{"version":3,"file":"index.cjs","names":["noop","sleep","Query","getDefaultState","noop","noop","Query","QueryClient","noop","datasetGet","datasetSet","dataflowExecuteLaunch","e3DatasetList","datasetListAt","workspaceStatusSince","pollRequestOptions","QueryClient","variant","ApiError","blobEqual","equalFor","BlobType","onClearKept","variant","blobEqual","equalFor","BlobType","EastTypeType","SortedMap","compareFor","toEastTypeValue","PatchType","decodeBeast2For","encodeBeast2For","applyFor","diffFor","EastError","fromEastTypeValue","East","TreePathType","some","none","OptionType","DataBindModeType","DataBindPrimitives","NullType","BooleanType","DatasetStatusType","ConflictError","bindPlatformFn","registerReactiveTracker","registerPlatformImplementation","nestedSpanName","INDEXED_ROWS_SUFFIX","RECORD_SLICE_DATA_MARK","parseFor","printFor","StructType","fromEastTypeValue","DictType","ArrayType","IndexedEntryType","entriesRowsName","indexWindowType","NullType","NestedSpanKeyType","RecordSummaryTotalsType","toEastTypeValue","variant","none","some","isTypeEqual","DataIndexedPrimitives","bindIndexedPagedPlatformFn","printType","East","TreePathType","BooleanType","StringType","IntegerType","OptionType","SeekQueryType","SeekRangeType","workspaceRecordDescribe","workspaceRecordMutate","none","workspaceRecordHistory","variant","transportError","isTypeValueStructurallyEqual","encodeBeast2For","RecordBindPrimitives","decodeBeast2For","some","fromEastTypeValue","East","StringType","NullType","StructType","recordBindPlatformFn","toEastTypeValue","ConflictError","registerReactiveTracker","registerPlatformImplementation","registerSettledSources","sha256Hex","MAX_LANDED_SEARCHES","fromEastTypeValue","SortedMap","compareFor","SortedSet","DatasetHashMismatchError","some","none","decodeBeast2For","printFor","parseFor","SortedMap","compareFor","fromEastTypeValue","some","none","none","some","DATASET_BATCH_MAX","decodeBeast2For","datasetRowsType","fromEastTypeValue","RunsHashMismatchError","datasetGetPage","datasetFindKey","datasetFindKeys","datasetGetRows","datasetGetRuns","datasetPlace","datasetWithin","datasetGetStatus","none","DataPagedPrimitives","some","East","SeekQueryType","OptionType","SeekRangeType","SortedMap","compareFor","EastTypeType","fromEastTypeValue","TreePathType","StringType","BooleanType","IntegerType","NullType","bindPagedPlatformFn","bindPagedPinnedPlatformFn","parseFor","toEastTypeValue","DictType","registerReactiveTracker","registerPlatformImplementation","registerRecordSliceBatches","workspaceFunctionList","workspaceFunctionCall","variant","none","isTypeValueEqual","encodeBeast2For","decodeBeast2For","FuncBindPrimitives","some","fromEastTypeValue","StructType","East","StringType","NullType","OptionType","FuncStatusType","FuncErrorType","BooleanType","funcBindPlatformFn","toEastTypeValue","registerReactiveTracker","registerPlatformImplementation","noop","parseTypenames","get","set","namespaces","namespace","none","selector","Selection","array","array","selectorAll","Selection","matcher","Selection","Selection","sparse","constant","Selection","Selection","sparse","Selection","ascending","Selection","attrRemove","attrRemoveNS","attrConstant","attrConstantNS","attrFunction","attrFunctionNS","namespace","styleRemove","styleConstant","styleFunction","defaultView","classArray","textConstant","textFunction","lower","creator","creator","selector","remove","defaultView","Selection","selection_select","selection_selectAll","selection_selectChild","selection_selectChildren","selection_filter","selection_data","selection_enter","selection_exit","selection_join","selection_merge","selection_order","selection_sort","selection_call","selection_nodes","selection_node","selection_size","selection_empty","selection_each","selection_attr","selection_style","selection_property","selection_classed","selection_text","selection_html","selection_raise","selection_lower","selection_append","selection_insert","selection_remove","selection_clone","selection_datum","selection_on","selection_dispatch","selection_iterator","Selection","sourceEvent","nopropagation","select","noevent","defaultFilter","defaultTouchable","pointer","constant","extend","define","rgba","hsla","extend","hsl","degrees","K","t0","t1","lab","define","extend","degrees","hcl","A","B","C","D","degrees","cubehelix","define","extend","linear","constant","rgb","colorRgb","basis","basisClosed","value","value","zero","one","number","constant","number","rgb","string","date","numberArray","object","identity","identity","decompose","number","colorHsl","color","color","colorLab","colorHcl","color","colorCubehelix","color","get","set","create","timeout","set","get","interpolateNumber","interpolateRgb","interpolateString","namespace","interpolateTransform","interpolate","namespace","get","get","get","matcher","set","get","selector","get","selectorAll","get","style","set","interpolateTransform","interpolate","get","set","transition_select","transition_selectAll","transition_filter","transition_merge","transition_selection","transition_transition","transition_on","transition_attr","transition_attrTween","transition_style","transition_styleTween","transition_text","transition_textTween","transition_remove","transition_tween","transition_delay","transition_duration","transition_ease","transition_easeVarying","transition_end","easeCubicInOut","selection_interrupt","selection_transition","identity","identity","interpolateZoom","select","pointer","constant","clamp","select","drag","zoom","zoomIdentity","pointer","interpolate","interpolateZoom","transform","zoomTransform","initPrevValues","createStore","ReactExports","useSyncExternalStoreExports","identity","createStore","createContext","useContext","useMemo","jsx","jsxs","Fragment","forwardRef","shallow","useLayoutEffect","useEffect","useRef","useState","useCallback","selected","memo","index","createPortal","_arrayLikeToArray","_arrayWithHoles","_arrayWithoutHoles","_classCallCheck","_defineProperties","_toPropertyKey","_createClass","_createForOfIteratorHelper","_unsupportedIterableToArray","_defineProperty","_iterableToArray","_iterableToArrayLimit","_nonIterableRest","_nonIterableSpread","_slicedToArray","_toConsumableArray","_toPrimitive","_typeof","noop","i","f","y","p","a","x","T","K","f$1","css","noop$1","noop$2","createElement","parse$1","text","React","capitalize","styleCache","useId","config","parse","useRecipe","chakra","memo","Box","VStack","Text","memo","useToken","useMemo","_Fragment","Box","Text","useState","VStack","Field","HStack","Box","NativeSelect","Input","Textarea","Text","useMemo","Drawer","Portal","Tip","Tooltip","Portal","chakra","Box","Text","HStack","VStack","memo","Fragment","useMemo","useSlotRecipe","useState","navigator","number$1","number","ascending","descending","extend","requestAnimationFrame","copy","Element","topEndY","rightEndX","bottomEndY","leftEndX","normalize","val","define","newQuery","match","edgeVisibleViaNode","_jsons","_json","noop","x","y","identity","output","cytoscape","cytoscape","coseBilkent","useState","useRef","useCallback","useMemo","useRef","createContext","printFor","StructType","StringType","useMemo","QueryClient","EditingScope","QueryClientProvider","useContext","createContext","useRef","useState","useContext","useCallback","useSyncExternalStore","useMemo","_Fragment","useMemo","useCallback","useSyncExternalStore","useState","VIEWS","useState","useMemo","useCallback","_Fragment","Box","HStack","Input","Text","ReactFlow","Menu","Portal","memo","none","some","variant","Global","xyflowCss","Button","SegmentGroup","implementUIComponent","Ontology","OptionType","StringType","encodeBeast2For","decodeBeast2For","printFor","StructType","ArrayType","DiffBindingType","EastTypeValueType","StateRuntime","none","getRegisteredPlatformImplementations","fromEastTypeValue","East","DecisionBindPrimitives","DecisionType","NullType","judgementInputType","AnswerType","VerdictType","CommitStateType","toEastTypeValue","DecisionConstraintType","canonicalTypeValue","decisionBindPlatformFn","some","variant","registerPlatformImplementation","useMemo","useCallback","useSyncExternalStore","printFor","formatters","toEastTypeValue","NullType","defaultValue","some","variant","useRecipe","useMemo","useState","useRef","EastChakraIntegerInput","EastChakraFloatInput","EastChakraDateTimeInput","EastChakraSelect","none","EastChakraStringInput","Box","chakra","getSomeorUndefined","memo","useFormatters","Box","Text","_Fragment","compareValues","compareFor","FloatType","useRecipe","useState","useCallback","useMemo","chakra","EastChakraSelect","some","none","variant","useMemo","compareFor","DateTimeType","FloatType","keptRead","getSomeorUndefined","Row","memo","useSlotRecipe","useRecipe","useFormatters","useMemo","useState","useCallback","Box","Text","_Fragment","EastChakraComponent","useRef","useContainerBelow","usePersistedState","variant","boundSliceConfig","sliceMatches","SliceRailCluster","implementUIComponent","DecisionQueue","memo","useSlotRecipe","useFormatters","getSomeorUndefined","useMemo","Box","Text","ClauseChip","implementUIComponent","DecisionJournal","createContext","useContext","useMemo","createElement","useState","chakra","memo","useSlotRecipe","useSlotStyles","useRecipe","useFormatters","useId","useCallback","useMemo","createListCollection","Box","variant","SliceEditPopover","none","some","_Fragment","ChakraSelect","Portal","encodeBeast2For","StudioKeyType","decodeBeast2For","StateRuntime","useCallback","useSyncExternalStore","useMemo","equivalentFor","StudioPageComponent","keyEqual","equalFor","StudioKeyType","useCallback","useTrackedEvaluation","BannerView","EastChakraComponent","EmptyStateView","useMemo","SnapGridTiles","memo","implementUIComponent","useSlotStyles","useFormatters","useMemo","none","some","variant","EastChakraLibrary","Box","useSlotRecipe","useRecipe","useId","useState","SliceEditPopover","_Fragment","ChakraButton","chakra","Box","memo","useSlotRecipe","useState","ChakraButton","_Fragment","Box","memo","useSlotStyles","useRef","useContainerWidth","useState","chakra","Box","VisuallyHidden","useSlotStyles","useFormatters","useRef","useMemo","Box","memo","useSlotRecipe","useState","useCallback","chakra","_Fragment","ChakraButton","East","paletteCards","palettePages","canvasTiles","inspectorSelection","publishSummary","publishRefusal","libraryProjects","libraryPages","libraryTemplates","nameWriteRefusal","Studio","saveCells","compiled","ArrayType","StudioCellType","encodeBeast2For","decodeBeast2For","decodeBatch","Editing","toEastTypeValue","EditingDraftFieldType","keyEqual","equalFor","StudioKeyType","printKey","printFor","NOTHING_SELECTED","none","RANK_MORE","SNAP_GRID_HOST_RANK","MORE_BUNDLE","memo","useSlotRecipe","useFormatters","useMemo","builderKeys","useCallback","useTrackedEvaluation","useState","variant","useRef","useContainerWidth","NARROW_FRAME","some","ChipMenu","ChakraMenu","ChakraHStack","Box","ChakraButton","BannerView","EmptyStateView","SnapGridEditor","implementUIComponent","StudioBuilderComponent","RANK","SORTS","SortMenu","ChakraMenu","chakra","_Fragment","Box","Portal","memo","useSlotRecipe","useRecipe","useFormatters","useId","useMemo","builderKeys","useCallback","useTrackedEvaluation","useState","some","SnapGridTiles","none","variant","createListCollection","ChakraSelect","LibraryLayoutSwitch","BannerView","Toolbar","EastChakraLibrary","implementUIComponent","StudioLibraryComponent","library","fas","INSET","GAP","samePlace","keyOf","sameText","Box","chakra","Tooltip","Portal","memo","useSlotStyles","useSlotRecipe","useMemo","useId","useCallback","useState","useRef","createPortal","NeverType","isTypeEqual","OptionType","rowOf","kindOf","elementOf","IDENTITY","variant","none","some","BooleanType","FloatType","IntegerType","NullType","StringType","variant","slotAt","narrowingOf","IDENTITY","printJq","checkJq","parseJq","ArrayType","IntegerType","IDENTITY","printJq","isValueOf","printFloat","printFor","FloatType","printBoolean","BooleanType","valueText","plainKind","place","variant","COMPARISON","PLACEHOLDER","capital","WHOLE","variant","some","none","plural","countWords","placeOf","fixLabel","durationWords","planWords","summaryProgram","equalFor","ArrayType","DataSourceType","printFor","SavedQueryType","parseFor","savedEqual","useDataStable","useMemo","variant","queryRoot","createContext","createElement","useContext","oneShotCall","oneShotExecute","splitCall","splitCallExplain","collectionOpen","pathToString","datasetGetStatus","QueryClientContext","useState","prepareQuery","queryResultOf","decodeBeast2","isValueOf","SummaryType","usePersistedState","keptRead","useCallback","plural","NO_STATUSES","memo","useQueries","useMemo","fromEastTypeValue","none","some","EastChakraLibrary","useDragLayerOptional","useSlotRecipe","queryKeys","useState","useCallback","useMemo","useDropCell","_Fragment","Box","Box","VStack","LoadingIcon","Text","Code","Clipboard","IconButton","pollRequestOptions","useMemo","variant","useQuery","datasetGetStatus","StateImpl","SliceImpl","RecordSliceImpl","SliceApplyImpl","OverlayImpl","ClipboardImpl","DownloadImpl","ShareImpl","useQueryClient","useMemo","variant","useQuery","datasetGet","decodeBeast2For","useCallback","useQuery","datasetList","datasetListAt","datasetListRecursive","datasetListRecursivePaths","datasetListWithStatus","datasetGetStatus","datasetGet","useMutation","datasetSet","parseKeyInput","partsOf","useState","ApiError","EastError","variant","some","none","formatters","useState","Button","memo","useFormatters","keepPreviousData","useQueryClient","useRef","useCallback","encodeBeast2For","useMemo","keyRangePredicates","parseFor","compareFor","ValueTree","Flex","Text","DatasetKeySearch","Box","EastChakraValueTree","useRef","useReducer","useCallback","pruneRetainedPages","debugFlag","MAX_RETAINED_PAGES","ValueTree","variant","memo","useFormatters","useQueryClient","useState","useRef","useCallback","datasetGetPage","DatasetHashMismatchError","ApiError","decodeBeast2For","useMemo","datasetFindKey","none","some","Flex","Text","DatasetKeySearch","Box","EastChakraValueTree","library","fas","textEqual","equalFor","StringType","useSlotRecipe","useRecipe","slotKey","Tooltip","Portal","chakra","memo","useState","useRef","Box","Button","Parts","Fragment","compareKeys","compareFor","StringType","printFor","BooleanType","NullType","BlobType","rowsOf","elementOf","cellText","isPrimitiveType","plural","variant","none","some","SortedMap","cellOf","toEastTypeValue","decodeBeast2For","fromEastTypeValue","useCallback","useMemo","memo","useSlotRecipe","useState","useMemo","planWords","SliceEditPopover","chakra","Box","RANK_VIEW","describeJqType","countWords","memo","useSlotRecipe","useRef","useState","useMemo","ValueTree","none","some","Box","EastChakraTable","EmptyStateView","Skeleton","_Fragment","EastChakraValueTree","Toolbar","toEastTypeValue","useCallback","useRecipe","Button","chakra","CloseButton","ChakraMenu","Portal","OptionType","StringType","StructType","cellText","some","none","encodeCsvFor","encodeBeast2For","countWords","slot","isTypeEqual","countWords","describeJqType","plural","variant","some","toQuerySpan","refOf","none","SortedMap","compareFor","StringType","parseJq","checkJq","East","Query","textEqual","equalFor","StringType","StructType","StringType","OptionType","VariantType","QueryStepType","ArrayType","toEastTypeValue","EditingDraftFieldType","encodeBeast2For","decodeBeast2For","Editing","equalFor","SavedQueryType","compareFor","variant","printJq","some","none","pathToString","checkJq","prepareQuery","SortedMap","East","lessFor","DateTimeType","WEEK_MS","checkJq","nameEqual","equalFor","StringType","runEqual","SavedQueryType","memo","useSlotStyles","useState","useCallback","useMemo","none","some","variant","Box","chakra","_Fragment","BannerView","EastChakraLibrary","VariantType","StructType","StringType","OptionType","SavedQueryType","encodeBeast2For","decodeBeast2For","printString","printFor","started","variant","none","some","StateRuntime","useCallback","useSyncExternalStore","useMemo","AT_END","memo","useRecipe","Box","chakra","slotKey","Button","RANK","lexJq","keepFocus","memo","useSlotRecipe","useMemo","useId","useRef","useState","useCallback","completeJq","plural","Box","chakra","Kbd","Button","memo","Box","Button","slotKey","memo","Box","memo","Box","Parts","useState","useRef","useCallback","Button","useSlotRecipe","ChipMenu","ChakraMenu","Box","chakra","Kbd","FLOOR_RANK","memo","useSlotRecipe","useMemo","Box","Toolbar","BannerView","_Fragment","Fragment","memo","useSlotStyles","useState","useMemo","planWords","Box","chakra","SliceEditPopover","_Fragment","Button","mapStep","variant","none","some","updateTest","isTypeEqual","SortedMap","compareFor","StringType","placeOf","narrowingOf","readNumber","parseFor","FloatType","variant","isTypeEqual","plural","equalFor","QueryStepValueType","some","none","SortedMap","compareFor","StringType","Box","Button","slotKey","chakra","useSlotStyles","Fragment","memo","useState","useRef","BannerView","_Fragment","parseJq","printJq","decodeBeast2","fromEastTypeValue","messageOf","ApiError","AuthError","weighPlan","useState","useRef","useCallback","draftPlan","queryResultOf","createContext","useContext","useMemo","createElement","useFormatters","editingMessages","OptionType","StringType","equivalentFor","equalFor","memo","useSlotRecipe","useRecipe","useId","useState","useCallback","some","none","_Fragment","Box","chakra","memo","useSlotRecipe","Box","_Fragment","describeJqType","useMemo","useState","useRef","useCallback","some","none","checkJq","slotKey","StateRuntime","useState","useCallback","useMemo","useRef","variant","some","none","useEditSession","payloadEquivalent","equivalentFor","QueryBuilderPayloadType","nameEqual","equalFor","StringType","sessionErrorText","memo","useMemo","queryKeys","useCallback","useTrackedEvaluation","variant","none","BannerView","EmptyStateView","useSlotRecipe","useState","useRef","useContainerWidth","NARROW_FRAME","usePersistedState","keptRead","checkJq","typedInto","historyShortcut","Button","historyToolbarItem","Box","BuilderFrame","_Fragment","SessionBanners","LoadingLine","implementUIComponent","QueryBuilderComponent","iconLibrary","fas","payloadEquivalent","equivalentFor","QueryLibraryPayloadType","equalFor","StringType","SavedQueryType","compareFor","DateTimeType","EMPTY_ICON","ChakraMenu","chakra","_Fragment","Box","Portal","memo","useCallback","useTrackedEvaluation","BannerView","useSlotRecipe","useRecipe","useId","useMemo","queryKeys","variant","none","useState","some","fromEastTypeValue","LibraryLayoutSwitch","Toolbar","EmptyStateView","EastChakraLibrary","implementUIComponent","QueryLibraryComponent","getSomeorUndefined","fieldBreachIssue","NO_BREACHES","decodeBeast2For","fieldBreaches","sameType","isTypeValueEqual","toEastTypeValue","IDLE","useDataStable","useMemo","FuncBindHandleType","useSyncExternalStore","useCallback","usePersistedState","keptRead","useState","useRef","useCallback","useMemo","useState","useRef","useCallback","useMemo","optimiseToolbarItem","OptimiseEntry","OptimiseBanner","optimiseRunningLine","optimiseStoppedLine","loadingMessages","loadingLineText","none","none","some","variant","KEY_ORDER","ABSENT","NO_ENTRY","NO_RANGE","NO_LANDED","compareString","compareFor","StringType","stringEqual","equalFor","blobEqual","BlobType","parseFor","IntegerType","SortedMap","NO_DRAFTS","rowOf","isVariant","sameDrafts","useRef","useMemo","fromEastTypeValue","OptionType","encodeBeast2For","decodeBeast2For","prepareRecordSliceSave","historyKeyOf","wholeEntryReadiness","boundedReadiness","fieldBreaches","drawnFromKeys","randomKeys","madeFromKeys","nextIntegerKeys","onceKeys","pastKeys","EntryRefType","useEditHistory","useCallback","useTrackedEvaluation","createContext","stringEqual","equalFor","StringType","useState","useRef","useCallback","useMemo","useContext","FrameDrawer","FramePane","DockTab","NOTHING_READ","useMemo","_Fragment","compareString","compareFor","StringType","EMPTY","some","SortedSet","useMemo","PagedScan","useCallback","snapshotOf","none","useTrackedEvaluation","useRef","useMemo","narrowedCount","stringEqual","equalFor","StringType","NO_ROWS","useMemo","none","some","useRef","useCallback","_Fragment","compareString","compareFor","StringType","Fields","StructType","fromEastTypeValue","printFor","parseFor","defaultValue","toEastTypeValue","some","none","variant","isVariant","plural","printWhere","printFor","RecordSliceWhereType","stringEqual","equalFor","StringType","compareString","compareFor","SortedMap","WHOLE_RECORD","recordPlanIndex","recordChoiceWhere","recordChoiceLabel","useState","useRef","useCallback","awaitTracked","recordSliceWithin","none","some","recordSlicePage","recordSliceRows","useMemo","recordSliceRevision","useTrackedEvaluation","useSliceReactivity","hiddenOf","useMemo","_Fragment","usePickHandOff","useRef","useState","useCallback","NONE","compareDateTime","compareFor","DateTimeType","compareString","StringType","ScheduleResourceRefType","printFor","ScheduleEventRefType","SortedMap","stringEqual","equalFor","StringType","spellOut","Box","useState","DAY_MS","compareDateTime","compareFor","DateTimeType","match","HOUR_MS","DAY_MS","DAY","weekStart","printFor","ScheduleEventRefType","ScheduleResourceRefType","parseFor","DateTimeType","sameResource","equalFor","compareDate","compareFor","compareString","StringType","DAY","weekStart","inWindow","resourceChoices","SortedSet","onResource","dateText","compareDate","compareFor","DateTimeType","none","variant","fromEastTypeValue","encodeBeast2For","some","stringEqual","equalFor","StringType","compareString","compareFor","variant","printFor","OptionType","DateTimeType","none","SortedMap","useMemo","useSlicesReactivity","useCallback","some","useTrackedEvaluation","stringEqual","equalFor","StringType","printWhere","printFor","RecordSliceWhereType","EVER","MAX_SERVED","codecs","encodeBeast2For","fromEastTypeValue","recordSliceRevision","none","some","recordSlicePage","stringEqual","equalFor","StringType","stringEqual","equalFor","StringType","sameTypeValue","EastTypeType","parseInstant","parseFor","DateTimeType","fromEastTypeValue","encodeBeast2For","decodeBeast2For","variant","isVariant","none","some","stringEqual","equalFor","StringType","sameRows","StructType","DateTimeType","OptionType","FloatType","DictType","StringType","ArrayType","compareString","compareFor","stringEqual","equalFor","sameNarrowing","blobEqual","BlobType","shadingEqual","ScheduleDraftsType","printFor","SeekQueryType","printWhere","RecordSliceWhereType","some","SCHEDULE_EVENT_CAP","none","shadesOf","hatchOf","READING","NO_RESOURCES","NONE_CAPPED","NO_ROWS","NO_IDS","NO_REVISIONS","NONE_WINDOWED","NO_VIEW","sameKeys","sameRange","cellText","tilingOf","RecordSliceChoiceType","tileOf","recordSliceRevision","SortedMap","fromEastTypeValue","parseFor","encodeBeast2For","decodeBeast2For","recordSliceCellEntries","levelCellQueries","recordSliceCellRuns","sameRevisions","recordSliceRows","recordSliceWithin","tileIndexFor","levelRuns","MAX_RECORD_SLICE_BATCH","summaryRun","summaryCellQueries","readBeforeSaves","sameRead","useState","useCallback","useTrackedEvaluation","useRef","useMemo","stringEqual","equalFor","StringType","readFailure","entryLookup","none","isEmpty","offsetOfWindow","documentHeight","elementAtOffset","slotHeight","travelOf","advance","unpinAll","pin","stringEqual","equalFor","StringType","sameNarrowing","reasonOf","sameWindows","NO_WINDOWS","NO_FAILURES","useSyncExternalStore","useState","useMemo","some","useCallback","useTrackedEvaluation","useRef","stringEqual","equalFor","StringType","tileStart","tileNext","useMemo","useCallback","useKept","keptJson","NOT_KEPT","CalendarLayoutType","CalendarPeriodType","LAYOUTS","CalendarLayoutType","PERIODS","recordSliceWindow","useMemo","useSlicesReactivity","useState","recordSliceSeeded","DAY","compareDate","compareFor","DateTimeType","compareString","StringType","NO_DRAFTS","SortedMap","SortedSet","equalFor","SetType","EVER","reasonOf","useMemo","useCallback","none","some","useTrackedEvaluation","useRef","NOTHING","NO_VIEW","useSyncExternalStore","KEY_TYPE","toEastTypeValue","StringType","keyEqual","equalFor","createContext","useSliceReactivity","useCallback","awaitTracked","toSeekQuery","recordSliceWithinAt","useTrackedEvaluation","Box","DatasetKeySearch","useContext","number","number","HOUR_MS","DAY_MS","formatters","periodOf","dateTimeSlot","formatDatePattern","none","some","StructType","DateTimeType","OptionType","StringType","Fields","some","none","useFormatters","useMemo","fieldFormMessages","resourceChoices","useCallback","FieldForm","useState","SliceEditPopover","Button","_Fragment","Box","templatesTab","useFormatters","useState","some","none","narrowedCount","Box","PagedLibrary","EastChakraLibrary","Button","compareFor","DragEventType","useRef","useCallback","useFormatters","useMemo","some","none","SortedMap","DAY","dropEvent","keyEqual","equalFor","StringType","createContext","useContext","KEY_TYPE","toEastTypeValue","StringType","keyEqual","equalFor","compareFor","WHOLE","BROWSE_QUERY","awaitTracked","recordSliceRows","none","some","recordSliceWithin","findKeyInline","runsAt","useRef","useCallback","toSeekQuery","recordSliceSeek","recordSlicePage","recordSliceWithinAt","hiddenOf","recordSliceRevision","useTrackedEvaluation","useState","useMemo","useRef","useFooterFit","useRevealed","useSlotClass","Box","footerCut","OptimiseLegendItem","FooterMore","RecordSliceSaveNotice","LoadingLine","useRef","useCallback","Box","isVariant","stringEqual","isValueOf","OptionType","StringType","itemEqual","equalFor","Schedule","rowEqual","BlobType","sameSelection","useCallback","useTrackedEvaluation","useRef","useSlotRecipe","useMemo","useDeferredValue","Box","memo","_Fragment","OneEvent","useFormatters","fromEastTypeValue","decodeBeast2For","resourceChoices","Fields","some","Button","BannerView","FieldForm","EastChakraComponent","useState","StructType","none","editingMessages","printFor","parseFor","equalFor","encodeBeast2For","typesOf","fromEastTypeValue","StringType","scheduleOptimiseRows","ScheduleOptimiseRequestTypeFor","ScheduleOptimiseResultTypeFor","SortedMap","compareFor","decodeBeast2For","DictType","stringEqual","equalFor","StringType","followedSources","useSlotRecipe","useMemo","Box","chakra","useRecipe","ChakraMenu","coarseHitArea","FrameMenuLayer","NO_DATES","monthStart","useFormatters","useSlotStyles","useState","weekStart","useMemo","DAY","_Fragment","Button","SliceEditPopover","Box","chakra","LAYOUTS","PERIODS","kindOfIssue","useRecordSlicesToolbarItems","RecordSliceFieldEditor","useRecipe","useKeySearchToolbarItem","chakra","coarseHitArea","ChipMenu","_Fragment","ChakraMenu","Button","HOST_RANK","Box","historyToolbarItem","some","SLACK","useState","NOTHING","memo","Box","useRef","useCallback","useSyncExternalStore","HOUR_MS","DAY_MS","LANE_GAP","HOUR","DAY","usePersistedState","keptRead","useCallback","chakra","Box","useSlotClass","sameText","equalFor","StringType","keptRead","useRef","useState","useCallback","useRef","useCallback","dateText","previousWords","useSlotClass","optimiseMessages","keptRead","_Fragment","PlaceholderShape","useState","LoadingFailedBox","booked","onResource","tileNext","Box","keyOf","createContext","sameFits","itemEqual","equalFor","Schedule","memo","useMemo","none","useDragEventChip","useRef","useCallback","useContext","useDragEventEdge","useDragMessages","sameResource","useDropCell","useSurfaceGestures","loadingLineText","chakra","inWindow","DAY","LoadingWash","Fragment","MonthGrid","placeKey","useRowsTop","LoadingFailedLine","slotOf","UnloadedRun","devicePixels","VirtualRows","Agenda","Button","NO_JOINED","NO_ITEMS","NO_ANCHOR","none","NO_ROWS","CLICK_FOCUS","NO_DRAFTS","SortedMap","compareFor","StringType","stringEqual","equalFor","sameCount","useCallback","PAGED_LIBRARY_PAGE","useTrackedEvaluation","useRef","NO_BREACHES","sameBreaches","useMemo","fromEastTypeValue","fieldBreachIssue","some","useSlotRecipe","useFormatters","useContainerBelow","useState","usePersistedState","inWindow","useLanding","useLandingStyles","optimiseMessages","templatesTab","typedInto","Box","LoadingReveal","BuilderFrame","historyShortcut","_Fragment","SessionBanners","BannerView","Button","followedSources","implementUIComponent","CalendarComponent","useSlicesReactivity","useState","recordSliceWindow","periodOf","ROSTER_LAYOUT_PERIODS","DAY","weekStart","compareDate","spanWords","equalFor","RosterSlotType","printFor","parseFor","DateTimeType","compareFor","compareString","StringType","samePlace","RosterPlaceType","OptionType","placeKey","placeOf","some","RosterWhoType","RosterRequirementType","sameBytes","BlobType","StructType","East","IntegerType","RosterShiftType","rosterShiftStart","sameTypeValue","EastTypeType","domains","fromEastTypeValue","RosterAssignmentTypeFor","RosterWeekTypeFor","encodeBeast2For","decodeBeast2For","rosterPlacement","rosterCoverage","rosterCheck","rosterWeekHours","RosterPayRequestTypeFor","DictType","RosterCheckContextTypeFor","RosterFitRequestTypeFor","referenceCheckEncoders","rosterDayOf","rosterMove","rosterNewDuty","placeStored","SortedMap","placeDrafted","NO_PERIOD","variant","SortedSet","started","editableStatus","none","plural","statusText","GRAPHEMES","configError","PERIODS","NO_JOINED","parseFor","DateTimeType","useMemo","useRef","sameBytes","equalFor","BlobType","OptionType","ScheduleResourceRefType","StringType","NO_TARGETS","compareDate","none","some","PERIODS","samePlace","variant","placeOf","equalFor","StringType","sameType","EastTypeType","sameBytes","BlobType","byKey","compareFor","useMemo","SCHEDULE_REFERENCE","SortedMap","decodeBeast2For","fromEastTypeValue","sameBytes","equalFor","BlobType","samePicker","DictType","DateTimeType","RosterStatusType","NO_DUTIES","NO_STATUSES","SortedMap","compareDate","compareString","useRef","useCallback","DAY","useTrackedEvaluation","useMemo","VariantType","StringType","printFor","parseFor","variant","parseDay","parseFor","IntegerType","printFor","printGroup","OptionType","StringType","StructType","Fields","DutyForm","DateTimeType","RosterRequirementType","FloatType","some","none","useFormatters","DAY","FieldForm","useState","Button","SliceEditPopover","_Fragment","Box","useMemo","Chooser","SortedMap","compareString","Box","WHOLE","none","some","compareFor","FloatType","reasonOf","useFormatters","useState","useMemo","DAY","variant","placeOf","narrowedCount","entries","SliceFieldChip","EastChakraLibrary","Button","StructType","StringType","DateTimeType","printFor","parseFor","OptionType","placeKey","useDragMessages","useMemo","some","none","variant","compareDate","SortedMap","samePlace","compareString","dropEvent","KEY_TYPE","toEastTypeValue","StringType","compareKey","compareFor","keyEqual","equalFor","BROWSE_QUERY","findKeyInline","useRef","useCallback","hiddenOf","useMemo","useRef","useReducer","useCallback","StructType","RosterNeedType","RosterSlotType","printFor","equalFor","sameContext","RosterContextType","useDataStable","useMemo","RosterFitResultType","legendOf","useRef","useFooterFit","useRevealed","Box","footerCut","OptimiseLegendItem","FooterMore","RecordSliceSaveNotice","LoadingLine","EPSILON","none","some","keptRead","createContext","useState","useMemo","useRef","PlaceholderShape","ReadFailure","LoadingFailedLine","tickFormatOf","variant","NO_ISSUES","samePlace","Box","_Fragment","useContext","useDragEventChip","useCallback","useDropCell","memo","chakra","none","placeKey","Button","placeOf","DAY","Fragment","some","ANCHOR_EVERY_ROW","devicePixels","fillOf","px","ChakraMenu","FrameMenuLayer","useRowsTop","SortedMap","usePersistedState","printFor","ArrayType","StringType","VirtualRows","useRevealed","keyEqual","equalFor","StringType","fixLabel","_Fragment","Box","chakra","Button","DAY","useCallback","useTrackedEvaluation","useMemo","EastChakraComponent","FieldForm","samePlace","BannerView","placeOf","Summary","plural","Details","some","DetailsTab","useSlotRecipe","PlaceholderShape","editingMessages","NO_ROWS","SortedMap","compareString","RosterOptimiseRequestTypeFor","RosterOptimiseResultTypeFor","compareDate","SortedSet","StringType","optimiseMessages","Box","_Fragment","LAYOUTS","EYE_INTO_VIEW","useRecordSlicesToolbarItems","useRecipe","useKeySearchToolbarItem","ROSTER_LAYOUT_PERIODS","useState","_Fragment","ChakraMenu","ChipMenu","Box","Button","DAY","HOST_RANK","OPTIMISE_RANK","PlaceholderShape","chakra","coarseHitArea","historyToolbarItem","LAYOUTS","RosterLayoutType","periodOf","RosterPeriodType","useMemo","weekStart","DAY","useCallback","useRef","compareDate","NO_DATES","NO_PERIOD_DRAFTS","NO_STORED","NO_ISSUES","equalFor","RosterContextType","sameIssues","ArrayType","RosterIssueType","NO_ANCHOR","keptRead","keyEqual","StringType","CLICK_FOCUS","periodOf","NO_PERIOD","editableStatus","useMemo","useState","useDataStable","useRef","useCallback","placeStored","compareDate","placeDrafted","useContainerBelow","useSlotRecipe","useFormatters","variant","fieldBreachIssue","none","some","useTrackedEvaluation","useLanding","useLandingStyles","optimiseMessages","SCHEDULE_REFERENCE","spanWords","usePersistedState","typedInto","isVariant","DAY","weekStart","started","Box","LoadingReveal","BuilderFrame","historyShortcut","_Fragment","SessionBanners","BannerView","Button","configError","implementUIComponent","RosterComponent","printFor","DateTimeType","parseFor","compareFor","compareString","StringType","compareFloat","FloatType","equalFor","ScheduleAllocationRolesType","sameBytes","BlobType","EastTypeType","fromEastTypeValue","AllocationDayTypeFor","encodeBeast2For","decodeBeast2For","AllocationBinTypeFor","East","allocationBinOf","AllocationCheckContextTypeFor","allocationLoads","allocationCheck","allocationSlots","allocationCandidates","AllocationFitRequestTypeFor","allocationQuantityText","allocationLoadText","allocationResourceLine","allocationMilliseconds","SortedMap","DictType","variant","statusText","DAY","weekStart","PERIODS","keyEqual","equalFor","StringType","getSomeorUndefined","NO_JOINED","useMemo","DAY","useRef","counted","createContext","useContext","compareFloat","some","SortedMap","compareString","none","variant","PERIODS","keyEqual","equalFor","StringType","createContext","useContext","useRef","CHECKING","compareString","formatDatePattern","compareFloat","none","counted","targetOf","variant","rankOf","compareFloat","codeOf","nameOf","formatDatePattern","landing","refused","useDragLayerOptional","useMemo","useState","some","useRef","useDragMessages","LAYOUTS","plural","useRecordSlicesToolbarItems","useRecipe","useKeySearchToolbarItem","useState","Box","Button","ChipMenu","ChakraMenu","_Fragment","counted","chakra","HOST_RANK","OPTIMISE_RANK","PlaceholderShape","coarseHitArea","historyToolbarItem","DAY","DAY_MS","formatDatePattern","timeText","nameOf","counted","compareString","rankOf","compareFloat","SortedMap","compareFor","StringType","printFor","StructType","RecordSliceWhereType","Box","EmptyStateView","Button","StructType","FloatType","useSlotRecipe","useMemo","useState","compareFloat","variant","Fields","useCallback","SliceEditPopover","Box","FieldForm","Chooser","ROW_H","useRowsTop","Box","LoadingFailedLine","PlaceholderShape","useMemo","useCallback","useTrackedEvaluation","useState","useRef","_Fragment","VirtualRows","useDragEventChip","useDropCell","memo","formatDatePattern","compareFloat","chakra","SliceEditPopover","Chooser","variant","LoadingFailedLine","useMemo","useState","useCallback","Box","VirtualRows","useRowsTop","chakra","PlaceholderShape","Button","_Fragment","variant","compareFloat","formatDatePattern","sameBytes","equalFor","BlobType","DictType","DateTimeType","SchedulePeriodStatusType","printWhere","printFor","RecordSliceWhereType","StringType","SortedMap","compareString","useRef","useCallback","DAY","useTrackedEvaluation","useMemo","KEY_TYPE","toEastTypeValue","StringType","keyEqual","equalFor","WHOLE","BROWSE_QUERY","formatDatePattern","useRef","useCallback","awaitTracked","recordSliceSeek","toSeekQuery","recordSlicePage","none","recordSliceRevision","useTrackedEvaluation","useState","useMemo","printFor","AllocationFitAskType","useMemo","AllocationFitResultType","useRef","useFooterFit","useRevealed","Box","footerCut","OptimiseLegendItem","FooterMore","LoadingLine","rowOf","useMemo","hiddenOf","DAY","StructType","StringType","DateTimeType","FloatType","NO_EDIT","OptionType","plural","formatDatePattern","keyEqual","equalFor","useSlotRecipe","useMemo","Box","_Fragment","BannerView","useDropCell","Button","compareFloat","Fragment","useCallback","landing","getSomeorUndefined","Fields","chakra","useFormatters","fieldFormMessages","fieldBreachText","FieldForm","RowFields","useTrackedEvaluation","useRef","EastChakraComponent","variant","Chooser","some","none","PlaceholderShape","DAY_MS","formatDatePattern","compareString","counted","compareFloat","useMemo","useFormatters","none","some","useCallback","_Fragment","Box","Button","EastChakraLibrary","narrowedCount","SliceFieldChip","editingMessages","AllocationOptimiseRequestTypeFor","AllocationOptimiseResultTypeFor","SortedMap","compareString","formatDatePattern","StringType","optimiseMessages","compareFloat","CORNER_R","f","HALO_OUT","HALO_R","useState","useRef","useId","KNOCKOUT_RISE","_Fragment","chakra","useCallback","useSyncExternalStore","compareString","compareFloat","NO_ISSUES","NO_GHOSTS","formatDatePattern","plural","useDropCell","Box","LoadingWash","useMemo","useCallback","useRef","useState","useContainerBelow","PlaceholderShape","_Fragment","counted","LoadingFailedLine","LoadingEmptyLine","VirtualRows","useSyncExternalStore","createContext","useContext","useDragEventChip","memo","compareFloat","chakra","useRevealed","DAY","AllocationLayoutType","useMemo","DAY","readTab","keptRead","NO_STORED","NO_ISSUES","keyEqual","equalFor","StringType","ArrayType","AllocationIssueType","useMemo","useState","useCallback","usePersistedState","useRef","useContainerBelow","useSlotRecipe","useSlotStyles","useFormatters","none","useDataStable","variant","fieldBreachIssue","some","useTrackedEvaluation","useLanding","useLandingStyles","optimiseMessages","SortedMap","compareString","compareFloat","typedInto","SCHEDULE_REFERENCE","isVariant","formatDatePattern","statusText","Box","LoadingReveal","BuilderFrame","historyShortcut","_Fragment","SessionBanners","BannerView","Button","DAY","implementUIComponent","AllocationComponent","createContext","useContext","plural","joined","editingMessages","pluralName","getSomeorUndefined","createContext","useContext","useMemo","createElement","formatters","createContext","useLocale","useMemo","useContext","printFor","Plan","parseFor","equalFor","Plan","printFor","DateTimeType","FloatType","parseFor","variant","some","none","getSomeorUndefined","variant","getSomeorUndefined","some","none","getSomeorUndefined","variant","instantEqual","equalFor","Plan","ArrayType","some","none","indexRows","createContext","useContext","useRef","useSyncExternalStore","useCallback","rowsOf","createContext","useContext","useRef","useCallback","dateTimeSlot","numberSlot","stringSlot","createContext","useContext","NOTHING","noSubscribe","useSyncExternalStore","useMemo","useDragEventChip","useDragEventEdge","useCallback","some","variant","none","useRef","useCallback","useMemo","constant","bisect","interpolateValue","interpolateNumber","interpolateRound","formatDecimal","formatRounded","formatPrefixAuto","identity","formatGroup","formatNumerals","formatTypes","formatTrim","exponent","formatLocale","exponent","exponent","exponent","precisionPrefix","precisionRound","precisionFixed","interpolateLab","interpolateHcl","interpolateHclLong","interpolateHsl","interpolateHslLong","interpolateCubehelix","interpolateCubehelixLong","interpolateRgb","timeSecond","timeWeek","utcSecond","utcWeek","interpolateRound","domain","nice","zero","interpolate","round","align","base","clamp","constant","exponent","padding","range","reverse","unknown","scaleLinear","axisTicks","scaleLinear","formatters","tickFormatter","spanText","elementKeyOf","NOTHING","parseRef","parseFor","ScheduleEventRefType","createContext","noSubscribe","useContext","useSyncExternalStore","useCallback","Box","_Fragment","useChakraContext","useMemo","useRef","useCallback","getSomeorUndefined","useDragLayerOptional","useSyncExternalStore","useDropCell","resolveColor","LoadingWash","slot","useMemo","_Fragment","loadingLineText","Box","UnloadedRun","EastErrorBoundary","Box","DAY_MS","timeMs","tickFormatter","getSomeorUndefined","variant","stringEqual","equalFor","StringType","elementKeysOf","toEastTypeValue","NullType","none","pagedSourceEquivalent","equivalentFor","Plan","equalFor","NO_ROWS","NO_IDS","NO_DRAFTS","entryOf","StringType","printFor","parseFor","DateTimeType","useMemo","some","windowedSourceOf","encodeBeast2For","decodeBeast2For","PLAN_PAGE_SIZE","useRef","wholeEntryReadiness","fromEastTypeValue","recordSliceReadEntries","prepareRecordSliceSave","useEditSession","EntryRefType","historyKeyOf","standingBeforeSave","variant","kindOfIssue","useCallback","useTrackedEvaluation","useState","useMemo","parseFor","ScheduleEventRefType","printRef","printFor","ScheduleResourceRefType","NOTHING_READ","useMemo","useCallback","useTrackedEvaluation","useRef","stringEqual","equalFor","StringType","compareDateTime","compareFor","DateTimeType","printRef","printFor","ScheduleEventRefType","printResource","ScheduleResourceRefType","LIBRARY_SIZE","PENDING_CARD_PX","NONE_FOLLOWED","WHOLE","none","NO_PATCH_KINDS","tabLibrary","templatesTab","narrowingOf","Box","useSlotStyles","useCallback","some","useMemo","libraryOf","getSomeorUndefined","card","narrowedCount","useState","EastChakraLibrary","PlaceholderCard","EmptyStateView","SliceDensityContext","EastChakraPickPanel","DRAWS","NONE_MINTED","NO_ENTRY","MINUTE_MS","stringEqual","equalFor","StringType","DateTimeType","resourceEqual","OptionType","ScheduleResourceRefType","parseRef","parseFor","ScheduleEventRefType","printRef","printFor","refused","useRef","useMemo","tabLibrary","some","none","variant","getSomeorUndefined","VisuallyHidden","variant","getSomeorUndefined","_Fragment","Box","Box","NONE","createContext","useContext","NONE","createContext","useContext","NONE","createContext","useContext","useMemo","variant","Box","_Fragment","x","pointX","y","pointY","constant","curveLinear","pointX","constant","pointY","curveLinear","line","d3Area","line","d3Line","_excluded","_extends","_objectWithoutPropertiesLoose","line","React","cx","_excluded","_extends","_objectWithoutPropertiesLoose","React","cx","cx","_Fragment","Box","VisuallyHidden","useMemo","useRef","useCallback","curveLinear","Box","chakra","axisTicks","_Fragment","useRef","useContext","useSyncExternalStore","useState","useCallback","Box","ChakraMenu","chakra","FrameMenuLayer","useChakraContext","variant","useMemo","Box","resolveColor","_Fragment","useContext","useMemo","variant","Box","_Fragment","useMemo","variant","Box","_Fragment","useCallback","useSyncExternalStore","typedText","DAY_MS","NUMBER_FORMAT","INTEGER_FORMAT","useState","useRef","Box","ChakraNumberInput","heightOf","useState","equalFor","FloatType","useRef","useMemo","typedText","Popover","frameBounds","Portal","_Fragment","Box","variant","_Fragment","optimiseMessages","Box","getSomeorUndefined","memo","useMemo","Box","EastChakraComponent","LoadingWash","useMemo","Box","useRef","useCallback","PlaceholderShape","Box","selectScroll","Box","PlaceholderCard","PlaceholderShape","useMemo","useState","useRef","useSurfaceGestures","_Fragment","Tabs","LoadingFailedLine","loadingLineText","cellOf","useRef","useMemo","useCallback","variant","Box","sameKeys","NOT_PERSISTED","persistedOf","sameAnchor","pagedSourceEquivalent","equivalentFor","Plan","sameNarrowing","equalFor","StringType","NO_FAILURES","NO_ROWS","readFailure","NOTHING_READ","sameFailures","DEFAULT_RESIDENCY","createTrackedRead","createLedger","PLAN_PAGE_SIZE","NO_RESIDENCY","residentWindows","unpinAll","snapshotOf","observeWindow","elementsIn","isEmpty","offsetOfWindow","elementAtOffset","parseFor","StringType","toEastTypeValue","StringType","compareFor","createTrackedRead","toSeekQuery","bucketsOver","tileStart","tileNext","recordSliceWindow","getSomeorUndefined","useMemo","useSlicesReactivity","useState","recordSliceWindowFits","some","variant","getSomeorUndefined","NO_ROWS","refEqual","equalFor","Plan","StringType","sameNarrowing","printString","printFor","getSomeorUndefined","PLAN_PAGE_SIZE","NOT_PERSISTED","some","none","windowedSourceOf","sameAnchor","useRef","NONE_HIDDEN","stringEqual","equalFor","StringType","hiddenOf","stringEqual","equalFor","StringType","useMemo","planHideId","PLAN_PAGE_SIZE","NO_DRAFTS","SortedMap","compareFor","StringType","NONE_HIDDEN","equalFor","Plan","PlanEventPlacedType","shadingEqual","PlanEventShadingType","pagedSourceEquivalent","equivalentFor","PlanEventPagedType","printEventRef","printFor","ScheduleEventRefType","timeMs","none","planHideId","some","useCallback","useTrackedEvaluation","useMemo","useRef","useSyncExternalStore","narrowingOf","windowedSourceOf","snapshotOf","variant","printEventRef","printFor","ScheduleEventRefType","stringEqual","equalFor","StringType","OptionType","NO_BREACHES","NO_ROWS","planHideId","fieldBreaches","fieldBreachIssue","useMemo","fromEastTypeValue","decodeBeast2For","DictType","useCallback","useTrackedEvaluation","useRef","NOTHING","NO_ROWS","stringEqual","equalFor","StringType","sameRows","applyFor","OptionType","diffFor","ConflictError","some","none","useSyncExternalStore","useMemo","useCallback","useTrackedEvaluation","stringEqual","equalFor","StringType","variant","printFor","parseFor","encodeBeast2For","ArrayType","applyFor","levelRuns","summaryRun","compareString","compareFor","PlanNestedShadingType","blobEqual","BlobType","Plan","some","none","SCHEDULE_EVENT_CAP","SortedMap","useState","useCallback","useTrackedEvaluation","useRef","useMemo","useSyncExternalStore","spanOf","nestedSpanName","tileNext","pagedSourceEquivalent","equivalentFor","windowedSourceOf","useSliceReactivity","snapshotOf","useState","useMemo","getSomeorUndefined","useMemo","useCallback","useRef","PLAN_PAGE_SIZE","memo","Box","VisuallyHidden","EastChakraComponent","Box","VisuallyHidden","DAY_MS","recordSliceDomain","READING","useRef","useContainerWidth","useCallback","useTrackedEvaluation","useMemo","Box","chakra","PlaceholderShape","BrushStrip","_Fragment","Box","chakra","useMemo","Box","_Fragment","Box","useMemo","useId","getSomeorUndefined","useMemo","useIRCanDrop","refEqual","equalFor","Plan","variant","useHoverCapable","useMemo","useRef","useSlotStyles","useSlotClass","_Fragment","Popover","Portal","EastChakraComponent","HoverCard","Tooltip","VisuallyHidden","printWhere","printFor","RecordSliceWhereType","WHOLE_RECORD","useRef","useState","useCallback","toSeekQuery","awaitTracked","recordSliceSeek","recordSlicePage","none","isValueOf","StringType","recordSliceRows","some","recordSlicePosition","useMemo","useSyncExternalStore","VisuallyHidden","getSomeorUndefined","printEventRef","printFor","ScheduleEventRefType","fromEastTypeValue","StringType","scheduleOptimiseRows","ScheduleOptimiseRequestTypeFor","ScheduleOptimiseResultTypeFor","none","useCallback","useTrackedEvaluation","useRef","decodeBeast2For","DictType","SortedMap","compareFor","optimiseMessages","equalFor","Plan","stringEqual","StringType","printFor","ScheduleEventRefType","NO_KINDS","NO_JOINED","NO_RESOURCES","useDataStable","usePersistedState","NOT_PERSISTED","persistedOf","useState","useRef","getSomeorUndefined","getStore","useMemo","useCallback","useLanding","useLandingStyles","useFormatters","optimiseMessages","useTrackedEvaluation","useSliceReactivity","indexRows","useContainerBelow","entryOf","useSlotRecipe","useCoarsePointer","parseCssSize","planKeys","none","NO_BREACHES","useId","PLAN_PAGE_SIZE","NONE_HIDDEN","_Fragment","DensityProvider","recordSliceNoun","Box","elementKeyOf","historyShortcut","_jsxs","VirtualRows","VIRTUALIZE_UNBOUNDED_AT","VisuallyHidden","useRecipe","Box","chakra","stringEqual","equalFor","StringType","useFormatters","RecordSliceFieldEditor","HOST_RANK","useRecipe","chakra","coarseHitArea","Box","useMemo","useRecordSlicesToolbarItems","useKeySearchToolbarItem","useCallback","Button","_Fragment","historyToolbarItem","stringEqual","equalFor","StringType","NO_RETRY","useMemo","useRevealed","useLoadingReveal","useRef","useFooterFit","Box","footerCut","OptimiseLegendItem","FooterMore","RecordSliceSaveNotice","LoadingLine","NO_DRAFTS","SortedMap","compareFor","StringType","NONE_DRAFTED","DateTimeType","stringEqual","equalFor","NO_PARTS","READING","NONE_HIDDEN","useCallback","planHideId","none","some","useTrackedEvaluation","useRef","useMemo","INSPECTOR_SIZE","NO_DRAFTS","SortedMap","compareFor","StringType","NO_EDIT","READING","VariantType","NullType","stringEqual","equalFor","blobEqual","BlobType","PlanEventItemType","OptionType","ScheduleResourceRefType","parseRef","parseFor","ScheduleEventRefType","printFor","encodeBeast2For","EventStateType","variant","NOTHING","useMemo","useCallback","getSomeorUndefined","useTrackedEvaluation","useRef","memo","useSlotRecipe","Box","NothingSelected","BannerView","chakra","labelOf","Fact","useId","_Fragment","useRecipe","useDataStable","fromEastTypeValue","decodeBeast2For","fieldBreaches","fieldBreachIssue","fieldBreachText","fieldFormMessages","useState","EastChakraComponent","FieldForm","none","toEastTypeValue","some","planHideId","PlaceholderShape","useContext","FrameDrawer","equivalentFor","Plan","PlanEventBlocksType","PlanEventPagedType","PlanPayloadType","vocabularyEqual","equalFor","NO_KINDS","none","NOTHING_READ","compareString","compareFor","StringType","stringEqual","useRef","useMemo","SortedMap","memo","useDataStable","getSomeorUndefined","planKeys","usePersistedState","NONE_HIDDEN","keptRead","hiddenOf","useCallback","tabLibrary","_Fragment","useSlotRecipe","useState","typedInto","historyShortcut","Fragment","SessionBanners","Box","BannerView","Button","LoadingReveal","BuilderFrame","implementUIComponent","PlanComponent","parseDatePattern","formatDatePattern","encodeBeast2For","NullType","fromEastTypeValue","isTypeEqual","decodeBeast2For","getSomeorUndefined","variant","getSomeorUndefined","none","resolveMember","variant","formatDatePattern","markOf","getSomeorUndefined","identified","variant","counted","PLACEHOLDER","plural","editingMessages","getSomeorUndefined","createContext","useContext","useMemo","createElement","formatters","useFormatters","useMemo","issueText","DRAFT_ISSUE_TEXT","NO_RETRY","memo","useMemo","useRevealed","useLoadingReveal","useRef","useFooterFit","Box","getSomeorUndefined","RecordSliceSaveNotice","footerCut","OptimiseLegendItem","FooterMore","LoadingLine","compareFor","StringType","parseFor","compareString","compareFor","StringType","equalFor","DictType","RecordSliceStateType","ArrayType","Sheet","none","narrowingOf","SortedMap","decodeWire","decodeBeast2For","Sheet","sameCell","equalFor","variant","withCell","rowsOf","equalFor","Sheet","stringEqual","StringType","compareString","compareFor","printNarrowedSource","printFor","StructType","randomKeys","NO_KEYS","useDataStable","useId","useMemo","useState","getSomeorUndefined","useCoarsePointer","useDensityHeights","devicePixels","useRef","useCallback","SortedSet","useSlicesReactivity","narrowingOf","windowedSourceOf","StructType","OptionType","StringType","equalFor","printFor","none","some","readFailure","emptyCache","stringEqual","equalFor","StringType","NO_RESIDENCY","equivalentFor","Sheet","DEFAULT_RESIDENCY","useState","createLedger","useRef","useCallback","residentWindows","useTrackedEvaluation","observeWindow","isEmpty","useMemo","unpinAll","sameFolds","equalFor","Sheet","decodeBeast2For","fromEastTypeValue","StringType","SheetOptimiseRequestTypeFor","SheetOptimiseResultTypeFor","SortedMap","compareFor","normalizeDraft","encodeBeast2For","some","variant","none","liftDraft","printWhere","printFor","RecordSliceWhereType","stringEqual","equalFor","StringType","equivalentFor","Sheet","recordSliceSeek","useState","useRef","useCallback","recordSlicePlace","entryLookup","recordSliceWithinAt","useTrackedEvaluation","useMemo","none","none","stringEqual","equalFor","StringType","isRegisterKind","variant","encodeBeast2For","SheetReadyBatchType","fromEastTypeValue","decodeBeast2For","liftDraft","some","none","variant","raiseIssue","fromEastTypeValue","encodeBeast2For","decodeBeast2For","liftDraft","stringEqual","equalFor","StringType","getSomeorUndefined","fieldBreaches","isVariant","createContext","equalFor","DateTimeType","useMemo","useContext","useState","stringEqual","equalFor","StringType","encodeBeast2For","Sheet","NO_ROWS","decodeRow","decodeBeast2For","none","useMemo","useRef","getSomeorUndefined","boundedReadiness","fromEastTypeValue","fieldBreachIssue","normalizeDraft","isVariant","variant","some","editWindow","recordSliceReadEntries","prepareRecordSliceSave","useEditSession","useCallback","standingBeforeSave","OptionType","useMemo","getSomeorUndefined","fromEastTypeValue","encodeBeast2For","normalizeDraft","variant","some","CLEAN_DRAFT","presentDraft","issueText","conflictMarks","equalFor","none","variant","stringEqual","equalFor","StringType","none","printRowsWhere","printFor","RecordSliceWhereType","cellEqual","equalFor","Sheet","stringEqual","StringType","OptionType","IntegerType","SheetBatchReadinessType","printNarrowedSource","StructType","NOTHING","NO_BREACHES","usePersistedState","useState","useRef","useCallback","useReducer","getSomeorUndefined","useMemo","windowedSourceOf","useLanding","useLandingStyles","useDataStable","fromEastTypeValue","isVariant","normalizeDraft","fieldFormMessages","fieldBreachText","kindOfIssue","none","some","fieldBreachIssue","getSomeorUndefined","variant","getSomeorUndefined","useMemo","getSomeorUndefined","useCallback","some","none","variant","useRef","memo","Box","memo","Box","_Fragment","getSomeorUndefined","Box","forwardRef","chakra","chakra","memo","useSlotStyles","useMemo","useRef","_Fragment","useSyncExternalStore","useCallback","Box","chakra","useMemo","useCallback","useDropCell","useDragEventChip","optimiseMessages","useRef","useState","ChakraMenu","FrameMenuLayer","memo","useId","resolveMember","none","loadingLineText","UnloadedRun","EastErrorBoundary","getSomeorUndefined","variant","some","none","VariantType","StringType","StructType","NullType","printFor","parseFor","refused","variant","planDrop","titleOf","refusalWord","dropRefusal","dropCaption","dropName","stringEqual","equalFor","StringType","useMemo","useCallback","resolveRegisterMember","useRef","some","none","stringEqual","equalFor","StringType","variant","getSomeorUndefined","variant","useMemo","useRef","useCallback","fromEastTypeValue","sameFolds","cellEqual","equalFor","Sheet","useRef","useCallback","variant","some","none","useState","useCallback","useRef","useRef","useState","useCallback","markOf","getSomeorUndefined","variant","some","none","focusKeySearch","useRef","useCallback","reducedMotion","useState","memo","useSlotStyles","Box","ChakraMenu","chakra","FrameMenuLayer","_Fragment","getSomeorUndefined","useMemo","useRef","useCallback","historyShortcut","segmentsOf","memo","useDensity","useRef","useMemo","createListCollection","useCombobox","dateValueToDate","Box","chakra","ChakraInput","ChakraNumberInput","ChakraCombobox","Portal","CompoundDateField","dateToCalendarDate","CompoundDateInput","CompoundDateSegment","_Fragment","stringEqual","equalFor","StringType","useSlotRecipe","useMemo","useCallback","getSomeorUndefined","useState","useRef","useMemo","toEastTypeValue","StringType","useState","useRef","useMemo","useCallback","useTrackedEvaluation","toSeekQuery","awaitTracked","printFor","RecordSliceWhereType","stringEqual","equalFor","StringType","StructType","useCallback","useMemo","some","fromEastTypeValue","parseFor","none","useState","useRef","narrowingOf","recordSliceWithinAt","hiddenOf","useTrackedEvaluation","useCallback","none","useTrackedEvaluation","memo","useSlotRecipe","useSlotStyles","useRef","Box","SliceChoiceGroup","Button","SliceClearButton","chakra","ChakraMenu","FrameMenuLayer","useMemo","useCallback","stringEqual","equalFor","StringType","getSomeorUndefined","memo","useRef","useState","Box","chakra","useMemo","resolveRegisterMember","getSomeorUndefined","resolveVocabMember","variant","useRef","NOTHING","useCallback","useMemo","useRef","useState","useDragLayerOptional","useRef","useMemo","useState","useCallback","recordSliceNoun","stringEqual","equalFor","StringType","isVariant","variant","useRef","variant","memo","useSlotStyles","useMemo","ChakraMenu","Portal","chakra","useRecipe","useState","useCallback","SliceEditPopover","_Fragment","FieldForm","memo","useSlotStyles","useRecipe","useContext","FrameDrawer","useSyncExternalStore","useMemo","useState","useRef","useCallback","chakra","variant","FieldForm","memo","useSlotStyles","useRecipe","useSyncExternalStore","useMemo","useState","useRef","useCallback","chakra","variant","FieldForm","_Fragment","cellEqual","equalFor","Sheet","stringEqual","StringType","useMemo","useState","useRef","resolveRegisterMember","useCallback","useCallback","stringEqual","equalFor","StringType","EditingIssueType","printFor","variant","useSheetInspector","useMemo","useCallback","normalizeDraft","markOf","getSomeorUndefined","some","useRef","resolveRegisterMember","kindOfIssue","stringEqual","equalFor","StringType","Sheet","useMemo","useRef","useCallback","planDrop","variant","some","dropCaption","dropName","dropRefusal","memo","Box","chakra","HOST_RANK","useKeySearchToolbarItem","useRecordSlicesToolbarItems","Box","optimiseMessages","historyToolbarItem","useCallback","_jsxs","Box","_Fragment","VirtualRows","useSheetInspector","createContext","useContext","getSomeorUndefined","DensityProvider","Box","stringEqual","equalFor","StringType","ArrayType","INSPECTOR_SIZE","getSomeorUndefined","whatOf","memo","useSlotRecipe","none","some","variant","isTypeEqual","Sheet","fromEastTypeValue","toEastTypeValue","OptionType","useMemo","useRecipe","useCallback","encodeBeast2For","defaultValue","Box","chakra","issueText","decodeBeast2For","useDataStable","useContext","FrameDrawer","EastChakraComponent","FieldForm","useSlotStyles","printFor","IntegerType","FloatType","compareFor","useState","fieldFormMessages","fieldBreaches","_Fragment","NullType","VariantType","useContext","FrameDrawer","useSlotStyles","_Fragment","Box","getSomeorUndefined","chakra","FramePane","stringEqual","equalFor","StringType","decodeBeast2For","Sheet","StructType","printFor","WHOLE","none","LIBRARY_SIZE","some","templatesTab","variant","useSlotStyles","useMemo","getSomeorUndefined","useCallback","useState","Box","EastChakraLibrary","stringEqual","equalFor","StringType","followedSources","payloadEquivalent","equivalentFor","SheetPayloadType","vocabularyEqual","equalFor","stringEqual","StringType","NO_COLUMN_HIDDEN","dropHostOf","some","getSomeorUndefined","useCallback","none","useTrackedEvaluation","useMemo","useDataStable","memo","sheetKeys","usePersistedState","keptRead","useRef","useContainerWidth","NARROW_FRAME","followedSources","issueText","typedInto","historyShortcut","_Fragment","SessionBanners","Box","BannerView","Button","LoadingReveal","BuilderFrame","implementUIComponent","SheetComponent","createContext","useContext","lessFor","IntegerType","getSomeorUndefined","counted","stringEqual","equalFor","StringType","integerEqual","IntegerType","resolveMember","_Fragment","Box","m","getSomeorUndefined","formatDatePattern","stringEqual","equalFor","StringType","integerEqual","IntegerType","NO_LEGEND","legendOf","getSomeorUndefined","m","memo","useMemo","useRevealed","useLoadingReveal","useRef","useFooterFit","Box","RecordSliceSaveNotice","footerCut","FooterMore","LoadingLine","stringEqual","equalFor","StringType","printFor","createContext","useContext","getSomeorUndefined","memo","useId","useMemo","useSyncExternalStore","Box","chakra","m","markOf","resolveMember","defaultValue","Field","createContext","useContext","rm","memo","useSlotRecipe","useMemo","getSomeorUndefined","useRecipe","FrameDrawer","equalFor","some","markOf","none","variant","fromEastTypeValue","fieldFormMessages","useCallback","formatDatePattern","Box","whatOf","EastChakraComponent","FieldForm","EastChakraField","chakra","stringEqual","equalFor","StringType","m","DRAFT_ISSUE_TEXT","useSyncExternalStore","useState","stringEqual","equalFor","StringType","IntegerType","m","resolveMember","getSomeorUndefined","formatDatePattern","memo","markOf","Box","HOST_RANK","Tooltip","chakra","Portal","useRecipe","useSlotStyles","m","Box","equivalentFor","RecordPayloadType","NARROW_FRAME","rm","keptRead","memo","getSomeorUndefined","useMemo","useDensity","useToken","useSlotStyles","useState","useRef","useContainerWidth","usePersistedState","useCallback","fromEastTypeValue","useSyncExternalStore","legendOf","issueText","typedInto","historyShortcut","_Fragment","SessionBanners","Box","BannerView","LoadingReveal","BuilderFrame","implementUIComponent","RecordComponent","getSomeorUndefined","compareKey","compareFor","StringType","sameString","equalFor","compareFloat","FloatType","lessFloat","lessFor","sameBytes","BlobType","IntegerType","messageOf","sameKeys","useRef","useMemo","some","none","encodeBeast2For","fromEastTypeValue","printFor","variant","NO_ENTRIES","SortedMap","recordSliceWithin","NO_ROWS","sameEntries","useCallback","useTrackedEvaluation","SortedSet","labelOf","recordChoiceSummary","refusalWord","PLACEHOLDER_LINE","compareFloat","compareFor","FloatType","equalFor","lessFloat","lessFor","SortedSet","compareKey","compareFor","StringType","sameString","equalFor","NEUTRAL","SortedSet","across","lessFloat","lessFor","FloatType","ChakraTag","chakra","_Fragment","Box","getSomeorUndefined","PlaceholderShape","useRef","useState","useMemo","rowOf","intersects","memo","useSlotStyles","useState","useRef","Box","chakra","keyEqual","equalFor","StringType","placeholderOf","bandStates","NO_KEYS","some","none","unheldNamer","namers","FOLLOWS","heldOnceMoved","followBuiltKeys","keyEqual","equalFor","StringType","keyEqual","equalFor","StringType","dropHostOf","getSomeorUndefined","cardOf","VariantType","StructType","IntegerType","NullType","printDropAt","printFor","parseDropAt","parseFor","readDropAt","variant","linkAt","bandStates","refused","GONE","planDrop","dropEdits","markOf","markEqual","dropCaption","dropRefusal","dropName","dropLabel","printDropAt","FAILED_INSET_PX","keyEqual","equalFor","StringType","dispatchEast","useSlotRecipe","getSomeorUndefined","useMemo","useCallback","useRef","useState","useDragLayerOptional","readDropAt","markOf","markEqual","useDropCell","typedInto","followPointer","Box","_Fragment","Tooltip","chakra","Portal","LoadingFailedBox","compareString","compareFor","StringType","sameString","equalFor","BlobType","sameWhere","RecordSliceWhereType","NO_ROWS","NO_KEYS","SortedSet","NO_FAILURES","NO_REVISIONS","messageOf","sameRevisions","useCallback","getSomeorUndefined","recordSliceRows","useTrackedEvaluation","useRef","useMemo","NONE","NO_LANDED","merged","draftedAt","readBeforeSaves","landedDrafts","landedRead","stringEqual","equalFor","StringType","useRef","useCallback","useTrackedEvaluation","useMemo","stringEqual","equalFor","StringType","NO_KINDS","NO_JOINED","someOf","kindOf","getSomeorUndefined","READY","variant","NO_MINTED","builderOf","useRef","useMemo","recordSliceRows","some","NO_LANDED","useCallback","none","keyEqual","equalFor","StringType","printWhere","printFor","RecordSliceWhereType","WHOLE","BROWSE_QUERY","someOf","match","dimmedWords","foundLine","findKeyInline","useRef","useCallback","awaitTracked","recordSliceSeek","toSeekQuery","recordSlicePage","none","recordSliceWithin","hiddenOf","recordSliceRevision","useTrackedEvaluation","useState","useMemo","stringEqual","equalFor","StringType","compareFor","DateTimeType","useRef","useFooterFit","useRevealed","Box","RecordSliceSaveNotice","LoadingLine","useCallback","kindOf","useTrackedEvaluation","useMemo","lessFor","FloatType","Box","getSomeorUndefined","PlaceholderShape","useRef","useContainerWidth","useState","_Fragment","chakra","stringEqual","equalFor","StringType","useState","useMemo","useCallback","useRecipe","chakra","getSomeorUndefined","keyEqual","equalFor","StringType","compareFor","FloatType","variant","none","some","INSPECTOR_SIZE","NO_EDIT","NEW_ROW","stringEqual","equalFor","StringType","StructType","OptionType","IntegerType","DateTimeType","kindOf","whatOf","Box","Action","useRecipe","chakra","Edits","Fact","useMemo","_Fragment","FieldForm","useRefused","useState","useCallback","fieldFormMessages","useOwnDetails","fieldWrite","fromEastTypeValue","encodeBeast2For","useRowState","useSide","getSomeorUndefined","EastChakraComponent","Fragment","memo","useSlotRecipe","detailsView","LinkView","SeveralView","Fields","some","none","useContext","FrameDrawer","hiddenOf","keyEqual","equalFor","StringType","sessionIssues","fromEastTypeValue","isValueOf","OptionType","stringEqual","equalFor","StringType","LIBRARY_SIZE","WHOLE","none","getSomeorUndefined","narrowingOf","useSlotRecipe","useMemo","useCoarsePointer","useState","useCallback","some","Box","EastChakraLibrary","plural","counted","printFor","StringType","capital","keysUntyped","aNoun","editingMessages","encodeBeast2For","Flowchart","decodeBeast2For","ORIENTATIONS","variant","StateRuntime","useCallback","useSyncExternalStore","useMemo","stringEqual","equalFor","StringType","followedSources","getSomeorUndefined","useSlotRecipe","Box","chakra","HOST_RANK","useMemo","Box","useKeySearchToolbarItem","useRecordSlicesToolbarItems","useRecipe","useRef","useMemo","dropHostOf","getSomeorUndefined","useCallback","planDrop","cardOf","readDropAt","dropEdits","dropLabel","dropCaption","dropName","dropRefusal","equivalentFor","Flowchart","stringEqual","equalFor","StringType","ArrayType","EditingBatchReadinessType","kindOf","memo","useState","useCallback","getSomeorUndefined","_Fragment","useFormatters","useMemo","followedSources","useSlotRecipe","flowchartKeys","landedDrafts","landedRead","useRef","followBuiltKeys","useContainerBelow","none","typedInto","historyToolbarItem","focusKeySearch","historyShortcut","useDataStable","fieldBreachText","fieldFormMessages","fieldBreaches","sessionIssues","SessionBanners","Box","BannerView","Button","loadingLineText","LoadingReveal","BuilderFrame","implementUIComponent","contains","Schematic","StructType","StringType","FloatType","OptionType","ArrayType","printFor","parseFor","none","some","compareString","compareFor","StringType","SCHEMATIC_WINDOW_READ_ROWS","SortedMap","fromEastTypeValue","encodeBeast2For","ArrayType","StructType","equalFor","stringEqual","equalFor","StringType","compareFor","IntegerType","printQuery","printFor","SeekQueryType","printWhere","RecordSliceWhereType","READING","SCHEMATIC_WINDOW_ROWS","NO_ROWS","NO_JOINED","recordSliceRevision","SCHEMATIC_WINDOW_READ_ROWS","schematicWindowPlan","recordSliceOnPrinter","areaCells","recordSliceCellRuns","recordSliceCellEntries","schematicRaster","recordSliceBounds","recordSliceRunEntries","schematicDensityCells","recordSliceWithin","sameFrom","recordSliceRunJoins","recordSliceCellJoins","NO_ROWS","stringEqual","equalFor","StringType","fromEastTypeValue","encodeBeast2For","ArrayType","StructType","compareString","compareFor","StringType","stringEqual","equalFor","printWhere","printFor","RecordSliceWhereType","SortedMap","some","variant","schematicUnplacedPlan","recordSliceRevision","none","recordSlicePage","recordSliceWithin","stringEqual","equalFor","StringType","NONE","useMemo","fromEastTypeValue","useCallback","useTrackedEvaluation","fieldBreaches","fieldBreachIssue","useRef","getSomeorUndefined","match","getSomeorUndefined","match","css","statusRing","getSomeorUndefined","match","library","fas","memo","getSomeorUndefined","findIconDefinition","Box","PlaceholderShape","stringEqual","equalFor","StringType","useRef","useCallback","Box","memo","useSlotRecipe","useMemo","Box","useState","stringEqual","equalFor","StringType","stringEqual","equalFor","StringType","getSomeorUndefined","useState","useRef","useMemo","useCallback","stringEqual","equalFor","StringType","Schematic","some","stringEqual","equalFor","StringType","StructType","FloatType","IntegerType","VariantType","Schematic","NullType","printFor","parseFor","variant","some","none","refusalWords","stringEqual","equalFor","StringType","useDragLayerOptional","useState","useMemo","useCallback","useDropCell","ArrayType","Schematic","equalFor","stringEqual","StringType","useMemo","getSomeorUndefined","useState","useRef","useCallback","THEME_COLOURS","schematicColorTokens","memo","useRevealed","useRef","useMemo","useCallback","stringEqual","equalFor","StringType","SCHEMATIC_WINDOW_ROWS","useMemo","useState","useRef","getSomeorUndefined","useCallback","THEME_COLOURS","useSurfaceGestures","typedInto","equalFor","Schematic","sameWhere","RecordSliceWhereType","printWhere","printFor","sameString","StringType","compareString","compareFor","NO_WINDOWS","NO_REVISIONS","NO_DENSITY","getSomeorUndefined","useRef","useState","useCallback","schematicAreaIndexes","recordSliceRevision","READING","useTrackedEvaluation","useMemo","useSyncExternalStore","stringEqual","equalFor","StringType","memo","useSlotRecipe","useMemo","getSomeorUndefined","useRef","paintParallelLanes","useState","useSurfaceGestures","useCallback","Box","LoadingWash","_Fragment","chakra","LoadingFailedBox","getSomeorUndefined","match","stringEqual","equalFor","StringType","NO_AREAS","NO_AREA_COUNTS","none","schematicAreaIndexes","schematicUnplacedPlan","NO_AREAS","useCallback","getSomeorUndefined","useTrackedEvaluation","useRef","stringEqual","equalFor","StringType","readBeforeSaves","sameWhere","equalFor","RecordSliceWhereType","stringEqual","StringType","answersOf","recordSliceWithin","NO_AREAS","useRef","useCallback","getSomeorUndefined","recordSliceRevision","useTrackedEvaluation","stringEqual","equalFor","StringType","NO_JOINED","someOf","kindOf","variant","useMemo","useRef","some","useCallback","compareFor","StringType","equalFor","EastTypeType","parseFor","printWhere","printFor","RecordSliceWhereType","match","WHOLE","findKeyInline","parseKeyInput","awaitTracked","recordSlicePage","none","recordSliceWithin","hiddenOf","useMemo","useRef","useCallback","recordSliceSeek","toSeekQuery","recordSliceRevision","useTrackedEvaluation","useState","useState","useSyncExternalStore","useMemo","useRef","useFooterFit","useRevealed","Box","RecordSliceSaveNotice","LoadingLine","stringEqual","equalFor","StringType","article","some","variant","none","stringEqual","equalFor","StringType","StructType","FloatType","ArrayType","useRecipe","chakra","Box","PlaceholderShape","FieldForm","EastChakraComponent","useState","useCallback","useMemo","fromEastTypeValue","encodeBeast2For","getSomeorUndefined","READING","memo","useSlotRecipe","Fields","some","_Fragment","none","useTrackedEvaluation","hiddenOf","equalFor","BlobType","stringEqual","StringType","recordSliceRows","NO_AREAS","useCallback","getSomeorUndefined","useTrackedEvaluation","useRef","stringEqual","equalFor","StringType","stringEqual","equalFor","StringType","printFor","SeekQueryType","recordSliceRevision","READING","schematicWindowPlan","recordSliceOnPrinter","areaCells","recordSliceCellRuns","SCHEMATIC_WINDOW_READ_ROWS","recordSliceWithin","pagedSearchTarget","pagedSearchWhere","none","recordSlicePage","recordSliceCellEntries","recordSliceCellJoins","stringEqual","equalFor","StringType","compareString","compareFor","StructType","DictType","BooleanType","OptionType","SortedMap","none","encodeBeast2For","decodeBeast2For","getSomeorUndefined","some","StateRuntime","useCallback","useSyncExternalStore","useMemo","stringEqual","equalFor","StringType","useMemo","useCallback","useTrackedEvaluation","useSlotRecipe","useId","useState","useRef","SEARCH_DELAY_MS","getSomeorUndefined","SCHEMATIC_WINDOW_READ_ROWS","Box","chakra","LibraryEmptyState","_Fragment","LibrarySearchBox","VirtualRows","stringEqual","equalFor","StringType","useSlotRecipe","LibraryEmptyState","getSomeorUndefined","_Fragment","Box","chakra","Button","stringEqual","equalFor","StringType","none","getSomeorUndefined","useSlotRecipe","useMemo","useCoarsePointer","useCallback","some","Box","EastChakraLibrary","narrowedCount","PagedLibrary","useTrackedEvaluation","equalFor","RecordSliceWhereType","stringEqual","StringType","recordSliceWithin","useRef","useCallback","getSomeorUndefined","recordSliceRevision","recordSliceRows","useTrackedEvaluation","match","HOST_RANK","Box","useSlotRecipe","chakra","useRecordSlicesToolbarItems","useKeySearchToolbarItem","VariantType","NullType","StructType","OptionType","StringType","encodeBeast2For","decodeBeast2For","StateRuntime","useCallback","useSyncExternalStore","useMemo","variant","none","some","useRef","useMemo","useCallback","equivalentFor","Schematic","equalFor","ArrayType","StringType","compareFor","printFor","RecordSliceWhereType","memo","useState","useCallback","_Fragment","getSomeorUndefined","useFormatters","useDataStable","useMemo","schematicColorTokens","useSlotRecipe","schematicKeys","editingMessages","useRef","kindKeys","none","some","useSlicesReactivity","useContainerBelow","keysOfType","typedInto","historyToolbarItem","focusKeySearch","historyShortcut","schematicAreaIndexes","loadingLineText","SessionBanners","Box","BannerView","Button","usePersistedState","keptRead","LoadingReveal","BuilderFrame","implementUIComponent","useQuery","repoList","repoStatus","useMutation","repoGc","repoGcStart","repoGcStatus","repoCreate","repoRemove","useQuery","packageList","packageGet","useMutation","packageImport","packageExport","packageRemove","useQuery","workspaceList","useMutation","workspaceCreate","workspaceCopy","workspaceGet","workspaceStatus","pollRequestOptions","workspaceRemove","workspaceDeploy","workspaceExport","useQuery","taskList","taskGet","taskExecutionList","printFor","IntegerType","useMutation","dataflowExecute","dataflowExecuteLaunch","useQuery","dataflowGraph","dataflowExecutePoll","pollRequestOptions","dataflowCancel","taskLogs","useMemo","variant","useQuery","datasetGetPage","decodeBeast2For","keepPreviousData","useQueryClient","useMemo","useQuery","taskGet","Component","memo","Box","Flex","Text","treePathToString","memo","useMemo","StateImpl","SliceImpl","RecordSliceImpl","SliceApplyImpl","OverlayImpl","ClipboardImpl","DownloadImpl","ShareImpl","createUIStore","UIStoreProvider","Box","EastChakraComponent","_Fragment","chakra","useSlotRecipe","useRef","useState","useMemo","useVirtualizer","useCallback","Box","Tabs","Input","Text","IconButton","Badge","equalFor","StringType","useTaskLogs","useRef","useQuery","taskLogs","pollRequestOptions","memo","useTabs","useTaskLogsHook","useMemo","memo","useState","Box","Flex","SegmentGroup","memo","Box","Flex","Text","printFor","Box","Text","Badge"],"sources":["../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/subscribable.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/focusManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/timeoutManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/utils.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/environmentManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/thenable.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/notifyManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/onlineManager.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/retryer.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/removable.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/query.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/mutation.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/mutationCache.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/queryCache.js","../../../../../node_modules/.pnpm/@tanstack+query-core@5.96.1/node_modules/@tanstack/query-core/build/modern/queryClient.js","../src/platform/dataset-store.ts","../src/platform/staged-store.ts","../src/platform/bind-runtime.ts","../src/platform/find-query.ts","../src/platform/indexed-paged.ts","../src/platform/tracked-channel.ts","../src/platform/record-runtime.ts","../src/platform/paged/keys.ts","../src/platform/paged/state.ts","../src/platform/paged/errors.ts","../src/platform/paged/windows.ts","../src/platform/paged-read-error.ts","../src/platform/paged/channels.ts","../src/platform/paged/reads.ts","../src/platform/paged/batches.ts","../src/platform/paged/api.ts","../src/platform/paged-runtime.ts","../src/platform/func-runtime.ts","../../../../../node_modules/.pnpm/classcat@5.0.5/node_modules/classcat/index.js","../../../../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/sourceEvent.js","../../../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/pointer.js","../../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/noevent.js","../../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/nodrag.js","../../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/constant.js","../../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/event.js","../../../../../node_modules/.pnpm/d3-drag@3.0.0/node_modules/d3-drag/src/drag.js","../../../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js","../../../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js","../../../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/math.js","../../../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/lab.js","../../../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/cubehelix.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basis.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/basisClosed.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/numberArray.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/array.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/date.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/object.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/value.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/round.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/zoom.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/hsl.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/lab.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/hcl.js","../../../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/cubehelix.js","../../../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js","../../../../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js","../../../../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js","../../../../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js","../../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/constant.js","../../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/event.js","../../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js","../../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/noevent.js","../../../../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/zoom.js","../../../../../node_modules/.pnpm/@xyflow+system@0.0.76/node_modules/@xyflow/system/dist/esm/index.js","../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.4/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.4/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.4/node_modules/use-sync-external-store/shim/index.js","../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.4/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.4/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.4/node_modules/use-sync-external-store/shim/with-selector.js","../../../../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.14_immer@11.1.4_react@19.2.4/node_modules/zustand/esm/vanilla.mjs","../../../../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.14_immer@11.1.4_react@19.2.4/node_modules/zustand/esm/traditional.mjs","../../../../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.14_immer@11.1.4_react@19.2.4/node_modules/zustand/esm/shallow.mjs","../../../../../node_modules/.pnpm/@xyflow+react@12.10.2_@types+react@19.2.14_immer@11.1.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@xyflow/react/dist/esm/index.js","../../../../../node_modules/.pnpm/@xyflow+react@12.10.2_@types+react@19.2.14_immer@11.1.4_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@xyflow/react/dist/style.css?inline","../../../../../node_modules/.pnpm/@fortawesome+free-solid-svg-icons@7.2.0/node_modules/@fortawesome/free-solid-svg-icons/index.mjs","../src/ontology/accents.ts","../../../../../node_modules/.pnpm/@fortawesome+fontawesome-svg-core@7.2.0/node_modules/@fortawesome/fontawesome-svg-core/index.mjs","../../../../../node_modules/.pnpm/@fortawesome+react-fontawesome@3.3.0_@fortawesome+fontawesome-svg-core@7.2.0_react@19.2.4/node_modules/@fortawesome/react-fontawesome/dist/index.js","../src/ontology/mark.tsx","../src/ontology/OntologyNode.tsx","../src/ontology/OntologyEdge.tsx","../src/ontology/types.ts","../src/ontology/NodePropertiesDrawer.tsx","../src/ontology/projection.ts","../src/ontology/OntologyTable.tsx","../../../../../node_modules/.pnpm/cytoscape@3.33.4/node_modules/cytoscape/dist/cytoscape.esm.mjs","../../../../../node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js","../../../../../node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js","../../../../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.33.4/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js","../src/ontology/layout.ts","../src/ontology/flow-state.ts","../src/platform/recovery.ts","../src/platform/e3-config.tsx","../src/platform/dataset-hooks.tsx","../src/ontology/bind-runtime.ts","../src/ontology/use-color-mode.ts","../src/shared/views.ts","../src/ontology/index.tsx","../src/decision/handle-runtime.ts","../src/decision/constraint-format.ts","../src/decision/lever-editor.tsx","../src/decision/facets.tsx","../src/decision/contract.ts","../src/decision/types.ts","../src/decision/grouping.ts","../src/decision/queue.tsx","../src/decision/journal.tsx","../src/studio/messages.ts","../src/studio/inspector.tsx","../src/studio/open-page.ts","../src/studio/page.tsx","../src/studio/palette.tsx","../src/shared/name-popover.tsx","../src/studio/save-template.tsx","../src/studio/phone.tsx","../src/studio/publish.tsx","../src/studio/studio-east.ts","../src/studio/builder.tsx","../src/studio/library.tsx","../src/query/autocomplete.tsx","../src/query/steps/shape.ts","../src/query/steps/fields.ts","../src/query/steps/jq.ts","../src/query/steps/values.ts","../src/query/steps/print.ts","../src/query/steps/count.ts","../src/query/steps/check.ts","../src/shared/article.ts","../src/query/model/messages.ts","../src/query/model/words.ts","../src/query/model/summaries.ts","../src/query/hooks.tsx","../src/query/datasets-tab.tsx","../src/query/drops.tsx","../src/components/StatusDisplay.tsx","../src/hooks/useDatasetStatus.ts","../src/hooks/useDatasetValue.ts","../src/hooks/datasets.ts","../src/components/controlled-search.ts","../src/components/preview-controls.ts","../src/errors.ts","../src/components/DatasetPreview.tsx","../src/components/page-reads.ts","../src/debug.ts","../src/components/PagedDatasetPreview.tsx","../src/query/parts.tsx","../src/query/results-table.ts","../src/query/paged-result.ts","../src/query/plan-popover.tsx","../src/query/results.tsx","../src/query/downloads.ts","../src/query/model/cards.ts","../src/query/steps/parse.ts","../src/query/query-east.ts","../src/shared/records/author.ts","../src/query/session.ts","../src/query/about.ts","../src/query/library-tab.tsx","../src/query/open-query.ts","../src/query/foot.tsx","../src/query/jq-editor.tsx","../src/query/shape-line.tsx","../src/query/source.tsx","../src/query/step-card.tsx","../src/query/toolbar.tsx","../src/query/query-tab.tsx","../src/query/phone.tsx","../src/query/steps/edit.ts","../src/query/model/slots.ts","../src/query/phone-steps.tsx","../src/query/run.ts","../src/query/words.tsx","../src/query/save-popover.tsx","../src/query/status-line.tsx","../src/query/use-query-editor.ts","../src/query/use-query-session.ts","../src/query/builder.tsx","../src/query/library.tsx","../src/shared/bounds.ts","../src/shared/func/use-func-call.ts","../src/shared/func/use-optimise.ts","../src/shared/func/optimise-parts.tsx","../src/shared/loading.ts","../src/shared/schedule/editing.ts","../src/shared/schedule/field-ask.tsx","../src/shared/schedule/each-source.tsx","../src/shared/schedule/visibility.ts","../src/shared/schedule/source-tab.ts","../src/shared/schedule/follow-sources.tsx","../src/shared/schedule/kind-keys.ts","../src/shared/schedule/words.ts","../src/shared/schedule/hidden.ts","../src/shared/schedule/hidden-pick.tsx","../src/shared/schedule/overlaps.ts","../src/shared/schedule/refusals.ts","../src/shared/time/now-line.tsx","../src/shared/schedule/due.ts","../src/shared/time/calendar-math.ts","../src/shared/schedule/window.ts","../src/calendar/model.ts","../src/calendar/actions.ts","../src/shared/schedule/backlog.ts","../src/calendar/backlog-pages.ts","../src/shared/view-read.ts","../src/shared/schedule/records.ts","../src/shared/schedule/drafted-rows.ts","../src/shared/schedule/cells.ts","../src/shared/windowed.ts","../src/calendar/pages.ts","../src/calendar/cells.ts","../src/shared/schedule/read-ahead.ts","../src/shared/schedule/use-read-ahead.ts","../src/shared/schedule/page-view.ts","../src/calendar/view.ts","../src/calendar/window.ts","../src/calendar/data.ts","../src/calendar/chooser.tsx","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/interval.js","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/duration.js","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/second.js","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/minute.js","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/hour.js","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/day.js","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/week.js","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/month.js","../../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/year.js","../../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js","../../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js","../../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js","../../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/number.js","../../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisect.js","../../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ticks.js","../src/shared/time/scale.ts","../src/shared/time/drag.ts","../src/shared/schedule/library.ts","../src/calendar/controls.tsx","../src/calendar/library.tsx","../src/calendar/drag.ts","../src/calendar/event-focus.ts","../src/calendar/find.ts","../src/calendar/footer.tsx","../src/shared/focus-home.ts","../src/shared/schedule/inspector-head.tsx","../src/calendar/inspector.tsx","../src/calendar/messages.ts","../src/shared/func/optimise-diff.ts","../src/calendar/optimise.ts","../src/calendar/sources.ts","../src/shared/schedule/segments.tsx","../src/shared/time/navigation.tsx","../src/calendar/toolbar.tsx","../src/shared/time/ruler-thin.ts","../src/shared/time/use-ruler-fit.ts","../src/shared/time/ruler.tsx","../src/shared/time/lanes.ts","../src/shared/time/shading.ts","../src/calendar/timeline.ts","../src/shared/schedule/group-heading.tsx","../src/shared/schedule/move-ghost.tsx","../src/shared/schedule/row-anchor.ts","../src/calendar/agenda-focus.ts","../src/calendar/views.tsx","../src/calendar/index.tsx","../src/shared/schedule/source-window.ts","../src/roster/model.ts","../src/roster/editing.ts","../src/roster/actions.ts","../src/shared/schedule/reference.ts","../src/roster/data.ts","../src/roster/identity.ts","../src/roster/controls.tsx","../src/roster/library.tsx","../src/roster/drag.ts","../src/roster/find.ts","../src/shared/func/use-fit.ts","../src/roster/fit.ts","../src/roster/footer.tsx","../src/roster/demand.ts","../src/roster/views.tsx","../src/roster/inspector.tsx","../src/roster/messages.ts","../src/roster/optimise.ts","../src/shared/schedule/period-status.tsx","../src/roster/toolbar.tsx","../src/roster/window.ts","../src/roster/visibility.ts","../src/roster/index.tsx","../src/allocation/model.ts","../src/allocation/editing.ts","../src/allocation/nouns.ts","../src/allocation/actions.ts","../src/allocation/bin-focus.ts","../src/allocation/choices.ts","../src/allocation/table-rows.ts","../src/allocation/drag.ts","../src/allocation/toolbar.tsx","../src/allocation/inspector-model.ts","../src/allocation/narrowed.tsx","../src/allocation/split.tsx","../src/allocation/table.tsx","../src/allocation/cards.tsx","../src/allocation/data.ts","../src/allocation/find.ts","../src/allocation/fit.ts","../src/allocation/footer.tsx","../src/allocation/hidden.ts","../src/allocation/timeline-layout.ts","../src/allocation/inspector.tsx","../src/allocation/library.tsx","../src/allocation/messages.ts","../src/allocation/optimise.ts","../src/shared/links/look.ts","../src/shared/links/geometry.ts","../src/shared/links/layer.tsx","../src/shared/links/scroll.ts","../src/shared/links/captions.ts","../src/allocation/links.ts","../src/allocation/timeline.tsx","../src/allocation/window.ts","../src/allocation/index.tsx","../src/plan/geometry.ts","../src/plan/context.ts","../src/plan/use-plan-paging.ts","../src/plan/messages.ts","../src/plan/words.ts","../src/plan/row-tree.ts","../src/plan/row-key.ts","../src/plan/instant.ts","../src/plan/reductions.ts","../src/plan/fold.ts","../src/plan/quantity.ts","../src/plan/row-instants.ts","../src/plan/derive.ts","../src/plan/body-items.ts","../src/plan/model.ts","../src/plan/controller/react.ts","../src/plan/root/grid.ts","../src/shared/time/slot.ts","../src/plan/slot.ts","../src/plan/edit/store.ts","../src/plan/edit/movable.tsx","../src/plan/edit/use-carry.ts","../../../../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/init.js","../../../../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js","../../../../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/number.js","../../../../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/continuous.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatDecimal.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/exponent.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatGroup.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatNumerals.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatSpecifier.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatTrim.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatPrefixAuto.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatRounded.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatTypes.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/identity.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/locale.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/defaultLocale.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionFixed.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionPrefix.js","../../../../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionRound.js","../../../../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/tickFormat.js","../../../../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/domain.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/range.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/align.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/base.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/clamp.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/constant.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/exponent.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/utils/createColorInterpolator.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/interpolate.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/utils/isUtcScale.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/nice.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/padding.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/reverse.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/round.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/unknown.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/zero.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/operators/scaleOperator.js","../../../../../node_modules/.pnpm/@visx+scale@3.12.0/node_modules/@visx/scale/esm/scales/linear.js","../src/plan/rows/chart-geometry.ts","../src/plan/a11y.ts","../src/plan/rows/element-select.ts","../src/plan/rows/RowShell.tsx","../src/plan/rows/RunRow.tsx","../src/plan/rows/PartBoundary.tsx","../src/plan/scale.ts","../src/plan/axis.ts","../src/plan/root/sources.ts","../src/plan/use-plan-editing.ts","../src/plan/edit/events.ts","../src/plan/frame/resources.ts","../src/plan/frame/library.tsx","../src/plan/edit/event-drag.ts","../src/plan/rows/HeatRow.tsx","../src/plan/rows/RowDiagnostic.tsx","../src/plan/narrow/pan.ts","../src/plan/rows/element-overlap.ts","../src/plan/rows/element-draft.ts","../src/plan/rows/element-optimise.ts","../src/plan/rows/SpanRow.tsx","../../../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js","../../../../../node_modules/.pnpm/d3-path@1.0.9/node_modules/d3-path/src/path.js","../../../../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/constant.js","../../../../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/curve/linear.js","../../../../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/point.js","../../../../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/line.js","../../../../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/area.js","../../../../../node_modules/.pnpm/@visx+shape@3.12.0_react@19.2.4/node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js","../../../../../node_modules/.pnpm/@visx+shape@3.12.0_react@19.2.4/node_modules/@visx/shape/esm/util/D3ShapeFactories.js","../../../../../node_modules/.pnpm/@visx+shape@3.12.0_react@19.2.4/node_modules/@visx/shape/esm/shapes/LinePath.js","../../../../../node_modules/.pnpm/@visx+shape@3.12.0_react@19.2.4/node_modules/@visx/shape/esm/shapes/Area.js","../../../../../node_modules/.pnpm/@visx+shape@3.12.0_react@19.2.4/node_modules/@visx/shape/esm/shapes/Bar.js","../src/plan/rows/ToneStrip.tsx","../src/plan/rows/ChartRow.tsx","../src/plan/rows/tile-fold.ts","../src/plan/rows/BucketCell.tsx","../src/plan/rows/BucketsRow.tsx","../src/plan/rows/CardsRow.tsx","../src/plan/rows/EventsRow.tsx","../src/sheet/parse/quantity.ts","../src/plan/edit/typing.ts","../src/plan/rows/CellInput.tsx","../src/plan/use-element-height.ts","../src/plan/rows/TableRow.tsx","../src/plan/rows/KindPlot.tsx","../src/plan/narrow/cards.tsx","../src/plan/narrow/chrome.tsx","../src/plan/narrow/demand.ts","../src/plan/rows/GroupRow.tsx","../src/plan/narrow/lists.ts","../src/plan/narrow/index.tsx","../src/plan/shell/ribbon-layout.ts","../src/plan/shell/LinksOverlay.tsx","../src/plan/plan-state.ts","../src/plan/persisted.ts","../src/plan/window-reader.ts","../src/plan/controller/paging.ts","../src/plan/use-seek.ts","../src/plan/controller/seek.ts","../src/plan/root/window.ts","../src/plan/controller/effects.ts","../src/plan/controller/index.ts","../src/plan/root/view.ts","../src/plan/frame/hidden.ts","../src/plan/root/cells.ts","../src/plan/root/events.ts","../src/plan/root/bounds.ts","../src/shared/records/drafts.ts","../src/plan/root/nested.ts","../src/plan/root/host-bound.ts","../src/plan/root/focus.ts","../src/plan/root/body.ts","../src/plan/rows/row-facts.ts","../src/plan/rows/BodyRow.tsx","../src/plan/root/rows.tsx","../src/plan/shell/horizon-density.ts","../src/plan/shell/HorizonBrush.tsx","../src/plan/shell/FocusBar.tsx","../src/plan/shell/Ruler.tsx","../src/plan/root/Header.tsx","../src/plan/root/cursor.ts","../src/plan/root/drop.ts","../src/plan/root/overlays.tsx","../src/plan/root/keyboard.ts","../src/plan/root/announce.tsx","../src/plan/find.ts","../src/plan/edit/announce.tsx","../src/plan/root/inspect.ts","../src/plan/optimise.ts","../src/plan/canvas.tsx","../src/plan/shell/Diagnostics.tsx","../src/plan/shell/TimeNavigator.tsx","../src/plan/shell/Toolbar.tsx","../src/plan/shell/Footer.tsx","../src/plan/frame/counts.ts","../src/plan/frame/inspector.tsx","../src/plan/frame/index.tsx","../src/sheet/sheet-types.ts","../src/sheet/parse/date.ts","../src/sheet/actions/model.ts","../src/sheet/model.ts","../src/sheet/link/grammar.ts","../src/sheet/messages.ts","../src/sheet/words.ts","../src/sheet/Footer.tsx","../src/sheet/key-order.ts","../src/sheet/view-state.ts","../src/sheet/creation.ts","../src/sheet/suggest.ts","../src/sheet/suggest-async.ts","../src/sheet/gutter.ts","../src/sheet/use-decode.ts","../src/sheet/paged-snapshot.ts","../src/sheet/paging.ts","../src/sheet/persisted.ts","../src/sheet/optimise.ts","../src/sheet/lens-layout.ts","../src/sheet/use-lens.ts","../src/sheet/candidates.ts","../src/sheet/sheet-link-state.ts","../src/sheet/sheet-suggest-state.ts","../src/sheet/lens.ts","../src/sheet/sheet-tabs-state.ts","../src/sheet/sheet-state.ts","../src/sheet/placement.ts","../src/sheet/readiness.ts","../src/sheet/shown-drafts.ts","../src/sheet/bounds.ts","../src/sheet/day.tsx","../src/sheet/standing-rows.ts","../src/sheet/use-editing.ts","../src/sheet/cells-from-data.ts","../src/sheet/draft-state.ts","../src/sheet/local-rows.ts","../src/sheet/use-session.ts","../src/sheet/link/sides.ts","../src/sheet/link/predict.ts","../src/sheet/link/checks.ts","../src/sheet/use-links.ts","../src/sheet/membership.ts","../src/sheet/cells/LinkCell.tsx","../src/sheet/cells/Cell.tsx","../src/sheet/detail.ts","../src/sheet/Insertion.tsx","../src/sheet/actions/ActionCell.tsx","../src/sheet/Rows.tsx","../src/sheet/insertion-gesture.ts","../src/sheet/drop.ts","../src/sheet/items.ts","../src/sheet/use-body.ts","../src/sheet/steps.ts","../src/sheet/parse/index.ts","../src/sheet/use-machine.ts","../src/sheet/use-writes.ts","../src/sheet/use-copilot.ts","../src/sheet/clipboard.ts","../src/sheet/use-effects.ts","../src/sheet/use-gestures.ts","../src/sheet/Pager.tsx","../src/sheet/use-input.ts","../src/sheet/Editor.tsx","../src/sheet/use-open-editor.ts","../src/sheet/use-reading.ts","../src/sheet/use-seek.ts","../src/sheet/use-jumps.ts","../src/sheet/use-record-view-counts.ts","../src/sheet/Tabs.tsx","../src/sheet/use-view-tabs.tsx","../src/sheet/link/arity.ts","../src/sheet/Strip.tsx","../src/sheet/use-ring.ts","../src/sheet/use-scroll.tsx","../src/sheet/use-row-parts.ts","../src/sheet/actions/host.ts","../src/sheet/actions/form-check.ts","../src/sheet/actions/ActionOverlay.tsx","../src/sheet/actions/ActionPanel.tsx","../src/sheet/actions/ActionBar.tsx","../src/sheet/use-actions.tsx","../src/sheet/use-rows.tsx","../src/sheet/use-inspector.tsx","../src/sheet/use-drops.ts","../src/sheet/Header.tsx","../src/sheet/Toolbar.tsx","../src/sheet/use-assembled.tsx","../src/sheet/index.tsx","../src/sheet/frame/inspector.tsx","../src/sheet/frame/phone-library.tsx","../src/sheet/frame/library.tsx","../src/sheet/frame/sources.ts","../src/sheet/frame/index.tsx","../src/record/clock.tsx","../src/record/messages.ts","../src/record/cells.tsx","../src/record/footer.tsx","../src/record/grid.tsx","../src/record/inspector.tsx","../src/record/status.ts","../src/record/strip.tsx","../src/record/ticks.ts","../src/record/toolbar.tsx","../src/record/index.tsx","../src/shared/frame-keys.ts","../src/flowchart/details.ts","../src/flowchart/details-words.ts","../src/flowchart/details-draw.ts","../src/flowchart/details-card.tsx","../src/flowchart/layout.ts","../src/shared/scroll-rest.ts","../src/flowchart/lane-pager.tsx","../src/flowchart/connect.ts","../src/flowchart/edits.ts","../src/flowchart/selection.ts","../src/flowchart/drop.ts","../src/flowchart/canvas.tsx","../src/flowchart/read.ts","../src/flowchart/drafted.ts","../src/shared/schedule/use-drafted-rows.ts","../src/flowchart/editing.ts","../src/flowchart/find.ts","../src/flowchart/footer.tsx","../src/flowchart/details-pane.tsx","../src/shared/schedule/key-draft.tsx","../src/flowchart/model.ts","../src/flowchart/inspector.tsx","../src/flowchart/issues.ts","../src/flowchart/library.tsx","../src/flowchart/messages.ts","../src/flowchart/orientation.ts","../src/flowchart/sources.ts","../src/shared/schedule/zoom.tsx","../src/flowchart/toolbar.tsx","../src/flowchart/use-drop.ts","../src/flowchart/index.tsx","../../../../../node_modules/.pnpm/quickselect@3.0.0/node_modules/quickselect/index.js","../../../../../node_modules/.pnpm/rbush@4.0.1/node_modules/rbush/index.js","../src/schematic/canvas/drawn.ts","../src/schematic/canvas/model.ts","../src/schematic/made-rows.ts","../src/schematic/area.ts","../src/schematic/backlog.ts","../src/schematic/kind-rows.ts","../src/schematic/backlog-pages.ts","../src/schematic/record-keys.ts","../src/schematic/bounds.ts","../src/shared/links/canvas.ts","../src/schematic/canvas/camera.ts","../src/schematic/canvas/markers.ts","../src/schematic/canvas/routes.ts","../src/schematic/canvas/paint.ts","../src/schematic/canvas/selection.ts","../src/schematic/canvas/tints.ts","../src/schematic/canvas/card.tsx","../src/schematic/canvas/card-layer.tsx","../src/schematic/canvas/theme.tsx","../src/schematic/canvas/minimap.ts","../src/schematic/index-tree.ts","../src/schematic/canvas/use-camera.ts","../src/schematic/edits.ts","../src/schematic/drop.ts","../src/schematic/canvas/use-canvas-drop.ts","../src/schematic/canvas/use-canvas-selection.ts","../src/schematic/canvas/use-paint.ts","../src/schematic/canvas/use-gestures.ts","../src/schematic/data.ts","../src/schematic/canvas/view.tsx","../src/schematic/canvas/layers.ts","../src/schematic/counts.ts","../src/schematic/area-counts.ts","../src/schematic/drafted.ts","../src/schematic/drafts-narrowing.ts","../src/schematic/editing.ts","../src/schematic/find.ts","../src/shared/schedule/footer.ts","../src/schematic/footer.tsx","../src/schematic/inspect.ts","../src/schematic/messages.ts","../src/schematic/inspector.tsx","../src/schematic/inspector-rows.ts","../src/schematic/issues.ts","../src/schematic/index-area.ts","../src/schematic/layers-view.ts","../src/schematic/index-tab.tsx","../src/schematic/layers-tab.tsx","../src/schematic/library.tsx","../src/schematic/selected-rows.ts","../src/schematic/narrowing.ts","../src/schematic/toolbar.tsx","../src/schematic/tools.ts","../src/schematic/use-drop.ts","../src/schematic/index.tsx","../src/hooks/repos.ts","../src/hooks/packages.ts","../src/hooks/workspaces.ts","../src/hooks/tasks.ts","../src/hooks/executions.ts","../src/hooks/useDatasetPage.ts","../src/hooks/useTaskDetails.ts","../src/components/ErrorBoundary.tsx","../src/components/InputPreview.tsx","../src/components/UITaskPreview.tsx","../src/components/VirtualizedLogViewer.tsx","../src/hooks/useTaskLogsHook.ts","../src/components/TaskLogs.tsx","../src/components/DataTaskPreview.tsx","../src/components/TaskPreview.tsx","../src/components/EastValueViewer.tsx"],"sourcesContent":["// src/subscribable.ts\nvar Subscribable = class {\n  constructor() {\n    this.listeners = /* @__PURE__ */ new Set();\n    this.subscribe = this.subscribe.bind(this);\n  }\n  subscribe(listener) {\n    this.listeners.add(listener);\n    this.onSubscribe();\n    return () => {\n      this.listeners.delete(listener);\n      this.onUnsubscribe();\n    };\n  }\n  hasListeners() {\n    return this.listeners.size > 0;\n  }\n  onSubscribe() {\n  }\n  onUnsubscribe() {\n  }\n};\nexport {\n  Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nvar FocusManager = class extends Subscribable {\n  #focused;\n  #cleanup;\n  #setup;\n  constructor() {\n    super();\n    this.#setup = (onFocus) => {\n      if (typeof window !== \"undefined\" && window.addEventListener) {\n        const listener = () => onFocus();\n        window.addEventListener(\"visibilitychange\", listener, false);\n        return () => {\n          window.removeEventListener(\"visibilitychange\", listener);\n        };\n      }\n      return;\n    };\n  }\n  onSubscribe() {\n    if (!this.#cleanup) {\n      this.setEventListener(this.#setup);\n    }\n  }\n  onUnsubscribe() {\n    if (!this.hasListeners()) {\n      this.#cleanup?.();\n      this.#cleanup = void 0;\n    }\n  }\n  setEventListener(setup) {\n    this.#setup = setup;\n    this.#cleanup?.();\n    this.#cleanup = setup((focused) => {\n      if (typeof focused === \"boolean\") {\n        this.setFocused(focused);\n      } else {\n        this.onFocus();\n      }\n    });\n  }\n  setFocused(focused) {\n    const changed = this.#focused !== focused;\n    if (changed) {\n      this.#focused = focused;\n      this.onFocus();\n    }\n  }\n  onFocus() {\n    const isFocused = this.isFocused();\n    this.listeners.forEach((listener) => {\n      listener(isFocused);\n    });\n  }\n  isFocused() {\n    if (typeof this.#focused === \"boolean\") {\n      return this.#focused;\n    }\n    return globalThis.document?.visibilityState !== \"hidden\";\n  }\n};\nvar focusManager = new FocusManager();\nexport {\n  FocusManager,\n  focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/timeoutManager.ts\nvar defaultTimeoutProvider = {\n  // We need the wrapper function syntax below instead of direct references to\n  // global setTimeout etc.\n  //\n  // BAD: `setTimeout: setTimeout`\n  // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n  //\n  // If we use direct references here, then anything that wants to spy on or\n  // replace the global setTimeout (like tests) won't work since we'll already\n  // have a hard reference to the original implementation at the time when this\n  // file was imported.\n  setTimeout: (callback, delay) => setTimeout(callback, delay),\n  clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n  setInterval: (callback, delay) => setInterval(callback, delay),\n  clearInterval: (intervalId) => clearInterval(intervalId)\n};\nvar TimeoutManager = class {\n  // We cannot have TimeoutManager<T> as we must instantiate it with a concrete\n  // type at app boot; and if we leave that type, then any new timer provider\n  // would need to support the default provider's concrete timer ID, which is\n  // infeasible across environments.\n  //\n  // We settle for type safety for the TimeoutProvider type, and accept that\n  // this class is unsafe internally to allow for extension.\n  #provider = defaultTimeoutProvider;\n  #providerCalled = false;\n  setTimeoutProvider(provider) {\n    if (process.env.NODE_ENV !== \"production\") {\n      if (this.#providerCalled && provider !== this.#provider) {\n        console.error(\n          `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n          { previous: this.#provider, provider }\n        );\n      }\n    }\n    this.#provider = provider;\n    if (process.env.NODE_ENV !== \"production\") {\n      this.#providerCalled = false;\n    }\n  }\n  setTimeout(callback, delay) {\n    if (process.env.NODE_ENV !== \"production\") {\n      this.#providerCalled = true;\n    }\n    return this.#provider.setTimeout(callback, delay);\n  }\n  clearTimeout(timeoutId) {\n    this.#provider.clearTimeout(timeoutId);\n  }\n  setInterval(callback, delay) {\n    if (process.env.NODE_ENV !== \"production\") {\n      this.#providerCalled = true;\n    }\n    return this.#provider.setInterval(callback, delay);\n  }\n  clearInterval(intervalId) {\n    this.#provider.clearInterval(intervalId);\n  }\n};\nvar timeoutManager = new TimeoutManager();\nfunction systemSetTimeoutZero(callback) {\n  setTimeout(callback, 0);\n}\nexport {\n  TimeoutManager,\n  defaultTimeoutProvider,\n  systemSetTimeoutZero,\n  timeoutManager\n};\n//# sourceMappingURL=timeoutManager.js.map","// src/utils.ts\nimport { timeoutManager } from \"./timeoutManager.js\";\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n}\nfunction functionalUpdate(updater, input) {\n  return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n  return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n  return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveStaleTime(staleTime, query) {\n  return typeof staleTime === \"function\" ? staleTime(query) : staleTime;\n}\nfunction resolveEnabled(enabled, query) {\n  return typeof enabled === \"function\" ? enabled(query) : enabled;\n}\nfunction matchQuery(filters, query) {\n  const {\n    type = \"all\",\n    exact,\n    fetchStatus,\n    predicate,\n    queryKey,\n    stale\n  } = filters;\n  if (queryKey) {\n    if (exact) {\n      if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n        return false;\n      }\n    } else if (!partialMatchKey(query.queryKey, queryKey)) {\n      return false;\n    }\n  }\n  if (type !== \"all\") {\n    const isActive = query.isActive();\n    if (type === \"active\" && !isActive) {\n      return false;\n    }\n    if (type === \"inactive\" && isActive) {\n      return false;\n    }\n  }\n  if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n    return false;\n  }\n  if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n    return false;\n  }\n  if (predicate && !predicate(query)) {\n    return false;\n  }\n  return true;\n}\nfunction matchMutation(filters, mutation) {\n  const { exact, status, predicate, mutationKey } = filters;\n  if (mutationKey) {\n    if (!mutation.options.mutationKey) {\n      return false;\n    }\n    if (exact) {\n      if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n        return false;\n      }\n    } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n      return false;\n    }\n  }\n  if (status && mutation.state.status !== status) {\n    return false;\n  }\n  if (predicate && !predicate(mutation)) {\n    return false;\n  }\n  return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n  const hashFn = options?.queryKeyHashFn || hashKey;\n  return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n  return JSON.stringify(\n    queryKey,\n    (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n      result[key] = val[key];\n      return result;\n    }, {}) : val\n  );\n}\nfunction partialMatchKey(a, b) {\n  if (a === b) {\n    return true;\n  }\n  if (typeof a !== typeof b) {\n    return false;\n  }\n  if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n    return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]));\n  }\n  return false;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\nfunction replaceEqualDeep(a, b, depth = 0) {\n  if (a === b) {\n    return a;\n  }\n  if (depth > 500) return b;\n  const array = isPlainArray(a) && isPlainArray(b);\n  if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;\n  const aItems = array ? a : Object.keys(a);\n  const aSize = aItems.length;\n  const bItems = array ? b : Object.keys(b);\n  const bSize = bItems.length;\n  const copy = array ? new Array(bSize) : {};\n  let equalItems = 0;\n  for (let i = 0; i < bSize; i++) {\n    const key = array ? i : bItems[i];\n    const aItem = a[key];\n    const bItem = b[key];\n    if (aItem === bItem) {\n      copy[key] = aItem;\n      if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;\n      continue;\n    }\n    if (aItem === null || bItem === null || typeof aItem !== \"object\" || typeof bItem !== \"object\") {\n      copy[key] = bItem;\n      continue;\n    }\n    const v = replaceEqualDeep(aItem, bItem, depth + 1);\n    copy[key] = v;\n    if (v === aItem) equalItems++;\n  }\n  return aSize === bSize && equalItems === aSize ? a : copy;\n}\nfunction shallowEqualObjects(a, b) {\n  if (!b || Object.keys(a).length !== Object.keys(b).length) {\n    return false;\n  }\n  for (const key in a) {\n    if (a[key] !== b[key]) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction isPlainArray(value) {\n  return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n  if (!hasObjectPrototype(o)) {\n    return false;\n  }\n  const ctor = o.constructor;\n  if (ctor === void 0) {\n    return true;\n  }\n  const prot = ctor.prototype;\n  if (!hasObjectPrototype(prot)) {\n    return false;\n  }\n  if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n    return false;\n  }\n  if (Object.getPrototypeOf(o) !== Object.prototype) {\n    return false;\n  }\n  return true;\n}\nfunction hasObjectPrototype(o) {\n  return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n  return new Promise((resolve) => {\n    timeoutManager.setTimeout(resolve, timeout);\n  });\n}\nfunction replaceData(prevData, data, options) {\n  if (typeof options.structuralSharing === \"function\") {\n    return options.structuralSharing(prevData, data);\n  } else if (options.structuralSharing !== false) {\n    if (process.env.NODE_ENV !== \"production\") {\n      try {\n        return replaceEqualDeep(prevData, data);\n      } catch (error) {\n        console.error(\n          `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`\n        );\n        throw error;\n      }\n    }\n    return replaceEqualDeep(prevData, data);\n  }\n  return data;\n}\nfunction keepPreviousData(previousData) {\n  return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n  const newItems = [...items, item];\n  return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n  const newItems = [item, ...items];\n  return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = /* @__PURE__ */ Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\n  if (process.env.NODE_ENV !== \"production\") {\n    if (options.queryFn === skipToken) {\n      console.error(\n        `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`\n      );\n    }\n  }\n  if (!options.queryFn && fetchOptions?.initialPromise) {\n    return () => fetchOptions.initialPromise;\n  }\n  if (!options.queryFn || options.queryFn === skipToken) {\n    return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));\n  }\n  return options.queryFn;\n}\nfunction shouldThrowError(throwOnError, params) {\n  if (typeof throwOnError === \"function\") {\n    return throwOnError(...params);\n  }\n  return !!throwOnError;\n}\nfunction addConsumeAwareSignal(object, getSignal, onCancelled) {\n  let consumed = false;\n  let signal;\n  Object.defineProperty(object, \"signal\", {\n    enumerable: true,\n    get: () => {\n      signal ??= getSignal();\n      if (consumed) {\n        return signal;\n      }\n      consumed = true;\n      if (signal.aborted) {\n        onCancelled();\n      } else {\n        signal.addEventListener(\"abort\", onCancelled, { once: true });\n      }\n      return signal;\n    }\n  });\n  return object;\n}\nexport {\n  addConsumeAwareSignal,\n  addToEnd,\n  addToStart,\n  ensureQueryFn,\n  functionalUpdate,\n  hashKey,\n  hashQueryKeyByOptions,\n  isPlainArray,\n  isPlainObject,\n  isServer,\n  isValidTimeout,\n  keepPreviousData,\n  matchMutation,\n  matchQuery,\n  noop,\n  partialMatchKey,\n  replaceData,\n  replaceEqualDeep,\n  resolveEnabled,\n  resolveStaleTime,\n  shallowEqualObjects,\n  shouldThrowError,\n  skipToken,\n  sleep,\n  timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","// src/environmentManager.ts\nimport { isServer } from \"./utils.js\";\nvar environmentManager = /* @__PURE__ */ (() => {\n  let isServerFn = () => isServer;\n  return {\n    /**\n     * Returns whether the current runtime should be treated as a server environment.\n     */\n    isServer() {\n      return isServerFn();\n    },\n    /**\n     * Overrides the server check globally.\n     */\n    setIsServer(isServerValue) {\n      isServerFn = isServerValue;\n    }\n  };\n})();\nexport {\n  environmentManager\n};\n//# sourceMappingURL=environmentManager.js.map","// src/thenable.ts\nimport { noop } from \"./utils.js\";\nfunction pendingThenable() {\n  let resolve;\n  let reject;\n  const thenable = new Promise((_resolve, _reject) => {\n    resolve = _resolve;\n    reject = _reject;\n  });\n  thenable.status = \"pending\";\n  thenable.catch(() => {\n  });\n  function finalize(data) {\n    Object.assign(thenable, data);\n    delete thenable.resolve;\n    delete thenable.reject;\n  }\n  thenable.resolve = (value) => {\n    finalize({\n      status: \"fulfilled\",\n      value\n    });\n    resolve(value);\n  };\n  thenable.reject = (reason) => {\n    finalize({\n      status: \"rejected\",\n      reason\n    });\n    reject(reason);\n  };\n  return thenable;\n}\nfunction tryResolveSync(promise) {\n  let data;\n  promise.then((result) => {\n    data = result;\n    return result;\n  }, noop)?.catch(noop);\n  if (data !== void 0) {\n    return { data };\n  }\n  return void 0;\n}\nexport {\n  pendingThenable,\n  tryResolveSync\n};\n//# sourceMappingURL=thenable.js.map","// src/notifyManager.ts\nimport { systemSetTimeoutZero } from \"./timeoutManager.js\";\nvar defaultScheduler = systemSetTimeoutZero;\nfunction createNotifyManager() {\n  let queue = [];\n  let transactions = 0;\n  let notifyFn = (callback) => {\n    callback();\n  };\n  let batchNotifyFn = (callback) => {\n    callback();\n  };\n  let scheduleFn = defaultScheduler;\n  const schedule = (callback) => {\n    if (transactions) {\n      queue.push(callback);\n    } else {\n      scheduleFn(() => {\n        notifyFn(callback);\n      });\n    }\n  };\n  const flush = () => {\n    const originalQueue = queue;\n    queue = [];\n    if (originalQueue.length) {\n      scheduleFn(() => {\n        batchNotifyFn(() => {\n          originalQueue.forEach((callback) => {\n            notifyFn(callback);\n          });\n        });\n      });\n    }\n  };\n  return {\n    batch: (callback) => {\n      let result;\n      transactions++;\n      try {\n        result = callback();\n      } finally {\n        transactions--;\n        if (!transactions) {\n          flush();\n        }\n      }\n      return result;\n    },\n    /**\n     * All calls to the wrapped function will be batched.\n     */\n    batchCalls: (callback) => {\n      return (...args) => {\n        schedule(() => {\n          callback(...args);\n        });\n      };\n    },\n    schedule,\n    /**\n     * Use this method to set a custom notify function.\n     * This can be used to for example wrap notifications with `React.act` while running tests.\n     */\n    setNotifyFunction: (fn) => {\n      notifyFn = fn;\n    },\n    /**\n     * Use this method to set a custom function to batch notifications together into a single tick.\n     * By default React Query will use the batch function provided by ReactDOM or React Native.\n     */\n    setBatchNotifyFunction: (fn) => {\n      batchNotifyFn = fn;\n    },\n    setScheduler: (fn) => {\n      scheduleFn = fn;\n    }\n  };\n}\nvar notifyManager = createNotifyManager();\nexport {\n  createNotifyManager,\n  defaultScheduler,\n  notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nvar OnlineManager = class extends Subscribable {\n  #online = true;\n  #cleanup;\n  #setup;\n  constructor() {\n    super();\n    this.#setup = (onOnline) => {\n      if (typeof window !== \"undefined\" && window.addEventListener) {\n        const onlineListener = () => onOnline(true);\n        const offlineListener = () => onOnline(false);\n        window.addEventListener(\"online\", onlineListener, false);\n        window.addEventListener(\"offline\", offlineListener, false);\n        return () => {\n          window.removeEventListener(\"online\", onlineListener);\n          window.removeEventListener(\"offline\", offlineListener);\n        };\n      }\n      return;\n    };\n  }\n  onSubscribe() {\n    if (!this.#cleanup) {\n      this.setEventListener(this.#setup);\n    }\n  }\n  onUnsubscribe() {\n    if (!this.hasListeners()) {\n      this.#cleanup?.();\n      this.#cleanup = void 0;\n    }\n  }\n  setEventListener(setup) {\n    this.#setup = setup;\n    this.#cleanup?.();\n    this.#cleanup = setup(this.setOnline.bind(this));\n  }\n  setOnline(online) {\n    const changed = this.#online !== online;\n    if (changed) {\n      this.#online = online;\n      this.listeners.forEach((listener) => {\n        listener(online);\n      });\n    }\n  }\n  isOnline() {\n    return this.#online;\n  }\n};\nvar onlineManager = new OnlineManager();\nexport {\n  OnlineManager,\n  onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport { environmentManager } from \"./environmentManager.js\";\nimport { sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n  return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n  return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class extends Error {\n  constructor(options) {\n    super(\"CancelledError\");\n    this.revert = options?.revert;\n    this.silent = options?.silent;\n  }\n};\nfunction isCancelledError(value) {\n  return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n  let isRetryCancelled = false;\n  let failureCount = 0;\n  let continueFn;\n  const thenable = pendingThenable();\n  const isResolved = () => thenable.status !== \"pending\";\n  const cancel = (cancelOptions) => {\n    if (!isResolved()) {\n      const error = new CancelledError(cancelOptions);\n      reject(error);\n      config.onCancel?.(error);\n    }\n  };\n  const cancelRetry = () => {\n    isRetryCancelled = true;\n  };\n  const continueRetry = () => {\n    isRetryCancelled = false;\n  };\n  const canContinue = () => focusManager.isFocused() && (config.networkMode === \"always\" || onlineManager.isOnline()) && config.canRun();\n  const canStart = () => canFetch(config.networkMode) && config.canRun();\n  const resolve = (value) => {\n    if (!isResolved()) {\n      continueFn?.();\n      thenable.resolve(value);\n    }\n  };\n  const reject = (value) => {\n    if (!isResolved()) {\n      continueFn?.();\n      thenable.reject(value);\n    }\n  };\n  const pause = () => {\n    return new Promise((continueResolve) => {\n      continueFn = (value) => {\n        if (isResolved() || canContinue()) {\n          continueResolve(value);\n        }\n      };\n      config.onPause?.();\n    }).then(() => {\n      continueFn = void 0;\n      if (!isResolved()) {\n        config.onContinue?.();\n      }\n    });\n  };\n  const run = () => {\n    if (isResolved()) {\n      return;\n    }\n    let promiseOrValue;\n    const initialPromise = failureCount === 0 ? config.initialPromise : void 0;\n    try {\n      promiseOrValue = initialPromise ?? config.fn();\n    } catch (error) {\n      promiseOrValue = Promise.reject(error);\n    }\n    Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n      if (isResolved()) {\n        return;\n      }\n      const retry = config.retry ?? (environmentManager.isServer() ? 0 : 3);\n      const retryDelay = config.retryDelay ?? defaultRetryDelay;\n      const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n      const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n      if (isRetryCancelled || !shouldRetry) {\n        reject(error);\n        return;\n      }\n      failureCount++;\n      config.onFail?.(failureCount, error);\n      sleep(delay).then(() => {\n        return canContinue() ? void 0 : pause();\n      }).then(() => {\n        if (isRetryCancelled) {\n          reject(error);\n        } else {\n          run();\n        }\n      });\n    });\n  };\n  return {\n    promise: thenable,\n    status: () => thenable.status,\n    cancel,\n    continue: () => {\n      continueFn?.();\n      return thenable;\n    },\n    cancelRetry,\n    continueRetry,\n    canStart,\n    start: () => {\n      if (canStart()) {\n        run();\n      } else {\n        pause().then(run);\n      }\n      return thenable;\n    }\n  };\n}\nexport {\n  CancelledError,\n  canFetch,\n  createRetryer,\n  isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/removable.ts\nimport { timeoutManager } from \"./timeoutManager.js\";\nimport { environmentManager } from \"./environmentManager.js\";\nimport { isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n  #gcTimeout;\n  destroy() {\n    this.clearGcTimeout();\n  }\n  scheduleGc() {\n    this.clearGcTimeout();\n    if (isValidTimeout(this.gcTime)) {\n      this.#gcTimeout = timeoutManager.setTimeout(() => {\n        this.optionalRemove();\n      }, this.gcTime);\n    }\n  }\n  updateGcTime(newGcTime) {\n    this.gcTime = Math.max(\n      this.gcTime || 0,\n      newGcTime ?? (environmentManager.isServer() ? Infinity : 5 * 60 * 1e3)\n    );\n  }\n  clearGcTimeout() {\n    if (this.#gcTimeout) {\n      timeoutManager.clearTimeout(this.#gcTimeout);\n      this.#gcTimeout = void 0;\n    }\n  }\n};\nexport {\n  Removable\n};\n//# sourceMappingURL=removable.js.map","// src/query.ts\nimport {\n  ensureQueryFn,\n  noop,\n  replaceData,\n  resolveEnabled,\n  resolveStaleTime,\n  skipToken,\n  timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { CancelledError, canFetch, createRetryer } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n  #initialState;\n  #revertState;\n  #cache;\n  #client;\n  #retryer;\n  #defaultOptions;\n  #abortSignalConsumed;\n  constructor(config) {\n    super();\n    this.#abortSignalConsumed = false;\n    this.#defaultOptions = config.defaultOptions;\n    this.setOptions(config.options);\n    this.observers = [];\n    this.#client = config.client;\n    this.#cache = this.#client.getQueryCache();\n    this.queryKey = config.queryKey;\n    this.queryHash = config.queryHash;\n    this.#initialState = getDefaultState(this.options);\n    this.state = config.state ?? this.#initialState;\n    this.scheduleGc();\n  }\n  get meta() {\n    return this.options.meta;\n  }\n  get promise() {\n    return this.#retryer?.promise;\n  }\n  setOptions(options) {\n    this.options = { ...this.#defaultOptions, ...options };\n    this.updateGcTime(this.options.gcTime);\n    if (this.state && this.state.data === void 0) {\n      const defaultState = getDefaultState(this.options);\n      if (defaultState.data !== void 0) {\n        this.setState(\n          successState(defaultState.data, defaultState.dataUpdatedAt)\n        );\n        this.#initialState = defaultState;\n      }\n    }\n  }\n  optionalRemove() {\n    if (!this.observers.length && this.state.fetchStatus === \"idle\") {\n      this.#cache.remove(this);\n    }\n  }\n  setData(newData, options) {\n    const data = replaceData(this.state.data, newData, this.options);\n    this.#dispatch({\n      data,\n      type: \"success\",\n      dataUpdatedAt: options?.updatedAt,\n      manual: options?.manual\n    });\n    return data;\n  }\n  setState(state, setStateOptions) {\n    this.#dispatch({ type: \"setState\", state, setStateOptions });\n  }\n  cancel(options) {\n    const promise = this.#retryer?.promise;\n    this.#retryer?.cancel(options);\n    return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n  }\n  destroy() {\n    super.destroy();\n    this.cancel({ silent: true });\n  }\n  get resetState() {\n    return this.#initialState;\n  }\n  reset() {\n    this.destroy();\n    this.setState(this.resetState);\n  }\n  isActive() {\n    return this.observers.some(\n      (observer) => resolveEnabled(observer.options.enabled, this) !== false\n    );\n  }\n  isDisabled() {\n    if (this.getObserversCount() > 0) {\n      return !this.isActive();\n    }\n    return this.options.queryFn === skipToken || !this.isFetched();\n  }\n  isFetched() {\n    return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;\n  }\n  isStatic() {\n    if (this.getObserversCount() > 0) {\n      return this.observers.some(\n        (observer) => resolveStaleTime(observer.options.staleTime, this) === \"static\"\n      );\n    }\n    return false;\n  }\n  isStale() {\n    if (this.getObserversCount() > 0) {\n      return this.observers.some(\n        (observer) => observer.getCurrentResult().isStale\n      );\n    }\n    return this.state.data === void 0 || this.state.isInvalidated;\n  }\n  isStaleByTime(staleTime = 0) {\n    if (this.state.data === void 0) {\n      return true;\n    }\n    if (staleTime === \"static\") {\n      return false;\n    }\n    if (this.state.isInvalidated) {\n      return true;\n    }\n    return !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n  }\n  onFocus() {\n    const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus());\n    observer?.refetch({ cancelRefetch: false });\n    this.#retryer?.continue();\n  }\n  onOnline() {\n    const observer = this.observers.find((x) => x.shouldFetchOnReconnect());\n    observer?.refetch({ cancelRefetch: false });\n    this.#retryer?.continue();\n  }\n  addObserver(observer) {\n    if (!this.observers.includes(observer)) {\n      this.observers.push(observer);\n      this.clearGcTimeout();\n      this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n    }\n  }\n  removeObserver(observer) {\n    if (this.observers.includes(observer)) {\n      this.observers = this.observers.filter((x) => x !== observer);\n      if (!this.observers.length) {\n        if (this.#retryer) {\n          if (this.#abortSignalConsumed || this.#isInitialPausedFetch()) {\n            this.#retryer.cancel({ revert: true });\n          } else {\n            this.#retryer.cancelRetry();\n          }\n        }\n        this.scheduleGc();\n      }\n      this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n    }\n  }\n  getObserversCount() {\n    return this.observers.length;\n  }\n  #isInitialPausedFetch() {\n    return this.state.fetchStatus === \"paused\" && this.state.status === \"pending\";\n  }\n  invalidate() {\n    if (!this.state.isInvalidated) {\n      this.#dispatch({ type: \"invalidate\" });\n    }\n  }\n  async fetch(options, fetchOptions) {\n    if (this.state.fetchStatus !== \"idle\" && // If the promise in the retryer is already rejected, we have to definitely\n    // re-start the fetch; there is a chance that the query is still in a\n    // pending state when that happens\n    this.#retryer?.status() !== \"rejected\") {\n      if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n        this.cancel({ silent: true });\n      } else if (this.#retryer) {\n        this.#retryer.continueRetry();\n        return this.#retryer.promise;\n      }\n    }\n    if (options) {\n      this.setOptions(options);\n    }\n    if (!this.options.queryFn) {\n      const observer = this.observers.find((x) => x.options.queryFn);\n      if (observer) {\n        this.setOptions(observer.options);\n      }\n    }\n    if (process.env.NODE_ENV !== \"production\") {\n      if (!Array.isArray(this.options.queryKey)) {\n        console.error(\n          `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n        );\n      }\n    }\n    const abortController = new AbortController();\n    const addSignalProperty = (object) => {\n      Object.defineProperty(object, \"signal\", {\n        enumerable: true,\n        get: () => {\n          this.#abortSignalConsumed = true;\n          return abortController.signal;\n        }\n      });\n    };\n    const fetchFn = () => {\n      const queryFn = ensureQueryFn(this.options, fetchOptions);\n      const createQueryFnContext = () => {\n        const queryFnContext2 = {\n          client: this.#client,\n          queryKey: this.queryKey,\n          meta: this.meta\n        };\n        addSignalProperty(queryFnContext2);\n        return queryFnContext2;\n      };\n      const queryFnContext = createQueryFnContext();\n      this.#abortSignalConsumed = false;\n      if (this.options.persister) {\n        return this.options.persister(\n          queryFn,\n          queryFnContext,\n          this\n        );\n      }\n      return queryFn(queryFnContext);\n    };\n    const createFetchContext = () => {\n      const context2 = {\n        fetchOptions,\n        options: this.options,\n        queryKey: this.queryKey,\n        client: this.#client,\n        state: this.state,\n        fetchFn\n      };\n      addSignalProperty(context2);\n      return context2;\n    };\n    const context = createFetchContext();\n    this.options.behavior?.onFetch(context, this);\n    this.#revertState = this.state;\n    if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n      this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n    }\n    this.#retryer = createRetryer({\n      initialPromise: fetchOptions?.initialPromise,\n      fn: context.fetchFn,\n      onCancel: (error) => {\n        if (error instanceof CancelledError && error.revert) {\n          this.setState({\n            ...this.#revertState,\n            fetchStatus: \"idle\"\n          });\n        }\n        abortController.abort();\n      },\n      onFail: (failureCount, error) => {\n        this.#dispatch({ type: \"failed\", failureCount, error });\n      },\n      onPause: () => {\n        this.#dispatch({ type: \"pause\" });\n      },\n      onContinue: () => {\n        this.#dispatch({ type: \"continue\" });\n      },\n      retry: context.options.retry,\n      retryDelay: context.options.retryDelay,\n      networkMode: context.options.networkMode,\n      canRun: () => true\n    });\n    try {\n      const data = await this.#retryer.start();\n      if (data === void 0) {\n        if (process.env.NODE_ENV !== \"production\") {\n          console.error(\n            `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n          );\n        }\n        throw new Error(`${this.queryHash} data is undefined`);\n      }\n      this.setData(data);\n      this.#cache.config.onSuccess?.(data, this);\n      this.#cache.config.onSettled?.(\n        data,\n        this.state.error,\n        this\n      );\n      return data;\n    } catch (error) {\n      if (error instanceof CancelledError) {\n        if (error.silent) {\n          return this.#retryer.promise;\n        } else if (error.revert) {\n          if (this.state.data === void 0) {\n            throw error;\n          }\n          return this.state.data;\n        }\n      }\n      this.#dispatch({\n        type: \"error\",\n        error\n      });\n      this.#cache.config.onError?.(\n        error,\n        this\n      );\n      this.#cache.config.onSettled?.(\n        this.state.data,\n        error,\n        this\n      );\n      throw error;\n    } finally {\n      this.scheduleGc();\n    }\n  }\n  #dispatch(action) {\n    const reducer = (state) => {\n      switch (action.type) {\n        case \"failed\":\n          return {\n            ...state,\n            fetchFailureCount: action.failureCount,\n            fetchFailureReason: action.error\n          };\n        case \"pause\":\n          return {\n            ...state,\n            fetchStatus: \"paused\"\n          };\n        case \"continue\":\n          return {\n            ...state,\n            fetchStatus: \"fetching\"\n          };\n        case \"fetch\":\n          return {\n            ...state,\n            ...fetchState(state.data, this.options),\n            fetchMeta: action.meta ?? null\n          };\n        case \"success\":\n          const newState = {\n            ...state,\n            ...successState(action.data, action.dataUpdatedAt),\n            dataUpdateCount: state.dataUpdateCount + 1,\n            ...!action.manual && {\n              fetchStatus: \"idle\",\n              fetchFailureCount: 0,\n              fetchFailureReason: null\n            }\n          };\n          this.#revertState = action.manual ? newState : void 0;\n          return newState;\n        case \"error\":\n          const error = action.error;\n          return {\n            ...state,\n            error,\n            errorUpdateCount: state.errorUpdateCount + 1,\n            errorUpdatedAt: Date.now(),\n            fetchFailureCount: state.fetchFailureCount + 1,\n            fetchFailureReason: error,\n            fetchStatus: \"idle\",\n            status: \"error\",\n            // flag existing data as invalidated if we get a background error\n            // note that \"no data\" always means stale so we can set unconditionally here\n            isInvalidated: true\n          };\n        case \"invalidate\":\n          return {\n            ...state,\n            isInvalidated: true\n          };\n        case \"setState\":\n          return {\n            ...state,\n            ...action.state\n          };\n      }\n    };\n    this.state = reducer(this.state);\n    notifyManager.batch(() => {\n      this.observers.forEach((observer) => {\n        observer.onQueryUpdate();\n      });\n      this.#cache.notify({ query: this, type: \"updated\", action });\n    });\n  }\n};\nfunction fetchState(data, options) {\n  return {\n    fetchFailureCount: 0,\n    fetchFailureReason: null,\n    fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n    ...data === void 0 && {\n      error: null,\n      status: \"pending\"\n    }\n  };\n}\nfunction successState(data, dataUpdatedAt) {\n  return {\n    data,\n    dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n    error: null,\n    isInvalidated: false,\n    status: \"success\"\n  };\n}\nfunction getDefaultState(options) {\n  const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n  const hasData = data !== void 0;\n  const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n  return {\n    data,\n    dataUpdateCount: 0,\n    dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n    error: null,\n    errorUpdateCount: 0,\n    errorUpdatedAt: 0,\n    fetchFailureCount: 0,\n    fetchFailureReason: null,\n    fetchMeta: null,\n    isInvalidated: false,\n    status: hasData ? \"success\" : \"pending\",\n    fetchStatus: \"idle\"\n  };\n}\nexport {\n  Query,\n  fetchState\n};\n//# sourceMappingURL=query.js.map","// src/infiniteQueryBehavior.ts\nimport {\n  addConsumeAwareSignal,\n  addToEnd,\n  addToStart,\n  ensureQueryFn\n} from \"./utils.js\";\nfunction infiniteQueryBehavior(pages) {\n  return {\n    onFetch: (context, query) => {\n      const options = context.options;\n      const direction = context.fetchOptions?.meta?.fetchMore?.direction;\n      const oldPages = context.state.data?.pages || [];\n      const oldPageParams = context.state.data?.pageParams || [];\n      let result = { pages: [], pageParams: [] };\n      let currentPage = 0;\n      const fetchFn = async () => {\n        let cancelled = false;\n        const addSignalProperty = (object) => {\n          addConsumeAwareSignal(\n            object,\n            () => context.signal,\n            () => cancelled = true\n          );\n        };\n        const queryFn = ensureQueryFn(context.options, context.fetchOptions);\n        const fetchPage = async (data, param, previous) => {\n          if (cancelled) {\n            return Promise.reject();\n          }\n          if (param == null && data.pages.length) {\n            return Promise.resolve(data);\n          }\n          const createQueryFnContext = () => {\n            const queryFnContext2 = {\n              client: context.client,\n              queryKey: context.queryKey,\n              pageParam: param,\n              direction: previous ? \"backward\" : \"forward\",\n              meta: context.options.meta\n            };\n            addSignalProperty(queryFnContext2);\n            return queryFnContext2;\n          };\n          const queryFnContext = createQueryFnContext();\n          const page = await queryFn(queryFnContext);\n          const { maxPages } = context.options;\n          const addTo = previous ? addToStart : addToEnd;\n          return {\n            pages: addTo(data.pages, page, maxPages),\n            pageParams: addTo(data.pageParams, param, maxPages)\n          };\n        };\n        if (direction && oldPages.length) {\n          const previous = direction === \"backward\";\n          const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n          const oldData = {\n            pages: oldPages,\n            pageParams: oldPageParams\n          };\n          const param = pageParamFn(options, oldData);\n          result = await fetchPage(oldData, param, previous);\n        } else {\n          const remainingPages = pages ?? oldPages.length;\n          do {\n            const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);\n            if (currentPage > 0 && param == null) {\n              break;\n            }\n            result = await fetchPage(result, param);\n            currentPage++;\n          } while (currentPage < remainingPages);\n        }\n        return result;\n      };\n      if (context.options.persister) {\n        context.fetchFn = () => {\n          return context.options.persister?.(\n            fetchFn,\n            {\n              client: context.client,\n              queryKey: context.queryKey,\n              meta: context.options.meta,\n              signal: context.signal\n            },\n            query\n          );\n        };\n      } else {\n        context.fetchFn = fetchFn;\n      }\n    }\n  };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n  const lastIndex = pages.length - 1;\n  return pages.length > 0 ? options.getNextPageParam(\n    pages[lastIndex],\n    pages,\n    pageParams[lastIndex],\n    pageParams\n  ) : void 0;\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n  return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;\n}\nfunction hasNextPage(options, data) {\n  if (!data) return false;\n  return getNextPageParam(options, data) != null;\n}\nfunction hasPreviousPage(options, data) {\n  if (!data || !options.getPreviousPageParam) return false;\n  return getPreviousPageParam(options, data) != null;\n}\nexport {\n  hasNextPage,\n  hasPreviousPage,\n  infiniteQueryBehavior\n};\n//# sourceMappingURL=infiniteQueryBehavior.js.map","// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n  #client;\n  #observers;\n  #mutationCache;\n  #retryer;\n  constructor(config) {\n    super();\n    this.#client = config.client;\n    this.mutationId = config.mutationId;\n    this.#mutationCache = config.mutationCache;\n    this.#observers = [];\n    this.state = config.state || getDefaultState();\n    this.setOptions(config.options);\n    this.scheduleGc();\n  }\n  setOptions(options) {\n    this.options = options;\n    this.updateGcTime(this.options.gcTime);\n  }\n  get meta() {\n    return this.options.meta;\n  }\n  addObserver(observer) {\n    if (!this.#observers.includes(observer)) {\n      this.#observers.push(observer);\n      this.clearGcTimeout();\n      this.#mutationCache.notify({\n        type: \"observerAdded\",\n        mutation: this,\n        observer\n      });\n    }\n  }\n  removeObserver(observer) {\n    this.#observers = this.#observers.filter((x) => x !== observer);\n    this.scheduleGc();\n    this.#mutationCache.notify({\n      type: \"observerRemoved\",\n      mutation: this,\n      observer\n    });\n  }\n  optionalRemove() {\n    if (!this.#observers.length) {\n      if (this.state.status === \"pending\") {\n        this.scheduleGc();\n      } else {\n        this.#mutationCache.remove(this);\n      }\n    }\n  }\n  continue() {\n    return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n    this.execute(this.state.variables);\n  }\n  async execute(variables) {\n    const onContinue = () => {\n      this.#dispatch({ type: \"continue\" });\n    };\n    const mutationFnContext = {\n      client: this.#client,\n      meta: this.options.meta,\n      mutationKey: this.options.mutationKey\n    };\n    this.#retryer = createRetryer({\n      fn: () => {\n        if (!this.options.mutationFn) {\n          return Promise.reject(new Error(\"No mutationFn found\"));\n        }\n        return this.options.mutationFn(variables, mutationFnContext);\n      },\n      onFail: (failureCount, error) => {\n        this.#dispatch({ type: \"failed\", failureCount, error });\n      },\n      onPause: () => {\n        this.#dispatch({ type: \"pause\" });\n      },\n      onContinue,\n      retry: this.options.retry ?? 0,\n      retryDelay: this.options.retryDelay,\n      networkMode: this.options.networkMode,\n      canRun: () => this.#mutationCache.canRun(this)\n    });\n    const restored = this.state.status === \"pending\";\n    const isPaused = !this.#retryer.canStart();\n    try {\n      if (restored) {\n        onContinue();\n      } else {\n        this.#dispatch({ type: \"pending\", variables, isPaused });\n        if (this.#mutationCache.config.onMutate) {\n          await this.#mutationCache.config.onMutate(\n            variables,\n            this,\n            mutationFnContext\n          );\n        }\n        const context = await this.options.onMutate?.(\n          variables,\n          mutationFnContext\n        );\n        if (context !== this.state.context) {\n          this.#dispatch({\n            type: \"pending\",\n            context,\n            variables,\n            isPaused\n          });\n        }\n      }\n      const data = await this.#retryer.start();\n      await this.#mutationCache.config.onSuccess?.(\n        data,\n        variables,\n        this.state.context,\n        this,\n        mutationFnContext\n      );\n      await this.options.onSuccess?.(\n        data,\n        variables,\n        this.state.context,\n        mutationFnContext\n      );\n      await this.#mutationCache.config.onSettled?.(\n        data,\n        null,\n        this.state.variables,\n        this.state.context,\n        this,\n        mutationFnContext\n      );\n      await this.options.onSettled?.(\n        data,\n        null,\n        variables,\n        this.state.context,\n        mutationFnContext\n      );\n      this.#dispatch({ type: \"success\", data });\n      return data;\n    } catch (error) {\n      try {\n        await this.#mutationCache.config.onError?.(\n          error,\n          variables,\n          this.state.context,\n          this,\n          mutationFnContext\n        );\n      } catch (e) {\n        void Promise.reject(e);\n      }\n      try {\n        await this.options.onError?.(\n          error,\n          variables,\n          this.state.context,\n          mutationFnContext\n        );\n      } catch (e) {\n        void Promise.reject(e);\n      }\n      try {\n        await this.#mutationCache.config.onSettled?.(\n          void 0,\n          error,\n          this.state.variables,\n          this.state.context,\n          this,\n          mutationFnContext\n        );\n      } catch (e) {\n        void Promise.reject(e);\n      }\n      try {\n        await this.options.onSettled?.(\n          void 0,\n          error,\n          variables,\n          this.state.context,\n          mutationFnContext\n        );\n      } catch (e) {\n        void Promise.reject(e);\n      }\n      this.#dispatch({ type: \"error\", error });\n      throw error;\n    } finally {\n      this.#mutationCache.runNext(this);\n    }\n  }\n  #dispatch(action) {\n    const reducer = (state) => {\n      switch (action.type) {\n        case \"failed\":\n          return {\n            ...state,\n            failureCount: action.failureCount,\n            failureReason: action.error\n          };\n        case \"pause\":\n          return {\n            ...state,\n            isPaused: true\n          };\n        case \"continue\":\n          return {\n            ...state,\n            isPaused: false\n          };\n        case \"pending\":\n          return {\n            ...state,\n            context: action.context,\n            data: void 0,\n            failureCount: 0,\n            failureReason: null,\n            error: null,\n            isPaused: action.isPaused,\n            status: \"pending\",\n            variables: action.variables,\n            submittedAt: Date.now()\n          };\n        case \"success\":\n          return {\n            ...state,\n            data: action.data,\n            failureCount: 0,\n            failureReason: null,\n            error: null,\n            status: \"success\",\n            isPaused: false\n          };\n        case \"error\":\n          return {\n            ...state,\n            data: void 0,\n            error: action.error,\n            failureCount: state.failureCount + 1,\n            failureReason: action.error,\n            isPaused: false,\n            status: \"error\"\n          };\n      }\n    };\n    this.state = reducer(this.state);\n    notifyManager.batch(() => {\n      this.#observers.forEach((observer) => {\n        observer.onMutationUpdate(action);\n      });\n      this.#mutationCache.notify({\n        mutation: this,\n        type: \"updated\",\n        action\n      });\n    });\n  }\n};\nfunction getDefaultState() {\n  return {\n    context: void 0,\n    data: void 0,\n    error: null,\n    failureCount: 0,\n    failureReason: null,\n    isPaused: false,\n    status: \"idle\",\n    variables: void 0,\n    submittedAt: 0\n  };\n}\nexport {\n  Mutation,\n  getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationCache.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\nimport { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar MutationCache = class extends Subscribable {\n  constructor(config = {}) {\n    super();\n    this.config = config;\n    this.#mutations = /* @__PURE__ */ new Set();\n    this.#scopes = /* @__PURE__ */ new Map();\n    this.#mutationId = 0;\n  }\n  #mutations;\n  #scopes;\n  #mutationId;\n  build(client, options, state) {\n    const mutation = new Mutation({\n      client,\n      mutationCache: this,\n      mutationId: ++this.#mutationId,\n      options: client.defaultMutationOptions(options),\n      state\n    });\n    this.add(mutation);\n    return mutation;\n  }\n  add(mutation) {\n    this.#mutations.add(mutation);\n    const scope = scopeFor(mutation);\n    if (typeof scope === \"string\") {\n      const scopedMutations = this.#scopes.get(scope);\n      if (scopedMutations) {\n        scopedMutations.push(mutation);\n      } else {\n        this.#scopes.set(scope, [mutation]);\n      }\n    }\n    this.notify({ type: \"added\", mutation });\n  }\n  remove(mutation) {\n    if (this.#mutations.delete(mutation)) {\n      const scope = scopeFor(mutation);\n      if (typeof scope === \"string\") {\n        const scopedMutations = this.#scopes.get(scope);\n        if (scopedMutations) {\n          if (scopedMutations.length > 1) {\n            const index = scopedMutations.indexOf(mutation);\n            if (index !== -1) {\n              scopedMutations.splice(index, 1);\n            }\n          } else if (scopedMutations[0] === mutation) {\n            this.#scopes.delete(scope);\n          }\n        }\n      }\n    }\n    this.notify({ type: \"removed\", mutation });\n  }\n  canRun(mutation) {\n    const scope = scopeFor(mutation);\n    if (typeof scope === \"string\") {\n      const mutationsWithSameScope = this.#scopes.get(scope);\n      const firstPendingMutation = mutationsWithSameScope?.find(\n        (m) => m.state.status === \"pending\"\n      );\n      return !firstPendingMutation || firstPendingMutation === mutation;\n    } else {\n      return true;\n    }\n  }\n  runNext(mutation) {\n    const scope = scopeFor(mutation);\n    if (typeof scope === \"string\") {\n      const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused);\n      return foundMutation?.continue() ?? Promise.resolve();\n    } else {\n      return Promise.resolve();\n    }\n  }\n  clear() {\n    notifyManager.batch(() => {\n      this.#mutations.forEach((mutation) => {\n        this.notify({ type: \"removed\", mutation });\n      });\n      this.#mutations.clear();\n      this.#scopes.clear();\n    });\n  }\n  getAll() {\n    return Array.from(this.#mutations);\n  }\n  find(filters) {\n    const defaultedFilters = { exact: true, ...filters };\n    return this.getAll().find(\n      (mutation) => matchMutation(defaultedFilters, mutation)\n    );\n  }\n  findAll(filters = {}) {\n    return this.getAll().filter((mutation) => matchMutation(filters, mutation));\n  }\n  notify(event) {\n    notifyManager.batch(() => {\n      this.listeners.forEach((listener) => {\n        listener(event);\n      });\n    });\n  }\n  resumePausedMutations() {\n    const pausedMutations = this.getAll().filter((x) => x.state.isPaused);\n    return notifyManager.batch(\n      () => Promise.all(\n        pausedMutations.map((mutation) => mutation.continue().catch(noop))\n      )\n    );\n  }\n};\nfunction scopeFor(mutation) {\n  return mutation.options.scope?.id;\n}\nexport {\n  MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/queryCache.ts\nimport { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Query } from \"./query.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar QueryCache = class extends Subscribable {\n  constructor(config = {}) {\n    super();\n    this.config = config;\n    this.#queries = /* @__PURE__ */ new Map();\n  }\n  #queries;\n  build(client, options, state) {\n    const queryKey = options.queryKey;\n    const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n    let query = this.get(queryHash);\n    if (!query) {\n      query = new Query({\n        client,\n        queryKey,\n        queryHash,\n        options: client.defaultQueryOptions(options),\n        state,\n        defaultOptions: client.getQueryDefaults(queryKey)\n      });\n      this.add(query);\n    }\n    return query;\n  }\n  add(query) {\n    if (!this.#queries.has(query.queryHash)) {\n      this.#queries.set(query.queryHash, query);\n      this.notify({\n        type: \"added\",\n        query\n      });\n    }\n  }\n  remove(query) {\n    const queryInMap = this.#queries.get(query.queryHash);\n    if (queryInMap) {\n      query.destroy();\n      if (queryInMap === query) {\n        this.#queries.delete(query.queryHash);\n      }\n      this.notify({ type: \"removed\", query });\n    }\n  }\n  clear() {\n    notifyManager.batch(() => {\n      this.getAll().forEach((query) => {\n        this.remove(query);\n      });\n    });\n  }\n  get(queryHash) {\n    return this.#queries.get(queryHash);\n  }\n  getAll() {\n    return [...this.#queries.values()];\n  }\n  find(filters) {\n    const defaultedFilters = { exact: true, ...filters };\n    return this.getAll().find(\n      (query) => matchQuery(defaultedFilters, query)\n    );\n  }\n  findAll(filters = {}) {\n    const queries = this.getAll();\n    return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n  }\n  notify(event) {\n    notifyManager.batch(() => {\n      this.listeners.forEach((listener) => {\n        listener(event);\n      });\n    });\n  }\n  onFocus() {\n    notifyManager.batch(() => {\n      this.getAll().forEach((query) => {\n        query.onFocus();\n      });\n    });\n  }\n  onOnline() {\n    notifyManager.batch(() => {\n      this.getAll().forEach((query) => {\n        query.onOnline();\n      });\n    });\n  }\n};\nexport {\n  QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/queryClient.ts\nimport {\n  functionalUpdate,\n  hashKey,\n  hashQueryKeyByOptions,\n  noop,\n  partialMatchKey,\n  resolveStaleTime,\n  skipToken\n} from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nvar QueryClient = class {\n  #queryCache;\n  #mutationCache;\n  #defaultOptions;\n  #queryDefaults;\n  #mutationDefaults;\n  #mountCount;\n  #unsubscribeFocus;\n  #unsubscribeOnline;\n  constructor(config = {}) {\n    this.#queryCache = config.queryCache || new QueryCache();\n    this.#mutationCache = config.mutationCache || new MutationCache();\n    this.#defaultOptions = config.defaultOptions || {};\n    this.#queryDefaults = /* @__PURE__ */ new Map();\n    this.#mutationDefaults = /* @__PURE__ */ new Map();\n    this.#mountCount = 0;\n  }\n  mount() {\n    this.#mountCount++;\n    if (this.#mountCount !== 1) return;\n    this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n      if (focused) {\n        await this.resumePausedMutations();\n        this.#queryCache.onFocus();\n      }\n    });\n    this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n      if (online) {\n        await this.resumePausedMutations();\n        this.#queryCache.onOnline();\n      }\n    });\n  }\n  unmount() {\n    this.#mountCount--;\n    if (this.#mountCount !== 0) return;\n    this.#unsubscribeFocus?.();\n    this.#unsubscribeFocus = void 0;\n    this.#unsubscribeOnline?.();\n    this.#unsubscribeOnline = void 0;\n  }\n  isFetching(filters) {\n    return this.#queryCache.findAll({ ...filters, fetchStatus: \"fetching\" }).length;\n  }\n  isMutating(filters) {\n    return this.#mutationCache.findAll({ ...filters, status: \"pending\" }).length;\n  }\n  /**\n   * Imperative (non-reactive) way to retrieve data for a QueryKey.\n   * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n   *\n   * Hint: Do not use this function inside a component, because it won't receive updates.\n   * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n   */\n  getQueryData(queryKey) {\n    const options = this.defaultQueryOptions({ queryKey });\n    return this.#queryCache.get(options.queryHash)?.state.data;\n  }\n  ensureQueryData(options) {\n    const defaultedOptions = this.defaultQueryOptions(options);\n    const query = this.#queryCache.build(this, defaultedOptions);\n    const cachedData = query.state.data;\n    if (cachedData === void 0) {\n      return this.fetchQuery(options);\n    }\n    if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) {\n      void this.prefetchQuery(defaultedOptions);\n    }\n    return Promise.resolve(cachedData);\n  }\n  getQueriesData(filters) {\n    return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n      const data = state.data;\n      return [queryKey, data];\n    });\n  }\n  setQueryData(queryKey, updater, options) {\n    const defaultedOptions = this.defaultQueryOptions({ queryKey });\n    const query = this.#queryCache.get(\n      defaultedOptions.queryHash\n    );\n    const prevData = query?.state.data;\n    const data = functionalUpdate(updater, prevData);\n    if (data === void 0) {\n      return void 0;\n    }\n    return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });\n  }\n  setQueriesData(filters, updater, options) {\n    return notifyManager.batch(\n      () => this.#queryCache.findAll(filters).map(({ queryKey }) => [\n        queryKey,\n        this.setQueryData(queryKey, updater, options)\n      ])\n    );\n  }\n  getQueryState(queryKey) {\n    const options = this.defaultQueryOptions({ queryKey });\n    return this.#queryCache.get(\n      options.queryHash\n    )?.state;\n  }\n  removeQueries(filters) {\n    const queryCache = this.#queryCache;\n    notifyManager.batch(() => {\n      queryCache.findAll(filters).forEach((query) => {\n        queryCache.remove(query);\n      });\n    });\n  }\n  resetQueries(filters, options) {\n    const queryCache = this.#queryCache;\n    return notifyManager.batch(() => {\n      queryCache.findAll(filters).forEach((query) => {\n        query.reset();\n      });\n      return this.refetchQueries(\n        {\n          type: \"active\",\n          ...filters\n        },\n        options\n      );\n    });\n  }\n  cancelQueries(filters, cancelOptions = {}) {\n    const defaultedCancelOptions = { revert: true, ...cancelOptions };\n    const promises = notifyManager.batch(\n      () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))\n    );\n    return Promise.all(promises).then(noop).catch(noop);\n  }\n  invalidateQueries(filters, options = {}) {\n    return notifyManager.batch(() => {\n      this.#queryCache.findAll(filters).forEach((query) => {\n        query.invalidate();\n      });\n      if (filters?.refetchType === \"none\") {\n        return Promise.resolve();\n      }\n      return this.refetchQueries(\n        {\n          ...filters,\n          type: filters?.refetchType ?? filters?.type ?? \"active\"\n        },\n        options\n      );\n    });\n  }\n  refetchQueries(filters, options = {}) {\n    const fetchOptions = {\n      ...options,\n      cancelRefetch: options.cancelRefetch ?? true\n    };\n    const promises = notifyManager.batch(\n      () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {\n        let promise = query.fetch(void 0, fetchOptions);\n        if (!fetchOptions.throwOnError) {\n          promise = promise.catch(noop);\n        }\n        return query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n      })\n    );\n    return Promise.all(promises).then(noop);\n  }\n  fetchQuery(options) {\n    const defaultedOptions = this.defaultQueryOptions(options);\n    if (defaultedOptions.retry === void 0) {\n      defaultedOptions.retry = false;\n    }\n    const query = this.#queryCache.build(this, defaultedOptions);\n    return query.isStaleByTime(\n      resolveStaleTime(defaultedOptions.staleTime, query)\n    ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n  }\n  prefetchQuery(options) {\n    return this.fetchQuery(options).then(noop).catch(noop);\n  }\n  fetchInfiniteQuery(options) {\n    options.behavior = infiniteQueryBehavior(options.pages);\n    return this.fetchQuery(options);\n  }\n  prefetchInfiniteQuery(options) {\n    return this.fetchInfiniteQuery(options).then(noop).catch(noop);\n  }\n  ensureInfiniteQueryData(options) {\n    options.behavior = infiniteQueryBehavior(options.pages);\n    return this.ensureQueryData(options);\n  }\n  resumePausedMutations() {\n    if (onlineManager.isOnline()) {\n      return this.#mutationCache.resumePausedMutations();\n    }\n    return Promise.resolve();\n  }\n  getQueryCache() {\n    return this.#queryCache;\n  }\n  getMutationCache() {\n    return this.#mutationCache;\n  }\n  getDefaultOptions() {\n    return this.#defaultOptions;\n  }\n  setDefaultOptions(options) {\n    this.#defaultOptions = options;\n  }\n  setQueryDefaults(queryKey, options) {\n    this.#queryDefaults.set(hashKey(queryKey), {\n      queryKey,\n      defaultOptions: options\n    });\n  }\n  getQueryDefaults(queryKey) {\n    const defaults = [...this.#queryDefaults.values()];\n    const result = {};\n    defaults.forEach((queryDefault) => {\n      if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n        Object.assign(result, queryDefault.defaultOptions);\n      }\n    });\n    return result;\n  }\n  setMutationDefaults(mutationKey, options) {\n    this.#mutationDefaults.set(hashKey(mutationKey), {\n      mutationKey,\n      defaultOptions: options\n    });\n  }\n  getMutationDefaults(mutationKey) {\n    const defaults = [...this.#mutationDefaults.values()];\n    const result = {};\n    defaults.forEach((queryDefault) => {\n      if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n        Object.assign(result, queryDefault.defaultOptions);\n      }\n    });\n    return result;\n  }\n  defaultQueryOptions(options) {\n    if (options._defaulted) {\n      return options;\n    }\n    const defaultedOptions = {\n      ...this.#defaultOptions.queries,\n      ...this.getQueryDefaults(options.queryKey),\n      ...options,\n      _defaulted: true\n    };\n    if (!defaultedOptions.queryHash) {\n      defaultedOptions.queryHash = hashQueryKeyByOptions(\n        defaultedOptions.queryKey,\n        defaultedOptions\n      );\n    }\n    if (defaultedOptions.refetchOnReconnect === void 0) {\n      defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n    }\n    if (defaultedOptions.throwOnError === void 0) {\n      defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n    }\n    if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n      defaultedOptions.networkMode = \"offlineFirst\";\n    }\n    if (defaultedOptions.queryFn === skipToken) {\n      defaultedOptions.enabled = false;\n    }\n    return defaultedOptions;\n  }\n  defaultMutationOptions(options) {\n    if (options?._defaulted) {\n      return options;\n    }\n    return {\n      ...this.#defaultOptions.mutations,\n      ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n      ...options,\n      _defaulted: true\n    };\n  }\n  clear() {\n    this.#queryCache.clear();\n    this.#mutationCache.clear();\n  }\n};\nexport {\n  QueryClient\n};\n//# sourceMappingURL=queryClient.js.map","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * ReactiveDatasetCache for managing e3 dataset caching and reactivity.\n *\n * @remarks\n * Built on `@tanstack/query-core`: a {@link QueryClient} owns the content\n * bytes (one query per `(workspace, path)`, structured keys, in-flight\n * dedup + cancellation), while a thin subscription shim maintains the\n * string-keyed `subscribe` / `getKeyVersion` contract the platform\n * runtimes (`bind-runtime`, reactive trackers) consume, with an\n * optional `setScheduler` hook to defer notification flushes out of React\n * render.\n *\n * Server-side change detection is hash-based polling against\n * `workspaceStatus`: only when a dataset's hash moves do we issue a full\n * content fetch. Writes are optimistic and **serialized per key** —\n * concurrent writes to one dataset apply their bytes synchronously\n * (latest wins) but hit the server in order, and a failure only rolls\n * back to the last server-confirmed baseline when no later write has\n * taken ownership of the key. A write also cancels any in-flight content\n * fetch for its key so a stale fetch can never clobber the optimistic\n * bytes, and poll-driven fetch results are discarded when a write\n * supersedes them mid-flight (write-epoch guard).\n *\n * A workspace's poll runs at the interval its watchers asked for while what\n * it shows changes, and backs off once nothing has — the interval doubling\n * with each poll that sees no change, to 5 s — so a screen left open costs\n * the server a poll every few seconds, not every second. A poll that sees a\n * change, and the viewer acting — a write, a run launched, a refresh, a new\n * watch — bring it back to its interval. The intervals are the cache's\n * configuration ({@link ReactiveDatasetCacheConfig.pollIntervalMs},\n * {@link ReactiveDatasetCacheConfig.pollBackoffMs}), which a watch may\n * shorten. While the page is hidden — its tab in the background — no\n * workspace is polled at all; shown again, each is polled at once and at its\n * interval. A poll asks conditionally: it sends the tag the last answer\n * carried, and a server that still holds that status answers nothing, which\n * costs it a read of the workspace's revision; every half minute it asks\n * unconditionally, since the tag does not name the runner's view of an\n * execution recorded running, and so does the poll after a content fetch\n * failed, a new watch or a refresh, so nothing a conditional answer would\n * leave as it is stays so.\n *\n * Independent from `@tanstack/react-query`. Other hooks in this package\n * (status / repos) use TanStack's React layer on their own keys; this\n * cache shares only the framework-agnostic core.\n *\n * @packageDocumentation\n */\n\nimport { CancelledError, QueryClient } from \"@tanstack/query-core\";\nimport { variant } from \"@elaraai/east\";\nimport {\n    datasetGet,\n    datasetSet,\n    dataflowExecuteLaunch,\n    datasetList as e3DatasetList,\n    datasetListAt,\n    workspaceStatusSince,\n    pollRequestOptions,\n    ApiError,\n    type DatasetStatusInfo,\n    type RequestOptions,\n} from \"@elaraai/e3-api-client\";\nimport type { TreePath, DatasetStatus as PlatformDatasetStatus } from \"@elaraai/e3-types\";\n\n/**\n * Timer abstraction the cache uses for periodic polling. Exists so\n * tests can drive the poll loop deterministically with a fake clock\n * instead of `setInterval` real-time.\n */\nexport interface Clock {\n    /** Schedule `fn` to run every `ms` milliseconds. Returns a handle\n     *  whose `clear()` cancels future invocations. */\n    setInterval(fn: () => void, ms: number): { clear(): void };\n    /** The time now, in milliseconds, by which the cache ages its last full\n     *  status answer; `Date.now()` when absent. */\n    now?(): number;\n}\n\n/** Default {@link Clock} backed by `globalThis.setInterval`. */\nexport const realClock: Clock = {\n    setInterval(fn, ms) {\n        const id = setInterval(fn, ms);\n        return { clear: () => clearInterval(id) };\n    },\n    now: () => Date.now(),\n};\n\n/**\n * Whether the page is hidden — its tab in the background, or its window\n * minimized — and when that changes: what the cache stops its polls on.\n * Exists so tests can hide and show a page deterministically; the default\n * reads the document.\n */\nexport interface Visibility {\n    /** Whether the page is hidden */\n    readonly hidden: boolean;\n    /** Calls `fn` whenever `hidden` changes. Returns what stops the calls. */\n    onChange(fn: () => void): () => void;\n}\n\n/** Default {@link Visibility}: the document's, and never hidden where there\n *  is no document. */\nexport const documentVisibility: Visibility = {\n    get hidden() {\n        return typeof document !== \"undefined\" && document.visibilityState === \"hidden\";\n    },\n    onChange(fn) {\n        if (typeof document === \"undefined\") return () => undefined;\n        document.addEventListener(\"visibilitychange\", fn);\n        return () => document.removeEventListener(\"visibilitychange\", fn);\n    },\n};\n\n/** The interval a workspace is polled at unless configured or asked\n *  otherwise: every second while what the poll shows changes. */\nexport const DEFAULT_POLL_INTERVAL_MS = 1000;\n\n/** The longest a workspace's poll backs off to while nothing it shows\n *  changes, unless configured or asked otherwise: 5 s. A watcher that asked\n *  for a longer interval keeps it. */\nexport const DEFAULT_POLL_BACKOFF_MS = 5000;\n\n/**\n * How long a poll keeps asking conditionally — sending the tag of its last\n * full answer — before it asks for the status in full again: half a minute.\n * The tag names what the workspace stores, not the runner's view of an\n * execution recorded running, so a runner that died shows as stale within\n * this long.\n */\nexport const STATUS_UNCHANGED_MAX_MS = 30_000;\n\n/**\n * Adapter the cache uses for every server round-trip. Exists so tests\n * (and any non-e3 host) can inject a synthetic implementation; the\n * default wraps the `@elaraai/e3-api-client` module-level functions.\n *\n * The cache passes its own `apiUrl` / `repo` / request options to the\n * adapter only via the {@link createDefaultDatasetApi} factory — the\n * adapter itself doesn't see those values, so tests don't need to\n * scaffold dummy URLs.\n */\nexport interface DatasetApi {\n    /** Fetch a dataset's content. `hash` is the server's content hash\n     *  when it exposes one (`null` otherwise) — the cache records it so\n     *  the next status poll doesn't refetch content it already has. */\n    get(workspace: string, path: TreePath): Promise<{ data: Uint8Array; hash: string | null }>;\n    set(workspace: string, path: TreePath, value: Uint8Array): Promise<void>;\n    launchDataflow(workspace: string): Promise<void>;\n    listRoot(workspace: string): Promise<string[]>;\n    listAt(workspace: string, path: TreePath): Promise<string[]>;\n    /**\n     * A workspace's status, for the datasets `paths` names: the answer holds\n     * those of them the workspace has, each with its hash and status. Every\n     * dataset when omitted. The cache's poll names what it watches.\n     *\n     * Asked conditionally, with the `etag` the last answer carried, it is\n     * `null` when the status that answer gave is current. An answer carries\n     * its tag when the server names one; the cache asks unconditionally\n     * after an answer without one.\n     */\n    workspaceStatus(\n        workspace: string,\n        paths?: readonly TreePath[],\n        etag?: string,\n    ): Promise<{ datasets: DatasetStatusInfo[]; etag?: string | null } | null>;\n}\n\n/**\n * Build the default {@link DatasetApi} that talks to a real e3 server\n * via `@elaraai/e3-api-client`. Tests typically construct a\n * hand-rolled adapter instead.\n *\n * @param apiUrl - Base URL of the e3 API server\n * @param repo - Repository name\n * @param getOptions - Reads the current request options — the token, and the\n *   `fetch` requests go through — so a rotated one is used at once\n * @returns The adapter\n */\nexport function createDefaultDatasetApi(\n    apiUrl: string,\n    repo: string,\n    getOptions: () => RequestOptions,\n): DatasetApi {\n    return {\n        async get(workspace, path) {\n            const result = await datasetGet(apiUrl, repo, workspace, path, getOptions());\n            return { data: result.data, hash: result.hash ?? null };\n        },\n        async set(workspace, path, value) {\n            await datasetSet(apiUrl, repo, workspace, path, value, getOptions());\n        },\n        async launchDataflow(workspace) {\n            await dataflowExecuteLaunch(apiUrl, repo, workspace, {}, getOptions());\n        },\n        async listRoot(workspace) {\n            return e3DatasetList(apiUrl, repo, workspace, getOptions());\n        },\n        async listAt(workspace, path) {\n            return datasetListAt(apiUrl, repo, workspace, path, getOptions());\n        },\n        async workspaceStatus(workspace, paths, etag) {\n            // A poll: its next poll is its retry, so it makes one attempt.\n            const answer = await workspaceStatusSince(\n                apiUrl, repo, workspace, etag ?? null, pollRequestOptions(getOptions()), paths === undefined ? {} : { paths },\n            );\n            return answer === null ? null : { datasets: answer.status.datasets, etag: answer.etag };\n        },\n    };\n}\n\n/**\n * Configuration for the {@link ReactiveDatasetCache}.\n *\n * Strictly cache-internal — credentials and server identity (apiUrl,\n * repo, token) live in the {@link E3Config} context exposed by\n * `<E3Provider>`. The cache talks to the server only via the injected\n * {@link DatasetApi} adapter, so it has no opinion on transport.\n *\n * @property workspace - The workspace this cache instance renders\n *  against. Used by `Data.bind` to scope cache keys; consumed by\n *  bind-runtime and the renderers via `getConfig().workspace`.\n */\nexport interface ReactiveDatasetCacheConfig {\n    workspace?: string;\n    /**\n     * The interval a workspace is polled at while what the poll shows\n     * changes, in milliseconds, unless a watch asks for a shorter one.\n     *\n     * @defaultValue 1000\n     */\n    pollIntervalMs?: number;\n    /**\n     * The longest a workspace's poll backs off to while nothing it shows\n     * changes, in milliseconds, unless a watch asks for a shorter one.\n     *\n     * @defaultValue 5000\n     */\n    pollBackoffMs?: number;\n}\n\n/**\n * Interface for the ReactiveDatasetCache.\n */\nexport interface ReactiveDatasetCacheInterface {\n    /** Read a cached dataset value synchronously */\n    read(workspace: string, path: TreePath): Uint8Array | undefined;\n    /** Check if a dataset is cached */\n    has(workspace: string, path: TreePath): boolean;\n    /**\n     * Get the platform status of a dataset — `unset` | `stale` | `up-to-date`.\n     * Returns `unset` if we don't know yet (status hasn't been polled).\n     * `write()` flips the local entry to `stale` immediately (optimistic).\n     * The next poll updates from the server's authoritative status.\n     */\n    getStatus(workspace: string, path: TreePath): PlatformDatasetStatus;\n    /** Write a dataset value (async - mutates remotely) */\n    write(workspace: string, path: TreePath, value: Uint8Array): Promise<void>;\n    /**\n     * Write a dataset value AND launch a dataflow execution to propagate the\n     * change to downstream tasks. Use when a single user action both mutates\n     * input data and should trigger downstream recomputation (e.g. a Slider's\n     * `onChangeEnd`). Use plain `write` for high-frequency optimistic updates\n     * that you don't want to drive the dataflow on every tick.\n     */\n    writeAndStart(workspace: string, path: TreePath, value: Uint8Array): Promise<void>;\n    /**\n     * Launch a workspace dataflow run WITHOUT writing anything first, so\n     * downstream tasks recompute against the current dataset state. This is the\n     * standalone half of {@link writeAndStart} — use it after an out-of-band\n     * mutation (e.g. a record commit) or to drive an explicit \"Run\" affordance.\n     * Fire-and-await: resolves once the server accepts the request, not when\n     * the dataflow finishes.\n     */\n    launchDataflow(workspace: string): Promise<void>;\n    /** Preload a dataset into cache */\n    preload(workspace: string, path: TreePath): Promise<void>;\n    /** List fields at a path */\n    list(workspace: string, path: TreePath): Promise<string[]>;\n    /**\n     * Poll a dataset, for one watcher. Each call is paired with one\n     * {@link clearRefetchInterval}: a path two views watch stays polled until\n     * both have cleared it.\n     *\n     * @remarks\n     * The workspace's poll runs at the shortest interval its watchers asked\n     * for while what it shows changes, backing off to the shortest backoff\n     * they asked for once nothing has; a new watch, like the viewer's other\n     * acts, brings it back to its interval. While the page is hidden nothing\n     * is polled: shown again, the workspace is polled at once.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path\n     * @param intervalMs - The poll's interval while what it shows changes;\n     *   the cache's {@link ReactiveDatasetCacheConfig.pollIntervalMs} when\n     *   omitted\n     * @param backoffMs - The longest the poll backs off to; the cache's\n     *   {@link ReactiveDatasetCacheConfig.pollBackoffMs} when omitted\n     */\n    setRefetchInterval(workspace: string, path: TreePath, intervalMs?: number, backoffMs?: number): void;\n    /**\n     * Stop polling a dataset for one watcher registered with\n     * {@link setRefetchInterval}. The path stops being polled once its last\n     * watcher clears it, and the workspace's shared poller once its last path\n     * goes — without this, a long-lived session accumulates watched paths (and\n     * network traffic) forever.\n     */\n    clearRefetchInterval(workspace: string, path: TreePath): void;\n    /**\n     * Follow a dataset's content hash without fetching its content — what a\n     * paged source follows its dataset by.\n     *\n     * @remarks\n     * The path joins its workspace's status poll, started at `intervalMs` when\n     * nothing else polls the workspace. `onHash` is called with the hash a\n     * poll reports whenever it differs from the one this watch holds — the\n     * last it was told, or the one its watcher last said it holds\n     * ({@link hashHeld}) — (`null` while the dataset has no value), the first\n     * poll after the watch starts included. The dataset's content is never\n     * fetched.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path\n     * @param onHash - Called with each new hash\n     * @param intervalMs - The poll's interval, when this watch starts it or\n     *   asks for a shorter one: the poll backs off from it while nothing\n     *   changes, as every poll does; the cache's\n     *   {@link ReactiveDatasetCacheConfig.pollIntervalMs} when omitted\n     * @param backoffMs - The longest the poll backs off to, when this watch\n     *   asks for a shorter one; the cache's\n     *   {@link ReactiveDatasetCacheConfig.pollBackoffMs} when omitted\n     * @returns A function that stops the watch; the poller stops once nothing\n     *   watches the workspace\n     */\n    watchHash(\n        workspace: string,\n        path: TreePath,\n        onHash: (hash: string | null) => void,\n        intervalMs?: number,\n        backoffMs?: number,\n    ): () => void;\n    /**\n     * A watcher of a dataset's hash says which hash it holds now, by evidence\n     * of its own: a write's answer naming the state it committed, a read\n     * refused that names the dataset's state. The watch is told of the\n     * dataset's hash where it differs from that one, by the first poll\n     * started from here on — a poll in flight may have read before the\n     * evidence, and says nothing to this watcher — which is asked in full,\n     * and soon. Without it the watch compares each poll's hash with the last\n     * it told: a watcher put at a state the dataset has since left, where the\n     * dataset's hash is the one last told, would hear nothing more, and hold\n     * that state until the dataset next changed.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path\n     * @param onHash - The watcher, as {@link watchHash} was given it\n     * @param hash - The hash it holds now, `null` for no value\n     */\n    hashHeld(workspace: string, path: TreePath, onHash: (hash: string | null) => void, hash: string | null): void;\n    /**\n     * Force one immediate workspace-status poll, reconciling every watched\n     * path's content against the server (hash-gated; only changed datasets\n     * refetch). Use after an out-of-band server mutation (e.g. a record\n     * mutation commit) so a watched dataset picks up the new bytes without\n     * waiting for the standing poll interval. A poll already in flight may\n     * have read the status before the mutation, so the refresh polls again\n     * once it settles. The poll goes back to its interval, as for any act of\n     * the viewer's. No-op if the workspace has no active poller.\n     * Fire-and-forget; resolves when the refresh's poll settles.\n     */\n    refresh(workspace: string): Promise<void>;\n    /**\n     * A mark of a workspace's status polls as they stand now: a poll started\n     * after it reads the workspace's status after it.\n     *\n     * @remarks\n     * With {@link confirmedSince}, what says that the content the cache holds\n     * of a dataset is the dataset's own as of a read made since some moment —\n     * since a record's commit was answered, say, which the content then holds.\n     * A hash alone cannot say so: it names content, and a dataset put back as\n     * it was is under the hash it had before.\n     *\n     * @param workspace - The workspace\n     * @returns The mark\n     */\n    pollMark(workspace: string): number;\n    /**\n     * Whether a status poll started since a mark has found the content the\n     * cache holds of a dataset to be the dataset's: fetched by that poll, or\n     * held already under the hash it read.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path, one whose content the cache polls\n     * @param mark - A mark {@link pollMark} gave\n     * @returns Whether one has\n     */\n    confirmedSince(workspace: string, path: TreePath, mark: number): boolean;\n    /**\n     * The moment a status poll started since a mark finds the content the\n     * cache holds of a dataset to be the dataset's ({@link confirmedSince}).\n     * A dataset put back as it was is found so with no change to tell anyone\n     * of, so whoever waits on one is told here.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path\n     * @param mark - A mark {@link pollMark} gave\n     * @returns A promise settled at that moment — at once, where a poll has\n     *   found it so already; `undefined` for a dataset whose content no poll\n     *   of the cache reconciles: one never watched, or held only as it was\n     *   written here\n     */\n    confirmed(workspace: string, path: TreePath, mark: number): Promise<void> | undefined;\n    /**\n     * Whether a status poll started since a mark has read the hash of a\n     * dataset whose hash the cache follows ({@link watchHash}), every watcher\n     * of it holding that hash from then: told it, or holding it already. What\n     * says that the revision a paged source is pinned to is the dataset's as\n     * of a read made since some moment — a record's commit being answered —\n     * as {@link confirmedSince} says it of content.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path\n     * @param mark - A mark {@link pollMark} gave\n     * @returns Whether one has\n     */\n    hashReadSince(workspace: string, path: TreePath, mark: number): boolean;\n    /**\n     * The moment a status poll started since a mark has read the hash of a\n     * dataset whose hash the cache follows ({@link hashReadSince}). A dataset\n     * whose hash is as its watchers hold it is read so with nothing to tell\n     * them, so whoever waits on one is told here.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path\n     * @param mark - A mark {@link pollMark} gave\n     * @returns A promise settled at that moment — at once, where a poll has\n     *   read it so already; `undefined` for a dataset whose hash no watch follows\n     */\n    hashRead(workspace: string, path: TreePath, mark: number): Promise<void> | undefined;\n    /** Subscribe to changes on a specific key */\n    subscribe(key: string, callback: () => void): () => void;\n    /** Subscribe to all changes */\n    subscribe(callback: () => void): () => void;\n    /** Get global snapshot version */\n    getSnapshot(): number;\n    /** Get version for a specific key */\n    getKeyVersion(key: string): number;\n    /** Set notification scheduler */\n    setScheduler(scheduler: ((notify: () => void) => void) | undefined): void;\n    /** Batch multiple operations */\n    batch<T>(fn: () => T): T;\n    /** Get the configuration */\n    getConfig(): ReactiveDatasetCacheConfig;\n    /** Clean up resources */\n    destroy(): void;\n}\n\n/**\n * Convert a dataset path to a string key for caching.\n *\n * @remarks\n * Dot-joined to match the server's own path encoding (workspaceStatus\n * reports `.a.b` paths) — field names containing `.` are ambiguous at\n * the e3 wire level itself, so the cache doesn't try to out-encode it.\n */\nexport function datasetPathToString(path: TreePath): string {\n    return path.map(p => p.value).join(\".\");\n}\n\n/**\n * Create a cache key from workspace and path.\n */\nexport function datasetCacheKey(workspace: string, path: TreePath): string {\n    const pathStr = datasetPathToString(path);\n    return pathStr ? `${workspace}.${pathStr}` : workspace;\n}\n\n/** The last server-confirmed state of a key, captured when its write\n *  pipeline goes idle → busy; failures roll back to this. */\ninterface WriteBaseline {\n    value: Uint8Array | undefined;\n    /** `undefined` = hash unknown (entry absent); `null` = known-absent. */\n    hash: string | null | undefined;\n    status: PlatformDatasetStatus | undefined;\n}\n\n/**\n * ReactiveDatasetCache manages dataset caching and reactivity.\n *\n * @remarks\n * Content bytes live in a `@tanstack/query-core` {@link QueryClient}\n * (structured query keys, fetch dedup + cancellation); statuses, content\n * hashes, write pipelines, the workspace-status poll loop, and the\n * string-keyed subscription shim are cache-owned. See the module remarks\n * for the write/poll race rules.\n *\n * This differs from raw `@elaraai/e3-api-client` dataset functions which\n * are for direct API calls without reactive binding or caching.\n */\nexport class ReactiveDatasetCache implements ReactiveDatasetCacheInterface {\n    private destroyed = false;\n    private api: DatasetApi;\n    private config: {\n        workspace: string | undefined;\n        pollIntervalMs: number | undefined;\n        pollBackoffMs: number | undefined;\n    };\n\n    // Content store — one query per (workspace, path). `staleTime` and\n    // `gcTime` are Infinity: content only changes when the hash-poll says\n    // so (we invalidate explicitly), and the platform closures need\n    // synchronous reads of everything ever loaded (no observer-based GC).\n    private readonly client: QueryClient;\n\n    // Hash tracking for efficient change detection.\n    // Maps cache key -> last known e3 content hash (`null` = known-absent).\n    private knownHashes: Map<string, string | null> = new Map();\n\n    // Per-key platform status (unset | stale | up-to-date). Defaults to\n    // unset until either a poll returns a server status or a local write\n    // optimistically marks it stale.\n    private statuses: Map<string, PlatformDatasetStatus> = new Map();\n\n    // Write pipeline (per key): writes apply optimistically + synchronously\n    // (latest wins) but reach the server serialized, and only the newest\n    // failed write rolls back — to the last server-confirmed baseline.\n    // The epoch also discards poll-driven fetch results that a write\n    // superseded mid-flight.\n    private writeEpochs: Map<string, number> = new Map();\n    private writeChains: Map<string, Promise<void>> = new Map();\n    private writeBaselines: Map<string, WriteBaseline> = new Map();\n    private pendingWriteCounts: Map<string, number> = new Map();\n\n    // Subscription management\n    private keySubscribers: Map<string, Set<() => void>> = new Map();\n    private globalSubscribers: Set<() => void> = new Set();\n\n    // Version tracking for useSyncExternalStore\n    private version: number = 0;\n    private keyVersions: Map<string, number> = new Map();\n\n    // Workspace status polling — groups subscriptions by workspace for\n    // efficiency. Each entry holds the active interval handle from the\n    // injected {@link Clock} so tests can drive ticking deterministically\n    // (none while the page is hidden), and each polled path with how many\n    // watchers poll it. `intervalMs` is the shortest interval asked for,\n    // `backoffMs` the shortest backoff, and `currentMs` the one the timer\n    // runs at: `intervalMs` while what the poll shows changes, backing off to\n    // `backoffMs` once nothing has. `last` is the tag of the last full answer,\n    // the paths it covered, when it came and which of the workspace's polls\n    // it answered: what the next poll asks conditionally with.\n    private workspacePollers: Map<string, {\n        intervalMs: number;\n        backoffMs: number;\n        currentMs: number;\n        paths: Map<string, number>;\n        handle: { clear(): void } | null;\n        last: { etag: string; paths: string; at: number; poll: number } | null;\n    }> = new Map();\n    private readonly clock: Clock;\n    private readonly visibility: Visibility;\n    /** Whether the page is hidden, as last seen: no workspace is polled while it is */\n    private hidden: boolean;\n    /** Stops the watch on the page's visibility */\n    private readonly unwatchVisibility: () => void;\n\n    // In-flight poll dedup — concurrent callers (interval tick + a\n    // post-write trigger) share a single round-trip rather than racing.\n    private inFlightPolls: Map<string, Promise<void>> = new Map();\n    /**\n     * How many refreshes each workspace has been asked for: a poll in flight as one is asked for was overtaken by it —\n     * it may have read the status before what the refresh was asked for — and tells no hash watch what it read\n     * ({@link ReactiveDatasetCache.refresh}).\n     */\n    private refreshesAsked: Map<string, number> = new Map();\n    /** How many status polls each workspace has started: what {@link ReactiveDatasetCache.pollMark} gives. */\n    private pollsStarted: Map<string, number> = new Map();\n    /** The last poll, by its number among its workspace's, that found each key's held content to be its dataset's. */\n    private confirmedAt: Map<string, number> = new Map();\n    /** Who waits to hear a key's content found its dataset's by a poll started since a mark ({@link ReactiveDatasetCache.confirmed}). */\n    private confirmWaits: Map<string, { readonly mark: number; readonly settle: () => void }[]> = new Map();\n    /** The last poll, by its number among its workspace's, that read each watched key's hash, its watchers holding that hash from then. */\n    private hashReadAt: Map<string, number> = new Map();\n    /** Who waits to hear a watched key's hash read by a poll started since a mark ({@link ReactiveDatasetCache.hashRead}). */\n    private hashReadWaits: Map<string, { readonly mark: number; readonly settle: () => void }[]> = new Map();\n\n    // Hash-only watches, by workspace and path: each callback with the hash it\n    // holds — the last it was told, or the one its watcher last said it holds\n    // by evidence of its own — and how many of the workspace's polls had\n    // started as it last said so. A watched path rides its workspace's poll,\n    // but its content is never fetched — a paged source reads windows, never\n    // the value.\n    private hashWatches: Map<string, Map<string, Map<(hash: string | null) => void, { told: string | null | undefined; since: number }>>> = new Map();\n\n    // Batching\n    private batchDepth: number = 0;\n    private changedKeys: Set<string> = new Set();\n\n    // Scheduler for deferred notifications\n    private scheduler: ((notify: () => void) => void) | undefined;\n    private flushScheduled = false;\n\n    /**\n     * @param config - The cache's configuration: its workspace, and the\n     *   intervals its polls run at\n     * @param api - What every server round-trip goes through\n     * @param clock - What the polls are timed by; the real clock unless given\n     * @param visibility - Whether the page is hidden, on which the polls\n     *   stop; the document's unless given\n     */\n    constructor(config: ReactiveDatasetCacheConfig, api: DatasetApi, clock: Clock = realClock, visibility: Visibility = documentVisibility) {\n        this.config = { workspace: config.workspace, pollIntervalMs: config.pollIntervalMs, pollBackoffMs: config.pollBackoffMs };\n        this.api = api;\n        this.clock = clock;\n        this.visibility = visibility;\n        this.hidden = visibility.hidden;\n        this.unwatchVisibility = visibility.onChange(() => this.onVisibilityChange());\n        this.client = new QueryClient({\n            defaultOptions: {\n                queries: { retry: false, staleTime: Infinity, gcTime: Infinity },\n            },\n        });\n        this.client.mount();\n    }\n\n    /** Structured query key for a dataset's content. */\n    private contentKey(workspace: string, path: TreePath): readonly unknown[] {\n        return [\"dataset\", workspace, ...path.map(p => p.value)];\n    }\n\n    /**\n     * Read the cache's own configuration. Server identity (apiUrl,\n     * repo, token) is NOT here — read it from `<E3Provider>` via\n     * `useE3Config()` instead.\n     */\n    getConfig(): ReactiveDatasetCacheConfig {\n        return {\n            ...(this.config.workspace !== undefined && { workspace: this.config.workspace }),\n            ...(this.config.pollIntervalMs !== undefined && { pollIntervalMs: this.config.pollIntervalMs }),\n            ...(this.config.pollBackoffMs !== undefined && { pollBackoffMs: this.config.pollBackoffMs }),\n        };\n    }\n\n    /** The interval a workspace is polled at unless a watch asks for a shorter one. */\n    private get pollIntervalMs(): number {\n        return this.config.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;\n    }\n\n    /** The longest a workspace's poll backs off to unless a watch asks for a shorter one. */\n    private get pollBackoffMs(): number {\n        return this.config.pollBackoffMs ?? DEFAULT_POLL_BACKOFF_MS;\n    }\n\n    /** The time now, by the cache's clock. */\n    private now(): number {\n        return this.clock.now?.() ?? Date.now();\n    }\n\n    /**\n     * Read a dataset value synchronously from cache.\n     */\n    read(workspace: string, path: TreePath): Uint8Array | undefined {\n        return this.client.getQueryData<Uint8Array>(this.contentKey(workspace, path));\n    }\n\n    /**\n     * Check if a dataset is cached.\n     */\n    has(workspace: string, path: TreePath): boolean {\n        return this.read(workspace, path) !== undefined;\n    }\n\n    /**\n     * Get the platform status of a dataset. Defaults to `unset` until the\n     * first poll returns a server status.\n     */\n    getStatus(workspace: string, path: TreePath): PlatformDatasetStatus {\n        const key = datasetCacheKey(workspace, path);\n        return this.statuses.get(key) ?? variant('unset', null);\n    }\n\n    /**\n     * Write a dataset value (async - mutates remotely).\n     *\n     * @remarks\n     * Optimistic and synchronous: the bytes are readable via {@link read}\n     * before this method's first await. Concurrent writes to the same key\n     * are serialized server-side (issue order preserved); on failure, only\n     * the newest write rolls the key back — to the last server-confirmed\n     * baseline, not to a possibly-superseded optimistic intermediate.\n     */\n    write(workspace: string, path: TreePath, value: Uint8Array): Promise<void> {\n        if (this.destroyed) return Promise.resolve();\n        // The viewer acted: what the workspace's poll shows is about to change.\n        this.pollSoon(workspace);\n        const key = datasetCacheKey(workspace, path);\n        const queryKey = this.contentKey(workspace, path);\n\n        // Abort any in-flight content fetch for this key NOW — a stale\n        // fetch result must never apply over the optimistic bytes. (The\n        // returned promise only awaits teardown; the abort is immediate.)\n        void this.client.cancelQueries({ queryKey, exact: true });\n\n        // Baseline = last server-confirmed state, captured when this key's\n        // write pipeline goes idle → busy.\n        const pendingCount = this.pendingWriteCounts.get(key) ?? 0;\n        if (pendingCount === 0) {\n            this.writeBaselines.set(key, {\n                value: this.client.getQueryData<Uint8Array>(queryKey),\n                hash: this.knownHashes.has(key) ? this.knownHashes.get(key) : undefined,\n                status: this.statuses.get(key),\n            });\n        }\n        this.pendingWriteCounts.set(key, pendingCount + 1);\n        const myEpoch = (this.writeEpochs.get(key) ?? 0) + 1;\n        this.writeEpochs.set(key, myEpoch);\n\n        // Optimistic update — bytes go into the cache synchronously,\n        // status flips to `stale` until the server confirms.\n        this.client.setQueryData(queryKey, value);\n        this.knownHashes.delete(key);\n        this.statuses.set(key, variant('stale', null));\n        this.notifyChange(key);\n\n        // Server set, serialized after any earlier writes to this key.\n        const prevTail = this.writeChains.get(key) ?? Promise.resolve();\n        const run = prevTail.then(async () => {\n            try {\n                await this.api.set(workspace, path, value);\n                if (this.destroyed) return;\n\n                // Confirmed — this value is the new rollback baseline for\n                // any still-pending later writes.\n                this.writeBaselines.set(key, {\n                    value,\n                    hash: undefined,\n                    status: variant('stale', null),\n                });\n\n                // Refresh the hash + authoritative status.\n                void this.refresh(workspace);\n            } catch (error) {\n                // Roll back only if no later write owns the key's state.\n                if (!this.destroyed && this.writeEpochs.get(key) === myEpoch) {\n                    const baseline = this.writeBaselines.get(key);\n                    if (baseline?.value !== undefined) {\n                        this.client.setQueryData(queryKey, baseline.value);\n                    } else {\n                        this.client.removeQueries({ queryKey, exact: true });\n                    }\n                    if (baseline?.hash !== undefined) {\n                        this.knownHashes.set(key, baseline.hash);\n                    } else {\n                        this.knownHashes.delete(key);\n                    }\n                    if (baseline?.status !== undefined) {\n                        this.statuses.set(key, baseline.status);\n                    } else {\n                        this.statuses.delete(key);\n                    }\n                    this.notifyChange(key);\n                }\n                throw error;\n            } finally {\n                const remaining = (this.pendingWriteCounts.get(key) ?? 1) - 1;\n                if (remaining <= 0) {\n                    this.pendingWriteCounts.delete(key);\n                    this.writeBaselines.delete(key);\n                } else {\n                    this.pendingWriteCounts.set(key, remaining);\n                }\n            }\n        });\n        // The chain tail must never reject (later writes chain onto it).\n        this.writeChains.set(key, run.then(() => undefined, () => undefined));\n        return run;\n    }\n\n    /**\n     * Write a dataset value AND launch a workspace dataflow run so downstream\n     * tasks pick up the change. The launch is fire-and-await: it returns once\n     * the server has accepted the request (not when the dataflow finishes).\n     * Polling continues to surface live status as tasks complete.\n     */\n    async writeAndStart(workspace: string, path: TreePath, value: Uint8Array): Promise<void> {\n        await this.write(workspace, path, value);\n        if (this.destroyed) return;\n        await this.api.launchDataflow(workspace);\n    }\n\n    /**\n     * Launch a workspace dataflow run without writing first. The standalone\n     * half of {@link writeAndStart}; see the interface doc for semantics.\n     */\n    async launchDataflow(workspace: string): Promise<void> {\n        if (this.destroyed) return;\n        this.pollSoon(workspace);\n        await this.api.launchDataflow(workspace);\n    }\n\n    /**\n     * Preload a dataset into cache. Concurrent preloads of the same key\n     * share one fetch (query-core dedup); a write racing the fetch cancels\n     * it, so a preload can never clobber optimistic bytes.\n     */\n    async preload(workspace: string, path: TreePath): Promise<void> {\n        if (this.destroyed) return;\n        const key = datasetCacheKey(workspace, path);\n        const queryKey = this.contentKey(workspace, path);\n\n        // Already cached (including optimistically) — nothing to do.\n        if (this.client.getQueryData(queryKey) !== undefined) return;\n\n        let fetchedHash: string | null = null;\n        try {\n            await this.client.fetchQuery({\n                queryKey,\n                queryFn: async () => {\n                    const result = await this.api.get(workspace, path);\n                    fetchedHash = result.hash;\n                    return result.data;\n                },\n            });\n        } catch (error) {\n            // A write cancelled the fetch — its optimistic bytes win.\n            if (isCancelledError(error)) return;\n            // An unassigned dataset is the `unset` status, not a failure: leave it\n            // uncached so getStatus()→unset and has()→false, and the surface renders\n            // its own loading/empty branch (Data.bind(...).status()/.has()) instead of\n            // the whole tree crashing. A later status poll flips it once the producing\n            // task computes it. (Matches BoundValue's {unset, stale, up-to-date}.)\n            if (isDatasetUnassignedError(error)) {\n                this.statuses.set(key, variant(\"unset\", null));\n                this.notifyChange(key);\n                return;\n            }\n            throw error;\n        }\n        if (this.destroyed) {\n            this.client.removeQueries({ queryKey, exact: true });\n            return;\n        }\n        // Record the content hash so the next status poll doesn't refetch\n        // bytes we already hold.\n        this.knownHashes.set(key, fetchedHash);\n        this.notifyChange(key);\n    }\n\n    /**\n     * List fields at a path. Empty path lists workspace root.\n     */\n    list(workspace: string, path: TreePath): Promise<string[]> {\n        return path.length === 0\n            ? this.api.listRoot(workspace)\n            : this.api.listAt(workspace, path);\n    }\n\n    /**\n     * Set refetch interval for a dataset (polling).\n     *\n     * @remarks\n     * Uses hash-based change detection for efficiency:\n     * 1. Polls workspaceStatus to get dataset hashes (lightweight)\n     * 2. Compares hashes to detect changes\n     * 3. Only fetches full content when hash changes\n     *\n     * Multiple subscriptions to the same workspace share a single poller,\n     * at the shortest interval any asked for, which backs off while nothing\n     * it shows changes; a new watch brings it back to that interval.\n     * Pair each call with one {@link clearRefetchInterval} on unmount so the\n     * poller can stop when nothing is watching.\n     */\n    setRefetchInterval(workspace: string, path: TreePath, intervalMs: number = this.pollIntervalMs, backoffMs: number = this.pollBackoffMs): void {\n        const pathStr = datasetPathToString(path);\n        const poller = this.workspacePollers.get(workspace);\n\n        if (poller) {\n            poller.paths.set(pathStr, (poller.paths.get(pathStr) ?? 0) + 1);\n            poller.intervalMs = Math.min(poller.intervalMs, intervalMs);\n            poller.backoffMs = Math.min(poller.backoffMs, backoffMs);\n            // A new watcher is answered in full: a path watched already may\n            // hold content a fetch failed, which a poll the server answers\n            // nothing to would leave as it is.\n            poller.last = null;\n            this.pollSoon(workspace);\n        } else {\n            this.startPoller(workspace, intervalMs, backoffMs, new Map([[pathStr, 1]]));\n        }\n    }\n\n    /**\n     * Starts a workspace's poller: its timer, unless the page is hidden, and\n     * an immediate poll. The poll's promise is floated — the dedup map\n     * handles concurrency, and errors are logged.\n     */\n    private startPoller(workspace: string, intervalMs: number, backoffMs: number, paths: Map<string, number>): void {\n        this.workspacePollers.set(workspace, {\n            intervalMs,\n            backoffMs,\n            currentMs: intervalMs,\n            paths,\n            handle: this.hidden ? null : this.clock.setInterval(() => this.pollWorkspaceStatus(workspace), intervalMs),\n            last: null,\n        });\n        if (!this.hidden) void this.pollWorkspaceStatus(workspace);\n    }\n\n    /**\n     * Stops every workspace's timer as the page is hidden, keeping what each\n     * poller watches; and as it is shown, polls every workspace at once and\n     * at its interval again.\n     */\n    private onVisibilityChange(): void {\n        const hidden = this.visibility.hidden;\n        if (this.destroyed || hidden === this.hidden) return;\n        this.hidden = hidden;\n        for (const [workspace, poller] of this.workspacePollers) {\n            poller.handle?.clear();\n            poller.handle = null;\n            if (hidden) continue;\n            poller.currentMs = poller.intervalMs;\n            poller.handle = this.clock.setInterval(() => this.pollWorkspaceStatus(workspace), poller.intervalMs);\n            void this.pollWorkspaceStatus(workspace);\n        }\n    }\n\n    /**\n     * Stop polling a dataset for one watcher; the path goes when its last\n     * watcher clears it, and the workspace poller is torn down when its last\n     * path goes.\n     */\n    clearRefetchInterval(workspace: string, path: TreePath): void {\n        const poller = this.workspacePollers.get(workspace);\n        if (!poller) return;\n        const pathStr = datasetPathToString(path);\n        const watchers = (poller.paths.get(pathStr) ?? 0) - 1;\n        if (watchers > 0) {\n            poller.paths.set(pathStr, watchers);\n            return;\n        }\n        poller.paths.delete(pathStr);\n        this.stopIdlePoller(workspace);\n    }\n\n    /**\n     * Follow a dataset's content hash without fetching its content; see the\n     * interface doc.\n     */\n    watchHash(\n        workspace: string,\n        path: TreePath,\n        onHash: (hash: string | null) => void,\n        intervalMs: number = this.pollIntervalMs,\n        backoffMs: number = this.pollBackoffMs,\n    ): () => void {\n        const pathStr = datasetPathToString(path);\n        let byPath = this.hashWatches.get(workspace);\n        if (!byPath) {\n            byPath = new Map();\n            this.hashWatches.set(workspace, byPath);\n        }\n        let callbacks = byPath.get(pathStr);\n        if (!callbacks) {\n            callbacks = new Map();\n            byPath.set(pathStr, callbacks);\n        }\n        callbacks.set(onHash, { told: undefined, since: 0 });\n\n        const poller = this.workspacePollers.get(workspace);\n        if (!poller) {\n            this.startPoller(workspace, intervalMs, backoffMs, new Map());\n        } else {\n            poller.intervalMs = Math.min(poller.intervalMs, intervalMs);\n            poller.backoffMs = Math.min(poller.backoffMs, backoffMs);\n            // The watch is told its first hash by a full answer, which a poll\n            // the server answers nothing to is not.\n            poller.last = null;\n            this.pollSoon(workspace);\n        }\n\n        return () => {\n            const watched = this.hashWatches.get(workspace);\n            const set = watched?.get(pathStr);\n            if (!watched || !set) return;\n            set.delete(onHash);\n            if (set.size === 0) watched.delete(pathStr);\n            if (watched.size === 0) this.hashWatches.delete(workspace);\n            this.stopIdlePoller(workspace);\n        };\n    }\n\n    hashHeld(workspace: string, path: TreePath, onHash: (hash: string | null) => void, hash: string | null): void {\n        const watch = this.hashWatches.get(workspace)?.get(datasetPathToString(path))?.get(onHash);\n        if (watch === undefined) return;\n        watch.told = hash;\n        watch.since = this.pollsStarted.get(workspace) ?? 0;\n        // The next poll asks in full, and soon: what it reads is told to the watcher where it differs.\n        const poller = this.workspacePollers.get(workspace);\n        if (poller === undefined) return;\n        poller.last = null;\n        this.pollSoon(workspace);\n    }\n\n    /** Stops a workspace's poller once it has no path to reconcile and no hash\n     *  to follow — without this, a long-lived session polls forever. */\n    private stopIdlePoller(workspace: string): void {\n        const poller = this.workspacePollers.get(workspace);\n        if (!poller || poller.paths.size > 0 || this.hashWatches.has(workspace)) return;\n        poller.handle?.clear();\n        this.workspacePollers.delete(workspace);\n    }\n\n    /** Runs a workspace's poll every `ms` from now, restarting its timer when\n     *  that is another interval than it runs at; no timer runs while the\n     *  page is hidden. */\n    private pollEvery(workspace: string, ms: number): void {\n        const poller = this.workspacePollers.get(workspace);\n        if (!poller || poller.currentMs === ms) return;\n        poller.handle?.clear();\n        poller.currentMs = ms;\n        poller.handle = this.hidden ? null : this.clock.setInterval(() => this.pollWorkspaceStatus(workspace), ms);\n    }\n\n    /** Brings a workspace's poll back to the interval its watchers asked for:\n     *  what it shows changed, or the viewer acted. */\n    private pollSoon(workspace: string): void {\n        const poller = this.workspacePollers.get(workspace);\n        if (poller) this.pollEvery(workspace, poller.intervalMs);\n    }\n\n    /** Backs a workspace's poll off once it saw nothing change: its interval\n     *  doubles, to at most the poller's backoff, and never below the interval\n     *  asked for. */\n    private backOff(workspace: string): void {\n        const poller = this.workspacePollers.get(workspace);\n        if (poller) this.pollEvery(workspace, Math.max(poller.intervalMs, Math.min(poller.currentMs * 2, poller.backoffMs)));\n    }\n\n    refresh(workspace: string): Promise<void> {\n        // One immediate hash-gated poll, reusing the standing workspace poller,\n        // as write() does after a confirmed set. No-op when nothing watches the\n        // workspace. A poll in flight may have read the status before what the\n        // caller refreshes for, so joining it could leave the change unseen\n        // until the next interval: the refresh polls once it has settled. And\n        // what that poll read is told to no hash watch: a record's Save asks\n        // for a refresh as its answer comes, and its page moves to the state\n        // the answer names at once — told what a poll read before the commit,\n        // another session's write that came before it, the page would step\n        // back to it.\n        if (this.destroyed) return Promise.resolve();\n        const poller = this.workspacePollers.get(workspace);\n        if (poller === undefined) return Promise.resolve();\n        this.refreshesAsked.set(workspace, (this.refreshesAsked.get(workspace) ?? 0) + 1);\n        // A refresh asks in full: what it refreshes for may be content a\n        // fetch failed, which the tag still names.\n        poller.last = null;\n        this.pollSoon(workspace);\n        const inFlight = this.inFlightPolls.get(workspace);\n        if (inFlight === undefined) return this.pollWorkspaceStatus(workspace);\n        const again = () => (this.destroyed || !this.workspacePollers.has(workspace) ? undefined : this.pollWorkspaceStatus(workspace));\n        return inFlight.then(again, again);\n    }\n\n    pollMark(workspace: string): number {\n        return this.pollsStarted.get(workspace) ?? 0;\n    }\n\n    confirmedSince(workspace: string, path: TreePath, mark: number): boolean {\n        return (this.confirmedAt.get(datasetCacheKey(workspace, path)) ?? 0) > mark;\n    }\n\n    confirmed(workspace: string, path: TreePath, mark: number): Promise<void> | undefined {\n        if (this.destroyed || this.workspacePollers.get(workspace)?.paths.has(datasetPathToString(path)) !== true) return undefined;\n        const key = datasetCacheKey(workspace, path);\n        if ((this.confirmedAt.get(key) ?? 0) > mark) return Promise.resolve();\n        return new Promise<void>((settle) => {\n            const waits = this.confirmWaits.get(key);\n            if (waits === undefined) this.confirmWaits.set(key, [{ mark, settle }]);\n            else waits.push({ mark, settle });\n        });\n    }\n\n    /**\n     * Records that a poll found the content held of a key to be its dataset's,\n     * and tells whoever waited for one started since their mark.\n     *\n     * @param key - The dataset's key\n     * @param poll - The poll, by its number among its workspace's\n     */\n    private confirm(key: string, poll: number): void {\n        this.confirmedAt.set(key, poll);\n        ReactiveDatasetCache.settleWaits(this.confirmWaits, key, poll);\n    }\n\n    hashReadSince(workspace: string, path: TreePath, mark: number): boolean {\n        return (this.hashReadAt.get(datasetCacheKey(workspace, path)) ?? 0) > mark;\n    }\n\n    hashRead(workspace: string, path: TreePath, mark: number): Promise<void> | undefined {\n        if (this.destroyed || this.hashWatches.get(workspace)?.has(datasetPathToString(path)) !== true) return undefined;\n        const key = datasetCacheKey(workspace, path);\n        if ((this.hashReadAt.get(key) ?? 0) > mark) return Promise.resolve();\n        return new Promise<void>((settle) => {\n            const waits = this.hashReadWaits.get(key);\n            if (waits === undefined) this.hashReadWaits.set(key, [{ mark, settle }]);\n            else waits.push({ mark, settle });\n        });\n    }\n\n    /**\n     * Records that a poll read a watched key's hash, every watcher of it holding that hash from then, and tells\n     * whoever waited for one started since their mark.\n     *\n     * @param key - The dataset's key\n     * @param poll - The poll, by its number among its workspace's\n     */\n    private readHash(key: string, poll: number): void {\n        this.hashReadAt.set(key, poll);\n        ReactiveDatasetCache.settleWaits(this.hashReadWaits, key, poll);\n    }\n\n    /** Tells those waiting on a key for a poll started since their mark, and keeps the rest. */\n    private static settleWaits(all: Map<string, { readonly mark: number; readonly settle: () => void }[]>, key: string, poll: number): void {\n        const waits = all.get(key);\n        if (waits === undefined) return;\n        const left = waits.filter((wait) => wait.mark >= poll);\n        if (left.length === 0) all.delete(key);\n        else all.set(key, left);\n        for (const wait of waits) if (wait.mark < poll) wait.settle();\n    }\n\n    /**\n     * Poll workspace status and reconcile the cache with the server.\n     * Concurrent calls for the same workspace dedupe to a single fetch.\n     */\n    private pollWorkspaceStatus(workspace: string): Promise<void> {\n        const existing = this.inFlightPolls.get(workspace);\n        if (existing) return existing;\n        const promise = this.doPollWorkspaceStatus(workspace).finally(() => {\n            this.inFlightPolls.delete(workspace);\n        });\n        this.inFlightPolls.set(workspace, promise);\n        return promise;\n    }\n\n    private async doPollWorkspaceStatus(workspace: string): Promise<void> {\n        if (this.destroyed) return;\n        const poller = this.workspacePollers.get(workspace);\n        if (!poller || (poller.paths.size === 0 && !this.hashWatches.has(workspace))) return;\n\n        // Capture each watched key's write epoch BEFORE the status fetch:\n        // any write that lands after this point owns its key's state, and\n        // this poll's (potentially pre-write) content must not apply.\n        const epochsAtStart = new Map<string, number>();\n        for (const pathStr of poller.paths.keys()) {\n            const key = pathStr ? `${workspace}.${pathStr}` : workspace;\n            epochsAtStart.set(key, this.writeEpochs.get(key) ?? 0);\n        }\n\n        // Ask for what the poll watches and nothing else of the workspace: the\n        // paths whose content it reconciles, and those whose hash it follows.\n        // A UI binding a few datasets costs the server those, not the\n        // workspace's status. And ask conditionally, with the tag of the last\n        // full answer, while it covered the same paths and is younger than\n        // STATUS_UNCHANGED_MAX_MS: a server that still holds that status\n        // answers nothing, reading only the workspace's revision.\n        const watched = new Set([...poller.paths.keys(), ...(this.hashWatches.get(workspace)?.keys() ?? [])]);\n        const covering = [...watched].sort().join(\"\\n\");\n        const now = this.now();\n        // The refreshes asked for as the poll starts: one asked for while it is in flight overtakes it.\n        const refreshes = this.refreshesAsked.get(workspace) ?? 0;\n        // Which of the workspace's polls this is: what it finds current, it confirms as of its own start.\n        const poll = (this.pollsStarted.get(workspace) ?? 0) + 1;\n        this.pollsStarted.set(workspace, poll);\n        const held = poller.last;\n        const etag = held !== null && held.paths === covering && now - held.at < STATUS_UNCHANGED_MAX_MS ? held.etag : undefined;\n        let status;\n        try {\n            status = await this.api.workspaceStatus(workspace, [...watched].map((pathStr) => this.stringToPath(pathStr)), etag);\n        } catch (error) {\n            console.error(`Failed to poll workspace status for ${workspace}:`, error);\n            this.backOff(workspace);\n            return;\n        }\n        if (this.destroyed) return;\n        if (status === null) {\n            // The status the last full answer gave is current: nothing it\n            // shows changed, and what the cache holds of each path it\n            // reconciles is that path's still — but one a write owns.\n            for (const pathStr of poller.paths.keys()) {\n                const key = pathStr ? `${workspace}.${pathStr}` : workspace;\n                if (!watched.has(pathStr) || (this.writeEpochs.get(key) ?? 0) !== epochsAtStart.get(key) || (this.pendingWriteCounts.get(key) ?? 0) > 0) continue;\n                if (this.has(workspace, this.stringToPath(pathStr))) this.confirm(key, poll);\n            }\n            // And each hash a watch follows is the one its watchers were told — but one a watcher is still to be told, or\n            // holds by evidence of its own since that answer, which no poll has yet compared with the dataset's.\n            for (const [pathStr, callbacks] of this.hashWatches.get(workspace) ?? []) {\n                if (!watched.has(pathStr) || held === null) continue;\n                if ([...callbacks.values()].some((watch) => watch.told === undefined || watch.since >= held.poll)) continue;\n                this.readHash(pathStr ? `${workspace}.${pathStr}` : workspace, poll);\n            }\n            this.backOff(workspace);\n            return;\n        }\n        poller.last = typeof status.etag === \"string\" ? { etag: status.etag, paths: covering, at: now, poll } : null;\n\n        // Whether the poll saw what it shows change: a hash a watch is told,\n        // a status, or content to fetch or clear. One that saw none backs the\n        // poll off; one that saw one brings it back to its interval.\n        let changed = false;\n\n        // Index once — the path loop below must not rescan the dataset\n        // list per watched path.\n        const infoByPath = new Map<string, DatasetStatusInfo>();\n        for (const info of status.datasets) infoByPath.set(info.path, info);\n\n        // Hash watches hear the hashes first: they fetch nothing, and a\n        // watcher that throws must not cost the content paths their update.\n        // A path watched since the request was made was not asked for, so the\n        // answer says nothing of it: the next poll does. Nor does a poll a\n        // refresh overtook say anything to them: the poll that refresh chains\n        // reads after what it was asked for, and tells them then.\n        const overtaken = (this.refreshesAsked.get(workspace) ?? 0) !== refreshes;\n        // What an overtaken poll read it told no watch: its tag is not kept, so the poll its refresh chains asks in full.\n        if (overtaken && this.hashWatches.has(workspace)) poller.last = null;\n        for (const [pathStr, callbacks] of overtaken ? [] : this.hashWatches.get(workspace) ?? []) {\n            if (!watched.has(pathStr)) continue;\n            const info = infoByPath.get(pathStr ? `.${pathStr}` : \"\");\n            const hash = info?.hash?.type === \"some\" ? info.hash.value : null;\n            for (const [onHash, watch] of [...callbacks]) {\n                if (!callbacks.has(onHash)) continue;\n                // A watcher that came to hold a hash by evidence of its own once this poll had started\n                // ({@link hashHeld}): the poll may have read before that evidence, and says nothing to it. Its tag is\n                // not kept, so the next poll asks in full, and tells the watcher where the dataset's hash differs.\n                if (watch.since >= poll) { poller.last = null; continue; }\n                if (watch.told === hash) continue;\n                changed = true;\n                watch.told = hash;\n                try {\n                    onHash(hash);\n                } catch (error) {\n                    console.error(`A hash watch on ${workspace}.${pathStr} failed:`, error);\n                }\n            }\n            // Every watcher of the path holds the hash this poll read, from here.\n            if ([...callbacks.values()].every((watch) => watch.told === hash)) this.readHash(pathStr ? `${workspace}.${pathStr}` : workspace, poll);\n        }\n\n        // First pass — apply status updates synchronously, collect paths\n        // that need a content fetch. Doing these in two passes lets us\n        // batch the hash/status notifications under one `flush()` and\n        // run the fetches in parallel.\n        type PendingFetch =\n            | { kind: \"fetch\"; key: string; path: TreePath; pathStr: string; newHash: string }\n            | { kind: \"clear\"; key: string; path: TreePath };\n        const pending: PendingFetch[] = [];\n\n        this.batch(() => {\n            for (const pathStr of poller.paths.keys()) {\n                if (!watched.has(pathStr)) continue; // not asked for: the next poll\n                const e3Path = pathStr ? `.${pathStr}` : \"\";\n                const info = infoByPath.get(e3Path);\n                const key = pathStr ? `${workspace}.${pathStr}` : workspace;\n                const path = this.stringToPath(pathStr);\n                const currentHash = info?.hash?.type === \"some\" ? info.hash.value : null;\n                const knownHash = this.knownHashes.get(key);\n\n                if (info?.status) {\n                    const previous = this.statuses.get(key);\n                    this.statuses.set(key, info.status);\n                    if (!previous || previous.type !== info.status.type) {\n                        changed = true;\n                        this.notifyChange(key);\n                    }\n                }\n\n                // Skip content reconciliation for keys with writes in\n                // flight — the write pipeline owns them.\n                if ((this.writeEpochs.get(key) ?? 0) !== epochsAtStart.get(key)\n                    || (this.pendingWriteCounts.get(key) ?? 0) > 0) {\n                    continue;\n                }\n\n                if (currentHash !== knownHash || !this.has(workspace, path)) {\n                    if (currentHash !== null) {\n                        pending.push({ kind: \"fetch\", key, pathStr, path, newHash: currentHash });\n                    } else if (this.has(workspace, path)) {\n                        pending.push({ kind: \"clear\", key, path });\n                    }\n                } else {\n                    // Held under the hash this poll read: the dataset's content as of this poll.\n                    this.confirm(key, poll);\n                }\n            }\n        });\n\n        if (changed || pending.length > 0) this.pollSoon(workspace);\n        else this.backOff(workspace);\n\n        if (pending.length === 0) return;\n\n        // Run all fetches in parallel; per-path errors are isolated. The\n        // results apply under the write-epoch guard: a key written while\n        // the fetch was in flight keeps its optimistic bytes.\n        const fetched = await Promise.allSettled(\n            pending.map(p => p.kind === \"fetch\"\n                ? this.api.get(workspace, p.path).then(result => ({ p, result }))\n                : Promise.resolve({ p, result: null as { data: Uint8Array; hash: string | null } | null }),\n            ),\n        );\n        if (this.destroyed) return;\n\n        // A fetch that failed is tried again by the next poll, which asks in\n        // full: the tag names the content as fetched, which it is not.\n        let failed = false;\n        this.batch(() => {\n            for (let i = 0; i < pending.length; i++) {\n                const p = pending[i]!;\n                const result = fetched[i]!;\n                if (result.status === \"rejected\") {\n                    console.error(`Failed to fetch dataset ${p.key}:`, result.reason);\n                    failed = true;\n                    continue;\n                }\n                if ((this.writeEpochs.get(p.key) ?? 0) !== epochsAtStart.get(p.key)) {\n                    continue; // superseded by a write mid-flight\n                }\n                const queryKey = this.contentKey(workspace, p.path);\n                if (p.kind === \"fetch\") {\n                    this.client.setQueryData(queryKey, result.value.result!.data);\n                    this.knownHashes.set(p.key, result.value.result!.hash ?? p.newHash);\n                    this.confirm(p.key, poll);\n                    this.notifyChange(p.key);\n                } else {\n                    this.client.removeQueries({ queryKey, exact: true });\n                    this.knownHashes.set(p.key, null);\n                    this.confirm(p.key, poll);\n                    this.notifyChange(p.key);\n                }\n            }\n        });\n        if (failed) poller.last = null;\n    }\n\n    /**\n     * Convert a path string back to TreePath.\n     */\n    private stringToPath(pathStr: string): TreePath {\n        if (!pathStr) return [];\n        return pathStr.split(\".\").map(field => variant(\"field\", field));\n    }\n\n    // =========================================================================\n    // Subscription API (mirrors UIStore for compatibility)\n    // =========================================================================\n\n    /**\n     * Subscribe to changes on a specific key or all changes.\n     */\n    subscribe(callback: () => void): () => void;\n    subscribe(key: string, callback: () => void): () => void;\n    subscribe(keyOrCallback: string | (() => void), maybeCallback?: () => void): () => void {\n        if (typeof keyOrCallback === \"function\") {\n            // Global subscription\n            this.globalSubscribers.add(keyOrCallback);\n            return () => { this.globalSubscribers.delete(keyOrCallback); };\n        } else {\n            // Key-specific subscription\n            const key = keyOrCallback;\n            const callback = maybeCallback!;\n            let subs = this.keySubscribers.get(key);\n            if (!subs) {\n                subs = new Set();\n                this.keySubscribers.set(key, subs);\n            }\n            subs.add(callback);\n            return () => {\n                subs.delete(callback);\n                // Only drop the key's registration if it still points at\n                // OUR set — a stale disposer called twice must not tear\n                // down a newer subscriber set under the same key.\n                if (subs.size === 0 && this.keySubscribers.get(key) === subs) {\n                    this.keySubscribers.delete(key);\n                }\n            };\n        }\n    }\n\n    /**\n     * Get global version for useSyncExternalStore.\n     */\n    getSnapshot(): number {\n        return this.version;\n    }\n\n    /**\n     * Get version for a specific key.\n     */\n    getKeyVersion(key: string): number {\n        return this.keyVersions.get(key) ?? 0;\n    }\n\n    /**\n     * Set scheduler for deferred notifications.\n     */\n    setScheduler(scheduler: ((notify: () => void) => void) | undefined): void {\n        this.scheduler = scheduler;\n    }\n\n    /**\n     * Batch multiple operations.\n     */\n    batch<T>(fn: () => T): T {\n        this.batchDepth++;\n        try {\n            return fn();\n        } finally {\n            this.batchDepth--;\n            if (this.batchDepth === 0) {\n                this.flush();\n            }\n        }\n    }\n\n    /**\n     * Notify subscribers of a change.\n     */\n    private notifyChange(key: string): void {\n        // Increment key version\n        const currentVersion = this.keyVersions.get(key) ?? 0;\n        this.keyVersions.set(key, currentVersion + 1);\n\n        this.changedKeys.add(key);\n\n        if (this.batchDepth === 0) {\n            this.flush();\n        }\n    }\n\n    /**\n     * Flush pending notifications.\n     */\n    private flush(): void {\n        if (this.changedKeys.size === 0) return;\n\n        if (this.scheduler) {\n            // Defer notifications to avoid \"setState during render\" errors\n            if (!this.flushScheduled) {\n                this.flushScheduled = true;\n                this.scheduler(() => this.doFlush());\n            }\n        } else {\n            // Synchronous flush (no scheduler provided)\n            this.doFlush();\n        }\n    }\n\n    private doFlush(): void {\n        this.flushScheduled = false;\n        if (this.changedKeys.size === 0) return;\n\n        // Snapshot + clear BEFORE notifying. Without this, a subscriber\n        // that mutates the cache during its callback would add new keys\n        // to `changedKeys`, which we'd then `clear()` at the end —\n        // silently dropping the new notifications. Snapshot-first lets\n        // the recursive flush (or the next batch) handle them.\n        const keys = [...this.changedKeys];\n        const globals = [...this.globalSubscribers];\n        this.changedKeys.clear();\n\n        this.version++;\n\n        for (const key of keys) {\n            const subs = this.keySubscribers.get(key);\n            if (subs) for (const cb of subs) cb();\n        }\n        for (const cb of globals) cb();\n    }\n\n    /**\n     * Cleanup resources. After `destroy()` returns, in-flight fetches,\n     * polls, and writes that are still mid-await won't write to the cache —\n     * `this.destroyed` short-circuits their post-await branches, and the\n     * query client's in-flight fetches are torn down with it.\n     */\n    destroy(): void {\n        this.destroyed = true;\n        this.unwatchVisibility();\n        for (const poller of this.workspacePollers.values()) {\n            poller.handle?.clear();\n        }\n        this.workspacePollers.clear();\n        this.inFlightPolls.clear();\n        this.refreshesAsked.clear();\n        this.pollsStarted.clear();\n        this.confirmedAt.clear();\n        this.confirmWaits.clear();\n        this.hashReadAt.clear();\n        this.hashReadWaits.clear();\n        this.hashWatches.clear();\n        this.keySubscribers.clear();\n        this.globalSubscribers.clear();\n        this.knownHashes.clear();\n        this.statuses.clear();\n        this.keyVersions.clear();\n        this.changedKeys.clear();\n        this.writeEpochs.clear();\n        this.writeChains.clear();\n        this.writeBaselines.clear();\n        this.pendingWriteCounts.clear();\n        this.client.clear();\n        this.client.unmount();\n    }\n}\n\n/** True when `error` is query-core's cancellation rejection (a racing\n *  write aborted the fetch). */\nfunction isCancelledError(error: unknown): boolean {\n    return error instanceof CancelledError;\n}\n\n/** True when `error` is the server's `dataset_unassigned` response — a dataset\n *  with no value yet (a pending task output, or a UI-only input that no task\n *  computes). This is the `unset` status, NOT a failure: callers treat it as\n *  \"no value\" so a surface renders its own loading/empty state rather than\n *  crashing the whole tree. */\nfunction isDatasetUnassignedError(error: unknown): boolean {\n    return error instanceof ApiError && error.code === \"dataset_unassigned\";\n}\n\n/**\n * Create a new {@link ReactiveDatasetCache}. The caller is responsible\n * for constructing a {@link DatasetApi} adapter; in a React tree the\n * `<ReactiveDatasetProvider>` builds one from the surrounding\n * `<E3Provider>`. Tests inject a fake `clock` to drive polling\n * deterministically, and a `visibility` to hide and show the page.\n *\n * @param config - The cache's configuration: its workspace, and the\n *   intervals its polls run at\n * @param api - What every server round-trip goes through\n * @param clock - What the polls are timed by; the real clock unless given\n * @param visibility - Whether the page is hidden; the document's unless given\n * @returns The cache\n */\nexport function createReactiveDatasetCache(\n    config: ReactiveDatasetCacheConfig,\n    api: DatasetApi,\n    clock?: Clock,\n    visibility?: Visibility,\n): ReactiveDatasetCache {\n    return new ReactiveDatasetCache(config, api, clock, visibility);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * StagedStore — local transactional buffer for staged `Data.bind` writes.\n *\n * @remarks\n * Edits made through staged-mode bindings accumulate here as a per-path\n * entry of `{ snapshot, buffered }`, where:\n *   - `snapshot` is the server value at first-write time (pinned),\n *   - `buffered` is the user's current locally-edited value.\n *\n * The runtime value type for each path lives in the\n * {@link bindingRegistry} maintained by `bind-runtime.ts` — this store\n * holds bytes only and intentionally has no opinion about how to decode\n * them. Decoders look up `getBindingTypes(workspace, path).sourceType`.\n *\n * Persistence is via IndexedDB so values can be MB-scale (well past the\n * ~5–10MB localStorage cap). The store maintains a synchronous in-memory\n * cache mirrored from IndexedDB on hydrate, so reactive reads\n * (`hasPending` / `getBuffered`) stay synchronous. Writes update the\n * in-memory cache synchronously and persist to IndexedDB write-through.\n *\n * Subscribers are notified per-key on writes / discards / hydrate. A write of\n * the bytes an entry holds already moves nothing — no version, no\n * notification, no save — as the UI store's write of an equal value: a\n * tracked evaluation runs again when a key it read moves after its read, so\n * one that stages the value it reads settles, where each write moving the key\n * would run it again without end.\n *\n * Entries are kept per server and repository, the store's scope, which the\n * provider sets: IndexedDB is one per browser origin, and two servers or\n * repositories served from one origin must not share pending edits, or a\n * commit would write one project's edit into another's dataset. An entry an\n * older build left names no server, and is dropped when the store hydrates.\n *\n * Hydration is async (one IndexedDB load on first construction). Until\n * `await store.ready()` resolves, the in-memory cache is empty and reads\n * return undefined. Reactive subscribers fire after hydrate completes, so\n * UI components written against the standard `Reactive.Root` machinery\n * pick up hydrated entries automatically without explicit awaiting.\n *\n * @packageDocumentation\n */\n\nimport { BlobType, equalFor } from \"@elaraai/east\";\nimport type { TreePath } from \"@elaraai/e3-types\";\nimport { datasetCacheKey } from \"./dataset-store.js\";\nimport { onClearKept } from \"@elaraai/east-ui-components/internal\";\n\nconst blobEqual = equalFor(BlobType);\n\n// ============================================================================\n// Public types\n// ============================================================================\n\n/** A staged entry as held in the in-memory cache. */\nexport interface StagedEntry {\n    /** Server value at the moment staging began. Pinned across writes;\n     *  used as the snapshot side of the eventual 3-way merge at commit. */\n    snapshot: Uint8Array;\n    /** Current locally-edited value. Updates on every `write`. */\n    buffered: Uint8Array;\n}\n\n/** Persisted form. Identical to {@link StagedEntry} — kept distinct so\n *  future persistence-layer fields (e.g. compression metadata) don't\n *  leak into the in-memory shape. */\nexport interface PersistedStagedEntry {\n    snapshot: Uint8Array;\n    buffered: Uint8Array;\n}\n\n/** Pluggable persistence adapter. Production uses IndexedDB; tests / SSR\n *  use the in-memory adapter. */\nexport interface StagedPersistenceAdapter {\n    /** Load every persisted entry. Called once when the store is constructed. */\n    loadAll(): Promise<Map<string, PersistedStagedEntry>>;\n    /** Persist (or replace) an entry by key. */\n    save(key: string, entry: PersistedStagedEntry): Promise<void>;\n    /** Remove a single persisted entry by key. */\n    remove(key: string): Promise<void>;\n    /** Remove all persisted entries. */\n    clear(): Promise<void>;\n}\n\nexport interface StagedStoreInterface {\n    /** Resolves when the initial hydrate from persistence has completed.\n     *  Reactive subscribers are notified per-key as entries hydrate. */\n    ready(): Promise<void>;\n\n    /** Resolves when every in-flight persistence write has completed.\n     *  Used by tests and by host code that needs to ensure durability\n     *  before a navigation / unload event. */\n    flushPending(): Promise<void>;\n\n    /** True iff this path has a pending staged change. */\n    hasPending(workspace: string, path: TreePath): boolean;\n    /** Get the buffered (locally-edited) value, or undefined if not staged. */\n    getBuffered(workspace: string, path: TreePath): Uint8Array | undefined;\n    /** Get the pinned snapshot value, or undefined if not staged. */\n    getSnapshot(workspace: string, path: TreePath): Uint8Array | undefined;\n    /** Get the full staged entry, or undefined if not staged. */\n    getEntry(workspace: string, path: TreePath): StagedEntry | undefined;\n\n    /** Write a buffered value. Snapshot is pinned on the first call for a\n     *  given path; subsequent writes update only the buffered value, and one\n     *  of the bytes the entry holds already changes nothing and tells no one. */\n    write(\n        workspace: string,\n        path: TreePath,\n        snapshotIfNew: Uint8Array,\n        buffered: Uint8Array,\n    ): void;\n\n    /** Drop the staged entry for a path. Returns true if there was one. */\n    discard(workspace: string, path: TreePath): boolean;\n\n    /** All currently-staged keys (workspace+path combinations) in the scope. */\n    listKeys(): string[];\n\n    /**\n     * Scope the store to a server and repository: every read and write goes to\n     * that scope's entries, and entries of any other scope are kept, unseen.\n     * With no scope set, the store has one scope of its own.\n     *\n     * @param scope - The server and repository, as one string\n     * @returns A function that unsets the scope while it is still this one, so\n     *   a provider tearing down after another set its own leaves that in place\n     */\n    setScope(scope: string): () => void;\n\n    // Reactive tracker integration\n    subscribe(key: string, callback: () => void): () => void;\n    getKeyVersion(key: string): number;\n\n    /** Register a listener for durable-persistence failures (save / remove /\n     *  hydrate), keyed by the affected `datasetCacheKey` (empty string for a\n     *  whole-store hydrate failure). Returns an unsubscribe. With no listener,\n     *  failures fall back to a console warning. Lets a host surface a\n     *  'not durably saved' state, mirroring `BindRuntime.onWriteError`. */\n    onPersistError(cb: (key: string, err: unknown) => void): () => void;\n    /**\n     * Drop every staged entry, in memory and persisted, in every scope —\n     * what one person staged is never another's: east-ui-components' kept\n     * state clears it at a sign-out (`clearKept`), and a test between cases.\n     */\n    clear(): Promise<void>;\n}\n\n// ============================================================================\n// IndexedDB adapter\n// ============================================================================\n\nconst IDB_DB_NAME = \"elaraai-e3-ui\";\nconst IDB_STORE_NAME = \"staged\";\nconst IDB_VERSION = 1;\n\n/**\n * IndexedDB-backed persistence adapter. Stores entries as native\n * structured-clone shapes; no base64 encoding — `Uint8Array` fields\n * survive structured clone losslessly.\n */\nexport class IndexedDBStagedAdapter implements StagedPersistenceAdapter {\n    private dbPromise: Promise<IDBDatabase> | null = null;\n\n    private getDB(): Promise<IDBDatabase> {\n        if (!this.dbPromise) {\n            this.dbPromise = new Promise<IDBDatabase>((resolve, reject) => {\n                const req = indexedDB.open(IDB_DB_NAME, IDB_VERSION);\n                req.onupgradeneeded = () => {\n                    const db = req.result;\n                    if (!db.objectStoreNames.contains(IDB_STORE_NAME)) {\n                        db.createObjectStore(IDB_STORE_NAME);\n                    }\n                };\n                req.onsuccess = () => resolve(req.result);\n                req.onerror  = () => reject(req.error);\n                req.onblocked = () => reject(new Error(\"IndexedDB open blocked\"));\n            });\n            // A transient open failure must not be cached forever — drop the\n            // rejected promise so the next operation retries the open rather\n            // than returning the same rejection for the rest of the session.\n            void this.dbPromise.catch(() => { this.dbPromise = null; });\n        }\n        return this.dbPromise;\n    }\n\n    async loadAll(): Promise<Map<string, PersistedStagedEntry>> {\n        const db = await this.getDB();\n        return new Promise((resolve, reject) => {\n            const tx = db.transaction(IDB_STORE_NAME, \"readonly\");\n            const store = tx.objectStore(IDB_STORE_NAME);\n            const valuesReq = store.getAll();\n            const keysReq = store.getAllKeys();\n            tx.oncomplete = () => {\n                const out = new Map<string, PersistedStagedEntry>();\n                const values = valuesReq.result as PersistedStagedEntry[];\n                const keys = keysReq.result as IDBValidKey[];\n                for (let i = 0; i < keys.length; i++) {\n                    out.set(String(keys[i]), values[i]!);\n                }\n                resolve(out);\n            };\n            tx.onerror = () => reject(tx.error);\n        });\n    }\n\n    async save(key: string, entry: PersistedStagedEntry): Promise<void> {\n        const db = await this.getDB();\n        return new Promise((resolve, reject) => {\n            const tx = db.transaction(IDB_STORE_NAME, \"readwrite\");\n            tx.objectStore(IDB_STORE_NAME).put(entry, key);\n            tx.oncomplete = () => resolve();\n            tx.onerror = () => reject(tx.error);\n        });\n    }\n\n    async remove(key: string): Promise<void> {\n        const db = await this.getDB();\n        return new Promise((resolve, reject) => {\n            const tx = db.transaction(IDB_STORE_NAME, \"readwrite\");\n            tx.objectStore(IDB_STORE_NAME).delete(key);\n            tx.oncomplete = () => resolve();\n            tx.onerror = () => reject(tx.error);\n        });\n    }\n\n    async clear(): Promise<void> {\n        const db = await this.getDB();\n        return new Promise((resolve, reject) => {\n            const tx = db.transaction(IDB_STORE_NAME, \"readwrite\");\n            tx.objectStore(IDB_STORE_NAME).clear();\n            tx.oncomplete = () => resolve();\n            tx.onerror = () => reject(tx.error);\n        });\n    }\n}\n\n// ============================================================================\n// In-memory adapter (tests / SSR / fallback when no IndexedDB available)\n// ============================================================================\n\n/**\n * Trivial in-memory implementation. Used by tests directly and as the\n * fallback when IndexedDB isn't available (e.g. SSR, very locked-down\n * iframes). The \"persistence\" is process-lifetime only.\n */\nexport class MemoryStagedAdapter implements StagedPersistenceAdapter {\n    private map = new Map<string, PersistedStagedEntry>();\n\n    async loadAll(): Promise<Map<string, PersistedStagedEntry>> {\n        // Return a copy so callers mutating their map don't affect ours.\n        return new Map(this.map);\n    }\n\n    async save(key: string, entry: PersistedStagedEntry): Promise<void> {\n        this.map.set(key, entry);\n    }\n\n    async remove(key: string): Promise<void> {\n        this.map.delete(key);\n    }\n\n    async clear(): Promise<void> {\n        this.map.clear();\n    }\n}\n\n// ============================================================================\n// StagedStore — adapter-driven, sync in-memory cache, async write-through.\n// ============================================================================\n\n/** Joins an entry's scope to its `datasetCacheKey`. A workspace name holds no\n *  control character, so a key without one is an older build's. */\nconst SCOPE_SEPARATOR = \"\\u0000\";\n\n/** The `datasetCacheKey` an entry key holds, after its scope. */\nfunction cacheKeyOf(key: string): string {\n    return key.slice(key.indexOf(SCOPE_SEPARATOR) + 1);\n}\n\nexport class StagedStore implements StagedStoreInterface {\n    // By scope and `datasetCacheKey`; subscribers and versions go by the\n    // `datasetCacheKey` alone, which is what a reactive view tracks.\n    private entries: Map<string, StagedEntry> = new Map();\n    private scope: string | null = null;\n    private subscribers: Map<string, Set<() => void>> = new Map();\n    private versions: Map<string, number> = new Map();\n    private adapter: StagedPersistenceAdapter;\n    private hydrated: Promise<void>;\n    private inFlight: Set<Promise<void>> = new Set();\n    /** A wipe of what is persisted, in flight: what flushes the store waits for it, and it waits on the writes alone. */\n    private wiping: Promise<void> | undefined;\n    // Per-key persistence chain — serializes save/remove for a key so they\n    // land in IndexedDB in call order (last write wins) instead of racing.\n    private saveChains: Map<string, Promise<void>> = new Map();\n    // Listeners notified when a persistence op fails durably.\n    private errorListeners: Set<(key: string, err: unknown) => void> = new Set();\n\n    constructor(adapter: StagedPersistenceAdapter) {\n        this.adapter = adapter;\n        this.hydrated = this.hydrate();\n    }\n\n    // ----- public API ------------------------------------------------------\n\n    ready(): Promise<void> {\n        return this.hydrated;\n    }\n\n    async flushPending(): Promise<void> {\n        // Snapshot the in-flight set; new writes during await are tolerated\n        // by re-checking until idle. A wipe in flight is waited for too.\n        while (this.inFlight.size > 0 || this.wiping !== undefined) {\n            await Promise.all([...this.inFlight, ...(this.wiping === undefined ? [] : [this.wiping])]);\n        }\n    }\n\n    hasPending(workspace: string, path: TreePath): boolean {\n        return this.entries.has(this.keyOf(workspace, path));\n    }\n\n    getBuffered(workspace: string, path: TreePath): Uint8Array | undefined {\n        return this.entries.get(this.keyOf(workspace, path))?.buffered;\n    }\n\n    getSnapshot(workspace: string, path: TreePath): Uint8Array | undefined {\n        return this.entries.get(this.keyOf(workspace, path))?.snapshot;\n    }\n\n    getEntry(workspace: string, path: TreePath): StagedEntry | undefined {\n        return this.entries.get(this.keyOf(workspace, path));\n    }\n\n    write(\n        workspace: string,\n        path: TreePath,\n        snapshotIfNew: Uint8Array,\n        buffered: Uint8Array,\n    ): void {\n        const key = this.keyOf(workspace, path);\n        const existing = this.entries.get(key);\n        // The bytes it holds already: nothing moves, so an evaluation that stages what it reads settles (see the module docs).\n        if (existing !== undefined && blobEqual(existing.buffered, buffered)) return;\n        const next: StagedEntry = existing\n            ? { snapshot: existing.snapshot, buffered }\n            : { snapshot: snapshotIfNew, buffered };\n        this.entries.set(key, next);\n        this.notify(datasetCacheKey(workspace, path));\n\n        const persisted: PersistedStagedEntry = {\n            snapshot: next.snapshot,\n            buffered: next.buffered,\n        };\n        this.persist(key, () => this.adapter.save(key, persisted));\n    }\n\n    discard(workspace: string, path: TreePath): boolean {\n        const key = this.keyOf(workspace, path);\n        if (!this.entries.has(key)) return false;\n        this.entries.delete(key);\n        this.notify(datasetCacheKey(workspace, path));\n        this.persist(key, () => this.adapter.remove(key));\n        return true;\n    }\n\n    listKeys(): string[] {\n        const prefix = `${this.scope ?? \"\"}${SCOPE_SEPARATOR}`;\n        return [...this.entries.keys()].filter((key) => key.startsWith(prefix)).map(cacheKeyOf);\n    }\n\n    setScope(scope: string): () => void {\n        const before = this.scope;\n        this.scope = scope;\n        this.notifyScopes(before, scope);\n        return () => {\n            if (this.scope !== scope) return;\n            this.scope = null;\n            this.notifyScopes(scope, null);\n        };\n    }\n\n    subscribe(key: string, callback: () => void): () => void {\n        let set = this.subscribers.get(key);\n        if (!set) {\n            set = new Set();\n            this.subscribers.set(key, set);\n        }\n        set.add(callback);\n        return () => {\n            set!.delete(callback);\n            if (set!.size === 0) this.subscribers.delete(key);\n        };\n    }\n\n    getKeyVersion(key: string): number {\n        return this.versions.get(key) ?? 0;\n    }\n\n    onPersistError(cb: (key: string, err: unknown) => void): () => void {\n        this.errorListeners.add(cb);\n        return () => { this.errorListeners.delete(cb); };\n    }\n\n    clear(): Promise<void> {\n        const keys = [...this.entries.keys()];\n        this.entries.clear();\n        for (const key of new Set(keys.map(cacheKeyOf))) this.notify(key);\n        // Drain in-flight saves/removes before wiping persistence, so a save\n        // that lands after the wipe can't resurrect a discarded entry. The wipe\n        // is in flight itself, apart from the writes: what flushes the store\n        // waits for it, and it waits on the writes alone — never on itself.\n        const wiping: Promise<void> = this.drainWrites().then(() => this.adapter.clear()).then(\n            () => undefined,\n            (err: unknown) => { this.emitPersistError(\"\", err); },\n        ).then(() => { if (this.wiping === wiping) this.wiping = undefined; });\n        this.wiping = wiping;\n        return wiping;\n    }\n\n    // ----- internals -------------------------------------------------------\n\n    /** Waits for every save and remove in flight, those started meanwhile too. */\n    private async drainWrites(): Promise<void> {\n        while (this.inFlight.size > 0) await Promise.all([...this.inFlight]);\n    }\n\n    /** The key a path's entry is held under in the current scope. */\n    private keyOf(workspace: string, path: TreePath): string {\n        return `${this.scope ?? \"\"}${SCOPE_SEPARATOR}${datasetCacheKey(workspace, path)}`;\n    }\n\n    /** Tells every path with an entry in either scope that what it reads has\n     *  changed: the scope's move shows one's entries and hides the other's. */\n    private notifyScopes(from: string | null, to: string | null): void {\n        const keys = new Set<string>();\n        for (const key of this.entries.keys()) {\n            const scope = key.slice(0, key.indexOf(SCOPE_SEPARATOR));\n            if (scope === (from ?? \"\") || scope === (to ?? \"\")) keys.add(cacheKeyOf(key));\n        }\n        for (const key of keys) this.notify(key);\n    }\n\n    private notify(key: string): void {\n        this.versions.set(key, (this.versions.get(key) ?? 0) + 1);\n        const subs = this.subscribers.get(key);\n        if (subs) for (const cb of subs) cb();\n    }\n\n    /**\n     * Serialize a persistence op behind any prior op for the same key, so they\n     * land in IndexedDB in call order (last write wins) rather than racing.\n     * Tracks the op for {@link flushPending} and routes failures to\n     * {@link onPersistError} listeners (falling back to a console warning).\n     */\n    private persist(key: string, op: () => Promise<void>): void {\n        const prev = this.saveChains.get(key) ?? Promise.resolve();\n        // Run op once prev settles (regardless of prev's outcome, so a prior\n        // failure doesn't stall later ops). `settled` never rejects — failures\n        // are routed, not propagated.\n        const settled: Promise<void> = prev.then(op, op).then(\n            () => undefined,\n            (err: unknown) => { this.emitPersistError(cacheKeyOf(key), err); },\n        ).then(() => {\n            if (this.saveChains.get(key) === settled) this.saveChains.delete(key);\n            this.inFlight.delete(settled);\n        });\n        this.saveChains.set(key, settled);\n        this.inFlight.add(settled);\n    }\n\n    private emitPersistError(key: string, err: unknown): void {\n        if (this.errorListeners.size === 0) {\n            console.warn(\"[StagedStore] persistence operation failed:\", err);\n            return;\n        }\n        for (const cb of [...this.errorListeners]) {\n            try {\n                cb(key, err);\n            } catch (listenerErr) {\n                console.warn(\"[StagedStore] persist-error listener threw:\", listenerErr);\n            }\n        }\n    }\n\n    private async hydrate(): Promise<void> {\n        let persisted: Map<string, PersistedStagedEntry>;\n        try {\n            persisted = await this.adapter.loadAll();\n        } catch (err) {\n            this.emitPersistError(\"\", err);\n            return;\n        }\n        for (const [key, p] of persisted) {\n            if (!key.includes(SCOPE_SEPARATOR)) {\n                // An older build's entry names no server: shown under one, a\n                // commit could write it into another project's dataset.\n                this.persist(key, () => this.adapter.remove(key));\n                this.emitPersistError(key, new Error(\n                    `a staged edit of ${key} that an older build left names no server or repository, and was dropped`,\n                ));\n                continue;\n            }\n            this.entries.set(key, {\n                snapshot: p.snapshot,\n                buffered: p.buffered,\n            });\n            this.notify(cacheKeyOf(key));\n        }\n    }\n}\n\n// ============================================================================\n// Default singleton + adapter detection\n// ============================================================================\n\nfunction detectDefaultAdapter(): StagedPersistenceAdapter {\n    try {\n        if (typeof globalThis !== \"undefined\" && typeof (globalThis as { indexedDB?: unknown }).indexedDB !== \"undefined\") {\n            return new IndexedDBStagedAdapter();\n        }\n    } catch {\n        // fall through\n    }\n    return new MemoryStagedAdapter();\n}\n\nlet _stagedStore: StagedStoreInterface | null = null;\n\n// A sign-out clears what is staged with what is kept (east-ui-components' kept state): the store installed then.\nonClearKept(() => { void _stagedStore?.clear(); });\n\n/**\n * The staged store the package uses: the one installed\n * ({@link initializeStagedStore}), else the default — over IndexedDB where\n * there is one, made when it is first asked for.\n *\n * @returns The store\n */\nexport function getStagedStore(): StagedStoreInterface {\n    if (!_stagedStore) {\n        _stagedStore = new StagedStore(detectDefaultAdapter());\n    }\n    return _stagedStore;\n}\n\n/**\n * Install the staged store the package uses from now on. The default\n * `Data.bind` runtime, its reactive tracker and the providers each read the\n * store installed when they use it, so a host installs its own as it loads —\n * one that keeps edits in memory, say, when what they are staged against\n * lives no longer than the page.\n *\n * @param store - The store\n */\nexport function initializeStagedStore(store: StagedStoreInterface): void {\n    _stagedStore = store;\n}\n\nexport function clearStagedStoreSingleton(): void {\n    _stagedStore = null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Runtime implementation for the unified `Data.bind` platform function.\n *\n * Replaces three older runtimes (direct / staged / overlay) with one\n * mode-dispatched implementation. The (mode, patch?) combination resolved\n * at call time selects which closures to install for `read` / `write` /\n * `commit` / `discard`.\n *\n * State (queue, registry, cache singleton, tracking context) is\n * encapsulated in the {@link BindRuntime} class. A process-global\n * {@link defaultBindRuntime} powers the `BindPlatform` export and the\n * free-function helpers; tests construct their own `BindRuntime` for\n * isolation.\n *\n * @packageDocumentation\n */\n\nimport {\n    East,\n    fromEastTypeValue,\n    NullType,\n    BooleanType,\n    some,\n    none,\n    type EastTypeValue,\n    encodeBeast2For,\n    decodeBeast2For,\n    EastError,\n    ConflictError,\n    diffFor,\n    applyFor,\n    PatchType,\n    BlobType,\n    toEastTypeValue,\n    variant,\n    compareFor,\n    equalFor,\n    SortedMap,\n    type ValueTypeOf,\n    OptionType,\n} from \"@elaraai/east\";\nimport { type PlatformFunction, EastTypeType } from \"@elaraai/east/internal\";\nimport {\n    bindPlatformFn,\n    DataBindPrimitives,\n    type DataManifest,\n    type DataBindModeLiteral,\n    DataBindModeType,\n} from \"@elaraai/e3-ui/internal\";\nimport {\n    registerReactiveTracker,\n    registerPlatformImplementation,\n} from \"@elaraai/east-ui-components/platform\";\nimport { TreePathType, DatasetStatusType, type TreePath } from \"@elaraai/e3-types\";\n\nimport {\n    type ReactiveDatasetCacheInterface,\n    datasetCacheKey,\n    datasetPathToString,\n} from \"./dataset-store.js\";\nimport {\n    getStagedStore,\n    type StagedStoreInterface,\n} from \"./staged-store.js\";\n\n// =============================================================================\n// Module-level constants — these never depend on a specific runtime\n// instance, so they live at module scope.\n// =============================================================================\n\n/** Reusable `unchanged` variant for patch datasets. */\nconst UNCHANGED_VARIANT = variant(\"unchanged\", null);\n\n/** Bytewise equality for the cache's encoded BLOB representation. Used\n *  to detect concurrent writes during a commit's network round-trip so\n *  the post-commit `discard()` doesn't drop in-flight edits. */\nconst blobEqual = equalFor(BlobType) as (a: Uint8Array, b: Uint8Array) => boolean;\n\n/** Structural equality for East types — used to detect that two\n *  bindings against the same source path agree on the value type.\n *  Mismatch means one binding's decoder will misread the other's bytes. */\nconst eastTypeEqual = equalFor(EastTypeType) as (a: EastTypeValue, b: EastTypeValue) => boolean;\n\n// =============================================================================\n// Per-binding helpers cache.\n//\n// The platform impl runs on every reactive re-render of every binding;\n// for a Table with N row-cell bindings that's 6×N type-derived\n// closures per render — so we memoize them by sourceType.\n//\n// Keyed by *structural* equality (via `compareFor(EastTypeType)`):\n// each `Data.bind([T], ...)` evaluation builds a fresh `EastTypeValue`\n// from the IR, so a WeakMap-by-identity cache would miss every render.\n// Module-level (not per-runtime) because it's a pure function-of-type;\n// no semantic state belongs to a particular runtime instance.\n// =============================================================================\n\ninterface BindingHelpers {\n    readonly patchType:   EastTypeValue;\n    readonly decodeT:     (bytes: Uint8Array) => unknown;\n    readonly encodeT:     (value: unknown) => Uint8Array;\n    readonly decodePatch: (bytes: Uint8Array) => unknown;\n    readonly encodePatch: (value: unknown) => Uint8Array;\n    readonly apply:       (base: unknown, patch: unknown) => unknown;\n    readonly diff:        (before: unknown, after: unknown) => unknown;\n}\n\nconst helpersCache = new SortedMap<EastTypeValue, BindingHelpers>(\n    undefined,\n    compareFor(EastTypeType),\n);\n\nfunction getBindingHelpers(sourceType: EastTypeValue): BindingHelpers {\n    let cached = helpersCache.get(sourceType);\n    if (!cached) {\n        const patchType = toEastTypeValue(PatchType(sourceType));\n        cached = {\n            patchType,\n            decodeT:     decodeBeast2For(sourceType) as (b: Uint8Array) => unknown,\n            encodeT:     encodeBeast2For(sourceType) as (v: unknown) => Uint8Array,\n            decodePatch: decodeBeast2For(patchType)  as (b: Uint8Array) => unknown,\n            encodePatch: encodeBeast2For(patchType)  as (v: unknown) => Uint8Array,\n            apply:       applyFor(sourceType) as (b: unknown, p: unknown) => unknown,\n            diff:        diffFor(sourceType)  as (b: unknown, a: unknown) => unknown,\n        };\n        helpersCache.set(sourceType, cached);\n    }\n    return cached;\n}\n\n// =============================================================================\n// Public types\n// =============================================================================\n\n/**\n * Per-binding metadata a binding's readers need to decode its source and\n * patch bytes: the Ontology editor's commit, the decision handle's views and\n * the staged store's decoders. Keyed by `datasetCacheKey(workspace,\n * sourcePath)`.\n */\nexport interface BindingTypes {\n    readonly workspace:  string;\n    readonly sourceType: EastTypeValue;\n    readonly patchType:  EastTypeValue;\n    readonly mode:       DataBindModeLiteral;\n    readonly hasPatchDataset: boolean;\n}\n\n/** The struct returned by `Data.bind` — an East-side handle on a\n *  dataset binding. JS-side test callers use the same shape. */\nexport interface BindHandle {\n    read:          () => unknown;\n    write:         (value: unknown) => null;\n    writeAndStart: (value: unknown) => null;\n    start:         () => null;\n    source:        () => unknown;\n    pending:       () => boolean;\n    commit:        () => null;\n    discard:       () => null;\n    has:           () => boolean;\n    status:        () => unknown;\n    binding:       {\n        source: TreePath;\n        patch:  ValueTypeOf<OptionType<TreePath>>;\n        mode:   ValueTypeOf<DataBindModeType>;\n    };\n}\n\n// =============================================================================\n// BindRuntime\n// =============================================================================\n\n/**\n * A `BindRuntime` owns one set of bind-runtime state: pending writes\n * queue, error listeners, cache singleton, tracking context, and\n * binding-types registry. Exists as an instantiable class so tests can\n * construct an isolated runtime per `describe` rather than wrestling\n * with shared module state. The default process-global runtime is\n * {@link defaultBindRuntime}; production callers continue to use the\n * free-function exports.\n */\nexport class BindRuntime {\n    private cache: ReactiveDatasetCacheInterface | null = null;\n    /** The staged store this runtime was given, if any. Without one it uses\n     *  the package's ({@link getStagedStore}) as it is when a binding reads or\n     *  writes, so a store a host installs (`initializeStagedStore`) reaches\n     *  `Data.bind` as it reaches the reactive tracker and the providers: the\n     *  default runtime is made as this module loads, before any host can. */\n    private readonly givenStaged: StagedStoreInterface | undefined;\n    /** The staged stores whose persistence failures this runtime reports. */\n    private readonly reported = new WeakSet<StagedStoreInterface>();\n\n    // Pending-writes queue.\n    private readonly pendingWrites: Array<() => Promise<void>> = [];\n    private isProcessingWrites = false;\n    private drainPromise: Promise<void> | null = null;\n    private resolveDrain: (() => void) | null = null;\n    private readonly writeErrorListeners = new Set<(error: unknown) => void>();\n\n    // Reactive tracking — single combined tracker for both dataset\n    // reads and staged-buffer reads. The renderer's reactive context\n    // picks up keys from either source uniformly, each with its version\n    // (the cache's and the staged store's together) as first read.\n    private trackingContext: Map<string, number> | null = null;\n\n    // Binding types registry — populated on every `Data.bind` call so a\n    // binding's readers (the Ontology editor's commit, the decision handle,\n    // the staged store) can decode its source/patch bytes and pick the right\n    // commit code path.\n    private readonly bindingRegistry = new Map<string, BindingTypes>();\n\n    // Suppress-set for the stale-patch fallback warning. Module\n    // closures rebuild on every East-side `Data.bind` evaluation\n    // (i.e., every `Reactive.Root` re-render), so a closure-local\n    // \"logged once\" flag would reset every render and the warning\n    // would spam the console.\n    private readonly fallbackWarningEmitted = new Set<string>();\n\n    // List cache helpers.\n    private readonly listCache = new Map<string, string[]>();\n\n    // Compiled-handle cache (issue #106 perf). The bind impl compiles N\n    // East.function methods per bind, and binds re-run on every reactive frame.\n    // The compiled IR is a pure function of (sourceType, sourcePath, patch, mode)\n    // — same key ⇒ same methods — and the methods resolve cache/workspace LIVE,\n    // so a cached handle still re-binds correctly across renders / cache swaps.\n    // Keyed *structurally* (each bind builds a fresh EastTypeValue from IR, so a\n    // by-identity cache would miss every render — same reason as helpersCache).\n    private readonly handleCache = new SortedMap<EastTypeValue, Map<string, BindHandle>>(\n        undefined,\n        compareFor(EastTypeType),\n    );\n\n    /**\n     * @param staged - The staged store this runtime uses for staged-mode\n     *  buffers. Without one, the package's, as it is when a binding uses it.\n     */\n    constructor(staged?: StagedStoreInterface) {\n        this.givenStaged = staged;\n        if (staged !== undefined) this.reportPersistErrors(staged);\n    }\n\n    /** The staged store a binding buffers in now. */\n    private get staged(): StagedStoreInterface {\n        const store = this.givenStaged ?? getStagedStore();\n        this.reportPersistErrors(store);\n        return store;\n    }\n\n    /** Surface a staged store's persistence failures (IndexedDB save/remove)\n     *  through the same channel as dataset write failures, so a host that\n     *  registers onWriteError sees 'edit not durably saved' too. Once per\n     *  store: a store lives as long as the page, so the subscription is never\n     *  torn down. */\n    private reportPersistErrors(store: StagedStoreInterface): void {\n        if (this.reported.has(store)) return;\n        this.reported.add(store);\n        store.onPersistError((_key, err) => this.emitWriteError(err));\n    }\n\n    // ----- cache singleton ------------------------------------------------\n\n    /** Read the active cache. Throws if none has been initialized. */\n    requireCache(): ReactiveDatasetCacheInterface {\n        if (!this.cache) {\n            throw new Error(\n                \"ReactiveDatasetCache not initialized. \" +\n                \"Use ReactiveDatasetProvider in React or call initializeCache() directly.\",\n            );\n        }\n        return this.cache;\n    }\n\n    /** Read the active cache, returning null if not yet initialized. */\n    getCache(): ReactiveDatasetCacheInterface | null {\n        return this.cache;\n    }\n\n    /** Set the active cache. When the reference changes, drops any\n     *  leftover queued writes that captured the old cache. Same-cache\n     *  re-init (Strict Mode double-invoke; HMR) preserves the queue. */\n    initializeCache(cache: ReactiveDatasetCacheInterface): void {\n        if (this.cache !== cache) {\n            this.clearPendingWrites();\n        }\n        this.cache = cache;\n    }\n\n    /**\n     * Clear the active cache and drop any queued writes.\n     *\n     * @param cache - Clear only while this is the active cache, so a provider\n     *   tearing down after another installed its own leaves that one in place\n     */\n    clearCache(cache?: ReactiveDatasetCacheInterface): void {\n        if (cache !== undefined && this.cache !== cache) return;\n        this.cache = null;\n        this.clearPendingWrites();\n        this.handleCache.clear();\n    }\n\n    // ----- pending writes queue -------------------------------------------\n\n    /** Subscribe to write-queue errors. Returns an unsubscribe fn. */\n    onWriteError(cb: (error: unknown) => void): () => void {\n        this.writeErrorListeners.add(cb);\n        return () => { this.writeErrorListeners.delete(cb); };\n    }\n\n    /** Fan a write/persistence error out to every registered listener. */\n    private emitWriteError(error: unknown): void {\n        for (const cb of this.writeErrorListeners) {\n            try { cb(error); } catch (cbErr) {\n                console.error(\"Data.bind write-error listener threw:\", cbErr);\n            }\n        }\n    }\n\n    /** Resolve once every currently-queued write has finished\n     *  (success or failure). Errors are NOT thrown — subscribe via\n     *  {@link onWriteError} for those. */\n    awaitPendingWrites(): Promise<void> {\n        if (!this.isProcessingWrites && this.pendingWrites.length === 0) {\n            return Promise.resolve();\n        }\n        if (!this.drainPromise) {\n            this.drainPromise = new Promise(res => { this.resolveDrain = res; });\n        }\n        return this.drainPromise;\n    }\n\n    /** Drop every queued write without running it. */\n    clearPendingWrites(): void {\n        this.pendingWrites.length = 0;\n        if (this.resolveDrain) {\n            this.resolveDrain();\n            this.drainPromise = null;\n            this.resolveDrain = null;\n        }\n    }\n\n    /** Queue a write — internal API used by the bind-handle closures. */\n    private queueWrite(writeFn: () => Promise<void>): void {\n        this.pendingWrites.push(writeFn);\n        void this.processWriteQueue();\n    }\n\n    private async processWriteQueue(): Promise<void> {\n        if (this.isProcessingWrites) return;\n        this.isProcessingWrites = true;\n        while (this.pendingWrites.length > 0) {\n            const writeFn = this.pendingWrites.shift()!;\n            try {\n                await writeFn();\n            } catch (error) {\n                console.error(\"Data.bind write failed:\", error);\n                this.emitWriteError(error);\n            }\n        }\n        this.isProcessingWrites = false;\n        if (this.resolveDrain) {\n            this.resolveDrain();\n            this.drainPromise = null;\n            this.resolveDrain = null;\n        }\n    }\n\n    // ----- reactive tracking ---------------------------------------------\n\n    /**\n     * Start recording the datasets an evaluation reads.\n     *\n     * @returns What it records: each dataset's key, with its version as first read\n     */\n    enableTracking(): ReadonlyMap<string, number> {\n        this.trackingContext = new Map();\n        return this.trackingContext;\n    }\n\n    /**\n     * Stop recording.\n     *\n     * @returns Each dataset's key the evaluation read, with its version as it first read it — a staged write it made\n     *   since stands at another\n     */\n    disableTracking(): ReadonlyMap<string, number> {\n        const keys = this.trackingContext ?? new Map<string, number>();\n        this.trackingContext = null;\n        return keys;\n    }\n\n    isTracking(): boolean {\n        return this.trackingContext !== null;\n    }\n\n    /**\n     * A dataset's version as a reader of it sees it: its cache's and its\n     * staged buffer's together, which move as either does.\n     *\n     * @param key - The dataset's key ({@link datasetCacheKey})\n     * @returns Its version\n     */\n    keyVersion(key: string): number {\n        return (this.cache?.getKeyVersion(key) ?? 0) + this.staged.getKeyVersion(key);\n    }\n\n    trackPath(workspace: string, path: TreePath): void {\n        if (this.trackingContext === null) return;\n        const key = datasetCacheKey(workspace, path);\n        if (!this.trackingContext.has(key)) this.trackingContext.set(key, this.keyVersion(key));\n    }\n\n    // ----- binding registry ----------------------------------------------\n\n    getBindingTypes(workspace: string, sourcePath: TreePath): BindingTypes | undefined {\n        return this.bindingRegistry.get(datasetCacheKey(workspace, sourcePath));\n    }\n\n    /** Clear binding-registry entries. Pass a workspace to clear only\n     *  that workspace's entries. Match is by stored field, not key\n     *  prefix — workspace names that share a textual prefix never\n     *  collide. */\n    clearBindingRegistry(workspace?: string): void {\n        if (workspace === undefined) {\n            this.bindingRegistry.clear();\n            this.fallbackWarningEmitted.clear();\n            return;\n        }\n        for (const [key, info] of [...this.bindingRegistry.entries()]) {\n            if (info.workspace === workspace) {\n                this.bindingRegistry.delete(key);\n                this.fallbackWarningEmitted.delete(key);\n            }\n        }\n    }\n\n    private registerBindingTypes(workspace: string, sourcePath: TreePath, info: BindingTypes): void {\n        const key = datasetCacheKey(workspace, sourcePath);\n        const existing = this.bindingRegistry.get(key);\n        if (existing) {\n            // Hot path — runs once per binding per `Reactive.Root`\n            // re-render. Identity-equal mode/patch/sourceType means\n            // there's nothing to update OR warn about, so bail before\n            // the structural type-equality check, which can be O(type\n            // tree size) for nested struct/variant trees.\n            if (existing.mode === info.mode\n                && existing.hasPatchDataset === info.hasPatchDataset\n                && Object.is(existing.sourceType, info.sourceType)) {\n                return;\n            }\n            const shapeChanged = existing.mode !== info.mode\n                || existing.hasPatchDataset !== info.hasPatchDataset;\n            const typeChanged = !eastTypeEqual(existing.sourceType, info.sourceType);\n            if (!shapeChanged && !typeChanged) {\n                this.bindingRegistry.set(key, info);\n                return;\n            }\n            console.warn(\n                `[Data.bind] source path \"${key}\" bound twice with different `\n                + `${typeChanged ? \"value types\" : \"(mode, patch) shapes\"}: `\n                + `existing { mode: \"${existing.mode}\", hasPatch: ${existing.hasPatchDataset} } vs `\n                + `new { mode: \"${info.mode}\", hasPatch: ${info.hasPatchDataset} }. `\n                + `the most-recent metadata is used; one of the two bindings may read incorrectly.`,\n            );\n        }\n        this.bindingRegistry.set(key, info);\n    }\n\n    // ----- bind-handle construction --------------------------------------\n\n    /**\n     * Build a `Data.bind` handle. Its methods are thin IR-bearing\n     * `East.function`s over the `data_*` primitives, capturing only the\n     * plain-data `{source, patch, mode}` descriptor — so the handle is ordinary\n     * serializable East data (issue #106) and re-binds to the decoder's cache.\n     * Public so tests can call it directly without East's compile/dispatch.\n     *\n     * @throws `EastError` if the cache is uninitialized, the workspace is not\n     *  configured, or `allowed` is non-null and any referenced path is not in it.\n     */\n    buildBindHandle(\n        sourceType: EastTypeValue,\n        sourcePath: TreePath,\n        patchPath: TreePath | undefined,\n        mode: DataBindModeLiteral,\n        allowed?: ReadonlySet<string>,\n    ): BindHandle {\n        const cache = this.requireCache();\n        const ws = cache.getConfig().workspace;\n        if (!ws) throw new Error(\"ReactiveDatasetCache workspace not configured\");\n\n        if (allowed) {\n            const sStr = datasetPathToString(sourcePath);\n            if (!allowed.has(sStr)) {\n                throw new EastError(\n                    `Data.bind: source path \"${sStr}\" not declared in manifest`,\n                    { location: [{ filename: \"Data.bind\", line: 0n, column: 0n }] },\n                );\n            }\n            if (patchPath) {\n                const pStr = datasetPathToString(patchPath);\n                if (!allowed.has(pStr)) {\n                    throw new EastError(\n                        `Data.bind: patch path \"${pStr}\" not declared in manifest`,\n                        { location: [{ filename: \"Data.bind\", line: 0n, column: 0n }] },\n                    );\n                }\n            }\n        }\n\n        // Bind-time registration so the commit path has the binding types\n        // immediately; the primitives also re-register on first read (decode self-heal).\n        const { patchType } = getBindingHelpers(sourceType);\n        this.registerBindingTypes(ws, sourcePath, {\n            workspace: ws,\n            sourceType,\n            patchType,\n            mode,\n            hasPatchDataset: patchPath !== undefined,\n        });\n\n        // Compiled-handle cache: the method IR is a pure function of\n        // (sourceType, sourcePath, patch, mode) — skip the N East.compile calls\n        // on a hit (the methods resolve cache/workspace live, so the cached\n        // handle still re-binds). registerBindingTypes above already ran (cheap +\n        // idempotent), so the commit path stays correct on hits too.\n        const descKey = `${datasetPathToString(sourcePath)}\u0000${patchPath !== undefined ? datasetPathToString(patchPath) : \"\"}\u0000${mode}`;\n        let byDesc = this.handleCache.get(sourceType);\n        if (byDesc) {\n            const hit = byDesc.get(descKey);\n            if (hit) return hit;\n        } else {\n            byDesc = new Map<string, BindHandle>();\n            this.handleCache.set(sourceType, byDesc);\n        }\n\n        // The descriptor each method captures (plain data) + the source type type-arg.\n        const T = fromEastTypeValue(sourceType);\n        const srcExpr = East.value(sourcePath, TreePathType);\n        const patchExpr = East.value(patchPath !== undefined ? some(patchPath) : none, OptionType(TreePathType));\n        const modeExpr = East.value(variant(mode, null), DataBindModeType);\n        const platform = this.buildPrimitives();\n        const P = DataBindPrimitives;\n\n        const handle: BindHandle = {\n            read:          East.compile(East.function([], T, ($) => { $.return(P.read([T], srcExpr, patchExpr, modeExpr)); }), platform),\n            write:         East.compile(East.function([T], NullType, ($, v) => { $.return(P.write([T], srcExpr, patchExpr, modeExpr, v)); }), platform),\n            writeAndStart: East.compile(East.function([T], NullType, ($, v) => { $.return(P.writeAndStart([T], srcExpr, patchExpr, modeExpr, v)); }), platform),\n            start:         East.compile(East.function([], NullType, ($) => { $.return(P.start([T], srcExpr, patchExpr, modeExpr)); }), platform),\n            source:        East.compile(East.function([], T, ($) => { $.return(P.source([T], srcExpr, patchExpr, modeExpr)); }), platform),\n            pending:       East.compile(East.function([], BooleanType, ($) => { $.return(P.pending([T], srcExpr, patchExpr, modeExpr)); }), platform),\n            commit:        East.compile(East.function([], NullType, ($) => { $.return(P.commit([T], srcExpr, patchExpr, modeExpr)); }), platform),\n            discard:       East.compile(East.function([], NullType, ($) => { $.return(P.discard([T], srcExpr, patchExpr, modeExpr)); }), platform),\n            has:           East.compile(East.function([], BooleanType, ($) => { $.return(P.has([T], srcExpr, patchExpr, modeExpr)); }), platform),\n            status:        East.compile(East.function([], DatasetStatusType, ($) => { $.return(P.status([T], srcExpr, patchExpr, modeExpr)); }), platform),\n            binding: {\n                source: sourcePath,\n                patch:  patchPath !== undefined ? some(patchPath) : none,\n                mode:   variant(mode, null),\n            },\n        };\n        byDesc.set(descKey, handle);\n        return handle;\n    }\n\n    /**\n     * The low-level primitives backing handle methods, bound to THIS runtime.\n     * Registered globally (extension registry) and included by the scoped\n     * platform (e3 `ui()` tasks) so a decoded handle re-binds here. Each impl\n     * recovers the `{source, patch, mode}` descriptor from its args and delegates\n     * to {@link buildRawHandle}, reusing the full mode×patch logic verbatim.\n     */\n    buildPrimitives(): PlatformFunction[] {\n        const raw = (sourceType: EastTypeValue, sourceArg: unknown, patchOpt: unknown, modeVariant: unknown): BindHandle => {\n            const { patchPath, mode } = resolveOptions(patchOpt, modeVariant);\n            return this.buildRawHandle(sourceType, sourceArg as TreePath, patchPath, mode);\n        };\n        const P = DataBindPrimitives;\n        return [\n            P.read.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown) => raw(t, s, p, m).read()),\n            P.source.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown) => raw(t, s, p, m).source()),\n            P.write.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown, v: unknown) => raw(t, s, p, m).write(v)),\n            P.writeAndStart.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown, v: unknown) => raw(t, s, p, m).writeAndStart(v)),\n            P.start.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown) => raw(t, s, p, m).start()),\n            P.pending.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown) => raw(t, s, p, m).pending()),\n            P.commit.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown) => raw(t, s, p, m).commit()),\n            P.discard.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown) => raw(t, s, p, m).discard()),\n            P.has.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown) => raw(t, s, p, m).has()),\n            P.status.implement((t: EastTypeValue) => (s: unknown, p: unknown, m: unknown) => raw(t, s, p, m).status()),\n        ];\n    }\n\n    /**\n     * Build the raw (host-closure) bind handle for a single\n     * `(sourcePath, mode, patch?)` triple. The mode×patch matrix lives here; the\n     * serializable {@link buildBindHandle} wraps each method as an `East.function`\n     * over a primitive that delegates back here. Re-registers binding types on\n     * every call (decode self-heal). Public so tests can drive the raw closures.\n     */\n    buildRawHandle(\n        sourceType: EastTypeValue,\n        sourcePath: TreePath,\n        patchPath: TreePath | undefined,\n        mode: DataBindModeLiteral,\n    ): BindHandle {\n        const cache = this.requireCache();\n        const ws = cache.getConfig().workspace;\n        if (!ws) throw new Error(\"ReactiveDatasetCache workspace not configured\");\n\n        const { patchType, decodeT, encodeT, decodePatch, encodePatch, apply, diff }\n            = getBindingHelpers(sourceType);\n\n        this.registerBindingTypes(ws, sourcePath, {\n            workspace: ws,\n            sourceType,\n            patchType,\n            mode,\n            hasPatchDataset: patchPath !== undefined,\n        });\n\n        const staged = this.staged;\n        const fallbackKey = datasetCacheKey(ws, sourcePath);\n        const fallbackWarningEmitted = this.fallbackWarningEmitted;\n\n        const readSourceBytes = (): Uint8Array => {\n            const bytes = cache.read(ws, sourcePath);\n            if (!bytes) {\n                throw new EastError(\n                    `Source dataset not loaded: ${datasetCacheKey(ws, sourcePath)}`,\n                    { location: [{ filename: \"Data.bind\", line: 0n, column: 0n }] },\n                );\n            }\n            return bytes;\n        };\n        const readSourceValue = (): unknown => decodeT(readSourceBytes());\n        const readPatchValue = (): unknown => {\n            if (!patchPath) return UNCHANGED_VARIANT;\n            const bytes = cache.read(ws, patchPath);\n            if (!bytes) return UNCHANGED_VARIANT;\n            return decodePatch(bytes);\n        };\n        const overlaidSource = (): unknown => {\n            // `apply` throws ConflictError on stale ops — fall back to\n            // source so transient drift never crashes form components.\n            // Any non-ConflictError is re-thrown: those would indicate\n            // a bug in `applyFor` itself, not user-visible drift.\n            const sourceVal = readSourceValue();\n            try {\n                return apply(sourceVal, readPatchValue());\n            } catch (err) {\n                if (!(err instanceof ConflictError)) throw err;\n                if (!fallbackWarningEmitted.has(fallbackKey)) {\n                    fallbackWarningEmitted.add(fallbackKey);\n                    console.warn(\n                        `[Data.bind] read fell back to source for \"${fallbackKey}\" — `\n                        + `patch is stale relative to source.`,\n                        err,\n                    );\n                }\n                return sourceVal;\n            }\n        };\n\n        const bindingDescriptor = {\n            source: sourcePath,\n            patch:  patchPath ? some(patchPath) : none,\n            mode:   variant(mode, null),\n        };\n\n        const writeStaged = (value: unknown): null => {\n            this.trackPath(ws, sourcePath);\n            const buffered = encodeT(value);\n            if (staged.hasPending(ws, sourcePath)) {\n                // `snapshotIfNew` is ignored when an entry exists; pass\n                // the buffered bytes to avoid a redundant cache read.\n                staged.write(ws, sourcePath, buffered, buffered);\n            } else {\n                const snapshot = readSourceBytes();\n                staged.write(ws, sourcePath, snapshot, buffered);\n            }\n            return null;\n        };\n\n        // Standalone dataflow launch, queued behind any pending writes. In\n        // direct mode `write(v)` then `start()` propagates the just-written\n        // value rather than racing it. In STAGED mode `write(v)` only buffers\n        // locally (it never reaches the dataset), so `start()` launches the\n        // dataflow against the last *committed* server value — call `commit()`\n        // first to push staged edits before starting.\n        const startLaunch = (): null => {\n            this.queueWrite(() => cache.launchDataflow(ws));\n            return null;\n        };\n\n        // Whether the source has a value, tracked as a read of it: a view that\n        // renders an empty branch on `has()` re-renders when the value lands.\n        const hasSource = (): boolean => {\n            this.trackPath(ws, sourcePath);\n            return cache.has(ws, sourcePath);\n        };\n\n        // ----- direct, no patch — writes go to source ------------------\n        if (mode === \"direct\" && !patchPath) {\n            return {\n                read: () => {\n                    this.trackPath(ws, sourcePath);\n                    return readSourceValue();\n                },\n                write: (value: unknown) => {\n                    this.queueWrite(() => cache.write(ws, sourcePath, encodeT(value)));\n                    return null;\n                },\n                writeAndStart: (value: unknown) => {\n                    this.queueWrite(() => cache.writeAndStart(ws, sourcePath, encodeT(value)));\n                    return null;\n                },\n                start: startLaunch,\n                source: () => {\n                    this.trackPath(ws, sourcePath);\n                    return readSourceValue();\n                },\n                pending: () => false,\n                commit: () => null,\n                discard: () => null,\n                has: hasSource,\n                status: () => {\n                    this.trackPath(ws, sourcePath);\n                    return cache.getStatus(ws, sourcePath);\n                },\n                binding: bindingDescriptor,\n            };\n        }\n\n        // ----- direct, with patch — writes go to the patch dataset -----\n        if (mode === \"direct\" && patchPath) {\n            const pPath = patchPath;\n            return {\n                read: () => {\n                    this.trackPath(ws, sourcePath);\n                    this.trackPath(ws, pPath);\n                    return overlaidSource();\n                },\n                write: (value: unknown) => {\n                    const next = diff(readSourceValue(), value);\n                    this.queueWrite(() => cache.write(ws, pPath, encodePatch(next)));\n                    return null;\n                },\n                writeAndStart: (value: unknown) => {\n                    const next = diff(readSourceValue(), value);\n                    this.queueWrite(() => cache.writeAndStart(ws, pPath, encodePatch(next)));\n                    return null;\n                },\n                start: startLaunch,\n                source: () => {\n                    this.trackPath(ws, sourcePath);\n                    return readSourceValue();\n                },\n                pending: () => {\n                    this.trackPath(ws, pPath);\n                    return (readPatchValue() as { type: string }).type !== \"unchanged\";\n                },\n                commit: () => {\n                    // Snapshot inputs synchronously so re-renders during\n                    // the await don't change what we apply. Run the\n                    // apply inside `queueWrite` so a stale-patch\n                    // ConflictError is routed through the same error\n                    // pipeline as network failures.\n                    const sourceVal = readSourceValue();\n                    const patchVal  = readPatchValue();\n                    this.queueWrite(async () => {\n                        const next = apply(sourceVal, patchVal);\n                        // Sequence the two cross-key writes: commit the source\n                        // FIRST, then clear the patch only once that lands. A\n                        // partial failure is then self-healing — a failed source\n                        // write leaves the patch intact (still pending), and a\n                        // failed patch-clear leaves the source committed (an\n                        // idempotent retry re-clears). Doing both in one batch\n                        // (which only batches notifications, not the network\n                        // writes) could orphan a populated patch over a\n                        // committed source.\n                        await cache.write(ws, sourcePath, encodeT(next));\n                        await cache.write(ws, pPath, encodePatch(UNCHANGED_VARIANT));\n                    });\n                    return null;\n                },\n                discard: () => {\n                    this.queueWrite(() => cache.write(ws, pPath, encodePatch(UNCHANGED_VARIANT)));\n                    return null;\n                },\n                has: hasSource,\n                status: () => {\n                    this.trackPath(ws, sourcePath);\n                    return cache.getStatus(ws, sourcePath);\n                },\n                binding: bindingDescriptor,\n            };\n        }\n\n        // ----- staged, no patch — IDB buffer + commit-to-source --------\n        if (mode === \"staged\" && !patchPath) {\n            return {\n                read: () => {\n                    this.trackPath(ws, sourcePath);\n                    const buffered = staged.getBuffered(ws, sourcePath);\n                    if (buffered !== undefined) return decodeT(buffered);\n                    return readSourceValue();\n                },\n                write: writeStaged,\n                writeAndStart: writeStaged,\n                start: startLaunch,\n                source: () => {\n                    this.trackPath(ws, sourcePath);\n                    return readSourceValue();\n                },\n                pending: () => {\n                    this.trackPath(ws, sourcePath);\n                    return staged.hasPending(ws, sourcePath);\n                },\n                commit: () => {\n                    const entry = staged.getEntry(ws, sourcePath);\n                    if (!entry) return null;\n                    const buffered = entry.buffered;\n                    // Drop the buffer ONLY after the server write\n                    // succeeds — and only if the user hasn't edited\n                    // during the round-trip.\n                    this.queueWrite(async () => {\n                        await cache.writeAndStart(ws, sourcePath, buffered);\n                        const current = staged.getBuffered(ws, sourcePath);\n                        if (current !== undefined && blobEqual(current, buffered)) {\n                            staged.discard(ws, sourcePath);\n                        }\n                    });\n                    return null;\n                },\n                discard: () => {\n                    staged.discard(ws, sourcePath);\n                    return null;\n                },\n                has: hasSource,\n                status: () => {\n                    this.trackPath(ws, sourcePath);\n                    return cache.getStatus(ws, sourcePath);\n                },\n                binding: bindingDescriptor,\n            };\n        }\n\n        // ----- staged, with patch — IDB buffer + publish-to-patch ------\n        const pPath = patchPath!;\n        return {\n            read: () => {\n                this.trackPath(ws, sourcePath);\n                this.trackPath(ws, pPath);\n                const buffered = staged.getBuffered(ws, sourcePath);\n                if (buffered !== undefined) return decodeT(buffered);\n                return overlaidSource();\n            },\n            write: writeStaged,\n            writeAndStart: writeStaged,\n            start: startLaunch,\n            source: () => {\n                this.trackPath(ws, sourcePath);\n                return readSourceValue();\n            },\n            pending: () => {\n                this.trackPath(ws, sourcePath);\n                return staged.hasPending(ws, sourcePath);\n            },\n            commit: () => {\n                const entry = staged.getEntry(ws, sourcePath);\n                if (!entry) return null;\n                const bufferedSnapshot = entry.buffered;\n                const bufferedValue = decodeT(bufferedSnapshot);\n                const newPatch = diff(readSourceValue(), bufferedValue);\n                this.queueWrite(async () => {\n                    await cache.writeAndStart(ws, pPath, encodePatch(newPatch));\n                    const current = staged.getBuffered(ws, sourcePath);\n                    if (current !== undefined && blobEqual(current, bufferedSnapshot)) {\n                        staged.discard(ws, sourcePath);\n                    }\n                });\n                return null;\n            },\n            discard: () => {\n                staged.discard(ws, sourcePath);\n                return null;\n            },\n            has: hasSource,\n            status: () => {\n                this.trackPath(ws, sourcePath);\n                return cache.getStatus(ws, sourcePath);\n            },\n            binding: bindingDescriptor,\n        };\n    }\n\n    // ----- platform building ---------------------------------------------\n\n    /** Build a `Data.bind` PlatformFunction bound to this runtime.\n     *  Pass `allowed=null` for an unscoped impl (the global\n     *  `BindPlatform`); pass a Set for manifest scoping. */\n    buildPlatform(allowed: ReadonlySet<string> | null): PlatformFunction {\n        return bindPlatformFn.implement((sourceType: EastTypeValue) =>\n            (sourcePathArg: unknown, patchOpt: unknown, modeVariant: unknown) => {\n                const sourcePath = sourcePathArg as TreePath;\n                const { patchPath, mode } = resolveOptions(patchOpt, modeVariant);\n                return this.buildBindHandle(\n                    sourceType,\n                    sourcePath,\n                    patchPath,\n                    mode,\n                    allowed ?? undefined,\n                );\n            },\n        );\n    }\n\n    // ----- list cache helpers --------------------------------------------\n\n    async preloadList(workspace: string, path: TreePath): Promise<string[]> {\n        const cache = this.requireCache();\n        const key = datasetCacheKey(workspace, path);\n        const cached = this.listCache.get(key);\n        if (cached) return cached;\n        const result = await cache.list(workspace, path);\n        this.listCache.set(key, result);\n        return result;\n    }\n\n    clearListCache(): void {\n        this.listCache.clear();\n    }\n}\n\n// =============================================================================\n// Argument resolution — pure, used by both buildPlatform and tests.\n// =============================================================================\n\ninterface ResolvedOptions {\n    readonly patchPath?: TreePath;\n    readonly mode:       DataBindModeLiteral;\n}\n\nfunction resolveOptions(patchOpt: unknown, modeVariant: unknown): ResolvedOptions {\n    const opt = patchOpt as ValueTypeOf<OptionType<TreePath>>;\n    const patchPath = opt.type === \"some\" ? (opt.value as TreePath) : undefined;\n    const m = modeVariant as ValueTypeOf<DataBindModeType>;\n    if (m.type !== \"staged\" && m.type !== \"direct\") {\n        throw new Error(`Data.bind: unknown mode variant \"${(m as any).type}\" — expected \"staged\" or \"direct\"`);\n    }\n    const mode = m.type as DataBindModeLiteral;\n    return patchPath ? { patchPath, mode } : { mode };\n}\n\n// =============================================================================\n// Default process-global runtime + free-function exports for backwards\n// compatibility. Tests construct their own `new BindRuntime()` instead.\n// =============================================================================\n\n/** Process-global runtime backing the `BindPlatform` export and the\n *  free-function helpers. */\nexport const defaultBindRuntime = new BindRuntime();\n\n/** Read the active cache singleton. Throws if no provider has been mounted. */\nexport function getReactiveDatasetCache(): ReactiveDatasetCacheInterface {\n    return defaultBindRuntime.requireCache();\n}\n\n/** Set the active cache singleton — called by the React provider on mount. */\nexport function initializeReactiveDatasetCache(cache: ReactiveDatasetCacheInterface): void {\n    defaultBindRuntime.initializeCache(cache);\n}\n\n/**\n * Clear the active cache singleton — called on unmount or test teardown. Also\n * drops any queued writes that captured the old cache.\n *\n * @param cache - Clear only while this is the active cache\n */\nexport function clearReactiveDatasetCache(cache?: ReactiveDatasetCacheInterface): void {\n    defaultBindRuntime.clearCache(cache);\n}\n\nexport function enableBindingTracking(): ReadonlyMap<string, number> {\n    return defaultBindRuntime.enableTracking();\n}\nexport function disableBindingTracking(): ReadonlyMap<string, number> {\n    return defaultBindRuntime.disableTracking();\n}\nexport function isBindingTracking(): boolean {\n    return defaultBindRuntime.isTracking();\n}\nexport function trackDatasetPath(workspace: string, path: TreePath): void {\n    defaultBindRuntime.trackPath(workspace, path);\n}\n\nexport function getBindingTypes(workspace: string, sourcePath: TreePath): BindingTypes | undefined {\n    return defaultBindRuntime.getBindingTypes(workspace, sourcePath);\n}\nexport function clearBindingRegistry(workspace?: string): void {\n    defaultBindRuntime.clearBindingRegistry(workspace);\n}\n\n/** Subscribe to write-queue errors. Called once for every failed write. */\nexport function onWriteError(cb: (error: unknown) => void): () => void {\n    return defaultBindRuntime.onWriteError(cb);\n}\n/** Resolve once every currently-queued write has finished. */\nexport function awaitPendingWrites(): Promise<void> {\n    return defaultBindRuntime.awaitPendingWrites();\n}\n/** Drop every queued write without running it. */\nexport function clearPendingWrites(): void {\n    defaultBindRuntime.clearPendingWrites();\n}\n\n/** Global, manifest-unscoped `Data.bind` impl + its backing primitives.\n *  Registered on module load (powers the extension registry decode path). */\nexport const BindPlatform: PlatformFunction[] = [\n    defaultBindRuntime.buildPlatform(null),\n    ...defaultBindRuntime.buildPrimitives(),\n];\n\n/** Build a manifest-scoped `Data.bind` implementation + its backing primitives.\n *\n *  The `data_*` primitives MUST ship with the scoped platform: e3 `ui()` tasks\n *  render through `createScoped*()` arrays (UITaskPreview), NOT the global\n *  registry, so a serialized handle's methods would otherwise decode to\n *  \"Platform function 'data_read' is not available\". */\nexport function createScopedBindPlatform(manifest: DataManifest): PlatformFunction[] {\n    const allowed = new Set(manifest.paths.map(p => datasetPathToString(p)));\n    return [\n        defaultBindRuntime.buildPlatform(allowed),\n        ...defaultBindRuntime.buildPrimitives(),\n    ];\n}\n\nexport async function preloadReactiveDatasetList(workspace: string, path: TreePath): Promise<string[]> {\n    return defaultBindRuntime.preloadList(workspace, path);\n}\nexport function clearReactiveDatasetListCache(): void {\n    defaultBindRuntime.clearListCache();\n}\n\n// =============================================================================\n// Module-load registrations — wire the default runtime into east-ui\n// hooks. Tests with their own `BindRuntime` don't use these.\n// =============================================================================\n\nregisterReactiveTracker({\n    id: \"data-bind\",\n    enableTracking: () => defaultBindRuntime.enableTracking(),\n    disableTracking: () => defaultBindRuntime.disableTracking(),\n    getStore: () => {\n        const cache = defaultBindRuntime.getCache();\n        if (!cache) return null;\n        const staged = getStagedStore();\n        return {\n            subscribe: (key, cb) => {\n                const offCache  = cache.subscribe(key, cb);\n                const offStaged = staged.subscribe(key, cb);\n                return () => { offCache(); offStaged(); };\n            },\n            // The version a read records it at, as the runtime counts it.\n            getKeyVersion: (key) => defaultBindRuntime.keyVersion(key),\n        };\n    },\n});\n\nregisterPlatformImplementation(BindPlatform);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A paged source's key search, from East's form to e3's wire: what the paged\n * runtime asks e3 with, a search at a time and in batches (#1351).\n *\n * @packageDocumentation\n */\n\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { SeekQueryType } from \"@elaraai/east-ui\";\nimport type { DatasetFindQuery } from \"@elaraai/e3-api-client\";\n\n/** Which rows a search reads: the dataset's own, or one of a record's indexes. */\ninterface Selected {\n    /** The index's name, or `null` for the dataset itself. */\n    readonly index: string | null;\n}\n\n/**\n * The decoded East {@link SeekQueryType} value as e3's wire query.\n *\n * The two are deliberately the same shapes, so this is a re-tagging rather\n * than a translation: `.east` literals stay text, and the East option on the\n * `fields` arm, like an open end of a `range`, becomes an absent property\n * (`exactOptionalPropertyTypes`).\n *\n * @param query - The search, a decoded `SeekQueryType` value\n * @param selector - The rows it searches; the dataset's own when absent\n * @returns The wire query, naming the index when the rows are an index's\n * @throws {Error} When a range names neither end\n */\nexport function toFindQuery(query: unknown, selector: Selected = { index: null }): DatasetFindQuery {\n    const q = query as ValueTypeOf<typeof SeekQueryType>;\n    const scope = selector.index === null ? {} : { index: selector.index };\n    if (q.type === \"key\") return { key: q.value, ...scope };\n    if (q.type === \"prefix\") return { prefix: q.value, ...scope };\n    if (q.type === \"range\") {\n        // A half-open bound on a leading prefix of the FLATTENED key — an\n        // empty side is an open end, which the wire says by omitting it. Open\n        // at both ends it names no run, and a server refuses it with an error\n        // the retry gate would keep re-asking, so it is refused here instead.\n        const r = q.value;\n        const from = [...r.from];\n        const to = [...r.to];\n        if (from.length === 0 && to.length === 0) {\n            throw new Error(\"Data.bindPaged: a range seek names no end — give it a `from`, a `to`, or both\");\n        }\n        return from.length === 0 ? { to, ...scope } : to.length === 0 ? { from, ...scope } : { from, to, ...scope };\n    }\n    const f = q.value;\n    const fields = [...f.values];\n    return f.prefix.type === \"some\"\n        ? { fields, prefix: f.prefix.value, ...scope }\n        : { fields, ...scope };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Named field-index reads, adapted through the existing pinned paged runtime. */\nimport {\n    East, ArrayType, BooleanType, DictType, IntegerType, NullType, OptionType,\n    StringType, StructType, fromEastTypeValue, toEastTypeValue, printType, isTypeEqual, parseFor, printFor,\n    none, some, variant, type EastType, type EastTypeValue, type option, type ValueTypeOf,\n} from \"@elaraai/east\";\nimport type { PlatformFunction } from \"@elaraai/east/internal\";\nimport { SeekQueryType, SeekRangeType } from \"@elaraai/east-ui\";\nimport { INDEXED_ROWS_SUFFIX, IndexedEntryType, type RecordSliceEntryKey } from \"@elaraai/east-ui/internal\";\nimport { bindIndexedPagedPlatformFn, DataIndexedPrimitives, NestedPartType } from \"@elaraai/e3-ui/internal\";\nimport { NestedSpanKeyType, RecordSummaryTotalsType, TreePathType, entriesRowsName, indexWindowType, nestedSpanName, type TreePath } from \"@elaraai/e3-types\";\nimport { RECORD_SLICE_DATA_MARK, type RecordSliceBatches } from \"@elaraai/east-ui-components/platform\";\nimport { datasetPathToString } from \"./dataset-store.js\";\nimport type { PagedRuntime } from \"./paged-runtime.js\";\nimport { toFindQuery } from \"./find-query.js\";\n\ntype Metadata = Record<string, Record<string, unknown>>;\n/** A binding's nested part (#1435): the nested series index it lists, its name the one field of its `index`, or none. */\ntype Nested = ValueTypeOf<ReturnType<typeof NestedPartType<StructType, StructType, StructType, StructType>>>;\ntype Query = ValueTypeOf<typeof SeekQueryType>;\ntype Range = ValueTypeOf<typeof SeekRangeType>;\ntype Entry = { ik: unknown; key: unknown; value: unknown; row: option<unknown> };\n/**\n * An index's maintenance for one row (#1437): e3's, the function the record's commit runs — given a row's key, the\n * row before and after, and the patch an update sent, the changes the row makes to the index, by entry, each an op of\n * the index's own patch or a summary's add.\n */\nexport type IndexMaintenance = (key: unknown, held: option<unknown>, next: option<unknown>, patch: option<unknown>) => ReadonlyMap<unknown, unknown>;\n/** Each listed nested series and summary index's maintenance for one row, by its name; none where the binding lists neither. */\nexport type IndexMaintenances = option<Readonly<Record<string, IndexMaintenance>>>;\n/**\n * The listed nested series index's fill of a page (#1438): its lean rows, by key, filled with the entries read of it —\n * a beast2 Array of the index's `{ ik, value }` entries. None where the binding lists none.\n */\nexport type NestedFill = option<(rows: ReadonlyMap<unknown, unknown>, items: Uint8Array) => ReadonlyMap<unknown, unknown>>;\ninterface Handle {\n    id: string;\n    page(offset: bigint, limit: bigint): option<unknown>;\n    total(): option<bigint>;\n    seek: option<(query: Query) => option<Range>>;\n    revision(): option<string>;\n    refresh(hash: option<string>): null;\n}\ninterface Schema {\n    /** The binding's types: the key, the row, the projection, the indexes' metadata, the index keys, the nested part and what the nested index's entries carry. */\n    args: [EastType, EastType, EastType, EastType, EastType, EastType, EastType];\n    row: StructType;\n    keys: Record<string, EastType>;\n    collection: EastType;\n    window: EastType;\n}\n\n/** What a binding this runtime built reads: its record, its indexes, its nested series index and its join. */\ninterface Binding {\n    readonly schema: Schema;\n    readonly path: TreePath;\n    readonly metadata: Metadata;\n    readonly nested: Nested;\n    readonly joined: boolean;\n}\n\n/** Whether an index is the nested series index a binding lists (#1435): its entries items, totals and subtotals, read a cell at a time. */\nfunction isNested(nested: Nested, name: string): boolean {\n    return nested.type === \"some\" && Object.hasOwn(nested.value.index, name);\n}\n\n/**\n * Whether an index is the listed nested series index's span (#1438): the index\n * e3 keeps beside it, each collection's months across the record's rows,\n * summed as a summary's totals are — read by its searches and runs, never\n * listed, as the nested series index is.\n */\nfunction isSpan(nested: Nested, name: string): boolean {\n    return nested.type === \"some\" && Object.keys(nested.value.index).some((index) => nestedSpanName(index) === name);\n}\n\n/** The refusal of a page or a count of a nested series index (#1435): its entries are no window of rows. */\nfunction nestedWindow(name: string): Error {\n    return new Error(`Data.bindPaged: '${name}' is a nested series index, whose entries are items, totals and subtotals: a reader reads its cells`);\n}\n\n/** The refusal of a page of an entries index (#1522), or of its lean rows: a reader reads them by their keys' runs. */\nfunction entriesWindow(name: string): Error {\n    return new Error(`Data.bindPaged: '${name}' files a Dict field of the rows entry by entry, beside its lean rows: a reader reads the ` +\n        \"picked keys' runs of it, and the rows by key (recordSliceRunEntries)\");\n}\n\n/** An entries index a binding lists (#1522), as a reader reads it: the Dict field it files, the Dict's key and value types, and its lean rows' index. */\nexport interface IndexedEntries {\n    /** The Dict field of the rows it files, entry by entry: what the rail names. */\n    readonly field: string;\n    /** The Dict's key type: each entry's key, the index's own. */\n    readonly key: EastType;\n    /** The Dict's value type: what each entry carries. */\n    readonly value: EastType;\n    /** Its lean rows' index, the record's rows by key with the field emptied (e3-types' `entriesRowsName`). */\n    readonly rows: string;\n}\n\n/**\n * The batched reads of each handle an indexed runtime built, by the handle\n * itself (#1351): a record Slice bound over the handle finds the runtime that\n * built it, whichever runtime that is — the page's, or a spec's own.\n */\nconst batchesOfHandles = new WeakMap<object, RecordSliceBatches>();\n\n/**\n * The reads a paged runtime batches for a binding an indexed runtime built\n * (#1351): several searches of one of its sources in one request, and the\n * entries of several runs of one in one — what a record Slice bound over it\n * reads a plan's searches and its windows through.\n *\n * @param binding - The binding: the handle `Data.bindPaged` over a record's indexes returned\n * @returns Its batched reads, or `undefined` for a handle no indexed runtime built here — one decoded from\n *   elsewhere, whose Slice then reads its searches and runs one at a time\n */\nexport function recordSliceBatchesOf(binding: object): RecordSliceBatches | undefined {\n    return batchesOfHandles.get(binding);\n}\n\n/**\n * A binding an indexed runtime built, as a reader of its nested series index\n * finds it by its id (#1438): a Plan's root names the binding its rows are\n * read through by id alone, its type the Plan's own.\n */\nexport interface IndexedBindingRead {\n    /** The record's dataset path. */\n    readonly path: TreePath;\n    /** The handle: its revision, and each listed nested series and summary index's maintenance for one row. */\n    readonly handle: { revision(): option<string>; readonly maintenance: IndexMaintenances };\n    /** Its batched reads. */\n    readonly batches: RecordSliceBatches;\n    /** The record's key type. */\n    readonly key: EastType;\n    /** The record's row type. */\n    readonly row: EastType;\n    /** The listed nested series index: its name, and its entries' type, `{ ik, value }`; none where the binding lists none. */\n    readonly nested: { readonly index: string; readonly entry: StructType<{ ik: EastType; value: EastType }> } | undefined;\n    /** Each listed entries index, by its name (#1522); empty where the binding lists none. */\n    readonly entries: ReadonlyMap<string, IndexedEntries>;\n    /**\n     * Whether a read of the record's own rows by key reads them as the binding's windows hold them (#1596): it joins\n     * them. Beside a nested series index a binding's windows hold lean rows, which a row read whole by key is not.\n     */\n    readonly readsRows: boolean;\n    /** The record's identity, as a record Slice bound over the binding names it (`sourceId`): what tells two records' bindings apart (#1522). */\n    readonly recordId: string;\n    /** Asks every read of the record that failed again, at once — a Retry's, as a source of the rail asks (#1522). */\n    askAgain(): void;\n}\n\n/** The bindings the runtimes here built, by their ids: the latest built under an id, which every one built under it reads alike. */\nconst bindingsById = new Map<string, IndexedBindingRead>();\n\n/**\n * A binding an indexed runtime built, by its id (#1438).\n *\n * @param id - The binding's id, as its handle carries it\n * @returns The binding read; `undefined` for an id no runtime here built\n */\nexport function indexedBindingOf(id: string): IndexedBindingRead | undefined {\n    return bindingsById.get(id);\n}\n\n/**\n * The binding a windowed source of its rows reads (#1596): the source's id is\n * the binding's own, or the binding's with what the source shows of it after —\n * its unfiltered view ({@link INDEXED_ROWS_SUFFIX}), or a record Slice's\n * narrowing of it ({@link RECORD_SLICE_DATA_MARK} and the Slice's key), the\n * marks the sources' builders add. A Slice's key is its author's, and may end\n * as the unfiltered view's id does: an id that is no binding's unfiltered view\n * is still read as a Slice's.\n *\n * @param id - The source's id, as its handle carries it\n * @returns The binding read; `undefined` for a source of no binding built here\n */\nexport function indexedBindingOfSource(id: string): IndexedBindingRead | undefined {\n    const own = bindingsById.get(id);\n    if (own !== undefined) return own;\n    if (id.endsWith(INDEXED_ROWS_SUFFIX)) {\n        const unfiltered = bindingsById.get(id.slice(0, id.length - INDEXED_ROWS_SUFFIX.length));\n        if (unfiltered !== undefined) return unfiltered;\n    }\n    // A binding's id holds no Slice's mark; the Slice's key after it may.\n    const narrowed = id.indexOf(RECORD_SLICE_DATA_MARK);\n    return narrowed < 0 ? undefined : bindingsById.get(id.slice(0, narrowed));\n}\n\n/**\n * Serializable indexed handles backed by PagedRuntime's existing snapshots,\n * caches, error/retry handling and tracked reads. No second fetch cache lives here.\n */\nexport class IndexedPagedRuntime {\n    private readonly handles = new Map<string, Record<string, unknown>>();\n    // Preserve window identity without retaining pages the paged cache evicts.\n    private windows = new WeakMap<object, Map<string, unknown[]>>();\n    // Each schema's sources, built once: a window over an interval index is\n    // some fifty-five searches, and each read built its source's window type\n    // again and looked its handle up by that type's structure.\n    private sources = new WeakMap<Schema, Map<string, Handle>>();\n\n    // Each index's printer of an entry key, `(ik=…, k=…)`, from its key's text and the row's key (#1349).\n    private entryPrinters = new WeakMap<Schema, Map<string, (ik: string, key: unknown) => string>>();\n    // Each membership read's entry keys, printed, by the entries asked and the index (#1349): made once.\n    private printedEntries = new WeakMap<readonly RecordSliceEntryKey[], Map<string, readonly string[]>>();\n    // Each schema's entries indexes, by their names (#1522): read once from its metadata.\n    private entriesBySchema = new WeakMap<Schema, ReadonlyMap<string, IndexedEntries>>();\n\n    constructor(private readonly paged: Pick<PagedRuntime, \"buildHandle\" | \"sourceOf\" | \"seekAll\" | \"runsAll\" | \"placeAll\" | \"withinAll\" | \"rowsAll\" | \"joinAll\" | \"askAgain\">) {}\n\n    clear(): void {\n        this.handles.clear(); this.windows = new WeakMap(); this.sources = new WeakMap(); this.entryPrinters = new WeakMap(); this.printedEntries = new WeakMap();\n        this.entriesBySchema = new WeakMap();\n    }\n\n    /**\n     * An index's entry key, `(ik=…, k=…)`, as a membership read names it (#1349):\n     * the index key's `.east` text, as the binding's maintained keys print it,\n     * read back as the index key's type, beside the row's key.\n     *\n     * @param schema - The binding's types\n     * @param name - The index\n     * @returns The printer\n     */\n    private entryPrinter(schema: Schema, name: string): (ik: string, key: unknown) => string {\n        let printers = this.entryPrinters.get(schema);\n        if (printers === undefined) { printers = new Map(); this.entryPrinters.set(schema, printers); }\n        let print = printers.get(name);\n        if (print === undefined) {\n            const ikType = schema.keys[name];\n            if (ikType === undefined) throw new Error(`Index '${name}' was not declared on this binding`);\n            const parse = parseFor(ikType);\n            const printEntry = printFor(StructType({ ik: ikType, k: schema.args[0] }));\n            print = (ik, key) => {\n                const parsed = parse(ik);\n                if (!parsed.success) throw new Error(`The index '${name}' has no key ${ik}: ${parsed.error}`);\n                return printEntry({ ik: parsed.value, k: key });\n            };\n            printers.set(name, print);\n        }\n        return print;\n    }\n\n    /**\n     * Some entries' keys, `(ik=…, k=…)`, as a membership read names them (#1349): made once for the entries asked —\n     * the same array whenever a reader asks of them again, every evaluation that reads them while their answer is in\n     * flight among them — so no entry is read and printed again.\n     *\n     * @param schema - The binding's types\n     * @param name - The index\n     * @param entries - The entries asked of\n     * @returns Each entry's key, in order\n     */\n    private entryTexts(schema: Schema, name: string, entries: readonly RecordSliceEntryKey[]): readonly string[] {\n        let byIndex = this.printedEntries.get(entries);\n        if (byIndex === undefined) { byIndex = new Map(); this.printedEntries.set(entries, byIndex); }\n        let texts = byIndex.get(name);\n        if (texts === undefined) {\n            const print = this.entryPrinter(schema, name);\n            texts = entries.map(entry => print(entry.ik, entry.key));\n            byIndex.set(name, texts);\n        }\n        return texts;\n    }\n\n    private schema(types: EastTypeValue[]): Schema {\n        const args = types.map(fromEastTypeValue) as Schema[\"args\"];\n        const [key, row, projection, , keys] = args;\n        if (row.type !== \"Struct\" || keys.type !== \"Variant\") throw new Error(\"Invalid indexed record schema\");\n        return { args, row, keys: keys.cases, collection: DictType(key, row), window: ArrayType(IndexedEntryType(key, row, projection, keys)) };\n    }\n\n    private defaultIndex(schema: Schema, metadata: Metadata, joined: boolean): string {\n        if (joined) return \"primary\";\n        const index = Object.keys(metadata).find(name => {\n            // One entry a row: a plain or an area index, which files each row once — never an interval index, which\n            // files an event up to three times, nor a series or a summary index, nor a nested series index, which is\n            // no index of the metadata — led by no Set field.\n            const kind = this.kind(schema, name);\n            const fields = this.fields(schema, name);\n            return (kind === \"plain\" || kind === \"area\") && fields !== undefined && Object.entries(fields).every(([field, marker]) =>\n                marker.type === \"Array\" || (marker.type === \"Null\" && schema.row.fields[field]?.type !== \"Set\"));\n        });\n        if (index === undefined) throw new Error(\"A covering-only binding needs an index with one entry per record row\");\n        return index;\n    }\n\n    /** An index's metadata in the binding's type (#1432): its row fields' markers and its kind, `{ fields, kind }`. */\n    private metadataOf(schema: Schema, name: string): Record<string, EastType> | undefined {\n        const types = schema.args[3];\n        const index = types.type === \"Struct\" ? types.fields[name] : undefined;\n        return index?.type === \"Struct\" ? index.fields as Record<string, EastType> : undefined;\n    }\n\n    /** The row fields an index is led by, each its marker. */\n    private fields(schema: Schema, name: string): Record<string, EastType> | undefined {\n        const fields = this.metadataOf(schema, name)?.fields;\n        return fields?.type === \"Struct\" ? fields.fields as Record<string, EastType> : undefined;\n    }\n\n    /** An index's kind, its metadata's one case (#1432): `plain`, `interval`, `area`, `series`, `summary` or `entries` (#1522). */\n    private kind(schema: Schema, name: string): string | undefined {\n        const kind = this.metadataOf(schema, name)?.kind;\n        return kind?.type === \"Variant\" ? Object.keys(kind.cases)[0] : undefined;\n    }\n\n    /**\n     * Each entries index a binding lists (#1522), by its name: the Dict field\n     * it files — its metadata's one field — the Dict's key and value types,\n     * from the row's own field, and its lean rows' index.\n     */\n    private entriesIndexes(schema: Schema): ReadonlyMap<string, IndexedEntries> {\n        const known = this.entriesBySchema.get(schema);\n        if (known !== undefined) return known;\n        const listed = new Map<string, IndexedEntries>();\n        this.entriesBySchema.set(schema, listed);\n        const types = schema.args[3];\n        for (const name of types.type === \"Struct\" ? Object.keys(types.fields) : []) {\n            if (this.kind(schema, name) !== \"entries\") continue;\n            const field = Object.keys(this.fields(schema, name) ?? {})[0];\n            const held = field === undefined ? undefined : schema.row.fields[field];\n            if (field === undefined || held?.type !== \"Dict\") throw new Error(`Data.bindPaged: the entries index '${name}' names no Dict field of the rows`);\n            listed.set(name, { field, key: held.key, value: held.value, rows: entriesRowsName(name) });\n        }\n        return listed;\n    }\n\n    /** The entries index whose lean rows an index is (#1522); `undefined` for any other. */\n    private entriesRowsOf(schema: Schema, name: string): IndexedEntries | undefined {\n        return [...this.entriesIndexes(schema).values()].find(entries => entries.rows === name);\n    }\n\n    /** Whether an index is a summary index (#1039): its entries totals, naming no row. */\n    private isSummary(schema: Schema, name: string): boolean {\n        return this.kind(schema, name) === \"summary\";\n    }\n\n    /**\n     * Whether an index carries its rows (D29): an area index, or a series\n     * index (#1039), whose entries hold the whole row as their projection, so\n     * it is read without a join; and beside a nested series index, every index\n     * but a summary, whose entries hold the lean row (#1435) — the binding\n     * lists none with a value of its own there; and beside an entries index,\n     * every index but a summary and an entries index, whose entries hold the\n     * row with the fields filed entry by entry emptied (#1522).\n     */\n    private carriesRow(schema: Schema, nested: Nested, name: string): boolean {\n        const kind = this.kind(schema, name);\n        return kind === \"area\" || kind === \"series\" || (nested.type === \"some\" && kind !== undefined && kind !== \"summary\")\n            || (kind !== undefined && kind !== \"summary\" && kind !== \"entries\" && this.entriesIndexes(schema).size > 0);\n    }\n\n    private source(schema: Schema, path: TreePath, metadata: Metadata, nested: Nested, joined: boolean, name: string): Handle {\n        const inNested = isNested(nested, name);\n        const span = isSpan(nested, name);\n        // An entries index carries its own entries, and its lean rows carry the rows: neither is joined (#1522).\n        const entries = name === \"primary\" ? undefined : this.entriesIndexes(schema).get(name);\n        const leanRows = name === \"primary\" || entries !== undefined ? undefined : this.entriesRowsOf(schema, name);\n        if (name !== \"primary\" && !inNested && !span && leanRows === undefined && !Object.hasOwn(metadata, name)) throw new Error(`Index '${name}' was not declared on this binding`);\n        let built = this.sources.get(schema);\n        if (built === undefined) { built = new Map(); this.sources.set(schema, built); }\n        // An index that carries its rows is read without a join, whatever the binding's (D29); a summary index's\n        // entries name no row to join (#1039), nor do a nested series index's span's (#1438), and a nested series index's\n        // are its rows' items (#1435).\n        const rows = name !== \"primary\" && !span && this.carriesRow(schema, nested, name);\n        const summary = name !== \"primary\" && (span || this.isSummary(schema, name));\n        const join = name !== \"primary\" && joined && !rows && !summary && !inNested && entries === undefined && leanRows === undefined;\n        const sourceKey = `${datasetPathToString(path)}\\u0000${name}\\u0000${join ? \"+join\" : \"\"}`;\n        const cached = built.get(sourceKey);\n        if (cached !== undefined) return cached;\n        const [key, row, projection, , , , nestedValue] = schema.args;\n        const type = name === \"primary\" ? schema.collection\n            : span ? indexWindowType(NullType, NestedSpanKeyType, RecordSummaryTotalsType, row)\n                : summary ? indexWindowType(NullType, schema.keys[name]!, RecordSummaryTotalsType, row)\n                    : inNested ? indexWindowType(key, schema.keys[name]!, nestedValue, row)\n                        : entries !== undefined ? indexWindowType(key, entries.key, entries.value, row)\n                            : leanRows !== undefined ? indexWindowType(key, key, row, row)\n                                : indexWindowType(key, schema.keys[name]!, rows ? row : projection, row);\n        const handle = this.paged.buildHandle(toEastTypeValue(type), path,\n            { index: name === \"primary\" ? null : name, join }, \"pinned\") as unknown as Handle;\n        built.set(sourceKey, handle);\n        return handle;\n    }\n\n    /** A window of a source as a binding's entries, each tagged with the\n     *  source that orders it: mapped once per window, so a window read again\n     *  keeps its identity. An index that carries its rows gives each entry's\n     *  projection as its row, and the binding's projection as its value: the\n     *  row itself, or Null beside indexes that carry nothing (D29). A summary\n     *  index's entry gives its totals as its value, and names no row (#1039);\n     *  a nested series index's its item, totals or subtotal (#1435); an\n     *  entries index's the Dict's value, and its lean rows' the lean row as\n     *  both (#1522). */\n    private entriesOf(schema: Schema, nested: Nested, name: string, window: unknown): unknown[] {\n        let mapped = this.windows.get(window as object);\n        if (mapped === undefined) { mapped = new Map(); this.windows.set(window as object, mapped); }\n        let rows = mapped.get(name);\n        if (rows === undefined) {\n            if (name === \"primary\") {\n                rows = [...window as Map<unknown, unknown>].map(([key, row]) => ({ ik: variant(\"primary\", key), key, value: none, row: some(row) }));\n            } else if (this.entriesRowsOf(schema, name) !== undefined) {\n                rows = (window as Entry[]).map(entry => ({ ik: variant(name, entry.ik), key: entry.key, value: some(entry.value), row: some(entry.value) }));\n            } else if (this.isSummary(schema, name) || isNested(nested, name) || isSpan(nested, name) || this.kind(schema, name) === \"entries\") {\n                rows = (window as Entry[]).map(entry => ({ ik: variant(name, entry.ik), key: entry.key, value: some(entry.value), row: none }));\n            } else if (this.carriesRow(schema, nested, name)) {\n                const whole = isTypeEqual(schema.args[2], schema.row);\n                rows = (window as Entry[]).map(entry => ({ ik: variant(name, entry.ik), key: entry.key, value: some(whole ? entry.value : null), row: some(entry.value) }));\n            } else {\n                rows = (window as Entry[]).map(entry => ({ ik: variant(name, entry.ik), key: entry.key, value: some(entry.value), row: entry.row }));\n            }\n            mapped.set(name, rows);\n        }\n        return rows;\n    }\n\n    /**\n     * The reads the paged runtime batches for a binding this runtime built\n     * (#1351): several searches of one of its sources in one request, the\n     * entries of several runs of one in one, the rows of several of the\n     * record's own keys in one (#1039), and another Dict's rows under the keys\n     * some runs of one of its indexes name in one (#1393), each through the\n     * source's own handle, so its channels are the ones the binding's single\n     * reads use.\n     *\n     * @param binding - What the binding reads\n     * @returns Its batched reads\n     */\n    private batches({ schema, path, metadata, nested, joined }: Binding): RecordSliceBatches {\n        const sourceOf = (name: string) => {\n            const handle = this.source(schema, path, metadata, nested, joined, name);\n            const source = this.paged.sourceOf(handle.id);\n            if (source === undefined) throw new Error(`Data.bindPaged: the source '${name}' of ${handle.id} is no source this runtime serves`);\n            return source;\n        };\n        return {\n            seekAll: (name, queries) => {\n                const source = sourceOf(name);\n                const found = this.paged.seekAll(source, queries.map(query => toFindQuery(query, source.selector)));\n                return found.type === \"none\" ? none\n                    : some(found.value.map(range => ({ found: range.found, row: BigInt(range.row), count: BigInt(range.count) })));\n            },\n            runsAll: (name, runs) => {\n                if (name === \"primary\" && !joined) throw new Error(\"A covering-only binding cannot read primary rows\");\n                const read = this.paged.runsAll(sourceOf(name), runs.map(run => [Number(run.row), Number(run.count)] as const));\n                return read.type === \"none\" ? none : some(this.entriesOf(schema, nested, name, read.value) as never);\n            },\n            // Where a narrowing's runs of an index sit in the record, and which entries they hold (#1349).\n            placeAll: (name, runs) => {\n                if (name === \"primary\") throw new Error(\"A placement places runs of one of the record's indexes, never of its own rows\");\n                if (this.isSummary(schema, name)) throw new Error(`A placement places a narrowing's rows, and '${name}' is a summary index, whose entries name none`);\n                if (isNested(nested, name)) throw nestedWindow(name);\n                const placement = this.paged.placeAll(sourceOf(name), runs.map(run => [Number(run.row), Number(run.count)] as const));\n                if (placement.type === \"none\") return none;\n                const { segments, placed, entries, total, complete } = placement.value;\n                return some({\n                    segments: segments.map(segment => ({ offset: BigInt(segment.offset), count: BigInt(segment.count), rows: BigInt(segment.rows) })),\n                    placed: BigInt(placed), total: BigInt(entries), records: BigInt(total), complete,\n                });\n            },\n            withinAll: (name, runs, entries) => {\n                if (name === \"primary\") throw new Error(\"A membership read asks of runs of one of the record's indexes, never of its own rows\");\n                if (this.isSummary(schema, name)) throw new Error(`A membership read asks of a narrowing's rows, and '${name}' is a summary index, whose entries name none`);\n                if (isNested(nested, name)) throw nestedWindow(name);\n                const within = this.paged.withinAll(sourceOf(name), runs.map(run => [Number(run.row), Number(run.count)] as const),\n                    this.entryTexts(schema, name, entries));\n                return within.type === \"none\" ? none : some([...within.value]);\n            },\n            // The rows of several of the record's own keys in one request (#1039): its own Dict's rows by key — beside a\n            // nested series index too, which pages lean rows: a row whole is read by its key (#1435).\n            rowsAll: (keys) => {\n                if (!joined && nested.type === \"none\") throw new Error(\"A covering-only binding cannot read primary rows\");\n                const read = this.paged.rowsAll(sourceOf(\"primary\"), keys);\n                return read.type === \"none\" ? none : some(read.value.map(entry => entry.row));\n            },\n            // Another Dict's rows under the keys the entries of some runs of one of the record's indexes name, the server\n            // reading the keys from the index (#1393): a Schematic's details, for its area index's cells.\n            joinAll: (name, runs, dict) => {\n                if (name === \"primary\") throw new Error(\"A read of rows by runs reads the keys one of the record's indexes names, never runs of its own rows\");\n                if (this.isSummary(schema, name)) throw new Error(`A read of rows by runs reads the keys its entries name, and '${name}' is a summary index, whose entries name none`);\n                const rows = this.paged.sourceOf(dict);\n                if (rows === undefined) throw new Error(`Data.bindPaged: the Dict read '${dict}' is bound on no page this runtime serves`);\n                const read = this.paged.joinAll(rows, sourceOf(name), runs.map(run => [Number(run.row), Number(run.count)] as const));\n                return read.type === \"none\" ? none : some([...read.value]);\n            },\n        };\n    }\n\n    private primitives(): PlatformFunction[] {\n        const { page, seek, total, revision, refresh } = DataIndexedPrimitives;\n        return [\n            page.implement((...types: EastTypeValue[]) => {\n                const schema = this.schema(types);\n                return (...values: unknown[]) => {\n                    const [path, metadata, nested, joined, name, offset, limit] = values as [TreePath, Metadata, Nested, boolean, string, bigint, bigint];\n                    if (name === \"primary\" && !joined) throw new Error(\"A covering-only binding cannot read primary rows\");\n                    // A page's entries are the binding's, each naming its row; a summary's are totals naming none (#1039), and a\n                    // nested series index's its rows' items (#1435).\n                    if (name !== \"primary\" && this.isSummary(schema, name)) {\n                        throw new Error(`Data.bindPaged: '${name}' is a summary index, whose entries name no row: a reader reads its cells (recordSliceCellEntries)`);\n                    }\n                    if (isNested(nested, name)) throw nestedWindow(name);\n                    if (name !== \"primary\" && (this.kind(schema, name) === \"entries\" || this.entriesRowsOf(schema, name) !== undefined)) throw entriesWindow(name);\n                    const result = this.source(schema, path, metadata, nested, joined, name).page(offset, limit);\n                    if (result.type === \"none\") return none;\n                    return some(this.entriesOf(schema, nested, name, result.value));\n                };\n            }),\n            seek.implement((...types: EastTypeValue[]) => {\n                const schema = this.schema(types);\n                return (...values: unknown[]) => {\n                    const [path, metadata, nested, joined, name, query] = values as [TreePath, Metadata, Nested, boolean, string, Query];\n                    const source = this.source(schema, path, metadata, nested, joined, name);\n                    if (source.seek.type !== \"some\") throw new Error(\"The selected record source cannot be searched\");\n                    return source.seek.value(query);\n                };\n            }),\n            total.implement((...types: EastTypeValue[]) => {\n                const schema = this.schema(types);\n                return (...values: unknown[]) => {\n                    const [path, metadata, nested, joined, name] = values as [TreePath, Metadata, Nested, boolean, string];\n                    if (isNested(nested, name)) throw nestedWindow(name);\n                    // A non-fan-out index counts exactly the primary rows. Use\n                    // it in covering-only mode without opening primary segments.\n                    const source = this.source(schema, path, metadata, nested, joined,\n                        name === \"primary\" && !joined ? this.defaultIndex(schema, metadata, joined) : name);\n                    const count = source.total();\n                    if (count.type === \"some\") return count;\n                    // The existing page response supplies the exact total.\n                    // One bounded entry initiates it; never scan to count.\n                    source.page(0n, 1n);\n                    return source.total();\n                };\n            }),\n            revision.implement((...types: EastTypeValue[]) => {\n                const schema = this.schema(types);\n                return (...values: unknown[]) => {\n                    const [path, metadata, nested, joined] = values as [TreePath, Metadata, Nested, boolean];\n                    return this.source(schema, path, metadata, nested, joined, \"primary\").revision();\n                };\n            }),\n            refresh.implement((...types: EastTypeValue[]) => {\n                const schema = this.schema(types);\n                return (...values: unknown[]) => {\n                    const [path, metadata, nested, joined, hash] = values as [TreePath, Metadata, Nested, boolean, option<string>];\n                    return this.source(schema, path, metadata, nested, joined, \"primary\").refresh(hash);\n                };\n            }),\n        ];\n    }\n\n    /** Indexed bind and its serializable primitives, optionally manifest-scoped. */\n    platform(allowed: ReadonlySet<string> | null): PlatformFunction[] {\n        const primitives = this.primitives();\n        return [bindIndexedPagedPlatformFn.implement((...types: EastTypeValue[]) => {\n            // The binding's types, as its reads take them; its maintenance part's last, which the handle carries (#1437).\n            const schema = this.schema(types.slice(0, -1));\n            return (...values: unknown[]) => {\n                const [path, metadata, nested, joined, entryKeys, recordId, maintenance, fill] =\n                    values as [TreePath, Metadata, Nested, boolean, (index: string, key: unknown, row: unknown) => string[], string, IndexMaintenances, NestedFill];\n                const pathKey = datasetPathToString(path);\n                if (allowed !== null && !allowed.has(pathKey)) throw new Error(`Data.bindPaged: source path '${pathKey}' not declared in manifest`);\n                const typeKey = printType(StructType(schema.args.map((type, i) => [`T${i}`, type] as const)));\n                const listed = [...Object.keys(metadata), ...(nested.type === \"some\" ? Object.keys(nested.value.index) : [])];\n                const id = `${pathKey}@indexes:${listed.join(\",\")}${joined ? \"+join\" : \"\"}`;\n                const cacheKey = `${typeKey}:${id}`;\n                const cached = this.handles.get(cacheKey);\n                if (cached !== undefined) return cached;\n                const args = schema.args;\n                const descriptor = [East.value(path, TreePathType), East.value(metadata as never, args[3]), East.value(nested as never, args[5]),\n                    East.value(joined, BooleanType)] as const;\n                const { page, seek, total, revision, refresh } = DataIndexedPrimitives;\n                const handle = {\n                    id, recordId, indexes: metadata, nested, joined, defaultIndex: this.defaultIndex(schema, metadata, joined), entryKeys, maintenance, fill,\n                    page: East.compile(East.function([StringType, IntegerType, IntegerType], OptionType(schema.window), ($, name, offset, limit) =>\n                        $.return(page(args, ...descriptor, name, offset, limit))), primitives),\n                    seek: East.compile(East.function([StringType, SeekQueryType], OptionType(SeekRangeType), ($, name, query) =>\n                        $.return(seek(args, ...descriptor, name, query))), primitives),\n                    total: East.compile(East.function([StringType], OptionType(IntegerType), ($, name) =>\n                        $.return(total(args, ...descriptor, name))), primitives),\n                    revision: East.compile(East.function([], OptionType(StringType), $ =>\n                        $.return(revision(args, ...descriptor))), primitives),\n                    refresh: East.compile(East.function([OptionType(StringType)], NullType, ($, hash) =>\n                        $.return(refresh(args, ...descriptor, hash))), primitives),\n                };\n                this.handles.set(cacheKey, handle);\n                // A record Slice bound over the handle reads its searches and runs in batches (#1351).\n                const batches = this.batches({ schema, path, metadata, nested, joined });\n                batchesOfHandles.set(handle, batches);\n                // And a reader of its nested series index finds it by its id (#1438).\n                const nestedName = nested.type === \"some\" ? Object.keys(nested.value.index)[0] : undefined;\n                const ik = nestedName === undefined ? undefined : schema.keys[nestedName];\n                bindingsById.set(id, {\n                    path, handle, batches, key: args[0], row: args[1],\n                    nested: nestedName === undefined || ik === undefined ? undefined : { index: nestedName, entry: StructType({ ik, value: args[6] }) },\n                    entries: this.entriesIndexes(schema),\n                    readsRows: joined,\n                    recordId,\n                    // A Retry asks again of the record's path, every source of it alike: its own rows' source names it.\n                    askAgain: () => {\n                        const source = this.paged.sourceOf(this.source(schema, path, metadata, nested, joined, \"primary\").id);\n                        if (source !== undefined) this.paged.askAgain(source);\n                    },\n                });\n                return handle;\n            };\n        }), ...primitives];\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * TrackedChannelStore — shared base for the `Func.bind` / `Record.bind`\n * runtimes. Both expose one tracked channel per `(workspace, name)`: a\n * latest-wins async operation whose settling state is gated by a monotonic\n * `launchSeq`, plus a per-key reactive subscription shim that the renderer's\n * `Reactive.Root` machinery reads through (the same contract the dataset\n * cache uses).\n *\n * Subclasses supply their own API seam, per-channel entry shape, and the\n * operation body; the base owns the entries map, the tracking context, the\n * subscription shim, and the launch / settle / cancel latch.\n *\n * @packageDocumentation\n */\n\n/** The minimal per-channel state the base manages. */\nexport interface ChannelEntry {\n    /** Lifecycle tag — at least `\"idle\"` | `\"running\"` | `\"cancelled\"`, plus\n     *  whatever terminal states the subclass adds. */\n    status: string;\n    /** Monotonic launch counter; a settling op whose seq is no longer current\n     *  is discarded (latest-wins, and `cancel` orphans by bumping it). */\n    launchSeq: number;\n}\n\n/**\n * Base for a runtime that manages latest-wins channels keyed by string, with\n * per-key reactive subscriptions.\n *\n * @typeParam E - The per-channel entry type (extends {@link ChannelEntry}).\n */\nexport abstract class TrackedChannelStore<E extends ChannelEntry> {\n    protected readonly entries = new Map<string, E>();\n\n    // Per-key reactive subscription shim.\n    private readonly keySubscribers = new Map<string, Set<() => void>>();\n    private readonly keyVersions = new Map<string, number>();\n\n    // Reactive tracking — read closures record their channel keys here while a\n    // Reactive.Root render is being tracked, each with its version as first read.\n    private trackingContext: Map<string, number> | null = null;\n\n    /** Build a fresh channel entry in its initial (idle) state. */\n    protected abstract createEntry(): E;\n\n    // ----- reactive tracking ----------------------------------------------\n\n    /**\n     * Start recording the channels an evaluation reads.\n     *\n     * @returns What it records: each channel read, with its version as first read\n     */\n    enableTracking(): ReadonlyMap<string, number> {\n        this.trackingContext = new Map();\n        return this.trackingContext;\n    }\n\n    /**\n     * Stop recording.\n     *\n     * @returns Each channel the evaluation read, with its version as it first read it — a channel a launch it made\n     *   notified since stands at another\n     */\n    disableTracking(): ReadonlyMap<string, number> {\n        const keys = this.trackingContext ?? new Map<string, number>();\n        this.trackingContext = null;\n        return keys;\n    }\n\n    isTracking(): boolean {\n        return this.trackingContext !== null;\n    }\n\n    /** Whether the CURRENT evaluation has already read this channel. A cache\n     *  that evicts by least-recently-read must never drop one of these: a read\n     *  pass longer than the cache would otherwise evict its own head, and the\n     *  next pass would find it gone (#581). */\n    protected isTracked(key: string): boolean {\n        return this.trackingContext?.has(key) ?? false;\n    }\n\n    /** Record a channel-key dependency for the current render, at its version\n     *  as it is read now unless the render read it before (no-op when not\n     *  tracking). */\n    protected track(key: string): void {\n        if (this.trackingContext !== null && !this.trackingContext.has(key)) this.trackingContext.set(key, this.getKeyVersion(key));\n    }\n\n    // ----- subscription shim ------------------------------------------------\n\n    subscribe(key: string, callback: () => void): () => void {\n        let subs = this.keySubscribers.get(key);\n        if (!subs) {\n            subs = new Set();\n            this.keySubscribers.set(key, subs);\n        }\n        subs.add(callback);\n        return () => {\n            subs.delete(callback);\n            if (subs.size === 0 && this.keySubscribers.get(key) === subs) {\n                this.keySubscribers.delete(key);\n                this.unsubscribed(key);\n            }\n        };\n    }\n\n    getKeyVersion(key: string): number {\n        return this.keyVersions.get(key) ?? 0;\n    }\n\n    /** How many channels' versions the store keeps: what a spec holds its bounds to, beside its channels. */\n    protected versionsKept(): number {\n        return this.keyVersions.size;\n    }\n\n    /**\n     * Let a channel's version go, once nothing subscribes to it: a channel a\n     * subclass let go is versioned no longer, so the versions kept are those\n     * of the channels it holds and those a reader subscribes to. A reader\n     * still subscribed keeps the version it read until it lets the channel go.\n     *\n     * @param key - The channel\n     */\n    protected forgetVersion(key: string): void {\n        if (!this.keySubscribers.has(key)) this.keyVersions.delete(key);\n    }\n\n    /** Whether anything is subscribed to a channel. */\n    protected isSubscribed(key: string): boolean {\n        return this.keySubscribers.has(key);\n    }\n\n    /**\n     * Called as a channel's last subscriber leaves, synchronously — a\n     * subclass that holds something for the channel's readers can let it go.\n     * A reader re-subscribing drops its subscriptions first (a tracked read's\n     * run, React's), so what is let go should be let go only if the channel\n     * is still unsubscribed once that is done.\n     *\n     * @param _key - The channel\n     */\n    protected unsubscribed(_key: string): void {}\n\n    protected notify(key: string): void {\n        this.keyVersions.set(key, (this.keyVersions.get(key) ?? 0) + 1);\n        const subs = this.keySubscribers.get(key);\n        if (subs) for (const cb of [...subs]) cb();\n    }\n\n    /**\n     * Notify several channels as one (#1360): every channel's version moves\n     * first, then each subscriber is called once, however many of the\n     * channels it reads — a reader of a window's fifty-five searches runs\n     * again once as they land together, not once a search.\n     *\n     * @param keys - The channels\n     */\n    protected notifyAll(keys: Iterable<string>): void {\n        const subscribers = new Set<() => void>();\n        for (const key of keys) {\n            this.keyVersions.set(key, (this.keyVersions.get(key) ?? 0) + 1);\n            const subs = this.keySubscribers.get(key);\n            if (subs) for (const cb of subs) subscribers.add(cb);\n        }\n        for (const cb of subscribers) cb();\n    }\n\n    // ----- channel registry + latest-wins latch ----------------------------\n\n    protected entry(key: string): E {\n        let entry = this.entries.get(key);\n        if (!entry) {\n            entry = this.createEntry();\n            this.entries.set(key, entry);\n        }\n        return entry;\n    }\n\n    /**\n     * Open a latest-wins launch on a channel: bump the seq, mark the entry\n     * `running`, optionally `reset` it (e.g. clear a prior error), notify, and\n     * return a `settle` that applies a terminal mutation only if this launch is\n     * still the current one (a superseded / cancelled launch settles to a\n     * no-op).\n     */\n    protected beginLaunch(\n        key: string,\n        reset?: (entry: E) => void,\n    ): { entry: E; settle: (mutate: (entry: E) => void) => void } {\n        const entry = this.entry(key);\n        entry.launchSeq += 1;\n        const mySeq = entry.launchSeq;\n        entry.status = \"running\";\n        reset?.(entry);\n        this.notify(key);\n\n        const settle = (mutate: (entry: E) => void): void => {\n            const current = this.entries.get(key);\n            if (!current || current.launchSeq !== mySeq) return; // superseded\n            mutate(current);\n            this.notify(key);\n        };\n        return { entry, settle };\n    }\n\n    /**\n     * Client-side cancel: if the channel is running, orphan the in-flight wait\n     * (bump the seq) and mark it `cancelled`. `after` runs before the notify,\n     * for subclass-specific cleanup (e.g. dropping an in-flight handle).\n     */\n    protected cancelChannel(key: string, after?: (entry: E) => void): void {\n        const entry = this.entries.get(key);\n        if (entry && entry.status === \"running\") {\n            entry.launchSeq += 1;\n            entry.status = \"cancelled\";\n            after?.(entry);\n            this.notify(key);\n        }\n    }\n\n    /** Drop all channel state (entries + subscriptions + versions). */\n    protected clearChannels(): void {\n        this.entries.clear();\n        this.keySubscribers.clear();\n        this.keyVersions.clear();\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Runtime implementation for the `Record.bind` platform function — reading an\n * `e3.record`'s current state and applying its typed mutations from East UI.\n *\n * Hybrid of the two existing patterns: the READ side (`read`/`status`) is\n * served from the shared dataset cache (a record IS a dataset at\n * `.records.<name>`, preloaded + polled by the manifest like any dataset), so\n * there is no parallel fetcher; the WRITE side (`mutate.<name>`) is a\n * Func-style launch/latest-wins channel. On a committed mutation the runtime\n * fires one `cache.refresh(ws)` so the record's bytes are re-fetched and\n * `read()` re-renders, and drops the history cache so the next `history()`\n * refetches. `commit.<name>` is the same write awaited, on the same channel:\n * it resolves to the server's outcome, and a conflict fetches the record and\n * its history again before it settles. The refresh is the workspace poll's,\n * which fetches the content of the paths the manifest preloads and no other:\n * a record also bound with `Data.bindPaged` (#1199) is not among them, so it\n * is never fetched whole — its windows hear its new revision through the\n * poll's hash watch instead.\n *\n * A record read whole does not say which of its states the cache holds: its\n * bytes name no commit, and a record another write put back exactly as it was\n * reads as it did before a Save. The runtime knows when it read: it marks the\n * workspace's polls as each of a record's writes is answered, and says what\n * the cache holds of the record once a poll started since that answer has\n * found it the record's ({@link RecordRuntime.settledOf}) — which an editing\n * session reads a Save back at (east-ui-components' `settled-source.ts`). Of\n * a record read a page at a time, whose hash the cache follows, it says\n * whether a poll started since that answer has read the hash\n * ({@link RecordRuntime.followedOf}): from then the revision its pages are\n * pinned to is the record's as of a read made after the write.\n *\n * All handles bound to the same record in the same workspace share one mutation\n * channel (mutations serialize server-side under compare-and-swap). Mutation\n * signatures are validated against the deployed record's describe output.\n *\n * @packageDocumentation\n */\n\nimport {\n    ConflictError,\n    East,\n    StructType,\n    StringType,\n    NullType,\n    fromEastTypeValue,\n    variant,\n    some,\n    none,\n    encodeBeast2For,\n    decodeBeast2For,\n    isTypeValueStructurallyEqual,\n    toEastTypeValue,\n    type EastType,\n    type EastTypeValue,\n    type ValueTypeOf,\n} from \"@elaraai/east\";\nimport { type PlatformFunction } from \"@elaraai/east/internal\";\nimport { recordBindPlatformFn, RecordBindPrimitives, type RecordErrorType, type RecordOutcomeType } from \"@elaraai/e3-ui/internal\";\nimport {\n    workspaceRecordDescribe,\n    workspaceRecordMutate,\n    workspaceRecordHistory,\n    type RecordSignature,\n    type MutationResult,\n    type RecordHistoryResult,\n    type RecordHistoryCommit,\n    type RecordCommitInfo,\n    type RequestOptions,\n} from \"@elaraai/e3-api-client\";\nimport {\n    registerReactiveTracker,\n    registerPlatformImplementation,\n    registerSettledSources,\n    type SettledSource,\n} from \"@elaraai/east-ui-components/platform\";\nimport { TrackedChannelStore } from \"./tracked-channel.js\";\nimport { trackDatasetPath } from \"./bind-runtime.js\";\nimport { datasetCacheKey, type ReactiveDatasetCacheInterface } from \"./dataset-store.js\";\nimport type { TreePath } from \"@elaraai/e3-types\";\n\n// =============================================================================\n// API seam — the narrow surface the runtime talks through for the WRITE side.\n// (The read side goes through the dataset cache, not this.) e3's record routes,\n// over the fetch a host gives (e3-web's, in a test); the snapshot harness swaps\n// in an in-memory implementation.\n// =============================================================================\n\n/** Request shape for {@link RecordApi.mutate} — beast2-encoded positional\n *  args (the extra reducer parameters, after the implicit state). */\nexport interface RecordMutateArgs {\n    args: Uint8Array[];\n    /** The write's idempotency key: a retry with the same key after an\n     *  unanswered call resolves to the first call's commit instead of writing\n     *  twice. */\n    idempotencyKey?: string;\n}\n\n/**\n * Adapter for the workspace record endpoints. The default wraps\n * `@elaraai/e3-api-client`'s `workspaceRecordDescribe` /\n * `workspaceRecordMutate` / `workspaceRecordHistory`. `read()` does NOT go\n * through here — it reads the record's dataset bytes from the shared cache.\n */\nexport interface RecordApi {\n    /** Describe a record's mutations (name + extra arg types), for validation. */\n    describe(workspace: string, record: string): Promise<RecordSignature>;\n    /** Apply a mutation synchronously, returning its terminal MutationResult. */\n    mutate(workspace: string, record: string, mutation: string, req: RecordMutateArgs): Promise<MutationResult>;\n    /** Read a record's commit chain (newest first). */\n    history(workspace: string, record: string, limit: number | undefined, from?: string): Promise<RecordHistoryResult>;\n}\n\n/**\n * Build the default {@link RecordApi} that talks to a real e3 server via\n * `@elaraai/e3-api-client`.\n *\n * @param apiUrl - Base URL of the e3 API server\n * @param repo - Repository name\n * @param getOptions - Reads the current request options — the token, and the\n *   `fetch` requests go through — so a rotated one is used at once\n * @returns The adapter\n */\nexport function createDefaultRecordApi(\n    apiUrl: string,\n    repo: string,\n    getOptions: () => RequestOptions,\n): RecordApi {\n    return {\n        async describe(workspace, record) {\n            return workspaceRecordDescribe(apiUrl, repo, workspace, record, getOptions());\n        },\n        async mutate(workspace, record, mutation, req) {\n            return workspaceRecordMutate(apiUrl, repo, workspace, record, mutation, {\n                args: req.args,\n                actor: none,\n                limits: none,\n            }, getOptions(), req.idempotencyKey);\n        },\n        async history(workspace, record, limit, from) {\n            return workspaceRecordHistory(apiUrl, repo, workspace, record, limit, getOptions(), from);\n        },\n    };\n}\n\n// =============================================================================\n// Value-level helpers\n// =============================================================================\n\ntype RecordError = ValueTypeOf<RecordErrorType>;\ntype RecordOutcome = ValueTypeOf<RecordOutcomeType>;\ntype RecordMutateTag = \"idle\" | \"running\" | \"committed\" | \"failed\" | \"cancelled\";\ntype CommitInfo = RecordCommitInfo;\n\n/**\n * A commit of the API's history as `record.history` carries it: its own\n * fields, without the preview of its arguments, which `RecordCommitInfoType`\n * does not hold.\n */\nfunction commitInfo(commit: RecordHistoryCommit): CommitInfo {\n    return {\n        hash: commit.hash,\n        parent: commit.parent,\n        state: commit.state,\n        mutation: commit.mutation,\n        actor: commit.actor,\n        at: commit.at,\n        delta: commit.delta,\n    };\n}\n\n/** A handle's signature, recovered from the instantiated handle type. */\ninterface RecordHandleSignature {\n    readonly stateType: EastTypeValue;\n    readonly mutations: ReadonlyMap<string, EastTypeValue[]>;\n}\n\n/** Reserved (non-mutation) field names inside the handle's `mutate` struct. */\nconst RESERVED_MUTATE_FIELDS = new Set([\"pending\", \"status\", \"error\", \"cancel\"]);\n\n/**\n * Introspect the instantiated handle struct type `H`: the state type comes\n * from the `read` field's FunctionType output, and the mutation names + arg\n * types come from the `mutate` sub-struct's non-reserved FunctionType fields.\n * The handle's shape IS the signature — there are no duplicate signature\n * arguments to drift out of sync.\n */\nexport function signatureOfRecordHandleType(handleType: EastTypeValue): RecordHandleSignature {\n    if (handleType.type !== \"Struct\") {\n        throw new Error(`Record.bind: handle type must be a Struct; got ${handleType.type}`);\n    }\n    const fields = handleType.value as { name: string; type: EastTypeValue }[];\n    const read = fields.find(f => f.name === \"read\")?.type;\n    const mutate = fields.find(f => f.name === \"mutate\")?.type;\n    if (read?.type !== \"Function\") {\n        throw new Error(\"Record.bind: handle type is missing its read closure\");\n    }\n    if (mutate?.type !== \"Struct\") {\n        throw new Error(\"Record.bind: handle type is missing its mutate struct\");\n    }\n    const stateType = (read.value as { output: EastTypeValue }).output;\n    const mutations = new Map<string, EastTypeValue[]>();\n    for (const field of mutate.value as { name: string; type: EastTypeValue }[]) {\n        if (RESERVED_MUTATE_FIELDS.has(field.name)) continue;\n        if (field.type.type !== \"Function\") {\n            throw new Error(`Record.bind: mutate field \"${field.name}\" must be a closure`);\n        }\n        mutations.set(field.name, (field.type.value as { inputs: EastTypeValue[] }).inputs);\n    }\n    return { stateType, mutations };\n}\n\n/** Map a MutationResult's non-committed outcome onto a RecordError value. */\nfunction errorOfMutationResult(result: MutationResult): RecordError {\n    const outcome = result.outcome;\n    switch (outcome.type) {\n        case \"invalid\":\n            return { kind: variant(\"invalid\", { message: outcome.value.message }), message: outcome.value.message, stderr: \"\" };\n        case \"failed\":\n            return {\n                kind: variant(\"failed\", { exitCode: outcome.value.exitCode }),\n                message: `reducer exited with code ${outcome.value.exitCode}`,\n                stderr: outcome.value.stderr,\n            };\n        case \"timed_out\":\n            return {\n                kind: variant(\"timed_out\", { ms: outcome.value.ms }),\n                message: `mutation timed out after ${outcome.value.ms}ms (server deadline)`,\n                stderr: outcome.value.stderr,\n            };\n        case \"conflict\":\n            return {\n                kind: variant(\"conflict\", { attempts: outcome.value.attempts }),\n                // A write the record no longer matches would disagree again: only\n                // a lost race is worth trying again as it was.\n                message: outcome.value.detail.type === \"some\"\n                    ? `the write no longer matches the record (${outcome.value.detail.value}); re-read it and resubmit`\n                    : `compare-and-swap conflicted after ${outcome.value.attempts} attempts; try again`,\n                stderr: \"\",\n            };\n        default:\n            return transportError(`unexpected outcome \"${(outcome as { type: string }).type}\"`);\n    }\n}\n\nfunction transportError(message: string): RecordError {\n    return { kind: variant(\"transport\", { message }), message, stderr: \"\" };\n}\n\n/** The dataset path a record's current value lives at. */\nfunction recordPath(name: string): TreePath {\n    return [variant(\"field\", \"records\"), variant(\"field\", name)];\n}\n\n/**\n * The record a dataset path is the current value of.\n *\n * @param path - A dataset's path\n * @returns The record's name; `undefined` for a path that is no record's\n */\nexport function recordOfPath(path: TreePath): string | undefined {\n    const [root, name, ...rest] = path;\n    return root !== undefined && name !== undefined && rest.length === 0 && root.type === \"field\" && root.value === \"records\" && name.type === \"field\"\n        ? name.value : undefined;\n}\n\n/** Tracked mutation-channel key (one per record). */\nexport function recordChannelKey(workspace: string, name: string): string {\n    return `record:${workspace}:${name}`;\n}\n\n// =============================================================================\n// Runtime\n// =============================================================================\n\n/** One tracked mutation channel per `(workspace, record)`. */\ninterface RecordEntry {\n    status: RecordMutateTag;\n    /** Monotonic; a settling mutation whose seq is no longer current is\n     *  discarded (latest-wins, and `cancel` orphans by bumping it). */\n    launchSeq: number;\n    /** Detail of the last `failed` mutation. */\n    error?: RecordError;\n    /** The settle promise of the in-flight mutation, if one is running. `start()`\n     *  awaits it so a commit lands before the dataflow run reads the record. */\n    inflight?: Promise<void>;\n}\n\n/**\n * Encapsulates all `Record.bind` runtime state. The module-level\n * {@link defaultRecordRuntime} instance backs the registered platform; tests\n * construct their own for isolation.\n */\nexport class RecordRuntime extends TrackedChannelStore<RecordEntry> {\n    private api: RecordApi | null = null;\n    private cache: ReactiveDatasetCacheInterface | null = null;\n    private workspace: string | null = null;\n\n    // Describe signatures, fetched once per (workspace, record), failures evicted.\n    private readonly signatureCache = new Map<string, Promise<RecordSignature>>();\n    // History per channel, fetched once + refreshed on commit.\n    private readonly histories = new Map<string, CommitInfo[]>();\n    private readonly historyInFlight = new Map<string, Promise<void>>();\n    // Channels whose last history fetch failed. Guards `history()` from\n    // re-issuing the request on every render (a failing endpoint would\n    // otherwise spin); cleared on the next commit / on clear() so a later\n    // mutation retries.\n    private readonly historyFailed = new Set<string>();\n\n    // Compiled-handle cache (issue #106 perf): buildHandle compiles 8 + (two per\n    // mutation) East.functions per bind, and binds re-run every reactive frame.\n    // The method IR is a pure function of the record name and the mutations the\n    // handle binds (two binds of one record may bind different ones), and the\n    // methods resolve cache/api/ws LIVE, so a cached handle still re-binds.\n    // Cleared on clear().\n    private readonly handleCache = new Map<string, Record<string, unknown>>();\n\n    // By channel, the workspace's polls as they stood when the record's last\n    // committed write was answered (the cache's `pollMark`) — kept only for a\n    // record the cache's polls read: its content, which they reconcile\n    // (`whole`), or its hash, which a watch follows (`hash`). What the cache\n    // holds of the record is the record's since that answer once a poll\n    // started after the mark has found it so.\n    private readonly answered = new Map<string, { readonly mark: number; readonly whole: boolean; readonly hash: boolean }>();\n\n    protected createEntry(): RecordEntry {\n        return { status: \"idle\", launchSeq: 0 };\n    }\n\n    // ----- wiring ----------------------------------------------------------\n\n    /** Install the API adapter + dataset cache + workspace — called by the\n     *  React provider (or a test, or the snapshot harness) before any handle\n     *  is used. */\n    initialize(api: RecordApi, cache: ReactiveDatasetCacheInterface, workspace: string): void {\n        this.api = api;\n        this.cache = cache;\n        this.workspace = workspace;\n    }\n\n    /**\n     * Tear down the adapter and all record state.\n     *\n     * @param api - Clear only while this is the installed adapter, so a\n     *   provider tearing down after another installed its own leaves that one\n     *   in place\n     */\n    clear(api?: RecordApi): void {\n        if (api !== undefined && this.api !== api) return;\n        this.api = null;\n        this.cache = null;\n        this.workspace = null;\n        this.clearChannels();\n        this.signatureCache.clear();\n        this.histories.clear();\n        this.historyInFlight.clear();\n        this.historyFailed.clear();\n        this.handleCache.clear();\n        this.answered.clear();\n    }\n\n    private resolveWorkspace(): string {\n        if (!this.workspace) {\n            throw new Error(\"Record.bind: no workspace configured — mount a provider (or call initializeRecordApi) first\");\n        }\n        return this.workspace;\n    }\n\n    /** The deployed describe signature for a record (fetched once, evicted on failure). */\n    private signature(workspace: string, record: string): Promise<RecordSignature> {\n        const sigKey = `${workspace}:${record}`;\n        let promise = this.signatureCache.get(sigKey);\n        if (!promise) {\n            const api = this.api;\n            if (!api) return Promise.reject(new Error(\"Record.bind: no RecordApi installed\"));\n            promise = api.describe(workspace, record).catch(err => {\n                this.signatureCache.delete(sigKey);\n                throw err;\n            });\n            this.signatureCache.set(sigKey, promise);\n        }\n        return promise;\n    }\n\n    /** Validate a mutation's declared arg types against the deployed signature. */\n    private async validate(workspace: string, record: string, mutation: string, argTypes: EastTypeValue[]): Promise<RecordError | null> {\n        let sig: RecordSignature;\n        try {\n            sig = await this.signature(workspace, record);\n        } catch (err) {\n            return transportError(`failed to describe record \"${record}\": ${err instanceof Error ? err.message : String(err)}`);\n        }\n        const deployed = sig.mutations.find(m => m.name === mutation);\n        if (!deployed) {\n            const message = `no mutation \"${mutation}\" on record \"${record}\" in the deployed package`;\n            return { kind: variant(\"invalid\", { message }), message, stderr: \"\" };\n        }\n        // The deployed signature is another build's: a recursive type's wrappers are numbered by the process that\n        // exported the package on one side and by this one on the other, naming one type — compared by its structure.\n        const argsMatch = deployed.argTypes.length === argTypes.length\n            && deployed.argTypes.every((t, i) => isTypeValueStructurallyEqual(t as EastTypeValue, argTypes[i]!));\n        if (!argsMatch) {\n            const message = `signature mismatch for mutation \"${mutation}\": bound (${argTypes.length} args) disagrees with the deployed package`;\n            return { kind: variant(\"invalid\", { message }), message, stderr: \"\" };\n        }\n        return null;\n    }\n\n    /**\n     * Fetch a record's history once per channel (deduped); notify on settle.\n     *\n     * @param again - Fetch once more after a fetch in flight, which may have\n     *   read the chain before what the caller fetches it for\n     * @returns The fetch, settled once the history or its failure is in\n     */\n    private fetchHistory(workspace: string, record: string, key: string, again = false): Promise<void> {\n        const inFlight = this.historyInFlight.get(key);\n        if (inFlight !== undefined) return again ? inFlight.then(() => this.fetchHistory(workspace, record, key)) : inFlight;\n        const fetch = (async () => {\n            const api = this.api;\n            try {\n                if (!api) throw new Error(\"no RecordApi installed\");\n                const result = await api.history(workspace, record, undefined);\n                this.histories.set(key, result.commits.map(commitInfo));\n                this.historyFailed.delete(key);\n            } catch {\n                // Mark failed so `history()` stops re-issuing on every render;\n                // a later commit / clear() drops this and retries.\n                this.historyFailed.add(key);\n            } finally {\n                this.historyInFlight.delete(key);\n                this.notify(key);\n            }\n        })();\n        this.historyInFlight.set(key, fetch);\n        return fetch;\n    }\n\n    /**\n     * What the cache holds of a record read whole, once it has read the record\n     * since the record's last write from here was answered.\n     *\n     * @remarks\n     * The answer to a write names a commit the record holds, and what the cache\n     * holds of the record is from a read after it once a status poll started\n     * since the answer has found that content the record's — fetched it, or\n     * found it held under the hash the poll read. Until then the cache may\n     * hold the record as it was before the write. A record another write put\n     * back exactly as it was holds, after the write, the bytes it held before:\n     * only when they were read tells the two apart.\n     *\n     * @param name - The record's name\n     * @returns A tracked reader of the record's bytes — `undefined` from it\n     *   until the cache has read the record since; `undefined` for a record no\n     *   write from here has been answered for, or whose content the cache's\n     *   polls do not reconcile (one read a page at a time, or held offline)\n     */\n    settledOf(name: string): SettledSource | undefined {\n        const cache = this.cache;\n        const workspace = this.workspace;\n        if (cache === null || workspace === null) return undefined;\n        const key = recordChannelKey(workspace, name);\n        if (this.answered.get(key)?.whole !== true) return undefined;\n        const path = recordPath(name);\n        return () => {\n            this.track(key);\n            trackDatasetPath(workspace, path);\n            const answer = this.answered.get(key);\n            return answer !== undefined && cache.confirmedSince(workspace, path, answer.mark) ? cache.read(workspace, path) : undefined;\n        };\n    }\n\n    /**\n     * Whether the workspace has read a record's state since the record's last\n     * write from here was answered, for a record whose hash the cache follows:\n     * one read a page at a time.\n     *\n     * @remarks\n     * The pages of such a record are pinned to a revision, which follows the\n     * hash the workspace's status polls read. The answer to a write names the\n     * revision the write made, and a page that has moved to another one since\n     * the write was drafted cannot tell whether that one is older or newer:\n     * revisions name content, and have no order. A status poll started since\n     * the answer reads the record after the write, so from the moment one has\n     * read its hash — telling its watchers, or finding them holding it — the\n     * revision the pages are pinned to is the record's as of a read made\n     * after the write.\n     *\n     * @param name - The record's name\n     * @returns A tracked reader: whether a poll started since the answer has\n     *   read the record's hash; `undefined` for a record no write from here\n     *   has been answered for, or whose hash no watch follows\n     */\n    followedOf(name: string): (() => boolean) | undefined {\n        const cache = this.cache;\n        const workspace = this.workspace;\n        if (cache === null || workspace === null) return undefined;\n        const key = recordChannelKey(workspace, name);\n        if (this.answered.get(key)?.hash !== true) return undefined;\n        const path = recordPath(name);\n        return () => {\n            this.track(key);\n            const answer = this.answered.get(key);\n            return answer !== undefined && cache.hashReadSince(workspace, path, answer.mark);\n        };\n    }\n\n    // ----- closure semantics -------------------------------------------------\n\n    /**\n     * Run one mutation on the record's channel, and settle to the server's\n     * outcome.\n     *\n     * @remarks\n     * The channel shows the write as it shows every launch, latest-wins; the\n     * outcome returned is the server's own, whatever became of the channel. A\n     * commit refreshes the record's bytes and drops its history. A conflict\n     * fetches both again before the outcome settles, so an awaiting caller\n     * reads the state and the history its write lost to.\n     *\n     * @param idempotencyKey - The write's request id, when it has one\n     * @returns The outcome\n     */\n    private runMutation(\n        workspace: string, record: string, mutation: string, argTypes: EastTypeValue[], args: unknown[], idempotencyKey?: string,\n    ): Promise<RecordOutcome> {\n        const key = recordChannelKey(workspace, record);\n        const { entry, settle } = this.beginLaunch(key, e => { delete e.error; });\n\n        const run = (async (): Promise<RecordOutcome> => {\n            const invalid = await this.validate(workspace, record, mutation, argTypes);\n            if (invalid) {\n                settle(e => { e.status = \"failed\"; e.error = invalid; });\n                return invalid.kind.type === \"transport\"\n                    ? variant(\"transport\", { message: invalid.message })\n                    : variant(\"invalid\", { message: invalid.message });\n            }\n            const api = this.api;\n            if (!api) {\n                const error = transportError(\"no RecordApi installed\");\n                settle(e => { e.status = \"failed\"; e.error = error; });\n                return variant(\"transport\", { message: error.message });\n            }\n            let result: MutationResult;\n            try {\n                const encoded = args.map((arg, i) => encodeBeast2For(argTypes[i]!)(arg));\n                result = await api.mutate(workspace, record, mutation,\n                    idempotencyKey === undefined ? { args: encoded } : { args: encoded, idempotencyKey });\n            } catch (err) {\n                const error = transportError(err instanceof Error ? err.message : String(err));\n                settle(e => { e.status = \"failed\"; e.error = error; });\n                return variant(\"transport\", { message: error.message });\n            }\n            const outcome = result.outcome;\n            if (outcome.type === \"committed\") {\n                settle(e => { e.status = \"committed\"; delete e.error; });\n                // What the cache holds of the record whole is the record's since\n                // this answer once a poll started from here on finds it so: the\n                // mark is taken before the refresh below starts one. A record\n                // put back as it was is found so with no change of its bytes to\n                // tell its readers of, so the channel tells them.\n                const cache = this.cache;\n                const mark = cache?.pollMark(workspace);\n                const confirmed = mark === undefined ? undefined : cache?.confirmed(workspace, recordPath(record), mark);\n                // And of a record read a page at a time: once one has read its hash, its watchers holding it.\n                const followed = mark === undefined ? undefined : cache?.hashRead(workspace, recordPath(record), mark);\n                if (mark === undefined || (confirmed === undefined && followed === undefined)) this.answered.delete(key);\n                else {\n                    const answer = { mark, whole: confirmed !== undefined, hash: followed !== undefined };\n                    this.answered.set(key, answer);\n                    const told = (): void => { if (this.answered.get(key) === answer) this.notify(key); };\n                    void confirmed?.then(told);\n                    void followed?.then(told);\n                }\n                // The record ref's commit hash moved — force one workspace poll so\n                // the dataset cache refetches the record's bytes and read() re-renders.\n                // Reuses the standing poller the manifest installed; no new poller.\n                void cache?.refresh(workspace);\n                // History grew — drop the cache (and any failed-fetch flag) so\n                // the next history() refetches.\n                this.histories.delete(key);\n                this.historyFailed.delete(key);\n                this.notify(key);\n            } else {\n                settle(e => { e.status = \"failed\"; e.error = errorOfMutationResult(result); });\n                if (outcome.type === \"conflict\") {\n                    // Another write moved the record: fetch it and its history\n                    // again before the outcome settles.\n                    this.histories.delete(key);\n                    this.historyFailed.delete(key);\n                    await Promise.all([this.cache?.refresh(workspace), this.fetchHistory(workspace, record, key, true)]);\n                }\n            }\n            return outcome;\n        })();\n        // start() drains the write, never its failure.\n        const inflight = run.then(() => undefined, () => undefined);\n        entry.inflight = inflight;\n        void inflight.then(() => {\n            const current = this.entries.get(key);\n            if (current && current.inflight === inflight) delete current.inflight;\n        });\n        return run;\n    }\n\n    /**\n     * The low-level primitives backing handle methods, bound to THIS runtime.\n     * Registered globally (extension registry) and included by the scoped\n     * platform (e3 `ui()` tasks) so a decoded handle re-binds here. The host\n     * effects (dataset-cache reads + reactive tracking + mutation launch) live\n     * here, keyed only on the plain-data record name; the state type rides as a\n     * type-arg on `record_read`, and per-mutation arg types come from the\n     * `record_mutate` ArgsStruct type-arg.\n     */\n    buildPrimitives(): PlatformFunction[] {\n        // eslint-disable-next-line @typescript-eslint/no-this-alias\n        const runtime = this;\n        const requireCache = (): ReactiveDatasetCacheInterface => {\n            if (!runtime.cache) {\n                throw new Error(\"Record.bind: no dataset cache configured — mount a provider first\");\n            }\n            return runtime.cache;\n        };\n        return [\n            RecordBindPrimitives.read.implement((stateType: EastTypeValue) => {\n                const decode = decodeBeast2For(stateType); // built once per type-resolution, not per read()\n                return (nameArg: unknown) => {\n                    const ws = runtime.resolveWorkspace();\n                    const path = recordPath(nameArg as string);\n                    trackDatasetPath(ws, path);\n                    const bytes = requireCache().read(ws, path);\n                    if (bytes === undefined) {\n                        throw new Error(`Record.bind: record state not loaded: ${datasetCacheKey(ws, path)} (it should be preloaded via the UI task manifest)`);\n                    }\n                    return decode(bytes);\n                };\n            }),\n            RecordBindPrimitives.status.implement((nameArg: unknown) => {\n                const ws = runtime.resolveWorkspace();\n                const path = recordPath(nameArg as string);\n                trackDatasetPath(ws, path);\n                return requireCache().getStatus(ws, path);\n            }),\n            RecordBindPrimitives.history.implement((nameArg: unknown) => {\n                const name = nameArg as string;\n                const ws = runtime.resolveWorkspace();\n                const key = recordChannelKey(ws, name);\n                runtime.track(key);\n                const cached = runtime.histories.get(key);\n                if (cached === undefined) {\n                    // Don't re-issue while a prior fetch is known to have failed\n                    // (a commit / clear() clears the flag and retries).\n                    if (!runtime.historyFailed.has(key)) void runtime.fetchHistory(ws, name, key);\n                    return none;\n                }\n                return some(cached);\n            }),\n            RecordBindPrimitives.start.implement((nameArg: unknown) => {\n                const ws = runtime.resolveWorkspace();\n                const cache = requireCache();\n                const inflight = runtime.entry(recordChannelKey(ws, nameArg as string)).inflight;\n                // Drain any in-flight mutation first so the run reads the committed\n                // state, then launch. Launch failures surface via dataflow status.\n                void Promise.resolve(inflight)\n                    .catch(() => undefined)\n                    .then(() => cache.launchDataflow(ws))\n                    .catch(() => undefined);\n                return null;\n            }),\n            RecordBindPrimitives.mutatePending.implement((nameArg: unknown) => {\n                const ws = runtime.resolveWorkspace();\n                const key = recordChannelKey(ws, nameArg as string);\n                runtime.track(key);\n                return runtime.entry(key).status === \"running\";\n            }),\n            RecordBindPrimitives.mutateStatus.implement((nameArg: unknown) => {\n                const ws = runtime.resolveWorkspace();\n                const key = recordChannelKey(ws, nameArg as string);\n                runtime.track(key);\n                return variant(runtime.entry(key).status, null);\n            }),\n            RecordBindPrimitives.mutateError.implement((nameArg: unknown) => {\n                const ws = runtime.resolveWorkspace();\n                const key = recordChannelKey(ws, nameArg as string);\n                runtime.track(key);\n                const entry = runtime.entry(key);\n                return entry.status === \"failed\" && entry.error !== undefined ? some(entry.error) : none;\n            }),\n            RecordBindPrimitives.mutateCancel.implement((nameArg: unknown) => {\n                const ws = runtime.resolveWorkspace();\n                // Drop the error + in-flight handle on cancel so a later start()\n                // doesn't wait on the mutation the user just cancelled.\n                runtime.cancelChannel(recordChannelKey(ws, nameArg as string), e => {\n                    delete e.error;\n                    delete e.inflight;\n                });\n                return null;\n            }),\n            RecordBindPrimitives.mutate.implement((argsStructType: EastTypeValue) =>\n                (recordNameArg: unknown, mutationNameArg: unknown, argsStruct: unknown) => {\n                    const fields = (argsStructType as { value: { name: string; type: EastTypeValue }[] }).value;\n                    const obj = argsStruct as Record<string, unknown>;\n                    const argTypes = fields.map(f => f.type);\n                    const args = fields.map(f => obj[f.name]);\n                    void runtime.runMutation(runtime.resolveWorkspace(), recordNameArg as string, mutationNameArg as string, argTypes, args);\n                    return null;\n                }),\n            RecordBindPrimitives.commit.implement((argsStructType: EastTypeValue) =>\n                async (recordNameArg: unknown, mutationNameArg: unknown, requestArg: unknown, argsStruct: unknown) => {\n                    const fields = (argsStructType as { value: { name: string; type: EastTypeValue }[] }).value;\n                    const obj = argsStruct as Record<string, unknown>;\n                    const request = requestArg as string;\n                    return runtime.runMutation(runtime.resolveWorkspace(), recordNameArg as string, mutationNameArg as string,\n                        fields.map(f => f.type), fields.map(f => obj[f.name]), request === \"\" ? undefined : request);\n                }),\n        ];\n    }\n\n    /**\n     * Build the handle value for one `Record.bind` evaluation. Every method —\n     * top-level AND nested `mutate.*` (incl. the dynamic per-mutation closures) —\n     * is a thin IR-bearing `East.function` over {@link buildPrimitives}, capturing\n     * only the record name (+ per-mutation name), so the handle is ordinary\n     * serializable East data (issue #106).\n     */\n    buildHandle(handleType: EastTypeValue, name: string): Record<string, unknown> {\n        // Compiled-handle cache (issue #106 perf): the name and the handle's own\n        // mutations fix its signature, so the method IRs (incl. nested mutate.*)\n        // are identical across renders; methods resolve cache/api/ws live.\n        const fields = (handleType as { value: { name: string; type: EastTypeValue }[] }).value;\n        const key = [name, ...fields.flatMap(f => f.name === \"mutate\" || f.name === \"commit\"\n            ? [f.name, ...(f.type.value as { name: string }[]).map(m => m.name)] : [])].join(\"\\u0000\");\n        const cached = this.handleCache.get(key);\n        if (cached) return cached;\n\n        const sig = signatureOfRecordHandleType(handleType);\n        const stateTypeEast = fromEastTypeValue(sig.stateType);\n\n        // Recover each method's exact return type from the handle type, so the\n        // compiled wrappers match RecordBindHandleType without re-importing the types.\n        const fnOut = (list: { name: string; type: EastTypeValue }[], n: string): EastType =>\n            fromEastTypeValue(((list.find(f => f.name === n)!.type).value as { output: EastTypeValue }).output);\n        const statusRet = fnOut(fields, \"status\");\n        const historyRet = fnOut(fields, \"history\");\n        const mfields = ((fields.find(f => f.name === \"mutate\")!.type).value as { name: string; type: EastTypeValue }[]);\n        // The awaited writes — built only for a handle type that has them, so a\n        // UI exported before them binds as it was.\n        const cfields = fields.find(f => f.name === \"commit\")?.type.value as { name: string; type: EastTypeValue }[] | undefined;\n\n        const nameExpr = East.value(name, StringType);\n        const platform = this.buildPrimitives();\n        const P = RecordBindPrimitives;\n\n        const mutate: Record<string, unknown> = {\n            pending: East.compile(East.function([], fnOut(mfields, \"pending\"), ($) => { $.return(P.mutatePending(nameExpr)); }), platform),\n            status: East.compile(East.function([], fnOut(mfields, \"status\"), ($) => { $.return(P.mutateStatus(nameExpr)); }), platform),\n            error: East.compile(East.function([], fnOut(mfields, \"error\"), ($) => { $.return(P.mutateError(nameExpr)); }), platform),\n            cancel: East.compile(East.function([], NullType, ($) => { $.return(P.mutateCancel(nameExpr)); }), platform),\n        };\n        const commit: Record<string, unknown> = {};\n        for (const [mutationName, argTypes] of sig.mutations) {\n            const argTypesEast = argTypes.map(t => fromEastTypeValue(t));\n            // Bundle the mutation's N args into one struct (platform fns are fixed-arity).\n            const ArgsStruct = StructType(argTypesEast.map((t, i): readonly [string, EastType] => [`arg${i}`, t]));\n            const mutationNameExpr = East.value(mutationName, StringType);\n            mutate[mutationName] = East.compile(East.function(argTypesEast, NullType, ($, ...args) => {\n                const obj: Record<string, unknown> = {};\n                args.forEach((a, i) => { obj[`arg${i}`] = a; });\n                $.return(P.mutate([ArgsStruct], nameExpr, mutationNameExpr, East.value(obj as never, ArgsStruct)));\n            }), platform);\n            if (cfields === undefined) continue;\n            commit[mutationName] = East.compileAsync(East.asyncFunction([StringType, ...argTypesEast], fnOut(cfields, mutationName), ($, request, ...args) => {\n                const obj: Record<string, unknown> = {};\n                args.forEach((a, i) => { obj[`arg${i}`] = a; });\n                $.return(P.commit([ArgsStruct], nameExpr, mutationNameExpr, request as never, East.value(obj as never, ArgsStruct)));\n            }), platform);\n        }\n\n        const handle: Record<string, unknown> = {\n            read: East.compile(East.function([], stateTypeEast, ($) => { $.return(P.read([stateTypeEast], nameExpr)); }), platform),\n            status: East.compile(East.function([], statusRet, ($) => { $.return(P.status(nameExpr)); }), platform),\n            history: East.compile(East.function([], historyRet, ($) => { $.return(P.history(nameExpr)); }), platform),\n            mutate,\n            ...(cfields !== undefined && { commit }),\n            start: East.compile(East.function([], NullType, ($) => { $.return(P.start(nameExpr)); }), platform),\n            binding: { name, mutations: [...sig.mutations.keys()] },\n        };\n        this.handleCache.set(key, handle);\n        return handle;\n    }\n\n    // ----- platform building -------------------------------------------------\n\n    /** Build a `Record.bind` PlatformFunction bound to this runtime. Pass\n     *  `allowed=null` for an unscoped impl; pass a Set of record names for\n     *  manifest scoping. */\n    buildPlatform(allowed: ReadonlySet<string> | null): PlatformFunction {\n        return recordBindPlatformFn.implement((handleType: EastTypeValue) =>\n            (nameArg: unknown) => {\n                const name = nameArg as string;\n                if (allowed && !allowed.has(name)) {\n                    throw new Error(\n                        `Record.bind: record \"${name}\" is not in this UI task's manifest — ` +\n                        `bind it in the task body so derivation records it`,\n                    );\n                }\n                return this.buildHandle(handleType, name);\n            },\n        );\n    }\n}\n\n// =============================================================================\n// Default process-global runtime + free-function exports.\n// =============================================================================\n\n/** Process-global runtime backing the `RecordPlatform` export. */\nexport const defaultRecordRuntime = new RecordRuntime();\n\n/** Install the record API adapter + dataset cache + workspace — called by the\n *  React provider on mount (or by a test, or the snapshot harness). */\nexport function initializeRecordApi(api: RecordApi, cache: ReactiveDatasetCacheInterface, workspace: string): void {\n    defaultRecordRuntime.initialize(api, cache, workspace);\n}\n\n/**\n * Tear down the record API adapter and all record state.\n *\n * @param api - Clear only while this is the installed adapter\n */\nexport function clearRecordApi(api?: RecordApi): void {\n    defaultRecordRuntime.clear(api);\n}\n\n/** Global, manifest-unscoped `Record.bind` impl + its backing primitives.\n *  Registered on module load (powers the extension registry decode path). */\nexport const RecordPlatform: PlatformFunction[] = [\n    defaultRecordRuntime.buildPlatform(null),\n    ...defaultRecordRuntime.buildPrimitives(),\n];\n\n/** Build a manifest-scoped `Record.bind` implementation + its backing primitives.\n *\n *  The `record_*` primitives MUST ship with the scoped platform: e3 `ui()` tasks\n *  render through `createScoped*()` arrays (UITaskPreview), NOT the global\n *  registry, so a serialized handle's methods would otherwise decode to\n *  \"Platform function 'record_read' is not available\". */\nexport function createScopedRecordPlatform(records: readonly string[]): PlatformFunction[] {\n    return [\n        defaultRecordRuntime.buildPlatform(new Set(records)),\n        ...defaultRecordRuntime.buildPrimitives(),\n    ];\n}\n\n// =============================================================================\n// In-memory RecordApi — for a host with no server (the snapshot harness), never\n// a test, whose records are e3's own (#1380): deterministic implementations;\n// `mutate` writes the new state straight into the dataset cache (so `read()`\n// re-renders offline without a poller) and appends a synthetic commit.\n// =============================================================================\n\n/** How many keyed mutations an offline record remembers: as many as a deployed one (e3-core's `RECORD_KEYS_REMEMBERED`). */\nconst KEYS_REMEMBERED = 16;\n\n/** One offline record implementation for {@link createInMemoryRecordApi}. */\nexport interface InMemoryRecordDef {\n    /** Record name (what `Record.bind` is bound to). */\n    name: string;\n    /** The record's state type. */\n    stateType: EastType | EastTypeValue;\n    /** Initial state value (seeds the dataset cache); absent for a record\n     *  declared with no initial value, which holds no state — and refuses\n     *  every mutation — until its first state is committed, as a deployed one\n     *  does. */\n    initial?: unknown;\n    /** Mutations — each a reducer over the decoded state + decoded args. */\n    mutations: {\n        name: string;\n        argTypes: (EastType | EastTypeValue)[];\n        reduce: (state: unknown, ...args: unknown[]) => unknown;\n    }[];\n}\n\n/**\n * Build an offline {@link RecordApi} from local implementations — the\n * snapshot harness's stand-in for a deployed record. Seeds each\n * record's current value into the dataset cache so `read()` works offline.\n *\n * @remarks\n * A reducer that throws a patch's `ConflictError` — `applyFor` over a patch\n * whose befores the state no longer holds — is the stale write the server\n * reports as a `conflict` naming the key; any other throw is a failed program.\n * A mutation carrying a key one of its last {@link KEYS_REMEMBERED} keyed\n * mutations carried runs nothing again: it answers with that mutation's commit\n * and the state it holds now, as the server answers a request it remembers.\n */\nexport function createInMemoryRecordApi(\n    cache: ReactiveDatasetCacheInterface,\n    workspace: string,\n    defs: InMemoryRecordDef[],\n): RecordApi {\n    interface Compiled {\n        stateType: EastTypeValue;\n        mutations: Map<string, { argTypes: EastTypeValue[]; reduce: (state: unknown, ...args: unknown[]) => unknown }>;\n        commits: CommitInfo[];\n        seq: number;\n        /** The keyed mutations it remembers, newest first: each one's idempotency key, and the commit it made. */\n        keyed: { readonly key: string; readonly commitHash: string }[];\n    }\n    const compiled = new Map<string, Compiled>();\n    for (const def of defs) {\n        const stateType = toEastTypeValue(def.stateType as EastType);\n        const mutations = new Map<string, { argTypes: EastTypeValue[]; reduce: (state: unknown, ...args: unknown[]) => unknown }>();\n        for (const m of def.mutations) {\n            mutations.set(m.name, { argTypes: m.argTypes.map(t => toEastTypeValue(t as EastType)), reduce: m.reduce });\n        }\n        const genesis: CommitInfo = {\n            hash: `${def.name}-0`.padEnd(64, \"0\"),\n            parent: none,\n            state: `${def.name}-state-0`.padEnd(64, \"0\"),\n            mutation: \"$init\",\n            actor: \"memory\",\n            at: new Date(0),\n            delta: none,\n        };\n        compiled.set(def.name, { stateType, mutations, commits: [genesis], seq: 0, keyed: [] });\n        // Seed the record's current value into the dataset cache; a record\n        // declared with no initial value holds none\n        if (def.initial !== undefined) void cache.write(workspace, recordPath(def.name), encodeBeast2For(stateType)(def.initial));\n    }\n\n    return {\n        async describe(_ws, record) {\n            const c = compiled.get(record);\n            if (!c) throw new Error(`no in-memory record \"${record}\"`);\n            return {\n                name: record,\n                mutations: [...c.mutations].map(([name, m]) => ({ name, argTypes: m.argTypes })),\n            } as unknown as RecordSignature;\n        },\n        async mutate(ws, record, mutation, req) {\n            const c = compiled.get(record);\n            if (!c) throw new Error(`no in-memory record \"${record}\"`);\n            const m = c.mutations.get(mutation);\n            if (!m) return { outcome: variant(\"invalid\", { message: `no mutation \"${mutation}\"` }) } as MutationResult;\n            const remembered = req.idempotencyKey === undefined ? undefined : c.keyed.find((held) => held.key === req.idempotencyKey);\n            if (remembered !== undefined) {\n                return { outcome: variant(\"committed\", { commitHash: remembered.commitHash, stateHash: c.commits[0]!.state }) } as MutationResult;\n            }\n            const current = cache.read(ws, recordPath(record));\n            // A record that holds no state yet refuses the write, as the server does\n            if (current === undefined) {\n                return { outcome: variant(\"invalid\", { message: `record '${record}' has no state yet: it is unassigned until its first state is committed` }) } as MutationResult;\n            }\n            const state = decodeBeast2For(c.stateType)(current);\n            const args = req.args.map((bytes, i) => decodeBeast2For(m.argTypes[i]!)(bytes));\n            let next: unknown;\n            try {\n                next = m.reduce(state, ...args);\n            } catch (err) {\n                if (err instanceof ConflictError) {\n                    return { outcome: variant(\"conflict\", { attempts: 1n, detail: some(`primary: ${err.message}`) }) } as MutationResult;\n                }\n                return { outcome: variant(\"failed\", { exitCode: 1n, stderr: err instanceof Error ? err.message : String(err) }) } as MutationResult;\n            }\n            await cache.write(ws, recordPath(record), encodeBeast2For(c.stateType)(next));\n            c.seq += 1;\n            const hash = `${record}-${c.seq}`.padEnd(64, \"0\");\n            c.commits.unshift({\n                hash,\n                parent: some(c.commits[0]!.hash),\n                state: `${record}-state-${c.seq}`.padEnd(64, \"0\"),\n                mutation,\n                actor: \"memory\",\n                at: new Date(0),\n                delta: none,\n            });\n            // A keyed mutation joins those it remembers, the oldest of which it forgets.\n            if (req.idempotencyKey !== undefined) c.keyed = [{ key: req.idempotencyKey, commitHash: hash }, ...c.keyed].slice(0, KEYS_REMEMBERED);\n            return { outcome: variant(\"committed\", { commitHash: hash, stateHash: `${record}-state-${c.seq}`.padEnd(64, \"0\") }) } as MutationResult;\n        },\n        async history(_ws, record, limit) {\n            const c = compiled.get(record);\n            if (!c) throw new Error(`no in-memory record \"${record}\"`);\n            const commits = limit !== undefined ? c.commits.slice(0, limit) : c.commits;\n            // The offline commits keep no arguments, so none is previewed\n            return { commits: commits.map((commit) => ({ ...commit, args: none })) };\n        },\n    };\n}\n\n// =============================================================================\n// Module-load registrations — wire the default runtime into east-ui hooks.\n// Tests with their own `RecordRuntime` don't use these.\n// =============================================================================\n\nregisterReactiveTracker({\n    id: \"record-bind\",\n    enableTracking: () => defaultRecordRuntime.enableTracking(),\n    disableTracking: () => defaultRecordRuntime.disableTracking(),\n    getStore: () => ({\n        subscribe: (key, cb) => defaultRecordRuntime.subscribe(key, cb),\n        getKeyVersion: (key) => defaultRecordRuntime.getKeyVersion(key),\n    }),\n});\n\nregisterPlatformImplementation(RecordPlatform);\n\n// What an editing session reads a Save of a record read whole back at: a source's id is its record's name there.\nregisterSettledSources((sourceId) => defaultRecordRuntime.settledOf(sourceId));\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The paging runtime's names: a bind's selector, and the tracked-channel key of\n * every read — a dataset's revision, a window, a total, a key search, a batch\n * and a narrowing's membership answers — each keyed by the revision it belongs\n * to, so one snapshot's reads are never served beside another's.\n *\n * @packageDocumentation\n */\n\nimport { sha256Hex } from \"@elaraai/east\";\nimport type { DatasetFindQuery, DatasetKeySearch } from \"@elaraai/e3-api-client\";\nimport type { TreePath } from \"@elaraai/e3-types\";\n\nimport { datasetPathToString } from \"../dataset-store.js\";\nimport type { PagedSelector, PagedRun } from \"./api.js\";\n\n/** The selector a bind with no index has. */\nexport const NO_INDEX: PagedSelector = { index: null, join: false };\n\n/** A selector's contribution to a channel key and a cache key. */\nexport function selectorKey(selector: PagedSelector): string {\n    return selector.index === null ? \"\" : `@${selector.index}${selector.join ? \"+join\" : \"\"}`;\n}\n\n/** Tracked-channel key for a dataset's revision. Every read of the dataset\n *  tracks it, so every read re-fires when the source moves. */\nexport function pagedRevisionKey(workspace: string, path: TreePath): string {\n    return `paged:${workspace}:${datasetPathToString(path)}#revision`;\n}\n\n/** The family a window belongs to: its dataset, the rows it serves and its\n *  revision — every window one landed window can answer for (#1217). */\nexport function pagedWindowFamily(workspace: string, path: TreePath, revision: string, selector: PagedSelector): string {\n    return `paged:${workspace}:${datasetPathToString(path)}${selectorKey(selector)}@${revision}`;\n}\n\n/** Tracked-channel key for one window of one revision. */\nexport function pagedWindowKey(\n    workspace: string, path: TreePath, revision: string, offset: number, limit: number, selector: PagedSelector = NO_INDEX,\n): string {\n    return `${pagedWindowFamily(workspace, path, revision, selector)}#${offset}+${limit}`;\n}\n\n/** Tracked-channel key for one revision's element total. */\nexport function pagedTotalKey(workspace: string, path: TreePath, revision: string, selector: PagedSelector = NO_INDEX): string {\n    return `paged:${workspace}:${datasetPathToString(path)}${selectorKey(selector)}@${revision}#total`;\n}\n\n/** Tracked-channel key for ONE key query against one revision. Every distinct\n *  query gets its own channel: a search result is as fixed as a window. */\nexport function pagedSeekKey(\n    workspace: string, path: TreePath, revision: string, query: DatasetFindQuery, selector: PagedSelector = NO_INDEX,\n): string {\n    return seekKeyIn(pagedWindowFamily(workspace, path, revision, selector), seekQueryText(query));\n}\n\n/** A search's channel key, from the family of the rows it searches and its text. */\nexport function seekKeyIn(family: string, text: string): string {\n    return `${family}#seek:${text}`;\n}\n\n/** Encodes what a batch asks, for its digest. */\nconst batchText = new TextEncoder();\n\n/**\n * What names a batch's channel: the SHA-256 of what it asks, each part's\n * length beside it so no two lists of parts read alike — a key as long however\n * much the batch asks (#1351).\n *\n * @param parts - What it asks, each in its channel text\n * @returns The digest, as hex\n */\nfunction digestOf(parts: readonly string[]): string {\n    return sha256Hex(batchText.encode(parts.map((part) => `${part.length}:${part}`).join(\"\")));\n}\n\n/** A key query's form and literals, as a channel's key names it. */\nexport function seekQueryText(query: DatasetFindQuery): string {\n    return \"key\" in query\n        ? `k=${query.key}`\n        : \"fields\" in query\n            ? `f=${query.fields.join(\"\\u0000\")}|p=${query.prefix ?? \"\"}`\n            : \"prefix\" in query\n                ? `p=${query.prefix}`\n                : `r=${(query.from ?? []).join(\"\\u0000\")}|${(query.to ?? []).join(\"\\u0000\")}`;\n}\n\n/**\n * Tracked-channel key for one batch of reads of one revision (#1351): several\n * key searches, the rows of several keys — or of those another record's runs\n * name (#1393) — or the entries of several runs, each batch named by a digest\n * of what it asks, never by its text: a batch of ten thousand searches is a\n * key as short as one of two.\n *\n * @param workspace - The workspace\n * @param path - The dataset's path\n * @param revision - The revision the batch reads\n * @param selector - The rows it reads\n * @param kind - What it reads\n * @param parts - What it asks, each in its channel text\n * @returns The key\n */\nexport function pagedBatchKey(\n    workspace: string, path: TreePath, revision: string, selector: PagedSelector,\n    kind: \"seekAll\" | \"rows\" | \"joins\" | \"runs\" | \"place\" | \"within\", parts: readonly string[],\n): string {\n    return `${pagedWindowFamily(workspace, path, revision, selector)}#${kind}:${digestOf(parts)}`;\n}\n\n/** The family of a narrowing's membership answers (#1349): the runs of one\n *  of a record's indexes, at one revision, named by their digest. */\nexport function withinFamily(workspace: string, path: TreePath, revision: string, selector: PagedSelector, runs: readonly PagedRun[]): string {\n    return `${pagedWindowFamily(workspace, path, revision, selector)}#within:${digestOf(runs.map(([row, count]) => `${row}+${count}`))}`;\n}\n\n/** A key query as a batch's wire takes it: its form alone, the index and the\n *  pin being the batch's. */\nexport function searchOf(query: DatasetFindQuery): DatasetKeySearch {\n    const { index: _index, hash: _hash, ...search } = query;\n    return search as DatasetKeySearch;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the paging runtime holds, and its bounds: a channel's entry, a dataset's\n * snapshot — the content every bind of it is pinned to, and what that content\n * delivered apart from a channel: searches' bounds, rows read by key, a\n * narrowing's membership answers and its placements — and the bookkeeping that\n * keeps each within its bound. A move of the snapshot drops them all.\n *\n * @packageDocumentation\n */\n\nimport { SortedMap } from \"@elaraai/east\";\nimport { MAX_LANDED_SEARCHES } from \"@elaraai/east-ui/internal\";\nimport type { DatasetFindResult } from \"@elaraai/e3-api-client\";\n\nimport type { PagedRow, PagedPlacement } from \"./api.js\";\n\n/** One tracked channel per window, per total and per search. */\nexport interface PageEntry {\n    status: \"idle\" | \"running\" | \"loaded\" | \"failed\";\n    /** The fetch the channel waits on; a settling fetch that is no longer it\n     *  is discarded. Unique across the runtime, so a channel dropped by a move\n     *  and made again never mistakes an old fetch for its own. */\n    launchSeq: number;\n    /** The decoded window — a value of the dataset's own type. */\n    window?: unknown;\n    /** A landed window's place: its family (the source, its rows and the\n     *  revision), its first element's offset, and how many elements it holds —\n     *  a window the server trimmed holds fewer than it asked for. A read it\n     *  covers is answered from it (#1217). */\n    span?: WindowSpan;\n    /** Where a window in flight asked: its family, its first element's offset,\n     *  and how many elements it asked for. A read it covers waits on it (#1596). */\n    asking?: WindowSpan;\n    /** A landed runs read's place (#1351): its family, and where each run's\n     *  entries sit in it — a read inside one of its runs is answered from it,\n     *  as from a window's span. */\n    runSpans?: RunSpans;\n    /** Total elements in the source, learned from any landed window. */\n    total?: number;\n    /** Where a key query landed — the answer on a seek channel. */\n    range?: DatasetFindResult;\n    /** A batch of key searches' answer (#1351): every search it asks's\n     *  bounds, in the order asked — the answer on a `seekAll` channel. */\n    ranges?: DatasetFindResult[];\n    /** A rows read's answer, every key asked's row in order — the answer on a\n     *  rows batch's channel (#1351). */\n    rows?: readonly PagedRow[];\n    /** A placement's answer so far — the answer on a placement's channel\n     *  (#1349), set as each of its windows lands. */\n    placement?: PagedPlacement;\n    /** Why the last attempt failed — what a read of the channel throws. */\n    error?: string;\n    /** When the last attempt failed, so a retry can be rate-limited. */\n    failedAtMs?: number;\n    /** No retry can help while the source holds the same content. */\n    permanent?: boolean;\n    /** The snapshots whose channels hold it: its dataset's, and for a read by\n     *  another record's runs that record's too (#1393) — what a channel let go\n     *  leaves. */\n    owners?: Set<Snapshot>;\n}\n\n/** Where a landed window sits in its source's row space (#1217). */\ninterface WindowSpan {\n    /** The window's family — {@link pagedWindowFamily}: a read of another\n     *  family is never answered from it. */\n    readonly family: string;\n    /** Its first element's offset. */\n    readonly offset: number;\n    /** How many elements it holds. */\n    readonly count: number;\n}\n\n/** Where a landed runs read's entries sit in its source's row space (#1351). */\nexport interface RunSpans {\n    /** The read's family — {@link pagedWindowFamily}. */\n    readonly family: string;\n    /** Each run, ascending: its first row, how many entries it holds, and\n     *  where they start in the read's window. */\n    readonly runs: readonly { readonly row: number; readonly count: number; readonly at: number }[];\n}\n\n/** Searches of one source's rows launched in one synchronous turn (#1360). */\nexport interface SearchBurst {\n    /** Whether a search may still join: until the turn that opened it ends. */\n    open: boolean;\n    /** Members still in flight. */\n    pending: number;\n    /** The channels its members answered, landed or failed, to re-fire once\n     *  the last is done. */\n    readonly answered: string[];\n}\n\n/** What every bind of one dataset shares: the content its reads are pinned to. */\nexport interface Snapshot {\n    /** The dataset's revision channel, as snapshots are keyed — the channel\n     *  every read of the dataset tracks. */\n    readonly key: string;\n    /** The content hash reads are pinned to: `undefined` until found, `null`\n     *  while the dataset has no value. */\n    revision: string | null | undefined;\n    /** Moves so far. A lookup that began before a move answers for content no\n     *  newer than the move's, so its answer is dropped. */\n    moves: number;\n    /** The latest lookup of the revision; only it settles. */\n    findSeq: number;\n    /** Whether a lookup is in flight. */\n    finding: boolean;\n    /** Why the last lookup failed, while the revision is unknown. */\n    findError?: string;\n    /** When the last lookup failed, so a retry can be rate-limited. */\n    findFailedAtMs?: number;\n    /** The channels of the current revision, dropped when it moves. */\n    readonly channels: Set<string>;\n    /** The bounds of searches the revision holds apart from a channel, by the\n     *  search's channel key, the least recently used first: what batches\n     *  answered (#1351), and a search's own answer once no reader holds its\n     *  channel — at most {@link MAX_LANDED_SEARCHES}, as the record Slice keeps\n     *  its own. Dropped when it moves. */\n    readonly searches: Map<string, DatasetFindResult>;\n    /** The rows reads by key have held at this revision, by the family of the\n     *  rows they read (#1351): a search by one of their keys, and a one-row\n     *  page at one's position, answer from them. Dropped when it moves. */\n    readonly held: Map<string, HeldRows>;\n    /** Which entry keys a narrowing's runs hold, as membership reads have\n     *  answered them at this revision, by the runs (#1349), the least recently\n     *  used narrowing first. Dropped when it moves, with what each batch kept\n     *  for its reader. */\n    readonly within: Map<string, HeldWithin>;\n    /** Each membership batch keeping keys for its reader, over every\n     *  narrowing, the oldest first, beside the answers it keeps them in. */\n    readonly pinning: Map<string, HeldWithin>;\n    /** The placements the revision holds, by their channel, the least recently\n     *  read first (#1349): at most {@link MAX_HELD_PLACEMENTS} narrowings', but\n     *  never one a reader holds. Dropped when it moves. */\n    readonly placements: Map<string, true>;\n    /** Stops following the dataset; `undefined` while it is not followed —\n     *  nothing reads it, or no adapter is installed. */\n    unwatch: (() => void) | undefined;\n    /** What the dataset's follower is told its hashes through, while it is followed: named when the snapshot says\n     *  where it reads by evidence of its own. */\n    told?: ((hash: string | null) => void) | undefined;\n}\n\n/** The rows reads by key have held at one revision, of one family (#1351). */\nexport interface HeldRows {\n    /** Every key answered: its row or absence, and its position. */\n    readonly byKey: SortedMap<unknown, PagedRow>;\n    /** The rows the dataset holds, by their position. */\n    readonly byPosition: Map<number, PagedRow>;\n}\n\n/** The most rows a family holds from reads by key; past it, what it held goes\n *  and the newest read's rows are held alone. */\nexport const MAX_HELD_ROWS = 20_000;\n\n/**\n * Keep a search's bounds among those a revision holds apart from a channel\n * (#1351), the most recently used; past {@link MAX_LANDED_SEARCHES}, the least\n * recently used go.\n *\n * @param snapshot - The revision's snapshot\n * @param key - The search's channel key\n * @param range - Its bounds\n */\nexport function landSearch(snapshot: Snapshot, key: string, range: DatasetFindResult): void {\n    snapshot.searches.delete(key);\n    snapshot.searches.set(key, range);\n    if (snapshot.searches.size > MAX_LANDED_SEARCHES) snapshot.searches.delete(snapshot.searches.keys().next().value!);\n}\n\n/**\n * A search's bounds the revision holds apart from a channel, now its most\n * recently used.\n *\n * @param snapshot - The revision's snapshot\n * @param key - The search's channel key\n * @returns Its bounds, or `undefined` when the revision holds none of it\n */\nexport function heldSearch(snapshot: Snapshot, key: string): DatasetFindResult | undefined {\n    const range = snapshot.searches.get(key);\n    if (range === undefined) return undefined;\n    snapshot.searches.delete(key);\n    snapshot.searches.set(key, range);\n    return range;\n}\n\n/** What a channel holds that a read answers from, besides a failure: nothing at all, and a read of it asks again. */\nexport function holdsNothing(entry: PageEntry): boolean {\n    return entry.status !== \"failed\" && entry.window === undefined && entry.rows === undefined && entry.range === undefined\n        && entry.ranges === undefined && entry.placement === undefined && entry.total === undefined;\n}\n\n/** How many windows of a placement are asked at once (#1349). */\nexport const PLACE_CONCURRENCY = 4;\n\n/** The most entry keys one membership read asks of (#1349): a reader asks of\n *  more in parts. */\nexport const MAX_WITHIN_KEYS = 20_000;\n\n/** The most membership answers a revision holds, over every narrowing's runs;\n *  past it, the least recently used narrowing's least recently read answers\n *  go first — but never one a batch keeps for its reader ({@link HeldWithin}),\n *  so the answers a read waits on are held when it reads again, whatever other\n *  readers' answers land meanwhile, under whatever narrowing. */\nconst MAX_HELD_WITHIN = 2 * MAX_WITHIN_KEYS;\n\n/** The most membership batches that keep keys for their readers at once, over\n *  every narrowing of a revision; past it, the oldest batch's keys are trimmed\n *  as any are. What batches keep is bounded by it, so the answers held never\n *  pass {@link MAX_HELD_WITHIN} by more than the keys of this many batches. */\nconst MAX_PINNING_BATCHES = 16;\n\n/** The most narrowings whose placements a revision holds (#1349), as many as\n *  the membership batches it keeps for their readers\n *  ({@link MAX_PINNING_BATCHES}): a viewer trying narrowing after narrowing\n *  leaves each one's placement behind, and past this the least recently read\n *  of those no reader holds go. */\nexport const MAX_HELD_PLACEMENTS = MAX_PINNING_BATCHES;\n\n/**\n * Which entry keys one narrowing's runs hold, as membership reads answered\n * them at one revision (#1349), and what each batch keeps for its reader.\n *\n * A batch keeps every key its reader asks of — those already held when it\n * launches, and those its answer brings — until a read that holds every key\n * it asks of reads them. So however many readers' answers land between a\n * batch's landing and its reader's next read, trimming to\n * {@link MAX_HELD_WITHIN} never takes an answer the reader is waiting to\n * read, and each reader reads its answers after one batch: no reader's\n * landing undoes another's.\n */\ninterface HeldWithin {\n    /** Each entry key's answer, the least recently read first: a read moves the keys it reads to the end. */\n    readonly answers: Map<string, boolean>;\n    /** The batches that keep each key, until a read reads it. */\n    readonly pins: Map<string, Set<string>>;\n    /** Each batch keeping keys, the oldest first: the keys its reader asks of, and how many of them it keeps still. */\n    readonly batches: Map<string, KeepingBatch>;\n}\n\n/** A batch that keeps keys for its reader: the keys its reader asks of, and how many of them it keeps still. */\ninterface KeepingBatch {\n    /** Every key its reader asks of. */\n    readonly keys: readonly string[];\n    /** How many of them it keeps until a read reads them: once a read has read the last, it keeps nothing. */\n    kept: number;\n}\n\n/**\n * The membership answers one narrowing's runs hold, made empty on first use:\n * from now the revision's most recently used narrowing, whose answers a trim\n * takes last.\n */\nexport function heldWithinOf(snapshot: Snapshot, family: string): HeldWithin {\n    let held = snapshot.within.get(family);\n    if (held === undefined) held = { answers: new Map(), pins: new Map(), batches: new Map() };\n    else snapshot.within.delete(family);\n    snapshot.within.set(family, held);\n    return held;\n}\n\n/**\n * Keep keys for a batch until its reader reads them. Past\n * {@link MAX_PINNING_BATCHES} over every narrowing of the revision, the oldest\n * batch keeps its keys no longer.\n *\n * @param snapshot - The revision's snapshot\n * @param held - The answers one narrowing's runs hold\n * @param batch - The batch's channel key\n * @param keys - Every key its reader asks of\n * @param kept - The keys it keeps now: those held as it launches, or those its answer brings\n */\nexport function keepWithin(snapshot: Snapshot, held: HeldWithin, batch: string, keys: readonly string[], kept: Iterable<string>): void {\n    let keeping = held.batches.get(batch);\n    for (const key of kept) {\n        let by = held.pins.get(key);\n        if (by === undefined) {\n            by = new Set();\n            held.pins.set(key, by);\n        }\n        if (by.has(batch)) continue;\n        by.add(batch);\n        if (keeping === undefined) {\n            keeping = { keys, kept: 0 };\n            held.batches.set(batch, keeping);\n            snapshot.pinning.set(batch, held);\n        }\n        keeping.kept += 1;\n    }\n    while (snapshot.pinning.size > MAX_PINNING_BATCHES) {\n        const [oldest, of] = snapshot.pinning.entries().next().value!;\n        releaseWithin(snapshot, of, oldest);\n    }\n}\n\n/** A batch keeps its keys no longer: they are trimmed as any are, unless another batch keeps them. */\nexport function releaseWithin(snapshot: Snapshot, held: HeldWithin, batch: string): void {\n    snapshot.pinning.delete(batch);\n    const keeping = held.batches.get(batch);\n    if (keeping === undefined) return;\n    held.batches.delete(batch);\n    for (const key of keeping.keys) {\n        const by = held.pins.get(key);\n        if (by === undefined || !by.delete(batch)) continue;\n        if (by.size === 0) held.pins.delete(key);\n    }\n}\n\n/**\n * A read that holds every key it asks of has read them: each moves to the\n * end, the most recently read, and no batch keeps it any longer — however\n * many kept it, since the read answers every reader asking of it alike. A\n * batch whose last kept key a read has read keeps nothing, and is done.\n */\nexport function readWithin(snapshot: Snapshot, held: HeldWithin, keys: readonly string[]): void {\n    for (const key of keys) {\n        const answer = held.answers.get(key);\n        if (answer === undefined) continue;\n        held.answers.delete(key);\n        held.answers.set(key, answer);\n        const by = held.pins.get(key);\n        if (by === undefined) continue;\n        held.pins.delete(key);\n        for (const batch of by) {\n            const keeping = held.batches.get(batch);\n            if (keeping !== undefined && --keeping.kept === 0) {\n                held.batches.delete(batch);\n                snapshot.pinning.delete(batch);\n            }\n        }\n    }\n    trimWithin(snapshot);\n}\n\n/**\n * Past {@link MAX_HELD_WITHIN} answers over every narrowing of the revision,\n * the least recently used narrowing's least recently read answers go first —\n * but none a batch keeps — and a narrowing left holding none, and with no\n * batch keeping any, goes with them.\n */\nexport function trimWithin(snapshot: Snapshot): void {\n    let total = 0;\n    for (const held of snapshot.within.values()) total += held.answers.size;\n    if (total <= MAX_HELD_WITHIN) return;\n    for (const [family, held] of snapshot.within) {\n        for (const key of held.answers.keys()) {\n            if (total <= MAX_HELD_WITHIN) break;\n            if (held.pins.has(key)) continue;\n            held.answers.delete(key);\n            total -= 1;\n        }\n        if (held.answers.size === 0 && held.batches.size === 0) snapshot.within.delete(family);\n        if (total <= MAX_HELD_WITHIN) return;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * How the paging runtime reads what a fetch threw: which server errors no retry\n * can fix while the dataset holds the same content, which say the dataset has\n * no value, the reason a failed read throws, and how long a read that failed\n * waits before it is fetched again.\n *\n * @packageDocumentation\n */\n\nimport type { TreePath } from \"@elaraai/e3-types\";\n\nimport { datasetPathToString } from \"../dataset-store.js\";\n\n/** Minimum gap between retries of a read whose fetch failed. */\nexport const RETRY_AFTER_MS = 2000;\n\n/**\n * Server error codes that no retry can fix while the dataset holds the same\n * content: the request, or the stored value, is wrong rather than the moment.\n * A read that failed with one keeps throwing without fetching again until the\n * source moves. Anything else — a transport blip, a cold server — is fetched\n * again after {@link RETRY_AFTER_MS}.\n */\nconst PERMANENT_PAGE_ERRORS = new Set([\n    \"bad_request\",\n    \"dataset_not_canonical\",\n    \"dataset_not_indexed\",\n    \"dataset_not_pageable\",\n    \"dataset_not_searchable\",\n    \"dataset_not_segmented\",\n    \"index_not_found\",\n    \"key_parse_error\",\n]);\n\n/** Server error codes that say the dataset has no value, so the source has no\n *  snapshot until one lands. */\nexport const NO_VALUE_ERRORS = new Set([\"dataset_unassigned\", \"dataset_null\"]);\n\n/** A caught error's server code, when it carries one. */\nexport function errorCode(err: unknown): string | undefined {\n    const code = (err as { code?: unknown } | null)?.code;\n    return typeof code === \"string\" ? code : undefined;\n}\n\n/** Whether a caught fetch error is one no retry can fix. */\nexport function isPermanentPageError(err: unknown): boolean {\n    const code = errorCode(err);\n    return code !== undefined && PERMANENT_PAGE_ERRORS.has(code);\n}\n\n/** What a failed read throws: the server's code and message, or the error's own. */\nexport function failureOf(path: TreePath, err: unknown): string {\n    const code = errorCode(err);\n    const details = (err as { details?: unknown } | null)?.details;\n    const reason = code === undefined\n        ? (err instanceof Error ? err.message : String(err))\n        : typeof details === \"string\" && details !== \"\" ? `${code}: ${details}` : code;\n    return `Data.bindPaged: ${datasetPathToString(path)}: ${reason}`;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Window arithmetic for the paging runtime, pure: where a read starts in a\n * landed window that covers it (#1217, #1351), a cut of a decoded window, the\n * parts of a window read in turn joined, and the runs left once an answer's\n * entries are in hand.\n *\n * @packageDocumentation\n */\n\nimport { SortedMap, SortedSet, compareFor, fromEastTypeValue, type EastTypeValue } from \"@elaraai/east\";\n\nimport type { PagedRun } from \"./api.js\";\nimport type { PageEntry } from \"./state.js\";\n\n/**\n * Where a read of `[offset, offset + limit)` of a family starts in a landed\n * window that holds all of it: by the window's span, or inside one of a runs\n * read's runs (#1217, #1351).\n *\n * @param entry - A landed window's channel\n * @param family - The read's family\n * @param offset - The read's first element\n * @param limit - How many elements it asks for\n * @returns The element of the window it starts at, or `undefined` when the window holds none of it whole\n */\nexport function coveringAt(entry: PageEntry, family: string, offset: number, limit: number): number | undefined {\n    const span = entry.span;\n    if (span !== undefined) {\n        return span.family === family && span.offset <= offset && offset + limit <= span.offset + span.count ? offset - span.offset : undefined;\n    }\n    const spans = entry.runSpans;\n    if (spans === undefined || spans.family !== family) return undefined;\n    // The last run starting at or before the read's offset.\n    let lo = 0;\n    let hi = spans.runs.length;\n    while (lo < hi) {\n        const mid = (lo + hi) >> 1;\n        if (spans.runs[mid]!.row <= offset) lo = mid + 1;\n        else hi = mid;\n    }\n    const run = spans.runs[lo - 1];\n    return run !== undefined && offset + limit <= run.row + run.count ? run.at + (offset - run.row) : undefined;\n}\n\n/**\n * How many elements a decoded window holds, by the source's collection type;\n * `undefined` for a type a window is not cut from.\n *\n * @param sourceType - The source's type: an Array, Dict or Set\n * @param window - A decoded window of it\n * @returns The element count\n */\nexport function elementCount(sourceType: EastTypeValue, window: unknown): number | undefined {\n    switch (sourceType.type) {\n        case \"Array\": return (window as readonly unknown[]).length;\n        case \"Dict\": return (window as ReadonlyMap<unknown, unknown>).size;\n        case \"Set\": return (window as ReadonlySet<unknown>).size;\n        default: return undefined;\n    }\n}\n\n/**\n * Elements `[from, from + count)` of a decoded window, as a value of the\n * source's own type: an Array's slice, or a Dict's or a Set's entries in\n * their key order, under the key type's own comparator (#1217).\n *\n * @param sourceType - The source's type: an Array, Dict or Set\n * @param window - A decoded window of it\n * @param from - The first element, counted from the window's start\n * @param count - How many elements\n * @returns The cut, or `undefined` for a type a window is not cut from\n */\nexport function cutWindow(sourceType: EastTypeValue, window: unknown, from: number, count: number): unknown {\n    switch (sourceType.type) {\n        case \"Array\": return (window as readonly unknown[]).slice(from, from + count);\n        case \"Dict\": {\n            const keyType = fromEastTypeValue((sourceType.value as { key: EastTypeValue }).key);\n            return new SortedMap([...(window as ReadonlyMap<unknown, unknown>)].slice(from, from + count), compareFor(keyType));\n        }\n        case \"Set\": {\n            const elementType = fromEastTypeValue(sourceType.value as EastTypeValue);\n            return new SortedSet([...(window as ReadonlySet<unknown>)].slice(from, from + count), compareFor(elementType));\n        }\n        default: return undefined;\n    }\n}\n\n/**\n * The runs left of `runs` once their first `taken` entries are in hand.\n *\n * @param runs - The runs asked\n * @param taken - How many of their entries an answer held\n * @returns The rest, the first one cut where the answer ended\n */\nexport function runsAfter(runs: readonly PagedRun[], taken: number): PagedRun[] {\n    const rest: PagedRun[] = [];\n    let skip = taken;\n    for (const [row, count] of runs) {\n        if (skip >= count) { skip -= count; continue; }\n        rest.push([row + skip, count - skip]);\n        skip = 0;\n    }\n    return rest;\n}\n\n/**\n * The parts of one window read in turn, as one value of the source's type: an\n * Array's items one after another, a Set's or a Dict's in their key order.\n *\n * @param sourceType - The source's type: an Array, a Set or a Dict\n * @param parts - The decoded parts, in order\n * @returns The window\n */\nexport function joinWindows(sourceType: EastTypeValue, parts: readonly unknown[]): unknown {\n    if (parts.length === 1) return parts[0];\n    switch (sourceType.type) {\n        case \"Dict\": {\n            const keyType = fromEastTypeValue((sourceType.value as { key: EastTypeValue }).key);\n            return new SortedMap(parts.flatMap((part) => [...(part as ReadonlyMap<unknown, unknown>)]), compareFor(keyType));\n        }\n        case \"Set\": {\n            const elementType = fromEastTypeValue(sourceType.value as EastTypeValue);\n            return new SortedSet(parts.flatMap((part) => [...(part as ReadonlySet<unknown>)]), compareFor(elementType));\n        }\n        default: return parts.flatMap((part) => [...(part as readonly unknown[])]);\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A read of a paged source that failed (#811, #1039): what the paging runtime\n * throws when a read of a window, a total, a search or a batch whose fetch\n * failed is read — or of a source whose content could not be found — its\n * reason the message, until a read after the retry gap asks again. It has a\n * type of its own, so a reader tells a read that failed — said where its rows\n * would be, with Retry — from any other error, which it throws on.\n *\n * @packageDocumentation\n */\n\n/**\n * What marks a {@link PagedReadError}: a symbol of the runtime's registry, so\n * the mark holds whichever copy of this module made the error.\n */\nconst PAGED_READ_ERROR: unique symbol = Symbol.for(\"@elaraai/e3-ui-components:PagedReadError\");\n\n/** A read of a paged source that failed (see the module docs). */\nexport class PagedReadError extends Error {\n    /** Its mark, which {@link isPagedReadError} reads. */\n    readonly [PAGED_READ_ERROR] = true;\n\n    /**\n     * A read that failed.\n     *\n     * @param message - Why it failed: the server's code and message, or the error's own\n     */\n    constructor(message: string) {\n        super(message);\n        this.name = \"PagedReadError\";\n    }\n}\n\n/**\n * Whether what was thrown is a read of a paged source that failed\n * ({@link PagedReadError}), whichever copy of this module made it.\n *\n * @param error - What was thrown\n * @returns Whether it is a read that failed\n */\nexport function isPagedReadError(error: unknown): error is PagedReadError {\n    return typeof error === \"object\" && error !== null && (error as { readonly [PAGED_READ_ERROR]?: unknown })[PAGED_READ_ERROR] === true;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The paging runtime's first layer: the channels of a dataset's snapshot. It\n * follows each dataset's content hash — every bind of one shares a snapshot,\n * and a move drops what the old one delivered — and runs every channel's fetch:\n * launched, aborted once no read waits on it (#1398, CL6), applied only while\n * the channel still waits on it, failed with a reason a read throws and a retry\n * gap, and landed once a frame (CL9). Landed windows are kept least recently\n * read first, at most {@link MAX_RETAINED_WINDOWS}, never one a reader holds\n * (#1409, R24). The layers after it read through these channels: single windows\n * and searches (`reads.ts`), batched reads (`batches.ts`), and the handles and\n * platform functions (`../paged-runtime.ts`).\n *\n * @packageDocumentation\n */\n\nimport { none, some, type option } from \"@elaraai/east\";\nimport { DatasetHashMismatchError, RunsHashMismatchError } from \"@elaraai/e3-api-client\";\nimport type { TreePath } from \"@elaraai/e3-types\";\n\nimport { datasetPathToString } from \"../dataset-store.js\";\nimport { TrackedChannelStore } from \"../tracked-channel.js\";\nimport { PagedReadError } from \"../paged-read-error.js\";\nimport type { PagedApi } from \"./api.js\";\nimport { pagedRevisionKey } from \"./keys.js\";\nimport { RETRY_AFTER_MS, NO_VALUE_ERRORS, errorCode, failureOf } from \"./errors.js\";\nimport { type PageEntry, type SearchBurst, type Snapshot, landSearch, holdsNothing, MAX_HELD_PLACEMENTS } from \"./state.js\";\n\n/**\n * How long the windows landed wait for a frame to apply them before a timer\n * does (#1398, CL9): a page that draws no frames — hidden, say — still hears\n * them, a few frames late.\n */\nconst LANDING_WAIT_MS = 100;\n\n/**\n * What asks for the frame that applies the windows a runtime landed, in place\n * of the page's next frame (#1398, CL9).\n *\n * @param apply - Applies the windows landed, as the frame comes\n * @returns What cancels the frame\n */\nexport type PagedLandingFrame = (apply: () => void) => () => void;\n\n/**\n * Decoded windows retained across ALL paged sources (#567 D6).\n *\n * A decoded window is the heavy object here — a window of wide rows runs to\n * megabytes — and nothing else evicts one while its revision stands: scrolling\n * a GB-scale dataset end to end would pin every window it passed. Retention is\n * bounded least-recently-READ: past the cap the least recently read window no\n * reader holds goes whole, and a read of it fetches it again (the raw bytes\n * may still be in an HTTP cache, so a return is usually cheap).\n *\n * The windows its readers hold count toward the cap, but none is evicted\n * under its reader: past the cap the runtime keeps what its readers hold\n * alone, each reader bounding what it holds by its own demand (#1409, R24) —\n * a reader of more windows than the cap, rows read a key at a time among\n * them, each a one-row window, settles, each read once.\n *\n * `<PagedDatasetPreview>` caps its own materialized rows the same way\n * (`MAX_RETAINED_PAGES`); this is the cap for the *bound* path, where the\n * renderer holds no cache of its own and the runtime is the only holder.\n */\nexport const MAX_RETAINED_WINDOWS = 24;\n\n/**\n * One-row windows cut from a landed one, or from the rows a read by key holds,\n * kept across all paged sources, least recently read first (#1596). A one-row\n * cut holds a row and asked nothing of e3, so it counts toward none of\n * {@link MAX_RETAINED_WINDOWS}, and a reader that reads every row it draws a\n * row at a time — a sheet's row checks, its cells from data — leaves the\n * windows those rows came from where they are. A cut of more rows is a window\n * of the cap's, as one fetched is: at most this many rows are held by cuts.\n * Past it the runtime keeps the cuts its readers hold, as it keeps their\n * windows, and at most {@link CUTS_BETWEEN_LOOKS} that none does.\n */\nexport const MAX_RETAINED_CUTS = 4096;\n\n/**\n * How many one-row cuts are kept, past {@link MAX_RETAINED_CUTS}, between two\n * looks at them all (#1596). A look that leaves more than the cap leaves only\n * cuts a reader holds, each held until its reader lets it go: another look\n * would ask of every one of them whether a reader holds it, to let none go —\n * and a read past the cap is what looks, so a reader of 5,000 rows a row at a\n * time asked 25 million times a run. The cuts are looked at again once a\n * reader lets one go, or once this many more have been kept, which are the\n * only ones that can go.\n */\nexport const CUTS_BETWEEN_LOOKS = MAX_RETAINED_CUTS / 4;\n\n/**\n * The channels of every dataset's snapshot, and their fetches: the paging runtime's first layer.\n */\nexport class PagedChannels extends TrackedChannelStore<PageEntry> {\n    protected api: PagedApi | null = null;\n    protected workspace: string | null = null;\n\n    /** Loaded window keys in least-recently-READ order (a Map preserves\n     *  insertion order; a read re-inserts). Bounds the decoded-window cache. */\n    protected readonly loadedWindows = new Map<string, true>();\n\n    /** The one-row windows cut from a landed one, least-recently-READ order (#1596): apart from {@link loadedWindows}, whose cap they never press on. */\n    protected readonly cutWindows = new Map<string, true>();\n\n    /**\n     * How many cuts have been kept since {@link trimCuts} last looked at them all and left more than the cap, every\n     * one left a reader's; `undefined` while the next read past the cap is to look ({@link CUTS_BETWEEN_LOOKS}).\n     */\n    private cutsSinceLook: number | undefined;\n\n    /** Each dataset's snapshot, by workspace and path. */\n    protected readonly snapshots = new Map<string, Snapshot>();\n\n    /** This turn's open search bursts, by the family of the rows they search. */\n    protected readonly bursts = new Map<string, SearchBurst>();\n\n    /** Fetches launched so far — the source of every channel's `launchSeq`. */\n    protected launches = 0;\n\n    /** Each fetch in flight, by its channel: its launch, what aborts it, and what an abort lets go besides (#1398, CL6). */\n    protected readonly fetching = new Map<string, { readonly seq: number; readonly controller: AbortController; readonly onAbort: (() => void) | undefined }>();\n\n    /** The channels of the windows landed since the frame began, and their totals', whose readers are still to hear (#1398, CL9). */\n    protected readonly landed = new Set<string>();\n    /** What cancels the frame — or the timer standing in for one — that applies them, while one waits ({@link scheduleLanding}). */\n    protected landing: (() => void) | undefined;\n    /** What asks for the frame that applies them in place of the page's, once one is set ({@link setLandingFrame}). */\n    protected landingFrame: PagedLandingFrame | undefined;\n\n    /** Monotonic clock seam so tests can drive the retry gate. */\n    protected now(): number {\n        return Date.now();\n    }\n\n    protected createEntry(): PageEntry {\n        return { status: \"idle\", launchSeq: 0 };\n    }\n\n    /** Stop following every dataset, and drop what every snapshot delivered — aborting what is still in flight. */\n    protected reset(): void {\n        for (const key of [...this.fetching.keys()]) this.abortFetch(key);\n        for (const snapshot of this.snapshots.values()) snapshot.unwatch?.();\n        this.snapshots.clear();\n        this.clearChannels();\n        this.loadedWindows.clear();\n        this.cutWindows.clear();\n        this.cutsSinceLook = undefined;\n        this.bursts.clear();\n        this.cancelLanding();\n        this.landed.clear();\n    }\n\n    /**\n     * A window has landed: its readers hear with every other window landing before the next frame (#1398, CL9), so a\n     * burst of windows — a fling coming to rest, the windows either side read ahead — is applied to each reader once a\n     * frame, never once a window.\n     *\n     * @param keys - The window's channel, and its total's when it moved\n     */\n    protected notifyLanded(keys: readonly string[]): void {\n        for (const key of keys) this.landed.add(key);\n        if (this.landing !== undefined) return;\n        const cancel = this.scheduleLanding(() => this.flushLanded());\n        if (cancel === undefined) this.flushLanded();\n        else this.landing = cancel;\n    }\n\n    /**\n     * Apply the windows landed in frames of this, in place of the page's next frame (#1398, CL9): a DOM test's, whose\n     * page draws no frame its test waits on. `undefined` gives the page's frames back.\n     *\n     * @param frame - What asks for the frame, or `undefined`\n     */\n    setLandingFrame(frame: PagedLandingFrame | undefined): void {\n        this.landingFrame = frame;\n    }\n\n    /**\n     * What applies the windows landed (#1398, CL9): the next animation frame — or, where the page draws none, hidden\n     * say, a timer standing in for it, a few frames late — or the frame set in its place ({@link setLandingFrame}). A\n     * runtime with no frames to draw at all applies them at once. A spec drives frames of its own.\n     *\n     * @param apply - Applies the windows landed\n     * @returns What cancels it; `undefined` to apply them at once\n     */\n    protected scheduleLanding(apply: () => void): (() => void) | undefined {\n        if (this.landingFrame !== undefined) return this.landingFrame(apply);\n        if (typeof requestAnimationFrame !== \"function\") return undefined;\n        const frame = requestAnimationFrame(apply);\n        const timer = setTimeout(apply, LANDING_WAIT_MS);\n        return () => {\n            if (typeof cancelAnimationFrame === \"function\") cancelAnimationFrame(frame);\n            clearTimeout(timer);\n        };\n    }\n\n    /** No frame or timer waits to apply the windows landed. */\n    protected cancelLanding(): void {\n        const cancel = this.landing;\n        if (cancel === undefined) return;\n        this.landing = undefined;\n        cancel();\n    }\n\n    /**\n     * Apply the windows landed since the frame began to their readers now (#1398, CL9): every channel's version moves,\n     * then each reader hears once, however many of the windows it reads — what the frame does as it comes.\n     */\n    protected flushLanded(): void {\n        this.cancelLanding();\n        if (this.landed.size === 0) return;\n        const keys = [...this.landed];\n        this.landed.clear();\n        this.notifyAll(keys);\n    }\n\n    protected resolveWorkspace(): string {\n        if (!this.workspace) {\n            throw new Error(\n                \"Data.bindPaged: no paging service — a paged source is served BY THE SERVER \" +\n                \"(datasetGetPage), so it resolves only inside a live workspace. Render this \" +\n                \"component against a deployed workspace, or bind the whole value with Data.bind.\",\n            );\n        }\n        return this.workspace;\n    }\n\n    // ----- snapshots -------------------------------------------------------\n\n    /** A dataset's snapshot, followed from a read while something reads the\n     *  dataset ({@link unsubscribed}) — the read that makes it, or the first\n     *  after its readers all let it go. */\n    protected snapshotOf(workspace: string, path: TreePath): Snapshot {\n        const key = pagedRevisionKey(workspace, path);\n        let snapshot = this.snapshots.get(key);\n        if (snapshot === undefined) {\n            snapshot = {\n                key,\n                revision: undefined,\n                moves: 0,\n                findSeq: 0,\n                finding: false,\n                channels: new Set(),\n                searches: new Map(),\n                held: new Map(),\n                within: new Map(),\n                pinning: new Map(),\n                placements: new Map(),\n                unwatch: undefined,\n            };\n            this.snapshots.set(key, snapshot);\n        }\n        if (snapshot.unwatch === undefined && this.api !== null) {\n            const followed = snapshot;\n            const told = (hash: string | null): void => this.moveTo(workspace, path, followed, hash, true);\n            snapshot.told = told;\n            snapshot.unwatch = this.api.watchRevision(workspace, path, told);\n        }\n        return snapshot;\n    }\n\n    /**\n     * A dataset its readers have all let go stops being followed, so nothing\n     * polls for it: every read tracks its revision channel, and a reader lets\n     * the channel go as it unmounts. What its snapshot delivered stays, and a\n     * read follows it again — moved at the first report if the dataset moved\n     * meanwhile.\n     */\n    protected override unsubscribed(key: string): void {\n        // A read no reader waits on any longer is aborted while still in flight (#1398, CL6): a window that left the\n        // demand ring, a period read a newer navigation superseded. A reader re-subscribing lets every channel go\n        // before it subscribes again, so the fetch goes only if nothing reads it once that is done.\n        if (this.fetching.has(key)) {\n            queueMicrotask(() => { if (!this.isSubscribed(key)) this.abortFetch(key); });\n        }\n        // What the channel holds that no reader waits on goes too, once the reader re-subscribing has done so (#1351).\n        queueMicrotask(() => this.letGo(key));\n        const snapshot = this.snapshots.get(key);\n        if (snapshot?.unwatch === undefined) return;\n        // A reader re-subscribing lets every channel go before it subscribes\n        // again: the dataset goes only if nothing reads it once that is done.\n        queueMicrotask(() => {\n            if (!this.isLive(snapshot) || this.isSubscribed(key)) return;\n            snapshot.unwatch?.();\n            snapshot.unwatch = undefined;\n            snapshot.told = undefined;\n        });\n    }\n\n    /** Whether a snapshot is still the runtime's, rather than one a clear or a\n     *  re-initialization dropped. */\n    protected isLive(snapshot: Snapshot): boolean {\n        return this.snapshots.get(snapshot.key) === snapshot;\n    }\n\n    /** Whether a live snapshot is still pinned to `revision`. */\n    protected pinnedTo(snapshot: Snapshot, revision: string): boolean {\n        return this.isLive(snapshot) && snapshot.revision === revision;\n    }\n\n    /**\n     * The revision a read of `path` is pinned to — a hash, `null` while the\n     * dataset has no value, or `undefined` while it is being found — tracked so\n     * the read re-fires when the source moves.\n     *\n     * @throws {PagedReadError} The failed lookup's reason, until a read after the retry gap\n     *   looks again\n     */\n    protected revisionFor(workspace: string, path: TreePath): string | null | undefined {\n        this.track(pagedRevisionKey(workspace, path));\n        const snapshot = this.snapshotOf(workspace, path);\n        if (snapshot.revision !== undefined || snapshot.finding) return snapshot.revision;\n        if (snapshot.findError !== undefined && this.now() - (snapshot.findFailedAtMs ?? 0) < RETRY_AFTER_MS) {\n            throw new PagedReadError(snapshot.findError);\n        }\n        this.find(workspace, path, snapshot);\n        return undefined;\n    }\n\n    /**\n     * Ask the server which content the dataset holds, and move there — unless\n     * a move lands first, which came from something no older than the answer.\n     */\n    protected find(workspace: string, path: TreePath, snapshot: Snapshot): void {\n        const seq = ++snapshot.findSeq;\n        const moves = snapshot.moves;\n        snapshot.finding = true;\n        const api = this.api;\n        void (async () => {\n            let revision: string | null;\n            try {\n                if (api === null) throw new Error(\"no PagedApi installed\");\n                revision = await api.getRevision(workspace, path);\n            } catch (err) {\n                if (!this.isLive(snapshot) || snapshot.findSeq !== seq) return;\n                snapshot.finding = false;\n                if (snapshot.revision !== undefined) return;\n                snapshot.findError = failureOf(path, err);\n                snapshot.findFailedAtMs = this.now();\n                console.error(`Data.bindPaged: could not find which content ${datasetPathToString(path)} holds:`, err);\n                this.notify(pagedRevisionKey(workspace, path));\n                return;\n            }\n            if (!this.isLive(snapshot) || snapshot.findSeq !== seq) return;\n            snapshot.finding = false;\n            if (snapshot.moves !== moves) return;\n            this.moveTo(workspace, path, snapshot, revision);\n        })();\n    }\n\n    /**\n     * Move a dataset's source to `revision`: drop what the old snapshot\n     * delivered and re-fire every read of the dataset, so the windows and\n     * searches still in use are fetched again, pinned to the new one. A move to\n     * the revision the source already has changes nothing.\n     *\n     * A move made by evidence of the source's own — an answer's revision\n     * installed, a refusal naming the dataset's state, a lookup — is said to\n     * whoever follows the dataset for it ({@link PagedApi.revisionHeld}), so\n     * the next poll compares the dataset's hash with where the source reads.\n     * A source put at a state the dataset has since left would otherwise\n     * stay there wherever the dataset's hash is the one it was last told:\n     * its pinned reads answered by a browser that kept them, e3 never asked\n     * and so refusing none.\n     *\n     * @param told - Whether the follower itself told the source of `revision`\n     */\n    protected moveTo(workspace: string, path: TreePath, snapshot: Snapshot, revision: string | null, told = false): void {\n        if (!this.isLive(snapshot) || snapshot.revision === revision) return;\n        snapshot.revision = revision;\n        snapshot.moves += 1;\n        if (!told && snapshot.told !== undefined) this.api?.revisionHeld?.(workspace, path, snapshot.told, revision);\n        delete snapshot.findError;\n        delete snapshot.findFailedAtMs;\n        for (const key of snapshot.channels) {\n            // A read of the old revision still in flight lands nowhere (its pin no longer holds): it is no longer the channel's.\n            this.fetching.delete(key);\n            // A read by another record's runs is that record's channel too: it goes from both.\n            for (const owner of this.entries.get(key)?.owners ?? []) if (owner !== snapshot) owner.channels.delete(key);\n            this.entries.delete(key);\n            this.loadedWindows.delete(key);\n            this.cutWindows.delete(key);\n            this.forgetVersion(key);\n        }\n        snapshot.channels.clear();\n        snapshot.searches.clear();\n        snapshot.held.clear();\n        snapshot.within.clear();\n        snapshot.pinning.clear();\n        snapshot.placements.clear();\n        this.notify(pagedRevisionKey(workspace, path));\n    }\n\n    /**\n     * Handle what a pinned fetch threw when it is not the read's failure: a\n     * refusal naming other content moves the source there, and \"no value\"\n     * moves it to no snapshot. Returns whether the error was one of those, or\n     * arrived after the source had already moved on.\n     */\n    protected followed(workspace: string, path: TreePath, snapshot: Snapshot, revision: string, err: unknown): boolean {\n        if (!this.pinnedTo(snapshot, revision)) return true;\n        if (err instanceof DatasetHashMismatchError) {\n            if (err.currentHash !== null && err.currentHash !== revision) {\n                this.moveTo(workspace, path, snapshot, err.currentHash);\n                return true;\n            }\n            // A refusal that names no other content: look it up, and let this\n            // read fail until the lookup moves the source.\n            this.find(workspace, path, snapshot);\n            return false;\n        }\n        const code = errorCode(err);\n        if (code !== undefined && NO_VALUE_ERRORS.has(code)) {\n            this.moveTo(workspace, path, snapshot, null);\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Handle a read by a record's runs refused because the record moved\n     * (#1393), as {@link followed} handles a moved dataset: a refusal naming\n     * other content moves the record there; one naming none looks it up, and\n     * the read fails until the lookup moves it. Returns whether the refusal\n     * moved it, or arrived after it had already moved on.\n     */\n    protected followedRuns(workspace: string, path: TreePath, snapshot: Snapshot, revision: string, err: RunsHashMismatchError): boolean {\n        if (!this.pinnedTo(snapshot, revision)) return true;\n        if (err.currentHash !== null && err.currentHash !== revision) {\n            this.moveTo(workspace, path, snapshot, err.currentHash);\n            return true;\n        }\n        this.find(workspace, path, snapshot);\n        return false;\n    }\n\n    // ----- channels ----------------------------------------------------------\n\n    /** A channel of the snapshot's current revision, dropped when it moves. */\n    protected channel(snapshot: Snapshot, key: string): PageEntry {\n        snapshot.channels.add(key);\n        const entry = this.entry(key);\n        (entry.owners ??= new Set()).add(snapshot);\n        return entry;\n    }\n\n    /**\n     * Let a channel go (#1351): its entry, its place among its snapshots'\n     * channels and the window cache, and — once nothing subscribes to it — its\n     * version. A read of it makes it again, idle, and asks for it afresh.\n     * Never a channel in flight: its callers let go only what no fetch waits on.\n     *\n     * @param key - The channel\n     */\n    protected dropChannel(key: string): void {\n        for (const owner of this.entries.get(key)?.owners ?? []) {\n            owner.channels.delete(key);\n            owner.placements.delete(key);\n        }\n        this.entries.delete(key);\n        this.loadedWindows.delete(key);\n        this.cutWindows.delete(key);\n        this.forgetVersion(key);\n    }\n\n    /**\n     * What a channel no reader holds any longer leaves (#1351), once the\n     * reader re-subscribing has done so: nothing of a channel let go but its\n     * version, which goes; a search's answer, which the revision holds apart\n     * from its channel ({@link Snapshot.searches}), as it holds what batches\n     * answered; and a channel holding nothing — aborted, evicted, or a batch\n     * whose answer is held elsewhere — which goes. A landed window stays,\n     * bounded by the windows retained: held by no reader any longer, it is the\n     * cap's to let go again, and past the cap the least recently read windows\n     * no reader holds go ({@link trimWindows}), so readers that held more than\n     * the cap leave no more than it behind (#1409, R24); a one-row cut stays\n     * bounded by the cuts retained ({@link trimCuts}) as a window is by the\n     * windows. A placement stays, bounded by the placements a revision holds\n     * ({@link MAX_HELD_PLACEMENTS}); and so do a failure and a total.\n     *\n     * @param key - The channel\n     */\n    protected letGo(key: string): void {\n        if (this.isSubscribed(key) || this.fetching.has(key)) return;\n        const entry = this.entries.get(key);\n        if (entry === undefined) {\n            this.forgetVersion(key);\n            return;\n        }\n        if (entry.status === \"loaded\" && entry.range !== undefined) {\n            for (const owner of entry.owners ?? []) landSearch(owner, key, entry.range);\n            this.dropChannel(key);\n            return;\n        }\n        if (holdsNothing(entry)) {\n            this.dropChannel(key);\n            return;\n        }\n        if (this.loadedWindows.has(key)) this.trimWindows();\n        else if (this.cutWindows.has(key)) {\n            // A reader let a cut go, one the last look may have left for its sake: the cuts are looked at again.\n            this.cutsSinceLook = undefined;\n            this.trimCuts();\n        }\n    }\n\n    /** Whether a channel is due a fetch: never fetched, evicted, or failed\n     *  for a reason a retry can fix, longer ago than the retry gap. */\n    protected due(entry: PageEntry): boolean {\n        if (entry.status === \"idle\") return true;\n        if (entry.status !== \"failed\" || entry.permanent === true) return false;\n        return this.now() - (entry.failedAtMs ?? 0) >= RETRY_AFTER_MS;\n    }\n\n    /**\n     * Mark a channel's fetch as started, returning the fetch's sequence number.\n     *\n     * Deliberately does NOT notify — the read that triggers it runs inside a\n     * render pass, and notifying there would re-enter the renderer. Only the\n     * settle notifies.\n     */\n    protected launch(entry: PageEntry): number {\n        entry.status = \"running\";\n        entry.launchSeq = ++this.launches;\n        return entry.launchSeq;\n    }\n\n    /**\n     * Mark a channel's fetch as started, as {@link launch} does, and hand it\n     * the signal that aborts its requests (#1398, CL6): aborted once no read\n     * waits on the channel any longer ({@link unsubscribed}). A fetch it\n     * replaces is aborted. A fetch of a revision the source moves past is\n     * not: the move lets go of it and of its channel, and its answer lands\n     * nowhere, its pin no longer holding ({@link moveTo}).\n     *\n     * @param key - The channel\n     * @param entry - Its entry\n     * @param onAbort - What an abort lets go besides the request: what the fetch kept for its reader as it launched\n     * @returns The fetch's sequence number, and its signal\n     */\n    protected launchFetch(key: string, entry: PageEntry, onAbort?: () => void): { seq: number; signal: AbortSignal } {\n        const seq = this.launch(entry);\n        this.fetching.get(key)?.controller.abort();\n        const controller = new AbortController();\n        this.fetching.set(key, { seq, controller, onAbort });\n        return { seq, signal: controller.signal };\n    }\n\n    /** A channel's fetch is over: what aborts it is let go. */\n    protected forgetFetch(key: string, seq: number): void {\n        if (this.fetching.get(key)?.seq === seq) this.fetching.delete(key);\n    }\n\n    /**\n     * Abort a channel's fetch still in flight, which no read waits on any\n     * longer (#1398, CL6): its requests are cancelled — a request still to be\n     * sent, a retry among them, never is — and the channel goes back to\n     * `idle`, so a read that asks for it again fetches it afresh. Nothing is\n     * notified: no reader is waiting on it.\n     *\n     * @param key - The channel\n     */\n    protected abortFetch(key: string): void {\n        const fetch = this.fetching.get(key);\n        if (fetch === undefined) return;\n        this.fetching.delete(key);\n        fetch.controller.abort();\n        const entry = this.entries.get(key);\n        if (entry !== undefined && entry.launchSeq === fetch.seq && entry.status === \"running\") {\n            entry.status = \"idle\";\n            entry.launchSeq = ++this.launches;\n        }\n        fetch.onAbort?.();\n    }\n\n    /** Apply a fetch's outcome if the channel still waits on it, letting\n     *  the fetch go once the channel has settled. Returns whether it applied. */\n    protected apply(key: string, seq: number, mutate: (entry: PageEntry) => void): boolean {\n        const entry = this.entries.get(key);\n        if (entry === undefined || entry.launchSeq !== seq) return false;\n        mutate(entry);\n        if (entry.status !== \"running\") this.forgetFetch(key, seq);\n        return true;\n    }\n\n    /** Apply a fetch's outcome if the channel still waits on it, re-firing the\n     *  channel's reads. Returns whether it applied. */\n    protected settle(key: string, seq: number, mutate: (entry: PageEntry) => void): boolean {\n        if (!this.apply(key, seq, mutate)) return false;\n        this.notify(key);\n        return true;\n    }\n\n    /** A failed fetch's outcome: the reason a read will throw. */\n    protected failure(reason: string, permanent: boolean): (entry: PageEntry) => void {\n        return (e) => {\n            e.status = \"failed\";\n            e.error = reason;\n            e.failedAtMs = this.now();\n            e.permanent = permanent;\n        };\n    }\n\n    /** Settle a fetch as failed, with the reason a read will throw. */\n    protected fail(key: string, seq: number, reason: string, permanent: boolean): void {\n        this.settle(key, seq, this.failure(reason, permanent));\n    }\n\n    /**\n     * Join this turn's burst of searches of one source's rows (#1360), opening\n     * it with the turn's first. It closes as the turn ends.\n     *\n     * @param family - The rows searched — {@link pagedWindowFamily}\n     * @returns The burst\n     */\n    protected joinBurst(family: string): SearchBurst {\n        let burst = this.bursts.get(family);\n        if (burst === undefined) {\n            const opened: SearchBurst = { open: true, pending: 0, answered: [] };\n            this.bursts.set(family, opened);\n            queueMicrotask(() => {\n                opened.open = false;\n                if (this.bursts.get(family) === opened) this.bursts.delete(family);\n                this.flushBurst(opened);\n            });\n            burst = opened;\n        }\n        burst.pending += 1;\n        return burst;\n    }\n\n    /**\n     * A member of a burst is done: answered, or dropped — by a move, or by a\n     * newer launch on its channel.\n     *\n     * @param burst - Its burst\n     * @param answered - Its channel, when its answer was applied\n     */\n    protected leaveBurst(burst: SearchBurst, answered: string | undefined): void {\n        if (answered !== undefined) burst.answered.push(answered);\n        burst.pending -= 1;\n        this.flushBurst(burst);\n    }\n\n    /** Re-fire every channel a closed burst answered, once its last member is done. */\n    protected flushBurst(burst: SearchBurst): void {\n        if (burst.open || burst.pending > 0 || burst.answered.length === 0) return;\n        this.notifyAll(burst.answered.splice(0));\n    }\n\n    /**\n     * Ask again what failed: an explicit refresh — a Retry — puts every channel\n     * of the snapshot that failed for a reason a retry can fix back to `idle`\n     * and re-fires its readers, so their next read fetches it at once, not\n     * after the retry gap a read alone waits. A permanent failure stays until\n     * the source moves; nothing else is dropped.\n     *\n     * @param snapshot - The source's snapshot\n     */\n    protected rearmFailed(snapshot: Snapshot): void {\n        for (const key of snapshot.channels) {\n            const entry = this.entries.get(key);\n            if (entry === undefined || entry.status !== \"failed\" || entry.permanent === true) continue;\n            entry.status = \"idle\";\n            delete entry.error;\n            delete entry.failedAtMs;\n            this.notify(key);\n        }\n    }\n\n    /**\n     * A Retry of a dataset, following its current state: what failed asked\n     * again now ({@link rearmFailed}), and the content it holds looked up\n     * again — what `refresh` with no target and {@link askAgain} both ask.\n     *\n     * @param workspace - The workspace the Retry was asked in: another one since installed asks nothing\n     * @param path - The dataset's path\n     */\n    protected retryNow(workspace: string, path: TreePath): void {\n        if (this.workspace !== workspace) return;\n        const snapshot = this.snapshotOf(workspace, path);\n        this.rearmFailed(snapshot);\n        this.find(workspace, path, snapshot);\n    }\n\n    /** What a read of a channel answers: its value once loaded, `none` while\n     *  in flight, or its failure, thrown as a {@link PagedReadError}. */\n    protected answer<T>(entry: PageEntry, value: T | undefined): option<T> {\n        if (entry.status === \"loaded\" && value !== undefined) return some(value);\n        if (entry.status === \"failed\") throw new PagedReadError(entry.error ?? \"Data.bindPaged: the read failed\");\n        return none;\n    }\n\n    /** Note a window as most-recently-read, and let the coldest windows no\n     *  reader holds go once more have landed than the cap ({@link trimWindows}). */\n    protected touchWindow(key: string): void {\n        this.loadedWindows.delete(key);\n        this.loadedWindows.set(key, true);\n        this.trimWindows();\n    }\n\n    /**\n     * Keep a one-row window cut from a landed one, or from the row a read by\n     * key holds, apart from the windows (#1596): the most recently read of the\n     * cuts, and one more kept since they were last looked at ({@link trimCuts}).\n     *\n     * @param key - The cut's channel\n     */\n    protected keepCut(key: string): void {\n        this.cutWindows.set(key, true);\n        if (this.cutsSinceLook !== undefined) this.cutsSinceLook += 1;\n    }\n\n    /**\n     * Note a one-row cut as most-recently-read (#1596), and let the coldest no\n     * reader holds go past {@link MAX_RETAINED_CUTS} ({@link trimCuts}). Read\n     * again, one is cut again from what it came from, for nothing.\n     *\n     * @param key - The cut's channel\n     */\n    protected touchCut(key: string): void {\n        this.cutWindows.delete(key);\n        this.cutWindows.set(key, true);\n        this.trimCuts();\n    }\n\n    /**\n     * Past {@link MAX_RETAINED_CUTS} one-row cuts, let the least recently read\n     * that no reader holds go, coldest first, as {@link trimWindows} lets\n     * windows go (#1596).\n     *\n     * A look that leaves more than the cap leaves only cuts a reader holds —\n     * one it subscribes to, or one the read in hand has read, which it\n     * subscribes to as it ends — and each stays held until its reader lets it\n     * go. Looking again meanwhile asks of every one whether a reader holds it,\n     * to let none go, and every read of a cut past the cap is what looks: a\n     * reader of more rows a row at a time than the cap would ask as many times\n     * as its rows, squared, a run. So the cuts are not looked at again until\n     * one may go: a reader lets a cut go ({@link letGo}), or\n     * {@link CUTS_BETWEEN_LOOKS} more have been kept ({@link keepCut}), which\n     * are the only cuts no reader may hold. Until then at most that many cuts\n     * no reader holds stand past the cap.\n     */\n    protected trimCuts(): void {\n        if (this.cutWindows.size <= MAX_RETAINED_CUTS) return;\n        if (this.cutsSinceLook !== undefined && this.cutsSinceLook < CUTS_BETWEEN_LOOKS) return;\n        for (const candidate of [...this.cutWindows.keys()]) {\n            if (this.cutWindows.size <= MAX_RETAINED_CUTS) break;\n            if (this.isTracked(candidate) || this.isSubscribed(candidate)) continue;\n            this.dropChannel(candidate);\n        }\n        this.cutsSinceLook = this.cutWindows.size > MAX_RETAINED_CUTS ? 0 : undefined;\n    }\n\n    /**\n     * Past {@link MAX_RETAINED_WINDOWS} landed windows, let the least recently\n     * read that no reader holds go, whole (#1351), coldest first, until the\n     * cap holds or none is left to go.\n     *\n     * A window a reader holds is never evicted under it: one a reader\n     * subscribes to — what its last run read — and one the evaluation in hand\n     * has read, which it subscribes to as it ends. A read pass longer than the\n     * cap would otherwise evict its own head, find it gone on its next pass and\n     * blank the surface (#581). And evicted while a reader held it, a window\n     * went `idle` without its reader being told, so the reader's next run, set\n     * off by any other landing, read it again: a reader of more windows than\n     * the cap — rows read a key at a time, each a key search and a one-row\n     * window, or windows several readers hold between them — never settled,\n     * each landing evicting one it held (#1409, R24). Past the cap the runtime\n     * keeps what its readers hold alone, each reader bounding that by its own\n     * demand: exceeding a memory target beats a surface that never settles.\n     *\n     * A window still in flight is never evicted either: its settle would land\n     * on an entry the next read has already relaunched.\n     */\n    protected trimWindows(): void {\n        if (this.loadedWindows.size <= MAX_RETAINED_WINDOWS) return;\n        for (const candidate of [...this.loadedWindows.keys()]) {\n            if (this.loadedWindows.size <= MAX_RETAINED_WINDOWS) break;\n            if (this.isTracked(candidate) || this.isSubscribed(candidate)) continue;\n            const entry = this.entries.get(candidate);\n            if (entry === undefined || entry.status !== \"loaded\") continue;\n            this.dropChannel(candidate);\n        }\n    }\n\n    /**\n     * Note a placement as its revision's most recently read, and let the least\n     * recently read go past {@link MAX_HELD_PLACEMENTS} (#1349): a viewer trying\n     * narrowing after narrowing leaves each one's placement behind, which\n     * nothing else lets go while the revision stands. One a reader holds, one\n     * the read in hand has read, and one still in flight stay — the revision\n     * over its bound, rather than a reader's placement asked again.\n     *\n     * @param snapshot - The placement's revision\n     * @param key - The placement's channel\n     */\n    protected touchPlacement(snapshot: Snapshot, key: string): void {\n        snapshot.placements.delete(key);\n        snapshot.placements.set(key, true);\n        if (snapshot.placements.size <= MAX_HELD_PLACEMENTS) return;\n        for (const candidate of [...snapshot.placements.keys()]) {\n            if (snapshot.placements.size <= MAX_HELD_PLACEMENTS) break;\n            if (candidate === key || this.isSubscribed(candidate) || this.isTracked(candidate) || this.fetching.has(candidate)) continue;\n            snapshot.placements.delete(candidate);\n            this.dropChannel(candidate);\n        }\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The paging runtime's second layer: single reads. A window, fetched pinned or\n * answered from a landed one that covers it (#1217); one key search, its answer\n * re-firing its channel with the rest of its burst (#1360); and the rows reads\n * by key hold at a revision, by key and by position, which a later search or\n * one-row window is answered from (#1351).\n *\n * @packageDocumentation\n */\n\nimport { SortedMap, compareFor, fromEastTypeValue, decodeBeast2For, none, parseFor, printFor, some, type EastTypeValue } from \"@elaraai/east\";\nimport type { DatasetPage, DatasetFindQuery, DatasetFindResult } from \"@elaraai/e3-api-client\";\nimport type { TreePath } from \"@elaraai/e3-types\";\n\nimport type { PagedSelector, PagedRow } from \"./api.js\";\nimport { pagedWindowFamily, pagedTotalKey } from \"./keys.js\";\nimport { isPermanentPageError, failureOf } from \"./errors.js\";\nimport { type PageEntry, type Snapshot, type HeldRows, MAX_HELD_ROWS } from \"./state.js\";\nimport { coveringAt, elementCount, cutWindow } from \"./windows.js\";\nimport { PagedChannels } from \"./channels.js\";\n\n/**\n * What a spec watches a paging runtime by (test use only), as the Calendar's\n * frame is watched by its render probe: each landed channel a read looks at as\n * it seeks one that answers it — a window covering the window it reads\n * (#1217), or one holding the key it reads the row of (#1351).\n */\nexport interface PagedRuntimeProbe {\n    /** Called for each landed channel a read looks at. */\n    readonly looked?: () => void;\n}\n\n/** The probe a spec installed; `undefined` outside tests. */\nlet pagedRuntimeProbe: PagedRuntimeProbe | undefined;\n\n/**\n * Install (or clear) the probe every paging runtime is watched by. Test use only.\n *\n * @param probe - What watches the runtimes; `undefined` clears it\n */\nexport function setPagedRuntimeProbe(probe: PagedRuntimeProbe | undefined): void {\n    pagedRuntimeProbe = probe;\n}\n\n/**\n * Single windows and searches over the channels, and the rows reads by key hold: the paging runtime's second layer.\n */\nexport class PagedReads extends PagedChannels {\n    /** Each key type's printer and parser, and each landed Dict window's keys\n     *  in order — what reads by key look keys up by (#1351). */\n    protected readonly printers = new WeakMap<EastTypeValue, (key: unknown) => string>();\n    protected readonly parsers = new WeakMap<EastTypeValue, ReturnType<typeof parseFor>>();\n    protected readonly keysOfWindows = new WeakMap<object, readonly unknown[]>();\n\n    // ----- window loading --------------------------------------------------\n\n    /** Start the pinned fetch for a window if it is due one, returning its\n     *  channel. */\n    protected ensureWindow(\n        sourceType: EastTypeValue,\n        workspace: string,\n        path: TreePath,\n        snapshot: Snapshot,\n        revision: string,\n        offset: number,\n        limit: number,\n        selector: PagedSelector,\n        key: string,\n    ): PageEntry {\n        const entry = this.channel(snapshot, key);\n        if (!this.due(entry)) return entry;\n        const { seq, signal } = this.launchFetch(key, entry);\n        // Where it asked: a read inside it waits on it while it is in flight (#1596).\n        entry.asking = { family: pagedWindowFamily(workspace, path, revision, selector), offset, count: limit };\n        const api = this.api;\n\n        void (async () => {\n            let page: DatasetPage;\n            try {\n                if (api === null) throw new Error(\"no PagedApi installed\");\n                page = await api.getPage(workspace, path, {\n                    offset, limit, hash: revision,\n                    ...(selector.index !== null && { index: selector.index, join: selector.join }),\n                }, signal);\n            } catch (err) {\n                // Aborted: no read waits on it any longer, and its channel is idle again (CL6).\n                if (signal.aborted) return;\n                if (this.followed(workspace, path, snapshot, revision, err)) return;\n                this.fail(key, seq, failureOf(path, err), isPermanentPageError(err));\n                console.error(`Data.bindPaged: fetch failed for ${key}:`, err);\n                return;\n            }\n            if (signal.aborted || !this.pinnedTo(snapshot, revision)) return;\n            let decoded: unknown;\n            try {\n                decoded = decodeBeast2For(sourceType)(page.data);\n            } catch (err) {\n                // A window of this content that does not decode as the\n                // source's type never will.\n                this.fail(key, seq, `${failureOf(path, err)} (the window does not decode as the source's type)`, true);\n                console.error(`Data.bindPaged: decode failed for ${key}:`, err);\n                return;\n            }\n            const count = elementCount(sourceType, decoded);\n            const landed = this.apply(key, seq, (e) => {\n                e.status = \"loaded\";\n                e.window = decoded;\n                e.total = page.totalElements;\n                // Where it sits, by what it holds — a read it covers is answered from it (#1217).\n                if (count !== undefined) e.span = { family: pagedWindowFamily(workspace, path, revision, selector), offset, count };\n                delete e.error;\n            });\n            if (!landed) return;\n            this.touchWindow(key);\n            // Any landed window teaches the revision's total — publish it on\n            // the total's channel so a reader watching `total()` re-fires.\n            const totalKey = pagedTotalKey(workspace, path, revision, selector);\n            const totalEntry = this.channel(snapshot, totalKey);\n            const totalMoved = totalEntry.total !== page.totalElements;\n            if (totalMoved) {\n                totalEntry.total = page.totalElements;\n                totalEntry.status = \"loaded\";\n            }\n            // Its readers hear with the burst it lands in, once a frame (CL9).\n            this.notifyLanded(totalMoved ? [key, totalKey] : [key]);\n        })();\n        return entry;\n    }\n\n    /**\n     * Answer a window from a landed one of its family that covers it — the\n     * same rows at the same revision (#1217), a window's or one run of a runs\n     * read's (#1351): the cut lands in the window's own channel, so it keeps\n     * one identity, and nothing is fetched. The channel is the snapshot's, so\n     * a move drops the cut with every window. Only the landed windows are\n     * looked at — at most {@link MAX_RETAINED_WINDOWS}, or past it what its\n     * readers hold — never every channel of the revision.\n     *\n     * @param sourceType - The source's type\n     * @param family - The window's family\n     * @param offset - The window's first element\n     * @param limit - How many elements it asks for\n     * @param key - The window's channel's key\n     * @param into - The window's channel, not loaded\n     */\n    protected cutFromCovering(\n        sourceType: EastTypeValue, family: string, offset: number, limit: number, key: string, into: PageEntry,\n    ): void {\n        for (const landed of this.loadedWindows.keys()) {\n            pagedRuntimeProbe?.looked?.();\n            const covering = this.entries.get(landed);\n            if (covering === undefined || covering === into || covering.status !== \"loaded\" || covering.window === undefined) continue;\n            const from = coveringAt(covering, family, offset, limit);\n            if (from === undefined) continue;\n            const cut = cutWindow(sourceType, covering.window, from, limit);\n            if (cut === undefined) return;\n            into.status = \"loaded\";\n            into.window = cut;\n            if (covering.total !== undefined) into.total = covering.total;\n            into.span = { family, offset, count: limit };\n            delete into.error;\n            delete into.failedAtMs;\n            delete into.permanent;\n            // A one-row cut is kept apart from the windows it is cut from (#1596); one of more rows is a window of the cap's.\n            if (limit === 1) this.keepCut(key);\n            // The covering window was read, through its cut.\n            this.touchWindow(landed);\n            return;\n        }\n    }\n\n    /**\n     * A window in flight that covers a read of `[offset, offset + limit)` of a\n     * family (#1596): the read waits on it, its rows cut from that window once\n     * it lands, rather than asking for them on its own. Only the reads in\n     * flight are looked at, never every channel of the revision.\n     *\n     * @param family - The read's family\n     * @param offset - The read's first element\n     * @param limit - How many elements it asks for\n     * @param key - The read's own channel\n     * @returns The covering window's channel; `undefined` when no window in flight covers it\n     */\n    protected coveringInFlight(family: string, offset: number, limit: number, key: string): string | undefined {\n        for (const candidate of this.fetching.keys()) {\n            if (candidate === key) continue;\n            const entry = this.entries.get(candidate);\n            const asked = entry?.status === \"running\" ? entry.asking : undefined;\n            if (asked !== undefined && asked.family === family && asked.offset <= offset && offset + limit <= asked.offset + asked.count) return candidate;\n        }\n        return undefined;\n    }\n\n    /** Start the pinned fence search for one key query if it is due one,\n     *  returning its channel — the seek sibling of {@link ensureWindow}. Its\n     *  answer re-fires its channel with the rest of its burst (#1360). */\n    protected ensureSeek(\n        workspace: string,\n        path: TreePath,\n        snapshot: Snapshot,\n        revision: string,\n        selector: PagedSelector,\n        query: DatasetFindQuery,\n        key: string,\n    ): PageEntry {\n        const entry = this.channel(snapshot, key);\n        if (!this.due(entry)) return entry;\n        const { seq, signal } = this.launchFetch(key, entry);\n        const api = this.api;\n        const burst = this.joinBurst(pagedWindowFamily(workspace, path, revision, selector));\n\n        void (async () => {\n            let answered = false;\n            try {\n                let range: DatasetFindResult;\n                try {\n                    if (api === null) throw new Error(\"no PagedApi installed\");\n                    range = await api.findKey(workspace, path, { ...query, hash: revision }, signal);\n                } catch (err) {\n                    if (signal.aborted) return;\n                    if (this.followed(workspace, path, snapshot, revision, err)) return;\n                    answered = this.apply(key, seq, this.failure(failureOf(path, err), isPermanentPageError(err)));\n                    console.error(`Data.bindPaged: key search failed for ${key}:`, err);\n                    return;\n                }\n                if (!this.pinnedTo(snapshot, revision)) return;\n                answered = this.apply(key, seq, (e) => {\n                    e.status = \"loaded\";\n                    e.range = range;\n                    delete e.error;\n                });\n            } finally {\n                // Every way out leaves the burst, so its last member re-fires the rest.\n                this.leaveBurst(burst, answered ? key : undefined);\n            }\n        })();\n        return entry;\n    }\n\n    /** A printer of a key type's East text, built once per type. */\n    protected printerOf(keyType: EastTypeValue): (key: unknown) => string {\n        let print = this.printers.get(keyType);\n        if (print === undefined) {\n            print = printFor(keyType) as (key: unknown) => string;\n            this.printers.set(keyType, print);\n        }\n        return print;\n    }\n\n    /** A parser of a key type's East text, built once per type. */\n    protected parserOf(keyType: EastTypeValue): (text: string) => ReturnType<ReturnType<typeof parseFor>> {\n        let parse = this.parsers.get(keyType);\n        if (parse === undefined) {\n            parse = parseFor(keyType);\n            this.parsers.set(keyType, parse);\n        }\n        return parse;\n    }\n\n    /** The rows a family's reads by key hold, made empty on first use. */\n    protected heldRowsOf(snapshot: Snapshot, family: string, keyType: EastTypeValue): HeldRows {\n        let held = snapshot.held.get(family);\n        if (held === undefined) {\n            held = { byKey: new SortedMap<unknown, PagedRow>(undefined, compareFor(fromEastTypeValue(keyType))), byPosition: new Map() };\n            snapshot.held.set(family, held);\n        }\n        return held;\n    }\n\n    /** Hold a read's rows, each by its key and the dataset's by position too;\n     *  past {@link MAX_HELD_ROWS}, the family's older rows go first. */\n    protected hold(snapshot: Snapshot, family: string, keyType: EastTypeValue, rows: readonly PagedRow[]): void {\n        let held = this.heldRowsOf(snapshot, family, keyType);\n        if (held.byKey.size + rows.length > MAX_HELD_ROWS) {\n            snapshot.held.delete(family);\n            held = this.heldRowsOf(snapshot, family, keyType);\n        }\n        for (const row of rows) {\n            held.byKey.set(row.key, row);\n            if (row.row.type === \"some\") held.byPosition.set(row.position, row);\n        }\n    }\n\n    /** The row a landed Dict window of a family holds under a key — or the\n     *  key's absence, when the window's span takes it in — and its position.\n     *  Only the landed windows are looked at, never every channel of the\n     *  revision. */\n    protected rowInWindows(family: string, keyType: EastTypeValue, key: unknown): PagedRow | undefined {\n        const cmp = compareFor(fromEastTypeValue(keyType)) as (a: unknown, b: unknown) => number;\n        for (const channelKey of this.loadedWindows.keys()) {\n            pagedRuntimeProbe?.looked?.();\n            const entry = this.entries.get(channelKey);\n            const span = entry?.span;\n            if (entry === undefined || entry.status !== \"loaded\" || entry.window === undefined || span === undefined || span.family !== family) continue;\n            const keys = this.windowKeys(entry.window as ReadonlyMap<unknown, unknown>);\n            if (keys.length === 0 || cmp(key, keys[0]) < 0 || cmp(key, keys[keys.length - 1]) > 0) continue;\n            let lo = 0;\n            let hi = keys.length;\n            while (lo < hi) {\n                const mid = (lo + hi) >> 1;\n                if (cmp(keys[mid], key) < 0) lo = mid + 1;\n                else hi = mid;\n            }\n            const window = entry.window as ReadonlyMap<unknown, unknown>;\n            return cmp(keys[lo], key) === 0\n                ? { key: keys[lo], row: some(window.get(keys[lo])), position: span.offset + lo }\n                : { key, row: none, position: span.offset + lo };\n        }\n        return undefined;\n    }\n\n    /** A Dict window's keys, in order, listed once per window. */\n    protected windowKeys(window: ReadonlyMap<unknown, unknown>): readonly unknown[] {\n        let keys = this.keysOfWindows.get(window);\n        if (keys === undefined) {\n            keys = [...window.keys()];\n            this.keysOfWindows.set(window, keys);\n        }\n        return keys;\n    }\n\n    /** The row a family's reads by key hold under a key's East text, when they\n     *  hold one — what a search by the key answers from (#1351). */\n    protected heldRow(snapshot: Snapshot, family: string, sourceType: EastTypeValue, literal: string): PagedRow | undefined {\n        if (sourceType.type !== \"Dict\") return undefined;\n        const held = snapshot.held.get(family);\n        if (held === undefined) return undefined;\n        const parsed = this.parserOf((sourceType.value as { key: EastTypeValue }).key)(literal);\n        return parsed.success ? held.byKey.get(parsed.value) : undefined;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The paging runtime's third layer: batched reads (#1351). Several reads of one\n * source asked as ONE request and ONE channel, named by a digest of what it\n * asks: a batch of key searches (`seekAll`), the rows of several keys of a Dict\n * (`rowsAll`), a Dict's rows under the keys some runs of a record's index name\n * (`joinAll`, #1393), the entries of several runs (`runsAll`), where a\n * narrowing's runs sit in its record (`placeAll`, #1349) and which entries they\n * hold (`withinAll`). What a batch answers serves the single reads too.\n *\n * @packageDocumentation\n */\n\nimport { fromEastTypeValue, decodeBeast2For, none, some, type EastTypeValue, type option } from \"@elaraai/east\";\nimport {\n    RunsHashMismatchError, DATASET_BATCH_MAX, type DatasetPlacement, type DatasetFindQuery, type DatasetFindResult,\n} from \"@elaraai/e3-api-client\";\nimport { datasetRowsType, type TreePath } from \"@elaraai/e3-types\";\n\nimport { datasetPathToString } from \"../dataset-store.js\";\nimport type { PagedSelector, PagedSource, PagedRow, PagedRun, PagedPlacedSegment, PagedPlacement } from \"./api.js\";\nimport { NO_INDEX, pagedRevisionKey, pagedWindowFamily, seekKeyIn, seekQueryText, pagedBatchKey, withinFamily, searchOf } from \"./keys.js\";\nimport { isPermanentPageError, failureOf } from \"./errors.js\";\nimport {\n    type RunSpans, type Snapshot, landSearch, heldSearch, PLACE_CONCURRENCY, MAX_WITHIN_KEYS, heldWithinOf, keepWithin, releaseWithin, readWithin,\n    trimWithin,\n} from \"./state.js\";\nimport { elementCount, runsAfter, joinWindows } from \"./windows.js\";\nimport { PagedReads } from \"./reads.js\";\n\n/**\n * The batched reads over the single ones: the paging runtime's third layer.\n */\nexport class PagedBatches extends PagedReads {\n    // ----- batches (#1351) -------------------------------------------------\n\n    /**\n     * Several key searches of one source's rows, read as ONE request and ONE\n     * channel (#1351): each query's bounds, as `seek` answers them, in the order\n     * asked — `none` while any is in flight.\n     *\n     * @remarks\n     * The batch is one channel, named by a digest of what it asks, which\n     * holds its answer — every query's bounds, in order — kept as a landed\n     * window is, bounded with them. A query the runtime already holds — one a\n     * search's channel holds, or the revision holds apart from a channel\n     * ({@link Snapshot.searches}) — is answered from it; the rest go in one\n     * `findKeys` request (one for each {@link DATASET_BATCH_MAX} of them), whose\n     * readers track the batch's channel. As the answer lands, each query's\n     * bounds go into a search's channel waiting on it and among those the\n     * revision holds — the last {@link MAX_LANDED_SEARCHES} of them — so a\n     * search asked later answers from them, and the batch's channel re-fires\n     * once, with every reader waiting on one of its queries. A reader walking\n     * on leaves no search of its own behind: what it asked goes with its\n     * batch's channel, and its searches' bounds with the least recently used.\n     *\n     * @param source - The rows searched: a dataset's own, or one of a record's indexes\n     * @param queries - The searches, as e3's wire takes them; their index is the source's\n     * @returns Each search's bounds, in order, once every one has landed\n     * @throws The batch's failure, until a read after the retry gap asks again\n     */\n    seekAll(source: PagedSource, queries: readonly DatasetFindQuery[]): option<DatasetFindResult[]> {\n        const workspace = this.resolveWorkspace();\n        const { path, selector } = source;\n        const revision = this.revisionFor(workspace, path);\n        if (typeof revision !== \"string\") return none;\n        const snapshot = this.snapshotOf(workspace, path);\n        const texts = queries.map(seekQueryText);\n        const batchKey = pagedBatchKey(workspace, path, revision, selector, \"seekAll\", texts);\n        this.track(batchKey);\n        const batch = this.channel(snapshot, batchKey);\n        if (batch.status === \"loaded\" && batch.ranges !== undefined) {\n            this.touchWindow(batchKey);\n            return some(batch.ranges);\n        }\n        const family = pagedWindowFamily(workspace, path, revision, selector);\n        const keys = texts.map((text) => seekKeyIn(family, text));\n        const known = keys.map((key) => this.landedSearch(snapshot, key));\n        if (known.every((range): range is DatasetFindResult => range !== undefined)) {\n            // Every search is held already: the answer is what is held, kept on the batch's channel for its reader.\n            batch.status = \"loaded\";\n            batch.ranges = known;\n            delete batch.error;\n            this.touchWindow(batchKey);\n            return some(known);\n        }\n        if (this.due(batch)) this.launchSeekBatch(workspace, path, snapshot, revision, selector, batchKey, queries, keys, known);\n        return this.answer(batch, batch.ranges);\n    }\n\n    /** A search's bounds the runtime holds: its channel's, or what the revision holds apart from a channel. */\n    protected landedSearch(snapshot: Snapshot, key: string): DatasetFindResult | undefined {\n        const own = this.entries.get(key);\n        if (own?.status === \"loaded\" && own.range !== undefined) return own.range;\n        return heldSearch(snapshot, key);\n    }\n\n    /**\n     * Launch a batch's key searches not already held: one request for each\n     * {@link DATASET_BATCH_MAX} of them, the answers landing together on the\n     * batch's channel beside those held as it launched.\n     */\n    protected launchSeekBatch(\n        workspace: string,\n        path: TreePath,\n        snapshot: Snapshot,\n        revision: string,\n        selector: PagedSelector,\n        batchKey: string,\n        queries: readonly DatasetFindQuery[],\n        keys: readonly string[],\n        known: readonly (DatasetFindResult | undefined)[],\n    ): void {\n        const { seq, signal } = this.launchFetch(batchKey, this.channel(snapshot, batchKey));\n        const api = this.api;\n        const asked = known.flatMap((range, i) => (range === undefined ? [i] : []));\n        void (async () => {\n            const answers: DatasetFindResult[] = [];\n            try {\n                if (api === null) throw new Error(\"no PagedApi installed\");\n                for (let at = 0; at < asked.length; at += DATASET_BATCH_MAX) {\n                    const { results, hash } = await api.findKeys(workspace, path, {\n                        queries: asked.slice(at, at + DATASET_BATCH_MAX).map((i) => searchOf(queries[i]!)),\n                        hash: revision,\n                        ...(selector.index !== null && { index: selector.index }),\n                    }, signal);\n                    for (const result of results) answers.push({ ...result, hash });\n                }\n            } catch (err) {\n                if (signal.aborted) return;\n                if (this.followed(workspace, path, snapshot, revision, err)) return;\n                this.fail(batchKey, seq, failureOf(path, err), isPermanentPageError(err));\n                console.error(`Data.bindPaged: key searches failed for ${batchKey}:`, err);\n                return;\n            }\n            if (!this.pinnedTo(snapshot, revision)) return;\n            if (answers.length !== asked.length) {\n                this.fail(batchKey, seq, `Data.bindPaged: ${datasetPathToString(path)}: ${asked.length} key searches were asked, and ${answers.length} answered`, true);\n                return;\n            }\n            const ranges = [...known] as DatasetFindResult[];\n            for (const [n, i] of asked.entries()) ranges[i] = answers[n]!;\n            if (!this.apply(batchKey, seq, (e) => { e.status = \"loaded\"; e.ranges = ranges; delete e.error; })) return;\n            this.touchWindow(batchKey);\n            // Each answer serves a later search of it: a search's channel waiting on it, and what the revision holds.\n            const answered = [batchKey];\n            for (const [n, i] of asked.entries()) {\n                const key = keys[i]!;\n                landSearch(snapshot, key, answers[n]!);\n                const own = this.entries.get(key);\n                if (own === undefined) continue;\n                own.status = \"loaded\";\n                own.range = answers[n]!;\n                delete own.error;\n                answered.push(key);\n            }\n            this.notifyAll(answered);\n        })();\n    }\n\n    /**\n     * The rows a Dict source holds under several keys, read as ONE request and\n     * ONE channel (#1351): each key's row, or its absence, and its position in\n     * the source's canonical order, in the order asked — `none` while the read\n     * is in flight.\n     *\n     * @remarks\n     * A key the runtime already holds — a row an earlier read by key answered,\n     * or a key a landed window of the same rows holds — is answered from what it\n     * holds, and the rest go in one rows request: the server holds an answer to\n     * its byte budget, and what it did not reach is asked again until every key\n     * is answered. Each row is held at its position, so a later read by its key\n     * — a search by the key, then a one-row page at its row — answers from it,\n     * with no request.\n     *\n     * @param source - A Dict dataset's own rows\n     * @param keys - The keys, as East values of the key type\n     * @returns Each key's row, in order, once every one is known\n     * @throws The read's failure, until a read after the retry gap asks again;\n     *   at once, for a source that is not a Dict's own rows\n     */\n    rowsAll(source: PagedSource, keys: readonly unknown[]): option<readonly PagedRow[]> {\n        if (source.selector.index !== null || source.type.type !== \"Dict\") {\n            throw new Error(\"Data.bindPaged: a read of rows by key reads a Dict dataset's own rows, never an index's or another collection's\");\n        }\n        const workspace = this.resolveWorkspace();\n        const { path, selector } = source;\n        const revision = this.revisionFor(workspace, path);\n        if (typeof revision !== \"string\") return none;\n        const snapshot = this.snapshotOf(workspace, path);\n        const keyType = (source.type.value as { key: EastTypeValue }).key;\n        // Each key printed alone: `map` hands a callback its index too, which a printer reads as its print context.\n        const print = this.printerOf(keyType);\n        const literals = keys.map((key) => print(key));\n        const batchKey = pagedBatchKey(workspace, path, revision, selector, \"rows\", literals);\n        this.track(batchKey);\n        const batch = this.channel(snapshot, batchKey);\n        if (batch.status === \"loaded\" && batch.rows !== undefined) {\n            this.touchWindow(batchKey);\n            return some(batch.rows);\n        }\n        const family = pagedWindowFamily(workspace, path, revision, selector);\n        const held = this.heldRowsOf(snapshot, family, keyType);\n        const known = keys.map((key) => held.byKey.get(key) ?? this.rowInWindows(family, keyType, key));\n        if (known.every((row): row is PagedRow => row !== undefined)) {\n            // Every key is held already: the answer is what is held.\n            batch.status = \"loaded\";\n            batch.rows = known;\n            this.touchWindow(batchKey);\n            return some(known);\n        }\n        if (this.due(batch)) this.launchRowsBatch(workspace, path, snapshot, revision, source.type, batchKey, literals, known);\n        return this.answer(batch, batch.rows);\n    }\n\n    /** Launch a rows read for the keys not already held, asking again for what\n     *  each answer's budget did not reach. */\n    protected launchRowsBatch(\n        workspace: string,\n        path: TreePath,\n        snapshot: Snapshot,\n        revision: string,\n        sourceType: EastTypeValue,\n        batchKey: string,\n        literals: readonly string[],\n        known: readonly (PagedRow | undefined)[],\n    ): void {\n        const { seq, signal } = this.launchFetch(batchKey, this.channel(snapshot, batchKey));\n        const api = this.api;\n        const { key: keyType, value: rowType } = sourceType.value as { key: EastTypeValue; value: EastTypeValue };\n        const decode = decodeBeast2For(datasetRowsType(fromEastTypeValue(keyType), fromEastTypeValue(rowType))) as\n            (bytes: Uint8Array) => { key: unknown; row: option<unknown>; position: bigint }[];\n        void (async () => {\n            const rows = [...known];\n            const asked = rows.flatMap((row, i) => (row === undefined ? [i] : []));\n            try {\n                if (api === null) throw new Error(\"no PagedApi installed\");\n                for (let next = 0; next < asked.length;) {\n                    const chunk = asked.slice(next, next + DATASET_BATCH_MAX);\n                    const answer = await api.getRows(workspace, path, { keys: chunk.map((i) => literals[i]!), hash: revision }, signal);\n                    const decoded = decode(answer.data);\n                    if (answer.count < 1 || decoded.length !== answer.count) {\n                        throw new Error(`a read of ${chunk.length} rows by key answered ${decoded.length}, and said ${answer.count}`);\n                    }\n                    for (const [n, entry] of decoded.entries()) {\n                        rows[chunk[n]!] = { key: entry.key, row: entry.row, position: Number(entry.position) };\n                    }\n                    next += answer.count;\n                }\n            } catch (err) {\n                if (signal.aborted) return;\n                if (this.followed(workspace, path, snapshot, revision, err)) return;\n                this.fail(batchKey, seq, failureOf(path, err), isPermanentPageError(err));\n                console.error(`Data.bindPaged: read by key failed for ${batchKey}:`, err);\n                return;\n            }\n            if (!this.pinnedTo(snapshot, revision)) return;\n            const answered = rows as PagedRow[];\n            if (!this.apply(batchKey, seq, (e) => { e.status = \"loaded\"; e.rows = answered; delete e.error; })) return;\n            this.hold(snapshot, pagedWindowFamily(workspace, path, revision, NO_INDEX), keyType, answered);\n            this.touchWindow(batchKey);\n            this.notify(batchKey);\n        })();\n    }\n\n    /**\n     * The rows a Dict source holds under the keys the entries of some runs of\n     * one of a record's indexes name, read as ONE request and ONE channel\n     * (#1393): each entry's key, the Dict's row under it or its absence, and\n     * its position in the Dict, in the runs' order — `none` while the read is\n     * in flight. The server reads the keys from the index: none is sent.\n     *\n     * @remarks\n     * The read is pinned to both datasets' revisions, and its channel is both\n     * snapshots', so a move of either drops it and the reader asks again at\n     * the new one; a refusal naming either's new content moves that one. The\n     * server holds an answer to a page's bounds, and the runs' rest is asked\n     * again until every entry is answered. Each row is held at its position,\n     * as a read by key's are, so a later read by its key answers from it.\n     *\n     * @param dict - A Dict dataset's own rows: the rows read\n     * @param of - One of a record's indexes: the runs' rows, whose entries name the keys\n     * @param runs - The runs: ascending, disjoint, each inside the index\n     * @returns Each entry's row, in the runs' order, once every one is known\n     * @throws The read's failure, until a read after the retry gap asks again;\n     *   at once, for a source that is not a Dict's own rows, or runs of no index\n     */\n    joinAll(dict: PagedSource, of: PagedSource, runs: readonly PagedRun[]): option<readonly PagedRow[]> {\n        if (dict.selector.index !== null || dict.type.type !== \"Dict\") {\n            throw new Error(\"Data.bindPaged: a read of rows by runs reads a Dict dataset's own rows, never an index's or another collection's\");\n        }\n        const index = of.selector.index;\n        if (index === null) throw new Error(\"Data.bindPaged: a read of rows by runs reads the keys an index's entries name: name one of a record's indexes\");\n        const workspace = this.resolveWorkspace();\n        const revision = this.revisionFor(workspace, dict.path);\n        const runsRevision = this.revisionFor(workspace, of.path);\n        if (typeof revision !== \"string\" || typeof runsRevision !== \"string\") return none;\n        const snapshot = this.snapshotOf(workspace, dict.path);\n        const runsSnapshot = this.snapshotOf(workspace, of.path);\n        const batchKey = pagedBatchKey(workspace, dict.path, revision, dict.selector, \"joins\",\n            [datasetPathToString(of.path), index, runsRevision, ...runs.map(([row, count]) => `${row}+${count}`)]);\n        this.track(batchKey);\n        // The channel is both snapshots': a move of either drops it.\n        this.channel(runsSnapshot, batchKey);\n        const batch = this.channel(snapshot, batchKey);\n        if (batch.status === \"loaded\" && batch.rows !== undefined) {\n            this.touchWindow(batchKey);\n            return some(batch.rows);\n        }\n        if (this.due(batch)) this.launchJoins(workspace, dict, snapshot, revision, of, index, runsSnapshot, runsRevision, batchKey, runs);\n        return this.answer(batch, batch.rows);\n    }\n\n    /** Launch a read of a Dict's rows by a record's runs, asking again for the\n     *  entries each answer's bounds did not reach. */\n    protected launchJoins(\n        workspace: string,\n        dict: PagedSource,\n        snapshot: Snapshot,\n        revision: string,\n        of: PagedSource,\n        index: string,\n        runsSnapshot: Snapshot,\n        runsRevision: string,\n        batchKey: string,\n        runs: readonly PagedRun[],\n    ): void {\n        const { seq, signal } = this.launchFetch(batchKey, this.channel(snapshot, batchKey));\n        const api = this.api;\n        const { key: keyType, value: rowType } = dict.type.value as { key: EastTypeValue; value: EastTypeValue };\n        const decode = decodeBeast2For(datasetRowsType(fromEastTypeValue(keyType), fromEastTypeValue(rowType))) as\n            (bytes: Uint8Array) => { key: unknown; row: option<unknown>; position: bigint }[];\n        void (async () => {\n            const rows: PagedRow[] = [];\n            try {\n                if (api === null) throw new Error(\"no PagedApi installed\");\n                for (let rest: PagedRun[] = [...runs]; rest.length > 0;) {\n                    const chunk = rest.slice(0, DATASET_BATCH_MAX);\n                    const answer = await api.getRows(workspace, dict.path,\n                        { keysOf: { path: of.path, index, runs: chunk, hash: runsRevision }, hash: revision }, signal);\n                    const decoded = decode(answer.data);\n                    if (answer.count < 1 || decoded.length !== answer.count) {\n                        throw new Error(`a read of rows by ${chunk.length} runs answered ${decoded.length}, and said ${answer.count}`);\n                    }\n                    for (const entry of decoded) rows.push({ key: entry.key, row: entry.row, position: Number(entry.position) });\n                    rest = [...runsAfter(chunk, answer.count), ...rest.slice(DATASET_BATCH_MAX)];\n                }\n            } catch (err) {\n                if (signal.aborted) return;\n                // The record moved under its runs, or the Dict under its pin: the one that moved is followed.\n                if (err instanceof RunsHashMismatchError) {\n                    if (this.followedRuns(workspace, of.path, runsSnapshot, runsRevision, err)) return;\n                } else if (this.followed(workspace, dict.path, snapshot, revision, err)) {\n                    return;\n                }\n                this.fail(batchKey, seq, failureOf(dict.path, err), isPermanentPageError(err));\n                console.error(`Data.bindPaged: read of rows by runs failed for ${batchKey}:`, err);\n                return;\n            }\n            if (!this.pinnedTo(snapshot, revision) || !this.pinnedTo(runsSnapshot, runsRevision)) return;\n            if (!this.apply(batchKey, seq, (e) => { e.status = \"loaded\"; e.rows = rows; delete e.error; })) return;\n            this.hold(snapshot, pagedWindowFamily(workspace, dict.path, revision, NO_INDEX), keyType, rows);\n            this.touchWindow(batchKey);\n            this.notify(batchKey);\n        })();\n    }\n\n    /**\n     * The revision a source's reads are pinned to now (#1393): what a reader\n     * keeps what it read of the source under, so a move reads it again — a\n     * tracked read, which re-fires as the source moves.\n     *\n     * @param source - The source\n     * @returns Its dataset's revision; none while it is found, or while the dataset has no value\n     * @throws The failed lookup's reason, until a read after the retry gap looks again\n     */\n    revisionOf(source: PagedSource): option<string> {\n        const revision = this.revisionFor(this.resolveWorkspace(), source.path);\n        return typeof revision === \"string\" ? some(revision) : none;\n    }\n\n    /**\n     * Ask again what failed of a source (#1510): the Retry of a reader that\n     * holds the source alone, not the pinned handle whose `refresh` asks it —\n     * a read by key's ({@link rowsAll}) among what it asks again. What failed\n     * of its dataset for a reason a retry can fix is asked again at once, not\n     * after the retry gap a read alone waits, and the content it holds is\n     * looked up again, as `refresh` asks them. Deferred, as `refresh` is: a\n     * Retry asked while a view renders never re-fires that render from\n     * inside it. With no paging service installed there is nothing to ask.\n     *\n     * @param source - The source\n     */\n    askAgain(source: PagedSource): void {\n        const workspace = this.workspace;\n        if (workspace === null) return;\n        queueMicrotask(() => this.retryNow(workspace, source.path));\n    }\n\n    /**\n     * The entries of several runs of a source's rows, read as ONE request and\n     * ONE channel (#1351): one window of the source's type holding exactly the\n     * runs' entries, in order — `none` while the read is in flight.\n     *\n     * @remarks\n     * The server holds an answer to a page's bounds, and the runs' rest is asked\n     * again until every entry has landed, the parts joined in order. The window\n     * is kept as a landed window is, bounded with them, and a window of the same\n     * rows inside one of its runs is answered from it, as from a landed window\n     * that covers it (#1217).\n     *\n     * @param source - The rows read: a dataset's own, or one of a record's\n     *   indexes, joined as its selector says\n     * @param runs - The runs: ascending, disjoint, each inside the source\n     * @returns The window, once every entry has landed\n     * @throws The read's failure, until a read after the retry gap asks again\n     */\n    runsAll(source: PagedSource, runs: readonly PagedRun[]): option<unknown> {\n        const workspace = this.resolveWorkspace();\n        const { path, selector } = source;\n        const revision = this.revisionFor(workspace, path);\n        if (typeof revision !== \"string\") return none;\n        const snapshot = this.snapshotOf(workspace, path);\n        const batchKey = pagedBatchKey(workspace, path, revision, selector, \"runs\", runs.map(([row, count]) => `${row}+${count}`));\n        this.track(batchKey);\n        const batch = this.channel(snapshot, batchKey);\n        if (batch.status === \"loaded\" && batch.window !== undefined) {\n            this.touchWindow(batchKey);\n            return some(batch.window);\n        }\n        if (this.due(batch)) this.launchRunsBatch(workspace, path, snapshot, revision, source, batchKey, runs);\n        return this.answer(batch, batch.window);\n    }\n\n    /** Launch a runs read, asking again for the entries each answer's bounds\n     *  did not reach. */\n    protected launchRunsBatch(\n        workspace: string,\n        path: TreePath,\n        snapshot: Snapshot,\n        revision: string,\n        source: PagedSource,\n        batchKey: string,\n        runs: readonly PagedRun[],\n    ): void {\n        const { seq, signal } = this.launchFetch(batchKey, this.channel(snapshot, batchKey));\n        const api = this.api;\n        const { selector } = source;\n        const decode = decodeBeast2For(source.type);\n        void (async () => {\n            const parts: unknown[] = [];\n            try {\n                if (api === null) throw new Error(\"no PagedApi installed\");\n                for (let rest: PagedRun[] = [...runs]; rest.length > 0;) {\n                    const chunk = rest.slice(0, DATASET_BATCH_MAX);\n                    const answer = await api.getRuns(workspace, path, {\n                        runs: chunk, hash: revision,\n                        ...(selector.index !== null && { index: selector.index, join: selector.join }),\n                    }, signal);\n                    const part = decode(answer.data);\n                    if (answer.count < 1 || elementCount(source.type, part) !== answer.count) {\n                        throw new Error(`a read of runs answered ${elementCount(source.type, part)} entries, and said ${answer.count}`);\n                    }\n                    parts.push(part);\n                    rest = [...runsAfter(chunk, answer.count), ...rest.slice(DATASET_BATCH_MAX)];\n                }\n            } catch (err) {\n                if (signal.aborted) return;\n                if (this.followed(workspace, path, snapshot, revision, err)) return;\n                this.fail(batchKey, seq, failureOf(path, err), isPermanentPageError(err));\n                console.error(`Data.bindPaged: read of runs failed for ${batchKey}:`, err);\n                return;\n            }\n            if (!this.pinnedTo(snapshot, revision)) return;\n            const window = joinWindows(source.type, parts);\n            // Where each run's entries sit, so a read inside one is answered from them.\n            let at = 0;\n            const spans = runs.map(([row, count]) => { const span = { row, count, at }; at += count; return span; });\n            const runSpans: RunSpans = { family: pagedWindowFamily(workspace, path, revision, selector), runs: spans };\n            if (!this.apply(batchKey, seq, (e) => { e.status = \"loaded\"; e.window = window; e.runSpans = runSpans; delete e.error; })) return;\n            this.touchWindow(batchKey);\n            // A window across a narrowing's runs is a window: its readers hear with the burst it lands in, once a frame (CL9).\n            this.notifyLanded([batchKey]);\n        })();\n    }\n\n    /**\n     * Where a narrowing's runs of one of a record's indexes sit in the record\n     * (#1349): how many of the runs' entries each record segment holds, placed\n     * a window at a time and drawn as the windows land.\n     *\n     * @remarks\n     * The first window learns how many entries the server places in one, and\n     * the rest are asked {@link PLACE_CONCURRENCY} at a time from there; a\n     * window placed short leaves the rest of it to ask again. Runs past a\n     * request's {@link DATASET_BATCH_MAX} are placed a group at a time. A\n     * narrowing's runs name each row once, so the windows' placements add up,\n     * segment by segment. The channel re-fires as each window lands, its\n     * placement `complete` once the last has. The revision holds the placements\n     * of at most {@link MAX_HELD_PLACEMENTS} narrowings, the least recently read\n     * going first — never one a reader holds — so a viewer trying narrowing\n     * after narrowing leaves no more behind.\n     *\n     * @param source - One of a record's indexes, the runs' rows\n     * @param runs - The narrowing's runs: ascending, disjoint, each inside the index\n     * @returns What is placed so far, once the first window has landed\n     * @throws The placement's failure, until a read after the retry gap asks again;\n     *   at once, for a source that is no record's index\n     */\n    placeAll(source: PagedSource, runs: readonly PagedRun[]): option<PagedPlacement> {\n        const index = source.selector.index;\n        if (index === null) throw new Error(\"Data.bindPaged: a placement places runs of one of a record's indexes\");\n        const workspace = this.resolveWorkspace();\n        const { path, selector } = source;\n        const revision = this.revisionFor(workspace, path);\n        if (typeof revision !== \"string\") return none;\n        const snapshot = this.snapshotOf(workspace, path);\n        const batchKey = pagedBatchKey(workspace, path, revision, selector, \"place\", runs.map(([row, count]) => `${row}+${count}`));\n        this.track(batchKey);\n        const batch = this.channel(snapshot, batchKey);\n        this.touchPlacement(snapshot, batchKey);\n        if (this.due(batch)) this.launchPlacement(workspace, path, snapshot, revision, index, batchKey, runs);\n        if (batch.status === \"failed\") return this.answer<PagedPlacement>(batch, undefined);\n        return batch.placement === undefined ? none : some(batch.placement);\n    }\n\n    /** Launch a placement: its windows, {@link PLACE_CONCURRENCY} at a time,\n     *  each answer added in as it lands. */\n    protected launchPlacement(\n        workspace: string,\n        path: TreePath,\n        snapshot: Snapshot,\n        revision: string,\n        index: string,\n        batchKey: string,\n        runs: readonly PagedRun[],\n    ): void {\n        const batch = this.channel(snapshot, batchKey);\n        // A placement asked again — aborted, or failed — starts afresh: what the last one placed is not this one's, and\n        // its first window would take the count back below it.\n        delete batch.placement;\n        const { seq, signal } = this.launchFetch(batchKey, batch);\n        const api = this.api;\n        const entries = runs.reduce((sum, [, count]) => sum + count, 0);\n        void (async () => {\n            const held = new Map<number, PagedPlacedSegment>();\n            let placed = 0;\n            let total = 0;\n            /** Add a window's answer in, and re-fire the placement's readers. */\n            const land = (answer: DatasetPlacement): boolean => {\n                for (const segment of answer.segments) {\n                    const known = held.get(segment.segment);\n                    held.set(segment.segment, known === undefined ? { ...segment } : { ...known, rows: known.rows + segment.rows });\n                }\n                placed += answer.placed;\n                total = answer.totalElements;\n                const placement: PagedPlacement = {\n                    segments: [...held.values()].sort((a, b) => a.segment - b.segment), placed, entries, total, complete: placed === entries,\n                };\n                return this.settle(batchKey, seq, (e) => {\n                    e.placement = placement;\n                    if (placement.complete) { e.status = \"loaded\"; delete e.error; }\n                });\n            };\n            try {\n                if (api === null) throw new Error(\"no PagedApi installed\");\n                // No runs are one group, placing nothing, whose answer says how many rows the record holds.\n                const groups: (readonly PagedRun[])[] = [];\n                for (let at = 0; at < runs.length; at += DATASET_BATCH_MAX) groups.push(runs.slice(at, at + DATASET_BATCH_MAX));\n                if (groups.length === 0) groups.push([]);\n                for (const group of groups) {\n                    const groupEntries = group.reduce((sum, [, count]) => sum + count, 0);\n                    // The first window says how many entries a window places.\n                    const first = await api.place(workspace, path, { index, runs: group, offset: 0, hash: revision }, signal);\n                    if (signal.aborted || !this.pinnedTo(snapshot, revision) || !land(first)) return;\n                    if (first.placed < 1 && groupEntries > 0) throw new Error(\"a placement placed no entry of runs that hold some\");\n                    const width = first.placed;\n                    // What is left to place, as stretches of the runs' entries.\n                    const left: [number, number][] = first.placed < groupEntries ? [[first.placed, groupEntries]] : [];\n                    while (left.length > 0) {\n                        const asked: [number, number][] = [];\n                        while (asked.length < PLACE_CONCURRENCY && left.length > 0) {\n                            const [from, to] = left[0]!;\n                            const until = Math.min(to, from + width);\n                            asked.push([from, until]);\n                            if (until === to) left.shift();\n                            else left[0] = [until, to];\n                        }\n                        const answers = await Promise.all(asked.map(([from, until]) =>\n                            api.place(workspace, path, { index, runs: group, offset: from, limit: until - from, hash: revision }, signal)));\n                        if (signal.aborted || !this.pinnedTo(snapshot, revision)) return;\n                        for (const [k, answer] of answers.entries()) {\n                            const [from, until] = asked[k]!;\n                            if (answer.placed < 1) throw new Error(\"a placement placed no entry of a window that holds some\");\n                            if (!land(answer)) return;\n                            // A window placed short leaves the rest of it to ask again.\n                            if (from + answer.placed < until) left.unshift([from + answer.placed, until]);\n                        }\n                    }\n                }\n            } catch (err) {\n                if (signal.aborted) return;\n                if (this.followed(workspace, path, snapshot, revision, err)) return;\n                this.fail(batchKey, seq, failureOf(path, err), isPermanentPageError(err));\n                console.error(`Data.bindPaged: placement failed for ${batchKey}:`, err);\n            }\n        })();\n    }\n\n    /**\n     * Which of some index entries a narrowing's runs of one of a record's\n     * indexes hold (#1349): for each entry key, whether it lies in one of the\n     * runs, in the order asked — `none` while any is in flight.\n     *\n     * @remarks\n     * Each key's answer is held at the revision, by the runs, so a key asked\n     * again — a segment drawn again, a window panned back — is answered from\n     * what is held, and only the keys not held go in a request: one for each\n     * {@link DATASET_BATCH_MAX} keys, and for each as many runs, a key in any\n     * group of the runs being in them. Past {@link MAX_HELD_WITHIN} answers\n     * over every narrowing of the revision, the least recently used\n     * narrowing's least recently read go first, but a batch keeps every key\n     * its reader asks of until the reader has read them ({@link HeldWithin}):\n     * several readers whose keys together pass the cap each read theirs after\n     * one batch, and a reader whose answers went since asks again for those\n     * alone.\n     *\n     * @param source - One of a record's indexes, the runs' rows\n     * @param runs - The narrowing's runs: ascending, disjoint, each inside the index\n     * @param keys - `.east` literals of the index's entry keys, `(ik=…, k=…)`: at\n     *   most {@link MAX_WITHIN_KEYS} in one read\n     * @returns Whether each key lies in one of the runs, once every one is known\n     * @throws The read's failure, until a read after the retry gap asks again;\n     *   at once, for a source that is no record's index, or more keys than a read takes\n     */\n    withinAll(source: PagedSource, runs: readonly PagedRun[], keys: readonly string[]): option<readonly boolean[]> {\n        const index = source.selector.index;\n        if (index === null) throw new Error(\"Data.bindPaged: a membership read asks of runs of one of a record's indexes\");\n        if (keys.length > MAX_WITHIN_KEYS) {\n            throw new Error(`Data.bindPaged: a membership read asks of ${MAX_WITHIN_KEYS} entry keys at most; ask of ${keys.length} in parts`);\n        }\n        const workspace = this.resolveWorkspace();\n        const { path, selector } = source;\n        const revision = this.revisionFor(workspace, path);\n        if (typeof revision !== \"string\") return none;\n        const snapshot = this.snapshotOf(workspace, path);\n        const family = withinFamily(workspace, path, revision, selector, runs);\n        const held = snapshot.within.get(family);\n        const answers: boolean[] = new Array<boolean>(keys.length);\n        const missing = new Set<string>();\n        for (const [i, key] of keys.entries()) {\n            const known = held?.answers.get(key);\n            if (known === undefined) missing.add(key);\n            else answers[i] = known;\n        }\n        if (missing.size === 0) {\n            // Every answer is held: the reader has read them, and no batch keeps them for it any longer.\n            if (held !== undefined) readWithin(snapshot, heldWithinOf(snapshot, family), keys);\n            return some(answers);\n        }\n        const asked = [...missing];\n        // The channel coordinates the read; the answers are held key by key, so\n        // two reads that share a channel each read their own keys again if need be.\n        const batchKey = pagedBatchKey(workspace, path, revision, selector, \"within\",\n            [family, String(asked.length), asked[0]!, asked[asked.length - 1]!]);\n        this.track(batchKey);\n        const batch = this.channel(snapshot, batchKey);\n        if (batch.status === \"loaded\") batch.status = \"idle\";\n        if (this.due(batch)) {\n            // The batch keeps every key its reader asks of: those held now, and those its answer brings.\n            const kept = heldWithinOf(snapshot, family);\n            releaseWithin(snapshot, kept, batchKey);\n            keepWithin(snapshot, kept, batchKey, [...keys], keys.filter((key) => !missing.has(key)));\n            this.launchWithin(workspace, path, snapshot, revision, index, family, batchKey, runs, asked);\n        }\n        return this.answer<readonly boolean[]>(batch, undefined);\n    }\n\n    /**\n     * How many membership answers the runtime holds of a source's dataset,\n     * over every narrowing's runs, how many of them batches keep for their\n     * readers, and how many batches keep any (#1349): what its specs hold the\n     * bounds to. A move drops them all, so they are always the current\n     * revision's.\n     *\n     * @param source - One of a record's indexes, or any source of the same record\n     * @returns The answers held, those kept, and the batches keeping them\n     */\n    protected withinHeld(source: PagedSource): { answers: number; kept: number; batches: number } {\n        const snapshot = this.snapshots.get(pagedRevisionKey(this.resolveWorkspace(), source.path));\n        let answers = 0;\n        let kept = 0;\n        let batches = 0;\n        for (const held of snapshot?.within.values() ?? []) {\n            answers += held.answers.size;\n            kept += held.pins.size;\n            batches += held.batches.size;\n        }\n        return { answers, kept, batches };\n    }\n\n    /**\n     * What the runtime holds now (test use only, through a subclass, as\n     * {@link withinHeld} is): the channels it keeps, the versions it keeps of\n     * channels, the longest channel's key, and of a source's dataset at its\n     * revision the searches' bounds it holds apart from a channel, how many\n     * narrowings' membership answers it holds and how many of its channels hold\n     * a placement — what its specs hold the runtime's bounds to.\n     *\n     * @param source - Any source of the dataset\n     * @returns What it holds\n     */\n    protected holding(source: PagedSource): {\n        channels: number; versions: number; longestKey: number; searches: number; narrowings: number; placements: number;\n    } {\n        const snapshot = this.snapshots.get(pagedRevisionKey(this.resolveWorkspace(), source.path));\n        let longestKey = 0;\n        for (const key of this.entries.keys()) longestKey = Math.max(longestKey, key.length);\n        let placements = 0;\n        for (const key of snapshot?.channels ?? []) if (this.entries.get(key)?.placement !== undefined) placements += 1;\n        return {\n            channels: this.entries.size, versions: this.versionsKept(), longestKey,\n            searches: snapshot?.searches.size ?? 0, narrowings: snapshot?.within.size ?? 0, placements,\n        };\n    }\n\n    /** Launch a membership read of the keys not held: a request for each group\n     *  of keys and of runs, a key in any group of the runs being in them. */\n    protected launchWithin(\n        workspace: string,\n        path: TreePath,\n        snapshot: Snapshot,\n        revision: string,\n        index: string,\n        family: string,\n        batchKey: string,\n        runs: readonly PagedRun[],\n        keys: readonly string[],\n    ): void {\n        // Aborted, the batch keeps nothing for a reader that has let it go.\n        const { seq, signal } = this.launchFetch(batchKey, this.channel(snapshot, batchKey),\n            () => { const held = snapshot.within.get(family); if (held !== undefined) releaseWithin(snapshot, held, batchKey); });\n        const api = this.api;\n        void (async () => {\n            const within = new Array<boolean>(keys.length).fill(false);\n            try {\n                if (api === null) throw new Error(\"no PagedApi installed\");\n                for (let k = 0; k < keys.length; k += DATASET_BATCH_MAX) {\n                    const chunk = keys.slice(k, k + DATASET_BATCH_MAX);\n                    for (let r = 0; r < Math.max(1, runs.length); r += DATASET_BATCH_MAX) {\n                        const answer = await api.within(workspace, path, { index, runs: runs.slice(r, r + DATASET_BATCH_MAX), keys: chunk, hash: revision }, signal);\n                        if (answer.within.length !== chunk.length) {\n                            throw new Error(`a membership read of ${chunk.length} keys answered ${answer.within.length}`);\n                        }\n                        for (const [i, inside] of answer.within.entries()) within[k + i] ||= inside;\n                    }\n                }\n            } catch (err) {\n                if (signal.aborted) return;\n                if (this.followed(workspace, path, snapshot, revision, err)) return;\n                this.fail(batchKey, seq, failureOf(path, err), isPermanentPageError(err));\n                console.error(`Data.bindPaged: membership read failed for ${batchKey}:`, err);\n                return;\n            }\n            if (!this.pinnedTo(snapshot, revision)) return;\n            const held = heldWithinOf(snapshot, family);\n            for (const [i, key] of keys.entries()) {\n                held.answers.delete(key);\n                held.answers.set(key, within[i]!);\n            }\n            // Its answers are kept for its reader, beside what the batch kept as it launched, until the reader reads\n            // them; past the cap over every narrowing, the least recently read of the rest go, the least recently used\n            // narrowing's first.\n            keepWithin(snapshot, held, batchKey, keys, keys);\n            trimWithin(snapshot);\n            this.settle(batchKey, seq, (e) => { e.status = \"loaded\"; delete e.error; });\n        })();\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The paging runtime's API seam (`Data.bindPaged`): what a paged source is — a\n * dataset, and which of its rows — what a window, a row read by key, a run and\n * a placement are, and the narrow surface the runtime talks to e3 through. Tests\n * stub it; the React provider installs the real one. There is no offline\n * stand-in: paging is a SERVER capability (segment fences, exact totals, key\n * search), so a paged source resolves only against a live workspace.\n *\n * @packageDocumentation\n */\n\nimport type { EastTypeValue, option } from \"@elaraai/east\";\nimport {\n    datasetGetPage, datasetFindKey, datasetFindKeys, datasetGetRows, datasetGetRuns, datasetGetStatus, datasetPlace, datasetWithin, type DatasetPage,\n    type DatasetPlaceQuery, type DatasetPlacement, type DatasetWithin, type DatasetWithinQuery, type DatasetFindQuery, type DatasetFindResult,\n    type DatasetFindKeysQuery, type DatasetFindKeysResult, type DatasetRows, type DatasetRowsQuery, type DatasetRuns, type DatasetRunsQuery,\n    type RequestOptions,\n} from \"@elaraai/e3-api-client\";\nimport type { TreePath } from \"@elaraai/e3-types\";\n\nimport type { ReactiveDatasetCacheInterface } from \"../dataset-store.js\";\n\n/** One element window of a paged source. */\nexport interface PagedWindow {\n    /** Global element offset of the window's first element. */\n    offset: number;\n    /** Maximum elements to return (the server may clamp it). */\n    limit: number;\n    /** Read through one of a record's secondary indexes instead of the record\n     *  itself — the window is then the INDEX's row space, in its own order. */\n    index?: string;\n    /** With {@link index}: read each entry's row from the record too. */\n    join?: boolean;\n    /** The content hash the window is pinned to. The server answers from that\n     *  content or refuses, naming the content the dataset holds now; it never\n     *  answers from other content. */\n    hash?: string;\n}\n\n/** Which rows a bind serves: the dataset's own, or one of a record's indexes.\n *  Every channel key, every fetch and the handle cache carry it, because two\n *  binds that differ here serve different row spaces from one path. */\nexport interface PagedSelector {\n    /** The index's name, or `null` for the dataset itself. */\n    index: string | null;\n    /** Whether an index read joins each entry to its row. */\n    join: boolean;\n}\n\n/** What a paged handle serves: a dataset, and which of its rows. */\nexport interface PagedSource {\n    /** The dataset's path. */\n    readonly path: TreePath;\n    /** The rows it serves: the dataset's own, or one of a record's indexes. */\n    readonly selector: PagedSelector;\n    /** What a window of it decodes as: the dataset's own type, or an index's\n     *  window type. */\n    readonly type: EastTypeValue;\n}\n\n/** One row a read by key answers (#1351): the key, the row the dataset holds\n *  under it or none, and the key's position in the dataset's canonical order —\n *  the row space a window addresses. */\nexport interface PagedRow {\n    readonly key: unknown;\n    readonly row: option<unknown>;\n    readonly position: number;\n}\n\n/** A run of a source's rows: its first row and how many it holds. */\nexport type PagedRun = readonly [row: number, count: number];\n\n/** A record segment some of a narrowing's rows fall in (#1349). */\nexport interface PagedPlacedSegment {\n    /** The segment's number in the record's manifest. */\n    readonly segment: number;\n    /** Its first row in the record's order. */\n    readonly offset: number;\n    /** How many rows it holds. */\n    readonly count: number;\n    /** How many of the narrowing's rows it holds. */\n    readonly rows: number;\n}\n\n/** Where a narrowing's runs of an index sit in its record, as far as they are placed (#1349). */\nexport interface PagedPlacement {\n    /** The record segments the placed entries fall in, in the record's order, each with how many it holds. */\n    readonly segments: readonly PagedPlacedSegment[];\n    /** How many of the runs' entries are placed. */\n    readonly placed: number;\n    /** How many entries the runs hold. */\n    readonly entries: number;\n    /** The record's row count. */\n    readonly total: number;\n    /** Whether every entry is placed: until then, the segments not yet placed hold rows the placement has not counted. */\n    readonly complete: boolean;\n}\n\n/**\n * Adapter for the dataset paging endpoints. The default wraps\n * `@elaraai/e3-api-client`'s `datasetGetPage`, `datasetFindKey` and\n * `datasetGetStatus`, and follows datasets through the dataset store.\n *\n * Each request takes the signal of the read that asked it (#1398, CL6): a\n * read no reader waits on any longer — a window that left the demand ring, a\n * period read a newer navigation superseded — is aborted while still in\n * flight, and the request rejects as `fetch` does.\n */\nexport interface PagedApi {\n    /** Fetch one element window of a collection dataset — or of one of a\n     *  record's indexes, when the window names one. */\n    getPage(workspace: string, path: TreePath, window: PagedWindow, signal?: AbortSignal): Promise<DatasetPage>;\n    /** Locate a key query in a Set/Dict dataset's canonical key order. The\n     *  `row` it answers with indexes the SAME row space {@link getPage}'s\n     *  element windows serve, which is what makes a hit addressable. */\n    findKey(workspace: string, path: TreePath, query: DatasetFindQuery, signal?: AbortSignal): Promise<DatasetFindResult>;\n    /** Locate several key queries of one source in one request (#1351), each\n     *  as {@link findKey} would, in order. */\n    findKeys(workspace: string, path: TreePath, query: DatasetFindKeysQuery, signal?: AbortSignal): Promise<DatasetFindKeysResult>;\n    /** Read the rows a Dict dataset holds under several keys in one request —\n     *  its own, or those the entries of some runs of a record's index name\n     *  (#1393) — each key's row or absence and its position, the first `count`\n     *  of the keys the page's bounds reach. */\n    getRows(workspace: string, path: TreePath, query: DatasetRowsQuery, signal?: AbortSignal): Promise<DatasetRows>;\n    /** Read the entries of several runs of a source's rows in one request, in\n     *  order: the first `count` of them a page's bounds reach. */\n    getRuns(workspace: string, path: TreePath, query: DatasetRunsQuery, signal?: AbortSignal): Promise<DatasetRuns>;\n    /** Place a window of a narrowing's runs of one of a record's indexes in the\n     *  record (#1349): how many of the window's entries each record segment\n     *  holds, the first `placed` of them a page's bounds reach. */\n    place(workspace: string, path: TreePath, query: DatasetPlaceQuery, signal?: AbortSignal): Promise<DatasetPlacement>;\n    /** Ask which of some index entries a narrowing's runs of one of a record's\n     *  indexes hold, in one request (#1349). */\n    within(workspace: string, path: TreePath, query: DatasetWithinQuery, signal?: AbortSignal): Promise<DatasetWithin>;\n    /**\n     * The dataset's current content hash, or `null` while it has no value. For\n     * a record it is the record's state hash, which reads through its indexes\n     * are pinned to as well.\n     */\n    getRevision(workspace: string, path: TreePath): Promise<string | null>;\n    /**\n     * Follow a dataset's content hash.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path\n     * @param onChange - Hears each hash the dataset moves to, the first report\n     *   included; `null` while it has no value\n     * @returns A function that stops following\n     */\n    watchRevision(workspace: string, path: TreePath, onChange: (hash: string | null) => void): () => void;\n    /**\n     * Says which hash a follower of a dataset reads at now, by evidence of\n     * its own — an answer's revision installed, a refusal naming the\n     * dataset's state, a lookup: {@link watchRevision} then tells it of the\n     * dataset's hash wherever that differs, from the next poll started on,\n     * rather than only where it differs from the last hash told.\n     *\n     * @param workspace - The workspace\n     * @param path - The dataset's path\n     * @param onChange - The follower, as {@link watchRevision} was given it\n     * @param hash - The hash it reads at now; `null` while the dataset has no value\n     */\n    revisionHeld?(workspace: string, path: TreePath, onChange: (hash: string | null) => void, hash: string | null): void;\n}\n\n/**\n * A request's options with its read's signal: the `fetch` every one of its\n * requests goes through — its retries too — carries the signal, so aborting\n * the read rejects the request in flight as `fetch` does, and a retry is\n * never sent. The client's own options are otherwise as they were.\n *\n * @param options - The request's options\n * @param signal - The read's signal; absent, the options as they are\n * @returns The options\n */\nfunction withSignal(options: RequestOptions, signal: AbortSignal | undefined): RequestOptions {\n    if (signal === undefined) return options;\n    const send = options.fetch ?? globalThis.fetch;\n    return {\n        ...options,\n        fetch: (input, init) => {\n            const own = init?.signal ?? undefined;\n            if (own === undefined) return send(input, { ...init, signal });\n            // A request with a signal of its own is aborted by either.\n            const both = new AbortController();\n            const abort = () => both.abort();\n            if (own.aborted || signal.aborted) both.abort();\n            own.addEventListener(\"abort\", abort, { once: true });\n            signal.addEventListener(\"abort\", abort, { once: true });\n            return send(input, { ...init, signal: both.signal });\n        },\n    };\n}\n\n/**\n * Build the default {@link PagedApi} that talks to a real e3 server via\n * `@elaraai/e3-api-client`.\n *\n * @remarks\n * A dataset is followed through the dataset store's workspace-status poll,\n * which reports every dataset's hash: a followed dataset joins that poll, adds\n * no request of its own, and never has its content fetched.\n *\n * @param apiUrl - Base URL of the e3 API server\n * @param repo - Repository name\n * @param getOptions - Reads the current request options — the token, and the\n *   `fetch` requests go through — so a rotated one is used at once\n * @param datasets - The dataset store whose status poll reports the hashes\n * @returns The adapter\n */\nexport function createDefaultPagedApi(\n    apiUrl: string,\n    repo: string,\n    getOptions: () => RequestOptions,\n    datasets: Pick<ReactiveDatasetCacheInterface, \"watchHash\" | \"hashHeld\">,\n): PagedApi {\n    return {\n        async getPage(workspace, path, window, signal) {\n            return datasetGetPage(apiUrl, repo, workspace, path, window, withSignal(getOptions(), signal));\n        },\n        async findKey(workspace, path, query, signal) {\n            return datasetFindKey(apiUrl, repo, workspace, path, query, withSignal(getOptions(), signal));\n        },\n        async findKeys(workspace, path, query, signal) {\n            return datasetFindKeys(apiUrl, repo, workspace, path, query, withSignal(getOptions(), signal));\n        },\n        async getRows(workspace, path, query, signal) {\n            return datasetGetRows(apiUrl, repo, workspace, path, query, withSignal(getOptions(), signal));\n        },\n        async getRuns(workspace, path, query, signal) {\n            return datasetGetRuns(apiUrl, repo, workspace, path, query, withSignal(getOptions(), signal));\n        },\n        async place(workspace, path, query, signal) {\n            return datasetPlace(apiUrl, repo, workspace, path, query, withSignal(getOptions(), signal));\n        },\n        async within(workspace, path, query, signal) {\n            return datasetWithin(apiUrl, repo, workspace, path, query, withSignal(getOptions(), signal));\n        },\n        async getRevision(workspace, path) {\n            const status = await datasetGetStatus(apiUrl, repo, workspace, path, getOptions());\n            return status.hash.type === \"some\" ? status.hash.value : null;\n        },\n        watchRevision(workspace, path, onChange) {\n            return datasets.watchHash(workspace, path, onChange);\n        },\n        revisionHeld(workspace, path, onChange, hash) {\n            datasets.hashHeld(workspace, path, onChange, hash);\n        },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Runtime implementation for the `Data.bindPaged` platform functions — reading\n * a collection dataset one WINDOW at a time, for sources too large to hold\n * whole.\n *\n * The read itself is the trigger: `page(offset, limit)` returns the window if\n * it has landed, and otherwise starts the fetch and returns `none`. The caller\n * re-reads on the next reactive frame (the window's channel notifies when it\n * settles), which is why the East-side contract is `Option` rather than a\n * promise — the same shape `Func.bind`'s `read()` has. A fetch that failed\n * throws its reason when read — a {@link PagedReadError}, so a reader tells a\n * read that failed from any other error — so `none` means only \"in flight\".\n *\n * Every bind of one dataset shares a SNAPSHOT: the content hash its reads are\n * pinned to, its revision. Windows, totals and searches are fetched pinned, so\n * the server answers from that content or refuses; what one snapshot delivered\n * is never served beside another's. The snapshot follows its dataset — the\n * dataset store's status poll reporting a new hash, a refused pin, or\n * `refresh` moves it — and a move drops what the old snapshot delivered, so the\n * windows and searches still being read are fetched again, pinned to the new\n * one. It follows while something reads the dataset: once its readers have all\n * let it go, nothing polls for it, and the next read follows it again — moved\n * at the first report if the dataset moved meanwhile.\n *\n * One tracked channel per window, per total and per search, each keyed by the\n * revision it belongs to, plus one per dataset for its revision, which every\n * read tracks.\n *\n * Searches of one source's rows launched in one synchronous turn are a burst\n * (#1360): each answer is applied to its channel as it lands, and the last\n * re-fires every channel the burst answered at once, so a reader of a window\n * over an interval index — some fifty-five searches — runs again once, not\n * once a search. Windows are applied to their readers once a frame (#1398,\n * CL9) — those by offset and those across a narrowing's runs alike: each lands\n * in its channel at once, and the windows that land before the next frame — a\n * fling coming to rest, the windows read ahead either side — re-fire together,\n * so a reader draws once for them, never once a window.\n *\n * A window a landed one covers is never fetched (#1217): its rows are that\n * window's, at the same revision, so the read is answered from it and keeps\n * the answer in its own channel. A sheet reads an entry it is about to draft\n * as a one-element window, beside the windows it draws. A window one in flight\n * covers waits on that one, asking nothing of its own (#1596): its rows are\n * cut from it once it lands — a sheet's row checks over the rows a Save's new\n * revision reads again, a request a row otherwise.\n *\n * Landed windows are kept least recently read first, at most\n * {@link MAX_RETAINED_WINDOWS} of them: past the cap a window no reader holds\n * goes whole, and none a reader holds is evicted under it (#1409, R24), so a\n * reader of more windows than the cap — rows read a key at a time among\n * them, each a key search and a one-row window — settles, each read once. A\n * one-row window cut from a landed one cost no request, and is kept apart from\n * them (at most {@link MAX_RETAINED_CUTS}): a reader of many rows a row at a\n * time, each answered from a landed window, never pushes that window out\n * (#1596). A cut of more rows is kept as a window is.\n *\n * Several reads of one source are asked as one request when a reader asks\n * them together (#1351): `seekAll` a batch of key searches (`findKeys`),\n * `rowsAll` the rows of several keys of a Dict, `runsAll` the entries of\n * several runs — and `joinAll` a Dict's rows under the keys some runs of one\n * of a record's indexes name, the keys read by the server, none sent (#1393).\n * A batch is one request and one channel, named by a digest of what it asks,\n * which re-fires its readers once and holds its answer as a landed window\n * does, bounded with them. What it answers serves the single reads too: each\n * search's bounds are held at the revision — the last\n * {@link MAX_LANDED_SEARCHES} of them, a search's own answer among them once\n * no reader holds its channel — each row is held at its position — a search\n * by its key, or a one-row window at its row, is answered from it — and a\n * window inside one of a runs read's runs is cut from it. A channel no reader\n * holds goes once it holds nothing — aborted, evicted, or a batch whose\n * answer is held elsewhere — and its version with it. A record Slice over a\n * binding the indexed runtime built reads a plan's searches, and a window\n * across several runs, through them. A read by another record's runs is\n * pinned to both datasets' revisions, its channel both snapshots': a move of\n * either drops it.\n *\n * A read no reader waits on any longer is aborted while still in flight\n * (#1398, CL6, CL7): a window that left the demand ring, a period read a newer\n * navigation superseded. Each fetch carries its channel's signal through the\n * API seam; once the channel's last reader lets it go — and has not\n * subscribed again by the next microtask — its requests are cancelled and the\n * channel goes back to `idle`, so a read that asks for it again fetches it\n * afresh. (A read of a revision the source moved past is not aborted: its\n * answer lands nowhere, its pin no longer holding.)\n *\n * The dataset store's CONTENT is deliberately not used: it holds whole values,\n * and a paged source is precisely the thing you cannot hold whole. A source\n * rides the store's status poll for hashes alone, through\n * {@link PagedApi.watchRevision}, and reads windows through its own API seam —\n * the same shape `FuncRuntime` / `RecordRuntime` use.\n *\n * The runtime is a layer a file, each reading through the one before it, in\n * `paged/`: its API seam (`api.ts`), the names of its channels (`keys.ts`),\n * what it holds and its bounds (`state.ts`), window arithmetic (`windows.ts`)\n * and how it reads a failure (`errors.ts`); then the channels of a snapshot\n * and their fetches (`channels.ts`), single windows and searches (`reads.ts`)\n * and batched reads (`batches.ts`). This module is the last layer — the\n * handles, the platform functions and the default runtime — and the\n * runtime's entry: the rest of the package imports the runtime from here.\n *\n * @packageDocumentation\n */\n\nimport {\n    East, SortedMap, compareFor, fromEastTypeValue, toEastTypeValue, type EastType, BooleanType, DictType, IntegerType, NullType, OptionType, StringType,\n    none, parseFor, some, type EastTypeValue, type option,\n} from \"@elaraai/east\";\nimport { type PlatformFunction, EastTypeType } from \"@elaraai/east/internal\";\nimport { SeekQueryType, SeekRangeType } from \"@elaraai/east-ui\";\nimport { bindPagedPinnedPlatformFn, bindPagedPlatformFn, DataPagedPrimitives } from \"@elaraai/e3-ui/internal\";\nimport { registerReactiveTracker, registerPlatformImplementation, registerRecordSliceBatches } from \"@elaraai/east-ui-components/platform\";\nimport { TreePathType, type TreePath } from \"@elaraai/e3-types\";\n\nimport { datasetPathToString } from \"./dataset-store.js\";\nimport { IndexedPagedRuntime, indexedBindingOfSource, recordSliceBatchesOf } from \"./indexed-paged.js\";\nimport { defaultRecordRuntime, recordOfPath } from \"./record-runtime.js\";\nimport { toFindQuery } from \"./find-query.js\";\nimport type { PagedSelector, PagedSource, PagedApi } from \"./paged/api.js\";\nimport { NO_INDEX, selectorKey, pagedRevisionKey, pagedWindowFamily, pagedWindowKey, pagedTotalKey, pagedSeekKey } from \"./paged/keys.js\";\nimport { heldSearch } from \"./paged/state.js\";\nimport type { PagedLandingFrame } from \"./paged/channels.js\";\nimport { PagedBatches } from \"./paged/batches.js\";\n\n// The runtime's parts, in the files that hold them.\nexport {\n    type PagedWindow,\n    type PagedSelector,\n    type PagedSource,\n    type PagedRow,\n    type PagedRun,\n    type PagedPlacedSegment,\n    type PagedPlacement,\n    type PagedApi,\n    createDefaultPagedApi,\n} from \"./paged/api.js\";\nexport { pagedRevisionKey, pagedWindowKey, pagedTotalKey, pagedSeekKey, pagedBatchKey } from \"./paged/keys.js\";\nexport { MAX_WITHIN_KEYS, MAX_HELD_PLACEMENTS } from \"./paged/state.js\";\nexport { type PagedLandingFrame, MAX_RETAINED_WINDOWS, MAX_RETAINED_CUTS, CUTS_BETWEEN_LOOKS } from \"./paged/channels.js\";\nexport { type PagedRuntimeProbe, setPagedRuntimeProbe } from \"./paged/reads.js\";\n\n/** The decoded descriptor arguments as a selector. */\nfunction toSelector(indexArg: unknown, joinArg: unknown): PagedSelector {\n    const index = indexArg as option<string> | undefined;\n    return {\n        index: index !== undefined && index.type === \"some\" ? index.value : null,\n        join: joinArg === true,\n    };\n}\n\n/** Refuses a paged bind of a path the task's manifest never declared — so a\n *  `ui()` task windows only the datasets derivation recorded. */\nfunction checkDeclared(allowed: ReadonlySet<string> | null, path: TreePath): void {\n    if (allowed === null) return;\n    const pathStr = datasetPathToString(path);\n    if (!allowed.has(pathStr)) {\n        throw new Error(\n            `Data.bindPaged: source path \"${pathStr}\" not declared in manifest — ` +\n            `bind it in the task body so derivation records it`,\n        );\n    }\n}\n\n/** The Dict key / Set element type of a keyed collection, else null — the\n *  `seek` capability is decided from the dataset's own type at bind time. */\nexport function keyTypeOf(sourceType: EastTypeValue): EastTypeValue | null {\n    if (sourceType.type === \"Dict\") return (sourceType.value as { key: EastTypeValue }).key;\n    if (sourceType.type === \"Set\") return sourceType.value as EastTypeValue;\n    return null;\n}\n\n/**\n * The handle's `seek` field: `some(fn)` for a key-ordered source, `none` for an\n * Array (stream order has nothing to binary-search).\n *\n * The capability is decided from the DATASET's own type at bind time, so a\n * component renders the search affordance only where the server can answer it —\n * `datasetFindKey` binary-searches the stored blob's segment fences and decodes\n * at most two segments, which only a Set/Dict blob has.\n *\n * The function is an IR-bearing `East.function` over the `data_page_seek`\n * primitive, capturing only the plain-data path — the same shape `page` /\n * `total` have, so the whole handle stays serializable (issue #106).\n */\nfunction buildSeek(\n    sourceType: EastTypeValue,\n    T: EastType,\n    pathExpr: unknown,\n    indexExpr: unknown,\n    joinExpr: unknown,\n    selector: PagedSelector,\n    platform: PlatformFunction[],\n): unknown {\n    // An INDEX window is an Array — it has to be, or a Dict would re-sort it\n    // out of index order — but the collection behind it is keyed by `{ik, k}`,\n    // so it is searchable even though its window type is not.\n    if (selector.index === null && keyTypeOf(sourceType) === null) return none;\n    const { seek } = DataPagedPrimitives;\n    return some(East.compile(\n        East.function([SeekQueryType], OptionType(SeekRangeType), ($, query) => {\n            $.return(seek([T], pathExpr as never, indexExpr as never, joinExpr as never, query));\n        }),\n        platform,\n    ));\n}\n\n// A search from East's form to e3's wire, in a module of its own so the\n// indexed runtime, which this module builds, reaches it without a cycle.\nexport { toFindQuery } from \"./find-query.js\";\n\n/**\n * Encapsulates all `Data.bindPaged` runtime state. The module-level\n * {@link defaultPagedRuntime} instance backs the registered platform; tests\n * construct their own for isolation.\n */\nexport class PagedRuntime extends PagedBatches {\n    /** Field-index bindings share this runtime's existing reads. */\n    readonly indexed = new IndexedPagedRuntime(this);\n\n    // Compiled-handle cache (issue #106 perf): buildHandle compiles several\n    // East.functions per bind, and binds re-run every reactive frame. The\n    // method IR is a pure function of (sourceType, path, selector, shape), and\n    // the methods resolve api/workspace LIVE, so a cached handle still\n    // re-binds.\n    //\n    // Keyed by TYPE first, then path — never by path alone. The window decoder\n    // is baked from `sourceType`, so a path re-bound at a different type (a\n    // redeployed dataset whose schema changed, inside a live session) must not\n    // hand back the handle compiled against the old type. Structural key for\n    // the same reason `bind-runtime` uses one: every bind builds a fresh\n    // `EastTypeValue` from IR, so a by-identity cache would miss every render.\n    private readonly handleCache = new SortedMap<EastTypeValue, Map<string, Record<string, unknown>>>(\n        undefined,\n        compareFor(EastTypeType),\n    );\n\n    /** The source each handle serves, by the handle's `id` — what the id says,\n     *  kept as it was built rather than read back from its text. */\n    private readonly sources = new Map<string, PagedSource>();\n\n    // ----- wiring ----------------------------------------------------------\n\n    /** Install the API adapter + workspace — called by the React provider\n     *  (or a test) before any handle is used. Another adapter or workspace\n     *  starts from nothing: no snapshot of the old one's carries over. */\n    initialize(api: PagedApi, workspace: string): void {\n        if (this.api !== api || this.workspace !== workspace) this.reset();\n        this.api = api;\n        this.workspace = workspace;\n    }\n\n    /**\n     * Tear down the adapter and all window state.\n     *\n     * @param api - Clear only while this is the installed adapter, so a\n     *   provider tearing down after another installed its own leaves that one\n     *   in place\n     */\n    clear(api?: PagedApi): void {\n        if (api !== undefined && this.api !== api) return;\n        this.api = null;\n        this.workspace = null;\n        this.reset();\n        this.handleCache.clear();\n        this.indexed.clear();\n    }\n\n    /**\n     * The low-level primitives backing handle methods, bound to THIS runtime.\n     * Registered globally (extension registry) and included by the scoped\n     * platform (e3 `ui()` tasks) so a decoded handle re-binds to whatever\n     * runtime resolves the primitives on the decode side.\n     */\n    buildPrimitives(): PlatformFunction[] {\n        return [\n            DataPagedPrimitives.page.implement((sourceType: EastTypeValue) =>\n                (pathArg: unknown, indexArg: unknown, joinArg: unknown, offsetArg: unknown, limitArg: unknown) => {\n                    const workspace = this.resolveWorkspace();\n                    const path = pathArg as TreePath;\n                    const revision = this.revisionFor(workspace, path);\n                    if (typeof revision !== \"string\") return none;\n                    const selector = toSelector(indexArg, joinArg);\n                    const offset = Number(offsetArg as bigint);\n                    const limit = Number(limitArg as bigint);\n                    const key = pagedWindowKey(workspace, path, revision, offset, limit, selector);\n                    this.track(key);\n                    const snapshot = this.snapshotOf(workspace, path);\n                    const family = pagedWindowFamily(workspace, path, revision, selector);\n                    // A window a landed one covers is answered from it, never fetched (#1217).\n                    const own = this.channel(snapshot, key);\n                    if (own.status !== \"loaded\") {\n                        this.cutFromCovering(sourceType, family, offset, limit, key, own);\n                    }\n                    // A one-row window at a row a read by key holds is answered from it (#1351).\n                    if (own.status !== \"loaded\" && limit === 1 && selector.index === null && sourceType.type === \"Dict\") {\n                        const held = snapshot.held.get(family)?.byPosition.get(offset);\n                        if (held !== undefined && held.row.type === \"some\") {\n                            const keyType = fromEastTypeValue((sourceType.value as { key: EastTypeValue }).key);\n                            own.status = \"loaded\";\n                            own.window = new SortedMap([[held.key, held.row.value]], compareFor(keyType));\n                            own.span = { family, offset, count: 1 };\n                            delete own.error;\n                            this.keepCut(key);\n                        }\n                    }\n                    // A window one in flight covers waits on it, asking nothing of its own (#1596): its rows are cut from\n                    // that window once it lands, which re-fires this read.\n                    if (own.status !== \"loaded\" && this.due(own)) {\n                        const covering = this.coveringInFlight(family, offset, limit, key);\n                        if (covering !== undefined) {\n                            this.track(covering);\n                            return none;\n                        }\n                    }\n                    const entry = this.ensureWindow(sourceType, workspace, path, snapshot, revision, offset, limit, selector, key);\n                    if (entry.status === \"loaded\" && entry.window !== undefined) {\n                        if (this.cutWindows.has(key)) this.touchCut(key);\n                        else this.touchWindow(key);\n                    }\n                    return this.answer(entry, entry.window);\n                }),\n            DataPagedPrimitives.total.implement((_sourceType: EastTypeValue) =>\n                (pathArg: unknown, indexArg: unknown, joinArg: unknown) => {\n                    const workspace = this.resolveWorkspace();\n                    const path = pathArg as TreePath;\n                    const revision = this.revisionFor(workspace, path);\n                    if (typeof revision !== \"string\") return none;\n                    const key = pagedTotalKey(workspace, path, revision, toSelector(indexArg, joinArg));\n                    this.track(key);\n                    const entry = this.channel(this.snapshotOf(workspace, path), key);\n                    return entry.total !== undefined ? some(BigInt(entry.total)) : none;\n                }),\n            DataPagedPrimitives.seek.implement((sourceType: EastTypeValue) =>\n                (pathArg: unknown, indexArg: unknown, joinArg: unknown, queryArg: unknown) => {\n                    const workspace = this.resolveWorkspace();\n                    const path = pathArg as TreePath;\n                    const revision = this.revisionFor(workspace, path);\n                    if (typeof revision !== \"string\") return none;\n                    const selector = toSelector(indexArg, joinArg);\n                    const query = toFindQuery(queryArg, selector);\n                    const key = pagedSeekKey(workspace, path, revision, query, selector);\n                    this.track(key);\n                    const snapshot = this.snapshotOf(workspace, path);\n                    const own = this.channel(snapshot, key);\n                    // A search a batch answered, or this one's own answer its channel left, is answered from what the\n                    // revision holds, never searched (#1351).\n                    const landed = own.status === \"loaded\" ? undefined : heldSearch(snapshot, key);\n                    if (landed !== undefined) {\n                        own.status = \"loaded\";\n                        own.range = landed;\n                        delete own.error;\n                    }\n                    // A key a read by key holds is answered from it, never searched (#1351).\n                    if (own.status !== \"loaded\" && selector.index === null && \"key\" in query) {\n                        const held = this.heldRow(snapshot, pagedWindowFamily(workspace, path, revision, selector), sourceType, query.key);\n                        if (held !== undefined) {\n                            const found = held.row.type === \"some\";\n                            own.status = \"loaded\";\n                            own.range = { found, row: held.position, count: found ? 1 : 0, hash: revision };\n                            delete own.error;\n                        }\n                    }\n                    const entry = this.ensureSeek(workspace, path, snapshot, revision, selector, query, key);\n                    const range = entry.range;\n                    return this.answer(entry, range === undefined\n                        ? undefined\n                        : { found: range.found, row: BigInt(range.row), count: BigInt(range.count) });\n                }),\n            DataPagedPrimitives.revision.implement((_sourceType: EastTypeValue) =>\n                (pathArg: unknown, _indexArg: unknown, _joinArg: unknown) => {\n                    const revision = this.revisionFor(this.resolveWorkspace(), pathArg as TreePath);\n                    return typeof revision === \"string\" ? some(revision) : none;\n                }),\n            DataPagedPrimitives.refresh.implement((_sourceType: EastTypeValue) =>\n                (pathArg: unknown, _indexArg: unknown, _joinArg: unknown, targetArg: unknown) => {\n                    const workspace = this.resolveWorkspace();\n                    const path = pathArg as TreePath;\n                    const target = targetArg as option<string>;\n                    // Where the source reads as it is asked: a revision is installed only while it still reads there.\n                    const from = this.snapshots.get(pagedRevisionKey(workspace, path))?.revision;\n                    // Deferred: a refresh called while a view renders must not\n                    // re-fire that render from inside it.\n                    queueMicrotask(() => {\n                        if (this.workspace !== workspace) return;\n                        const snapshot = this.snapshotOf(workspace, path);\n                        // Moved meanwhile — told a newer hash, a refused pin naming one — the source may read past\n                        // the revision named, and revisions have no order to tell by: installed, it would pin the\n                        // page to a state the dataset has left, until e3 refuses a read pinned there — every window\n                        // then read a second time — or, where a browser answers those reads from what it kept, until\n                        // the next poll tells the source where the dataset is (`moveTo`). It follows the dataset's\n                        // current state instead, as a refresh that names no revision asks.\n                        if (target.type === \"some\" && snapshot.revision === from) { this.moveTo(workspace, path, snapshot, target.value); return; }\n                        // Following the current state is a Retry too: what failed is asked again now.\n                        this.retryNow(workspace, path);\n                    });\n                    return null;\n                }),\n        ];\n    }\n\n    /**\n     * Build the handle value for one paged bind. Every method is a thin\n     * IR-bearing `East.function` over {@link buildPrimitives}, capturing only\n     * the plain-data source path and selector (the value type rides as a\n     * type-arg) — so the handle is ordinary serializable East data (issue\n     * #106).\n     *\n     * @param sourceType - The dataset's type, or an index's window type\n     * @param path - The dataset's path\n     * @param selector - The rows the bind serves\n     * @param shape - `released`: the handle `data_bind_paged` returns, without\n     *   `revision` or `refresh`; `pinned`: the handle `data_bind_paged_pinned`\n     *   returns. Both read through the same snapshot.\n     * @returns The handle\n     */\n    buildHandle(\n        sourceType: EastTypeValue,\n        path: TreePath,\n        selector: PagedSelector,\n        shape: \"released\" | \"pinned\",\n    ): Record<string, unknown> {\n        const id = `${datasetPathToString(path)}${selectorKey(selector)}`;\n        this.sources.set(id, { path, selector, type: sourceType });\n        const cacheKey = `${id}#${shape}`;\n        let byPath = this.handleCache.get(sourceType);\n        if (byPath) {\n            const hit = byPath.get(cacheKey);\n            if (hit) return hit;\n        } else {\n            byPath = new Map<string, Record<string, unknown>>();\n            this.handleCache.set(sourceType, byPath);\n        }\n\n        const T = fromEastTypeValue(sourceType);\n        // A single literal `Value` IR node for the captured path (the\n        // `Data.bind` convention — manifest derivation reads it back).\n        const pathExpr = East.value(path, TreePathType);\n        // The selector rides the call as plain data, exactly as the path does,\n        // so a decoded handle re-binds to the same rows.\n        const indexExpr = East.value(selector.index === null ? none : some(selector.index), OptionType(StringType));\n        const joinExpr = East.value(selector.join, BooleanType);\n        const platform = this.buildPrimitives();\n        const { page, total, revision, refresh } = DataPagedPrimitives;\n\n        const handle: Record<string, unknown> = {\n            // The comparable identity east-ui's `PagedSourceType` requires:\n            // East compares every function as EQUAL, so a struct of nothing but\n            // closures is indistinguishable from any other and a memoized\n            // component would never re-render on a source swap (#567 D4). The\n            // dataset path and selector are the natural identity — same path,\n            // same rows. The snapshot they serve is `revision`'s, not the id's.\n            id,\n            page: East.compile(\n                East.function([IntegerType, IntegerType], OptionType(T), ($, offset, limit) => {\n                    $.return(page([T], pathExpr, indexExpr, joinExpr, offset, limit));\n                }),\n                platform,\n            ),\n            total: East.compile(\n                East.function([], OptionType(IntegerType), ($) => {\n                    $.return(total([T], pathExpr, indexExpr, joinExpr));\n                }),\n                platform,\n            ),\n            // Key search is a KEY-ORDER capability: Set/Dict element windows\n            // ride the canonical East key order, so a key locates in O(log\n            // segments) against the stored fences; an Array's stream order has\n            // nothing to search. Resolved at bind time from the dataset's own\n            // type, so a component renders the affordance only when it works.\n            seek: buildSeek(sourceType, T, pathExpr, indexExpr, joinExpr, selector, platform),\n        };\n        if (shape === \"pinned\") {\n            handle.revision = East.compile(\n                East.function([], OptionType(StringType), ($) => {\n                    $.return(revision([T], pathExpr, indexExpr, joinExpr));\n                }),\n                platform,\n            );\n            handle.refresh = East.compile(\n                East.function([OptionType(StringType)], NullType, ($, target) => {\n                    $.return(refresh([T], pathExpr, indexExpr, joinExpr, target));\n                }),\n                platform,\n            );\n        }\n        byPath.set(cacheKey, handle);\n        return handle;\n    }\n\n    /**\n     * The source a handle this runtime built serves, by the handle's `id`: its\n     * dataset's path and the rows it reads — what a component holding only the\n     * handle needs to name the dataset, such as a query's root.\n     *\n     * @param id - A paged handle's `id`\n     * @returns Its source, or `undefined` when this runtime built no handle with that id\n     */\n    sourceOf(id: string): PagedSource | undefined {\n        return this.sources.get(id);\n    }\n\n    // ----- platform building -------------------------------------------------\n\n    /** Build the PlatformFunction behind `data_bind_paged` — the bind a UI\n     *  exported before pinned reads calls — bound to this runtime. Its handle\n     *  has no `revision` or `refresh`, but its reads are pinned, follow the\n     *  dataset and fail visibly all the same. Pass `allowed=null` for an\n     *  unscoped impl, or a Set of path strings for manifest scoping. */\n    buildPlatform(allowed: ReadonlySet<string> | null): PlatformFunction {\n        return bindPagedPlatformFn.implement((sourceType: EastTypeValue) =>\n            (pathArg: unknown) => {\n                const path = pathArg as TreePath;\n                checkDeclared(allowed, path);\n                return this.buildHandle(sourceType, path, NO_INDEX, \"released\");\n            },\n        );\n    }\n\n    /** Build the PlatformFunction behind `data_bind_paged_pinned` — what\n     *  `Data.bindPaged` emits, for a dataset's own rows or a record's index —\n     *  bound to this runtime and scoped by `allowed` exactly as\n     *  {@link buildPlatform} is: an index read is a read of the record's path. */\n    buildPinnedPlatform(allowed: ReadonlySet<string> | null): PlatformFunction {\n        return bindPagedPinnedPlatformFn.implement((sourceType: EastTypeValue) =>\n            (pathArg: unknown, indexArg: unknown, joinArg: unknown) => {\n                const path = pathArg as TreePath;\n                checkDeclared(allowed, path);\n                return this.buildHandle(sourceType, path, toSelector(indexArg, joinArg), \"pinned\");\n            },\n        );\n    }\n}\n\n// =============================================================================\n// Default process-global runtime + free-function exports.\n// =============================================================================\n\n/** Process-global runtime backing the `PagedPlatform` export. */\nexport const defaultPagedRuntime = new PagedRuntime();\n\n/**\n * The source a paged handle serves, by the handle's `id`, from the runtime\n * behind the registered and the scoped paged platforms.\n *\n * @param id - A paged handle's `id`\n * @returns Its dataset's path and the rows it serves, or `undefined` when no\n *   handle with that id has been bound\n */\nexport function pagedSourceOf(id: string): PagedSource | undefined {\n    return defaultPagedRuntime.sourceOf(id);\n}\n\n/**\n * Reads a keyed source's entries by their ids.\n *\n * @param ids - The entries' ids\n * @returns Each entry's row, `none` for one the source does not hold, by id; none while the read is in flight;\n *   `undefined` for a source that cannot be read by key\n */\nexport type EntriesByKey = (ids: readonly string[]) => option<ReadonlyMap<string, option<unknown>>> | undefined;\n\n/**\n * Reads a keyed source's entries by their ids, every one in one request\n * (#1596): what a Save reads the entries it wrote back by, however many, and\n * wherever they sit. A source's entries are its dataset's own rows, whichever\n * of them it pages — all of them in key order, one of a record's indexes, a\n * binding's unfiltered view, or a record Slice's narrowing — so each is read\n * from the record itself, an id naming no key of the source's type being an\n * entry it does not hold. The source is found as each read runs: its handle is\n * bound as the page's program runs.\n *\n * @param id - The source's id, as its handle carries it, no narrowing printed into it\n * @param keyType - The source's key type\n * @param rowType - The type of its entries\n * @returns The reader\n */\nexport function entriesByKeyOf(id: string, keyType: EastType, rowType: EastType): EntriesByKey {\n    const parse = keyType.type === \"String\" ? undefined : parseFor(keyType);\n    const keyOf = (text: string): unknown => {\n        if (parse === undefined) return text;\n        const read = parse(text);\n        return read.success ? read.value : undefined;\n    };\n    // Made once: a read by key keeps its printer of the key type by this value.\n    const type = toEastTypeValue(DictType(keyType, rowType));\n    const rowsOf = (keys: readonly unknown[]): option<readonly option<unknown>[]> | undefined => {\n        const binding = indexedBindingOfSource(id);\n        if (binding !== undefined) return binding.readsRows ? binding.batches.rowsAll(keys) : undefined;\n        const source = pagedSourceOf(id);\n        if (source === undefined) return undefined;\n        const rows = defaultPagedRuntime.rowsAll({ path: source.path, selector: NO_INDEX, type }, keys);\n        return rows.type === \"some\" ? some(rows.value.map((entry) => entry.row)) : none;\n    };\n    return (ids) => {\n        const asked = ids.flatMap((entry) => {\n            const key = keyOf(entry);\n            return key === undefined ? [] : [{ entry, key }];\n        });\n        const read = asked.length === 0 ? some<readonly option<unknown>[]>([]) : rowsOf(asked.map(({ key }) => key));\n        if (read === undefined || read.type === \"none\") return read as undefined | typeof none;\n        const found = new Map<string, option<unknown>>(ids.map((entry) => [entry, none] as const));\n        asked.forEach(({ entry }, i) => found.set(entry, read.value[i]!));\n        return some(found);\n    };\n}\n\n/**\n * Whether the workspace has read the record a paged source reads since the\n * record's last write from here was answered (the record runtime's\n * `followedOf`): from then the revision the source is pinned to is the\n * record's as of a read made after that write. What a Save over the source\n * that did not install the revision it committed — the source having moved\n * since the Save was drafted — is read back by, wherever the source then\n * reads. The source is found as each read runs: its handle is bound as the\n * page's program runs.\n *\n * @param id - The source's id, as its handle carries it\n * @returns The reader, tracked: `true` once it has, `false` until then, and\n *   `undefined` where nothing says — a source of no record, a record no write\n *   from here has been answered for, or one whose hash is not followed\n */\nexport function readSinceAnswerOf(id: string): () => boolean | undefined {\n    return () => {\n        const path = indexedBindingOfSource(id)?.path ?? pagedSourceOf(id)?.path;\n        const record = path === undefined ? undefined : recordOfPath(path);\n        return record === undefined ? undefined : defaultRecordRuntime.followedOf(record)?.();\n    };\n}\n\n/**\n * Apply the windows the default runtime lands in frames of this, in place of\n * the page's next frame (#1398, CL9): a DOM test's, whose page draws no frame\n * its test waits on. `undefined` gives the page's frames back.\n *\n * @param frame - What asks for the frame, or `undefined`\n */\nexport function setPagedLandingFrame(frame: PagedLandingFrame | undefined): void {\n    defaultPagedRuntime.setLandingFrame(frame);\n}\n\n/** Install the paging API adapter + workspace — called by the React provider\n *  on mount (or by a test). */\nexport function initializePagedApi(api: PagedApi, workspace: string): void {\n    defaultPagedRuntime.initialize(api, workspace);\n}\n\n/**\n * Tear down the paging API adapter and all window state.\n *\n * @param api - Clear only while this is the installed adapter\n */\nexport function clearPagedApi(api?: PagedApi): void {\n    defaultPagedRuntime.clear(api);\n}\n\n/** Global, manifest-unscoped paged binds + their backing primitives.\n *  Registered on module load (powers the extension registry decode path). */\nexport const PagedPlatform: PlatformFunction[] = [\n    defaultPagedRuntime.buildPlatform(null),\n    defaultPagedRuntime.buildPinnedPlatform(null),\n    ...defaultPagedRuntime.indexed.platform(null),\n    ...defaultPagedRuntime.buildPrimitives(),\n];\n\n/** Build manifest-scoped paged binds + their backing primitives, from the\n *  manifest's `pages` list.\n *\n *  The `data_page*` primitives MUST ship with the scoped platform: e3 `ui()`\n *  tasks render through `createScoped*()` arrays (UITaskPreview), NOT the\n *  global registry, so a serialized handle's methods would otherwise decode to\n *  \"Platform function 'data_page' is not available\". */\nexport function createScopedPagedPlatform(pages: readonly TreePath[]): PlatformFunction[] {\n    const allowed = new Set(pages.map(p => datasetPathToString(p)));\n    return [\n        defaultPagedRuntime.buildPlatform(allowed),\n        defaultPagedRuntime.buildPinnedPlatform(allowed),\n        ...defaultPagedRuntime.indexed.platform(allowed),\n        ...defaultPagedRuntime.buildPrimitives(),\n    ];\n}\n\n// =============================================================================\n// Module-load registrations — wire the default runtime into east-ui hooks.\n// Tests with their own `PagedRuntime` don't use these.\n// =============================================================================\n\nregisterReactiveTracker({\n    id: \"data-bind-paged\",\n    enableTracking: () => defaultPagedRuntime.enableTracking(),\n    disableTracking: () => defaultPagedRuntime.disableTracking(),\n    getStore: () => ({\n        subscribe: (key, cb) => defaultPagedRuntime.subscribe(key, cb),\n        getKeyVersion: (key) => defaultPagedRuntime.getKeyVersion(key),\n    }),\n});\n\nregisterPlatformImplementation(PagedPlatform);\n\n// A record Slice over a binding an indexed runtime built — this one's, or a\n// spec's own — reads a plan's searches and its windows in batches, through that\n// runtime's channels (#1351).\nregisterRecordSliceBatches(recordSliceBatchesOf);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Runtime implementation for the `Func.bind` platform function — calling\n * named package functions (`e3.function`) from East UI code, RPC-style.\n *\n * A tracked call is an un-awaited `FunctionApi.call` promise tagged with\n * the monotonic `launchSeq` it was issued under; whichever response still\n * holds the current seq writes the terminal state (latest-wins). A call is\n * the server's for its lifetime, and outlives the request that starts it:\n * `cancel`, and a call that supersedes another on its channel, bump the seq\n * and abort the in-flight call's signal, which asks the server to stop it.\n * So does its page going: the provider's teardown ({@link FuncRuntime.clear})\n * and the page closing for good (`pagehide`, unless the page is kept for the\n * back button) stop every call in flight. e3's client names each call before\n * it sends it, so a call is asked to stop however soon its page goes.\n *\n * All handles bound to the same function name in the same workspace share\n * one registry entry, mirroring how `Data.bind` handles share the dataset\n * cache by path. Declared signatures are validated against the deployed\n * package's function list before any call is sent.\n *\n * State (registry, signature cache, tracking context) is encapsulated in\n * the {@link FuncRuntime} class. A process-global {@link defaultFuncRuntime}\n * powers the `FuncPlatform` export; tests construct their own runtime for\n * isolation.\n *\n * @packageDocumentation\n */\n\nimport {\n    East,\n    StructType,\n    OptionType,\n    BooleanType,\n    NullType,\n    StringType,\n    fromEastTypeValue,\n    type EastType,\n    type EastTypeValue,\n    type ValueTypeOf,\n    encodeBeast2For,\n    decodeBeast2For,\n    isTypeValueEqual,\n    none,\n    some,\n    toEastTypeValue,\n    variant,\n} from \"@elaraai/east\";\nimport { type PlatformFunction } from \"@elaraai/east/internal\";\nimport { funcBindPlatformFn, FuncBindPrimitives, FuncStatusType, FuncErrorType } from \"@elaraai/e3-ui/internal\";\nimport {\n    workspaceFunctionList,\n    workspaceFunctionCall,\n    type ExecuteResult,\n    type FunctionSignature,\n    type RequestOptions,\n} from \"@elaraai/e3-api-client\";\nimport {\n    registerReactiveTracker,\n    registerPlatformImplementation,\n} from \"@elaraai/east-ui-components/platform\";\nimport { TrackedChannelStore } from \"./tracked-channel.js\";\n\n// =============================================================================\n// API seam — the narrow surface the runtime talks through: e3's function\n// routes, over the fetch a host gives (e3-web's, in a test); the snapshot\n// harness swaps in an in-memory implementation.\n// =============================================================================\n\n/** Request shape for {@link FunctionApi.call} — beast2-encoded positional\n *  args. Runner/limit overrides are deliberately not exposed (the deployed\n *  function's runner is authoritative). */\nexport interface FunctionCallArgs {\n    args: Uint8Array[];\n}\n\n/** Options for {@link FunctionApi.call}. */\nexport interface FunctionCallOptions {\n    /** Stops the call: the call stops waiting, and asks the server to stop it */\n    signal?: AbortSignal;\n}\n\n/**\n * Adapter for the workspace function endpoints. The default wraps\n * `@elaraai/e3-api-client`'s `workspaceFunctionList` /\n * `workspaceFunctionCall`.\n */\nexport interface FunctionApi {\n    /** List the workspace's deployed functions with their signatures. */\n    list(workspace: string): Promise<FunctionSignature[]>;\n    /**\n     * Call a function, returning its terminal ExecuteResult once it ends,\n     * however long it runs. Aborting `options.signal` stops the call: its\n     * promise rejects with the abort, and the server is asked to stop it.\n     */\n    call(workspace: string, fn: string, req: FunctionCallArgs, options?: FunctionCallOptions): Promise<ExecuteResult>;\n}\n\n/** Options for {@link createDefaultFunctionApi}. */\nexport interface DefaultFunctionApiOptions {\n    /**\n     * How long a call's start waits for it to end before it answers\n     * `running`, in milliseconds: the server's window unless set. A call that\n     * ends within it costs one request; one that runs on past it is polled.\n     */\n    readonly startWaitMs?: number;\n}\n\n/**\n * Build the default {@link FunctionApi} that talks to a real e3 server via\n * `@elaraai/e3-api-client`.\n *\n * @param apiUrl - Base URL of the e3 API server\n * @param repo - Repository name\n * @param getOptions - Reads the current request options — the token, and the\n *   `fetch` requests go through — so a rotated one is used at once\n * @param options - How long a call's start waits for it to end\n * @returns The adapter\n */\nexport function createDefaultFunctionApi(\n    apiUrl: string,\n    repo: string,\n    getOptions: () => RequestOptions,\n    options: DefaultFunctionApiOptions = {},\n): FunctionApi {\n    return {\n        async list(workspace) {\n            return workspaceFunctionList(apiUrl, repo, workspace, getOptions());\n        },\n        async call(workspace, fn, req, call) {\n            return workspaceFunctionCall(apiUrl, repo, workspace, fn, {\n                // East values the handle was called with, each a value argument\n                args: req.args.map(arg => variant(\"value\", arg)),\n                runner: none,\n                limits: none,\n            }, getOptions(), {\n                // The call is started, and polled to its end; an abort asks the\n                // server to stop it\n                ...(call?.signal !== undefined && { signal: call.signal }),\n                ...(options.startWaitMs !== undefined && { startWaitMs: options.startWaitMs }),\n            });\n        },\n    };\n}\n\n// =============================================================================\n// Value-level helpers\n// =============================================================================\n\ntype FuncError = ValueTypeOf<FuncErrorType>;\ntype FuncStatusTag = ValueTypeOf<FuncStatusType>[\"type\"];\n\n/** A handle's signature, recovered from the instantiated handle type. */\ninterface FuncHandleSignature {\n    readonly inputs: EastTypeValue[];\n    readonly output: EastTypeValue;\n}\n\n/**\n * Introspect the instantiated handle struct type `H`: the input types come\n * from the `call` field's FunctionType, the output type from the `read`\n * field's `Option(Output)` return. The handle's shape IS the signature —\n * there are no duplicate signature arguments to drift out of sync.\n */\nexport function signatureOfFuncHandleType(handleType: EastTypeValue): FuncHandleSignature {\n    if (handleType.type !== \"Struct\") {\n        throw new Error(`Func.bind: handle type must be a Struct; got ${handleType.type}`);\n    }\n    const fields = handleType.value as { name: string; type: EastTypeValue }[];\n    const call = fields.find(f => f.name === \"call\")?.type;\n    const read = fields.find(f => f.name === \"read\")?.type;\n    if (call?.type !== \"Function\" || read?.type !== \"Function\") {\n        throw new Error(\"Func.bind: handle type is missing its call/read closures\");\n    }\n    const inputs = (call.value as { inputs: EastTypeValue[] }).inputs;\n    const readOut = (read.value as { output: EastTypeValue }).output;\n    if (readOut.type !== \"Variant\") {\n        throw new Error(\"Func.bind: read() must return Option(Output)\");\n    }\n    const some = (readOut.value as { name: string; type: EastTypeValue }[]).find(a => a.name === \"some\");\n    if (!some) {\n        throw new Error(\"Func.bind: read() must return Option(Output)\");\n    }\n    return { inputs, output: some.type };\n}\n\n/** Build a FuncError value from an ExecuteResult's non-success outcome. */\nfunction errorOfExecuteResult(result: ExecuteResult): FuncError {\n    const outcome = result.outcome;\n    switch (outcome.type) {\n        case \"failed\":\n            return {\n                kind: variant(\"failed\", { exitCode: outcome.value.exitCode }),\n                message: `runner exited with code ${outcome.value.exitCode}`,\n                stdout: result.stdout,\n                stderr: result.stderr,\n            };\n        case \"invalid\": {\n            const diagnostics = outcome.value.diagnostics.map(d => {\n                const at = d.filename.type === \"some\"\n                    ? ` (${d.filename.value}${d.line.type === \"some\" ? `:${d.line.value}` : \"\"})`\n                    : \"\";\n                return `${d.message}${at}`;\n            });\n            return {\n                kind: variant(\"invalid\", { diagnostics }),\n                message: diagnostics[0] ?? \"invalid call\",\n                stdout: result.stdout,\n                stderr: result.stderr,\n            };\n        }\n        case \"too_large\":\n            return {\n                kind: variant(\"too_large\", { bytes: outcome.value.bytes, limit: outcome.value.limit }),\n                message: `result too large (${outcome.value.bytes} bytes, limit ${outcome.value.limit})`,\n                stdout: result.stdout,\n                stderr: result.stderr,\n            };\n        case \"timed_out\":\n            return {\n                kind: variant(\"timed_out\", { ms: outcome.value.ms }),\n                message: `call timed out after ${outcome.value.ms}ms`,\n                stdout: result.stdout,\n                stderr: result.stderr,\n            };\n        default:\n            return transportError(`unexpected outcome \"${outcome.type}\"`);\n    }\n}\n\nfunction transportError(message: string): FuncError {\n    return {\n        kind: variant(\"transport\", { message }),\n        message,\n        stdout: \"\",\n        stderr: \"\",\n    };\n}\n\n// =============================================================================\n// Runtime\n// =============================================================================\n\n/** One tracked channel per `(workspace, name)`. */\ninterface FuncEntry {\n    status: FuncStatusTag;\n    /** Monotonic; a settling call whose seq is no longer current is\n     *  discarded (latest-wins, and `cancel` orphans by bumping it). */\n    launchSeq: number;\n    /** Decoded Output of the last `succeeded` call. */\n    result?: unknown;\n    /** Detail of the last `failed` call. */\n    error?: FuncError;\n    /** Stops the call in flight, while one is: a call that supersedes it, and\n     *  `cancel`, abort it, which asks the server to stop it. */\n    inflight?: AbortController;\n}\n\n/** Tracked-channel key. */\nexport function funcChannelKey(workspace: string, name: string): string {\n    return `func:${workspace}:${name}`;\n}\n\n/** What tells a runtime its page is going: a page's window, or a stand-in. */\nexport type FuncPage = Pick<EventTarget, \"addEventListener\" | \"removeEventListener\">;\n\n/** Options for {@link FuncRuntime}. */\nexport interface FuncRuntimeOptions {\n    /**\n     * The page whose closing stops the calls in flight: its `pagehide`, unless\n     * the page is kept for the back button (`persisted`). Default: the global\n     * object where it has events, a browser's window; none elsewhere.\n     */\n    readonly page?: FuncPage | null;\n}\n\n/** The global object as a page, where it has events: a browser's window. */\nfunction globalPage(): FuncPage | null {\n    const page: Partial<FuncPage> = globalThis;\n    return typeof page.addEventListener === \"function\" && typeof page.removeEventListener === \"function\" ? page as FuncPage : null;\n}\n\n/**\n * Encapsulates all `Func.bind` runtime state. The module-level\n * {@link defaultFuncRuntime} instance backs the registered platform; tests\n * construct their own for isolation.\n */\nexport class FuncRuntime extends TrackedChannelStore<FuncEntry> {\n    private api: FunctionApi | null = null;\n    private workspace: string | null = null;\n\n    /** The page whose closing stops the calls in flight; none outside a browser. */\n    private readonly page: FuncPage | null;\n    /** Stops watching the page, while an adapter is installed. */\n    private unwatchPage: (() => void) | null = null;\n\n    /**\n     * @param options - The page whose closing stops the calls in flight\n     */\n    constructor(options: FuncRuntimeOptions = {}) {\n        super();\n        this.page = options.page === undefined ? globalPage() : options.page;\n    }\n\n    // Signature lists are fetched once per workspace and cached.\n    private signatureLists = new Map<string, Promise<FunctionSignature[]>>();\n\n    // Compiled-handle cache (issue #106 perf): buildHandle compiles 6 East.functions\n    // per bind, and binds re-run every reactive frame. The method IR is a pure\n    // function of the function name (which fixes the handle type), and the methods\n    // resolve workspace/api LIVE, so a cached handle still re-binds. Cleared on clear().\n    private readonly handleCache = new Map<string, Record<string, unknown>>();\n\n    protected createEntry(): FuncEntry {\n        return { status: \"idle\", launchSeq: 0 };\n    }\n\n    // ----- wiring ----------------------------------------------------------\n\n    /** Install the API adapter + workspace — called by the React provider\n     *  (or a test, or the snapshot harness) before any handle is used. From\n     *  now until {@link clear}, the page closing for good stops the calls in\n     *  flight. */\n    initialize(api: FunctionApi, workspace: string): void {\n        this.api = api;\n        this.workspace = workspace;\n        this.watchPage();\n    }\n\n    /**\n     * Tear down the adapter and all call state. A call in flight is its\n     * page's, and its page is going: each is asked to stop on the server.\n     *\n     * @param api - Clear only while this is the installed adapter, so a\n     *   provider tearing down after another installed its own leaves that one\n     *   in place\n     */\n    clear(api?: FunctionApi): void {\n        if (api !== undefined && this.api !== api) return;\n        this.stopInFlight();\n        this.unwatchPage?.();\n        this.unwatchPage = null;\n        this.api = null;\n        this.workspace = null;\n        this.clearChannels();\n        this.signatureLists.clear();\n        this.handleCache.clear();\n    }\n\n    /** Stops the calls in flight once the page closes for good: a page kept\n     *  for the back button may come back, its calls with it. */\n    private watchPage(): void {\n        const page = this.page;\n        if (page === null || this.unwatchPage !== null) return;\n        const onHide = (event: Event): void => {\n            if ((event as PageTransitionEvent).persisted === true) return;\n            this.stopInFlight();\n        };\n        page.addEventListener(\"pagehide\", onHide);\n        this.unwatchPage = () => page.removeEventListener(\"pagehide\", onHide);\n    }\n\n    /** Cancels a channel's call in flight: the server is asked to stop it. */\n    private cancelCall(key: string): void {\n        this.cancelChannel(key, entry => {\n            entry.inflight?.abort();\n            delete entry.inflight;\n        });\n    }\n\n    /** Cancels every call in flight, each asked to stop on the server. */\n    private stopInFlight(): void {\n        for (const key of [...this.entries.keys()]) this.cancelCall(key);\n    }\n\n    /** The deployed signature list for a workspace (fetched once). */\n    private signatures(workspace: string): Promise<FunctionSignature[]> {\n        let promise = this.signatureLists.get(workspace);\n        if (!promise) {\n            const api = this.api;\n            if (!api) return Promise.reject(new Error(\"Func.bind: no FunctionApi installed\"));\n            promise = api.list(workspace).catch(err => {\n                // Don't cache failures — the next call retries the list.\n                this.signatureLists.delete(workspace);\n                throw err;\n            });\n            this.signatureLists.set(workspace, promise);\n        }\n        return promise;\n    }\n\n    /** Validate a declared signature against the deployed list. Returns a\n     *  FuncError when the name is unknown or the signature disagrees. */\n    private async validate(workspace: string, name: string, sig: FuncHandleSignature): Promise<FuncError | null> {\n        let list: FunctionSignature[];\n        try {\n            list = await this.signatures(workspace);\n        } catch (err) {\n            return transportError(`failed to list workspace functions: ${err instanceof Error ? err.message : String(err)}`);\n        }\n        const deployed = list.find(f => f.name === name);\n        if (!deployed) {\n            return {\n                kind: variant(\"invalid\", { diagnostics: [`no function \"${name}\" in the deployed package`] }),\n                message: `no function \"${name}\" in the deployed package`,\n                stdout: \"\",\n                stderr: \"\",\n            };\n        }\n        // East's type equality: a recursive type's wrapper ids are the server's\n        // on one side and this process's on the other, and name the same type.\n        // The handle takes the arguments alone; the inputs the function reads\n        // from the workspace are the server's to pass.\n        const argsMatch = deployed.argTypes.length === sig.inputs.length\n            && deployed.argTypes.every((t, i) => isTypeValueEqual(t, sig.inputs[i]!));\n        const outputMatches = isTypeValueEqual(deployed.outputType, sig.output);\n        if (!argsMatch || !outputMatches) {\n            const message = `signature mismatch for \"${name}\": bound (${sig.inputs.length} arguments) disagrees with the deployed package`;\n            return {\n                kind: variant(\"invalid\", { diagnostics: [message] }),\n                message,\n                stdout: \"\",\n                stderr: \"\",\n            };\n        }\n        return null;\n    }\n\n    // ----- closure semantics -------------------------------------------------\n\n    private launch(workspace: string, name: string, sig: FuncHandleSignature, args: unknown[]): void {\n        const key = funcChannelKey(workspace, name);\n        // The call this one supersedes is stopped on the server (latest-wins)\n        const controller = new AbortController();\n        const { settle: settleLaunch } = this.beginLaunch(key, e => {\n            e.inflight?.abort();\n            e.inflight = controller;\n        });\n        // A call that settles is in flight no longer\n        const settle = (mutate: (entry: FuncEntry) => void): void => settleLaunch(e => {\n            mutate(e);\n            if (e.inflight === controller) delete e.inflight;\n        });\n\n        void (async () => {\n            const invalid = await this.validate(workspace, name, sig);\n            if (invalid) {\n                settle(e => { e.status = \"failed\"; e.error = invalid; });\n                return;\n            }\n            const api = this.api;\n            if (!api) {\n                settle(e => { e.status = \"failed\"; e.error = transportError(\"no FunctionApi installed\"); });\n                return;\n            }\n            // Superseded, or cancelled, while it was validated: nothing is sent\n            if (controller.signal.aborted) return;\n            let result: ExecuteResult;\n            try {\n                const encoded = args.map((arg, i) => encodeBeast2For(sig.inputs[i]!)(arg));\n                result = await api.call(workspace, name, { args: encoded }, { signal: controller.signal });\n            } catch (err) {\n                settle(e => {\n                    e.status = \"failed\";\n                    e.error = transportError(err instanceof Error ? err.message : String(err));\n                });\n                return;\n            }\n            if (result.outcome.type === \"success\") {\n                let decoded: unknown;\n                try {\n                    decoded = decodeBeast2For(sig.output)(result.outcome.value.value);\n                } catch (err) {\n                    settle(e => {\n                        e.status = \"failed\";\n                        e.error = transportError(`failed to decode result: ${err instanceof Error ? err.message : String(err)}`);\n                    });\n                    return;\n                }\n                settle(e => { e.status = \"succeeded\"; e.result = decoded; delete e.error; });\n            } else {\n                const error = errorOfExecuteResult(result);\n                settle(e => { e.status = \"failed\"; e.error = error; });\n            }\n        })();\n    }\n\n    /**\n     * The 6 low-level primitives backing handle methods, bound to THIS runtime.\n     * Registered globally (extension registry) and included by the scoped\n     * platform (e3 `ui()` tasks) so a decoded handle re-binds to whatever runtime\n     * resolves the primitives on the decode side. The host effects (launch /\n     * channel reads + reactive tracking) live here, keyed only on the plain-data\n     * function name; the output type rides as a type-arg.\n     */\n    buildPrimitives(): PlatformFunction[] {\n        // eslint-disable-next-line @typescript-eslint/no-this-alias\n        const runtime = this;\n        const resolveWorkspace = (): string => {\n            if (!runtime.workspace) {\n                throw new Error(\"Func.bind: no workspace configured — mount a provider (or call initializeFunctionApi) first\");\n            }\n            return runtime.workspace;\n        };\n        const channel = (name: string): { key: string; entry: FuncEntry } => {\n            const key = funcChannelKey(resolveWorkspace(), name);\n            return { key, entry: runtime.entry(key) };\n        };\n        return [\n            // call: recover per-arg input types from the ArgsStruct type-arg + the\n            // values from the passed struct (field order), and the output type from O.\n            FuncBindPrimitives.call.implement((argsStructType: EastTypeValue, outputType: EastTypeValue) =>\n                (nameArg: unknown, argsStruct: unknown) => {\n                    const fields = (argsStructType as { value: { name: string; type: EastTypeValue }[] }).value;\n                    const obj = argsStruct as Record<string, unknown>;\n                    const inputs = fields.map(f => f.type);\n                    const args = fields.map(f => obj[f.name]);\n                    runtime.launch(resolveWorkspace(), nameArg as string, { inputs, output: outputType }, args);\n                    return null;\n                }),\n            FuncBindPrimitives.read.implement((_outputType: EastTypeValue) => (nameArg: unknown) => {\n                const { key, entry } = channel(nameArg as string);\n                runtime.track(key);\n                return entry.result !== undefined ? some(entry.result) : none;\n            }),\n            FuncBindPrimitives.status.implement((nameArg: unknown) => {\n                const { key, entry } = channel(nameArg as string);\n                runtime.track(key);\n                return variant(entry.status, null);\n            }),\n            FuncBindPrimitives.error.implement((nameArg: unknown) => {\n                const { key, entry } = channel(nameArg as string);\n                runtime.track(key);\n                return entry.status === \"failed\" && entry.error !== undefined\n                    ? some(entry.error)\n                    : none;\n            }),\n            FuncBindPrimitives.pending.implement((nameArg: unknown) => {\n                const { key, entry } = channel(nameArg as string);\n                runtime.track(key);\n                return entry.status === \"running\";\n            }),\n            FuncBindPrimitives.cancel.implement((nameArg: unknown) => {\n                const { key } = channel(nameArg as string);\n                // The call in flight is stopped on the server too\n                runtime.cancelCall(key);\n                return null;\n            }),\n        ];\n    }\n\n    /**\n     * Build the handle value for one `Func.bind` evaluation. The methods are\n     * thin IR-bearing `East.function`s over {@link buildPrimitives}, capturing\n     * only the function name (and the signature types via type-args) — so the\n     * handle is ordinary serializable East data (issue #106).\n     */\n    buildHandle(handleType: EastTypeValue, name: string): Record<string, unknown> {\n        // Compiled-handle cache (issue #106 perf): the name fixes the signature, so\n        // the 6 method IRs are identical across renders; methods resolve api/ws live.\n        const cached = this.handleCache.get(name);\n        if (cached) return cached;\n\n        const sig = signatureOfFuncHandleType(handleType);\n        const inputsEast = sig.inputs.map(t => fromEastTypeValue(t));\n        const outputEast = fromEastTypeValue(sig.output);\n        // Bundle the N positional call-args into one struct so a single\n        // fixed-arity primitive can carry them (call is otherwise variadic).\n        const ArgsStruct = StructType(inputsEast.map((t, i): readonly [string, EastType] => [`arg${i}`, t]));\n        const nameExpr = East.value(name, StringType);\n        const platform = this.buildPrimitives();\n        const { call, read, status, error, pending, cancel } = FuncBindPrimitives;\n\n        const handle: Record<string, unknown> = {\n            call: East.compile(East.function(inputsEast, NullType, ($, ...args) => {\n                const obj: Record<string, unknown> = {};\n                args.forEach((a, i) => { obj[`arg${i}`] = a; });\n                $.return(call([ArgsStruct, outputEast], nameExpr, East.value(obj as never, ArgsStruct)));\n            }), platform),\n            read: East.compile(East.function([], OptionType(outputEast), ($) => {\n                $.return(read([outputEast], nameExpr));\n            }), platform),\n            status: East.compile(East.function([], FuncStatusType, ($) => {\n                $.return(status(nameExpr));\n            }), platform),\n            error: East.compile(East.function([], OptionType(FuncErrorType), ($) => {\n                $.return(error(nameExpr));\n            }), platform),\n            pending: East.compile(East.function([], BooleanType, ($) => {\n                $.return(pending(nameExpr));\n            }), platform),\n            cancel: East.compile(East.function([], NullType, ($) => {\n                $.return(cancel(nameExpr));\n            }), platform),\n            binding: { name },\n        };\n        this.handleCache.set(name, handle);\n        return handle;\n    }\n\n    // ----- platform building -------------------------------------------------\n\n    /** Build a `Func.bind` PlatformFunction bound to this runtime. Pass\n     *  `allowed=null` for an unscoped impl; pass a Set of function names\n     *  for manifest scoping. */\n    buildPlatform(allowed: ReadonlySet<string> | null): PlatformFunction {\n        return funcBindPlatformFn.implement((handleType: EastTypeValue) =>\n            (nameArg: unknown) => {\n                const name = nameArg as string;\n                if (allowed && !allowed.has(name)) {\n                    throw new Error(\n                        `Func.bind: function \"${name}\" is not in this UI task's manifest — ` +\n                        `bind it in the task body so derivation records it`,\n                    );\n                }\n                return this.buildHandle(handleType, name);\n            },\n        );\n    }\n}\n\n// =============================================================================\n// Default process-global runtime + free-function exports.\n// =============================================================================\n\n/** Process-global runtime backing the `FuncPlatform` export. */\nexport const defaultFuncRuntime = new FuncRuntime();\n\n/** Install the function API adapter + workspace — called by the React\n *  provider on mount (or by a test, or the snapshot harness). */\nexport function initializeFunctionApi(api: FunctionApi, workspace: string): void {\n    defaultFuncRuntime.initialize(api, workspace);\n}\n\n/**\n * Tear down the function API adapter and all call state.\n *\n * @param api - Clear only while this is the installed adapter\n */\nexport function clearFunctionApi(api?: FunctionApi): void {\n    defaultFuncRuntime.clear(api);\n}\n\n/** Global, manifest-unscoped `Func.bind` impl + its backing primitives.\n *  Registered on module load (powers the extension registry decode path). */\nexport const FuncPlatform: PlatformFunction[] = [\n    defaultFuncRuntime.buildPlatform(null),\n    ...defaultFuncRuntime.buildPrimitives(),\n];\n\n/** Build a manifest-scoped `Func.bind` implementation + its backing primitives.\n *\n *  The `function_*` primitives MUST ship with the scoped platform: e3 `ui()`\n *  tasks render through `createScoped*()` arrays (UITaskPreview), NOT the global\n *  registry, so a serialized handle's methods would otherwise decode to\n *  \"Platform function 'function_call' is not available\". */\nexport function createScopedFuncPlatform(functions: readonly string[]): PlatformFunction[] {\n    return [\n        defaultFuncRuntime.buildPlatform(new Set(functions)),\n        ...defaultFuncRuntime.buildPrimitives(),\n    ];\n}\n\n// =============================================================================\n// In-memory FunctionApi — for a host with no server (the snapshot harness),\n// never a test, whose calls go to e3 itself (#1380): deterministic\n// implementations keyed by name; `call` round-trips arguments and results\n// through the same beast2 codecs a real server uses.\n// =============================================================================\n\n/** One offline function implementation for {@link createInMemoryFunctionApi}. */\nexport interface InMemoryFunctionDef {\n    /** Function name (what `Func.bind` is bound to). */\n    name: string;\n    /** The argument types a caller passes. */\n    argTypes: (EastType | EastTypeValue)[];\n    /** Return type. */\n    outputType: EastType | EastTypeValue;\n    /** The implementation — receives decoded args, returns the result\n     *  value (or a promise of it). */\n    fn: (...args: unknown[]) => unknown;\n}\n\n/**\n * Build an offline {@link FunctionApi} from local implementations — the\n * snapshot harness's stand-in for a deployed package.\n */\nexport function createInMemoryFunctionApi(functions: InMemoryFunctionDef[]): FunctionApi {\n    const defs = functions.map(def => ({\n        name: def.name,\n        argTypes: def.argTypes.map(t => toEastTypeValue(t as EastType)),\n        outputType: toEastTypeValue(def.outputType as EastType),\n        fn: def.fn,\n    }));\n    return {\n        async list() {\n            return defs.map(def => ({\n                name: def.name,\n                // An offline function reads nothing of a workspace.\n                inputs: [],\n                argTypes: def.argTypes,\n                outputType: def.outputType,\n                runner: variant(\"east_node\", { platforms: [], decode: variant(\"lazy\", null) }),\n            })) as unknown as FunctionSignature[];\n        },\n        async call(_workspace, fnName, req) {\n            const def = defs.find(d => d.name === fnName);\n            if (!def) throw new Error(`no in-memory function \"${fnName}\"`);\n            const args = req.args.map((bytes, i) => decodeBeast2For(def.argTypes[i]!)(bytes));\n            const value = await def.fn(...args);\n            return {\n                outcome: variant(\"success\", { value: encodeBeast2For(def.outputType)(value) }),\n                stdout: \"\",\n                stderr: \"\",\n                stdoutTruncated: false,\n                stderrTruncated: false,\n                // A call of values reads no dataset.\n                inputs: [],\n            } as ExecuteResult;\n        },\n    };\n}\n\n// =============================================================================\n// Module-load registrations — wire the default runtime into east-ui hooks.\n// Tests with their own `FuncRuntime` don't use these.\n// =============================================================================\n\nregisterReactiveTracker({\n    id: \"func-bind\",\n    enableTracking: () => defaultFuncRuntime.enableTracking(),\n    disableTracking: () => defaultFuncRuntime.disableTracking(),\n    getStore: () => ({\n        subscribe: (key, cb) => defaultFuncRuntime.subscribe(key, cb),\n        getKeyVersion: (key) => defaultFuncRuntime.getKeyVersion(key),\n    }),\n});\n\nregisterPlatformImplementation(FuncPlatform);\n","export default function cc(names) {\n  if (typeof names === \"string\" || typeof names === \"number\") return \"\" + names\n\n  let out = \"\"\n\n  if (Array.isArray(names)) {\n    for (let i = 0, tmp; i < names.length; i++) {\n      if ((tmp = cc(names[i])) !== \"\") {\n        out += (out && \" \") + tmp\n      }\n    }\n  } else {\n    for (let k in names) {\n      if (names[k]) out += (out && \" \") + k\n    }\n  }\n\n  return out\n}\n","var noop = {value: () => {}};\n\nfunction dispatch() {\n  for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n    if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n    _[t] = [];\n  }\n  return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n  this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n  return typenames.trim().split(/^|\\s+/).map(function(t) {\n    var name = \"\", i = t.indexOf(\".\");\n    if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n    if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n    return {type: t, name: name};\n  });\n}\n\nDispatch.prototype = dispatch.prototype = {\n  constructor: Dispatch,\n  on: function(typename, callback) {\n    var _ = this._,\n        T = parseTypenames(typename + \"\", _),\n        t,\n        i = -1,\n        n = T.length;\n\n    // If no callback was specified, return the callback of the given type and name.\n    if (arguments.length < 2) {\n      while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n      return;\n    }\n\n    // If a type was specified, set the callback for the given type and name.\n    // Otherwise, if a null callback was specified, remove callbacks of the given name.\n    if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n    while (++i < n) {\n      if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n      else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n    }\n\n    return this;\n  },\n  copy: function() {\n    var copy = {}, _ = this._;\n    for (var t in _) copy[t] = _[t].slice();\n    return new Dispatch(copy);\n  },\n  call: function(type, that) {\n    if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n    if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n    for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n  },\n  apply: function(type, that, args) {\n    if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n    for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n  }\n};\n\nfunction get(type, name) {\n  for (var i = 0, n = type.length, c; i < n; ++i) {\n    if ((c = type[i]).name === name) {\n      return c.value;\n    }\n  }\n}\n\nfunction set(type, name, callback) {\n  for (var i = 0, n = type.length; i < n; ++i) {\n    if (type[i].name === name) {\n      type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n      break;\n    }\n  }\n  if (callback != null) type.push({name: name, value: callback});\n  return type;\n}\n\nexport default dispatch;\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n  svg: \"http://www.w3.org/2000/svg\",\n  xhtml: xhtml,\n  xlink: \"http://www.w3.org/1999/xlink\",\n  xml: \"http://www.w3.org/XML/1998/namespace\",\n  xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n  var prefix = name += \"\", i = prefix.indexOf(\":\");\n  if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n  return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n","import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n  return function() {\n    var document = this.ownerDocument,\n        uri = this.namespaceURI;\n    return uri === xhtml && document.documentElement.namespaceURI === xhtml\n        ? document.createElement(name)\n        : document.createElementNS(uri, name);\n  };\n}\n\nfunction creatorFixed(fullname) {\n  return function() {\n    return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n  };\n}\n\nexport default function(name) {\n  var fullname = namespace(name);\n  return (fullname.local\n      ? creatorFixed\n      : creatorInherit)(fullname);\n}\n","function none() {}\n\nexport default function(selector) {\n  return selector == null ? none : function() {\n    return this.querySelector(selector);\n  };\n}\n","import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n  if (typeof select !== \"function\") select = selector(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n      if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n        if (\"__data__\" in node) subnode.__data__ = node.__data__;\n        subgroup[i] = subnode;\n      }\n    }\n  }\n\n  return new Selection(subgroups, this._parents);\n}\n","// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don’t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n  return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n","function empty() {\n  return [];\n}\n\nexport default function(selector) {\n  return selector == null ? empty : function() {\n    return this.querySelectorAll(selector);\n  };\n}\n","import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n  return function() {\n    return array(select.apply(this, arguments));\n  };\n}\n\nexport default function(select) {\n  if (typeof select === \"function\") select = arrayAll(select);\n  else select = selectorAll(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        subgroups.push(select.call(node, node.__data__, i, group));\n        parents.push(node);\n      }\n    }\n  }\n\n  return new Selection(subgroups, parents);\n}\n","export default function(selector) {\n  return function() {\n    return this.matches(selector);\n  };\n}\n\nexport function childMatcher(selector) {\n  return function(node) {\n    return node.matches(selector);\n  };\n}\n\n","import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n  return function() {\n    return find.call(this.children, match);\n  };\n}\n\nfunction childFirst() {\n  return this.firstElementChild;\n}\n\nexport default function(match) {\n  return this.select(match == null ? childFirst\n      : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n  return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n  return function() {\n    return filter.call(this.children, match);\n  };\n}\n\nexport default function(match) {\n  return this.selectAll(match == null ? children\n      : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n","import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n  if (typeof match !== \"function\") match = matcher(match);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n      if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n        subgroup.push(node);\n      }\n    }\n  }\n\n  return new Selection(subgroups, this._parents);\n}\n","export default function(update) {\n  return new Array(update.length);\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n  return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n  this.ownerDocument = parent.ownerDocument;\n  this.namespaceURI = parent.namespaceURI;\n  this._next = null;\n  this._parent = parent;\n  this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n  constructor: EnterNode,\n  appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n  insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n  querySelector: function(selector) { return this._parent.querySelector(selector); },\n  querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","export default function(x) {\n  return function() {\n    return x;\n  };\n}\n","import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n  var i = 0,\n      node,\n      groupLength = group.length,\n      dataLength = data.length;\n\n  // Put any non-null nodes that fit into update.\n  // Put any null nodes into enter.\n  // Put any remaining data into enter.\n  for (; i < dataLength; ++i) {\n    if (node = group[i]) {\n      node.__data__ = data[i];\n      update[i] = node;\n    } else {\n      enter[i] = new EnterNode(parent, data[i]);\n    }\n  }\n\n  // Put any non-null nodes that don’t fit into exit.\n  for (; i < groupLength; ++i) {\n    if (node = group[i]) {\n      exit[i] = node;\n    }\n  }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n  var i,\n      node,\n      nodeByKeyValue = new Map,\n      groupLength = group.length,\n      dataLength = data.length,\n      keyValues = new Array(groupLength),\n      keyValue;\n\n  // Compute the key for each node.\n  // If multiple nodes have the same key, the duplicates are added to exit.\n  for (i = 0; i < groupLength; ++i) {\n    if (node = group[i]) {\n      keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n      if (nodeByKeyValue.has(keyValue)) {\n        exit[i] = node;\n      } else {\n        nodeByKeyValue.set(keyValue, node);\n      }\n    }\n  }\n\n  // Compute the key for each datum.\n  // If there a node associated with this key, join and add it to update.\n  // If there is not (or the key is a duplicate), add it to enter.\n  for (i = 0; i < dataLength; ++i) {\n    keyValue = key.call(parent, data[i], i, data) + \"\";\n    if (node = nodeByKeyValue.get(keyValue)) {\n      update[i] = node;\n      node.__data__ = data[i];\n      nodeByKeyValue.delete(keyValue);\n    } else {\n      enter[i] = new EnterNode(parent, data[i]);\n    }\n  }\n\n  // Add any remaining nodes that were not bound to data to exit.\n  for (i = 0; i < groupLength; ++i) {\n    if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n      exit[i] = node;\n    }\n  }\n}\n\nfunction datum(node) {\n  return node.__data__;\n}\n\nexport default function(value, key) {\n  if (!arguments.length) return Array.from(this, datum);\n\n  var bind = key ? bindKey : bindIndex,\n      parents = this._parents,\n      groups = this._groups;\n\n  if (typeof value !== \"function\") value = constant(value);\n\n  for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n    var parent = parents[j],\n        group = groups[j],\n        groupLength = group.length,\n        data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n        dataLength = data.length,\n        enterGroup = enter[j] = new Array(dataLength),\n        updateGroup = update[j] = new Array(dataLength),\n        exitGroup = exit[j] = new Array(groupLength);\n\n    bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n    // Now connect the enter nodes to their following update node, such that\n    // appendChild can insert the materialized enter node before this node,\n    // rather than at the end of the parent node.\n    for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n      if (previous = enterGroup[i0]) {\n        if (i0 >= i1) i1 = i0 + 1;\n        while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n        previous._next = next || null;\n      }\n    }\n  }\n\n  update = new Selection(update, parents);\n  update._enter = enter;\n  update._exit = exit;\n  return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn’t worried about “live” collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don’t; we’d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n  return typeof data === \"object\" && \"length\" in data\n    ? data // Array, TypedArray, NodeList, array-like\n    : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n","import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n  return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n  var enter = this.enter(), update = this, exit = this.exit();\n  if (typeof onenter === \"function\") {\n    enter = onenter(enter);\n    if (enter) enter = enter.selection();\n  } else {\n    enter = enter.append(onenter + \"\");\n  }\n  if (onupdate != null) {\n    update = onupdate(update);\n    if (update) update = update.selection();\n  }\n  if (onexit == null) exit.remove(); else onexit(exit);\n  return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(context) {\n  var selection = context.selection ? context.selection() : context;\n\n  for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n    for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group0[i] || group1[i]) {\n        merge[i] = node;\n      }\n    }\n  }\n\n  for (; j < m0; ++j) {\n    merges[j] = groups0[j];\n  }\n\n  return new Selection(merges, this._parents);\n}\n","export default function() {\n\n  for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n    for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n      if (node = group[i]) {\n        if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n        next = node;\n      }\n    }\n  }\n\n  return this;\n}\n","import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n  if (!compare) compare = ascending;\n\n  function compareNode(a, b) {\n    return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n  }\n\n  for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        sortgroup[i] = node;\n      }\n    }\n    sortgroup.sort(compareNode);\n  }\n\n  return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function() {\n  var callback = arguments[0];\n  arguments[0] = this;\n  callback.apply(null, arguments);\n  return this;\n}\n","export default function() {\n  return Array.from(this);\n}\n","export default function() {\n\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n      var node = group[i];\n      if (node) return node;\n    }\n  }\n\n  return null;\n}\n","export default function() {\n  let size = 0;\n  for (const node of this) ++size; // eslint-disable-line no-unused-vars\n  return size;\n}\n","export default function() {\n  return !this.node();\n}\n","export default function(callback) {\n\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n      if (node = group[i]) callback.call(node, node.__data__, i, group);\n    }\n  }\n\n  return this;\n}\n","import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n  return function() {\n    this.removeAttribute(name);\n  };\n}\n\nfunction attrRemoveNS(fullname) {\n  return function() {\n    this.removeAttributeNS(fullname.space, fullname.local);\n  };\n}\n\nfunction attrConstant(name, value) {\n  return function() {\n    this.setAttribute(name, value);\n  };\n}\n\nfunction attrConstantNS(fullname, value) {\n  return function() {\n    this.setAttributeNS(fullname.space, fullname.local, value);\n  };\n}\n\nfunction attrFunction(name, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.removeAttribute(name);\n    else this.setAttribute(name, v);\n  };\n}\n\nfunction attrFunctionNS(fullname, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n    else this.setAttributeNS(fullname.space, fullname.local, v);\n  };\n}\n\nexport default function(name, value) {\n  var fullname = namespace(name);\n\n  if (arguments.length < 2) {\n    var node = this.node();\n    return fullname.local\n        ? node.getAttributeNS(fullname.space, fullname.local)\n        : node.getAttribute(fullname);\n  }\n\n  return this.each((value == null\n      ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n      ? (fullname.local ? attrFunctionNS : attrFunction)\n      : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n  return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n      || (node.document && node) // node is a Window\n      || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n  return function() {\n    this.style.removeProperty(name);\n  };\n}\n\nfunction styleConstant(name, value, priority) {\n  return function() {\n    this.style.setProperty(name, value, priority);\n  };\n}\n\nfunction styleFunction(name, value, priority) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.style.removeProperty(name);\n    else this.style.setProperty(name, v, priority);\n  };\n}\n\nexport default function(name, value, priority) {\n  return arguments.length > 1\n      ? this.each((value == null\n            ? styleRemove : typeof value === \"function\"\n            ? styleFunction\n            : styleConstant)(name, value, priority == null ? \"\" : priority))\n      : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n  return node.style.getPropertyValue(name)\n      || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function propertyRemove(name) {\n  return function() {\n    delete this[name];\n  };\n}\n\nfunction propertyConstant(name, value) {\n  return function() {\n    this[name] = value;\n  };\n}\n\nfunction propertyFunction(name, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) delete this[name];\n    else this[name] = v;\n  };\n}\n\nexport default function(name, value) {\n  return arguments.length > 1\n      ? this.each((value == null\n          ? propertyRemove : typeof value === \"function\"\n          ? propertyFunction\n          : propertyConstant)(name, value))\n      : this.node()[name];\n}\n","function classArray(string) {\n  return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n  return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n  this._node = node;\n  this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n  add: function(name) {\n    var i = this._names.indexOf(name);\n    if (i < 0) {\n      this._names.push(name);\n      this._node.setAttribute(\"class\", this._names.join(\" \"));\n    }\n  },\n  remove: function(name) {\n    var i = this._names.indexOf(name);\n    if (i >= 0) {\n      this._names.splice(i, 1);\n      this._node.setAttribute(\"class\", this._names.join(\" \"));\n    }\n  },\n  contains: function(name) {\n    return this._names.indexOf(name) >= 0;\n  }\n};\n\nfunction classedAdd(node, names) {\n  var list = classList(node), i = -1, n = names.length;\n  while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n  var list = classList(node), i = -1, n = names.length;\n  while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n  return function() {\n    classedAdd(this, names);\n  };\n}\n\nfunction classedFalse(names) {\n  return function() {\n    classedRemove(this, names);\n  };\n}\n\nfunction classedFunction(names, value) {\n  return function() {\n    (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n  };\n}\n\nexport default function(name, value) {\n  var names = classArray(name + \"\");\n\n  if (arguments.length < 2) {\n    var list = classList(this.node()), i = -1, n = names.length;\n    while (++i < n) if (!list.contains(names[i])) return false;\n    return true;\n  }\n\n  return this.each((typeof value === \"function\"\n      ? classedFunction : value\n      ? classedTrue\n      : classedFalse)(names, value));\n}\n","function textRemove() {\n  this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n  return function() {\n    this.textContent = value;\n  };\n}\n\nfunction textFunction(value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    this.textContent = v == null ? \"\" : v;\n  };\n}\n\nexport default function(value) {\n  return arguments.length\n      ? this.each(value == null\n          ? textRemove : (typeof value === \"function\"\n          ? textFunction\n          : textConstant)(value))\n      : this.node().textContent;\n}\n","function htmlRemove() {\n  this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n  return function() {\n    this.innerHTML = value;\n  };\n}\n\nfunction htmlFunction(value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    this.innerHTML = v == null ? \"\" : v;\n  };\n}\n\nexport default function(value) {\n  return arguments.length\n      ? this.each(value == null\n          ? htmlRemove : (typeof value === \"function\"\n          ? htmlFunction\n          : htmlConstant)(value))\n      : this.node().innerHTML;\n}\n","function raise() {\n  if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n  return this.each(raise);\n}\n","function lower() {\n  if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n  return this.each(lower);\n}\n","import creator from \"../creator.js\";\n\nexport default function(name) {\n  var create = typeof name === \"function\" ? name : creator(name);\n  return this.select(function() {\n    return this.appendChild(create.apply(this, arguments));\n  });\n}\n","import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n  return null;\n}\n\nexport default function(name, before) {\n  var create = typeof name === \"function\" ? name : creator(name),\n      select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n  return this.select(function() {\n    return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n  });\n}\n","function remove() {\n  var parent = this.parentNode;\n  if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n  return this.each(remove);\n}\n","function selection_cloneShallow() {\n  var clone = this.cloneNode(false), parent = this.parentNode;\n  return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n  var clone = this.cloneNode(true), parent = this.parentNode;\n  return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n  return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","export default function(value) {\n  return arguments.length\n      ? this.property(\"__data__\", value)\n      : this.node().__data__;\n}\n","function contextListener(listener) {\n  return function(event) {\n    listener.call(this, event, this.__data__);\n  };\n}\n\nfunction parseTypenames(typenames) {\n  return typenames.trim().split(/^|\\s+/).map(function(t) {\n    var name = \"\", i = t.indexOf(\".\");\n    if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n    return {type: t, name: name};\n  });\n}\n\nfunction onRemove(typename) {\n  return function() {\n    var on = this.__on;\n    if (!on) return;\n    for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n      if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n        this.removeEventListener(o.type, o.listener, o.options);\n      } else {\n        on[++i] = o;\n      }\n    }\n    if (++i) on.length = i;\n    else delete this.__on;\n  };\n}\n\nfunction onAdd(typename, value, options) {\n  return function() {\n    var on = this.__on, o, listener = contextListener(value);\n    if (on) for (var j = 0, m = on.length; j < m; ++j) {\n      if ((o = on[j]).type === typename.type && o.name === typename.name) {\n        this.removeEventListener(o.type, o.listener, o.options);\n        this.addEventListener(o.type, o.listener = listener, o.options = options);\n        o.value = value;\n        return;\n      }\n    }\n    this.addEventListener(typename.type, listener, options);\n    o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n    if (!on) this.__on = [o];\n    else on.push(o);\n  };\n}\n\nexport default function(typename, value, options) {\n  var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n  if (arguments.length < 2) {\n    var on = this.node().__on;\n    if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n      for (i = 0, o = on[j]; i < n; ++i) {\n        if ((t = typenames[i]).type === o.type && t.name === o.name) {\n          return o.value;\n        }\n      }\n    }\n    return;\n  }\n\n  on = value ? onAdd : onRemove;\n  for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n  return this;\n}\n","import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n  var window = defaultView(node),\n      event = window.CustomEvent;\n\n  if (typeof event === \"function\") {\n    event = new event(type, params);\n  } else {\n    event = window.document.createEvent(\"Event\");\n    if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n    else event.initEvent(type, false, false);\n  }\n\n  node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n  return function() {\n    return dispatchEvent(this, type, params);\n  };\n}\n\nfunction dispatchFunction(type, params) {\n  return function() {\n    return dispatchEvent(this, type, params.apply(this, arguments));\n  };\n}\n\nexport default function(type, params) {\n  return this.each((typeof params === \"function\"\n      ? dispatchFunction\n      : dispatchConstant)(type, params));\n}\n","export default function*() {\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n      if (node = group[i]) yield node;\n    }\n  }\n}\n","import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n  this._groups = groups;\n  this._parents = parents;\n}\n\nfunction selection() {\n  return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n  return this;\n}\n\nSelection.prototype = selection.prototype = {\n  constructor: Selection,\n  select: selection_select,\n  selectAll: selection_selectAll,\n  selectChild: selection_selectChild,\n  selectChildren: selection_selectChildren,\n  filter: selection_filter,\n  data: selection_data,\n  enter: selection_enter,\n  exit: selection_exit,\n  join: selection_join,\n  merge: selection_merge,\n  selection: selection_selection,\n  order: selection_order,\n  sort: selection_sort,\n  call: selection_call,\n  nodes: selection_nodes,\n  node: selection_node,\n  size: selection_size,\n  empty: selection_empty,\n  each: selection_each,\n  attr: selection_attr,\n  style: selection_style,\n  property: selection_property,\n  classed: selection_classed,\n  text: selection_text,\n  html: selection_html,\n  raise: selection_raise,\n  lower: selection_lower,\n  append: selection_append,\n  insert: selection_insert,\n  remove: selection_remove,\n  clone: selection_clone,\n  datum: selection_datum,\n  on: selection_on,\n  dispatch: selection_dispatch,\n  [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n","import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n  return typeof selector === \"string\"\n      ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n      : new Selection([[selector]], root);\n}\n","export default function(event) {\n  let sourceEvent;\n  while (sourceEvent = event.sourceEvent) event = sourceEvent;\n  return event;\n}\n","import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n  event = sourceEvent(event);\n  if (node === undefined) node = event.currentTarget;\n  if (node) {\n    var svg = node.ownerSVGElement || node;\n    if (svg.createSVGPoint) {\n      var point = svg.createSVGPoint();\n      point.x = event.clientX, point.y = event.clientY;\n      point = point.matrixTransform(node.getScreenCTM().inverse());\n      return [point.x, point.y];\n    }\n    if (node.getBoundingClientRect) {\n      var rect = node.getBoundingClientRect();\n      return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n    }\n  }\n  return [event.pageX, event.pageY];\n}\n","// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n  event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n  event.preventDefault();\n  event.stopImmediatePropagation();\n}\n","import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n  var root = view.document.documentElement,\n      selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n  if (\"onselectstart\" in root) {\n    selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n  } else {\n    root.__noselect = root.style.MozUserSelect;\n    root.style.MozUserSelect = \"none\";\n  }\n}\n\nexport function yesdrag(view, noclick) {\n  var root = view.document.documentElement,\n      selection = select(view).on(\"dragstart.drag\", null);\n  if (noclick) {\n    selection.on(\"click.drag\", noevent, nonpassivecapture);\n    setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n  }\n  if (\"onselectstart\" in root) {\n    selection.on(\"selectstart.drag\", null);\n  } else {\n    root.style.MozUserSelect = root.__noselect;\n    delete root.__noselect;\n  }\n}\n","export default x => () => x;\n","export default function DragEvent(type, {\n  sourceEvent,\n  subject,\n  target,\n  identifier,\n  active,\n  x, y, dx, dy,\n  dispatch\n}) {\n  Object.defineProperties(this, {\n    type: {value: type, enumerable: true, configurable: true},\n    sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n    subject: {value: subject, enumerable: true, configurable: true},\n    target: {value: target, enumerable: true, configurable: true},\n    identifier: {value: identifier, enumerable: true, configurable: true},\n    active: {value: active, enumerable: true, configurable: true},\n    x: {value: x, enumerable: true, configurable: true},\n    y: {value: y, enumerable: true, configurable: true},\n    dx: {value: dx, enumerable: true, configurable: true},\n    dy: {value: dy, enumerable: true, configurable: true},\n    _: {value: dispatch}\n  });\n}\n\nDragEvent.prototype.on = function() {\n  var value = this._.on.apply(this._, arguments);\n  return value === this._ ? this : value;\n};\n","import {dispatch} from \"d3-dispatch\";\nimport {select, pointer} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag.js\";\nimport noevent, {nonpassive, nonpassivecapture, nopropagation} from \"./noevent.js\";\nimport constant from \"./constant.js\";\nimport DragEvent from \"./event.js\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n  return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n  return this.parentNode;\n}\n\nfunction defaultSubject(event, d) {\n  return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n  return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nexport default function() {\n  var filter = defaultFilter,\n      container = defaultContainer,\n      subject = defaultSubject,\n      touchable = defaultTouchable,\n      gestures = {},\n      listeners = dispatch(\"start\", \"drag\", \"end\"),\n      active = 0,\n      mousedownx,\n      mousedowny,\n      mousemoving,\n      touchending,\n      clickDistance2 = 0;\n\n  function drag(selection) {\n    selection\n        .on(\"mousedown.drag\", mousedowned)\n      .filter(touchable)\n        .on(\"touchstart.drag\", touchstarted)\n        .on(\"touchmove.drag\", touchmoved, nonpassive)\n        .on(\"touchend.drag touchcancel.drag\", touchended)\n        .style(\"touch-action\", \"none\")\n        .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n  }\n\n  function mousedowned(event, d) {\n    if (touchending || !filter.call(this, event, d)) return;\n    var gesture = beforestart(this, container.call(this, event, d), event, d, \"mouse\");\n    if (!gesture) return;\n    select(event.view)\n      .on(\"mousemove.drag\", mousemoved, nonpassivecapture)\n      .on(\"mouseup.drag\", mouseupped, nonpassivecapture);\n    nodrag(event.view);\n    nopropagation(event);\n    mousemoving = false;\n    mousedownx = event.clientX;\n    mousedowny = event.clientY;\n    gesture(\"start\", event);\n  }\n\n  function mousemoved(event) {\n    noevent(event);\n    if (!mousemoving) {\n      var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n      mousemoving = dx * dx + dy * dy > clickDistance2;\n    }\n    gestures.mouse(\"drag\", event);\n  }\n\n  function mouseupped(event) {\n    select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n    yesdrag(event.view, mousemoving);\n    noevent(event);\n    gestures.mouse(\"end\", event);\n  }\n\n  function touchstarted(event, d) {\n    if (!filter.call(this, event, d)) return;\n    var touches = event.changedTouches,\n        c = container.call(this, event, d),\n        n = touches.length, i, gesture;\n\n    for (i = 0; i < n; ++i) {\n      if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) {\n        nopropagation(event);\n        gesture(\"start\", event, touches[i]);\n      }\n    }\n  }\n\n  function touchmoved(event) {\n    var touches = event.changedTouches,\n        n = touches.length, i, gesture;\n\n    for (i = 0; i < n; ++i) {\n      if (gesture = gestures[touches[i].identifier]) {\n        noevent(event);\n        gesture(\"drag\", event, touches[i]);\n      }\n    }\n  }\n\n  function touchended(event) {\n    var touches = event.changedTouches,\n        n = touches.length, i, gesture;\n\n    if (touchending) clearTimeout(touchending);\n    touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n    for (i = 0; i < n; ++i) {\n      if (gesture = gestures[touches[i].identifier]) {\n        nopropagation(event);\n        gesture(\"end\", event, touches[i]);\n      }\n    }\n  }\n\n  function beforestart(that, container, event, d, identifier, touch) {\n    var dispatch = listeners.copy(),\n        p = pointer(touch || event, container), dx, dy,\n        s;\n\n    if ((s = subject.call(that, new DragEvent(\"beforestart\", {\n        sourceEvent: event,\n        target: drag,\n        identifier,\n        active,\n        x: p[0],\n        y: p[1],\n        dx: 0,\n        dy: 0,\n        dispatch\n      }), d)) == null) return;\n\n    dx = s.x - p[0] || 0;\n    dy = s.y - p[1] || 0;\n\n    return function gesture(type, event, touch) {\n      var p0 = p, n;\n      switch (type) {\n        case \"start\": gestures[identifier] = gesture, n = active++; break;\n        case \"end\": delete gestures[identifier], --active; // falls through\n        case \"drag\": p = pointer(touch || event, container), n = active; break;\n      }\n      dispatch.call(\n        type,\n        that,\n        new DragEvent(type, {\n          sourceEvent: event,\n          subject: s,\n          target: drag,\n          identifier,\n          active: n,\n          x: p[0] + dx,\n          y: p[1] + dy,\n          dx: p[0] - p0[0],\n          dy: p[1] - p0[1],\n          dispatch\n        }),\n        d\n      );\n    };\n  }\n\n  drag.filter = function(_) {\n    return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n  };\n\n  drag.container = function(_) {\n    return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n  };\n\n  drag.subject = function(_) {\n    return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n  };\n\n  drag.touchable = function(_) {\n    return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n  };\n\n  drag.on = function() {\n    var value = listeners.on.apply(listeners, arguments);\n    return value === listeners ? drag : value;\n  };\n\n  drag.clickDistance = function(_) {\n    return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n  };\n\n  return drag;\n}\n","export default function(constructor, factory, prototype) {\n  constructor.prototype = factory.prototype = prototype;\n  prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n  var prototype = Object.create(parent.prototype);\n  for (var key in definition) prototype[key] = definition[key];\n  return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n    reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n    reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n    reHex = /^#([0-9a-f]{3,8})$/,\n    reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n    reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n    reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n    reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n    reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n    reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n  aliceblue: 0xf0f8ff,\n  antiquewhite: 0xfaebd7,\n  aqua: 0x00ffff,\n  aquamarine: 0x7fffd4,\n  azure: 0xf0ffff,\n  beige: 0xf5f5dc,\n  bisque: 0xffe4c4,\n  black: 0x000000,\n  blanchedalmond: 0xffebcd,\n  blue: 0x0000ff,\n  blueviolet: 0x8a2be2,\n  brown: 0xa52a2a,\n  burlywood: 0xdeb887,\n  cadetblue: 0x5f9ea0,\n  chartreuse: 0x7fff00,\n  chocolate: 0xd2691e,\n  coral: 0xff7f50,\n  cornflowerblue: 0x6495ed,\n  cornsilk: 0xfff8dc,\n  crimson: 0xdc143c,\n  cyan: 0x00ffff,\n  darkblue: 0x00008b,\n  darkcyan: 0x008b8b,\n  darkgoldenrod: 0xb8860b,\n  darkgray: 0xa9a9a9,\n  darkgreen: 0x006400,\n  darkgrey: 0xa9a9a9,\n  darkkhaki: 0xbdb76b,\n  darkmagenta: 0x8b008b,\n  darkolivegreen: 0x556b2f,\n  darkorange: 0xff8c00,\n  darkorchid: 0x9932cc,\n  darkred: 0x8b0000,\n  darksalmon: 0xe9967a,\n  darkseagreen: 0x8fbc8f,\n  darkslateblue: 0x483d8b,\n  darkslategray: 0x2f4f4f,\n  darkslategrey: 0x2f4f4f,\n  darkturquoise: 0x00ced1,\n  darkviolet: 0x9400d3,\n  deeppink: 0xff1493,\n  deepskyblue: 0x00bfff,\n  dimgray: 0x696969,\n  dimgrey: 0x696969,\n  dodgerblue: 0x1e90ff,\n  firebrick: 0xb22222,\n  floralwhite: 0xfffaf0,\n  forestgreen: 0x228b22,\n  fuchsia: 0xff00ff,\n  gainsboro: 0xdcdcdc,\n  ghostwhite: 0xf8f8ff,\n  gold: 0xffd700,\n  goldenrod: 0xdaa520,\n  gray: 0x808080,\n  green: 0x008000,\n  greenyellow: 0xadff2f,\n  grey: 0x808080,\n  honeydew: 0xf0fff0,\n  hotpink: 0xff69b4,\n  indianred: 0xcd5c5c,\n  indigo: 0x4b0082,\n  ivory: 0xfffff0,\n  khaki: 0xf0e68c,\n  lavender: 0xe6e6fa,\n  lavenderblush: 0xfff0f5,\n  lawngreen: 0x7cfc00,\n  lemonchiffon: 0xfffacd,\n  lightblue: 0xadd8e6,\n  lightcoral: 0xf08080,\n  lightcyan: 0xe0ffff,\n  lightgoldenrodyellow: 0xfafad2,\n  lightgray: 0xd3d3d3,\n  lightgreen: 0x90ee90,\n  lightgrey: 0xd3d3d3,\n  lightpink: 0xffb6c1,\n  lightsalmon: 0xffa07a,\n  lightseagreen: 0x20b2aa,\n  lightskyblue: 0x87cefa,\n  lightslategray: 0x778899,\n  lightslategrey: 0x778899,\n  lightsteelblue: 0xb0c4de,\n  lightyellow: 0xffffe0,\n  lime: 0x00ff00,\n  limegreen: 0x32cd32,\n  linen: 0xfaf0e6,\n  magenta: 0xff00ff,\n  maroon: 0x800000,\n  mediumaquamarine: 0x66cdaa,\n  mediumblue: 0x0000cd,\n  mediumorchid: 0xba55d3,\n  mediumpurple: 0x9370db,\n  mediumseagreen: 0x3cb371,\n  mediumslateblue: 0x7b68ee,\n  mediumspringgreen: 0x00fa9a,\n  mediumturquoise: 0x48d1cc,\n  mediumvioletred: 0xc71585,\n  midnightblue: 0x191970,\n  mintcream: 0xf5fffa,\n  mistyrose: 0xffe4e1,\n  moccasin: 0xffe4b5,\n  navajowhite: 0xffdead,\n  navy: 0x000080,\n  oldlace: 0xfdf5e6,\n  olive: 0x808000,\n  olivedrab: 0x6b8e23,\n  orange: 0xffa500,\n  orangered: 0xff4500,\n  orchid: 0xda70d6,\n  palegoldenrod: 0xeee8aa,\n  palegreen: 0x98fb98,\n  paleturquoise: 0xafeeee,\n  palevioletred: 0xdb7093,\n  papayawhip: 0xffefd5,\n  peachpuff: 0xffdab9,\n  peru: 0xcd853f,\n  pink: 0xffc0cb,\n  plum: 0xdda0dd,\n  powderblue: 0xb0e0e6,\n  purple: 0x800080,\n  rebeccapurple: 0x663399,\n  red: 0xff0000,\n  rosybrown: 0xbc8f8f,\n  royalblue: 0x4169e1,\n  saddlebrown: 0x8b4513,\n  salmon: 0xfa8072,\n  sandybrown: 0xf4a460,\n  seagreen: 0x2e8b57,\n  seashell: 0xfff5ee,\n  sienna: 0xa0522d,\n  silver: 0xc0c0c0,\n  skyblue: 0x87ceeb,\n  slateblue: 0x6a5acd,\n  slategray: 0x708090,\n  slategrey: 0x708090,\n  snow: 0xfffafa,\n  springgreen: 0x00ff7f,\n  steelblue: 0x4682b4,\n  tan: 0xd2b48c,\n  teal: 0x008080,\n  thistle: 0xd8bfd8,\n  tomato: 0xff6347,\n  turquoise: 0x40e0d0,\n  violet: 0xee82ee,\n  wheat: 0xf5deb3,\n  white: 0xffffff,\n  whitesmoke: 0xf5f5f5,\n  yellow: 0xffff00,\n  yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n  copy(channels) {\n    return Object.assign(new this.constructor, this, channels);\n  },\n  displayable() {\n    return this.rgb().displayable();\n  },\n  hex: color_formatHex, // Deprecated! Use color.formatHex.\n  formatHex: color_formatHex,\n  formatHex8: color_formatHex8,\n  formatHsl: color_formatHsl,\n  formatRgb: color_formatRgb,\n  toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n  return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n  return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n  return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n  return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n  var m, l;\n  format = (format + \"\").trim().toLowerCase();\n  return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n      : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n      : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n      : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n      : null) // invalid hex\n      : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n      : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n      : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n      : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n      : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n      : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n      : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n      : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n      : null;\n}\n\nfunction rgbn(n) {\n  return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n  if (a <= 0) r = g = b = NaN;\n  return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n  if (!(o instanceof Color)) o = color(o);\n  if (!o) return new Rgb;\n  o = o.rgb();\n  return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n  return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n  this.r = +r;\n  this.g = +g;\n  this.b = +b;\n  this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n  brighter(k) {\n    k = k == null ? brighter : Math.pow(brighter, k);\n    return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n  },\n  darker(k) {\n    k = k == null ? darker : Math.pow(darker, k);\n    return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n  },\n  rgb() {\n    return this;\n  },\n  clamp() {\n    return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n  },\n  displayable() {\n    return (-0.5 <= this.r && this.r < 255.5)\n        && (-0.5 <= this.g && this.g < 255.5)\n        && (-0.5 <= this.b && this.b < 255.5)\n        && (0 <= this.opacity && this.opacity <= 1);\n  },\n  hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n  formatHex: rgb_formatHex,\n  formatHex8: rgb_formatHex8,\n  formatRgb: rgb_formatRgb,\n  toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n  const a = clampa(this.opacity);\n  return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n  return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n  return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n  value = clampi(value);\n  return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n  if (a <= 0) h = s = l = NaN;\n  else if (l <= 0 || l >= 1) h = s = NaN;\n  else if (s <= 0) h = NaN;\n  return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n  if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n  if (!(o instanceof Color)) o = color(o);\n  if (!o) return new Hsl;\n  if (o instanceof Hsl) return o;\n  o = o.rgb();\n  var r = o.r / 255,\n      g = o.g / 255,\n      b = o.b / 255,\n      min = Math.min(r, g, b),\n      max = Math.max(r, g, b),\n      h = NaN,\n      s = max - min,\n      l = (max + min) / 2;\n  if (s) {\n    if (r === max) h = (g - b) / s + (g < b) * 6;\n    else if (g === max) h = (b - r) / s + 2;\n    else h = (r - g) / s + 4;\n    s /= l < 0.5 ? max + min : 2 - max - min;\n    h *= 60;\n  } else {\n    s = l > 0 && l < 1 ? 0 : h;\n  }\n  return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n  return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n  this.h = +h;\n  this.s = +s;\n  this.l = +l;\n  this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n  brighter(k) {\n    k = k == null ? brighter : Math.pow(brighter, k);\n    return new Hsl(this.h, this.s, this.l * k, this.opacity);\n  },\n  darker(k) {\n    k = k == null ? darker : Math.pow(darker, k);\n    return new Hsl(this.h, this.s, this.l * k, this.opacity);\n  },\n  rgb() {\n    var h = this.h % 360 + (this.h < 0) * 360,\n        s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n        l = this.l,\n        m2 = l + (l < 0.5 ? l : 1 - l) * s,\n        m1 = 2 * l - m2;\n    return new Rgb(\n      hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n      hsl2rgb(h, m1, m2),\n      hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n      this.opacity\n    );\n  },\n  clamp() {\n    return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n  },\n  displayable() {\n    return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n        && (0 <= this.l && this.l <= 1)\n        && (0 <= this.opacity && this.opacity <= 1);\n  },\n  formatHsl() {\n    const a = clampa(this.opacity);\n    return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n  }\n}));\n\nfunction clamph(value) {\n  value = (value || 0) % 360;\n  return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n  return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n  return (h < 60 ? m1 + (m2 - m1) * h / 60\n      : h < 180 ? m2\n      : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n      : m1) * 255;\n}\n","export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n    Xn = 0.96422,\n    Yn = 1,\n    Zn = 0.82521,\n    t0 = 4 / 29,\n    t1 = 6 / 29,\n    t2 = 3 * t1 * t1,\n    t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n  if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n  if (o instanceof Hcl) return hcl2lab(o);\n  if (!(o instanceof Rgb)) o = rgbConvert(o);\n  var r = rgb2lrgb(o.r),\n      g = rgb2lrgb(o.g),\n      b = rgb2lrgb(o.b),\n      y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n  if (r === g && g === b) x = z = y; else {\n    x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n    z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n  }\n  return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n  return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n  return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n  this.l = +l;\n  this.a = +a;\n  this.b = +b;\n  this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n  brighter(k) {\n    return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n  },\n  darker(k) {\n    return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n  },\n  rgb() {\n    var y = (this.l + 16) / 116,\n        x = isNaN(this.a) ? y : y + this.a / 500,\n        z = isNaN(this.b) ? y : y - this.b / 200;\n    x = Xn * lab2xyz(x);\n    y = Yn * lab2xyz(y);\n    z = Zn * lab2xyz(z);\n    return new Rgb(\n      lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n      lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n      lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n      this.opacity\n    );\n  }\n}));\n\nfunction xyz2lab(t) {\n  return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n  return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n  return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n  return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n  if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n  if (!(o instanceof Lab)) o = labConvert(o);\n  if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n  var h = Math.atan2(o.b, o.a) * degrees;\n  return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n  return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n  return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n  this.h = +h;\n  this.c = +c;\n  this.l = +l;\n  this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n  if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n  var h = o.h * radians;\n  return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n  brighter(k) {\n    return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n  },\n  darker(k) {\n    return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n  },\n  rgb() {\n    return hcl2lab(this).rgb();\n  }\n}));\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n    B = +1.78277,\n    C = -0.29227,\n    D = -0.90649,\n    E = +1.97294,\n    ED = E * D,\n    EB = E * B,\n    BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n  if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n  if (!(o instanceof Rgb)) o = rgbConvert(o);\n  var r = o.r / 255,\n      g = o.g / 255,\n      b = o.b / 255,\n      l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n      bl = b - l,\n      k = (E * (g - l) - C * bl) / D,\n      s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n      h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n  return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n  return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n  this.h = +h;\n  this.s = +s;\n  this.l = +l;\n  this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n  brighter(k) {\n    k = k == null ? brighter : Math.pow(brighter, k);\n    return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n  },\n  darker(k) {\n    k = k == null ? darker : Math.pow(darker, k);\n    return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n  },\n  rgb() {\n    var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n        l = +this.l,\n        a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n        cosh = Math.cos(h),\n        sinh = Math.sin(h);\n    return new Rgb(\n      255 * (l + a * (A * cosh + B * sinh)),\n      255 * (l + a * (C * cosh + D * sinh)),\n      255 * (l + a * (E * cosh)),\n      this.opacity\n    );\n  }\n}));\n","export function basis(t1, v0, v1, v2, v3) {\n  var t2 = t1 * t1, t3 = t2 * t1;\n  return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n      + (4 - 6 * t2 + 3 * t3) * v1\n      + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n      + t3 * v3) / 6;\n}\n\nexport default function(values) {\n  var n = values.length - 1;\n  return function(t) {\n    var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n        v1 = values[i],\n        v2 = values[i + 1],\n        v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n        v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n    return basis((t - i / n) * n, v0, v1, v2, v3);\n  };\n}\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n  var n = values.length;\n  return function(t) {\n    var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n        v0 = values[(i + n - 1) % n],\n        v1 = values[i % n],\n        v2 = values[(i + 1) % n],\n        v3 = values[(i + 2) % n];\n    return basis((t - i / n) * n, v0, v1, v2, v3);\n  };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n  return function(t) {\n    return a + t * d;\n  };\n}\n\nfunction exponential(a, b, y) {\n  return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n    return Math.pow(a + t * b, y);\n  };\n}\n\nexport function hue(a, b) {\n  var d = b - a;\n  return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n  return (y = +y) === 1 ? nogamma : function(a, b) {\n    return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n  };\n}\n\nexport default function nogamma(a, b) {\n  var d = b - a;\n  return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n  var color = gamma(y);\n\n  function rgb(start, end) {\n    var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n        g = color(start.g, end.g),\n        b = color(start.b, end.b),\n        opacity = nogamma(start.opacity, end.opacity);\n    return function(t) {\n      start.r = r(t);\n      start.g = g(t);\n      start.b = b(t);\n      start.opacity = opacity(t);\n      return start + \"\";\n    };\n  }\n\n  rgb.gamma = rgbGamma;\n\n  return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n  return function(colors) {\n    var n = colors.length,\n        r = new Array(n),\n        g = new Array(n),\n        b = new Array(n),\n        i, color;\n    for (i = 0; i < n; ++i) {\n      color = colorRgb(colors[i]);\n      r[i] = color.r || 0;\n      g[i] = color.g || 0;\n      b[i] = color.b || 0;\n    }\n    r = spline(r);\n    g = spline(g);\n    b = spline(b);\n    color.opacity = 1;\n    return function(t) {\n      color.r = r(t);\n      color.g = g(t);\n      color.b = b(t);\n      return color + \"\";\n    };\n  };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","export default function(a, b) {\n  if (!b) b = [];\n  var n = a ? Math.min(b.length, a.length) : 0,\n      c = b.slice(),\n      i;\n  return function(t) {\n    for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n    return c;\n  };\n}\n\nexport function isNumberArray(x) {\n  return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n  return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n  var nb = b ? b.length : 0,\n      na = a ? Math.min(nb, a.length) : 0,\n      x = new Array(na),\n      c = new Array(nb),\n      i;\n\n  for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n  for (; i < nb; ++i) c[i] = b[i];\n\n  return function(t) {\n    for (i = 0; i < na; ++i) c[i] = x[i](t);\n    return c;\n  };\n}\n","export default function(a, b) {\n  var d = new Date;\n  return a = +a, b = +b, function(t) {\n    return d.setTime(a * (1 - t) + b * t), d;\n  };\n}\n","export default function(a, b) {\n  return a = +a, b = +b, function(t) {\n    return a * (1 - t) + b * t;\n  };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n  var i = {},\n      c = {},\n      k;\n\n  if (a === null || typeof a !== \"object\") a = {};\n  if (b === null || typeof b !== \"object\") b = {};\n\n  for (k in b) {\n    if (k in a) {\n      i[k] = value(a[k], b[k]);\n    } else {\n      c[k] = b[k];\n    }\n  }\n\n  return function(t) {\n    for (k in i) c[k] = i[k](t);\n    return c;\n  };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n    reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n  return function() {\n    return b;\n  };\n}\n\nfunction one(b) {\n  return function(t) {\n    return b(t) + \"\";\n  };\n}\n\nexport default function(a, b) {\n  var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n      am, // current match in a\n      bm, // current match in b\n      bs, // string preceding current number in b, if any\n      i = -1, // index in s\n      s = [], // string constants and placeholders\n      q = []; // number interpolators\n\n  // Coerce inputs to strings.\n  a = a + \"\", b = b + \"\";\n\n  // Interpolate pairs of numbers in a & b.\n  while ((am = reA.exec(a))\n      && (bm = reB.exec(b))) {\n    if ((bs = bm.index) > bi) { // a string precedes the next number in b\n      bs = b.slice(bi, bs);\n      if (s[i]) s[i] += bs; // coalesce with previous string\n      else s[++i] = bs;\n    }\n    if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n      if (s[i]) s[i] += bm; // coalesce with previous string\n      else s[++i] = bm;\n    } else { // interpolate non-matching numbers\n      s[++i] = null;\n      q.push({i: i, x: number(am, bm)});\n    }\n    bi = reB.lastIndex;\n  }\n\n  // Add remains of b.\n  if (bi < b.length) {\n    bs = b.slice(bi);\n    if (s[i]) s[i] += bs; // coalesce with previous string\n    else s[++i] = bs;\n  }\n\n  // Special optimization for only a single match.\n  // Otherwise, interpolate each of the numbers and rejoin the string.\n  return s.length < 2 ? (q[0]\n      ? one(q[0].x)\n      : zero(b))\n      : (b = q.length, function(t) {\n          for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n          return s.join(\"\");\n        });\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n  var t = typeof b, c;\n  return b == null || t === \"boolean\" ? constant(b)\n      : (t === \"number\" ? number\n      : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n      : b instanceof color ? rgb\n      : b instanceof Date ? date\n      : isNumberArray(b) ? numberArray\n      : Array.isArray(b) ? genericArray\n      : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n      : number)(a, b);\n}\n","export default function(a, b) {\n  return a = +a, b = +b, function(t) {\n    return Math.round(a * (1 - t) + b * t);\n  };\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n  translateX: 0,\n  translateY: 0,\n  rotate: 0,\n  skewX: 0,\n  scaleX: 1,\n  scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n  var scaleX, scaleY, skewX;\n  if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n  if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n  if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n  if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n  return {\n    translateX: e,\n    translateY: f,\n    rotate: Math.atan2(b, a) * degrees,\n    skewX: Math.atan(skewX) * degrees,\n    scaleX: scaleX,\n    scaleY: scaleY\n  };\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n  const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n  return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n  if (value == null) return identity;\n  if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n  svgNode.setAttribute(\"transform\", value);\n  if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n  value = value.matrix;\n  return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n  function pop(s) {\n    return s.length ? s.pop() + \" \" : \"\";\n  }\n\n  function translate(xa, ya, xb, yb, s, q) {\n    if (xa !== xb || ya !== yb) {\n      var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n      q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n    } else if (xb || yb) {\n      s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n    }\n  }\n\n  function rotate(a, b, s, q) {\n    if (a !== b) {\n      if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n      q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n    } else if (b) {\n      s.push(pop(s) + \"rotate(\" + b + degParen);\n    }\n  }\n\n  function skewX(a, b, s, q) {\n    if (a !== b) {\n      q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n    } else if (b) {\n      s.push(pop(s) + \"skewX(\" + b + degParen);\n    }\n  }\n\n  function scale(xa, ya, xb, yb, s, q) {\n    if (xa !== xb || ya !== yb) {\n      var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n      q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n    } else if (xb !== 1 || yb !== 1) {\n      s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n    }\n  }\n\n  return function(a, b) {\n    var s = [], // string constants and placeholders\n        q = []; // number interpolators\n    a = parse(a), b = parse(b);\n    translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n    rotate(a.rotate, b.rotate, s, q);\n    skewX(a.skewX, b.skewX, s, q);\n    scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n    a = b = null; // gc\n    return function(t) {\n      var i = -1, n = q.length, o;\n      while (++i < n) s[(o = q[i]).i] = o.x(t);\n      return s.join(\"\");\n    };\n  };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n  return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n  return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n  return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n  // p0 = [ux0, uy0, w0]\n  // p1 = [ux1, uy1, w1]\n  function zoom(p0, p1) {\n    var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n        ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n        dx = ux1 - ux0,\n        dy = uy1 - uy0,\n        d2 = dx * dx + dy * dy,\n        i,\n        S;\n\n    // Special case for u0 ≅ u1.\n    if (d2 < epsilon2) {\n      S = Math.log(w1 / w0) / rho;\n      i = function(t) {\n        return [\n          ux0 + t * dx,\n          uy0 + t * dy,\n          w0 * Math.exp(rho * t * S)\n        ];\n      }\n    }\n\n    // General case.\n    else {\n      var d1 = Math.sqrt(d2),\n          b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n          b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n          r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n          r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n      S = (r1 - r0) / rho;\n      i = function(t) {\n        var s = t * S,\n            coshr0 = cosh(r0),\n            u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n        return [\n          ux0 + u * dx,\n          uy0 + u * dy,\n          w0 * coshr0 / cosh(rho * s + r0)\n        ];\n      }\n    }\n\n    i.duration = S * 1000 * rho / Math.SQRT2;\n\n    return i;\n  }\n\n  zoom.rho = function(_) {\n    var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n    return zoomRho(_1, _2, _4);\n  };\n\n  return zoom;\n})(Math.SQRT2, 2, 4);\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n  return function(start, end) {\n    var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n        s = color(start.s, end.s),\n        l = color(start.l, end.l),\n        opacity = color(start.opacity, end.opacity);\n    return function(t) {\n      start.h = h(t);\n      start.s = s(t);\n      start.l = l(t);\n      start.opacity = opacity(t);\n      return start + \"\";\n    };\n  }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n  var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n      a = color(start.a, end.a),\n      b = color(start.b, end.b),\n      opacity = color(start.opacity, end.opacity);\n  return function(t) {\n    start.l = l(t);\n    start.a = a(t);\n    start.b = b(t);\n    start.opacity = opacity(t);\n    return start + \"\";\n  };\n}\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n  return function(start, end) {\n    var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n        c = color(start.c, end.c),\n        l = color(start.l, end.l),\n        opacity = color(start.opacity, end.opacity);\n    return function(t) {\n      start.h = h(t);\n      start.c = c(t);\n      start.l = l(t);\n      start.opacity = opacity(t);\n      return start + \"\";\n    };\n  }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n  return (function cubehelixGamma(y) {\n    y = +y;\n\n    function cubehelix(start, end) {\n      var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n          s = color(start.s, end.s),\n          l = color(start.l, end.l),\n          opacity = color(start.opacity, end.opacity);\n      return function(t) {\n        start.h = h(t);\n        start.s = s(t);\n        start.l = l(Math.pow(t, y));\n        start.opacity = opacity(t);\n        return start + \"\";\n      };\n    }\n\n    cubehelix.gamma = cubehelixGamma;\n\n    return cubehelix;\n  })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","var frame = 0, // is an animation frame pending?\n    timeout = 0, // is a timeout pending?\n    interval = 0, // are any timers active?\n    pokeDelay = 1000, // how frequently we check for clock skew\n    taskHead,\n    taskTail,\n    clockLast = 0,\n    clockNow = 0,\n    clockSkew = 0,\n    clock = typeof performance === \"object\" && performance.now ? performance : Date,\n    setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n  return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n  clockNow = 0;\n}\n\nexport function Timer() {\n  this._call =\n  this._time =\n  this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n  constructor: Timer,\n  restart: function(callback, delay, time) {\n    if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n    time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n    if (!this._next && taskTail !== this) {\n      if (taskTail) taskTail._next = this;\n      else taskHead = this;\n      taskTail = this;\n    }\n    this._call = callback;\n    this._time = time;\n    sleep();\n  },\n  stop: function() {\n    if (this._call) {\n      this._call = null;\n      this._time = Infinity;\n      sleep();\n    }\n  }\n};\n\nexport function timer(callback, delay, time) {\n  var t = new Timer;\n  t.restart(callback, delay, time);\n  return t;\n}\n\nexport function timerFlush() {\n  now(); // Get the current time, if not already set.\n  ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n  var t = taskHead, e;\n  while (t) {\n    if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n    t = t._next;\n  }\n  --frame;\n}\n\nfunction wake() {\n  clockNow = (clockLast = clock.now()) + clockSkew;\n  frame = timeout = 0;\n  try {\n    timerFlush();\n  } finally {\n    frame = 0;\n    nap();\n    clockNow = 0;\n  }\n}\n\nfunction poke() {\n  var now = clock.now(), delay = now - clockLast;\n  if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n  var t0, t1 = taskHead, t2, time = Infinity;\n  while (t1) {\n    if (t1._call) {\n      if (time > t1._time) time = t1._time;\n      t0 = t1, t1 = t1._next;\n    } else {\n      t2 = t1._next, t1._next = null;\n      t1 = t0 ? t0._next = t2 : taskHead = t2;\n    }\n  }\n  taskTail = t0;\n  sleep(time);\n}\n\nfunction sleep(time) {\n  if (frame) return; // Soonest alarm already set, or will be.\n  if (timeout) timeout = clearTimeout(timeout);\n  var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n  if (delay > 24) {\n    if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n    if (interval) interval = clearInterval(interval);\n  } else {\n    if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n    frame = 1, setFrame(wake);\n  }\n}\n","import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n  var t = new Timer;\n  delay = delay == null ? 0 : +delay;\n  t.restart(elapsed => {\n    t.stop();\n    callback(elapsed + delay);\n  }, delay, time);\n  return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n  var schedules = node.__transition;\n  if (!schedules) node.__transition = {};\n  else if (id in schedules) return;\n  create(node, id, {\n    name: name,\n    index: index, // For context during callback.\n    group: group, // For context during callback.\n    on: emptyOn,\n    tween: emptyTween,\n    time: timing.time,\n    delay: timing.delay,\n    duration: timing.duration,\n    ease: timing.ease,\n    timer: null,\n    state: CREATED\n  });\n}\n\nexport function init(node, id) {\n  var schedule = get(node, id);\n  if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n  return schedule;\n}\n\nexport function set(node, id) {\n  var schedule = get(node, id);\n  if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n  return schedule;\n}\n\nexport function get(node, id) {\n  var schedule = node.__transition;\n  if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n  return schedule;\n}\n\nfunction create(node, id, self) {\n  var schedules = node.__transition,\n      tween;\n\n  // Initialize the self timer when the transition is created.\n  // Note the actual delay is not known until the first callback!\n  schedules[id] = self;\n  self.timer = timer(schedule, 0, self.time);\n\n  function schedule(elapsed) {\n    self.state = SCHEDULED;\n    self.timer.restart(start, self.delay, self.time);\n\n    // If the elapsed delay is less than our first sleep, start immediately.\n    if (self.delay <= elapsed) start(elapsed - self.delay);\n  }\n\n  function start(elapsed) {\n    var i, j, n, o;\n\n    // If the state is not SCHEDULED, then we previously errored on start.\n    if (self.state !== SCHEDULED) return stop();\n\n    for (i in schedules) {\n      o = schedules[i];\n      if (o.name !== self.name) continue;\n\n      // While this element already has a starting transition during this frame,\n      // defer starting an interrupting transition until that transition has a\n      // chance to tick (and possibly end); see d3/d3-transition#54!\n      if (o.state === STARTED) return timeout(start);\n\n      // Interrupt the active transition, if any.\n      if (o.state === RUNNING) {\n        o.state = ENDED;\n        o.timer.stop();\n        o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n        delete schedules[i];\n      }\n\n      // Cancel any pre-empted transitions.\n      else if (+i < id) {\n        o.state = ENDED;\n        o.timer.stop();\n        o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n        delete schedules[i];\n      }\n    }\n\n    // Defer the first tick to end of the current frame; see d3/d3#1576.\n    // Note the transition may be canceled after start and before the first tick!\n    // Note this must be scheduled before the start event; see d3/d3-transition#16!\n    // Assuming this is successful, subsequent callbacks go straight to tick.\n    timeout(function() {\n      if (self.state === STARTED) {\n        self.state = RUNNING;\n        self.timer.restart(tick, self.delay, self.time);\n        tick(elapsed);\n      }\n    });\n\n    // Dispatch the start event.\n    // Note this must be done before the tween are initialized.\n    self.state = STARTING;\n    self.on.call(\"start\", node, node.__data__, self.index, self.group);\n    if (self.state !== STARTING) return; // interrupted\n    self.state = STARTED;\n\n    // Initialize the tween, deleting null tween.\n    tween = new Array(n = self.tween.length);\n    for (i = 0, j = -1; i < n; ++i) {\n      if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n        tween[++j] = o;\n      }\n    }\n    tween.length = j + 1;\n  }\n\n  function tick(elapsed) {\n    var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n        i = -1,\n        n = tween.length;\n\n    while (++i < n) {\n      tween[i].call(node, t);\n    }\n\n    // Dispatch the end event.\n    if (self.state === ENDING) {\n      self.on.call(\"end\", node, node.__data__, self.index, self.group);\n      stop();\n    }\n  }\n\n  function stop() {\n    self.state = ENDED;\n    self.timer.stop();\n    delete schedules[id];\n    for (var i in schedules) return; // eslint-disable-line no-unused-vars\n    delete node.__transition;\n  }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n  var schedules = node.__transition,\n      schedule,\n      active,\n      empty = true,\n      i;\n\n  if (!schedules) return;\n\n  name = name == null ? null : name + \"\";\n\n  for (i in schedules) {\n    if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n    active = schedule.state > STARTING && schedule.state < ENDING;\n    schedule.state = ENDED;\n    schedule.timer.stop();\n    schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n    delete schedules[i];\n  }\n\n  if (empty) delete node.__transition;\n}\n","import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n  return this.each(function() {\n    interrupt(this, name);\n  });\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n  var tween0, tween1;\n  return function() {\n    var schedule = set(this, id),\n        tween = schedule.tween;\n\n    // If this node shared tween with the previous node,\n    // just assign the updated shared tween and we’re done!\n    // Otherwise, copy-on-write.\n    if (tween !== tween0) {\n      tween1 = tween0 = tween;\n      for (var i = 0, n = tween1.length; i < n; ++i) {\n        if (tween1[i].name === name) {\n          tween1 = tween1.slice();\n          tween1.splice(i, 1);\n          break;\n        }\n      }\n    }\n\n    schedule.tween = tween1;\n  };\n}\n\nfunction tweenFunction(id, name, value) {\n  var tween0, tween1;\n  if (typeof value !== \"function\") throw new Error;\n  return function() {\n    var schedule = set(this, id),\n        tween = schedule.tween;\n\n    // If this node shared tween with the previous node,\n    // just assign the updated shared tween and we’re done!\n    // Otherwise, copy-on-write.\n    if (tween !== tween0) {\n      tween1 = (tween0 = tween).slice();\n      for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n        if (tween1[i].name === name) {\n          tween1[i] = t;\n          break;\n        }\n      }\n      if (i === n) tween1.push(t);\n    }\n\n    schedule.tween = tween1;\n  };\n}\n\nexport default function(name, value) {\n  var id = this._id;\n\n  name += \"\";\n\n  if (arguments.length < 2) {\n    var tween = get(this.node(), id).tween;\n    for (var i = 0, n = tween.length, t; i < n; ++i) {\n      if ((t = tween[i]).name === name) {\n        return t.value;\n      }\n    }\n    return null;\n  }\n\n  return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n  var id = transition._id;\n\n  transition.each(function() {\n    var schedule = set(this, id);\n    (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n  });\n\n  return function(node) {\n    return get(node, id).value[name];\n  };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n  var c;\n  return (typeof b === \"number\" ? interpolateNumber\n      : b instanceof color ? interpolateRgb\n      : (c = color(b)) ? (b = c, interpolateRgb)\n      : interpolateString)(a, b);\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n  return function() {\n    this.removeAttribute(name);\n  };\n}\n\nfunction attrRemoveNS(fullname) {\n  return function() {\n    this.removeAttributeNS(fullname.space, fullname.local);\n  };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = this.getAttribute(name);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = this.getAttributeNS(fullname.space, fullname.local);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction attrFunction(name, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0, value1 = value(this), string1;\n    if (value1 == null) return void this.removeAttribute(name);\n    string0 = this.getAttribute(name);\n    string1 = value1 + \"\";\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0, value1 = value(this), string1;\n    if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n    string0 = this.getAttributeNS(fullname.space, fullname.local);\n    string1 = value1 + \"\";\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nexport default function(name, value) {\n  var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n  return this.attrTween(name, typeof value === \"function\"\n      ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n      : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n      : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n  return function(t) {\n    this.setAttribute(name, i.call(this, t));\n  };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n  return function(t) {\n    this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n  };\n}\n\nfunction attrTweenNS(fullname, value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nfunction attrTween(name, value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(name, value) {\n  var key = \"attr.\" + name;\n  if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  var fullname = namespace(name);\n  return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n  return function() {\n    init(this, id).delay = +value.apply(this, arguments);\n  };\n}\n\nfunction delayConstant(id, value) {\n  return value = +value, function() {\n    init(this, id).delay = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each((typeof value === \"function\"\n          ? delayFunction\n          : delayConstant)(id, value))\n      : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n  return function() {\n    set(this, id).duration = +value.apply(this, arguments);\n  };\n}\n\nfunction durationConstant(id, value) {\n  return value = +value, function() {\n    set(this, id).duration = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each((typeof value === \"function\"\n          ? durationFunction\n          : durationConstant)(id, value))\n      : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n  if (typeof value !== \"function\") throw new Error;\n  return function() {\n    set(this, id).ease = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each(easeConstant(id, value))\n      : get(this.node(), id).ease;\n}\n","import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (typeof v !== \"function\") throw new Error;\n    set(this, id).ease = v;\n  };\n}\n\nexport default function(value) {\n  if (typeof value !== \"function\") throw new Error;\n  return this.each(easeVarying(this._id, value));\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n  if (typeof match !== \"function\") match = matcher(match);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n      if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n        subgroup.push(node);\n      }\n    }\n  }\n\n  return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n  if (transition._id !== this._id) throw new Error;\n\n  for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n    for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group0[i] || group1[i]) {\n        merge[i] = node;\n      }\n    }\n  }\n\n  for (; j < m0; ++j) {\n    merges[j] = groups0[j];\n  }\n\n  return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n  return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n    var i = t.indexOf(\".\");\n    if (i >= 0) t = t.slice(0, i);\n    return !t || t === \"start\";\n  });\n}\n\nfunction onFunction(id, name, listener) {\n  var on0, on1, sit = start(name) ? init : set;\n  return function() {\n    var schedule = sit(this, id),\n        on = schedule.on;\n\n    // If this node shared a dispatch with the previous node,\n    // just assign the updated shared dispatch and we’re done!\n    // Otherwise, copy-on-write.\n    if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n    schedule.on = on1;\n  };\n}\n\nexport default function(name, listener) {\n  var id = this._id;\n\n  return arguments.length < 2\n      ? get(this.node(), id).on.on(name)\n      : this.each(onFunction(id, name, listener));\n}\n","function removeFunction(id) {\n  return function() {\n    var parent = this.parentNode;\n    for (var i in this.__transition) if (+i !== id) return;\n    if (parent) parent.removeChild(this);\n  };\n}\n\nexport default function() {\n  return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n  var name = this._name,\n      id = this._id;\n\n  if (typeof select !== \"function\") select = selector(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n      if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n        if (\"__data__\" in node) subnode.__data__ = node.__data__;\n        subgroup[i] = subnode;\n        schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n      }\n    }\n  }\n\n  return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n  var name = this._name,\n      id = this._id;\n\n  if (typeof select !== \"function\") select = selectorAll(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n          if (child = children[k]) {\n            schedule(child, name, id, k, children, inherit);\n          }\n        }\n        subgroups.push(children);\n        parents.push(node);\n      }\n    }\n  }\n\n  return new Transition(subgroups, parents, name, id);\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n  return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0 = style(this, name),\n        string1 = (this.style.removeProperty(name), style(this, name));\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, string10 = string1);\n  };\n}\n\nfunction styleRemove(name) {\n  return function() {\n    this.style.removeProperty(name);\n  };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = style(this, name);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction styleFunction(name, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0 = style(this, name),\n        value1 = value(this),\n        string1 = value1 + \"\";\n    if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nfunction styleMaybeRemove(id, name) {\n  var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n  return function() {\n    var schedule = set(this, id),\n        on = schedule.on,\n        listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n    // If this node shared a dispatch with the previous node,\n    // just assign the updated shared dispatch and we’re done!\n    // Otherwise, copy-on-write.\n    if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n    schedule.on = on1;\n  };\n}\n\nexport default function(name, value, priority) {\n  var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n  return value == null ? this\n      .styleTween(name, styleNull(name, i))\n      .on(\"end.style.\" + name, styleRemove(name))\n    : typeof value === \"function\" ? this\n      .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n      .each(styleMaybeRemove(this._id, name))\n    : this\n      .styleTween(name, styleConstant(name, i, value), priority)\n      .on(\"end.style.\" + name, null);\n}\n","function styleInterpolate(name, i, priority) {\n  return function(t) {\n    this.style.setProperty(name, i.call(this, t), priority);\n  };\n}\n\nfunction styleTween(name, value, priority) {\n  var t, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n    return t;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(name, value, priority) {\n  var key = \"style.\" + (name += \"\");\n  if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n  return function() {\n    this.textContent = value;\n  };\n}\n\nfunction textFunction(value) {\n  return function() {\n    var value1 = value(this);\n    this.textContent = value1 == null ? \"\" : value1;\n  };\n}\n\nexport default function(value) {\n  return this.tween(\"text\", typeof value === \"function\"\n      ? textFunction(tweenValue(this, \"text\", value))\n      : textConstant(value == null ? \"\" : value + \"\"));\n}\n","function textInterpolate(i) {\n  return function(t) {\n    this.textContent = i.call(this, t);\n  };\n}\n\nfunction textTween(value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(value) {\n  var key = \"text\";\n  if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  return this.tween(key, textTween(value));\n}\n","import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n  var name = this._name,\n      id0 = this._id,\n      id1 = newId();\n\n  for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        var inherit = get(node, id0);\n        schedule(node, name, id1, i, group, {\n          time: inherit.time + inherit.delay + inherit.duration,\n          delay: 0,\n          duration: inherit.duration,\n          ease: inherit.ease\n        });\n      }\n    }\n  }\n\n  return new Transition(groups, this._parents, name, id1);\n}\n","import {set} from \"./schedule.js\";\n\nexport default function() {\n  var on0, on1, that = this, id = that._id, size = that.size();\n  return new Promise(function(resolve, reject) {\n    var cancel = {value: reject},\n        end = {value: function() { if (--size === 0) resolve(); }};\n\n    that.each(function() {\n      var schedule = set(this, id),\n          on = schedule.on;\n\n      // If this node shared a dispatch with the previous node,\n      // just assign the updated shared dispatch and we’re done!\n      // Otherwise, copy-on-write.\n      if (on !== on0) {\n        on1 = (on0 = on).copy();\n        on1._.cancel.push(cancel);\n        on1._.interrupt.push(cancel);\n        on1._.end.push(end);\n      }\n\n      schedule.on = on1;\n    });\n\n    // The selection was empty, resolve end immediately\n    if (size === 0) resolve();\n  });\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n  this._groups = groups;\n  this._parents = parents;\n  this._name = name;\n  this._id = id;\n}\n\nexport default function transition(name) {\n  return selection().transition(name);\n}\n\nexport function newId() {\n  return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n  constructor: Transition,\n  select: transition_select,\n  selectAll: transition_selectAll,\n  selectChild: selection_prototype.selectChild,\n  selectChildren: selection_prototype.selectChildren,\n  filter: transition_filter,\n  merge: transition_merge,\n  selection: transition_selection,\n  transition: transition_transition,\n  call: selection_prototype.call,\n  nodes: selection_prototype.nodes,\n  node: selection_prototype.node,\n  size: selection_prototype.size,\n  empty: selection_prototype.empty,\n  each: selection_prototype.each,\n  on: transition_on,\n  attr: transition_attr,\n  attrTween: transition_attrTween,\n  style: transition_style,\n  styleTween: transition_styleTween,\n  text: transition_text,\n  textTween: transition_textTween,\n  remove: transition_remove,\n  tween: transition_tween,\n  delay: transition_delay,\n  duration: transition_duration,\n  ease: transition_ease,\n  easeVarying: transition_easeVarying,\n  end: transition_end,\n  [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n","export function cubicIn(t) {\n  return t * t * t;\n}\n\nexport function cubicOut(t) {\n  return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n  return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n  time: null, // Set on use.\n  delay: 0,\n  duration: 250,\n  ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n  var timing;\n  while (!(timing = node.__transition) || !(timing = timing[id])) {\n    if (!(node = node.parentNode)) {\n      throw new Error(`transition ${id} not found`);\n    }\n  }\n  return timing;\n}\n\nexport default function(name) {\n  var id,\n      timing;\n\n  if (name instanceof Transition) {\n    id = name._id, name = name._name;\n  } else {\n    id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n  }\n\n  for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        schedule(node, name, id, i, group, timing || inherit(node, id));\n      }\n    }\n  }\n\n  return new Transition(groups, this._parents, name, id);\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","export default x => () => x;\n","export default function ZoomEvent(type, {\n  sourceEvent,\n  target,\n  transform,\n  dispatch\n}) {\n  Object.defineProperties(this, {\n    type: {value: type, enumerable: true, configurable: true},\n    sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n    target: {value: target, enumerable: true, configurable: true},\n    transform: {value: transform, enumerable: true, configurable: true},\n    _: {value: dispatch}\n  });\n}\n","export function Transform(k, x, y) {\n  this.k = k;\n  this.x = x;\n  this.y = y;\n}\n\nTransform.prototype = {\n  constructor: Transform,\n  scale: function(k) {\n    return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n  },\n  translate: function(x, y) {\n    return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n  },\n  apply: function(point) {\n    return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n  },\n  applyX: function(x) {\n    return x * this.k + this.x;\n  },\n  applyY: function(y) {\n    return y * this.k + this.y;\n  },\n  invert: function(location) {\n    return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n  },\n  invertX: function(x) {\n    return (x - this.x) / this.k;\n  },\n  invertY: function(y) {\n    return (y - this.y) / this.k;\n  },\n  rescaleX: function(x) {\n    return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n  },\n  rescaleY: function(y) {\n    return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n  },\n  toString: function() {\n    return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n  }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n  while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n  return node.__zoom;\n}\n","export function nopropagation(event) {\n  event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n  event.preventDefault();\n  event.stopImmediatePropagation();\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolateZoom} from \"d3-interpolate\";\nimport {select, pointer} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport ZoomEvent from \"./event.js\";\nimport {Transform, identity} from \"./transform.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\n// Ignore right-click, since that should open the context menu.\n// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event\nfunction defaultFilter(event) {\n  return (!event.ctrlKey || event.type === 'wheel') && !event.button;\n}\n\nfunction defaultExtent() {\n  var e = this;\n  if (e instanceof SVGElement) {\n    e = e.ownerSVGElement || e;\n    if (e.hasAttribute(\"viewBox\")) {\n      e = e.viewBox.baseVal;\n      return [[e.x, e.y], [e.x + e.width, e.y + e.height]];\n    }\n    return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];\n  }\n  return [[0, 0], [e.clientWidth, e.clientHeight]];\n}\n\nfunction defaultTransform() {\n  return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta(event) {\n  return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1);\n}\n\nfunction defaultTouchable() {\n  return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n  var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n      dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n      dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n      dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n  return transform.translate(\n    dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n    dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n  );\n}\n\nexport default function() {\n  var filter = defaultFilter,\n      extent = defaultExtent,\n      constrain = defaultConstrain,\n      wheelDelta = defaultWheelDelta,\n      touchable = defaultTouchable,\n      scaleExtent = [0, Infinity],\n      translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n      duration = 250,\n      interpolate = interpolateZoom,\n      listeners = dispatch(\"start\", \"zoom\", \"end\"),\n      touchstarting,\n      touchfirst,\n      touchending,\n      touchDelay = 500,\n      wheelDelay = 150,\n      clickDistance2 = 0,\n      tapDistance = 10;\n\n  function zoom(selection) {\n    selection\n        .property(\"__zoom\", defaultTransform)\n        .on(\"wheel.zoom\", wheeled, {passive: false})\n        .on(\"mousedown.zoom\", mousedowned)\n        .on(\"dblclick.zoom\", dblclicked)\n      .filter(touchable)\n        .on(\"touchstart.zoom\", touchstarted)\n        .on(\"touchmove.zoom\", touchmoved)\n        .on(\"touchend.zoom touchcancel.zoom\", touchended)\n        .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n  }\n\n  zoom.transform = function(collection, transform, point, event) {\n    var selection = collection.selection ? collection.selection() : collection;\n    selection.property(\"__zoom\", defaultTransform);\n    if (collection !== selection) {\n      schedule(collection, transform, point, event);\n    } else {\n      selection.interrupt().each(function() {\n        gesture(this, arguments)\n          .event(event)\n          .start()\n          .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n          .end();\n      });\n    }\n  };\n\n  zoom.scaleBy = function(selection, k, p, event) {\n    zoom.scaleTo(selection, function() {\n      var k0 = this.__zoom.k,\n          k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n      return k0 * k1;\n    }, p, event);\n  };\n\n  zoom.scaleTo = function(selection, k, p, event) {\n    zoom.transform(selection, function() {\n      var e = extent.apply(this, arguments),\n          t0 = this.__zoom,\n          p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p,\n          p1 = t0.invert(p0),\n          k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n      return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n    }, p, event);\n  };\n\n  zoom.translateBy = function(selection, x, y, event) {\n    zoom.transform(selection, function() {\n      return constrain(this.__zoom.translate(\n        typeof x === \"function\" ? x.apply(this, arguments) : x,\n        typeof y === \"function\" ? y.apply(this, arguments) : y\n      ), extent.apply(this, arguments), translateExtent);\n    }, null, event);\n  };\n\n  zoom.translateTo = function(selection, x, y, p, event) {\n    zoom.transform(selection, function() {\n      var e = extent.apply(this, arguments),\n          t = this.__zoom,\n          p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p;\n      return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(\n        typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n        typeof y === \"function\" ? -y.apply(this, arguments) : -y\n      ), e, translateExtent);\n    }, p, event);\n  };\n\n  function scale(transform, k) {\n    k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n    return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n  }\n\n  function translate(transform, p0, p1) {\n    var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n    return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n  }\n\n  function centroid(extent) {\n    return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n  }\n\n  function schedule(transition, transform, point, event) {\n    transition\n        .on(\"start.zoom\", function() { gesture(this, arguments).event(event).start(); })\n        .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).event(event).end(); })\n        .tween(\"zoom\", function() {\n          var that = this,\n              args = arguments,\n              g = gesture(that, args).event(event),\n              e = extent.apply(that, args),\n              p = point == null ? centroid(e) : typeof point === \"function\" ? point.apply(that, args) : point,\n              w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n              a = that.__zoom,\n              b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n              i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n          return function(t) {\n            if (t === 1) t = b; // Avoid rounding error on end.\n            else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n            g.zoom(null, t);\n          };\n        });\n  }\n\n  function gesture(that, args, clean) {\n    return (!clean && that.__zooming) || new Gesture(that, args);\n  }\n\n  function Gesture(that, args) {\n    this.that = that;\n    this.args = args;\n    this.active = 0;\n    this.sourceEvent = null;\n    this.extent = extent.apply(that, args);\n    this.taps = 0;\n  }\n\n  Gesture.prototype = {\n    event: function(event) {\n      if (event) this.sourceEvent = event;\n      return this;\n    },\n    start: function() {\n      if (++this.active === 1) {\n        this.that.__zooming = this;\n        this.emit(\"start\");\n      }\n      return this;\n    },\n    zoom: function(key, transform) {\n      if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n      if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n      if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n      this.that.__zoom = transform;\n      this.emit(\"zoom\");\n      return this;\n    },\n    end: function() {\n      if (--this.active === 0) {\n        delete this.that.__zooming;\n        this.emit(\"end\");\n      }\n      return this;\n    },\n    emit: function(type) {\n      var d = select(this.that).datum();\n      listeners.call(\n        type,\n        this.that,\n        new ZoomEvent(type, {\n          sourceEvent: this.sourceEvent,\n          target: zoom,\n          type,\n          transform: this.that.__zoom,\n          dispatch: listeners\n        }),\n        d\n      );\n    }\n  };\n\n  function wheeled(event, ...args) {\n    if (!filter.apply(this, arguments)) return;\n    var g = gesture(this, args).event(event),\n        t = this.__zoom,\n        k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n        p = pointer(event);\n\n    // If the mouse is in the same location as before, reuse it.\n    // If there were recent wheel events, reset the wheel idle timeout.\n    if (g.wheel) {\n      if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n        g.mouse[1] = t.invert(g.mouse[0] = p);\n      }\n      clearTimeout(g.wheel);\n    }\n\n    // If this wheel event won’t trigger a transform change, ignore it.\n    else if (t.k === k) return;\n\n    // Otherwise, capture the mouse point and location at the start.\n    else {\n      g.mouse = [p, t.invert(p)];\n      interrupt(this);\n      g.start();\n    }\n\n    noevent(event);\n    g.wheel = setTimeout(wheelidled, wheelDelay);\n    g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n    function wheelidled() {\n      g.wheel = null;\n      g.end();\n    }\n  }\n\n  function mousedowned(event, ...args) {\n    if (touchending || !filter.apply(this, arguments)) return;\n    var currentTarget = event.currentTarget,\n        g = gesture(this, args, true).event(event),\n        v = select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n        p = pointer(event, currentTarget),\n        x0 = event.clientX,\n        y0 = event.clientY;\n\n    dragDisable(event.view);\n    nopropagation(event);\n    g.mouse = [p, this.__zoom.invert(p)];\n    interrupt(this);\n    g.start();\n\n    function mousemoved(event) {\n      noevent(event);\n      if (!g.moved) {\n        var dx = event.clientX - x0, dy = event.clientY - y0;\n        g.moved = dx * dx + dy * dy > clickDistance2;\n      }\n      g.event(event)\n       .zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));\n    }\n\n    function mouseupped(event) {\n      v.on(\"mousemove.zoom mouseup.zoom\", null);\n      dragEnable(event.view, g.moved);\n      noevent(event);\n      g.event(event).end();\n    }\n  }\n\n  function dblclicked(event, ...args) {\n    if (!filter.apply(this, arguments)) return;\n    var t0 = this.__zoom,\n        p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this),\n        p1 = t0.invert(p0),\n        k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n        t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);\n\n    noevent(event);\n    if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0, event);\n    else select(this).call(zoom.transform, t1, p0, event);\n  }\n\n  function touchstarted(event, ...args) {\n    if (!filter.apply(this, arguments)) return;\n    var touches = event.touches,\n        n = touches.length,\n        g = gesture(this, args, event.changedTouches.length === n).event(event),\n        started, i, t, p;\n\n    nopropagation(event);\n    for (i = 0; i < n; ++i) {\n      t = touches[i], p = pointer(t, this);\n      p = [p, this.__zoom.invert(p), t.identifier];\n      if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;\n      else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;\n    }\n\n    if (touchstarting) touchstarting = clearTimeout(touchstarting);\n\n    if (started) {\n      if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n      interrupt(this);\n      g.start();\n    }\n  }\n\n  function touchmoved(event, ...args) {\n    if (!this.__zooming) return;\n    var g = gesture(this, args).event(event),\n        touches = event.changedTouches,\n        n = touches.length, i, t, p, l;\n\n    noevent(event);\n    for (i = 0; i < n; ++i) {\n      t = touches[i], p = pointer(t, this);\n      if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n      else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n    }\n    t = g.that.__zoom;\n    if (g.touch1) {\n      var p0 = g.touch0[0], l0 = g.touch0[1],\n          p1 = g.touch1[0], l1 = g.touch1[1],\n          dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n          dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n      t = scale(t, Math.sqrt(dp / dl));\n      p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n      l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n    }\n    else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n    else return;\n\n    g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n  }\n\n  function touchended(event, ...args) {\n    if (!this.__zooming) return;\n    var g = gesture(this, args).event(event),\n        touches = event.changedTouches,\n        n = touches.length, i, t;\n\n    nopropagation(event);\n    if (touchending) clearTimeout(touchending);\n    touchending = setTimeout(function() { touchending = null; }, touchDelay);\n    for (i = 0; i < n; ++i) {\n      t = touches[i];\n      if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n      else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n    }\n    if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n    if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n    else {\n      g.end();\n      // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.\n      if (g.taps === 2) {\n        t = pointer(t, this);\n        if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {\n          var p = select(this).on(\"dblclick.zoom\");\n          if (p) p.apply(this, arguments);\n        }\n      }\n    }\n  }\n\n  zoom.wheelDelta = function(_) {\n    return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n  };\n\n  zoom.filter = function(_) {\n    return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n  };\n\n  zoom.touchable = function(_) {\n    return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n  };\n\n  zoom.extent = function(_) {\n    return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n  };\n\n  zoom.scaleExtent = function(_) {\n    return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n  };\n\n  zoom.translateExtent = function(_) {\n    return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n  };\n\n  zoom.constrain = function(_) {\n    return arguments.length ? (constrain = _, zoom) : constrain;\n  };\n\n  zoom.duration = function(_) {\n    return arguments.length ? (duration = +_, zoom) : duration;\n  };\n\n  zoom.interpolate = function(_) {\n    return arguments.length ? (interpolate = _, zoom) : interpolate;\n  };\n\n  zoom.on = function() {\n    var value = listeners.on.apply(listeners, arguments);\n    return value === listeners ? zoom : value;\n  };\n\n  zoom.clickDistance = function(_) {\n    return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n  };\n\n  zoom.tapDistance = function(_) {\n    return arguments.length ? (tapDistance = +_, zoom) : tapDistance;\n  };\n\n  return zoom;\n}\n","import { drag } from 'd3-drag';\nimport { select, pointer } from 'd3-selection';\nimport { zoom, zoomIdentity, zoomTransform } from 'd3-zoom';\nimport { interpolateZoom, interpolate } from 'd3-interpolate';\n\nconst errorMessages = {\n    error001: () => '[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001',\n    error002: () => \"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.\",\n    error003: (nodeType) => `Node type \"${nodeType}\" not found. Using fallback type \"default\".`,\n    error004: () => 'The React Flow parent container needs a width and a height to render the graph.',\n    error005: () => 'Only child nodes can use a parent extent.',\n    error006: () => \"Can't create edge. An edge needs a source and a target.\",\n    error007: (id) => `The old edge with id=${id} does not exist.`,\n    error009: (type) => `Marker type \"${type}\" doesn't exist.`,\n    error008: (handleType, { id, sourceHandle, targetHandle }) => `Couldn't create edge for ${handleType} handle id: \"${handleType === 'source' ? sourceHandle : targetHandle}\", edge id: ${id}.`,\n    error010: () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.',\n    error011: (edgeType) => `Edge type \"${edgeType}\" not found. Using fallback type \"default\".`,\n    error012: (id) => `Node with id \"${id}\" does not exist, it may have been removed. This can happen when a node is deleted before the \"onNodeClick\" handler is called.`,\n    error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`,\n    error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.',\n    error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.',\n};\nconst infiniteExtent = [\n    [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n    [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n];\nconst elementSelectionKeys = ['Enter', ' ', 'Escape'];\nconst defaultAriaLabelConfig = {\n    'node.a11yDescription.default': 'Press enter or space to select a node. Press delete to remove it and escape to cancel.',\n    'node.a11yDescription.keyboardDisabled': 'Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.',\n    'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`,\n    'edge.a11yDescription.default': 'Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.',\n    // Control elements\n    'controls.ariaLabel': 'Control Panel',\n    'controls.zoomIn.ariaLabel': 'Zoom In',\n    'controls.zoomOut.ariaLabel': 'Zoom Out',\n    'controls.fitView.ariaLabel': 'Fit View',\n    'controls.interactive.ariaLabel': 'Toggle Interactivity',\n    // Mini map\n    'minimap.ariaLabel': 'Mini Map',\n    // Handle\n    'handle.ariaLabel': 'Handle',\n};\n\n/**\n * The `ConnectionMode` is used to set the mode of connection between nodes.\n * The `Strict` mode is the default one and only allows source to target edges.\n * `Loose` mode allows source to source and target to target edges as well.\n *\n * @public\n */\nvar ConnectionMode;\n(function (ConnectionMode) {\n    ConnectionMode[\"Strict\"] = \"strict\";\n    ConnectionMode[\"Loose\"] = \"loose\";\n})(ConnectionMode || (ConnectionMode = {}));\n/**\n * This enum is used to set the different modes of panning the viewport when the\n * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling\n * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict\n * scroll panning to only the vertical or horizontal axis, respectively.\n *\n * @public\n */\nvar PanOnScrollMode;\n(function (PanOnScrollMode) {\n    PanOnScrollMode[\"Free\"] = \"free\";\n    PanOnScrollMode[\"Vertical\"] = \"vertical\";\n    PanOnScrollMode[\"Horizontal\"] = \"horizontal\";\n})(PanOnScrollMode || (PanOnScrollMode = {}));\nvar SelectionMode;\n(function (SelectionMode) {\n    SelectionMode[\"Partial\"] = \"partial\";\n    SelectionMode[\"Full\"] = \"full\";\n})(SelectionMode || (SelectionMode = {}));\nconst initialConnection = {\n    inProgress: false,\n    isValid: null,\n    from: null,\n    fromHandle: null,\n    fromPosition: null,\n    fromNode: null,\n    to: null,\n    toHandle: null,\n    toPosition: null,\n    toNode: null,\n    pointer: null,\n};\n\n/**\n * If you set the `connectionLineType` prop on your [`<ReactFlow />`](/api-reference/react-flow#connection-connectionLineType)\n *component, it will dictate the style of connection line rendered when creating\n *new edges.\n *\n * @public\n *\n * @remarks If you choose to render a custom connection line component, this value will be\n *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props).\n */\nvar ConnectionLineType;\n(function (ConnectionLineType) {\n    ConnectionLineType[\"Bezier\"] = \"default\";\n    ConnectionLineType[\"Straight\"] = \"straight\";\n    ConnectionLineType[\"Step\"] = \"step\";\n    ConnectionLineType[\"SmoothStep\"] = \"smoothstep\";\n    ConnectionLineType[\"SimpleBezier\"] = \"simplebezier\";\n})(ConnectionLineType || (ConnectionLineType = {}));\n/**\n * Edges may optionally have a marker on either end. The MarkerType type enumerates\n * the options available to you when configuring a given marker.\n *\n * @public\n */\nvar MarkerType;\n(function (MarkerType) {\n    MarkerType[\"Arrow\"] = \"arrow\";\n    MarkerType[\"ArrowClosed\"] = \"arrowclosed\";\n})(MarkerType || (MarkerType = {}));\n\n/**\n * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a\n * component in the corners of a container, the `Position` enum is less precise and used\n * primarily in relation to edges and handles.\n *\n * @public\n */\nvar Position;\n(function (Position) {\n    Position[\"Left\"] = \"left\";\n    Position[\"Top\"] = \"top\";\n    Position[\"Right\"] = \"right\";\n    Position[\"Bottom\"] = \"bottom\";\n})(Position || (Position = {}));\nconst oppositePosition = {\n    [Position.Left]: Position.Right,\n    [Position.Right]: Position.Left,\n    [Position.Top]: Position.Bottom,\n    [Position.Bottom]: Position.Top,\n};\n\n/**\n * @internal\n */\nfunction areConnectionMapsEqual(a, b) {\n    if (!a && !b) {\n        return true;\n    }\n    if (!a || !b || a.size !== b.size) {\n        return false;\n    }\n    if (!a.size && !b.size) {\n        return true;\n    }\n    for (const key of a.keys()) {\n        if (!b.has(key)) {\n            return false;\n        }\n    }\n    return true;\n}\n/**\n * We call the callback for all connections in a that are not in b\n *\n * @internal\n */\nfunction handleConnectionChange(a, b, cb) {\n    if (!cb) {\n        return;\n    }\n    const diff = [];\n    a.forEach((connection, key) => {\n        if (!b?.has(key)) {\n            diff.push(connection);\n        }\n    });\n    if (diff.length) {\n        cb(diff);\n    }\n}\nfunction getConnectionStatus(isValid) {\n    return isValid === null ? null : isValid ? 'valid' : 'invalid';\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Test whether an object is usable as an Edge\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Edge\n */\nconst isEdgeBase = (element) => 'id' in element && 'source' in element && 'target' in element;\n/**\n * Test whether an object is usable as a Node\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Node\n */\nconst isNodeBase = (element) => 'id' in element && 'position' in element && !('source' in element) && !('target' in element);\nconst isInternalNodeBase = (element) => 'id' in element && 'internals' in element && !('source' in element) && !('target' in element);\n/**\n * This util is used to tell you what nodes, if any, are connected to the given node\n * as the _target_ of an edge.\n * @public\n * @param node - The node to get the connected nodes from.\n * @param nodes - The array of all nodes.\n * @param edges - The array of all edges.\n * @returns An array of nodes that are connected over edges where the source is the given node.\n *\n * @example\n * ```ts\n *import { getOutgoers } from '@xyflow/react';\n *\n *const nodes = [];\n *const edges = [];\n *\n *const outgoers = getOutgoers(\n *  { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },\n *  nodes,\n *  edges,\n *);\n *```\n */\nconst getOutgoers = (node, nodes, edges) => {\n    if (!node.id) {\n        return [];\n    }\n    const outgoerIds = new Set();\n    edges.forEach((edge) => {\n        if (edge.source === node.id) {\n            outgoerIds.add(edge.target);\n        }\n    });\n    return nodes.filter((n) => outgoerIds.has(n.id));\n};\n/**\n * This util is used to tell you what nodes, if any, are connected to the given node\n * as the _source_ of an edge.\n * @public\n * @param node - The node to get the connected nodes from.\n * @param nodes - The array of all nodes.\n * @param edges - The array of all edges.\n * @returns An array of nodes that are connected over edges where the target is the given node.\n *\n * @example\n * ```ts\n *import { getIncomers } from '@xyflow/react';\n *\n *const nodes = [];\n *const edges = [];\n *\n *const incomers = getIncomers(\n *  { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },\n *  nodes,\n *  edges,\n *);\n *```\n */\nconst getIncomers = (node, nodes, edges) => {\n    if (!node.id) {\n        return [];\n    }\n    const incomersIds = new Set();\n    edges.forEach((edge) => {\n        if (edge.target === node.id) {\n            incomersIds.add(edge.source);\n        }\n    });\n    return nodes.filter((n) => incomersIds.has(n.id));\n};\nconst getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {\n    const { width, height } = getNodeDimensions(node);\n    const origin = node.origin ?? nodeOrigin;\n    const offsetX = width * origin[0];\n    const offsetY = height * origin[1];\n    return {\n        x: node.position.x - offsetX,\n        y: node.position.y - offsetY,\n    };\n};\n/**\n * Returns the bounding box that contains all the given nodes in an array. This can\n * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds)\n * to calculate the correct transform to fit the given nodes in a viewport.\n * @public\n * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport.\n * @param nodes - Nodes to calculate the bounds for.\n * @returns Bounding box enclosing all nodes.\n *\n * @remarks This function was previously called `getRectOfNodes`\n *\n * @example\n * ```js\n *import { getNodesBounds } from '@xyflow/react';\n *\n *const nodes = [\n *  {\n *    id: 'a',\n *    position: { x: 0, y: 0 },\n *    data: { label: 'a' },\n *    width: 50,\n *    height: 25,\n *  },\n *  {\n *    id: 'b',\n *    position: { x: 100, y: 100 },\n *    data: { label: 'b' },\n *    width: 50,\n *    height: 25,\n *  },\n *];\n *\n *const bounds = getNodesBounds(nodes);\n *```\n */\nconst getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => {\n    if (process.env.NODE_ENV === 'development' && !params.nodeLookup) {\n        console.warn('Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.');\n    }\n    if (nodes.length === 0) {\n        return { x: 0, y: 0, width: 0, height: 0 };\n    }\n    const box = nodes.reduce((currBox, nodeOrId) => {\n        const isId = typeof nodeOrId === 'string';\n        let currentNode = !params.nodeLookup && !isId ? nodeOrId : undefined;\n        if (params.nodeLookup) {\n            currentNode = isId\n                ? params.nodeLookup.get(nodeOrId)\n                : !isInternalNodeBase(nodeOrId)\n                    ? params.nodeLookup.get(nodeOrId.id)\n                    : nodeOrId;\n        }\n        const nodeBox = currentNode ? nodeToBox(currentNode, params.nodeOrigin) : { x: 0, y: 0, x2: 0, y2: 0 };\n        return getBoundsOfBoxes(currBox, nodeBox);\n    }, { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity });\n    return boxToRect(box);\n};\n/**\n * Determines a bounding box that contains all given nodes in an array\n * @internal\n */\nconst getInternalNodesBounds = (nodeLookup, params = {}) => {\n    let box = { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity };\n    let hasVisibleNodes = false;\n    nodeLookup.forEach((node) => {\n        if (params.filter === undefined || params.filter(node)) {\n            box = getBoundsOfBoxes(box, nodeToBox(node));\n            hasVisibleNodes = true;\n        }\n    });\n    return hasVisibleNodes ? boxToRect(box) : { x: 0, y: 0, width: 0, height: 0 };\n};\nconst getNodesInside = (nodes, rect, [tx, ty, tScale] = [0, 0, 1], partially = false, \n// set excludeNonSelectableNodes if you want to pay attention to the nodes \"selectable\" attribute\nexcludeNonSelectableNodes = false) => {\n    const paneRect = {\n        ...pointToRendererPoint(rect, [tx, ty, tScale]),\n        width: rect.width / tScale,\n        height: rect.height / tScale,\n    };\n    const visibleNodes = [];\n    for (const node of nodes.values()) {\n        const { measured, selectable = true, hidden = false } = node;\n        if ((excludeNonSelectableNodes && !selectable) || hidden) {\n            continue;\n        }\n        const width = measured.width ?? node.width ?? node.initialWidth ?? null;\n        const height = measured.height ?? node.height ?? node.initialHeight ?? null;\n        const overlappingArea = getOverlappingArea(paneRect, nodeToRect(node));\n        const area = (width ?? 0) * (height ?? 0);\n        const partiallyVisible = partially && overlappingArea > 0;\n        const forceInitialRender = !node.internals.handleBounds;\n        const isVisible = forceInitialRender || partiallyVisible || overlappingArea >= area;\n        if (isVisible || node.dragging) {\n            visibleNodes.push(node);\n        }\n    }\n    return visibleNodes;\n};\n/**\n * This utility filters an array of edges, keeping only those where either the source or target\n * node is present in the given array of nodes.\n * @public\n * @param nodes - Nodes you want to get the connected edges for.\n * @param edges - All edges.\n * @returns Array of edges that connect any of the given nodes with each other.\n *\n * @example\n * ```js\n *import { getConnectedEdges } from '@xyflow/react';\n *\n *const nodes = [\n *  { id: 'a', position: { x: 0, y: 0 } },\n *  { id: 'b', position: { x: 100, y: 0 } },\n *];\n *\n *const edges = [\n *  { id: 'a->c', source: 'a', target: 'c' },\n *  { id: 'c->d', source: 'c', target: 'd' },\n *];\n *\n *const connectedEdges = getConnectedEdges(nodes, edges);\n * // => [{ id: 'a->c', source: 'a', target: 'c' }]\n *```\n */\nconst getConnectedEdges = (nodes, edges) => {\n    const nodeIds = new Set();\n    nodes.forEach((node) => {\n        nodeIds.add(node.id);\n    });\n    return edges.filter((edge) => nodeIds.has(edge.source) || nodeIds.has(edge.target));\n};\nfunction getFitViewNodes(nodeLookup, options) {\n    const fitViewNodes = new Map();\n    const optionNodeIds = options?.nodes ? new Set(options.nodes.map((node) => node.id)) : null;\n    nodeLookup.forEach((n) => {\n        const isVisible = n.measured.width && n.measured.height && (options?.includeHiddenNodes || !n.hidden);\n        if (isVisible && (!optionNodeIds || optionNodeIds.has(n.id))) {\n            fitViewNodes.set(n.id, n);\n        }\n    });\n    return fitViewNodes;\n}\nasync function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) {\n    if (nodes.size === 0) {\n        return Promise.resolve(true);\n    }\n    const nodesToFit = getFitViewNodes(nodes, options);\n    const bounds = getInternalNodesBounds(nodesToFit);\n    const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);\n    await panZoom.setViewport(viewport, {\n        duration: options?.duration,\n        ease: options?.ease,\n        interpolate: options?.interpolate,\n    });\n    return Promise.resolve(true);\n}\n/**\n * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin.\n *\n * @internal\n * @returns position, positionAbsolute\n */\nfunction calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin = [0, 0], nodeExtent, onError, }) {\n    const node = nodeLookup.get(nodeId);\n    const parentNode = node.parentId ? nodeLookup.get(node.parentId) : undefined;\n    const { x: parentX, y: parentY } = parentNode ? parentNode.internals.positionAbsolute : { x: 0, y: 0 };\n    const origin = node.origin ?? nodeOrigin;\n    let extent = node.extent || nodeExtent;\n    if (node.extent === 'parent' && !node.expandParent) {\n        if (!parentNode) {\n            onError?.('005', errorMessages['error005']());\n        }\n        else {\n            const parentWidth = parentNode.measured.width;\n            const parentHeight = parentNode.measured.height;\n            if (parentWidth && parentHeight) {\n                extent = [\n                    [parentX, parentY],\n                    [parentX + parentWidth, parentY + parentHeight],\n                ];\n            }\n        }\n    }\n    else if (parentNode && isCoordinateExtent(node.extent)) {\n        extent = [\n            [node.extent[0][0] + parentX, node.extent[0][1] + parentY],\n            [node.extent[1][0] + parentX, node.extent[1][1] + parentY],\n        ];\n    }\n    const positionAbsolute = isCoordinateExtent(extent)\n        ? clampPosition(nextPosition, extent, node.measured)\n        : nextPosition;\n    if (node.measured.width === undefined || node.measured.height === undefined) {\n        onError?.('015', errorMessages['error015']());\n    }\n    return {\n        position: {\n            x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0],\n            y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1],\n        },\n        positionAbsolute,\n    };\n}\n/**\n * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted\n * @internal\n * @param param.nodesToRemove - The nodes to remove\n * @param param.edgesToRemove - The edges to remove\n * @param param.nodes - All nodes\n * @param param.edges - All edges\n * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted\n * @returns nodes: nodes that can be deleted, edges: edges that can be deleted\n */\nasync function getElementsToRemove({ nodesToRemove = [], edgesToRemove = [], nodes, edges, onBeforeDelete, }) {\n    const nodeIds = new Set(nodesToRemove.map((node) => node.id));\n    const matchingNodes = [];\n    for (const node of nodes) {\n        if (node.deletable === false) {\n            continue;\n        }\n        const isIncluded = nodeIds.has(node.id);\n        const parentHit = !isIncluded && node.parentId && matchingNodes.find((n) => n.id === node.parentId);\n        if (isIncluded || parentHit) {\n            matchingNodes.push(node);\n        }\n    }\n    const edgeIds = new Set(edgesToRemove.map((edge) => edge.id));\n    const deletableEdges = edges.filter((edge) => edge.deletable !== false);\n    const connectedEdges = getConnectedEdges(matchingNodes, deletableEdges);\n    const matchingEdges = connectedEdges;\n    for (const edge of deletableEdges) {\n        const isIncluded = edgeIds.has(edge.id);\n        if (isIncluded && !matchingEdges.find((e) => e.id === edge.id)) {\n            matchingEdges.push(edge);\n        }\n    }\n    if (!onBeforeDelete) {\n        return {\n            edges: matchingEdges,\n            nodes: matchingNodes,\n        };\n    }\n    const onBeforeDeleteResult = await onBeforeDelete({\n        nodes: matchingNodes,\n        edges: matchingEdges,\n    });\n    if (typeof onBeforeDeleteResult === 'boolean') {\n        return onBeforeDeleteResult ? { edges: matchingEdges, nodes: matchingNodes } : { edges: [], nodes: [] };\n    }\n    return onBeforeDeleteResult;\n}\n\nconst clamp = (val, min = 0, max = 1) => Math.min(Math.max(val, min), max);\nconst clampPosition = (position = { x: 0, y: 0 }, extent, dimensions) => ({\n    x: clamp(position.x, extent[0][0], extent[1][0] - (dimensions?.width ?? 0)),\n    y: clamp(position.y, extent[0][1], extent[1][1] - (dimensions?.height ?? 0)),\n});\nfunction clampPositionToParent(childPosition, childDimensions, parent) {\n    const { width: parentWidth, height: parentHeight } = getNodeDimensions(parent);\n    const { x: parentX, y: parentY } = parent.internals.positionAbsolute;\n    return clampPosition(childPosition, [\n        [parentX, parentY],\n        [parentX + parentWidth, parentY + parentHeight],\n    ], childDimensions);\n}\n/**\n * Calculates the velocity of panning when the mouse is close to the edge of the canvas\n * @internal\n * @param value - One dimensional poition of the mouse (x or y)\n * @param min - Minimal position on canvas before panning starts\n * @param max - Maximal position on canvas before panning starts\n * @returns - A number between 0 and 1 that represents the velocity of panning\n */\nconst calcAutoPanVelocity = (value, min, max) => {\n    if (value < min) {\n        return clamp(Math.abs(value - min), 1, min) / min;\n    }\n    else if (value > max) {\n        return -clamp(Math.abs(value - max), 1, min) / min;\n    }\n    return 0;\n};\nconst calcAutoPan = (pos, bounds, speed = 15, distance = 40) => {\n    const xMovement = calcAutoPanVelocity(pos.x, distance, bounds.width - distance) * speed;\n    const yMovement = calcAutoPanVelocity(pos.y, distance, bounds.height - distance) * speed;\n    return [xMovement, yMovement];\n};\nconst getBoundsOfBoxes = (box1, box2) => ({\n    x: Math.min(box1.x, box2.x),\n    y: Math.min(box1.y, box2.y),\n    x2: Math.max(box1.x2, box2.x2),\n    y2: Math.max(box1.y2, box2.y2),\n});\nconst rectToBox = ({ x, y, width, height }) => ({\n    x,\n    y,\n    x2: x + width,\n    y2: y + height,\n});\nconst boxToRect = ({ x, y, x2, y2 }) => ({\n    x,\n    y,\n    width: x2 - x,\n    height: y2 - y,\n});\nconst nodeToRect = (node, nodeOrigin = [0, 0]) => {\n    const { x, y } = isInternalNodeBase(node)\n        ? node.internals.positionAbsolute\n        : getNodePositionWithOrigin(node, nodeOrigin);\n    return {\n        x,\n        y,\n        width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,\n        height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,\n    };\n};\nconst nodeToBox = (node, nodeOrigin = [0, 0]) => {\n    const { x, y } = isInternalNodeBase(node)\n        ? node.internals.positionAbsolute\n        : getNodePositionWithOrigin(node, nodeOrigin);\n    return {\n        x,\n        y,\n        x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0),\n        y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0),\n    };\n};\nconst getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2)));\nconst getOverlappingArea = (rectA, rectB) => {\n    const xOverlap = Math.max(0, Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - Math.max(rectA.x, rectB.x));\n    const yOverlap = Math.max(0, Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - Math.max(rectA.y, rectB.y));\n    return Math.ceil(xOverlap * yOverlap);\n};\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isRectObject = (obj) => isNumeric(obj.width) && isNumeric(obj.height) && isNumeric(obj.x) && isNumeric(obj.y);\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nconst isNumeric = (n) => !isNaN(n) && isFinite(n);\n// used for a11y key board controls for nodes and edges\nconst devWarn = (id, message) => {\n    if (process.env.NODE_ENV === 'development') {\n        console.warn(`[React Flow]: ${message} Help: https://reactflow.dev/error#${id}`);\n    }\n};\nconst snapPosition = (position, snapGrid = [1, 1]) => {\n    return {\n        x: snapGrid[0] * Math.round(position.x / snapGrid[0]),\n        y: snapGrid[1] * Math.round(position.y / snapGrid[1]),\n    };\n};\nconst pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = false, snapGrid = [1, 1]) => {\n    const position = {\n        x: (x - tx) / tScale,\n        y: (y - ty) / tScale,\n    };\n    return snapToGrid ? snapPosition(position, snapGrid) : position;\n};\nconst rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {\n    return {\n        x: x * tScale + tx,\n        y: y * tScale + ty,\n    };\n};\n/**\n * Parses a single padding value to a number\n * @internal\n * @param padding - Padding to parse\n * @param viewport - Width or height of the viewport\n * @returns The padding in pixels\n */\nfunction parsePadding(padding, viewport) {\n    if (typeof padding === 'number') {\n        return Math.floor((viewport - viewport / (1 + padding)) * 0.5);\n    }\n    if (typeof padding === 'string' && padding.endsWith('px')) {\n        const paddingValue = parseFloat(padding);\n        if (!Number.isNaN(paddingValue)) {\n            return Math.floor(paddingValue);\n        }\n    }\n    if (typeof padding === 'string' && padding.endsWith('%')) {\n        const paddingValue = parseFloat(padding);\n        if (!Number.isNaN(paddingValue)) {\n            return Math.floor(viewport * paddingValue * 0.01);\n        }\n    }\n    console.error(`[React Flow] The padding value \"${padding}\" is invalid. Please provide a number or a string with a valid unit (px or %).`);\n    return 0;\n}\n/**\n * Parses the paddings to an object with top, right, bottom, left, x and y paddings\n * @internal\n * @param padding - Padding to parse\n * @param width - Width of the viewport\n * @param height - Height of the viewport\n * @returns An object with the paddings in pixels\n */\nfunction parsePaddings(padding, width, height) {\n    if (typeof padding === 'string' || typeof padding === 'number') {\n        const paddingY = parsePadding(padding, height);\n        const paddingX = parsePadding(padding, width);\n        return {\n            top: paddingY,\n            right: paddingX,\n            bottom: paddingY,\n            left: paddingX,\n            x: paddingX * 2,\n            y: paddingY * 2,\n        };\n    }\n    if (typeof padding === 'object') {\n        const top = parsePadding(padding.top ?? padding.y ?? 0, height);\n        const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);\n        const left = parsePadding(padding.left ?? padding.x ?? 0, width);\n        const right = parsePadding(padding.right ?? padding.x ?? 0, width);\n        return { top, right, bottom, left, x: left + right, y: top + bottom };\n    }\n    return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };\n}\n/**\n * Calculates the resulting paddings if the new viewport is applied\n * @internal\n * @param bounds - Bounds to fit inside viewport\n * @param x - X position of the viewport\n * @param y - Y position of the viewport\n * @param zoom - Zoom level of the viewport\n * @param width - Width of the viewport\n * @param height - Height of the viewport\n * @returns An object with the minimum padding required to fit the bounds inside the viewport\n */\nfunction calculateAppliedPaddings(bounds, x, y, zoom, width, height) {\n    const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]);\n    const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]);\n    const right = width - boundRight;\n    const bottom = height - boundBottom;\n    return {\n        left: Math.floor(left),\n        top: Math.floor(top),\n        right: Math.floor(right),\n        bottom: Math.floor(bottom),\n    };\n}\n/**\n * Returns a viewport that encloses the given bounds with padding.\n * @public\n * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects}\n * @param bounds - Bounds to fit inside viewport.\n * @param width - Width of the viewport.\n * @param height  - Height of the viewport.\n * @param minZoom - Minimum zoom level of the resulting viewport.\n * @param maxZoom - Maximum zoom level of the resulting viewport.\n * @param padding - Padding around the bounds.\n * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}.\n * @example\n * const { x, y, zoom } = getViewportForBounds(\n * { x: 0, y: 0, width: 100, height: 100},\n * 1200, 800, 0.5, 2);\n */\nconst getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {\n    // First we resolve all the paddings to actual pixel values\n    const p = parsePaddings(padding, width, height);\n    const xZoom = (width - p.x) / bounds.width;\n    const yZoom = (height - p.y) / bounds.height;\n    // We calculate the new x, y, zoom for a centered view\n    const zoom = Math.min(xZoom, yZoom);\n    const clampedZoom = clamp(zoom, minZoom, maxZoom);\n    const boundsCenterX = bounds.x + bounds.width / 2;\n    const boundsCenterY = bounds.y + bounds.height / 2;\n    const x = width / 2 - boundsCenterX * clampedZoom;\n    const y = height / 2 - boundsCenterY * clampedZoom;\n    // Then we calculate the minimum padding, to respect asymmetric paddings\n    const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height);\n    // We only want to have an offset if the newPadding is smaller than the required padding\n    const offset = {\n        left: Math.min(newPadding.left - p.left, 0),\n        top: Math.min(newPadding.top - p.top, 0),\n        right: Math.min(newPadding.right - p.right, 0),\n        bottom: Math.min(newPadding.bottom - p.bottom, 0),\n    };\n    return {\n        x: x - offset.left + offset.right,\n        y: y - offset.top + offset.bottom,\n        zoom: clampedZoom,\n    };\n};\nconst isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;\nfunction isCoordinateExtent(extent) {\n    return extent !== undefined && extent !== null && extent !== 'parent';\n}\nfunction getNodeDimensions(node) {\n    return {\n        width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,\n        height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,\n    };\n}\nfunction nodeHasDimensions(node) {\n    return ((node.measured?.width ?? node.width ?? node.initialWidth) !== undefined &&\n        (node.measured?.height ?? node.height ?? node.initialHeight) !== undefined);\n}\n/**\n * Convert child position to absolute position\n *\n * @internal\n * @param position\n * @param parentId\n * @param nodeLookup\n * @param nodeOrigin\n * @returns an internal node with an absolute position\n */\nfunction evaluateAbsolutePosition(position, dimensions = { width: 0, height: 0 }, parentId, nodeLookup, nodeOrigin) {\n    const positionAbsolute = { ...position };\n    const parent = nodeLookup.get(parentId);\n    if (parent) {\n        const origin = parent.origin || nodeOrigin;\n        positionAbsolute.x += parent.internals.positionAbsolute.x - (dimensions.width ?? 0) * origin[0];\n        positionAbsolute.y += parent.internals.positionAbsolute.y - (dimensions.height ?? 0) * origin[1];\n    }\n    return positionAbsolute;\n}\nfunction areSetsEqual(a, b) {\n    if (a.size !== b.size) {\n        return false;\n    }\n    for (const item of a) {\n        if (!b.has(item)) {\n            return false;\n        }\n    }\n    return true;\n}\n/**\n * Polyfill for Promise.withResolvers until we can use it in all browsers\n * @internal\n */\nfunction withResolvers() {\n    let resolve;\n    let reject;\n    const promise = new Promise((res, rej) => {\n        resolve = res;\n        reject = rej;\n    });\n    return { promise, resolve, reject };\n}\nfunction mergeAriaLabelConfig(partial) {\n    return { ...defaultAriaLabelConfig, ...(partial || {}) };\n}\n\nfunction getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = false, transform, containerBounds }) {\n    const { x, y } = getEventPosition(event);\n    const pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform);\n    const { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;\n    // we need the snapped position in order to be able to skip unnecessary drag events\n    return {\n        xSnapped,\n        ySnapped,\n        ...pointerPos,\n    };\n}\nconst getDimensions = (node) => ({\n    width: node.offsetWidth,\n    height: node.offsetHeight,\n});\nconst getHostForElement = (element) => element?.getRootNode?.() || window?.document;\nconst inputTags = ['INPUT', 'SELECT', 'TEXTAREA'];\nfunction isInputDOMNode(event) {\n    // using composed path for handling shadow dom\n    const target = (event.composedPath?.()?.[0] || event.target);\n    if (target?.nodeType !== 1 /* Node.ELEMENT_NODE */)\n        return false;\n    const isInput = inputTags.includes(target.nodeName) || target.hasAttribute('contenteditable');\n    // when an input field is focused we don't want to trigger deletion or movement of nodes\n    return isInput || !!target.closest('.nokey');\n}\nconst isMouseEvent = (event) => 'clientX' in event;\nconst getEventPosition = (event, bounds) => {\n    const isMouse = isMouseEvent(event);\n    const evtX = isMouse ? event.clientX : event.touches?.[0].clientX;\n    const evtY = isMouse ? event.clientY : event.touches?.[0].clientY;\n    return {\n        x: evtX - (bounds?.left ?? 0),\n        y: evtY - (bounds?.top ?? 0),\n    };\n};\n/*\n * The handle bounds are calculated relative to the node element.\n * We store them in the internals object of the node in order to avoid\n * unnecessary recalculations.\n */\nconst getHandleBounds = (type, nodeElement, nodeBounds, zoom, nodeId) => {\n    const handles = nodeElement.querySelectorAll(`.${type}`);\n    if (!handles || !handles.length) {\n        return null;\n    }\n    return Array.from(handles).map((handle) => {\n        const handleBounds = handle.getBoundingClientRect();\n        return {\n            id: handle.getAttribute('data-handleid'),\n            type,\n            nodeId,\n            position: handle.getAttribute('data-handlepos'),\n            x: (handleBounds.left - nodeBounds.left) / zoom,\n            y: (handleBounds.top - nodeBounds.top) / zoom,\n            ...getDimensions(handle),\n        };\n    });\n};\n\nfunction getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }) {\n    /*\n     * cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate\n     * https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve\n     */\n    const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125;\n    const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125;\n    const offsetX = Math.abs(centerX - sourceX);\n    const offsetY = Math.abs(centerY - sourceY);\n    return [centerX, centerY, offsetX, offsetY];\n}\nfunction calculateControlOffset(distance, curvature) {\n    if (distance >= 0) {\n        return 0.5 * distance;\n    }\n    return curvature * 25 * Math.sqrt(-distance);\n}\nfunction getControlWithCurvature({ pos, x1, y1, x2, y2, c }) {\n    switch (pos) {\n        case Position.Left:\n            return [x1 - calculateControlOffset(x1 - x2, c), y1];\n        case Position.Right:\n            return [x1 + calculateControlOffset(x2 - x1, c), y1];\n        case Position.Top:\n            return [x1, y1 - calculateControlOffset(y1 - y2, c)];\n        case Position.Bottom:\n            return [x1, y1 + calculateControlOffset(y2 - y1, c)];\n    }\n}\n/**\n * The `getBezierPath` util returns everything you need to render a bezier edge\n *between two nodes.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n *  const source = { x: 0, y: 20 };\n *  const target = { x: 150, y: 100 };\n *\n *  const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({\n *    sourceX: source.x,\n *    sourceY: source.y,\n *    sourcePosition: Position.Right,\n *    targetX: target.x,\n *    targetY: target.y,\n *    targetPosition: Position.Left,\n *});\n *```\n *\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to\n *work with multiple edge paths at once.\n */\nfunction getBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, curvature = 0.25, }) {\n    const [sourceControlX, sourceControlY] = getControlWithCurvature({\n        pos: sourcePosition,\n        x1: sourceX,\n        y1: sourceY,\n        x2: targetX,\n        y2: targetY,\n        c: curvature,\n    });\n    const [targetControlX, targetControlY] = getControlWithCurvature({\n        pos: targetPosition,\n        x1: targetX,\n        y1: targetY,\n        x2: sourceX,\n        y2: sourceY,\n        c: curvature,\n    });\n    const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n        sourceX,\n        sourceY,\n        targetX,\n        targetY,\n        sourceControlX,\n        sourceControlY,\n        targetControlX,\n        targetControlY,\n    });\n    return [\n        `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n        labelX,\n        labelY,\n        offsetX,\n        offsetY,\n    ];\n}\n\n// this is used for straight edges and simple smoothstep edges (LTR, RTL, BTT, TTB)\nfunction getEdgeCenter({ sourceX, sourceY, targetX, targetY, }) {\n    const xOffset = Math.abs(targetX - sourceX) / 2;\n    const centerX = targetX < sourceX ? targetX + xOffset : targetX - xOffset;\n    const yOffset = Math.abs(targetY - sourceY) / 2;\n    const centerY = targetY < sourceY ? targetY + yOffset : targetY - yOffset;\n    return [centerX, centerY, xOffset, yOffset];\n}\n/**\n * Returns the z-index for an edge based on the node it connects and whether it is selected.\n * By default, edges are rendered below nodes. This behaviour is different for edges that are\n * connected to nodes with a parent, as they are rendered above the parent node.\n */\nfunction getElevatedEdgeZIndex({ sourceNode, targetNode, selected = false, zIndex = 0, elevateOnSelect = false, zIndexMode = 'basic', }) {\n    if (zIndexMode === 'manual') {\n        return zIndex;\n    }\n    const edgeZ = elevateOnSelect && selected ? zIndex + 1000 : zIndex;\n    const nodeZ = Math.max(sourceNode.parentId || (elevateOnSelect && sourceNode.selected) ? sourceNode.internals.z : 0, targetNode.parentId || (elevateOnSelect && targetNode.selected) ? targetNode.internals.z : 0);\n    return edgeZ + nodeZ;\n}\nfunction isEdgeVisible({ sourceNode, targetNode, width, height, transform }) {\n    const edgeBox = getBoundsOfBoxes(nodeToBox(sourceNode), nodeToBox(targetNode));\n    if (edgeBox.x === edgeBox.x2) {\n        edgeBox.x2 += 1;\n    }\n    if (edgeBox.y === edgeBox.y2) {\n        edgeBox.y2 += 1;\n    }\n    const viewRect = {\n        x: -transform[0] / transform[2],\n        y: -transform[1] / transform[2],\n        width: width / transform[2],\n        height: height / transform[2],\n    };\n    return getOverlappingArea(viewRect, boxToRect(edgeBox)) > 0;\n}\n/**\n * The default edge ID generator function. Generates an ID based on the source, target, and handles.\n * @public\n * @param params - The connection or edge to generate an ID for.\n * @returns The generated edge ID.\n */\nconst getEdgeId = ({ source, sourceHandle, target, targetHandle }) => `xy-edge__${source}${sourceHandle || ''}-${target}${targetHandle || ''}`;\nconst connectionExists = (edge, edges) => {\n    return edges.some((el) => el.source === edge.source &&\n        el.target === edge.target &&\n        (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle)) &&\n        (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle)));\n};\n/**\n * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one.\n * @public\n * @param edgeParams - Either an `Edge` or a `Connection` you want to add.\n * @param edges - The array of all current edges.\n * @param options - Optional configuration object.\n * @returns A new array of edges with the new edge added.\n *\n * @remarks If an edge with the same `target` and `source` already exists (and the same\n *`targetHandle` and `sourceHandle` if those are set), then this util won't add\n *a new edge even if the `id` property is different.\n *\n */\nconst addEdge = (edgeParams, edges, options = {}) => {\n    if (!edgeParams.source || !edgeParams.target) {\n        devWarn('006', errorMessages['error006']());\n        return edges;\n    }\n    const edgeIdGenerator = options.getEdgeId || getEdgeId;\n    let edge;\n    if (isEdgeBase(edgeParams)) {\n        edge = { ...edgeParams };\n    }\n    else {\n        edge = {\n            ...edgeParams,\n            id: edgeIdGenerator(edgeParams),\n        };\n    }\n    if (connectionExists(edge, edges)) {\n        return edges;\n    }\n    if (edge.sourceHandle === null) {\n        delete edge.sourceHandle;\n    }\n    if (edge.targetHandle === null) {\n        delete edge.targetHandle;\n    }\n    return edges.concat(edge);\n};\n/**\n * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties.\n *This searches your edge array for an edge with a matching `id` and updates its\n *properties with the connection you provide.\n * @public\n * @param oldEdge - The edge you want to update.\n * @param newConnection - The new connection you want to update the edge with.\n * @param edges - The array of all current edges.\n * @returns The updated edges array.\n *\n * @example\n * ```js\n *const onReconnect = useCallback(\n *  (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]);\n *```\n */\nconst reconnectEdge = (oldEdge, newConnection, edges, options = { shouldReplaceId: true }) => {\n    const { id: oldEdgeId, ...rest } = oldEdge;\n    if (!newConnection.source || !newConnection.target) {\n        devWarn('006', errorMessages['error006']());\n        return edges;\n    }\n    const foundEdge = edges.find((e) => e.id === oldEdge.id);\n    if (!foundEdge) {\n        devWarn('007', errorMessages['error007'](oldEdgeId));\n        return edges;\n    }\n    const edgeIdGenerator = options.getEdgeId || getEdgeId;\n    // Remove old edge and create the new edge with parameters of old edge.\n    const edge = {\n        ...rest,\n        id: options.shouldReplaceId ? edgeIdGenerator(newConnection) : oldEdgeId,\n        source: newConnection.source,\n        target: newConnection.target,\n        sourceHandle: newConnection.sourceHandle,\n        targetHandle: newConnection.targetHandle,\n    };\n    return edges.filter((e) => e.id !== oldEdgeId).concat(edge);\n};\n\n/**\n * Calculates the straight line path between two points.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n *\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n *  const source = { x: 0, y: 20 };\n *  const target = { x: 150, y: 100 };\n *\n *  const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({\n *    sourceX: source.x,\n *    sourceY: source.y,\n *    sourcePosition: Position.Right,\n *    targetX: target.x,\n *    targetY: target.y,\n *    targetPosition: Position.Left,\n *  });\n * ```\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.\n */\nfunction getStraightPath({ sourceX, sourceY, targetX, targetY, }) {\n    const [labelX, labelY, offsetX, offsetY] = getEdgeCenter({\n        sourceX,\n        sourceY,\n        targetX,\n        targetY,\n    });\n    return [`M ${sourceX},${sourceY}L ${targetX},${targetY}`, labelX, labelY, offsetX, offsetY];\n}\n\nconst handleDirections = {\n    [Position.Left]: { x: -1, y: 0 },\n    [Position.Right]: { x: 1, y: 0 },\n    [Position.Top]: { x: 0, y: -1 },\n    [Position.Bottom]: { x: 0, y: 1 },\n};\nconst getDirection = ({ source, sourcePosition = Position.Bottom, target, }) => {\n    if (sourcePosition === Position.Left || sourcePosition === Position.Right) {\n        return source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 };\n    }\n    return source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 };\n};\nconst distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));\n/*\n * With this function we try to mimic an orthogonal edge routing behaviour\n * It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges\n */\nfunction getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, stepPosition, }) {\n    const sourceDir = handleDirections[sourcePosition];\n    const targetDir = handleDirections[targetPosition];\n    const sourceGapped = { x: source.x + sourceDir.x * offset, y: source.y + sourceDir.y * offset };\n    const targetGapped = { x: target.x + targetDir.x * offset, y: target.y + targetDir.y * offset };\n    const dir = getDirection({\n        source: sourceGapped,\n        sourcePosition,\n        target: targetGapped,\n    });\n    const dirAccessor = dir.x !== 0 ? 'x' : 'y';\n    const currDir = dir[dirAccessor];\n    let points = [];\n    let centerX, centerY;\n    const sourceGapOffset = { x: 0, y: 0 };\n    const targetGapOffset = { x: 0, y: 0 };\n    const [, , defaultOffsetX, defaultOffsetY] = getEdgeCenter({\n        sourceX: source.x,\n        sourceY: source.y,\n        targetX: target.x,\n        targetY: target.y,\n    });\n    // opposite handle positions, default case\n    if (sourceDir[dirAccessor] * targetDir[dirAccessor] === -1) {\n        if (dirAccessor === 'x') {\n            // Primary direction is horizontal, so stepPosition affects X coordinate\n            centerX = center.x ?? sourceGapped.x + (targetGapped.x - sourceGapped.x) * stepPosition;\n            centerY = center.y ?? (sourceGapped.y + targetGapped.y) / 2;\n        }\n        else {\n            // Primary direction is vertical, so stepPosition affects Y coordinate\n            centerX = center.x ?? (sourceGapped.x + targetGapped.x) / 2;\n            centerY = center.y ?? sourceGapped.y + (targetGapped.y - sourceGapped.y) * stepPosition;\n        }\n        /*\n         *    --->\n         *    |\n         * >---\n         */\n        const verticalSplit = [\n            { x: centerX, y: sourceGapped.y },\n            { x: centerX, y: targetGapped.y },\n        ];\n        /*\n         *    |\n         *  ---\n         *  |\n         */\n        const horizontalSplit = [\n            { x: sourceGapped.x, y: centerY },\n            { x: targetGapped.x, y: centerY },\n        ];\n        if (sourceDir[dirAccessor] === currDir) {\n            points = dirAccessor === 'x' ? verticalSplit : horizontalSplit;\n        }\n        else {\n            points = dirAccessor === 'x' ? horizontalSplit : verticalSplit;\n        }\n    }\n    else {\n        // sourceTarget means we take x from source and y from target, targetSource is the opposite\n        const sourceTarget = [{ x: sourceGapped.x, y: targetGapped.y }];\n        const targetSource = [{ x: targetGapped.x, y: sourceGapped.y }];\n        // this handles edges with same handle positions\n        if (dirAccessor === 'x') {\n            points = sourceDir.x === currDir ? targetSource : sourceTarget;\n        }\n        else {\n            points = sourceDir.y === currDir ? sourceTarget : targetSource;\n        }\n        if (sourcePosition === targetPosition) {\n            const diff = Math.abs(source[dirAccessor] - target[dirAccessor]);\n            // if an edge goes from right to right for example (sourcePosition === targetPosition) and the distance between source.x and target.x is less than the offset, the added point and the gapped source/target will overlap. This leads to a weird edge path. To avoid this we add a gapOffset to the source/target\n            if (diff <= offset) {\n                const gapOffset = Math.min(offset - 1, offset - diff);\n                if (sourceDir[dirAccessor] === currDir) {\n                    sourceGapOffset[dirAccessor] = (sourceGapped[dirAccessor] > source[dirAccessor] ? -1 : 1) * gapOffset;\n                }\n                else {\n                    targetGapOffset[dirAccessor] = (targetGapped[dirAccessor] > target[dirAccessor] ? -1 : 1) * gapOffset;\n                }\n            }\n        }\n        // these are conditions for handling mixed handle positions like Right -> Bottom for example\n        if (sourcePosition !== targetPosition) {\n            const dirAccessorOpposite = dirAccessor === 'x' ? 'y' : 'x';\n            const isSameDir = sourceDir[dirAccessor] === targetDir[dirAccessorOpposite];\n            const sourceGtTargetOppo = sourceGapped[dirAccessorOpposite] > targetGapped[dirAccessorOpposite];\n            const sourceLtTargetOppo = sourceGapped[dirAccessorOpposite] < targetGapped[dirAccessorOpposite];\n            const flipSourceTarget = (sourceDir[dirAccessor] === 1 && ((!isSameDir && sourceGtTargetOppo) || (isSameDir && sourceLtTargetOppo))) ||\n                (sourceDir[dirAccessor] !== 1 && ((!isSameDir && sourceLtTargetOppo) || (isSameDir && sourceGtTargetOppo)));\n            if (flipSourceTarget) {\n                points = dirAccessor === 'x' ? sourceTarget : targetSource;\n            }\n        }\n        const sourceGapPoint = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };\n        const targetGapPoint = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };\n        const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x));\n        const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y));\n        // we want to place the label on the longest segment of the edge\n        if (maxXDistance >= maxYDistance) {\n            centerX = (sourceGapPoint.x + targetGapPoint.x) / 2;\n            centerY = points[0].y;\n        }\n        else {\n            centerX = points[0].x;\n            centerY = (sourceGapPoint.y + targetGapPoint.y) / 2;\n        }\n    }\n    const gappedSource = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };\n    const gappedTarget = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };\n    const pathPoints = [\n        source,\n        // we only want to add the gapped source/target if they are different from the first/last point to avoid duplicates which can cause issues with the bends\n        ...(gappedSource.x !== points[0].x || gappedSource.y !== points[0].y ? [gappedSource] : []),\n        ...points,\n        ...(gappedTarget.x !== points[points.length - 1].x || gappedTarget.y !== points[points.length - 1].y\n            ? [gappedTarget]\n            : []),\n        target,\n    ];\n    return [pathPoints, centerX, centerY, defaultOffsetX, defaultOffsetY];\n}\nfunction getBend(a, b, c, size) {\n    const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size);\n    const { x, y } = b;\n    // no bend\n    if ((a.x === x && x === c.x) || (a.y === y && y === c.y)) {\n        return `L${x} ${y}`;\n    }\n    // first segment is horizontal\n    if (a.y === y) {\n        const xDir = a.x < c.x ? -1 : 1;\n        const yDir = a.y < c.y ? 1 : -1;\n        return `L ${x + bendSize * xDir},${y}Q ${x},${y} ${x},${y + bendSize * yDir}`;\n    }\n    const xDir = a.x < c.x ? 1 : -1;\n    const yDir = a.y < c.y ? -1 : 1;\n    return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`;\n}\n/**\n * The `getSmoothStepPath` util returns everything you need to render a stepped path\n * between two nodes. The `borderRadius` property can be used to choose how rounded\n * the corners of those steps are.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n *\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n *  const source = { x: 0, y: 20 };\n *  const target = { x: 150, y: 100 };\n *\n *  const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({\n *    sourceX: source.x,\n *    sourceY: source.y,\n *    sourcePosition: Position.Right,\n *    targetX: target.x,\n *    targetY: target.y,\n *    targetPosition: Position.Left,\n *  });\n * ```\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.\n */\nfunction getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius = 5, centerX, centerY, offset = 20, stepPosition = 0.5, }) {\n    const [points, labelX, labelY, offsetX, offsetY] = getPoints({\n        source: { x: sourceX, y: sourceY },\n        sourcePosition,\n        target: { x: targetX, y: targetY },\n        targetPosition,\n        center: { x: centerX, y: centerY },\n        offset,\n        stepPosition,\n    });\n    let path = `M${points[0].x} ${points[0].y}`;\n    for (let i = 1; i < points.length - 1; i++) {\n        path += getBend(points[i - 1], points[i], points[i + 1], borderRadius);\n    }\n    path += `L${points[points.length - 1].x} ${points[points.length - 1].y}`;\n    return [path, labelX, labelY, offsetX, offsetY];\n}\n\nfunction isNodeInitialized(node) {\n    return (node &&\n        !!(node.internals.handleBounds || node.handles?.length) &&\n        !!(node.measured.width || node.width || node.initialWidth));\n}\nfunction getEdgePosition(params) {\n    const { sourceNode, targetNode } = params;\n    if (!isNodeInitialized(sourceNode) || !isNodeInitialized(targetNode)) {\n        return null;\n    }\n    const sourceHandleBounds = sourceNode.internals.handleBounds || toHandleBounds(sourceNode.handles);\n    const targetHandleBounds = targetNode.internals.handleBounds || toHandleBounds(targetNode.handles);\n    const sourceHandle = getHandle$1(sourceHandleBounds?.source ?? [], params.sourceHandle);\n    const targetHandle = getHandle$1(\n    // when connection type is loose we can define all handles as sources and connect source -> source\n    params.connectionMode === ConnectionMode.Strict\n        ? targetHandleBounds?.target ?? []\n        : (targetHandleBounds?.target ?? []).concat(targetHandleBounds?.source ?? []), params.targetHandle);\n    if (!sourceHandle || !targetHandle) {\n        params.onError?.('008', errorMessages['error008'](!sourceHandle ? 'source' : 'target', {\n            id: params.id,\n            sourceHandle: params.sourceHandle,\n            targetHandle: params.targetHandle,\n        }));\n        return null;\n    }\n    const sourcePosition = sourceHandle?.position || Position.Bottom;\n    const targetPosition = targetHandle?.position || Position.Top;\n    const source = getHandlePosition(sourceNode, sourceHandle, sourcePosition);\n    const target = getHandlePosition(targetNode, targetHandle, targetPosition);\n    return {\n        sourceX: source.x,\n        sourceY: source.y,\n        targetX: target.x,\n        targetY: target.y,\n        sourcePosition,\n        targetPosition,\n    };\n}\nfunction toHandleBounds(handles) {\n    if (!handles) {\n        return null;\n    }\n    const source = [];\n    const target = [];\n    for (const handle of handles) {\n        handle.width = handle.width ?? 1;\n        handle.height = handle.height ?? 1;\n        if (handle.type === 'source') {\n            source.push(handle);\n        }\n        else if (handle.type === 'target') {\n            target.push(handle);\n        }\n    }\n    return {\n        source,\n        target,\n    };\n}\nfunction getHandlePosition(node, handle, fallbackPosition = Position.Left, center = false) {\n    const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x;\n    const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y;\n    const { width, height } = handle ?? getNodeDimensions(node);\n    if (center) {\n        return { x: x + width / 2, y: y + height / 2 };\n    }\n    const position = handle?.position ?? fallbackPosition;\n    switch (position) {\n        case Position.Top:\n            return { x: x + width / 2, y };\n        case Position.Right:\n            return { x: x + width, y: y + height / 2 };\n        case Position.Bottom:\n            return { x: x + width / 2, y: y + height };\n        case Position.Left:\n            return { x, y: y + height / 2 };\n    }\n}\nfunction getHandle$1(bounds, handleId) {\n    if (!bounds) {\n        return null;\n    }\n    // if no handleId is given, we use the first handle, otherwise we check for the id\n    return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null;\n}\n\nfunction getMarkerId(marker, id) {\n    if (!marker) {\n        return '';\n    }\n    if (typeof marker === 'string') {\n        return marker;\n    }\n    const idPrefix = id ? `${id}__` : '';\n    return `${idPrefix}${Object.keys(marker)\n        .sort()\n        .map((key) => `${key}=${marker[key]}`)\n        .join('&')}`;\n}\nfunction createMarkerIds(edges, { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }) {\n    const ids = new Set();\n    return edges\n        .reduce((markers, edge) => {\n        [edge.markerStart || defaultMarkerStart, edge.markerEnd || defaultMarkerEnd].forEach((marker) => {\n            if (marker && typeof marker === 'object') {\n                const markerId = getMarkerId(marker, id);\n                if (!ids.has(markerId)) {\n                    markers.push({ id: markerId, color: marker.color || defaultColor, ...marker });\n                    ids.add(markerId);\n                }\n            }\n        });\n        return markers;\n    }, [])\n        .sort((a, b) => a.id.localeCompare(b.id));\n}\n\nfunction getNodeToolbarTransform(nodeRect, viewport, position, offset, align) {\n    let alignmentOffset = 0.5;\n    if (align === 'start') {\n        alignmentOffset = 0;\n    }\n    else if (align === 'end') {\n        alignmentOffset = 1;\n    }\n    /*\n     * position === Position.Top\n     * we set the x any y position of the toolbar based on the nodes position\n     */\n    let pos = [\n        (nodeRect.x + nodeRect.width * alignmentOffset) * viewport.zoom + viewport.x,\n        nodeRect.y * viewport.zoom + viewport.y - offset,\n    ];\n    // and than shift it based on the alignment. The shift values are in %.\n    let shift = [-100 * alignmentOffset, -100];\n    switch (position) {\n        case Position.Right:\n            pos = [\n                (nodeRect.x + nodeRect.width) * viewport.zoom + viewport.x + offset,\n                (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,\n            ];\n            shift = [0, -100 * alignmentOffset];\n            break;\n        case Position.Bottom:\n            pos[1] = (nodeRect.y + nodeRect.height) * viewport.zoom + viewport.y + offset;\n            shift[1] = 0;\n            break;\n        case Position.Left:\n            pos = [\n                nodeRect.x * viewport.zoom + viewport.x - offset,\n                (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,\n            ];\n            shift = [-100, -100 * alignmentOffset];\n            break;\n    }\n    return `translate(${pos[0]}px, ${pos[1]}px) translate(${shift[0]}%, ${shift[1]}%)`;\n}\n\nconst alignXToPercent = {\n    left: 0,\n    center: 50,\n    right: 100,\n};\nconst alignYToPercent = {\n    top: 0,\n    center: 50,\n    bottom: 100,\n};\nfunction getEdgeToolbarTransform(x, y, zoom, alignX = 'center', alignY = 'center') {\n    return `translate(${x}px, ${y}px) scale(${1 / zoom}) translate(${-(alignXToPercent[alignX] ?? 50)}%, ${-(alignYToPercent[alignY] ?? 50)}%)`;\n}\n\nconst SELECTED_NODE_Z = 1000;\nconst ROOT_PARENT_Z_INCREMENT = 10;\nconst defaultOptions = {\n    nodeOrigin: [0, 0],\n    nodeExtent: infiniteExtent,\n    elevateNodesOnSelect: true,\n    zIndexMode: 'basic',\n    defaults: {},\n};\nconst adoptUserNodesDefaultOptions = {\n    ...defaultOptions,\n    checkEquality: true,\n};\nfunction mergeObjects(base, incoming) {\n    const result = { ...base };\n    for (const key in incoming) {\n        if (incoming[key] !== undefined) {\n            // typecast is safe here, because we check for undefined\n            result[key] = incoming[key];\n        }\n    }\n    return result;\n}\nfunction updateAbsolutePositions(nodeLookup, parentLookup, options) {\n    const _options = mergeObjects(defaultOptions, options);\n    for (const node of nodeLookup.values()) {\n        if (node.parentId) {\n            updateChildNode(node, nodeLookup, parentLookup, _options);\n        }\n        else {\n            const positionWithOrigin = getNodePositionWithOrigin(node, _options.nodeOrigin);\n            const extent = isCoordinateExtent(node.extent) ? node.extent : _options.nodeExtent;\n            const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(node));\n            node.internals.positionAbsolute = clampedPosition;\n        }\n    }\n}\nfunction parseHandles(userNode, internalNode) {\n    if (!userNode.handles) {\n        return !userNode.measured ? undefined : internalNode?.internals.handleBounds;\n    }\n    const source = [];\n    const target = [];\n    for (const handle of userNode.handles) {\n        const handleBounds = {\n            id: handle.id,\n            width: handle.width ?? 1,\n            height: handle.height ?? 1,\n            nodeId: userNode.id,\n            x: handle.x,\n            y: handle.y,\n            position: handle.position,\n            type: handle.type,\n        };\n        if (handle.type === 'source') {\n            source.push(handleBounds);\n        }\n        else if (handle.type === 'target') {\n            target.push(handleBounds);\n        }\n    }\n    return {\n        source,\n        target,\n    };\n}\nfunction isManualZIndexMode(zIndexMode) {\n    return zIndexMode === 'manual';\n}\nfunction adoptUserNodes(nodes, nodeLookup, parentLookup, options = {}) {\n    const _options = mergeObjects(adoptUserNodesDefaultOptions, options);\n    const rootParentIndex = { i: 0 };\n    const tmpLookup = new Map(nodeLookup);\n    const selectedNodeZ = _options?.elevateNodesOnSelect && !isManualZIndexMode(_options.zIndexMode) ? SELECTED_NODE_Z : 0;\n    let nodesInitialized = nodes.length > 0;\n    let hasSelectedNodes = false;\n    nodeLookup.clear();\n    parentLookup.clear();\n    for (const userNode of nodes) {\n        let internalNode = tmpLookup.get(userNode.id);\n        if (_options.checkEquality && userNode === internalNode?.internals.userNode) {\n            nodeLookup.set(userNode.id, internalNode);\n        }\n        else {\n            const positionWithOrigin = getNodePositionWithOrigin(userNode, _options.nodeOrigin);\n            const extent = isCoordinateExtent(userNode.extent) ? userNode.extent : _options.nodeExtent;\n            const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(userNode));\n            internalNode = {\n                ..._options.defaults,\n                ...userNode,\n                measured: {\n                    width: userNode.measured?.width,\n                    height: userNode.measured?.height,\n                },\n                internals: {\n                    positionAbsolute: clampedPosition,\n                    // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured\n                    handleBounds: parseHandles(userNode, internalNode),\n                    z: calculateZ(userNode, selectedNodeZ, _options.zIndexMode),\n                    userNode,\n                },\n            };\n            nodeLookup.set(userNode.id, internalNode);\n        }\n        if ((internalNode.measured === undefined ||\n            internalNode.measured.width === undefined ||\n            internalNode.measured.height === undefined) &&\n            !internalNode.hidden) {\n            nodesInitialized = false;\n        }\n        if (userNode.parentId) {\n            updateChildNode(internalNode, nodeLookup, parentLookup, options, rootParentIndex);\n        }\n        hasSelectedNodes ||= userNode.selected ?? false;\n    }\n    return { nodesInitialized, hasSelectedNodes };\n}\nfunction updateParentLookup(node, parentLookup) {\n    if (!node.parentId) {\n        return;\n    }\n    const childNodes = parentLookup.get(node.parentId);\n    if (childNodes) {\n        childNodes.set(node.id, node);\n    }\n    else {\n        parentLookup.set(node.parentId, new Map([[node.id, node]]));\n    }\n}\n/**\n * Updates positionAbsolute and zIndex of a child node and the parentLookup.\n */\nfunction updateChildNode(node, nodeLookup, parentLookup, options, rootParentIndex) {\n    const { elevateNodesOnSelect, nodeOrigin, nodeExtent, zIndexMode } = mergeObjects(defaultOptions, options);\n    const parentId = node.parentId;\n    const parentNode = nodeLookup.get(parentId);\n    if (!parentNode) {\n        console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);\n        return;\n    }\n    updateParentLookup(node, parentLookup);\n    // We just want to set the rootParentIndex for the first child\n    if (rootParentIndex &&\n        !parentNode.parentId &&\n        parentNode.internals.rootParentIndex === undefined &&\n        zIndexMode === 'auto') {\n        parentNode.internals.rootParentIndex = ++rootParentIndex.i;\n        parentNode.internals.z = parentNode.internals.z + rootParentIndex.i * ROOT_PARENT_Z_INCREMENT;\n    }\n    // But we need to update rootParentIndex.i also when parent has not been updated\n    if (rootParentIndex && parentNode.internals.rootParentIndex !== undefined) {\n        rootParentIndex.i = parentNode.internals.rootParentIndex;\n    }\n    const selectedNodeZ = elevateNodesOnSelect && !isManualZIndexMode(zIndexMode) ? SELECTED_NODE_Z : 0;\n    const { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ, zIndexMode);\n    const { positionAbsolute } = node.internals;\n    const positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y;\n    if (positionChanged || z !== node.internals.z) {\n        // we create a new object to mark the node as updated\n        nodeLookup.set(node.id, {\n            ...node,\n            internals: {\n                ...node.internals,\n                positionAbsolute: positionChanged ? { x, y } : positionAbsolute,\n                z,\n            },\n        });\n    }\n}\nfunction calculateZ(node, selectedNodeZ, zIndexMode) {\n    const zIndex = isNumeric(node.zIndex) ? node.zIndex : 0;\n    if (isManualZIndexMode(zIndexMode)) {\n        return zIndex;\n    }\n    return zIndex + (node.selected ? selectedNodeZ : 0);\n}\nfunction calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, selectedNodeZ, zIndexMode) {\n    const { x: parentX, y: parentY } = parentNode.internals.positionAbsolute;\n    const childDimensions = getNodeDimensions(childNode);\n    const positionWithOrigin = getNodePositionWithOrigin(childNode, nodeOrigin);\n    const clampedPosition = isCoordinateExtent(childNode.extent)\n        ? clampPosition(positionWithOrigin, childNode.extent, childDimensions)\n        : positionWithOrigin;\n    let absolutePosition = clampPosition({ x: parentX + clampedPosition.x, y: parentY + clampedPosition.y }, nodeExtent, childDimensions);\n    if (childNode.extent === 'parent') {\n        absolutePosition = clampPositionToParent(absolutePosition, childDimensions, parentNode);\n    }\n    const childZ = calculateZ(childNode, selectedNodeZ, zIndexMode);\n    const parentZ = parentNode.internals.z ?? 0;\n    return {\n        x: absolutePosition.x,\n        y: absolutePosition.y,\n        z: parentZ >= childZ ? parentZ + 1 : childZ,\n    };\n}\nfunction handleExpandParent(children, nodeLookup, parentLookup, nodeOrigin = [0, 0]) {\n    const changes = [];\n    const parentExpansions = new Map();\n    // determine the expanded rectangle the child nodes would take for each parent\n    for (const child of children) {\n        const parent = nodeLookup.get(child.parentId);\n        if (!parent) {\n            continue;\n        }\n        const parentRect = parentExpansions.get(child.parentId)?.expandedRect ?? nodeToRect(parent);\n        const expandedRect = getBoundsOfRects(parentRect, child.rect);\n        parentExpansions.set(child.parentId, { expandedRect, parent });\n    }\n    if (parentExpansions.size > 0) {\n        parentExpansions.forEach(({ expandedRect, parent }, parentId) => {\n            // determine the position & dimensions of the parent\n            const positionAbsolute = parent.internals.positionAbsolute;\n            const dimensions = getNodeDimensions(parent);\n            const origin = parent.origin ?? nodeOrigin;\n            // determine how much the parent expands in width and position\n            const xChange = expandedRect.x < positionAbsolute.x ? Math.round(Math.abs(positionAbsolute.x - expandedRect.x)) : 0;\n            const yChange = expandedRect.y < positionAbsolute.y ? Math.round(Math.abs(positionAbsolute.y - expandedRect.y)) : 0;\n            const newWidth = Math.max(dimensions.width, Math.round(expandedRect.width));\n            const newHeight = Math.max(dimensions.height, Math.round(expandedRect.height));\n            const widthChange = (newWidth - dimensions.width) * origin[0];\n            const heightChange = (newHeight - dimensions.height) * origin[1];\n            // We need to correct the position of the parent node if the origin is not [0,0]\n            if (xChange > 0 || yChange > 0 || widthChange || heightChange) {\n                changes.push({\n                    id: parentId,\n                    type: 'position',\n                    position: {\n                        x: parent.position.x - xChange + widthChange,\n                        y: parent.position.y - yChange + heightChange,\n                    },\n                });\n                /*\n                 * We move all child nodes in the oppsite direction\n                 * so the x,y changes of the parent do not move the children\n                 */\n                parentLookup.get(parentId)?.forEach((childNode) => {\n                    if (!children.some((child) => child.id === childNode.id)) {\n                        changes.push({\n                            id: childNode.id,\n                            type: 'position',\n                            position: {\n                                x: childNode.position.x + xChange,\n                                y: childNode.position.y + yChange,\n                            },\n                        });\n                    }\n                });\n            }\n            // We need to correct the dimensions of the parent node if the origin is not [0,0]\n            if (dimensions.width < expandedRect.width || dimensions.height < expandedRect.height || xChange || yChange) {\n                changes.push({\n                    id: parentId,\n                    type: 'dimensions',\n                    setAttributes: true,\n                    dimensions: {\n                        width: newWidth + (xChange ? origin[0] * xChange - widthChange : 0),\n                        height: newHeight + (yChange ? origin[1] * yChange - heightChange : 0),\n                    },\n                });\n            }\n        });\n    }\n    return changes;\n}\nfunction updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, zIndexMode) {\n    const viewportNode = domNode?.querySelector('.xyflow__viewport');\n    let updatedInternals = false;\n    if (!viewportNode) {\n        return { changes: [], updatedInternals };\n    }\n    const changes = [];\n    const style = window.getComputedStyle(viewportNode);\n    const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);\n    // in this array we collect nodes, that might trigger changes (like expanding parent)\n    const parentExpandChildren = [];\n    for (const update of updates.values()) {\n        const node = nodeLookup.get(update.id);\n        if (!node) {\n            continue;\n        }\n        if (node.hidden) {\n            nodeLookup.set(node.id, {\n                ...node,\n                internals: {\n                    ...node.internals,\n                    handleBounds: undefined,\n                },\n            });\n            updatedInternals = true;\n            continue;\n        }\n        const dimensions = getDimensions(update.nodeElement);\n        const dimensionChanged = node.measured.width !== dimensions.width || node.measured.height !== dimensions.height;\n        const doUpdate = !!(dimensions.width &&\n            dimensions.height &&\n            (dimensionChanged || !node.internals.handleBounds || update.force));\n        if (doUpdate) {\n            const nodeBounds = update.nodeElement.getBoundingClientRect();\n            const extent = isCoordinateExtent(node.extent) ? node.extent : nodeExtent;\n            let { positionAbsolute } = node.internals;\n            if (node.parentId && node.extent === 'parent') {\n                positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, nodeLookup.get(node.parentId));\n            }\n            else if (extent) {\n                positionAbsolute = clampPosition(positionAbsolute, extent, dimensions);\n            }\n            const newNode = {\n                ...node,\n                measured: dimensions,\n                internals: {\n                    ...node.internals,\n                    positionAbsolute,\n                    handleBounds: {\n                        source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id),\n                        target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id),\n                    },\n                },\n            };\n            nodeLookup.set(node.id, newNode);\n            if (node.parentId) {\n                updateChildNode(newNode, nodeLookup, parentLookup, { nodeOrigin, zIndexMode });\n            }\n            updatedInternals = true;\n            if (dimensionChanged) {\n                changes.push({\n                    id: node.id,\n                    type: 'dimensions',\n                    dimensions,\n                });\n                if (node.expandParent && node.parentId) {\n                    parentExpandChildren.push({\n                        id: node.id,\n                        parentId: node.parentId,\n                        rect: nodeToRect(newNode, nodeOrigin),\n                    });\n                }\n            }\n        }\n    }\n    if (parentExpandChildren.length > 0) {\n        const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);\n        changes.push(...parentExpandChanges);\n    }\n    return { changes, updatedInternals };\n}\nasync function panBy({ delta, panZoom, transform, translateExtent, width, height, }) {\n    if (!panZoom || (!delta.x && !delta.y)) {\n        return Promise.resolve(false);\n    }\n    const nextViewport = await panZoom.setViewportConstrained({\n        x: transform[0] + delta.x,\n        y: transform[1] + delta.y,\n        zoom: transform[2],\n    }, [\n        [0, 0],\n        [width, height],\n    ], translateExtent);\n    const transformChanged = !!nextViewport &&\n        (nextViewport.x !== transform[0] || nextViewport.y !== transform[1] || nextViewport.k !== transform[2]);\n    return Promise.resolve(transformChanged);\n}\n/**\n * this function adds the connection to the connectionLookup\n * at the following keys: nodeId-type-handleId, nodeId-type and nodeId\n * @param type type of the connection\n * @param connection connection that should be added to the lookup\n * @param connectionKey at which key the connection should be added\n * @param connectionLookup reference to the connection lookup\n * @param nodeId nodeId of the connection\n * @param handleId handleId of the connection\n */\nfunction addConnectionToLookup(type, connection, connectionKey, connectionLookup, nodeId, handleId) {\n    /*\n     * We add the connection to the connectionLookup at the following keys\n     * 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId\n     * If the key already exists, we add the connection to the existing map\n     */\n    let key = nodeId;\n    const nodeMap = connectionLookup.get(key) || new Map();\n    connectionLookup.set(key, nodeMap.set(connectionKey, connection));\n    key = `${nodeId}-${type}`;\n    const typeMap = connectionLookup.get(key) || new Map();\n    connectionLookup.set(key, typeMap.set(connectionKey, connection));\n    if (handleId) {\n        key = `${nodeId}-${type}-${handleId}`;\n        const handleMap = connectionLookup.get(key) || new Map();\n        connectionLookup.set(key, handleMap.set(connectionKey, connection));\n    }\n}\nfunction updateConnectionLookup(connectionLookup, edgeLookup, edges) {\n    connectionLookup.clear();\n    edgeLookup.clear();\n    for (const edge of edges) {\n        const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge;\n        const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle };\n        const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`;\n        const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`;\n        addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle);\n        addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle);\n        edgeLookup.set(edge.id, edge);\n    }\n}\n\nfunction shallowNodeData(a, b) {\n    if (a === null || b === null) {\n        return false;\n    }\n    const _a = Array.isArray(a) ? a : [a];\n    const _b = Array.isArray(b) ? b : [b];\n    if (_a.length !== _b.length) {\n        return false;\n    }\n    for (let i = 0; i < _a.length; i++) {\n        if (_a[i].id !== _b[i].id || _a[i].type !== _b[i].type || !Object.is(_a[i].data, _b[i].data)) {\n            return false;\n        }\n    }\n    return true;\n}\n\nfunction isParentSelected(node, nodeLookup) {\n    if (!node.parentId) {\n        return false;\n    }\n    const parentNode = nodeLookup.get(node.parentId);\n    if (!parentNode) {\n        return false;\n    }\n    if (parentNode.selected) {\n        return true;\n    }\n    return isParentSelected(parentNode, nodeLookup);\n}\nfunction hasSelector(target, selector, domNode) {\n    let current = target;\n    do {\n        if (current?.matches?.(selector))\n            return true;\n        if (current === domNode)\n            return false;\n        current = current?.parentElement;\n    } while (current);\n    return false;\n}\n// looks for all selected nodes and created a NodeDragItem for each of them\nfunction getDragItems(nodeLookup, nodesDraggable, mousePos, nodeId) {\n    const dragItems = new Map();\n    for (const [id, node] of nodeLookup) {\n        if ((node.selected || node.id === nodeId) &&\n            (!node.parentId || !isParentSelected(node, nodeLookup)) &&\n            (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'))) {\n            const internalNode = nodeLookup.get(id);\n            if (internalNode) {\n                dragItems.set(id, {\n                    id,\n                    position: internalNode.position || { x: 0, y: 0 },\n                    distance: {\n                        x: mousePos.x - internalNode.internals.positionAbsolute.x,\n                        y: mousePos.y - internalNode.internals.positionAbsolute.y,\n                    },\n                    extent: internalNode.extent,\n                    parentId: internalNode.parentId,\n                    origin: internalNode.origin,\n                    expandParent: internalNode.expandParent,\n                    internals: {\n                        positionAbsolute: internalNode.internals.positionAbsolute || { x: 0, y: 0 },\n                    },\n                    measured: {\n                        width: internalNode.measured.width ?? 0,\n                        height: internalNode.measured.height ?? 0,\n                    },\n                });\n            }\n        }\n    }\n    return dragItems;\n}\n/*\n * returns two params:\n * 1. the dragged node (or the first of the list, if we are dragging a node selection)\n * 2. array of selected nodes (for multi selections)\n */\nfunction getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true, }) {\n    const nodesFromDragItems = [];\n    for (const [id, dragItem] of dragItems) {\n        const node = nodeLookup.get(id)?.internals.userNode;\n        if (node) {\n            nodesFromDragItems.push({\n                ...node,\n                position: dragItem.position,\n                dragging,\n            });\n        }\n    }\n    if (!nodeId) {\n        return [nodesFromDragItems[0], nodesFromDragItems];\n    }\n    const node = nodeLookup.get(nodeId)?.internals.userNode;\n    return [\n        !node\n            ? nodesFromDragItems[0]\n            : {\n                ...node,\n                position: dragItems.get(nodeId)?.position || node.position,\n                dragging,\n            },\n        nodesFromDragItems,\n    ];\n}\n/**\n * If a selection is being dragged we want to apply the same snap offset to all nodes in the selection.\n * This function calculates the snap offset based on the first node in the selection.\n */\nfunction calculateSnapOffset({ dragItems, snapGrid, x, y, }) {\n    const refDragItem = dragItems.values().next().value;\n    if (!refDragItem) {\n        return null;\n    }\n    const refPos = {\n        x: x - refDragItem.distance.x,\n        y: y - refDragItem.distance.y,\n    };\n    const refPosSnapped = snapPosition(refPos, snapGrid);\n    return {\n        x: refPosSnapped.x - refPos.x,\n        y: refPosSnapped.y - refPos.y,\n    };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) {\n    let lastPos = { x: null, y: null };\n    let autoPanId = 0;\n    let dragItems = new Map();\n    let autoPanStarted = false;\n    let mousePosition = { x: 0, y: 0 };\n    let containerBounds = null;\n    let dragStarted = false;\n    let d3Selection = null;\n    let abortDrag = false; // prevents unintentional dragging on multitouch\n    let nodePositionsChanged = false;\n    // we store the last drag event to be able to use it in the update function\n    let dragEvent = null;\n    // public functions\n    function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {\n        d3Selection = select(domNode);\n        function updateNodes({ x, y }) {\n            const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();\n            lastPos = { x, y };\n            let hasChange = false;\n            const isMultiDrag = dragItems.size > 1;\n            const nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null;\n            const multiDragSnapOffset = isMultiDrag && snapToGrid\n                ? calculateSnapOffset({\n                    dragItems,\n                    snapGrid,\n                    x,\n                    y,\n                })\n                : null;\n            for (const [id, dragItem] of dragItems) {\n                /*\n                 * if the node is not in the nodeLookup anymore, it was probably deleted while dragging\n                 */\n                if (!nodeLookup.has(id)) {\n                    continue;\n                }\n                let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };\n                if (snapToGrid) {\n                    nextPosition = multiDragSnapOffset\n                        ? {\n                            x: Math.round(nextPosition.x + multiDragSnapOffset.x),\n                            y: Math.round(nextPosition.y + multiDragSnapOffset.y),\n                        }\n                        : snapPosition(nextPosition, snapGrid);\n                }\n                let adjustedNodeExtent = null;\n                if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {\n                    const { positionAbsolute } = dragItem.internals;\n                    const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0];\n                    const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0];\n                    const y1 = positionAbsolute.y - nodesBox.y + nodeExtent[0][1];\n                    const y2 = positionAbsolute.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1];\n                    adjustedNodeExtent = [\n                        [x1, y1],\n                        [x2, y2],\n                    ];\n                }\n                const { position, positionAbsolute } = calculateNodePosition({\n                    nodeId: id,\n                    nextPosition,\n                    nodeLookup,\n                    nodeExtent: adjustedNodeExtent ? adjustedNodeExtent : nodeExtent,\n                    nodeOrigin,\n                    onError,\n                });\n                // we want to make sure that we only fire a change event when there is a change\n                hasChange = hasChange || dragItem.position.x !== position.x || dragItem.position.y !== position.y;\n                dragItem.position = position;\n                dragItem.internals.positionAbsolute = positionAbsolute;\n            }\n            nodePositionsChanged = nodePositionsChanged || hasChange;\n            if (!hasChange) {\n                return;\n            }\n            updateNodePositions(dragItems, true);\n            if (dragEvent && (onDrag || onNodeDrag || (!nodeId && onSelectionDrag))) {\n                const [currentNode, currentNodes] = getEventHandlerParams({\n                    nodeId,\n                    dragItems,\n                    nodeLookup,\n                });\n                onDrag?.(dragEvent, dragItems, currentNode, currentNodes);\n                onNodeDrag?.(dragEvent, currentNode, currentNodes);\n                if (!nodeId) {\n                    onSelectionDrag?.(dragEvent, currentNodes);\n                }\n            }\n        }\n        async function autoPan() {\n            if (!containerBounds) {\n                return;\n            }\n            const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems();\n            if (!autoPanOnNodeDrag) {\n                autoPanStarted = false;\n                cancelAnimationFrame(autoPanId);\n                return;\n            }\n            const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);\n            if (xMovement !== 0 || yMovement !== 0) {\n                lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2];\n                lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2];\n                if (await panBy({ x: xMovement, y: yMovement })) {\n                    updateNodes(lastPos);\n                }\n            }\n            autoPanId = requestAnimationFrame(autoPan);\n        }\n        function startDrag(event) {\n            const { nodeLookup, multiSelectionActive, nodesDraggable, transform, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges, } = getStoreItems();\n            dragStarted = true;\n            if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) {\n                if (!nodeLookup.get(nodeId)?.selected) {\n                    // we need to reset selected nodes when selectNodesOnDrag=false\n                    unselectNodesAndEdges();\n                }\n            }\n            if (isSelectable && selectNodesOnDrag && nodeId) {\n                onNodeMouseDown?.(nodeId);\n            }\n            const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n            lastPos = pointerPos;\n            dragItems = getDragItems(nodeLookup, nodesDraggable, pointerPos, nodeId);\n            if (dragItems.size > 0 && (onDragStart || onNodeDragStart || (!nodeId && onSelectionDragStart))) {\n                const [currentNode, currentNodes] = getEventHandlerParams({\n                    nodeId,\n                    dragItems,\n                    nodeLookup,\n                });\n                onDragStart?.(event.sourceEvent, dragItems, currentNode, currentNodes);\n                onNodeDragStart?.(event.sourceEvent, currentNode, currentNodes);\n                if (!nodeId) {\n                    onSelectionDragStart?.(event.sourceEvent, currentNodes);\n                }\n            }\n        }\n        const d3DragInstance = drag()\n            .clickDistance(nodeClickDistance)\n            .on('start', (event) => {\n            const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems();\n            containerBounds = domNode?.getBoundingClientRect() || null;\n            abortDrag = false;\n            nodePositionsChanged = false;\n            dragEvent = event.sourceEvent;\n            if (nodeDragThreshold === 0) {\n                startDrag(event);\n            }\n            const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n            lastPos = pointerPos;\n            mousePosition = getEventPosition(event.sourceEvent, containerBounds);\n        })\n            .on('drag', (event) => {\n            const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems();\n            const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n            dragEvent = event.sourceEvent;\n            if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) ||\n                // if user deletes a node while dragging, we need to abort the drag to prevent errors\n                (nodeId && !nodeLookup.has(nodeId))) {\n                abortDrag = true;\n            }\n            if (abortDrag) {\n                return;\n            }\n            if (!autoPanStarted && autoPanOnNodeDrag && dragStarted) {\n                autoPanStarted = true;\n                autoPan();\n            }\n            if (!dragStarted) {\n                // Calculate distance in client coordinates for consistent drag threshold behavior across zoom levels\n                const currentMousePosition = getEventPosition(event.sourceEvent, containerBounds);\n                const x = currentMousePosition.x - mousePosition.x;\n                const y = currentMousePosition.y - mousePosition.y;\n                const distance = Math.sqrt(x * x + y * y);\n                if (distance > nodeDragThreshold) {\n                    startDrag(event);\n                }\n            }\n            // skip events without movement\n            if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) {\n                mousePosition = getEventPosition(event.sourceEvent, containerBounds);\n                updateNodes(pointerPos);\n            }\n        })\n            .on('end', (event) => {\n            if (!dragStarted || abortDrag) {\n                return;\n            }\n            autoPanStarted = false;\n            dragStarted = false;\n            cancelAnimationFrame(autoPanId);\n            if (dragItems.size > 0) {\n                const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems();\n                if (nodePositionsChanged) {\n                    updateNodePositions(dragItems, false);\n                    nodePositionsChanged = false;\n                }\n                if (onDragStop || onNodeDragStop || (!nodeId && onSelectionDragStop)) {\n                    const [currentNode, currentNodes] = getEventHandlerParams({\n                        nodeId,\n                        dragItems,\n                        nodeLookup,\n                        dragging: false,\n                    });\n                    onDragStop?.(event.sourceEvent, dragItems, currentNode, currentNodes);\n                    onNodeDragStop?.(event.sourceEvent, currentNode, currentNodes);\n                    if (!nodeId) {\n                        onSelectionDragStop?.(event.sourceEvent, currentNodes);\n                    }\n                }\n            }\n        })\n            .filter((event) => {\n            const target = event.target;\n            const isDraggable = !event.button &&\n                (!noDragClassName || !hasSelector(target, `.${noDragClassName}`, domNode)) &&\n                (!handleSelector || hasSelector(target, handleSelector, domNode));\n            return isDraggable;\n        });\n        d3Selection.call(d3DragInstance);\n    }\n    function destroy() {\n        d3Selection?.on('.drag', null);\n    }\n    return {\n        update,\n        destroy,\n    };\n}\n\nfunction getNodesWithinDistance(position, nodeLookup, distance) {\n    const nodes = [];\n    const rect = {\n        x: position.x - distance,\n        y: position.y - distance,\n        width: distance * 2,\n        height: distance * 2,\n    };\n    for (const node of nodeLookup.values()) {\n        if (getOverlappingArea(rect, nodeToRect(node)) > 0) {\n            nodes.push(node);\n        }\n    }\n    return nodes;\n}\n/*\n * this distance is used for the area around the user pointer\n * while doing a connection for finding the closest nodes\n */\nconst ADDITIONAL_DISTANCE = 250;\nfunction getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {\n    let closestHandles = [];\n    let minDistance = Infinity;\n    const closeNodes = getNodesWithinDistance(position, nodeLookup, connectionRadius + ADDITIONAL_DISTANCE);\n    for (const node of closeNodes) {\n        const allHandles = [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n        for (const handle of allHandles) {\n            // if the handle is the same as the fromHandle we skip it\n            if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id) {\n                continue;\n            }\n            // determine absolute position of the handle\n            const { x, y } = getHandlePosition(node, handle, handle.position, true);\n            const distance = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2));\n            if (distance > connectionRadius) {\n                continue;\n            }\n            if (distance < minDistance) {\n                closestHandles = [{ ...handle, x, y }];\n                minDistance = distance;\n            }\n            else if (distance === minDistance) {\n                // when multiple handles are on the same distance we collect all of them\n                closestHandles.push({ ...handle, x, y });\n            }\n        }\n    }\n    if (!closestHandles.length) {\n        return null;\n    }\n    // when multiple handles overlay each other we prefer the opposite handle\n    if (closestHandles.length > 1) {\n        const oppositeHandleType = fromHandle.type === 'source' ? 'target' : 'source';\n        return closestHandles.find((handle) => handle.type === oppositeHandleType) ?? closestHandles[0];\n    }\n    return closestHandles[0];\n}\nfunction getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode, withAbsolutePosition = false) {\n    const node = nodeLookup.get(nodeId);\n    if (!node) {\n        return null;\n    }\n    const handles = connectionMode === 'strict'\n        ? node.internals.handleBounds?.[handleType]\n        : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n    const handle = (handleId ? handles?.find((h) => h.id === handleId) : handles?.[0]) ?? null;\n    return handle && withAbsolutePosition\n        ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) }\n        : handle;\n}\nfunction getHandleType(edgeUpdaterType, handleDomNode) {\n    if (edgeUpdaterType) {\n        return edgeUpdaterType;\n    }\n    else if (handleDomNode?.classList.contains('target')) {\n        return 'target';\n    }\n    else if (handleDomNode?.classList.contains('source')) {\n        return 'source';\n    }\n    return null;\n}\nfunction isConnectionValid(isInsideConnectionRadius, isHandleValid) {\n    let isValid = null;\n    if (isHandleValid) {\n        isValid = true;\n    }\n    else if (isInsideConnectionRadius && !isHandleValid) {\n        isValid = false;\n    }\n    return isValid;\n}\n\nconst alwaysValid = () => true;\nfunction onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode, }) {\n    // when xyflow is used inside a shadow root we can't use document\n    const doc = getHostForElement(event.target);\n    let autoPanId = 0;\n    let closestHandle;\n    const { x, y } = getEventPosition(event);\n    const handleType = getHandleType(edgeUpdaterType, handleDomNode);\n    const containerBounds = domNode?.getBoundingClientRect();\n    let connectionStarted = false;\n    if (!containerBounds || !handleType) {\n        return;\n    }\n    const fromHandleInternal = getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode);\n    if (!fromHandleInternal) {\n        return;\n    }\n    let position = getEventPosition(event, containerBounds);\n    let autoPanStarted = false;\n    let connection = null;\n    let isValid = false;\n    let resultHandleDomNode = null;\n    // when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas\n    function autoPan() {\n        if (!autoPanOnConnect || !containerBounds) {\n            return;\n        }\n        const [x, y] = calcAutoPan(position, containerBounds, autoPanSpeed);\n        panBy({ x, y });\n        autoPanId = requestAnimationFrame(autoPan);\n    }\n    // Stays the same for all consecutive pointermove events\n    const fromHandle = {\n        ...fromHandleInternal,\n        nodeId,\n        type: handleType,\n        position: fromHandleInternal.position,\n    };\n    const fromInternalNode = nodeLookup.get(nodeId);\n    const from = getHandlePosition(fromInternalNode, fromHandle, Position.Left, true);\n    let previousConnection = {\n        inProgress: true,\n        isValid: null,\n        from,\n        fromHandle,\n        fromPosition: fromHandle.position,\n        fromNode: fromInternalNode,\n        to: position,\n        toHandle: null,\n        toPosition: oppositePosition[fromHandle.position],\n        toNode: null,\n        pointer: position,\n    };\n    function startConnection() {\n        connectionStarted = true;\n        updateConnection(previousConnection);\n        onConnectStart?.(event, { nodeId, handleId, handleType });\n    }\n    if (dragThreshold === 0) {\n        startConnection();\n    }\n    function onPointerMove(event) {\n        if (!connectionStarted) {\n            const { x: evtX, y: evtY } = getEventPosition(event);\n            const dx = evtX - x;\n            const dy = evtY - y;\n            const nextConnectionStarted = dx * dx + dy * dy > dragThreshold * dragThreshold;\n            if (!nextConnectionStarted) {\n                return;\n            }\n            startConnection();\n        }\n        if (!getFromHandle() || !fromHandle) {\n            onPointerUp(event);\n            return;\n        }\n        const transform = getTransform();\n        position = getEventPosition(event, containerBounds);\n        closestHandle = getClosestHandle(pointToRendererPoint(position, transform, false, [1, 1]), connectionRadius, nodeLookup, fromHandle);\n        if (!autoPanStarted) {\n            autoPan();\n            autoPanStarted = true;\n        }\n        const result = isValidHandle(event, {\n            handle: closestHandle,\n            connectionMode,\n            fromNodeId: nodeId,\n            fromHandleId: handleId,\n            fromType: isTarget ? 'target' : 'source',\n            isValidConnection,\n            doc,\n            lib,\n            flowId,\n            nodeLookup,\n        });\n        resultHandleDomNode = result.handleDomNode;\n        connection = result.connection;\n        isValid = isConnectionValid(!!closestHandle, result.isValid);\n        const fromInternalNode = nodeLookup.get(nodeId);\n        const from = fromInternalNode\n            ? getHandlePosition(fromInternalNode, fromHandle, Position.Left, true)\n            : previousConnection.from;\n        const newConnection = {\n            ...previousConnection,\n            from,\n            isValid,\n            to: result.toHandle && isValid\n                ? rendererPointToPoint({ x: result.toHandle.x, y: result.toHandle.y }, transform)\n                : position,\n            toHandle: result.toHandle,\n            toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position],\n            toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId) : null,\n            pointer: position,\n        };\n        updateConnection(newConnection);\n        previousConnection = newConnection;\n    }\n    function onPointerUp(event) {\n        // Prevent multi-touch aborting connection\n        if ('touches' in event && event.touches.length > 0) {\n            return;\n        }\n        if (connectionStarted) {\n            if ((closestHandle || resultHandleDomNode) && connection && isValid) {\n                onConnect?.(connection);\n            }\n            /*\n             * it's important to get a fresh reference from the store here\n             * in order to get the latest state of onConnectEnd\n             */\n            // eslint-disable-next-line @typescript-eslint/no-unused-vars\n            const { inProgress, ...connectionState } = previousConnection;\n            const finalConnectionState = {\n                ...connectionState,\n                toPosition: previousConnection.toHandle ? previousConnection.toPosition : null,\n            };\n            onConnectEnd?.(event, finalConnectionState);\n            if (edgeUpdaterType) {\n                onReconnectEnd?.(event, finalConnectionState);\n            }\n        }\n        cancelConnection();\n        cancelAnimationFrame(autoPanId);\n        autoPanStarted = false;\n        isValid = false;\n        connection = null;\n        resultHandleDomNode = null;\n        doc.removeEventListener('mousemove', onPointerMove);\n        doc.removeEventListener('mouseup', onPointerUp);\n        doc.removeEventListener('touchmove', onPointerMove);\n        doc.removeEventListener('touchend', onPointerUp);\n    }\n    doc.addEventListener('mousemove', onPointerMove);\n    doc.addEventListener('mouseup', onPointerUp);\n    doc.addEventListener('touchmove', onPointerMove);\n    doc.addEventListener('touchend', onPointerUp);\n}\n// checks if  and returns connection in form of an object { source: 123, target: 312 }\nfunction isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup, }) {\n    const isTarget = fromType === 'target';\n    const handleDomNode = handle\n        ? doc.querySelector(`.${lib}-flow__handle[data-id=\"${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}\"]`)\n        : null;\n    const { x, y } = getEventPosition(event);\n    const handleBelow = doc.elementFromPoint(x, y);\n    /*\n     * we always want to prioritize the handle below the mouse cursor over the closest distance handle,\n     * because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor\n     */\n    const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode;\n    const result = {\n        handleDomNode: handleToCheck,\n        isValid: false,\n        connection: null,\n        toHandle: null,\n    };\n    if (handleToCheck) {\n        const handleType = getHandleType(undefined, handleToCheck);\n        const handleNodeId = handleToCheck.getAttribute('data-nodeid');\n        const handleId = handleToCheck.getAttribute('data-handleid');\n        const connectable = handleToCheck.classList.contains('connectable');\n        const connectableEnd = handleToCheck.classList.contains('connectableend');\n        if (!handleNodeId || !handleType) {\n            return result;\n        }\n        const connection = {\n            source: isTarget ? handleNodeId : fromNodeId,\n            sourceHandle: isTarget ? handleId : fromHandleId,\n            target: isTarget ? fromNodeId : handleNodeId,\n            targetHandle: isTarget ? fromHandleId : handleId,\n        };\n        result.connection = connection;\n        const isConnectable = connectable && connectableEnd;\n        // in strict mode we don't allow target to target or source to source connections\n        const isValid = isConnectable &&\n            (connectionMode === ConnectionMode.Strict\n                ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')\n                : handleNodeId !== fromNodeId || handleId !== fromHandleId);\n        result.isValid = isValid && isValidConnection(connection);\n        result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, true);\n    }\n    return result;\n}\nconst XYHandle = {\n    onPointerDown,\n    isValid: isValidHandle,\n};\n\nfunction XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {\n    const selection = select(domNode);\n    function update({ translateExtent, width, height, zoomStep = 1, pannable = true, zoomable = true, inversePan = false, }) {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const zoomHandler = (event) => {\n            if (event.sourceEvent.type !== 'wheel' || !panZoom) {\n                return;\n            }\n            const transform = getTransform();\n            const factor = event.sourceEvent.ctrlKey && isMacOs() ? 10 : 1;\n            const pinchDelta = -event.sourceEvent.deltaY *\n                (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) *\n                zoomStep;\n            const nextZoom = transform[2] * Math.pow(2, pinchDelta * factor);\n            panZoom.scaleTo(nextZoom);\n        };\n        let panStart = [0, 0];\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const panStartHandler = (event) => {\n            if (event.sourceEvent.type === 'mousedown' || event.sourceEvent.type === 'touchstart') {\n                panStart = [\n                    event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,\n                    event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,\n                ];\n            }\n        };\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const panHandler = (event) => {\n            const transform = getTransform();\n            if ((event.sourceEvent.type !== 'mousemove' && event.sourceEvent.type !== 'touchmove') || !panZoom) {\n                return;\n            }\n            const panCurrent = [\n                event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,\n                event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,\n            ];\n            const panDelta = [panCurrent[0] - panStart[0], panCurrent[1] - panStart[1]];\n            panStart = panCurrent;\n            const moveScale = getViewScale() * Math.max(transform[2], Math.log(transform[2])) * (inversePan ? -1 : 1);\n            const position = {\n                x: transform[0] - panDelta[0] * moveScale,\n                y: transform[1] - panDelta[1] * moveScale,\n            };\n            const extent = [\n                [0, 0],\n                [width, height],\n            ];\n            panZoom.setViewportConstrained({\n                x: position.x,\n                y: position.y,\n                zoom: transform[2],\n            }, extent, translateExtent);\n        };\n        const zoomAndPanHandler = zoom()\n            .on('start', panStartHandler)\n            // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n            // @ts-ignore\n            .on('zoom', pannable ? panHandler : null)\n            // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n            // @ts-ignore\n            .on('zoom.wheel', zoomable ? zoomHandler : null);\n        selection.call(zoomAndPanHandler, {});\n    }\n    function destroy() {\n        selection.on('zoom', null);\n    }\n    return {\n        update,\n        destroy,\n        pointer,\n    };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst transformToViewport = (transform) => ({\n    x: transform.x,\n    y: transform.y,\n    zoom: transform.k,\n});\nconst viewportToTransform = ({ x, y, zoom }) => zoomIdentity.translate(x, y).scale(zoom);\nconst isWrappedWithClass = (event, className) => event.target.closest(`.${className}`);\nconst isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2);\n// taken from d3-ease: https://github.com/d3/d3-ease/blob/main/src/cubic.js\nconst defaultEase = (t) => ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\nconst getD3Transition = (selection, duration = 0, ease = defaultEase, onEnd = () => { }) => {\n    const hasDuration = typeof duration === 'number' && duration > 0;\n    if (!hasDuration) {\n        onEnd();\n    }\n    return hasDuration ? selection.transition().duration(duration).ease(ease).on('end', onEnd) : selection;\n};\nconst wheelDelta = (event) => {\n    const factor = event.ctrlKey && isMacOs() ? 10 : 1;\n    return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * factor;\n};\n\nfunction createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }) {\n    return (event) => {\n        if (isWrappedWithClass(event, noWheelClassName)) {\n            if (event.ctrlKey) {\n                event.preventDefault(); // stop native page zoom for pinch zooming\n            }\n            return false;\n        }\n        event.preventDefault();\n        event.stopImmediatePropagation();\n        const currentZoom = d3Selection.property('__zoom').k || 1;\n        // macos sets ctrlKey=true for pinch gesture on a trackpad\n        if (event.ctrlKey && zoomOnPinch) {\n            const point = pointer(event);\n            const pinchDelta = wheelDelta(event);\n            const zoom = currentZoom * Math.pow(2, pinchDelta);\n            // @ts-ignore\n            d3Zoom.scaleTo(d3Selection, zoom, point, event);\n            return;\n        }\n        /*\n         * increase scroll speed in firefox\n         * firefox: deltaMode === 1; chrome: deltaMode === 0\n         */\n        const deltaNormalize = event.deltaMode === 1 ? 20 : 1;\n        let deltaX = panOnScrollMode === PanOnScrollMode.Vertical ? 0 : event.deltaX * deltaNormalize;\n        let deltaY = panOnScrollMode === PanOnScrollMode.Horizontal ? 0 : event.deltaY * deltaNormalize;\n        // this enables vertical scrolling with shift + scroll on windows\n        if (!isMacOs() && event.shiftKey && panOnScrollMode !== PanOnScrollMode.Vertical) {\n            deltaX = event.deltaY * deltaNormalize;\n            deltaY = 0;\n        }\n        d3Zoom.translateBy(d3Selection, -(deltaX / currentZoom) * panOnScrollSpeed, -(deltaY / currentZoom) * panOnScrollSpeed, \n        // @ts-ignore\n        { internal: true });\n        const nextViewport = transformToViewport(d3Selection.property('__zoom'));\n        clearTimeout(zoomPanValues.panScrollTimeout);\n        /*\n         * for pan on scroll we need to handle the event calls on our own\n         * we can't use the start, zoom and end events from d3-zoom\n         * because start and move gets called on every scroll event and not once at the beginning\n         */\n        if (!zoomPanValues.isPanScrolling) {\n            zoomPanValues.isPanScrolling = true;\n            onPanZoomStart?.(event, nextViewport);\n        }\n        else {\n            onPanZoom?.(event, nextViewport);\n            zoomPanValues.panScrollTimeout = setTimeout(() => {\n                onPanZoomEnd?.(event, nextViewport);\n                zoomPanValues.isPanScrolling = false;\n            }, 150);\n        }\n    };\n}\nfunction createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {\n    return function (event, d) {\n        const isWheel = event.type === 'wheel';\n        // we still want to enable pinch zooming even if preventScrolling is set to false\n        const preventZoom = !preventScrolling && isWheel && !event.ctrlKey;\n        const hasNoWheelClass = isWrappedWithClass(event, noWheelClassName);\n        // if user is pinch zooming above a nowheel element, we don't want the browser to zoom\n        if (event.ctrlKey && isWheel && hasNoWheelClass) {\n            event.preventDefault();\n        }\n        if (preventZoom || hasNoWheelClass) {\n            return null;\n        }\n        event.preventDefault();\n        d3ZoomHandler.call(this, event, d);\n    };\n}\nfunction createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) {\n    return (event) => {\n        if (event.sourceEvent?.internal) {\n            return;\n        }\n        const viewport = transformToViewport(event.transform);\n        // we need to remember it here, because it's always 0 in the \"zoom\" event\n        zoomPanValues.mouseButton = event.sourceEvent?.button || 0;\n        zoomPanValues.isZoomingOrPanning = true;\n        zoomPanValues.prevViewport = viewport;\n        if (event.sourceEvent?.type === 'mousedown') {\n            onDraggingChange(true);\n        }\n        if (onPanZoomStart) {\n            onPanZoomStart?.(event.sourceEvent, viewport);\n        }\n    };\n}\nfunction createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }) {\n    return (event) => {\n        zoomPanValues.usedRightMouseButton = !!(onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0));\n        if (!event.sourceEvent?.sync) {\n            onTransformChange([event.transform.x, event.transform.y, event.transform.k]);\n        }\n        if (onPanZoom && !event.sourceEvent?.internal) {\n            onPanZoom?.(event.sourceEvent, transformToViewport(event.transform));\n        }\n    };\n}\nfunction createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }) {\n    return (event) => {\n        if (event.sourceEvent?.internal) {\n            return;\n        }\n        zoomPanValues.isZoomingOrPanning = false;\n        if (onPaneContextMenu &&\n            isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) &&\n            !zoomPanValues.usedRightMouseButton &&\n            event.sourceEvent) {\n            onPaneContextMenu(event.sourceEvent);\n        }\n        zoomPanValues.usedRightMouseButton = false;\n        onDraggingChange(false);\n        if (onPanZoomEnd) {\n            const viewport = transformToViewport(event.transform);\n            zoomPanValues.prevViewport = viewport;\n            clearTimeout(zoomPanValues.timerId);\n            zoomPanValues.timerId = setTimeout(() => {\n                onPanZoomEnd?.(event.sourceEvent, viewport);\n            }, \n            // we need a setTimeout for panOnScroll to suppress multiple end events fired during scroll\n            panOnScroll ? 150 : 0);\n        }\n    };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, connectionInProgress, }) {\n    return (event) => {\n        const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;\n        const pinchZoom = zoomOnPinch && event.ctrlKey;\n        const isWheelEvent = event.type === 'wheel';\n        if (event.button === 1 &&\n            event.type === 'mousedown' &&\n            (isWrappedWithClass(event, `${lib}-flow__node`) || isWrappedWithClass(event, `${lib}-flow__edge`))) {\n            return true;\n        }\n        // if all interactions are disabled, we prevent all zoom events\n        if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch) {\n            return false;\n        }\n        // during a selection we prevent all other interactions\n        if (userSelectionActive) {\n            return false;\n        }\n        // we want to disable pinch-zooming while making a connection\n        if (connectionInProgress && !isWheelEvent) {\n            return false;\n        }\n        // if the target element is inside an element with the nowheel class, we prevent zooming\n        if (isWrappedWithClass(event, noWheelClassName) && isWheelEvent) {\n            return false;\n        }\n        // if the target element is inside an element with the nopan class, we prevent panning\n        if (isWrappedWithClass(event, noPanClassName) &&\n            (!isWheelEvent || (panOnScroll && isWheelEvent && !zoomActivationKeyPressed))) {\n            return false;\n        }\n        if (!zoomOnPinch && event.ctrlKey && isWheelEvent) {\n            return false;\n        }\n        if (!zoomOnPinch && event.type === 'touchstart' && event.touches?.length > 1) {\n            event.preventDefault(); // if you manage to start with 2 touches, we prevent native zoom\n            return false;\n        }\n        // when there is no scroll handling enabled, we prevent all wheel events\n        if (!zoomScroll && !panOnScroll && !pinchZoom && isWheelEvent) {\n            return false;\n        }\n        // if the pane is not movable, we prevent dragging it with mousestart or touchstart\n        if (!panOnDrag && (event.type === 'mousedown' || event.type === 'touchstart')) {\n            return false;\n        }\n        // if the pane is only movable using allowed clicks\n        if (Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === 'mousedown') {\n            return false;\n        }\n        // We only allow right clicks if pan on drag is set to right click\n        const buttonAllowed = (Array.isArray(panOnDrag) && panOnDrag.includes(event.button)) || !event.button || event.button <= 1;\n        // default filter for d3-zoom\n        return (!event.ctrlKey || isWheelEvent) && buttonAllowed;\n    };\n}\n\nfunction XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }) {\n    const zoomPanValues = {\n        isZoomingOrPanning: false,\n        usedRightMouseButton: false,\n        prevViewport: { x: 0, y: 0, zoom: 0 },\n        mouseButton: 0,\n        timerId: undefined,\n        panScrollTimeout: undefined,\n        isPanScrolling: false,\n    };\n    const bbox = domNode.getBoundingClientRect();\n    const d3ZoomInstance = zoom().scaleExtent([minZoom, maxZoom]).translateExtent(translateExtent);\n    const d3Selection = select(domNode).call(d3ZoomInstance);\n    setViewportConstrained({\n        x: viewport.x,\n        y: viewport.y,\n        zoom: clamp(viewport.zoom, minZoom, maxZoom),\n    }, [\n        [0, 0],\n        [bbox.width, bbox.height],\n    ], translateExtent);\n    const d3ZoomHandler = d3Selection.on('wheel.zoom');\n    const d3DblClickZoomHandler = d3Selection.on('dblclick.zoom');\n    d3ZoomInstance.wheelDelta(wheelDelta);\n    function setTransform(transform, options) {\n        if (d3Selection) {\n            return new Promise((resolve) => {\n                d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).transform(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), transform);\n            });\n        }\n        return Promise.resolve(false);\n    }\n    // public functions\n    function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib, onTransformChange, connectionInProgress, paneClickDistance, selectionOnDrag, }) {\n        if (userSelectionActive && !zoomPanValues.isZoomingOrPanning) {\n            destroy();\n        }\n        const isPanOnScroll = panOnScroll && !zoomActivationKeyPressed && !userSelectionActive;\n        d3ZoomInstance.clickDistance(selectionOnDrag ? Infinity : !isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance);\n        const wheelHandler = isPanOnScroll\n            ? createPanOnScrollHandler({\n                zoomPanValues,\n                noWheelClassName,\n                d3Selection,\n                d3Zoom: d3ZoomInstance,\n                panOnScrollMode,\n                panOnScrollSpeed,\n                zoomOnPinch,\n                onPanZoomStart,\n                onPanZoom,\n                onPanZoomEnd,\n            })\n            : createZoomOnScrollHandler({\n                noWheelClassName,\n                preventScrolling,\n                d3ZoomHandler,\n            });\n        d3Selection.on('wheel.zoom', wheelHandler, { passive: false });\n        if (!userSelectionActive) {\n            // pan zoom start\n            const startHandler = createPanZoomStartHandler({\n                zoomPanValues,\n                onDraggingChange,\n                onPanZoomStart,\n            });\n            d3ZoomInstance.on('start', startHandler);\n            // pan zoom\n            const panZoomHandler = createPanZoomHandler({\n                zoomPanValues,\n                panOnDrag,\n                onPaneContextMenu: !!onPaneContextMenu,\n                onPanZoom,\n                onTransformChange,\n            });\n            d3ZoomInstance.on('zoom', panZoomHandler);\n            // pan zoom end\n            const panZoomEndHandler = createPanZoomEndHandler({\n                zoomPanValues,\n                panOnDrag,\n                panOnScroll,\n                onPaneContextMenu,\n                onPanZoomEnd,\n                onDraggingChange,\n            });\n            d3ZoomInstance.on('end', panZoomEndHandler);\n        }\n        const filter = createFilter({\n            zoomActivationKeyPressed,\n            panOnDrag,\n            zoomOnScroll,\n            panOnScroll,\n            zoomOnDoubleClick,\n            zoomOnPinch,\n            userSelectionActive,\n            noPanClassName,\n            noWheelClassName,\n            lib,\n            connectionInProgress,\n        });\n        d3ZoomInstance.filter(filter);\n        /*\n         * We cannot add zoomOnDoubleClick to the filter above because\n         * double tapping on touch screens circumvents the filter and\n         * dblclick.zoom is fired on the selection directly\n         */\n        if (zoomOnDoubleClick) {\n            d3Selection.on('dblclick.zoom', d3DblClickZoomHandler);\n        }\n        else {\n            d3Selection.on('dblclick.zoom', null);\n        }\n    }\n    function destroy() {\n        d3ZoomInstance.on('zoom', null);\n    }\n    async function setViewportConstrained(viewport, extent, translateExtent) {\n        const nextTransform = viewportToTransform(viewport);\n        const contrainedTransform = d3ZoomInstance?.constrain()(nextTransform, extent, translateExtent);\n        if (contrainedTransform) {\n            await setTransform(contrainedTransform);\n        }\n        return new Promise((resolve) => resolve(contrainedTransform));\n    }\n    async function setViewport(viewport, options) {\n        const nextTransform = viewportToTransform(viewport);\n        await setTransform(nextTransform, options);\n        return new Promise((resolve) => resolve(nextTransform));\n    }\n    function syncViewport(viewport) {\n        if (d3Selection) {\n            const nextTransform = viewportToTransform(viewport);\n            const currentTransform = d3Selection.property('__zoom');\n            if (currentTransform.k !== viewport.zoom ||\n                currentTransform.x !== viewport.x ||\n                currentTransform.y !== viewport.y) {\n                // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n                // @ts-ignore\n                d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true });\n            }\n        }\n    }\n    function getViewport() {\n        const transform = d3Selection ? zoomTransform(d3Selection.node()) : { x: 0, y: 0, k: 1 };\n        return { x: transform.x, y: transform.y, zoom: transform.k };\n    }\n    function scaleTo(zoom, options) {\n        if (d3Selection) {\n            return new Promise((resolve) => {\n                d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleTo(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), zoom);\n            });\n        }\n        return Promise.resolve(false);\n    }\n    function scaleBy(factor, options) {\n        if (d3Selection) {\n            return new Promise((resolve) => {\n                d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleBy(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), factor);\n            });\n        }\n        return Promise.resolve(false);\n    }\n    function setScaleExtent(scaleExtent) {\n        d3ZoomInstance?.scaleExtent(scaleExtent);\n    }\n    function setTranslateExtent(translateExtent) {\n        d3ZoomInstance?.translateExtent(translateExtent);\n    }\n    function setClickDistance(distance) {\n        const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance;\n        d3ZoomInstance?.clickDistance(validDistance);\n    }\n    return {\n        update,\n        destroy,\n        setViewport,\n        setViewportConstrained,\n        getViewport,\n        scaleTo,\n        scaleBy,\n        setScaleExtent,\n        setTranslateExtent,\n        syncViewport,\n        setClickDistance,\n    };\n}\n\n/**\n * Used to determine the variant of the resize control\n *\n * @public\n */\nvar ResizeControlVariant;\n(function (ResizeControlVariant) {\n    ResizeControlVariant[\"Line\"] = \"line\";\n    ResizeControlVariant[\"Handle\"] = \"handle\";\n})(ResizeControlVariant || (ResizeControlVariant = {}));\nconst XY_RESIZER_HANDLE_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];\nconst XY_RESIZER_LINE_POSITIONS = ['top', 'right', 'bottom', 'left'];\n\n/**\n * Get all connecting edges for a given set of nodes\n * @param width - new width of the node\n * @param prevWidth - previous width of the node\n * @param height - new height of the node\n * @param prevHeight - previous height of the node\n * @param affectsX - whether to invert the resize direction for the x axis\n * @param affectsY - whether to invert the resize direction for the y axis\n * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease\n */\nfunction getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }) {\n    const deltaWidth = width - prevWidth;\n    const deltaHeight = height - prevHeight;\n    const direction = [deltaWidth > 0 ? 1 : deltaWidth < 0 ? -1 : 0, deltaHeight > 0 ? 1 : deltaHeight < 0 ? -1 : 0];\n    if (deltaWidth && affectsX) {\n        direction[0] = direction[0] * -1;\n    }\n    if (deltaHeight && affectsY) {\n        direction[1] = direction[1] * -1;\n    }\n    return direction;\n}\n/**\n * Parses the control position that is being dragged to dimensions that are being resized\n * @param controlPosition - position of the control that is being dragged\n * @returns isHorizontal, isVertical, affectsX, affectsY,\n */\nfunction getControlDirection(controlPosition) {\n    const isHorizontal = controlPosition.includes('right') || controlPosition.includes('left');\n    const isVertical = controlPosition.includes('bottom') || controlPosition.includes('top');\n    const affectsX = controlPosition.includes('left');\n    const affectsY = controlPosition.includes('top');\n    return {\n        isHorizontal,\n        isVertical,\n        affectsX,\n        affectsY,\n    };\n}\nfunction getLowerExtentClamp(lowerExtent, lowerBound) {\n    return Math.max(0, lowerBound - lowerExtent);\n}\nfunction getUpperExtentClamp(upperExtent, upperBound) {\n    return Math.max(0, upperExtent - upperBound);\n}\nfunction getSizeClamp(size, minSize, maxSize) {\n    return Math.max(0, minSize - size, size - maxSize);\n}\nfunction xor(a, b) {\n    return a ? !b : b;\n}\n/**\n * Calculates new width & height and x & y of node after resize based on pointer position\n * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize,\n * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed\n * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes\n * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio!\n * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the\n * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio,\n * the resize amount is always kept in distX & distY amount (the distance in mouse movement)\n * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values.\n * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0],\n * then calculating the restrictions as usual\n * @param startValues - starting values of resize\n * @param controlDirection - dimensions affected by the resize\n * @param pointerPosition - the current pointer position corrected for snapping\n * @param boundaries - minimum and maximum dimensions of the node\n * @param keepAspectRatio - prevent changes of asprect ratio\n * @returns x, y, width and height of the node after resize\n */\nfunction getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, extent, childExtent) {\n    let { affectsX, affectsY } = controlDirection;\n    const { isHorizontal, isVertical } = controlDirection;\n    const isDiagonal = isHorizontal && isVertical;\n    const { xSnapped, ySnapped } = pointerPosition;\n    const { minWidth, maxWidth, minHeight, maxHeight } = boundaries;\n    const { x: startX, y: startY, width: startWidth, height: startHeight, aspectRatio } = startValues;\n    let distX = Math.floor(isHorizontal ? xSnapped - startValues.pointerX : 0);\n    let distY = Math.floor(isVertical ? ySnapped - startValues.pointerY : 0);\n    const newWidth = startWidth + (affectsX ? -distX : distX);\n    const newHeight = startHeight + (affectsY ? -distY : distY);\n    const originOffsetX = -nodeOrigin[0] * startWidth;\n    const originOffsetY = -nodeOrigin[1] * startHeight;\n    // Check if maxWidth, minWWidth, maxHeight, minHeight are restricting the resize\n    let clampX = getSizeClamp(newWidth, minWidth, maxWidth);\n    let clampY = getSizeClamp(newHeight, minHeight, maxHeight);\n    // Check if extent is restricting the resize\n    if (extent) {\n        let xExtentClamp = 0;\n        let yExtentClamp = 0;\n        if (affectsX && distX < 0) {\n            xExtentClamp = getLowerExtentClamp(startX + distX + originOffsetX, extent[0][0]);\n        }\n        else if (!affectsX && distX > 0) {\n            xExtentClamp = getUpperExtentClamp(startX + newWidth + originOffsetX, extent[1][0]);\n        }\n        if (affectsY && distY < 0) {\n            yExtentClamp = getLowerExtentClamp(startY + distY + originOffsetY, extent[0][1]);\n        }\n        else if (!affectsY && distY > 0) {\n            yExtentClamp = getUpperExtentClamp(startY + newHeight + originOffsetY, extent[1][1]);\n        }\n        clampX = Math.max(clampX, xExtentClamp);\n        clampY = Math.max(clampY, yExtentClamp);\n    }\n    // Check if the child extent is restricting the resize\n    if (childExtent) {\n        let xExtentClamp = 0;\n        let yExtentClamp = 0;\n        if (affectsX && distX > 0) {\n            xExtentClamp = getUpperExtentClamp(startX + distX, childExtent[0][0]);\n        }\n        else if (!affectsX && distX < 0) {\n            xExtentClamp = getLowerExtentClamp(startX + newWidth, childExtent[1][0]);\n        }\n        if (affectsY && distY > 0) {\n            yExtentClamp = getUpperExtentClamp(startY + distY, childExtent[0][1]);\n        }\n        else if (!affectsY && distY < 0) {\n            yExtentClamp = getLowerExtentClamp(startY + newHeight, childExtent[1][1]);\n        }\n        clampX = Math.max(clampX, xExtentClamp);\n        clampY = Math.max(clampY, yExtentClamp);\n    }\n    // Check if the aspect ratio resizing of the other side is restricting the resize\n    if (keepAspectRatio) {\n        if (isHorizontal) {\n            // Check if the max dimensions might be restricting the resize\n            const aspectHeightClamp = getSizeClamp(newWidth / aspectRatio, minHeight, maxHeight) * aspectRatio;\n            clampX = Math.max(clampX, aspectHeightClamp);\n            // Check if the extent is restricting the resize\n            if (extent) {\n                let aspectExtentClamp = 0;\n                if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {\n                    aspectExtentClamp =\n                        getUpperExtentClamp(startY + originOffsetY + newWidth / aspectRatio, extent[1][1]) * aspectRatio;\n                }\n                else {\n                    aspectExtentClamp =\n                        getLowerExtentClamp(startY + originOffsetY + (affectsX ? distX : -distX) / aspectRatio, extent[0][1]) *\n                            aspectRatio;\n                }\n                clampX = Math.max(clampX, aspectExtentClamp);\n            }\n            // Check if the child extent is restricting the resize\n            if (childExtent) {\n                let aspectExtentClamp = 0;\n                if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {\n                    aspectExtentClamp = getLowerExtentClamp(startY + newWidth / aspectRatio, childExtent[1][1]) * aspectRatio;\n                }\n                else {\n                    aspectExtentClamp =\n                        getUpperExtentClamp(startY + (affectsX ? distX : -distX) / aspectRatio, childExtent[0][1]) * aspectRatio;\n                }\n                clampX = Math.max(clampX, aspectExtentClamp);\n            }\n        }\n        // Do the same thing for vertical resizing\n        if (isVertical) {\n            const aspectWidthClamp = getSizeClamp(newHeight * aspectRatio, minWidth, maxWidth) / aspectRatio;\n            clampY = Math.max(clampY, aspectWidthClamp);\n            if (extent) {\n                let aspectExtentClamp = 0;\n                if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {\n                    aspectExtentClamp =\n                        getUpperExtentClamp(startX + newHeight * aspectRatio + originOffsetX, extent[1][0]) / aspectRatio;\n                }\n                else {\n                    aspectExtentClamp =\n                        getLowerExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio + originOffsetX, extent[0][0]) /\n                            aspectRatio;\n                }\n                clampY = Math.max(clampY, aspectExtentClamp);\n            }\n            if (childExtent) {\n                let aspectExtentClamp = 0;\n                if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {\n                    aspectExtentClamp = getLowerExtentClamp(startX + newHeight * aspectRatio, childExtent[1][0]) / aspectRatio;\n                }\n                else {\n                    aspectExtentClamp =\n                        getUpperExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio, childExtent[0][0]) / aspectRatio;\n                }\n                clampY = Math.max(clampY, aspectExtentClamp);\n            }\n        }\n    }\n    distY = distY + (distY < 0 ? clampY : -clampY);\n    distX = distX + (distX < 0 ? clampX : -clampX);\n    if (keepAspectRatio) {\n        if (isDiagonal) {\n            if (newWidth > newHeight * aspectRatio) {\n                distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio;\n            }\n            else {\n                distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio;\n            }\n        }\n        else {\n            if (isHorizontal) {\n                distY = distX / aspectRatio;\n                affectsY = affectsX;\n            }\n            else {\n                distX = distY * aspectRatio;\n                affectsX = affectsY;\n            }\n        }\n    }\n    const x = affectsX ? startX + distX : startX;\n    const y = affectsY ? startY + distY : startY;\n    return {\n        width: startWidth + (affectsX ? -distX : distX),\n        height: startHeight + (affectsY ? -distY : distY),\n        x: nodeOrigin[0] * distX * (!affectsX ? 1 : -1) + x,\n        y: nodeOrigin[1] * distY * (!affectsY ? 1 : -1) + y,\n    };\n}\n\nconst initPrevValues = { width: 0, height: 0, x: 0, y: 0 };\nconst initStartValues = {\n    ...initPrevValues,\n    pointerX: 0,\n    pointerY: 0,\n    aspectRatio: 1,\n};\nfunction nodeToParentExtent(node) {\n    return [\n        [0, 0],\n        [node.measured.width, node.measured.height],\n    ];\n}\nfunction nodeToChildExtent(child, parent, nodeOrigin) {\n    const x = parent.position.x + child.position.x;\n    const y = parent.position.y + child.position.y;\n    const width = child.measured.width ?? 0;\n    const height = child.measured.height ?? 0;\n    const originOffsetX = nodeOrigin[0] * width;\n    const originOffsetY = nodeOrigin[1] * height;\n    return [\n        [x - originOffsetX, y - originOffsetY],\n        [x + width - originOffsetX, y + height - originOffsetY],\n    ];\n}\nfunction XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {\n    const selection = select(domNode);\n    let params = {\n        controlDirection: getControlDirection('bottom-right'),\n        boundaries: {\n            minWidth: 0,\n            minHeight: 0,\n            maxWidth: Number.MAX_VALUE,\n            maxHeight: Number.MAX_VALUE,\n        },\n        resizeDirection: undefined,\n        keepAspectRatio: false,\n    };\n    function update({ controlPosition, boundaries, keepAspectRatio, resizeDirection, onResizeStart, onResize, onResizeEnd, shouldResize, }) {\n        let prevValues = { ...initPrevValues };\n        let startValues = { ...initStartValues };\n        params = {\n            boundaries,\n            resizeDirection,\n            keepAspectRatio,\n            controlDirection: getControlDirection(controlPosition),\n        };\n        let node = undefined;\n        let containerBounds = null;\n        let childNodes = [];\n        let parentNode = undefined; // Needed to fix expandParent\n        let parentExtent = undefined;\n        let childExtent = undefined;\n        // we only want to trigger onResizeEnd if onResize was actually called\n        let resizeDetected = false;\n        const dragHandler = drag()\n            .on('start', (event) => {\n            const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, paneDomNode } = getStoreItems();\n            node = nodeLookup.get(nodeId);\n            if (!node) {\n                return;\n            }\n            containerBounds = paneDomNode?.getBoundingClientRect() ?? null;\n            const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, {\n                transform,\n                snapGrid,\n                snapToGrid,\n                containerBounds,\n            });\n            prevValues = {\n                width: node.measured.width ?? 0,\n                height: node.measured.height ?? 0,\n                x: node.position.x ?? 0,\n                y: node.position.y ?? 0,\n            };\n            startValues = {\n                ...prevValues,\n                pointerX: xSnapped,\n                pointerY: ySnapped,\n                aspectRatio: prevValues.width / prevValues.height,\n            };\n            parentNode = undefined;\n            if (node.parentId && (node.extent === 'parent' || node.expandParent)) {\n                parentNode = nodeLookup.get(node.parentId);\n                parentExtent = parentNode && node.extent === 'parent' ? nodeToParentExtent(parentNode) : undefined;\n            }\n            /*\n             * Collect all child nodes to correct their relative positions when top/left changes\n             * Determine largest minimal extent the parent node is allowed to resize to\n             */\n            childNodes = [];\n            childExtent = undefined;\n            for (const [childId, child] of nodeLookup) {\n                if (child.parentId === nodeId) {\n                    childNodes.push({\n                        id: childId,\n                        position: { ...child.position },\n                        extent: child.extent,\n                    });\n                    if (child.extent === 'parent' || child.expandParent) {\n                        const extent = nodeToChildExtent(child, node, child.origin ?? nodeOrigin);\n                        if (childExtent) {\n                            childExtent = [\n                                [Math.min(extent[0][0], childExtent[0][0]), Math.min(extent[0][1], childExtent[0][1])],\n                                [Math.max(extent[1][0], childExtent[1][0]), Math.max(extent[1][1], childExtent[1][1])],\n                            ];\n                        }\n                        else {\n                            childExtent = extent;\n                        }\n                    }\n                }\n            }\n            onResizeStart?.(event, { ...prevValues });\n        })\n            .on('drag', (event) => {\n            const { transform, snapGrid, snapToGrid, nodeOrigin: storeNodeOrigin } = getStoreItems();\n            const pointerPosition = getPointerPosition(event.sourceEvent, {\n                transform,\n                snapGrid,\n                snapToGrid,\n                containerBounds,\n            });\n            const childChanges = [];\n            if (!node) {\n                return;\n            }\n            const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues;\n            const change = {};\n            const nodeOrigin = node.origin ?? storeNodeOrigin;\n            const { width, height, x, y } = getDimensionsAfterResize(startValues, params.controlDirection, pointerPosition, params.boundaries, params.keepAspectRatio, nodeOrigin, parentExtent, childExtent);\n            const isWidthChange = width !== prevWidth;\n            const isHeightChange = height !== prevHeight;\n            const isXPosChange = x !== prevX && isWidthChange;\n            const isYPosChange = y !== prevY && isHeightChange;\n            if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange) {\n                return;\n            }\n            if (isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) {\n                change.x = isXPosChange ? x : prevValues.x;\n                change.y = isYPosChange ? y : prevValues.y;\n                prevValues.x = change.x;\n                prevValues.y = change.y;\n                /*\n                 * when top/left changes, correct the relative positions of child nodes\n                 * so that they stay in the same position\n                 */\n                if (childNodes.length > 0) {\n                    const xChange = x - prevX;\n                    const yChange = y - prevY;\n                    for (const childNode of childNodes) {\n                        childNode.position = {\n                            x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth),\n                            y: childNode.position.y - yChange + nodeOrigin[1] * (height - prevHeight),\n                        };\n                        childChanges.push(childNode);\n                    }\n                }\n            }\n            if (isWidthChange || isHeightChange) {\n                change.width =\n                    isWidthChange && (!params.resizeDirection || params.resizeDirection === 'horizontal')\n                        ? width\n                        : prevValues.width;\n                change.height =\n                    isHeightChange && (!params.resizeDirection || params.resizeDirection === 'vertical')\n                        ? height\n                        : prevValues.height;\n                prevValues.width = change.width;\n                prevValues.height = change.height;\n            }\n            // Fix expandParent when resizing from top/left\n            if (parentNode && node.expandParent) {\n                const xLimit = nodeOrigin[0] * (change.width ?? 0);\n                if (change.x && change.x < xLimit) {\n                    prevValues.x = xLimit;\n                    startValues.x = startValues.x - (change.x - xLimit);\n                }\n                const yLimit = nodeOrigin[1] * (change.height ?? 0);\n                if (change.y && change.y < yLimit) {\n                    prevValues.y = yLimit;\n                    startValues.y = startValues.y - (change.y - yLimit);\n                }\n            }\n            const direction = getResizeDirection({\n                width: prevValues.width,\n                prevWidth,\n                height: prevValues.height,\n                prevHeight,\n                affectsX: params.controlDirection.affectsX,\n                affectsY: params.controlDirection.affectsY,\n            });\n            const nextValues = { ...prevValues, direction };\n            const callResize = shouldResize?.(event, nextValues);\n            if (callResize === false) {\n                return;\n            }\n            resizeDetected = true;\n            onResize?.(event, nextValues);\n            onChange(change, childChanges);\n        })\n            .on('end', (event) => {\n            if (!resizeDetected) {\n                return;\n            }\n            onResizeEnd?.(event, { ...prevValues });\n            onEnd?.({ ...prevValues });\n            resizeDetected = false;\n        });\n        selection.call(dragHandler);\n    }\n    function destroy() {\n        selection.on('.drag', null);\n    }\n    return {\n        update,\n        destroy,\n    };\n}\n\nexport { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, defaultAriaLabelConfig, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgeId, getEdgePosition, getEdgeToolbarTransform, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getSmoothStepPath, getStraightPath, getViewportForBounds, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isManualZIndexMode, isMouseEvent, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals, withResolvers };\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n  return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n  useState = React.useState,\n  useEffect = React.useEffect,\n  useLayoutEffect = React.useLayoutEffect,\n  useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n  var value = getSnapshot(),\n    _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n    inst = _useState[0].inst,\n    forceUpdate = _useState[1];\n  useLayoutEffect(\n    function () {\n      inst.value = value;\n      inst.getSnapshot = getSnapshot;\n      checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n    },\n    [subscribe, value, getSnapshot]\n  );\n  useEffect(\n    function () {\n      checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n      return subscribe(function () {\n        checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n      });\n    },\n    [subscribe]\n  );\n  useDebugValue(value);\n  return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n  var latestGetSnapshot = inst.getSnapshot;\n  inst = inst.value;\n  try {\n    var nextValue = latestGetSnapshot();\n    return !objectIs(inst, nextValue);\n  } catch (error) {\n    return !0;\n  }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n  return getSnapshot();\n}\nvar shim =\n  \"undefined\" === typeof window ||\n  \"undefined\" === typeof window.document ||\n  \"undefined\" === typeof window.document.createElement\n    ? useSyncExternalStore$1\n    : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n  void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n  (function () {\n    function is(x, y) {\n      return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n    }\n    function useSyncExternalStore$2(subscribe, getSnapshot) {\n      didWarnOld18Alpha ||\n        void 0 === React.startTransition ||\n        ((didWarnOld18Alpha = !0),\n        console.error(\n          \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n        ));\n      var value = getSnapshot();\n      if (!didWarnUncachedGetSnapshot) {\n        var cachedValue = getSnapshot();\n        objectIs(value, cachedValue) ||\n          (console.error(\n            \"The result of getSnapshot should be cached to avoid an infinite loop\"\n          ),\n          (didWarnUncachedGetSnapshot = !0));\n      }\n      cachedValue = useState({\n        inst: { value: value, getSnapshot: getSnapshot }\n      });\n      var inst = cachedValue[0].inst,\n        forceUpdate = cachedValue[1];\n      useLayoutEffect(\n        function () {\n          inst.value = value;\n          inst.getSnapshot = getSnapshot;\n          checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n        },\n        [subscribe, value, getSnapshot]\n      );\n      useEffect(\n        function () {\n          checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n          return subscribe(function () {\n            checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n          });\n        },\n        [subscribe]\n      );\n      useDebugValue(value);\n      return value;\n    }\n    function checkIfSnapshotChanged(inst) {\n      var latestGetSnapshot = inst.getSnapshot;\n      inst = inst.value;\n      try {\n        var nextValue = latestGetSnapshot();\n        return !objectIs(inst, nextValue);\n      } catch (error) {\n        return !0;\n      }\n    }\n    function useSyncExternalStore$1(subscribe, getSnapshot) {\n      return getSnapshot();\n    }\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n    var React = require(\"react\"),\n      objectIs = \"function\" === typeof Object.is ? Object.is : is,\n      useState = React.useState,\n      useEffect = React.useEffect,\n      useLayoutEffect = React.useLayoutEffect,\n      useDebugValue = React.useDebugValue,\n      didWarnOld18Alpha = !1,\n      didWarnUncachedGetSnapshot = !1,\n      shim =\n        \"undefined\" === typeof window ||\n        \"undefined\" === typeof window.document ||\n        \"undefined\" === typeof window.document.createElement\n          ? useSyncExternalStore$1\n          : useSyncExternalStore$2;\n    exports.useSyncExternalStore =\n      void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n  })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n  module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n  shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n  return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n  useSyncExternalStore = shim.useSyncExternalStore,\n  useRef = React.useRef,\n  useEffect = React.useEffect,\n  useMemo = React.useMemo,\n  useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n  subscribe,\n  getSnapshot,\n  getServerSnapshot,\n  selector,\n  isEqual\n) {\n  var instRef = useRef(null);\n  if (null === instRef.current) {\n    var inst = { hasValue: !1, value: null };\n    instRef.current = inst;\n  } else inst = instRef.current;\n  instRef = useMemo(\n    function () {\n      function memoizedSelector(nextSnapshot) {\n        if (!hasMemo) {\n          hasMemo = !0;\n          memoizedSnapshot = nextSnapshot;\n          nextSnapshot = selector(nextSnapshot);\n          if (void 0 !== isEqual && inst.hasValue) {\n            var currentSelection = inst.value;\n            if (isEqual(currentSelection, nextSnapshot))\n              return (memoizedSelection = currentSelection);\n          }\n          return (memoizedSelection = nextSnapshot);\n        }\n        currentSelection = memoizedSelection;\n        if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n        var nextSelection = selector(nextSnapshot);\n        if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n          return (memoizedSnapshot = nextSnapshot), currentSelection;\n        memoizedSnapshot = nextSnapshot;\n        return (memoizedSelection = nextSelection);\n      }\n      var hasMemo = !1,\n        memoizedSnapshot,\n        memoizedSelection,\n        maybeGetServerSnapshot =\n          void 0 === getServerSnapshot ? null : getServerSnapshot;\n      return [\n        function () {\n          return memoizedSelector(getSnapshot());\n        },\n        null === maybeGetServerSnapshot\n          ? void 0\n          : function () {\n              return memoizedSelector(maybeGetServerSnapshot());\n            }\n      ];\n    },\n    [getSnapshot, getServerSnapshot, selector, isEqual]\n  );\n  var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n  useEffect(\n    function () {\n      inst.hasValue = !0;\n      inst.value = value;\n    },\n    [value]\n  );\n  useDebugValue(value);\n  return value;\n};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n  (function () {\n    function is(x, y) {\n      return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n    }\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n    var React = require(\"react\"),\n      shim = require(\"use-sync-external-store/shim\"),\n      objectIs = \"function\" === typeof Object.is ? Object.is : is,\n      useSyncExternalStore = shim.useSyncExternalStore,\n      useRef = React.useRef,\n      useEffect = React.useEffect,\n      useMemo = React.useMemo,\n      useDebugValue = React.useDebugValue;\n    exports.useSyncExternalStoreWithSelector = function (\n      subscribe,\n      getSnapshot,\n      getServerSnapshot,\n      selector,\n      isEqual\n    ) {\n      var instRef = useRef(null);\n      if (null === instRef.current) {\n        var inst = { hasValue: !1, value: null };\n        instRef.current = inst;\n      } else inst = instRef.current;\n      instRef = useMemo(\n        function () {\n          function memoizedSelector(nextSnapshot) {\n            if (!hasMemo) {\n              hasMemo = !0;\n              memoizedSnapshot = nextSnapshot;\n              nextSnapshot = selector(nextSnapshot);\n              if (void 0 !== isEqual && inst.hasValue) {\n                var currentSelection = inst.value;\n                if (isEqual(currentSelection, nextSnapshot))\n                  return (memoizedSelection = currentSelection);\n              }\n              return (memoizedSelection = nextSnapshot);\n            }\n            currentSelection = memoizedSelection;\n            if (objectIs(memoizedSnapshot, nextSnapshot))\n              return currentSelection;\n            var nextSelection = selector(nextSnapshot);\n            if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n              return (memoizedSnapshot = nextSnapshot), currentSelection;\n            memoizedSnapshot = nextSnapshot;\n            return (memoizedSelection = nextSelection);\n          }\n          var hasMemo = !1,\n            memoizedSnapshot,\n            memoizedSelection,\n            maybeGetServerSnapshot =\n              void 0 === getServerSnapshot ? null : getServerSnapshot;\n          return [\n            function () {\n              return memoizedSelector(getSnapshot());\n            },\n            null === maybeGetServerSnapshot\n              ? void 0\n              : function () {\n                  return memoizedSelector(maybeGetServerSnapshot());\n                }\n          ];\n        },\n        [getSnapshot, getServerSnapshot, selector, isEqual]\n      );\n      var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n      useEffect(\n        function () {\n          inst.hasValue = !0;\n          inst.value = value;\n        },\n        [value]\n      );\n      useDebugValue(value);\n      return value;\n    };\n    \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n      \"function\" ===\n        typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n      __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n  })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n  module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","const createStoreImpl = (createState) => {\n  let state;\n  const listeners = /* @__PURE__ */ new Set();\n  const setState = (partial, replace) => {\n    const nextState = typeof partial === \"function\" ? partial(state) : partial;\n    if (!Object.is(nextState, state)) {\n      const previousState = state;\n      state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n      listeners.forEach((listener) => listener(state, previousState));\n    }\n  };\n  const getState = () => state;\n  const getInitialState = () => initialState;\n  const subscribe = (listener) => {\n    listeners.add(listener);\n    return () => listeners.delete(listener);\n  };\n  const destroy = () => {\n    if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n      console.warn(\n        \"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.\"\n      );\n    }\n    listeners.clear();\n  };\n  const api = { setState, getState, getInitialState, subscribe, destroy };\n  const initialState = state = createState(setState, getState, api);\n  return api;\n};\nconst createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;\nvar vanilla = (createState) => {\n  if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n    console.warn(\n      \"[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'.\"\n    );\n  }\n  return createStore(createState);\n};\n\nexport { createStore, vanilla as default };\n","import ReactExports from 'react';\nimport useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js';\nimport { createStore } from 'zustand/vanilla';\n\nconst { useDebugValue } = ReactExports;\nconst { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;\nconst identity = (arg) => arg;\nfunction useStoreWithEqualityFn(api, selector = identity, equalityFn) {\n  const slice = useSyncExternalStoreWithSelector(\n    api.subscribe,\n    api.getState,\n    api.getServerState || api.getInitialState,\n    selector,\n    equalityFn\n  );\n  useDebugValue(slice);\n  return slice;\n}\nconst createWithEqualityFnImpl = (createState, defaultEqualityFn) => {\n  const api = createStore(createState);\n  const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn);\n  Object.assign(useBoundStoreWithEqualityFn, api);\n  return useBoundStoreWithEqualityFn;\n};\nconst createWithEqualityFn = (createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl;\n\nexport { createWithEqualityFn, useStoreWithEqualityFn };\n","function shallow$1(objA, objB) {\n  if (Object.is(objA, objB)) {\n    return true;\n  }\n  if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n    return false;\n  }\n  if (objA instanceof Map && objB instanceof Map) {\n    if (objA.size !== objB.size) return false;\n    for (const [key, value] of objA) {\n      if (!Object.is(value, objB.get(key))) {\n        return false;\n      }\n    }\n    return true;\n  }\n  if (objA instanceof Set && objB instanceof Set) {\n    if (objA.size !== objB.size) return false;\n    for (const value of objA) {\n      if (!objB.has(value)) {\n        return false;\n      }\n    }\n    return true;\n  }\n  const keysA = Object.keys(objA);\n  if (keysA.length !== Object.keys(objB).length) {\n    return false;\n  }\n  for (const keyA of keysA) {\n    if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) {\n      return false;\n    }\n  }\n  return true;\n}\n\nvar shallow = (objA, objB) => {\n  if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n    console.warn(\n      \"[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`.\"\n    );\n  }\n  return shallow$1(objA, objB);\n};\n\nexport { shallow as default, shallow$1 as shallow };\n","\"use client\"\nimport { jsxs, Fragment, jsx } from 'react/jsx-runtime';\nimport { createContext, useContext, useMemo, forwardRef, useEffect, useLayoutEffect, useRef, useState, useCallback, memo } from 'react';\nimport cc from 'classcat';\nimport { errorMessages, mergeAriaLabelConfig, infiniteExtent, isInputDOMNode, getViewportForBounds, pointToRendererPoint, rendererPointToPoint, isNodeBase, isEdgeBase, getElementsToRemove, isRectObject, nodeToRect, getOverlappingArea, getNodesBounds, withResolvers, evaluateAbsolutePosition, getDimensions, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, getNodesInside, areSetsEqual, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, isMouseEvent, XYHandle, getHostForElement, addEdge, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, initialConnection, devWarn, defaultAriaLabelConfig, updateNodeInternals, updateAbsolutePositions, getHandlePosition, handleExpandParent, panBy, fitViewport, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform, getEdgeToolbarTransform } from '@xyflow/system';\nexport { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, reconnectEdge } from '@xyflow/system';\nimport { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional';\nimport { shallow } from 'zustand/shallow';\nimport { createPortal } from 'react-dom';\n\nconst StoreContext = createContext(null);\nconst Provider$1 = StoreContext.Provider;\n\nconst zustandErrorMessage = errorMessages['error001']();\n/**\n * This hook can be used to subscribe to internal state changes of the React Flow\n * component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand)\n * state management library, so you should check out their docs for more details.\n *\n * @public\n * @param selector - A selector function that returns a slice of the flow's internal state.\n * Extracting or transforming just the state you need is a good practice to avoid unnecessary\n * re-renders.\n * @param equalityFn - A function to compare the previous and next value. This is incredibly useful\n * for preventing unnecessary re-renders. Good sensible defaults are using `Object.is` or importing\n * `zustand/shallow`, but you can be as granular as you like.\n * @returns The selected state slice.\n *\n * @example\n * ```ts\n * const nodes = useStore((state) => state.nodes);\n * ```\n *\n * @remarks This hook should only be used if there is no other way to access the internal\n * state. For many of the common use cases, there are dedicated hooks available\n * such as {@link useReactFlow}, {@link useViewport}, etc.\n */\nfunction useStore(selector, equalityFn) {\n    const store = useContext(StoreContext);\n    if (store === null) {\n        throw new Error(zustandErrorMessage);\n    }\n    return useStoreWithEqualityFn(store, selector, equalityFn);\n}\n/**\n * In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions.\n *\n * @returns The store object.\n * @example\n * ```ts\n * const store = useStoreApi();\n * ```\n *\n * @remarks This hook should only be used if there is no other way to access the internal\n * state. For many of the common use cases, there are dedicated hooks available\n * such as {@link useReactFlow}, {@link useViewport}, etc.\n */\nfunction useStoreApi() {\n    const store = useContext(StoreContext);\n    if (store === null) {\n        throw new Error(zustandErrorMessage);\n    }\n    return useMemo(() => ({\n        getState: store.getState,\n        setState: store.setState,\n        subscribe: store.subscribe,\n    }), [store]);\n}\n\nconst style = { display: 'none' };\nconst ariaLiveStyle = {\n    position: 'absolute',\n    width: 1,\n    height: 1,\n    margin: -1,\n    border: 0,\n    padding: 0,\n    overflow: 'hidden',\n    clip: 'rect(0px, 0px, 0px, 0px)',\n    clipPath: 'inset(100%)',\n};\nconst ARIA_NODE_DESC_KEY = 'react-flow__node-desc';\nconst ARIA_EDGE_DESC_KEY = 'react-flow__edge-desc';\nconst ARIA_LIVE_MESSAGE = 'react-flow__aria-live';\nconst ariaLiveSelector = (s) => s.ariaLiveMessage;\nconst ariaLabelConfigSelector = (s) => s.ariaLabelConfig;\nfunction AriaLiveMessage({ rfId }) {\n    const ariaLiveMessage = useStore(ariaLiveSelector);\n    return (jsx(\"div\", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, \"aria-live\": \"assertive\", \"aria-atomic\": \"true\", style: ariaLiveStyle, children: ariaLiveMessage }));\n}\nfunction A11yDescriptions({ rfId, disableKeyboardA11y }) {\n    const ariaLabelConfig = useStore(ariaLabelConfigSelector);\n    return (jsxs(Fragment, { children: [jsx(\"div\", { id: `${ARIA_NODE_DESC_KEY}-${rfId}`, style: style, children: disableKeyboardA11y\n                    ? ariaLabelConfig['node.a11yDescription.default']\n                    : ariaLabelConfig['node.a11yDescription.keyboardDisabled'] }), jsx(\"div\", { id: `${ARIA_EDGE_DESC_KEY}-${rfId}`, style: style, children: ariaLabelConfig['edge.a11yDescription.default'] }), !disableKeyboardA11y && jsx(AriaLiveMessage, { rfId: rfId })] }));\n}\n\n/**\n * The `<Panel />` component helps you position content above the viewport.\n * It is used internally by the [`<MiniMap />`](/api-reference/components/minimap)\n * and [`<Controls />`](/api-reference/components/controls) components.\n *\n * @public\n *\n * @example\n * ```jsx\n *import { ReactFlow, Background, Panel } from '@xyflow/react';\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlow nodes={[]} fitView>\n *      <Panel position=\"top-left\">top-left</Panel>\n *      <Panel position=\"top-center\">top-center</Panel>\n *      <Panel position=\"top-right\">top-right</Panel>\n *      <Panel position=\"bottom-left\">bottom-left</Panel>\n *      <Panel position=\"bottom-center\">bottom-center</Panel>\n *      <Panel position=\"bottom-right\">bottom-right</Panel>\n *    </ReactFlow>\n *  );\n *}\n *```\n */\nconst Panel = forwardRef(({ position = 'top-left', children, className, style, ...rest }, ref) => {\n    const positionClasses = `${position}`.split('-');\n    return (jsx(\"div\", { className: cc(['react-flow__panel', className, ...positionClasses]), style: style, ref: ref, ...rest, children: children }));\n});\nPanel.displayName = 'Panel';\n\nfunction Attribution({ proOptions, position = 'bottom-right' }) {\n    if (proOptions?.hideAttribution) {\n        return null;\n    }\n    return (jsx(Panel, { position: position, className: \"react-flow__attribution\", \"data-message\": \"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev\", children: jsx(\"a\", { href: \"https://reactflow.dev\", target: \"_blank\", rel: \"noopener noreferrer\", \"aria-label\": \"React Flow attribution\", children: \"React Flow\" }) }));\n}\n\nconst selector$m = (s) => {\n    const selectedNodes = [];\n    const selectedEdges = [];\n    for (const [, node] of s.nodeLookup) {\n        if (node.selected) {\n            selectedNodes.push(node.internals.userNode);\n        }\n    }\n    for (const [, edge] of s.edgeLookup) {\n        if (edge.selected) {\n            selectedEdges.push(edge);\n        }\n    }\n    return { selectedNodes, selectedEdges };\n};\nconst selectId = (obj) => obj.id;\nfunction areEqual(a, b) {\n    return (shallow(a.selectedNodes.map(selectId), b.selectedNodes.map(selectId)) &&\n        shallow(a.selectedEdges.map(selectId), b.selectedEdges.map(selectId)));\n}\nfunction SelectionListenerInner({ onSelectionChange, }) {\n    const store = useStoreApi();\n    const { selectedNodes, selectedEdges } = useStore(selector$m, areEqual);\n    useEffect(() => {\n        const params = { nodes: selectedNodes, edges: selectedEdges };\n        onSelectionChange?.(params);\n        store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params));\n    }, [selectedNodes, selectedEdges, onSelectionChange]);\n    return null;\n}\nconst changeSelector = (s) => !!s.onSelectionChangeHandlers;\nfunction SelectionListener({ onSelectionChange, }) {\n    const storeHasSelectionChangeHandlers = useStore(changeSelector);\n    if (onSelectionChange || storeHasSelectionChangeHandlers) {\n        return jsx(SelectionListenerInner, { onSelectionChange: onSelectionChange });\n    }\n    return null;\n}\n\n// we need this hook to prevent a warning when using react-flow in SSR\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst defaultNodeOrigin = [0, 0];\nconst defaultViewport = { x: 0, y: 0, zoom: 1 };\n\n/*\n * This component helps us to update the store with the values coming from the user.\n * We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`)\n * and values that have a dedicated setter function in the store (like `setNodes`).\n */\n// These fields exist in the global store, and we need to keep them up to date\nconst reactFlowFieldsToTrack = [\n    'nodes',\n    'edges',\n    'defaultNodes',\n    'defaultEdges',\n    'onConnect',\n    'onConnectStart',\n    'onConnectEnd',\n    'onClickConnectStart',\n    'onClickConnectEnd',\n    'nodesDraggable',\n    'autoPanOnNodeFocus',\n    'nodesConnectable',\n    'nodesFocusable',\n    'edgesFocusable',\n    'edgesReconnectable',\n    'elevateNodesOnSelect',\n    'elevateEdgesOnSelect',\n    'minZoom',\n    'maxZoom',\n    'nodeExtent',\n    'onNodesChange',\n    'onEdgesChange',\n    'elementsSelectable',\n    'connectionMode',\n    'snapGrid',\n    'snapToGrid',\n    'translateExtent',\n    'connectOnClick',\n    'defaultEdgeOptions',\n    'fitView',\n    'fitViewOptions',\n    'onNodesDelete',\n    'onEdgesDelete',\n    'onDelete',\n    'onNodeDrag',\n    'onNodeDragStart',\n    'onNodeDragStop',\n    'onSelectionDrag',\n    'onSelectionDragStart',\n    'onSelectionDragStop',\n    'onMoveStart',\n    'onMove',\n    'onMoveEnd',\n    'noPanClassName',\n    'nodeOrigin',\n    'autoPanOnConnect',\n    'autoPanOnNodeDrag',\n    'onError',\n    'connectionRadius',\n    'isValidConnection',\n    'selectNodesOnDrag',\n    'nodeDragThreshold',\n    'connectionDragThreshold',\n    'onBeforeDelete',\n    'debug',\n    'autoPanSpeed',\n    'ariaLabelConfig',\n    'zIndexMode',\n];\n// rfId doesn't exist in ReactFlowProps, but it's one of the fields we want to update\nconst fieldsToTrack = [...reactFlowFieldsToTrack, 'rfId'];\nconst selector$l = (s) => ({\n    setNodes: s.setNodes,\n    setEdges: s.setEdges,\n    setMinZoom: s.setMinZoom,\n    setMaxZoom: s.setMaxZoom,\n    setTranslateExtent: s.setTranslateExtent,\n    setNodeExtent: s.setNodeExtent,\n    reset: s.reset,\n    setDefaultNodesAndEdges: s.setDefaultNodesAndEdges,\n});\nconst initPrevValues = {\n    /*\n     * these are values that are also passed directly to other components\n     * than the StoreUpdater. We can reduce the number of setStore calls\n     * by setting the same values here as prev fields.\n     */\n    translateExtent: infiniteExtent,\n    nodeOrigin: defaultNodeOrigin,\n    minZoom: 0.5,\n    maxZoom: 2,\n    elementsSelectable: true,\n    noPanClassName: 'nopan',\n    rfId: '1',\n};\nfunction StoreUpdater(props) {\n    const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, } = useStore(selector$l, shallow);\n    const store = useStoreApi();\n    // We use layout effects here so that the store is always populated before\n    // any child useEffect or useLayoutEffect fires. With regular useEffect, the\n    // cleanup calls reset() which empties the store, and child effects can run\n    // before the new mount effect repopulates it — causing children to read\n    // empty nodeLookup/nodes/edges during a <ReactFlow> remount.\n    useIsomorphicLayoutEffect(() => {\n        setDefaultNodesAndEdges(props.defaultNodes, props.defaultEdges);\n        return () => {\n            // when we reset the store we also need to reset the previous fields\n            previousFields.current = initPrevValues;\n            reset();\n        };\n    }, []);\n    const previousFields = useRef(initPrevValues);\n    useIsomorphicLayoutEffect(() => {\n        for (const fieldName of fieldsToTrack) {\n            const fieldValue = props[fieldName];\n            const previousFieldValue = previousFields.current[fieldName];\n            if (fieldValue === previousFieldValue)\n                continue;\n            if (typeof props[fieldName] === 'undefined')\n                continue;\n            // Custom handling with dedicated setters for some fields\n            if (fieldName === 'nodes')\n                setNodes(fieldValue);\n            else if (fieldName === 'edges')\n                setEdges(fieldValue);\n            else if (fieldName === 'minZoom')\n                setMinZoom(fieldValue);\n            else if (fieldName === 'maxZoom')\n                setMaxZoom(fieldValue);\n            else if (fieldName === 'translateExtent')\n                setTranslateExtent(fieldValue);\n            else if (fieldName === 'nodeExtent')\n                setNodeExtent(fieldValue);\n            else if (fieldName === 'ariaLabelConfig')\n                store.setState({ ariaLabelConfig: mergeAriaLabelConfig(fieldValue) });\n            // Renamed fields\n            else if (fieldName === 'fitView')\n                store.setState({ fitViewQueued: fieldValue });\n            else if (fieldName === 'fitViewOptions')\n                store.setState({ fitViewOptions: fieldValue });\n            // General case\n            else\n                store.setState({ [fieldName]: fieldValue });\n        }\n        previousFields.current = props;\n    }, \n    // Only re-run the effect if one of the fields we track changes\n    fieldsToTrack.map((fieldName) => props[fieldName]));\n    return null;\n}\n\nfunction getMediaQuery() {\n    if (typeof window === 'undefined' || !window.matchMedia) {\n        return null;\n    }\n    return window.matchMedia('(prefers-color-scheme: dark)');\n}\n/**\n * Hook for receiving the current color mode class 'dark' or 'light'.\n *\n * @internal\n * @param colorMode - The color mode to use ('dark', 'light' or 'system')\n */\nfunction useColorModeClass(colorMode) {\n    const [colorModeClass, setColorModeClass] = useState(colorMode === 'system' ? null : colorMode);\n    useEffect(() => {\n        if (colorMode !== 'system') {\n            setColorModeClass(colorMode);\n            return;\n        }\n        const mediaQuery = getMediaQuery();\n        const updateColorModeClass = () => setColorModeClass(mediaQuery?.matches ? 'dark' : 'light');\n        updateColorModeClass();\n        mediaQuery?.addEventListener('change', updateColorModeClass);\n        return () => {\n            mediaQuery?.removeEventListener('change', updateColorModeClass);\n        };\n    }, [colorMode]);\n    return colorModeClass !== null ? colorModeClass : getMediaQuery()?.matches ? 'dark' : 'light';\n}\n\nconst defaultDoc = typeof document !== 'undefined' ? document : null;\n/**\n * This hook lets you listen for specific key codes and tells you whether they are\n * currently pressed or not.\n *\n * @public\n * @param options - Options\n *\n * @example\n * ```tsx\n *import { useKeyPress } from '@xyflow/react';\n *\n *export default function () {\n *  const spacePressed = useKeyPress('Space');\n *  const cmdAndSPressed = useKeyPress(['Meta+s', 'Strg+s']);\n *\n *  return (\n *    <div>\n *     {spacePressed && <p>Space pressed!</p>}\n *     {cmdAndSPressed && <p>Cmd + S pressed!</p>}\n *    </div>\n *  );\n *}\n *```\n */\nfunction useKeyPress(\n/**\n * The key code (string or array of strings) specifies which key(s) should trigger\n * an action.\n *\n * A **string** can represent:\n * - A **single key**, e.g. `'a'`\n * - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'`\n *\n * An  **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']`\n * means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`.\n * @default null\n */\nkeyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true }) {\n    const [keyPressed, setKeyPressed] = useState(false);\n    // we need to remember if a modifier key is pressed in order to track it\n    const modifierPressed = useRef(false);\n    // we need to remember the pressed keys in order to support combinations\n    const pressedKeys = useRef(new Set([]));\n    /*\n     * keyCodes = array with single keys [['a']] or key combinations [['a', 's']]\n     * keysToWatch = array with all keys flattened ['a', 'd', 'ShiftLeft']\n     * used to check if we store event.code or event.key. When the code is in the list of keysToWatch\n     * we use the code otherwise the key. Explainer: When you press the left \"command\" key, the code is \"MetaLeft\"\n     * and the key is \"Meta\". We want users to be able to pass keys and codes so we assume that the key is meant when\n     * we can't find it in the list of keysToWatch.\n     */\n    const [keyCodes, keysToWatch] = useMemo(() => {\n        if (keyCode !== null) {\n            const keyCodeArr = Array.isArray(keyCode) ? keyCode : [keyCode];\n            const keys = keyCodeArr\n                .filter((kc) => typeof kc === 'string')\n                /*\n                 * we first replace all '+' with '\\n'  which we will use to split the keys on\n                 * then we replace '\\n\\n' with '\\n+', this way we can also support the combination 'key++'\n                 * in the end we simply split on '\\n' to get the key array\n                 */\n                .map((kc) => kc.replace('+', '\\n').replace('\\n\\n', '\\n+').split('\\n'));\n            const keysFlat = keys.reduce((res, item) => res.concat(...item), []);\n            return [keys, keysFlat];\n        }\n        return [[], []];\n    }, [keyCode]);\n    useEffect(() => {\n        const target = options?.target ?? defaultDoc;\n        const actInsideInputWithModifier = options?.actInsideInputWithModifier ?? true;\n        if (keyCode !== null) {\n            const downHandler = (event) => {\n                modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;\n                const preventAction = (!modifierPressed.current || (modifierPressed.current && !actInsideInputWithModifier)) &&\n                    isInputDOMNode(event);\n                if (preventAction) {\n                    return false;\n                }\n                const keyOrCode = useKeyOrCode(event.code, keysToWatch);\n                pressedKeys.current.add(event[keyOrCode]);\n                if (isMatchingKey(keyCodes, pressedKeys.current, false)) {\n                    const target = (event.composedPath?.()?.[0] || event.target);\n                    const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A';\n                    if (options.preventDefault !== false && (modifierPressed.current || !isInteractiveElement)) {\n                        event.preventDefault();\n                    }\n                    setKeyPressed(true);\n                }\n            };\n            const upHandler = (event) => {\n                const keyOrCode = useKeyOrCode(event.code, keysToWatch);\n                if (isMatchingKey(keyCodes, pressedKeys.current, true)) {\n                    setKeyPressed(false);\n                    pressedKeys.current.clear();\n                }\n                else {\n                    pressedKeys.current.delete(event[keyOrCode]);\n                }\n                // fix for Mac: when cmd key is pressed, keyup is not triggered for any other key, see: https://stackoverflow.com/questions/27380018/when-cmd-key-is-kept-pressed-keyup-is-not-triggered-for-any-other-key\n                if (event.key === 'Meta') {\n                    pressedKeys.current.clear();\n                }\n                modifierPressed.current = false;\n            };\n            const resetHandler = () => {\n                pressedKeys.current.clear();\n                setKeyPressed(false);\n            };\n            target?.addEventListener('keydown', downHandler);\n            target?.addEventListener('keyup', upHandler);\n            window.addEventListener('blur', resetHandler);\n            window.addEventListener('contextmenu', resetHandler);\n            return () => {\n                target?.removeEventListener('keydown', downHandler);\n                target?.removeEventListener('keyup', upHandler);\n                window.removeEventListener('blur', resetHandler);\n                window.removeEventListener('contextmenu', resetHandler);\n            };\n        }\n    }, [keyCode, setKeyPressed]);\n    return keyPressed;\n}\n// utils\nfunction isMatchingKey(keyCodes, pressedKeys, isUp) {\n    return (keyCodes\n        /*\n         * we only want to compare same sizes of keyCode definitions\n         * and pressed keys. When the user specified 'Meta' as a key somewhere\n         * this would also be truthy without this filter when user presses 'Meta' + 'r'\n         */\n        .filter((keys) => isUp || keys.length === pressedKeys.size)\n        /*\n         * since we want to support multiple possibilities only one of the\n         * combinations need to be part of the pressed keys\n         */\n        .some((keys) => keys.every((k) => pressedKeys.has(k))));\n}\nfunction useKeyOrCode(eventCode, keysToWatch) {\n    return keysToWatch.includes(eventCode) ? 'code' : 'key';\n}\n\n/**\n * Hook for getting viewport helper functions.\n *\n * @internal\n * @returns viewport helper functions\n */\nconst useViewportHelper = () => {\n    const store = useStoreApi();\n    return useMemo(() => {\n        return {\n            zoomIn: (options) => {\n                const { panZoom } = store.getState();\n                return panZoom ? panZoom.scaleBy(1.2, options) : Promise.resolve(false);\n            },\n            zoomOut: (options) => {\n                const { panZoom } = store.getState();\n                return panZoom ? panZoom.scaleBy(1 / 1.2, options) : Promise.resolve(false);\n            },\n            zoomTo: (zoomLevel, options) => {\n                const { panZoom } = store.getState();\n                return panZoom ? panZoom.scaleTo(zoomLevel, options) : Promise.resolve(false);\n            },\n            getZoom: () => store.getState().transform[2],\n            setViewport: async (viewport, options) => {\n                const { transform: [tX, tY, tZoom], panZoom, } = store.getState();\n                if (!panZoom) {\n                    return Promise.resolve(false);\n                }\n                await panZoom.setViewport({\n                    x: viewport.x ?? tX,\n                    y: viewport.y ?? tY,\n                    zoom: viewport.zoom ?? tZoom,\n                }, options);\n                return Promise.resolve(true);\n            },\n            getViewport: () => {\n                const [x, y, zoom] = store.getState().transform;\n                return { x, y, zoom };\n            },\n            setCenter: async (x, y, options) => {\n                return store.getState().setCenter(x, y, options);\n            },\n            fitBounds: async (bounds, options) => {\n                const { width, height, minZoom, maxZoom, panZoom } = store.getState();\n                const viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1);\n                if (!panZoom) {\n                    return Promise.resolve(false);\n                }\n                await panZoom.setViewport(viewport, {\n                    duration: options?.duration,\n                    ease: options?.ease,\n                    interpolate: options?.interpolate,\n                });\n                return Promise.resolve(true);\n            },\n            screenToFlowPosition: (clientPosition, options = {}) => {\n                const { transform, snapGrid, snapToGrid, domNode } = store.getState();\n                if (!domNode) {\n                    return clientPosition;\n                }\n                const { x: domX, y: domY } = domNode.getBoundingClientRect();\n                const correctedPosition = {\n                    x: clientPosition.x - domX,\n                    y: clientPosition.y - domY,\n                };\n                const _snapGrid = options.snapGrid ?? snapGrid;\n                const _snapToGrid = options.snapToGrid ?? snapToGrid;\n                return pointToRendererPoint(correctedPosition, transform, _snapToGrid, _snapGrid);\n            },\n            flowToScreenPosition: (flowPosition) => {\n                const { transform, domNode } = store.getState();\n                if (!domNode) {\n                    return flowPosition;\n                }\n                const { x: domX, y: domY } = domNode.getBoundingClientRect();\n                const rendererPosition = rendererPointToPoint(flowPosition, transform);\n                return {\n                    x: rendererPosition.x + domX,\n                    y: rendererPosition.y + domY,\n                };\n            },\n        };\n    }, []);\n};\n\n/*\n * This function applies changes to nodes or edges that are triggered by React Flow internally.\n * When you drag a node for example, React Flow will send a position change update.\n * This function then applies the changes and returns the updated elements.\n */\nfunction applyChanges(changes, elements) {\n    const updatedElements = [];\n    /*\n     * By storing a map of changes for each element, we can a quick lookup as we\n     * iterate over the elements array!\n     */\n    const changesMap = new Map();\n    const addItemChanges = [];\n    for (const change of changes) {\n        if (change.type === 'add') {\n            addItemChanges.push(change);\n            continue;\n        }\n        else if (change.type === 'remove' || change.type === 'replace') {\n            /*\n             * For a 'remove' change we can safely ignore any other changes queued for\n             * the same element, it's going to be removed anyway!\n             */\n            changesMap.set(change.id, [change]);\n        }\n        else {\n            const elementChanges = changesMap.get(change.id);\n            if (elementChanges) {\n                /*\n                 * If we have some changes queued already, we can do a mutable update of\n                 * that array and save ourselves some copying.\n                 */\n                elementChanges.push(change);\n            }\n            else {\n                changesMap.set(change.id, [change]);\n            }\n        }\n    }\n    for (const element of elements) {\n        const changes = changesMap.get(element.id);\n        /*\n         * When there are no changes for an element we can just push it unmodified,\n         * no need to copy it.\n         */\n        if (!changes) {\n            updatedElements.push(element);\n            continue;\n        }\n        // If we have a 'remove' change queued, it'll be the only change in the array\n        if (changes[0].type === 'remove') {\n            continue;\n        }\n        if (changes[0].type === 'replace') {\n            updatedElements.push({ ...changes[0].item });\n            continue;\n        }\n        /**\n         * For other types of changes, we want to start with a shallow copy of the\n         * object so React knows this element has changed. Sequential changes will\n         * each _mutate_ this object, so there's only ever one copy.\n         */\n        const updatedElement = { ...element };\n        for (const change of changes) {\n            applyChange(change, updatedElement);\n        }\n        updatedElements.push(updatedElement);\n    }\n    /*\n     * we need to wait for all changes to be applied before adding new items\n     * to be able to add them at the correct index\n     */\n    if (addItemChanges.length) {\n        addItemChanges.forEach((change) => {\n            if (change.index !== undefined) {\n                updatedElements.splice(change.index, 0, { ...change.item });\n            }\n            else {\n                updatedElements.push({ ...change.item });\n            }\n        });\n    }\n    return updatedElements;\n}\n// Applies a single change to an element. This is a *mutable* update.\nfunction applyChange(change, element) {\n    switch (change.type) {\n        case 'select': {\n            element.selected = change.selected;\n            break;\n        }\n        case 'position': {\n            if (typeof change.position !== 'undefined') {\n                element.position = change.position;\n            }\n            if (typeof change.dragging !== 'undefined') {\n                element.dragging = change.dragging;\n            }\n            break;\n        }\n        case 'dimensions': {\n            if (typeof change.dimensions !== 'undefined') {\n                element.measured = {\n                    ...change.dimensions,\n                };\n                if (change.setAttributes) {\n                    if (change.setAttributes === true || change.setAttributes === 'width') {\n                        element.width = change.dimensions.width;\n                    }\n                    if (change.setAttributes === true || change.setAttributes === 'height') {\n                        element.height = change.dimensions.height;\n                    }\n                }\n            }\n            if (typeof change.resizing === 'boolean') {\n                element.resizing = change.resizing;\n            }\n            break;\n        }\n    }\n}\n/**\n * Drop in function that applies node changes to an array of nodes.\n * @public\n * @param changes - Array of changes to apply.\n * @param nodes - Array of nodes to apply the changes to.\n * @returns Array of updated nodes.\n * @example\n *```tsx\n *import { useState, useCallback } from 'react';\n *import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react';\n *\n *export default function Flow() {\n *  const [nodes, setNodes] = useState<Node[]>([]);\n *  const [edges, setEdges] = useState<Edge[]>([]);\n *  const onNodesChange: OnNodesChange = useCallback(\n *    (changes) => {\n *      setNodes((oldNodes) => applyNodeChanges(changes, oldNodes));\n *    },\n *    [setNodes],\n *  );\n *\n *  return (\n *    <ReactFlow nodes={nodes} edges={edges} onNodesChange={onNodesChange} />\n *  );\n *}\n *```\n * @remarks Various events on the <ReactFlow /> component can produce an {@link NodeChange}\n * that describes how to update the edges of your flow in some way.\n * If you don't need any custom behaviour, this util can be used to take an array\n * of these changes and apply them to your edges.\n */\nfunction applyNodeChanges(changes, nodes) {\n    return applyChanges(changes, nodes);\n}\n/**\n * Drop in function that applies edge changes to an array of edges.\n * @public\n * @param changes - Array of changes to apply.\n * @param edges - Array of edge to apply the changes to.\n * @returns Array of updated edges.\n * @example\n * ```tsx\n *import { useState, useCallback } from 'react';\n *import { ReactFlow, applyEdgeChanges } from '@xyflow/react';\n *\n *export default function Flow() {\n *  const [nodes, setNodes] = useState([]);\n *  const [edges, setEdges] = useState([]);\n *  const onEdgesChange = useCallback(\n *    (changes) => {\n *      setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges));\n *    },\n *    [setEdges],\n *  );\n *\n *  return (\n *    <ReactFlow nodes={nodes} edges={edges} onEdgesChange={onEdgesChange} />\n *  );\n *}\n *```\n * @remarks Various events on the <ReactFlow /> component can produce an {@link EdgeChange}\n * that describes how to update the edges of your flow in some way.\n * If you don't need any custom behaviour, this util can be used to take an array\n * of these changes and apply them to your edges.\n */\nfunction applyEdgeChanges(changes, edges) {\n    return applyChanges(changes, edges);\n}\nfunction createSelectionChange(id, selected) {\n    return {\n        id,\n        type: 'select',\n        selected,\n    };\n}\nfunction getSelectionChanges(items, selectedIds = new Set(), mutateItem = false) {\n    const changes = [];\n    for (const [id, item] of items) {\n        const willBeSelected = selectedIds.has(id);\n        // we don't want to set all items to selected=false on the first selection\n        if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) {\n            if (mutateItem) {\n                /*\n                 * this hack is needed for nodes. When the user dragged a node, it's selected.\n                 * When another node gets dragged, we need to deselect the previous one,\n                 * in order to have only one selected node at a time - the onNodesChange callback comes too late here :/\n                 */\n                item.selected = willBeSelected;\n            }\n            changes.push(createSelectionChange(item.id, willBeSelected));\n        }\n    }\n    return changes;\n}\nfunction getElementsDiffChanges({ items = [], lookup, }) {\n    const changes = [];\n    const itemsLookup = new Map(items.map((item) => [item.id, item]));\n    for (const [index, item] of items.entries()) {\n        const lookupItem = lookup.get(item.id);\n        const storeItem = lookupItem?.internals?.userNode ?? lookupItem;\n        if (storeItem !== undefined && storeItem !== item) {\n            changes.push({ id: item.id, item: item, type: 'replace' });\n        }\n        if (storeItem === undefined) {\n            changes.push({ item: item, type: 'add', index });\n        }\n    }\n    for (const [id] of lookup) {\n        const nextNode = itemsLookup.get(id);\n        if (nextNode === undefined) {\n            changes.push({ id, type: 'remove' });\n        }\n    }\n    return changes;\n}\nfunction elementToRemoveChange(item) {\n    return {\n        id: item.id,\n        type: 'remove',\n    };\n}\n\n/**\n * Test whether an object is usable as an [`Node`](/api-reference/types/node).\n * In TypeScript this is a type guard that will narrow the type of whatever you pass in to\n * [`Node`](/api-reference/types/node) if it returns `true`.\n *\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test.\n * @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript,\n * this function acts as a type guard and will narrow the type of the value to `Node` if it returns\n * `true`.\n *\n * @example\n * ```js\n *import { isNode } from '@xyflow/react';\n *\n *if (isNode(node)) {\n * // ...\n *}\n *```\n */\nconst isNode = (element) => isNodeBase(element);\n/**\n * Test whether an object is usable as an [`Edge`](/api-reference/types/edge).\n * In TypeScript this is a type guard that will narrow the type of whatever you pass in to\n * [`Edge`](/api-reference/types/edge) if it returns `true`.\n *\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript,\n * this function acts as a type guard and will narrow the type of the value to `Edge` if it returns\n * `true`.\n *\n * @example\n * ```js\n *import { isEdge } from '@xyflow/react';\n *\n *if (isEdge(edge)) {\n * // ...\n *}\n *```\n */\nconst isEdge = (element) => isEdgeBase(element);\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nfunction fixedForwardRef(render) {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    return forwardRef(render);\n}\n\n/**\n * This hook returns a queue that can be used to batch updates.\n *\n * @param runQueue - a function that gets called when the queue is flushed\n * @internal\n *\n * @returns a Queue object\n */\nfunction useQueue(runQueue) {\n    /*\n     * Because we're using a ref above, we need some way to let React know when to\n     * actually process the queue. We increment this number any time we mutate the\n     * queue, creating a new state to trigger the layout effect below.\n     * Using a boolean dirty flag here instead would lead to issues related to\n     * automatic batching. (https://github.com/xyflow/xyflow/issues/4779)\n     */\n    const [serial, setSerial] = useState(BigInt(0));\n    /*\n     * A reference of all the batched updates to process before the next render. We\n     * want a reference here so multiple synchronous calls to `setNodes` etc can be\n     * batched together.\n     */\n    const [queue] = useState(() => createQueue(() => setSerial(n => n + BigInt(1))));\n    /*\n     * Layout effects are guaranteed to run before the next render which means we\n     * shouldn't run into any issues with stale state or weird issues that come from\n     * rendering things one frame later than expected (we used to use `setTimeout`).\n     */\n    useIsomorphicLayoutEffect(() => {\n        const queueItems = queue.get();\n        if (queueItems.length) {\n            runQueue(queueItems);\n            queue.reset();\n        }\n    }, [serial]);\n    return queue;\n}\nfunction createQueue(cb) {\n    let queue = [];\n    return {\n        get: () => queue,\n        reset: () => {\n            queue = [];\n        },\n        push: (item) => {\n            queue.push(item);\n            cb();\n        },\n    };\n}\n\nconst BatchContext = createContext(null);\n/**\n * This is a context provider that holds and processes the node and edge update queues\n * that are needed to handle setNodes, addNodes, setEdges and addEdges.\n *\n * @internal\n */\nfunction BatchProvider({ children, }) {\n    const store = useStoreApi();\n    const nodeQueueHandler = useCallback((queueItems) => {\n        const { nodes = [], setNodes, hasDefaultNodes, onNodesChange, nodeLookup, fitViewQueued, onNodesChangeMiddlewareMap, } = store.getState();\n        /*\n         * This is essentially an `Array.reduce` in imperative clothing. Processing\n         * this queue is a relatively hot path so we'd like to avoid the overhead of\n         * array methods where we can.\n         */\n        let next = nodes;\n        for (const payload of queueItems) {\n            next = typeof payload === 'function' ? payload(next) : payload;\n        }\n        let changes = getElementsDiffChanges({\n            items: next,\n            lookup: nodeLookup,\n        });\n        for (const middleware of onNodesChangeMiddlewareMap.values()) {\n            changes = middleware(changes);\n        }\n        if (hasDefaultNodes) {\n            setNodes(next);\n        }\n        // We only want to fire onNodesChange if there are changes to the nodes\n        if (changes.length > 0) {\n            onNodesChange?.(changes);\n        }\n        else if (fitViewQueued) {\n            // If there are no changes to the nodes, we still need to call setNodes\n            // to trigger a re-render and fitView.\n            window.requestAnimationFrame(() => {\n                const { fitViewQueued, nodes, setNodes } = store.getState();\n                if (fitViewQueued) {\n                    setNodes(nodes);\n                }\n            });\n        }\n    }, []);\n    const nodeQueue = useQueue(nodeQueueHandler);\n    const edgeQueueHandler = useCallback((queueItems) => {\n        const { edges = [], setEdges, hasDefaultEdges, onEdgesChange, edgeLookup } = store.getState();\n        let next = edges;\n        for (const payload of queueItems) {\n            next = typeof payload === 'function' ? payload(next) : payload;\n        }\n        if (hasDefaultEdges) {\n            setEdges(next);\n        }\n        else if (onEdgesChange) {\n            onEdgesChange(getElementsDiffChanges({\n                items: next,\n                lookup: edgeLookup,\n            }));\n        }\n    }, []);\n    const edgeQueue = useQueue(edgeQueueHandler);\n    const value = useMemo(() => ({ nodeQueue, edgeQueue }), []);\n    return jsx(BatchContext.Provider, { value: value, children: children });\n}\nfunction useBatchContext() {\n    const batchContext = useContext(BatchContext);\n    if (!batchContext) {\n        throw new Error('useBatchContext must be used within a BatchProvider');\n    }\n    return batchContext;\n}\n\nconst selector$k = (s) => !!s.panZoom;\n/**\n * This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow.\n *\n * @public\n * @example\n * ```jsx\n *import { useCallback, useState } from 'react';\n *import { useReactFlow } from '@xyflow/react';\n *\n *export function NodeCounter() {\n *  const reactFlow = useReactFlow();\n *  const [count, setCount] = useState(0);\n *  const countNodes = useCallback(() => {\n *    setCount(reactFlow.getNodes().length);\n *    // you need to pass it as a dependency if you are using it with useEffect or useCallback\n *    // because at the first render, it's not initialized yet and some functions might not work.\n *  }, [reactFlow]);\n *\n *  return (\n *    <div>\n *      <button onClick={countNodes}>Update count</button>\n *      <p>There are {count} nodes in the flow.</p>\n *    </div>\n *  );\n *}\n *```\n */\nfunction useReactFlow() {\n    const viewportHelper = useViewportHelper();\n    const store = useStoreApi();\n    const batchContext = useBatchContext();\n    const viewportInitialized = useStore(selector$k);\n    const generalHelper = useMemo(() => {\n        const getInternalNode = (id) => store.getState().nodeLookup.get(id);\n        const setNodes = (payload) => {\n            batchContext.nodeQueue.push(payload);\n        };\n        const setEdges = (payload) => {\n            batchContext.edgeQueue.push(payload);\n        };\n        const getNodeRect = (node) => {\n            const { nodeLookup, nodeOrigin } = store.getState();\n            const nodeToUse = isNode(node) ? node : nodeLookup.get(node.id);\n            const position = nodeToUse.parentId\n                ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin)\n                : nodeToUse.position;\n            const nodeWithPosition = {\n                ...nodeToUse,\n                position,\n                width: nodeToUse.measured?.width ?? nodeToUse.width,\n                height: nodeToUse.measured?.height ?? nodeToUse.height,\n            };\n            return nodeToRect(nodeWithPosition);\n        };\n        const updateNode = (id, nodeUpdate, options = { replace: false }) => {\n            setNodes((prevNodes) => prevNodes.map((node) => {\n                if (node.id === id) {\n                    const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n                    return options.replace && isNode(nextNode) ? nextNode : { ...node, ...nextNode };\n                }\n                return node;\n            }));\n        };\n        const updateEdge = (id, edgeUpdate, options = { replace: false }) => {\n            setEdges((prevEdges) => prevEdges.map((edge) => {\n                if (edge.id === id) {\n                    const nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge) : edgeUpdate;\n                    return options.replace && isEdge(nextEdge) ? nextEdge : { ...edge, ...nextEdge };\n                }\n                return edge;\n            }));\n        };\n        return {\n            getNodes: () => store.getState().nodes.map((n) => ({ ...n })),\n            getNode: (id) => getInternalNode(id)?.internals.userNode,\n            getInternalNode,\n            getEdges: () => {\n                const { edges = [] } = store.getState();\n                return edges.map((e) => ({ ...e }));\n            },\n            getEdge: (id) => store.getState().edgeLookup.get(id),\n            setNodes,\n            setEdges,\n            addNodes: (payload) => {\n                const newNodes = Array.isArray(payload) ? payload : [payload];\n                batchContext.nodeQueue.push((nodes) => [...nodes, ...newNodes]);\n            },\n            addEdges: (payload) => {\n                const newEdges = Array.isArray(payload) ? payload : [payload];\n                batchContext.edgeQueue.push((edges) => [...edges, ...newEdges]);\n            },\n            toObject: () => {\n                const { nodes = [], edges = [], transform } = store.getState();\n                const [x, y, zoom] = transform;\n                return {\n                    nodes: nodes.map((n) => ({ ...n })),\n                    edges: edges.map((e) => ({ ...e })),\n                    viewport: {\n                        x,\n                        y,\n                        zoom,\n                    },\n                };\n            },\n            deleteElements: async ({ nodes: nodesToRemove = [], edges: edgesToRemove = [] }) => {\n                const { nodes, edges, onNodesDelete, onEdgesDelete, triggerNodeChanges, triggerEdgeChanges, onDelete, onBeforeDelete, } = store.getState();\n                const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({\n                    nodesToRemove,\n                    edgesToRemove,\n                    nodes,\n                    edges,\n                    onBeforeDelete,\n                });\n                const hasMatchingEdges = matchingEdges.length > 0;\n                const hasMatchingNodes = matchingNodes.length > 0;\n                if (hasMatchingEdges) {\n                    const edgeChanges = matchingEdges.map(elementToRemoveChange);\n                    onEdgesDelete?.(matchingEdges);\n                    triggerEdgeChanges(edgeChanges);\n                }\n                if (hasMatchingNodes) {\n                    const nodeChanges = matchingNodes.map(elementToRemoveChange);\n                    onNodesDelete?.(matchingNodes);\n                    triggerNodeChanges(nodeChanges);\n                }\n                if (hasMatchingNodes || hasMatchingEdges) {\n                    onDelete?.({ nodes: matchingNodes, edges: matchingEdges });\n                }\n                return { deletedNodes: matchingNodes, deletedEdges: matchingEdges };\n            },\n            /**\n             * Partial is defined as \"the 2 nodes/areas are intersecting partially\".\n             * If a is contained in b or b is contained in a, they are both\n             * considered fully intersecting.\n             */\n            getIntersectingNodes: (nodeOrRect, partially = true, nodes) => {\n                const isRect = isRectObject(nodeOrRect);\n                const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n                const hasNodesOption = nodes !== undefined;\n                if (!nodeRect) {\n                    return [];\n                }\n                return (nodes || store.getState().nodes).filter((n) => {\n                    const internalNode = store.getState().nodeLookup.get(n.id);\n                    if (internalNode && !isRect && (n.id === nodeOrRect.id || !internalNode.internals.positionAbsolute)) {\n                        return false;\n                    }\n                    const currNodeRect = nodeToRect(hasNodesOption ? n : internalNode);\n                    const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n                    const partiallyVisible = partially && overlappingArea > 0;\n                    return (partiallyVisible ||\n                        overlappingArea >= currNodeRect.width * currNodeRect.height ||\n                        overlappingArea >= nodeRect.width * nodeRect.height);\n                });\n            },\n            isNodeIntersecting: (nodeOrRect, area, partially = true) => {\n                const isRect = isRectObject(nodeOrRect);\n                const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n                if (!nodeRect) {\n                    return false;\n                }\n                const overlappingArea = getOverlappingArea(nodeRect, area);\n                const partiallyVisible = partially && overlappingArea > 0;\n                return (partiallyVisible ||\n                    overlappingArea >= area.width * area.height ||\n                    overlappingArea >= nodeRect.width * nodeRect.height);\n            },\n            updateNode,\n            updateNodeData: (id, dataUpdate, options = { replace: false }) => {\n                updateNode(id, (node) => {\n                    const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n                    return options.replace ? { ...node, data: nextData } : { ...node, data: { ...node.data, ...nextData } };\n                }, options);\n            },\n            updateEdge,\n            updateEdgeData: (id, dataUpdate, options = { replace: false }) => {\n                updateEdge(id, (edge) => {\n                    const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate;\n                    return options.replace ? { ...edge, data: nextData } : { ...edge, data: { ...edge.data, ...nextData } };\n                }, options);\n            },\n            getNodesBounds: (nodes) => {\n                const { nodeLookup, nodeOrigin } = store.getState();\n                return getNodesBounds(nodes, { nodeLookup, nodeOrigin });\n            },\n            getHandleConnections: ({ type, id, nodeId }) => Array.from(store\n                .getState()\n                .connectionLookup.get(`${nodeId}-${type}${id ? `-${id}` : ''}`)\n                ?.values() ?? []),\n            getNodeConnections: ({ type, handleId, nodeId }) => Array.from(store\n                .getState()\n                .connectionLookup.get(`${nodeId}${type ? (handleId ? `-${type}-${handleId}` : `-${type}`) : ''}`)\n                ?.values() ?? []),\n            fitView: async (options) => {\n                // We either create a new Promise or reuse the existing one\n                // Even if fitView is called multiple times in a row, we only end up with a single Promise\n                const fitViewResolver = store.getState().fitViewResolver ?? withResolvers();\n                // We schedule a fitView by setting fitViewQueued and triggering a setNodes\n                store.setState({ fitViewQueued: true, fitViewOptions: options, fitViewResolver });\n                batchContext.nodeQueue.push((nodes) => [...nodes]);\n                return fitViewResolver.promise;\n            },\n        };\n    }, []);\n    return useMemo(() => {\n        return {\n            ...generalHelper,\n            ...viewportHelper,\n            viewportInitialized,\n        };\n    }, [viewportInitialized]);\n}\n\nconst selected = (item) => item.selected;\nconst win$1 = typeof window !== 'undefined' ? window : undefined;\n/**\n * Hook for handling global key events.\n *\n * @internal\n */\nfunction useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode, }) {\n    const store = useStoreApi();\n    const { deleteElements } = useReactFlow();\n    const deleteKeyPressed = useKeyPress(deleteKeyCode, { actInsideInputWithModifier: false });\n    const multiSelectionKeyPressed = useKeyPress(multiSelectionKeyCode, { target: win$1 });\n    useEffect(() => {\n        if (deleteKeyPressed) {\n            const { edges, nodes } = store.getState();\n            deleteElements({ nodes: nodes.filter(selected), edges: edges.filter(selected) });\n            store.setState({ nodesSelectionActive: false });\n        }\n    }, [deleteKeyPressed]);\n    useEffect(() => {\n        store.setState({ multiSelectionActive: multiSelectionKeyPressed });\n    }, [multiSelectionKeyPressed]);\n}\n\n/**\n * Hook for handling resize events.\n *\n * @internal\n */\nfunction useResizeHandler(domNode) {\n    const store = useStoreApi();\n    useEffect(() => {\n        const updateDimensions = () => {\n            if (!domNode.current || !(domNode.current.checkVisibility?.() ?? true)) {\n                return false;\n            }\n            const size = getDimensions(domNode.current);\n            if (size.height === 0 || size.width === 0) {\n                store.getState().onError?.('004', errorMessages['error004']());\n            }\n            store.setState({ width: size.width || 500, height: size.height || 500 });\n        };\n        if (domNode.current) {\n            updateDimensions();\n            window.addEventListener('resize', updateDimensions);\n            const resizeObserver = new ResizeObserver(() => updateDimensions());\n            resizeObserver.observe(domNode.current);\n            return () => {\n                window.removeEventListener('resize', updateDimensions);\n                if (resizeObserver && domNode.current) {\n                    resizeObserver.unobserve(domNode.current);\n                }\n            };\n        }\n    }, []);\n}\n\nconst containerStyle = {\n    position: 'absolute',\n    width: '100%',\n    height: '100%',\n    top: 0,\n    left: 0,\n};\n\nconst selector$j = (s) => ({\n    userSelectionActive: s.userSelectionActive,\n    lib: s.lib,\n    connectionInProgress: s.connection.inProgress,\n});\nfunction ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, defaultViewport, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = true, children, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, selectionOnDrag, }) {\n    const store = useStoreApi();\n    const zoomPane = useRef(null);\n    const { userSelectionActive, lib, connectionInProgress } = useStore(selector$j, shallow);\n    const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);\n    const panZoom = useRef();\n    useResizeHandler(zoomPane);\n    const onTransformChange = useCallback((transform) => {\n        onViewportChange?.({ x: transform[0], y: transform[1], zoom: transform[2] });\n        if (!isControlledViewport) {\n            store.setState({ transform });\n        }\n    }, [onViewportChange, isControlledViewport]);\n    useEffect(() => {\n        if (zoomPane.current) {\n            panZoom.current = XYPanZoom({\n                domNode: zoomPane.current,\n                minZoom,\n                maxZoom,\n                translateExtent,\n                viewport: defaultViewport,\n                onDraggingChange: (paneDragging) => store.setState((prevState) => prevState.paneDragging === paneDragging ? prevState : { paneDragging }),\n                onPanZoomStart: (event, vp) => {\n                    const { onViewportChangeStart, onMoveStart } = store.getState();\n                    onMoveStart?.(event, vp);\n                    onViewportChangeStart?.(vp);\n                },\n                onPanZoom: (event, vp) => {\n                    const { onViewportChange, onMove } = store.getState();\n                    onMove?.(event, vp);\n                    onViewportChange?.(vp);\n                },\n                onPanZoomEnd: (event, vp) => {\n                    const { onViewportChangeEnd, onMoveEnd } = store.getState();\n                    onMoveEnd?.(event, vp);\n                    onViewportChangeEnd?.(vp);\n                },\n            });\n            const { x, y, zoom } = panZoom.current.getViewport();\n            store.setState({\n                panZoom: panZoom.current,\n                transform: [x, y, zoom],\n                domNode: zoomPane.current.closest('.react-flow'),\n            });\n            return () => {\n                panZoom.current?.destroy();\n            };\n        }\n    }, []);\n    useEffect(() => {\n        panZoom.current?.update({\n            onPaneContextMenu,\n            zoomOnScroll,\n            zoomOnPinch,\n            panOnScroll,\n            panOnScrollSpeed,\n            panOnScrollMode,\n            zoomOnDoubleClick,\n            panOnDrag,\n            zoomActivationKeyPressed,\n            preventScrolling,\n            noPanClassName,\n            userSelectionActive,\n            noWheelClassName,\n            lib,\n            onTransformChange,\n            connectionInProgress,\n            selectionOnDrag,\n            paneClickDistance,\n        });\n    }, [\n        onPaneContextMenu,\n        zoomOnScroll,\n        zoomOnPinch,\n        panOnScroll,\n        panOnScrollSpeed,\n        panOnScrollMode,\n        zoomOnDoubleClick,\n        panOnDrag,\n        zoomActivationKeyPressed,\n        preventScrolling,\n        noPanClassName,\n        userSelectionActive,\n        noWheelClassName,\n        lib,\n        onTransformChange,\n        connectionInProgress,\n        selectionOnDrag,\n        paneClickDistance,\n    ]);\n    return (jsx(\"div\", { className: \"react-flow__renderer\", ref: zoomPane, style: containerStyle, children: children }));\n}\n\nconst selector$i = (s) => ({\n    userSelectionActive: s.userSelectionActive,\n    userSelectionRect: s.userSelectionRect,\n});\nfunction UserSelection() {\n    const { userSelectionActive, userSelectionRect } = useStore(selector$i, shallow);\n    const isActive = userSelectionActive && userSelectionRect;\n    if (!isActive) {\n        return null;\n    }\n    return (jsx(\"div\", { className: \"react-flow__selection react-flow__container\", style: {\n            width: userSelectionRect.width,\n            height: userSelectionRect.height,\n            transform: `translate(${userSelectionRect.x}px, ${userSelectionRect.y}px)`,\n        } }));\n}\n\nconst wrapHandler = (handler, containerRef) => {\n    return (event) => {\n        if (event.target !== containerRef.current) {\n            return;\n        }\n        handler?.(event);\n    };\n};\nconst selector$h = (s) => ({\n    userSelectionActive: s.userSelectionActive,\n    elementsSelectable: s.elementsSelectable,\n    connectionInProgress: s.connection.inProgress,\n    dragging: s.paneDragging,\n});\nfunction Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, paneClickDistance, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }) {\n    const store = useStoreApi();\n    const { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow);\n    const isSelectionEnabled = elementsSelectable && (isSelecting || userSelectionActive);\n    const container = useRef(null);\n    const containerBounds = useRef();\n    const selectedNodeIds = useRef(new Set());\n    const selectedEdgeIds = useRef(new Set());\n    // Used to prevent click events when the user lets go of the selectionKey during a selection\n    const selectionInProgress = useRef(false);\n    const onClick = (event) => {\n        // We prevent click events when the user let go of the selectionKey during a selection\n        // We also prevent click events when a connection is in progress\n        if (selectionInProgress.current || connectionInProgress) {\n            selectionInProgress.current = false;\n            return;\n        }\n        onPaneClick?.(event);\n        store.getState().resetSelectedElements();\n        store.setState({ nodesSelectionActive: false });\n    };\n    const onContextMenu = (event) => {\n        if (Array.isArray(panOnDrag) && panOnDrag?.includes(2)) {\n            event.preventDefault();\n            return;\n        }\n        onPaneContextMenu?.(event);\n    };\n    const onWheel = onPaneScroll ? (event) => onPaneScroll(event) : undefined;\n    const onClickCapture = (event) => {\n        if (selectionInProgress.current) {\n            event.stopPropagation();\n            selectionInProgress.current = false;\n        }\n    };\n    // We are using capture here in order to prevent other pointer events\n    // to be able to create a selection above a node or an edge\n    const onPointerDownCapture = (event) => {\n        const { domNode } = store.getState();\n        containerBounds.current = domNode?.getBoundingClientRect();\n        if (!containerBounds.current)\n            return;\n        const eventTargetIsContainer = event.target === container.current;\n        // if a child element has the 'nokey' class, we don't want to swallow the event and don't start a selection\n        const isNoKeyEvent = !eventTargetIsContainer && !!event.target.closest('.nokey');\n        const isSelectionActive = (selectionOnDrag && eventTargetIsContainer) || selectionKeyPressed;\n        if (isNoKeyEvent || !isSelecting || !isSelectionActive || event.button !== 0 || !event.isPrimary) {\n            return;\n        }\n        event.target?.setPointerCapture?.(event.pointerId);\n        selectionInProgress.current = false;\n        const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current);\n        store.setState({\n            userSelectionRect: {\n                width: 0,\n                height: 0,\n                startX: x,\n                startY: y,\n                x,\n                y,\n            },\n        });\n        if (!eventTargetIsContainer) {\n            event.stopPropagation();\n            event.preventDefault();\n        }\n    };\n    const onPointerMove = (event) => {\n        const { userSelectionRect, transform, nodeLookup, edgeLookup, connectionLookup, triggerNodeChanges, triggerEdgeChanges, defaultEdgeOptions, resetSelectedElements, } = store.getState();\n        if (!containerBounds.current || !userSelectionRect) {\n            return;\n        }\n        const { x: mouseX, y: mouseY } = getEventPosition(event.nativeEvent, containerBounds.current);\n        const { startX, startY } = userSelectionRect;\n        if (!selectionInProgress.current) {\n            const requiredDistance = selectionKeyPressed ? 0 : paneClickDistance;\n            const distance = Math.hypot(mouseX - startX, mouseY - startY);\n            if (distance <= requiredDistance) {\n                return;\n            }\n            resetSelectedElements();\n            onSelectionStart?.(event);\n        }\n        selectionInProgress.current = true;\n        const nextUserSelectRect = {\n            startX,\n            startY,\n            x: mouseX < startX ? mouseX : startX,\n            y: mouseY < startY ? mouseY : startY,\n            width: Math.abs(mouseX - startX),\n            height: Math.abs(mouseY - startY),\n        };\n        const prevSelectedNodeIds = selectedNodeIds.current;\n        const prevSelectedEdgeIds = selectedEdgeIds.current;\n        selectedNodeIds.current = new Set(getNodesInside(nodeLookup, nextUserSelectRect, transform, selectionMode === SelectionMode.Partial, true).map((node) => node.id));\n        selectedEdgeIds.current = new Set();\n        const edgesSelectable = defaultEdgeOptions?.selectable ?? true;\n        // We look for all edges connected to the selected nodes\n        for (const nodeId of selectedNodeIds.current) {\n            const connections = connectionLookup.get(nodeId);\n            if (!connections)\n                continue;\n            for (const { edgeId } of connections.values()) {\n                const edge = edgeLookup.get(edgeId);\n                if (edge && (edge.selectable ?? edgesSelectable)) {\n                    selectedEdgeIds.current.add(edgeId);\n                }\n            }\n        }\n        if (!areSetsEqual(prevSelectedNodeIds, selectedNodeIds.current)) {\n            const changes = getSelectionChanges(nodeLookup, selectedNodeIds.current, true);\n            triggerNodeChanges(changes);\n        }\n        if (!areSetsEqual(prevSelectedEdgeIds, selectedEdgeIds.current)) {\n            const changes = getSelectionChanges(edgeLookup, selectedEdgeIds.current);\n            triggerEdgeChanges(changes);\n        }\n        store.setState({\n            userSelectionRect: nextUserSelectRect,\n            userSelectionActive: true,\n            nodesSelectionActive: false,\n        });\n    };\n    const onPointerUp = (event) => {\n        if (event.button !== 0) {\n            return;\n        }\n        event.target?.releasePointerCapture?.(event.pointerId);\n        /*\n         * We only want to trigger click functions when in selection mode if\n         * the user did not move the mouse.\n         */\n        if (!userSelectionActive && event.target === container.current && store.getState().userSelectionRect) {\n            onClick?.(event);\n        }\n        store.setState({\n            userSelectionActive: false,\n            userSelectionRect: null,\n        });\n        if (selectionInProgress.current) {\n            onSelectionEnd?.(event);\n            store.setState({\n                nodesSelectionActive: selectedNodeIds.current.size > 0,\n            });\n        }\n    };\n    const draggable = panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0));\n    return (jsxs(\"div\", { className: cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }]), onClick: isSelectionEnabled ? undefined : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: isSelectionEnabled ? undefined : onPaneMouseEnter, onPointerMove: isSelectionEnabled ? onPointerMove : onPaneMouseMove, onPointerUp: isSelectionEnabled ? onPointerUp : undefined, onPointerDownCapture: isSelectionEnabled ? onPointerDownCapture : undefined, onClickCapture: isSelectionEnabled ? onClickCapture : undefined, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children, jsx(UserSelection, {})] }));\n}\n\n/*\n * this handler is called by\n * 1. the click handler when node is not draggable or selectNodesOnDrag = false\n * or\n * 2. the on drag start handler when node is draggable and selectNodesOnDrag = true\n */\nfunction handleNodeClick({ id, store, unselect = false, nodeRef, }) {\n    const { addSelectedNodes, unselectNodesAndEdges, multiSelectionActive, nodeLookup, onError } = store.getState();\n    const node = nodeLookup.get(id);\n    if (!node) {\n        onError?.('012', errorMessages['error012'](id));\n        return;\n    }\n    store.setState({ nodesSelectionActive: false });\n    if (!node.selected) {\n        addSelectedNodes([id]);\n    }\n    else if (unselect || (node.selected && multiSelectionActive)) {\n        unselectNodesAndEdges({ nodes: [node], edges: [] });\n        requestAnimationFrame(() => nodeRef?.current?.blur());\n    }\n}\n\n/**\n * Hook for calling XYDrag helper from @xyflow/system.\n *\n * @internal\n */\nfunction useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, nodeId, isSelectable, nodeClickDistance, }) {\n    const store = useStoreApi();\n    const [dragging, setDragging] = useState(false);\n    const xyDrag = useRef();\n    useEffect(() => {\n        xyDrag.current = XYDrag({\n            getStoreItems: () => store.getState(),\n            onNodeMouseDown: (id) => {\n                handleNodeClick({\n                    id,\n                    store,\n                    nodeRef,\n                });\n            },\n            onDragStart: () => {\n                setDragging(true);\n            },\n            onDragStop: () => {\n                setDragging(false);\n            },\n        });\n    }, []);\n    useEffect(() => {\n        if (disabled || !nodeRef.current || !xyDrag.current) {\n            return;\n        }\n        xyDrag.current.update({\n            noDragClassName,\n            handleSelector,\n            domNode: nodeRef.current,\n            isSelectable,\n            nodeId,\n            nodeClickDistance,\n        });\n        return () => {\n            xyDrag.current?.destroy();\n        };\n    }, [noDragClassName, handleSelector, disabled, isSelectable, nodeRef, nodeId, nodeClickDistance]);\n    return dragging;\n}\n\nconst selectedAndDraggable = (nodesDraggable) => (n) => n.selected && (n.draggable || (nodesDraggable && typeof n.draggable === 'undefined'));\n/**\n * Hook for updating node positions by passing a direction and factor\n *\n * @internal\n * @returns function for updating node positions\n */\nfunction useMoveSelectedNodes() {\n    const store = useStoreApi();\n    const moveSelectedNodes = useCallback((params) => {\n        const { nodeExtent, snapToGrid, snapGrid, nodesDraggable, onError, updateNodePositions, nodeLookup, nodeOrigin } = store.getState();\n        const nodeUpdates = new Map();\n        const isSelected = selectedAndDraggable(nodesDraggable);\n        /*\n         * by default a node moves 5px on each key press\n         * if snap grid is enabled, we use that for the velocity\n         */\n        const xVelo = snapToGrid ? snapGrid[0] : 5;\n        const yVelo = snapToGrid ? snapGrid[1] : 5;\n        const xDiff = params.direction.x * xVelo * params.factor;\n        const yDiff = params.direction.y * yVelo * params.factor;\n        for (const [, node] of nodeLookup) {\n            if (!isSelected(node)) {\n                continue;\n            }\n            let nextPosition = {\n                x: node.internals.positionAbsolute.x + xDiff,\n                y: node.internals.positionAbsolute.y + yDiff,\n            };\n            if (snapToGrid) {\n                nextPosition = snapPosition(nextPosition, snapGrid);\n            }\n            const { position, positionAbsolute } = calculateNodePosition({\n                nodeId: node.id,\n                nextPosition,\n                nodeLookup,\n                nodeExtent,\n                nodeOrigin,\n                onError,\n            });\n            node.position = position;\n            node.internals.positionAbsolute = positionAbsolute;\n            nodeUpdates.set(node.id, node);\n        }\n        updateNodePositions(nodeUpdates);\n    }, []);\n    return moveSelectedNodes;\n}\n\nconst NodeIdContext = createContext(null);\nconst Provider = NodeIdContext.Provider;\nNodeIdContext.Consumer;\n/**\n * You can use this hook to get the id of the node it is used inside. It is useful\n * if you need the node's id deeper in the render tree but don't want to manually\n * drill down the id as a prop.\n *\n * @public\n * @returns The id for a node in the flow.\n *\n * @example\n *```jsx\n *import { useNodeId } from '@xyflow/react';\n *\n *export default function CustomNode() {\n *  return (\n *    <div>\n *      <span>This node has an id of </span>\n *      <NodeIdDisplay />\n *    </div>\n *  );\n *}\n *\n *function NodeIdDisplay() {\n *  const nodeId = useNodeId();\n *\n *  return <span>{nodeId}</span>;\n *}\n *```\n */\nconst useNodeId = () => {\n    const nodeId = useContext(NodeIdContext);\n    return nodeId;\n};\n\nconst selector$g = (s) => ({\n    connectOnClick: s.connectOnClick,\n    noPanClassName: s.noPanClassName,\n    rfId: s.rfId,\n});\nconst connectingSelector = (nodeId, handleId, type) => (state) => {\n    const { connectionClickStartHandle: clickHandle, connectionMode, connection } = state;\n    const { fromHandle, toHandle, isValid } = connection;\n    const connectingTo = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === type;\n    return {\n        connectingFrom: fromHandle?.nodeId === nodeId && fromHandle?.id === handleId && fromHandle?.type === type,\n        connectingTo,\n        clickConnecting: clickHandle?.nodeId === nodeId && clickHandle?.id === handleId && clickHandle?.type === type,\n        isPossibleEndHandle: connectionMode === ConnectionMode.Strict\n            ? fromHandle?.type !== type\n            : nodeId !== fromHandle?.nodeId || handleId !== fromHandle?.id,\n        connectionInProcess: !!fromHandle,\n        clickConnectionInProcess: !!clickHandle,\n        valid: connectingTo && isValid,\n    };\n};\nfunction HandleComponent({ type = 'source', position = Position.Top, isValidConnection, isConnectable = true, isConnectableStart = true, isConnectableEnd = true, id, onConnect, children, className, onMouseDown, onTouchStart, ...rest }, ref) {\n    const handleId = id || null;\n    const isTarget = type === 'target';\n    const store = useStoreApi();\n    const nodeId = useNodeId();\n    const { connectOnClick, noPanClassName, rfId } = useStore(selector$g, shallow);\n    const { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, clickConnectionInProcess, valid, } = useStore(connectingSelector(nodeId, handleId, type), shallow);\n    if (!nodeId) {\n        store.getState().onError?.('010', errorMessages['error010']());\n    }\n    const onConnectExtended = (params) => {\n        const { defaultEdgeOptions, onConnect: onConnectAction, hasDefaultEdges } = store.getState();\n        const edgeParams = {\n            ...defaultEdgeOptions,\n            ...params,\n        };\n        if (hasDefaultEdges) {\n            const { edges, setEdges } = store.getState();\n            setEdges(addEdge(edgeParams, edges));\n        }\n        onConnectAction?.(edgeParams);\n        onConnect?.(edgeParams);\n    };\n    const onPointerDown = (event) => {\n        if (!nodeId) {\n            return;\n        }\n        const isMouseTriggered = isMouseEvent(event.nativeEvent);\n        if (isConnectableStart &&\n            ((isMouseTriggered && event.button === 0) || !isMouseTriggered)) {\n            const currentStore = store.getState();\n            XYHandle.onPointerDown(event.nativeEvent, {\n                handleDomNode: event.currentTarget,\n                autoPanOnConnect: currentStore.autoPanOnConnect,\n                connectionMode: currentStore.connectionMode,\n                connectionRadius: currentStore.connectionRadius,\n                domNode: currentStore.domNode,\n                nodeLookup: currentStore.nodeLookup,\n                lib: currentStore.lib,\n                isTarget,\n                handleId,\n                nodeId,\n                flowId: currentStore.rfId,\n                panBy: currentStore.panBy,\n                cancelConnection: currentStore.cancelConnection,\n                onConnectStart: currentStore.onConnectStart,\n                onConnectEnd: (...args) => store.getState().onConnectEnd?.(...args),\n                updateConnection: currentStore.updateConnection,\n                onConnect: onConnectExtended,\n                isValidConnection: isValidConnection || ((...args) => store.getState().isValidConnection?.(...args) ?? true),\n                getTransform: () => store.getState().transform,\n                getFromHandle: () => store.getState().connection.fromHandle,\n                autoPanSpeed: currentStore.autoPanSpeed,\n                dragThreshold: currentStore.connectionDragThreshold,\n            });\n        }\n        if (isMouseTriggered) {\n            onMouseDown?.(event);\n        }\n        else {\n            onTouchStart?.(event);\n        }\n    };\n    const onClick = (event) => {\n        const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, nodeLookup, connection: connectionState, } = store.getState();\n        if (!nodeId || (!connectionClickStartHandle && !isConnectableStart)) {\n            return;\n        }\n        if (!connectionClickStartHandle) {\n            onClickConnectStart?.(event.nativeEvent, { nodeId, handleId, handleType: type });\n            store.setState({ connectionClickStartHandle: { nodeId, type, id: handleId } });\n            return;\n        }\n        const doc = getHostForElement(event.target);\n        const isValidConnectionHandler = isValidConnection || isValidConnectionStore;\n        const { connection, isValid } = XYHandle.isValid(event.nativeEvent, {\n            handle: {\n                nodeId,\n                id: handleId,\n                type,\n            },\n            connectionMode,\n            fromNodeId: connectionClickStartHandle.nodeId,\n            fromHandleId: connectionClickStartHandle.id || null,\n            fromType: connectionClickStartHandle.type,\n            isValidConnection: isValidConnectionHandler,\n            flowId,\n            doc,\n            lib,\n            nodeLookup,\n        });\n        if (isValid && connection) {\n            onConnectExtended(connection);\n        }\n        const connectionClone = structuredClone(connectionState);\n        delete connectionClone.inProgress;\n        connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;\n        onClickConnectEnd?.(event, connectionClone);\n        store.setState({ connectionClickStartHandle: null });\n    };\n    return (jsx(\"div\", { \"data-handleid\": handleId, \"data-nodeid\": nodeId, \"data-handlepos\": position, \"data-id\": `${rfId}-${nodeId}-${handleId}-${type}`, className: cc([\n            'react-flow__handle',\n            `react-flow__handle-${position}`,\n            'nodrag',\n            noPanClassName,\n            className,\n            {\n                source: !isTarget,\n                target: isTarget,\n                connectable: isConnectable,\n                connectablestart: isConnectableStart,\n                connectableend: isConnectableEnd,\n                clickconnecting: clickConnecting,\n                connectingfrom: connectingFrom,\n                connectingto: connectingTo,\n                valid,\n                /*\n                 * shows where you can start a connection from\n                 * and where you can end it while connecting\n                 */\n                connectionindicator: isConnectable &&\n                    (!connectionInProcess || isPossibleEndHandle) &&\n                    (connectionInProcess || clickConnectionInProcess ? isConnectableEnd : isConnectableStart),\n            },\n        ]), onMouseDown: onPointerDown, onTouchStart: onPointerDown, onClick: connectOnClick ? onClick : undefined, ref: ref, ...rest, children: children }));\n}\n/**\n * The `<Handle />` component is used in your [custom nodes](/learn/customization/custom-nodes)\n * to define connection points.\n *\n *@public\n *\n *@example\n *\n *```jsx\n *import { Handle, Position } from '@xyflow/react';\n *\n *export function CustomNode({ data }) {\n *  return (\n *    <>\n *      <div style={{ padding: '10px 20px' }}>\n *        {data.label}\n *      </div>\n *\n *      <Handle type=\"target\" position={Position.Left} />\n *      <Handle type=\"source\" position={Position.Right} />\n *    </>\n *  );\n *};\n *```\n */\nconst Handle = memo(fixedForwardRef(HandleComponent));\n\nfunction InputNode({ data, isConnectable, sourcePosition = Position.Bottom }) {\n    return (jsxs(Fragment, { children: [data?.label, jsx(Handle, { type: \"source\", position: sourcePosition, isConnectable: isConnectable })] }));\n}\n\nfunction DefaultNode({ data, isConnectable, targetPosition = Position.Top, sourcePosition = Position.Bottom, }) {\n    return (jsxs(Fragment, { children: [jsx(Handle, { type: \"target\", position: targetPosition, isConnectable: isConnectable }), data?.label, jsx(Handle, { type: \"source\", position: sourcePosition, isConnectable: isConnectable })] }));\n}\n\nfunction GroupNode() {\n    return null;\n}\n\nfunction OutputNode({ data, isConnectable, targetPosition = Position.Top }) {\n    return (jsxs(Fragment, { children: [jsx(Handle, { type: \"target\", position: targetPosition, isConnectable: isConnectable }), data?.label] }));\n}\n\nconst arrowKeyDiffs = {\n    ArrowUp: { x: 0, y: -1 },\n    ArrowDown: { x: 0, y: 1 },\n    ArrowLeft: { x: -1, y: 0 },\n    ArrowRight: { x: 1, y: 0 },\n};\nconst builtinNodeTypes = {\n    input: InputNode,\n    default: DefaultNode,\n    output: OutputNode,\n    group: GroupNode,\n};\nfunction getNodeInlineStyleDimensions(node) {\n    if (node.internals.handleBounds === undefined) {\n        return {\n            width: node.width ?? node.initialWidth ?? node.style?.width,\n            height: node.height ?? node.initialHeight ?? node.style?.height,\n        };\n    }\n    return {\n        width: node.width ?? node.style?.width,\n        height: node.height ?? node.style?.height,\n    };\n}\n\nconst selector$f = (s) => {\n    const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, {\n        filter: (node) => !!node.selected,\n    });\n    return {\n        width: isNumeric(width) ? width : null,\n        height: isNumeric(height) ? height : null,\n        userSelectionActive: s.userSelectionActive,\n        transformString: `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]}) translate(${x}px,${y}px)`,\n    };\n};\nfunction NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }) {\n    const store = useStoreApi();\n    const { width, height, transformString, userSelectionActive } = useStore(selector$f, shallow);\n    const moveSelectedNodes = useMoveSelectedNodes();\n    const nodeRef = useRef(null);\n    useEffect(() => {\n        if (!disableKeyboardA11y) {\n            nodeRef.current?.focus({\n                preventScroll: true,\n            });\n        }\n    }, [disableKeyboardA11y]);\n    const shouldRender = !userSelectionActive && width !== null && height !== null;\n    useDrag({\n        nodeRef,\n        disabled: !shouldRender,\n    });\n    if (!shouldRender) {\n        return null;\n    }\n    const onContextMenu = onSelectionContextMenu\n        ? (event) => {\n            const selectedNodes = store.getState().nodes.filter((n) => n.selected);\n            onSelectionContextMenu(event, selectedNodes);\n        }\n        : undefined;\n    const onKeyDown = (event) => {\n        if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {\n            event.preventDefault();\n            moveSelectedNodes({\n                direction: arrowKeyDiffs[event.key],\n                factor: event.shiftKey ? 4 : 1,\n            });\n        }\n    };\n    return (jsx(\"div\", { className: cc(['react-flow__nodesselection', 'react-flow__container', noPanClassName]), style: {\n            transform: transformString,\n        }, children: jsx(\"div\", { ref: nodeRef, className: \"react-flow__nodesselection-rect\", onContextMenu: onContextMenu, tabIndex: disableKeyboardA11y ? undefined : -1, onKeyDown: disableKeyboardA11y ? undefined : onKeyDown, style: {\n                width,\n                height,\n            } }) }));\n}\n\nconst win = typeof window !== 'undefined' ? window : undefined;\nconst selector$e = (s) => {\n    return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive };\n};\nfunction FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }) {\n    const { nodesSelectionActive, userSelectionActive } = useStore(selector$e, shallow);\n    const selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win });\n    const panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win });\n    const panOnDrag = panActivationKeyPressed || _panOnDrag;\n    const panOnScroll = panActivationKeyPressed || _panOnScroll;\n    const _selectionOnDrag = selectionOnDrag && panOnDrag !== true;\n    const isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag;\n    useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode });\n    return (jsx(ZoomPane, { onPaneContextMenu: onPaneContextMenu, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, zoomOnDoubleClick: zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, zoomActivationKeyCode: zoomActivationKeyCode, preventScrolling: preventScrolling, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, onViewportChange: onViewportChange, isControlledViewport: isControlledViewport, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: jsxs(Pane, { onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, panOnDrag: panOnDrag, isSelecting: !!isSelecting, selectionMode: selectionMode, selectionKeyPressed: selectionKeyPressed, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: [children, nodesSelectionActive && (jsx(NodesSelection, { onSelectionContextMenu: onSelectionContextMenu, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y }))] }) }));\n}\nFlowRendererComponent.displayName = 'FlowRenderer';\nconst FlowRenderer = memo(FlowRendererComponent);\n\nconst selector$d = (onlyRenderVisible) => (s) => {\n    return onlyRenderVisible\n        ? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true).map((node) => node.id)\n        : Array.from(s.nodeLookup.keys());\n};\n/**\n * Hook for getting the visible node ids from the store.\n *\n * @internal\n * @param onlyRenderVisible\n * @returns array with visible node ids\n */\nfunction useVisibleNodeIds(onlyRenderVisible) {\n    const nodeIds = useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow);\n    return nodeIds;\n}\n\nconst selector$c = (s) => s.updateNodeInternals;\nfunction useResizeObserver() {\n    const updateNodeInternals = useStore(selector$c);\n    const [resizeObserver] = useState(() => {\n        if (typeof ResizeObserver === 'undefined') {\n            return null;\n        }\n        return new ResizeObserver((entries) => {\n            const updates = new Map();\n            entries.forEach((entry) => {\n                const id = entry.target.getAttribute('data-id');\n                updates.set(id, {\n                    id,\n                    nodeElement: entry.target,\n                    force: true,\n                });\n            });\n            updateNodeInternals(updates);\n        });\n    });\n    useEffect(() => {\n        return () => {\n            resizeObserver?.disconnect();\n        };\n    }, [resizeObserver]);\n    return resizeObserver;\n}\n\n/**\n * Hook to handle the resize observation + internal updates for the passed node.\n *\n * @internal\n * @returns nodeRef - reference to the node element\n */\nfunction useNodeObserver({ node, nodeType, hasDimensions, resizeObserver, }) {\n    const store = useStoreApi();\n    const nodeRef = useRef(null);\n    const observedNode = useRef(null);\n    const prevSourcePosition = useRef(node.sourcePosition);\n    const prevTargetPosition = useRef(node.targetPosition);\n    const prevType = useRef(nodeType);\n    const isInitialized = hasDimensions && !!node.internals.handleBounds;\n    useEffect(() => {\n        if (nodeRef.current && !node.hidden && (!isInitialized || observedNode.current !== nodeRef.current)) {\n            if (observedNode.current) {\n                resizeObserver?.unobserve(observedNode.current);\n            }\n            resizeObserver?.observe(nodeRef.current);\n            observedNode.current = nodeRef.current;\n        }\n    }, [isInitialized, node.hidden]);\n    useEffect(() => {\n        return () => {\n            if (observedNode.current) {\n                resizeObserver?.unobserve(observedNode.current);\n                observedNode.current = null;\n            }\n        };\n    }, []);\n    useEffect(() => {\n        if (nodeRef.current) {\n            /*\n             * when the user programmatically changes the source or handle position, we need to update the internals\n             * to make sure the edges are updated correctly\n             */\n            const typeChanged = prevType.current !== nodeType;\n            const sourcePosChanged = prevSourcePosition.current !== node.sourcePosition;\n            const targetPosChanged = prevTargetPosition.current !== node.targetPosition;\n            if (typeChanged || sourcePosChanged || targetPosChanged) {\n                prevType.current = nodeType;\n                prevSourcePosition.current = node.sourcePosition;\n                prevTargetPosition.current = node.targetPosition;\n                store\n                    .getState()\n                    .updateNodeInternals(new Map([[node.id, { id: node.id, nodeElement: nodeRef.current, force: true }]]));\n            }\n        }\n    }, [node.id, nodeType, node.sourcePosition, node.targetPosition]);\n    return nodeRef;\n}\n\nfunction NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError, }) {\n    const { node, internals, isParent } = useStore((s) => {\n        const node = s.nodeLookup.get(id);\n        const isParent = s.parentLookup.has(id);\n        return {\n            node,\n            internals: node.internals,\n            isParent,\n        };\n    }, shallow);\n    let nodeType = node.type || 'default';\n    let NodeComponent = nodeTypes?.[nodeType] || builtinNodeTypes[nodeType];\n    if (NodeComponent === undefined) {\n        onError?.('003', errorMessages['error003'](nodeType));\n        nodeType = 'default';\n        NodeComponent = nodeTypes?.['default'] || builtinNodeTypes.default;\n    }\n    const isDraggable = !!(node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'));\n    const isSelectable = !!(node.selectable || (elementsSelectable && typeof node.selectable === 'undefined'));\n    const isConnectable = !!(node.connectable || (nodesConnectable && typeof node.connectable === 'undefined'));\n    const isFocusable = !!(node.focusable || (nodesFocusable && typeof node.focusable === 'undefined'));\n    const store = useStoreApi();\n    const hasDimensions = nodeHasDimensions(node);\n    const nodeRef = useNodeObserver({ node, nodeType, hasDimensions, resizeObserver });\n    const dragging = useDrag({\n        nodeRef,\n        disabled: node.hidden || !isDraggable,\n        noDragClassName,\n        handleSelector: node.dragHandle,\n        nodeId: id,\n        isSelectable,\n        nodeClickDistance,\n    });\n    const moveSelectedNodes = useMoveSelectedNodes();\n    if (node.hidden) {\n        return null;\n    }\n    const nodeDimensions = getNodeDimensions(node);\n    const inlineDimensions = getNodeInlineStyleDimensions(node);\n    const hasPointerEvents = isSelectable || isDraggable || onClick || onMouseEnter || onMouseMove || onMouseLeave;\n    const onMouseEnterHandler = onMouseEnter\n        ? (event) => onMouseEnter(event, { ...internals.userNode })\n        : undefined;\n    const onMouseMoveHandler = onMouseMove\n        ? (event) => onMouseMove(event, { ...internals.userNode })\n        : undefined;\n    const onMouseLeaveHandler = onMouseLeave\n        ? (event) => onMouseLeave(event, { ...internals.userNode })\n        : undefined;\n    const onContextMenuHandler = onContextMenu\n        ? (event) => onContextMenu(event, { ...internals.userNode })\n        : undefined;\n    const onDoubleClickHandler = onDoubleClick\n        ? (event) => onDoubleClick(event, { ...internals.userNode })\n        : undefined;\n    const onSelectNodeHandler = (event) => {\n        const { selectNodesOnDrag, nodeDragThreshold } = store.getState();\n        if (isSelectable && (!selectNodesOnDrag || !isDraggable || nodeDragThreshold > 0)) {\n            /*\n             * this handler gets called by XYDrag on drag start when selectNodesOnDrag=true\n             * here we only need to call it when selectNodesOnDrag=false\n             */\n            handleNodeClick({\n                id,\n                store,\n                nodeRef,\n            });\n        }\n        if (onClick) {\n            onClick(event, { ...internals.userNode });\n        }\n    };\n    const onKeyDown = (event) => {\n        if (isInputDOMNode(event.nativeEvent) || disableKeyboardA11y) {\n            return;\n        }\n        if (elementSelectionKeys.includes(event.key) && isSelectable) {\n            const unselect = event.key === 'Escape';\n            handleNodeClick({\n                id,\n                store,\n                unselect,\n                nodeRef,\n            });\n        }\n        else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {\n            // prevent default scrolling behavior on arrow key press when node is moved\n            event.preventDefault();\n            const { ariaLabelConfig } = store.getState();\n            store.setState({\n                ariaLiveMessage: ariaLabelConfig['node.a11yDescription.ariaLiveMessage']({\n                    direction: event.key.replace('Arrow', '').toLowerCase(),\n                    x: ~~internals.positionAbsolute.x,\n                    y: ~~internals.positionAbsolute.y,\n                }),\n            });\n            moveSelectedNodes({\n                direction: arrowKeyDiffs[event.key],\n                factor: event.shiftKey ? 4 : 1,\n            });\n        }\n    };\n    const onFocus = () => {\n        if (disableKeyboardA11y || !nodeRef.current?.matches(':focus-visible')) {\n            return;\n        }\n        const { transform, width, height, autoPanOnNodeFocus, setCenter } = store.getState();\n        if (!autoPanOnNodeFocus) {\n            return;\n        }\n        const withinViewport = getNodesInside(new Map([[id, node]]), { x: 0, y: 0, width, height }, transform, true).length > 0;\n        if (!withinViewport) {\n            setCenter(node.position.x + nodeDimensions.width / 2, node.position.y + nodeDimensions.height / 2, {\n                zoom: transform[2],\n            });\n        }\n    };\n    return (jsx(\"div\", { className: cc([\n            'react-flow__node',\n            `react-flow__node-${nodeType}`,\n            {\n                // this is overwritable by passing `nopan` as a class name\n                [noPanClassName]: isDraggable,\n            },\n            node.className,\n            {\n                selected: node.selected,\n                selectable: isSelectable,\n                parent: isParent,\n                draggable: isDraggable,\n                dragging,\n            },\n        ]), ref: nodeRef, style: {\n            zIndex: internals.z,\n            transform: `translate(${internals.positionAbsolute.x}px,${internals.positionAbsolute.y}px)`,\n            pointerEvents: hasPointerEvents ? 'all' : 'none',\n            visibility: hasDimensions ? 'visible' : 'hidden',\n            ...node.style,\n            ...inlineDimensions,\n        }, \"data-id\": id, \"data-testid\": `rf__node-${id}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, onFocus: isFocusable ? onFocus : undefined, role: node.ariaRole ?? (isFocusable ? 'group' : undefined), \"aria-roledescription\": \"node\", \"aria-describedby\": disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${rfId}`, \"aria-label\": node.ariaLabel, ...node.domAttributes, children: jsx(Provider, { value: id, children: jsx(NodeComponent, { id: id, data: node.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node.selected ?? false, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? true, isConnectable: isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging: dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) }));\n}\nvar NodeWrapper$1 = memo(NodeWrapper);\n\nconst selector$b = (s) => ({\n    nodesDraggable: s.nodesDraggable,\n    nodesConnectable: s.nodesConnectable,\n    nodesFocusable: s.nodesFocusable,\n    elementsSelectable: s.elementsSelectable,\n    onError: s.onError,\n});\nfunction NodeRendererComponent(props) {\n    const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow);\n    const nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements);\n    const resizeObserver = useResizeObserver();\n    return (jsx(\"div\", { className: \"react-flow__nodes\", style: containerStyle, children: nodeIds.map((nodeId) => {\n            return (\n            /*\n             * The split of responsibilities between NodeRenderer and\n             * NodeComponentWrapper may appear weird. However, it’s designed to\n             * minimize the cost of updates when individual nodes change.\n             *\n             * For example, when you’re dragging a single node, that node gets\n             * updated multiple times per second. If `NodeRenderer` were to update\n             * every time, it would have to re-run the `nodes.map()` loop every\n             * time. This gets pricey with hundreds of nodes, especially if every\n             * loop cycle does more than just rendering a JSX element!\n             *\n             * As a result of this choice, we took the following implementation\n             * decisions:\n             * - NodeRenderer subscribes *only* to node IDs – and therefore\n             *   rerender *only* when visible nodes are added or removed.\n             * - NodeRenderer performs all operations the result of which can be\n             *   shared between nodes (such as creating the `ResizeObserver`\n             *   instance, or subscribing to `selector`). This means extra prop\n             *   drilling into `NodeComponentWrapper`, but it means we need to run\n             *   these operations only once – instead of once per node.\n             * - Any operations that you’d normally write inside `nodes.map` are\n             *   moved into `NodeComponentWrapper`. This ensures they are\n             *   memorized – so if `NodeRenderer` *has* to rerender, it only\n             *   needs to regenerate the list of nodes, nothing else.\n             */\n            jsx(NodeWrapper$1, { id: nodeId, nodeTypes: props.nodeTypes, nodeExtent: props.nodeExtent, onClick: props.onNodeClick, onMouseEnter: props.onNodeMouseEnter, onMouseMove: props.onNodeMouseMove, onMouseLeave: props.onNodeMouseLeave, onContextMenu: props.onNodeContextMenu, onDoubleClick: props.onNodeDoubleClick, noDragClassName: props.noDragClassName, noPanClassName: props.noPanClassName, rfId: props.rfId, disableKeyboardA11y: props.disableKeyboardA11y, resizeObserver: resizeObserver, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, elementsSelectable: elementsSelectable, nodeClickDistance: props.nodeClickDistance, onError: onError }, nodeId));\n        }) }));\n}\nNodeRendererComponent.displayName = 'NodeRenderer';\nconst NodeRenderer = memo(NodeRendererComponent);\n\n/**\n * Hook for getting the visible edge ids from the store.\n *\n * @internal\n * @param onlyRenderVisible\n * @returns array with visible edge ids\n */\nfunction useVisibleEdgeIds(onlyRenderVisible) {\n    const edgeIds = useStore(useCallback((s) => {\n        if (!onlyRenderVisible) {\n            return s.edges.map((edge) => edge.id);\n        }\n        const visibleEdgeIds = [];\n        if (s.width && s.height) {\n            for (const edge of s.edges) {\n                const sourceNode = s.nodeLookup.get(edge.source);\n                const targetNode = s.nodeLookup.get(edge.target);\n                if (sourceNode &&\n                    targetNode &&\n                    isEdgeVisible({\n                        sourceNode,\n                        targetNode,\n                        width: s.width,\n                        height: s.height,\n                        transform: s.transform,\n                    })) {\n                    visibleEdgeIds.push(edge.id);\n                }\n            }\n        }\n        return visibleEdgeIds;\n    }, [onlyRenderVisible]), shallow);\n    return edgeIds;\n}\n\nconst ArrowSymbol = ({ color = 'none', strokeWidth = 1 }) => {\n    const style = {\n        strokeWidth,\n        ...(color && { stroke: color }),\n    };\n    return (jsx(\"polyline\", { className: \"arrow\", style: style, strokeLinecap: \"round\", fill: \"none\", strokeLinejoin: \"round\", points: \"-5,-4 0,0 -5,4\" }));\n};\nconst ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }) => {\n    const style = {\n        strokeWidth,\n        ...(color && { stroke: color, fill: color }),\n    };\n    return (jsx(\"polyline\", { className: \"arrowclosed\", style: style, strokeLinecap: \"round\", strokeLinejoin: \"round\", points: \"-5,-4 0,0 -5,4 -5,-4\" }));\n};\nconst MarkerSymbols = {\n    [MarkerType.Arrow]: ArrowSymbol,\n    [MarkerType.ArrowClosed]: ArrowClosedSymbol,\n};\nfunction useMarkerSymbol(type) {\n    const store = useStoreApi();\n    const symbol = useMemo(() => {\n        const symbolExists = Object.prototype.hasOwnProperty.call(MarkerSymbols, type);\n        if (!symbolExists) {\n            store.getState().onError?.('009', errorMessages['error009'](type));\n            return null;\n        }\n        return MarkerSymbols[type];\n    }, [type]);\n    return symbol;\n}\n\nconst Marker = ({ id, type, color, width = 12.5, height = 12.5, markerUnits = 'strokeWidth', strokeWidth, orient = 'auto-start-reverse', }) => {\n    const Symbol = useMarkerSymbol(type);\n    if (!Symbol) {\n        return null;\n    }\n    return (jsx(\"marker\", { className: \"react-flow__arrowhead\", id: id, markerWidth: `${width}`, markerHeight: `${height}`, viewBox: \"-10 -10 20 20\", markerUnits: markerUnits, orient: orient, refX: \"0\", refY: \"0\", children: jsx(Symbol, { color: color, strokeWidth: strokeWidth }) }));\n};\n/*\n * when you have multiple flows on a page and you hide the first one, the other ones have no markers anymore\n * when they do have markers with the same ids. To prevent this the user can pass a unique id to the react flow wrapper\n * that we can then use for creating our unique marker ids\n */\nconst MarkerDefinitions = ({ defaultColor, rfId }) => {\n    const edges = useStore((s) => s.edges);\n    const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);\n    const markers = useMemo(() => {\n        const markers = createMarkerIds(edges, {\n            id: rfId,\n            defaultColor,\n            defaultMarkerStart: defaultEdgeOptions?.markerStart,\n            defaultMarkerEnd: defaultEdgeOptions?.markerEnd,\n        });\n        return markers;\n    }, [edges, defaultEdgeOptions, rfId, defaultColor]);\n    if (!markers.length) {\n        return null;\n    }\n    return (jsx(\"svg\", { className: \"react-flow__marker\", \"aria-hidden\": \"true\", children: jsx(\"defs\", { children: markers.map((marker) => (jsx(Marker, { id: marker.id, type: marker.type, color: marker.color, width: marker.width, height: marker.height, markerUnits: marker.markerUnits, strokeWidth: marker.strokeWidth, orient: marker.orient }, marker.id))) }) }));\n};\nMarkerDefinitions.displayName = 'MarkerDefinitions';\nvar MarkerDefinitions$1 = memo(MarkerDefinitions);\n\nfunction EdgeTextComponent({ x, y, label, labelStyle, labelShowBg = true, labelBgStyle, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children, className, ...rest }) {\n    const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 1, y: 0, width: 0, height: 0 });\n    const edgeTextClasses = cc(['react-flow__edge-textwrapper', className]);\n    const edgeTextRef = useRef(null);\n    useEffect(() => {\n        if (edgeTextRef.current) {\n            const textBbox = edgeTextRef.current.getBBox();\n            setEdgeTextBbox({\n                x: textBbox.x,\n                y: textBbox.y,\n                width: textBbox.width,\n                height: textBbox.height,\n            });\n        }\n    }, [label]);\n    if (!label) {\n        return null;\n    }\n    return (jsxs(\"g\", { transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? 'visible' : 'hidden', ...rest, children: [labelShowBg && (jsx(\"rect\", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: \"react-flow__edge-textbg\", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius })), jsx(\"text\", { className: \"react-flow__edge-text\", y: edgeTextBbox.height / 2, dy: \"0.3em\", ref: edgeTextRef, style: labelStyle, children: label }), children] }));\n}\nEdgeTextComponent.displayName = 'EdgeText';\n/**\n * You can use the `<EdgeText />` component as a helper component to display text\n * within your custom edges.\n *\n * @public\n *\n * @example\n * ```jsx\n * import { EdgeText } from '@xyflow/react';\n *\n * export function CustomEdgeLabel({ label }) {\n *   return (\n *     <EdgeText\n *       x={100}\n *       y={100}\n *       label={label}\n *       labelStyle={{ fill: 'white' }}\n *       labelShowBg\n *       labelBgStyle={{ fill: 'red' }}\n *       labelBgPadding={[2, 4]}\n *       labelBgBorderRadius={2}\n *     />\n *   );\n * }\n *```\n */\nconst EdgeText = memo(EdgeTextComponent);\n\n/**\n * The `<BaseEdge />` component gets used internally for all the edges. It can be\n * used inside a custom edge and handles the invisible helper edge and the edge label\n * for you.\n *\n * @public\n * @example\n * ```jsx\n *import { BaseEdge } from '@xyflow/react';\n *\n *export function CustomEdge({ sourceX, sourceY, targetX, targetY, ...props }) {\n *  const [edgePath] = getStraightPath({\n *    sourceX,\n *    sourceY,\n *    targetX,\n *    targetY,\n *  });\n *\n *  return <BaseEdge path={edgePath} {...props} />;\n *}\n *```\n *\n * @remarks If you want to use an edge marker with the [`<BaseEdge />`](/api-reference/components/base-edge) component,\n * you can pass the `markerStart` or `markerEnd` props passed to your custom edge\n * through to the [`<BaseEdge />`](/api-reference/components/base-edge) component.\n * You can see all the props passed to a custom edge by looking at the [`EdgeProps`](/api-reference/types/edge-props) type.\n */\nfunction BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth = 20, ...props }) {\n    return (jsxs(Fragment, { children: [jsx(\"path\", { ...props, d: path, fill: \"none\", className: cc(['react-flow__edge-path', props.className]) }), interactionWidth ? (jsx(\"path\", { d: path, fill: \"none\", strokeOpacity: 0, strokeWidth: interactionWidth, className: \"react-flow__edge-interaction\" })) : null, label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] }));\n}\n\nfunction getControl({ pos, x1, y1, x2, y2 }) {\n    if (pos === Position.Left || pos === Position.Right) {\n        return [0.5 * (x1 + x2), y1];\n    }\n    return [x1, 0.5 * (y1 + y2)];\n}\n/**\n * The `getSimpleBezierPath` util returns everything you need to render a simple\n * bezier edge between two nodes.\n * @public\n * @returns\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n */\nfunction getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, }) {\n    const [sourceControlX, sourceControlY] = getControl({\n        pos: sourcePosition,\n        x1: sourceX,\n        y1: sourceY,\n        x2: targetX,\n        y2: targetY,\n    });\n    const [targetControlX, targetControlY] = getControl({\n        pos: targetPosition,\n        x1: targetX,\n        y1: targetY,\n        x2: sourceX,\n        y2: sourceY,\n    });\n    const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n        sourceX,\n        sourceY,\n        targetX,\n        targetY,\n        sourceControlX,\n        sourceControlY,\n        targetControlX,\n        targetControlY,\n    });\n    return [\n        `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n        labelX,\n        labelY,\n        offsetX,\n        offsetY,\n    ];\n}\nfunction createSimpleBezierEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => {\n        const [path, labelX, labelY] = getSimpleBezierPath({\n            sourceX,\n            sourceY,\n            sourcePosition,\n            targetX,\n            targetY,\n            targetPosition,\n        });\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n    });\n}\nconst SimpleBezierEdge = createSimpleBezierEdge({ isInternal: false });\nconst SimpleBezierEdgeInternal = createSimpleBezierEdge({ isInternal: true });\nSimpleBezierEdge.displayName = 'SimpleBezierEdge';\nSimpleBezierEdgeInternal.displayName = 'SimpleBezierEdgeInternal';\n\nfunction createSmoothStepEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition = Position.Bottom, targetPosition = Position.Top, markerEnd, markerStart, pathOptions, interactionWidth, }) => {\n        const [path, labelX, labelY] = getSmoothStepPath({\n            sourceX,\n            sourceY,\n            sourcePosition,\n            targetX,\n            targetY,\n            targetPosition,\n            borderRadius: pathOptions?.borderRadius,\n            offset: pathOptions?.offset,\n            stepPosition: pathOptions?.stepPosition,\n        });\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n    });\n}\n/**\n * Component that can be used inside a custom edge to render a smooth step edge.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { SmoothStepEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n *   return (\n *     <SmoothStepEdge\n *       sourceX={sourceX}\n *       sourceY={sourceY}\n *       targetX={targetX}\n *       targetY={targetY}\n *       sourcePosition={sourcePosition}\n *       targetPosition={targetPosition}\n *     />\n *   );\n * }\n * ```\n */\nconst SmoothStepEdge = createSmoothStepEdge({ isInternal: false });\n/**\n * @internal\n */\nconst SmoothStepEdgeInternal = createSmoothStepEdge({ isInternal: true });\nSmoothStepEdge.displayName = 'SmoothStepEdge';\nSmoothStepEdgeInternal.displayName = 'SmoothStepEdgeInternal';\n\nfunction createStepEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, ...props }) => {\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(SmoothStepEdge, { ...props, id: _id, pathOptions: useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset]) }));\n    });\n}\n/**\n * Component that can be used inside a custom edge to render a step edge.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { StepEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n *   return (\n *     <StepEdge\n *       sourceX={sourceX}\n *       sourceY={sourceY}\n *       targetX={targetX}\n *       targetY={targetY}\n *       sourcePosition={sourcePosition}\n *       targetPosition={targetPosition}\n *     />\n *   );\n * }\n * ```\n */\nconst StepEdge = createStepEdge({ isInternal: false });\n/**\n * @internal\n */\nconst StepEdgeInternal = createStepEdge({ isInternal: true });\nStepEdge.displayName = 'StepEdge';\nStepEdgeInternal.displayName = 'StepEdgeInternal';\n\nfunction createStraightEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => {\n        const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY });\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n    });\n}\n/**\n * Component that can be used inside a custom edge to render a straight line.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { StraightEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY }) {\n *   return (\n *     <StraightEdge\n *       sourceX={sourceX}\n *       sourceY={sourceY}\n *       targetX={targetX}\n *       targetY={targetY}\n *     />\n *   );\n * }\n * ```\n */\nconst StraightEdge = createStraightEdge({ isInternal: false });\n/**\n * @internal\n */\nconst StraightEdgeInternal = createStraightEdge({ isInternal: true });\nStraightEdge.displayName = 'StraightEdge';\nStraightEdgeInternal.displayName = 'StraightEdgeInternal';\n\nfunction createBezierEdge(params) {\n    // eslint-disable-next-line react/display-name\n    return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition = Position.Bottom, targetPosition = Position.Top, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }) => {\n        const [path, labelX, labelY] = getBezierPath({\n            sourceX,\n            sourceY,\n            sourcePosition,\n            targetX,\n            targetY,\n            targetPosition,\n            curvature: pathOptions?.curvature,\n        });\n        const _id = params.isInternal ? undefined : id;\n        return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n    });\n}\n/**\n * Component that can be used inside a custom edge to render a bezier curve.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { BezierEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n *   return (\n *     <BezierEdge\n *       sourceX={sourceX}\n *       sourceY={sourceY}\n *       targetX={targetX}\n *       targetY={targetY}\n *       sourcePosition={sourcePosition}\n *       targetPosition={targetPosition}\n *     />\n *   );\n * }\n * ```\n */\nconst BezierEdge = createBezierEdge({ isInternal: false });\n/**\n * @internal\n */\nconst BezierEdgeInternal = createBezierEdge({ isInternal: true });\nBezierEdge.displayName = 'BezierEdge';\nBezierEdgeInternal.displayName = 'BezierEdgeInternal';\n\nconst builtinEdgeTypes = {\n    default: BezierEdgeInternal,\n    straight: StraightEdgeInternal,\n    step: StepEdgeInternal,\n    smoothstep: SmoothStepEdgeInternal,\n    simplebezier: SimpleBezierEdgeInternal,\n};\nconst nullPosition = {\n    sourceX: null,\n    sourceY: null,\n    targetX: null,\n    targetY: null,\n    sourcePosition: null,\n    targetPosition: null,\n};\n\nconst shiftX = (x, shift, position) => {\n    if (position === Position.Left)\n        return x - shift;\n    if (position === Position.Right)\n        return x + shift;\n    return x;\n};\nconst shiftY = (y, shift, position) => {\n    if (position === Position.Top)\n        return y - shift;\n    if (position === Position.Bottom)\n        return y + shift;\n    return y;\n};\nconst EdgeUpdaterClassName = 'react-flow__edgeupdater';\n/**\n * @internal\n */\nfunction EdgeAnchor({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type, }) {\n    return (jsx(\"circle\", { onMouseDown: onMouseDown, onMouseEnter: onMouseEnter, onMouseOut: onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: \"transparent\", fill: \"transparent\" }));\n}\n\nfunction EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, onReconnect, onReconnectStart, onReconnectEnd, setReconnecting, setUpdateHover, }) {\n    const store = useStoreApi();\n    const handleEdgeUpdater = (event, oppositeHandle) => {\n        // avoid triggering edge updater if mouse btn is not left\n        if (event.button !== 0) {\n            return;\n        }\n        const { autoPanOnConnect, domNode, connectionMode, connectionRadius, lib, onConnectStart, cancelConnection, nodeLookup, rfId: flowId, panBy, updateConnection, } = store.getState();\n        const isTarget = oppositeHandle.type === 'target';\n        const _onReconnectEnd = (evt, connectionState) => {\n            setReconnecting(false);\n            onReconnectEnd?.(evt, edge, oppositeHandle.type, connectionState);\n        };\n        const onConnectEdge = (connection) => onReconnect?.(edge, connection);\n        const _onConnectStart = (_event, params) => {\n            setReconnecting(true);\n            onReconnectStart?.(event, edge, oppositeHandle.type);\n            onConnectStart?.(_event, params);\n        };\n        XYHandle.onPointerDown(event.nativeEvent, {\n            autoPanOnConnect,\n            connectionMode,\n            connectionRadius,\n            domNode,\n            handleId: oppositeHandle.id,\n            nodeId: oppositeHandle.nodeId,\n            nodeLookup,\n            isTarget,\n            edgeUpdaterType: oppositeHandle.type,\n            lib,\n            flowId,\n            cancelConnection,\n            panBy,\n            isValidConnection: (...args) => store.getState().isValidConnection?.(...args) ?? true,\n            onConnect: onConnectEdge,\n            onConnectStart: _onConnectStart,\n            onConnectEnd: (...args) => store.getState().onConnectEnd?.(...args),\n            onReconnectEnd: _onReconnectEnd,\n            updateConnection,\n            getTransform: () => store.getState().transform,\n            getFromHandle: () => store.getState().connection.fromHandle,\n            dragThreshold: store.getState().connectionDragThreshold,\n            handleDomNode: event.currentTarget,\n        });\n    };\n    const onReconnectSourceMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.target, id: edge.targetHandle ?? null, type: 'target' });\n    const onReconnectTargetMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.source, id: edge.sourceHandle ?? null, type: 'source' });\n    const onReconnectMouseEnter = () => setUpdateHover(true);\n    const onReconnectMouseOut = () => setUpdateHover(false);\n    return (jsxs(Fragment, { children: [(isReconnectable === true || isReconnectable === 'source') && (jsx(EdgeAnchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: reconnectRadius, onMouseDown: onReconnectSourceMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: \"source\" })), (isReconnectable === true || isReconnectable === 'target') && (jsx(EdgeAnchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: reconnectRadius, onMouseDown: onReconnectTargetMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: \"target\" }))] }));\n}\n\nfunction EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y, }) {\n    let edge = useStore((s) => s.edgeLookup.get(id));\n    const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);\n    edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge;\n    let edgeType = edge.type || 'default';\n    let EdgeComponent = edgeTypes?.[edgeType] || builtinEdgeTypes[edgeType];\n    if (EdgeComponent === undefined) {\n        onError?.('011', errorMessages['error011'](edgeType));\n        edgeType = 'default';\n        EdgeComponent = edgeTypes?.['default'] || builtinEdgeTypes.default;\n    }\n    const isFocusable = !!(edge.focusable || (edgesFocusable && typeof edge.focusable === 'undefined'));\n    const isReconnectable = typeof onReconnect !== 'undefined' &&\n        (edge.reconnectable || (edgesReconnectable && typeof edge.reconnectable === 'undefined'));\n    const isSelectable = !!(edge.selectable || (elementsSelectable && typeof edge.selectable === 'undefined'));\n    const edgeRef = useRef(null);\n    const [updateHover, setUpdateHover] = useState(false);\n    const [reconnecting, setReconnecting] = useState(false);\n    const store = useStoreApi();\n    const { zIndex, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition } = useStore(useCallback((store) => {\n        const sourceNode = store.nodeLookup.get(edge.source);\n        const targetNode = store.nodeLookup.get(edge.target);\n        if (!sourceNode || !targetNode) {\n            return {\n                zIndex: edge.zIndex,\n                ...nullPosition,\n            };\n        }\n        const edgePosition = getEdgePosition({\n            id,\n            sourceNode,\n            targetNode,\n            sourceHandle: edge.sourceHandle || null,\n            targetHandle: edge.targetHandle || null,\n            connectionMode: store.connectionMode,\n            onError,\n        });\n        const zIndex = getElevatedEdgeZIndex({\n            selected: edge.selected,\n            zIndex: edge.zIndex,\n            sourceNode,\n            targetNode,\n            elevateOnSelect: store.elevateEdgesOnSelect,\n            zIndexMode: store.zIndexMode,\n        });\n        return {\n            zIndex,\n            ...(edgePosition || nullPosition),\n        };\n    }, [edge.source, edge.target, edge.sourceHandle, edge.targetHandle, edge.selected, edge.zIndex]), shallow);\n    const markerStartUrl = useMemo(() => (edge.markerStart ? `url('#${getMarkerId(edge.markerStart, rfId)}')` : undefined), [edge.markerStart, rfId]);\n    const markerEndUrl = useMemo(() => (edge.markerEnd ? `url('#${getMarkerId(edge.markerEnd, rfId)}')` : undefined), [edge.markerEnd, rfId]);\n    if (edge.hidden || sourceX === null || sourceY === null || targetX === null || targetY === null) {\n        return null;\n    }\n    const onEdgeClick = (event) => {\n        const { addSelectedEdges, unselectNodesAndEdges, multiSelectionActive } = store.getState();\n        if (isSelectable) {\n            store.setState({ nodesSelectionActive: false });\n            if (edge.selected && multiSelectionActive) {\n                unselectNodesAndEdges({ nodes: [], edges: [edge] });\n                edgeRef.current?.blur();\n            }\n            else {\n                addSelectedEdges([id]);\n            }\n        }\n        if (onClick) {\n            onClick(event, edge);\n        }\n    };\n    const onEdgeDoubleClick = onDoubleClick\n        ? (event) => {\n            onDoubleClick(event, { ...edge });\n        }\n        : undefined;\n    const onEdgeContextMenu = onContextMenu\n        ? (event) => {\n            onContextMenu(event, { ...edge });\n        }\n        : undefined;\n    const onEdgeMouseEnter = onMouseEnter\n        ? (event) => {\n            onMouseEnter(event, { ...edge });\n        }\n        : undefined;\n    const onEdgeMouseMove = onMouseMove\n        ? (event) => {\n            onMouseMove(event, { ...edge });\n        }\n        : undefined;\n    const onEdgeMouseLeave = onMouseLeave\n        ? (event) => {\n            onMouseLeave(event, { ...edge });\n        }\n        : undefined;\n    const onKeyDown = (event) => {\n        if (!disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable) {\n            const { unselectNodesAndEdges, addSelectedEdges } = store.getState();\n            const unselect = event.key === 'Escape';\n            if (unselect) {\n                edgeRef.current?.blur();\n                unselectNodesAndEdges({ edges: [edge] });\n            }\n            else {\n                addSelectedEdges([id]);\n            }\n        }\n    };\n    return (jsx(\"svg\", { style: { zIndex }, children: jsxs(\"g\", { className: cc([\n                'react-flow__edge',\n                `react-flow__edge-${edgeType}`,\n                edge.className,\n                noPanClassName,\n                {\n                    selected: edge.selected,\n                    animated: edge.animated,\n                    inactive: !isSelectable && !onClick,\n                    updating: updateHover,\n                    selectable: isSelectable,\n                },\n            ]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, role: edge.ariaRole ?? (isFocusable ? 'group' : 'img'), \"aria-roledescription\": \"edge\", \"data-id\": id, \"data-testid\": `rf__edge-${id}`, \"aria-label\": edge.ariaLabel === null ? undefined : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, \"aria-describedby\": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && (jsx(EdgeComponent, { id: id, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? true, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: 'pathOptions' in edge ? edge.pathOptions : undefined, interactionWidth: edge.interactionWidth })), isReconnectable && (jsx(EdgeUpdateAnchors, { edge: edge, isReconnectable: isReconnectable, reconnectRadius: reconnectRadius, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, setUpdateHover: setUpdateHover, setReconnecting: setReconnecting }))] }) }));\n}\nvar EdgeWrapper$1 = memo(EdgeWrapper);\n\nconst selector$a = (s) => ({\n    edgesFocusable: s.edgesFocusable,\n    edgesReconnectable: s.edgesReconnectable,\n    elementsSelectable: s.elementsSelectable,\n    connectionMode: s.connectionMode,\n    onError: s.onError,\n});\nfunction EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y, }) {\n    const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow);\n    const edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);\n    return (jsxs(\"div\", { className: \"react-flow__edges\", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId: rfId }), edgeIds.map((id) => {\n                return (jsx(EdgeWrapper$1, { id: id, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, noPanClassName: noPanClassName, onReconnect: onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius: reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, rfId: rfId, onError: onError, edgeTypes: edgeTypes, disableKeyboardA11y: disableKeyboardA11y }, id));\n            })] }));\n}\nEdgeRendererComponent.displayName = 'EdgeRenderer';\nconst EdgeRenderer = memo(EdgeRendererComponent);\n\nconst selector$9 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`;\nfunction Viewport({ children }) {\n    const transform = useStore(selector$9);\n    return (jsx(\"div\", { className: \"react-flow__viewport xyflow__viewport react-flow__container\", style: { transform }, children: children }));\n}\n\n/**\n * Hook for calling onInit handler.\n *\n * @internal\n */\nfunction useOnInitHandler(onInit) {\n    const rfInstance = useReactFlow();\n    const isInitialized = useRef(false);\n    useEffect(() => {\n        if (!isInitialized.current && rfInstance.viewportInitialized && onInit) {\n            setTimeout(() => onInit(rfInstance), 1);\n            isInitialized.current = true;\n        }\n    }, [onInit, rfInstance.viewportInitialized]);\n}\n\nconst selector$8 = (state) => state.panZoom?.syncViewport;\n/**\n * Hook for syncing the viewport with the panzoom instance.\n *\n * @internal\n * @param viewport\n */\nfunction useViewportSync(viewport) {\n    const syncViewport = useStore(selector$8);\n    const store = useStoreApi();\n    useEffect(() => {\n        if (viewport) {\n            syncViewport?.(viewport);\n            store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] });\n        }\n    }, [viewport, syncViewport]);\n    return null;\n}\n\nfunction storeSelector$1(s) {\n    return s.connection.inProgress\n        ? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) }\n        : { ...s.connection };\n}\nfunction getSelector(connectionSelector) {\n    if (connectionSelector) {\n        const combinedSelector = (s) => {\n            const connection = storeSelector$1(s);\n            return connectionSelector(connection);\n        };\n        return combinedSelector;\n    }\n    return storeSelector$1;\n}\n/**\n * The `useConnection` hook returns the current connection when there is an active\n * connection interaction. If no connection interaction is active, it returns null\n * for every property. A typical use case for this hook is to colorize handles\n * based on a certain condition (e.g. if the connection is valid or not).\n *\n * @public\n * @param connectionSelector - An optional selector function used to extract a slice of the\n * `ConnectionState` data. Using a selector can prevent component re-renders where data you don't\n * otherwise care about might change. If a selector is not provided, the entire `ConnectionState`\n * object is returned unchanged.\n * @example\n *\n * ```tsx\n *import { useConnection } from '@xyflow/react';\n *\n *function App() {\n *  const connection = useConnection();\n *\n *  return (\n *    <div> {connection ? `Someone is trying to make a connection from ${connection.fromNode} to this one.` : 'There are currently no incoming connections!'}\n *\n *   </div>\n *   );\n * }\n * ```\n *\n * @returns ConnectionState\n */\nfunction useConnection(connectionSelector) {\n    const combinedSelector = getSelector(connectionSelector);\n    return useStore(combinedSelector, shallow);\n}\n\nconst selector$7 = (s) => ({\n    nodesConnectable: s.nodesConnectable,\n    isValid: s.connection.isValid,\n    inProgress: s.connection.inProgress,\n    width: s.width,\n    height: s.height,\n});\nfunction ConnectionLineWrapper({ containerStyle, style, type, component, }) {\n    const { nodesConnectable, width, height, isValid, inProgress } = useStore(selector$7, shallow);\n    const renderConnection = !!(width && nodesConnectable && inProgress);\n    if (!renderConnection) {\n        return null;\n    }\n    return (jsx(\"svg\", { style: containerStyle, width: width, height: height, className: \"react-flow__connectionline react-flow__container\", children: jsx(\"g\", { className: cc(['react-flow__connection', getConnectionStatus(isValid)]), children: jsx(ConnectionLine, { style: style, type: type, CustomComponent: component, isValid: isValid }) }) }));\n}\nconst ConnectionLine = ({ style, type = ConnectionLineType.Bezier, CustomComponent, isValid, }) => {\n    const { inProgress, from, fromNode, fromHandle, fromPosition, to, toNode, toHandle, toPosition, pointer } = useConnection();\n    if (!inProgress) {\n        return;\n    }\n    if (CustomComponent) {\n        return (jsx(CustomComponent, { connectionLineType: type, connectionLineStyle: style, fromNode: fromNode, fromHandle: fromHandle, fromX: from.x, fromY: from.y, toX: to.x, toY: to.y, fromPosition: fromPosition, toPosition: toPosition, connectionStatus: getConnectionStatus(isValid), toNode: toNode, toHandle: toHandle, pointer: pointer }));\n    }\n    let path = '';\n    const pathParams = {\n        sourceX: from.x,\n        sourceY: from.y,\n        sourcePosition: fromPosition,\n        targetX: to.x,\n        targetY: to.y,\n        targetPosition: toPosition,\n    };\n    switch (type) {\n        case ConnectionLineType.Bezier:\n            [path] = getBezierPath(pathParams);\n            break;\n        case ConnectionLineType.SimpleBezier:\n            [path] = getSimpleBezierPath(pathParams);\n            break;\n        case ConnectionLineType.Step:\n            [path] = getSmoothStepPath({\n                ...pathParams,\n                borderRadius: 0,\n            });\n            break;\n        case ConnectionLineType.SmoothStep:\n            [path] = getSmoothStepPath(pathParams);\n            break;\n        default:\n            [path] = getStraightPath(pathParams);\n    }\n    return jsx(\"path\", { d: path, fill: \"none\", className: \"react-flow__connection-path\", style: style });\n};\nConnectionLine.displayName = 'ConnectionLine';\n\nconst emptyTypes = {};\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction useNodeOrEdgeTypesWarning(nodeOrEdgeTypes = emptyTypes) {\n    const typesRef = useRef(nodeOrEdgeTypes);\n    const store = useStoreApi();\n    useEffect(() => {\n        if (process.env.NODE_ENV === 'development') {\n            const usedKeys = new Set([...Object.keys(typesRef.current), ...Object.keys(nodeOrEdgeTypes)]);\n            for (const key of usedKeys) {\n                if (typesRef.current[key] !== nodeOrEdgeTypes[key]) {\n                    store.getState().onError?.('002', errorMessages['error002']());\n                    break;\n                }\n            }\n            typesRef.current = nodeOrEdgeTypes;\n        }\n    }, [nodeOrEdgeTypes]);\n}\n\nfunction useStylesLoadedWarning() {\n    const store = useStoreApi();\n    const checked = useRef(false);\n    useEffect(() => {\n        if (process.env.NODE_ENV === 'development') {\n            if (!checked.current) {\n                const pane = document.querySelector('.react-flow__pane');\n                if (pane && !(window.getComputedStyle(pane).zIndex === '1')) {\n                    store.getState().onError?.('013', errorMessages['error013']('react'));\n                }\n                checked.current = true;\n            }\n        }\n    }, []);\n}\n\nfunction GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, }) {\n    useNodeOrEdgeTypesWarning(nodeTypes);\n    useNodeOrEdgeTypesWarning(edgeTypes);\n    useStylesLoadedWarning();\n    useOnInitHandler(onInit);\n    useViewportSync(viewport);\n    return (jsx(FlowRenderer, { onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, paneClickDistance: paneClickDistance, deleteKeyCode: deleteKeyCode, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, onSelectionContextMenu: onSelectionContextMenu, preventScrolling: preventScrolling, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, onViewportChange: onViewportChange, isControlledViewport: !!viewport, children: jsxs(Viewport, { children: [jsx(EdgeRenderer, { edgeTypes: edgeTypes, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onlyRenderVisibleElements: onlyRenderVisibleElements, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, rfId: rfId }), jsx(ConnectionLineWrapper, { style: connectionLineStyle, type: connectionLineType, component: connectionLineComponent, containerStyle: connectionLineContainerStyle }), jsx(\"div\", { className: \"react-flow__edgelabel-renderer\" }), jsx(NodeRenderer, { nodeTypes: nodeTypes, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, nodeClickDistance: nodeClickDistance, onlyRenderVisibleElements: onlyRenderVisibleElements, noPanClassName: noPanClassName, noDragClassName: noDragClassName, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, rfId: rfId }), jsx(\"div\", { className: \"react-flow__viewport-portal\" })] }) }));\n}\nGraphViewComponent.displayName = 'GraphView';\nconst GraphView = memo(GraphViewComponent);\n\nconst getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom = 0.5, maxZoom = 2, nodeOrigin, nodeExtent, zIndexMode = 'basic', } = {}) => {\n    const nodeLookup = new Map();\n    const parentLookup = new Map();\n    const connectionLookup = new Map();\n    const edgeLookup = new Map();\n    const storeEdges = defaultEdges ?? edges ?? [];\n    const storeNodes = defaultNodes ?? nodes ?? [];\n    const storeNodeOrigin = nodeOrigin ?? [0, 0];\n    const storeNodeExtent = nodeExtent ?? infiniteExtent;\n    updateConnectionLookup(connectionLookup, edgeLookup, storeEdges);\n    const { nodesInitialized } = adoptUserNodes(storeNodes, nodeLookup, parentLookup, {\n        nodeOrigin: storeNodeOrigin,\n        nodeExtent: storeNodeExtent,\n        zIndexMode,\n    });\n    let transform = [0, 0, 1];\n    if (fitView && width && height) {\n        const bounds = getInternalNodesBounds(nodeLookup, {\n            filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight)),\n        });\n        const { x, y, zoom } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1);\n        transform = [x, y, zoom];\n    }\n    return {\n        rfId: '1',\n        width: width ?? 0,\n        height: height ?? 0,\n        transform,\n        nodes: storeNodes,\n        nodesInitialized,\n        nodeLookup,\n        parentLookup,\n        edges: storeEdges,\n        edgeLookup,\n        connectionLookup,\n        onNodesChange: null,\n        onEdgesChange: null,\n        hasDefaultNodes: defaultNodes !== undefined,\n        hasDefaultEdges: defaultEdges !== undefined,\n        panZoom: null,\n        minZoom,\n        maxZoom,\n        translateExtent: infiniteExtent,\n        nodeExtent: storeNodeExtent,\n        nodesSelectionActive: false,\n        userSelectionActive: false,\n        userSelectionRect: null,\n        connectionMode: ConnectionMode.Strict,\n        domNode: null,\n        paneDragging: false,\n        noPanClassName: 'nopan',\n        nodeOrigin: storeNodeOrigin,\n        nodeDragThreshold: 1,\n        connectionDragThreshold: 1,\n        snapGrid: [15, 15],\n        snapToGrid: false,\n        nodesDraggable: true,\n        nodesConnectable: true,\n        nodesFocusable: true,\n        edgesFocusable: true,\n        edgesReconnectable: true,\n        elementsSelectable: true,\n        elevateNodesOnSelect: true,\n        elevateEdgesOnSelect: true,\n        selectNodesOnDrag: true,\n        multiSelectionActive: false,\n        fitViewQueued: fitView ?? false,\n        fitViewOptions,\n        fitViewResolver: null,\n        connection: { ...initialConnection },\n        connectionClickStartHandle: null,\n        connectOnClick: true,\n        ariaLiveMessage: '',\n        autoPanOnConnect: true,\n        autoPanOnNodeDrag: true,\n        autoPanOnNodeFocus: true,\n        autoPanSpeed: 15,\n        connectionRadius: 20,\n        onError: devWarn,\n        isValidConnection: undefined,\n        onSelectionChangeHandlers: [],\n        lib: 'react',\n        debug: false,\n        ariaLabelConfig: defaultAriaLabelConfig,\n        zIndexMode,\n        onNodesChangeMiddlewareMap: new Map(),\n        onEdgesChangeMiddlewareMap: new Map(),\n    };\n};\n\nconst createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, zIndexMode, }) => createWithEqualityFn((set, get) => {\n    async function resolveFitView() {\n        const { nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom } = get();\n        if (!panZoom) {\n            return;\n        }\n        await fitViewport({\n            nodes: nodeLookup,\n            width,\n            height,\n            panZoom,\n            minZoom,\n            maxZoom,\n        }, fitViewOptions);\n        fitViewResolver?.resolve(true);\n        /**\n         * wait for the fitViewport to resolve before deleting the resolver,\n         * we want to reuse the old resolver if the user calls fitView again in the mean time\n         */\n        set({ fitViewResolver: null });\n    }\n    return {\n        ...getInitialState({\n            nodes,\n            edges,\n            width,\n            height,\n            fitView,\n            fitViewOptions,\n            minZoom,\n            maxZoom,\n            nodeOrigin,\n            nodeExtent,\n            defaultNodes,\n            defaultEdges,\n            zIndexMode,\n        }),\n        setNodes: (nodes) => {\n            const { nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, fitViewQueued, zIndexMode, nodesSelectionActive, } = get();\n            /*\n             * setNodes() is called exclusively in response to user actions:\n             * - either when the `<ReactFlow nodes>` prop is updated in the controlled ReactFlow setup,\n             * - or when the user calls something like `reactFlowInstance.setNodes()` in an uncontrolled ReactFlow setup.\n             *\n             * When this happens, we take the note objects passed by the user and extend them with fields\n             * relevant for internal React Flow operations.\n             */\n            const { nodesInitialized, hasSelectedNodes } = adoptUserNodes(nodes, nodeLookup, parentLookup, {\n                nodeOrigin,\n                nodeExtent,\n                elevateNodesOnSelect,\n                checkEquality: true,\n                zIndexMode,\n            });\n            const nextNodesSelectionActive = nodesSelectionActive && hasSelectedNodes;\n            if (fitViewQueued && nodesInitialized) {\n                resolveFitView();\n                set({\n                    nodes,\n                    nodesInitialized,\n                    fitViewQueued: false,\n                    fitViewOptions: undefined,\n                    nodesSelectionActive: nextNodesSelectionActive\n                });\n            }\n            else {\n                set({ nodes, nodesInitialized, nodesSelectionActive: nextNodesSelectionActive });\n            }\n        },\n        setEdges: (edges) => {\n            const { connectionLookup, edgeLookup } = get();\n            updateConnectionLookup(connectionLookup, edgeLookup, edges);\n            set({ edges });\n        },\n        setDefaultNodesAndEdges: (nodes, edges) => {\n            if (nodes) {\n                const { setNodes } = get();\n                setNodes(nodes);\n                set({ hasDefaultNodes: true });\n            }\n            if (edges) {\n                const { setEdges } = get();\n                setEdges(edges);\n                set({ hasDefaultEdges: true });\n            }\n        },\n        /*\n         * Every node gets registered at a ResizeObserver. Whenever a node\n         * changes its dimensions, this function is called to measure the\n         * new dimensions and update the nodes.\n         */\n        updateNodeInternals: (updates) => {\n            const { triggerNodeChanges, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, debug, fitViewQueued, zIndexMode, } = get();\n            const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, zIndexMode);\n            if (!updatedInternals) {\n                return;\n            }\n            updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin, nodeExtent, zIndexMode });\n            if (fitViewQueued) {\n                resolveFitView();\n                set({ fitViewQueued: false, fitViewOptions: undefined });\n            }\n            else {\n                // we always want to trigger useStore calls whenever updateNodeInternals is called\n                set({});\n            }\n            if (changes?.length > 0) {\n                if (debug) {\n                    console.log('React Flow: trigger node changes', changes);\n                }\n                triggerNodeChanges?.(changes);\n            }\n        },\n        updateNodePositions: (nodeDragItems, dragging = false) => {\n            const parentExpandChildren = [];\n            let changes = [];\n            const { nodeLookup, triggerNodeChanges, connection, updateConnection, onNodesChangeMiddlewareMap } = get();\n            for (const [id, dragItem] of nodeDragItems) {\n                // we are using the nodelookup to be sure to use the current expandParent and parentId value\n                const node = nodeLookup.get(id);\n                const expandParent = !!(node?.expandParent && node?.parentId && dragItem?.position);\n                const change = {\n                    id,\n                    type: 'position',\n                    position: expandParent\n                        ? {\n                            x: Math.max(0, dragItem.position.x),\n                            y: Math.max(0, dragItem.position.y),\n                        }\n                        : dragItem.position,\n                    dragging,\n                };\n                if (node && connection.inProgress && connection.fromNode.id === node.id) {\n                    const updatedFrom = getHandlePosition(node, connection.fromHandle, Position.Left, true);\n                    updateConnection({ ...connection, from: updatedFrom });\n                }\n                if (expandParent && node.parentId) {\n                    parentExpandChildren.push({\n                        id,\n                        parentId: node.parentId,\n                        rect: {\n                            ...dragItem.internals.positionAbsolute,\n                            width: dragItem.measured.width ?? 0,\n                            height: dragItem.measured.height ?? 0,\n                        },\n                    });\n                }\n                changes.push(change);\n            }\n            if (parentExpandChildren.length > 0) {\n                const { parentLookup, nodeOrigin } = get();\n                const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);\n                changes.push(...parentExpandChanges);\n            }\n            for (const middleware of onNodesChangeMiddlewareMap.values()) {\n                changes = middleware(changes);\n            }\n            triggerNodeChanges(changes);\n        },\n        triggerNodeChanges: (changes) => {\n            const { onNodesChange, setNodes, nodes, hasDefaultNodes, debug } = get();\n            if (changes?.length) {\n                if (hasDefaultNodes) {\n                    const updatedNodes = applyNodeChanges(changes, nodes);\n                    setNodes(updatedNodes);\n                }\n                if (debug) {\n                    console.log('React Flow: trigger node changes', changes);\n                }\n                onNodesChange?.(changes);\n            }\n        },\n        triggerEdgeChanges: (changes) => {\n            const { onEdgesChange, setEdges, edges, hasDefaultEdges, debug } = get();\n            if (changes?.length) {\n                if (hasDefaultEdges) {\n                    const updatedEdges = applyEdgeChanges(changes, edges);\n                    setEdges(updatedEdges);\n                }\n                if (debug) {\n                    console.log('React Flow: trigger edge changes', changes);\n                }\n                onEdgesChange?.(changes);\n            }\n        },\n        addSelectedNodes: (selectedNodeIds) => {\n            const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n            if (multiSelectionActive) {\n                const nodeChanges = selectedNodeIds.map((nodeId) => createSelectionChange(nodeId, true));\n                triggerNodeChanges(nodeChanges);\n                return;\n            }\n            triggerNodeChanges(getSelectionChanges(nodeLookup, new Set([...selectedNodeIds]), true));\n            triggerEdgeChanges(getSelectionChanges(edgeLookup));\n        },\n        addSelectedEdges: (selectedEdgeIds) => {\n            const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n            if (multiSelectionActive) {\n                const changedEdges = selectedEdgeIds.map((edgeId) => createSelectionChange(edgeId, true));\n                triggerEdgeChanges(changedEdges);\n                return;\n            }\n            triggerEdgeChanges(getSelectionChanges(edgeLookup, new Set([...selectedEdgeIds])));\n            triggerNodeChanges(getSelectionChanges(nodeLookup, new Set(), true));\n        },\n        unselectNodesAndEdges: ({ nodes, edges } = {}) => {\n            const { edges: storeEdges, nodes: storeNodes, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n            const nodesToUnselect = nodes ? nodes : storeNodes;\n            const edgesToUnselect = edges ? edges : storeEdges;\n            const nodeChanges = [];\n            for (const node of nodesToUnselect) {\n                if (!node.selected) {\n                    continue; // skip changing nodes that are not selected\n                }\n                const internalNode = nodeLookup.get(node.id);\n                if (internalNode) {\n                    /*\n                     * we need to unselect the internal node that was selected previously before we\n                     * send the change to the user to prevent it to be selected while dragging the new node\n                     */\n                    internalNode.selected = false;\n                }\n                nodeChanges.push(createSelectionChange(node.id, false));\n            }\n            const edgeChanges = [];\n            for (const edge of edgesToUnselect) {\n                if (!edge.selected) {\n                    continue; // skip changing edges that are not selected\n                }\n                edgeChanges.push(createSelectionChange(edge.id, false));\n            }\n            triggerNodeChanges(nodeChanges);\n            triggerEdgeChanges(edgeChanges);\n        },\n        setMinZoom: (minZoom) => {\n            const { panZoom, maxZoom } = get();\n            panZoom?.setScaleExtent([minZoom, maxZoom]);\n            set({ minZoom });\n        },\n        setMaxZoom: (maxZoom) => {\n            const { panZoom, minZoom } = get();\n            panZoom?.setScaleExtent([minZoom, maxZoom]);\n            set({ maxZoom });\n        },\n        setTranslateExtent: (translateExtent) => {\n            get().panZoom?.setTranslateExtent(translateExtent);\n            set({ translateExtent });\n        },\n        resetSelectedElements: () => {\n            const { edges, nodes, triggerNodeChanges, triggerEdgeChanges, elementsSelectable } = get();\n            if (!elementsSelectable) {\n                return;\n            }\n            const nodeChanges = nodes.reduce((res, node) => (node.selected ? [...res, createSelectionChange(node.id, false)] : res), []);\n            const edgeChanges = edges.reduce((res, edge) => (edge.selected ? [...res, createSelectionChange(edge.id, false)] : res), []);\n            triggerNodeChanges(nodeChanges);\n            triggerEdgeChanges(edgeChanges);\n        },\n        setNodeExtent: (nextNodeExtent) => {\n            const { nodes, nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, nodeExtent, zIndexMode } = get();\n            if (nextNodeExtent[0][0] === nodeExtent[0][0] &&\n                nextNodeExtent[0][1] === nodeExtent[0][1] &&\n                nextNodeExtent[1][0] === nodeExtent[1][0] &&\n                nextNodeExtent[1][1] === nodeExtent[1][1]) {\n                return;\n            }\n            adoptUserNodes(nodes, nodeLookup, parentLookup, {\n                nodeOrigin,\n                nodeExtent: nextNodeExtent,\n                elevateNodesOnSelect,\n                checkEquality: false,\n                zIndexMode,\n            });\n            set({ nodeExtent: nextNodeExtent });\n        },\n        panBy: (delta) => {\n            const { transform, width, height, panZoom, translateExtent } = get();\n            return panBy({ delta, panZoom, transform, translateExtent, width, height });\n        },\n        setCenter: async (x, y, options) => {\n            const { width, height, maxZoom, panZoom } = get();\n            if (!panZoom) {\n                return Promise.resolve(false);\n            }\n            const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : maxZoom;\n            await panZoom.setViewport({\n                x: width / 2 - x * nextZoom,\n                y: height / 2 - y * nextZoom,\n                zoom: nextZoom,\n            }, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate });\n            return Promise.resolve(true);\n        },\n        cancelConnection: () => {\n            set({\n                connection: { ...initialConnection },\n            });\n        },\n        updateConnection: (connection) => {\n            set({ connection });\n        },\n        reset: () => set({ ...getInitialState() }),\n    };\n}, Object.is);\n\n/**\n * The `<ReactFlowProvider />` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#)\n * that makes it possible to access a flow's internal state outside of the\n * [`<ReactFlow />`](/api-reference/react-flow) component. Many of the hooks we\n * provide rely on this component to work.\n * @public\n *\n * @example\n * ```tsx\n *import { ReactFlow, ReactFlowProvider, useNodes } from '@xyflow/react'\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlowProvider>\n *      <ReactFlow nodes={...} edges={...} />\n *      <Sidebar />\n *    </ReactFlowProvider>\n *  );\n *}\n *\n *function Sidebar() {\n *  // This hook will only work if the component it's used in is a child of a\n *  // <ReactFlowProvider />.\n *  const nodes = useNodes()\n *\n *  return <aside>do something with nodes</aside>;\n *}\n *```\n *\n * @remarks If you're using a router and want your flow's state to persist across routes,\n * it's vital that you place the `<ReactFlowProvider />` component _outside_ of\n * your router. If you have multiple flows on the same page you will need to use a separate\n * `<ReactFlowProvider />` for each flow.\n */\nfunction ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, zIndexMode, children, }) {\n    const [store] = useState(() => createStore({\n        nodes,\n        edges,\n        defaultNodes,\n        defaultEdges,\n        width,\n        height,\n        fitView,\n        minZoom,\n        maxZoom,\n        fitViewOptions,\n        nodeOrigin,\n        nodeExtent,\n        zIndexMode,\n    }));\n    return (jsx(Provider$1, { value: store, children: jsx(BatchProvider, { children: children }) }));\n}\n\nfunction Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, zIndexMode, }) {\n    const isWrapped = useContext(StoreContext);\n    if (isWrapped) {\n        /*\n         * we need to wrap it with a fragment because it's not allowed for children to be a ReactNode\n         * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051\n         */\n        return jsx(Fragment, { children: children });\n    }\n    return (jsx(ReactFlowProvider, { initialNodes: nodes, initialEdges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, initialWidth: width, initialHeight: height, fitView: fitView, initialFitViewOptions: fitViewOptions, initialMinZoom: minZoom, initialMaxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, zIndexMode: zIndexMode, children: children }));\n}\n\nconst wrapperStyle = {\n    width: '100%',\n    height: '100%',\n    overflow: 'hidden',\n    position: 'relative',\n    zIndex: 0,\n};\nfunction ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 1, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect = true, elevateEdgesOnSelect = false, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, connectionDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, onScroll, ariaLabelConfig, zIndexMode = 'basic', ...rest }, ref) {\n    const rfId = id || '1';\n    const colorModeClassName = useColorModeClass(colorMode);\n    // Undo scroll events, preventing viewport from shifting when nodes outside of it are focused\n    const wrapperOnScroll = useCallback((e) => {\n        e.currentTarget.scrollTo({ top: 0, left: 0, behavior: 'instant' });\n        onScroll?.(e);\n    }, [onScroll]);\n    return (jsx(\"div\", { \"data-testid\": \"rf__wrapper\", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, role: \"application\", children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, fitViewOptions: fitViewOptions, minZoom: minZoom, maxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, zIndexMode: zIndexMode, children: [jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, autoPanOnNodeFocus: autoPanOnNodeFocus, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, connectionDragThreshold: connectionDragThreshold, onBeforeDelete: onBeforeDelete, debug: debug, ariaLabelConfig: ariaLabelConfig, zIndexMode: zIndexMode }), jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));\n}\n/**\n * The `<ReactFlow />` component is the heart of your React Flow application.\n * It renders your nodes and edges and handles user interaction\n *\n * @public\n *\n * @example\n * ```tsx\n *import { ReactFlow } from '@xyflow/react'\n *\n *export default function Flow() {\n *  return (<ReactFlow\n *    nodes={...}\n *    edges={...}\n *    onNodesChange={...}\n *    ...\n *  />);\n *}\n *```\n */\nvar index = fixedForwardRef(ReactFlow);\n\nconst selector$6 = (s) => s.domNode?.querySelector('.react-flow__edgelabel-renderer');\n/**\n * Edges are SVG-based. If you want to render more complex labels you can use the\n * `<EdgeLabelRenderer />` component to access a div based renderer. This component\n * is a portal that renders the label in a `<div />` that is positioned on top of\n * the edges. You can see an example usage of the component in the\n * [edge label renderer example](/examples/edges/edge-label-renderer).\n * @public\n *\n * @example\n * ```jsx\n * import React from 'react';\n * import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react';\n *\n * export function CustomEdge({ id, data, ...props }) {\n *   const [edgePath, labelX, labelY] = getBezierPath(props);\n *\n *   return (\n *     <>\n *       <BaseEdge id={id} path={edgePath} />\n *       <EdgeLabelRenderer>\n *         <div\n *           style={{\n *             position: 'absolute',\n *             transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`,\n *             background: '#ffcc00',\n *             padding: 10,\n *         }}\n *           className=\"nodrag nopan\"\n *         >\n *          {data.label}\n *         </div>\n *       </EdgeLabelRenderer>\n *     </>\n *   );\n * };\n * ```\n *\n * @remarks The `<EdgeLabelRenderer />` has no pointer events by default. If you want to\n * add mouse interactions you need to set the style `pointerEvents: all` and add\n * the `nopan` class on the label or the element you want to interact with.\n */\nfunction EdgeLabelRenderer({ children }) {\n    const edgeLabelRenderer = useStore(selector$6);\n    if (!edgeLabelRenderer) {\n        return null;\n    }\n    return createPortal(children, edgeLabelRenderer);\n}\n\nconst selector$5 = (s) => s.domNode?.querySelector('.react-flow__viewport-portal');\n/**\n * The `<ViewportPortal />` component can be used to add components to the same viewport\n * of the flow where nodes and edges are rendered. This is useful when you want to render\n * your own components that are adhere to the same coordinate system as the nodes & edges\n * and are also affected by zooming and panning\n * @public\n * @example\n *\n * ```jsx\n *import React from 'react';\n *import { ViewportPortal } from '@xyflow/react';\n *\n *export default function () {\n *  return (\n *    <ViewportPortal>\n *      <div\n *        style={{ transform: 'translate(100px, 100px)', position: 'absolute' }}\n *      >\n *        This div is positioned at [100, 100] on the flow.\n *      </div>\n *    </ViewportPortal>\n *  );\n *}\n *```\n */\nfunction ViewportPortal({ children }) {\n    const viewPortalDiv = useStore(selector$5);\n    if (!viewPortalDiv) {\n        return null;\n    }\n    return createPortal(children, viewPortalDiv);\n}\n\n/**\n * When you programmatically add or remove handles to a node or update a node's\n * handle position, you need to let React Flow know about it using this hook. This\n * will update the internal dimensions of the node and properly reposition handles\n * on the canvas if necessary.\n *\n * @public\n * @returns Use this function to tell React Flow to update the internal state of one or more nodes\n * that you have changed programmatically.\n *\n * @example\n * ```jsx\n *import { useCallback, useState } from 'react';\n *import { Handle, useUpdateNodeInternals } from '@xyflow/react';\n *\n *export default function RandomHandleNode({ id }) {\n *  const updateNodeInternals = useUpdateNodeInternals();\n *  const [handleCount, setHandleCount] = useState(0);\n *  const randomizeHandleCount = useCallback(() => {\n *   setHandleCount(Math.floor(Math.random() * 10));\n *    updateNodeInternals(id);\n *  }, [id, updateNodeInternals]);\n *\n *  return (\n *    <>\n *      {Array.from({ length: handleCount }).map((_, index) => (\n *        <Handle\n *          key={index}\n *          type=\"target\"\n *          position=\"left\"\n *          id={`handle-${index}`}\n *        />\n *      ))}\n *\n *      <div>\n *        <button onClick={randomizeHandleCount}>Randomize handle count</button>\n *        <p>There are {handleCount} handles on this node.</p>\n *      </div>\n *    </>\n *  );\n *}\n *```\n * @remarks This hook can only be used in a component that is a child of a\n *{@link ReactFlowProvider} or a {@link ReactFlow} component.\n */\nfunction useUpdateNodeInternals() {\n    const store = useStoreApi();\n    return useCallback((id) => {\n        const { domNode, updateNodeInternals } = store.getState();\n        const updateIds = Array.isArray(id) ? id : [id];\n        const updates = new Map();\n        updateIds.forEach((updateId) => {\n            const nodeElement = domNode?.querySelector(`.react-flow__node[data-id=\"${updateId}\"]`);\n            if (nodeElement) {\n                updates.set(updateId, { id: updateId, nodeElement, force: true });\n            }\n        });\n        requestAnimationFrame(() => updateNodeInternals(updates, { triggerFitView: false }));\n    }, []);\n}\n\nconst nodesSelector = (state) => state.nodes;\n/**\n * This hook returns an array of the current nodes. Components that use this hook\n * will re-render **whenever any node changes**, including when a node is selected\n * or moved.\n *\n * @public\n * @returns An array of all nodes currently in the flow.\n *\n * @example\n * ```jsx\n *import { useNodes } from '@xyflow/react';\n *\n *export default function() {\n *  const nodes = useNodes();\n *\n *  return <div>There are currently {nodes.length} nodes!</div>;\n *}\n *```\n */\nfunction useNodes() {\n    const nodes = useStore(nodesSelector, shallow);\n    return nodes;\n}\n\nconst edgesSelector = (state) => state.edges;\n/**\n * This hook returns an array of the current edges. Components that use this hook\n * will re-render **whenever any edge changes**.\n *\n * @public\n * @returns An array of all edges currently in the flow.\n *\n * @example\n * ```tsx\n *import { useEdges } from '@xyflow/react';\n *\n *export default function () {\n *  const edges = useEdges();\n *\n *  return <div>There are currently {edges.length} edges!</div>;\n *}\n *```\n */\nfunction useEdges() {\n    const edges = useStore(edgesSelector, shallow);\n    return edges;\n}\n\nconst viewportSelector = (state) => ({\n    x: state.transform[0],\n    y: state.transform[1],\n    zoom: state.transform[2],\n});\n/**\n * The `useViewport` hook is a convenient way to read the current state of the\n * {@link Viewport} in a component. Components that use this hook\n * will re-render **whenever the viewport changes**.\n *\n * @public\n * @returns The current viewport.\n *\n * @example\n *\n *```jsx\n *import { useViewport } from '@xyflow/react';\n *\n *export default function ViewportDisplay() {\n *  const { x, y, zoom } = useViewport();\n *\n *  return (\n *    <div>\n *      <p>\n *        The viewport is currently at ({x}, {y}) and zoomed to {zoom}.\n *      </p>\n *    </div>\n *  );\n *}\n *```\n *\n * @remarks This hook can only be used in a component that is a child of a\n *{@link ReactFlowProvider} or a {@link ReactFlow} component.\n */\nfunction useViewport() {\n    const viewport = useStore(viewportSelector, shallow);\n    return viewport;\n}\n\n/**\n * This hook makes it easy to prototype a controlled flow where you manage the\n * state of nodes and edges outside the `ReactFlowInstance`. You can think of it\n * like React's `useState` hook with an additional helper callback.\n *\n * @public\n * @returns\n * - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your\n * `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,\n * for example.\n * - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of\n * nodes or a callback that receives the current array of nodes and returns a new array of nodes.\n * This is the same as the second element of the tuple returned by React's `useState` hook.\n * - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes\n * state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your\n * `<ReactFlow />` component.\n * @example\n *\n *```tsx\n *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react';\n *\n *const initialNodes = [];\n *const initialEdges = [];\n *\n *export default function () {\n *  const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n *  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n *\n *  return (\n *    <ReactFlow\n *      nodes={nodes}\n *      edges={edges}\n *      onNodesChange={onNodesChange}\n *      onEdgesChange={onEdgesChange}\n *    />\n *  );\n *}\n *```\n *\n * @remarks This hook was created to make prototyping easier and our documentation\n * examples clearer. Although it is OK to use this hook in production, in\n * practice you may want to use a more sophisticated state management solution\n * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.\n *\n */\nfunction useNodesState(initialNodes) {\n    const [nodes, setNodes] = useState(initialNodes);\n    const onNodesChange = useCallback((changes) => setNodes((nds) => applyNodeChanges(changes, nds)), []);\n    return [nodes, setNodes, onNodesChange];\n}\n/**\n * This hook makes it easy to prototype a controlled flow where you manage the\n * state of nodes and edges outside the `ReactFlowInstance`. You can think of it\n * like React's `useState` hook with an additional helper callback.\n *\n * @public\n * @returns\n * - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your\n * `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,\n * for example.\n *\n * - `setEdges`: A function that you can use to update the edges. You can pass it a new array of\n * edges or a callback that receives the current array of edges and returns a new array of edges.\n * This is the same as the second element of the tuple returned by React's `useState` hook.\n *\n * - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges\n * state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your\n * `<ReactFlow />` component.\n * @example\n *\n *```tsx\n *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react';\n *\n *const initialNodes = [];\n *const initialEdges = [];\n *\n *export default function () {\n *  const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n *  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n *\n *  return (\n *    <ReactFlow\n *      nodes={nodes}\n *      edges={edges}\n *      onNodesChange={onNodesChange}\n *      onEdgesChange={onEdgesChange}\n *    />\n *  );\n *}\n *```\n *\n * @remarks This hook was created to make prototyping easier and our documentation\n * examples clearer. Although it is OK to use this hook in production, in\n * practice you may want to use a more sophisticated state management solution\n * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.\n *\n */\nfunction useEdgesState(initialEdges) {\n    const [edges, setEdges] = useState(initialEdges);\n    const onEdgesChange = useCallback((changes) => setEdges((eds) => applyEdgeChanges(changes, eds)), []);\n    return [edges, setEdges, onEdgesChange];\n}\n\n/**\n * The `useOnViewportChange` hook lets you listen for changes to the viewport such\n * as panning and zooming. You can provide a callback for each phase of a viewport\n * change: `onStart`, `onChange`, and `onEnd`.\n *\n * @public\n * @example\n * ```jsx\n *import { useCallback } from 'react';\n *import { useOnViewportChange } from '@xyflow/react';\n *\n *function ViewportChangeLogger() {\n *  useOnViewportChange({\n *    onStart: (viewport: Viewport) => console.log('start', viewport),\n *    onChange: (viewport: Viewport) => console.log('change', viewport),\n *    onEnd: (viewport: Viewport) => console.log('end', viewport),\n *  });\n *\n *  return null;\n *}\n *```\n */\nfunction useOnViewportChange({ onStart, onChange, onEnd }) {\n    const store = useStoreApi();\n    useEffect(() => {\n        store.setState({ onViewportChangeStart: onStart });\n    }, [onStart]);\n    useEffect(() => {\n        store.setState({ onViewportChange: onChange });\n    }, [onChange]);\n    useEffect(() => {\n        store.setState({ onViewportChangeEnd: onEnd });\n    }, [onEnd]);\n}\n\n/**\n * This hook lets you listen for changes to both node and edge selection. As the\n *name implies, the callback you provide will be called whenever the selection of\n *_either_ nodes or edges changes.\n *\n * @public\n * @example\n * ```jsx\n *import { useState } from 'react';\n *import { ReactFlow, useOnSelectionChange } from '@xyflow/react';\n *\n *function SelectionDisplay() {\n *  const [selectedNodes, setSelectedNodes] = useState([]);\n *  const [selectedEdges, setSelectedEdges] = useState([]);\n *\n *  // the passed handler has to be memoized, otherwise the hook will not work correctly\n *  const onChange = useCallback(({ nodes, edges }) => {\n *    setSelectedNodes(nodes.map((node) => node.id));\n *    setSelectedEdges(edges.map((edge) => edge.id));\n *  }, []);\n *\n *  useOnSelectionChange({\n *    onChange,\n *  });\n *\n *  return (\n *    <div>\n *      <p>Selected nodes: {selectedNodes.join(', ')}</p>\n *      <p>Selected edges: {selectedEdges.join(', ')}</p>\n *    </div>\n *  );\n *}\n *```\n *\n * @remarks You need to memoize the passed `onChange` handler, otherwise the hook will not work correctly.\n */\nfunction useOnSelectionChange({ onChange, }) {\n    const store = useStoreApi();\n    useEffect(() => {\n        const nextOnSelectionChangeHandlers = [...store.getState().onSelectionChangeHandlers, onChange];\n        store.setState({ onSelectionChangeHandlers: nextOnSelectionChangeHandlers });\n        return () => {\n            const nextHandlers = store.getState().onSelectionChangeHandlers.filter((fn) => fn !== onChange);\n            store.setState({ onSelectionChangeHandlers: nextHandlers });\n        };\n    }, [onChange]);\n}\n\nconst selector$4 = (options) => (s) => {\n    if (!options.includeHiddenNodes) {\n        return s.nodesInitialized;\n    }\n    if (s.nodeLookup.size === 0) {\n        return false;\n    }\n    for (const [, { internals }] of s.nodeLookup) {\n        if (internals.handleBounds === undefined || !nodeHasDimensions(internals.userNode)) {\n            return false;\n        }\n    }\n    return true;\n};\n/**\n * This hook tells you whether all the nodes in a flow have been measured and given\n *a width and height. When you add a node to the flow, this hook will return\n *`false` and then `true` again once the node has been measured.\n *\n * @public\n * @returns Whether or not the nodes have been initialized by the `<ReactFlow />` component and\n * given a width and height.\n *\n * @example\n * ```jsx\n *import { useReactFlow, useNodesInitialized } from '@xyflow/react';\n *import { useEffect, useState } from 'react';\n *\n *const options = {\n *  includeHiddenNodes: false,\n *};\n *\n *export default function useLayout() {\n *  const { getNodes } = useReactFlow();\n *  const nodesInitialized = useNodesInitialized(options);\n *  const [layoutedNodes, setLayoutedNodes] = useState(getNodes());\n *\n *  useEffect(() => {\n *    if (nodesInitialized) {\n *      setLayoutedNodes(yourLayoutingFunction(getNodes()));\n *    }\n *  }, [nodesInitialized]);\n *\n *  return layoutedNodes;\n *}\n *```\n */\nfunction useNodesInitialized(options = {\n    includeHiddenNodes: false,\n}) {\n    const initialized = useStore(selector$4(options));\n    return initialized;\n}\n\n/**\n * Hook to check if a <Handle /> is connected to another <Handle /> and get the connections.\n *\n * @public\n * @deprecated Use `useNodeConnections` instead.\n * @returns An array with handle connections.\n */\nfunction useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }) {\n    console.warn('[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections');\n    const _nodeId = useNodeId();\n    const currentNodeId = nodeId ?? _nodeId;\n    const prevConnections = useRef(null);\n    const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}-${type}${id ? `-${id}` : ''}`), areConnectionMapsEqual);\n    useEffect(() => {\n        // @todo discuss if onConnect/onDisconnect should be called when the component mounts/unmounts\n        if (prevConnections.current && prevConnections.current !== connections) {\n            const _connections = connections ?? new Map();\n            handleConnectionChange(prevConnections.current, _connections, onDisconnect);\n            handleConnectionChange(_connections, prevConnections.current, onConnect);\n        }\n        prevConnections.current = connections ?? new Map();\n    }, [connections, onConnect, onDisconnect]);\n    return useMemo(() => Array.from(connections?.values() ?? []), [connections]);\n}\n\nconst error014 = errorMessages['error014']();\n/**\n * This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID.\n *\n * @public\n * @returns An array with connections.\n *\n * @example\n * ```jsx\n *import { useNodeConnections } from '@xyflow/react';\n *\n *export default function () {\n *  const connections = useNodeConnections({\n *    handleType: 'target',\n *    handleId: 'my-handle',\n *  });\n *\n *  return (\n *    <div>There are currently {connections.length} incoming connections!</div>\n *  );\n *}\n *```\n */\nfunction useNodeConnections({ id, handleType, handleId, onConnect, onDisconnect, } = {}) {\n    const nodeId = useNodeId();\n    const currentNodeId = id ?? nodeId;\n    if (!currentNodeId) {\n        throw new Error(error014);\n    }\n    const prevConnections = useRef(null);\n    const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}${handleType ? (handleId ? `-${handleType}-${handleId}` : `-${handleType}`) : ''}`), areConnectionMapsEqual);\n    useEffect(() => {\n        // @todo discuss if onConnect/onDisconnect should be called when the component mounts/unmounts\n        if (prevConnections.current && prevConnections.current !== connections) {\n            const _connections = connections ?? new Map();\n            handleConnectionChange(prevConnections.current, _connections, onDisconnect);\n            handleConnectionChange(_connections, prevConnections.current, onConnect);\n        }\n        prevConnections.current = connections ?? new Map();\n    }, [connections, onConnect, onDisconnect]);\n    return useMemo(() => Array.from(connections?.values() ?? []), [connections]);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction useNodesData(nodeIds) {\n    const nodesData = useStore(useCallback((s) => {\n        const data = [];\n        const isArrayOfIds = Array.isArray(nodeIds);\n        const _nodeIds = isArrayOfIds ? nodeIds : [nodeIds];\n        for (const nodeId of _nodeIds) {\n            const node = s.nodeLookup.get(nodeId);\n            if (node) {\n                data.push({\n                    id: node.id,\n                    type: node.type,\n                    data: node.data,\n                });\n            }\n        }\n        return isArrayOfIds ? data : data[0] ?? null;\n    }, [nodeIds]), shallowNodeData);\n    return nodesData;\n}\n\n/**\n * This hook returns the internal representation of a specific node.\n * Components that use this hook will re-render **whenever the node changes**,\n * including when a node is selected or moved.\n *\n * @public\n * @param id - The ID of a node you want to observe.\n * @returns The `InternalNode` object for the node with the given ID.\n *\n * @example\n * ```tsx\n *import { useInternalNode } from '@xyflow/react';\n *\n *export default function () {\n *  const internalNode = useInternalNode('node-1');\n *  const absolutePosition = internalNode.internals.positionAbsolute;\n *\n *  return (\n *    <div>\n *      The absolute position of the node is at:\n *      <p>x: {absolutePosition.x}</p>\n *      <p>y: {absolutePosition.y}</p>\n *    </div>\n *  );\n *}\n *```\n */\nfunction useInternalNode(id) {\n    const node = useStore(useCallback((s) => s.nodeLookup.get(id), [id]), shallow);\n    return node;\n}\n\n/**\n * Registers a middleware function to transform node changes.\n *\n * @public\n * @param fn - Middleware function. Should be memoized with useCallback to avoid re-registration.\n */\nfunction experimental_useOnNodesChangeMiddleware(fn) {\n    const store = useStoreApi();\n    const [symbol] = useState(() => Symbol());\n    useEffect(() => {\n        const { onNodesChangeMiddlewareMap } = store.getState();\n        onNodesChangeMiddlewareMap.set(symbol, fn);\n    }, [fn]);\n    useEffect(() => {\n        const { onNodesChangeMiddlewareMap } = store.getState();\n        return () => {\n            onNodesChangeMiddlewareMap.delete(symbol);\n        };\n    }, []);\n}\n\n/**\n * Registers a middleware function to transform edge changes.\n *\n * @public\n * @param fn - Middleware function. Should be memoized with useCallback to avoid re-registration.\n */\nfunction experimental_useOnEdgesChangeMiddleware(fn) {\n    const store = useStoreApi();\n    const [symbol] = useState(() => Symbol());\n    useEffect(() => {\n        const { onEdgesChangeMiddlewareMap } = store.getState();\n        onEdgesChangeMiddlewareMap.set(symbol, fn);\n    }, [fn]);\n    useEffect(() => {\n        const { onEdgesChangeMiddlewareMap } = store.getState();\n        return () => {\n            onEdgesChangeMiddlewareMap.delete(symbol);\n        };\n    }, []);\n}\n\nfunction LinePattern({ dimensions, lineWidth, variant, className }) {\n    return (jsx(\"path\", { strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`, className: cc(['react-flow__background-pattern', variant, className]) }));\n}\nfunction DotPattern({ radius, className }) {\n    return (jsx(\"circle\", { cx: radius, cy: radius, r: radius, className: cc(['react-flow__background-pattern', 'dots', className]) }));\n}\n\n/**\n * The three variants are exported as an enum for convenience. You can either import\n * the enum and use it like `BackgroundVariant.Lines` or you can use the raw string\n * value directly.\n * @public\n */\nvar BackgroundVariant;\n(function (BackgroundVariant) {\n    BackgroundVariant[\"Lines\"] = \"lines\";\n    BackgroundVariant[\"Dots\"] = \"dots\";\n    BackgroundVariant[\"Cross\"] = \"cross\";\n})(BackgroundVariant || (BackgroundVariant = {}));\n\nconst defaultSize = {\n    [BackgroundVariant.Dots]: 1,\n    [BackgroundVariant.Lines]: 1,\n    [BackgroundVariant.Cross]: 6,\n};\nconst selector$3 = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` });\nfunction BackgroundComponent({ id, variant = BackgroundVariant.Dots, \n// only used for dots and cross\ngap = 20, \n// only used for lines and cross\nsize, lineWidth = 1, offset = 0, color, bgColor, style, className, patternClassName, }) {\n    const ref = useRef(null);\n    const { transform, patternId } = useStore(selector$3, shallow);\n    const patternSize = size || defaultSize[variant];\n    const isDots = variant === BackgroundVariant.Dots;\n    const isCross = variant === BackgroundVariant.Cross;\n    const gapXY = Array.isArray(gap) ? gap : [gap, gap];\n    const scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1];\n    const scaledSize = patternSize * transform[2];\n    const offsetXY = Array.isArray(offset) ? offset : [offset, offset];\n    const patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap;\n    const scaledOffset = [\n        offsetXY[0] * transform[2] || 1 + patternDimensions[0] / 2,\n        offsetXY[1] * transform[2] || 1 + patternDimensions[1] / 2,\n    ];\n    const _patternId = `${patternId}${id ? id : ''}`;\n    return (jsxs(\"svg\", { className: cc(['react-flow__background', className]), style: {\n            ...style,\n            ...containerStyle,\n            '--xy-background-color-props': bgColor,\n            '--xy-background-pattern-color-props': color,\n        }, ref: ref, \"data-testid\": \"rf__background\", children: [jsx(\"pattern\", { id: _patternId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: \"userSpaceOnUse\", patternTransform: `translate(-${scaledOffset[0]},-${scaledOffset[1]})`, children: isDots ? (jsx(DotPattern, { radius: scaledSize / 2, className: patternClassName })) : (jsx(LinePattern, { dimensions: patternDimensions, lineWidth: lineWidth, variant: variant, className: patternClassName })) }), jsx(\"rect\", { x: \"0\", y: \"0\", width: \"100%\", height: \"100%\", fill: `url(#${_patternId})` })] }));\n}\nBackgroundComponent.displayName = 'Background';\n/**\n * The `<Background />` component makes it convenient to render different types of backgrounds common in node-based UIs. It comes with three variants: lines, dots and cross.\n *\n * @example\n *\n * A simple example of how to use the Background component.\n *\n * ```tsx\n * import { useState } from 'react';\n * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react';\n *\n * export default function Flow() {\n *   return (\n *     <ReactFlow defaultNodes={[...]} defaultEdges={[...]}>\n *       <Background color=\"#ccc\" variant={BackgroundVariant.Dots} />\n *     </ReactFlow>\n *   );\n * }\n * ```\n *\n * @example\n *\n * In this example you can see how to combine multiple backgrounds\n *\n * ```tsx\n * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react';\n * import '@xyflow/react/dist/style.css';\n *\n * export default function Flow() {\n *   return (\n *     <ReactFlow defaultNodes={[...]} defaultEdges={[...]}>\n *       <Background\n *         id=\"1\"\n *         gap={10}\n *         color=\"#f1f1f1\"\n *         variant={BackgroundVariant.Lines}\n *       />\n *       <Background\n *         id=\"2\"\n *         gap={100}\n *         color=\"#ccc\"\n *         variant={BackgroundVariant.Lines}\n *       />\n *     </ReactFlow>\n *   );\n * }\n * ```\n *\n * @remarks\n *\n * When combining multiple <Background /> components it’s important to give each of them a unique id prop!\n *\n */\nconst Background = memo(BackgroundComponent);\n\nfunction PlusIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 32\", children: jsx(\"path\", { d: \"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z\" }) }));\n}\n\nfunction MinusIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 5\", children: jsx(\"path\", { d: \"M0 0h32v4.2H0z\" }) }));\n}\n\nfunction FitViewIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 30\", children: jsx(\"path\", { d: \"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z\" }) }));\n}\n\nfunction LockIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 25 32\", children: jsx(\"path\", { d: \"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z\" }) }));\n}\n\nfunction UnlockIcon() {\n    return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 25 32\", children: jsx(\"path\", { d: \"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z\" }) }));\n}\n\n/**\n * You can add buttons to the control panel by using the `<ControlButton />` component\n * and pass it as a child to the [`<Controls />`](/api-reference/components/controls) component.\n *\n * @public\n * @example\n *```jsx\n *import { MagicWand } from '@radix-ui/react-icons'\n *import { ReactFlow, Controls, ControlButton } from '@xyflow/react'\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlow nodes={[...]} edges={[...]}>\n *      <Controls>\n *        <ControlButton onClick={() => alert('Something magical just happened. ✨')}>\n *          <MagicWand />\n *        </ControlButton>\n *      </Controls>\n *    </ReactFlow>\n *  )\n *}\n *```\n */\nfunction ControlButton({ children, className, ...rest }) {\n    return (jsx(\"button\", { type: \"button\", className: cc(['react-flow__controls-button', className]), ...rest, children: children }));\n}\n\nconst selector$2 = (s) => ({\n    isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,\n    minZoomReached: s.transform[2] <= s.minZoom,\n    maxZoomReached: s.transform[2] >= s.maxZoom,\n    ariaLabelConfig: s.ariaLabelConfig,\n});\nfunction ControlsComponent({ style, showZoom = true, showFitView = true, showInteractive = true, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children, position = 'bottom-left', orientation = 'vertical', 'aria-label': ariaLabel, }) {\n    const store = useStoreApi();\n    const { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector$2, shallow);\n    const { zoomIn, zoomOut, fitView } = useReactFlow();\n    const onZoomInHandler = () => {\n        zoomIn();\n        onZoomIn?.();\n    };\n    const onZoomOutHandler = () => {\n        zoomOut();\n        onZoomOut?.();\n    };\n    const onFitViewHandler = () => {\n        fitView(fitViewOptions);\n        onFitView?.();\n    };\n    const onToggleInteractivity = () => {\n        store.setState({\n            nodesDraggable: !isInteractive,\n            nodesConnectable: !isInteractive,\n            elementsSelectable: !isInteractive,\n        });\n        onInteractiveChange?.(!isInteractive);\n    };\n    const orientationClass = orientation === 'horizontal' ? 'horizontal' : 'vertical';\n    return (jsxs(Panel, { className: cc(['react-flow__controls', orientationClass, className]), position: position, style: style, \"data-testid\": \"rf__controls\", \"aria-label\": ariaLabel ?? ariaLabelConfig['controls.ariaLabel'], children: [showZoom && (jsxs(Fragment, { children: [jsx(ControlButton, { onClick: onZoomInHandler, className: \"react-flow__controls-zoomin\", title: ariaLabelConfig['controls.zoomIn.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.zoomIn.ariaLabel'], disabled: maxZoomReached, children: jsx(PlusIcon, {}) }), jsx(ControlButton, { onClick: onZoomOutHandler, className: \"react-flow__controls-zoomout\", title: ariaLabelConfig['controls.zoomOut.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.zoomOut.ariaLabel'], disabled: minZoomReached, children: jsx(MinusIcon, {}) })] })), showFitView && (jsx(ControlButton, { className: \"react-flow__controls-fitview\", onClick: onFitViewHandler, title: ariaLabelConfig['controls.fitView.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.fitView.ariaLabel'], children: jsx(FitViewIcon, {}) })), showInteractive && (jsx(ControlButton, { className: \"react-flow__controls-interactive\", onClick: onToggleInteractivity, title: ariaLabelConfig['controls.interactive.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.interactive.ariaLabel'], children: isInteractive ? jsx(UnlockIcon, {}) : jsx(LockIcon, {}) })), children] }));\n}\nControlsComponent.displayName = 'Controls';\n/**\n * The `<Controls />` component renders a small panel that contains convenient\n * buttons to zoom in, zoom out, fit the view, and lock the viewport.\n *\n * @public\n * @example\n *```tsx\n *import { ReactFlow, Controls } from '@xyflow/react'\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlow nodes={[...]} edges={[...]}>\n *      <Controls />\n *    </ReactFlow>\n *  )\n *}\n *```\n *\n * @remarks To extend or customise the controls, you can use the [`<ControlButton />`](/api-reference/components/control-button) component\n *\n */\nconst Controls = memo(ControlsComponent);\n\nfunction MiniMapNodeComponent({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, selected, onClick, }) {\n    const { background, backgroundColor } = style || {};\n    const fill = (color || background || backgroundColor);\n    return (jsx(\"rect\", { className: cc(['react-flow__minimap-node', { selected }, className]), x: x, y: y, rx: borderRadius, ry: borderRadius, width: width, height: height, style: {\n            fill,\n            stroke: strokeColor,\n            strokeWidth,\n        }, shapeRendering: shapeRendering, onClick: onClick ? (event) => onClick(event, id) : undefined }));\n}\nconst MiniMapNode = memo(MiniMapNodeComponent);\n\nconst selectorNodeIds = (s) => s.nodes.map((node) => node.id);\nconst getAttrFunction = (func) => func instanceof Function ? func : () => func;\nfunction MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, \n/*\n * We need to rename the prop to be `CapitalCase` so that JSX will render it as\n * a component properly.\n */\nnodeComponent: NodeComponent = MiniMapNode, onClick, }) {\n    const nodeIds = useStore(selectorNodeIds, shallow);\n    const nodeColorFunc = getAttrFunction(nodeColor);\n    const nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor);\n    const nodeClassNameFunc = getAttrFunction(nodeClassName);\n    const shapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision';\n    return (jsx(Fragment, { children: nodeIds.map((nodeId) => (\n        /*\n         * The split of responsibilities between MiniMapNodes and\n         * NodeComponentWrapper may appear weird. However, it’s designed to\n         * minimize the cost of updates when individual nodes change.\n         *\n         * For more details, see a similar commit in `NodeRenderer/index.tsx`.\n         */\n        jsx(NodeComponentWrapper, { id: nodeId, nodeColorFunc: nodeColorFunc, nodeStrokeColorFunc: nodeStrokeColorFunc, nodeClassNameFunc: nodeClassNameFunc, nodeBorderRadius: nodeBorderRadius, nodeStrokeWidth: nodeStrokeWidth, NodeComponent: NodeComponent, onClick: onClick, shapeRendering: shapeRendering }, nodeId))) }));\n}\nfunction NodeComponentWrapperInner({ id, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick, }) {\n    const { node, x, y, width, height } = useStore((s) => {\n        const node = s.nodeLookup.get(id);\n        if (!node) {\n            return { node: undefined, x: 0, y: 0, width: 0, height: 0 };\n        }\n        const userNode = node.internals.userNode;\n        const { x, y } = node.internals.positionAbsolute;\n        const { width, height } = getNodeDimensions(userNode);\n        return {\n            node: userNode,\n            x,\n            y,\n            width,\n            height,\n        };\n    }, shallow);\n    if (!node || node.hidden || !nodeHasDimensions(node)) {\n        return null;\n    }\n    return (jsx(NodeComponent, { x: x, y: y, width: width, height: height, style: node.style, selected: !!node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering: shapeRendering, onClick: onClick, id: node.id }));\n}\nconst NodeComponentWrapper = memo(NodeComponentWrapperInner);\nvar MiniMapNodes$1 = memo(MiniMapNodes);\n\nconst defaultWidth = 200;\nconst defaultHeight = 150;\nconst filterHidden = (node) => !node.hidden;\nconst selector$1 = (s) => {\n    const viewBB = {\n        x: -s.transform[0] / s.transform[2],\n        y: -s.transform[1] / s.transform[2],\n        width: s.width / s.transform[2],\n        height: s.height / s.transform[2],\n    };\n    return {\n        viewBB,\n        boundingRect: s.nodeLookup.size > 0\n            ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB)\n            : viewBB,\n        rfId: s.rfId,\n        panZoom: s.panZoom,\n        translateExtent: s.translateExtent,\n        flowWidth: s.width,\n        flowHeight: s.height,\n        ariaLabelConfig: s.ariaLabelConfig,\n    };\n};\nconst ARIA_LABEL_KEY = 'react-flow__minimap-desc';\nfunction MiniMapComponent({ style, className, nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, \n/*\n * We need to rename the prop to be `CapitalCase` so that JSX will render it as\n * a component properly.\n */\nnodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel, inversePan, zoomStep = 1, offsetScale = 5, }) {\n    const store = useStoreApi();\n    const svg = useRef(null);\n    const { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow);\n    const elementWidth = style?.width ?? defaultWidth;\n    const elementHeight = style?.height ?? defaultHeight;\n    const scaledWidth = boundingRect.width / elementWidth;\n    const scaledHeight = boundingRect.height / elementHeight;\n    const viewScale = Math.max(scaledWidth, scaledHeight);\n    const viewWidth = viewScale * elementWidth;\n    const viewHeight = viewScale * elementHeight;\n    const offset = offsetScale * viewScale;\n    const x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset;\n    const y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;\n    const width = viewWidth + offset * 2;\n    const height = viewHeight + offset * 2;\n    const labelledBy = `${ARIA_LABEL_KEY}-${rfId}`;\n    const viewScaleRef = useRef(0);\n    const minimapInstance = useRef();\n    viewScaleRef.current = viewScale;\n    useEffect(() => {\n        if (svg.current && panZoom) {\n            minimapInstance.current = XYMinimap({\n                domNode: svg.current,\n                panZoom,\n                getTransform: () => store.getState().transform,\n                getViewScale: () => viewScaleRef.current,\n            });\n            return () => {\n                minimapInstance.current?.destroy();\n            };\n        }\n    }, [panZoom]);\n    useEffect(() => {\n        minimapInstance.current?.update({\n            translateExtent,\n            width: flowWidth,\n            height: flowHeight,\n            inversePan,\n            pannable,\n            zoomStep,\n            zoomable,\n        });\n    }, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]);\n    const onSvgClick = onClick\n        ? (event) => {\n            const [x, y] = minimapInstance.current?.pointer(event) || [0, 0];\n            onClick(event, { x, y });\n        }\n        : undefined;\n    const onSvgNodeClick = onNodeClick\n        ? useCallback((event, nodeId) => {\n            const node = store.getState().nodeLookup.get(nodeId).internals.userNode;\n            onNodeClick(event, node);\n        }, [])\n        : undefined;\n    const _ariaLabel = ariaLabel ?? ariaLabelConfig['minimap.ariaLabel'];\n    return (jsx(Panel, { position: position, style: {\n            ...style,\n            '--xy-minimap-background-color-props': typeof bgColor === 'string' ? bgColor : undefined,\n            '--xy-minimap-mask-background-color-props': typeof maskColor === 'string' ? maskColor : undefined,\n            '--xy-minimap-mask-stroke-color-props': typeof maskStrokeColor === 'string' ? maskStrokeColor : undefined,\n            '--xy-minimap-mask-stroke-width-props': typeof maskStrokeWidth === 'number' ? maskStrokeWidth * viewScale : undefined,\n            '--xy-minimap-node-background-color-props': typeof nodeColor === 'string' ? nodeColor : undefined,\n            '--xy-minimap-node-stroke-color-props': typeof nodeStrokeColor === 'string' ? nodeStrokeColor : undefined,\n            '--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === 'number' ? nodeStrokeWidth : undefined,\n        }, className: cc(['react-flow__minimap', className]), \"data-testid\": \"rf__minimap\", children: jsxs(\"svg\", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, className: \"react-flow__minimap-svg\", role: \"img\", \"aria-labelledby\": labelledBy, ref: svg, onClick: onSvgClick, children: [_ariaLabel && jsx(\"title\", { id: labelledBy, children: _ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor, nodeBorderRadius: nodeBorderRadius, nodeClassName: nodeClassName, nodeStrokeWidth: nodeStrokeWidth, nodeComponent: nodeComponent }), jsx(\"path\", { className: \"react-flow__minimap-mask\", d: `M${x - offset},${y - offset}h${width + offset * 2}v${height + offset * 2}h${-width - offset * 2}z\n        M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: \"evenodd\", pointerEvents: \"none\" })] }) }));\n}\nMiniMapComponent.displayName = 'MiniMap';\n/**\n * The `<MiniMap />` component can be used to render an overview of your flow. It\n * renders each node as an SVG element and visualizes where the current viewport is\n * in relation to the rest of the flow.\n *\n * @public\n * @example\n *\n * ```jsx\n *import { ReactFlow, MiniMap } from '@xyflow/react';\n *\n *export default function Flow() {\n *  return (\n *    <ReactFlow nodes={[...]} edges={[...]}>\n *      <MiniMap nodeStrokeWidth={3} />\n *    </ReactFlow>\n *  );\n *}\n *```\n */\nconst MiniMap = memo(MiniMapComponent);\n\nconst scaleSelector = (calculateScale) => (store) => calculateScale ? `${Math.max(1 / store.transform[2], 1)}` : undefined;\nconst defaultPositions = {\n    [ResizeControlVariant.Line]: 'right',\n    [ResizeControlVariant.Handle]: 'bottom-right',\n};\nfunction ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle, className, style = undefined, children, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, resizeDirection, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) {\n    const contextNodeId = useNodeId();\n    const id = typeof nodeId === 'string' ? nodeId : contextNodeId;\n    const store = useStoreApi();\n    const resizeControlRef = useRef(null);\n    const isHandleControl = variant === ResizeControlVariant.Handle;\n    const scale = useStore(useCallback(scaleSelector(isHandleControl && autoScale), [isHandleControl, autoScale]), shallow);\n    const resizer = useRef(null);\n    const controlPosition = position ?? defaultPositions[variant];\n    useEffect(() => {\n        if (!resizeControlRef.current || !id) {\n            return;\n        }\n        if (!resizer.current) {\n            resizer.current = XYResizer({\n                domNode: resizeControlRef.current,\n                nodeId: id,\n                getStoreItems: () => {\n                    const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, domNode } = store.getState();\n                    return {\n                        nodeLookup,\n                        transform,\n                        snapGrid,\n                        snapToGrid,\n                        nodeOrigin,\n                        paneDomNode: domNode,\n                    };\n                },\n                onChange: (change, childChanges) => {\n                    const { triggerNodeChanges, nodeLookup, parentLookup, nodeOrigin } = store.getState();\n                    const changes = [];\n                    const nextPosition = { x: change.x, y: change.y };\n                    const node = nodeLookup.get(id);\n                    if (node && node.expandParent && node.parentId) {\n                        const origin = node.origin ?? nodeOrigin;\n                        const width = change.width ?? node.measured.width ?? 0;\n                        const height = change.height ?? node.measured.height ?? 0;\n                        const child = {\n                            id: node.id,\n                            parentId: node.parentId,\n                            rect: {\n                                width,\n                                height,\n                                ...evaluateAbsolutePosition({\n                                    x: change.x ?? node.position.x,\n                                    y: change.y ?? node.position.y,\n                                }, { width, height }, node.parentId, nodeLookup, origin),\n                            },\n                        };\n                        const parentExpandChanges = handleExpandParent([child], nodeLookup, parentLookup, nodeOrigin);\n                        changes.push(...parentExpandChanges);\n                        /*\n                         * when the parent was expanded by the child node, its position will be clamped at\n                         * 0,0 when node origin is 0,0 and to width, height if it's 1,1\n                         */\n                        nextPosition.x = change.x ? Math.max(origin[0] * width, change.x) : undefined;\n                        nextPosition.y = change.y ? Math.max(origin[1] * height, change.y) : undefined;\n                    }\n                    if (nextPosition.x !== undefined && nextPosition.y !== undefined) {\n                        const positionChange = {\n                            id,\n                            type: 'position',\n                            position: { ...nextPosition },\n                        };\n                        changes.push(positionChange);\n                    }\n                    if (change.width !== undefined && change.height !== undefined) {\n                        const setAttributes = !resizeDirection ? true : resizeDirection === 'horizontal' ? 'width' : 'height';\n                        const dimensionChange = {\n                            id,\n                            type: 'dimensions',\n                            resizing: true,\n                            setAttributes,\n                            dimensions: {\n                                width: change.width,\n                                height: change.height,\n                            },\n                        };\n                        changes.push(dimensionChange);\n                    }\n                    for (const childChange of childChanges) {\n                        const positionChange = {\n                            ...childChange,\n                            type: 'position',\n                        };\n                        changes.push(positionChange);\n                    }\n                    triggerNodeChanges(changes);\n                },\n                onEnd: ({ width, height }) => {\n                    const dimensionChange = {\n                        id: id,\n                        type: 'dimensions',\n                        resizing: false,\n                        dimensions: {\n                            width,\n                            height,\n                        },\n                    };\n                    store.getState().triggerNodeChanges([dimensionChange]);\n                },\n            });\n        }\n        resizer.current.update({\n            controlPosition,\n            boundaries: {\n                minWidth,\n                minHeight,\n                maxWidth,\n                maxHeight,\n            },\n            keepAspectRatio,\n            resizeDirection,\n            onResizeStart,\n            onResize,\n            onResizeEnd,\n            shouldResize,\n        });\n        return () => {\n            resizer.current?.destroy();\n        };\n    }, [\n        controlPosition,\n        minWidth,\n        minHeight,\n        maxWidth,\n        maxHeight,\n        keepAspectRatio,\n        onResizeStart,\n        onResize,\n        onResizeEnd,\n        shouldResize,\n    ]);\n    const positionClassNames = controlPosition.split('-');\n    return (jsx(\"div\", { className: cc(['react-flow__resize-control', 'nodrag', ...positionClassNames, variant, className]), ref: resizeControlRef, style: {\n            ...style,\n            scale,\n            ...(color && { [isHandleControl ? 'backgroundColor' : 'borderColor']: color }),\n        }, children: children }));\n}\n/**\n * To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons).\n * @public\n *\n */\nconst NodeResizeControl = memo(ResizeControl);\n\n/**\n * The `<NodeResizer />` component can be used to add a resize functionality to your\n * nodes. It renders draggable controls around the node to resize in all directions.\n * @public\n *\n * @example\n *```jsx\n *import { memo } from 'react';\n *import { Handle, Position, NodeResizer } from '@xyflow/react';\n *\n *function ResizableNode({ data }) {\n *  return (\n *    <>\n *      <NodeResizer minWidth={100} minHeight={30} />\n *      <Handle type=\"target\" position={Position.Left} />\n *      <div style={{ padding: 10 }}>{data.label}</div>\n *      <Handle type=\"source\" position={Position.Right} />\n *    </>\n *  );\n *};\n *\n *export default memo(ResizableNode);\n *```\n */\nfunction NodeResizer({ nodeId, isVisible = true, handleClassName, handleStyle, lineClassName, lineStyle, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) {\n    if (!isVisible) {\n        return null;\n    }\n    return (jsxs(Fragment, { children: [XY_RESIZER_LINE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: lineClassName, style: lineStyle, nodeId: nodeId, position: position, variant: ResizeControlVariant.Line, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position))), XY_RESIZER_HANDLE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: handleClassName, style: handleStyle, nodeId: nodeId, position: position, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position)))] }));\n}\n\nconst selector = (state) => state.domNode?.querySelector('.react-flow__renderer');\nfunction NodeToolbarPortal({ children }) {\n    const wrapperRef = useStore(selector);\n    if (!wrapperRef) {\n        return null;\n    }\n    return createPortal(children, wrapperRef);\n}\n\nconst nodeEqualityFn = (a, b) => a?.internals.positionAbsolute.x !== b?.internals.positionAbsolute.x ||\n    a?.internals.positionAbsolute.y !== b?.internals.positionAbsolute.y ||\n    a?.measured.width !== b?.measured.width ||\n    a?.measured.height !== b?.measured.height ||\n    a?.selected !== b?.selected ||\n    a?.internals.z !== b?.internals.z;\nconst nodesEqualityFn = (a, b) => {\n    if (a.size !== b.size) {\n        return false;\n    }\n    for (const [key, node] of a) {\n        if (nodeEqualityFn(node, b.get(key))) {\n            return false;\n        }\n    }\n    return true;\n};\nconst storeSelector = (state) => ({\n    x: state.transform[0],\n    y: state.transform[1],\n    zoom: state.transform[2],\n    selectedNodesCount: state.nodes.filter((node) => node.selected).length,\n});\n/**\n * This component can render a toolbar or tooltip to one side of a custom node. This\n * toolbar doesn't scale with the viewport so that the content is always visible.\n *\n * @public\n * @example\n * ```jsx\n *import { memo } from 'react';\n *import { Handle, Position, NodeToolbar } from '@xyflow/react';\n *\n *function CustomNode({ data }) {\n *  return (\n *    <>\n *      <NodeToolbar isVisible={data.toolbarVisible} position={data.toolbarPosition}>\n *        <button>delete</button>\n *        <button>copy</button>\n *        <button>expand</button>\n *      </NodeToolbar>\n *\n *      <div style={{ padding: '10px 20px' }}>\n *        {data.label}\n *      </div>\n *\n *      <Handle type=\"target\" position={Position.Left} />\n *      <Handle type=\"source\" position={Position.Right} />\n *    </>\n *  );\n *};\n *\n *export default memo(CustomNode);\n *```\n * @remarks By default, the toolbar is only visible when a node is selected. If multiple\n * nodes are selected it will not be visible to prevent overlapping toolbars or\n * clutter. You can override this behavior by setting the `isVisible` prop to `true`.\n */\nfunction NodeToolbar({ nodeId, children, className, style, isVisible, position = Position.Top, offset = 10, align = 'center', ...rest }) {\n    const contextNodeId = useNodeId();\n    const nodesSelector = useCallback((state) => {\n        const nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ''];\n        const internalNodes = nodeIds.reduce((res, id) => {\n            const node = state.nodeLookup.get(id);\n            if (node) {\n                res.set(node.id, node);\n            }\n            return res;\n        }, new Map());\n        return internalNodes;\n    }, [nodeId, contextNodeId]);\n    const nodes = useStore(nodesSelector, nodesEqualityFn);\n    const { x, y, zoom, selectedNodesCount } = useStore(storeSelector, shallow);\n    // if isVisible is not set, we show the toolbar only if its node is selected and no other node is selected\n    const isActive = typeof isVisible === 'boolean'\n        ? isVisible\n        : nodes.size === 1 && nodes.values().next().value?.selected && selectedNodesCount === 1;\n    if (!isActive || !nodes.size) {\n        return null;\n    }\n    const nodeRect = getInternalNodesBounds(nodes);\n    const nodesArray = Array.from(nodes.values());\n    const zIndex = Math.max(...nodesArray.map((node) => node.internals.z + 1));\n    const wrapperStyle = {\n        position: 'absolute',\n        transform: getNodeToolbarTransform(nodeRect, { x, y, zoom }, position, offset, align),\n        zIndex,\n        ...style,\n    };\n    return (jsx(NodeToolbarPortal, { children: jsx(\"div\", { style: wrapperStyle, className: cc(['react-flow__node-toolbar', className]), ...rest, \"data-id\": nodesArray.reduce((acc, node) => `${acc}${node.id} `, '').trim(), children: children }) }));\n}\n\nconst zoomSelector = (state) => state.transform[2];\n/**\n * This component can render a toolbar or tooltip to one side of a custom edge. This\n * toolbar doesn't scale with the viewport so that the content stays the same size.\n *\n * @public\n * @example\n * ```jsx\n * import { EdgeToolbar, BaseEdge, getBezierPath, type EdgeProps } from \"@xyflow/react\";\n *\n * export function CustomEdge({ id, data, ...props }: EdgeProps) {\n *   const [edgePath, centerX, centerY] = getBezierPath(props);\n *\n *   return (\n *     <>\n *       <BaseEdge id={id} path={edgePath} />\n *       <EdgeToolbar edgeId={id} x={centerX} y={centerY} isVisible>\n *         <button onClick={() => console.log('edge', id, 'click')}}>Click me</button>\n *       </EdgeToolbar>\n *     </>\n *   );\n * }\n * ```\n */\nfunction EdgeToolbar({ edgeId, x, y, children, className, style, isVisible, alignX = 'center', alignY = 'center', ...rest }) {\n    const edgeSelector = useCallback((state) => state.edgeLookup.get(edgeId), [edgeId]);\n    const edge = useStore(edgeSelector, shallow);\n    const isActive = typeof isVisible === 'boolean' ? isVisible : edge?.selected;\n    const zoom = useStore(zoomSelector);\n    if (!isActive) {\n        return null;\n    }\n    const zIndex = (edge?.zIndex ?? 0) + 1;\n    const transform = getEdgeToolbarTransform(x, y, zoom, alignX, alignY);\n    return (jsx(EdgeLabelRenderer, { children: jsx(\"div\", { style: {\n                position: 'absolute',\n                transform,\n                zIndex,\n                pointerEvents: 'all',\n                transformOrigin: '0 0',\n                ...style,\n            }, className: cc(['react-flow__edge-toolbar', className]), \"data-id\": edge?.id ?? '', ...rest, children: children }) }));\n}\n\nexport { Background, BackgroundVariant, BaseEdge, BezierEdge, ControlButton, Controls, EdgeLabelRenderer, EdgeText, EdgeToolbar, Handle, MiniMap, MiniMapNode, NodeResizeControl, NodeResizer, NodeToolbar, Panel, index as ReactFlow, ReactFlowProvider, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge, ViewportPortal, applyEdgeChanges, applyNodeChanges, experimental_useOnEdgesChangeMiddleware, experimental_useOnNodesChangeMiddleware, getSimpleBezierPath, isEdge, isNode, useConnection, useEdges, useEdgesState, useHandleConnections, useInternalNode, useKeyPress, useNodeConnections, useNodeId, useNodes, useNodesData, useNodesInitialized, useNodesState, useOnSelectionChange, useOnViewportChange, useReactFlow, useStore, useStoreApi, useUpdateNodeInternals, useViewport };\n","/* this gets exported as style.css and can be used for the default theming */\n/* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */\n.react-flow {\n  direction: ltr;\n\n  --xy-edge-stroke-default: #b1b1b7;\n  --xy-edge-stroke-width-default: 1;\n  --xy-edge-stroke-selected-default: #555;\n\n  --xy-connectionline-stroke-default: #b1b1b7;\n  --xy-connectionline-stroke-width-default: 1;\n\n  --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);\n\n  --xy-minimap-background-color-default: #fff;\n  --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);\n  --xy-minimap-mask-stroke-color-default: transparent;\n  --xy-minimap-mask-stroke-width-default: 1;\n  --xy-minimap-node-background-color-default: #e2e2e2;\n  --xy-minimap-node-stroke-color-default: transparent;\n  --xy-minimap-node-stroke-width-default: 2;\n\n  --xy-background-color-default: transparent;\n  --xy-background-pattern-dots-color-default: #91919a;\n  --xy-background-pattern-lines-color-default: #eee;\n  --xy-background-pattern-cross-color-default: #e2e2e2;\n  background-color: var(--xy-background-color, var(--xy-background-color-default));\n  --xy-node-color-default: inherit;\n  --xy-node-border-default: 1px solid #1a192b;\n  --xy-node-background-color-default: #fff;\n  --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);\n  --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08);\n  --xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b;\n  --xy-node-border-radius-default: 3px;\n\n  --xy-handle-background-color-default: #1a192b;\n  --xy-handle-border-color-default: #fff;\n\n  --xy-selection-background-color-default: rgba(0, 89, 220, 0.08);\n  --xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8);\n\n  --xy-controls-button-background-color-default: #fefefe;\n  --xy-controls-button-background-color-hover-default: #f4f4f4;\n  --xy-controls-button-color-default: inherit;\n  --xy-controls-button-color-hover-default: inherit;\n  --xy-controls-button-border-color-default: #eee;\n  --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);\n\n  --xy-edge-label-background-color-default: #ffffff;\n  --xy-edge-label-color-default: inherit;\n  --xy-resize-background-color-default: #3367d9;\n}\n.react-flow.dark {\n  --xy-edge-stroke-default: #3e3e3e;\n  --xy-edge-stroke-width-default: 1;\n  --xy-edge-stroke-selected-default: #727272;\n\n  --xy-connectionline-stroke-default: #b1b1b7;\n  --xy-connectionline-stroke-width-default: 1;\n\n  --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);\n\n  --xy-minimap-background-color-default: #141414;\n  --xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6);\n  --xy-minimap-mask-stroke-color-default: transparent;\n  --xy-minimap-mask-stroke-width-default: 1;\n  --xy-minimap-node-background-color-default: #2b2b2b;\n  --xy-minimap-node-stroke-color-default: transparent;\n  --xy-minimap-node-stroke-width-default: 2;\n\n  --xy-background-color-default: #141414;\n  --xy-background-pattern-dots-color-default: #777;\n  --xy-background-pattern-lines-color-default: #777;\n  --xy-background-pattern-cross-color-default: #777;\n  --xy-node-color-default: #f8f8f8;\n  --xy-node-border-default: 1px solid #3c3c3c;\n  --xy-node-background-color-default: #1e1e1e;\n  --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);\n  --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08);\n  --xy-node-boxshadow-selected-default: 0 0 0 0.5px #999;\n\n  --xy-handle-background-color-default: #bebebe;\n  --xy-handle-border-color-default: #1e1e1e;\n\n  --xy-selection-background-color-default: rgba(200, 200, 220, 0.08);\n  --xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8);\n\n  --xy-controls-button-background-color-default: #2b2b2b;\n  --xy-controls-button-background-color-hover-default: #3e3e3e;\n  --xy-controls-button-color-default: #f8f8f8;\n  --xy-controls-button-color-hover-default: #fff;\n  --xy-controls-button-border-color-default: #5b5b5b;\n  --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);\n\n  --xy-edge-label-background-color-default: #141414;\n  --xy-edge-label-color-default: #f8f8f8;\n}\n.react-flow__background {\n  background-color: var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));\n  pointer-events: none;\n  z-index: -1;\n}\n.react-flow__container {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  top: 0;\n  left: 0;\n}\n.react-flow__pane {\n  z-index: 1;\n}\n.react-flow__pane.draggable {\n    cursor: grab;\n  }\n.react-flow__pane.dragging {\n    cursor: grabbing;\n  }\n.react-flow__pane.selection {\n    cursor: pointer;\n  }\n.react-flow__viewport {\n  transform-origin: 0 0;\n  z-index: 2;\n  pointer-events: none;\n}\n.react-flow__renderer {\n  z-index: 4;\n}\n.react-flow__selection {\n  z-index: 6;\n}\n.react-flow__nodesselection-rect:focus,\n.react-flow__nodesselection-rect:focus-visible {\n  outline: none;\n}\n.react-flow__edge-path {\n  stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));\n  stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));\n  fill: none;\n}\n.react-flow__connection-path {\n  stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));\n  stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));\n  fill: none;\n}\n.react-flow .react-flow__edges {\n  position: absolute;\n}\n.react-flow .react-flow__edges svg {\n    overflow: visible;\n    position: absolute;\n    pointer-events: none;\n  }\n.react-flow__edge {\n  pointer-events: visibleStroke;\n}\n.react-flow__edge.selectable {\n    cursor: pointer;\n  }\n.react-flow__edge.animated path {\n    stroke-dasharray: 5;\n    animation: dashdraw 0.5s linear infinite;\n  }\n.react-flow__edge.animated path.react-flow__edge-interaction {\n    stroke-dasharray: none;\n    animation: none;\n  }\n.react-flow__edge.inactive {\n    pointer-events: none;\n  }\n.react-flow__edge.selected,\n  .react-flow__edge:focus,\n  .react-flow__edge:focus-visible {\n    outline: none;\n  }\n.react-flow__edge.selected .react-flow__edge-path,\n  .react-flow__edge.selectable:focus .react-flow__edge-path,\n  .react-flow__edge.selectable:focus-visible .react-flow__edge-path {\n    stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default));\n  }\n.react-flow__edge-textwrapper {\n    pointer-events: all;\n  }\n.react-flow__edge .react-flow__edge-text {\n    pointer-events: none;\n    -webkit-user-select: none;\n       -moz-user-select: none;\n            user-select: none;\n  }\n/* Arrowhead marker styles - use CSS custom properties as default */\n.react-flow__arrowhead polyline {\n  stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));\n}\n.react-flow__arrowhead polyline.arrowclosed {\n  fill: var(--xy-edge-stroke, var(--xy-edge-stroke-default));\n}\n.react-flow__connection {\n  pointer-events: none;\n}\n.react-flow__connection .animated {\n    stroke-dasharray: 5;\n    animation: dashdraw 0.5s linear infinite;\n  }\nsvg.react-flow__connectionline {\n  z-index: 1001;\n  overflow: visible;\n  position: absolute;\n}\n.react-flow__nodes {\n  pointer-events: none;\n  transform-origin: 0 0;\n}\n.react-flow__node {\n  position: absolute;\n  -webkit-user-select: none;\n     -moz-user-select: none;\n          user-select: none;\n  pointer-events: all;\n  transform-origin: 0 0;\n  box-sizing: border-box;\n  cursor: default;\n}\n.react-flow__node.selectable {\n    cursor: pointer;\n  }\n.react-flow__node.draggable {\n    cursor: grab;\n    pointer-events: all;\n  }\n.react-flow__node.draggable.dragging {\n      cursor: grabbing;\n    }\n.react-flow__nodesselection {\n  z-index: 3;\n  transform-origin: left top;\n  pointer-events: none;\n}\n.react-flow__nodesselection-rect {\n    position: absolute;\n    pointer-events: all;\n    cursor: grab;\n  }\n.react-flow__handle {\n  position: absolute;\n  pointer-events: none;\n  min-width: 5px;\n  min-height: 5px;\n  width: 6px;\n  height: 6px;\n  background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default));\n  border: 1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));\n  border-radius: 100%;\n}\n.react-flow__handle.connectingfrom {\n    pointer-events: all;\n  }\n.react-flow__handle.connectionindicator {\n    pointer-events: all;\n    cursor: crosshair;\n  }\n.react-flow__handle-bottom {\n    top: auto;\n    left: 50%;\n    bottom: 0;\n    transform: translate(-50%, 50%);\n  }\n.react-flow__handle-top {\n    top: 0;\n    left: 50%;\n    transform: translate(-50%, -50%);\n  }\n.react-flow__handle-left {\n    top: 50%;\n    left: 0;\n    transform: translate(-50%, -50%);\n  }\n.react-flow__handle-right {\n    top: 50%;\n    right: 0;\n    transform: translate(50%, -50%);\n  }\n.react-flow__edgeupdater {\n  cursor: move;\n  pointer-events: all;\n}\n.react-flow__pane.selection .react-flow__panel {\n  pointer-events: none;\n}\n.react-flow__panel {\n  position: absolute;\n  z-index: 5;\n  margin: 15px;\n}\n.react-flow__panel.top {\n    top: 0;\n  }\n.react-flow__panel.bottom {\n    bottom: 0;\n  }\n.react-flow__panel.top.center, .react-flow__panel.bottom.center {\n      left: 50%;\n      transform: translateX(-15px) translateX(-50%);\n    }\n.react-flow__panel.left {\n    left: 0;\n  }\n.react-flow__panel.right {\n    right: 0;\n  }\n.react-flow__panel.left.center, .react-flow__panel.right.center {\n      top: 50%;\n      transform: translateY(-15px) translateY(-50%);\n    }\n.react-flow__attribution {\n  font-size: 10px;\n  background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));\n  padding: 2px 3px;\n  margin: 0;\n}\n.react-flow__attribution a {\n    text-decoration: none;\n    color: #999;\n  }\n@keyframes dashdraw {\n  from {\n    stroke-dashoffset: 10;\n  }\n}\n.react-flow__edgelabel-renderer {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  pointer-events: none;\n  -webkit-user-select: none;\n     -moz-user-select: none;\n          user-select: none;\n  left: 0;\n  top: 0;\n}\n.react-flow__viewport-portal {\n  position: absolute;\n  width: 100%;\n  height: 100%;\n  left: 0;\n  top: 0;\n  -webkit-user-select: none;\n     -moz-user-select: none;\n          user-select: none;\n}\n.react-flow__minimap {\n  background: var(\n    --xy-minimap-background-color-props,\n    var(--xy-minimap-background-color, var(--xy-minimap-background-color-default))\n  );\n}\n.react-flow__minimap-svg {\n    display: block;\n  }\n.react-flow__minimap-mask {\n    fill: var(\n      --xy-minimap-mask-background-color-props,\n      var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default))\n    );\n    stroke: var(\n      --xy-minimap-mask-stroke-color-props,\n      var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default))\n    );\n    stroke-width: var(\n      --xy-minimap-mask-stroke-width-props,\n      var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default))\n    );\n  }\n.react-flow__minimap-node {\n    fill: var(\n      --xy-minimap-node-background-color-props,\n      var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default))\n    );\n    stroke: var(\n      --xy-minimap-node-stroke-color-props,\n      var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default))\n    );\n    stroke-width: var(\n      --xy-minimap-node-stroke-width-props,\n      var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default))\n    );\n  }\n.react-flow__background-pattern.dots {\n    fill: var(\n      --xy-background-pattern-color-props,\n      var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default))\n    );\n  }\n.react-flow__background-pattern.lines {\n    stroke: var(\n      --xy-background-pattern-color-props,\n      var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default))\n    );\n  }\n.react-flow__background-pattern.cross {\n    stroke: var(\n      --xy-background-pattern-color-props,\n      var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default))\n    );\n  }\n.react-flow__controls {\n  display: flex;\n  flex-direction: column;\n  box-shadow: var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default));\n}\n.react-flow__controls.horizontal {\n    flex-direction: row;\n  }\n.react-flow__controls-button {\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    height: 26px;\n    width: 26px;\n    padding: 4px;\n    border: none;\n    background: var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));\n    border-bottom: 1px solid\n      var(\n        --xy-controls-button-border-color-props,\n        var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))\n      );\n    color: var(\n      --xy-controls-button-color-props,\n      var(--xy-controls-button-color, var(--xy-controls-button-color-default))\n    );\n    cursor: pointer;\n    -webkit-user-select: none;\n       -moz-user-select: none;\n            user-select: none;\n  }\n.react-flow__controls-button svg {\n      width: 100%;\n      max-width: 12px;\n      max-height: 12px;\n      fill: currentColor;\n    }\n.react-flow__edge.updating .react-flow__edge-path {\n      stroke: #777;\n    }\n.react-flow__edge-text {\n    font-size: 10px;\n  }\n.react-flow__node.selectable:focus,\n  .react-flow__node.selectable:focus-visible {\n    outline: none;\n  }\n.react-flow__node-input,\n.react-flow__node-default,\n.react-flow__node-output,\n.react-flow__node-group {\n  padding: 10px;\n  border-radius: var(--xy-node-border-radius, var(--xy-node-border-radius-default));\n  width: 150px;\n  font-size: 12px;\n  color: var(--xy-node-color, var(--xy-node-color-default));\n  text-align: center;\n  border: var(--xy-node-border, var(--xy-node-border-default));\n  background-color: var(--xy-node-background-color, var(--xy-node-background-color-default));\n}\n.react-flow__node-input.selectable:hover, .react-flow__node-default.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover {\n      box-shadow: var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default));\n    }\n.react-flow__node-input.selectable.selected,\n    .react-flow__node-input.selectable:focus,\n    .react-flow__node-input.selectable:focus-visible,\n    .react-flow__node-default.selectable.selected,\n    .react-flow__node-default.selectable:focus,\n    .react-flow__node-default.selectable:focus-visible,\n    .react-flow__node-output.selectable.selected,\n    .react-flow__node-output.selectable:focus,\n    .react-flow__node-output.selectable:focus-visible,\n    .react-flow__node-group.selectable.selected,\n    .react-flow__node-group.selectable:focus,\n    .react-flow__node-group.selectable:focus-visible {\n      box-shadow: var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default));\n    }\n.react-flow__node-group {\n  background-color: var(--xy-node-group-background-color, var(--xy-node-group-background-color-default));\n}\n.react-flow__nodesselection-rect,\n.react-flow__selection {\n  background: var(--xy-selection-background-color, var(--xy-selection-background-color-default));\n  border: var(--xy-selection-border, var(--xy-selection-border-default));\n}\n.react-flow__nodesselection-rect:focus,\n  .react-flow__nodesselection-rect:focus-visible,\n  .react-flow__selection:focus,\n  .react-flow__selection:focus-visible {\n    outline: none;\n  }\n.react-flow__controls-button:hover {\n      background: var(\n        --xy-controls-button-background-color-hover-props,\n        var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default))\n      );\n      color: var(\n        --xy-controls-button-color-hover-props,\n        var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default))\n      );\n    }\n.react-flow__controls-button:disabled {\n      pointer-events: none;\n    }\n.react-flow__controls-button:disabled svg {\n        fill-opacity: 0.4;\n      }\n.react-flow__controls-button:last-child {\n    border-bottom: none;\n  }\n.react-flow__controls.horizontal .react-flow__controls-button {\n    border-bottom: none;\n    border-right: 1px solid\n      var(\n        --xy-controls-button-border-color-props,\n        var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))\n      );\n  }\n.react-flow__controls.horizontal .react-flow__controls-button:last-child {\n    border-right: none;\n  }\n.react-flow__resize-control {\n  position: absolute;\n}\n.react-flow__resize-control.left,\n.react-flow__resize-control.right {\n  cursor: ew-resize;\n}\n.react-flow__resize-control.top,\n.react-flow__resize-control.bottom {\n  cursor: ns-resize;\n}\n.react-flow__resize-control.top.left,\n.react-flow__resize-control.bottom.right {\n  cursor: nwse-resize;\n}\n.react-flow__resize-control.bottom.left,\n.react-flow__resize-control.top.right {\n  cursor: nesw-resize;\n}\n/* handle styles */\n.react-flow__resize-control.handle {\n  width: 5px;\n  height: 5px;\n  border: 1px solid #fff;\n  border-radius: 1px;\n  background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));\n  translate: -50% -50%;\n}\n.react-flow__resize-control.handle.left {\n  left: 0;\n  top: 50%;\n}\n.react-flow__resize-control.handle.right {\n  left: 100%;\n  top: 50%;\n}\n.react-flow__resize-control.handle.top {\n  left: 50%;\n  top: 0;\n}\n.react-flow__resize-control.handle.bottom {\n  left: 50%;\n  top: 100%;\n}\n.react-flow__resize-control.handle.top.left {\n  left: 0;\n}\n.react-flow__resize-control.handle.bottom.left {\n  left: 0;\n}\n.react-flow__resize-control.handle.top.right {\n  left: 100%;\n}\n.react-flow__resize-control.handle.bottom.right {\n  left: 100%;\n}\n/* line styles */\n.react-flow__resize-control.line {\n  border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));\n  border-width: 0;\n  border-style: solid;\n}\n.react-flow__resize-control.line.left,\n.react-flow__resize-control.line.right {\n  width: 1px;\n  transform: translate(-50%, 0);\n  top: 0;\n  height: 100%;\n}\n.react-flow__resize-control.line.left {\n  left: 0;\n  border-left-width: 1px;\n}\n.react-flow__resize-control.line.right {\n  left: 100%;\n  border-right-width: 1px;\n}\n.react-flow__resize-control.line.top,\n.react-flow__resize-control.line.bottom {\n  height: 1px;\n  transform: translate(0, -50%);\n  left: 0;\n  width: 100%;\n}\n.react-flow__resize-control.line.top {\n  top: 0;\n  border-top-width: 1px;\n}\n.react-flow__resize-control.line.bottom {\n  border-bottom-width: 1px;\n  top: 100%;\n}\n.react-flow__edge-textbg {\n  fill: var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default));\n}\n.react-flow__edge-text {\n  fill: var(--xy-edge-label-color, var(--xy-edge-label-color-default));\n}\n","/*!\n * Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com\n * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)\n * Copyright 2026 Fonticons, Inc.\n */\nvar prefix = \"fas\";\nvar fa0 = {\n  prefix: 'fas',\n  iconName: '0',\n  icon: [320, 512, [], \"30\", \"M0 192C0 103.6 71.6 32 160 32s160 71.6 160 160l0 128c0 88.4-71.6 160-160 160S0 408.4 0 320L0 192zM160 96c-53 0-96 43-96 96l0 128c0 53 43 96 96 96s96-43 96-96l0-128c0-53-43-96-96-96z\"]\n};\nvar fa1 = {\n  prefix: 'fas',\n  iconName: '1',\n  icon: [256, 512, [], \"31\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l64 0 0 320-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-352c0-17.7-14.3-32-32-32L32 32z\"]\n};\nvar fa2 = {\n  prefix: 'fas',\n  iconName: '2',\n  icon: [384, 512, [], \"32\", \"M48 64c0-17.7 14.3-32 32-32l171 0c60.2 0 109 48.8 109 109 0 43.8-26.2 83.3-66.4 100.4l-139.1 59C119 315.4 96 350.2 96 388.7l0 27.3 224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 480c-17.7 0-32-14.3-32-32l0-59.3c0-64.2 38.4-122.2 97.5-147.3l139.1-59c16.6-7.1 27.4-23.4 27.4-41.4 0-24.9-20.2-45-45-45L80 96C62.3 96 48 81.7 48 64z\"]\n};\nvar fa3 = {\n  prefix: 'fas',\n  iconName: '3',\n  icon: [320, 512, [], \"33\", \"M80 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l112 0c35.3 0 64-28.7 64-64s-28.7-64-64-64L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l160 0c70.7 0 128 57.3 128 128 0 38.2-16.8 72.5-43.3 96 26.6 23.5 43.3 57.8 43.3 96 0 70.7-57.3 128-128 128L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c35.3 0 64-28.7 64-64s-28.7-64-64-64L80 288z\"]\n};\nvar fa4 = {\n  prefix: 'fas',\n  iconName: '4',\n  icon: [384, 512, [], \"34\", \"M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 288c0 35.3 28.7 64 64 64l192 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-224c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 224-192 0 0-224z\"]\n};\nvar fa5 = {\n  prefix: 'fas',\n  iconName: '5',\n  icon: [320, 512, [], \"35\", \"M0 64C0 46.3 14.3 32 32 32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0 0 112 120 0c75.1 0 136 60.9 136 136S259.1 480 184 480L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l152 0c39.8 0 72-32.2 72-72s-32.2-72-72-72L32 272c-17.7 0-32-14.3-32-32L0 64z\"]\n};\nvar fa6 = {\n  prefix: 'fas',\n  iconName: '6',\n  icon: [384, 512, [], \"36\", \"M256 32c17.7 0 32 14.3 32 32s-14.3 32-32 32l-88 0c-48.6 0-88 39.4-88 88l0 32.2c22.9-15.3 50.4-24.2 80-24.2l48 0c79.5 0 144 64.5 144 144S287.5 480 208 480l-48 0C80.5 480 16 415.5 16 336l0-152C16 100.1 84.1 32 168 32l88 0zM80 336c0 44.2 35.8 80 80 80l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80l-48 0c-44.2 0-80 35.8-80 80z\"]\n};\nvar fa7 = {\n  prefix: 'fas',\n  iconName: '7',\n  icon: [320, 512, [], \"37\", \"M0 64C0 46.3 14.3 32 32 32l256 0c11.5 0 22 6.1 27.7 16.1s5.7 22.2-.1 32.1l-224 384c-8.9 15.3-28.5 20.4-43.8 11.5s-20.4-28.5-11.5-43.8L232.3 96 32 96C14.3 96 0 81.7 0 64z\"]\n};\nvar fa8 = {\n  prefix: 'fas',\n  iconName: '8',\n  icon: [320, 512, [], \"38\", \"M304 160c0-70.7-57.3-128-128-128l-32 0c-70.7 0-128 57.3-128 128 0 34.6 13.7 66 36 89-31.5 23.3-52 60.8-52 103 0 70.7 57.3 128 128 128l64 0c70.7 0 128-57.3 128-128 0-42.2-20.5-79.7-52-103 22.3-23 36-54.4 36-89zM176.1 288l15.9 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64s28.7-64 64-64l48.1 0zm0-64L144 224c-35.3 0-64-28.7-64-64 0-35.3 28.7-64 64-64l32 0c35.3 0 64 28.7 64 64 0 35.3-28.6 64-64 64z\"]\n};\nvar fa9 = {\n  prefix: 'fas',\n  iconName: '9',\n  icon: [384, 512, [], \"39\", \"M208 320c29.6 0 57.1-8.9 80-24.2l0 32.2c0 48.6-39.4 88-88 88L96 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l104 0c83.9 0 152-68.1 152-152l0-152.1C351.9 96.4 287.5 32 208 32l-48 0C80.5 32 16 96.5 16 176S80.5 320 160 320l48 0zm80-144c0 44.2-35.8 80-80 80l-48 0c-44.2 0-80-35.8-80-80s35.8-80 80-80l48 0c44.2 0 80 35.8 80 80z\"]\n};\nvar faDollarSign = {\n  prefix: 'fas',\n  iconName: 'dollar-sign',\n  icon: [320, 512, [128178, 61781, \"dollar\", \"usd\"], \"24\", \"M136 24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40 56 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-114.9 0c-24.9 0-45.1 20.2-45.1 45.1 0 22.5 16.5 41.5 38.7 44.7l91.6 13.1c53.8 7.7 93.7 53.7 93.7 108 0 60.3-48.9 109.1-109.1 109.1l-10.9 0 0 40c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-40-72 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l130.9 0c24.9 0 45.1-20.2 45.1-45.1 0-22.5-16.5-41.5-38.7-44.7l-91.6-13.1C55.9 273.5 16 227.4 16 173.1 16 112.9 64.9 64 125.1 64l10.9 0 0-40z\"]\n};\nvar faDollar = faDollarSign;\nvar faUsd = faDollarSign;\nvar faDog = {\n  prefix: 'fas',\n  iconName: 'dog',\n  icon: [576, 512, [128021], \"f6d3\", \"M32 112c16.6 0 30.2 12.6 31.8 28.7l.3 6.6C65.8 163.4 79.4 176 96 176l179.1 0 140.9 60.4 0 243.6c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-131.3C296 361 268.8 368 240 368s-56-7-80-19.3L160 480c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-245.6c-37.3-13.2-64-48.6-64-90.4 0-17.7 14.3-32 32-32zM355.8-32c7.7 0 14.9 3.6 19.6 9.8L392 0 444.1 0c12.7 0 24.9 5.1 33.9 14.1L496 32 552 32c13.3 0 24 10.7 24 24l0 24c0 44.2-35.8 80-80 80l-64 0-7 28-124.7-53.4 31.6-147.2C334.3-23.9 344.2-32 355.8-32zM448 44a20 20 0 1 0 0 40 20 20 0 1 0 0-40z\"]\n};\nvar faTruckMoving = {\n  prefix: 'fas',\n  iconName: 'truck-moving',\n  icon: [640, 512, [], \"f4df\", \"M64 32C28.7 32 0 60.7 0 96L0 424c0 48.6 39.4 88 88 88 25.2 0 48-10.6 64-27.6 16 17 38.8 27.6 64 27.6 40.3 0 74.2-27.1 84.7-64l134.6 0c10.4 36.9 44.4 64 84.7 64 43 0 78.9-30.9 86.5-71.7 20-10.8 33.5-32 33.5-56.3l0-146.7c0-17-6.7-33.3-18.7-45.3L576 146.7c-12-12-28.3-18.7-45.3-18.7l-50.7 0 0-32c0-35.3-28.7-64-64-64L64 32zM480 192l50.7 0 45.3 45.3 0 50.7-96 0 0-96zM88 384a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm392 40a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM216 384a40 40 0 1 1 0 80 40 40 0 1 1 0-80z\"]\n};\nvar faRotate = {\n  prefix: 'fas',\n  iconName: 'rotate',\n  icon: [512, 512, [128260, \"sync-alt\"], \"f2f1\", \"M480.1 192l7.9 0c13.3 0 24-10.7 24-24l0-144c0-9.7-5.8-18.5-14.8-22.2S477.9 .2 471 7L419.3 58.8C375 22.1 318 0 256 0 127 0 20.3 95.4 2.6 219.5 .1 237 12.2 253.2 29.7 255.7s33.7-9.7 36.2-27.1C79.2 135.5 159.3 64 256 64 300.4 64 341.2 79 373.7 104.3L327 151c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 192 344 192l136.1 0zm29.4 100.5c2.5-17.5-9.7-33.7-27.1-36.2s-33.7 9.7-36.2 27.1c-13.3 93-93.4 164.5-190.1 164.5-44.4 0-85.2-15-117.7-40.3L185 361c6.9-6.9 8.9-17.2 5.2-26.2S177.7 320 168 320L24 320c-13.3 0-24 10.7-24 24L0 488c0 9.7 5.8 18.5 14.8 22.2S34.1 511.8 41 505l51.8-51.8C137 489.9 194 512 256 512 385 512 491.7 416.6 509.4 292.5z\"]\n};\nvar faSyncAlt = faRotate;\nvar faSquareMinus = {\n  prefix: 'fas',\n  iconName: 'square-minus',\n  icon: [448, 512, [61767, \"minus-square\"], \"f146\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm72 200l176 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-176 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faMinusSquare = faSquareMinus;\nvar faAlignJustify = {\n  prefix: 'fas',\n  iconName: 'align-justify',\n  icon: [448, 512, [], \"f039\", \"M448 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32L32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32z\"]\n};\nvar faCalendarCheck = {\n  prefix: 'fas',\n  iconName: 'calendar-check',\n  icon: [448, 512, [], \"f274\", \"M320 0c17.7 0 32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32zm22 161.7c-10.7-7.8-25.7-5.4-33.5 5.3L189.1 331.2 137 279.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.9 7.5 18.8 7s13.4-4.1 17.5-9.8L347.3 195.2c7.8-10.7 5.4-25.7-5.3-33.5z\"]\n};\nvar faFaceKiss = {\n  prefix: 'fas',\n  iconName: 'face-kiss',\n  icon: [512, 512, [128535, \"kiss\"], \"f596\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM240 288l32 0c26.5 0 48 21.5 48 48 0 12.3-4.6 23.5-12.2 32 7.6 8.5 12.2 19.7 12.2 32 0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zm-96-80a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faKiss = faFaceKiss;\nvar faKitchenSet = {\n  prefix: 'fas',\n  iconName: 'kitchen-set',\n  icon: [576, 512, [], \"e51a\", \"M240 144a96 96 0 1 0 -192 0 96 96 0 1 0 192 0zm44.4 32C269.9 240.1 212.5 288 144 288 64.5 288 0 223.5 0 144S64.5 0 144 0c68.5 0 125.9 47.9 140.4 112l71.8 0c8.8-9.8 21.6-16 35.8-16l104 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-104 0c-14.2 0-27-6.2-35.8-16l-71.8 0zM144 80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM400 240c13.3 0 24 10.7 24 24l0 8 96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-240 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0 0-8c0-13.3 10.7-24 24-24zM288 464l0-112 224 0 0 112c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48zM48 320l128 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-16 0c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-80c0-8.8 7.2-16 16-16zm128 64c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0 32 16 0zM24 464l176 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faDna = {\n  prefix: 'fas',\n  iconName: 'dna',\n  icon: [384, 512, [129516], \"f471\", \"M352 0c17.7 0 32 14.3 32 32 0 57.8-24.4 104.8-57.4 144.5-24.1 28.9-53.8 55.1-83.6 79.5 29.8 24.5 59.5 50.6 83.6 79.5 33 39.6 57.4 86.7 57.4 144.5 0 17.7-14.3 32-32 32s-32-14.3-32-32L64 480c0 17.7-14.3 32-32 32S0 497.7 0 480C0 422.2 24.4 375.2 57.4 335.5 81.5 306.6 111.2 280.5 141 256 111.2 231.5 81.5 205.4 57.4 176.5 24.4 136.8 0 89.8 0 32 0 14.3 14.3 0 32 0S64 14.3 64 32l256 0c0-17.7 14.3-32 32-32zM283.5 384l-182.9 0c-8.2 10.5-15.1 21.1-20.6 32l224.2 0c-5.6-10.9-12.5-21.5-20.6-32zM238 336c-14.3-13-29.8-25.8-46-39-16.2 13.1-31.7 26-46 39l92 0zM100.5 128l182.9 0c8.2-10.5 15.1-21.1 20.6-32L79.9 96c5.6 10.9 12.5 21.5 20.6 32zM146 176c14.3 13 29.8 25.8 46 39 16.2-13.1 31.7-26 46-39l-92 0z\"]\n};\nvar faChildReaching = {\n  prefix: 'fas',\n  iconName: 'child-reaching',\n  icon: [384, 512, [], \"e59d\", \"M256 64a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM152.9 169.3c-23.7-8.4-44.5-24.3-58.8-45.8L74.6 94.2C64.8 79.5 45 75.6 30.3 85.4S11.6 115 21.4 129.8L40.9 159c18.1 27.1 42.8 48.4 71.1 62.4L112 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-258.4c29.1-14.2 54.4-36.2 72.7-64.2l18.2-27.9c9.6-14.8 5.4-34.6-9.4-44.3s-34.6-5.5-44.3 9.4L291 122.4c-21.8 33.4-58.9 53.6-98.8 53.6-12.6 0-24.9-2-36.6-5.8-.9-.3-1.8-.7-2.7-.9z\"]\n};\nvar faPaste = {\n  prefix: 'fas',\n  iconName: 'paste',\n  icon: [512, 512, [\"file-clipboard\"], \"f0ea\", \"M64 0C28.7 0 0 28.7 0 64L0 384c0 35.3 28.7 64 64 64l112 0 0-224c0-61.9 50.1-112 112-112l64 0 0-48c0-35.3-28.7-64-64-64L64 0zM248 112l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24zm40 48c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64l160 0c35.3 0 64-28.7 64-64l0-165.5c0-17-6.7-33.3-18.7-45.3l-58.5-58.5c-12-12-28.3-18.7-45.3-18.7L288 160z\"]\n};\nvar faFileClipboard = faPaste;\nvar faMeteor = {\n  prefix: 'fas',\n  iconName: 'meteor',\n  icon: [512, 512, [9732], \"f753\", \"M493.7 .9l-194.2 74.7 2.3-29.3c1-12.8-12.8-21.5-24-15.1L101.3 133.4C38.6 169.7 0 236.6 0 309 0 421.1 90.9 512 203 512 275.4 512 342.3 473.4 378.6 410.7L480.8 234.3c6.5-11.1-2.2-25-15.1-24l-29.3 2.3 74.7-194.2c.6-1.5 .9-3.2 .9-4.8 0-7.5-6-13.5-13.5-13.5-1.7 0-3.3 .3-4.8 .9zM192 192a128 128 0 1 1 0 256 128 128 0 1 1 0-256zm0 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm16 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32z\"]\n};\nvar faGears = {\n  prefix: 'fas',\n  iconName: 'gears',\n  icon: [640, 512, [\"cogs\"], \"f085\", \"M415.9 210.5c12.2-3.3 25 2.5 30.5 13.8L465 261.9c10.3 1.4 20.4 4.2 29.9 8.1l35-23.3c10.5-7 24.4-5.6 33.3 3.3l19.2 19.2c8.9 8.9 10.3 22.9 3.3 33.3l-23.3 34.9c1.9 4.7 3.6 9.6 5 14.7 1.4 5.1 2.3 10.1 3 15.2l37.7 18.6c11.3 5.6 17.1 18.4 13.8 30.5l-7 26.2c-3.3 12.1-14.6 20.3-27.2 19.5l-42-2.7c-6.3 8.1-13.6 15.6-21.9 22l2.7 41.9c.8 12.6-7.4 24-19.5 27.2l-26.2 7c-12.2 3.3-24.9-2.5-30.5-13.8l-18.6-37.6c-10.3-1.4-20.4-4.2-29.9-8.1l-35 23.3c-10.5 7-24.4 5.6-33.3-3.3l-19.2-19.2c-8.9-8.9-10.3-22.8-3.3-33.3l23.3-35c-1.9-4.7-3.6-9.6-5-14.7s-2.3-10.2-3-15.2l-37.7-18.6c-11.3-5.6-17-18.4-13.8-30.5l7-26.2c3.3-12.1 14.6-20.3 27.2-19.5l41.9 2.7c6.3-8.1 13.6-15.6 21.9-22l-2.7-41.8c-.8-12.6 7.4-24 19.5-27.2l26.2-7zM448.4 340a44 44 0 1 0 .1 88 44 44 0 1 0 -.1-88zM224.9-45.5l26.2 7c12.1 3.3 20.3 14.7 19.5 27.2l-2.7 41.8c8.3 6.4 15.6 13.8 21.9 22l42-2.7c12.5-.8 23.9 7.4 27.2 19.5l7 26.2c3.2 12.1-2.5 24.9-13.8 30.5l-37.7 18.6c-.7 5.1-1.7 10.2-3 15.2s-3.1 10-5 14.7l23.3 35c7 10.5 5.6 24.4-3.3 33.3L307.3 262c-8.9 8.9-22.8 10.3-33.3 3.3L239 242c-9.5 3.9-19.6 6.7-29.9 8.1l-18.6 37.6c-5.6 11.3-18.4 17-30.5 13.8l-26.2-7c-12.2-3.3-20.3-14.7-19.5-27.2l2.7-41.9c-8.3-6.4-15.6-13.8-21.9-22l-42 2.7c-12.5 .8-23.9-7.4-27.2-19.5l-7-26.2c-3.2-12.1 2.5-24.9 13.8-30.5l37.7-18.6c.7-5.1 1.7-10.1 3-15.2 1.4-5.1 3-10 5-14.7L55.1 46.5c-7-10.5-5.6-24.4 3.3-33.3L77.6-6c8.9-8.9 22.8-10.3 33.3-3.3l35 23.3c9.5-3.9 19.6-6.7 29.9-8.1l18.6-37.6c5.6-11.3 18.3-17 30.5-13.8zM192.4 84a44 44 0 1 0 0 88 44 44 0 1 0 0-88z\"]\n};\nvar faCogs = faGears;\nvar faFileCirclePlus = {\n  prefix: 'fas',\n  iconName: 'file-circle-plus',\n  icon: [576, 512, [58606], \"e494\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-22.7-31.5-36-70.2-36-112 0-100.6 77.4-183.2 176-191.3l0-38.1c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm16-208l0 48 48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16z\"]\n};\nvar faIcicles = {\n  prefix: 'fas',\n  iconName: 'icicles',\n  icon: [512, 512, [], \"f7ad\", \"M75.8 304.8L1 35.7C.3 33.2 0 30.7 0 28.2 0 12.6 12.6 0 28.2 0L482.4 0c16.3 0 29.6 13.2 29.6 29.6 0 1.6-.1 3.3-.4 4.9L434.6 496.1c-1.5 9.2-9.5 15.9-18.8 15.9-9.2 0-17.1-6.6-18.7-15.6L336 160 307.2 303.9c-1.9 9.3-10.1 16.1-19.6 16.1-9.2 0-17.2-6.2-19.4-15.1L240 192 210.6 368.2c-1.5 9.1-9.4 15.8-18.6 15.8s-17.1-6.7-18.6-15.8L144 192 115.9 304.3c-2.3 9.2-10.6 15.7-20.1 15.7-9.3 0-17.5-6.2-20-15.2z\"]\n};\nvar faArrowTrendUp = {\n  prefix: 'fas',\n  iconName: 'arrow-trend-up',\n  icon: [576, 512, [], \"e098\", \"M384 160c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-82.7-169.4 169.4c-12.5 12.5-32.8 12.5-45.3 0L192 269.3 54.6 406.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160c12.5-12.5 32.8-12.5 45.3 0L320 306.7 466.7 160 384 160z\"]\n};\nvar faHexagonNodesBolt = {\n  prefix: 'fas',\n  iconName: 'hexagon-nodes-bolt',\n  icon: [576, 512, [], \"e69a\", \"M248 106.6c18.9-9 32-28.3 32-50.6c0-30.9-25.1-56-56-56s-56 25.1-56 56c0 22.3 13.1 41.6 32 50.6l0 98.8c-2.8 1.3-5.5 2.9-8 4.7l-80.1-45.8c1.6-20.8-8.6-41.6-27.9-52.8C57.2 96 23 105.2 7.5 132S1.2 193 28 208.5c1.3 .8 2.6 1.5 4 2.1l0 90.8c-1.3 .6-2.7 1.3-4 2.1C1.2 319-8 353.2 7.5 380S57.2 416 84 400.5c19.3-11.1 29.4-32 27.8-52.8l50.5-28.9c-11.5-11.2-19.9-25.6-23.8-41.7L88 306.1c-2.6-1.8-5.2-3.3-8-4.7l0-90.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-.1 1.4-.2 2.8-.2 4.3c0 22.3 13.1 41.6 32 50.6l0 98.8c-18.9 9-32 28.3-32 50.6c0 30.9 25.1 56 56 56c30.7 0 55.6-24.7 56-55.2c-7.5-12.9-13.5-26.8-17.6-41.5c-4.2-4-9.1-7.3-14.4-9.9l0-98.8c2.8-1.3 5.5-2.9 8-4.7l10.5 6c5.5-15.3 13.1-29.5 22.4-42.5l-9.1-5.2c.1-1.4 .2-2.8 .2-4.3c0-22.3-13.1-41.6-32-50.6l0-98.8zM440.5 132C425 105.2 390.8 96 364 111.5c-19.3 11.1-29.4 32-27.8 52.8l-50.6 28.9c11.5 11.2 19.9 25.6 23.8 41.7L360 205.9c.4 .3 .8 .6 1.3 .9c21.7-9.5 45.6-14.8 70.8-14.8c2 0 4 0 5.9 .1c12.1-17.3 13.8-40.6 2.6-60.1zM432 512a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm47.9-225c4.3 3.7 5.4 9.9 2.6 14.9L452.4 356l35.6 0c5.2 0 9.8 3.3 11.4 8.2s-.1 10.3-4.2 13.4l-96 72c-4.5 3.4-10.8 3.2-15.1-.6s-5.4-9.9-2.6-14.9L411.6 380 376 380c-5.2 0-9.8-3.3-11.4-8.2s.1-10.3 4.2-13.4l96-72c4.5-3.4 10.8-3.2 15.1 .6z\"]\n};\nvar faQuestion = {\n  prefix: 'fas',\n  iconName: 'question',\n  icon: [320, 512, [10067, 10068, 61736], \"3f\", \"M64 160c0-53 43-96 96-96s96 43 96 96c0 42.7-27.9 78.9-66.5 91.4-28.4 9.2-61.5 35.3-61.5 76.6l0 24c0 17.7 14.3 32 32 32s32-14.3 32-32l0-24c0-1.7 .6-4.1 3.5-7.3 3-3.3 7.9-6.5 13.7-8.4 64.3-20.7 110.8-81 110.8-152.3 0-88.4-71.6-160-160-160S0 71.6 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm96 352c22.1 0 40-17.9 40-40s-17.9-40-40-40-40 17.9-40 40 17.9 40 40 40z\"]\n};\nvar faHandsBound = {\n  prefix: 'fas',\n  iconName: 'hands-bound',\n  icon: [576, 512, [], \"e4f9\", \"M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32L0 213.9c0 14.2 5.1 27.9 14.3 38.7L99.6 352 96 352c-13.3 0-24 10.7-24 24s10.7 24 24 24l384 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-3.6 0 85.3-99.5c9.2-10.8 14.3-24.5 14.3-38.7L576 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112.8-69.3 92.4c-5.7 7.6-16.1 9.6-24.2 4.8-9.7-5.7-12.1-18.7-5.1-27.5L441 180c10.8-13.5 8.9-33.3-4.4-44.5s-33-9.8-44.5 3.2l-46.7 52.5C329 209.7 320 233.4 320 258.1l0 93.9-64 0 0-93.9c0-24.6-9-48.4-25.4-66.8l-46.7-52.5c-11.5-13-31.3-14.4-44.5-3.2S124.2 166.4 135 180l27.6 34.5c7 8.8 4.7 21.8-5.1 27.5-8.1 4.8-18.6 2.7-24.2-4.8L64 144.8 64 32zm64 448l0 32 128 0 0-32 64 0 0 32 128 0 0-32 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L96 432c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0z\"]\n};\nvar faPersonWalkingLuggage = {\n  prefix: 'fas',\n  iconName: 'person-walking-luggage',\n  icon: [512, 512, [], \"e554\", \"M264.3 24a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm-8 181.3l-22.6 22.6c-6 6-9.4 14.1-9.4 22.6l0 37.5c0 12.3-7 23-17.2 28.4-.9 4.2-2.4 8.4-4.3 12.3l-69 138.1-.8-.4-27.7 55.3c-9.9 19.8-33.9 27.8-53.7 17.9L14.6 521c-19.8-9.9-27.8-33.9-17.9-53.7L47.3 366.3c9.9-19.8 33.9-27.8 53.7-17.9l30.7 15.3 28.3-56.6c.3-.6 .4-1.2 .4-1.8l0-16.9c0-.2 0-.3 0-.5l0-37.5c0-25.5 10.1-49.9 28.1-67.9l35.1-35.1c22.8-22.8 53.6-35.6 85.8-35.6 36.9 0 71.8 16.8 94.8 45.6L422.1 180c6.1 7.6 15.3 12 25 12l33.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-33.2 0c-29.2 0-56.7-13.3-75-36l-3.8-4.7 0 115.2 34.5 29.6c17.7 15.2 29.3 36.2 32.6 59.3L448 507.5c2.5 17.5-9.7 33.7-27.2 36.2s-33.7-9.7-36.2-27.2L372 428.4c-1.1-7.7-5-14.7-10.9-19.8l-71.4-61.2c-21.3-18.2-33.5-44.9-33.5-72.9l0-69.3zm.1 165.8c2.4 2.3 4.8 4.6 7.4 6.8l46 39.4-2.2 7.6c-4.5 15.7-12.9 30-24.4 41.5l-68.3 68.3c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L238 421.1c3.8-3.8 6.6-8.6 8.1-13.8L256.4 371z\"]\n};\nvar faFileArrowDown = {\n  prefix: 'fas',\n  iconName: 'file-arrow-down',\n  icon: [384, 512, [\"file-download\"], \"f56d\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM175 441c9.4 9.4 24.6 9.4 33.9 0l64-64c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-23 23 0-86.1c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 86.1-23-23c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64z\"]\n};\nvar faFileDownload = faFileArrowDown;\nvar faPersonBooth = {\n  prefix: 'fas',\n  iconName: 'person-booth',\n  icon: [576, 512, [], \"f756\", \"M40 24A56 56 0 1 1 152 24 56 56 0 1 1 40 24zm51.1 88c23.5 0 45.5 11.3 59.1 30.4l48.7 68.2c6 8.4 15.7 13.4 26 13.4l31.1 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-31.1 0c-31 0-60.1-15-78.1-40.2l-2.8-3.9 0 80.1 41.6 31.2C209.8 373.3 224 401.8 224 432l0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-80c0-10.1-4.7-19.6-12.8-25.6L70.4 348.8C46.2 330.7 32 302.2 32 272l0-100.9C32 138.5 58.5 112 91.1 112zM32 512l0-132.7c3.1 2.7 6.3 5.4 9.6 7.9L96 428 96 512c0 17.7-14.3 32-32 32s-32-14.3-32-32zm544-88l0 96c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-72-168 0c-7.1 0-13.8-3.1-18.4-8.6s-6.5-12.6-5.3-19.6l30.7-176.7-63.1-137.6 0 72c-5.2-1-10.5-1.6-16-1.6l-32 0 0-120c0-30.9 25.1-56 56-56L520 0c30.9 0 56 25.1 56 56l0 368zM288 336c5.5 0 10.8-.6 16-1.6L304 520c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-184 32 0z\"]\n};\nvar faLocust = {\n  prefix: 'fas',\n  iconName: 'locust',\n  icon: [576, 512, [], \"e520\", \"M328 32c137 0 248 111 248 248l0 40-.4 8.2C571.5 368.5 537.4 400 496 400l-12.3 0 25.2 44.1c6.6 11.5 2.6 26.2-8.9 32.8s-26.2 2.6-32.7-8.9l-38.8-67.9-80.4 0-48.2 69.7c-7.5 10.9-22.5 13.6-33.4 6.1s-13.6-22.5-6.1-33.4l29.3-42.3-74.5 0-51.7 70.2c-7.9 10.7-22.9 12.9-33.6 5.1s-12.9-22.9-5.1-33.6l40.5-55-43-16.4-79.3 100.5c-8.2 10.4-23.3 12.2-33.7 4s-12.2-23.3-4-33.7l240-304 2.1-2.3c5.2-5.1 12.5-7.5 19.9-6.6 8.4 1.1 15.6 6.5 18.9 14.3l21.7 50.7 40.9-55.5 2.1-2.4c5.1-5.3 12.5-8 20-7.2 8.5 1 15.9 6.5 19.3 14.4l41.8 97.5 64.2 0c10.2 0 20 2 29 5.5-16.4-94-98.3-165.5-197-165.5l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0zM488 296a24 24 0 1 0 0 48 24 24 0 1 0 0-48zM43.5 331.1C36.2 321.4 32 309.5 32 296.8 32 265.5 57.5 240 88.9 240l27.6 0-72.9 91.1zM225.1 240l48.2 0 1.4-1.9-16.9-39.5-32.7 41.5zm107.8 0l46.7 0-17.2-40-29.5 40z\"]\n};\nvar faRightLong = {\n  prefix: 'fas',\n  iconName: 'right-long',\n  icon: [576, 512, [\"long-arrow-alt-right\"], \"f30b\", \"M566.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-128 128c-9.2 9.2-22.9 11.9-34.9 6.9S384 396.9 384 384l0-64-336 0c-26.5 0-48-21.5-48-48l0-32c0-26.5 21.5-48 48-48l336 0 0-64c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l128 128z\"]\n};\nvar faLongArrowAltRight = faRightLong;\nvar faTruckDroplet = {\n  prefix: 'fas',\n  iconName: 'truck-droplet',\n  icon: [576, 512, [], \"e58c\", \"M64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64l3.3 0c10.4 36.9 44.4 64 84.7 64s74.2-27.1 84.7-64l102.6 0c10.4 36.9 44.4 64 84.7 64s74.2-27.1 84.7-64l3.3 0c35.3 0 64-28.7 64-64l0-146.7c0-17-6.7-33.3-18.7-45.3L512 146.7c-12-12-28.3-18.7-45.3-18.7l-50.7 0 0-32c0-35.3-28.7-64-64-64L64 32zM512 237.3l0 50.7-96 0 0-96 50.7 0 45.3 45.3zM152 384a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm232 40a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM208 304c-39.8 0-72-32.2-72-72 0-33.2 34.5-78 55.8-102.4 8.7-10 23.8-10 32.5 0 21.2 24.4 55.8 69.1 55.8 102.4 0 48-32.2 72-72 72z\"]\n};\nvar faHandHoldingMedical = {\n  prefix: 'fas',\n  iconName: 'hand-holding-medical',\n  icon: [576, 512, [], \"e05c\", \"M240 24c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 56 56 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24l-56 0 0 56c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-56-56 0c-13.3 0-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24l56 0 0-56zM66.7 384l42.5-42.5c24-24 56.6-37.5 90.5-37.5L352 304c17.7 0 32 14.3 32 32s-14.3 32-32 32l-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l112.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5s9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5L32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l34.7 0z\"]\n};\nvar faHandPointLeft = {\n  prefix: 'fas',\n  iconName: 'hand-point-left',\n  icon: [512, 512, [], \"f0a5\", \"M32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l208 0 0-64-208 0zM192 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0zm-64-64c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0c-17.7 0-32 14.3-32 32zm96 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0zm88-96l-.6 0c5.4 9.4 8.6 20.3 8.6 32 0 13.2-4 25.4-10.8 35.6 24.9 8.7 42.8 32.5 42.8 60.4 0 11.7-3.1 22.6-8.6 32l8.6 0c88.4 0 160-71.6 160-160l0-61.7c0-42.4-16.9-83.1-46.9-113.1l-11.6-11.6C429.5 77.5 396.9 64 363 64l-27 0c-35.3 0-64 28.7-64 64l0 88c0 22.1 17.9 40 40 40s40-17.9 40-40l0-56c0-8.8 7.2-16 16-16s16 7.2 16 16l0 56c0 39.8-32.2 72-72 72z\"]\n};\nvar faCalculator = {\n  prefix: 'fas',\n  iconName: 'calculator',\n  icon: [384, 512, [128425], \"f1ec\", \"M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM96 64l192 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L96 160c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32zm16 168a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zm80 24a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm128-24a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM88 352a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm128-24a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zm80 24a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM64 424c0-13.3 10.7-24 24-24l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 448c-13.3 0-24-10.7-24-24zm232-24c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24z\"]\n};\nvar faMinus = {\n  prefix: 'fas',\n  iconName: 'minus',\n  icon: [448, 512, [8211, 8722, 10134, \"subtract\"], \"f068\", \"M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z\"]\n};\nvar faSubtract = faMinus;\nvar faArrowUpZA = {\n  prefix: 'fas',\n  iconName: 'arrow-up-z-a',\n  icon: [512, 512, [\"sort-alpha-up-alt\"], \"f882\", \"M150.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 141.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-80-80zM288 64c0 17.7 14.3 32 32 32l50.7 0-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9S307.1 224 320 224l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0 73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9S461 32 448 32L320 32c-17.7 0-32 14.3-32 32zM412.6 273.7C407.2 262.8 396.1 256 384 256s-23.2 6.8-28.6 17.7l-80 160c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3 88.4 0 7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-80-160zM384 359.6l20.2 40.4-40.4 0 20.2-40.4z\"]\n};\nvar faSortAlphaUpAlt = faArrowUpZA;\nvar faMicrophoneSlash = {\n  prefix: 'fas',\n  iconName: 'microphone-slash',\n  icon: [576, 512, [], \"f131\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L424.7 358.8C458.9 324.2 480 276.6 480 224l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 39.3-15.7 74.9-41.3 100.9L356.8 291C373.6 273.7 384 250 384 224l0-128c0-53-43-96-96-96s-96 43-96 96l0 30.2-151-151zm298.3 434l-41.4-41.4c-3.3 .2-6.5 .3-9.8 .3-79.5 0-144-64.5-144-144l0-10.2-43.6-43.6c-2.8 3.9-4.4 8.7-4.4 13.8l0 40c0 97.9 73.3 178.7 168 190.5l0 49.5-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-49.5c9.3-1.2 18.4-3 27.3-5.4z\"]\n};\nvar faSquarePen = {\n  prefix: 'fas',\n  iconName: 'square-pen',\n  icon: [448, 512, [\"pen-square\", \"pencil-square\"], \"f14b\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM325.8 139.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-23.8 23.8-71-71 23.8-23.8c15.6-15.6 40.9-15.6 56.6 0zM119.9 289l91.5-91.6 71 71-91.6 91.5c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z\"]\n};\nvar faPenSquare = faSquarePen;\nvar faPencilSquare = faSquarePen;\nvar faHandFist = {\n  prefix: 'fas',\n  iconName: 'hand-fist',\n  icon: [384, 512, [9994, \"fist-raised\"], \"f6de\", \"M160 0c17.7 0 32 14.3 32 32l0 112-64 0 0-112c0-17.7 14.3-32 32-32zM32 64c0-17.7 14.3-32 32-32S96 46.3 96 64l0 80-64 0 0-80zm192 0c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96zm96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-96 88l0-.6c9.4 5.4 20.3 8.6 32 8.6 13.2 0 25.4-4 35.6-10.8 8.7 24.9 32.5 42.8 60.4 42.8 11.7 0 22.6-3.1 32-8.6l0 8.6c0 52.3-25.1 98.8-64 128l0 96c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-78.4c-17.3-7.9-33.2-18.8-46.9-32.5L37.5 357.5C13.5 333.5 0 300.9 0 267l0-27c0-35.3 28.7-64 64-64l88 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72z\"]\n};\nvar faFistRaised = faHandFist;\nvar faCommentSms = {\n  prefix: 'fas',\n  iconName: 'comment-sms',\n  icon: [512, 512, [\"sms\"], \"f7cd\", \"M256 480c141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240c0 54.3 19.2 104.3 51.6 144.5L2.8 476.8c-4.8 9-3.3 20 3.6 27.5s17.8 9.8 27.1 5.8l118.4-50.7C183.7 472.6 218.9 480 256 480zM140.8 172.8l19.2 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-19.2 0c-5.3 0-9.6 4.3-9.6 9.6s4.3 9.6 9.6 9.6c23 0 41.6 18.6 41.6 41.6s-18.6 41.6-41.6 41.6l-25.6 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l25.6 0c5.3 0 9.6-4.3 9.6-9.6s-4.3-9.6-9.6-9.6c-23 0-41.6-18.6-41.6-41.6s18.6-41.6 41.6-41.6zm188.8 41.6c0-23 18.6-41.6 41.6-41.6l19.2 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-19.2 0c-5.3 0-9.6 4.3-9.6 9.6s4.3 9.6 9.6 9.6c23 0 41.6 18.6 41.6 41.6s-18.6 41.6-41.6 41.6l-25.6 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l25.6 0c5.3 0 9.6-4.3 9.6-9.6s-4.3-9.6-9.6-9.6c-23 0-41.6-18.6-41.6-41.6zm-98.3-33.8l24.7 41.1 24.7-41.1c3.7-6.2 11.1-9.1 18-7.2s11.7 8.2 11.7 15.4l0 102.4c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-44.6-8.7 14.5c-2.9 4.8-8.1 7.8-13.7 7.8s-10.8-3-13.7-7.8l-8.7-14.5 0 44.6c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-102.4c0-7.2 4.8-13.5 11.7-15.4s14.3 1 18 7.2z\"]\n};\nvar faSms = faCommentSms;\nvar faSimCard = {\n  prefix: 'fas',\n  iconName: 'sim-card',\n  icon: [384, 512, [], \"f7c4\", \"M0 64C0 28.7 28.7 0 64 0L258.7 0c17 0 33.3 6.7 45.3 18.7L365.3 80c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM96 256c-17.7 0-32 14.3-32 32l0 40 128 0 0-72-96 0zM64 416c0 17.7 14.3 32 32 32l48 0 0-72-80 0 0 40zm256 0l0-40-128 0 0 72 96 0c17.7 0 32-14.3 32-32zm0-128c0-17.7-14.3-32-32-32l-48 0 0 72 80 0 0-40z\"]\n};\nvar faScaleBalanced = {\n  prefix: 'fas',\n  iconName: 'scale-balanced',\n  icon: [640, 512, [9878, \"balance-scale\"], \"f24e\", \"M384 32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L398.4 96c-5.2 25.8-22.9 47.1-46.4 57.3l0 294.7 160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-384 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0 0-294.7c-23.5-10.3-41.2-31.6-46.4-57.3L128 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l128 0c14.6-19.4 37.8-32 64-32s49.4 12.6 64 32zm55.6 288L584.4 320 512 195.8 439.6 320zM512 416c-62.9 0-115.2-34-126-78.9-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1-10.8 44.8-63.1 78.9-126 78.9zM126.8 195.8L54.4 320 199.3 320 126.8 195.8zM.9 337.1c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1-10.8 44.8-63.1 78.9-126 78.9S11.7 382 .9 337.1z\"]\n};\nvar faBalanceScale = faScaleBalanced;\nvar faCar = {\n  prefix: 'fas',\n  iconName: 'car',\n  icon: [512, 512, [128664, \"automobile\"], \"f1b9\", \"M135.2 117.4l-26.1 74.6 293.8 0-26.1-74.6C372.3 104.6 360.2 96 346.6 96L165.4 96c-13.6 0-25.7 8.6-30.2 21.4zM39.6 196.8L74.8 96.3C88.3 57.8 124.6 32 165.4 32l181.2 0c40.8 0 77.1 25.8 90.6 64.3l35.2 100.5c23.2 9.6 39.6 32.5 39.6 59.2l0 192c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-320 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32L0 256c0-26.7 16.4-49.6 39.6-59.2zM128 304a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faAutomobile = faCar;\nvar faCropSimple = {\n  prefix: 'fas',\n  iconName: 'crop-simple',\n  icon: [512, 512, [\"crop-alt\"], \"f565\", \"M128 32c0-17.7-14.3-32-32-32S64 14.3 64 32l0 32-32 0C14.3 64 0 78.3 0 96s14.3 32 32 32l32 0 0 256c0 35.3 28.7 64 64 64l208 0 0-64-208 0 0-352zM384 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-256c0-35.3-28.7-64-64-64l-208 0 0 64 208 0 0 352z\"]\n};\nvar faCropAlt = faCropSimple;\nvar faMedal = {\n  prefix: 'fas',\n  iconName: 'medal',\n  icon: [448, 512, [127941], \"f5a2\", \"M224.3 128L139.7-12.9c-6.5-10.8-20.1-14.7-31.3-9.1L21.8 21.3C9.9 27.2 5.1 41.6 11 53.5L80.6 192.6c-30.1 33.9-48.3 78.5-48.3 127.4 0 106 86 192 192 192s192-86 192-192c0-48.9-18.3-93.5-48.3-127.4L437.6 53.5c5.9-11.9 1.1-26.3-10.7-32.2L340.2-22.1c-11.2-5.6-24.9-1.6-31.3 9.1L224.3 128zm30.8 142.5c1.4 2.8 4 4.7 7 5.1l50.1 7.3c7.7 1.1 10.7 10.5 5.2 16l-36.3 35.4c-2.2 2.2-3.2 5.2-2.7 8.3l8.6 49.9c1.3 7.6-6.7 13.5-13.6 9.9l-44.8-23.6c-2.7-1.4-6-1.4-8.7 0l-44.8 23.6c-6.9 3.6-14.9-2.2-13.6-9.9l8.6-49.9c.5-3-.5-6.1-2.7-8.3l-36.3-35.4c-5.6-5.4-2.5-14.8 5.2-16l50.1-7.3c3-.4 5.7-2.4 7-5.1l22.4-45.4c3.4-7 13.3-7 16.8 0l22.4 45.4z\"]\n};\nvar faScroll = {\n  prefix: 'fas',\n  iconName: 'scroll',\n  icon: [576, 512, [128220], \"f70e\", \"M0 112C0 70.5 31.6 36.4 72 32.4l0-.4 280 0c53 0 96 43 96 96l0 176-176 0c-39.8 0-72 32.2-72 72l0 60c0 24.3-19.7 44-44 44s-44-19.7-44-44l0-228-64 0c-26.5 0-48-21.5-48-48l0-48zM236.8 480c7.1-13.1 11.2-28.1 11.2-44l0-60c0-13.3 10.7-24 24-24l248 0c13.3 0 24 10.7 24 24l0 24c0 44.2-35.8 80-80 80l-227.2 0zM80 80c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32z\"]\n};\nvar faFileExcel = {\n  prefix: 'fas',\n  iconName: 'file-excel',\n  icon: [384, 512, [], \"f1c3\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM164 266.7c-7.4-11-22.3-14-33.3-6.7s-14 22.3-6.7 33.3L163.2 352 124 410.7c-7.4 11-4.4 25.9 6.7 33.3s25.9 4.4 33.3-6.7l28-42 28 42c7.4 11 22.3 14 33.3 6.7s14-22.3 6.7-33.3L220.8 352 260 293.3c7.4-11 4.4-25.9-6.7-33.3s-25.9-4.4-33.3 6.7l-28 42-28-42z\"]\n};\nvar faFilter = {\n  prefix: 'fas',\n  iconName: 'filter',\n  icon: [512, 512, [], \"f0b0\", \"M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c9.2 9.2 22.9 11.9 34.9 6.9S320 492.9 320 480l0-178.7 182.6-182.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64z\"]\n};\nvar faDrum = {\n  prefix: 'fas',\n  iconName: 'drum',\n  icon: [512, 512, [129345], \"f569\", \"M501.2 76.1c11.1-7.3 14.2-22.1 6.9-33.2s-22.1-14.2-33.2-6.9L370.2 104.5C335.8 98.7 297 96 256 96 114.6 96 0 128 0 208L0 368c0 31.3 27.4 58.8 72 78.7L72 344c0-13.3 10.7-24 24-24s24 10.7 24 24l0 119.4c33 8.9 71.1 14.5 112 16.1L232 376c0-13.3 10.7-24 24-24s24 10.7 24 24l0 103.5c40.9-1.6 79-7.2 112-16.1L392 344c0-13.3 10.7-24 24-24s24 10.7 24 24l0 102.7c44.6-19.9 72-47.4 72-78.7l0-160c0-41.1-30.2-69.5-78.8-87.4l67.9-44.5zM307.4 145.6l-64.6 42.3c-11.1 7.3-14.2 22.1-6.9 33.2s22.1 14.2 33.2 6.9l111.1-72.8c14.7 3.2 27.9 7 39.4 11.5 38.8 15.1 44.4 30.6 44.4 41.3 0 .8-2.7 17.2-46 35.9-38.9 16.8-96 28.1-162 28.1S132.9 260.7 94 243.9c-43.3-18.7-46-35.1-46-35.9 0-10.6 5.6-26.2 44.4-41.3 38.3-14.9 95.4-22.7 163.6-22.7 18 0 35.1 .5 51.4 1.6z\"]\n};\nvar faMapPin = {\n  prefix: 'fas',\n  iconName: 'map-pin',\n  icon: [320, 512, [128205], \"f276\", \"M192 284.4C256.1 269.9 304 212.5 304 144 304 64.5 239.5 0 160 0S16 64.5 16 144c0 68.5 47.9 125.9 112 140.4L128 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-195.6zM168 96c-30.9 0-56 25.1-56 56 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-57.4 46.6-104 104-104 13.3 0 24 10.7 24 24s-10.7 24-24 24z\"]\n};\nvar faScaleUnbalancedFlip = {\n  prefix: 'fas',\n  iconName: 'scale-unbalanced-flip',\n  icon: [640, 512, [\"balance-scale-right\"], \"f516\", \"M118.2 62.4C101.5 56.8 92.4 38.6 98 21.9S121.7-3.9 138.5 1.6l113 37.7c13.9-23.5 39.6-39.3 68.9-39.3 44.2 0 80 35.8 80 80 0 3-.2 5.9-.5 8.8l122.6 40.9c16.8 5.6 25.8 23.7 20.2 40.5s-23.7 25.8-40.5 20.2L366.7 145.2c-4.5 3.2-9.3 5.9-14.4 8.2l0 326.7c0 17.7-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0 0-294.7c-21-9.2-37.2-27-44.2-49l-125.9-42zM200.8 288L128.3 163.8 55.9 288 200.8 288zm-72.4 96c-62.9 0-115.2-34-126-78.9-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1-10.8 44.8-63.1 78.9-126 78.9zm382.8-92.2l-72.4 124.2 144.9 0-72.4-124.2zm126 141.3C626.4 478 574.1 512 511.2 512s-115.2-34-126-78.9c-2.6-11 1-22.3 6.7-32.1l95.2-163.2c5-8.6 14.2-13.8 24.1-13.8s19.1 5.3 24.1 13.8l95.2 163.2c5.7 9.8 9.3 21.1 6.7 32.1z\"]\n};\nvar faBalanceScaleRight = faScaleUnbalancedFlip;\nvar faArrowsToCircle = {\n  prefix: 'fas',\n  iconName: 'arrows-to-circle',\n  icon: [512, 512, [], \"e4bd\", \"M9.4 9.4C21.9-3.1 42.1-3.1 54.6 9.4L128 82.7 128 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.7 0-73.4-73.4C-3.1 42.1-3.1 21.9 9.4 9.4zM200 256a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM502.6 54.6L429.3 128 448 128c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 18.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zm-45.3 448L384 429.3 384 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.7 0 73.4 73.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0zM9.4 457.4L82.7 384 64 384c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.7-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3z\"]\n};\nvar faEnvelope = {\n  prefix: 'fas',\n  iconName: 'envelope',\n  icon: [512, 512, [128386, 9993, 61443], \"f0e0\", \"M48 64c-26.5 0-48 21.5-48 48 0 15.1 7.1 29.3 19.2 38.4l208 156c17.1 12.8 40.5 12.8 57.6 0l208-156c12.1-9.1 19.2-23.3 19.2-38.4 0-26.5-21.5-48-48-48L48 64zM0 196L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-188-198.4 148.8c-34.1 25.6-81.1 25.6-115.2 0L0 196z\"]\n};\nvar faBaby = {\n  prefix: 'fas',\n  iconName: 'baby',\n  icon: [384, 512, [], \"f77c\", \"M120 88a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zM7.7 144.5c13-17.9 38-21.8 55.9-8.8L99.8 162c26.8 19.5 59.1 30 92.2 30s65.4-10.5 92.2-30l36.2-26.4c17.9-13 42.9-9 55.9 8.8s9 42.9-8.8 55.9l-36.2 26.4c-13.6 9.9-28.1 18.2-43.3 25l0 36.3-192 0 0-36.3c-15.2-6.7-29.7-15.1-43.3-25L16.5 200.3c-17.9-13-21.8-38-8.8-55.9zM97.5 329.3l60.6 53-26 37.2 24.3 24.3c15.6 15.6 15.6 40.9 0 56.6s-40.9 15.6-56.6 0l-48-48C38 438.6 36.1 417 47.2 401.1l50.2-71.8zm128.5 53l60.6-53 50.2 71.8c11.1 15.9 9.2 37.5-4.5 51.2l-48 48c-15.6 15.6-40.9 15.6-56.6 0s-15.6-40.9 0-56.6l24.3-24.3-26-37.2z\"]\n};\nvar faSquareCaretDown = {\n  prefix: 'fas',\n  iconName: 'square-caret-down',\n  icon: [448, 512, [\"caret-square-down\"], \"f150\", \"M384 480c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0zM224 352c-6.7 0-13-2.8-17.6-7.7l-104-112c-6.5-7-8.2-17.2-4.4-25.9S110.5 192 120 192l208 0c9.5 0 18.2 5.7 22 14.4s2.1 18.9-4.4 25.9l-104 112c-4.5 4.9-10.9 7.7-17.6 7.7z\"]\n};\nvar faCaretSquareDown = faSquareCaretDown;\nvar faTent = {\n  prefix: 'fas',\n  iconName: 'tent',\n  icon: [512, 512, [], \"e57d\", \"M26.9 206.9L3.7 444.9C1.8 463.7 16.6 480 35.5 480l172.7 0c26.5 0 48-21.5 48-48l0-129c0-8.3 6.7-15 15-15 5.5 0 10.6 3 13.2 7.9l86.1 159c8.4 15.5 24.6 25.1 42.2 25.1l64.1 0c18.9 0 33.7-16.3 31.8-35.1L485.6 207.1c-1.9-19.6-12.8-37.3-29.5-47.8L280.9 48.3c-15.7-10-35.8-9.9-51.5 .1L56.1 159.2c-16.5 10.6-27.3 28.2-29.2 47.7z\"]\n};\nvar faA = {\n  prefix: 'fas',\n  iconName: 'a',\n  icon: [384, 512, [97], \"41\", \"M221.5 51.7C216.6 39.8 204.9 32 192 32s-24.6 7.8-29.5 19.7c-93.3 224-146.7 352-160 384-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2l31.8-76.3 197.3 0 31.8 76.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8c-13.3-32-66.7-160-160-384zM264 320l-144 0 72-172.8 72 172.8z\"]\n};\nvar faParachuteBox = {\n  prefix: 'fas',\n  iconName: 'parachute-box',\n  icon: [512, 512, [], \"f4cd\", \"M128 224C128 152.2 144.3 88.4 169.5 43.4 195.1-2.4 226.6-24 256-24s60.9 21.6 86.5 67.4C367.7 88.4 384 152.2 384 224l-104 0 0 96 8 0c9.3 0 18.1 2 26 5.5l118.4-101.5-.5 0c0-78.4-17.7-150.6-47.6-204-6.1-11-12.9-21.3-20.3-30.9 86.5 35.9 147.8 115.1 147.8 218.9 0 7-3.1 13.7-8.4 18.2L347.4 360.1c3 7.4 4.6 15.4 4.6 23.9l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-64c0-8.4 1.6-16.5 4.6-23.9L8.4 226.2C3.1 221.7 0 215 0 208 0 104.2 61.3 24.9 147.8-10.9 140.5-1.4 133.7 9 127.6 20 97.7 73.4 80 145.6 80 224l-.5 0 118.4 101.5c8-3.5 16.8-5.5 26-5.5l8 0 0-96-104 0z\"]\n};\nvar faCartArrowDown = {\n  prefix: 'fas',\n  iconName: 'cart-arrow-down',\n  icon: [640, 512, [], \"f218\", \"M0 8C0-5.3 10.7-16 24-16l45.3 0c27.1 0 50.3 19.4 55.1 46l.4 2 187.2 0 0 102.1-31-31c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c9.4 9.4 24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-31 31 0-102.1 177.4 0c20 0 35.1 18.2 31.4 37.9L537.8 235.8c-5.7 30.3-32.1 52.2-62.9 52.2l-303.6 0 5.1 28.3c2.1 11.4 12 19.7 23.6 19.7L456 336c13.3 0 24 10.7 24 24s-10.7 24-24 24l-255.9 0c-34.8 0-64.6-24.9-70.8-59.1L77.2 38.6c-.7-3.8-4-6.6-7.9-6.6L24 32C10.7 32 0 21.3 0 8zM160 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm224 0a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z\"]\n};\nvar faBridgeCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'bridge-circle-exclamation',\n  icon: [576, 512, [], \"e4ca\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l8 0 0 64-40 0 0 112c37.6 9.4 64 43.2 64 82l0 94c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96 6.4 0 12.7 .6 18.7 1.8 34.7-49.5 92.2-81.8 157.3-81.8 28.6 0 55.6 6.2 80 17.4l0-65.4-40 0 0-64 8 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM424 96l0 64-80 0 0-64 80 0zM296 96l0 64-80 0 0-64 80 0zM88 96l80 0 0 64-80 0 0-64zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-140c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z\"]\n};\nvar faCloudArrowUp = {\n  prefix: 'fas',\n  iconName: 'cloud-arrow-up',\n  icon: [576, 512, [62338, \"cloud-upload\", \"cloud-upload-alt\"], \"f0ee\", \"M144 480c-79.5 0-144-64.5-144-144 0-63.4 41-117.2 97.9-136.5-1.3-7.7-1.9-15.5-1.9-23.5 0-79.5 64.5-144 144-144 55.4 0 103.5 31.3 127.6 77.1 14.2-8.3 30.8-13.1 48.4-13.1 53 0 96 43 96 96 0 15.7-3.8 30.6-10.5 43.7 44 20.3 74.5 64.7 74.5 116.3 0 70.7-57.3 128-128 128l-304 0zM305 191c-9.4-9.4-24.6-9.4-33.9 0l-72 72c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l31-31 0 102.1c0 13.3 10.7 24 24 24s24-10.7 24-24l0-102.1 31 31c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-72-72z\"]\n};\nvar faCloudUpload = faCloudArrowUp;\nvar faCloudUploadAlt = faCloudArrowUp;\nvar faAt = {\n  prefix: 'fas',\n  iconName: 'at',\n  icon: [512, 512, [61946], \"40\", \"M256 64C150 64 64 150 64 256s86 192 192 192c17.7 0 32 14.3 32 32s-14.3 32-32 32C114.6 512 0 397.4 0 256S114.6 0 256 0 512 114.6 512 256l0 32c0 53-43 96-96 96-29.3 0-55.6-13.2-73.2-33.9-22.8 21-53.3 33.9-86.8 33.9-70.7 0-128-57.3-128-128s57.3-128 128-128c27.9 0 53.7 8.9 74.7 24.1 5.7-5 13.1-8.1 21.3-8.1 17.7 0 32 14.3 32 32l0 112c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32c0-106-86-192-192-192zm64 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z\"]\n};\nvar faIndianRupeeSign = {\n  prefix: 'fas',\n  iconName: 'indian-rupee-sign',\n  icon: [320, 512, [\"indian-rupee\", \"inr\"], \"e1bc\", \"M0 64C0 46.3 14.3 32 32 32l264 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-76.7 0c17.7 19.8 30.1 44.6 34.7 72l42 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-42 0c-10.4 62.2-60.8 110.9-123.8 118.9L274.6 422c14.4 10.3 17.7 30.3 7.4 44.6s-30.3 17.7-44.6 7.4L13.4 314C2.1 306-2.7 291.5 1.5 278.2S18.1 256 32 256l80 0c35.8 0 66.1-23.5 76.3-56L24 200c-13.3 0-24-10.7-24-24s10.7-24 24-24l164.3 0c-10.2-32.5-40.5-56-76.3-56L32 96C14.3 96 0 81.7 0 64z\"]\n};\nvar faIndianRupee = faIndianRupeeSign;\nvar faInr = faIndianRupeeSign;\nvar faTruck = {\n  prefix: 'fas',\n  iconName: 'truck',\n  icon: [576, 512, [128666, 9951], \"f0d1\", \"M0 96C0 60.7 28.7 32 64 32l288 0c35.3 0 64 28.7 64 64l0 32 50.7 0c17 0 33.3 6.7 45.3 18.7L557.3 192c12 12 18.7 28.3 18.7 45.3L576 384c0 35.3-28.7 64-64 64l-3.3 0c-10.4 36.9-44.4 64-84.7 64s-74.2-27.1-84.7-64l-102.6 0c-10.4 36.9-44.4 64-84.7 64s-74.2-27.1-84.7-64L64 448c-35.3 0-64-28.7-64-64L0 96zM512 288l0-50.7-45.3-45.3-50.7 0 0 96 96 0zM192 424a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm232 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80z\"]\n};\nvar faChalkboardUser = {\n  prefix: 'fas',\n  iconName: 'chalkboard-user',\n  icon: [640, 512, [\"chalkboard-teacher\"], \"f51c\", \"M192 384c53 0 96 43 96 96 0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32 0-53 43-96 96-96l96 0zM544 32c35.3 0 64 28.7 64 64l0 288c0 33.1-25.2 60.4-57.5 63.7l-6.5 .3-211.1 0c-5.1-24.2-16.3-46.1-32.1-64l51.2 0 0-32c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32l0 32 32 0 0-288-352 0 0 57.3c-14.8-6-31-9.3-48-9.3-5.4 0-10.8 .3-16 1l0-49c0-35.3 28.7-64 64-64l352 0zM144 352a80 80 0 1 1 0-160 80 80 0 1 1 0 160z\"]\n};\nvar faChalkboardTeacher = faChalkboardUser;\nvar faUserCheck = {\n  prefix: 'fas',\n  iconName: 'user-check',\n  icon: [640, 512, [], \"f4fc\", \"M286 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L78 512c-16.4 0-29.7-13.3-29.7-29.7 0-98.5 79.8-178.3 178.3-178.3l59.4 0zM585.7 105.9c7.8-10.7 22.8-13.1 33.5-5.3s13.1 22.8 5.3 33.5L522.1 274.9c-4.2 5.7-10.7 9.4-17.7 9.8s-14-2.2-18.9-7.3l-46.4-48c-9.2-9.5-9-24.7 .6-33.9 9.5-9.2 24.7-8.9 33.9 .6l26.5 27.4 85.6-117.7zM256.3 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240z\"]\n};\nvar faUserNinja = {\n  prefix: 'fas',\n  iconName: 'user-ninja',\n  icon: [448, 512, [129399], \"f504\", \"M352 128c0 70.7-57.3 128-128 128-57.2 0-105.6-37.5-122-89.3-1.1 1.3-2.2 2.6-3.5 3.8-15.8 15.8-38.8 20.7-53.6 22.1-8.1 .8-14.6-5.7-13.8-13.8 1.4-14.7 6.3-37.8 22.1-53.6 5.8-5.8 12.6-10.1 19.6-13.4-7-3.2-13.8-7.6-19.6-13.4-15.8-15.8-20.7-38.8-22.1-53.6-.8-8.1 5.7-14.6 13.8-13.8 14.7 1.4 37.8 6.3 53.6 22.1 4.8 4.8 8.7 10.4 11.7 16.1 21.3-41.2 64.3-69.4 113.8-69.4 70.7 0 128 57.3 128 128zM144 112c0 8.8 7.2 16 16 16l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L160 96c-8.8 0-16 7.2-16 16zm-1.4 211l67 50.2c8.5 6.4 20.3 6.4 28.8 0l67-50.2c6.5-4.9 15.2-6.2 22.6-2.8 61.4 28.2 104.1 90.2 104.1 162.1 0 16.4-13.3 29.7-29.7 29.7L45.7 512c-16.4 0-29.7-13.3-29.7-29.7 0-72 42.7-134 104.1-162.1 7.4-3.4 16.1-2.1 22.6 2.8z\"]\n};\nvar faPlantWilt = {\n  prefix: 'fas',\n  iconName: 'plant-wilt',\n  icon: [512, 512, [], \"e5aa\", \"M344-32c66.3 0 120 53.7 120 120l0 6.2c29.3 12.2 48 41.3 48 76.9 0 27.9-25.3 74.8-66 111.7-3.8 3.5-8.8 5.3-14 5.3s-10.2-1.8-14-5.3c-40.7-36.8-66-83.7-66-111.7 0-35.6 18.7-64.7 48-76.9l0-6.2c0-30.9-25.1-56-56-56s-56 25.1-56 56l0 424c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-296c0-30.9-25.1-56-56-56s-56 25.1-56 56l0 38.2c29.3 12.2 48 41.3 48 76.9 0 27.9-25.3 74.8-66 111.7-3.8 3.5-8.8 5.3-14 5.3s-10.2-1.8-14-5.3C25.3 405.9 0 359 0 331.1 0 295.4 18.7 266.4 48 254.2L48 216c0-66.3 53.7-120 120-120 20.2 0 39.3 5 56 13.8L224 88c0-66.3 53.7-120 120-120z\"]\n};\nvar faWeightScale = {\n  prefix: 'fas',\n  iconName: 'weight-scale',\n  icon: [448, 512, [\"weight\"], \"f496\", \"M116.6 192c-3-10.1-4.6-20.9-4.6-32 0-61.9 50.1-112 112-112S336 98.1 336 160c0 11.1-1.6 21.9-4.6 32l-71 0 24.6-44.3c6.4-11.6 2.3-26.2-9.3-32.6s-26.2-2.3-32.6 9.3l-37.6 67.7-88.8 0zM128 32L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-64 0C293.3 11.9 260 0 224 0s-69.3 11.9-96 32z\"]\n};\nvar faWeight = faWeightScale;\nvar faCaretRight = {\n  prefix: 'fas',\n  iconName: 'caret-right',\n  icon: [256, 512, [], \"f0da\", \"M249.3 235.8c10.2 12.6 9.5 31.1-2.2 42.8l-128 128c-9.2 9.2-22.9 11.9-34.9 6.9S64.5 396.9 64.5 384l0-256c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l128 128 2.2 2.4z\"]\n};\nvar faFlorinSign = {\n  prefix: 'fas',\n  iconName: 'florin-sign',\n  icon: [384, 512, [], \"e184\", \"M314.7 32c-38.8 0-73.7 23.3-88.6 59.1L170.7 224 64 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0-45.1 108.3c-5 11.9-16.6 19.7-29.5 19.7L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l37.3 0c38.8 0 73.7-23.3 88.6-59.1L213.3 288 320 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 45.1-108.3c5-11.9 16.6-19.7 29.5-19.7L352 96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-37.3 0z\"]\n};\nvar faBell = {\n  prefix: 'fas',\n  iconName: 'bell',\n  icon: [448, 512, [128276, 61602], \"f0f3\", \"M224 0c-17.7 0-32 14.3-32 32l0 3.2C119 50 64 114.6 64 192l0 21.7c0 48.1-16.4 94.8-46.4 132.4L7.8 358.3C2.7 364.6 0 372.4 0 380.5 0 400.1 15.9 416 35.5 416l376.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2l-9.8-12.2C400.4 308.5 384 261.8 384 213.7l0-21.7c0-77.4-55-142-128-156.8l0-3.2c0-17.7-14.3-32-32-32zM162 464c7.1 27.6 32.2 48 62 48s54.9-20.4 62-48l-124 0z\"]\n};\nvar faLariSign = {\n  prefix: 'fas',\n  iconName: 'lari-sign',\n  icon: [384, 512, [], \"e1c8\", \"M144 0c13.3 0 24 10.7 24 24l0 41.5c7.9-1 15.9-1.5 24-1.5s16.1 .5 24 1.5L216 24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 54c58.9 23.8 103.2 76 116.2 139.7 3.5 17.3-7.7 34.2-25 37.7s-34.2-7.7-37.7-25c-6.7-33.2-26.4-61.8-53.4-80.2l0 81.8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-101.8c-7.8-1.5-15.8-2.2-24-2.2s-16.2 .8-24 2.2L168 232c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-81.8c-33.8 23-56 61.9-56 105.8 0 70.7 57.3 128 128 128l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l16.9 0C18.5 350 0 305.2 0 256 0 175.4 49.6 106.4 120 78l0-54c0-13.3 10.7-24 24-24z\"]\n};\nvar faMillSign = {\n  prefix: 'fas',\n  iconName: 'mill-sign',\n  icon: [384, 512, [], \"e1ed\", \"M297-22.2c12.3 5 18.2 19 13.2 31.3l-29 71.3C338.8 85.1 384 133.3 384 192l0 208c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-208c0-26.5-21.5-48-48-48-6.4 0-12.5 1.2-18 3.5l-30 73.8 0 178.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-21.2-57.8 142.2c-5 12.3-19 18.2-31.3 13.2s-18.2-19-13.2-31.3L160 251.3 160 192c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 208c0 17.7-14.3 32-32 32S0 417.7 0 400L0 112c0-17.7 14.3-32 32-32 10.9 0 20.5 5.4 26.3 13.7 16-8.7 34.3-13.7 53.7-13.7 31.3 0 59.7 12.9 80 33.6 9.6-9.8 20.9-17.8 33.5-23.5L265.8-9c5-12.3 19-18.2 31.3-13.2z\"]\n};\nvar faPersonSnowboarding = {\n  prefix: 'fas',\n  iconName: 'person-snowboarding',\n  icon: [576, 512, [127938, \"snowboarding\"], \"f7ce\", \"M424.5 16a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM166.4 45.5c10.2-14.4 30.2-17.9 44.6-7.7l272 192c14.4 10.2 17.9 30.2 7.7 44.6s-30.2 17.9-44.6 7.7l-92.2-65.1-62.2 53.3 32.1 26.7c18.2 15.2 28.8 37.7 28.8 61.5l0 87.8 77.5 15.2c6.2 1.2 12.6 .9 18.7-.8l41.2-11.8c12.7-3.6 26 3.7 29.7 16.5s-3.7 26-16.5 29.7l-41.2 11.8c-13.4 3.8-27.4 4.4-41.1 1.8L87.1 443.3c-17.2-3.4-33-11.8-45.3-24.1L15.5 393c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l26.2 26.2c5.6 5.6 12.8 9.4 20.6 11l64.2 12.6 0-123.7c0-27.7 12-54 32.8-72.2l69-60.4-88.2-62.3C159.6 80 156.2 60 166.4 45.5zm58.1 375.7l64 12.5 0-75.3c0-4.7-2.1-9.3-5.8-12.3l-58.2-48.5 0 123.6z\"]\n};\nvar faSnowboarding = faPersonSnowboarding;\nvar faTty = {\n  prefix: 'fas',\n  iconName: 'tty',\n  icon: [512, 512, [\"teletype\"], \"f1e4\", \"M450.2 266.8c15.8 6.5 34.1 .3 42.6-14.6l2.4-4.2c27.9-48.9 23.6-118.8-31.3-154.5-126-82-289.6-82-415.6 0-54.9 35.7-59.3 105.7-31.3 154.5l2.4 4.2c8.5 14.9 26.7 21.1 42.6 14.6l81.9-33.7c13.9-5.7 22.4-19.9 20.9-34.9l-5.1-51c62.5-21 130.8-19.9 192.6 3.3l-4.8 47.7c-1.5 15 7 29.2 20.9 34.9l81.9 33.7zM32 352a32 32 0 1 0 64 0 32 32 0 1 0 -64 0zm96 0a32 32 0 1 0 64 0 32 32 0 1 0 -64 0zM64 416a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm352 32a32 32 0 1 0 64 0 32 32 0 1 0 -64 0zM256 320a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm64 32a32 32 0 1 0 64 0 32 32 0 1 0 -64 0zm128-32a32 32 0 1 0 0 64 32 32 0 1 0 0-64zM128 448c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32z\"]\n};\nvar faTeletype = faTty;\nvar faUsersRectangle = {\n  prefix: 'fas',\n  iconName: 'users-rectangle',\n  icon: [576, 512, [], \"e594\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm224 72a56 56 0 1 1 0 112 56 56 0 1 1 0-112zm0 152c53 0 96 43 96 96l0 24c0 13.3-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24l0-24c0-53 43-96 96-96zm96-64a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM168 272.3c-15.2 22.8-24 50.2-24 79.7l0 24c0 8.4 1.4 16.5 4.1 24l-46.8 0C89.6 400 80 390.4 80 378.7L80 368c0-50.3 38.7-91.6 88-95.7zM427.9 400c2.7-7.5 4.1-15.6 4.1-24l0-24c0-29.5-8.8-56.9-24-79.7 49.3 4.1 88 45.3 88 95.7l0 10.7c0 11.8-9.6 21.3-21.3 21.3l-46.8 0zM96 192a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z\"]\n};\nvar faMobile = {\n  prefix: 'fas',\n  iconName: 'mobile',\n  icon: [384, 512, [128241, \"mobile-android\", \"mobile-phone\"], \"f3ce\", \"M80 0C44.7 0 16 28.7 16 64l0 384c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L80 0zm72 416l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faMobileAndroid = faMobile;\nvar faMobilePhone = faMobile;\nvar faArrowsTurnToDots = {\n  prefix: 'fas',\n  iconName: 'arrows-turn-to-dots',\n  icon: [448, 512, [], \"e4c1\", \"M265.4-6.6c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L285.3 64 352 64c53 0 96 43 96 96l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-17.7-14.3-32-32-32l-66.7 0 25.4 25.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3l80-80zm-82.7 272l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L162.7 400 96 400c-17.7 0-32 14.3-32 32l0 32c0 17.7-14.3 32-32 32S0 481.7 0 464l0-32c0-53 43-96 96-96l66.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0zM320 368a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM64 160a64 64 0 1 1 0-128 64 64 0 1 1 0 128z\"]\n};\nvar faExclamation = {\n  prefix: 'fas',\n  iconName: 'exclamation',\n  icon: [128, 512, [10069, 10071, 61738], \"21\", \"M64 432c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40c0-22.1 17.9-40 40-40zM64 0c26.5 0 48 21.5 48 48 0 .6 0 1.1 0 1.7l-16 304c-.9 17-15 30.3-32 30.3S33 370.7 32 353.7L16 49.7c0-.6 0-1.1 0-1.7 0-26.5 21.5-48 48-48z\"]\n};\nvar faChurch = {\n  prefix: 'fas',\n  iconName: 'church',\n  icon: [512, 512, [9962], \"f51d\", \"M280-8c0-13.3-10.7-24-24-24S232-21.3 232-8l0 24-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 48-98.6 65.8C120 186.7 112 201.6 112 217.7l0 38.3-79.8 45.6C12.3 313 0 334.2 0 357.1L0 448c0 35.3 28.7 64 64 64 74.7 0 85.4 0 320 0l64 0c35.3 0 64-28.7 64-64l0-90.9c0-23-12.3-44.2-32.2-55.6L400 256 400 217.7c0-16-8-31-21.4-39.9l-98.6-65.8 0-48 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0 0-24zM256 320c35.3 0 64 28.7 64 64l0 80-128 0 0-80c0-35.3 28.7-64 64-64z\"]\n};\nvar faToggleOff = {\n  prefix: 'fas',\n  iconName: 'toggle-off',\n  icon: [576, 512, [], \"f204\", \"M384 128c70.7 0 128 57.3 128 128S454.7 384 384 384l-192 0c-70.7 0-128-57.3-128-128s57.3-128 128-128l192 0zM576 256c0-106-86-192-192-192L192 64C86 64 0 150 0 256S86 448 192 448l192 0c106 0 192-86 192-192zM192 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z\"]\n};\nvar faShoePrints = {\n  prefix: 'fas',\n  iconName: 'shoe-prints',\n  icon: [576, 512, [], \"f54b\", \"M296 192c-21.1-12.1-42.3-24.2-72-29.3l0-140.3C257.7 13 311.4 0 352 0 448 0 576 48 576 128s-119.6 96-176 96c-48 0-76-16-104-32zM128 32l48 0 0 128-48 0c-35.3 0-64-28.7-64-64s28.7-64 64-64zM232 320c28-16 56-32 104-32 56.4 0 176 16 176 96S384 512 288 512c-40.5 0-94.3-13-128-22.4l0-140.3c29.7-5.2 50.9-17.3 72-29.4zM64 480c-35.3 0-64-28.7-64-64s28.7-64 64-64l48 0 0 128-48 0z\"]\n};\nvar faFileCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'file-circle-exclamation',\n  icon: [576, 512, [], \"e4eb\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-22.7-31.5-36-70.2-36-112 0-100.6 77.4-183.2 176-191.3l0-38.1c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-140c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z\"]\n};\nvar faWallet = {\n  prefix: 'fas',\n  iconName: 'wallet',\n  icon: [512, 512, [], \"f555\", \"M64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64L72 128c-13.3 0-24-10.7-24-24S58.7 80 72 80l384 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L64 32zM416 256a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faMessage = {\n  prefix: 'fas',\n  iconName: 'message',\n  icon: [512, 512, [\"comment-alt\"], \"f27a\", \"M0 352L0 128C0 75 43 32 96 32l320 0c53 0 96 43 96 96l0 224c0 53-43 96-96 96l-120 0c-5.2 0-10.2 1.7-14.4 4.8L166.4 539.2c-4.2 3.1-9.2 4.8-14.4 4.8-13.3 0-24-10.7-24-24l0-72-32 0c-53 0-96-43-96-96z\"]\n};\nvar faCommentAlt = faMessage;\nvar faTrophy = {\n  prefix: 'fas',\n  iconName: 'trophy',\n  icon: [512, 512, [127942], \"f091\", \"M144.3 0l224 0c26.5 0 48.1 21.8 47.1 48.2-.2 5.3-.4 10.6-.7 15.8l49.6 0c26.1 0 49.1 21.6 47.1 49.8-7.5 103.7-60.5 160.7-118 190.5-15.8 8.2-31.9 14.3-47.2 18.8-20.2 28.6-41.2 43.7-57.9 51.8l0 73.1 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0 0-73.1c-16-7.7-35.9-22-55.3-48.3-18.4-4.8-38.4-12.1-57.9-23.1-54.1-30.3-102.9-87.4-109.9-189.9-1.9-28.1 21-49.7 47.1-49.7l49.6 0c-.3-5.2-.5-10.4-.7-15.8-1-26.5 20.6-48.2 47.1-48.2zM101.5 112l-52.4 0c6.2 84.7 45.1 127.1 85.2 149.6-14.4-37.3-26.3-86-32.8-149.6zM380 256.8c40.5-23.8 77.1-66.1 83.3-144.8L411 112c-6.2 60.9-17.4 108.2-31 144.8z\"]\n};\nvar faFaceDizzy = {\n  prefix: 'fas',\n  iconName: 'face-dizzy',\n  icon: [512, 512, [\"dizzy\"], \"f567\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM134.1 153.9l25.9 25.9 25.9-25.9c7.8-7.8 20.5-7.8 28.3 0s7.8 20.5 0 28.3l-25.9 25.9 25.9 25.9c7.8 7.8 7.8 20.5 0 28.3s-20.5 7.8-28.3 0l-25.9-25.9-25.9 25.9c-7.8 7.8-20.5 7.8-28.3 0s-7.8-20.5 0-28.3l25.9-25.9-25.9-25.9c-7.8-7.8-7.8-20.5 0-28.3s20.5-7.8 28.3 0zm192 0l25.9 25.9 25.9-25.9c7.8-7.8 20.5-7.8 28.3 0s7.8 20.5 0 28.3l-25.9 25.9 25.9 25.9c7.8 7.8 7.8 20.5 0 28.3s-20.5 7.8-28.3 0l-25.9-25.9-25.9 25.9c-7.8 7.8-20.5 7.8-28.3 0s-7.8-20.5 0-28.3l25.9-25.9-25.9-25.9c-7.8-7.8-7.8-20.5 0-28.3s20.5-7.8 28.3 0zM256 304a64 64 0 1 1 0 128 64 64 0 1 1 0-128z\"]\n};\nvar faDizzy = faFaceDizzy;\nvar faBacteria = {\n  prefix: 'fas',\n  iconName: 'bacteria',\n  icon: [640, 512, [], \"e059\", \"M256-32c13.3 0 24 10.7 24 24l0 11c8.6 2.2 16.9 5.6 24.8 10.3L311 7c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-6.3 6.3c4.6 7.8 8 16.2 10.3 24.8l11 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-11 0c-2.2 8.6-5.6 16.9-10.3 24.8L345 151c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-4.1-4.1-30.1 30.1 4.1 4.1c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-4.1-4.1c-10 10-20 20-30.1 30.1L217 279c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-6.3-6.3c-7.8 4.6-16.2 8-24.8 10.3l0 11c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-11c-8.6-2.2-16.9-5.6-24.8-10.3L73 313c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l6.3-6.3c-4.6-7.8-8-16.2-10.3-24.8l-11 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l11 0c2.2-8.6 5.6-16.9 10.3-24.8L39 169c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l4.1 4.1c10-10 20-20 30.1-30.1L103 105c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l4.1 4.1 30.1-30.1-4.1-4.1c-9.4-9.4-9.4-24.6 0-33.9S191.6-2.3 201 7l6.3 6.3c7.8-4.6 16.2-8 24.8-10.3l0-11c0-13.3 10.7-24 24-24zM128 256a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM240 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm296 40l0 11c8.6 2.2 16.9 5.6 24.8 10.3L567 199c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-6.3 6.3c4.6 7.8 8 16.2 10.3 24.8l11 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-11 0c-2.2 8.6-5.6 16.9-10.3 24.8L601 343c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-4.1-4.1-30.1 30.1 4.1 4.1c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-4.1-4.1c-10 10-20 20-30.1 30.1L473 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-6.3-6.3c-7.8 4.6-16.2 8-24.8 10.3l0 11c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-11c-8.6-2.2-16.9-5.6-24.8-10.3L329 505c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l6.3-6.3c-4.6-7.8-8-16.2-10.3-24.8l-11 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l11 0c2.2-8.6 5.6-16.9 10.3-24.8L295 361c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l4.1 4.1c10-10 20-20 30.1-30.1L359 297c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l4.1 4.1 30.1-30.1-4.1-4.1c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l6.3 6.3c7.8-4.6 16.2-8 24.8-10.3l0-11c0-13.3 10.7-24 24-24s24 10.7 24 24zM448 384a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\"]\n};\nvar faEarDeaf = {\n  prefix: 'fas',\n  iconName: 'ear-deaf',\n  icon: [512, 512, [\"deaf\", \"deafness\", \"hard-of-hearing\"], \"f2a4\", \"M502.6 54.6l-40 40c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l40-40c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zm-320 320l-128 128c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM240 128c-57.6 0-105.1 43.6-111.3 99.5-1.9 17.6-17.8 30.2-35.3 28.3s-30.2-17.8-28.3-35.3c9.7-88 84.3-156.5 174.9-156.5 97.2 0 176 78.8 176 176 0 46-17.7 87.9-46.6 119.3-12 13-17.4 24.8-17.4 34.7l0 6.1c0 61.9-50.1 112-112 112-17.7 0-32-14.3-32-32s14.3-32 32-32c26.5 0 48-21.5 48-48l0-6.1c0-32.9 17.4-59.6 34.4-78 18.4-20 29.6-46.6 29.6-75.9 0-61.9-50.1-112-112-112zm0 80c-17.7 0-32 14.3-32 32 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-17.7-14.3-32-32-32z\"]\n};\nvar faDeaf = faEarDeaf;\nvar faDeafness = faEarDeaf;\nvar faHardOfHearing = faEarDeaf;\nvar faPeopleArrows = {\n  prefix: 'fas',\n  iconName: 'people-arrows',\n  icon: [512, 512, [\"people-arrows-left-right\"], \"e068\", \"M32 64A64 64 0 1 1 160 64 64 64 0 1 1 32 64zM0 224c0-35.3 28.7-64 64-64l64 0c3.2 0 6.4 .2 9.5 .7L93.1 205.1C65 233.2 65 278.8 93.1 306.9l56 56c3.4 3.4 7 6.4 10.9 9l0 92.1c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-120.6C12.9 332.4 0 311.7 0 288l0-64zM352 64a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm66.9 141.1l-44.4-44.4c3.1-.5 6.3-.7 9.5-.7l64 0c35.3 0 64 28.7 64 64l0 64c0 23.7-12.9 44.4-32 55.4L480 464c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-92.1c3.9-2.6 7.5-5.6 10.9-9l56-56c28.1-28.1 28.1-73.7 0-101.8zM302.8 177.8c9-3.7 19.3-1.7 26.2 5.2l56 56c9.4 9.4 9.4 24.6 0 33.9l-56 56c-6.9 6.9-17.2 8.9-26.2 5.2S288 321.7 288 312l0-24-64 0 0 24c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-56-56c-9.4-9.4-9.4-24.6 0-33.9l56-56c6.9-6.9 17.2-8.9 26.2-5.2S224 190.3 224 200l0 24 64 0 0-24c0-9.7 5.8-18.5 14.8-22.2z\"]\n};\nvar faPeopleArrowsLeftRight = faPeopleArrows;\nvar faHandsClapping = {\n  prefix: 'fas',\n  iconName: 'hands-clapping',\n  icon: [512, 512, [], \"e1a8\", \"M344 8l0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-64c0-13.3 10.7-24 24-24S344-5.3 344 8zM220 10.7l32 48c7.4 11 4.4 25.9-6.7 33.3s-25.9 4.4-33.3-6.7l-32-48c-7.4-11-4.4-25.9 6.7-33.3S212.6-.3 220 10.7zM135 119c9.4-9.4 24.6-9.4 33.9 0L292.7 242.7c10.1 10.1 27.3 2.9 27.3-11.3l0-39.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 153.6c0 57.1-30 110-78.9 139.4-64 38.4-145.8 28.3-198.5-24.4L7 361c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l53 53c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1L23 265c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l93 93c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1L55 185c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l117 117c6.1 6.1 16 6.1 22.1 0s6.1-16 0-22.1l-93-93c-9.4-9.4-9.4-24.6 0-33.9zM433.1 484.9c-24.2 14.5-50.9 22.1-77.7 23.1 48.1-39.6 76.6-99 76.6-162.4l0-98.1c8.2-.1 16-6.4 16-16l0-39.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 153.6c0 57.1-30 110-78.9 139.4zM453.3 4c11 7.4 14 22.3 6.7 33.3l-32 48c-7.4 11-22.3 14-33.3 6.7s-14-22.3-6.7-33.3l32-48c7.4-11 22.3-14 33.3-6.7z\"]\n};\nvar faVirusCovidSlash = {\n  prefix: 'fas',\n  iconName: 'virus-covid-slash',\n  icon: [576, 512, [], \"e4a9\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-83-83 11.4-11.4c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-11.3 11.3-23.8-23.8c17.9-23.5 29.9-51.7 34.1-82.3l33.6 0 0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16-33.6 0c-4.2-30.7-16.3-58.8-34.1-82.3l23.8-23.8 11.3 11.3c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L440.7 46.7c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l11.3 11.3-23.8 23.8C370.8 97.9 342.7 85.8 312 81.6l0-33.6 16 0c13.3 0 24-10.7 24-24S341.3 0 328 0L248 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0 0 33.6c-30.7 4.2-58.8 16.3-82.3 34.1L157.9 92 169.2 80.6c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L123.9 58.1 41-24.9zM113.6 232l-33.6 0 0-16c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16 33.6 0c4.2 30.7 16.3 58.8 34.1 82.3l-23.8 23.8-11.3-11.3c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l56.6 56.6c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-11.3-11.3 23.8-23.8c23.5 17.9 51.7 29.9 82.3 34.1l0 33.6-16 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0-33.6c13.4-1.8 26.4-5.2 38.7-9.9L123.5 193.3c-4.7 12.3-8 25.2-9.9 38.7z\"]\n};\nvar faCalendarDays = {\n  prefix: 'fas',\n  iconName: 'calendar-days',\n  icon: [448, 512, [\"calendar-alt\"], \"f073\", \"M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zM64 240l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z\"]\n};\nvar faCalendarAlt = faCalendarDays;\nvar faDiamondTurnRight = {\n  prefix: 'fas',\n  iconName: 'diamond-turn-right',\n  icon: [512, 512, [\"directions\"], \"f5eb\", \"M215 17L17 215C6.1 225.9 0 240.6 0 256s6.1 30.1 17 41L215 495c10.9 10.9 25.6 17 41 17s30.1-6.1 41-17L495 297c10.9-10.9 17-25.6 17-41s-6.1-30.1-17-41L297 17C286.1 6.1 271.4 0 256 0s-30.1 6.1-41 17zM385 257l-72 72c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-78.1 0c-13.3 0-24 10.7-24 24l0 40c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-40c0-39.8 32.2-72 72-72l78.1 0-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9z\"]\n};\nvar faDirections = faDiamondTurnRight;\nvar faHandPointUp = {\n  prefix: 'fas',\n  iconName: 'hand-point-up',\n  icon: [384, 512, [9757], \"f0a6\", \"M32 32C32 14.3 46.3 0 64 0S96 14.3 96 32l0 208-64 0 0-208zM224 192c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-64-64c17.7 0 32 14.3 32 32l0 48c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-48c0-17.7 14.3-32 32-32zm160 96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm-96 88l0-.6c9.4 5.4 20.3 8.6 32 8.6 13.2 0 25.4-4 35.6-10.8 8.7 24.9 32.5 42.8 60.4 42.8 11.7 0 22.6-3.1 32-8.6l0 8.6c0 88.4-71.6 160-160 160l-61.7 0c-42.4 0-83.1-16.9-113.1-46.9L37.5 453.5C13.5 429.5 0 396.9 0 363l0-27c0-35.3 28.7-64 64-64l88 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72z\"]\n};\nvar faBezierCurve = {\n  prefix: 'fas',\n  iconName: 'bezier-curve',\n  icon: [640, 512, [], \"f55b\", \"M296 136l0-48 48 0 0 48-48 0zM288 32c-26.5 0-48 21.5-48 48l0 4-118.4 0C111.2 62.7 89.3 48 64 48 28.7 48 0 76.7 0 112s28.7 64 64 64c25.3 0 47.2-14.7 57.6-36l66.9 0c-58.9 39.6-98.9 105-104 180L80 320c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-3.3 0c5.9-67 48.5-123.4 107.5-149.1 8.6 12.7 23.2 21.1 39.8 21.1l64 0c16.6 0 31.1-8.4 39.8-21.1 59 25.7 101.6 82.1 107.5 149.1l-3.3 0c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-4.5 0c-5-75-45.1-140.4-104-180l66.9 0c10.4 21.3 32.3 36 57.6 36 35.3 0 64-28.7 64-64s-28.7-64-64-64c-25.3 0-47.2 14.7-57.6 36l-118.4 0 0-4c0-26.5-21.5-48-48-48l-64 0zM88 376l48 0 0 48-48 0 0-48zm416 48l0-48 48 0 0 48-48 0z\"]\n};\nvar faPersonHalfDress = {\n  prefix: 'fas',\n  iconName: 'person-half-dress',\n  icon: [384, 512, [], \"e548\", \"M143.4-3.9c9.7-16.8 27.8-28.1 48.6-28.1 30.9 0 56 25.1 56 56 0 25.4-16.9 46.8-40 53.7l0 0c-5.1 1.5-10.4 2.3-16 2.3-30.9 0-56-25.1-56-56l0 0c0-10.1 2.7-19.7 7.4-27.9zM318.3 299.1L272 236.7 272 512c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160 0-.4 0-238.6c36.2 4.4 69.2 23.4 91.2 53l70.5 95c10.5 14.2 7.6 34.2-6.6 44.8s-34.2 7.6-44.8-6.6zM176 113l0 399c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-25.8 0c-10.9 0-18.6-10.7-15.2-21.1l43-129-48.3 65.1c-10.5 14.2-30.6 17.2-44.8 6.6s-17.2-30.6-6.6-44.8l70.5-95c22-29.6 55.1-48.6 91.2-53z\"]\n};\nvar faSquarePollHorizontal = {\n  prefix: 'fas',\n  iconName: 'square-poll-horizontal',\n  icon: [448, 512, [\"poll-h\"], \"f682\", \"M448 96c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320zM256 152c0 13.3-10.7 24-24 24l-112 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l112 0c13.3 0 24 10.7 24 24zm72 80c13.3 0 24 10.7 24 24s-10.7 24-24 24l-208 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l208 0zM192 360c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24z\"]\n};\nvar faPollH = faSquarePollHorizontal;\nvar faSchoolCircleXmark = {\n  prefix: 'fas',\n  iconName: 'school-circle-xmark',\n  icon: [640, 512, [], \"e56d\", \"M64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l276 0c-10.5-14.6-19-30.7-25.1-48l-90.9 0 0-88c0-22.1 17.9-40 40-40l48 0c1 0 1.9 0 2.9 .1 26.3-74.6 97.5-128.1 181.1-128.1 28.6 0 55.6 6.2 80 17.4l0-33.4c0-35.3-28.7-64-64-64l-64 0-127.9-115.1c-18.3-16.4-46-16.4-64.2 0L128 128 64 128zm64 240c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32zM112 256l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16zM288 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7l-36.7 36.7 36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z\"]\n};\nvar faHandLizard = {\n  prefix: 'fas',\n  iconName: 'hand-lizard',\n  icon: [512, 512, [], \"f258\", \"M0 112C0 85.5 21.5 64 48 64l238.5 0c36.8 0 71.2 18 92.1 48.2l113.5 164c13 18.7 19.9 41 19.9 63.8l0 76c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-13.8-78.1-50.2-161.9 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l128 0c26.5 0 48-21.5 48-48s-21.5-48-48-48L48 160c-26.5 0-48-21.5-48-48z\"]\n};\nvar faChalkboard = {\n  prefix: 'fas',\n  iconName: 'chalkboard',\n  icon: [576, 512, [\"blackboard\"], \"f51b\", \"M96 64c-35.3 0-64 28.7-64 64l0 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-256c0-35.3-28.7-64-64-64L96 64zM480 384l-64 0 0-32c0-17.7-14.3-32-32-32l-96 0c-17.7 0-32 14.3-32 32l0 32-160 0 0-256 384 0 0 256z\"]\n};\nvar faBlackboard = faChalkboard;\nvar faUpRightFromSquare = {\n  prefix: 'fas',\n  iconName: 'up-right-from-square',\n  icon: [512, 512, [\"external-link-alt\"], \"f35d\", \"M290.4 19.8C295.4 7.8 307.1 0 320 0L480 0c17.7 0 32 14.3 32 32l0 160c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9L400 157.3 246.6 310.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L354.7 112 297.4 54.6c-9.2-9.2-11.9-22.9-6.9-34.9zM0 176c0-44.2 35.8-80 80-80l80 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-80 0c-8.8 0-16 7.2-16 16l0 256c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-80c0-17.7 14.3-32 32-32s32 14.3 32 32l0 80c0 44.2-35.8 80-80 80L80 512c-44.2 0-80-35.8-80-80L0 176z\"]\n};\nvar faExternalLinkAlt = faUpRightFromSquare;\nvar faSquareFull = {\n  prefix: 'fas',\n  iconName: 'square-full',\n  icon: [512, 512, [128997, 128998, 128999, 129000, 129001, 129002, 129003, 11035, 11036], \"f45c\", \"M0 64C0 28.7 28.7 0 64 0L448 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64z\"]\n};\nvar faClover = {\n  prefix: 'fas',\n  iconName: 'clover',\n  icon: [512, 512, [], \"e139\", \"M310.4 16C346.6 16 376 45.4 376 81.7l0 5.2c0 11.2-2.7 22.3-7.8 32.2l-2.3 4.2-20.1 33.5c-1.1 1.9-1.2 3.4-1.1 4.5 .2 1.3 .9 2.7 2.1 3.9s2.6 1.9 3.9 2.1c1.1 .2 2.6 .1 4.5-1.1l33.5-20.1 4.2-2.3c10-5.1 21-7.8 32.2-7.8l5.2 0c36.2 0 65.6 29.4 65.6 65.7 0 17.4-6.9 34.1-19.2 46.4l-1.3 1.3c-3.7 3.7-3.7 9.6 0 13.3l1.3 1.3c12.3 12.3 19.2 29 19.2 46.4 0 36.2-29.4 65.6-65.6 65.6l-5.2 0c-12.8 0-25.5-3.5-36.5-10.1l-33.5-20.1c-1.9-1.1-3.4-1.2-4.5-1.1-1.3 .2-2.7 .9-3.9 2.1s-1.9 2.6-2.1 3.9c-.2 1.1-.1 2.6 1.1 4.5l20.1 33.5c6.6 11 10.1 23.6 10.1 36.5l0 5.2c0 36.2-29.4 65.6-65.6 65.6-17.4 0-34.1-6.9-46.4-19.2l-1.3-1.3c-3.7-3.7-9.6-3.7-13.3 0l-1.3 1.3c-12.3 12.3-29 19.2-46.4 19.2-36.2 0-65.6-29.4-65.7-65.6l0-5.2c0-12.8 3.5-25.5 10.1-36.5l20.1-33.5c1.1-1.9 1.2-3.4 1.1-4.5-.2-1.3-.9-2.7-2.1-3.9s-2.6-1.9-3.9-2.1c-.5-.1-1.2-.1-1.9 0l-2.5 1-33.5 20.1c-11 6.6-23.6 10.1-36.5 10.1l-5.2 0C45.4 376 16 346.6 16 310.4 16 293 22.9 276.3 35.2 264l1.3-1.3 1.2-1.5c2.1-3.1 2.1-7.2 0-10.3l-1.2-1.5-1.3-1.3C22.9 235.8 16 219.1 16 201.7 16 165.4 45.4 136 81.7 136l5.2 0c12.8 0 25.5 3.5 36.5 10.1l33.5 20.1 2.5 1c.7 .1 1.4 .1 1.9 .1 1.3-.2 2.7-.9 3.9-2.1s1.9-2.6 2.1-3.9c.1-.5 .1-1.2-.1-1.9l-1-2.5-20.1-33.5c-6.6-11-10.1-23.6-10.1-36.5l0-5.2c0-36.2 29.4-65.7 65.7-65.7 17.4 0 34.1 6.9 46.4 19.2l1.3 1.3c3.7 3.6 9.6 3.7 13.3 0l1.3-1.3 4.8-4.4C280.5 21.3 295.1 16 310.4 16z\"]\n};\nvar faTeethOpen = {\n  prefix: 'fas',\n  iconName: 'teeth-open',\n  icon: [512, 512, [], \"f62f\", \"M64 32C28.7 32 0 60.7 0 96l0 80c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-80c0-35.3-28.7-64-64-64L64 32zm0 272c-35.3 0-64 28.7-64 64l0 48c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-48c0-35.3-28.7-64-64-64L64 304zm80-160c0-26.5 21.5-48 48-48s48 21.5 48 48l0 24c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-24zm128 0c0-26.5 21.5-48 48-48s48 21.5 48 48l0 24c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-24zM80 112c17.7 0 32 14.3 32 32l0 24c0 13.3-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24l0-24c0-17.7 14.3-32 32-32zm320 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 24c0 13.3-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24l0-24zM48 384l0-16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 16c0 17.7-14.3 32-32 32s-32-14.3-32-32zm144 48c-26.5 0-48-21.5-48-48l0-16c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 16c0 26.5-21.5 48-48 48zm128 0c-26.5 0-48-21.5-48-48l0-16c0-8.8 7.2-16 16-16l64 0c8.8 0 16 7.2 16 16l0 16c0 26.5-21.5 48-48 48zm112-16c-17.7 0-32-14.3-32-32l0-16c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 16c0 17.7-14.3 32-32 32z\"]\n};\nvar faBarsStaggered = {\n  prefix: 'fas',\n  iconName: 'bars-staggered',\n  icon: [512, 512, [\"reorder\", \"stream\"], \"f550\", \"M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM64 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L96 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z\"]\n};\nvar faReorder = faBarsStaggered;\nvar faStream = faBarsStaggered;\nvar faWarehouse = {\n  prefix: 'fas',\n  iconName: 'warehouse',\n  icon: [576, 512, [], \"f494\", \"M0 142.1L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-240c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32l0 240c0 17.7 14.3 32 32 32s32-14.3 32-32l0-337.9c0-27.5-17.6-52-43.8-60.7L303.2 5.1c-9.9-3.3-20.5-3.3-30.4 0L43.8 81.4C17.6 90.1 0 114.6 0 142.1zM464 256l-352 0 0 64 352 0 0-64zM112 416l352 0 0-64-352 0 0 64zm352 32l-352 0 0 64 352 0 0-64z\"]\n};\nvar faSwatchbook = {\n  prefix: 'fas',\n  iconName: 'swatchbook',\n  icon: [512, 512, [], \"f5c3\", \"M0 48C0 21.5 21.5 0 48 0l96 0c26.5 0 48 21.5 48 48l0 368c0 53-43 96-96 96S0 469 0 416L0 48zM240 409.6l0-271.5 48.1-48.1c18.7-18.7 49.1-18.7 67.9 0l67.9 67.9c18.7 18.7 18.7 49.1 0 67.9L240 409.6zM205.5 512l192-192 66.6 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-258.5 0zM80 64c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L80 64zM64 208l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM96 440a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faCampground = {\n  prefix: 'fas',\n  iconName: 'campground',\n  icon: [512, 512, [9978], \"f6bb\", \"M344.8 52.3c11.2-13.7 9.2-33.8-4.5-45s-33.8-9.2-45 4.5l-39.2 48-39.2-48C205.6-1.9 185.4-4 171.7 7.2s-15.7 31.4-4.5 45l47.4 58-202 246.9C4.5 367.1 0 379.6 0 392.6L0 432c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-39.4c0-12.9-4.5-25.5-12.7-35.5l-202-246.9 47.4-58zM256 288l112 128-224 0 112-128z\"]\n};\nvar faPersonWalkingArrowRight = {\n  prefix: 'fas',\n  iconName: 'person-walking-arrow-right',\n  icon: [576, 512, [], \"e552\", \"M104.5 24a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm-8 181.3L73.9 227.9c-6 6-9.4 14.1-9.4 22.6l0 37.5c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-37.5c0-25.5 10.1-49.9 28.1-67.9l35.1-35.1c22.8-22.8 53.6-35.6 85.8-35.6 36.9 0 71.8 16.8 94.8 45.6L262.3 180c6.1 7.6 15.3 12 25 12l33.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-33.2 0c-29.2 0-56.7-13.3-75-36l-3.8-4.7 0 115.2 34.5 29.6c17.7 15.2 29.3 36.2 32.6 59.3l12.6 88.1c2.5 17.5-9.7 33.7-27.2 36.2s-33.7-9.7-36.2-27.2l-12.6-88.1c-1.1-7.7-5-14.7-10.9-19.8L130 347.5c-21.3-18.2-33.5-44.9-33.5-72.9l0-69.3zM96.6 371c2.4 2.3 4.8 4.6 7.4 6.8l46 39.4-2.2 7.6c-4.5 15.7-12.9 30-24.4 41.5L55.1 534.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l68.3-68.3c3.8-3.8 6.6-8.6 8.1-13.8L96.6 371zM505.5 345c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-102.1 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l102.1 0-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9l-72 72z\"]\n};\nvar faGlasses = {\n  prefix: 'fas',\n  iconName: 'glasses',\n  icon: [576, 512, [], \"f530\", \"M143.3 96c-14 0-26.5 9.2-30.6 22.6L70.4 256 224 256c17.7 0 32 14.3 32 32l64 0c0-17.7 14.3-32 32-32l153.6 0-42.3-137.4C459.2 105.2 446.8 96 432.7 96L400 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l32.7 0c42.1 0 79.4 27.5 91.8 67.8l45.4 147.5c4.1 13.2 6.1 26.9 6.1 40.7l0 96c0 53-43 96-96 96l-64 0c-53 0-96-43-96-96l0-32-64 0 0 32c0 53-43 96-96 96l-64 0c-53 0-96-43-96-96l0-96c0-13.8 2.1-27.5 6.1-40.7L51.5 99.8C63.9 59.5 101.1 32 143.3 32L176 32c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32.7 0zM64 320l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64-128 0zm416 96c17.7 0 32-14.3 32-32l0-64-128 0 0 64c0 17.7 14.3 32 32 32l64 0z\"]\n};\nvar faCirclePause = {\n  prefix: 'fas',\n  iconName: 'circle-pause',\n  icon: [512, 512, [62092, \"pause-circle\"], \"f28b\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM224 192l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32z\"]\n};\nvar faPauseCircle = faCirclePause;\nvar faMemory = {\n  prefix: 'fas',\n  iconName: 'memory',\n  icon: [512, 512, [], \"f538\", \"M64 64C28.7 64 0 92.7 0 128l0 7.4C0 142.2 4.4 148 10.1 151.7 23.3 160.3 32 175.1 32 192s-8.7 31.7-21.9 40.3C4.4 236 0 241.8 0 248.6l0 55.4 512 0 0-55.4c0-6.8-4.4-12.6-10.1-16.3-13.2-8.6-21.9-23.4-21.9-40.3s8.7-31.7 21.9-40.3c5.7-3.7 10.1-9.5 10.1-16.3l0-7.4c0-35.3-28.7-64-64-64L64 64zM512 416l0-64-512 0 0 64c0 17.7 14.3 32 32 32l64 0 0-24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 24 88 0 0-24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 24 88 0 0-24c0-13.3 10.7-24 24-24s24 10.7 24 24l0 24 64 0c17.7 0 32-14.3 32-32zM160 160l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32z\"]\n};\nvar faGift = {\n  prefix: 'fas',\n  iconName: 'gift',\n  icon: [512, 512, [127873], \"f06b\", \"M321.5 68.8C329.1 55.9 342.9 48 357.8 48l2.2 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-73.3 0 34.8-59.2zm-131 0l34.8 59.2-73.3 0c-22.1 0-40-17.9-40-40s17.9-40 40-40l2.2 0c14.9 0 28.8 7.9 36.3 20.8zm89.6-24.3l-24.1 41-24.1-41C215.7 16.9 186.1 0 154.2 0L152 0c-48.6 0-88 39.4-88 88 0 14.4 3.5 28 9.6 40L32 128c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l448 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-41.6 0c6.1-12 9.6-25.6 9.6-40 0-48.6-39.4-88-88-88l-2.2 0c-31.9 0-61.5 16.9-77.7 44.4zM480 272l-200 0 0 208 136 0c35.3 0 64-28.7 64-64l0-144zm-248 0l-200 0 0 144c0 35.3 28.7 64 64 64l136 0 0-208z\"]\n};\nvar faMoneyBillWheat = {\n  prefix: 'fas',\n  iconName: 'money-bill-wheat',\n  icon: [512, 512, [], \"e52a\", \"M176-16c44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16-44.2 0-80-35.8-80-80 0-8.8 7.2-16 16-16zM56 0l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L56 48C42.7 48 32 37.3 32 24S42.7 0 56 0zM24 72l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 120C10.7 120 0 109.3 0 96S10.7 72 24 72zm8 96c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zM272 0c0-8.8 7.2-16 16-16 44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16-44.2 0-80-35.8-80-80zM400-16c44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16-44.2 0-80-35.8-80-80 0-8.8 7.2-16 16-16zm80 144c0 44.2-35.8 80-80 80-8.8 0-16-7.2-16-16 0-44.2 35.8-80 80-80 8.8 0 16 7.2 16 16zM352 112c8.8 0 16 7.2 16 16 0 44.2-35.8 80-80 80-8.8 0-16-7.2-16-16 0-44.2 35.8-80 80-80zm-96 16c0 44.2-35.8 80-80 80-8.8 0-16-7.2-16-16 0-44.2 35.8-80 80-80 8.8 0 16 7.2 16 16zM0 304c0-26.5 21.5-48 48-48l416 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 304zM48 416l0 48 48 0c0-26.5-21.5-48-48-48zM96 304l-48 0 0 48c26.5 0 48-21.5 48-48zM464 416c-26.5 0-48 21.5-48 48l48 0 0-48zM416 304c0 26.5 21.5 48 48 48l0-48-48 0zm-96 80a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z\"]\n};\nvar faDungeon = {\n  prefix: 'fas',\n  iconName: 'dungeon',\n  icon: [512, 512, [], \"f6d9\", \"M347.5 144.8c6.5 5.4 12.5 11.3 18 17.7 8.7 10.2 23.7 14 35.1 6.9l54.1-33.8c11.2-7 14.7-21.7 6.9-32.2-15.3-20.5-33.5-38.6-54.1-53.8-10.4-7.6-24.7-4.3-31.8 6.4l-35.1 52.6c-7.8 11.6-3.8 27.3 7 36.2zM327.8 41.1c8.6-12.9 2.9-30.5-12.2-34.1-19.1-4.6-39.1-7-59.6-7s-40.4 2.4-59.6 7c-15.1 3.6-20.8 21.2-12.2 34.1l40 60c5.2 7.8 14.5 11.7 23.9 11.2 5.2-.3 10.6-.3 15.8 0 9.4 .5 18.7-3.4 23.9-11.2l40-60zM50.5 103.3c-7.9 10.5-4.3 25.3 6.9 32.2l54.1 33.8c11.4 7.1 26.3 3.3 35.1-6.9 5.5-6.4 11.5-12.3 18-17.7 10.8-8.9 14.8-24.6 7-36.2L136.4 55.9c-7.1-10.7-21.5-14-31.8-6.4-20.6 15.1-38.8 33.3-54.1 53.8zm62 141.1c.8-9.9-3.3-19.9-11.8-25.1L41 182c-12.9-8-29.9-2.3-33.6 12.5-4.9 19.7-7.5 40.3-7.5 61.6l0 24c0 13.3 10.7 24 24 24l64 0c13.3 0 24-10.7 24-24l0-24c0-3.9 .2-7.8 .5-11.6zm287.1 0c.3 3.8 .5 7.7 .5 11.6l0 24c0 13.3 10.7 24 24 24l64 0c13.3 0 24-10.7 24-24l0-24c0-21.2-2.6-41.8-7.5-61.6-3.6-14.7-20.7-20.5-33.6-12.5l-59.7 37.3c-8.4 5.3-12.6 15.2-11.8 25.1zM88 352l-64 0c-13.3 0-24 10.7-24 24L0 488c0 13.3 10.7 24 24 24l64 0c13.3 0 24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm400 0l-64 0c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24l64 0c13.3 0 24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zM280 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 304c0 13.3 10.7 24 24 24s24-10.7 24-24l0-304zm-80 32c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 272c0 13.3 10.7 24 24 24s24-10.7 24-24l0-272zm160 0c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 272c0 13.3 10.7 24 24 24s24-10.7 24-24l0-272z\"]\n};\nvar faSuitcaseMedical = {\n  prefix: 'fas',\n  iconName: 'suitcase-medical',\n  icon: [512, 512, [\"medkit\"], \"f0fa\", \"M192 56l0 40 128 0 0-40c0-4.4-3.6-8-8-8L200 48c-4.4 0-8 3.6-8 8zm-48 8l0-8c0-30.9 25.1-56 56-56L312 0c30.9 0 56 25.1 56 56l0 424-224 0 0-416zM96 176l0 304-32 0c-35.3 0-64-28.7-64-64L0 160c0-35.3 28.7-64 64-64l32 0 0 80zM416 480l0-384 32 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64l-32 0zM244 208c-8.8 0-16 7.2-16 16l0 36-36 0c-8.8 0-16 7.2-16 16l0 24c0 8.8 7.2 16 16 16l36 0 0 36c0 8.8 7.2 16 16 16l24 0c8.8 0 16-7.2 16-16l0-36 36 0c8.8 0 16-7.2 16-16l0-24c0-8.8-7.2-16-16-16l-36 0 0-36c0-8.8-7.2-16-16-16l-24 0z\"]\n};\nvar faMedkit = faSuitcaseMedical;\nvar faPersonCane = {\n  prefix: 'fas',\n  iconName: 'person-cane',\n  icon: [448, 512, [], \"e53c\", \"M232-32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM144 236.7L97.7 299.1c-10.5 14.2-30.6 17.2-44.8 6.6s-17.2-30.6-6.6-44.8l70.5-95C142 132 181.7 112 224 112s82 20 107.2 53.9l70.5 95c10.5 14.2 7.6 34.2-6.6 44.8s-34.2 7.6-44.8-6.6L304 236.7 304 512c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-275.3zM392 384c-4.4 0-8 3.6-8 8 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-30.9 25.1-56 56-56s56 25.1 56 56l0 128c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-128c0-4.4-3.6-8-8-8z\"]\n};\nvar faGauge = {\n  prefix: 'fas',\n  iconName: 'gauge',\n  icon: [512, 512, [\"dashboard\", \"gauge-med\", \"tachometer-alt-average\"], \"f624\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm320 96c0-26.9-16.5-49.9-40-59.3L280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 172.7c-23.5 9.5-40 32.5-40 59.3 0 35.3 28.7 64 64 64s64-28.7 64-64zM144 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm-16 80a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM400 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\"]\n};\nvar faDashboard = faGauge;\nvar faGaugeMed = faGauge;\nvar faTachometerAltAverage = faGauge;\nvar faEnvelopeOpenText = {\n  prefix: 'fas',\n  iconName: 'envelope-open-text',\n  icon: [576, 512, [], \"f658\", \"M288 33.9L96.4 175.8 254.5 293c5.3 3.9 11.2 6.9 17.5 8.7L272 464c0 5.5 .5 10.8 1.3 16L96 480c-35.3 0-64-28.7-64-64l0-239.9c0-20.3 9.6-39.4 25.9-51.4L254.5-21c9.7-7.2 21.4-11 33.5-11s23.8 3.9 33.5 11L518.1 124.7c7.2 5.3 13.1 12 17.4 19.6-2.5-.2-5-.3-7.5-.3L436.6 144 288 33.9zM320 240c0-26.5 21.5-48 48-48l160 0c26.5 0 48 21.5 48 48l0 224c0 26.5-21.5 48-48 48l-160 0c-26.5 0-48-21.5-48-48l0-224zm80 16c-13.3 0-24 10.7-24 24s10.7 24 24 24l96 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-96 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0z\"]\n};\nvar faToolbox = {\n  prefix: 'fas',\n  iconName: 'toolbox',\n  icon: [512, 512, [129520], \"f552\", \"M176 56l0 40 160 0 0-40c0-4.4-3.6-8-8-8L184 48c-4.4 0-8 3.6-8 8zM128 96l0-40c0-30.9 25.1-56 56-56L328 0c30.9 0 56 25.1 56 56l0 40 28.1 0c12.7 0 24.9 5.1 33.9 14.1l51.9 51.9c9 9 14.1 21.2 14.1 33.9l0 76.1-136 0 0-16c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16-144 0 0-16c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16-136 0 0-76.1c0-12.7 5.1-24.9 14.1-33.9l51.9-51.9c9-9 21.2-14.1 33.9-14.1L128 96zM0 416l0-96 136 0 0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16 144 0 0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16 136 0 0 96c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64z\"]\n};\nvar faPowerOff = {\n  prefix: 'fas',\n  iconName: 'power-off',\n  icon: [512, 512, [9211], \"f011\", \"M288 0c0-17.7-14.3-32-32-32S224-17.7 224 0l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32L288 0zM146.3 98.4c14.5-10.1 18-30.1 7.9-44.6s-30.1-18-44.6-7.9C43.4 92.1 0 169 0 256 0 397.4 114.6 512 256 512S512 397.4 512 256c0-87-43.4-163.9-109.7-210.1-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6c49.8 34.8 82.3 92.4 82.3 157.6 0 106-86 192-192 192S64 362 64 256c0-65.2 32.5-122.9 82.3-157.6z\"]\n};\nvar faSignal = {\n  prefix: 'fas',\n  iconName: 'signal',\n  icon: [512, 512, [128246, \"signal-5\", \"signal-perfect\"], \"f012\", \"M488 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 400c0 13.3 10.7 24 24 24s24-10.7 24-24l0-400zM360 128c-13.3 0-24 10.7-24 24l0 304c0 13.3 10.7 24 24 24s24-10.7 24-24l0-304c0-13.3-10.7-24-24-24zM280 248c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 208c0 13.3 10.7 24 24 24s24-10.7 24-24l0-208zM152 320c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zM48 384c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48c0-13.3-10.7-24-24-24z\"]\n};\nvar faSignal5 = faSignal;\nvar faSignalPerfect = faSignal;\nvar faArrowsSpin = {\n  prefix: 'fas',\n  iconName: 'arrows-spin',\n  icon: [512, 512, [], \"e4bb\", \"M481.7 240.1c-17.6-1.2-32.9 12-34.2 29.7-3.3 47-23.6 89.4-54.8 121L361 359c-6.9-6.9-17.2-8.9-26.2-5.2S320 366.3 320 376l0 112c0 13.3 10.7 24 24 24l112 0c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-35-35c41.7-42.2 68.9-98.8 73.4-161.8 1.2-17.6-12-32.9-29.7-34.2zM39 41L74 76c-41.7 42.2-68.9 98.8-73.4 161.8-1.2 17.6 12 32.9 29.7 34.2s32.9-12 34.2-29.7c3.3-47 23.6-89.4 54.8-121L151 153c6.9 6.9 17.2 8.9 26.2 5.2S192 145.7 192 136l0-112c0-13.3-10.7-24-24-24L56 0C46.3 0 37.5 5.8 33.8 14.8S32.2 34.1 39 41zm201-10.7c-1.2 17.6 12 32.9 29.7 34.2 47 3.3 89.4 23.6 121 54.8L359 151c-6.9 6.9-8.9 17.2-5.2 26.2S366.3 192 376 192l112 0c13.3 0 24-10.7 24-24l0-112c0-9.7-5.8-18.5-14.8-22.2S477.9 32.2 471 39L436 74c-42.2-41.7-98.8-68.9-161.8-73.4-17.6-1.2-32.9 12-34.2 29.7zM41 473l35-35c42.2 41.7 98.8 68.9 161.8 73.4 17.6 1.2 32.9-12 34.2-29.7s-12-32.9-29.7-34.2c-47-3.3-89.4-23.6-121-54.8L153 361c6.9-6.9 8.9-17.2 5.2-26.2S145.7 320 136 320L24 320c-13.3 0-24 10.7-24 24L0 456c0 9.7 5.8 18.5 14.8 22.2S34.1 479.8 41 473z\"]\n};\nvar faJoint = {\n  prefix: 'fas',\n  iconName: 'joint',\n  icon: [576, 512, [], \"f595\", \"M360 0c13.3 0 24 10.7 24 24l0 19c0 40.3 16 79 44.5 107.5l21 21C469 191 480 217.4 480 245l0 19c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-19c0-14.9-5.9-29.1-16.4-39.6l-21-21C357.1 146.9 336 96 336 43l0-19c0-13.3 10.7-24 24-24zM552 288c-13.3 0-24-10.7-24-24l0-19c0-40.3-16-79-44.5-107.5l-21-21C443 97 432 70.6 432 43l0-19c0-13.3 10.7-24 24-24s24 10.7 24 24l0 19c0 14.9 5.9 29.1 16.4 39.6l21 21C554.9 141.1 576 192 576 245l0 19c0 13.3-10.7 24-24 24zM292.7 320c5.6 0 10.7 2.9 13.6 7.6L394.6 471c1.3 2.1 0 4.9-2.4 5.2-16.1 2.5-32.4 3.7-48.7 3.7l-38.1 0c-5.6 0-10.7-2.9-13.6-7.6l-79-128.4c-6-9.8 0-22.6 11.5-23.3 6.7-.4 13.4-.6 20.2-.6l48.3 0zM459.3 465.9c-6.4 1-12.7-1.9-16.1-7.4L374.1 346.1c-6.7-10.9 1.5-24.7 14.2-22.9 1.3 .2 2.6 .4 3.8 .6l136.4 21c27.3 4.2 47.4 27.7 47.4 55.3s-20.1 51.1-47.4 55.3l-69.2 10.6zM138.7 336c6.7-1.5 13.6 1.4 17.2 7.2l68.9 112c6.6 10.7-1.2 24.4-13.8 23.1-13-1.4-25.9-3.5-38.6-6.5L31.2 439.2C12.9 435 0 418.7 0 400s12.9-35 31.2-39.2L138.7 336z\"]\n};\nvar faBraille = {\n  prefix: 'fas',\n  iconName: 'braille',\n  icon: [384, 512, [], \"f2a1\", \"M80 144a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0 192a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0 136c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0 56c44.2 0 80-35.8 80-80s-35.8-80-80-80-80 35.8-80 80 35.8 80 80 80zm248-80c0 13.3-10.7 24-24 24s-24-10.7-24-24 10.7-24 24-24 24 10.7 24 24zm56 0c0-44.2-35.8-80-80-80s-80 35.8-80 80 35.8 80 80 80 80-35.8 80-80zM304 232a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm0 104a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-192a80 80 0 1 0 0-160 80 80 0 1 0 0 160z\"]\n};\nvar faBasketShopping = {\n  prefix: 'fas',\n  iconName: 'basket-shopping',\n  icon: [576, 512, [\"shopping-basket\"], \"f291\", \"M288 0c6.6 0 12.9 2.7 17.4 7.5l144 152 .5 .5 78.1 0c17.7 0 32 14.3 32 32 0 14.5-9.6 26.7-22.8 30.7L491.1 429.9c-6.5 29.3-32.5 50.1-62.5 50.1l-281.3 0c-30 0-56-20.8-62.5-50.1l-46-207.2c-13.2-3.9-22.8-16.2-22.8-30.7 0-17.7 14.3-32 32-32l78.1 0 .5-.5 144-152C275.1 2.7 281.4 0 288 0zm0 58.9L192.2 160 383.8 160 288 58.9zM208 264c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112zm80-24c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm128 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112z\"]\n};\nvar faShoppingBasket = faBasketShopping;\nvar faBridge = {\n  prefix: 'fas',\n  iconName: 'bridge',\n  icon: [512, 512, [], \"e4c8\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l8 0 0 64-40 0 0 112c37.6 9.4 64 43.2 64 82l0 94c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96s96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-94c0-38.8 26.4-72.6 64-82l0-112-40 0 0-64 8 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM424 96l0 64-80 0 0-64 80 0zM296 96l0 64-80 0 0-64 80 0zM88 96l80 0 0 64-80 0 0-64z\"]\n};\nvar faPlaneArrival = {\n  prefix: 'fas',\n  iconName: 'plane-arrival',\n  icon: [576, 512, [128748], \"f5af\", \"M386.6 193.1L265.9 3.7c-4.8-7.6-12.6-12.8-21.4-14.3l-43.1-7.6c-10.8-1.9-20.2 7.3-18.6 18.1l24 161.6-105-18.5-33.8-61.8C64.5 74.7 58.2 70.2 51.1 69L34 66c-9.8-1.7-18.8 5.9-18.8 15.8l.6 106.3c.2 30.9 22.4 57.3 52.9 62.7l13.5 2.4 0 0 417.6 73.6c30.5 5.4 59.5-15 64.9-45.4s-15-59.5-45.4-64.9L386.6 193.1zM224 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm131.2-15.3a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 448z\"]\n};\nvar faCashRegister = {\n  prefix: 'fas',\n  iconName: 'cash-register',\n  icon: [512, 512, [], \"f788\", \"M96 0C60.7 0 32 28.7 32 64s28.7 64 64 64l48 0 0 32-57 0c-31.6 0-58.5 23.1-63.3 54.4L1.1 364.1C.4 368.8 0 373.6 0 378.4L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-69.6c0-4.8-.4-9.6-1.1-14.4L488.2 214.4C483.5 183.1 456.6 160 425 160l-217 0 0-32 48 0c35.3 0 64-28.7 64-64S291.3 0 256 0L96 0zm0 48l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L96 80c-8.8 0-16-7.2-16-16s7.2-16 16-16zM64 424c0-13.3 10.7-24 24-24l336 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 448c-13.3 0-24-10.7-24-24zm48-160a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm120-24a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM160 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM328 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM256 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM424 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM352 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48z\"]\n};\nvar faRing = {\n  prefix: 'fas',\n  iconName: 'ring',\n  icon: [512, 512, [], \"f70b\", \"M64 208c0 7.8 4.4 18.7 17.1 30.3 45.4-24.2 107.7-38.3 174.9-38.3s129.5 14.1 174.9 38.3c12.8-11.6 17.1-22.5 17.1-30.3 0-12.3-10.8-32-47.9-50.6-35.2-17.6-86.1-29.4-144.1-29.4s-108.9 11.8-144.1 29.4C74.8 176 64 195.7 64 208zm192 40c-47 0-89.3 7.6-122.9 19.7 33.2 12.4 75.7 20.3 122.9 20.3s89.7-7.8 122.9-20.3C345.3 255.6 303 248 256 248zM0 208C0 158.4 39.4 122.2 83.3 100.2 129.1 77.3 190.3 64 256 64s126.9 13.3 172.7 36.2c43.9 22 83.3 58.2 83.3 107.8l0 96c0 49.6-39.4 85.8-83.3 107.8-45.9 22.9-107 36.2-172.7 36.2S129.1 434.7 83.3 411.8C39.4 389.8 0 353.6 0 304l0-96z\"]\n};\nvar faAquarius = {\n  prefix: 'fas',\n  iconName: 'aquarius',\n  icon: [576, 512, [], \"e845\", \"M401.7 291.4c9-4.5 19.6-4.5 28.6 0l128 64c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3L416 355.8 302.3 412.6c-9 4.5-19.6 4.5-28.6 0L160 355.8 46.3 412.6c-15.8 7.9-35 1.5-42.9-14.3s-1.5-35 14.3-42.9l128-64c9-4.5 19.6-4.5 28.6 0L288 348.2 401.7 291.4zm3.4-193.5c8.2-3 17.3-2.5 25.2 1.5l128 64c15.8 7.9 22.2 27.1 14.3 42.9s-27.1 22.2-42.9 14.3L416 163.8 302.3 220.6c-9 4.5-19.6 4.5-28.6 0L160 163.8 46.3 220.6c-15.8 7.9-35 1.5-42.9-14.3s-1.5-35 14.3-42.9l128-64 3.4-1.5c8.2-3 17.3-2.5 25.2 1.5l113.7 56.8 113.7-56.8 3.4-1.5z\"]\n};\nvar faShareNodes = {\n  prefix: 'fas',\n  iconName: 'share-nodes',\n  icon: [512, 512, [\"share-alt\"], \"f1e0\", \"M384 192c53 0 96-43 96-96s-43-96-96-96-96 43-96 96c0 5.4 .5 10.8 1.3 16L159.6 184.1c-16.9-15-39.2-24.1-63.6-24.1-53 0-96 43-96 96s43 96 96 96c24.4 0 46.6-9.1 63.6-24.1L289.3 400c-.9 5.2-1.3 10.5-1.3 16 0 53 43 96 96 96s96-43 96-96-43-96-96-96c-24.4 0-46.6 9.1-63.6 24.1L190.7 272c.9-5.2 1.3-10.5 1.3-16s-.5-10.8-1.3-16l129.7-72.1c16.9 15 39.2 24.1 63.6 24.1z\"]\n};\nvar faShareAlt = faShareNodes;\nvar faPersonCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'person-circle-exclamation',\n  icon: [640, 512, [], \"e53f\", \"M280 24a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zm24 212.7L341 286.6c12.8-17.5 28.5-32.7 46.3-45l-56.2-75.7C306 132 266.3 112 224 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6L144 236.7 144 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-275.3zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-140c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z\"]\n};\nvar faBinoculars = {\n  prefix: 'fas',\n  iconName: 'binoculars',\n  icon: [512, 512, [], \"f1e5\", \"M128 32l32 0c17.7 0 32 14.3 32 32l0 32-96 0 0-32c0-17.7 14.3-32 32-32zm64 96l0 320c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32l0-59.1c0-34.6 9.4-68.6 27.2-98.3 13.7-22.8 22.5-48.2 25.8-74.6L60.5 156c2-16 15.6-28 31.8-28l99.8 0zm227.8 0c16.1 0 29.8 12 31.8 28L459 216c3.3 26.4 12.1 51.8 25.8 74.6 17.8 29.7 27.2 63.7 27.2 98.3l0 59.1c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-320 99.8 0zM320 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 32-96 0 0-32zm-32 64l0 160-64 0 0-160 64 0z\"]\n};\nvar faKipSign = {\n  prefix: 'fas',\n  iconName: 'kip-sign',\n  icon: [384, 512, [], \"e1c4\", \"M340.8 88.3c13.4-11.5 15-31.7 3.5-45.1s-31.7-15-45.1-3.5L128 186.4 128 64c0-17.7-14.3-32-32-32S64 46.3 64 64l0 168-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 168c0 17.7 14.3 32 32 32s32-14.3 32-32l0-122.4 171.2 146.7c13.4 11.5 33.6 9.9 45.1-3.5s9.9-33.6-3.5-45.1L173.2 280 352 280c13.3 0 24-10.7 24-24s-10.7-24-24-24L173.2 232 340.8 88.3z\"]\n};\nvar faHardDrive = {\n  prefix: 'fas',\n  iconName: 'hard-drive',\n  icon: [448, 512, [128436, \"hdd\"], \"f0a0\", \"M64 32C28.7 32 0 60.7 0 96L0 260.1C18.1 247.4 40.2 240 64 240l320 0c23.8 0 45.9 7.4 64 20.1L448 96c0-35.3-28.7-64-64-64L64 32zM448 352c0-35.3-28.7-64-64-64L64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-64zM224 384a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faHdd = faHardDrive;\nvar faRankingStar = {\n  prefix: 'fas',\n  iconName: 'ranking-star',\n  icon: [576, 512, [], \"e561\", \"M321.8 54.1L298.2 6.3c-3.9-8.3-16.1-8.6-20.4 0l-23.6 47.8-52.3 7.5c-9.3 1.4-13.3 12.9-6.4 19.8l38 37-9 52.1c-1.4 9.3 8.2 16.5 16.8 12.2l46.9-24.8 46.6 24.4c8.6 4.3 18.3-2.9 16.8-12.2l-9-52.1 38-36.6c6.8-6.8 2.9-18.3-6.4-19.8l-52.3-7.5zM256 256c-26.5 0-48 21.5-48 48l0 160c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-160c0-26.5-21.5-48-48-48l-64 0zM48 320c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-64 0zM416 432l0 32c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-32c0-26.5-21.5-48-48-48l-64 0c-26.5 0-48 21.5-48 48z\"]\n};\nvar faUserTie = {\n  prefix: 'fas',\n  iconName: 'user-tie',\n  icon: [448, 512, [], \"f508\", \"M224 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240zm-30.5 56l61 0c9.7 0 17.5 7.8 17.5 17.5 0 4.2-1.5 8.2-4.2 11.4l-27.4 32 31 115.1 .6 0 34.6-138.5c2.2-8.7 11.1-14 19.5-10.8 61.9 23.6 105.9 83.6 105.9 153.8 0 15.1-12.3 27.4-27.4 27.4L43.4 512c-15.1 0-27.4-12.3-27.4-27.4 0-70.2 44-130.2 105.9-153.8 8.4-3.2 17.3 2.1 19.5 10.8l34.6 138.5 .6 0 31-115.1-27.4-32c-2.7-3.2-4.2-7.2-4.2-11.4 0-9.7 7.8-17.5 17.5-17.5z\"]\n};\nvar faEllipsis = {\n  prefix: 'fas',\n  iconName: 'ellipsis',\n  icon: [448, 512, [\"ellipsis-h\"], \"f141\", \"M0 256a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm168 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm224-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z\"]\n};\nvar faEllipsisH = faEllipsis;\nvar faStoreSlash = {\n  prefix: 'fas',\n  iconName: 'store-slash',\n  icon: [576, 512, [], \"e071\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-58.6-58.6c1.1-4 1.6-8.2 1.6-12.5l0-151.2c-12.5 4.6-26.1 7.2-40.5 7.2-8.1 0-15.9-.8-23.5-2.4l0 66.4-30.2 0-137.5-137.5c2.9-3.6 5.5-7.4 7.6-11.5 11.6 22 34.7 37 61.3 37 26.8 0 49.8-15.1 61.4-37.1 11.4 22.1 34.5 37.1 60.8 37.1 45.6 0 78.4-43.7 65.6-87.5L513.8 72.3C506.8 48.4 484.9 32 460 32L116 32c-5.5 0-10.8 .8-15.9 2.3L41-24.9zM151.5 221.3L48.7 118.6 38.9 152.5c-12.8 43.7 20 87.5 65.6 87.5 18.1 0 34.7-7.1 47-18.7zM410.2 480l-128-128-154.2 0 0-66.4c-7.6 1.6-15.5 2.4-23.5 2.4-14.4 0-28-2.6-40.5-7.2L64 432c0 26.5 21.5 48 48 48l298.2 0z\"]\n};\nvar faPercent = {\n  prefix: 'fas',\n  iconName: 'percent',\n  icon: [448, 512, [62101, 62785, \"percentage\"], \"25\", \"M192 128a96 96 0 1 0 -192 0 96 96 0 1 0 192 0zM448 384a96 96 0 1 0 -192 0 96 96 0 1 0 192 0zM438.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-384 384c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l384-384z\"]\n};\nvar faPercentage = faPercent;\nvar faFileZipper = {\n  prefix: 'fas',\n  iconName: 'file-zipper',\n  icon: [384, 512, [\"file-archive\"], \"f1c6\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM64 72c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 48C74.7 48 64 58.7 64 72zm0 96c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zm64 72l-32 0c-17.7 0-32 14.3-32 32l0 48c0 26.5 21.5 48 48 48s48-21.5 48-48l0-48c0-17.7-14.3-32-32-32zm-16 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z\"]\n};\nvar faFileArchive = faFileZipper;\nvar faDisplay = {\n  prefix: 'fas',\n  iconName: 'display',\n  icon: [512, 512, [], \"e163\", \"M448 96l0 256-384 0 0-256 384 0zM64 32C28.7 32 0 60.7 0 96L0 352c0 35.3 28.7 64 64 64l144 0-16 48-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l272 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0-16-48 144 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 32z\"]\n};\nvar faIcons = {\n  prefix: 'fas',\n  iconName: 'icons',\n  icon: [512, 512, [\"heart-music-camera-bolt\"], \"f86d\", \"M174.9 272c10.7 0 20.7 5.3 26.6 14.2l11.8 17.8 26.7 0c26.5 0 48 21.5 48 48l0 112c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 352c0-26.5 21.5-48 48-48l26.7 0 11.8-17.8c5.9-8.9 15.9-14.2 26.6-14.2l61.7 0zm278.6-12c5.6-4.9 13.9-5.3 19.9-.9s8.3 12.4 5.3 19.3L440.3 368 496 368c6.7 0 12.6 4.1 15 10.4s.6 13.3-4.4 17.7l-128 112c-5.6 4.9-13.9 5.3-19.9 .9s-8.3-12.4-5.3-19.3l38.5-89.7-55.8 0c-6.7 0-12.6-4.1-15-10.4s-.6-13.3 4.4-17.7l128-112zM144 360a48 48 0 1 0 0 96 48 48 0 1 0 0-96zM483.8 .4c6.5-1.1 13.1 .4 18.5 4.4 6.1 4.5 9.7 11.7 9.7 19.2l0 152-.3 4.9c-3.3 24.2-30.5 43.1-63.7 43.1-35.3 0-64-21.5-64-48s28.7-48 64-48c5.5 0 10.9 .6 16 1.6l0-49.3-112 33.6 0 110.2-.3 4.9c-3.3 24.2-30.5 43.1-63.7 43.1-35.3 0-64-21.5-64-48s28.7-48 64-48c5.5 0 10.9 .6 16 1.6L304 72c0-10.6 7-20 17.1-23l160-48 2.7-.6zM188.9 0C226 0 256 30 256 67.1l0 6.1c0 56.1-75.2 112.1-110.3 135.3-10.8 7.1-24.6 7.1-35.4 0-35.1-23.1-110.3-79.2-110.3-135.3l0-6.1C0 30 30 0 67.1 0 88.2 0 108 9.9 120.7 26.8l7.3 9.8 7.3-9.8C148 9.9 167.8 0 188.9 0z\"]\n};\nvar faHeartMusicCameraBolt = faIcons;\nvar faRulerVertical = {\n  prefix: 'fas',\n  iconName: 'ruler-vertical',\n  icon: [256, 512, [], \"f548\", \"M0 16C0-10.5 21.5-32 48-32l160 0c26.5 0 48 21.5 48 48l0 24-104 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l104 0 0 48-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 0 48-104 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l104 0 0 48-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 0 48-104 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l104 0 0 24c0 26.5-21.5 48-48 48L48 544c-26.5 0-48-21.5-48-48L0 16z\"]\n};\nvar faMapLocationDot = {\n  prefix: 'fas',\n  iconName: 'map-location-dot',\n  icon: [640, 512, [\"map-marked-alt\"], \"f5a0\", \"M576 48c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4L413.5 77.5 234.1 17.6c-8.1-2.7-16.8-2.1-24.4 1.7l-128 64C70.8 88.8 64 99.9 64 112l0 352c0 11.1 5.7 21.4 15.2 27.2s21.2 6.4 31.1 1.4l116.1-58.1 173.3 57.8c-4.3-6.4-8.5-13.1-12.6-19.9-11-18.3-21.9-39.3-30-61.8l-101.2-33.7 0-284.5 128 42.7 0 99.3c31-35.8 77-58.4 128-58.4 22.6 0 44.2 4.4 64 12.5L576 48zM512 224c-66.3 0-120 52.8-120 117.9 0 68.9 64.1 150.4 98.6 189.3 11.6 13 31.3 13 42.9 0 34.5-38.9 98.6-120.4 98.6-189.3 0-65.1-53.7-117.9-120-117.9zM472 344a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z\"]\n};\nvar faMapMarkedAlt = faMapLocationDot;\nvar faHeartCrack = {\n  prefix: 'fas',\n  iconName: 'heart-crack',\n  icon: [512, 512, [128148, \"heart-broken\"], \"f7a9\", \"M133.1 32c17.3 0 34.2 3.4 49.9 9.7l54.8 85.2-75.4 75.4c-1.5 1.5-2.4 3.6-2.3 5.8s1 4.2 2.6 5.7l112 104c2.9 2.7 7.4 2.9 10.5 .3s3.8-7 1.7-10.4l-60.4-98.1 90.7-75.6c2.6-2.1 3.5-5.7 2.4-8.8L296.4 60.6C319.6 42.3 348.6 32 378.9 32 452.4 32 512 91.6 512 165.1l0 2.6c0 112.2-139.9 242.5-212.9 298.2-12.4 9.4-27.6 14.1-43.1 14.1s-30.8-4.6-43.1-14.1C139.9 410.2 0 279.9 0 167.7l0-2.6C0 91.6 59.6 32 133.1 32z\"]\n};\nvar faHeartBroken = faHeartCrack;\nvar faCow = {\n  prefix: 'fas',\n  iconName: 'cow',\n  icon: [640, 512, [128004], \"f6c8\", \"M96 224l0 192c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-88.2c9.9 6.6 20.6 12 32 16.1l0 24.2c0 8.8 7.2 16 16 16s16-7.2 16-16l0-16.9c5.3 .6 10.6 .9 16 .9s10.7-.3 16-.9l0 16.9c0 8.8 7.2 16 16 16s16-7.2 16-16l0-24.2c11.4-4 22.1-9.4 32-16.1l0 88.2c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-160 32 32 0 49.5c0 9.5 2.8 18.7 8.1 26.6L530 427c8.8 13.1 23.5 21 39.3 21 22.5 0 41.9-15.9 46.3-38l20.3-101.6c2.6-13-.3-26.5-8-37.3l-3.9-5.5 0-81.6c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 14.4-52.9-74.1C496 86.5 452.4 64 405.9 64L144 64C77.7 64 24 117.7 24 184l0 54C9.4 249.8 0 267.8 0 288l0 17.6c0 8 6.4 14.4 14.4 14.4 31.8 0 57.6-25.8 57.6-57.6L72 184c0-24.3 12.1-45.8 30.5-58.9-4.2 10.8-6.5 22.6-6.5 34.9l0 64zM560 336a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM166.6 166.6c-4.2-4.2-6.6-10-6.6-16 0-12.5 10.1-22.6 22.6-22.6l178.7 0c12.5 0 22.6 10.1 22.6 22.6 0 6-2.4 11.8-6.6 16l-23.4 23.4C332.2 211.8 302.7 224 272 224s-60.2-12.2-81.9-33.9l-23.4-23.4z\"]\n};\nvar faRss = {\n  prefix: 'fas',\n  iconName: 'rss',\n  icon: [448, 512, [\"feed\"], \"f09e\", \"M0 64c0-17.7 14.3-32 32-32 229.8 0 416 186.2 416 416 0 17.7-14.3 32-32 32s-32-14.3-32-32C384 253.6 226.4 96 32 96 14.3 96 0 81.7 0 64zM0 416a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM32 160c159.1 0 288 128.9 288 288 0 17.7-14.3 32-32 32s-32-14.3-32-32c0-123.7-100.3-224-224-224-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faFeed = faRss;\nvar faMagnifyingGlass = {\n  prefix: 'fas',\n  iconName: 'magnifying-glass',\n  icon: [512, 512, [128269, \"search\"], \"f002\", \"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z\"]\n};\nvar faSearch = faMagnifyingGlass;\nvar faCloudMoon = {\n  prefix: 'fas',\n  iconName: 'cloud-moon',\n  icon: [640, 512, [], \"f6c3\", \"M480 0c14.6 0 28.8 1.6 42.5 4.7 7.4 1.7 13 7.8 13.9 15.4s-3 14.9-9.8 18.3c-45.4 22.6-76.6 69.5-76.6 123.6 0 76.2 61.8 138 138 138 3.7 0 7.4-.1 11.1-.4 7.6-.6 14.7 3.6 17.8 10.6s1.5 15.1-3.9 20.4c-26 25-59.1 42.7-95.9 49.9-11.1-25.3-30.2-46.3-54.1-59.8-7.6-63.4-61.6-112.6-127.1-112.6-11.2 0-22.1 1.5-32.5 4.2-4.8-4.2-9.9-8.2-15.2-11.8-.1-2.8-.2-5.6-.2-8.4 0-106 86-192 192-192zm-.1 431.9c0 44.2-35.8 80-80 80l-271.9 0c-53 0-96-43-96-96 0-47.6 34.6-87 80-94.6-.4-52.8 42.9-97.3 96-97.3 34.9 0 65.4 18.6 82.2 46.4 13-9.1 28.8-14.4 45.8-14.4 44.2 0 80 35.8 80 80 0 5.9-.6 11.7-1.9 17.2 37.4 6.7 65.8 39.4 65.8 78.7z\"]\n};\nvar faBoxesStacked = {\n  prefix: 'fas',\n  iconName: 'boxes-stacked',\n  icon: [512, 512, [62625, \"boxes\", \"boxes-alt\"], \"f468\", \"M224 0l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 5.5-.7 10.9-2 16l-252 0c-1.3-5.1-2-10.5-2-16l0-128c0-35.3 28.7-64 64-64l32 0zm96 512c-11.2 0-21.8-2.9-31-8 9.5-16.5 15-35.6 15-56l0-128c0-20.4-5.5-39.5-15-56 9.2-5.1 19.7-8 31-8l32 0 0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 35.3-28.7 64-64 64l-128 0zM0 320c0-35.3 28.7-64 64-64l32 0 0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 320z\"]\n};\nvar faBoxes = faBoxesStacked;\nvar faBoxesAlt = faBoxesStacked;\nvar faCodeBranch = {\n  prefix: 'fas',\n  iconName: 'code-branch',\n  icon: [448, 512, [], \"f126\", \"M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3l0 70.7 176 0c26.5 0 48-21.5 48-48l0-22.7c-28.3-12.3-48-40.5-48-73.3 0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 22.7c0 61.9-50.1 112-112 112l-176 0 0 70.7c28.3 12.3 48 40.5 48 73.3 0 44.2-35.8 80-80 80S0 476.2 0 432c0-32.8 19.7-61 48-73.3l0-205.3C19.7 141 0 112.8 0 80 0 35.8 35.8 0 80 0s80 35.8 80 80zm232 0a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM80 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faBan = {\n  prefix: 'fas',\n  iconName: 'ban',\n  icon: [512, 512, [128683, \"cancel\"], \"f05e\", \"M367.2 412.5L99.5 144.8c-22.4 31.4-35.5 69.8-35.5 111.2 0 106 86 192 192 192 41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3c22.4-31.4 35.5-69.8 35.5-111.2 0-106-86-192-192-192-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z\"]\n};\nvar faCancel = faBan;\nvar faJugDetergent = {\n  prefix: 'fas',\n  iconName: 'jug-detergent',\n  icon: [384, 512, [], \"e519\", \"M96 24c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24l0 24 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 96C74.7 96 64 85.3 64 72S74.7 48 88 48l8 0 0-24zM0 256c0-70.7 57.3-128 128-128l128 0c70.7 0 128 57.3 128 128l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256zm256 0l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32z\"]\n};\nvar faReply = {\n  prefix: 'fas',\n  iconName: 'reply',\n  icon: [512, 512, [61714, \"mail-reply\"], \"f3e5\", \"M204.2 18.4c12 5 19.8 16.6 19.8 29.6l0 80 112 0c97.2 0 176 78.8 176 176 0 113.3-81.5 163.9-100.2 174.1-2.5 1.4-5.3 1.9-8.1 1.9-10.9 0-19.7-8.9-19.7-19.7 0-7.5 4.3-14.4 9.8-19.5 9.4-8.8 22.2-26.4 22.2-56.7 0-53-43-96-96-96l-96 0 0 80c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-160-160c-12.5-12.5-12.5-32.8 0-45.3l160-160c9.2-9.2 22.9-11.9 34.9-6.9z\"]\n};\nvar faMailReply = faReply;\nvar faSunPlantWilt = {\n  prefix: 'fas',\n  iconName: 'sun-plant-wilt',\n  icon: [640, 512, [], \"e57a\", \"M160 0c-5.5 0-10.6 2.8-13.5 7.4l-1.1 2.1-24.8 55.4-56.7-21.7c-5.9-2.2-12.5-.8-17 3.7S41 58 43.2 63.9l21.7 56.7-55.4 24.8C3.7 148 0 153.7 0 160s3.7 12 9.5 14.6l55.4 24.8-21.7 56.7c-2.2 5.9-.8 12.5 3.7 17s11.1 5.9 17 3.7l56.7-21.7 24.8 55.4c2.6 5.8 8.3 9.5 14.6 9.5s12-3.7 14.6-9.5l24.8-55.4 56.8 21.7c5.9 2.2 12.5 .8 17-3.7s5.9-11.1 3.7-17l-21.7-56.7 55.4-24.8c5.8-2.6 9.5-8.3 9.5-14.6s-3.7-12-9.5-14.6l-55.4-24.8 21.7-56.7 .7-2.2c1.2-5.3-.4-10.9-4.3-14.8s-9.5-5.5-14.8-4.3l-2.2 .7-56.8 21.7-24.8-55.4C172 3.7 166.3 0 160 0zm0 96a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm376 16l0 53.4c-14.8 7.7-24 23.1-24 44.6 0 16.8 16 44 37.4 67.2 5.8 6.2 15.5 6.2 21.2 0 21.4-23.3 37.4-50.6 37.4-67.2 0-21.5-9.2-37-24-44.6l0-53.4c0-44.2-35.8-80-80-80s-80 35.8-80 80l0 22.7c-9.8-4.3-20.6-6.7-32-6.7-44.2 0-80 35.8-80 80l0 21.4c-14.8 7.6-24 23.1-24 44.6 0 16.8 16 44 37.4 67.2 5.8 6.2 15.5 6.2 21.2 0 21.4-23.3 37.4-50.6 37.4-67.2 0-21.5-9.2-37-24-44.6l0-21.4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 176-424 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-104 0 0-272c0-17.7 14.3-32 32-32s32 14.3 32 32z\"]\n};\nvar faBacterium = {\n  prefix: 'fas',\n  iconName: 'bacterium',\n  icon: [576, 512, [], \"e05a\", \"M408 16c0-13.3-10.7-24-24-24S360 2.7 360 16l0 23.4c-13.9 5.3-26.9 13.5-38.2 24.5L305 47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l16.8 16.8-30.1 30.1-16.8-16.8c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l16.8 16.8c-10 10-20 20-30.1 30.1L177 175c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l16.8 16.8-30.1 30.1-16.8-16.8c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l16.8 16.8c-11 11.3-19.2 24.3-24.5 38.2L48 328c-13.3 0-24 10.7-24 24s10.7 24 24 24l16.3 0c1.3 18.3 7.1 36.4 17.4 52.4L71 439c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l10.6-10.6c16 10.3 34.1 16.1 52.4 17.4l0 16.3c0 13.3 10.7 24 24 24s24-10.7 24-24l0-23.4c13.9-5.3 26.9-13.5 38.2-24.5L271 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-16.8-16.8 30.1-30.1 16.8 16.8c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-16.8-16.8c10-10 20-20 30.1-30.1L399 337c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-16.8-16.8 30.1-30.1 16.8 16.8c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-16.8-16.8c11-11.3 19.2-24.3 24.5-38.2l23.4 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16.3 0c-1.3-18.3-7.1-36.4-17.4-52.4L505 73c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L460.4 49.7c-16-10.3-34.1-16.1-52.4-17.4L408 16zM160 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM272 240a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faRecordVinyl = {\n  prefix: 'fas',\n  iconName: 'record-vinyl',\n  icon: [512, 512, [], \"f8d9\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 240a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-112a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faFloppyDisk = {\n  prefix: 'fas',\n  iconName: 'floppy-disk',\n  icon: [448, 512, [128190, 128426, \"save\"], \"f0c7\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-242.7c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32L64 32zm32 96c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-64zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z\"]\n};\nvar faSave = faFloppyDisk;\nvar faToiletsPortable = {\n  prefix: 'fas',\n  iconName: 'toilets-portable',\n  icon: [512, 512, [], \"e584\", \"M64 0l96 0c35.3 0 64 28.7 64 64l0 16-224 0 0-16C0 28.7 28.7 0 64 0zM0 128l224 0 0 360c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8-128 0 0 8c0 13.3-10.7 24-24 24S0 501.3 0 488L0 128zM128 248l0 48c0 13.3 10.7 24 24 24l24 0 0-96-24 0c-13.3 0-24 10.7-24 24zM352 0l96 0c35.3 0 64 28.7 64 64l0 16-224 0 0-16c0-35.3 28.7-64 64-64zM288 128l224 0 0 360c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8-128 0 0 8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-360zM416 248l0 48c0 13.3 10.7 24 24 24l24 0 0-96-24 0c-13.3 0-24 10.7-24 24z\"]\n};\nvar faO = {\n  prefix: 'fas',\n  iconName: 'o',\n  icon: [448, 512, [111], \"4f\", \"M224 96a160 160 0 1 0 0 320 160 160 0 1 0 0-320zM448 256a224 224 0 1 1 -448 0 224 224 0 1 1 448 0z\"]\n};\nvar faPalette = {\n  prefix: 'fas',\n  iconName: 'palette',\n  icon: [512, 512, [127912], \"f53f\", \"M512 256c0 .9 0 1.8 0 2.7-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48 0 3.4 .4 6.7 1 9.9 2.1 10.2 6.5 20 10.8 29.9 6.1 13.8 12.1 27.5 12.1 42 0 31.8-21.6 60.7-53.4 62-3.5 .1-7 .2-10.6 .2-141.4 0-256-114.6-256-256S114.6 0 256 0 512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faUnlock = {\n  prefix: 'fas',\n  iconName: 'unlock',\n  icon: [384, 512, [128275], \"f09c\", \"M128 96c0-35.3 28.7-64 64-64 31.7 0 58 23 63.1 53.3 2.9 17.4 19.4 29.2 36.9 26.3s29.2-19.4 26.3-36.9C308.1 14.1 255.5-32 192-32 121.3-32 64 25.3 64 96l0 64c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64l-192 0 0-64z\"]\n};\nvar faEarListen = {\n  prefix: 'fas',\n  iconName: 'ear-listen',\n  icon: [512, 512, [\"assistive-listening-systems\"], \"f2a2\", \"M379.6 .3c-8.9 1.2-17.2 6.2-22.4 14.1-6.8 10.4-7 24.1-.4 34.6 5.6 8.9 15.5 12.7 23.8 18.5 7.5 5.2 17.6 13.2 27.7 24.2 20 21.7 39.5 54.3 39.5 100.3 0 17.7 14.3 32 32 32s32-14.3 32-32c0-66-28.5-113.4-56.5-143.7-13.9-15.1-27.8-26.1-38.3-33.3-11-7.6-23.5-16.6-37.6-14.7zM240 128c-57.6 0-105.1 43.6-111.3 99.5-1.9 17.6-17.8 30.2-35.3 28.3s-30.2-17.8-28.3-35.3c9.7-88 84.3-156.5 174.9-156.5 97.2 0 176 78.8 176 176 0 46-17.7 87.9-46.6 119.3-12 13-17.4 24.8-17.4 34.7l0 6.1c0 61.9-50.1 112-112 112-17.7 0-32-14.3-32-32s14.3-32 32-32c26.5 0 48-21.5 48-48l0-6.1c0-32.9 17.4-59.6 34.4-78 18.4-20 29.6-46.6 29.6-75.9 0-61.9-50.1-112-112-112zM0 480a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm160-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM86.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64zM240 208c-17.7 0-32 14.3-32 32 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-17.7-14.3-32-32-32z\"]\n};\nvar faAssistiveListeningSystems = faEarListen;\nvar faCodePullRequest = {\n  prefix: 'fas',\n  iconName: 'code-pull-request',\n  icon: [512, 512, [], \"e13c\", \"M328 24c0-9.7-5.8-18.5-14.8-22.2S293.9 .2 287 7L231 63c-9.4 9.4-9.4 24.6 0 33.9l56 56c6.9 6.9 17.2 8.9 26.2 5.2S328 145.7 328 136l0-24 24 0c17.7 0 32 14.3 32 32l0 214.7c-28.3 12.3-48 40.5-48 73.3 0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3L448 144c0-53-43-96-96-96l-24 0 0-24zM72 80a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm56 73.3c28.3-12.3 48-40.5 48-73.3 0-44.2-35.8-80-80-80S16 35.8 16 80c0 32.8 19.7 61 48 73.3l0 205.3c-28.3 12.3-48 40.5-48 73.3 0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3l0-205.3zM72 432a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm344-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faKey = {\n  prefix: 'fas',\n  iconName: 'key',\n  icon: [512, 512, [128273], \"f084\", \"M336 352c97.2 0 176-78.8 176-176S433.2 0 336 0 160 78.8 160 176c0 18.7 2.9 36.8 8.3 53.7L7 391c-4.5 4.5-7 10.6-7 17l0 80c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-40 40 0c13.3 0 24-10.7 24-24l0-40 40 0c6.4 0 12.5-2.5 17-7l33.3-33.3c16.9 5.4 35 8.3 53.7 8.3zM376 96a40 40 0 1 1 0 80 40 40 0 1 1 0-80z\"]\n};\nvar faSkull = {\n  prefix: 'fas',\n  iconName: 'skull',\n  icon: [512, 512, [128128], \"f54c\", \"M416 427.4c58.5-44 96-111.6 96-187.4 0-132.5-114.6-240-256-240S0 107.5 0 240c0 75.8 37.5 143.4 96 187.4L96 464c0 26.5 21.5 48 48 48l32 0 0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40 64 0 0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40 32 0c26.5 0 48-21.5 48-48l0-36.6zM96 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm256-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z\"]\n};\nvar faMarsStrokeUp = {\n  prefix: 'fas',\n  iconName: 'mars-stroke-up',\n  icon: [384, 512, [9896, \"mars-stroke-v\"], \"f22a\", \"M192 256a112 112 0 1 0 0 224 112 112 0 1 0 0-224zM16 368c0-86.3 62.1-158.1 144.1-173.1-.1-.9-.1-1.9-.1-2.9l0-16-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-61.4-28 22.4c-13.8 11-33.9 8.8-45-5s-8.8-33.9 5-45l80-64c11.7-9.3 28.3-9.3 40 0l80 64c13.8 11 16 31.2 5 45s-31.2 16-45 5l-28-22.4 0 61.4 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 16c0 1 0 1.9-.1 2.9 82 15 144.1 86.8 144.1 173.1 0 97.2-78.8 176-176 176S16 465.2 16 368z\"]\n};\nvar faMarsStrokeV = faMarsStrokeUp;\nvar faFireFlameSimple = {\n  prefix: 'fas',\n  iconName: 'fire-flame-simple',\n  icon: [384, 512, [\"burn\"], \"f46a\", \"M372.5 256.5l-.7-1.9C337.8 160.8 282 76.5 209.1 8.5l-3.3-3C202.1 2 197.1 0 192 0s-10.1 2-13.8 5.5l-3.3 3C102 76.5 46.2 160.8 12.2 254.6l-.7 1.9C3.9 277.3 0 299.4 0 321.6 0 426.7 86.8 512 192 512s192-85.3 192-190.4c0-22.2-3.9-44.2-11.5-65.1zm-90.8 49.5c4.1 9.3 6.2 19.4 6.2 29.5 0 53-43 96.5-96 96.5s-96-43.5-96-96.5c0-10.1 2.1-20.3 6.2-29.5l1.9-4.3c15.8-35.4 37.9-67.7 65.3-95.1l8.9-8.9c3.6-3.6 8.5-5.6 13.6-5.6s10 2 13.6 5.6l8.9 8.9c27.4 27.4 49.6 59.7 65.3 95.1l1.9 4.3z\"]\n};\nvar faBurn = faFireFlameSimple;\nvar faTree = {\n  prefix: 'fas',\n  iconName: 'tree',\n  icon: [448, 512, [127794], \"f1bb\", \"M224-32c7 0 13.7 3.1 18.3 8.5l136 160c6.1 7.1 7.4 17.1 3.5 25.6S369.4 176 360 176l-24.9 0 75.2 88.5c6.1 7.1 7.4 17.1 3.5 25.6S401.4 304 392 304l-38.5 0 88.8 104.5c6.1 7.1 7.4 17.1 3.5 25.6S433.4 448 424 448l-168 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64-168 0c-9.4 0-17.9-5.4-21.8-13.9s-2.6-18.5 3.5-25.6L94.5 304 56 304c-9.4 0-17.9-5.4-21.8-13.9s-2.6-18.5 3.5-25.6L112.9 176 88 176c-9.4 0-17.9-5.4-21.8-13.9s-2.6-18.5 3.5-25.6l136-160C210.3-28.9 217-32 224-32z\"]\n};\nvar faSmog = {\n  prefix: 'fas',\n  iconName: 'smog',\n  icon: [576, 512, [], \"f75f\", \"M176 288C96.5 288 32 223.5 32 144S96.5 0 176 0c27.2 0 52.6 7.5 74.3 20.6 20.1-13 44-20.6 69.7-20.6 47.4 0 88.7 25.7 110.9 64l1.1 0c61.9 0 112 50.1 112 112 0 60.3-47.6 109.4-107.2 111.9-22.6 20-52.3 32.1-84.8 32.1-32.5 0-62.1-12.1-84.7-32L176 288zM512 392c0 13.3-10.7 24-24 24L24 416c-13.3 0-24-10.7-24-24s10.7-24 24-24l464 0c13.3 0 24 10.7 24 24zM88 464l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm176 0l288 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-288 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faS = {\n  prefix: 'fas',\n  iconName: 's',\n  icon: [320, 512, [115], \"53\", \"M0 157.5C0 88.2 56.2 32 125.5 32L272 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L125.5 96c-34 0-61.5 27.5-61.5 61.5 0 31 23.1 57.2 53.9 61L210.1 230C272.9 237.9 320 291.2 320 354.5 320 423.8 263.8 480 194.5 480L48 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l146.5 0c34 0 61.5-27.5 61.5-61.5 0-31-23.1-57.2-53.9-61L109.9 282C47.1 274.1 0 220.8 0 157.5z\"]\n};\nvar faJedi = {\n  prefix: 'fas',\n  iconName: 'jedi',\n  icon: [576, 512, [], \"f669\", \"M246 315.7l-21.2-31.9c-2.1-3.2-1.7-7.4 1-10.1s6.9-3.1 10.1-1l29.5 19.7c2.1 1.4 4.9-.1 5-2.6L279.7 8c.1-4.5 3.8-8 8.3-8s8.1 3.5 8.3 8l9.4 281.9c.1 2.5 2.9 3.9 5 2.6l29.5-19.7c3.2-2.1 7.4-1.7 10.1 1s3.1 6.9 1 10.1L330 315.7c-1.3 1.9-.2 4.5 2 4.9l37.6 7.5c3.7 .7 6.4 4 6.4 7.8s-2.7 7.1-6.4 7.8L332 351.4c-2.2 .4-3.3 3-2 4.9l21.2 31.9c2.1 3.2 1.7 7.4-1 10.1s-6.9 3.1-10.1 1l-26.3-17.6c-2.2-1.4-5.1 .2-5 2.8l2.1 61.5c59.8-10.8 105.1-63.1 105.1-126 0-37-15.7-70.4-40.8-93.7-7-6.5-6.5-18.6 1-24.4 34-26.3 55.8-67.5 55.8-113.9 0-16.8-2.9-33-8.2-48-4.6-13 10.2-30 21.4-22 53.5 38 92.7 94.8 107.8 160.7 .5 2.1-.2 4.3-1.7 5.9l-28.4 28.4c-4 4-1.2 10.9 4.5 10.9l26 0c3.4 0 6.2 2.6 6.3 6 .1 3.3 .2 6.6 .2 10 0 17.5-1.7 34.7-4.8 51.3-.2 1.2-.9 2.4-1.7 3.3l-46.5 46.5c-4 4-1.2 10.9 4.5 10.9l14.6 0c4.6 0 7.7 4.8 5.7 9-44.5 89.5-136.9 151-243.7 151S88.8 450.5 44.3 361c-2.1-4.2 1-9 5.7-9l14.6 0c5.7 0 8.6-6.9 4.5-10.9L22.6 294.6c-.9-.9-1.5-2-1.7-3.3-3.2-16.6-4.8-33.8-4.8-51.3 0-3.3 .1-6.7 .2-10 .1-3.4 2.9-6 6.3-6l26 0c5.7 0 8.6-6.9 4.5-10.9L24.6 184.6c-1.5-1.5-2.2-3.8-1.7-5.9 15.2-66 54.3-122.8 107.8-160.7 11.3-8 26 8.9 21.4 22-5.3 15-8.2 31.2-8.2 48 0 46.3 21.9 87.5 55.8 113.9 7.5 5.8 8 17.9 1 24.4-25.1 23.4-40.8 56.7-40.8 93.7 0 62.9 45.4 115.2 105.1 126l2.1-61.5c.1-2.6-2.8-4.2-5-2.8l-26.3 17.6c-3.2 2.1-7.4 1.7-10.1-1s-3.1-6.9-1-10.1L246 356.3c1.3-1.9 .2-4.5-2-4.9l-37.6-7.5c-3.7-.7-6.4-4-6.4-7.8s2.7-7.1 6.4-7.8l37.6-7.5c2.2-.4 3.3-3 2-4.9z\"]\n};\nvar faPersonHiking = {\n  prefix: 'fas',\n  iconName: 'person-hiking',\n  icon: [448, 512, [\"hiking\"], \"f6ec\", \"M192-32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM128 173.6c0-34 27.6-61.6 61.6-61.6 20.3 0 39.7 8.1 54 22.4l48.2 48.2c6 6 14.1 9.4 22.6 9.4l37.5 0c5.8 0 11.3 1.6 16 4.3l0-76.3c0-13.3 10.7-24 24-24s24 10.7 24 24l0 400c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-268.3c-4.7 2.7-10.2 4.3-16 4.3l-37.5 0c-25.5 0-49.9-10.1-67.9-28.1l-6.6-6.6 0 109.2 34.5 29.6c17.7 15.2 29.3 36.2 32.6 59.3l12.6 88.1c2.5 17.5-9.7 33.7-27.2 36.2s-33.7-9.7-36.2-27.2l-12.6-88.1c-1.1-7.7-5-14.7-10.9-19.8l-71.4-61.2c-21.3-18.2-33.5-44.9-33.5-72.9l0-101zm-4.8 203.7c2.3 2.3 4.7 4.4 7.1 6.5l44.9 38.5c-3.6 8.4-8.5 16.3-14.4 23.4L88.6 532.5c-11.3 13.6-31.5 15.4-45.1 4.1s-15.4-31.5-4.1-45.1l72.3-86.7c2.6-3.1 4.5-6.6 5.8-10.4l5.7-17.1zM0 160c0-35.3 28.7-64 64-64 17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-96z\"]\n};\nvar faHiking = faPersonHiking;\nvar faArrowsUpToLine = {\n  prefix: 'fas',\n  iconName: 'arrows-up-to-line',\n  icon: [448, 512, [], \"e4c2\", \"M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l384 0c17.7 0 32-14.3 32-32S433.7 0 416 0L32 0zm86.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L64 237.3 64 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-242.7 9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64zm256 0c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4 0 242.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-242.7 9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z\"]\n};\nvar faMarsDouble = {\n  prefix: 'fas',\n  iconName: 'mars-double',\n  icon: [640, 512, [9891], \"f227\", \"M288 32c0-17.7 14.3-32 32-32L448 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-50.7-95 95c19.5 28.4 31 62.7 31 99.8 0 97.2-78.8 176-176 176S0 401.2 0 304 78.8 128 176 128c37 0 71.4 11.4 99.8 31l95-95-50.7 0c-17.7 0-32-14.3-32-32zM176 416a112 112 0 1 0 0-224 112 112 0 1 0 0 224zm160 64c-6.8 0-13.4-.4-20-1.1 23.6-18.9 43.3-42.5 57.6-69.4 43.3-15.5 74.4-56.9 74.4-105.5 0-25.2-8.3-48.5-22.4-67.2 7.1 2.1 14.6 3.2 22.4 3.2 17 0 32.7-5.3 45.7-14.3 11.7 23.6 18.3 50.2 18.3 78.3 0 97.2-78.8 176-176 176zM528 157.3L528 32c0-11.4-2.4-22.2-6.7-32L608 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-50.7-48 48z\"]\n};\nvar faThermometer = {\n  prefix: 'fas',\n  iconName: 'thermometer',\n  icon: [512, 512, [], \"f491\", \"M96 382.1l0-88.8c0-14.9 5.9-29.1 16.4-39.6l21.7-21.7 41 41c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-41-41 46.1-46.1 41 41c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-41-41 46.1-46.1 41 41c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-41-41 7.8-7.8c19.4-19.4 45.6-30.2 73-30.2 57 0 103.2 46.2 103.2 103.2 0 27.4-10.9 53.6-30.2 73L258.3 399.6c-10.5 10.5-24.7 16.4-39.6 16.4l-88.8 0-89 89c-9.4 9.4-24.6 9.4-33.9 0S-2.3 480.4 7 471l89-89z\"]\n};\nvar faPaintbrush = {\n  prefix: 'fas',\n  iconName: 'paintbrush',\n  icon: [576, 512, [128396, \"paint-brush\"], \"f1fc\", \"M480.5 10.3L259.1 158c-29.1 19.4-47.6 50.9-50.6 85.3 62.3 12.8 111.4 61.9 124.3 124.3 34.5-3 65.9-21.5 85.3-50.6L565.7 95.5c6.7-10.1 10.3-21.9 10.3-34.1 0-33.9-27.5-61.4-61.4-61.4-12.1 0-24 3.6-34.1 10.3zM288 400c0-61.9-50.1-112-112-112S64 338.1 64 400c0 3.9 .2 7.8 .6 11.6 1.8 17.5-10.2 36.4-27.8 36.4L32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0c61.9 0 112-50.1 112-112z\"]\n};\nvar faPaintBrush = faPaintbrush;\nvar faNeuter = {\n  prefix: 'fas',\n  iconName: 'neuter',\n  icon: [384, 512, [9906], \"f22c\", \"M80 176a112 112 0 1 1 224 0 112 112 0 1 1 -224 0zM223.9 349.1C305.9 334.1 368 262.3 368 176 368 78.8 289.2 0 192 0S16 78.8 16 176c0 86.3 62.1 158.1 144.1 173.1-.1 1-.1 1.9-.1 2.9l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-1 0-1.9-.1-2.9z\"]\n};\nvar faSquarePhoneFlip = {\n  prefix: 'fas',\n  iconName: 'square-phone-flip',\n  icon: [448, 512, [\"phone-square-alt\"], \"f87b\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm232 96.7l2.8 .8c32.3 8.8 59.9 40.1 51.8 78.2-18.5 87.5-87.4 156.3-174.9 174.9-38.1 8.1-69.4-19.5-78.2-51.8l-.8-2.8c-2.7-9.8 2.4-20.1 11.8-24l48.7-20.3c8.3-3.4 17.8-1.1 23.5 5.9l19.3 23.6c35.1-17.4 63.4-46.6 79.6-82.4l-22.1-18c-6.9-5.7-9.3-15.2-5.9-23.5l20.3-48.7c3.9-9.4 14.2-14.4 24-11.8z\"]\n};\nvar faPhoneSquareAlt = faSquarePhoneFlip;\nvar faFaceGrinTongueSquint = {\n  prefix: 'fas',\n  iconName: 'face-grin-tongue-squint',\n  icon: [512, 512, [128541, \"grin-tongue-squint\"], \"f58a\", \"M0 256c0 104.4 62.5 194.2 152.2 234.1-5.3-13-8.2-27.2-8.2-42.1l0-61.7c-16.9-16.5-30.1-36.7-38.3-59.3-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1c11.9-3.7 23.9 6.3 19.6 18.1-8.3 22.6-21.5 42.8-38.3 59.3l0 61.7c0 14.9-2.9 29.1-8.2 42.1 89.7-39.8 152.2-129.6 152.2-234.1 0-141.4-114.6-256-256-256S0 114.6 0 256zm125.8-91.7c-6.2-5.2-7.6-14.3-3.1-21.1s13.3-9.2 20.6-5.5l79.6 40c5.4 2.7 8.8 8.2 8.8 14.3s-3.4 11.6-8.8 14.3l-79.6 40c-7.3 3.6-16.1 1.3-20.6-5.5s-3.1-15.9 3.1-21.1L159 192 125.8 164.3zm263.6-21.1c4.5 6.8 3.1 15.9-3.1 21.1L353 192 386.2 219.7c6.2 5.2 7.6 14.3 3.1 21.1s-13.3 9.2-20.6 5.5l-79.6-40c-5.4-2.7-8.8-8.2-8.8-14.3s3.4-11.6 8.8-14.3l79.6-40c7.3-3.6 16.1-1.3 20.6 5.5zM320 448l0-45.4c0-14.7-11.9-26.6-26.6-26.6l-2 0c-11.3 0-21.1 7.9-23.6 18.9-2.8 12.6-20.8 12.6-23.6 0-2.5-11.1-12.3-18.9-23.6-18.9l-2 0c-14.7 0-26.6 11.9-26.6 26.6l0 45.4c0 35.3 28.7 64 64 64s64-28.7 64-64z\"]\n};\nvar faGrinTongueSquint = faFaceGrinTongueSquint;\nvar faCommentDollar = {\n  prefix: 'fas',\n  iconName: 'comment-dollar',\n  icon: [512, 512, [], \"f651\", \"M256 480c141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240c0 54.3 19.2 104.3 51.6 144.5L2.8 476.8c-4.8 9-3.3 20 3.6 27.5s17.8 9.8 27.1 5.8l118.4-50.7C183.7 472.6 218.9 480 256 480zm4-352c11 0 20 9 20 20l0 4 8 0c11 0 20 9 20 20s-9 20-20 20l-47.5 0c-6.9 0-12.5 5.6-12.5 12.5 0 6.1 4.4 11.3 10.4 12.3l41.7 7c25.3 4.2 43.9 26.1 43.9 51.8 0 26.1-19 47.7-44 51.8l0 4.7c0 11-9 20-20 20s-20-9-20-20l0-4-24 0c-11 0-20-9-20-20s9-20 20-20l55.5 0c6.9 0 12.5-5.6 12.5-12.5 0-6.1-4.4-11.3-10.4-12.3l-41.7-7c-25.3-4.2-43.9-26.1-43.9-51.8 0-28.8 23.2-52.2 52-52.5l0-4c0-11 9-20 20-20z\"]\n};\nvar faHippo = {\n  prefix: 'fas',\n  iconName: 'hippo',\n  icon: [640, 512, [129435], \"f6ed\", \"M407 47c9.4-9.4 24.6-9.4 33.9 0l17.2 17.2c1.9-.1 3.9-.2 5.8-.2l32 0c11.2 0 21.9 2.3 31.6 6.5L543 55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L564 101.9c7.6 12.2 12 26.7 12 42.1 0 10.2 7.4 18.8 16.7 23 27.9 12.5 47.3 40.5 47.3 73 0 26.2-12.6 49.4-32 64l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-16-64 0 0 16c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-17.6c-11.8-2.4-22.7-7.4-32-14.4-1.5-1.1-2.9-2.3-4.3-3.5-17-14.7-27.7-36.4-27.7-60.5 0-8.8-7.2-16-16-16s-16 7.2-16 16c0 44.7 26.2 83.2 64 101.2l0 10.8c0 17.7 14.3 32 32 32l32 0 0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-76c-19.8 7.7-41.4 12-64 12s-44.2-4.3-64-12l0 76c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-118.9-18.1 40.7c-5.4 12.1-19.6 17.6-31.7 12.2S-3.3 362.4 2.1 350.3L24 300.9c5.3-11.9 8-24.7 8-37.7 0-107.5 85.2-195.2 191.8-199.1l.2-.1 64 0c41.7 0 83.4 12.1 117.2 25.7 1.7-1.8 3.5-3.6 5.3-5.2L407 81c-9.4-9.4-9.4-24.6 0-33.9zm73 185a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm88 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM480 144a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z\"]\n};\nvar faBowlFood = {\n  prefix: 'fas',\n  iconName: 'bowl-food',\n  icon: [512, 512, [], \"e4c6\", \"M0 176c0-35.3 28.7-64 64-64 .5 0 1.1 0 1.6 0 7.4-36.5 39.7-64 78.4-64 15 0 29 4.1 40.9 11.2 13.3-25.7 40.1-43.2 71.1-43.2s57.8 17.6 71.1 43.2c12-7.1 26-11.2 40.9-11.2 38.7 0 71 27.5 78.4 64 .5 0 1.1 0 1.6 0 35.3 0 64 28.7 64 64 0 11.7-3.1 22.6-8.6 32L8.6 208C3.1 198.6 0 187.7 0 176zM0 283.4C0 268.3 12.3 256 27.4 256l457.1 0c15.1 0 27.4 12.3 27.4 27.4 0 70.5-44.4 130.7-106.7 154.1L403.5 452c-2 16-15.6 28-31.8 28l-231.5 0c-16.1 0-29.8-12-31.8-28l-1.8-14.4C44.4 414.1 0 353.9 0 283.4z\"]\n};\nvar faSquareVirus = {\n  prefix: 'fas',\n  iconName: 'square-virus',\n  icon: [448, 512, [], \"e578\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm160 80c13.3 0 24 10.7 24 24 0 22.9 27.7 34.4 43.9 18.2 9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-16.2 16.2-4.7 43.9 18.2 43.9 13.3 0 24 10.7 24 24s-10.7 24-24 24c-22.9 0-34.4 27.7-18.2 43.9 9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-16.2-16.2-43.9-4.7-43.9 18.2 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-22.9-27.7-34.4-43.9-18.2-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9c16.2-16.2 4.7-43.9-18.2-43.9-13.3 0-24-10.7-24-24s10.7-24 24-24c22.9 0 34.4-27.7 18.2-43.9-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0c16.2 16.2 43.9 4.7 43.9-18.2 0-13.3 10.7-24 24-24zM192 248a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm88 40a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faCloudSunRain = {\n  prefix: 'fas',\n  iconName: 'cloud-sun-rain',\n  icon: [640, 512, [127782], \"f743\", \"M254.9 448.2c4.2-12.6 17.8-19.4 30.3-15.2 12.6 4.2 19.4 17.8 15.2 30.4l-21.4 64.1c-4.2 12.6-17.8 19.4-30.4 15.2s-19.4-17.8-15.2-30.3l21.4-64.2zm120 0c4.2-12.6 17.8-19.4 30.3-15.2 12.6 4.2 19.4 17.8 15.2 30.4l-21.4 64.1c-4.2 12.6-17.8 19.4-30.4 15.2s-19.4-17.8-15.2-30.3l21.4-64.2zm120 0c4.2-12.6 17.8-19.4 30.3-15.2 12.6 4.2 19.4 17.8 15.2 30.4l-21.4 64.1c-4.2 12.6-17.8 19.4-30.4 15.2s-19.4-17.8-15.2-30.3l21.4-64.2zM448.3 128c44.2 0 80 35.8 80 80 0 7.5-1.1 14.7-3 21.5 29.8 11.6 51 40.6 51 74.5 0 44.2-35.8 80-80 80l-192 0-8.2-.4c-40.3-4.1-71.8-38.2-71.8-79.6 0-39 27.9-71.5 64.9-78.5-.5-3.1-.9-6.2-.9-9.5 0-30.9 25.1-56 56-56 12.4 0 23.9 4.1 33.2 10.9 13.4-25.5 40.1-42.9 70.8-42.9zM240.3-31.8c5.3 0 10.3 2.7 13.3 7.1l47.3 70.4 83.3-16.3c5.2-1 10.6 .7 14.3 4.4 3.8 3.8 5.4 9.2 4.4 14.4l-8.6 43.8c-11.9 5.5-22.8 12.9-32.4 21.6-5.7-1-11.7-1.5-17.7-1.5-14.3 0-28 3-40.4 8.2-16.9-15-39.2-24.2-63.6-24.2-53 0-96 43-96 96 0 30.9 14.6 58.2 37.2 75.8-3.4 11.5-5.2 23.6-5.2 36.2 0 13.2 2 25.9 5.7 37.9l-2.4-3.5-83.2 16.3c-5.2 1-10.6-.7-14.3-4.4-3.8-3.8-5.4-9.2-4.4-14.4l16.3-83.3-70.4-47.4c-4.4-3-7.1-8-7.1-13.3 0-5.3 2.6-10.3 7-13.2l70.4-47.4-16.3-83.2-.2-2c-.3-4.6 1.3-9.1 4.6-12.4 3.8-3.8 9.2-5.4 14.4-4.4l83.2 16.3 47.3-70.4 1.2-1.6c3-3.5 7.4-5.5 12.1-5.5zm0 175.8c8.6 0 16.6 2.3 23.6 6.2-9.7 11.9-16.9 25.9-20.7 41.3-15 8.1-28.2 19.2-38.8 32.3-7.5-8.5-12.2-19.6-12.2-31.8 0-26.5 21.5-48 48-48z\"]\n};\nvar faArrowRightLong = {\n  prefix: 'fas',\n  iconName: 'arrow-right-long',\n  icon: [576, 512, [\"long-arrow-right\"], \"f178\", \"M566.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L466.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l434.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z\"]\n};\nvar faLongArrowRight = faArrowRightLong;\nvar faBuildingUn = {\n  prefix: 'fas',\n  iconName: 'building-un',\n  icon: [512, 512, [], \"e4d9\", \"M32 64C32 28.7 60.7 0 96 0L352 0c35.3 0 64 28.7 64 64l0 272-112 0c-20.9 0-39.5 10.1-51.2 25.6-8-6-18-9.6-28.8-9.6-26.5 0-48 21.5-48 48l0 64 64 0 0 48-144 0c-35.3 0-64-28.7-64-64L32 64zM144 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM144 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM427.4 380.5c9-2.1 18.3 2.2 22.5 10.5l26.1 52.2 0-43.3c0-11 9-20 20-20s20 9 20 20l0 128c0 9.3-6.4 17.3-15.4 19.5s-18.3-2.2-22.5-10.5L452 484.7 452 528c0 11-9 20-20 20s-20-9-20-20l0-128c0-9.3 6.4-17.3 15.4-19.5zM324 400l0 96c0 6.6 5.4 12 12 12s12-5.4 12-12l0-96c0-11 9-20 20-20s20 9 20 20l0 96c0 28.7-23.3 52-52 52s-52-23.3-52-52l0-96c0-11 9-20 20-20s20 9 20 20z\"]\n};\nvar faTemperatureLow = {\n  prefix: 'fas',\n  iconName: 'temperature-low',\n  icon: [512, 512, [], \"f76b\", \"M96 96c0-53 43-96 96-96s96 43 96 96l0 164.7c29.5 26.4 48 64.7 48 107.3 0 79.5-64.5 144-144 144S48 447.5 48 368c0-42.6 18.5-81 48-107.3L96 96zm96 336c35.3 0 64-28.7 64-64 0-26.9-16.5-49.9-40-59.3l0-28.7c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 28.7c-23.5 9.5-40 32.5-40 59.3 0 35.3 28.7 64 64 64zM464 80a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM352 80a80 80 0 1 1 160 0 80 80 0 1 1 -160 0z\"]\n};\nvar faDoorOpen = {\n  prefix: 'fas',\n  iconName: 'door-open',\n  icon: [448, 512, [], \"f52b\", \"M288 64l64 0 0 416c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-384c0-35.3-28.7-64-64-64l-96 0 0 0-160 0C60.7 0 32 28.7 32 64l0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-416zM160 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faAlignLeft = {\n  prefix: 'fas',\n  iconName: 'align-left',\n  icon: [448, 512, [], \"f036\", \"M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z\"]\n};\nvar faCamera = {\n  prefix: 'fas',\n  iconName: 'camera',\n  icon: [512, 512, [62258, \"camera-alt\"], \"f030\", \"M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0-10.4-31.2C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z\"]\n};\nvar faCameraAlt = faCamera;\nvar faUsersRays = {\n  prefix: 'fas',\n  iconName: 'users-rays',\n  icon: [640, 512, [], \"e593\", \"M31-33C21.7-23.6 21.7-8.4 31 1L87 57c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65-33c-9.4-9.4-24.6-9.4-33.9 0zM609-33c-9.4-9.4-24.6-9.4-33.9 0L519 23c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L609 1c9.4-9.4 9.4-24.6 0-33.9zM65 545l56-56c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L31 511c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0zm544 0c9.4-9.4 9.4-24.6 0-33.9l-56-56c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l56 56c9.4 9.4 24.6 9.4 33.9 0zM320 208a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm0 32c-61.9 0-112 50.1-112 112l0 8c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24l0-8c0-61.9-50.1-112-112-112zm216-80a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zM451.2 260.4C469.4 286.3 480 317.9 480 352l0 8c0 8.4-1.4 16.5-4.1 24l78.8 0c11.8 0 21.3-9.6 21.3-21.3l0-10.7c0-53-43-96-96-96-10 0-19.7 1.5-28.8 4.4zm-262.4 0c-9.1-2.9-18.8-4.4-28.8-4.4-53 0-96 43-96 96l0 10.7c0 11.8 9.6 21.3 21.3 21.3l78.8 0c-2.7-7.5-4.1-15.6-4.1-24l0-8c0-34.1 10.6-65.7 28.8-91.6zM216 160a56 56 0 1 0 -112 0 56 56 0 1 0 112 0z\"]\n};\nvar faRainbow = {\n  prefix: 'fas',\n  iconName: 'rainbow',\n  icon: [640, 512, [127752], \"f75b\", \"M320 96C178.6 96 64 210.6 64 352l0 64c0 17.7-14.3 32-32 32S0 433.7 0 416l0-64C0 175.3 143.3 32 320 32S640 175.3 640 352l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64C576 210.6 461.4 96 320 96zm0 112c-79.5 0-144 64.5-144 144l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-114.9 93.1-208 208-208s208 93.1 208 208l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-79.5-64.5-144-144-144zM288 352l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-53 43-96 96-96s96 43 96 96l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32z\"]\n};\nvar faSitemap = {\n  prefix: 'fas',\n  iconName: 'sitemap',\n  icon: [512, 512, [], \"f0e8\", \"M192 64c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-8 0 0 64 120 0c39.8 0 72 32.2 72 72l0 56 8 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l8 0 0-56c0-13.3-10.7-24-24-24l-120 0 0 80 8 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l8 0 0-80-120 0c-13.3 0-24 10.7-24 24l0 56 8 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l8 0 0-56c0-39.8 32.2-72 72-72l120 0 0-64-8 0c-17.7 0-32-14.3-32-32l0-64z\"]\n};\nvar faFaceGrinStars = {\n  prefix: 'fas',\n  iconName: 'face-grin-stars',\n  icon: [512, 512, [129321, \"grin-stars\"], \"f587\", \"M256 512c141.4 0 256-114.6 256-256 0-24.4-3.4-48.1-9.8-70.5 18.6-36.1-2.7-83.6-46.7-90-46.9-58.3-118.9-95.5-199.5-95.5S103.4 37.3 56.5 95.5c-44 6.4-65.3 53.9-46.7 90-6.4 22.4-9.8 46-9.8 70.5 0 141.4 114.6 256 256 256zM386.7 324.9c11.9-3.7 23.9 6.3 19.6 18.1-22.4 61.3-81.3 105.1-150.3 105.1S128.1 404.2 105.7 342.9c-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1zm-31.6-231c5.3-10.7 20.5-10.7 25.8 0l20.9 42.4 46.7 6.8c11.8 1.7 16.5 16.2 8 24.5l-33.8 33 8 46.6c2 11.7-10.3 20.7-20.9 15.2l-41.8-22-41.8 22c-10.5 5.5-22.9-3.4-20.9-15.2l8-46.6-33.8-33c-8.5-8.3-3.8-22.8 8-24.5l46.7-6.8 20.9-42.4zm-198.2 0l20.9 42.4 46.7 6.8c11.8 1.7 16.5 16.2 8 24.5l-33.8 33 8 46.6c2 11.7-10.3 20.7-20.9 15.2l-41.8-22-41.8 22c-10.5 5.5-22.9-3.4-20.9-15.2l8-46.6-33.8-33c-8.5-8.3-3.8-22.8 8-24.5l46.7-6.8 20.9-42.4c5.3-10.7 20.5-10.7 25.8 0z\"]\n};\nvar faGrinStars = faFaceGrinStars;\nvar faSortUp = {\n  prefix: 'fas',\n  iconName: 'sort-up',\n  icon: [384, 512, [\"sort-asc\"], \"f0de\", \"M32 224c-12.9 0-24.6-7.8-29.6-19.8S.2 178.5 9.4 169.4l160-160c12.5-12.5 32.8-12.5 45.3 0l160 160c9.2 9.2 11.9 22.9 6.9 34.9S364.9 224 352 224L32 224z\"]\n};\nvar faSortAsc = faSortUp;\nvar faEye = {\n  prefix: 'fas',\n  iconName: 'eye',\n  icon: [576, 512, [128065], \"f06e\", \"M288 32c-80.8 0-145.5 36.8-192.6 80.6-46.8 43.5-78.1 95.4-93 131.1-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64-11.5 0-22.3-3-31.7-8.4-1 10.9-.1 22.1 2.9 33.2 13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-12.2-45.7-55.5-74.8-101.1-70.8 5.3 9.3 8.4 20.1 8.4 31.7z\"]\n};\nvar faCaretLeft = {\n  prefix: 'fas',\n  iconName: 'caret-left',\n  icon: [256, 512, [], \"f0d9\", \"M7.7 235.8c-10.3 12.6-9.5 31.1 2.2 42.8l128 128c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-256c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-128 128-2.2 2.4z\"]\n};\nvar faAppleWhole = {\n  prefix: 'fas',\n  iconName: 'apple-whole',\n  icon: [448, 512, [127822, 127823, \"apple-alt\"], \"f5d1\", \"M224 112c-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80l16 0c8.8 0 16 7.2 16 16l0 16c0 44.2-35.8 80-80 80l-16 0zM0 288c0-76.3 35.7-160 112-160 27.3 0 59.7 10.3 82.7 19.3 18.8 7.3 39.9 7.3 58.7 0 22.9-8.9 55.4-19.3 82.7-19.3 76.3 0 112 83.7 112 160 0 128-80 224-160 224-16.5 0-38.1-6.6-51.5-11.3-8.1-2.8-16.9-2.8-25 0-13.4 4.7-35 11.3-51.5 11.3-80 0-160-96-160-224z\"]\n};\nvar faAppleAlt = faAppleWhole;\nvar faScrollTorah = {\n  prefix: 'fas',\n  iconName: 'scroll-torah',\n  icon: [576, 512, [\"torah\"], \"f6a0\", \"M0 48C0 21.5 21.5 0 48 0 68.9 0 86.7 13.4 93.3 32l389.5 0c6.6-18.6 24.4-32 45.3-32 26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48-20.9 0-38.7-13.4-45.3-32L93.3 480c-6.6 18.6-24.4 32-45.3 32-26.5 0-48-21.5-48-48L0 48zM177.9 301c-1.2 2-1.9 4.2-1.9 6.6 0 6.9 5.6 12.5 12.5 12.5l56.9 0 30.5 49.2c2.6 4.2 7.2 6.8 12.2 6.8s9.6-2.6 12.2-6.8l30.5-49.2 56.9 0c6.9 0 12.5-5.6 12.5-12.5 0-2.3-.6-4.6-1.9-6.6l-27.8-45 27.8-45c1.2-2 1.9-4.2 1.9-6.6 0-6.9-5.6-12.5-12.5-12.5l-56.9 0-30.5-49.2c-2.6-4.2-7.2-6.8-12.2-6.8s-9.6 2.6-12.2 6.8l-30.5 49.2-56.9 0c-6.9 0-12.5 5.6-12.5 12.5 0 2.3 .6 4.6 1.9 6.6l27.8 45-27.8 45z\"]\n};\nvar faTorah = faScrollTorah;\nvar faHouseLock = {\n  prefix: 'fas',\n  iconName: 'house-lock',\n  icon: [640, 512, [], \"e510\", \"M528 224.1c44.2 0 80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80zM268.6 6.5c12.2-9.3 29.7-8.7 41.2 2l185 171.8C440.2 195 400 244.8 400 304l0 24.4c-19.6 17.6-32 43.1-32 71.5l0 96c0 5.5 .5 10.9 1.3 16.1L144 512c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208 2.4-2zM272 320c-26.5 0-48 21.5-48 48l0 96 96 0 0-87.3c0-16.5 7-31.5 18.4-42.1-8.7-9-20.9-14.6-34.4-14.6l-32 0zm256-47.9c-17.7 0-32 14.3-32 32l0 47.9 64 0 0-47.9c0-17.7-14.3-32-32-32z\"]\n};\nvar faArrowsLeftRightToLine = {\n  prefix: 'fas',\n  iconName: 'arrows-left-right-to-line',\n  icon: [576, 512, [], \"e4ba\", \"M32 96C14.3 96 0 110.3 0 128L0 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-256c0-17.7-14.3-32-32-32zM390.6 342.6l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4-133.5 0 9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4 133.5 0-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0zM576 128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-256z\"]\n};\nvar faTrash = {\n  prefix: 'fas',\n  iconName: 'trash',\n  icon: [448, 512, [], \"f1f8\", \"M136.7 5.9L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-8.7-26.1C306.9-7.2 294.7-16 280.9-16L167.1-16c-13.8 0-26 8.8-30.4 21.9zM416 144L32 144 53.1 467.1C54.7 492.4 75.7 512 101 512L347 512c25.3 0 46.3-19.6 47.9-44.9L416 144z\"]\n};\nvar faFaceSadTear = {\n  prefix: 'fas',\n  iconName: 'face-sad-tear',\n  icon: [512, 512, [128546, \"sad-tear\"], \"f5b4\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm271 98c5.5-1.3 11.1-2 17-2 24.1 0 45.4 11.8 58.5 30 7.7 10.8 22.7 13.2 33.5 5.5s13.2-22.7 5.5-33.5c-21.7-30.2-57.3-50-97.5-50-12.5 0-24.6 1.9-35.9 5.5 9.8 12.7 16.5 27.9 18.9 44.6zM176 240a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm192-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM185.4 292.8c-2.4-2.9-5.7-4.8-9.4-4.8s-7 1.9-9.4 4.8c-6.5 7.8-12.6 16.1-18.3 24.6-9 13.4-20.3 30.2-20.3 47.4 0 28.3 21.5 51.2 48 51.2s48-22.9 48-51.2c0-17.2-11.2-34-20.3-47.4-5.7-8.5-11.9-16.7-18.3-24.6z\"]\n};\nvar faSadTear = faFaceSadTear;\nvar faFax = {\n  prefix: 'fas',\n  iconName: 'fax',\n  icon: [512, 512, [128224, 128439], \"f1ac\", \"M160 64l0 80 64 0 0-80 146.7 0 45.3 45.3 0 34.7 64 0 0-34.7c0-17-6.7-33.3-18.7-45.3L416 18.7C404 6.7 387.7 0 370.7 0L224 0c-35.3 0-64 28.7-64 64zM32 128c-17.7 0-32 14.3-32 32L0 448c0 17.7 14.3 32 32 32l48 0c17.7 0 32-14.3 32-32l0-288c0-17.7-14.3-32-32-32l-48 0zm448 64l-320 0 0 256c0 17.7 14.3 32 32 32l288 0c17.7 0 32-14.3 32-32l0-224c0-17.7-14.3-32-32-32zM224 288a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm0 96a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM336 264a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM312 384a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM424 264a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM400 384a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faPersonCirclePlus = {\n  prefix: 'fas',\n  iconName: 'person-circle-plus',\n  icon: [640, 512, [], \"e541\", \"M280 24a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zm24 212.7L341 286.6c12.8-17.5 28.5-32.7 46.3-45l-56.2-75.7C306 132 266.3 112 224 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6L144 236.7 144 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-275.3zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm16-208l0 48 48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16z\"]\n};\nvar faHamsa = {\n  prefix: 'fas',\n  iconName: 'hamsa',\n  icon: [512, 512, [], \"f665\", \"M34.6 288L80 288c8.8 0 16-7.2 16-16L96 72c0-22.1 17.9-40 40-40s40 17.9 40 40l0 132c0 11 9 20 20 20s20-9 20-20l0-164c0-22.1 17.9-40 40-40s40 17.9 40 40l0 164c0 11 9 20 20 20s20-9 20-20l0-132c0-22.1 17.9-40 40-40s40 17.9 40 40l0 200c0 8.8 7.2 16 16 16l45.4 0c19.1 0 34.6 15.5 34.6 34.6 0 8.6-3.2 16.9-9 23.3L416.6 441c-41.1 45.2-99.4 71-160.6 71S136.6 486.2 95.4 441L9 345.9c-5.8-6.4-9-14.7-9-23.3 0-19.1 15.5-34.6 34.6-34.6zM256 288c-38.4 0-76.8 35.8-90.6 50.2-3.6 3.7-5.4 8.7-5.4 13.8s1.8 10.1 5.4 13.8C179.2 380.2 217.6 416 256 416s76.8-35.8 90.6-50.2c3.6-3.7 5.4-8.7 5.4-13.8s-1.8-10.1-5.4-13.8C332.8 323.8 294.4 288 256 288zm0 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faPersonCircleQuestion = {\n  prefix: 'fas',\n  iconName: 'person-circle-question',\n  icon: [640, 512, [], \"e542\", \"M280 24a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zm24 212.7L341 286.6c12.8-17.5 28.5-32.7 46.3-45l-56.2-75.7C306 132 266.3 112 224 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6L144 236.7 144 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-275.3zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-100c-11.6 0-21.3 8.2-23.5 19.2-1.8 8.7-10.2 14.3-18.9 12.5s-14.3-10.2-12.5-18.9c5.2-25.6 27.8-44.8 54.9-44.8 30.9 0 56 25.1 56 56 0 19.8-11.7 37.8-29.8 45.9l-10.4 4.6c-1.2 7.7-7.8 13.5-15.8 13.5-8.8 0-16-7.2-16-16 0-11.2 6.6-21.3 16.8-25.9l12.4-5.5c6.6-2.9 10.8-9.4 10.8-16.6 0-13.3-10.7-24-24-24z\"]\n};\nvar faClipboardCheck = {\n  prefix: 'fas',\n  iconName: 'clipboard-check',\n  icon: [384, 512, [], \"f46c\", \"M256 0c23.7 0 44.4 12.9 55.4 32l8.6 0c35.3 0 64 28.7 64 64l0 352c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l8.6 0C83.6 12.9 104.3 0 128 0L256 0zm26.9 212.6c-10.7-7.8-25.7-5.4-33.5 5.3l-85.6 117.7-26.5-27.4c-9.2-9.5-24.4-9.8-33.9-.6s-9.8 24.4-.6 33.9l46.4 48c4.9 5.1 11.8 7.8 18.9 7.3s13.6-4.1 17.8-9.8L288.2 246.1c7.8-10.7 5.4-25.7-5.3-33.5zM136 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L136 64z\"]\n};\nvar faShareFromSquare = {\n  prefix: 'fas',\n  iconName: 'share-from-square',\n  icon: [576, 512, [61509, \"share-square\"], \"f14d\", \"M384.5 24l0 72-64 0c-79.5 0-144 64.5-144 144 0 93.4 82.8 134.8 100.6 142.6 2.2 1 4.6 1.4 7.1 1.4l2.5 0c9.8 0 17.8-8 17.8-17.8 0-8.3-5.9-15.5-12.8-20.3-8.9-6.2-19.2-18.2-19.2-40.5 0-45 36.5-81.5 81.5-81.5l30.5 0 0 72c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l136-136c9.4-9.4 9.4-24.6 0-33.9L425.5 7c-6.9-6.9-17.2-8.9-26.2-5.2S384.5 14.3 384.5 24zm-272 72c-44.2 0-80 35.8-80 80l0 256c0 44.2 35.8 80 80 80l256 0c44.2 0 80-35.8 80-80l0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32c0 8.8-7.2 16-16 16l-256 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0z\"]\n};\nvar faShareSquare = faShareFromSquare;\nvar faReceipt = {\n  prefix: 'fas',\n  iconName: 'receipt',\n  icon: [384, 512, [129534], \"f543\", \"M14 2.2C22.5-1.7 32.5-.3 39.6 5.8L80 40.4 120.4 5.8c9-7.7 22.3-7.7 31.2 0L192 40.4 232.4 5.8c9-7.7 22.2-7.7 31.2 0L304 40.4 344.4 5.8c7.1-6.1 17.1-7.5 25.6-3.6S384 14.6 384 24l0 464c0 9.4-5.5 17.9-14 21.8s-18.5 2.5-25.6-3.6l-40.4-34.6-40.4 34.6c-9 7.7-22.2 7.7-31.2 0l-40.4-34.6-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L80 471.6 39.6 506.2c-7.1 6.1-17.1 7.5-25.6 3.6S0 497.4 0 488L0 24C0 14.6 5.5 6.1 14 2.2zM104 136c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0zM80 352c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0c-13.3 0-24 10.7-24 24zm24-120c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0z\"]\n};\nvar faEquals = {\n  prefix: 'fas',\n  iconName: 'equals',\n  icon: [448, 512, [62764], \"3d\", \"M32 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 128zm0 192c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 320z\"]\n};\nvar faChevronUp = {\n  prefix: 'fas',\n  iconName: 'chevron-up',\n  icon: [448, 512, [], \"f077\", \"M201.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 173.3 54.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z\"]\n};\nvar faVirusSlash = {\n  prefix: 'fas',\n  iconName: 'virus-slash',\n  icon: [576, 512, [], \"e075\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-88.6-88.6c1.7-12.1-2-24.8-11.3-34-31.2-31.2-9.1-84.5 35-84.5 22.1 0 40-17.9 40-40s-17.9-40-40-40c-44.1 0-66.1-53.3-35-84.5 15.6-15.6 15.6-40.9 0-56.6s-40.9-15.6-56.6 0c-31.2 31.2-84.5 9.1-84.5-35 0-22.1-17.9-40-40-40s-40 17.9-40 40c0 44.1-53.3 66.1-84.5 35-9.3-9.3-22-13-34-11.3L41-24.9zM72 216c-22.1 0-40 17.9-40 40s17.9 40 40 40c44.1 0 66.1 53.3 35 84.5-15.6 15.6-15.6 40.9 0 56.6s40.9 15.6 56.6 0c31.2-31.2 84.5-9.1 84.5 35 0 22.1 17.9 40 40 40s40-17.9 40-40c0-21.4 12.6-37.6 29.1-45.1l-240-240C109.6 203.4 93.4 216 72 216z\"]\n};\nvar faSlash = {\n  prefix: 'fas',\n  iconName: 'slash',\n  icon: [576, 512, [], \"f715\", \"M7-25c9.4-9.4 24.6-9.4 33.9 0L569 503c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 9C-2.3-.4-2.3-15.6 7-25z\"]\n};\nvar faExpand = {\n  prefix: 'fas',\n  iconName: 'expand',\n  icon: [448, 512, [], \"f065\", \"M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z\"]\n};\nvar faNoteSticky = {\n  prefix: 'fas',\n  iconName: 'note-sticky',\n  icon: [448, 512, [62026, \"sticky-note\"], \"f249\", \"M64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 213.5c0 17-6.7 33.3-18.7 45.3L322.7 461.3c-12 12-28.3 18.7-45.3 18.7L64 480zM389.5 304L296 304c-13.3 0-24 10.7-24 24l0 93.5 117.5-117.5z\"]\n};\nvar faStickyNote = faNoteSticky;\nvar faTableColumns = {\n  prefix: 'fas',\n  iconName: 'table-columns',\n  icon: [448, 512, [\"columns\"], \"f0db\", \"M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 128 0 0-256-128 0zm320 0l-128 0 0 256 128 0 0-256z\"]\n};\nvar faColumns = faTableColumns;\nvar faPersonShelter = {\n  prefix: 'fas',\n  iconName: 'person-shelter',\n  icon: [512, 512, [], \"e54f\", \"M271.9 4.2c-9.8-5.6-21.9-5.6-31.8 0l-224 128C6.2 137.9 0 148.5 0 160L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32L64 178.6 256 68.9 448 178.6 448 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-11.5-6.2-22.1-16.1-27.8l-224-128zM256 208a40 40 0 1 0 0-80 40 40 0 1 0 0 80zm-8 192l16 0 0 88c0 13.3 10.7 24 24 24s24-10.7 24-24l0-174.5 26.9 49.9c6.3 11.7 20.8 16 32.5 9.8s16-20.8 9.8-32.5l-33.2-61.7C329.7 245.1 294.4 224 256 224s-73.7 21.1-91.9 54.9l-33.2 61.7c-6.3 11.7-1.9 26.2 9.8 32.5s26.2 1.9 32.5-9.8L200 313.5 200 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-88z\"]\n};\nvar faCircleNotch = {\n  prefix: 'fas',\n  iconName: 'circle-notch',\n  icon: [512, 512, [], \"f1ce\", \"M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8-79.3 23.6-137.1 97.1-137.1 184.1 0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256 512 397.4 397.4 512 256 512S0 397.4 0 256c0-116 77.1-213.9 182.9-245.4 16.9-5 34.8 4.6 39.8 21.5z\"]\n};\nvar faWater = {\n  prefix: 'fas',\n  iconName: 'water',\n  icon: [512, 512, [], \"f773\", \"M410.6 124.1c20.7 15.6 46 30.7 74.2 34.5 13.1 1.8 25.2-7.5 27-20.6s-7.5-25.2-20.6-27c-15.9-2.1-33.2-11.3-51.7-25.2-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-18.5 13.9-35.8 23.1-51.7 25.2-13.1 1.8-22.4 13.8-20.6 27s13.8 22.4 27 20.6c28.2-3.8 53.6-18.9 74.2-34.5 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9c21.3-16.1 49.9-16.1 71.2 0zm0 144c20.7 15.6 46 30.7 74.2 34.5 13.1 1.8 25.2-7.5 27-20.6s-7.5-25.2-20.6-27c-15.9-2.1-33.2-11.3-51.7-25.2-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-18.5 13.9-35.8 23.1-51.7 25.2-13.1 1.7-22.4 13.8-20.6 27s13.8 22.4 27 20.6c28.2-3.8 53.6-18.9 74.2-34.5 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9c21.3-16.1 49.9-16.1 71.2 0zm-71.2 144c21.3-16.1 49.9-16.1 71.2 0 20.7 15.6 46 30.7 74.2 34.5 13.1 1.8 25.2-7.5 27-20.6s-7.5-25.2-20.6-27c-15.9-2.1-33.2-11.3-51.7-25.2-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-18.5 13.9-35.8 23.1-51.7 25.2-13.1 1.8-22.4 13.8-20.6 27s13.8 22.4 27 20.6c28.2-3.8 53.6-18.9 74.2-34.5 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9z\"]\n};\nvar faDeleteLeft = {\n  prefix: 'fas',\n  iconName: 'delete-left',\n  icon: [640, 512, [9003, \"backspace\"], \"f55a\", \"M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM284.1 188.1c9.4-9.4 24.6-9.4 33.9 0l33.9 33.9 33.9-33.9c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-33.9 33.9 33.9 33.9c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-33.9-33.9-33.9 33.9c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l33.9-33.9-33.9-33.9c-9.4-9.4-9.4-24.6 0-33.9z\"]\n};\nvar faBackspace = faDeleteLeft;\nvar faBroomBall = {\n  prefix: 'fas',\n  iconName: 'broom-ball',\n  icon: [576, 512, [\"quidditch\", \"quidditch-broom-ball\"], \"f458\", \"M496 544a80 80 0 1 1 0-160 80 80 0 1 1 0 160zM106.8 277.2c30.6-30.6 73.1-45.9 115.8-42.2L341 353.3c3.7 42.8-11.6 85.2-42.2 115.9-27.4 27.4-64.6 42.8-103.3 42.8L22.1 512c-12.2 0-22.1-9.9-22.1-22.1 0-6.3 2.7-12.3 7.3-16.5L133.7 359.7c4.2-3.7-.4-10.4-5.4-7.9L77.2 377.4c-6.1 3-13.2-1.4-13.2-8.2 0-31.5 12.5-61.8 34.8-84l8-8zm417-270c12.6-10.3 31.1-9.5 42.8 2.2s12.4 30.2 2.2 42.8l-2.2 2.4-192 192 34.8 34.7c4.2 4.2 6.6 10 6.6 16 0 12.5-10.1 22.6-22.6 22.6l-29.1 0-108.3-108.3 0-29.1c0-12.5 10.1-22.6 22.6-22.6 6 0 11.8 2.4 16 6.6l34.8 34.7 192-192 2.4-2.2z\"]\n};\nvar faQuidditch = faBroomBall;\nvar faQuidditchBroomBall = faBroomBall;\nvar faJ = {\n  prefix: 'fas',\n  iconName: 'j',\n  icon: [320, 512, [106], \"4a\", \"M288 32c17.7 0 32 14.3 32 32l0 256c0 88.4-71.6 160-160 160S0 408.4 0 320l0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32c0 53 43 96 96 96s96-43 96-96l0-256c0-17.7 14.3-32 32-32z\"]\n};\nvar faShuttleSpace = {\n  prefix: 'fas',\n  iconName: 'shuttle-space',\n  icon: [576, 512, [\"space-shuttle\"], \"f197\", \"M0 368l0 64c0 26.5 21.5 48 48 48l50 0c40.6 0 80.4-11 115.2-31.9l133.5-80.1-93.3 0-64.9 38.9c-14 8.4-28.9 14.7-44.5 19l0-66.4c9.7-5.6 17.8-13.7 23.4-23.4l198.8 0c67.1 0 127.8-20.6 170.3-70.6 4.6-5.4 4.6-13.3 0-18.8-42.5-50.1-103.2-70.6-170.3-70.6l-198.8 0c-5.6-9.7-13.7-17.8-23.4-23.4l0-66.4c15.6 4.2 30.6 10.6 44.5 19l64.9 38.9 93.3 0-133.5-80.1C178.4 43 138.6 32 98 32L48 32C21.5 32 0 53.5 0 80L0 368zm96 0l0 64-48 0 0-64 48 0zM96 80l0 64-48 0 0-64 48 0zM416 224c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z\"]\n};\nvar faSpaceShuttle = faShuttleSpace;\nvar faYinYang = {\n  prefix: 'fas',\n  iconName: 'yin-yang',\n  icon: [512, 512, [9775], \"f6ad\", \"M224 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 352a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-448c53 0 96 43 96 96s-43 96-96 96-96 43-96 96 43 96 96 96C150 448 64 362 64 256S150 64 256 64zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faStop = {\n  prefix: 'fas',\n  iconName: 'stop',\n  icon: [448, 512, [9209], \"f04d\", \"M64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32z\"]\n};\nvar faTrowel = {\n  prefix: 'fas',\n  iconName: 'trowel',\n  icon: [576, 512, [], \"e589\", \"M407.9 181.4L277.3 312 342.6 377.4c7.9 7.9 11.1 19.4 8.4 30.3s-10.8 19.6-21.5 22.9l-256 80c-11.4 3.5-23.8 .5-32.2-7.9s-11.5-20.8-7.9-32.2l80-256c3.3-10.7 12-18.9 22.9-21.5s22.4 .5 30.3 8.4L232 266.7 362.6 136.1c-14.3-14.6-14.2-38 .3-52.5l95.4-95.4c26.9-26.9 70.5-26.9 97.5 0s26.9 70.5 0 97.5l-95.4 95.4c-14.5 14.5-37.9 14.6-52.5 .3z\"]\n};\nvar faHandBackFist = {\n  prefix: 'fas',\n  iconName: 'hand-back-fist',\n  icon: [384, 512, [\"hand-rock\"], \"f255\", \"M7.4 253.6C2.6 245.9 0 237.1 0 228l0-36c0-26.5 21.5-48 48-48l16 0 0-80c0-26.5 21.5-48 48-48 17.3 0 32.4 9.1 40.9 22.8 4.3-22.1 23.8-38.8 47.1-38.8 23.4 0 42.9 16.8 47.1 38.9 7.3-4.4 15.8-6.9 24.9-6.9 22.1 0 40.8 15 46.3 35.4 5.5-2.2 11.4-3.4 17.7-3.4 26.5 0 48 21.5 48 48l0 96.9c0 9.9-2.3 19.7-6.8 28.6l-39.6 79.1c-10.8 21.7-33 35.4-57.2 35.4L96 352c-16.5 0-31.8-8.4-40.6-22.4l-48-76zM32 480l0-48c0-17.7 14.3-32 32-32l256 0c17.7 0 32 14.3 32 32l0 48c0 17.7-14.3 32-32 32L64 512c-17.7 0-32-14.3-32-32z\"]\n};\nvar faHandRock = faHandBackFist;\nvar faTemperatureHigh = {\n  prefix: 'fas',\n  iconName: 'temperature-high',\n  icon: [512, 512, [], \"f769\", \"M96 96c0-53 43-96 96-96s96 43 96 96l0 164.7c29.5 26.4 48 64.7 48 107.3 0 79.5-64.5 144-144 144S48 447.5 48 368c0-42.6 18.5-81 48-107.3L96 96zm96 336c35.3 0 64-28.7 64-64 0-26.9-16.5-49.9-40-59.3L216 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 212.7c-23.5 9.5-40 32.5-40 59.3 0 35.3 28.7 64 64 64zM464 80a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM352 80a80 80 0 1 1 160 0 80 80 0 1 1 -160 0z\"]\n};\nvar faGreaterThan = {\n  prefix: 'fas',\n  iconName: 'greater-than',\n  icon: [512, 512, [62769], \"3e\", \"M34.9 50.6c-7.4 16-.4 35.1 15.6 42.5L403.6 256 50.6 419c-16 7.4-23.1 26.4-15.6 42.5s26.4 23 42.5 15.6l416-192c11.3-5.2 18.6-16.6 18.6-29.1s-7.3-23.8-18.6-29.1L77.4 35c-16-7.4-35.1-.4-42.5 15.6z\"]\n};\nvar faCrutch = {\n  prefix: 'fas',\n  iconName: 'crutch',\n  icon: [512, 512, [], \"f7f7\", \"M297.4 9.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-1.4-1.4-158.6 158.6c-18 18-42.4 28.1-67.9 28.1l-59 0c-8.5 0-16.6 3.4-22.6 9.4-61.7 61.7-92.8 92.8-93.3 93.3-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l16-16 0 0 77.3-77.3c6-6 9.4-14.1 9.4-22.6l0-59c0-25.5 10.1-49.9 28.1-67.9L298.7 56 297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3zM344 101.3L261.3 184 328 250.7 410.7 168 344 101.3zm-128 128l-30.6 30.6c-6 6-9.4 14.1-9.4 22.6l0 53.5 53.5 0c8.5 0 16.6-3.4 22.6-9.4L282.7 296 216 229.3z\"]\n};\nvar faSeptagon = {\n  prefix: 'fas',\n  iconName: 'septagon',\n  icon: [576, 512, [\"heptagon\"], \"e820\", \"M267.4-31.5c15.9-5.5 33.5-4.6 48.8 2.7l172.4 83 6.3 3.5c14.2 9 24.5 23.3 28.3 39.9l42.6 186.5 1.2 7.2c1.6 14.3-1.7 28.8-9.4 41.1l-4.2 5.9-119.3 149.6c-12.1 15.2-30.6 24.1-50 24.1l-191.3 0c-19.5 0-37.9-8.9-50-24.1L23.5 338.4c-12.1-15.2-16.7-35.2-12.3-54.2l42.6-186.5 2-7c5.6-15.9 17.2-29 32.6-36.4l172.4-83 6.7-2.7z\"]\n};\nvar faHeptagon = faSeptagon;\nvar faStreetView = {\n  prefix: 'fas',\n  iconName: 'street-view',\n  icon: [512, 512, [], \"f21d\", \"M256 0a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM224 160l64 0c35.3 0 64 28.7 64 64l0 48c0 17.7-14.3 32-32 32l-1.8 0-11.1 99.5c-1.8 16.2-15.5 28.5-31.8 28.5l-38.7 0c-16.3 0-30-12.3-31.8-28.5l-11.1-99.5-1.8 0c-17.7 0-32-14.3-32-32l0-48c0-35.3 28.7-64 64-64zM412.4 400.2c-16.1-4.2-34.8-7.6-55.4-10.2l5.3-47.7c22.7 2.9 43.7 6.7 62.1 11.5 22.4 5.8 42.6 13.3 57.8 23.3 14.7 9.6 29.8 24.9 29.8 47s-15.1 37.4-29.8 47c-15.2 9.9-35.5 17.5-57.8 23.3-45.1 11.7-105.3 17.8-168.4 17.8s-123.3-6.1-168.4-17.8C65.2 488.4 45 480.9 29.8 471 15.1 461.4 0 446.1 0 424s15.1-37.4 29.8-47c15.2-9.9 35.5-17.5 57.8-23.3 18.5-4.8 39.5-8.6 62.1-11.5L155 390c-20.6 2.6-39.3 6.1-55.4 10.2-56.6 14.6-56.6 32.9 0 47.5 39.9 10.3 95.8 16.2 156.4 16.2s116.5-5.9 156.4-16.2c56.6-14.6 56.6-32.9 0-47.5z\"]\n};\nvar faWaveSquare = {\n  prefix: 'fas',\n  iconName: 'wave-square',\n  icon: [512, 512, [], \"f83e\", \"M64 96c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 288 96 0 0-128c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-288-96 0 0 128c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-128z\"]\n};\nvar faAngleLeft = {\n  prefix: 'fas',\n  iconName: 'angle-left',\n  icon: [256, 512, [8249], \"f104\", \"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z\"]\n};\nvar faScrewdriver = {\n  prefix: 'fas',\n  iconName: 'screwdriver',\n  icon: [576, 512, [129691], \"f54a\", \"M352.1 146.7l0-49.6c0-10.7 5.3-20.7 14.2-26.6L485.2-8.7c6.3-4.2 14.8-3.4 20.2 2l45.4 45.5c5.4 5.4 6.2 13.8 2 20.2L473.6 177.8c-5.9 8.9-15.9 14.2-26.6 14.2l-49.6 0-90.7 90.7c15 33.3 8.9 73.9-18.5 101.3L162.1 510.1c-18.7 18.7-49.1 18.7-67.9 0L34.1 449.9c-18.7-18.7-18.7-49.1 0-67.9L160.1 256c27.4-27.4 67.9-33.6 101.3-18.5l90.7-90.7z\"]\n};\nvar faTractor = {\n  prefix: 'fas',\n  iconName: 'tractor',\n  icon: [576, 512, [128668], \"f722\", \"M160 96l0 96 133.4 0-57.6-96-75.8 0zM96 223L96 64c0-17.7 14.3-32 32-32l107.8 0c22.5 0 43.3 11.8 54.9 31.1l77.4 128.9 64 0 0-72c0-13.3 10.7-24 24-24s24 10.7 24 24l0 72 48 0c26.5 0 48 21.5 48 48l0 41.5c0 14.2-6.3 27.8-17.3 36.9l-35 29.2c26.5 15.2 44.3 43.7 44.3 76.4 0 48.6-39.4 88-88 88s-88-39.4-88-88c0-14.4 3.5-28 9.6-40l-101.2 0c-3 13.4-7.9 26-14.4 37.7 7.7 9.4 7.2 23.4-1.6 32.2l-22.6 22.6c-8.8 8.8-22.7 9.3-32.2 1.6-9.3 5.2-19.3 9.3-29.8 12.3-1.2 12.1-11.4 21.6-23.9 21.6l-32 0c-12.4 0-22.7-9.5-23.9-21.6-10.5-3-20.4-7.2-29.8-12.3-9.4 7.7-23.4 7.2-32.2-1.6L35.5 453.8c-8.8-8.8-9.3-22.7-1.6-32.2-5.2-9.3-9.3-19.3-12.3-29.8-12.1-1.2-21.6-11.4-21.6-23.9l0-32c0-12.4 9.5-22.7 21.6-23.9 3-10.5 7.2-20.4 12.3-29.8-7.7-9.4-7.2-23.4 1.6-32.2l22.6-22.6c8.8-8.8 22.7-9.3 32.2-1.6 1.9-1 3.7-2 5.7-3zm64 65a64 64 0 1 0 0 128 64 64 0 1 0 0-128zM440 424a40 40 0 1 0 80 0 40 40 0 1 0 -80 0z\"]\n};\nvar faBridgeCircleXmark = {\n  prefix: 'fas',\n  iconName: 'bridge-circle-xmark',\n  icon: [576, 512, [], \"e4cb\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l8 0 0 64-40 0 0 112c37.6 9.4 64 43.2 64 82l0 94c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96 6.4 0 12.7 .6 18.7 1.8 34.7-49.5 92.2-81.8 157.3-81.8 28.6 0 55.6 6.2 80 17.4l0-65.4-40 0 0-64 8 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM424 96l0 64-80 0 0-64 80 0zM296 96l0 64-80 0 0-64 80 0zM88 96l80 0 0 64-80 0 0-64zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7l-36.7 36.7 36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z\"]\n};\nvar faVials = {\n  prefix: 'fas',\n  iconName: 'vials',\n  icon: [512, 512, [], \"f493\", \"M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 352c0 53 43 96 96 96s96-43 96-96l0-352 64 0 0 352c0 53 43 96 96 96s96-43 96-96l0-352c17.7 0 32-14.3 32-32S497.7 0 480 0L32 0zM160 64l0 128-64 0 0-128 64 0zm256 0l0 128-64 0 0-128 64 0z\"]\n};\nvar faStethoscope = {\n  prefix: 'fas',\n  iconName: 'stethoscope',\n  icon: [576, 512, [129658], \"f0f1\", \"M32 48C32 21.5 53.5 0 80 0l48 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-32 0c-17.7 0-32-14.3-32-32S238.3 0 256 0l48 0c26.5 0 48 21.5 48 48l0 144c0 77.4-55 142-128 156.8l0 19.2c0 61.9 50.1 112 112 112s112-50.1 112-112l0-85.5c-37.3-13.2-64-48.7-64-90.5 0-53 43-96 96-96s96 43 96 96c0 41.8-26.7 77.4-64 90.5l0 85.5c0 97.2-78.8 176-176 176S160 465.2 160 368l0-19.2C87 334 32 269.4 32 192L32 48zM480 224a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faPodcast = {\n  prefix: 'fas',\n  iconName: 'podcast',\n  icon: [448, 512, [], \"f2ce\", \"M336 359.8c39.1-32.3 64-81.1 64-135.8 0-97.2-78.8-176-176-176S48 126.8 48 224C48 278.7 72.9 327.5 112 359.8 112.4 377.4 115.2 400.2 118.4 421.6 48 383.9 0 309.5 0 224 0 100.3 100.3 0 224 0S448 100.3 448 224c0 85.6-48 159.9-118.5 197.6 3.3-21.4 6-44.2 6.4-61.8zm-14-53.4c-8.3-12.6-19.2-21.6-30.4-27.8-2.1-1.1-4.2-2.2-6.3-3.2 11.7-13.9 18.8-31.9 18.8-51.5 0-44.2-35.8-80-80-80s-80 35.8-80 80c0 19.6 7.1 37.6 18.8 51.5-2.1 1-4.2 2-6.3 3.2-11.2 6.2-22.1 15.2-30.4 27.8-18.8-22.3-30.1-51-30.1-82.4 0-70.7 57.3-128 128-128s128 57.3 128 128c0 31.4-11.3 60.2-30.1 82.4zM224 312c32.9 0 64 8.6 64 43.8 0 33-12.9 104.1-20.6 132.9-5.1 19-24.5 23.4-43.4 23.4s-38.2-4.4-43.4-23.4c-7.8-28.5-20.6-99.7-20.6-132.8 0-35.1 31.1-43.8 64-43.8zm0-128a40 40 0 1 1 0 80 40 40 0 1 1 0-80z\"]\n};\nvar faArrowUpRightDots = {\n  prefix: 'fas',\n  iconName: 'arrow-up-right-dots',\n  icon: [512, 512, [], \"e4b7\", \"M96 32C78.3 32 64 46.3 64 64S78.3 96 96 96L114.7 96 9.4 201.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.3 160 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32L96 32zM403.8 70.1a38.1 38.1 0 1 0 76.2 0 38.1 38.1 0 1 0 -76.2 0zM279.7 194.2a38.1 38.1 0 1 0 76.2 0 38.1 38.1 0 1 0 -76.2 0zm162.2-38.1a38.1 38.1 0 1 0 0 76.2 38.1 38.1 0 1 0 0-76.2zM156.2 317.8a38.1 38.1 0 1 0 76.2 0 38.1 38.1 0 1 0 -76.2 0zm161.6-38.1a38.1 38.1 0 1 0 0 76.2 38.1 38.1 0 1 0 0-76.2zm86.1 38.1a38.1 38.1 0 1 0 76.2 0 38.1 38.1 0 1 0 -76.2 0zM70.1 403.8a38.1 38.1 0 1 0 0 76.2 38.1 38.1 0 1 0 0-76.2zm86.1 38.1a38.1 38.1 0 1 0 76.2 0 38.1 38.1 0 1 0 -76.2 0zm161.6-38.1a38.1 38.1 0 1 0 0 76.2 38.1 38.1 0 1 0 0-76.2zm86.1 38.1a38.1 38.1 0 1 0 76.2 0 38.1 38.1 0 1 0 -76.2 0z\"]\n};\nvar faChessQueen = {\n  prefix: 'fas',\n  iconName: 'chess-queen',\n  icon: [512, 512, [9819], \"f445\", \"M256 80a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM5.5 185L128 384 71.8 454.3c-5 6.3-7.8 14.1-7.8 22.2 0 19.6 15.9 35.5 35.5 35.5l312.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2L384 384 506.5 185c3.6-5.9 5.5-12.7 5.5-19.6l0-.6c0-20.3-16.5-36.8-36.8-36.8-7.3 0-14.4 2.2-20.4 6.2l-16.9 11.3c-12.7 8.5-29.6 6.8-40.4-4l-34.1-34.1C356.1 100.1 346.2 96 336 96s-20.1 4.1-27.3 11.3l-30.1 30.1c-12.5 12.5-32.8 12.5-45.3 0l-30.1-30.1C196.1 100.1 186.2 96 176 96s-20.1 4.1-27.3 11.3l-34.1 34.1c-10.8 10.8-27.7 12.5-40.4 4L57.3 134.2c-6.1-4-13.2-6.2-20.4-6.2-20.3 0-36.8 16.5-36.8 36.8l0 .6c0 6.9 1.9 13.7 5.5 19.6z\"]\n};\nvar faAnchorCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'anchor-circle-exclamation',\n  icon: [640, 512, [], \"e4ab\", \"M320.5 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm-32-96c-53 0-96 43-96 96 0 41.8 26.7 77.4 64 90.5l0 257.9c-62.9-14.3-110.2-69.7-111.9-136.5l16.1 14.1c10 8.7 25.1 7.7 33.9-2.3s7.7-25.1-2.3-33.9l-64-56c-9-7.9-22.6-7.9-31.6 0l-64 56c-10 8.7-11 23.9-2.3 33.9s23.9 11 33.9 2.3l16.2-14.2c2.1 113.1 94.4 204.1 208 204.1 16.6 0 32.7-1.9 48.2-5.6-20.3-30.5-32.2-67-32.2-106.4 0-27.3 5.7-53.3 16-76.9l0-136.6c37.3-13.2 64-48.7 64-90.5 0-53-43-96-96-96zm208 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-140c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z\"]\n};\nvar faEllipsisVertical = {\n  prefix: 'fas',\n  iconName: 'ellipsis-vertical',\n  icon: [128, 512, [\"ellipsis-v\"], \"f142\", \"M64 144a56 56 0 1 1 0-112 56 56 0 1 1 0 112zm0 224c30.9 0 56 25.1 56 56s-25.1 56-56 56-56-25.1-56-56 25.1-56 56-56zm56-112c0 30.9-25.1 56-56 56s-56-25.1-56-56 25.1-56 56-56 56 25.1 56 56z\"]\n};\nvar faEllipsisV = faEllipsisVertical;\nvar faHeartCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'heart-circle-exclamation',\n  icon: [576, 512, [], \"e4fe\", \"M241 87.1l15 20.7 15-20.7C296 52.5 336.2 32 378.9 32 452.4 32 512 91.6 512 165.1l0 2.6c0 17.6-3.4 35.6-9.5 53.7-21.8-8.6-45.6-13.4-70.5-13.4-106 0-192 86-192 192 0 28.5 6.2 55.6 17.4 80-.5 0-.9 0-1.4 0-15.5 0-30.8-4.6-43.1-14.1-73-55.7-212.9-186-212.9-298.2l0-2.6C0 91.6 59.6 32 133.1 32 175.8 32 216 52.5 241 87.1zM432 256a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 228a20 20 0 1 0 0-40 20 20 0 1 0 0 40zm0-180c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z\"]\n};\nvar faBuildingCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'building-circle-exclamation',\n  icon: [576, 512, [], \"e4d3\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-10.5-14.6-19-30.7-25.1-48l-74.9 0 0-80c0-17.7 14.3-32 32-32l32 0c2 0 4 .2 5.9 .5 6-23.6 16.3-45.4 30.1-64.5l-4 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 4c27.5-19.8 60.3-32.4 96-35.4L416 64c0-35.3-28.7-64-64-64L96 0zm32 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM128 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-140c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z\"]\n};\nvar faPersonArrowUpFromLine = {\n  prefix: 'fas',\n  iconName: 'person-arrow-up-from-line',\n  icon: [576, 512, [], \"e539\", \"M192-32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM318.3 299.1l-46.3-62.4 0 243.3 272 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 544c-17.7 0-32-14.3-32-32s14.3-32 32-32l80 0 0-243.3-46.3 62.4c-10.5 14.2-30.6 17.2-44.8 6.6s-17.2-30.6-6.6-44.8l70.5-95C110 132 149.7 112 192 112s82 20 107.2 53.9l70.5 95c10.5 14.2 7.6 34.2-6.6 44.8s-34.2 7.6-44.8-6.6zM208 480l0-128c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 128 32 0zM566.6 102.6c-12.5 12.5-32.8 12.5-45.3 0L496 77.3 496 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-146.7-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l80-80c12.5-12.5 32.8-12.5 45.3 0l80 80c12.5 12.5 12.5 32.8 0 45.3z\"]\n};\nvar faNotEqual = {\n  prefix: 'fas',\n  iconName: 'not-equal',\n  icon: [448, 512, [], \"f53e\", \"M378.6 81.8c9.8-14.7 5.8-34.6-8.9-44.4s-34.6-5.8-44.4 8.9L270.9 128 32 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l196.2 0-85.3 128-110.9 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l68.2 0-30.8 46.2c-9.8 14.7-5.8 34.6 8.9 44.4s34.6 5.8 44.4-8.9L177.1 384 416 384c17.7 0 32-14.3 32-32s-14.3-32-32-32l-196.2 0 85.3-128 110.9 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-68.2 0 30.8-46.2z\"]\n};\nvar faTrainTram = {\n  prefix: 'fas',\n  iconName: 'train-tram',\n  icon: [384, 512, [128650], \"e5b4\", \"M0 8C0-5.3 10.7-16 24-16l336 0c13.3 0 24 10.7 24 24l0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8-120 0 0 64 40 0c53 0 96 43 96 96l0 160c0 31.2-14.9 59-38 76.5l64.3 76c8.6 10.1 7.3 25.3-2.8 33.8s-25.3 7.3-33.8-2.8l-74.6-88.1c-3.6 .4-7.3 .6-11.1 .6l-128 0c-3.8 0-7.5-.2-11.1-.6L42.3 535.5c-8.6 10.1-23.7 11.4-33.8 2.8s-11.4-23.7-2.8-33.8l64.3-76C46.9 411 32 383.2 32 352l0-160c0-53 43-96 96-96l40 0 0-64-120 0 0 8c0 13.3-10.7 24-24 24S0 53.3 0 40L0 8zM128 160c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-128 0zm32 192a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faPlaneDeparture = {\n  prefix: 'fas',\n  iconName: 'plane-departure',\n  icon: [576, 512, [128747], \"f5b0\", \"M372 143.9L172.7 40.2c-8-4.1-17.3-4.8-25.7-1.7l-41.1 15c-10.3 3.7-13.8 16.4-7.1 25L200.3 206.4 100.1 242.8 40 206.2c-6.2-3.8-13.8-4.5-20.7-2.1L3 210.1c-9.4 3.4-13.4 14.5-8.3 23.1l53.6 91.8c15.6 26.7 48.1 38.4 77.1 27.8l12.9-4.7 0 0 398.4-145c29.1-10.6 44-42.7 33.5-71.8s-42.7-44-71.8-33.5L372 143.9zM32.2 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-512 0z\"]\n};\nvar faRightToBracket = {\n  prefix: 'fas',\n  iconName: 'right-to-bracket',\n  icon: [512, 512, [\"sign-in-alt\"], \"f2f6\", \"M345 273c9.4-9.4 9.4-24.6 0-33.9L201 95c-6.9-6.9-17.2-8.9-26.2-5.2S160 102.3 160 112l0 80-112 0c-26.5 0-48 21.5-48 48l0 32c0 26.5 21.5 48 48 48l112 0 0 80c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2L345 273zm7 143c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0z\"]\n};\nvar faSignInAlt = faRightToBracket;\nvar faSdCard = {\n  prefix: 'fas',\n  iconName: 'sd-card',\n  icon: [384, 512, [], \"f7c2\", \"M384 64c0-35.3-28.7-64-64-64L125.3 0C108.3 0 92 6.7 80 18.7L18.7 80C6.7 92 0 108.3 0 125.3L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384zM160 88l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24zm88 0l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24zm88 0l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24z\"]\n};\nvar faHouseCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'house-circle-exclamation',\n  icon: [640, 512, [], \"e50a\", \"M496 544a144 144 0 1 1 0-288 144 144 0 1 1 0 288zM268.6 6.5c12.2-9.3 29.7-8.7 41.2 2l217.6 202c-10.2-1.7-20.7-2.6-31.3-2.6-78.6 0-146.1 47.2-175.8 114.8-5.1-1.8-10.5-2.8-16.2-2.8l-32 0c-26.5 0-48 21.5-48 48l0 96 91 0c6.1 17.3 14.6 33.4 25.1 48L144 512c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208 2.4-2zM496 444a20 20 0 1 0 0 40 20 20 0 1 0 0-40zm0-140c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16 8.8 0 16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z\"]\n};\nvar faShekelSign = {\n  prefix: 'fas',\n  iconName: 'shekel-sign',\n  icon: [448, 512, [8362, \"ils\", \"shekel\", \"sheqel\", \"sheqel-sign\"], \"f20b\", \"M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 128 0c35.3 0 64 28.7 64 64l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-70.7-57.3-128-128-128L32 32zM320 480c70.7 0 128-57.3 128-128l0-288c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 288c0 35.3-28.7 64-64 64l-128 0 0-224c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l160 0z\"]\n};\nvar faIls = faShekelSign;\nvar faShekel = faShekelSign;\nvar faSheqel = faShekelSign;\nvar faSheqelSign = faShekelSign;\nvar faRadio = {\n  prefix: 'fas',\n  iconName: 'radio',\n  icon: [512, 512, [128251], \"f8d7\", \"M494.8 15c12.7-3.7 20-17.1 16.3-29.8S494-34.8 481.3-31L51.8 94.9C42.4 97.6 33.9 102.1 26.6 108 10.5 119.7 0 138.6 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L218.5 96 494.8 15zM368 208a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM64 248c0-13.3 10.7-24 24-24l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 272c-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 368c-13.3 0-24-10.7-24-24z\"]\n};\nvar faHandDots = {\n  prefix: 'fas',\n  iconName: 'hand-dots',\n  icon: [512, 512, [\"allergies\"], \"f461\", \"M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4S-3.6 325.7 12.4 341L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208zM200 352a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 88a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm-88 24a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faAllergies = faHandDots;\nvar faBookSkull = {\n  prefix: 'fas',\n  iconName: 'book-skull',\n  icon: [448, 512, [\"book-dead\"], \"f6b7\", \"M96 512l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-66.7c18.6-6.6 32-24.4 32-45.3l0-288c0-26.5-21.5-48-48-48L96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96zM64 416c0-17.7 14.3-32 32-32l256 0 0 64-256 0c-17.7 0-32-14.3-32-32zM272 163.2l0 12.8c0 8.8-7.2 16-16 16l-64 0c-8.8 0-16-7.2-16-16l0-12.8c-19.4-11.7-32-30.3-32-51.2 0-35.3 35.8-64 80-64s80 28.7 80 64c0 20.9-12.6 39.5-32 51.2zM208 112a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm74.2 95.7c4.6 10.1 .1 21.9-9.9 26.5l-47.9 21.8 47.9 21.8c10.1 4.6 14.5 16.4 9.9 26.5s-16.4 14.5-26.5 9.9L224 294 144.3 330.2c-10.1 4.6-21.9 .1-26.5-9.9s-.1-21.9 9.9-26.5l47.9-21.8-47.9-21.8c-10.1-4.6-14.5-16.4-9.9-26.5s16.4-14.5 26.5-9.9L224 250 303.7 213.8c10.1-4.6 21.9-.1 26.5 9.9z\"]\n};\nvar faBookDead = faBookSkull;\nvar faUnlockKeyhole = {\n  prefix: 'fas',\n  iconName: 'unlock-keyhole',\n  icon: [384, 512, [\"unlock-alt\"], \"f13e\", \"M192 32c-35.3 0-64 28.7-64 64l0 64 192 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l0-64c0-70.7 57.3-128 128-128 63.5 0 116.1 46.1 126.2 106.7 2.9 17.4-8.8 33.9-26.3 36.9s-33.9-8.8-36.9-26.3C250 55.1 223.7 32 192 32zm40 328c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0z\"]\n};\nvar faUnlockAlt = faUnlockKeyhole;\nvar faFileArrowUp = {\n  prefix: 'fas',\n  iconName: 'file-arrow-up',\n  icon: [384, 512, [\"file-upload\"], \"f574\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM209 263c-9.4-9.4-24.6-9.4-33.9 0l-64 64c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l23-23 0 86.1c0 13.3 10.7 24 24 24s24-10.7 24-24l0-86.1 23 23c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-64-64z\"]\n};\nvar faFileUpload = faFileArrowUp;\nvar faFaceGrinTears = {\n  prefix: 'fas',\n  iconName: 'face-grin-tears',\n  icon: [640, 512, [128514, \"grin-tears\"], \"f588\", \"M554.8 203.4l16.3 2.3C547.7 88.4 444.2 0 320 0S92.3 88.4 68.9 205.7l16.3-2.3c37-5.3 68.6 26.4 63.4 63.4l-6.7 46.7c-4.1 29-21.6 53.2-45.8 66.8 43.7 78.5 127.6 131.7 223.8 131.7s180.1-53.1 223.8-131.7c-24.1-13.5-41.6-37.8-45.8-66.8l-6.7-46.7c-5.3-37 26.4-68.6 63.4-63.4zM470.3 326.9C447.9 388.2 389.1 432 320 432S192.1 388.2 169.7 326.9c-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1c11.9-3.7 23.9 6.3 19.6 18.1zM212 208l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28s-28 12.5-28 28zm188-28c-15.5 0-28 12.5-28 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28zM640 300.6c0-25.6-18.8-47.3-44.1-50.9L549.1 243c-10.6-1.5-19.6 7.5-18.1 18.1l6.7 46.7c3.6 25.3 25.3 44.1 50.9 44.1 28.4 0 51.4-23 51.4-51.4zm-640 0C0 329 23 352 51.4 352 77 352 98.7 333.2 102.3 307.9l6.7-46.7c1.5-10.6-7.5-19.6-18.1-18.1l-46.7 6.7C18.8 253.3 0 275 0 300.6z\"]\n};\nvar faGrinTears = faFaceGrinTears;\nvar faPenToSquare = {\n  prefix: 'fas',\n  iconName: 'pen-to-square',\n  icon: [512, 512, [\"edit\"], \"f044\", \"M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L368 46.1 465.9 144 490.3 119.6c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L432 177.9 334.1 80 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z\"]\n};\nvar faEdit = faPenToSquare;\nvar faEarthEurope = {\n  prefix: 'fas',\n  iconName: 'earth-europe',\n  icon: [512, 512, [\"globe-europe\"], \"f7a2\", \"M256.2 48c114.8 .1 207.8 93.2 207.8 208 0 22.1-3.4 43.4-9.8 63.4-2 .4-4.1 .6-6.2 .6l-2.7 0c-8.5 0-16.6-3.4-22.6-9.4l-29.3-29.3c-6-6-9.4-14.1-9.4-22.6l0-50.7c0-8.8 7.2-16 16-16s16-7.2 16-16-7.2-16-16-16l-24 0c-13.3 0-24 10.7-24 24s-10.7 24-24 24l-56 0c-8.8 0-16 7.2-16 16s-7.2 16-16 16l-25.4 0c-12.5 0-22.6-10.1-22.6-22.6 0-6 2.4-11.8 6.6-16l70.1-70.1c2.1-2.1 3.3-5 3.3-8 0-6.2-5.1-11.3-11.3-11.3l-14.1 0c-12.5 0-22.6-10.1-22.6-22.6 0-6 2.4-11.8 6.6-16l23.1-23.1c.8-.8 1.6-1.5 2.5-2.2zM438.4 356.1c-32.8 59.6-93.9 101.4-165.2 107.2-.7-2.3-1.1-4.8-1.1-7.3 0-13.3-10.7-24-24-24l-26.7 0c-8.5 0-16.6-3.4-22.6-9.4l-29.3-29.3c-6-6-9.4-14.1-9.4-22.6l0-66.7c0-17.7 14.3-32 32-32l98.7 0c8.5 0 16.6 3.4 22.6 9.4l29.3 29.3c6 6 14.1 9.4 22.6 9.4l5.5 0c8.5 0 16.6 3.4 22.6 9.4l16 16c4.2 4.2 10 6.6 16 6.6 4.8 0 9.3 1.5 13 4.1zM256 512l26.2-1.3c-8.6 .9-17.3 1.3-26.2 1.3zm26.2-1.3C411.3 497.6 512 388.6 512 256 512 114.6 397.4 0 256 0l0 0C114.6 0 0 114.6 0 256 0 383.5 93.2 489.3 215.3 508.8 228.5 510.9 242.1 512 256 512zM187.3 123.3l-32 32c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l32-32c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z\"]\n};\nvar faGlobeEurope = faEarthEurope;\nvar faFaceGrinBeamSweat = {\n  prefix: 'fas',\n  iconName: 'face-grin-beam-sweat',\n  icon: [576, 512, [128517, \"grin-beam-sweat\"], \"f583\", \"M546.2-.1c14.7 17.8 29.8 40.1 29.8 64.1 0 36.4-27.6 64-64 64s-64-27.6-64-64c0-24 15.2-46.3 29.8-64.1 8.8-10.7 18.5-20.8 29-30 3-2.6 7.4-2.6 10.4 0 10.5 9.1 20.1 19.3 29 30zM288 0c42.5 0 82.6 10.4 117.8 28.7-3.6 10.9-5.8 22.7-5.8 35.3 0 62.9 49.1 112 112 112 6.4 0 12.7-.5 18.8-1.5 8.6 25.6 13.2 53 13.2 81.5 0 141.4-114.6 256-256 256S32 397.4 32 256 146.6 0 288 0zM418.7 308.9C379.5 321.1 335.1 328 288 328s-91.5-6.9-130.7-19.1c-11.9-3.7-23.9 6.3-19.6 18.1 22.4 61.3 81.3 105.1 150.3 105.1s127.9-43.8 150.3-105.1c4.3-11.8-7.7-21.8-19.6-18.1zM208 180c15.5 0 28 12.5 28 28l0 8c0 11 9 20 20 20s20-9 20-20l0-8c0-37.6-30.4-68-68-68s-68 30.4-68 68l0 8c0 11 9 20 20 20s20-9 20-20l0-8c0-15.5 12.5-28 28-28zm132 28c0-15.5 12.5-28 28-28s28 12.5 28 28l0 8c0 11 9 20 20 20s20-9 20-20l0-8c0-37.6-30.4-68-68-68s-68 30.4-68 68l0 8c0 11 9 20 20 20s20-9 20-20l0-8z\"]\n};\nvar faGrinBeamSweat = faFaceGrinBeamSweat;\nvar faCircleHalfStroke = {\n  prefix: 'fas',\n  iconName: 'circle-half-stroke',\n  icon: [512, 512, [9680, \"adjust\"], \"f042\", \"M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z\"]\n};\nvar faAdjust = faCircleHalfStroke;\nvar faPersonMilitaryToPerson = {\n  prefix: 'fas',\n  iconName: 'person-military-to-person',\n  icon: [512, 512, [], \"e54c\", \"M71 12.5c-8.6 1-15 8.2-15 16.8 0 9.3 7.5 16.8 16.7 16.9l111.4 0c8.8-.1 15.9-7.2 15.9-16L200 16c0-9.5-8.3-17-17.8-15.9L71 12.5zM189.5 78.1l-122.9 0c-1.6 5.7-2.5 11.7-2.5 17.9 0 35.3 28.7 64 64 64s64-28.7 64-64c0-6.2-.9-12.2-2.5-17.9zM32 256l0 32c0 17.7 14.3 32 32 32l128 0c1.8 0 3.5-.1 5.2-.4L53 208.6C40.1 220.3 32 237.2 32 256zm190.2 42.5c1.1-3.3 1.8-6.8 1.8-10.5l0-32c0-35.3-28.7-64-64-64l-64 0c-3.7 0-7.4 .3-10.9 .9L222.2 298.5zM384 160a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-35.3 0-64 28.7-64 64l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32c0-35.3-28.7-64-64-64l-64 0zM215.8 450.1c5.2-4.6 8.2-11.1 8.2-18.1s-3-13.5-8.2-18.1l-64-56c-7.1-6.2-17.1-7.7-25.7-3.8S112 366.6 112 376l0 32-88 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l88 0 0 32c0 9.4 5.5 18 14.1 21.9s18.6 2.4 25.7-3.8l64-56zM288 431.9c0 6.9 3 13.5 8.1 18.1l64 56.4c7.1 6.2 17.1 7.8 25.7 3.9S400 497.8 400 488.4l0-32.4 88 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-88 0 0-32c0-9.4-5.5-18-14.1-21.9s-18.6-2.4-25.7 3.8l-64 56c-5.2 4.5-8.2 11.1-8.2 18z\"]\n};\nvar faTableCellsColumnLock = {\n  prefix: 'fas',\n  iconName: 'table-cells-column-lock',\n  icon: [640, 512, [], \"e678\", \"M256 224l0 192 64 0 0-192-64 0zm256-79c-46.7 5.8-85.6 36.8-102.7 79l-25.3 0 0 90.8c-10.1 15.2-16 33.4-16 53.1l0 96c0 5.5 .5 10.9 1.3 16.1L128 480c-35.3 0-64-28.7-64-64L64 96c0-35.3 28.7-64 64-64l320 0c35.3 0 64 28.7 64 64l0 49zM128 224l0 192 64 0 0-192-64 0zm432 48.1c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0 0-47.9zM416 368c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96z\"]\n};\nvar faTruckFieldUn = {\n  prefix: 'fas',\n  iconName: 'truck-field-un',\n  icon: [640, 512, [], \"e58e\", \"M96 32C60.7 32 32 60.7 32 96l0 32c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l0 48c0 21.1 13.7 39.1 32.6 45.5-.4 3.4-.6 7-.6 10.5 0 48.6 39.4 88 88 88s88-39.4 88-88c0-2.7-.1-5.4-.4-8l144.7 0c-.2 2.6-.4 5.3-.4 8 0 48.6 39.4 88 88 88s88-39.4 88-88c0-2.7-.1-5.4-.4-8l.4 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-24.7 0-1.7-4.2-43.8-106.3c-12.3-30-41.6-49.5-74-49.5l-40.4 0C364.4 44.9 343.7 32 320 32L96 32zM384 224l0-96 31.9 0c6.5 0 12.3 3.9 14.8 9.9l35.4 86.1-82.1 0zM152 352a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm280 40a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM256.6 132.9l27.4 41 0-29.9c0-11 9-20 20-20s20 9 20 20l0 96c0 8.8-5.8 16.6-14.2 19.1s-17.5-.7-22.4-8l-27.4-41 0 29.9c0 11-9 20-20 20s-20-9-20-20l0-96c0-8.8 5.8-16.6 14.2-19.1s17.5 .7 22.4 8zM132 144l0 64c0 6.6 5.4 12 12 12s12-5.4 12-12l0-64c0-11 9-20 20-20s20 9 20 20l0 64c0 28.7-23.3 52-52 52s-52-23.3-52-52l0-64c0-11 9-20 20-20s20 9 20 20z\"]\n};\nvar faClock = {\n  prefix: 'fas',\n  iconName: 'clock',\n  icon: [512, 512, [128339, \"clock-four\"], \"f017\", \"M256 0a256 256 0 1 1 0 512 256 256 0 1 1 0-512zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z\"]\n};\nvar faClockFour = faClock;\nvar faBook = {\n  prefix: 'fas',\n  iconName: 'book',\n  icon: [448, 512, [128212], \"f02d\", \"M384 512L96 512c-53 0-96-43-96-96L0 96C0 43 43 0 96 0L400 0c26.5 0 48 21.5 48 48l0 288c0 20.9-13.4 38.7-32 45.3l0 66.7c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zM96 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0 0-64-256 0zm32-232c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0c-13.3 0-24 10.7-24 24zm24 72c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0z\"]\n};\nvar faFaceLaughWink = {\n  prefix: 'fas',\n  iconName: 'face-laugh-wink',\n  icon: [512, 512, [\"laugh-wink\"], \"f59c\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM101.6 314c-3.7-13.7 7.5-26 21.7-26l265.4 0c14.2 0 25.4 12.3 21.7 26-18.5 68-80.6 118-154.4 118S120 382 101.6 314zM144 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm164 8c0 11-9 20-20 20s-20-9-20-20c0-33.1 26.9-60 60-60l16 0c33.1 0 60 26.9 60 60 0 11-9 20-20 20s-20-9-20-20-9-20-20-20l-16 0c-11 0-20 9-20 20z\"]\n};\nvar faLaughWink = faFaceLaughWink;\nvar faCloudMeatball = {\n  prefix: 'fas',\n  iconName: 'cloud-meatball',\n  icon: [512, 512, [], \"f73b\", \"M0 224c0 53 43 96 96 96l26.9 0c3.5-12.1 10.1-23.3 19.2-32.4l1.4-1.4c15-15 35.3-22.9 56.1-22.2 14.2-15.1 34.2-23.9 55.4-23.9l2 0c21.1 0 41.1 8.8 55.4 23.9 20.8-.6 41.1 7.3 56.1 22.2l1.4 1.4c9.2 9.2 15.7 20.4 19.2 32.4l26.9 0c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0 1.1-5.2 1.6-10.5 1.6-16 0-44.2-35.8-80-80-80-24.3 0-46.1 10.9-60.8 28-18.7-35.7-56.1-60-99.2-60-61.9 0-112 50.1-112 112 0 7.1 .7 14.1 1.9 20.8-38.3 12.6-65.9 48.7-65.9 91.2zM156.5 424.3c9.5 6.3 14.2 17.7 11.9 28.8-1.8 9.2 1 18.7 7.7 25.3l1.4 1.4c6.6 6.6 16.1 9.5 25.3 7.7 11.1-2.2 22.5 2.5 28.8 11.9 5.2 7.8 14 12.5 23.3 12.5l2 0c9.4 0 18.1-4.7 23.3-12.5 6.3-9.5 17.7-14.2 28.8-11.9 9.2 1.8 18.7-1 25.3-7.7l1.4-1.4c6.6-6.6 9.5-16.1 7.7-25.3-2.2-11.1 2.5-22.5 11.9-28.8 7.8-5.2 12.5-14 12.5-23.3l0-2c0-9.4-4.7-18.1-12.5-23.3-9.5-6.3-14.2-17.7-11.9-28.8 1.8-9.2-1-18.7-7.7-25.3l-1.4-1.4c-6.6-6.6-16.1-9.5-25.3-7.7-11.1 2.2-22.5-2.5-28.8-11.9-5.2-7.8-14-12.5-23.3-12.5l-2 0c-9.4 0-18.1 4.7-23.3 12.5-6.3 9.5-17.7 14.2-28.8 11.9-9.2-1.8-18.7 1-25.3 7.7l-1.4 1.4c-6.6 6.6-9.5 16.1-7.7 25.3 2.2 11.1-2.5 22.5-11.9 28.8-7.8 5.2-12.5 14-12.5 23.3l0 2c0 9.4 4.7 18.1 12.5 23.3zM48 448a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm416 0a48 48 0 1 0 0-96 48 48 0 1 0 0 96z\"]\n};\nvar faChartArea = {\n  prefix: 'fas',\n  iconName: 'chart-area',\n  icon: [512, 512, [\"area-chart\"], \"f1fe\", \"M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zM240 96c6.7 0 13.1 2.8 17.7 7.8L328.8 181.3 375 135c9.4-9.4 24.6-9.4 33.9 0l64 64c4.5 4.5 7 10.6 7 17l0 112c0 13.3-10.7 24-24 24l-304 0c-13.3 0-24-10.7-24-24l0-112c0-6 2.3-11.8 6.3-16.2l88-96c4.5-5 11-7.8 17.7-7.8z\"]\n};\nvar faAreaChart = faChartArea;\nvar faRupiahSign = {\n  prefix: 'fas',\n  iconName: 'rupiah-sign',\n  icon: [512, 512, [], \"e23d\", \"M0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144 0 54.3-30 101.5-74.4 126.1l41 136.7c5.1 16.9-4.5 34.8-21.5 39.8s-34.8-4.5-39.8-21.5L120.1 319.8c-2.7 .1-5.4 .2-8.1 .2l-48 0 0 128c0 17.7-14.3 32-32 32S0 465.7 0 448L0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80l-48 0 0 160zm256-32l80 0c61.9 0 112 50.1 112 112S461.9 448 400 448l-48 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32zm80 160c26.5 0 48-21.5 48-48s-21.5-48-48-48l-48 0 0 96 48 0z\"]\n};\nvar faTextWidth = {\n  prefix: 'fas',\n  iconName: 'text-width',\n  icon: [448, 512, [], \"f035\", \"M40 0C17.9 0 0 17.9 0 40L0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 128 0 0 160-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-160 128 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-56c0-22.1-17.9-40-40-40L40 0zm78.6 406.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4 229.5 0-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4-229.5 0 9.4-9.4z\"]\n};\nvar faSatellite = {\n  prefix: 'fas',\n  iconName: 'satellite',\n  icon: [512, 512, [128752], \"f7bf\", \"M199 7c9.4-9.4 24.6-9.4 33.9 0l89.4 89.4 55-55c12.5-12.5 32.8-12.5 45.3 0l48 48c12.5 12.5 12.5 32.8 0 45.3l-55 55 89.4 89.4c9.4 9.4 9.4 24.6 0 33.9l-96 96c-9.4 9.4-24.6 9.4-33.9 0l-89.4-89.4-15.5 15.5c11.4 24.6 17.8 52 17.8 80.9 0 31.7-7.7 61.5-21.2 87.8-4.7 9-16.7 10.3-23.8 3.1l-96.3-96.3-60 60c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l60-60-96.3-96.3c-7.2-7.2-5.9-19.2 3.1-23.8 26.3-13.6 56.2-21.2 87.8-21.2 28.9 0 56.3 6.4 80.9 17.8L192.4 226.3 103 137c-9.4-9.4-9.4-24.6 0-33.9L199 7zm17 50.9l-62.1 62.1 72.4 72.4 62.1-62.1-72.4-72.4zM392 358.1l62.1-62.1-72.4-72.4-62.1 62.1 72.4 72.4z\"]\n};\nvar faMagnifyingGlassMinus = {\n  prefix: 'fas',\n  iconName: 'magnifying-glass-minus',\n  icon: [512, 512, [\"search-minus\"], \"f010\", \"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z\"]\n};\nvar faSearchMinus = faMagnifyingGlassMinus;\nvar faPeopleGroup = {\n  prefix: 'fas',\n  iconName: 'people-group',\n  icon: [512, 512, [], \"e533\", \"M256 0a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm96 312c0 25-12.7 47-32 59.9l0 92.1c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-92.1C172.7 359 160 337 160 312l0-40c0-53 43-96 96-96s96 43 96 96l0 40zM96 32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zm16 240l0 32c0 32.5 12.1 62.1 32 84.7l0 75.3c0 1.2 0 2.5 .1 3.7-8.5 7.6-19.7 12.3-32.1 12.3l-32 0c-26.5 0-48-21.5-48-48l0-56.6C12.9 364.4 0 343.7 0 320l0-32c0-53 43-96 96-96 12.7 0 24.8 2.5 35.9 6.9-12.6 21.4-19.9 46.4-19.9 73.1zM368 464l0-75.3c19.9-22.5 32-52.2 32-84.7l0-32c0-26.7-7.3-51.6-19.9-73.1 11.1-4.5 23.2-6.9 35.9-6.9 53 0 96 43 96 96l0 32c0 23.7-12.9 44.4-32 55.4l0 56.6c0 26.5-21.5 48-48 48l-32 0c-12.3 0-23.6-4.6-32.1-12.3 0-1.2 .1-2.5 .1-3.7zM416 32a56 56 0 1 1 0 112 56 56 0 1 1 0-112z\"]\n};\nvar faSquareBinary = {\n  prefix: 'fas',\n  iconName: 'square-binary',\n  icon: [448, 512, [], \"e69b\", \"M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm144 4c-24.3 0-44 19.7-44 44l0 48c0 24.3 19.7 44 44 44l32 0c24.3 0 44-19.7 44-44l0-48c0-24.3-19.7-44-44-44l-32 0zm-4 44c0-2.2 1.8-4 4-4l32 0c2.2 0 4 1.8 4 4l0 48c0 2.2-1.8 4-4 4l-32 0c-2.2 0-4-1.8-4-4l0-48zm140-44c-11 0-20 9-20 20 0 9.7 6.9 17.7 16 19.6l0 76.4c0 11 9 20 20 20s20-9 20-20l0-96c0-11-9-20-20-20l-16 0zM132 296c0 9.7 6.9 17.7 16 19.6l0 76.4c0 11 9 20 20 20s20-9 20-20l0-96c0-11-9-20-20-20l-16 0c-11 0-20 9-20 20zm96 24l0 48c0 24.3 19.7 44 44 44l32 0c24.3 0 44-19.7 44-44l0-48c0-24.3-19.7-44-44-44l-32 0c-24.3 0-44 19.7-44 44zm44-4l32 0c2.2 0 4 1.8 4 4l0 48c0 2.2-1.8 4-4 4l-32 0c-2.2 0-4-1.8-4-4l0-48c0-2.2 1.8-4 4-4z\"]\n};\nvar faMasksTheater = {\n  prefix: 'fas',\n  iconName: 'masks-theater',\n  icon: [576, 512, [127917, \"theater-masks\"], \"f630\", \"M-5 118L23.5 279.7c14 79.5 76.3 141.8 155.8 155.8l12.7 2.2c-16.5-28.6-27.1-60.7-30.6-94.5l-24.1 4.3c-9.7 1.7-18.8-5.8-16.9-15.5 4.8-24.7 19.1-46.6 39.7-60.9l0-74.6c-1.4 .8-3 1.3-4.7 1.6l-63 11.1c-8.7 1.5-17.3-4.4-15.9-13.1 3.1-19.6 18.4-36 39.1-39.7 17.2-3 33.9 3.5 44.6 15.8l0-22.7c0-22.5 6.9-52.4 32.3-73.4 26-21.5 67.7-43.9 124.9-54.2-30.5-16.3-86.3-32-163.8-18.4-80.3 14.2-128 50.1-150.1 76.1-9 10.5-10.8 24.9-8.4 38.5zM208 138.7l0 174.8c0 80.7 50.5 152.9 126.4 180.4L362.1 504c14.1 5.1 29.6 5.1 43.7 0L433.6 494C509.5 466.4 560 394.3 560 313.5l0-174.8c0-6.9-2.1-13.8-7-18.6-22.6-22.5-78.2-56-169-56s-146.4 33.6-169 56c-4.9 4.9-7 11.7-7 18.6zm66.1 187.1c-1.4-7 7-11 12.7-6.6 26.9 20.6 60.6 32.9 97.2 32.9s70.2-12.3 97.2-32.9c5.7-4.4 14.1-.4 12.7 6.6-10.1 51.4-55.5 90.3-109.9 90.3s-99.8-38.8-109.9-90.3zm.5-101.5C281.2 205.5 299 192 320 192s38.9 13.5 45.4 32.3c2.9 8.4-4.5 15.7-13.4 15.7l-64 0c-8.8 0-16.3-7.4-13.4-15.7zM480 240l-64 0c-8.8 0-16.3-7.4-13.4-15.7 6.5-18.8 24.4-32.3 45.4-32.3s38.9 13.5 45.4 32.3c2.9 8.4-4.5 15.7-13.4 15.7z\"]\n};\nvar faTheaterMasks = faMasksTheater;\nvar faCartPlus = {\n  prefix: 'fas',\n  iconName: 'cart-plus',\n  icon: [640, 512, [], \"f217\", \"M0 8C0-5.3 10.7-16 24-16l45.3 0c27.1 0 50.3 19.4 55.1 46l.4 2 412.7 0c20 0 35.1 18.2 31.4 37.9L537.8 235.8c-5.7 30.3-32.1 52.2-62.9 52.2l-303.6 0 5.1 28.3c2.1 11.4 12 19.7 23.6 19.7L456 336c13.3 0 24 10.7 24 24s-10.7 24-24 24l-255.9 0c-34.8 0-64.6-24.9-70.8-59.1L77.2 38.6c-.7-3.8-4-6.6-7.9-6.6L24 32C10.7 32 0 21.3 0 8zM160 464a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm224 0a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM336 78.4c-13.3 0-24 10.7-24 24l0 33.6-33.6 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l33.6 0 0 33.6c0 13.3 10.7 24 24 24s24-10.7 24-24l0-33.6 33.6 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-33.6 0 0-33.6c0-13.3-10.7-24-24-24z\"]\n};\nvar faHandsAslInterpreting = {\n  prefix: 'fas',\n  iconName: 'hands-asl-interpreting',\n  icon: [640, 512, [\"american-sign-language-interpreting\", \"asl-interpreting\", \"hands-american-sign-language-interpreting\"], \"f2a3\", \"M156.6 46.3c7.9-15.8 1.5-35-14.3-42.9s-35-1.5-42.9 14.3L13.5 189.4C4.6 207.2 0 226.8 0 246.7L0 256c0 70.7 57.3 128 128 128l80 0 0-.3c35.2-2.7 65.4-22.8 82.1-51.7 8.8-15.3 3.6-34.9-11.7-43.7s-34.9-3.6-43.7 11.7c-7 12-19.9 20-34.7 20-22.1 0-40-17.9-40-40s17.9-40 40-40c14.8 0 27.7 8 34.7 20 8.8 15.3 28.4 20.5 43.7 11.7s20.5-28.4 11.7-43.7c-12.8-22.1-33.6-39.1-58.4-47.1l80.8-22c17-4.6 27.1-22.2 22.5-39.3s-22.2-27.1-39.3-22.5l-100.7 27.5 81.6-68c13.6-11.3 15.4-31.5 4.1-45.1S249.1-3.9 235.5 7.4l-101.9 84.9 23-46zM483.4 465.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l85.9-171.7c8.9-17.8 13.5-37.4 13.5-57.2l0-9.3c0-70.7-57.3-128-128-128l-80 0 0 .3c-35.2 2.7-65.4 22.8-82.1 51.7-8.9 15.3-3.6 34.9 11.7 43.7s34.9 3.6 43.7-11.7c7-12 19.9-20 34.7-20 22.1 0 40 17.9 40 40s-17.9 40-40 40c-14.8 0-27.7-8-34.7-20-8.9-15.3-28.4-20.5-43.7-11.7s-20.5 28.4-11.7 43.7c12.8 22.1 33.6 39.1 58.4 47.1l-80.8 22c-17.1 4.6-27.1 22.2-22.5 39.3s22.2 27.1 39.3 22.5l100.7-27.5-81.6 68c-13.6 11.3-15.4 31.5-4.1 45.1s31.5 15.4 45.1 4.1l101.9-84.9-23 46z\"]\n};\nvar faAmericanSignLanguageInterpreting = faHandsAslInterpreting;\nvar faAslInterpreting = faHandsAslInterpreting;\nvar faHandsAmericanSignLanguageInterpreting = faHandsAslInterpreting;\nvar faTableCellsRowUnlock = {\n  prefix: 'fas',\n  iconName: 'table-cells-row-unlock',\n  icon: [640, 512, [], \"e691\", \"M256 224l0 192 64 0 0-192-64 0zm256-79c-46.7 5.8-85.6 36.8-102.7 79l-25.3 0 0 90.8c-10.1 15.2-16 33.4-16 53.1l0 96c0 5.5 .5 10.9 1.3 16.1L128 480c-35.3 0-64-28.7-64-64L64 96c0-35.3 28.7-64 64-64l320 0c35.3 0 64 28.7 64 64l0 49zM128 224l0 192 64 0 0-192-64 0zm432 48c-.1-17.6-14.4-31.9-32-31.9-17.7 0-32 14.3-32 32l0 47.9 96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80 44.2 0 79.9 35.8 80 79.9l-48 0z\"]\n};\nvar faRocket = {\n  prefix: 'fas',\n  iconName: 'rocket',\n  icon: [512, 512, [], \"f135\", \"M128 320L24.5 320c-24.9 0-40.2-27.1-27.4-48.5L50 183.3C58.7 168.8 74.3 160 91.2 160l95 0c76.1-128.9 189.6-135.4 265.5-124.3 12.8 1.9 22.8 11.9 24.6 24.6 11.1 75.9 4.6 189.4-124.3 265.5l0 95c0 16.9-8.8 32.5-23.3 41.2l-88.2 52.9c-21.3 12.8-48.5-2.6-48.5-27.4L192 384c0-35.3-28.7-64-64-64l-.1 0zM400 160a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z\"]\n};\nvar faShrimp = {\n  prefix: 'fas',\n  iconName: 'shrimp',\n  icon: [512, 512, [129424], \"e448\", \"M72 32C32.2 32 0 64.2 0 104 0 141.9 29.3 172.9 66.4 175.8 77.6 257.2 147.4 320 232 320l56 0 0-192-216 0c-13.3 0-24-10.7-24-24S58.7 80 72 80l384 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L72 32zM224 456c0 13.3 10.7 24 24 24l72 0 0-72.2-64.1-22.4c-12.5-4.4-26.2 2.2-30.6 14.7s2.2 26.2 14.7 30.6l4.5 1.6C233 433.9 224 443.9 224 456zm128 23.3c36.4-3.3 69.5-17.6 96.1-39.6l-86.5-34.6c-3 1.8-6.2 3.2-9.6 4.3l0 69.9zM472.6 415c24.6-30.3 39.4-68.9 39.4-111 0-12.3-1.3-24.3-3.7-35.9L382.8 355.1c.8 3.4 1.2 7 1.2 10.6 0 4.6-.7 9-1.9 13.1L472.6 415zM336 128l-16 0 0 192 18.3 0c9.9 0 19.1 3.2 26.6 8.5l133.5-92.4C471.8 172.6 409.1 128 336 128zM168 192a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faTengeSign = {\n  prefix: 'fas',\n  iconName: 'tenge-sign',\n  icon: [384, 512, [8376, \"tenge\"], \"f7d7\", \"M0 56C0 42.7 10.7 32 24 32l336 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 80C10.7 80 0 69.3 0 56zM0 160c0-17.7 14.3-32 32-32l320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0 0 256c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-256-128 0c-17.7 0-32-14.3-32-32z\"]\n};\nvar faTenge = faTengeSign;\nvar faHouseChimneyMedical = {\n  prefix: 'fas',\n  iconName: 'house-chimney-medical',\n  icon: [512, 512, [\"clinic-medical\"], \"f7f2\", \"M234.2 8.6c12.3-11.4 31.3-11.4 43.5 0L368 92.3 368 80c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 101.5 37.8 35.1c9.6 9 12.8 22.9 8 35.1S493.2 272 480 272l-16 0 0 176c0 35.3-28.7 64-64 64l-288 0c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208zM224 248l0 40-40 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l40 0 0 40c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-40 40 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-40 0 0-40c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z\"]\n};\nvar faClinicMedical = faHouseChimneyMedical;\nvar faUsersSlash = {\n  prefix: 'fas',\n  iconName: 'users-slash',\n  icon: [640, 512, [], \"e073\", \"M73-24.9c-9.4-9.4-24.6-9.4-33.9 0S29.7-.3 39 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L321.8 224c56.6-1 102.2-47.2 102.2-104 0-57.4-46.6-104-104-104-56.8 0-103 45.6-104 102.2L73-24.9zM512 288c-17.2 0-33.7 3.4-48.7 9.6l170 170c4.2-5.4 6.7-12.2 6.7-19.6l0-32c0-70.7-57.3-128-128-128zM59.9 97.7c-21.5 12.5-35.9 35.7-35.9 62.3 0 39.8 32.2 72 72 72 26.6 0 49.8-14.4 62.3-35.9L59.9 97.7zM250.2 288C196.8 313.9 160 368.7 160 432l0 16c0 17.7 14.3 32 32 32l250.2 0-192-192zM128 288C57.3 288 0 345.3 0 416l0 32c0 17.7 14.3 32 32 32l86.7 0c-4.3-9.8-6.7-20.6-6.7-32l0-16c0-53.2 20-101.8 52.9-138.6-11.7-3.5-24.1-5.4-36.9-5.4zM616 160a72 72 0 1 0 -144 0 72 72 0 1 0 144 0z\"]\n};\nvar faPaperPlane = {\n  prefix: 'fas',\n  iconName: 'paper-plane',\n  icon: [576, 512, [61913], \"f1d8\", \"M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9L229.2 276.1c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8l496.9-178z\"]\n};\nvar faBookAtlas = {\n  prefix: 'fas',\n  iconName: 'book-atlas',\n  icon: [448, 512, [\"atlas\"], \"f558\", \"M96 512l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-66.7c18.6-6.6 32-24.4 32-45.3l0-288c0-26.5-21.5-48-48-48L96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96zM64 416c0-17.7 14.3-32 32-32l256 0 0 64-256 0c-17.7 0-32-14.3-32-32zM310.6 208L279 208c-1.4 23.1-6 44.2-12.6 61.2 22.7-12.5 39.4-34.8 44.2-61.2zm-173.1 0c4.8 26.4 21.5 48.7 44.2 61.2-6.7-17-11.2-38-12.6-61.2l-31.6 0zm76.4 55c4.5 9.6 8.2 13.8 10.2 15.5 2-1.7 5.7-5.8 10.2-15.5 6.2-13.4 11.1-32.5 12.7-55l-45.8 0c1.6 22.5 6.5 41.6 12.7 55zm-12.7-87l45.8 0c-1.6-22.5-6.5-41.6-12.7-55-4.5-9.6-8.2-13.8-10.2-15.5-2 1.7-5.7 5.8-10.2 15.5-6.2 13.4-11.1 32.5-12.7 55zm109.5 0c-4.8-26.4-21.5-48.7-44.2-61.2 6.7 17 11.2 38 12.6 61.2l31.6 0zM169 176c1.4-23.1 6-44.2 12.6-61.2-22.7 12.5-39.4 34.8-44.2 61.2l31.6 0zM96 192a128 128 0 1 1 256 0 128 128 0 1 1 -256 0z\"]\n};\nvar faAtlas = faBookAtlas;\nvar faTable = {\n  prefix: 'fas',\n  iconName: 'table',\n  icon: [448, 512, [], \"f0ce\", \"M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64l-320 0-6.5-.3C25.2 476.4 0 449.1 0 416L0 96C0 60.7 28.7 32 64 32l320 0zM64 320l0 96 128 0 0-96-128 0zm192 0l0 96 128 0 0-96-128 0zM64 256l128 0 0-96-128 0 0 96zm192 0l128 0 0-96-128 0 0 96z\"]\n};\nvar faHeart = {\n  prefix: 'fas',\n  iconName: 'heart',\n  icon: [512, 512, [128153, 128154, 128155, 128156, 128420, 129293, 129294, 129505, 9829, 10084, 61578], \"f004\", \"M241 87.1l15 20.7 15-20.7C296 52.5 336.2 32 378.9 32 452.4 32 512 91.6 512 165.1l0 2.6c0 112.2-139.9 242.5-212.9 298.2-12.4 9.4-27.6 14.1-43.1 14.1s-30.8-4.6-43.1-14.1C139.9 410.2 0 279.9 0 167.7l0-2.6C0 91.6 59.6 32 133.1 32 175.8 32 216 52.5 241 87.1z\"]\n};\nvar faCircleChevronUp = {\n  prefix: 'fas',\n  iconName: 'circle-chevron-up',\n  icon: [512, 512, [\"chevron-circle-up\"], \"f139\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM377 271c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-87-87-87 87c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 167c9.4-9.4 24.6-9.4 33.9 0L377 271z\"]\n};\nvar faChevronCircleUp = faCircleChevronUp;\nvar faBatteryHalf = {\n  prefix: 'fas',\n  iconName: 'battery-half',\n  icon: [640, 512, [\"battery-3\"], \"f242\", \"M528 128c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-416 0c-8.8 0-16-7.2-16-16l0-224c0-8.8 7.2-16 16-16l416 0zM112 64c-44.2 0-80 35.8-80 80l0 224c0 44.2 35.8 80 80 80l416 0c44.2 0 80-35.8 80-80l0-48c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80L112 64zm56 112c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24l144 0c13.3 0 24-10.7 24-24l0-112c0-13.3-10.7-24-24-24l-144 0z\"]\n};\nvar faBattery3 = faBatteryHalf;\nvar faFontAwesome = {\n  prefix: 'fas',\n  iconName: 'font-awesome',\n  icon: [512, 512, [62501, 62694, \"font-awesome-flag\", \"font-awesome-logo-full\"], \"f2b4\", \"M91.7 96C106.3 86.8 116 70.5 116 52 116 23.3 92.7 0 64 0S12 23.3 12 52c0 16.7 7.8 31.5 20 41l0 419 64 0 0-64 373.6 0c14.6 0 26.4-11.8 26.4-26.4 0-3.7-.8-7.3-2.3-10.7L432 272 493.7 133.1c1.5-3.4 2.3-7 2.3-10.7 0-14.6-11.8-26.4-26.4-26.4L91.7 96z\"]\n};\nvar faFontAwesomeFlag = faFontAwesome;\nvar faFontAwesomeLogoFull = faFontAwesome;\nvar faHandcuffs = {\n  prefix: 'fas',\n  iconName: 'handcuffs',\n  icon: [576, 512, [], \"e4f8\", \"M320-32c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32zM192 64a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM152 96c-13.3 0-24 10.7-24 24l0 16c0 1 .1 1.9 .2 2.9-74.7 26.3-128.2 97.5-128.2 181.1 0 106 86 192 192 192s192-86 192-192c0-83.7-53.5-154.8-128.2-181.1 .1-.9 .2-1.9 .2-2.9l0-16c0-13.3-10.7-24-24-24l-80 0zM64 320a128 128 0 1 1 256 0 128 128 0 1 1 -256 0zm448 0c0 66.9-51.3 121.8-116.6 127.5-14.3 22.8-32.4 43.1-53.4 59.9 13.5 3 27.6 4.6 42 4.6 106 0 192-86 192-192 0-83.7-53.5-154.8-128.2-181.1 .1-.9 .2-1.9 .2-2.9l0-16c0-13.3-10.7-24-24-24l-80 0c-12.3 0-22.4 9.2-23.8 21.1 30.3 19.2 56.1 45 75.2 75.4 65.4 5.8 116.6 60.6 116.6 127.5zM384 64a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faHatCowboySide = {\n  prefix: 'fas',\n  iconName: 'hat-cowboy-side',\n  icon: [640, 512, [], \"f8c1\", \"M640 388.3c0 16.9-7.1 32.2-18.4 43.1l-35-23.3-292.7-195.1c-36.1-24.1-78.6-36.9-122-36.9l-3.9 0c-2.7 0-5.4 0-8 .1l22.2-100c5.7-25.8 28.6-44.1 55-44.1 12.2 0 24.1 4 33.8 11.3l4.7 3.5c26.3 19.7 62.4 19.7 88.6 0l4.7-3.5c9.8-7.3 21.6-11.3 33.8-11.3 26.4 0 49.3 18.3 55 44.1l33 148.5C574.5 232.3 640 302.6 640 388.3zM171.9 224c33.9 0 67.1 10 95.4 28.9L560 448 56 448c-30.9 0-56-25.1-56-56 0-92.8 75.2-168 168-168l3.9 0z\"]\n};\nvar faIndustry = {\n  prefix: 'fas',\n  iconName: 'industry',\n  icon: [512, 512, [], \"f275\", \"M32 32C14.3 32 0 46.3 0 64L0 432c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-279.8c0-18.2-19.4-29.7-35.4-21.1l-156.6 84.3 0-63.2c0-18.2-19.4-29.7-35.4-21.1L128 215.4 128 64c0-17.7-14.3-32-32-32L32 32z\"]\n};\nvar faLinesLeaning = {\n  prefix: 'fas',\n  iconName: 'lines-leaning',\n  icon: [384, 512, [], \"e51e\", \"M190.4 74.1c5.6-16.8-3.5-34.9-20.2-40.5s-34.9 3.5-40.5 20.2l-128 384c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l128-384zm70.9-41.7c-17.4-2.9-33.9 8.9-36.8 26.3l-64 384c-2.9 17.4 8.9 33.9 26.3 36.8s33.9-8.9 36.8-26.3l64-384c2.9-17.4-8.9-33.9-26.3-36.8zM352 32c-17.7 0-32 14.3-32 32l0 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32z\"]\n};\nvar faPassport = {\n  prefix: 'fas',\n  iconName: 'passport',\n  icon: [384, 512, [], \"f5ab\", \"M0 64C0 28.7 28.7 0 64 0L320 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM96 408c0 13.3 10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0c-13.3 0-24 10.7-24 24zM278.6 208c-4.8 26.4-21.5 48.7-44.2 61.2 6.7-17 11.2-38 12.6-61.2l31.6 0zm-173.1 0l31.6 0c1.4 23.1 6 44.2 12.6 61.2-22.7-12.5-39.4-34.8-44.2-61.2zm76.4 55c-6.2-13.4-11.1-32.5-12.7-55l45.8 0c-1.6 22.5-6.5 41.6-12.7 55-4.5 9.6-8.2 13.8-10.2 15.5-2-1.7-5.7-5.8-10.2-15.5zm0-142c4.5-9.6 8.2-13.8 10.2-15.5 2 1.7 5.7 5.8 10.2 15.5 6.2 13.4 11.1 32.5 12.7 55l-45.8 0c1.6-22.5 6.5-41.6 12.7-55zm96.7 55L247 176c-1.4-23.1-6-44.2-12.6-61.2 22.7 12.5 39.4 34.8 44.2 61.2zM137 176l-31.6 0c4.8-26.4 21.5-48.7 44.2-61.2-6.7 17-11.2 38-12.6 61.2zm183 16a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z\"]\n};\nvar faInfinity = {\n  prefix: 'fas',\n  iconName: 'infinity',\n  icon: [640, 512, [8734, 9854], \"f534\", \"M0 256c0-88.4 71.6-160 160-160 50.4 0 97.8 23.7 128 64l32 42.7 32-42.7c30.2-40.3 77.6-64 128-64 88.4 0 160 71.6 160 160S568.4 416 480 416c-50.4 0-97.8-23.7-128-64l-32-42.7-32 42.7c-30.2 40.3-77.6 64-128 64-88.4 0-160-71.6-160-160zm280 0l-43.2-57.6c-18.1-24.2-46.6-38.4-76.8-38.4-53 0-96 43-96 96s43 96 96 96c30.2 0 58.7-14.2 76.8-38.4L280 256zm80 0l43.2 57.6c18.1 24.2 46.6 38.4 76.8 38.4 53 0 96-43 96-96s-43-96-96-96c-30.2 0-58.7 14.2-76.8 38.4L360 256z\"]\n};\nvar faClone = {\n  prefix: 'fas',\n  iconName: 'clone',\n  icon: [512, 512, [], \"f24d\", \"M288 448l-224 0 0-224 48 0 0-64-48 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-48-64 0 0 48zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z\"]\n};\nvar faForward = {\n  prefix: 'fas',\n  iconName: 'forward',\n  icon: [576, 512, [9193], \"f04e\", \"M371.7 43.1C360.1 32 343 28.9 328.3 35.2S304 56 304 72l0 136.3-172.3-165.1C120.1 32 103 28.9 88.3 35.2S64 56 64 72l0 368c0 16 9.6 30.5 24.3 36.8s31.8 3.2 43.4-7.9L304 303.7 304 440c0 16 9.6 30.5 24.3 36.8s31.8 3.2 43.4-7.9l192-184c7.9-7.5 12.3-18 12.3-28.9s-4.5-21.3-12.3-28.9l-192-184z\"]\n};\nvar faM = {\n  prefix: 'fas',\n  iconName: 'm',\n  icon: [448, 512, [109], \"4d\", \"M22.7 33.4c13.5-4.1 28.1 1.1 35.9 12.9L224 294.3 389.4 46.3c7.8-11.7 22.4-17 35.9-12.9S448 49.9 448 64l0 384c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-278.3-133.4 200.1c-5.9 8.9-15.9 14.2-26.6 14.2s-20.7-5.3-26.6-14.2L64 169.7 64 448c0 17.7-14.3 32-32 32S0 465.7 0 448L0 64C0 49.9 9.2 37.5 22.7 33.4z\"]\n};\nvar faRoadSpikes = {\n  prefix: 'fas',\n  iconName: 'road-spikes',\n  icon: [640, 512, [], \"e568\", \"M64 116.8c0-15.8 20.5-22 29.3-8.9l98.7 148 0-139.2c0-15.8 20.5-22 29.3-8.9l98.7 148 0-139.2c0-15.8 20.5-22 29.3-8.9l98.7 148 0-139.2c0-15.8 20.5-22 29.3-8.9L606.8 302.2c14.2 21.3-1.1 49.8-26.6 49.8L64 352 64 116.8zM32 384l576 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faMountain = {\n  prefix: 'fas',\n  iconName: 'mountain',\n  icon: [512, 512, [127956], \"f6fc\", \"M256.5 0c14.7 0 28.2 8.1 35.2 21l216 400c6.7 12.4 6.4 27.4-.8 39.5-7.2 12.1-20.3 19.5-34.3 19.5l-432 0c-14.1 0-27.1-7.4-34.3-19.5s-7.5-27.1-.8-39.5l216-400 2.9-4.6C231.7 6.2 243.6 0 256.5 0zM170.4 249.9l26.8 26.8c6.2 6.2 16.4 6.2 22.6 0l43.3-43.3c6-6 14.1-9.4 22.6-9.4l42.8 0-72.1-133.5-86.1 159.4z\"]\n};\nvar faChess = {\n  prefix: 'fas',\n  iconName: 'chess',\n  icon: [512, 512, [], \"f439\", \"M168 56l0 40-78.1 0c-14.3 0-25.9 11.6-25.9 25.9 0 4 .9 8 2.7 11.6l33.4 66.8c-11.4 1.8-20.2 11.7-20.2 23.7 0 13.3 10.7 24 24 24l5.6 0-13.6 136-56.2 70.3c-5 6.3-7.8 14.1-7.8 22.2 0 19.6 15.9 35.5 35.5 35.5l248.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2L288 384 274.4 248 280 248c13.3 0 24-10.7 24-24 0-11.9-8.7-21.9-20.2-23.7l33.4-66.8c1.8-3.6 2.7-7.6 2.7-11.6 0-14.3-11.6-25.9-25.9-25.9l-78.1 0 0-40 16 0c13.3 0 24-10.7 24-24S245.3 8 232 8l-16 0 0-16c0-13.3-10.7-24-24-24S168-21.3 168-8l0 16-16 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0zM325.8 279.6l8.5 85.5 47.4 59.2 4.2 5.7c9.2 13.7 14.1 29.9 14.1 46.5 0 12.7-2.8 24.8-7.9 35.5l83.1 0c20.3 0 36.8-16.5 36.8-36.8 0-7.3-2.2-14.4-6.2-20.4l-25.8-38.7 0-64 13.3-13.3c12-12 18.7-28.3 18.7-45.3L512 192c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 16-32 0 0-16c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32c0 22.4-10.2 42.4-26.2 55.6z\"]\n};\nvar faTemperatureThreeQuarters = {\n  prefix: 'fas',\n  iconName: 'temperature-three-quarters',\n  icon: [320, 512, [\"temperature-3\", \"thermometer-3\", \"thermometer-three-quarters\"], \"f2c8\", \"M160 0C107 0 64 43 64 96l0 164.7C34.5 287 16 325.4 16 368 16 447.5 80.5 512 160 512s144-64.5 144-144c0-42.6-18.5-81-48-107.3L256 96c0-53-43-96-96-96zm64 368c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-26.9 16.5-49.9 40-59.3L136 152c0-13.3 10.7-24 24-24s24 10.7 24 24l0 156.7c23.5 9.5 40 32.5 40 59.3z\"]\n};\nvar faTemperature3 = faTemperatureThreeQuarters;\nvar faThermometer3 = faTemperatureThreeQuarters;\nvar faThermometerThreeQuarters = faTemperatureThreeQuarters;\nvar faB = {\n  prefix: 'fas',\n  iconName: 'b',\n  icon: [320, 512, [98], \"42\", \"M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32l160 0c70.7 0 128-57.3 128-128 0-46.5-24.8-87.3-62-109.7 18.7-22.3 30-51 30-82.3 0-70.7-57.3-128-128-128L32 32zM160 224l-96 0 0-128 96 0c35.3 0 64 28.7 64 64s-28.7 64-64 64zM64 288l128 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-128 0 0-128z\"]\n};\nvar faShieldVirus = {\n  prefix: 'fas',\n  iconName: 'shield-virus',\n  icon: [512, 512, [], \"e06c\", \"M253.4 2.9C249.2 1 244.7 0 240 0s-9.2 1-13.4 2.9L38.3 82.8c-22 9.3-38.4 31-38.3 57.2 .5 99.2 41.3 280.7 213.6 363.2 16.7 8 36.1 8 52.8 0 172.4-82.5 213.2-264 213.6-363.2 .1-26.2-16.3-47.9-38.3-57.2L253.4 2.9zM240 128c13.3 0 24 10.7 24 24 0 22.9 27.7 34.4 43.9 18.2 9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-16.2 16.2-4.7 43.9 18.2 43.9 13.3 0 24 10.7 24 24s-10.7 24-24 24c-22.9 0-34.4 27.7-18.2 43.9 9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-16.2-16.2-43.9-4.7-43.9 18.2 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-22.9-27.7-34.4-43.9-18.2-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9c16.2-16.2 4.7-43.9-18.2-43.9-13.3 0-24-10.7-24-24s10.7-24 24-24c22.9 0 34.4-27.7 18.2-43.9-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0c16.2 16.2 43.9 4.7 43.9-18.2 0-13.3 10.7-24 24-24zM208 264a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm88 40a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faLitecoinSign = {\n  prefix: 'fas',\n  iconName: 'litecoin-sign',\n  icon: [384, 512, [], \"e1d3\", \"M128 64c0-17.7-14.3-32-32-32S64 46.3 64 64l0 157.9-38.6 11c-12.7 3.6-20.1 16.9-16.5 29.7s16.9 20.1 29.7 16.5L64 271.8 64 448c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0 0-162.5 134.6-38.5c12.7-3.6 20.1-16.9 16.5-29.7s-16.9-20.1-29.7-16.5L128 203.6 128 64z\"]\n};\nvar faDiceD6 = {\n  prefix: 'fas',\n  iconName: 'dice-d6',\n  icon: [512, 512, [], \"f6d1\", \"M224.4 8.3C244-2.8 268-2.8 287.6 8.3l176 99.7c20 11.4 32.4 32.6 32.4 55.7l0 197.4c0 23-12.4 44.3-32.4 55.7l-176 99.7c-19.6 11.1-43.6 11.1-63.1 0l-176-99.7C28.4 405.5 16 384.2 16 361.2l0-197.4c0-23 12.4-44.3 32.4-55.7l176-99.7zM102.6 155.6c-8.8-3.1-18.8 .3-23.8 8.6s-3.2 18.7 3.6 25l3.2 2.4 150.2 90.2 0 148.7c0 11 9 20 20 20 11 0 20-9 20-20l0-148.7 150.3-90.2c9.5-5.7 12.6-18 6.9-27.4s-18-12.5-27.4-6.9l-149.7 89.8-149.7-89.8-3.7-1.7z\"]\n};\nvar faGripLinesVertical = {\n  prefix: 'fas',\n  iconName: 'grip-lines-vertical',\n  icon: [192, 512, [], \"f7a5\", \"M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32L64 64zm128 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384z\"]\n};\nvar faGolfBallTee = {\n  prefix: 'fas',\n  iconName: 'golf-ball-tee',\n  icon: [384, 512, [\"golf-ball\"], \"f450\", \"M298.5 384.1c12.1 1.2 21.5 11.5 21.5 23.9s-9.4 22.6-21.5 23.9l-2.5 .1-80 0 0 88c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-88-80 0c-13.3 0-24-10.7-24-24 0-12.4 9.4-22.6 21.5-23.9l2.5-.1 208 0 2.5 .1zM192 0c106 0 192 86 192 192 0 57.4-25.2 108.8-65.1 144L65.1 336C25.2 300.8 0 249.4 0 192 0 86 86 0 192 0zm32 240c-7.7 0-14.2 5.5-15.7 12.8l-.6 6.4c-1.3 6.3-6.2 11.2-12.5 12.5l-6.4 .6c-7.3 1.5-12.8 8-12.8 15.7 0 8.8 7.2 16 16 16 26.5 0 48-21.5 48-48 0-8.8-7.2-16-16-16zm64-64c-7.7 0-14.2 5.5-15.7 12.8l-.6 6.4c-1.3 6.3-6.2 11.2-12.5 12.5l-6.4 .6c-7.3 1.5-12.8 8-12.8 15.7 0 8.8 7.2 16 16 16 26.5 0 48-21.5 48-48 0-8.8-7.2-16-16-16zm-80-16c-7.7 0-14.2 5.5-15.7 12.8l-.6 6.4c-1.3 6.3-6.2 11.2-12.5 12.5l-6.4 .6c-7.3 1.5-12.8 8-12.8 15.7 0 8.8 7.2 16 16 16 26.5 0 48-21.5 48-48 0-8.8-7.2-16-16-16z\"]\n};\nvar faGolfBall = faGolfBallTee;\nvar faHexagon = {\n  prefix: 'fas',\n  iconName: 'hexagon',\n  icon: [576, 512, [11043], \"f312\", \"M33.5 220.3c-12.7 22.2-12.7 49.4 0 71.5l96.2 168.1c12.8 22.4 36.7 36.2 62.5 36.2l191.6 0c25.8 0 49.7-13.8 62.5-36.2l96.2-168.1c12.7-22.2 12.7-49.4 0-71.5L446.3 52.2C433.5 29.8 409.6 16 383.8 16L192.2 16c-25.8 0-49.7 13.8-62.5 36.2L33.5 220.3z\"]\n};\nvar faFolderOpen = {\n  prefix: 'fas',\n  iconName: 'folder-open',\n  icon: [576, 512, [128194, 128449, 61717], \"f07c\", \"M56 225.6L32.4 296.2 32.4 96c0-35.3 28.7-64 64-64l138.7 0c13.8 0 27.3 4.5 38.4 12.8l38.4 28.8c5.5 4.2 12.3 6.4 19.2 6.4l117.3 0c35.3 0 64 28.7 64 64l0 16-365.4 0c-41.3 0-78 26.4-91.1 65.6zM477.8 448L99 448c-32.8 0-55.9-32.1-45.5-63.2l48-144C108 221.2 126.4 208 147 208l378.8 0c32.8 0 55.9 32.1 45.5 63.2l-48 144c-6.5 19.6-24.9 32.8-45.5 32.8z\"]\n};\nvar faKaaba = {\n  prefix: 'fas',\n  iconName: 'kaaba',\n  icon: [512, 512, [128331], \"f66b\", \"M256 51.3L92.8 112.4 247.5 171.1c5.5 2.1 11.5 2.1 17 0L419.2 112.4 256 51.3zM0 129.3c0-20 12.4-37.9 31.1-44.9l208-78c10.9-4.1 22.8-4.1 33.7 0l208 78c18.7 7 31.1 24.9 31.1 44.9l0 36-253.2 96c-1.8 .7-3.8 .7-5.7 0l-253.2-96 0-36zm0 140l0-52.7 236.1 89.6c12.8 4.9 26.9 4.9 39.7 0l236.1-89.6 0 52.7-128 48.6 0 51.3 128-48.6 0 62.2c0 20-12.4 37.9-31.1 44.9l-208 78c-10.9 4.1-22.8 4.1-33.7 0l-208-78C12.4 420.7 0 402.7 0 382.7l0-62.2 128 48.6 0-51.3-128-48.6zM236.1 410.1c12.8 4.9 26.9 4.9 39.7 0l60.1-22.8 0-51.3-77.2 29.3c-1.8 .7-3.8 .7-5.7 0l-77.2-29.3 0 51.3 60.1 22.8z\"]\n};\nvar faHandHolding = {\n  prefix: 'fas',\n  iconName: 'hand-holding',\n  icon: [576, 512, [], \"f4bd\", \"M66.7 384l42.5-42.5c24-24 56.6-37.5 90.5-37.5L352 304c17.7 0 32 14.3 32 32s-14.3 32-32 32l-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l112.6 0 119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5s9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5L32 512c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l34.7 0z\"]\n};\nvar faSingleQuoteRight = {\n  prefix: 'fas',\n  iconName: 'single-quote-right',\n  icon: [192, 512, [], \"e81c\", \"M64 416c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 136c0 66.3-53.7 120-120 120l-8 0z\"]\n};\nvar faBottleDroplet = {\n  prefix: 'fas',\n  iconName: 'bottle-droplet',\n  icon: [320, 512, [], \"e4c4\", \"M80 0c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 103.3c64.9 20.4 112 81 112 152.7l0 192c0 35.3-28.7 64-64 64L64 544c-35.3 0-64-28.7-64-64L0 288c0-71.6 47.1-132.3 112-152.7L112 32C94.3 32 80 17.7 80 0zm80 416c35.3 0 64-32.4 64-64 0-21.2-28.9-64.5-47.9-90.6-8.1-11.1-24.2-11.1-32.3 0-19 26.1-47.9 69.4-47.9 90.6 0 31.6 28.7 64 64 64z\"]\n};\nvar faWindowMinimize = {\n  prefix: 'fas',\n  iconName: 'window-minimize',\n  icon: [512, 512, [128469], \"f2d1\", \"M0 416c0-17.7 14.3-32 32-32l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32z\"]\n};\nvar faChevronRight = {\n  prefix: 'fas',\n  iconName: 'chevron-right',\n  icon: [320, 512, [9002], \"f054\", \"M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z\"]\n};\nvar faEgg = {\n  prefix: 'fas',\n  iconName: 'egg',\n  icon: [384, 512, [129370], \"f7fb\", \"M192 496C86 496 0 394 0 288 0 176 64 16 192 16S384 176 384 288c0 106-86 208-192 208zM154.8 134c6.5-6 7-16.1 1-22.6s-16.1-7-22.6-1c-23.9 21.8-41.1 52.7-52.3 84.2-11.2 31.6-16.9 65.1-16.9 93.5 0 8.8 7.2 16 16 16s16-7.2 16-16c0-24.5 5-54.4 15.1-82.8 10.1-28.5 25-54.1 43.7-71.2z\"]\n};\nvar faLandmarkDome = {\n  prefix: 'fas',\n  iconName: 'landmark-dome',\n  icon: [512, 512, [\"landmark-alt\"], \"f752\", \"M256 0c-17.7 0-32 14.3-32 32 0 .9 0 1.8 .1 2.6-80.5 13.4-144 76.9-157.5 157.4L64 192c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 160-51.2 38.4C4.7 460.4 0 469.9 0 480 0 497.7 14.3 512 32 512l448 0c17.7 0 32-14.3 32-32 0-10.1-4.7-19.6-12.8-25.6L448 416 448 256c17.7 0 32-14.3 32-32s-14.3-32-32-32l-2.7 0c-13.5-80.4-77-143.9-157.5-157.4 .1-.9 .1-1.7 .1-2.6 0-17.7-14.3-32-32-32zm80 256l64 0 0 160-64 0 0-160zM224 416l0-160 64 0 0 160-64 0zM112 256l64 0 0 160-64 0 0-160z\"]\n};\nvar faLandmarkAlt = faLandmarkDome;\nvar faWorm = {\n  prefix: 'fas',\n  iconName: 'worm',\n  icon: [448, 512, [], \"e599\", \"M224 96c0-53 43-96 96-96l38.4 0C407.9 0 448 40.1 448 89.6L448 376c0 75.1-60.9 136-136 136S176 451.1 176 376l0-80c0-22.1-17.9-40-40-40s-40 17.9-40 40l0 168c0 26.5-21.5 48-48 48S0 490.5 0 464L0 296c0-75.1 60.9-136 136-136s136 60.9 136 136l0 80c0 22.1 17.9 40 40 40s40-17.9 40-40l0-184-32 0c-53 0-96-43-96-96zm144-8a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faUserInjured = {\n  prefix: 'fas',\n  iconName: 'user-injured',\n  icon: [448, 512, [], \"f728\", \"M242.7 80L334 80c-10.7-24.6-29.5-44.9-52.9-57.6L242.7 80zm-.9-70.7C236 8.4 230 8 224 8 174.8 8 132.5 37.6 114 80l80.6 0 47.1-70.7zM224 248c66.3 0 120-53.7 120-120l-240 0c0 66.3 53.7 120 120 120zM98.7 341.8C49.3 370.2 16 423.5 16 484.6 16 499.7 28.3 512 43.4 512l151 0-95.8-170.2zm45.1-17.7l42.7 75.9 85.5 0c44.2 0 80 35.8 80 80 0 11.4-2.4 22.2-6.7 32l59.2 0c15.1 0 27.4-12.3 27.4-27.4 0-90.9-73.7-164.6-164.6-164.6l-86.9 0c-12.6 0-24.9 1.4-36.7 4.1zM213.5 448l36 64 22.5 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-58.5 0z\"]\n};\nvar faStrikethrough = {\n  prefix: 'fas',\n  iconName: 'strikethrough',\n  icon: [512, 512, [], \"f0cc\", \"M96 157.5C96 88.2 152.2 32 221.5 32L368 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L221.5 96c-34 0-61.5 27.5-61.5 61.5 0 31 23.1 57.2 53.9 61l44.1 5.5 222 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l83.1 0C103 204.6 96 181.8 96 157.5zM349.2 336l65.5 0c.9 6.1 1.4 12.2 1.4 18.5 0 69.3-56.2 125.5-125.5 125.5L144 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l146.5 0c34 0 61.5-27.5 61.5-61.5 0-6.4-1-12.7-2.8-18.5z\"]\n};\nvar faBlog = {\n  prefix: 'fas',\n  iconName: 'blog',\n  icon: [512, 512, [], \"f781\", \"M224 24c0-13.3 10.7-24 24-24 145.8 0 264 118.2 264 264 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-119.3-96.7-216-216-216-13.3 0-24-10.7-24-24zM80 96c26.5 0 48 21.5 48 48l0 224c0 26.5 21.5 48 48 48s48-21.5 48-48-21.5-48-48-48c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16 79.5 0 144 64.5 144 144S255.5 512 176 512 32 447.5 32 368l0-224c0-26.5 21.5-48 48-48zm168 0c92.8 0 168 75.2 168 168 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-66.3-53.7-120-120-120-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faStopwatch20 = {\n  prefix: 'fas',\n  iconName: 'stopwatch-20',\n  icon: [448, 512, [], \"e06f\", \"M168.5 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 25.3c-108 11.9-192 103.5-192 214.7 0 119.3 96.7 216 216 216s216-96.7 216-216c0-39.8-10.8-77.1-29.6-109.2l28.2-28.2c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-23.4 23.4c-32.9-30.2-75.2-50.3-122-55.5l0-25.3 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0zm-60 240c0-28.7 23.3-52 52-52s52 23.3 52 52l0 3.8c0 11.7-3.2 23.1-9.3 33l-43.8 71.2 33.1 0c11 0 20 9 20 20s-9 20-20 20l-57.8 0c-14.5 0-26.2-11.7-26.2-26.2 0-4.9 1.3-9.6 3.9-13.8l56.7-92.1c2.2-3.6 3.4-7.8 3.4-12.1l0-3.8c0-6.6-5.4-12-12-12s-12 5.4-12 12c0 11-9 20-20 20s-20-9-20-20zm180-52c28.7 0 52 23.3 52 52l0 96c0 28.7-23.3 52-52 52s-52-23.3-52-52l0-96c0-28.7 23.3-52 52-52zm-12 52l0 96c0 6.6 5.4 12 12 12s12-5.4 12-12l0-96c0-6.6-5.4-12-12-12s-12 5.4-12 12z\"]\n};\nvar faTruckPickup = {\n  prefix: 'fas',\n  iconName: 'truck-pickup',\n  icon: [640, 512, [128763], \"f63c\", \"M363.8 96l57.6 96-133.4 0 0-96 75.8 0zM496 192L418.6 63.1C407.1 43.8 386.2 32 363.8 32L256 32c-17.7 0-32 14.3-32 32l0 128-144 0c-26.5 0-48 21.5-48 48l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l32.4 0c-.2 2.6-.4 5.3-.4 8 0 48.6 39.4 88 88 88s88-39.4 88-88c0-2.7-.1-5.4-.4-8l160.7 0c-.2 2.6-.4 5.3-.4 8 0 48.6 39.4 88 88 88s88-39.4 88-88c0-2.7-.1-5.4-.4-8l32.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-80c0-26.5-21.5-48-48-48l-64 0zM112 392a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zm376-40a40 40 0 1 1 0 80 40 40 0 1 1 0-80z\"]\n};\nvar faSeedling = {\n  prefix: 'fas',\n  iconName: 'seedling',\n  icon: [512, 512, [127793, \"sprout\"], \"f4d8\", \"M512 32C512 140.1 435.4 230.3 333.6 251.4 325.7 193.3 299.6 141 261.1 100.5 301.2 40 369.9 0 448 0l32 0c17.7 0 32 14.3 32 32zM0 96C0 78.3 14.3 64 32 64l32 0c123.7 0 224 100.3 224 224l0 192c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160C100.3 320 0 219.7 0 96z\"]\n};\nvar faSprout = faSeedling;\nvar faTransgender = {\n  prefix: 'fas',\n  iconName: 'transgender',\n  icon: [576, 512, [9895, \"transgender-alt\"], \"f225\", \"M128-32c17.7 0 32 14.3 32 32s-14.3 32-32 32L97.9 32 136 70.1 151 55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-15 15 14.2 14.2c27.9-23.8 64.2-38.2 103.8-38.2 36.7 0 70.6 12.4 97.6 33.2L466.7 32 448 32c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.7-84.4 84.4c13 23.1 20.4 49.9 20.4 78.3 0 77.4-55 142-128 156.8l0 35.2 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 16c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-16-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-35.2c-73-14.8-128-79.4-128-156.8 0-31.4 9-60.7 24.7-85.4l-16.7-16.7-15 15c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l15-15-38.1-38.1 0 30.1c0 17.7-14.3 32-32 32S0 113.7 0 96L0 0C0-17.7 14.3-32 32-32l96 0zM288 336a96 96 0 1 0 0-192 96 96 0 1 0 0 192z\"]\n};\nvar faTransgenderAlt = faTransgender;\nvar faStarHalf = {\n  prefix: 'fas',\n  iconName: 'star-half',\n  icon: [576, 512, [61731], \"f089\", \"M304.1 7.6c0-11.1-7.6-20.7-18.4-23.3s-21.9 2.5-27 12.4L193.1 125.3 33.2 150.7c-8.9 1.4-16.3 7.7-19.1 16.3s-.5 18 5.8 24.4l114.4 114.5-25.2 159.9c-1.4 8.9 2.3 17.9 9.6 23.2s16.9 6.1 25 2L291 416.1c8-4.1 13.1-12.4 13.1-21.4l0-387.1z\"]\n};\nvar faPhotoFilm = {\n  prefix: 'fas',\n  iconName: 'photo-film',\n  icon: [640, 512, [\"photo-video\"], \"f87c\", \"M192 64c0-35.3 28.7-64 64-64L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224zM320 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm156.5 11.5C472.1 100.4 464.4 96 456 96s-16.1 4.4-20.5 11.5l-54 88.3-17.9-25.6c-4.5-6.4-11.8-10.2-19.7-10.2s-15.2 3.8-19.7 10.2l-56 80c-5.1 7.3-5.8 16.9-1.6 24.8S279.1 288 288 288l256 0c8.7 0 16.7-4.7 20.9-12.3s4.1-16.8-.5-24.3l-88-144zM144 128l0 160c0 61.9 50.1 112 112 112l192 0 0 16c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64l80 0zM52 196l0 24c0 8.8 7.2 16 16 16l24 0c8.8 0 16-7.2 16-16l0-24c0-8.8-7.2-16-16-16l-24 0c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16l0 24c0 8.8 7.2 16 16 16l24 0c8.8 0 16-7.2 16-16l0-24c0-8.8-7.2-16-16-16l-24 0zm0 96c-8.8 0-16 7.2-16 16l0 24c0 8.8 7.2 16 16 16l24 0c8.8 0 16-7.2 16-16l0-24c0-8.8-7.2-16-16-16l-24 0z\"]\n};\nvar faPhotoVideo = faPhotoFilm;\nvar faPictureInPicture = {\n  prefix: 'fas',\n  iconName: 'picture-in-picture',\n  icon: [512, 512, [], \"e80b\", \"M448 32c35.3 0 64 28.7 64 64l0 112-64 0 0-112-384 0 0 320 144 0 0 64-144 0-6.5-.3c-30.1-3.1-54.1-27-57.1-57.1L0 416 0 96C0 62.9 25.2 35.6 57.5 32.3L64 32 448 32zm16 224c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48l-160 0c-26.5 0-48-21.5-48-48l0-128c0-26.5 21.5-48 48-48l160 0z\"]\n};\nvar faPumpMedical = {\n  prefix: 'fas',\n  iconName: 'pump-medical',\n  icon: [320, 512, [], \"e06a\", \"M96 0l0 80 128 0 0-24 72 0c13.3 0 24-10.7 24-24S309.3 8 296 8l-72 0 0-8c0-17.7-14.3-32-32-32l-64 0C110.3-32 96-17.7 96 0zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 128zm64 120c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 40 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-40 0 0 40c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40z\"]\n};\nvar faFire = {\n  prefix: 'fas',\n  iconName: 'fire',\n  icon: [448, 512, [128293], \"f06d\", \"M160.5-26.4c9.3-7.8 23-7.5 31.9 .9 12.3 11.6 23.3 24.4 33.9 37.4 13.5 16.5 29.7 38.3 45.3 64.2 5.2-6.8 10-12.8 14.2-17.9 1.1-1.3 2.2-2.7 3.3-4.1 7.9-9.8 17.7-22.1 30.8-22.1 13.4 0 22.8 11.9 30.8 22.1 1.3 1.7 2.6 3.3 3.9 4.8 10.3 12.4 24 30.3 37.7 52.4 27.2 43.9 55.6 106.4 55.6 176.6 0 123.7-100.3 224-224 224S0 411.7 0 288c0-91.1 41.1-170 80.5-225 19.9-27.7 39.7-49.9 54.6-65.1 8.2-8.4 16.5-16.7 25.5-24.2zM225.7 416c25.3 0 47.7-7 68.8-21 42.1-29.4 53.4-88.2 28.1-134.4-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5-17.3-22.1-49.1-62.4-65.3-83-5.4-6.9-15.2-8-21.5-1.9-18.3 17.8-51.5 56.8-51.5 104.3 0 68.6 50.6 109.2 113.7 109.2z\"]\n};\nvar faMagnifyingGlassPlus = {\n  prefix: 'fas',\n  iconName: 'magnifying-glass-plus',\n  icon: [512, 512, [\"search-plus\"], \"f00e\", \"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 112c-13.3 0-24 10.7-24 24l0 48-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0 0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48 48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-48c0-13.3-10.7-24-24-24z\"]\n};\nvar faSearchPlus = faMagnifyingGlassPlus;\nvar faFlask = {\n  prefix: 'fas',\n  iconName: 'flask',\n  icon: [448, 512, [], \"f0c3\", \"M288 0L128 0C110.3 0 96 14.3 96 32s14.3 32 32 32L128 215.5 7.5 426.3C2.6 435 0 444.7 0 454.7 0 486.4 25.6 512 57.3 512l333.4 0c31.6 0 57.3-25.6 57.3-57.3 0-10-2.6-19.8-7.5-28.4L320 215.5 320 64c17.7 0 32-14.3 32-32S337.7 0 320 0L288 0zM192 215.5l0-151.5 64 0 0 151.5c0 11.1 2.9 22.1 8.4 31.8l41.6 72.7-164 0 41.6-72.7c5.5-9.7 8.4-20.6 8.4-31.8z\"]\n};\nvar faAlignRight = {\n  prefix: 'fas',\n  iconName: 'align-right',\n  icon: [448, 512, [], \"f038\", \"M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z\"]\n};\nvar faCableCar = {\n  prefix: 'fas',\n  iconName: 'cable-car',\n  icon: [512, 512, [128673, 57551, \"tram\"], \"f7da\", \"M288-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM160 24a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM32 288c0-35.3 28.7-64 64-64l136 0 0-96.2-193.4 55.3c-12.7 3.6-26-3.7-29.7-16.5s3.7-26 16.5-29.7l224-64 0 0 224-64c12.7-3.6 26 3.7 29.7 16.5s-3.7 26-16.5 29.7l-206.6 59 0 109.9 136 0c35.3 0 64 28.7 64 64l0 160c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-160zm80 0c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l56 0 0-96-56 0zm184 96l0-96-80 0 0 96 80 0zm48 0l56 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-56 0 0 96z\"]\n};\nvar faTram = faCableCar;\nvar faKitMedical = {\n  prefix: 'fas',\n  iconName: 'kit-medical',\n  icon: [512, 512, [\"first-aid\"], \"f479\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l16 0 0-384-16 0zm64 0l0 384 256 0 0-384-256 0zM448 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-16 0 0 384 16 0zM224 184c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 40 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-40 0 0 40c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40z\"]\n};\nvar faFirstAid = faKitMedical;\nvar faGripLines = {\n  prefix: 'fas',\n  iconName: 'grip-lines',\n  icon: [448, 512, [], \"f7a4\", \"M32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 288zm0-128c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160z\"]\n};\nvar faBurger = {\n  prefix: 'fas',\n  iconName: 'burger',\n  icon: [512, 512, [\"hamburger\"], \"f805\", \"M48 384c-8.8 0-16 7.2-16 16 0 44.2 35.8 80 80 80l288 0c44.2 0 80-35.8 80-80 0-8.8-7.2-16-16-16L48 384zM32 202c0 12.2 9.9 22 22 22L458 224c12.2 0 22-9.9 22-22 0-17.2-2.6-34.4-10.8-49.5-22.2-40.8-82.3-120.5-213.2-120.5S65 111.6 42.8 152.5C34.6 167.6 32 184.8 32 202zM0 304c0 17.7 14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 272c-17.7 0-32 14.3-32 32zM256 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM120 128a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm248-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faHamburger = faBurger;\nvar faSnowman = {\n  prefix: 'fas',\n  iconName: 'snowman',\n  icon: [640, 512, [9731, 9924], \"f7d0\", \"M403 211.7c32.2-24.9 53-63.9 53-107.7 0-75.1-60.9-136-136-136S184 28.9 184 104c0 43.9 20.8 82.9 53 107.7-32.2 16.3-59 41.8-76.8 73.1L112 264.2 112 224c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 19.6-22.5-9.7c-12.2-5.2-26.3 .4-31.5 12.6s.4 26.3 12.6 31.5c36.1 15.5 75.9 32.5 119.4 51.2-3.9 14.9-6 30.6-6 46.7 0 70 39.1 130.8 96.6 161.9 7.9 4.3 16.9 6.1 25.9 6.1l123 0c9 0 18-1.8 25.9-6.1 57.5-31.1 96.6-92 96.6-161.9 0-16.2-2.1-31.8-6-46.7 43.5-18.7 83.4-35.7 119.4-51.2 12.2-5.2 17.8-19.3 12.6-31.5s-19.3-17.8-31.5-12.6l-22.5 9.7 0-19.6c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40.2-48.2 20.6c-17.9-31.3-44.6-56.8-76.8-73.1zM296 416a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm24-120a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM248 80a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM292.2 159.3c-2.7-4.8-4.2-10.2-4.2-15.7 0-17.5 14.2-31.6 31.6-31.6l.8 0c17.5 0 31.6 14.2 31.6 31.6 0 5.5-1.4 10.9-4.2 15.7L327 195.8c-3.1 5.4-10.8 5.4-13.9 0l-20.9-36.6z\"]\n};\nvar faHotel = {\n  prefix: 'fas',\n  iconName: 'hotel',\n  icon: [512, 512, [127976], \"f594\", \"M16 24C16 10.7 26.7 0 40 0L472 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 416 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L40 512c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-416-8 0C26.7 48 16 37.3 16 24zm208 88l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM128 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm96 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM352 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM112 208l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm240-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM288 384l43.8 0c9.9 0 17.5-9 14-18.2-13.8-36.1-48.8-61.8-89.7-61.8s-75.9 25.7-89.7 61.8c-3.5 9.2 4.1 18.2 14 18.2l43.8 0 0 80 64 0 0-80z\"]\n};\nvar faPrint = {\n  prefix: 'fas',\n  iconName: 'print',\n  icon: [512, 512, [128424, 128438, 9113], \"f02f\", \"M64 64C64 28.7 92.7 0 128 0L341.5 0c17 0 33.3 6.7 45.3 18.7l42.5 42.5c12 12 18.7 28.3 18.7 45.3l0 37.5-384 0 0-80zM0 256c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 96c0 17.7-14.3 32-32 32l-32 0 0 64c0 35.3-28.7 64-64 64l-256 0c-35.3 0-64-28.7-64-64l0-64-32 0c-17.7 0-32-14.3-32-32l0-96zM128 416l0 32 256 0 0-96-256 0 0 64zM456 272a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faVolleyball = {\n  prefix: 'fas',\n  iconName: 'volleyball',\n  icon: [512, 512, [127952, \"volleyball-ball\"], \"f45f\", \"M512 258.9c-23.4 8-47.8 13.1-72.6 15.1 5.9-98.6-30.7-191.1-94.9-258.3 97.8 36 167.5 130 167.5 240.3 0 1 0 1.9 0 2.9zm-5.9 52c-5.2 23.7-13.6 46.2-24.9 66.9-94.7 52.2-214 50-308.4-13.6 21.7-31.3 49.8-58.9 83.8-80.5 79.5 41.6 168.5 49.1 249.5 27.1zM279.7 241.6c-3.7-89.7-41.7-170.5-101.3-229.7 22.3-7.1 46-11.2 70.5-11.9 92.5 55.9 150.3 160.3 142.4 273.8-38-3.2-75.9-13.7-111.6-32.3zM130.5 32.8C149.1 49.1 165.8 67.7 179.9 88.2 91.5 132.3 29.7 210.3 3.7 299.5 1.3 285.3 0 270.8 0 256 0 160.2 52.6 76.7 130.5 32.8zm73.4 97c16.3 34.5 26.1 72.6 27.9 112.8-75.8 48-126.8 121.3-148.3 202.5-17.6-16.1-33-34.6-45.5-55 2.1-108.1 63.7-210.4 165.9-260.3zM256 512c-47.7 0-92.3-13-130.5-35.7 4.8-24.3 12.6-48 23.2-70.4 82.4 54.4 180.8 68.9 271 47-44.4 37-101.5 59.2-163.7 59.2z\"]\n};\nvar faVolleyballBall = faVolleyball;\nvar faTrafficLight = {\n  prefix: 'fas',\n  iconName: 'traffic-light',\n  icon: [320, 512, [128678], \"f637\", \"M64-32C28.7-32 0-3.3 0 32L0 384c0 88.4 71.6 160 160 160s160-71.6 160-160l0-352c0-35.3-28.7-64-64-64L64-32zm96 392c30.9 0 56 25.1 56 56s-25.1 56-56 56-56-25.1-56-56 25.1-56 56-56zm56-104a56 56 0 1 1 -112 0 56 56 0 1 1 112 0zM160 152a56 56 0 1 1 0-112 56 56 0 1 1 0 112z\"]\n};\nvar faPlaneCircleCheck = {\n  prefix: 'fas',\n  iconName: 'plane-circle-check',\n  icon: [640, 512, [], \"e555\", \"M232 24c0-30.9 25.1-56 56-56s56 25.1 56 56l0 127.3 78 71.5c-69.3 29-118 97.4-118 177.2 0 49.3 18.6 94.3 49.1 128.3L288 512 179.9 539c-10.1 2.5-19.9-5.1-19.9-15.5l0-19.8c0-4.9 2.2-9.5 6-12.5l66-52.8 0-99.7-162.9 54.3C58.7 396.4 48 388.7 48 377.8l0-43.7c0-9 3.8-17.5 10.4-23.6L232 151.3 232 24zM352 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm201.4-60.9c-7.1-5.2-17.2-3.6-22.4 3.5l-53 72.9-26.8-26.8c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c3.3 3.3 7.9 5 12.6 4.6s8.9-2.8 11.7-6.5l64-88c5.2-7.1 3.6-17.2-3.5-22.3z\"]\n};\nvar faUsers = {\n  prefix: 'fas',\n  iconName: 'users',\n  icon: [640, 512, [], \"f0c0\", \"M320 16a104 104 0 1 1 0 208 104 104 0 1 1 0-208zM96 88a72 72 0 1 1 0 144 72 72 0 1 1 0-144zM0 416c0-70.7 57.3-128 128-128 12.8 0 25.2 1.9 36.9 5.4-32.9 36.8-52.9 85.4-52.9 138.6l0 16c0 11.4 2.4 22.2 6.7 32L32 480c-17.7 0-32-14.3-32-32l0-32zm521.3 64c4.3-9.8 6.7-20.6 6.7-32l0-16c0-53.2-20-101.8-52.9-138.6 11.7-3.5 24.1-5.4 36.9-5.4 70.7 0 128 57.3 128 128l0 32c0 17.7-14.3 32-32 32l-86.7 0zM472 160a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zM160 432c0-88.4 71.6-160 160-160s160 71.6 160 160l0 16c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-16z\"]\n};\nvar faCertificate = {\n  prefix: 'fas',\n  iconName: 'certificate',\n  icon: [576, 512, [], \"f0a3\", \"M239.2-8c-6.1-6.2-15-8.7-23.4-6.4S200.9-5.6 198.8 2.8L183.5 63c-1.1 4.4-5.6 7-9.9 5.7L113.8 51.9c-8.4-2.4-17.4 0-23.5 6.1s-8.5 15.1-6.1 23.5l16.9 59.8c1.2 4.3-1.4 8.8-5.7 9.9L35.1 166.5c-8.4 2.1-15 8.7-17.3 17.1s.2 17.3 6.4 23.4l44.5 43.3c3.2 3.1 3.2 8.3 0 11.5L24.3 305.1c-6.2 6.1-8.7 15-6.4 23.4s8.9 14.9 17.3 17.1l60.2 15.3c4.4 1.1 7 5.6 5.7 9.9L84.2 430.5c-2.4 8.4 0 17.4 6.1 23.5s15.1 8.5 23.5 6.1l59.8-16.9c4.3-1.2 8.8 1.4 9.9 5.7l15.3 60.2c2.1 8.4 8.7 15 17.1 17.3s17.3-.2 23.4-6.4l43.3-44.5c3.1-3.2 8.3-3.2 11.5 0L337.3 520c6.1 6.2 15 8.7 23.4 6.4s14.9-8.9 17.1-17.3L393.1 449c1.1-4.4 5.6-7 9.9-5.7l59.8 16.9c8.4 2.4 17.4 0 23.5-6.1s8.5-15.1 6.1-23.5l-16.9-59.8c-1.2-4.3 1.4-8.8 5.7-9.9l60.2-15.3c8.4-2.1 15-8.7 17.3-17.1s-.2-17.4-6.4-23.4l-44.5-43.3c-3.2-3.1-3.2-8.3 0-11.5l44.5-43.3c6.2-6.1 8.7-15 6.4-23.4s-8.9-14.9-17.3-17.1l-60.2-15.3c-4.4-1.1-7-5.6-5.7-9.9l16.9-59.8c2.4-8.4 0-17.4-6.1-23.5s-15.1-8.5-23.5-6.1L403 68.8c-4.3 1.2-8.8-1.4-9.9-5.7L377.8 2.8c-2.1-8.4-8.7-15-17.1-17.3s-17.3 .2-23.4 6.4L294 36.5c-3.1 3.2-8.3 3.2-11.5 0L239.2-8z\"]\n};\nvar faAlarmClock = {\n  prefix: 'fas',\n  iconName: 'alarm-clock',\n  icon: [512, 512, [9200], \"f34e\", \"M504.4 132.5c-4.5 10.5-18.4 9.8-24.9 .4-27.8-40-66.1-72.2-111-92.6-10.4-4.7-13.7-18.3-4.1-24.6 15-9.9 33-15.7 52.3-15.7 52.6 0 95.2 42.6 95.2 95.2 0 13.2-2.7 25.8-7.6 37.3zm-471.9 .4c-6.5 9.4-20.5 10.1-24.9-.4-4.9-11.5-7.6-24.1-7.6-37.3 0-52.6 42.6-95.2 95.2-95.2 19.3 0 37.3 5.8 52.3 15.7 9.6 6.3 6.3 19.9-4.1 24.6-44.8 20.4-83.1 52.6-111 92.6zM390.2 467.4C352.8 495.4 306.3 512 256 512s-96.8-16.6-134.1-44.6L86.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l35.2-35.2C48.6 384.8 32 338.3 32 288 32 164.3 132.3 64 256 64S480 164.3 480 288c0 50.3-16.6 96.8-44.6 134.2l35.2 35.2c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-35.2-35.2zM280 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l56 56c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-49-49 0-94.1z\"]\n};\nvar faHelicopterSymbol = {\n  prefix: 'fas',\n  iconName: 'helicopter-symbol',\n  icon: [512, 512, [], \"e502\", \"M445.4 224l64.7 0C495.6 108.2 403.8 16.4 288 2l0 64.7C368.4 80.1 431.9 143.6 445.4 224zM510 288l-64.7 0C431.9 368.4 368.4 431.9 288 445.3l0 64.7c115.8-14.4 207.6-106.2 222-222zM2 288C16.4 403.8 108.2 495.6 224 510l0-64.7C143.6 431.9 80.2 368.4 66.7 288L2 288zm0-64l64.7 0C80.2 143.6 143.6 80.1 224 66.7L224 2C108.2 16.4 16.4 108.2 2 224zm206-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 96 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-96 0 0-64z\"]\n};\nvar faHouseChimneyCrack = {\n  prefix: 'fas',\n  iconName: 'house-chimney-crack',\n  icon: [512, 512, [\"house-damage\"], \"f6f1\", \"M234.2 8.6c12.3-11.4 31.3-11.4 43.5 0L368 92.3 368 80c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 101.5 37.8 35.1c9.6 9 12.8 22.9 8 35.1S493.2 272 480 272l-16 0 0 176c0 35.3-28.7 64-64 64l-105.6 0-38.4-64 80.8-67.3c7.8-6.5 7.6-18.6-.4-24.9L218.6 263.2c-14.6-11.5-33.8 7-22.8 22L256 368 170.5 439.2c-6.1 5-7.5 13.8-3.5 20.5l31.3 52.2-86.4 0c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208z\"]\n};\nvar faHouseDamage = faHouseChimneyCrack;\nvar faPersonMilitaryPointing = {\n  prefix: 'fas',\n  iconName: 'person-military-pointing',\n  icon: [512, 512, [], \"e54a\", \"M214.9 14.1C202 15.2 192 26 192 39 192 52.8 203.2 64 217 64l151 0c8.8 0 16-7.2 16-16l0-30.6C384 8 376 .7 366.7 1.4L214.9 14.1zM208 112c0 44.2 35.8 80 80 80s80-35.8 80-80c0-5.5-.6-10.8-1.6-16L209.6 96c-1 5.2-1.6 10.5-1.6 16zM40 224c-22.1 0-40 17.9-40 40s17.9 40 40 40l152 0 0 89.4 162.8-162.8c-13.3-4.3-27.3-6.5-41.6-6.5L40 224zm345.7 20.9l-171.1 171.1 169.4 0 0-46.3 53.6 90.6c11.2 19 35.8 25.3 54.8 14.1s25.3-35.8 14.1-54.8L430.3 290.8c-11.2-19-26.6-34.5-44.6-45.9zM192 448l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32-192 0z\"]\n};\nvar faDatabase = {\n  prefix: 'fas',\n  iconName: 'database',\n  icon: [448, 512, [], \"f1c0\", \"M448 205.8c-14.8 9.8-31.8 17.7-49.5 24-47 16.8-108.7 26.2-174.5 26.2S96.4 246.5 49.5 229.8c-17.6-6.3-34.7-14.2-49.5-24L0 288c0 44.2 100.3 80 224 80s224-35.8 224-80l0-82.2zm0-77.8l0-48C448 35.8 347.7 0 224 0S0 35.8 0 80l0 48c0 44.2 100.3 80 224 80s224-35.8 224-80zM398.5 389.8C351.6 406.5 289.9 416 224 416S96.4 406.5 49.5 389.8c-17.6-6.3-34.7-14.2-49.5-24L0 432c0 44.2 100.3 80 224 80s224-35.8 224-80l0-66.2c-14.8 9.8-31.8 17.7-49.5 24z\"]\n};\nvar faNewspaper = {\n  prefix: 'fas',\n  iconName: 'newspaper',\n  icon: [512, 512, [128240], \"f1ea\", \"M0 416L0 120c0-13.3 10.7-24 24-24s24 10.7 24 24l0 288c0 13.3 10.7 24 24 24s24-10.7 24-24L96 96c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64zM160 128l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32zm24 240c-13.3 0-24 10.7-24 24s10.7 24 24 24l240 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-240 0zm-24-72c0 13.3 10.7 24 24 24l240 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-240 0c-13.3 0-24 10.7-24 24zM360 176c-13.3 0-24 10.7-24 24s10.7 24 24 24l64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0z\"]\n};\nvar faCloudRain = {\n  prefix: 'fas',\n  iconName: 'cloud-rain',\n  icon: [512, 512, [127783, 9926], \"f73d\", \"M96 320c-53 0-96-43-96-96 0-42.5 27.6-78.6 65.9-91.2-1.3-6.7-1.9-13.7-1.9-20.8 0-61.9 50.1-112 112-112 43.1 0 80.5 24.3 99.2 60 14.7-17.1 36.5-28 60.8-28 44.2 0 80 35.8 80 80 0 5.5-.6 10.8-1.6 16 .5 0 1.1 0 1.6 0 53 0 96 43 96 96s-43 96-96 96L96 320zm1.6 68.2c1.1-2.5 3.6-4.2 6.4-4.2s5.3 1.6 6.4 4.2l30.2 68.2c2.2 5.1 3.4 10.5 3.4 16 0 21.9-18.1 39.6-40 39.6s-40-17.7-40-39.6c0-5.5 1.2-11 3.4-16l30.2-68.2zm152 0c1.1-2.5 3.6-4.2 6.4-4.2s5.3 1.6 6.4 4.2l30.2 68.2c2.2 5.1 3.4 10.5 3.4 16 0 21.9-18.1 39.6-40 39.6s-40-17.7-40-39.6c0-5.5 1.2-11 3.4-16l30.2-68.2zm121.8 68.2l30.2-68.2c1.1-2.5 3.6-4.2 6.4-4.2s5.3 1.6 6.4 4.2l30.2 68.2c2.2 5.1 3.4 10.5 3.4 16 0 21.9-18.1 39.6-40 39.6s-40-17.7-40-39.6c0-5.5 1.2-11 3.4-16z\"]\n};\nvar faMaximize = {\n  prefix: 'fas',\n  iconName: 'maximize',\n  icon: [448, 512, [\"expand-arrows-alt\"], \"f31e\", \"M168 32L24 32C10.7 32 0 42.7 0 56L0 200c0 9.7 5.8 18.5 14.8 22.2S34.1 223.8 41 217l40-40 79 79-79 79-40-40c-6.9-6.9-17.2-8.9-26.2-5.2S0 302.3 0 312L0 456c0 13.3 10.7 24 24 24l144 0c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-40-40 79-79 79 79-40 40c-6.9 6.9-8.9 17.2-5.2 26.2S270.3 480 280 480l144 0c13.3 0 24-10.7 24-24l0-144c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2l-40 40-79-79 79-79 40 40c6.9 6.9 17.2 8.9 26.2 5.2S448 209.7 448 200l0-144c0-13.3-10.7-24-24-24L280 32c-9.7 0-18.5 5.8-22.2 14.8S256.2 66.1 263 73l40 40-79 79-79-79 40-40c6.9-6.9 8.9-17.2 5.2-26.2S177.7 32 168 32z\"]\n};\nvar faExpandArrowsAlt = faMaximize;\nvar faLocationArrow = {\n  prefix: 'fas',\n  iconName: 'location-arrow',\n  icon: [512, 512, [], \"f124\", \"M477.9 75.5c4.5-11.8 1.7-25.2-7.2-34.1s-22.3-11.8-34.1-7.2l-416 160C7.9 199-.3 211.2 0 224.7s9.1 25.4 21.9 29.6l176.8 58.9 58.9 176.8c4.3 12.8 16.1 21.6 29.6 21.9s25.7-7.9 30.6-20.5l160-416z\"]\n};\nvar faCity = {\n  prefix: 'fas',\n  iconName: 'city',\n  icon: [576, 512, [127961], \"f64f\", \"M320 0c-35.3 0-64 28.7-64 64l0 32-48 0 0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-64 0 0-72C96 10.7 85.3 0 72 0S48 10.7 48 24l0 74c-27.6 7.1-48 32.2-48 62L0 448c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-64 0 0-128c0-35.3-28.7-64-64-64L320 0zm64 112l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zm-16 80c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zm16 112l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zm112-16c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zM256 304l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zM240 192c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0zM128 304l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16zM112 192c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0z\"]\n};\nvar faXRay = {\n  prefix: 'fas',\n  iconName: 'x-ray',\n  icon: [512, 512, [], \"f497\", \"M0 64C0 46.3 14.3 32 32 32l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 320c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32L32 96C14.3 96 0 81.7 0 64zm280 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16-64 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l64 0 0 48-80 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0 0 48-64 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l64 0 0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16 64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0 0-48 80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0 0-48 64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0 0-16z\"]\n};\nvar faUmbrellaBeach = {\n  prefix: 'fas',\n  iconName: 'umbrella-beach',\n  icon: [512, 512, [127958], \"f5ca\", \"M497.5 341.1c-5.9 16.7-25.3 23-41.1 15.1l-178.2-89.1-1.6 3.2-88.8 177.7 292.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l84.2 0 103.2-206.3 1.6-3.2-165.4-82.7c-15.8-7.9-22.4-27.3-12.5-42 45.9-68.6 124.1-113.8 212.9-113.8 141.4 0 256 114.6 256 256 0 29.8-5.1 58.5-14.5 85.1z\"]\n};\nvar faArrowRightToBracket = {\n  prefix: 'fas',\n  iconName: 'arrow-right-to-bracket',\n  icon: [512, 512, [\"sign-in\"], \"f090\", \"M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z\"]\n};\nvar faSignIn = faArrowRightToBracket;\nvar faHeadset = {\n  prefix: 'fas',\n  iconName: 'headset',\n  icon: [448, 512, [], \"f590\", \"M224 64c-79 0-144.7 57.3-157.7 132.7 9.3-3 19.3-4.7 29.7-4.7l16 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-16 0c-53 0-96-43-96-96l0-64C0 100.3 100.3 0 224 0S448 100.3 448 224l0 168.1c0 66.3-53.8 120-120.1 120l-87.9-.1-32 0c-26.5 0-48-21.5-48-48s21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 0 40 0c39.8 0 72-32.2 72-72l0-20.9c-14.1 8.2-30.5 12.8-48 12.8l-16 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48l16 0c10.4 0 20.3 1.6 29.7 4.7-13-75.3-78.6-132.7-157.7-132.7z\"]\n};\nvar faSplotch = {\n  prefix: 'fas',\n  iconName: 'splotch',\n  icon: [512, 512, [], \"f5bc\", \"M208.5 62.3l28.1-36.9C248.8 9.4 267.8 0 288 0 316.5 0 341.6 18.7 349.8 46l17.8 59.4c10.3 34.4 36.1 62 69.8 74.6l39.8 14.9c20.9 7.9 34.8 27.9 34.8 50.2 0 16.9-7.9 32.8-21.5 42.9l-67.3 50.5c-24.3 18.2-37.2 47.9-33.8 78.1l2.5 22.7c4.3 38.7-26 72.6-65 72.6-14.8 0-29.3-5.1-40.9-14.3l-55.3-44.3c-4.5-3.6-9.3-6.7-14.5-9.2-15.8-7.9-33.7-10.4-51-7.3L82.4 451.9c-34.6 6.3-66.4-20.3-66.4-55.4 0-13.2 4.7-26 13.1-36.2l11.2-13.4c14.6-17.4 22.6-39.4 22.6-62.1 0-18.8-5.5-37.2-15.8-53L8.8 173.5C3.1 164.7 0 154.4 0 143.9 0 110.5 30.1 85.1 63 90.7l51.3 8.7c35.9 6.1 72.2-8.2 94.2-37.1z\"]\n};\nvar faUpLong = {\n  prefix: 'fas',\n  iconName: 'up-long',\n  icon: [320, 512, [\"long-arrow-alt-up\"], \"f30c\", \"M137.4-22.6c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9S300.9 160 288 160l-64 0 0 336c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-336-64 0c-12.9 0-24.6-7.8-29.6-19.8S.2 114.5 9.4 105.4l128-128z\"]\n};\nvar faLongArrowAltUp = faUpLong;\nvar faHexagonNodes = {\n  prefix: 'fas',\n  iconName: 'hexagon-nodes',\n  icon: [448, 512, [], \"e699\", \"M248 106.6c18.9-9 32-28.3 32-50.6c0-30.9-25.1-56-56-56s-56 25.1-56 56c0 22.3 13.1 41.6 32 50.6l0 98.8c-2.8 1.3-5.5 2.9-8 4.7l-80.1-45.8c1.6-20.8-8.6-41.6-27.9-52.8C57.2 96 23 105.2 7.5 132S1.2 193 28 208.5c1.3 .8 2.6 1.5 4 2.1l0 90.8c-1.3 .6-2.7 1.3-4 2.1C1.2 319-8 353.2 7.5 380S57.2 416 84 400.5c19.3-11.1 29.4-32 27.8-52.8l50.5-28.9c-11.5-11.2-19.9-25.6-23.8-41.7L88 306.1c-2.6-1.8-5.2-3.3-8-4.7l0-90.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-.1 1.4-.2 2.8-.2 4.3c0 22.3 13.1 41.6 32 50.6l0 98.8c-18.9 9-32 28.3-32 50.6c0 30.9 25.1 56 56 56s56-25.1 56-56c0-22.3-13.1-41.6-32-50.6l0-98.8c2.8-1.3 5.5-2.9 8-4.7l80.1 45.8c-1.6 20.8 8.6 41.6 27.8 52.8c26.8 15.5 61 6.3 76.5-20.5s6.3-61-20.5-76.5c-1.3-.8-2.7-1.5-4-2.1l0-90.8c1.4-.6 2.7-1.3 4-2.1c26.8-15.5 36-49.7 20.5-76.5S390.8 96 364 111.5c-19.3 11.1-29.4 32-27.8 52.8l-50.6 28.9c11.5 11.2 19.9 25.6 23.8 41.7L360 205.9c2.6 1.8 5.2 3.3 8 4.7l0 90.8c-2.8 1.3-5.5 2.9-8 4.6l-80.1-45.8c.1-1.4 .2-2.8 .2-4.3c0-22.3-13.1-41.6-32-50.6l0-98.8z\"]\n};\nvar faHospital = {\n  prefix: 'fas',\n  iconName: 'hospital',\n  icon: [576, 512, [127973, 62589, \"hospital-alt\", \"hospital-wide\"], \"f0f8\", \"M128 64c0-35.3 28.7-64 64-64L384 0c35.3 0 64 28.7 64 64l0 64 64 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64l64 0 0-64zM272 352c-17.7 0-32 14.3-32 32l0 80 96 0 0-80c0-17.7-14.3-32-32-32l-32 0zM128 368l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM112 256c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0zM512 368l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM496 256c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0zM264 104l0 32-32 0c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l32 0 0 32c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-32 32 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-32 0 0-32c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z\"]\n};\nvar faHospitalAlt = faHospital;\nvar faHospitalWide = faHospital;\nvar faPersonHarassing = {\n  prefix: 'fas',\n  iconName: 'person-harassing',\n  icon: [576, 512, [], \"e549\", \"M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM59.4 304.5L88 256.9 88 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-244.7 47.4 57.1c11.3 13.6 31.5 15.5 45.1 4.2s15.5-31.5 4.2-45.1l-73.7-88.9c-18.2-22-45.3-34.7-73.9-34.7l-35.9 0c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9zM480 240a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM464 344l0 58.7-41.4-41.4c-7.3-7.3-17.6-10.6-27.8-9s-18.9 8.1-23.5 17.3l-48 96c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l28.1-56.3 54.7 54.7c12.4 12.4 29.1 19.3 46.6 19.3 36.4 0 65.9-29.5 65.9-65.9L576 344c0-30.9-25.1-56-56-56s-56 25.1-56 56zM288 48c0 8.8 7.2 16 16 16l56 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-56 0c-8.8 0-16 7.2-16 16zm-.8 49.7c-7.9-4-17.5-.7-21.5 7.2s-.7 17.5 7.2 21.5l48 24c7.9 4 17.5 .7 21.5-7.2s.7-17.5-7.2-21.5l-48-24z\"]\n};\nvar faMoneyBillTrendUp = {\n  prefix: 'fas',\n  iconName: 'money-bill-trend-up',\n  icon: [512, 512, [], \"e529\", \"M480 8c0-13.3-10.7-24-24-24L354.2-16c-13.3 0-24 10.7-24 24s10.7 24 24 24l43.9 0-111.3 111.3-95.1-81.5c-9-7.7-22.2-7.7-31.2 0l-112 96c-10.1 8.6-11.2 23.8-2.6 33.8s23.8 11.2 33.8 2.6l96.4-82.6 96.4 82.6c9.5 8.2 23.7 7.6 32.6-1.3l127-127 0 43.9c0 13.3 10.7 24 24 24s24-10.7 24-24L480 8zM48 256c-26.5 0-48 21.5-48 48L0 464c0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48l0-160c0-26.5-21.5-48-48-48L48 256zm47.3 56c-3.4 20.1-19.2 36-39.4 39.4-4.4 .7-8-2.9-8-7.3l0-32c0-4.4 3.6-8 8-8l32 0c4.4 0 8.1 3.6 7.3 8zm0 144.1c.7 4.4-2.9 8-7.3 8l-32 0c-4.4 0-8-3.6-8-8l0-32c0-4.4 3.6-8.1 8-7.3 20.1 3.4 36 19.2 39.4 39.4zM456 416.7c4.4-.7 8 2.9 8 7.3l0 32c0 4.4-3.6 8-8 8l-32 0c-4.4 0-8.1-3.6-7.3-8 3.4-20.1 19.2-36 39.4-39.4zM416.7 312c-.7-4.4 2.9-8 7.3-8l32 0c4.4 0 8 3.6 8 8l0 32c0 4.4-3.6 8.1-8 7.3-20.1-3.4-36-19.2-39.4-39.4zM192 384a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z\"]\n};\nvar faPenRuler = {\n  prefix: 'fas',\n  iconName: 'pen-ruler',\n  icon: [512, 512, [\"pencil-ruler\"], \"f5ae\", \"M404 0c19.2 0 37.6 7.6 51.1 21.2l35.7 35.7C504.4 70.4 512 88.8 512 108s-7.6 37.6-21.2 51.1L445.9 204 308 66.1 352.9 21.2C366.4 7.6 384.8 0 404 0zM58.9 315.1L274.1 100 412 237.9 196.9 453.1c-10.7 10.7-24.1 18.5-38.7 22.6L30.4 511.1c-8.3 2.3-17.3 0-23.4-6.2s-8.5-15.1-6.2-23.4L36.4 353.8c4.1-14.6 11.8-27.9 22.6-38.7zM225.4 80.8L80.8 225.4 11.7 156.3c-15.6-15.6-15.6-40.9 0-56.6l88-88c15.6-15.6 40.9-15.6 56.6 0l5.9 5.9-56.3 56.3c-7.8 7.8-7.8 20.5 0 28.3s20.5 7.8 28.3 0l56.3-56.3 34.9 34.9zM431.2 286.6l34.9 34.9-56.3 56.3c-7.8 7.8-7.8 20.5 0 28.3s20.5 7.8 28.3 0l56.3-56.3 5.9 5.9c15.6 15.6 15.6 40.9 0 56.6l-88 88c-15.6 15.6-40.9 15.6-56.6 0l-69.1-69.1 144.6-144.6z\"]\n};\nvar faPencilRuler = faPenRuler;\nvar faRepeat = {\n  prefix: 'fas',\n  iconName: 'repeat',\n  icon: [512, 512, [128257], \"f363\", \"M470.6 118.6c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9S352 19.1 352 32l0 32-160 0C86 64 0 150 0 256 0 273.7 14.3 288 32 288s32-14.3 32-32c0-70.7 57.3-128 128-128l160 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64zM41.4 393.4c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9S160 492.9 160 480l0-32 160 0c106 0 192-86 192-192 0-17.7-14.3-32-32-32s-32 14.3-32 32c0 70.7-57.3 128-128 128l-160 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64z\"]\n};\nvar faBone = {\n  prefix: 'fas',\n  iconName: 'bone',\n  icon: [640, 512, [129460], \"f5d7\", \"M197.4 160c-3.9 0-7.2-2.8-8.1-6.6-10.2-42.1-48.1-73.4-93.3-73.4-53 0-96 43-96 96 0 29.1 12.9 55.1 33.3 72.7 4.3 3.7 4.3 10.8 0 14.5-20.4 17.6-33.3 43.7-33.3 72.7 0 53 43 96 96 96 45.2 0 83.1-31.3 93.3-73.4 .9-3.8 4.2-6.6 8.1-6.6l245.1 0c3.9 0 7.2 2.8 8.1 6.6 10.2 42.1 48.1 73.4 93.3 73.4 53 0 96-43 96-96 0-29.1-12.9-55.1-33.3-72.7-4.3-3.7-4.3-10.8 0-14.5 20.4-17.6 33.3-43.7 33.3-72.7 0-53-43-96-96-96-45.2 0-83.1 31.3-93.3 73.4-.9 3.8-4.2 6.6-8.1 6.6l-245.1 0z\"]\n};\nvar faFireFlameCurved = {\n  prefix: 'fas',\n  iconName: 'fire-flame-curved',\n  icon: [384, 512, [\"fire-alt\"], \"f7e4\", \"M153.6 29.9l16-21.3C173.6 3.2 180 0 186.7 0 198.4 0 208 9.6 208 21.3l0 22.1c0 13.1 5.4 25.7 14.9 34.7L307.6 159C356.4 205.6 384 270.2 384 337.7 384 434 306 512 209.7 512L192 512C86 512 0 426 0 320l0-3.8c0-48.8 19.4-95.6 53.9-130.1l3.5-3.5c4.2-4.2 10-6.6 16-6.6 12.5 0 22.6 10.1 22.6 22.6L96 288c0 35.3 28.7 64 64 64s64-28.7 64-64l0-3.9c0-18-7.2-35.3-19.9-48l-38.6-38.6c-24-24-37.5-56.7-37.5-90.7 0-27.7 9-54.8 25.6-76.9z\"]\n};\nvar faFireAlt = faFireFlameCurved;\nvar faBusSimple = {\n  prefix: 'fas',\n  iconName: 'bus-simple',\n  icon: [448, 512, [\"bus-alt\"], \"f55e\", \"M96 0C43 0 0 43 0 96L0 384c0 29.8 20.4 54.9 48 62l0 34c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-32 192 0 0 32c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-34c27.6-7.1 48-32.2 48-62l0-288c0-53-43-96-96-96L96 0zM64 128c0-17.7 14.3-32 32-32l256 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32L96 256c-17.7 0-32-14.3-32-32l0-96zM96 320a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm256 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faBusAlt = faBusSimple;\nvar faVenusMars = {\n  prefix: 'fas',\n  iconName: 'venus-mars',\n  icon: [640, 512, [9892], \"f228\", \"M480-64c-17.7 0-32 14.3-32 32S462.3 0 480 0L530.7 0 474 56.7c-26.3-15.7-57.1-24.7-90-24.7-35.4 0-68.4 10.5-96 28.5-27.6-18-60.6-28.5-96-28.5-97.2 0-176 78.8-176 176 0 86.3 62.1 158.1 144 173.1l0 34.9-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-34.9c23.3-4.3 44.9-13.1 64-25.6 27.6 18 60.6 28.5 96 28.5 97.2 0 176-78.8 176-176 0-41.1-14.1-79-37.8-109L576 45.3 576 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L480-64zM336 309.2c20.2-28.6 32-63.5 32-101.2s-11.8-72.6-32-101.2c14.6-6.9 30.8-10.8 48-10.8 61.9 0 112 50.1 112 112S445.9 320 384 320c-17.2 0-33.5-3.9-48-10.8zM288 150.3c10.2 16.9 16 36.6 16 57.7s-5.8 40.9-16 57.7c-10.2-16.9-16-36.6-16-57.7s5.8-40.9 16-57.7zm-48-43.5c-20.2 28.6-32 63.5-32 101.2s11.8 72.6 32 101.2c-14.5 6.9-30.8 10.8-48 10.8-61.9 0-112-50.1-112-112S130.1 96 192 96c17.2 0 33.5 3.9 48 10.8z\"]\n};\nvar faBlender = {\n  prefix: 'fas',\n  iconName: 'blender',\n  icon: [512, 512, [], \"f517\", \"M0 56C0 25.1 25.1 0 56 0L437.6 0c21.3 0 36.6 20.3 30.8 40.8L457.1 80 344 80c-13.3 0-24 10.7-24 24s10.7 24 24 24l99.4 0-18.3 64-81.1 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l67.4 0-27.4 96-256 0-9.1-96-62.9 0c-30.9 0-56-25.1-56-56L0 56zM114.3 192L100.6 48 56 48c-4.4 0-8 3.6-8 8l0 128c0 4.4 3.6 8 8 8l58.3 0zM136 384l240 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-240 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm120 88a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faU = {\n  prefix: 'fas',\n  iconName: 'u',\n  icon: [384, 512, [117], \"55\", \"M32 32c17.7 0 32 14.3 32 32l0 224c0 70.7 57.3 128 128 128s128-57.3 128-128l0-224c0-17.7 14.3-32 32-32s32 14.3 32 32l0 224c0 106-86 192-192 192S0 394 0 288L0 64C0 46.3 14.3 32 32 32z\"]\n};\nvar faShare = {\n  prefix: 'fas',\n  iconName: 'share',\n  icon: [512, 512, [\"mail-forward\"], \"f064\", \"M307.8 18.4c-12 5-19.8 16.6-19.8 29.6l0 80-112 0c-97.2 0-176 78.8-176 176 0 113.3 81.5 163.9 100.2 174.1 2.5 1.4 5.3 1.9 8.1 1.9 10.9 0 19.7-8.9 19.7-19.7 0-7.5-4.3-14.4-9.8-19.5-9.4-8.8-22.2-26.4-22.2-56.7 0-53 43-96 96-96l96 0 0 80c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-9.2-9.2-22.9-11.9-34.9-6.9z\"]\n};\nvar faMailForward = faShare;\nvar faPhoneFlip = {\n  prefix: 'fas',\n  iconName: 'phone-flip',\n  icon: [512, 512, [128381, \"phone-alt\"], \"f879\", \"M351.8 25c7.8-18.8 28.4-28.9 48.1-23.5l5.5 1.5c64.6 17.6 119.8 80.2 103.7 156.4-37.1 175-174.8 312.7-349.8 349.8-76.3 16.2-138.8-39.1-156.4-103.7l-1.5-5.5c-5.4-19.7 4.7-40.3 23.5-48.1l97.3-40.5c16.5-6.9 35.6-2.1 47 11.8l38.6 47.2c70.3-34.9 126.8-93.3 159.3-164.9l-44.1-36.1c-13.9-11.3-18.6-30.4-11.8-47L351.8 25z\"]\n};\nvar faPhoneAlt = faPhoneFlip;\nvar faToiletPortable = {\n  prefix: 'fas',\n  iconName: 'toilet-portable',\n  icon: [320, 512, [], \"e583\", \"M0 64l0 16 320 0 0-16c0-35.3-28.7-64-64-64L64 0C28.7 0 0 28.7 0 64zm24 64L0 128 0 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8 224 0 0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-360-296 0zm224 96l24 0 0 96-24 0c-13.3 0-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24z\"]\n};\nvar faPersonPregnant = {\n  prefix: 'fas',\n  iconName: 'person-pregnant',\n  icon: [384, 512, [], \"e31e\", \"M192 80a56 56 0 1 0 0-112 56 56 0 1 0 0 112zm80 321.2c8.6-4.5 16.8-10 24.3-16.5l4-3.4c22.6-19.4 35.7-47.7 35.7-77.6 0-35.9-18.8-69.1-49.6-87.6l-30.4-18.2 0-1.8c0-46.5-37.7-84.1-84.1-84.1-28.1 0-54.4 14.1-70 37.5L21.4 270.2c-9.8 14.7-5.8 34.6 8.9 44.4s34.6 5.8 44.4-8.9l29-43.5-30.5 113.5c-2.6 9.6-.6 19.9 5.5 27.8S94 416 104 416l8 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-110.8z\"]\n};\nvar faLessThan = {\n  prefix: 'fas',\n  iconName: 'less-than',\n  icon: [512, 512, [62774], \"3c\", \"M477.1 50.6c7.4 16 .4 35.1-15.6 42.5L108.4 256 461.4 419c16 7.4 23 26.4 15.6 42.5s-26.4 23-42.5 15.6l-416-192C7.3 279.8 0 268.5 0 256S7.3 232.2 18.6 227l416-192c16-7.4 35.1-.4 42.5 15.6z\"]\n};\nvar faSuperscript = {\n  prefix: 'fas',\n  iconName: 'superscript',\n  icon: [576, 512, [], \"f12b\", \"M544 32c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16C449.9 27.3 443.5 46.5 451.4 62.3 457 73.5 468.3 80 480 80l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128zM96 64C78.3 64 64 78.3 64 96s14.3 32 32 32l15.3 0 89.6 128-89.6 128-15.3 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L240 311.8 325.8 434.4c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0-89.6-128 89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L240 200.2 154.2 77.6C148.2 69.1 138.4 64 128 64L96 64z\"]\n};\nvar faCircleStop = {\n  prefix: 'fas',\n  iconName: 'circle-stop',\n  icon: [512, 512, [62094, \"stop-circle\"], \"f28d\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM192 160l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z\"]\n};\nvar faStopCircle = faCircleStop;\nvar faArrowsUpDown = {\n  prefix: 'fas',\n  iconName: 'arrows-up-down',\n  icon: [256, 512, [\"arrows-v\"], \"f07d\", \"M150.6-22.6c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 77.3 96 434.7 54.6 393.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c6 6 14.1 9.4 22.6 9.4s16.6-3.4 22.6-9.4l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-41.4 41.4 0-357.5 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z\"]\n};\nvar faArrowsV = faArrowsUpDown;\nvar faPooStorm = {\n  prefix: 'fas',\n  iconName: 'poo-storm',\n  icon: [512, 512, [\"poo-bolt\"], \"f75a\", \"M268.9-31.8c-5.5-.7-11 1.4-14.5 5.7s-4.6 10.1-2.8 15.3c2.8 8.2 4.3 16.9 4.3 26.1 0 21.7-8.5 37.2-21.9 47.6-13.9 10.8-34.1 17-58.1 17l-24 0c-48.6 0-88 39.4-88 88 0 14.8 3.7 28.8 10.2 41.1-42 6.6-74.2 43-74.2 86.9 0 46.6 36.2 84.7 81.9 87.8 3.1-12.4 9.9-23.8 19.6-32.5L242.7 225c12.2-10.9 28-17 44.4-17 44.6 0 76.5 43 63.7 85.7l-12.7 42.4c28.8 1.2 52.7 21.1 59.8 47.9l26.2 0c48.6 0 88-39.4 88-88 0-43.9-32.1-80.3-74.2-86.9 6.5-12.3 10.2-26.2 10.2-41.1 0-48.6-39.4-88-88-88l-9.4 0c.9-5.4 1.4-10.9 1.4-16.6 0-48.7-36.1-88.9-83.1-95.2zM144.6 416l61.8 0-31.2 104.1c-3.6 11.9 5.3 23.9 17.8 23.9 4.6 0 9-1.7 12.4-4.7L346.5 412.9c3.5-3.1 5.5-7.6 5.5-12.4 0-9.2-7.4-16.6-16.6-16.6l-61.8 0 31.2-104.1c3.6-11.9-5.3-23.9-17.8-23.9-4.6 0-9 1.7-12.4 4.7L133.5 387.1c-3.5 3.1-5.5 7.6-5.5 12.4 0 9.2 7.4 16.6 16.6 16.6z\"]\n};\nvar faPooBolt = faPooStorm;\nvar faVideoSlash = {\n  prefix: 'fas',\n  iconName: 'video-slash',\n  icon: [576, 512, [], \"f4e2\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-153-153 0-222.2c0-35.3-28.7-64-64-64L129.8 64 41-24.9zM32 128l0 256c0 35.3 28.7 64 64 64l256 0c7.8 0 15.3-1.4 22.2-4L36 105.8c-2.6 6.9-4 14.4-4 22.2zM464 336l73.5 58.8c4.2 3.4 9.4 5.2 14.8 5.2 13.1 0 23.7-10.6 23.7-23.7l0-240.6c0-13.1-10.6-23.7-23.7-23.7-5.4 0-10.6 1.8-14.8 5.2L464 176 464 336z\"]\n};\nvar faSquareXmark = {\n  prefix: 'fas',\n  iconName: 'square-xmark',\n  icon: [448, 512, [10062, \"times-square\", \"xmark-square\"], \"f2d3\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm71 135c9.4-9.4 24.6-9.4 33.9 0l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9z\"]\n};\nvar faTimesSquare = faSquareXmark;\nvar faXmarkSquare = faSquareXmark;\nvar faHandHoldingDroplet = {\n  prefix: 'fas',\n  iconName: 'hand-holding-droplet',\n  icon: [576, 512, [\"hand-holding-water\"], \"f4c1\", \"M275.5 6.6L209.2 103C198 119.3 192 138.6 192 158.3l0 1.7c0 53 43 96 96 96s96-43 96-96l0-1.7c0-19.8-6-39-17.2-55.3L300.5 6.6C297.7 2.5 293 0 288 0s-9.7 2.5-12.5 6.6zM109.3 341.5L66.7 384 32 384c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l320.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416 280 416c-13.3 0-24-10.7-24-24s10.7-24 24-24l72 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-152.2 0c-33.9 0-66.5 13.5-90.5 37.5z\"]\n};\nvar faHandHoldingWater = faHandHoldingDroplet;\nvar faWonSign = {\n  prefix: 'fas',\n  iconName: 'won-sign',\n  icon: [512, 512, [8361, \"krw\", \"won\"], \"f159\", \"M62.4 53.9C56.8 37.1 38.7 28.1 21.9 33.6S-3.9 57.4 1.7 74.1L56.9 240 32 240c-13.3 0-24 10.7-24 24s10.7 24 24 24l40.9 0 56.7 170.1c4.5 13.5 17.4 22.4 31.6 21.9s26.4-10.4 29.8-24.2L233 288 279 288 321 455.8c3.4 13.8 15.6 23.7 29.8 24.2s27.1-8.4 31.6-21.9L439.1 288 480 288c13.3 0 24-10.7 24-24s-10.7-24-24-24l-24.9 0 55.3-165.9c5.6-16.8-3.5-34.9-20.2-40.5s-34.9 3.5-40.5 20.2l-62 186.1-54.6 0-45.9-183.8C283.5 42 270.7 32 256 32s-27.5 10-31 24.2L179 240 124.4 240 62.4 53.9zm78 234.1l26.6 0-11.4 45.6-15.2-45.6zM245 240l11-44.1 11 44.1-22 0zm100 48l26.6 0-15.2 45.6-11.4-45.6z\"]\n};\nvar faKrw = faWonSign;\nvar faWon = faWonSign;\nvar faObjectUngroup = {\n  prefix: 'fas',\n  iconName: 'object-ungroup',\n  icon: [640, 512, [], \"f248\", \"M32 119.4C12.9 108.4 0 87.7 0 64 0 28.7 28.7 0 64 0 87.7 0 108.4 12.9 119.4 32l209.1 0c11.1-19.1 31.7-32 55.4-32 35.3 0 64 28.7 64 64 0 23.7-12.9 44.4-32 55.4l0 113.1c19.1 11.1 32 31.7 32 55.4 0 35.3-28.7 64-64 64-23.7 0-44.4-12.9-55.4-32l-209.1 0c-11.1 19.1-31.7 32-55.4 32-35.3 0-64-28.7-64-64 0-23.7 12.9-44.4 32-55.4l0-113.1zM119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4l0 113.1c9.7 5.6 17.8 13.7 23.4 23.4l209.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-113.1c-9.7-5.6-17.8-13.7-23.4-23.4L119.4 96zM544 279.4c-9.7-5.6-17.8-13.7-23.4-23.4l-29.2 0c-5.3-17.7-14.8-33.5-27.4-46.4l0-17.6 56.6 0c11.1-19.1 31.7-32 55.4-32 35.3 0 64 28.7 64 64 0 23.7-12.9 44.4-32 55.4l0 113.1c19.1 11.1 32 31.7 32 55.4 0 35.3-28.7 64-64 64-23.7 0-44.4-12.9-55.4-32l-209.1 0c-11.1 19.1-31.7 32-55.4 32-35.3 0-64-28.7-64-64 0-23.7 12.9-44.4 32-55.4l0-24.6 64 0 0 24.6c9.7 5.6 17.8 13.7 23.4 23.4l209.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-113.1z\"]\n};\nvar faComment = {\n  prefix: 'fas',\n  iconName: 'comment',\n  icon: [512, 512, [128489, 61669], \"f075\", \"M512 240c0 132.5-114.6 240-256 240-37.1 0-72.3-7.4-104.1-20.7L33.5 510.1c-9.4 4-20.2 1.7-27.1-5.8S-2 485.8 2.8 476.8l48.8-92.2C19.2 344.3 0 294.3 0 240 0 107.5 114.6 0 256 0S512 107.5 512 240z\"]\n};\nvar faHillAvalanche = {\n  prefix: 'fas',\n  iconName: 'hill-avalanche',\n  icon: [576, 512, [], \"e507\", \"M440.1 401.9c34.2 23.1 81.1 19.5 111.4-10.8 34.4-34.4 34.4-90.1 0-124.5-27.8-27.8-69.5-33.1-102.6-16-11.8 6.1-16.4 20.6-10.3 32.3s20.6 16.4 32.3 10.3c15.1-7.8 34-5.3 46.6 7.3 15.6 15.6 15.6 40.9 0 56.6s-40.9 15.6-56.6 0l-81.7-81.7c22.3-14.2 37.1-39.1 37.1-67.5 0-33.9-21.1-62.9-50.9-74.5 1.9-6.8 2.9-14 2.9-21.5 0-44.2-35.8-80-80-80-27.3 0-51.5 13.7-65.9 34.6-5.8-20-24.2-34.6-46.1-34.6-26.5 0-48 21.5-48 48 0 4 .5 7.9 1.4 11.6L440.1 401.9zM480.4 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM68.7 87C43.5 61.8 .4 79.7 .4 115.3L.4 432c0 44.2 35.8 80 80 80l316.7 0c35.6 0 53.5-43.1 28.3-68.3L68.7 87z\"]\n};\nvar faArrowsToEye = {\n  prefix: 'fas',\n  iconName: 'arrows-to-eye',\n  icon: [640, 512, [], \"e4bf\", \"M176 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 38.1-63-63c-9.4-9.4-24.6-9.4-33.9 0S21.7 55.6 31 65l63 63-38.1 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l96 0c13.3 0 24-10.7 24-24l0-96zm0 400l0-96c0-13.3-10.7-24-24-24l-96 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l38.1 0-63 63c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l63-63 0 38.1c0 13.3 10.7 24 24 24s24-10.7 24-24zm312 24c13.3 0 24-10.7 24-24l0-38.1 63 63c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-63-63 38.1 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-96 0c-13.3 0-24 10.7-24 24l0 96c0 13.3 10.7 24 24 24zM464 56l0 96c0 13.3 10.7 24 24 24l96 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-38.1 0 63-63c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-63 63 0-38.1c0-13.3-10.7-24-24-24s-24 10.7-24 24zM320 120c-57.3 0-99.4 34-125.6 64.3-20 23.1-32.4 45.8-37.6 56.1-2.5 5-4.9 9.7-4.9 15.6s2.3 10.6 4.9 15.6c5.2 10.3 17.6 33 37.6 56.1 26.2 30.3 68.2 64.3 125.6 64.3s99.4-34 125.6-64.3c20-23.1 32.4-45.8 37.6-56.1 2.5-5 4.9-9.7 4.9-15.6s-2.3-10.6-4.9-15.6c-5.2-10.3-17.6-33-37.6-56.1-26.2-30.3-68.2-64.3-125.6-64.3zM256 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z\"]\n};\nvar faSnowplow = {\n  prefix: 'fas',\n  iconName: 'snowplow',\n  icon: [640, 512, [], \"f7d2\", \"M128 160l0-96c0-35.3 28.7-64 64-64L296.4 0c24.2 0 46.4 13.7 57.2 35.4l87.6 175.1c4.4 8.9 6.8 18.7 6.8 28.6l0 56.9 80 0 0-80c0-48.6 39.4-88 88-88 13.3 0 24 10.7 24 24s-10.7 24-24 24c-22.1 0-40 17.9-40 40l0 208c0 22.1 17.9 40 40 40 13.3 0 24 10.7 24 24s-10.7 24-24 24c-48.6 0-88-39.4-88-88l0-80-63 0c9.5 16.5 15 35.6 15 56 0 61.9-50.1 112-112 112l-224 0c-61.9 0-112-50.1-112-112 0-30.5 12.2-58.2 32-78.4L64 224c0-35.3 28.7-64 64-64zm91.7 34.9l43.6 29.1 113.2 0-80-160-104.4 0 0 108.8 27.7 22.1zM416 400c0-26.5-21.5-48-48-48l-224 0c-26.5 0-48 21.5-48 48s21.5 48 48 48l224 0c26.5 0 48-21.5 48-48zm-280 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm216-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM232 400a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faChartGantt = {\n  prefix: 'fas',\n  iconName: 'chart-gantt',\n  icon: [512, 512, [], \"e0e4\", \"M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0zm64 112c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-128 0zM384 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0z\"]\n};\nvar faVideo = {\n  prefix: 'fas',\n  iconName: 'video',\n  icon: [576, 512, [\"video-camera\"], \"f03d\", \"M96 64c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L96 64zM464 336l73.5 58.8c4.2 3.4 9.4 5.2 14.8 5.2 13.1 0 23.7-10.6 23.7-23.7l0-240.6c0-13.1-10.6-23.7-23.7-23.7-5.4 0-10.6 1.8-14.8 5.2L464 176 464 336z\"]\n};\nvar faVideoCamera = faVideo;\nvar faChessPawn = {\n  prefix: 'fas',\n  iconName: 'chess-pawn',\n  icon: [384, 512, [9823], \"f443\", \"M192-32c66.3 0 120 53.7 120 120 0 27-8.9 51.9-24 72 17.7 0 32 14.3 32 32s-14.3 32-32 32l-10.7 0 26.7 160 56.2 70.3c5 6.3 7.8 14.1 7.8 22.2 0 19.6-15.9 35.5-35.5 35.5L51.5 512c-19.6 0-35.5-15.9-35.5-35.5 0-8.1 2.7-15.9 7.8-22.2L80 384 106.7 224 96 224c-17.7 0-32-14.3-32-32s14.3-32 32-32c-15.1-20.1-24-45-24-72 0-66.3 53.7-120 120-120z\"]\n};\nvar faSynagogue = {\n  prefix: 'fas',\n  iconName: 'synagogue',\n  icon: [576, 512, [128333], \"f69b\", \"M16 80c0-35.3 28.7-64 64-64s64 28.7 64 64l0 32-128 0 0-32zm0 368l0-288 128 0 126.2-84.2c10.7-7.2 24.8-7.2 35.5 0l126.2 84.2 128 0 0 288c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64zM560 112l-128 0 0-32c0-35.3 28.7-64 64-64s64 28.7 64 64l0 32zM224 384l0 80 128 0 0-80c0-35.3-28.7-64-64-64s-64 28.7-64 64zm64-152a40 40 0 1 0 0-80 40 40 0 1 0 0 80z\"]\n};\nvar faBuildingCircleCheck = {\n  prefix: 'fas',\n  iconName: 'building-circle-check',\n  icon: [576, 512, [], \"e4d2\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-10.5-14.6-19-30.7-25.1-48l-74.9 0 0-80c0-17.7 14.3-32 32-32l32 0c2 0 4 .2 5.9 .5 6-23.6 16.3-45.4 30.1-64.5l-4 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 4c27.5-19.8 60.3-32.4 96-35.4L416 64c0-35.3-28.7-64-64-64L96 0zm32 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM128 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM576 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-86.6-60.9c7.1 5.2 8.7 15.2 3.5 22.3l-64 88c-2.8 3.8-7 6.2-11.7 6.5s-9.3-1.3-12.6-4.6l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l26.8 26.8 53-72.9c5.2-7.1 15.2-8.7 22.4-3.5z\"]\n};\nvar faCalendarPlus = {\n  prefix: 'fas',\n  iconName: 'calendar-plus',\n  icon: [448, 512, [], \"f271\", \"M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zm96 192c-13.3 0-24 10.7-24 24l0 48-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0 0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48 48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-48c0-13.3-10.7-24-24-24z\"]\n};\nvar faWheelchairMove = {\n  prefix: 'fas',\n  iconName: 'wheelchair-move',\n  icon: [448, 512, [\"wheelchair-alt\"], \"e2ce\", \"M312 56a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM205.4 124.1c-6.4-5.2-15.6-4.7-21.4 1.1l-33.4 33.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L138.8 80c29-29 75.2-31.4 107-5.5l81.3 66c21.4 17.4 23.8 49.2 5.2 69.5l-41.8 46 98 0c30.3 0 53 27.7 47.1 57.4L407.4 454.3c-3.5 17.3-20.3 28.6-37.7 25.1s-28.6-20.3-25.1-37.7L369 320 316.8 320c2.1 10.3 3.2 21 3.2 32 0 88.4-71.6 160-160 160S0 440.4 0 352 71.6 192 160 192c6 0 11.9 .3 17.8 1l50.4-50.4-22.7-18.5zM160 448a96 96 0 1 0 0-192 96 96 0 1 0 0 192z\"]\n};\nvar faWheelchairAlt = faWheelchairMove;\nvar faUserShield = {\n  prefix: 'fas',\n  iconName: 'user-shield',\n  icon: [576, 512, [], \"f505\", \"M224 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56C95.8 304 16 383.8 16 482.3 16 498.7 29.3 512 45.7 512l251.5 0C261 469.4 240 414.5 240 356.4l0-31.1c0-7.3 1-14.5 2.9-21.3l-48.6 0zm251 184.5l-13.3 6.3 0-188.1 96 32 0 19.6c0 55.8-32.2 106.5-82.7 130.3zM421.9 259.5l-112 37.3c-13.1 4.4-21.9 16.6-21.9 30.4l0 31.1c0 74.4 43 142.1 110.2 173.7l18.5 8.7c4.8 2.2 10 3.4 15.2 3.4s10.5-1.2 15.2-3.4l18.5-8.7C533 500.3 576 432.6 576 358.2l0-31.1c0-13.8-8.8-26-21.9-30.4l-112-37.3c-6.6-2.2-13.7-2.2-20.2 0z\"]\n};\nvar faBold = {\n  prefix: 'fas',\n  iconName: 'bold',\n  icon: [384, 512, [], \"f032\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l32 0 0 320-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0c70.7 0 128-57.3 128-128 0-46.5-24.8-87.3-62-109.7 18.7-22.3 30-51 30-82.3 0-70.7-57.3-128-128-128L32 32zM288 160c0 35.3-28.7 64-64 64l-96 0 0-128 96 0c35.3 0 64 28.7 64 64zM128 416l0-128 128 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-128 0z\"]\n};\nvar faHeartPulse = {\n  prefix: 'fas',\n  iconName: 'heart-pulse',\n  icon: [512, 512, [\"heartbeat\"], \"f21e\", \"M256 107.9L241 87.1C216 52.5 175.9 32 133.1 32 59.6 32 0 91.6 0 165.1l0 2.6c0 23.6 6.2 48 16.6 72.3l106 0c3.2 0 6.1-1.9 7.4-4.9l31.8-76.3c3.7-8.8 12.3-14.6 21.8-14.8s18.3 5.4 22.2 14.1l51.3 113.9 41.4-82.8c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3l23.2 46.3c1.4 2.7 4.1 4.4 7.2 4.4l123.6 0c10.5-24.3 16.6-48.7 16.6-72.3l0-2.6C512 91.6 452.4 32 378.9 32 336.2 32 296 52.5 271 87.1l-15 20.7zM469.6 288l-97.8 0c-21.2 0-40.6-12-50.1-31l-1.7-3.4-42.5 85.1c-4.1 8.3-12.7 13.5-22 13.3s-17.6-5.7-21.4-14.1l-49.3-109.5-10.5 25.2c-8.7 20.9-29.1 34.5-51.7 34.5l-80.2 0c47.2 73.8 123 141.7 170.4 177.9 12.4 9.4 27.6 14.1 43.1 14.1s30.8-4.6 43.1-14.1C346.6 429.7 422.4 361.8 469.6 288z\"]\n};\nvar faHeartbeat = faHeartPulse;\nvar faSquareRootVariable = {\n  prefix: 'fas',\n  iconName: 'square-root-variable',\n  icon: [576, 512, [\"square-root-alt\"], \"f698\", \"M282.6 78.1c8-27.3 33-46.1 61.4-46.1l200 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L344 96 238.7 457c-3.6 12.3-14.1 21.2-26.8 22.8s-25.1-4.6-31.5-15.6L77.6 288 32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l45.6 0c22.8 0 43.8 12.1 55.3 31.8l65.2 111.8 84.4-289.5zM393.4 233.4c12.5-12.5 32.8-12.5 45.3 0l41.4 41.4 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-41.4 41.4 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-41.4-41.4-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l41.4-41.4-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3z\"]\n};\nvar faSquareRootAlt = faSquareRootVariable;\nvar faHandsBubbles = {\n  prefix: 'fas',\n  iconName: 'hands-bubbles',\n  icon: [512, 512, [\"hands-wash\"], \"e05e\", \"M384 64a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm96 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM128 464a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM0 160l.1 72.6c0 44.8 17.6 87.1 47.9 118.4 .3-77 40.1-148.4 105.4-189.3l1.9-1.2c-2.5-3.7-2.8-8.6-.4-12.7l62-107.4c6.6-11.5 2.7-26.2-8.8-32.8S182 5 175.4 16.5l-68 117.8 0 0 0 0-43.3 75 0-49.3c0-17.7-14.4-32-32-32S0 142.4 0 160zm213.6-35.9c14.1-8.8 29.8-12.7 45.2-12.1l36.5-63.3c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8l-67.1 116.2 27-16.9zm86.5-35.7l-16.4 28.4c15.1 5.5 28.6 15.6 38.3 29.7l19.7-34.2c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8zm46.4 63.7l-12.5 21.7c2 8.6 2.5 17.5 1.7 26.1l4.3 0 0 0 34.4 0 13.7-23.8c6.6-11.5 2.7-26.2-8.8-32.8s-26.2-2.7-32.8 8.8zM283.1 175c-9.4-15-29.1-19.5-44.1-10.2l-60.2 37.6C127.3 234.7 96 291.2 96 352l0 8c0 8.9 .8 17.6 2.2 26.1 35.4 8.2 61.8 40 61.8 77.9 0 6.3-.7 12.5-2.1 18.4 25.2 18.6 56.4 29.6 90.1 29.6l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-92 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l124 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-124 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l156 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-156 0c-6.6 0-12-5.4-12-12s5.4-12 12-12l124 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-136 0 0 0 0 0-93.2 0 46.2-28.9c15-9.4 19.5-29.1 10.2-44.1z\"]\n};\nvar faHandsWash = faHandsBubbles;\nvar faMarker = {\n  prefix: 'fas',\n  iconName: 'marker',\n  icon: [512, 512, [], \"f5a1\", \"M408.8 0c-27.4 0-53.6 10.9-73 30.2L318.1 48 305 34.9c-28.1-28.1-73.7-28.1-101.8 0L103 135c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L237.1 68.9c9.4-9.4 24.6-9.4 33.9 0L284.1 81.9 184 182.1 329.9 328 481.8 176.2c19.4-19.4 30.2-45.6 30.2-73 0-57-46.2-103.2-103.2-103.2zM102.4 263.7c-49.9 49.9-83.3 114-95.5 183.5L.4 483.8C-1 491.6 1.5 499.4 7 505s13.4 8 21.1 6.7l36.7-6.5c69.5-12.3 133.6-45.6 183.5-95.5L296 361.9 150.1 216 102.4 263.7z\"]\n};\nvar faClipboard = {\n  prefix: 'fas',\n  iconName: 'clipboard',\n  icon: [384, 512, [128203], \"f328\", \"M320 32l-8.6 0C300.4 12.9 279.7 0 256 0L128 0C104.3 0 83.6 12.9 72.6 32L64 32C28.7 32 0 60.7 0 96L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-352c0-35.3-28.7-64-64-64zM136 112c-13.3 0-24-10.7-24-24s10.7-24 24-24l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-112 0z\"]\n};\nvar faPlaceOfWorship = {\n  prefix: 'fas',\n  iconName: 'place-of-worship',\n  icon: [512, 512, [], \"f67f\", \"M160 79l0 81-44.8 33.6C103.1 202.7 96 216.9 96 232l0 40-60.6 30.3C13.7 313.2 0 335.3 0 359.6L0 448c0 35.3 28.7 64 64 64 74.7 0 85.4 0 320 0l64 0c35.3 0 64-28.7 64-64l0-88.4c0-24.2-13.7-46.4-35.4-57.2L416 272 416 232c0-15.1-7.1-29.3-19.2-38.4L352 160 352 79c0-9.5-4.2-18.5-11.5-24.6L271.4-3.2c-8.9-7.4-21.8-7.4-30.7 0L171.5 54.4C164.2 60.5 160 69.5 160 79zm96 241c35.3 0 64 28.7 64 64l0 80-128 0 0-80c0-35.3 28.7-64 64-64z\"]\n};\nvar faCannabis = {\n  prefix: 'fas',\n  iconName: 'cannabis',\n  icon: [512, 512, [], \"f55f\", \"M256 0c5.3 0 10.3 2.7 13.3 7.1 15.8 23.5 36.7 63.7 49.2 109 7.3 26.4 11.8 55.3 10.3 84 11.6-8.9 23.7-16.7 35.9-23.7 41-23.3 84.4-36.9 112.2-42.5 5.2-1 10.7 .6 14.4 4.4s5.4 9.2 4.4 14.5c-5.6 27.7-19.3 70.9-42.7 111.7-9.1 15.9-19.9 31.7-32.5 46.3 27.9 6.6 52.5 17.2 67.3 25.4 5.1 2.8 8.2 8.2 8.2 14s-3.2 11.2-8.2 14c-15.2 8.4-40.9 19.5-69.8 26.1-20.2 4.6-42.9 7.2-65.2 4.6l8.3 33.2c1.5 6.1-.6 12.5-5.5 16.4s-11.6 4.6-17.2 1.8L280 417.2 280 488c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-70.8-58.5 29.1c-5.6 2.8-12.3 2.1-17.2-1.8s-7-10.3-5.5-16.4l8.3-33.2c-22.2 2.6-45 0-65.2-4.6-28.9-6.6-54.5-17.6-69.8-26.1-5.1-2.8-8.2-8.2-8.2-14s3.2-11.2 8.2-14l6.2-3.3c15-7.6 36.8-16.4 61.1-22.2-12.5-14.5-23.3-30.4-32.4-46.2-23.4-40.8-37.1-84-42.7-111.7-1.1-5.2 .6-10.7 4.4-14.5s9.2-5.4 14.4-4.4c27.9 5.5 71.2 19.2 112.2 42.5 12.2 6.9 24.3 14.8 35.8 23.7-1.4-28.7 3.1-57.6 10.3-84 12.5-45.3 33.4-85.5 49.2-109l1.2-1.6C246.9 2 251.3 0 256 0z\"]\n};\nvar faPeopleRoof = {\n  prefix: 'fas',\n  iconName: 'people-roof',\n  icon: [576, 512, [], \"e537\", \"M302.3-12.6c-9-4.5-19.6-4.5-28.6 0l-256 128C1.9 123.3-4.5 142.5 3.4 158.3s27.1 22.2 42.9 14.3L288 51.8 529.7 172.6c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9l-256-128zM288 272a56 56 0 1 0 0-112 56 56 0 1 0 0 112zm0 48c-53 0-96 43-96 96l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32c0-53-43-96-96-96zM160 256a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm352 0a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM112 336c-44.2 0-80 35.8-80 80l0 33.1c0 17 13.8 30.9 30.9 30.9l87.8 0c-4.3-9.8-6.7-20.6-6.7-32l0-48c0-18.4 3.5-36 9.8-52.2-12.2-7.5-26.5-11.8-41.8-11.8zM425.4 480l87.8 0c17 0 30.9-13.8 30.9-30.9l0-33.1c0-44.2-35.8-80-80-80-15.3 0-29.6 4.3-41.8 11.8 6.3 16.2 9.8 33.8 9.8 52.2l0 48c0 11.4-2.4 22.2-6.7 32z\"]\n};\nvar faDisease = {\n  prefix: 'fas',\n  iconName: 'disease',\n  icon: [512, 512, [], \"f7fa\", \"M236.5 29.4L224 48c-20 30-53.6 48-89.7 48L68 96c-37.5 0-67.9 30.4-67.9 67.9 0 18 7.2 35.2 19.9 47.9l27 27c11 11 17.2 25.9 17.2 41.5 0 15.8-6.4 30.9-17.7 42L33.4 335.1c-11.1 10.8-17.3 25.7-17.3 41.2 0 36.8 34.1 64.2 70.1 56.2l62.3-13.8c7.7-1.7 15.7-2.6 23.6-2.6 32.8 0 64.2 14.6 85.2 39.8l30.5 36.6c10.4 12.4 25.7 19.6 41.9 19.6 30.1 0 54.5-24.4 54.5-54.5l0-51.2c0-41.4 25.4-78.5 64-93.5l22.2-8.6c25.2-9.8 41.8-34.1 41.8-61.1 0-26.4-15.9-50.3-40.3-60.5L429 164.8c-33.2-13.9-57.6-43-65.5-78.1l-7.9-35.2c-6.8-30.1-33.5-51.5-64.3-51.5-22 0-42.6 11-54.8 29.4zM160 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faBookBible = {\n  prefix: 'fas',\n  iconName: 'book-bible',\n  icon: [448, 512, [\"bible\"], \"f647\", \"M96 512c-53 0-96-43-96-96L0 96C0 43 43 0 96 0L400 0c26.5 0 48 21.5 48 48l0 288c0 20.9-13.4 38.7-32 45.3l0 66.7c17.7 0 32 14.3 32 32s-14.3 32-32 32L96 512zm0-128c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0 0-64-256 0zM192 80l0 48-48 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l48 0 0 112c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-112 48 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-48 0 0-48c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z\"]\n};\nvar faBible = faBookBible;\nvar faChessBoard = {\n  prefix: 'fas',\n  iconName: 'chess-board',\n  icon: [448, 512, [], \"f43c\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 64l0 64 64 0 0-64 64 0 0 64 64 0 0-64 64 0 0 64-64 0 0 64 64 0 0 64-64 0 0 64 64 0 0 64-64 0 0-64-64 0 0 64-64 0 0-64-64 0 0 64-64 0 0-64 64 0 0-64-64 0 0-64 64 0 0-64-64 0 0-64 64 0zm64 128l64 0 0-64-64 0 0 64zm0 64l0-64-64 0 0 64 64 0zm64 0l-64 0 0 64 64 0 0-64zm0 0l64 0 0-64-64 0 0 64z\"]\n};\nvar faMars = {\n  prefix: 'fas',\n  iconName: 'mars',\n  icon: [512, 512, [9794], \"f222\", \"M320 32c0-17.7 14.3-32 32-32L480 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-50.7-95 95c19.5 28.4 31 62.7 31 99.8 0 97.2-78.8 176-176 176S32 401.2 32 304 110.8 128 208 128c37 0 71.4 11.4 99.8 31l95-95-50.7 0c-17.7 0-32-14.3-32-32zM208 416a112 112 0 1 0 0-224 112 112 0 1 0 0 224z\"]\n};\nvar faLaptop = {\n  prefix: 'fas',\n  iconName: 'laptop',\n  icon: [640, 512, [128187], \"f109\", \"M128 32C92.7 32 64 60.7 64 96l0 240 64 0 0-240 384 0 0 240 64 0 0-240c0-35.3-28.7-64-64-64L128 32zM19.2 384C8.6 384 0 392.6 0 403.2 0 445.6 34.4 480 76.8 480l486.4 0c42.4 0 76.8-34.4 76.8-76.8 0-10.6-8.6-19.2-19.2-19.2L19.2 384z\"]\n};\nvar faUserXmark = {\n  prefix: 'fas',\n  iconName: 'user-xmark',\n  icon: [576, 512, [\"user-times\"], \"f235\", \"M254.1 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L46.1 512c-16.4 0-29.7-13.3-29.7-29.7 0-98.5 79.8-178.3 178.3-178.3l59.4 0zM530.3 108.1c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-33.9 33.9 33.9 33.9c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-33.9-33.9-33.9 33.9c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l33.9-33.9-33.9-33.9c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l33.9 33.9 33.9-33.9zM224.4 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240z\"]\n};\nvar faUserTimes = faUserXmark;\nvar faFlagUsa = {\n  prefix: 'fas',\n  iconName: 'flag-usa',\n  icon: [448, 512, [], \"f74d\", \"M32 0C49.7 0 64 14.3 64 32l0 16 69-17.2c38.1-9.5 78.3-5.1 113.5 12.5 46.3 23.2 100.8 23.2 147.1 0l9.6-4.8C423.8 28.1 448 43.1 448 66.1l0 36.1-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-20.3-9-41.8-14.7-63.6-16.9l0 32.2c17.4 2.1 34.4 6.7 50.6 13.9l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4l33.7-12.3 0 62-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-40.2-17.9-85-22.5-128.1-13.3l-63.5 13.6 0 32.7 70.2-15.1c36.4-7.8 74.3-3.9 108.4 11.3l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4l33.7-12.3 0 61.9-44.7 16.2c-42.8 15.6-90 13.9-131.6-4.6l-16.1-7.2c-40.2-17.9-85-22.5-128.1-13.3l-63.5 13.6 0 32.7 70.2-15.1c36.4-7.8 74.3-3.9 108.4 11.3l16.1 7.2c49.2 21.9 105 23.8 155.6 5.4l33.7-12.3 0 33.5c0 13.3-8.3 25.3-20.8 30l-34.7 13c-46.2 17.3-97.6 14.6-141.7-7.4-37.9-19-81.4-23.7-122.5-13.4L64 400 64 480c0 17.7-14.3 32-32 32S0 497.7 0 480L0 32C0 14.3 14.3 0 32 0zm80 96a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm32 0a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm-32 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm32 0a16 16 0 1 0 0-32 16 16 0 1 0 0 32z\"]\n};\nvar faHandMiddleFinger = {\n  prefix: 'fas',\n  iconName: 'hand-middle-finger',\n  icon: [448, 512, [128405], \"f806\", \"M232 0c-22.1 0-40 17.9-40 40l0 164.2c-8.5-7.6-19.7-12.2-32-12.2-26.5 0-48 21.5-48 48l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-55.7c-2 1.4-3.9 3-5.8 4.5L55 284.8C40.4 297 32 315 32 334L32 372c0 38 16.9 74 46.1 98.3l5.4 4.5c28.8 24 65 37.1 102.4 37.1L304 512c70.7 0 128-57.3 128-128l0-96c0-26.5-21.5-48-48-48-12.4 0-23.6 4.7-32.1 12.3-1.9-24.8-22.6-44.3-47.9-44.3-12.3 0-23.5 4.6-32 12.2L272 40c0-22.1-17.9-40-40-40z\"]\n};\nvar faMortarPestle = {\n  prefix: 'fas',\n  iconName: 'mortar-pestle',\n  icon: [512, 512, [], \"f5a7\", \"M504.3 11.1C493.3-1.6 474.5-3.7 461 6.2L252.3 160 397.3 160 502.6 54.6c11.8-11.8 12.6-30.8 1.6-43.5zM32 192c-17.7 0-32 14.3-32 32s14.3 32 32 32c0 82.5 43.4 147.7 123.9 176.2-11.1 13.9-19.4 30.3-23.9 48.1-4.4 17.1 10.4 31.7 28.1 31.7l192 0c17.7 0 32.4-14.6 28.1-31.7-4.5-17.8-12.8-34.1-23.9-48.1 80.5-28.6 123.9-93.7 123.9-176.2 17.7 0 32-14.3 32-32s-14.3-32-32-32L32 192z\"]\n};\nvar faHeadSideCough = {\n  prefix: 'fas',\n  iconName: 'head-side-cough',\n  icon: [512, 512, [], \"e061\", \"M96 512l64 0c53 0 96-43 96-96l0-80c0-8.8 7.2-16 16-16l1 0c26 0 47-21 47-47 0-11-3.9-21.6-10.9-30.1L273.3 200C271.4 197.6 270.1 194.7 269.7 191.7 254 83.3 160.7 0 48 0 40.4 0 32.9 .4 25.4 1.1 10.5 2.6 0 15.9 0 30.9L0 480c0 17.7 14.3 32 32 32l64 0zm16-320a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm63.1 237.2l-41.5-3.5c-12.2-1-21.6-11.2-21.6-23.4 0-10.8 7.3-20.2 17.8-22.8l40.4-10.1c19.2-4.8 37.8 9.7 37.8 29.5 0 17.8-15.2 31.8-32.9 30.3zM480 312a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm-40 24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm-64 48a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm128 0a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM480 504a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm-40-72a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faPlaneLock = {\n  prefix: 'fas',\n  iconName: 'plane-lock',\n  icon: [640, 512, [], \"e558\", \"M232 24c0-30.9 25.1-56 56-56s56 25.1 56 56l0 127.3 82.1 75.2C409.7 248.1 400 274.9 400 304l0 24.4c-7.3 6.6-13.6 14.2-18.7 22.7l-37.3-12.4 0 99.7 24 19.2 0 38.3c0 13.5 2.8 26.4 7.8 38.1L288 512 179.9 539c-10.1 2.5-19.9-5.1-19.9-15.5l0-19.8c0-4.9 2.2-9.5 6-12.5l66-52.8 0-99.7-162.9 54.3C58.7 396.4 48 388.7 48 377.8l0-43.7c0-9 3.8-17.5 10.4-23.6L232 151.3 232 24zM560 304.1c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0 0-47.9zM416 400c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96z\"]\n};\nvar faBatteryThreeQuarters = {\n  prefix: 'fas',\n  iconName: 'battery-three-quarters',\n  icon: [640, 512, [\"battery-4\"], \"f241\", \"M528 128c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-416 0c-8.8 0-16-7.2-16-16l0-224c0-8.8 7.2-16 16-16l416 0zM112 64c-44.2 0-80 35.8-80 80l0 224c0 44.2 35.8 80 80 80l416 0c44.2 0 80-35.8 80-80l0-48c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80L112 64zm56 112c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24l224 0c13.3 0 24-10.7 24-24l0-112c0-13.3-10.7-24-24-24l-224 0z\"]\n};\nvar faBattery4 = faBatteryThreeQuarters;\nvar faFrancSign = {\n  prefix: 'fas',\n  iconName: 'franc-sign',\n  icon: [320, 512, [], \"e18f\", \"M80 32C62.3 32 48 46.3 48 64l0 256-24 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 88 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-88 0 0-64 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-96 176 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z\"]\n};\nvar faFilterCircleDollar = {\n  prefix: 'fas',\n  iconName: 'filter-circle-dollar',\n  icon: [576, 512, [\"funnel-dollar\"], \"f662\", \"M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c2.5 2.5 5.3 4.5 8.3 6-21.2-30.9-33.6-68.3-33.6-108.6 0-99.4 75.5-181.1 172.3-191l90.4-90.4c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64zM576 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM416 320c0-8.8 7.2-16 16-16s16 7.2 16 16l0 8 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-45.8 0c-5.6 0-10.2 4.6-10.2 10.2 0 4.9 3.5 9.1 8.3 10l45 8.2c20 3.6 34.6 21.1 34.6 41.5 0 23.3-18.9 42.2-42.2 42.2l-5.8 0 0 8c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-8-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l53.8 0c5.6 0 10.2-4.6 10.2-10.2 0-4.9-3.5-9.1-8.3-10l-45-8.2c-20-3.6-34.6-21.1-34.6-41.5 0-22.6 17.7-41 40-42.1l0-8.1z\"]\n};\nvar faFunnelDollar = faFilterCircleDollar;\nvar faCheese = {\n  prefix: 'fas',\n  iconName: 'cheese',\n  icon: [512, 512, [], \"f7ef\", \"M512 240.2l0 15.8-512 0c0-20 10-38.7 26.6-49.8L274.9 40.7c8.6-5.7 18.6-8.7 28.9-8.7 115 0 208.2 93.2 208.2 208.2zm0 63.8l0 112c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-112 512 0z\"]\n};\nvar faCircleH = {\n  prefix: 'fas',\n  iconName: 'circle-h',\n  icon: [512, 512, [9405, \"hospital-symbol\"], \"f47e\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm96-344l0 176c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-64-96 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-176c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 96 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24z\"]\n};\nvar faHospitalSymbol = faCircleH;\nvar faSchool = {\n  prefix: 'fas',\n  iconName: 'school',\n  icon: [576, 512, [127979], \"f549\", \"M0 192c0-35.3 28.7-64 64-64l64 0 127.9-115.1c18.3-16.4 46-16.4 64.2 0L448 128 512 128c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192zM224 376l0 88 128 0 0-88c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zm-112 8c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0zm16-144l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM496 384c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0zm16-144l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM288 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128z\"]\n};\nvar faDiceFive = {\n  prefix: 'fas',\n  iconName: 'dice-five',\n  icon: [448, 512, [9860], \"f523\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM96 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM224 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64-64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 160a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faTornado = {\n  prefix: 'fas',\n  iconName: 'tornado',\n  icon: [448, 512, [127786], \"f76f\", \"M0 32L0 45.6C0 62.7 1.7 79.6 5 96l352.8 0c3.2-6.9 7.5-13.3 13-18.8l38.6-38.6c4.2-4.2 6.6-10 6.6-16 0-12.5-10.1-22.6-22.6-22.6L32 0C14.3 0 0 14.3 0 32zM355.7 144l-336 0c12.4 29.7 30.2 56.8 52.7 80l339.6 0-47.2-62.9c-3.9-5.2-7-11-9.2-17.1zM242.6 334.7c8.2 4.8 15.8 10.7 22.5 17.3L445 352c2-9.8 3-19.9 3-30.1 0-17.1-2.9-34-8.6-49.9L136 272 242.6 334.7zM294.3 400c5.3 17 6.5 35.2 3.6 53l-5.9 35.7c-2 12.2 7.4 23.4 19.8 23.4 5.3 0 10.4-2.1 14.2-5.9l78.2-78.2c8.5-8.5 15.8-17.8 21.9-27.9l-131.8 0z\"]\n};\nvar faJetFighter = {\n  prefix: 'fas',\n  iconName: 'jet-fighter',\n  icon: [576, 512, [\"fighter-jet\"], \"f0fb\", \"M496.2 206.8c-10.7-4.5-22.2-6.8-33.8-6.8L362 200 248 48 296 48c13.3 0 24-10.7 24-24S309.3 0 296 0L152 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l8 0 0 152-54.4 0-52.8-66c-3-3.8-7.6-6-12.5-6L16 128c-8.8 0-16 7.2-16 16l0 88 40 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-40 0 0 88c0 8.8 7.2 16 16 16l24.3 0c4.9 0 9.5-2.2 12.5-6l52.8-66 54.4 0 0 152-8 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 114-152 100.4 0c11.6 0 23.1-2.3 33.8-6.8l65-27.1c8.9-3.7 14.8-12.5 14.8-22.2s-5.8-18.4-14.8-22.2l-65-27.1z\"]\n};\nvar faFighterJet = faJetFighter;\nvar faThumbsDown = {\n  prefix: 'fas',\n  iconName: 'thumbs-down',\n  icon: [512, 512, [128078, 61576], \"f165\", \"M384 32c26.5 0 48 21.5 48 48 0 6.3-1.3 12.2-3.4 17.7 20.4 5.5 35.4 24.1 35.4 46.3 0 9.1-2.6 17.6-7 24.9 22.2 4.2 39 23.7 39 47.1 0 19.7-11.9 36.6-28.9 44 17 7.4 28.9 24.3 28.9 44 0 26.5-21.5 48-48 48l-160 0 28.2 70.4c2.5 6.3 3.8 13.1 3.8 19.9l0 4.2c0 27.3-22.1 49.4-49.4 49.4-18.7 0-35.8-10.6-44.2-27.3L170.1 356.3c-6.7-13.3-10.1-28-10.1-42.9l0-186.6c0-19.4 8.9-37.8 24-50l12.2-9.7C224.6 44.4 259.8 32 296.1 32L384 32zM80 96c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32L0 128c0-17.7 14.3-32 32-32l48 0z\"]\n};\nvar faBroom = {\n  prefix: 'fas',\n  iconName: 'broom',\n  icon: [576, 512, [129529], \"f51a\", \"M566.6 54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192-34.7-34.7c-4.2-4.2-10-6.6-16-6.6-12.5 0-22.6 10.1-22.6 22.6l0 29.1 108.3 108.3 29.1 0c12.5 0 22.6-10.1 22.6-22.6 0-6-2.4-11.8-6.6-16l-34.7-34.7 192-192zM341.1 353.4L222.6 234.9c-42.7-3.7-85.2 11.7-115.8 42.3l-8 8c-22.3 22.3-34.8 52.5-34.8 84 0 6.8 7.1 11.2 13.2 8.2l51.1-25.5c5-2.5 9.5 4.1 5.4 7.9L7.3 473.4C2.7 477.6 0 483.6 0 489.9 0 502.1 9.9 512 22.1 512l173.3 0c38.8 0 75.9-15.4 103.4-42.8 30.6-30.6 45.9-73.1 42.3-115.8z\"]\n};\nvar faFileImport = {\n  prefix: 'fas',\n  iconName: 'file-import',\n  icon: [384, 512, [\"arrow-right-to-file\"], \"f56f\", \"M64 0C28.7 0 0 28.7 0 64l0 240 182.1 0-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9l-72 72c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-182.1 0 0 96c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-277.5c0-17-6.7-33.3-18.7-45.3L258.7 18.7C246.7 6.7 230.5 0 213.5 0L64 0zM325.5 176L232 176c-13.3 0-24-10.7-24-24L208 58.5 325.5 176z\"]\n};\nvar faArrowRightToFile = faFileImport;\nvar faUtensils = {\n  prefix: 'fas',\n  iconName: 'utensils',\n  icon: [512, 512, [127860, 61685, \"cutlery\"], \"f2e7\", \"M63.9 14.4C63.1 6.2 56.2 0 48 0s-15.1 6.2-16 14.3L17.9 149.7c-1.3 6-1.9 12.1-1.9 18.2 0 45.9 35.1 83.6 80 87.7L96 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224.4c44.9-4.1 80-41.8 80-87.7 0-6.1-.6-12.2-1.9-18.2L223.9 14.3C223.1 6.2 216.2 0 208 0s-15.1 6.2-15.9 14.4L178.5 149.9c-.6 5.7-5.4 10.1-11.1 10.1-5.8 0-10.6-4.4-11.2-10.2L143.9 14.6C143.2 6.3 136.3 0 128 0s-15.2 6.3-15.9 14.6L99.8 149.8c-.5 5.8-5.4 10.2-11.2 10.2-5.8 0-10.6-4.4-11.1-10.1L63.9 14.4zM448 0C432 0 320 32 320 176l0 112c0 35.3 28.7 64 64 64l32 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-448c0-17.7-14.3-32-32-32z\"]\n};\nvar faCutlery = faUtensils;\nvar faIdBadge = {\n  prefix: 'fas',\n  iconName: 'id-badge',\n  icon: [384, 512, [], \"f2c1\", \"M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zm96 352l64 0c44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16L96 448c-8.8 0-16-7.2-16-16 0-44.2 35.8-80 80-80zm-24-96a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM152 64l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faSpider = {\n  prefix: 'fas',\n  iconName: 'spider',\n  icon: [512, 512, [128375], \"f717\", \"M369.3-31c11.9-3.5 24.4 2.7 29 13.9l.8 2.3 40 136c2.5 8.4 .1 17.5-6.1 23.7l-64.1 64.1 76.4-20.8 19.9-59.8 .9-2.3c5-11.1 17.7-16.8 29.5-12.9 11.8 3.9 18.5 16.1 15.8 28l-.7 2.4-24 72c-2.5 7.6-8.7 13.4-16.5 15.6l-91.1 24.8 91.1 24.8c7.7 2.1 13.9 8 16.5 15.6l24 72 .7 2.4c2.7 11.9-4.1 24.1-15.8 28-11.8 3.9-24.5-1.8-29.5-12.9l-.9-2.3-19.9-59.8-76.4-20.8 64.1 64.1c6.1 6.1 8.5 15.1 6.2 23.4l-40 144-.8 2.3c-4.4 11.3-16.8 17.7-28.8 14.4-12-3.3-19.3-15.2-17.2-27.2l.5-2.4 36.2-130.5-37.2-37.2C351 406 308.4 448 256 448s-95-42-96-94.1l-37 37 36 122.3 .6 2.4c2.2 11.9-4.9 23.9-16.8 27.4-11.9 3.5-24.4-2.7-29-13.9l-.8-2.3-40-136c-2.5-8.4-.1-17.5 6.1-23.8l64.1-64.1-76.4 20.8-19.9 59.8-.9 2.3c-5 11.1-17.7 16.8-29.5 12.9s-18.5-16.1-15.8-28l.7-2.4 24-72c2.5-7.6 8.7-13.4 16.5-15.6l91.1-24.8-91.1-24.8c-7.7-2.1-13.9-8-16.5-15.6l-24-72-.7-2.4c-2.7-11.9 4.1-24.1 15.8-28s24.5 1.8 29.5 12.9l.9 2.3 19.9 59.8 76.4 20.8-64.1-64.1c-6.2-6.2-8.5-15.3-6.1-23.7l40-136 .8-2.3c4.6-11.3 17.1-17.4 29-13.9 11.9 3.5 19 15.5 16.8 27.4l-.6 2.4-36 122.3 53 53c1-43.3 36.4-78.1 79.9-78.1s78.9 34.8 79.9 78.2l53.1-53.1-36-122.3-.6-2.4c-2.2-12 4.9-23.9 16.8-27.4z\"]\n};\nvar faMobileRetro = {\n  prefix: 'fas',\n  iconName: 'mobile-retro',\n  icon: [384, 512, [], \"e527\", \"M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zm80 96l0 64c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-128 0c-17.7 0-32 14.3-32 32zm8 192a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 72c0-13.3-10.7-24-24-24s-24 10.7-24 24 10.7 24 24 24 24-10.7 24-24zm64-72a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 72c0-13.3-10.7-24-24-24s-24 10.7-24 24 10.7 24 24 24 24-10.7 24-24zm64-72a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm24 72c0-13.3-10.7-24-24-24s-24 10.7-24 24 10.7 24 24 24 24-10.7 24-24zM168 40c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0z\"]\n};\nvar faSignsPost = {\n  prefix: 'fas',\n  iconName: 'signs-post',\n  icon: [512, 512, [\"map-signs\"], \"f277\", \"M256.4 0c-17.7 0-32 14.3-32 32l0 32-160 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l160 0 0 64-153.4 0c-4.2 0-8.3 1.7-11.3 4.7l-48 48c-6.2 6.2-6.2 16.4 0 22.6l48 48c3 3 7.1 4.7 11.3 4.7l153.4 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 160 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-160 0 0-64 153.4 0c4.2 0 8.3-1.7 11.3-4.7l48-48c6.2-6.2 6.2-16.4 0-22.6l-48-48c-3-3-7.1-4.7-11.3-4.7l-153.4 0 0-32c0-17.7-14.3-32-32-32z\"]\n};\nvar faMapSigns = faSignsPost;\nvar faGroupArrowsRotate = {\n  prefix: 'fas',\n  iconName: 'group-arrows-rotate',\n  icon: [512, 512, [], \"e4f6\", \"M37.6 122.3c-11.5 18.7-20.6 39-27 60.5-5 16.9 4.6 34.8 21.5 39.8s34.8-4.6 39.8-21.5c18.4-61.9 67.3-110.8 129.2-129.2 16.9-5 26.6-22.9 21.5-39.8S199.8 5.6 182.9 10.6C161.4 17 141.1 26.1 122.3 37.6 112.3 15.4 89.9 0 64 0 28.7 0 0 28.7 0 64 0 89.9 15.4 112.3 37.6 122.3zm436.7 0c22.2-10 37.6-32.4 37.6-58.3 0-35.3-28.7-64-64-64-25.9 0-48.3 15.4-58.3 37.6-18.7-11.5-39-20.6-60.5-27-16.9-5-34.8 4.6-39.8 21.5s4.6 34.8 21.5 39.8c61.9 18.4 110.8 67.3 129.2 129.2 5 16.9 22.9 26.6 39.8 21.5s26.6-22.9 21.5-39.8c-6.4-21.5-15.5-41.8-27-60.5zM512 448c0-25.9-15.4-48.3-37.6-58.3 11.5-18.7 20.6-39 27-60.5 5-16.9-4.6-34.8-21.5-39.8s-34.8 4.6-39.8 21.5c-18.4 61.9-67.3 110.8-129.2 129.2-16.9 5-26.6 22.9-21.5 39.8s22.9 26.6 39.8 21.5c21.5-6.4 41.8-15.5 60.5-27 10 22.2 32.4 37.6 58.3 37.6 35.3 0 64-28.7 64-64zM37.6 389.7c-22.2 10-37.6 32.4-37.6 58.3 0 35.3 28.7 64 64 64 25.9 0 48.3-15.4 58.3-37.6 18.7 11.5 39 20.6 60.5 27 16.9 5 34.8-4.6 39.8-21.5s-4.6-34.8-21.5-39.8c-61.9-18.4-110.8-67.3-129.2-129.2-5-16.9-22.9-26.6-39.8-21.5S5.6 312.2 10.6 329.1c6.4 21.5 15.5 41.8 27 60.5zM256 192c15.6 0 30 5.6 41.1 14.9l-15.3 15.3c-6.6 6.6-1.9 17.8 7.4 17.8l60.5 0c5.7 0 10.4-4.7 10.4-10.4l0-60.5c0-9.3-11.2-13.9-17.8-7.4l-11.2 11.2c-19.8-17.9-46.2-28.9-75.1-28.9-43.6 0-81.3 24.9-99.8 61.1-6 11.8-1.4 26.3 10.4 32.3s26.3 1.4 32.3-10.4c10.6-20.8 32.2-34.9 57-34.9zm58.6 93.1c-10.6 20.8-32.2 34.9-57 34.9-15.7 0-30-5.6-41.1-14.9l15.3-15.3c6.6-6.6 1.9-17.8-7.4-17.8L164 272c-5.7 0-10.4 4.7-10.4 10.4l0 60.5c0 9.3 11.2 13.9 17.8 7.4l11.2-11.2c19.8 17.9 46.2 28.9 75.1 28.9 43.6 0 81.3-24.9 99.8-61.1 6-11.8 1.4-26.3-10.4-32.3s-26.3-1.4-32.3 10.4z\"]\n};\nvar faArrowsSplitUpAndLeft = {\n  prefix: 'fas',\n  iconName: 'arrows-split-up-and-left',\n  icon: [512, 512, [], \"e4bc\", \"M342.6-22.6c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l41.4-41.4 0 195.9c-18.8-10.9-40.7-17.1-64-17.1l-114.7 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 320 224 320c35.3 0 64 28.7 64 64 0 70.7 57.3 128 128 128l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-35.3 0-64-28.7-64-64l0-306.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z\"]\n};\nvar faFillDrip = {\n  prefix: 'fas',\n  iconName: 'fill-drip',\n  icon: [576, 512, [], \"f576\", \"M309.7 71.6l-64.4 64.4 33.4 33.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-33.4-33.4-96.4 96.4c-2.9 2.9-5.1 6.5-6.3 10.3l321.5 0 53.7-53.7c4.9-4.9 7.6-11.5 7.6-18.3s-2.7-13.5-7.6-18.3L346.3 71.6C341.5 66.7 334.9 64 328 64s-13.5 2.7-18.3 7.6zM58.3 232.4l96.4-96.4-49.4-49.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L200 90.7 264.4 26.3C281.3 9.5 304.1 0 328 0s46.7 9.5 63.6 26.3L517.7 152.4C534.5 169.3 544 192.1 544 216s-9.5 46.7-26.3 63.6L311.6 485.7C294.7 502.5 271.9 512 248 512s-46.7-9.5-63.6-26.3L58.3 359.6C41.5 342.7 32 319.9 32 296s9.5-46.7 26.3-63.6zM512 544c-35.3 0-64-28.7-64-64 0-25.2 32.6-79.6 51.2-108.7 6-9.4 19.5-9.4 25.5 0 18.7 29.1 51.2 83.5 51.2 108.7 0 35.3-28.7 64-64 64z\"]\n};\nvar faShieldHeart = {\n  prefix: 'fas',\n  iconName: 'shield-heart',\n  icon: [512, 512, [], \"e574\", \"M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2 .5 99.2 41.3 280.7 213.6 363.2 16.7 8 36.1 8 52.8 0 172.4-82.5 213.2-264 213.6-363.2 .1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM249.6 183.5l6.4 8.5 6.4-8.5c11.1-14.8 28.5-23.5 46.9-23.5 32.4 0 58.7 26.3 58.7 58.7l0 5.3c0 49.1-65.8 98.1-96.5 118.3-9.5 6.2-21.5 6.2-30.9 0-30.7-20.2-96.5-69.3-96.5-118.3l0-5.3c0-32.4 26.3-58.7 58.7-58.7 18.5 0 35.9 8.7 46.9 23.5z\"]\n};\nvar faPersonSkiingNordic = {\n  prefix: 'fas',\n  iconName: 'person-skiing-nordic',\n  icon: [576, 512, [\"skiing-nordic\"], \"f7ca\", \"M424.8 16a56 56 0 1 1 0 112 56 56 0 1 1 0-112zm99.8 193.7c7.6 15.2 1.9 33.6-12.6 42l0 180.3-32 0 0-164.2-10.1 5c-27.4 13.7-60.7 6.1-79.4-18.2l-19.6-25.5-39.5 68.8 24.8 12.4c29.5 14.7 42.9 49.5 31.1 80.2l-28.2 73.4 149.4 0c7.9 0 15.6-2.3 22.2-6.7l7.9-5.3c11-7.4 25.9-4.4 33.3 6.7s4.4 25.9-6.7 33.3l-7.9 5.3C543 506.9 526 512 508.6 512l-189.1 0c-.5 0-1 0-1.5 0L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24l88 0c0-8.2 3.1-16.4 9.4-22.6l74.1-74.1 10.2-35.9c11.3 18.3 27.7 33.8 48.4 44.2l4.8 2.4-1.9 6.8c-3 10.5-8.6 20-16.3 27.7l-51.5 51.5 101.3 0 37.1-96.4-55.6-27.8C230.4 319 215.3 267 239.3 227.1l37.7-62.7-27.7-7.7c-9-2.5-18.1 3.2-20 12.3l-5.9 29.3c-3.1 15.6-17.1 26.3-32.5 25.7l-130 208-37.7 0 140.6-225c-3.4-6.3-4.6-13.8-3.1-21.3l5.9-29.3c9.1-45.6 55.1-73.8 99.9-61.4l32.5 9c46.7 13 88 40.8 117.6 79.3l24.9 32.3 40.4-20.2c15.8-7.9 35-1.5 42.9 14.3z\"]\n};\nvar faSkiingNordic = faPersonSkiingNordic;\nvar faSquareCheck = {\n  prefix: 'fas',\n  iconName: 'square-check',\n  icon: [448, 512, [9745, 9989, 61510, \"check-square\"], \"f14a\", \"M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM342 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L189.1 315.2 137 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.9 7.5 18.8 7s13.4-4.1 17.5-9.8L347.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z\"]\n};\nvar faCheckSquare = faSquareCheck;\nvar faBath = {\n  prefix: 'fas',\n  iconName: 'bath',\n  icon: [512, 512, [128705, \"bathtub\"], \"f2cd\", \"M96 77.3c0-7.3 5.9-13.3 13.3-13.3 3.5 0 6.9 1.4 9.4 3.9l14.9 14.9c-3.6 9.1-5.5 18.9-5.5 29.2 0 19.9 7.2 38 19.2 52-5.3 9.2-4 21.1 3.8 29 9.4 9.4 24.6 9.4 33.9 0L289 89c9.4-9.4 9.4-24.6 0-33.9-7.8-7.9-19.8-9.1-29-3.8-14-12-32.1-19.2-52-19.2-10.3 0-20.2 2-29.2 5.5L163.9 22.6C149.4 8.1 129.7 0 109.3 0 66.6 0 32 34.6 32 77.3L32 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 48c0 28.4 12.4 54 32 71.6L64 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-16 256 0 0 16c0 17.7 14.3 32 32 32s32-14.3 32-32l0-40.4c19.6-17.6 32-43.1 32-71.6l0-48c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 256 96 77.3z\"]\n};\nvar faBathtub = faBath;\nvar faChessBishop = {\n  prefix: 'fas',\n  iconName: 'chess-bishop',\n  icon: [320, 512, [9821], \"f43a\", \"M64 384L48.3 368.3C17.4 337.4 0 295.4 0 251.7 0 213.1 13.5 175.8 38.2 146.1L106.7 64 96 64C78.3 64 64 49.7 64 32S78.3 0 96 0L224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-10.7 0 47.6 57.1-85.9 85.9c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l82.3-82.3c18.7 27.3 28.7 59.7 28.7 93 0 43.7-17.4 85.7-48.3 116.6L256 384 312.2 454.3c5 6.3 7.8 14.1 7.8 22.2 0 19.6-15.9 35.5-35.5 35.5L35.5 512c-19.6 0-35.5-15.9-35.5-35.5 0-8.1 2.7-15.9 7.8-22.2L64 384z\"]\n};\nvar faPrescriptionBottleMedical = {\n  prefix: 'fas',\n  iconName: 'prescription-bottle-medical',\n  icon: [384, 512, [\"prescription-bottle-alt\"], \"f486\", \"M0 32C0 14.3 14.3 0 32 0L352 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64L0 32zM32 144l320 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-304zM160 248l0 40-40 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l40 0 0 40c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-40 40 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-40 0 0-40c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z\"]\n};\nvar faPrescriptionBottleAlt = faPrescriptionBottleMedical;\nvar faDrawPolygon = {\n  prefix: 'fas',\n  iconName: 'draw-polygon',\n  icon: [512, 512, [58055, \"vector-polygon\"], \"f5ee\", \"M64 0c23.7 0 44.4 12.9 55.4 32l273.1 0c11.1-19.1 31.7-32 55.4-32 35.3 0 64 28.7 64 64 0 34-26.5 61.8-60 63.9l-2.1 2.9-71.5 99.1c3.6 8 5.6 16.9 5.6 26.2s-2 18.2-5.6 26.2l2.2 3.1 69.3 96 2.1 2.9c33.5 2.1 60 29.9 60 63.9 0 35.3-28.7 64-64 64-23.7 0-44.4-12.9-55.4-32l-273.1 0c-11.1 19.1-31.7 32-55.4 32-35.3 0-64-28.7-64-64 0-23.7 12.9-44.4 32-55.4l0-273.1C12.9 108.4 0 87.7 0 64 0 28.7 28.7 0 64 0zM394.2 413.4l-65.5-90.6-2.2-3.1c-2.1 .2-4.3 .3-6.5 .3-35.3 0-64-28.7-64-64s28.7-64 64-64c2.2 0 4.4 .1 6.5 .3l67.7-93.7c-.6-.9-1.1-1.7-1.6-2.6L119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4l0 273.1c9.7 5.6 17.8 13.7 23.4 23.4l273.1 0c.5-.9 1.1-1.8 1.6-2.6z\"]\n};\nvar faVectorPolygon = faDrawPolygon;\nvar faICursor = {\n  prefix: 'fas',\n  iconName: 'i-cursor',\n  icon: [256, 512, [], \"f246\", \"M.1 29.3C-1.4 47 11.7 62.4 29.3 63.9l8 .7C70.5 67.3 96 95 96 128.3l0 95.7-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 95.7c0 33.3-25.5 61-58.7 63.8l-8 .7C11.7 449.6-1.4 465 .1 482.7S17 513.4 34.7 511.9l8-.7c34.1-2.8 64.2-18.9 85.4-42.9 21.2 24 51.2 40 85.4 42.9l8 .7c17.6 1.5 33.1-11.6 34.5-29.2s-11.6-33.1-29.2-34.5l-8-.7C185.5 444.7 160 417 160 383.7l0-95.7 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-95.7c0-33.3 25.5-61 58.7-63.8l8-.7c17.6-1.5 30.7-16.9 29.2-34.5S239-1.4 221.3 .1l-8 .7c-34.1 2.8-64.2 18.9-85.4 42.9-21.2-24-51.2-40-85.4-42.9l-8-.7C17-1.4 1.6 11.7 .1 29.3z\"]\n};\nvar faHeartCirclePlus = {\n  prefix: 'fas',\n  iconName: 'heart-circle-plus',\n  icon: [576, 512, [], \"e500\", \"M241 87.1l15 20.7 15-20.7C296 52.5 336.2 32 378.9 32 452.4 32 512 91.6 512 165.1l0 2.6c0 17.6-3.4 35.6-9.5 53.7-21.8-8.6-45.6-13.4-70.5-13.4-106 0-192 86-192 192 0 28.5 6.2 55.6 17.4 80-.5 0-.9 0-1.4 0-15.5 0-30.8-4.6-43.1-14.1-73-55.7-212.9-186-212.9-298.2l0-2.6C0 91.6 59.6 32 133.1 32 175.8 32 216 52.5 241 87.1zM432 256a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm16 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0 0-48z\"]\n};\nvar faShieldDog = {\n  prefix: 'fas',\n  iconName: 'shield-dog',\n  icon: [512, 512, [], \"e573\", \"M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2 .5 99.2 41.3 280.7 213.6 363.2 16.7 8 36.1 8 52.8 0 172.4-82.5 213.2-264 213.6-363.2 .1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM160.9 286.2c4.8 1.2 9.9 1.8 15.1 1.8 35.3 0 64-28.7 64-64l0-64 44.2 0c12.1 0 23.2 6.8 28.6 17.7l7.2 14.3 64 0c8.8 0 16 7.2 16 16l0 32c0 44.2-35.8 80-80 80l-48 0 0 50.7c0 7.3-5.9 13.3-13.3 13.3-1.8 0-3.6-.4-5.2-1.1l-98.7-42.3c-6.6-2.8-10.8-9.3-10.8-16.4 0-2.8 .6-5.5 1.9-8l15-30zM160 160l48 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-48c0-8.8 7.2-16 16-16zm128 48a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z\"]\n};\nvar faGreaterThanEqual = {\n  prefix: 'fas',\n  iconName: 'greater-than-equal',\n  icon: [448, 512, [], \"f532\", \"M21.9 94.4C5.1 88.8-3.9 70.6 1.7 53.9S25.4 28.1 42.1 33.6l384 128C439.2 166 448 178.2 448 192s-8.8 26-21.9 30.4l-384 128c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5L314.8 192 21.9 94.4zM416 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0z\"]\n};\nvar faEnvelopeOpen = {\n  prefix: 'fas',\n  iconName: 'envelope-open',\n  icon: [512, 512, [62135], \"f2b6\", \"M64.4 175.8L256 33.9 447.6 175.8 289.5 293c-9.7 7.2-21.4 11-33.5 11s-23.8-3.9-33.5-11L64.4 175.8zM256-32c-12.1 0-23.8 3.9-33.5 11L25.9 124.7C9.6 136.8 0 155.8 0 176.1L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-239.9c0-20.3-9.6-39.4-25.9-51.4L289.5-21c-9.7-7.2-21.4-11-33.5-11z\"]\n};\nvar faMound = {\n  prefix: 'fas',\n  iconName: 'mound',\n  icon: [512, 512, [], \"e52d\", \"M112.4 179.2C142 127.7 196.8 96 256.2 96s114.2 31.7 143.9 83.2L508.7 368c12.3 21.3-3.1 48-27.7 48L31.5 416c-24.6 0-40-26.6-27.7-48L112.4 179.2z\"]\n};\nvar faVoicemail = {\n  prefix: 'fas',\n  iconName: 'voicemail',\n  icon: [640, 512, [], \"f897\", \"M144 160a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM263.8 320c15.3-22.9 24.2-50.4 24.2-80 0-79.5-64.5-144-144-144S0 160.5 0 240 64.5 384 144 384l352 0c79.5 0 144-64.5 144-144S575.5 96 496 96 352 160.5 352 240c0 29.6 8.9 57.1 24.2 80l-112.5 0zM496 160a80 80 0 1 1 0 160 80 80 0 1 1 0-160z\"]\n};\nvar faVest = {\n  prefix: 'fas',\n  iconName: 'vest',\n  icon: [448, 512, [], \"e085\", \"M200 464l0-170.1c0-3.9-.5-7.8-1.4-11.6L144.4 65.4C162.1 77.2 188.2 88 224 88s61.9-10.8 79.6-22.6L249.4 282.3c-1 3.8-1.4 7.7-1.4 11.6L248 464c0 26.5 21.5 48 48 48l104 0c26.5 0 48-21.5 48-48l0-193.5c0-9.5-2.8-18.7-8.1-26.6l-47.9-71.8c-5.3-7.9-8.1-17.1-8.1-26.6L384 48c0-26.5-21.5-48-48-48l-3.5 0c-.3 0-.6 0-1 0-.6 0-1.2 0-1.8 0-18.8 0-34.1 9.7-44.1 18.8-9.3 8.4-28.5 21.2-61.7 21.2s-52.4-12.8-61.7-21.2c-10-9.1-25.3-18.8-44.1-18.8-.6 0-1.2 0-1.8 0-.3 0-.6 0-1 0L112 0C85.5 0 64 21.5 64 48l0 97.5c0 9.5-2.8 18.7-8.1 26.6L8.1 243.9C2.8 251.8 0 261.1 0 270.5L0 464c0 26.5 21.5 48 48 48l104 0c26.5 0 48-21.5 48-48z\"]\n};\nvar faAudioDescription = {\n  prefix: 'fas',\n  iconName: 'audio-description',\n  icon: [512, 512, [], \"f29e\", \"M0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zm96 96l0 104c0 13.3 10.7 24 24 24s24-10.7 24-24l0-24 48 0 0 24c0 13.3 10.7 24 24 24s24-10.7 24-24l0-104c0-35.3-28.7-64-64-64l-16 0c-35.3 0-64 28.7-64 64zm48 32l0-32c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 32-48 0zm152-96c-13.3 0-24 10.7-24 24l0 144c0 13.3 10.7 24 24 24l48 0c39.8 0 72-32.2 72-72l0-48c0-39.8-32.2-72-72-72l-48 0zm48 144l-24 0 0-96 24 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24z\"]\n};\nvar faW = {\n  prefix: 'fas',\n  iconName: 'w',\n  icon: [576, 512, [119], \"57\", \"M20.8 34c16.5-6.2 35 2.2 41.2 18.7L172.2 346.7 257.3 55c4-13.7 16.5-23 30.7-23s26.7 9.4 30.7 23L403.8 346.7 514 52.8c6.2-16.5 24.6-24.9 41.2-18.7S580.2 58.7 574 75.2l-144 384c-4.8 12.9-17.4 21.3-31.2 20.7s-25.7-9.8-29.5-23L288 178.3 206.7 457c-3.9 13.2-15.8 22.5-29.5 23s-26.3-7.8-31.2-20.7L2 75.2C-4.2 58.7 4.2 40.2 20.8 34z\"]\n};\nvar faEyeDropper = {\n  prefix: 'fas',\n  iconName: 'eye-dropper',\n  icon: [512, 512, [\"eye-dropper-empty\", \"eyedropper\"], \"f1fb\", \"M341.6 29.2l-101.6 101.6-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4 101.6-101.6c39-39 39-102.2 0-141.1s-102.2-39-141.1 0zM55.4 323.3c-15 15-23.4 35.4-23.4 56.6l0 42.4-26.6 39.9c-8.5 12.7-6.8 29.6 4 40.4s27.7 12.5 40.4 4l39.9-26.6 42.4 0c21.2 0 41.6-8.4 56.6-23.4l109.4-109.4-45.3-45.3-109.4 109.4c-3 3-7.1 4.7-11.3 4.7l-36.1 0 0-36.1c0-4.2 1.7-8.3 4.7-11.3l109.4-109.4-45.3-45.3-109.4 109.4z\"]\n};\nvar faEyeDropperEmpty = faEyeDropper;\nvar faEyedropper = faEyeDropper;\nvar faCircleXmark = {\n  prefix: 'fas',\n  iconName: 'circle-xmark',\n  icon: [512, 512, [61532, \"times-circle\", \"xmark-circle\"], \"f057\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM167 167c9.4-9.4 24.6-9.4 33.9 0l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9z\"]\n};\nvar faTimesCircle = faCircleXmark;\nvar faXmarkCircle = faCircleXmark;\nvar faTrailer = {\n  prefix: 'fas',\n  iconName: 'trailer',\n  icon: [640, 512, [], \"e041\", \"M32 96c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 256 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-296.4 0c.2 2.6 .4 5.3 .4 8 0 48.6-39.4 88-88 88s-88-39.4-88-88c0-2.7 .1-5.4 .4-8L96 416c-35.3 0-64-28.7-64-64L32 96zm408 16c-13.3 0-24 10.7-24 24l0 160c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24zM112 136l0 160c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24s-24 10.7-24 24zm176-24c-13.3 0-24 10.7-24 24l0 160c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24zM264 424a40 40 0 1 0 -80 0 40 40 0 1 0 80 0z\"]\n};\nvar faTurkishLiraSign = {\n  prefix: 'fas',\n  iconName: 'turkish-lira-sign',\n  icon: [448, 512, [\"try\", \"turkish-lira\"], \"e2bb\", \"M160 32c17.7 0 32 14.3 32 32l0 43.6 121.4-34.7c12.7-3.6 26 3.7 29.7 16.5s-3.7 26-16.5 29.7l-134.6 38.5 0 46.1 121.4-34.7c12.7-3.6 26 3.7 29.7 16.5s-3.7 26-16.5 29.7l-134.6 38.5 0 162.5 72 0c53 0 96-43 96-96 0-17.7 14.3-32 32-32s32 14.3 32 32c0 88.4-71.6 160-160 160l-104 0c-17.7 0-32-14.3-32-32l0-176.2-25.4 7.3c-12.7 3.6-26-3.7-29.7-16.5s3.7-26 16.5-29.7l38.6-11 0-46.1-25.4 7.3c-12.7 3.6-26-3.7-29.7-16.5s3.7-26 16.5-29.7l38.6-11 0-61.9c0-17.7 14.3-32 32-32z\"]\n};\nvar faTry = faTurkishLiraSign;\nvar faTurkishLira = faTurkishLiraSign;\nvar faVolcano = {\n  prefix: 'fas',\n  iconName: 'volcano',\n  icon: [512, 512, [127755], \"f770\", \"M160 144c-35.3 0-64-28.7-64-64s28.7-64 64-64c15.7 0 30 5.6 41.2 15 11.2-18.6 31.6-31 54.8-31s43.6 12.4 54.8 31c11.1-9.4 25.5-15 41.2-15 35.3 0 64 28.7 64 64s-28.7 64-64 64c-14.7 0-28.3-5-39.1-13.3l-32 48C275.3 187 266 192 256 192s-19.3-5-24.9-13.3l-32-48C188.3 139 174.7 144 160 144zM144 352l48.4-24.2c10.2-5.1 21.6-7.8 33-7.8 19.6 0 38.4 7.8 52.2 21.6l32.5 32.5c6.3 6.3 14.9 9.9 23.8 9.9 11.3 0 21.8-5.6 28-15l9.7-14.6-59-66.3c-9.1-10.2-22.2-16.1-35.9-16.1l-41.8 0c-13.7 0-26.8 5.9-35.9 16.1l-59.9 67.4 4.7-3.5zm19.4-95.8c18.2-20.5 44.3-32.2 71.8-32.2l41.8 0c27.4 0 53.5 11.7 71.8 32.2l150.2 169c8.5 9.5 13.2 21.9 13.2 34.7 0 28.8-23.4 52.2-52.2 52.2L52.2 512C23.4 512 0 488.6 0 459.8 0 447.1 4.7 434.7 13.2 425.2l150.2-169z\"]\n};\nvar faWandSparkles = {\n  prefix: 'fas',\n  iconName: 'wand-sparkles',\n  icon: [512, 512, [], \"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1 7.8-6.1z\"]\n};\nvar faMicrophone = {\n  prefix: 'fas',\n  iconName: 'microphone',\n  icon: [384, 512, [], \"f130\", \"M192 0C139 0 96 43 96 96l0 128c0 53 43 96 96 96s96-43 96-96l0-128c0-53-43-96-96-96zM48 184c0-13.3-10.7-24-24-24S0 170.7 0 184l0 40c0 97.9 73.3 178.7 168 190.5l0 49.5-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-49.5c94.7-11.8 168-92.6 168-190.5l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 79.5-64.5 144-144 144S48 303.5 48 224l0-40z\"]\n};\nvar faCrown = {\n  prefix: 'fas',\n  iconName: 'crown',\n  icon: [576, 512, [128081], \"f521\", \"M313 87.2c9.2-7.3 15-18.6 15-31.2 0-22.1-17.9-40-40-40s-40 17.9-40 40c0 12.6 5.9 23.9 15 31.2L194.6 194.8c-10 15.7-31.3 19.6-46.2 8.4L88.9 158.7c4.5-6.4 7.1-14.3 7.1-22.7 0-22.1-17.9-40-40-40s-40 17.9-40 40c0 21.8 17.5 39.6 39.2 40L87.8 393.5c4.7 31.3 31.6 54.5 63.3 54.5l273.8 0c31.7 0 58.6-23.2 63.3-54.5L520.8 176c21.7-.4 39.2-18.2 39.2-40 0-22.1-17.9-40-40-40s-40 17.9-40 40c0 8.4 2.6 16.3 7.1 22.7l-59.4 44.6c-14.9 11.2-36.2 7.3-46.2-8.4L313 87.2z\"]\n};\nvar faTentArrowTurnLeft = {\n  prefix: 'fas',\n  iconName: 'tent-arrow-turn-left',\n  icon: [512, 512, [], \"e580\", \"M-.5 113l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-31-31 350.1 0c22.1 0 40 17.9 40 40l0 24c0 13.3 10.7 24 24 24s24-10.7 24-24l0-24c0-48.6-39.4-88-88-88l-350.1 0 31-31c9.4-9.4 9.4-24.6 0-33.9S80.9-2.3 71.5 7L-.5 79c-9.4 9.4-9.4 24.6 0 33.9zM60.3 292.6L37.1 476c-2.4 19.1 12.5 36 31.7 36l154.5 0c17.7 0 32-14.3 32-32l0-117.4c0-5.9 4.7-10.6 10.6-10.6 4 0 7.7 2.3 9.5 5.9l68.2 136.5c5.4 10.8 16.5 17.7 28.6 17.7l71.9 0c19.3 0 34.2-16.9 31.7-36L452.7 292.7c-1.2-9.7-6.9-18.4-15.3-23.4L271.9 169.9c-10.2-6.1-22.9-6.1-33.1 .1L75.4 269.3c-8.3 5.1-13.9 13.7-15.1 23.3z\"]\n};\nvar faTruckFast = {\n  prefix: 'fas',\n  iconName: 'truck-fast',\n  icon: [640, 512, [\"shipping-fast\"], \"f48b\", \"M64 96c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 32 50.7 0c17 0 33.3 6.7 45.3 18.7L621.3 192c12 12 18.7 28.3 18.7 45.3L640 384c0 35.3-28.7 64-64 64l-3.3 0c-10.4 36.9-44.4 64-84.7 64s-74.2-27.1-84.7-64l-102.6 0c-10.4 36.9-44.4 64-84.7 64s-74.2-27.1-84.7-64l-3.3 0c-35.3 0-64-28.7-64-64l0-48-40 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 240c-13.3 0-24-10.7-24-24s10.7-24 24-24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 144c-13.3 0-24-10.7-24-24S10.7 96 24 96l40 0zM576 288l0-50.7-45.3-45.3-50.7 0 0 96 96 0zM256 424a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm232 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80z\"]\n};\nvar faShippingFast = faTruckFast;\nvar faUserPen = {\n  prefix: 'fas',\n  iconName: 'user-pen',\n  icon: [640, 512, [\"user-edit\"], \"f4ff\", \"M256.1 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56c-98.5 0-178.3 79.8-178.3 178.3 0 16.4 13.3 29.7 29.7 29.7l196.5 0 10.9-54.5c4.3-21.7 15-41.6 30.6-57.2l67.3-67.3c-28-18.3-61.4-28.9-97.4-28.9l-59.4 0zM332.3 466.9l-11.9 59.6c-.2 .9-.3 1.9-.3 2.9 0 8 6.5 14.6 14.6 14.6 1 0 1.9-.1 2.9-.3l59.6-11.9c12.4-2.5 23.8-8.6 32.7-17.5l118.9-118.9-80-80-118.9 118.9c-8.9 8.9-15 20.3-17.5 32.7zm267.8-123c22.1-22.1 22.1-57.9 0-80s-57.9-22.1-80 0l-28.8 28.8 80 80 28.8-28.8z\"]\n};\nvar faUserEdit = faUserPen;\nvar faUserClock = {\n  prefix: 'fas',\n  iconName: 'user-clock',\n  icon: [576, 512, [], \"f4fd\", \"M224 8a120 120 0 1 1 0 240 120 120 0 1 1 0-240zM194.3 304l59.4 0c3.9 0 7.9 .1 11.8 .4-16.2 28.2-25.5 60.8-25.5 95.6 0 41.8 13.4 80.5 36 112L45.7 512C29.3 512 16 498.7 16 482.3 16 383.8 95.8 304 194.3 304zM288 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-80c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0-48c0-8.8-7.2-16-16-16z\"]\n};\nvar faShower = {\n  prefix: 'fas',\n  iconName: 'shower',\n  icon: [512, 512, [128703], \"f2cc\", \"M64 131.9c0-19.8 16.1-35.9 35.9-35.9 9.5 0 18.6 3.8 25.4 10.5l16.2 16.2c-21 38.9-17.4 87.5 10.9 123L151 247c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L345 121c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-1.3 1.3c-35.5-28.3-84.1-31.9-123-10.9L170.5 61.3C151.8 42.5 126.4 32 99.9 32 44.7 32 0 76.7 0 131.9L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-316.1zM256 352a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm64 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm32-32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faSquareCaretUp = {\n  prefix: 'fas',\n  iconName: 'square-caret-up',\n  icon: [448, 512, [\"caret-square-up\"], \"f151\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM224 160c6.7 0 13 2.8 17.6 7.7l104 112c6.5 7 8.2 17.2 4.4 25.9S337.5 320 328 320l-208 0c-9.5 0-18.2-5.7-22-14.4s-2.1-18.9 4.4-25.9l104-112c4.5-4.9 10.9-7.7 17.6-7.7z\"]\n};\nvar faCaretSquareUp = faSquareCaretUp;\nvar faMapLocation = {\n  prefix: 'fas',\n  iconName: 'map-location',\n  icon: [640, 512, [\"map-marked\"], \"f59f\", \"M576 48c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4L413.5 77.5 234.1 17.6c-8.1-2.7-16.8-2.1-24.4 1.7l-128 64C70.8 88.8 64 99.9 64 112l0 352c0 11.1 5.7 21.4 15.2 27.2s21.2 6.4 31.1 1.4l116.1-58.1 173.3 57.8c-4.3-6.4-8.5-13.1-12.6-19.9-11-18.3-21.9-39.3-30-61.8l-101.2-33.7 0-284.5 128 42.7 0 99.3c31-35.8 77-58.4 128-58.4 22.6 0 44.2 4.4 64 12.5L576 48zM392 341.9c0 68.9 64.1 150.4 98.6 189.3 11.6 13 31.3 13 42.9 0 34.5-38.9 98.6-120.4 98.6-189.3 0-65.1-53.7-117.9-120-117.9S392 276.8 392 341.9z\"]\n};\nvar faMapMarked = faMapLocation;\nvar faPenFancy = {\n  prefix: 'fas',\n  iconName: 'pen-fancy',\n  icon: [512, 512, [128395, 10002], \"f5ac\", \"M373.5 27.1c15-17.2 36.7-27.1 59.6-27.1 43.6 0 79 35.4 79 79 0 22.8-9.9 44.6-27.1 59.6L283.7 313.8 273 303 209 239 198.2 228.3 373.5 27.1zM161.1 259C162 260 188 286 239 337l13.9 13.9-17.1 74.2c-3.9 17.1-16.9 30.7-33.8 35.4l-169.8 47.5 92.3-92.3c1.2 .1 2.3 .2 3.5 .2 17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32c0 1.2 .1 2.4 .2 3.5L3.9 479.8 51.5 310c4.7-16.9 18.3-29.9 35.4-33.8L161.1 259z\"]\n};\nvar faEuroSign = {\n  prefix: 'fas',\n  iconName: 'euro-sign',\n  icon: [448, 512, [8364, \"eur\", \"euro\"], \"f153\", \"M73.3 192C100.8 99.5 186.5 32 288 32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-65.6 0-122 39.5-146.7 96L272 192c13.3 0 24 10.7 24 24s-10.7 24-24 24l-143.2 0c-.5 5.3-.8 10.6-.8 16s.3 10.7 .8 16L272 272c13.3 0 24 10.7 24 24s-10.7 24-24 24l-130.7 0c24.7 56.5 81.1 96 146.7 96l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-101.5 0-187.2-67.5-214.7-160L40 320c-13.3 0-24-10.7-24-24s10.7-24 24-24l24.6 0c-.7-10.5-.7-21.5 0-32L40 240c-13.3 0-24-10.7-24-24s10.7-24 24-24l33.3 0z\"]\n};\nvar faEur = faEuroSign;\nvar faEuro = faEuroSign;\nvar faHouseCircleXmark = {\n  prefix: 'fas',\n  iconName: 'house-circle-xmark',\n  icon: [640, 512, [], \"e50b\", \"M496 544a144 144 0 1 1 0-288 144 144 0 1 1 0 288zM268.6 6.5c12.2-9.3 29.7-8.7 41.2 2l217.6 202c-10.2-1.7-20.7-2.6-31.3-2.6-78.6 0-146.2 47.2-175.9 114.8-5-1.8-10.5-2.8-16.1-2.8l-32 0c-26.5 0-48 21.5-48 48l0 96 90.9 0c6.1 17.3 14.6 33.4 25.2 48L144 512c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208 2.4-2zM555.3 340.7c-6.2-6.2-16.4-6.2-22.6 0l-36.7 36.7-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l36.7 36.7-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l36.7-36.7 36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-36.7-36.7 36.7-36.7c6.2-6.2 6.2-16.4 0-22.6z\"]\n};\nvar faLiraSign = {\n  prefix: 'fas',\n  iconName: 'lira-sign',\n  icon: [384, 512, [8356], \"f195\", \"M84.9 256l-28.4 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l11.6 0C53.2 124.7 116.8 42 207.6 42l8.2 0c33.6 0 66.2 11.3 92.5 32.2l16.1 12.7c13.9 11 16.2 31.1 5.2 45s-31.1 16.2-45 5.2l-16.1-12.7c-15-11.9-33.6-18.4-52.8-18.4l-8.2 0c-53.8 0-90.1 52.9-73.5 102l162.4 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-145.1 0c2.3 10.6 3.6 21.3 3.9 32l141.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L150 336c-4.8 18.6-12.6 36.5-23.6 52.9l-18.1 27.1 212.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-272 0c-11.8 0-22.6-6.5-28.2-16.9s-5-23 1.6-32.9l51.2-76.8c3.7-5.6 6.9-11.4 9.4-17.4l-26 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l34.8 0c-.5-10.8-2.6-21.6-6.4-32z\"]\n};\nvar faYenSign = {\n  prefix: 'fas',\n  iconName: 'yen-sign',\n  icon: [384, 512, [165, \"cny\", \"jpy\", \"rmb\", \"yen\"], \"f157\", \"M74.9 46.7c-9.6-14.9-29.4-19.2-44.2-9.6S11.5 66.4 21.1 81.3L143.7 272 88 272c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 0 32-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0 0-32 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-55.7 0 122.6-190.7c9.6-14.9 5.3-34.7-9.6-44.2s-34.7-5.3-44.2 9.6L192 228.8 74.9 46.7z\"]\n};\nvar faCny = faYenSign;\nvar faJpy = faYenSign;\nvar faRmb = faYenSign;\nvar faYen = faYenSign;\nvar faBoxOpen = {\n  prefix: 'fas',\n  iconName: 'box-open',\n  icon: [640, 512, [], \"f49e\", \"M560.3 237.2c10.4 11.8 28.3 14.4 41.8 5.5 14.7-9.8 18.7-29.7 8.9-44.4l-48-72c-2.8-4.2-6.6-7.7-11.1-10.2L351.4 4.7c-19.3-10.7-42.8-10.7-62.2 0L88.8 116c-5.4 3-9.7 7.4-12.6 12.8L27.7 218.7c-12.6 23.4-3.8 52.5 19.6 65.1l33 17.7 0 53.3c0 23 12.4 44.3 32.4 55.7l176 99.7c19.6 11.1 43.5 11.1 63.1 0l176-99.7c20.1-11.4 32.4-32.6 32.4-55.7l0-117.5zm-240-9.8L170.2 144 320.3 60.6 470.4 144 320.3 227.4zm-41.5 50.2l-21.3 46.2-165.8-88.8 25.4-47.2 161.7 89.8z\"]\n};\nvar faTruckField = {\n  prefix: 'fas',\n  iconName: 'truck-field',\n  icon: [640, 512, [], \"e58d\", \"M32 96c0-35.3 28.7-64 64-64l224 0c23.7 0 44.4 12.9 55.4 32l40.4 0c32.4 0 61.6 19.6 74 49.5l43.8 106.3 1.7 4.2 24.7 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-.4 0c.2 2.6 .4 5.3 .4 8 0 48.6-39.4 88-88 88s-88-39.4-88-88c0-2.7 .1-5.4 .4-8l-144.7 0c.2 2.6 .4 5.3 .4 8 0 48.6-39.4 88-88 88s-88-39.4-88-88c0-3.6 .2-7.1 .6-10.5-19-6.4-32.6-24.4-32.6-45.5l0-48c-17.7 0-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32l0-32zm352 32l0 96 82.1 0-35.4-86.1c-2.5-6-8.3-9.9-14.8-9.9L384 128zM192 392a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm280 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80z\"]\n};\nvar faLocationPinLock = {\n  prefix: 'fas',\n  iconName: 'location-pin-lock',\n  icon: [512, 512, [], \"e51f\", \"M0 188.6C0 84.4 86 0 192 0 294.1 0 377.6 78.3 383.6 177 320.7 185.1 272 238.8 272 304l0 24.4c-19.6 17.6-32 43.1-32 71.5l0 75.7c-9.9 11.6-18.9 21.7-26.4 29.8-11.8 12.8-31.5 12.8-43.3 0-50.2-54.5-170.4-197.5-170.4-316.8zM192 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm240 48.1c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0 0-47.9zM288 400c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96z\"]\n};\nvar faPersonPraying = {\n  prefix: 'fas',\n  iconName: 'person-praying',\n  icon: [384, 512, [128720, \"pray\"], \"f683\", \"M320 64a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM200.7 264l22.9 31.5c6.5 8.9 16.3 14.7 27.2 16.1s21.9-1.7 30.4-8.7l88-72c17.1-14 19.6-39.2 5.6-56.3s-39.2-19.6-56.3-5.6l-55.2 45.2-26.2-36c-15.6-21.5-40.6-34.2-67.2-34.2-30.9 0-59.2 17.1-73.6 44.4L47.8 280.9c-20.2 38.5-9.4 85.9 25.6 111.8L126.6 432 40 432c-22.1 0-40 17.9-40 40s17.9 40 40 40l208 0c17.3 0 32.6-11.1 38-27.5s-.3-34.4-14.2-44.7l-116.1-85.8 45-90z\"]\n};\nvar faPray = faPersonPraying;\nvar faClipboardList = {\n  prefix: 'fas',\n  iconName: 'clipboard-list',\n  icon: [384, 512, [], \"f46d\", \"M311.4 32l8.6 0c35.3 0 64 28.7 64 64l0 352c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l8.6 0C83.6 12.9 104.3 0 128 0L256 0c23.7 0 44.4 12.9 55.4 32zM248 112c13.3 0 24-10.7 24-24s-10.7-24-24-24L136 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0zM128 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm32 0c0 13.3 10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0c-13.3 0-24 10.7-24 24zm0 128c0 13.3 10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0c-13.3 0-24 10.7-24 24zM96 416a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faSackDollar = {\n  prefix: 'fas',\n  iconName: 'sack-dollar',\n  icon: [512, 512, [128176], \"f81d\", \"M328 112l-144 0-37.3-74.5c-1.8-3.6-2.7-7.6-2.7-11.6 0-14.3 11.6-25.9 25.9-25.9L342.1 0c14.3 0 25.9 11.6 25.9 25.9 0 4-.9 8-2.7 11.6L328 112zM169.6 160l172.8 0 48.7 40.6C457.6 256 496 338 496 424.5 496 472.8 456.8 512 408.5 512l-305.1 0C55.2 512 16 472.8 16 424.5 16 338 54.4 256 120.9 200.6L169.6 160zM260 224c-11 0-20 9-20 20l0 4c-28.8 .3-52 23.7-52 52.5 0 25.7 18.5 47.6 43.9 51.8l41.7 7c6 1 10.4 6.2 10.4 12.3 0 6.9-5.6 12.5-12.5 12.5L216 384c-11 0-20 9-20 20s9 20 20 20l24 0 0 4c0 11 9 20 20 20s20-9 20-20l0-4.7c25-4.1 44-25.7 44-51.8 0-25.7-18.5-47.6-43.9-51.8l-41.7-7c-6-1-10.4-6.2-10.4-12.3 0-6.9 5.6-12.5 12.5-12.5l47.5 0c11 0 20-9 20-20s-9-20-20-20l-8 0 0-4c0-11-9-20-20-20z\"]\n};\nvar faMountainSun = {\n  prefix: 'fas',\n  iconName: 'mountain-sun',\n  icon: [576, 512, [], \"e52f\", \"M256.5 0c14.7 0 28.2 8.1 35.2 21l216 400c6.7 12.4 6.4 27.4-.8 39.5-7.2 12.1-20.3 19.5-34.3 19.5l-432 0c-14.1 0-27.1-7.4-34.3-19.5s-7.5-27.1-.8-39.5l216-400 2.9-4.6C231.7 6.2 243.6 0 256.5 0zM170.4 249.9l26.8 26.8c6.2 6.2 16.4 6.2 22.6 0l43.3-43.3c6-6 14.1-9.4 22.6-9.4l42.8 0-72.1-133.5-86.1 159.4zM496.5 160a80 80 0 1 1 0-160 80 80 0 1 1 0 160z\"]\n};\nvar faArrowUpWideShort = {\n  prefix: 'fas',\n  iconName: 'arrow-up-wide-short',\n  icon: [576, 512, [\"sort-amount-up\"], \"f161\", \"M150.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 141.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96zM320 480l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm0-128l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32z\"]\n};\nvar faSortAmountUp = faArrowUpWideShort;\nvar faUsersLine = {\n  prefix: 'fas',\n  iconName: 'users-line',\n  icon: [576, 512, [], \"e592\", \"M224 128a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM176 336c0-61.9 50.1-112 112-112s112 50.1 112 112l0 8c0 13.3-10.7 24-24 24l-176 0c-13.3 0-24-10.7-24-24l0-8zM392 144a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm27.2 100.4c9.1-2.9 18.8-4.4 28.8-4.4 53 0 96 43 96 96l0 10.7c0 11.8-9.6 21.3-21.3 21.3l-78.8 0c2.7-7.5 4.1-15.6 4.1-24l0-8c0-34.1-10.6-65.7-28.8-91.6zm-262.4 0c-18.2 26-28.8 57.5-28.8 91.6l0 8c0 8.4 1.4 16.5 4.1 24l-78.8 0C41.6 368 32 358.4 32 346.7L32 336c0-53 43-96 96-96 10 0 19.7 1.5 28.8 4.4zM72 144a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM0 440c0-13.3 10.7-24 24-24l528 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 464c-13.3 0-24-10.7-24-24z\"]\n};\nvar faStarOfDavid = {\n  prefix: 'fas',\n  iconName: 'star-of-david',\n  icon: [512, 512, [10017], \"f69a\", \"M415.9 311.9l-27.8 48.1 55.7 0-27.8-48.1zM383.6 256l-60.2-104-134.8 0-60.2 104 60.2 104 134.8 0 60.2-104zm64.7 0l58.4 100.9c3.5 6 5.3 12.8 5.3 19.7 0 21.7-17.6 39.4-39.4 39.4l-117 0-61.3 105.8C286.5 535.6 271.8 544 256 544s-30.5-8.4-38.4-22.2l-61.3-105.8-117 0c-21.7 0-39.4-17.6-39.4-39.4 0-6.9 1.8-13.7 5.3-19.7L63.7 256 5.3 155.1C1.8 149.1 0 142.3 0 135.4 0 113.6 17.6 96 39.4 96l117 0 61.3-105.8C225.5-23.6 240.2-32 256-32s30.5 8.4 38.4 22.2l61.3 105.8 117 0c21.7 0 39.4 17.6 39.4 39.4 0 6.9-1.8 13.7-5.3 19.7L448.3 256zM388.1 152l27.8 48.1 27.8-48.1-55.7 0zM291 96l-35-60.4-35 60.4 70 0zM123.9 152l-55.7 0 27.8 48.1 27.8-48.1zM96.1 311.9l-27.8 48.1 55.7 0-27.8-48.1zM221 416l35 60.4 35-60.4-70 0z\"]\n};\nvar faNotesMedical = {\n  prefix: 'fas',\n  iconName: 'notes-medical',\n  icon: [512, 512, [], \"f481\", \"M96 352c0 35.3 28.7 64 64 64l181.5 0c17 0 33.3-6.7 45.3-18.7L493.3 290.7c12-12 18.7-28.3 18.7-45.3L512 64c0-35.3-28.7-64-64-64L160 0C124.7 0 96 28.7 96 64l0 288zM288 112l32 0c8.8 0 16 7.2 16 16l0 48 48 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-48 0 0 48c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-48-48 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l48 0 0-48c0-8.8 7.2-16 16-16zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 448c0 35.3 28.7 64 64 64l264 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L64 464c-8.8 0-16-7.2-16-16l0-328z\"]\n};\nvar faAustralSign = {\n  prefix: 'fas',\n  iconName: 'austral-sign',\n  icon: [448, 512, [], \"e0a9\", \"M266.5 240l-85 0 42.5-106.4 42.5 106.4zm68.9 0L262.9 58.3C256.5 42.4 241.1 32 224 32s-32.5 10.4-38.9 26.3L112.6 240 32 240c-13.3 0-24 10.7-24 24s10.7 24 24 24l61.4 0-19.2 48-42.3 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l23.1 0-20.8 52.1c-6.6 16.4 1.4 35 17.9 41.6s35-1.4 41.6-17.9l30.3-75.9 200 0 30.3 75.9c6.6 16.4 25.2 24.4 41.6 17.9s24.4-25.2 17.9-41.6L392.9 384 416 384c13.3 0 24-10.7 24-24s-10.7-24-24-24l-42.3 0-19.2-48 61.4 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80.6 0zm-49.7 48l19.2 48-161.6 0 19.2-48 123.3 0z\"]\n};\nvar faClipboardUser = {\n  prefix: 'fas',\n  iconName: 'clipboard-user',\n  icon: [384, 512, [], \"f7f3\", \"M311.4 32l8.6 0c35.3 0 64 28.7 64 64l0 352c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l8.6 0C83.6 12.9 104.3 0 128 0L256 0c23.7 0 44.4 12.9 55.4 32zM248 112c13.3 0 24-10.7 24-24s-10.7-24-24-24L136 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0zM192 344a56 56 0 1 0 0-112 56 56 0 1 0 0 112zM98.3 413c-12.9 15.6 2.2 35 22.4 35l142.5 0c20.2 0 35.3-19.4 22.4-35-14.7-17.7-36.9-29-61.7-29l-64 0c-24.8 0-47 11.3-61.7 29z\"]\n};\nvar faFileImage = {\n  prefix: 'fas',\n  iconName: 'file-image',\n  icon: [384, 512, [128443], \"f1c5\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM128 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM92.6 448l198.8 0c15.8 0 28.6-12.8 28.6-28.6 0-7.3-2.8-14.4-7.9-19.7L215.3 297.9c-6-6.3-14.4-9.9-23.2-9.9l-.3 0c-8.8 0-17.1 3.6-23.2 9.9L71.9 399.7C66.8 405 64 412.1 64 419.4 64 435.2 76.8 448 92.6 448z\"]\n};\nvar faSquareCaretRight = {\n  prefix: 'fas',\n  iconName: 'square-caret-right',\n  icon: [448, 512, [\"caret-square-right\"], \"f152\", \"M448 96c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320zM320 256c0 6.7-2.8 13-7.7 17.6l-112 104c-7 6.5-17.2 8.2-25.9 4.4S160 369.5 160 360l0-208c0-9.5 5.7-18.2 14.4-22s18.9-2.1 25.9 4.4l112 104c4.9 4.5 7.7 10.9 7.7 17.6z\"]\n};\nvar faCaretSquareRight = faSquareCaretRight;\nvar faVial = {\n  prefix: 'fas',\n  iconName: 'vial',\n  icon: [512, 512, [129514], \"f492\", \"M342.6 9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L306.7 64 28.1 342.6C10.1 360.6 0 385 0 410.5L0 416c0 53 43 96 96 96l5.5 0c25.5 0 49.9-10.1 67.9-28.1l278.6-278.6 9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160zM205.3 256l146.7-146.7 50.7 50.7-96 96-101.5 0z\"]\n};\nvar faHelicopter = {\n  prefix: 'fas',\n  iconName: 'helicopter',\n  icon: [576, 512, [128641], \"f533\", \"M176 32c-13.3 0-24 10.7-24 24s10.7 24 24 24l152 0 0 48-220.8 0-32.8-39.4C69.9 83.2 63.1 80 56 80L24 80C15.7 80 8 84.3 3.6 91.4s-4.8 15.9-1.1 23.4l48 96C54.6 218.9 62.9 224 72 224l107.8 0 104 143.1c15.1 20.7 39.1 32.9 64.7 32.9l75.5 0c75.1 0 136-60.9 136-136S499.1 128 424 128l-48 0 0-48 152 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L176 32zM376 192l48 0c39.8 0 72 32.2 72 72s-32.2 72-72 72l-48 0 0-144zM552 416c-13.3 0-24 10.7-24 24 0 4.4-3.6 8-8 8l-272 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l272 0c30.9 0 56-25.1 56-56 0-13.3-10.7-24-24-24z\"]\n};\nvar faMitten = {\n  prefix: 'fas',\n  iconName: 'mitten',\n  icon: [448, 512, [], \"f7b5\", \"M352 384L64 384 5.4 178.9C1.8 166.4 0 153.4 0 140.3 0 62.8 62.8 0 140.3 0l3.4 0c66 0 123.5 44.9 139.5 108.9l31.4 125.8 17.6-20.1C344.8 200.2 362.9 192 382 192l2.8 0c34.9 0 63.3 28.3 63.3 63.3 0 15.9-6 31.2-16.8 42.9L352 384zM32 464c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32l0 16c0 17.7-14.3 32-32 32L64 512c-17.7 0-32-14.3-32-32l0-16z\"]\n};\nvar faGasPump = {\n  prefix: 'fas',\n  iconName: 'gas-pump',\n  icon: [512, 512, [9981], \"f52f\", \"M32 64C32 28.7 60.7 0 96 0L256 0c35.3 0 64 28.7 64 64l0 192 8 0c48.6 0 88 39.4 88 88l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-154c-27.6-7.1-48-32.2-48-62l0-59.5-25.8-28.3c-8.9-9.8-8.2-25 1.6-33.9s25-8.2 33.9 1.6l71.7 78.8c9.4 10.3 14.6 23.7 14.6 37.7L512 376c0 39.8-32.2 72-72 72s-72-32.2-72-72l0-32c0-22.1-17.9-40-40-40l-8 0 0 161.4c9.3 3.3 16 12.2 16 22.6 0 13.3-10.7 24-24 24L40 512c-13.3 0-24-10.7-24-24 0-10.5 6.7-19.3 16-22.6L32 64zM96 80l0 96c0 8.8 7.2 16 16 16l128 0c8.8 0 16-7.2 16-16l0-96c0-8.8-7.2-16-16-16L112 64c-8.8 0-16 7.2-16 16z\"]\n};\nvar faEnvelopeCircleCheck = {\n  prefix: 'fas',\n  iconName: 'envelope-circle-check',\n  icon: [640, 512, [], \"e4e8\", \"M64 112c0-26.5 21.5-48 48-48l416 0c26.5 0 48 21.5 48 48l0 81.4c-24.4-11.2-51.4-17.4-80-17.4-87.7 0-161.7 58.8-184.7 139.2-7.1-1.3-14.1-4.2-20.1-8.8l-208-156C71.1 141.3 64 127.1 64 112zM304 368c0 28.6 6.2 55.6 17.4 80L128 448c-35.3 0-64-28.7-64-64l0-188 198.4 148.8c12.6 9.4 26.9 15.4 41.7 17.9 0 1.8-.1 3.5-.1 5.3zm48 0a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm201.4-60.9c-7.1-5.2-17.2-3.6-22.4 3.5l-53 72.9-26.8-26.8c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c3.3 3.3 7.9 5 12.6 4.6s8.9-2.8 11.7-6.5l64-88c5.2-7.1 3.6-17.2-3.5-22.3z\"]\n};\nvar faPersonSkating = {\n  prefix: 'fas',\n  iconName: 'person-skating',\n  icon: [512, 512, [\"skating\"], \"f7c5\", \"M368 56a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM128 128c0-17.7 14.3-32 32-32l150.1 0c49.9 0 74.9 60.3 39.6 95.6l-63.9 63.9 69.8 31c17.3 7.7 28.5 24.9 28.5 43.9l0 85.6c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-75.2-82.4-36.6c-41-18.2-51-72-19.3-103.7l40.4-40.4-98.7 0c-17.7 0-32-14.3-32-32zM89.4 361.4l75.9-75.9c7.7 19.7 21.6 37.3 41 49.6l-71.6 71.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3zm346.5 87.1c8.6 2.1 13.8 10.8 11.6 19.4l-.4 1.7c-6.2 24.9-28.6 42.4-54.3 42.4L304 512c-8.8 0-16-7.2-16-16s7.2-16 16-16l88.8 0c11 0 20.6-7.5 23.3-18.2l.4-1.7c2.1-8.6 10.8-13.8 19.4-11.6zM143.2 486.3l-6.2 3.1c-21.6 10.8-47.6 6.6-64.6-10.5L12.7 419.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l59.6 59.6c7.3 7.3 18.5 9.1 27.7 4.5l6.2-3.1c7.9-4 17.5-.7 21.5 7.2s.7 17.5-7.2 21.5z\"]\n};\nvar faSkating = faPersonSkating;\nvar faSun = {\n  prefix: 'fas',\n  iconName: 'sun',\n  icon: [576, 512, [9728], \"f185\", \"M288-32c8.4 0 16.3 4.4 20.6 11.7L364.1 72.3 468.9 46c8.2-2 16.9 .4 22.8 6.3S500 67 498 75.1l-26.3 104.7 92.7 55.5c7.2 4.3 11.7 12.2 11.7 20.6s-4.4 16.3-11.7 20.6L471.7 332.1 498 436.8c2 8.2-.4 16.9-6.3 22.8S477 468 468.9 466l-104.7-26.3-55.5 92.7c-4.3 7.2-12.2 11.7-20.6 11.7s-16.3-4.4-20.6-11.7L211.9 439.7 107.2 466c-8.2 2-16.8-.4-22.8-6.3S76 445 78 436.8l26.2-104.7-92.6-55.5C4.4 272.2 0 264.4 0 256s4.4-16.3 11.7-20.6L104.3 179.9 78 75.1c-2-8.2 .3-16.8 6.3-22.8S99 44 107.2 46l104.7 26.2 55.5-92.6 1.8-2.6c4.5-5.7 11.4-9.1 18.8-9.1zm0 144a144 144 0 1 0 0 288 144 144 0 1 0 0-288zm0 240a96 96 0 1 1 0-192 96 96 0 1 1 0 192z\"]\n};\nvar faBaseball = {\n  prefix: 'fas',\n  iconName: 'baseball',\n  icon: [512, 512, [129358, 9918, \"baseball-ball\"], \"f433\", \"M232.4 1.1c-122.2 11.4-219.5 108.7-230.9 230.9 16.2-.1 32-1.8 47.2-5 13-2.7 25.7 5.5 28.4 18.5s-5.5 25.7-18.5 28.4c-18.4 3.9-37.6 6-57.1 6.1 11.4 122.2 108.7 219.5 230.9 230.9 .1-19.5 2.2-38.7 6.1-57.1 2.7-13 15.5-21.3 28.4-18.5s21.3 15.5 18.5 28.4c-3.2 15.2-4.9 31-5 47.2 122.2-11.4 219.5-108.7 230.9-230.9-16.2 .1-32 1.8-47.2 5-13 2.7-25.7-5.5-28.4-18.5s5.5-25.7 18.5-28.4c18.4-3.9 37.6-6 57.1-6.1-11.4-122.2-108.7-219.5-230.9-230.9-.1 19.5-2.2 38.7-6.1 57.1-2.7 13-15.5 21.3-28.4 18.5s-21.3-15.5-18.5-28.4c3.2-15.2 4.9-31 5-47.2zm2.8 151.4c-21.4 32.9-49.5 60.9-82.3 82.3-11.1 7.2-26 4.1-33.2-7s-4.1-26 7-33.2c27.2-17.7 50.5-41 68.3-68.3 7.2-11.1 22.1-14.3 33.2-7s14.3 22.1 7 33.2zM393.1 284.2c7.2 11.1 4.1 26-7 33.2-27.2 17.7-50.5 41-68.3 68.3-7.2 11.1-22.1 14.3-33.2 7s-14.3-22.1-7-33.2c21.4-32.9 49.5-60.9 82.3-82.3 11.1-7.2 26-4.1 33.2 7z\"]\n};\nvar faBaseballBall = faBaseball;\nvar faImage = {\n  prefix: 'fas',\n  iconName: 'image',\n  icon: [448, 512, [], \"f03e\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 80a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM272 224c8.4 0 16.1 4.4 20.5 11.5l88 144c4.5 7.4 4.7 16.7 .5 24.3S368.7 416 360 416L88 416c-8.9 0-17.2-5-21.3-12.9s-3.5-17.5 1.6-24.8l56-80c4.5-6.4 11.8-10.2 19.7-10.2s15.2 3.8 19.7 10.2l26.4 37.8 61.4-100.5c4.4-7.1 12.1-11.5 20.5-11.5z\"]\n};\nvar faNotdef = {\n  prefix: 'fas',\n  iconName: 'notdef',\n  icon: [384, 512, [], \"e1fe\", \"M64 390.3L153.5 256 64 121.7 64 390.3zM102.5 448L281.5 448 192 313.7 102.5 448zm128-192L320 390.3 320 121.7 230.5 256zM281.5 64L102.5 64 192 198.3 281.5 64zM0 48C0 21.5 21.5 0 48 0L336 0c26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 48z\"]\n};\nvar faBasketball = {\n  prefix: 'fas',\n  iconName: 'basketball',\n  icon: [512, 512, [127936, \"basketball-ball\"], \"f434\", \"M92.7 58.8l78.4 78.4c18.2-25 28.9-55.9 28.9-89.2 0-14.1-1.9-27.7-5.5-40.6-38 9.4-72.6 27.2-101.8 51.4zM58.8 92.7c-24.2 29.2-42 63.8-51.4 101.8 12.9 3.6 26.5 5.5 40.6 5.5 33.3 0 64.1-10.7 89.2-28.9L58.8 92.7zM256 0c-4.6 0-9.2 .1-13.7 .4 3.7 15.3 5.7 31.2 5.7 47.6 0 46.6-15.9 89.4-42.6 123.4L256 222.1 419.3 58.8C374.9 22.1 318.1 0 256 0zM48 248c-16.4 0-32.4-2-47.6-5.7-.2 4.5-.4 9.1-.4 13.7 0 62.1 22.1 118.9 58.8 163.3L222.1 256 171.4 205.4C137.4 232.1 94.6 248 48 248zm463.6 21.7c.2-4.5 .4-9.1 .4-13.7 0-62.1-22.1-118.9-58.8-163.3L289.9 256 340.6 306.6c34-26.7 76.9-42.6 123.4-42.6 16.4 0 32.4 2 47.6 5.7zm-7.1 47.8c-12.9-3.6-26.5-5.5-40.6-5.5-33.3 0-64.1 10.7-89.2 28.9l78.4 78.4c24.2-29.2 42-63.8 51.4-101.8zM340.9 374.8c-18.2 25-28.9 55.9-28.9 89.2 0 14.1 1.9 27.7 5.5 40.6 38-9.4 72.6-27.2 101.8-51.4l-78.4-78.4zm-34.3-34.3L256 289.9 92.7 453.2c44.3 36.7 101.2 58.8 163.3 58.8 4.6 0 9.2-.1 13.7-.4-3.7-15.3-5.7-31.2-5.7-47.6 0-46.6 15.9-89.4 42.6-123.4z\"]\n};\nvar faBasketballBall = faBasketball;\nvar faPencil = {\n  prefix: 'fas',\n  iconName: 'pencil',\n  icon: [512, 512, [9999, 61504, \"pencil-alt\"], \"f303\", \"M36.4 353.2c4.1-14.6 11.8-27.9 22.6-38.7l181.2-181.2 33.9-33.9c16.6 16.6 51.3 51.3 104 104l33.9 33.9-33.9 33.9-181.2 181.2c-10.7 10.7-24.1 18.5-38.7 22.6L30.4 510.6c-8.3 2.3-17.3 0-23.4-6.2S-1.4 489.3 .9 481L36.4 353.2zm55.6-3.7c-4.4 4.7-7.6 10.4-9.3 16.6l-24.1 86.9 86.9-24.1c6.4-1.8 12.2-5.1 17-9.7L91.9 349.5zm354-146.1c-16.6-16.6-51.3-51.3-104-104L308 65.5C334.5 39 349.4 24.1 352.9 20.6 366.4 7 384.8-.6 404-.6S441.6 7 455.1 20.6l35.7 35.7C504.4 69.9 512 88.3 512 107.4s-7.6 37.6-21.2 51.1c-3.5 3.5-18.4 18.4-44.9 44.9z\"]\n};\nvar faPencilAlt = faPencil;\nvar faPersonWalkingArrowLoopLeft = {\n  prefix: 'fas',\n  iconName: 'person-walking-arrow-loop-left',\n  icon: [640, 512, [], \"e551\", \"M160 80a56 56 0 1 0 0-112 56 56 0 1 0 0 112zM73.4 227.9l22.6-22.6 0 69.3c0 28 12.2 54.7 33.5 72.9l71.4 61.2c5.9 5.1 9.8 12.1 10.9 19.8l12.6 88.1c2.5 17.5 18.7 29.7 36.2 27.2s29.7-18.7 27.2-36.2l-12.6-88.1c-3.3-23.1-14.9-44.1-32.6-59.3l-34.5-29.6 0-115.2 3.8 4.7c18.2 22.8 45.8 36 75 36l33.2 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-33.2 0c-9.7 0-18.9-4.4-25-12l-17.9-22.4c-23-28.8-57.9-45.6-94.8-45.6-32.2 0-63.1 12.8-85.8 35.6L28.1 182.6C10.1 200.6 0 225 0 250.5L0 288c0 17.7 14.3 32 32 32s32-14.3 32-32l0-37.5c0-8.5 3.4-16.6 9.4-22.6zM85.8 407.3c-1.5 5.2-4.3 10-8.1 13.8L9.4 489.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.3-68.3c11.5-11.5 19.9-25.8 24.4-41.5l2.2-7.6-46-39.4c-2.5-2.2-5-4.4-7.4-6.8L85.8 407.3zM359 335c-9.4 9.4-9.4 24.6 0 33.9l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-31-31 102.1 0c1.2 0 2.4-.1 3.5-.3 56.1-3.9 100.5-50.6 100.5-107.7 0-59.6-48.4-108-108-108l-92 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l92 0c33.1 0 60 26.9 60 60s-26.9 60-60 60l-98.1 0 31-31c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-72 72z\"]\n};\nvar faDiceSix = {\n  prefix: 'fas',\n  iconName: 'dice-six',\n  icon: [448, 512, [9861], \"f526\", \"M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm160 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faAnglesDown = {\n  prefix: 'fas',\n  iconName: 'angles-down',\n  icon: [384, 512, [\"angle-double-down\"], \"f103\", \"M214.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L192 402.7 329.4 265.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-160 160zm160-352l-160 160c-12.5 12.5-32.8 12.5-45.3 0l-160-160c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L192 210.7 329.4 73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3z\"]\n};\nvar faAngleDoubleDown = faAnglesDown;\nvar faSyringe = {\n  prefix: 'fas',\n  iconName: 'syringe',\n  icon: [576, 512, [128137], \"f48e\", \"M497.5-17c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l15 15-46.1 46.1-63-63c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l7 7-78.1 78.1 41 41c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-41-41-46.1 46.1 41 41c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-41-41-37.7 37.7c-10.5 10.5-16.4 24.7-16.4 39.6l0 88.8-57 57c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l57-57 88.8 0c14.9 0 29.1-5.9 39.6-16.4l229.7-229.7 7 7c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-63-63 46.1-46.1 15 15c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-64-64z\"]\n};\nvar faWheatAwn = {\n  prefix: 'fas',\n  iconName: 'wheat-awn',\n  icon: [576, 512, [\"wheat-alt\"], \"e2cd\", \"M79.7 234.6c6.2-4.1 14.7-3.4 20.1 2.1l46.1 46.1 6.1 6.7c19.7 23.8 26.3 55 19.2 83.9 31.7-7.7 66.2 1 90.6 25.3l46.1 46.1c6.2 6.2 6.2 16.4 0 22.6l-7.4 7.4c-37.5 37.5-98.3 37.5-135.8 0L134.1 444.3 49.4 529c-9.4 9.4-24.5 9.4-33.9 0-9.4-9.4-9.4-24.6 0-33.9l84.7-84.7-30.5-30.5c-37.5-37.5-37.5-98.3 0-135.7l7.4-7.4 2.5-2.1zm104-104c6.2-4.1 14.7-3.4 20.1 2.1l46.1 46.1 6.1 6.7c19.7 23.8 26.3 55 19.2 83.9 31.7-7.7 66.2 1 90.6 25.3l46.1 46.1c6.2 6.2 6.2 16.4 0 22.6l-7.4 7.4c-37.5 37.5-98.3 37.5-135.8 0l-94.9-94.9c-37.5-37.5-37.5-98.3 0-135.7l7.4-7.4 2.5-2.1zM495.2 15c9.4-9.4 24.6-9.4 34 0 8.8 8.8 9.3 22.7 1.6 32.2L529.2 49 414.7 163.4c7.7 1 15.2 3 22.5 5.9L495.5 111c9.4-9.4 24.6-9.4 34 0 8.8 8.8 9.3 22.7 1.6 32.1l-1.7 1.8-52.7 52.7 39 39c6.2 6.2 6.2 16.4 0 22.6l-7.4 7.4c-37.5 37.5-98.3 37.5-135.8 0l-94.9-94.9c-37.5-37.5-37.5-98.3 0-135.7l7.4-7.4 2.5-2.1c6.2-4.1 14.7-3.4 20.1 2.1l39 39 52.7-52.7c9.4-9.4 24.6-9.4 34 0 8.8 8.8 9.3 22.7 1.6 32.1l-1.7 1.8-58.3 58.3c2.8 7.1 4.7 14.5 5.7 22.1L495.2 15z\"]\n};\nvar faWheatAlt = faWheatAwn;\nvar faPlaneUp = {\n  prefix: 'fas',\n  iconName: 'plane-up',\n  icon: [512, 512, [], \"e22d\", \"M200 24c0-30.9 25.1-56 56-56s56 25.1 56 56l0 127.3 173.6 159.2c6.6 6.1 10.4 14.6 10.4 23.6l0 43.7c0 10.9-10.7 18.6-21.1 15.2l-162.9-54.3 0 99.7 66 52.8c3.8 3 6 7.6 6 12.5l0 19.8c0 10.4-9.8 18-19.9 15.5L256 512 147.9 539c-10.1 2.5-19.9-5.1-19.9-15.5l0-19.8c0-4.9 2.2-9.5 6-12.5l66-52.8 0-99.7-162.9 54.3C26.7 396.4 16 388.7 16 377.8l0-43.7c0-9 3.8-17.5 10.4-23.6L200 151.3 200 24z\"]\n};\nvar faAlignCenter = {\n  prefix: 'fas',\n  iconName: 'align-center',\n  icon: [448, 512, [], \"f037\", \"M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z\"]\n};\nvar faHockeyPuck = {\n  prefix: 'fas',\n  iconName: 'hockey-puck',\n  icon: [512, 512, [], \"f453\", \"M256 256C114.6 256 0 213 0 160s114.6-96 256-96 256 43 256 96-114.6 96-256 96zM0 352L0 242.7c16.9 12.3 37 22.2 58.1 30.1 53 19.9 123 31.2 197.9 31.2s144.9-11.3 197.9-31.2c21.2-7.9 41.2-17.8 58.1-30.1L512 352c0 53-114.6 96-256 96S0 405 0 352z\"]\n};\nvar faCircleArrowLeft = {\n  prefix: 'fas',\n  iconName: 'circle-arrow-left',\n  icon: [512, 512, [\"arrow-circle-left\"], \"f0a8\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM135 239l80-80c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-39 39 150.1 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-150.1 0 39 39c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-80-80c-9.4-9.4-9.4-24.6 0-33.9z\"]\n};\nvar faArrowCircleLeft = faCircleArrowLeft;\nvar faPlugCircleBolt = {\n  prefix: 'fas',\n  iconName: 'plug-circle-bolt',\n  icon: [640, 512, [], \"e55b\", \"M192-32c17.7 0 32 14.3 32 32l0 96 128 0 0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 48.7c-98.6 8.1-176 90.7-176 191.3 0 27.3 5.7 53.3 16 76.9l0 3.1c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7C165.2 398.1 96 319.1 96 224l0-64c-17.7 0-32-14.3-32-32S78.3 96 96 96l64 0 0-96c0-17.7 14.3-32 32-32zM352 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm177.4-77c-5.8-4.2-13.8-4-19.4 .5l-80 64c-5.3 4.2-7.4 11.4-5.1 17.8S433.2 416 440 416l32.9 0-15.9 42.4c-2.5 6.7-.2 14.3 5.6 18.6s13.8 4 19.4-.5l80-64c5.3-4.2 7.4-11.4 5.1-17.8S558.8 384 552 384l-32.9 0 15.9-42.4c2.5-6.7 .2-14.3-5.6-18.6z\"]\n};\nvar faRestroom = {\n  prefix: 'fas',\n  iconName: 'restroom',\n  icon: [640, 512, [], \"f7bd\", \"M80 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm40 304l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-154.8c-8.1 9.2-21.1 13.2-33.5 9.4-16.9-5.3-26.3-23.2-21-40.1l29.7-95.2C44.4 156.9 83.6 128 128 128s83.6 28.9 96.8 71.2l29.7 95.2c5.3 16.9-4.1 34.8-21 40.1-12.4 3.9-25.4-.2-33.5-9.4L200 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-16 0zM320 0c13.3 0 24 10.7 24 24l0 464c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-464c0-13.3 10.7-24 24-24zM464 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM440 480l0-96-17.8 0c-10.9 0-18.6-10.7-15.2-21.1l9-26.9c-3.2 0-6.4-.5-9.5-1.5-16.9-5.3-26.3-23.2-21-40.1l29.7-95.2C428.4 156.9 467.6 128 512 128s83.6 28.9 96.8 71.2l29.7 95.2c5.3 16.9-4.1 34.8-21 40.1-3.2 1-6.4 1.5-9.5 1.5l9 26.9c3.5 10.4-4.3 21.1-15.2 21.1l-17.8 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-16 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32z\"]\n};\nvar faAnchorLock = {\n  prefix: 'fas',\n  iconName: 'anchor-lock',\n  icon: [640, 512, [], \"e4ad\", \"M320.5 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm-32-96c-53 0-96 43-96 96 0 41.8 26.7 77.4 64 90.5l0 257.9c-62.9-14.3-110.2-69.7-111.9-136.5l16.1 14.1c10 8.7 25.1 7.7 33.9-2.3s7.7-25.1-2.3-33.9l-64-56c-9-7.9-22.6-7.9-31.6 0l-64 56c-10 8.7-11 23.9-2.3 33.9s23.9 11 33.9 2.3l16.2-14.2c2.1 113.1 94.4 204.1 208 204.1 28.3 0 55.4-5.7 80-15.9l0-.2 0-72.2c-14.4 9.6-30.6 16.7-48 20.7l0-257.9c37.3-13.2 64-48.7 64-90.5 0-53-43-96-96-96zm272 304.1l0 47.9-64 0 0-47.9c0-17.7 14.3-32 32-32s32 14.3 32 32zM416.5 400l0 96c0 26.5 21.5 48 48 48l128 0c26.5 0 48-21.5 48-48l0-96c0-20.9-13.4-38.7-32-45.3l0-50.6c0-44.2-35.8-80-80-80s-80 35.8-80 80l0 50.6c-18.6 6.6-32 24.4-32 45.3z\"]\n};\nvar faTimeline = {\n  prefix: 'fas',\n  iconName: 'timeline',\n  icon: [576, 512, [], \"e29c\", \"M160 169.3c28.3-12.3 48-40.5 48-73.3 0-44.2-35.8-80-80-80S48 51.8 48 96c0 32.8 19.7 61 48 73.3l0 54.7-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0 0 54.7c-28.3 12.3-48 40.5-48 73.3 0 44.2 35.8 80 80 80s80-35.8 80-80c0-32.8-19.7-61-48-73.3l0-54.7 224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-54.7c28.3-12.3 48-40.5 48-73.3 0-44.2-35.8-80-80-80s-80 35.8-80 80c0 32.8 19.7 61 48 73.3l0 54.7-256 0 0-54.7z\"]\n};\nvar faLightbulb = {\n  prefix: 'fas',\n  iconName: 'lightbulb',\n  icon: [384, 512, [128161], \"f0eb\", \"M292.9 384c7.3-22.3 21.9-42.5 38.4-59.9 32.7-34.4 52.7-80.9 52.7-132.1 0-106-86-192-192-192S0 86 0 192c0 51.2 20 97.7 52.7 132.1 16.5 17.4 31.2 37.6 38.4 59.9l201.7 0zM288 432l-192 0 0 16c0 44.2 35.8 80 80 80l32 0c44.2 0 80-35.8 80-80l0-16zM184 112c-39.8 0-72 32.2-72 72 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-66.3 53.7-120 120-120 13.3 0 24 10.7 24 24s-10.7 24-24 24z\"]\n};\nvar faCircleArrowRight = {\n  prefix: 'fas',\n  iconName: 'circle-arrow-right',\n  icon: [512, 512, [\"arrow-circle-right\"], \"f0a9\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm41-159c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l39-39-150.1 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l150.1 0-39-39c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80z\"]\n};\nvar faArrowCircleRight = faCircleArrowRight;\nvar faMarsAndVenus = {\n  prefix: 'fas',\n  iconName: 'mars-and-venus',\n  icon: [512, 512, [9893], \"f224\", \"M368 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l112 0c17.7 0 32 14.3 32 32l0 112c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-34.7-63 63c19.5 28.4 31 62.7 31 99.8 0 86.3-62.1 158.1-144 173.1l0 34.9 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-34.9c-81.9-15-144-86.8-144-173.1 0-97.2 78.8-176 176-176 37 0 71.4 11.4 99.8 31l63-63-34.7 0zM352 208a112 112 0 1 0 -224 0 112 112 0 1 0 224 0z\"]\n};\nvar faNetworkWired = {\n  prefix: 'fas',\n  iconName: 'network-wired',\n  icon: [576, 512, [], \"f6ff\", \"M248 88l80 0 0 48-80 0 0-48zm-8-56c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l16 0 0 32-224 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 0 32-16 0c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l96 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-16 0 0-32 192 0 0 32-16 0c-26.5 0-48 21.5-48 48l0 64c0 26.5 21.5 48 48 48l96 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-16 0 0-32 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0 0-32 16 0c26.5 0 48-21.5 48-48l0-64c0-26.5-21.5-48-48-48l-96 0zM448 376l8 0 0 48-80 0 0-48 72 0zm-256 0l8 0 0 48-80 0 0-48 72 0z\"]\n};\nvar faBuildingShield = {\n  prefix: 'fas',\n  iconName: 'building-shield',\n  icon: [576, 512, [], \"e4d8\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l201.2 0c-12.5-14.7-23.2-30.8-31.8-48l-89.5 0 0-80c0-17.7 14.3-32 32-32l32 0 0-26.7c0-18.1 6.1-35.2 16.6-48.8-.4-1.4-.6-2.9-.6-4.5l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 1 86.7-28.9c3.1-1 6.2-1.8 9.3-2.5L416 64c0-35.3-28.7-64-64-64L96 0zm32 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM128 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM445.3 488.5l-13.3 6.3 0-188.1 96 32 0 19.6c0 55.8-32.2 106.5-82.7 130.3zM421.9 259.5l-112 37.3c-13.1 4.4-21.9 16.6-21.9 30.4l0 31.1c0 74.4 43 142.1 110.2 173.7l18.5 8.7c4.8 2.2 10 3.4 15.2 3.4s10.5-1.2 15.2-3.4l18.5-8.7C533 500.3 576 432.6 576 358.2l0-31.1c0-13.8-8.8-26-21.9-30.4l-112-37.3c-6.6-2.2-13.7-2.2-20.2 0z\"]\n};\nvar faCode = {\n  prefix: 'fas',\n  iconName: 'code',\n  icon: [576, 512, [], \"f121\", \"M360.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm64.6 136.1c-12.5 12.5-12.5 32.8 0 45.3l73.4 73.4-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0zm-274.7 0c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 150.6 182.6c12.5-12.5 12.5-32.8 0-45.3z\"]\n};\nvar faFeatherPointed = {\n  prefix: 'fas',\n  iconName: 'feather-pointed',\n  icon: [512, 512, [\"feather-alt\"], \"f56b\", \"M475.3 .1c9.9-.8 19.6 3 26.6 10s10.8 16.7 10 26.6c-4 49.3-17.4 126.2-46.3 199.7-1.8 4.5-5.5 7.9-10.2 9.3L374.5 270c-3.9 1.2-6.5 4.7-6.5 8.8 0 5.1 4.1 9.2 9.2 9.2l38.6 0c12 0 19.7 12.8 13.5 23.1-4 6.7-8.3 13.2-12.7 19.6-2 2.9-5 5-8.4 6.1L310.5 366c-3.9 1.2-6.5 4.7-6.5 8.8 0 5.1 4.1 9.2 9.2 9.2l16 0c14.6 0 21 17.4 8.8 25.4-68 45-137.7 43.3-182.4 31.3-12.7-3.4-24-9.9-34.4-17.9L48 496c-8.8 8.8-23.2 8.8-32 0s-8.8-23.2 0-32l80-80 .5 .5c.7-1.3 1.6-2.5 2.7-3.6L256 224c8.8-8.8 8.8-23.2 0-32s-23.2-8.8-32 0L89.7 326.2c-8.9 8.9-24 4.4-25-8.2-4.3-53.2 9.3-123.1 72.6-186.4 91.1-91.1 254.2-124.7 337.9-131.5z\"]\n};\nvar faFeatherAlt = faFeatherPointed;\nvar faFileCircleQuestion = {\n  prefix: 'fas',\n  iconName: 'file-circle-question',\n  icon: [576, 512, [], \"e4ef\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-22.7-31.5-36-70.2-36-112 0-100.6 77.4-183.2 176-191.3l0-38.1c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-100c-11.6 0-21.3 8.2-23.5 19.2-1.8 8.7-10.2 14.3-18.9 12.5s-14.3-10.2-12.5-18.9c5.2-25.6 27.8-44.8 54.9-44.8 30.9 0 56 25.1 56 56 0 19.8-11.7 37.8-29.8 45.9l-10.4 4.6c-1.2 7.7-7.8 13.5-15.8 13.5-8.8 0-16-7.2-16-16 0-11.2 6.6-21.3 16.8-25.9l12.4-5.5c6.6-2.9 10.8-9.4 10.8-16.6 0-13.3-10.7-24-24-24z\"]\n};\nvar faSignature = {\n  prefix: 'fas',\n  iconName: 'signature',\n  icon: [640, 512, [], \"f5b7\", \"M192 128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 7.8c0 27.7-2.4 55.3-7.1 82.5l-84.4 25.3c-40.6 12.2-68.4 49.6-68.4 92l0 32.4-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72.5 0c4.2 36 34.8 64 72 64 26 0 50-13.9 62.9-36.5l13.9-24.3c26.8-47 46.5-97.7 58.4-150.5l94.4-28.3-12.5 37.5c-3.3 9.8-1.6 20.5 4.4 28.8S405.7 320 416 320l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-83.6 0 18-53.9c3.8-11.3 .9-23.8-7.4-32.4s-20.7-11.8-32.2-8.4L316.4 198.1c2.4-20.7 3.6-41.4 3.6-62.3l0-7.8c0-53-43-96-96-96s-96 43-96 96l0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32zm-9.2 177l49-14.7c-10.4 33.8-24.5 66.4-42.1 97.2l-13.9 24.3c-1.5 2.6-4.3 4.3-7.4 4.3-4.7 0-8.5-3.8-8.5-8.5l0-71.9c0-14.1 9.3-26.6 22.8-30.7zM616 416c13.3 0 24-10.7 24-24s-10.7-24-24-24l-292.9 0c-6.5 16.3-13.7 32.3-21.6 48L616 416z\"]\n};\nvar faEarthAmericas = {\n  prefix: 'fas',\n  iconName: 'earth-americas',\n  icon: [512, 512, [127758, \"earth\", \"earth-america\", \"globe-americas\"], \"f57d\", \"M55.7 199.7l30.9 30.9c6 6 14.1 9.4 22.6 9.4l21.5 0c8.5 0 16.6 3.4 22.6 9.4l29.3 29.3c6 6 9.4 14.1 9.4 22.6l0 37.5c0 8.5 3.4 16.6 9.4 22.6l13.3 13.3c6 6 9.4 14.1 9.4 22.6l0 18.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-2.7c0-8.5 3.4-16.6 9.4-22.6l45.3-45.3c6-6 9.4-14.1 9.4-22.6l0-34.7c0-17.7-14.3-32-32-32l-82.7 0c-8.5 0-16.6-3.4-22.6-9.4l-16-16c-4.2-4.2-6.6-10-6.6-16 0-12.5 10.1-22.6 22.6-22.6l34.7 0c12.5 0 22.6-10.1 22.6-22.6 0-6-2.4-11.8-6.6-16l-19.7-19.7C242 130 240 125.1 240 120s2-10 5.7-13.7l17.3-17.3c5.8-5.8 9.1-13.7 9.1-21.9 0-7.2-2.4-13.7-6.4-18.9-3.2-.1-6.4-.2-9.6-.2-95.4 0-175.7 64.2-200.3 151.7zM464 256c0-34.6-8.4-67.2-23.4-95.8-6.4 .9-12.7 3.9-17.9 9.1l-13.4 13.4c-6 6-9.4 14.1-9.4 22.6l0 34.7c0 17.7 14.3 32 32 32l24.1 0c2.5 0 5-.3 7.3-.8 .4-5 .5-10.1 .5-15.2zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z\"]\n};\nvar faEarth = faEarthAmericas;\nvar faEarthAmerica = faEarthAmericas;\nvar faGlobeAmericas = faEarthAmericas;\nvar faCarrot = {\n  prefix: 'fas',\n  iconName: 'carrot',\n  icon: [640, 512, [129365], \"f787\", \"M453.1-36.7L440.9-24.6c-31.2 31.2-31.2 81.9 0 113.1 15.6 15.6 31.2 31.2 46.9 46.9 31.2 31.2 81.9 31.2 113.1 0l12.1-12.1c6.2-6.2 6.2-16.4 0-22.6L600.9 88.6c-31.2-31.2-81.9-31.2-113.1 0 31.2-31.2 31.2-81.9 0-113.1L475.7-36.7c-6.2-6.2-16.4-6.2-22.6 0zM331.6 96c-45.2 0-87.1 20.4-115 54.3L273.3 207c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L191.6 193.2 67.2 466.8c-5.5 12.1-2.9 26.4 6.5 35.9s23.7 12 35.9 6.5l141.6-64.4-43.8-43.8c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l56.5 56.5 95.3-43.3c53.1-24.1 87.2-77.1 87.2-135.5 0-82.2-66.6-148.8-148.8-148.8z\"]\n};\nvar faTemperatureFull = {\n  prefix: 'fas',\n  iconName: 'temperature-full',\n  icon: [320, 512, [\"temperature-4\", \"thermometer-4\", \"thermometer-full\"], \"f2c7\", \"M160 0C107 0 64 43 64 96l0 164.7C34.5 287 16 325.4 16 368 16 447.5 80.5 512 160 512s144-64.5 144-144c0-42.6-18.5-81-48-107.3L256 96c0-53-43-96-96-96zm64 368c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-26.9 16.5-49.9 40-59.3L136 96c0-13.3 10.7-24 24-24s24 10.7 24 24l0 212.7c23.5 9.5 40 32.5 40 59.3z\"]\n};\nvar faTemperature4 = faTemperatureFull;\nvar faThermometer4 = faTemperatureFull;\nvar faThermometerFull = faTemperatureFull;\nvar faTableCellsRowLock = {\n  prefix: 'fas',\n  iconName: 'table-cells-row-lock',\n  icon: [640, 512, [], \"e67a\", \"M256 288l0-64 153.3 0c17.1-42.2 56-73.2 102.7-79l0-49c0-35.3-28.7-64-64-64L128 32C92.7 32 64 60.7 64 96l0 320c0 35.3 28.7 64 64 64l241.3 0c-.9-5.2-1.3-10.6-1.3-16.1l0-47.9-112 0 0-64 113.3 0c3.7-22 14.8-41.4 30.7-55.6l0-8.4-144 0zm0-192l192 0 0 64-192 0 0-64zM560 272.1l0 47.9-64 0 0-47.9c0-17.7 14.3-32 32-32s32 14.3 32 32zM416 368l0 96c0 26.5 21.5 48 48 48l128 0c26.5 0 48-21.5 48-48l0-96c0-20.9-13.4-38.7-32-45.3l0-50.6c0-44.2-35.8-80-80-80s-80 35.8-80 80l0 50.6c-18.6 6.6-32 24.4-32 45.3z\"]\n};\nvar faBoltLightning = {\n  prefix: 'fas',\n  iconName: 'bolt-lightning',\n  icon: [384, 512, [], \"e0b7\", \"M0 256L28.5 28c2-16 15.6-28 31.8-28L228.9 0c15 0 27.1 12.1 27.1 27.1 0 3.2-.6 6.5-1.7 9.5L208 160 347.3 160c20.2 0 36.7 16.4 36.7 36.7 0 7.4-2.2 14.6-6.4 20.7l-192.2 281c-5.9 8.6-15.6 13.7-25.9 13.7l-2.9 0c-15.7 0-28.5-12.8-28.5-28.5 0-2.3 .3-4.6 .9-6.9L176 288 32 288c-17.7 0-32-14.3-32-32z\"]\n};\nvar faCloudShowersWater = {\n  prefix: 'fas',\n  iconName: 'cloud-showers-water',\n  icon: [512, 512, [], \"e4e4\", \"M279.2 55.7C263.9 22.8 230.6 0 192 0 139 0 96 43 96 96 60.7 96 32 124.7 32 160s28.7 64 64 64l320 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-1.6 0c-7.4-36.5-39.7-64-78.4-64-22.2 0-42.3 9.1-56.8 23.7zM410.6 476.1c20.7 15.6 46 30.7 74.2 34.5 13.1 1.8 25.2-7.5 27-20.6s-7.5-25.2-20.6-27c-15.9-2.1-33.2-11.3-51.7-25.2-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-18.5 13.9-35.8 23.1-51.7 25.2-13.1 1.8-22.4 13.8-20.6 27s13.8 22.4 27 20.6c28.2-3.8 53.6-18.9 74.2-34.5 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9c21.3-16.1 49.9-16.1 71.2 0zM100.1 303.6c4.2-12.6-2.6-26.2-15.2-30.4s-26.2 2.6-30.4 15.2l-21.3 64C29 365 35.8 378.6 48.4 382.8s26.2-2.6 30.4-15.2l21.3-64zm120 0c4.2-12.6-2.6-26.2-15.2-30.4s-26.2 2.6-30.4 15.2l-21.3 64c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l21.3-64zm112 0c4.2-12.6-2.6-26.2-15.2-30.4s-26.2 2.6-30.4 15.2l-21.3 64c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l21.3-64zm120 0c4.2-12.6-2.6-26.2-15.2-30.4s-26.2 2.6-30.4 15.2l-21.3 64c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l21.3-64z\"]\n};\nvar faArrowUpLong = {\n  prefix: 'fas',\n  iconName: 'arrow-up-long',\n  icon: [320, 512, [\"long-arrow-up\"], \"f176\", \"M182.6-22.6c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L128 77.3 128 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-434.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128z\"]\n};\nvar faLongArrowUp = faArrowUpLong;\nvar faAddressCard = {\n  prefix: 'fas',\n  iconName: 'address-card',\n  icon: [576, 512, [62140, \"contact-card\", \"vcard\"], \"f2bb\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm80 256l64 0c44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16L80 384c-8.8 0-16-7.2-16-16 0-44.2 35.8-80 80-80zm-24-96a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm240-48l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-112 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm0 96l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-112 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faContactCard = faAddressCard;\nvar faVcard = faAddressCard;\nvar faAngleRight = {\n  prefix: 'fas',\n  iconName: 'angle-right',\n  icon: [256, 512, [8250], \"f105\", \"M247.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L179.2 256 41.9 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z\"]\n};\nvar faFaceMeh = {\n  prefix: 'fas',\n  iconName: 'face-meh',\n  icon: [512, 512, [128528, \"meh\"], \"f11a\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM176 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM176 320l160 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-160 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faMeh = faFaceMeh;\nvar faArrowUpFromGroundWater = {\n  prefix: 'fas',\n  iconName: 'arrow-up-from-ground-water',\n  icon: [640, 512, [], \"e4b5\", \"M303 7c9.4-9.4 24.6-9.4 33.9 0l88 88c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47 0 278.1c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-278.1-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L303 7zM240 192l0 163.1c-10.6-2.2-21.3-3.2-32-3.1-32.5 .2-64.9 10.7-92.3 31.4-8.8 6.6-15.9 10.9-21.7 13.5l-.8 .4c-3.7 1.7-6.4 2.9-9.8 .3-6-4.5-12.6-8-19.3-10.4L64 240c0-26.5 21.5-48 48-48l128 0zm336 48l0 155.2c-1.1 .8-2.2 1.5-3.3 2.4-4.1 3.1-8.3 .8-12.6-1.5-.6-.3-1.2-.6-1.8-1-5.2-2.7-11.1-6.6-18-11.7-28.1-21.1-61.3-31.6-94.4-31.4-15.5 .1-31 2.5-46 7.3l0-167.3 128 0c26.5 0 48 21.5 48 48zM403.4 476.1C379.1 494.3 351.1 512 320 512s-59.1-17.7-83.4-35.9c-21.3-16.1-49.9-16.1-71.2 0-23.8 17.9-54.1 35.5-88.1 35.3-20.4-.1-40.7-6.7-59.8-21.1-10.6-8-12.7-23-4.7-33.6s23-12.7 33.6-4.7c11.3 8.5 21.6 11.4 31.2 11.5 17.6 .1 37.3-9.4 58.9-25.7 38.4-29 90.5-29 129 0 24 18.1 40.7 26.3 54.5 26.3s30.5-8.2 54.5-26.3c38.4-29 90.5-29 129 0 16.9 12.7 32.9 21.5 47.8 24.6 13.7 2.8 27.4 .9 42.3-10.3 10.6-8 25.6-5.9 33.6 4.7s5.9 25.6-4.7 33.6c-26.4 19.9-54.2 24.4-80.7 19.1-25.3-5.1-48.1-18.9-67.2-33.3-21.3-16.1-49.9-16.1-71.2 0z\"]\n};\nvar faMap = {\n  prefix: 'fas',\n  iconName: 'map',\n  icon: [512, 512, [128506, 62072], \"f279\", \"M512 48c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4L349.5 77.5 170.1 17.6c-8.1-2.7-16.8-2.1-24.4 1.7l-128 64C6.8 88.8 0 99.9 0 112L0 464c0 11.1 5.7 21.4 15.2 27.2s21.2 6.4 31.1 1.4l116.1-58.1 179.4 59.8c8.1 2.7 16.8 2.1 24.4-1.7l128-64c10.8-5.4 17.7-16.5 17.7-28.6l0-352zM192 376.9l0-284.5 128 42.7 0 284.5-128-42.7z\"]\n};\nvar faUserPlus = {\n  prefix: 'fas',\n  iconName: 'user-plus',\n  icon: [640, 512, [], \"f234\", \"M285.7 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L77.7 512C61.3 512 48 498.7 48 482.3 48 383.8 127.8 304 226.3 304l59.4 0zM528 80c13.3 0 24 10.7 24 24l0 48 48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0 0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48-48 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0 0-48c0-13.3 10.7-24 24-24zM256 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240z\"]\n};\nvar faVenus = {\n  prefix: 'fas',\n  iconName: 'venus',\n  icon: [384, 512, [9792], \"f221\", \"M80 176a112 112 0 1 1 224 0 112 112 0 1 1 -224 0zM223.9 349.1C305.9 334.1 368 262.3 368 176 368 78.8 289.2 0 192 0S16 78.8 16 176c0 86.3 62.1 158.1 144.1 173.1-.1 1-.1 1.9-.1 2.9l0 64-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-64c0-1 0-1.9-.1-2.9z\"]\n};\nvar faDiagramSuccessor = {\n  prefix: 'fas',\n  iconName: 'diagram-successor',\n  icon: [448, 512, [], \"e47a\", \"M289.2 137.9c2.5-6 8.3-9.9 14.8-9.9l40 0 0-24c0-13.3-10.7-24-24-24l-98 0c1.3 5.1 2 10.5 2 16l0 64c0 35.3-28.7 64-64 64l-96 0c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l256 0c39.8 0 72 32.2 72 72l0 24 40 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-64 64c-6.2 6.2-16.4 6.2-22.6 0l-64-64c-4.6-4.6-5.9-11.5-3.5-17.4zM384 480L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l320 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64zM160 160l0-64-96 0 0 64 96 0z\"]\n};\nvar faHeadSideCoughSlash = {\n  prefix: 'fas',\n  iconName: 'head-side-cough-slash',\n  icon: [576, 512, [], \"e062\", \"M535-24.9c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L41 537.1c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l25-25 0-447.2c0-15 10.5-28.3 25.4-29.8 7.4-.7 14.9-1.1 22.6-1.1 112.7 0 206 83.3 221.7 191.7 .4 3 1.7 5.9 3.6 8.3l2.2 2.6 227.5-227.5zM133.8 512L288 357.8 288 416c0 53-43 96-96 96l-58.2 0zM176 224a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm336 40a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm-88 72a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm-64 48a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm128 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm24 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm-88-24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faDiagramProject = {\n  prefix: 'fas',\n  iconName: 'diagram-project',\n  icon: [512, 512, [\"project-diagram\"], \"f542\", \"M0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 16 128 0 0-16c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-16-128 0 0 16c0 7.3-1.7 14.3-4.6 20.5l68.6 91.5 80 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96c0-7.3 1.7-14.3 4.6-20.5L128 224 48 224c-26.5 0-48-21.5-48-48L0 80z\"]\n};\nvar faProjectDiagram = faDiagramProject;\nvar faTerminal = {\n  prefix: 'fas',\n  iconName: 'terminal',\n  icon: [512, 512, [], \"f120\", \"M9.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L146.7 256 9.4 118.6zM224 384l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faHouseFire = {\n  prefix: 'fas',\n  iconName: 'house-fire',\n  icon: [640, 512, [], \"e50c\", \"M448 192c14.1 .4 23.8 11.4 32.7 21.7 2 2.3 4 4.6 6 6.7l19 19.9 12.2-13.8c5.4-6.1 13.3-8.9 20.9-8.9 7.2 0 14.3 2.6 19.9 7.8 19.7 18.3 39.8 43.2 55 70.6 15.1 27.2 26.2 58.2 26.2 88.2 0 88.7-71.3 159.8-160 159.8-89.6 0-160-71.3-160-159.8 0-37.3 16-73.4 36.8-104.5 20.9-31.3 47.5-59 70.9-80.1 5.7-5.2 13.1-7.7 20.3-7.5zM268.6 6.5c12.2-9.3 29.7-8.7 41.2 2l147.5 137c-19.2-4.3-40 .5-55.5 14.4-36.4 32.6-67.7 69.8-90.3 106.4-10.3 16.6-19.7 34.9-26.8 53.7L272 320c-26.5 0-48 21.5-48 48l0 96 64.6 0c7.3 17.2 16.8 33.4 28.2 48L144 512c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208 2.4-2zM489.3 343.7c-5.4-4.7-13.1-4.7-18.5 0-17.7 15.4-54.7 51.9-54.7 88.4 0 35.3 28.7 64 64 64s64-28.7 64-64c0-36.5-37-73-54.7-88.4z\"]\n};\nvar faMask = {\n  prefix: 'fas',\n  iconName: 'mask',\n  icon: [576, 512, [], \"f6fa\", \"M288 64C64 64 0 160 0 272S80 448 176 448l8.4 0c24.2 0 46.4-13.7 57.2-35.4l23.2-46.3c4.4-8.8 13.3-14.3 23.2-14.3s18.8 5.5 23.2 14.3l23.2 46.3c10.8 21.7 33 35.4 57.2 35.4l8.4 0c96 0 176-64 176-176S512 64 288 64zM96 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm320-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z\"]\n};\nvar faHurricane = {\n  prefix: 'fas',\n  iconName: 'hurricane',\n  icon: [384, 512, [], \"f751\", \"M0 208C0 104.4 75.7 18.5 174.9 2.6 184 1.2 192 8.6 192 17.9l0 63.3c0 8.4 6.5 15.3 14.7 16.5 100.3 14.9 177.3 101.3 177.3 205.7 0 103.6-75.7 189.5-174.9 205.4-9.2 1.5-17.1-5.9-17.1-15.2l0-63.3C192 421.9 185.5 415 177.3 413.7 77 398.9 0 312.4 0 208zm288 48a96 96 0 1 0 -192 0 96 96 0 1 0 192 0zm-96-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faEarthAfrica = {\n  prefix: 'fas',\n  iconName: 'earth-africa',\n  icon: [512, 512, [127757, \"globe-africa\"], \"f57c\", \"M447.6 175c-31.6-74.6-105.5-127-191.6-127-22.1 0-43.4 3.5-63.4 9.8-.4 2-.6 4.1-.6 6.2l0 73.4c0 12.5 10.1 22.6 22.6 22.6 6 0 11.8-2.4 16-6.6l16-16c6-6 14.1-9.4 22.6-9.4l5.5 0c28.5 0 42.8 34.5 22.6 54.6-6 6-14.1 9.4-22.6 9.4l-61.5 0c-8.5 0-16.6 3.4-22.6 9.4l-21.3 21.3c-6 6-9.4 14.1-9.4 22.6l0 42.7c0 17.7 14.3 32 32 32l32 0c17.7 0 32 14.3 32 32l0 32c0 17.7 14.3 32 32 32l2.7 0c8.5 0 16.6-3.4 22.6-9.4l29.3-29.3c6-6 9.4-14.1 9.4-22.6l0-18.7c0-8.8 7.2-16 16-16s16-7.2 16-16l0-34.7c0-8.5-3.4-16.6-9.4-22.6l-16-16c-4.2-4.2-6.6-10-6.6-16 0-12.5 10.1-22.6 22.6-22.6l45 0c12.4 0 22.7-7.1 28-17zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z\"]\n};\nvar faGlobeAfrica = faEarthAfrica;\nvar faThumbtack = {\n  prefix: 'fas',\n  iconName: 'thumbtack',\n  icon: [384, 512, [128204, 128392, \"thumb-tack\"], \"f08d\", \"M32 32C32 14.3 46.3 0 64 0L320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-29.5 0 10.3 134.1c37.1 21.2 65.8 56.4 78.2 99.7l3.8 13.4c2.8 9.7 .8 20-5.2 28.1S362 352 352 352L32 352c-10 0-19.5-4.7-25.5-12.7s-8-18.4-5.2-28.1L5 297.8c12.4-43.3 41-78.5 78.2-99.7L93.5 64 64 64C46.3 64 32 49.7 32 32zM160 400l64 0 0 112c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-112z\"]\n};\nvar faThumbTack = faThumbtack;\nvar faHandPointDown = {\n  prefix: 'fas',\n  iconName: 'hand-point-down',\n  icon: [384, 512, [], \"f0a7\", \"M32 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-208-64 0 0 208zM224 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64zm-64 64c17.7 0 32-14.3 32-32l0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c0 17.7 14.3 32 32 32zm160-96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64zm-96-88l0 .6c9.4-5.4 20.3-8.6 32-8.6 13.2 0 25.4 4 35.6 10.8 8.7-24.9 32.5-42.8 60.4-42.8 11.7 0 22.6 3.1 32 8.6l0-8.6C384 71.6 312.4 0 224 0L162.3 0C119.8 0 79.1 16.9 49.1 46.9L37.5 58.5C13.5 82.5 0 115.1 0 149l0 27c0 35.3 28.7 64 64 64l88 0c22.1 0 40-17.9 40-40s-17.9-40-40-40l-56 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l56 0c39.8 0 72 32.2 72 72z\"]\n};\nvar faFaceMehBlank = {\n  prefix: 'fas',\n  iconName: 'face-meh-blank',\n  icon: [512, 512, [128566, \"meh-blank\"], \"f5a4\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm208-48a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm128 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faMehBlank = faFaceMehBlank;\nvar faTemperatureEmpty = {\n  prefix: 'fas',\n  iconName: 'temperature-empty',\n  icon: [320, 512, [\"temperature-0\", \"thermometer-0\", \"thermometer-empty\"], \"f2cb\", \"M64 96c0-53 43-96 96-96s96 43 96 96l0 164.7c29.5 26.4 48 64.7 48 107.3 0 79.5-64.5 144-144 144S16 447.5 16 368c0-42.6 18.5-81 48-107.3L64 96zm96 336c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64z\"]\n};\nvar faTemperature0 = faTemperatureEmpty;\nvar faThermometer0 = faTemperatureEmpty;\nvar faThermometerEmpty = faTemperatureEmpty;\nvar faBorderNone = {\n  prefix: 'fas',\n  iconName: 'border-none',\n  icon: [448, 512, [], \"f850\", \"M32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zM160 32a32 32 0 1 0 0 64 32 32 0 1 0 0-64zM288 416c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zM160 480c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zM288 32a32 32 0 1 0 0 64 32 32 0 1 0 0-64zM416 480c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm0-384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM32 32a32 32 0 1 0 0 64 32 32 0 1 0 0-64zM416 352a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM32 160a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM416 160a32 32 0 1 0 0 64 32 32 0 1 0 0-64z\"]\n};\nvar faHighlighter = {\n  prefix: 'fas',\n  iconName: 'highlighter',\n  icon: [576, 512, [], \"f591\", \"M315 315L473.4 99.9 444.1 70.6 229 229 315 315zm-187 5l0 0 0-71.7c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0 457.6 0 468.5 4.5 476.6 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5 0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5l-71.7 0-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l51.7-51.7 70.6 70.6-19.7 19.7c-4.5 4.5-10.6 7-17 7L24 512c-13.3 0-24-10.7-24-24l0-4.7c0-6.4 2.5-12.5 7-17z\"]\n};\nvar faMoneyBillWave = {\n  prefix: 'fas',\n  iconName: 'money-bill-wave',\n  icon: [512, 512, [], \"f53a\", \"M0 419.6L0 109.5c0-23.2 24.1-38.6 46.3-32 87.7 26.2 149.7 5.5 212.1-15.3 64.5-21.5 129.4-43.1 223.3-13.1 18.5 5.9 30.3 23.8 30.3 43.3l0 310.1c0 23.2-24.1 38.6-46.2 32-87.7-26.2-149.8-5.5-212.1 15.3-64.5 21.5-129.4 43.1-223.3 13.1-18.5-5.9-30.3-23.8-30.3-43.3zM336 256c0-53-35.8-96-80-96s-80 43-80 96 35.8 96 80 96 80-43 80-96zM120 413.6c4.4 0 7.9-3.8 7.2-8.1-4.6-27.8-27-49.5-55.2-53-4.4-.5-8 3.1-8 7.5l0 39.9c0 3.6 2.4 6.8 6 7.7 17.9 4.2 34.3 6.1 50 6.1zm318.5-51.1c5 .8 9.5-3 9.5-8l0-42.6c0-4.4-3.6-8.1-8-7.5-25.2 3.1-45.9 20.9-53.2 44.6-1.4 4.7 2.3 9.1 7.2 9.2 14.2 .4 29 1.7 44.4 4.3zM448 152l0-39.9c0-3.6-2.5-6.8-6-7.7-17.9-4.2-34.3-6.1-50-6.1-4.4 0-7.9 3.8-7.2 8.1 4.6 27.8 27 49.5 55.2 53 4.4 .5 8-3.1 8-7.5zM125.2 162.9c1.4-4.7-2.3-9.1-7.2-9.2-14.2-.4-29-1.7-44.4-4.3-5-.8-9.5 3-9.5 8L64 200c0 4.4 3.6 8.1 8 7.5 25.2-3.1 45.9-20.9 53.2-44.6z\"]\n};\nvar faToiletPaperSlash = {\n  prefix: 'fas',\n  iconName: 'toilet-paper-slash',\n  icon: [576, 512, [], \"e072\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-94.5-94.5c40.2-23 69.5-96.9 69.5-184.6 0-106-43-192-96-192s-96 86-96 192c0 24.1 2.2 47.2 6.3 68.4L304 238.2 304 224c0-58.9 11.8-114.5 33.2-157.2 5.9-11.7 13.1-23.7 21.9-34.8L128 32c-8.3 0-16.4 2.1-24.1 6.1l-63-63zM32 224l0 264c0 30.9 25.1 56 56 56l160 0c30.9 0 56-25.1 56-56l0-114.2-256-256C37.9 148.2 32 184.7 32 224zm416 64c-17.7 0-32-28.7-32-64s14.3-64 32-64 32 28.7 32 64-14.3 64-32 64z\"]\n};\nvar faFileShield = {\n  prefix: 'fas',\n  iconName: 'file-shield',\n  icon: [576, 512, [], \"e4f0\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l201.2 0C261 469.4 240 414.5 240 356.4l0-31.1c0-34.4 22-65 54.7-75.9l112-37.3c3.1-1 6.2-1.8 9.3-2.5l0-39.1c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zm87.8 312.5l-13.3 6.3 0-188.1 96 32 0 19.6c0 55.8-32.2 106.5-82.7 130.3zM421.9 259.5l-112 37.3c-13.1 4.4-21.9 16.6-21.9 30.4l0 31.1c0 74.4 43 142.1 110.2 173.7l18.5 8.7c4.8 2.2 10 3.4 15.2 3.4s10.5-1.2 15.2-3.4l18.5-8.7C533 500.3 576 432.6 576 358.2l0-31.1c0-13.8-8.8-26-21.9-30.4l-112-37.3c-6.6-2.2-13.7-2.2-20.2 0z\"]\n};\nvar faTextHeight = {\n  prefix: 'fas',\n  iconName: 'text-height',\n  icon: [576, 512, [], \"f034\", \"M40 32C17.9 32 0 49.9 0 72l0 56c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 64 0 0 320-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-320 64 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-56c0-22.1-17.9-40-40-40L40 32zM438.6 361.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4 0-229.5 9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64c-6-6-14.1-9.4-22.6-9.4s-16.6 3.4-22.6 9.4l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4 0 229.5-9.4-9.4z\"]\n};\nvar faFaceGrinTongue = {\n  prefix: 'fas',\n  iconName: 'face-grin-tongue',\n  icon: [512, 512, [128539, \"grin-tongue\"], \"f589\", \"M0 256c0 104.4 62.5 194.2 152.2 234.1-5.3-13-8.2-27.2-8.2-42.1l0-61.7c-16.9-16.5-30.1-36.7-38.3-59.3-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1c11.9-3.7 23.9 6.3 19.6 18.1-8.3 22.6-21.5 42.8-38.3 59.3l0 61.7c0 14.9-2.9 29.1-8.2 42.1 89.7-39.8 152.2-129.6 152.2-234.1 0-141.4-114.6-256-256-256S0 114.6 0 256zm176-80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm16 240l0-45.4c0-14.7-11.9-26.6-26.6-26.6l-2 0c-11.3 0-21.1 7.9-23.6 18.9-2.8 12.6-20.8 12.6-23.6 0-2.5-11.1-12.3-18.9-23.6-18.9l-2 0c-14.7 0-26.6 11.9-26.6 26.6l0 45.4c0 35.3 28.7 64 64 64s64-28.7 64-64z\"]\n};\nvar faGrinTongue = faFaceGrinTongue;\nvar faFileSignature = {\n  prefix: 'fas',\n  iconName: 'file-signature',\n  icon: [640, 512, [], \"f573\", \"M64.1 64c0-35.3 28.7-64 64-64L277.6 0c17 0 33.3 6.7 45.3 18.7L429.3 125.3c12 12 18.7 28.3 18.7 45.3l0 97.5-132 132-42.1 0-16.1-53.6c-4.7-15.7-19.1-26.4-35.5-26.4-11.3 0-21.9 5.1-28.9 13.9L133.3 409c-8.3 10.3-6.6 25.5 3.7 33.7s25.5 6.6 33.7-3.8l47.1-58.8 15.2 50.7c3 10.2 12.4 17.1 23 17.1l31.5 0c-.9 3.1-1.7 6.3-2.3 9.5l-10.9 54.5-146.2 0c-35.3 0-64-28.7-64-64l0-384zm208-5.5l0 93.5c0 13.3 10.7 24 24 24l93.5 0-117.5-117.5zm60.2 408.4c2.5-12.4 8.6-23.8 17.5-32.7l118.9-118.9 80 80-118.9 118.9c-8.9 8.9-20.3 15-32.7 17.5l-59.6 11.9c-.9 .2-1.9 .3-2.9 .3-8 0-14.6-6.5-14.6-14.6 0-1 .1-1.9 .3-2.9l11.9-59.6zm267.8-123l-28.8 28.8-80-80 28.8-28.8c22.1-22.1 57.9-22.1 80 0s22.1 57.9 0 80z\"]\n};\nvar faBuildingWheat = {\n  prefix: 'fas',\n  iconName: 'building-wheat',\n  icon: [640, 512, [], \"e4db\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l249.3 0c-6-14.8-9.3-31-9.3-48 0-17.7 7.2-33.7 18.8-45.3-11.9-19.4-18.8-42.3-18.8-66.7 0-17.7 7.2-33.7 18.8-45.3-11.9-19.4-18.8-42.3-18.8-66.7 0-25.2 14.5-46.9 35.6-57.4-2.4-7.1-3.6-14.7-3.6-22.6l0-32C368 96.7 388 70.1 415.9 60.1 413.9 26.6 386 0 352 0L96 0zM208 352l32 0c17.7 0 32 14.3 32 32l0 80-96 0 0-80c0-17.7 14.3-32 32-32zM128 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM128 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm144-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm352 0l-16 0c-44.2 0-80 35.8-80 80 0 8.8 7.2 16 16 16l16 0c44.2 0 80-35.8 80-80 0-8.8-7.2-16-16-16zm16 128c0-8.8-7.2-16-16-16l-16 0c-44.2 0-80 35.8-80 80 0 8.8 7.2 16 16 16l16 0c44.2 0 80-35.8 80-80zm0 112c0-8.8-7.2-16-16-16l-16 0c-44.2 0-80 35.8-80 80 0 8.8 7.2 16 16 16l16 0c44.2 0 80-35.8 80-80zM496 528c0-44.2-35.8-80-80-80l-16 0c-8.8 0-16 7.2-16 16 0 44.2 35.8 80 80 80l16 0c8.8 0 16-7.2 16-16zm-16-96c8.8 0 16-7.2 16-16 0-44.2-35.8-80-80-80l-16 0c-8.8 0-16 7.2-16 16 0 44.2 35.8 80 80 80l16 0zm16-128c0-44.2-35.8-80-80-80l-16 0c-8.8 0-16 7.2-16 16 0 44.2 35.8 80 80 80l16 0c8.8 0 16-7.2 16-16zM512 64c-13.3 0-24 10.7-24 24l0 104c0 13.3 10.7 24 24 24s24-10.7 24-24l0-104c0-13.3-10.7-24-24-24zm96 64c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32zM440 104c-13.3 0-24 10.7-24 24l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32c0-13.3-10.7-24-24-24z\"]\n};\nvar faPlugCircleMinus = {\n  prefix: 'fas',\n  iconName: 'plug-circle-minus',\n  icon: [640, 512, [], \"e55e\", \"M192-32c17.7 0 32 14.3 32 32l0 96 128 0 0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 48.7c-98.6 8.1-176 90.7-176 191.3 0 27.3 5.7 53.3 16 76.9l0 3.1c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7C165.2 398.1 96 319.1 96 224l0-64c-17.7 0-32-14.3-32-32S78.3 96 96 96l64 0 0-96c0-17.7 14.3-32 32-32zM352 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm224 0c0-8.8-7.2-16-16-16l-128 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16z\"]\n};\nvar faFutbol = {\n  prefix: 'fas',\n  iconName: 'futbol',\n  icon: [512, 512, [9917, \"futbol-ball\", \"soccer-ball\"], \"f1e3\", \"M417.3 360.1l-71.6-4.8c-5.2-.3-10.3 1.1-14.5 4.2s-7.2 7.4-8.4 12.5l-17.6 69.6C289.5 445.8 273 448 256 448s-33.5-2.2-49.2-6.4L189.2 372c-1.3-5-4.3-9.4-8.4-12.5s-9.3-4.5-14.5-4.2l-71.6 4.8c-17.6-27.2-28.5-59.2-30.4-93.6L125 228.3c4.4-2.8 7.6-7 9.2-11.9s1.4-10.2-.5-15l-26.7-66.6C128 109.2 155.3 89 186.7 76.9l55.2 46c4 3.3 9 5.1 14.1 5.1s10.2-1.8 14.1-5.1l55.2-46c31.3 12.1 58.7 32.3 79.6 57.9l-26.7 66.6c-1.9 4.8-2.1 10.1-.5 15s4.9 9.1 9.2 11.9l60.7 38.2c-1.9 34.4-12.8 66.4-30.4 93.6zM256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm14.1-325.7c-8.4-6.1-19.8-6.1-28.2 0L194 221c-8.4 6.1-11.9 16.9-8.7 26.8l18.3 56.3c3.2 9.9 12.4 16.6 22.8 16.6l59.2 0c10.4 0 19.6-6.7 22.8-16.6l18.3-56.3c3.2-9.9-.3-20.7-8.7-26.8l-47.9-34.8z\"]\n};\nvar faFutbolBall = faFutbol;\nvar faSoccerBall = faFutbol;\nvar faCirclePlus = {\n  prefix: 'fas',\n  iconName: 'circle-plus',\n  icon: [512, 512, [\"plus-circle\"], \"f055\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z\"]\n};\nvar faPlusCircle = faCirclePlus;\nvar faBrazilianRealSign = {\n  prefix: 'fas',\n  iconName: 'brazilian-real-sign',\n  icon: [512, 512, [], \"e46c\", \"M400 16c17.7 0 32 14.3 32 32l0 16 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-48.9 0c-26 0-47.1 21.1-47.1 47.1 0 22.5 15.9 41.8 37.9 46.2l32.8 6.6c51.9 10.4 89.3 56 89.3 109 0 50.6-33.8 93.3-80 106.7l0 20.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-16-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64.9 0c26 0 47.1-21.1 47.1-47.1 0-22.5-15.9-41.8-37.9-46.2l-32.8-6.6c-51.9-10.4-89.3-56-89.3-109 0-50.6 33.8-93.2 80-106.7L368 48c0-17.7 14.3-32 32-32zM0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144 0 54.3-30 101.5-74.4 126.1l41 136.7c5.1 16.9-4.5 34.8-21.5 39.8s-34.8-4.5-39.8-21.5L120.1 319.8c-2.7 .1-5.4 .2-8.1 .2l-48 0 0 128c0 17.7-14.3 32-32 32S0 465.7 0 448L0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80l-48 0 0 160z\"]\n};\nvar faStarAndCrescent = {\n  prefix: 'fas',\n  iconName: 'star-and-crescent',\n  icon: [512, 512, [9770], \"f699\", \"M0 256c0-141.4 114.6-256 256-256 33 0 64.6 6.3 93.6 17.7 7.4 2.9 11.5 10.7 9.8 18.4s-8.8 13-16.7 12.4c-4.8-.3-9.7-.5-14.6-.5-114.9 0-208 93.1-208 208s93.1 208 208 208c4.9 0 9.8-.2 14.6-.5 7.9-.5 15 4.7 16.7 12.4s-2.4 15.5-9.8 18.4C320.6 505.7 289 512 256 512 114.6 512 0 397.4 0 256zM375.4 137.4c3.5-7.1 13.7-7.1 17.2 0l31.5 63.8c1.4 2.8 4.1 4.8 7.2 5.3l70.4 10.2c7.9 1.1 11 10.8 5.3 16.4l-50.9 49.6c-2.3 2.2-3.3 5.4-2.8 8.5l12 70.1c1.3 7.8-6.9 13.8-13.9 10.1l-63-33.1c-2.8-1.5-6.1-1.5-8.9 0l-63 33.1c-7 3.7-15.3-2.3-13.9-10.1l12-70.1c.5-3.1-.5-6.3-2.8-8.5L261 233.1c-5.7-5.6-2.6-15.2 5.3-16.4l70.4-10.2c3.1-.5 5.8-2.4 7.2-5.3l31.5-63.8z\"]\n};\nvar faFaceSurprise = {\n  prefix: 'fas',\n  iconName: 'face-surprise',\n  icon: [512, 512, [128558, \"surprise\"], \"f5c2\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM176 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-48 80a64 64 0 1 1 0 128 64 64 0 1 1 0-128z\"]\n};\nvar faSurprise = faFaceSurprise;\nvar faHospitalUser = {\n  prefix: 'fas',\n  iconName: 'hospital-user',\n  icon: [640, 512, [], \"f80d\", \"M64 64C64 28.7 92.7 0 128 0L384 0c35.3 0 64 28.7 64 64l0 121.3c-46.9 19-80 65-80 118.7 0 27.7 8.8 53.4 23.8 74.4-51.5 21-87.8 71.6-87.8 130.7 0 1 0 1.9 0 2.9l-176 0c-35.3 0-64-28.7-64-64L64 64zM208 400l0 64 53.4 0c7.2-29.4 21.3-56.1 40.4-78.3-6.1-19.5-24.3-33.7-45.8-33.7-26.5 0-48 21.5-48 48zM248 88c-8.8 0-16 7.2-16 16l0 32-32 0c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l32 0 0 32c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-32 32 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-32 0 0-32c0-8.8-7.2-16-16-16l-16 0zM416 304a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zM352 512c0-53 43-96 96-96l96 0c53 0 96 43 96 96 0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32z\"]\n};\nvar faArrowDownUpLock = {\n  prefix: 'fas',\n  iconName: 'arrow-down-up-lock',\n  icon: [576, 512, [], \"e4b0\", \"M262.6 422.6l-80 80c-12.5 12.5-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l25.4 25.4 0-114.7-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l256 0 0-114.7-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l80-80c12.5-12.5 32.8-12.5 45.3 0l80 80c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-25.4-25.4 0 94.8c-25.3 20.3-42.8 50.1-47 83.9l-145 0 0 114.7 25.4-25.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM192 32l0 144-64 0 0-144c0-17.7 14.3-32 32-32s32 14.3 32 32zM496 304.1c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0 0-47.9zM352 400c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96z\"]\n};\nvar faFolder = {\n  prefix: 'fas',\n  iconName: 'folder',\n  icon: [512, 512, [128193, 128447, 61716, \"folder-blank\"], \"f07b\", \"M64 448l384 0c35.3 0 64-28.7 64-64l0-240c0-35.3-28.7-64-64-64L298.7 80c-6.9 0-13.7-2.2-19.2-6.4L241.1 44.8C230 36.5 216.5 32 202.7 32L64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64z\"]\n};\nvar faFolderBlank = faFolder;\nvar faHollyBerry = {\n  prefix: 'fas',\n  iconName: 'holly-berry',\n  icon: [512, 512, [], \"f7aa\", \"M256.2 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-80 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM277 383.8c1 .1 2.1 .2 3.2 .2 39.8 0 72 32.2 72 72l0 22.7c0 16.4 16 27.9 31.6 22.8l12.8-4.3c18-6 37.3-6.5 55.6-1.5l19.4 5.3c17.9 4.9 34.4-11.6 29.5-29.5L495.9 452c-5-18.3-4.4-37.6 1.5-55.6l4.3-12.8c5.2-15.5-6.4-31.6-22.8-31.6-34.6 0-62.7-28.1-62.7-62.7l0-32c0-16.4-16-27.9-31.6-22.8l-12.8 4.3c-18 6-37.3 6.5-55.6 1.5l-29.6-8.1c-2.9-.8-5.9-1-8.7-.7 4.2 9.7 5.8 20.8 3.7 32.3l-6.3 34.8c-1.5 8.4-1.4 17 .5 25.3l5.3 23.9c2.8 12.7 1.1 25.2-4 35.9zM127.8 234.5c-15.5-5.2-31.6 6.4-31.6 22.8l0 32c0 34.6-28.1 62.7-62.7 62.7-16.4 0-27.9 16-22.8 31.6L15 396.4c6 18 6.5 37.3 1.5 55.6l-5.3 19.4C6.4 489.4 22.8 505.8 40.7 501l19.4-5.3c18.3-5 37.6-4.5 55.6 1.5l12.8 4.3c15.5 5.2 31.6-6.4 31.6-22.8l0-32c0-34.6 28.1-62.7 62.7-62.7 16.4 0 27.9-16 22.8-31.6l-4.3-12.8c-6-18-6.5-37.3-1.5-55.6l5.3-19.4c4.9-17.9-11.6-34.4-29.5-29.5l-19.4 5.3c-18.3 5-37.6 4.4-55.6-1.5l-12.8-4.3zM384.2 144a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z\"]\n};\nvar faVenusDouble = {\n  prefix: 'fas',\n  iconName: 'venus-double',\n  icon: [640, 512, [9890], \"f226\", \"M192 288a112 112 0 1 0 0-224 112 112 0 1 0 0 224zM368 176c0 86.3-62.1 158.1-144.1 173.1 .1 1 .1 1.9 .1 2.9l0 64 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-64c0-1 0-1.9 .1-2.9-82-15-144.1-86.8-144.1-173.1 0-97.2 78.8-176 176-176S368 78.8 368 176zM357.5 327c14.4-15.8 26.6-33.7 36.1-53.1 16.1 9 34.7 14.1 54.5 14.1 61.9 0 112-50.1 112-112S509.9 64 448 64c-19.8 0-38.3 5.1-54.5 14.1-9.5-19.4-21.6-37.3-36.1-53.1 26.4-15.9 57.4-25 90.5-25 97.2 0 176 78.8 176 176 0 86.3-62.1 158.1-144.1 173.1 .1 .9 .1 1.9 .1 2.9l0 64 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-64c0-1 0-1.9 .1-2.9-21.1-3.9-40.9-11.5-58.6-22.2z\"]\n};\nvar faClipboardQuestion = {\n  prefix: 'fas',\n  iconName: 'clipboard-question',\n  icon: [384, 512, [], \"e4e3\", \"M311.4 32l8.6 0c35.3 0 64 28.7 64 64l0 352c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l8.6 0C83.6 12.9 104.3 0 128 0L256 0c23.7 0 44.4 12.9 55.4 32zM248 112c13.3 0 24-10.7 24-24s-10.7-24-24-24L136 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0zM192 248c16.1 0 29.2 13.1 29.2 29.2 0 8.7-3.1 13.9-6.9 17.7-4.5 4.4-10.7 7.5-16.8 9.5-14.9 5-29.5 19.3-29.5 39.5 0 13.3 10.7 24 24 24 11.5 0 21.2-8.1 23.5-19 19.2-7.1 53.7-26.3 53.7-71.8 0-42.6-34.6-77.2-77.2-77.2s-77.2 34.6-77.2 77.2c0 13.3 10.7 24 24 24s24-10.7 24-24c0-16.1 13.1-29.2 29.2-29.2zm28 168c0-15.5-12.5-28-28-28s-28 12.5-28 28 12.5 28 28 28 28-12.5 28-28z\"]\n};\nvar faHotdog = {\n  prefix: 'fas',\n  iconName: 'hotdog',\n  icon: [512, 512, [127789], \"f80f\", \"M288 0c-20.5 0-40.1 8.1-54.6 22.6L22.6 233.4C8.1 247.9 0 267.5 0 288 0 300.2 2.9 312.1 8.2 322.7L322.7 8.2C312.1 2.9 300.2 0 288 0zM224 512c20.5 0 40.1-8.1 54.6-22.6L489.4 278.6c14.5-14.5 22.6-34.1 22.6-54.6 0-12.2-2.9-24.1-8.2-34.7L189.3 503.8c10.7 5.4 22.6 8.2 34.7 8.2zM456.6 168.6c31.2-31.2 31.2-81.9 0-113.1s-81.9-31.2-113.1 0l-288 288c-31.2 31.2-31.2 81.9 0 113.1s81.9 31.2 113.1 0l288-288z\"]\n};\nvar faArrowUpFromBracket = {\n  prefix: 'fas',\n  iconName: 'arrow-up-from-bracket',\n  icon: [448, 512, [], \"e09a\", \"M246.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 109.3 192 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 64c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-64z\"]\n};\nvar faMicroscope = {\n  prefix: 'fas',\n  iconName: 'microscope',\n  icon: [512, 512, [128300], \"f610\", \"M176 0c-26.5 0-48 21.5-48 48l0 208c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-64 32 0c70.7 0 128 57.3 128 128S390.7 448 320 448L32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16.9 0c30.4-34 48.9-78.8 48.9-128 0-106-86-192-192-192l-32 0 0-80c0-26.5-21.5-48-48-48L176 0zM120 352c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0z\"]\n};\nvar faCloud = {\n  prefix: 'fas',\n  iconName: 'cloud',\n  icon: [576, 512, [9729], \"f0c2\", \"M0 336c0 79.5 64.5 144 144 144l304 0c70.7 0 128-57.3 128-128 0-51.6-30.5-96.1-74.5-116.3 6.7-13.1 10.5-28 10.5-43.7 0-53-43-96-96-96-17.7 0-34.2 4.8-48.4 13.1-24.1-45.8-72.2-77.1-127.6-77.1-79.5 0-144 64.5-144 144 0 8 .7 15.9 1.9 23.5-56.9 19.2-97.9 73.1-97.9 136.5z\"]\n};\nvar faBaseballBatBall = {\n  prefix: 'fas',\n  iconName: 'baseball-bat-ball',\n  icon: [576, 512, [], \"f432\", \"M464.1 544a80 80 0 1 1 0-160 80 80 0 1 1 0 160zm8.4-576c15.1 0 29.7 5.8 40.7 16.2l47.2 44.8c12.6 12 19.1 29 17.5 46.3-1.2 13.3-7 25.8-16.5 35.2L363.1 309c-7.3 7.3-15.7 13.4-25 18L206 393c-9.2 4.6-17.7 10.7-25 18l-92 92 1.7 1.8c7.7 9.4 7.1 23.3-1.7 32.1s-22.7 9.3-32.1 1.7l-1.8-1.7-48-48-1.7-1.8c-7.7-9.4-7.1-23.3 1.7-32.1s22.7-9.3 32.1-1.7l1.8 1.7 92-92c7.3-7.3 13.4-15.7 18-25l66.1-132.1c4.6-9.2 10.7-17.7 18-25L430.8-14.7C441.9-25.8 456.9-32 472.5-32z\"]\n};\nvar faCarRear = {\n  prefix: 'fas',\n  iconName: 'car-rear',\n  icon: [512, 512, [\"car-alt\"], \"f5de\", \"M165.4 96l181.2 0c13.6 0 25.7 8.6 30.2 21.4l26.1 74.6-293.8 0 26.1-74.6c4.5-12.8 16.6-21.4 30.2-21.4zm-90.6 .3L39.6 196.8C16.4 206.4 0 229.3 0 256l0 96c0 23.7 12.9 44.4 32 55.4L32 448c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-32 256 0 0 32c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-40.6c19.1-11.1 32-31.7 32-55.4l0-96c0-26.7-16.4-49.6-39.6-59.2L437.2 96.3C423.7 57.8 387.4 32 346.6 32L165.4 32c-40.8 0-77.1 25.8-90.6 64.3zM208 288l96 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-96 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM48 280c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24zm360-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faCarAlt = faCarRear;\nvar faThumbtackSlash = {\n  prefix: 'fas',\n  iconName: 'thumbtack-slash',\n  icon: [576, 512, [\"thumb-tack-slash\"], \"e68f\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L417.8 352 448 352c10 0 19.5-4.7 25.5-12.7s8-18.4 5.2-28.1L475 297.8c-12.4-43.3-41-78.5-78.2-99.7L386.5 64 416 64c17.7 0 32-14.3 32-32S433.7 0 416 0L160 0c-7.4 0-14.1 2.5-19.5 6.6L190.1 56.3 185.3 119.4 41-24.9zM282.2 352L149.7 219.6c-22.7 20.5-39.8 47.4-48.7 78.3l-3.8 13.4c-2.8 9.7-.8 20 5.2 28.1S118 352 128 352l154.2 0zM256 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-112-64 0 0 112z\"]\n};\nvar faThumbTackSlash = faThumbtackSlash;\nvar faPlusMinus = {\n  prefix: 'fas',\n  iconName: 'plus-minus',\n  icon: [384, 512, [], \"e43c\", \"M224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 128-128 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-128 0 0-128zM0 480c0 17.7 14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 448c-17.7 0-32 14.3-32 32z\"]\n};\nvar faHouseCircleCheck = {\n  prefix: 'fas',\n  iconName: 'house-circle-check',\n  icon: [640, 512, [], \"e509\", \"M496 544a144 144 0 1 1 0-288 144 144 0 1 1 0 288zM268.6 6.5c12.2-9.3 29.7-8.7 41.2 2l217.6 202c-10.2-1.7-20.7-2.6-31.3-2.6-78.6 0-146.1 47.2-175.8 114.8-5.1-1.8-10.5-2.8-16.2-2.8l-32 0c-26.5 0-48 21.5-48 48l0 96 91 0c6.1 17.3 14.6 33.4 25.1 48L144 512c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208 2.4-2zM553.4 339.1c-7.1-5.2-17.1-3.6-22.3 3.5l-53 72.8-26.7-26.8c-6.2-6.2-16.4-6.2-22.6 0-6.2 6.2-6.2 16.4 0 22.6l40 40c3.3 3.3 7.9 5 12.6 4.7s8.9-2.8 11.7-6.6l64-88c5.2-7.1 3.6-17.1-3.5-22.3z\"]\n};\nvar faCalendarDay = {\n  prefix: 'fas',\n  iconName: 'calendar-day',\n  icon: [448, 512, [], \"f783\", \"M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zm0 256c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0z\"]\n};\nvar faLibra = {\n  prefix: 'fas',\n  iconName: 'libra',\n  icon: [512, 512, [], \"e84b\", \"M480 384c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l448 0zM256 32c97.2 0 176 78.8 176 176 0 16.6-2.4 32.7-6.7 48l54.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-104.2 0c-11.8 0-22.7-6.5-28.2-16.9s-4.9-23.1 1.6-32.9c11.9-17.8 18.8-39.1 18.8-62.2 0-61.9-50.1-112-112-112S144 146.1 144 208c0 23.1 6.9 44.4 18.8 62.2 6.6 9.8 7.2 22.5 1.6 32.9S148.1 320 136.2 320L32 320c-17.7 0-32-14.3-32-32s14.3-32 32-32l54.8 0c-4.3-15.3-6.8-31.4-6.8-48 0-97.2 78.8-176 176-176z\"]\n};\nvar faCircle = {\n  prefix: 'fas',\n  iconName: 'circle',\n  icon: [512, 512, [128308, 128309, 128992, 128993, 128994, 128995, 128996, 9679, 9898, 9899, 11044, 61708, 61915], \"f111\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z\"]\n};\nvar faMobileVibrate = {\n  prefix: 'fas',\n  iconName: 'mobile-vibrate',\n  icon: [576, 512, [], \"e816\", \"M384 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64l-192 0c-35.3 0-64-28.7-64-64l0-384c0-35.3 28.7-64 64-64L384 0zM248 416c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zM48.8 133.4c9.4-7.7 23.3-7.1 32.1 1.7 9.4 9.4 9.4 24.6 0 33.9l-31 31 25.4 25.4 2.9 3.2c6.3 7.7 9.8 17.4 9.8 27.4 0 11.5-4.6 22.5-12.7 30.6l-25.4 25.4 31 31 1.7 1.8c7.7 9.4 7.1 23.3-1.7 32.1s-22.7 9.3-32.1 1.7L47 377 12.7 342.6C5.6 335.5 1.2 326.2 .2 316.3L0 312 .2 307.7c1-9.9 5.4-19.2 12.5-26.3L38.1 256 12.7 230.6C5.6 223.5 1.2 214.2 .2 204.3L0 200 .2 195.7c1-9.9 5.4-19.2 12.5-26.3L47 135 48.8 133.4zM495 135c8.8-8.8 22.7-9.3 32.1-1.7l1.8 1.7 34.3 34.3c7.1 7.1 11.5 16.4 12.5 26.3l.2 4.3-.2 4.3c-1 9.9-5.4 19.2-12.5 26.3l-25.4 25.4 25.4 25.4c7.1 7.1 11.5 16.4 12.5 26.3l.2 4.3-.2 4.3c-1 9.9-5.4 19.2-12.5 26.3l-34.3 34.3-1.8 1.7c-9.4 7.7-23.3 7.1-32.1-1.7s-9.3-22.7-1.7-32.1l1.7-1.8 31-31-25.4-25.4c-8.1-8.1-12.7-19.1-12.7-30.6 0-10 3.5-19.7 9.8-27.4l2.9-3.2 25.4-25.4-31-31c-9.4-9.4-9.4-24.6 0-33.9z\"]\n};\nvar faFaceGrinSquint = {\n  prefix: 'fas',\n  iconName: 'face-grin-squint',\n  icon: [512, 512, [128518, \"grin-squint\"], \"f585\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM386.7 308.9c11.9-3.7 23.9 6.3 19.6 18.1-22.4 61.3-81.3 105.1-150.3 105.1S128.1 388.2 105.7 326.9c-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1zM122.6 143.2c4.5-6.8 13.3-9.2 20.6-5.5l79.6 40c5.4 2.7 8.8 8.2 8.8 14.3s-3.4 11.6-8.8 14.3l-79.6 40c-7.3 3.6-16.1 1.3-20.6-5.5s-3.1-15.9 3.1-21.1L159 192 125.8 164.3c-6.2-5.2-7.6-14.3-3.1-21.1zm263.6 21.1L353 192 386.2 219.7c6.2 5.2 7.6 14.3 3.1 21.1s-13.3 9.2-20.6 5.5l-79.6-40c-5.4-2.7-8.8-8.2-8.8-14.3s3.4-11.6 8.8-14.3l79.6-40c7.3-3.6 16.1-1.3 20.6 5.5s3.1 15.9-3.1 21.1z\"]\n};\nvar faGrinSquint = faFaceGrinSquint;\nvar faUsersBetweenLines = {\n  prefix: 'fas',\n  iconName: 'users-between-lines',\n  icon: [576, 512, [], \"e591\", \"M24 16l528 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 64C10.7 64 0 53.3 0 40S10.7 16 24 16zm0 448l528 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24zM392 192a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm27.2 100.4c9.1-2.9 18.8-4.4 28.8-4.4 53 0 96 43 96 96l0 10.7c0 11.8-9.6 21.3-21.3 21.3l-78.8 0c2.7-7.5 4.1-15.6 4.1-24l0-8c0-34.1-10.6-65.7-28.8-91.6zm-262.4 0C138.6 318.3 128 349.9 128 384l0 8c0 8.4 1.4 16.5 4.1 24l-78.8 0C41.6 416 32 406.4 32 394.7L32 384c0-53 43-96 96-96 10 0 19.7 1.5 28.8 4.4zM72 192a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm152-16a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM176 384c0-61.9 50.1-112 112-112s112 50.1 112 112l0 8c0 13.3-10.7 24-24 24l-176 0c-13.3 0-24-10.7-24-24l0-8z\"]\n};\nvar faHouseMedicalCircleXmark = {\n  prefix: 'fas',\n  iconName: 'house-medical-circle-xmark',\n  icon: [640, 512, [], \"e513\", \"M309.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S50.8 272 64 272l16 0 0 176c0 35.3 28.7 64 64 64l196 0c-21.2-29.5-34.3-65.3-35.9-104L272 408c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 20 0c34.9-48.5 91.7-80 156-80 10.7 0 21.1 .9 31.3 2.5L309.8 8.6zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm22.6-144l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L518.6 400z\"]\n};\nvar faTableList = {\n  prefix: 'fas',\n  iconName: 'table-list',\n  icon: [448, 512, [\"th-list\"], \"f00b\", \"M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 0l0 64 64 0 0-64-64 0zm320 0l-192 0 0 64 192 0 0-64zM64 224l0 64 64 0 0-64-64 0zm320 0l-192 0 0 64 192 0 0-64zM64 352l0 64 64 0 0-64-64 0zm320 0l-192 0 0 64 192 0 0-64z\"]\n};\nvar faThList = faTableList;\nvar faFlaskVial = {\n  prefix: 'fas',\n  iconName: 'flask-vial',\n  icon: [640, 512, [], \"e4f3\", \"M184.6 411.5c-3.1 7.3-5.4 14.9-6.8 22.6-14.5 8.8-31.5 13.9-49.8 13.9-53 0-96-43-96-96L32 64C14.3 64 0 49.7 0 32S14.3 0 32 0L224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 255.6-39.4 91.9zM96 64l0 128 64 0 0-128-64 0zM352 0L512 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 153.4 91.3 213c2.3 5.4 3.8 11.1 4.4 17l.3 .6-.3 0c.2 1.8 .3 3.6 .3 5.4 0 32.3-26.2 58.6-58.6 58.6l-266.9 0c-32.3 0-58.6-26.2-58.6-58.6 0-1.8 .1-3.6 .3-5.4l-.3 0 .3-.6c.6-5.8 2.1-11.6 4.4-17L320 217.4 320 64c-17.7 0-32-14.3-32-32S302.3 0 320 0l32 0zM453.2 242.6c-3.4-8-5.2-16.5-5.2-25.2l0-153.4-64 0 0 153.4c0 8.7-1.8 17.2-5.2 25.2l-33.2 77.4 140.7 0-33.2-77.4z\"]\n};\nvar faCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'circle-exclamation',\n  icon: [512, 512, [\"exclamation-circle\"], \"f06a\", \"M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z\"]\n};\nvar faExclamationCircle = faCircleExclamation;\nvar faTaxi = {\n  prefix: 'fas',\n  iconName: 'taxi',\n  icon: [512, 512, [128662, \"cab\"], \"f1ba\", \"M192 0c-17.7 0-32 14.3-32 32l0 32-8.9 0c-42 0-79.1 27.3-91.6 67.4l-23 73.5C14.5 219.1 0 243.9 0 272L0 448c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-32 320 0 0 32c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-176c0-28.1-14.5-52.9-36.4-67.1l-23-73.5C440.1 91.3 402.9 64 360.9 64l-8.9 0 0-32c0-17.7-14.3-32-32-32L192 0zM151.1 128l209.9 0c14 0 26.4 9.1 30.5 22.5l13 41.5-296.9 0 13-41.5c4.2-13.4 16.5-22.5 30.5-22.5zM96 272a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm288 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faCab = faTaxi;\nvar faTextSlash = {\n  prefix: 'fas',\n  iconName: 'text-slash',\n  icon: [576, 512, [\"remove-format\"], \"f87d\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L322.7 256.9 368.2 96 471 96 465 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C545.6 61.3 522.7 32 491.5 32l-319 0c-19.8 0-37.3 12.1-44.5 30.1l-87-87zM180.4 114.5l4.6-18.5 116.7 0-30.8 109-90.5-90.5zM241 310.8L211.3 416 160 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-42.2 0 15.1-53.3-51.9-51.9z\"]\n};\nvar faRemoveFormat = faTextSlash;\nvar faPeoplePulling = {\n  prefix: 'fas',\n  iconName: 'people-pulling',\n  icon: [576, 512, [], \"e535\", \"M80 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM64 128c-35.3 0-64 28.7-64 64L0 320c0 17.7 14.3 32 32 32 9.8 0 18.5-4.4 24.4-11.2L80.4 485.3c2.9 17.4 19.4 29.2 36.8 26.3s29.2-19.4 26.3-36.8l-20.5-122.7 15.7 0 30 134.9c3.8 17.3 20.9 28.1 38.2 24.3s28.1-20.9 24.3-38.2l-57.3-258 116.3 53.8c.5 .3 1.1 .5 1.6 .7 8.6 3.6 18 3.1 25.9-.7 3.4-1.6 6.6-3.9 9.3-6.7 3.1-3.2 5.5-7 7.1-11.4 .1-.3 .2-.7 .3-1l2.5-7.5c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9l-21.4-10.7-15.3-36.8c-17.1-41.1-57.3-67.9-101.9-67.9-22.8 0-45.3 4.8-66.1 14l-8 3.5c-24.4 10.9-44.6 29-58.1 51.6L157.3 136.9C144.7 131 130.9 128 117 128l-53 0zM464 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM349.7 335.6l-25 62.4-59.4 59.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L372.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6z\"]\n};\nvar faBackward = {\n  prefix: 'fas',\n  iconName: 'backward',\n  icon: [576, 512, [9194], \"f04a\", \"M204.3 43.1C215.9 32 233 28.9 247.7 35.2S272 56 272 72l0 136.3 172.3-165.1C455.9 32 473 28.9 487.7 35.2S512 56 512 72l0 368c0 16-9.6 30.5-24.3 36.8s-31.8 3.2-43.4-7.9L272 303.7 272 440c0 16-9.6 30.5-24.3 36.8s-31.8 3.2-43.4-7.9l-192-184C4.5 277.3 0 266.9 0 256s4.5-21.3 12.3-28.9l192-184z\"]\n};\nvar faCarBurst = {\n  prefix: 'fas',\n  iconName: 'car-burst',\n  icon: [640, 512, [\"car-crash\"], \"f5e1\", \"M232 16.1l0-48c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24zM32 168.1l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24zM281.5 70.6c9.4 9.4 24.6 9.4 33.9 0l33.9-33.9c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L281.5 36.6c-9.4 9.4-9.4 24.6 0 33.9zm-181 215l33.9-33.9c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L66.6 251.6c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0zM66.6 2.7c-9.4 9.4-9.4 24.6 0 33.9l33.9 33.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L100.5 2.7C91.1-6.7 76-6.7 66.6 2.7zM352.9 175.4L505 216.2c6.4 1.7 11.1 7.3 11.8 13.9l7.2 74-231.5-62 43.2-60.5c3.9-5.4 10.7-7.9 17.2-6.2zM223.6 228.5l-2.1 2.9c-21.7 5.5-39.9 22.3-46.1 45.5-4.1 15.5-12.4 46.4-24.8 92.7l-8.3 30.9c-4.6 17.1 5.6 34.6 22.6 39.2l15.5 4.1c17.1 4.6 34.6-5.6 39.2-22.6l8.3-30.9 278.2 74.5-8.3 30.9c-4.6 17.1 5.6 34.6 22.6 39.2l15.5 4.1c17.1 4.6 34.6-5.6 39.2-22.6 4.1-15.5 12.4-46.4 24.8-92.7l8.3-30.9c6.2-23.2-1.1-46.8-17.2-62.5l-.3-3.6-10-103c-3.2-33.2-26.7-60.9-58.9-69.5L369.5 113.6c-32.2-8.6-66.4 3.6-85.8 30.8l-60.2 84.2zm48.7 57.8a32 32 0 1 1 -16.6 61.8 32 32 0 1 1 16.6-61.8zm208.1 88.9a32 32 0 1 1 61.8 16.6 32 32 0 1 1 -61.8-16.6z\"]\n};\nvar faCarCrash = faCarBurst;\nvar faLink = {\n  prefix: 'fas',\n  iconName: 'link',\n  icon: [576, 512, [128279, \"chain\"], \"f0c1\", \"M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z\"]\n};\nvar faChain = faLink;\nvar faBackwardStep = {\n  prefix: 'fas',\n  iconName: 'backward-step',\n  icon: [384, 512, [\"step-backward\"], \"f048\", \"M363 36.8c-12.9-7-28.7-6.3-41 1.8L64 208.1 64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144.1 258 169.6c12.3 8.1 28 8.8 41 1.8s21-20.5 21-35.2l0-368c0-14.7-8.1-28.2-21-35.2z\"]\n};\nvar faStepBackward = faBackwardStep;\nvar faX = {\n  prefix: 'fas',\n  iconName: 'x',\n  icon: [384, 512, [120], \"58\", \"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z\"]\n};\nvar faCircleUser = {\n  prefix: 'fas',\n  iconName: 'circle-user',\n  icon: [512, 512, [62142, \"user-circle\"], \"f2bd\", \"M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2 35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z\"]\n};\nvar faUserCircle = faCircleUser;\nvar faRectangleList = {\n  prefix: 'fas',\n  iconName: 'rectangle-list',\n  icon: [512, 512, [\"list-alt\"], \"f022\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm96 256a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm-32-96a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm120-56l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm0 128l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faListAlt = faRectangleList;\nvar faHand = {\n  prefix: 'fas',\n  iconName: 'hand',\n  icon: [512, 512, [129306, 9995, \"hand-paper\"], \"f256\", \"M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 272c0 1.5 0 3.1 .1 4.6L67.6 283c-16-15.2-41.3-14.6-56.6 1.4S-3.6 325.7 12.4 341L124.8 448c43.1 41.1 100.4 64 160 64l19.2 0c97.2 0 176-78.8 176-176l0-208c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-176c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208z\"]\n};\nvar faHandPaper = faHand;\nvar faCancer = {\n  prefix: 'fas',\n  iconName: 'cancer',\n  icon: [512, 512, [], \"e847\", \"M408 152c57.4 0 104 46.6 104 104 0 141.4-114.6 256-256 256-54.3 0-104.8-17-146.3-45.9-14.5-10.1-18-30.1-7.9-44.6s30.1-18 44.6-7.9c31.1 21.7 68.9 34.4 109.7 34.4 67.9 0 127.5-35.3 161.7-88.5-3.2 .3-6.4 .5-9.7 .5-57.4 0-104-46.6-104-104s46.6-104 104-104zM256 0c54.3 0 104.8 17 146.3 45.9 14.5 10.1 18 30.1 7.9 44.6s-30.1 18-44.6 7.9c-31.1-21.7-68.9-34.4-109.7-34.4-67.9 0-127.5 35.2-161.7 88.4 3.2-.3 6.4-.4 9.7-.4 57.4 0 104 46.6 104 104S161.4 360 104 360 0 313.4 0 256C0 254.1 0 252.2 .1 250.4 3.1 111.6 116.5 0 256 0zM104 216a40 40 0 1 0 0 80 40 40 0 1 0 0-80zm304 0a40 40 0 1 0 0 80 40 40 0 1 0 0-80z\"]\n};\nvar faVanShuttle = {\n  prefix: 'fas',\n  iconName: 'van-shuttle',\n  icon: [576, 512, [128656, \"shuttle-van\"], \"f5b6\", \"M64 64C28.7 64 0 92.7 0 128L0 336c0 35.3 28.7 64 64 64l.4 0c4 44.9 41.7 80 87.6 80s83.6-35.1 87.6-80l104.7 0c4 44.9 41.7 80 87.6 80 46.1 0 83.9-35.4 87.7-80.5 31.7-3.8 56.3-30.8 56.3-63.5l0-101.3c0-13.8-4.5-27.3-12.8-38.4l-80-106.7C471.1 73.5 452.1 64 432 64L64 64zM504 224l-120 0 0-96 48 0 72 96zM64 224l0-96 96 0 0 96-96 0zm160 0l0-96 96 0 0 96-96 0zM392 392a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM152 352a40 40 0 1 1 0 80 40 40 0 1 1 0-80z\"]\n};\nvar faShuttleVan = faVanShuttle;\nvar faStairs = {\n  prefix: 'fas',\n  iconName: 'stairs',\n  icon: [576, 512, [], \"e289\", \"M384 64c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32l-96 0 0 96c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0 0-96c0-17.7 14.3-32 32-32l96 0 0-96c0-17.7 14.3-32 32-32l96 0 0-96z\"]\n};\nvar faHorseHead = {\n  prefix: 'fas',\n  iconName: 'horse-head',\n  icon: [512, 512, [], \"f7ab\", \"M0 464L0 316.9C0 208.5 68.3 111.8 170.5 75.6L340.2 15.5c21.4-7.6 43.8 8.3 43.8 30.9 0 11-5.5 21.2-14.6 27.3L336 96c48.1 0 91.2 29.8 108.1 74.9l48.6 129.5c11.8 31.4 4.1 66.8-19.6 90.5-16 16-37.8 25.1-60.5 25.1l-3.4 0c-26.1 0-50.9-11.6-67.6-31.7l-32.3-38.7c-11.7 4.1-24.2 6.4-37.3 6.4l-.1 0c-6.3 0-12.5-.5-18.6-1.5-3.6-.6-7.2-1.4-10.7-2.3l0 0c-28.9-7.8-53.1-26.8-67.8-52.2-4.4-7.7-14.2-10.3-21.9-5.8s-10.3 14.2-5.8 21.9c24 41.5 68.3 70 119.3 71.9l47.2 70.8c4 6.1 6.2 13.2 6.2 20.4 0 20.3-16.5 36.8-36.8 36.8L48 512c-26.5 0-48-21.5-48-48zM328 224a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faVault = {\n  prefix: 'fas',\n  iconName: 'vault',\n  icon: [512, 512, [], \"e2c5\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64 0 17.7 14.3 32 32 32s32-14.3 32-32l256 0c0 17.7 14.3 32 32 32s32-14.3 32-32c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM256 256a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM64 256a128 128 0 1 1 256 0 128 128 0 1 1 -256 0zm384-48c0 17.8-9.7 33.3-24 41.6l0 78.4c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-78.4c-14.3-8.3-24-23.8-24-41.6 0-26.5 21.5-48 48-48s48 21.5 48 48z\"]\n};\nvar faClosedCaptioningSlash = {\n  prefix: 'fas',\n  iconName: 'closed-captioning-slash',\n  icon: [576, 512, [], \"e135\", \"M7-24.9c9.4-9.4 24.6-9.4 33.9 0L129.8 64 480 64c35.3 0 64 28.7 64 64l0 256c0 25.5-14.9 47.4-36.4 57.8L569 503.1c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 9.1C-2.3-.3-2.3-15.5 7-24.9zm345 311l0-70.2c0-4.4 3.6-8 8-8l32 0c4.4 0 8 3.6 8 8 0 13.3 10.7 24 24 24s24-10.7 24-24c0-30.9-25.1-56-56-56l-32 0c-30.9 0-56 25.1-56 56l0 22.2 48 48zm61.5 61.5c20.2-8.4 34.5-28.4 34.5-51.7 0-13.3-10.7-24-24-24s-24 10.7-24 24c0 4.4-3.6 8-8 8l-22.2 0 43.7 43.7zM130.3 200.1c-1.5 5-2.3 10.4-2.3 15.9l0 80c0 30.9 25.1 56 56 56l32 0c18.1 0 34.1-8.5 44.4-21.8L378.2 448 96 448c-35.3 0-64-28.7-64-64l0-256c0-7.8 1.4-15.3 4-22.2l94.3 94.3zm93.8 93.8c-.1 .7-.1 1.4-.1 2.1 0 4.4-3.6 8-8 8l-32 0c-4.4 0-8-3.6-8-8l0-50.2 48.1 48.1z\"]\n};\nvar faDrumSteelpan = {\n  prefix: 'fas',\n  iconName: 'drum-steelpan',\n  icon: [576, 512, [], \"f56a\", \"M288 32c159.1 0 288 48 288 128l0 192c0 80-128.9 128-288 128S0 432 0 352L0 160C0 80 128.9 32 288 32zM528 160c0-9.9-8-29.9-55-49.8-18.6-7.9-40.9-14.4-66-19.4l-27.8 43.6c-7.3 11.5-11.2 24.8-11.2 38.4 0 17.5 6.4 34.4 18.1 47.5l9.8 11c29.8-5.2 55.9-12.5 77.2-21.5 47.1-19.9 55-39.9 55-49.8zM349.2 237.3c-8-26.2-32.4-45.3-61.2-45.3s-53.3 19.1-61.2 45.3c19.4 1.7 39.9 2.7 61.2 2.7s41.8-.9 61.2-2.7zM169 90.8c-25.2 5-47.4 11.6-66 19.4-47.1 19.9-55 39.9-55 49.8s8 29.9 55 49.8c21.3 9 47.4 16.3 77.2 21.5l9.8-11c11.6-13.1 18.1-30 18.1-47.5 0-13.6-3.9-26.9-11.2-38.4L169 90.8zm56.3-8c-.9 4.3-1.4 8.7-1.4 13.2 0 35.3 28.7 64 64 64s64-28.7 64-64c0-4.5-.5-9-1.4-13.2-19.8-1.8-40.8-2.8-62.6-2.8s-42.8 1-62.6 2.8z\"]\n};\nvar faThumbsUp = {\n  prefix: 'fas',\n  iconName: 'thumbs-up',\n  icon: [512, 512, [128077, 61575], \"f164\", \"M80 160c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32L0 192c0-17.7 14.3-32 32-32l48 0zM270.6 16C297.9 16 320 38.1 320 65.4l0 4.2c0 6.8-1.3 13.6-3.8 19.9L288 160 448 160c26.5 0 48 21.5 48 48 0 19.7-11.9 36.6-28.9 44 17 7.4 28.9 24.3 28.9 44 0 23.4-16.8 42.9-39 47.1 4.4 7.3 7 15.8 7 24.9 0 22.2-15 40.8-35.4 46.3 2.2 5.5 3.4 11.5 3.4 17.7 0 26.5-21.5 48-48 48l-87.9 0c-36.3 0-71.6-12.4-99.9-35.1L184 435.2c-15.2-12.1-24-30.5-24-50l0-186.6c0-14.9 3.5-29.6 10.1-42.9L226.3 43.3C234.7 26.6 251.8 16 270.6 16z\"]\n};\nvar faStamp = {\n  prefix: 'fas',\n  iconName: 'stamp',\n  icon: [512, 512, [], \"f5bf\", \"M312 201.8c0-17.4 9.2-33.2 19.9-47 12.6-16.2 20.1-36.6 20.1-58.8 0-53-43-96-96-96s-96 43-96 96c0 22.1 7.5 42.5 20.1 58.8 10.7 13.8 19.9 29.6 19.9 47 0 29.9-24.3 54.2-54.2 54.2L112 256c-61.9 0-112 50.1-112 112 0 26.5 21.5 48 48 48l416 0c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112l-33.8 0c-29.9 0-54.2-24.3-54.2-54.2zM56 464c-13.3 0-24 10.7-24 24s10.7 24 24 24l400 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L56 464z\"]\n};\nvar faMenorah = {\n  prefix: 'fas',\n  iconName: 'menorah',\n  icon: [640, 512, [], \"f676\", \"M20.8 7.4C22.8 2.9 27.1 0 32 0s9.2 2.9 11.2 7.4L61.3 49.7c1.8 4.1 2.7 8.6 2.7 13.1L64 64c0 17.7-14.3 32-32 32S0 81.7 0 64l0-1.2c0-4.5 .9-8.9 2.7-13.1L20.8 7.4zm96 0C118.8 2.9 123.1 0 128 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32S96 81.7 96 64l0-1.2c0-4.5 .9-8.9 2.7-13.1L116.8 7.4zm77.8 42.4L212.8 7.4C214.8 2.9 219.1 0 224 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM308.8 7.4C310.8 2.9 315.1 0 320 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1L308.8 7.4zm77.8 42.4L404.8 7.4C406.8 2.9 411.1 0 416 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM500.8 7.4C502.8 2.9 507.1 0 512 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1L500.8 7.4zm77.8 42.4L596.8 7.4C598.8 2.9 603.1 0 608 0s9.2 2.9 11.2 7.4l18.2 42.4c1.8 4.1 2.7 8.6 2.7 13.1l0 1.2c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-1.2c0-4.5 .9-8.9 2.7-13.1zM32 128c17.7 0 32 14.3 32 32l0 128c0 17.7 14.3 32 32 32l192 0 0-160c0-17.7 14.3-32 32-32s32 14.3 32 32l0 160 192 0c17.7 0 32-14.3 32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 53-43 96-96 96l-192 0 0 64 128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-320 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l128 0 0-64-192 0c-53 0-96-43-96-96L0 160c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 128-64 0 0-128c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 128-64 0 0-128c0-17.7 14.3-32 32-32zm192 0c17.7 0 32 14.3 32 32l0 128-64 0 0-128c0-17.7 14.3-32 32-32zm96 0c17.7 0 32 14.3 32 32l0 128-64 0 0-128c0-17.7 14.3-32 32-32z\"]\n};\nvar faChildren = {\n  prefix: 'fas',\n  iconName: 'children',\n  icon: [640, 512, [], \"e4e1\", \"M160.5 0a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm-72 480l0-80-17.8 0c-10.9 0-18.6-10.7-15.2-21.1L86.7 285.5 58 323.3c-10.7 14.1-30.8 16.8-44.8 6.2S-3.7 298.7 7 284.7L65.9 207c22.4-29.6 57.5-47 94.6-47s72.2 17.4 94.6 47L314 284.7c10.7 14.1 7.9 34.2-6.2 44.8s-34.2 7.9-44.8-6.2l-28.7-37.8 31.1 93.4c3.5 10.4-4.3 21.1-15.2 21.1l-17.8 0 0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-80-16 0 0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32zM480.5 0a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm-8 384l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-179.5-12.9 20.5c-9.4 15-29.2 19.4-44.1 10s-19.4-29.2-10-44.1l51.7-82.1c17.6-27.9 48.3-44.9 81.2-44.9l12.3 0c33 0 63.7 16.9 81.2 44.9L619.6 287c9.4 15 4.9 34.7-10 44.1s-34.7 4.9-44.1-10l-12.9-20.5 0 179.5c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-16 0z\"]\n};\nvar faChartLine = {\n  prefix: 'fas',\n  iconName: 'chart-line',\n  icon: [512, 512, [\"line-chart\"], \"f201\", \"M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7 262.6 153.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l73.4-73.4 57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z\"]\n};\nvar faLineChart = faChartLine;\nvar faSquareEnvelope = {\n  prefix: 'fas',\n  iconName: 'square-envelope',\n  icon: [448, 512, [\"envelope-square\"], \"f199\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM209.1 267.9L108.4 207.4c-7.7-4.6-12.4-12.9-12.4-21.9 0-14.1 11.4-25.5 25.5-25.5l204.9 0c14.1 0 25.5 11.4 25.5 25.5 0 9-4.7 17.3-12.4 21.9L238.9 267.9c-4.5 2.7-9.6 4.1-14.9 4.1s-10.4-1.4-14.9-4.1zM352 237.3l0 82.7c0 17.7-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32l0-82.7 96.7 58C202.1 301 213 304 224 304s21.9-3 31.3-8.7l96.7-58z\"]\n};\nvar faEnvelopeSquare = faSquareEnvelope;\nvar faBanSmoking = {\n  prefix: 'fas',\n  iconName: 'ban-smoking',\n  icon: [512, 512, [128685, \"smoking-ban\"], \"f54d\", \"M99.5 144.8l79.2 79.2-50.7 0c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l146.7 0 92.5 92.5c-31.4 22.4-69.8 35.5-111.2 35.5-106 0-192-86-192-192 0-41.5 13.1-79.9 35.5-111.2zM333.3 288l-32-32 82.7 0 0 32-50.7 0zm32 32l18.7 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32L269.3 224 144.8 99.5c31.4-22.4 69.8-35.5 111.2-35.5 106 0 192 86 192 192 0 41.5-13.1 79.9-35.5 111.2L365.3 320zM256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM272 96c-8.8 0-16 7.2-16 16 0 26.5 21.5 48 48 48l32 0c8.8 0 16 7.2 16 16s7.2 16 16 16 16-7.2 16-16c0-26.5-21.5-48-48-48l-32 0c-8.8 0-16-7.2-16-16s-7.2-16-16-16z\"]\n};\nvar faSmokingBan = faBanSmoking;\nvar faTruckFront = {\n  prefix: 'fas',\n  iconName: 'truck-front',\n  icon: [448, 512, [], \"e2b7\", \"M0 112C0 67.8 35.8 32 80 32l288 0c44.2 0 80 35.8 80 80l0 256c0 26.2-12.6 49.4-32 64l0 48c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-32-192 0 0 32c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-48C12.6 417.4 0 394.2 0 368L0 112zm96 80l0 64 256 0 0-64c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32zm32 160a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm224 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faBuilding = {\n  prefix: 'fas',\n  iconName: 'building',\n  icon: [384, 512, [127970, 61687], \"f1ad\", \"M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM176 352l32 0c17.7 0 32 14.3 32 32l0 80-96 0 0-80c0-17.7 14.3-32 32-32zM96 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM240 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM96 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm144-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z\"]\n};\nvar faBullseye = {\n  prefix: 'fas',\n  iconName: 'bullseye',\n  icon: [512, 512, [], \"f140\", \"M448 256a192 192 0 1 0 -384 0 192 192 0 1 0 384 0zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm256 80a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm0-224a144 144 0 1 1 0 288 144 144 0 1 1 0-288zM224 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faArrowLeftLong = {\n  prefix: 'fas',\n  iconName: 'arrow-left-long',\n  icon: [576, 512, [\"long-arrow-left\"], \"f177\", \"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 544 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-434.7 0 73.4-73.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-128 128z\"]\n};\nvar faLongArrowLeft = faArrowLeftLong;\nvar faChessRook = {\n  prefix: 'fas',\n  iconName: 'chess-rook',\n  icon: [384, 512, [9820], \"f447\", \"M0 32L0 133.5c0 17 6.7 33.3 18.7 45.3L64 224 64 384 7.8 454.3C2.7 460.6 0 468.4 0 476.5 0 496.1 15.9 512 35.5 512l312.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2l-56.2-70.3 0-160 45.3-45.3c12-12 18.7-28.3 18.7-45.3L384 32c0-17.7-14.3-32-32-32L320 0c-17.7 0-32 14.3-32 32l0 32-48 0 0-32c0-17.7-14.3-32-32-32L176 0c-17.7 0-32 14.3-32 32l0 32-48 0 0-32C96 14.3 81.7 0 64 0L32 0C14.3 0 0 14.3 0 32z\"]\n};\nvar faBlenderPhone = {\n  prefix: 'fas',\n  iconName: 'blender-phone',\n  icon: [576, 512, [], \"f6b6\", \"M151.4 13.2c10.2 5.8 14.5 18.4 10 29.3L138.2 98.8c-3.9 9.6-13.7 15.4-24 14.4l-20.2-2C78.7 152.9 78 198.9 91.9 241.1l22.4-2.2c10.3-1 20 4.8 24 14.4l23.2 56.3c4.5 10.9 .2 23.4-10 29.3l-2.9 1.6c-33.6 19.2-81.7 16.2-106.2-21.6-56.3-86.6-56.3-199.1 0-285.7 24.6-37.7 72.7-40.7 106.2-21.6l2.9 1.6zM224 336L193.7 17.5C192.8 8.1 200.2 0 209.6 0l324 0c21.3 0 36.6 20.3 30.8 40.8L553.1 80 440 80c-13.3 0-24 10.7-24 24s10.7 24 24 24l99.4 0-18.3 64-81.1 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l67.4 0-27.4 96-256 0zm8 48l240 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-240 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40zm120 88a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faArrowTurnUp = {\n  prefix: 'fas',\n  iconName: 'arrow-turn-up',\n  icon: [384, 512, [\"level-up\"], \"f148\", \"M32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96-43 96-96l0-306.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 416c0 17.7-14.3 32-32 32l-96 0z\"]\n};\nvar faLevelUp = faArrowTurnUp;\nvar faBicycle = {\n  prefix: 'fas',\n  iconName: 'bicycle',\n  icon: [640, 512, [128690], \"f206\", \"M331.7 43.3C336 36.3 343.7 32 352 32l104 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-65.6 0 72.2 148.4c10.7-2.9 21.9-4.4 33.4-4.4 70.7 0 128 57.3 128 128s-57.3 128-128 128-128-57.3-128-128c0-42 20.2-79.2 51.4-102.6l-20.4-41.9-73.5 147c-2.3 4.8-6.3 8.8-11.4 11.2-.6 .3-1.2 .5-1.8 .7-2.9 1.1-5.9 1.6-8.9 1.5L271 368c-7.9 63.1-61.7 112-127 112-70.7 0-128-57.3-128-128S73.3 224 144 224c10.8 0 21.2 1.3 31.2 3.8l28.5-56.9-11.5-26.9-40.2 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l56 0c9.6 0 18.3 5.7 22.1 14.5l14.3 33.5 123.7 0-37.7-77.5c-3.6-7.4-3.2-16.2 1.2-23.2zM228.5 228.7l-45.6 91.3 84.8 0-39.1-91.3zM305.7 287l47.5-95-88.2 0 40.7 95zm168.7 75.5l-29.7-61c-12.8 13-20.7 30.8-20.7 50.5 0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72c-2.7 0-5.5 .2-8.1 .5l29.7 61c5.8 11.9 .8 26.3-11.1 32.1s-26.3 .8-32.1-11.1zM149.2 368c-20.2 0-33.4-21.3-24.3-39.4l24.2-48.5c-1.7-.1-3.4-.2-5.1-.2-39.8 0-72 32.2-72 72s32.2 72 72 72c34.3 0 62.9-23.9 70.2-56l-65 0z\"]\n};\nvar faCircleArrowDown = {\n  prefix: 'fas',\n  iconName: 'circle-arrow-down',\n  icon: [512, 512, [\"arrow-circle-down\"], \"f0ab\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM239 377l-80-80c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l39 39 0-150.1c0-13.3 10.7-24 24-24s24 10.7 24 24l0 150.1 39-39c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0z\"]\n};\nvar faArrowCircleDown = faCircleArrowDown;\nvar faGear = {\n  prefix: 'fas',\n  iconName: 'gear',\n  icon: [512, 512, [9881, \"cog\"], \"f013\", \"M195.1 9.5C198.1-5.3 211.2-16 226.4-16l59.8 0c15.2 0 28.3 10.7 31.3 25.5L332 79.5c14.1 6 27.3 13.7 39.3 22.8l67.8-22.5c14.4-4.8 30.2 1.2 37.8 14.4l29.9 51.8c7.6 13.2 4.9 29.8-6.5 39.9L447 233.3c.9 7.4 1.3 15 1.3 22.7s-.5 15.3-1.3 22.7l53.4 47.5c11.4 10.1 14 26.8 6.5 39.9l-29.9 51.8c-7.6 13.1-23.4 19.2-37.8 14.4l-67.8-22.5c-12.1 9.1-25.3 16.7-39.3 22.8l-14.4 69.9c-3.1 14.9-16.2 25.5-31.3 25.5l-59.8 0c-15.2 0-28.3-10.7-31.3-25.5l-14.4-69.9c-14.1-6-27.2-13.7-39.3-22.8L73.5 432.3c-14.4 4.8-30.2-1.2-37.8-14.4L5.8 366.1c-7.6-13.2-4.9-29.8 6.5-39.9l53.4-47.5c-.9-7.4-1.3-15-1.3-22.7s.5-15.3 1.3-22.7L12.3 185.8c-11.4-10.1-14-26.8-6.5-39.9L35.7 94.1c7.6-13.2 23.4-19.2 37.8-14.4l67.8 22.5c12.1-9.1 25.3-16.7 39.3-22.8L195.1 9.5zM256.3 336a80 80 0 1 0 -.6-160 80 80 0 1 0 .6 160z\"]\n};\nvar faCog = faGear;\nvar faMarsAndVenusBurst = {\n  prefix: 'fas',\n  iconName: 'mars-and-venus-burst',\n  icon: [640, 512, [], \"e523\", \"M464-32c0 17.7 14.3 32 32 32l34.7 0-63 63c-28.4-19.5-62.7-31-99.8-31-97.2 0-176 78.8-176 176 0 86.3 62.1 158.1 144 173.1l0 34.9-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-34.9c81.9-15 144-86.8 144-173.1 0-37-11.4-71.4-31-99.8l63-63 0 34.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-112c0-17.7-14.3-32-32-32L496-64c-17.7 0-32 14.3-32 32zM368 96a112 112 0 1 1 0 224 112 112 0 1 1 0-224zM190.9-21.9C188.4-28 182.6-32 176-32s-12.4 4-14.9 10.1l-29.4 74-76.2-23.1c-6.3-1.9-13.1 .2-17.2 5.3S33.8 46.5 37 52.2l39.5 69.1-65.6 45.1c-5.4 3.7-8 10.3-6.5 16.7s6.7 11.2 13.1 12.2l78.7 12.2-5.6 79.4c-.5 6.5 3.1 12.7 9 15.5s12.9 1.8 17.8-2.6L152.1 268c-5.3-19.1-8.1-39.2-8.1-60 0-65.4 28-124.2 72.6-165.1L190.9-21.9z\"]\n};\nvar faOtter = {\n  prefix: 'fas',\n  iconName: 'otter',\n  icon: [640, 512, [129446], \"f700\", \"M181.5 197.1l12.9 6.4c5.9 3 12.4 4.5 19.1 4.5 23.5 0 42.6-19.1 42.6-42.6l0-21.4c0-35.3-28.7-64-64-64l-64 0c-35.3 0-64 28.7-64 64l0 21.4c0 23.5 19.1 42.6 42.6 42.6 6.6 0 13.1-1.5 19.1-4.5 9.3-4.7 16.4-8.2 21.2-10.6L135.1 185c-4.5-3-7.1-8-7.1-13.3l0-3.7c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24l0 3.7c0 5.3-2.7 10.3-7.1 13.3l-11.8 7.9 8.4 4.2zm-8.6 49.4l-12.9-6.4-12.9 6.4c-12.6 6.3-26.5 9.6-40.5 9.6-3.6 0-7.1-.2-10.6-.6l0 .6c0 35.3 28.7 64 64 64l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l160 0 0-64c0-23.7 12.9-44.4 32-55.4 9.4-5.4 20.3-8.6 32-8.6l0-16c0-26.5 21.5-48 48-48 8.8 0 16 7.2 16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-99.7c0-48.2-30.8-91-76.6-106.3l-8.5-2.8c-8-2.7-12.6-11.1-10.4-19.3s10.3-13.2 18.6-11.6l19.9 4C576 86.1 640 164.2 640 254.9l0 1.1 0 0c0 123.7-100.3 224-224 224l-160.6 0C132 480 32 380 32 256.6l0-39.8c-10.1-14.6-16-32.3-16-51.4l0-21.4 0-1.4C6.7 139.3 0 130.5 0 120 0 106.7 10.7 96 24 96l2.8 0C44.8 58.2 83.3 32 128 32l64 0c44.7 0 83.2 26.2 101.2 64l2.8 0c13.3 0 24 10.7 24 24 0 10.5-6.7 19.3-16 22.6l0 1.4 0 21.4c0 1.4 0 2.8-.1 4.3 12-6.2 25.7-9.6 40.1-9.6l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-13.3 0-24 10.7-24 24l0 8 56.4 0c-15.2 17-24.4 39.4-24.4 64l-32 0c-42.3 0-78.2-27.4-91-65.3-5.1 .9-10.3 1.3-15.6 1.3-14.1 0-27.9-3.3-40.5-9.6zM96 128a16 16 0 1 1 0 32 16 16 0 1 1 0-32zm112 16a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z\"]\n};\nvar faCircleChevronLeft = {\n  prefix: 'fas',\n  iconName: 'circle-chevron-left',\n  icon: [512, 512, [\"chevron-circle-left\"], \"f137\", \"M512 256a256 256 0 1 0 -512 0 256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z\"]\n};\nvar faChevronCircleLeft = faCircleChevronLeft;\nvar faCircleQuestion = {\n  prefix: 'fas',\n  iconName: 'circle-question',\n  icon: [512, 512, [62108, \"question-circle\"], \"f059\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-336c-17.7 0-32 14.3-32 32 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 47.2-36 67.2-56 74.5l0 3.8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8.1c0-20.5 14.8-35.2 30.1-40.2 6.4-2.1 13.2-5.5 18.2-10.3 4.3-4.2 7.7-10 7.7-19.6 0-17.7-14.3-32-32-32zM224 368a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faQuestionCircle = faCircleQuestion;\nvar faWalkieTalkie = {\n  prefix: 'fas',\n  iconName: 'walkie-talkie',\n  icon: [384, 512, [], \"f8ef\", \"M88-32c13.3 0 24 10.7 24 24l0 72 48 0c0-17.7 14.3-32 32-32s32 14.3 32 32l32 0c0-17.7 14.3-32 32-32s32 14.3 32 32l16 0c26.5 0 48 21.5 48 48l0 160.9c0 9.9-2.3 19.7-6.8 28.6l-20.2 40.4c-3.3 6.7-5.1 14-5.1 21.5l0 84.7c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-84.7c0-7.5-1.7-14.8-5.1-21.5L6.8 301.5C2.3 292.6 0 282.8 0 272.9L0 112C0 85.5 21.5 64 48 64l16 0 0-72c0-13.3 10.7-24 24-24zm32 176c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z\"]\n};\nvar faUserGroup = {\n  prefix: 'fas',\n  iconName: 'user-group',\n  icon: [576, 512, [128101, \"user-friends\"], \"f500\", \"M64 128a112 112 0 1 1 224 0 112 112 0 1 1 -224 0zM0 464c0-97.2 78.8-176 176-176s176 78.8 176 176l0 6c0 23.2-18.8 42-42 42L42 512c-23.2 0-42-18.8-42-42l0-6zM432 64a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm0 240c79.5 0 144 64.5 144 144l0 22.4c0 23-18.6 41.6-41.6 41.6l-144.8 0c6.6-12.5 10.4-26.8 10.4-42l0-6c0-51.5-17.4-98.9-46.5-136.7 22.6-14.7 49.6-23.3 78.5-23.3z\"]\n};\nvar faUserFriends = faUserGroup;\nvar faHouseChimney = {\n  prefix: 'fas',\n  iconName: 'house-chimney',\n  icon: [512, 512, [63499, \"home-lg\"], \"e3af\", \"M234.2 8.6c12.3-11.4 31.3-11.4 43.5 0L368 92.3 368 80c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 101.5 37.8 35.1c9.6 9 12.8 22.9 8 35.1S493.2 272 480 272l-16 0 0 176c0 35.3-28.7 64-64 64l-288 0c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208zM240 320c-26.5 0-48 21.5-48 48l0 96 128 0 0-96c0-26.5-21.5-48-48-48l-32 0z\"]\n};\nvar faHomeLg = faHouseChimney;\nvar faRightFromBracket = {\n  prefix: 'fas',\n  iconName: 'right-from-bracket',\n  icon: [512, 512, [\"sign-out-alt\"], \"f2f5\", \"M505 273c9.4-9.4 9.4-24.6 0-33.9L361 95c-6.9-6.9-17.2-8.9-26.2-5.2S320 102.3 320 112l0 80-112 0c-26.5 0-48 21.5-48 48l0 32c0 26.5 21.5 48 48 48l112 0 0 80c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2L505 273zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z\"]\n};\nvar faSignOutAlt = faRightFromBracket;\nvar faFile = {\n  prefix: 'fas',\n  iconName: 'file',\n  icon: [384, 512, [128196, 128459, 61462], \"f15b\", \"M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-277.5c0-17-6.7-33.3-18.7-45.3L258.7 18.7C246.7 6.7 230.5 0 213.5 0L64 0zM325.5 176L232 176c-13.3 0-24-10.7-24-24L208 58.5 325.5 176z\"]\n};\nvar faPlaneSlash = {\n  prefix: 'fas',\n  iconName: 'plane-slash',\n  icon: [576, 512, [], \"e069\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-183.4-183.4 7.1-7.7 127.3 0c30.9 0 56-25.1 56-56s-25.1-56-56-56L392.7 200 233.5 26.4C227.5 19.8 218.9 16 209.9 16l-43.7 0c-10.9 0-18.6 10.7-15.2 21.1L175.1 109.2 41-24.9zM130.2 200l-24.6 0-52.8-66c-3-3.8-7.6-6-12.5-6l-19.8 0c-10.4 0-18 9.8-15.5 19.9L32 256 5 364.1C2.4 374.2 10.1 384 20.5 384l19.8 0c4.9 0 9.5-2.2 12.5-6l52.8-66 99.7 0-54.3 162.9c-3.5 10.4 4.3 21.1 15.2 21.1l43.7 0c9 0 17.5-3.8 23.6-10.4L320.7 390.5 130.2 200z\"]\n};\nvar faCloudShowersHeavy = {\n  prefix: 'fas',\n  iconName: 'cloud-showers-heavy',\n  icon: [512, 512, [], \"f740\", \"M96 320c-53 0-96-43-96-96 0-42.5 27.6-78.6 65.9-91.2-1.3-6.7-1.9-13.7-1.9-20.8 0-61.9 50.1-112 112-112 43.1 0 80.5 24.3 99.2 60 14.7-17.1 36.5-28 60.8-28 44.2 0 80 35.8 80 80 0 5.5-.6 10.8-1.6 16 .5 0 1.1 0 1.6 0 53 0 96 43 96 96s-43 96-96 96L96 320zm6.8 79.6l-32 96C66.6 508.2 53 515 40.4 510.8S21 493 25.2 480.4l32-96C61.4 371.8 75 365 87.6 369.2S107 387 102.8 399.6zm120 0l-32 96c-4.2 12.6-17.8 19.4-30.4 15.2S141 493 145.2 480.4l32-96c4.2-12.6 17.8-19.4 30.4-15.2S227 387 222.8 399.6zm112 0l-32 96c-4.2 12.6-17.8 19.4-30.4 15.2S253 493 257.2 480.4l32-96c4.2-12.6 17.8-19.4 30.4-15.2S339 387 334.8 399.6zm120 0l-32 96c-4.2 12.6-17.8 19.4-30.4 15.2S373 493 377.2 480.4l32-96c4.2-12.6 17.8-19.4 30.4-15.2S459 387 454.8 399.6z\"]\n};\nvar faPersonFalling = {\n  prefix: 'fas',\n  iconName: 'person-falling',\n  icon: [512, 512, [], \"e546\", \"M320 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 5.4c0 45-23.6 86.6-62.1 109.8l-4.6 2.8C131.4 184.7 96 247.1 96 314.6L96 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-69.4c0-16.7 3.3-33 9.4-48L359.2 500.2c11.1 13.7 31.3 15.8 45 4.7s15.8-31.3 4.7-45L295.2 320 400 320 438.4 371.2c10.6 14.1 30.7 17 44.8 6.4s17-30.7 6.4-44.8l-43.2-57.6C437.3 263.1 423.1 256 408 256l-89 0-62.9-75.5c40.3-36 63.9-87.9 63.9-143.1l0-5.4zM104 144a56 56 0 1 0 0-112 56 56 0 1 0 0 112z\"]\n};\nvar faTurnDown = {\n  prefix: 'fas',\n  iconName: 'turn-down',\n  icon: [384, 512, [10549, \"level-down-alt\"], \"f3be\", \"M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9S332.9 320 320 320l-64 0 0-160C256 71.6 184.4 0 96 0L32 0C14.3 0 0 14.3 0 32L0 96c0 17.7 14.3 32 32 32l64 0c17.7 0 32 14.3 32 32l0 160-64 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z\"]\n};\nvar faLevelDownAlt = faTurnDown;\nvar faUpRightAndDownLeftFromCenter = {\n  prefix: 'fas',\n  iconName: 'up-right-and-down-left-from-center',\n  icon: [512, 512, [\"expand-alt\"], \"f424\", \"M344 0L488 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512L24 512c-13.3 0-24-10.7-24-24L0 344c0-9.7 5.8-18.5 14.8-22.2S34.1 320.2 41 327l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S177.7 512 168 512z\"]\n};\nvar faExpandAlt = faUpRightAndDownLeftFromCenter;\nvar faUserTag = {\n  prefix: 'fas',\n  iconName: 'user-tag',\n  icon: [640, 512, [], \"f507\", \"M256.1 8a120 120 0 1 1 0 240 120 120 0 1 1 0-240zM226.4 304l59.4 0c6.7 0 13.2 .4 19.7 1.1-.9 4.9-1.4 9.9-1.4 15l0 92.1c0 25.5 10.1 49.9 28.1 67.9l31.9 31.9-286.3 0c-16.4 0-29.7-13.3-29.7-29.7 0-98.5 79.8-178.3 178.3-178.3zM352.1 412.2l0-92.1c0-17.7 14.3-32 32-32l92.1 0c12.7 0 24.9 5.1 33.9 14.1l96 96c18.7 18.7 18.7 49.1 0 67.9l-76.1 76.1c-18.7 18.7-49.1 18.7-67.9 0l-96-96c-9-9-14.1-21.2-14.1-33.9zm104-44.2a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faHandSparkles = {\n  prefix: 'fas',\n  iconName: 'hand-sparkles',\n  icon: [640, 512, [], \"e05d\", \"M320 0c17.7 0 32 14.3 32 32l0 208c0 8.8 7.2 16 16 16s16-7.2 16-16l0-176c0-17.7 14.3-32 32-32s32 14.3 32 32l0 176c0 8.8 7.2 16 16 16s16-7.2 16-16l0-112c0-17.7 14.3-32 32-32s32 14.3 32 32l0 178.2c-19.2 5.4-34.7 20.4-40.4 40.3l-6.5 22.7-22.7 6.5c-25.2 7.2-42.5 30.2-42.5 56.4 0 22.1 12.4 42 31.4 51.9-27.5 17.8-60.2 28.1-95.4 28.1l-19.2 0c-59.6 0-116.9-22.9-160-64L76.4 341c-16-15.2-16.6-40.6-1.4-56.6s40.6-16.6 56.6-1.4l60.5 57.6c0-1.5-.1-3.1-.1-4.6l0-272c0-17.7 14.3-32 32-32s32 14.3 32 32l0 176c0 8.8 7.2 16 16 16s16-7.2 16-16l0-208c0-17.7 14.3-32 32-32zm-7.3 326.6c-1.1-3.9-4.7-6.6-8.7-6.6s-7.6 2.7-8.7 6.6l-7.3 25.4-25.4 7.3c-3.9 1.1-6.6 4.7-6.6 8.7s2.7 7.6 6.6 8.7l25.4 7.3 7.3 25.4c1.1 3.9 4.7 6.6 8.7 6.6s7.6-2.7 8.7-6.6l7.3-25.4 25.4-7.3c3.9-1.1 6.6-4.7 6.6-8.7s-2.7-7.6-6.6-8.7l-25.4-7.3-7.3-25.4zM104 120l48.3 13.8c4.6 1.3 7.7 5.5 7.7 10.2s-3.1 8.9-7.7 10.2L104 168 90.2 216.3c-1.3 4.6-5.5 7.7-10.2 7.7s-8.9-3.1-10.2-7.7L56 168 7.7 154.2C3.1 152.9 0 148.7 0 144s3.1-8.9 7.7-10.2L56 120 69.8 71.7C71.1 67.1 75.3 64 80 64s8.9 3.1 10.2 7.7L104 120zM584 408l48.3 13.8c4.6 1.3 7.7 5.5 7.7 10.2s-3.1 8.9-7.7 10.2L584 456 570.2 504.3c-1.3 4.6-5.5 7.7-10.2 7.7s-8.9-3.1-10.2-7.7L536 456 487.7 442.2c-4.6-1.3-7.7-5.5-7.7-10.2s3.1-8.9 7.7-10.2L536 408 549.8 359.7c1.3-4.6 5.5-7.7 10.2-7.7s8.9 3.1 10.2 7.7L584 408z\"]\n};\nvar faArrowsToDot = {\n  prefix: 'fas',\n  iconName: 'arrows-to-dot',\n  icon: [512, 512, [], \"e4be\", \"M256 0c17.7 0 32 14.3 32 32l0 32 32 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-9.2-9.2-11.9-22.9-6.9-34.9S179.1 64 192 64l32 0 0-32c0-17.7 14.3-32 32-32zM169.4 393.4l64-64c12.5-12.5 32.8-12.5 45.3 0l64 64c9.2 9.2 11.9 22.9 6.9 34.9S332.9 448 320 448l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9zM32 224l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c12.5 12.5 12.5 32.8 0 45.3l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9S64 332.9 64 320l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3l64-64c9.2-9.2 22.9-11.9 34.9-6.9S448 179.1 448 192l0 32 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-64-64zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faFaceSadCry = {\n  prefix: 'fas',\n  iconName: 'face-sad-cry',\n  icon: [512, 512, [128557, \"sad-cry\"], \"f5b3\", \"M352 493.4c-29.6 12-62.1 18.6-96 18.6s-66.4-6.6-96-18.6L160 296c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 171.7C44.4 421.6 0 344 0 256 0 114.6 114.6 0 256 0S512 114.6 512 256c0 88-44.4 165.6-112 211.7L400 296c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 197.4zM152 196l16 0c11 0 20 9 20 20s9 20 20 20 20-9 20-20c0-33.1-26.9-60-60-60l-16 0c-33.1 0-60 26.9-60 60 0 11 9 20 20 20s20-9 20-20 9-20 20-20zm172 20c0-11 9-20 20-20l16 0c11 0 20 9 20 20s9 20 20 20 20-9 20-20c0-33.1-26.9-60-60-60l-16 0c-33.1 0-60 26.9-60 60 0 11 9 20 20 20s20-9 20-20zM208 336l0 32c0 26.5 21.5 48 48 48s48-21.5 48-48l0-32c0-26.5-21.5-48-48-48s-48 21.5-48 48z\"]\n};\nvar faSadCry = faFaceSadCry;\nvar faDongSign = {\n  prefix: 'fas',\n  iconName: 'dong-sign',\n  icon: [384, 512, [], \"e169\", \"M288-16c-17.7 0-32 14.3-32 32l0 32-104 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l104 0 0 72.2c-22.9-15.3-50.4-24.2-80-24.2-79.5 0-144 64.5-144 144S96.5 432 176 432c30 0 57.8-9.1 80.8-24.8 3.3 14.2 16 24.8 31.2 24.8 17.7 0 32-14.3 32-32l0-304 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0 0-32c0-17.7-14.3-32-32-32zM96 288a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zM24 464c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 464z\"]\n};\nvar faPeopleLine = {\n  prefix: 'fas',\n  iconName: 'people-line',\n  icon: [576, 512, [], \"e534\", \"M288 0a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm96 312c0 25-12.7 47-32 59.9l0 44.1-128 0 0-44.1C204.7 359 192 337 192 312l0-40c0-53 43-96 96-96s96 43 96 96l0 40zm16 104l0-27.3c19.9-22.5 32-52.2 32-84.7l0-32c0-26.7-7.3-51.6-19.9-73.1 11.1-4.5 23.2-6.9 35.9-6.9 53 0 96 43 96 96l0 32c0 23.7-12.9 44.4-32 55.4l0 40.6-112 0zM64 375.4C44.9 364.4 32 343.7 32 320l0-32c0-53 43-96 96-96 12.7 0 24.8 2.5 35.9 6.9-12.6 21.4-19.9 46.4-19.9 73.1l0 32c0 32.5 12.1 62.1 32 84.7l0 27.3-112 0 0-40.6zM128 32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zm320 0a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM24 464l528 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faSquareRss = {\n  prefix: 'fas',\n  iconName: 'square-rss',\n  icon: [448, 512, [\"rss-square\"], \"f143\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM96 136c0-13.3 10.7-24 24-24 137 0 248 111 248 248 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-110.5-89.5-200-200-200-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24 83.9 0 152 68.1 152 152 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-57.4-46.6-104-104-104-13.3 0-24-10.7-24-24zm0 120a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faRssSquare = faSquareRss;\nvar faCalendarMinus = {\n  prefix: 'fas',\n  iconName: 'calendar-minus',\n  icon: [448, 512, [], \"f272\", \"M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zm24 264c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z\"]\n};\nvar faChartDiagram = {\n  prefix: 'fas',\n  iconName: 'chart-diagram',\n  icon: [512, 512, [], \"e695\", \"M80 32C53.5 32 32 53.5 32 80s21.5 48 48 48l152 0 0 40-48 48-72 0c-39.8 0-72 32.2-72 72l0 64-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-64c0-13.3 10.7-24 24-24l72 0 48 48 0 40-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-40 48-48 72 0c13.3 0 24 10.7 24 24l0 64-8 0c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-8 0 0-64c0-39.8-32.2-72-72-72l-72 0-48-48 0-40 152 0c26.5 0 48-21.5 48-48s-21.5-48-48-48L80 32z\"]\n};\nvar faFaceTired = {\n  prefix: 'fas',\n  iconName: 'face-tired',\n  icon: [512, 512, [128555, \"tired\"], \"f5c8\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM164.7 328.7c22-22 53.9-40.7 91.3-40.7s69.3 18.7 91.3 40.7c11.1 11.1 20.1 23.4 26.4 35.4 6.2 11.7 10.3 24.4 10.3 35.9 0 5.2-2.6 10.2-6.9 13.2s-9.8 3.7-14.7 1.8l-20.5-7.7c-26.9-10.1-55.5-15.3-84.3-15.3l-3.2 0c-28.8 0-57.3 5.2-84.3 15.3L149.6 415c-4.9 1.8-10.4 1.2-14.7-1.8S128 405.2 128 400c0-11.6 4.2-24.2 10.3-35.9 6.3-12 15.3-24.3 26.4-35.4zM122.6 159.2c4.5-6.8 13.3-9.2 20.6-5.5l79.6 40c5.4 2.7 8.8 8.2 8.8 14.3s-3.4 11.6-8.8 14.3l-79.6 40c-7.3 3.6-16.1 1.3-20.6-5.5s-3.1-15.9 3.1-21.1L159 208 125.8 180.3c-6.2-5.2-7.6-14.3-3.1-21.1zm263.6 21.1L353 208 386.2 235.7c6.2 5.2 7.6 14.3 3.1 21.1s-13.3 9.2-20.6 5.5l-79.6-40c-5.4-2.7-8.8-8.2-8.8-14.3s3.4-11.6 8.8-14.3l79.6-40c7.3-3.6 16.1-1.3 20.6 5.5s3.1 15.9-3.1 21.1z\"]\n};\nvar faTired = faFaceTired;\nvar faHandPointRight = {\n  prefix: 'fas',\n  iconName: 'hand-point-right',\n  icon: [512, 512, [], \"f0a4\", \"M480 96c17.7 0 32 14.3 32 32s-14.3 32-32 32l-208 0 0-64 208 0zM320 288c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0zm64-64c0 17.7-14.3 32-32 32l-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l48 0c17.7 0 32 14.3 32 32zM288 384c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0zm-88-96l.6 0c-5.4 9.4-8.6 20.3-8.6 32 0 13.2 4 25.4 10.8 35.6-24.9 8.7-42.8 32.5-42.8 60.4 0 11.7 3.1 22.6 8.6 32l-8.6 0C71.6 448 0 376.4 0 288l0-61.7c0-42.4 16.9-83.1 46.9-113.1l11.6-11.6C82.5 77.5 115.1 64 149 64l27 0c35.3 0 64 28.7 64 64l0 88c0 22.1-17.9 40-40 40s-40-17.9-40-40l0-56c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 56c0 39.8 32.2 72 72 72z\"]\n};\nvar faArrowUp = {\n  prefix: 'fas',\n  iconName: 'arrow-up',\n  icon: [384, 512, [8593], \"f062\", \"M214.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-370.7 105.4 105.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z\"]\n};\nvar faCubesStacked = {\n  prefix: 'fas',\n  iconName: 'cubes-stacked',\n  icon: [512, 512, [], \"e4e6\", \"M192 32c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64zm32 352l64 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm192 0l64 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zM320 192l64 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm-182.6-3.9c12.5-12.5 32.8-12.5 45.3 0l45.3 45.3c12.5 12.5 12.5 32.8 0 45.3l-45.3 45.3c-12.5 12.5-32.8 12.5-45.3 0L92.1 278.6c-12.5-12.5-12.5-32.8 0-45.3l45.3-45.3zM32 384l64 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32z\"]\n};\nvar faChildCombatant = {\n  prefix: 'fas',\n  iconName: 'child-combatant',\n  icon: [576, 512, [\"child-rifle\"], \"e4e0\", \"M176.5 128a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-16 352l0-96 32 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-192.2 20.9 33.2c9.4 15 29.2 19.4 44.1 10s19.4-29.2 10-44.1l-39.9-63.3C266.8 184 223.3 160 176.5 160S86.2 184 61.3 223.6L21.4 287c-9.4 15-4.9 34.7 10 44.1s34.7 4.9 44.1-10l20.9-33.2 0 192.2c0 17.7 14.3 32 32 32s32-14.3 32-32zM448.5 0l-32 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l0 100.3c-9.6 5.5-16 15.9-16 27.7l0 32c-17.7 0-32 14.3-32 32l0 144c0 17.7 14.3 32 32 32l16 0 0 96c0 8.8 7.2 16 16 16l59.5 0c10.4 0 18-9.8 15.5-19.9l-23-92.1 44 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-48 0 0-26.7 53.1-17.7c6.5-2.2 10.9-8.3 10.9-15.2l0-84.5c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 56-16 5.3 0-109.3c0-11.8-6.4-22.2-16-27.7l0-116.3c0-8.8-7.2-16-16-16z\"]\n};\nvar faChildRifle = faChildCombatant;\nvar faVestPatches = {\n  prefix: 'fas',\n  iconName: 'vest-patches',\n  icon: [448, 512, [], \"e086\", \"M200 293.9L200 464c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 270.5c0-9.5 2.8-18.7 8.1-26.6l47.9-71.8c5.3-7.9 8.1-17.1 8.1-26.6L64 48C64 21.5 85.5 0 112 0l3.5 0c.3 0 .6 0 1 0 .6 0 1.2 0 1.8 0 18.8 0 34.1 9.7 44.1 18.8 9.3 8.4 28.5 21.2 61.7 21.2s52.4-12.8 61.7-21.2c10-9.1 25.3-18.8 44.1-18.8 .6 0 1.2 0 1.8 0 .3 0 .6 0 1 0L336 0c26.5 0 48 21.5 48 48l0 97.5c0 9.5 2.8 18.7 8.1 26.6l47.9 71.8c5.3 7.9 8.1 17.1 8.1 26.6L448 464c0 26.5-21.5 48-48 48l-104 0c-26.5 0-48-21.5-48-48l0-170.1c0-3.9 .5-7.8 1.4-11.6L303.6 65.4C285.9 77.2 259.8 88 224 88s-61.9-10.8-79.6-22.6l54.2 216.8c1 3.8 1.4 7.7 1.4 11.6zM96 456a40 40 0 1 0 0-80 40 40 0 1 0 0 80zM63.5 255.5c-4.7 4.7-4.7 12.3 0 17L79 288 63.5 303.5c-4.7 4.7-4.7 12.3 0 17s12.3 4.7 17 0L96 305 111.5 320.5c4.7 4.7 12.3 4.7 17 0s4.7-12.3 0-17L113 288 128.5 272.5c4.7-4.7 4.7-12.3 0-17s-12.3-4.7-17 0L96 271 80.5 255.5c-4.7-4.7-12.3-4.7-17 0zM304 280l0 40c0 8.8 7.2 16 16 16l40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-8c0-13.3-10.7-24-24-24s-24 10.7-24 24z\"]\n};\nvar faMartiniGlassEmpty = {\n  prefix: 'fas',\n  iconName: 'martini-glass-empty',\n  icon: [512, 512, [\"glass-martini\"], \"f000\", \"M32 32C19.1 32 7.4 39.8 2.4 51.8S.2 77.5 9.4 86.6l214.6 214.6 0 146.7-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-146.7 214.6-214.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 32 480 32L32 32zM256 242.7L109.3 96 402.7 96 256 242.7z\"]\n};\nvar faGlassMartini = faMartiniGlassEmpty;\nvar faMagnet = {\n  prefix: 'fas',\n  iconName: 'magnet',\n  icon: [448, 512, [129522], \"f076\", \"M0 176L0 288C0 411.7 100.3 512 224 512S448 411.7 448 288l0-112-128 0 0 112c0 53-43 96-96 96s-96-43-96-96l0-112-128 0zm0-48l128 0 0-64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64l0 64zm320 0l128 0 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64z\"]\n};\nvar faRoadBarrier = {\n  prefix: 'fas',\n  iconName: 'road-barrier',\n  icon: [640, 512, [], \"e562\", \"M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32L64 266.3 149.2 96 64 96 64 64c0-17.7-14.3-32-32-32zM405.2 96l-74.3 0-5.4 10.7-90.6 181.3 74.3 0 5.4-10.7 90.6-181.3zM362.8 288l74.3 0 5.4-10.7 90.6-181.3-74.3 0-5.4 10.7-90.6 181.3zM202.8 96l-5.4 10.7-90.6 181.3 74.3 0 5.4-10.7 90.6-181.3-74.3 0zm288 192l85.2 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 53.7-85.2 170.3z\"]\n};\nvar faCompassDrafting = {\n  prefix: 'fas',\n  iconName: 'compass-drafting',\n  icon: [512, 512, [\"drafting-compass\"], \"f568\", \"M99.3 256.1l69.4-119.9c-5.6-12.2-8.8-25.8-8.8-40.2 0-53 43-96 96-96s96 43 96 96c0 14.3-3.1 27.9-8.8 40.2l44.4 76.7c-23.1 26-53.7 45.1-88.4 53.8L256 191.9 187.9 309.5c21.5 6.8 44.3 10.5 68.1 10.5 70.7 0 133.8-32.7 174.9-84 11.1-13.8 31.2-16 45-5s16 31.2 5 45c-52.7 65.8-133.9 108-224.8 108-35.4 0-69.4-6.4-100.7-18.1L98.7 463.7C94 471.8 87 478.4 78.6 482.6L23.2 510.3c-5 2.5-10.9 2.2-15.6-.7S0 501.5 0 496l0-55.4c0-8.4 2.2-16.7 6.5-24.1l60-103.7c-12.8-11.2-24.6-23.5-35.3-36.8-11.1-13.8-8.8-33.9 5-45s33.9-8.8 45 5c5.7 7.1 11.8 13.8 18.2 20.1zM381.1 407.9c32.5-13 62.4-31 88.9-52.9l35.6 61.5c4.2 7.3 6.5 15.6 6.5 24.1l0 55.4c0 5.5-2.9 10.7-7.6 13.6s-10.6 3.2-15.6 .7l-55.4-27.7c-8.4-4.2-15.4-10.8-20.1-18.9l-32.3-55.8zM256 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faDraftingCompass = faCompassDrafting;\nvar faSquarePersonConfined = {\n  prefix: 'fas',\n  iconName: 'square-person-confined',\n  icon: [448, 512, [], \"e577\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm96 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm80 104c0-30.9 25.1-56 56-56s56 25.1 56 56l0 102.1c0 36.4-29.5 65.9-65.9 65.9-17.5 0-34.3-6.9-46.6-19.3l-54.7-54.7-28.1 56.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l48-96c4.6-9.2 13.3-15.6 23.5-17.3s20.5 1.7 27.8 9l41.4 41.4 0-58.7z\"]\n};\nvar faPlateWheat = {\n  prefix: 'fas',\n  iconName: 'plate-wheat',\n  icon: [512, 512, [], \"e55a\", \"M176 32c44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16-44.2 0-80-35.8-80-80l0-16c0-8.8 7.2-16 16-16zM56 64l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24S42.7 64 56 64zM24 136l112 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 96c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zM272 48c0-8.8 7.2-16 16-16 44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16-44.2 0-80-35.8-80-80l0-16zM400 32c44.2 0 80 35.8 80 80l0 16c0 8.8-7.2 16-16 16-44.2 0-80-35.8-80-80l0-16c0-8.8 7.2-16 16-16zm80 160l0 16c0 44.2-35.8 80-80 80-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80 8.8 0 16 7.2 16 16zM352 176c8.8 0 16 7.2 16 16l0 16c0 44.2-35.8 80-80 80-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80zm-96 16l0 16c0 44.2-35.8 80-80 80-8.8 0-16-7.2-16-16l0-16c0-44.2 35.8-80 80-80 8.8 0 16 7.2 16 16zM3.5 347.6C1.6 332.9 13 320 27.8 320l456.4 0c14.8 0 26.2 12.9 24.4 27.6-6.3 50.2-44.4 89.4-92.6 98.4l0 2c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-2c-48.2-9-86.3-48.2-92.5-98.4z\"]\n};\nvar faSignHanging = {\n  prefix: 'fas',\n  iconName: 'sign-hanging',\n  icon: [512, 512, [\"sign\"], \"f4d9\", \"M96 0c17.7 0 32 14.3 32 32l0 32 352 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-352 0 0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352-32 0C14.3 128 0 113.7 0 96S14.3 64 32 64l32 0 0-32C64 14.3 78.3 0 96 0zM208 176l240 0c17.7 0 32 14.3 32 32l0 144c0 17.7-14.3 32-32 32l-240 0c-17.7 0-32-14.3-32-32l0-144c0-17.7 14.3-32 32-32z\"]\n};\nvar faSign = faSignHanging;\nvar faCarBattery = {\n  prefix: 'fas',\n  iconName: 'car-battery',\n  icon: [512, 512, [\"battery-car\"], \"f5df\", \"M80 64c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l96 0c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l16 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l16 0zM392 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 32-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0 0-32zM64 240c0 13.3 10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 216c-13.3 0-24 10.7-24 24z\"]\n};\nvar faBatteryCar = faCarBattery;\nvar faShirt = {\n  prefix: 'fas',\n  iconName: 'shirt',\n  icon: [640, 512, [128085, \"t-shirt\", \"tshirt\"], \"f553\", \"M320.2 112c44.2 0 80-35.8 80-80l53.5 0c17 0 33.3 6.7 45.3 18.7L617.6 169.4c12.5 12.5 12.5 32.8 0 45.3l-50.7 50.7c-12.5 12.5-32.8 12.5-45.3 0l-41.4-41.4 0 224c0 35.3-28.7 64-64 64l-192 0c-35.3 0-64-28.7-64-64l0-224-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0L22.9 214.6c-12.5-12.5-12.5-32.8 0-45.3L141.5 50.7c12-12 28.3-18.7 45.3-18.7l53.5 0c0 44.2 35.8 80 80 80z\"]\n};\nvar faTShirt = faShirt;\nvar faTshirt = faShirt;\nvar faParagraph = {\n  prefix: 'fas',\n  iconName: 'paragraph',\n  icon: [448, 512, [182], \"f1dd\", \"M160 0L416 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 416c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-416-48 0 0 416c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160-48 0C71.6 320 0 248.4 0 160S71.6 0 160 0z\"]\n};\nvar faEnvelopesBulk = {\n  prefix: 'fas',\n  iconName: 'envelopes-bulk',\n  icon: [576, 512, [\"mail-bulk\"], \"f674\", \"M112 0C85.5 0 64 21.5 64 48l0 160 80 0 0-32c0-53 43-96 96-96l208 0 0-32c0-26.5-21.5-48-48-48L112 0zM240 128c-26.5 0-48 21.5-48 48l0 32 80 0c53 0 96 43 96 96l0 112 160 0c26.5 0 48-21.5 48-48l0-192c0-26.5-21.5-48-48-48l-288 0zm200 64l48 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24zM48 256c-26.5 0-48 21.5-48 48l0 10.4 156.6 86.2c1.1 .6 2.2 .9 3.4 .9s2.4-.3 3.4-.9L320 314.4 320 304c0-26.5-21.5-48-48-48L48 256zM320 369.2L186.6 442.6c-8.1 4.5-17.3 6.8-26.6 6.8s-18.4-2.4-26.6-6.8L0 369.2 0 464c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-94.8z\"]\n};\nvar faMailBulk = faEnvelopesBulk;\nvar faGuitar = {\n  prefix: 'fas',\n  iconName: 'guitar',\n  icon: [512, 512, [], \"f7a6\", \"M465 7c-9.4-9.4-24.6-9.4-33.9 0L383 55c-2.4 2.4-4.3 5.3-5.5 8.5l-15.4 41-77.5 77.6c-45.1-29.4-99.3-30.2-131 1.6-11 11-18 24.6-21.4 39.6-3.7 16.6-19.1 30.7-36.1 31.6-25.6 1.3-49.3 10.7-67.3 28.6-44.8 44.8-36.4 125.8 18.7 180.9S183.6 528 228.4 483.2c17.9-17.9 27.4-41.7 28.6-67.3 .9-17 15-32.3 31.6-36.1 15-3.4 28.6-10.5 39.6-21.4 31.8-31.8 31-85.9 1.6-131l77.6-77.6 41-15.4c3.2-1.2 6.1-3.1 8.5-5.5l48-48c9.4-9.4 9.4-24.6 0-33.9L465 7zM208 256a48 48 0 1 1 0 96 48 48 0 1 1 0-96z\"]\n};\nvar faSuitcase = {\n  prefix: 'fas',\n  iconName: 'suitcase',\n  icon: [512, 512, [129523], \"f0f2\", \"M200 48l112 0c4.4 0 8 3.6 8 8l0 40-128 0 0-40c0-4.4 3.6-8 8-8zm-56 8l0 424 224 0 0-424c0-30.9-25.1-56-56-56L200 0c-30.9 0-56 25.1-56 56zM416 96l0 384 32 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-32 0zM96 480l0-384-32 0C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l32 0z\"]\n};\nvar faCircleUp = {\n  prefix: 'fas',\n  iconName: 'circle-up',\n  icon: [512, 512, [61467, \"arrow-alt-circle-up\"], \"f35b\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm11.3-387.3l104 104c4.6 4.6 5.9 11.5 3.5 17.4S366.5 256 360 256l-56 0 0 96c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-96-56 0c-6.5 0-12.3-3.9-14.8-9.9s-1.1-12.9 3.5-17.4l104-104c6.2-6.2 16.4-6.2 22.6 0z\"]\n};\nvar faArrowAltCircleUp = faCircleUp;\nvar faF = {\n  prefix: 'fas',\n  iconName: 'f',\n  icon: [320, 512, [102], \"46\", \"M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-128 224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32z\"]\n};\nvar faXmarksLines = {\n  prefix: 'fas',\n  iconName: 'xmarks-lines',\n  icon: [640, 512, [], \"e59a\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zm0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l576 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416zM7 167c-9.4 9.4-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55c-9.4-9.4-24.6-9.4-33.9 0zM265 167c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55zM455 167c-9.4 9.4-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55c-9.4-9.4-24.6-9.4-33.9 0z\"]\n};\nvar faEarthOceania = {\n  prefix: 'fas',\n  iconName: 'earth-oceania',\n  icon: [512, 512, [\"globe-oceania\"], \"e47b\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM192 150.6c0-12.5 10.1-22.6 22.6-22.6l41.4 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.7 0c-8.5 0-16.6-3.4-22.6-9.4l-16-16c-4.2-4.2-6.6-10-6.6-16zM432 256c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM411.3 379.3l-32 32c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l32-32c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6zM224 432c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zm-96-80c-17.7 0-32-14.3-32-32l0-18.7c0-8.5 3.4-16.6 9.4-22.6l48-48c4.2-4.2 10-6.6 16-6.6l6.6 0c8.8 0 16 7.2 16 16s7.2 16 16 16 16-7.2 16-16 7.2-16 16-16l6.6 0c6 0 11.8 2.4 16 6.6l48 48c6 6 9.4 14.1 9.4 22.6l0 50.7c0 17.7-14.3 32-32 32l-50.7 0c-8.5 0-16.6-3.4-22.6-9.4l-13.3-13.3c-6-6-14.1-9.4-22.6-9.4L128 352z\"]\n};\nvar faGlobeOceania = faEarthOceania;\nvar faCommentSlash = {\n  prefix: 'fas',\n  iconName: 'comment-slash',\n  icon: [576, 512, [], \"f4b3\", \"M41-25C31.6-34.3 16.4-34.3 7-25S-2.3-.4 7 9L535 537c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.6-96.6c44.4-43.2 71.6-101.8 71.6-166.5 0-132.5-114.6-240-256-240-63 0-120.8 21.4-165.4 56.8L41-25zm19.4 155C42.2 163 32 200.3 32 239.9 32 294.2 51.2 344.2 83.6 384.4L34.8 476.7c-4.8 9-3.3 20 3.6 27.5S56.1 514 65.5 510l118.4-50.7c31.8 13.3 67.1 20.7 104.1 20.7 36.4 0 70.9-7.1 102.3-19.9L60.3 130.1z\"]\n};\nvar faPlay = {\n  prefix: 'fas',\n  iconName: 'play',\n  icon: [448, 512, [9654], \"f04b\", \"M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z\"]\n};\nvar faVialCircleCheck = {\n  prefix: 'fas',\n  iconName: 'vial-circle-check',\n  icon: [512, 512, [], \"e596\", \"M32 32C32 14.3 46.3 0 64 0L288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 161.4c-66.1 30.3-112 97.1-112 174.6 0 39.7 12 76.6 32.7 107.2-10.3 3.1-21.3 4.8-32.7 4.8-61.9 0-112-50.1-112-112L64 64C46.3 64 32 49.7 32 32zm96 32l0 128 96 0 0-128-96 0zm96 336a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm201.4-60.9c-7.1-5.2-17.2-3.6-22.4 3.5l-53 72.9-26.8-26.8c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c3.3 3.3 7.9 5 12.6 4.6s8.9-2.8 11.7-6.5l64-88c5.2-7.1 3.6-17.2-3.5-22.3z\"]\n};\nvar faBridgeCircleCheck = {\n  prefix: 'fas',\n  iconName: 'bridge-circle-check',\n  icon: [576, 512, [], \"e4c9\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l8 0 0 64-40 0 0 112c37.6 9.4 64 43.2 64 82l0 94c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96 6.4 0 12.7 .6 18.7 1.8 34.7-49.5 92.2-81.8 157.3-81.8 28.6 0 55.6 6.2 80 17.4l0-65.4-40 0 0-64 8 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM424 96l0 64-80 0 0-64 80 0zM296 96l0 64-80 0 0-64 80 0zM88 96l80 0 0 64-80 0 0-64zM576 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-86.6-60.9c7.1 5.2 8.7 15.2 3.5 22.3l-64 88c-2.8 3.8-7 6.2-11.7 6.5s-9.3-1.3-12.6-4.6l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l26.8 26.8 53-72.9c5.2-7.1 15.2-8.7 22.4-3.5z\"]\n};\nvar faCediSign = {\n  prefix: 'fas',\n  iconName: 'cedi-sign',\n  icon: [384, 512, [], \"e0df\", \"M232 32c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 26.5C88.8 73.9 16 156.4 16 256S88.8 438.1 184 453.5l0 26.5c0 13.3 10.7 24 24 24s24-10.7 24-24l0-24.6c46.8-3.7 89.1-23.6 121.3-53.9 12.9-12.1 13.4-32.4 1.3-45.2s-32.4-13.4-45.2-1.3c-20.7 19.6-47.6 32.7-77.3 36.2l0-270.1c29.8 3.5 56.6 16.6 77.3 36.2 12.9 12.1 33.1 11.5 45.2-1.3s11.5-33.1-1.3-45.2C321.1 80.2 278.8 60.3 232 56.6L232 32zm-48 91.8l0 264.4C124.3 373.8 80 320.1 80 256s44.3-117.8 104-132.2z\"]\n};\nvar faPuzzlePiece = {\n  prefix: 'fas',\n  iconName: 'puzzle-piece',\n  icon: [512, 512, [129513], \"f12e\", \"M224 0c35.3 0 64 21.5 64 48 0 10.4-4.4 20-12 27.9-6.6 6.9-12 15.3-12 24.9 0 15 12.2 27.2 27.2 27.2l44.8 0c26.5 0 48 21.5 48 48l0 44.8c0 15 12.2 27.2 27.2 27.2 9.5 0 18-5.4 24.9-12 7.9-7.5 17.5-12 27.9-12 26.5 0 48 28.7 48 64s-21.5 64-48 64c-10.4 0-20.1-4.4-27.9-12-6.9-6.6-15.3-12-24.9-12-15 0-27.2 12.2-27.2 27.2L384 464c0 26.5-21.5 48-48 48l-56.8 0c-12.8 0-23.2-10.4-23.2-23.2 0-9.2 5.8-17.3 13.2-22.8 11.6-8.7 18.8-20.7 18.8-34 0-26.5-28.7-48-64-48s-64 21.5-64 48c0 13.3 7.2 25.3 18.8 34 7.4 5.5 13.2 13.5 13.2 22.8 0 12.8-10.4 23.2-23.2 23.2L48 512c-26.5 0-48-21.5-48-48L0 343.2c0-12.8 10.4-23.2 23.2-23.2 9.2 0 17.3 5.8 22.8 13.2 8.7 11.6 20.7 18.8 34 18.8 26.5 0 48-28.7 48-64s-21.5-64-48-64c-13.3 0-25.3 7.2-34 18.8-5.5 7.4-13.5 13.2-22.8 13.2-12.8 0-23.2-10.4-23.2-23.2L0 176c0-26.5 21.5-48 48-48l108.8 0c15 0 27.2-12.2 27.2-27.2 0-9.5-5.4-18-12-24.9-7.5-7.9-12-17.5-12-27.9 0-26.5 28.7-48 64-48z\"]\n};\nvar faHelmetUn = {\n  prefix: 'fas',\n  iconName: 'helmet-un',\n  icon: [512, 512, [], \"e503\", \"M479.5 224C471.2 98.9 367.2 0 240 0 107.5 0 0 107.5 0 240l0 56.3C0 344.8 39.2 384 87.7 384l127.3 0 128.6 121.4c4.5 4.2 10.4 6.6 16.5 6.6l96 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-86.5 0-1.5-1.5 0-174.5 112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-.5 0zM320 417.2l-78-73.7 32.4-55.5 45.6 0 0 129.2zM285.3 103.1l34.7 52 0-43.2c0-8.8 7.2-16 16-16s16 7.2 16 16l0 96c0 7.1-4.6 13.3-11.4 15.3s-14-.6-17.9-6.4l-34.7-52 0 43.2c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-96c0-7.1 4.6-13.3 11.4-15.3s14 .6 17.9 6.4zM160 112l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-64c0-8.8 7.2-16 16-16s16 7.2 16 16z\"]\n};\nvar faGlassWater = {\n  prefix: 'fas',\n  iconName: 'glass-water',\n  icon: [384, 512, [], \"e4f4\", \"M32 0C23.1 0 14.6 3.7 8.6 10.2S-.6 25.4 .1 34.3L28.9 437.7c3 41.9 37.8 74.3 79.8 74.3l166.6 0c42 0 76.8-32.4 79.8-74.3L383.9 34.3c.6-8.9-2.4-17.6-8.5-24.1S360.9 0 352 0L32 0zM73 156.5l-6.6-92.5 251.3 0-6.6 92.5-24.2 12.1c-19.4 9.7-42.2 9.7-61.6 0-20.9-10.4-45.5-10.4-66.4 0-19.4 9.7-42.2 9.7-61.6 0L73 156.5z\"]\n};\nvar faHeartCircleBolt = {\n  prefix: 'fas',\n  iconName: 'heart-circle-bolt',\n  icon: [576, 512, [], \"e4fc\", \"M241 87.1l15 20.7 15-20.7C296 52.5 336.2 32 378.9 32 452.4 32 512 91.6 512 165.1l0 2.6c0 17.6-3.4 35.6-9.5 53.7-21.8-8.6-45.6-13.4-70.5-13.4-106 0-192 86-192 192 0 28.5 6.2 55.6 17.4 80-.5 0-.9 0-1.4 0-15.5 0-30.8-4.6-43.1-14.1-73-55.7-212.9-186-212.9-298.2l0-2.6C0 91.6 59.6 32 133.1 32 175.8 32 216 52.5 241 87.1zM288 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm177.4-77c-5.8-4.2-13.8-4-19.4 .5l-80 64c-5.3 4.2-7.4 11.4-5.1 17.8S369.2 416 376 416l32.9 0-15.9 42.4c-2.5 6.7-.2 14.3 5.6 18.6s13.8 4 19.4-.5l80-64c5.3-4.2 7.4-11.4 5.1-17.8S494.8 384 488 384l-32.9 0 15.9-42.4c2.5-6.7 .2-14.3-5.6-18.6z\"]\n};\nvar faPumpSoap = {\n  prefix: 'fas',\n  iconName: 'pump-soap',\n  icon: [320, 512, [], \"e06b\", \"M96 0l0 80 128 0 0-24 72 0c13.3 0 24-10.7 24-24S309.3 8 296 8l-72 0 0-8c0-17.7-14.3-32-32-32l-64 0C110.3-32 96-17.7 96 0zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 128zM224 344c0 35.3-28.7 56-64 56s-64-20.7-64-56c0-32.5 37-80.9 50.9-97.9 3.2-3.9 8.1-6.1 13.1-6.1s9.9 2.2 13.1 6.1C187 263.1 224 311.5 224 344z\"]\n};\nvar faHandScissors = {\n  prefix: 'fas',\n  iconName: 'hand-scissors',\n  icon: [512, 512, [], \"f257\", \"M40 208c-22.1 0-40 17.9-40 40s17.9 40 40 40l180.2 0c-7.6 8.5-12.2 19.7-12.2 32 0 25.3 19.5 46 44.3 47.9-7.7 8.5-12.3 19.8-12.3 32.1 0 26.5 21.5 48 48 48l96 0c70.7 0 128-57.3 128-128l0-113.1c0-40.2-16-78.8-44.4-107.3-22.8-22.8-53.6-35.6-85.8-35.6L336 64c-21.3 0-39.3 13.9-45.6 33.1l74.5 23.7c8.4 2.7 13.1 11.7 10.4 20.1s-11.7 13.1-20.1 10.4l-67.1-21.4 0 .1-204-64.1C62.9 59.2 40.5 70.9 33.9 92s5.1 43.5 26.2 50.2L269.5 208 40 208z\"]\n};\nvar faDolly = {\n  prefix: 'fas',\n  iconName: 'dolly',\n  icon: [576, 512, [\"dolly-box\"], \"f472\", \"M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l72.9 0 92.1 276.2c-22.5 17.6-37 45-37 75.8 0 53 43 96 96 96 52.4 0 95.1-42 96-94.3l202.1-67.4c16.8-5.6 25.8-23.7 20.2-40.5s-23.7-25.8-40.5-20.2L331.8 357c-17.2-22.1-43.9-36.5-74-37L165.7 43.8C156.9 17.6 132.5 0 104.9 0L32 0zM208 416a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM280.5 89.3c-25.2 8.2-39 35.3-30.8 60.5l39.6 121.7c8.2 25.2 35.3 39 60.5 30.8l121.7-39.6c25.2-8.2 39-35.3 30.8-60.5L462.8 80.5c-8.2-25.2-35.3-39-60.5-30.8L280.5 89.3z\"]\n};\nvar faDollyBox = faDolly;\nvar faPaperclip = {\n  prefix: 'fas',\n  iconName: 'paperclip',\n  icon: [512, 512, [128206], \"f0c6\", \"M224.6 12.8c56.2-56.2 147.4-56.2 203.6 0s56.2 147.4 0 203.6l-164 164c-34.4 34.4-90.1 34.4-124.5 0s-34.4-90.1 0-124.5L292.5 103.3c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L185 301.3c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l164-164c31.2-31.2 31.2-81.9 0-113.1s-81.9-31.2-113.1 0l-164 164c-53.1 53.1-53.1 139.2 0 192.3s139.2 53.1 192.3 0L428.3 284.3c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L343.4 459.6c-78.1 78.1-204.7 78.1-282.8 0s-78.1-204.7 0-282.8l164-164z\"]\n};\nvar faDemocrat = {\n  prefix: 'fas',\n  iconName: 'democrat',\n  icon: [640, 512, [], \"f747\", \"M64 32c0-8.9 3.8-20.9 6.2-27.3 1-2.8 3.8-4.7 6.8-4.7 1.9 0 3.8 .7 5.2 2.1L128 45.7 173.8 2.1c1.4-1.3 3.2-2.1 5.2-2.1 3 0 5.8 1.8 6.8 4.7 2.4 6.5 6.2 18.4 6.2 27.3 0 26.5-21.9 42-29.5 46.6l76.2 72.6c6 5.7 13.9 8.8 22.1 8.8l219.2 0 32 0c40.3 0 78.2 19 102.4 51.2l19.2 25.6c10.6 14.1 7.7 34.2-6.4 44.8s-34.2 7.7-44.8-6.4l-19.2-25.6c-5.3-7-11.8-12.8-19.2-17l0 87.4-352 0-40.4-94.3c-3.9-9.2-15.3-12.6-23.6-7l-42.1 28c-9.1 6.1-19.7 9.3-30.7 9.3l-2 0C23.9 256 0 232.1 0 202.7 0 190.6 4.1 178.9 11.7 169.4L87.6 74.6C78.1 67.4 64 53.2 64 32zM544 352l0 128c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-64-160 0 0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-128 352 0zM256 280a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm248-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM368 280a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faSquareArrowUpRight = {\n  prefix: 'fas',\n  iconName: 'square-arrow-up-right',\n  icon: [448, 512, [\"external-link-square\"], \"f14c\", \"M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM272 296c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24l-112 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l54.1 0-103 103c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l103-103 0 54.1z\"]\n};\nvar faExternalLinkSquare = faSquareArrowUpRight;\nvar faFerry = {\n  prefix: 'fas',\n  iconName: 'ferry',\n  icon: [640, 512, [], \"e4ea\", \"M224 32c0-17.7 14.3-32 32-32L384 0c17.7 0 32 14.3 32 32l0 32 48 0c44.2 0 80 35.8 80 80l0 128-.1 0c.1 .7 .1 1.3 .1 2 0 30.2-7.6 59.8-22 86.3l-12.7 23.3-.6 1c-22.3-11.3-46.5-16.8-70.8-16.7-32.5 .2-64.9 10.7-92.4 31.4-22.1 16.6-29.1 16.6-51.2 0-28.1-21.1-61.3-31.6-94.4-31.4-23.6 .2-47.1 5.7-68.7 16.7l-.6-1-12.7-23.3c-14.4-26.5-22-56.2-22-86.3 0-.7 0-1.4 .1-2l-.1 0 0-128c0-44.2 35.8-80 80-80l48 0 0-32zM160 256l320 0 0-112c0-8.8-7.2-16-16-16l-288 0c-8.8 0-16 7.2-16 16l0 112zM403.4 476.1C379.1 494.3 351.1 512 320 512s-59.1-17.7-83.4-35.9c-21.3-16.1-49.9-16.1-71.2 0-23.8 17.9-54.1 35.5-88.1 35.3-20.4-.1-40.7-6.7-59.8-21.1-10.6-8-12.7-23-4.7-33.6s23-12.7 33.6-4.7c11.3 8.5 21.6 11.4 31.2 11.5 17.6 .1 37.3-9.4 58.9-25.7 38.4-29 90.5-29 129 0 24 18.1 40.7 26.3 54.5 26.3s30.5-8.2 54.5-26.3c38.4-29 90.5-29 129 0 16.9 12.7 32.9 21.5 47.8 24.6 13.7 2.8 27.4 .9 42.3-10.3 10.6-8 25.6-5.9 33.6 4.7s5.9 25.6-4.7 33.6c-26.4 19.9-54.2 24.4-80.7 19.1-25.3-5.1-48.1-18.9-67.2-33.3-21.3-16.1-49.9-16.1-71.2 0z\"]\n};\nvar faMosquito = {\n  prefix: 'fas',\n  iconName: 'mosquito',\n  icon: [576, 512, [], \"e52b\", \"M178.5 495.2c-7.5 9.6-21 12.1-31.3 5.3S133.5 480 138.9 469l1.2-2.2 36.2-58 0-41 .3-4c.6-3.9 2.2-7.7 4.6-10.9l39.3-52.2-66.2 59.5c-17 15.3-39 23.7-61.9 23.8l-8.1 0c-46.6 0-84.4-37.8-84.4-84.4 0-43 32.4-79.2 75.1-83.9l130.5-14.5-44.8-38.3-2.4-2.4c-5.3-6-7.3-14.4-5.3-22.3l13.3-53.4-25.9-38.9-1.3-2.1c-5.8-10.8-2.7-24.6 7.4-31.7 10.1-7.1 23.7-5.1 31.4 4.3l1.5 2 32 48 1.4 2.2c2.8 5.3 3.5 11.6 2.1 17.6l-12.3 49.2 53.3 45.7 0-28.8c0-11.8 6.5-22.1 16-27.7l0-60.5 .3-3.3c1.5-7.3 8-12.7 15.7-12.7s14.2 5.5 15.7 12.7l.3 3.2 0 60.5c9.6 5.5 16 15.8 16 27.7l0 28.9 53.4-45.8-12.3-49.2c-1.5-5.9-.7-12.2 2.1-17.6l1.4-2.2 32-48 1.5-2c7.7-9.4 21.3-11.5 31.4-4.3 10.1 7.1 13.1 20.9 7.4 31.7l-1.3 2.1-25.9 38.9 13.3 53.4c2 8-.1 16.3-5.3 22.3l-2.4 2.4-44.7 38.3 130.5 14.5c42.8 4.8 75.1 40.9 75.1 83.9 0 46.6-37.8 84.4-84.4 84.4l-8.1 0c-22.8 0-44.9-8.5-61.9-23.8l-66.1-59.5 39.2 52.2c2.4 3.2 4 7 4.6 10.9l.3 4 0 41 36.2 58 1.2 2.1c5.4 11 2 24.7-8.3 31.5s-23.8 4.4-31.3-5.3l-1.4-2-40-64-1.6-3.1c-1.4-3.1-2.1-6.6-2.1-10.1l0-39.8-32.4-43.1 0 74.7c0 17.7-14.3 32-32 32-17.7 0-32-14.3-32-32l0-74.6-32.3 43 0 39.8c0 3.5-.7 6.9-2.1 10.1l-1.6 3.1-40 64-1.4 2z\"]\n};\nvar faBuildingCircleArrowRight = {\n  prefix: 'fas',\n  iconName: 'building-circle-arrow-right',\n  icon: [576, 512, [], \"e4d1\", \"M32 64C32 28.7 60.7 0 96 0L352 0c35.3 0 64 28.7 64 64l0 144.7c-35.7 2.9-68.5 15.6-96 35.4l0-4c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l4 0c-13.8 19.2-24.1 41-30.1 64.5-1.9-.4-3.9-.5-5.9-.5l-32 0c-17.7 0-32 14.3-32 32l0 80 74.9 0c6.1 17.3 14.6 33.4 25.1 48L96 512c-35.3 0-64-28.7-64-64L32 64zM144 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM144 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM288 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm140.7-67.3c-6.2 6.2-6.2 16.4 0 22.6l28.7 28.7-89.4 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l89.4 0-28.7 28.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l56-56c6.2-6.2 6.2-16.4 0-22.6l-56-56c-6.2-6.2-16.4-6.2-22.6 0z\"]\n};\nvar faLeftRight = {\n  prefix: 'fas',\n  iconName: 'left-right',\n  icon: [512, 512, [8596, \"arrows-alt-h\"], \"f337\", \"M502.6 406.6l-96 96c-9.2 9.2-22.9 11.9-34.9 6.9S352 492.9 352 480l0-64-320 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l320 0 0-64c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l96 96c12.5 12.5 12.5 32.8 0 45.3zM9.4 150.6c-12.5-12.5-12.5-32.8 0-45.3l96-96c9.2-9.2 22.9-11.9 34.9-6.9S160 19.1 160 32l0 64 320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-320 0 0 64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-96-96z\"]\n};\nvar faArrowsAltH = faLeftRight;\nvar faVirus = {\n  prefix: 'fas',\n  iconName: 'virus',\n  icon: [512, 512, [], \"e074\", \"M296 40c0-22.1-17.9-40-40-40s-40 17.9-40 40c0 44.1-53.3 66.1-84.5 35-15.6-15.6-40.9-15.6-56.6 0s-15.6 40.9 0 56.6c31.2 31.2 9.1 84.5-35 84.5-22.1 0-40 17.9-40 40s17.9 40 40 40c44.1 0 66.1 53.3 35 84.5-15.6 15.6-15.6 40.9 0 56.6s40.9 15.6 56.6 0c31.2-31.2 84.5-9.1 84.5 35 0 22.1 17.9 40 40 40s40-17.9 40-40c0-44.1 53.3-66.1 84.5-35 15.6 15.6 40.9 15.6 56.6 0s15.6-40.9 0-56.6c-31.2-31.2-9.1-84.5 35-84.5 22.1 0 40-17.9 40-40s-17.9-40-40-40c-44.1 0-66.1-53.3-35-84.5 15.6-15.6 15.6-40.9 0-56.6s-40.9-15.6-56.6 0C349.3 106.1 296 84.1 296 40zM160 224a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm160 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faGem = {\n  prefix: 'fas',\n  iconName: 'gem',\n  icon: [512, 512, [128142], \"f3a5\", \"M116.7 33.8c4.5-6.1 11.7-9.8 19.3-9.8l240 0c7.6 0 14.8 3.6 19.3 9.8l112 152c6.8 9.2 6.1 21.9-1.5 30.4l-232 256c-4.5 5-11 7.9-17.8 7.9s-13.2-2.9-17.8-7.9l-232-256c-7.7-8.5-8.3-21.2-1.5-30.4l112-152zm38.5 39.8c-3.3 2.5-4.2 7-2.1 10.5L210.5 179.8 63.3 192c-4.1 .3-7.3 3.8-7.3 8s3.2 7.6 7.3 8l192 16c.4 0 .9 0 1.3 0l192-16c4.1-.3 7.3-3.8 7.3-8s-3.2-7.6-7.3-8l-147.2-12.3 57.4-95.6c2.1-3.5 1.2-8.1-2.1-10.5s-7.9-2-10.7 1L256 172.2 165.9 74.6c-2.8-3-7.4-3.4-10.7-1z\"]\n};\nvar faToilet = {\n  prefix: 'fas',\n  iconName: 'toilet',\n  icon: [448, 512, [128701], \"f7d8\", \"M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48l8 0 0 148.9c-1.9 1.4-3.8 2.9-5.6 4.4-15.5 13.2-26.4 31.6-26.4 54.6 0 46.9 14.3 84.1 37 112.5 14.2 17.7 31.1 31.3 48.5 41.8L65.6 469.9c-3.3 9.8-1.6 20.5 4.4 28.8S85.7 512 96 512l256 0c10.3 0 19.9-4.9 26-13.3s7.7-19.1 4.4-28.8l-19.8-59.5c17.4-10.5 34.3-24.1 48.5-41.8 22.7-28.4 37-65.5 37-112.5 0-23.1-10.9-41.5-26.4-54.6-1.8-1.5-3.7-3-5.6-4.4l0-148.9 8 0c13.3 0 24-10.7 24-24S437.3 0 424 0L24 0zM96 80c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16zM224 288c-88.4 0-160-14.3-160-32s71.6-32 160-32 160 14.3 160 32-71.6 32-160 32z\"]\n};\nvar faSingleQuoteLeft = {\n  prefix: 'fas',\n  iconName: 'single-quote-left',\n  icon: [192, 512, [], \"e81b\", \"M128 96c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64L0 216C0 149.7 53.7 96 120 96l8 0z\"]\n};\nvar faMoneyBills = {\n  prefix: 'fas',\n  iconName: 'money-bills',\n  icon: [576, 512, [], \"e1f3\", \"M160 32c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32zm176 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM160 152l0-48c0-4.4 3.6-8 8-8l48 0c4.4 0 8.1 3.6 7.5 8-3.6 29-26.6 51.9-55.5 55.5-4.4 .5-8-3.1-8-7.5zm0 112c0-4.4 3.6-8.1 8-7.5 29 3.6 51.9 26.6 55.5 55.5 .5 4.4-3.1 8-7.5 8l-48 0c-4.4 0-8-3.6-8-8l0-48zM504 159.5c-29-3.6-51.9-26.6-55.5-55.5-.5-4.4 3.1-8 7.5-8l48 0c4.4 0 8 3.6 8 8l0 48c0 4.4-3.6 8.1-8 7.5zM512 264l0 48c0 4.4-3.6 8-8 8l-48 0c-4.4 0-8.1-3.6-7.5-8 3.6-29 26.6-51.9 55.5-55.5 4.4-.5 8 3.1 8 7.5zM48 152c0-13.3-10.7-24-24-24S0 138.7 0 152L0 416c0 35.3 28.7 64 64 64l392 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L64 432c-8.8 0-16-7.2-16-16l0-264z\"]\n};\nvar faTabletButton = {\n  prefix: 'fas',\n  iconName: 'tablet-button',\n  icon: [448, 512, [], \"f10a\", \"M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM224 400a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faRectangleXmark = {\n  prefix: 'fas',\n  iconName: 'rectangle-xmark',\n  icon: [512, 512, [62164, \"rectangle-times\", \"times-rectangle\", \"window-close\"], \"f410\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zM167 167c9.4-9.4 24.6-9.4 33.9 0l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9z\"]\n};\nvar faRectangleTimes = faRectangleXmark;\nvar faTimesRectangle = faRectangleXmark;\nvar faWindowClose = faRectangleXmark;\nvar faWrench = {\n  prefix: 'fas',\n  iconName: 'wrench',\n  icon: [576, 512, [128295], \"f0ad\", \"M509.4 98.6c7.6-7.6 20.3-5.7 24.1 4.3 6.8 17.7 10.5 37 10.5 57.1 0 88.4-71.6 160-160 160-17.5 0-34.4-2.8-50.2-8L146.9 498.9c-28.1 28.1-73.7 28.1-101.8 0s-28.1-73.7 0-101.8L232 210.2c-5.2-15.8-8-32.6-8-50.2 0-88.4 71.6-160 160-160 20.1 0 39.4 3.7 57.1 10.5 10 3.8 11.8 16.5 4.3 24.1l-88.7 88.7c-3 3-4.7 7.1-4.7 11.3l0 41.4c0 8.8 7.2 16 16 16l41.4 0c4.2 0 8.3-1.7 11.3-4.7l88.7-88.7z\"]\n};\nvar faTrashCan = {\n  prefix: 'fas',\n  iconName: 'trash-can',\n  icon: [448, 512, [61460, \"trash-alt\"], \"f2ed\", \"M136.7 5.9C141.1-7.2 153.3-16 167.1-16l113.9 0c13.8 0 26 8.8 30.4 21.9L320 32 416 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 8.7-26.1zM32 144l384 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-304zm88 64c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24z\"]\n};\nvar faTrashAlt = faTrashCan;\nvar faTableCells = {\n  prefix: 'fas',\n  iconName: 'table-cells',\n  icon: [448, 512, [\"th\"], \"f00a\", \"M384 96l0 64-64 0 0-64 64 0zm0 128l0 64-64 0 0-64 64 0zm0 128l0 64-64 0 0-64 64 0zM256 288l-64 0 0-64 64 0 0 64zm-64 64l64 0 0 64-64 0 0-64zm-64-64l-64 0 0-64 64 0 0 64zM64 352l64 0 0 64-64 0 0-64zm0-192l0-64 64 0 0 64-64 0zm128 0l0-64 64 0 0 64-64 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z\"]\n};\nvar faTh = faTableCells;\nvar faRibbon = {\n  prefix: 'fas',\n  iconName: 'ribbon',\n  icon: [384, 512, [127895], \"f4d6\", \"M235.1 0c33.4 0 64.5 17.4 81.9 45.9 1.2 2 13 21.3 35.3 57.8 21.1 34.5 18.3 78.5-7 110L278.3 297.7 364.5 406c5.5 6.9 4.4 16.9-2.5 22.5l-80 64c-6.9 5.5-17 4.4-22.5-2.5L38.6 213.8C13.3 182.3 10.5 138.3 31.6 103.8 54 67.2 65.7 47.9 67 45.9 84.4 17.4 115.4 0 148.9 0l86.3 0zM192 189.2l48.6-61.2-97.3 0 48.6 61.2zM75 336.2l86.2 107.8-36.8 46c-5.5 6.9-15.6 8-22.5 2.5l-80-64c-6.9-5.5-8-15.6-2.5-22.5L75 336.2z\"]\n};\nvar faLandmarkFlag = {\n  prefix: 'fas',\n  iconName: 'landmark-flag',\n  icon: [512, 512, [], \"e51c\", \"M352-32L240-32c-8.8 0-16 7.2-16 16l0 144-176 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0 0 224-51.2 38.4C4.7 460.4 0 469.9 0 480 0 497.7 14.3 512 32 512l448 0c17.7 0 32-14.3 32-32 0-10.1-4.7-19.6-12.8-25.6l-51.2-38.4 0-224 16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-192 0 0-64 80 0c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16zm48 224l0 224-64 0 0-224 64 0zm-112 0l0 224-64 0 0-224 64 0zm-112 0l0 224-64 0 0-224 64 0z\"]\n};\nvar faUpDownLeftRight = {\n  prefix: 'fas',\n  iconName: 'up-down-left-right',\n  icon: [512, 512, [\"arrows-alt\"], \"f0b2\", \"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9S179.1 128 192 128l32 0 0 96-96 0 0-32c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9S128 332.9 128 320l0-32 96 0 0 96-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9S332.9 384 320 384l-32 0 0-96 96 0 0 32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9S384 179.1 384 192l0 32-96 0 0-96 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64z\"]\n};\nvar faArrowsAlt = faUpDownLeftRight;\nvar faCarSide = {\n  prefix: 'fas',\n  iconName: 'car-side',\n  icon: [640, 512, [128663], \"f5e4\", \"M147 106.7l-29.8 85.3 122.9 0 0-96-77.9 0c-6.8 0-12.9 4.3-15.1 10.7zM48.6 193.9L86.5 85.6C97.8 53.5 128.1 32 162.1 32L360 32c25.2 0 48.9 11.9 64 32l96.2 128.3C587.1 196.5 640 252.1 640 320l0 16c0 35.3-28.7 64-64 64l-16.4 0c-4 44.9-41.7 80-87.6 80s-83.6-35.1-87.6-80l-144.7 0c-4 44.9-41.7 80-87.6 80s-83.6-35.1-87.6-80l-.4 0c-35.3 0-64-28.7-64-64l0-80c0-30.1 20.7-55.3 48.6-62.1zM440 192l-67.2-89.6c-3-4-7.8-6.4-12.8-6.4l-72 0 0 96 152 0zM152 432a40 40 0 1 0 0-80 40 40 0 1 0 0 80zm360-40a40 40 0 1 0 -80 0 40 40 0 1 0 80 0z\"]\n};\nvar faTrashArrowUp = {\n  prefix: 'fas',\n  iconName: 'trash-arrow-up',\n  icon: [448, 512, [\"trash-restore\"], \"f829\", \"M167.1-16l113.9 0c13.8 0 26 8.8 30.4 21.9L320 32 416 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 8.7-26.1C141.1-7.2 153.3-16 167.1-16zM32 144l384 0-21.1 323.1C393.3 492.4 372.3 512 347 512L101 512c-25.3 0-46.3-19.6-47.9-44.9L32 144zm209 79c-9.4-9.4-24.6-9.4-33.9 0l-72 72c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l31-31 0 102.1c0 13.3 10.7 24 24 24s24-10.7 24-24l0-102.1 31 31c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-72-72z\"]\n};\nvar faTrashRestore = faTrashArrowUp;\nvar faLifeRing = {\n  prefix: 'fas',\n  iconName: 'life-ring',\n  icon: [512, 512, [], \"f1cd\", \"M367.2 412.5C335.9 434.9 297.5 448 256 448s-79.9-13.1-111.2-35.5l58-58c15.8 8.6 34 13.5 53.3 13.5s37.4-4.9 53.3-13.5l58 58zm90.7 .8c33.8-43.4 54-98 54-157.3S491.8 142.1 458 98.7c9-12.5 7.9-30.1-3.4-41.3S425.8 45 413.3 54C369.9 20.2 315.3 0 256 0S142.1 20.2 98.7 54c-12.5-9-30.1-7.9-41.3 3.4S45 86.2 54 98.7C20.2 142.1 0 196.7 0 256S20.2 369.9 54 413.3c-9 12.5-7.9 30.1 3.4 41.3S86.2 467 98.7 458c43.4 33.8 98 54 157.3 54s113.9-20.2 157.3-54c12.5 9 30.1 7.9 41.3-3.4s12.4-28.8 3.4-41.3zm-45.5-46.1l-58-58c8.6-15.8 13.5-34 13.5-53.3s-4.9-37.4-13.5-53.3l58-58C434.9 176.1 448 214.5 448 256s-13.1 79.9-35.5 111.2zM367.2 99.5l-58 58c-15.8-8.6-34-13.5-53.3-13.5s-37.4 4.9-53.3 13.5l-58-58C176.1 77.1 214.5 64 256 64s79.9 13.1 111.2 35.5zM157.5 309.3l-58 58C77.1 335.9 64 297.5 64 256s13.1-79.9 35.5-111.2l58 58c-8.6 15.8-13.5 34-13.5 53.3s4.9 37.4 13.5 53.3zM208 256a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z\"]\n};\nvar faCopyright = {\n  prefix: 'fas',\n  iconName: 'copyright',\n  icon: [512, 512, [169], \"f1f9\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM205.1 306.9c28.1 28.1 73.7 28.1 101.8 0 9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-46.9 46.9-122.8 46.9-169.7 0s-46.9-122.8 0-169.7 122.8-46.9 169.7 0c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-28.1-28.1-73.7-28.1-101.8 0s-28.1 73.7 0 101.8z\"]\n};\nvar faFilePrescription = {\n  prefix: 'fas',\n  iconName: 'file-prescription',\n  icon: [384, 512, [], \"f572\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM88 192c-13.3 0-24 10.7-24 24l0 144c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40 22.5 0 58.4 55-33.4 31.6c-9.6 9.1-10.1 24.3-.9 33.9s24.3 10.1 33.9 .9l35.4-33.5 35.6 33.5c9.7 9.1 24.8 8.6 33.9-1s8.6-24.8-1-33.9l-33.6-31.6 33.6-31.8c9.6-9.1 10.1-24.3 .9-33.9s-24.3-10.1-33.9-.9l-35.7 33.7-40.9-38.5c12.9-11.7 21.1-28.6 21.1-47.5 0-35.3-28.7-64-64-64l-56 0zm32 80l-8 0 0-32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-24 0z\"]\n};\nvar faEraser = {\n  prefix: 'fas',\n  iconName: 'eraser',\n  icon: [576, 512, [], \"f12d\", \"M178.5 416l123 0 65.3-65.3-173.5-173.5-126.7 126.7 112 112zM224 480l-45.5 0c-17 0-33.3-6.7-45.3-18.7L17 345C6.1 334.1 0 319.4 0 304s6.1-30.1 17-41L263 17C273.9 6.1 288.6 0 304 0s30.1 6.1 41 17L527 199c10.9 10.9 17 25.6 17 41s-6.1 30.1-17 41l-135 135 120 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0z\"]\n};\nvar faHourglassStart = {\n  prefix: 'fas',\n  iconName: 'hourglass-start',\n  icon: [384, 512, [\"hourglass-1\"], \"f251\", \"M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM288 437l0 11-192 0 0-11c0-25.5 10.1-49.9 28.1-67.9l67.9-67.9 67.9 67.9c18 18 28.1 42.4 28.1 67.9z\"]\n};\nvar faHourglass1 = faHourglassStart;\nvar faCircleLeft = {\n  prefix: 'fas',\n  iconName: 'circle-left',\n  icon: [512, 512, [61840, \"arrow-alt-circle-left\"], \"f359\", \"M512 256a256 256 0 1 0 -512 0 256 256 0 1 0 512 0zM124.7 244.7l104-104c4.6-4.6 11.5-5.9 17.4-3.5s9.9 8.3 9.9 14.8l0 56 96 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32l-96 0 0 56c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5l-104-104c-6.2-6.2-6.2-16.4 0-22.6z\"]\n};\nvar faArrowAltCircleLeft = faCircleLeft;\nvar faCruzeiroSign = {\n  prefix: 'fas',\n  iconName: 'cruzeiro-sign',\n  icon: [448, 512, [], \"e152\", \"M240 96c-88.4 0-160 71.6-160 160 0 71.6 47.1 132.3 112 152.7L192 256c0-13.3 10.7-24 24-24 12.8 0 23.3 10.1 24 22.7 15.5-9.5 33.5-14.7 52.3-14.7l11.8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-11.8 0c-18.8 0-36.1 10-45.4 26.3-4.5 7.9-6.9 16.8-6.9 25.9l0 75.8c42.5 0 81.1-16.6 109.8-43.6 12.9-12.1 33.1-11.5 45.2 1.3s11.5 33.1-1.3 45.2C353.7 456.8 299.5 480 240 480 116.3 480 16 379.7 16 256S116.3 32 240 32c59.5 0 113.7 23.2 153.7 61.1 12.9 12.1 13.4 32.4 1.3 45.2s-32.4 13.4-45.2 1.3C321.1 112.6 282.5 96 240 96z\"]\n};\nvar faSmoking = {\n  prefix: 'fas',\n  iconName: 'smoking',\n  icon: [576, 512, [128684], \"f48d\", \"M360 0c13.3 0 24 10.7 24 24l0 19c0 40.3 16 79 44.5 107.5l21 21C469 191 480 217.4 480 245l0 19c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-19c0-14.9-5.9-29.1-16.4-39.6l-21-21C357.1 146.9 336 96 336 43l0-19c0-13.3 10.7-24 24-24zM552 288c-13.3 0-24-10.7-24-24l0-19c0-40.3-16-79-44.5-107.5l-21-21C443 97 432 70.6 432 43l0-19c0-13.3 10.7-24 24-24s24 10.7 24 24l0 19c0 14.9 5.9 29.1 16.4 39.6l21 21C554.9 141.1 576 192 576 245l0 19c0 13.3-10.7 24-24 24zM320 448l96 0 0-32-96 0 0 32zM0 416c0-35.3 28.7-64 64-64l384 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32L64 512c-35.3 0-64-28.7-64-64l0-32zm576-40l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24s24 10.7 24 24z\"]\n};\nvar faSquarePollVertical = {\n  prefix: 'fas',\n  iconName: 'square-poll-vertical',\n  icon: [448, 512, [\"poll\"], \"f681\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm56 192c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zm184 88c0-13.3 10.7-24 24-24s24 10.7 24 24l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48zM224 128c13.3 0 24 10.7 24 24l0 208c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-208c0-13.3 10.7-24 24-24z\"]\n};\nvar faPoll = faSquarePollVertical;\nvar faPersonCircleMinus = {\n  prefix: 'fas',\n  iconName: 'person-circle-minus',\n  icon: [640, 512, [], \"e540\", \"M280 24a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zm24 212.7L341 286.6c12.8-17.5 28.5-32.7 46.3-45l-56.2-75.7C306 132 266.3 112 224 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6L144 236.7 144 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-275.3zM640 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-64 0c0 8.8-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l128 0c8.8 0 16 7.2 16 16z\"]\n};\nvar faBiohazard = {\n  prefix: 'fas',\n  iconName: 'biohazard',\n  icon: [576, 512, [9763], \"f780\", \"M260 12.6c0-8.3-7.6-14.5-15.5-12.1-60.9 18.8-105.1 75.8-105.1 143.1 0 25.1 6.1 48.7 17 69.5-21 1.8-42 8.2-61.5 19.5-57.9 33.6-84.8 100.2-70.9 162.5 1.9 8.4 11.4 12 18.9 7.6 5-2.9 7.6-8.6 7.1-14.4-.3-3.3-.4-6.6-.4-10.1 0-123.5 184.4-123.5 184.4 0 0 88.4-94.5 113.6-148.2 75.4-4.5-3.2-10.5-3.9-15.3-1.1-7 4.1-8.6 13.6-2.7 19.1 46.6 43.8 118 53.9 176.1 20.2 17.9-10.4 32.8-23.9 44.5-39.4 11.7 15.6 26.6 29.1 44.5 39.4 58.1 33.7 129.5 23.6 176.1-20.2 5.9-5.5 4.3-15.1-2.7-19.1-4.8-2.8-10.8-2.1-15.3 1.1-53.7 38.2-148.2 13-148.2-75.4 0-123.5 184.4-123.5 184.4 0 0 3.4-.1 6.8-.4 10.1-.5 5.8 2.1 11.5 7.1 14.4 7.4 4.3 17 .8 18.9-7.6 13.9-62.2-13-128.9-70.9-162.5-19.5-11.3-40.4-17.7-61.5-19.5 10.9-20.8 17-44.4 17-69.5 0-67.3-44.2-124.3-105.1-143.1-7.9-2.4-15.5 3.8-15.5 12.1 0 5.9 4 11 9.5 13.2 83.4 33.6 70.8 178.4-37.8 178.4S167.1 59.4 250.5 25.8c5.5-2.2 9.5-7.3 9.5-13.2zM248.4 288a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM435 317.7c-16.2 0-31.4 5.5-42.1 15-10.1 9.1-18.1 23.4-18.1 45.6 0 21.1 7.2 35 16.5 44.1 32.2-24.6 55.5-60.5 63.9-101.8-6.3-1.9-13.2-3-20.2-3zM202 378.3c0-22.3-8-36.6-18.1-45.6-10.7-9.6-25.9-15-42.1-15-7 0-13.9 1-20.2 3 8.4 41.3 31.6 77.2 63.9 101.8 9.4-9.1 16.5-23.1 16.5-44.2zm41.2-224.3c9 10.2 23.2 18.2 45.2 18.2s36.2-8 45.2-18.2c6.7-7.6 11.5-17.5 13.6-28.4-18.3-6.8-38.2-10.5-58.8-10.5s-40.5 3.7-58.8 10.5c2.2 10.9 6.9 20.8 13.6 28.5z\"]\n};\nvar faBellConcierge = {\n  prefix: 'fas',\n  iconName: 'bell-concierge',\n  icon: [512, 512, [128718, \"concierge-bell\"], \"f562\", \"M216 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0 0 33.3C124.8 156.7 40.2 243.7 32.6 352l446.9 0C471.8 243.7 387.2 156.7 280 145.3l0-33.3 16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zM24 400c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 400z\"]\n};\nvar faConciergeBell = faBellConcierge;\nvar faRulerHorizontal = {\n  prefix: 'fas',\n  iconName: 'ruler-horizontal',\n  icon: [576, 512, [], \"f547\", \"M48 384c-26.5 0-48-21.5-48-48L0 176c0-26.5 21.5-48 48-48l24 0 0 104c0 13.3 10.7 24 24 24s24-10.7 24-24l0-104 48 0 0 72c0 13.3 10.7 24 24 24s24-10.7 24-24l0-72 48 0 0 104c0 13.3 10.7 24 24 24s24-10.7 24-24l0-104 48 0 0 72c0 13.3 10.7 24 24 24s24-10.7 24-24l0-72 48 0 0 104c0 13.3 10.7 24 24 24s24-10.7 24-24l0-104 24 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48L48 384z\"]\n};\nvar faHorse = {\n  prefix: 'fas',\n  iconName: 'horse',\n  icon: [576, 512, [128014], \"f6f0\", \"M448 238.1l0-78.1 16 0 9.8 19.6c12.5 25.1 42.2 36.4 68.3 26 20.5-8.2 33.9-28 33.9-50.1L576 80c0-19.1-8.4-36.3-21.7-48l5.7 0c8.8 0 16-7.2 16-16S568.8 0 560 0L448 0C377.3 0 320 57.3 320 128l-171.2 0C118.1 128 91.2 144.3 76.3 168.8 33.2 174.5 0 211.4 0 256l0 56c0 13.3 10.7 24 24 24s24-10.7 24-24l0-56c0-13.4 6.6-25.2 16.7-32.5 1.6 13 6.3 25.4 13.6 36.4l28.2 42.4c8.3 12.4 6.4 28.7-1.2 41.6-16.5 28-20.6 62.2-10 93.9l17.5 52.4c4.4 13.1 16.6 21.9 30.4 21.9l33.7 0c21.8 0 37.3-21.4 30.4-42.1l-20.8-62.5c-2.1-6.4-.5-13.4 4.3-18.2l12.7-12.7c13.2-13.2 20.6-31.1 20.6-49.7 0-2.3-.1-4.6-.3-6.9l84 24c4.1 1.2 8.2 2.1 12.3 2.8L320 480c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-164.3c19.2-19.2 31.5-45.7 32-75.7l0 0 0-1.9zM496 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z\"]\n};\nvar faCalendar = {\n  prefix: 'fas',\n  iconName: 'calendar',\n  icon: [448, 512, [128197, 128198], \"f133\", \"M128 0C110.3 0 96 14.3 96 32l0 32-32 0C28.7 64 0 92.7 0 128l0 48 448 0 0-48c0-35.3-28.7-64-64-64l-32 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32-128 0 0-32c0-17.7-14.3-32-32-32zM0 224L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192-448 0z\"]\n};\nvar faHandsHoldingChild = {\n  prefix: 'fas',\n  iconName: 'hands-holding-child',\n  icon: [640, 512, [], \"e4fa\", \"M320-32a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM40 64c22.1 0 40 17.9 40 40l0 160.2c0 17 6.7 33.3 18.7 45.3l51.1 51.1c8.3 8.3 21.3 9.6 31 3.1 12.9-8.6 14.7-26.9 3.7-37.8-7.3-7.3-23.1-23.1-47.2-47.2-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c24.1 24.1 39.9 39.9 47.2 47.2l0 0 25.3 25.3c21 21 32.8 49.5 32.8 79.2l0 78.9c0 26.5-21.5 48-48 48l-66.7 0c-17 0-33.3-6.7-45.3-18.7L28.1 393.4C10.1 375.4 0 351 0 325.5L0 104C0 81.9 17.9 64 40 64zm560 0c22.1 0 40 17.9 40 40l0 221.5c0 25.5-10.1 49.9-28.1 67.9L512 493.3c-12 12-28.3 18.7-45.3 18.7L400 512c-26.5 0-48-21.5-48-48l0-78.9c0-29.7 11.8-58.2 32.8-79.2l25.3-25.3 0 0c7.3-7.3 23.1-23.1 47.2-47.2 12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3c-24.1 24.1-39.9 39.9-47.2 47.2-11 11-9.2 29.2 3.7 37.8 9.7 6.5 22.7 5.2 31-3.1l51.1-51.1c12-12 18.7-28.3 18.7-45.3L560 104c0-22.1 17.9-40 40-40zM384.5 149l-19.8-16.7 11.1 88.8c1.6 13.2-7.7 25.1-20.8 26.8s-25.1-7.7-26.8-20.8l-4.4-35-7.6 0-4.4 35c-1.6 13.2-13.6 22.5-26.8 20.8s-22.5-13.6-20.8-26.8l11.1-88.8-19.8 16.7c-10.1 8.6-25.3 7.3-33.8-2.8s-7.3-25.3 2.8-33.8l27.9-23.6C271.3 72.8 295.3 64 320 64s48.7 8.8 67.6 24.7l27.9 23.6c10.1 8.6 11.4 23.7 2.8 33.8s-23.7 11.4-33.8 2.8z\"]\n};\nvar faItalic = {\n  prefix: 'fas',\n  iconName: 'italic',\n  icon: [384, 512, [], \"f033\", \"M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0-133.3 320 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0 133.3-320-64 0c-17.7 0-32-14.3-32-32z\"]\n};\nvar faKhanda = {\n  prefix: 'fas',\n  iconName: 'khanda',\n  icon: [512, 512, [9772], \"f66d\", \"M240.7 8c8.9-7.4 21.8-7.4 30.7 0l37.8 31.5c8.7 7.3 11.1 19.6 6 29.6-1.2 2.4-2.8 5.5-4.6 9.2 34.2 19.2 57.3 55.8 57.3 97.8s-23.1 78.6-57.3 97.8c1.8 3.7 3.3 6.8 4.6 9.2 5.1 10 2.7 22.3-6 29.6l-37.2 31 0 19.8c22.9-15.7 48.4-33.3 76.7-52.7 42.8-29.4 68.4-78 68.4-130l0-11.1c0-23.9-7.1-47.3-20.4-67.2-5.1-7.7-4.6-17.8 1.7-24.6 6.6-7.1 17.2-8.1 25.2-2.8 27.5 18.1 89.4 67.5 89.4 149.1 0 46.5-20.2 88.6-41.8 120.4-21.6 32-45.6 55-55.3 63.8-7.8 7.1-19 7.9-27.6 3l-70.8-40.3-32.7 22.5 45.5 31.3c1.8-.4 3.7-.7 5.7-.7 13.3 0 24 10.7 24 24s-10.7 24-24 24c-12.2 0-22.3-9.1-23.8-21l-40.2-27.6 0 28.9c9.6 5.5 16 15.9 16 27.7 0 17.7-14.3 32-32 32s-32-14.3-32-32c0-11.8 6.4-22.2 16-27.7l0-28.1-40.3 27.7c-1.8 11.4-11.8 20.1-23.7 20.1-13.3 0-24-10.7-24-24s10.7-24 24-24c2.2 0 4.4 .3 6.5 .9l45.8-31.5-32.7-22.5-70.8 40.3c-8.7 4.9-19.8 4.1-27.6-3-9.7-8.8-33.7-31.9-55.3-63.8-21.5-31.8-41.8-73.9-41.8-120.4 0-81.7 61.9-131.1 89.4-149.1 8.1-5.3 18.6-4.3 25.2 2.8 6.4 6.9 6.8 17 1.7 24.6-13.3 19.9-20.4 43.3-20.4 67.2l0 11.1c0 51.9 25.6 100.6 68.4 130 28.4 19.6 53.7 36.9 75.6 52l0-19.1-37.2-31c-8.7-7.3-11.1-19.6-6-29.6 1.2-2.4 2.8-5.5 4.6-9.2-34.2-19.2-57.3-55.8-57.3-97.8s23.1-78.6 57.3-97.8c-1.8-3.7-3.3-6.8-4.6-9.2-5.1-10-2.7-22.3 6-29.6L240.7 8zM220.3 122.9c-17 11.5-28.2 31-28.2 53.1s11.2 41.6 28.2 53.1c6.8-19.2 11.8-38.4 11.8-53.1s-4.9-33.9-11.8-53.1zm71.5 106.2c17-11.5 28.2-31 28.2-53.1s-11.2-41.6-28.2-53.1c-6.8 19.2-11.8 38.4-11.8 53.1s4.9 33.9 11.8 53.1z\"]\n};\nvar faFaceFrownOpen = {\n  prefix: 'fas',\n  iconName: 'face-frown-open',\n  icon: [512, 512, [128550, \"frown-open\"], \"f57a\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM176 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM182.4 382.5c-12.4 5.2-26.5-4.1-21.1-16.4 16-36.6 52.4-62.1 94.8-62.1s78.8 25.6 94.8 62.1c5.4 12.3-8.7 21.6-21.1 16.4-22.4-9.5-47.4-14.8-73.7-14.8s-51.3 5.3-73.7 14.8z\"]\n};\nvar faFrownOpen = faFaceFrownOpen;\nvar faCheck = {\n  prefix: 'fas',\n  iconName: 'check',\n  icon: [448, 512, [10003, 10004], \"f00c\", \"M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z\"]\n};\nvar faFingerprint = {\n  prefix: 'fas',\n  iconName: 'fingerprint',\n  icon: [512, 512, [], \"f577\", \"M48 256c0-114.9 93.1-208 208-208 63.1 0 119.6 28.1 157.8 72.5 8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0 114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6-15.2 5-18.7 23.7-8.3 35.9 7.1 8.3 18.8 10.8 29.4 7.9 10.6-2.9 21.8-4.4 33.4-4.4 70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3-1.7 14.6 9.4 27.8 24.2 27.8 11.8 0 21.9-8.6 23.3-20.3 3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4-23.1 29.8-36.8 67.1-36.8 107.7l0 24.9c0 24.2-2.6 48.4-7.8 71.9-3.4 15.6 7.9 31.1 23.9 31.1 10.5 0 19.9-7 22.2-17.3 6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1 7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1-3.8 14.3 6.7 29 21.5 29 9.5 0 17.9-6.2 20.4-15.4 10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9-2.7 13.9 7.7 27.2 21.8 27.2 10.2 0 19-7 21-17 7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z\"]\n};\nvar faChargingStation = {\n  prefix: 'fas',\n  iconName: 'charging-station',\n  icon: [576, 512, [], \"f5e7\", \"M64 64C64 28.7 92.7 0 128 0L288 0c35.3 0 64 28.7 64 64l0 224c44.2 0 80 35.8 80 80l0 12c0 11 9 20 20 20s20-9 20-20l0-127.7c-32.5-10.2-56-40.5-56-76.3l0-32c0-8.8 7.2-16 16-16l16 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 32 0 0-48c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 16 0c8.8 0 16 7.2 16 16l0 32c0 35.8-23.5 66.1-56 76.3L520 380c0 37.6-30.4 68-68 68s-68-30.4-68-68l0-12c0-17.7-14.3-32-32-32l0 129.4c9.3 3.3 16 12.2 16 22.6 0 13.3-10.7 24-24 24L72 512c-13.3 0-24-10.7-24-24 0-10.5 6.7-19.3 16-22.6L64 64zm82.7 125.7l39 0-20.9 66.9c-2.4 7.6 3.3 15.4 11.3 15.4 2.9 0 5.6-1 7.8-2.9l94.6-82c3.1-2.7 4.9-6.6 4.9-10.7 0-7.8-6.3-14.1-14.1-14.1l-39 0 20.9-66.9c2.4-7.6-3.3-15.4-11.3-15.4-2.9 0-5.6 1-7.8 2.9l-94.6 82c-3.1 2.7-4.9 6.6-4.9 10.7 0 7.8 6.3 14.1 14.1 14.1z\"]\n};\nvar faUserLock = {\n  prefix: 'fas',\n  iconName: 'user-lock',\n  icon: [576, 512, [], \"f502\", \"M224 8a120 120 0 1 1 0 240 120 120 0 1 1 0-240zM194.3 304l59.4 0c29.7 0 57.7 7.3 82.3 20.1l0 4.3c-19.6 17.6-32 43.1-32 71.5l0 96c0 5.5 .5 10.9 1.3 16.1L45.7 512C29.3 512 16 498.7 16 482.3 16 383.8 95.8 304 194.3 304zm301.7 .1c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0 0-47.9zM352 400c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96z\"]\n};\nvar faMobileScreenButton = {\n  prefix: 'fas',\n  iconName: 'mobile-screen-button',\n  icon: [384, 512, [\"mobile-alt\"], \"f3cd\", \"M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zm64 0l0 304 224 0 0-304-224 0zM192 472c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32z\"]\n};\nvar faMobileAlt = faMobileScreenButton;\nvar faAnchorCircleCheck = {\n  prefix: 'fas',\n  iconName: 'anchor-circle-check',\n  icon: [640, 512, [], \"e4aa\", \"M320 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zM288 0c-53 0-96 43-96 96 0 41.8 26.7 77.4 64 90.5l0 257.9c-62.9-14.3-110.2-69.7-111.9-136.5l16.1 14.1c10 8.7 25.1 7.7 33.9-2.3s7.7-25.1-2.3-33.9l-64-56c-9-7.9-22.6-7.9-31.6 0l-64 56c-10 8.7-11 23.9-2.3 33.9s23.9 11 33.9 2.3L80 307.9c2.1 113.1 94.4 204.1 208 204.1 16.6 0 32.7-1.9 48.2-5.6-20.3-30.5-32.2-67-32.2-106.4 0-27.3 5.7-53.3 16-76.9l0-136.6c37.3-13.2 64-48.7 64-90.5 0-53-43-96-96-96zM640 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-86.6-60.9c7.1 5.2 8.7 15.2 3.5 22.3l-64 88c-2.8 3.8-7 6.2-11.7 6.5s-9.3-1.3-12.6-4.6l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l26.8 26.8 53-72.9c5.2-7.1 15.2-8.7 22.4-3.5z\"]\n};\nvar faPersonWalkingWithCane = {\n  prefix: 'fas',\n  iconName: 'person-walking-with-cane',\n  icon: [576, 512, [\"blind\"], \"f29d\", \"M224-32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM160 205.3l-22.6 22.6c-6 6-9.4 14.1-9.4 22.6l0 37.5c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-37.5c0-25.5 10.1-49.9 28.1-67.9l34.4-34.4c23.2-23.2 54.6-36.2 87.3-36.2 36.1 0 70.3 15.8 93.8 43.1l68.6 80c11.5 13.4 9.9 33.6-3.5 45.1s-33.6 9.9-45.1-3.5l-55.7-65 0 118.6 34.5 29.6c17.7 15.2 29.3 36.2 32.6 59.3l12.6 88.1c2.5 17.5-9.7 33.7-27.2 36.2s-33.7-9.7-36.2-27.2l-12.6-88.1c-1.1-7.7-5-14.7-10.9-19.8l-71.4-61.2c-21.3-18.2-33.5-44.9-33.5-72.9l0-69.3zm.1 165.8c2.4 2.3 4.8 4.6 7.4 6.8l46 39.4-2.2 7.6c-4.5 15.7-12.9 30-24.4 41.5l-68.3 68.3c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l68.3-68.3c3.8-3.8 6.6-8.6 8.1-13.8L160.1 371zm233.5-62.2c10.6-8 25.6-5.8 33.6 4.8l144 192c8 10.6 5.8 25.6-4.8 33.6s-25.6 5.8-33.6-4.8l-144-192c-8-10.6-5.8-25.6 4.8-33.6z\"]\n};\nvar faBlind = faPersonWalkingWithCane;\nvar faFileWaveform = {\n  prefix: 'fas',\n  iconName: 'file-waveform',\n  icon: [384, 512, [\"file-medical-alt\"], \"f478\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64l0-96 60.3 0 48.8 62.7c5.1 6.6 13.3 10 21.6 9.1s15.5-6.1 19.1-13.6l42.9-91.2 9.9 19.8c4.1 8.1 12.4 13.3 21.5 13.3l72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-57.2 0-25.4-50.7c-4.1-8.2-12.6-13.4-21.8-13.3s-17.5 5.5-21.4 13.8l-47.3 100.6-32-41.1C86.4 307.4 79.4 304 72 304L0 304 0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5z\"]\n};\nvar faFileMedicalAlt = faFileWaveform;\nvar faHouseCrack = {\n  prefix: 'fas',\n  iconName: 'house-crack',\n  icon: [512, 512, [], \"e3b1\", \"M277.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S18.8 272 32 272l16 0 0 176c0 35.3 28.7 64 64 64l86.4 0-31.3-52.2c-4.1-6.8-2.6-15.5 3.5-20.5L256 368 195.8 285.2c-10.9-15 8.2-33.5 22.8-22l117.9 92.6c8 6.3 8.2 18.4 .4 24.9L256 448 294.4 512 400 512c35.3 0 64-28.7 64-64l0-176 16 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8-35.1l-224-208z\"]\n};\nvar faHatWizard = {\n  prefix: 'fas',\n  iconName: 'hat-wizard',\n  icon: [512, 512, [], \"f6e8\", \"M64 400l85.7-208.2c17-41.3 47.8-75.3 87.2-96.3L383.8 17.2c12.3-6.6 26.5 4.7 23 18.2L369.6 177.8c-1.1 4.1-1.6 8.3-1.6 12.6 0 6.3 1.2 12.6 3.6 18.5l76.4 191.1-207.1 0 11.8-35.4 40.4-13.5c6.5-2.2 10.9-8.3 10.9-15.2s-4.4-13-10.9-15.2l-40.4-13.5-13.5-40.4C237 260.4 230.9 256 224 256s-13 4.4-15.2 10.9l-13.5 40.4-40.4 13.5C148.4 323 144 329.1 144 336s4.4 13 10.9 15.2l40.4 13.5 11.8 35.4-143.1 0zM279.6 141.5c-1.1-3.3-4.1-5.5-7.6-5.5s-6.5 2.2-7.6 5.5l-6.7 20.2-20.2 6.7c-3.3 1.1-5.5 4.1-5.5 7.6s2.2 6.5 5.5 7.6l20.2 6.7 6.7 20.2c1.1 3.3 4.1 5.5 7.6 5.5s6.5-2.2 7.6-5.5l6.7-20.2 20.2-6.7c3.3-1.1 5.5-4.1 5.5-7.6s-2.2-6.5-5.5-7.6l-20.2-6.7-6.7-20.2zM32 448l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faUserDoctor = {\n  prefix: 'fas',\n  iconName: 'user-doctor',\n  icon: [448, 512, [\"user-md\"], \"f0f0\", \"M224 8a120 120 0 1 0 0 240 120 120 0 1 0 0-240zm60 312.8c-5.4-.5-11-.8-16.6-.8l-86.9 0c-5.6 0-11.1 .3-16.6 .8l0 67.5c16.5 7.6 28 24.3 28 43.6 0 26.5-21.5 48-48 48s-48-21.5-48-48c0-19.4 11.5-36.1 28-43.6l0-58.4C61 353 16 413.6 16 484.6 16 499.7 28.3 512 43.4 512l361.1 0c15.1 0 27.4-12.3 27.4-27.4 0-71-45-131.5-108-154.6l0 37.4c23.3 8.2 40 30.5 40 56.6l0 32c0 11-9 20-20 20s-20-9-20-20l0-32c0-11-9-20-20-20s-20 9-20 20l0 32c0 11-9 20-20 20s-20-9-20-20l0-32c0-26.1 16.7-48.3 40-56.6l0-46.6z\"]\n};\nvar faUserMd = faUserDoctor;\nvar faChartBar = {\n  prefix: 'fas',\n  iconName: 'chart-bar',\n  icon: [512, 512, [\"bar-chart\"], \"f080\", \"M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zm96 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 80l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 112l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faBarChart = faChartBar;\nvar faSprayCanSparkles = {\n  prefix: 'fas',\n  iconName: 'spray-can-sparkles',\n  icon: [576, 512, [\"air-freshener\"], \"f5d0\", \"M160 32l0 80 128 0 0-80c0-17.7-14.3-32-32-32L192 0c-17.7 0-32 14.3-32 32zm0 128c-53 0-96 43-96 96l0 208c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-208c0-53-43-96-96-96l-128 0zm64 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM448 48c0-1.4-1-3-2.2-3.6L416 32 403.6 2.2C403 1 401.4 0 400 0s-3 1-3.6 2.2L384 32 354.2 44.4c-1.2 .6-2.2 2.2-2.2 3.6 0 1.4 1 3 2.2 3.6L384 64 396.4 93.8C397 95 398.6 96 400 96s3-1 3.6-2.2L416 64 445.8 51.6C447 51 448 49.4 448 48zm76.4 45.8C525 95 526.6 96 528 96s3-1 3.6-2.2L544 64 573.8 51.6c1.2-.6 2.2-2.2 2.2-3.6 0-1.4-1-3-2.2-3.6L544 32 531.6 2.2C531 1 529.4 0 528 0s-3 1-3.6 2.2L512 32 482.2 44.4c-1.2 .6-2.2 2.2-2.2 3.6 0 1.4 1 3 2.2 3.6L512 64 524.4 93.8zm7.2 100.4c-.6-1.2-2.2-2.2-3.6-2.2s-3 1-3.6 2.2L512 224 482.2 236.4c-1.2 .6-2.2 2.2-2.2 3.6 0 1.4 1 3 2.2 3.6L512 256 524.4 285.8c.6 1.2 2.2 2.2 3.6 2.2s3-1 3.6-2.2L544 256 573.8 243.6c1.2-.6 2.2-2.2 2.2-3.6 0-1.4-1-3-2.2-3.6L544 224 531.6 194.2zM512 144c0-1.4-1-3-2.2-3.6L480 128 467.6 98.2C467 97 465.4 96 464 96s-3 1-3.6 2.2L448 128 418.2 140.4c-1.2 .6-2.2 2.2-2.2 3.6 0 1.4 1 3 2.2 3.6L448 160 460.4 189.8c.6 1.2 2.2 2.2 3.6 2.2s3-1 3.6-2.2L480 160 509.8 147.6c1.2-.6 2.2-2.2 2.2-3.6z\"]\n};\nvar faAirFreshener = faSprayCanSparkles;\nvar faBahtSign = {\n  prefix: 'fas',\n  iconName: 'baht-sign',\n  icon: [320, 512, [], \"e0ac\", \"M136 0c-13.3 0-24 10.7-24 24l0 40-74.4 0C16.8 64 0 80.8 0 101.6L0 406.3c0 23 18.7 41.7 41.7 41.7l70.3 0 0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40 48 0c61.9 0 112-50.1 112-112 0-40.1-21.1-75.3-52.7-95.1 13.1-18.3 20.7-40.7 20.7-64.9 0-61.9-50.1-112-112-112l-16 0 0-40c0-13.3-10.7-24-24-24zM112 128l0 96-48 0 0-96 48 0zm48 96l0-96 16 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-16 0zm-48 64l0 96-48 0 0-96 48 0zm48 96l0-96 48 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-48 0z\"]\n};\nvar faTemperatureArrowUp = {\n  prefix: 'fas',\n  iconName: 'temperature-arrow-up',\n  icon: [512, 512, [\"temperature-up\"], \"e040\", \"M64.5 96c0-53 43-96 96-96s96 43 96 96l0 164.7c29.5 26.4 48 64.7 48 107.3 0 79.5-64.5 144-144 144s-144-64.5-144-144c0-42.6 18.5-81 48-107.3L64.5 96zm96 336c35.3 0 64-28.7 64-64 0-26.9-16.5-49.9-40-59.3l0-212.7c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 212.7c-23.5 9.5-40 32.5-40 59.3 0 35.3 28.7 64 64 64zM439.1 9.4l64 64c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-9.4-9.4 0 178.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-178.7-9.4 9.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l64-64c6-6 14.1-9.4 22.6-9.4s16.6 3.4 22.6 9.4z\"]\n};\nvar faTemperatureUp = faTemperatureArrowUp;\nvar faWebAwesome = {\n  prefix: 'fas',\n  iconName: 'web-awesome',\n  icon: [640, 512, [], \"e682\", \"M372.2 52c0 20.9-12.4 39-30.2 47.2L448 192 552.4 171.1c-5.3-7.7-8.4-17.1-8.4-27.1 0-26.5 21.5-48 48-48s48 21.5 48 48c0 26-20.6 47.1-46.4 48L481 442.3c-10.3 23-33.2 37.7-58.4 37.7l-205.2 0c-25.2 0-48-14.8-58.4-37.7L46.4 192C20.6 191.1 0 170 0 144 0 117.5 21.5 96 48 96s48 21.5 48 48c0 10.1-3.1 19.4-8.4 27.1L192 192 298.1 99.1c-17.7-8.3-30-26.3-30-47.1 0-28.7 23.3-52 52-52s52 23.3 52 52z\"]\n};\nvar faNonBinary = {\n  prefix: 'fas',\n  iconName: 'non-binary',\n  icon: [384, 512, [], \"e807\", \"M192 544c-97.2 0-176-78.8-176-176 0-86.3 62.1-158 144-173l0-47.2-49.7 24.8-3 1.3c-15.2 5.7-32.5-.8-39.9-15.7-7.4-14.8-2.2-32.6 11.5-41.3l2.8-1.6 38.8-19.4-38.8-19.4c-15.8-7.9-22.2-27.1-14.3-42.9 7.4-14.8 24.8-21.4 40-15.6l3 1.3 49.7 24.8 0-44.2c0-17.7 14.3-32 32-32s32 14.3 32 32l0 44.2 49.7-24.8 3-1.3c15.2-5.8 32.5 .8 39.9 15.6s2.2 32.7-11.5 41.3l-2.8 1.6-38.7 19.4 38.7 19.3c15.8 7.9 22.2 27.1 14.3 42.9-7.4 14.8-24.7 21.4-39.9 15.6l-3-1.3-49.7-24.8 0 47.2c81.9 15.1 144 86.8 144 173 0 97.2-78.8 176-176 176zm0-64a112 112 0 1 0 0-224 112 112 0 1 0 0 224z\"]\n};\nvar faN = {\n  prefix: 'fas',\n  iconName: 'n',\n  icon: [384, 512, [110], \"4e\", \"M21.1 33.9c12.7-4.6 26.9-.7 35.5 9.6L320 359.6 320 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 384c0 13.5-8.4 25.5-21.1 30.1s-26.9 .7-35.5-9.6L64 152.4 64 448c0 17.7-14.3 32-32 32S0 465.7 0 448L0 64C0 50.5 8.4 38.5 21.1 33.9z\"]\n};\nvar faArrowsUpDownLeftRight = {\n  prefix: 'fas',\n  iconName: 'arrows-up-down-left-right',\n  icon: [512, 512, [\"arrows\"], \"f047\", \"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4 0 114.7-114.7 0 9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4 114.7 0 0 114.7-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4 0-114.7 114.7 0-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4-114.7 0 0-114.7 9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z\"]\n};\nvar faArrows = faArrowsUpDownLeftRight;\nvar faHouse = {\n  prefix: 'fas',\n  iconName: 'house',\n  icon: [512, 512, [127968, 63498, 63500, \"home\", \"home-alt\", \"home-lg-alt\"], \"f015\", \"M277.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S18.8 272 32 272l16 0 0 176c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-176 16 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8-35.1l-224-208zM240 320l32 0c26.5 0 48 21.5 48 48l0 96-128 0 0-96c0-26.5 21.5-48 48-48z\"]\n};\nvar faHome = faHouse;\nvar faHomeAlt = faHouse;\nvar faHomeLgAlt = faHouse;\nvar faSpinner = {\n  prefix: 'fas',\n  iconName: 'spinner',\n  icon: [512, 512, [], \"f110\", \"M208 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm0 416a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM48 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm368 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM75 369.1A48 48 0 1 1 142.9 437 48 48 0 1 1 75 369.1zM75 75A48 48 0 1 1 142.9 142.9 48 48 0 1 1 75 75zM437 369.1A48 48 0 1 1 369.1 437 48 48 0 1 1 437 369.1z\"]\n};\nvar faGavel = {\n  prefix: 'fas',\n  iconName: 'gavel',\n  icon: [576, 512, [\"legal\"], \"f0e3\", \"M169.6 153.4l-18.7-18.7c-12.5-12.5-12.5-32.8 0-45.3L265.6-25.4c12.5-12.5 32.8-12.5 45.3 0L329.6-6.6c12.5 12.5 12.5 32.8 0 45.3L214.9 153.4c-12.5 12.5-32.8 12.5-45.3 0zM276 211.7l-31.4-31.4 112-112 119.4 119.4-112 112-31.4-31.4-232 232c-15.6 15.6-40.9 15.6-56.6 0s-15.6-40.9 0-56.6l232-232zM390.9 374.6c-12.5-12.5-12.5-32.8 0-45.3L505.6 214.6c12.5-12.5 32.8-12.5 45.3 0l18.7 18.7c12.5 12.5 12.5 32.8 0 45.3L454.9 393.4c-12.5 12.5-32.8 12.5-45.3 0l-18.7-18.7z\"]\n};\nvar faLegal = faGavel;\nvar faTicketSimple = {\n  prefix: 'fas',\n  iconName: 'ticket-simple',\n  icon: [576, 512, [\"ticket-alt\"], \"f3ff\", \"M0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 64c0 8.8-7.4 15.7-15.7 18.6-18.8 6.5-32.3 24.4-32.3 45.4s13.5 38.9 32.3 45.4c8.3 2.9 15.7 9.8 15.7 18.6l0 64c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64l0-64C0 311.2 7.4 304.3 15.7 301.4 34.5 294.9 48 277 48 256s-13.5-38.9-32.3-45.4C7.4 207.7 0 200.8 0 192l0-64z\"]\n};\nvar faTicketAlt = faTicketSimple;\nvar faDove = {\n  prefix: 'fas',\n  iconName: 'dove',\n  icon: [512, 512, [128330], \"f4ba\", \"M496 64c13.2 0 20.7 15.1 12.8 25.6L480 128 480 304c0 79.5-64.5 144-144 144l-112 0-46.3 46.3c-10.4 10.4-26.5 12.4-39.1 4.8L41.5 440.9c-17-10.2-15-35.5 3.4-42.9L160 352C23.8 311.1 7.5 169.8 22 95.7 25.6 77.9 45.3 71.4 61.3 80.2L320 224 320 144c0-44.2 35.8-80 80-80l96 0zm-96 56a24 24 0 1 0 0 48 24 24 0 1 0 0-48zM182.5-9.6c12.4-13.7 33.3-8.9 42.5 7.1l56.4 98.3c-5.8 14.4-9.2 30.1-9.4 46.5L138.1 68c10.1-31.6 27-58.4 44.4-77.6z\"]\n};\nvar faTarpDroplet = {\n  prefix: 'fas',\n  iconName: 'tarp-droplet',\n  icon: [512, 512, [], \"e57c\", \"M256 160c35.3 0 64-26.9 64-60 0-24-33.7-70.1-52.2-93.5-6.1-7.7-17.5-7.7-23.6 0-18.5 23.4-52.2 69.5-52.2 93.5 0 33.1 28.7 60 64 60zM368 96c0 61.9-50.1 112-112 112S144 157.9 144 96c0-11.1 1.6-21.9 4.6-32L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l277.5 0c17 0 33.3-6.7 45.3-18.7L493.3 322.7c12-12 18.7-28.3 18.7-45.3L512 128c0-35.3-28.7-64-64-64l-84.6 0c3 10.1 4.6 20.9 4.6 32zm85.5 176L336 389.5 336 296c0-13.3 10.7-24 24-24l93.5 0zM96 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faTreeCity = {\n  prefix: 'fas',\n  iconName: 'tree-city',\n  icon: [640, 512, [], \"e587\", \"M288 48c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 48 48 0 0-72c0-13.3 10.7-24 24-24s24 10.7 24 24l0 72 16 0c26.5 0 48 21.5 48 48l0 320c0 26.5-21.5 48-48 48l-256 0c-26.5 0-48-21.5-48-48l0-416zm64 64l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM352 304l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM528 192c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM512 304l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM96 480l0-160-16 0c-44.2 0-80-35.8-80-80 0-26.7 13.1-50.3 33.2-64.9-.8-4.9-1.2-10-1.2-15.1 0-53 43-96 96-96s96 43 96 96l0 96c0 35.3-28.7 64-64 64l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32z\"]\n};\nvar faTurnUp = {\n  prefix: 'fas',\n  iconName: 'turn-up',\n  icon: [384, 512, [10548, \"level-up-alt\"], \"f3bf\", \"M169.4 9.4c12.5-12.5 32.8-12.5 45.3 0l128 128c9.2 9.2 11.9 22.9 6.9 34.9S332.9 192 320 192l-64 0 0 160c0 88.4-71.6 160-160 160l-64 0c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l64 0c17.7 0 32-14.3 32-32l0-160-64 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l128-128z\"]\n};\nvar faLevelUpAlt = faTurnUp;\nvar faTemperatureQuarter = {\n  prefix: 'fas',\n  iconName: 'temperature-quarter',\n  icon: [320, 512, [\"temperature-1\", \"thermometer-1\", \"thermometer-quarter\"], \"f2ca\", \"M160 0C107 0 64 43 64 96l0 164.7C34.5 287 16 325.4 16 368 16 447.5 80.5 512 160 512s144-64.5 144-144c0-42.6-18.5-81-48-107.3L256 96c0-53-43-96-96-96zm64 368c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-26.9 16.5-49.9 40-59.3l0-28.7c0-13.3 10.7-24 24-24s24 10.7 24 24l0 28.7c23.5 9.5 40 32.5 40 59.3z\"]\n};\nvar faTemperature1 = faTemperatureQuarter;\nvar faThermometer1 = faTemperatureQuarter;\nvar faThermometerQuarter = faTemperatureQuarter;\nvar faSliders = {\n  prefix: 'fas',\n  iconName: 'sliders',\n  icon: [512, 512, [\"sliders-h\"], \"f1de\", \"M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 224zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384z\"]\n};\nvar faSlidersH = faSliders;\nvar faMosque = {\n  prefix: 'fas',\n  iconName: 'mosque',\n  icon: [576, 512, [128332], \"f678\", \"M174.8 224l226.4 0c43.5 0 78.8-35.3 78.8-78.8 0-25.5-12.3-49.4-33.1-64.2L297.3-25.4c-5.6-3.9-13-3.9-18.5 0L129.1 81C108.3 95.8 96 119.7 96 145.2 96 188.7 131.3 224 174.8 224zM512 512c35.3 0 64-28.7 64-64l0-224c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48-448 0 0-48c0-17.7-14.3-32-32-32S0 206.3 0 224L0 448c0 35.3 28.7 64 64 64l448 0zM240 384c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80-96 0 0-80z\"]\n};\nvar faH = {\n  prefix: 'fas',\n  iconName: 'h',\n  icon: [384, 512, [104], \"48\", \"M320 288l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-256 0 0-160c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 256 0z\"]\n};\nvar faInfo = {\n  prefix: 'fas',\n  iconName: 'info',\n  icon: [192, 512, [], \"f129\", \"M48 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM0 192c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 256 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-224-32 0c-17.7 0-32-14.3-32-32z\"]\n};\nvar faPersonWalking = {\n  prefix: 'fas',\n  iconName: 'person-walking',\n  icon: [384, 512, [128694, \"walking\"], \"f554\", \"M192 80a56 56 0 1 0 0-112 56 56 0 1 0 0 112zM105.4 227.9l22.6-22.6 0 69.3c0 28 12.2 54.7 33.5 72.9l71.4 61.2c5.9 5.1 9.8 12.1 10.9 19.8l12.6 88.1c2.5 17.5 18.7 29.7 36.2 27.2s29.7-18.7 27.2-36.2l-12.6-88.1c-3.3-23.1-14.9-44.1-32.6-59.3l-34.5-29.6 0-115.2 3.8 4.7c18.2 22.8 45.8 36 75 36l33.2 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-33.2 0c-9.7 0-18.9-4.4-25-12l-17.9-22.4c-23-28.8-57.9-45.6-94.8-45.6-32.2 0-63.1 12.8-85.8 35.6L60.1 182.6C42.1 200.6 32 225 32 250.5L32 288c0 17.7 14.3 32 32 32s32-14.3 32-32l0-37.5c0-8.5 3.4-16.6 9.4-22.6zm12.4 179.4c-1.5 5.2-4.3 10-8.1 13.8L41.4 489.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.3-68.3c11.5-11.5 19.9-25.8 24.4-41.5l2.2-7.6-46-39.4c-2.5-2.2-5-4.4-7.4-6.8l-10.4 36.2z\"]\n};\nvar faWalking = faPersonWalking;\nvar faArrowTurnDown = {\n  prefix: 'fas',\n  iconName: 'arrow-turn-down',\n  icon: [384, 512, [\"level-down\"], \"f149\", \"M32 64C14.3 64 0 49.7 0 32S14.3 0 32 0l96 0c53 0 96 43 96 96l0 306.7 73.4-73.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 402.7 160 96c0-17.7-14.3-32-32-32L32 64z\"]\n};\nvar faLevelDown = faArrowTurnDown;\nvar faRoad = {\n  prefix: 'fas',\n  iconName: 'road',\n  icon: [512, 512, [128739], \"f018\", \"M223.9 32l-76.2 0c-29.4 0-55.1 20.1-62.1 48.6L1.4 420.5C-6.1 450.7 16.8 480 48 480l175.9 0 0-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64 176.1 0c31.2 0 54.1-29.3 46.6-59.5L426.5 80.6C419.4 52.1 393.8 32 364.3 32l-76.4 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm64 192l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32z\"]\n};\nvar faSpiral = {\n  prefix: 'fas',\n  iconName: 'spiral',\n  icon: [512, 512, [], \"e80a\", \"M115.5 7.4c13.6-11.3 33.8-9.5 45.1 4.1s9.5 33.8-4.1 45.1C100.2 103.5 64 175.2 64 256 64 362 150 448 256 448s192-86 192-192c0-75.1-60.9-136-136-136S176 180.9 176 256c0 44.2 35.8 80 80 80s80-35.8 80-80c0-13.3-10.7-24-24-24s-24 10.7-24 24c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-48.6 39.4-88 88-88s88 39.4 88 88c0 79.5-64.5 144-144 144S112 335.5 112 256c0-110.5 89.5-200 200-200s200 89.5 200 200c0 141.4-114.6 256-256 256S0 397.4 0 256C0 155.8 45 66.1 115.5 7.4z\"]\n};\nvar faFaceFrown = {\n  prefix: 'fas',\n  iconName: 'face-frown',\n  icon: [512, 512, [9785, \"frown\"], \"f119\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm90.6-113.9c-20.4-28-53.4-46.1-90.6-46.1s-70.2 18.1-90.6 46.1c-7.8 10.7-22.8 13.1-33.5 5.3s-13.1-22.8-5.3-33.5C155.7 330 202.8 304 256 304s100.3 26 129.4 65.9c7.8 10.7 5.4 25.7-5.3 33.5s-25.7 5.4-33.5-5.3zM144 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faFrown = faFaceFrown;\nvar faWineGlassEmpty = {\n  prefix: 'fas',\n  iconName: 'wine-glass-empty',\n  icon: [320, 512, [\"wine-glass-alt\"], \"f5ce\", \"M64 0C48.7 0 35.6 10.8 32.6 25.7L3.2 173C1.1 183.5 0 194.2 0 205l0 3c0 77.4 55 142 128 156.8l0 115.2-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-115.2C265 350 320 285.4 320 208l0-3c0-10.7-1.1-21.4-3.2-32L287.4 25.7C284.4 10.8 271.3 0 256 0L64 0zm1.9 185.6L90.2 64 229.8 64 254.1 185.6c1.3 6.4 1.9 12.9 1.9 19.4l0 3c0 53-43 96-96 96s-96-43-96-96l0-3c0-6.5 .6-13 1.9-19.4z\"]\n};\nvar faWineGlassAlt = faWineGlassEmpty;\nvar faClapperboard = {\n  prefix: 'fas',\n  iconName: 'clapperboard',\n  icon: [512, 512, [], \"e131\", \"M448 64c2 0 3.9 .1 5.8 .3l-95.7 95.7 67.9 0 72-72c8.8 11 14 24.9 14 40l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l70.1 0-96 96 67.9 0 95-95 1-1 92.1 0-96 96 67.9 0 95-95 1-1 86.1 0z\"]\n};\nvar faForwardStep = {\n  prefix: 'fas',\n  iconName: 'forward-step',\n  icon: [384, 512, [\"step-forward\"], \"f051\", \"M21 36.8c12.9-7 28.7-6.3 41 1.8L320 208.1 320 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 384c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-144.1-258 169.6c-12.3 8.1-28 8.8-41 1.8S0 454.7 0 440L0 72C0 57.3 8.1 43.8 21 36.8z\"]\n};\nvar faStepForward = faForwardStep;\nvar faSquareUpRight = {\n  prefix: 'fas',\n  iconName: 'square-up-right',\n  icon: [448, 512, [8599, \"external-link-square-alt\"], \"f360\", \"M384 32c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0zM168 160c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l35 35-67 67c-9.4 9.4-9.4 24.6 0 33.9l24 24c9.4 9.4 24.6 9.4 33.9 0l67-67 35 35c6.9 6.9 17.2 8.9 26.2 5.2S320 321.7 320 312l0-128c0-13.3-10.7-24-24-24l-128 0z\"]\n};\nvar faExternalLinkSquareAlt = faSquareUpRight;\nvar faBookJournalWhills = {\n  prefix: 'fas',\n  iconName: 'book-journal-whills',\n  icon: [448, 512, [\"journal-whills\"], \"f66a\", \"M96 512l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-66.7c18.6-6.6 32-24.4 32-45.3l0-288c0-26.5-21.5-48-48-48L96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96zM64 416c0-17.7 14.3-32 32-32l256 0 0 64-256 0c-17.7 0-32-14.3-32-32zM274.1 99.2c2.6-2.6 6.7-3.1 9.9-1.1 32.1 20 53.4 55.6 53.4 96.2 0 62.6-50.7 113.3-113.3 113.3S110.7 256.9 110.7 194.3c0-40.6 21.4-76.2 53.4-96.2 3.1-2 7.2-1.5 9.9 1.1s3.1 6.7 1.2 9.8c-5.2 8.6-8.2 18.7-8.2 29.5 0 15.1 5.9 28.8 15.5 39.1 2.5 2.7 2.9 6.7 .9 9.7-4.7 7.4-7.4 16.1-7.4 25.5 0 21.6 14.3 39.9 34 45.9l1-24.8c-7.1-4.4-11.8-12.2-11.8-21.1 0-9.6 5.5-18 13.5-22.1l3.3-81.8c.2-4.3 3.7-7.7 8-7.7s7.8 3.4 8 7.7l3.3 81.8c8 4.1 13.5 12.4 13.5 22.1 0 8.9-4.7 16.7-11.8 21.1l1 24.8c19.6-6 33.9-24.1 34-45.6l0-.6c-.1-9.3-2.7-17.9-7.4-25.2-1.9-3.1-1.6-7.1 .9-9.7 9.6-10.2 15.5-23.9 15.5-39.1 0-10.8-3-20.9-8.2-29.5-1.9-3.2-1.4-7.2 1.2-9.8z\"]\n};\nvar faJournalWhills = faBookJournalWhills;\nvar faChampagneGlasses = {\n  prefix: 'fas',\n  iconName: 'champagne-glasses',\n  icon: [640, 512, [129346, \"glass-cheers\"], \"f79f\", \"M155.6 17.3C163 3 179.9-3.6 195 1.9l125 45.6 125-45.6c15.1-5.5 32 1.1 39.4 15.4l78.8 152.9c28.8 55.8 10.3 122.3-38.5 156.6l31.3 86.2 41-15c16.6-6 35 2.5 41 19.1s-2.5 35-19.1 41c-47.4 17.3-94.8 34.5-142.2 51.8-16.6 6.1-35-2.5-41-19.1s2.5-35 19.1-41l41-15-31.3-86.2c-59.4 5.2-116.2-33.9-130-95.2l-14.6-64.7-14.6 64.7c-13.8 61.3-70.6 100.4-130 95.2l-31.3 86.2 41 15c16.6 6.1 25.2 24.4 19.1 41s-24.4 25.2-41 19.1c-47.4-17.3-94.8-34.6-142.2-51.8-16.6-6.1-25.2-24.4-19.1-41S26.3 392 42.9 398l41 15 31.3-86.2C66.5 292.5 48.1 226 76.9 170.2L155.6 17.3zm44 54.4l-27.2 52.8 89.2 32.5 13.1-57.9-75.1-27.4zm240.9 0l-75.1 27.4 13.1 57.9 89.2-32.5-27.2-52.8z\"]\n};\nvar faGlassCheers = faChampagneGlasses;\nvar faDumpster = {\n  prefix: 'fas',\n  iconName: 'dumpster',\n  icon: [576, 512, [], \"f793\", \"M132.3 64L106.7 192 24 192c-13.3 0-24-10.7-24-24l0-4.1c0-2.6 .4-5.1 1.2-7.6L26.5 80.4C29.8 70.6 39 64 49.3 64l83 0zm23.4 128l25.6-128 82.7 0 0 128-108.3 0zM312 64l82.7 0 25.6 128-108.3 0 0-128zm131.7 0l83 0c10.3 0 19.5 6.6 22.8 16.4l25.3 75.9c.8 2.4 1.2 5 1.2 7.6l0 4.1c0 13.3-10.7 24-24 24l-82.7 0-25.6-128zM25.7 240l524.7 0c-.4 2.1-13.3 73.4-38.9 213.7-3 16.3-17.9 27.6-34.4 26.1S448 464.6 448 448l0-16-320 0 0 16c0 16.6-12.6 30.4-29.1 31.9S67.5 470 64.5 453.7C39 313.3 26 242.1 25.7 240z\"]\n};\nvar faHeartCircleXmark = {\n  prefix: 'fas',\n  iconName: 'heart-circle-xmark',\n  icon: [576, 512, [], \"e501\", \"M241 87.1l15 20.7 15-20.7C296 52.5 336.2 32 378.9 32 452.4 32 512 91.6 512 165.1l0 2.6c0 17.6-3.4 35.6-9.5 53.7-21.8-8.6-45.6-13.4-70.5-13.4-106 0-192 86-192 192 0 28.5 6.2 55.6 17.4 80-.5 0-.9 0-1.4 0-15.5 0-30.8-4.6-43.1-14.1-73-55.7-212.9-186-212.9-298.2l0-2.6C0 91.6 59.6 32 133.1 32 175.8 32 216 52.5 241 87.1zM432 256a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-36.7 36.7-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l36.7 36.7-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l36.7-36.7 36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-36.7-36.7 36.7-36.7z\"]\n};\nvar faComputer = {\n  prefix: 'fas',\n  iconName: 'computer',\n  icon: [576, 512, [], \"e4e5\", \"M348.8 32C340.7 46.1 336 62.5 336 80l0 16-272 0 0 224 272 0 0 64-272 0c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l284.8 0zM336 432c0 17.5 4.7 33.9 12.8 48L120 480c-13.3 0-24-10.7-24-24s10.7-24 24-24l216 0zM432 32l96 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-352c0-26.5 21.5-48 48-48zm24 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0zm56 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\"]\n};\nvar faWandMagic = {\n  prefix: 'fas',\n  iconName: 'wand-magic',\n  icon: [512, 512, [\"magic\"], \"f0d0\", \"M398.5 12.2l-88.2 88.2 101.3 101.3 88.2-88.2C507.6 105.6 512 95 512 84s-4.4-21.6-12.2-29.5L457.5 12.2C449.6 4.4 439 0 428 0s-21.6 4.4-29.5 12.2zM276.4 134.3L12.2 398.5C4.4 406.4 0 417 0 428s4.4 21.6 12.2 29.5l42.3 42.3C62.4 507.6 73 512 84 512s21.6-4.4 29.5-12.2L377.7 235.6 276.4 134.3z\"]\n};\nvar faMagic = faWandMagic;\nvar faBrain = {\n  prefix: 'fas',\n  iconName: 'brain',\n  icon: [512, 512, [129504], \"f5dc\", \"M120 56c0-30.9 25.1-56 56-56l24 0c17.7 0 32 14.3 32 32l0 448c0 17.7-14.3 32-32 32l-32 0c-29.8 0-54.9-20.4-62-48-.7 0-1.3 0-2 0-44.2 0-80-35.8-80-80 0-18 6-34.6 16-48-19.4-14.6-32-37.8-32-64 0-30.9 17.6-57.8 43.2-71.1-7.1-12-11.2-26-11.2-40.9 0-44.2 35.8-80 80-80l0-24zm272 0l0 24c44.2 0 80 35.8 80 80 0 15-4.1 29-11.2 40.9 25.7 13.3 43.2 40.1 43.2 71.1 0 26.2-12.6 49.4-32 64 10 13.4 16 30 16 48 0 44.2-35.8 80-80 80-.7 0-1.3 0-2 0-7.1 27.6-32.2 48-62 48l-32 0c-17.7 0-32-14.3-32-32l0-448c0-17.7 14.3-32 32-32l24 0c30.9 0 56 25.1 56 56z\"]\n};\nvar faBriefcaseMedical = {\n  prefix: 'fas',\n  iconName: 'briefcase-medical',\n  icon: [512, 512, [], \"f469\", \"M200 48l112 0c4.4 0 8 3.6 8 8l0 40-128 0 0-40c0-4.4 3.6-8 8-8zm-56 8l0 40-80 0C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-80 0 0-40c0-30.9-25.1-56-56-56L200 0c-30.9 0-56 25.1-56 56zm80 160c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 40 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-40 0 0 40c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40z\"]\n};\nvar faHouseMedicalCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'house-medical-circle-exclamation',\n  icon: [640, 512, [], \"e512\", \"M309.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S50.8 272 64 272l16 0 0 176c0 35.3 28.7 64 64 64l196 0c-21.2-29.5-34.3-65.3-35.9-104L272 408c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 20 0c34.9-48.5 91.7-80 156-80 10.7 0 21.1 .9 31.3 2.5L309.8 8.6zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-140c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z\"]\n};\nvar faCodeCommit = {\n  prefix: 'fas',\n  iconName: 'code-commit',\n  icon: [576, 512, [], \"f386\", \"M288 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160zm156.8-48C430 361 365.4 416 288 416S146 361 131.2 288L32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l99.2 0C146 151 210.6 96 288 96s142 55 156.8 128l99.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-99.2 0z\"]\n};\nvar faPersonBreastfeeding = {\n  prefix: 'fas',\n  iconName: 'person-breastfeeding',\n  icon: [448, 512, [], \"e53a\", \"M224 0a80 80 0 1 1 0 160 80 80 0 1 1 0-160zM436.8 382.8L373.5 462c-16.6 20.7-46.8 24.1-67.5 7.5-17.6-14.1-22.7-38.1-13.5-57.7l-.7-.1c-38.9-5.6-74.3-25.1-99.7-54.8l0-36.8c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48c0 .8 0 1.6 .1 2.4l101.4 50.7c23.7 11.9 33.3 40.7 21.5 64.4s-40.7 33.3-64.4 21.5L27.2 427.3c-1.1-.5-2.2-1.1-3.3-1.7-4.9-2.8-9.2-6.4-12.6-10.6-4.6-5.4-7.8-11.7-9.6-18.4-3.3-12-1.9-25.2 4.8-36.6 .6-1.1 1.3-2.2 2-3.2L75.6 256.1c26.7-40.1 71.7-64.1 119.8-64.1l75.2 0c46.5 0 90.1 22.5 117.2 60.3l50.7 70.9c2.2 3 4 6.1 5.5 9.4 2.9 6.7 4.3 13.8 4 20.8-.3 10.6-4.2 21-11.2 29.4zM320 332a44 44 0 1 0 -88 0 44 44 0 1 0 88 0z\"]\n};\nvar faPersonRays = {\n  prefix: 'fas',\n  iconName: 'person-rays',\n  icon: [512, 512, [], \"e54d\", \"M312.5 24a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zm24 212.7l46.3 62.4c10.5 14.2 30.6 17.2 44.8 6.6s17.2-30.6 6.6-44.8l-70.5-95C338.5 132 298.8 112 256.5 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6l46.3-62.4 0 275.3c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-275.3zM7.5 7c-9.4 9.4-9.4 24.6 0 33.9l80 80c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L41.5 7C32.1-2.3 16.9-2.3 7.5 7zm464 0l-80 80c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0zM7.5 505c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-80 80c-9.4 9.4-9.4 24.6 0 33.9zm464 0c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l80 80z\"]\n};\nvar faManatSign = {\n  prefix: 'fas',\n  iconName: 'manat-sign',\n  icon: [384, 512, [], \"e1d5\", \"M192 32c-13.3 0-24 10.7-24 24l0 41.5C73.3 109.3 0 190.1 0 288L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-62.5 44.8-114.5 104-125.8L168 456c0 13.3 10.7 24 24 24s24-10.7 24-24l0-293.8c59.2 11.2 104 63.3 104 125.8l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-97.9-73.3-178.7-168-190.5L216 56c0-13.3-10.7-24-24-24z\"]\n};\nvar faSort = {\n  prefix: 'fas',\n  iconName: 'sort',\n  icon: [384, 512, [\"unsorted\"], \"f0dc\", \"M2.4 204.2c5 12 16.6 19.8 29.6 19.8l320 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-160-160c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-9.2 9.2-11.9 22.9-6.9 34.9zm0 103.5c-5 12-2.2 25.7 6.9 34.9l160 160c12.5 12.5 32.8 12.5 45.3 0l160-160c9.2-9.2 11.9-22.9 6.9-34.9S364.9 288 352 288L32 288c-12.9 0-24.6 7.8-29.6 19.8z\"]\n};\nvar faUnsorted = faSort;\nvar faCircleRadiation = {\n  prefix: 'fas',\n  iconName: 'circle-radiation',\n  icon: [512, 512, [9762, \"radiation-alt\"], \"f7ba\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm80 0l64.3 0c8.7 0 15.7-7.1 17.3-15.6 4.4-24.4 18.1-45.5 37.2-59.7 7.4-5.5 10.6-15.6 6-23.6l-32.5-56.3c-4.3-7.5-13.9-10.3-21.2-5.5-48.2 31.5-81.3 84.2-86.3 144.8-.7 8.8 6.5 16 15.3 16zm137.9 89.8c-8.5-3.7-18.8-1.4-23.5 6.6l-31 53.8c-4.3 7.5-1.9 17.2 5.8 21.1 26.1 13.2 55.5 20.7 86.8 20.7s60.7-7.5 86.8-20.7c7.7-3.9 10.1-13.6 5.8-21.1l-31-53.8c-4.6-8-15-10.3-23.5-6.6-11.7 5-24.5 7.8-38.1 7.8s-26.4-2.8-38.1-7.8zM350.4 240.4c1.6 8.6 8.5 15.6 17.3 15.6l64.3 0c8.8 0 16.1-7.2 15.3-16-5-60.6-38.1-113.2-86.3-144.8-7.3-4.8-16.8-2-21.2 5.5L307.3 157c-4.6 8-1.4 18.1 6 23.6 19.1 14.2 32.7 35.4 37.2 59.7zM256 305.7a48 48 0 1 0 0-96 48 48 0 1 0 0 96z\"]\n};\nvar faRadiationAlt = faCircleRadiation;\nvar faLaptopCode = {\n  prefix: 'fas',\n  iconName: 'laptop-code',\n  icon: [640, 512, [], \"f5fc\", \"M64 96c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 240-64 0 0-240-384 0 0 240-64 0 0-240zM0 403.2C0 392.6 8.6 384 19.2 384l601.6 0c10.6 0 19.2 8.6 19.2 19.2 0 42.4-34.4 76.8-76.8 76.8L76.8 480C34.4 480 0 445.6 0 403.2zM281 209l-31 31 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-48-48c-9.4-9.4-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM393 175l48 48c9.4 9.4 9.4 24.6 0 33.9l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z\"]\n};\nvar faSink = {\n  prefix: 'fas',\n  iconName: 'sink',\n  icon: [512, 512, [], \"e06d\", \"M288 96c0-17.7 14.3-32 32-32s32 14.3 32 32 14.3 32 32 32 32-14.3 32-32c0-53-43-96-96-96s-96 43-96 96l0 192-64 0 0-40c0-30.9-25.1-56-56-56l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c4.4 0 8 3.6 8 8l0 40-80 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l0 64c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-64c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 0-40c0-4.4 3.6-8 8-8l56 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0c-30.9 0-56 25.1-56 56l0 40-64 0 0-192z\"]\n};\nvar faArrowUpFromWaterPump = {\n  prefix: 'fas',\n  iconName: 'arrow-up-from-water-pump',\n  icon: [640, 512, [], \"e4b6\", \"M144 32c-26.5 0-48 21.5-48 48l0 176-16 0c-26.5 0-48 21.5-48 48l0 79.6c17.6-2 36 2.5 51.3 14 3.4 2.6 6.1 1.4 9.8-.3l.8-.4c5.7-2.6 12.9-6.9 21.7-13.5 27.5-20.7 59.9-31.2 92.3-31.4 33.1-.2 66.3 10.2 94.4 31.4 22.1 16.6 29.1 16.6 51.2 0 27.5-20.7 59.9-31.2 92.4-31.4 33.1-.2 66.3 10.2 94.4 31.4 6.9 5.2 12.8 9 18 11.7 .6 .3 1.2 .6 1.8 1 4.2 2.3 8.5 4.6 12.6 1.5 10.7-8.1 22.9-12.7 35.3-14.1l0-79.5c0-26.5-21.5-48-48-48l-56 0 0-142.1 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L497 39c-9.4-9.4-24.6-9.4-33.9 0l-88 88c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 0 142.1-136 0 0-176c0-26.5-21.5-48-48-48L144 32zM474.6 476.1c19 14.4 41.9 28.2 67.2 33.3 26.5 5.4 54.3 .8 80.7-19.1 10.6-8 12.7-23 4.7-33.6s-23-12.7-33.6-4.7c-14.9 11.2-28.6 13.1-42.3 10.3-14.9-3-30.9-11.9-47.8-24.6-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-21.6 16.3-41.3 25.8-58.9 25.7-9.6-.1-19.9-3-31.2-11.5-10.6-8-25.6-5.9-33.6 4.7S7 482.3 17.6 490.3c19.1 14.4 39.4 21 59.8 21.1 33.9 .2 64.3-17.4 88.1-35.3 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9c21.3-16.1 49.9-16.1 71.2 0z\"]\n};\nvar faMicrophoneLinesSlash = {\n  prefix: 'fas',\n  iconName: 'microphone-lines-slash',\n  icon: [576, 512, [\"microphone-alt-slash\"], \"f539\", \"M7-24.9c9.4-9.4 24.6-9.4 33.9 0l151 151 0-30.2c0-53 43-96 96-96 50.3 0 91.6 38.7 95.7 88L328 88c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0 0 48-56 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l55.7 0c-1.9 22.9-11.8 43.4-26.9 59l33.9 33.9c25.5-26 41.3-61.6 41.3-100.9l0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40c0 52.6-21.1 100.2-55.3 134.8L569 503.1c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 9.1C-2.3-.3-2.3-15.5 7-24.9zM297.8 367.7l41.4 41.4c-8.8 2.4-17.9 4.3-27.3 5.4l0 49.5 48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0 0-49.5C169.3 402.7 96 321.9 96 224l0-40c0-5.1 1.6-9.9 4.4-13.8l43.6 43.6 0 10.2c0 79.5 64.5 144 144 144 3.3 0 6.6-.1 9.8-.3z\"]\n};\nvar faMicrophoneAltSlash = faMicrophoneLinesSlash;\nvar faServer = {\n  prefix: 'fas',\n  iconName: 'server',\n  icon: [448, 512, [], \"f233\", \"M64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 32zm216 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm56 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 288zm216 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm56 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faUser = {\n  prefix: 'fas',\n  iconName: 'user',\n  icon: [448, 512, [128100, 62144, 62470, \"user-alt\", \"user-large\"], \"f007\", \"M224 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56C95.8 304 16 383.8 16 482.3 16 498.7 29.3 512 45.7 512l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-98.5-79.8-178.3-178.3-178.3l-59.4 0z\"]\n};\nvar faUserAlt = faUser;\nvar faUserLarge = faUser;\nvar faSnowflake = {\n  prefix: 'fas',\n  iconName: 'snowflake',\n  icon: [512, 512, [10052, 10054], \"f2dc\", \"M288.2 0c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 62.1-15-15c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l49 49 0 70.6-61.2-35.3-17.9-66.9c-3.4-12.8-16.6-20.4-29.4-17S95.3 98 98.7 110.8l5.5 20.5-53.7-31C35.2 91.5 15.6 96.7 6.8 112s-3.6 34.9 11.7 43.7l53.7 31-20.5 5.5c-12.8 3.4-20.4 16.6-17 29.4s16.6 20.4 29.4 17l66.9-17.9 61.2 35.3-61.2 35.3-66.9-17.9c-12.8-3.4-26 4.2-29.4 17s4.2 26 17 29.4l20.5 5.5-53.7 31C3.2 365.1-2 384.7 6.8 400s28.4 20.6 43.7 11.7l53.7-31-5.5 20.5c-3.4 12.8 4.2 26 17 29.4s26-4.2 29.4-17l17.9-66.9 61.2-35.3 0 70.6-49 49c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l15-15 0 62.1c0 17.7 14.3 32 32 32s32-14.3 32-32l0-62.1 15 15c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-49-49 0-70.6 61.2 35.3 17.9 66.9c3.4 12.8 16.6 20.4 29.4 17s20.4-16.6 17-29.4l-5.5-20.5 53.7 31c15.3 8.8 34.9 3.6 43.7-11.7s3.6-34.9-11.7-43.7l-53.7-31 20.5-5.5c12.8-3.4 20.4-16.6 17-29.4s-16.6-20.4-29.4-17l-66.9 17.9-61.2-35.3 61.2-35.3 66.9 17.9c12.8 3.4 26-4.2 29.4-17s-4.2-26-17-29.4l-20.5-5.5 53.7-31c15.3-8.8 20.6-28.4 11.7-43.7s-28.4-20.5-43.7-11.7l-53.7 31 5.5-20.5c3.4-12.8-4.2-26-17-29.4s-26 4.2-29.4 17l-17.9 66.9-61.2 35.3 0-70.6 49-49c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-15 15 0-62.1z\"]\n};\nvar faTaurus = {\n  prefix: 'fas',\n  iconName: 'taurus',\n  icon: [384, 512, [], \"e84f\", \"M336-16c17.7 0 32 14.3 32 32 0 58.5-28.6 110.3-72.5 142.3 53.2 34.1 88.5 93.8 88.5 161.7 0 106-86 192-192 192S0 426 0 320C0 252.1 35.3 192.4 88.5 158.3 44.6 126.3 16 74.5 16 16 16-1.7 30.3-16 48-16S80-1.7 80 16c0 61.9 50.1 112 112 112S304 77.9 304 16c0-17.7 14.3-32 32-32zM192 192a128 128 0 1 0 0 256 128 128 0 1 0 0-256z\"]\n};\nvar faSkullCrossbones = {\n  prefix: 'fas',\n  iconName: 'skull-crossbones',\n  icon: [448, 512, [128369, 9760], \"f714\", \"M384 144C384 64.5 312.4 0 224 0S64 64.5 64 144c0 47.1 25.1 88.9 64 115.2l0 28.8c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-28.8c38.9-26.3 64-68.1 64-115.2zM160 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM445.5 339.7c-6.8-16.3-25.5-24-41.8-17.2L224 397.3 44.3 322.5c-16.3-6.8-35 .9-41.8 17.2s.9 35 17.2 41.8L140.8 432 19.7 482.5C3.4 489.3-4.3 508 2.5 524.3s25.5 24 41.8 17.2L224 466.7 403.7 541.5c16.3 6.8 35-.9 41.8-17.2s-.9-35-17.2-41.8L307.2 432 428.3 381.5c16.3-6.8 24-25.5 17.2-41.8z\"]\n};\nvar faPesoSign = {\n  prefix: 'fas',\n  iconName: 'peso-sign',\n  icon: [448, 512, [], \"e222\", \"M112 32C94.3 32 80 46.3 80 64l0 64-24 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 32-24 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 96 0c65.6 0 122-39.5 146.7-96l37.3 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-24.8 0c.5-5.3 .8-10.6 .8-16s-.3-10.7-.8-16l24.8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-37.3 0C362 71.5 305.6 32 240 32L112 32zm199.6 96l-167.6 0 0-32 96 0c28.4 0 54 12.4 71.6 32zM144 176l190.7 0c.9 5.2 1.3 10.5 1.3 16s-.5 10.8-1.3 16l-190.7 0 0-32zm167.6 80c-17.6 19.6-43.1 32-71.6 32l-96 0 0-32 167.6 0z\"]\n};\nvar faWineGlass = {\n  prefix: 'fas',\n  iconName: 'wine-glass',\n  icon: [320, 512, [127863], \"f4e3\", \"M32.6 25.7C35.6 10.8 48.7 0 64 0L256 0c15.3 0 28.4 10.8 31.4 25.7L316.8 173c2.1 10.5 3.2 21.2 3.2 32l0 3c0 77.4-55 142-128 156.8l0 115.2 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 544c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0 0-115.2C55 350 0 285.4 0 208l0-3c0-10.7 1.1-21.4 3.2-32L32.6 25.7zM77.4 128l165.1 0-12.8-64-139.5 0-12.8 64z\"]\n};\nvar faTemperatureHalf = {\n  prefix: 'fas',\n  iconName: 'temperature-half',\n  icon: [320, 512, [127777, \"temperature-2\", \"thermometer-2\", \"thermometer-half\"], \"f2c9\", \"M160 0C107 0 64 43 64 96l0 164.7C34.5 287 16 325.4 16 368 16 447.5 80.5 512 160 512s144-64.5 144-144c0-42.6-18.5-81-48-107.3L256 96c0-53-43-96-96-96zm64 368c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-26.9 16.5-49.9 40-59.3l0-92.7c0-13.3 10.7-24 24-24s24 10.7 24 24l0 92.7c23.5 9.5 40 32.5 40 59.3z\"]\n};\nvar faTemperature2 = faTemperatureHalf;\nvar faThermometer2 = faTemperatureHalf;\nvar faThermometerHalf = faTemperatureHalf;\nvar faTicket = {\n  prefix: 'fas',\n  iconName: 'ticket',\n  icon: [576, 512, [127903], \"f145\", \"M64 64C28.7 64 0 92.7 0 128l0 64C0 200.8 7.4 207.7 15.7 210.6 34.5 217.1 48 235 48 256s-13.5 38.9-32.3 45.4C7.4 304.3 0 311.2 0 320l0 64c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-64c0-8.8-7.4-15.7-15.7-18.6-18.8-6.5-32.3-24.4-32.3-45.4s13.5-38.9 32.3-45.4c8.3-2.9 15.7-9.8 15.7-18.6l0-64c0-35.3-28.7-64-64-64L64 64zM416 336l0-160-256 0 0 160 256 0zM112 160c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32l0-192z\"]\n};\nvar faWheatAwnCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'wheat-awn-circle-exclamation',\n  icon: [640, 512, [], \"e598\", \"M496 576a144 144 0 1 1 0-288 144 144 0 1 1 0 288zM81 529c-9.4 9.3-24.5 9.3-33.9 0-9.4-9.4-9.4-24.6 0-33.9L81 529zm30.2-294.4c6.2-4.1 14.7-3.4 20.1 2.1l46.1 46.1 6.1 6.7c19.7 23.8 26.3 55 19.3 83.9 31.7-7.7 66.2 1 90.6 25.3l12 12c-.8 7-1.2 14.2-1.2 21.4 0 20 3 39.3 8.7 57.4-36.8 21.8-85 17-116.6-14.7L165.6 444.3 81 529C69.7 517.7 58.4 506.3 47 495l84.7-84.7-30.5-30.5c-37.5-37.5-37.5-98.3 0-135.7l7.4-7.4 2.5-2.1zM496 476a20 20 0 1 0 0 40 20 20 0 1 0 0-40zm0-140c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16 8.8 0 16-7.2 16-16l0-80c0-8.8-7.2-16-16-16zM215.2 130.6c6.2-4.1 14.7-3.4 20.1 2.1l46.1 46.1 6.1 6.7c19.7 23.8 26.3 55 19.3 83.9 24.2-5.9 50.1-2.1 71.9 10.8-32.2 24.9-56.2 59.8-67.4 100.1-3.8-2.8-7.5-6-11-9.5l-94.9-94.9c-37.5-37.5-37.5-98.3 0-135.7l7.4-7.4 2.5-2.1zM526.7 15c9.4-9.4 24.6-9.4 33.9 0 8.8 8.8 9.3 22.7 1.7 32.1L560.6 49 446.2 163.4c7.7 1 15.3 3 22.5 5.9L527 111c9.4-9.4 24.6-9.4 34 0 8.8 8.8 9.3 22.7 1.6 32.1l-1.7 1.8-52.7 52.7 39 39c3.2 3.2 4.7 7.4 4.7 11.6-17.7-5.4-36.5-8.3-55.9-8.3-34.2 0-66.3 8.9-94.1 24.6l-92.7-92.7c-37.5-37.5-37.5-98.3 0-135.8l7.4-7.4 2.5-2.1c6.2-4.1 14.7-3.4 20.1 2.1l39 39 52.7-52.7c9.4-9.4 24.6-9.4 34 0 8.8 8.8 9.3 22.7 1.6 32.1L465 49 406.7 107.3c2.8 7.1 4.7 14.5 5.8 22.1L526.7 15z\"]\n};\nvar faArrowsTurnRight = {\n  prefix: 'fas',\n  iconName: 'arrows-turn-right',\n  icon: [448, 512, [], \"e4c0\", \"M313.4-6.6c12.5-12.5 32.8-12.5 45.3 0l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L338.7 128 128 128c-35.3 0-64 28.7-64 64l0 32c0 17.7-14.3 32-32 32S0 241.7 0 224l0-32C0 121.3 57.3 64 128 64l210.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3zm-96 256c12.5-12.5 32.8-12.5 45.3 0l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 384 96 384c-17.7 0-32 14.3-32 32l0 32c0 17.7-14.3 32-32 32S0 465.7 0 448l0-32c0-53 43-96 96-96l146.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3z\"]\n};\nvar faCandyCane = {\n  prefix: 'fas',\n  iconName: 'candy-cane',\n  icon: [448, 512, [], \"f786\", \"M421.8 39.6C452 85.2 456.5 142.9 435.1 192l-165.4 0 41.4-41.4c.8-.8 1.5-1.6 2.2-2.4L421.8 39.6zM268 102.9c-.8 .7-1.6 1.4-2.4 2.2l-28.1 28.1c-25 25-65.5 25-90.5 0s-25-65.5 0-90.5L175 14.6C229.9-40.2 314.5-46.7 376.5-5.6L268 102.9zM125.7 336l80-80 181 0-82.5 82.5 0-2.5-178.5 0zm117 64L141.4 501.3c-25 25-65.5 25-90.5 0s-25-65.5 0-90.5l10.7-10.7 181 0z\"]\n};\nvar faWheelchair = {\n  prefix: 'fas',\n  iconName: 'wheelchair',\n  icon: [512, 512, [], \"f193\", \"M136 40a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM117.9 197.6l12.6 63c-38.6 12.4-66.5 48.7-66.5 91.4 0 53 43 96 96 96 35.6 0 66.7-19.4 83.3-48.2 2.3 .1 4.6 .2 7 .2l4.1 0c1 0 2.1 0 3.1 0l55.2 0c-20.4 64.9-81 112-152.7 112-88.4 0-160-71.6-160-160 0-73.8 50-135.9 117.9-154.4zm148.6-28.1l23.7 118.5 60.5 0c33.3 0 63.2 20.7 74.9 51.9l25.5 68 18.7-6.2c16.8-5.6 34.9 3.5 40.5 20.2s-3.5 34.9-20.2 40.5l-48 16c-16.3 5.4-34-3-40.1-19.1l-36.3-96.9c-2.3-6.2-8.3-10.4-15-10.4l-86.1 0c-.4 0-.8 0-1.3 0l-13.1 0c-30.5 0-56.8-21.5-62.8-51.4L165.3 189.7c-6.4-31.9 18-61.7 50.6-61.7 24.6 0 45.8 17.4 50.6 41.5z\"]\n};\nvar faSpellCheck = {\n  prefix: 'fas',\n  iconName: 'spell-check',\n  icon: [576, 512, [], \"f891\", \"M120 32c-48.6 0-88 39.4-88 88l0 168c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-168c0-48.6-39.4-88-88-88l-16 0zm40 128l-64 0 0-40c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24l0 40zM304 32c-17.7 0-32 14.3-32 32l0 224c0 17.7 14.3 32 32 32l72 0c48.6 0 88-39.4 88-88 0-23.6-9.3-45-24.4-60.8 10.3-14.4 16.4-32.1 16.4-51.2 0-48.6-39.4-88-88-88l-64 0zm64 112l-32 0 0-48 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24zM336 256l0-48 40 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-40 0zm233 84c11-13.8 8.8-33.9-5-45s-33.9-8.8-45 5l-105.7 132.1-38.7-38.7c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c6.4 6.4 15.3 9.8 24.4 9.3s17.5-4.9 23.2-12L569 340z\"]\n};\nvar faVolumeOff = {\n  prefix: 'fas',\n  iconName: 'volume-off',\n  icon: [320, 512, [], \"f026\", \"M96 352l-48 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48l48 0 134.1-119.2c6.4-5.7 14.6-8.8 23.1-8.8 19.2 0 34.8 15.6 34.8 34.8l0 378.4c0 19.2-15.6 34.8-34.8 34.8-8.5 0-16.7-3.1-23.1-8.8L96 352z\"]\n};\nvar faLungs = {\n  prefix: 'fas',\n  iconName: 'lungs',\n  icon: [576, 512, [129729], \"f604\", \"M320 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 141.9-32 19.2 0-116.7c0-24.5-19.9-44.4-44.4-44.4-12.5 0-24.4 5.3-32.8 14.5l-26.4 29C42.9 160.8 0 271.8 0 387l0 30.5c0 52.2 42.3 94.5 94.5 94.5 22 0 43.7-5.1 63.4-15l5-2.5c37.4-18.7 61-56.9 61-98.8l0-128 64-38.4 64 38.4 0 128c0 41.8 23.6 80.1 61 98.8l5 2.5c19.7 9.8 41.4 15 63.4 15 52.2 0 94.5-42.3 94.5-94.5l0-6.2c0-111.1-36.7-219-104.4-307L428.9 48.7c-8.1-10.6-20.7-16.7-34-16.7-23.7 0-42.9 19.2-42.9 42.9l0 118.2-32-19.2 0-141.9z\"]\n};\nvar faBookmark = {\n  prefix: 'fas',\n  iconName: 'bookmark',\n  icon: [384, 512, [128278, 61591], \"f02e\", \"M64 0C28.7 0 0 28.7 0 64L0 480c0 11.5 6.2 22.2 16.2 27.8s22.3 5.5 32.2-.4L192 421.3 335.5 507.4c9.9 5.9 22.2 6.1 32.2 .4S384 491.5 384 480l0-416c0-35.3-28.7-64-64-64L64 0z\"]\n};\nvar faBarcode = {\n  prefix: 'fas',\n  iconName: 'barcode',\n  icon: [448, 512, [], \"f02a\", \"M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32L64 64c0-17.7-14.3-32-32-32zm88 0c-13.3 0-24 10.7-24 24l0 400c0 13.3 10.7 24 24 24s24-10.7 24-24l0-400c0-13.3-10.7-24-24-24zm72 32l0 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32s-32 14.3-32 32zm208-8l0 400c0 13.3 10.7 24 24 24s24-10.7 24-24l0-400c0-13.3-10.7-24-24-24s-24 10.7-24 24zm-96 0l0 400c0 13.3 10.7 24 24 24s24-10.7 24-24l0-400c0-13.3-10.7-24-24-24s-24 10.7-24 24z\"]\n};\nvar faListOl = {\n  prefix: 'fas',\n  iconName: 'list-ol',\n  icon: [512, 512, [\"list-1-2\", \"list-numeric\"], \"f0cb\", \"M0 72C0 58.8 10.7 48 24 48l48 0c13.3 0 24 10.7 24 24l0 104 24 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-80-24 0C10.7 96 0 85.3 0 72zM30.4 301.2C41.8 292.6 55.7 288 70 288l4.9 0c33.7 0 61.1 27.4 61.1 61.1 0 19.6-9.4 37.9-25.2 49.4l-24 17.5 33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-90.7 0C13.1 464 0 450.9 0 434.7 0 425.3 4.5 416.5 12.1 411l70.5-51.3c3.4-2.5 5.4-6.4 5.4-10.6 0-7.2-5.9-13.1-13.1-13.1L70 336c-3.9 0-7.7 1.3-10.8 3.6L38.4 355.2c-10.6 8-25.6 5.8-33.6-4.8S-1 324.8 9.6 316.8l20.8-15.6zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faList12 = faListOl;\nvar faListNumeric = faListOl;\nvar faFileCircleXmark = {\n  prefix: 'fas',\n  iconName: 'file-circle-xmark',\n  icon: [576, 512, [], \"e5a1\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-22.7-31.5-36-70.2-36-112 0-100.6 77.4-183.2 176-191.3l0-38.1c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7l-36.7 36.7 36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z\"]\n};\nvar faCube = {\n  prefix: 'fas',\n  iconName: 'cube',\n  icon: [512, 512, [], \"f1b2\", \"M224.3-2.5c19.8-11.4 44.2-11.4 64 0L464.2 99c19.8 11.4 32 32.6 32 55.4l0 203c0 22.9-12.2 44-32 55.4L288.3 514.5c-19.8 11.4-44.2 11.4-64 0L48.5 413c-19.8-11.4-32-32.6-32-55.4l0-203c0-22.9 12.2-44 32-55.4L224.3-2.5zm207.8 360l0-166.1-143.8 83 0 166.1 143.8-83z\"]\n};\nvar faTape = {\n  prefix: 'fas',\n  iconName: 'tape',\n  icon: [576, 512, [], \"f4db\", \"M412.8 416c41.5-40.7 67.2-97.3 67.2-160 0-123.7-100.3-224-224-224S32 132.3 32 256 132.3 480 256 480l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-131.2 0zM256 160a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm48 96a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z\"]\n};\nvar faBomb = {\n  prefix: 'fas',\n  iconName: 'bomb',\n  icon: [576, 512, [128163], \"f1e2\", \"M480-16c6.9 0 13 4.4 15.2 10.9l13.5 40.4 40.4 13.5C555.6 51 560 57.1 560 64s-4.4 13-10.9 15.2l-40.4 13.5-13.5 40.4C493 139.6 486.9 144 480 144s-13-4.4-15.2-10.9l-13.5-40.4-40.4-13.5C404.4 77 400 70.9 400 64s4.4-13 10.9-15.2l40.4-13.5 13.5-40.4C467-11.6 473.1-16 480-16zM321.4 97.4c12.5-12.5 32.8-12.5 45.3 0l80 80c12.5 12.5 12.5 32.8 0 45.3l-10.9 10.9c7.9 22 12.2 45.7 12.2 70.5 0 114.9-93.1 208-208 208S32 418.9 32 304 125.1 96 240 96c24.7 0 48.5 4.3 70.5 12.3l10.9-10.9zM144 304c0-53 43-96 96-96 13.3 0 24-10.7 24-24s-10.7-24-24-24c-79.5 0-144 64.5-144 144 0 13.3 10.7 24 24 24s24-10.7 24-24z\"]\n};\nvar faScaleUnbalanced = {\n  prefix: 'fas',\n  iconName: 'scale-unbalanced',\n  icon: [640, 512, [\"balance-scale-left\"], \"f515\", \"M519.8 62.4c16.8-5.6 25.8-23.7 20.2-40.5S516.3-3.9 499.6 1.6l-113 37.7c-13.9-23.5-39.6-39.3-68.9-39.3-44.2 0-80 35.8-80 80 0 3 .2 5.9 .5 8.8L115.6 129.6c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l135.5-45.2c4.5 3.2 9.3 5.9 14.4 8.2l0 326.7c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-294.7c21-9.2 37.2-27 44.2-49l125.9-42zM437.3 288l72.4-124.2 72.4 124.2-144.9 0zm72.4 96c62.9 0 115.2-34 126-78.9 2.6-11-1-22.3-6.7-32.1L533.8 109.8c-5-8.6-14.2-13.8-24.1-13.8s-19.1 5.3-24.1 13.8L390.4 273.1c-5.7 9.8-9.3 21.1-6.7 32.1 10.8 44.8 63.1 78.9 126 78.9zM126.8 291.8l72.4 124.2-144.9 0 72.4-124.2zM.9 433.1C11.7 478 64 512 126.8 512s115.2-34 126-78.9c2.6-11-1-22.3-6.7-32.1L150.9 237.8c-5-8.6-14.2-13.8-24.1-13.8s-19.1 5.3-24.1 13.8L7.6 401.1c-5.7 9.8-9.3 21.1-6.7 32.1z\"]\n};\nvar faBalanceScaleLeft = faScaleUnbalanced;\nvar faSquareCaretLeft = {\n  prefix: 'fas',\n  iconName: 'square-caret-left',\n  icon: [448, 512, [\"caret-square-left\"], \"f191\", \"M0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416zM128 256c0-6.7 2.8-13 7.7-17.6l112-104c7-6.5 17.2-8.2 25.9-4.4S288 142.5 288 152l0 208c0 9.5-5.7 18.2-14.4 22s-18.9 2.1-25.9-4.4l-112-104c-4.9-4.5-7.7-10.9-7.7-17.6z\"]\n};\nvar faCaretSquareLeft = faSquareCaretLeft;\nvar faRuler = {\n  prefix: 'fas',\n  iconName: 'ruler',\n  icon: [576, 512, [128207], \"f545\", \"M209.1 516.2c-18.7 18.7-49.1 18.7-67.9 0L28.1 403.1c-18.7-18.7-18.7-49.1 0-67.9l17-17 73.5 73.5c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-73.5-73.5 33.9-33.9 50.9 50.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-50.9-50.9 33.9-33.9 73.5 73.5c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-73.5-73.5 33.9-33.9 50.9 50.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-50.9-50.9 33.9-33.9 73.5 73.5c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-73.5-73.5 17-17c18.7-18.7 49.1-18.7 67.9 0L548.5 108.9c18.7 18.7 18.7 49.1 0 67.9L209.1 516.2z\"]\n};\nvar faI = {\n  prefix: 'fas',\n  iconName: 'i',\n  icon: [320, 512, [105], \"49\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l96 0 0 320-96 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0 0-320 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32z\"]\n};\nvar faVolumeXmark = {\n  prefix: 'fas',\n  iconName: 'volume-xmark',\n  icon: [576, 512, [\"volume-mute\", \"volume-times\"], \"f6a9\", \"M48 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L96 160 48 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48zM367 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z\"]\n};\nvar faVolumeMute = faVolumeXmark;\nvar faVolumeTimes = faVolumeXmark;\nvar faArchway = {\n  prefix: 'fas',\n  iconName: 'archway',\n  icon: [512, 512, [], \"f557\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zm0 384c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0 0-128c0-53 43-96 96-96s96 43 96 96l0 128 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-272-448 0 0 272z\"]\n};\nvar faPersonDigging = {\n  prefix: 'fas',\n  iconName: 'person-digging',\n  icon: [576, 512, [\"digging\"], \"f85e\", \"M208 40a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM10.5 181.3c5.9-11.9 20.3-16.7 32.2-10.7l24.6 12.3 12.2-20.4c18.9-31.5 53.2-50.5 89.6-50.5 46.2 0 87.7 30.5 100.5 75.4l32.2 112.7 92.9 46.4 25.8-43c5.8-9.6 16.2-15.5 27.4-15.5s21.7 5.9 27.4 15.5l96 160c5.9 9.9 6.1 22.2 .4 32.2S555.5 512 544 512l-192 0c-11.5 0-22.2-6.2-27.8-16.2s-5.5-22.3 .4-32.2L370 387.8 21.3 213.5c-11.9-5.9-16.7-20.3-10.7-32.2zM94.3 307.4l112 56c10.8 5.4 17.7 16.5 17.7 28.6l0 88c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-68.2-61.3-30.7-36.3 109c-5.6 16.8-23.7 25.8-40.5 20.2S-3.9 486.6 1.7 469.9l48-144c2.9-8.8 9.5-15.9 18.1-19.4s18.3-3.2 26.6 .9z\"]\n};\nvar faDigging = faPersonDigging;\nvar faGaugeHigh = {\n  prefix: 'fas',\n  iconName: 'gauge-high',\n  icon: [512, 512, [62461, \"tachometer-alt\", \"tachometer-alt-fast\"], \"f625\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM256 416c35.3 0 64-28.7 64-64 0-16.2-6-31.1-16-42.3l69.5-138.9c5.9-11.9 1.1-26.3-10.7-32.2s-26.3-1.1-32.2 10.7L261.1 288.2c-1.7-.1-3.4-.2-5.1-.2-35.3 0-64 28.7-64 64s28.7 64 64 64zM176 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM96 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm352-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\"]\n};\nvar faTachometerAlt = faGaugeHigh;\nvar faTachometerAltFast = faGaugeHigh;\nvar faGenderless = {\n  prefix: 'fas',\n  iconName: 'genderless',\n  icon: [384, 512, [], \"f22d\", \"M192 128a128 128 0 1 1 0 256 128 128 0 1 1 0-256zm0 320a192 192 0 1 0 0-384 192 192 0 1 0 0 384z\"]\n};\nvar faCloudSun = {\n  prefix: 'fas',\n  iconName: 'cloud-sun',\n  icon: [640, 512, [9925], \"f6c4\", \"M208.3 192c43.1 0 80.5 24.4 99.2 60.1 14.7-17.2 36.4-28.1 60.8-28.1 44.2 0 80 35.8 80 80 0 5.5-.6 10.9-1.6 16 .5 0 1.1 0 1.6 0 53 0 96 43 96 96s-43 96-96 96l-320 0c-53 0-96-43-96-96 0-42.5 27.7-78.5 66-91.2-1.3-6.8-2-13.7-2-20.8 0-61.9 50.1-112 112-112zm192-223.8c5.3 0 10.3 2.7 13.3 7.1l47.3 70.4 83.3-16.3c5.2-1 10.6 .7 14.3 4.4 3.8 3.8 5.4 9.2 4.4 14.4l-16.3 83.3 70.4 47.3c4.4 3 7.1 8 7.1 13.3 0 5.3-2.6 10.3-7 13.2l-70.4 47.3 14.5 74.2c-17.2-21.7-40.4-38.4-67.2-47.3-2.5-12.7-6.9-24.6-12.8-35.7 9.6-14.9 15.2-32.7 15.2-51.7 0-53-43-96-96-96-47.9 0-87.6 35.1-94.8 80.9-20.9-16-45.9-27-73.1-31.1l21.5-14.5-16.3-83.2-.3-2c-.3-4.6 1.3-9.1 4.6-12.4 3.8-3.8 9.2-5.4 14.4-4.4l83.3 16.3 47.3-70.4 1.2-1.6c3-3.5 7.4-5.5 12.1-5.5zm0 175.8c26.5 0 48 21.5 48 48 0 3.8-.5 7.6-1.4 11.1-21.7-16.9-48.9-27.1-78.6-27.1-4.6 0-9.1 .2-13.5 .7 6.4-19 24.3-32.7 45.5-32.7z\"]\n};\nvar faArrowRight = {\n  prefix: 'fas',\n  iconName: 'arrow-right',\n  icon: [512, 512, [8594], \"f061\", \"M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-105.4 105.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z\"]\n};\nvar faHandshake = {\n  prefix: 'fas',\n  iconName: 'handshake',\n  icon: [576, 512, [129309, 62662, \"handshake-alt\", \"handshake-simple\"], \"f2b5\", \"M268.9 85.2L152.3 214.8c-4.6 5.1-4.4 13 .5 17.9 30.5 30.5 80 30.5 110.5 0l31.8-31.8c4.2-4.2 9.5-6.5 14.9-6.9 6.8-.6 13.8 1.7 19 6.9L505.6 376 576 320 576 32 464 96 440.2 80.1C424.4 69.6 405.9 64 386.9 64l-70.4 0c-1.1 0-2.3 0-3.4 .1-16.9 .9-32.8 8.5-44.2 21.1zM116.6 182.7L223.4 64 183.8 64c-25.5 0-49.9 10.1-67.9 28.1L112 96 0 32 0 320 156.4 450.3c23 19.2 52 29.7 81.9 29.7l15.7 0-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l41 41 9 0c19.1 0 37.8-4.3 54.8-12.3L359 441c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l32 32 17.5-17.5c8.9-8.9 11.5-21.8 7.6-33.1l-137.9-136.8-14.9 14.9c-49.3 49.3-129.1 49.3-178.4 0-23-23-23.9-59.9-2.2-84z\"]\n};\nvar faHandshakeAlt = faHandshake;\nvar faHandshakeSimple = faHandshake;\nvar faPersonSkiing = {\n  prefix: 'fas',\n  iconName: 'person-skiing',\n  icon: [576, 512, [9975, \"skiing\"], \"f7c9\", \"M416 56a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM2.7 300.9c6.1-11.8 20.6-16.3 32.4-10.2l197.8 102.7 62.3-87.2-82-92.2c-11-12.4-16.2-27.5-16.2-42.4l111.6 53.4 42.9 48.2c14.9 16.7 16.2 41.6 3.2 59.8l-64.4 90.2 128.3 66.6c13.6 7.1 29.8 7.2 43.6 .3l15.2-7.6c11.9-5.9 26.3-1.1 32.2 10.7s1.1 26.3-10.7 32.2l-15.2 7.6c-27.5 13.7-59.9 13.5-87.2-.7L12.9 333.3C1.2 327.2-3.4 312.7 2.7 300.9zM103 49.6l18 8.7 8.7-17.4c4-7.9 13.6-11.1 21.5-7.2s11.1 13.6 7.2 21.5l-8.5 17 84.8 41 .4-.2 76.1-33.8c31.3-13.9 67.9-.7 83.2 29.9l28.9 57.8 68.7 27.5c16.4 6.6 24.4 25.2 17.8 41.6s-25.2 24.4-41.6 17.8L393.8 224c-10.9-4.4-19.8-12.6-25.1-23.1l-11.5-23.1c-16.4 9.4-25.9 14.8-28.5 16.3l-7.6-3.7-185.6-89.6-9.2 18.3c-4 7.9-13.6 11.1-21.5 7.2s-11.1-13.6-7.2-21.5l9-17.9-17.6-8.5C81.1 74.6 77.8 65 81.6 57S95 45.7 103 49.6z\"]\n};\nvar faSkiing = faPersonSkiing;\nvar faBridgeWater = {\n  prefix: 'fas',\n  iconName: 'bridge-water',\n  icon: [640, 512, [], \"e4ce\", \"M64 64l512 0 0 112c-37.6 9.4-64 43.2-64 82l0 76.4c-21-9.7-43.5-14.5-66-14.4-10 .1-20.1 1.1-30 3.1l0-35.1c0-53-43-96-96-96s-96 43-96 96l0 32.7c-5.3-.5-10.7-.8-16-.7-27.7 .2-55.4 7.8-80 23l0-85c0-38.8-26.4-72.6-64-82L64 64zM403.4 444.1C379.1 462.3 351.1 480 320 480s-59.1-17.7-83.4-35.9c-21.3-16.1-49.9-16.1-71.2 0-23.8 17.9-54.1 35.5-88.1 35.3-20.4-.1-40.7-6.7-59.8-21.1-10.6-8-12.7-23-4.7-33.6s23-12.7 33.6-4.7c11.3 8.5 21.6 11.4 31.2 11.5 17.6 .1 37.3-9.4 58.9-25.7 38.4-29 90.5-29 129 0 24 18.1 40.7 26.3 54.5 26.3s30.5-8.2 54.5-26.3c38.4-29 90.5-29 129 0 16.9 12.7 32.9 21.5 47.8 24.6 13.7 2.8 27.4 .9 42.3-10.3 10.6-8 25.6-5.9 33.6 4.7s5.9 25.6-4.7 33.6c-26.4 19.9-54.2 24.4-80.7 19.1-25.3-5.1-48.1-18.9-67.2-33.3-21.3-16.1-49.9-16.1-71.2 0z\"]\n};\nvar faBuildingNgo = {\n  prefix: 'fas',\n  iconName: 'building-ngo',\n  icon: [576, 512, [], \"e4d7\", \"M128 0C92.7 0 64 28.7 64 64l0 384c0 35.3 28.7 64 64 64l48 0 0-112c0-35.3 28.7-64 64-64l208 0 0-272c0-35.3-28.7-64-64-64L128 0zm32 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM304 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM160 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm144-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM520 380c-24.3 0-44 19.7-44 44l0 80c0 24.3 19.7 44 44 44l16 0c24.3 0 44-19.7 44-44l0-80c0-24.3-19.7-44-44-44l-16 0zm-4 44c0-2.2 1.8-4 4-4l16 0c2.2 0 4 1.8 4 4l0 80c0 2.2-1.8 4-4 4l-16 0c-2.2 0-4-1.8-4-4l0-80zm-168 0l0 80c0 24.3 19.7 44 44 44l16 0c24.3 0 44-19.7 44-44l0-24c0-11-9-20-20-20l-8 0c-11 0-20 9-20 20 0 6.5 3.1 12.4 8 16l0 8c0 2.2-1.8 4-4 4l-16 0c-2.2 0-4-1.8-4-4l0-80c0-2.2 1.8-4 4-4l20.4 0c1.9 9.1 9.9 16 19.6 16 11 0 20-9 20-20 0-19.9-16.1-36-36-36l-24 0c-24.3 0-44 19.7-44 44zm-90.1-32.9c-4.1-8.3-13.5-12.7-22.5-10.5S220 390.7 220 400l0 128c0 11 9 20 20 20s20-9 20-20l0-43.3 26.1 52.2c4.1 8.3 13.5 12.7 22.5 10.5S324 537.3 324 528l0-128c0-11-9-20-20-20s-20 9-20 20l0 43.3-26.1-52.2z\"]\n};\nvar faIgloo = {\n  prefix: 'fas',\n  iconName: 'igloo',\n  icon: [576, 512, [], \"f7ae\", \"M320 33.8l0 126.2-271.5 0c51.7-77.2 139.6-128 239.5-128 10.8 0 21.5 .6 32 1.8zM368 160l0-116.7c66 19 122.2 61 159.5 116.7L368 160zM22.6 208l73.4 0 0 112-96 0c0-39.7 8-77.6 22.6-112zM176 320l-32 0 0-112 288 0 0 112-32 0 0 48 176 0 0 64c0 26.5-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48l0-64 176 0 0-48zm304 0l0-112 73.4 0C568 242.4 576 280.3 576 320l-96 0zM288 288c-35.3 0-64 28.7-64 64l0 80 128 0 0-80c0-35.3-28.7-64-64-64z\"]\n};\nvar faCircleDollarToSlot = {\n  prefix: 'fas',\n  iconName: 'circle-dollar-to-slot',\n  icon: [576, 512, [\"donate\"], \"f4b9\", \"M96 224a192 192 0 1 1 384 0 192 192 0 1 1 -384 0zm176-92l0 4c-28.8 .3-52 23.7-52 52.5 0 25.7 18.5 47.6 43.9 51.8l41.7 7c6 1 10.4 6.2 10.4 12.3 0 6.9-5.6 12.5-12.5 12.5L248 272c-11 0-20 9-20 20s9 20 20 20l24 0 0 4c0 11 9 20 20 20s20-9 20-20l0-4.7c25-4.1 44-25.7 44-51.8 0-25.7-18.5-47.6-43.9-51.8l-41.7-7c-6-1-10.4-6.2-10.4-12.3 0-6.9 5.6-12.5 12.5-12.5l47.5 0c11 0 20-9 20-20s-9-20-20-20l-8 0 0-4c0-11-9-20-20-20s-20 9-20 20zM48 344l0 104c0 8.8 7.2 16 16 16l448 0c8.8 0 16-7.2 16-16l0-104c0-13.3 10.7-24 24-24s24 10.7 24 24l0 104c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 344c0-13.3 10.7-24 24-24s24 10.7 24 24z\"]\n};\nvar faDonate = faCircleDollarToSlot;\nvar faY = {\n  prefix: 'fas',\n  iconName: 'y',\n  icon: [384, 512, [121], \"59\", \"M58 45.4C47.8 31 27.8 27.7 13.4 38S-4.3 68.2 6 82.6L160 298.3 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-149.7 154-215.7c10.3-14.4 6.9-34.4-7.4-44.6S336.2 31 326 45.4L192 232.9 58 45.4z\"]\n};\nvar faFaceSmileWink = {\n  prefix: 'fas',\n  iconName: 'face-smile-wink',\n  icon: [512, 512, [128521, \"smile-wink\"], \"f4da\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM165.4 321.9c20.4 28 53.4 46.1 90.6 46.1s70.2-18.1 90.6-46.1c7.8-10.7 22.8-13.1 33.5-5.3s13.1 22.8 5.3 33.5C356.3 390 309.2 416 256 416s-100.3-26-129.4-65.9c-7.8-10.7-5.4-25.7 5.3-33.5s25.7-5.4 33.5 5.3zM144 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm164 8c0 11-9 20-20 20s-20-9-20-20c0-33.1 26.9-60 60-60l16 0c33.1 0 60 26.9 60 60 0 11-9 20-20 20s-20-9-20-20-9-20-20-20l-16 0c-11 0-20 9-20 20z\"]\n};\nvar faSmileWink = faFaceSmileWink;\nvar faDiceFour = {\n  prefix: 'fas',\n  iconName: 'dice-four',\n  icon: [448, 512, [9859], \"f524\", \"M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm160 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM352 160a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM320 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faFaceGrinSquintTears = {\n  prefix: 'fas',\n  iconName: 'face-grin-squint-tears',\n  icon: [576, 512, [129315, \"grin-squint-tears\"], \"f586\", \"M560 35.4c0 25.6-18.8 47.3-44.1 50.9L469.1 93c-10.6 1.5-19.6-7.5-18.1-18.1l6.7-46.7C461.3 2.8 483-16 508.6-16 537-16 560 7 560 35.4zM403.5 68.1c-6 42.2 30.2 78.4 72.4 72.4l37.8-5.4C565.7 232 550.8 355.3 469 437s-205 96.6-301.9 44.7l5.4-37.8c6-42.2-30.2-78.4-72.4-72.4l-37.8 5.4C10.3 280 25.2 156.7 107 75S312-21.7 408.9 30.3l-5.4 37.8zM417.8 201c-19.1 36.4-45.6 72.7-78.9 106s-69.6 59.8-106 78.9c-11.1 5.8-12.4 21.4-1.1 26.6 59.2 27.5 131.8 16.8 180.6-32s59.5-121.4 32-180.6c-5.3-11.3-20.8-10-26.6 1.1zM113.9 270.6c1.7 8 9 13.4 17.1 12.7l43.1-3.9-3.9 43.1c-.7 8.1 4.7 15.5 12.7 17.1s15.9-2.9 18.4-10.6l28-84.6c1.9-5.7 .4-12.1-3.9-16.3s-10.6-5.8-16.3-3.9l-84.6 28c-7.7 2.6-12.3 10.5-10.6 18.5zM315.2 99.1c.7-8.1-4.7-15.5-12.7-17.1s-15.9 2.9-18.5 10.6l-28 84.6c-1.9 5.7-.4 12.1 3.9 16.3s10.6 5.8 16.3 3.9l84.6-28c7.7-2.6 12.3-10.5 10.6-18.4s-9-13.4-17.1-12.7l-43.1 3.9 3.9-43.1zM60.1 425.7l46.7-6.7c10.6-1.5 19.6 7.5 18.1 18.1l-6.7 46.7C114.7 509.2 93 528 67.4 528 39 528 16 505 16 476.6 16 451 34.8 429.3 60.1 425.7z\"]\n};\nvar faGrinSquintTears = faFaceGrinSquintTears;\nvar faFileAudio = {\n  prefix: 'fas',\n  iconName: 'file-audio',\n  icon: [384, 512, [], \"f1c7\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zm53.8 185.2c-9.1-6.3-21.5-4.1-27.8 5s-4.1 21.5 5 27.8c23.9 16.7 39.4 44.3 39.4 75.5s-15.6 58.9-39.4 75.5c-9.1 6.3-11.3 18.8-5 27.8s18.8 11.3 27.8 5c34.1-23.8 56.6-63.5 56.6-108.3S296 267.5 261.8 243.7zM80 312c-8.8 0-16 7.2-16 16l0 48c0 8.8 7.2 16 16 16l24 0 27.2 34c3 3.8 7.6 6 12.5 6l.3 0c8.8 0 16-7.2 16-16l0-128c0-8.8-7.2-16-16-16l-.3 0c-4.9 0-9.5 2.2-12.5 6l-27.2 34-24 0zm128 72.2c0 10.7 10.5 18.2 18.9 11.6 12.9-10.3 21.1-26.1 21.1-43.8s-8.2-33.5-21.1-43.8c-8.4-6.7-18.9 .9-18.9 11.6l0 64.5z\"]\n};\nvar faArrowsDownToLine = {\n  prefix: 'fas',\n  iconName: 'arrows-down-to-line',\n  icon: [512, 512, [], \"e4b8\", \"M214.6 310.6l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 274.7 96 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 242.7 9.4-9.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zm256 0l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l9.4 9.4 0-242.7c0-17.7 14.3-32 32-32s32 14.3 32 32l0 242.7 9.4-9.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512z\"]\n};\nvar faG = {\n  prefix: 'fas',\n  iconName: 'g',\n  icon: [448, 512, [103], \"47\", \"M224 96C135.6 96 64 167.6 64 256s71.6 160 160 160c77.4 0 142-55 156.8-128L256 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l144 0c25.8 0 49.6 21.4 47.2 50.6-9.5 115-105.8 205.4-223.2 205.4-123.7 0-224-100.3-224-224S100.3 32 224 32c57.4 0 109.7 21.6 149.3 57 13.2 11.8 14.3 32 2.5 45.2s-32 14.3-45.2 2.5C302.3 111.4 265 96 224 96z\"]\n};\nvar faVihara = {\n  prefix: 'fas',\n  iconName: 'vihara',\n  icon: [576, 512, [], \"f6a7\", \"M273.6-3.2c8.5-6.4 20.3-6.4 28.8 0L443.2 102.4c8.3 6.2 18.4 9.6 28.8 9.6 13.3 0 24 10.7 24 24s-10.7 24-24 24l-24 0 0 48 58.7 64 13.3 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 48 24.4 32 15.6 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-40 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-128 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-128 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-40 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l22.1 0 17.9-32 0-48-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l13.3 0 58.7-64 0-48-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24c10.4 0 20.5-3.4 28.8-9.6L273.6-3.2zM128 368l320 0 0-48-320 0 0 48zM384 160l-192 0 0 48 192 0 0-48z\"]\n};\nvar faFlagCheckered = {\n  prefix: 'fas',\n  iconName: 'flag-checkered',\n  icon: [448, 512, [127937], \"f11e\", \"M32 0C49.7 0 64 14.3 64 32l0 16 69-17.2c38.1-9.5 78.3-5.1 113.5 12.5 46.3 23.2 100.8 23.2 147.1 0l9.6-4.8C423.8 28.1 448 43.1 448 66.1l0 279.7c0 13.3-8.3 25.3-20.8 30l-34.7 13c-46.2 17.3-97.6 14.6-141.7-7.4-37.9-19-81.4-23.7-122.5-13.4L64 384 64 480c0 17.7-14.3 32-32 32S0 497.7 0 480L0 32C0 14.3 14.3 0 32 0zM64 187.1l64-13.9 0 65.5-64 13.9 0 65.5 48.8-12.2c5.1-1.3 10.1-2.4 15.2-3.3l0-63.9 38.9-8.4c8.3-1.8 16.7-2.5 25.1-2.1l0-64c13.6 .4 27.2 2.6 40.4 6.4l23.6 6.9 0 66.7-41.7-12.3c-7.3-2.1-14.8-3.4-22.3-3.8l0 71.4c21.8 1.9 43.3 6.7 64 14.4l0-69.8 22.7 6.7c13.5 4 27.3 6.4 41.3 7.4l0-64.2c-7.8-.8-15.6-2.3-23.2-4.5l-40.8-12 0-62c-13-3.8-25.8-8.8-38.2-15-8.2-4.1-16.9-7-25.8-8.8l0 72.4c-13-.4-26 .8-38.7 3.6l-25.3 5.5 0-75.2-64 16 0 73.1zM320 335.7c16.8 1.5 33.9-.7 50-6.8l14-5.2 0-71.7-7.9 1.8c-18.4 4.3-37.3 5.7-56.1 4.5l0 77.4zm64-149.4l0-70.8c-20.9 6.1-42.4 9.1-64 9.1l0 69.4c13.9 1.4 28 .5 41.7-2.6l22.3-5.2z\"]\n};\nvar faGaugeSimple = {\n  prefix: 'fas',\n  iconName: 'gauge-simple',\n  icon: [512, 512, [\"gauge-simple-med\", \"tachometer-average\"], \"f629\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm320 96c0-26.9-16.5-49.9-40-59.3L280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 172.7c-23.5 9.5-40 32.5-40 59.3 0 35.3 28.7 64 64 64s64-28.7 64-64z\"]\n};\nvar faGaugeSimpleMed = faGaugeSimple;\nvar faTachometerAverage = faGaugeSimple;\nvar faRightLeft = {\n  prefix: 'fas',\n  iconName: 'right-left',\n  icon: [512, 512, [\"exchange-alt\"], \"f362\", \"M502.6 150.6l-96 96c-9.2 9.2-22.9 11.9-34.9 6.9S352 236.9 352 224l0-64-320 0c-17.7 0-32-14.3-32-32S14.3 96 32 96l320 0 0-64c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l96 96c12.5 12.5 12.5 32.8 0 45.3zm-397.3 352l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c9.2-9.2 22.9-11.9 34.9-6.9S160 275.1 160 288l0 64 320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-320 0 0 64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9z\"]\n};\nvar faExchangeAlt = faRightLeft;\nvar faPills = {\n  prefix: 'fas',\n  iconName: 'pills',\n  icon: [512, 512, [], \"f484\", \"M64 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 112-96 0 0-112zM176 368c0-48.7 18.1-93.2 48-127l0-129C224 50.1 173.9 0 112 0S0 50.1 0 112L0 400c0 61.9 50.1 112 112 112 37.3 0 70.3-18.2 90.7-46.3-17-28.6-26.7-62-26.7-97.7zm64.7 67.4c4.6 8.7 16.3 9.7 23.3 2.7L438.1 264c7-7 6-18.7-2.7-23.3-20.1-10.7-43-16.7-67.4-16.7-79.5 0-144 64.5-144 144 0 24.3 6 47.3 16.7 67.4zM297.9 472c-7 7-6 18.7 2.7 23.3 20.1 10.7 43 16.7 67.4 16.7 79.5 0 144-64.5 144-144 0-24.3-6-47.3-16.7-67.4-4.6-8.7-16.3-9.7-23.3-2.7L297.9 472z\"]\n};\nvar faExplosion = {\n  prefix: 'fas',\n  iconName: 'explosion',\n  icon: [512, 512, [], \"e4e9\", \"M256-32c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24zm0 160c12.4 0 22.7 9.4 23.9 21.7L293.4 291.6 467.6 11.3c6.7-10.7 20.5-14.5 31.7-8.5s15.8 19.5 10.6 31L372.8 338.6c2.2 2.3 4.3 4.7 6.3 7.1l97.2-54.7c10.5-5.9 23.6-3.1 30.9 6.4s6.3 23-2.2 31.5l-87 87-71.4 0c-13.2-37.3-48.7-64-90.5-64s-77.4 26.7-90.5 64l-79.6 0-75.5-52.3C.6 357-2.8 344.1 2.4 333.5s17.4-15.9 28.7-12.4l97.2 30.4c3-3.9 6.1-7.6 9.4-11.3L75.4 236.3c-6.1-10.1-3.9-23.1 5.1-30.7s22.2-7.5 31.1 .1L214 293.6c1.5-.4 3-.8 4.5-1.1l13.6-142.7c1.2-12.3 11.5-21.7 23.9-21.7zM32 464l456 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0z\"]\n};\nvar faArrowsDownToPeople = {\n  prefix: 'fas',\n  iconName: 'arrows-down-to-people',\n  icon: [512, 512, [], \"e4b9\", \"M113 153c-9.4 9.4-24.6 9.4-33.9 0L15 89C5.7 79.6 5.7 64.4 15 55S39.6 45.7 49 55L72 78.1 72-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 86.1 23-23c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-64 64zm320 0c-9.4 9.4-24.6 9.4-33.9 0L335 89c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l23 23 0-86.1c0-13.3 10.7-24 24-24s24 10.7 24 24l0 86.1 23-23c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-64 64zM256 192a56 56 0 1 1 0 112 56 56 0 1 1 0-112zm0 160c53 0 96 43 96 96l0 32c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-32c0-53 43-96 96-96zM32 288a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm352 0a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM80 368c15.3 0 29.6 4.3 41.8 11.8-6.3 16.2-9.8 33.8-9.8 52.2l0 48c0 11.4 2.4 22.2 6.7 32l-87.8 0C13.8 512 0 498.2 0 481.1L0 448c0-44.2 35.8-80 80-80zM393.3 512c4.3-9.8 6.7-20.6 6.7-32l0-48c0-18.4-3.5-36-9.8-52.2 12.2-7.5 26.5-11.8 41.8-11.8 44.2 0 80 35.8 80 80l0 33.1c0 17-13.8 30.9-30.9 30.9l-87.8 0z\"]\n};\nvar faUsersViewfinder = {\n  prefix: 'fas',\n  iconName: 'users-viewfinder',\n  icon: [576, 512, [], \"e595\", \"M64 0C28.7 0 0 28.7 0 64l0 72c0 13.3 10.7 24 24 24s24-10.7 24-24l0-72c0-8.8 7.2-16 16-16l72 0c13.3 0 24-10.7 24-24S149.3 0 136 0L64 0zM440 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0c8.8 0 16 7.2 16 16l0 72c0 13.3 10.7 24 24 24s24-10.7 24-24l0-72c0-35.3-28.7-64-64-64L440 0zM48 376c0-13.3-10.7-24-24-24S0 362.7 0 376l0 72c0 35.3 28.7 64 64 64l72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0c-8.8 0-16-7.2-16-16l0-72zm528 0c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72c0 8.8-7.2 16-16 16l-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0c35.3 0 64-28.7 64-64l0-72zM288 216a56 56 0 1 0 0-112 56 56 0 1 0 0 112zm0 40c-53 0-96 43-96 96l0 24c0 13.3 10.7 24 24 24l144 0c13.3 0 24-10.7 24-24l0-24c0-53-43-96-96-96zm192-64a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM168 272.3c-49.3 4.1-88 45.3-88 95.7l0 10.7c0 11.8 9.6 21.3 21.3 21.3l46.8 0c-2.7-7.5-4.1-15.6-4.1-24l0-24c0-29.5 8.8-56.9 24-79.7zM427.9 400l46.8 0c11.8 0 21.3-9.6 21.3-21.3l0-10.7c0-50.3-38.7-91.6-88-95.7 15.2 22.8 24 50.2 24 79.7l0 24c0 8.4-1.4 16.5-4.1 24zM192 192a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z\"]\n};\nvar faCarOn = {\n  prefix: 'fas',\n  iconName: 'car-on',\n  icon: [448, 512, [], \"e4dd\", \"M248-8c0-13.3-10.7-24-24-24S200-21.3 200-8l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64zM145.3 208l157.5 0c6.7 0 12.6 4.1 15 10.4l26.1 69.6-239.6 0 26.1-69.6c2.3-6.2 8.3-10.4 15-10.4zM34 292.8l-1.3 3.4C13.2 307.1 0 328 0 352L0 480c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-32 288 0 0 32c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-128c0-24-13.2-44.9-32.8-55.9l-1.3-3.4-36.3-96.9c-11.7-31.2-41.6-51.9-74.9-51.9l-157.5 0c-33.3 0-63.2 20.7-74.9 51.9L34 292.8zM96 336a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm224 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM7 7C-2.3 16.4-2.3 31.6 7 41L55 89c9.4 9.4 24.6 9.4 33.9 0S98.3 64.4 89 55L41 7C31.6-2.3 16.4-2.3 7 7zM407 7L359 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9S416.4-2.3 407 7z\"]\n};\nvar faSleigh = {\n  prefix: 'fas',\n  iconName: 'sleigh',\n  icon: [640, 512, [], \"f7cc\", \"M64 32C46.3 32 32 46.3 32 64S46.3 96 64 96l0 160c0 41.8 26.7 77.4 64 90.5l0 69.5-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l504 0c44.2 0 80-35.8 80-80l0-8c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 8c0 17.7-14.3 32-32 32l-80 0 0-64c53 0 96-43 96-96l0-96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32l0 32c0 35.3-28.7 64-64 64l-48.9 0c-48.5 0-92.8-27.4-114.5-70.8l-25.2-50.5C237.7 59.4 193.4 32 144.9 32L64 32zM432 416l-256 0 0-64 256 0 0 64z\"]\n};\nvar faDumbbell = {\n  prefix: 'fas',\n  iconName: 'dumbbell',\n  icon: [640, 512, [], \"f44b\", \"M96 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 112 256 0 0-112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 16 16 0c26.5 0 48 21.5 48 48l0 48c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 48c0 26.5-21.5 48-48 48l-16 0 0 16c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-112-256 0 0 112c0 26.5-21.5 48-48 48s-48-21.5-48-48l0-16-16 0c-26.5 0-48-21.5-48-48l0-48c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-48c0-26.5 21.5-48 48-48l16 0 0-16z\"]\n};\nvar faBabyCarriage = {\n  prefix: 'fas',\n  iconName: 'baby-carriage',\n  icon: [512, 512, [\"carriage-baby\"], \"f77d\", \"M64 208l0 80c0 53 43 96 96 96l192 0c53 0 96-43 96-96l0-112 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0c-13.3 0-24 10.7-24 24l0 56-336 0zm.2-48l223.8 0 0-128c0-17.7-14.3-32-32-32L232 0C141.9 0 68.4 70.9 64.2 160zM160 464a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm288 0a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z\"]\n};\nvar faCarriageBaby = faBabyCarriage;\nvar faKiwiBird = {\n  prefix: 'fas',\n  iconName: 'kiwi-bird',\n  icon: [576, 512, [], \"f535\", \"M291.2 388.4c31.2-18.8 64.7-36.4 101.1-36.4l55.7 0c4.6 0 9.1-.2 13.6-.7l85.3 121.9c4 5.7 11.3 8.2 17.9 6.1S576 471 576 464l0-240c0-70.7-57.3-128-128-128l-55.7 0C355.9 96 322.4 78.4 291.2 59.6 262.3 42.1 228.3 32 192 32 86 32 0 118 0 224 0 295.1 38.6 357.1 96 390.3L96 456c0 13.3 10.7 24 24 24s24-10.7 24-24l0-46c15.3 3.9 31.4 6 48 6 5.4 0 10.7-.2 16-.7l0 40.7c0 13.3 10.7 24 24 24s24-10.7 24-24l0-50.9c12.4-4.4 24.2-10 35.2-16.7zM448 200a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faCalendarXmark = {\n  prefix: 'fas',\n  iconName: 'calendar-xmark',\n  icon: [448, 512, [\"calendar-times\"], \"f273\", \"M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zM291.9 220.1c-9.4-9.4-24.6-9.4-33.9 0l-33.9 33.9-33.9-33.9c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l33.9 33.9-33.9 33.9c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l33.9-33.9 33.9 33.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-33.9-33.9 33.9-33.9c9.4-9.4 9.4-24.6 0-33.9z\"]\n};\nvar faCalendarTimes = faCalendarXmark;\nvar faCircleDown = {\n  prefix: 'fas',\n  iconName: 'circle-down',\n  icon: [512, 512, [61466, \"arrow-alt-circle-down\"], \"f358\", \"M256 0a256 256 0 1 0 0 512 256 256 0 1 0 0-512zM244.7 387.3l-104-104c-4.6-4.6-5.9-11.5-3.5-17.4s8.3-9.9 14.8-9.9l56 0 0-96c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 96 56 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-104 104c-6.2 6.2-16.4 6.2-22.6 0z\"]\n};\nvar faArrowAltCircleDown = faCircleDown;\nvar faFileMedical = {\n  prefix: 'fas',\n  iconName: 'file-medical',\n  icon: [384, 512, [], \"f477\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM160 280l0 40-40 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l40 0 0 40c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-40 40 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-40 0 0-40c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z\"]\n};\nvar faXmark = {\n  prefix: 'fas',\n  iconName: 'xmark',\n  icon: [384, 512, [128473, 10005, 10006, 10060, 215, \"close\", \"multiply\", \"remove\", \"times\"], \"f00d\", \"M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z\"]\n};\nvar faClose = faXmark;\nvar faMultiply = faXmark;\nvar faRemove = faXmark;\nvar faTimes = faXmark;\nvar faShapes = {\n  prefix: 'fas',\n  iconName: 'shapes',\n  icon: [512, 512, [\"triangle-circle-square\"], \"f61f\", \"M256 0c11.2 0 21.7 5.9 27.4 15.5l96 160c5.9 9.9 6.1 22.2 .4 32.2S363.5 224 352 224l-192 0c-11.5 0-22.2-6.2-27.8-16.2s-5.5-22.3 .4-32.2l96-160C234.3 5.9 244.8 0 256 0zM128 272a112 112 0 1 1 0 224 112 112 0 1 1 0-224zm200 16l112 0c22.1 0 40 17.9 40 40l0 112c0 22.1-17.9 40-40 40l-112 0c-22.1 0-40-17.9-40-40l0-112c0-22.1 17.9-40 40-40z\"]\n};\nvar faTriangleCircleSquare = faShapes;\nvar faDiceOne = {\n  prefix: 'fas',\n  iconName: 'dice-one',\n  icon: [448, 512, [9856], \"f525\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM224 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faLockOpen = {\n  prefix: 'fas',\n  iconName: 'lock-open',\n  icon: [576, 512, [], \"f3c1\", \"M384 96c0-35.3 28.7-64 64-64s64 28.7 64 64l0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32c0-70.7-57.3-128-128-128S320 25.3 320 96l0 64-160 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64l-32 0 0-64z\"]\n};\nvar faPepperHot = {\n  prefix: 'fas',\n  iconName: 'pepper-hot',\n  icon: [576, 512, [127798], \"f816\", \"M545 65c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L478.9 63.2C452.3 43.6 419.5 32 384 32 348.9 32 316.5 43.3 290.1 62.4 274.1 74.1 284.2 96 304 96l24 0c13.3 0 24 10.7 24 24l0 80c0 13.3 10.7 24 24 24l80 0c13.3 0 24 10.7 24 24l0 24c0 19.8 21.9 29.9 33.6 13.9 19.1-26.4 30.4-58.8 30.4-93.9 0-35.5-11.6-68.3-31.2-94.9L545 65zM270 135.5l-159.6 228C101.3 376.4 86.7 384 71 384l-7 0c-26.5 0-48 21.5-48 48s21.5 48 48 48l27.1 0c65.7 0 129.7-20.2 183.5-57.8L440.5 306.1C435 295.9 432 284.2 432 272l-56 0c-39.8 0-72-32.2-72-72l0-56c-12.2 0-23.9-3-34-8.5z\"]\n};\nvar faDropletSlash = {\n  prefix: 'fas',\n  iconName: 'droplet-slash',\n  icon: [576, 512, [\"tint-slash\"], \"f5c7\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L463.6 397.8c10.5-23.8 16.4-50.1 16.4-77.8 0-91.2-130.2-274.1-166.6-323.5-5.9-8-15.2-12.5-25.2-12.5l-.4 0c-10 0-19.3 4.5-25.2 12.5-15.6 21.2-48.5 66.9-80.9 119.4L41-24.9zm92 227.7c-21.6 43.8-37 85.9-37 117.2 0 106 86 192 192 192 43.4 0 83.4-14.4 115.5-38.6L133 202.8z\"]\n};\nvar faTintSlash = faDropletSlash;\nvar faDroplet = {\n  prefix: 'fas',\n  iconName: 'droplet',\n  icon: [384, 512, [128167, \"tint\"], \"f043\", \"M192 512C86 512 0 426 0 320 0 228.8 130.2 45.9 166.6-3.5 172.5-11.5 181.8-16 191.8-16l.4 0c10 0 19.3 4.5 25.2 12.5 36.4 49.4 166.6 232.3 166.6 323.5 0 106-86 192-192 192zM112 312c0-13.3-10.7-24-24-24s-24 10.7-24 24c0 75.1 60.9 136 136 136 13.3 0 24-10.7 24-24s-10.7-24-24-24c-48.6 0-88-39.4-88-88z\"]\n};\nvar faTint = faDroplet;\nvar faFileLines = {\n  prefix: 'fas',\n  iconName: 'file-lines',\n  icon: [384, 512, [128441, 128462, 61686, \"file-alt\", \"file-text\"], \"f15c\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM120 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z\"]\n};\nvar faFileAlt = faFileLines;\nvar faFileText = faFileLines;\nvar faCommentsDollar = {\n  prefix: 'fas',\n  iconName: 'comments-dollar',\n  icon: [576, 512, [], \"f653\", \"M192 320c106 0 192-78.8 192-176S298-32 192-32 0 46.8 0 144c0 39.6 14.3 76.2 38.4 105.6L2.8 316.8C-2.1 326.1-.4 337.5 7 345s18.9 9.2 28.2 4.2L116.8 306c23.1 9 48.5 14 75.2 14zm3.2 48c16.4 81.9 94.7 144 188.8 144 26.7 0 52.1-5 75.2-14l81.6 43.2c9.3 4.9 20.7 3.2 28.2-4.2s9.2-18.9 4.2-28.2l-35.6-67.2c24.1-29.4 38.4-66 38.4-105.6 0-82.4-61.7-151.5-145-170.7-11.5 115.8-115.8 201.2-235.8 202.7zM196 32c11 0 20 9 20 20l0 4 8 0c11 0 20 9 20 20s-9 20-20 20l-47.5 0c-6.9 0-12.5 5.6-12.5 12.5 0 6.1 4.4 11.3 10.4 12.3l41.7 7c25.3 4.2 43.9 26.1 43.9 51.8 0 26.1-19 47.7-44 51.8l0 4.7c0 11-9 20-20 20s-20-9-20-20l0-4-24 0c-11 0-20-9-20-20s9-20 20-20l55.5 0c6.9 0 12.5-5.6 12.5-12.5 0-6.1-4.4-11.3-10.4-12.3l-41.7-7c-25.3-4.2-43.9-26.1-43.9-51.8 0-28.8 23.2-52.2 52-52.5l0-4c0-11 9-20 20-20z\"]\n};\nvar faMagnifyingGlassLocation = {\n  prefix: 'fas',\n  iconName: 'magnifying-glass-location',\n  icon: [512, 512, [\"search-location\"], \"f689\", \"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM288 176c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 48.8 46.5 111.6 68.6 138.6 6 7.3 16.8 7.3 22.7 0 22.1-27 68.6-89.8 68.6-138.6zm-112 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faSearchLocation = faMagnifyingGlassLocation;\nvar faFileInvoice = {\n  prefix: 'fas',\n  iconName: 'file-invoice',\n  icon: [384, 512, [], \"f570\", \"M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-277.5c0-17-6.7-33.3-18.7-45.3L258.7 18.7C246.7 6.7 230.5 0 213.5 0L64 0zM325.5 176L232 176c-13.3 0-24-10.7-24-24L208 58.5 325.5 176zM64 384l0-64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L96 416c-17.7 0-32-14.3-32-32zM88 64l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24S74.7 64 88 64zm0 96l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faPentagon = {\n  prefix: 'fas',\n  iconName: 'pentagon',\n  icon: [576, 512, [], \"e790\", \"M316.4-3.1c-16.8-12.2-39.6-12.2-56.4 0L35.3 160.2c-16.8 12.2-23.9 33.9-17.4 53.7l85.8 264.1c6.4 19.8 24.9 33.2 45.7 33.2l277.7 0c20.8 0 39.2-13.4 45.7-33.2l85.8-264.1c6.4-19.8-.6-41.4-17.4-53.7L316.4-3.1z\"]\n};\nvar faRepublican = {\n  prefix: 'fas',\n  iconName: 'republican',\n  icon: [640, 512, [], \"f75e\", \"M0 192C0 103.6 71.6 32 160 32l224 0c88.4 0 160 71.6 160 160l0 64-544 0 0-64zm152-32a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm232 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM280 160a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM128 288l416 0 0 112c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48c0-17.7 14.3-32 32-32s32 14.3 32 32l0 48c0 44.2-35.8 80-80 80s-80-35.8-80-80l0-48-32 0 0 96c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-64-192 0 0 64c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-160 128 0z\"]\n};\nvar faShop = {\n  prefix: 'fas',\n  iconName: 'shop',\n  icon: [576, 512, [\"store-alt\"], \"f54f\", \"M21.5 181.1L78.3 67.4C89.2 45.7 111.3 32 135.6 32l304.9 0c24.2 0 46.4 13.7 57.2 35.4l56.8 113.7c3.6 7.2 5.5 15.1 5.5 23.2 0 27.3-21.2 49.7-48 51.6L512 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-192-96 0 0 176c0 26.5-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48l0-176.1c-26.8-1.9-48-24.3-48-51.6 0-8 1.9-16 5.5-23.2zM128 256l0 112c0 8.8 7.2 16 16 16l128 0c8.8 0 16-7.2 16-16l0-112-160 0z\"]\n};\nvar faStoreAlt = faShop;\nvar faFilm = {\n  prefix: 'fas',\n  iconName: 'film',\n  icon: [448, 512, [127902, 62368, \"film-alt\", \"film-simple\"], \"f008\", \"M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM48 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm304-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM48 240l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm304-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM48 112l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16L64 96c-8.8 0-16 7.2-16 16zM352 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0z\"]\n};\nvar faFilmAlt = faFilm;\nvar faFilmSimple = faFilm;\nvar faBuildingCircleXmark = {\n  prefix: 'fas',\n  iconName: 'building-circle-xmark',\n  icon: [576, 512, [], \"e4d4\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-10.5-14.6-19-30.7-25.1-48l-74.9 0 0-80c0-17.7 14.3-32 32-32l32 0c2 0 4 .2 5.9 .5 6-23.6 16.3-45.4 30.1-64.5l-4 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 4c27.5-19.8 60.3-32.4 96-35.4L416 64c0-35.3-28.7-64-64-64L96 0zm32 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM272 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM128 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm22.6-144l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L454.6 400z\"]\n};\nvar faComments = {\n  prefix: 'fas',\n  iconName: 'comments',\n  icon: [576, 512, [128490, 61670], \"f086\", \"M384 144c0 97.2-86 176-192 176-26.7 0-52.1-5-75.2-14L35.2 349.2c-9.3 4.9-20.7 3.2-28.2-4.2s-9.2-18.9-4.2-28.2l35.6-67.2C14.3 220.2 0 183.6 0 144 0 46.8 86-32 192-32S384 46.8 384 144zm0 368c-94.1 0-172.4-62.1-188.8-144 120-1.5 224.3-86.9 235.8-202.7 83.3 19.2 145 88.3 145 170.7 0 39.6-14.3 76.2-38.4 105.6l35.6 67.2c4.9 9.3 3.2 20.7-4.2 28.2s-18.9 9.2-28.2 4.2L459.2 498c-23.1 9-48.5 14-75.2 14z\"]\n};\nvar faTags = {\n  prefix: 'fas',\n  iconName: 'tags',\n  icon: [576, 512, [], \"f02c\", \"M401.2 39.1L549.4 189.4c27.7 28.1 27.7 73.1 0 101.2L393 448.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L515.3 256.8c9.2-9.3 9.2-24.4 0-33.7L367 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM32.1 229.5L32.1 96c0-35.3 28.7-64 64-64l133.5 0c17 0 33.3 6.7 45.3 18.7l144 144c25 25 25 65.5 0 90.5L285.4 418.7c-25 25-65.5 25-90.5 0l-144-144c-12-12-18.7-28.3-18.7-45.3zm144-85.5a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\"]\n};\nvar faGun = {\n  prefix: 'fas',\n  iconName: 'gun',\n  icon: [576, 512, [], \"e19b\", \"M528 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 8-448 0C14.3 64 0 78.3 0 96L0 208c0 17.7 14.3 32 32 32l10 0c20.8 0 36.1 19.6 31 39.8L33 440.2c-2.4 9.6-.2 19.7 5.8 27.5S54.1 480 64 480l96 0c14.7 0 27.5-10 31-24.2L217 352 321.4 352c23.7 0 44.8-14.9 52.7-37.2l26.7-74.8 31.1 0c8.5 0 16.6-3.4 22.6-9.4l22.6-22.6 66.7 0c17.7 0 32-14.3 32-32l0-80c0-17.7-14.3-32-32-32l-16 0 0-8zM321.4 304l-92.5 0 16-64 105 0-21 58.7c-1.1 3.2-4.2 5.3-7.5 5.3zM80 128l384 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 160c-8.8 0-16-7.2-16-16s7.2-16 16-16z\"]\n};\nvar faCircleCheck = {\n  prefix: 'fas',\n  iconName: 'circle-check',\n  icon: [512, 512, [61533, \"check-circle\"], \"f058\", \"M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zM374 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8L379.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z\"]\n};\nvar faCheckCircle = faCircleCheck;\nvar faScorpio = {\n  prefix: 'fas',\n  iconName: 'scorpio',\n  icon: [640, 512, [], \"e84e\", \"M368 32c61.9 0 112 50.1 112 112l0 289.7c0 7.9 6.4 14.3 14.3 14.3 3.9 0 7.6-1.6 10.2-4.3l40.1-41.1-9.7-9.7c-6.9-6.9-8.9-17.2-5.2-26.2S542.3 352 552 352l64 0 2.5 .1c12.1 1.2 21.5 11.5 21.5 23.9l0 64-.3 3.6c-1.2 8.2-6.7 15.3-14.5 18.6-9 3.7-19.3 1.6-26.2-5.2l-9.1-9.1-39.6 40.6c-14.7 15.1-34.9 23.6-56 23.6-43.3 0-78.3-35.1-78.3-78.3L416 144c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 304c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-304c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 304c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-320c0-16.6-12.6-30.2-28.7-31.8l-6.6-.3C44.6 94.2 32 80.6 32 64 32 46.3 46.3 32 64 32 91 32 115.3 43.1 132.7 61 152.6 43 179 32 208 32 239.3 32 267.7 44.9 288 65.7 308.3 44.9 336.6 32 368 32z\"]\n};\nvar faIdCardClip = {\n  prefix: 'fas',\n  iconName: 'id-card-clip',\n  icon: [576, 512, [\"id-card-alt\"], \"f47f\", \"M256-32l64 0c17.7 0 32 14.3 32 32l0 64-128 0 0-64c0-17.7 14.3-32 32-32zM64 32l112 0 0 32c0 26.5 21.5 48 48 48l128 0c26.5 0 48-21.5 48-48l0-32 112 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32zM176 400c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16 0-44.2-35.8-80-80-80l-64 0c-44.2 0-80 35.8-80 80zM288 280a56 56 0 1 0 0-112 56 56 0 1 0 0 112z\"]\n};\nvar faIdCardAlt = faIdCardClip;\nvar faMoon = {\n  prefix: 'fas',\n  iconName: 'moon',\n  icon: [512, 512, [127769, 9214], \"f186\", \"M256 0C114.6 0 0 114.6 0 256S114.6 512 256 512c68.8 0 131.3-27.2 177.3-71.4 7.3-7 9.4-17.9 5.3-27.1s-13.7-14.9-23.8-14.1c-4.9 .4-9.8 .6-14.8 .6-101.6 0-184-82.4-184-184 0-72.1 41.5-134.6 102.1-164.8 9.1-4.5 14.3-14.3 13.1-24.4S322.6 8.5 312.7 6.3C294.4 2.2 275.4 0 256 0z\"]\n};\nvar faOilWell = {\n  prefix: 'fas',\n  iconName: 'oil-well',\n  icon: [576, 512, [], \"e532\", \"M528.3 61.3c-11.4-42.7-55.3-68-98-56.6L414.9 8.8C397.8 13.4 387.7 31 392.3 48l24.5 91.4-108.2 28.1-6.3-18.1C297.7 136.6 285.6 128 272 128s-25.7 8.6-30.2 21.4l-13.6 39-132.2 34.3 0-38.6c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 264-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-137.3 0-61.4-175.4-62.2 16.1 22.1 63.2-66.6 0 19.9-56.9-74.6 19.3-46.7 133.5-41.3 0 0-159.2 337.4-87.5 25.2 94c4.6 17.1 22.1 27.2 39.2 22.6l15.5-4.1c42.7-11.4 68-55.3 56.6-98L528.3 61.3zM205.1 448l16.8-48 100.2 0 16.8 48-133.8 0z\"]\n};\nvar faTachographDigital = {\n  prefix: 'fas',\n  iconName: 'tachograph-digital',\n  icon: [576, 512, [\"digital-tachograph\"], \"f566\", \"M0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zm64 32l0 32c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32L96 128c-17.7 0-32 14.3-32 32zM88 352c-13.3 0-24 10.7-24 24s10.7 24 24 24l136 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 352zm256 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zM496 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM88 312a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm104-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm56 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faDigitalTachograph = faTachographDigital;\nvar faTablet = {\n  prefix: 'fas',\n  iconName: 'tablet',\n  icon: [448, 512, [\"tablet-android\"], \"f3fb\", \"M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM184 400l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faTabletAndroid = faTablet;\nvar faRubleSign = {\n  prefix: 'fas',\n  iconName: 'ruble-sign',\n  icon: [448, 512, [8381, \"rouble\", \"rub\", \"ruble\"], \"f158\", \"M112 32C94.3 32 80 46.3 80 64l0 208-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 48-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 152 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-152 0 0-48 112 0c79.5 0 144-64.5 144-144S335.5 32 256 32L112 32zM256 256l-112 0 0-160 112 0c44.2 0 80 35.8 80 80s-35.8 80-80 80z\"]\n};\nvar faRouble = faRubleSign;\nvar faRub = faRubleSign;\nvar faRuble = faRubleSign;\nvar faClosedCaptioning = {\n  prefix: 'fas',\n  iconName: 'closed-captioning',\n  icon: [512, 512, [], \"f20a\", \"M0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zm152 80l32 0c4.4 0 8 3.6 8 8 0 13.3 10.7 24 24 24s24-10.7 24-24c0-30.9-25.1-56-56-56l-32 0c-30.9 0-56 25.1-56 56l0 80c0 30.9 25.1 56 56 56l32 0c30.9 0 56-25.1 56-56 0-13.3-10.7-24-24-24s-24 10.7-24 24c0 4.4-3.6 8-8 8l-32 0c-4.4 0-8-3.6-8-8l0-80c0-4.4 3.6-8 8-8zm168 8c0-4.4 3.6-8 8-8l32 0c4.4 0 8 3.6 8 8 0 13.3 10.7 24 24 24s24-10.7 24-24c0-30.9-25.1-56-56-56l-32 0c-30.9 0-56 25.1-56 56l0 80c0 30.9 25.1 56 56 56l32 0c30.9 0 56-25.1 56-56 0-13.3-10.7-24-24-24s-24 10.7-24 24c0 4.4-3.6 8-8 8l-32 0c-4.4 0-8-3.6-8-8l0-80z\"]\n};\nvar faPen = {\n  prefix: 'fas',\n  iconName: 'pen',\n  icon: [512, 512, [128394], \"f304\", \"M352.9 21.2L308 66.1 445.9 204 490.8 159.1C504.4 145.6 512 127.2 512 108s-7.6-37.6-21.2-51.1L455.1 21.2C441.6 7.6 423.2 0 404 0s-37.6 7.6-51.1 21.2zM274.1 100L58.9 315.1c-10.7 10.7-18.5 24.1-22.6 38.7L.9 481.6c-2.3 8.3 0 17.3 6.2 23.4s15.1 8.5 23.4 6.2l127.8-35.5c14.6-4.1 27.9-11.8 38.7-22.6L412 237.9 274.1 100z\"]\n};\nvar faPlane = {\n  prefix: 'fas',\n  iconName: 'plane',\n  icon: [576, 512, [], \"f072\", \"M520 200c30.9 0 56 25.1 56 56s-25.1 56-56 56l-127.3 0-159.2 173.6c-6.1 6.6-14.6 10.4-23.6 10.4l-43.7 0c-10.9 0-18.6-10.7-15.2-21.1l54.3-162.9-99.7 0-52.8 66c-3 3.8-7.6 6-12.5 6l-19.8 0c-10.4 0-18-9.8-15.5-19.9L32 256 5 147.9C2.4 137.8 10.1 128 20.5 128l19.8 0c4.9 0 9.5 2.2 12.5 6l52.8 66 99.7 0-54.3-162.9C147.6 26.7 155.3 16 166.2 16l43.7 0c9 0 17.5 3.8 23.6 10.4L392.7 200 520 200z\"]\n};\nvar faImages = {\n  prefix: 'fas',\n  iconName: 'images',\n  icon: [576, 512, [], \"f302\", \"M96 96c0-35.3 28.7-64 64-64l320 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64L96 96zM24 128c13.3 0 24 10.7 24 24l0 296c0 8.8 7.2 16 16 16l360 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L64 512c-35.3 0-64-28.7-64-64L0 152c0-13.3 10.7-24 24-24zm168 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm196.5 11.5c-4.4-7.1-12.1-11.5-20.5-11.5s-16.1 4.4-20.5 11.5l-56.3 92.1-24.5-30.6c-4.6-5.7-11.4-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4S174.8 352 184 352l272 0c8.7 0 16.7-4.7 20.9-12.3s4.1-16.8-.5-24.3l-88-144z\"]\n};\nvar faMobileScreen = {\n  prefix: 'fas',\n  iconName: 'mobile-screen',\n  icon: [384, 512, [\"mobile-android-alt\"], \"f3cf\", \"M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM128 440c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0c-13.3 0-24 10.7-24 24zM304 64l-224 0 0 304 224 0 0-304z\"]\n};\nvar faMobileAndroidAlt = faMobileScreen;\nvar faGuaraniSign = {\n  prefix: 'fas',\n  iconName: 'guarani-sign',\n  icon: [384, 512, [], \"e19a\", \"M192 0c-13.3 0-24 10.7-24 24l0 41.5C73.3 77.3 0 158.1 0 256S73.3 434.7 168 446.5l0 41.5c0 13.3 10.7 24 24 24s24-10.7 24-24l0-41.5c94.7-11.8 168-92.6 168-190.5 0-17.7-14.3-32-32-32l-136 0 0-93.8c25.3 4.8 47.9 17 65.6 34.3 12.6 12.4 32.9 12.2 45.3-.4s12.2-32.9-.5-45.3C297.2 90.2 258.8 70.8 216 65.5L216 24c0-13.3-10.7-24-24-24zM168 130.2l0 251.5C108.8 370.5 64 318.5 64 256s44.8-114.5 104-125.8zm48 251.5l0-93.8 100 0c-12.3 47.6-51.2 84.5-100 93.8z\"]\n};\nvar faBagShopping = {\n  prefix: 'fas',\n  iconName: 'bag-shopping',\n  icon: [448, 512, [\"shopping-bag\"], \"f290\", \"M160 80c0-35.3 28.7-64 64-64s64 28.7 64 64l0 48-128 0 0-48zm-48 48l-64 0c-26.5 0-48 21.5-48 48L0 384c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-208c0-26.5-21.5-48-48-48l-64 0 0-48c0-61.9-50.1-112-112-112S112 18.1 112 80l0 48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faShoppingBag = faBagShopping;\nvar faCircleRight = {\n  prefix: 'fas',\n  iconName: 'circle-right',\n  icon: [512, 512, [61838, \"arrow-alt-circle-right\"], \"f35a\", \"M0 256a256 256 0 1 0 512 0 256 256 0 1 0 -512 0zm387.3 11.3l-104 104c-4.6 4.6-11.5 5.9-17.4 3.5S256 366.5 256 360l0-56-96 0c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32l96 0 0-56c0-6.5 3.9-12.3 9.9-14.8s12.9-1.1 17.4 3.5l104 104c6.2 6.2 6.2 16.4 0 22.6z\"]\n};\nvar faArrowAltCircleRight = faCircleRight;\nvar faPhoneVolume = {\n  prefix: 'fas',\n  iconName: 'phone-volume',\n  icon: [576, 512, [\"volume-control-phone\"], \"f2a0\", \"M344-32c128.1 0 232 103.9 232 232 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM320 88c0-13.3 10.7-24 24-24 75.1 0 136 60.9 136 136 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88-13.3 0-24-10.7-24-24zM144.1 1.4c19.7-5.4 40.3 4.7 48.1 23.5l40.5 97.3c6.9 16.5 2.1 35.6-11.8 47l-44.1 36.1c32.5 71.6 89 130 159.3 164.9L374.7 323c11.3-13.9 30.4-18.6 47-11.8L519 351.8c18.8 7.8 28.9 28.4 23.5 48.1l-1.5 5.5C523.4 470.1 460.9 525.3 384.6 509.2 209.6 472.1 71.9 334.4 34.8 159.4 18.7 83.1 73.9 20.6 138.5 2.9l5.5-1.5z\"]\n};\nvar faVolumeControlPhone = faPhoneVolume;\nvar faCubes = {\n  prefix: 'fas',\n  iconName: 'cubes',\n  icon: [512, 512, [], \"f1b3\", \"M284-1.3c-17.3-10-38.7-10-56 0L143.8 47.3c-17.3 10-28 28.5-28 48.5l0 101.9-88.3 51c-17.3 10-28 28.5-28 48.5l0 97.3c0 20 10.7 38.5 28 48.5l84.3 48.6c17.3 10 38.7 10 56 0l88.3-51 88.3 51c17.3 10 38.7 10 56 0L484.5 443c17.3-10 28-28.5 28-48.5l0-97.3c0-20-10.7-38.5-28-48.5l-88.3-51 0-101.9c0-20-10.7-38.5-28-48.5L284-1.3zM232 292.6l0 106.5-88.3 51c-1.2 .7-2.6 1.1-4 1.1l0-105.3 92.3-53.3zm231.4 .6c.7 1.2 1.1 2.6 1.1 4l0 97.3c0 2.9-1.5 5.5-4 6.9l-84.3 48.6c-1.2 .7-2.6 1.1-4 1.1l0-105.3 91.2-52.6zM348.3 95.8l0 101.9-92.3 53.3 0-106.5 91.2-52.6c.7 1.2 1.1 2.6 1.1 4z\"]\n};\nvar faPhone = {\n  prefix: 'fas',\n  iconName: 'phone',\n  icon: [512, 512, [128222, 128379], \"f095\", \"M160.2 25C152.3 6.1 131.7-3.9 112.1 1.4l-5.5 1.5c-64.6 17.6-119.8 80.2-103.7 156.4 37.1 175 174.8 312.7 349.8 349.8 76.3 16.2 138.8-39.1 156.4-103.7l1.5-5.5c5.4-19.7-4.7-40.3-23.5-48.1l-97.3-40.5c-16.5-6.9-35.6-2.1-47 11.8l-38.6 47.2C233.9 335.4 177.3 277 144.8 205.3L189 169.3c13.9-11.3 18.6-30.4 11.8-47L160.2 25z\"]\n};\nvar faToriiGate = {\n  prefix: 'fas',\n  iconName: 'torii-gate',\n  icon: [448, 512, [9961], \"f6a1\", \"M0 96L0 28.5C0 21.6 5.6 16 12.5 16 14.8 16 17 16.6 19 17.8L58 41.2C82.9 56.1 111.3 64 140.3 64l167.4 0c29 0 57.5-7.9 82.3-22.8l39-23.4c1.9-1.2 4.2-1.8 6.4-1.8 6.9 0 12.5 5.6 12.5 12.5L448 96c0 35.3-28.7 64-64 64l0 64 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 192c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-192-192 0 0 192c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-192-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-64C28.7 160 0 131.3 0 96zM128 224l64 0 0-64-64 0 0 64zm128 0l64 0 0-64-64 0 0 64z\"]\n};\nvar faBacon = {\n  prefix: 'fas',\n  iconName: 'bacon',\n  icon: [576, 512, [129363], \"f7e5\", \"M557 96.7c14.4 14.4 12.4 38.4-4.3 50.2l-64.6 45.7c-43.7 30.9-79.2 71.9-103.4 119.6l-25.3 49.8c-25.1 49.3-62.1 91.5-107.8 122.6l-74.1 50.6c-13.1 8.9-30.7 7.3-41.8-3.9l-44.9-44.9 86.5-66.5c42.3-32.5 76.7-74.3 100.6-122l24.5-49.1c24.5-49 61.8-90.6 107.9-120.2l108.7-69.9 38 38zM484.2 23.9L384.3 88.2c-53.4 34.3-96.5 82.4-124.9 139.1l-24.5 49.1c-20.6 41.3-50.3 77.3-86.9 105.4l-91.4 70.3-36.9-36.9c-14.4-14.4-12.4-38.4 4.3-50.2l64.6-45.7c43.7-30.9 79.2-71.9 103.4-119.6l25.3-49.8C242.3 100.8 279.3 58.6 325 27.4l74.1-50.6c13.1-8.9 30.6-7.3 41.8 3.9l43.3 43.3z\"]\n};\nvar faPersonFallingBurst = {\n  prefix: 'fas',\n  iconName: 'person-falling-burst',\n  icon: [576, 512, [], \"e547\", \"M256 0c17.7 0 32 14.3 32 32l0 5.4c0 55.2-23.7 107-63.9 143.1l62.9 75.5 89 0c15.1 0 29.3 7.1 38.4 19.2l43.2 57.6c10.6 14.1 7.7 34.2-6.4 44.8s-34.2 7.7-44.8-6.4L368 320 263.2 320 376.8 459.8c11.1 13.7 9.1 33.9-4.7 45s-33.9 9.1-45-4.7L137.4 266.6c-6.1 15-9.4 31.3-9.4 48l0 69.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-69.4c0-67.4 35.4-129.9 93.2-164.6l4.6-2.8C200.4 124 224 82.4 224 37.4l0-5.4c0-17.7 14.3-32 32-32zM16 88A56 56 0 1 1 128 88 56 56 0 1 1 16 88zm376-7.9c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24l0 48zm104 152c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0zm-54.5-97.5c-9.4-9.4-9.4-24.6 0-33.9l33.9-33.9c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-33.9 33.9c-9.4 9.4-24.6 9.4-33.9 0z\"]\n};\nvar faQuoteRight = {\n  prefix: 'fas',\n  iconName: 'quote-right',\n  icon: [448, 512, [8221, \"quote-right-alt\"], \"f10e\", \"M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 136zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 136z\"]\n};\nvar faQuoteRightAlt = faQuoteRight;\nvar faHouseMedicalFlag = {\n  prefix: 'fas',\n  iconName: 'house-medical-flag',\n  icon: [640, 512, [], \"e514\", \"M480 0c17.7 0 32 14.3 32 32l96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-96 0 0 288c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-448c0-17.7 14.3-32 32-32zM267.5 59.1L400 186.9 400 503.4c-9.4 5.4-20.3 8.6-32 8.6l-256 0c-35.3 0-64-28.7-64-64l0-144-19.9 0C12.6 304 0 291.4 0 275.9 0 268.3 3.1 261 8.6 255.7L212.5 59.1C219.9 52 229.7 48 240 48s20.1 4 27.5 11.1zM204.8 256.8l0 44-44 0c-9.7 0-17.6 7.9-17.6 17.6l0 35.2c0 9.7 7.9 17.6 17.6 17.6l44 0 0 44c0 9.7 7.9 17.6 17.6 17.6l35.2 0c9.7 0 17.6-7.9 17.6-17.6l0-44 44 0c9.7 0 17.6-7.9 17.6-17.6l0-35.2c0-9.7-7.9-17.6-17.6-17.6l-44 0 0-44c0-9.7-7.9-17.6-17.6-17.6l-35.2 0c-9.7 0-17.6 7.9-17.6 17.6z\"]\n};\nvar faPrescription = {\n  prefix: 'fas',\n  iconName: 'prescription',\n  icon: [448, 512, [], \"f5b1\", \"M32 0C14.3 0 0 14.3 0 32L0 288c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 50.7 0 128 128-105.4 105.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L288 397.3 393.4 502.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L333.3 352 438.6 246.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 306.7 202.2 220.9C251.4 209.1 288 164.8 288 112 288 50.1 237.9 0 176 0L32 0zM176 160l-112 0 0-96 112 0c26.5 0 48 21.5 48 48s-21.5 48-48 48z\"]\n};\nvar faDiceThree = {\n  prefix: 'fas',\n  iconName: 'dice-three',\n  icon: [448, 512, [9858], \"f527\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm128 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faBuildingLock = {\n  prefix: 'fas',\n  iconName: 'building-lock',\n  icon: [576, 512, [], \"e4d6\", \"M32 64C32 28.7 60.7 0 96 0L352 0c35.3 0 64 28.7 64 64l0 121.3c-46.9 19-80 65-80 118.7l0 24.4c-19.6 17.6-32 43.1-32 71.5l0 96c0 5.5 .5 10.9 1.3 16.1L96 512c-35.3 0-64-28.7-64-64L32 64zM176 384l0 80 80 0 0-64.1c0-13.7 1.9-27 5.5-39.6-5.7-5.2-13.2-8.3-21.5-8.3l-32 0c-17.7 0-32 14.3-32 32zM307 224.3c-1-.2-2-.3-3-.3l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l16.7 0c2.1-22.8 8.4-44.3 18.3-63.7zM144 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM144 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm352 80.1c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0 0-47.9zM352 400c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96z\"]\n};\nvar faIdCard = {\n  prefix: 'fas',\n  iconName: 'id-card',\n  icon: [576, 512, [62147, \"drivers-license\"], \"f2c2\", \"M0 96C0 60.7 28.7 32 64 32l448 0c35.3 0 64 28.7 64 64L0 96zm0 48l576 0 0 272c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 144zM247.3 416c20.2 0 35.3-19.4 22.4-35-14.7-17.7-36.9-29-61.7-29l-64 0c-24.8 0-47 11.3-61.7 29-12.9 15.6 2.2 35 22.4 35l142.5 0zM176 312a56 56 0 1 0 0-112 56 56 0 1 0 0 112zM360 208c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0z\"]\n};\nvar faDriversLicense = faIdCard;\nvar faCirclePlay = {\n  prefix: 'fas',\n  iconName: 'circle-play',\n  icon: [512, 512, [61469, \"play-circle\"], \"f144\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z\"]\n};\nvar faPlayCircle = faCirclePlay;\nvar faFaceLaughBeam = {\n  prefix: 'fas',\n  iconName: 'face-laugh-beam',\n  icon: [512, 512, [128513, \"laugh-beam\"], \"f59a\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM101.6 314c-3.7-13.7 7.5-26 21.7-26l265.4 0c14.2 0 25.4 12.3 21.7 26-18.5 68-80.6 118-154.4 118S120 382 101.6 314zM176 164c-15.5 0-28 12.5-28 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28zm132 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28s-28 12.5-28 28z\"]\n};\nvar faLaughBeam = faFaceLaughBeam;\nvar faLeaf = {\n  prefix: 'fas',\n  iconName: 'leaf',\n  icon: [512, 512, [], \"f06c\", \"M471.3 6.7C477.7 .6 487-1.6 495.6 1.2 505.4 4.5 512 13.7 512 24l0 186.9c0 131.2-108.1 237.1-238.8 237.1-77 0-143.4-49.5-167.5-118.7-35.4 30.8-57.7 76.1-57.7 126.7 0 13.3-10.7 24-24 24S0 469.3 0 456C0 381.1 38.2 315.1 96.1 276.3 131.4 252.7 173.5 240 216 240l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0c-39.7 0-77.3 8.8-111 24.5 23.3-70 89.2-120.5 167-120.5 66.4 0 115.8-22.1 148.7-44 19.2-12.8 35.5-28.1 50.7-45.3z\"]\n};\nvar faHouseChimneyUser = {\n  prefix: 'fas',\n  iconName: 'house-chimney-user',\n  icon: [512, 512, [], \"e065\", \"M234.2 8.6c12.3-11.4 31.3-11.4 43.5 0L368 92.3 368 80c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 101.5 37.8 35.1c9.6 9 12.8 22.9 8 35.1S493.2 272 480 272l-16 0 0 176c0 35.3-28.7 64-64 64l-288 0c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208zM312 256a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zM144 432c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16 0-44.2-35.8-80-80-80l-64 0c-44.2 0-80 35.8-80 80z\"]\n};\nvar faRotateRight = {\n  prefix: 'fas',\n  iconName: 'rotate-right',\n  icon: [512, 512, [\"redo-alt\", \"rotate-forward\"], \"f2f9\", \"M488 192l-144 0c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l46.7-46.7c-75.3-58.6-184.3-53.3-253.5 15.9-75 75-75 196.5 0 271.5s196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c94.3-94.3 243.7-99.6 344.3-16.2L471 7c6.9-6.9 17.2-8.9 26.2-5.2S512 14.3 512 24l0 144c0 13.3-10.7 24-24 24z\"]\n};\nvar faRedoAlt = faRotateRight;\nvar faRotateForward = faRotateRight;\nvar faTooth = {\n  prefix: 'fas',\n  iconName: 'tooth',\n  icon: [448, 512, [129463], \"f5c9\", \"M145 5.7L224 32 303 5.7C314.3 1.9 326 0 337.9 0 398.7 0 448 49.3 448 110.1l0 68.5c0 29.4-9.5 58.1-27.2 81.6l-1.1 1.5c-12.9 17.2-21.3 37.4-24.3 58.7L373.7 471.9c-3.3 23-23 40.1-46.2 40.1-22.8 0-42.3-16.5-46-39L261.3 351.6c-3-18.2-18.8-31.6-37.3-31.6s-34.2 13.4-37.3 31.6L166.5 473c-3.8 22.5-23.2 39-46 39-23.2 0-42.9-17.1-46.2-40.1L52.6 320.5c-3-21.3-11.4-41.5-24.3-58.7l-1.1-1.5C9.5 236.7 0 208.1 0 178.7l0-68.5C0 49.3 49.3 0 110.1 0 122 0 133.7 1.9 145 5.7z\"]\n};\nvar faHouseChimneyWindow = {\n  prefix: 'fas',\n  iconName: 'house-chimney-window',\n  icon: [512, 512, [], \"e00d\", \"M234.2 8.6c12.3-11.4 31.3-11.4 43.5 0L368 92.3 368 80c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 101.5 37.8 35.1c9.6 9 12.8 22.9 8 35.1S493.2 272 480 272l-16 0 0 176c0 35.3-28.7 64-64 64l-288 0c-35.3 0-64-28.7-64-64l0-176-16 0c-13.2 0-25-8.1-29.8-20.3s-1.6-26.2 8-35.1l224-208zM216 224c-13.3 0-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-80c0-13.3-10.7-24-24-24l-80 0z\"]\n};\nvar faMotorcycle = {\n  prefix: 'fas',\n  iconName: 'motorcycle',\n  icon: [640, 512, [127949], \"f21c\", \"M280 16c-13.3 0-24 10.7-24 24s10.7 24 24 24l56.6 0 22.5 48.7-95.1 71.3c-33.4-25.1-75-40-120-40l-56 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0c78.5 0 143.2 59.6 151.2 136l-25.4 0c-11.2-59.2-63.3-104-125.8-104-70.7 0-128 57.3-128 128S73.3 480 144 480c62.5 0 114.5-44.8 125.8-104l50.2 0c13.3 0 24-10.7 24-24l0-22.5c0-45.1 25.7-85.4 65.5-107.7l12.1 26.1c-32.4 23.2-53.5 61.2-53.5 104.1 0 70.7 57.3 128 128 128s128-57.3 128-128-57.3-128-128-128c-10.7 0-21 1.3-30.9 3.8L433.8 160 488 160c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-53.3 0c-6.9 0-13.7 2.2-19.2 6.4l-17.1 12.8-24.6-53.3C369.9 21.4 361.4 16 352 16l-72 0zM445.8 300.4l28.4 61.6c5.6 12 19.8 17.3 31.8 11.7s17.3-19.8 11.7-31.8l-28.5-61.6c2.2-.2 4.4-.3 6.7-.3 39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72c0-20.2 8.3-38.5 21.8-51.6zM144 424c-39.8 0-72-32.2-72-72s32.2-72 72-72c31.3 0 58 20 67.9 48L144 328c-13.3 0-24 10.7-24 24s10.7 24 24 24l67.9 0c-9.9 28-36.6 48-67.9 48z\"]\n};\nvar faBackwardFast = {\n  prefix: 'fas',\n  iconName: 'backward-fast',\n  icon: [512, 512, [9198, \"fast-backward\"], \"f049\", \"M492.2 477.6c-12 5-25.7 2.2-34.9-6.9L288 301.3 288 448c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9L64 301.3 64 448c0 17.7-14.3 32-32 32S0 465.7 0 448L0 64C0 46.3 14.3 32 32 32S64 46.3 64 64L64 210.7 233.4 41.4c9.2-9.2 22.9-11.9 34.9-6.9S288 51.1 288 64l0 146.7 169.4-169.4c9.2-9.2 22.9-11.9 34.9-6.9S512 51.1 512 64l0 384c0 12.9-7.8 24.6-19.8 29.6z\"]\n};\nvar faFastBackward = faBackwardFast;\nvar faAddressBook = {\n  prefix: 'fas',\n  iconName: 'address-book',\n  icon: [512, 512, [62138, \"contact-book\"], \"f2b9\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L96 0zM208 288l64 0c44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16 0-44.2 35.8-80 80-80zm-24-96a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM512 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64zm0 128c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64zM496 320c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64c0-8.8-7.2-16-16-16z\"]\n};\nvar faContactBook = faAddressBook;\nvar faSailboat = {\n  prefix: 'fas',\n  iconName: 'sailboat',\n  icon: [512, 512, [], \"e445\", \"M240 35.9l0 348.1-224 0c-8.8 0-16 7.2-16 16 0 61.9 50.1 112 112 112l288 0c61.9 0 112-50.1 112-112 0-8.8-7.2-16-16-16l-208 0 0-48 161.7 0c12.9 0 20.5-14.4 13.2-25L269.2 26.9c-8.9-13-29.2-6.7-29.2 9zM192 320l0-184.2c0-16.1-21-22.1-29.6-8.5L47.3 311.5c-6.7 10.7 1 24.5 13.6 24.5L176 336c8.8 0 16-7.2 16-16z\"]\n};\nvar faBookBookmark = {\n  prefix: 'fas',\n  iconName: 'book-bookmark',\n  icon: [448, 512, [], \"e0bb\", \"M96 512l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-66.7c18.6-6.6 32-24.4 32-45.3l0-288c0-26.5-21.5-48-48-48l-48 0 0 169.4c0 12.5-10.1 22.6-22.6 22.6-6 0-11.8-2.4-16-6.6L272 144 230.6 185.4c-4.2 4.2-10 6.6-16 6.6-12.5 0-22.6-10.1-22.6-22.6L192 0 96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96zM64 416c0-17.7 14.3-32 32-32l256 0 0 64-256 0c-17.7 0-32-14.3-32-32z\"]\n};\nvar faMagnifyingGlassArrowRight = {\n  prefix: 'fas',\n  iconName: 'magnifying-glass-arrow-right',\n  icon: [512, 512, [], \"e521\", \"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM305 225c9.4-9.4 9.4-24.6 0-33.9l-72-72c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-102.1 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l102.1 0-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72z\"]\n};\nvar faMicrophoneLines = {\n  prefix: 'fas',\n  iconName: 'microphone-lines',\n  icon: [384, 512, [127897, \"microphone-alt\"], \"f3c9\", \"M96 96c0-53 43-96 96-96 50.3 0 91.6 38.7 95.7 88L232 88c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0 0 48-56 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l55.7 0c-4.1 49.3-45.3 88-95.7 88-53 0-96-43-96-96L96 96zM24 160c13.3 0 24 10.7 24 24l0 40c0 79.5 64.5 144 144 144s144-64.5 144-144l0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40c0 97.9-73.3 178.7-168 190.5l0 49.5 48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0 0-49.5C73.3 402.7 0 321.9 0 224l0-40c0-13.3 10.7-24 24-24z\"]\n};\nvar faMicrophoneAlt = faMicrophoneLines;\nvar faReplyAll = {\n  prefix: 'fas',\n  iconName: 'reply-all',\n  icon: [576, 512, [\"mail-reply-all\"], \"f122\", \"M332.2 18.4c12 5 19.8 16.6 19.8 29.6l0 80 48 0c97.2 0 176 78.8 176 176 0 113.3-81.5 163.9-100.2 174.1-2.5 1.4-5.3 1.9-8.1 1.9-10.9 0-19.7-8.9-19.7-19.7 0-7.5 4.3-14.4 9.8-19.5 9.4-8.8 22.2-26.4 22.2-56.7 0-53-43-96-96-96l-32 0 0 80c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-160-160c-12.5-12.5-12.5-32.8 0-45.3l160-160c9.2-9.2 22.9-11.9 34.9-6.9zM205.6 23.1c9.4 9.4 9.4 24.6 0 33.9L54.6 208 205.6 358.9c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L10 231.2c-6.4-6-10-14.4-10-23.2s3.6-17.2 10-23.2L171.6 23.1c9.4-9.4 24.6-9.4 33.9 0z\"]\n};\nvar faMailReplyAll = faReplyAll;\nvar faUniversalAccess = {\n  prefix: 'fas',\n  iconName: 'universal-access',\n  icon: [512, 512, [], \"f29a\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm161.5-86.1c-12.2-5.2-26.3 .4-31.5 12.6s.4 26.3 12.6 31.5l11.9 5.1c17.3 7.4 35.2 12.9 53.6 16.3l0 50.1c0 4.3-.7 8.6-2.1 12.6l-28.7 86.1c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l24.4-73.2c1.3-3.8 4.8-6.4 8.8-6.4s7.6 2.6 8.8 6.4l24.4 73.2c4.2 12.6 17.8 19.4 30.4 15.2S339 397 334.8 384.4l-28.7-86.1c-1.4-4.1-2.1-8.3-2.1-12.6l0-50.1c18.4-3.5 36.3-8.9 53.6-16.3l11.9-5.1c12.2-5.2 17.8-19.3 12.6-31.5s-19.3-17.8-31.5-12.6L338.7 175c-26.1 11.2-54.2 17-82.7 17s-56.5-5.8-82.7-17l-11.9-5.1zM256 160a40 40 0 1 0 0-80 40 40 0 1 0 0 80z\"]\n};\nvar faToiletPaper = {\n  prefix: 'fas',\n  iconName: 'toilet-paper',\n  icon: [512, 512, [129531, 63263, \"toilet-paper-alt\", \"toilet-paper-blank\"], \"f71e\", \"M327.1 32c-8.8 11.1-16 23.1-21.9 34.8-21.4 42.7-33.2 98.4-33.2 157.2l0 264c0 30.9-25.1 56-56 56L56 544c-30.9 0-56-25.1-56-56L0 224C0 118 43 32 96 32l231.1 0zM416 416c-53 0-96-86-96-192s43-192 96-192 96 86 96 192-43 192-96 192zm0-128c17.7 0 32-28.7 32-64s-14.3-64-32-64-32 28.7-32 64 14.3 64 32 64z\"]\n};\nvar faToiletPaperAlt = faToiletPaper;\nvar faToiletPaperBlank = faToiletPaper;\nvar faVrCardboard = {\n  prefix: 'fas',\n  iconName: 'vr-cardboard',\n  icon: [576, 512, [], \"f729\", \"M512 96L64 96C28.7 96 0 124.7 0 160L0 352c0 35.3 28.7 64 64 64l117.5 0c17 0 33.3-6.7 45.3-18.7l33.9-33.9c7.2-7.2 17.1-11.3 27.3-11.3s20.1 4.1 27.3 11.3l33.9 33.9c12 12 28.3 18.7 45.3 18.7L512 416c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64zM80 240a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm352-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z\"]\n};\nvar faPizzaSlice = {\n  prefix: 'fas',\n  iconName: 'pizza-slice',\n  icon: [512, 512, [], \"f818\", \"M169.7 .9c-22.8-1.6-41.9 14-47.5 34.7L112.5 72C293.3 72.3 439.7 218.7 440 399.5l36.4-9.7c20.8-5.5 36.3-24.7 34.7-47.5-12.6-182.8-158.6-328.8-341.4-341.4zm222 411.5c.2-4.1 .3-8.2 .3-12.4 0-154.6-125.4-280-280-280-4.1 0-8.3 .1-12.4 .3L.5 491.9c-1.5 5.5 .1 11.4 4.1 15.4s9.9 5.6 15.4 4.1l371.6-99.1zM176 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM96 384a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faSprayCan = {\n  prefix: 'fas',\n  iconName: 'spray-can',\n  icon: [576, 512, [], \"f5bd\", \"M192 0l64 0c17.7 0 32 14.3 32 32l0 80-128 0 0-80c0-17.7 14.3-32 32-32zM64 256c0-53 43-96 96-96l128 0c53 0 96 43 96 96l0 208c0 26.5-21.5 48-48 48l-224 0c-26.5 0-48-21.5-48-48l0-208zm240 80a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM320 64a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM448 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm64 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM512 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM448 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faVolumeLow = {\n  prefix: 'fas',\n  iconName: 'volume-low',\n  icon: [448, 512, [128264, \"volume-down\"], \"f027\", \"M48 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L96 160 48 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48zM380.6 181.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C361.1 227.6 368 241 368 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C402.1 312.9 416 286.1 416 256s-13.9-56.9-35.5-74.5z\"]\n};\nvar faVolumeDown = faVolumeLow;\nvar faCross = {\n  prefix: 'fas',\n  iconName: 'cross',\n  icon: [384, 512, [128327, 10013], \"f654\", \"M176 0c-26.5 0-48 21.5-48 48l0 80-80 0c-26.5 0-48 21.5-48 48l0 32c0 26.5 21.5 48 48 48l80 0 0 208c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-208 80 0c26.5 0 48-21.5 48-48l0-32c0-26.5-21.5-48-48-48l-80 0 0-80c0-26.5-21.5-48-48-48L176 0z\"]\n};\nvar faPerson = {\n  prefix: 'fas',\n  iconName: 'person',\n  icon: [384, 512, [129485, \"male\"], \"f183\", \"M248 24a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zm24 212.7l46.3 62.4c10.5 14.2 30.6 17.2 44.8 6.6s17.2-30.6 6.6-44.8l-70.5-95C274 132 234.3 112 192 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6L112 236.7 112 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-275.3z\"]\n};\nvar faMale = faPerson;\nvar faHourglass = {\n  prefix: 'fas',\n  iconName: 'hourglass',\n  icon: [384, 512, [9203, 62032, \"hourglass-empty\"], \"f254\", \"M0 32C0 14.3 14.3 0 32 0L352 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 11c0 42.4-16.9 83.1-46.9 113.1l-67.9 67.9 67.9 67.9c30 30 46.9 70.7 46.9 113.1l0 11c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-11c0-42.4 16.9-83.1 46.9-113.1l67.9-67.9-67.9-67.9C48.9 158.1 32 117.4 32 75l0-11C14.3 64 0 49.7 0 32zM96 64l0 11c0 25.5 10.1 49.9 28.1 67.9l67.9 67.9 67.9-67.9c18-18 28.1-42.4 28.1-67.9l0-11-192 0zm0 384l192 0 0-11c0-25.5-10.1-49.9-28.1-67.9l-67.9-67.9-67.9 67.9c-18 18-28.1 42.4-28.1 67.9l0 11z\"]\n};\nvar faHourglassEmpty = faHourglass;\nvar faFish = {\n  prefix: 'fas',\n  iconName: 'fish',\n  icon: [576, 512, [128031], \"f578\", \"M180.5 141.5C219.7 108.5 272.6 80 336 80s116.3 28.5 155.5 61.5c39.1 33 66.9 72.4 81 99.8 4.7 9.2 4.7 20.1 0 29.3-14.1 27.4-41.9 66.8-81 99.8-39.2 33.1-92 61.5-155.5 61.5s-116.3-28.5-155.5-61.5c-16.2-13.7-30.5-28.5-42.7-43.1L48.1 379.6c-12.5 7.3-28.4 5.3-38.7-4.9s-12.4-26-5.3-38.6L50 256 4.2 175.9c-7.2-12.6-5-28.4 5.3-38.6s26.1-12.2 38.7-4.9l89.7 52.3c12.2-14.6 26.5-29.4 42.7-43.1zM448 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\"]\n};\nvar faDrumstickBite = {\n  prefix: 'fas',\n  iconName: 'drumstick-bite',\n  icon: [512, 512, [], \"f6d7\", \"M160 265.2c0 8.5-3.4 16.6-9.4 22.6l-26.8 26.8c-12.3 12.3-32.5 11.4-49.4 7.2-4.6-1.1-9.5-1.8-14.5-1.8-33.1 0-60 26.9-60 60s26.9 60 60 60c6.3 0 12 5.7 12 12 0 33.1 26.9 60 60 60s60-26.9 60-60c0-5-.6-9.8-1.8-14.5-4.2-16.9-5.2-37.1 7.2-49.4l26.8-26.8c6-6 14.1-9.4 22.6-9.4l89.2 0c6.3 0 12.4-.3 18.5-1 11.9-1.2 16.4-15.5 10.8-26-8.5-15.8-13.3-33.8-13.3-53 0-61.9 50.1-112 112-112 8 0 15.7 .8 23.2 2.4 11.7 2.5 24.1-5.9 22-17.6-14.7-82.3-86.7-144.8-173.2-144.8-97.2 0-176 78.8-176 176l0 89.2z\"]\n};\nvar faChartSimple = {\n  prefix: 'fas',\n  iconName: 'chart-simple',\n  icon: [512, 512, [], \"e473\", \"M192 80c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-352zM0 272c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48L0 272zM432 96l32 0c26.5 0 48 21.5 48 48l0 288c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48z\"]\n};\nvar faAtom = {\n  prefix: 'fas',\n  iconName: 'atom',\n  icon: [448, 512, [9883], \"f5d2\", \"M224 398.8c-11.8 5.1-23.4 9.7-34.9 13.5 16.7 33.8 31 35.7 34.9 35.7s18.1-1.9 34.9-35.7c-11.4-3.9-23.1-8.4-34.9-13.5zM414 256c33 45.2 44.3 90.9 23.6 128-20.2 36.3-62.5 49.3-115.2 43.2-22 52.1-55.7 84.8-98.4 84.8s-76.4-32.7-98.4-84.8C72.9 433.3 30.6 420.3 10.4 384-10.3 346.9 1 301.2 34 256 1 210.8-10.3 165.1 10.4 128 30.6 91.7 72.9 78.7 125.6 84.8 147.6 32.7 181.2 0 224 0s76.4 32.7 98.4 84.8c52.7-6.1 95 6.8 115.2 43.2 20.7 37.1 9.4 82.8-23.6 128zm-65.8 67.4c-1.7 14.2-3.9 28-6.7 41.2 31.8 1.4 38.6-8.7 40.2-11.7 2.3-4.2 7-17.9-11.9-48.1-6.8 6.3-14 12.5-21.6 18.6zm-6.7-175.9c2.8 13.1 5 26.9 6.7 41.2 7.6 6.1 14.8 12.3 21.6 18.6 18.9-30.2 14.2-44 11.9-48.1-1.6-2.9-8.4-13-40.2-11.7zM258.9 99.7C242.1 65.9 227.9 64 224 64s-18.1 1.9-34.9 35.7c11.4 3.9 23.1 8.4 34.9 13.5 11.8-5.1 23.4-9.7 34.9-13.5zm-159 88.9c1.7-14.3 3.9-28 6.7-41.2-31.8-1.4-38.6 8.7-40.2 11.7-2.3 4.2-7 17.9 11.9 48.1 6.8-6.3 14-12.5 21.6-18.6zM78.2 304.8c-18.9 30.2-14.2 44-11.9 48.1 1.6 2.9 8.4 13 40.2 11.7-2.8-13.1-5-26.9-6.7-41.2-7.6-6.1-14.8-12.3-21.6-18.6zM304 256a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zm-80-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faP = {\n  prefix: 'fas',\n  iconName: 'p',\n  icon: [320, 512, [112], \"50\", \"M0 64C0 46.3 14.3 32 32 32l128 0c88.4 0 160 71.6 160 160S248.4 352 160 352l-96 0 0 96c0 17.7-14.3 32-32 32S0 465.7 0 448L0 64zM64 288l96 0c53 0 96-43 96-96s-43-96-96-96l-96 0 0 192z\"]\n};\nvar faJetFighterUp = {\n  prefix: 'fas',\n  iconName: 'jet-fighter-up',\n  icon: [512, 512, [], \"e518\", \"M206.8 47.8C202.3 58.5 200 70 200 81.6l0 100.4-152 114 0-48c0-13.3-10.7-24-24-24S0 234.7 0 248L0 392c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8 152 0 0 54.4-66 52.8c-3.8 3-6 7.6-6 12.5l0 24.3c0 8.8 7.2 16 16 16l88 0 0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40 88 0c8.8 0 16-7.2 16-16l0-24.3c0-4.9-2.2-9.5-6-12.5l-66-52.8 0-54.4 152 0 0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-144c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 48-152-114 0-100.4c0-11.6-2.3-23.1-6.8-33.8l-27.1-65C274.4-26.2 265.7-32 256-32s-18.4 5.8-22.2 14.8l-27.1 65z\"]\n};\nvar faPlugCircleXmark = {\n  prefix: 'fas',\n  iconName: 'plug-circle-xmark',\n  icon: [640, 512, [], \"e560\", \"M192-32c17.7 0 32 14.3 32 32l0 96 128 0 0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 48.7c-98.6 8.1-176 90.7-176 191.3 0 27.3 5.7 53.3 16 76.9l0 3.1c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7C165.2 398.1 96 319.1 96 224l0-64c-17.7 0-32-14.3-32-32S78.3 96 96 96l64 0 0-96c0-17.7 14.3-32 32-32zM496 256a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-36.7 36.7-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l36.7 36.7-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l36.7-36.7 36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-36.7-36.7 36.7-36.7z\"]\n};\nvar faSheetPlastic = {\n  prefix: 'fas',\n  iconName: 'sheet-plastic',\n  icon: [384, 512, [], \"e571\", \"M0 448c0 35.3 28.7 64 64 64l149.5 0c17 0 33.3-6.7 45.3-18.7L365.3 386.7c12-12 18.7-28.3 18.7-45.3L384 64c0-35.3-28.7-64-64-64L64 0C28.7 0 0 28.7 0 64L0 448zm208 5.5l0-93.5c0-13.3 10.7-24 24-24l93.5 0-117.5 117.5zM153 105l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zm96 32L137 249c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L215 103c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z\"]\n};\nvar faV = {\n  prefix: 'fas',\n  iconName: 'v',\n  icon: [384, 512, [118], \"56\", \"M19.7 34.5c16.3-6.8 35 .9 41.8 17.2L192 364.8 322.5 51.7c6.8-16.3 25.5-24 41.8-17.2s24 25.5 17.2 41.8l-160 384c-5 11.9-16.6 19.7-29.5 19.7s-24.6-7.8-29.5-19.7L2.5 76.3c-6.8-16.3 .9-35 17.2-41.8z\"]\n};\nvar faList = {\n  prefix: 'fas',\n  iconName: 'list',\n  icon: [512, 512, [\"list-squares\"], \"f03a\", \"M40 48C26.7 48 16 58.7 16 72l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24L40 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM16 232l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0z\"]\n};\nvar faListSquares = faList;\nvar faPisces = {\n  prefix: 'fas',\n  iconName: 'pisces',\n  icon: [448, 512, [], \"e84c\", \"M40.4 10.4c11.9-13 32.2-13.9 45.2-2 2.9 2.7 28.3 26.7 53.6 67.8 22.3 36.2 45 86.6 51.1 147.8l67.3 0c6.1-61.1 28.8-111.6 51.1-147.8 25.3-41.1 50.7-65.1 53.6-67.8 13-11.9 33.3-11.1 45.2 2 11.9 13 11 33.3-2 45.2-1.4 1.3-22 21.1-42.4 54.2-17.9 29.1-35.4 68-41.2 114.2l94 0 3.3 .2c16.1 1.6 28.7 15.3 28.7 31.8s-12.6 30.2-28.7 31.8l-3.3 .2-94 0c5.8 46.2 23.3 85.1 41.2 114.2 20.4 33.1 41 52.9 42.4 54.2 13 11.9 13.9 32.2 2 45.2-11.9 13-32.2 13.9-45.2 2-2.9-2.7-28.3-26.7-53.6-67.8-22.3-36.2-45-86.6-51.1-147.8l-67.3 0c-6.1 61.1-28.8 111.6-51.1 147.8-25.3 41.1-50.7 65.1-53.6 67.8-13 11.9-33.3 11.1-45.2-2-11.9-13-11-33.3 2-45.2 1.4-1.3 22-21.1 42.4-54.2 17.9-29.1 35.4-68 41.2-114.2l-94 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l94 0c-5.8-46.2-23.3-85.1-41.2-114.2-20.4-33.1-41-52.9-42.4-54.2-13-11.9-13.9-32.2-2-45.2z\"]\n};\nvar faSolarPanel = {\n  prefix: 'fas',\n  iconName: 'solar-panel',\n  icon: [576, 512, [], \"f5ba\", \"M121.8 32c-30 0-56 20.8-62.5 50.1L9.6 306.1C.7 346.1 31.1 384 72 384l184.1 0 0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64 184.1 0c40.9 0 71.4-37.9 62.5-77.9l-49.8-224C510.4 52.8 484.5 32 454.5 32L121.8 32zM245.6 96l85.2 0 7.3 88-99.8 0 7.3-88zm-55.5 88l-87.8 0 19.6-88 75.6 0-7.3 88zM91.6 232l94.5 0-7.3 88-106.7 0 19.6-88zm142.6 0l107.8 0 7.3 88-122.5 0 7.3-88zm156 0l94.5 0 19.6 88-106.7 0-7.3-88zM474 184l-87.8 0-7.3-88 75.6 0 19.6 88z\"]\n};\nvar faLandMineOn = {\n  prefix: 'fas',\n  iconName: 'land-mine-on',\n  icon: [576, 512, [], \"e51b\", \"M312 0l0 128c0 13.3-10.7 24-24 24s-24-10.7-24-24L264 0c0-13.3 10.7-24 24-24s24 10.7 24 24zM160 288c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32l0 32 80 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48L80 512c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48l80 0 0-32zM12 114.7c7.4-11 22.3-14 33.3-6.7l96 64c11 7.4 14 22.3 6.7 33.3s-22.3 14-33.3 6.7l-96-64c-11-7.4-14-22.3-6.7-33.3zM530.7 108c11-7.4 25.9-4.4 33.3 6.7s4.4 25.9-6.7 33.3l-96 64c-11 7.4-25.9 4.4-33.3-6.7s-4.4-25.9 6.7-33.3l96-64z\"]\n};\nvar faHeadphones = {\n  prefix: 'fas',\n  iconName: 'headphones',\n  icon: [448, 512, [127911, 62863, \"headphones-alt\", \"headphones-simple\"], \"f025\", \"M64 224c0-88.4 71.6-160 160-160s160 71.6 160 160l0 37.5c-10-3.5-20.8-5.5-32-5.5l-16 0c-26.5 0-48 21.5-48 48l0 128c0 26.5 21.5 48 48 48l16 0c53 0 96-43 96-96l0-160C448 100.3 347.7 0 224 0S0 100.3 0 224L0 384c0 53 43 96 96 96l16 0c26.5 0 48-21.5 48-48l0-128c0-26.5-21.5-48-48-48l-16 0c-11.2 0-22 1.9-32 5.5L64 224z\"]\n};\nvar faHeadphonesAlt = faHeadphones;\nvar faHeadphonesSimple = faHeadphones;\nvar faBus = {\n  prefix: 'fas',\n  iconName: 'bus',\n  icon: [448, 512, [128653], \"f207\", \"M96 0C43 0 0 43 0 96L0 384c0 29.8 20.4 54.9 48 62l0 34c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-32 192 0 0 32c0 17.7 14.3 32 32 32l16 0c17.7 0 32-14.3 32-32l0-34c27.6-7.1 48-32.2 48-62l0-288c0-53-43-96-96-96L96 0zM64 176c0-17.7 14.3-32 32-32l104 0 0 112-104 0c-17.7 0-32-14.3-32-32l0-48zm184 80l0-112 104 0c17.7 0 32 14.3 32 32l0 48c0 17.7-14.3 32-32 32l-104 0zM96 320a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm256 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM152 72c0-13.3 10.7-24 24-24l96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24z\"]\n};\nvar faFilePowerpoint = {\n  prefix: 'fas',\n  iconName: 'file-powerpoint',\n  icon: [384, 512, [], \"f1c4\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM152 256c-13.3 0-24 10.7-24 24l0 144c0 13.3 10.7 24 24 24s24-10.7 24-24l0-24 24 0c39.8 0 72-32.2 72-72s-32.2-72-72-72l-48 0zm48 96l-24 0 0-48 24 0c13.3 0 24 10.7 24 24s-10.7 24-24 24z\"]\n};\nvar faQuoteLeft = {\n  prefix: 'fas',\n  iconName: 'quote-left',\n  icon: [448, 512, [8220, \"quote-left-alt\"], \"f10d\", \"M0 216C0 149.7 53.7 96 120 96l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64L0 216zm256 0c0-66.3 53.7-120 120-120l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-136z\"]\n};\nvar faQuoteLeftAlt = faQuoteLeft;\nvar faChevronDown = {\n  prefix: 'fas',\n  iconName: 'chevron-down',\n  icon: [448, 512, [], \"f078\", \"M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z\"]\n};\nvar faEarthAsia = {\n  prefix: 'fas',\n  iconName: 'earth-asia',\n  icon: [512, 512, [127759, \"globe-asia\"], \"f57e\", \"M50 284.8c4.2 2.1 9 3.2 14 3.2l50.7 0c8.5 0 16.6 3.4 22.6 9.4l13.3 13.3c6 6 14.1 9.4 22.6 9.4l18.7 0c17.7 0 32-14.3 32-32l0-40c0-13.3 10.7-24 24-24s24-10.7 24-24l0-42.7c0-8.5 3.4-16.6 9.4-22.6l13.3-13.3c6-6 9.4-14.1 9.4-22.6L304 57c0-1.2-.1-2.3-.2-3.5-15.4-3.6-31.4-5.5-47.8-5.5-114.9 0-208 93.1-208 208 0 9.8 .7 19.4 2 28.8zm403.3 37.3c-3.2-1.4-6.7-2.1-10.5-2.1L432 320c-8.8 0-16-7.2-16-16s-7.2-16-16-16l-34.7 0c-8.5 0-16.6 3.4-22.6 9.4l-45.3 45.3c-6 6-9.4 14.1-9.4 22.6l0 18.7c0 17.7 14.3 32 32 32l18.7 0c8.5 0 16.6 3.4 22.6 9.4 2.2 2.2 4.7 4.1 7.3 5.5 39.3-25.4 69.5-63.6 84.6-108.8zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM128 368c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM272 256c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32c0-8.8-7.2-16-16-16zm48-112l0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32c0-8.8-7.2-16-16-16s-16 7.2-16 16z\"]\n};\nvar faGlobeAsia = faEarthAsia;\nvar faCentSign = {\n  prefix: 'fas',\n  iconName: 'cent-sign',\n  icon: [384, 512, [], \"e3f5\", \"M208 0c17.7 0 32 14.3 32 32l0 25.4c43.6 5.2 83 24.5 113.3 53.1 12.9 12.1 13.4 32.4 1.3 45.2s-32.4 13.4-45.2 1.3c-24.4-23-57.2-37.1-93.3-37.1-75.1 0-136 60.9-136 136s60.9 136 136 136c36.2 0 69-14.1 93.3-37.1 12.9-12.1 33.1-11.5 45.2 1.3s11.5 33.1-1.3 45.2C323 430.1 283.6 449.4 240 454.6l0 25.4c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-28C84.7 433.5 16 352.8 16 256S84.7 78.5 176 60l0-28c0-17.7 14.3-32 32-32z\"]\n};\nvar faShieldCat = {\n  prefix: 'fas',\n  iconName: 'shield-cat',\n  icon: [512, 512, [], \"e572\", \"M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2 .5 99.2 41.3 280.7 213.6 363.2 16.7 8 36.1 8 52.8 0 172.4-82.5 213.2-264 213.6-363.2 .1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM160 154.4c0-5.8 4.7-10.4 10.4-10.4l.2 0c3.4 0 6.5 1.6 8.5 4.3l40 53.3c3 4 7.8 6.4 12.8 6.4l48 0c5 0 9.8-2.4 12.8-6.4l40-53.3c2-2.7 5.2-4.3 8.5-4.3l.2 0c5.8 0 10.4 4.7 10.4 10.4L352 272c0 53-43 96-96 96s-96-43-96-96l0-117.6zM216 288a16 16 0 1 0 0-32 16 16 0 1 0 0 32zm96-16a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z\"]\n};\nvar faSchoolCircleCheck = {\n  prefix: 'fas',\n  iconName: 'school-circle-check',\n  icon: [640, 512, [], \"e56b\", \"M64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l276 0c-10.5-14.6-19-30.7-25.1-48l-90.9 0 0-88c0-22.1 17.9-40 40-40l48 0c1 0 1.9 0 2.9 .1 26.3-74.6 97.5-128.1 181.1-128.1 28.6 0 55.6 6.2 80 17.4l0-33.4c0-35.3-28.7-64-64-64l-64 0-127.9-115.1c-18.3-16.4-46-16.4-64.2 0L128 128 64 128zm64 240c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32zM112 256l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16zM288 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM640 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-86.6-60.9c7.1 5.2 8.7 15.2 3.5 22.3l-64 88c-2.8 3.8-7 6.2-11.7 6.5s-9.3-1.3-12.6-4.6l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l26.8 26.8 53-72.9c5.2-7.1 15.2-8.7 22.4-3.5z\"]\n};\nvar faMartiniGlass = {\n  prefix: 'fas',\n  iconName: 'martini-glass',\n  icon: [512, 512, [127864, \"glass-martini-alt\"], \"f57b\", \"M2.4 51.8C7.4 39.8 19.1 32 32 32l448 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L288 301.3 288 448 352 448c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0 0-146.7-214.6-214.6C.2 77.5-2.5 63.7 2.4 51.8zM354.7 144l48-48-293.5 0 48 48 197.5 0z\"]\n};\nvar faGlassMartiniAlt = faMartiniGlass;\nvar faPlug = {\n  prefix: 'fas',\n  iconName: 'plug',\n  icon: [448, 512, [128268], \"f1e6\", \"M128-32c17.7 0 32 14.3 32 32l0 96 128 0 0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 64c0 95.1-69.2 174.1-160 189.3l0 66.7c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7C101.2 398.1 32 319.1 32 224l0-64c-17.7 0-32-14.3-32-32S14.3 96 32 96l64 0 0-96c0-17.7 14.3-32 32-32z\"]\n};\nvar faPanorama = {\n  prefix: 'fas',\n  iconName: 'panorama',\n  icon: [576, 512, [], \"e209\", \"M43.9 48C19.7 48 0 67.7 0 91.9L0 420.1c0 24.3 19.7 43.9 43.9 43.9 5.5 0 10.7-1 15.7-2.9 12.9-4.9 103.4-37.1 228.4-37.1s215.5 32.3 228.4 37.1c5 1.9 10.2 2.9 15.7 2.9 24.3 0 43.9-19.7 43.9-43.9l0-328.2c0-24.3-19.7-43.9-43.9-43.9-5.5 0-10.7 1-15.7 2.9-12.9 4.9-103.4 37.1-228.4 37.1S72.5 55.7 59.6 50.9C54.6 49 49.4 48 43.9 48zM72 176a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zm264.1-16c7.5 0 14.6 3.6 19.1 9.6L479.7 336.2c5.9 7.9 6.4 18.5 1.3 26.9s-14.8 12.8-24.5 11.1c-45.8-7.8-103.3-14.2-168.4-14.2-65.6 0-123.4 6.5-169.3 14.4-9.8 1.7-19.7-2.9-24.7-11.5s-4.3-19.4 1.9-27.2L165.3 249c4.6-5.7 11.5-9 18.7-9s14.2 3.3 18.7 9l27.5 34.4 86.7-113.9c4.6-6 11.7-9.5 19.2-9.5z\"]\n};\nvar faClockRotateLeft = {\n  prefix: 'fas',\n  iconName: 'clock-rotate-left',\n  icon: [576, 512, [\"history\"], \"f1da\", \"M288 64c106 0 192 86 192 192S394 448 288 448c-65.2 0-122.9-32.5-157.6-82.3-10.1-14.5-30.1-18-44.6-7.9s-18 30.1-7.9 44.6C124.1 468.6 201 512 288 512 429.4 512 544 397.4 544 256S429.4 0 288 0C202.3 0 126.5 42.1 80 106.7L80 80c0-17.7-14.3-32-32-32S16 62.3 16 80l0 112c0 17.7 14.3 32 32 32l24.6 0c.5 0 1 0 1.5 0l86 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-38.3 0C154.9 102.6 217 64 288 64zm24 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1z\"]\n};\nvar faHistory = faClockRotateLeft;\nvar faJarWheat = {\n  prefix: 'fas',\n  iconName: 'jar-wheat',\n  icon: [320, 512, [], \"e517\", \"M32-8c0-13.3 10.7-24 24-24l208 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L56 16C42.7 16 32 5.3 32-8zM0 128C0 92.7 28.7 64 64 64l192 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 128zm112 32l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8 0 32.1 26 58.2 58.2 58.2l75.6 0c32.1 0 58.2-26 58.2-58.2 0-3.2-2.6-5.8-5.8-5.8L208 160c-19.1 0-36.3 8.4-48 21.7-11.7-13.3-28.9-21.7-48-21.7zm48 117.7c-11.7-13.3-28.9-21.7-48-21.7l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8 0 32.1 26 58.2 58.2 58.2l75.6 0c32.1 0 58.2-26 58.2-58.2 0-3.2-2.6-5.8-5.8-5.8L208 256c-19.1 0-36.3 8.4-48 21.7zM112 352l-42.2 0c-3.2 0-5.8 2.6-5.8 5.8 0 32.1 26 58.2 58.2 58.2l21.8 0 0 32c0 8.8 7.2 16 16 16s16-7.2 16-16l0-32 21.8 0c32.1 0 58.2-26 58.2-58.2 0-3.2-2.6-5.8-5.8-5.8L208 352c-19.1 0-36.3 8.4-48 21.7-11.7-13.3-28.9-21.7-48-21.7z\"]\n};\nvar faCloudArrowDown = {\n  prefix: 'fas',\n  iconName: 'cloud-arrow-down',\n  icon: [576, 512, [62337, \"cloud-download\", \"cloud-download-alt\"], \"f0ed\", \"M144 480c-79.5 0-144-64.5-144-144 0-63.4 41-117.2 97.9-136.5-1.3-7.7-1.9-15.5-1.9-23.5 0-79.5 64.5-144 144-144 55.4 0 103.5 31.3 127.6 77.1 14.2-8.3 30.8-13.1 48.4-13.1 53 0 96 43 96 96 0 15.7-3.8 30.6-10.5 43.7 44 20.3 74.5 64.7 74.5 116.3 0 70.7-57.3 128-128 128l-304 0zM377 313c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-31 31 0-102.1c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 102.1-31-31c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c9.4 9.4 24.6 9.4 33.9 0l72-72z\"]\n};\nvar faCloudDownload = faCloudArrowDown;\nvar faCloudDownloadAlt = faCloudArrowDown;\nvar faTruckRampBox = {\n  prefix: 'fas',\n  iconName: 'truck-ramp-box',\n  icon: [576, 512, [\"truck-loading\"], \"f4de\", \"M400 32c-44.2 0-80 35.8-80 80l0 248.2-297.2 89.2C5.9 454.4-3.7 472.3 1.4 489.2s22.9 26.5 39.8 21.5l315.5-94.6 43.7 0c-.2 2.6-.4 5.3-.4 8 0 48.6 39.4 88 88 88s88-39.4 88-88l0-392-176 0zM528 424c0 22.1-17.9 40-40 40s-40-17.9-40-40 17.9-40 40-40c22.1 0 39.9 17.9 40 39.9l0 .1zM51.9 149.5C18.1 159.8-.9 195.6 9.4 229.4l28.1 91.8C47.8 355 83.6 374 117.4 363.7l91.8-28.1c33.8-10.3 52.8-46.1 42.5-79.9l-28.1-91.8c-10.3-33.8-46.1-52.8-79.9-42.5L51.9 149.5z\"]\n};\nvar faTruckLoading = faTruckRampBox;\nvar faAngleDown = {\n  prefix: 'fas',\n  iconName: 'angle-down',\n  icon: [384, 512, [8964], \"f107\", \"M169.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 306.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z\"]\n};\nvar faPlugCircleCheck = {\n  prefix: 'fas',\n  iconName: 'plug-circle-check',\n  icon: [640, 512, [], \"e55c\", \"M192-32c17.7 0 32 14.3 32 32l0 96 128 0 0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 48.7c-98.6 8.1-176 90.7-176 191.3 0 27.3 5.7 53.3 16 76.9l0 3.1c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7C165.2 398.1 96 319.1 96 224l0-64c-17.7 0-32-14.3-32-32S78.3 96 96 96l64 0 0-96c0-17.7 14.3-32 32-32zM352 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm201.4-60.9c-7.1-5.2-17.2-3.6-22.4 3.5l-53 72.9-26.8-26.8c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c3.3 3.3 7.9 5 12.6 4.6s8.9-2.8 11.7-6.5l64-88c5.2-7.1 3.6-17.2-3.5-22.3z\"]\n};\nvar faWindowMaximize = {\n  prefix: 'fas',\n  iconName: 'window-maximize',\n  icon: [512, 512, [128470], \"f2d0\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm24 64l336 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 176c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faHandsHoldingCircle = {\n  prefix: 'fas',\n  iconName: 'hands-holding-circle',\n  icon: [640, 512, [], \"e4fb\", \"M320 0a128 128 0 1 1 0 256 128 128 0 1 1 0-256zM40 64c22.1 0 40 17.9 40 40l0 160.2c0 17 6.7 33.3 18.7 45.3l51.1 51.1c8.3 8.3 21.3 9.6 31 3.1 12.9-8.6 14.7-26.9 3.7-37.8-7.3-7.3-23.1-23.1-47.2-47.2-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c24.1 24.1 39.9 39.9 47.2 47.2l0 0 25.3 25.3c21 21 32.8 49.5 32.8 79.2l0 78.9c0 26.5-21.5 48-48 48l-66.7 0c-17 0-33.3-6.7-45.3-18.7L28.1 393.4C10.1 375.4 0 351 0 325.5L0 104C0 81.9 17.9 64 40 64zm560 0c22.1 0 40 17.9 40 40l0 221.5c0 25.5-10.1 49.9-28.1 67.9L512 493.3c-12 12-28.3 18.7-45.3 18.7L400 512c-26.5 0-48-21.5-48-48l0-78.9c0-29.7 11.8-58.2 32.8-79.2l25.3-25.3 0 0c7.3-7.3 23.1-23.1 47.2-47.2 12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3c-24.1 24.1-39.9 39.9-47.2 47.2-11 11-9.2 29.2 3.7 37.8 9.7 6.5 22.7 5.2 31-3.1l51.1-51.1c12-12 18.7-28.3 18.7-45.3L560 104c0-22.1 17.9-40 40-40z\"]\n};\nvar faLocationPin = {\n  prefix: 'fas',\n  iconName: 'location-pin',\n  icon: [384, 512, [\"map-marker\"], \"f041\", \"M192 0C86 0 0 84.4 0 188.6 0 307.9 120.2 450.9 170.4 505.4 182.2 518.2 201.8 518.2 213.6 505.4 263.8 450.9 384 307.9 384 188.6 384 84.4 298 0 192 0z\"]\n};\nvar faMapMarker = faLocationPin;\nvar faBowlingBall = {\n  prefix: 'fas',\n  iconName: 'bowling-ball',\n  icon: [512, 512, [], \"f436\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM240 80a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM208 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-64-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faCartFlatbed = {\n  prefix: 'fas',\n  iconName: 'cart-flatbed',\n  icon: [576, 512, [\"dolly-flatbed\"], \"f474\", \"M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l16 0c8.8 0 16 7.2 16 16l0 288c0 39.8 29.1 72.8 67.1 79-2 5.3-3.1 11-3.1 17 0 26.5 21.5 48 48 48s48-21.5 48-48c0-5.6-1-11-2.7-16l197.5 0c-1.8 5-2.7 10.4-2.7 16 0 26.5 21.5 48 48 48s48-21.5 48-48c0-5.6-1-11-2.7-16l34.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-400 0c-8.8 0-16-7.2-16-16l0-288C128 35.8 92.2 0 48 0L32 0zM224 64c-26.5 0-48 21.5-48 48l0 176c0 26.5 21.5 48 48 48l240 0c26.5 0 48-21.5 48-48l0-176c0-26.5-21.5-48-48-48L224 64z\"]\n};\nvar faDollyFlatbed = faCartFlatbed;\nvar faHouseUser = {\n  prefix: 'fas',\n  iconName: 'house-user',\n  icon: [512, 512, [\"home-user\"], \"e1b0\", \"M277.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S18.8 272 32 272l16 0 0 176c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-176 16 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8-35.1l-224-208zM200 256a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM144 432c0-44.2 35.8-80 80-80l64 0c44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16l-192 0c-8.8 0-16-7.2-16-16z\"]\n};\nvar faHomeUser = faHouseUser;\nvar faGhost = {\n  prefix: 'fas',\n  iconName: 'ghost',\n  icon: [384, 512, [128123], \"f6e2\", \"M40.1 467.1l-11.2 9C25.7 478.6 21.8 480 17.8 480 8 480 0 472 0 462.2L0 192C0 86 86 0 192 0S384 86 384 192l0 270.2c0 9.8-8 17.8-17.8 17.8-4 0-7.9-1.4-11.1-3.9l-11.2-9c-13.4-10.7-32.8-9-44.1 3.9L269.3 506c-3.3 3.8-8.2 6-13.3 6s-9.9-2.2-13.3-6l-26.6-30.5c-12.7-14.6-35.4-14.6-48.2 0L141.3 506c-3.3 3.8-8.2 6-13.3 6s-9.9-2.2-13.3-6L84.2 471c-11.3-12.9-30.7-14.6-44.1-3.9zM160 192a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faCommentNodes = {\n  prefix: 'fas',\n  iconName: 'comment-nodes',\n  icon: [640, 512, [], \"e696\", \"M480 208C503.7 208 525.6 215.3 543.7 227.9 536.9 100.9 425 0 288 0 146.6 0 32 107.5 32 240 32 294.3 51.2 344.3 83.6 384.5L34.8 476.8c-4.8 9-3.3 20 3.6 27.5s17.8 9.8 27.1 5.8l118.4-50.7c27.2 11.4 56.9 18.4 88.1 20.2 .1-18.9 4.9-38 15-55.5 17.1-29.7 45.8-48.5 77-54.2l9.2-16c-3.4-10.7-5.2-22-5.2-33.8 0-61.9 50.1-112 112-112zM328.6 448c-17.7 30.6-7.2 69.7 23.4 87.4s69.7 7.2 87.4-23.4c1.5-2.6 2.8-5.3 3.9-8l73.3 0c1.1 2.7 2.4 5.4 3.9 8 17.7 30.6 56.8 41.1 87.4 23.4s41.1-56.8 23.4-87.4c-13.4-23.2-39.1-34.8-64-31.4l-17.6-30.7c-11 11.7-25 20.6-40.6 25.6l16.5 28.9c-3.8 4.8-6.8 10-9 15.6l-73.4 0c-2.2-5.6-5.3-10.8-9-15.6l33-57.7c4.1 .8 8.4 1.3 12.8 1.3 35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64c0 13.4 4.1 25.8 11.2 36.1l-34.6 60.5c-25-3.4-50.6 8.3-64 31.4z\"]\n};\nvar faPersonArrowDownToLine = {\n  prefix: 'fas',\n  iconName: 'person-arrow-down-to-line',\n  icon: [576, 512, [], \"e538\", \"M192-32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM318.3 299.1l-46.3-62.4 0 243.3 272 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 544c-17.7 0-32-14.3-32-32s14.3-32 32-32l80 0 0-243.3-46.3 62.4c-10.5 14.2-30.6 17.2-44.8 6.6s-17.2-30.6-6.6-44.8l70.5-95C110 132 149.7 112 192 112s82 20 107.2 53.9l70.5 95c10.5 14.2 7.6 34.2-6.6 44.8s-34.2 7.6-44.8-6.6zM176 480l32 0 0-128c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 128zM566.6 166.6l-80 80c-12.5 12.5-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L432 146.7 432 0c0-17.7 14.3-32 32-32s32 14.3 32 32l0 146.7 25.4-25.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3z\"]\n};\nvar faPlugCirclePlus = {\n  prefix: 'fas',\n  iconName: 'plug-circle-plus',\n  icon: [640, 512, [], \"e55f\", \"M192-32c17.7 0 32 14.3 32 32l0 96 128 0 0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 48.7c-98.6 8.1-176 90.7-176 191.3 0 27.3 5.7 53.3 16 76.9l0 3.1c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7C165.2 398.1 96 319.1 96 224l0-64c-17.7 0-32-14.3-32-32S78.3 96 96 96l64 0 0-96c0-17.7 14.3-32 32-32zM496 256a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm16 80c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48-48 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 0 48c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0 0-48z\"]\n};\nvar faPersonSwimming = {\n  prefix: 'fas',\n  iconName: 'person-swimming',\n  icon: [640, 512, [127946, \"swimmer\"], \"f5c4\", \"M552 152a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zM293.4 198.2l-88.6 73.9c1.1 0 2.2-.1 3.3-.1 33.1-.2 66.3 10.2 94.4 31.4 22.1 16.6 29.1 16.6 51.2 0 27.5-20.7 59.9-31.2 92.4-31.4 4.8 0 9.7 .2 14.5 .6-8.3-30-24.3-57.7-46.8-80.2-18.4-18.4-40.6-32.7-65-41.8l-68.6-25.7c-27.4-10.3-58-7.5-83.1 7.6l-53.5 32.1c-15.2 9.1-20.1 28.7-11 43.9s28.7 20.1 43.9 11L230 187.3c8.4-5 18.6-5.9 27.7-2.5l35.7 13.4zm110 181.9c21.3-16.1 49.9-16.1 71.2 0 19 14.4 41.9 28.2 67.2 33.3 26.5 5.4 54.3 .8 80.7-19.1 10.6-8 12.7-23 4.7-33.6s-23-12.7-33.6-4.7c-14.9 11.2-28.6 13.1-42.3 10.3-14.9-3-30.9-11.9-47.8-24.6-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-21.6 16.3-41.3 25.8-58.9 25.7-9.6-.1-19.9-3-31.2-11.5-10.6-8-25.6-5.9-33.6 4.7S7 386.3 17.6 394.3c19.1 14.4 39.4 21 59.8 21.1 33.9 .2 64.3-17.4 88.1-35.3 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9z\"]\n};\nvar faSwimmer = faPersonSwimming;\nvar faCommentDots = {\n  prefix: 'fas',\n  iconName: 'comment-dots',\n  icon: [512, 512, [128172, 62075, \"commenting\"], \"f4ad\", \"M256 480c141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240c0 54.3 19.2 104.3 51.6 144.5L2.8 476.8c-4.8 9-3.3 20 3.6 27.5s17.8 9.8 27.1 5.8l118.4-50.7C183.7 472.6 218.9 480 256 480zM128 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faCommenting = faCommentDots;\nvar faChartPie = {\n  prefix: 'fas',\n  iconName: 'chart-pie',\n  icon: [576, 512, [\"pie-chart\"], \"f200\", \"M512.4 240l-176 0c-17.7 0-32-14.3-32-32l0-176c0-17.7 14.4-32.2 31.9-29.9 107 14.2 191.8 99 206 206 2.3 17.5-12.2 31.9-29.9 31.9zM222.6 37.2c18.1-3.8 33.8 11 33.8 29.5l0 197.3c0 5.6 2 11 5.5 15.3L394 438.7c11.7 14.1 9.2 35.4-6.9 44.1-34.1 18.6-73.2 29.2-114.7 29.2-132.5 0-240-107.5-240-240 0-115.5 81.5-211.9 190.2-234.8zM477.8 288l64 0c18.5 0 33.3 15.7 29.5 33.8-10.2 48.4-35 91.4-69.6 124.2-12.3 11.7-31.6 9.2-42.4-3.9L374.9 340.4c-17.3-20.9-2.4-52.4 24.6-52.4l78.2 0z\"]\n};\nvar faPieChart = faChartPie;\nvar faFrog = {\n  prefix: 'fas',\n  iconName: 'frog',\n  icon: [576, 512, [], \"f52e\", \"M368 32c41.7 0 75.9 31.8 79.7 72.5l85.6 26.3c25.4 7.8 42.8 31.3 42.8 57.9 0 21.8-11.7 41.9-30.7 52.7l-144.5 82.1 92.5 92.5 50.7 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-64 0c-8.5 0-16.6-3.4-22.6-9.4L346.9 360.2c11.7-36 3.2-77.1-25.4-105.7-40.6-40.6-106.3-40.6-146.9-.1L101 324.4c-6.4 6.1-6.7 16.2-.6 22.6s16.2 6.6 22.6 .6l73.8-70.2 .1-.1 .1-.1c3.5-3.5 7.3-6.6 11.3-9.2 27.9-18.5 65.9-15.4 90.5 9.2 24.7 24.7 27.7 62.9 9 90.9-2.6 3.8-5.6 7.5-9 10.9L261.8 416 352 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 480C28.7 480 0 451.3 0 416 0 249.6 127 112.9 289.3 97.5 296.2 60.2 328.8 32 368 32zm0 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faWineBottle = {\n  prefix: 'fas',\n  iconName: 'wine-bottle',\n  icon: [320, 512, [], \"f72f\", \"M80-32c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32 0 11.8-6.4 22.2-16 27.7l0 145.6c56.5 24.7 96 81.1 96 146.7l0 224c0 35.3-28.7 64-64 64L64 576c-35.3 0-64-28.7-64-64L0 288c0-65.6 39.5-122 96-146.7L96-4.3C86.4-9.8 80-20.2 80-32zM96 288c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L96 288z\"]\n};\nvar faInbox = {\n  prefix: 'fas',\n  iconName: 'inbox',\n  icon: [512, 512, [], \"f01c\", \"M91.8 32C59.9 32 32.9 55.4 28.4 86.9L.6 281.2c-.4 3-.6 6-.6 9.1L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-125.7c0-3-.2-6.1-.6-9.1L483.6 86.9C479.1 55.4 452.1 32 420.2 32L91.8 32zm0 64l328.5 0 27.4 192-59.9 0c-12.1 0-23.2 6.8-28.6 17.7l-14.3 28.6c-5.4 10.8-16.5 17.7-28.6 17.7l-120.4 0c-12.1 0-23.2-6.8-28.6-17.7l-14.3-28.6c-5.4-10.8-16.5-17.7-28.6-17.7L64.3 288 91.8 96z\"]\n};\nvar faSquareH = {\n  prefix: 'fas',\n  iconName: 'square-h',\n  icon: [448, 512, [\"h-square\"], \"f0fd\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM320 168l0 176c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-64-96 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-176c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 96 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24z\"]\n};\nvar faHSquare = faSquareH;\nvar faHouseMedical = {\n  prefix: 'fas',\n  iconName: 'house-medical',\n  icon: [512, 512, [], \"e3b2\", \"M277.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S18.8 272 32 272l16 0 0 176c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-176 16 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8-35.1l-224-208zM224 248c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 40 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-40 0 0 40c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40z\"]\n};\nvar faCircleChevronRight = {\n  prefix: 'fas',\n  iconName: 'circle-chevron-right',\n  icon: [512, 512, [\"chevron-circle-right\"], \"f138\", \"M0 256a256 256 0 1 0 512 0 256 256 0 1 0 -512 0zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z\"]\n};\nvar faChevronCircleRight = faCircleChevronRight;\nvar faFileCsv = {\n  prefix: 'fas',\n  iconName: 'file-csv',\n  icon: [576, 512, [], \"f6dd\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l80 0 0-112c0-35.3 28.7-64 64-64l176 0 0-165.5c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM264 380c-24.3 0-44 19.7-44 44l0 80c0 24.3 19.7 44 44 44l16 0c24.3 0 44-19.7 44-44l0-8c0-11-9-20-20-20s-20 9-20 20l0 8c0 2.2-1.8 4-4 4l-16 0c-2.2 0-4-1.8-4-4l0-80c0-2.2 1.8-4 4-4l16 0c2.2 0 4 1.8 4 4l0 8c0 11 9 20 20 20s20-9 20-20l0-8c0-24.3-19.7-44-44-44l-16 0zm136 0c-28.7 0-52 23.3-52 52s23.3 52 52 52c6.6 0 12 5.4 12 12s-5.4 12-12 12l-32 0c-11 0-20 9-20 20s9 20 20 20l32 0c28.7 0 52-23.3 52-52s-23.3-52-52-52c-6.6 0-12-5.4-12-12s5.4-12 12-12l24 0c11 0 20-9 20-20s-9-20-20-20l-24 0zm96 0c-11 0-20 9-20 20l0 31.6c0 35.5 10.5 70.3 30.2 99.8l5.1 7.7c3.7 5.6 10 8.9 16.6 8.9s12.9-3.3 16.6-8.9l5.1-7.7c19.7-29.6 30.2-64.3 30.2-99.8l0-31.6c0-11-9-20-20-20s-20 9-20 20l0 31.6c0 19.6-4.1 38.9-12 56.7-7.9-17.8-12-37.1-12-56.7l0-31.6c0-11-9-20-20-20z\"]\n};\nvar faHatCowboy = {\n  prefix: 'fas',\n  iconName: 'hat-cowboy',\n  icon: [640, 512, [], \"f8c0\", \"M182.2 76.1L130.8 307.5C145.5 324.9 167.4 336 192 336l256 0c24.6 0 46.5-11.1 61.2-28.5L457.8 76.1c-5.7-25.8-28.6-44.1-55-44.1-12.2 0-24.1 4-33.8 11.3l-4.7 3.5c-26.3 19.7-62.4 19.7-88.6 0L271 43.3c-9.8-7.3-21.6-11.3-33.8-11.3-26.4 0-49.3 18.3-55 44.1zM64 256c0-17.7-14.3-32-32-32S0 238.3 0 256C0 362 86 448 192 448l256 0c106 0 192-86 192-192 0-17.7-14.3-32-32-32s-32 14.3-32 32c0 70.7-57.3 128-128 128l-256 0c-70.7 0-128-57.3-128-128z\"]\n};\nvar faFaceGrinTongueWink = {\n  prefix: 'fas',\n  iconName: 'face-grin-tongue-wink',\n  icon: [512, 512, [128540, \"grin-tongue-wink\"], \"f58b\", \"M152.2 490.1C62.5 450.2 0 360.4 0 256 0 114.6 114.6 0 256 0S512 114.6 512 256c0 104.4-62.5 194.2-152.2 234.1 5.3-13 8.2-27.2 8.2-42.1l0-61.7c16.9-16.5 30.1-36.7 38.3-59.3 4.3-11.8-7.7-21.8-19.6-18.1-39.2 12.2-83.7 19.1-130.7 19.1s-91.5-6.9-130.7-19.1c-11.9-3.7-23.9 6.3-19.6 18.1 8.3 22.6 21.5 42.8 38.3 59.3l0 61.7c0 14.9 2.9 29.1 8.2 42.1zM152 212l16 0c11 0 20 9 20 20s9 20 20 20 20-9 20-20c0-33.1-26.9-60-60-60l-16 0c-33.1 0-60 26.9-60 60 0 11 9 20 20 20s20-9 20-20 9-20 20-20zm184 60a64 64 0 1 0 0-128 64 64 0 1 0 0 128zM320 402.6l0 45.4c0 35.3-28.7 64-64 64s-64-28.7-64-64l0-45.4c0-14.7 11.9-26.6 26.6-26.6l2 0c11.3 0 21.1 7.9 23.6 18.9 2.8 12.6 20.8 12.6 23.6 0 2.5-11.1 12.3-18.9 23.6-18.9l2 0c14.7 0 26.6 11.9 26.6 26.6zM336 184a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faGrinTongueWink = faFaceGrinTongueWink;\nvar faL = {\n  prefix: 'fas',\n  iconName: 'l',\n  icon: [320, 512, [108], \"4c\", \"M64 32c17.7 0 32 14.3 32 32l0 352 192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 480c-17.7 0-32-14.3-32-32L32 64c0-17.7 14.3-32 32-32z\"]\n};\nvar faArrowDownShortWide = {\n  prefix: 'fas',\n  iconName: 'arrow-down-short-wide',\n  icon: [576, 512, [\"sort-amount-desc\", \"sort-amount-down-alt\"], \"f884\", \"M246.6 374.6l-96 96c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM320 32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faSortAmountDesc = faArrowDownShortWide;\nvar faSortAmountDownAlt = faArrowDownShortWide;\nvar faHourglassHalf = {\n  prefix: 'fas',\n  iconName: 'hourglass-half',\n  icon: [384, 512, [\"hourglass-2\"], \"f252\", \"M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9l67.9-67.9 67.9 67.9c4.6 4.6 8.6 9.6 12.2 14.9L112 384z\"]\n};\nvar faHourglass2 = faHourglassHalf;\nvar faSpoon = {\n  prefix: 'fas',\n  iconName: 'spoon',\n  icon: [512, 512, [129348, 61873, \"utensil-spoon\"], \"f2e5\", \"M245.8 220.9c-14.5-17.6-21.8-39.2-21.8-60.8 0-80.2 96-160.2 192-160.2 53 0 96 43 96 96 0 96-80 192-160.2 192-21.6 0-43.2-7.3-60.8-21.8L54.6 502.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L245.8 220.9z\"]\n};\nvar faUtensilSpoon = faSpoon;\nvar faCreditCard = {\n  prefix: 'fas',\n  iconName: 'credit-card',\n  icon: [512, 512, [128179, 62083, \"credit-card-alt\"], \"f09d\", \"M0 128l0 32 512 0 0-32c0-35.3-28.7-64-64-64L64 64C28.7 64 0 92.7 0 128zm0 80L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-176-512 0zM64 360c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zm144 0c0-13.3 10.7-24 24-24l64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0c-13.3 0-24-10.7-24-24z\"]\n};\nvar faCreditCardAlt = faCreditCard;\nvar faFileInvoiceDollar = {\n  prefix: 'fas',\n  iconName: 'file-invoice-dollar',\n  icon: [384, 512, [], \"f571\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM64 88c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 64C74.7 64 64 74.7 64 88zm0 96c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zm112 76l0 4c-28.8 .3-52 23.7-52 52.5 0 25.7 18.5 47.6 43.9 51.8l41.7 7c6 1 10.4 6.2 10.4 12.3 0 6.9-5.6 12.5-12.5 12.5L152 400c-11 0-20 9-20 20s9 20 20 20l24 0 0 4c0 11 9 20 20 20s20-9 20-20l0-4.7c25-4.1 44-25.7 44-51.8 0-25.7-18.5-47.6-43.9-51.8l-41.7-7c-6-1-10.4-6.2-10.4-12.3 0-6.9 5.6-12.5 12.5-12.5l47.5 0c11 0 20-9 20-20s-9-20-20-20l-8 0 0-4c0-11-9-20-20-20s-20 9-20 20z\"]\n};\nvar faSpaghettiMonsterFlying = {\n  prefix: 'fas',\n  iconName: 'spaghetti-monster-flying',\n  icon: [640, 512, [\"pastafarianism\"], \"f67b\", \"M208 64a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 0c0 16.2-6 31.1-16 42.3l15.6 31.2c18.7-6 39.9-9.5 64.4-9.5s45.8 3.5 64.4 9.5L400 106.3c-10-11.3-16-26.1-16-42.3 0-35.3 28.7-64 64-64s64 28.7 64 64-28.7 64-64 64c-1.7 0-3.4-.1-5.1-.2L427.8 158c21.1 13.6 37.7 30.2 51.4 46.4 7.1 8.3 13.5 16.6 19.3 24l1.4 1.8c6.3 8.1 11.6 14.8 16.7 20.4 10.7 11.7 16.1 13.4 19.4 13.4 2.5 0 4.3-.6 7.1-3.3 3.7-3.5 7.1-8.8 12.5-17.4l.6-.9c4.6-7.4 11-17.6 19.4-25.7 9.7-9.3 22.9-16.7 40.4-16.7 13.3 0 24 10.7 24 24s-10.7 24-24 24c-2.5 0-4.3 .6-7.1 3.3-3.7 3.5-7.1 8.8-12.5 17.4l-.6 .9c-4.6 7.4-11 17.6-19.4 25.7-9.7 9.3-22.9 16.7-40.4 16.7-18.5 0-32.9-8.5-44.3-18.6-3.1 4-6.6 8.3-10.5 12.7 1.4 4.3 2.8 8.5 4 12.5 .9 3 1.8 5.8 2.6 8.6 3 9.8 5.5 18.2 8.6 25.9 3.9 9.8 7.4 15.4 10.8 18.5 2.6 2.4 5.9 4.3 12.8 4.3 8.7 0 16.9-4.2 33.7-13.2 15-8 35.7-18.8 62.3-18.8 13.3 0 24 10.7 24 24s-10.7 24-24 24c-13.4 0-24.7 5.2-39.7 13.2-1 .6-2.1 1.1-3.2 1.7-13.1 7.1-31.6 17.1-53.1 17.1-18.4 0-33.6-6.1-45.5-17.2-11.1-10.3-17.9-23.7-22.7-36-3.6-9-6.7-19.1-9.5-28.5-16.4 12.3-36.1 23.6-58.9 31.3 3.6 10.8 8.4 23.5 14.4 36.2 7.5 15.9 16.2 30.4 25.8 40.5 9.6 10.2 17.7 13.7 24.5 13.7 13.3 0 24 10.7 24 24s-10.7 24-24 24c-25.2 0-45-13.5-59.5-28.8-14.5-15.4-25.7-34.9-34.2-53-8-17-14.1-33.8-18.3-46.9-5.2 .4-10.6 .6-16 .6s-10.8-.2-16-.6c-4.2 13-10.3 29.9-18.3 46.9-8.5 18.1-19.8 37.6-34.2 53-14.4 15.3-34.3 28.8-59.5 28.8-13.3 0-24-10.7-24-24s10.7-24 24-24c6.8 0 15-3.5 24.5-13.7 9.5-10.1 18.3-24.6 25.8-40.5 5.9-12.6 10.7-25.4 14.4-36.2-22.8-7.7-42.5-19-58.9-31.3-2.9 9.4-6 19.5-9.5 28.5-4.8 12.2-11.6 25.6-22.7 36-11.9 11.1-27.1 17.2-45.5 17.2-13.1 0-24.5-4.1-33.8-8.9-7.9-4-15.7-9.2-22.1-13.5l0 0-2.4-1.6c-15.3-10.2-25.8-16-37.7-16-13.3 0-24-10.7-24-24s10.7-24 24-24c28.1 0 49.6 14.2 64.3 24l2.4 1.6c6.9 4.6 12.1 8.1 17.2 10.7 5.5 2.8 9.1 3.6 12 3.6 6.8 0 10.2-1.9 12.8-4.3 3.4-3.2 7-8.8 10.8-18.5 3-7.7 5.6-16.1 8.6-25.9 .8-2.7 1.7-5.6 2.6-8.6 1.2-4 2.6-8.2 4-12.5-3.9-4.5-7.4-8.8-10.5-12.7-11.4 10.1-25.9 18.6-44.3 18.6-17.5 0-30.7-7.4-40.4-16.7-8.4-8.1-14.8-18.3-19.4-25.7l-.6-.9c-5.4-8.6-8.8-13.9-12.5-17.4-2.8-2.7-4.6-3.3-7.1-3.3-13.3 0-24-10.7-24-24s10.7-24 24-24c17.5 0 30.7 7.4 40.4 16.7 8.4 8.1 14.8 18.3 19.4 25.7l.6 .9c5.4 8.6 8.8 13.9 12.5 17.4 2.8 2.7 4.6 3.3 7.1 3.3 3.3 0 8.7-1.7 19.4-13.4 5.1-5.6 10.4-12.3 16.7-20.4l1.4-1.8c5.8-7.4 12.2-15.7 19.3-24 13.8-16.2 30.3-32.8 51.4-46.4l-15.1-30.2c-1.7 .1-3.4 .2-5.1 .2-35.3 0-64-28.7-64-64s28.7-64 64-64 64 28.7 64 64zm208 0a16 16 0 1 0 -32 0 16 16 0 1 0 32 0z\"]\n};\nvar faPastafarianism = faSpaghettiMonsterFlying;\nvar faMartiniGlassCitrus = {\n  prefix: 'fas',\n  iconName: 'martini-glass-citrus',\n  icon: [640, 512, [\"cocktail\"], \"f561\", \"M576 80c0-44.2-35.8-80-80-80-18 0-34.6 6-48 16l-81 0c23.6-47.4 72.5-80 129-80 79.5 0 144 64.5 144 144S575.5 224 496 224c-6.5 0-13-.4-19.3-1.3l64-74.7c1.1-1.3 2.2-2.7 3.3-4.1 19.4-14.6 32-37.8 32-64zM66.9 82.6C72.2 71.3 83.5 64 96 64l384 0c12.5 0 23.8 7.3 29.1 18.6s3.4 24.7-4.8 34.2l-184.3 215 0 116.2 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0 0-116.2-184.3-215c-8.1-9.5-10-22.8-4.8-34.2zM165.6 128L288 270.8 410.4 128 165.6 128z\"]\n};\nvar faCocktail = faMartiniGlassCitrus;\nvar faBullhorn = {\n  prefix: 'fas',\n  iconName: 'bullhorn',\n  icon: [512, 512, [128226, 128363], \"f0a1\", \"M461.2 18.9C472.7 24 480 35.4 480 48l0 416c0 12.6-7.3 24-18.8 29.1s-24.8 3.2-34.3-5.1l-46.6-40.7c-43.6-38.1-98.7-60.3-156.4-63l0 95.7c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-96C57.3 384 0 326.7 0 256S57.3 128 128 128l84.5 0c61.8-.2 121.4-22.7 167.9-63.3l46.6-40.7c9.4-8.3 22.9-10.2 34.3-5.1zM224 320l0 .2c70.3 2.7 137.8 28.5 192 73.4l0-275.3c-54.2 44.9-121.7 70.7-192 73.4L224 320z\"]\n};\nvar faBoxTissue = {\n  prefix: 'fas',\n  iconName: 'box-tissue',\n  icon: [512, 512, [], \"e05b\", \"M103.9 32l161 0c13.8 0 26 8.8 30.4 21.9l17.4 52.2c4.4 13.1 16.6 21.9 30.4 21.9l60.5 0c21.8 0 37.3 21.4 30.4 42.1L384 320 128 320 72.7 70.9C68.2 51 83.4 32 103.9 32zM48 256l16.6 0 16.5 74.4C86 352.4 105.5 368 128 368l256 0c20.7 0 39-13.2 45.5-32.8l26.4-79.2 8.1 0c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48L0 304c0-26.5 21.5-48 48-48z\"]\n};\nvar faMattressPillow = {\n  prefix: 'fas',\n  iconName: 'mattress-pillow',\n  icon: [576, 512, [], \"e525\", \"M256 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l192 0 0-384zm48 384l208 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-208 0 0 384zM64 160c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-192z\"]\n};\nvar faChevronLeft = {\n  prefix: 'fas',\n  iconName: 'chevron-left',\n  icon: [320, 512, [9001], \"f053\", \"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z\"]\n};\nvar faCloudMoonRain = {\n  prefix: 'fas',\n  iconName: 'cloud-moon-rain',\n  icon: [576, 512, [], \"f73c\", \"M448 0c-68.6 0-127.1 43.1-149.8 103.8 17.1 14.1 29.6 33.5 34.9 55.8 39.9 21.7 66.9 63.9 66.9 112.5 0 13.5-2.1 26.5-5.9 38.7 16.9 6 35 9.3 53.9 9.3 43 0 82.1-17 110.8-44.6 4.6-4.4 5.9-11.2 3.3-17s-8.6-9.3-14.9-8.8c-3 .2-6.1 .4-9.2 .4-63.5 0-115-51.5-115-115 0-45.1 26-84.2 63.8-103 5.7-2.8 9-8.9 8.2-15.2S489.6 5.3 483.4 3.9C472 1.4 460.2 0 448 0zM272 352c44.2 0 80-35.8 80-80 0-39-27.9-71.5-64.8-78.6 .5-3.1 .8-6.2 .8-9.4 0-30.9-25.1-56-56-56-12.4 0-23.9 4-33.1 10.8-13.4-25.5-40.1-42.8-70.9-42.8-44.2 0-80 35.8-80 80 0 7.4 1 14.6 2.9 21.5-29.8 11.6-50.9 40.6-50.9 74.5 0 44.2 35.8 80 80 80l192 0zM69 401.1c-12.6-4.2-26.2 2.6-30.4 15.2L17.2 480.4C13 493 19.8 506.6 32.4 510.8s26.2-2.6 30.4-15.2l21.4-64.1c4.2-12.6-2.6-26.2-15.2-30.4zm120 0c-12.6-4.2-26.2 2.6-30.4 15.2l-21.4 64.1c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l21.4-64.1c4.2-12.6-2.6-26.2-15.2-30.4zm120 0c-12.6-4.2-26.2 2.6-30.4 15.2l-21.4 64.1c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l21.4-64.1c4.2-12.6-2.6-26.2-15.2-30.4z\"]\n};\nvar faArrowDown19 = {\n  prefix: 'fas',\n  iconName: 'arrow-down-1-9',\n  icon: [512, 512, [\"sort-numeric-asc\", \"sort-numeric-down\"], \"f162\", \"M418.7 38c8.3 6 13.3 15.7 13.3 26l0 96 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-51.6-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4zM365.1 430.6l11.7-18c-32.9-9.9-56.8-40.5-56.8-76.6 0-44.2 35.8-80 80-80s80 35.8 80 80c0 22.9-6.6 45.3-19.1 64.5l-42.1 64.9c-9.6 14.8-29.4 19.1-44.3 9.4s-19.1-29.4-9.4-44.3zM424 336a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM150.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-96 96z\"]\n};\nvar faSortNumericAsc = faArrowDown19;\nvar faSortNumericDown = faArrowDown19;\nvar faHandSpock = {\n  prefix: 'fas',\n  iconName: 'hand-spock',\n  icon: [512, 512, [128406], \"f259\", \"M214.9 23.7C210.3 6.6 192.8-3.5 175.7 1.1s-27.2 22.1-22.6 39.2L206 237.8c2.5 9.2-4.5 18.2-14 18.2-6.4 0-12-4.2-13.9-10.3L134.6 102.7c-5.1-16.9-23-26.4-39.9-21.3s-26.4 23-21.3 39.9l62.8 206.4c2.4 7.9-7.2 13.8-13.2 8.1L67.6 283c-16-15.2-41.3-14.6-56.6 1.4S-3.6 325.7 12.4 341L124.8 448c43.1 41.1 100.4 64 160 64l19.1 0c.1 0 .1-.1 .1-.1s.1-.1 .1-.1c58.3-3.5 108.6-43.2 125.3-99.7l81.2-275c5-16.9-4.7-34.7-21.6-39.8s-34.7 4.7-39.8 21.6L411.5 247.1c-1.6 5.3-6.4 8.9-12 8.9-7.9 0-13.8-7.3-12.2-15.1l36-170.3c3.7-17.3-7.4-34.3-24.7-37.9s-34.3 7.4-37.9 24.7L323.1 235.1c-2.6 12.2-13.3 20.9-25.8 20.9-11.9 0-22.4-8-25.4-19.5l-57-212.8z\"]\n};\nvar faWandMagicSparkles = {\n  prefix: 'fas',\n  iconName: 'wand-magic-sparkles',\n  icon: [576, 512, [\"magic-wand-sparkles\"], \"e2ca\", \"M263.4-27L278.2 9.8 315 24.6c3 1.2 5 4.2 5 7.4s-2 6.2-5 7.4L278.2 54.2 263.4 91c-1.2 3-4.2 5-7.4 5s-6.2-2-7.4-5L233.8 54.2 197 39.4c-3-1.2-5-4.2-5-7.4s2-6.2 5-7.4L233.8 9.8 248.6-27c1.2-3 4.2-5 7.4-5s6.2 2 7.4 5zM110.7 41.7l21.5 50.1 50.1 21.5c5.9 2.5 9.7 8.3 9.7 14.7s-3.8 12.2-9.7 14.7l-50.1 21.5-21.5 50.1c-2.5 5.9-8.3 9.7-14.7 9.7s-12.2-3.8-14.7-9.7L59.8 164.2 9.7 142.7C3.8 140.2 0 134.4 0 128s3.8-12.2 9.7-14.7L59.8 91.8 81.3 41.7C83.8 35.8 89.6 32 96 32s12.2 3.8 14.7 9.7zM464 304c6.4 0 12.2 3.8 14.7 9.7l21.5 50.1 50.1 21.5c5.9 2.5 9.7 8.3 9.7 14.7s-3.8 12.2-9.7 14.7l-50.1 21.5-21.5 50.1c-2.5 5.9-8.3 9.7-14.7 9.7s-12.2-3.8-14.7-9.7l-21.5-50.1-50.1-21.5c-5.9-2.5-9.7-8.3-9.7-14.7s3.8-12.2 9.7-14.7l50.1-21.5 21.5-50.1c2.5-5.9 8.3-9.7 14.7-9.7zM460 0c11 0 21.6 4.4 29.5 12.2l42.3 42.3C539.6 62.4 544 73 544 84s-4.4 21.6-12.2 29.5l-88.2 88.2-101.3-101.3 88.2-88.2C438.4 4.4 449 0 460 0zM44.2 398.5L308.4 134.3 409.7 235.6 145.5 499.8C137.6 507.6 127 512 116 512s-21.6-4.4-29.5-12.2L44.2 457.5C36.4 449.6 32 439 32 428s4.4-21.6 12.2-29.5z\"]\n};\nvar faMagicWandSparkles = faWandMagicSparkles;\nvar faCommentMedical = {\n  prefix: 'fas',\n  iconName: 'comment-medical',\n  icon: [512, 512, [], \"f7f5\", \"M256 480c141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240c0 54.3 19.2 104.3 51.6 144.5L2.8 476.8c-4.8 9-3.3 20 3.6 27.5s17.8 9.8 27.1 5.8l118.4-50.7C183.7 472.6 218.9 480 256 480zM217.6 153.6c0-10.6 8.6-19.2 19.2-19.2l38.4 0c10.6 0 19.2 8.6 19.2 19.2l0 48 48 0c10.6 0 19.2 8.6 19.2 19.2l0 38.4c0 10.6-8.6 19.2-19.2 19.2l-48 0 0 48c0 10.6-8.6 19.2-19.2 19.2l-38.4 0c-10.6 0-19.2-8.6-19.2-19.2l0-48-48 0c-10.6 0-19.2-8.6-19.2-19.2l0-38.4c0-10.6 8.6-19.2 19.2-19.2l48 0 0-48z\"]\n};\nvar faBellSlash = {\n  prefix: 'fas',\n  iconName: 'bell-slash',\n  icon: [576, 512, [128277, 61943], \"f1f6\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-87.5-87.5c17.2-2.4 30.5-17.3 30.5-35.2 0-8.1-2.7-15.9-7.8-22.2l-9.8-12.2C464.4 308.5 448 261.8 448 213.7l0-21.7c0-77.4-55-142-128-156.8l0-3.2c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 3.2c-38.6 7.8-72.2 29.6-95.2 59.7L41-24.9zm87 238.5c0 48.1-16.4 94.8-46.4 132.4l-9.8 12.2c-5 6.3-7.8 14.1-7.8 22.2 0 19.6 15.9 35.5 35.5 35.5l235.3 0-206.9-206.9 0 4.5zM288 512c29.8 0 54.9-20.4 62-48l-124 0c7.1 27.6 32.2 48 62 48z\"]\n};\nvar faHandshakeSlash = {\n  prefix: 'fas',\n  iconName: 'handshake-slash',\n  icon: [576, 512, [57439, \"handshake-alt-slash\", \"handshake-simple-slash\"], \"e060\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-288-288 14.2-14.2c4.2-4.2 9.5-6.5 14.9-6.9 6.8-.6 13.8 1.7 19 6.9L505.6 376 576 320 576 32 464 96 440.2 80.1C424.4 69.6 405.9 64 386.9 64l-70.4 0c-1.1 0-2.3 0-3.4 .1-16.9 .9-32.8 8.5-44.2 21.1l-55.8 62.1-34-34 44.3-49.2-39.7 0c-15.3 0-30.1 3.6-43.5 10.4L41-24.9zM0 69.8L0 320 156.4 450.3c23 19.2 52 29.7 81.9 29.7l15.7 0-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l41 41 9 0c22.2 0 43.8-5.8 62.8-16.4L0 69.8z\"]\n};\nvar faHandshakeAltSlash = faHandshakeSlash;\nvar faHandshakeSimpleSlash = faHandshakeSlash;\nvar faBottleWater = {\n  prefix: 'fas',\n  iconName: 'bottle-water',\n  icon: [320, 512, [], \"e4c5\", \"M112-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0C94.3 32 80 17.7 80 0s14.3-32 32-32zM16 144c0-35.3 28.7-64 64-64l160 0c35.3 0 64 28.7 64 64 0 24.1-13.3 45.1-33 56 19.7 10.9 33 31.9 33 56s-13.3 45.1-33 56c19.7 10.9 33 31.9 33 56s-13.3 45.1-33 56c19.7 10.9 33 31.9 33 56 0 35.3-28.7 64-64 64L80 544c-35.3 0-64-28.7-64-64 0-24.1 13.3-45.1 33-56-19.7-10.9-33-31.9-33-56s13.3-45.1 33-56c-19.7-10.9-33-31.9-33-56s13.3-45.1 33-56c-19.7-10.9-33-31.9-33-56z\"]\n};\nvar faDiceD20 = {\n  prefix: 'fas',\n  iconName: 'dice-d20',\n  icon: [512, 512, [], \"f6cf\", \"M224.4-8.2c19.6-11.1 43.6-11.1 63.1 0l192 108.8c20 11.4 32.4 32.6 32.4 55.7l0 215.6c0 23-12.4 44.3-32.4 55.7l-192 108.8c-19.6 11.1-43.6 11.1-63.1 0L32.4 427.5C12.4 416.1 0 394.8 0 371.8L0 156.2c0-23 12.4-44.3 32.4-55.7L224.4-8.2zm52 73.2C267 49.8 245 49.8 235.6 65l-76.6 123.7-85.4-46.3-3.8-1.6c-8.9-2.7-18.8 1.1-23.4 9.6s-2.4 18.9 4.7 24.8l3.3 2.3 83.4 45.2-74.6 120.6C55.3 356.2 61 373 75 378.4l161 61.9 0 39.7c0 11 9 20 20 20s20-9 20-20l0-39.7 161-61.9c14-5.4 19.7-22.2 11.8-35l-74.7-120.6 83.4-45.2c9.7-5.3 13.3-17.4 8.1-27.1s-17.4-13.3-27.1-8.1L353 188.7 276.4 65zm-47 329.9l-122-46.9 54.5-88.1 67.5 135zM404.6 348l-122 46.9 67.5-135 54.5 88.1zM319.3 232L256 358.6 192.7 232 319.3 232zM308 192l-104.1 0 52-84 52 84z\"]\n};\nvar faArrowDownZA = {\n  prefix: 'fas',\n  iconName: 'arrow-down-z-a',\n  icon: [512, 512, [\"sort-alpha-desc\", \"sort-alpha-down-alt\"], \"f881\", \"M230.6 390.6l-80 80c-12.5 12.5-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 25.4-25.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM288 64c0-17.7 14.3-32 32-32l128 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L397.3 160 448 160c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9L370.8 96 320 96c-17.7 0-32-14.3-32-32zM412.6 273.7l80 160c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3l-7.2-14.3-88.4 0-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9l80-160c5.4-10.8 16.5-17.7 28.6-17.7s23.2 6.8 28.6 17.7zM384 359.6l-20.2 40.4 40.4 0-20.2-40.4z\"]\n};\nvar faSortAlphaDesc = faArrowDownZA;\nvar faSortAlphaDownAlt = faArrowDownZA;\nvar faBrush = {\n  prefix: 'fas',\n  iconName: 'brush',\n  icon: [384, 512, [], \"f55d\", \"M162.4 6c-1.5-3.6-5-6-8.9-6l-19 0c-3.9 0-7.5 2.4-8.9 6L104.9 57.7c-3.2 8-14.6 8-17.8 0L66.4 6c-1.5-3.6-5-6-8.9-6L48 0C21.5 0 0 21.5 0 48l0 208 384 0 0-208c0-26.5-21.5-48-48-48L230.5 0c-3.9 0-7.5 2.4-8.9 6L200.9 57.7c-3.2 8-14.6 8-17.8 0L162.4 6zM0 304l0 16c0 35.3 28.7 64 64 64l64 0 0 64c0 35.3 28.7 64 64 64s64-28.7 64-64l0-64 64 0c35.3 0 64-28.7 64-64l0-16-384 0zM192 464c-8.8 0-16-7.2-16-16s7.2-16 16-16 16 7.2 16 16-7.2 16-16 16z\"]\n};\nvar faPersonWalkingDashedLineArrowRight = {\n  prefix: 'fas',\n  iconName: 'person-walking-dashed-line-arrow-right',\n  icon: [640, 512, [], \"e553\", \"M160 80a56 56 0 1 0 0-112 56 56 0 1 0 0 112zM73.4 227.9l22.6-22.6 0 69.3c0 28 12.2 54.7 33.5 72.9l71.4 61.2c5.9 5.1 9.8 12.1 10.9 19.8l12.6 88.1c2.5 17.5 18.7 29.7 36.2 27.2s29.7-18.7 27.2-36.2l-12.6-88.1c-3.3-23.1-14.9-44.1-32.6-59.3l-34.5-29.6 0-115.2 3.8 4.7c18.2 22.8 45.8 36 75 36l33.2 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-33.2 0c-9.7 0-18.9-4.4-25-12l-17.9-22.4c-23-28.8-57.9-45.6-94.8-45.6-32.2 0-63.1 12.8-85.8 35.6L28.1 182.6C10.1 200.6 0 225 0 250.5L0 288c0 17.7 14.3 32 32 32s32-14.3 32-32l0-37.5c0-8.5 3.4-16.6 9.4-22.6zM85.8 407.3c-1.5 5.2-4.3 10-8.1 13.8L9.4 489.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l68.3-68.3c11.5-11.5 19.9-25.8 24.4-41.5l2.2-7.6-46-39.4c-2.5-2.2-5-4.4-7.4-6.8L85.8 407.3zM432 8c0-13.3-10.7-24-24-24S384-5.3 384 8l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32zm0 128c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32zM408 320c-13.3 0-24 10.7-24 24l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32c0-13.3-10.7-24-24-24zm24 152c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32zM609 273c9.4-9.4 9.4-24.6 0-33.9l-72-72c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-102.1 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l102.1 0-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72z\"]\n};\nvar faArrowUpShortWide = {\n  prefix: 'fas',\n  iconName: 'arrow-up-short-wide',\n  icon: [576, 512, [\"sort-amount-up-alt\"], \"f885\", \"M320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0zM150.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 141.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96z\"]\n};\nvar faSortAmountUpAlt = faArrowUpShortWide;\nvar faGripVertical = {\n  prefix: 'fas',\n  iconName: 'grip-vertical',\n  icon: [320, 512, [\"grid-vertical\"], \"f58e\", \"M128 40c0-22.1-17.9-40-40-40L40 0C17.9 0 0 17.9 0 40L0 88c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm0 192c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zM0 424l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM320 40c0-22.1-17.9-40-40-40L232 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zM192 232l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM320 424c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48z\"]\n};\nvar faGridVertical = faGripVertical;\nvar faCarTunnel = {\n  prefix: 'fas',\n  iconName: 'car-tunnel',\n  icon: [512, 512, [], \"e4de\", \"M256 0C114.6 0 0 114.6 0 256L0 448c0 35.3 28.7 64 64 64l42.8 0c-6.6-5.9-10.8-14.4-10.8-24l0-113.1c0-13.5 3.1-26.8 9-38.9l39.7-80.8c9.4-19.1 28.9-31.3 50.2-31.3L317 224c21.3 0 40.8 12.1 50.2 31.3L407 336c5.9 12.1 9 25.4 9 38.9L416 488c0 9.6-4.2 18.1-10.8 24l42.8 0c35.3 0 64-28.7 64-64l0-192C512 114.6 397.4 0 256 0zM362.8 512c-6.6-5.9-10.8-14.4-10.8-24l0-24-192 0 0 24c0 9.6-4.2 18.1-10.8 24l213.7 0zm-175-235.5l-29.3 59.5 194.9 0-29.3-59.5c-1.3-2.7-4.1-4.5-7.2-4.5L195 272c-3 0-5.8 1.7-7.2 4.5zM176 424a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm184-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faChartColumn = {\n  prefix: 'fas',\n  iconName: 'chart-column',\n  icon: [512, 512, [], \"e0e3\", \"M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zM144 224c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm144-64l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32s32 14.3 32 32zm80 32c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c0-17.7 14.3-32 32-32zM512 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-224c0-17.7 14.3-32 32-32s32 14.3 32 32z\"]\n};\nvar faCapricorn = {\n  prefix: 'fas',\n  iconName: 'capricorn',\n  icon: [576, 512, [], \"e848\", \"M240 32c79.5 0 144 64.5 144 144l0 65.2c18.8-10.9 40.7-17.2 64-17.2 70.7 0 128 57.3 128 128S518.7 480 448 480c-35.8 0-68.2-14.7-91.4-38.4-28.8 42.5-77.4 70.4-132.6 70.4-17.7 0-32-14.3-32-32s14.3-32 32-32c53 0 96-43 96-96l0-176c0-44.2-35.8-80-80-80s-80 35.8-80 80l0 208c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-224c0-35.3-28.7-64-64-64-17.7 0-32-14.3-32-32S14.3 32 32 32C72.6 32 108.8 51 132.2 80.5 158.6 50.7 197.1 32 240 32zM448 288a64 64 0 1 0 0 128 64 64 0 1 0 0-128z\"]\n};\nvar faTruckArrowRight = {\n  prefix: 'fas',\n  iconName: 'truck-arrow-right',\n  icon: [576, 512, [], \"e58b\", \"M64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64l3.3 0c10.4 36.9 44.4 64 84.7 64s74.2-27.1 84.7-64l102.6 0c10.4 36.9 44.4 64 84.7 64s74.2-27.1 84.7-64l3.3 0c35.3 0 64-28.7 64-64l0-146.7c0-17-6.7-33.3-18.7-45.3L512 146.7c-12-12-28.3-18.7-45.3-18.7l-50.7 0 0-32c0-35.3-28.7-64-64-64L64 32zM512 237.3l0 50.7-96 0 0-96 50.7 0 45.3 45.3zM152 384a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm232 40a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM305 225l-72 72c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-102.1 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l102.1 0-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9z\"]\n};\nvar faTv = {\n  prefix: 'fas',\n  iconName: 'tv',\n  icon: [576, 512, [63717, \"television\", \"tv-alt\"], \"f26c\", \"M64 96l0 240 448 0 0-240-448 0zM0 96C0 60.7 28.7 32 64 32l448 0c35.3 0 64 28.7 64 64l0 240c0 35.3-28.7 64-64 64L64 400c-35.3 0-64-28.7-64-64L0 96zM160 448l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faTelevision = faTv;\nvar faTvAlt = faTv;\nvar faSection = {\n  prefix: 'fas',\n  iconName: 'section',\n  icon: [256, 512, [], \"e447\", \"M110 0C49.2 0 0 49.2 0 110 0 133.7 7.6 155.8 20.5 174 7.6 192 0 214.1 0 238 0 291.7 38.9 337.6 91.9 346.4l61.7 10.3c22.2 3.7 38.4 22.9 38.4 45.3 0 25.4-20.6 46-46 46l-98 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l98 0c60.7 0 110-49.2 110-110 0-23.7-7.6-45.9-20.5-64 12.9-18 20.5-40.1 20.5-64 0-53.8-38.9-99.6-91.9-108.5l-61.7-10.3C80.2 151.6 64 132.4 64 110 64 84.6 84.6 64 110 64l98 0c17.7 0 32-14.3 32-32S225.7 0 208 0L110 0zm74.7 299.1c-6.5-2.4-13.4-4.3-20.5-5.5l-61.7-10.3c-22.2-3.7-38.4-22.9-38.4-45.3 0-9.2 2.7-17.8 7.4-25 6.5 2.4 13.4 4.3 20.5 5.5l61.7 10.3c22.2 3.7 38.4 22.9 38.4 45.3 0 9.2-2.7 17.8-7.4 25z\"]\n};\nvar faPeace = {\n  prefix: 'fas',\n  iconName: 'peace',\n  icon: [512, 512, [9774], \"f67c\", \"M224 445.3l0-121.8-94.3 77.1c26.1 22.8 58.5 38.7 94.3 44.7zM89.2 351.1L224 240.8 224 66.7c-90.8 15.2-160 94.2-160 189.3 0 34.6 9.2 67.1 25.2 95.1zm293.1 49.5l-94.3-77.1 0 121.8c35.7-6 68.1-21.9 94.3-44.7zm40.6-49.5c16-28 25.2-60.5 25.2-95.1 0-95.1-69.2-174.1-160-189.3l0 174.2 134.8 110.3zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z\"]\n};\nvar faStar = {\n  prefix: 'fas',\n  iconName: 'star',\n  icon: [576, 512, [11088, 61446], \"f005\", \"M309.5-18.9c-4.1-8-12.4-13.1-21.4-13.1s-17.3 5.1-21.4 13.1L193.1 125.3 33.2 150.7c-8.9 1.4-16.3 7.7-19.1 16.3s-.5 18 5.8 24.4l114.4 114.5-25.2 159.9c-1.4 8.9 2.3 17.9 9.6 23.2s16.9 6.1 25 2L288.1 417.6 432.4 491c8 4.1 17.7 3.3 25-2s11-14.2 9.6-23.2L441.7 305.9 556.1 191.4c6.4-6.4 8.6-15.8 5.8-24.4s-10.1-14.9-19.1-16.3L383 125.3 309.5-18.9z\"]\n};\nvar faFlag = {\n  prefix: 'fas',\n  iconName: 'flag',\n  icon: [448, 512, [127988, 61725], \"f024\", \"M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32L0 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-121.6 62.7-18.8c41.9-12.6 87.1-8.7 126.2 10.9 42.7 21.4 92.5 24 137.2 7.2l37.1-13.9c12.5-4.7 20.8-16.6 20.8-30l0-247.7c0-23-24.2-38-44.8-27.7l-11.8 5.9c-44.9 22.5-97.8 22.5-142.8 0-36.4-18.2-78.3-21.8-117.2-10.1L64 54.4 64 32z\"]\n};\nvar faTriangleExclamation = {\n  prefix: 'fas',\n  iconName: 'triangle-exclamation',\n  icon: [512, 512, [9888, \"exclamation-triangle\", \"warning\"], \"f071\", \"M256 0c14.7 0 28.2 8.1 35.2 21l216 400c6.7 12.4 6.4 27.4-.8 39.5S486.1 480 472 480L40 480c-14.1 0-27.2-7.4-34.4-19.5s-7.5-27.1-.8-39.5l216-400c7-12.9 20.5-21 35.2-21zm0 352a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.5 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z\"]\n};\nvar faExclamationTriangle = faTriangleExclamation;\nvar faWarning = faTriangleExclamation;\nvar faSchoolCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'school-circle-exclamation',\n  icon: [640, 512, [], \"e56c\", \"M64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l276 0c-10.5-14.6-19-30.7-25.1-48l-90.9 0 0-88c0-22.1 17.9-40 40-40l48 0c1 0 1.9 0 2.9 .1 26.3-74.6 97.5-128.1 181.1-128.1 28.6 0 55.6 6.2 80 17.4l0-33.4c0-35.3-28.7-64-64-64l-64 0-127.9-115.1c-18.3-16.4-46-16.4-64.2 0L128 128 64 128zm64 240c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32zM112 256l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16zM288 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-140c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z\"]\n};\nvar faGraduationCap = {\n  prefix: 'fas',\n  iconName: 'graduation-cap',\n  icon: [576, 512, [127891, \"mortar-board\"], \"f19d\", \"M48 195.8l209.2 86.1c9.8 4 20.2 6.1 30.8 6.1s21-2.1 30.8-6.1l242.4-99.8c9-3.7 14.8-12.4 14.8-22.1s-5.8-18.4-14.8-22.1L318.8 38.1C309 34.1 298.6 32 288 32s-21 2.1-30.8 6.1L14.8 137.9C5.8 141.6 0 150.3 0 160L0 456c0 13.3 10.7 24 24 24s24-10.7 24-24l0-260.2zm48 71.7L96 384c0 53 86 96 192 96s192-43 192-96l0-116.6-142.9 58.9c-15.6 6.4-32.2 9.7-49.1 9.7s-33.5-3.3-49.1-9.7L96 267.4z\"]\n};\nvar faMortarBoard = faGraduationCap;\nvar faStore = {\n  prefix: 'fas',\n  iconName: 'store',\n  icon: [512, 512, [], \"f54e\", \"M30.7 72.3C37.6 48.4 59.5 32 84.4 32l344 0c24.9 0 46.8 16.4 53.8 40.3l23.4 80.2c12.8 43.7-20.1 87.5-65.6 87.5-26.3 0-49.4-14.9-60.8-37.1-11.6 21.9-34.6 37.1-61.4 37.1-26.6 0-49.7-15-61.3-37-11.6 22-34.7 37-61.3 37-26.8 0-49.8-15.1-61.4-37.1-11.4 22.1-34.5 37.1-60.8 37.1-45.6 0-78.4-43.7-65.6-87.5L30.7 72.3zM96.4 352l320 0 0-66.4c7.6 1.6 15.5 2.4 23.5 2.4 14.3 0 28-2.6 40.5-7.2l0 151.2c0 26.5-21.5 48-48 48l-352 0c-26.5 0-48-21.5-48-48l0-151.2c12.5 4.6 26.1 7.2 40.5 7.2 8.1 0 15.9-.8 23.5-2.4l0 66.4z\"]\n};\nvar faUserAstronaut = {\n  prefix: 'fas',\n  iconName: 'user-astronaut',\n  icon: [448, 512, [], \"f4fb\", \"M224 336c74.6 0 138.4-46.4 164-112l4 0c13.3 0 24-10.7 24-24l0-80c0-13.3-10.7-24-24-24l-4 0C362.4 30.4 298.6-16 224-16S85.6 30.4 60 96l-4 0c-13.3 0-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24l4 0c25.6 65.6 89.4 112 164 112zM208 80l32 0c53 0 96 43 96 96s-43 96-96 96l-32 0c-53 0-96-43-96-96s43-96 96-96zM16 484.6C16 499.7 28.3 512 43.4 512l52.6 0 0-48c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32l0 48 52.6 0c15.1 0 27.4-12.3 27.4-27.4 0-59.8-31.9-112.2-79.6-141-36.4 25.5-80.6 40.4-128.4 40.4s-92-14.9-128.4-40.4C47.9 372.4 16 424.8 16 484.6zM183.3 141.5c-.9-3.3-3.9-5.5-7.3-5.5s-6.4 2.2-7.3 5.5l-6 21.2-21.2 6c-3.3 .9-5.5 3.9-5.5 7.3s2.2 6.4 5.5 7.3l21.2 6 6 21.2c.9 3.3 3.9 5.5 7.3 5.5s6.4-2.2 7.3-5.5l6-21.2 21.2-6c3.3-.9 5.5-3.9 5.5-7.3s-2.2-6.4-5.5-7.3l-21.2-6-6-21.2zM152 488l0 24 48 0 0-24c0-13.3-10.7-24-24-24s-24 10.7-24 24zm120-24c-13.3 0-24 10.7-24 24l0 24 48 0 0-24c0-13.3-10.7-24-24-24z\"]\n};\nvar faBuildingFlag = {\n  prefix: 'fas',\n  iconName: 'building-flag',\n  icon: [640, 512, [], \"e4d5\", \"M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM176 352l32 0c17.7 0 32 14.3 32 32l0 80-96 0 0-80c0-17.7 14.3-32 32-32zM96 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM240 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM96 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm144-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM464 0c-17.7 0-32 14.3-32 32l0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-288 112 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32L496 32c0-17.7-14.3-32-32-32z\"]\n};\nvar faMugSaucer = {\n  prefix: 'fas',\n  iconName: 'mug-saucer',\n  icon: [576, 512, [\"coffee\"], \"f0f4\", \"M64 64c0-17.7 14.3-32 32-32l352 0c70.7 0 128 57.3 128 128S518.7 288 448 288c0 53-43 96-96 96l-192 0c-53 0-96-43-96-96L64 64zm448 96c0-35.3-28.7-64-64-64l0 128c35.3 0 64-28.7 64-64zM64 448l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L64 512c-17.7 0-32-14.3-32-32s14.3-32 32-32z\"]\n};\nvar faCoffee = faMugSaucer;\nvar faLemon = {\n  prefix: 'fas',\n  iconName: 'lemon',\n  icon: [448, 512, [127819], \"f094\", \"M448 96c0-35.3-28.7-64-64-64-6.6 0-13 1-19 2.9-22.5 7-48.1 14.9-71 9-75.2-19.1-156.4 11-213.7 68.3S-7.2 250.8 11.9 326c5.8 22.9-2 48.4-9 71-1.9 6-2.9 12.4-2.9 19 0 35.3 28.7 64 64 64 6.6 0 13-1 19.1-2.9 22.5-7 48.1-14.9 71-9 75.2 19.1 156.4-11 213.7-68.3S455.2 261.2 436.1 186c-5.8-22.9 2-48.4 9-71 1.9-6 2.9-12.4 2.9-19.1zM222.7 143c-52 15.2-96.5 59.7-111.7 111.7-3.7 12.7-17.1 20-29.8 16.3S61.2 254 65 241.3c19.8-67.7 76.6-124.5 144.3-144.3 12.7-3.7 26.1 3.6 29.8 16.3s-3.6 26.1-16.3 29.8z\"]\n};\nvar faCaravan = {\n  prefix: 'fas',\n  iconName: 'caravan',\n  icon: [640, 512, [], \"f8ff\", \"M32 96c0-35.3 28.7-64 64-64l320 0c70.7 0 128 57.3 128 128l0 192 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-296.4 0c.2 2.6 .4 5.3 .4 8 0 48.6-39.4 88-88 88s-88-39.4-88-88c0-2.7 .1-5.4 .4-8L96 416c-35.3 0-64-28.7-64-64L32 96zM352 352l64 0c17.7 0 32-14.3 32-32l0-48-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 160c0 17.7 14.3 32 32 32zM160 128c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0zm64 336a40 40 0 1 0 0-80 40 40 0 1 0 0 80z\"]\n};\nvar faQ = {\n  prefix: 'fas',\n  iconName: 'q',\n  icon: [448, 512, [113], \"51\", \"M64 256c0 88.4 71.6 160 160 160 28.9 0 56-7.7 79.4-21.1l-72-86.4c-11.3-13.6-9.5-33.8 4.1-45.1s33.8-9.5 45.1 4.1l70.9 85.1c20.4-26.8 32.5-60.3 32.5-96.6 0-88.4-71.6-160-160-160S64 167.6 64 256zM344.9 444.6C310 467 268.5 480 224 480 100.3 480 0 379.7 0 256S100.3 32 224 32 448 132.3 448 256c0 56.1-20.6 107.4-54.7 146.7l47.3 56.8c11.3 13.6 9.5 33.8-4.1 45.1s-33.8 9.5-45.1-4.1l-46.6-55.9z\"]\n};\nvar faLock = {\n  prefix: 'fas',\n  iconName: 'lock',\n  icon: [384, 512, [128274], \"f023\", \"M128 96l0 64 128 0 0-64c0-35.3-28.7-64-64-64s-64 28.7-64 64zM64 160l0-64C64 25.3 121.3-32 192-32S320 25.3 320 96l0 64c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64z\"]\n};\nvar faPaintRoller = {\n  prefix: 'fas',\n  iconName: 'paint-roller',\n  icon: [512, 512, [], \"f5aa\", \"M0 64C0 28.7 28.7 0 64 0L352 0c35.3 0 64 28.7 64 64l16 0c44.2 0 80 35.8 80 80l0 96c0 44.2-35.8 80-80 80l-160 0c-8.8 0-16 7.2-16 16l0 18.7c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-96c0-20.9 13.4-38.7 32-45.3l0-18.7c0-44.2 35.8-80 80-80l160 0c8.8 0 16-7.2 16-16l0-96c0-8.8-7.2-16-16-16l-16 0c0 35.3-28.7 64-64 64L64 192c-35.3 0-64-28.7-64-64L0 64z\"]\n};\nvar faVolumeHigh = {\n  prefix: 'fas',\n  iconName: 'volume-high',\n  icon: [640, 512, [128266, \"volume-up\"], \"f028\", \"M533.6 32.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C557.5 113.8 592 180.8 592 256s-34.5 142.2-88.7 186.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C598.5 426.7 640 346.2 640 256S598.5 85.2 533.6 32.5zM473.1 107c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C475.3 170.7 496 210.9 496 256s-20.7 85.3-53.2 111.8c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5c43.2-35.2 70.9-88.9 70.9-149s-27.7-113.8-70.9-149zm-60.5 74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C393.1 227.6 400 241 400 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C434.1 312.9 448 286.1 448 256s-13.9-56.9-35.4-74.5zM80 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L128 160 80 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48z\"]\n};\nvar faVolumeUp = faVolumeHigh;\nvar faFolderPlus = {\n  prefix: 'fas',\n  iconName: 'folder-plus',\n  icon: [512, 512, [], \"f65e\", \"M512 384c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l138.7 0c13.8 0 27.3 4.5 38.4 12.8l38.4 28.8c5.5 4.2 12.3 6.4 19.2 6.4L448 80c35.3 0 64 28.7 64 64l0 240zM256 160c-13.3 0-24 10.7-24 24l0 48-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0 0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48 48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-48c0-13.3-10.7-24-24-24z\"]\n};\nvar faMercury = {\n  prefix: 'fas',\n  iconName: 'mercury',\n  icon: [384, 512, [9791], \"f223\", \"M117-4C106-17.8 85.8-20 72.1-9s-16 31.2-5 45C74.9 45.7 83.7 54.5 93.5 62.1 46.7 93.7 16 147.3 16 208 16 294.3 78.1 366.1 160 381.1l0 34.9-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-34.9c81.9-15 144-86.8 144-173.1 0-60.7-30.7-114.3-77.5-145.9 9.8-7.7 18.7-16.4 26.4-26.1 11.1-13.8 8.8-33.9-5-45S278-17.8 267-4c-17.6 22-44.7 36-75 36S134.7 18 117-4zm75 324c-61.9 0-112-50.1-112-112S130.1 96 192 96 304 146.1 304 208c0 61.8-50.1 112-111.9 112l-.1 0z\"]\n};\nvar faAnchor = {\n  prefix: 'fas',\n  iconName: 'anchor',\n  icon: [576, 512, [9875], \"f13d\", \"M288 64a32 32 0 1 0 0 64 32 32 0 1 0 0-64zM192 96c0-53 43-96 96-96s96 43 96 96c0 41.8-26.7 77.4-64 90.5l0 257.9c62.9-14.3 110.2-69.7 111.9-136.5l-16.1 14.1c-10 8.7-25.1 7.7-33.9-2.3s-7.7-25.1 2.3-33.9l64-56c9-7.9 22.6-7.9 31.6 0l64 56c10 8.7 11 23.9 2.3 33.9s-23.9 11-33.9 2.3L496 307.9C493.9 421 401.6 512 288 512S82.1 421 80 307.9L63.8 322.1c-10 8.7-25.1 7.7-33.9-2.3s-7.7-25.1 2.3-33.9l64-56c9-7.9 22.6-7.9 31.6 0l64 56c10 8.7 11 23.9 2.3 33.9s-23.9 11-33.9 2.3l-16.1-14.1c1.8 66.8 49.1 122.2 111.9 136.5l0-257.9c-37.3-13.2-64-48.7-64-90.5z\"]\n};\nvar faSquareParking = {\n  prefix: 'fas',\n  iconName: 'square-parking',\n  icon: [448, 512, [127359, \"parking\"], \"f540\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM192 256l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-48 0 0 64zm48 64l-48 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-184c0-22.1 17.9-40 40-40l72 0c53 0 96 43 96 96s-43 96-96 96z\"]\n};\nvar faParking = faSquareParking;\nvar faHanukiah = {\n  prefix: 'fas',\n  iconName: 'hanukiah',\n  icon: [640, 512, [128334], \"f6e6\", \"M314.2 3.3c-5.1 8.8-18.2 33.3-18.2 52.7 0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zm-288 48C21.1 60.1 8 84.6 8 104 8 117.3 18.7 128 32 128s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM88 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C101.1 60.1 88 84.6 88 104zm82.2-52.7c-5.1 8.8-18.2 33.3-18.2 52.7 0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM216 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C229.1 60.1 216 84.6 216 104zM394.2 51.3c-5.1 8.8-18.2 33.3-18.2 52.7 0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM440 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C453.1 60.1 440 84.6 440 104zm82.2-52.7c-5.1 8.8-18.2 33.3-18.2 52.7 0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3zM584 104c0 13.3 10.7 24 24 24s24-10.7 24-24c0-19.4-13.1-43.9-18.2-52.7-1.2-2.1-3.4-3.3-5.8-3.3s-4.6 1.2-5.8 3.3C597.1 60.1 584 84.6 584 104zM112 160c-8.8 0-16 7.2-16 16l0 112 32 0 0-112c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 112 32 0 0-112c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 112 32 0 0-112c0-8.8-7.2-16-16-16zm160 0c-8.8 0-16 7.2-16 16l0 112 32 0 0-112c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 112 32 0 0-112c0-8.8-7.2-16-16-16zm64 0c-8.8 0-16 7.2-16 16l0 112 32 0 0-112c0-8.8-7.2-16-16-16zM352 144c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 176-192 0c-17.7 0-32-14.3-32-32l0-96c0-17.7-14.3-32-32-32S0 174.3 0 192l0 96c0 53 43 96 96 96l192 0 0 64-128 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-128 0 0-64 192 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32l-192 0 0-176z\"]\n};\nvar faRotateLeft = {\n  prefix: 'fas',\n  iconName: 'rotate-left',\n  icon: [512, 512, [\"rotate-back\", \"rotate-backward\", \"undo-alt\"], \"f2ea\", \"M24 192l144 0c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-46.7-46.7c75.3-58.6 184.3-53.3 253.5 15.9 75 75 75 196.5 0 271.5s-196.5 75-271.5 0c-10.2-10.2-19-21.3-26.4-33-9.5-14.9-29.3-19.3-44.2-9.8s-19.3 29.3-9.8 44.2C49.7 408.7 61.4 423.5 75 437 175 537 337 537 437 437S537 175 437 75C342.8-19.3 193.3-24.7 92.7 58.8L41 7C34.1 .2 23.8-1.9 14.8 1.8S0 14.3 0 24L0 168c0 13.3 10.7 24 24 24z\"]\n};\nvar faRotateBack = faRotateLeft;\nvar faRotateBackward = faRotateLeft;\nvar faUndoAlt = faRotateLeft;\nvar faHeading = {\n  prefix: 'fas',\n  iconName: 'heading',\n  icon: [448, 512, [\"header\"], \"f1dc\", \"M0 64C0 46.3 14.3 32 32 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 112 224 0 0-112-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 320 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-144-224 0 0 144 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-320-16 0C14.3 96 0 81.7 0 64z\"]\n};\nvar faHeader = faHeading;\nvar faCrosshairs = {\n  prefix: 'fas',\n  iconName: 'crosshairs',\n  icon: [576, 512, [], \"f05b\", \"M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM131.2 288c12.7 62.7 62.1 112.1 124.8 124.8l0-12.8c0-17.7 14.3-32 32-32s32 14.3 32 32l0 12.8c62.7-12.7 112.1-62.1 124.8-124.8L432 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l12.8 0C432.1 161.3 382.7 111.9 320 99.2l0 12.8c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-12.8C193.3 111.9 143.9 161.3 131.2 224l12.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-12.8 0zM288 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96z\"]\n};\nvar faCircleNodes = {\n  prefix: 'fas',\n  iconName: 'circle-nodes',\n  icon: [512, 512, [], \"e4e2\", \"M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9 0-44.2-35.8-80-80-80-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128 35.8 128 0 163.8 0 208s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2 0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z\"]\n};\nvar faWindowRestore = {\n  prefix: 'fas',\n  iconName: 'window-restore',\n  icon: [576, 512, [], \"f2d2\", \"M512 96L160 96c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64l-48 0 0-64 48 0 0-192zM0 224c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 224zm64 40c0 13.3 10.7 24 24 24l240 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 240c-13.3 0-24 10.7-24 24z\"]\n};\nvar faR = {\n  prefix: 'fas',\n  iconName: 'r',\n  icon: [320, 512, [114], \"52\", \"M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 95.3 0 102.4 146.4c10.1 14.5 30.1 18 44.6 7.9s18-30.1 7.9-44.6L230.1 309.5C282.8 288.1 320 236.4 320 176 320 96.5 255.5 32 176 32L32 32zM176 256l-112 0 0-160 112 0c44.2 0 80 35.8 80 80s-35.8 80-80 80z\"]\n};\nvar faFilterCircleXmark = {\n  prefix: 'fas',\n  iconName: 'filter-circle-xmark',\n  icon: [576, 512, [], \"e17b\", \"M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c2.5 2.5 5.3 4.5 8.3 6-21.2-30.9-33.6-68.3-33.6-108.6 0-99.4 75.5-181.1 172.3-191l90.4-90.4c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64zM432 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7l-36.7 36.7 36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z\"]\n};\nvar faGopuram = {\n  prefix: 'fas',\n  iconName: 'gopuram',\n  icon: [512, 512, [], \"f664\", \"M120 0c13.3 0 24 10.7 24 24l0 8 40 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 8 48 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 8 40 0 0-8c0-13.3 10.7-24 24-24s24 10.7 24 24l0 136c26.5 0 48 21.5 48 48l0 80c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48l-48 0 0-224-32 0 0-128-48 0 0 128 32 0 0 224-224 0 0-224 32 0 0-128-48 0 0 128-32 0 0 224-48 0c-26.5 0-48-21.5-48-48L0 336c0-26.5 21.5-48 48-48l0-80c0-26.5 21.5-48 48-48L96 24c0-13.3 10.7-24 24-24zM256 208c-17.7 0-32 14.3-32 32l0 48 64 0 0-48c0-17.7-14.3-32-32-32zM208 400l0 64 96 0 0-64c0-26.5-21.5-48-48-48s-48 21.5-48 48zM256 96c-17.7 0-32 14.3-32 32l0 32 64 0 0-32c0-17.7-14.3-32-32-32z\"]\n};\nvar faHeartCircleMinus = {\n  prefix: 'fas',\n  iconName: 'heart-circle-minus',\n  icon: [576, 512, [], \"e4ff\", \"M241 87.1l15 20.7 15-20.7C296 52.5 336.2 32 378.9 32 452.4 32 512 91.6 512 165.1l0 2.6c0 17.6-3.4 35.6-9.5 53.7-21.8-8.6-45.6-13.4-70.5-13.4-106 0-192 86-192 192 0 28.5 6.2 55.6 17.4 80-.5 0-.9 0-1.4 0-15.5 0-30.8-4.6-43.1-14.1-73-55.7-212.9-186-212.9-298.2l0-2.6C0 91.6 59.6 32 133.1 32 175.8 32 216 52.5 241 87.1zM288 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm224 0c0-8.8-7.2-16-16-16l-128 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16z\"]\n};\nvar faStarOfLife = {\n  prefix: 'fas',\n  iconName: 'star-of-life',\n  icon: [512, 512, [], \"f621\", \"M208.5 32c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 140.9 122-70.4c15.3-8.8 34.9-3.6 43.7 11.7l16 27.7c8.8 15.3 3.6 34.9-11.7 43.7l-122 70.4 122 70.4c15.3 8.8 20.6 28.4 11.7 43.7l-16 27.7c-8.8 15.3-28.4 20.6-43.7 11.7l-122-70.4 0 140.9c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-140.9-122 70.4c-15.3 8.8-34.9 3.6-43.7-11.7l-16-27.7c-8.8-15.3-3.6-34.9 11.7-43.7l122-70.4-122-70.4c-15.3-8.8-20.5-28.4-11.7-43.7l16-27.7c8.8-15.3 28.4-20.5 43.7-11.7l122 70.4 0-140.9z\"]\n};\nvar faBusinessTime = {\n  prefix: 'fas',\n  iconName: 'business-time',\n  icon: [640, 512, [\"briefcase-clock\"], \"f64a\", \"M264 48l112 0c4.4 0 8 3.6 8 8l0 40-128 0 0-40c0-4.4 3.6-8 8-8zm-56 8l0 40-80 0c-35.3 0-64 28.7-64 64l0 96 305 0c33.8-29.9 78.3-48 127-48 28.6 0 55.6 6.2 80 17.4l0-65.4c0-35.3-28.7-64-64-64l-80 0 0-40c0-30.9-25.1-56-56-56L264 0c-30.9 0-56 25.1-56 56zm80 296c-17.7 0-32-14.3-32-32l0-16-192 0 0 112c0 35.3 28.7 64 64 64l193.4 0c-11.2-24.4-17.4-51.4-17.4-80 0-16.6 2.1-32.7 6-48l-22 0zm352 48a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM496 320c8.8 0 16 7.2 16 16l0 48 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0c-8.8 0-16-7.2-16-16l0-64c0-8.8 7.2-16 16-16z\"]\n};\nvar faBriefcaseClock = faBusinessTime;\nvar faFireExtinguisher = {\n  prefix: 'fas',\n  iconName: 'fire-extinguisher',\n  icon: [512, 512, [129519], \"f134\", \"M512 32c0-9.6-4.3-18.7-11.7-24.7S483.1-1.3 473.7 .6l-160 32C301.5 35.1 292 44.3 289 56l-65 0 0-24c0-17.7-14.3-32-32-32L160 0c-17.7 0-32 14.3-32 32l0 28.4c-55.3 12.3-101.3 49.5-125.5 99.1-5.8 11.9-.9 26.3 11.1 32.1s26.3 .9 32.1-11.1C62 146.9 91.8 121.1 128 110l0 28.8c-37.8 18-64 56.5-64 101.2l0 128 224 0 0-128c0-44.7-26.2-83.2-64-101.2l0-34.8 65 0c3 11.7 12.5 20.9 24.7 23.4l160 32c9.4 1.9 19.1-.6 26.6-6.6S512 137.6 512 128l0-96zM288 448l0-32-224 0 0 32c0 35.3 28.7 64 64 64l96 0c35.3 0 64-28.7 64-64z\"]\n};\nvar faArrowDownLong = {\n  prefix: 'fas',\n  iconName: 'arrow-down-long',\n  icon: [320, 512, [\"long-arrow-down\"], \"f175\", \"M137.4 534.6c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 434.7 192 0c0-17.7-14.3-32-32-32S128-17.7 128 0l0 434.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128z\"]\n};\nvar faLongArrowDown = faArrowDownLong;\nvar faUserMinus = {\n  prefix: 'fas',\n  iconName: 'user-minus',\n  icon: [640, 512, [], \"f503\", \"M285.7 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L77.7 512C61.3 512 48 498.7 48 482.3 48 383.8 127.8 304 226.3 304l59.4 0zM256 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240zm344-96c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l144 0z\"]\n};\nvar faMoneyCheck = {\n  prefix: 'fas',\n  iconName: 'money-check',\n  icon: [512, 512, [], \"f53c\", \"M0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM96 312c0 13.3 10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0c-13.3 0-24 10.7-24 24zm24-136c-13.3 0-24 10.7-24 24s10.7 24 24 24l272 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-272 0z\"]\n};\nvar faHouseLaptop = {\n  prefix: 'fas',\n  iconName: 'house-laptop',\n  icon: [640, 512, [\"laptop-house\"], \"e066\", \"M448 240l19.9 0c15.5 0 28.1-12.6 28.1-28.1 0-7.6-3.1-14.9-8.6-20.2L283.5-4.9C276.1-12 266.3-16 256-16s-20.1 4-27.5 11.1L24.6 191.7C19.1 197 16 204.3 16 211.9 16 227.4 28.6 240 44.1 240l19.9 0 0 144c0 35.3 28.7 64 64 64l85.7 0c7.4-6.6 16.4-11.4 26.3-14l0-130c0-5.5 .7-10.9 2-16l-10 0c-13.3 0-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 24 144 0zM352 352l160 0 0 128-160 0 0-128zm-64-32l0 160-32 0c-8.8 0-16 7.2-16 16 0 26.5 21.5 48 48 48l288 0c26.5 0 48-21.5 48-48 0-8.8-7.2-16-16-16l-32 0 0-160c0-17.7-14.3-32-32-32l-224 0c-17.7 0-32 14.3-32 32z\"]\n};\nvar faLaptopHouse = faHouseLaptop;\nvar faDownload = {\n  prefix: 'fas',\n  iconName: 'download',\n  icon: [448, 512, [], \"f019\", \"M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 242.7 256 32zM64 320c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-46.9 0-56.6 56.6c-31.2 31.2-81.9 31.2-113.1 0L110.9 320 64 320zm304 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faSagittarius = {\n  prefix: 'fas',\n  iconName: 'sagittarius',\n  icon: [448, 512, [], \"e84d\", \"M416 32c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-82.8-146.8 146.8 41.4 41.4c12.5 12.5 12.5 32.8 0 45.2s-32.8 12.5-45.3 0L192 333.3 54.6 470.6c-12.5 12.5-32.8 12.5-45.2 0s-12.5-32.8 0-45.2L146.8 288 105.4 246.6c-12.5-12.5-12.5-32.8 0-45.2s32.8-12.5 45.2 0L192 242.8 338.8 96 256 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0z\"]\n};\nvar faCouch = {\n  prefix: 'fas',\n  iconName: 'couch',\n  icon: [640, 512, [], \"f4b8\", \"M144 272C144 224.7 109.8 185.4 64.8 177.5 72 113.6 126.2 64 192 64l256 0c65.8 0 120 49.6 127.2 113.5-45 8-79.2 47.2-79.2 94.5l0 32-352 0 0-32zM0 384L0 272c0-26.5 21.5-48 48-48s48 21.5 48 48l0 80 448 0 0-80c0-26.5 21.5-48 48-48s48 21.5 48 48l0 112c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64z\"]\n};\nvar faRoadLock = {\n  prefix: 'fas',\n  iconName: 'road-lock',\n  icon: [576, 512, [], \"e567\", \"M256 32l-76.3 0c-29.4 0-55.1 20.1-62.1 48.6L33.4 420.5C25.9 450.7 48.8 480 80 480l175.9 0 0-64c0-17.7 14.3-32 32-32 6.1 0 11.8 1.7 16.7 4.7 2.8-23.9 14.3-45.1 31.4-60.3l0-24.4c0-70.7 57.3-128 128-128 6.2 0 12.4 .4 18.4 1.3L458.5 80.6C451.4 52.1 425.8 32 396.3 32l-76.4 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zm64 192l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32zm176 80.1l0 47.9-64 0 0-47.9c0-17.7 14.3-32 32-32s32 14.3 32 32zM352 400l0 96c0 26.5 21.5 48 48 48l128 0c26.5 0 48-21.5 48-48l0-96c0-20.9-13.4-38.7-32-45.3l0-50.6c0-44.2-35.8-80-80-80s-80 35.8-80 80l0 50.6c-18.6 6.6-32 24.4-32 45.3z\"]\n};\nvar faScissors = {\n  prefix: 'fas',\n  iconName: 'scissors',\n  icon: [512, 512, [9984, 9986, 9988, \"cut\"], \"f0c4\", \"M192 256l-39.5 39.5c-12.6-4.9-26.2-7.5-40.5-7.5-61.9 0-112 50.1-112 112s50.1 112 112 112 112-50.1 112-112c0-14.3-2.7-27.9-7.5-40.5L499.2 76.8c7.1-7.1 7.1-18.5 0-25.6-28.3-28.3-74.1-28.3-102.4 0L256 192 216.5 152.5c4.9-12.6 7.5-26.2 7.5-40.5 0-61.9-50.1-112-112-112S0 50.1 0 112 50.1 224 112 224c14.3 0 27.9-2.7 40.5-7.5L192 256zm97.9 97.9L396.8 460.8c28.3 28.3 74.1 28.3 102.4 0 7.1-7.1 7.1-18.5 0-25.6l-145.3-145.3-64 64zM64 112a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zm48 240a48 48 0 1 1 0 96 48 48 0 1 1 0-96z\"]\n};\nvar faCut = faScissors;\nvar faBug = {\n  prefix: 'fas',\n  iconName: 'bug',\n  icon: [576, 512, [], \"f188\", \"M192 96c0-53 43-96 96-96s96 43 96 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4l-135.1 0c-15.7 0-28.4-12.7-28.4-28.4l0-3.6zm345.6 12.8c10.6 14.1 7.7 34.2-6.4 44.8l-97.8 73.3c5.3 8.9 9.3 18.7 11.8 29.1l98.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0 0 32c0 2.6-.1 5.3-.2 7.9l83.4 62.5c14.1 10.6 17 30.7 6.4 44.8s-30.7 17-44.8 6.4l-63.1-47.3c-23.2 44.2-66.5 76.2-117.7 83.9L312 280c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 230.2c-51.2-7.7-94.5-39.7-117.7-83.9L83.2 473.6c-14.1 10.6-34.2 7.7-44.8-6.4s-7.7-34.2 6.4-44.8l83.4-62.5c-.1-2.6-.2-5.2-.2-7.9l0-32-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l98.8 0c2.5-10.4 6.5-20.2 11.8-29.1L44.8 153.6c-14.1-10.6-17-30.7-6.4-44.8s30.7-17 44.8-6.4L192 184c12.3-5.1 25.8-8 40-8l112 0c14.2 0 27.7 2.8 40 8l108.8-81.6c14.1-10.6 34.2-7.7 44.8 6.4z\"]\n};\nvar faArrowRightFromBracket = {\n  prefix: 'fas',\n  iconName: 'arrow-right-from-bracket',\n  icon: [512, 512, [\"sign-out\"], \"f08b\", \"M160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0zM502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z\"]\n};\nvar faSignOut = faArrowRightFromBracket;\nvar faHandHoldingHand = {\n  prefix: 'fas',\n  iconName: 'hand-holding-hand',\n  icon: [576, 512, [], \"e4f7\", \"M466.8 186.5l42.5-42.5 34.7 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L223.6 16c-29 0-57.3 9.3-80.7 26.5L16.3 135.8c-17.8 13.1-21.6 38.1-8.5 55.9s38.1 21.6 55.9 8.5L183.4 112 296 112c13.3 0 24 10.7 24 24s-10.7 24-24 24l-72 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l152.2 0c33.9 0 66.5-13.5 90.5-37.5zm-357.5 139L66.7 368 32 368c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l320.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 400 280 400c-13.3 0-24-10.7-24-24s10.7-24 24-24l72 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-152.2 0c-33.9 0-66.5 13.5-90.5 37.5z\"]\n};\nvar faStroopwafel = {\n  prefix: 'fas',\n  iconName: 'stroopwafel',\n  icon: [512, 512, [], \"f551\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM312.6 63.7c-6.2-6.2-16.4-6.2-22.6 0L256 97.6 222.1 63.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l33.9 33.9-45.3 45.3-56.6-56.6c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l56.6 56.6-45.3 45.3-33.9-33.9c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6L97.6 256 63.7 289.9c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l33.9-33.9 45.3 45.3-56.6 56.6c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l56.6-56.6 45.3 45.3-33.9 33.9c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l33.9-33.9 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 45.3-45.3 56.6 56.6c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-56.6-56.6 45.3-45.3 33.9 33.9c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-33.9-33.9 33.9-33.9c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-33.9 33.9-45.3-45.3 56.6-56.6c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-56.6 56.6-45.3-45.3 33.9-33.9c6.2-6.2 6.2-16.4 0-22.6zM142.9 256l45.3-45.3 45.3 45.3-45.3 45.3-45.3-45.3zm67.9 67.9l45.3-45.3 45.3 45.3-45.3 45.3-45.3-45.3zM278.6 256l45.3-45.3 45.3 45.3-45.3 45.3-45.3-45.3zm22.6-67.9l-45.3 45.3-45.3-45.3 45.3-45.3 45.3 45.3z\"]\n};\nvar faChild = {\n  prefix: 'fas',\n  iconName: 'child',\n  icon: [320, 512, [], \"f1ae\", \"M96 64A64 64 0 1 1 224 64 64 64 0 1 1 96 64zm48 320l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32L80 287.8 59.1 321c-9.4 15-29.2 19.4-44.1 10S-4.5 301.9 4.9 287l39.9-63.3C69.7 184 113.2 160 160 160s90.3 24 115.2 63.6L315.1 287c9.4 15 4.9 34.7-10 44.1s-34.7 4.9-44.1-10L240 287.8 240 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-32 0z\"]\n};\nvar faIceCream = {\n  prefix: 'fas',\n  iconName: 'ice-cream',\n  icon: [384, 512, [127848], \"f810\", \"M335.1 160c.6-5.3 .9-10.6 .9-16 0-79.5-64.5-144-144-144S48 64.5 48 144c0 5.4 .3 10.7 .9 16l-.9 0c-26.5 0-48 21.5-48 48s21.5 48 48 48l288 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-.9 0zM64 304L169.2 529.5c4.1 8.8 13 14.5 22.8 14.5s18.6-5.7 22.8-14.5L320 304 64 304z\"]\n};\nvar faComputerMouse = {\n  prefix: 'fas',\n  iconName: 'computer-mouse',\n  icon: [384, 512, [128433, \"mouse\"], \"f8cc\", \"M0 192l168 0 0-192-8 0C71.6 0 0 71.6 0 160l0 32zm0 48L0 352c0 88.4 71.6 160 160 160l64 0c88.4 0 160-71.6 160-160l0-112-384 0zm384-48l0-32C384 71.6 312.4 0 224 0l-8 0 0 192 168 0z\"]\n};\nvar faMouse = faComputerMouse;\nvar faFaucet = {\n  prefix: 'fas',\n  iconName: 'faucet',\n  icon: [512, 512, [], \"e005\", \"M192 64c0-17.7 14.3-32 32-32s32 14.3 32 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0 0 64 18.7 0c8.5 0 16.6 3.4 22.6 9.4l22.6 22.6 32 0c88.4 0 160 71.6 160 160 0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s-14.3-32-32-32l-36.1 0c-20.2 29-53.9 48-91.9 48s-71.7-19-91.9-48L32 352c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32l96 0 22.6-22.6c6-6 14.1-9.4 22.6-9.4l18.7 0 0-64-96 0c-17.7 0-32-14.3-32-32S78.3 64 96 64l96 0z\"]\n};\nvar faAward = {\n  prefix: 'fas',\n  iconName: 'award',\n  icon: [448, 512, [], \"f559\", \"M245.9-25.9c-13.4-8.2-30.3-8.2-43.7 0-24.4 14.9-39.5 18.9-68.1 18.3-15.7-.4-30.3 8.1-37.9 21.9-13.7 25.1-24.8 36.2-49.9 49.9-13.8 7.5-22.2 22.2-21.9 37.9 .7 28.6-3.4 43.7-18.3 68.1-8.2 13.4-8.2 30.3 0 43.7 14.9 24.4 18.9 39.5 18.3 68.1-.4 15.7 8.1 30.3 21.9 37.9 22.1 12.1 33.3 22.1 45.1 41.5L42.7 458.5c-5.9 11.9-1.1 26.3 10.7 32.2l86 43c11.5 5.7 25.5 1.4 31.7-9.8l52.8-95.1 52.8 95.1c6.2 11.2 20.2 15.6 31.7 9.8l86-43c11.9-5.9 16.7-20.3 10.7-32.2l-48.6-97.2c11.7-19.4 23-29.4 45.1-41.5 13.8-7.5 22.2-22.2 21.9-37.9-.7-28.6 3.4-43.7 18.3-68.1 8.2-13.4 8.2-30.3 0-43.7-14.9-24.4-18.9-39.5-18.3-68.1 .4-15.7-8.1-30.3-21.9-37.9-25.1-13.7-36.2-24.8-49.9-49.9-7.5-13.8-22.2-22.2-37.9-21.9-28.6 .7-43.7-3.4-68.1-18.3zM224 96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z\"]\n};\nvar faPersonDrowning = {\n  prefix: 'fas',\n  iconName: 'person-drowning',\n  icon: [640, 512, [], \"e545\", \"M264 88a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM133.9 65.6c16.8-5.6 34.9 3.5 40.5 20.2l10.9 32.8c9.4 28.3 33.2 49.5 62.5 55.6 5.6 1.2 11.3 1.8 17.1 1.8l88 0c17.2 0 34.3-2.8 50.6-8.2l114.4-38.1c16.8-5.6 34.9 3.5 40.5 20.2s-3.5 34.9-20.2 40.5L423.7 228.5c-8.4 2.8-17 5.1-25.7 6.9l-26.5 88.3c-6.1 3.4-12.1 7.3-17.9 11.7-22.1 16.6-29.1 16.6-51.2 0-26.2-19.7-56.9-30.2-87.8-31.3l20.2-67.2c-51.5-10.7-93.5-48.1-110.2-98l-10.9-32.8c-5.6-16.8 3.5-34.9 20.2-40.5zM403.4 412.1C379.1 430.3 351.1 448 320 448s-59.1-17.7-83.4-35.9c-21.3-16.1-49.9-16.1-71.2 0-23.8 17.9-54.1 35.5-88.1 35.3-20.4-.1-40.7-6.7-59.8-21.1-10.6-8-12.7-23-4.7-33.6s23-12.7 33.6-4.7c11.3 8.5 21.6 11.4 31.2 11.5 17.6 .1 37.3-9.4 58.9-25.7 38.4-29 90.5-29 129 0 24 18.1 40.7 26.3 54.5 26.3s30.5-8.2 54.5-26.3c38.4-29 90.5-29 129 0 16.9 12.7 32.9 21.5 47.8 24.6 13.7 2.8 27.4 .9 42.3-10.3 10.6-8 25.6-5.9 33.6 4.7s5.9 25.6-4.7 33.6c-26.4 19.9-54.2 24.4-80.7 19.1-25.3-5.1-48.1-18.9-67.2-33.3-21.3-16.1-49.9-16.1-71.2 0z\"]\n};\nvar faCameraRotate = {\n  prefix: 'fas',\n  iconName: 'camera-rotate',\n  icon: [512, 512, [], \"e0d8\", \"M138.7 96l10.4-31.2C155.6 45.2 173.9 32 194.6 32l122.8 0c20.7 0 39 13.2 45.5 32.8L373.3 96 448 96c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 160c0-35.3 28.7-64 64-64l74.7 0zM96 305.9c0 3.9 1.4 7.7 4 10.6l48 54c6.4 7.2 17.6 7.2 23.9 0l48-54c2.6-2.9 4-6.7 4-10.6l0-1.9c0-8.8-7.2-16-16-16l-24 0c0-39.8 32.2-72 72-72 4.4 0 8.7 .4 12.9 1.2l34.9-39.3c-14.6-6.4-30.8-9.9-47.8-9.9-66.3 0-120 53.7-120 120l-24 0c-8.8 0-16 7.2-16 16l0 1.9zm196-46.5c-2.6 2.9-4 6.7-4 10.6l0 1.9c0 8.8 7.2 16 16 16l24 0c0 39.8-32.2 72-72 72-4.4 0-8.7-.4-12.9-1.2l-34.9 39.3c14.7 6.4 30.8 9.9 47.8 9.9 66.3 0 120-53.7 120-120l24 0c8.8 0 16-7.2 16-16l0-1.9c0-3.9-1.4-7.7-4-10.6l-48-54c-6.4-7.2-17.6-7.2-23.9 0l-48 54z\"]\n};\nvar faFaceGrinHearts = {\n  prefix: 'fas',\n  iconName: 'face-grin-hearts',\n  icon: [512, 512, [128525, \"grin-hearts\"], \"f584\", \"M256 512c141.4 0 256-114.6 256-256 0-23.3-3.1-45.9-8.9-67.3 5.5-13.5 8.9-28.4 8.9-44.7 0-53-43-96-96-96l-2.9 0c-2.5 0-5 .1-7.4 .3-42.1-30.4-93.8-48.3-149.7-48.3S148.4 17.9 106.3 48.3c-2.5-.2-4.9-.3-7.4-.3L96 48c-53 0-96 43-96 96 0 16.3 3.5 31.2 8.9 44.7-5.8 21.4-8.9 44-8.9 67.3 0 141.4 114.6 256 256 256zM386.7 324.9c11.9-3.7 23.9 6.3 19.6 18.1-22.4 61.3-81.3 105.1-150.3 105.1S128.1 404.2 105.7 342.9c-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1zM322.9 96c13.5 0 26.5 5.4 36 14.9l9.1 9.1 9.1-9.1c9.5-9.5 22.5-14.9 36-14.9l2.9 0c26.5 0 48 21.5 48 48 0 53.4-66.9 95.7-89 108.2-4.4 2.5-9.6 2.5-14 0-22.1-12.5-89-54.8-89-108.2 0-26.5 21.5-48 48-48l2.9 0zm-188 14.9l9.1 9.1 9.1-9.1c9.5-9.5 22.5-14.9 36-14.9l2.9 0c26.5 0 48 21.5 48 48 0 53.4-66.9 95.7-89 108.2-4.4 2.5-9.6 2.5-14 0-22.1-12.5-89-54.8-89-108.2 0-26.5 21.5-48 48-48l2.9 0c13.5 0 26.5 5.4 36 14.9z\"]\n};\nvar faGrinHearts = faFaceGrinHearts;\nvar faFileFragment = {\n  prefix: 'fas',\n  iconName: 'file-fragment',\n  icon: [384, 512, [], \"e697\", \"M64 0C28.7 0 0 28.7 0 64l0 240 128 0c44.2 0 80 35.8 80 80l0 128 112 0c35.3 0 64-28.7 64-64l0-277.5c0-17-6.7-33.3-18.7-45.3L258.7 18.7C246.7 6.7 230.5 0 213.5 0L64 0zM325.5 176L232 176c-13.3 0-24-10.7-24-24L208 58.5 325.5 176zM32 352c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0z\"]\n};\nvar faPersonMilitaryRifle = {\n  prefix: 'fas',\n  iconName: 'person-military-rifle',\n  icon: [448, 512, [], \"e54b\", \"M128 39c0-13 10-23.8 22.9-24.9L302.7 1.4C312 .7 320 8 320 17.4L320 48c0 8.8-7.2 16-16 16L153 64c-13.8 0-25-11.2-25-25zm17.6 57l156.8 0c1 5.2 1.6 10.5 1.6 16 0 44.2-35.8 80-80 80s-80-35.8-80-80c0-5.5 .6-10.8 1.6-16zm228 364.3L320 369.7 320 480c0 1.3-.1 2.5-.2 3.8L145.5 234.9c16.6-7.1 34.6-10.9 53.3-10.9l50.4 0c15.9 0 31.3 2.8 45.8 7.9L389.9 67.7c-7.7-4.4-10.3-14.2-5.9-21.9s14.2-10.3 21.9-5.9l27.7 16c7.7 4.4 10.3 14.2 5.9 21.9l-55.5 96.1 1.6 .9c15.3 8.8 20.6 28.4 11.7 43.7L360.7 282c2 2.8 3.9 5.8 5.7 8.8l76.1 128.8c11.2 19 4.9 43.5-14.1 54.8s-43.5 4.9-54.8-14.1zM288 512l-128 0c-17.7 0-32-14.3-32-32l0-110.3-53.6 90.6c-11.2 19-35.8 25.3-54.8 14.1S-5.7 438.7 5.6 419.7L81.7 290.8c9.4-15.8 21.7-29.3 36-40L299.1 510c-3.5 1.3-7.2 2-11.1 2zM264 320a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faToggleOn = {\n  prefix: 'fas',\n  iconName: 'toggle-on',\n  icon: [576, 512, [], \"f205\", \"M192 64C86 64 0 150 0 256S86 448 192 448l192 0c106 0 192-86 192-192S490 64 384 64L192 64zm192 96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z\"]\n};\nvar faLungsVirus = {\n  prefix: 'fas',\n  iconName: 'lungs-virus',\n  icon: [576, 512, [], \"e067\", \"M288 0c-17.7 0-32 14.3-32 32l0 151.3c9.6-4.8 20.5-7.5 32-7.5s22.4 2.7 32 7.5L320 32c0-17.7-14.3-32-32-32zM450.1 451c8 18.3 8.1 39.2 .2 57.5 10.2 2.3 20.6 3.5 31.2 3.5 52.2 0 94.5-42.3 94.5-94.5l0-6.2c0-111.1-36.7-219-104.4-307L428.9 48.7c-8.1-10.6-20.7-16.7-34-16.7-23.7 0-42.9 19.2-42.9 42.9l0 139.9c1.2 2.2 2.2 4.6 3.1 6.9 26.4-11.6 58.3-6.6 79.9 15s26.6 53.6 15 79.9C477 327.2 496 353.3 496 383.8s-19 56.7-45.9 67.1zM220.9 221.8c.9-2.4 2-4.7 3.1-6.9l0-138.5c0-24.5-19.9-44.4-44.4-44.4-12.5 0-24.4 5.3-32.8 14.5l-26.4 29C42.9 160.8 0 271.8 0 387l0 30.5c0 52.2 42.3 94.5 94.5 94.5 10.5 0 21-1.2 31.2-3.5-7.9-18.3-7.8-39.3 .2-57.5-26.9-10.4-45.9-36.6-45.9-67.1s19-56.7 45.9-67.1c-11.6-26.4-6.6-58.3 15-79.9s53.6-26.6 79.9-15zM152 408c28.8 0 43.2 34.8 22.9 55.2-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0c20.4-20.4 55.2-5.9 55.2 22.9 0 13.3 10.7 24 24 24s24-10.7 24-24c0-28.8 34.8-43.2 55.2-22.9 9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9c-20.4-20.4-5.9-55.2 22.9-55.2 13.3 0 24-10.7 24-24s-10.7-24-24-24c-28.8 0-43.2-34.8-22.9-55.2 9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0c-20.4 20.4-55.2 5.9-55.2-22.9 0-13.3-10.7-24-24-24s-24 10.7-24 24c0 28.8-34.8 43.2-55.2 22.9-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9c20.4 20.4 5.9 55.2-22.9 55.2-13.3 0-24 10.7-24 24s10.7 24 24 24zm104-80a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 88a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faTableTennisPaddleBall = {\n  prefix: 'fas',\n  iconName: 'table-tennis-paddle-ball',\n  icon: [512, 512, [127955, \"ping-pong-paddle-ball\", \"table-tennis\"], \"f45d\", \"M97 127l67.4-67.4c38.2-38.2 90-59.6 144-59.6 112.5 0 203.7 91.2 203.7 203.6 0 46.4-15.8 91.1-44.5 127-23.6-16.8-52.4-26.7-83.5-26.7-31.1 0-59.9 9.9-83.4 26.6L97 127zM240 448c0 9.7 1 19.1 2.8 28.2-19.8-5.2-38-15.5-52.7-30.2-12.2-12.2-31.9-12.2-44.1 0L96.6 495.4c-10.6 10.6-25 16.6-40 16.6-31.2 0-56.6-25.3-56.6-56.6 0-15 6-29.4 16.6-40l49.4-49.4c12.2-12.2 12.2-31.9 0-44.1-21.7-21.7-33.9-51.2-33.9-81.9 0-29.4 11.1-57.6 31.1-79L266.6 364.6C249.9 388.1 240 416.9 240 448zm144-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z\"]\n};\nvar faPingPongPaddleBall = faTableTennisPaddleBall;\nvar faTableTennis = faTableTennisPaddleBall;\nvar faBoxesPacking = {\n  prefix: 'fas',\n  iconName: 'boxes-packing',\n  icon: [576, 512, [], \"e4c7\", \"M208 0l80 0 0 56c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-56 80 0c26.5 0 48 21.5 48 48l0 416c0 26.5-21.5 48-48 48l-108.8 0c8.2-14.1 12.8-30.5 12.8-48l0-160c10-13.4 16-30 16-48l0-32c0-44.2-35.8-80-80-80l-176 0 0-96c0-26.5 21.5-48 48-48zM32 336l320 0 0 128c0 26.5-21.5 48-48 48L80 512c-26.5 0-48-21.5-48-48l0-128zM48 192l288 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32z\"]\n};\nvar faPersonChalkboard = {\n  prefix: 'fas',\n  iconName: 'person-chalkboard',\n  icon: [640, 512, [], \"e53d\", \"M192 80a56 56 0 1 0 0-112 56 56 0 1 0 0 112zM176 512l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-336 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-48 192 0 0 192-192 0 0-32-64 0 0 48c0 26.5 21.5 48 48 48l224 0c26.5 0 48-21.5 48-48l0-224c0-26.5-21.5-48-48-48L368 0c-26.5 0-48 21.5-48 48l0 64-122.7 0c-45.6 0-88.5 21.6-115.6 58.2L14.3 260.9c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6L112 236.7 112 512c0 17.7 14.3 32 32 32s32-14.3 32-32z\"]\n};\nvar faDiceTwo = {\n  prefix: 'fas',\n  iconName: 'dice-two',\n  icon: [448, 512, [9857], \"f528\", \"M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM352 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM128 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faArrowRightArrowLeft = {\n  prefix: 'fas',\n  iconName: 'arrow-right-arrow-left',\n  icon: [512, 512, [8644, \"exchange\"], \"f0ec\", \"M502.6 150.6l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L402.7 160 32 160c-17.7 0-32-14.3-32-32S14.3 96 32 96l370.7 0-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3zm-397.3 352l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L109.3 352 480 352c17.7 0 32 14.3 32 32s-14.3 32-32 32l-370.7 0 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0z\"]\n};\nvar faExchange = faArrowRightArrowLeft;\nvar faFootball = {\n  prefix: 'fas',\n  iconName: 'football',\n  icon: [512, 512, [127944, \"football-ball\"], \"f44e\", \"M261.1 22.6c-89 18-150.5 63.4-190 123.9-23.3 35.6-38.1 75.3-46.7 115.5L251.9 489.4c89-18 150.5-63.4 190.1-123.9 23.3-35.6 38.1-75.3 46.7-115.5L261.1 22.6zm236 168.1c3.2-42.3 .7-83.3-4.8-118.7-4.4-27.8-26.8-48-53.1-51.6-43-5.9-82.2-7.5-117.8-5.4L497.1 190.6zM191.7 497.1L15.9 321.4c-3.2 42.3-.7 83.3 4.8 118.7 4.4 27.8 26.8 48 53.1 51.6 43 5.9 82.2 7.5 117.8 5.4zM271.5 143c9.4-9.4 24.6-9.4 33.9 0l64 64c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9zm-64 64c9.4-9.4 24.6-9.4 33.9 0l64 64c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9zm-64 64c9.4-9.4 24.6-9.4 33.9 0l64 64c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9z\"]\n};\nvar faFootballBall = faFootball;\nvar faTruckMonster = {\n  prefix: 'fas',\n  iconName: 'truck-monster',\n  icon: [576, 512, [], \"f63b\", \"M336 96l48 64-128 0 0-64 80 0zm128 64L387.2 57.6C375.1 41.5 356.1 32 336 32L224 32c-17.7 0-32 14.3-32 32l0 96-144 0c-26.5 0-48 21.5-48 48l0 64c0 18.1 10.1 33.9 24.9 42.1-.5 5.7 1.1 11.6 4.7 16.4-3.7 6.9-6.8 14.1-9 21.8-11.6 1.7-20.6 11.7-20.6 23.8l0 16c0 12.1 8.9 22.1 20.6 23.8 2.2 7.6 5.3 14.9 9 21.8-7 9.4-6.3 22.8 2.3 31.3l11.3 11.3c8.6 8.6 21.9 9.3 31.3 2.2 6.8 3.7 14.1 6.8 21.7 9 1.7 11.6 11.7 20.6 23.8 20.6l16 0c12.1 0 22.1-8.9 23.8-20.6 7.6-2.2 14.9-5.3 21.7-9 9.4 7 22.8 6.3 31.3-2.2l11.3-11.3c8.6-8.6 9.3-21.9 2.3-31.3 3.7-6.8 6.8-14.1 9-21.7 11.6-1.7 20.6-11.7 20.6-23.8l0-16c0-12.1-8.9-22.1-20.6-23.8-2.2-7.6-5.3-14.9-9-21.7 2.4-3.2 3.9-6.8 4.5-10.5l114.2 0c.6 3.7 2.1 7.3 4.5 10.5-3.7 6.9-6.8 14.1-9 21.8-11.6 1.7-20.6 11.7-20.6 23.8l0 16c0 12.1 8.9 22.1 20.6 23.8 2.2 7.6 5.3 14.9 9 21.8-7 9.4-6.3 22.8 2.2 31.3l11.3 11.3c8.5 8.6 21.9 9.3 31.3 2.2 6.8 3.7 14.1 6.8 21.7 9 1.7 11.6 11.7 20.6 23.8 20.6l16 0c12.1 0 22.1-8.9 23.8-20.6 7.6-2.2 14.9-5.3 21.8-9 9.4 7 22.8 6.3 31.3-2.2l11.3-11.3c8.6-8.6 9.3-21.9 2.2-31.3 3.7-6.8 6.8-14.1 9-21.7 11.6-1.7 20.6-11.7 20.6-23.8l0-16c0-12.1-8.9-22.1-20.6-23.8-2.2-7.6-5.3-14.9-9-21.7 3.6-4.8 5.2-10.7 4.7-16.4 14.8-8.2 24.9-23.9 24.9-42.1l0-64c0-26.5-21.5-48-48-48l-64 0zM128 336a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm272 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z\"]\n};\nvar faAsterisk = {\n  prefix: 'fas',\n  iconName: 'asterisk',\n  icon: [448, 512, [10033, 61545], \"2a\", \"M224 0c17.7 0 32 14.3 32 32l0 168.6 144-83.1c15.3-8.8 34.9-3.6 43.7 11.7s3.6 34.9-11.7 43.7L288 256 432 339.1c15.3 8.8 20.6 28.4 11.7 43.7s-28.4 20.6-43.7 11.7L256 311.4 256 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-168.6-144 83.1c-15.3 8.8-34.9 3.6-43.7-11.7S.7 348 16 339.1L160 256 16 172.9C.7 164-4.5 144.5 4.3 129.1S32.7 108.6 48 117.4L192 200.6 192 32c0-17.7 14.3-32 32-32z\"]\n};\nvar faBatteryFull = {\n  prefix: 'fas',\n  iconName: 'battery-full',\n  icon: [640, 512, [128267, \"battery\", \"battery-5\"], \"f240\", \"M528 128c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-416 0c-8.8 0-16-7.2-16-16l0-224c0-8.8 7.2-16 16-16l416 0zM112 64c-44.2 0-80 35.8-80 80l0 224c0 44.2 35.8 80 80 80l416 0c44.2 0 80-35.8 80-80l0-48c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80L112 64zm56 112c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24l304 0c13.3 0 24-10.7 24-24l0-112c0-13.3-10.7-24-24-24l-304 0z\"]\n};\nvar faBattery = faBatteryFull;\nvar faBattery5 = faBatteryFull;\nvar faChildDress = {\n  prefix: 'fas',\n  iconName: 'child-dress',\n  icon: [320, 512, [], \"e59c\", \"M224 64A64 64 0 1 0 96 64 64 64 0 1 0 224 64zM88 400l0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 16 0 0 80c0 17.7 14.3 32 32 32s32-14.3 32-32l0-80 17.8 0c10.9 0 18.6-10.7 15.2-21.1l-31.1-93.4 28.7 37.8c10.7 14.1 30.8 16.8 44.8 6.2s16.8-30.7 6.2-44.8L254.6 207c-22.4-29.6-57.5-47-94.6-47s-72.2 17.4-94.6 47L6.5 284.7c-10.7 14.1-7.9 34.2 6.2 44.8s34.2 7.9 44.8-6.2L86.2 285.5 55 378.9C51.6 389.3 59.3 400 70.2 400L88 400z\"]\n};\nvar faFaceKissBeam = {\n  prefix: 'fas',\n  iconName: 'face-kiss-beam',\n  icon: [512, 512, [128537, \"kiss-beam\"], \"f597\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM240 288l32 0c26.5 0 48 21.5 48 48 0 12.3-4.6 23.5-12.2 32 7.6 8.5 12.2 19.7 12.2 32 0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16zM176 180c-15.5 0-28 12.5-28 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28zm132 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28s-28 12.5-28 28z\"]\n};\nvar faKissBeam = faFaceKissBeam;\nvar faTrashCanArrowUp = {\n  prefix: 'fas',\n  iconName: 'trash-can-arrow-up',\n  icon: [448, 512, [\"trash-restore-alt\"], \"f82a\", \"M167.1-16l113.9 0c13.8 0 26 8.8 30.4 21.9L320 32 416 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 8.7-26.1C141.1-7.2 153.3-16 167.1-16zM32 144l384 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-304zm209 79c-9.4-9.4-24.6-9.4-33.9 0l-72 72c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l31-31 0 102.1c0 13.3 10.7 24 24 24s24-10.7 24-24l0-102.1 31 31c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-72-72z\"]\n};\nvar faTrashRestoreAlt = faTrashCanArrowUp;\nvar faFont = {\n  prefix: 'fas',\n  iconName: 'font',\n  icon: [512, 512, [], \"f031\", \"M285.1 50.7C279.9 39.3 268.5 32 256 32s-23.9 7.3-29.1 18.7L59.5 416 48 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l88 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-6.1 0 22-48 208.3 0 22 48-6.1 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l88 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-11.5 0-167.4-365.3zM330.8 304L181.2 304 256 140.8 330.8 304z\"]\n};\nvar faBoreHole = {\n  prefix: 'fas',\n  iconName: 'bore-hole',\n  icon: [512, 512, [], \"e4c3\", \"M256 0c-17.7 0-32 14.3-32 32l0 232.6c-19.1 11.1-32 31.7-32 55.4 0 35.3 28.7 64 64 64s64-28.7 64-64c0-23.7-12.9-44.4-32-55.4L288 32c0-17.7-14.3-32-32-32zM0 384l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-272c0-26.5-21.5-48-48-48l-48 0c-26.5 0-48 21.5-48 48l0 144c0 61.9-50.1 112-112 112S144 381.9 144 320l0-144c0-26.5-21.5-48-48-48l-48 0c-26.5 0-48 21.5-48 48L0 384z\"]\n};\nvar faVirusCovid = {\n  prefix: 'fas',\n  iconName: 'virus-covid',\n  icon: [512, 512, [], \"e4a8\", \"M192 24c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 33.6c30.7 4.2 58.8 16.3 82.3 34.1L386.1 92 374.8 80.6c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l56.6 56.6c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-11.3-11.3-23.8 23.8c17.9 23.5 29.9 51.7 34.1 82.3l33.6 0 0-16c0-13.3 10.7-24 24-24s24 10.7 24 24l0 80c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-33.6 0c-4.2 30.7-16.3 58.8-34.1 82.3l23.8 23.8 11.3-11.3c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-56.6 56.6c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l11.3-11.3-23.8-23.8c-23.5 17.9-51.7 29.9-82.3 34.1l0 33.6 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-33.6c-30.7-4.2-58.8-16.3-82.3-34.1l-23.8 23.8 11.3 11.3c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L46.7 408.7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l11.3 11.3 23.8-23.8C97.9 338.8 85.8 310.7 81.6 280l-33.6 0 0 16c0 13.3-10.7 24-24 24S0 309.3 0 296l0-80c0-13.3 10.7-24 24-24s24 10.7 24 24l0 16 33.6 0c4.2-30.7 16.3-58.8 34.1-82.3L92 125.9 80.6 137.2c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l56.6-56.6c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L125.9 92 149.7 115.7c23.5-17.9 51.7-29.9 82.3-34.1l0-33.6-16 0c-13.3 0-24-10.7-24-24zm32 200a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faFilePdf = {\n  prefix: 'fas',\n  iconName: 'file-pdf',\n  icon: [576, 512, [], \"f1c1\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l80 0 0-112c0-35.3 28.7-64 64-64l176 0 0-165.5c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM240 380c-11 0-20 9-20 20l0 128c0 11 9 20 20 20s20-9 20-20l0-28 12 0c33.1 0 60-26.9 60-60s-26.9-60-60-60l-32 0zm32 80l-12 0 0-40 12 0c11 0 20 9 20 20s-9 20-20 20zm96-80c-11 0-20 9-20 20l0 128c0 11 9 20 20 20l32 0c28.7 0 52-23.3 52-52l0-64c0-28.7-23.3-52-52-52l-32 0zm20 128l0-88 12 0c6.6 0 12 5.4 12 12l0 64c0 6.6-5.4 12-12 12l-12 0zm88-108l0 128c0 11 9 20 20 20s20-9 20-20l0-44 28 0c11 0 20-9 20-20s-9-20-20-20l-28 0 0-24 28 0c11 0 20-9 20-20s-9-20-20-20l-48 0c-11 0-20 9-20 20z\"]\n};\nvar faLanguage = {\n  prefix: 'fas',\n  iconName: 'language',\n  icon: [576, 512, [], \"f1ab\", \"M160 0c17.7 0 32 14.3 32 32l0 32 128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-9.6 0-8.4 23.1c-16.4 45.2-41.1 86.5-72.2 122 14.2 8.8 29 16.6 44.4 23.5l50.4 22.4 62.2-140c5.1-11.6 16.6-19 29.2-19s24.1 7.4 29.2 19l128 288c7.2 16.2-.1 35.1-16.2 42.2s-35.1-.1-42.2-16.2l-20-45-157.5 0-20 45c-7.2 16.2-26.1 23.4-42.2 16.2s-23.4-26.1-16.2-42.2l39.8-89.5-50.4-22.4c-23-10.2-45-22.4-65.8-36.4-21.3 17.2-44.6 32.2-69.5 44.7L78.3 380.6c-15.8 7.9-35 1.5-42.9-14.3s-1.5-35 14.3-42.9l34.5-17.3c16.3-8.2 31.8-17.7 46.4-28.3-13.8-12.7-26.8-26.4-38.9-40.9L81.6 224.7c-11.3-13.6-9.5-33.8 4.1-45.1s33.8-9.5 45.1 4.1l10.2 12.2c11.5 13.9 24.1 26.8 37.4 38.7 27.5-30.4 49.2-66.1 63.5-105.4l.5-1.2-210.3 0C14.3 128 0 113.7 0 96S14.3 64 32 64l96 0 0-32c0-17.7 14.3-32 32-32zM416 270.8L365.7 384 466.3 384 416 270.8z\"]\n};\nvar faShieldHalved = {\n  prefix: 'fas',\n  iconName: 'shield-halved',\n  icon: [512, 512, [\"shield-alt\"], \"f3ed\", \"M256 0c4.6 0 9.2 1 13.4 2.9L457.8 82.8c22 9.3 38.4 31 38.3 57.2-.5 99.2-41.3 280.7-213.6 363.2-16.7 8-36.1 8-52.8 0-172.4-82.5-213.1-264-213.6-363.2-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.9 1 251.4 0 256 0zm0 66.8l0 378.1c138-66.8 175.1-214.8 176-303.4l-176-74.6 0 0z\"]\n};\nvar faShieldAlt = faShieldHalved;\nvar faCaretUp = {\n  prefix: 'fas',\n  iconName: 'caret-up',\n  icon: [320, 512, [], \"f0d8\", \"M140.3 135.2c12.6-10.3 31.1-9.5 42.8 2.2l128 128c9.2 9.2 11.9 22.9 6.9 34.9S301.4 320 288.5 320l-256 0c-12.9 0-24.6-7.8-29.6-19.8S.7 274.5 9.9 265.4l128-128 2.4-2.2z\"]\n};\nvar faFilePen = {\n  prefix: 'fas',\n  iconName: 'file-pen',\n  icon: [640, 512, [128221, \"file-edit\"], \"f31c\", \"M128.1 0c-35.3 0-64 28.7-64 64l0 384c0 35.3 28.7 64 64 64l146.2 0 10.9-54.5c4.3-21.7 15-41.6 30.6-57.2l132.2-132.2 0-97.5c0-17-6.7-33.3-18.7-45.3L322.8 18.7C310.8 6.7 294.5 0 277.6 0L128.1 0zM389.6 176l-93.5 0c-13.3 0-24-10.7-24-24l0-93.5 117.5 117.5zM332.3 466.9l-11.9 59.6c-.2 .9-.3 1.9-.3 2.9 0 8 6.5 14.6 14.6 14.6 1 0 1.9-.1 2.9-.3l59.6-11.9c12.4-2.5 23.8-8.6 32.7-17.5l118.9-118.9-80-80-118.9 118.9c-8.9 8.9-15 20.3-17.5 32.7zm267.8-123c22.1-22.1 22.1-57.9 0-80s-57.9-22.1-80 0l-28.8 28.8 80 80 28.8-28.8z\"]\n};\nvar faFileEdit = faFilePen;\nvar faPersonBiking = {\n  prefix: 'fas',\n  iconName: 'person-biking',\n  icon: [576, 512, [128692, \"biking\"], \"f84a\", \"M368 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm27.2 64l-61.8-48.8c-17.3-13.6-41.7-13.8-59.1-.3l-83.1 64.2c-30.7 23.8-28.5 70.8 4.3 91.6L256 305.1 256 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-10.7-5.3-20.7-14.2-26.6L263 232.9 323.3 184.4 364 217c5.7 4.5 12.7 7 20 7l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-52.8 0zM112 512a112 112 0 1 0 0-224 112 112 0 1 0 0 224zm352 0a112 112 0 1 0 0-224 112 112 0 1 0 0 224z\"]\n};\nvar faBiking = faPersonBiking;\nvar faBookOpenReader = {\n  prefix: 'fas',\n  iconName: 'book-open-reader',\n  icon: [512, 512, [\"book-reader\"], \"f5da\", \"M256 152a88 88 0 1 0 0-176 88 88 0 1 0 0 176zm0 298.7l0-149.3c16.3-6.8 32.9-13.7 49.7-20.7 39-16.2 80.8-24.6 123.1-24.6l19.2 0 0 160-19.2 0c-59.1 0-117.7 11.7-172.3 34.5l-.5 .2zM256 232l-25.1-10.5C184.1 202 133.9 192 83.2 192L48 192c-26.5 0-48 21.5-48 48L0 432c0 26.5 21.5 48 48 48l35.2 0c50.7 0 100.9 10 147.7 29.5l12.8 5.3c7.9 3.3 16.7 3.3 24.6 0l12.8-5.3c46.8-19.5 97-29.5 147.7-29.5l35.2 0c26.5 0 48-21.5 48-48l0-192c0-26.5-21.5-48-48-48l-35.2 0c-50.7 0-100.9 10-147.7 29.5L256 232z\"]\n};\nvar faBookReader = faBookOpenReader;\nvar faGlassWaterDroplet = {\n  prefix: 'fas',\n  iconName: 'glass-water-droplet',\n  icon: [384, 512, [], \"e4f5\", \"M32 0C23.1 0 14.6 3.7 8.6 10.2S-.6 25.4 .1 34.3L28.9 437.7c3 41.9 37.8 74.3 79.8 74.3l166.6 0c42 0 76.8-32.4 79.8-74.3L383.9 34.3c.6-8.9-2.4-17.6-8.5-24.1S360.9 0 352 0L32 0zM83 297.5L66.4 64 317.6 64 301 297.5 288 304c-20.1 10.1-43.9 10.1-64 0s-43.9-10.1-64 0-43.9 10.1-64 0l-13-6.5zM256 196c0-24-33.7-70.1-52.2-93.5-6.1-7.7-17.5-7.7-23.6 0-18.5 23.4-52.2 69.5-52.2 93.5 0 33.1 28.7 60 64 60s64-26.9 64-60z\"]\n};\nvar faTowerBroadcast = {\n  prefix: 'fas',\n  iconName: 'tower-broadcast',\n  icon: [576, 512, [\"broadcast-tower\"], \"f519\", \"M87.9 11.5c-11.3-6.9-26.1-3.2-33 8.1-24.8 41-39 89.1-39 140.4s14.2 99.4 39 140.4c6.9 11.3 21.6 15 33 8.1s15-21.6 8.1-33C75.7 241.9 64 202.3 64 160S75.7 78.1 96.1 44.4c6.9-11.3 3.2-26.1-8.1-33zm400.1 0c-11.3 6.9-15 21.6-8.1 33 20.4 33.7 32.1 73.3 32.1 115.6s-11.7 81.9-32.1 115.6c-6.9 11.3-3.2 26.1 8.1 33s26.1 3.2 33-8.1c24.8-41 39-89.1 39-140.4S545.8 60.6 521 19.6c-6.9-11.3-21.6-15-33-8.1zM320 215.4c19.1-11.1 32-31.7 32-55.4 0-35.3-28.7-64-64-64s-64 28.7-64 64c0 23.7 12.9 44.4 32 55.4L256 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-264.6zM180.2 91c7.2-11.2 3.9-26-7.2-33.2s-26-3.9-33.2 7.2c-17.6 27.4-27.8 60-27.8 95s10.2 67.6 27.8 95c7.2 11.2 22 14.4 33.2 7.2s14.4-22 7.2-33.2c-12.8-19.9-20.2-43.6-20.2-69s7.4-49.1 20.2-69zM436.2 65c-7.2-11.2-22-14.4-33.2-7.2s-14.4 22-7.2 33.2c12.8 19.9 20.2 43.6 20.2 69s-7.4 49.1-20.2 69c-7.2 11.2-3.9 26 7.2 33.2s26 3.9 33.2-7.2c17.6-27.4 27.8-60 27.8-95s-10.2-67.6-27.8-95z\"]\n};\nvar faBroadcastTower = faTowerBroadcast;\nvar faMinimize = {\n  prefix: 'fas',\n  iconName: 'minimize',\n  icon: [512, 512, [\"compress-arrows-alt\"], \"f78c\", \"M456 224l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2S322.1 32.2 329 39l40 40 73.4-73.4C446 2 450.9 0 456 0s10 2 13.7 5.7l36.7 36.7C510 46 512 50.9 512 56s-2 10-5.7 13.7L433 143 473 183c6.9 6.9 8.9 17.2 5.2 26.2S465.7 224 456 224zm0 64c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-40 40 73.4 73.4c3.6 3.6 5.7 8.5 5.7 13.7s-2 10-5.7 13.7l-36.7 36.7C466 510 461.1 512 456 512s-10-2-13.7-5.7L369 433 329 473c-6.9 6.9-17.2 8.9-26.2 5.2S288 465.7 288 456l0-144c0-13.3 10.7-24 24-24l144 0zm-256 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-40-40-73.4 73.4C66 510 61.1 512 56 512s-10-2-13.7-5.7L5.7 469.7C2 466 0 461.1 0 456s2-10 5.7-13.7L79 369 39 329c-6.9-6.9-8.9-17.2-5.2-26.2S46.3 288 56 288l144 0zM56 224c-9.7 0-18.5-5.8-22.2-14.8S32.2 189.9 39 183L79 143 5.7 69.7C2 66 0 61.1 0 56S2 46 5.7 42.3L42.3 5.7C46 2 50.9 0 56 0S66 2 69.7 5.7L143 79 183 39c6.9-6.9 17.2-8.9 26.2-5.2S224 46.3 224 56l0 144c0 13.3-10.7 24-24 24L56 224z\"]\n};\nvar faCompressArrowsAlt = faMinimize;\nvar faArrowRightToCity = {\n  prefix: 'fas',\n  iconName: 'arrow-right-to-city',\n  icon: [640, 512, [], \"e4b3\", \"M288 48c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 80 48 0 0-72c0-13.3 10.7-24 24-24s24 10.7 24 24l0 72 16 0c26.5 0 48 21.5 48 48l0 288c0 26.5-21.5 48-48 48l-256 0c-26.5 0-48-21.5-48-48l0-416zm64 64l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM352 304l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm176-80c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM512 336l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM153 167l72 72c9.4 9.4 9.4 24.6 0 33.9l-72 72c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-102.1 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l102.1 0-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z\"]\n};\nvar faLaptopMedical = {\n  prefix: 'fas',\n  iconName: 'laptop-medical',\n  icon: [640, 512, [], \"f812\", \"M64 96c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 240-64 0 0-240-384 0 0 240-64 0 0-240zM0 403.2C0 392.6 8.6 384 19.2 384l601.6 0c10.6 0 19.2 8.6 19.2 19.2 0 42.4-34.4 76.8-76.8 76.8L76.8 480C34.4 480 0 445.6 0 403.2zM288 160c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 40 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-40 0 0 40c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40z\"]\n};\nvar faBreadSlice = {\n  prefix: 'fas',\n  iconName: 'bread-slice',\n  icon: [512, 512, [], \"f7ec\", \"M64 432l0-176c-35.3 0-64-28.7-64-64 0-216.5 512-216.5 512 0 0 35.3-28.7 64-64 64l0 176c0 26.5-21.5 48-48 48l-288 0c-26.5 0-48-21.5-48-48z\"]\n};\nvar faGlobe = {\n  prefix: 'fas',\n  iconName: 'globe',\n  icon: [512, 512, [127760], \"f0ac\", \"M351.9 280l-190.9 0c2.9 64.5 17.2 123.9 37.5 167.4 11.4 24.5 23.7 41.8 35.1 52.4 11.2 10.5 18.9 12.2 22.9 12.2s11.7-1.7 22.9-12.2c11.4-10.6 23.7-28 35.1-52.4 20.3-43.5 34.6-102.9 37.5-167.4zM160.9 232l190.9 0C349 167.5 334.7 108.1 314.4 64.6 303 40.2 290.7 22.8 279.3 12.2 268.1 1.7 260.4 0 256.4 0s-11.7 1.7-22.9 12.2c-11.4 10.6-23.7 28-35.1 52.4-20.3 43.5-34.6 102.9-37.5 167.4zm-48 0C116.4 146.4 138.5 66.9 170.8 14.7 78.7 47.3 10.9 131.2 1.5 232l111.4 0zM1.5 280c9.4 100.8 77.2 184.7 169.3 217.3-32.3-52.2-54.4-131.7-57.9-217.3L1.5 280zm398.4 0c-3.5 85.6-25.6 165.1-57.9 217.3 92.1-32.7 159.9-116.5 169.3-217.3l-111.4 0zm111.4-48C501.9 131.2 434.1 47.3 342 14.7 374.3 66.9 396.4 146.4 399.9 232l111.4 0z\"]\n};\nvar faFolderMinus = {\n  prefix: 'fas',\n  iconName: 'folder-minus',\n  icon: [512, 512, [], \"f65d\", \"M448 448L64 448c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l138.7 0c13.8 0 27.3 4.5 38.4 12.8l38.4 28.8c5.5 4.2 12.3 6.4 19.2 6.4L448 80c35.3 0 64 28.7 64 64l0 240c0 35.3-28.7 64-64 64zM184 240c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z\"]\n};\nvar faMaskFace = {\n  prefix: 'fas',\n  iconName: 'mask-face',\n  icon: [640, 512, [], \"e1d7\", \"M320 64c-27.2 0-53.8 8-76.4 23.1l-37.1 24.8c-15.8 10.5-34.3 16.1-53.3 16.1L64 128c-35.3 0-64 28.7-64 64l0 78.7c0 62.6 45.2 116 107 126.3l97.9 16.3c33 22 72.6 34.7 115.1 34.7s82.2-12.8 115.1-34.7L533 396.9c61.7-10.3 107-63.7 107-126.3l0-78.7c0-35.3-28.7-64-64-64l-89.2 0c-19 0-37.5-5.6-53.3-16.1L396.4 87.1C373.8 72 347.2 64 320 64zM135.9 336.9l-18.4-3.1C86.6 328.7 64 302 64 270.7l0-78.7 48 0 0 48c0 35 8.6 67.9 23.9 96.9zm386.6-3.1l-18.4 3.1C519.4 307.9 528 275 528 240l0-48 48 0 0 78.7c0 31.3-22.6 58-53.5 63.1zM192 232c0-13.3 10.7-24 24-24l208 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-208 0c-13.3 0-24-10.7-24-24zm56 56l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faBong = {\n  prefix: 'fas',\n  iconName: 'bong',\n  icon: [512, 512, [], \"f55c\", \"M448.5 384c0 41.5-13.1 79.9-35.5 111.3-7.9 11.1-21.2 16.7-34.8 16.7l-243.3 0c-13.7 0-26.9-5.6-34.8-16.7-22.4-31.4-35.5-69.8-35.5-111.3 0-71.1 38.6-133.1 96-166.3l0-153.7c-17.7 0-32-14.3-32-32s14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 153.7c14.2 8.2 27.2 18.2 38.8 29.6l39.3-39.3-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0c16 16 32 32 48 48 9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-7-7-43.3 43.3c17.3 28.9 27.3 62.6 27.3 98.8zM288.5 64l-64 0 0 190.6-32 18.5c-19.5 11.3-35.7 27.5-46.9 46.9l221.8 0c-11.2-19.4-27.4-35.6-46.9-46.9l-32-18.5 0-190.6z\"]\n};\nvar faRoadBridge = {\n  prefix: 'fas',\n  iconName: 'road-bridge',\n  icon: [576, 512, [], \"e563\", \"M32 32l208 0 0 64-24 0 0 64 24 0 0 129.3c-45.4 7.6-80 47.1-80 94.7l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-94c0-38.8-26.4-72.6-64-82l0-112 40 0 0-64-8 0C14.3 96 0 81.7 0 64S14.3 32 32 32zM88 96l0 64 80 0 0-64-80 0zM336 32l72 0 0 72c0 13.3 10.7 24 24 24s24-10.7 24-24l0-72 72 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-72 0 0-72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 72-72 0c-26.5 0-48-21.5-48-48l0-352c0-26.5 21.5-48 48-48zm96 160c-13.3 0-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80c0-13.3-10.7-24-24-24z\"]\n};\nvar faArrowUp91 = {\n  prefix: 'fas',\n  iconName: 'arrow-up-9-1',\n  icon: [512, 512, [\"sort-numeric-up-alt\"], \"f887\", \"M150.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 141.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96zM365.1 206.6c-9.6 14.8-5.4 34.6 9.4 44.3s34.6 5.4 44.3-9.4l42.1-64.9c12.4-19.2 19.1-41.6 19.1-64.5 0-44.2-35.8-80-80-80s-80 35.8-80 80c0 36.1 23.9 66.7 56.8 76.6l-11.7 18zM376 112a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm42.7 182c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2 0 51.6-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-96c0-10.3-4.9-19.9-13.3-26z\"]\n};\nvar faSortNumericUpAlt = faArrowUp91;\nvar faMountainCity = {\n  prefix: 'fas',\n  iconName: 'mountain-city',\n  icon: [640, 512, [], \"e52e\", \"M256.3 48c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 48 48 0 0-72c0-13.3 10.7-24 24-24s24 10.7 24 24l0 72 16 0c26.5 0 48 21.5 48 48l0 320c0 26.5-21.5 48-48 48l-77.8 0c4-15.4 2.4-32.6-6.7-48.2L354.6 256 368.3 256c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-6.1 0-11.4 3.4-14.1 8.5l-42.6-73c-6-10.2-14.1-18-23.3-23.3l0-56.2zm64 64l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm160 96l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm16 80c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm-272-64.7l-65.1 111.6 33.1 33.1 48-48 40.4 0-56.4-96.7zm-27.6-47.9c12.3-21.2 42.9-21.2 55.3 0L420.3 463.9c12.4 21.3-2.9 48.1-27.6 48.1L56 512c-24.7 0-40.1-26.8-27.6-48.1L196.7 175.4z\"]\n};\nvar faArrowDown91 = {\n  prefix: 'fas',\n  iconName: 'arrow-down-9-1',\n  icon: [512, 512, [\"sort-numeric-desc\", \"sort-numeric-down-alt\"], \"f886\", \"M230.6 390.6l-80 80c-12.5 12.5-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 25.4-25.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zm134.5-184l11.7-18c-32.9-9.9-56.8-40.5-56.8-76.6 0-44.2 35.8-80 80-80s80 35.8 80 80c0 22.9-6.6 45.3-19.1 64.5l-42.1 64.9c-9.6 14.8-29.4 19.1-44.3 9.4s-19.1-29.4-9.4-44.3zM424 112a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zm-5.3 182c8.3 6 13.3 15.7 13.3 26l0 96 16 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-51.6-5.9 2c-16.8 5.6-34.9-3.5-40.5-20.2s3.5-34.9 20.2-40.5l48-16c9.8-3.3 20.5-1.6 28.8 4.4z\"]\n};\nvar faSortNumericDesc = faArrowDown91;\nvar faSortNumericDownAlt = faArrowDown91;\nvar faFaceGrinWide = {\n  prefix: 'fas',\n  iconName: 'face-grin-wide',\n  icon: [512, 512, [128515, \"grin-alt\"], \"f581\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM386.7 308.9c11.9-3.7 23.9 6.3 19.6 18.1-22.4 61.3-81.3 105.1-150.3 105.1S128.1 388.2 105.7 326.9c-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1zM208 192c0 35.3-14.3 64-32 64s-32-28.7-32-64 14.3-64 32-64 32 28.7 32 64zm128 64c-17.7 0-32-28.7-32-64s14.3-64 32-64 32 28.7 32 64-14.3 64-32 64z\"]\n};\nvar faGrinAlt = faFaceGrinWide;\nvar faPoop = {\n  prefix: 'fas',\n  iconName: 'poop',\n  icon: [512, 512, [], \"f619\", \"M254.4 6.6c3.5-4.3 9-6.5 14.5-5.7 46.9 6.3 83.1 46.5 83.1 95.1 0 11.2-1.9 22-5.5 32l5.5 0c35.3 0 64 28.7 64 64 0 19.1-8.4 36.3-21.7 48l13.7 0c39.8 0 72 32.2 72 72 0 23.2-11 43.8-28 57 34.1 5.7 60 35.3 60 71 0 39.8-32.2 72-72 72L72 512c-39.8 0-72-32.2-72-72 0-35.7 25.9-65.3 60-71-17-13.2-28-33.8-28-57 0-39.8 32.2-72 72-72l13.7 0c-13.3-11.7-21.7-28.9-21.7-48 0-35.3 28.7-64 64-64l16.2 0c44.1-.1 79.8-35.9 79.8-80 0-9.2-1.5-17.9-4.3-26.1-1.8-5.2-.8-11.1 2.8-15.4z\"]\n};\nvar faDharmachakra = {\n  prefix: 'fas',\n  iconName: 'dharmachakra',\n  icon: [512, 512, [9784], \"f655\", \"M337.8 205.7l48.6-42.5c13.8 19.3 23.4 41.9 27.4 66.2l-64.4 4.3c-2.4-10.1-6.4-19.5-11.6-28zm140.1 19.5c-5.3-38.8-20.6-74.5-43.2-104.3l.8-.7C449 108.4 449.7 87.6 437 75s-33.4-12-45.2 1.5l-.7 .8c-29.8-22.6-65.5-37.9-104.3-43.2l.1-1.1c1.2-17.9-13-33-30.9-33s-32.1 15.2-30.9 33l.1 1.1c-38.8 5.3-74.5 20.6-104.3 43.2l-.7-.8C108.4 63 87.6 62.3 75 75s-12 33.4 1.5 45.2l.8 .7c-22.6 29.8-37.9 65.5-43.2 104.3l-1.1-.1c-17.9-1.2-33 13-33 30.9s15.2 32.1 33 30.9l1.1-.1c5.3 38.8 20.6 74.5 43.2 104.3l-.8 .7C63 403.6 62.3 424.4 75 437s33.4 12 45.2-1.5l.7-.8c29.8 22.6 65.5 37.9 104.3 43.2l-.1 1.1c-1.2 17.9 13 33 30.9 33s32.1-15.2 30.9-33l-.1-1.1c38.8-5.3 74.5-20.6 104.3-43.2l.7 .8c11.8 13.5 32.5 14.2 45.2 1.5s12-33.4-1.5-45.2l-.8-.7c22.6-29.8 37.9-65.5 43.2-104.3l1.1 .1c17.9 1.2 33-13 33-30.9s-15.2-32.1-33-30.9l-1.1 .1zM163.2 125.6c19.3-13.8 41.9-23.4 66.2-27.5l4.3 64.4c-10 2.4-19.5 6.4-28 11.6l-42.5-48.6zm-65 103.8c4.1-24.4 13.7-46.9 27.5-66.2l48.6 42.5c-5.3 8.5-9.2 18-11.6 28l-64.4-4.3zm27.5 119.4c-13.8-19.3-23.4-41.9-27.5-66.2l64.4-4.3c2.4 10.1 6.4 19.5 11.6 28l-48.6 42.5zm103.8 65c-24.4-4.1-46.9-13.7-66.2-27.4l42.5-48.6c8.5 5.3 18 9.2 28 11.6l-4.3 64.4zm119.4-27.4c-19.3 13.8-41.9 23.4-66.2 27.4l-4.3-64.4c10-2.4 19.5-6.4 28-11.6l42.5 48.6zm65-103.8c-4.1 24.4-13.7 46.9-27.4 66.2l-48.6-42.5c5.3-8.6 9.2-18 11.6-28l64.4 4.3zm-65-156.9l-42.5 48.6c-8.6-5.3-18-9.2-28-11.6l4.3-64.4c24.4 4.1 46.9 13.7 66.2 27.5zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faBatteryQuarter = {\n  prefix: 'fas',\n  iconName: 'battery-quarter',\n  icon: [640, 512, [\"battery-2\"], \"f243\", \"M528 128c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-416 0c-8.8 0-16-7.2-16-16l0-224c0-8.8 7.2-16 16-16l416 0zM112 64c-44.2 0-80 35.8-80 80l0 224c0 44.2 35.8 80 80 80l416 0c44.2 0 80-35.8 80-80l0-48c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80L112 64zm56 112c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24l64 0c13.3 0 24-10.7 24-24l0-112c0-13.3-10.7-24-24-24l-64 0z\"]\n};\nvar faBattery2 = faBatteryQuarter;\nvar faAnkh = {\n  prefix: 'fas',\n  iconName: 'ankh',\n  icon: [320, 512, [9765], \"f644\", \"M96 128c0-35.3 28.7-64 64-64s64 28.7 64 64c0 41.6-20.7 76.6-46.6 104.1-5.9 6.2-11.8 11.8-17.4 16.7-5.6-4.9-11.5-10.5-17.4-16.7-25.9-27.5-46.6-62.6-46.6-104.1zM160 0C89.3 0 32 57.3 32 128 32 180.4 53.5 223.5 78.8 256L32 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-46.8 0C266.5 223.5 288 180.4 288 128 288 57.3 230.7 0 160 0z\"]\n};\nvar faDiamond = {\n  prefix: 'fas',\n  iconName: 'diamond',\n  icon: [512, 512, [9830], \"f219\", \"M17 215L215 17C225.9 6.1 240.6 0 256 0s30.1 6.1 41 17L495 215c10.9 10.9 17 25.6 17 41s-6.1 30.1-17 41L297 495c-10.9 10.9-25.6 17-41 17s-30.1-6.1-41-17L17 297C6.1 286.1 0 271.4 0 256s6.1-30.1 17-41z\"]\n};\nvar faSubscript = {\n  prefix: 'fas',\n  iconName: 'subscript',\n  icon: [576, 512, [], \"f12c\", \"M96 64C78.3 64 64 78.3 64 96s14.3 32 32 32l15.3 0 89.6 128-89.6 128-15.3 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c10.4 0 20.2-5.1 26.2-13.6L240 311.8 325.8 434.4c6 8.6 15.8 13.6 26.2 13.6l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-15.3 0-89.6-128 89.6-128 15.3 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0c-10.4 0-20.2 5.1-26.2 13.6L240 200.2 154.2 77.6C148.2 69.1 138.4 64 128 64L96 64zM544 320c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4l-32 16c-15.8 7.9-22.2 27.1-14.3 42.9 5.6 11.2 16.9 17.7 28.6 17.7l0 80c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-128z\"]\n};\nvar faRupeeSign = {\n  prefix: 'fas',\n  iconName: 'rupee-sign',\n  icon: [448, 512, [8360, \"rupee\"], \"f156\", \"M0 64C0 46.3 14.3 32 32 32l80 0c79.5 0 144 64.5 144 144 0 54.3-30 101.5-74.4 126.1l41 136.7c5.1 16.9-4.5 34.8-21.5 39.8s-34.8-4.5-39.8-21.5L120.1 319.8c-2.7 .1-5.4 .2-8.1 .2l-48 0 0 128c0 17.7-14.3 32-32 32S0 465.7 0 448L0 64zM64 256l48 0c44.2 0 80-35.8 80-80s-35.8-80-80-80l-48 0 0 160zm285.1-32l34.9 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-34.9 0c-7.2 0-13.1 5.9-13.1 13.1 0 5.7 3.7 10.7 9.1 12.5l49.4 15.9c31.9 10.3 53.5 39.9 53.5 73.4 0 42.6-34.5 77.1-77.1 77.1L320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l50.9 0c7.2 0 13.1-5.9 13.1-13.1 0-5.7-3.7-10.7-9.1-12.5l-49.4-15.9c-31.9-10.3-53.5-39.9-53.5-73.4 0-42.6 34.5-77.1 77.1-77.1z\"]\n};\nvar faRupee = faRupeeSign;\nvar faPersonRifle = {\n  prefix: 'fas',\n  iconName: 'person-rifle',\n  icon: [512, 512, [], \"e54e\", \"M416 0L384 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l0 100.3c-9.6 5.5-16 15.9-16 27.7l0 32c-17.7 0-32 14.3-32 32l0 144c0 17.7 14.3 32 32 32l16 0 0 96c0 8.8 7.2 16 16 16l59.5 0c10.4 0 18-9.8 15.5-19.9l-23-92.1 44 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-48 0 0-26.7 53.1-17.7c6.5-2.2 10.9-8.3 10.9-15.2l0-84.5c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16l0 56-16 5.3 0-109.3c0-11.8-6.4-22.2-16-27.7L432 16c0-8.8-7.2-16-16-16zM224 208C118 208 32 294 32 400l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48c0-32.5 12.1-62.1 32-84.7l0 196.7 160 0 0-293.1c-20-7.1-41.6-10.9-64-10.9zM280 88a72 72 0 1 0 -144 0 72 72 0 1 0 144 0z\"]\n};\nvar faD = {\n  prefix: 'fas',\n  iconName: 'd',\n  icon: [384, 512, [100], \"44\", \"M0 64C0 46.3 14.3 32 32 32l128 0c123.7 0 224 100.3 224 224S283.7 480 160 480L32 480c-17.7 0-32-14.3-32-32L0 64zM64 96l0 320 96 0c88.4 0 160-71.6 160-160S248.4 96 160 96L64 96z\"]\n};\nvar faSquareNfi = {\n  prefix: 'fas',\n  iconName: 'square-nfi',\n  icon: [448, 512, [], \"e576\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM93 172.3l35 63 0-51.4c0-13.3 10.7-24 24-24s24 10.7 24 24l0 144c0 10.9-7.4 20.5-18 23.2s-21.7-2-27-11.6l-35-63 0 51.4c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-144c0-10.9 7.4-20.5 18-23.2s21.7 2 27 11.6zM208 184c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-56 0 0 32 40 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-40 0 0 40c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-144zm192 0l0 144c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-144c0-13.3 10.7-24 24-24s24 10.7 24 24z\"]\n};\nvar faTeeth = {\n  prefix: 'fas',\n  iconName: 'teeth',\n  icon: [512, 512, [], \"f62e\", \"M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM144 208l0 24c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-24c0-26.5-21.5-48-48-48s-48 21.5-48 48zm128 0l0 24c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-24c0-26.5-21.5-48-48-48s-48 21.5-48 48zM80 176c-17.7 0-32 14.3-32 32l0 24c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-24c0-17.7-14.3-32-32-32zm320 32l0 24c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24l0-24c0-17.7-14.3-32-32-32s-32 14.3-32 32zM48 336c0 17.7 14.3 32 32 32s32-14.3 32-32l0-16c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 16zm144 48c26.5 0 48-21.5 48-48l0-16c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16l0 16c0 26.5 21.5 48 48 48zm128 0c26.5 0 48-21.5 48-48l0-16c0-8.8-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16l0 16c0 26.5 21.5 48 48 48zm112-16c17.7 0 32-14.3 32-32l0-16c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 16c0 17.7 14.3 32 32 32z\"]\n};\nvar faMagnifyingGlassDollar = {\n  prefix: 'fas',\n  iconName: 'magnifying-glass-dollar',\n  icon: [512, 512, [\"search-dollar\"], \"f688\", \"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM212 96c-11 0-20 9-20 20l0 4c-28.8 .3-52 23.7-52 52.5 0 25.7 18.5 47.6 43.9 51.8l41.7 7c6 1 10.4 6.2 10.4 12.3 0 6.9-5.6 12.5-12.5 12.5L168 256c-11 0-20 9-20 20s9 20 20 20l24 0 0 4c0 11 9 20 20 20s20-9 20-20l0-4.7c25-4.1 44-25.7 44-51.8 0-25.7-18.5-47.6-43.9-51.8l-41.7-7c-6-1-10.4-6.2-10.4-12.3 0-6.9 5.6-12.5 12.5-12.5l47.5 0c11 0 20-9 20-20s-9-20-20-20l-8 0 0-4c0-11-9-20-20-20z\"]\n};\nvar faSearchDollar = faMagnifyingGlassDollar;\nvar faDumpsterFire = {\n  prefix: 'fas',\n  iconName: 'dumpster-fire',\n  icon: [640, 512, [], \"f794\", \"M164.3 64L138.7 192 56 192c-13.3 0-24-10.7-24-24l0-4.1c0-2.6 .4-5.1 1.2-7.6L58.5 80.4C61.8 70.6 71 64 81.3 64l83 0zm23.4 128l25.6-128 82.7 0 0 128-108.3 0zM344 64l82.7 0 16 80c-14.7 .2-29.3 5.5-40.9 15.9-11.5 10.3-22.5 21-32.8 32.1l-24.9 0 0-128zM96 240l233.2 0c-6.4 8.8-12.3 17.6-17.7 26.3-21.4 34.7-39.5 76.1-39.5 115.8 0 17.1 2.1 33.8 6 49.9l-120.4 0 1.9 10.3c3.2 17.4-8.4 34-25.8 37.2s-34-8.4-37.2-25.8C71 313.3 58 242.1 57.7 240L96 240zm512-72c0 11-7.4 20.3-17.5 23.1-.9-.8-1.7-1.6-2.6-2.4-21.8-20-54.3-21.8-78-5.5-4.2-4.3-8.5-8.5-12.9-12.6l-21.3-106.6 83 0c10.3 0 19.5 6.6 22.8 16.4l25.3 75.9c.8 2.4 1.2 5 1.2 7.6l0 4.1zM505.7 240.3L518 226.5c5.4-6.1 13.3-8.8 20.9-8.9 7.2 0 14.3 2.6 19.9 7.8 19.7 18.3 39.8 43.2 55 70.6 15.1 27.2 26.2 58.1 26.2 88.1 0 88.7-71.3 159.8-160 159.8-89.6 0-160-71.3-160-159.8 0-37.3 16-73.4 36.8-104.5 20.9-31.3 47.5-59 70.9-80.2 5.7-5.2 13.1-7.7 20.3-7.5s13.4 3.2 18.8 7.5c14.4 11.4 38.9 40.7 38.9 40.7zM544 432.2c0-36.5-37-73-54.8-88.4-5.4-4.7-13.1-4.7-18.5 0-17.7 15.4-54.8 51.9-54.8 88.4 0 35.3 28.7 64 64 64s64-28.7 64-64z\"]\n};\nvar faUpload = {\n  prefix: 'fas',\n  iconName: 'upload',\n  icon: [448, 512, [], \"f093\", \"M256 109.3L256 320c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-210.7-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 109.3zM224 400c44.2 0 80-35.8 80-80l80 0c35.3 0 64 28.7 64 64l0 32c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-32c0-35.3 28.7-64 64-64l80 0c0 44.2 35.8 80 80 80zm144 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faUserSlash = {\n  prefix: 'fas',\n  iconName: 'user-slash',\n  icon: [576, 512, [62714, \"user-alt-slash\", \"user-large-slash\"], \"f506\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L311.5 245.7c55-10.9 96.5-59.5 96.5-117.7 0-66.3-53.7-120-120-120-58.2 0-106.8 41.5-117.7 96.5L41-24.9zM235.6 305.4C147.9 316.6 80 391.5 80 482.3 80 498.7 93.3 512 109.7 512l332.5 0-206.6-206.6z\"]\n};\nvar faUserAltSlash = faUserSlash;\nvar faUserLargeSlash = faUserSlash;\nvar faArrowLeft = {\n  prefix: 'fas',\n  iconName: 'arrow-left',\n  icon: [512, 512, [8592], \"f060\", \"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 105.4-105.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z\"]\n};\nvar faVialVirus = {\n  prefix: 'fas',\n  iconName: 'vial-virus',\n  icon: [576, 512, [], \"e597\", \"M64 32C64 14.3 78.3 0 96 0L320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 151.7c-18.5 0-37 7-51.1 21.1-21.6 21.6-26.6 53.6-15 79.9-26.9 10.4-45.9 36.6-45.9 67.1s19 56.7 45.9 67.1c-7.3 16.5-8 35.2-2.3 52.2-13.4 5.7-28.2 8.8-43.6 8.8-61.9 0-112-50.1-112-112L96 64C78.3 64 64 49.7 64 32zm96 32l0 128 96 0 0-128-96 0zM280 408c-13.3 0-24-10.7-24-24s10.7-24 24-24c28.8 0 43.2-34.8 22.9-55.2-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0c20.4 20.4 55.2 5.9 55.2-22.9 0-13.3 10.7-24 24-24s24 10.7 24 24c0 28.8 34.8 43.2 55.2 22.9 9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-20.4 20.4-5.9 55.2 22.9 55.2 13.3 0 24 10.7 24 24s-10.7 24-24 24c-28.8 0-43.2 34.8-22.9 55.2 9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-20.4-20.4-55.2-5.9-55.2 22.9 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-28.8-34.8-43.2-55.2-22.9-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9c20.4-20.4 5.9-55.2-22.9-55.2zm104-32a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm88 40a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faCheckDouble = {\n  prefix: 'fas',\n  iconName: 'check-double',\n  icon: [384, 512, [], \"f560\", \"M249.9 66.8c10.4-14.3 7.2-34.3-7.1-44.7s-34.3-7.2-44.7 7.1l-106 145.7-37.5-37.5c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c6.6 6.6 15.8 10 25.1 9.3s17.9-5.5 23.4-13.1l128-176zm128 136c10.4-14.3 7.2-34.3-7.1-44.7s-34.3-7.2-44.7 7.1l-170 233.7-69.5-69.5c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c6.6 6.6 15.8 10 25.1 9.3s17.9-5.5 23.4-13.1l192-264z\"]\n};\nvar faPaw = {\n  prefix: 'fas',\n  iconName: 'paw',\n  icon: [512, 512, [], \"f1b0\", \"M234.5 92.9c14.3 42.9-.3 86.2-32.6 96.8s-70.1-15.6-84.4-58.5 .3-86.2 32.6-96.8 70.1 15.6 84.4 58.5zM100.4 198.6c18.9 32.4 14.3 70.1-10.2 84.1s-59.7-.9-78.5-33.3-14.3-70.1 10.2-84.1 59.7 .9 78.5 33.3zM69.2 401.2C121.6 259.9 214.7 224 256 224s134.4 35.9 186.8 177.2c3.6 9.7 5.2 20.1 5.2 30.5l0 1.6c0 25.8-20.9 46.7-46.7 46.7-11.5 0-22.9-1.4-34-4.2l-88-22c-15.3-3.8-31.3-3.8-46.6 0l-88 22c-11.1 2.8-22.5 4.2-34 4.2-25.8 0-46.7-20.9-46.7-46.7l0-1.6c0-10.4 1.6-20.8 5.2-30.5zM421.8 282.7c-24.5-14-29.1-51.7-10.2-84.1s54-47.3 78.5-33.3 29.1 51.7 10.2 84.1-54 47.3-78.5 33.3zM310.1 189.7c-32.3-10.6-46.9-53.9-32.6-96.8s52.1-69.1 84.4-58.5 46.9 53.9 32.6 96.8-52.1 69.1-84.4 58.5z\"]\n};\nvar faHelmetSafety = {\n  prefix: 'fas',\n  iconName: 'helmet-safety',\n  icon: [576, 512, [\"hard-hat\", \"hat-hard\"], \"f807\", \"M352 264l0-200c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 200c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-185.9C90 109.8 32 191.8 32 288l0 64 512 0 0-64c-1-95.2-58.4-177.7-144-209.8L400 264c0 13.3-10.7 24-24 24s-24-10.7-24-24zM40 400c-22.1 0-40 17.9-40 40s17.9 40 40 40l496 0c22.1 0 40-17.9 40-40s-17.9-40-40-40L40 400z\"]\n};\nvar faHardHat = faHelmetSafety;\nvar faHatHard = faHelmetSafety;\nvar faE = {\n  prefix: 'fas',\n  iconName: 'e',\n  icon: [320, 512, [101], \"45\", \"M32 32C14.3 32 0 46.3 0 64L0 448c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0 0-128 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-128 224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32z\"]\n};\nvar faFaceLaughSquint = {\n  prefix: 'fas',\n  iconName: 'face-laugh-squint',\n  icon: [512, 512, [\"laugh-squint\"], \"f59b\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM107.7 332.1C102 318 113.4 304 128.6 304l254.9 0c15.2 0 26.6 14 20.9 28.1-23.8 58.6-81.2 99.9-148.3 99.9s-124.6-41.3-148.3-99.9zm15-188.8c4.5-6.8 13.3-9.2 20.6-5.5l79.6 40c5.4 2.7 8.8 8.2 8.8 14.3s-3.4 11.6-8.8 14.3l-79.6 40c-7.3 3.6-16.1 1.3-20.6-5.5s-3.1-15.9 3.1-21.1L159 192 125.8 164.3c-6.2-5.2-7.6-14.3-3.1-21.1zm263.6 21.1L353 192 386.2 219.7c6.2 5.2 7.6 14.3 3.1 21.1s-13.3 9.2-20.6 5.5l-79.6-40c-5.4-2.7-8.8-8.2-8.8-14.3s3.4-11.6 8.8-14.3l79.6-40c7.3-3.6 16.1-1.3 20.6 5.5s3.1 15.9-3.1 21.1z\"]\n};\nvar faLaughSquint = faFaceLaughSquint;\nvar faDownLeftAndUpRightToCenter = {\n  prefix: 'fas',\n  iconName: 'down-left-and-up-right-to-center',\n  icon: [512, 512, [\"compress-alt\"], \"f422\", \"M439.5 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S450.2 240 440.5 240l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87zM72.5 272l144 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S62.8 272 72.5 272z\"]\n};\nvar faCompressAlt = faDownLeftAndUpRightToCenter;\nvar faGifts = {\n  prefix: 'fas',\n  iconName: 'gifts',\n  icon: [576, 512, [], \"f79c\", \"M202-30.6c12.5 4.4 19 18.1 14.6 30.6l-8.2 23.1 25.4-18.5c10.7-7.8 25.7-5.4 33.5 5.3s5.4 25.7-5.3 33.5L233.8 64 272 64c26.5 0 48 21.5 48 48l0 2.1c-54.7 10.4-96 58.4-96 116l0 1.9c0 8.9 1 17.5 2.8 25.9-11.9 17.8-18.8 39.1-18.8 62.1l0 128c0 23.8 7.4 45.9 20.1 64L48 512c-26.5 0-48-21.5-48-48L0 112C0 85.5 21.5 64 48 64l38.2 0-28.3-20.6C47.2 35.6 44.8 20.6 52.6 9.9S75.4-3.2 86.1 4.6l27.4 20-8.3-25C101-13 107.8-26.6 120.4-30.8s26.2 2.6 30.4 15.2l9.9 29.8 10.7-30.2c4.4-12.5 18.1-19 30.6-14.6zM489.9 208c-7.5 0-14.5 3.8-18.6 10.1L446.9 256 488 256c13.3 0 24-10.7 24-24l0-1.9c0-12.2-9.9-22.1-22.1-22.1zM385.1 256l-24.4-37.9c-4.1-6.3-11.1-10.1-18.6-10.1-12.2 0-22.1 9.9-22.1 22.1l0 1.9c0 13.3 10.7 24 24 24l41.1 0zM281.9 268.5c-6.3-10.7-9.9-23.2-9.9-36.5l0-1.9c0-38.7 31.4-70.1 70.1-70.1 23.8 0 46 12.1 58.9 32.1l15 23.2 15-23.2c12.9-20 35.1-32.1 58.9-32.1 38.7 0 70.1 31.4 70.1 70.1l0 1.9c0 13.3-3.6 25.8-9.9 36.5 15.7 11.7 25.9 30.4 25.9 51.5l0 128c0 35.3-28.7 64-64 64l-72 0 0-208-48 0 0 208-72 0c-35.3 0-64-28.7-64-64l0-128c0-21.1 10.2-39.8 25.9-51.5z\"]\n};\nvar faBed = {\n  prefix: 'fas',\n  iconName: 'bed',\n  icon: [576, 512, [128716], \"f236\", \"M32 32c17.7 0 32 14.3 32 32l0 224 224 0 0-128c0-17.7 14.3-32 32-32l160 0c53 0 96 43 96 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64-448 0 0 64c0 17.7-14.3 32-32 32S0 465.7 0 448L0 64C0 46.3 14.3 32 32 32zm80 160a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z\"]\n};\nvar faMoneyBillTransfer = {\n  prefix: 'fas',\n  iconName: 'money-bill-transfer',\n  icon: [640, 512, [], \"e528\", \"M31 105c-9.4-9.4-9.4-24.6 0-33.9L103-1c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-31 31 67.7 0 0 0 338.3 0c35.3 0 64 28.7 64 64l0 178.2-5.1-5.1c-28.1-28.1-73.7-28.1-101.8 0-27.2 27.2-28.1 70.6-2.8 98.9l67.7 0-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9l-72 72c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-406.1 0c-35.3 0-64-28.7-64-64l0-178.2 5.1 5.1c28.1 28.1 73.7 28.1 101.8 0 27.2-27.2 28.1-70.6 2.8-98.9l-67.7 0 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L31 105zM416 256a96 96 0 1 0 -192 0 96 96 0 1 0 192 0zm88-64.5c4.4 .5 8-3.1 8-7.5l0-48c0-4.4-3.6-8-8-8l-48 0c-4.4 0-8.1 3.6-7.5 8 3.6 29 26.6 51.9 55.5 55.5zm-368 129c-4.4-.5-8 3.1-8 7.5l0 48c0 4.4 3.6 8 8 8l48 0c4.4 0 8.1-3.6 7.5-8-3.6-29-26.6-51.9-55.5-55.5z\"]\n};\nvar faPersonRunning = {\n  prefix: 'fas',\n  iconName: 'person-running',\n  icon: [448, 512, [127939, \"running\"], \"f70c\", \"M256.5-32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM123.6 176c-3.3 0-6.2 2-7.4 5L94.2 235.9c-6.6 16.4-25.2 24.4-41.6 17.8s-24.4-25.2-17.8-41.6l21.9-54.9C67.7 129.9 94.1 112 123.6 112l97.3 0c28.5 0 54.8 15.1 69.1 39.7l32.8 56.3 61.6 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-61.6 0c-22.8 0-43.8-12.1-55.3-31.8l-10-17.1-20.7 70.4 75.4 22.6c27.7 8.3 41.8 39 30.1 65.5L285.7 509c-7.2 16.2-26.1 23.4-42.2 16.2s-23.4-26.1-16.2-42.2l49.2-110.8-95.9-28.8c-32.7-9.8-52-43.7-43.7-76.8l22.7-90.6-35.9 0zm-8 181c13.3 14.9 30.7 26.3 51.2 32.4l4.7 1.4-6.9 19.3c-5.8 16.3-16 30.8-29.3 41.8L52.9 519.8c-13.6 11.2-33.8 9.3-45-4.3s-9.3-33.8 4.3-45l82.4-67.9c4.5-3.7 7.8-8.5 9.8-13.9L115.6 357z\"]\n};\nvar faRunning = faPersonRunning;\nvar faCircleChevronDown = {\n  prefix: 'fas',\n  iconName: 'circle-chevron-down',\n  icon: [512, 512, [\"chevron-circle-down\"], \"f13a\", \"M256 0a256 256 0 1 0 0 512 256 256 0 1 0 0-512zM135 241c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l87 87 87-87c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 345c-9.4 9.4-24.6 9.4-33.9 0L135 241z\"]\n};\nvar faChevronCircleDown = faCircleChevronDown;\nvar faUserNurse = {\n  prefix: 'fas',\n  iconName: 'user-nurse',\n  icon: [448, 512, [], \"f82f\", \"M96 44.9c0-12.7 7.5-24.2 19.2-29.3l96-42c8.2-3.6 17.5-3.6 25.7 0l96 42C344.5 20.7 352 32.2 352 44.9l0 99.1c0 70.7-57.3 128-128 128S96 214.7 96 144l0-99.1zM304 128l-111.6 0-.4 0-48 0 0 16c0 44.2 35.8 80 80 80s80-35.8 80-80l0-16zM208 16l0 16-16 0c-4.4 0-8 3.6-8 8l0 16c0 4.4 3.6 8 8 8l16 0 0 16c0 4.4 3.6 8 8 8l16 0c4.4 0 8-3.6 8-8l0-16 16 0c4.4 0 8-3.6 8-8l0-16c0-4.4-3.6-8-8-8l-16 0 0-16c0-4.4-3.6-8-8-8L216 8c-4.4 0-8 3.6-8 8zM142.6 323c-6.5-4.9-15.2-6.2-22.6-2.8-61.4 28.2-104.1 90.2-104.1 162.1 0 16.4 13.3 29.7 29.7 29.7l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-72-42.7-134-104.1-162.1-7.4-3.4-16.1-2.1-22.6 2.8l-67 50.2c-8.5 6.4-20.3 6.4-28.8 0l-67-50.2z\"]\n};\nvar faFaceKissWinkHeart = {\n  prefix: 'fas',\n  iconName: 'face-kiss-wink-heart',\n  icon: [640, 512, [128536, \"kiss-wink-heart\"], \"f598\", \"M543.7 268.3c.2-4.1 .3-8.2 .3-12.3 0-141.4-114.6-256-256-256S32 114.6 32 256 146.6 512 288 512c41.4 0 80.5-9.8 115.1-27.3-7.6-17.1-16.1-38.8-21.8-61.7-7.7-30.5-14.1-76.2 8.2-114.7l2.7-4.6c29.5-51 94.7-68.5 145.7-39 2 1.2 4 2.4 5.9 3.7zM240 304c0-8.8 7.2-16 16-16l32 0c26.5 0 48 21.5 48 48 0 12.3-4.6 23.5-12.2 32 7.6 8.5 12.2 19.7 12.2 32 0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0c-8.8 0-16-7.2-16-16zM208 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm152 20c-11 0-20 9-20 20s-9 20-20 20-20-9-20-20c0-33.1 26.9-60 60-60l16 0c33.1 0 60 26.9 60 60 0 11-9 20-20 20s-20-9-20-20-9-20-20-20l-16 0zM542.8 350c-2.2-18.3-12.9-34.6-28.9-43.8-28.1-16.2-63.9-6.6-80.1 21.5l-2.7 4.6c-24.5 42.5 7.9 117.9 24.4 150.8 5.1 10.1 15.5 16.1 26.8 15.5 36.7-2.2 118.2-11.7 142.8-54.2l2.7-4.6c16.2-28.1 6.6-63.9-21.5-80.1-16-9.2-35.4-10.4-52.4-3.1l-9.8 4.2-1.3-10.6z\"]\n};\nvar faKissWinkHeart = faFaceKissWinkHeart;\nvar faFill = {\n  prefix: 'fas',\n  iconName: 'fill',\n  icon: [512, 512, [], \"f575\", \"M296 64c6.9 0 13.5 2.7 18.3 7.6L440.4 197.7c4.9 4.9 7.6 11.5 7.6 18.3s-2.7 13.5-7.6 18.3L386.7 288 65.3 288c1.3-3.9 3.4-7.4 6.3-10.3l96.4-96.4 33.4 33.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L213.3 136 277.7 71.6c4.9-4.9 11.5-7.6 18.3-7.6zM122.7 136L26.3 232.4C9.5 249.3 0 272.1 0 296s9.5 46.7 26.3 63.6L152.4 485.7C169.3 502.5 192.1 512 216 512s46.7-9.5 63.6-26.3L485.7 279.6C502.5 262.7 512 239.9 512 216s-9.5-46.7-26.3-63.6L359.6 26.3C342.7 9.5 319.9 0 296 0s-46.7 9.5-63.6 26.3L168 90.7 118.6 41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L122.7 136z\"]\n};\nvar faMoneyBill1Wave = {\n  prefix: 'fas',\n  iconName: 'money-bill-1-wave',\n  icon: [512, 512, [\"money-bill-wave-alt\"], \"f53b\", \"M0 109.5L0 419.6c0 19.4 11.8 37.3 30.3 43.3 94 30 158.8 8.4 223.3-13.1 62.4-20.8 124.4-41.5 212.1-15.3 22.2 6.6 46.2-8.8 46.2-32l0-310.1c0-19.4-11.8-37.3-30.3-43.3-94-30-158.8-8.4-223.3 13.1-62.4 20.8-124.4 41.5-212.1 15.3-22.2-6.6-46.3 8.8-46.3 32zM256 368c-53 0-96-50.1-96-112s43-112 96-112 96 50.1 96 112-43 112-96 112zM127.1 405.5c.7 4.4-2.8 8.1-7.2 8.1-15.7 0-32.1-1.8-50-6.1-3.5-.8-6-4-6-7.7L64 360c0-4.4 3.6-8.1 8-7.5 28.1 3.5 50.6 25.2 55.2 53zM448 354.6c0 5-4.6 8.8-9.5 8-15.4-2.5-30.2-3.9-44.4-4.3-4.9-.1-8.7-4.5-7.2-9.2 7.3-23.7 28-41.4 53.2-44.6 4.4-.5 8 3.1 8 7.5l0 42.6zm-8-195.1c-28.1-3.5-50.6-25.2-55.2-53-.7-4.4 2.8-8.1 7.2-8.1 15.7 0 32.1 1.8 50 6.1 3.5 .8 6 4 6 7.7l0 39.9c0 4.4-3.6 8.1-8 7.5zm-322.1-5.8c4.9 .1 8.7 4.5 7.2 9.2-7.3 23.7-28 41.4-53.2 44.6-4.4 .5-8-3.1-8-7.5l0-42.6c0-5 4.6-8.8 9.5-8 15.4 2.5 30.2 3.9 44.4 4.3zM240 188c-11 0-20 9-20 20 0 9.7 6.9 17.7 16 19.6l0 48.4-4 0c-11 0-20 9-20 20s9 20 20 20l48 0c11 0 20-9 20-20s-9-20-20-20l-4 0 0-68c0-11-9-20-20-20l-16 0z\"]\n};\nvar faMoneyBillWaveAlt = faMoneyBill1Wave;\nvar faLandmark = {\n  prefix: 'fas',\n  iconName: 'landmark',\n  icon: [512, 512, [127963], \"f66f\", \"M238.7 5.1c10.5-6.8 24.1-6.8 34.6 0l224 144c11.9 7.7 17.4 22.3 13.4 35.9s-16.5 23-30.7 23l-32 0 0 208 51.2 38.4c8.1 6 12.8 15.5 12.8 25.6 0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32 0-10.1 4.7-19.6 12.8-25.6l51.2-38.4 0 0 0-208-32 0c-14.2 0-26.7-9.4-30.7-23s1.5-28.3 13.4-35.9l224-144zM336 208l0 208 64 0 0-208-64 0zM224 416l64 0 0-208-64 0 0 208zM112 208l0 208 64 0 0-208-64 0z\"]\n};\nvar faMusic = {\n  prefix: 'fas',\n  iconName: 'music',\n  icon: [512, 512, [127925], \"f001\", \"M468 7c7.6 6.1 12 15.3 12 25l0 304c0 44.2-43 80-96 80s-96-35.8-96-80 43-80 96-80c11.2 0 22 1.6 32 4.6l0-116.7-224 49.8 0 206.3c0 44.2-43 80-96 80s-96-35.8-96-80 43-80 96-80c11.2 0 22 1.6 32 4.6L128 96c0-15 10.4-28 25.1-31.2l288-64c9.5-2.1 19.4 .2 27 6.3z\"]\n};\nvar faBookMedical = {\n  prefix: 'fas',\n  iconName: 'book-medical',\n  icon: [448, 512, [], \"f7e6\", \"M96 512l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-66.7c18.6-6.6 32-24.4 32-45.3l0-288c0-26.5-21.5-48-48-48L96 0C43 0 0 43 0 96L0 416c0 53 43 96 96 96zM64 416c0-17.7 14.3-32 32-32l256 0 0 64-256 0c-17.7 0-32-14.3-32-32zM192 120c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 40 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-40 0 0 40c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40z\"]\n};\nvar faShuffle = {\n  prefix: 'fas',\n  iconName: 'shuffle',\n  icon: [512, 512, [128256, \"random\"], \"f074\", \"M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9S384 204.9 384 192l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8l-32.4 43.2-40-53.3 21.2-28.3C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM154 296l40 53.3-21.2 28.3C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L154 296zM438.6 470.6c-9.2 9.2-22.9 11.9-34.9 6.9S384 460.9 384 448l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32S14.3 96 32 96l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z\"]\n};\nvar faRandom = faShuffle;\nvar faUnderline = {\n  prefix: 'fas',\n  iconName: 'underline',\n  icon: [384, 512, [], \"f0cd\", \"M0 32C0 14.3 14.3 0 32 0L96 0c17.7 0 32 14.3 32 32S113.7 64 96 64l0 160c0 53 43 96 96 96s96-43 96-96l0-160c-17.7 0-32-14.3-32-32S270.3 0 288 0l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 160c0 88.4-71.6 160-160 160S32 312.4 32 224L32 64C14.3 64 0 49.7 0 32zM0 480c0-17.7 14.3-32 32-32l320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32z\"]\n};\nvar faBuildingUser = {\n  prefix: 'fas',\n  iconName: 'building-user',\n  icon: [640, 512, [], \"e4da\", \"M64 64C64 28.7 92.7 0 128 0L384 0c35.3 0 64 28.7 64 64l0 121.3c-46.9 19-80 65-80 118.7 0 27.7 8.8 53.4 23.8 74.4-51.5 21-87.8 71.6-87.8 130.7 0 1 0 1.9 0 2.9l-176 0c-35.3 0-64-28.7-64-64L64 64zM208 400l0 64 53.4 0c7.2-29.4 21.3-56.1 40.4-78.3-6.1-19.5-24.3-33.7-45.8-33.7-26.5 0-48 21.5-48 48zM339 224.3c-1-.2-2-.3-3-.3l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l16.7 0c2.1-22.8 8.4-44.3 18.3-63.7zM176 96c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zM176 224c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm240 80a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zM352 512c0-53 43-96 96-96l96 0c53 0 96 43 96 96 0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32z\"]\n};\nvar faRobot = {\n  prefix: 'fas',\n  iconName: 'robot',\n  icon: [640, 512, [129302], \"f544\", \"M352 0c0-17.7-14.3-32-32-32S288-17.7 288 0l0 64-96 0c-53 0-96 43-96 96l0 224c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-224c0-53-43-96-96-96l-96 0 0-64zM160 368c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24zm120 0c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24zm120 0c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0c-13.3 0-24-10.7-24-24zM224 176a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm144 48a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM64 224c0-17.7-14.3-32-32-32S0 206.3 0 224l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96zm544-32c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32z\"]\n};\nvar faPlus = {\n  prefix: 'fas',\n  iconName: 'plus',\n  icon: [448, 512, [10133, 61543, \"add\"], \"2b\", \"M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z\"]\n};\nvar faAdd = faPlus;\nvar faCopy = {\n  prefix: 'fas',\n  iconName: 'copy',\n  icon: [448, 512, [], \"f0c5\", \"M192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-200.6c0-17.4-7.1-34.1-19.7-46.2L370.6 17.8C358.7 6.4 342.8 0 326.3 0L192 0zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-16-64 0 0 16-192 0 0-256 16 0 0-64-16 0z\"]\n};\nvar faChessKing = {\n  prefix: 'fas',\n  iconName: 'chess-king',\n  icon: [448, 512, [9818], \"f43f\", \"M224-32c17.7 0 32 14.3 32 32l0 32 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 64 153.8 0c21.1 0 38.2 17.1 38.2 38.2 0 6.4-1.6 12.7-4.7 18.3L352 384 408.2 454.3c5 6.3 7.8 14.1 7.8 22.2 0 19.6-15.9 35.5-35.5 35.5L67.5 512c-19.6 0-35.5-15.9-35.5-35.5 0-8.1 2.7-15.9 7.8-22.2L96 384 4.7 216.6C1.6 210.9 0 204.6 0 198.2 0 177.1 17.1 160 38.2 160l153.8 0 0-64-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-32c0-17.7 14.3-32 32-32z\"]\n};\nvar faHouseFloodWater = {\n  prefix: 'fas',\n  iconName: 'house-flood-water',\n  icon: [640, 512, [], \"e50e\", \"M496 208l4.5 0c15.2 0 27.5-12.3 27.5-27.5 0-7.9-3.4-15.5-9.4-20.7L348 10.5C340.3 3.7 330.3 0 320 0s-20.3 3.7-28 10.5L121.4 159.8c-6 5.2-9.4 12.8-9.4 20.7 0 15.2 12.3 27.5 27.5 27.5l4.5 0 0 94.4c20.3-9.4 42.1-14.2 64-14.4 33.1-.2 66.3 10.2 94.4 31.4 22.1 16.6 29.1 16.6 51.2 0 27.5-20.7 59.9-31.2 92.4-31.4 16.9-.1 33.8 2.6 50 8l0-88zm-224-8c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-48zM474.6 412.1c19 14.4 41.9 28.2 67.2 33.3 26.5 5.4 54.3 .8 80.7-19.1 10.6-8 12.7-23 4.7-33.6s-23-12.7-33.6-4.7c-14.9 11.2-28.6 13.1-42.3 10.3-14.9-3-30.9-11.9-47.8-24.6-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-21.6 16.3-41.3 25.8-58.9 25.7-9.6-.1-19.9-3-31.2-11.5-10.6-8-25.6-5.9-33.6 4.7S7 418.3 17.6 426.3c19.1 14.4 39.4 21 59.8 21.1 33.9 .2 64.3-17.4 88.1-35.3 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9c21.3-16.1 49.9-16.1 71.2 0zm-71.2 96c21.3-16.1 49.9-16.1 71.2 0 19 14.4 41.9 28.2 67.2 33.3 26.5 5.4 54.3 .8 80.7-19.1 10.6-8 12.7-23 4.7-33.6s-23-12.7-33.6-4.7c-14.9 11.2-28.6 13.1-42.3 10.3-14.9-3-30.9-11.9-47.8-24.6-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-21.6 16.3-41.3 25.8-58.9 25.7-9.6-.1-19.9-3-31.2-11.5-10.6-8-25.6-5.9-33.6 4.7S7 514.3 17.6 522.3c19.1 14.4 39.4 21 59.8 21.1 33.9 .2 64.3-17.4 88.1-35.3 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9z\"]\n};\nvar faBitcoinSign = {\n  prefix: 'fas',\n  iconName: 'bitcoin-sign',\n  icon: [320, 512, [], \"e0b4\", \"M64 24C64 10.7 74.7 0 88 0s24 10.7 24 24l0 40 32 0 0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 41.1c54.3 7.8 96 54.4 96 110.9 0 24.2-7.7 46.6-20.7 64.9 31.7 19.8 52.7 55 52.7 95.1 0 61.9-50.1 112-112 112l-16 0 0 40c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-40-32 0 0 40c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-40-22.3 0C18.7 448 0 429.3 0 406.3L0 101.6C0 80.8 16.8 64 37.6 64L64 64 64 24zm0 200l112 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-112 0 0 96zm112 64l-112 0 0 96 144 0c26.5 0 48-21.5 48-48s-21.5-48-48-48l-32 0z\"]\n};\nvar faBox = {\n  prefix: 'fas',\n  iconName: 'box',\n  icon: [448, 512, [128230], \"f466\", \"M369.4 128l-34.3-48-222.1 0-34.3 48 290.7 0zM0 148.5c0-13.3 4.2-26.3 11.9-37.2L60.9 42.8C72.9 26 92.3 16 112.9 16l222.1 0c20.7 0 40.1 10 52.1 26.8l48.9 68.5c7.8 10.9 11.9 23.9 11.9 37.2L448 416c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 148.5z\"]\n};\nvar faSquarePlus = {\n  prefix: 'fas',\n  iconName: 'square-plus',\n  icon: [448, 512, [61846, \"plus-square\"], \"f0fe\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM200 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z\"]\n};\nvar faPlusSquare = faSquarePlus;\nvar faArrowsLeftRight = {\n  prefix: 'fas',\n  iconName: 'arrows-left-right',\n  icon: [576, 512, [\"arrows-h\"], \"f07e\", \"M470.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l41.4 41.4-357.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-41.4-41.4 357.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z\"]\n};\nvar faArrowsH = faArrowsLeftRight;\nvar faFan = {\n  prefix: 'fas',\n  iconName: 'fan',\n  icon: [512, 512, [], \"f863\", \"M160 144c0-79.5 64.5-144 144-144 8.8 0 16 7.2 16 16l0 152.2c15-5.3 31.2-8.2 48-8.2 79.5 0 144 64.5 144 144 0 8.8-7.2 16-16 16l-152.2 0c5.3 15 8.2 31.2 8.2 48 0 79.5-64.5 144-144 144-8.8 0-16-7.2-16-16l0-152.2c-15 5.3-31.2 8.2-48 8.2-79.5 0-144-64.5-144-144 0-8.8 7.2-16 16-16l152.2 0c-5.3-15-8.2-31.2-8.2-48zm96 144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faCrow = {\n  prefix: 'fas',\n  iconName: 'crow',\n  icon: [640, 512, [], \"f520\", \"M456.5 0c-48.6 0-88 39.4-88 88l0 36-355.2 266.4C-.8 401-3.7 421 6.9 435.2s30.6 17 44.8 6.4l76.8-57.6 131.3 0 46.6 113.1 1 2.2c5.7 10.7 18.8 15.5 30.3 10.8s17.3-17.3 13.9-29l-.8-2.3-39.1-94.9 40.9 0c1.1 0 2.2 0 3.2 0l46.6 113.2 1 2.2c5.7 10.7 18.8 15.5 30.3 10.8s17.3-17.3 13.9-29l-.8-2.3-42-102C485.3 354.1 544.5 280 544.5 192l0-72 80.5-20.1c8.6-2.1 13.8-10.8 11.6-19.4-7.1-28.5-32.7-48.5-62.1-48.5l-50.1 0C508.2 12.5 483.8 0 456.5 0zm0 64a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faFileCircleCheck = {\n  prefix: 'fas',\n  iconName: 'file-circle-check',\n  icon: [576, 512, [], \"e5a0\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-22.7-31.5-36-70.2-36-112 0-100.6 77.4-183.2 176-191.3l0-38.1c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM576 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-86.6-60.9c7.1 5.2 8.7 15.2 3.5 22.3l-64 88c-2.8 3.8-7 6.2-11.7 6.5s-9.3-1.3-12.6-4.6l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l26.8 26.8 53-72.9c5.2-7.1 15.2-8.7 22.4-3.5z\"]\n};\nvar faLinkSlash = {\n  prefix: 'fas',\n  iconName: 'link-slash',\n  icon: [576, 512, [\"chain-broken\", \"chain-slash\", \"unlink\"], \"f127\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-122-122c4.2-3.4 8.3-7.1 12.1-10.9l71.1-71.1c29.3-29.3 45.8-69.1 45.8-110.6 0-86.4-70-156.5-156.5-156.5-37.3 0-73.1 13.3-101.3 37.2 20.3 10.1 38.7 23.5 54.5 39.5 14.1-8.3 30.2-12.7 46.8-12.7 51.1 0 92.5 41.4 92.5 92.5 0 24.5-9.7 48-27.1 65.4l-71.1 71.1c-3.9 3.9-8.1 7.4-12.6 10.5l-47.5-47.5c16.5-.9 29.7-14.4 30.2-31.1 0-1.3 0-2.6 0-3.9 0-86.3-69.9-156.9-156.5-156.9-19.2 0-37.9 3.5-55.5 10.2L41-24.9zM225.9 160c.6 0 1.1 0 1.7 0 15.1 0 29.5 3.7 42.1 10.2 1.8 1.2 3.6 2.3 5.5 3.1 26.8 16.3 44.8 45.9 44.8 79.6 0 .4 0 .8 0 1.2L225.9 160zM346.2 416L192 261.8c1.2 84.6 69.6 152.9 154.1 154.1zM139.7 209.5l-45.3-45.3-48.6 48.6c-29.3 29.3-45.8 69.1-45.8 110.6 0 86.4 70 156.5 156.5 156.5 37.2 0 73.1-13.3 101.3-37.2-20.3-10.1-38.8-23.5-54.6-39.5-14 8.2-30.1 12.6-46.7 12.6-51.1 0-92.5-41.4-92.5-92.5 0-24.5 9.7-48 27.1-65.4l48.6-48.6z\"]\n};\nvar faChainBroken = faLinkSlash;\nvar faChainSlash = faLinkSlash;\nvar faUnlink = faLinkSlash;\nvar faArrowRotateRight = {\n  prefix: 'fas',\n  iconName: 'arrow-rotate-right',\n  icon: [512, 512, [8635, \"arrow-right-rotate\", \"arrow-rotate-forward\", \"redo\"], \"f01e\", \"M436.7 74.7L448 85.4 448 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l47.9 0-7.6-7.2c-.2-.2-.4-.4-.6-.6-75-75-196.5-75-271.5 0s-75 196.5 0 271.5 196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c99.9-99.9 261.7-100 361.7-.3z\"]\n};\nvar faArrowRightRotate = faArrowRotateRight;\nvar faArrowRotateForward = faArrowRotateRight;\nvar faRedo = faArrowRotateRight;\nvar faPenClip = {\n  prefix: 'fas',\n  iconName: 'pen-clip',\n  icon: [512, 512, [\"pen-alt\"], \"f305\", \"M404 0c19.2 0 37.6 7.6 51.1 21.2l35.7 35.7C504.4 70.4 512 88.8 512 108s-7.6 37.6-21.2 51.1L445.9 204 308 66.1 352.9 21.2C366.4 7.6 384.8 0 404 0zM274.1 100l0 0 137.9 137.9-215.1 215.1c-10.7 10.7-24.1 18.5-38.7 22.6L30.4 511.1c-8.3 2.3-17.3 0-23.4-6.2s-8.5-15.1-6.2-23.4L36.4 353.8c4.1-14.6 11.8-27.9 22.6-38.7L240.1 133.9 223 116.9c-9.4-9.4-24.6-9.4-33.9 0L89 217c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L155.1 82.9c28.1-28.1 73.7-28.1 101.8 0L274.1 100z\"]\n};\nvar faPenAlt = faPenClip;\nvar faDoorClosed = {\n  prefix: 'fas',\n  iconName: 'door-closed',\n  icon: [448, 512, [128682], \"f52a\", \"M32 64C32 28.7 60.7 0 96 0L352 0c35.3 0 64 28.7 64 64l0 384c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32L32 64zM320 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faArrowDownWideShort = {\n  prefix: 'fas',\n  iconName: 'arrow-down-wide-short',\n  icon: [576, 512, [\"sort-amount-asc\", \"sort-amount-down\"], \"f160\", \"M246.6 374.6l-96 96c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96z\"]\n};\nvar faSortAmountAsc = faArrowDownWideShort;\nvar faSortAmountDown = faArrowDownWideShort;\nvar faCaretDown = {\n  prefix: 'fas',\n  iconName: 'caret-down',\n  icon: [320, 512, [], \"f0d7\", \"M140.3 376.8c12.6 10.2 31.1 9.5 42.8-2.2l128-128c9.2-9.2 11.9-22.9 6.9-34.9S301.4 192 288.5 192l-256 0c-12.9 0-24.6 7.8-29.6 19.8S.7 237.5 9.9 246.6l128 128 2.4 2.2z\"]\n};\nvar faK = {\n  prefix: 'fas',\n  iconName: 'k',\n  icon: [320, 512, [107], \"4b\", \"M311 86.3c12.3-12.7 12-32.9-.7-45.2s-32.9-12-45.2 .7C143.4 167.2 76.4 236.3 64 249L64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-107 64.7-66.7 133 192c10.1 14.5 30 18.1 44.5 8.1s18.1-30 8.1-44.5L174.1 227.4 311 86.3z\"]\n};\nvar faCheckToSlot = {\n  prefix: 'fas',\n  iconName: 'check-to-slot',\n  icon: [576, 512, [\"vote-yea\"], \"f772\", \"M552 288c13.3 0 24 10.7 24 24l0 104c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 312c0-13.3 10.7-24 24-24s24 10.7 24 24l0 104c0 8.8 7.2 16 16 16l448 0c8.8 0 16-7.2 16-16l0-104c0-13.3 10.7-24 24-24zM416 32c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-256 0c-35.3 0-64-28.7-64-64L96 96c0-35.3 28.7-64 64-64l256 0zm-37.1 84.6c-10.7-7.8-25.7-5.4-33.5 5.3l-85.6 117.7-26.5-27.4c-9.2-9.5-24.4-9.8-33.9-.6-9.5 9.2-9.8 24.4-.6 33.9l46.4 48c4.9 5.1 11.8 7.8 18.9 7.3s13.6-4.1 17.8-9.8L384.2 150.1c7.8-10.7 5.4-25.7-5.3-33.5z\"]\n};\nvar faVoteYea = faCheckToSlot;\nvar faFishFins = {\n  prefix: 'fas',\n  iconName: 'fish-fins',\n  icon: [576, 512, [], \"e4f2\", \"M275.2 38.4c-10.6-8-25-8.5-36.3-1.5S222 57.3 224.6 70.3l9.7 48.6c-19.4 9-36.9 19.9-52.4 31.5-15.3 11.5-29 23.9-40.7 36.3L48.1 132.4c-12.5-7.3-28.4-5.3-38.7 4.9s-12.4 26-5.3 38.6L50 256 4.2 336.1c-7.2 12.6-5 28.4 5.3 38.6s26.1 12.2 38.7 4.9l93.1-54.3c11.8 12.3 25.4 24.8 40.7 36.3 15.5 11.6 33 22.5 52.4 31.5l-9.7 48.6c-2.6 13 3.1 26.3 14.3 33.3s25.6 6.5 36.3-1.5l77.6-58.2c54.9-4 101.5-27 137.2-53.8 39.2-29.4 67.2-64.7 81.6-89.5 5.8-9.9 5.8-22.2 0-32.1-14.4-24.8-42.5-60.1-81.6-89.5-35.8-26.8-82.3-49.8-137.2-53.8L275.2 38.4zM384 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faCompress = {\n  prefix: 'fas',\n  iconName: 'compress',\n  icon: [448, 512, [], \"f066\", \"M160 64c0-17.7-14.3-32-32-32S96 46.3 96 64l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 320c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0z\"]\n};\nvar faArrowUpAZ = {\n  prefix: 'fas',\n  iconName: 'arrow-up-a-z',\n  icon: [512, 512, [\"sort-alpha-up\"], \"f15e\", \"M412.6 49.7C407.2 38.8 396.1 32 384 32s-23.2 6.8-28.6 17.7c-50.7 101.3-77.3 154.7-80 160-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3 88.4 0 7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9c-2.7-5.3-29.3-58.7-80-160zM384 135.6l20.2 40.4-40.4 0 20.2-40.4zM288 320c0 17.7 14.3 32 32 32l50.7 0-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9S307.1 480 320 480l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-50.7 0 73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9S460.9 288 448 288l-128 0c-17.7 0-32 14.3-32 32zM150.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 141.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7 25.4 25.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-80-80z\"]\n};\nvar faSortAlphaUp = faArrowUpAZ;\nvar faUserGraduate = {\n  prefix: 'fas',\n  iconName: 'user-graduate',\n  icon: [448, 512, [], \"f501\", \"M241.3-13c-11.4-2.3-23.1-2.3-34.5 0L19.3 24.5C8.1 26.7 0 36.6 0 48 0 58.3 6.5 67.3 16 70.6L16 144 .3 222.6c-.2 .9-.3 1.9-.3 2.9 0 8 6.5 14.6 14.6 14.6l34.9 0c8 0 14.6-6.5 14.6-14.6 0-1-.1-1.9-.3-2.9L48 144 48 77.3 96 86.9 96 144c0 70.7 57.3 128 128 128s128-57.3 128-128l0-57.1 76.7-15.3C439.9 69.3 448 59.4 448 48s-8.1-21.3-19.3-23.5L241.3-13zM224 224c-44.2 0-80-35.8-80-80l160 0c0 44.2-35.8 80-80 80zM120.1 320.1C58.7 348.3 16 410.3 16 482.3 16 498.7 29.3 512 45.7 512l154.3 0 0-146-57.4-43c-6.5-4.9-15.2-6.2-22.6-2.8zM248 512l154.3 0c16.4 0 29.7-13.3 29.7-29.7 0-72-42.7-134-104.1-162.1-7.4-3.4-16.1-2.1-22.6 2.8l-57.4 43 0 146z\"]\n};\nvar faFileCode = {\n  prefix: 'fas',\n  iconName: 'file-code',\n  icon: [384, 512, [], \"f1c9\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM154.2 295.6c8.6-10.1 7.5-25.2-2.6-33.8s-25.2-7.5-33.8 2.6l-48 56c-7.7 9-7.7 22.2 0 31.2l48 56c8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8l-34.6-40.4 34.6-40.4zm112-31.2c-8.6-10.1-23.8-11.2-33.8-2.6s-11.2 23.8-2.6 33.8l34.6 40.4-34.6 40.4c-8.6 10.1-7.5 25.2 2.6 33.8s25.2 7.5 33.8-2.6l48-56c7.7-9 7.7-22.2 0-31.2l-48-56z\"]\n};\nvar faSoap = {\n  prefix: 'fas',\n  iconName: 'soap',\n  icon: [512, 512, [129532], \"e06e\", \"M208-32a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM320 96a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM352 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM96 160l112 0c0 23.8 7.4 45.9 20.1 64L160 224c-53 0-96 43-96 96s43 96 96 96l192 0c53 0 96-43 96-96 0-35.1-18.9-65.9-47-82.6 19-19.8 30.7-46.6 31-76.1 45.4 7.6 80 47.1 80 94.7l0 128c0 53-43 96-96 96L96 480c-53 0-96-43-96-96L0 256c0-53 43-96 96-96zm64 112l192 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48s21.5-48 48-48z\"]\n};\nvar faRecycle = {\n  prefix: 'fas',\n  iconName: 'recycle',\n  icon: [512, 512, [9842, 9850, 9851], \"f1b8\", \"M152.3 60C198.5-20 314-20 360.2 60l37.3 64.6 27.7-16c8.4-4.9 18.9-4.2 26.6 1.7s11.1 15.9 8.6 25.3L436.9 223c-3.4 12.8-16.6 20.4-29.4 17l-87.4-23.4c-9.4-2.5-16.3-10.4-17.6-20s3.4-19.1 11.8-23.9l27.7-16-37.3-64.6c-21.6-37.3-75.4-37.3-97 0l-5.3 9.1c-8.8 15.3-28.4 20.5-43.7 11.7S138.2 84.5 147 69.1l5.3-9.1zM449.7 279.1c15.3-8.8 34.9-3.6 43.7 11.7l5.3 9.1c46.2 80-11.5 180-103.9 180l-74.6 0 0 32c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-64-64c-9.4-9.4-9.4-24.6 0-33.9l64-64c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 32 74.6 0c43.1 0 70.1-46.7 48.5-84l-5.3-9.1c-8.8-15.3-3.6-34.9 11.7-43.7zM51 235.4l-27.7-16c-8.4-4.9-13.1-14.3-11.8-23.9s8.2-17.5 17.6-20L116.5 152c12.8-3.4 26 4.2 29.4 17l23.4 87.4c2.5 9.4-.9 19.3-8.6 25.3s-18.2 6.6-26.6 1.7l-27.7-16-37.3 64.6c-21.6 37.3 5.4 84 48.5 84l10.6 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-10.6 0C25.3 480-32.4 380 13.8 300L51 235.4z\"]\n};\nvar faFaceGrinWink = {\n  prefix: 'fas',\n  iconName: 'face-grin-wink',\n  icon: [512, 512, [\"grin-wink\"], \"f58c\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM386.7 308.9c11.9-3.7 23.9 6.3 19.6 18.1-22.4 61.3-81.3 105.1-150.3 105.1S128.1 388.2 105.7 326.9c-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1zM328 196c-11 0-20 9-20 20s-9 20-20 20-20-9-20-20c0-33.1 26.9-60 60-60l16 0c33.1 0 60 26.9 60 60 0 11-9 20-20 20s-20-9-20-20-9-20-20-20l-16 0zM176 176a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faGrinWink = faFaceGrinWink;\nvar faWaterLadder = {\n  prefix: 'fas',\n  iconName: 'water-ladder',\n  icon: [640, 512, [\"ladder-water\", \"swimming-pool\"], \"f5c5\", \"M374.5 405.7c38.4-29 90.5-29 129 0 16.9 12.7 32.9 21.5 47.8 24.6 13.7 2.8 27.4 .9 42.3-10.3 10.6-8 25.6-5.9 33.6 4.7s5.8 25.7-4.8 33.6c-26.4 19.9-54.2 24.4-80.7 19.1-25.3-5.1-48.1-18.9-67.2-33.3-21.3-16.1-49.9-16.1-71.2 0-24.2 18.3-52.3 35.9-83.4 35.9s-59.1-17.7-83.3-35.9c-21.3-16.1-49.9-16.1-71.2 0-23.8 17.9-54.1 35.5-88.1 35.3-20.4-.1-40.7-6.7-59.8-21.1-10.6-8-12.7-23-4.7-33.6s23-12.7 33.6-4.7c11.3 8.5 21.6 11.4 31.2 11.5 17.6 .1 37.3-9.4 58.9-25.7 38.4-29 90.6-29 129 0 24 18.1 40.7 26.3 54.5 26.3s30.5-8.2 54.5-26.3zM511.8 32c48.3 0 89 36 95 83.9l1 8.2c2.2 17.5-10.2 33.5-27.8 35.7s-33.5-10.2-35.7-27.8l-1-8.2c-2-15.9-15.5-27.8-31.5-27.8-17.5 0-31.8 14.2-31.8 31.8l0 211.8c-23.1-5.1-44.9-4.4-64-.4l0-51.2-192 0 0 48.7c-5.3-.5-10.7-.8-16-.7-16.2 .1-32.4 2.7-48 8l0-216.2c0-52.9 42.9-95.8 95.7-95.8 48.3 0 89 36 95 83.9l1 8.2c2.2 17.5-10.2 33.5-27.8 35.7s-33.5-10.2-35.7-27.8l-1-8.2c-2-15.9-15.5-27.8-31.5-27.8-17.5 0-31.7 14.2-31.7 31.8l0 96.2 192 0 0-96.2C416 74.9 458.9 32 511.8 32z\"]\n};\nvar faLadderWater = faWaterLadder;\nvar faSwimmingPool = faWaterLadder;\nvar faGemini = {\n  prefix: 'fas',\n  iconName: 'gemini',\n  icon: [448, 512, [], \"e849\", \"M395.4 8c13.2-11.7 33.3-10.5 45.1 2.7 11.7 13.2 10.5 33.4-2.7 45.2-2.7 2.4-23.1 19.8-58.3 36.8-8.2 4-17.2 7.9-27 11.6l0 303.2c9.8 3.8 18.8 7.6 27 11.6 18.2 8.8 32.4 17.7 42.2 24.5 3 2.1 5.5 4.1 7.7 5.7 1.2 .9 2.3 1.6 3.2 2.4 .2 .1 .3 .2 .5 .4 1.3 1.1 2.4 2 3.2 2.6 .4 .3 .7 .6 .9 .8 .1 .1 .3 .2 .3 .3 0 0 .1 .1 .1 .1l.1 0 0 0 0 0c3.3 2.9 5.9 6.4 7.7 10.2 5.4 11.3 3.8 25.1-5 35-.3 .4-.7 .7-1.1 1.1-11.9 12.2-31.2 13.1-44 1.7-.3-.3-1.5-1.3-3.5-2.8-.4-.3-.9-.7-1.5-1.1-1.9-1.4-4.2-3.1-7.1-5.1-2.2-1.5-4.7-3.1-7.4-4.8-6.6-4.1-14.8-8.8-24.4-13.5-7.4-3.6-15.6-7.2-24.7-10.5-13.6-5.1-29-9.6-46.1-12.9-5.7-1.1-11.6-2.1-17.7-2.8-12.1-1.6-25-2.5-38.6-2.5-54.2 0-97.4 14.4-127 28.8-3.4 1.6-6.5 3.3-9.5 4.9-5.1 2.8-9.7 5.4-13.8 7.9-3.3 2.1-6.3 4-8.9 5.7-1.7 1.2-3.2 2.3-4.6 3.3-1.9 1.4-3.5 2.5-4.6 3.4-1.4 1.1-2.2 1.8-2.5 2-13.2 11.7-33.3 10.5-45.1-2.8-2.2-2.5-4-5.2-5.2-8.1s-2.1-5.9-2.5-8.9c-1.4-10.2 2.2-20.8 10.4-28.2 .2-.2 .6-.5 1.2-1 .1-.1 .2-.2 .3-.3l3.2-2.6c1.7-1.3 3.7-2.8 6.2-4.6 1.6-1.2 3.3-2.5 5.2-3.8 9.8-6.8 24-15.7 42.2-24.5 8.2-4 17.2-7.9 27-11.6l0-303.2C86.7 100.6 77.7 96.7 69.5 92.8 34.3 75.7 14 58.3 11.3 55.9-1.9 44.2-3.1 24 8.6 10.7 20.3-2.5 40.5-3.7 53.7 8 55.1 9.2 70.7 22.2 97.5 35.2 127.1 49.6 170.3 64 224.5 64s97.4-14.4 127-28.8c26.8-13 42.4-26 43.8-27.2zM288.5 122.3c-19.7 3.5-41 5.7-64 5.7s-44.3-2.2-64-5.7l0 267.4c12.6-2.3 25.9-4 39.9-4.9 7.8-.5 15.8-.8 24-.8 23 0 44.4 2.2 64 5.7l0-267.4z\"]\n};\nvar faTowerCell = {\n  prefix: 'fas',\n  iconName: 'tower-cell',\n  icon: [576, 512, [], \"e585\", \"M59.6 9.8C47.3 4.8 33.3 10.7 28.4 23 15.2 55.5 8 90.9 8 128s7.2 72.5 20.4 105c5 12.3 19 18.2 31.3 13.2s18.2-19 13.2-31.3C62 188.2 56 158.8 56 128s6-60.2 16.9-87c5-12.3-1-26.3-13.2-31.3zm456.8 0c-12.3 5-18.2 19-13.2 31.3 10.9 26.8 16.9 56.2 16.9 87s-6 60.2-16.9 87c-5 12.3 1 26.3 13.2 31.3s26.3-1 31.3-13.2c13.1-32.5 20.4-67.9 20.4-105s-7.2-72.5-20.4-105c-5-12.3-19-18.2-31.3-13.2zM340.1 165.2c7.5-10.5 11.9-23.3 11.9-37.2 0-35.3-28.7-64-64-64s-64 28.7-64 64c0 13.9 4.4 26.7 11.9 37.2L98.9 466.8c-7.3 16.1-.2 35.1 15.9 42.4s35.1 .2 42.4-15.9l20.6-45.2 220.6 0 20.6 45.2c7.3 16.1 26.3 23.2 42.4 15.9s23.2-26.3 15.9-42.4L340.1 165.2zM376.5 400l-177 0 21.8-48 133.3 0 21.8 48zM288 205.3l44.8 98.7-89.7 0 44.8-98.7zM163.3 73.6c5.3-12.1-.2-26.3-12.4-31.6s-26.3 .2-31.6 12.4C109.5 77 104 101.9 104 128s5.5 51 15.3 73.6c5.3 12.1 19.5 17.7 31.6 12.4s17.7-19.5 12.4-31.6C156 165.8 152 147.4 152 128s4-37.8 11.3-54.4zM456.7 54.4c-5.3-12.1-19.5-17.7-31.6-12.4s-17.7 19.5-12.4 31.6C420 90.2 424 108.6 424 128s-4 37.8-11.3 54.4c-5.3 12.1 .2 26.3 12.4 31.6s26.3-.2 31.6-12.4C466.5 179 472 154.1 472 128s-5.5-51-15.3-73.6z\"]\n};\nvar faColonSign = {\n  prefix: 'fas',\n  iconName: 'colon-sign',\n  icon: [384, 512, [], \"e140\", \"M213.8 8.7c12.9 3.2 20.7 16.2 17.5 29.1l-4.6 18.5c15.4 .8 30.4 3.4 44.7 7.5l9.4-37.6C283.9 13.3 297 5.5 309.8 8.7S330.5 25 327.3 37.8L316 82.8c13.5 7.8 26 17.1 37.2 27.8 12.9 12.1 13.4 32.4 1.3 45.2s-32.4 13.4-45.2 1.3c-3.1-2.9-6.4-5.8-9.8-8.4L239.2 390c26.9-4.6 51.1-17.1 70.1-35.1 12.9-12.1 33.1-11.5 45.2 1.3s11.5 33.1-1.3 45.2c-34.3 32.3-80 52.8-130.5 54.4l-7.5 29.9c-3.2 12.9-16.2 20.7-29.1 17.5s-20.7-16.2-17.5-29.1l5.6-22.5c-15-3.2-29.4-8-42.9-14.4l-12.1 48.5c-3.2 12.9-16.2 20.7-29.1 17.5S69.5 487 72.7 474.2l16-63.9C44.3 373.6 16 318.1 16 256 16 159.2 84.8 78.4 176.3 60l8.4-33.8C187.9 13.3 201 5.5 213.8 8.7zM158 132.9c-46.1 21.8-78 68.7-78 123.1 0 30.5 10 58.6 26.9 81.3L158 132.9zM147.4 373.4c13 7.6 27.3 13.1 42.5 16.1l65.9-263.6c-12.6-3.8-25.9-5.9-39.8-5.9-1.8 0-3.5 0-5.3 .1L147.4 373.4z\"]\n};\nvar faLaptopFile = {\n  prefix: 'fas',\n  iconName: 'laptop-file',\n  icon: [576, 512, [], \"e51d\", \"M64 64C64 28.7 92.7 0 128 0L416 0c35.3 0 64 28.7 64 64l0 48-64 0 0-48-288 0 0 192 112 0 0 96-163.2 0C34.4 352 0 317.6 0 275.2 0 264.6 8.6 256 19.2 256L64 256 64 64zM529.9 257.9c9 9 14.1 21.2 14.1 33.9L544 464c0 26.5-21.5 48-48 48l-160 0c-26.5 0-48-21.5-48-48l0-256c0-26.5 21.5-48 48-48l76.1 0c12.7 0 24.9 5.1 33.9 14.1 20 20 47.9 47.9 83.9 83.9zM416 272c0 8.8 7.2 16 16 16l60.1 0-76.1-76.1 0 60.1z\"]\n};\nvar faBahai = {\n  prefix: 'fas',\n  iconName: 'bahai',\n  icon: [576, 512, [\"haykal\"], \"f666\", \"M288.4-8c13.2 0 25 8.1 29.8 20.4l31.9 82 77.2-42.3c11.6-6.3 25.8-4.9 35.9 3.5s14 22.3 9.7 34.8l-28.2 83.3 86.3 17.2c12.9 2.6 23 12.8 25.3 25.8s-3.6 26.1-14.9 32.9l-75.2 45.7 55 68.6c8.3 10.3 9.3 24.6 2.7 36s-19.5 17.6-32.6 15.6l-87-13.3-2 88c-.3 13.2-8.6 24.8-21 29.4s-26.3 1-35-9l-58-66.1-58 66.1c-8.7 9.9-22.6 13.5-35 9s-20.8-16.2-21-29.4l-2-88-87 13.3c-13 2-26-4.2-32.6-15.6s-5.5-25.7 2.7-36l55-68.6-75.2-45.7c-11.3-6.8-17.2-19.9-14.9-32.9s12.3-23.2 25.3-25.8l86.3-17.2-28.2-83.3c-4.2-12.5-.4-26.3 9.7-34.8s24.4-9.9 35.9-3.5l77.1 42.3 31.9-82C263.3 .1 275.2-8 288.4-8zm0 120.2L273 151.6c-3.3 8.6-10.2 15.3-18.9 18.5s-18.2 2.4-26.3-2l-37-20.3 13.6 40c3 8.7 2 18.3-2.6 26.3s-12.4 13.6-21.5 15.4l-41.4 8.3 36.1 21.9c7.9 4.8 13.3 12.7 14.9 21.8s-.8 18.4-6.5 25.6l-26.4 33 41.8-6.4c9.1-1.4 18.4 1.2 25.4 7.1s11.2 14.6 11.4 23.8l.9 42.2 27.9-31.8c6.1-6.9 14.8-10.9 24.1-10.9s18 4 24.1 10.9l27.9 31.8 .9-42.2c.2-9.2 4.4-17.9 11.4-23.8s16.3-8.5 25.4-7.1l41.8 6.4-26.4-33c-5.8-7.2-8.2-16.5-6.6-25.6s7-17 14.9-21.8l36.1-21.9-41.4-8.3c-9-1.8-16.9-7.4-21.5-15.4s-5.5-17.6-2.6-26.3l13.6-40-37 20.3c-8.1 4.4-17.7 5.2-26.3 2s-15.5-9.9-18.9-18.5l-15.3-39.4z\"]\n};\nvar faHaykal = faBahai;\nvar faMoneyBill1 = {\n  prefix: 'fas',\n  iconName: 'money-bill-1',\n  icon: [512, 512, [\"money-bill-alt\"], \"f3d1\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm192 80a112 112 0 1 1 0 224 112 112 0 1 1 0-224zM64 184l0-48c0-4.4 3.6-8 8-8l48 0c4.4 0 8.1 3.6 7.5 8-3.6 29-26.6 51.9-55.5 55.5-4.4 .5-8-3.1-8-7.5zm0 144c0-4.4 3.6-8.1 8-7.5 29 3.6 51.9 26.6 55.5 55.5 .5 4.4-3.1 8-7.5 8l-48 0c-4.4 0-8-3.6-8-8l0-48zM440 191.5c-29-3.6-51.9-26.6-55.5-55.5-.5-4.4 3.1-8 7.5-8l48 0c4.4 0 8 3.6 8 8l0 48c0 4.4-3.6 8.1-8 7.5zM448 328l0 48c0 4.4-3.6 8-8 8l-48 0c-4.4 0-8.1-3.6-7.5-8 3.6-29 26.6-51.9 55.5-55.5 4.4-.5 8 3.1 8 7.5zM240 188c-11 0-20 9-20 20 0 9.7 6.9 17.7 16 19.6l0 48.4-4 0c-11 0-20 9-20 20s9 20 20 20l48 0c11 0 20-9 20-20s-9-20-20-20l-4 0 0-68c0-11-9-20-20-20l-16 0z\"]\n};\nvar faMoneyBillAlt = faMoneyBill1;\nvar faCloudBolt = {\n  prefix: 'fas',\n  iconName: 'cloud-bolt',\n  icon: [512, 512, [127785, \"thunderstorm\"], \"f76c\", \"M0 224c0 53 43 96 96 96l38.6 0 124.1-111c12.2-10.9 28-17 44.4-17 44.6 0 76.5 43 63.7 85.7L354.1 320 416 320c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0 1.1-5.2 1.6-10.5 1.6-16 0-44.2-35.8-80-80-80-24.3 0-46.1 10.9-60.8 28-18.7-35.7-56.1-60-99.2-60-61.9 0-112 50.1-112 112 0 7.1 .7 14.1 1.9 20.8-38.3 12.6-65.9 48.7-65.9 91.2zM160.6 400l61.8 0-31.2 104.1c-3.6 11.9 5.3 23.9 17.8 23.9 4.6 0 9-1.7 12.4-4.7L362.5 396.9c3.5-3.1 5.5-7.6 5.5-12.4 0-9.2-7.4-16.6-16.6-16.6l-61.8 0 31.2-104.1c3.6-11.9-5.3-23.9-17.8-23.9-4.6 0-9 1.7-12.4 4.7L149.5 371.1c-3.5 3.1-5.5 7.6-5.5 12.4 0 9.2 7.4 16.6 16.6 16.6z\"]\n};\nvar faThunderstorm = faCloudBolt;\nvar faEthernet = {\n  prefix: 'fas',\n  iconName: 'ethernet',\n  icon: [512, 512, [], \"f796\", \"M0 224L0 416c0 17.7 14.3 32 32 32l32 0 0-104c0-13.3 10.7-24 24-24s24 10.7 24 24l0 104 64 0 0-104c0-13.3 10.7-24 24-24s24 10.7 24 24l0 104 64 0 0-104c0-13.3 10.7-24 24-24s24 10.7 24 24l0 104 64 0 0-104c0-13.3 10.7-24 24-24s24 10.7 24 24l0 104 32 0c17.7 0 32-14.3 32-32l0-192c0-17.7-14.3-32-32-32l-32 0 0-32c0-17.7-14.3-32-32-32l-32 0 0-32c0-17.7-14.3-32-32-32L160 64c-17.7 0-32 14.3-32 32l0 32-32 0c-17.7 0-32 14.3-32 32l0 32-32 0c-17.7 0-32 14.3-32 32z\"]\n};\nvar faHryvniaSign = {\n  prefix: 'fas',\n  iconName: 'hryvnia-sign',\n  icon: [384, 512, [8372, \"hryvnia\"], \"f6f2\", \"M336 149.4C336 77 268.5 23.5 198 40.1L93.2 64.9C76 68.9 65.4 86.2 69.4 103.4s21.3 27.9 38.5 23.8l104.8-24.7c30.3-7.1 59.3 15.8 59.3 46.9 0 17.6-9.6 33.8-25 42.3l-.7 .4-222.3 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32.4 0c5.5-13.3 8.4-27.8 8.4-42.6zM360 272L24 272c-13.3 0-24 10.7-24 24s10.7 24 24 24l33.3 0c-6.1 13.4-9.3 28.1-9.3 43.3 0 64.1 56.9 113.4 120.4 104.2l137.9-19.9c17.5-2.5 29.6-18.7 27.1-36.2s-18.8-29.6-36.2-27.1L159.2 404.2c-24.9 3.6-47.2-15.7-47.2-40.9 0-15.1 8.2-28.9 21.4-36.2l13-7.1 213.6 0c13.3 0 24-10.7 24-24s-10.7-24-24-24z\"]\n};\nvar faHryvnia = faHryvniaSign;\nvar faEyeSlash = {\n  prefix: 'fas',\n  iconName: 'eye-slash',\n  icon: [576, 512, [], \"f070\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.4-96.4c2.7-2.4 5.4-4.8 8-7.2 46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6-56.8 0-105.6 18.2-146 44.2L41-24.9zM204.5 138.7c23.5-16.8 52.4-26.7 83.5-26.7 79.5 0 144 64.5 144 144 0 31.1-9.9 59.9-26.7 83.5l-34.7-34.7c12.7-21.4 17-47.7 10.1-73.7-13.7-51.2-66.4-81.6-117.6-67.9-8.6 2.3-16.7 5.7-24 10l-34.7-34.7zM325.3 395.1c-11.9 3.2-24.4 4.9-37.3 4.9-79.5 0-144-64.5-144-144 0-12.9 1.7-25.4 4.9-37.3L69.4 139.2c-32.6 36.8-55 75.8-66.9 104.5-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6 37.3 0 71.2-7.9 101.5-20.6l-64.2-64.2z\"]\n};\nvar faCartFlatbedSuitcase = {\n  prefix: 'fas',\n  iconName: 'cart-flatbed-suitcase',\n  icon: [576, 512, [\"luggage-cart\"], \"f59d\", \"M0 32C0 14.3 14.3 0 32 0L48 0c44.2 0 80 35.8 80 80l0 288c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-34.7 0c1.8 5 2.7 10.4 2.7 16 0 26.5-21.5 48-48 48s-48-21.5-48-48c0-5.6 1-11 2.7-16l-197.5 0c1.8 5 2.7 10.4 2.7 16 0 26.5-21.5 48-48 48s-48-21.5-48-48c0-6 1.1-11.7 3.1-17-38.1-6.2-67.1-39.2-67.1-79L64 80c0-8.8-7.2-16-16-16L32 64C14.3 64 0 49.7 0 32zM176 144c0-26.5 21.5-48 48-48l32 0 0-24c0-30.9 25.1-56 56-56l64 0c30.9 0 56 25.1 56 56l0 24 32 0c26.5 0 48 21.5 48 48l0 144c0 26.5-21.5 48-48 48l-240 0c-26.5 0-48-21.5-48-48l0-144zM384 96l0-24c0-4.4-3.6-8-8-8l-64 0c-4.4 0-8 3.6-8 8l0 24 80 0z\"]\n};\nvar faLuggageCart = faCartFlatbedSuitcase;\nvar faRadiation = {\n  prefix: 'fas',\n  iconName: 'radiation',\n  icon: [576, 512, [], \"f7b9\", \"M446.2 34.5c-14.2-10.1-33.5-4.6-42.2 10.5L331.6 170.3c31.3 15.8 52.8 48.3 52.8 85.7l144 0c17.7 0 32.2-14.4 30.1-31.9-9.1-78.1-51.4-146.1-112.3-189.6zM172.7 44.9C164 29.8 144.7 24.3 130.5 34.5 69.6 77.9 27.3 145.9 18.2 224.1 16.1 241.6 30.7 256 48.3 256l144 0c0-37.5 21.5-69.9 52.8-85.7L172.7 44.9zm-9.4 416.8c-8.7 15.1-3.8 34.5 12 41.8 34.4 15.7 72.7 24.5 113 24.5s78.6-8.8 113-24.5c15.8-7.2 20.7-26.7 12-41.8L341 336.3c-15.1 9.9-33.2 15.7-52.6 15.7s-37.5-5.8-52.6-15.7L163.3 461.7zM288.3 304a48 48 0 1 0 -.7-96 48 48 0 1 0 .7 96z\"]\n};\nvar faFileWord = {\n  prefix: 'fas',\n  iconName: 'file-word',\n  icon: [384, 512, [], \"f1c2\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM135.4 274.8c-2.9-12.9-15.7-21.1-28.6-18.2s-21.1 15.7-18.2 28.6l32 144c2.3 10.5 11.4 18.2 22.2 18.8s20.6-6.1 24-16.4l25.2-75.7 25.2 75.7c3.4 10.2 13.2 16.9 24 16.4s19.9-8.2 22.2-18.8l32-144c2.9-12.9-5.3-25.8-18.2-28.6s-25.8 5.3-28.6 18.2l-13.2 59.4-20.6-61.8c-3.3-9.8-12.4-16.4-22.8-16.4s-19.5 6.6-22.8 16.4l-20.6 61.8-13.2-59.4z\"]\n};\nvar faBedPulse = {\n  prefix: 'fas',\n  iconName: 'bed-pulse',\n  icon: [640, 512, [\"procedures\"], \"f487\", \"M531.2-22.4L572 32 616 32c13.3 0 24 10.7 24 24s-10.7 24-24 24l-56 0c-7.6 0-14.7-3.6-19.2-9.6l-24.1-32.1-47 99.9c-3.7 7.8-11.3 13.1-19.9 13.7s-16.9-3.4-21.7-10.6L387.2 80 344 80c-13.3 0-24-10.7-24-24s10.7-24 24-24l56 0c8 0 15.5 4 20 10.7l24.4 36.6 45.9-97.5c3.6-7.6 10.9-12.8 19.3-13.7s16.6 2.7 21.6 9.5zM320 160c0-17.7 14.3-32 32-32l9.5 0 26.6 39.9c14.4 21.6 39.3 33.8 65.2 31.9s48.8-17.6 59.8-41.1L527 129.2c45.9 7.2 81 46.9 81 94.8l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64-448 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32L32 64c0-17.7 14.3-32 32-32S96 46.3 96 64l0 224 224 0 0-128zM144 192a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z\"]\n};\nvar faProcedures = faBedPulse;\nvar faTents = {\n  prefix: 'fas',\n  iconName: 'tents',\n  icon: [576, 512, [], \"e582\", \"M539.9 352l-95.6 0-8.4-66.1c-2.9-23.2-15.9-43.9-35.4-56.8L252.2 131.5c-18-11.9-39.7-15.7-60.1-11.5 2.5-4.3 5.9-7.9 10.1-10.7L350.6 11.6c10.7-7 24.5-7 35.2 0l148.4 97.7c7.8 5.1 13 13.4 14.2 22.7l23.3 184c2.4 19.1-12.5 36-31.7 36zM4.8 476l23.3-184c1.2-9.3 6.3-17.6 14.2-22.7l148.4-97.7c10.7-7 24.5-7 35.2 0l148.4 97.7c7.8 5.1 13 13.4 14.2 22.7l23.3 184c2.4 19.1-12.5 36-31.7 36l-49.7 0c-11.2 0-21.5-5.8-27.3-15.4l-77-126.7c-1.7-2.8-4.8-4.6-8.1-4.6-5.3 0-9.5 4.3-9.5 9.5l0 105.2c0 17.7-14.3 32-32 32L36.5 512c-19.3 0-34.2-16.9-31.7-36z\"]\n};\nvar faMugHot = {\n  prefix: 'fas',\n  iconName: 'mug-hot',\n  icon: [576, 512, [9749], \"f7b6\", \"M152-16c-13.3 0-24 10.7-24 24 0 38.9 23.4 59.4 39.1 73.1l1.1 1c16.3 14.3 23.8 21.8 23.8 37.9 0 13.3 10.7 24 24 24s24-10.7 24-24c0-38.9-23.4-59.4-39.1-73.1l-1.1-1C183.5 31.7 176 24.1 176 8 176-5.3 165.3-16 152-16zM96 192c-17.7 0-32 14.3-32 32l0 192c0 53 43 96 96 96l192 0c41.8 0 77.4-26.7 90.5-64l5.5 0c70.7 0 128-57.3 128-128S518.7 192 448 192L96 192zM448 384l0-128c35.3 0 64 28.7 64 64s-28.7 64-64 64zM288 8c0-13.3-10.7-24-24-24S240-5.3 240 8c0 38.9 23.4 59.4 39.1 73.1l1.1 1c16.3 14.3 23.8 21.8 23.8 37.9 0 13.3 10.7 24 24 24s24-10.7 24-24c0-38.9-23.4-59.4-39.1-73.1l-1.1-1C295.5 31.7 288 24.1 288 8z\"]\n};\nvar faBolt = {\n  prefix: 'fas',\n  iconName: 'bolt',\n  icon: [448, 512, [9889, \"zap\"], \"f0e7\", \"M338.8-9.9c11.9 8.6 16.3 24.2 10.9 37.8L271.3 224 416 224c13.5 0 25.5 8.4 30.1 21.1s.7 26.9-9.6 35.5l-288 240c-11.3 9.4-27.4 9.9-39.3 1.3s-16.3-24.2-10.9-37.8L176.7 288 32 288c-13.5 0-25.5-8.4-30.1-21.1s-.7-26.9 9.6-35.5l288-240c11.3-9.4 27.4-9.9 39.3-1.3z\"]\n};\nvar faZap = faBolt;\nvar faJar = {\n  prefix: 'fas',\n  iconName: 'jar',\n  icon: [320, 512, [], \"e516\", \"M32-8c0-13.3 10.7-24 24-24l208 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L56 16C42.7 16 32 5.3 32-8zM0 128C0 92.7 28.7 64 64 64l192 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 128zm96 64c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32L96 192z\"]\n};\nvar faTruckPlane = {\n  prefix: 'fas',\n  iconName: 'truck-plane',\n  icon: [640, 512, [], \"e58f\", \"M144 48c0-26.5 21.5-48 48-48s48 21.5 48 48l0 320c0 32.5 12.1 62.1 32 84.7l0 27.3c0 7.1 .9 14.1 2.7 20.7L192 480 83.9 507C73.8 509.6 64 501.9 64 491.5l0-19.8c0-4.9 2.2-9.5 6-12.5l74-59.2 0-57.6-122.1 48.8C11.4 395.4 0 387.7 0 376.4l0-44c0-8 3-15.6 8.3-21.5L144 161.6 144 48zm224 80l192 0c44.2 0 80 35.8 80 80l0 160c0 26.2-12.6 49.4-32 64l0 48c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-160 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-48c-19.4-14.6-32-37.8-32-64l0-160c0-44.2 35.8-80 80-80zm0 176l192 0 0-32c0-17.7-14.3-32-32-32l-128 0c-17.7 0-32 14.3-32 32l0 32zm0 88a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm216-24a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faHandHoldingHeart = {\n  prefix: 'fas',\n  iconName: 'hand-holding-heart',\n  icon: [576, 512, [], \"f4be\", \"M279.6 31C265.5 11.5 242.9 0 218.9 0 177.5 0 144 33.5 144 74.9l0 2.4c0 64.4 82 133.4 122.2 163.3 13 9.7 30.5 9.7 43.5 0 40.2-30 122.2-98.9 122.2-163.3l0-2.4c0-41.4-33.5-74.9-74.9-74.9-24 0-46.6 11.5-60.7 31L288 42.7 279.6 31zM109.3 341.5L66.7 384 32 384c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l320.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416 280 416c-13.3 0-24-10.7-24-24s10.7-24 24-24l72 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-152.2 0c-33.9 0-66.5 13.5-90.5 37.5z\"]\n};\nvar faArrowRotateLeft = {\n  prefix: 'fas',\n  iconName: 'arrow-rotate-left',\n  icon: [512, 512, [8634, \"arrow-left-rotate\", \"arrow-rotate-back\", \"arrow-rotate-backward\", \"undo\"], \"f0e2\", \"M256 64c-56.8 0-107.9 24.7-143.1 64l47.1 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 192c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l0 54.7C110.9 33.6 179.5 0 256 0 397.4 0 512 114.6 512 256S397.4 512 256 512c-87 0-163.9-43.4-210.1-109.7-10.1-14.5-6.6-34.4 7.9-44.6s34.4-6.6 44.6 7.9c34.8 49.8 92.4 82.3 157.6 82.3 106 0 192-86 192-192S362 64 256 64z\"]\n};\nvar faArrowLeftRotate = faArrowRotateLeft;\nvar faArrowRotateBack = faArrowRotateLeft;\nvar faArrowRotateBackward = faArrowRotateLeft;\nvar faUndo = faArrowRotateLeft;\nvar faFaceAngry = {\n  prefix: 'fas',\n  iconName: 'face-angry',\n  icon: [512, 512, [128544, \"angry\"], \"f556\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM256 368c24.1 0 45.4 11.8 58.5 30 7.7 10.8 22.7 13.2 33.5 5.5s13.2-22.7 5.5-33.5c-21.7-30.2-57.3-50-97.5-50s-75.7 19.8-97.5 50c-7.7 10.8-5.3 25.8 5.5 33.5s25.8 5.3 33.5-5.5c13.1-18.2 34.4-30 58.5-30zm-80-96c17.7 0 32-14.3 32-32l0-.3 9.7 3.2c10.5 3.5 21.8-2.2 25.3-12.6s-2.2-21.8-12.6-25.3l-96-32c-10.5-3.5-21.8 2.2-25.3 12.6s2.2 21.8 12.6 25.3l28.9 9.6c-4.1 5.4-6.6 12.1-6.6 19.4 0 17.7 14.3 32 32 32zm192-32c0-7.3-2.4-14-6.6-19.4l28.9-9.6c10.5-3.5 16.1-14.8 12.6-25.3s-14.8-16.1-25.3-12.6l-96 32c-10.5 3.5-16.1 14.8-12.6 25.3s14.8 16.1 25.3 12.6l9.7-3.2 0 .3c0 17.7 14.3 32 32 32s32-14.3 32-32z\"]\n};\nvar faAngry = faFaceAngry;\nvar faBurst = {\n  prefix: 'fas',\n  iconName: 'burst',\n  icon: [512, 512, [], \"e4dc\", \"M37.6 4.2C28-2.3 15.2-1.1 7 7S-2.3 28 4.2 37.6l112 163.3-99.6 32.3C6.7 236.4 0 245.6 0 256s6.7 19.6 16.6 22.8l103.1 33.4-52.9 100.6c-4.9 9.3-3.2 20.7 4.3 28.1s18.8 9.2 28.1 4.3l100.6-52.9 33.4 103.1c3.2 9.9 12.4 16.6 22.8 16.6s19.6-6.7 22.8-16.6l33.4-103.1 100.6 52.9c9.3 4.9 20.7 3.2 28.1-4.3s9.2-18.8 4.3-28.1l-52.9-100.6 103.1-33.4c9.9-3.2 16.6-12.4 16.6-22.8s-6.7-19.6-16.6-22.8l-106.5-34.5 25.7-70.4c3.2-8.8 1-18.6-5.6-25.2s-16.4-8.8-25.2-5.6l-70.4 25.7-34.5-106.5C275.6 6.7 266.4 0 256 0s-19.6 6.7-22.8 16.6L200.9 116.2 37.6 4.2z\"]\n};\nvar faZ = {\n  prefix: 'fas',\n  iconName: 'z',\n  icon: [384, 512, [122], \"5a\", \"M0 64C0 46.3 14.3 32 32 32l320 0c12.4 0 23.7 7.2 29 18.4s3.6 24.5-4.4 34.1L100.3 416 352 416c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-12.4 0-23.7-7.2-29-18.4s-3.6-24.5 4.4-34.1L283.7 96 32 96C14.3 96 0 81.7 0 64z\"]\n};\nvar faBandage = {\n  prefix: 'fas',\n  iconName: 'bandage',\n  icon: [576, 512, [129657, \"band-aid\"], \"f462\", \"M464 416l48 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-48 0 0 320zM416 96l-256 0 0 320 256 0 0-320zM64 96C28.7 96 0 124.7 0 160L0 352c0 35.3 28.7 64 64 64l48 0 0-320-48 0zM216 208a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM216 304a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm120-24a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faBandAid = faBandage;\nvar faPlaneCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'plane-circle-exclamation',\n  icon: [640, 512, [], \"e556\", \"M232 24c0-30.9 25.1-56 56-56s56 25.1 56 56l0 127.3 78 71.5c-69.3 29-118 97.4-118 177.2 0 49.3 18.6 94.3 49.1 128.3L288 512 179.9 539c-10.1 2.5-19.9-5.1-19.9-15.5l0-19.8c0-4.9 2.2-9.5 6-12.5l66-52.8 0-99.7-162.9 54.3C58.7 396.4 48 388.7 48 377.8l0-43.7c0-9 3.8-17.5 10.4-23.6L232 151.3 232 24zM496 256a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 228a20 20 0 1 0 0-40 20 20 0 1 0 0 40zm0-180c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z\"]\n};\nvar faBusSide = {\n  prefix: 'fas',\n  iconName: 'bus-side',\n  icon: [640, 512, [], \"e81d\", \"M480 0c88.4 0 160 71.6 160 160l0 224c0 35.3-28.7 64-64 64l-5.6 0c-13.2 37.3-48.6 64-90.4 64s-77.3-26.7-90.4-64l-139.1 0c-13.2 37.3-48.7 64-90.4 64s-77.2-26.7-90.4-64L64 448c-35.3 0-64-28.7-64-64L0 96C0 43 43 0 96 0L480 0zM160 368a48 48 0 1 0 0 96 48 48 0 1 0 0-96zm320 0a48 48 0 1 0 0 96 48 48 0 1 0 0-96zm0-304c-17.7 0-32 14.3-32 32l0 192c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-128c0-53-43-96-96-96zM248 224l104 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-104 0 0 160zM96 64C78.3 64 64 78.3 64 96l0 96c0 17.7 14.3 32 32 32l104 0 0-160-104 0z\"]\n};\nvar faBugs = {\n  prefix: 'fas',\n  iconName: 'bugs',\n  icon: [576, 512, [], \"e4d0\", \"M447.5 174.6c8.8-8.4 22.7-8.9 32.2-.8s11 21.9 4.1 31.9l-1.5 1.9-23 26.7c26.7 13.5 46.3 39.1 51.4 69.6l25.3 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-24 0 0 32 24 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-25.3 0c-7.6 45.4-47.1 80-94.7 80s-87-34.6-94.7-80L296 432c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-32-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l25.3 0c5.1-30.5 24.7-56.1 51.4-69.6l-22.9-26.7c-8.6-10.1-7.5-25.2 2.6-33.8s25.2-7.5 33.8 2.6l29.8 34.8 29.8-34.8 1.7-1.8zm-256-192c8.8-8.4 22.7-8.9 32.2-.8s11 21.9 4.1 31.9l-1.5 1.9-23 26.7C230 55.9 249.5 81.5 254.7 112l25.3 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-24 0 0 32 24 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-25.3 0c-7.6 45.4-47.1 80-94.7 80s-87-34.6-94.7-80L40 240c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-32-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l25.3 0C70.5 81.5 90 55.9 116.7 42.4L93.8 15.6C85.2 5.6 86.3-9.6 96.4-18.2s25.2-7.5 33.8 2.6l29.8 34.8 29.8-34.8 1.7-1.8z\"]\n};\nvar faBeerMugEmpty = {\n  prefix: 'fas',\n  iconName: 'beer-mug-empty',\n  icon: [576, 512, [\"beer\"], \"f0fc\", \"M64 80c0-26.5 21.5-48 48-48l288 0c26.5 0 48 21.5 48 48l0 16 64 0c35.3 0 64 28.7 64 64l0 108.2c0 24.2-13.7 46.4-35.4 57.2L448 371.8 448 384c0 53-43 96-96 96l-192 0c-53 0-96-43-96-96L64 80zM448 300.2l64-32 0-108.2-64 0 0 140.2zM192 152c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 208c0 13.3 10.7 24 24 24s24-10.7 24-24l0-208zm88 0c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 208c0 13.3 10.7 24 24 24s24-10.7 24-24l0-208zm88 0c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 208c0 13.3 10.7 24 24 24s24-10.7 24-24l0-208z\"]\n};\nvar faBeer = faBeerMugEmpty;\nvar faPersonCircleCheck = {\n  prefix: 'fas',\n  iconName: 'person-circle-check',\n  icon: [640, 512, [], \"e53e\", \"M280 24a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zm24 212.7L341 286.6c12.8-17.5 28.5-32.7 46.3-45l-56.2-75.7C306 132 266.3 112 224 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6L144 236.7 144 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-275.3zM640 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-86.6-60.9c7.1 5.2 8.7 15.2 3.5 22.3l-64 88c-2.8 3.8-7 6.2-11.7 6.5s-9.3-1.3-12.6-4.6l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l26.8 26.8 53-72.9c5.2-7.1 15.2-8.7 22.4-3.5z\"]\n};\nvar faStapler = {\n  prefix: 'fas',\n  iconName: 'stapler',\n  icon: [640, 512, [], \"e5af\", \"M640 299.3L640 432c0 26.5-21.5 48-48 48L64 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0 0-48-352 0c-17.7 0-32-14.3-32-32l0-116.6-30.2-5.4c-19.6-3.5-33.8-20.5-33.8-40.4 0-8.9 2.9-17.5 8.2-24.6l35.6-47.5c32.8-43.8 84.4-69.6 139.1-69.6 27 0 53.6 6.3 77.8 18.4L586.9 213.5C619.5 229.7 640 263 640 299.3zM448 304l0-16-320-57.1 0 73.1 320 0z\"]\n};\nvar faHouseMedicalCircleCheck = {\n  prefix: 'fas',\n  iconName: 'house-medical-circle-check',\n  icon: [640, 512, [], \"e511\", \"M309.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S50.8 272 64 272l16 0 0 176c0 35.3 28.7 64 64 64l196 0c-21.2-29.5-34.3-65.3-35.9-104L272 408c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 20 0c34.9-48.5 91.7-80 156-80 10.7 0 21.1 .9 31.3 2.5L309.8 8.6zM640 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-86.6-60.9c7.1 5.2 8.7 15.2 3.5 22.3l-64 88c-2.8 3.8-7 6.2-11.7 6.5s-9.3-1.3-12.6-4.6l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l26.8 26.8 53-72.9c5.2-7.1 15.2-8.7 22.4-3.5z\"]\n};\nvar faNairaSign = {\n  prefix: 'fas',\n  iconName: 'naira-sign',\n  icon: [448, 512, [], \"e1f6\", \"M122.6 46.3c-7.8-11.7-22.4-17-35.9-12.9S64 49.9 64 64l0 192-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 89.5 0 107.8 161.8c7.8 11.7 22.4 17 35.9 12.9S384 462.1 384 448l0-144 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0 0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 192-57.5 0-139.8-209.7zM294.5 304l25.5 0 0 38.3-25.5-38.3zM185.5 256l-57.5 0 0-86.3 57.5 86.3z\"]\n};\nvar faWifi = {\n  prefix: 'fas',\n  iconName: 'wifi',\n  icon: [576, 512, [\"wifi-3\", \"wifi-strong\"], \"f1eb\", \"M288 96c-90.9 0-173.2 36-233.7 94.6-12.7 12.3-33 12-45.2-.7s-12-33 .7-45.2C81.7 74.9 179.9 32 288 32S494.3 74.9 566.3 144.7c12.7 12.3 13 32.6 .7 45.2s-32.6 13-45.2 .7C461.2 132 378.9 96 288 96zM240 432a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM168 326.2c-11.7 13.3-31.9 14.5-45.2 2.8s-14.5-31.9-2.8-45.2C161 237.4 221.1 208 288 208s127 29.4 168 75.8c11.7 13.3 10.4 33.5-2.8 45.2s-33.5 10.4-45.2-2.8C378.6 292.9 335.8 272 288 272s-90.6 20.9-120 54.2z\"]\n};\nvar faWifi3 = faWifi;\nvar faWifiStrong = faWifi;\nvar faMoneyCheckDollar = {\n  prefix: 'fas',\n  iconName: 'money-check-dollar',\n  icon: [512, 512, [\"money-check-alt\"], \"f53d\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zM296 288l128 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-128 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm-24-88c0-13.3 10.7-24 24-24l128 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-128 0c-13.3 0-24-10.7-24-24zM148 144c11 0 20 9 20 20l0 4 8 0c11 0 20 9 20 20s-9 20-20 20l-47.5 0c-6.9 0-12.5 5.6-12.5 12.5 0 6.1 4.4 11.3 10.4 12.3l41.7 7c25.3 4.2 43.9 26.1 43.9 51.8 0 26.1-19 47.7-44 51.8l0 4.7c0 11-9 20-20 20s-20-9-20-20l0-4-24 0c-11 0-20-9-20-20s9-20 20-20l55.5 0c6.9 0 12.5-5.6 12.5-12.5 0-6.1-4.4-11.3-10.4-12.3l-41.7-7C94.5 268 76 246.1 76 220.5 76 191.7 99.2 168.3 128 168l0-4c0-11 9-20 20-20z\"]\n};\nvar faMoneyCheckAlt = faMoneyCheckDollar;\nvar faEyeLowVision = {\n  prefix: 'fas',\n  iconName: 'eye-low-vision',\n  icon: [576, 512, [\"low-vision\"], \"f2a8\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.4-96.4c2.7-2.4 5.4-4.8 8-7.2 46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6-56.8 0-105.6 18.2-146 44.2L41-24.9zM204.5 138.7c23.5-16.8 52.4-26.7 83.5-26.7 79.5 0 144 64.5 144 144 0 31.1-9.9 59.9-26.7 83.5l-34.7-34.7c12.7-21.4 17-47.7 10.1-73.7-13.7-51.2-66.4-81.6-117.6-67.9-8.6 2.3-16.7 5.7-24 10l-34.7-34.7zM88 157.9c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L328.2 466c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L88 157.9zM45.7 251.3c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L181.9 455.5c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L45.7 251.3z\"]\n};\nvar faLowVision = faEyeLowVision;\nvar faCircleArrowUp = {\n  prefix: 'fas',\n  iconName: 'circle-arrow-up',\n  icon: [512, 512, [\"arrow-circle-up\"], \"f0aa\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm17-377l80 80c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-39-39 0 150.1c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-150.1-39 39c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l80-80c9.4-9.4 24.6-9.4 33.9 0z\"]\n};\nvar faArrowCircleUp = faCircleArrowUp;\nvar faCameraRetro = {\n  prefix: 'fas',\n  iconName: 'camera-retro',\n  icon: [512, 512, [128247], \"f083\", \"M0 416l0-208 136.2 0c13.5-20.2 32-36.8 53.7-48L0 160 0 125.7c0-35.3 28.7-64 64-64l.1 0C65.3 45.1 79.1 32 96 32l32 0c16.9 0 30.7 13.1 31.9 29.7l32.1 0 51.2-23.8c8.4-3.9 17.6-6 26.9-6L448 32c35.3 0 64 28.7 64 64l0 64-190 0c21.7 11.2 40.2 27.8 53.7 48l136.2 0 0 208c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64zM256 192a96.1 96.1 0 1 0 0 192.1 96.1 96.1 0 1 0 0-192.1z\"]\n};\nvar faCapsules = {\n  prefix: 'fas',\n  iconName: 'capsules',\n  icon: [576, 512, [], \"f46b\", \"M96 112c0-26.5 21.5-48 48-48s48 21.5 48 48l0 112-96 0 0-112zm-64 0l0 288c0 61.9 50.1 112 112 112s112-50.1 112-112l0-105.8 116.3 169.5c35.5 51.7 105.3 64.3 156 28.1s63-107.5 27.5-159.2L427.3 145.3c-35.5-51.7-105.3-64.3-156-28.1-5.6 4-10.7 8.4-15.3 13.1l0-18.3C256 50.1 205.9 0 144 0S32 50.1 32 112zM296.6 240.2c-16-23.3-10-55.3 11.9-71 21.2-15.1 50.5-10.3 66 12.2l67 97.6-79.9 55.9-65-94.8z\"]\n};\nvar faPoo = {\n  prefix: 'fas',\n  iconName: 'poo',\n  icon: [512, 512, [128169], \"f2fe\", \"M268.9 .9c-5.5-.7-11 1.4-14.5 5.7s-4.6 10.1-2.8 15.4c2.8 8.2 4.3 16.9 4.3 26.1 0 44.1-35.7 79.9-79.8 80L160 128c-35.3 0-64 28.7-64 64 0 19.1 8.4 36.3 21.7 48L104 240c-39.8 0-72 32.2-72 72 0 23.2 11 43.8 28 57-34.1 5.7-60 35.3-60 71 0 39.8 32.2 72 72 72l368 0c39.8 0 72-32.2 72-72 0-35.7-25.9-65.3-60-71 17-13.2 28-33.8 28-57 0-39.8-32.2-72-72-72l-13.7 0c13.3-11.7 21.7-28.9 21.7-48 0-35.3-28.7-64-64-64l-5.5 0c3.5-10 5.5-20.8 5.5-32 0-48.6-36.2-88.8-83.1-95.1zM192 256a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm64 108.3c0 2.4-.7 4.8-2.2 6.7-8.2 10.5-39.5 45-93.8 45s-85.6-34.6-93.8-45c-1.5-1.9-2.2-4.3-2.2-6.7 0-6.8 5.5-12.3 12.3-12.3l167.4 0c6.8 0 12.3 5.5 12.3 12.3z\"]\n};\nvar faVolume = {\n  prefix: 'fas',\n  iconName: 'volume',\n  icon: [512, 512, [128265, \"volume-medium\"], \"f6a8\", \"M48 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L96 160 48 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48zM441.1 107c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C443.3 170.7 464 210.9 464 256s-20.7 85.3-53.2 111.8c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5c43.2-35.2 70.9-88.9 70.9-149s-27.7-113.8-70.9-149zm-60.5 74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C361.1 227.6 368 241 368 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C402.1 312.9 416 286.1 416 256s-13.9-56.9-35.5-74.5z\"]\n};\nvar faVolumeMedium = faVolume;\nvar faElevator = {\n  prefix: 'fas',\n  iconName: 'elevator',\n  icon: [512, 512, [], \"e16d\", \"M292.7-4.7l64 64c6.2 6.2 16.4 6.2 22.6 0l64-64c4.6-4.6 5.9-11.5 3.5-17.4S438.5-32 432-32L304-32c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4zm-160-22.6l-64 64c-4.6 4.6-5.9 11.5-3.5 17.4S73.5 64 80 64l128 0c6.5 0 12.3-3.9 14.8-9.9s1.1-12.9-3.5-17.4l-64-64c-6.2-6.2-16.4-6.2-22.6 0zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 128zm96 96a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM80 400c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 16c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-16zm192 0c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 16c0 17.7-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32l0-16zm32-128a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z\"]\n};\nvar faTag = {\n  prefix: 'fas',\n  iconName: 'tag',\n  icon: [512, 512, [127991], \"f02b\", \"M32.5 96l0 149.5c0 17 6.7 33.3 18.7 45.3l192 192c25 25 65.5 25 90.5 0L483.2 333.3c25-25 25-65.5 0-90.5l-192-192C279.2 38.7 263 32 246 32L96.5 32c-35.3 0-64 28.7-64 64zm112 16a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faFileCircleMinus = {\n  prefix: 'fas',\n  iconName: 'file-circle-minus',\n  icon: [576, 512, [], \"e4ed\", \"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l180 0c-22.7-31.5-36-70.2-36-112 0-100.6 77.4-183.2 176-191.3l0-38.1c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM576 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-64 0c0 8.8-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l128 0c8.8 0 16 7.2 16 16z\"]\n};\nvar faDownLong = {\n  prefix: 'fas',\n  iconName: 'down-long',\n  icon: [320, 512, [\"long-arrow-alt-down\"], \"f309\", \"M137.4 534.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9S300.9 352 288 352l-64 0 0-336c0-26.5-21.5-48-48-48l-32 0c-26.5 0-48 21.5-48 48l0 336-64 0c-12.9 0-24.6 7.8-29.6 19.8S.2 397.5 9.4 406.6l128 128z\"]\n};\nvar faLongArrowAltDown = faDownLong;\nvar faCompactDisc = {\n  prefix: 'fas',\n  iconName: 'compact-disc',\n  icon: [512, 512, [128191, 128192, 128440], \"f51f\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm256 32a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm-96-32a96 96 0 1 0 192 0 96 96 0 1 0 -192 0zm-56-16c0-32.4 16.3-66.6 42.8-93.2S207.6 104 240 104c13.3 0 24-10.7 24-24s-10.7-24-24-24c-47.9 0-93.7 23.5-127.1 56.9S56 192.1 56 240c0 13.3 10.7 24 24 24s24-10.7 24-24z\"]\n};\nvar faSuitcaseRolling = {\n  prefix: 'fas',\n  iconName: 'suitcase-rolling',\n  icon: [384, 512, [], \"f5c1\", \"M144 24c0-4.4 3.6-8 8-8l80 0c4.4 0 8 3.6 8 8l0 72-96 0 0-72zM320 96l-32 0 0-72c0-30.9-25.1-56-56-56l-80 0C121.1-32 96-6.9 96 24l0 72-32 0C28.7 96 0 124.7 0 160L0 448c0 35.3 28.7 64 64 64 0 17.7 14.3 32 32 32s32-14.3 32-32l128 0c0 17.7 14.3 32 32 32s32-14.3 32-32c35.3 0 64-28.7 64-64l0-288c0-35.3-28.7-64-64-64zM120 208l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm0 128l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faBookQuran = {\n  prefix: 'fas',\n  iconName: 'book-quran',\n  icon: [448, 512, [\"quran\"], \"f687\", \"M64 512l288 0c53 0 96-43 96-96l0-320c0-53-43-96-96-96L48 0C21.5 0 0 21.5 0 48L0 336c0 20.9 13.4 38.7 32 45.3L32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0zM352 384c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0 0-64 256 0zM273.1 144.4c2.5-6.1 11.2-6.1 13.7 0l10.3 24.8 26.8 2.1c6.6 .5 9.2 8.7 4.2 13L307.8 201.9 314 228c1.5 6.4-5.5 11.5-11.1 8.1l-22.9-14-22.9 14c-5.6 3.4-12.6-1.6-11.1-8.1l6.2-26.1-20.4-17.5c-5-4.3-2.3-12.5 4.2-13l26.8-2.1 10.3-24.8zM100 192c0-68.5 55.5-124 124-124 23.8 0 46.1 6.7 65 18.4 4.8 2.9 6.9 8.8 5 14.1s-7.1 8.6-12.7 8c-3.1-.3-6.2-.5-9.4-.5-46.4 0-84 37.6-84 84s37.6 84 84 84c3.2 0 6.3-.2 9.4-.5 5.6-.6 10.8 2.7 12.7 8s-.3 11.2-5 14.1c-18.9 11.7-41.2 18.4-65 18.4-68.5 0-124-55.5-124-124z\"]\n};\nvar faQuran = faBookQuran;\nvar faPhoneSlash = {\n  prefix: 'fas',\n  iconName: 'phone-slash',\n  icon: [576, 512, [], \"f3dd\", \"M535-24.9c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L41 537.1c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L141.5 368.6C89.2 310.5 51.6 238.8 34.8 159.4 18.7 83.1 73.9 20.6 138.5 2.9l5.5-1.5c19.7-5.4 40.3 4.7 48.1 23.5l40.5 97.3c6.9 16.5 2.1 35.6-11.8 47l-44.1 36.1c12.9 28.5 29.6 54.8 49.5 78.5L535-24.9zm-150.4 534c-63-13.4-121.3-39.8-171.7-76.3L297.8 348c12.2 8.2 25 15.6 38.3 22.2L374.7 323c11.3-13.9 30.4-18.6 47-11.8L519 351.8c18.8 7.8 28.9 28.4 23.5 48.1l-1.5 5.5c-17.6 64.6-80.2 119.8-156.4 103.7z\"]\n};\nvar faRoadCircleCheck = {\n  prefix: 'fas',\n  iconName: 'road-circle-check',\n  icon: [640, 512, [], \"e564\", \"M288 32l-76.3 0c-29.4 0-55.1 20.1-62.1 48.6L65.4 420.5C57.9 450.7 80.8 480 112 480l209.4 0c-11.2-24.4-17.4-51.4-17.4-80 0-28.6 6.2-55.7 17.4-80-.5 0-1 0-1.5 0-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 49c35.2-39.9 86.7-65 144-65 9 0 17.8 .6 26.5 1.8l-32-129.2C483.4 52.1 457.8 32 428.3 32l-76.4 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zM640 400a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-86.6-60.9c7.1 5.2 8.7 15.2 3.5 22.3l-64 88c-2.8 3.8-7 6.2-11.7 6.5s-9.3-1.3-12.6-4.6l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l26.8 26.8 53-72.9c5.2-7.1 15.2-8.7 22.4-3.5z\"]\n};\nvar faShopLock = {\n  prefix: 'fas',\n  iconName: 'shop-lock',\n  icon: [640, 512, [], \"e4a5\", \"M21.5 181.1L78.3 67.4C89.2 45.7 111.3 32 135.6 32l304.9 0c24.2 0 46.4 13.7 57.2 35.4l55.6 111.1c-8.2-1.6-16.6-2.5-25.2-2.5-53.7 0-99.7 33.1-118.7 80l-57.3 0 0 176c0 26.5-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48l0-176.1c-26.8-1.9-48-24.3-48-51.6 0-8 1.9-16 5.5-23.2zM128 256l0 112c0 8.8 7.2 16 16 16l128 0c8.8 0 16-7.2 16-16l0-112-160 0zm432 48.1c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0 0-47.9zM416 400c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96z\"]\n};\nvar faImagePortrait = {\n  prefix: 'fas',\n  iconName: 'image-portrait',\n  icon: [384, 512, [\"portrait\"], \"f3e0\", \"M0 64C0 28.7 28.7 0 64 0L320 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM80 368c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16 0-44.2-35.8-80-80-80l-64 0c-44.2 0-80 35.8-80 80zM192 248a56 56 0 1 0 0-112 56 56 0 1 0 0 112z\"]\n};\nvar faPortrait = faImagePortrait;\nvar faBridgeLock = {\n  prefix: 'fas',\n  iconName: 'bridge-lock',\n  icon: [576, 512, [], \"e4cc\", \"M0 64C0 46.3 14.3 32 32 32l448 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0 0 32.2c13.8 .6 27.2 2.8 40 6.4l0 50.7c-14.8-6-31-9.3-48-9.3-70.7 0-128 57.3-128 128l0 24.4c-.4 .3-.7 .6-1.1 1-17.3-25-46.2-41.3-78.9-41.3-53 0-96 43-96 96l0 64c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-94c0-38.8-26.4-72.6-64-82l0-112 40 0 0-64-8 0C14.3 96 0 81.7 0 64zm424 68.6l0-36.6-80 0 0 64 18.8 0c18.2-12.8 38.9-22.2 61.2-27.4zM216 96l0 64 80 0 0-64-80 0zm-48 0l-80 0 0 64 80 0 0-64zM496 304.1c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0 0-47.9zM352 400c0-20.9 13.4-38.7 32-45.3l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96z\"]\n};\nvar faHammer = {\n  prefix: 'fas',\n  iconName: 'hammer',\n  icon: [640, 512, [128296], \"f6e3\", \"M246.9 18.3L271 3.8c21.6-13 46.3-19.8 71.5-19.8 36.8 0 72.2 14.6 98.2 40.7l63.9 63.9c15 15 23.4 35.4 23.4 56.6l0 30.9 19.7 19.7 0 0c15.6-15.6 40.9-15.6 56.6 0s15.6 40.9 0 56.6l-64 64c-15.6 15.6-40.9 15.6-56.6 0s-15.6-40.9 0-56.6L464 240 433.1 240c-21.2 0-41.6-8.4-56.6-23.4l-49.1-49.1c-15-15-23.4-35.4-23.4-56.6l0-12.7c0-11.2-5.9-21.7-15.5-27.4l-41.6-25c-10.4-6.2-10.4-21.2 0-27.4zM50.7 402.7l222.1-222.1 90.5 90.5-222.1 222.1c-25 25-65.5 25-90.5 0s-25-65.5 0-90.5z\"]\n};\nvar faArrowUp19 = {\n  prefix: 'fas',\n  iconName: 'arrow-up-1-9',\n  icon: [512, 512, [\"sort-numeric-up\"], \"f163\", \"M150.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L96 141.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-96-96zM418.7 38c-8.3-6-19.1-7.7-28.8-4.4l-48 16c-16.8 5.6-25.8 23.7-20.2 40.5s23.7 25.8 40.5 20.2l5.9-2 0 51.6-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-16 0 0-96c0-10.3-4.9-19.9-13.3-26zM365.1 430.6c-9.6 14.8-5.4 34.6 9.4 44.3s34.6 5.4 44.3-9.4l42.1-64.9c12.4-19.2 19.1-41.6 19.1-64.5 0-44.2-35.8-80-80-80s-80 35.8-80 80c0 36.1 23.9 66.7 56.8 76.6l-11.7 18zM376 336a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faSortNumericUp = faArrowUp19;\nvar faChessKnight = {\n  prefix: 'fas',\n  iconName: 'chess-knight',\n  icon: [384, 512, [9822], \"f441\", \"M192-32c106 0 192 86 192 192l0 133.5c0 17-6.8 33.2-18.7 45.2L320 384 370.8 434.7c8.5 8.5 13.2 20 13.2 32 0 25-20.3 45.2-45.2 45.3L45.3 512c-25 0-45.2-20.3-45.2-45.3 0-12 4.8-23.5 13.2-32L64 384 64 349.4c0-18.7 8.2-36.4 22.3-48.6l89.7-76.8-48 0-12.1 12.1c-12.7 12.7-30 19.9-48 19.9-37.5 0-67.9-30.4-67.9-67.9l0-8.7c0-22.8 8.2-44.9 23.1-62.3L96 32 96 0c0-17.7 14.3-32 32-32l64 0zM160 72a24 24 0 1 0 0 48 24 24 0 1 0 0-48z\"]\n};\nvar faHouseFloodWaterCircleArrowRight = {\n  prefix: 'fas',\n  iconName: 'house-flood-water-circle-arrow-right',\n  icon: [640, 512, [], \"e50f\", \"M288.5 112a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zM141.2 44.7c6.2-6.2 16.4-6.2 22.6 0l56 56c6.2 6.2 6.2 16.4 0 22.6l-56 56c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l28.7-28.7-89.4 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l89.4 0-28.7-28.7c-6.2-6.2-6.2-16.4 0-22.6zM336.5 112c0 71.1-38.6 133.1-96 166.3l0 12.8c22.1 4.5 43.4 13.9 62.4 28.2 22.1 16.6 29.1 16.6 51.2 0 27.5-20.7 59.9-31.2 92.4-31.4 33.1-.2 66.3 10.2 94.4 31.4 6.9 5.2 12.8 9 18 11.7 .6 .3 1.2 .6 1.8 1 4.2 2.3 8.5 4.6 12.6 1.5 6-4.5 12.6-8 19.3-10.4l0-115.2 4.5 0c15.2 0 27.5-12.3 27.5-27.5 0-7.9-3.4-15.5-9.4-20.7L444.5 10.5C436.8 3.7 426.8 0 416.5 0s-20.3 3.7-28 10.5L329.9 61.8c4.3 16 6.6 32.8 6.6 50.2zm32 88c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-48zM475.1 412.1c19 14.4 41.9 28.2 67.2 33.3 26.5 5.4 54.3 .8 80.7-19.1 10.6-8 12.7-23 4.7-33.6s-23-12.7-33.6-4.7c-14.9 11.2-28.6 13.1-42.3 10.3-14.9-3-30.9-11.9-47.8-24.6-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3S290 391.8 266 373.7c-38.4-29-90.5-29-129 0-21.6 16.3-41.3 25.8-58.9 25.7-9.6-.1-19.9-3-31.2-11.5-10.6-8-25.6-5.9-33.6 4.7s-5.9 25.6 4.7 33.6c19.1 14.4 39.4 21 59.8 21.1 33.9 .2 64.3-17.4 88.1-35.3 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9c21.3-16.1 49.9-16.1 71.2 0zm-71.2 96c21.3-16.1 49.9-16.1 71.2 0 19 14.4 41.9 28.2 67.2 33.3 26.5 5.4 54.3 .8 80.7-19.1 10.6-8 12.7-23 4.7-33.6s-23-12.7-33.6-4.7c-14.9 11.2-28.6 13.1-42.3 10.3-14.9-3-30.9-11.9-47.8-24.6-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3S290 487.8 266 469.7c-38.4-29-90.5-29-129 0-21.6 16.3-41.3 25.8-58.9 25.7-9.6-.1-19.9-3-31.2-11.5-10.6-8-25.6-5.9-33.6 4.7s-5.9 25.6 4.7 33.6c19.1 14.4 39.4 21 59.8 21.1 33.9 .2 64.3-17.4 88.1-35.3 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9z\"]\n};\nvar faArrowUpRightFromSquare = {\n  prefix: 'fas',\n  iconName: 'arrow-up-right-from-square',\n  icon: [512, 512, [\"external-link\"], \"f08e\", \"M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0-201.4 201.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 96C35.8 96 0 131.8 0 176L0 432c0 44.2 35.8 80 80 80l256 0c44.2 0 80-35.8 80-80l0-80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 80c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 96z\"]\n};\nvar faExternalLink = faArrowUpRightFromSquare;\nvar faArrowDownUpAcrossLine = {\n  prefix: 'fas',\n  iconName: 'arrow-down-up-across-line',\n  icon: [512, 512, [], \"e4af\", \"M265.4 105.4l96-96c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-41.4-41.4 0 114.7 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-320 0 0 114.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-96 96c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 402.7 96 288 32 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l320 0 0-114.7-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3zM416 336l0 144c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-144 64 0zM96 176L96 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 144-64 0z\"]\n};\nvar faFaceGrinBeam = {\n  prefix: 'fas',\n  iconName: 'face-grin-beam',\n  icon: [512, 512, [128516, \"grin-beam\"], \"f582\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM386.7 308.9c11.9-3.7 23.9 6.3 19.6 18.1-22.4 61.3-81.3 105.1-150.3 105.1S128.1 388.2 105.7 326.9c-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1zM176 180c-15.5 0-28 12.5-28 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28zm132 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28s-28 12.5-28 28z\"]\n};\nvar faGrinBeam = faFaceGrinBeam;\nvar faRectangleAd = {\n  prefix: 'fas',\n  iconName: 'rectangle-ad',\n  icon: [512, 512, [\"ad\"], \"f641\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zM416 184l0 144c0 13.3-10.7 24-24 24-7.1 0-13.5-3.1-17.9-8-10.2 5.1-21.8 8-34.1 8-42 0-76-34-76-76s34-76 76-76c9.9 0 19.3 1.9 28 5.3l0-21.3c0-13.3 10.7-24 24-24s24 10.7 24 24zm-48 92a28 28 0 1 0 -56 0 28 28 0 1 0 56 0zM160 208c-8.8 0-16 7.2-16 16l0 32 48 0 0-32c0-8.8-7.2-16-16-16l-16 0zm32 96l-48 0 0 24c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-104c0-35.3 28.7-64 64-64l16 0c35.3 0 64 28.7 64 64l0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-24z\"]\n};\nvar faAd = faRectangleAd;\nvar faBookTanakh = {\n  prefix: 'fas',\n  iconName: 'book-tanakh',\n  icon: [448, 512, [\"tanakh\"], \"f827\", \"M352 512L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l0-66.7C13.4 374.7 0 356.9 0 336L0 48C0 21.5 21.5 0 48 0L352 0c53 0 96 43 96 96l0 320c0 53-43 96-96 96zm32-96c0-17.7-14.3-32-32-32l-256 0 0 64 256 0c17.7 0 32-14.3 32-32zM113.9 229c-1.2 2-1.9 4.2-1.9 6.6 0 6.9 5.6 12.5 12.5 12.5l56.9 0 30.5 49.2c2.6 4.2 7.2 6.8 12.2 6.8s9.6-2.6 12.2-6.8l30.5-49.2 56.9 0c6.9 0 12.5-5.6 12.5-12.5 0-2.3-.6-4.6-1.9-6.6l-27.8-45 27.8-45c1.2-2 1.9-4.2 1.9-6.6 0-6.9-5.6-12.5-12.5-12.5l-56.9 0-30.5-49.2C233.6 66.6 229 64 224 64s-9.6 2.6-12.2 6.8l-30.5 49.2-56.9 0c-6.9 0-12.5 5.6-12.5 12.5 0 2.3 .6 4.6 1.9 6.6l27.8 45-27.8 45z\"]\n};\nvar faTanakh = faBookTanakh;\nvar faHotTubPerson = {\n  prefix: 'fas',\n  iconName: 'hot-tub-person',\n  icon: [448, 512, [\"hot-tub\"], \"f593\", \"M240 40c0 13.6 5.8 26.5 15.8 35.6l26.5 23.8c24 21.6 37.7 52.3 37.7 84.6 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-18.7-7.9-36.4-21.8-48.9l-26.5-23.8C203.5 93.1 192 67.2 192 40 192 26.7 202.7 16 216 16s24 10.7 24 24zM0 336l0-80c0-35.3 28.7-64 64-64l19.7 0c8.1 0 16.2 1.6 23.8 4.6l137.1 54.8c7.6 3 15.6 4.6 23.8 4.6L384 256c35.3 0 64 28.7 64 64l0 128c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 336zm96-16c-13.3 0-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80c0-13.3-10.7-24-24-24zm152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80zm104-24c-13.3 0-24 10.7-24 24l0 80c0 13.3 10.7 24 24 24s24-10.7 24-24l0-80c0-13.3-10.7-24-24-24zM328 16c13.3 0 24 10.7 24 24 0 13.6 5.8 26.5 15.8 35.6l26.5 23.8c24 21.6 37.7 52.3 37.7 84.6 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-18.7-7.9-36.4-21.8-48.9l-26.5-23.8C315.5 93.1 304 67.2 304 40 304 26.7 314.7 16 328 16zM64 40a56 56 0 1 1 0 112 56 56 0 1 1 0-112z\"]\n};\nvar faHotTub = faHotTubPerson;\nvar faFileHalfDashed = {\n  prefix: 'fas',\n  iconName: 'file-half-dashed',\n  icon: [384, 512, [], \"e698\", \"M64 0C28.7 0 0 28.7 0 64l0 256 384 0 0-149.5c0-17-6.7-33.3-18.7-45.3L258.7 18.7C246.7 6.7 230.5 0 213.5 0L64 0zM325.5 176L232 176c-13.3 0-24-10.7-24-24L208 58.5 325.5 176zM0 352l0 64 64 0 0-64-64 0zM64 512l0-64-64 0c0 35.3 28.7 64 64 64zm32 0l80 0 0-64-80 0 0 64zm112 0l80 0 0-64-80 0 0 64zm112 0c35.3 0 64-28.7 64-64l-64 0 0 64zm64-160l-64 0 0 64 64 0 0-64z\"]\n};\nvar faOutdent = {\n  prefix: 'fas',\n  iconName: 'outdent',\n  icon: [448, 512, [\"dedent\"], \"f03b\", \"M.4 64c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-384 0C14.8 96 .4 81.7 .4 64zm192 128c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM.4 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-384 0c-17.7 0-32-14.3-32-32zM.7 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6l0 158.6c0 13.3-15.3 20.8-25.8 12.6L.7 268.6z\"]\n};\nvar faDedent = faOutdent;\nvar faHandPeace = {\n  prefix: 'fas',\n  iconName: 'hand-peace',\n  icon: [448, 512, [9996], \"f25b\", \"M192 0c17.7 0 32 14.3 32 32l0 208-64 0 0-208c0-17.7 14.3-32 32-32zm96 160c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32zm64 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zM61.3 51.2L143.9 240 74.1 240 2.7 76.8C-4.4 60.6 3 41.8 19.2 34.7S54.2 35 61.3 51.2zm27 221.3l-.2-.5 95.9 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-56 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l56 0c39.8 0 72-32.2 72-72l0-.6c9.4 5.4 20.3 8.6 32 8.6 13.2 0 25.4-4 35.6-10.8 8.7 24.9 32.5 42.8 60.4 42.8 11.7 0 22.6-3.1 32-8.6l0 8.6c0 88.4-71.6 160-160 160l-61.7 0c-42.4 0-83.1-16.9-113.1-46.9L69.5 453.5C45.5 429.5 32 396.9 32 363l0-27c0-32.7 24.6-59.7 56.3-63.5z\"]\n};\nvar faHeadSideVirus = {\n  prefix: 'fas',\n  iconName: 'head-side-virus',\n  icon: [512, 512, [], \"e064\", \"M329.7 448c-5.1 0-9.7 3.7-9.7 8.8l0 7.2c0 26.5-21.5 48-48 48l-160 0c-26.5 0-48-21.5-48-48l0-63.6c0-12.6-5.1-24.5-13.1-34.2-31.8-38.7-50.9-88.2-50.9-142.2 0-123.7 100.3-224 224-224 112.7 0 206 83.3 221.7 191.7 .4 3 1.7 5.9 3.6 8.3l35.8 42.9c7 8.4 10.9 19.1 10.9 30.1 0 25.9-21 47-47 47l-1 0c-8.8 0-16 7.2-16 16l0 48c0 35.3-28.7 64-64 64l-38.3 0zM224 64c-13.3 0-24 10.7-24 24 0 22.9-27.7 34.4-43.9 18.2-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9c16.2 16.2 4.7 43.9-18.2 43.9-13.3 0-24 10.7-24 24s10.7 24 24 24c22.9 0 34.4 27.7 18.2 43.9-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0c16.2-16.2 43.9-4.7 43.9 18.2 0 13.3 10.7 24 24 24s24-10.7 24-24c0-22.9 27.7-34.4 43.9-18.2 9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9c-16.2-16.2-4.7-43.9 18.2-43.9 13.3 0 24-10.7 24-24s-10.7-24-24-24c-22.9 0-34.4-27.7-18.2-43.9 9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0c-16.2 16.2-43.9 4.7-43.9-18.2 0-13.3-10.7-24-24-24zm-32 88a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 88a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faCompass = {\n  prefix: 'fas',\n  iconName: 'compass',\n  icon: [512, 512, [129517], \"f14e\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm50.7-186.9L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\"]\n};\nvar faPenNib = {\n  prefix: 'fas',\n  iconName: 'pen-nib',\n  icon: [512, 512, [10001], \"f5ad\", \"M368.5 18.3l-50.1 50.1 125.3 125.3 50.1-50.1c21.9-21.9 21.9-57.3 0-79.2L447.7 18.3c-21.9-21.9-57.3-21.9-79.2 0zM279.3 97.2l-.5 .1-144.1 43.2c-19.9 6-35.7 21.2-42.3 41L3.8 445.8c-2.9 8.7-1.9 18.2 2.5 26L161.7 316.4c-1.1-4-1.6-8.1-1.6-12.4 0-26.5 21.5-48 48-48s48 21.5 48 48-21.5 48-48 48c-4.3 0-8.5-.6-12.4-1.6L40.3 505.7c7.8 4.4 17.2 5.4 26 2.5l264.3-88.6c19.7-6.6 35-22.4 41-42.3l43.2-144.1 .1-.5-135.5-135.5z\"]\n};\nvar faTentArrowsDown = {\n  prefix: 'fas',\n  iconName: 'tent-arrows-down',\n  icon: [512, 512, [], \"e581\", \"M185.5 121c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-31 31 0-102.1c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 102.1-31-31c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c9.4 9.4 24.6 9.4 33.9 0l72-72zm248 72l72-72c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-31 31 0-102.1c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 102.1-31-31c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c9.4 9.4 24.6 9.4 33.9 0zM60.3 292.6L37.1 476c-2.4 19.1 12.5 36 31.7 36l154.5 0c17.7 0 32-14.3 32-32l0-117.4c0-5.9 4.7-10.6 10.6-10.6 4 0 7.7 2.3 9.5 5.9l68.2 136.5c5.4 10.8 16.5 17.7 28.6 17.7l71.9 0c19.3 0 34.2-16.9 31.7-36L452.7 292.7c-1.2-9.7-6.9-18.4-15.3-23.4L271.9 169.9c-10.2-6.1-22.9-6.1-33.1 .1L75.4 269.3c-8.3 5.1-13.9 13.7-15.1 23.3z\"]\n};\nvar faForwardFast = {\n  prefix: 'fas',\n  iconName: 'forward-fast',\n  icon: [512, 512, [9197, \"fast-forward\"], \"f050\", \"M19.8 477.6c12 5 25.7 2.2 34.9-6.9L224 301.3 224 448c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9L448 301.3 448 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 146.7-169.4-169.4c-9.2-9.2-22.9-11.9-34.9-6.9S224 51.1 224 64L224 210.7 54.6 41.4c-9.2-9.2-22.9-11.9-34.9-6.9S0 51.1 0 64L0 448c0 12.9 7.8 24.6 19.8 29.6z\"]\n};\nvar faFastForward = faForwardFast;\nvar faCrop = {\n  prefix: 'fas',\n  iconName: 'crop',\n  icon: [512, 512, [], \"f125\", \"M448 109.3l54.6-54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L402.7 64 176 64 176 128 338.7 128 128 338.7 128 32c0-17.7-14.3-32-32-32S64 14.3 64 32l0 32-32 0C14.3 64 0 78.3 0 96s14.3 32 32 32l32 0 0 256c0 35.3 28.7 64 64 64l208 0 0-64-162.7 0 210.7-210.7 0 306.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-274.7z\"]\n};\nvar faWhiskeyGlass = {\n  prefix: 'fas',\n  iconName: 'whiskey-glass',\n  icon: [448, 512, [129347, \"glass-whiskey\"], \"f7a0\", \"M32 32C14.3 32 0 46.3 0 64L0 352c0 70.7 57.3 128 128 128l192 0c70.7 0 128-57.3 128-128l0-288c0-17.7-14.3-32-32-32L32 32zM64 256l0-160 320 0 0 160-320 0z\"]\n};\nvar faGlassWhiskey = faWhiskeyGlass;\nvar faSquare = {\n  prefix: 'fas',\n  iconName: 'square',\n  icon: [448, 512, [9632, 9723, 9724, 61590], \"f0c8\", \"M64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32z\"]\n};\nvar faFaceGrin = {\n  prefix: 'fas',\n  iconName: 'face-grin',\n  icon: [512, 512, [128512, \"grin\"], \"f580\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM386.7 308.9c11.9-3.7 23.9 6.3 19.6 18.1-22.4 61.3-81.3 105.1-150.3 105.1S128.1 388.2 105.7 326.9c-4.3-11.8 7.7-21.8 19.6-18.1 39.2 12.2 83.7 19.1 130.7 19.1s91.5-6.9 130.7-19.1zM144 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faGrin = faFaceGrin;\nvar faFileContract = {\n  prefix: 'fas',\n  iconName: 'file-contract',\n  icon: [384, 512, [], \"f56c\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM88 64C74.7 64 64 74.7 64 88s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L88 64zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0zm70.3 160c-11.3 0-21.9 5.1-28.9 13.9L69.3 409c-8.3 10.3-6.6 25.5 3.7 33.7s25.5 6.6 33.7-3.8l47.1-58.8 15.2 50.7c3 10.2 12.4 17.1 23 17.1l104 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-86.1 0-16.1-53.6c-4.7-15.7-19.1-26.4-35.5-26.4z\"]\n};\nvar faAngleUp = {\n  prefix: 'fas',\n  iconName: 'angle-up',\n  icon: [384, 512, [8963], \"f106\", \"M169.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L192 205.3 54.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z\"]\n};\nvar faFaceSmile = {\n  prefix: 'fas',\n  iconName: 'face-smile',\n  icon: [512, 512, [128578, \"smile\"], \"f118\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM165.4 321.9c20.4 28 53.4 46.1 90.6 46.1s70.2-18.1 90.6-46.1c7.8-10.7 22.8-13.1 33.5-5.3s13.1 22.8 5.3 33.5C356.3 390 309.2 416 256 416s-100.3-26-129.4-65.9c-7.8-10.7-5.4-25.7 5.3-33.5s25.7-5.4 33.5 5.3zM144 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faSmile = faFaceSmile;\nvar faPersonDressBurst = {\n  prefix: 'fas',\n  iconName: 'person-dress-burst',\n  icon: [640, 512, [], \"e544\", \"M208 40.1c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24zM8 144.1c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zm92.5 141.4l33.9-33.9c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L66.6 251.6c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0zM66.6 2.7c-9.4 9.4-9.4 24.6 0 33.9l33.9 33.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L100.5 2.7C91.1-6.7 76-6.7 66.6 2.7zM352 80a56 56 0 1 0 0-112 56 56 0 1 0 0 112zM246.2 384l25.8 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 32 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 25.8 0c10.9 0 18.6-10.7 15.2-21.1l-43-129 48.3 65.1c10.5 14.2 30.6 17.2 44.8 6.6s17.2-30.6 6.6-44.8l-70.5-95C434 132 394.3 112 352 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6l48.3-65.1-43 129c-3.5 10.4 4.3 21.1 15.2 21.1z\"]\n};\nvar faDivide = {\n  prefix: 'fas',\n  iconName: 'divide',\n  icon: [448, 512, [10135, 247], \"f529\", \"M224 48a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM168 408a56 56 0 1 1 112 0 56 56 0 1 1 -112 0z\"]\n};\nvar faCodeFork = {\n  prefix: 'fas',\n  iconName: 'code-fork',\n  icon: [448, 512, [], \"e13b\", \"M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3l0 22.7c0 26.5 21.5 48 48 48l128 0c26.5 0 48-21.5 48-48l0-22.7c-28.3-12.3-48-40.5-48-73.3 0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 22.7c0 61.9-50.1 112-112 112l-32 0 0 70.7c28.3 12.3 48 40.5 48 73.3 0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3l0-70.7-32 0C98.1 288 48 237.9 48 176l0-22.7C19.7 141 0 112.8 0 80 0 35.8 35.8 0 80 0s80 35.8 80 80zm208 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM248 432a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faHouseFlag = {\n  prefix: 'fas',\n  iconName: 'house-flag',\n  icon: [640, 512, [], \"e50d\", \"M472 0c17.7 0 32 14.3 32 32l96 0c17.7 0 32 14.3 32 32l0 96c0 17.7-14.3 32-32 32l-96 0 0 288c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-448c0-17.7 14.3-32 32-32zM283.5 59.1l100.5 96.9 0 356-256 0c-35.3 0-64-28.7-64-64l0-144-19.9 0c-15.5 0-28.1-12.6-28.1-28.1 0-7.6 3.1-14.9 8.6-20.2L228.5 59.1C235.9 52 245.7 48 256 48s20.1 4 27.5 11.1zM232 256c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0z\"]\n};\nvar faBuildingColumns = {\n  prefix: 'fas',\n  iconName: 'building-columns',\n  icon: [512, 512, [\"bank\", \"institution\", \"museum\", \"university\"], \"f19c\", \"M271.9 20.2c-9.8-5.6-21.9-5.6-31.8 0l-224 128c-12.6 7.2-18.8 22-15.1 36S17.5 208 32 208l32 0 0 208 0 0-51.2 38.4C4.7 460.4 0 469.9 0 480 0 497.7 14.3 512 32 512l448 0c17.7 0 32-14.3 32-32 0-10.1-4.7-19.6-12.8-25.6l-51.2-38.4 0-208 32 0c14.5 0 27.2-9.8 30.9-23.8s-2.5-28.8-15.1-36l-224-128zM400 208l0 208-64 0 0-208 64 0zm-112 0l0 208-64 0 0-208 64 0zm-112 0l0 208-64 0 0-208 64 0zM256 96a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faBank = faBuildingColumns;\nvar faInstitution = faBuildingColumns;\nvar faMuseum = faBuildingColumns;\nvar faUniversity = faBuildingColumns;\nvar faRug = {\n  prefix: 'fas',\n  iconName: 'rug',\n  icon: [576, 512, [], \"e569\", \"M24 64l56 0 0 384-56 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-40-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-32-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-32-8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-40-8 0C10.7 112 0 101.3 0 88S10.7 64 24 64zm104 0l320 0 0 384-320 0 0-384zM576 88c0 13.3-10.7 24-24 24l-8 0 0 40 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 32 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 32 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 40 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-56 0 0-384 56 0c13.3 0 24 10.7 24 24z\"]\n};\nvar faCodeMerge = {\n  prefix: 'fas',\n  iconName: 'code-merge',\n  icon: [448, 512, [], \"f387\", \"M80 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm32.4 97.2c28-12.4 47.6-40.5 47.6-73.2 0-44.2-35.8-80-80-80S0 35.8 0 80c0 32.8 19.7 61 48 73.3l0 205.3C19.7 371 0 399.2 0 432 0 476.2 35.8 512 80 512s80-35.8 80-80c0-32.8-19.7-61-48-73.3l0-86.6c26.7 20.1 60 32 96 32l86.7 0c12.3 28.3 40.5 48 73.3 48 44.2 0 80-35.8 80-80s-35.8-80-80-80c-32.8 0-61 19.7-73.3 48L208 240c-49.9 0-91-38.1-95.6-86.8zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48zM344 272a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faHouseTsunami = {\n  prefix: 'fas',\n  iconName: 'house-tsunami',\n  icon: [640, 512, [], \"e515\", \"M288 16C155.5 16 48 123.5 48 256S155.5 496 288 496c7.4 0 19.7-2.3 33.7-7.3 13.8-4.9 27.1-11.7 36.7-18.9 38.4-29 90.5-29 129 0 15.4 11.6 35.3 21.1 55 24.4 19.5 3.3 37 .4 51.1-10.2 10.6-8 25.6-5.9 33.6 4.7s5.9 25.6-4.7 33.6c-27.3 20.5-59.2 24-87.9 19.2-28.5-4.8-55.4-18-75.9-33.4-21.3-16.1-49.9-16.1-71.2 0-14.5 10.9-32.4 19.7-49.5 25.8-16.8 6-34.9 10.1-49.9 10.1l-.1 0C128.9 543.9 0 415 0 256 0 96.9 128.9-32 288-32 301.3-32 312-21.3 312-8s-10.7 24-24 24zm44.8 166.4l96-72c11.4-8.5 27.1-8.5 38.5 0l95.5 72c8 6 12.7 15.5 12.7 25.5l.3 121.5c-2.2 1.3-4.3 2.6-6.4 4.2-4.3 3.1-8.7 .8-13.2-1.5l-1.2-.6-.7-.3c-5.4-2.7-11.7-6.6-18.9-11.7-29.5-21.1-64.3-31.6-99.1-31.4-34.1 .2-68.1 10.7-97 31.4-7.8 5.6-13.8 9.3-19.3 11.2L320 208c0-10.1 4.7-19.6 12.8-25.6zm54.6 229.7c-14.5 10.9-32.4 19.7-49.5 25.8-16.8 6-34.9 10.1-49.9 10.1-106 0-192-86-192-192S182 64 288 64c13.3 0 24 10.7 24 24s-10.7 24-24 24c-79.5 0-144 64.5-144 144s64.5 144 144 144c7.4 0 19.7-2.3 33.7-7.3 13.8-4.9 27.1-11.7 36.7-18.9 38.4-29 90.5-29 129 0 15.4 11.6 35.3 21.1 55 24.4 19.5 3.3 37 .4 51.1-10.2 10.6-8 25.6-5.9 33.6 4.7s5.9 25.6-4.7 33.6c-27.3 20.5-59.2 24-87.9 19.2-28.5-4.8-55.4-18-75.9-33.4-21.3-16.1-49.9-16.1-71.2 0z\"]\n};\nvar faMagnifyingGlassChart = {\n  prefix: 'fas',\n  iconName: 'magnifying-glass-chart',\n  icon: [512, 512, [], \"e522\", \"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zm-312 8l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80-96l0 160c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80 64l0 96c0 13.3 10.7 24 24 24s24-10.7 24-24l0-96c0-13.3-10.7-24-24-24s-24 10.7-24 24z\"]\n};\nvar faUmbrella = {\n  prefix: 'fas',\n  iconName: 'umbrella',\n  icon: [512, 512, [], \"f0e9\", \"M256-32c17.7 0 32 14.3 32 32l0 2c126.3 15.7 224 123.5 224 254 0 3.8-.1 7.5-.2 11.3-.3 6.9-5 12.8-11.7 14.7s-13.8-.7-17.6-6.5c-14.4-21.4-38.8-35.5-66.5-35.5-29.3 0-54.9 15.7-68.9 39.3-2.7 4.6-7.6 7.6-13 7.8s-10.5-2.2-13.7-6.5c-14.6-19.8-38-32.6-64.5-32.6s-49.9 12.8-64.5 32.6c-3.2 4.3-8.3 6.8-13.7 6.5s-10.2-3.2-13-7.8c-14-23.6-39.6-39.3-68.9-39.3-27.7 0-52.1 14.1-66.5 35.5-3.9 5.7-11 8.4-17.6 6.5S.5 274.2 .2 267.3C.1 263.5 0 259.8 0 256 0 125.5 97.7 17.7 224 2l0-2c0-17.7 14.3-32 32-32zm32 360l0 102.6c0 45-36.5 81.4-81.4 81.4-30.8 0-59-17.4-72.8-45l-2.3-4.7c-7.9-15.8-1.5-35 14.3-42.9s35-1.5 42.9 14.3l2.3 4.7c3 5.9 9 9.6 15.6 9.6 9.6 0 17.4-7.8 17.4-17.4L224 328c0-17.7 14.3-32 32-32s32 14.3 32 32z\"]\n};\nvar faHillRockslide = {\n  prefix: 'fas',\n  iconName: 'hill-rockslide',\n  icon: [576, 512, [], \"e508\", \"M252.4 103.8l27 48c2.8 5 8.2 8.2 13.9 8.2l53.3 0c5.8 0 11.1-3.1 13.9-8.2l27-48c2.7-4.9 2.7-10.8 0-15.7l-27-48c-2.8-5-8.2-8.2-13.9-8.2l-53.3 0c-5.8 0-11.1 3.1-13.9 8.2l-27 48c-2.7 4.9-2.7 10.8 0 15.7zM68.3 87C43.1 61.8 0 79.7 0 115.3L0 432c0 44.2 35.8 80 80 80l316.7 0c35.6 0 53.5-43.1 28.3-68.3L68.3 87zM504.2 403.6c4.9 2.7 10.8 2.7 15.7 0l48-27c5-2.8 8.2-8.2 8.2-13.9l0-53.3c0-5.8-3.1-11.1-8.2-13.9l-48-27c-4.9-2.7-10.8-2.7-15.7 0l-48 27c-5 2.8-8.2 8.2-8.2 13.9l0 53.3c0 5.8 3.1 11.1 8.2 13.9l48 27zM192 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM384 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faUserSecret = {\n  prefix: 'fas',\n  iconName: 'user-secret',\n  icon: [448, 512, [128373], \"f21b\", \"M171-16c-36.4 0-57.8 58.3-68.3 112L72 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 32c0 17 3.3 33.2 9.3 48l-9.3 0 0 0-20.5 0c-15.2 0-27.5 12.3-27.5 27.5 0 3 .5 5.9 1.4 8.7l28.9 86.6C40.2 379.6 16 428.1 16 482.3 16 498.7 29.3 512 45.7 512l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-54.2-24.2-102.7-62.3-135.4l28.9-86.6c.9-2.8 1.4-5.7 1.4-8.7 0-15.2-12.3-27.5-27.5-27.5l-20.5 0 0 0-9.3 0c6-14.8 9.3-31 9.3-48l0-32 24 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-30.7 0c-10.4-53.7-31.9-112-68.3-112-9.6 0-19 3.9-27.5 8.2-8.2 4.1-18.4 7.8-25.5 7.8s-17.3-3.7-25.5-7.8C190-12.1 180.6-16 171-16zm93.7 484.4l-24.8-70.9 27.9-32.5c2.7-3.2 4.2-7.2 4.2-11.4 0-9.7-7.8-17.5-17.5-17.5l-61 0c-9.7 0-17.5 7.8-17.5 17.5 0 4.2 1.5 8.2 4.2 11.4l27.9 32.5-24.8 70.9-57-180.4 35.7 0c18.4 10.2 39.5 16 62 16s43.6-5.8 62-16l35.7 0-57 180.4zM224 256c-34.7 0-64.2-22.1-75.3-53 5.7 3.2 12.3 5 19.3 5l12.4 0c16.5 0 31.1-10.6 36.3-26.2 2.3-7 12.2-7 14.5 0 5.2 15.6 19.9 26.2 36.3 26.2l12.4 0c7 0 13.6-1.8 19.3-5-11.1 30.9-40.6 53-75.3 53z\"]\n};\nvar faPager = {\n  prefix: 'fas',\n  iconName: 'pager',\n  icon: [512, 512, [128223], \"f815\", \"M0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zm64 32l0 64c0 17.7 14.3 32 32 32l320 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32L96 128c-17.7 0-32 14.3-32 32zM88 320c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0zm128 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0z\"]\n};\nvar faBriefcase = {\n  prefix: 'fas',\n  iconName: 'briefcase',\n  icon: [512, 512, [128188], \"f0b1\", \"M200 48l112 0c4.4 0 8 3.6 8 8l0 40-128 0 0-40c0-4.4 3.6-8 8-8zm-56 8l0 40-80 0C28.7 96 0 124.7 0 160l0 96 512 0 0-96c0-35.3-28.7-64-64-64l-80 0 0-40c0-30.9-25.1-56-56-56L200 0c-30.9 0-56 25.1-56 56zM512 304l-192 0 0 16c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-16-192 0 0 112c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-112z\"]\n};\nvar faTrowelBricks = {\n  prefix: 'fas',\n  iconName: 'trowel-bricks',\n  icon: [512, 512, [], \"e58a\", \"M224 32c0-11.5-6.2-22.2-16.2-27.8s-22.3-5.5-32.2 .4l-160 96C5.9 106.3 0 116.8 0 128s5.9 21.7 15.5 27.4l160 96c9.9 5.9 22.2 6.1 32.2 .4S224 235.5 224 224l0-64 256 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-256 0 0-64zm96 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-160 0zM0 416l0 64c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-96 0c-17.7 0-32 14.3-32 32zm224-32c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-256 0z\"]\n};\nvar faSocks = {\n  prefix: 'fas',\n  iconName: 'socks',\n  icon: [512, 512, [129510], \"f696\", \"M252.8 0L176 0c-26.5 0-48 21.5-48 48l0 16 112 0 0-16c0-17.5 4.7-33.9 12.8-48zM128 112l0 128c0 20.1-9.5 39.1-25.6 51.2l-64 48c-24.2 18.1-38.4 46.6-38.4 76.8 0 53 43 96 96 96 15.4 0 30.5-3.7 44-10.7-17.6-23.9-28-53.4-28-85.3 0-45.3 21.3-88 57.6-115.2l64-48c4-3 6.4-7.8 6.4-12.8l0-128-112 0zm160 0l0 128c0 20.1-9.5 39.1-25.6 51.2l-64 48c-24.2 18.1-38.4 46.6-38.4 76.8 0 53 43 96 96 96 20.8 0 41-6.7 57.6-19.2l115.2-86.4C461 382.2 480 344.3 480 304l0-192-192 0zM480 64l0-16c0-26.5-21.5-48-48-48L336 0c-26.5 0-48 21.5-48 48l0 16 192 0z\"]\n};\nvar faT = {\n  prefix: 'fas',\n  iconName: 't',\n  icon: [384, 512, [116], \"54\", \"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l128 0 0 352c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32z\"]\n};\nvar faMicrochip = {\n  prefix: 'fas',\n  iconName: 'microchip',\n  icon: [512, 512, [], \"f2db\", \"M176 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c-35.3 0-64 28.7-64 64l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 56-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 56-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c0 35.3 28.7 64 64 64l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40 56 0 0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40 56 0 0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c35.3 0 64-28.7 64-64l40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0 0-56 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0 0-56 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0c0-35.3-28.7-64-64-64l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40-56 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40-56 0 0-40zM160 128l192 0c17.7 0 32 14.3 32 32l0 192c0 17.7-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32l0-192c0-17.7 14.3-32 32-32zm16 48l0 160 160 0 0-160-160 0z\"]\n};\nvar faTruckMedical = {\n  prefix: 'fas',\n  iconName: 'truck-medical',\n  icon: [576, 512, [128657, \"ambulance\"], \"f0f9\", \"M64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64l3.3 0c10.4 36.9 44.4 64 84.7 64s74.2-27.1 84.7-64l102.6 0c10.4 36.9 44.4 64 84.7 64s74.2-27.1 84.7-64l3.3 0c35.3 0 64-28.7 64-64l0-146.7c0-17-6.7-33.3-18.7-45.3L512 146.7c-12-12-28.3-18.7-45.3-18.7l-50.7 0 0-32c0-35.3-28.7-64-64-64L64 32zM512 237.3l0 50.7-96 0 0-96 50.7 0 45.3 45.3zM152 384a40 40 0 1 1 0 80 40 40 0 1 1 0-80zm232 40a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM176 136c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 40 40 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-40 0 0 40c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-40-40 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16l40 0 0-40z\"]\n};\nvar faAmbulance = faTruckMedical;\nvar faOm = {\n  prefix: 'fas',\n  iconName: 'om',\n  icon: [576, 512, [128329], \"f679\", \"M388.7 4.7c6.2-6.2 16.4-6.2 22.6 0l16 16c6.2 6.2 6.2 16.4 0 22.6l-16 16c-6.2 6.2-16.4 6.2-22.6 0l-16-16c-6.2-6.2-6.2-16.4 0-22.6l16-16zM176 160c-10.8 0-20.8 3.6-28.8 9.6-14.1 10.6-34.2 7.8-44.8-6.4s-7.8-34.2 6.4-44.8c18.7-14.1 42-22.4 67.2-22.4 61.9 0 112 50.1 112 112 0 17.2-3.9 33.5-10.8 48l49.7 0c12.7 0 24.9-5 33.9-14.1l20.7-20.7c18.7-18.7 44.1-29.3 70.6-29.3 55.2 0 99.9 44.7 99.9 99.9l0 96.1c0 55.2-44.8 100-100 100S352 443.2 352 388l0-4c0-17.7 14.3-32 32-32s32 14.3 32 32l0 4c0 19.9 16.1 36 36 36s36-16.1 36-36l0-96.1c0-19.8-16.1-35.9-35.9-35.9-9.5 0-18.6 3.8-25.4 10.5l-20.7 20.7c-21 21-49.4 32.8-79.1 32.8l-26.8 0c12.6 19.6 19.9 42.8 19.9 68 0 75.2-65 132-140 132S40 463.2 40 388c0-17.7 14.3-32 32-32s32 14.3 32 32c0 35.3 31.7 68 76 68s76-32.7 76-68-31.7-68-76-68l-20 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0c26.5 0 48-21.5 48-48s-21.5-48-48-48zM337.1 60.1c-11-13.8-31.1-16.2-45-5.2s-16.2 31.1-5.2 45C312.6 132.2 354.4 152 400 152s87.4-19.8 113.1-52.1c11-13.8 8.7-34-5.2-45s-34-8.7-45 5.2C450.3 76 427.5 88 400 88s-50.3-12-62.9-27.9z\"]\n};\nvar faMosquitoNet = {\n  prefix: 'fas',\n  iconName: 'mosquito-net',\n  icon: [640, 512, [], \"e52c\", \"M576 352c13.3 0 24 10.7 24 24l0 16 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 48 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 16-.1 2.5C598.6 566.6 588.4 576 576 576s-22.6-9.4-23.9-21.5l-.1-2.5 0-16-48 0 0 16-.1 2.5C502.6 566.6 492.4 576 480 576s-22.6-9.4-23.9-21.5l-.1-2.5 0-16-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-48-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-16c0-13.3 10.7-24 24-24s24 10.7 24 24l0 16 48 0 0-16c0-13.3 10.7-24 24-24zM429.9 16.3c7.7-9.4 21.3-11.5 31.4-4.3 10.1 7.1 13.1 20.9 7.4 31.7l-1.3 2.1-25.9 38.9 13.3 53.4c2 8-.1 16.3-5.3 22.3l-2.4 2.4-44.7 38.3 130.5 14.5c42.8 4.8 75.1 40.9 75.1 83.9 0 3.9-.4 7.7-.9 11.5-7.3-3.5-15.3-5.8-23.8-6.7L576 304c-18.5 0-35.3 7-48 18.4-11-9.9-25.1-16.5-40.6-18.1L480 304c-30.3 0-56.1 18.7-66.8 45.2-12.5 5-23.2 13.4-31.1 24l-30.2-40.1 0 74.7c0 17.7-14.3 32-32 32-16.6 0-30.2-12.6-31.8-28.7l-.2-3.3 0-74.6-32.3 43 0 39.8c0 3.5-.7 6.9-2.1 10.1l-1.6 3.1-40 64-1.4 2c-7.5 9.6-21 12.1-31.3 5.3-10.3-6.8-13.7-20.5-8.3-31.5l1.2-2.2 36.2-58 0-41 .3-4c.6-3.9 2.2-7.7 4.6-10.9l39.3-52.2-66.2 59.5c-17 15.3-39 23.7-61.9 23.8l-8.1 0c-46.6 0-84.4-37.8-84.4-84.4 0-43 32.4-79.2 75.1-83.9l130.5-14.5-44.7-38.3-2.4-2.4c-5.2-6-7.3-14.4-5.3-22.3l13.3-53.4-25.9-38.9-1.2-2.1c-5.7-10.8-2.7-24.6 7.4-31.7 10.1-7.1 23.7-5.1 31.4 4.3l1.5 2 32 48 1.4 2.2c2.8 5.3 3.5 11.6 2.1 17.6l-12.3 49.2 53.3 45.7 0-28.8 .2-3.2c1.1-10.4 7.2-19.4 15.8-24.4l0-60.5 .3-3.2c1.5-7.3 8-12.7 15.7-12.8 7.7 0 14.2 5.5 15.7 12.8l.3 3.2 0 60.5c8.7 5 14.8 14 15.8 24.4l.2 3.2 0 28.9 53.4-45.7-12.3-49.2c-1.5-5.9-.7-12.2 2.1-17.6l1.4-2.2 32-48 1.5-2zM504 488l48 0 0-48-48 0 0 48z\"]\n};\nvar faPrescriptionBottle = {\n  prefix: 'fas',\n  iconName: 'prescription-bottle',\n  icon: [384, 512, [], \"f485\", \"M0 32C0 14.3 14.3 0 32 0L352 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64L0 32zM32 144l320 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0 0-48 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0 0-48 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0 0-64z\"]\n};\nvar faUsersGear = {\n  prefix: 'fas',\n  iconName: 'users-gear',\n  icon: [640, 512, [\"users-cog\"], \"f509\", \"M320 224a104 104 0 1 0 0-208 104 104 0 1 0 0 208zM96 232a72 72 0 1 0 0-144 72 72 0 1 0 0 144zM0 416l0 32c0 17.7 14.3 32 32 32l86.7 0c-4.3-9.8-6.7-20.6-6.7-32l0-16c0-53.2 20-101.8 52.9-138.6-11.7-3.5-24.1-5.4-36.9-5.4-70.7 0-128 57.3-128 128zM616 160a72 72 0 1 0 -144 0 72 72 0 1 0 144 0zM160 432l0 16c0 17.7 14.3 32 32 32l156.8 0c-7.1-21.6-6.3-44.4 10.7-64-14-16.2-20.5-39.7-11.4-63.3 6.6-17.1 15.9-33.1 27.4-47.3 5.4-6.6 11.6-11.7 18.3-15.4-22.1-11.5-47.2-18-73.8-18-88.4 0-160 71.6-160 160zm464.6-44.1c6.3-3.6 9.5-11.1 6.8-18-4.8-12.4-11.5-24.1-19.9-34.4-4.6-5.7-12.7-6.7-19-3-21.8 12.6-48.6-2.8-48.6-28.1 0-7.3-4.9-13.8-12.1-14.9-12.9-2-26.8-2-39.7 0-7.2 1.1-12.1 7.6-12.1 14.9 0 25.2-26.8 40.7-48.6 28.1-6.3-3.6-14.4-2.6-19 3-8.4 10.3-15.1 22-19.9 34.4-2.6 6.8 .5 14.3 6.8 17.9 21.9 12.6 21.9 43.5 0 56.2-6.3 3.6-9.5 11.1-6.8 17.9 4.8 12.4 11.5 24.1 19.9 34.4 4.6 5.7 12.7 6.7 19 3 21.8-12.6 48.6 2.9 48.6 28.1 0 7.3 4.9 13.8 12.1 14.9 12.9 2 26.8 2 39.7 0 7.2-1.1 12.1-7.6 12.1-14.9 0-25.2 26.8-40.7 48.6-28.1 6.3 3.6 14.4 2.6 19-3 8.4-10.3 15.1-22 19.9-34.4 2.6-6.8-.5-14.3-6.8-17.9-21.9-12.6-21.9-43.5 0-56.2zM472 416a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z\"]\n};\nvar faUsersCog = faUsersGear;\nvar faRoadCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'road-circle-exclamation',\n  icon: [640, 512, [], \"e565\", \"M288 32l-76.3 0c-29.4 0-55.1 20.1-62.1 48.6L65.4 420.5C57.9 450.7 80.8 480 112 480l209.4 0c-11.2-24.4-17.4-51.4-17.4-80 0-28.6 6.2-55.7 17.4-80-.5 0-1 0-1.5 0-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 49c35.2-39.9 86.7-65 144-65 9 0 17.8 .6 26.5 1.8l-32-129.2C483.4 52.1 457.8 32 428.3 32l-76.4 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm0-100a20 20 0 1 1 0 40 20 20 0 1 1 0-40zm0-140c8.8 0 16 7.2 16 16l0 80c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-80c0-8.8 7.2-16 16-16z\"]\n};\nvar faPause = {\n  prefix: 'fas',\n  iconName: 'pause',\n  icon: [384, 512, [9208], \"f04c\", \"M48 32C21.5 32 0 53.5 0 80L0 432c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 32zm224 0c-26.5 0-48 21.5-48 48l0 352c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48l-64 0z\"]\n};\nvar faStaffSnake = {\n  prefix: 'fas',\n  iconName: 'staff-snake',\n  icon: [448, 512, [\"rod-asclepius\", \"rod-snake\", \"staff-aesculapius\"], \"e579\", \"M192 32l0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 64 0c53 0 96 43 96 96s-43 96-96 96l-16 0 0-64 16 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0 192 32 0c53 0 96 43 96 96 0 47.6-34.6 87.1-80 94.7l0-67c9.6-5.5 16-15.9 16-27.7 0-17.7-14.3-32-32-32l-32 0 0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-64-32 0c-53 0-96-43-96-96 0-47.6 34.6-87.1 80-94.7l0 67c-9.6 5.5-16 15.9-16 27.7 0 17.7 14.3 32 32 32l32 0 0-192-72.6 0c-11.1 19.1-31.7 32-55.4 32l-16 0C21.5 128 0 106.5 0 80S21.5 32 48 32l144 0z\"]\n};\nvar faRodAsclepius = faStaffSnake;\nvar faRodSnake = faStaffSnake;\nvar faStaffAesculapius = faStaffSnake;\nvar faPiggyBank = {\n  prefix: 'fas',\n  iconName: 'piggy-bank',\n  icon: [576, 512, [], \"f4d3\", \"M288-32a96 96 0 1 1 0 192 96 96 0 1 1 0-192zM48 304c0-70.1 47-131.4 117.1-164.9 25.3 41.3 70.9 68.9 122.9 68.9 55.7 0 104.1-31.7 128-78 15.8-11.3 35.1-18 56-18l19.5 0c10.4 0 18 9.8 15.5 19.9l-17.1 68.3c9.9 12.4 18.2 25.7 24.4 39.8l21.7 0c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24l-40 0c-16.5 22-38.5 39.6-64 50.7l0 29.3c0 17.7-14.3 32-32 32l-33 0c-14.3 0-26.8-9.5-30.8-23.2l-7.1-24.8-82.3 0-7.1 24.8C235.8 502.5 223.3 512 209 512l-33 0c-17.7 0-32-14.3-32-32l0-29.3C87.5 426 48 369.6 48 304zm376 16a24 24 0 1 0 0-48 24 24 0 1 0 0 48z\"]\n};\nvar faMonument = {\n  prefix: 'fas',\n  iconName: 'monument',\n  icon: [384, 512, [], \"f5a6\", \"M209-33c-9.4-9.4-24.6-9.4-33.9 0L95 47c-4.1 4.1-6.5 9.4-7 15.1L58.4 448 48 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-10.4 0-29.7-385.8c-.4-5.7-2.9-11.1-7-15.1L209-33zM128 296c0-13.3 10.7-24 24-24l80 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24z\"]\n};\nvar faAnglesRight = {\n  prefix: 'fas',\n  iconName: 'angles-right',\n  icon: [448, 512, [187, \"angle-double-right\"], \"f101\", \"M439.1 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L371.2 256 233.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L179.2 256 41.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z\"]\n};\nvar faAngleDoubleRight = faAnglesRight;\nvar faDesktop = {\n  prefix: 'fas',\n  iconName: 'desktop',\n  icon: [512, 512, [128421, 61704, \"desktop-alt\"], \"f390\", \"M64 32C28.7 32 0 60.7 0 96L0 352c0 35.3 28.7 64 64 64l144 0-16 48-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l272 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0-16-48 144 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 32zM96 96l320 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32L96 320c-17.7 0-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32z\"]\n};\nvar faDesktopAlt = faDesktop;\nvar faPlaneCircleXmark = {\n  prefix: 'fas',\n  iconName: 'plane-circle-xmark',\n  icon: [640, 512, [], \"e557\", \"M232 24c0-30.9 25.1-56 56-56s56 25.1 56 56l0 127.3 78 71.5c-69.3 29-118 97.4-118 177.2 0 49.3 18.6 94.3 49.1 128.3L288 512 179.9 539c-10.1 2.5-19.9-5.1-19.9-15.5l0-19.8c0-4.9 2.2-9.5 6-12.5l66-52.8 0-99.7-162.9 54.3C58.7 396.4 48 388.7 48 377.8l0-43.7c0-9 3.8-17.5 10.4-23.6L232 151.3 232 24zM496 256a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm59.3 107.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0l-36.7 36.7-36.7-36.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l36.7 36.7-36.7 36.7c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l36.7-36.7 36.7 36.7c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-36.7-36.7 36.7-36.7z\"]\n};\nvar faRetweet = {\n  prefix: 'fas',\n  iconName: 'retweet',\n  icon: [576, 512, [], \"f079\", \"M118.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-9.2 9.2-11.9 22.9-6.9 34.9S19.1 160 32 160l32 0 0 224c0 53 43 96 96 96l128 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-128 0c-17.7 0-32-14.3-32-32l0-224 32 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-64-64zM457.4 470.6c12.5 12.5 32.8 12.5 45.3 0l64-64c9.2-9.2 11.9-22.9 6.9-34.9S556.9 352 544 352l-32 0 0-224c0-53-43-96-96-96L288 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32 14.3 32 32l0 224-32 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l64 64z\"]\n};\nvar faUserGear = {\n  prefix: 'fas',\n  iconName: 'user-gear',\n  icon: [640, 512, [\"user-cog\"], \"f4fe\", \"M256.5 8a120 120 0 1 1 0 240 120 120 0 1 1 0-240zM226.7 304l59.4 0 1.5 0c-12.9 26.8-7.8 58.2 11.5 79.5-20.2 22.3-24.8 55.8-9.4 83.4l22.5 40.4c.9 1.6 1.9 3.2 2.9 4.7l-237 0c-16.4 0-29.7-13.3-29.7-29.7 0-98.5 79.8-178.3 178.3-178.3zm205.9-56.4c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 6.1c0 18.9 24.1 32.8 40.5 23.4l5-2.9c11.6-6.7 26.5-2.6 33 9.1l22.4 40.2c6.2 11.2 2.6 25.2-8.2 32l-4.7 2.9c-16.2 10.1-16.2 39.9 0 50.1l4.6 2.9c10.8 6.8 14.5 20.8 8.3 32L607 483.8c-6.5 11.7-21.4 15.9-33 9.1l-4.9-2.9c-16.4-9.5-40.5 4.5-40.5 23.4l0 6.1c0 13.3-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24l0-5.9c0-19-24.2-33-40.7-23.5l-4.8 2.8c-11.6 6.7-26.4 2.6-33-9.1l-22.6-40.4c-6.2-11.2-2.6-25.3 8.3-32.1l4.4-2.7c16.3-10.1 16.3-40.1 0-50.2l-4.5-2.8c-10.9-6.8-14.5-20.9-8.3-32.1l22.5-40.3c6.5-11.7 21.4-15.8 32.9-9.1l4.8 2.8c16.5 9.5 40.7-4.5 40.7-23.5l0-5.9zm99.9 136.2a52 52 0 1 0 -104 0 52 52 0 1 0 104 0z\"]\n};\nvar faUserCog = faUserGear;\nvar faBorderAll = {\n  prefix: 'fas',\n  iconName: 'border-all',\n  icon: [448, 512, [], \"f84c\", \"M384 96l0 128-128 0 0-128 128 0zm0 192l0 128-128 0 0-128 128 0zM192 224l-128 0 0-128 128 0 0 128zM64 288l128 0 0 128-128 0 0-128zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z\"]\n};\nvar faCoins = {\n  prefix: 'fas',\n  iconName: 'coins',\n  icon: [512, 512, [], \"f51e\", \"M128 96l0-16c0-44.2 86-80 192-80S512 35.8 512 80l0 16c0 30.6-41.3 57.2-102 70.7-2.4-2.8-4.9-5.5-7.4-8-15.5-15.3-35.5-26.9-56.4-35.5-41.9-17.5-96.5-27.1-154.2-27.1-21.9 0-43.3 1.4-63.8 4.1-.2-1.3-.2-2.7-.2-4.1zM432 353l0-46.2c15.1-3.9 29.3-8.5 42.2-13.9 13.2-5.5 26.1-12.2 37.8-20.3l0 15.4c0 26.8-31.5 50.5-80 65zm0-96l0-33c0-4.5-.4-8.8-1-13 15.5-3.9 30-8.6 43.2-14.2s26.1-12.2 37.8-20.3l0 15.4c0 26.8-31.5 50.5-80 65zM0 240l0-16c0-44.2 86-80 192-80s192 35.8 192 80l0 16c0 44.2-86 80-192 80S0 284.2 0 240zm384 96c0 44.2-86 80-192 80S0 380.2 0 336l0-15.4c11.6 8.1 24.5 14.7 37.8 20.3 41.9 17.5 96.5 27.1 154.2 27.1s112.3-9.7 154.2-27.1c13.2-5.5 26.1-12.2 37.8-20.3l0 15.4zm0 80.6l0 15.4c0 44.2-86 80-192 80S0 476.2 0 432l0-15.4c11.6 8.1 24.5 14.7 37.8 20.3 41.9 17.5 96.5 27.1 154.2 27.1s112.3-9.7 154.2-27.1c13.2-5.5 26.1-12.2 37.8-20.3z\"]\n};\nvar faMarsStroke = {\n  prefix: 'fas',\n  iconName: 'mars-stroke',\n  icon: [576, 512, [9894], \"f229\", \"M416-32c-17.7 0-32 14.3-32 32s14.3 32 32 32l50.7 0-58.7 58.7-17.4-17.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l17.4 17.4-23 23c-28.4-19.5-62.7-31-99.8-31-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176c0-37-11.4-71.4-31-99.8l23-23 17.4 17.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L453.3 136 512 77.3 512 128c0 17.7 14.3 32 32 32s32-14.3 32-32L576 0c0-17.7-14.3-32-32-32L416-32zM128 304a112 112 0 1 1 224 0 112 112 0 1 1 -224 0z\"]\n};\nvar faHandshakeAngle = {\n  prefix: 'fas',\n  iconName: 'handshake-angle',\n  icon: [576, 512, [\"hands-helping\"], \"f4c4\", \"M268.9 53.2L152.3 182.8c-4.6 5.1-4.4 13 .5 17.9 30.5 30.5 80 30.5 110.5 0l31.8-31.8c4.2-4.2 9.5-6.5 14.9-6.9 6.8-.6 13.8 1.7 19 6.9L505.6 344 576 288 576 0 464 64 440.2 48.1C424.4 37.6 405.9 32 386.9 32l-70.4 0c-1.1 0-2.3 0-3.4 .1-16.9 .9-32.8 8.5-44.2 21.1zM116.6 150.7L223.4 32 183.8 32c-25.5 0-49.9 10.1-67.9 28.1L0 192 0 544 144 408 156.4 418.3c23 19.2 52 29.7 81.9 29.7l15.7 0-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l41 41 9 0c19.1 0 37.8-4.3 54.8-12.3L359 409c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l32 32 17.5-17.5c8.9-8.9 11.5-21.8 7.6-33.1l-137.9-136.8-14.9 14.9c-49.3 49.3-129.1 49.3-178.4 0-23-23-23.9-59.9-2.2-84z\"]\n};\nvar faHandsHelping = faHandshakeAngle;\nvar faArrowDown = {\n  prefix: 'fas',\n  iconName: 'arrow-down',\n  icon: [384, 512, [8595], \"f063\", \"M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7-105.4-105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z\"]\n};\nvar faLocationDot = {\n  prefix: 'fas',\n  iconName: 'location-dot',\n  icon: [384, 512, [\"map-marker-alt\"], \"f3c5\", \"M0 188.6C0 84.4 86 0 192 0S384 84.4 384 188.6c0 119.3-120.2 262.3-170.4 316.8-11.8 12.8-31.5 12.8-43.3 0-50.2-54.5-170.4-197.5-170.4-316.8zM192 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128z\"]\n};\nvar faMapMarkerAlt = faLocationDot;\nvar faPlugCircleExclamation = {\n  prefix: 'fas',\n  iconName: 'plug-circle-exclamation',\n  icon: [640, 512, [], \"e55d\", \"M192-32c17.7 0 32 14.3 32 32l0 96 128 0 0-96c0-17.7 14.3-32 32-32s32 14.3 32 32l0 96 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 48.7c-98.6 8.1-176 90.7-176 191.3 0 27.3 5.7 53.3 16 76.9l0 3.1c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-66.7C165.2 398.1 96 319.1 96 224l0-64c-17.7 0-32-14.3-32-32S78.3 96 96 96l64 0 0-96c0-17.7 14.3-32 32-32zM496 256a144 144 0 1 1 0 288 144 144 0 1 1 0-288zm0 228a20 20 0 1 0 0-40 20 20 0 1 0 0 40zm0-180c-8.8 0-16 7.2-16 16l0 80c0 8.8 7.2 16 16 16s16-7.2 16-16l0-80c0-8.8-7.2-16-16-16z\"]\n};\nvar faCookieBite = {\n  prefix: 'fas',\n  iconName: 'cookie-bite',\n  icon: [512, 512, [], \"f564\", \"M257.5 27.6c-.8-5.4-4.9-9.8-10.3-10.6-22.1-3.1-44.6 .9-64.4 11.4l-74 39.5C89.1 78.4 73.2 94.9 63.4 115L26.7 190.6c-9.8 20.1-13 42.9-9.1 64.9l14.5 82.8c3.9 22.1 14.6 42.3 30.7 57.9l60.3 58.4c16.1 15.6 36.6 25.6 58.7 28.7l83 11.7c22.1 3.1 44.6-.9 64.4-11.4l74-39.5c19.7-10.5 35.6-27 45.4-47.2l36.7-75.5c9.8-20.1 13-42.9 9.1-64.9-.9-5.3-5.3-9.3-10.6-10.1-51.5-8.2-92.8-47.1-104.5-97.4-1.8-7.6-8-13.4-15.7-14.6-54.6-8.7-97.7-52-106.2-106.8zM208 144a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM144 336a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm224-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faScrewdriverWrench = {\n  prefix: 'fas',\n  iconName: 'screwdriver-wrench',\n  icon: [576, 512, [\"tools\"], \"f7d9\", \"M70.8-6.7c5.4-5.4 13.8-6.2 20.2-2L209.9 70.5c8.9 5.9 14.2 15.9 14.2 26.6l0 49.6 90.8 90.8c33.3-15 73.9-8.9 101.2 18.5L542.2 382.1c18.7 18.7 18.7 49.1 0 67.9l-60.1 60.1c-18.7 18.7-49.1 18.7-67.9 0L288.1 384c-27.4-27.4-33.5-67.9-18.5-101.2l-90.8-90.8-49.6 0c-10.7 0-20.7-5.3-26.6-14.2L23.4 58.9c-4.2-6.3-3.4-14.8 2-20.2L70.8-6.7zm145 303.5c-6.3 36.9 2.3 75.9 26.2 107.2l-94.9 95c-28.1 28.1-73.7 28.1-101.8 0s-28.1-73.7 0-101.8l135.4-135.5 35.2 35.1zM384.1 0c20.1 0 39.4 3.7 57.1 10.5 10 3.8 11.8 16.5 4.3 24.1L388.8 91.3c-3 3-4.7 7.1-4.7 11.3l0 41.4c0 8.8 7.2 16 16 16l41.4 0c4.2 0 8.3-1.7 11.3-4.7l56.7-56.7c7.6-7.5 20.3-5.7 24.1 4.3 6.8 17.7 10.5 37 10.5 57.1 0 43.2-17.2 82.3-45 111.1l-49.1-49.1c-33.1-33-78.5-45.7-121.1-38.4l-56.8-56.8 0-29.7-.2-5c-.8-12.4-4.4-24.3-10.5-34.9 29.4-35 73.4-57.2 122.7-57.3z\"]\n};\nvar faTools = faScrewdriverWrench;\nvar faIndent = {\n  prefix: 'fas',\n  iconName: 'indent',\n  icon: [448, 512, [], \"f03c\", \"M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z\"]\n};\nvar faBars = {\n  prefix: 'fas',\n  iconName: 'bars',\n  icon: [448, 512, [\"navicon\"], \"f0c9\", \"M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z\"]\n};\nvar faNavicon = faBars;\nvar faHandsPraying = {\n  prefix: 'fas',\n  iconName: 'hands-praying',\n  icon: [640, 512, [\"praying-hands\"], \"f684\", \"M224 296c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112.6 88.2-119.7c13.1-17.8 9.3-42.8-8.5-55.9s-42.8-9.3-55.9 8.5L106.5 142.9C89.3 166.2 80 194.5 80 223.6l0 110.7-58.1 19.4C8.8 358 0 370.2 0 384l0 96c0 10 4.7 19.5 12.7 25.5s18.4 8 28.1 5.2l154.4-44.1c55-15.7 92.8-65.9 92.8-123.1L288 224c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 72zm192 0l0-72c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 119.6c0 57.2 37.9 107.4 92.8 123.1l154.4 44.1c9.7 2.8 20 .8 28.1-5.2S640 490 640 480l0-96c0-13.8-8.8-26-21.9-30.4l-58.1-19.4 0-110.7c0-29-9.3-57.3-26.5-80.7L440.2 16.3C427.1-1.5 402.1-5.3 384.3 7.8s-21.6 38.1-8.5 55.9L464 183.4 464 296c0 13.3-10.7 24-24 24s-24-10.7-24-24z\"]\n};\nvar faPrayingHands = faHandsPraying;\nvar faViruses = {\n  prefix: 'fas',\n  iconName: 'viruses',\n  icon: [640, 512, [], \"e076\", \"M192 0c17.7 0 32 14.3 32 32 0 30.5 36.9 45.8 58.5 24.2 12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3c-21.6 21.6-6.3 58.5 24.2 58.5 17.7 0 32 14.3 32 32s-14.3 32-32 32c-30.5 0-45.8 36.9-24.2 58.5 12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0c-21.6-21.6-58.5-6.3-58.5 24.2 0 17.7-14.3 32-32 32s-32-14.3-32-32c0-30.5-36.9-45.8-58.5-24.2-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3C77.8 260.9 62.5 224 32 224 14.3 224 0 209.7 0 192s14.3-32 32-32c30.5 0 45.8-36.9 24.2-58.5-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0C123.1 77.8 160 62.5 160 32 160 14.3 174.3 0 192 0zM144 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm128 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm248 40c0 22.9 27.7 34.4 43.9 18.2 9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9c-16.2 16.2-4.7 43.9 18.2 43.9 13.3 0 24 10.7 24 24s-10.7 24-24 24c-22.9 0-34.4 27.7-18.2 43.9 9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0c-16.2-16.2-43.9-4.7-43.9 18.2 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-22.9-27.7-34.4-43.9-18.2-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9c16.2-16.2 4.7-43.9-18.2-43.9-13.3 0-24-10.7-24-24s10.7-24 24-24c22.9 0 34.4-27.7 18.2-43.9-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0c16.2 16.2 43.9 4.7 43.9-18.2 0-13.3 10.7-24 24-24s24 10.7 24 24zM504 384a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faSchoolFlag = {\n  prefix: 'fas',\n  iconName: 'school-flag',\n  icon: [576, 512, [], \"e56e\", \"M256-8c0-13.3 10.7-24 24-24l112 0c13.3 0 24 10.7 24 24l0 48c0 13.3-10.7 24-24 24l-72 0 0 19.2 128 76.8 64 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 128-76.8 0-91.2zM240 384l0 80 96 0 0-80c0-26.5-21.5-48-48-48s-48 21.5-48 48zM112 416c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0zm16-144l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zM496 416c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0zm16-144l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zm-224 0a48 48 0 1 0 0-96 48 48 0 1 0 0 96z\"]\n};\nvar faTrademark = {\n  prefix: 'fas',\n  iconName: 'trademark',\n  icon: [640, 512, [8482], \"f25c\", \"M346.6 110.2c-7.8-11.7-22.4-17-35.9-12.9S288 113.9 288 128l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32l0-150.3 69.4 104.1c5.9 8.9 15.9 14.2 26.6 14.2s20.7-5.3 26.6-14.2L544 233.7 544 384c0 17.7 14.3 32 32 32s32-14.3 32-32l0-256c0-14.1-9.2-26.5-22.7-30.6s-28.1 1.1-35.9 12.9L448 262.3 346.6 110.2zM32 96C14.3 96 0 110.3 0 128s14.3 32 32 32l64 0 0 224c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 96z\"]\n};\nvar faFireBurner = {\n  prefix: 'fas',\n  iconName: 'fire-burner',\n  icon: [512, 512, [], \"e4f1\", \"M281.7 48.3L294 34.5c5.4-6.1 13.3-8.8 20.9-8.9 7.2 0 14.3 2.6 19.9 7.8 19.7 18.3 39.8 43.2 55 70.6 15.1 27.2 26.2 58.1 26.2 88.1 0 88.7-71.3 159.8-160 159.8-89.6 0-160-71.3-160-159.8 0-37.3 16-73.4 36.8-104.5 20.9-31.3 47.5-59 70.9-80.2 5.7-5.2 13.1-7.7 20.3-7.5s13.4 3.2 18.8 7.5c14.4 11.4 38.9 40.7 38.9 40.7zM320 240.2c0-36.5-37-73-54.8-88.4-5.4-4.7-13.1-4.7-18.5 0-17.7 15.4-54.8 51.9-54.8 88.4 0 35.3 28.7 64 64 64s64-28.7 64-64zM92.8 320c37.7 48.3 96.1 80 163.2 80 66.5 0 125.1-31.7 163-80l45 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48l0-64c0-26.5 21.5-48 48-48l44.8 0zM456 400a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"]\n};\nvar faFaceSmileBeam = {\n  prefix: 'fas',\n  iconName: 'face-smile-beam',\n  icon: [512, 512, [128522, \"smile-beam\"], \"f5b8\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM165.4 321.9c20.4 28 53.4 46.1 90.6 46.1s70.2-18.1 90.6-46.1c7.8-10.7 22.8-13.1 33.5-5.3s13.1 22.8 5.3 33.5C356.3 390 309.2 416 256 416s-100.3-26-129.4-65.9c-7.8-10.7-5.4-25.7 5.3-33.5s25.7-5.4 33.5 5.3zM176 180c-15.5 0-28 12.5-28 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28zm132 28l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-37.6 30.4-68 68-68s68 30.4 68 68l0 8c0 11-9 20-20 20s-20-9-20-20l0-8c0-15.5-12.5-28-28-28s-28 12.5-28 28z\"]\n};\nvar faSmileBeam = faFaceSmileBeam;\nvar faTentArrowLeftRight = {\n  prefix: 'fas',\n  iconName: 'tent-arrow-left-right',\n  icon: [512, 512, [], \"e57f\", \"M-.5 113c-9.4-9.4-9.4-24.6 0-33.9l72-72c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-31 31 310.1 0 54.1 0-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l72 72c9.4 9.4 9.4 24.6 0 33.9l-72 72c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-102.1 0-.1 0-262 0 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-72-72zM37.1 476L60.3 292.6c1.2-9.7 6.8-18.3 15.1-23.3L238.8 170c10.2-6.2 22.9-6.2 33.1-.1l165.5 99.4c8.4 5 14 13.7 15.3 23.4L475.9 476c2.4 19.1-12.5 36-31.7 36l-71.9 0c-12.1 0-23.2-6.8-28.6-17.7L275.4 357.9c-1.8-3.6-5.5-5.9-9.5-5.9-5.9 0-10.6 4.7-10.6 10.6l0 117.4c0 17.7-14.3 32-32 32L68.8 512c-19.3 0-34.2-16.9-31.7-36z\"]\n};\nvar faRoute = {\n  prefix: 'fas',\n  iconName: 'route',\n  icon: [512, 512, [], \"f4d7\", \"M512 96c0 50.2-59.1 125.1-84.6 155-3.8 4.4-9.4 6.1-14.5 5L320 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96 43 96 96s-43 96-96 96l-276.4 0c8.7-9.9 19.3-22.6 30-36.8 6.3-8.4 12.8-17.6 19-27.2L416 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-53 0-96-43-96-96s43-96 96-96l39.8 0c-21-31.5-39.8-67.7-39.8-96 0-53 43-96 96-96s96 43 96 96zM117.1 489.1c-3.8 4.3-7.2 8.1-10.1 11.3l-1.8 2-.2-.2c-6 4.6-14.6 4-20-1.8-25.2-27.4-85-97.9-85-148.4 0-53 43-96 96-96s96 43 96 96c0 30-21.1 67-43.5 97.9-10.7 14.7-21.7 28-30.8 38.5l-.6 .7zM128 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faAnglesUp = {\n  prefix: 'fas',\n  iconName: 'angles-up',\n  icon: [384, 512, [\"angle-double-up\"], \"f102\", \"M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 109.3 329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160zm160 352l-160-160c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 329.4 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3z\"]\n};\nvar faAngleDoubleUp = faAnglesUp;\nvar faBucket = {\n  prefix: 'fas',\n  iconName: 'bucket',\n  icon: [448, 512, [], \"e4cf\", \"M443.7 208c2.7 4.7 4.3 10.2 4.3 16 0 17.7-14.3 32-32 32l-5.1 0-22.4 213c-2.6 24.4-23.2 43-47.8 43l-233.6 0c-24.6 0-45.2-18.5-47.8-43L37.1 256 32 256c-17.7 0-32-14.3-32-32 0-5.8 1.6-11.3 4.3-16l439.4 0zM224-16c79.5 0 144 64.5 144 144l0 32-48 0 0-32c0-53-43-96-96-96s-96 43-96 96l0 32-48 0 0-32C80 48.5 144.5-16 224-16z\"]\n};\nvar faLessThanEqual = {\n  prefix: 'fas',\n  iconName: 'less-than-equal',\n  icon: [448, 512, [], \"f537\", \"M426.1 94.4c16.8-5.6 25.8-23.7 20.2-40.5s-23.7-25.8-40.5-20.2l-384 128C8.8 166 0 178.2 0 192s8.8 26 21.9 30.4l384 128c16.8 5.6 34.9-3.5 40.5-20.2s-3.5-34.9-20.2-40.5L133.2 192 426.1 94.4zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416z\"]\n};\nvar faFolderClosed = {\n  prefix: 'fas',\n  iconName: 'folder-closed',\n  icon: [512, 512, [], \"e185\", \"M448 448L64 448c-35.3 0-64-28.7-64-64l0-176 512 0 0 176c0 35.3-28.7 64-64 64zm64-288L0 160 0 96C0 60.7 28.7 32 64 32l138.7 0c13.8 0 27.3 4.5 38.4 12.8l38.4 28.8c5.5 4.2 12.3 6.4 19.2 6.4L448 80c35.3 0 64 28.7 64 64l0 16z\"]\n};\nvar faPersonThroughWindow = {\n  prefix: 'fas',\n  iconName: 'person-through-window',\n  icon: [640, 512, [], \"e5a9\", \"M64 64l224 0 0 9.8c0 39-23.7 74-59.9 88.4-60.5 24.2-100.1 82.7-100.1 147.9l0 73.8-64 0 0-320zm288 0l224 0 0 320-67.7 0-3.7-4.5-75.2-90.2c-9.1-10.9-22.6-17.3-36.9-17.3l-71.1 0-41-63.1c-.3-.5-.6-1-1-1.4 44.7-29 72.5-79 72.5-133.6l0-9.8zm73 320l-26.6 0 42.7 64 150.9 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 0C21.5 0 0 21.5 0 48L0 400c0 26.5 21.5 48 48 48l260.2 0 33.2 49.8c9.8 14.7 29.7 18.7 44.4 8.9s18.7-29.7 8.9-44.4l-84.2-126.2 74.6 0 40 48zm-159.5 0l-73.5 0 0-73.8c0-10.2 1.6-20.1 4.7-29.5L265.5 384zM192 128a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z\"]\n};\nvar faSchoolLock = {\n  prefix: 'fas',\n  iconName: 'school-lock',\n  icon: [640, 512, [], \"e56f\", \"M0 192c0-35.3 28.7-64 64-64l64 0 127.9-115.1c18.3-16.4 46-16.4 64.2 0L448 128 512 128c33 0 60.2 25 63.6 57.2-14.7-5.9-30.8-9.2-47.6-9.2-70.7 0-128 57.3-128 128l0 24.4c-19.6 17.6-32 43.1-32 71.5l0 96c0 5.5 .5 10.9 1.3 16.1L64 512c-35.3 0-64-28.7-64-64L0 192zM332.3 341.5c-6-3.5-12.9-5.5-20.3-5.5l-48 0c-22.1 0-40 17.9-40 40l0 88 96 0 0-64.1c0-20.8 4.4-40.5 12.3-58.4zM112 384c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0zm16-144l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16zm224-48a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM560 352l0-47.9c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 47.9 64 0zm-112 2.7l0-50.6c0-44.2 35.8-80 80-80s80 35.8 80 80l0 50.6c18.6 6.6 32 24.4 32 45.3l0 96c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48l0-96c0-20.9 13.4-38.7 32-45.3z\"]\n};\nvar faPersonBurst = {\n  prefix: 'fas',\n  iconName: 'person-burst',\n  icon: [640, 512, [], \"e53b\", \"M204 40.1c-13.3 0-24-10.7-24-24l0-48c0-13.3 10.7-24 24-24s24 10.7 24 24l0 48c0 13.3-10.7 24-24 24zM4 144.1c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zM96.5 285.5c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l33.9-33.9c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L96.5 285.5zM62.6 2.7c9.4-9.4 24.6-9.4 33.9 0l33.9 33.9c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L62.6 36.6c-9.4-9.4-9.4-24.6 0-33.9zM352.4-32a56 56 0 1 1 0 112 56 56 0 1 1 0-112zM478.7 299.1l-46.3-62.4 0 275.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-275.3-46.3 62.4c-10.5 14.2-30.6 17.2-44.8 6.6s-17.2-30.6-6.6-44.8l70.5-95c25.2-33.9 65-53.9 107.2-53.9s82 20 107.2 53.9l70.5 95c10.5 14.2 7.6 34.2-6.6 44.8s-34.2 7.6-44.8-6.6z\"]\n};\nvar faLeftLong = {\n  prefix: 'fas',\n  iconName: 'left-long',\n  icon: [576, 512, [\"long-arrow-alt-left\"], \"f30a\", \"M9.4 278.6c-12.5-12.5-12.5-32.8 0-45.3l128-128c9.2-9.2 22.9-11.9 34.9-6.9S192 115.1 192 128l0 64 336 0c26.5 0 48 21.5 48 48l0 32c0 26.5-21.5 48-48 48l-336 0 0 64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-128-128z\"]\n};\nvar faLongArrowAltLeft = faLeftLong;\nvar faLocationCrosshairs = {\n  prefix: 'fas',\n  iconName: 'location-crosshairs',\n  icon: [576, 512, [\"location\"], \"f601\", \"M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM128 256a160 160 0 1 0 320 0 160 160 0 1 0 -320 0zm160-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z\"]\n};\nvar faLocation = faLocationCrosshairs;\nvar faPersonDotsFromLine = {\n  prefix: 'fas',\n  iconName: 'person-dots-from-line',\n  icon: [512, 512, [\"diagnoses\"], \"f470\", \"M184 72a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zM160 299.3c-19.9 22.6-32 52.2-32 84.7l0 32-64 0 0-32c0-106 86-192 192-192s192 86 192 192l0 32-64 0 0-32c0-32.5-12.1-62.1-32-84.7l0 116.7-192 0 0-116.7zM232 384a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm88-104a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM24 464l464 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24zM64 184a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm424 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"]\n};\nvar faDiagnoses = faPersonDotsFromLine;\nvar faGaugeSimpleHigh = {\n  prefix: 'fas',\n  iconName: 'gauge-simple-high',\n  icon: [512, 512, [61668, \"tachometer\", \"tachometer-fast\"], \"f62a\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm320 96c0-16.2-6-31.1-16-42.3l69.5-138.9c5.9-11.9 1.1-26.3-10.7-32.2s-26.3-1.1-32.2 10.7L261.1 288.2c-1.7-.1-3.4-.2-5.1-.2-35.3 0-64 28.7-64 64s28.7 64 64 64 64-28.7 64-64z\"]\n};\nvar faTachometer = faGaugeSimpleHigh;\nvar faTachometerFast = faGaugeSimpleHigh;\nvar faAnglesLeft = {\n  prefix: 'fas',\n  iconName: 'angles-left',\n  icon: [448, 512, [171, \"angle-double-left\"], \"f100\", \"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L269.3 256 406.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z\"]\n};\nvar faAngleDoubleLeft = faAnglesLeft;\nvar faUpDown = {\n  prefix: 'fas',\n  iconName: 'up-down',\n  icon: [512, 512, [8597, 11021, \"arrows-alt-v\"], \"f338\", \"M406.6 502.6l96-96c9.2-9.2 11.9-22.9 6.9-34.9S492.9 352 480 352l-64 0 0-320c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 320-64 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l96 96c12.5 12.5 32.8 12.5 45.3 0zM150.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-9.2 9.2-11.9 22.9-6.9 34.9S19.1 160 32 160l64 0 0 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320 64 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-96-96z\"]\n};\nvar faArrowsAltV = faUpDown;\nvar faBatteryEmpty = {\n  prefix: 'fas',\n  iconName: 'battery-empty',\n  icon: [640, 512, [\"battery-0\"], \"f244\", \"M112 160c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16l416 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16l-416 0zM32 176c0-44.2 35.8-80 80-80l416 0c44.2 0 80 35.8 80 80l0 48c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l0 48c0 44.2-35.8 80-80 80l-416 0c-44.2 0-80-35.8-80-80l0-224z\"]\n};\nvar faBattery0 = faBatteryEmpty;\nvar faKeyboard = {\n  prefix: 'fas',\n  iconName: 'keyboard',\n  icon: [576, 512, [9000], \"f11c\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm16 64l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM64 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM176 128l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM160 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l224 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-176c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-80c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zm80-80c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm16 80l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z\"]\n};\nvar faCookie = {\n  prefix: 'fas',\n  iconName: 'cookie',\n  icon: [512, 512, [127850], \"f563\", \"M247.2 17c-22.1-3.1-44.6 .9-64.4 11.4l-74 39.5C89.1 78.4 73.2 94.9 63.4 115L26.7 190.6c-9.8 20.1-13 42.9-9.1 64.9l14.5 82.8c3.9 22.1 14.6 42.3 30.7 57.9l60.3 58.4c16.1 15.6 36.6 25.6 58.7 28.7l83 11.7c22.1 3.1 44.6-.9 64.4-11.4l74-39.5c19.7-10.5 35.6-27 45.4-47.2l36.7-75.5c9.8-20.1 13-42.9 9.1-64.9l-14.6-82.8c-3.9-22.1-14.6-42.3-30.7-57.9L388.9 57.5c-16.1-15.6-36.6-25.6-58.7-28.7L247.2 17zM208 144a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM144 336a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm224-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faStopwatch = {\n  prefix: 'fas',\n  iconName: 'stopwatch',\n  icon: [448, 512, [9201], \"f2f2\", \"M168.5 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 25.3c-108 11.9-192 103.5-192 214.7 0 119.3 96.7 216 216 216s216-96.7 216-216c0-39.8-10.8-77.1-29.6-109.2l28.2-28.2c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-23.4 23.4c-32.9-30.2-75.2-50.3-122-55.5l0-25.3 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0zm80 184l0 104c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-104c0-13.3 10.7-24 24-24s24 10.7 24 24z\"]\n};\nvar faEject = {\n  prefix: 'fas',\n  iconName: 'eject',\n  icon: [448, 512, [9167], \"f052\", \"M224 32c13.5 0 26.3 5.6 35.4 15.6l176 192c12.9 14 16.2 34.3 8.6 51.8S419 320 400 320L48 320c-19 0-36.3-11.2-43.9-28.7s-4.3-37.7 8.6-51.8l176-192C197.7 37.6 210.5 32 224 32zM0 432c0-26.5 21.5-48 48-48l352 0c26.5 0 48 21.5 48 48s-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48z\"]\n};\nvar faSatelliteDish = {\n  prefix: 'fas',\n  iconName: 'satellite-dish',\n  icon: [512, 512, [128225], \"f7c0\", \"M232 0c154.6 0 280 125.4 280 280 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-128.1-103.9-232-232-232-13.3 0-24-10.7-24-24S218.7 0 232 0zM208 120c0-13.3 10.7-24 24-24 101.6 0 184 82.4 184 184 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-75.1-60.9-136-136-136-13.3 0-24-10.7-24-24zM26.4 142.7c8.8-17.9 32.4-19.9 46.5-5.8l128.5 128.5 32-32c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-32 32 128.5 128.5c14.1 14.1 12 37.6-5.8 46.5-34.2 16.9-72.6 26.4-113.3 26.4-141.4 0-256-114.6-256-256 0-40.7 9.5-79.2 26.4-113.3z\"]\n};\nvar faFaceRollingEyes = {\n  prefix: 'fas',\n  iconName: 'face-rolling-eyes',\n  icon: [512, 512, [128580, \"meh-rolling-eyes\"], \"f5a5\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM192 352l128 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-128 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm32-128c0 35.3-28.7 64-64 64s-64-28.7-64-64c0-26 15.5-48.4 37.8-58.4-3.7 5.2-5.8 11.6-5.8 18.4 0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.9-2.2-13.2-5.8-18.4 22.3 10 37.8 32.4 37.8 58.4zm128 64c-35.3 0-64-28.7-64-64 0-26 15.5-48.4 37.8-58.4-3.7 5.2-5.8 11.6-5.8 18.4 0 17.7 14.3 32 32 32s32-14.3 32-32c0-6.9-2.2-13.2-5.8-18.4 22.3 10 37.8 32.4 37.8 58.4 0 35.3-28.7 64-64 64z\"]\n};\nvar faMehRollingEyes = faFaceRollingEyes;\nvar faListCheck = {\n  prefix: 'fas',\n  iconName: 'list-check',\n  icon: [512, 512, [\"tasks\"], \"f0ae\", \"M133.8 36.3c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 158 47 153L7 113C-2.3 103.6-2.3 88.4 7 79S31.6 69.7 41 79l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zm0 160c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 318 47 313L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM64 376a40 40 0 1 1 0 80 40 40 0 1 1 0-80z\"]\n};\nvar faTasks = faListCheck;\nvar faSackXmark = {\n  prefix: 'fas',\n  iconName: 'sack-xmark',\n  icon: [512, 512, [], \"e56a\", \"M328 112l-144 0-37.3-74.5c-1.8-3.6-2.7-7.6-2.7-11.6 0-14.3 11.6-25.9 25.9-25.9L342.1 0c14.3 0 25.9 11.6 25.9 25.9 0 4-.9 8-2.7 11.6L328 112zM169.6 160l172.8 0 48.7 40.6C457.6 256 496 338 496 424.5 496 472.8 456.8 512 408.5 512l-305.1 0C55.2 512 16 472.8 16 424.5 16 338 54.4 256 120.9 200.6L169.6 160zM323.9 284.1c-9.4-9.4-24.6-9.4-33.9 0l-33.9 33.9-33.9-33.9c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l33.9 33.9-33.9 33.9c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l33.9-33.9 33.9 33.9c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-33.9-33.9 33.9-33.9c9.4-9.4 9.4-24.6 0-33.9z\"]\n};\nvar faHashtag = {\n  prefix: 'fas',\n  iconName: 'hashtag',\n  icon: [512, 512, [62098], \"23\", \"M214.7 .7c17.3 3.7 28.3 20.7 24.6 38l-19.1 89.3 126.5 0 22-102.7C372.4 8 389.4-3 406.7 .7s28.3 20.7 24.6 38L412.2 128 480 128c17.7 0 32 14.3 32 32s-14.3 32-32 32l-81.6 0-27.4 128 67.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-81.6 0-22 102.7c-3.7 17.3-20.7 28.3-38 24.6s-28.3-20.7-24.6-38l19.1-89.3-126.5 0-22 102.7c-3.7 17.3-20.7 28.3-38 24.6s-28.3-20.7-24.6-38L99.8 384 32 384c-17.7 0-32-14.3-32-32s14.3-32 32-32l81.6 0 27.4-128-67.8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l81.6 0 22-102.7C180.4 8 197.4-3 214.7 .7zM206.4 192l-27.4 128 126.5 0 27.4-128-126.5 0z\"]\n};\nvar faTrain = {\n  prefix: 'fas',\n  iconName: 'train',\n  icon: [384, 512, [128646], \"f238\", \"M0 96C0 43 43 0 96 0L288 0c53 0 96 43 96 96l0 256c0 40.1-24.6 74.5-59.5 88.8l53.9 63.7c8.6 10.1 7.3 25.3-2.8 33.8s-25.3 7.3-33.8-2.8l-74-87.5-151.3 0-74 87.5c-8.6 10.1-23.7 11.4-33.8 2.8s-11.4-23.7-2.8-33.8l53.9-63.7C24.6 426.5 0 392.1 0 352L0 96zm64 32l0 96c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32L96 96c-17.7 0-32 14.3-32 32zM192 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faGamepad = {\n  prefix: 'fas',\n  iconName: 'gamepad',\n  icon: [640, 512, [], \"f11b\", \"M448 64c106 0 192 86 192 192S554 448 448 448l-256 0C86 448 0 362 0 256S86 64 192 64l256 0zM192 176c-13.3 0-24 10.7-24 24l0 32-32 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l32 0 0 32c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32 32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0 0-32c0-13.3-10.7-24-24-24zm240 96a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm64-96a32 32 0 1 0 0 64 32 32 0 1 0 0-64z\"]\n};\nvar faFileExport = {\n  prefix: 'fas',\n  iconName: 'file-export',\n  icon: [576, 512, [\"arrow-right-from-file\"], \"f56e\", \"M96.5 0c-35.3 0-64 28.7-64 64l0 384c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-96 78.1 0-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9l-72-72c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-78.1 0 0-133.5c0-17-6.7-33.3-18.7-45.3L291.2 18.7C279.2 6.7 263 0 246 0L96.5 0zM358 176l-93.5 0c-13.3 0-24-10.7-24-24L240.5 58.5 358 176zM224.5 328c0-13.3 10.7-24 24-24l104 0 0 48-104 0c-13.3 0-24-10.7-24-24z\"]\n};\nvar faArrowRightFromFile = faFileExport;\nvar faFaceGrimace = {\n  prefix: 'fas',\n  iconName: 'face-grimace',\n  icon: [512, 512, [128556, \"grimace\"], \"f57f\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM400 352c0 25.2-19.4 45.8-44 47.8l0-95.7c24.6 2 44 22.7 44 47.8zM276 304l40 0 0 96-40 0 0-96zm-80 96l0-96 40 0 0 96-40 0zm-40-95.8l0 95.7c-24.6-2-44-22.7-44-47.8s19.4-45.8 44-47.8zM144 208a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faGrimace = faFaceGrimace;\nvar faTrainSubway = {\n  prefix: 'fas',\n  iconName: 'train-subway',\n  icon: [384, 512, [\"subway\"], \"f239\", \"M0 96C0 43 43 0 96 0L288 0c53 0 96 43 96 96l0 256c0 40.1-24.6 74.5-59.5 88.8l53.9 63.7c8.6 10.1 7.3 25.3-2.8 33.8s-25.3 7.3-33.8-2.8l-74-87.5-151.3 0-74 87.5c-8.6 10.1-23.7 11.4-33.8 2.8s-11.4-23.7-2.8-33.8l53.9-63.7C24.6 426.5 0 392.1 0 352L0 96zm64 32l0 96c0 17.7 14.3 32 32 32l72 0 0-160-72 0c-17.7 0-32 14.3-32 32zM216 256l72 0c17.7 0 32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-72 0 0 160zM96 384a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm224-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\"]\n};\nvar faSubway = faTrainSubway;\nvar faCircleDot = {\n  prefix: 'fas',\n  iconName: 'circle-dot',\n  icon: [512, 512, [128280, \"dot-circle\"], \"f192\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z\"]\n};\nvar faDotCircle = faCircleDot;\nvar faObjectGroup = {\n  prefix: 'fas',\n  iconName: 'object-group',\n  icon: [576, 512, [], \"f247\", \"M32 119.4C12.9 108.4 0 87.7 0 64 0 28.7 28.7 0 64 0 87.7 0 108.4 12.9 119.4 32l337.1 0c11.1-19.1 31.7-32 55.4-32 35.3 0 64 28.7 64 64 0 23.7-12.9 44.4-32 55.4l0 273.1c19.1 11.1 32 31.7 32 55.4 0 35.3-28.7 64-64 64-23.7 0-44.4-12.9-55.4-32l-337.1 0c-11.1 19.1-31.7 32-55.4 32-35.3 0-64-28.7-64-64 0-23.7 12.9-44.4 32-55.4l0-273.1zm448 0c-9.7-5.6-17.8-13.7-23.4-23.4L119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4l0 273.1c9.7 5.6 17.8 13.7 23.4 23.4l337.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-273.1zM144 176c0-17.7 14.3-32 32-32l112 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-112 0c-17.7 0-32-14.3-32-32l0-64zM256 320l32 0c44.2 0 80-35.8 80-80l32 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-112 0c-17.7 0-32-14.3-32-32l0-16z\"]\n};\nvar faShip = {\n  prefix: 'fas',\n  iconName: 'ship',\n  icon: [640, 512, [128674], \"f21a\", \"M272 0c-26.5 0-48 21.5-48 48l0 16-16 0c-44.2 0-80 35.8-80 80l0 108.8-21.6 8.6c-14.8 5.9-22.5 22.4-17.4 37.5 10.4 31.3 26.8 59.3 47.7 83.1 20.1-9.2 41.7-13.9 63.3-14 33.1-.2 66.3 10.2 94.4 31.4l1.6 1.2 0-215-104 41.6 0-83.2c0-8.8 7.2-16 16-16l224 0c8.8 0 16 7.2 16 16l0 83.2-104-41.6 0 215 1.6-1.2c27.5-20.7 59.9-31.2 92.4-31.4 22.3-.1 44.6 4.5 65.3 14 20.9-23.7 37.3-51.8 47.7-83.1 5-15.2-2.6-31.6-17.4-37.5L512 252.8 512 144c0-44.2-35.8-80-80-80l-16 0 0-16c0-26.5-21.5-48-48-48L272 0zM403.4 476.1c21.3-16.1 49.9-16.1 71.2 0 19 14.4 41.9 28.2 67.2 33.3 26.5 5.4 54.3 .8 80.7-19.1 10.6-8 12.7-23 4.7-33.6s-23-12.7-33.6-4.7c-14.9 11.2-28.6 13.1-42.3 10.3-14.9-3-30.9-11.9-47.8-24.6-38.4-29-90.5-29-129 0-24 18.1-40.7 26.3-54.5 26.3s-30.5-8.2-54.5-26.3c-38.4-29-90.5-29-129 0-21.6 16.3-41.3 25.8-58.9 25.7-9.6-.1-19.9-3-31.2-11.5-10.6-8-25.6-5.9-33.6 4.7S7 482.3 17.6 490.3c19.1 14.4 39.4 21 59.8 21.1 33.9 .2 64.3-17.4 88.1-35.3 21.3-16.1 49.9-16.1 71.2 0 24.2 18.3 52.3 35.9 83.4 35.9s59.1-17.7 83.4-35.9z\"]\n};\nvar faC = {\n  prefix: 'fas',\n  iconName: 'c',\n  icon: [384, 512, [99], \"43\", \"M329.1 142.9c-62.5-62.5-155.8-62.5-218.3 0s-62.5 163.8 0 226.3 155.8 62.5 218.3 0c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3c-87.5 87.5-221.3 87.5-308.8 0s-87.5-229.3 0-316.8 221.3-87.5 308.8 0c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0z\"]\n};\nvar faSquarePhone = {\n  prefix: 'fas',\n  iconName: 'square-phone',\n  icon: [448, 512, [\"phone-square\"], \"f098\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm88 96.7c9.8-2.7 20.1 2.4 24 11.8l20.3 48.7c3.4 8.3 1.1 17.8-5.9 23.5l-22.1 18c16.2 35.8 44.5 65 79.6 82.4l19.3-23.6c5.7-6.9 15.2-9.3 23.5-5.9l48.7 20.3c9.4 3.9 14.4 14.2 11.8 24l-.8 2.8c-8.8 32.3-40.1 59.9-78.2 51.8-87.5-18.5-156.3-87.4-174.9-174.9-8.1-38.1 19.5-69.4 51.8-78.2l2.8-.8z\"]\n};\nvar faPhoneSquare = faSquarePhone;\nvar faRulerCombined = {\n  prefix: 'fas',\n  iconName: 'ruler-combined',\n  icon: [448, 512, [], \"f546\", \"M1 441.7C5.5 463.5 24.8 480 48 480l352 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-48 0 0 72c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-72-64 0 0 72c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-72-72 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l72 0 0-64-72 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l72 0 0-48c0-26.5-21.5-48-48-48L48 32C21.5 32 0 53.5 0 80L0 432c0 3.3 .3 6.6 1 9.7z\"]\n};\nvar faArrowsRotate = {\n  prefix: 'fas',\n  iconName: 'arrows-rotate',\n  icon: [512, 512, [128472, \"refresh\", \"sync\"], \"f021\", \"M65.9 228.5c13.3-93 93.4-164.5 190.1-164.5 53 0 101 21.5 135.8 56.2 .2 .2 .4 .4 .6 .6l7.6 7.2-47.9 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 53.4-11.3-10.7C390.5 28.6 326.5 0 256 0 127 0 20.3 95.4 2.6 219.5 .1 237 12.2 253.2 29.7 255.7s33.7-9.7 36.2-27.1zm443.5 64c2.5-17.5-9.7-33.7-27.1-36.2s-33.7 9.7-36.2 27.1c-13.3 93-93.4 164.5-190.1 164.5-53 0-101-21.5-135.8-56.2-.2-.2-.4-.4-.6-.6l-7.6-7.2 47.9 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 320c-8.5 0-16.7 3.4-22.7 9.5S-.1 343.7 0 352.3l1 127c.1 17.7 14.6 31.9 32.3 31.7S65.2 496.4 65 478.7l-.4-51.5 10.7 10.1c46.3 46.1 110.2 74.7 180.7 74.7 129 0 235.7-95.4 253.4-219.5z\"]\n};\nvar faRefresh = faArrowsRotate;\nvar faSync = faArrowsRotate;\nvar faPersonDress = {\n  prefix: 'fas',\n  iconName: 'person-dress',\n  icon: [384, 512, [\"female\"], \"f182\", \"M136 24a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zM112 384l-25.8 0c-10.9 0-18.6-10.7-15.2-21.1l43-129-48.3 65.1c-10.5 14.2-30.6 17.2-44.8 6.6s-17.2-30.6-6.6-44.8l70.5-95C110 132 149.7 112 192 112s82 20 107.2 53.9l70.5 95c10.5 14.2 7.6 34.2-6.6 44.8s-34.2 7.6-44.8-6.6L270 234 313 362.9c3.5 10.4-4.3 21.1-15.2 21.1l-25.8 0 0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128-32 0 0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128z\"]\n};\nvar faFemale = faPersonDress;\nvar faBookOpen = {\n  prefix: 'fas',\n  iconName: 'book-open',\n  icon: [512, 512, [128214, 128366], \"f518\", \"M256 141.3l0 309.3 .5-.2C311.1 427.7 369.7 416 428.8 416l19.2 0 0-320-19.2 0c-42.2 0-84.1 8.4-123.1 24.6-16.8 7-33.4 13.9-49.7 20.7zM230.9 61.5L256 72 281.1 61.5C327.9 42 378.1 32 428.8 32L464 32c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-35.2 0c-50.7 0-100.9 10-147.7 29.5l-12.8 5.3c-7.9 3.3-16.7 3.3-24.6 0l-12.8-5.3C184.1 490 133.9 480 83.2 480L48 480c-26.5 0-48-21.5-48-48L0 80C0 53.5 21.5 32 48 32l35.2 0c50.7 0 100.9 10 147.7 29.5z\"]\n};\nvar faFolderTree = {\n  prefix: 'fas',\n  iconName: 'folder-tree',\n  icon: [576, 512, [], \"f802\", \"M48 24C48 10.7 37.3 0 24 0S0 10.7 0 24L0 392c0 30.9 25.1 56 56 56l184 0 0-48-184 0c-4.4 0-8-3.6-8-8l0-232 192 0 0-48-192 0 0-88zM336 224l192 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-82.7 0c-8.5 0-16.6-3.4-22.6-9.4l-8.6-8.6c-9-9-21.2-14.1-33.9-14.1L336 0c-26.5 0-48 21.5-48 48l0 128c0 26.5 21.5 48 48 48zm0 288l192 0c26.5 0 48-21.5 48-48l0-96c0-26.5-21.5-48-48-48l-82.7 0c-8.5 0-16.6-3.4-22.6-9.4l-8.6-8.6c-9-9-21.2-14.1-33.9-14.1L336 288c-26.5 0-48 21.5-48 48l0 128c0 26.5 21.5 48 48 48z\"]\n};\nvar faVirgo = {\n  prefix: 'fas',\n  iconName: 'virgo',\n  icon: [640, 512, [], \"e850\", \"M368 32c61.9 0 112 50.1 112 112l0 26.8c14.5-6.9 30.8-10.8 48-10.8 61.9 0 112 50.1 112 112S589.9 384 528 384l-48 0 0 32c0 16.6 12.6 30.2 28.7 31.8l6.6 .3c16.1 1.6 28.7 15.3 28.7 31.8 0 17.7-14.3 32-32 32-53 0-96-43-96-96l0-32-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-176c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 304c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-304c0-26.5-21.5-48-48-48s-48 21.5-48 48l0 304c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-320c0-16.6-12.6-30.2-28.7-31.8l-6.6-.3C44.6 94.2 32 80.6 32 64 32 46.3 46.3 32 64 32 91 32 115.3 43.1 132.7 61 152.6 43 179 32 208 32 239.3 32 267.7 44.9 288 65.7 308.3 44.9 336.6 32 368 32zM528 224c-26.5 0-48 21.5-48 48l0 48 48 0c26.5 0 48-21.5 48-48s-21.5-48-48-48z\"]\n};\nvar faBoxArchive = {\n  prefix: 'fas',\n  iconName: 'box-archive',\n  icon: [512, 512, [\"archive\"], \"f187\", \"M0 64C0 46.3 14.3 32 32 32l448 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96L0 64zM32 176l448 0 0 240c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64l0-240zm152 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z\"]\n};\nvar faArchive = faBoxArchive;\nvar faTentArrowDownToLine = {\n  prefix: 'fas',\n  iconName: 'tent-arrow-down-to-line',\n  icon: [576, 512, [], \"e57e\", \"M185 121c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-31 31 0-102.1C120 2.7 109.3-8 96-8S72 2.7 72 16l0 102.1-31-31C31.6 77.7 16.4 77.7 7 87S-2.3 111.6 7 121l72 72c9.4 9.4 24.6 9.4 33.9 0l72-72zM155.8 260.6L132.1 448 32 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32 0-2.8-.4-5.5-1-8L548.2 260.7c-1.2-9.7-6.9-18.4-15.3-23.4L367.4 137.9c-10.2-6.1-22.9-6.1-33.1 .1L170.9 237.3c-8.3 5.1-13.9 13.7-15.1 23.3zM448 448l-97.1 0 0-149.4c0-5.9 4.7-10.6 10.6-10.6 4 0 7.7 2.3 9.5 5.9L448 448z\"]\n};\nvar faQrcode = {\n  prefix: 'fas',\n  iconName: 'qrcode',\n  icon: [448, 512, [], \"f029\", \"M64 160l64 0 0-64-64 0 0 64zM0 80C0 53.5 21.5 32 48 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48L0 80zM64 416l64 0 0-64-64 0 0 64zM0 336c0-26.5 21.5-48 48-48l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96zM320 96l0 64 64 0 0-64-64 0zM304 32l96 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48l-96 0c-26.5 0-48-21.5-48-48l0-96c0-26.5 21.5-48 48-48zM288 352a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0 64c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm96 32c0-17.7 14.3-32 32-32s32 14.3 32 32-14.3 32-32 32-32-14.3-32-32zm32-96a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm-32 32a32 32 0 1 1 -64 0 32 32 0 1 1 64 0z\"]\n};\nvar faDragon = {\n  prefix: 'fas',\n  iconName: 'dragon',\n  icon: [640, 512, [128009], \"f6d5\", \"M352 124.5l-51.9-13c-6.5-1.6-11.3-7.1-12-13.8s2.8-13.1 8.7-16.1l40.8-20.4-43.3-32.5c-5.5-4.1-7.8-11.3-5.6-17.9S297.1 0 304 0L464 0c30.2 0 58.7 14.2 76.8 38.4l57.6 76.8c6.2 8.3 9.6 18.4 9.6 28.8 0 26.5-21.5 48-48 48l-21.5 0c-17 0-33.3-6.7-45.3-18.7l-13.3-13.3-32 0 0 21.5c0 24.8 12.8 47.9 33.8 61.1l106.6 66.6c32.1 20.1 51.6 55.2 51.6 93.1 0 60.6-49.1 109.8-109.8 109.8L32.3 512c-3.3 0-6.6-.4-9.6-1.4-9.2-2.8-16.7-9.6-20.4-18.6-1.3-3.3-2.2-6.9-2.3-10.7-.2-3.7 .3-7.3 1.3-10.7 2.8-9.2 9.6-16.7 18.6-20.4 3-1.2 6.2-2 9.5-2.2L433.3 412c8.3-.7 14.7-7.7 14.7-16.1 0-4.3-1.7-8.4-4.7-11.4l-44.4-44.4c-30-30-46.9-70.7-46.9-113.1l0-102.5zM512 72.3c0-.1 0-.2 0-.3s0-.2 0-.3l0 .6zm-1.3 7.4L464.3 68.1c-.2 1.3-.3 2.6-.3 3.9 0 13.3 10.7 24 24 24 10.6 0 19.5-6.8 22.7-16.3zM130.9 116.5c16.3-14.5 40.4-16.2 58.5-4.1l130.6 87 0 27.5c0 32.8 8.4 64.8 24 93l-232 0c-6.7 0-12.7-4.2-15-10.4s-.5-13.3 4.6-17.7L171 232.3 18.4 255.8c-7 1.1-13.9-2.6-16.9-9S.1 232.8 5.4 228L130.9 116.5z\"]\n};\nvar faHourglassEnd = {\n  prefix: 'fas',\n  iconName: 'hourglass-end',\n  icon: [384, 512, [8987, \"hourglass-3\"], \"f253\", \"M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM96 75l0-11 192 0 0 11c0 25.5-10.1 49.9-28.1 67.9l-67.9 67.9-67.9-67.9C106.1 124.9 96 100.4 96 75z\"]\n};\nvar faHourglass3 = faHourglassEnd;\nvar faGrip = {\n  prefix: 'fas',\n  iconName: 'grip',\n  icon: [512, 512, [58119, \"grid-horizontal\", \"grip-horizontal\"], \"f58d\", \"M88 96c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0zM280 224l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40zm192 0l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40zm0 192l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40zM280 288c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0zM88 416l-48 0c-22.1 0-40-17.9-40-40l0-48c0-22.1 17.9-40 40-40l48 0c22.1 0 40 17.9 40 40l0 48c0 22.1-17.9 40-40 40z\"]\n};\nvar faGridHorizontal = faGrip;\nvar faGripHorizontal = faGrip;\nvar faBorderTopLeft = {\n  prefix: 'fas',\n  iconName: 'border-top-left',\n  icon: [448, 512, [\"border-style\"], \"f853\", \"M0 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-352 352 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L64 32C28.7 32 0 60.7 0 96L0 448zm128 0c0 17.7 14.3 32 32 32s32-14.3 32-32-14.3-32-32-32-32 14.3-32 32zm128 0c0 17.7 14.3 32 32 32s32-14.3 32-32-14.3-32-32-32-32 14.3-32 32zm160 32c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zM384 192a32 32 0 1 0 64 0 32 32 0 1 0 -64 0zm32 160a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faBorderStyle = faBorderTopLeft;\nvar faListUl = {\n  prefix: 'fas',\n  iconName: 'list-ul',\n  icon: [512, 512, [\"list-dots\"], \"f0ca\", \"M48 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM48 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM96 256a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z\"]\n};\nvar faListDots = faListUl;\nvar faPeopleRobbery = {\n  prefix: 'fas',\n  iconName: 'people-robbery',\n  icon: [576, 512, [], \"e536\", \"M488.2 59.1C478.1 99.6 441.7 128 400 128s-78.1-28.4-88.2-68.9L303 24.2C298.8 7.1 281.4-3.3 264.2 1S236.7 22.6 241 39.8l8.7 34.9c11 44 40.2 79.6 78.3 99.6L328 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-305.7c38.1-20 67.3-55.6 78.3-99.6L559 39.8c4.3-17.1-6.1-34.5-23.3-38.8S501.2 7.1 497 24.2l-8.7 34.9zM400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM80 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 32c-35.3 0-64 28.7-64 64l0 96 0 .6 0 191.4c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128 16 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-227.3 13 20.5c5.9 9.2 16.1 14.9 27 14.9l48 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-30.4 0-37.4-58.9C157.6 142 132.1 128 104.7 128L72 128z\"]\n};\nvar faMobileButton = {\n  prefix: 'fas',\n  iconName: 'mobile-button',\n  icon: [384, 512, [], \"f10b\", \"M80 0C44.7 0 16 28.7 16 64l0 384c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L80 0zM192 464c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z\"]\n};\nvar faArrowDownAZ = {\n  prefix: 'fas',\n  iconName: 'arrow-down-a-z',\n  icon: [512, 512, [\"sort-alpha-asc\", \"sort-alpha-down\"], \"f15d\", \"M230.6 390.6l-80 80c-12.5 12.5-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 25.4-25.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zm182-340.9c50.7 101.3 77.3 154.7 80 160 7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3l-7.2-14.3-88.4 0-7.2 14.3c-7.9 15.8-27.1 22.2-42.9 14.3s-22.2-27.1-14.3-42.9c2.7-5.3 29.3-58.7 80-160 5.4-10.8 16.5-17.7 28.6-17.7s23.2 6.8 28.6 17.7zM384 135.6l-20.2 40.4 40.4 0-20.2-40.4zM288 320c0-17.7 14.3-32 32-32l128 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9L397.3 416 448 416c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9l73.4-73.4-50.7 0c-17.7 0-32-14.3-32-32z\"]\n};\nvar faSortAlphaAsc = faArrowDownAZ;\nvar faSortAlphaDown = faArrowDownAZ;\nvar faMoneyBill = {\n  prefix: 'fas',\n  iconName: 'money-bill',\n  icon: [512, 512, [], \"f0d6\", \"M64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 64zm192 96a96 96 0 1 1 0 192 96 96 0 1 1 0-192zm192 24c0 4.4-3.6 8.1-8 7.5-29-3.6-51.9-26.6-55.5-55.5-.5-4.4 3.1-8 7.5-8l48 0c4.4 0 8 3.6 8 8l0 48zM64 328c0-4.4 3.6-8.1 8-7.5 29 3.6 51.9 26.6 55.5 55.5 .5 4.4-3.1 8-7.5 8l-48 0c-4.4 0-8-3.6-8-8l0-48zm8-136.5c-4.4 .5-8-3.1-8-7.5l0-48c0-4.4 3.6-8 8-8l48 0c4.4 0 8.1 3.6 7.5 8-3.6 29-26.6 51.9-55.5 55.5zm368 129c4.4-.5 8 3.1 8 7.5l0 48c0 4.4-3.6 8-8 8l-48 0c-4.4 0-8.1-3.6-7.5-8 3.6-29 26.6-51.9 55.5-55.5z\"]\n};\nvar faCircleMinus = {\n  prefix: 'fas',\n  iconName: 'circle-minus',\n  icon: [512, 512, [\"minus-circle\"], \"f056\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM168 232l176 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-176 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faMinusCircle = faCircleMinus;\nvar faArrowPointer = {\n  prefix: 'fas',\n  iconName: 'arrow-pointer',\n  icon: [448, 512, [\"mouse-pointer\"], \"f245\", \"M77.3 2.5c8.1-4.1 17.9-3.2 25.1 2.3l320 239.9c8.3 6.2 11.6 17 8.4 26.8s-12.4 16.4-22.8 16.4l-152.3 0 88.9 177.7c7.9 15.8 1.5 35-14.3 42.9s-35 1.5-42.9-14.3l-88.9-177.7-91.3 121.8c-6.2 8.3-17 11.6-26.8 8.4S64 434.3 64 424L64 24c0-9.1 5.1-17.4 13.3-21.5z\"]\n};\nvar faMousePointer = faArrowPointer;\nvar faSquareShareNodes = {\n  prefix: 'fas',\n  iconName: 'square-share-nodes',\n  icon: [448, 512, [\"share-alt-square\"], \"f1e1\", \"M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM368 160c0 35.3-28.7 64-64 64-15.4 0-29.5-5.4-40.6-14.5l-85.3 46.5 85.3 46.5c11-9.1 25.2-14.5 40.6-14.5 35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64c0-2.5 .1-4.9 .4-7.3L158.5 300c-11.7 12.3-28.2 20-46.5 20-35.3 0-64-28.7-64-64s28.7-64 64-64c18.3 0 34.8 7.7 46.5 20l81.9-44.7c-.3-2.4-.4-4.9-.4-7.3 0-35.3 28.7-64 64-64s64 28.7 64 64z\"]\n};\nvar faShareAltSquare = faSquareShareNodes;\nvar faTableCellsLarge = {\n  prefix: 'fas',\n  iconName: 'table-cells-large',\n  icon: [448, 512, [\"th-large\"], \"f009\", \"M384 96l-128 0 0 128 128 0 0-128zm64 128l0 192c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 128zM64 288l0 128 128 0 0-128-128 0zm128-64l0-128-128 0 0 128 128 0zm64 64l0 128 128 0 0-128-128 0z\"]\n};\nvar faThLarge = faTableCellsLarge;\nvar faCat = {\n  prefix: 'fas',\n  iconName: 'cat',\n  icon: [576, 512, [128008], \"f6be\", \"M64 96c53 0 96 43 96 96l0 85.8c29.7-44.7 77.8-76.2 133.4-84 25.6 60 85.2 102.1 154.6 102.1 10.9 0 21.6-1.1 32-3.1L480 480c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-140.8-136 108.8 56 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-144 0c-53 0-96-43-96-96l0-224c0-16.6-12.6-30.2-28.7-31.8l-6.6-.3C44.6 158.2 32 144.6 32 128 32 110.3 46.3 96 64 96zM533.8 3.2C544.2-5.5 560 1.9 560 15.5L560 128c0 61.9-50.1 112-112 112S336 189.9 336 128l0-112.5c0-13.6 15.8-21 26.2-12.3L416 48 480 48 533.8 3.2zM400 108a20 20 0 1 0 0 40 20 20 0 1 0 0-40zm96 0a20 20 0 1 0 0 40 20 20 0 1 0 0-40z\"]\n};\nvar faCalendarWeek = {\n  prefix: 'fas',\n  iconName: 'calendar-week',\n  icon: [448, 512, [], \"f784\", \"M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zm0 256c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l192 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-192 0z\"]\n};\nvar faCodeCompare = {\n  prefix: 'fas',\n  iconName: 'code-compare',\n  icon: [512, 512, [], \"e13a\", \"M198.8 1.8c9-3.7 19.3-1.7 26.2 5.2l56 56c9.4 9.4 9.4 24.6 0 33.9l-56 56c-6.9 6.9-17.2 8.9-26.2 5.2S184 145.7 184 136l0-24-24 0c-17.7 0-32 14.3-32 32l0 214.7c28.3 12.3 48 40.5 48 73.3 0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3L64 144c0-53 43-96 96-96l24 0 0-24c0-9.7 5.8-18.5 14.8-22.2zM392 80a24 24 0 1 0 48 0 24 24 0 1 0 -48 0zm-8 73.3c-28.3-12.3-48-40.5-48-73.3 0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3L448 368c0 53-43 96-96 96l-24 0 0 24c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-56-56c-9.4-9.4-9.4-24.6 0-33.9l56-56c6.9-6.9 17.2-8.9 26.2-5.2S328 366.3 328 376l0 24 24 0c17.7 0 32-14.3 32-32l0-214.7zM72 432a24 24 0 1 0 48 0 24 24 0 1 0 -48 0z\"]\n};\nvar faLeo = {\n  prefix: 'fas',\n  iconName: 'leo',\n  icon: [512, 512, [], \"e84a\", \"M260 0c72.9 0 132 59.1 132 132l0 5.4-.1 1.4-23.8 270c.4 21.7 18.2 39.2 40 39.2 22.1 0 40-17.9 40-40l0-40c0-17.7 14.3-32 32-32s32 14.3 32 32l0 40c0 57.4-46.6 104-104 104S304 465.4 304 408l0-1.4 .1-1.4 23.9-270.6 0-2.6c0-37.6-30.4-68-68-68s-68 30.4-68 68l0 4c0 3.7 .3 7.3 .8 11l29.7 193.4c.9 6.1 1.4 12.2 1.4 18.4l0 9.2c0 61.9-50.1 112-112 112S0 429.9 0 368 50.1 256 112 256c11.7 0 23 1.8 33.7 5.1L129.6 156.7c-1.1-6.8-1.6-13.8-1.6-20.7l0-4C128 59.1 187.1 0 260 0zM112 320a48 48 0 1 0 0 96 48 48 0 1 0 0-96z\"]\n};\nvar faRoadCircleXmark = {\n  prefix: 'fas',\n  iconName: 'road-circle-xmark',\n  icon: [640, 512, [], \"e566\", \"M287.9 32l-76.2 0c-29.4 0-55.1 20.1-62.1 48.6L65.4 420.5C57.9 450.7 80.8 480 112 480l209.4 0c-11.2-24.4-17.4-51.4-17.4-80 0-28.6 6.2-55.7 17.4-80-.5 0-1 0-1.6 0-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 49.2c35.2-40 86.7-65.2 144.2-65.2 9 0 17.8 .6 26.4 1.8l-32-129.2C483.4 52.1 457.8 32 428.3 32l-76.5 0 0 64c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-64zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7l-36.7 36.7 36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z\"]\n};\nvar faPallet = {\n  prefix: 'fas',\n  iconName: 'pallet',\n  icon: [576, 512, [], \"f482\", \"M32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 64-32 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-64 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 320zm96 64l128 0 0 64-128 0 0-64zm192 0l128 0 0 64-128 0 0-64z\"]\n};\nvar faCakeCandles = {\n  prefix: 'fas',\n  iconName: 'cake-candles',\n  icon: [448, 512, [127874, \"birthday-cake\", \"cake\"], \"f1fd\", \"M86.4-10.5L61.8 31.6C58 38.1 56 45.6 56 53.2L56 56c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L105.6-10.5c-2-3.4-5.7-5.5-9.6-5.5s-7.6 2.1-9.6 5.5zm128 0L189.8 31.6c-3.8 6.5-5.8 14-5.8 21.6l0 2.8c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L233.6-10.5c-2-3.4-5.7-5.5-9.6-5.5s-7.6 2.1-9.6 5.5zM317.8 31.6c-3.8 6.5-5.8 14-5.8 21.6l0 2.8c0 22.1 17.9 40 40 40s40-17.9 40-40l0-2.8c0-7.6-2-15-5.8-21.6L361.6-10.5c-2-3.4-5.7-5.5-9.6-5.5s-7.6 2.1-9.6 5.5L317.8 31.6zM128 160c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 53.5C26.7 226.6 0 262.2 0 304l0 20.8c20.9 1.3 41.6 7.3 60.3 18l7.1 4.1c26.3 15 58.9 13.4 83.6-4.2 43.7-31.2 102.3-31.2 146 0 24.6 17.6 57.3 19.3 83.6 4.2l7.1-4.1c18.7-10.7 39.3-16.7 60.3-18l0-20.8c0-41.8-26.7-77.4-64-90.5l0-53.5c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48-64 0 0-48c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 48-64 0 0-48zM448 373c-12.7 1.2-25.1 5-36.5 11.5l-7.1 4.1c-42.6 24.3-95.4 21.7-135.3-6.8-27-19.3-63.2-19.3-90.2 0-39.9 28.5-92.7 31.2-135.3 6.8l-7.1-4.1C25.1 378 12.7 374.1 0 373l0 75c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-75z\"]\n};\nvar faBirthdayCake = faCakeCandles;\nvar faCake = faCakeCandles;\nvar faBugSlash = {\n  prefix: 'fas',\n  iconName: 'bug-slash',\n  icon: [576, 512, [], \"e490\", \"M7-24.9c9.4-9.4 24.6-9.4 33.9 0L241.8 176 344 176c14.2 0 27.7 2.8 40 8l108.8-81.6c14.1-10.6 34.2-7.7 44.8 6.4s7.7 34.2-6.4 44.8l-97.8 73.3c5.3 8.9 9.3 18.7 11.8 29.1l98.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0 0 32c0 9.5-.8 18.7-2.4 27.8L569 503.1c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L7 9.1C-2.3-.3-2.3-15.5 7-24.9zM398.2 468c-23.2 22.1-53 37.2-86.2 42.2l0-128.4 86.2 86.2zM264 333.8l0 176.4c-51.2-7.7-94.5-39.7-117.7-83.9L83.2 473.6c-14.1 10.6-34.2 7.7-44.8-6.4s-7.7-34.2 6.4-44.8l83.4-62.5c-.1-2.6-.2-5.2-.2-7.9l0-32-96 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l98.8 0c3.3-13.9 9.3-26.7 17.6-37.8L264 333.8zM355.6 128l-82.4 0-72.3-72.3C216.1 22.8 249.4 0 288 0 341 0 384 43 384 96l0 3.6c0 15.7-12.7 28.4-28.4 28.4z\"]\n};\nvar faTarp = {\n  prefix: 'fas',\n  iconName: 'tarp',\n  icon: [512, 512, [], \"e57b\", \"M448 64c35.3 0 64 28.7 64 64l0 149.5c0 17-6.7 33.3-18.7 45.3L386.7 429.3c-12 12-28.3 18.7-45.3 18.7L64 448c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l384 0zm5.5 208L360 272c-13.3 0-24 10.7-24 24l0 93.5 117.5-117.5zM96 192a32 32 0 1 0 0-64 32 32 0 1 0 0 64z\"]\n};\nvar faDiagramPredecessor = {\n  prefix: 'fas',\n  iconName: 'diagram-predecessor',\n  icon: [448, 512, [], \"e477\", \"M289.2 137.9c2.5-6 8.3-9.9 14.8-9.9l40 0 0-24c0-13.3-10.7-24-24-24l-98 0c1.3 5.1 2 10.5 2 16l0 64c0 35.3-28.7 64-64 64l-96 0c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l256 0c39.8 0 72 32.2 72 72l0 24 40 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-64 64c-6.2 6.2-16.4 6.2-22.6 0l-64-64c-4.6-4.6-5.9-11.5-3.5-17.4zM384 352l-320 0 0 64 320 0 0-64zm64 64c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l320 0c35.3 0 64 28.7 64 64l0 64z\"]\n};\nvar faFaceFlushed = {\n  prefix: 'fas',\n  iconName: 'face-flushed',\n  icon: [512, 512, [128563, \"flushed\"], \"f579\", \"M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM168 392c0 13.3 10.7 24 24 24l128 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-128 0c-13.3 0-24 10.7-24 24zm-8-96a72 72 0 1 0 0-144 72 72 0 1 0 0 144zm264-72a72 72 0 1 0 -144 0 72 72 0 1 0 144 0zm-288 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zm192 0a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z\"]\n};\nvar faFlushed = faFaceFlushed;\nvar faDiagramNext = {\n  prefix: 'fas',\n  iconName: 'diagram-next',\n  icon: [448, 512, [], \"e476\", \"M384 224c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l128 0 0 64-32 0c-6.5 0-12.3 3.9-14.8 9.9s-1.1 12.9 3.5 17.4l64 64c6.2 6.2 16.4 6.2 22.6 0l64-64c4.6-4.6 5.9-11.5 3.5-17.4S294.5 288 288 288l-32 0 0-64 128 0zM64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64l-34 0c5.6 21.7-.5 45.1-16.7 61.3l-64 64c-25 25-65.5 25-90.5 0l-64-64C98.6 333.1 92.4 309.7 98 288l-34 0z\"]\n};\nvar faAnchorCircleXmark = {\n  prefix: 'fas',\n  iconName: 'anchor-circle-xmark',\n  icon: [640, 512, [], \"e4ac\", \"M320.5 96a32 32 0 1 1 -64 0 32 32 0 1 1 64 0zm-32-96c-53 0-96 43-96 96 0 41.8 26.7 77.4 64 90.5l0 257.9c-62.9-14.3-110.2-69.7-111.9-136.5l16.1 14.1c10 8.7 25.1 7.7 33.9-2.3s7.7-25.1-2.3-33.9l-64-56c-9-7.9-22.6-7.9-31.6 0l-64 56c-10 8.7-11 23.9-2.3 33.9s23.9 11 33.9 2.3l16.2-14.2c2.1 113.1 94.4 204.1 208 204.1 16.6 0 32.7-1.9 48.2-5.6-20.3-30.5-32.2-67-32.2-106.4 0-27.3 5.7-53.3 16-76.9l0-136.6c37.3-13.2 64-48.7 64-90.5 0-53-43-96-96-96zm208 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm59.3-180.7l-36.7 36.7 36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6z\"]\n};\nvar faPersonCircleXmark = {\n  prefix: 'fas',\n  iconName: 'person-circle-xmark',\n  icon: [640, 512, [], \"e543\", \"M280 24a56 56 0 1 0 -112 0 56 56 0 1 0 112 0zm24 212.7L341 286.6c12.8-17.5 28.5-32.7 46.3-45l-56.2-75.7C306 132 266.3 112 224 112s-82 20-107.2 53.9l-70.5 95c-10.5 14.2-7.6 34.2 6.6 44.8s34.2 7.6 44.8-6.6L144 236.7 144 512c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-8.8 7.2-16 16-16s16 7.2 16 16l0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-275.3zM496 544a144 144 0 1 0 0-288 144 144 0 1 0 0 288zm22.6-144l36.7 36.7c6.2 6.2 6.2 16.4 0 22.6s-16.4 6.2-22.6 0l-36.7-36.7-36.7 36.7c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l36.7-36.7-36.7-36.7c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l36.7 36.7 36.7-36.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6L518.6 400z\"]\n};\nvar faSpa = {\n  prefix: 'fas',\n  iconName: 'spa',\n  icon: [576, 512, [], \"f5bb\", \"M169.7 227.5c34.3 18.7 64.5 44.1 88.8 74.5 11.1 13.9 21 28.9 29.4 44.8 8.5-15.9 18.3-30.8 29.4-44.8 24.3-30.5 54.5-55.9 88.8-74.5 41.7-22.7 89.4-35.5 139.7-35.5l9.9 0c11.1 0 20.1 9 20.1 20.1 0 148-119.9 267.9-267.9 267.9l-40.2 0C119.9 480 0 360.1 0 212.1 0 201 9 192 20.1 192l9.9 0c50.4 0 98.1 12.8 139.7 35.5zM303.9 38c16.9 15.9 61.4 63.4 89 142.3-40.1 20.2-75.8 48.2-104.9 82.1-29.2-33.9-64.8-61.8-104.9-82.1 27.6-78.9 72.2-126.4 89-142.3 4.3-4.1 10-6 15.9-6s11.6 2 15.9 6z\"]\n};\nvar faAries = {\n  prefix: 'fas',\n  iconName: 'aries',\n  icon: [512, 512, [], \"e846\", \"M401.6 0c61.3 0 110.4 50.3 110.4 111 0 29.4-11.6 57.9-32.6 78.8l-8.8 8.8c-12.5 12.5-32.8 12.5-45.2 0s-12.5-32.8 0-45.2l8.8-8.8c8.8-8.8 13.8-21 13.8-33.6 0-25.9-21.1-47-46.4-47-22.5 0-41.7 16.1-45.7 38.2L287.5 485.6c0 .1-.1 .3-.1 .4-.2 .8-.3 1.6-.5 2.3-.1 .3-.1 .5-.2 .7-.2 .6-.4 1.3-.7 1.9-.2 .5-.4 1-.6 1.5-.1 .3-.3 .6-.4 .9-1.6 3.5-3.8 6.5-6.4 9.2-2 2-4.2 3.7-6.6 5.1-.2 .1-.3 .2-.5 .3-.7 .4-1.4 .7-2.1 1-.3 .1-.6 .3-.9 .4-.5 .2-1 .4-1.5 .6-.6 .2-1.2 .5-1.9 .7-.2 .1-.5 .2-.7 .2-.8 .2-1.6 .4-2.3 .5-.2 0-.3 .1-.4 .1-.2 0-.4 0-.6 .1-.7 .1-1.3 .2-2 .2-.4 0-.8 .1-1.2 .1-.6 0-1.2 .1-1.8 .1-.6 0-1.2 0-1.8-.1-.4 0-.8-.1-1.2-.1-.7-.1-1.4-.1-2-.2-.2 0-.4 0-.6-.1-.2 0-.3-.1-.5-.1-.8-.2-1.6-.3-2.3-.5-.3-.1-.5-.1-.8-.2-.6-.2-1.3-.4-1.9-.7-.5-.2-1-.4-1.5-.6-.3-.1-.6-.3-.9-.4-.7-.3-1.4-.7-2.1-1-.2-.1-.3-.2-.5-.3-2.4-1.4-4.7-3.1-6.6-5.1-2.6-2.6-4.8-5.7-6.4-9.2-.1-.2-.2-.3-.2-.5l-.5-1.1c-.1-.3-.2-.5-.3-.8-.2-.6-.5-1.2-.7-1.9-.1-.2-.2-.5-.2-.7-.2-.8-.4-1.6-.5-2.3 0-.1-.1-.3-.1-.4L156 102.2c-4-22.1-23.2-38.2-45.7-38.2-25.3 0-46.4 21.1-46.4 47 0 12.6 5 24.8 13.8 33.6l8.8 8.8c12.5 12.5 12.5 32.8 0 45.2s-32.8 12.5-45.2 0l-8.8-8.8C11.6 168.9 0 140.3 0 111 0 50.3 49.1 0 110.4 0 163.8 0 209.6 38.3 219 91l37 207 37-207c9.4-52.6 55.2-91 108.7-91z\"]\n};\nvar faBarsProgress = {\n  prefix: 'fas',\n  iconName: 'bars-progress',\n  icon: [448, 512, [\"tasks-alt\"], \"f828\", \"M288 160l96 0 0-64-96 0 0 64zM0 160L0 80C0 53.5 21.5 32 48 32l352 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48L48 224c-26.5 0-48-21.5-48-48l0-16zM160 416l224 0 0-64-224 0 0 64zM0 416l0-80c0-26.5 21.5-48 48-48l352 0c26.5 0 48 21.5 48 48l0 96c0 26.5-21.5 48-48 48L48 480c-26.5 0-48-21.5-48-48l0-16z\"]\n};\nvar faTasksAlt = faBarsProgress;\nvar faHeartCircleCheck = {\n  prefix: 'fas',\n  iconName: 'heart-circle-check',\n  icon: [576, 512, [], \"e4fd\", \"M241 87.1l15 20.7 15-20.7C296 52.5 336.2 32 378.9 32 452.4 32 512 91.6 512 165.1l0 2.6c0 17.6-3.4 35.6-9.5 53.7-21.8-8.6-45.6-13.4-70.5-13.4-106 0-192 86-192 192 0 28.5 6.2 55.6 17.4 80-.5 0-.9 0-1.4 0-15.5 0-30.8-4.6-43.1-14.1-73-55.7-212.9-186-212.9-298.2l0-2.6C0 91.6 59.6 32 133.1 32 175.8 32 216 52.5 241 87.1zM288 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm201.4-60.9c-7.1-5.2-17.2-3.6-22.4 3.5l-53 72.9-26.8-26.8c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c3.3 3.3 7.9 5 12.6 4.6s8.9-2.8 11.7-6.5l64-88c5.2-7.1 3.6-17.2-3.5-22.3z\"]\n};\nvar faMarsStrokeRight = {\n  prefix: 'fas',\n  iconName: 'mars-stroke-right',\n  icon: [640, 512, [9897, \"mars-stroke-h\"], \"f22b\", \"M320.5 256a112 112 0 1 0 -224 0 112 112 0 1 0 224 0zM208.5 80c86.3 0 158.1 62.1 173.1 144.1 1-.1 1.9-.1 2.9-.1l16 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 61.4 0-22.4-28c-11-13.8-8.8-33.9 5-45s33.9-8.8 45 5l64 80c9.3 11.7 9.3 28.3 0 40l-64 80c-11 13.8-31.2 16-45 5s-16-31.2-5-45l22.4-28-61.4 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-16 0c-1 0-1.9 0-2.9-.1-15 82-86.8 144.1-173.1 144.1-97.2 0-176-78.8-176-176s78.8-176 176-176z\"]\n};\nvar faMarsStrokeH = faMarsStrokeRight;\nvar faTowerObservation = {\n  prefix: 'fas',\n  iconName: 'tower-observation',\n  icon: [448, 512, [], \"e586\", \"M209.7 3.4c9-4.5 19.6-4.5 28.6 0l160 80c15.8 7.9 22.2 27.1 14.3 42.9-5.6 11.2-16.9 17.7-28.6 17.7l0 80c0 17.7-14.3 32-32 32l-13 0 32 192 45 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32s14.3-32 32-32l45 0 32-192-13 0c-17.7 0-32-14.3-32-32l0-80c-11.7 0-23-6.5-28.6-17.7-7.9-15.8-1.5-35 14.3-42.9l160-80zM310.7 448l-86.7-61.9-86.7 61.9 173.4 0zm-153-192l-3.5 21.2 69.9 49.9 69.9-49.9-3.5-21.2-132.7 0zm-12.3 73.9l-10.1 60.6 47.5-33.9-37.4-26.7zm119.9 26.7l47.5 33.9-10.1-60.6-37.4 26.7zM152 128c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z\"]\n};\nvar faSterlingSign = {\n  prefix: 'fas',\n  iconName: 'sterling-sign',\n  icon: [384, 512, [163, \"gbp\", \"pound-sign\"], \"f154\", \"M91.3 288l-34.8 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l21.4 0C37.3 147.3 105.1 42 207.6 42l8.2 0c33.6 0 66.2 11.3 92.5 32.2l16.1 12.7c13.9 11 16.2 31.1 5.2 45s-31.1 16.2-45 5.2l-16.1-12.7c-15-11.9-33.6-18.4-52.8-18.4l-8.2 0c-57.3 0-94.7 59.9-69.7 111.4 3.6 7.4 6.6 14.9 9.1 22.6l149.5 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-141.2 0c1 35.3-8.7 70.6-28.9 100.9l-18.1 27.1 212.2 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-272 0c-11.8 0-22.6-6.5-28.2-16.9s-5-23 1.6-32.9l51.2-76.8c13.1-19.6 19.2-42.6 18.2-65.4z\"]\n};\nvar faGbp = faSterlingSign;\nvar faPoundSign = faSterlingSign;\nvar faFaucetDrip = {\n  prefix: 'fas',\n  iconName: 'faucet-drip',\n  icon: [512, 512, [128688], \"e006\", \"M224 32c-17.7 0-32 14.3-32 32L96 64C78.3 64 64 78.3 64 96s14.3 32 32 32l96 0 0 64-18.7 0c-8.5 0-16.6 3.4-22.6 9.4L128 224 32 224c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l100.1 0c20.2 29 53.9 48 91.9 48s71.7-19 91.9-48l36.1 0c17.7 0 32 14.3 32 32s14.3 32 32 32l64 0c17.7 0 32-14.3 32-32 0-88.4-71.6-160-160-160l-32 0-22.6-22.6c-6-6-14.1-9.4-22.6-9.4l-18.7 0 0-64 96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c0-17.7-14.3-32-32-32zM436.8 455.4l-18.2 42.4c-1.8 4.1-2.7 8.6-2.7 13.1l0 1.2c0 17.7 14.3 32 32 32s32-14.3 32-32l0-1.2c0-4.5-.9-8.9-2.7-13.1l-18.2-42.4c-1.9-4.5-6.3-7.4-11.2-7.4s-9.2 2.9-11.2 7.4z\"]\n};\nvar faCircleInfo = {\n  prefix: 'fas',\n  iconName: 'circle-info',\n  icon: [512, 512, [\"info-circle\"], \"f05a\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM224 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-8 64l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faInfoCircle = faCircleInfo;\nvar faFeather = {\n  prefix: 'fas',\n  iconName: 'feather',\n  icon: [512, 512, [129718], \"f52d\", \"M352 0c41 0 80.3 16.3 109.2 45.2l5.5 5.5c29 29 45.3 68.3 45.3 109.2 0 24.1-5.7 47.6-16.2 68.8-1.9 3.7-5.3 6.5-9.3 7.7L374.5 270c-3.9 1.2-6.5 4.7-6.5 8.8 0 5.1 4.1 9.2 9.2 9.2l32.2 0c14.3 0 21.4 17.2 11.3 27.3l-22.4 22.4c-1.9 1.9-4.2 3.2-6.7 4l-81 24.3c-3.9 1.2-6.5 4.7-6.5 8.8 0 5.1 4.1 9.2 9.2 9.2 13.2 0 18.9 15.7 7.8 22.9-41.1 26.6-89.3 41.1-139 41.1l-86 0-48 48c-8.8 8.8-23.2 8.8-32 0s-8.8-23.2 0-32L256 224c8.8-8.8 8.8-23.2 0-32s-23.2-8.8-32 0L79.5 336.5c-5.7 5.7-15.5 1.7-15.5-6.4 0-67.9 27-133 75-181L242.8 45.2C271.7 16.3 311 0 352 0z\"]\n};\nvar faBowlRice = {\n  prefix: 'fas',\n  iconName: 'bowl-rice',\n  icon: [512, 512, [], \"e2eb\", \"M176 40c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm24 48l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM56 160l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM0 283.4C0 268.3 12.3 256 27.4 256l457.1 0c15.1 0 27.4 12.3 27.4 27.4 0 70.5-44.4 130.7-106.7 154.1L403.5 452c-2 16-15.6 28-31.8 28l-231.5 0c-16.1 0-29.8-12-31.8-28l-1.8-14.4C44.4 414.1 0 353.9 0 283.4zM224 184c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zm-96 0c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zM104 88l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm216 96c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zM296 88l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm120 96c0-13.3 10.7-24 24-24l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24zM392 88l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zM296 16l16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"]\n};\nvar faStarHalfStroke = {\n  prefix: 'fas',\n  iconName: 'star-half-stroke',\n  icon: [576, 512, [\"star-half-alt\"], \"f5c0\", \"M288.1 353.6c10 0 19.9 2.3 29 7l74.4 37.9-13-82.5c-3.2-20.2 3.5-40.7 17.9-55.2l59-59.1-82.5-13.1c-20.2-3.2-37.7-15.9-47-34.1l-38-74.4 0 273.6zM457.4 489c-7.3 5.3-17 6.1-25 2L288.1 417.6 143.8 491c-8 4.1-17.7 3.3-25-2s-11-14.2-9.6-23.2L134.4 305.9 20 191.4c-6.4-6.4-8.6-15.8-5.8-24.4s10.1-14.9 19.1-16.3l159.9-25.4 73.6-144.2c4.1-8 12.4-13.1 21.4-13.1s17.3 5.1 21.4 13.1L383 125.3 542.9 150.7c8.9 1.4 16.3 7.7 19.1 16.3s.5 18-5.8 24.4L441.7 305.9 467 465.8c1.4 8.9-2.3 17.9-9.6 23.2z\"]\n};\nvar faStarHalfAlt = faStarHalfStroke;\nvar faTemperatureArrowDown = {\n  prefix: 'fas',\n  iconName: 'temperature-arrow-down',\n  icon: [512, 512, [\"temperature-down\"], \"e03f\", \"M64.5 96c0-53 43-96 96-96s96 43 96 96l0 164.7c29.5 26.4 48 64.7 48 107.3 0 79.5-64.5 144-144 144s-144-64.5-144-144c0-42.6 18.5-81 48-107.3L64.5 96zm96 336c35.3 0 64-28.7 64-64 0-26.9-16.5-49.9-40-59.3l0-28.7c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 28.7c-23.5 9.5-40 32.5-40 59.3 0 35.3 28.7 64 64 64zM439.1 310.6c-6 6-14.1 9.4-22.6 9.4s-16.6-3.4-22.6-9.4l-64-64c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l9.4 9.4 0-178.7c0-17.7 14.3-32 32-32s32 14.3 32 32l0 178.7 9.4-9.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-64 64z\"]\n};\nvar faTemperatureDown = faTemperatureArrowDown;\nvar faMaskVentilator = {\n  prefix: 'fas',\n  iconName: 'mask-ventilator',\n  icon: [640, 512, [], \"e524\", \"M152.2 192c-15.4 38.3-24.2 77.2-24.2 108.8 0 13.3 1.5 26.2 4.4 38.7l-17-3.4c-29.9-6-51.4-32.2-51.4-62.8l0-81.3 88.2 0zm32.9-64L64 128c-35.3 0-64 28.7-64 64l0 81.3c0 61 43.1 113.5 102.9 125.5l66.3 13.3c18.7 22.1 42.9 40 70.8 51.8l0-87.8c-10.1-14.2-16-31.3-16-49.7 0-49.5 43-134.4 96-134.4 52.5 0 96 84.9 96 134.4 0 18.4-5.9 35.4-16 49.6l0 87.7c27.6-11.8 51.7-29.6 70.4-51.6l66.7-13.3c59.8-12 102.9-64.5 102.9-125.5l0-81.3c0-35.3-28.7-64-64-64l-121.5 0c-34.8-54.2-82.5-96-134.5-96-52.6 0-100.2 41.8-134.9 96zm302.5 64l88.4 0 0 81.3c0 30.5-21.5 56.8-51.4 62.8l-17 3.4c2.9-12.4 4.5-25.4 4.5-38.7 0-31.6-8.9-70.5-24.4-108.8zM288 320l0 192 64 0 0-192c0-17.7-14.3-32-32-32s-32 14.3-32 32z\"]\n};\nvar faFileVideo = {\n  prefix: 'fas',\n  iconName: 'file-video',\n  icon: [384, 512, [], \"f1c8\", \"M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM80 304l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-24 35 35c3.2 3.2 7.5 5 12 5 9.4 0 17-7.6 17-17l0-94.1c0-9.4-7.6-17-17-17-4.5 0-8.8 1.8-12 5l-35 35 0-24c0-17.7-14.3-32-32-32l-96 0c-17.7 0-32 14.3-32 32z\"]\n};\nvar faArrowTrendDown = {\n  prefix: 'fas',\n  iconName: 'arrow-trend-down',\n  icon: [576, 512, [], \"e097\", \"M384 352c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-160c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 82.7-169.4-169.4c-12.5-12.5-32.8-12.5-45.3 0L192 242.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0L320 205.3 466.7 352 384 352z\"]\n};\nvar faOilCan = {\n  prefix: 'fas',\n  iconName: 'oil-can',\n  icon: [640, 512, [], \"f613\", \"M320 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0 0 32-176 0c-26.5 0-48 21.5-48 48l0 64.8c0 19 11.2 36.2 28.5 43.9l67.5 30 0 21.3c0 26.5 21.5 48 48 48l259.1 0c18.4 0 35.8-7.9 48-21.7L633.5 187.7c12.3-13.9-.3-35.4-18.4-31.5L448 192 397.5 166.8c-8.9-4.4-18.7-6.8-28.6-6.8l-80.9 0 0-32 32 0zM96 208l0 86.1-48-21.3 0-64.8 48 0z\"]\n};\nvar faPeopleCarryBox = {\n  prefix: 'fas',\n  iconName: 'people-carry-box',\n  icon: [576, 512, [\"people-carry\"], \"f4ce\", \"M64-32A56 56 0 1 1 64 80 56 56 0 1 1 64-32zM0 171.1c0-32.6 26.5-59.1 59.1-59.1 23.5 0 45.5 11.3 59.1 30.4l48.7 68.2c5.8 8.2 15.1 13.1 25.1 13.4l0-96c0-17.7 14.3-32 32-32l128 0c17.7 0 32 14.3 32 32l0 96c10-.3 19.3-5.2 25.1-13.4l48.7-68.2c13.6-19.1 35.6-30.4 59.1-30.4 32.6 0 59.1 26.5 59.1 59.1L576 272c0 30.2-14.2 58.7-38.4 76.8l-76.8 57.6c-8.1 6-12.8 15.5-12.8 25.6l0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-80c0-30.2 14.2-58.7 38.4-76.8l41.6-31.2 0-80.1-2.8 3.9c-18 25.2-47.1 40.2-78.1 40.2L352 288c-.6 0-1.3 0-1.9-.1-.6 0-1.3 .1-1.9 .1l-120.4 0c-.6 0-1.3 0-1.9-.1-.6 0-1.3 .1-1.9 .1l-31.1 0c-31 0-60.1-15-78.1-40.2l-2.8-3.9 0 80.1 41.6 31.2C177.8 373.3 192 401.8 192 432l0 80c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-80c0-10.1-4.7-19.6-12.8-25.6L38.4 348.8C14.2 330.7 0 302.2 0 272L0 171.1zM0 379.3c3.1 2.7 6.3 5.4 9.6 7.9L64 428 64 512c0 17.7-14.3 32-32 32S0 529.7 0 512L0 379.3zM568 24a56 56 0 1 1 -112 0 56 56 0 1 1 112 0zm8 488c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-84 54.4-40.8c3.3-2.5 6.5-5.1 9.6-7.9L576 512z\"]\n};\nvar faPeopleCarry = faPeopleCarryBox;\nvar faChair = {\n  prefix: 'fas',\n  iconName: 'chair',\n  icon: [448, 512, [129681], \"f6c0\", \"M152 256l0-181.8c-24.5 20.5-40 51.4-40 85.8l0 96 40 0zm48 0l48 0 0-205.4c-7.7-1.7-15.8-2.6-24-2.6s-16.3 .9-24 2.6L200 256zM296 74.2l0 181.8 40 0 0-96c0-34.4-15.5-65.2-40-85.8zM32 256l32 0 0-96C64 71.6 135.6 0 224 0S384 71.6 384 160l0 96 32 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96-256 0 0 96c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-96c-17.7 0-32-14.3-32-32l0-64c0-17.7 14.3-32 32-32z\"]\n};\nvar faWind = {\n  prefix: 'fas',\n  iconName: 'wind',\n  icon: [512, 512, [], \"f72e\", \"M288 32c0 17.7 14.3 32 32 32l40 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L32 112c-17.7 0-32 14.3-32 32s14.3 32 32 32l328 0c48.6 0 88-39.4 88-88S408.6 0 360 0L320 0c-17.7 0-32 14.3-32 32zm64 352c0 17.7 14.3 32 32 32l32 0c53 0 96-43 96-96s-43-96-96-96L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32 14.3-32 32zM128 512l40 0c48.6 0 88-39.4 88-88s-39.4-88-88-88L32 336c-17.7 0-32 14.3-32 32s14.3 32 32 32l136 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-40 0c-17.7 0-32 14.3-32 32s14.3 32 32 32z\"]\n};\nvar faLayerGroup = {\n  prefix: 'fas',\n  iconName: 'layer-group',\n  icon: [512, 512, [], \"f5fd\", \"M232.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 149.8C5.4 145.8 0 137.3 0 128s5.4-17.9 13.9-21.8L232.5 5.2zM48.1 218.4l164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 277.8C5.4 273.8 0 265.3 0 256s5.4-17.9 13.9-21.8l34.1-15.8zM13.9 362.2l34.1-15.8 164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 405.8C5.4 401.8 0 393.3 0 384s5.4-17.9 13.9-21.8z\"]\n};\nvar faHeadSideMask = {\n  prefix: 'fas',\n  iconName: 'head-side-mask',\n  icon: [512, 512, [], \"e063\", \"M445.9 193c-.1-.4-.2-.9-.2-1.3-15.7-108.4-108.9-191.7-221.7-191.7-85 0-159 47.4-196.9 117.2L283.3 288 456 288 442.9 336 336 336c-8.8 0-16 7.2-16 16s7.2 16 16 16l98.2 0-8.7 32-89.5 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l80.6 0c-6.7 19.1-24.8 32-45.3 32L288 464c-17.7 0-32-14.3-32-32l0-104.5-247.5-165C3 182.1 0 202.7 0 224 0 278 19.1 327.5 50.9 366.2 58.9 375.9 64 387.8 64 400.4L64 464c0 26.5 21.5 48 48 48l127.3 0 .7 0 131.3 0c44.9 0 83.8-31.1 93.6-74.9l33.9-150.3c3.3-14.4-.3-29.5-9.7-41L445.9 193zM288 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z\"]\n};\nvar faHands = {\n  prefix: 'fas',\n  iconName: 'hands',\n  icon: [512, 512, [\"sign-language\", \"signing\"], \"f2a7\", \"M512 160l-.1 72.6c0 44.8-17.6 87.1-47.9 118.4-.3-77-40.1-148.4-105.4-189.3l-1.9-1.2c2.5-3.7 2.8-8.6 .4-12.7l-62-107.4c-6.6-11.5-2.7-26.2 8.8-32.8S330 5 336.6 16.5l68 117.8 0 0 0 0 43.3 75 .1-49.3c0-17.7 14.4-32 32-32s32 14.4 32 32zM298.4 124.2c-14.1-8.8-29.8-12.7-45.2-12.1L216.7 48.8c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8l67.1 116.2-27-16.9zM211.9 88.5l16.4 28.4c-15.1 5.5-28.6 15.6-38.3 29.7l-19.7-34.2c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8zm-46.4 63.7l12.5 21.7c-2 8.6-2.5 17.5-1.7 26.1l-4.3 0 0 0-34.4 0-13.7-23.8c-6.6-11.5-2.7-26.2 8.8-32.8s26.2-2.7 32.8 8.8zM228.9 175c9.4-15 29.1-19.5 44.1-10.2l60.2 37.6C384.7 234.7 416 291.2 416 352l0 8c0 83.9-68.1 152-152 152L88 512c-13.3 0-24-10.7-24-24s10.7-24 24-24l92 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L56 440c-13.3 0-24-10.7-24-24s10.7-24 24-24l124 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L24 368c-13.3 0-24-10.7-24-24s10.7-24 24-24l156 0c6.6 0 12-5.4 12-12s-5.4-12-12-12L56 296c-13.3 0-24-10.7-24-24s10.7-24 24-24l136 0 0 0 0 0 93.2 0-46.2-28.9c-15-9.4-19.5-29.1-10.2-44.1z\"]\n};\nvar faSignLanguage = faHands;\nvar faSigning = faHands;\nvar faTablets = {\n  prefix: 'fas',\n  iconName: 'tablets',\n  icon: [512, 512, [], \"f490\", \"M495.3 76.6c-4.6-8.7-16.3-9.7-23.3-2.7L297.9 248c-7 7-6 18.7 2.7 23.3 20.1 10.7 43 16.7 67.4 16.7 79.5 0 144-64.5 144-144 0-24.3-6-47.3-16.7-67.4zM240.7 211.4c4.6 8.7 16.3 9.7 23.3 2.7L438.1 40c7-7 6-18.7-2.7-23.3-20.1-10.7-43-16.7-67.4-16.7-79.5 0-144 64.5-144 144 0 24.3 6 47.3 16.7 67.4zM144 224C79.2 224 24.4 266.8 6.3 325.6 3.4 335.1 11 344 20.9 344l246.2 0c9.9 0 17.5-8.9 14.6-18.4-.9-3-1.9-5.9-3-8.7-37.4-18.1-68-48-87-84.8-14.9-5.2-30.9-8.1-47.6-8.1zM281.7 410.4c2.9-9.5-4.7-18.4-14.6-18.4L20.9 392C11 392 3.4 400.9 6.3 410.4 24.4 469.2 79.2 512 144 512s119.6-42.8 137.7-101.6z\"]\n};\nvar faWeightHanging = {\n  prefix: 'fas',\n  iconName: 'weight-hanging',\n  icon: [512, 512, [], \"f5cd\", \"M224 96a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm122.5 32c3.5-10 5.5-20.8 5.5-32 0-53-43-96-96-96s-96 43-96 96c0 11.2 1.9 22 5.5 32l-21.8 0c-28.3 0-53.2 18.5-61.3 45.6L2.4 440.2C.8 445.4 0 450.8 0 456.2 0 487 25 512 55.8 512l400.4 0c30.8 0 55.8-25 55.8-55.8 0-5.4-.8-10.8-2.4-16l-80-266.5c-8.1-27.1-33-45.6-61.3-45.6l-21.8 0z\"]\n};\nvar faDice = {\n  prefix: 'fas',\n  iconName: 'dice',\n  icon: [512, 512, [127922], \"f522\", \"M141.4 2.3C103-8 63.5 14.8 53.3 53.2L2.5 242.7C-7.8 281.1 15 320.6 53.4 330.9l189.5 50.8c38.4 10.3 77.9-12.5 88.2-50.9l50.8-189.5c10.3-38.4-12.5-77.9-50.9-88.2L141.4 2.3zm23 205.7a32 32 0 1 1 55.4-32 32 32 0 1 1 -55.4 32zM79.2 220.3a32 32 0 1 1 32 55.4 32 32 0 1 1 -32-55.4zm185 96.4a32 32 0 1 1 -32-55.4 32 32 0 1 1 32 55.4zm9-208.4a32 32 0 1 1 32 55.4 32 32 0 1 1 -32-55.4zm-121 14.4a32 32 0 1 1 -32-55.4 32 32 0 1 1 32 55.4zM418 192L377.4 343.2c-17.2 64-83 102-147 84.9l-38.3-10.3 0 30.2c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64L418 192z\"]\n};\nvar faShopSlash = {\n  prefix: 'fas',\n  iconName: 'shop-slash',\n  icon: [576, 512, [\"store-alt-slash\"], \"e070\", \"M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-57-57 0-190.3c26.8-1.9 48-24.3 48-51.6 0-8-1.9-16-5.5-23.2L497.7 67.4C486.8 45.7 464.7 32 440.4 32L135.6 32c-10.7 0-21 2.7-30.2 7.6L41-24.9zM321.8 256L448 256 448 382.2 321.8 256zM352 421.8l-64-64 0 10.2c0 8.8-7.2 16-16 16l-128 0c-8.8 0-16-7.2-16-16l0-112 58.2 0-134.8-134.8-29.9 59.9c-3.6 7.2-5.5 15.1-5.5 23.2 0 27.3 21.2 49.7 48 51.6L64 432c0 26.5 21.5 48 48 48l192 0c26.5 0 48-21.5 48-48l0-10.2z\"]\n};\nvar faStoreAltSlash = faShopSlash;\nvar faSortDown = {\n  prefix: 'fas',\n  iconName: 'sort-down',\n  icon: [384, 512, [\"sort-desc\"], \"f0dd\", \"M32 288c-12.9 0-24.6 7.8-29.6 19.8S.2 333.5 9.4 342.6l160 160c12.5 12.5 32.8 12.5 45.3 0l160-160c9.2-9.2 11.9-22.9 6.9-34.9S364.9 288 352 288L32 288z\"]\n};\nvar faSortDesc = faSortDown;\nvar faPesetaSign = {\n  prefix: 'fas',\n  iconName: 'peseta-sign',\n  icon: [448, 512, [], \"e221\", \"M112 32C94.3 32 80 46.3 80 64l0 104-24 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 232c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 96 0c80.2 0 146.6-59 158.2-136l25.8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-25.8 0C386.6 91 320.2 32 240 32L112 32zM333 168l-189 0 0-72 96 0c44.7 0 82.3 30.6 93 72zM144 216l189 0c-10.7 41.4-48.2 72-93 72l-96 0 0-72z\"]\n};\nvar faTabletScreenButton = {\n  prefix: 'fas',\n  iconName: 'tablet-screen-button',\n  icon: [448, 512, [\"tablet-alt\"], \"f3fa\", \"M0 64C0 28.7 28.7 0 64 0L384 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM256 432a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM384 64l-320 0 0 288 320 0 0-288z\"]\n};\nvar faTabletAlt = faTabletScreenButton;\nvar faHandHoldingDollar = {\n  prefix: 'fas',\n  iconName: 'hand-holding-dollar',\n  icon: [576, 512, [\"hand-holding-usd\"], \"f4c0\", \"M288-16c-13.3 0-24 10.7-24 24l0 12-1.8 0c-36.6 0-66.2 29.7-66.2 66.2 0 33.4 24.9 61.6 58 65.7l61 7.6c5.1 .6 9 5 9 10.2 0 5.7-4.6 10.2-10.2 10.2L240 180c-15.5 0-28 12.5-28 28s12.5 28 28 28l24 0 0 12c0 13.3 10.7 24 24 24s24-10.7 24-24l0-12 1.8 0c36.6 0 66.2-29.7 66.2-66.2 0-33.4-24.9-61.6-58-65.7l-61-7.6c-5.1-.6-9-5-9-10.2 0-5.7 4.6-10.2 10.2-10.2L328 76c15.5 0 28-12.5 28-28s-12.5-28-28-28l-16 0 0-12c0-13.3-10.7-24-24-24zM109.3 341.5L66.7 384 32 384c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l320.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416 280 416c-13.3 0-24-10.7-24-24s10.7-24 24-24l72 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-152.2 0c-33.9 0-66.5 13.5-90.5 37.5z\"]\n};\nvar faHandHoldingUsd = faHandHoldingDollar;\nvar faShield = {\n  prefix: 'fas',\n  iconName: 'shield',\n  icon: [512, 512, [128737, \"shield-blank\"], \"f132\", \"M256 0c4.6 0 9.2 1 13.4 2.9L457.8 82.8c22 9.3 38.4 31 38.3 57.2-.5 99.2-41.3 280.7-213.6 363.2-16.7 8-36.1 8-52.8 0-172.4-82.5-213.1-264-213.6-363.2-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.9 1 251.4 0 256 0z\"]\n};\nvar faShieldBlank = faShield;\nvar faFaceLaugh = {\n  prefix: 'fas',\n  iconName: 'face-laugh',\n  icon: [512, 512, [\"laugh\"], \"f599\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM101.6 314c-3.7-13.7 7.5-26 21.7-26l265.4 0c14.2 0 25.4 12.3 21.7 26-18.5 68-80.6 118-154.4 118S120 382 101.6 314zM144 192a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"]\n};\nvar faLaugh = faFaceLaugh;\nvar faHandsHolding = {\n  prefix: 'fas',\n  iconName: 'hands-holding',\n  icon: [640, 512, [], \"f4c2\", \"M80 104c0-22.1-17.9-40-40-40S0 81.9 0 104L0 325.5c0 25.5 10.1 49.9 28.1 67.9L128 493.3c12 12 28.3 18.7 45.3 18.7l66.7 0c26.5 0 48-21.5 48-48l0-78.9c0-29.7-11.8-58.2-32.8-79.2l-25.3-25.3 0 0c-7.3-7.3-23.1-23.1-47.2-47.2-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3c24.1 24.1 39.9 39.9 47.2 47.2 11 11 9.2 29.2-3.7 37.8-9.7 6.5-22.7 5.2-31-3.1L98.7 309.5c-12-12-18.7-28.3-18.7-45.3L80 104zm480 0l0 160.2c0 17-6.7 33.3-18.7 45.3l-51.1 51.1c-8.3 8.3-21.3 9.6-31 3.1-12.9-8.6-14.7-26.9-3.7-37.8 7.3-7.3 23.1-23.1 47.2-47.2 12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-24.1 24.1-39.9 39.9-47.2 47.2l0 0-25.3 25.3c-21 21-32.8 49.5-32.8 79.2l0 78.9c0 26.5 21.5 48 48 48l66.7 0c17 0 33.3-6.7 45.3-18.7l99.9-99.9c18-18 28.1-42.4 28.1-67.9L640 104c0-22.1-17.9-40-40-40s-40 17.9-40 40z\"]\n};\nvar faCartShopping = {\n  prefix: 'fas',\n  iconName: 'cart-shopping',\n  icon: [640, 512, [128722, \"shopping-cart\"], \"f07a\", \"M24-16C10.7-16 0-5.3 0 8S10.7 32 24 32l45.3 0c3.9 0 7.2 2.8 7.9 6.6l52.1 286.3c6.2 34.2 36 59.1 70.8 59.1L456 384c13.3 0 24-10.7 24-24s-10.7-24-24-24l-255.9 0c-11.6 0-21.5-8.3-23.6-19.7l-5.1-28.3 303.6 0c30.8 0 57.2-21.9 62.9-52.2L568.9 69.9C572.6 50.2 557.5 32 537.4 32l-412.7 0-.4-2c-4.8-26.6-28-46-55.1-46L24-16zM208 512a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm224 0a48 48 0 1 0 0-96 48 48 0 1 0 0 96z\"]\n};\nvar faShoppingCart = faCartShopping;\nvar faOctagon = {\n  prefix: 'fas',\n  iconName: 'octagon',\n  icon: [512, 512, [128721], \"f306\", \"M188.6 .1c-17 0-33.3 6.7-45.3 18.7L19.2 143C7.2 155 .5 171.2 .5 188.2l0 135.6c0 17 6.7 33.3 18.7 45.3L143.4 493.2c12 12 28.3 18.7 45.3 18.7l135.6 0c17 0 33.3-6.7 45.3-18.7L493.6 369c12-12 18.7-28.3 18.7-45.3l0-135.6c0-17-6.7-33.3-18.7-45.3L369.5 18.8c-12-12-28.3-18.7-45.3-18.7L188.6 .1z\"]\n};\nvar faHandPointer = {\n  prefix: 'fas',\n  iconName: 'hand-pointer',\n  icon: [448, 512, [], \"f25a\", \"M128 40c0-22.1 17.9-40 40-40s40 17.9 40 40l0 148.2c8.5-7.6 19.7-12.2 32-12.2 20.6 0 38.2 13 45 31.2 8.8-9.3 21.2-15.2 35-15.2 25.3 0 46 19.5 47.9 44.3 8.5-7.7 19.8-12.3 32.1-12.3 26.5 0 48 21.5 48 48l0 112c0 70.7-57.3 128-128 128l-85.3 0c-5 0-9.9-.3-14.7-1-55.3-5.6-106.2-34-140-79L8 336c-13.3-17.7-9.7-42.7 8-56s42.7-9.7 56 8l56 74.7 0-322.7zM240 304c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96zm48-16c-8.8 0-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96c0-8.8-7.2-16-16-16zm80 16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 96c0 8.8 7.2 16 16 16s16-7.2 16-16l0-96z\"]\n};\nvar faRegistered = {\n  prefix: 'fas',\n  iconName: 'registered',\n  icon: [512, 512, [174], \"f25d\", \"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM200 144l80 0c39.8 0 72 32.2 72 72 0 28.9-17 53.8-41.6 65.3l30.2 50.3c6.8 11.4 3.1 26.1-8.2 32.9s-26.1 3.1-32.9-8.2l-41-68.3-34.4 0 0 56c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-176c0-13.3 10.7-24 24-24zm72 96l8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-56 0 0 48 48 0z\"]\n};\nvar faHouseSignal = {\n  prefix: 'fas',\n  iconName: 'house-signal',\n  icon: [576, 512, [], \"e012\", \"M515.9 240l-19.9 0 0 144c0 35.3-28.7 64-64 64l-137 0c-24-91.7-93.5-165-183-194.3l0-13.7-19.9 0c-15.5 0-28.1-12.6-28.1-28.1 0-7.6 3.1-14.9 8.6-20.2L276.5-4.9C283.9-12 293.7-16 304-16s20.1 4 27.5 11.1L535.4 191.7c5.5 5.3 8.6 12.6 8.6 20.2 0 15.5-12.6 28.1-28.1 28.1zM280 192c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0zM24 288c128.1 0 232 103.9 232 232 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM0 408c0-13.3 10.7-24 24-24 75.1 0 136 60.9 136 136 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88-13.3 0-24-10.7-24-24z\"]\n};\nvar faBangladeshiTakaSign = {\n  prefix: 'fas',\n  iconName: 'bangladeshi-taka-sign',\n  icon: [384, 512, [], \"e2e6\", \"M36 32.3C18.4 30.1 2.4 42.5 .3 60S10.5 93.6 28 95.8l7.9 1c16 2 28 15.6 28 31.8l0 31.5-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0 0 176c0 53 43 96 96 96l32 0c106 0 192-86 192-192l0-32c0-53-43-96-96-96l-16 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l16 0c17.7 0 32 14.3 32 32l0 32c0 70.7-57.3 128-128 128l-32 0c-17.7 0-32-14.3-32-32l0-176 40 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-40 0 0-31.5C128 80.1 92 39.2 43.9 33.2l-7.9-1z\"]\n};\nvar icons = {\n  fa0: fa0,\n  fa1: fa1,\n  fa2: fa2,\n  fa3: fa3,\n  fa4: fa4,\n  fa5: fa5,\n  fa6: fa6,\n  fa7: fa7,\n  fa8: fa8,\n  fa9: fa9,\n  faDollarSign: faDollarSign,\n  faDollar: faDollar,\n  faUsd: faUsd,\n  faDog: faDog,\n  faTruckMoving: faTruckMoving,\n  faRotate: faRotate,\n  faSyncAlt: faSyncAlt,\n  faSquareMinus: faSquareMinus,\n  faMinusSquare: faMinusSquare,\n  faAlignJustify: faAlignJustify,\n  faCalendarCheck: faCalendarCheck,\n  faFaceKiss: faFaceKiss,\n  faKiss: faKiss,\n  faKitchenSet: faKitchenSet,\n  faDna: faDna,\n  faChildReaching: faChildReaching,\n  faPaste: faPaste,\n  faFileClipboard: faFileClipboard,\n  faMeteor: faMeteor,\n  faGears: faGears,\n  faCogs: faCogs,\n  faFileCirclePlus: faFileCirclePlus,\n  faIcicles: faIcicles,\n  faArrowTrendUp: faArrowTrendUp,\n  faHexagonNodesBolt: faHexagonNodesBolt,\n  faQuestion: faQuestion,\n  faHandsBound: faHandsBound,\n  faPersonWalkingLuggage: faPersonWalkingLuggage,\n  faFileArrowDown: faFileArrowDown,\n  faFileDownload: faFileDownload,\n  faPersonBooth: faPersonBooth,\n  faLocust: faLocust,\n  faRightLong: faRightLong,\n  faLongArrowAltRight: faLongArrowAltRight,\n  faTruckDroplet: faTruckDroplet,\n  faHandHoldingMedical: faHandHoldingMedical,\n  faHandPointLeft: faHandPointLeft,\n  faCalculator: faCalculator,\n  faMinus: faMinus,\n  faSubtract: faSubtract,\n  faArrowUpZA: faArrowUpZA,\n  faSortAlphaUpAlt: faSortAlphaUpAlt,\n  faMicrophoneSlash: faMicrophoneSlash,\n  faSquarePen: faSquarePen,\n  faPenSquare: faPenSquare,\n  faPencilSquare: faPencilSquare,\n  faHandFist: faHandFist,\n  faFistRaised: faFistRaised,\n  faCommentSms: faCommentSms,\n  faSms: faSms,\n  faSimCard: faSimCard,\n  faScaleBalanced: faScaleBalanced,\n  faBalanceScale: faBalanceScale,\n  faCar: faCar,\n  faAutomobile: faAutomobile,\n  faCropSimple: faCropSimple,\n  faCropAlt: faCropAlt,\n  faMedal: faMedal,\n  faScroll: faScroll,\n  faFileExcel: faFileExcel,\n  faFilter: faFilter,\n  faDrum: faDrum,\n  faMapPin: faMapPin,\n  faScaleUnbalancedFlip: faScaleUnbalancedFlip,\n  faBalanceScaleRight: faBalanceScaleRight,\n  faArrowsToCircle: faArrowsToCircle,\n  faEnvelope: faEnvelope,\n  faBaby: faBaby,\n  faSquareCaretDown: faSquareCaretDown,\n  faCaretSquareDown: faCaretSquareDown,\n  faTent: faTent,\n  faA: faA,\n  faParachuteBox: faParachuteBox,\n  faCartArrowDown: faCartArrowDown,\n  faBridgeCircleExclamation: faBridgeCircleExclamation,\n  faCloudArrowUp: faCloudArrowUp,\n  faCloudUpload: faCloudUpload,\n  faCloudUploadAlt: faCloudUploadAlt,\n  faAt: faAt,\n  faIndianRupeeSign: faIndianRupeeSign,\n  faIndianRupee: faIndianRupee,\n  faInr: faInr,\n  faTruck: faTruck,\n  faChalkboardUser: faChalkboardUser,\n  faChalkboardTeacher: faChalkboardTeacher,\n  faUserCheck: faUserCheck,\n  faUserNinja: faUserNinja,\n  faPlantWilt: faPlantWilt,\n  faWeightScale: faWeightScale,\n  faWeight: faWeight,\n  faCaretRight: faCaretRight,\n  faFlorinSign: faFlorinSign,\n  faBell: faBell,\n  faLariSign: faLariSign,\n  faMillSign: faMillSign,\n  faPersonSnowboarding: faPersonSnowboarding,\n  faSnowboarding: faSnowboarding,\n  faTty: faTty,\n  faTeletype: faTeletype,\n  faUsersRectangle: faUsersRectangle,\n  faMobile: faMobile,\n  faMobileAndroid: faMobileAndroid,\n  faMobilePhone: faMobilePhone,\n  faArrowsTurnToDots: faArrowsTurnToDots,\n  faExclamation: faExclamation,\n  faChurch: faChurch,\n  faToggleOff: faToggleOff,\n  faShoePrints: faShoePrints,\n  faFileCircleExclamation: faFileCircleExclamation,\n  faWallet: faWallet,\n  faMessage: faMessage,\n  faCommentAlt: faCommentAlt,\n  faTrophy: faTrophy,\n  faFaceDizzy: faFaceDizzy,\n  faDizzy: faDizzy,\n  faBacteria: faBacteria,\n  faEarDeaf: faEarDeaf,\n  faDeaf: faDeaf,\n  faDeafness: faDeafness,\n  faHardOfHearing: faHardOfHearing,\n  faPeopleArrows: faPeopleArrows,\n  faPeopleArrowsLeftRight: faPeopleArrowsLeftRight,\n  faHandsClapping: faHandsClapping,\n  faVirusCovidSlash: faVirusCovidSlash,\n  faCalendarDays: faCalendarDays,\n  faCalendarAlt: faCalendarAlt,\n  faDiamondTurnRight: faDiamondTurnRight,\n  faDirections: faDirections,\n  faHandPointUp: faHandPointUp,\n  faBezierCurve: faBezierCurve,\n  faPersonHalfDress: faPersonHalfDress,\n  faSquarePollHorizontal: faSquarePollHorizontal,\n  faPollH: faPollH,\n  faSchoolCircleXmark: faSchoolCircleXmark,\n  faHandLizard: faHandLizard,\n  faChalkboard: faChalkboard,\n  faBlackboard: faBlackboard,\n  faUpRightFromSquare: faUpRightFromSquare,\n  faExternalLinkAlt: faExternalLinkAlt,\n  faSquareFull: faSquareFull,\n  faClover: faClover,\n  faTeethOpen: faTeethOpen,\n  faBarsStaggered: faBarsStaggered,\n  faReorder: faReorder,\n  faStream: faStream,\n  faWarehouse: faWarehouse,\n  faSwatchbook: faSwatchbook,\n  faCampground: faCampground,\n  faPersonWalkingArrowRight: faPersonWalkingArrowRight,\n  faGlasses: faGlasses,\n  faCirclePause: faCirclePause,\n  faPauseCircle: faPauseCircle,\n  faMemory: faMemory,\n  faGift: faGift,\n  faMoneyBillWheat: faMoneyBillWheat,\n  faDungeon: faDungeon,\n  faSuitcaseMedical: faSuitcaseMedical,\n  faMedkit: faMedkit,\n  faPersonCane: faPersonCane,\n  faGauge: faGauge,\n  faDashboard: faDashboard,\n  faGaugeMed: faGaugeMed,\n  faTachometerAltAverage: faTachometerAltAverage,\n  faEnvelopeOpenText: faEnvelopeOpenText,\n  faToolbox: faToolbox,\n  faPowerOff: faPowerOff,\n  faSignal: faSignal,\n  faSignal5: faSignal5,\n  faSignalPerfect: faSignalPerfect,\n  faArrowsSpin: faArrowsSpin,\n  faJoint: faJoint,\n  faBraille: faBraille,\n  faBasketShopping: faBasketShopping,\n  faShoppingBasket: faShoppingBasket,\n  faBridge: faBridge,\n  faPlaneArrival: faPlaneArrival,\n  faCashRegister: faCashRegister,\n  faRing: faRing,\n  faAquarius: faAquarius,\n  faShareNodes: faShareNodes,\n  faShareAlt: faShareAlt,\n  faPersonCircleExclamation: faPersonCircleExclamation,\n  faBinoculars: faBinoculars,\n  faKipSign: faKipSign,\n  faHardDrive: faHardDrive,\n  faHdd: faHdd,\n  faRankingStar: faRankingStar,\n  faUserTie: faUserTie,\n  faEllipsis: faEllipsis,\n  faEllipsisH: faEllipsisH,\n  faStoreSlash: faStoreSlash,\n  faPercent: faPercent,\n  faPercentage: faPercentage,\n  faFileZipper: faFileZipper,\n  faFileArchive: faFileArchive,\n  faDisplay: faDisplay,\n  faIcons: faIcons,\n  faHeartMusicCameraBolt: faHeartMusicCameraBolt,\n  faRulerVertical: faRulerVertical,\n  faMapLocationDot: faMapLocationDot,\n  faMapMarkedAlt: faMapMarkedAlt,\n  faHeartCrack: faHeartCrack,\n  faHeartBroken: faHeartBroken,\n  faCow: faCow,\n  faRss: faRss,\n  faFeed: faFeed,\n  faMagnifyingGlass: faMagnifyingGlass,\n  faSearch: faSearch,\n  faCloudMoon: faCloudMoon,\n  faBoxesStacked: faBoxesStacked,\n  faBoxes: faBoxes,\n  faBoxesAlt: faBoxesAlt,\n  faCodeBranch: faCodeBranch,\n  faBan: faBan,\n  faCancel: faCancel,\n  faJugDetergent: faJugDetergent,\n  faReply: faReply,\n  faMailReply: faMailReply,\n  faSunPlantWilt: faSunPlantWilt,\n  faBacterium: faBacterium,\n  faRecordVinyl: faRecordVinyl,\n  faFloppyDisk: faFloppyDisk,\n  faSave: faSave,\n  faToiletsPortable: faToiletsPortable,\n  faO: faO,\n  faPalette: faPalette,\n  faUnlock: faUnlock,\n  faEarListen: faEarListen,\n  faAssistiveListeningSystems: faAssistiveListeningSystems,\n  faCodePullRequest: faCodePullRequest,\n  faKey: faKey,\n  faSkull: faSkull,\n  faMarsStrokeUp: faMarsStrokeUp,\n  faMarsStrokeV: faMarsStrokeV,\n  faFireFlameSimple: faFireFlameSimple,\n  faBurn: faBurn,\n  faTree: faTree,\n  faSmog: faSmog,\n  faS: faS,\n  faJedi: faJedi,\n  faPersonHiking: faPersonHiking,\n  faHiking: faHiking,\n  faArrowsUpToLine: faArrowsUpToLine,\n  faMarsDouble: faMarsDouble,\n  faThermometer: faThermometer,\n  faPaintbrush: faPaintbrush,\n  faPaintBrush: faPaintBrush,\n  faNeuter: faNeuter,\n  faSquarePhoneFlip: faSquarePhoneFlip,\n  faPhoneSquareAlt: faPhoneSquareAlt,\n  faFaceGrinTongueSquint: faFaceGrinTongueSquint,\n  faGrinTongueSquint: faGrinTongueSquint,\n  faCommentDollar: faCommentDollar,\n  faHippo: faHippo,\n  faBowlFood: faBowlFood,\n  faSquareVirus: faSquareVirus,\n  faCloudSunRain: faCloudSunRain,\n  faArrowRightLong: faArrowRightLong,\n  faLongArrowRight: faLongArrowRight,\n  faBuildingUn: faBuildingUn,\n  faTemperatureLow: faTemperatureLow,\n  faDoorOpen: faDoorOpen,\n  faAlignLeft: faAlignLeft,\n  faCamera: faCamera,\n  faCameraAlt: faCameraAlt,\n  faUsersRays: faUsersRays,\n  faRainbow: faRainbow,\n  faSitemap: faSitemap,\n  faFaceGrinStars: faFaceGrinStars,\n  faGrinStars: faGrinStars,\n  faSortUp: faSortUp,\n  faSortAsc: faSortAsc,\n  faEye: faEye,\n  faCaretLeft: faCaretLeft,\n  faAppleWhole: faAppleWhole,\n  faAppleAlt: faAppleAlt,\n  faScrollTorah: faScrollTorah,\n  faTorah: faTorah,\n  faHouseLock: faHouseLock,\n  faArrowsLeftRightToLine: faArrowsLeftRightToLine,\n  faTrash: faTrash,\n  faFaceSadTear: faFaceSadTear,\n  faSadTear: faSadTear,\n  faFax: faFax,\n  faPersonCirclePlus: faPersonCirclePlus,\n  faHamsa: faHamsa,\n  faPersonCircleQuestion: faPersonCircleQuestion,\n  faClipboardCheck: faClipboardCheck,\n  faShareFromSquare: faShareFromSquare,\n  faShareSquare: faShareSquare,\n  faReceipt: faReceipt,\n  faEquals: faEquals,\n  faChevronUp: faChevronUp,\n  faVirusSlash: faVirusSlash,\n  faSlash: faSlash,\n  faExpand: faExpand,\n  faNoteSticky: faNoteSticky,\n  faStickyNote: faStickyNote,\n  faTableColumns: faTableColumns,\n  faColumns: faColumns,\n  faPersonShelter: faPersonShelter,\n  faCircleNotch: faCircleNotch,\n  faWater: faWater,\n  faDeleteLeft: faDeleteLeft,\n  faBackspace: faBackspace,\n  faBroomBall: faBroomBall,\n  faQuidditch: faQuidditch,\n  faQuidditchBroomBall: faQuidditchBroomBall,\n  faJ: faJ,\n  faShuttleSpace: faShuttleSpace,\n  faSpaceShuttle: faSpaceShuttle,\n  faYinYang: faYinYang,\n  faStop: faStop,\n  faTrowel: faTrowel,\n  faHandBackFist: faHandBackFist,\n  faHandRock: faHandRock,\n  faTemperatureHigh: faTemperatureHigh,\n  faGreaterThan: faGreaterThan,\n  faCrutch: faCrutch,\n  faSeptagon: faSeptagon,\n  faHeptagon: faHeptagon,\n  faStreetView: faStreetView,\n  faWaveSquare: faWaveSquare,\n  faAngleLeft: faAngleLeft,\n  faScrewdriver: faScrewdriver,\n  faTractor: faTractor,\n  faBridgeCircleXmark: faBridgeCircleXmark,\n  faVials: faVials,\n  faStethoscope: faStethoscope,\n  faPodcast: faPodcast,\n  faArrowUpRightDots: faArrowUpRightDots,\n  faChessQueen: faChessQueen,\n  faAnchorCircleExclamation: faAnchorCircleExclamation,\n  faEllipsisVertical: faEllipsisVertical,\n  faEllipsisV: faEllipsisV,\n  faHeartCircleExclamation: faHeartCircleExclamation,\n  faBuildingCircleExclamation: faBuildingCircleExclamation,\n  faPersonArrowUpFromLine: faPersonArrowUpFromLine,\n  faNotEqual: faNotEqual,\n  faTrainTram: faTrainTram,\n  faPlaneDeparture: faPlaneDeparture,\n  faRightToBracket: faRightToBracket,\n  faSignInAlt: faSignInAlt,\n  faSdCard: faSdCard,\n  faHouseCircleExclamation: faHouseCircleExclamation,\n  faShekelSign: faShekelSign,\n  faIls: faIls,\n  faShekel: faShekel,\n  faSheqel: faSheqel,\n  faSheqelSign: faSheqelSign,\n  faRadio: faRadio,\n  faHandDots: faHandDots,\n  faAllergies: faAllergies,\n  faBookSkull: faBookSkull,\n  faBookDead: faBookDead,\n  faUnlockKeyhole: faUnlockKeyhole,\n  faUnlockAlt: faUnlockAlt,\n  faFileArrowUp: faFileArrowUp,\n  faFileUpload: faFileUpload,\n  faFaceGrinTears: faFaceGrinTears,\n  faGrinTears: faGrinTears,\n  faPenToSquare: faPenToSquare,\n  faEdit: faEdit,\n  faEarthEurope: faEarthEurope,\n  faGlobeEurope: faGlobeEurope,\n  faFaceGrinBeamSweat: faFaceGrinBeamSweat,\n  faGrinBeamSweat: faGrinBeamSweat,\n  faCircleHalfStroke: faCircleHalfStroke,\n  faAdjust: faAdjust,\n  faPersonMilitaryToPerson: faPersonMilitaryToPerson,\n  faTableCellsColumnLock: faTableCellsColumnLock,\n  faTruckFieldUn: faTruckFieldUn,\n  faClock: faClock,\n  faClockFour: faClockFour,\n  faBook: faBook,\n  faFaceLaughWink: faFaceLaughWink,\n  faLaughWink: faLaughWink,\n  faCloudMeatball: faCloudMeatball,\n  faChartArea: faChartArea,\n  faAreaChart: faAreaChart,\n  faRupiahSign: faRupiahSign,\n  faTextWidth: faTextWidth,\n  faSatellite: faSatellite,\n  faMagnifyingGlassMinus: faMagnifyingGlassMinus,\n  faSearchMinus: faSearchMinus,\n  faPeopleGroup: faPeopleGroup,\n  faSquareBinary: faSquareBinary,\n  faMasksTheater: faMasksTheater,\n  faTheaterMasks: faTheaterMasks,\n  faCartPlus: faCartPlus,\n  faHandsAslInterpreting: faHandsAslInterpreting,\n  faAmericanSignLanguageInterpreting: faAmericanSignLanguageInterpreting,\n  faAslInterpreting: faAslInterpreting,\n  faHandsAmericanSignLanguageInterpreting: faHandsAmericanSignLanguageInterpreting,\n  faTableCellsRowUnlock: faTableCellsRowUnlock,\n  faRocket: faRocket,\n  faShrimp: faShrimp,\n  faTengeSign: faTengeSign,\n  faTenge: faTenge,\n  faHouseChimneyMedical: faHouseChimneyMedical,\n  faClinicMedical: faClinicMedical,\n  faUsersSlash: faUsersSlash,\n  faPaperPlane: faPaperPlane,\n  faBookAtlas: faBookAtlas,\n  faAtlas: faAtlas,\n  faTable: faTable,\n  faHeart: faHeart,\n  faCircleChevronUp: faCircleChevronUp,\n  faChevronCircleUp: faChevronCircleUp,\n  faBatteryHalf: faBatteryHalf,\n  faBattery3: faBattery3,\n  faFontAwesome: faFontAwesome,\n  faFontAwesomeFlag: faFontAwesomeFlag,\n  faFontAwesomeLogoFull: faFontAwesomeLogoFull,\n  faHandcuffs: faHandcuffs,\n  faHatCowboySide: faHatCowboySide,\n  faIndustry: faIndustry,\n  faLinesLeaning: faLinesLeaning,\n  faPassport: faPassport,\n  faInfinity: faInfinity,\n  faClone: faClone,\n  faForward: faForward,\n  faM: faM,\n  faRoadSpikes: faRoadSpikes,\n  faMountain: faMountain,\n  faChess: faChess,\n  faTemperatureThreeQuarters: faTemperatureThreeQuarters,\n  faTemperature3: faTemperature3,\n  faThermometer3: faThermometer3,\n  faThermometerThreeQuarters: faThermometerThreeQuarters,\n  faB: faB,\n  faShieldVirus: faShieldVirus,\n  faLitecoinSign: faLitecoinSign,\n  faDiceD6: faDiceD6,\n  faGripLinesVertical: faGripLinesVertical,\n  faGolfBallTee: faGolfBallTee,\n  faGolfBall: faGolfBall,\n  faHexagon: faHexagon,\n  faFolderOpen: faFolderOpen,\n  faKaaba: faKaaba,\n  faHandHolding: faHandHolding,\n  faSingleQuoteRight: faSingleQuoteRight,\n  faBottleDroplet: faBottleDroplet,\n  faWindowMinimize: faWindowMinimize,\n  faChevronRight: faChevronRight,\n  faEgg: faEgg,\n  faLandmarkDome: faLandmarkDome,\n  faLandmarkAlt: faLandmarkAlt,\n  faWorm: faWorm,\n  faUserInjured: faUserInjured,\n  faStrikethrough: faStrikethrough,\n  faBlog: faBlog,\n  faStopwatch20: faStopwatch20,\n  faTruckPickup: faTruckPickup,\n  faSeedling: faSeedling,\n  faSprout: faSprout,\n  faTransgender: faTransgender,\n  faTransgenderAlt: faTransgenderAlt,\n  faStarHalf: faStarHalf,\n  faPhotoFilm: faPhotoFilm,\n  faPhotoVideo: faPhotoVideo,\n  faPictureInPicture: faPictureInPicture,\n  faPumpMedical: faPumpMedical,\n  faFire: faFire,\n  faMagnifyingGlassPlus: faMagnifyingGlassPlus,\n  faSearchPlus: faSearchPlus,\n  faFlask: faFlask,\n  faAlignRight: faAlignRight,\n  faCableCar: faCableCar,\n  faTram: faTram,\n  faKitMedical: faKitMedical,\n  faFirstAid: faFirstAid,\n  faGripLines: faGripLines,\n  faBurger: faBurger,\n  faHamburger: faHamburger,\n  faSnowman: faSnowman,\n  faHotel: faHotel,\n  faPrint: faPrint,\n  faVolleyball: faVolleyball,\n  faVolleyballBall: faVolleyballBall,\n  faTrafficLight: faTrafficLight,\n  faPlaneCircleCheck: faPlaneCircleCheck,\n  faUsers: faUsers,\n  faCertificate: faCertificate,\n  faAlarmClock: faAlarmClock,\n  faHelicopterSymbol: faHelicopterSymbol,\n  faHouseChimneyCrack: faHouseChimneyCrack,\n  faHouseDamage: faHouseDamage,\n  faPersonMilitaryPointing: faPersonMilitaryPointing,\n  faDatabase: faDatabase,\n  faNewspaper: faNewspaper,\n  faCloudRain: faCloudRain,\n  faMaximize: faMaximize,\n  faExpandArrowsAlt: faExpandArrowsAlt,\n  faLocationArrow: faLocationArrow,\n  faCity: faCity,\n  faXRay: faXRay,\n  faUmbrellaBeach: faUmbrellaBeach,\n  faArrowRightToBracket: faArrowRightToBracket,\n  faSignIn: faSignIn,\n  faHeadset: faHeadset,\n  faSplotch: faSplotch,\n  faUpLong: faUpLong,\n  faLongArrowAltUp: faLongArrowAltUp,\n  faHexagonNodes: faHexagonNodes,\n  faHospital: faHospital,\n  faHospitalAlt: faHospitalAlt,\n  faHospitalWide: faHospitalWide,\n  faPersonHarassing: faPersonHarassing,\n  faMoneyBillTrendUp: faMoneyBillTrendUp,\n  faPenRuler: faPenRuler,\n  faPencilRuler: faPencilRuler,\n  faRepeat: faRepeat,\n  faBone: faBone,\n  faFireFlameCurved: faFireFlameCurved,\n  faFireAlt: faFireAlt,\n  faBusSimple: faBusSimple,\n  faBusAlt: faBusAlt,\n  faVenusMars: faVenusMars,\n  faBlender: faBlender,\n  faU: faU,\n  faShare: faShare,\n  faMailForward: faMailForward,\n  faPhoneFlip: faPhoneFlip,\n  faPhoneAlt: faPhoneAlt,\n  faToiletPortable: faToiletPortable,\n  faPersonPregnant: faPersonPregnant,\n  faLessThan: faLessThan,\n  faSuperscript: faSuperscript,\n  faCircleStop: faCircleStop,\n  faStopCircle: faStopCircle,\n  faArrowsUpDown: faArrowsUpDown,\n  faArrowsV: faArrowsV,\n  faPooStorm: faPooStorm,\n  faPooBolt: faPooBolt,\n  faVideoSlash: faVideoSlash,\n  faSquareXmark: faSquareXmark,\n  faTimesSquare: faTimesSquare,\n  faXmarkSquare: faXmarkSquare,\n  faHandHoldingDroplet: faHandHoldingDroplet,\n  faHandHoldingWater: faHandHoldingWater,\n  faWonSign: faWonSign,\n  faKrw: faKrw,\n  faWon: faWon,\n  faObjectUngroup: faObjectUngroup,\n  faComment: faComment,\n  faHillAvalanche: faHillAvalanche,\n  faArrowsToEye: faArrowsToEye,\n  faSnowplow: faSnowplow,\n  faChartGantt: faChartGantt,\n  faVideo: faVideo,\n  faVideoCamera: faVideoCamera,\n  faChessPawn: faChessPawn,\n  faSynagogue: faSynagogue,\n  faBuildingCircleCheck: faBuildingCircleCheck,\n  faCalendarPlus: faCalendarPlus,\n  faWheelchairMove: faWheelchairMove,\n  faWheelchairAlt: faWheelchairAlt,\n  faUserShield: faUserShield,\n  faBold: faBold,\n  faHeartPulse: faHeartPulse,\n  faHeartbeat: faHeartbeat,\n  faSquareRootVariable: faSquareRootVariable,\n  faSquareRootAlt: faSquareRootAlt,\n  faHandsBubbles: faHandsBubbles,\n  faHandsWash: faHandsWash,\n  faMarker: faMarker,\n  faClipboard: faClipboard,\n  faPlaceOfWorship: faPlaceOfWorship,\n  faCannabis: faCannabis,\n  faPeopleRoof: faPeopleRoof,\n  faDisease: faDisease,\n  faBookBible: faBookBible,\n  faBible: faBible,\n  faChessBoard: faChessBoard,\n  faMars: faMars,\n  faLaptop: faLaptop,\n  faUserXmark: faUserXmark,\n  faUserTimes: faUserTimes,\n  faFlagUsa: faFlagUsa,\n  faHandMiddleFinger: faHandMiddleFinger,\n  faMortarPestle: faMortarPestle,\n  faHeadSideCough: faHeadSideCough,\n  faPlaneLock: faPlaneLock,\n  faBatteryThreeQuarters: faBatteryThreeQuarters,\n  faBattery4: faBattery4,\n  faFrancSign: faFrancSign,\n  faFilterCircleDollar: faFilterCircleDollar,\n  faFunnelDollar: faFunnelDollar,\n  faCheese: faCheese,\n  faCircleH: faCircleH,\n  faHospitalSymbol: faHospitalSymbol,\n  faSchool: faSchool,\n  faDiceFive: faDiceFive,\n  faTornado: faTornado,\n  faJetFighter: faJetFighter,\n  faFighterJet: faFighterJet,\n  faThumbsDown: faThumbsDown,\n  faBroom: faBroom,\n  faFileImport: faFileImport,\n  faArrowRightToFile: faArrowRightToFile,\n  faUtensils: faUtensils,\n  faCutlery: faCutlery,\n  faIdBadge: faIdBadge,\n  faSpider: faSpider,\n  faMobileRetro: faMobileRetro,\n  faSignsPost: faSignsPost,\n  faMapSigns: faMapSigns,\n  faGroupArrowsRotate: faGroupArrowsRotate,\n  faArrowsSplitUpAndLeft: faArrowsSplitUpAndLeft,\n  faFillDrip: faFillDrip,\n  faShieldHeart: faShieldHeart,\n  faPersonSkiingNordic: faPersonSkiingNordic,\n  faSkiingNordic: faSkiingNordic,\n  faSquareCheck: faSquareCheck,\n  faCheckSquare: faCheckSquare,\n  faBath: faBath,\n  faBathtub: faBathtub,\n  faChessBishop: faChessBishop,\n  faPrescriptionBottleMedical: faPrescriptionBottleMedical,\n  faPrescriptionBottleAlt: faPrescriptionBottleAlt,\n  faDrawPolygon: faDrawPolygon,\n  faVectorPolygon: faVectorPolygon,\n  faICursor: faICursor,\n  faHeartCirclePlus: faHeartCirclePlus,\n  faShieldDog: faShieldDog,\n  faGreaterThanEqual: faGreaterThanEqual,\n  faEnvelopeOpen: faEnvelopeOpen,\n  faMound: faMound,\n  faVoicemail: faVoicemail,\n  faVest: faVest,\n  faAudioDescription: faAudioDescription,\n  faW: faW,\n  faEyeDropper: faEyeDropper,\n  faEyeDropperEmpty: faEyeDropperEmpty,\n  faEyedropper: faEyedropper,\n  faCircleXmark: faCircleXmark,\n  faTimesCircle: faTimesCircle,\n  faXmarkCircle: faXmarkCircle,\n  faTrailer: faTrailer,\n  faTurkishLiraSign: faTurkishLiraSign,\n  faTry: faTry,\n  faTurkishLira: faTurkishLira,\n  faVolcano: faVolcano,\n  faWandSparkles: faWandSparkles,\n  faMicrophone: faMicrophone,\n  faCrown: faCrown,\n  faTentArrowTurnLeft: faTentArrowTurnLeft,\n  faTruckFast: faTruckFast,\n  faShippingFast: faShippingFast,\n  faUserPen: faUserPen,\n  faUserEdit: faUserEdit,\n  faUserClock: faUserClock,\n  faShower: faShower,\n  faSquareCaretUp: faSquareCaretUp,\n  faCaretSquareUp: faCaretSquareUp,\n  faMapLocation: faMapLocation,\n  faMapMarked: faMapMarked,\n  faPenFancy: faPenFancy,\n  faEuroSign: faEuroSign,\n  faEur: faEur,\n  faEuro: faEuro,\n  faHouseCircleXmark: faHouseCircleXmark,\n  faLiraSign: faLiraSign,\n  faYenSign: faYenSign,\n  faCny: faCny,\n  faJpy: faJpy,\n  faRmb: faRmb,\n  faYen: faYen,\n  faBoxOpen: faBoxOpen,\n  faTruckField: faTruckField,\n  faLocationPinLock: faLocationPinLock,\n  faPersonPraying: faPersonPraying,\n  faPray: faPray,\n  faClipboardList: faClipboardList,\n  faSackDollar: faSackDollar,\n  faMountainSun: faMountainSun,\n  faArrowUpWideShort: faArrowUpWideShort,\n  faSortAmountUp: faSortAmountUp,\n  faUsersLine: faUsersLine,\n  faStarOfDavid: faStarOfDavid,\n  faNotesMedical: faNotesMedical,\n  faAustralSign: faAustralSign,\n  faClipboardUser: faClipboardUser,\n  faFileImage: faFileImage,\n  faSquareCaretRight: faSquareCaretRight,\n  faCaretSquareRight: faCaretSquareRight,\n  faVial: faVial,\n  faHelicopter: faHelicopter,\n  faMitten: faMitten,\n  faGasPump: faGasPump,\n  faEnvelopeCircleCheck: faEnvelopeCircleCheck,\n  faPersonSkating: faPersonSkating,\n  faSkating: faSkating,\n  faSun: faSun,\n  faBaseball: faBaseball,\n  faBaseballBall: faBaseballBall,\n  faImage: faImage,\n  faNotdef: faNotdef,\n  faBasketball: faBasketball,\n  faBasketballBall: faBasketballBall,\n  faPencil: faPencil,\n  faPencilAlt: faPencilAlt,\n  faPersonWalkingArrowLoopLeft: faPersonWalkingArrowLoopLeft,\n  faDiceSix: faDiceSix,\n  faAnglesDown: faAnglesDown,\n  faAngleDoubleDown: faAngleDoubleDown,\n  faSyringe: faSyringe,\n  faWheatAwn: faWheatAwn,\n  faWheatAlt: faWheatAlt,\n  faPlaneUp: faPlaneUp,\n  faAlignCenter: faAlignCenter,\n  faHockeyPuck: faHockeyPuck,\n  faCircleArrowLeft: faCircleArrowLeft,\n  faArrowCircleLeft: faArrowCircleLeft,\n  faPlugCircleBolt: faPlugCircleBolt,\n  faRestroom: faRestroom,\n  faAnchorLock: faAnchorLock,\n  faTimeline: faTimeline,\n  faLightbulb: faLightbulb,\n  faCircleArrowRight: faCircleArrowRight,\n  faArrowCircleRight: faArrowCircleRight,\n  faMarsAndVenus: faMarsAndVenus,\n  faNetworkWired: faNetworkWired,\n  faBuildingShield: faBuildingShield,\n  faCode: faCode,\n  faFeatherPointed: faFeatherPointed,\n  faFeatherAlt: faFeatherAlt,\n  faFileCircleQuestion: faFileCircleQuestion,\n  faSignature: faSignature,\n  faEarthAmericas: faEarthAmericas,\n  faEarth: faEarth,\n  faEarthAmerica: faEarthAmerica,\n  faGlobeAmericas: faGlobeAmericas,\n  faCarrot: faCarrot,\n  faTemperatureFull: faTemperatureFull,\n  faTemperature4: faTemperature4,\n  faThermometer4: faThermometer4,\n  faThermometerFull: faThermometerFull,\n  faTableCellsRowLock: faTableCellsRowLock,\n  faBoltLightning: faBoltLightning,\n  faCloudShowersWater: faCloudShowersWater,\n  faArrowUpLong: faArrowUpLong,\n  faLongArrowUp: faLongArrowUp,\n  faAddressCard: faAddressCard,\n  faContactCard: faContactCard,\n  faVcard: faVcard,\n  faAngleRight: faAngleRight,\n  faFaceMeh: faFaceMeh,\n  faMeh: faMeh,\n  faArrowUpFromGroundWater: faArrowUpFromGroundWater,\n  faMap: faMap,\n  faUserPlus: faUserPlus,\n  faVenus: faVenus,\n  faDiagramSuccessor: faDiagramSuccessor,\n  faHeadSideCoughSlash: faHeadSideCoughSlash,\n  faDiagramProject: faDiagramProject,\n  faProjectDiagram: faProjectDiagram,\n  faTerminal: faTerminal,\n  faHouseFire: faHouseFire,\n  faMask: faMask,\n  faHurricane: faHurricane,\n  faEarthAfrica: faEarthAfrica,\n  faGlobeAfrica: faGlobeAfrica,\n  faThumbtack: faThumbtack,\n  faThumbTack: faThumbTack,\n  faHandPointDown: faHandPointDown,\n  faFaceMehBlank: faFaceMehBlank,\n  faMehBlank: faMehBlank,\n  faTemperatureEmpty: faTemperatureEmpty,\n  faTemperature0: faTemperature0,\n  faThermometer0: faThermometer0,\n  faThermometerEmpty: faThermometerEmpty,\n  faBorderNone: faBorderNone,\n  faHighlighter: faHighlighter,\n  faMoneyBillWave: faMoneyBillWave,\n  faToiletPaperSlash: faToiletPaperSlash,\n  faFileShield: faFileShield,\n  faTextHeight: faTextHeight,\n  faFaceGrinTongue: faFaceGrinTongue,\n  faGrinTongue: faGrinTongue,\n  faFileSignature: faFileSignature,\n  faBuildingWheat: faBuildingWheat,\n  faPlugCircleMinus: faPlugCircleMinus,\n  faFutbol: faFutbol,\n  faFutbolBall: faFutbolBall,\n  faSoccerBall: faSoccerBall,\n  faCirclePlus: faCirclePlus,\n  faPlusCircle: faPlusCircle,\n  faBrazilianRealSign: faBrazilianRealSign,\n  faStarAndCrescent: faStarAndCrescent,\n  faFaceSurprise: faFaceSurprise,\n  faSurprise: faSurprise,\n  faHospitalUser: faHospitalUser,\n  faArrowDownUpLock: faArrowDownUpLock,\n  faFolder: faFolder,\n  faFolderBlank: faFolderBlank,\n  faHollyBerry: faHollyBerry,\n  faVenusDouble: faVenusDouble,\n  faClipboardQuestion: faClipboardQuestion,\n  faHotdog: faHotdog,\n  faArrowUpFromBracket: faArrowUpFromBracket,\n  faMicroscope: faMicroscope,\n  faCloud: faCloud,\n  faBaseballBatBall: faBaseballBatBall,\n  faCarRear: faCarRear,\n  faCarAlt: faCarAlt,\n  faThumbtackSlash: faThumbtackSlash,\n  faThumbTackSlash: faThumbTackSlash,\n  faPlusMinus: faPlusMinus,\n  faHouseCircleCheck: faHouseCircleCheck,\n  faCalendarDay: faCalendarDay,\n  faLibra: faLibra,\n  faCircle: faCircle,\n  faMobileVibrate: faMobileVibrate,\n  faFaceGrinSquint: faFaceGrinSquint,\n  faGrinSquint: faGrinSquint,\n  faUsersBetweenLines: faUsersBetweenLines,\n  faHouseMedicalCircleXmark: faHouseMedicalCircleXmark,\n  faTableList: faTableList,\n  faThList: faThList,\n  faFlaskVial: faFlaskVial,\n  faCircleExclamation: faCircleExclamation,\n  faExclamationCircle: faExclamationCircle,\n  faTaxi: faTaxi,\n  faCab: faCab,\n  faTextSlash: faTextSlash,\n  faRemoveFormat: faRemoveFormat,\n  faPeoplePulling: faPeoplePulling,\n  faBackward: faBackward,\n  faCarBurst: faCarBurst,\n  faCarCrash: faCarCrash,\n  faLink: faLink,\n  faChain: faChain,\n  faBackwardStep: faBackwardStep,\n  faStepBackward: faStepBackward,\n  faX: faX,\n  faCircleUser: faCircleUser,\n  faUserCircle: faUserCircle,\n  faRectangleList: faRectangleList,\n  faListAlt: faListAlt,\n  faHand: faHand,\n  faHandPaper: faHandPaper,\n  faCancer: faCancer,\n  faVanShuttle: faVanShuttle,\n  faShuttleVan: faShuttleVan,\n  faStairs: faStairs,\n  faHorseHead: faHorseHead,\n  faVault: faVault,\n  faClosedCaptioningSlash: faClosedCaptioningSlash,\n  faDrumSteelpan: faDrumSteelpan,\n  faThumbsUp: faThumbsUp,\n  faStamp: faStamp,\n  faMenorah: faMenorah,\n  faChildren: faChildren,\n  faChartLine: faChartLine,\n  faLineChart: faLineChart,\n  faSquareEnvelope: faSquareEnvelope,\n  faEnvelopeSquare: faEnvelopeSquare,\n  faBanSmoking: faBanSmoking,\n  faSmokingBan: faSmokingBan,\n  faTruckFront: faTruckFront,\n  faBuilding: faBuilding,\n  faBullseye: faBullseye,\n  faArrowLeftLong: faArrowLeftLong,\n  faLongArrowLeft: faLongArrowLeft,\n  faChessRook: faChessRook,\n  faBlenderPhone: faBlenderPhone,\n  faArrowTurnUp: faArrowTurnUp,\n  faLevelUp: faLevelUp,\n  faBicycle: faBicycle,\n  faCircleArrowDown: faCircleArrowDown,\n  faArrowCircleDown: faArrowCircleDown,\n  faGear: faGear,\n  faCog: faCog,\n  faMarsAndVenusBurst: faMarsAndVenusBurst,\n  faOtter: faOtter,\n  faCircleChevronLeft: faCircleChevronLeft,\n  faChevronCircleLeft: faChevronCircleLeft,\n  faCircleQuestion: faCircleQuestion,\n  faQuestionCircle: faQuestionCircle,\n  faWalkieTalkie: faWalkieTalkie,\n  faUserGroup: faUserGroup,\n  faUserFriends: faUserFriends,\n  faHouseChimney: faHouseChimney,\n  faHomeLg: faHomeLg,\n  faRightFromBracket: faRightFromBracket,\n  faSignOutAlt: faSignOutAlt,\n  faFile: faFile,\n  faPlaneSlash: faPlaneSlash,\n  faCloudShowersHeavy: faCloudShowersHeavy,\n  faPersonFalling: faPersonFalling,\n  faTurnDown: faTurnDown,\n  faLevelDownAlt: faLevelDownAlt,\n  faUpRightAndDownLeftFromCenter: faUpRightAndDownLeftFromCenter,\n  faExpandAlt: faExpandAlt,\n  faUserTag: faUserTag,\n  faHandSparkles: faHandSparkles,\n  faArrowsToDot: faArrowsToDot,\n  faFaceSadCry: faFaceSadCry,\n  faSadCry: faSadCry,\n  faDongSign: faDongSign,\n  faPeopleLine: faPeopleLine,\n  faSquareRss: faSquareRss,\n  faRssSquare: faRssSquare,\n  faCalendarMinus: faCalendarMinus,\n  faChartDiagram: faChartDiagram,\n  faFaceTired: faFaceTired,\n  faTired: faTired,\n  faHandPointRight: faHandPointRight,\n  faArrowUp: faArrowUp,\n  faCubesStacked: faCubesStacked,\n  faChildCombatant: faChildCombatant,\n  faChildRifle: faChildRifle,\n  faVestPatches: faVestPatches,\n  faMartiniGlassEmpty: faMartiniGlassEmpty,\n  faGlassMartini: faGlassMartini,\n  faMagnet: faMagnet,\n  faRoadBarrier: faRoadBarrier,\n  faCompassDrafting: faCompassDrafting,\n  faDraftingCompass: faDraftingCompass,\n  faSquarePersonConfined: faSquarePersonConfined,\n  faPlateWheat: faPlateWheat,\n  faSignHanging: faSignHanging,\n  faSign: faSign,\n  faCarBattery: faCarBattery,\n  faBatteryCar: faBatteryCar,\n  faShirt: faShirt,\n  faTShirt: faTShirt,\n  faTshirt: faTshirt,\n  faParagraph: faParagraph,\n  faEnvelopesBulk: faEnvelopesBulk,\n  faMailBulk: faMailBulk,\n  faGuitar: faGuitar,\n  faSuitcase: faSuitcase,\n  faCircleUp: faCircleUp,\n  faArrowAltCircleUp: faArrowAltCircleUp,\n  faF: faF,\n  faXmarksLines: faXmarksLines,\n  faEarthOceania: faEarthOceania,\n  faGlobeOceania: faGlobeOceania,\n  faCommentSlash: faCommentSlash,\n  faPlay: faPlay,\n  faVialCircleCheck: faVialCircleCheck,\n  faBridgeCircleCheck: faBridgeCircleCheck,\n  faCediSign: faCediSign,\n  faPuzzlePiece: faPuzzlePiece,\n  faHelmetUn: faHelmetUn,\n  faGlassWater: faGlassWater,\n  faHeartCircleBolt: faHeartCircleBolt,\n  faPumpSoap: faPumpSoap,\n  faHandScissors: faHandScissors,\n  faDolly: faDolly,\n  faDollyBox: faDollyBox,\n  faPaperclip: faPaperclip,\n  faDemocrat: faDemocrat,\n  faSquareArrowUpRight: faSquareArrowUpRight,\n  faExternalLinkSquare: faExternalLinkSquare,\n  faFerry: faFerry,\n  faMosquito: faMosquito,\n  faBuildingCircleArrowRight: faBuildingCircleArrowRight,\n  faLeftRight: faLeftRight,\n  faArrowsAltH: faArrowsAltH,\n  faVirus: faVirus,\n  faGem: faGem,\n  faToilet: faToilet,\n  faSingleQuoteLeft: faSingleQuoteLeft,\n  faMoneyBills: faMoneyBills,\n  faTabletButton: faTabletButton,\n  faRectangleXmark: faRectangleXmark,\n  faRectangleTimes: faRectangleTimes,\n  faTimesRectangle: faTimesRectangle,\n  faWindowClose: faWindowClose,\n  faWrench: faWrench,\n  faTrashCan: faTrashCan,\n  faTrashAlt: faTrashAlt,\n  faTableCells: faTableCells,\n  faTh: faTh,\n  faRibbon: faRibbon,\n  faLandmarkFlag: faLandmarkFlag,\n  faUpDownLeftRight: faUpDownLeftRight,\n  faArrowsAlt: faArrowsAlt,\n  faCarSide: faCarSide,\n  faTrashArrowUp: faTrashArrowUp,\n  faTrashRestore: faTrashRestore,\n  faLifeRing: faLifeRing,\n  faCopyright: faCopyright,\n  faFilePrescription: faFilePrescription,\n  faEraser: faEraser,\n  faHourglassStart: faHourglassStart,\n  faHourglass1: faHourglass1,\n  faCircleLeft: faCircleLeft,\n  faArrowAltCircleLeft: faArrowAltCircleLeft,\n  faCruzeiroSign: faCruzeiroSign,\n  faSmoking: faSmoking,\n  faSquarePollVertical: faSquarePollVertical,\n  faPoll: faPoll,\n  faPersonCircleMinus: faPersonCircleMinus,\n  faBiohazard: faBiohazard,\n  faBellConcierge: faBellConcierge,\n  faConciergeBell: faConciergeBell,\n  faRulerHorizontal: faRulerHorizontal,\n  faHorse: faHorse,\n  faCalendar: faCalendar,\n  faHandsHoldingChild: faHandsHoldingChild,\n  faItalic: faItalic,\n  faKhanda: faKhanda,\n  faFaceFrownOpen: faFaceFrownOpen,\n  faFrownOpen: faFrownOpen,\n  faCheck: faCheck,\n  faFingerprint: faFingerprint,\n  faChargingStation: faChargingStation,\n  faUserLock: faUserLock,\n  faMobileScreenButton: faMobileScreenButton,\n  faMobileAlt: faMobileAlt,\n  faAnchorCircleCheck: faAnchorCircleCheck,\n  faPersonWalkingWithCane: faPersonWalkingWithCane,\n  faBlind: faBlind,\n  faFileWaveform: faFileWaveform,\n  faFileMedicalAlt: faFileMedicalAlt,\n  faHouseCrack: faHouseCrack,\n  faHatWizard: faHatWizard,\n  faUserDoctor: faUserDoctor,\n  faUserMd: faUserMd,\n  faChartBar: faChartBar,\n  faBarChart: faBarChart,\n  faSprayCanSparkles: faSprayCanSparkles,\n  faAirFreshener: faAirFreshener,\n  faBahtSign: faBahtSign,\n  faTemperatureArrowUp: faTemperatureArrowUp,\n  faTemperatureUp: faTemperatureUp,\n  faWebAwesome: faWebAwesome,\n  faNonBinary: faNonBinary,\n  faN: faN,\n  faArrowsUpDownLeftRight: faArrowsUpDownLeftRight,\n  faArrows: faArrows,\n  faHouse: faHouse,\n  faHome: faHome,\n  faHomeAlt: faHomeAlt,\n  faHomeLgAlt: faHomeLgAlt,\n  faSpinner: faSpinner,\n  faGavel: faGavel,\n  faLegal: faLegal,\n  faTicketSimple: faTicketSimple,\n  faTicketAlt: faTicketAlt,\n  faDove: faDove,\n  faTarpDroplet: faTarpDroplet,\n  faTreeCity: faTreeCity,\n  faTurnUp: faTurnUp,\n  faLevelUpAlt: faLevelUpAlt,\n  faTemperatureQuarter: faTemperatureQuarter,\n  faTemperature1: faTemperature1,\n  faThermometer1: faThermometer1,\n  faThermometerQuarter: faThermometerQuarter,\n  faSliders: faSliders,\n  faSlidersH: faSlidersH,\n  faMosque: faMosque,\n  faH: faH,\n  faInfo: faInfo,\n  faPersonWalking: faPersonWalking,\n  faWalking: faWalking,\n  faArrowTurnDown: faArrowTurnDown,\n  faLevelDown: faLevelDown,\n  faRoad: faRoad,\n  faSpiral: faSpiral,\n  faFaceFrown: faFaceFrown,\n  faFrown: faFrown,\n  faWineGlassEmpty: faWineGlassEmpty,\n  faWineGlassAlt: faWineGlassAlt,\n  faClapperboard: faClapperboard,\n  faForwardStep: faForwardStep,\n  faStepForward: faStepForward,\n  faSquareUpRight: faSquareUpRight,\n  faExternalLinkSquareAlt: faExternalLinkSquareAlt,\n  faBookJournalWhills: faBookJournalWhills,\n  faJournalWhills: faJournalWhills,\n  faChampagneGlasses: faChampagneGlasses,\n  faGlassCheers: faGlassCheers,\n  faDumpster: faDumpster,\n  faHeartCircleXmark: faHeartCircleXmark,\n  faComputer: faComputer,\n  faWandMagic: faWandMagic,\n  faMagic: faMagic,\n  faBrain: faBrain,\n  faBriefcaseMedical: faBriefcaseMedical,\n  faHouseMedicalCircleExclamation: faHouseMedicalCircleExclamation,\n  faCodeCommit: faCodeCommit,\n  faPersonBreastfeeding: faPersonBreastfeeding,\n  faPersonRays: faPersonRays,\n  faManatSign: faManatSign,\n  faSort: faSort,\n  faUnsorted: faUnsorted,\n  faCircleRadiation: faCircleRadiation,\n  faRadiationAlt: faRadiationAlt,\n  faLaptopCode: faLaptopCode,\n  faSink: faSink,\n  faArrowUpFromWaterPump: faArrowUpFromWaterPump,\n  faMicrophoneLinesSlash: faMicrophoneLinesSlash,\n  faMicrophoneAltSlash: faMicrophoneAltSlash,\n  faServer: faServer,\n  faUser: faUser,\n  faUserAlt: faUserAlt,\n  faUserLarge: faUserLarge,\n  faSnowflake: faSnowflake,\n  faTaurus: faTaurus,\n  faSkullCrossbones: faSkullCrossbones,\n  faPesoSign: faPesoSign,\n  faWineGlass: faWineGlass,\n  faTemperatureHalf: faTemperatureHalf,\n  faTemperature2: faTemperature2,\n  faThermometer2: faThermometer2,\n  faThermometerHalf: faThermometerHalf,\n  faTicket: faTicket,\n  faWheatAwnCircleExclamation: faWheatAwnCircleExclamation,\n  faArrowsTurnRight: faArrowsTurnRight,\n  faCandyCane: faCandyCane,\n  faWheelchair: faWheelchair,\n  faSpellCheck: faSpellCheck,\n  faVolumeOff: faVolumeOff,\n  faLungs: faLungs,\n  faBookmark: faBookmark,\n  faBarcode: faBarcode,\n  faListOl: faListOl,\n  faList12: faList12,\n  faListNumeric: faListNumeric,\n  faFileCircleXmark: faFileCircleXmark,\n  faCube: faCube,\n  faTape: faTape,\n  faBomb: faBomb,\n  faScaleUnbalanced: faScaleUnbalanced,\n  faBalanceScaleLeft: faBalanceScaleLeft,\n  faSquareCaretLeft: faSquareCaretLeft,\n  faCaretSquareLeft: faCaretSquareLeft,\n  faRuler: faRuler,\n  faI: faI,\n  faVolumeXmark: faVolumeXmark,\n  faVolumeMute: faVolumeMute,\n  faVolumeTimes: faVolumeTimes,\n  faArchway: faArchway,\n  faPersonDigging: faPersonDigging,\n  faDigging: faDigging,\n  faGaugeHigh: faGaugeHigh,\n  faTachometerAlt: faTachometerAlt,\n  faTachometerAltFast: faTachometerAltFast,\n  faGenderless: faGenderless,\n  faCloudSun: faCloudSun,\n  faArrowRight: faArrowRight,\n  faHandshake: faHandshake,\n  faHandshakeAlt: faHandshakeAlt,\n  faHandshakeSimple: faHandshakeSimple,\n  faPersonSkiing: faPersonSkiing,\n  faSkiing: faSkiing,\n  faBridgeWater: faBridgeWater,\n  faBuildingNgo: faBuildingNgo,\n  faIgloo: faIgloo,\n  faCircleDollarToSlot: faCircleDollarToSlot,\n  faDonate: faDonate,\n  faY: faY,\n  faFaceSmileWink: faFaceSmileWink,\n  faSmileWink: faSmileWink,\n  faDiceFour: faDiceFour,\n  faFaceGrinSquintTears: faFaceGrinSquintTears,\n  faGrinSquintTears: faGrinSquintTears,\n  faFileAudio: faFileAudio,\n  faArrowsDownToLine: faArrowsDownToLine,\n  faG: faG,\n  faVihara: faVihara,\n  faFlagCheckered: faFlagCheckered,\n  faGaugeSimple: faGaugeSimple,\n  faGaugeSimpleMed: faGaugeSimpleMed,\n  faTachometerAverage: faTachometerAverage,\n  faRightLeft: faRightLeft,\n  faExchangeAlt: faExchangeAlt,\n  faPills: faPills,\n  faExplosion: faExplosion,\n  faArrowsDownToPeople: faArrowsDownToPeople,\n  faUsersViewfinder: faUsersViewfinder,\n  faCarOn: faCarOn,\n  faSleigh: faSleigh,\n  faDumbbell: faDumbbell,\n  faBabyCarriage: faBabyCarriage,\n  faCarriageBaby: faCarriageBaby,\n  faKiwiBird: faKiwiBird,\n  faCalendarXmark: faCalendarXmark,\n  faCalendarTimes: faCalendarTimes,\n  faCircleDown: faCircleDown,\n  faArrowAltCircleDown: faArrowAltCircleDown,\n  faFileMedical: faFileMedical,\n  faXmark: faXmark,\n  faClose: faClose,\n  faMultiply: faMultiply,\n  faRemove: faRemove,\n  faTimes: faTimes,\n  faShapes: faShapes,\n  faTriangleCircleSquare: faTriangleCircleSquare,\n  faDiceOne: faDiceOne,\n  faLockOpen: faLockOpen,\n  faPepperHot: faPepperHot,\n  faDropletSlash: faDropletSlash,\n  faTintSlash: faTintSlash,\n  faDroplet: faDroplet,\n  faTint: faTint,\n  faFileLines: faFileLines,\n  faFileAlt: faFileAlt,\n  faFileText: faFileText,\n  faCommentsDollar: faCommentsDollar,\n  faMagnifyingGlassLocation: faMagnifyingGlassLocation,\n  faSearchLocation: faSearchLocation,\n  faFileInvoice: faFileInvoice,\n  faPentagon: faPentagon,\n  faRepublican: faRepublican,\n  faShop: faShop,\n  faStoreAlt: faStoreAlt,\n  faFilm: faFilm,\n  faFilmAlt: faFilmAlt,\n  faFilmSimple: faFilmSimple,\n  faBuildingCircleXmark: faBuildingCircleXmark,\n  faComments: faComments,\n  faTags: faTags,\n  faGun: faGun,\n  faCircleCheck: faCircleCheck,\n  faCheckCircle: faCheckCircle,\n  faScorpio: faScorpio,\n  faIdCardClip: faIdCardClip,\n  faIdCardAlt: faIdCardAlt,\n  faMoon: faMoon,\n  faOilWell: faOilWell,\n  faTachographDigital: faTachographDigital,\n  faDigitalTachograph: faDigitalTachograph,\n  faTablet: faTablet,\n  faTabletAndroid: faTabletAndroid,\n  faRubleSign: faRubleSign,\n  faRouble: faRouble,\n  faRub: faRub,\n  faRuble: faRuble,\n  faClosedCaptioning: faClosedCaptioning,\n  faPen: faPen,\n  faPlane: faPlane,\n  faImages: faImages,\n  faMobileScreen: faMobileScreen,\n  faMobileAndroidAlt: faMobileAndroidAlt,\n  faGuaraniSign: faGuaraniSign,\n  faBagShopping: faBagShopping,\n  faShoppingBag: faShoppingBag,\n  faCircleRight: faCircleRight,\n  faArrowAltCircleRight: faArrowAltCircleRight,\n  faPhoneVolume: faPhoneVolume,\n  faVolumeControlPhone: faVolumeControlPhone,\n  faCubes: faCubes,\n  faPhone: faPhone,\n  faToriiGate: faToriiGate,\n  faBacon: faBacon,\n  faPersonFallingBurst: faPersonFallingBurst,\n  faQuoteRight: faQuoteRight,\n  faQuoteRightAlt: faQuoteRightAlt,\n  faHouseMedicalFlag: faHouseMedicalFlag,\n  faPrescription: faPrescription,\n  faDiceThree: faDiceThree,\n  faBuildingLock: faBuildingLock,\n  faIdCard: faIdCard,\n  faDriversLicense: faDriversLicense,\n  faCirclePlay: faCirclePlay,\n  faPlayCircle: faPlayCircle,\n  faFaceLaughBeam: faFaceLaughBeam,\n  faLaughBeam: faLaughBeam,\n  faLeaf: faLeaf,\n  faHouseChimneyUser: faHouseChimneyUser,\n  faRotateRight: faRotateRight,\n  faRedoAlt: faRedoAlt,\n  faRotateForward: faRotateForward,\n  faTooth: faTooth,\n  faHouseChimneyWindow: faHouseChimneyWindow,\n  faMotorcycle: faMotorcycle,\n  faBackwardFast: faBackwardFast,\n  faFastBackward: faFastBackward,\n  faAddressBook: faAddressBook,\n  faContactBook: faContactBook,\n  faSailboat: faSailboat,\n  faBookBookmark: faBookBookmark,\n  faMagnifyingGlassArrowRight: faMagnifyingGlassArrowRight,\n  faMicrophoneLines: faMicrophoneLines,\n  faMicrophoneAlt: faMicrophoneAlt,\n  faReplyAll: faReplyAll,\n  faMailReplyAll: faMailReplyAll,\n  faUniversalAccess: faUniversalAccess,\n  faToiletPaper: faToiletPaper,\n  faToiletPaperAlt: faToiletPaperAlt,\n  faToiletPaperBlank: faToiletPaperBlank,\n  faVrCardboard: faVrCardboard,\n  faPizzaSlice: faPizzaSlice,\n  faSprayCan: faSprayCan,\n  faVolumeLow: faVolumeLow,\n  faVolumeDown: faVolumeDown,\n  faCross: faCross,\n  faPerson: faPerson,\n  faMale: faMale,\n  faHourglass: faHourglass,\n  faHourglassEmpty: faHourglassEmpty,\n  faFish: faFish,\n  faDrumstickBite: faDrumstickBite,\n  faChartSimple: faChartSimple,\n  faAtom: faAtom,\n  faP: faP,\n  faJetFighterUp: faJetFighterUp,\n  faPlugCircleXmark: faPlugCircleXmark,\n  faSheetPlastic: faSheetPlastic,\n  faV: faV,\n  faList: faList,\n  faListSquares: faListSquares,\n  faPisces: faPisces,\n  faSolarPanel: faSolarPanel,\n  faLandMineOn: faLandMineOn,\n  faHeadphones: faHeadphones,\n  faHeadphonesAlt: faHeadphonesAlt,\n  faHeadphonesSimple: faHeadphonesSimple,\n  faBus: faBus,\n  faFilePowerpoint: faFilePowerpoint,\n  faQuoteLeft: faQuoteLeft,\n  faQuoteLeftAlt: faQuoteLeftAlt,\n  faChevronDown: faChevronDown,\n  faEarthAsia: faEarthAsia,\n  faGlobeAsia: faGlobeAsia,\n  faCentSign: faCentSign,\n  faShieldCat: faShieldCat,\n  faSchoolCircleCheck: faSchoolCircleCheck,\n  faMartiniGlass: faMartiniGlass,\n  faGlassMartiniAlt: faGlassMartiniAlt,\n  faPlug: faPlug,\n  faPanorama: faPanorama,\n  faClockRotateLeft: faClockRotateLeft,\n  faHistory: faHistory,\n  faJarWheat: faJarWheat,\n  faCloudArrowDown: faCloudArrowDown,\n  faCloudDownload: faCloudDownload,\n  faCloudDownloadAlt: faCloudDownloadAlt,\n  faTruckRampBox: faTruckRampBox,\n  faTruckLoading: faTruckLoading,\n  faAngleDown: faAngleDown,\n  faPlugCircleCheck: faPlugCircleCheck,\n  faWindowMaximize: faWindowMaximize,\n  faHandsHoldingCircle: faHandsHoldingCircle,\n  faLocationPin: faLocationPin,\n  faMapMarker: faMapMarker,\n  faBowlingBall: faBowlingBall,\n  faCartFlatbed: faCartFlatbed,\n  faDollyFlatbed: faDollyFlatbed,\n  faHouseUser: faHouseUser,\n  faHomeUser: faHomeUser,\n  faGhost: faGhost,\n  faCommentNodes: faCommentNodes,\n  faPersonArrowDownToLine: faPersonArrowDownToLine,\n  faPlugCirclePlus: faPlugCirclePlus,\n  faPersonSwimming: faPersonSwimming,\n  faSwimmer: faSwimmer,\n  faCommentDots: faCommentDots,\n  faCommenting: faCommenting,\n  faChartPie: faChartPie,\n  faPieChart: faPieChart,\n  faFrog: faFrog,\n  faWineBottle: faWineBottle,\n  faInbox: faInbox,\n  faSquareH: faSquareH,\n  faHSquare: faHSquare,\n  faHouseMedical: faHouseMedical,\n  faCircleChevronRight: faCircleChevronRight,\n  faChevronCircleRight: faChevronCircleRight,\n  faFileCsv: faFileCsv,\n  faHatCowboy: faHatCowboy,\n  faFaceGrinTongueWink: faFaceGrinTongueWink,\n  faGrinTongueWink: faGrinTongueWink,\n  faL: faL,\n  faArrowDownShortWide: faArrowDownShortWide,\n  faSortAmountDesc: faSortAmountDesc,\n  faSortAmountDownAlt: faSortAmountDownAlt,\n  faHourglassHalf: faHourglassHalf,\n  faHourglass2: faHourglass2,\n  faSpoon: faSpoon,\n  faUtensilSpoon: faUtensilSpoon,\n  faCreditCard: faCreditCard,\n  faCreditCardAlt: faCreditCardAlt,\n  faFileInvoiceDollar: faFileInvoiceDollar,\n  faSpaghettiMonsterFlying: faSpaghettiMonsterFlying,\n  faPastafarianism: faPastafarianism,\n  faMartiniGlassCitrus: faMartiniGlassCitrus,\n  faCocktail: faCocktail,\n  faBullhorn: faBullhorn,\n  faBoxTissue: faBoxTissue,\n  faMattressPillow: faMattressPillow,\n  faChevronLeft: faChevronLeft,\n  faCloudMoonRain: faCloudMoonRain,\n  faArrowDown19: faArrowDown19,\n  faSortNumericAsc: faSortNumericAsc,\n  faSortNumericDown: faSortNumericDown,\n  faHandSpock: faHandSpock,\n  faWandMagicSparkles: faWandMagicSparkles,\n  faMagicWandSparkles: faMagicWandSparkles,\n  faCommentMedical: faCommentMedical,\n  faBellSlash: faBellSlash,\n  faHandshakeSlash: faHandshakeSlash,\n  faHandshakeAltSlash: faHandshakeAltSlash,\n  faHandshakeSimpleSlash: faHandshakeSimpleSlash,\n  faBottleWater: faBottleWater,\n  faDiceD20: faDiceD20,\n  faArrowDownZA: faArrowDownZA,\n  faSortAlphaDesc: faSortAlphaDesc,\n  faSortAlphaDownAlt: faSortAlphaDownAlt,\n  faBrush: faBrush,\n  faPersonWalkingDashedLineArrowRight: faPersonWalkingDashedLineArrowRight,\n  faArrowUpShortWide: faArrowUpShortWide,\n  faSortAmountUpAlt: faSortAmountUpAlt,\n  faGripVertical: faGripVertical,\n  faGridVertical: faGridVertical,\n  faCarTunnel: faCarTunnel,\n  faChartColumn: faChartColumn,\n  faCapricorn: faCapricorn,\n  faTruckArrowRight: faTruckArrowRight,\n  faTv: faTv,\n  faTelevision: faTelevision,\n  faTvAlt: faTvAlt,\n  faSection: faSection,\n  faPeace: faPeace,\n  faStar: faStar,\n  faFlag: faFlag,\n  faTriangleExclamation: faTriangleExclamation,\n  faExclamationTriangle: faExclamationTriangle,\n  faWarning: faWarning,\n  faSchoolCircleExclamation: faSchoolCircleExclamation,\n  faGraduationCap: faGraduationCap,\n  faMortarBoard: faMortarBoard,\n  faStore: faStore,\n  faUserAstronaut: faUserAstronaut,\n  faBuildingFlag: faBuildingFlag,\n  faMugSaucer: faMugSaucer,\n  faCoffee: faCoffee,\n  faLemon: faLemon,\n  faCaravan: faCaravan,\n  faQ: faQ,\n  faLock: faLock,\n  faPaintRoller: faPaintRoller,\n  faVolumeHigh: faVolumeHigh,\n  faVolumeUp: faVolumeUp,\n  faFolderPlus: faFolderPlus,\n  faMercury: faMercury,\n  faAnchor: faAnchor,\n  faSquareParking: faSquareParking,\n  faParking: faParking,\n  faHanukiah: faHanukiah,\n  faRotateLeft: faRotateLeft,\n  faRotateBack: faRotateBack,\n  faRotateBackward: faRotateBackward,\n  faUndoAlt: faUndoAlt,\n  faHeading: faHeading,\n  faHeader: faHeader,\n  faCrosshairs: faCrosshairs,\n  faCircleNodes: faCircleNodes,\n  faWindowRestore: faWindowRestore,\n  faR: faR,\n  faFilterCircleXmark: faFilterCircleXmark,\n  faGopuram: faGopuram,\n  faHeartCircleMinus: faHeartCircleMinus,\n  faStarOfLife: faStarOfLife,\n  faBusinessTime: faBusinessTime,\n  faBriefcaseClock: faBriefcaseClock,\n  faFireExtinguisher: faFireExtinguisher,\n  faArrowDownLong: faArrowDownLong,\n  faLongArrowDown: faLongArrowDown,\n  faUserMinus: faUserMinus,\n  faMoneyCheck: faMoneyCheck,\n  faHouseLaptop: faHouseLaptop,\n  faLaptopHouse: faLaptopHouse,\n  faDownload: faDownload,\n  faSagittarius: faSagittarius,\n  faCouch: faCouch,\n  faRoadLock: faRoadLock,\n  faScissors: faScissors,\n  faCut: faCut,\n  faBug: faBug,\n  faArrowRightFromBracket: faArrowRightFromBracket,\n  faSignOut: faSignOut,\n  faHandHoldingHand: faHandHoldingHand,\n  faStroopwafel: faStroopwafel,\n  faChild: faChild,\n  faIceCream: faIceCream,\n  faComputerMouse: faComputerMouse,\n  faMouse: faMouse,\n  faFaucet: faFaucet,\n  faAward: faAward,\n  faPersonDrowning: faPersonDrowning,\n  faCameraRotate: faCameraRotate,\n  faFaceGrinHearts: faFaceGrinHearts,\n  faGrinHearts: faGrinHearts,\n  faFileFragment: faFileFragment,\n  faPersonMilitaryRifle: faPersonMilitaryRifle,\n  faToggleOn: faToggleOn,\n  faLungsVirus: faLungsVirus,\n  faTableTennisPaddleBall: faTableTennisPaddleBall,\n  faPingPongPaddleBall: faPingPongPaddleBall,\n  faTableTennis: faTableTennis,\n  faBoxesPacking: faBoxesPacking,\n  faPersonChalkboard: faPersonChalkboard,\n  faDiceTwo: faDiceTwo,\n  faArrowRightArrowLeft: faArrowRightArrowLeft,\n  faExchange: faExchange,\n  faFootball: faFootball,\n  faFootballBall: faFootballBall,\n  faTruckMonster: faTruckMonster,\n  faAsterisk: faAsterisk,\n  faBatteryFull: faBatteryFull,\n  faBattery: faBattery,\n  faBattery5: faBattery5,\n  faChildDress: faChildDress,\n  faFaceKissBeam: faFaceKissBeam,\n  faKissBeam: faKissBeam,\n  faTrashCanArrowUp: faTrashCanArrowUp,\n  faTrashRestoreAlt: faTrashRestoreAlt,\n  faFont: faFont,\n  faBoreHole: faBoreHole,\n  faVirusCovid: faVirusCovid,\n  faFilePdf: faFilePdf,\n  faLanguage: faLanguage,\n  faShieldHalved: faShieldHalved,\n  faShieldAlt: faShieldAlt,\n  faCaretUp: faCaretUp,\n  faFilePen: faFilePen,\n  faFileEdit: faFileEdit,\n  faPersonBiking: faPersonBiking,\n  faBiking: faBiking,\n  faBookOpenReader: faBookOpenReader,\n  faBookReader: faBookReader,\n  faGlassWaterDroplet: faGlassWaterDroplet,\n  faTowerBroadcast: faTowerBroadcast,\n  faBroadcastTower: faBroadcastTower,\n  faMinimize: faMinimize,\n  faCompressArrowsAlt: faCompressArrowsAlt,\n  faArrowRightToCity: faArrowRightToCity,\n  faLaptopMedical: faLaptopMedical,\n  faBreadSlice: faBreadSlice,\n  faGlobe: faGlobe,\n  faFolderMinus: faFolderMinus,\n  faMaskFace: faMaskFace,\n  faBong: faBong,\n  faRoadBridge: faRoadBridge,\n  faArrowUp91: faArrowUp91,\n  faSortNumericUpAlt: faSortNumericUpAlt,\n  faMountainCity: faMountainCity,\n  faArrowDown91: faArrowDown91,\n  faSortNumericDesc: faSortNumericDesc,\n  faSortNumericDownAlt: faSortNumericDownAlt,\n  faFaceGrinWide: faFaceGrinWide,\n  faGrinAlt: faGrinAlt,\n  faPoop: faPoop,\n  faDharmachakra: faDharmachakra,\n  faBatteryQuarter: faBatteryQuarter,\n  faBattery2: faBattery2,\n  faAnkh: faAnkh,\n  faDiamond: faDiamond,\n  faSubscript: faSubscript,\n  faRupeeSign: faRupeeSign,\n  faRupee: faRupee,\n  faPersonRifle: faPersonRifle,\n  faD: faD,\n  faSquareNfi: faSquareNfi,\n  faTeeth: faTeeth,\n  faMagnifyingGlassDollar: faMagnifyingGlassDollar,\n  faSearchDollar: faSearchDollar,\n  faDumpsterFire: faDumpsterFire,\n  faUpload: faUpload,\n  faUserSlash: faUserSlash,\n  faUserAltSlash: faUserAltSlash,\n  faUserLargeSlash: faUserLargeSlash,\n  faArrowLeft: faArrowLeft,\n  faVialVirus: faVialVirus,\n  faCheckDouble: faCheckDouble,\n  faPaw: faPaw,\n  faHelmetSafety: faHelmetSafety,\n  faHardHat: faHardHat,\n  faHatHard: faHatHard,\n  faE: faE,\n  faFaceLaughSquint: faFaceLaughSquint,\n  faLaughSquint: faLaughSquint,\n  faDownLeftAndUpRightToCenter: faDownLeftAndUpRightToCenter,\n  faCompressAlt: faCompressAlt,\n  faGifts: faGifts,\n  faBed: faBed,\n  faMoneyBillTransfer: faMoneyBillTransfer,\n  faPersonRunning: faPersonRunning,\n  faRunning: faRunning,\n  faCircleChevronDown: faCircleChevronDown,\n  faChevronCircleDown: faChevronCircleDown,\n  faUserNurse: faUserNurse,\n  faFaceKissWinkHeart: faFaceKissWinkHeart,\n  faKissWinkHeart: faKissWinkHeart,\n  faFill: faFill,\n  faMoneyBill1Wave: faMoneyBill1Wave,\n  faMoneyBillWaveAlt: faMoneyBillWaveAlt,\n  faLandmark: faLandmark,\n  faMusic: faMusic,\n  faBookMedical: faBookMedical,\n  faShuffle: faShuffle,\n  faRandom: faRandom,\n  faUnderline: faUnderline,\n  faBuildingUser: faBuildingUser,\n  faRobot: faRobot,\n  faPlus: faPlus,\n  faAdd: faAdd,\n  faCopy: faCopy,\n  faChessKing: faChessKing,\n  faHouseFloodWater: faHouseFloodWater,\n  faBitcoinSign: faBitcoinSign,\n  faBox: faBox,\n  faSquarePlus: faSquarePlus,\n  faPlusSquare: faPlusSquare,\n  faArrowsLeftRight: faArrowsLeftRight,\n  faArrowsH: faArrowsH,\n  faFan: faFan,\n  faCrow: faCrow,\n  faFileCircleCheck: faFileCircleCheck,\n  faLinkSlash: faLinkSlash,\n  faChainBroken: faChainBroken,\n  faChainSlash: faChainSlash,\n  faUnlink: faUnlink,\n  faArrowRotateRight: faArrowRotateRight,\n  faArrowRightRotate: faArrowRightRotate,\n  faArrowRotateForward: faArrowRotateForward,\n  faRedo: faRedo,\n  faPenClip: faPenClip,\n  faPenAlt: faPenAlt,\n  faDoorClosed: faDoorClosed,\n  faArrowDownWideShort: faArrowDownWideShort,\n  faSortAmountAsc: faSortAmountAsc,\n  faSortAmountDown: faSortAmountDown,\n  faCaretDown: faCaretDown,\n  faK: faK,\n  faCheckToSlot: faCheckToSlot,\n  faVoteYea: faVoteYea,\n  faFishFins: faFishFins,\n  faCompress: faCompress,\n  faArrowUpAZ: faArrowUpAZ,\n  faSortAlphaUp: faSortAlphaUp,\n  faUserGraduate: faUserGraduate,\n  faFileCode: faFileCode,\n  faSoap: faSoap,\n  faRecycle: faRecycle,\n  faFaceGrinWink: faFaceGrinWink,\n  faGrinWink: faGrinWink,\n  faWaterLadder: faWaterLadder,\n  faLadderWater: faLadderWater,\n  faSwimmingPool: faSwimmingPool,\n  faGemini: faGemini,\n  faTowerCell: faTowerCell,\n  faColonSign: faColonSign,\n  faLaptopFile: faLaptopFile,\n  faBahai: faBahai,\n  faHaykal: faHaykal,\n  faMoneyBill1: faMoneyBill1,\n  faMoneyBillAlt: faMoneyBillAlt,\n  faCloudBolt: faCloudBolt,\n  faThunderstorm: faThunderstorm,\n  faEthernet: faEthernet,\n  faHryvniaSign: faHryvniaSign,\n  faHryvnia: faHryvnia,\n  faEyeSlash: faEyeSlash,\n  faCartFlatbedSuitcase: faCartFlatbedSuitcase,\n  faLuggageCart: faLuggageCart,\n  faRadiation: faRadiation,\n  faFileWord: faFileWord,\n  faBedPulse: faBedPulse,\n  faProcedures: faProcedures,\n  faTents: faTents,\n  faMugHot: faMugHot,\n  faBolt: faBolt,\n  faZap: faZap,\n  faJar: faJar,\n  faTruckPlane: faTruckPlane,\n  faHandHoldingHeart: faHandHoldingHeart,\n  faArrowRotateLeft: faArrowRotateLeft,\n  faArrowLeftRotate: faArrowLeftRotate,\n  faArrowRotateBack: faArrowRotateBack,\n  faArrowRotateBackward: faArrowRotateBackward,\n  faUndo: faUndo,\n  faFaceAngry: faFaceAngry,\n  faAngry: faAngry,\n  faBurst: faBurst,\n  faZ: faZ,\n  faBandage: faBandage,\n  faBandAid: faBandAid,\n  faPlaneCircleExclamation: faPlaneCircleExclamation,\n  faBusSide: faBusSide,\n  faBugs: faBugs,\n  faBeerMugEmpty: faBeerMugEmpty,\n  faBeer: faBeer,\n  faPersonCircleCheck: faPersonCircleCheck,\n  faStapler: faStapler,\n  faHouseMedicalCircleCheck: faHouseMedicalCircleCheck,\n  faNairaSign: faNairaSign,\n  faWifi: faWifi,\n  faWifi3: faWifi3,\n  faWifiStrong: faWifiStrong,\n  faMoneyCheckDollar: faMoneyCheckDollar,\n  faMoneyCheckAlt: faMoneyCheckAlt,\n  faEyeLowVision: faEyeLowVision,\n  faLowVision: faLowVision,\n  faCircleArrowUp: faCircleArrowUp,\n  faArrowCircleUp: faArrowCircleUp,\n  faCameraRetro: faCameraRetro,\n  faCapsules: faCapsules,\n  faPoo: faPoo,\n  faVolume: faVolume,\n  faVolumeMedium: faVolumeMedium,\n  faElevator: faElevator,\n  faTag: faTag,\n  faFileCircleMinus: faFileCircleMinus,\n  faDownLong: faDownLong,\n  faLongArrowAltDown: faLongArrowAltDown,\n  faCompactDisc: faCompactDisc,\n  faSuitcaseRolling: faSuitcaseRolling,\n  faBookQuran: faBookQuran,\n  faQuran: faQuran,\n  faPhoneSlash: faPhoneSlash,\n  faRoadCircleCheck: faRoadCircleCheck,\n  faShopLock: faShopLock,\n  faImagePortrait: faImagePortrait,\n  faPortrait: faPortrait,\n  faBridgeLock: faBridgeLock,\n  faHammer: faHammer,\n  faArrowUp19: faArrowUp19,\n  faSortNumericUp: faSortNumericUp,\n  faChessKnight: faChessKnight,\n  faHouseFloodWaterCircleArrowRight: faHouseFloodWaterCircleArrowRight,\n  faArrowUpRightFromSquare: faArrowUpRightFromSquare,\n  faExternalLink: faExternalLink,\n  faArrowDownUpAcrossLine: faArrowDownUpAcrossLine,\n  faFaceGrinBeam: faFaceGrinBeam,\n  faGrinBeam: faGrinBeam,\n  faRectangleAd: faRectangleAd,\n  faAd: faAd,\n  faBookTanakh: faBookTanakh,\n  faTanakh: faTanakh,\n  faHotTubPerson: faHotTubPerson,\n  faHotTub: faHotTub,\n  faFileHalfDashed: faFileHalfDashed,\n  faOutdent: faOutdent,\n  faDedent: faDedent,\n  faHandPeace: faHandPeace,\n  faHeadSideVirus: faHeadSideVirus,\n  faCompass: faCompass,\n  faPenNib: faPenNib,\n  faTentArrowsDown: faTentArrowsDown,\n  faForwardFast: faForwardFast,\n  faFastForward: faFastForward,\n  faCrop: faCrop,\n  faWhiskeyGlass: faWhiskeyGlass,\n  faGlassWhiskey: faGlassWhiskey,\n  faSquare: faSquare,\n  faFaceGrin: faFaceGrin,\n  faGrin: faGrin,\n  faFileContract: faFileContract,\n  faAngleUp: faAngleUp,\n  faFaceSmile: faFaceSmile,\n  faSmile: faSmile,\n  faPersonDressBurst: faPersonDressBurst,\n  faDivide: faDivide,\n  faCodeFork: faCodeFork,\n  faHouseFlag: faHouseFlag,\n  faBuildingColumns: faBuildingColumns,\n  faBank: faBank,\n  faInstitution: faInstitution,\n  faMuseum: faMuseum,\n  faUniversity: faUniversity,\n  faRug: faRug,\n  faCodeMerge: faCodeMerge,\n  faHouseTsunami: faHouseTsunami,\n  faMagnifyingGlassChart: faMagnifyingGlassChart,\n  faUmbrella: faUmbrella,\n  faHillRockslide: faHillRockslide,\n  faUserSecret: faUserSecret,\n  faPager: faPager,\n  faBriefcase: faBriefcase,\n  faTrowelBricks: faTrowelBricks,\n  faSocks: faSocks,\n  faT: faT,\n  faMicrochip: faMicrochip,\n  faTruckMedical: faTruckMedical,\n  faAmbulance: faAmbulance,\n  faOm: faOm,\n  faMosquitoNet: faMosquitoNet,\n  faPrescriptionBottle: faPrescriptionBottle,\n  faUsersGear: faUsersGear,\n  faUsersCog: faUsersCog,\n  faRoadCircleExclamation: faRoadCircleExclamation,\n  faPause: faPause,\n  faStaffSnake: faStaffSnake,\n  faRodAsclepius: faRodAsclepius,\n  faRodSnake: faRodSnake,\n  faStaffAesculapius: faStaffAesculapius,\n  faPiggyBank: faPiggyBank,\n  faMonument: faMonument,\n  faAnglesRight: faAnglesRight,\n  faAngleDoubleRight: faAngleDoubleRight,\n  faDesktop: faDesktop,\n  faDesktopAlt: faDesktopAlt,\n  faPlaneCircleXmark: faPlaneCircleXmark,\n  faRetweet: faRetweet,\n  faUserGear: faUserGear,\n  faUserCog: faUserCog,\n  faBorderAll: faBorderAll,\n  faCoins: faCoins,\n  faMarsStroke: faMarsStroke,\n  faHandshakeAngle: faHandshakeAngle,\n  faHandsHelping: faHandsHelping,\n  faArrowDown: faArrowDown,\n  faLocationDot: faLocationDot,\n  faMapMarkerAlt: faMapMarkerAlt,\n  faPlugCircleExclamation: faPlugCircleExclamation,\n  faCookieBite: faCookieBite,\n  faScrewdriverWrench: faScrewdriverWrench,\n  faTools: faTools,\n  faIndent: faIndent,\n  faBars: faBars,\n  faNavicon: faNavicon,\n  faHandsPraying: faHandsPraying,\n  faPrayingHands: faPrayingHands,\n  faViruses: faViruses,\n  faSchoolFlag: faSchoolFlag,\n  faTrademark: faTrademark,\n  faFireBurner: faFireBurner,\n  faFaceSmileBeam: faFaceSmileBeam,\n  faSmileBeam: faSmileBeam,\n  faTentArrowLeftRight: faTentArrowLeftRight,\n  faRoute: faRoute,\n  faAnglesUp: faAnglesUp,\n  faAngleDoubleUp: faAngleDoubleUp,\n  faBucket: faBucket,\n  faLessThanEqual: faLessThanEqual,\n  faFolderClosed: faFolderClosed,\n  faPersonThroughWindow: faPersonThroughWindow,\n  faSchoolLock: faSchoolLock,\n  faPersonBurst: faPersonBurst,\n  faLeftLong: faLeftLong,\n  faLongArrowAltLeft: faLongArrowAltLeft,\n  faLocationCrosshairs: faLocationCrosshairs,\n  faLocation: faLocation,\n  faPersonDotsFromLine: faPersonDotsFromLine,\n  faDiagnoses: faDiagnoses,\n  faGaugeSimpleHigh: faGaugeSimpleHigh,\n  faTachometer: faTachometer,\n  faTachometerFast: faTachometerFast,\n  faAnglesLeft: faAnglesLeft,\n  faAngleDoubleLeft: faAngleDoubleLeft,\n  faUpDown: faUpDown,\n  faArrowsAltV: faArrowsAltV,\n  faBatteryEmpty: faBatteryEmpty,\n  faBattery0: faBattery0,\n  faKeyboard: faKeyboard,\n  faCookie: faCookie,\n  faStopwatch: faStopwatch,\n  faEject: faEject,\n  faSatelliteDish: faSatelliteDish,\n  faFaceRollingEyes: faFaceRollingEyes,\n  faMehRollingEyes: faMehRollingEyes,\n  faListCheck: faListCheck,\n  faTasks: faTasks,\n  faSackXmark: faSackXmark,\n  faHashtag: faHashtag,\n  faTrain: faTrain,\n  faGamepad: faGamepad,\n  faFileExport: faFileExport,\n  faArrowRightFromFile: faArrowRightFromFile,\n  faFaceGrimace: faFaceGrimace,\n  faGrimace: faGrimace,\n  faTrainSubway: faTrainSubway,\n  faSubway: faSubway,\n  faCircleDot: faCircleDot,\n  faDotCircle: faDotCircle,\n  faObjectGroup: faObjectGroup,\n  faShip: faShip,\n  faC: faC,\n  faSquarePhone: faSquarePhone,\n  faPhoneSquare: faPhoneSquare,\n  faRulerCombined: faRulerCombined,\n  faArrowsRotate: faArrowsRotate,\n  faRefresh: faRefresh,\n  faSync: faSync,\n  faPersonDress: faPersonDress,\n  faFemale: faFemale,\n  faBookOpen: faBookOpen,\n  faFolderTree: faFolderTree,\n  faVirgo: faVirgo,\n  faBoxArchive: faBoxArchive,\n  faArchive: faArchive,\n  faTentArrowDownToLine: faTentArrowDownToLine,\n  faQrcode: faQrcode,\n  faDragon: faDragon,\n  faHourglassEnd: faHourglassEnd,\n  faHourglass3: faHourglass3,\n  faGrip: faGrip,\n  faGridHorizontal: faGridHorizontal,\n  faGripHorizontal: faGripHorizontal,\n  faBorderTopLeft: faBorderTopLeft,\n  faBorderStyle: faBorderStyle,\n  faListUl: faListUl,\n  faListDots: faListDots,\n  faPeopleRobbery: faPeopleRobbery,\n  faMobileButton: faMobileButton,\n  faArrowDownAZ: faArrowDownAZ,\n  faSortAlphaAsc: faSortAlphaAsc,\n  faSortAlphaDown: faSortAlphaDown,\n  faMoneyBill: faMoneyBill,\n  faCircleMinus: faCircleMinus,\n  faMinusCircle: faMinusCircle,\n  faArrowPointer: faArrowPointer,\n  faMousePointer: faMousePointer,\n  faSquareShareNodes: faSquareShareNodes,\n  faShareAltSquare: faShareAltSquare,\n  faTableCellsLarge: faTableCellsLarge,\n  faThLarge: faThLarge,\n  faCat: faCat,\n  faCalendarWeek: faCalendarWeek,\n  faCodeCompare: faCodeCompare,\n  faLeo: faLeo,\n  faRoadCircleXmark: faRoadCircleXmark,\n  faPallet: faPallet,\n  faCakeCandles: faCakeCandles,\n  faBirthdayCake: faBirthdayCake,\n  faCake: faCake,\n  faBugSlash: faBugSlash,\n  faTarp: faTarp,\n  faDiagramPredecessor: faDiagramPredecessor,\n  faFaceFlushed: faFaceFlushed,\n  faFlushed: faFlushed,\n  faDiagramNext: faDiagramNext,\n  faAnchorCircleXmark: faAnchorCircleXmark,\n  faPersonCircleXmark: faPersonCircleXmark,\n  faSpa: faSpa,\n  faAries: faAries,\n  faBarsProgress: faBarsProgress,\n  faTasksAlt: faTasksAlt,\n  faHeartCircleCheck: faHeartCircleCheck,\n  faMarsStrokeRight: faMarsStrokeRight,\n  faMarsStrokeH: faMarsStrokeH,\n  faTowerObservation: faTowerObservation,\n  faSterlingSign: faSterlingSign,\n  faGbp: faGbp,\n  faPoundSign: faPoundSign,\n  faFaucetDrip: faFaucetDrip,\n  faCircleInfo: faCircleInfo,\n  faInfoCircle: faInfoCircle,\n  faFeather: faFeather,\n  faBowlRice: faBowlRice,\n  faStarHalfStroke: faStarHalfStroke,\n  faStarHalfAlt: faStarHalfAlt,\n  faTemperatureArrowDown: faTemperatureArrowDown,\n  faTemperatureDown: faTemperatureDown,\n  faMaskVentilator: faMaskVentilator,\n  faFileVideo: faFileVideo,\n  faArrowTrendDown: faArrowTrendDown,\n  faOilCan: faOilCan,\n  faPeopleCarryBox: faPeopleCarryBox,\n  faPeopleCarry: faPeopleCarry,\n  faChair: faChair,\n  faWind: faWind,\n  faLayerGroup: faLayerGroup,\n  faHeadSideMask: faHeadSideMask,\n  faHands: faHands,\n  faSignLanguage: faSignLanguage,\n  faSigning: faSigning,\n  faTablets: faTablets,\n  faWeightHanging: faWeightHanging,\n  faDice: faDice,\n  faShopSlash: faShopSlash,\n  faStoreAltSlash: faStoreAltSlash,\n  faSortDown: faSortDown,\n  faSortDesc: faSortDesc,\n  faPesetaSign: faPesetaSign,\n  faTabletScreenButton: faTabletScreenButton,\n  faTabletAlt: faTabletAlt,\n  faHandHoldingDollar: faHandHoldingDollar,\n  faHandHoldingUsd: faHandHoldingUsd,\n  faShield: faShield,\n  faShieldBlank: faShieldBlank,\n  faFaceLaugh: faFaceLaugh,\n  faLaugh: faLaugh,\n  faHandsHolding: faHandsHolding,\n  faCartShopping: faCartShopping,\n  faShoppingCart: faShoppingCart,\n  faOctagon: faOctagon,\n  faHandPointer: faHandPointer,\n  faRegistered: faRegistered,\n  faHouseSignal: faHouseSignal,\n  faBangladeshiTakaSign: faBangladeshiTakaSign\n};\n\nexport { icons as fas, prefix, fa0, fa1, fa2, fa3, fa4, fa5, fa6, fa7, fa8, fa9, faDollarSign, faDollar, faUsd, faDog, faTruckMoving, faRotate, faSyncAlt, faSquareMinus, faMinusSquare, faAlignJustify, faCalendarCheck, faFaceKiss, faKiss, faKitchenSet, faDna, faChildReaching, faPaste, faFileClipboard, faMeteor, faGears, faCogs, faFileCirclePlus, faIcicles, faArrowTrendUp, faHexagonNodesBolt, faQuestion, faHandsBound, faPersonWalkingLuggage, faFileArrowDown, faFileDownload, faPersonBooth, faLocust, faRightLong, faLongArrowAltRight, faTruckDroplet, faHandHoldingMedical, faHandPointLeft, faCalculator, faMinus, faSubtract, faArrowUpZA, faSortAlphaUpAlt, faMicrophoneSlash, faSquarePen, faPenSquare, faPencilSquare, faHandFist, faFistRaised, faCommentSms, faSms, faSimCard, faScaleBalanced, faBalanceScale, faCar, faAutomobile, faCropSimple, faCropAlt, faMedal, faScroll, faFileExcel, faFilter, faDrum, faMapPin, faScaleUnbalancedFlip, faBalanceScaleRight, faArrowsToCircle, faEnvelope, faBaby, faSquareCaretDown, faCaretSquareDown, faTent, faA, faParachuteBox, faCartArrowDown, faBridgeCircleExclamation, faCloudArrowUp, faCloudUpload, faCloudUploadAlt, faAt, faIndianRupeeSign, faIndianRupee, faInr, faTruck, faChalkboardUser, faChalkboardTeacher, faUserCheck, faUserNinja, faPlantWilt, faWeightScale, faWeight, faCaretRight, faFlorinSign, faBell, faLariSign, faMillSign, faPersonSnowboarding, faSnowboarding, faTty, faTeletype, faUsersRectangle, faMobile, faMobileAndroid, faMobilePhone, faArrowsTurnToDots, faExclamation, faChurch, faToggleOff, faShoePrints, faFileCircleExclamation, faWallet, faMessage, faCommentAlt, faTrophy, faFaceDizzy, faDizzy, faBacteria, faEarDeaf, faDeaf, faDeafness, faHardOfHearing, faPeopleArrows, faPeopleArrowsLeftRight, faHandsClapping, faVirusCovidSlash, faCalendarDays, faCalendarAlt, faDiamondTurnRight, faDirections, faHandPointUp, faBezierCurve, faPersonHalfDress, faSquarePollHorizontal, faPollH, faSchoolCircleXmark, faHandLizard, faChalkboard, faBlackboard, faUpRightFromSquare, faExternalLinkAlt, faSquareFull, faClover, faTeethOpen, faBarsStaggered, faReorder, faStream, faWarehouse, faSwatchbook, faCampground, faPersonWalkingArrowRight, faGlasses, faCirclePause, faPauseCircle, faMemory, faGift, faMoneyBillWheat, faDungeon, faSuitcaseMedical, faMedkit, faPersonCane, faGauge, faDashboard, faGaugeMed, faTachometerAltAverage, faEnvelopeOpenText, faToolbox, faPowerOff, faSignal, faSignal5, faSignalPerfect, faArrowsSpin, faJoint, faBraille, faBasketShopping, faShoppingBasket, faBridge, faPlaneArrival, faCashRegister, faRing, faAquarius, faShareNodes, faShareAlt, faPersonCircleExclamation, faBinoculars, faKipSign, faHardDrive, faHdd, faRankingStar, faUserTie, faEllipsis, faEllipsisH, faStoreSlash, faPercent, faPercentage, faFileZipper, faFileArchive, faDisplay, faIcons, faHeartMusicCameraBolt, faRulerVertical, faMapLocationDot, faMapMarkedAlt, faHeartCrack, faHeartBroken, faCow, faRss, faFeed, faMagnifyingGlass, faSearch, faCloudMoon, faBoxesStacked, faBoxes, faBoxesAlt, faCodeBranch, faBan, faCancel, faJugDetergent, faReply, faMailReply, faSunPlantWilt, faBacterium, faRecordVinyl, faFloppyDisk, faSave, faToiletsPortable, faO, faPalette, faUnlock, faEarListen, faAssistiveListeningSystems, faCodePullRequest, faKey, faSkull, faMarsStrokeUp, faMarsStrokeV, faFireFlameSimple, faBurn, faTree, faSmog, faS, faJedi, faPersonHiking, faHiking, faArrowsUpToLine, faMarsDouble, faThermometer, faPaintbrush, faPaintBrush, faNeuter, faSquarePhoneFlip, faPhoneSquareAlt, faFaceGrinTongueSquint, faGrinTongueSquint, faCommentDollar, faHippo, faBowlFood, faSquareVirus, faCloudSunRain, faArrowRightLong, faLongArrowRight, faBuildingUn, faTemperatureLow, faDoorOpen, faAlignLeft, faCamera, faCameraAlt, faUsersRays, faRainbow, faSitemap, faFaceGrinStars, faGrinStars, faSortUp, faSortAsc, faEye, faCaretLeft, faAppleWhole, faAppleAlt, faScrollTorah, faTorah, faHouseLock, faArrowsLeftRightToLine, faTrash, faFaceSadTear, faSadTear, faFax, faPersonCirclePlus, faHamsa, faPersonCircleQuestion, faClipboardCheck, faShareFromSquare, faShareSquare, faReceipt, faEquals, faChevronUp, faVirusSlash, faSlash, faExpand, faNoteSticky, faStickyNote, faTableColumns, faColumns, faPersonShelter, faCircleNotch, faWater, faDeleteLeft, faBackspace, faBroomBall, faQuidditch, faQuidditchBroomBall, faJ, faShuttleSpace, faSpaceShuttle, faYinYang, faStop, faTrowel, faHandBackFist, faHandRock, faTemperatureHigh, faGreaterThan, faCrutch, faSeptagon, faHeptagon, faStreetView, faWaveSquare, faAngleLeft, faScrewdriver, faTractor, faBridgeCircleXmark, faVials, faStethoscope, faPodcast, faArrowUpRightDots, faChessQueen, faAnchorCircleExclamation, faEllipsisVertical, faEllipsisV, faHeartCircleExclamation, faBuildingCircleExclamation, faPersonArrowUpFromLine, faNotEqual, faTrainTram, faPlaneDeparture, faRightToBracket, faSignInAlt, faSdCard, faHouseCircleExclamation, faShekelSign, faIls, faShekel, faSheqel, faSheqelSign, faRadio, faHandDots, faAllergies, faBookSkull, faBookDead, faUnlockKeyhole, faUnlockAlt, faFileArrowUp, faFileUpload, faFaceGrinTears, faGrinTears, faPenToSquare, faEdit, faEarthEurope, faGlobeEurope, faFaceGrinBeamSweat, faGrinBeamSweat, faCircleHalfStroke, faAdjust, faPersonMilitaryToPerson, faTableCellsColumnLock, faTruckFieldUn, faClock, faClockFour, faBook, faFaceLaughWink, faLaughWink, faCloudMeatball, faChartArea, faAreaChart, faRupiahSign, faTextWidth, faSatellite, faMagnifyingGlassMinus, faSearchMinus, faPeopleGroup, faSquareBinary, faMasksTheater, faTheaterMasks, faCartPlus, faHandsAslInterpreting, faAmericanSignLanguageInterpreting, faAslInterpreting, faHandsAmericanSignLanguageInterpreting, faTableCellsRowUnlock, faRocket, faShrimp, faTengeSign, faTenge, faHouseChimneyMedical, faClinicMedical, faUsersSlash, faPaperPlane, faBookAtlas, faAtlas, faTable, faHeart, faCircleChevronUp, faChevronCircleUp, faBatteryHalf, faBattery3, faFontAwesome, faFontAwesomeFlag, faFontAwesomeLogoFull, faHandcuffs, faHatCowboySide, faIndustry, faLinesLeaning, faPassport, faInfinity, faClone, faForward, faM, faRoadSpikes, faMountain, faChess, faTemperatureThreeQuarters, faTemperature3, faThermometer3, faThermometerThreeQuarters, faB, faShieldVirus, faLitecoinSign, faDiceD6, faGripLinesVertical, faGolfBallTee, faGolfBall, faHexagon, faFolderOpen, faKaaba, faHandHolding, faSingleQuoteRight, faBottleDroplet, faWindowMinimize, faChevronRight, faEgg, faLandmarkDome, faLandmarkAlt, faWorm, faUserInjured, faStrikethrough, faBlog, faStopwatch20, faTruckPickup, faSeedling, faSprout, faTransgender, faTransgenderAlt, faStarHalf, faPhotoFilm, faPhotoVideo, faPictureInPicture, faPumpMedical, faFire, faMagnifyingGlassPlus, faSearchPlus, faFlask, faAlignRight, faCableCar, faTram, faKitMedical, faFirstAid, faGripLines, faBurger, faHamburger, faSnowman, faHotel, faPrint, faVolleyball, faVolleyballBall, faTrafficLight, faPlaneCircleCheck, faUsers, faCertificate, faAlarmClock, faHelicopterSymbol, faHouseChimneyCrack, faHouseDamage, faPersonMilitaryPointing, faDatabase, faNewspaper, faCloudRain, faMaximize, faExpandArrowsAlt, faLocationArrow, faCity, faXRay, faUmbrellaBeach, faArrowRightToBracket, faSignIn, faHeadset, faSplotch, faUpLong, faLongArrowAltUp, faHexagonNodes, faHospital, faHospitalAlt, faHospitalWide, faPersonHarassing, faMoneyBillTrendUp, faPenRuler, faPencilRuler, faRepeat, faBone, faFireFlameCurved, faFireAlt, faBusSimple, faBusAlt, faVenusMars, faBlender, faU, faShare, faMailForward, faPhoneFlip, faPhoneAlt, faToiletPortable, faPersonPregnant, faLessThan, faSuperscript, faCircleStop, faStopCircle, faArrowsUpDown, faArrowsV, faPooStorm, faPooBolt, faVideoSlash, faSquareXmark, faTimesSquare, faXmarkSquare, faHandHoldingDroplet, faHandHoldingWater, faWonSign, faKrw, faWon, faObjectUngroup, faComment, faHillAvalanche, faArrowsToEye, faSnowplow, faChartGantt, faVideo, faVideoCamera, faChessPawn, faSynagogue, faBuildingCircleCheck, faCalendarPlus, faWheelchairMove, faWheelchairAlt, faUserShield, faBold, faHeartPulse, faHeartbeat, faSquareRootVariable, faSquareRootAlt, faHandsBubbles, faHandsWash, faMarker, faClipboard, faPlaceOfWorship, faCannabis, faPeopleRoof, faDisease, faBookBible, faBible, faChessBoard, faMars, faLaptop, faUserXmark, faUserTimes, faFlagUsa, faHandMiddleFinger, faMortarPestle, faHeadSideCough, faPlaneLock, faBatteryThreeQuarters, faBattery4, faFrancSign, faFilterCircleDollar, faFunnelDollar, faCheese, faCircleH, faHospitalSymbol, faSchool, faDiceFive, faTornado, faJetFighter, faFighterJet, faThumbsDown, faBroom, faFileImport, faArrowRightToFile, faUtensils, faCutlery, faIdBadge, faSpider, faMobileRetro, faSignsPost, faMapSigns, faGroupArrowsRotate, faArrowsSplitUpAndLeft, faFillDrip, faShieldHeart, faPersonSkiingNordic, faSkiingNordic, faSquareCheck, faCheckSquare, faBath, faBathtub, faChessBishop, faPrescriptionBottleMedical, faPrescriptionBottleAlt, faDrawPolygon, faVectorPolygon, faICursor, faHeartCirclePlus, faShieldDog, faGreaterThanEqual, faEnvelopeOpen, faMound, faVoicemail, faVest, faAudioDescription, faW, faEyeDropper, faEyeDropperEmpty, faEyedropper, faCircleXmark, faTimesCircle, faXmarkCircle, faTrailer, faTurkishLiraSign, faTry, faTurkishLira, faVolcano, faWandSparkles, faMicrophone, faCrown, faTentArrowTurnLeft, faTruckFast, faShippingFast, faUserPen, faUserEdit, faUserClock, faShower, faSquareCaretUp, faCaretSquareUp, faMapLocation, faMapMarked, faPenFancy, faEuroSign, faEur, faEuro, faHouseCircleXmark, faLiraSign, faYenSign, faCny, faJpy, faRmb, faYen, faBoxOpen, faTruckField, faLocationPinLock, faPersonPraying, faPray, faClipboardList, faSackDollar, faMountainSun, faArrowUpWideShort, faSortAmountUp, faUsersLine, faStarOfDavid, faNotesMedical, faAustralSign, faClipboardUser, faFileImage, faSquareCaretRight, faCaretSquareRight, faVial, faHelicopter, faMitten, faGasPump, faEnvelopeCircleCheck, faPersonSkating, faSkating, faSun, faBaseball, faBaseballBall, faImage, faNotdef, faBasketball, faBasketballBall, faPencil, faPencilAlt, faPersonWalkingArrowLoopLeft, faDiceSix, faAnglesDown, faAngleDoubleDown, faSyringe, faWheatAwn, faWheatAlt, faPlaneUp, faAlignCenter, faHockeyPuck, faCircleArrowLeft, faArrowCircleLeft, faPlugCircleBolt, faRestroom, faAnchorLock, faTimeline, faLightbulb, faCircleArrowRight, faArrowCircleRight, faMarsAndVenus, faNetworkWired, faBuildingShield, faCode, faFeatherPointed, faFeatherAlt, faFileCircleQuestion, faSignature, faEarthAmericas, faEarth, faEarthAmerica, faGlobeAmericas, faCarrot, faTemperatureFull, faTemperature4, faThermometer4, faThermometerFull, faTableCellsRowLock, faBoltLightning, faCloudShowersWater, faArrowUpLong, faLongArrowUp, faAddressCard, faContactCard, faVcard, faAngleRight, faFaceMeh, faMeh, faArrowUpFromGroundWater, faMap, faUserPlus, faVenus, faDiagramSuccessor, faHeadSideCoughSlash, faDiagramProject, faProjectDiagram, faTerminal, faHouseFire, faMask, faHurricane, faEarthAfrica, faGlobeAfrica, faThumbtack, faThumbTack, faHandPointDown, faFaceMehBlank, faMehBlank, faTemperatureEmpty, faTemperature0, faThermometer0, faThermometerEmpty, faBorderNone, faHighlighter, faMoneyBillWave, faToiletPaperSlash, faFileShield, faTextHeight, faFaceGrinTongue, faGrinTongue, faFileSignature, faBuildingWheat, faPlugCircleMinus, faFutbol, faFutbolBall, faSoccerBall, faCirclePlus, faPlusCircle, faBrazilianRealSign, faStarAndCrescent, faFaceSurprise, faSurprise, faHospitalUser, faArrowDownUpLock, faFolder, faFolderBlank, faHollyBerry, faVenusDouble, faClipboardQuestion, faHotdog, faArrowUpFromBracket, faMicroscope, faCloud, faBaseballBatBall, faCarRear, faCarAlt, faThumbtackSlash, faThumbTackSlash, faPlusMinus, faHouseCircleCheck, faCalendarDay, faLibra, faCircle, faMobileVibrate, faFaceGrinSquint, faGrinSquint, faUsersBetweenLines, faHouseMedicalCircleXmark, faTableList, faThList, faFlaskVial, faCircleExclamation, faExclamationCircle, faTaxi, faCab, faTextSlash, faRemoveFormat, faPeoplePulling, faBackward, faCarBurst, faCarCrash, faLink, faChain, faBackwardStep, faStepBackward, faX, faCircleUser, faUserCircle, faRectangleList, faListAlt, faHand, faHandPaper, faCancer, faVanShuttle, faShuttleVan, faStairs, faHorseHead, faVault, faClosedCaptioningSlash, faDrumSteelpan, faThumbsUp, faStamp, faMenorah, faChildren, faChartLine, faLineChart, faSquareEnvelope, faEnvelopeSquare, faBanSmoking, faSmokingBan, faTruckFront, faBuilding, faBullseye, faArrowLeftLong, faLongArrowLeft, faChessRook, faBlenderPhone, faArrowTurnUp, faLevelUp, faBicycle, faCircleArrowDown, faArrowCircleDown, faGear, faCog, faMarsAndVenusBurst, faOtter, faCircleChevronLeft, faChevronCircleLeft, faCircleQuestion, faQuestionCircle, faWalkieTalkie, faUserGroup, faUserFriends, faHouseChimney, faHomeLg, faRightFromBracket, faSignOutAlt, faFile, faPlaneSlash, faCloudShowersHeavy, faPersonFalling, faTurnDown, faLevelDownAlt, faUpRightAndDownLeftFromCenter, faExpandAlt, faUserTag, faHandSparkles, faArrowsToDot, faFaceSadCry, faSadCry, faDongSign, faPeopleLine, faSquareRss, faRssSquare, faCalendarMinus, faChartDiagram, faFaceTired, faTired, faHandPointRight, faArrowUp, faCubesStacked, faChildCombatant, faChildRifle, faVestPatches, faMartiniGlassEmpty, faGlassMartini, faMagnet, faRoadBarrier, faCompassDrafting, faDraftingCompass, faSquarePersonConfined, faPlateWheat, faSignHanging, faSign, faCarBattery, faBatteryCar, faShirt, faTShirt, faTshirt, faParagraph, faEnvelopesBulk, faMailBulk, faGuitar, faSuitcase, faCircleUp, faArrowAltCircleUp, faF, faXmarksLines, faEarthOceania, faGlobeOceania, faCommentSlash, faPlay, faVialCircleCheck, faBridgeCircleCheck, faCediSign, faPuzzlePiece, faHelmetUn, faGlassWater, faHeartCircleBolt, faPumpSoap, faHandScissors, faDolly, faDollyBox, faPaperclip, faDemocrat, faSquareArrowUpRight, faExternalLinkSquare, faFerry, faMosquito, faBuildingCircleArrowRight, faLeftRight, faArrowsAltH, faVirus, faGem, faToilet, faSingleQuoteLeft, faMoneyBills, faTabletButton, faRectangleXmark, faRectangleTimes, faTimesRectangle, faWindowClose, faWrench, faTrashCan, faTrashAlt, faTableCells, faTh, faRibbon, faLandmarkFlag, faUpDownLeftRight, faArrowsAlt, faCarSide, faTrashArrowUp, faTrashRestore, faLifeRing, faCopyright, faFilePrescription, faEraser, faHourglassStart, faHourglass1, faCircleLeft, faArrowAltCircleLeft, faCruzeiroSign, faSmoking, faSquarePollVertical, faPoll, faPersonCircleMinus, faBiohazard, faBellConcierge, faConciergeBell, faRulerHorizontal, faHorse, faCalendar, faHandsHoldingChild, faItalic, faKhanda, faFaceFrownOpen, faFrownOpen, faCheck, faFingerprint, faChargingStation, faUserLock, faMobileScreenButton, faMobileAlt, faAnchorCircleCheck, faPersonWalkingWithCane, faBlind, faFileWaveform, faFileMedicalAlt, faHouseCrack, faHatWizard, faUserDoctor, faUserMd, faChartBar, faBarChart, faSprayCanSparkles, faAirFreshener, faBahtSign, faTemperatureArrowUp, faTemperatureUp, faWebAwesome, faNonBinary, faN, faArrowsUpDownLeftRight, faArrows, faHouse, faHome, faHomeAlt, faHomeLgAlt, faSpinner, faGavel, faLegal, faTicketSimple, faTicketAlt, faDove, faTarpDroplet, faTreeCity, faTurnUp, faLevelUpAlt, faTemperatureQuarter, faTemperature1, faThermometer1, faThermometerQuarter, faSliders, faSlidersH, faMosque, faH, faInfo, faPersonWalking, faWalking, faArrowTurnDown, faLevelDown, faRoad, faSpiral, faFaceFrown, faFrown, faWineGlassEmpty, faWineGlassAlt, faClapperboard, faForwardStep, faStepForward, faSquareUpRight, faExternalLinkSquareAlt, faBookJournalWhills, faJournalWhills, faChampagneGlasses, faGlassCheers, faDumpster, faHeartCircleXmark, faComputer, faWandMagic, faMagic, faBrain, faBriefcaseMedical, faHouseMedicalCircleExclamation, faCodeCommit, faPersonBreastfeeding, faPersonRays, faManatSign, faSort, faUnsorted, faCircleRadiation, faRadiationAlt, faLaptopCode, faSink, faArrowUpFromWaterPump, faMicrophoneLinesSlash, faMicrophoneAltSlash, faServer, faUser, faUserAlt, faUserLarge, faSnowflake, faTaurus, faSkullCrossbones, faPesoSign, faWineGlass, faTemperatureHalf, faTemperature2, faThermometer2, faThermometerHalf, faTicket, faWheatAwnCircleExclamation, faArrowsTurnRight, faCandyCane, faWheelchair, faSpellCheck, faVolumeOff, faLungs, faBookmark, faBarcode, faListOl, faList12, faListNumeric, faFileCircleXmark, faCube, faTape, faBomb, faScaleUnbalanced, faBalanceScaleLeft, faSquareCaretLeft, faCaretSquareLeft, faRuler, faI, faVolumeXmark, faVolumeMute, faVolumeTimes, faArchway, faPersonDigging, faDigging, faGaugeHigh, faTachometerAlt, faTachometerAltFast, faGenderless, faCloudSun, faArrowRight, faHandshake, faHandshakeAlt, faHandshakeSimple, faPersonSkiing, faSkiing, faBridgeWater, faBuildingNgo, faIgloo, faCircleDollarToSlot, faDonate, faY, faFaceSmileWink, faSmileWink, faDiceFour, faFaceGrinSquintTears, faGrinSquintTears, faFileAudio, faArrowsDownToLine, faG, faVihara, faFlagCheckered, faGaugeSimple, faGaugeSimpleMed, faTachometerAverage, faRightLeft, faExchangeAlt, faPills, faExplosion, faArrowsDownToPeople, faUsersViewfinder, faCarOn, faSleigh, faDumbbell, faBabyCarriage, faCarriageBaby, faKiwiBird, faCalendarXmark, faCalendarTimes, faCircleDown, faArrowAltCircleDown, faFileMedical, faXmark, faClose, faMultiply, faRemove, faTimes, faShapes, faTriangleCircleSquare, faDiceOne, faLockOpen, faPepperHot, faDropletSlash, faTintSlash, faDroplet, faTint, faFileLines, faFileAlt, faFileText, faCommentsDollar, faMagnifyingGlassLocation, faSearchLocation, faFileInvoice, faPentagon, faRepublican, faShop, faStoreAlt, faFilm, faFilmAlt, faFilmSimple, faBuildingCircleXmark, faComments, faTags, faGun, faCircleCheck, faCheckCircle, faScorpio, faIdCardClip, faIdCardAlt, faMoon, faOilWell, faTachographDigital, faDigitalTachograph, faTablet, faTabletAndroid, faRubleSign, faRouble, faRub, faRuble, faClosedCaptioning, faPen, faPlane, faImages, faMobileScreen, faMobileAndroidAlt, faGuaraniSign, faBagShopping, faShoppingBag, faCircleRight, faArrowAltCircleRight, faPhoneVolume, faVolumeControlPhone, faCubes, faPhone, faToriiGate, faBacon, faPersonFallingBurst, faQuoteRight, faQuoteRightAlt, faHouseMedicalFlag, faPrescription, faDiceThree, faBuildingLock, faIdCard, faDriversLicense, faCirclePlay, faPlayCircle, faFaceLaughBeam, faLaughBeam, faLeaf, faHouseChimneyUser, faRotateRight, faRedoAlt, faRotateForward, faTooth, faHouseChimneyWindow, faMotorcycle, faBackwardFast, faFastBackward, faAddressBook, faContactBook, faSailboat, faBookBookmark, faMagnifyingGlassArrowRight, faMicrophoneLines, faMicrophoneAlt, faReplyAll, faMailReplyAll, faUniversalAccess, faToiletPaper, faToiletPaperAlt, faToiletPaperBlank, faVrCardboard, faPizzaSlice, faSprayCan, faVolumeLow, faVolumeDown, faCross, faPerson, faMale, faHourglass, faHourglassEmpty, faFish, faDrumstickBite, faChartSimple, faAtom, faP, faJetFighterUp, faPlugCircleXmark, faSheetPlastic, faV, faList, faListSquares, faPisces, faSolarPanel, faLandMineOn, faHeadphones, faHeadphonesAlt, faHeadphonesSimple, faBus, faFilePowerpoint, faQuoteLeft, faQuoteLeftAlt, faChevronDown, faEarthAsia, faGlobeAsia, faCentSign, faShieldCat, faSchoolCircleCheck, faMartiniGlass, faGlassMartiniAlt, faPlug, faPanorama, faClockRotateLeft, faHistory, faJarWheat, faCloudArrowDown, faCloudDownload, faCloudDownloadAlt, faTruckRampBox, faTruckLoading, faAngleDown, faPlugCircleCheck, faWindowMaximize, faHandsHoldingCircle, faLocationPin, faMapMarker, faBowlingBall, faCartFlatbed, faDollyFlatbed, faHouseUser, faHomeUser, faGhost, faCommentNodes, faPersonArrowDownToLine, faPlugCirclePlus, faPersonSwimming, faSwimmer, faCommentDots, faCommenting, faChartPie, faPieChart, faFrog, faWineBottle, faInbox, faSquareH, faHSquare, faHouseMedical, faCircleChevronRight, faChevronCircleRight, faFileCsv, faHatCowboy, faFaceGrinTongueWink, faGrinTongueWink, faL, faArrowDownShortWide, faSortAmountDesc, faSortAmountDownAlt, faHourglassHalf, faHourglass2, faSpoon, faUtensilSpoon, faCreditCard, faCreditCardAlt, faFileInvoiceDollar, faSpaghettiMonsterFlying, faPastafarianism, faMartiniGlassCitrus, faCocktail, faBullhorn, faBoxTissue, faMattressPillow, faChevronLeft, faCloudMoonRain, faArrowDown19, faSortNumericAsc, faSortNumericDown, faHandSpock, faWandMagicSparkles, faMagicWandSparkles, faCommentMedical, faBellSlash, faHandshakeSlash, faHandshakeAltSlash, faHandshakeSimpleSlash, faBottleWater, faDiceD20, faArrowDownZA, faSortAlphaDesc, faSortAlphaDownAlt, faBrush, faPersonWalkingDashedLineArrowRight, faArrowUpShortWide, faSortAmountUpAlt, faGripVertical, faGridVertical, faCarTunnel, faChartColumn, faCapricorn, faTruckArrowRight, faTv, faTelevision, faTvAlt, faSection, faPeace, faStar, faFlag, faTriangleExclamation, faExclamationTriangle, faWarning, faSchoolCircleExclamation, faGraduationCap, faMortarBoard, faStore, faUserAstronaut, faBuildingFlag, faMugSaucer, faCoffee, faLemon, faCaravan, faQ, faLock, faPaintRoller, faVolumeHigh, faVolumeUp, faFolderPlus, faMercury, faAnchor, faSquareParking, faParking, faHanukiah, faRotateLeft, faRotateBack, faRotateBackward, faUndoAlt, faHeading, faHeader, faCrosshairs, faCircleNodes, faWindowRestore, faR, faFilterCircleXmark, faGopuram, faHeartCircleMinus, faStarOfLife, faBusinessTime, faBriefcaseClock, faFireExtinguisher, faArrowDownLong, faLongArrowDown, faUserMinus, faMoneyCheck, faHouseLaptop, faLaptopHouse, faDownload, faSagittarius, faCouch, faRoadLock, faScissors, faCut, faBug, faArrowRightFromBracket, faSignOut, faHandHoldingHand, faStroopwafel, faChild, faIceCream, faComputerMouse, faMouse, faFaucet, faAward, faPersonDrowning, faCameraRotate, faFaceGrinHearts, faGrinHearts, faFileFragment, faPersonMilitaryRifle, faToggleOn, faLungsVirus, faTableTennisPaddleBall, faPingPongPaddleBall, faTableTennis, faBoxesPacking, faPersonChalkboard, faDiceTwo, faArrowRightArrowLeft, faExchange, faFootball, faFootballBall, faTruckMonster, faAsterisk, faBatteryFull, faBattery, faBattery5, faChildDress, faFaceKissBeam, faKissBeam, faTrashCanArrowUp, faTrashRestoreAlt, faFont, faBoreHole, faVirusCovid, faFilePdf, faLanguage, faShieldHalved, faShieldAlt, faCaretUp, faFilePen, faFileEdit, faPersonBiking, faBiking, faBookOpenReader, faBookReader, faGlassWaterDroplet, faTowerBroadcast, faBroadcastTower, faMinimize, faCompressArrowsAlt, faArrowRightToCity, faLaptopMedical, faBreadSlice, faGlobe, faFolderMinus, faMaskFace, faBong, faRoadBridge, faArrowUp91, faSortNumericUpAlt, faMountainCity, faArrowDown91, faSortNumericDesc, faSortNumericDownAlt, faFaceGrinWide, faGrinAlt, faPoop, faDharmachakra, faBatteryQuarter, faBattery2, faAnkh, faDiamond, faSubscript, faRupeeSign, faRupee, faPersonRifle, faD, faSquareNfi, faTeeth, faMagnifyingGlassDollar, faSearchDollar, faDumpsterFire, faUpload, faUserSlash, faUserAltSlash, faUserLargeSlash, faArrowLeft, faVialVirus, faCheckDouble, faPaw, faHelmetSafety, faHardHat, faHatHard, faE, faFaceLaughSquint, faLaughSquint, faDownLeftAndUpRightToCenter, faCompressAlt, faGifts, faBed, faMoneyBillTransfer, faPersonRunning, faRunning, faCircleChevronDown, faChevronCircleDown, faUserNurse, faFaceKissWinkHeart, faKissWinkHeart, faFill, faMoneyBill1Wave, faMoneyBillWaveAlt, faLandmark, faMusic, faBookMedical, faShuffle, faRandom, faUnderline, faBuildingUser, faRobot, faPlus, faAdd, faCopy, faChessKing, faHouseFloodWater, faBitcoinSign, faBox, faSquarePlus, faPlusSquare, faArrowsLeftRight, faArrowsH, faFan, faCrow, faFileCircleCheck, faLinkSlash, faChainBroken, faChainSlash, faUnlink, faArrowRotateRight, faArrowRightRotate, faArrowRotateForward, faRedo, faPenClip, faPenAlt, faDoorClosed, faArrowDownWideShort, faSortAmountAsc, faSortAmountDown, faCaretDown, faK, faCheckToSlot, faVoteYea, faFishFins, faCompress, faArrowUpAZ, faSortAlphaUp, faUserGraduate, faFileCode, faSoap, faRecycle, faFaceGrinWink, faGrinWink, faWaterLadder, faLadderWater, faSwimmingPool, faGemini, faTowerCell, faColonSign, faLaptopFile, faBahai, faHaykal, faMoneyBill1, faMoneyBillAlt, faCloudBolt, faThunderstorm, faEthernet, faHryvniaSign, faHryvnia, faEyeSlash, faCartFlatbedSuitcase, faLuggageCart, faRadiation, faFileWord, faBedPulse, faProcedures, faTents, faMugHot, faBolt, faZap, faJar, faTruckPlane, faHandHoldingHeart, faArrowRotateLeft, faArrowLeftRotate, faArrowRotateBack, faArrowRotateBackward, faUndo, faFaceAngry, faAngry, faBurst, faZ, faBandage, faBandAid, faPlaneCircleExclamation, faBusSide, faBugs, faBeerMugEmpty, faBeer, faPersonCircleCheck, faStapler, faHouseMedicalCircleCheck, faNairaSign, faWifi, faWifi3, faWifiStrong, faMoneyCheckDollar, faMoneyCheckAlt, faEyeLowVision, faLowVision, faCircleArrowUp, faArrowCircleUp, faCameraRetro, faCapsules, faPoo, faVolume, faVolumeMedium, faElevator, faTag, faFileCircleMinus, faDownLong, faLongArrowAltDown, faCompactDisc, faSuitcaseRolling, faBookQuran, faQuran, faPhoneSlash, faRoadCircleCheck, faShopLock, faImagePortrait, faPortrait, faBridgeLock, faHammer, faArrowUp19, faSortNumericUp, faChessKnight, faHouseFloodWaterCircleArrowRight, faArrowUpRightFromSquare, faExternalLink, faArrowDownUpAcrossLine, faFaceGrinBeam, faGrinBeam, faRectangleAd, faAd, faBookTanakh, faTanakh, faHotTubPerson, faHotTub, faFileHalfDashed, faOutdent, faDedent, faHandPeace, faHeadSideVirus, faCompass, faPenNib, faTentArrowsDown, faForwardFast, faFastForward, faCrop, faWhiskeyGlass, faGlassWhiskey, faSquare, faFaceGrin, faGrin, faFileContract, faAngleUp, faFaceSmile, faSmile, faPersonDressBurst, faDivide, faCodeFork, faHouseFlag, faBuildingColumns, faBank, faInstitution, faMuseum, faUniversity, faRug, faCodeMerge, faHouseTsunami, faMagnifyingGlassChart, faUmbrella, faHillRockslide, faUserSecret, faPager, faBriefcase, faTrowelBricks, faSocks, faT, faMicrochip, faTruckMedical, faAmbulance, faOm, faMosquitoNet, faPrescriptionBottle, faUsersGear, faUsersCog, faRoadCircleExclamation, faPause, faStaffSnake, faRodAsclepius, faRodSnake, faStaffAesculapius, faPiggyBank, faMonument, faAnglesRight, faAngleDoubleRight, faDesktop, faDesktopAlt, faPlaneCircleXmark, faRetweet, faUserGear, faUserCog, faBorderAll, faCoins, faMarsStroke, faHandshakeAngle, faHandsHelping, faArrowDown, faLocationDot, faMapMarkerAlt, faPlugCircleExclamation, faCookieBite, faScrewdriverWrench, faTools, faIndent, faBars, faNavicon, faHandsPraying, faPrayingHands, faViruses, faSchoolFlag, faTrademark, faFireBurner, faFaceSmileBeam, faSmileBeam, faTentArrowLeftRight, faRoute, faAnglesUp, faAngleDoubleUp, faBucket, faLessThanEqual, faFolderClosed, faPersonThroughWindow, faSchoolLock, faPersonBurst, faLeftLong, faLongArrowAltLeft, faLocationCrosshairs, faLocation, faPersonDotsFromLine, faDiagnoses, faGaugeSimpleHigh, faTachometer, faTachometerFast, faAnglesLeft, faAngleDoubleLeft, faUpDown, faArrowsAltV, faBatteryEmpty, faBattery0, faKeyboard, faCookie, faStopwatch, faEject, faSatelliteDish, faFaceRollingEyes, faMehRollingEyes, faListCheck, faTasks, faSackXmark, faHashtag, faTrain, faGamepad, faFileExport, faArrowRightFromFile, faFaceGrimace, faGrimace, faTrainSubway, faSubway, faCircleDot, faDotCircle, faObjectGroup, faShip, faC, faSquarePhone, faPhoneSquare, faRulerCombined, faArrowsRotate, faRefresh, faSync, faPersonDress, faFemale, faBookOpen, faFolderTree, faVirgo, faBoxArchive, faArchive, faTentArrowDownToLine, faQrcode, faDragon, faHourglassEnd, faHourglass3, faGrip, faGridHorizontal, faGripHorizontal, faBorderTopLeft, faBorderStyle, faListUl, faListDots, faPeopleRobbery, faMobileButton, faArrowDownAZ, faSortAlphaAsc, faSortAlphaDown, faMoneyBill, faCircleMinus, faMinusCircle, faArrowPointer, faMousePointer, faSquareShareNodes, faShareAltSquare, faTableCellsLarge, faThLarge, faCat, faCalendarWeek, faCodeCompare, faLeo, faRoadCircleXmark, faPallet, faCakeCandles, faBirthdayCake, faCake, faBugSlash, faTarp, faDiagramPredecessor, faFaceFlushed, faFlushed, faDiagramNext, faAnchorCircleXmark, faPersonCircleXmark, faSpa, faAries, faBarsProgress, faTasksAlt, faHeartCircleCheck, faMarsStrokeRight, faMarsStrokeH, faTowerObservation, faSterlingSign, faGbp, faPoundSign, faFaucetDrip, faCircleInfo, faInfoCircle, faFeather, faBowlRice, faStarHalfStroke, faStarHalfAlt, faTemperatureArrowDown, faTemperatureDown, faMaskVentilator, faFileVideo, faArrowTrendDown, faOilCan, faPeopleCarryBox, faPeopleCarry, faChair, faWind, faLayerGroup, faHeadSideMask, faHands, faSignLanguage, faSigning, faTablets, faWeightHanging, faDice, faShopSlash, faStoreAltSlash, faSortDown, faSortDesc, faPesetaSign, faTabletScreenButton, faTabletAlt, faHandHoldingDollar, faHandHoldingUsd, faShield, faShieldBlank, faFaceLaugh, faLaugh, faHandsHolding, faCartShopping, faShoppingCart, faOctagon, faHandPointer, faRegistered, faHouseSignal, faBangladeshiTakaSign };\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Ontology-specific accent maps — the per-kind colour and per-link-kind\n * stroke dash pattern that the renderer can't get from the shared Chakra\n * theme alone.\n *\n * Colour values reference the shared brand / gray / status palette so they\n * track theme changes. Edge dash patterns are SVG `stroke-dasharray`\n * strings (not colours) so they don't belong in the theme.\n *\n * Both maps are typed as `Record<OntologyXxxKind, ...>` — if the East\n * `NodeKindType` / `LinkKindType` gains a tag, TypeScript flags the\n * missing entry here as a compile error.\n *\n * @packageDocumentation\n */\n\nimport type { OntologyNodeKind, OntologyLinkKind } from './types.js';\n\n/**\n * Per-kind 2px top-stripe colour, applied to the node card. Card body\n * stays neutral `paper / ink` regardless of kind.\n *\n * Values are theme tokens, or `color-mix()` over theme tokens for the\n * blended kinds — so they follow colour-mode changes. Mixed\n * tones for `computation` / `resource` / `policy` / `document` use\n * `color-mix` math against those same anchors (precomputed because Chakra\n * tokens don't natively express `color-mix`).\n */\nexport const NODE_KIND_ACCENT: Record<OntologyNodeKind, string> = {\n    process:     'brand.600',\n    computation: 'color-mix(in srgb, var(--chakra-colors-brand-600) 60%, var(--chakra-colors-gray-500))',\n    decision:    'brand.700',\n    objective:   'gray.800',\n    kpi:         'status.pos',\n    agent:       'color-mix(in srgb, var(--chakra-colors-brand-700) 45%, color-mix(in srgb, var(--chakra-colors-status-warn) 15%, var(--chakra-colors-gray-500)))', // plum — people/role tone\n    data:        'status.warn',\n    resource:    'color-mix(in srgb, var(--chakra-colors-brand-600) 30%, var(--chakra-colors-gray-500))',\n    policy:      'color-mix(in srgb, var(--chakra-colors-status-warn) 50%, var(--chakra-colors-gray-600))',\n    document:    'color-mix(in srgb, var(--chakra-colors-brand-600) 30%, var(--chakra-colors-gray-100))',\n    group:       'gray.600',\n};\n\n/**\n * Per-link-kind stroke dash pattern. Empty string `'none'` (CSS-friendly)\n * → solid line. Patterns mirror the schematic vocabulary\n * (flow / signal / dependency / constraint / simulation) in\n * `east-ui-showcase/dist-design/configure__pattern__schematic.html`.\n */\nexport const EDGE_DASH: Record<OntologyLinkKind, string> = {\n    // flow — solid\n    uses:              'none',\n    executes:          'none',\n    produces:          'none',\n    used_by:           'none',\n    drives:            'none',\n    contains:          'none',\n    results_in:        'none',\n    // signal\n    informs:           '4,4',\n    measures:          '4,4',\n    // dependency\n    gets_data_from:    '1.5,4',\n    inserts_data_into: '1.5,4',\n    references:        '1.5,4',\n    // constraint\n    constrains:        '8,4',\n    validates:         '8,4',\n    defines:           '8,4',\n    // simulation\n    simulates:         '10,2,2,2',\n};\n","/*!\n * Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com\n * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)\n * Copyright 2026 Fonticons, Inc.\n */\nfunction _arrayLikeToArray(r, a) {\n  (null == a || a > r.length) && (a = r.length);\n  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n  return n;\n}\nfunction _arrayWithHoles(r) {\n  if (Array.isArray(r)) return r;\n}\nfunction _arrayWithoutHoles(r) {\n  if (Array.isArray(r)) return _arrayLikeToArray(r);\n}\nfunction _classCallCheck(a, n) {\n  if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(e, r) {\n  for (var t = 0; t < r.length; t++) {\n    var o = r[t];\n    o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);\n  }\n}\nfunction _createClass(e, r, t) {\n  return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n    writable: !1\n  }), e;\n}\nfunction _createForOfIteratorHelper(r, e) {\n  var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n  if (!t) {\n    if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) {\n      t && (r = t);\n      var n = 0,\n        F = function () {};\n      return {\n        s: F,\n        n: function () {\n          return n >= r.length ? {\n            done: !0\n          } : {\n            done: !1,\n            value: r[n++]\n          };\n        },\n        e: function (r) {\n          throw r;\n        },\n        f: F\n      };\n    }\n    throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n  }\n  var o,\n    a = !0,\n    u = !1;\n  return {\n    s: function () {\n      t = t.call(r);\n    },\n    n: function () {\n      var r = t.next();\n      return a = r.done, r;\n    },\n    e: function (r) {\n      u = !0, o = r;\n    },\n    f: function () {\n      try {\n        a || null == t.return || t.return();\n      } finally {\n        if (u) throw o;\n      }\n    }\n  };\n}\nfunction _defineProperty(e, r, t) {\n  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n    value: t,\n    enumerable: !0,\n    configurable: !0,\n    writable: !0\n  }) : e[r] = t, e;\n}\nfunction _inherits(t, e) {\n  if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\");\n  t.prototype = Object.create(e && e.prototype, {\n    constructor: {\n      value: t,\n      writable: !0,\n      configurable: !0\n    }\n  }), Object.defineProperty(t, \"prototype\", {\n    writable: !1\n  }), e && _setPrototypeOf(t, e);\n}\nfunction _iterableToArray(r) {\n  if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nfunction _iterableToArrayLimit(r, l) {\n  var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n  if (null != t) {\n    var e,\n      n,\n      i,\n      u,\n      a = [],\n      f = !0,\n      o = !1;\n    try {\n      if (i = (t = t.call(r)).next, 0 === l) {\n        if (Object(t) !== t) return;\n        f = !1;\n      } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n    } catch (r) {\n      o = !0, n = r;\n    } finally {\n      try {\n        if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n      } finally {\n        if (o) throw n;\n      }\n    }\n    return a;\n  }\n}\nfunction _nonIterableRest() {\n  throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _nonIterableSpread() {\n  throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction ownKeys(e, r) {\n  var t = Object.keys(e);\n  if (Object.getOwnPropertySymbols) {\n    var o = Object.getOwnPropertySymbols(e);\n    r && (o = o.filter(function (r) {\n      return Object.getOwnPropertyDescriptor(e, r).enumerable;\n    })), t.push.apply(t, o);\n  }\n  return t;\n}\nfunction _objectSpread2(e) {\n  for (var r = 1; r < arguments.length; r++) {\n    var t = null != arguments[r] ? arguments[r] : {};\n    r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n      _defineProperty(e, r, t[r]);\n    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n    });\n  }\n  return e;\n}\nfunction _setPrototypeOf(t, e) {\n  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n    return t.__proto__ = e, t;\n  }, _setPrototypeOf(t, e);\n}\nfunction _slicedToArray(r, e) {\n  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _toConsumableArray(r) {\n  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();\n}\nfunction _toPrimitive(t, r) {\n  if (\"object\" != typeof t || !t) return t;\n  var e = t[Symbol.toPrimitive];\n  if (void 0 !== e) {\n    var i = e.call(t, r || \"default\");\n    if (\"object\" != typeof i) return i;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n  var i = _toPrimitive(t, \"string\");\n  return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _typeof(o) {\n  \"@babel/helpers - typeof\";\n\n  return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n    return typeof o;\n  } : function (o) {\n    return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n  }, _typeof(o);\n}\nfunction _unsupportedIterableToArray(r, a) {\n  if (r) {\n    if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n    var t = {}.toString.call(r).slice(8, -1);\n    return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n  }\n}\nfunction _wrapRegExp() {\n  _wrapRegExp = function (e, r) {\n    return new BabelRegExp(e, void 0, r);\n  };\n  var e = RegExp.prototype,\n    r = new WeakMap();\n  function BabelRegExp(e, t, p) {\n    var o = RegExp(e, t);\n    return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype);\n  }\n  function buildGroups(e, t) {\n    var p = r.get(t);\n    return Object.keys(p).reduce(function (r, t) {\n      var o = p[t];\n      if (\"number\" == typeof o) r[t] = e[o];else {\n        for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;\n        r[t] = e[o[i]];\n      }\n      return r;\n    }, Object.create(null));\n  }\n  return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {\n    var t = e.exec.call(this, r);\n    if (t) {\n      t.groups = buildGroups(t, this);\n      var p = t.indices;\n      p && (p.groups = buildGroups(p, this));\n    }\n    return t;\n  }, BabelRegExp.prototype[Symbol.replace] = function (t, p) {\n    if (\"string\" == typeof p) {\n      var o = r.get(this);\n      return e[Symbol.replace].call(this, t, p.replace(/\\$<([^>]+)(>|$)/g, function (e, r, t) {\n        if (\"\" === t) return e;\n        var p = o[r];\n        return Array.isArray(p) ? \"$\" + p.join(\"$\") : \"number\" == typeof p ? \"$\" + p : \"\";\n      }));\n    }\n    if (\"function\" == typeof p) {\n      var i = this;\n      return e[Symbol.replace].call(this, t, function () {\n        var e = arguments;\n        return \"object\" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);\n      });\n    }\n    return e[Symbol.replace].call(this, t, p);\n  }, _wrapRegExp.apply(this, arguments);\n}\n\nvar noop = function noop() {};\nvar _WINDOW = {};\nvar _DOCUMENT = {};\nvar _MUTATION_OBSERVER = null;\nvar _PERFORMANCE = {\n  mark: noop,\n  measure: noop\n};\ntry {\n  if (typeof window !== 'undefined') _WINDOW = window;\n  if (typeof document !== 'undefined') _DOCUMENT = document;\n  if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;\n  if (typeof performance !== 'undefined') _PERFORMANCE = performance;\n} catch (e) {} // eslint-disable-line no-empty\n\nvar _ref = _WINDOW.navigator || {},\n  _ref$userAgent = _ref.userAgent,\n  userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;\nvar WINDOW = _WINDOW;\nvar DOCUMENT = _DOCUMENT;\nvar MUTATION_OBSERVER = _MUTATION_OBSERVER;\nvar PERFORMANCE = _PERFORMANCE;\nvar IS_BROWSER = !!WINDOW.document;\nvar IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';\nvar IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');\n\nvar _ht;\nvar G = /fa(k|kd|s|r|l|t|d|dr|dl|dt|b|slr|slpr|wsb|tl|ns|nds|es|gt|jr|jfr|jdr|usb|ufsb|udsb|cr|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\\-\\ ]/,\n  M = /Font ?Awesome ?([567 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit|Notdog Duo|Notdog|Chisel|Etch|Graphite|Thumbprint|Jelly Fill|Jelly Duo|Jelly|Utility|Utility Fill|Utility Duo|Slab Press|Slab|Whiteboard)?.*/i;\nvar Q = {\n    classic: {\n      fa: \"solid\",\n      fas: \"solid\",\n      \"fa-solid\": \"solid\",\n      far: \"regular\",\n      \"fa-regular\": \"regular\",\n      fal: \"light\",\n      \"fa-light\": \"light\",\n      fat: \"thin\",\n      \"fa-thin\": \"thin\",\n      fab: \"brands\",\n      \"fa-brands\": \"brands\"\n    },\n    duotone: {\n      fa: \"solid\",\n      fad: \"solid\",\n      \"fa-solid\": \"solid\",\n      \"fa-duotone\": \"solid\",\n      fadr: \"regular\",\n      \"fa-regular\": \"regular\",\n      fadl: \"light\",\n      \"fa-light\": \"light\",\n      fadt: \"thin\",\n      \"fa-thin\": \"thin\"\n    },\n    sharp: {\n      fa: \"solid\",\n      fass: \"solid\",\n      \"fa-solid\": \"solid\",\n      fasr: \"regular\",\n      \"fa-regular\": \"regular\",\n      fasl: \"light\",\n      \"fa-light\": \"light\",\n      fast: \"thin\",\n      \"fa-thin\": \"thin\"\n    },\n    \"sharp-duotone\": {\n      fa: \"solid\",\n      fasds: \"solid\",\n      \"fa-solid\": \"solid\",\n      fasdr: \"regular\",\n      \"fa-regular\": \"regular\",\n      fasdl: \"light\",\n      \"fa-light\": \"light\",\n      fasdt: \"thin\",\n      \"fa-thin\": \"thin\"\n    },\n    slab: {\n      \"fa-regular\": \"regular\",\n      faslr: \"regular\"\n    },\n    \"slab-press\": {\n      \"fa-regular\": \"regular\",\n      faslpr: \"regular\"\n    },\n    thumbprint: {\n      \"fa-light\": \"light\",\n      fatl: \"light\"\n    },\n    whiteboard: {\n      \"fa-semibold\": \"semibold\",\n      fawsb: \"semibold\"\n    },\n    notdog: {\n      \"fa-solid\": \"solid\",\n      fans: \"solid\"\n    },\n    \"notdog-duo\": {\n      \"fa-solid\": \"solid\",\n      fands: \"solid\"\n    },\n    etch: {\n      \"fa-solid\": \"solid\",\n      faes: \"solid\"\n    },\n    graphite: {\n      \"fa-thin\": \"thin\",\n      fagt: \"thin\"\n    },\n    jelly: {\n      \"fa-regular\": \"regular\",\n      fajr: \"regular\"\n    },\n    \"jelly-fill\": {\n      \"fa-regular\": \"regular\",\n      fajfr: \"regular\"\n    },\n    \"jelly-duo\": {\n      \"fa-regular\": \"regular\",\n      fajdr: \"regular\"\n    },\n    chisel: {\n      \"fa-regular\": \"regular\",\n      facr: \"regular\"\n    },\n    utility: {\n      \"fa-semibold\": \"semibold\",\n      fausb: \"semibold\"\n    },\n    \"utility-duo\": {\n      \"fa-semibold\": \"semibold\",\n      faudsb: \"semibold\"\n    },\n    \"utility-fill\": {\n      \"fa-semibold\": \"semibold\",\n      faufsb: \"semibold\"\n    }\n  },\n  X = {\n    GROUP: \"duotone-group\",\n    SWAP_OPACITY: \"swap-opacity\",\n    PRIMARY: \"primary\",\n    SECONDARY: \"secondary\"\n  },\n  Z = [\"fa-classic\", \"fa-duotone\", \"fa-sharp\", \"fa-sharp-duotone\", \"fa-thumbprint\", \"fa-whiteboard\", \"fa-notdog\", \"fa-notdog-duo\", \"fa-chisel\", \"fa-etch\", \"fa-graphite\", \"fa-jelly\", \"fa-jelly-fill\", \"fa-jelly-duo\", \"fa-slab\", \"fa-slab-press\", \"fa-utility\", \"fa-utility-duo\", \"fa-utility-fill\"];\nvar i = \"classic\",\n  t = \"duotone\",\n  d = \"sharp\",\n  l = \"sharp-duotone\",\n  f = \"chisel\",\n  h = \"etch\",\n  n = \"graphite\",\n  g = \"jelly\",\n  o = \"jelly-duo\",\n  u = \"jelly-fill\",\n  m = \"notdog\",\n  e = \"notdog-duo\",\n  y = \"slab\",\n  p = \"slab-press\",\n  s = \"thumbprint\",\n  w = \"utility\",\n  a = \"utility-duo\",\n  x = \"utility-fill\",\n  b = \"whiteboard\",\n  c = \"Classic\",\n  I = \"Duotone\",\n  F = \"Sharp\",\n  v = \"Sharp Duotone\",\n  S = \"Chisel\",\n  A = \"Etch\",\n  P = \"Graphite\",\n  j = \"Jelly\",\n  B = \"Jelly Duo\",\n  N = \"Jelly Fill\",\n  k = \"Notdog\",\n  D = \"Notdog Duo\",\n  T = \"Slab\",\n  C = \"Slab Press\",\n  W = \"Thumbprint\",\n  K = \"Utility\",\n  R = \"Utility Duo\",\n  L = \"Utility Fill\",\n  U = \"Whiteboard\",\n  dt = [i, t, d, l, f, h, n, g, o, u, m, e, y, p, s, w, a, x, b],\n  ht = (_ht = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ht, i, c), t, I), d, F), l, v), f, S), h, A), n, P), g, j), o, B), u, N), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ht, m, k), e, D), y, T), p, C), s, W), w, K), a, R), x, L), b, U));\nvar yt = {\n    classic: {\n      900: \"fas\",\n      400: \"far\",\n      normal: \"far\",\n      300: \"fal\",\n      100: \"fat\"\n    },\n    duotone: {\n      900: \"fad\",\n      400: \"fadr\",\n      300: \"fadl\",\n      100: \"fadt\"\n    },\n    sharp: {\n      900: \"fass\",\n      400: \"fasr\",\n      300: \"fasl\",\n      100: \"fast\"\n    },\n    \"sharp-duotone\": {\n      900: \"fasds\",\n      400: \"fasdr\",\n      300: \"fasdl\",\n      100: \"fasdt\"\n    },\n    slab: {\n      400: \"faslr\"\n    },\n    \"slab-press\": {\n      400: \"faslpr\"\n    },\n    whiteboard: {\n      600: \"fawsb\"\n    },\n    thumbprint: {\n      300: \"fatl\"\n    },\n    notdog: {\n      900: \"fans\"\n    },\n    \"notdog-duo\": {\n      900: \"fands\"\n    },\n    etch: {\n      900: \"faes\"\n    },\n    graphite: {\n      100: \"fagt\"\n    },\n    chisel: {\n      400: \"facr\"\n    },\n    jelly: {\n      400: \"fajr\"\n    },\n    \"jelly-fill\": {\n      400: \"fajfr\"\n    },\n    \"jelly-duo\": {\n      400: \"fajdr\"\n    },\n    utility: {\n      600: \"fausb\"\n    },\n    \"utility-duo\": {\n      600: \"faudsb\"\n    },\n    \"utility-fill\": {\n      600: \"faufsb\"\n    }\n  };\nvar Kt = {\n    \"Font Awesome 7 Free\": {\n      900: \"fas\",\n      400: \"far\"\n    },\n    \"Font Awesome 7 Pro\": {\n      900: \"fas\",\n      400: \"far\",\n      normal: \"far\",\n      300: \"fal\",\n      100: \"fat\"\n    },\n    \"Font Awesome 7 Brands\": {\n      400: \"fab\",\n      normal: \"fab\"\n    },\n    \"Font Awesome 7 Duotone\": {\n      900: \"fad\",\n      400: \"fadr\",\n      normal: \"fadr\",\n      300: \"fadl\",\n      100: \"fadt\"\n    },\n    \"Font Awesome 7 Sharp\": {\n      900: \"fass\",\n      400: \"fasr\",\n      normal: \"fasr\",\n      300: \"fasl\",\n      100: \"fast\"\n    },\n    \"Font Awesome 7 Sharp Duotone\": {\n      900: \"fasds\",\n      400: \"fasdr\",\n      normal: \"fasdr\",\n      300: \"fasdl\",\n      100: \"fasdt\"\n    },\n    \"Font Awesome 7 Jelly\": {\n      400: \"fajr\",\n      normal: \"fajr\"\n    },\n    \"Font Awesome 7 Jelly Fill\": {\n      400: \"fajfr\",\n      normal: \"fajfr\"\n    },\n    \"Font Awesome 7 Jelly Duo\": {\n      400: \"fajdr\",\n      normal: \"fajdr\"\n    },\n    \"Font Awesome 7 Slab\": {\n      400: \"faslr\",\n      normal: \"faslr\"\n    },\n    \"Font Awesome 7 Slab Press\": {\n      400: \"faslpr\",\n      normal: \"faslpr\"\n    },\n    \"Font Awesome 7 Thumbprint\": {\n      300: \"fatl\",\n      normal: \"fatl\"\n    },\n    \"Font Awesome 7 Notdog\": {\n      900: \"fans\",\n      normal: \"fans\"\n    },\n    \"Font Awesome 7 Notdog Duo\": {\n      900: \"fands\",\n      normal: \"fands\"\n    },\n    \"Font Awesome 7 Etch\": {\n      900: \"faes\",\n      normal: \"faes\"\n    },\n    \"Font Awesome 7 Graphite\": {\n      100: \"fagt\",\n      normal: \"fagt\"\n    },\n    \"Font Awesome 7 Chisel\": {\n      400: \"facr\",\n      normal: \"facr\"\n    },\n    \"Font Awesome 7 Whiteboard\": {\n      600: \"fawsb\",\n      normal: \"fawsb\"\n    },\n    \"Font Awesome 7 Utility\": {\n      600: \"fausb\",\n      normal: \"fausb\"\n    },\n    \"Font Awesome 7 Utility Duo\": {\n      600: \"faudsb\",\n      normal: \"faudsb\"\n    },\n    \"Font Awesome 7 Utility Fill\": {\n      600: \"faufsb\",\n      normal: \"faufsb\"\n    }\n  };\nvar Et = new Map([[\"classic\", {\n    defaultShortPrefixId: \"fas\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\", \"regular\", \"light\", \"thin\", \"brands\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"duotone\", {\n    defaultShortPrefixId: \"fad\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\", \"regular\", \"light\", \"thin\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"sharp\", {\n    defaultShortPrefixId: \"fass\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\", \"regular\", \"light\", \"thin\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"sharp-duotone\", {\n    defaultShortPrefixId: \"fasds\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\", \"regular\", \"light\", \"thin\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"chisel\", {\n    defaultShortPrefixId: \"facr\",\n    defaultStyleId: \"regular\",\n    styleIds: [\"regular\"],\n    futureStyleIds: [],\n    defaultFontWeight: 400\n  }], [\"etch\", {\n    defaultShortPrefixId: \"faes\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"graphite\", {\n    defaultShortPrefixId: \"fagt\",\n    defaultStyleId: \"thin\",\n    styleIds: [\"thin\"],\n    futureStyleIds: [],\n    defaultFontWeight: 100\n  }], [\"jelly\", {\n    defaultShortPrefixId: \"fajr\",\n    defaultStyleId: \"regular\",\n    styleIds: [\"regular\"],\n    futureStyleIds: [],\n    defaultFontWeight: 400\n  }], [\"jelly-duo\", {\n    defaultShortPrefixId: \"fajdr\",\n    defaultStyleId: \"regular\",\n    styleIds: [\"regular\"],\n    futureStyleIds: [],\n    defaultFontWeight: 400\n  }], [\"jelly-fill\", {\n    defaultShortPrefixId: \"fajfr\",\n    defaultStyleId: \"regular\",\n    styleIds: [\"regular\"],\n    futureStyleIds: [],\n    defaultFontWeight: 400\n  }], [\"notdog\", {\n    defaultShortPrefixId: \"fans\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"notdog-duo\", {\n    defaultShortPrefixId: \"fands\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"slab\", {\n    defaultShortPrefixId: \"faslr\",\n    defaultStyleId: \"regular\",\n    styleIds: [\"regular\"],\n    futureStyleIds: [],\n    defaultFontWeight: 400\n  }], [\"slab-press\", {\n    defaultShortPrefixId: \"faslpr\",\n    defaultStyleId: \"regular\",\n    styleIds: [\"regular\"],\n    futureStyleIds: [],\n    defaultFontWeight: 400\n  }], [\"thumbprint\", {\n    defaultShortPrefixId: \"fatl\",\n    defaultStyleId: \"light\",\n    styleIds: [\"light\"],\n    futureStyleIds: [],\n    defaultFontWeight: 300\n  }], [\"utility\", {\n    defaultShortPrefixId: \"fausb\",\n    defaultStyleId: \"semibold\",\n    styleIds: [\"semibold\"],\n    futureStyleIds: [],\n    defaultFontWeight: 600\n  }], [\"utility-duo\", {\n    defaultShortPrefixId: \"faudsb\",\n    defaultStyleId: \"semibold\",\n    styleIds: [\"semibold\"],\n    futureStyleIds: [],\n    defaultFontWeight: 600\n  }], [\"utility-fill\", {\n    defaultShortPrefixId: \"faufsb\",\n    defaultStyleId: \"semibold\",\n    styleIds: [\"semibold\"],\n    futureStyleIds: [],\n    defaultFontWeight: 600\n  }], [\"whiteboard\", {\n    defaultShortPrefixId: \"fawsb\",\n    defaultStyleId: \"semibold\",\n    styleIds: [\"semibold\"],\n    futureStyleIds: [],\n    defaultFontWeight: 600\n  }]]),\n  Mt = {\n    chisel: {\n      regular: \"facr\"\n    },\n    classic: {\n      brands: \"fab\",\n      light: \"fal\",\n      regular: \"far\",\n      solid: \"fas\",\n      thin: \"fat\"\n    },\n    duotone: {\n      light: \"fadl\",\n      regular: \"fadr\",\n      solid: \"fad\",\n      thin: \"fadt\"\n    },\n    etch: {\n      solid: \"faes\"\n    },\n    graphite: {\n      thin: \"fagt\"\n    },\n    jelly: {\n      regular: \"fajr\"\n    },\n    \"jelly-duo\": {\n      regular: \"fajdr\"\n    },\n    \"jelly-fill\": {\n      regular: \"fajfr\"\n    },\n    notdog: {\n      solid: \"fans\"\n    },\n    \"notdog-duo\": {\n      solid: \"fands\"\n    },\n    sharp: {\n      light: \"fasl\",\n      regular: \"fasr\",\n      solid: \"fass\",\n      thin: \"fast\"\n    },\n    \"sharp-duotone\": {\n      light: \"fasdl\",\n      regular: \"fasdr\",\n      solid: \"fasds\",\n      thin: \"fasdt\"\n    },\n    slab: {\n      regular: \"faslr\"\n    },\n    \"slab-press\": {\n      regular: \"faslpr\"\n    },\n    thumbprint: {\n      light: \"fatl\"\n    },\n    utility: {\n      semibold: \"fausb\"\n    },\n    \"utility-duo\": {\n      semibold: \"faudsb\"\n    },\n    \"utility-fill\": {\n      semibold: \"faufsb\"\n    },\n    whiteboard: {\n      semibold: \"fawsb\"\n    }\n  };\nvar Ht = [\"fak\", \"fa-kit\", \"fakd\", \"fa-kit-duotone\"],\n  Qt = {\n    kit: {\n      fak: \"kit\",\n      \"fa-kit\": \"kit\"\n    },\n    \"kit-duotone\": {\n      fakd: \"kit-duotone\",\n      \"fa-kit-duotone\": \"kit-duotone\"\n    }\n  },\n  Xt = [\"kit\"];\nvar J = \"kit\",\n  r = \"kit-duotone\",\n  E = \"Kit\",\n  _ = \"Kit Duotone\",\n  ll = _defineProperty(_defineProperty({}, J, E), r, _);\nvar sl = {\n  kit: {\n    \"fa-kit\": \"fak\"\n  },\n  \"kit-duotone\": {\n    \"fa-kit-duotone\": \"fakd\"\n  }\n};\nvar hl = {\n    \"Font Awesome Kit\": {\n      400: \"fak\",\n      normal: \"fak\"\n    },\n    \"Font Awesome Kit Duotone\": {\n      400: \"fakd\",\n      normal: \"fakd\"\n    }\n  },\n  nl = {\n    kit: {\n      fak: \"fa-kit\"\n    },\n    \"kit-duotone\": {\n      fakd: \"fa-kit-duotone\"\n    }\n  };\nvar ml = {\n    kit: {\n      kit: \"fak\"\n    },\n    \"kit-duotone\": {\n      \"kit-duotone\": \"fakd\"\n    }\n  };\n\nvar _wt;\nvar t$1 = {\n    GROUP: \"duotone-group\",\n    SWAP_OPACITY: \"swap-opacity\",\n    PRIMARY: \"primary\",\n    SECONDARY: \"secondary\"\n  },\n  f$1 = [\"fa-classic\", \"fa-duotone\", \"fa-sharp\", \"fa-sharp-duotone\", \"fa-thumbprint\", \"fa-whiteboard\", \"fa-notdog\", \"fa-notdog-duo\", \"fa-chisel\", \"fa-etch\", \"fa-graphite\", \"fa-jelly\", \"fa-jelly-fill\", \"fa-jelly-duo\", \"fa-slab\", \"fa-slab-press\", \"fa-utility\", \"fa-utility-duo\", \"fa-utility-fill\"];\nvar h$1 = \"classic\",\n  o$1 = \"duotone\",\n  n$1 = \"sharp\",\n  s$1 = \"sharp-duotone\",\n  u$1 = \"chisel\",\n  g$1 = \"etch\",\n  y$1 = \"graphite\",\n  m$1 = \"jelly\",\n  a$1 = \"jelly-duo\",\n  p$1 = \"jelly-fill\",\n  w$1 = \"notdog\",\n  e$1 = \"notdog-duo\",\n  b$1 = \"slab\",\n  c$1 = \"slab-press\",\n  r$1 = \"thumbprint\",\n  x$1 = \"utility\",\n  i$1 = \"utility-duo\",\n  I$1 = \"utility-fill\",\n  F$1 = \"whiteboard\",\n  v$1 = \"Classic\",\n  S$1 = \"Duotone\",\n  A$1 = \"Sharp\",\n  P$1 = \"Sharp Duotone\",\n  j$1 = \"Chisel\",\n  B$1 = \"Etch\",\n  N$1 = \"Graphite\",\n  k$1 = \"Jelly\",\n  D$1 = \"Jelly Duo\",\n  C$1 = \"Jelly Fill\",\n  T$1 = \"Notdog\",\n  L$1 = \"Notdog Duo\",\n  W$1 = \"Slab\",\n  R$1 = \"Slab Press\",\n  K$1 = \"Thumbprint\",\n  U$1 = \"Utility\",\n  J$1 = \"Utility Duo\",\n  E$1 = \"Utility Fill\",\n  _$1 = \"Whiteboard\",\n  wt$1 = (_wt = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_wt, h$1, v$1), o$1, S$1), n$1, A$1), s$1, P$1), u$1, j$1), g$1, B$1), y$1, N$1), m$1, k$1), a$1, D$1), p$1, C$1), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_wt, w$1, T$1), e$1, L$1), b$1, W$1), c$1, R$1), r$1, K$1), x$1, U$1), i$1, J$1), I$1, E$1), F$1, _$1));\nvar G$1 = \"kit\",\n  d$1 = \"kit-duotone\",\n  M$1 = \"Kit\",\n  O = \"Kit Duotone\",\n  dl$1 = _defineProperty(_defineProperty({}, G$1, M$1), d$1, O);\nvar Hl = {\n    classic: {\n      \"fa-brands\": \"fab\",\n      \"fa-duotone\": \"fad\",\n      \"fa-light\": \"fal\",\n      \"fa-regular\": \"far\",\n      \"fa-solid\": \"fas\",\n      \"fa-thin\": \"fat\"\n    },\n    duotone: {\n      \"fa-regular\": \"fadr\",\n      \"fa-light\": \"fadl\",\n      \"fa-thin\": \"fadt\"\n    },\n    sharp: {\n      \"fa-solid\": \"fass\",\n      \"fa-regular\": \"fasr\",\n      \"fa-light\": \"fasl\",\n      \"fa-thin\": \"fast\"\n    },\n    \"sharp-duotone\": {\n      \"fa-solid\": \"fasds\",\n      \"fa-regular\": \"fasdr\",\n      \"fa-light\": \"fasdl\",\n      \"fa-thin\": \"fasdt\"\n    },\n    slab: {\n      \"fa-regular\": \"faslr\"\n    },\n    \"slab-press\": {\n      \"fa-regular\": \"faslpr\"\n    },\n    whiteboard: {\n      \"fa-semibold\": \"fawsb\"\n    },\n    thumbprint: {\n      \"fa-light\": \"fatl\"\n    },\n    notdog: {\n      \"fa-solid\": \"fans\"\n    },\n    \"notdog-duo\": {\n      \"fa-solid\": \"fands\"\n    },\n    etch: {\n      \"fa-solid\": \"faes\"\n    },\n    graphite: {\n      \"fa-thin\": \"fagt\"\n    },\n    jelly: {\n      \"fa-regular\": \"fajr\"\n    },\n    \"jelly-fill\": {\n      \"fa-regular\": \"fajfr\"\n    },\n    \"jelly-duo\": {\n      \"fa-regular\": \"fajdr\"\n    },\n    chisel: {\n      \"fa-regular\": \"facr\"\n    },\n    utility: {\n      \"fa-semibold\": \"fausb\"\n    },\n    \"utility-duo\": {\n      \"fa-semibold\": \"faudsb\"\n    },\n    \"utility-fill\": {\n      \"fa-semibold\": \"faufsb\"\n    }\n  },\n  Y$1 = {\n    classic: [\"fas\", \"far\", \"fal\", \"fat\", \"fad\"],\n    duotone: [\"fadr\", \"fadl\", \"fadt\"],\n    sharp: [\"fass\", \"fasr\", \"fasl\", \"fast\"],\n    \"sharp-duotone\": [\"fasds\", \"fasdr\", \"fasdl\", \"fasdt\"],\n    slab: [\"faslr\"],\n    \"slab-press\": [\"faslpr\"],\n    whiteboard: [\"fawsb\"],\n    thumbprint: [\"fatl\"],\n    notdog: [\"fans\"],\n    \"notdog-duo\": [\"fands\"],\n    etch: [\"faes\"],\n    graphite: [\"fagt\"],\n    jelly: [\"fajr\"],\n    \"jelly-fill\": [\"fajfr\"],\n    \"jelly-duo\": [\"fajdr\"],\n    chisel: [\"facr\"],\n    utility: [\"fausb\"],\n    \"utility-duo\": [\"faudsb\"],\n    \"utility-fill\": [\"faufsb\"]\n  },\n  Xl = {\n    classic: {\n      fab: \"fa-brands\",\n      fad: \"fa-duotone\",\n      fal: \"fa-light\",\n      far: \"fa-regular\",\n      fas: \"fa-solid\",\n      fat: \"fa-thin\"\n    },\n    duotone: {\n      fadr: \"fa-regular\",\n      fadl: \"fa-light\",\n      fadt: \"fa-thin\"\n    },\n    sharp: {\n      fass: \"fa-solid\",\n      fasr: \"fa-regular\",\n      fasl: \"fa-light\",\n      fast: \"fa-thin\"\n    },\n    \"sharp-duotone\": {\n      fasds: \"fa-solid\",\n      fasdr: \"fa-regular\",\n      fasdl: \"fa-light\",\n      fasdt: \"fa-thin\"\n    },\n    slab: {\n      faslr: \"fa-regular\"\n    },\n    \"slab-press\": {\n      faslpr: \"fa-regular\"\n    },\n    whiteboard: {\n      fawsb: \"fa-semibold\"\n    },\n    thumbprint: {\n      fatl: \"fa-light\"\n    },\n    notdog: {\n      fans: \"fa-solid\"\n    },\n    \"notdog-duo\": {\n      fands: \"fa-solid\"\n    },\n    etch: {\n      faes: \"fa-solid\"\n    },\n    graphite: {\n      fagt: \"fa-thin\"\n    },\n    jelly: {\n      fajr: \"fa-regular\"\n    },\n    \"jelly-fill\": {\n      fajfr: \"fa-regular\"\n    },\n    \"jelly-duo\": {\n      fajdr: \"fa-regular\"\n    },\n    chisel: {\n      facr: \"fa-regular\"\n    },\n    utility: {\n      fausb: \"fa-semibold\"\n    },\n    \"utility-duo\": {\n      faudsb: \"fa-semibold\"\n    },\n    \"utility-fill\": {\n      faufsb: \"fa-semibold\"\n    }\n  },\n  V$1 = [\"fa-solid\", \"fa-regular\", \"fa-light\", \"fa-thin\", \"fa-duotone\", \"fa-brands\", \"fa-semibold\"],\n  lo = [\"fa\", \"fas\", \"far\", \"fal\", \"fat\", \"fad\", \"fadr\", \"fadl\", \"fadt\", \"fab\", \"fass\", \"fasr\", \"fasl\", \"fast\", \"fasds\", \"fasdr\", \"fasdl\", \"fasdt\", \"faslr\", \"faslpr\", \"fawsb\", \"fatl\", \"fans\", \"fands\", \"faes\", \"fagt\", \"fajr\", \"fajfr\", \"fajdr\", \"facr\", \"fausb\", \"faudsb\", \"faufsb\"].concat(f$1, V$1),\n  $ = [\"solid\", \"regular\", \"light\", \"thin\", \"duotone\", \"brands\", \"semibold\"],\n  z$1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n  q$1 = z$1.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),\n  H$1 = [\"aw\", \"fw\", \"pull-left\", \"pull-right\"],\n  so = [].concat(_toConsumableArray(Object.keys(Y$1)), $, H$1, [\"2xs\", \"xs\", \"sm\", \"lg\", \"xl\", \"2xl\", \"beat\", \"border\", \"fade\", \"beat-fade\", \"bounce\", \"flip-both\", \"flip-horizontal\", \"flip-vertical\", \"flip\", \"inverse\", \"layers\", \"layers-bottom-left\", \"layers-bottom-right\", \"layers-counter\", \"layers-text\", \"layers-top-left\", \"layers-top-right\", \"li\", \"pull-end\", \"pull-start\", \"pulse\", \"rotate-180\", \"rotate-270\", \"rotate-90\", \"rotate-by\", \"shake\", \"spin-pulse\", \"spin-reverse\", \"spin\", \"stack-1x\", \"stack-2x\", \"stack\", \"ul\", \"width-auto\", \"width-fixed\", t$1.GROUP, t$1.SWAP_OPACITY, t$1.PRIMARY, t$1.SECONDARY]).concat(z$1.map(function (l) {\n    return \"\".concat(l, \"x\");\n  })).concat(q$1.map(function (l) {\n    return \"w-\".concat(l);\n  }));\nvar fo = {\n    \"Font Awesome 5 Free\": {\n      900: \"fas\",\n      400: \"far\"\n    },\n    \"Font Awesome 5 Pro\": {\n      900: \"fas\",\n      400: \"far\",\n      normal: \"far\",\n      300: \"fal\"\n    },\n    \"Font Awesome 5 Brands\": {\n      400: \"fab\",\n      normal: \"fab\"\n    },\n    \"Font Awesome 5 Duotone\": {\n      900: \"fad\"\n    }\n  };\n\nvar NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';\nvar UNITS_IN_GRID = 16;\nvar DEFAULT_CSS_PREFIX = 'fa';\nvar DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';\nvar DATA_FA_I2SVG = 'data-fa-i2svg';\nvar DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';\nvar DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';\nvar DATA_PREFIX = 'data-prefix';\nvar DATA_ICON = 'data-icon';\nvar HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';\nvar MUTATION_APPROACH_ASYNC = 'async';\nvar TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];\nvar PSEUDO_ELEMENTS = ['::before', '::after', ':before', ':after'];\nvar PRODUCTION = function () {\n  try {\n    return process.env.NODE_ENV === 'production';\n  } catch (e$$1) {\n    return false;\n  }\n}();\nfunction familyProxy(obj) {\n  // Defaults to the classic family if family is not available\n  return new Proxy(obj, {\n    get: function get(target, prop) {\n      return prop in target ? target[prop] : target[i];\n    }\n  });\n}\nvar _PREFIX_TO_STYLE = _objectSpread2({}, Q);\n\n// We changed FACSSClassesToStyleId in the icons repo to be canonical and as such, \"classic\" family does not have any\n// duotone styles.  But we do still need duotone in _PREFIX_TO_STYLE below, so we are manually adding\n// {'fa-duotone': 'duotone'}\n_PREFIX_TO_STYLE[i] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {\n  'fa-duotone': 'duotone'\n}), Q[i]), Qt['kit']), Qt['kit-duotone']);\nvar PREFIX_TO_STYLE = familyProxy(_PREFIX_TO_STYLE);\nvar _STYLE_TO_PREFIX = _objectSpread2({}, Mt);\n\n// We changed FAStyleIdToShortPrefixId in the icons repo to be canonical and as such, \"classic\" family does not have any\n// duotone styles.  But we do still need duotone in _STYLE_TO_PREFIX below, so we are manually adding {duotone: 'fad'}\n_STYLE_TO_PREFIX[i] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {\n  duotone: 'fad'\n}), _STYLE_TO_PREFIX[i]), ml['kit']), ml['kit-duotone']);\nvar STYLE_TO_PREFIX = familyProxy(_STYLE_TO_PREFIX);\nvar _PREFIX_TO_LONG_STYLE = _objectSpread2({}, Xl);\n_PREFIX_TO_LONG_STYLE[i] = _objectSpread2(_objectSpread2({}, _PREFIX_TO_LONG_STYLE[i]), nl['kit']);\nvar PREFIX_TO_LONG_STYLE = familyProxy(_PREFIX_TO_LONG_STYLE);\nvar _LONG_STYLE_TO_PREFIX = _objectSpread2({}, Hl);\n_LONG_STYLE_TO_PREFIX[i] = _objectSpread2(_objectSpread2({}, _LONG_STYLE_TO_PREFIX[i]), sl['kit']);\nvar LONG_STYLE_TO_PREFIX = familyProxy(_LONG_STYLE_TO_PREFIX);\nvar ICON_SELECTION_SYNTAX_PATTERN = G;\nvar LAYERS_TEXT_CLASSNAME = 'fa-layers-text';\nvar FONT_FAMILY_PATTERN = M;\nvar _FONT_WEIGHT_TO_PREFIX = _objectSpread2({}, yt);\nvar FONT_WEIGHT_TO_PREFIX = familyProxy(_FONT_WEIGHT_TO_PREFIX);\nvar ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];\nvar DUOTONE_CLASSES = X;\nvar RESERVED_CLASSES = [].concat(_toConsumableArray(Xt), _toConsumableArray(so));\n\nvar initial = WINDOW.FontAwesomeConfig || {};\nfunction getAttrConfig(attr) {\n  var element = DOCUMENT.querySelector('script[' + attr + ']');\n  if (element) {\n    return element.getAttribute(attr);\n  }\n}\nfunction coerce(val) {\n  // Getting an empty string will occur if the attribute is set on the HTML tag but without a value\n  // We'll assume that this is an indication that it should be toggled to true\n  if (val === '') return true;\n  if (val === 'false') return false;\n  if (val === 'true') return true;\n  return val;\n}\nif (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {\n  var attrs = [['data-family-prefix', 'familyPrefix'], ['data-css-prefix', 'cssPrefix'], ['data-family-default', 'familyDefault'], ['data-style-default', 'styleDefault'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-search-pseudo-elements-warnings', 'searchPseudoElementsWarnings'], ['data-search-pseudo-elements-full-scan', 'searchPseudoElementsFullScan'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];\n  attrs.forEach(function (_ref) {\n    var _ref2 = _slicedToArray(_ref, 2),\n      attr = _ref2[0],\n      key = _ref2[1];\n    var val = coerce(getAttrConfig(attr));\n    if (val !== undefined && val !== null) {\n      initial[key] = val;\n    }\n  });\n}\nvar _default = {\n  styleDefault: 'solid',\n  familyDefault: i,\n  cssPrefix: DEFAULT_CSS_PREFIX,\n  replacementClass: DEFAULT_REPLACEMENT_CLASS,\n  autoReplaceSvg: true,\n  autoAddCss: true,\n  searchPseudoElements: false,\n  searchPseudoElementsWarnings: true,\n  searchPseudoElementsFullScan: false,\n  observeMutations: true,\n  mutateApproach: 'async',\n  keepOriginalSource: true,\n  measurePerformance: false,\n  showMissingIcons: true\n};\n\n// familyPrefix is deprecated but we must still support it if present\nif (initial.familyPrefix) {\n  initial.cssPrefix = initial.familyPrefix;\n}\nvar _config = _objectSpread2(_objectSpread2({}, _default), initial);\nif (!_config.autoReplaceSvg) _config.observeMutations = false;\nvar config = {};\nObject.keys(_default).forEach(function (key) {\n  Object.defineProperty(config, key, {\n    enumerable: true,\n    set: function set(val) {\n      _config[key] = val;\n      _onChangeCb.forEach(function (cb) {\n        return cb(config);\n      });\n    },\n    get: function get() {\n      return _config[key];\n    }\n  });\n});\n\n// familyPrefix is deprecated as of 6.2.0 and should be removed in 7.0.0\nObject.defineProperty(config, 'familyPrefix', {\n  enumerable: true,\n  set: function set(val) {\n    _config.cssPrefix = val;\n    _onChangeCb.forEach(function (cb) {\n      return cb(config);\n    });\n  },\n  get: function get() {\n    return _config.cssPrefix;\n  }\n});\nWINDOW.FontAwesomeConfig = config;\nvar _onChangeCb = [];\nfunction onChange(cb) {\n  _onChangeCb.push(cb);\n  return function () {\n    _onChangeCb.splice(_onChangeCb.indexOf(cb), 1);\n  };\n}\n\nvar d$2 = UNITS_IN_GRID;\nvar meaninglessTransform = {\n  size: 16,\n  x: 0,\n  y: 0,\n  rotate: 0,\n  flipX: false,\n  flipY: false\n};\nfunction insertCss(css) {\n  if (!css || !IS_DOM) {\n    return;\n  }\n  var style = DOCUMENT.createElement('style');\n  style.setAttribute('type', 'text/css');\n  style.innerHTML = css;\n  var headChildren = DOCUMENT.head.childNodes;\n  var beforeChild = null;\n  for (var i = headChildren.length - 1; i > -1; i--) {\n    var child = headChildren[i];\n    var tagName = (child.tagName || '').toUpperCase();\n    if (['STYLE', 'LINK'].indexOf(tagName) > -1) {\n      beforeChild = child;\n    }\n  }\n  DOCUMENT.head.insertBefore(style, beforeChild);\n  return css;\n}\nvar idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\nfunction nextUniqueId() {\n  var size = 12;\n  var id = '';\n  while (size-- > 0) {\n    id += idPool[Math.random() * 62 | 0];\n  }\n  return id;\n}\nfunction toArray(obj) {\n  var array = [];\n  for (var i = (obj || []).length >>> 0; i--;) {\n    array[i] = obj[i];\n  }\n  return array;\n}\nfunction classArray(node) {\n  if (node.classList) {\n    return toArray(node.classList);\n  } else {\n    return (node.getAttribute('class') || '').split(' ').filter(function (i) {\n      return i;\n    });\n  }\n}\nfunction htmlEscape(str) {\n  return \"\".concat(str).replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\nfunction joinAttributes(attributes) {\n  return Object.keys(attributes || {}).reduce(function (acc, attributeName) {\n    return acc + \"\".concat(attributeName, \"=\\\"\").concat(htmlEscape(attributes[attributeName]), \"\\\" \");\n  }, '').trim();\n}\nfunction joinStyles(styles) {\n  return Object.keys(styles || {}).reduce(function (acc, styleName) {\n    return acc + \"\".concat(styleName, \": \").concat(styles[styleName].trim(), \";\");\n  }, '');\n}\nfunction transformIsMeaningful(transform) {\n  return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;\n}\nfunction transformForSvg(_ref) {\n  var transform = _ref.transform,\n    containerWidth = _ref.containerWidth,\n    iconWidth = _ref.iconWidth;\n  var outer = {\n    transform: \"translate(\".concat(containerWidth / 2, \" 256)\")\n  };\n  var innerTranslate = \"translate(\".concat(transform.x * 32, \", \").concat(transform.y * 32, \") \");\n  var innerScale = \"scale(\".concat(transform.size / 16 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / 16 * (transform.flipY ? -1 : 1), \") \");\n  var innerRotate = \"rotate(\".concat(transform.rotate, \" 0 0)\");\n  var inner = {\n    transform: \"\".concat(innerTranslate, \" \").concat(innerScale, \" \").concat(innerRotate)\n  };\n  var path = {\n    transform: \"translate(\".concat(iconWidth / 2 * -1, \" -256)\")\n  };\n  return {\n    outer: outer,\n    inner: inner,\n    path: path\n  };\n}\nfunction transformForCss(_ref2) {\n  var transform = _ref2.transform,\n    _ref2$width = _ref2.width,\n    width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,\n    _ref2$height = _ref2.height,\n    height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,\n    _ref2$startCentered = _ref2.startCentered,\n    startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;\n  var val = '';\n  if (startCentered && IS_IE) {\n    val += \"translate(\".concat(transform.x / d$2 - width / 2, \"em, \").concat(transform.y / d$2 - height / 2, \"em) \");\n  } else if (startCentered) {\n    val += \"translate(calc(-50% + \".concat(transform.x / d$2, \"em), calc(-50% + \").concat(transform.y / d$2, \"em)) \");\n  } else {\n    val += \"translate(\".concat(transform.x / d$2, \"em, \").concat(transform.y / d$2, \"em) \");\n  }\n  val += \"scale(\".concat(transform.size / d$2 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / d$2 * (transform.flipY ? -1 : 1), \") \");\n  val += \"rotate(\".concat(transform.rotate, \"deg) \");\n  return val;\n}\n\nvar baseStyles = \":root, :host {\\n  --fa-font-solid: normal 900 1em/1 'Font Awesome 7 Free';\\n  --fa-font-regular: normal 400 1em/1 'Font Awesome 7 Free';\\n  --fa-font-light: normal 300 1em/1 'Font Awesome 7 Pro';\\n  --fa-font-thin: normal 100 1em/1 'Font Awesome 7 Pro';\\n  --fa-font-duotone: normal 900 1em/1 'Font Awesome 7 Duotone';\\n  --fa-font-duotone-regular: normal 400 1em/1 'Font Awesome 7 Duotone';\\n  --fa-font-duotone-light: normal 300 1em/1 'Font Awesome 7 Duotone';\\n  --fa-font-duotone-thin: normal 100 1em/1 'Font Awesome 7 Duotone';\\n  --fa-font-brands: normal 400 1em/1 'Font Awesome 7 Brands';\\n  --fa-font-sharp-solid: normal 900 1em/1 'Font Awesome 7 Sharp';\\n  --fa-font-sharp-regular: normal 400 1em/1 'Font Awesome 7 Sharp';\\n  --fa-font-sharp-light: normal 300 1em/1 'Font Awesome 7 Sharp';\\n  --fa-font-sharp-thin: normal 100 1em/1 'Font Awesome 7 Sharp';\\n  --fa-font-sharp-duotone-solid: normal 900 1em/1 'Font Awesome 7 Sharp Duotone';\\n  --fa-font-sharp-duotone-regular: normal 400 1em/1 'Font Awesome 7 Sharp Duotone';\\n  --fa-font-sharp-duotone-light: normal 300 1em/1 'Font Awesome 7 Sharp Duotone';\\n  --fa-font-sharp-duotone-thin: normal 100 1em/1 'Font Awesome 7 Sharp Duotone';\\n  --fa-font-slab-regular: normal 400 1em/1 'Font Awesome 7 Slab';\\n  --fa-font-slab-press-regular: normal 400 1em/1 'Font Awesome 7 Slab Press';\\n  --fa-font-whiteboard-semibold: normal 600 1em/1 'Font Awesome 7 Whiteboard';\\n  --fa-font-thumbprint-light: normal 300 1em/1 'Font Awesome 7 Thumbprint';\\n  --fa-font-notdog-solid: normal 900 1em/1 'Font Awesome 7 Notdog';\\n  --fa-font-notdog-duo-solid: normal 900 1em/1 'Font Awesome 7 Notdog Duo';\\n  --fa-font-etch-solid: normal 900 1em/1 'Font Awesome 7 Etch';\\n  --fa-font-graphite-thin: normal 100 1em/1 'Font Awesome 7 Graphite';\\n  --fa-font-jelly-regular: normal 400 1em/1 'Font Awesome 7 Jelly';\\n  --fa-font-jelly-fill-regular: normal 400 1em/1 'Font Awesome 7 Jelly Fill';\\n  --fa-font-jelly-duo-regular: normal 400 1em/1 'Font Awesome 7 Jelly Duo';\\n  --fa-font-chisel-regular: normal 400 1em/1 'Font Awesome 7 Chisel';\\n  --fa-font-utility-semibold: normal 600 1em/1 'Font Awesome 7 Utility';\\n  --fa-font-utility-duo-semibold: normal 600 1em/1 'Font Awesome 7 Utility Duo';\\n  --fa-font-utility-fill-semibold: normal 600 1em/1 'Font Awesome 7 Utility Fill';\\n}\\n\\n.svg-inline--fa {\\n  box-sizing: content-box;\\n  display: var(--fa-display, inline-block);\\n  height: 1em;\\n  overflow: visible;\\n  vertical-align: -0.125em;\\n  width: var(--fa-width, 1.25em);\\n}\\n.svg-inline--fa.fa-2xs {\\n  vertical-align: 0.1em;\\n}\\n.svg-inline--fa.fa-xs {\\n  vertical-align: 0em;\\n}\\n.svg-inline--fa.fa-sm {\\n  vertical-align: -0.0714285714em;\\n}\\n.svg-inline--fa.fa-lg {\\n  vertical-align: -0.2em;\\n}\\n.svg-inline--fa.fa-xl {\\n  vertical-align: -0.25em;\\n}\\n.svg-inline--fa.fa-2xl {\\n  vertical-align: -0.3125em;\\n}\\n.svg-inline--fa.fa-pull-left,\\n.svg-inline--fa .fa-pull-start {\\n  float: inline-start;\\n  margin-inline-end: var(--fa-pull-margin, 0.3em);\\n}\\n.svg-inline--fa.fa-pull-right,\\n.svg-inline--fa .fa-pull-end {\\n  float: inline-end;\\n  margin-inline-start: var(--fa-pull-margin, 0.3em);\\n}\\n.svg-inline--fa.fa-li {\\n  width: var(--fa-li-width, 2em);\\n  inset-inline-start: calc(-1 * var(--fa-li-width, 2em));\\n  inset-block-start: 0.25em; /* syncing vertical alignment with Web Font rendering */\\n}\\n\\n.fa-layers-counter, .fa-layers-text {\\n  display: inline-block;\\n  position: absolute;\\n  text-align: center;\\n}\\n\\n.fa-layers {\\n  display: inline-block;\\n  height: 1em;\\n  position: relative;\\n  text-align: center;\\n  vertical-align: -0.125em;\\n  width: var(--fa-width, 1.25em);\\n}\\n.fa-layers .svg-inline--fa {\\n  inset: 0;\\n  margin: auto;\\n  position: absolute;\\n  transform-origin: center center;\\n}\\n\\n.fa-layers-text {\\n  left: 50%;\\n  top: 50%;\\n  transform: translate(-50%, -50%);\\n  transform-origin: center center;\\n}\\n\\n.fa-layers-counter {\\n  background-color: var(--fa-counter-background-color, #ff253a);\\n  border-radius: var(--fa-counter-border-radius, 1em);\\n  box-sizing: border-box;\\n  color: var(--fa-inverse, #fff);\\n  line-height: var(--fa-counter-line-height, 1);\\n  max-width: var(--fa-counter-max-width, 5em);\\n  min-width: var(--fa-counter-min-width, 1.5em);\\n  overflow: hidden;\\n  padding: var(--fa-counter-padding, 0.25em 0.5em);\\n  right: var(--fa-right, 0);\\n  text-overflow: ellipsis;\\n  top: var(--fa-top, 0);\\n  transform: scale(var(--fa-counter-scale, 0.25));\\n  transform-origin: top right;\\n}\\n\\n.fa-layers-bottom-right {\\n  bottom: var(--fa-bottom, 0);\\n  right: var(--fa-right, 0);\\n  top: auto;\\n  transform: scale(var(--fa-layers-scale, 0.25));\\n  transform-origin: bottom right;\\n}\\n\\n.fa-layers-bottom-left {\\n  bottom: var(--fa-bottom, 0);\\n  left: var(--fa-left, 0);\\n  right: auto;\\n  top: auto;\\n  transform: scale(var(--fa-layers-scale, 0.25));\\n  transform-origin: bottom left;\\n}\\n\\n.fa-layers-top-right {\\n  top: var(--fa-top, 0);\\n  right: var(--fa-right, 0);\\n  transform: scale(var(--fa-layers-scale, 0.25));\\n  transform-origin: top right;\\n}\\n\\n.fa-layers-top-left {\\n  left: var(--fa-left, 0);\\n  right: auto;\\n  top: var(--fa-top, 0);\\n  transform: scale(var(--fa-layers-scale, 0.25));\\n  transform-origin: top left;\\n}\\n\\n.fa-1x {\\n  font-size: 1em;\\n}\\n\\n.fa-2x {\\n  font-size: 2em;\\n}\\n\\n.fa-3x {\\n  font-size: 3em;\\n}\\n\\n.fa-4x {\\n  font-size: 4em;\\n}\\n\\n.fa-5x {\\n  font-size: 5em;\\n}\\n\\n.fa-6x {\\n  font-size: 6em;\\n}\\n\\n.fa-7x {\\n  font-size: 7em;\\n}\\n\\n.fa-8x {\\n  font-size: 8em;\\n}\\n\\n.fa-9x {\\n  font-size: 9em;\\n}\\n\\n.fa-10x {\\n  font-size: 10em;\\n}\\n\\n.fa-2xs {\\n  font-size: calc(10 / 16 * 1em); /* converts a 10px size into an em-based value that's relative to the scale's 16px base */\\n  line-height: calc(1 / 10 * 1em); /* sets the line-height of the icon back to that of it's parent */\\n  vertical-align: calc((6 / 10 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */\\n}\\n\\n.fa-xs {\\n  font-size: calc(12 / 16 * 1em); /* converts a 12px size into an em-based value that's relative to the scale's 16px base */\\n  line-height: calc(1 / 12 * 1em); /* sets the line-height of the icon back to that of it's parent */\\n  vertical-align: calc((6 / 12 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */\\n}\\n\\n.fa-sm {\\n  font-size: calc(14 / 16 * 1em); /* converts a 14px size into an em-based value that's relative to the scale's 16px base */\\n  line-height: calc(1 / 14 * 1em); /* sets the line-height of the icon back to that of it's parent */\\n  vertical-align: calc((6 / 14 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */\\n}\\n\\n.fa-lg {\\n  font-size: calc(20 / 16 * 1em); /* converts a 20px size into an em-based value that's relative to the scale's 16px base */\\n  line-height: calc(1 / 20 * 1em); /* sets the line-height of the icon back to that of it's parent */\\n  vertical-align: calc((6 / 20 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */\\n}\\n\\n.fa-xl {\\n  font-size: calc(24 / 16 * 1em); /* converts a 24px size into an em-based value that's relative to the scale's 16px base */\\n  line-height: calc(1 / 24 * 1em); /* sets the line-height of the icon back to that of it's parent */\\n  vertical-align: calc((6 / 24 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */\\n}\\n\\n.fa-2xl {\\n  font-size: calc(32 / 16 * 1em); /* converts a 32px size into an em-based value that's relative to the scale's 16px base */\\n  line-height: calc(1 / 32 * 1em); /* sets the line-height of the icon back to that of it's parent */\\n  vertical-align: calc((6 / 32 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */\\n}\\n\\n.fa-width-auto {\\n  --fa-width: auto;\\n}\\n\\n.fa-fw,\\n.fa-width-fixed {\\n  --fa-width: 1.25em;\\n}\\n\\n.fa-ul {\\n  list-style-type: none;\\n  margin-inline-start: var(--fa-li-margin, 2.5em);\\n  padding-inline-start: 0;\\n}\\n.fa-ul > li {\\n  position: relative;\\n}\\n\\n.fa-li {\\n  inset-inline-start: calc(-1 * var(--fa-li-width, 2em));\\n  position: absolute;\\n  text-align: center;\\n  width: var(--fa-li-width, 2em);\\n  line-height: inherit;\\n}\\n\\n/* Heads Up: Bordered Icons will not be supported in the future!\\n  - This feature will be deprecated in the next major release of Font Awesome (v8)!\\n  - You may continue to use it in this version *v7), but it will not be supported in Font Awesome v8.\\n*/\\n/* Notes:\\n* --@{v.$css-prefix}-border-width = 1/16 by default (to render as ~1px based on a 16px default font-size)\\n* --@{v.$css-prefix}-border-padding =\\n  ** 3/16 for vertical padding (to give ~2px of vertical whitespace around an icon considering it's vertical alignment)\\n  ** 4/16 for horizontal padding (to give ~4px of horizontal whitespace around an icon)\\n*/\\n.fa-border {\\n  border-color: var(--fa-border-color, #eee);\\n  border-radius: var(--fa-border-radius, 0.1em);\\n  border-style: var(--fa-border-style, solid);\\n  border-width: var(--fa-border-width, 0.0625em);\\n  box-sizing: var(--fa-border-box-sizing, content-box);\\n  padding: var(--fa-border-padding, 0.1875em 0.25em);\\n}\\n\\n.fa-pull-left,\\n.fa-pull-start {\\n  float: inline-start;\\n  margin-inline-end: var(--fa-pull-margin, 0.3em);\\n}\\n\\n.fa-pull-right,\\n.fa-pull-end {\\n  float: inline-end;\\n  margin-inline-start: var(--fa-pull-margin, 0.3em);\\n}\\n\\n.fa-beat {\\n  animation-name: fa-beat;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\\n}\\n\\n.fa-bounce {\\n  animation-name: fa-bounce;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\\n}\\n\\n.fa-fade {\\n  animation-name: fa-fade;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\\n}\\n\\n.fa-beat-fade {\\n  animation-name: fa-beat-fade;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\\n}\\n\\n.fa-flip {\\n  animation-name: fa-flip;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\\n}\\n\\n.fa-shake {\\n  animation-name: fa-shake;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, linear);\\n}\\n\\n.fa-spin {\\n  animation-name: fa-spin;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 2s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, linear);\\n}\\n\\n.fa-spin-reverse {\\n  --fa-animation-direction: reverse;\\n}\\n\\n.fa-pulse,\\n.fa-spin-pulse {\\n  animation-name: fa-spin;\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, steps(8));\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .fa-beat,\\n  .fa-bounce,\\n  .fa-fade,\\n  .fa-beat-fade,\\n  .fa-flip,\\n  .fa-pulse,\\n  .fa-shake,\\n  .fa-spin,\\n  .fa-spin-pulse {\\n    animation: none !important;\\n    transition: none !important;\\n  }\\n}\\n@keyframes fa-beat {\\n  0%, 90% {\\n    transform: scale(1);\\n  }\\n  45% {\\n    transform: scale(var(--fa-beat-scale, 1.25));\\n  }\\n}\\n@keyframes fa-bounce {\\n  0% {\\n    transform: scale(1, 1) translateY(0);\\n  }\\n  10% {\\n    transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\\n  }\\n  30% {\\n    transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\\n  }\\n  50% {\\n    transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\\n  }\\n  57% {\\n    transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\\n  }\\n  64% {\\n    transform: scale(1, 1) translateY(0);\\n  }\\n  100% {\\n    transform: scale(1, 1) translateY(0);\\n  }\\n}\\n@keyframes fa-fade {\\n  50% {\\n    opacity: var(--fa-fade-opacity, 0.4);\\n  }\\n}\\n@keyframes fa-beat-fade {\\n  0%, 100% {\\n    opacity: var(--fa-beat-fade-opacity, 0.4);\\n    transform: scale(1);\\n  }\\n  50% {\\n    opacity: 1;\\n    transform: scale(var(--fa-beat-fade-scale, 1.125));\\n  }\\n}\\n@keyframes fa-flip {\\n  50% {\\n    transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\\n  }\\n}\\n@keyframes fa-shake {\\n  0% {\\n    transform: rotate(-15deg);\\n  }\\n  4% {\\n    transform: rotate(15deg);\\n  }\\n  8%, 24% {\\n    transform: rotate(-18deg);\\n  }\\n  12%, 28% {\\n    transform: rotate(18deg);\\n  }\\n  16% {\\n    transform: rotate(-22deg);\\n  }\\n  20% {\\n    transform: rotate(22deg);\\n  }\\n  32% {\\n    transform: rotate(-12deg);\\n  }\\n  36% {\\n    transform: rotate(12deg);\\n  }\\n  40%, 100% {\\n    transform: rotate(0deg);\\n  }\\n}\\n@keyframes fa-spin {\\n  0% {\\n    transform: rotate(0deg);\\n  }\\n  100% {\\n    transform: rotate(360deg);\\n  }\\n}\\n.fa-rotate-90 {\\n  transform: rotate(90deg);\\n}\\n\\n.fa-rotate-180 {\\n  transform: rotate(180deg);\\n}\\n\\n.fa-rotate-270 {\\n  transform: rotate(270deg);\\n}\\n\\n.fa-flip-horizontal {\\n  transform: scale(-1, 1);\\n}\\n\\n.fa-flip-vertical {\\n  transform: scale(1, -1);\\n}\\n\\n.fa-flip-both,\\n.fa-flip-horizontal.fa-flip-vertical {\\n  transform: scale(-1, -1);\\n}\\n\\n.fa-rotate-by {\\n  transform: rotate(var(--fa-rotate-angle, 0));\\n}\\n\\n.svg-inline--fa .fa-primary {\\n  fill: var(--fa-primary-color, currentColor);\\n  opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa .fa-secondary {\\n  fill: var(--fa-secondary-color, currentColor);\\n  opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-primary {\\n  opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\\n  opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa mask .fa-primary,\\n.svg-inline--fa mask .fa-secondary {\\n  fill: black;\\n}\\n\\n.svg-inline--fa.fa-inverse {\\n  fill: var(--fa-inverse, #fff);\\n}\\n\\n.fa-stack {\\n  display: inline-block;\\n  height: 2em;\\n  line-height: 2em;\\n  position: relative;\\n  vertical-align: middle;\\n  width: 2.5em;\\n}\\n\\n.fa-inverse {\\n  color: var(--fa-inverse, #fff);\\n}\\n\\n.svg-inline--fa.fa-stack-1x {\\n  --fa-width: 1.25em;\\n  height: 1em;\\n  width: var(--fa-width);\\n}\\n.svg-inline--fa.fa-stack-2x {\\n  --fa-width: 2.5em;\\n  height: 2em;\\n  width: var(--fa-width);\\n}\\n\\n.fa-stack-1x,\\n.fa-stack-2x {\\n  inset: 0;\\n  margin: auto;\\n  position: absolute;\\n  z-index: var(--fa-stack-z-index, auto);\\n}\";\n\nfunction css() {\n  var dcp = DEFAULT_CSS_PREFIX;\n  var drc = DEFAULT_REPLACEMENT_CLASS;\n  var fp = config.cssPrefix;\n  var rc = config.replacementClass;\n  var s = baseStyles;\n  if (fp !== dcp || rc !== drc) {\n    var dPatt = new RegExp(\"\\\\.\".concat(dcp, \"\\\\-\"), 'g');\n    var customPropPatt = new RegExp(\"\\\\--\".concat(dcp, \"\\\\-\"), 'g');\n    var rPatt = new RegExp(\"\\\\.\".concat(drc), 'g');\n    s = s.replace(dPatt, \".\".concat(fp, \"-\")).replace(customPropPatt, \"--\".concat(fp, \"-\")).replace(rPatt, \".\".concat(rc));\n  }\n  return s;\n}\nvar _cssInserted = false;\nfunction ensureCss() {\n  if (config.autoAddCss && !_cssInserted) {\n    insertCss(css());\n    _cssInserted = true;\n  }\n}\nvar InjectCSS = {\n  mixout: function mixout() {\n    return {\n      dom: {\n        css: css,\n        insertCss: ensureCss\n      }\n    };\n  },\n  hooks: function hooks() {\n    return {\n      beforeDOMElementCreation: function beforeDOMElementCreation() {\n        ensureCss();\n      },\n      beforeI2svg: function beforeI2svg() {\n        ensureCss();\n      }\n    };\n  }\n};\n\nvar w$2 = WINDOW || {};\nif (!w$2[NAMESPACE_IDENTIFIER]) w$2[NAMESPACE_IDENTIFIER] = {};\nif (!w$2[NAMESPACE_IDENTIFIER].styles) w$2[NAMESPACE_IDENTIFIER].styles = {};\nif (!w$2[NAMESPACE_IDENTIFIER].hooks) w$2[NAMESPACE_IDENTIFIER].hooks = {};\nif (!w$2[NAMESPACE_IDENTIFIER].shims) w$2[NAMESPACE_IDENTIFIER].shims = [];\nvar namespace = w$2[NAMESPACE_IDENTIFIER];\n\nvar functions = [];\nvar _listener = function listener() {\n  DOCUMENT.removeEventListener('DOMContentLoaded', _listener);\n  loaded = 1;\n  functions.map(function (fn) {\n    return fn();\n  });\n};\nvar loaded = false;\nif (IS_DOM) {\n  loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);\n  if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', _listener);\n}\nfunction domready (fn) {\n  if (!IS_DOM) return;\n  loaded ? setTimeout(fn, 0) : functions.push(fn);\n}\n\nfunction toHtml(abstractNodes) {\n  var tag = abstractNodes.tag,\n    _abstractNodes$attrib = abstractNodes.attributes,\n    attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,\n    _abstractNodes$childr = abstractNodes.children,\n    children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;\n  if (typeof abstractNodes === 'string') {\n    return htmlEscape(abstractNodes);\n  } else {\n    return \"<\".concat(tag, \" \").concat(joinAttributes(attributes), \">\").concat(children.map(toHtml).join(''), \"</\").concat(tag, \">\");\n  }\n}\n\nfunction iconFromMapping(mapping, prefix, iconName) {\n  if (mapping && mapping[prefix] && mapping[prefix][iconName]) {\n    return {\n      prefix: prefix,\n      iconName: iconName,\n      icon: mapping[prefix][iconName]\n    };\n  }\n}\n\n/**\n * Internal helper to bind a function known to have 4 arguments\n * to a given context.\n */\nvar bindInternal4 = function bindInternal4(func, thisContext) {\n  return function (a, b, c, d) {\n    return func.call(thisContext, a, b, c, d);\n  };\n};\n\n/**\n * # Reduce\n *\n * A fast object `.reduce()` implementation.\n *\n * @param  {Object}   subject      The object to reduce over.\n * @param  {Function} fn           The reducer function.\n * @param  {mixed}    initialValue The initial value for the reducer, defaults to subject[0].\n * @param  {Object}   thisContext  The context for the reducer.\n * @return {mixed}                 The final result.\n */\nvar reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {\n  var keys = Object.keys(subject),\n    length = keys.length,\n    iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,\n    i,\n    key,\n    result;\n  if (initialValue === undefined) {\n    i = 1;\n    result = subject[keys[0]];\n  } else {\n    i = 0;\n    result = initialValue;\n  }\n  for (; i < length; i++) {\n    key = keys[i];\n    result = iterator(result, subject[key], key, subject);\n  }\n  return result;\n};\n\n/**\n * Return hexadecimal string for a unicode character\n * Returns `null` when more than one character (not bytes!) are passed\n * For example: 'K' → '7B'\n */\nfunction toHex(unicode) {\n  if (_toConsumableArray(unicode).length !== 1) return null;\n  return unicode.codePointAt(0).toString(16);\n}\n\nfunction normalizeIcons(icons) {\n  return Object.keys(icons).reduce(function (acc, iconName) {\n    var icon = icons[iconName];\n    var expanded = !!icon.icon;\n    if (expanded) {\n      acc[icon.iconName] = icon.icon;\n    } else {\n      acc[iconName] = icon;\n    }\n    return acc;\n  }, {});\n}\nfunction defineIcons(prefix, icons) {\n  var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  var _params$skipHooks = params.skipHooks,\n    skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;\n  var normalized = normalizeIcons(icons);\n  if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {\n    namespace.hooks.addPack(prefix, normalizeIcons(icons));\n  } else {\n    namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), normalized);\n  }\n\n  /**\n   * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction\n   * of new styles we needed to differentiate between them. Prefix `fa` is now an alias\n   * for `fas` so we'll ease the upgrade process for our users by automatically defining\n   * this as well.\n   */\n  if (prefix === 'fas') {\n    defineIcons('fa', icons);\n  }\n}\n\nvar MONO = 0x1;\nvar DUO = 0x2;\n\n// New v7 compatible matchers using the style attribute to determine layer membership\nvar modernMatches = [[DUO, /*#__PURE__*/_wrapRegExp(/path opacity=\"([^\"]*)\".*d=\"([^\"]*)\".*path.*d=\"([^\"]*)\"/, {\n  d2: 2,\n  d1: 3\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path opacity=\"([^\"]*)\".*d=\"([^\"]*)\"/, {\n  d2: 2\n})], [MONO, /*#__PURE__*/_wrapRegExp(/path fill=\"currentColor\".*d=\"([^\"]+)\"/, {\n  d1: 1\n})]];\n\n// Old <= v6 matchers, these should rarely get used.\n//\n// Why are there so many? Over the lifecycle of version 5 and 6 we modified the\n// syntax for our source SVG files several times. These patterns match the\n// historical record and attempt to handle backwards-compatibility in rare edge\n// cases (loading version 6 SVG source files using the version 7 SVG parser)\nvar legacyMatches = [[DUO, /*#__PURE__*/_wrapRegExp(/path class=\"([^\"]*secondary[^\"]*)\".*d=\"([^\"]+)\".*path class=\"([^\"]*primary[^\"]*)\".*d=\"([^\"]+)\"/, {\n  attr2: 1,\n  d2: 2,\n  attr1: 3,\n  d1: 4\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path class=\"([^\"]*primary[^\"]*)\".*d=\"([^\"]+)\".*path class=\"([^\"]*secondary[^\"]*)\".*d=\"([^\"]+)\"/, {\n  attr1: 1,\n  d1: 2,\n  attr2: 3,\n  d2: 4\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path class=\"([^\"]*primary[^\"]*)\".*d=\"([^\"]+)\"/, {\n  attr1: 1,\n  d1: 2\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path class=\"([^\"]*secondary[^\"]*)\".*d=\"([^\"]+)\"/, {\n  attr2: 1,\n  d2: 2\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path d=\"([^\"]+)\".*class=\"([^\"]*secondary[^\"]*)\".*path d=\"([^\"]+)\".*class=\"([^\"]*primary[^\"]*)\"/, {\n  d2: 1,\n  attr2: 2,\n  d1: 3,\n  attr1: 4\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path d=\"([^\"]+)\".*class=\"([^\"]*primary[^\"]*)\".*path d=\"([^\"]+)\".*class=\"([^\"]*secondary[^\"]*)\"/, {\n  d1: 1,\n  attr1: 2,\n  d2: 3,\n  attr2: 4\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path d=\"([^\"]+)\".*class=\"([^\"]*primary[^\"]*)\"/, {\n  d1: 1,\n  attr1: 2\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path d=\"([^\"]+)\".*class=\"([^\"]*secondary[^\"]*)\"/, {\n  d2: 1,\n  attr2: 2\n})], [DUO, /*#__PURE__*/_wrapRegExp(/path d=\"([^\"]+)\".*path d=\"([^\"]+)\"/, {\n  d1: 1,\n  d2: 2\n})], [MONO, /*#__PURE__*/_wrapRegExp(/path d=\"([^\"]+)\"/, {\n  d1: 1\n})], [MONO, /*#__PURE__*/_wrapRegExp(/path style=\"([^\"]+)\".*d=\"([^\"]+)\"/, {\n  attr1: 1,\n  d1: 2\n})]];\n\nvar styles = namespace.styles,\n  shims = namespace.shims;\nvar FAMILY_NAMES = Object.keys(PREFIX_TO_LONG_STYLE);\nvar PREFIXES_FOR_FAMILY = FAMILY_NAMES.reduce(function (acc, familyId) {\n  acc[familyId] = Object.keys(PREFIX_TO_LONG_STYLE[familyId]);\n  return acc;\n}, {});\nvar _defaultUsablePrefix = null;\nvar _byUnicode = {};\nvar _byLigature = {};\nvar _byOldName = {};\nvar _byOldUnicode = {};\nvar _byAlias = {};\nfunction isReserved(name) {\n  return ~RESERVED_CLASSES.indexOf(name);\n}\nfunction getIconName(cssPrefix, cls) {\n  var parts = cls.split('-');\n  var prefix = parts[0];\n  var iconName = parts.slice(1).join('-');\n  if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {\n    return iconName;\n  } else {\n    return null;\n  }\n}\nvar build = function build() {\n  var lookup = function lookup(reducer) {\n    return reduce(styles, function (o$$1, style, prefix) {\n      o$$1[prefix] = reduce(style, reducer, {});\n      return o$$1;\n    }, {});\n  };\n  _byUnicode = lookup(function (acc, icon, iconName) {\n    if (icon[3]) {\n      acc[icon[3]] = iconName;\n    }\n    if (icon[2]) {\n      var aliases = icon[2].filter(function (a$$1) {\n        return typeof a$$1 === 'number';\n      });\n      aliases.forEach(function (alias) {\n        acc[alias.toString(16)] = iconName;\n      });\n    }\n    return acc;\n  });\n  _byLigature = lookup(function (acc, icon, iconName) {\n    acc[iconName] = iconName;\n    if (icon[2]) {\n      var aliases = icon[2].filter(function (a$$1) {\n        return typeof a$$1 === 'string';\n      });\n      aliases.forEach(function (alias) {\n        acc[alias] = iconName;\n      });\n    }\n    return acc;\n  });\n  _byAlias = lookup(function (acc, icon, iconName) {\n    var aliases = icon[2];\n    acc[iconName] = iconName;\n    aliases.forEach(function (alias) {\n      acc[alias] = iconName;\n    });\n    return acc;\n  });\n\n  // If we have a Kit, we can't determine if regular is available since we\n  // could be auto-fetching it. We'll have to assume that it is available.\n  var hasRegular = 'far' in styles || config.autoFetchSvg;\n  var shimLookups = reduce(shims, function (acc, shim) {\n    var maybeNameMaybeUnicode = shim[0];\n    var prefix = shim[1];\n    var iconName = shim[2];\n    if (prefix === 'far' && !hasRegular) {\n      prefix = 'fas';\n    }\n    if (typeof maybeNameMaybeUnicode === 'string') {\n      acc.names[maybeNameMaybeUnicode] = {\n        prefix: prefix,\n        iconName: iconName\n      };\n    }\n    if (typeof maybeNameMaybeUnicode === 'number') {\n      acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {\n        prefix: prefix,\n        iconName: iconName\n      };\n    }\n    return acc;\n  }, {\n    names: {},\n    unicodes: {}\n  });\n  _byOldName = shimLookups.names;\n  _byOldUnicode = shimLookups.unicodes;\n  _defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {\n    family: config.familyDefault\n  });\n};\nonChange(function (c$$1) {\n  _defaultUsablePrefix = getCanonicalPrefix(c$$1.styleDefault, {\n    family: config.familyDefault\n  });\n});\nbuild();\nfunction byUnicode(prefix, unicode) {\n  return (_byUnicode[prefix] || {})[unicode];\n}\nfunction byLigature(prefix, ligature) {\n  return (_byLigature[prefix] || {})[ligature];\n}\nfunction byAlias(prefix, alias) {\n  return (_byAlias[prefix] || {})[alias];\n}\nfunction byOldName(name) {\n  return _byOldName[name] || {\n    prefix: null,\n    iconName: null\n  };\n}\nfunction byOldUnicode(unicode) {\n  var oldUnicode = _byOldUnicode[unicode];\n  var newUnicode = byUnicode('fas', unicode);\n  return oldUnicode || (newUnicode ? {\n    prefix: 'fas',\n    iconName: newUnicode\n  } : null) || {\n    prefix: null,\n    iconName: null\n  };\n}\nfunction getDefaultUsablePrefix() {\n  return _defaultUsablePrefix;\n}\nvar emptyCanonicalIcon = function emptyCanonicalIcon() {\n  return {\n    prefix: null,\n    iconName: null,\n    rest: []\n  };\n};\nfunction getFamilyId(values) {\n  var family = i;\n  var famProps = FAMILY_NAMES.reduce(function (acc, familyId) {\n    acc[familyId] = \"\".concat(config.cssPrefix, \"-\").concat(familyId);\n    return acc;\n  }, {});\n  dt.forEach(function (familyId) {\n    if (values.includes(famProps[familyId]) || values.some(function (v$$1) {\n      return PREFIXES_FOR_FAMILY[familyId].includes(v$$1);\n    })) {\n      family = familyId;\n    }\n  });\n  return family;\n}\nfunction getCanonicalPrefix(styleOrPrefix) {\n  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var _params$family = params.family,\n    family = _params$family === void 0 ? i : _params$family;\n  var style = PREFIX_TO_STYLE[family][styleOrPrefix];\n\n  // handles the exception of passing in only a family of 'duotone' with no style\n  if (family === t && !styleOrPrefix) {\n    return 'fad';\n  }\n  var prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];\n  var defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;\n  var result = prefix || defined || null;\n  return result;\n}\nfunction moveNonFaClassesToRest(classNames) {\n  var rest = [];\n  var iconName = null;\n  classNames.forEach(function (cls) {\n    var result = getIconName(config.cssPrefix, cls);\n    if (result) {\n      iconName = result;\n    } else if (cls) {\n      rest.push(cls);\n    }\n  });\n  return {\n    iconName: iconName,\n    rest: rest\n  };\n}\nfunction sortedUniqueValues(arr) {\n  return arr.sort().filter(function (value, index, arr) {\n    return arr.indexOf(value) === index;\n  });\n}\nvar _faCombinedClasses = lo.concat(Ht);\nfunction getCanonicalIcon(values) {\n  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var _params$skipLookups = params.skipLookups,\n    skipLookups = _params$skipLookups === void 0 ? false : _params$skipLookups;\n  var givenPrefix = null;\n  var faStyleOrFamilyClasses = sortedUniqueValues(values.filter(function (cls) {\n    return _faCombinedClasses.includes(cls);\n  }));\n  var nonStyleOrFamilyClasses = sortedUniqueValues(values.filter(function (cls) {\n    return !_faCombinedClasses.includes(cls);\n  }));\n  var faStyles = faStyleOrFamilyClasses.filter(function (cls) {\n    givenPrefix = cls;\n    return !Z.includes(cls);\n  });\n  var _faStyles = _slicedToArray(faStyles, 1),\n    _faStyles$ = _faStyles[0],\n    styleFromValues = _faStyles$ === void 0 ? null : _faStyles$;\n  var family = getFamilyId(faStyleOrFamilyClasses);\n  var canonical = _objectSpread2(_objectSpread2({}, moveNonFaClassesToRest(nonStyleOrFamilyClasses)), {}, {\n    prefix: getCanonicalPrefix(styleFromValues, {\n      family: family\n    })\n  });\n  return _objectSpread2(_objectSpread2(_objectSpread2({}, canonical), getDefaultCanonicalPrefix({\n    values: values,\n    family: family,\n    styles: styles,\n    config: config,\n    canonical: canonical,\n    givenPrefix: givenPrefix\n  })), applyShimAndAlias(skipLookups, givenPrefix, canonical));\n}\nfunction applyShimAndAlias(skipLookups, givenPrefix, canonical) {\n  var prefix = canonical.prefix,\n    iconName = canonical.iconName;\n  if (skipLookups || !prefix || !iconName) {\n    return {\n      prefix: prefix,\n      iconName: iconName\n    };\n  }\n  var shim = givenPrefix === 'fa' ? byOldName(iconName) : {};\n  var aliasIconName = byAlias(prefix, iconName);\n  iconName = shim.iconName || aliasIconName || iconName;\n  prefix = shim.prefix || prefix;\n  if (prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {\n    // Allow a fallback from the regular style to solid if regular is not available\n    // but only if we aren't auto-fetching SVGs\n    prefix = 'fas';\n  }\n  return {\n    prefix: prefix,\n    iconName: iconName\n  };\n}\nvar newCanonicalFamilies = dt.filter(function (familyId) {\n  return familyId !== i || familyId !== t;\n});\nvar newCanonicalStyles = Object.keys(Xl).filter(function (key) {\n  return key !== i;\n}).map(function (key) {\n  return Object.keys(Xl[key]);\n}).flat();\nfunction getDefaultCanonicalPrefix(prefixOptions) {\n  var values = prefixOptions.values,\n    family = prefixOptions.family,\n    canonical = prefixOptions.canonical,\n    _prefixOptions$givenP = prefixOptions.givenPrefix,\n    givenPrefix = _prefixOptions$givenP === void 0 ? '' : _prefixOptions$givenP,\n    _prefixOptions$styles = prefixOptions.styles,\n    styles = _prefixOptions$styles === void 0 ? {} : _prefixOptions$styles,\n    _prefixOptions$config = prefixOptions.config,\n    config$$1 = _prefixOptions$config === void 0 ? {} : _prefixOptions$config;\n  var isDuotoneFamily = family === t;\n  var valuesHasDuotone = values.includes('fa-duotone') || values.includes('fad');\n  var defaultFamilyIsDuotone = config$$1.familyDefault === 'duotone';\n  var canonicalPrefixIsDuotone = canonical.prefix === 'fad' || canonical.prefix === 'fa-duotone';\n  if (!isDuotoneFamily && (valuesHasDuotone || defaultFamilyIsDuotone || canonicalPrefixIsDuotone)) {\n    canonical.prefix = 'fad';\n  }\n  if (values.includes('fa-brands') || values.includes('fab')) {\n    canonical.prefix = 'fab';\n  }\n  if (!canonical.prefix && newCanonicalFamilies.includes(family)) {\n    var validPrefix = Object.keys(styles).find(function (key) {\n      return newCanonicalStyles.includes(key);\n    });\n    if (validPrefix || config$$1.autoFetchSvg) {\n      var defaultPrefix = Et.get(family).defaultShortPrefixId;\n      canonical.prefix = defaultPrefix;\n      canonical.iconName = byAlias(canonical.prefix, canonical.iconName) || canonical.iconName;\n    }\n  }\n  if (canonical.prefix === 'fa' || givenPrefix === 'fa') {\n    // The fa prefix is not canonical. So if it has made it through until this point\n    // we will shift it to the correct prefix.\n    canonical.prefix = getDefaultUsablePrefix() || 'fas';\n  }\n  return canonical;\n}\n\nvar Library = /*#__PURE__*/function () {\n  function Library() {\n    _classCallCheck(this, Library);\n    this.definitions = {};\n  }\n  return _createClass(Library, [{\n    key: \"add\",\n    value: function add() {\n      var _this = this;\n      for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {\n        definitions[_key] = arguments[_key];\n      }\n      var additions = definitions.reduce(this._pullDefinitions, {});\n      Object.keys(additions).forEach(function (key) {\n        _this.definitions[key] = _objectSpread2(_objectSpread2({}, _this.definitions[key] || {}), additions[key]);\n        defineIcons(key, additions[key]);\n\n        // To keep support for older Classic styles, also add longer prefixes\n        var longPrefix = PREFIX_TO_LONG_STYLE[i][key];\n        if (longPrefix) defineIcons(longPrefix, additions[key]);\n        build();\n      });\n    }\n  }, {\n    key: \"reset\",\n    value: function reset() {\n      this.definitions = {};\n    }\n  }, {\n    key: \"_pullDefinitions\",\n    value: function _pullDefinitions(additions, definition) {\n      var normalized = definition.prefix && definition.iconName && definition.icon ? {\n        0: definition\n      } : definition;\n      Object.keys(normalized).map(function (key) {\n        var _normalized$key = normalized[key],\n          prefix = _normalized$key.prefix,\n          iconName = _normalized$key.iconName,\n          icon = _normalized$key.icon;\n        var aliases = icon[2];\n        if (!additions[prefix]) additions[prefix] = {};\n        if (aliases.length > 0) {\n          aliases.forEach(function (alias) {\n            if (typeof alias === 'string') {\n              additions[prefix][alias] = icon;\n            }\n          });\n        }\n        additions[prefix][iconName] = icon;\n      });\n      return additions;\n    }\n  }]);\n}();\n\nvar _plugins = [];\nvar _hooks = {};\nvar providers = {};\nvar defaultProviderKeys = Object.keys(providers);\nfunction registerPlugins(nextPlugins, _ref) {\n  var obj = _ref.mixoutsTo;\n  _plugins = nextPlugins;\n  _hooks = {};\n  Object.keys(providers).forEach(function (k) {\n    if (defaultProviderKeys.indexOf(k) === -1) {\n      delete providers[k];\n    }\n  });\n  _plugins.forEach(function (plugin) {\n    var mixout = plugin.mixout ? plugin.mixout() : {};\n    Object.keys(mixout).forEach(function (tk) {\n      if (typeof mixout[tk] === 'function') {\n        obj[tk] = mixout[tk];\n      }\n      if (_typeof(mixout[tk]) === 'object') {\n        Object.keys(mixout[tk]).forEach(function (sk) {\n          if (!obj[tk]) {\n            obj[tk] = {};\n          }\n          obj[tk][sk] = mixout[tk][sk];\n        });\n      }\n    });\n    if (plugin.hooks) {\n      var hooks = plugin.hooks();\n      Object.keys(hooks).forEach(function (hook) {\n        if (!_hooks[hook]) {\n          _hooks[hook] = [];\n        }\n        _hooks[hook].push(hooks[hook]);\n      });\n    }\n    if (plugin.provides) {\n      plugin.provides(providers);\n    }\n  });\n  return obj;\n}\nfunction chainHooks(hook, accumulator) {\n  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n    args[_key - 2] = arguments[_key];\n  }\n  var hookFns = _hooks[hook] || [];\n  hookFns.forEach(function (hookFn) {\n    accumulator = hookFn.apply(null, [accumulator].concat(args));\n  });\n  return accumulator;\n}\nfunction callHooks(hook) {\n  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n    args[_key2 - 1] = arguments[_key2];\n  }\n  var hookFns = _hooks[hook] || [];\n  hookFns.forEach(function (hookFn) {\n    hookFn.apply(null, args);\n  });\n  return undefined;\n}\nfunction callProvided() {\n  var hook = arguments[0];\n  var args = Array.prototype.slice.call(arguments, 1);\n  return providers[hook] ? providers[hook].apply(null, args) : undefined;\n}\n\nfunction findIconDefinition(iconLookup) {\n  if (iconLookup.prefix === 'fa') {\n    iconLookup.prefix = 'fas';\n  }\n  var iconName = iconLookup.iconName;\n  var prefix = iconLookup.prefix || getDefaultUsablePrefix();\n  if (!iconName) return;\n  iconName = byAlias(prefix, iconName) || iconName;\n  return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);\n}\nvar library = new Library();\nvar noAuto = function noAuto() {\n  config.autoReplaceSvg = false;\n  config.observeMutations = false;\n  callHooks('noAuto');\n};\nvar dom = {\n  i2svg: function i2svg() {\n    var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    if (IS_DOM) {\n      callHooks('beforeI2svg', params);\n      callProvided('pseudoElements2svg', params);\n      return callProvided('i2svg', params);\n    } else {\n      return Promise.reject(new Error('Operation requires a DOM of some kind.'));\n    }\n  },\n  watch: function watch() {\n    var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    var autoReplaceSvgRoot = params.autoReplaceSvgRoot;\n    if (config.autoReplaceSvg === false) {\n      config.autoReplaceSvg = true;\n    }\n    config.observeMutations = true;\n    domready(function () {\n      autoReplace({\n        autoReplaceSvgRoot: autoReplaceSvgRoot\n      });\n      callHooks('watch', params);\n    });\n  }\n};\nvar parse = {\n  icon: function icon(_icon) {\n    if (_icon === null) {\n      return null;\n    }\n    if (_typeof(_icon) === 'object' && _icon.prefix && _icon.iconName) {\n      return {\n        prefix: _icon.prefix,\n        iconName: byAlias(_icon.prefix, _icon.iconName) || _icon.iconName\n      };\n    }\n    if (Array.isArray(_icon) && _icon.length === 2) {\n      var iconName = _icon[1].indexOf('fa-') === 0 ? _icon[1].slice(3) : _icon[1];\n      var prefix = getCanonicalPrefix(_icon[0]);\n      return {\n        prefix: prefix,\n        iconName: byAlias(prefix, iconName) || iconName\n      };\n    }\n    if (typeof _icon === 'string' && (_icon.indexOf(\"\".concat(config.cssPrefix, \"-\")) > -1 || _icon.match(ICON_SELECTION_SYNTAX_PATTERN))) {\n      var canonicalIcon = getCanonicalIcon(_icon.split(' '), {\n        skipLookups: true\n      });\n      return {\n        prefix: canonicalIcon.prefix || getDefaultUsablePrefix(),\n        iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName\n      };\n    }\n    if (typeof _icon === 'string') {\n      var _prefix = getDefaultUsablePrefix();\n      return {\n        prefix: _prefix,\n        iconName: byAlias(_prefix, _icon) || _icon\n      };\n    }\n  }\n};\nvar api = {\n  noAuto: noAuto,\n  config: config,\n  dom: dom,\n  parse: parse,\n  library: library,\n  findIconDefinition: findIconDefinition,\n  toHtml: toHtml\n};\nvar autoReplace = function autoReplace() {\n  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var _params$autoReplaceSv = params.autoReplaceSvgRoot,\n    autoReplaceSvgRoot = _params$autoReplaceSv === void 0 ? DOCUMENT : _params$autoReplaceSv;\n  if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({\n    node: autoReplaceSvgRoot\n  });\n};\n\nfunction domVariants(val, abstractCreator) {\n  Object.defineProperty(val, 'abstract', {\n    get: abstractCreator\n  });\n  Object.defineProperty(val, 'html', {\n    get: function get() {\n      return val.abstract.map(function (a) {\n        return toHtml(a);\n      });\n    }\n  });\n  Object.defineProperty(val, 'node', {\n    get: function get() {\n      if (!IS_DOM) return undefined;\n      var container = DOCUMENT.createElement('div');\n      container.innerHTML = val.html;\n      return container.children;\n    }\n  });\n  return val;\n}\n\nfunction asIcon (_ref) {\n  var children = _ref.children,\n    main = _ref.main,\n    mask = _ref.mask,\n    attributes = _ref.attributes,\n    styles = _ref.styles,\n    transform = _ref.transform;\n  if (transformIsMeaningful(transform) && main.found && !mask.found) {\n    var width = main.width,\n      height = main.height;\n    var offset = {\n      x: width / height / 2,\n      y: 0.5\n    };\n    attributes['style'] = joinStyles(_objectSpread2(_objectSpread2({}, styles), {}, {\n      'transform-origin': \"\".concat(offset.x + transform.x / 16, \"em \").concat(offset.y + transform.y / 16, \"em\")\n    }));\n  }\n  return [{\n    tag: 'svg',\n    attributes: attributes,\n    children: children\n  }];\n}\n\nfunction asSymbol (_ref) {\n  var prefix = _ref.prefix,\n    iconName = _ref.iconName,\n    children = _ref.children,\n    attributes = _ref.attributes,\n    symbol = _ref.symbol;\n  var id = symbol === true ? \"\".concat(prefix, \"-\").concat(config.cssPrefix, \"-\").concat(iconName) : symbol;\n  return [{\n    tag: 'svg',\n    attributes: {\n      style: 'display: none;'\n    },\n    children: [{\n      tag: 'symbol',\n      attributes: _objectSpread2(_objectSpread2({}, attributes), {}, {\n        id: id\n      }),\n      children: children\n    }]\n  }];\n}\n\n// If any of these attributes are present, don't assume the icon is decorative\nfunction isLabeled(attributes) {\n  var labels = ['aria-label', 'aria-labelledby', 'title', 'role'];\n  return labels.some(function (label) {\n    return label in attributes;\n  });\n}\nfunction makeInlineSvgAbstract(params) {\n  var _params$icons = params.icons,\n    main = _params$icons.main,\n    mask = _params$icons.mask,\n    prefix = params.prefix,\n    iconName = params.iconName,\n    transform = params.transform,\n    symbol = params.symbol,\n    maskId = params.maskId,\n    extra = params.extra,\n    _params$watchable = params.watchable,\n    watchable = _params$watchable === void 0 ? false : _params$watchable;\n  var _ref = mask.found ? mask : main,\n    width = _ref.width,\n    height = _ref.height;\n  var attrClass = [config.replacementClass, iconName ? \"\".concat(config.cssPrefix, \"-\").concat(iconName) : ''].filter(function (c) {\n    return extra.classes.indexOf(c) === -1;\n  }).filter(function (c) {\n    return c !== '' || !!c;\n  }).concat(extra.classes).join(' ');\n  var content = {\n    children: [],\n    attributes: _objectSpread2(_objectSpread2({}, extra.attributes), {}, {\n      'data-prefix': prefix,\n      'data-icon': iconName,\n      'class': attrClass,\n      'role': extra.attributes.role || 'img',\n      'viewBox': \"0 0 \".concat(width, \" \").concat(height)\n    })\n  };\n  if (!isLabeled(extra.attributes) && !extra.attributes['aria-hidden']) {\n    content.attributes['aria-hidden'] = 'true';\n  }\n  if (watchable) {\n    content.attributes[DATA_FA_I2SVG] = '';\n  }\n  var args = _objectSpread2(_objectSpread2({}, content), {}, {\n    prefix: prefix,\n    iconName: iconName,\n    main: main,\n    mask: mask,\n    maskId: maskId,\n    transform: transform,\n    symbol: symbol,\n    styles: _objectSpread2({}, extra.styles)\n  });\n  var _ref2 = mask.found && main.found ? callProvided('generateAbstractMask', args) || {\n      children: [],\n      attributes: {}\n    } : callProvided('generateAbstractIcon', args) || {\n      children: [],\n      attributes: {}\n    },\n    children = _ref2.children,\n    attributes = _ref2.attributes;\n  args.children = children;\n  args.attributes = attributes;\n  if (symbol) {\n    return asSymbol(args);\n  } else {\n    return asIcon(args);\n  }\n}\nfunction makeLayersTextAbstract(params) {\n  var content = params.content,\n    width = params.width,\n    height = params.height,\n    transform = params.transform,\n    extra = params.extra,\n    _params$watchable2 = params.watchable,\n    watchable = _params$watchable2 === void 0 ? false : _params$watchable2;\n  var attributes = _objectSpread2(_objectSpread2({}, extra.attributes), {}, {\n    class: extra.classes.join(' ')\n  });\n  if (watchable) {\n    attributes[DATA_FA_I2SVG] = '';\n  }\n  var styles = _objectSpread2({}, extra.styles);\n  if (transformIsMeaningful(transform)) {\n    styles['transform'] = transformForCss({\n      transform: transform,\n      startCentered: true,\n      width: width,\n      height: height\n    });\n    styles['-webkit-transform'] = styles['transform'];\n  }\n  var styleString = joinStyles(styles);\n  if (styleString.length > 0) {\n    attributes['style'] = styleString;\n  }\n  var val = [];\n  val.push({\n    tag: 'span',\n    attributes: attributes,\n    children: [content]\n  });\n  return val;\n}\nfunction makeLayersCounterAbstract(params) {\n  var content = params.content,\n    extra = params.extra;\n  var attributes = _objectSpread2(_objectSpread2({}, extra.attributes), {}, {\n    class: extra.classes.join(' ')\n  });\n  var styleString = joinStyles(extra.styles);\n  if (styleString.length > 0) {\n    attributes['style'] = styleString;\n  }\n  var val = [];\n  val.push({\n    tag: 'span',\n    attributes: attributes,\n    children: [content]\n  });\n  return val;\n}\n\nvar styles$1 = namespace.styles;\nfunction asFoundIcon(icon) {\n  var width = icon[0];\n  var height = icon[1];\n  var _icon$slice = icon.slice(4),\n    _icon$slice2 = _slicedToArray(_icon$slice, 1),\n    vectorData = _icon$slice2[0];\n  var element = null;\n  if (Array.isArray(vectorData)) {\n    element = {\n      tag: 'g',\n      attributes: {\n        class: \"\".concat(config.cssPrefix, \"-\").concat(DUOTONE_CLASSES.GROUP)\n      },\n      children: [{\n        tag: 'path',\n        attributes: {\n          class: \"\".concat(config.cssPrefix, \"-\").concat(DUOTONE_CLASSES.SECONDARY),\n          fill: 'currentColor',\n          d: vectorData[0]\n        }\n      }, {\n        tag: 'path',\n        attributes: {\n          class: \"\".concat(config.cssPrefix, \"-\").concat(DUOTONE_CLASSES.PRIMARY),\n          fill: 'currentColor',\n          d: vectorData[1]\n        }\n      }]\n    };\n  } else {\n    element = {\n      tag: 'path',\n      attributes: {\n        fill: 'currentColor',\n        d: vectorData\n      }\n    };\n  }\n  return {\n    found: true,\n    width: width,\n    height: height,\n    icon: element\n  };\n}\nvar missingIconResolutionMixin = {\n  found: false,\n  width: 512,\n  height: 512\n};\nfunction maybeNotifyMissing(iconName, prefix) {\n  if (!PRODUCTION && !config.showMissingIcons && iconName) {\n    console.error(\"Icon with name \\\"\".concat(iconName, \"\\\" and prefix \\\"\").concat(prefix, \"\\\" is missing.\"));\n  }\n}\nfunction findIcon(iconName, prefix) {\n  var givenPrefix = prefix;\n  if (prefix === 'fa' && config.styleDefault !== null) {\n    prefix = getDefaultUsablePrefix();\n  }\n  return new Promise(function (resolve, reject) {\n    if (givenPrefix === 'fa') {\n      var shim = byOldName(iconName) || {};\n      iconName = shim.iconName || iconName;\n      prefix = shim.prefix || prefix;\n    }\n    if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {\n      var icon = styles$1[prefix][iconName];\n      return resolve(asFoundIcon(icon));\n    }\n    maybeNotifyMissing(iconName, prefix);\n    resolve(_objectSpread2(_objectSpread2({}, missingIconResolutionMixin), {}, {\n      icon: config.showMissingIcons && iconName ? callProvided('missingIconAbstract') || {} : {}\n    }));\n  });\n}\n\nvar noop$1 = function noop() {};\nvar p$2 = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {\n  mark: noop$1,\n  measure: noop$1\n};\nvar preamble = \"FA \\\"7.2.0\\\"\";\nvar begin = function begin(name) {\n  p$2.mark(\"\".concat(preamble, \" \").concat(name, \" begins\"));\n  return function () {\n    return end(name);\n  };\n};\nvar end = function end(name) {\n  p$2.mark(\"\".concat(preamble, \" \").concat(name, \" ends\"));\n  p$2.measure(\"\".concat(preamble, \" \").concat(name), \"\".concat(preamble, \" \").concat(name, \" begins\"), \"\".concat(preamble, \" \").concat(name, \" ends\"));\n};\nvar perf = {\n  begin: begin,\n  end: end\n};\n\nvar noop$2 = function noop() {};\nfunction isWatched(node) {\n  var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;\n  return typeof i2svg === 'string';\n}\nfunction hasPrefixAndIcon(node) {\n  var prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;\n  var icon = node.getAttribute ? node.getAttribute(DATA_ICON) : null;\n  return prefix && icon;\n}\nfunction hasBeenReplaced(node) {\n  return node && node.classList && node.classList.contains && node.classList.contains(config.replacementClass);\n}\nfunction getMutator() {\n  if (config.autoReplaceSvg === true) {\n    return mutators.replace;\n  }\n  var mutator = mutators[config.autoReplaceSvg];\n  return mutator || mutators.replace;\n}\nfunction createElementNS(tag) {\n  return DOCUMENT.createElementNS('http://www.w3.org/2000/svg', tag);\n}\nfunction createElement(tag) {\n  return DOCUMENT.createElement(tag);\n}\nfunction convertSVG(abstractObj) {\n  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var _params$ceFn = params.ceFn,\n    ceFn = _params$ceFn === void 0 ? abstractObj.tag === 'svg' ? createElementNS : createElement : _params$ceFn;\n  if (typeof abstractObj === 'string') {\n    return DOCUMENT.createTextNode(abstractObj);\n  }\n  var tag = ceFn(abstractObj.tag);\n  Object.keys(abstractObj.attributes || []).forEach(function (key) {\n    tag.setAttribute(key, abstractObj.attributes[key]);\n  });\n  var children = abstractObj.children || [];\n  children.forEach(function (child) {\n    tag.appendChild(convertSVG(child, {\n      ceFn: ceFn\n    }));\n  });\n  return tag;\n}\nfunction nodeAsComment(node) {\n  var comment = \" \".concat(node.outerHTML, \" \");\n  /* BEGIN.ATTRIBUTION */\n  comment = \"\".concat(comment, \"Font Awesome fontawesome.com \");\n  /* END.ATTRIBUTION */\n  return comment;\n}\nvar mutators = {\n  replace: function replace(mutation) {\n    var node = mutation[0];\n    if (node.parentNode) {\n      mutation[1].forEach(function (abstract) {\n        node.parentNode.insertBefore(convertSVG(abstract), node);\n      });\n      if (node.getAttribute(DATA_FA_I2SVG) === null && config.keepOriginalSource) {\n        var comment = DOCUMENT.createComment(nodeAsComment(node));\n        node.parentNode.replaceChild(comment, node);\n      } else {\n        node.remove();\n      }\n    }\n  },\n  nest: function nest(mutation) {\n    var node = mutation[0];\n    var abstract = mutation[1];\n\n    // If we already have a replaced node we do not want to continue nesting within it.\n    // Short-circuit to the standard replacement\n    if (~classArray(node).indexOf(config.replacementClass)) {\n      return mutators.replace(mutation);\n    }\n    var forSvg = new RegExp(\"\".concat(config.cssPrefix, \"-.*\"));\n    delete abstract[0].attributes.id;\n    if (abstract[0].attributes.class) {\n      var splitClasses = abstract[0].attributes.class.split(' ').reduce(function (acc, cls) {\n        if (cls === config.replacementClass || cls.match(forSvg)) {\n          acc.toSvg.push(cls);\n        } else {\n          acc.toNode.push(cls);\n        }\n        return acc;\n      }, {\n        toNode: [],\n        toSvg: []\n      });\n      abstract[0].attributes.class = splitClasses.toSvg.join(' ');\n      if (splitClasses.toNode.length === 0) {\n        node.removeAttribute('class');\n      } else {\n        node.setAttribute('class', splitClasses.toNode.join(' '));\n      }\n    }\n    var newInnerHTML = abstract.map(function (a) {\n      return toHtml(a);\n    }).join('\\n');\n    node.setAttribute(DATA_FA_I2SVG, '');\n    node.innerHTML = newInnerHTML;\n  }\n};\nfunction performOperationSync(op) {\n  op();\n}\nfunction perform(mutations, callback) {\n  var callbackFunction = typeof callback === 'function' ? callback : noop$2;\n  if (mutations.length === 0) {\n    callbackFunction();\n  } else {\n    var frame = performOperationSync;\n    if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {\n      frame = WINDOW.requestAnimationFrame || performOperationSync;\n    }\n    frame(function () {\n      var mutator = getMutator();\n      var mark = perf.begin('mutate');\n      mutations.map(mutator);\n      mark();\n      callbackFunction();\n    });\n  }\n}\nvar disabled = false;\nfunction disableObservation() {\n  disabled = true;\n}\nfunction enableObservation() {\n  disabled = false;\n}\nvar mo = null;\nfunction observe(options) {\n  if (!MUTATION_OBSERVER) {\n    return;\n  }\n  if (!config.observeMutations) {\n    return;\n  }\n  var _options$treeCallback = options.treeCallback,\n    treeCallback = _options$treeCallback === void 0 ? noop$2 : _options$treeCallback,\n    _options$nodeCallback = options.nodeCallback,\n    nodeCallback = _options$nodeCallback === void 0 ? noop$2 : _options$nodeCallback,\n    _options$pseudoElemen = options.pseudoElementsCallback,\n    pseudoElementsCallback = _options$pseudoElemen === void 0 ? noop$2 : _options$pseudoElemen,\n    _options$observeMutat = options.observeMutationsRoot,\n    observeMutationsRoot = _options$observeMutat === void 0 ? DOCUMENT : _options$observeMutat;\n  mo = new MUTATION_OBSERVER(function (objects) {\n    if (disabled) return;\n    var defaultPrefix = getDefaultUsablePrefix();\n    toArray(objects).forEach(function (mutationRecord) {\n      if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {\n        if (config.searchPseudoElements) {\n          pseudoElementsCallback(mutationRecord.target);\n        }\n        treeCallback(mutationRecord.target);\n      }\n      if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {\n        pseudoElementsCallback([mutationRecord.target], true);\n      }\n      if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {\n        if (mutationRecord.attributeName === 'class' && hasPrefixAndIcon(mutationRecord.target)) {\n          var _getCanonicalIcon = getCanonicalIcon(classArray(mutationRecord.target)),\n            prefix = _getCanonicalIcon.prefix,\n            iconName = _getCanonicalIcon.iconName;\n          mutationRecord.target.setAttribute(DATA_PREFIX, prefix || defaultPrefix);\n          if (iconName) mutationRecord.target.setAttribute(DATA_ICON, iconName);\n        } else if (hasBeenReplaced(mutationRecord.target)) {\n          nodeCallback(mutationRecord.target);\n        }\n      }\n    });\n  });\n  if (!IS_DOM) return;\n  mo.observe(observeMutationsRoot, {\n    childList: true,\n    attributes: true,\n    characterData: true,\n    subtree: true\n  });\n}\nfunction disconnect() {\n  if (!mo) return;\n  mo.disconnect();\n}\n\nfunction styleParser (node) {\n  var style = node.getAttribute('style');\n  var val = [];\n  if (style) {\n    val = style.split(';').reduce(function (acc, style) {\n      var styles = style.split(':');\n      var prop = styles[0];\n      var value = styles.slice(1);\n      if (prop && value.length > 0) {\n        acc[prop] = value.join(':').trim();\n      }\n      return acc;\n    }, {});\n  }\n  return val;\n}\n\nfunction classParser (node) {\n  var existingPrefix = node.getAttribute('data-prefix');\n  var existingIconName = node.getAttribute('data-icon');\n  var innerText = node.innerText !== undefined ? node.innerText.trim() : '';\n  var val = getCanonicalIcon(classArray(node));\n  if (!val.prefix) {\n    val.prefix = getDefaultUsablePrefix();\n  }\n  if (existingPrefix && existingIconName) {\n    val.prefix = existingPrefix;\n    val.iconName = existingIconName;\n  }\n  if (val.iconName && val.prefix) {\n    return val;\n  }\n  if (val.prefix && innerText.length > 0) {\n    val.iconName = byLigature(val.prefix, node.innerText) || byUnicode(val.prefix, toHex(node.innerText));\n  }\n  if (!val.iconName && config.autoFetchSvg && node.firstChild && node.firstChild.nodeType === Node.TEXT_NODE) {\n    val.iconName = node.firstChild.data;\n  }\n  return val;\n}\n\nfunction attributesParser (node) {\n  var extraAttributes = toArray(node.attributes).reduce(function (acc, attr) {\n    if (acc.name !== 'class' && acc.name !== 'style') {\n      acc[attr.name] = attr.value;\n    }\n    return acc;\n  }, {});\n  return extraAttributes;\n}\n\nfunction blankMeta() {\n  return {\n    iconName: null,\n    prefix: null,\n    transform: meaninglessTransform,\n    symbol: false,\n    mask: {\n      iconName: null,\n      prefix: null,\n      rest: []\n    },\n    maskId: null,\n    extra: {\n      classes: [],\n      styles: {},\n      attributes: {}\n    }\n  };\n}\nfunction parseMeta(node) {\n  var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n    styleParser: true\n  };\n  var _classParser = classParser(node),\n    iconName = _classParser.iconName,\n    prefix = _classParser.prefix,\n    extraClasses = _classParser.rest;\n  var extraAttributes = attributesParser(node);\n  var pluginMeta = chainHooks('parseNodeAttributes', {}, node);\n  var extraStyles = parser.styleParser ? styleParser(node) : [];\n  return _objectSpread2({\n    iconName: iconName,\n    prefix: prefix,\n    transform: meaninglessTransform,\n    mask: {\n      iconName: null,\n      prefix: null,\n      rest: []\n    },\n    maskId: null,\n    symbol: false,\n    extra: {\n      classes: extraClasses,\n      styles: extraStyles,\n      attributes: extraAttributes\n    }\n  }, pluginMeta);\n}\n\nvar styles$2 = namespace.styles;\nfunction generateMutation(node) {\n  var nodeMeta = config.autoReplaceSvg === 'nest' ? parseMeta(node, {\n    styleParser: false\n  }) : parseMeta(node);\n  if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {\n    return callProvided('generateLayersText', node, nodeMeta);\n  } else {\n    return callProvided('generateSvgReplacementMutation', node, nodeMeta);\n  }\n}\nfunction getKnownPrefixes() {\n  return [].concat(_toConsumableArray(Ht), _toConsumableArray(lo));\n}\nfunction onTree(root) {\n  var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n  if (!IS_DOM) return Promise.resolve();\n  var htmlClassList = DOCUMENT.documentElement.classList;\n  var hclAdd = function hclAdd(suffix) {\n    return htmlClassList.add(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n  };\n  var hclRemove = function hclRemove(suffix) {\n    return htmlClassList.remove(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n  };\n  var prefixes = config.autoFetchSvg ? getKnownPrefixes() : Z.concat(Object.keys(styles$2));\n  if (!prefixes.includes('fa')) {\n    prefixes.push('fa');\n  }\n  var prefixesDomQuery = [\".\".concat(LAYERS_TEXT_CLASSNAME, \":not([\").concat(DATA_FA_I2SVG, \"])\")].concat(prefixes.map(function (p$$1) {\n    return \".\".concat(p$$1, \":not([\").concat(DATA_FA_I2SVG, \"])\");\n  })).join(', ');\n  if (prefixesDomQuery.length === 0) {\n    return Promise.resolve();\n  }\n  var candidates = [];\n  try {\n    candidates = toArray(root.querySelectorAll(prefixesDomQuery));\n  } catch (e$$1) {\n    // noop\n  }\n  if (candidates.length > 0) {\n    hclAdd('pending');\n    hclRemove('complete');\n  } else {\n    return Promise.resolve();\n  }\n  var mark = perf.begin('onTree');\n  var mutations = candidates.reduce(function (acc, node) {\n    try {\n      var mutation = generateMutation(node);\n      if (mutation) {\n        acc.push(mutation);\n      }\n    } catch (e$$1) {\n      if (!PRODUCTION) {\n        if (e$$1.name === 'MissingIcon') {\n          console.error(e$$1);\n        }\n      }\n    }\n    return acc;\n  }, []);\n  return new Promise(function (resolve, reject) {\n    Promise.all(mutations).then(function (resolvedMutations) {\n      perform(resolvedMutations, function () {\n        hclAdd('active');\n        hclAdd('complete');\n        hclRemove('pending');\n        if (typeof callback === 'function') callback();\n        mark();\n        resolve();\n      });\n    }).catch(function (e$$1) {\n      mark();\n      reject(e$$1);\n    });\n  });\n}\nfunction onNode(node) {\n  var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n  generateMutation(node).then(function (mutation) {\n    if (mutation) {\n      perform([mutation], callback);\n    }\n  });\n}\nfunction resolveIcons(next) {\n  return function (maybeIconDefinition) {\n    var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});\n    var mask = params.mask;\n    if (mask) {\n      mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});\n    }\n    return next(iconDefinition, _objectSpread2(_objectSpread2({}, params), {}, {\n      mask: mask\n    }));\n  };\n}\nvar render = function render(iconDefinition) {\n  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var _params$transform = params.transform,\n    transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,\n    _params$symbol = params.symbol,\n    symbol = _params$symbol === void 0 ? false : _params$symbol,\n    _params$mask = params.mask,\n    mask = _params$mask === void 0 ? null : _params$mask,\n    _params$maskId = params.maskId,\n    maskId = _params$maskId === void 0 ? null : _params$maskId,\n    _params$classes = params.classes,\n    classes = _params$classes === void 0 ? [] : _params$classes,\n    _params$attributes = params.attributes,\n    attributes = _params$attributes === void 0 ? {} : _params$attributes,\n    _params$styles = params.styles,\n    styles = _params$styles === void 0 ? {} : _params$styles;\n  if (!iconDefinition) return;\n  var prefix = iconDefinition.prefix,\n    iconName = iconDefinition.iconName,\n    icon = iconDefinition.icon;\n  return domVariants(_objectSpread2({\n    type: 'icon'\n  }, iconDefinition), function () {\n    callHooks('beforeDOMElementCreation', {\n      iconDefinition: iconDefinition,\n      params: params\n    });\n    return makeInlineSvgAbstract({\n      icons: {\n        main: asFoundIcon(icon),\n        mask: mask ? asFoundIcon(mask.icon) : {\n          found: false,\n          width: null,\n          height: null,\n          icon: {}\n        }\n      },\n      prefix: prefix,\n      iconName: iconName,\n      transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),\n      symbol: symbol,\n      maskId: maskId,\n      extra: {\n        attributes: attributes,\n        styles: styles,\n        classes: classes\n      }\n    });\n  });\n};\nvar ReplaceElements = {\n  mixout: function mixout() {\n    return {\n      icon: resolveIcons(render)\n    };\n  },\n  hooks: function hooks() {\n    return {\n      mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {\n        accumulator.treeCallback = onTree;\n        accumulator.nodeCallback = onNode;\n        return accumulator;\n      }\n    };\n  },\n  provides: function provides(providers$$1) {\n    providers$$1.i2svg = function (params) {\n      var _params$node = params.node,\n        node = _params$node === void 0 ? DOCUMENT : _params$node,\n        _params$callback = params.callback,\n        callback = _params$callback === void 0 ? function () {} : _params$callback;\n      return onTree(node, callback);\n    };\n    providers$$1.generateSvgReplacementMutation = function (node, nodeMeta) {\n      var iconName = nodeMeta.iconName,\n        prefix = nodeMeta.prefix,\n        transform = nodeMeta.transform,\n        symbol = nodeMeta.symbol,\n        mask = nodeMeta.mask,\n        maskId = nodeMeta.maskId,\n        extra = nodeMeta.extra;\n      return new Promise(function (resolve, reject) {\n        Promise.all([findIcon(iconName, prefix), mask.iconName ? findIcon(mask.iconName, mask.prefix) : Promise.resolve({\n          found: false,\n          width: 512,\n          height: 512,\n          icon: {}\n        })]).then(function (_ref) {\n          var _ref2 = _slicedToArray(_ref, 2),\n            main = _ref2[0],\n            mask = _ref2[1];\n          resolve([node, makeInlineSvgAbstract({\n            icons: {\n              main: main,\n              mask: mask\n            },\n            prefix: prefix,\n            iconName: iconName,\n            transform: transform,\n            symbol: symbol,\n            maskId: maskId,\n            extra: extra,\n            watchable: true\n          })]);\n        }).catch(reject);\n      });\n    };\n    providers$$1.generateAbstractIcon = function (_ref3) {\n      var children = _ref3.children,\n        attributes = _ref3.attributes,\n        main = _ref3.main,\n        transform = _ref3.transform,\n        styles = _ref3.styles;\n      var styleString = joinStyles(styles);\n      if (styleString.length > 0) {\n        attributes['style'] = styleString;\n      }\n      var nextChild;\n      if (transformIsMeaningful(transform)) {\n        nextChild = callProvided('generateAbstractTransformGrouping', {\n          main: main,\n          transform: transform,\n          containerWidth: main.width,\n          iconWidth: main.width\n        });\n      }\n      children.push(nextChild || main.icon);\n      return {\n        children: children,\n        attributes: attributes\n      };\n    };\n  }\n};\n\nvar Layers = {\n  mixout: function mixout() {\n    return {\n      layer: function layer(assembler) {\n        var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n        var _params$classes = params.classes,\n          classes = _params$classes === void 0 ? [] : _params$classes;\n        return domVariants({\n          type: 'layer'\n        }, function () {\n          callHooks('beforeDOMElementCreation', {\n            assembler: assembler,\n            params: params\n          });\n          var children = [];\n          assembler(function (args) {\n            Array.isArray(args) ? args.map(function (a) {\n              children = children.concat(a.abstract);\n            }) : children = children.concat(args.abstract);\n          });\n          return [{\n            tag: 'span',\n            attributes: {\n              class: [\"\".concat(config.cssPrefix, \"-layers\")].concat(_toConsumableArray(classes)).join(' ')\n            },\n            children: children\n          }];\n        });\n      }\n    };\n  }\n};\n\nvar LayersCounter = {\n  mixout: function mixout() {\n    return {\n      counter: function counter(content) {\n        var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n        var _params$title = params.title,\n          title = _params$title === void 0 ? null : _params$title,\n          _params$classes = params.classes,\n          classes = _params$classes === void 0 ? [] : _params$classes,\n          _params$attributes = params.attributes,\n          attributes = _params$attributes === void 0 ? {} : _params$attributes,\n          _params$styles = params.styles,\n          styles = _params$styles === void 0 ? {} : _params$styles;\n        return domVariants({\n          type: 'counter',\n          content: content\n        }, function () {\n          callHooks('beforeDOMElementCreation', {\n            content: content,\n            params: params\n          });\n          return makeLayersCounterAbstract({\n            content: content.toString(),\n            title: title,\n            extra: {\n              attributes: attributes,\n              styles: styles,\n              classes: [\"\".concat(config.cssPrefix, \"-layers-counter\")].concat(_toConsumableArray(classes))\n            }\n          });\n        });\n      }\n    };\n  }\n};\n\nvar LayersText = {\n  mixout: function mixout() {\n    return {\n      text: function text(content) {\n        var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n        var _params$transform = params.transform,\n          transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,\n          _params$classes = params.classes,\n          classes = _params$classes === void 0 ? [] : _params$classes,\n          _params$attributes = params.attributes,\n          attributes = _params$attributes === void 0 ? {} : _params$attributes,\n          _params$styles = params.styles,\n          styles = _params$styles === void 0 ? {} : _params$styles;\n        return domVariants({\n          type: 'text',\n          content: content\n        }, function () {\n          callHooks('beforeDOMElementCreation', {\n            content: content,\n            params: params\n          });\n          return makeLayersTextAbstract({\n            content: content,\n            transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),\n            extra: {\n              attributes: attributes,\n              styles: styles,\n              classes: [\"\".concat(config.cssPrefix, \"-layers-text\")].concat(_toConsumableArray(classes))\n            }\n          });\n        });\n      }\n    };\n  },\n  provides: function provides(providers$$1) {\n    providers$$1.generateLayersText = function (node, nodeMeta) {\n      var transform = nodeMeta.transform,\n        extra = nodeMeta.extra;\n      var width = null;\n      var height = null;\n      if (IS_IE) {\n        var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);\n        var boundingClientRect = node.getBoundingClientRect();\n        width = boundingClientRect.width / computedFontSize;\n        height = boundingClientRect.height / computedFontSize;\n      }\n      return Promise.resolve([node, makeLayersTextAbstract({\n        content: node.innerHTML,\n        width: width,\n        height: height,\n        transform: transform,\n        extra: extra,\n        watchable: true\n      })]);\n    };\n  }\n};\n\nvar CLEAN_CONTENT_PATTERN = new RegExp(\"\\\"\", 'ug');\nvar SECONDARY_UNICODE_RANGE = [1105920, 1112319];\nvar _FONT_FAMILY_WEIGHT_TO_PREFIX = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {\n  FontAwesome: {\n    normal: 'fas',\n    400: 'fas'\n  }\n}), Kt), fo), hl);\nvar FONT_FAMILY_WEIGHT_TO_PREFIX = Object.keys(_FONT_FAMILY_WEIGHT_TO_PREFIX).reduce(function (acc, key) {\n  acc[key.toLowerCase()] = _FONT_FAMILY_WEIGHT_TO_PREFIX[key];\n  return acc;\n}, {});\nvar FONT_FAMILY_WEIGHT_FALLBACK = Object.keys(FONT_FAMILY_WEIGHT_TO_PREFIX).reduce(function (acc, fontFamily) {\n  var weights = FONT_FAMILY_WEIGHT_TO_PREFIX[fontFamily];\n  acc[fontFamily] = weights[900] || _toConsumableArray(Object.entries(weights))[0][1];\n  return acc;\n}, {});\n\n// Return hex value of *first* character in `content`\nfunction hexValueFromContent(content) {\n  var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');\n  return toHex(_toConsumableArray(cleaned)[0] || '');\n}\n\n// Check if it's a secondary Duotone layer, by checking if:\n// - Unicode value in `content` is repeated\n// - Unicode value in `content` is above 0x10000\n// - The \"ss01\" font feature is enabled on the `content`\nfunction isSecondaryLayer(styles) {\n  var hasStylisticSet = styles.getPropertyValue('font-feature-settings').includes('ss01');\n  var content = styles.getPropertyValue('content');\n  var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');\n  var codePoint = cleaned.codePointAt(0);\n  var isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];\n  var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;\n  return isPrependTen || isDoubled || hasStylisticSet;\n}\nfunction getPrefix(fontFamily, fontWeight) {\n  var fontFamilySanitized = fontFamily.replace(/^['\"]|['\"]$/g, '').toLowerCase();\n  var fontWeightInteger = parseInt(fontWeight);\n  var fontWeightSanitized = isNaN(fontWeightInteger) ? 'normal' : fontWeightInteger;\n  return (FONT_FAMILY_WEIGHT_TO_PREFIX[fontFamilySanitized] || {})[fontWeightSanitized] || FONT_FAMILY_WEIGHT_FALLBACK[fontFamilySanitized];\n}\nfunction replaceForPosition(node, position) {\n  var pendingAttribute = \"\".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));\n  return new Promise(function (resolve, reject) {\n    if (node.getAttribute(pendingAttribute) !== null) {\n      // This node is already being processed\n      return resolve();\n    }\n    var children = toArray(node.children);\n    var alreadyProcessedPseudoElement = children.filter(function (c$$1) {\n      return c$$1.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;\n    })[0];\n    var styles = WINDOW.getComputedStyle(node, position);\n    var fontFamily = styles.getPropertyValue('font-family');\n    var fontFamilyMatch = fontFamily.match(FONT_FAMILY_PATTERN);\n    var fontWeight = styles.getPropertyValue('font-weight');\n    var content = styles.getPropertyValue('content');\n    if (alreadyProcessedPseudoElement && !fontFamilyMatch) {\n      // If we've already processed it but the current computed style does not result in a font-family,\n      // that probably means that a class name that was previously present to make the icon has been\n      // removed. So we now should delete the icon.\n      node.removeChild(alreadyProcessedPseudoElement);\n      return resolve();\n    } else if (fontFamilyMatch && content !== 'none' && content !== '') {\n      var _content = styles.getPropertyValue('content');\n      var prefix = getPrefix(fontFamily, fontWeight);\n      var hexValue = hexValueFromContent(_content);\n      var isV4 = fontFamilyMatch[0].startsWith('FontAwesome');\n      var isSecondary = isSecondaryLayer(styles);\n      var iconName = byUnicode(prefix, hexValue);\n      var iconIdentifier = iconName;\n      if (isV4) {\n        var iconName4 = byOldUnicode(hexValue);\n        if (iconName4.iconName && iconName4.prefix) {\n          iconName = iconName4.iconName;\n          prefix = iconName4.prefix;\n        }\n      }\n\n      // Only convert the pseudo element in this ::before/::after position into an icon if we haven't\n      // already done so with the same prefix and iconName\n      if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {\n        node.setAttribute(pendingAttribute, iconIdentifier);\n        if (alreadyProcessedPseudoElement) {\n          // Delete the old one, since we're replacing it with a new one\n          node.removeChild(alreadyProcessedPseudoElement);\n        }\n        var meta = blankMeta();\n        var extra = meta.extra;\n        extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;\n        findIcon(iconName, prefix).then(function (main) {\n          var abstract = makeInlineSvgAbstract(_objectSpread2(_objectSpread2({}, meta), {}, {\n            icons: {\n              main: main,\n              mask: emptyCanonicalIcon()\n            },\n            prefix: prefix,\n            iconName: iconIdentifier,\n            extra: extra,\n            watchable: true\n          }));\n          var element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');\n          if (position === '::before') {\n            node.insertBefore(element, node.firstChild);\n          } else {\n            node.appendChild(element);\n          }\n          element.outerHTML = abstract.map(function (a$$1) {\n            return toHtml(a$$1);\n          }).join('\\n');\n          node.removeAttribute(pendingAttribute);\n          resolve();\n        }).catch(reject);\n      } else {\n        resolve();\n      }\n    } else {\n      resolve();\n    }\n  });\n}\nfunction replace(node) {\n  return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);\n}\nfunction processable(node) {\n  return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');\n}\nvar hasPseudoElement = function hasPseudoElement(selector) {\n  return !!selector && PSEUDO_ELEMENTS.some(function (pseudoSelector) {\n    return selector.includes(pseudoSelector);\n  });\n};\n\n// Return selectors from all available stylesheets that have\n// pseudo-elements defined.\nvar parseCSSRuleForPseudos = function parseCSSRuleForPseudos(selectorText) {\n  if (!selectorText) return [];\n  var selectorSet = new Set();\n  var selectors = selectorText.split(/,(?![^()]*\\))/).map(function (s$$1) {\n    return s$$1.trim();\n  });\n  selectors = selectors.flatMap(function (selector) {\n    return selector.includes('(') ? selector : selector.split(',').map(function (s$$1) {\n      return s$$1.trim();\n    });\n  });\n  var _iterator = _createForOfIteratorHelper(selectors),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var selector = _step.value;\n      if (hasPseudoElement(selector)) {\n        // Remove pseudo-elements from the selector\n        var selectorWithoutPseudo = PSEUDO_ELEMENTS.reduce(function (acc, pseudoSelector) {\n          return acc.replace(pseudoSelector, '');\n        }, selector);\n        if (selectorWithoutPseudo !== '' && selectorWithoutPseudo !== '*') {\n          selectorSet.add(selectorWithoutPseudo);\n        }\n      }\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return selectorSet;\n};\nfunction searchPseudoElements(root) {\n  var useAsNodeList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n  if (!IS_DOM) return;\n  var nodeList;\n  if (useAsNodeList) {\n    nodeList = root;\n  } else if (config.searchPseudoElementsFullScan) {\n    nodeList = root.querySelectorAll('*');\n  } else {\n    // Get elements that have pseudo elements defined in the CSS\n    var selectorSet = new Set();\n    var _iterator2 = _createForOfIteratorHelper(document.styleSheets),\n      _step2;\n    try {\n      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n        var stylesheet = _step2.value;\n        try {\n          var _iterator3 = _createForOfIteratorHelper(stylesheet.cssRules),\n            _step3;\n          try {\n            for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n              var rule = _step3.value;\n              var parsedSelectors = parseCSSRuleForPseudos(rule.selectorText);\n              var _iterator4 = _createForOfIteratorHelper(parsedSelectors),\n                _step4;\n              try {\n                for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n                  var selector = _step4.value;\n                  selectorSet.add(selector);\n                }\n              } catch (err) {\n                _iterator4.e(err);\n              } finally {\n                _iterator4.f();\n              }\n            }\n          } catch (err) {\n            _iterator3.e(err);\n          } finally {\n            _iterator3.f();\n          }\n        } catch (e$$1) {\n          if (config.searchPseudoElementsWarnings) {\n            console.warn(\"Font Awesome: cannot parse stylesheet: \".concat(stylesheet.href, \" (\").concat(e$$1.message, \")\\nIf it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin=\\\"anonymous\\\" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.\"));\n          }\n        }\n      }\n    } catch (err) {\n      _iterator2.e(err);\n    } finally {\n      _iterator2.f();\n    }\n    if (!selectorSet.size) return;\n    var cleanSelectors = Array.from(selectorSet).join(', ');\n    try {\n      nodeList = root.querySelectorAll(cleanSelectors);\n    } catch (_unused) {} // eslint-disable-line no-empty\n  }\n  return new Promise(function (resolve, reject) {\n    var operations = toArray(nodeList).filter(processable).map(replace);\n    var end = perf.begin('searchPseudoElements');\n    disableObservation();\n    Promise.all(operations).then(function () {\n      end();\n      enableObservation();\n      resolve();\n    }).catch(function () {\n      end();\n      enableObservation();\n      reject();\n    });\n  });\n}\nvar PseudoElements = {\n  hooks: function hooks() {\n    return {\n      mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {\n        accumulator.pseudoElementsCallback = searchPseudoElements;\n        return accumulator;\n      }\n    };\n  },\n  provides: function provides(providers) {\n    providers.pseudoElements2svg = function (params) {\n      var _params$node = params.node,\n        node = _params$node === void 0 ? DOCUMENT : _params$node;\n      if (config.searchPseudoElements) {\n        searchPseudoElements(node);\n      }\n    };\n  }\n};\n\nvar _unwatched = false;\nvar MutationObserver$1 = {\n  mixout: function mixout() {\n    return {\n      dom: {\n        unwatch: function unwatch() {\n          disableObservation();\n          _unwatched = true;\n        }\n      }\n    };\n  },\n  hooks: function hooks() {\n    return {\n      bootstrap: function bootstrap() {\n        observe(chainHooks('mutationObserverCallbacks', {}));\n      },\n      noAuto: function noAuto() {\n        disconnect();\n      },\n      watch: function watch(params) {\n        var observeMutationsRoot = params.observeMutationsRoot;\n        if (_unwatched) {\n          enableObservation();\n        } else {\n          observe(chainHooks('mutationObserverCallbacks', {\n            observeMutationsRoot: observeMutationsRoot\n          }));\n        }\n      }\n    };\n  }\n};\n\nvar parseTransformString = function parseTransformString(transformString) {\n  var transform = {\n    size: 16,\n    x: 0,\n    y: 0,\n    flipX: false,\n    flipY: false,\n    rotate: 0\n  };\n  return transformString.toLowerCase().split(' ').reduce(function (acc, n) {\n    var parts = n.toLowerCase().split('-');\n    var first = parts[0];\n    var rest = parts.slice(1).join('-');\n    if (first && rest === 'h') {\n      acc.flipX = true;\n      return acc;\n    }\n    if (first && rest === 'v') {\n      acc.flipY = true;\n      return acc;\n    }\n    rest = parseFloat(rest);\n    if (isNaN(rest)) {\n      return acc;\n    }\n    switch (first) {\n      case 'grow':\n        acc.size = acc.size + rest;\n        break;\n      case 'shrink':\n        acc.size = acc.size - rest;\n        break;\n      case 'left':\n        acc.x = acc.x - rest;\n        break;\n      case 'right':\n        acc.x = acc.x + rest;\n        break;\n      case 'up':\n        acc.y = acc.y - rest;\n        break;\n      case 'down':\n        acc.y = acc.y + rest;\n        break;\n      case 'rotate':\n        acc.rotate = acc.rotate + rest;\n        break;\n    }\n    return acc;\n  }, transform);\n};\nvar PowerTransforms = {\n  mixout: function mixout() {\n    return {\n      parse: {\n        transform: function transform(transformString) {\n          return parseTransformString(transformString);\n        }\n      }\n    };\n  },\n  hooks: function hooks() {\n    return {\n      parseNodeAttributes: function parseNodeAttributes(accumulator, node) {\n        var transformString = node.getAttribute('data-fa-transform');\n        if (transformString) {\n          accumulator.transform = parseTransformString(transformString);\n        }\n        return accumulator;\n      }\n    };\n  },\n  provides: function provides(providers) {\n    providers.generateAbstractTransformGrouping = function (_ref) {\n      var main = _ref.main,\n        transform = _ref.transform,\n        containerWidth = _ref.containerWidth,\n        iconWidth = _ref.iconWidth;\n      var outer = {\n        transform: \"translate(\".concat(containerWidth / 2, \" 256)\")\n      };\n      var innerTranslate = \"translate(\".concat(transform.x * 32, \", \").concat(transform.y * 32, \") \");\n      var innerScale = \"scale(\".concat(transform.size / 16 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / 16 * (transform.flipY ? -1 : 1), \") \");\n      var innerRotate = \"rotate(\".concat(transform.rotate, \" 0 0)\");\n      var inner = {\n        transform: \"\".concat(innerTranslate, \" \").concat(innerScale, \" \").concat(innerRotate)\n      };\n      var path = {\n        transform: \"translate(\".concat(iconWidth / 2 * -1, \" -256)\")\n      };\n      var operations = {\n        outer: outer,\n        inner: inner,\n        path: path\n      };\n      return {\n        tag: 'g',\n        attributes: _objectSpread2({}, operations.outer),\n        children: [{\n          tag: 'g',\n          attributes: _objectSpread2({}, operations.inner),\n          children: [{\n            tag: main.icon.tag,\n            children: main.icon.children,\n            attributes: _objectSpread2(_objectSpread2({}, main.icon.attributes), operations.path)\n          }]\n        }]\n      };\n    };\n  }\n};\n\nvar ALL_SPACE = {\n  x: 0,\n  y: 0,\n  width: '100%',\n  height: '100%'\n};\nfunction fillBlack(abstract) {\n  var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n  if (abstract.attributes && (abstract.attributes.fill || force)) {\n    abstract.attributes.fill = 'black';\n  }\n  return abstract;\n}\nfunction deGroup(abstract) {\n  if (abstract.tag === 'g') {\n    return abstract.children;\n  } else {\n    return [abstract];\n  }\n}\nvar Masks = {\n  hooks: function hooks() {\n    return {\n      parseNodeAttributes: function parseNodeAttributes(accumulator, node) {\n        var maskData = node.getAttribute('data-fa-mask');\n        var mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(function (i) {\n          return i.trim();\n        }));\n        if (!mask.prefix) {\n          mask.prefix = getDefaultUsablePrefix();\n        }\n        accumulator.mask = mask;\n        accumulator.maskId = node.getAttribute('data-fa-mask-id');\n        return accumulator;\n      }\n    };\n  },\n  provides: function provides(providers) {\n    providers.generateAbstractMask = function (_ref) {\n      var children = _ref.children,\n        attributes = _ref.attributes,\n        main = _ref.main,\n        mask = _ref.mask,\n        explicitMaskId = _ref.maskId,\n        transform = _ref.transform;\n      var mainWidth = main.width,\n        mainPath = main.icon;\n      var maskWidth = mask.width,\n        maskPath = mask.icon;\n      var trans = transformForSvg({\n        transform: transform,\n        containerWidth: maskWidth,\n        iconWidth: mainWidth\n      });\n      var maskRect = {\n        tag: 'rect',\n        attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {\n          fill: 'white'\n        })\n      };\n      var maskInnerGroupChildrenMixin = mainPath.children ? {\n        children: mainPath.children.map(fillBlack)\n      } : {};\n      var maskInnerGroup = {\n        tag: 'g',\n        attributes: _objectSpread2({}, trans.inner),\n        children: [fillBlack(_objectSpread2({\n          tag: mainPath.tag,\n          attributes: _objectSpread2(_objectSpread2({}, mainPath.attributes), trans.path)\n        }, maskInnerGroupChildrenMixin))]\n      };\n      var maskOuterGroup = {\n        tag: 'g',\n        attributes: _objectSpread2({}, trans.outer),\n        children: [maskInnerGroup]\n      };\n      var maskId = \"mask-\".concat(explicitMaskId || nextUniqueId());\n      var clipId = \"clip-\".concat(explicitMaskId || nextUniqueId());\n      var maskTag = {\n        tag: 'mask',\n        attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {\n          id: maskId,\n          maskUnits: 'userSpaceOnUse',\n          maskContentUnits: 'userSpaceOnUse'\n        }),\n        children: [maskRect, maskOuterGroup]\n      };\n      var defs = {\n        tag: 'defs',\n        children: [{\n          tag: 'clipPath',\n          attributes: {\n            id: clipId\n          },\n          children: deGroup(maskPath)\n        }, maskTag]\n      };\n      children.push(defs, {\n        tag: 'rect',\n        attributes: _objectSpread2({\n          'fill': 'currentColor',\n          'clip-path': \"url(#\".concat(clipId, \")\"),\n          'mask': \"url(#\".concat(maskId, \")\")\n        }, ALL_SPACE)\n      });\n      return {\n        children: children,\n        attributes: attributes\n      };\n    };\n  }\n};\n\nvar MissingIconIndicator = {\n  provides: function provides(providers) {\n    var reduceMotion = false;\n    if (WINDOW.matchMedia) {\n      reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;\n    }\n    providers.missingIconAbstract = function () {\n      var gChildren = [];\n      var FILL = {\n        fill: 'currentColor'\n      };\n      var ANIMATION_BASE = {\n        attributeType: 'XML',\n        repeatCount: 'indefinite',\n        dur: '2s'\n      };\n\n      // Ring\n      gChildren.push({\n        tag: 'path',\n        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {\n          d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'\n        })\n      });\n      var OPACITY_ANIMATE = _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {\n        attributeName: 'opacity'\n      });\n      var dot = {\n        tag: 'circle',\n        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {\n          cx: '256',\n          cy: '364',\n          r: '28'\n        }),\n        children: []\n      };\n      if (!reduceMotion) {\n        dot.children.push({\n          tag: 'animate',\n          attributes: _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {\n            attributeName: 'r',\n            values: '28;14;28;28;14;28;'\n          })\n        }, {\n          tag: 'animate',\n          attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {\n            values: '1;0;1;1;0;1;'\n          })\n        });\n      }\n      gChildren.push(dot);\n      gChildren.push({\n        tag: 'path',\n        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {\n          opacity: '1',\n          d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'\n        }),\n        children: reduceMotion ? [] : [{\n          tag: 'animate',\n          attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {\n            values: '1;0;0;0;0;1;'\n          })\n        }]\n      });\n      if (!reduceMotion) {\n        // Exclamation\n        gChildren.push({\n          tag: 'path',\n          attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {\n            opacity: '0',\n            d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'\n          }),\n          children: [{\n            tag: 'animate',\n            attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {\n              values: '0;0;1;1;0;0;'\n            })\n          }]\n        });\n      }\n      return {\n        tag: 'g',\n        attributes: {\n          class: 'missing'\n        },\n        children: gChildren\n      };\n    };\n  }\n};\n\nvar SvgSymbols = {\n  hooks: function hooks() {\n    return {\n      parseNodeAttributes: function parseNodeAttributes(accumulator, node) {\n        var symbolData = node.getAttribute('data-fa-symbol');\n        var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;\n        accumulator['symbol'] = symbol;\n        return accumulator;\n      }\n    };\n  }\n};\n\nvar plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];\n\nregisterPlugins(plugins, {\n  mixoutsTo: api\n});\nvar noAuto$1 = api.noAuto;\nvar config$1 = api.config;\nvar library$1 = api.library;\nvar dom$1 = api.dom;\nvar parse$1 = api.parse;\nvar findIconDefinition$1 = api.findIconDefinition;\nvar toHtml$1 = api.toHtml;\nvar icon = api.icon;\nvar layer = api.layer;\nvar text = api.text;\nvar counter = api.counter;\n\nexport { noAuto$1 as noAuto, config$1 as config, library$1 as library, dom$1 as dom, parse$1 as parse, findIconDefinition$1 as findIconDefinition, toHtml$1 as toHtml, icon, layer, text, counter, api };\n","import React, { useId, useMemo } from 'react';\nimport { config, parse, icon, text, counter } from '@fortawesome/fontawesome-svg-core';\nimport { jsx } from 'react/jsx-runtime';\n\n// src/components/FontAwesomeIcon.tsx\n\n// src/utils/camelize.ts\nfunction _isNumerical(object) {\n  object = object - 0;\n  return object === object;\n}\nfunction camelize(string) {\n  if (_isNumerical(string)) {\n    return string;\n  }\n  string = string.replace(/[_-]+(.)?/g, (_, chr) => {\n    return chr ? chr.toUpperCase() : \"\";\n  });\n  return string.charAt(0).toLowerCase() + string.slice(1);\n}\nvar createGradientStops = (stop, index) => React.createElement(\"stop\", {\n  key: `${index}-${stop.offset}`,\n  offset: stop.offset,\n  stopColor: stop.color,\n  ...stop.opacity !== void 0 && { stopOpacity: stop.opacity }\n});\n\n// src/converter.ts\nfunction capitalize(val) {\n  return val.charAt(0).toUpperCase() + val.slice(1);\n}\nvar styleCache = /* @__PURE__ */ new Map();\nvar STYLE_CACHE_LIMIT = 1e3;\nfunction styleToObject(style) {\n  if (styleCache.has(style)) {\n    return styleCache.get(style);\n  }\n  const result = {};\n  let start = 0;\n  const len = style.length;\n  while (start < len) {\n    const semicolonIndex = style.indexOf(\";\", start);\n    const end = semicolonIndex === -1 ? len : semicolonIndex;\n    const pair = style.slice(start, end).trim();\n    if (pair) {\n      const colonIndex = pair.indexOf(\":\");\n      if (colonIndex > 0) {\n        const rawProp = pair.slice(0, colonIndex).trim();\n        const value = pair.slice(colonIndex + 1).trim();\n        if (rawProp && value) {\n          const prop = camelize(rawProp);\n          result[prop.startsWith(\"webkit\") ? capitalize(prop) : prop] = value;\n        }\n      }\n    }\n    start = end + 1;\n  }\n  if (styleCache.size === STYLE_CACHE_LIMIT) {\n    const oldestKey = styleCache.keys().next().value;\n    if (oldestKey) {\n      styleCache.delete(oldestKey);\n    }\n  }\n  styleCache.set(style, result);\n  return result;\n}\nfunction convert(createElement, element, extraProps = {}) {\n  if (typeof element === \"string\") {\n    return element;\n  }\n  const children = (element.children || []).map((child) => {\n    let element2 = child;\n    if ((\"fill\" in extraProps || extraProps.gradientFill) && child.tag === \"path\" && \"fill\" in child.attributes) {\n      element2 = {\n        ...child,\n        attributes: {\n          ...child.attributes,\n          fill: void 0\n        }\n      };\n    }\n    return convert(createElement, element2);\n  });\n  const elementAttributes = element.attributes || {};\n  const attrs = {};\n  for (const [key, val] of Object.entries(elementAttributes)) {\n    switch (true) {\n      case key === \"class\": {\n        attrs.className = val;\n        break;\n      }\n      case key === \"style\": {\n        attrs.style = styleToObject(String(val));\n        break;\n      }\n      case key.startsWith(\"aria-\"):\n      case key.startsWith(\"data-\"): {\n        attrs[key.toLowerCase()] = val;\n        break;\n      }\n      default: {\n        attrs[camelize(key)] = val;\n      }\n    }\n  }\n  const {\n    style: existingStyle,\n    role: existingRole,\n    \"aria-label\": ariaLabel,\n    gradientFill,\n    ...remaining\n  } = extraProps;\n  if (existingStyle) {\n    attrs.style = attrs.style ? { ...attrs.style, ...existingStyle } : existingStyle;\n  }\n  if (existingRole) {\n    attrs.role = existingRole;\n  }\n  if (ariaLabel) {\n    attrs[\"aria-label\"] = ariaLabel;\n    attrs[\"aria-hidden\"] = \"false\";\n  }\n  if (gradientFill) {\n    attrs.fill = `url(#${gradientFill.id})`;\n    const {\n      type: gradientType,\n      stops: gradientStops = [],\n      ...gradientProps\n    } = gradientFill;\n    children.unshift(\n      createElement(\n        gradientType === \"linear\" ? \"linearGradient\" : \"radialGradient\",\n        {\n          ...gradientProps,\n          id: gradientFill.id\n        },\n        gradientStops.map(createGradientStops)\n      )\n    );\n  }\n  return createElement(element.tag, { ...attrs, ...remaining }, ...children);\n}\nvar makeReactConverter = convert.bind(null, React.createElement);\nvar useAccessibilityId = (id, hasAccessibleProps) => {\n  const generatedId = useId();\n  return id || (hasAccessibleProps ? generatedId : void 0);\n};\n\n// src/logger.ts\nvar Logger = class {\n  constructor(scope = \"react-fontawesome\") {\n    this.enabled = false;\n    let IS_DEV = false;\n    try {\n      IS_DEV = typeof process !== \"undefined\" && process.env?.NODE_ENV === \"development\";\n    } catch {\n    }\n    this.scope = scope;\n    this.enabled = IS_DEV;\n  }\n  /**\n   * Logs messages to the console if not in production.\n   * @param args - The message and/or data to log.\n   */\n  log(...args) {\n    if (!this.enabled) return;\n    console.log(`[${this.scope}]`, ...args);\n  }\n  /**\n   * Logs warnings to the console if not in production.\n   * @param args - The warning message and/or data to log.\n   */\n  warn(...args) {\n    if (!this.enabled) return;\n    console.warn(`[${this.scope}]`, ...args);\n  }\n  /**\n   * Logs errors to the console if not in production.\n   * @param args - The error message and/or data to log.\n   */\n  error(...args) {\n    if (!this.enabled) return;\n    console.error(`[${this.scope}]`, ...args);\n  }\n};\ntypeof process !== \"undefined\" && process.env?.FA_VERSION || \"7.0.0\";\nvar SVG_CORE_VERSION = (\n  // @ts-expect-error TS2872 - Expression is always truthy - This is true when v7 of SVGCore is used, but not when v6 is used.\n  // This is the point of this check - if the property exists on config, we have v7, otherwise we have v6.\n  // TS is checking this against the dev dependencies which uses v7, so it reports a false error here.\n  (\"searchPseudoElementsFullScan\" in config && typeof config.searchPseudoElementsFullScan === \"boolean\" ? \"7.0.0\" : \"6.0.0\")\n);\nvar IS_VERSION_7_OR_LATER = Number.parseInt(SVG_CORE_VERSION) >= 7;\nvar getIsVersion7OrLater = () => IS_VERSION_7_OR_LATER;\nvar DEFAULT_CLASSNAME_PREFIX = \"fa\";\nvar ANIMATION_CLASSES = {\n  beat: \"fa-beat\",\n  fade: \"fa-fade\",\n  beatFade: \"fa-beat-fade\",\n  bounce: \"fa-bounce\",\n  shake: \"fa-shake\",\n  spin: \"fa-spin\",\n  spinPulse: \"fa-spin-pulse\",\n  spinReverse: \"fa-spin-reverse\",\n  pulse: \"fa-pulse\"\n};\nvar PULL_CLASSES = {\n  left: \"fa-pull-left\",\n  right: \"fa-pull-right\"\n};\nvar ROTATE_CLASSES = {\n  \"90\": \"fa-rotate-90\",\n  \"180\": \"fa-rotate-180\",\n  \"270\": \"fa-rotate-270\"\n};\nvar SIZE_CLASSES = {\n  \"2xs\": \"fa-2xs\",\n  xs: \"fa-xs\",\n  sm: \"fa-sm\",\n  lg: \"fa-lg\",\n  xl: \"fa-xl\",\n  \"2xl\": \"fa-2xl\",\n  \"1x\": \"fa-1x\",\n  \"2x\": \"fa-2x\",\n  \"3x\": \"fa-3x\",\n  \"4x\": \"fa-4x\",\n  \"5x\": \"fa-5x\",\n  \"6x\": \"fa-6x\",\n  \"7x\": \"fa-7x\",\n  \"8x\": \"fa-8x\",\n  \"9x\": \"fa-9x\",\n  \"10x\": \"fa-10x\"\n};\nvar STYLE_CLASSES = {\n  border: \"fa-border\",\n  /** @deprecated */\n  fixedWidth: \"fa-fw\",\n  flip: \"fa-flip\",\n  flipHorizontal: \"fa-flip-horizontal\",\n  flipVertical: \"fa-flip-vertical\",\n  inverse: \"fa-inverse\",\n  rotateBy: \"fa-rotate-by\",\n  swapOpacity: \"fa-swap-opacity\",\n  widthAuto: \"fa-width-auto\"\n};\nvar LAYER_CLASSES = {\n  default: \"fa-layers\"\n};\n\n// src/utils/get-class-list-from-props.ts\nfunction withPrefix(cls) {\n  const prefix = config.cssPrefix || config.familyPrefix || DEFAULT_CLASSNAME_PREFIX;\n  return prefix === DEFAULT_CLASSNAME_PREFIX ? cls : cls.replace(\n    new RegExp(String.raw`(?<=^|\\s)${DEFAULT_CLASSNAME_PREFIX}-`, \"g\"),\n    `${prefix}-`\n  );\n}\nfunction getClassListFromProps(props) {\n  const {\n    beat,\n    fade,\n    beatFade,\n    bounce,\n    shake,\n    spin,\n    spinPulse,\n    spinReverse,\n    pulse,\n    fixedWidth,\n    inverse,\n    border,\n    flip,\n    size,\n    rotation,\n    pull,\n    swapOpacity,\n    rotateBy,\n    widthAuto,\n    className\n  } = props;\n  const result = [];\n  if (className) result.push(...className.split(\" \"));\n  if (beat) result.push(ANIMATION_CLASSES.beat);\n  if (fade) result.push(ANIMATION_CLASSES.fade);\n  if (beatFade) result.push(ANIMATION_CLASSES.beatFade);\n  if (bounce) result.push(ANIMATION_CLASSES.bounce);\n  if (shake) result.push(ANIMATION_CLASSES.shake);\n  if (spin) result.push(ANIMATION_CLASSES.spin);\n  if (spinReverse) result.push(ANIMATION_CLASSES.spinReverse);\n  if (spinPulse) result.push(ANIMATION_CLASSES.spinPulse);\n  if (pulse) result.push(ANIMATION_CLASSES.pulse);\n  if (fixedWidth) result.push(STYLE_CLASSES.fixedWidth);\n  if (inverse) result.push(STYLE_CLASSES.inverse);\n  if (border) result.push(STYLE_CLASSES.border);\n  if (flip === true) result.push(STYLE_CLASSES.flip);\n  if (flip === \"horizontal\" || flip === \"both\") {\n    result.push(STYLE_CLASSES.flipHorizontal);\n  }\n  if (flip === \"vertical\" || flip === \"both\") {\n    result.push(STYLE_CLASSES.flipVertical);\n  }\n  if (size !== void 0 && size !== null) result.push(SIZE_CLASSES[size]);\n  if (rotation !== void 0 && rotation !== null && rotation !== 0) {\n    result.push(ROTATE_CLASSES[rotation]);\n  }\n  if (pull !== void 0 && pull !== null) result.push(PULL_CLASSES[pull]);\n  if (swapOpacity) result.push(STYLE_CLASSES.swapOpacity);\n  if (!getIsVersion7OrLater()) return result;\n  if (rotateBy) result.push(STYLE_CLASSES.rotateBy);\n  if (widthAuto) result.push(STYLE_CLASSES.widthAuto);\n  const prefix = config.cssPrefix || config.familyPrefix || DEFAULT_CLASSNAME_PREFIX;\n  return prefix === DEFAULT_CLASSNAME_PREFIX ? result : (\n    // TODO: see if we can achieve custom prefix support without iterating\n    // eslint-disable-next-line unicorn/no-array-callback-reference\n    result.map(withPrefix)\n  );\n}\nvar isIconDefinition = (icon) => typeof icon === \"object\" && \"icon\" in icon && !!icon.icon;\nfunction normalizeIconArgs(icon) {\n  if (!icon) {\n    return void 0;\n  }\n  if (isIconDefinition(icon)) {\n    return icon;\n  }\n  return parse.icon(icon);\n}\n\n// src/utils/typed-object-keys.ts\nfunction typedObjectKeys(obj) {\n  return Object.keys(obj);\n}\n\n// src/components/FontAwesomeIcon.tsx\nvar logger = new Logger(\"FontAwesomeIcon\");\nvar DEFAULT_PROPS = {\n  border: false,\n  className: \"\",\n  mask: void 0,\n  maskId: void 0,\n  fixedWidth: false,\n  inverse: false,\n  flip: false,\n  icon: void 0,\n  listItem: false,\n  pull: void 0,\n  pulse: false,\n  rotation: void 0,\n  rotateBy: false,\n  size: void 0,\n  spin: false,\n  spinPulse: false,\n  spinReverse: false,\n  beat: false,\n  fade: false,\n  beatFade: false,\n  bounce: false,\n  shake: false,\n  symbol: false,\n  title: \"\",\n  titleId: void 0,\n  transform: void 0,\n  swapOpacity: false,\n  widthAuto: false\n};\nvar DEFAULT_PROP_KEYS = new Set(Object.keys(DEFAULT_PROPS));\nvar FontAwesomeIcon = React.forwardRef((props, ref) => {\n  const allProps = { ...DEFAULT_PROPS, ...props };\n  const {\n    icon: iconArgs,\n    mask: maskArgs,\n    symbol,\n    title,\n    titleId: titleIdFromProps,\n    maskId: maskIdFromProps,\n    transform\n  } = allProps;\n  const maskId = useAccessibilityId(maskIdFromProps, Boolean(maskArgs));\n  const titleId = useAccessibilityId(titleIdFromProps, Boolean(title));\n  const iconLookup = normalizeIconArgs(iconArgs);\n  if (!iconLookup) {\n    logger.error(\"Icon lookup is undefined\", iconArgs);\n    return null;\n  }\n  const classList = getClassListFromProps(allProps);\n  const transformProps = typeof transform === \"string\" ? parse.transform(transform) : transform;\n  const normalizedMaskArgs = normalizeIconArgs(maskArgs);\n  const renderedIcon = icon(iconLookup, {\n    ...classList.length > 0 && { classes: classList },\n    ...transformProps && { transform: transformProps },\n    ...normalizedMaskArgs && { mask: normalizedMaskArgs },\n    symbol,\n    title,\n    titleId,\n    maskId\n  });\n  if (!renderedIcon) {\n    logger.error(\"Could not find icon\", iconLookup);\n    return null;\n  }\n  const { abstract } = renderedIcon;\n  const extraProps = { ref };\n  for (const key of typedObjectKeys(allProps)) {\n    if (DEFAULT_PROP_KEYS.has(key)) {\n      continue;\n    }\n    extraProps[key] = allProps[key];\n  }\n  return makeReactConverter(abstract[0], extraProps);\n});\nFontAwesomeIcon.displayName = \"FontAwesomeIcon\";\nvar DEFAULT_CLASSNAMES = `${LAYER_CLASSES.default} ${STYLE_CLASSES.fixedWidth}`;\nvar FontAwesomeLayers = ({\n  children,\n  className,\n  size,\n  ...attributes\n}) => {\n  const prefixedDefaultClasses = withPrefix(DEFAULT_CLASSNAMES);\n  const classes = className ? `${prefixedDefaultClasses} ${className}` : prefixedDefaultClasses;\n  const element = /* @__PURE__ */ jsx(\"span\", { ...attributes, className: classes, children });\n  if (size) {\n    return /* @__PURE__ */ jsx(\"div\", { className: withPrefix(`fa-${size}`), children: element });\n  }\n  return element;\n};\nvar LayersText = ({\n  text: text$1,\n  className,\n  inverse,\n  transform,\n  style,\n  ...attributes\n}) => {\n  const textAbstractElement = useMemo(() => {\n    const textObject = text(text$1, {\n      classes: [\n        ...className?.split(\" \") || [],\n        ...inverse ? [STYLE_CLASSES.inverse] : []\n      ],\n      transform: typeof transform === \"string\" ? parse.transform(transform) : transform\n    });\n    return textObject.abstract[0];\n  }, [text$1, transform, className, inverse]);\n  return makeReactConverter(textAbstractElement, { ...attributes, style });\n};\nvar LayersCounter = ({\n  count,\n  className,\n  style,\n  ...attributes\n}) => {\n  const counterAbstractElement = useMemo(\n    () => counter(count, {\n      classes: className?.split(\" \")\n    }).abstract[0],\n    [count, className]\n  );\n  return makeReactConverter(counterAbstractElement, { ...attributes, style });\n};\n\nexport { FontAwesomeIcon, FontAwesomeLayers, LayersCounter, LayersText };\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<OntologyMark>` — one of the Ontology editor's icons: Font Awesome's solid\n * icon (#1263), in the square the Feather icon it replaced took.\n *\n * @packageDocumentation\n */\n\nimport { chakra, useRecipe } from '@chakra-ui/react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport type { IconDefinition } from '@fortawesome/fontawesome-svg-core';\n\n/** The squares the editor's icons take, in px — east-ui-components' `ontologyMark` recipe's sizes. */\nexport type OntologyMarkSize = '11' | '12' | '13' | '14' | '18';\n\n/** Props for {@link OntologyMark}. */\nexport interface OntologyMarkProps {\n    /** The icon: a Font Awesome solid icon. */\n    readonly icon: IconDefinition;\n    /** The square it takes, in px — what the Feather icon's `size` was. */\n    readonly size: OntologyMarkSize;\n}\n\n/**\n * One of the Ontology editor's icons: a Font Awesome solid icon in an N × N\n * square (the `ontologyMark` recipe), never a Feather icon (#1263).\n *\n * @param props - The icon and its square ({@link OntologyMarkProps})\n * @returns The mark, named by its icon (`data-ontology-mark`)\n */\nexport function OntologyMark({ icon, size }: OntologyMarkProps) {\n    const mark = useRecipe({ key: 'ontologyMark' })({ size });\n    return (\n        <chakra.span css={mark} data-ontology-mark={icon.iconName}>\n            <FontAwesomeIcon icon={icon} />\n        </chakra.span>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<OntologyNode>` — ReactFlow custom node for the ontology editor.\n *\n * Follows the bsys `.lib-card` box: a flat bordered `paper` card, 2px\n * radius, **no top stripe** — a 32×32 brand-tinted icon block on the left,\n * the kind's Font Awesome solid icon 18px square in it (#1263), and a\n * content column with the name (body 13/600) over a kind tag (mono 9.5/600\n * uppercase, kind-coloured). Optional top-right flag pill. Selected →\n * brand-tint fill + brand border. Four outlined connection handles.\n *\n * @packageDocumentation\n */\n\nimport { memo } from 'react';\nimport { Handle, Position, type NodeProps, type Node } from '@xyflow/react';\nimport { Box, Text, VStack } from '@chakra-ui/react';\nimport type { IconDefinition } from '@fortawesome/fontawesome-svg-core';\nimport {\n    faBox, faBullseye, faChartSimple, faCircleCheck, faDatabase, faFileLines,\n    faFolder, faGear, faMicrochip, faShield, faUser,\n} from '@fortawesome/free-solid-svg-icons';\nimport type { OntologyNodeKind } from './types.js';\nimport { NODE_KIND_ACCENT } from './accents.js';\nimport { OntologyMark } from './mark.js';\n\n/** Each kind's icon: Font Awesome's solid icon nearest the Feather icon it replaced (#1263). */\nconst NODE_ICONS: Record<OntologyNodeKind, IconDefinition> = {\n    objective:   faBullseye,\n    kpi:         faChartSimple,\n    decision:    faCircleCheck,\n    process:     faGear,\n    resource:    faBox,\n    agent:       faUser,\n    data:        faDatabase,\n    policy:      faShield,\n    document:    faFileLines,\n    computation: faMicrochip,\n    group:       faFolder,\n};\n\n/** Data the parent passes through to the ReactFlow node-renderer. */\nexport interface OntologyFlowNodeData {\n    name: string;\n    description: string | undefined;\n    type: OntologyNodeKind;\n    attention: 'focused' | 'normal' | 'unfocused';\n    /** Optional status pill shown top-right (e.g. a validation flag). */\n    flag?: string;\n    [key: string]: unknown;\n}\n\n// `.sch-handle` — 8×8 paper-filled, 1.4px ink4 outline. Paper = the mode's\n// surface token so the dot doesn't glare white on a dark canvas (#362).\nconst HANDLE_BASE: React.CSSProperties = {\n    width: 8,\n    height: 8,\n    background: 'var(--chakra-colors-bg-surface)',\n    border: '1.4px solid var(--chakra-colors-gray-500)',\n    boxSizing: 'border-box',\n    zIndex: 5,\n};\n\nconst HANDLE_TARGET: React.CSSProperties = {\n    ...HANDLE_BASE,\n    width: 12,\n    height: 12,\n    opacity: 0.45,\n};\n\nexport const OntologyNode = memo(({ data, selected }: NodeProps<Node<OntologyFlowNodeData>>) => {\n    const icon = NODE_ICONS[data.type] ?? faBox;\n    const isGroup = data.type === 'group';\n    const isFocused = data.attention === 'focused';\n    const isUnfocused = data.attention === 'unfocused';\n    const accent = NODE_KIND_ACCENT[data.type];\n\n    return (\n        <Box\n            position=\"relative\"\n            display=\"grid\"\n            gridTemplateColumns=\"32px 1fr\"\n            gap=\"2\"\n            alignItems=\"center\"\n            bg={selected ? 'bg.brand.subtle' : 'bg.surface'}\n            border=\"1px solid\"\n            borderColor={selected ? 'brand.solid' : isFocused ? 'border.strong' : 'border.subtle'}\n            borderStyle={isGroup ? 'dashed' : 'solid'}\n            borderRadius=\"sm\"\n            px=\"2.5\"\n            py=\"2\"\n            minW={isGroup ? '200px' : '172px'}\n            maxW={isGroup ? '280px' : '240px'}\n            cursor=\"pointer\"\n            transition=\"border-color 120ms, background 120ms, opacity 120ms\"\n            opacity={isUnfocused ? 0.4 : 1}\n            boxShadow=\"sm\"\n            _hover={{ borderColor: 'brand.solid' }}\n            fontFeatureSettings='\"tnum\"'\n        >\n            {/* Source handles — outlined ink4 circles, all four sides. */}\n            <Handle type=\"source\" position={Position.Top}    id=\"top\"    style={HANDLE_BASE} />\n            <Handle type=\"source\" position={Position.Bottom} id=\"bottom\" style={HANDLE_BASE} />\n            <Handle type=\"source\" position={Position.Left}   id=\"left\"   style={HANDLE_BASE} />\n            <Handle type=\"source\" position={Position.Right}  id=\"right\"  style={HANDLE_BASE} />\n            {/* Target handles — larger drop-zones, low-opacity outlined. */}\n            <Handle type=\"target\" position={Position.Top}    id=\"top-target\"    style={HANDLE_TARGET} />\n            <Handle type=\"target\" position={Position.Bottom} id=\"bottom-target\" style={HANDLE_TARGET} />\n            <Handle type=\"target\" position={Position.Left}   id=\"left-target\"   style={HANDLE_TARGET} />\n            <Handle type=\"target\" position={Position.Right}  id=\"right-target\"  style={HANDLE_TARGET} />\n\n            {/* 32×32 brand-tinted icon block (left column). */}\n            <Box\n                w=\"32px\"\n                h=\"32px\"\n                bg=\"bg.brand.subtle\"\n                color=\"brand.fg\"\n                borderRadius=\"sm\"\n                display=\"inline-flex\"\n                alignItems=\"center\"\n                justifyContent=\"center\"\n                flexShrink={0}\n            >\n                <OntologyMark icon={icon} size=\"18\" />\n            </Box>\n\n            {/* Content column: name over kind tag (+ optional description). */}\n            <VStack gap=\"0.5\" alignItems=\"stretch\" minW=\"0\">\n                <Text\n                    fontSize=\"body.lg\"\n                    fontWeight=\"semibold\"\n                    color=\"fg\"\n                    lineHeight=\"tight\"\n                    overflow=\"hidden\"\n                    textOverflow=\"ellipsis\"\n                    whiteSpace=\"nowrap\"\n                >\n                    {data.name}\n                </Text>\n                <Text\n                    fontFamily=\"mono\"\n                    fontSize=\"label.sm\"\n                    fontWeight=\"semibold\"\n                    letterSpacing=\"wider\"\n                    textTransform=\"uppercase\"\n                    color={accent}\n                    lineHeight=\"tight\"\n                >\n                    {data.type}\n                </Text>\n                {data.description && (\n                    <Text\n                        fontSize=\"body.sm\"\n                        color=\"fg.muted\"\n                        lineHeight=\"snug\"\n                        mt=\"0.5\"\n                        overflow=\"hidden\"\n                        textOverflow=\"ellipsis\"\n                        whiteSpace=\"nowrap\"\n                    >\n                        {data.description}\n                    </Text>\n                )}\n            </VStack>\n\n            {/* Optional status flag pill — top-right, mono uppercase. */}\n            {data.flag && (\n                <Box\n                    position=\"absolute\"\n                    top=\"1\"\n                    right=\"1.5\"\n                    px=\"1.5\"\n                    py=\"0.5\"\n                    bg=\"brand.solid\"\n                    color=\"brand.contrast\"\n                    borderRadius=\"xs\"\n                    fontFamily=\"mono\"\n                    fontSize=\"9px\"\n                    fontWeight=\"bold\"\n                    letterSpacing=\"wider\"\n                    textTransform=\"uppercase\"\n                    lineHeight=\"1.2\"\n                >\n                    {data.flag}\n                </Box>\n            )}\n        </Box>\n    );\n});\n\nOntologyNode.displayName = 'OntologyNode';\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<OntologyEdge>` — ReactFlow custom edge for the ontology editor.\n *\n * Styled against the bsys `.sch-conn` vocabulary: 1.5px `ink4` stroke with\n * dash patterns from {@link EDGE_DASH}, `ink2` 1.75px for emphasis, neutral\n * mono label pills (no pastel chips).\n *\n * @packageDocumentation\n */\n\nimport { memo, useMemo } from 'react';\nimport { getBezierPath, EdgeLabelRenderer, type EdgeProps, type Edge } from '@xyflow/react';\nimport { Box, Text, useToken } from '@chakra-ui/react';\nimport type { OntologyLinkKind } from './types.js';\nimport { EDGE_DASH } from './accents.js';\n\n/** Data the parent passes through to the ReactFlow edge-renderer. */\nexport interface OntologyFlowEdgeData {\n    type: OntologyLinkKind;\n    label: string;\n    attention: 'focused' | 'normal' | 'unfocused';\n    [key: string]: unknown;\n}\n\nconst STROKE_WIDTH_DEFAULT = 1.5;\nconst STROKE_WIDTH_EMPHASIZED = 1.75;\n\nexport const OntologyEdge = memo(({\n    id,\n    sourceX,\n    sourceY,\n    targetX,\n    targetY,\n    sourcePosition,\n    targetPosition,\n    selected,\n    data,\n}: EdgeProps<Edge<OntologyFlowEdgeData>>) => {\n    const [edgePath, labelX, labelY] = getBezierPath({\n        sourceX, sourceY, sourcePosition,\n        targetX, targetY, targetPosition,\n    });\n\n    // Pull raw hex values from theme so the SVG stroke gets a literal colour.\n    const [strokeDefault, strokeEmphasized, brandSolid] = useToken('colors', [\n        'gray.500', 'gray.800', 'brand.solid',\n    ]);\n\n    const dash = useMemo(\n        () => (data ? EDGE_DASH[data.type] ?? 'none' : 'none'),\n        [data],\n    );\n    const isFocused = data?.attention === 'focused';\n    const isSelected = selected ?? false;\n    const isEmphasized = isFocused || isSelected;\n    // Spec `.sch-conn .edge` draws at full opacity; only the search \"unfocused\"\n    // state dims (a feature on top of the static spec).\n    const opacity = data?.attention === 'unfocused' ? 0.15 : 1;\n\n    if (!data) {\n        return <path id={id} className=\"react-flow__edge-path\" d={edgePath} fill=\"none\" stroke={strokeDefault} strokeWidth={STROKE_WIDTH_DEFAULT} />;\n    }\n\n    const stroke = isSelected ? brandSolid : isEmphasized ? strokeEmphasized : strokeDefault;\n    const strokeWidth = isEmphasized ? STROKE_WIDTH_EMPHASIZED : STROKE_WIDTH_DEFAULT;\n\n    return (\n        <>\n            {/* Wider invisible hit area for easier click target. */}\n            <path\n                d={edgePath}\n                fill=\"none\"\n                stroke=\"transparent\"\n                strokeWidth={20}\n                className=\"react-flow__edge-interaction\"\n            />\n            <path\n                id={id}\n                className=\"react-flow__edge-path\"\n                d={edgePath}\n                fill=\"none\"\n                markerEnd=\"url(#react-flow__arrowclosed)\"\n                style={{\n                    opacity,\n                    strokeDasharray: isEmphasized ? 'none' : (dash === 'none' ? undefined : dash),\n                    stroke,\n                    strokeWidth,\n                }}\n            />\n            <EdgeLabelRenderer>\n                <Box\n                    position=\"absolute\"\n                    style={{ transform: `translate(-50%, -50%) translate(${labelX}px, ${labelY}px)` }}\n                    className=\"nodrag nopan\"\n                    pointerEvents=\"all\"\n                    opacity={data.attention === 'unfocused' ? 0.25 : 1}\n                >\n                    <Text\n                        fontFamily=\"mono\"\n                        fontSize=\"label.sm\"\n                        letterSpacing=\"wider\"\n                        px=\"2\"\n                        py=\"0.5\"\n                        bg={isSelected ? 'bg.brand.subtle' : 'bg.surface'}\n                        color={isSelected ? 'brand.fg' : 'fg.muted'}\n                        border=\"1px solid\"\n                        borderColor={isSelected ? 'brand.solid' : 'border.subtle'}\n                        borderRadius=\"sm\"\n                        whiteSpace=\"nowrap\"\n                    >\n                        {data.label}\n                    </Text>\n                </Box>\n            </EdgeLabelRenderer>\n        </>\n    );\n});\n\nOntologyEdge.displayName = 'OntologyEdge';\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Renderer-side aliases derived from the East `OntologyType` so the\n * renderer tracks any structural change to the source-of-truth type as a\n * compile error — adding a tag to `NodeKindType` / `LinkKindType` or a\n * field to a struct shows up here, not as a silent runtime drift.\n *\n * The flattened representation (`FlatNode` / `FlatLink`) strips the\n * `OptionType` / `VariantType` wrappers down to plain strings so the\n * React components can read them without ceremony.\n *\n * @packageDocumentation\n */\n\nimport type { ValueTypeOf } from '@elaraai/east';\nimport {\n    NodeKindType as EastNodeKindType,\n    LinkKindType as EastLinkKindType,\n    OntologyType as EastOntologyType,\n} from '@elaraai/e3-ui/internal';\n\n/** JS string-union of every `NodeKindType` variant tag. */\nexport type OntologyNodeKind = ValueTypeOf<typeof EastNodeKindType>['type'];\n\n/** JS string-union of every `LinkKindType` variant tag. */\nexport type OntologyLinkKind = ValueTypeOf<typeof EastLinkKindType>['type'];\n\n/** JS-side shape of an `OntologyType` node carrier. */\nexport type OntologyNode = ValueTypeOf<typeof EastOntologyType>['nodes'][number];\n\n/** JS-side shape of an `OntologyType` link carrier. */\nexport type OntologyLink = ValueTypeOf<typeof EastOntologyType>['links'][number];\n\n/** JS-side shape of an `OntologyType` value. */\nexport type Ontology = ValueTypeOf<typeof EastOntologyType>;\n\n/** Flattened node — variant wrappers stripped to plain strings for the\n *  layout + ReactFlow render path. `description` is `string | undefined`\n *  (not optional) because `exactOptionalPropertyTypes` in tsconfig forbids\n *  assigning `undefined` to an optional property. */\nexport interface FlatNode {\n    id: string;\n    name: string;\n    description: string | undefined;\n    nodeType: OntologyNodeKind;\n}\n\n/** Flattened link — kind unwrapped to a plain string. */\nexport interface FlatLink {\n    id: string;\n    source: string;\n    target: string;\n    linkType: OntologyLinkKind;\n}\n\n/** Strip the variant wrappers off an ontology value for layout / render.\n *  Orphan links (source or target missing from the node set) are dropped. */\nexport function flattenOntology(ontology: Ontology): { nodes: FlatNode[]; links: FlatLink[] } {\n    const nodes: FlatNode[] = ontology.nodes.map(n => ({\n        id: n.id,\n        name: n.name,\n        description: n.description.type === 'some' ? n.description.value : undefined,\n        nodeType: n.type.type,\n    }));\n    const nodeIds = new Set(nodes.map(n => n.id));\n    const links: FlatLink[] = ontology.links\n        .filter(l => nodeIds.has(l.source) && nodeIds.has(l.target))\n        .map(l => ({\n            id: l.id,\n            source: l.source,\n            target: l.target,\n            linkType: l.type.type,\n        }));\n    return { nodes, links };\n}\n\n/**\n * Default link kind for a `source → target` node-kind pair, or `null` if\n * no conventional relation exists. Typed as\n * `Record<OntologyNodeKind, Record<OntologyNodeKind, OntologyLinkKind | null>>`\n * — if `NodeKindType` or `LinkKindType` gains a tag, TS flags the missing\n * entries here.\n */\nexport const ValidLinks: Record<OntologyNodeKind, Record<OntologyNodeKind, OntologyLinkKind | null>> = {\n    objective:   { objective: 'drives',   kpi: 'defines',  decision: 'informs', process: 'drives',    resource: 'drives',     agent: 'informs',  data: 'gets_data_from',    policy: 'informs',  document: 'references', computation: 'informs',  group: null },\n    kpi:         { objective: 'measures', kpi: 'results_in', decision: 'informs', process: 'measures', resource: 'measures',  agent: 'measures', data: 'gets_data_from',    policy: null,       document: 'references', computation: 'gets_data_from', group: null },\n    decision:    { objective: 'drives',   kpi: 'drives',   decision: 'informs', process: 'drives',    resource: 'drives',     agent: 'informs',  data: 'inserts_data_into', policy: 'executes', document: 'references', computation: 'uses',     group: null },\n    process:     { objective: 'drives',   kpi: 'results_in', decision: 'informs', process: 'executes', resource: 'produces',  agent: 'uses',     data: 'inserts_data_into', policy: 'executes', document: 'references', computation: 'uses',     group: null },\n    resource:    { objective: 'drives',   kpi: 'results_in', decision: 'informs', process: 'used_by',  resource: null,        agent: 'used_by',  data: 'inserts_data_into', policy: null,       document: 'references', computation: 'uses',     group: null },\n    agent:       { objective: 'drives',   kpi: 'drives',   decision: 'executes', process: 'executes', resource: 'uses',       agent: 'informs',  data: 'inserts_data_into', policy: 'executes', document: 'references', computation: 'uses',     group: null },\n    data:        { objective: 'informs',  kpi: 'informs',  decision: 'informs', process: 'informs',   resource: 'informs',    agent: 'informs',  data: 'gets_data_from',    policy: 'validates',document: 'references', computation: 'informs',  group: null },\n    policy:      { objective: 'drives',   kpi: 'defines',  decision: 'constrains', process: 'constrains', resource: 'constrains', agent: 'constrains', data: 'constrains',  policy: 'informs',  document: 'references', computation: 'constrains', group: null },\n    document:    { objective: 'defines',  kpi: 'defines',  decision: 'informs', process: 'defines',   resource: 'defines',    agent: 'defines',  data: 'defines',           policy: 'defines',  document: 'references', computation: 'defines',  group: 'defines' },\n    computation: { objective: 'measures', kpi: 'produces', decision: 'informs', process: 'simulates', resource: 'simulates',  agent: 'informs',  data: 'produces',          policy: 'validates',document: 'references', computation: 'uses',     group: null },\n    group:       { objective: 'contains', kpi: 'contains', decision: 'contains', process: 'contains',  resource: 'contains',  agent: 'contains', data: 'contains',          policy: 'contains', document: 'contains',   computation: 'contains', group: 'contains' },\n};\n\n/** All node kinds in display order. */\nexport const ALL_NODE_KINDS: OntologyNodeKind[] = [\n    'objective', 'kpi', 'decision', 'process', 'resource', 'agent',\n    'data', 'policy', 'document', 'computation', 'group',\n];\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<NodePropertiesDrawer>` — slide-out editor for a single ontology node.\n *\n * Ported from the east-ontology webview but decoupled from\n * `OntologyContext` — the node lookup and the update / delete callbacks\n * are injected by the parent renderer.\n *\n * Phase 2 wires the drawer to a read-only `node` lookup; in phase 3 the\n * `onUpdate` / `onDelete` callbacks become non-null and the edit footer\n * goes live. The type picker's chevron is Font Awesome's, never Chakra's own\n * icon (#1263).\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useMemo, useState } from 'react';\nimport {\n    Box, Drawer, Field, HStack, Input, NativeSelect, Portal, Text, Textarea, VStack,\n} from '@chakra-ui/react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faChevronDown } from '@fortawesome/free-solid-svg-icons';\nimport type { OntologyNode, OntologyNodeKind } from './types.js';\nimport { ALL_NODE_KINDS } from './types.js';\nimport { NODE_KIND_ACCENT } from './accents.js';\n\nexport interface NodePropertiesDrawerProps {\n    /** Node to edit; `null` closes the drawer. */\n    nodeId: string | null;\n    /** Resolves a node id to its current ontology entry, or `undefined`. */\n    getNode(id: string): OntologyNode | undefined;\n    /** Close the drawer without committing pending edits. */\n    onClose(): void;\n    /** Apply edits to a node. Pass `null` to disable mutation (read-only). */\n    onUpdate: ((id: string, updates: { type?: OntologyNodeKind; name?: string; description?: string }) => void) | null;\n    /** Delete a node. Pass `null` to disable. */\n    onDelete: ((id: string) => void) | null;\n}\n\ninterface NodePropertiesFormProps {\n    nodeId: string;\n    node: OntologyNode;\n    onUpdate: NodePropertiesDrawerProps['onUpdate'];\n    onDelete: NodePropertiesDrawerProps['onDelete'];\n    onClose: () => void;\n}\n\nfunction NodePropertiesForm({ nodeId, node, onUpdate, onDelete, onClose }: NodePropertiesFormProps) {\n    const readonly = onUpdate === null;\n    const serverName = node.name;\n    const serverDesc = node.description.type === 'some' ? node.description.value : '';\n    const [name, setName] = useState(serverName);\n    const [description, setDescription] = useState(serverDesc);\n\n    useEffect(() => { setName(serverName); }, [serverName]);\n    useEffect(() => { setDescription(serverDesc); }, [serverDesc]);\n\n    return (\n        <VStack gap=\"4\" align=\"stretch\">\n            <Field.Root>\n                <Field.Label fontFamily=\"mono\" fontSize=\"label.sm\" letterSpacing=\"widest\" textTransform=\"uppercase\" color=\"fg.muted\">\n                    Type\n                </Field.Label>\n                <HStack gap=\"2\" alignItems=\"center\">\n                    <Box w=\"8px\" h=\"8px\" borderRadius=\"full\" bg={NODE_KIND_ACCENT[node.type.type]} flexShrink={0} />\n                    <NativeSelect.Root size=\"sm\" flex=\"1\" disabled={readonly}>\n                        <NativeSelect.Field\n                            value={node.type.type}\n                            onChange={(e: React.ChangeEvent<HTMLSelectElement>) => onUpdate?.(nodeId, { type: e.target.value as OntologyNodeKind })}\n                        >\n                            {ALL_NODE_KINDS.map(nt => <option key={nt} value={nt}>{nt}</option>)}\n                        </NativeSelect.Field>\n                        <NativeSelect.Indicator><FontAwesomeIcon icon={faChevronDown} /></NativeSelect.Indicator>\n                    </NativeSelect.Root>\n                </HStack>\n            </Field.Root>\n\n            <Field.Root>\n                <Field.Label fontFamily=\"mono\" fontSize=\"label.sm\" letterSpacing=\"widest\" textTransform=\"uppercase\" color=\"fg.muted\">\n                    Name\n                </Field.Label>\n                <Input\n                    size=\"sm\"\n                    value={name}\n                    disabled={readonly}\n                    onChange={(e: React.ChangeEvent<HTMLInputElement>) => setName(e.target.value)}\n                    onBlur={() => { if (!readonly && name !== serverName) onUpdate?.(nodeId, { name }); }}\n                    onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\n                        if (readonly) return;\n                        if (e.key === 'Enter' && name !== serverName) onUpdate?.(nodeId, { name });\n                    }}\n                />\n            </Field.Root>\n\n            <Field.Root>\n                <Field.Label fontFamily=\"mono\" fontSize=\"label.sm\" letterSpacing=\"widest\" textTransform=\"uppercase\" color=\"fg.muted\">\n                    Description\n                </Field.Label>\n                <Textarea\n                    size=\"sm\"\n                    value={description}\n                    rows={4}\n                    disabled={readonly}\n                    onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => setDescription(e.target.value)}\n                    onBlur={() => { if (!readonly && description !== serverDesc) onUpdate?.(nodeId, { description }); }}\n                />\n            </Field.Root>\n\n            {!readonly && (\n                <HStack gap=\"2\" pt=\"2\" borderTop=\"1px solid\" borderColor=\"border.subtle\" justifyContent=\"space-between\">\n                    <Box\n                        as=\"button\"\n                        fontFamily=\"mono\"\n                        fontSize=\"label.lg\"\n                        letterSpacing=\"wider\"\n                        textTransform=\"uppercase\"\n                        color=\"fg.danger\"\n                        px=\"3\" py=\"1.5\"\n                        border=\"1px solid\"\n                        borderColor=\"transparent\"\n                        _hover={{ borderColor: 'status.neg' }}\n                        onClick={() => { onDelete?.(nodeId); onClose(); }}\n                    >\n                        Delete\n                    </Box>\n                    <Text fontFamily=\"mono\" fontSize=\"label.sm\" letterSpacing=\"widest\" textTransform=\"uppercase\" color=\"fg.subtle\">\n                        Edits save on blur\n                    </Text>\n                </HStack>\n            )}\n        </VStack>\n    );\n}\n\nexport function NodePropertiesDrawer({ nodeId, getNode, onClose, onUpdate, onDelete }: NodePropertiesDrawerProps) {\n    const node = useMemo(() => (nodeId ? getNode(nodeId) : undefined), [nodeId, getNode]);\n    const open = nodeId !== null && node !== undefined;\n\n    return (\n        <Drawer.Root open={open} onOpenChange={(d) => { if (!d.open) onClose(); }} placement=\"end\" size=\"sm\">\n            <Portal>\n                <Drawer.Backdrop />\n                <Drawer.Positioner>\n                    <Drawer.Content bg=\"bg.surface\" borderLeft=\"1px solid\" borderColor=\"border.subtle\">\n                        {/* eyebrow header */}\n                        <Drawer.Header bg=\"bg.panel\" borderBottom=\"1px solid\" borderColor=\"border.subtle\" px=\"4\" py=\"3\">\n                            <HStack justify=\"space-between\" alignItems=\"center\">\n                                <Text fontFamily=\"mono\" fontSize=\"label.lg\" fontWeight=\"semibold\" letterSpacing=\"widest\" textTransform=\"uppercase\" color=\"fg\">\n                                    Edit Node\n                                </Text>\n                                {nodeId && (\n                                    <Text fontFamily=\"mono\" fontSize=\"label.sm\" letterSpacing=\"wider\" color=\"fg.muted\">\n                                        {nodeId}\n                                    </Text>\n                                )}\n                            </HStack>\n                        </Drawer.Header>\n                        <Drawer.Body px=\"4\" py=\"4\">\n                            {node && nodeId && (\n                                <NodePropertiesForm\n                                    nodeId={nodeId}\n                                    node={node}\n                                    onUpdate={onUpdate}\n                                    onDelete={onDelete}\n                                    onClose={onClose}\n                                />\n                            )}\n                        </Drawer.Body>\n                    </Drawer.Content>\n                </Drawer.Positioner>\n            </Portal>\n        </Drawer.Root>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Table projection of an ontology value — the pure derivation behind the\n * editor's table view. Internal to the component (not exported from the\n * package index): nothing here is public API.\n *\n * The projection renders the ontology as a value-driver-tree-shaped table:\n *\n * - **Objective forest** — apex objectives (those that don't `drive`\n *   another objective) at the top, sub-objectives indented beneath via\n *   `objective --drives--> objective` chains.\n * - **KPI tier** — within an objective, processes partition under the KPI\n *   that connects them to it (`process --results_in--> kpi` /\n *   `kpi --measures--> process`, then `kpi --drives--> objective`).\n * - **Process rows** — the leaves, ordered by **value-chain stage**: the\n *   longest-path layering of the process-precedence DAG induced by\n *   resource flow (`A produces r` ∧ `B uses r` ⇒ `A ≺ B`), with\n *   strongly-connected components condensed first so resource cycles\n *   (cash → materials → goods → cash) are honest: every member shares a\n *   stage and is flagged `cyclic` instead of breaking the sort.\n * - **Lints** — REA-duality and reachability checks (a process with no\n *   inputs or no outputs, an unmeasured process, a decision driving\n *   nothing, an unreachable objective, orphan links).\n *\n * @packageDocumentation\n */\n\nimport type { Ontology, OntologyNodeKind } from './types.js';\n\n// ============================================================================\n// Output shape.\n// ============================================================================\n\n/** A node reference rendered as a chip in a table cell. */\nexport interface NodeChip {\n    id: string;\n    name: string;\n    kind: OntologyNodeKind;\n}\n\n/** A process adjacent in the resource flow, with the resources that\n *  connect it — the row-level answer to \"how does this process affect\n *  the next one\". */\nexport interface FlowNeighbor {\n    id: string;\n    name: string;\n    /** Names of the resources carrying the dependency. */\n    via: string[];\n}\n\n/** One process leaf row. */\nexport interface ProcessRow {\n    id: string;\n    name: string;\n    description: string | undefined;\n    /** 1-based global value-chain stage (longest-path layer of the SCC\n     *  condensation). Identical for every member of a resource cycle. */\n    stage: number;\n    /** True iff this process is in a resource-flow cycle (SCC size > 1). */\n    cyclic: boolean;\n    /** Names of the other processes in the same cycle (empty if acyclic). */\n    cycleWith: string[];\n    /** Processes that produce a resource this one uses (what feeds me). */\n    upstream: FlowNeighbor[];\n    /** Processes that use a resource this one produces (what I feed). */\n    downstream: FlowNeighbor[];\n    uses: NodeChip[];\n    produces: NodeChip[];\n    kpis: NodeChip[];\n    data: NodeChip[];\n    decisions: NodeChip[];\n    policies: NodeChip[];\n    agents: NodeChip[];\n    /** KPIs (beyond the section's own) that also connect this row to the\n     *  enclosing objective — rendered as \"also via …\" chips. */\n    alsoVia: NodeChip[];\n    /** Row-level completeness warnings (REA duality etc.). */\n    lints: string[];\n}\n\n/** A KPI sub-section within an objective group. `kpi === null` collects\n *  processes that reach the objective without a connecting KPI (direct\n *  `process --drives--> objective`). */\nexport interface KpiSection {\n    kpi: NodeChip | null;\n    rows: ProcessRow[];\n}\n\n/** An objective group — one node of the objective forest. */\nexport interface ObjectiveGroup {\n    /** `null` for the synthetic \"Unassigned\" group. */\n    id: string | null;\n    name: string;\n    description: string | undefined;\n    /** Indent depth in the objective forest (apex = 0). */\n    depth: number;\n    /** KPI sub-sections. A single section with `kpi: null` when the\n     *  objective has at most one connecting KPI (no tier tax). */\n    sections: KpiSection[];\n    /** Sub-objectives indented beneath this one. */\n    children: ObjectiveGroup[];\n    /** Totals across this group (excluding children). */\n    processCount: number;\n    decisionCount: number;\n    lintCount: number;\n}\n\n/** The full table projection. */\nexport interface TableProjection {\n    groups: ObjectiveGroup[];\n    /** Graph-level warnings (unattached KPIs, idle decisions, orphan links…). */\n    lints: string[];\n    /** Highest stage number assigned (for the stage legend). */\n    stageCount: number;\n    /** Total process count (for the empty state). */\n    processCount: number;\n}\n\n// ============================================================================\n// Internal graph helpers.\n// ============================================================================\n\ninterface FlatNode {\n    id: string;\n    name: string;\n    description: string | undefined;\n    kind: OntologyNodeKind;\n}\n\n/** Tarjan strongly-connected components over a directed adjacency map.\n *  Returns one array of node ids per component, and the component index\n *  per node. Iterative (explicit stack) so deep chains can't overflow. */\nfunction tarjanScc(\n    ids: string[],\n    adj: Map<string, Set<string>>,\n): { components: string[][]; componentOf: Map<string, number> } {\n    const index = new Map<string, number>();\n    const lowlink = new Map<string, number>();\n    const onStack = new Set<string>();\n    const stack: string[] = [];\n    const components: string[][] = [];\n    const componentOf = new Map<string, number>();\n    let counter = 0;\n\n    for (const root of ids) {\n        if (index.has(root)) continue;\n        // Each frame: [node, iterator position into its successors].\n        const work: Array<[string, string[], number]> = [[root, [...(adj.get(root) ?? [])], 0]];\n        index.set(root, counter);\n        lowlink.set(root, counter);\n        counter += 1;\n        stack.push(root);\n        onStack.add(root);\n\n        while (work.length > 0) {\n            const frame = work[work.length - 1]!;\n            const [v, succs] = frame;\n            if (frame[2] < succs.length) {\n                const w = succs[frame[2]]!;\n                frame[2] += 1;\n                if (!index.has(w)) {\n                    index.set(w, counter);\n                    lowlink.set(w, counter);\n                    counter += 1;\n                    stack.push(w);\n                    onStack.add(w);\n                    work.push([w, [...(adj.get(w) ?? [])], 0]);\n                } else if (onStack.has(w)) {\n                    lowlink.set(v, Math.min(lowlink.get(v)!, index.get(w)!));\n                }\n            } else {\n                work.pop();\n                if (work.length > 0) {\n                    const parent = work[work.length - 1]![0];\n                    lowlink.set(parent, Math.min(lowlink.get(parent)!, lowlink.get(v)!));\n                }\n                if (lowlink.get(v) === index.get(v)) {\n                    const component: string[] = [];\n                    for (;;) {\n                        const w = stack.pop()!;\n                        onStack.delete(w);\n                        component.push(w);\n                        if (w === v) break;\n                    }\n                    const ci = components.length;\n                    components.push(component);\n                    for (const w of component) componentOf.set(w, ci);\n                }\n            }\n        }\n    }\n    return { components, componentOf };\n}\n\n/** Longest-path layering of a DAG: layer(n) = 1 + max(layer(preds)). */\nfunction longestPathLayers(count: number, edges: Array<[number, number]>): number[] {\n    const preds: number[][] = Array.from({ length: count }, () => []);\n    const outDeg: number[] = Array.from({ length: count }, () => 0);\n    const inDeg: number[] = Array.from({ length: count }, () => 0);\n    for (const [a, b] of edges) {\n        preds[b]!.push(a);\n        outDeg[a]! += 1;\n        inDeg[b]! += 1;\n    }\n    // Kahn order, then relax. (The graph is a condensation, hence acyclic.)\n    const layer: number[] = Array.from({ length: count }, () => 1);\n    const queue: number[] = [];\n    const remaining = [...inDeg];\n    for (let i = 0; i < count; i++) if (remaining[i] === 0) queue.push(i);\n    const order: number[] = [];\n    while (queue.length > 0) {\n        const n = queue.shift()!;\n        order.push(n);\n        for (const [a, b] of edges) {\n            if (a !== n) continue;\n            remaining[b]! -= 1;\n            if (remaining[b] === 0) queue.push(b);\n        }\n    }\n    for (const n of order) {\n        for (const p of preds[n]!) layer[n] = Math.max(layer[n]!, layer[p]! + 1);\n    }\n    return layer;\n}\n\n// ============================================================================\n// The projection.\n// ============================================================================\n\nexport function projectTable(ontology: Ontology): TableProjection {\n    // ---- Flatten + index. -------------------------------------------------\n    const nodes: FlatNode[] = ontology.nodes.map(n => ({\n        id: n.id,\n        name: n.name,\n        description: n.description.type === 'some' ? n.description.value : undefined,\n        kind: n.type.type,\n    }));\n    const byId = new Map(nodes.map(n => [n.id, n]));\n    const lints: string[] = [];\n\n    interface FlatLink { source: string; target: string; kind: string }\n    const links: FlatLink[] = [];\n    for (const l of ontology.links) {\n        if (!byId.has(l.source) || !byId.has(l.target)) {\n            lints.push(`Orphan link ${l.id}: ${l.source} → ${l.target}`);\n            continue;\n        }\n        links.push({ source: l.source, target: l.target, kind: l.type.type });\n    }\n\n    const chip = (id: string): NodeChip => {\n        const n = byId.get(id)!;\n        return { id: n.id, name: n.name, kind: n.kind };\n    };\n    const ofKind = (kind: OntologyNodeKind) => nodes.filter(n => n.kind === kind);\n    const processes = ofKind('process');\n    const sortChips = (cs: NodeChip[]) => [...new Map(cs.map(c => [c.id, c])).values()]\n        .sort((a, b) => a.name.localeCompare(b.name));\n\n    // ---- Per-process relations (liberal across canonical directions). -----\n    const rel = new Map<string, {\n        uses: NodeChip[]; produces: NodeChip[]; kpis: NodeChip[]; data: NodeChip[];\n        decisions: NodeChip[]; policies: NodeChip[]; agents: NodeChip[]; directObjectives: string[];\n    }>();\n    for (const p of processes) {\n        rel.set(p.id, { uses: [], produces: [], kpis: [], data: [], decisions: [], policies: [], agents: [], directObjectives: [] });\n    }\n    const kindOf = (id: string) => byId.get(id)!.kind;\n\n    for (const l of links) {\n        const sk = kindOf(l.source);\n        const tk = kindOf(l.target);\n        // process ↔ resource flow\n        if (sk === 'process' && tk === 'resource' && l.kind === 'uses') rel.get(l.source)!.uses.push(chip(l.target));\n        if (sk === 'resource' && tk === 'process' && l.kind === 'used_by') rel.get(l.target)!.uses.push(chip(l.source));\n        if (sk === 'process' && tk === 'resource' && l.kind === 'produces') rel.get(l.source)!.produces.push(chip(l.target));\n        // process ↔ kpi\n        if (sk === 'kpi' && tk === 'process' && l.kind === 'measures') rel.get(l.target)!.kpis.push(chip(l.source));\n        if (sk === 'process' && tk === 'kpi' && l.kind === 'results_in') rel.get(l.source)!.kpis.push(chip(l.target));\n        // process ↔ data / computation\n        if (sk === 'data' && tk === 'process') rel.get(l.target)!.data.push(chip(l.source));\n        if (sk === 'process' && tk === 'data') rel.get(l.source)!.data.push(chip(l.target));\n        if (sk === 'computation' && tk === 'process') rel.get(l.target)!.data.push(chip(l.source));\n        if (sk === 'process' && tk === 'computation') rel.get(l.source)!.data.push(chip(l.target));\n        // decision → process\n        if (sk === 'decision' && tk === 'process' && l.kind === 'drives') rel.get(l.target)!.decisions.push(chip(l.source));\n        // policy ↔ process\n        if (sk === 'policy' && tk === 'process' && l.kind === 'constrains') rel.get(l.target)!.policies.push(chip(l.source));\n        if (sk === 'process' && tk === 'policy' && l.kind === 'executes') rel.get(l.source)!.policies.push(chip(l.target));\n        // agent ↔ process\n        if (sk === 'agent' && tk === 'process' && l.kind === 'executes') rel.get(l.target)!.agents.push(chip(l.source));\n        if (sk === 'process' && tk === 'agent' && l.kind === 'uses') rel.get(l.source)!.agents.push(chip(l.target));\n        // process → objective (direct)\n        if (sk === 'process' && tk === 'objective' && l.kind === 'drives') rel.get(l.source)!.directObjectives.push(l.target);\n    }\n\n    // ---- Value-chain stages (SCC condensation + longest-path layers). -----\n    // A ≺ B iff A produces a resource B uses.\n    const producersOf = new Map<string, string[]>(); // resource id -> process ids\n    const usersOf = new Map<string, string[]>();\n    for (const p of processes) {\n        for (const r of rel.get(p.id)!.produces) {\n            producersOf.set(r.id, [...(producersOf.get(r.id) ?? []), p.id]);\n        }\n        for (const r of rel.get(p.id)!.uses) {\n            usersOf.set(r.id, [...(usersOf.get(r.id) ?? []), p.id]);\n        }\n    }\n    const prec = new Map<string, Set<string>>(processes.map(p => [p.id, new Set<string>()]));\n    // a → b via resource r: a produces r, b uses r. `flowVia` remembers the\n    // carrying resources so rows can explain *how* they affect each other.\n    const flowVia = new Map<string, Set<string>>(); // \"a>b\" -> resource names\n    for (const [resourceId, producers] of producersOf) {\n        for (const a of producers) {\n            for (const b of usersOf.get(resourceId) ?? []) {\n                if (a === b) continue;\n                prec.get(a)!.add(b);\n                const key = `${a}>${b}`;\n                if (!flowVia.has(key)) flowVia.set(key, new Set());\n                flowVia.get(key)!.add(byId.get(resourceId)!.name);\n            }\n        }\n    }\n    const neighborsOf = (pid: string): { upstream: FlowNeighbor[]; downstream: FlowNeighbor[] } => {\n        const upstream: FlowNeighbor[] = [];\n        const downstream: FlowNeighbor[] = [];\n        for (const [a, succs] of prec) {\n            if (a === pid) {\n                for (const b of succs) {\n                    downstream.push({ id: b, name: byId.get(b)!.name, via: [...flowVia.get(`${a}>${b}`)!].sort() });\n                }\n            } else if (succs.has(pid)) {\n                upstream.push({ id: a, name: byId.get(a)!.name, via: [...flowVia.get(`${a}>${pid}`)!].sort() });\n            }\n        }\n        upstream.sort((x, y) => x.name.localeCompare(y.name));\n        downstream.sort((x, y) => x.name.localeCompare(y.name));\n        return { upstream, downstream };\n    };\n    const { components, componentOf } = tarjanScc(processes.map(p => p.id), prec);\n    const condensedEdges: Array<[number, number]> = [];\n    const seenEdge = new Set<string>();\n    for (const [a, succs] of prec) {\n        for (const b of succs) {\n            const ca = componentOf.get(a)!;\n            const cb = componentOf.get(b)!;\n            if (ca === cb) continue;\n            const key = `${ca}>${cb}`;\n            if (seenEdge.has(key)) continue;\n            seenEdge.add(key);\n            condensedEdges.push([ca, cb]);\n        }\n    }\n    const layers = longestPathLayers(components.length, condensedEdges);\n    const stageOf = (pid: string) => layers[componentOf.get(pid)!]!;\n    const cycleOf = (pid: string) => components[componentOf.get(pid)!]!;\n    const stageCount = layers.reduce((m, l) => Math.max(m, l), 0);\n\n    // Within a cycle there is no topological order, but there is a best\n    // reading order: enter at the member the rest of the value chain flows\n    // into (an upstream producer *outside* the SCC), then follow the loop —\n    // every row is fed by the row above it, and only the wrap-around edge\n    // points back. Ties (no external inflow) fall back to name.\n    const nameOf = (id: string) => byId.get(id)!.name;\n    const cycleRank = new Map<string, number>();   // walk position within the SCC\n    const sccKey = new Map<string, string>();      // clusters SCC members in the sort\n    for (const component of components) {\n        if (component.length === 1) {\n            const only = component[0]!;\n            cycleRank.set(only, 0);\n            sccKey.set(only, nameOf(only));\n            continue;\n        }\n        const inScc = new Set(component);\n        const externalInflow = (m: string) => {\n            let n = 0;\n            for (const [a, succs] of prec) {\n                if (!inScc.has(a) && succs.has(m)) n += 1;\n            }\n            return n;\n        };\n        const entry = [...component].sort((a, b) =>\n            externalInflow(b) - externalInflow(a) || nameOf(a).localeCompare(nameOf(b)))[0]!;\n        const order: string[] = [];\n        const visited = new Set<string>();\n        const walk = (m: string) => {\n            visited.add(m);\n            order.push(m);\n            const nexts = [...(prec.get(m) ?? [])]\n                .filter(x => inScc.has(x) && !visited.has(x))\n                .sort((a, b) => nameOf(a).localeCompare(nameOf(b)));\n            for (const x of nexts) walk(x);\n        };\n        walk(entry);\n        for (const m of [...component].sort((a, b) => nameOf(a).localeCompare(nameOf(b)))) {\n            if (!visited.has(m)) walk(m);\n        }\n        order.forEach((m, i) => {\n            cycleRank.set(m, i);\n            sccKey.set(m, nameOf(entry));\n        });\n    }\n\n    // ---- KPI → objective reachability (drives chains). ---------------------\n    const drivesAdj = new Map<string, Set<string>>();\n    for (const l of links) {\n        if (l.kind !== 'drives') continue;\n        if (!drivesAdj.has(l.source)) drivesAdj.set(l.source, new Set());\n        drivesAdj.get(l.source)!.add(l.target);\n    }\n    /** Objectives reachable from `start` over `drives` edges. */\n    const reachObjectives = (start: string): Set<string> => {\n        const seen = new Set<string>([start]);\n        const out = new Set<string>();\n        const queue = [start];\n        while (queue.length > 0) {\n            const n = queue.shift()!;\n            for (const next of drivesAdj.get(n) ?? []) {\n                if (seen.has(next)) continue;\n                seen.add(next);\n                if (kindOf(next) === 'objective') out.add(next);\n                queue.push(next);\n            }\n        }\n        return out;\n    };\n    const kpiObjectives = new Map<string, Set<string>>();\n    for (const k of ofKind('kpi')) kpiObjectives.set(k.id, reachObjectives(k.id));\n\n    // ---- Build process rows. -----------------------------------------------\n    const rowOf = (p: FlatNode): ProcessRow => {\n        const r = rel.get(p.id)!;\n        const cycle = cycleOf(p.id);\n        const rowLints: string[] = [];\n        if (r.uses.length === 0) rowLints.push('No inputs (uses)');\n        if (r.produces.length === 0) rowLints.push('No outputs (produces)');\n        if (r.kpis.length === 0) rowLints.push('No KPI');\n        if (r.decisions.length === 0) rowLints.push('No decision');\n        const { upstream, downstream } = neighborsOf(p.id);\n        return {\n            id: p.id,\n            name: p.name,\n            description: p.description,\n            stage: stageOf(p.id),\n            cyclic: cycle.length > 1,\n            cycleWith: cycle.filter(id => id !== p.id).map(id => byId.get(id)!.name).sort(),\n            upstream,\n            downstream,\n            uses: sortChips(r.uses),\n            produces: sortChips(r.produces),\n            kpis: sortChips(r.kpis),\n            data: sortChips(r.data),\n            decisions: sortChips(r.decisions),\n            policies: sortChips(r.policies),\n            agents: sortChips(r.agents),\n            alsoVia: [],\n            lints: rowLints,\n        };\n    };\n\n    // ---- Objective forest. --------------------------------------------------\n    const objectives = ofKind('objective');\n    const objectiveIds = new Set(objectives.map(o => o.id));\n    // child --drives--> parent: the child contributes to the parent, so it\n    // indents beneath it. Apexes have no outgoing drives to an objective.\n    const parentOf = new Map<string, string>();\n    for (const l of links) {\n        if (l.kind !== 'drives') continue;\n        if (!objectiveIds.has(l.source) || !objectiveIds.has(l.target)) continue;\n        if (!parentOf.has(l.source)) parentOf.set(l.source, l.target);\n    }\n\n    // Processes per objective: via KPIs (and direct drives).\n    const processObjectives = new Map<string, Set<string>>();\n    for (const p of processes) {\n        const r = rel.get(p.id)!;\n        const objs = new Set<string>(r.directObjectives);\n        for (const k of r.kpis) {\n            for (const o of kpiObjectives.get(k.id) ?? []) objs.add(o);\n        }\n        processObjectives.set(p.id, objs);\n    }\n\n    // Stage first (the global value chain); within a stage, cycle members\n    // stay contiguous (sccKey) and follow the loop walk (cycleRank).\n    const sortRows = (rows: ProcessRow[]) =>\n        rows.sort((a, b) =>\n            a.stage - b.stage\n            || (sccKey.get(a.id) ?? a.name).localeCompare(sccKey.get(b.id) ?? b.name)\n            || (cycleRank.get(a.id) ?? 0) - (cycleRank.get(b.id) ?? 0)\n            || a.name.localeCompare(b.name));\n\n    const buildGroup = (o: FlatNode, depth: number): ObjectiveGroup => {\n        const members = processes.filter(p => processObjectives.get(p.id)!.has(o.id));\n        // Partition by the first KPI connecting the process to this objective.\n        const connecting = (p: FlatNode): NodeChip[] =>\n            sortChips(rel.get(p.id)!.kpis.filter(k => (kpiObjectives.get(k.id) ?? new Set()).has(o.id)));\n        const kpiIds = sortChips(members.flatMap(connecting));\n        let sections: KpiSection[];\n        if (kpiIds.length <= 1) {\n            // No KPI tier tax for simple objectives.\n            sections = [{ kpi: kpiIds[0] ?? null, rows: sortRows(members.map(rowOf)) }];\n        } else {\n            const byKpi = new Map<string, ProcessRow[]>(kpiIds.map(k => [k.id, []]));\n            const direct: ProcessRow[] = [];\n            for (const p of members) {\n                const ks = connecting(p);\n                const row = rowOf(p);\n                if (ks.length === 0) {\n                    direct.push(row);\n                } else {\n                    row.alsoVia = ks.slice(1);\n                    byKpi.get(ks[0]!.id)!.push(row);\n                }\n            }\n            sections = kpiIds\n                .map(k => ({ kpi: k, rows: sortRows(byKpi.get(k.id)!) }))\n                .filter(s => s.rows.length > 0);\n            if (direct.length > 0) sections.push({ kpi: null, rows: sortRows(direct) });\n        }\n        const children = objectives\n            .filter(c => parentOf.get(c.id) === o.id)\n            .sort((a, b) => a.name.localeCompare(b.name))\n            .map(c => buildGroup(c, depth + 1));\n        const allRows = sections.flatMap(s => s.rows);\n        return {\n            id: o.id,\n            name: o.name,\n            description: o.description,\n            depth,\n            sections,\n            children,\n            processCount: allRows.length,\n            decisionCount: new Set(allRows.flatMap(r => r.decisions.map(d => d.id))).size,\n            lintCount: allRows.reduce((n, r) => n + r.lints.length, 0),\n        };\n    };\n\n    const apexes = objectives\n        .filter(o => !parentOf.has(o.id))\n        .sort((a, b) => a.name.localeCompare(b.name));\n    const groups = apexes.map(o => buildGroup(o, 0));\n\n    // Unassigned group — processes serving no objective. Elicitation debt,\n    // surfaced on purpose.\n    const unassigned = processes.filter(p => processObjectives.get(p.id)!.size === 0);\n    if (unassigned.length > 0) {\n        const rows = sortRows(unassigned.map(rowOf));\n        groups.push({\n            id: null,\n            name: 'Unassigned',\n            description: undefined,\n            depth: 0,\n            sections: [{ kpi: null, rows }],\n            children: [],\n            processCount: rows.length,\n            decisionCount: new Set(rows.flatMap(r => r.decisions.map(d => d.id))).size,\n            lintCount: rows.reduce((n, r) => n + r.lints.length, 0),\n        });\n    }\n\n    // ---- Graph-level lints. --------------------------------------------------\n    const attachedKpis = new Set(processes.flatMap(p => rel.get(p.id)!.kpis.map(k => k.id)));\n    for (const k of ofKind('kpi')) {\n        if (!attachedKpis.has(k.id)) lints.push(`KPI \"${k.name}\": measures nothing`);\n    }\n    const drivingDecisions = new Set<string>();\n    for (const l of links) {\n        if (kindOf(l.source) === 'decision' && (l.kind === 'drives' || l.kind === 'executes')) drivingDecisions.add(l.source);\n    }\n    for (const d of ofKind('decision')) {\n        if (!drivingDecisions.has(d.id)) lints.push(`Decision \"${d.name}\": drives nothing`);\n    }\n    const reachedObjectives = new Set<string>(\n        [...processObjectives.values()].flatMap(s => [...s]),\n    );\n    for (const o of objectives) {\n        const hasChild = objectives.some(c => parentOf.get(c.id) === o.id);\n        if (!reachedObjectives.has(o.id) && !hasChild) lints.push(`Objective \"${o.name}\": nothing drives it`);\n    }\n\n    return {\n        groups,\n        lints,\n        stageCount,\n        processCount: processes.length,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<OntologyTable>` — the Ontology editor's table view: a value-driver-tree\n * shaped projection of the bound graph (see `projection.ts`).\n *\n * Hierarchy lives in the stub column (objective groups → KPI sub-headers\n * with indentation); leaf process rows keep aligned columns so the surface\n * reads as a table, not a tree of cards. Rows order by global value-chain\n * stage; resource cycles share a stage and wear a pulsing ↺ badge.\n *\n * Interactions:\n * - hovering any chip highlights **every occurrence of that node** across\n *   the table (and tints the rows containing it) — hover \"Cash\" and the\n *   working-capital loop lights up;\n * - clicking a row expands its flow detail (fed by / feeds, with the\n *   carrying resources; cycle path; lints) with an animated reveal;\n * - clicking a chip or the expanded \"open\" affordance selects the node in\n *   the shared properties drawer.\n *\n * What a collapse hides — a row's flow detail, a group's body, the graph\n * warnings — stays mounted, so it animates open and shut, and is `inert`\n * while shut: out of the tab order, the accessibility tree and the pointer's\n * way (#1270). Each such region says which it is (`data-ontology-collapse`)\n * and whether it is open (`data-open`).\n *\n * Styling rides the shared theme: `table` slot recipe for the grid chrome,\n * kind accents from `accents.ts`, and the `spec-pulse-live` keyframe for\n * cycle badges.\n *\n * @packageDocumentation\n */\n\nimport { Fragment, memo, useEffect, useMemo, useState } from 'react';\nimport { Box, HStack, Portal, Text, Tooltip, VStack, chakra, useSlotRecipe } from '@chakra-ui/react';\nimport { faArrowDown, faArrowUp, faArrowsRotate, faChevronDown, faTriangleExclamation } from '@fortawesome/free-solid-svg-icons';\n\nimport { NODE_KIND_ACCENT } from './accents.js';\nimport { OntologyMark } from './mark.js';\nimport type { Ontology as OntologyValue } from './types.js';\nimport {\n    projectTable,\n    type KpiSection,\n    type NodeChip,\n    type ObjectiveGroup,\n    type ProcessRow,\n} from './projection.js';\n\n// ============================================================================\n// Shared bits.\n// ============================================================================\n\ninterface HoverState {\n    hovered: string | null;\n    setHovered: (id: string | null) => void;\n}\n\n/** Themed hover tip (the shared `tooltip` slot recipe), matrix-style. */\nfunction Tip({ label, children }: { label: React.ReactNode; children: React.ReactElement }) {\n    return (\n        <Tooltip.Root openDelay={150} closeDelay={60}>\n            <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>\n            <Portal>\n                <Tooltip.Positioner>\n                    <Tooltip.Content>{label}</Tooltip.Content>\n                </Tooltip.Positioner>\n            </Portal>\n        </Tooltip.Root>\n    );\n}\n\ninterface ChipProps extends HoverState {\n    chip: NodeChip;\n    emphasized?: boolean;\n    onSelect: (id: string) => void;\n}\n\n/** A node chip — kind-accent dot + name. Hovering one highlights every chip\n *  with the same node id across the table; everything else dims. */\nfunction Chip({ chip, emphasized = false, hovered, setHovered, onSelect }: ChipProps) {\n    const active = hovered === chip.id;\n    const dimmed = hovered !== null && !active;\n    const accent = NODE_KIND_ACCENT[chip.kind];\n    return (\n        <Tip label={`${chip.kind} · ${chip.name}`}>\n        <chakra.button\n            type=\"button\"\n            display=\"inline-flex\"\n            alignItems=\"flex-start\"\n            gap=\"1.5\"\n            px=\"1.5\"\n            py=\"0.5\"\n            borderRadius=\"sm\"\n            border=\"1px solid\"\n            borderColor={active ? accent : emphasized ? 'border.strong' : 'border.subtle'}\n            bg={active || emphasized ? 'bg.brand.subtle' : 'bg.surface'}\n            opacity={dimmed ? 0.4 : 1}\n            transform={active ? 'translateY(-1px)' : 'none'}\n            boxShadow={active ? 'sm' : 'none'}\n            transition=\"opacity 140ms ease, transform 140ms ease, border-color 140ms ease, background 140ms ease\"\n            fontSize=\"body.sm\"\n            color=\"fg\"\n            cursor=\"pointer\"\n            onMouseEnter={() => setHovered(chip.id)}\n            onMouseLeave={() => setHovered(null)}\n            onClick={(e: React.MouseEvent) => { e.stopPropagation(); onSelect(chip.id); }}\n        >\n            <Box w=\"6px\" h=\"6px\" borderRadius=\"full\" bg={accent} flexShrink={0} mt=\"1\" alignSelf=\"flex-start\" />\n            <Box as=\"span\" textAlign=\"left\" lineHeight=\"short\">\n                {chip.name}\n            </Box>\n        </chakra.button>\n        </Tip>\n    );\n}\n\nfunction ChipCell({ chips, emphasized, hovered, setHovered, onSelect }: {\n    chips: NodeChip[];\n    emphasized?: boolean;\n} & HoverState & { onSelect: (id: string) => void }) {\n    if (chips.length === 0) {\n        return <Text as=\"span\" fontFamily=\"mono\" fontSize=\"label.sm\" color=\"fg.subtle\">—</Text>;\n    }\n    return (\n        <HStack gap=\"1\" flexWrap=\"wrap\">\n            {chips.map(c => (\n                <Chip key={c.id} chip={c} emphasized={emphasized ?? false}\n                      hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n            ))}\n        </HStack>\n    );\n}\n\n/** Does this row mention the hovered node anywhere? Drives the row tint. */\nfunction rowMentions(row: ProcessRow, id: string | null): boolean {\n    if (id === null) return false;\n    if (row.id === id) return true;\n    return [row.uses, row.produces, row.kpis, row.data, row.decisions, row.policies, row.agents, row.alsoVia]\n        .some(chips => chips.some(c => c.id === id));\n}\n\n// ============================================================================\n// Rows.\n// ============================================================================\n\nconst COLUMNS = ['Stage', 'Process', 'Uses', 'Produces', 'KPIs', 'Data', 'Decisions', 'Policies', ''] as const;\nconst COL_WIDTHS = ['44px', '22%', '14%', '14%', '12%', '9%', '15%', '9%', '28px'] as const;\n\ninterface RowCtx extends HoverState {\n    onSelect: (id: string) => void;\n    expanded: Set<string>;\n    toggleExpanded: (id: string) => void;\n    mounted: boolean;\n    cellCss: object;\n}\n\nfunction FlowList({ label, icon, neighbors, hovered, setHovered, onSelect }: {\n    label: string;\n    icon: React.ReactNode;\n    neighbors: ProcessRow['upstream'];\n} & HoverState & { onSelect: (id: string) => void }) {\n    return (\n        <VStack alignItems=\"stretch\" gap=\"1\" minW=\"0\">\n            <HStack gap=\"1\" color=\"fg.subtle\">\n                {icon}\n                <Text fontFamily=\"mono\" fontSize=\"label.sm\" fontWeight=\"semibold\" letterSpacing=\"wider\" textTransform=\"uppercase\">\n                    {label}\n                </Text>\n            </HStack>\n            {neighbors.length === 0 ? (\n                <Text fontFamily=\"mono\" fontSize=\"label.sm\" color=\"fg.subtle\">none</Text>\n            ) : neighbors.map(n => (\n                <HStack key={n.id} gap=\"1.5\" flexWrap=\"wrap\">\n                    <Chip chip={{ id: n.id, name: n.name, kind: 'process' }}\n                          hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n                    <Text fontSize=\"label.sm\" color=\"fg.muted\">via {n.via.join(', ')}</Text>\n                </HStack>\n            ))}\n        </VStack>\n    );\n}\n\nconst ProcessRowView = memo(function ProcessRowView({ row, index, ctx }: {\n    row: ProcessRow;\n    index: number;\n    ctx: RowCtx;\n}) {\n    const { hovered, setHovered, onSelect, expanded, toggleExpanded, mounted, cellCss } = ctx;\n    const isExpanded = expanded.has(row.id);\n    const tinted = rowMentions(row, hovered);\n    const delay = Math.min(index, 12) * 18;\n    // Zebra keeps adjacent leaf rows distinguishable in dense groups; the\n    // expanded row and its detail panel share one surface so they read as\n    // a single attached unit.\n    const zebra = index % 2 === 1;\n    const rowCellCss = isExpanded ? { ...cellCss, borderBottom: 'none' } : cellCss;\n\n    return (\n        <Fragment>\n            <Box\n                as=\"tr\"\n                cursor=\"pointer\"\n                bg={isExpanded || zebra ? 'bg.panel' : 'transparent'}\n                // Highlight via the spec table's selected treatment — a full\n                // 2px inset ring — never a background tint behind row text.\n                boxShadow={tinted ? 'inset 0 0 0 2px var(--chakra-colors-brand-solid)' : 'none'}\n                opacity={mounted ? 1 : 0}\n                transform={mounted ? 'none' : 'translateY(6px)'}\n                style={{ transition: `opacity 220ms ease ${delay}ms, transform 220ms ease ${delay}ms, box-shadow 140ms ease` }}\n                _hover={{ boxShadow: 'inset 0 0 0 1px var(--chakra-colors-border-strong)' }}\n                onClick={() => toggleExpanded(row.id)}\n            >\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\">\n                    <HStack gap=\"1\">\n                        <Text fontFamily=\"mono\" fontSize=\"label.sm\" fontWeight=\"bold\" color=\"fg.muted\">\n                            S{row.stage}\n                        </Text>\n                        {row.cyclic && (\n                            <Tip label={`Resource cycle: ${[row.name, ...row.cycleWith].join(' → ')} → ${row.name}`}>\n                                <Box color=\"brand.fg\" display=\"inline-flex\">\n                                    <OntologyMark icon={faArrowsRotate} size=\"11\" />\n                                </Box>\n                            </Tip>\n                        )}\n                    </HStack>\n                </Box>\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\">\n                    <VStack alignItems=\"stretch\" gap=\"0.5\" minW=\"0\">\n                        <HStack gap=\"1.5\" alignItems=\"flex-start\">\n                            <Box\n                                w=\"7px\" h=\"7px\" borderRadius=\"full\" flexShrink={0} mt=\"1.5\"\n                                bg={NODE_KIND_ACCENT.process}\n                                boxShadow={hovered === row.id ? `0 0 0 3px ${NODE_KIND_ACCENT.process}33` : 'none'}\n                                transition=\"box-shadow 140ms ease\"\n                            />\n                            <Text fontSize=\"body.lg\" fontWeight=\"semibold\" color=\"fg\" lineHeight=\"tight\">\n                                {row.name}\n                            </Text>\n                            <Box\n                                color=\"fg.subtle\"\n                                marginLeft=\"auto\"\n                                mt=\"1\"\n                                transform={isExpanded ? 'rotate(180deg)' : 'none'}\n                                transition=\"transform 180ms ease\"\n                                display=\"inline-flex\"\n                                flexShrink={0}\n                            >\n                                <OntologyMark icon={faChevronDown} size=\"12\" />\n                            </Box>\n                        </HStack>\n                        {row.agents.length > 0 && (\n                            <HStack gap=\"1\" flexWrap=\"wrap\">\n                                {row.agents.map(a => (\n                                    <Chip key={a.id} chip={a} hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n                                ))}\n                            </HStack>\n                        )}\n                        {row.description && (\n                            <Text fontSize=\"body.sm\" color=\"fg.muted\" lineHeight=\"snug\"\n                                  overflow=\"hidden\" textOverflow=\"ellipsis\" whiteSpace=\"nowrap\">\n                                {row.description}\n                            </Text>\n                        )}\n                    </VStack>\n                </Box>\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\">\n                    <ChipCell chips={row.uses} hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n                </Box>\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\">\n                    <ChipCell chips={row.produces} hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n                </Box>\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\">\n                    <VStack alignItems=\"stretch\" gap=\"1\">\n                        <ChipCell chips={row.kpis} hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n                        {row.alsoVia.length > 0 && (\n                            <Text fontSize=\"label.sm\" color=\"fg.subtle\">\n                                also via {row.alsoVia.map(k => k.name).join(', ')}\n                            </Text>\n                        )}\n                    </VStack>\n                </Box>\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\">\n                    <ChipCell chips={row.data} hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n                </Box>\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\">\n                    <ChipCell chips={row.decisions} emphasized hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n                </Box>\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\">\n                    <ChipCell chips={row.policies} hovered={hovered} setHovered={setHovered} onSelect={onSelect} />\n                </Box>\n                <Box as=\"td\" css={rowCellCss} verticalAlign=\"top\" textAlign=\"right\">\n                    {row.lints.length > 0 && (\n                        <Tip label={<VStack alignItems=\"stretch\" gap=\"0.5\">{row.lints.map(l => <Text key={l} fontSize=\"body.sm\">{l}</Text>)}</VStack>}>\n                            <Box as=\"span\" display=\"inline-flex\" color=\"status.warn\">\n                                <OntologyMark icon={faTriangleExclamation} size=\"13\" />\n                            </Box>\n                        </Tip>\n                    )}\n                </Box>\n            </Box>\n            {/* Expanded flow detail — animated reveal, visually attached to its\n                row: shared surface, no separator above, strong closing rule. */}\n            <Box as=\"tr\">\n                <chakra.td colSpan={COLUMNS.length} p=\"0\" border=\"none\">\n                    <Box\n                        display=\"grid\"\n                        gridTemplateRows={isExpanded ? '1fr' : '0fr'}\n                        transition=\"grid-template-rows 220ms ease\"\n                    >\n                        <Box overflow=\"hidden\" minH=\"0\" inert={!isExpanded}\n                            data-ontology-collapse=\"detail\" data-open={isExpanded ? '' : undefined}>\n                            <Box\n                                px=\"4\" py=\"3\"\n                                bg=\"bg.panel\"\n                                borderBottom=\"2px solid\"\n                                borderBottomColor=\"border.strong\"\n                            >\n                                <Box\n                                    display=\"grid\"\n                                    gridTemplateColumns=\"repeat(auto-fit, minmax(240px, 1fr))\"\n                                    gap=\"5\"\n                                    alignItems=\"start\"\n                                >\n                                    <FlowList\n                                        label=\"Upstream\"\n                                        icon={<OntologyMark icon={faArrowUp} size=\"11\" />}\n                                        neighbors={row.upstream}\n                                        hovered={hovered} setHovered={setHovered} onSelect={onSelect}\n                                    />\n                                    <FlowList\n                                        label=\"Downstream\"\n                                        icon={<OntologyMark icon={faArrowDown} size=\"11\" />}\n                                        neighbors={row.downstream}\n                                        hovered={hovered} setHovered={setHovered} onSelect={onSelect}\n                                    />\n                                    {row.cyclic && (\n                                        <VStack alignItems=\"stretch\" gap=\"1\">\n                                            <HStack gap=\"1\" color=\"brand.fg\">\n                                                <OntologyMark icon={faArrowsRotate} size=\"11\" />\n                                                <Text fontFamily=\"mono\" fontSize=\"label.sm\" fontWeight=\"semibold\" letterSpacing=\"wider\" textTransform=\"uppercase\">\n                                                    Cycle\n                                                </Text>\n                                            </HStack>\n                                            <Text fontSize=\"body.sm\" color=\"fg.muted\">\n                                                {[row.name, ...row.cycleWith].join(' → ')} → {row.name}\n                                            </Text>\n                                        </VStack>\n                                    )}\n                                    {row.lints.length > 0 && (\n                                        <VStack alignItems=\"stretch\" gap=\"1\">\n                                            <HStack gap=\"1\" color=\"fg.warning\">\n                                                <OntologyMark icon={faTriangleExclamation} size=\"11\" />\n                                                <Text fontFamily=\"mono\" fontSize=\"label.sm\" fontWeight=\"semibold\" letterSpacing=\"wider\" textTransform=\"uppercase\">\n                                                    Warnings\n                                                </Text>\n                                            </HStack>\n                                            {row.lints.map(l => (\n                                                <Text key={l} fontSize=\"body.sm\" color=\"fg.muted\">{l}</Text>\n                                            ))}\n                                        </VStack>\n                                    )}\n                                </Box>\n                                <HStack mt=\"2.5\" justify=\"flex-end\">\n                                    <chakra.button\n                                        type=\"button\"\n                                        fontFamily=\"mono\"\n                                        fontSize=\"label.sm\"\n                                        letterSpacing=\"wider\"\n                                        textTransform=\"uppercase\"\n                                        color=\"brand.fg\"\n                                        cursor=\"pointer\"\n                                        _hover={{ textDecoration: 'underline' }}\n                                        onClick={(e: React.MouseEvent) => { e.stopPropagation(); onSelect(row.id); }}\n                                    >\n                                        Open properties →\n                                    </chakra.button>\n                                </HStack>\n                            </Box>\n                        </Box>\n                    </Box>\n                </chakra.td>\n            </Box>\n        </Fragment>\n    );\n});\n\n// ============================================================================\n// Groups.\n// ============================================================================\n\nfunction SectionRows({ section, ctx, startIndex }: { section: KpiSection; ctx: RowCtx; startIndex: number }) {\n    return (\n        <Fragment>\n            {section.kpi && (\n                <Box as=\"tr\" bg=\"bg.panel\">\n                    <chakra.td colSpan={COLUMNS.length} px=\"4\" py=\"1.5\"\n                         borderBottom=\"1px solid\" borderColor=\"border.subtle\">\n                        <HStack gap=\"2\" pl=\"4\">\n                            <Box w=\"6px\" h=\"6px\" borderRadius=\"full\" bg={NODE_KIND_ACCENT.kpi} />\n                            <Text fontFamily=\"mono\" fontSize=\"label.sm\" fontWeight=\"semibold\"\n                                  letterSpacing=\"wider\" textTransform=\"uppercase\" color=\"fg.muted\">\n                                via\n                            </Text>\n                            <Chip chip={section.kpi} hovered={ctx.hovered} setHovered={ctx.setHovered} onSelect={ctx.onSelect} />\n                        </HStack>\n                    </chakra.td>\n                </Box>\n            )}\n            {section.rows.map((row, i) => (\n                <ProcessRowView key={row.id} row={row} index={startIndex + i} ctx={ctx} />\n            ))}\n        </Fragment>\n    );\n}\n\nfunction GroupSection({ group, ctx, collapsed, toggleCollapsed, headerCss, columnHeaderCss }: {\n    group: ObjectiveGroup;\n    ctx: RowCtx;\n    collapsed: Set<string>;\n    toggleCollapsed: (key: string) => void;\n    headerCss: object;\n    columnHeaderCss: object;\n}) {\n    const key = group.id ?? '∅';\n    const isCollapsed = collapsed.has(key);\n    const indent = group.depth * 5;\n    let rowIndex = 0;\n\n    return (\n        <Box>\n            {/* Objective header — collapsible tier of the driver tree. */}\n            <HStack\n                px=\"4\" py=\"2.5\"\n                style={{ paddingLeft: `calc(${indent * 4}px + var(--chakra-spacing-4))` }}\n                gap=\"2.5\"\n                borderBottom=\"1px solid\"\n                borderColor=\"border.subtle\"\n                bg=\"bg.panel\"\n                cursor=\"pointer\"\n                userSelect=\"none\"\n                transition=\"background 140ms ease\"\n                _hover={{ bg: 'bg.brand.subtle' }}\n                onClick={() => toggleCollapsed(key)}\n            >\n                <Box\n                    color=\"fg.subtle\"\n                    transform={isCollapsed ? 'rotate(-90deg)' : 'none'}\n                    transition=\"transform 180ms ease\"\n                    display=\"inline-flex\"\n                >\n                    <OntologyMark icon={faChevronDown} size=\"14\" />\n                </Box>\n                <Box w=\"8px\" h=\"8px\" borderRadius=\"full\"\n                     bg={group.id === null ? 'border.strong' : NODE_KIND_ACCENT.objective} flexShrink={0} />\n                <Text fontSize=\"body.lg\" fontWeight=\"semibold\" color=\"fg\">{group.name}</Text>\n                <Text fontFamily=\"mono\" fontSize=\"label.sm\" letterSpacing=\"wider\" color=\"fg.muted\" textTransform=\"uppercase\">\n                    {group.processCount} processes · {group.decisionCount} decisions\n                </Text>\n                {group.lintCount > 0 && (\n                    <Tip label={`${group.lintCount} completeness warnings in this group`}>\n                        <HStack gap=\"1\" color=\"fg.warning\">\n                            <OntologyMark icon={faTriangleExclamation} size=\"12\" />\n                            <Text fontFamily=\"mono\" fontSize=\"label.sm\" fontWeight=\"bold\">{group.lintCount}</Text>\n                        </HStack>\n                    </Tip>\n                )}\n                {group.description && (\n                    <Text fontSize=\"body.sm\" color=\"fg.subtle\" overflow=\"hidden\" textOverflow=\"ellipsis\" whiteSpace=\"nowrap\">\n                        {group.description}\n                    </Text>\n                )}\n            </HStack>\n\n            {/* Animated collapse of the group's body. */}\n            <Box display=\"grid\" gridTemplateRows={isCollapsed ? '0fr' : '1fr'} transition=\"grid-template-rows 220ms ease\">\n                <Box overflow=\"hidden\" minH=\"0\" inert={isCollapsed}\n                    data-ontology-collapse=\"group\" data-open={isCollapsed ? undefined : ''}>\n                    {group.sections.length > 0 && group.processCount > 0 && (\n                        <chakra.table css={headerCss} style={{ tableLayout: 'fixed' }}>\n                            <Box as=\"colgroup\">\n                                {COL_WIDTHS.map((w, i) => <Box as=\"col\" key={i} style={{ width: w }} />)}\n                            </Box>\n                            <Box as=\"thead\">\n                                <Box as=\"tr\">\n                                    {COLUMNS.map(c => (\n                                        <Box as=\"th\" key={c} css={columnHeaderCss} textAlign=\"left\" px=\"3\" py=\"1.5\">\n                                            {c}\n                                        </Box>\n                                    ))}\n                                </Box>\n                            </Box>\n                            <Box as=\"tbody\">\n                                {group.sections.map((s, si) => {\n                                    const start = rowIndex;\n                                    rowIndex += s.rows.length;\n                                    return <SectionRows key={s.kpi?.id ?? `direct-${si}`} section={s} ctx={ctx} startIndex={start} />;\n                                })}\n                            </Box>\n                        </chakra.table>\n                    )}\n                    {group.children.map(child => (\n                        <GroupSection\n                            key={child.id ?? '∅'}\n                            group={child}\n                            ctx={ctx}\n                            collapsed={collapsed}\n                            toggleCollapsed={toggleCollapsed}\n                            headerCss={headerCss}\n                            columnHeaderCss={columnHeaderCss}\n                        />\n                    ))}\n                </Box>\n            </Box>\n        </Box>\n    );\n}\n\n// ============================================================================\n// The table view.\n// ============================================================================\n\nexport interface OntologyTableProps {\n    ontology: OntologyValue;\n    /** Open a node in the shared properties drawer. */\n    onSelectNode: (id: string) => void;\n}\n\nexport const OntologyTable = memo(function OntologyTable({ ontology, onSelectNode }: OntologyTableProps) {\n    const projection = useMemo(() => projectTable(ontology), [ontology]);\n    const tableRecipe = useSlotRecipe({ key: 'table' });\n    const styles = useMemo(() => tableRecipe({}), [tableRecipe]);\n\n    const [hovered, setHovered] = useState<string | null>(null);\n    const [expanded, setExpanded] = useState<Set<string>>(new Set());\n    const [collapsed, setCollapsed] = useState<Set<string>>(new Set());\n    const [showLints, setShowLints] = useState(false);\n\n    // Entry animation — rows stagger in on first mount of the view.\n    const [mounted, setMounted] = useState(false);\n    useEffect(() => {\n        const raf = requestAnimationFrame(() => setMounted(true));\n        return () => cancelAnimationFrame(raf);\n    }, []);\n\n    const ctx: RowCtx = useMemo(() => ({\n        hovered,\n        setHovered,\n        onSelect: onSelectNode,\n        expanded,\n        toggleExpanded: (id: string) => setExpanded(prev => {\n            const next = new Set(prev);\n            if (next.has(id)) next.delete(id); else next.add(id);\n            return next;\n        }),\n        mounted,\n        cellCss: { ...(styles.cell as object), paddingLeft: '12px', paddingRight: '12px', paddingTop: '8px', paddingBottom: '8px', borderBottom: '1px solid var(--chakra-colors-border-subtle)' },\n    }), [hovered, onSelectNode, expanded, mounted, styles.cell]);\n\n    const toggleCollapsed = (key: string) => setCollapsed(prev => {\n        const next = new Set(prev);\n        if (next.has(key)) next.delete(key); else next.add(key);\n        return next;\n    });\n\n    if (projection.processCount === 0) {\n        return (\n            <Box p=\"9\" textAlign=\"center\">\n                <Text fontFamily=\"mono\" fontSize=\"body.lg\" color=\"fg.subtle\">\n                    No process nodes yet — add processes in the graph view to populate the table.\n                </Text>\n            </Box>\n        );\n    }\n\n    return (\n        <Box h=\"100%\" overflowY=\"auto\" bg=\"bg.surface\" fontFeatureSettings='\"tnum\"'>\n            {/* Graph-level lints — collapsed to a slim banner. */}\n            {projection.lints.length > 0 && (\n                <Box\n                    px=\"4\" py=\"1.5\"\n                    borderBottom=\"1px solid\" borderColor=\"border.subtle\"\n                    bg=\"bg.panel\"\n                    cursor=\"pointer\"\n                    onClick={() => setShowLints(v => !v)}\n                >\n                    <HStack gap=\"1.5\" color=\"fg.warning\">\n                        <OntologyMark icon={faTriangleExclamation} size=\"12\" />\n                        <Text fontFamily=\"mono\" fontSize=\"label.sm\" fontWeight=\"semibold\" letterSpacing=\"wider\" textTransform=\"uppercase\">\n                            {projection.lints.length} graph warnings\n                        </Text>\n                        <Box transform={showLints ? 'rotate(180deg)' : 'none'} transition=\"transform 180ms ease\" display=\"inline-flex\">\n                            <OntologyMark icon={faChevronDown} size=\"11\" />\n                        </Box>\n                    </HStack>\n                    <Box display=\"grid\" gridTemplateRows={showLints ? '1fr' : '0fr'} transition=\"grid-template-rows 200ms ease\">\n                        <Box overflow=\"hidden\" minH=\"0\" inert={!showLints}\n                            data-ontology-collapse=\"lints\" data-open={showLints ? '' : undefined}>\n                            <VStack alignItems=\"stretch\" gap=\"0.5\" pt=\"1.5\">\n                                {projection.lints.map(l => (\n                                    <Text key={l} fontSize=\"body.sm\" color=\"fg.muted\">{l}</Text>\n                                ))}\n                            </VStack>\n                        </Box>\n                    </Box>\n                </Box>\n            )}\n\n            {projection.groups.map(group => (\n                <GroupSection\n                    key={group.id ?? '∅'}\n                    group={group}\n                    ctx={ctx}\n                    collapsed={collapsed}\n                    toggleCollapsed={toggleCollapsed}\n                    headerCss={styles.root as object}\n                    columnHeaderCss={styles.columnHeader as object}\n                />\n            ))}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2016-2026, The Cytoscape Consortium.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the “Software”), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do\n * so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nfunction _arrayLikeToArray(r, a) {\n  (null == a || a > r.length) && (a = r.length);\n  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n  return n;\n}\nfunction _arrayWithHoles(r) {\n  if (Array.isArray(r)) return r;\n}\nfunction _arrayWithoutHoles(r) {\n  if (Array.isArray(r)) return _arrayLikeToArray(r);\n}\nfunction _classCallCheck(a, n) {\n  if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(e, r) {\n  for (var t = 0; t < r.length; t++) {\n    var o = r[t];\n    o.enumerable = o.enumerable || false, o.configurable = true, \"value\" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);\n  }\n}\nfunction _createClass(e, r, t) {\n  return r && _defineProperties(e.prototype, r), Object.defineProperty(e, \"prototype\", {\n    writable: false\n  }), e;\n}\nfunction _createForOfIteratorHelper(r, e) {\n  var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n  if (!t) {\n    if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {\n      t && (r = t);\n      var n = 0,\n        F = function () {};\n      return {\n        s: F,\n        n: function () {\n          return n >= r.length ? {\n            done: true\n          } : {\n            done: false,\n            value: r[n++]\n          };\n        },\n        e: function (r) {\n          throw r;\n        },\n        f: F\n      };\n    }\n    throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n  }\n  var o,\n    a = true,\n    u = false;\n  return {\n    s: function () {\n      t = t.call(r);\n    },\n    n: function () {\n      var r = t.next();\n      return a = r.done, r;\n    },\n    e: function (r) {\n      u = true, o = r;\n    },\n    f: function () {\n      try {\n        a || null == t.return || t.return();\n      } finally {\n        if (u) throw o;\n      }\n    }\n  };\n}\nfunction _defineProperty$1(e, r, t) {\n  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n    value: t,\n    enumerable: true,\n    configurable: true,\n    writable: true\n  }) : e[r] = t, e;\n}\nfunction _iterableToArray(r) {\n  if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nfunction _iterableToArrayLimit(r, l) {\n  var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n  if (null != t) {\n    var e,\n      n,\n      i,\n      u,\n      a = [],\n      f = true,\n      o = false;\n    try {\n      if (i = (t = t.call(r)).next, 0 === l) {\n        if (Object(t) !== t) return;\n        f = !1;\n      } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n    } catch (r) {\n      o = true, n = r;\n    } finally {\n      try {\n        if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n      } finally {\n        if (o) throw n;\n      }\n    }\n    return a;\n  }\n}\nfunction _nonIterableRest() {\n  throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _nonIterableSpread() {\n  throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _slicedToArray(r, e) {\n  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _toConsumableArray(r) {\n  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();\n}\nfunction _toPrimitive(t, r) {\n  if (\"object\" != typeof t || !t) return t;\n  var e = t[Symbol.toPrimitive];\n  if (undefined !== e) {\n    var i = e.call(t, r);\n    if (\"object\" != typeof i) return i;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (String )(t);\n}\nfunction _toPropertyKey(t) {\n  var i = _toPrimitive(t, \"string\");\n  return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _typeof(o) {\n  \"@babel/helpers - typeof\";\n\n  return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n    return typeof o;\n  } : function (o) {\n    return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n  }, _typeof(o);\n}\nfunction _unsupportedIterableToArray(r, a) {\n  if (r) {\n    if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n    var t = {}.toString.call(r).slice(8, -1);\n    return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;\n  }\n}\n\nvar _window = typeof window === 'undefined' ? null : window; // eslint-disable-line no-undef\n\nvar navigator = _window ? _window.navigator : null;\n_window ? _window.document : null;\nvar typeofstr = _typeof('');\nvar typeofobj = _typeof({});\nvar typeoffn = _typeof(function () {});\nvar typeofhtmlele = typeof HTMLElement === \"undefined\" ? \"undefined\" : _typeof(HTMLElement);\nvar instanceStr = function instanceStr(obj) {\n  return obj && obj.instanceString && fn$6(obj.instanceString) ? obj.instanceString() : null;\n};\n\nvar string = function string(obj) {\n  return obj != null && _typeof(obj) == typeofstr;\n};\nvar fn$6 = function fn(obj) {\n  return obj != null && _typeof(obj) === typeoffn;\n};\nvar array = function array(obj) {\n  return !elementOrCollection(obj) && (Array.isArray ? Array.isArray(obj) : obj != null && obj instanceof Array);\n};\nvar plainObject = function plainObject(obj) {\n  return obj != null && _typeof(obj) === typeofobj && !array(obj) && obj.constructor === Object;\n};\nvar object = function object(obj) {\n  return obj != null && _typeof(obj) === typeofobj;\n};\nvar number$1 = function number(obj) {\n  return obj != null && _typeof(obj) === _typeof(1) && !isNaN(obj);\n};\nvar integer = function integer(obj) {\n  return number$1(obj) && Math.floor(obj) === obj;\n};\nvar htmlElement = function htmlElement(obj) {\n  if ('undefined' === typeofhtmlele) {\n    return undefined;\n  } else {\n    return null != obj && obj instanceof HTMLElement;\n  }\n};\nvar elementOrCollection = function elementOrCollection(obj) {\n  return element(obj) || collection(obj);\n};\nvar element = function element(obj) {\n  return instanceStr(obj) === 'collection' && obj._private.single;\n};\nvar collection = function collection(obj) {\n  return instanceStr(obj) === 'collection' && !obj._private.single;\n};\nvar core = function core(obj) {\n  return instanceStr(obj) === 'core';\n};\nvar stylesheet = function stylesheet(obj) {\n  return instanceStr(obj) === 'stylesheet';\n};\nvar event = function event(obj) {\n  return instanceStr(obj) === 'event';\n};\nvar emptyString = function emptyString(obj) {\n  if (obj === undefined || obj === null) {\n    // null is empty\n    return true;\n  } else if (obj === '' || obj.match(/^\\s+$/)) {\n    return true; // empty string is empty\n  }\n  return false; // otherwise, we don't know what we've got\n};\nvar domElement = function domElement(obj) {\n  if (typeof HTMLElement === 'undefined') {\n    return false; // we're not in a browser so it doesn't matter\n  } else {\n    return obj instanceof HTMLElement;\n  }\n};\nvar boundingBox = function boundingBox(obj) {\n  return plainObject(obj) && number$1(obj.x1) && number$1(obj.x2) && number$1(obj.y1) && number$1(obj.y2);\n};\nvar promise = function promise(obj) {\n  return object(obj) && fn$6(obj.then);\n};\nvar ms = function ms() {\n  return navigator && navigator.userAgent.match(/msie|trident|edge/i);\n}; // probably a better way to detect this...\n\nvar memoize = function memoize(fn, keyFn) {\n  if (!keyFn) {\n    keyFn = function keyFn() {\n      if (arguments.length === 1) {\n        return arguments[0];\n      } else if (arguments.length === 0) {\n        return 'undefined';\n      }\n      var args = [];\n      for (var i = 0; i < arguments.length; i++) {\n        args.push(arguments[i]);\n      }\n      return args.join('$');\n    };\n  }\n  var _memoizedFn = function memoizedFn() {\n    var self = this;\n    var args = arguments;\n    var ret;\n    var k = keyFn.apply(self, args);\n    var cache = _memoizedFn.cache;\n    if (!(ret = cache[k])) {\n      ret = cache[k] = fn.apply(self, args);\n    }\n    return ret;\n  };\n  _memoizedFn.cache = {};\n  return _memoizedFn;\n};\n\nvar camel2dash = memoize(function (str) {\n  return str.replace(/([A-Z])/g, function (v) {\n    return '-' + v.toLowerCase();\n  });\n});\nvar dash2camel = memoize(function (str) {\n  return str.replace(/(-\\w)/g, function (v) {\n    return v[1].toUpperCase();\n  });\n});\nvar prependCamel = memoize(function (prefix, str) {\n  return prefix + str[0].toUpperCase() + str.substring(1);\n}, function (prefix, str) {\n  return prefix + '$' + str;\n});\nvar capitalize = function capitalize(str) {\n  if (emptyString(str)) {\n    return str;\n  }\n  return str.charAt(0).toUpperCase() + str.substring(1);\n};\nvar endsWith = function endsWith(string, suffix) {\n  return string.slice(-1 * suffix.length) === suffix;\n};\n\nvar number = '(?:[-+]?(?:(?:\\\\d+|\\\\d*\\\\.\\\\d+)(?:[Ee][+-]?\\\\d+)?))';\nvar rgba = 'rgb[a]?\\\\((' + number + '[%]?)\\\\s*,\\\\s*(' + number + '[%]?)\\\\s*,\\\\s*(' + number + '[%]?)(?:\\\\s*,\\\\s*(' + number + '))?\\\\)';\nvar rgbaNoBackRefs = 'rgb[a]?\\\\((?:' + number + '[%]?)\\\\s*,\\\\s*(?:' + number + '[%]?)\\\\s*,\\\\s*(?:' + number + '[%]?)(?:\\\\s*,\\\\s*(?:' + number + '))?\\\\)';\nvar hsla = 'hsl[a]?\\\\((' + number + ')\\\\s*,\\\\s*(' + number + '[%])\\\\s*,\\\\s*(' + number + '[%])(?:\\\\s*,\\\\s*(' + number + '))?\\\\)';\nvar hslaNoBackRefs = 'hsl[a]?\\\\((?:' + number + ')\\\\s*,\\\\s*(?:' + number + '[%])\\\\s*,\\\\s*(?:' + number + '[%])(?:\\\\s*,\\\\s*(?:' + number + '))?\\\\)';\nvar hex3 = '\\\\#[0-9a-fA-F]{3}';\nvar hex6 = '\\\\#[0-9a-fA-F]{6}';\n\nvar ascending = function ascending(a, b) {\n  if (a < b) {\n    return -1;\n  } else if (a > b) {\n    return 1;\n  } else {\n    return 0;\n  }\n};\nvar descending = function descending(a, b) {\n  return -1 * ascending(a, b);\n};\n\nvar extend = Object.assign != null ? Object.assign.bind(Object) : function (tgt) {\n  var args = arguments;\n  for (var i = 1; i < args.length; i++) {\n    var obj = args[i];\n    if (obj == null) {\n      continue;\n    }\n    var keys = Object.keys(obj);\n    for (var j = 0; j < keys.length; j++) {\n      var k = keys[j];\n      tgt[k] = obj[k];\n    }\n  }\n  return tgt;\n};\n\n// get [r, g, b] from #abc or #aabbcc\nvar hex2tuple = function hex2tuple(hex) {\n  if (!(hex.length === 4 || hex.length === 7) || hex[0] !== '#') {\n    return;\n  }\n  var shortHex = hex.length === 4;\n  var r, g, b;\n  var base = 16;\n  if (shortHex) {\n    r = parseInt(hex[1] + hex[1], base);\n    g = parseInt(hex[2] + hex[2], base);\n    b = parseInt(hex[3] + hex[3], base);\n  } else {\n    r = parseInt(hex[1] + hex[2], base);\n    g = parseInt(hex[3] + hex[4], base);\n    b = parseInt(hex[5] + hex[6], base);\n  }\n  return [r, g, b];\n};\n\n// get [r, g, b, a] from hsl(0, 0, 0) or hsla(0, 0, 0, 0)\nvar hsl2tuple = function hsl2tuple(hsl) {\n  var ret;\n  var h, s, l, a, r, g, b;\n  function hue2rgb(p, q, t) {\n    if (t < 0) t += 1;\n    if (t > 1) t -= 1;\n    if (t < 1 / 6) return p + (q - p) * 6 * t;\n    if (t < 1 / 2) return q;\n    if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n    return p;\n  }\n  var m = new RegExp('^' + hsla + '$').exec(hsl);\n  if (m) {\n    // get hue\n    h = parseInt(m[1]);\n    if (h < 0) {\n      h = (360 - -1 * h % 360) % 360;\n    } else if (h > 360) {\n      h = h % 360;\n    }\n    h /= 360; // normalise on [0, 1]\n\n    s = parseFloat(m[2]);\n    if (s < 0 || s > 100) {\n      return;\n    } // saturation is [0, 100]\n    s = s / 100; // normalise on [0, 1]\n\n    l = parseFloat(m[3]);\n    if (l < 0 || l > 100) {\n      return;\n    } // lightness is [0, 100]\n    l = l / 100; // normalise on [0, 1]\n\n    a = m[4];\n    if (a !== undefined) {\n      a = parseFloat(a);\n      if (a < 0 || a > 1) {\n        return;\n      } // alpha is [0, 1]\n    }\n\n    // now, convert to rgb\n    // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n    if (s === 0) {\n      r = g = b = Math.round(l * 255); // achromatic\n    } else {\n      var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n      var p = 2 * l - q;\n      r = Math.round(255 * hue2rgb(p, q, h + 1 / 3));\n      g = Math.round(255 * hue2rgb(p, q, h));\n      b = Math.round(255 * hue2rgb(p, q, h - 1 / 3));\n    }\n    ret = [r, g, b, a];\n  }\n  return ret;\n};\n\n// get [r, g, b, a] from rgb(0, 0, 0) or rgba(0, 0, 0, 0)\nvar rgb2tuple = function rgb2tuple(rgb) {\n  var ret;\n  var m = new RegExp('^' + rgba + '$').exec(rgb);\n  if (m) {\n    ret = [];\n    var isPct = [];\n    for (var i = 1; i <= 3; i++) {\n      var channel = m[i];\n      if (channel[channel.length - 1] === '%') {\n        isPct[i] = true;\n      }\n      channel = parseFloat(channel);\n      if (isPct[i]) {\n        channel = channel / 100 * 255; // normalise to [0, 255]\n      }\n      if (channel < 0 || channel > 255) {\n        return;\n      } // invalid channel value\n\n      ret.push(Math.floor(channel));\n    }\n    var atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3];\n    var allArePct = isPct[1] && isPct[2] && isPct[3];\n    if (atLeastOneIsPct && !allArePct) {\n      return;\n    } // must all be percent values if one is\n\n    var alpha = m[4];\n    if (alpha !== undefined) {\n      alpha = parseFloat(alpha);\n      if (alpha < 0 || alpha > 1) {\n        return;\n      } // invalid alpha value\n\n      ret.push(alpha);\n    }\n  }\n  return ret;\n};\nvar colorname2tuple = function colorname2tuple(color) {\n  return colors[color.toLowerCase()];\n};\nvar color2tuple = function color2tuple(color) {\n  return (array(color) ? color : null) || colorname2tuple(color) || hex2tuple(color) || rgb2tuple(color) || hsl2tuple(color);\n};\nvar colors = {\n  // special colour names\n  transparent: [0, 0, 0, 0],\n  // NB alpha === 0\n\n  // regular colours\n  aliceblue: [240, 248, 255],\n  antiquewhite: [250, 235, 215],\n  aqua: [0, 255, 255],\n  aquamarine: [127, 255, 212],\n  azure: [240, 255, 255],\n  beige: [245, 245, 220],\n  bisque: [255, 228, 196],\n  black: [0, 0, 0],\n  blanchedalmond: [255, 235, 205],\n  blue: [0, 0, 255],\n  blueviolet: [138, 43, 226],\n  brown: [165, 42, 42],\n  burlywood: [222, 184, 135],\n  cadetblue: [95, 158, 160],\n  chartreuse: [127, 255, 0],\n  chocolate: [210, 105, 30],\n  coral: [255, 127, 80],\n  cornflowerblue: [100, 149, 237],\n  cornsilk: [255, 248, 220],\n  crimson: [220, 20, 60],\n  cyan: [0, 255, 255],\n  darkblue: [0, 0, 139],\n  darkcyan: [0, 139, 139],\n  darkgoldenrod: [184, 134, 11],\n  darkgray: [169, 169, 169],\n  darkgreen: [0, 100, 0],\n  darkgrey: [169, 169, 169],\n  darkkhaki: [189, 183, 107],\n  darkmagenta: [139, 0, 139],\n  darkolivegreen: [85, 107, 47],\n  darkorange: [255, 140, 0],\n  darkorchid: [153, 50, 204],\n  darkred: [139, 0, 0],\n  darksalmon: [233, 150, 122],\n  darkseagreen: [143, 188, 143],\n  darkslateblue: [72, 61, 139],\n  darkslategray: [47, 79, 79],\n  darkslategrey: [47, 79, 79],\n  darkturquoise: [0, 206, 209],\n  darkviolet: [148, 0, 211],\n  deeppink: [255, 20, 147],\n  deepskyblue: [0, 191, 255],\n  dimgray: [105, 105, 105],\n  dimgrey: [105, 105, 105],\n  dodgerblue: [30, 144, 255],\n  firebrick: [178, 34, 34],\n  floralwhite: [255, 250, 240],\n  forestgreen: [34, 139, 34],\n  fuchsia: [255, 0, 255],\n  gainsboro: [220, 220, 220],\n  ghostwhite: [248, 248, 255],\n  gold: [255, 215, 0],\n  goldenrod: [218, 165, 32],\n  gray: [128, 128, 128],\n  grey: [128, 128, 128],\n  green: [0, 128, 0],\n  greenyellow: [173, 255, 47],\n  honeydew: [240, 255, 240],\n  hotpink: [255, 105, 180],\n  indianred: [205, 92, 92],\n  indigo: [75, 0, 130],\n  ivory: [255, 255, 240],\n  khaki: [240, 230, 140],\n  lavender: [230, 230, 250],\n  lavenderblush: [255, 240, 245],\n  lawngreen: [124, 252, 0],\n  lemonchiffon: [255, 250, 205],\n  lightblue: [173, 216, 230],\n  lightcoral: [240, 128, 128],\n  lightcyan: [224, 255, 255],\n  lightgoldenrodyellow: [250, 250, 210],\n  lightgray: [211, 211, 211],\n  lightgreen: [144, 238, 144],\n  lightgrey: [211, 211, 211],\n  lightpink: [255, 182, 193],\n  lightsalmon: [255, 160, 122],\n  lightseagreen: [32, 178, 170],\n  lightskyblue: [135, 206, 250],\n  lightslategray: [119, 136, 153],\n  lightslategrey: [119, 136, 153],\n  lightsteelblue: [176, 196, 222],\n  lightyellow: [255, 255, 224],\n  lime: [0, 255, 0],\n  limegreen: [50, 205, 50],\n  linen: [250, 240, 230],\n  magenta: [255, 0, 255],\n  maroon: [128, 0, 0],\n  mediumaquamarine: [102, 205, 170],\n  mediumblue: [0, 0, 205],\n  mediumorchid: [186, 85, 211],\n  mediumpurple: [147, 112, 219],\n  mediumseagreen: [60, 179, 113],\n  mediumslateblue: [123, 104, 238],\n  mediumspringgreen: [0, 250, 154],\n  mediumturquoise: [72, 209, 204],\n  mediumvioletred: [199, 21, 133],\n  midnightblue: [25, 25, 112],\n  mintcream: [245, 255, 250],\n  mistyrose: [255, 228, 225],\n  moccasin: [255, 228, 181],\n  navajowhite: [255, 222, 173],\n  navy: [0, 0, 128],\n  oldlace: [253, 245, 230],\n  olive: [128, 128, 0],\n  olivedrab: [107, 142, 35],\n  orange: [255, 165, 0],\n  orangered: [255, 69, 0],\n  orchid: [218, 112, 214],\n  palegoldenrod: [238, 232, 170],\n  palegreen: [152, 251, 152],\n  paleturquoise: [175, 238, 238],\n  palevioletred: [219, 112, 147],\n  papayawhip: [255, 239, 213],\n  peachpuff: [255, 218, 185],\n  peru: [205, 133, 63],\n  pink: [255, 192, 203],\n  plum: [221, 160, 221],\n  powderblue: [176, 224, 230],\n  purple: [128, 0, 128],\n  red: [255, 0, 0],\n  rosybrown: [188, 143, 143],\n  royalblue: [65, 105, 225],\n  saddlebrown: [139, 69, 19],\n  salmon: [250, 128, 114],\n  sandybrown: [244, 164, 96],\n  seagreen: [46, 139, 87],\n  seashell: [255, 245, 238],\n  sienna: [160, 82, 45],\n  silver: [192, 192, 192],\n  skyblue: [135, 206, 235],\n  slateblue: [106, 90, 205],\n  slategray: [112, 128, 144],\n  slategrey: [112, 128, 144],\n  snow: [255, 250, 250],\n  springgreen: [0, 255, 127],\n  steelblue: [70, 130, 180],\n  tan: [210, 180, 140],\n  teal: [0, 128, 128],\n  thistle: [216, 191, 216],\n  tomato: [255, 99, 71],\n  turquoise: [64, 224, 208],\n  violet: [238, 130, 238],\n  wheat: [245, 222, 179],\n  white: [255, 255, 255],\n  whitesmoke: [245, 245, 245],\n  yellow: [255, 255, 0],\n  yellowgreen: [154, 205, 50]\n};\n\n// sets the value in a map (map may not be built)\nvar setMap = function setMap(options) {\n  var obj = options.map;\n  var keys = options.keys;\n  var l = keys.length;\n  for (var i = 0; i < l; i++) {\n    var key = keys[i];\n    if (plainObject(key)) {\n      throw Error('Tried to set map with object key');\n    }\n    if (i < keys.length - 1) {\n      // extend the map if necessary\n      if (obj[key] == null) {\n        obj[key] = {};\n      }\n      obj = obj[key];\n    } else {\n      // set the value\n      obj[key] = options.value;\n    }\n  }\n};\n\n// gets the value in a map even if it's not built in places\nvar getMap = function getMap(options) {\n  var obj = options.map;\n  var keys = options.keys;\n  var l = keys.length;\n  for (var i = 0; i < l; i++) {\n    var key = keys[i];\n    if (plainObject(key)) {\n      throw Error('Tried to get map with object key');\n    }\n    obj = obj[key];\n    if (obj == null) {\n      return obj;\n    }\n  }\n  return obj;\n};\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n\nvar isObject_1;\nvar hasRequiredIsObject;\n\nfunction requireIsObject () {\n\tif (hasRequiredIsObject) return isObject_1;\n\thasRequiredIsObject = 1;\n\tfunction isObject(value) {\n\t  var type = typeof value;\n\t  return value != null && (type == 'object' || type == 'function');\n\t}\n\n\tisObject_1 = isObject;\n\treturn isObject_1;\n}\n\n/** Detect free variable `global` from Node.js. */\n\nvar _freeGlobal;\nvar hasRequired_freeGlobal;\n\nfunction require_freeGlobal () {\n\tif (hasRequired_freeGlobal) return _freeGlobal;\n\thasRequired_freeGlobal = 1;\n\tvar freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;\n\n\t_freeGlobal = freeGlobal;\n\treturn _freeGlobal;\n}\n\nvar _root;\nvar hasRequired_root;\n\nfunction require_root () {\n\tif (hasRequired_root) return _root;\n\thasRequired_root = 1;\n\tvar freeGlobal = require_freeGlobal();\n\n\t/** Detect free variable `self`. */\n\tvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n\t/** Used as a reference to the global object. */\n\tvar root = freeGlobal || freeSelf || Function('return this')();\n\n\t_root = root;\n\treturn _root;\n}\n\nvar now_1;\nvar hasRequiredNow;\n\nfunction requireNow () {\n\tif (hasRequiredNow) return now_1;\n\thasRequiredNow = 1;\n\tvar root = require_root();\n\n\t/**\n\t * Gets the timestamp of the number of milliseconds that have elapsed since\n\t * the Unix epoch (1 January 1970 00:00:00 UTC).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 2.4.0\n\t * @category Date\n\t * @returns {number} Returns the timestamp.\n\t * @example\n\t *\n\t * _.defer(function(stamp) {\n\t *   console.log(_.now() - stamp);\n\t * }, _.now());\n\t * // => Logs the number of milliseconds it took for the deferred invocation.\n\t */\n\tvar now = function() {\n\t  return root.Date.now();\n\t};\n\n\tnow_1 = now;\n\treturn now_1;\n}\n\n/** Used to match a single whitespace character. */\n\nvar _trimmedEndIndex;\nvar hasRequired_trimmedEndIndex;\n\nfunction require_trimmedEndIndex () {\n\tif (hasRequired_trimmedEndIndex) return _trimmedEndIndex;\n\thasRequired_trimmedEndIndex = 1;\n\tvar reWhitespace = /\\s/;\n\n\t/**\n\t * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n\t * character of `string`.\n\t *\n\t * @private\n\t * @param {string} string The string to inspect.\n\t * @returns {number} Returns the index of the last non-whitespace character.\n\t */\n\tfunction trimmedEndIndex(string) {\n\t  var index = string.length;\n\n\t  while (index-- && reWhitespace.test(string.charAt(index))) {}\n\t  return index;\n\t}\n\n\t_trimmedEndIndex = trimmedEndIndex;\n\treturn _trimmedEndIndex;\n}\n\nvar _baseTrim;\nvar hasRequired_baseTrim;\n\nfunction require_baseTrim () {\n\tif (hasRequired_baseTrim) return _baseTrim;\n\thasRequired_baseTrim = 1;\n\tvar trimmedEndIndex = require_trimmedEndIndex();\n\n\t/** Used to match leading whitespace. */\n\tvar reTrimStart = /^\\s+/;\n\n\t/**\n\t * The base implementation of `_.trim`.\n\t *\n\t * @private\n\t * @param {string} string The string to trim.\n\t * @returns {string} Returns the trimmed string.\n\t */\n\tfunction baseTrim(string) {\n\t  return string\n\t    ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n\t    : string;\n\t}\n\n\t_baseTrim = baseTrim;\n\treturn _baseTrim;\n}\n\nvar _Symbol;\nvar hasRequired_Symbol;\n\nfunction require_Symbol () {\n\tif (hasRequired_Symbol) return _Symbol;\n\thasRequired_Symbol = 1;\n\tvar root = require_root();\n\n\t/** Built-in value references. */\n\tvar Symbol = root.Symbol;\n\n\t_Symbol = Symbol;\n\treturn _Symbol;\n}\n\nvar _getRawTag;\nvar hasRequired_getRawTag;\n\nfunction require_getRawTag () {\n\tif (hasRequired_getRawTag) return _getRawTag;\n\thasRequired_getRawTag = 1;\n\tvar Symbol = require_Symbol();\n\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar nativeObjectToString = objectProto.toString;\n\n\t/** Built-in value references. */\n\tvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n\t/**\n\t * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the raw `toStringTag`.\n\t */\n\tfunction getRawTag(value) {\n\t  var isOwn = hasOwnProperty.call(value, symToStringTag),\n\t      tag = value[symToStringTag];\n\n\t  try {\n\t    value[symToStringTag] = undefined;\n\t    var unmasked = true;\n\t  } catch (e) {}\n\n\t  var result = nativeObjectToString.call(value);\n\t  if (unmasked) {\n\t    if (isOwn) {\n\t      value[symToStringTag] = tag;\n\t    } else {\n\t      delete value[symToStringTag];\n\t    }\n\t  }\n\t  return result;\n\t}\n\n\t_getRawTag = getRawTag;\n\treturn _getRawTag;\n}\n\n/** Used for built-in method references. */\n\nvar _objectToString;\nvar hasRequired_objectToString;\n\nfunction require_objectToString () {\n\tif (hasRequired_objectToString) return _objectToString;\n\thasRequired_objectToString = 1;\n\tvar objectProto = Object.prototype;\n\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar nativeObjectToString = objectProto.toString;\n\n\t/**\n\t * Converts `value` to a string using `Object.prototype.toString`.\n\t *\n\t * @private\n\t * @param {*} value The value to convert.\n\t * @returns {string} Returns the converted string.\n\t */\n\tfunction objectToString(value) {\n\t  return nativeObjectToString.call(value);\n\t}\n\n\t_objectToString = objectToString;\n\treturn _objectToString;\n}\n\nvar _baseGetTag;\nvar hasRequired_baseGetTag;\n\nfunction require_baseGetTag () {\n\tif (hasRequired_baseGetTag) return _baseGetTag;\n\thasRequired_baseGetTag = 1;\n\tvar Symbol = require_Symbol(),\n\t    getRawTag = require_getRawTag(),\n\t    objectToString = require_objectToString();\n\n\t/** `Object#toString` result references. */\n\tvar nullTag = '[object Null]',\n\t    undefinedTag = '[object Undefined]';\n\n\t/** Built-in value references. */\n\tvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n\t/**\n\t * The base implementation of `getTag` without fallbacks for buggy environments.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the `toStringTag`.\n\t */\n\tfunction baseGetTag(value) {\n\t  if (value == null) {\n\t    return value === undefined ? undefinedTag : nullTag;\n\t  }\n\t  return (symToStringTag && symToStringTag in Object(value))\n\t    ? getRawTag(value)\n\t    : objectToString(value);\n\t}\n\n\t_baseGetTag = baseGetTag;\n\treturn _baseGetTag;\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n\nvar isObjectLike_1;\nvar hasRequiredIsObjectLike;\n\nfunction requireIsObjectLike () {\n\tif (hasRequiredIsObjectLike) return isObjectLike_1;\n\thasRequiredIsObjectLike = 1;\n\tfunction isObjectLike(value) {\n\t  return value != null && typeof value == 'object';\n\t}\n\n\tisObjectLike_1 = isObjectLike;\n\treturn isObjectLike_1;\n}\n\nvar isSymbol_1;\nvar hasRequiredIsSymbol;\n\nfunction requireIsSymbol () {\n\tif (hasRequiredIsSymbol) return isSymbol_1;\n\thasRequiredIsSymbol = 1;\n\tvar baseGetTag = require_baseGetTag(),\n\t    isObjectLike = requireIsObjectLike();\n\n\t/** `Object#toString` result references. */\n\tvar symbolTag = '[object Symbol]';\n\n\t/**\n\t * Checks if `value` is classified as a `Symbol` primitive or object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n\t * @example\n\t *\n\t * _.isSymbol(Symbol.iterator);\n\t * // => true\n\t *\n\t * _.isSymbol('abc');\n\t * // => false\n\t */\n\tfunction isSymbol(value) {\n\t  return typeof value == 'symbol' ||\n\t    (isObjectLike(value) && baseGetTag(value) == symbolTag);\n\t}\n\n\tisSymbol_1 = isSymbol;\n\treturn isSymbol_1;\n}\n\nvar toNumber_1;\nvar hasRequiredToNumber;\n\nfunction requireToNumber () {\n\tif (hasRequiredToNumber) return toNumber_1;\n\thasRequiredToNumber = 1;\n\tvar baseTrim = require_baseTrim(),\n\t    isObject = requireIsObject(),\n\t    isSymbol = requireIsSymbol();\n\n\t/** Used as references for various `Number` constants. */\n\tvar NAN = 0 / 0;\n\n\t/** Used to detect bad signed hexadecimal string values. */\n\tvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n\t/** Used to detect binary string values. */\n\tvar reIsBinary = /^0b[01]+$/i;\n\n\t/** Used to detect octal string values. */\n\tvar reIsOctal = /^0o[0-7]+$/i;\n\n\t/** Built-in method references without a dependency on `root`. */\n\tvar freeParseInt = parseInt;\n\n\t/**\n\t * Converts `value` to a number.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {number} Returns the number.\n\t * @example\n\t *\n\t * _.toNumber(3.2);\n\t * // => 3.2\n\t *\n\t * _.toNumber(Number.MIN_VALUE);\n\t * // => 5e-324\n\t *\n\t * _.toNumber(Infinity);\n\t * // => Infinity\n\t *\n\t * _.toNumber('3.2');\n\t * // => 3.2\n\t */\n\tfunction toNumber(value) {\n\t  if (typeof value == 'number') {\n\t    return value;\n\t  }\n\t  if (isSymbol(value)) {\n\t    return NAN;\n\t  }\n\t  if (isObject(value)) {\n\t    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n\t    value = isObject(other) ? (other + '') : other;\n\t  }\n\t  if (typeof value != 'string') {\n\t    return value === 0 ? value : +value;\n\t  }\n\t  value = baseTrim(value);\n\t  var isBinary = reIsBinary.test(value);\n\t  return (isBinary || reIsOctal.test(value))\n\t    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n\t    : (reIsBadHex.test(value) ? NAN : +value);\n\t}\n\n\ttoNumber_1 = toNumber;\n\treturn toNumber_1;\n}\n\nvar debounce_1;\nvar hasRequiredDebounce;\n\nfunction requireDebounce () {\n\tif (hasRequiredDebounce) return debounce_1;\n\thasRequiredDebounce = 1;\n\tvar isObject = requireIsObject(),\n\t    now = requireNow(),\n\t    toNumber = requireToNumber();\n\n\t/** Error message constants. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeMax = Math.max,\n\t    nativeMin = Math.min;\n\n\t/**\n\t * Creates a debounced function that delays invoking `func` until after `wait`\n\t * milliseconds have elapsed since the last time the debounced function was\n\t * invoked. The debounced function comes with a `cancel` method to cancel\n\t * delayed `func` invocations and a `flush` method to immediately invoke them.\n\t * Provide `options` to indicate whether `func` should be invoked on the\n\t * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n\t * with the last arguments provided to the debounced function. Subsequent\n\t * calls to the debounced function return the result of the last `func`\n\t * invocation.\n\t *\n\t * **Note:** If `leading` and `trailing` options are `true`, `func` is\n\t * invoked on the trailing edge of the timeout only if the debounced function\n\t * is invoked more than once during the `wait` timeout.\n\t *\n\t * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n\t * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n\t *\n\t * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n\t * for details over the differences between `_.debounce` and `_.throttle`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Function\n\t * @param {Function} func The function to debounce.\n\t * @param {number} [wait=0] The number of milliseconds to delay.\n\t * @param {Object} [options={}] The options object.\n\t * @param {boolean} [options.leading=false]\n\t *  Specify invoking on the leading edge of the timeout.\n\t * @param {number} [options.maxWait]\n\t *  The maximum time `func` is allowed to be delayed before it's invoked.\n\t * @param {boolean} [options.trailing=true]\n\t *  Specify invoking on the trailing edge of the timeout.\n\t * @returns {Function} Returns the new debounced function.\n\t * @example\n\t *\n\t * // Avoid costly calculations while the window size is in flux.\n\t * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n\t *\n\t * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n\t * jQuery(element).on('click', _.debounce(sendMail, 300, {\n\t *   'leading': true,\n\t *   'trailing': false\n\t * }));\n\t *\n\t * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n\t * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n\t * var source = new EventSource('/stream');\n\t * jQuery(source).on('message', debounced);\n\t *\n\t * // Cancel the trailing debounced invocation.\n\t * jQuery(window).on('popstate', debounced.cancel);\n\t */\n\tfunction debounce(func, wait, options) {\n\t  var lastArgs,\n\t      lastThis,\n\t      maxWait,\n\t      result,\n\t      timerId,\n\t      lastCallTime,\n\t      lastInvokeTime = 0,\n\t      leading = false,\n\t      maxing = false,\n\t      trailing = true;\n\n\t  if (typeof func != 'function') {\n\t    throw new TypeError(FUNC_ERROR_TEXT);\n\t  }\n\t  wait = toNumber(wait) || 0;\n\t  if (isObject(options)) {\n\t    leading = !!options.leading;\n\t    maxing = 'maxWait' in options;\n\t    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n\t    trailing = 'trailing' in options ? !!options.trailing : trailing;\n\t  }\n\n\t  function invokeFunc(time) {\n\t    var args = lastArgs,\n\t        thisArg = lastThis;\n\n\t    lastArgs = lastThis = undefined;\n\t    lastInvokeTime = time;\n\t    result = func.apply(thisArg, args);\n\t    return result;\n\t  }\n\n\t  function leadingEdge(time) {\n\t    // Reset any `maxWait` timer.\n\t    lastInvokeTime = time;\n\t    // Start the timer for the trailing edge.\n\t    timerId = setTimeout(timerExpired, wait);\n\t    // Invoke the leading edge.\n\t    return leading ? invokeFunc(time) : result;\n\t  }\n\n\t  function remainingWait(time) {\n\t    var timeSinceLastCall = time - lastCallTime,\n\t        timeSinceLastInvoke = time - lastInvokeTime,\n\t        timeWaiting = wait - timeSinceLastCall;\n\n\t    return maxing\n\t      ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n\t      : timeWaiting;\n\t  }\n\n\t  function shouldInvoke(time) {\n\t    var timeSinceLastCall = time - lastCallTime,\n\t        timeSinceLastInvoke = time - lastInvokeTime;\n\n\t    // Either this is the first call, activity has stopped and we're at the\n\t    // trailing edge, the system time has gone backwards and we're treating\n\t    // it as the trailing edge, or we've hit the `maxWait` limit.\n\t    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n\t      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n\t  }\n\n\t  function timerExpired() {\n\t    var time = now();\n\t    if (shouldInvoke(time)) {\n\t      return trailingEdge(time);\n\t    }\n\t    // Restart the timer.\n\t    timerId = setTimeout(timerExpired, remainingWait(time));\n\t  }\n\n\t  function trailingEdge(time) {\n\t    timerId = undefined;\n\n\t    // Only invoke if we have `lastArgs` which means `func` has been\n\t    // debounced at least once.\n\t    if (trailing && lastArgs) {\n\t      return invokeFunc(time);\n\t    }\n\t    lastArgs = lastThis = undefined;\n\t    return result;\n\t  }\n\n\t  function cancel() {\n\t    if (timerId !== undefined) {\n\t      clearTimeout(timerId);\n\t    }\n\t    lastInvokeTime = 0;\n\t    lastArgs = lastCallTime = lastThis = timerId = undefined;\n\t  }\n\n\t  function flush() {\n\t    return timerId === undefined ? result : trailingEdge(now());\n\t  }\n\n\t  function debounced() {\n\t    var time = now(),\n\t        isInvoking = shouldInvoke(time);\n\n\t    lastArgs = arguments;\n\t    lastThis = this;\n\t    lastCallTime = time;\n\n\t    if (isInvoking) {\n\t      if (timerId === undefined) {\n\t        return leadingEdge(lastCallTime);\n\t      }\n\t      if (maxing) {\n\t        // Handle invocations in a tight loop.\n\t        clearTimeout(timerId);\n\t        timerId = setTimeout(timerExpired, wait);\n\t        return invokeFunc(lastCallTime);\n\t      }\n\t    }\n\t    if (timerId === undefined) {\n\t      timerId = setTimeout(timerExpired, wait);\n\t    }\n\t    return result;\n\t  }\n\t  debounced.cancel = cancel;\n\t  debounced.flush = flush;\n\t  return debounced;\n\t}\n\n\tdebounce_1 = debounce;\n\treturn debounce_1;\n}\n\nvar debounceExports = requireDebounce();\nvar debounce = /*@__PURE__*/getDefaultExportFromCjs(debounceExports);\n\nvar performance$1 = _window ? _window.performance : null;\nvar pnow = performance$1 && performance$1.now ? function () {\n  return performance$1.now();\n} : function () {\n  return Date.now();\n};\nvar raf = function () {\n  if (_window) {\n    if (_window.requestAnimationFrame) {\n      return function (fn) {\n        _window.requestAnimationFrame(fn);\n      };\n    } else if (_window.mozRequestAnimationFrame) {\n      return function (fn) {\n        _window.mozRequestAnimationFrame(fn);\n      };\n    } else if (_window.webkitRequestAnimationFrame) {\n      return function (fn) {\n        _window.webkitRequestAnimationFrame(fn);\n      };\n    } else if (_window.msRequestAnimationFrame) {\n      return function (fn) {\n        _window.msRequestAnimationFrame(fn);\n      };\n    }\n  }\n  return function (fn) {\n    if (fn) {\n      setTimeout(function () {\n        fn(pnow());\n      }, 1000 / 60);\n    }\n  };\n}();\nvar requestAnimationFrame = function requestAnimationFrame(fn) {\n  return raf(fn);\n};\nvar performanceNow = pnow;\n\nvar DEFAULT_HASH_SEED = 9261;\nvar K = 65599; // 37 also works pretty well\nvar DEFAULT_HASH_SEED_ALT = 5381;\nvar hashIterableInts = function hashIterableInts(iterator) {\n  var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_HASH_SEED;\n  // sdbm/string-hash\n  var hash = seed;\n  var entry;\n  for (;;) {\n    entry = iterator.next();\n    if (entry.done) {\n      break;\n    }\n    hash = hash * K + entry.value | 0;\n  }\n  return hash;\n};\nvar hashInt = function hashInt(num) {\n  var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_HASH_SEED;\n  // sdbm/string-hash\n  return seed * K + num | 0;\n};\nvar hashIntAlt = function hashIntAlt(num) {\n  var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_HASH_SEED_ALT;\n  // djb2/string-hash\n  return (seed << 5) + seed + num | 0;\n};\nvar combineHashes = function combineHashes(hash1, hash2) {\n  return hash1 * 0x200000 + hash2;\n};\nvar combineHashesArray = function combineHashesArray(hashes) {\n  return hashes[0] * 0x200000 + hashes[1];\n};\nvar hashArrays = function hashArrays(hashes1, hashes2) {\n  return [hashInt(hashes1[0], hashes2[0]), hashIntAlt(hashes1[1], hashes2[1])];\n};\nvar hashIntsArray = function hashIntsArray(ints, seed) {\n  var entry = {\n    value: 0,\n    done: false\n  };\n  var i = 0;\n  var length = ints.length;\n  var iterator = {\n    next: function next() {\n      if (i < length) {\n        entry.value = ints[i++];\n      } else {\n        entry.done = true;\n      }\n      return entry;\n    }\n  };\n  return hashIterableInts(iterator, seed);\n};\nvar hashString = function hashString(str, seed) {\n  var entry = {\n    value: 0,\n    done: false\n  };\n  var i = 0;\n  var length = str.length;\n  var iterator = {\n    next: function next() {\n      if (i < length) {\n        entry.value = str.charCodeAt(i++);\n      } else {\n        entry.done = true;\n      }\n      return entry;\n    }\n  };\n  return hashIterableInts(iterator, seed);\n};\nvar hashStrings = function hashStrings() {\n  return hashStringsArray(arguments);\n};\nvar hashStringsArray = function hashStringsArray(strs) {\n  var hash;\n  for (var i = 0; i < strs.length; i++) {\n    var str = strs[i];\n    if (i === 0) {\n      hash = hashString(str);\n    } else {\n      hash = hashString(str, hash);\n    }\n  }\n  return hash;\n};\n\nfunction rotatePoint(x, y, centerX, centerY, angleDegrees) {\n  var angleRadians = angleDegrees * Math.PI / 180;\n  var rotatedX = Math.cos(angleRadians) * (x - centerX) - Math.sin(angleRadians) * (y - centerY) + centerX;\n  var rotatedY = Math.sin(angleRadians) * (x - centerX) + Math.cos(angleRadians) * (y - centerY) + centerY;\n  return {\n    x: rotatedX,\n    y: rotatedY\n  };\n}\nvar movePointByBoxAspect = function movePointByBoxAspect(x, y, boxX, boxY, skewX, skewY) {\n  return {\n    x: (x - boxX) * skewX + boxX,\n    y: (y - boxY) * skewY + boxY\n  };\n};\nfunction rotatePosAndSkewByBox(pos, box, angleDegrees) {\n  if (angleDegrees === 0) return pos;\n  var centerX = (box.x1 + box.x2) / 2;\n  var centerY = (box.y1 + box.y2) / 2;\n  var skewX = box.w / box.h;\n  var skewY = 1 / skewX;\n  var rotated = rotatePoint(pos.x, pos.y, centerX, centerY, angleDegrees);\n  var skewed = movePointByBoxAspect(rotated.x, rotated.y, centerX, centerY, skewX, skewY);\n  return {\n    x: skewed.x,\n    y: skewed.y\n  };\n}\n\nvar warningsEnabled = true;\nvar warnSupported = console.warn != null;\nvar traceSupported = console.trace != null;\nvar MAX_INT$1 = Number.MAX_SAFE_INTEGER || 9007199254740991;\nvar trueify = function trueify() {\n  return true;\n};\nvar falsify = function falsify() {\n  return false;\n};\nvar zeroify = function zeroify() {\n  return 0;\n};\nvar noop$1 = function noop() {};\nvar error = function error(msg) {\n  throw new Error(msg);\n};\nvar warnings = function warnings(enabled) {\n  if (enabled !== undefined) {\n    warningsEnabled = !!enabled;\n  } else {\n    return warningsEnabled;\n  }\n};\nvar warn = function warn(msg) {\n  if (!warnings()) {\n    return;\n  }\n  if (warnSupported) {\n    console.warn(msg);\n  } else {\n    console.log(msg);\n    if (traceSupported) {\n      console.trace();\n    }\n  }\n};\nvar clone = function clone(obj) {\n  return extend({}, obj);\n};\n\n// gets a shallow copy of the argument\nvar copy = function copy(obj) {\n  if (obj == null) {\n    return obj;\n  }\n  if (array(obj)) {\n    return obj.slice();\n  } else if (plainObject(obj)) {\n    return clone(obj);\n  } else {\n    return obj;\n  }\n};\nvar copyArray = function copyArray(arr) {\n  return arr.slice();\n};\nvar uuid = function uuid(a, b /* placeholders */) {\n  for (\n  // loop :)\n  b = a = '';\n  // b - result , a - numeric letiable\n  a++ < 36;\n  //\n  b += a * 51 & 52 // if \"a\" is not 9 or 14 or 19 or 24\n  ?\n  //  return a random number or 4\n  (a ^ 15 // if \"a\" is not 15\n  ?\n  // generate a random number from 0 to 15\n  8 ^ Math.random() * (a ^ 20 ? 16 : 4) // unless \"a\" is 20, in which case a random number from 8 to 11\n  : 4 //  otherwise 4\n  ).toString(16) : '-' //  in other cases (if \"a\" is 9,14,19,24) insert \"-\"\n  );\n  return b;\n};\nvar _staticEmptyObject = {};\nvar staticEmptyObject = function staticEmptyObject() {\n  return _staticEmptyObject;\n};\nvar defaults$g = function defaults(_defaults) {\n  var keys = Object.keys(_defaults);\n  return function (opts) {\n    var filledOpts = {};\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n      var optVal = opts == null ? undefined : opts[key];\n      filledOpts[key] = optVal === undefined ? _defaults[key] : optVal;\n    }\n    return filledOpts;\n  };\n};\nvar removeFromArray = function removeFromArray(arr, ele, oneCopy) {\n  for (var i = arr.length - 1; i >= 0; i--) {\n    if (arr[i] === ele) {\n      arr.splice(i, 1);\n    }\n  }\n};\nvar clearArray = function clearArray(arr) {\n  arr.splice(0, arr.length);\n};\nvar push = function push(arr, otherArr) {\n  for (var i = 0; i < otherArr.length; i++) {\n    var el = otherArr[i];\n    arr.push(el);\n  }\n};\nvar getPrefixedProperty = function getPrefixedProperty(obj, propName, prefix) {\n  if (prefix) {\n    propName = prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth\n  }\n  return obj[propName];\n};\nvar setPrefixedProperty = function setPrefixedProperty(obj, propName, prefix, value) {\n  if (prefix) {\n    propName = prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth\n  }\n  obj[propName] = value;\n};\n\n/* global Map */\nvar ObjectMap = /*#__PURE__*/function () {\n  function ObjectMap() {\n    _classCallCheck(this, ObjectMap);\n    this._obj = {};\n  }\n  return _createClass(ObjectMap, [{\n    key: \"set\",\n    value: function set(key, val) {\n      this._obj[key] = val;\n      return this;\n    }\n  }, {\n    key: \"delete\",\n    value: function _delete(key) {\n      this._obj[key] = undefined;\n      return this;\n    }\n  }, {\n    key: \"clear\",\n    value: function clear() {\n      this._obj = {};\n    }\n  }, {\n    key: \"has\",\n    value: function has(key) {\n      return this._obj[key] !== undefined;\n    }\n  }, {\n    key: \"get\",\n    value: function get(key) {\n      return this._obj[key];\n    }\n  }]);\n}();\nvar Map$1 = typeof Map !== 'undefined' ? Map : ObjectMap;\n\n/* global Set */\n\nvar undef = \"undefined\" ;\nvar ObjectSet = /*#__PURE__*/function () {\n  function ObjectSet(arrayOrObjectSet) {\n    _classCallCheck(this, ObjectSet);\n    this._obj = Object.create(null);\n    this.size = 0;\n    if (arrayOrObjectSet != null) {\n      var arr;\n      if (arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString()) {\n        arr = arrayOrObjectSet.toArray();\n      } else {\n        arr = arrayOrObjectSet;\n      }\n      for (var i = 0; i < arr.length; i++) {\n        this.add(arr[i]);\n      }\n    }\n  }\n  return _createClass(ObjectSet, [{\n    key: \"instanceString\",\n    value: function instanceString() {\n      return 'set';\n    }\n  }, {\n    key: \"add\",\n    value: function add(val) {\n      var o = this._obj;\n      if (o[val] !== 1) {\n        o[val] = 1;\n        this.size++;\n      }\n    }\n  }, {\n    key: \"delete\",\n    value: function _delete(val) {\n      var o = this._obj;\n      if (o[val] === 1) {\n        o[val] = 0;\n        this.size--;\n      }\n    }\n  }, {\n    key: \"clear\",\n    value: function clear() {\n      this._obj = Object.create(null);\n    }\n  }, {\n    key: \"has\",\n    value: function has(val) {\n      return this._obj[val] === 1;\n    }\n  }, {\n    key: \"toArray\",\n    value: function toArray() {\n      var _this = this;\n      return Object.keys(this._obj).filter(function (key) {\n        return _this.has(key);\n      });\n    }\n  }, {\n    key: \"forEach\",\n    value: function forEach(callback, thisArg) {\n      return this.toArray().forEach(callback, thisArg);\n    }\n  }]);\n}();\nvar Set$1 = (typeof Set === \"undefined\" ? \"undefined\" : _typeof(Set)) !== undef ? Set : ObjectSet;\n\n// represents a node or an edge\nvar Element = function Element(cy, params) {\n  var restore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n  if (cy === undefined || params === undefined || !core(cy)) {\n    error('An element must have a core reference and parameters set');\n    return;\n  }\n  var group = params.group;\n\n  // try to automatically infer the group if unspecified\n  if (group == null) {\n    if (params.data && params.data.source != null && params.data.target != null) {\n      group = 'edges';\n    } else {\n      group = 'nodes';\n    }\n  }\n\n  // validate group\n  if (group !== 'nodes' && group !== 'edges') {\n    error('An element must be of type `nodes` or `edges`; you specified `' + group + '`');\n    return;\n  }\n\n  // make the element array-like, just like a collection\n  this.length = 1;\n  this[0] = this;\n\n  // NOTE: when something is added here, add also to ele.json()\n  var _p = this._private = {\n    cy: cy,\n    single: true,\n    // indicates this is an element\n    data: params.data || {},\n    // data object\n    position: params.position || {\n      x: 0,\n      y: 0\n    },\n    // (x, y) position pair\n    autoWidth: undefined,\n    // width and height of nodes calculated by the renderer when set to special 'auto' value\n    autoHeight: undefined,\n    autoPadding: undefined,\n    compoundBoundsClean: false,\n    // whether the compound dimensions need to be recalculated the next time dimensions are read\n    listeners: [],\n    // array of bound listeners\n    group: group,\n    // string; 'nodes' or 'edges'\n    style: {},\n    // properties as set by the style\n    rstyle: {},\n    // properties for style sent from the renderer to the core\n    styleCxts: [],\n    // applied style contexts from the styler\n    styleKeys: {},\n    // per-group keys of style property values\n    removed: true,\n    // whether it's inside the vis; true if removed (set true here since we call restore)\n    selected: params.selected ? true : false,\n    // whether it's selected\n    selectable: params.selectable === undefined ? true : params.selectable ? true : false,\n    // whether it's selectable\n    locked: params.locked ? true : false,\n    // whether the element is locked (cannot be moved)\n    grabbed: false,\n    // whether the element is grabbed by the mouse; renderer sets this privately\n    grabbable: params.grabbable === undefined ? true : params.grabbable ? true : false,\n    // whether the element can be grabbed\n    pannable: params.pannable === undefined ? group === 'edges' ? true : false : params.pannable ? true : false,\n    // whether the element has passthrough panning enabled\n    active: false,\n    // whether the element is active from user interaction\n    classes: new Set$1(),\n    // map ( className => true )\n    animation: {\n      // object for currently-running animations\n      current: [],\n      queue: []\n    },\n    rscratch: {},\n    // object in which the renderer can store information\n    scratch: params.scratch || {},\n    // scratch objects\n    edges: [],\n    // array of connected edges\n    children: [],\n    // array of children\n    parent: params.parent && params.parent.isNode() ? params.parent : null,\n    // parent ref\n    traversalCache: {},\n    // cache of output of traversal functions\n    backgrounding: false,\n    // whether background images are loading\n    bbCache: null,\n    // cache of the current bounding box\n    bbCacheShift: {\n      x: 0,\n      y: 0\n    },\n    // shift applied to cached bb to be applied on next get\n    bodyBounds: null,\n    // bounds cache of element body, w/o overlay\n    overlayBounds: null,\n    // bounds cache of element body, including overlay\n    labelBounds: {\n      // bounds cache of labels\n      all: null,\n      source: null,\n      target: null,\n      main: null\n    },\n    arrowBounds: {\n      // bounds cache of edge arrows\n      source: null,\n      target: null,\n      'mid-source': null,\n      'mid-target': null\n    }\n  };\n  if (_p.position.x == null) {\n    _p.position.x = 0;\n  }\n  if (_p.position.y == null) {\n    _p.position.y = 0;\n  }\n\n  // renderedPosition overrides if specified\n  if (params.renderedPosition) {\n    var rpos = params.renderedPosition;\n    var pan = cy.pan();\n    var zoom = cy.zoom();\n    _p.position = {\n      x: (rpos.x - pan.x) / zoom,\n      y: (rpos.y - pan.y) / zoom\n    };\n  }\n  var classes = [];\n  if (array(params.classes)) {\n    classes = params.classes;\n  } else if (string(params.classes)) {\n    classes = params.classes.split(/\\s+/);\n  }\n  for (var i = 0, l = classes.length; i < l; i++) {\n    var cls = classes[i];\n    if (!cls || cls === '') {\n      continue;\n    }\n    _p.classes.add(cls);\n  }\n  this.createEmitter();\n  if (restore === undefined || restore) {\n    this.restore();\n  }\n  var bypass = params.style || params.css;\n  if (bypass) {\n    warn('Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead.');\n    this.style(bypass);\n  }\n};\n\nvar defineSearch = function defineSearch(params) {\n  params = {\n    bfs: params.bfs || !params.dfs,\n    dfs: params.dfs || !params.bfs\n  };\n\n  // from pseudocode on wikipedia\n  return function searchFn(roots, fn, directed) {\n    var options;\n    if (plainObject(roots) && !elementOrCollection(roots)) {\n      options = roots;\n      roots = options.roots || options.root;\n      fn = options.visit;\n      directed = options.directed;\n    }\n    directed = arguments.length === 2 && !fn$6(fn) ? fn : directed;\n    fn = fn$6(fn) ? fn : function () {};\n    var cy = this._private.cy;\n    var v = roots = string(roots) ? this.filter(roots) : roots;\n    var Q = [];\n    var connectedNodes = [];\n    var connectedBy = {};\n    var id2depth = {};\n    var V = {};\n    var j = 0;\n    var found;\n    var _this$byGroup = this.byGroup(),\n      nodes = _this$byGroup.nodes,\n      edges = _this$byGroup.edges;\n\n    // enqueue v\n    for (var i = 0; i < v.length; i++) {\n      var vi = v[i];\n      var viId = vi.id();\n      if (vi.isNode()) {\n        Q.unshift(vi);\n        if (params.bfs) {\n          V[viId] = true;\n          connectedNodes.push(vi);\n        }\n        id2depth[viId] = 0;\n      }\n    }\n    var _loop = function _loop() {\n        var v = params.bfs ? Q.shift() : Q.pop();\n        var vId = v.id();\n        if (params.dfs) {\n          if (V[vId]) {\n            return 0; // continue\n          }\n          V[vId] = true;\n          connectedNodes.push(v);\n        }\n        var depth = id2depth[vId];\n        var prevEdge = connectedBy[vId];\n        var src = prevEdge != null ? prevEdge.source() : null;\n        var tgt = prevEdge != null ? prevEdge.target() : null;\n        var prevNode = prevEdge == null ? undefined : v.same(src) ? tgt[0] : src[0];\n        var ret;\n        ret = fn(v, prevEdge, prevNode, j++, depth);\n        if (ret === true) {\n          found = v;\n          return 1; // break\n        }\n        if (ret === false) {\n          return 1; // break\n        }\n        var vwEdges = v.connectedEdges().filter(function (e) {\n          return (!directed || e.source().same(v)) && edges.has(e);\n        });\n        for (var _i2 = 0; _i2 < vwEdges.length; _i2++) {\n          var e = vwEdges[_i2];\n          var w = e.connectedNodes().filter(function (n) {\n            return !n.same(v) && nodes.has(n);\n          });\n          var wId = w.id();\n          if (w.length !== 0 && !V[wId]) {\n            w = w[0];\n            Q.push(w);\n            if (params.bfs) {\n              V[wId] = true;\n              connectedNodes.push(w);\n            }\n            connectedBy[wId] = e;\n            id2depth[wId] = id2depth[vId] + 1;\n          }\n        }\n      },\n      _ret;\n    while (Q.length !== 0) {\n      _ret = _loop();\n      if (_ret === 0) continue;\n      if (_ret === 1) break;\n    }\n    var connectedEles = cy.collection();\n    for (var _i = 0; _i < connectedNodes.length; _i++) {\n      var node = connectedNodes[_i];\n      var edge = connectedBy[node.id()];\n      if (edge != null) {\n        connectedEles.push(edge);\n      }\n      connectedEles.push(node);\n    }\n    return {\n      path: cy.collection(connectedEles),\n      found: cy.collection(found)\n    };\n  };\n};\n\n// search, spanning trees, etc\nvar elesfn$v = {\n  breadthFirstSearch: defineSearch({\n    bfs: true\n  }),\n  depthFirstSearch: defineSearch({\n    dfs: true\n  })\n};\n\n// nice, short mathematical alias\nelesfn$v.bfs = elesfn$v.breadthFirstSearch;\nelesfn$v.dfs = elesfn$v.depthFirstSearch;\n\nvar heap$2 = {exports: {}};\n\nvar heap$1 = heap$2.exports;\n\nvar hasRequiredHeap$1;\n\nfunction requireHeap$1 () {\n\tif (hasRequiredHeap$1) return heap$2.exports;\n\thasRequiredHeap$1 = 1;\n\t(function (module, exports) {\n\t\t// Generated by CoffeeScript 1.8.0\n\t\t(function() {\n\t\t  var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup;\n\n\t\t  floor = Math.floor, min = Math.min;\n\n\n\t\t  /*\n\t\t  Default comparison function to be used\n\t\t   */\n\n\t\t  defaultCmp = function(x, y) {\n\t\t    if (x < y) {\n\t\t      return -1;\n\t\t    }\n\t\t    if (x > y) {\n\t\t      return 1;\n\t\t    }\n\t\t    return 0;\n\t\t  };\n\n\n\t\t  /*\n\t\t  Insert item x in list a, and keep it sorted assuming a is sorted.\n\t\t  \n\t\t  If x is already in a, insert it to the right of the rightmost x.\n\t\t  \n\t\t  Optional args lo (default 0) and hi (default a.length) bound the slice\n\t\t  of a to be searched.\n\t\t   */\n\n\t\t  insort = function(a, x, lo, hi, cmp) {\n\t\t    var mid;\n\t\t    if (lo == null) {\n\t\t      lo = 0;\n\t\t    }\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    if (lo < 0) {\n\t\t      throw new Error('lo must be non-negative');\n\t\t    }\n\t\t    if (hi == null) {\n\t\t      hi = a.length;\n\t\t    }\n\t\t    while (lo < hi) {\n\t\t      mid = floor((lo + hi) / 2);\n\t\t      if (cmp(x, a[mid]) < 0) {\n\t\t        hi = mid;\n\t\t      } else {\n\t\t        lo = mid + 1;\n\t\t      }\n\t\t    }\n\t\t    return ([].splice.apply(a, [lo, lo - lo].concat(x)), x);\n\t\t  };\n\n\n\t\t  /*\n\t\t  Push item onto heap, maintaining the heap invariant.\n\t\t   */\n\n\t\t  heappush = function(array, item, cmp) {\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    array.push(item);\n\t\t    return _siftdown(array, 0, array.length - 1, cmp);\n\t\t  };\n\n\n\t\t  /*\n\t\t  Pop the smallest item off the heap, maintaining the heap invariant.\n\t\t   */\n\n\t\t  heappop = function(array, cmp) {\n\t\t    var lastelt, returnitem;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    lastelt = array.pop();\n\t\t    if (array.length) {\n\t\t      returnitem = array[0];\n\t\t      array[0] = lastelt;\n\t\t      _siftup(array, 0, cmp);\n\t\t    } else {\n\t\t      returnitem = lastelt;\n\t\t    }\n\t\t    return returnitem;\n\t\t  };\n\n\n\t\t  /*\n\t\t  Pop and return the current smallest value, and add the new item.\n\t\t  \n\t\t  This is more efficient than heappop() followed by heappush(), and can be\n\t\t  more appropriate when using a fixed size heap. Note that the value\n\t\t  returned may be larger than item! That constrains reasonable use of\n\t\t  this routine unless written as part of a conditional replacement:\n\t\t      if item > array[0]\n\t\t        item = heapreplace(array, item)\n\t\t   */\n\n\t\t  heapreplace = function(array, item, cmp) {\n\t\t    var returnitem;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    returnitem = array[0];\n\t\t    array[0] = item;\n\t\t    _siftup(array, 0, cmp);\n\t\t    return returnitem;\n\t\t  };\n\n\n\t\t  /*\n\t\t  Fast version of a heappush followed by a heappop.\n\t\t   */\n\n\t\t  heappushpop = function(array, item, cmp) {\n\t\t    var _ref;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    if (array.length && cmp(array[0], item) < 0) {\n\t\t      _ref = [array[0], item], item = _ref[0], array[0] = _ref[1];\n\t\t      _siftup(array, 0, cmp);\n\t\t    }\n\t\t    return item;\n\t\t  };\n\n\n\t\t  /*\n\t\t  Transform list into a heap, in-place, in O(array.length) time.\n\t\t   */\n\n\t\t  heapify = function(array, cmp) {\n\t\t    var i, _i, _len, _ref1, _results, _results1;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    _ref1 = (function() {\n\t\t      _results1 = [];\n\t\t      for (var _j = 0, _ref = floor(array.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--){ _results1.push(_j); }\n\t\t      return _results1;\n\t\t    }).apply(this).reverse();\n\t\t    _results = [];\n\t\t    for (_i = 0, _len = _ref1.length; _i < _len; _i++) {\n\t\t      i = _ref1[_i];\n\t\t      _results.push(_siftup(array, i, cmp));\n\t\t    }\n\t\t    return _results;\n\t\t  };\n\n\n\t\t  /*\n\t\t  Update the position of the given item in the heap.\n\t\t  This function should be called every time the item is being modified.\n\t\t   */\n\n\t\t  updateItem = function(array, item, cmp) {\n\t\t    var pos;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    pos = array.indexOf(item);\n\t\t    if (pos === -1) {\n\t\t      return;\n\t\t    }\n\t\t    _siftdown(array, 0, pos, cmp);\n\t\t    return _siftup(array, pos, cmp);\n\t\t  };\n\n\n\t\t  /*\n\t\t  Find the n largest elements in a dataset.\n\t\t   */\n\n\t\t  nlargest = function(array, n, cmp) {\n\t\t    var elem, result, _i, _len, _ref;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    result = array.slice(0, n);\n\t\t    if (!result.length) {\n\t\t      return result;\n\t\t    }\n\t\t    heapify(result, cmp);\n\t\t    _ref = array.slice(n);\n\t\t    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n\t\t      elem = _ref[_i];\n\t\t      heappushpop(result, elem, cmp);\n\t\t    }\n\t\t    return result.sort(cmp).reverse();\n\t\t  };\n\n\n\t\t  /*\n\t\t  Find the n smallest elements in a dataset.\n\t\t   */\n\n\t\t  nsmallest = function(array, n, cmp) {\n\t\t    var elem, los, result, _i, _j, _len, _ref, _ref1, _results;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    if (n * 10 <= array.length) {\n\t\t      result = array.slice(0, n).sort(cmp);\n\t\t      if (!result.length) {\n\t\t        return result;\n\t\t      }\n\t\t      los = result[result.length - 1];\n\t\t      _ref = array.slice(n);\n\t\t      for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n\t\t        elem = _ref[_i];\n\t\t        if (cmp(elem, los) < 0) {\n\t\t          insort(result, elem, 0, null, cmp);\n\t\t          result.pop();\n\t\t          los = result[result.length - 1];\n\t\t        }\n\t\t      }\n\t\t      return result;\n\t\t    }\n\t\t    heapify(array, cmp);\n\t\t    _results = [];\n\t\t    for (_j = 0, _ref1 = min(n, array.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; 0 <= _ref1 ? ++_j : --_j) {\n\t\t      _results.push(heappop(array, cmp));\n\t\t    }\n\t\t    return _results;\n\t\t  };\n\n\t\t  _siftdown = function(array, startpos, pos, cmp) {\n\t\t    var newitem, parent, parentpos;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    newitem = array[pos];\n\t\t    while (pos > startpos) {\n\t\t      parentpos = (pos - 1) >> 1;\n\t\t      parent = array[parentpos];\n\t\t      if (cmp(newitem, parent) < 0) {\n\t\t        array[pos] = parent;\n\t\t        pos = parentpos;\n\t\t        continue;\n\t\t      }\n\t\t      break;\n\t\t    }\n\t\t    return array[pos] = newitem;\n\t\t  };\n\n\t\t  _siftup = function(array, pos, cmp) {\n\t\t    var childpos, endpos, newitem, rightpos, startpos;\n\t\t    if (cmp == null) {\n\t\t      cmp = defaultCmp;\n\t\t    }\n\t\t    endpos = array.length;\n\t\t    startpos = pos;\n\t\t    newitem = array[pos];\n\t\t    childpos = 2 * pos + 1;\n\t\t    while (childpos < endpos) {\n\t\t      rightpos = childpos + 1;\n\t\t      if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) {\n\t\t        childpos = rightpos;\n\t\t      }\n\t\t      array[pos] = array[childpos];\n\t\t      pos = childpos;\n\t\t      childpos = 2 * pos + 1;\n\t\t    }\n\t\t    array[pos] = newitem;\n\t\t    return _siftdown(array, startpos, pos, cmp);\n\t\t  };\n\n\t\t  Heap = (function() {\n\t\t    Heap.push = heappush;\n\n\t\t    Heap.pop = heappop;\n\n\t\t    Heap.replace = heapreplace;\n\n\t\t    Heap.pushpop = heappushpop;\n\n\t\t    Heap.heapify = heapify;\n\n\t\t    Heap.updateItem = updateItem;\n\n\t\t    Heap.nlargest = nlargest;\n\n\t\t    Heap.nsmallest = nsmallest;\n\n\t\t    function Heap(cmp) {\n\t\t      this.cmp = cmp != null ? cmp : defaultCmp;\n\t\t      this.nodes = [];\n\t\t    }\n\n\t\t    Heap.prototype.push = function(x) {\n\t\t      return heappush(this.nodes, x, this.cmp);\n\t\t    };\n\n\t\t    Heap.prototype.pop = function() {\n\t\t      return heappop(this.nodes, this.cmp);\n\t\t    };\n\n\t\t    Heap.prototype.peek = function() {\n\t\t      return this.nodes[0];\n\t\t    };\n\n\t\t    Heap.prototype.contains = function(x) {\n\t\t      return this.nodes.indexOf(x) !== -1;\n\t\t    };\n\n\t\t    Heap.prototype.replace = function(x) {\n\t\t      return heapreplace(this.nodes, x, this.cmp);\n\t\t    };\n\n\t\t    Heap.prototype.pushpop = function(x) {\n\t\t      return heappushpop(this.nodes, x, this.cmp);\n\t\t    };\n\n\t\t    Heap.prototype.heapify = function() {\n\t\t      return heapify(this.nodes, this.cmp);\n\t\t    };\n\n\t\t    Heap.prototype.updateItem = function(x) {\n\t\t      return updateItem(this.nodes, x, this.cmp);\n\t\t    };\n\n\t\t    Heap.prototype.clear = function() {\n\t\t      return this.nodes = [];\n\t\t    };\n\n\t\t    Heap.prototype.empty = function() {\n\t\t      return this.nodes.length === 0;\n\t\t    };\n\n\t\t    Heap.prototype.size = function() {\n\t\t      return this.nodes.length;\n\t\t    };\n\n\t\t    Heap.prototype.clone = function() {\n\t\t      var heap;\n\t\t      heap = new Heap();\n\t\t      heap.nodes = this.nodes.slice(0);\n\t\t      return heap;\n\t\t    };\n\n\t\t    Heap.prototype.toArray = function() {\n\t\t      return this.nodes.slice(0);\n\t\t    };\n\n\t\t    Heap.prototype.insert = Heap.prototype.push;\n\n\t\t    Heap.prototype.top = Heap.prototype.peek;\n\n\t\t    Heap.prototype.front = Heap.prototype.peek;\n\n\t\t    Heap.prototype.has = Heap.prototype.contains;\n\n\t\t    Heap.prototype.copy = Heap.prototype.clone;\n\n\t\t    return Heap;\n\n\t\t  })();\n\n\t\t  (function(root, factory) {\n\t\t    {\n\t\t      return module.exports = factory();\n\t\t    }\n\t\t  })(this, function() {\n\t\t    return Heap;\n\t\t  });\n\n\t\t}).call(heap$1); \n\t} (heap$2));\n\treturn heap$2.exports;\n}\n\nvar heap;\nvar hasRequiredHeap;\n\nfunction requireHeap () {\n\tif (hasRequiredHeap) return heap;\n\thasRequiredHeap = 1;\n\theap = requireHeap$1();\n\treturn heap;\n}\n\nvar heapExports = requireHeap();\nvar Heap = /*@__PURE__*/getDefaultExportFromCjs(heapExports);\n\nvar dijkstraDefaults = defaults$g({\n  root: null,\n  weight: function weight(edge) {\n    return 1;\n  },\n  directed: false\n});\nvar elesfn$u = {\n  dijkstra: function dijkstra(options) {\n    if (!plainObject(options)) {\n      var args = arguments;\n      options = {\n        root: args[0],\n        weight: args[1],\n        directed: args[2]\n      };\n    }\n    var _dijkstraDefaults = dijkstraDefaults(options),\n      root = _dijkstraDefaults.root,\n      weight = _dijkstraDefaults.weight,\n      directed = _dijkstraDefaults.directed;\n    var eles = this;\n    var weightFn = weight;\n    var source = string(root) ? this.filter(root)[0] : root[0];\n    var dist = {};\n    var prev = {};\n    var knownDist = {};\n    var _this$byGroup = this.byGroup(),\n      nodes = _this$byGroup.nodes,\n      edges = _this$byGroup.edges;\n    edges.unmergeBy(function (ele) {\n      return ele.isLoop();\n    });\n    var getDist = function getDist(node) {\n      return dist[node.id()];\n    };\n    var setDist = function setDist(node, d) {\n      dist[node.id()] = d;\n      Q.updateItem(node);\n    };\n    var Q = new Heap(function (a, b) {\n      return getDist(a) - getDist(b);\n    });\n    for (var i = 0; i < nodes.length; i++) {\n      var node = nodes[i];\n      dist[node.id()] = node.same(source) ? 0 : Infinity;\n      Q.push(node);\n    }\n    var distBetween = function distBetween(u, v) {\n      var uvs = (directed ? u.edgesTo(v) : u.edgesWith(v)).intersect(edges);\n      var smallestDistance = Infinity;\n      var smallestEdge;\n      for (var _i = 0; _i < uvs.length; _i++) {\n        var edge = uvs[_i];\n        var _weight = weightFn(edge);\n        if (_weight < smallestDistance || !smallestEdge) {\n          smallestDistance = _weight;\n          smallestEdge = edge;\n        }\n      }\n      return {\n        edge: smallestEdge,\n        dist: smallestDistance\n      };\n    };\n    while (Q.size() > 0) {\n      var u = Q.pop();\n      var smalletsDist = getDist(u);\n      var uid = u.id();\n      knownDist[uid] = smalletsDist;\n      if (smalletsDist === Infinity) {\n        continue;\n      }\n      var neighbors = u.neighborhood().intersect(nodes);\n      for (var _i2 = 0; _i2 < neighbors.length; _i2++) {\n        var v = neighbors[_i2];\n        var vid = v.id();\n        var vDist = distBetween(u, v);\n        var alt = smalletsDist + vDist.dist;\n        if (alt < getDist(v)) {\n          setDist(v, alt);\n          prev[vid] = {\n            node: u,\n            edge: vDist.edge\n          };\n        }\n      } // for\n    } // while\n\n    return {\n      distanceTo: function distanceTo(node) {\n        var target = string(node) ? nodes.filter(node)[0] : node[0];\n        return knownDist[target.id()];\n      },\n      pathTo: function pathTo(node) {\n        var target = string(node) ? nodes.filter(node)[0] : node[0];\n        var S = [];\n        var u = target;\n        var uid = u.id();\n        if (target.length > 0) {\n          S.unshift(target);\n          while (prev[uid]) {\n            var p = prev[uid];\n            S.unshift(p.edge);\n            S.unshift(p.node);\n            u = p.node;\n            uid = u.id();\n          }\n        }\n        return eles.spawn(S);\n      }\n    };\n  }\n};\n\nvar elesfn$t = {\n  // kruskal's algorithm (finds min spanning tree, assuming undirected graph)\n  // implemented from pseudocode from wikipedia\n  kruskal: function kruskal(weightFn) {\n    weightFn = weightFn || function (edge) {\n      return 1;\n    };\n    var _this$byGroup = this.byGroup(),\n      nodes = _this$byGroup.nodes,\n      edges = _this$byGroup.edges;\n    var numNodes = nodes.length;\n    var forest = new Array(numNodes);\n    var A = nodes; // assumes byGroup() creates new collections that can be safely mutated\n\n    var findSetIndex = function findSetIndex(ele) {\n      for (var i = 0; i < forest.length; i++) {\n        var eles = forest[i];\n        if (eles.has(ele)) {\n          return i;\n        }\n      }\n    };\n\n    // start with one forest per node\n    for (var i = 0; i < numNodes; i++) {\n      forest[i] = this.spawn(nodes[i]);\n    }\n    var S = edges.sort(function (a, b) {\n      return weightFn(a) - weightFn(b);\n    });\n    for (var _i = 0; _i < S.length; _i++) {\n      var edge = S[_i];\n      var u = edge.source()[0];\n      var v = edge.target()[0];\n      var setUIndex = findSetIndex(u);\n      var setVIndex = findSetIndex(v);\n      var setU = forest[setUIndex];\n      var setV = forest[setVIndex];\n      if (setUIndex !== setVIndex) {\n        A.merge(edge);\n\n        // combine forests for u and v\n        setU.merge(setV);\n        forest.splice(setVIndex, 1);\n      }\n    }\n    return A;\n  }\n};\n\nvar aStarDefaults = defaults$g({\n  root: null,\n  goal: null,\n  weight: function weight(edge) {\n    return 1;\n  },\n  heuristic: function heuristic(edge) {\n    return 0;\n  },\n  directed: false\n});\nvar elesfn$s = {\n  // Implemented from pseudocode from wikipedia\n  aStar: function aStar(options) {\n    var cy = this.cy();\n    var _aStarDefaults = aStarDefaults(options),\n      root = _aStarDefaults.root,\n      goal = _aStarDefaults.goal,\n      heuristic = _aStarDefaults.heuristic,\n      directed = _aStarDefaults.directed,\n      weight = _aStarDefaults.weight;\n    root = cy.collection(root)[0];\n    goal = cy.collection(goal)[0];\n    var sid = root.id();\n    var tid = goal.id();\n    var gScore = {};\n    var fScore = {};\n    var closedSetIds = {};\n    var openSet = new Heap(function (a, b) {\n      return fScore[a.id()] - fScore[b.id()];\n    });\n    var openSetIds = new Set$1();\n    var cameFrom = {};\n    var cameFromEdge = {};\n    var addToOpenSet = function addToOpenSet(ele, id) {\n      openSet.push(ele);\n      openSetIds.add(id);\n    };\n    var cMin, cMinId;\n    var popFromOpenSet = function popFromOpenSet() {\n      cMin = openSet.pop();\n      cMinId = cMin.id();\n      openSetIds[\"delete\"](cMinId);\n    };\n    var isInOpenSet = function isInOpenSet(id) {\n      return openSetIds.has(id);\n    };\n    addToOpenSet(root, sid);\n    gScore[sid] = 0;\n    fScore[sid] = heuristic(root);\n\n    // Counter\n    var steps = 0;\n\n    // Main loop\n    while (openSet.size() > 0) {\n      popFromOpenSet();\n      steps++;\n\n      // If we've found our goal, then we are done\n      if (cMinId === tid) {\n        var path = [];\n        var pathNode = goal;\n        var pathNodeId = tid;\n        var pathEdge = cameFromEdge[pathNodeId];\n        for (;;) {\n          path.unshift(pathNode);\n          if (pathEdge != null) {\n            path.unshift(pathEdge);\n          }\n          pathNode = cameFrom[pathNodeId];\n          if (pathNode == null) {\n            break;\n          }\n          pathNodeId = pathNode.id();\n          pathEdge = cameFromEdge[pathNodeId];\n        }\n        return {\n          found: true,\n          distance: gScore[cMinId],\n          path: this.spawn(path),\n          steps: steps\n        };\n      }\n\n      // Add cMin to processed nodes\n      closedSetIds[cMinId] = true;\n\n      // Update scores for neighbors of cMin\n      // Take into account if graph is directed or not\n      var vwEdges = cMin._private.edges;\n      for (var i = 0; i < vwEdges.length; i++) {\n        var e = vwEdges[i];\n\n        // edge must be in set of calling eles\n        if (!this.hasElementWithId(e.id())) {\n          continue;\n        }\n\n        // cMin must be the source of edge if directed\n        if (directed && e.data('source') !== cMinId) {\n          continue;\n        }\n        var wSrc = e.source();\n        var wTgt = e.target();\n        var w = wSrc.id() !== cMinId ? wSrc : wTgt;\n        var wid = w.id();\n\n        // node must be in set of calling eles\n        if (!this.hasElementWithId(wid)) {\n          continue;\n        }\n\n        // if node is in closedSet, ignore it\n        if (closedSetIds[wid]) {\n          continue;\n        }\n\n        // New tentative score for node w\n        var tempScore = gScore[cMinId] + weight(e);\n\n        // Update gScore for node w if:\n        //   w not present in openSet\n        // OR\n        //   tentative gScore is less than previous value\n\n        // w not in openSet\n        if (!isInOpenSet(wid)) {\n          gScore[wid] = tempScore;\n          fScore[wid] = tempScore + heuristic(w);\n          addToOpenSet(w, wid);\n          cameFrom[wid] = cMin;\n          cameFromEdge[wid] = e;\n          continue;\n        }\n\n        // w already in openSet, but with greater gScore\n        if (tempScore < gScore[wid]) {\n          gScore[wid] = tempScore;\n          fScore[wid] = tempScore + heuristic(w);\n          cameFrom[wid] = cMin;\n          cameFromEdge[wid] = e;\n        }\n      } // End of neighbors update\n    } // End of main loop\n\n    // If we've reached here, then we've not reached our goal\n    return {\n      found: false,\n      distance: undefined,\n      path: undefined,\n      steps: steps\n    };\n  }\n}; // elesfn\n\nvar floydWarshallDefaults = defaults$g({\n  weight: function weight(edge) {\n    return 1;\n  },\n  directed: false\n});\nvar elesfn$r = {\n  // Implemented from pseudocode from wikipedia\n  floydWarshall: function floydWarshall(options) {\n    var cy = this.cy();\n    var _floydWarshallDefault = floydWarshallDefaults(options),\n      weight = _floydWarshallDefault.weight,\n      directed = _floydWarshallDefault.directed;\n    var weightFn = weight;\n    var _this$byGroup = this.byGroup(),\n      nodes = _this$byGroup.nodes,\n      edges = _this$byGroup.edges;\n    var N = nodes.length;\n    var Nsq = N * N;\n    var indexOf = function indexOf(node) {\n      return nodes.indexOf(node);\n    };\n    var atIndex = function atIndex(i) {\n      return nodes[i];\n    };\n\n    // Initialize distance matrix\n    var dist = new Array(Nsq);\n    for (var n = 0; n < Nsq; n++) {\n      var j = n % N;\n      var i = (n - j) / N;\n      if (i === j) {\n        dist[n] = 0;\n      } else {\n        dist[n] = Infinity;\n      }\n    }\n\n    // Initialize matrix used for path reconstruction\n    // Initialize distance matrix\n    var next = new Array(Nsq);\n    var edgeNext = new Array(Nsq);\n\n    // Process edges\n    for (var _i = 0; _i < edges.length; _i++) {\n      var edge = edges[_i];\n      var src = edge.source()[0];\n      var tgt = edge.target()[0];\n      if (src === tgt) {\n        continue;\n      } // exclude loops\n\n      var s = indexOf(src);\n      var t = indexOf(tgt);\n      var st = s * N + t; // source to target index\n      var _weight = weightFn(edge);\n\n      // Check if already process another edge between same 2 nodes\n      if (dist[st] > _weight) {\n        dist[st] = _weight;\n        next[st] = t;\n        edgeNext[st] = edge;\n      }\n\n      // If undirected graph, process 'reversed' edge\n      if (!directed) {\n        var ts = t * N + s; // target to source index\n\n        if (!directed && dist[ts] > _weight) {\n          dist[ts] = _weight;\n          next[ts] = s;\n          edgeNext[ts] = edge;\n        }\n      }\n    }\n\n    // Main loop\n    for (var k = 0; k < N; k++) {\n      for (var _i2 = 0; _i2 < N; _i2++) {\n        var ik = _i2 * N + k;\n        for (var _j = 0; _j < N; _j++) {\n          var ij = _i2 * N + _j;\n          var kj = k * N + _j;\n          if (dist[ik] + dist[kj] < dist[ij]) {\n            dist[ij] = dist[ik] + dist[kj];\n            next[ij] = next[ik];\n          }\n        }\n      }\n    }\n    var getArgEle = function getArgEle(ele) {\n      return (string(ele) ? cy.filter(ele) : ele)[0];\n    };\n    var indexOfArgEle = function indexOfArgEle(ele) {\n      return indexOf(getArgEle(ele));\n    };\n    var res = {\n      distance: function distance(from, to) {\n        var i = indexOfArgEle(from);\n        var j = indexOfArgEle(to);\n        return dist[i * N + j];\n      },\n      path: function path(from, to) {\n        var i = indexOfArgEle(from);\n        var j = indexOfArgEle(to);\n        var fromNode = atIndex(i);\n        if (i === j) {\n          return fromNode.collection();\n        }\n        if (next[i * N + j] == null) {\n          return cy.collection();\n        }\n        var path = cy.collection();\n        var prev = i;\n        var edge;\n        path.merge(fromNode);\n        while (i !== j) {\n          prev = i;\n          i = next[i * N + j];\n          edge = edgeNext[prev * N + i];\n          path.merge(edge);\n          path.merge(atIndex(i));\n        }\n        return path;\n      }\n    };\n    return res;\n  } // floydWarshall\n}; // elesfn\n\nvar bellmanFordDefaults = defaults$g({\n  weight: function weight(edge) {\n    return 1;\n  },\n  directed: false,\n  root: null\n});\nvar elesfn$q = {\n  // Implemented from pseudocode from wikipedia\n  bellmanFord: function bellmanFord(options) {\n    var _this = this;\n    var _bellmanFordDefaults = bellmanFordDefaults(options),\n      weight = _bellmanFordDefaults.weight,\n      directed = _bellmanFordDefaults.directed,\n      root = _bellmanFordDefaults.root;\n    var weightFn = weight;\n    var eles = this;\n    var cy = this.cy();\n    var _this$byGroup = this.byGroup(),\n      edges = _this$byGroup.edges,\n      nodes = _this$byGroup.nodes;\n    var numNodes = nodes.length;\n    var infoMap = new Map$1();\n    var hasNegativeWeightCycle = false;\n    var negativeWeightCycles = [];\n    root = cy.collection(root)[0]; // in case selector passed\n\n    edges.unmergeBy(function (edge) {\n      return edge.isLoop();\n    });\n    var numEdges = edges.length;\n    var getInfo = function getInfo(node) {\n      var obj = infoMap.get(node.id());\n      if (!obj) {\n        obj = {};\n        infoMap.set(node.id(), obj);\n      }\n      return obj;\n    };\n    var getNodeFromTo = function getNodeFromTo(to) {\n      return (string(to) ? cy.$(to) : to)[0];\n    };\n    var distanceTo = function distanceTo(to) {\n      return getInfo(getNodeFromTo(to)).dist;\n    };\n    var pathTo = function pathTo(to) {\n      var thisStart = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : root;\n      var end = getNodeFromTo(to);\n      var path = [];\n      var node = end;\n      for (;;) {\n        if (node == null) {\n          return _this.spawn();\n        }\n        var _getInfo = getInfo(node),\n          edge = _getInfo.edge,\n          pred = _getInfo.pred;\n        path.unshift(node[0]);\n        if (node.same(thisStart) && path.length > 0) {\n          break;\n        }\n        if (edge != null) {\n          path.unshift(edge);\n        }\n        node = pred;\n      }\n      return eles.spawn(path);\n    };\n\n    // Initializations { dist, pred, edge }\n    for (var i = 0; i < numNodes; i++) {\n      var node = nodes[i];\n      var info = getInfo(node);\n      if (node.same(root)) {\n        info.dist = 0;\n      } else {\n        info.dist = Infinity;\n      }\n      info.pred = null;\n      info.edge = null;\n    }\n\n    // Edges relaxation\n    var replacedEdge = false;\n    var checkForEdgeReplacement = function checkForEdgeReplacement(node1, node2, edge, info1, info2, weight) {\n      var dist = info1.dist + weight;\n      if (dist < info2.dist && !edge.same(info1.edge)) {\n        info2.dist = dist;\n        info2.pred = node1;\n        info2.edge = edge;\n        replacedEdge = true;\n      }\n    };\n    for (var _i = 1; _i < numNodes; _i++) {\n      replacedEdge = false;\n      for (var e = 0; e < numEdges; e++) {\n        var edge = edges[e];\n        var src = edge.source();\n        var tgt = edge.target();\n        var _weight = weightFn(edge);\n        var srcInfo = getInfo(src);\n        var tgtInfo = getInfo(tgt);\n        checkForEdgeReplacement(src, tgt, edge, srcInfo, tgtInfo, _weight);\n\n        // If undirected graph, we need to take into account the 'reverse' edge\n        if (!directed) {\n          checkForEdgeReplacement(tgt, src, edge, tgtInfo, srcInfo, _weight);\n        }\n      }\n      if (!replacedEdge) {\n        break;\n      }\n    }\n    if (replacedEdge) {\n      // Check for negative weight cycles\n      var negativeWeightCycleIds = [];\n      for (var _e = 0; _e < numEdges; _e++) {\n        var _edge = edges[_e];\n        var _src = _edge.source();\n        var _tgt = _edge.target();\n        var _weight2 = weightFn(_edge);\n        var srcDist = getInfo(_src).dist;\n        var tgtDist = getInfo(_tgt).dist;\n        if (srcDist + _weight2 < tgtDist || !directed && tgtDist + _weight2 < srcDist) {\n          if (!hasNegativeWeightCycle) {\n            warn('Graph contains a negative weight cycle for Bellman-Ford');\n            hasNegativeWeightCycle = true;\n          }\n          if (options.findNegativeWeightCycles !== false) {\n            var negativeNodes = [];\n            if (srcDist + _weight2 < tgtDist) {\n              negativeNodes.push(_src);\n            }\n            if (!directed && tgtDist + _weight2 < srcDist) {\n              negativeNodes.push(_tgt);\n            }\n            var numNegativeNodes = negativeNodes.length;\n            for (var n = 0; n < numNegativeNodes; n++) {\n              var start = negativeNodes[n];\n              var cycle = [start];\n              cycle.push(getInfo(start).edge);\n              var _node = getInfo(start).pred;\n              while (cycle.indexOf(_node) === -1) {\n                cycle.push(_node);\n                cycle.push(getInfo(_node).edge);\n                _node = getInfo(_node).pred;\n              }\n              cycle = cycle.slice(cycle.indexOf(_node));\n              var smallestId = cycle[0].id();\n              var smallestIndex = 0;\n              for (var c = 2; c < cycle.length; c += 2) {\n                if (cycle[c].id() < smallestId) {\n                  smallestId = cycle[c].id();\n                  smallestIndex = c;\n                }\n              }\n              cycle = cycle.slice(smallestIndex).concat(cycle.slice(0, smallestIndex));\n              cycle.push(cycle[0]);\n              var cycleId = cycle.map(function (el) {\n                return el.id();\n              }).join(\",\");\n              if (negativeWeightCycleIds.indexOf(cycleId) === -1) {\n                negativeWeightCycles.push(eles.spawn(cycle));\n                negativeWeightCycleIds.push(cycleId);\n              }\n            }\n          } else {\n            break;\n          }\n        }\n      }\n    }\n    return {\n      distanceTo: distanceTo,\n      pathTo: pathTo,\n      hasNegativeWeightCycle: hasNegativeWeightCycle,\n      negativeWeightCycles: negativeWeightCycles\n    };\n  } // bellmanFord\n}; // elesfn\n\nvar sqrt2 = Math.sqrt(2);\n\n// Function which colapses 2 (meta) nodes into one\n// Updates the remaining edge lists\n// Receives as a paramater the edge which causes the collapse\nvar collapse = function collapse(edgeIndex, nodeMap, remainingEdges) {\n  if (remainingEdges.length === 0) {\n    error(\"Karger-Stein must be run on a connected (sub)graph\");\n  }\n  var edgeInfo = remainingEdges[edgeIndex];\n  var sourceIn = edgeInfo[1];\n  var targetIn = edgeInfo[2];\n  var partition1 = nodeMap[sourceIn];\n  var partition2 = nodeMap[targetIn];\n  var newEdges = remainingEdges; // re-use array\n\n  // Delete all edges between partition1 and partition2\n  for (var i = newEdges.length - 1; i >= 0; i--) {\n    var edge = newEdges[i];\n    var src = edge[1];\n    var tgt = edge[2];\n    if (nodeMap[src] === partition1 && nodeMap[tgt] === partition2 || nodeMap[src] === partition2 && nodeMap[tgt] === partition1) {\n      newEdges.splice(i, 1);\n    }\n  }\n\n  // All edges pointing to partition2 should now point to partition1\n  for (var _i = 0; _i < newEdges.length; _i++) {\n    var _edge = newEdges[_i];\n    if (_edge[1] === partition2) {\n      // Check source\n      newEdges[_i] = _edge.slice(); // copy\n      newEdges[_i][1] = partition1;\n    } else if (_edge[2] === partition2) {\n      // Check target\n      newEdges[_i] = _edge.slice(); // copy\n      newEdges[_i][2] = partition1;\n    }\n  }\n\n  // Move all nodes from partition2 to partition1\n  for (var _i2 = 0; _i2 < nodeMap.length; _i2++) {\n    if (nodeMap[_i2] === partition2) {\n      nodeMap[_i2] = partition1;\n    }\n  }\n  return newEdges;\n};\n\n// Contracts a graph until we reach a certain number of meta nodes\nvar contractUntil = function contractUntil(metaNodeMap, remainingEdges, size, sizeLimit) {\n  while (size > sizeLimit) {\n    // Choose an edge randomly\n    var edgeIndex = Math.floor(Math.random() * remainingEdges.length);\n\n    // Collapse graph based on edge\n    remainingEdges = collapse(edgeIndex, metaNodeMap, remainingEdges);\n    size--;\n  }\n  return remainingEdges;\n};\nvar elesfn$p = {\n  // Computes the minimum cut of an undirected graph\n  // Returns the correct answer with high probability\n  kargerStein: function kargerStein() {\n    var _this = this;\n    var _this$byGroup = this.byGroup(),\n      nodes = _this$byGroup.nodes,\n      edges = _this$byGroup.edges;\n    edges.unmergeBy(function (edge) {\n      return edge.isLoop();\n    });\n    var numNodes = nodes.length;\n    var numEdges = edges.length;\n    var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2));\n    var stopSize = Math.floor(numNodes / sqrt2);\n    if (numNodes < 2) {\n      error('At least 2 nodes are required for Karger-Stein algorithm');\n      return undefined;\n    }\n\n    // Now store edge destination as indexes\n    // Format for each edge (edge index, source node index, target node index)\n    var edgeIndexes = [];\n    for (var i = 0; i < numEdges; i++) {\n      var e = edges[i];\n      edgeIndexes.push([i, nodes.indexOf(e.source()), nodes.indexOf(e.target())]);\n    }\n\n    // We will store the best cut found here\n    var minCutSize = Infinity;\n    var minCutEdgeIndexes = [];\n    var minCutNodeMap = new Array(numNodes);\n\n    // Initial meta node partition\n    var metaNodeMap = new Array(numNodes);\n    var metaNodeMap2 = new Array(numNodes);\n    var copyNodesMap = function copyNodesMap(from, to) {\n      for (var _i3 = 0; _i3 < numNodes; _i3++) {\n        to[_i3] = from[_i3];\n      }\n    };\n\n    // Main loop\n    for (var iter = 0; iter <= numIter; iter++) {\n      // Reset meta node partition\n      for (var _i4 = 0; _i4 < numNodes; _i4++) {\n        metaNodeMap[_i4] = _i4;\n      }\n\n      // Contract until stop point (stopSize nodes)\n      var edgesState = contractUntil(metaNodeMap, edgeIndexes.slice(), numNodes, stopSize);\n      var edgesState2 = edgesState.slice(); // copy\n\n      // Create a copy of the colapsed nodes state\n      copyNodesMap(metaNodeMap, metaNodeMap2);\n\n      // Run 2 iterations starting in the stop state\n      var res1 = contractUntil(metaNodeMap, edgesState, stopSize, 2);\n      var res2 = contractUntil(metaNodeMap2, edgesState2, stopSize, 2);\n\n      // Is any of the 2 results the best cut so far?\n      if (res1.length <= res2.length && res1.length < minCutSize) {\n        minCutSize = res1.length;\n        minCutEdgeIndexes = res1;\n        copyNodesMap(metaNodeMap, minCutNodeMap);\n      } else if (res2.length <= res1.length && res2.length < minCutSize) {\n        minCutSize = res2.length;\n        minCutEdgeIndexes = res2;\n        copyNodesMap(metaNodeMap2, minCutNodeMap);\n      }\n    } // end of main loop\n\n    // Construct result\n    var cut = this.spawn(minCutEdgeIndexes.map(function (e) {\n      return edges[e[0]];\n    }));\n    var partition1 = this.spawn();\n    var partition2 = this.spawn();\n\n    // traverse metaNodeMap for best cut\n    var witnessNodePartition = minCutNodeMap[0];\n    for (var _i5 = 0; _i5 < minCutNodeMap.length; _i5++) {\n      var partitionId = minCutNodeMap[_i5];\n      var node = nodes[_i5];\n      if (partitionId === witnessNodePartition) {\n        partition1.merge(node);\n      } else {\n        partition2.merge(node);\n      }\n    }\n\n    // construct components corresponding to each disjoint subset of nodes\n    var constructComponent = function constructComponent(subset) {\n      var component = _this.spawn();\n      subset.forEach(function (node) {\n        component.merge(node);\n        node.connectedEdges().forEach(function (edge) {\n          // ensure edge is within calling collection and edge is not in cut\n          if (_this.contains(edge) && !cut.contains(edge)) {\n            component.merge(edge);\n          }\n        });\n      });\n      return component;\n    };\n    var components = [constructComponent(partition1), constructComponent(partition2)];\n    var ret = {\n      cut: cut,\n      components: components,\n      // n.b. partitions are included to be compatible with the old api spec\n      // (could be removed in a future major version)\n      partition1: partition1,\n      partition2: partition2\n    };\n    return ret;\n  }\n}; // elesfn\n\nvar _Math$hypot;\nvar copyPosition = function copyPosition(p) {\n  return {\n    x: p.x,\n    y: p.y\n  };\n};\nvar modelToRenderedPosition$1 = function modelToRenderedPosition(p, zoom, pan) {\n  return {\n    x: p.x * zoom + pan.x,\n    y: p.y * zoom + pan.y\n  };\n};\nvar renderedToModelPosition = function renderedToModelPosition(p, zoom, pan) {\n  return {\n    x: (p.x - pan.x) / zoom,\n    y: (p.y - pan.y) / zoom\n  };\n};\nvar array2point = function array2point(arr) {\n  return {\n    x: arr[0],\n    y: arr[1]\n  };\n};\nvar min = function min(arr) {\n  var begin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : arr.length;\n  var min = Infinity;\n  for (var i = begin; i < end; i++) {\n    var val = arr[i];\n    if (isFinite(val)) {\n      min = Math.min(val, min);\n    }\n  }\n  return min;\n};\nvar max = function max(arr) {\n  var begin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : arr.length;\n  var max = -Infinity;\n  for (var i = begin; i < end; i++) {\n    var val = arr[i];\n    if (isFinite(val)) {\n      max = Math.max(val, max);\n    }\n  }\n  return max;\n};\nvar mean = function mean(arr) {\n  var begin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : arr.length;\n  var total = 0;\n  var n = 0;\n  for (var i = begin; i < end; i++) {\n    var val = arr[i];\n    if (isFinite(val)) {\n      total += val;\n      n++;\n    }\n  }\n  return total / n;\n};\nvar median = function median(arr) {\n  var begin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : arr.length;\n  var copy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n  var sort = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n  var includeHoles = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n  if (copy) {\n    arr = arr.slice(begin, end);\n  } else {\n    if (end < arr.length) {\n      arr.splice(end, arr.length - end);\n    }\n    if (begin > 0) {\n      arr.splice(0, begin);\n    }\n  }\n\n  // all non finite (e.g. Infinity, NaN) elements must be -Infinity so they go to the start\n  var off = 0; // offset from non-finite values\n  for (var i = arr.length - 1; i >= 0; i--) {\n    var v = arr[i];\n    if (includeHoles) {\n      if (!isFinite(v)) {\n        arr[i] = -Infinity;\n        off++;\n      }\n    } else {\n      // just remove it if we don't want to consider holes\n      arr.splice(i, 1);\n    }\n  }\n  if (sort) {\n    arr.sort(function (a, b) {\n      return a - b;\n    }); // requires copy = true if you don't want to change the orig\n  }\n  var len = arr.length;\n  var mid = Math.floor(len / 2);\n  if (len % 2 !== 0) {\n    return arr[mid + 1 + off];\n  } else {\n    return (arr[mid - 1 + off] + arr[mid + off]) / 2;\n  }\n};\nvar deg2rad = function deg2rad(deg) {\n  return Math.PI * deg / 180;\n};\nvar getAngleFromDisp = function getAngleFromDisp(dispX, dispY) {\n  return Math.atan2(dispY, dispX) - Math.PI / 2;\n};\nvar log2 = Math.log2 || function (n) {\n  return Math.log(n) / Math.log(2);\n};\nvar signum = function signum(x) {\n  if (x > 0) {\n    return 1;\n  } else if (x < 0) {\n    return -1;\n  } else {\n    return 0;\n  }\n};\nvar dist = function dist(p1, p2) {\n  return Math.sqrt(sqdist(p1, p2));\n};\nvar sqdist = function sqdist(p1, p2) {\n  var dx = p2.x - p1.x;\n  var dy = p2.y - p1.y;\n  return dx * dx + dy * dy;\n};\nvar inPlaceSumNormalize = function inPlaceSumNormalize(v) {\n  var length = v.length;\n\n  // First, get sum of all elements\n  var total = 0;\n  for (var i = 0; i < length; i++) {\n    total += v[i];\n  }\n\n  // Now, divide each by the sum of all elements\n  for (var _i = 0; _i < length; _i++) {\n    v[_i] = v[_i] / total;\n  }\n  return v;\n};\n\n// from http://en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves\nvar qbezierAt = function qbezierAt(p0, p1, p2, t) {\n  return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2;\n};\nvar qbezierPtAt = function qbezierPtAt(p0, p1, p2, t) {\n  return {\n    x: qbezierAt(p0.x, p1.x, p2.x, t),\n    y: qbezierAt(p0.y, p1.y, p2.y, t)\n  };\n};\nvar lineAt = function lineAt(p0, p1, t, d) {\n  var vec = {\n    x: p1.x - p0.x,\n    y: p1.y - p0.y\n  };\n  var vecDist = dist(p0, p1);\n  var normVec = {\n    x: vec.x / vecDist,\n    y: vec.y / vecDist\n  };\n  t = t == null ? 0 : t;\n  d = d != null ? d : t * vecDist;\n  return {\n    x: p0.x + normVec.x * d,\n    y: p0.y + normVec.y * d\n  };\n};\nvar bound = function bound(min, val, max) {\n  return Math.max(min, Math.min(max, val));\n};\n\n// makes a full bb (x1, y1, x2, y2, w, h) from implicit params\nvar makeBoundingBox = function makeBoundingBox(bb) {\n  if (bb == null) {\n    return {\n      x1: Infinity,\n      y1: Infinity,\n      x2: -Infinity,\n      y2: -Infinity,\n      w: 0,\n      h: 0\n    };\n  } else if (bb.x1 != null && bb.y1 != null) {\n    if (bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1) {\n      return {\n        x1: bb.x1,\n        y1: bb.y1,\n        x2: bb.x2,\n        y2: bb.y2,\n        w: bb.x2 - bb.x1,\n        h: bb.y2 - bb.y1\n      };\n    } else if (bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0) {\n      return {\n        x1: bb.x1,\n        y1: bb.y1,\n        x2: bb.x1 + bb.w,\n        y2: bb.y1 + bb.h,\n        w: bb.w,\n        h: bb.h\n      };\n    }\n  }\n};\nvar copyBoundingBox = function copyBoundingBox(bb) {\n  return {\n    x1: bb.x1,\n    x2: bb.x2,\n    w: bb.w,\n    y1: bb.y1,\n    y2: bb.y2,\n    h: bb.h\n  };\n};\nvar clearBoundingBox = function clearBoundingBox(bb) {\n  bb.x1 = Infinity;\n  bb.y1 = Infinity;\n  bb.x2 = -Infinity;\n  bb.y2 = -Infinity;\n  bb.w = 0;\n  bb.h = 0;\n};\nvar updateBoundingBox = function updateBoundingBox(bb1, bb2) {\n  // update bb1 with bb2 bounds\n\n  bb1.x1 = Math.min(bb1.x1, bb2.x1);\n  bb1.x2 = Math.max(bb1.x2, bb2.x2);\n  bb1.w = bb1.x2 - bb1.x1;\n  bb1.y1 = Math.min(bb1.y1, bb2.y1);\n  bb1.y2 = Math.max(bb1.y2, bb2.y2);\n  bb1.h = bb1.y2 - bb1.y1;\n};\nvar expandBoundingBoxByPoint = function expandBoundingBoxByPoint(bb, x, y) {\n  bb.x1 = Math.min(bb.x1, x);\n  bb.x2 = Math.max(bb.x2, x);\n  bb.w = bb.x2 - bb.x1;\n  bb.y1 = Math.min(bb.y1, y);\n  bb.y2 = Math.max(bb.y2, y);\n  bb.h = bb.y2 - bb.y1;\n};\nvar expandBoundingBox = function expandBoundingBox(bb) {\n  var padding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  bb.x1 -= padding;\n  bb.x2 += padding;\n  bb.y1 -= padding;\n  bb.y2 += padding;\n  bb.w = bb.x2 - bb.x1;\n  bb.h = bb.y2 - bb.y1;\n  return bb;\n};\nvar expandBoundingBoxSides = function expandBoundingBoxSides(bb) {\n  var padding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0];\n  var top, right, bottom, left;\n  if (padding.length === 1) {\n    top = right = bottom = left = padding[0];\n  } else if (padding.length === 2) {\n    top = bottom = padding[0];\n    left = right = padding[1];\n  } else if (padding.length === 4) {\n    var _padding = _slicedToArray(padding, 4);\n    top = _padding[0];\n    right = _padding[1];\n    bottom = _padding[2];\n    left = _padding[3];\n  }\n  bb.x1 -= left;\n  bb.x2 += right;\n  bb.y1 -= top;\n  bb.y2 += bottom;\n  bb.w = bb.x2 - bb.x1;\n  bb.h = bb.y2 - bb.y1;\n  return bb;\n};\n\n// assign the values of bb2 into bb1\nvar assignBoundingBox = function assignBoundingBox(bb1, bb2) {\n  bb1.x1 = bb2.x1;\n  bb1.y1 = bb2.y1;\n  bb1.x2 = bb2.x2;\n  bb1.y2 = bb2.y2;\n  bb1.w = bb1.x2 - bb1.x1;\n  bb1.h = bb1.y2 - bb1.y1;\n};\nvar boundingBoxesIntersect = function boundingBoxesIntersect(bb1, bb2) {\n  // case: one bb to right of other\n  if (bb1.x1 > bb2.x2) {\n    return false;\n  }\n  if (bb2.x1 > bb1.x2) {\n    return false;\n  }\n\n  // case: one bb to left of other\n  if (bb1.x2 < bb2.x1) {\n    return false;\n  }\n  if (bb2.x2 < bb1.x1) {\n    return false;\n  }\n\n  // case: one bb above other\n  if (bb1.y2 < bb2.y1) {\n    return false;\n  }\n  if (bb2.y2 < bb1.y1) {\n    return false;\n  }\n\n  // case: one bb below other\n  if (bb1.y1 > bb2.y2) {\n    return false;\n  }\n  if (bb2.y1 > bb1.y2) {\n    return false;\n  }\n\n  // otherwise, must have some overlap\n  return true;\n};\nvar inBoundingBox = function inBoundingBox(bb, x, y) {\n  return bb.x1 <= x && x <= bb.x2 && bb.y1 <= y && y <= bb.y2;\n};\nvar pointInBoundingBox = function pointInBoundingBox(bb, pt) {\n  return inBoundingBox(bb, pt.x, pt.y);\n};\nvar boundingBoxInBoundingBox = function boundingBoxInBoundingBox(bb1, bb2) {\n  return inBoundingBox(bb1, bb2.x1, bb2.y1) && inBoundingBox(bb1, bb2.x2, bb2.y2);\n};\nvar hypot = (_Math$hypot = Math.hypot) !== null && _Math$hypot !== undefined ? _Math$hypot : function (x, y) {\n  return Math.sqrt(x * x + y * y);\n};\nfunction inflatePolygon(polygon, d) {\n  if (polygon.length < 3) {\n    throw new Error('Need at least 3 vertices');\n  }\n  // Helpers\n  var add = function add(a, b) {\n    return {\n      x: a.x + b.x,\n      y: a.y + b.y\n    };\n  };\n  var sub = function sub(a, b) {\n    return {\n      x: a.x - b.x,\n      y: a.y - b.y\n    };\n  };\n  var scale = function scale(v, s) {\n    return {\n      x: v.x * s,\n      y: v.y * s\n    };\n  };\n  var cross = function cross(u, v) {\n    return u.x * v.y - u.y * v.x;\n  };\n  var normalize = function normalize(v) {\n    var len = hypot(v.x, v.y);\n    return len === 0 ? {\n      x: 0,\n      y: 0\n    } : {\n      x: v.x / len,\n      y: v.y / len\n    };\n  };\n  // Signed area (positive = CCW)\n  var signedArea = function signedArea(pts) {\n    var A = 0;\n    for (var i = 0; i < pts.length; i++) {\n      var p = pts[i],\n        q = pts[(i + 1) % pts.length];\n      A += p.x * q.y - q.x * p.y;\n    }\n    return A / 2;\n  };\n  // Line–line intersection (infinite lines)\n  var intersectLines = function intersectLines(p1, p2, p3, p4) {\n    var r = sub(p2, p1);\n    var s = sub(p4, p3);\n    var denom = cross(r, s);\n    if (Math.abs(denom) < 1e-9) {\n      // Parallel or nearly so — fallback to midpoint\n      return add(p1, scale(r, 0.5));\n    }\n    var t = cross(sub(p3, p1), s) / denom;\n    return add(p1, scale(r, t));\n  };\n\n  // Make a shallow copy and enforce CCW\n  var pts = polygon.map(function (p) {\n    return {\n      x: p.x,\n      y: p.y\n    };\n  });\n  if (signedArea(pts) < 0) pts.reverse();\n  var n = pts.length;\n  // Compute outward normals for each edge\n  var normals = [];\n  for (var i = 0; i < n; i++) {\n    var p = pts[i],\n      q = pts[(i + 1) % n];\n    var edge = sub(q, p);\n    // For CCW polygon, inward normal = (-edge.y, edge.x)\n    // so outward normal = (edge.y, -edge.x)\n    var out = normalize({\n      x: edge.y,\n      y: -edge.x\n    });\n    normals.push(out);\n  }\n\n  // Build offset edges\n  var offsetEdges = normals.map(function (nrm, i) {\n    var p1 = add(pts[i], scale(nrm, d));\n    var p2 = add(pts[(i + 1) % n], scale(nrm, d));\n    return {\n      p1: p1,\n      p2: p2\n    };\n  });\n\n  // Intersect consecutive offset edges\n  var inflated = [];\n  for (var _i2 = 0; _i2 < n; _i2++) {\n    var prevEdge = offsetEdges[(_i2 - 1 + n) % n];\n    var currEdge = offsetEdges[_i2];\n    var ip = intersectLines(prevEdge.p1, prevEdge.p2, currEdge.p1, currEdge.p2);\n    inflated.push(ip);\n  }\n  return inflated;\n}\nfunction miterBox(pts, centerX, centerY, width, height, strokeWidth) {\n  var tpts = transformPoints(pts, centerX, centerY, width, height);\n  var offsetPoints = inflatePolygon(tpts, strokeWidth);\n  var bb = makeBoundingBox();\n  offsetPoints.forEach(function (pt) {\n    return expandBoundingBoxByPoint(bb, pt.x, pt.y);\n  });\n  return bb;\n}\nvar roundRectangleIntersectLine = function roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding) {\n  var radius = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'auto';\n  var cornerRadius = radius === 'auto' ? getRoundRectangleRadius(width, height) : radius;\n  var halfWidth = width / 2;\n  var halfHeight = height / 2;\n  cornerRadius = Math.min(cornerRadius, halfWidth, halfHeight);\n  var doWidth = cornerRadius !== halfWidth,\n    doHeight = cornerRadius !== halfHeight;\n\n  // Check intersections with straight line segments\n  var straightLineIntersections;\n\n  // Top segment, left to right\n  if (doWidth) {\n    var topStartX = nodeX - halfWidth + cornerRadius - padding;\n    var topStartY = nodeY - halfHeight - padding;\n    var topEndX = nodeX + halfWidth - cornerRadius + padding;\n    var topEndY = topStartY;\n    straightLineIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false);\n    if (straightLineIntersections.length > 0) {\n      return straightLineIntersections;\n    }\n  }\n\n  // Right segment, top to bottom\n  if (doHeight) {\n    var rightStartX = nodeX + halfWidth + padding;\n    var rightStartY = nodeY - halfHeight + cornerRadius - padding;\n    var rightEndX = rightStartX;\n    var rightEndY = nodeY + halfHeight - cornerRadius + padding;\n    straightLineIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false);\n    if (straightLineIntersections.length > 0) {\n      return straightLineIntersections;\n    }\n  }\n\n  // Bottom segment, left to right\n  if (doWidth) {\n    var bottomStartX = nodeX - halfWidth + cornerRadius - padding;\n    var bottomStartY = nodeY + halfHeight + padding;\n    var bottomEndX = nodeX + halfWidth - cornerRadius + padding;\n    var bottomEndY = bottomStartY;\n    straightLineIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false);\n    if (straightLineIntersections.length > 0) {\n      return straightLineIntersections;\n    }\n  }\n\n  // Left segment, top to bottom\n  if (doHeight) {\n    var leftStartX = nodeX - halfWidth - padding;\n    var leftStartY = nodeY - halfHeight + cornerRadius - padding;\n    var leftEndX = leftStartX;\n    var leftEndY = nodeY + halfHeight - cornerRadius + padding;\n    straightLineIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false);\n    if (straightLineIntersections.length > 0) {\n      return straightLineIntersections;\n    }\n  }\n\n  // Check intersections with arc segments\n  var arcIntersections;\n\n  // Top Left\n  {\n    var topLeftCenterX = nodeX - halfWidth + cornerRadius;\n    var topLeftCenterY = nodeY - halfHeight + cornerRadius;\n    arcIntersections = intersectLineCircle(x, y, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding);\n\n    // Ensure the intersection is on the desired quarter of the circle\n    if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) {\n      return [arcIntersections[0], arcIntersections[1]];\n    }\n  }\n\n  // Top Right\n  {\n    var topRightCenterX = nodeX + halfWidth - cornerRadius;\n    var topRightCenterY = nodeY - halfHeight + cornerRadius;\n    arcIntersections = intersectLineCircle(x, y, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding);\n\n    // Ensure the intersection is on the desired quarter of the circle\n    if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) {\n      return [arcIntersections[0], arcIntersections[1]];\n    }\n  }\n\n  // Bottom Right\n  {\n    var bottomRightCenterX = nodeX + halfWidth - cornerRadius;\n    var bottomRightCenterY = nodeY + halfHeight - cornerRadius;\n    arcIntersections = intersectLineCircle(x, y, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding);\n\n    // Ensure the intersection is on the desired quarter of the circle\n    if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) {\n      return [arcIntersections[0], arcIntersections[1]];\n    }\n  }\n\n  // Bottom Left\n  {\n    var bottomLeftCenterX = nodeX - halfWidth + cornerRadius;\n    var bottomLeftCenterY = nodeY + halfHeight - cornerRadius;\n    arcIntersections = intersectLineCircle(x, y, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding);\n\n    // Ensure the intersection is on the desired quarter of the circle\n    if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) {\n      return [arcIntersections[0], arcIntersections[1]];\n    }\n  }\n  return []; // if nothing\n};\nvar inLineVicinity = function inLineVicinity(x, y, lx1, ly1, lx2, ly2, tolerance) {\n  var t = tolerance;\n  var x1 = Math.min(lx1, lx2);\n  var x2 = Math.max(lx1, lx2);\n  var y1 = Math.min(ly1, ly2);\n  var y2 = Math.max(ly1, ly2);\n  return x1 - t <= x && x <= x2 + t && y1 - t <= y && y <= y2 + t;\n};\nvar inBezierVicinity = function inBezierVicinity(x, y, x1, y1, x2, y2, x3, y3, tolerance) {\n  var bb = {\n    x1: Math.min(x1, x3, x2) - tolerance,\n    x2: Math.max(x1, x3, x2) + tolerance,\n    y1: Math.min(y1, y3, y2) - tolerance,\n    y2: Math.max(y1, y3, y2) + tolerance\n  };\n\n  // if outside the rough bounding box for the bezier, then it can't be a hit\n  if (x < bb.x1 || x > bb.x2 || y < bb.y1 || y > bb.y2) {\n    // console.log('bezier out of rough bb')\n    return false;\n  } else {\n    // console.log('do more expensive check');\n    return true;\n  }\n};\nvar solveQuadratic = function solveQuadratic(a, b, c, val) {\n  c -= val;\n  var r = b * b - 4 * a * c;\n  if (r < 0) {\n    return [];\n  }\n  var sqrtR = Math.sqrt(r);\n  var denom = 2 * a;\n  var root1 = (-b + sqrtR) / denom;\n  var root2 = (-b - sqrtR) / denom;\n  return [root1, root2];\n};\nvar solveCubic = function solveCubic(a, b, c, d, result) {\n  // Solves a cubic function, returns root in form [r1, i1, r2, i2, r3, i3], where\n  // r is the real component, i is the imaginary component\n\n  // An implementation of the Cardano method from the year 1545\n  // http://en.wikipedia.org/wiki/Cubic_function#The_nature_of_the_roots\n\n  var epsilon = 0.00001;\n\n  // avoid division by zero while keeping the overall expression close in value\n  if (a === 0) {\n    a = epsilon;\n  }\n  b /= a;\n  c /= a;\n  d /= a;\n  var discriminant, q, r, dum1, s, t, term1, r13;\n  q = (3.0 * c - b * b) / 9.0;\n  r = -(27.0 * d) + b * (9.0 * c - 2.0 * (b * b));\n  r /= 54.0;\n  discriminant = q * q * q + r * r;\n  result[1] = 0;\n  term1 = b / 3.0;\n  if (discriminant > 0) {\n    s = r + Math.sqrt(discriminant);\n    s = s < 0 ? -Math.pow(-s, 1.0 / 3.0) : Math.pow(s, 1.0 / 3.0);\n    t = r - Math.sqrt(discriminant);\n    t = t < 0 ? -Math.pow(-t, 1.0 / 3.0) : Math.pow(t, 1.0 / 3.0);\n    result[0] = -term1 + s + t;\n    term1 += (s + t) / 2.0;\n    result[4] = result[2] = -term1;\n    term1 = Math.sqrt(3.0) * (-t + s) / 2;\n    result[3] = term1;\n    result[5] = -term1;\n    return;\n  }\n  result[5] = result[3] = 0;\n  if (discriminant === 0) {\n    r13 = r < 0 ? -Math.pow(-r, 1.0 / 3.0) : Math.pow(r, 1.0 / 3.0);\n    result[0] = -term1 + 2.0 * r13;\n    result[4] = result[2] = -(r13 + term1);\n    return;\n  }\n  q = -q;\n  dum1 = q * q * q;\n  dum1 = Math.acos(r / Math.sqrt(dum1));\n  r13 = 2.0 * Math.sqrt(q);\n  result[0] = -term1 + r13 * Math.cos(dum1 / 3.0);\n  result[2] = -term1 + r13 * Math.cos((dum1 + 2.0 * Math.PI) / 3.0);\n  result[4] = -term1 + r13 * Math.cos((dum1 + 4.0 * Math.PI) / 3.0);\n  return;\n};\nvar sqdistToQuadraticBezier = function sqdistToQuadraticBezier(x, y, x1, y1, x2, y2, x3, y3) {\n  // Find minimum distance by using the minimum of the distance\n  // function between the given point and the curve\n\n  // This gives the coefficients of the resulting cubic equation\n  // whose roots tell us where a possible minimum is\n  // (Coefficients are divided by 4)\n\n  var a = 1.0 * x1 * x1 - 4 * x1 * x2 + 2 * x1 * x3 + 4 * x2 * x2 - 4 * x2 * x3 + x3 * x3 + y1 * y1 - 4 * y1 * y2 + 2 * y1 * y3 + 4 * y2 * y2 - 4 * y2 * y3 + y3 * y3;\n  var b = 1.0 * 9 * x1 * x2 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x2 * x2 + 3 * x2 * x3 + 9 * y1 * y2 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y2 * y2 + 3 * y2 * y3;\n  var c = 1.0 * 3 * x1 * x1 - 6 * x1 * x2 + x1 * x3 - x1 * x + 2 * x2 * x2 + 2 * x2 * x - x3 * x + 3 * y1 * y1 - 6 * y1 * y2 + y1 * y3 - y1 * y + 2 * y2 * y2 + 2 * y2 * y - y3 * y;\n  var d = 1.0 * x1 * x2 - x1 * x1 + x1 * x - x2 * x + y1 * y2 - y1 * y1 + y1 * y - y2 * y;\n\n  // debug(\"coefficients: \" + a / a + \", \" + b / a + \", \" + c / a + \", \" + d / a);\n\n  var roots = [];\n\n  // Use the cubic solving algorithm\n  solveCubic(a, b, c, d, roots);\n  var zeroThreshold = 0.0000001;\n  var params = [];\n  for (var index = 0; index < 6; index += 2) {\n    if (Math.abs(roots[index + 1]) < zeroThreshold && roots[index] >= 0 && roots[index] <= 1.0) {\n      params.push(roots[index]);\n    }\n  }\n  params.push(1.0);\n  params.push(0.0);\n  var minDistanceSquared = -1;\n  var curX, curY, distSquared;\n  for (var i = 0; i < params.length; i++) {\n    curX = Math.pow(1.0 - params[i], 2.0) * x1 + 2.0 * (1 - params[i]) * params[i] * x2 + params[i] * params[i] * x3;\n    curY = Math.pow(1 - params[i], 2.0) * y1 + 2 * (1.0 - params[i]) * params[i] * y2 + params[i] * params[i] * y3;\n    distSquared = Math.pow(curX - x, 2) + Math.pow(curY - y, 2);\n    // debug('distance for param ' + params[i] + \": \" + Math.sqrt(distSquared));\n    if (minDistanceSquared >= 0) {\n      if (distSquared < minDistanceSquared) {\n        minDistanceSquared = distSquared;\n      }\n    } else {\n      minDistanceSquared = distSquared;\n    }\n  }\n  return minDistanceSquared;\n};\nvar sqdistToFiniteLine = function sqdistToFiniteLine(x, y, x1, y1, x2, y2) {\n  var offset = [x - x1, y - y1];\n  var line = [x2 - x1, y2 - y1];\n  var lineSq = line[0] * line[0] + line[1] * line[1];\n  var hypSq = offset[0] * offset[0] + offset[1] * offset[1];\n  var dotProduct = offset[0] * line[0] + offset[1] * line[1];\n  var adjSq = dotProduct * dotProduct / lineSq;\n  if (dotProduct < 0) {\n    return hypSq;\n  }\n  if (adjSq > lineSq) {\n    return (x - x2) * (x - x2) + (y - y2) * (y - y2);\n  }\n  return hypSq - adjSq;\n};\nvar pointInsidePolygonPoints = function pointInsidePolygonPoints(x, y, points) {\n  var x1, y1, x2, y2;\n  var y3;\n\n  // Intersect with vertical line through (x, y)\n  var up = 0;\n  // let down = 0;\n  for (var i = 0; i < points.length / 2; i++) {\n    x1 = points[i * 2];\n    y1 = points[i * 2 + 1];\n    if (i + 1 < points.length / 2) {\n      x2 = points[(i + 1) * 2];\n      y2 = points[(i + 1) * 2 + 1];\n    } else {\n      x2 = points[(i + 1 - points.length / 2) * 2];\n      y2 = points[(i + 1 - points.length / 2) * 2 + 1];\n    }\n    if (x1 == x && x2 == x) ; else if (x1 >= x && x >= x2 || x1 <= x && x <= x2) {\n      y3 = (x - x1) / (x2 - x1) * (y2 - y1) + y1;\n      if (y3 > y) {\n        up++;\n      }\n\n      // if( y3 < y ){\n      // down++;\n      // }\n    } else {\n      continue;\n    }\n  }\n  if (up % 2 === 0) {\n    return false;\n  } else {\n    return true;\n  }\n};\nvar pointInsidePolygon = function pointInsidePolygon(x, y, basePoints, centerX, centerY, width, height, direction, padding) {\n  var transformedPoints = new Array(basePoints.length);\n\n  // Gives negative angle\n  var angle;\n  if (direction[0] != null) {\n    angle = Math.atan(direction[1] / direction[0]);\n    if (direction[0] < 0) {\n      angle = angle + Math.PI / 2;\n    } else {\n      angle = -angle - Math.PI / 2;\n    }\n  } else {\n    angle = direction;\n  }\n  var cos = Math.cos(-angle);\n  var sin = Math.sin(-angle);\n\n  //    console.log(\"base: \" + basePoints);\n  for (var i = 0; i < transformedPoints.length / 2; i++) {\n    transformedPoints[i * 2] = width / 2 * (basePoints[i * 2] * cos - basePoints[i * 2 + 1] * sin);\n    transformedPoints[i * 2 + 1] = height / 2 * (basePoints[i * 2 + 1] * cos + basePoints[i * 2] * sin);\n    transformedPoints[i * 2] += centerX;\n    transformedPoints[i * 2 + 1] += centerY;\n  }\n  var points;\n  if (padding > 0) {\n    var expandedLineSet = expandPolygon(transformedPoints, -padding);\n    points = joinLines(expandedLineSet);\n  } else {\n    points = transformedPoints;\n  }\n  return pointInsidePolygonPoints(x, y, points);\n};\nvar pointInsideRoundPolygon = function pointInsideRoundPolygon(x, y, basePoints, centerX, centerY, width, height, corners) {\n  var cutPolygonPoints = new Array(basePoints.length * 2);\n  for (var i = 0; i < corners.length; i++) {\n    var corner = corners[i];\n    cutPolygonPoints[i * 4 + 0] = corner.startX;\n    cutPolygonPoints[i * 4 + 1] = corner.startY;\n    cutPolygonPoints[i * 4 + 2] = corner.stopX;\n    cutPolygonPoints[i * 4 + 3] = corner.stopY;\n    var squaredDistance = Math.pow(corner.cx - x, 2) + Math.pow(corner.cy - y, 2);\n    if (squaredDistance <= Math.pow(corner.radius, 2)) {\n      return true;\n    }\n  }\n  return pointInsidePolygonPoints(x, y, cutPolygonPoints);\n};\nvar joinLines = function joinLines(lineSet) {\n  var vertices = new Array(lineSet.length / 2);\n  var currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY;\n  var nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY;\n  for (var i = 0; i < lineSet.length / 4; i++) {\n    currentLineStartX = lineSet[i * 4];\n    currentLineStartY = lineSet[i * 4 + 1];\n    currentLineEndX = lineSet[i * 4 + 2];\n    currentLineEndY = lineSet[i * 4 + 3];\n    if (i < lineSet.length / 4 - 1) {\n      nextLineStartX = lineSet[(i + 1) * 4];\n      nextLineStartY = lineSet[(i + 1) * 4 + 1];\n      nextLineEndX = lineSet[(i + 1) * 4 + 2];\n      nextLineEndY = lineSet[(i + 1) * 4 + 3];\n    } else {\n      nextLineStartX = lineSet[0];\n      nextLineStartY = lineSet[1];\n      nextLineEndX = lineSet[2];\n      nextLineEndY = lineSet[3];\n    }\n    var intersection = finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true);\n    vertices[i * 2] = intersection[0];\n    vertices[i * 2 + 1] = intersection[1];\n  }\n  return vertices;\n};\nvar expandPolygon = function expandPolygon(points, pad) {\n  var expandedLineSet = new Array(points.length * 2);\n  var currentPointX, currentPointY, nextPointX, nextPointY;\n  for (var i = 0; i < points.length / 2; i++) {\n    currentPointX = points[i * 2];\n    currentPointY = points[i * 2 + 1];\n    if (i < points.length / 2 - 1) {\n      nextPointX = points[(i + 1) * 2];\n      nextPointY = points[(i + 1) * 2 + 1];\n    } else {\n      nextPointX = points[0];\n      nextPointY = points[1];\n    }\n\n    // Current line: [currentPointX, currentPointY] to [nextPointX, nextPointY]\n\n    // Assume CCW polygon winding\n\n    var offsetX = nextPointY - currentPointY;\n    var offsetY = -(nextPointX - currentPointX);\n\n    // Normalize\n    var offsetLength = Math.sqrt(offsetX * offsetX + offsetY * offsetY);\n    var normalizedOffsetX = offsetX / offsetLength;\n    var normalizedOffsetY = offsetY / offsetLength;\n    expandedLineSet[i * 4] = currentPointX + normalizedOffsetX * pad;\n    expandedLineSet[i * 4 + 1] = currentPointY + normalizedOffsetY * pad;\n    expandedLineSet[i * 4 + 2] = nextPointX + normalizedOffsetX * pad;\n    expandedLineSet[i * 4 + 3] = nextPointY + normalizedOffsetY * pad;\n  }\n  return expandedLineSet;\n};\nvar intersectLineEllipse = function intersectLineEllipse(x, y, centerX, centerY, ellipseWradius, ellipseHradius) {\n  var dispX = centerX - x;\n  var dispY = centerY - y;\n  dispX /= ellipseWradius;\n  dispY /= ellipseHradius;\n  var len = Math.sqrt(dispX * dispX + dispY * dispY);\n  var newLength = len - 1;\n  if (newLength < 0) {\n    return [];\n  }\n  var lenProportion = newLength / len;\n  return [(centerX - x) * lenProportion + x, (centerY - y) * lenProportion + y];\n};\nvar checkInEllipse = function checkInEllipse(x, y, width, height, centerX, centerY, padding) {\n  x -= centerX;\n  y -= centerY;\n  x /= width / 2 + padding;\n  y /= height / 2 + padding;\n  return x * x + y * y <= 1;\n};\n\n// Returns intersections of increasing distance from line's start point\nvar intersectLineCircle = function intersectLineCircle(x1, y1, x2, y2, centerX, centerY, radius) {\n  // Calculate d, direction vector of line\n  var d = [x2 - x1, y2 - y1]; // Direction vector of line\n  var f = [x1 - centerX, y1 - centerY];\n  var a = d[0] * d[0] + d[1] * d[1];\n  var b = 2 * (f[0] * d[0] + f[1] * d[1]);\n  var c = f[0] * f[0] + f[1] * f[1] - radius * radius;\n  var discriminant = b * b - 4 * a * c;\n  if (discriminant < 0) {\n    return [];\n  }\n  var t1 = (-b + Math.sqrt(discriminant)) / (2 * a);\n  var t2 = (-b - Math.sqrt(discriminant)) / (2 * a);\n  var tMin = Math.min(t1, t2);\n  var tMax = Math.max(t1, t2);\n  var inRangeParams = [];\n  if (tMin >= 0 && tMin <= 1) {\n    inRangeParams.push(tMin);\n  }\n  if (tMax >= 0 && tMax <= 1) {\n    inRangeParams.push(tMax);\n  }\n  if (inRangeParams.length === 0) {\n    return [];\n  }\n  var nearIntersectionX = inRangeParams[0] * d[0] + x1;\n  var nearIntersectionY = inRangeParams[0] * d[1] + y1;\n  if (inRangeParams.length > 1) {\n    if (inRangeParams[0] == inRangeParams[1]) {\n      return [nearIntersectionX, nearIntersectionY];\n    } else {\n      var farIntersectionX = inRangeParams[1] * d[0] + x1;\n      var farIntersectionY = inRangeParams[1] * d[1] + y1;\n      return [nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY];\n    }\n  } else {\n    return [nearIntersectionX, nearIntersectionY];\n  }\n};\nvar midOfThree = function midOfThree(a, b, c) {\n  if (b <= a && a <= c || c <= a && a <= b) {\n    return a;\n  } else if (a <= b && b <= c || c <= b && b <= a) {\n    return b;\n  } else {\n    return c;\n  }\n};\n\n// (x1,y1)=>(x2,y2) intersect with (x3,y3)=>(x4,y4)\nvar finiteLinesIntersect = function finiteLinesIntersect(x1, y1, x2, y2, x3, y3, x4, y4, infiniteLines) {\n  var dx13 = x1 - x3;\n  var dx21 = x2 - x1;\n  var dx43 = x4 - x3;\n  var dy13 = y1 - y3;\n  var dy21 = y2 - y1;\n  var dy43 = y4 - y3;\n  var ua_t = dx43 * dy13 - dy43 * dx13;\n  var ub_t = dx21 * dy13 - dy21 * dx13;\n  var u_b = dy43 * dx21 - dx43 * dy21;\n  if (u_b !== 0) {\n    var ua = ua_t / u_b;\n    var ub = ub_t / u_b;\n    var flptThreshold = 0.001;\n    var _min = 0 - flptThreshold;\n    var _max = 1 + flptThreshold;\n    if (_min <= ua && ua <= _max && _min <= ub && ub <= _max) {\n      return [x1 + ua * dx21, y1 + ua * dy21];\n    } else {\n      if (!infiniteLines) {\n        return [];\n      } else {\n        return [x1 + ua * dx21, y1 + ua * dy21];\n      }\n    }\n  } else {\n    if (ua_t === 0 || ub_t === 0) {\n      // Parallel, coincident lines. Check if overlap\n\n      // Check endpoint of second line\n      if (midOfThree(x1, x2, x4) === x4) {\n        return [x4, y4];\n      }\n\n      // Check start point of second line\n      if (midOfThree(x1, x2, x3) === x3) {\n        return [x3, y3];\n      }\n\n      // Endpoint of first line\n      if (midOfThree(x3, x4, x2) === x2) {\n        return [x2, y2];\n      }\n      return [];\n    } else {\n      // Parallel, non-coincident\n      return [];\n    }\n  }\n};\nvar transformPoints = function transformPoints(points, centerX, centerY, width, height) {\n  var ret = [];\n  var halfW = width / 2;\n  var halfH = height / 2;\n  var x = centerX;\n  var y = centerY;\n  ret.push({\n    x: x + halfW * points[0],\n    y: y + halfH * points[1]\n  });\n  for (var i = 1; i < points.length / 2; i++) {\n    ret.push({\n      x: x + halfW * points[i * 2],\n      y: y + halfH * points[i * 2 + 1]\n    });\n  }\n  return ret;\n};\n\n// math.polygonIntersectLine( x, y, basePoints, centerX, centerY, width, height, padding )\n// intersect a node polygon (pts transformed)\n//\n// math.polygonIntersectLine( x, y, basePoints, centerX, centerY )\n// intersect the points (no transform)\nvar polygonIntersectLine = function polygonIntersectLine(x, y, basePoints, centerX, centerY, width, height, padding) {\n  var intersections = [];\n  var intersection;\n  var transformedPoints = new Array(basePoints.length);\n  var doTransform = true;\n  if (width == null) {\n    doTransform = false;\n  }\n  var points;\n  if (doTransform) {\n    for (var i = 0; i < transformedPoints.length / 2; i++) {\n      transformedPoints[i * 2] = basePoints[i * 2] * width + centerX;\n      transformedPoints[i * 2 + 1] = basePoints[i * 2 + 1] * height + centerY;\n    }\n    if (padding > 0) {\n      var expandedLineSet = expandPolygon(transformedPoints, -padding);\n      points = joinLines(expandedLineSet);\n    } else {\n      points = transformedPoints;\n    }\n  } else {\n    points = basePoints;\n  }\n  var currentX, currentY, nextX, nextY;\n  for (var _i3 = 0; _i3 < points.length / 2; _i3++) {\n    currentX = points[_i3 * 2];\n    currentY = points[_i3 * 2 + 1];\n    if (_i3 < points.length / 2 - 1) {\n      nextX = points[(_i3 + 1) * 2];\n      nextY = points[(_i3 + 1) * 2 + 1];\n    } else {\n      nextX = points[0];\n      nextY = points[1];\n    }\n    intersection = finiteLinesIntersect(x, y, centerX, centerY, currentX, currentY, nextX, nextY);\n    if (intersection.length !== 0) {\n      intersections.push(intersection[0], intersection[1]);\n    }\n  }\n  return intersections;\n};\nvar roundPolygonIntersectLine = function roundPolygonIntersectLine(x, y, basePoints, centerX, centerY, width, height, padding, corners) {\n  var intersections = [];\n  var intersection;\n  var lines = new Array(basePoints.length * 2);\n  corners.forEach(function (corner, i) {\n    if (i === 0) {\n      lines[lines.length - 2] = corner.startX;\n      lines[lines.length - 1] = corner.startY;\n    } else {\n      lines[i * 4 - 2] = corner.startX;\n      lines[i * 4 - 1] = corner.startY;\n    }\n    lines[i * 4] = corner.stopX;\n    lines[i * 4 + 1] = corner.stopY;\n    intersection = intersectLineCircle(x, y, centerX, centerY, corner.cx, corner.cy, corner.radius);\n    if (intersection.length !== 0) {\n      intersections.push(intersection[0], intersection[1]);\n    }\n  });\n  for (var i = 0; i < lines.length / 4; i++) {\n    intersection = finiteLinesIntersect(x, y, centerX, centerY, lines[i * 4], lines[i * 4 + 1], lines[i * 4 + 2], lines[i * 4 + 3], false);\n    if (intersection.length !== 0) {\n      intersections.push(intersection[0], intersection[1]);\n    }\n  }\n  if (intersections.length > 2) {\n    var lowestIntersection = [intersections[0], intersections[1]];\n    var lowestSquaredDistance = Math.pow(lowestIntersection[0] - x, 2) + Math.pow(lowestIntersection[1] - y, 2);\n    for (var _i4 = 1; _i4 < intersections.length / 2; _i4++) {\n      var squaredDistance = Math.pow(intersections[_i4 * 2] - x, 2) + Math.pow(intersections[_i4 * 2 + 1] - y, 2);\n      if (squaredDistance <= lowestSquaredDistance) {\n        lowestIntersection[0] = intersections[_i4 * 2];\n        lowestIntersection[1] = intersections[_i4 * 2 + 1];\n        lowestSquaredDistance = squaredDistance;\n      }\n    }\n    return lowestIntersection;\n  }\n  return intersections;\n};\nvar shortenIntersection = function shortenIntersection(intersection, offset, amount) {\n  var disp = [intersection[0] - offset[0], intersection[1] - offset[1]];\n  var length = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]);\n  var lenRatio = (length - amount) / length;\n  if (lenRatio < 0) {\n    lenRatio = 0.00001;\n  }\n  return [offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1]];\n};\nvar generateUnitNgonPointsFitToSquare = function generateUnitNgonPointsFitToSquare(sides, rotationRadians) {\n  var points = generateUnitNgonPoints(sides, rotationRadians);\n  points = fitPolygonToSquare(points);\n  return points;\n};\nvar fitPolygonToSquare = function fitPolygonToSquare(points) {\n  var x, y;\n  var sides = points.length / 2;\n  var minX = Infinity,\n    minY = Infinity,\n    maxX = -Infinity,\n    maxY = -Infinity;\n  for (var i = 0; i < sides; i++) {\n    x = points[2 * i];\n    y = points[2 * i + 1];\n    minX = Math.min(minX, x);\n    maxX = Math.max(maxX, x);\n    minY = Math.min(minY, y);\n    maxY = Math.max(maxY, y);\n  }\n\n  // stretch factors\n  var sx = 2 / (maxX - minX);\n  var sy = 2 / (maxY - minY);\n  for (var _i5 = 0; _i5 < sides; _i5++) {\n    x = points[2 * _i5] = points[2 * _i5] * sx;\n    y = points[2 * _i5 + 1] = points[2 * _i5 + 1] * sy;\n    minX = Math.min(minX, x);\n    maxX = Math.max(maxX, x);\n    minY = Math.min(minY, y);\n    maxY = Math.max(maxY, y);\n  }\n  if (minY < -1) {\n    for (var _i6 = 0; _i6 < sides; _i6++) {\n      y = points[2 * _i6 + 1] = points[2 * _i6 + 1] + (-1 - minY);\n    }\n  }\n  return points;\n};\nvar generateUnitNgonPoints = function generateUnitNgonPoints(sides, rotationRadians) {\n  var increment = 1.0 / sides * 2 * Math.PI;\n  var startAngle = sides % 2 === 0 ? Math.PI / 2.0 + increment / 2.0 : Math.PI / 2.0;\n  startAngle += rotationRadians;\n  var points = new Array(sides * 2);\n  var currentAngle;\n  for (var i = 0; i < sides; i++) {\n    currentAngle = i * increment + startAngle;\n    points[2 * i] = Math.cos(currentAngle); // x\n    points[2 * i + 1] = Math.sin(-currentAngle); // y\n  }\n  return points;\n};\n\n// Set the default radius, unless half of width or height is smaller than default\nvar getRoundRectangleRadius = function getRoundRectangleRadius(width, height) {\n  return Math.min(width / 4, height / 4, 8);\n};\n\n// Set the default radius\nvar getRoundPolygonRadius = function getRoundPolygonRadius(width, height) {\n  return Math.min(width / 10, height / 10, 8);\n};\nvar getCutRectangleCornerLength = function getCutRectangleCornerLength() {\n  return 8;\n};\nvar bezierPtsToQuadCoeff = function bezierPtsToQuadCoeff(p0, p1, p2) {\n  return [p0 - 2 * p1 + p2, 2 * (p1 - p0), p0];\n};\n\n// get curve width, height, and control point position offsets as a percentage of node height / width\nvar getBarrelCurveConstants = function getBarrelCurveConstants(width, height) {\n  return {\n    heightOffset: Math.min(15, 0.05 * height),\n    widthOffset: Math.min(100, 0.25 * width),\n    ctrlPtOffsetPct: 0.05\n  };\n};\n\n// Separating Axis Theorem (SAT) to determine if two polygons intersect. \n// The function takes two polygons as input and returns a boolean value indicating \n// whether the two polygons intersect.\nfunction satPolygonIntersection(poly1, poly2) {\n  function getAxes(polygon) {\n    var axes = [];\n    for (var i = 0; i < polygon.length; i++) {\n      var p1 = polygon[i];\n      var p2 = polygon[(i + 1) % polygon.length];\n      var edge = {\n        x: p2.x - p1.x,\n        y: p2.y - p1.y\n      };\n      var normal = {\n        x: -edge.y,\n        y: edge.x\n      };\n      var length = Math.sqrt(normal.x * normal.x + normal.y * normal.y);\n      axes.push({\n        x: normal.x / length,\n        y: normal.y / length\n      });\n    }\n    return axes;\n  }\n  function project(polygon, axis) {\n    var min = Infinity;\n    var max = -Infinity;\n    var _iterator = _createForOfIteratorHelper(polygon),\n      _step;\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var point = _step.value;\n        var projection = point.x * axis.x + point.y * axis.y;\n        min = Math.min(min, projection);\n        max = Math.max(max, projection);\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n    return {\n      min: min,\n      max: max\n    };\n  }\n  function overlaps(proj1, proj2) {\n    return !(proj1.max < proj2.min || proj2.max < proj1.min);\n  }\n  var axes = [].concat(_toConsumableArray(getAxes(poly1)), _toConsumableArray(getAxes(poly2)));\n  var _iterator2 = _createForOfIteratorHelper(axes),\n    _step2;\n  try {\n    for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n      var axis = _step2.value;\n      var proj1 = project(poly1, axis);\n      var proj2 = project(poly2, axis);\n      if (!overlaps(proj1, proj2)) {\n        return false; // No overlap, so the polygons do not intersect\n      }\n    }\n  } catch (err) {\n    _iterator2.e(err);\n  } finally {\n    _iterator2.f();\n  }\n  return true; // polygons intersect\n}\n\nvar pageRankDefaults = defaults$g({\n  dampingFactor: 0.8,\n  precision: 0.000001,\n  iterations: 200,\n  weight: function weight(edge) {\n    return 1;\n  }\n});\nvar elesfn$o = {\n  pageRank: function pageRank(options) {\n    var _pageRankDefaults = pageRankDefaults(options),\n      dampingFactor = _pageRankDefaults.dampingFactor,\n      precision = _pageRankDefaults.precision,\n      iterations = _pageRankDefaults.iterations,\n      weight = _pageRankDefaults.weight;\n    var cy = this._private.cy;\n    var _this$byGroup = this.byGroup(),\n      nodes = _this$byGroup.nodes,\n      edges = _this$byGroup.edges;\n    var numNodes = nodes.length;\n    var numNodesSqd = numNodes * numNodes;\n    var numEdges = edges.length;\n\n    // Construct transposed adjacency matrix\n    // First lets have a zeroed matrix of the right size\n    // We'll also keep track of the sum of each column\n    var matrix = new Array(numNodesSqd);\n    var columnSum = new Array(numNodes);\n    var additionalProb = (1 - dampingFactor) / numNodes;\n\n    // Create null matrix\n    for (var i = 0; i < numNodes; i++) {\n      for (var j = 0; j < numNodes; j++) {\n        var n = i * numNodes + j;\n        matrix[n] = 0;\n      }\n      columnSum[i] = 0;\n    }\n\n    // Now, process edges\n    for (var _i = 0; _i < numEdges; _i++) {\n      var edge = edges[_i];\n      var srcId = edge.data('source');\n      var tgtId = edge.data('target');\n\n      // Don't include loops in the matrix\n      if (srcId === tgtId) {\n        continue;\n      }\n      var s = nodes.indexOfId(srcId);\n      var t = nodes.indexOfId(tgtId);\n      var w = weight(edge);\n      var _n = t * numNodes + s;\n\n      // Update matrix\n      matrix[_n] += w;\n\n      // Update column sum\n      columnSum[s] += w;\n    }\n\n    // Add additional probability based on damping factor\n    // Also, take into account columns that have sum = 0\n    var p = 1.0 / numNodes + additionalProb; // Shorthand\n\n    // Traverse matrix, column by column\n    for (var _j = 0; _j < numNodes; _j++) {\n      if (columnSum[_j] === 0) {\n        // No 'links' out from node jth, assume equal probability for each possible node\n        for (var _i2 = 0; _i2 < numNodes; _i2++) {\n          var _n2 = _i2 * numNodes + _j;\n          matrix[_n2] = p;\n        }\n      } else {\n        // Node jth has outgoing link, compute normalized probabilities\n        for (var _i3 = 0; _i3 < numNodes; _i3++) {\n          var _n3 = _i3 * numNodes + _j;\n          matrix[_n3] = matrix[_n3] / columnSum[_j] + additionalProb;\n        }\n      }\n    }\n\n    // Compute dominant eigenvector using power method\n    var eigenvector = new Array(numNodes);\n    var temp = new Array(numNodes);\n    var previous;\n\n    // Start with a vector of all 1's\n    // Also, initialize a null vector which will be used as shorthand\n    for (var _i4 = 0; _i4 < numNodes; _i4++) {\n      eigenvector[_i4] = 1;\n    }\n    for (var iter = 0; iter < iterations; iter++) {\n      // Temp array with all 0's\n      for (var _i5 = 0; _i5 < numNodes; _i5++) {\n        temp[_i5] = 0;\n      }\n\n      // Multiply matrix with previous result\n      for (var _i6 = 0; _i6 < numNodes; _i6++) {\n        for (var _j2 = 0; _j2 < numNodes; _j2++) {\n          var _n4 = _i6 * numNodes + _j2;\n          temp[_i6] += matrix[_n4] * eigenvector[_j2];\n        }\n      }\n      inPlaceSumNormalize(temp);\n      previous = eigenvector;\n      eigenvector = temp;\n      temp = previous;\n      var diff = 0;\n      // Compute difference (squared module) of both vectors\n      for (var _i7 = 0; _i7 < numNodes; _i7++) {\n        var delta = previous[_i7] - eigenvector[_i7];\n        diff += delta * delta;\n      }\n\n      // If difference is less than the desired threshold, stop iterating\n      if (diff < precision) {\n        break;\n      }\n    }\n\n    // Construct result\n    var res = {\n      rank: function rank(node) {\n        node = cy.collection(node)[0];\n        return eigenvector[nodes.indexOf(node)];\n      }\n    };\n    return res;\n  } // pageRank\n}; // elesfn\n\nvar defaults$f = defaults$g({\n  root: null,\n  weight: function weight(edge) {\n    return 1;\n  },\n  directed: false,\n  alpha: 0\n});\nvar elesfn$n = {\n  degreeCentralityNormalized: function degreeCentralityNormalized(options) {\n    options = defaults$f(options);\n    var cy = this.cy();\n    var nodes = this.nodes();\n    var numNodes = nodes.length;\n    if (!options.directed) {\n      var degrees = {};\n      var maxDegree = 0;\n      for (var i = 0; i < numNodes; i++) {\n        var node = nodes[i];\n\n        // add current node to the current options object and call degreeCentrality\n        options.root = node;\n        var currDegree = this.degreeCentrality(options);\n        if (maxDegree < currDegree.degree) {\n          maxDegree = currDegree.degree;\n        }\n        degrees[node.id()] = currDegree.degree;\n      }\n      return {\n        degree: function degree(node) {\n          if (maxDegree === 0) {\n            return 0;\n          }\n          if (string(node)) {\n            // from is a selector string\n            node = cy.filter(node);\n          }\n          return degrees[node.id()] / maxDegree;\n        }\n      };\n    } else {\n      var indegrees = {};\n      var outdegrees = {};\n      var maxIndegree = 0;\n      var maxOutdegree = 0;\n      for (var _i = 0; _i < numNodes; _i++) {\n        var _node = nodes[_i];\n        var id = _node.id();\n\n        // add current node to the current options object and call degreeCentrality\n        options.root = _node;\n        var _currDegree = this.degreeCentrality(options);\n        if (maxIndegree < _currDegree.indegree) maxIndegree = _currDegree.indegree;\n        if (maxOutdegree < _currDegree.outdegree) maxOutdegree = _currDegree.outdegree;\n        indegrees[id] = _currDegree.indegree;\n        outdegrees[id] = _currDegree.outdegree;\n      }\n      return {\n        indegree: function indegree(node) {\n          if (maxIndegree == 0) {\n            return 0;\n          }\n          if (string(node)) {\n            // from is a selector string\n            node = cy.filter(node);\n          }\n          return indegrees[node.id()] / maxIndegree;\n        },\n        outdegree: function outdegree(node) {\n          if (maxOutdegree === 0) {\n            return 0;\n          }\n          if (string(node)) {\n            // from is a selector string\n            node = cy.filter(node);\n          }\n          return outdegrees[node.id()] / maxOutdegree;\n        }\n      };\n    }\n  },\n  // degreeCentralityNormalized\n\n  // Implemented from the algorithm in Opsahl's paper\n  // \"Node centrality in weighted networks: Generalizing degree and shortest paths\"\n  // check the heading 2 \"Degree\"\n  degreeCentrality: function degreeCentrality(options) {\n    options = defaults$f(options);\n    var cy = this.cy();\n    var callingEles = this;\n    var _options = options,\n      root = _options.root,\n      weight = _options.weight,\n      directed = _options.directed,\n      alpha = _options.alpha;\n    root = cy.collection(root)[0];\n    if (!directed) {\n      var connEdges = root.connectedEdges().intersection(callingEles);\n      var k = connEdges.length;\n      var s = 0;\n\n      // Now, sum edge weights\n      for (var i = 0; i < connEdges.length; i++) {\n        s += weight(connEdges[i]);\n      }\n      return {\n        degree: Math.pow(k, 1 - alpha) * Math.pow(s, alpha)\n      };\n    } else {\n      var edges = root.connectedEdges();\n      var incoming = edges.filter(function (edge) {\n        return edge.target().same(root) && callingEles.has(edge);\n      });\n      var outgoing = edges.filter(function (edge) {\n        return edge.source().same(root) && callingEles.has(edge);\n      });\n      var k_in = incoming.length;\n      var k_out = outgoing.length;\n      var s_in = 0;\n      var s_out = 0;\n\n      // Now, sum incoming edge weights\n      for (var _i2 = 0; _i2 < incoming.length; _i2++) {\n        s_in += weight(incoming[_i2]);\n      }\n\n      // Now, sum outgoing edge weights\n      for (var _i3 = 0; _i3 < outgoing.length; _i3++) {\n        s_out += weight(outgoing[_i3]);\n      }\n      return {\n        indegree: Math.pow(k_in, 1 - alpha) * Math.pow(s_in, alpha),\n        outdegree: Math.pow(k_out, 1 - alpha) * Math.pow(s_out, alpha)\n      };\n    }\n  } // degreeCentrality\n}; // elesfn\n\n// nice, short mathematical alias\nelesfn$n.dc = elesfn$n.degreeCentrality;\nelesfn$n.dcn = elesfn$n.degreeCentralityNormalised = elesfn$n.degreeCentralityNormalized;\n\nvar defaults$e = defaults$g({\n  harmonic: true,\n  weight: function weight() {\n    return 1;\n  },\n  directed: false,\n  root: null\n});\nvar elesfn$m = {\n  closenessCentralityNormalized: function closenessCentralityNormalized(options) {\n    var _defaults = defaults$e(options),\n      harmonic = _defaults.harmonic,\n      weight = _defaults.weight,\n      directed = _defaults.directed;\n    var cy = this.cy();\n    var closenesses = {};\n    var maxCloseness = 0;\n    var nodes = this.nodes();\n    var fw = this.floydWarshall({\n      weight: weight,\n      directed: directed\n    });\n\n    // Compute closeness for every node and find the maximum closeness\n    for (var i = 0; i < nodes.length; i++) {\n      var currCloseness = 0;\n      var node_i = nodes[i];\n      for (var j = 0; j < nodes.length; j++) {\n        if (i !== j) {\n          var d = fw.distance(node_i, nodes[j]);\n          if (harmonic) {\n            currCloseness += 1 / d;\n          } else {\n            currCloseness += d;\n          }\n        }\n      }\n      if (!harmonic) {\n        currCloseness = 1 / currCloseness;\n      }\n      if (maxCloseness < currCloseness) {\n        maxCloseness = currCloseness;\n      }\n      closenesses[node_i.id()] = currCloseness;\n    }\n    return {\n      closeness: function closeness(node) {\n        if (maxCloseness == 0) {\n          return 0;\n        }\n        if (string(node)) {\n          // from is a selector string\n          node = cy.filter(node)[0].id();\n        } else {\n          // from is a node\n          node = node.id();\n        }\n        return closenesses[node] / maxCloseness;\n      }\n    };\n  },\n  // Implemented from pseudocode from wikipedia\n  closenessCentrality: function closenessCentrality(options) {\n    var _defaults2 = defaults$e(options),\n      root = _defaults2.root,\n      weight = _defaults2.weight,\n      directed = _defaults2.directed,\n      harmonic = _defaults2.harmonic;\n    root = this.filter(root)[0];\n\n    // we need distance from this node to every other node\n    var dijkstra = this.dijkstra({\n      root: root,\n      weight: weight,\n      directed: directed\n    });\n    var totalDistance = 0;\n    var nodes = this.nodes();\n    for (var i = 0; i < nodes.length; i++) {\n      var n = nodes[i];\n      if (!n.same(root)) {\n        var d = dijkstra.distanceTo(n);\n        if (harmonic) {\n          totalDistance += 1 / d;\n        } else {\n          totalDistance += d;\n        }\n      }\n    }\n    return harmonic ? totalDistance : 1 / totalDistance;\n  } // closenessCentrality\n}; // elesfn\n\n// nice, short mathematical alias\nelesfn$m.cc = elesfn$m.closenessCentrality;\nelesfn$m.ccn = elesfn$m.closenessCentralityNormalised = elesfn$m.closenessCentralityNormalized;\n\nvar defaults$d = defaults$g({\n  weight: null,\n  directed: false\n});\nvar elesfn$l = {\n  // Implemented from the algorithm in the paper \"On Variants of Shortest-Path Betweenness Centrality and their Generic Computation\" by Ulrik Brandes\n  betweennessCentrality: function betweennessCentrality(options) {\n    var _defaults = defaults$d(options),\n      directed = _defaults.directed,\n      weight = _defaults.weight;\n    var weighted = weight != null;\n    var cy = this.cy();\n\n    // starting\n    var V = this.nodes();\n    var A = {};\n    var _C = {};\n    var max = 0;\n    var C = {\n      set: function set(key, val) {\n        _C[key] = val;\n        if (val > max) {\n          max = val;\n        }\n      },\n      get: function get(key) {\n        return _C[key];\n      }\n    };\n\n    // A contains the neighborhoods of every node\n    for (var i = 0; i < V.length; i++) {\n      var v = V[i];\n      var vid = v.id();\n      if (directed) {\n        A[vid] = v.outgoers().nodes(); // get outgoers of every node\n      } else {\n        A[vid] = v.openNeighborhood().nodes(); // get neighbors of every node\n      }\n      C.set(vid, 0);\n    }\n    var _loop = function _loop() {\n      var sid = V[s].id();\n      var S = []; // stack\n      var P = {};\n      var g = {};\n      var d = {};\n      var Q = new Heap(function (a, b) {\n        return d[a] - d[b];\n      }); // queue\n\n      // init dictionaries\n      for (var _i = 0; _i < V.length; _i++) {\n        var _vid = V[_i].id();\n        P[_vid] = [];\n        g[_vid] = 0;\n        d[_vid] = Infinity;\n      }\n      g[sid] = 1; // sigma\n      d[sid] = 0; // distance to s\n\n      Q.push(sid);\n      while (!Q.empty()) {\n        var _v = Q.pop();\n        S.push(_v);\n        if (weighted) {\n          for (var j = 0; j < A[_v].length; j++) {\n            var w = A[_v][j];\n            var vEle = cy.getElementById(_v);\n            var edge = undefined;\n            if (vEle.edgesTo(w).length > 0) {\n              edge = vEle.edgesTo(w)[0];\n            } else {\n              edge = w.edgesTo(vEle)[0];\n            }\n            var edgeWeight = weight(edge);\n            w = w.id();\n            if (d[w] > d[_v] + edgeWeight) {\n              d[w] = d[_v] + edgeWeight;\n              if (Q.nodes.indexOf(w) < 0) {\n                //if w is not in Q\n                Q.push(w);\n              } else {\n                // update position if w is in Q\n                Q.updateItem(w);\n              }\n              g[w] = 0;\n              P[w] = [];\n            }\n            if (d[w] == d[_v] + edgeWeight) {\n              g[w] = g[w] + g[_v];\n              P[w].push(_v);\n            }\n          }\n        } else {\n          for (var _j = 0; _j < A[_v].length; _j++) {\n            var _w = A[_v][_j].id();\n            if (d[_w] == Infinity) {\n              Q.push(_w);\n              d[_w] = d[_v] + 1;\n            }\n            if (d[_w] == d[_v] + 1) {\n              g[_w] = g[_w] + g[_v];\n              P[_w].push(_v);\n            }\n          }\n        }\n      }\n      var e = {};\n      for (var _i2 = 0; _i2 < V.length; _i2++) {\n        e[V[_i2].id()] = 0;\n      }\n      while (S.length > 0) {\n        var _w2 = S.pop();\n        for (var _j2 = 0; _j2 < P[_w2].length; _j2++) {\n          var _v2 = P[_w2][_j2];\n          e[_v2] = e[_v2] + g[_v2] / g[_w2] * (1 + e[_w2]);\n        }\n        if (_w2 != V[s].id()) {\n          C.set(_w2, C.get(_w2) + e[_w2]);\n        }\n      }\n    };\n    for (var s = 0; s < V.length; s++) {\n      _loop();\n    }\n    var ret = {\n      betweenness: function betweenness(node) {\n        var id = cy.collection(node).id();\n        return C.get(id);\n      },\n      betweennessNormalized: function betweennessNormalized(node) {\n        if (max == 0) {\n          return 0;\n        }\n        var id = cy.collection(node).id();\n        return C.get(id) / max;\n      }\n    };\n\n    // alias\n    ret.betweennessNormalised = ret.betweennessNormalized;\n    return ret;\n  } // betweennessCentrality\n}; // elesfn\n\n// nice, short mathematical alias\nelesfn$l.bc = elesfn$l.betweennessCentrality;\n\n// Implemented by Zoe Xi @zoexi for GSOC 2016\n// https://github.com/cytoscape/cytoscape.js-markov-cluster\n\n\n/* eslint-disable no-unused-vars */\nvar defaults$c = defaults$g({\n  expandFactor: 2,\n  // affects time of computation and cluster granularity to some extent: M * M\n  inflateFactor: 2,\n  // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j)\n  multFactor: 1,\n  // optional self loops for each node. Use a neutral value to improve cluster computations.\n  maxIterations: 20,\n  // maximum number of iterations of the MCL algorithm in a single run\n  attributes: [\n  // attributes/features used to group nodes, ie. similarity values between nodes\n  function (edge) {\n    return 1;\n  }]\n});\n/* eslint-enable */\n\nvar setOptions$3 = function setOptions(options) {\n  return defaults$c(options);\n};\n/* eslint-enable */\n\nvar getSimilarity$1 = function getSimilarity(edge, attributes) {\n  var total = 0;\n  for (var i = 0; i < attributes.length; i++) {\n    total += attributes[i](edge);\n  }\n  return total;\n};\nvar addLoops = function addLoops(M, n, val) {\n  for (var i = 0; i < n; i++) {\n    M[i * n + i] = val;\n  }\n};\nvar normalize = function normalize(M, n) {\n  var sum;\n  for (var col = 0; col < n; col++) {\n    sum = 0;\n    for (var row = 0; row < n; row++) {\n      sum += M[row * n + col];\n    }\n    for (var _row = 0; _row < n; _row++) {\n      M[_row * n + col] = M[_row * n + col] / sum;\n    }\n  }\n};\n\n// TODO: blocked matrix multiplication?\nvar mmult = function mmult(A, B, n) {\n  var C = new Array(n * n);\n  for (var i = 0; i < n; i++) {\n    for (var j = 0; j < n; j++) {\n      C[i * n + j] = 0;\n    }\n    for (var k = 0; k < n; k++) {\n      for (var _j = 0; _j < n; _j++) {\n        C[i * n + _j] += A[i * n + k] * B[k * n + _j];\n      }\n    }\n  }\n  return C;\n};\nvar expand = function expand(M, n, expandFactor /** power **/) {\n  var _M = M.slice(0);\n  for (var p = 1; p < expandFactor; p++) {\n    M = mmult(M, _M, n);\n  }\n  return M;\n};\nvar inflate = function inflate(M, n, inflateFactor /** r **/) {\n  var _M = new Array(n * n);\n\n  // M(i,j) ^ inflatePower\n  for (var i = 0; i < n * n; i++) {\n    _M[i] = Math.pow(M[i], inflateFactor);\n  }\n  normalize(_M, n);\n  return _M;\n};\nvar hasConverged = function hasConverged(M, _M, n2, roundFactor) {\n  // Check that both matrices have the same elements (i,j)\n  for (var i = 0; i < n2; i++) {\n    var v1 = Math.round(M[i] * Math.pow(10, roundFactor)) / Math.pow(10, roundFactor); // truncate to 'roundFactor' decimal places\n    var v2 = Math.round(_M[i] * Math.pow(10, roundFactor)) / Math.pow(10, roundFactor);\n    if (v1 !== v2) {\n      return false;\n    }\n  }\n  return true;\n};\nvar assign$2 = function assign(M, n, nodes, cy) {\n  var clusters = [];\n  for (var i = 0; i < n; i++) {\n    var cluster = [];\n    for (var j = 0; j < n; j++) {\n      // Row-wise attractors and elements that they attract belong in same cluster\n      if (Math.round(M[i * n + j] * 1000) / 1000 > 0) {\n        cluster.push(nodes[j]);\n      }\n    }\n    if (cluster.length !== 0) {\n      clusters.push(cy.collection(cluster));\n    }\n  }\n  return clusters;\n};\nvar isDuplicate = function isDuplicate(c1, c2) {\n  for (var i = 0; i < c1.length; i++) {\n    if (!c2[i] || c1[i].id() !== c2[i].id()) {\n      return false;\n    }\n  }\n  return true;\n};\nvar removeDuplicates = function removeDuplicates(clusters) {\n  for (var i = 0; i < clusters.length; i++) {\n    for (var j = 0; j < clusters.length; j++) {\n      if (i != j && isDuplicate(clusters[i], clusters[j])) {\n        clusters.splice(j, 1);\n      }\n    }\n  }\n  return clusters;\n};\nvar markovClustering = function markovClustering(options) {\n  var nodes = this.nodes();\n  var edges = this.edges();\n  var cy = this.cy();\n\n  // Set parameters of algorithm:\n  var opts = setOptions$3(options);\n\n  // Map each node to its position in node array\n  var id2position = {};\n  for (var i = 0; i < nodes.length; i++) {\n    id2position[nodes[i].id()] = i;\n  }\n\n  // Generate stochastic matrix M from input graph G (should be symmetric/undirected)\n  var n = nodes.length,\n    n2 = n * n;\n  var M = new Array(n2),\n    _M;\n  for (var _i = 0; _i < n2; _i++) {\n    M[_i] = 0;\n  }\n  for (var e = 0; e < edges.length; e++) {\n    var edge = edges[e];\n    var _i2 = id2position[edge.source().id()];\n    var j = id2position[edge.target().id()];\n    var sim = getSimilarity$1(edge, opts.attributes);\n    M[_i2 * n + j] += sim; // G should be symmetric and undirected\n    M[j * n + _i2] += sim;\n  }\n\n  // Begin Markov cluster algorithm\n\n  // Step 1: Add self loops to each node, ie. add multFactor to matrix diagonal\n  addLoops(M, n, opts.multFactor);\n\n  // Step 2: M = normalize( M );\n  normalize(M, n);\n  var isStillMoving = true;\n  var iterations = 0;\n  while (isStillMoving && iterations < opts.maxIterations) {\n    isStillMoving = false;\n\n    // Step 3:\n    _M = expand(M, n, opts.expandFactor);\n\n    // Step 4:\n    M = inflate(_M, n, opts.inflateFactor);\n\n    // Step 5: check to see if ~steady state has been reached\n    if (!hasConverged(M, _M, n2, 4)) {\n      isStillMoving = true;\n    }\n    iterations++;\n  }\n\n  // Build clusters from matrix\n  var clusters = assign$2(M, n, nodes, cy);\n\n  // Remove duplicate clusters due to symmetry of graph and M matrix\n  clusters = removeDuplicates(clusters);\n  return clusters;\n};\nvar markovClustering$1 = {\n  markovClustering: markovClustering,\n  mcl: markovClustering\n};\n\n// Common distance metrics for clustering algorithms\n// https://en.wikipedia.org/wiki/Hierarchical_clustering#Metric\n\nvar identity$1 = function identity(x) {\n  return x;\n};\nvar absDiff = function absDiff(p, q) {\n  return Math.abs(q - p);\n};\nvar addAbsDiff = function addAbsDiff(total, p, q) {\n  return total + absDiff(p, q);\n};\nvar addSquaredDiff = function addSquaredDiff(total, p, q) {\n  return total + Math.pow(q - p, 2);\n};\nvar sqrt = function sqrt(x) {\n  return Math.sqrt(x);\n};\nvar maxAbsDiff = function maxAbsDiff(currentMax, p, q) {\n  return Math.max(currentMax, absDiff(p, q));\n};\nvar getDistance = function getDistance(length, getP, getQ, init, visit) {\n  var post = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : identity$1;\n  var ret = init;\n  var p, q;\n  for (var dim = 0; dim < length; dim++) {\n    p = getP(dim);\n    q = getQ(dim);\n    ret = visit(ret, p, q);\n  }\n  return post(ret);\n};\nvar distances = {\n  euclidean: function euclidean(length, getP, getQ) {\n    if (length >= 2) {\n      return getDistance(length, getP, getQ, 0, addSquaredDiff, sqrt);\n    } else {\n      // for single attr case, more efficient to avoid sqrt\n      return getDistance(length, getP, getQ, 0, addAbsDiff);\n    }\n  },\n  squaredEuclidean: function squaredEuclidean(length, getP, getQ) {\n    return getDistance(length, getP, getQ, 0, addSquaredDiff);\n  },\n  manhattan: function manhattan(length, getP, getQ) {\n    return getDistance(length, getP, getQ, 0, addAbsDiff);\n  },\n  max: function max(length, getP, getQ) {\n    return getDistance(length, getP, getQ, -Infinity, maxAbsDiff);\n  }\n};\n\n// in case the user accidentally doesn't use camel case\ndistances['squared-euclidean'] = distances['squaredEuclidean'];\ndistances['squaredeuclidean'] = distances['squaredEuclidean'];\nfunction clusteringDistance (method, length, getP, getQ, nodeP, nodeQ) {\n  var impl;\n  if (fn$6(method)) {\n    impl = method;\n  } else {\n    impl = distances[method] || distances.euclidean;\n  }\n  if (length === 0 && fn$6(method)) {\n    return impl(nodeP, nodeQ);\n  } else {\n    return impl(length, getP, getQ, nodeP, nodeQ);\n  }\n}\n\nvar defaults$b = defaults$g({\n  k: 2,\n  m: 2,\n  sensitivityThreshold: 0.0001,\n  distance: 'euclidean',\n  maxIterations: 10,\n  attributes: [],\n  testMode: false,\n  testCentroids: null\n});\nvar setOptions$2 = function setOptions(options) {\n  return defaults$b(options);\n};\n\nvar getDist = function getDist(type, node, centroid, attributes, mode) {\n  var noNodeP = mode !== 'kMedoids';\n  var getP = noNodeP ? function (i) {\n    return centroid[i];\n  } : function (i) {\n    return attributes[i](centroid);\n  };\n  var getQ = function getQ(i) {\n    return attributes[i](node);\n  };\n  var nodeP = centroid;\n  var nodeQ = node;\n  return clusteringDistance(type, attributes.length, getP, getQ, nodeP, nodeQ);\n};\nvar randomCentroids = function randomCentroids(nodes, k, attributes) {\n  var ndim = attributes.length;\n  var min = new Array(ndim);\n  var max = new Array(ndim);\n  var centroids = new Array(k);\n  var centroid = null;\n\n  // Find min, max values for each attribute dimension\n  for (var i = 0; i < ndim; i++) {\n    min[i] = nodes.min(attributes[i]).value;\n    max[i] = nodes.max(attributes[i]).value;\n  }\n\n  // Build k centroids, each represented as an n-dim feature vector\n  for (var c = 0; c < k; c++) {\n    centroid = [];\n    for (var _i = 0; _i < ndim; _i++) {\n      centroid[_i] = Math.random() * (max[_i] - min[_i]) + min[_i]; // random initial value\n    }\n    centroids[c] = centroid;\n  }\n  return centroids;\n};\nvar classify = function classify(node, centroids, distance, attributes, type) {\n  var min = Infinity;\n  var index = 0;\n  for (var i = 0; i < centroids.length; i++) {\n    var dist = getDist(distance, node, centroids[i], attributes, type);\n    if (dist < min) {\n      min = dist;\n      index = i;\n    }\n  }\n  return index;\n};\nvar buildCluster = function buildCluster(centroid, nodes, assignment) {\n  var cluster = [];\n  var node = null;\n  for (var n = 0; n < nodes.length; n++) {\n    node = nodes[n];\n    if (assignment[node.id()] === centroid) {\n      //console.log(\"Node \" + node.id() + \" is associated with medoid #: \" + m);\n      cluster.push(node);\n    }\n  }\n  return cluster;\n};\nvar haveValuesConverged = function haveValuesConverged(v1, v2, sensitivityThreshold) {\n  return Math.abs(v2 - v1) <= sensitivityThreshold;\n};\nvar haveMatricesConverged = function haveMatricesConverged(v1, v2, sensitivityThreshold) {\n  for (var i = 0; i < v1.length; i++) {\n    for (var j = 0; j < v1[i].length; j++) {\n      var diff = Math.abs(v1[i][j] - v2[i][j]);\n      if (diff > sensitivityThreshold) {\n        return false;\n      }\n    }\n  }\n  return true;\n};\nvar seenBefore = function seenBefore(node, medoids, n) {\n  for (var i = 0; i < n; i++) {\n    if (node === medoids[i]) return true;\n  }\n  return false;\n};\nvar randomMedoids = function randomMedoids(nodes, k) {\n  var medoids = new Array(k);\n\n  // For small data sets, the probability of medoid conflict is greater,\n  // so we need to check to see if we've already seen or chose this node before.\n  if (nodes.length < 50) {\n    // Randomly select k medoids from the n nodes\n    for (var i = 0; i < k; i++) {\n      var node = nodes[Math.floor(Math.random() * nodes.length)];\n\n      // If we've already chosen this node to be a medoid, don't choose it again (for small data sets).\n      // Instead choose a different random node.\n      while (seenBefore(node, medoids, i)) {\n        node = nodes[Math.floor(Math.random() * nodes.length)];\n      }\n      medoids[i] = node;\n    }\n  } else {\n    // Relatively large data set, so pretty safe to not check and just select random nodes\n    for (var _i2 = 0; _i2 < k; _i2++) {\n      medoids[_i2] = nodes[Math.floor(Math.random() * nodes.length)];\n    }\n  }\n  return medoids;\n};\nvar findCost = function findCost(potentialNewMedoid, cluster, attributes) {\n  var cost = 0;\n  for (var n = 0; n < cluster.length; n++) {\n    cost += getDist('manhattan', cluster[n], potentialNewMedoid, attributes, 'kMedoids');\n  }\n  return cost;\n};\nvar kMeans = function kMeans(options) {\n  var cy = this.cy();\n  var nodes = this.nodes();\n  var node = null;\n\n  // Set parameters of algorithm: # of clusters, distance metric, etc.\n  var opts = setOptions$2(options);\n\n  // Begin k-means algorithm\n  var clusters = new Array(opts.k);\n  var assignment = {};\n  var centroids;\n\n  // Step 1: Initialize centroid positions\n  if (opts.testMode) {\n    if (typeof opts.testCentroids === 'number') {\n      // TODO: implement a seeded random number generator.\n      opts.testCentroids;\n      centroids = randomCentroids(nodes, opts.k, opts.attributes);\n    } else if (_typeof(opts.testCentroids) === 'object') {\n      centroids = opts.testCentroids;\n    } else {\n      centroids = randomCentroids(nodes, opts.k, opts.attributes);\n    }\n  } else {\n    centroids = randomCentroids(nodes, opts.k, opts.attributes);\n  }\n  var isStillMoving = true;\n  var iterations = 0;\n  while (isStillMoving && iterations < opts.maxIterations) {\n    // Step 2: Assign nodes to the nearest centroid\n    for (var n = 0; n < nodes.length; n++) {\n      node = nodes[n];\n      // Determine which cluster this node belongs to: node id => cluster #\n      assignment[node.id()] = classify(node, centroids, opts.distance, opts.attributes, 'kMeans');\n    }\n\n    // Step 3: For each of the k clusters, update its centroid\n    isStillMoving = false;\n    for (var c = 0; c < opts.k; c++) {\n      // Get all nodes that belong to this cluster\n      var cluster = buildCluster(c, nodes, assignment);\n      if (cluster.length === 0) {\n        // If cluster is empty, break out early & move to next cluster\n        continue;\n      }\n\n      // Update centroids by calculating avg of all nodes within the cluster.\n      var ndim = opts.attributes.length;\n      var centroid = centroids[c]; // [ dim_1, dim_2, dim_3, ... , dim_n ]\n      var newCentroid = new Array(ndim);\n      var sum = new Array(ndim);\n      for (var d = 0; d < ndim; d++) {\n        sum[d] = 0.0;\n        for (var i = 0; i < cluster.length; i++) {\n          node = cluster[i];\n          sum[d] += opts.attributes[d](node);\n        }\n        newCentroid[d] = sum[d] / cluster.length;\n\n        // Check to see if algorithm has converged, i.e. when centroids no longer change\n        if (!haveValuesConverged(newCentroid[d], centroid[d], opts.sensitivityThreshold)) {\n          isStillMoving = true;\n        }\n      }\n      centroids[c] = newCentroid;\n      clusters[c] = cy.collection(cluster);\n    }\n    iterations++;\n  }\n  return clusters;\n};\nvar kMedoids = function kMedoids(options) {\n  var cy = this.cy();\n  var nodes = this.nodes();\n  var node = null;\n  var opts = setOptions$2(options);\n\n  // Begin k-medoids algorithm\n  var clusters = new Array(opts.k);\n  var medoids;\n  var assignment = {};\n  var curCost;\n  var minCosts = new Array(opts.k); // minimum cost configuration for each cluster\n\n  // Step 1: Initialize k medoids\n  if (opts.testMode) {\n    if (typeof opts.testCentroids === 'number') ; else if (_typeof(opts.testCentroids) === 'object') {\n      medoids = opts.testCentroids;\n    } else {\n      medoids = randomMedoids(nodes, opts.k);\n    }\n  } else {\n    medoids = randomMedoids(nodes, opts.k);\n  }\n  var isStillMoving = true;\n  var iterations = 0;\n  while (isStillMoving && iterations < opts.maxIterations) {\n    // Step 2: Assign nodes to the nearest medoid\n    for (var n = 0; n < nodes.length; n++) {\n      node = nodes[n];\n      // Determine which cluster this node belongs to: node id => cluster #\n      assignment[node.id()] = classify(node, medoids, opts.distance, opts.attributes, 'kMedoids');\n    }\n    isStillMoving = false;\n    // Step 3: For each medoid m, and for each node associated with mediod m,\n    // select the node with the lowest configuration cost as new medoid.\n    for (var m = 0; m < medoids.length; m++) {\n      // Get all nodes that belong to this medoid\n      var cluster = buildCluster(m, nodes, assignment);\n      if (cluster.length === 0) {\n        // If cluster is empty, break out early & move to next cluster\n        continue;\n      }\n      minCosts[m] = findCost(medoids[m], cluster, opts.attributes); // original cost\n\n      // Select different medoid if its configuration has the lowest cost\n      for (var _n = 0; _n < cluster.length; _n++) {\n        curCost = findCost(cluster[_n], cluster, opts.attributes);\n        if (curCost < minCosts[m]) {\n          minCosts[m] = curCost;\n          medoids[m] = cluster[_n];\n          isStillMoving = true;\n        }\n      }\n      clusters[m] = cy.collection(cluster);\n    }\n    iterations++;\n  }\n  return clusters;\n};\nvar updateCentroids = function updateCentroids(centroids, nodes, U, weight, opts) {\n  var numerator, denominator;\n  for (var n = 0; n < nodes.length; n++) {\n    for (var c = 0; c < centroids.length; c++) {\n      weight[n][c] = Math.pow(U[n][c], opts.m);\n    }\n  }\n  for (var _c = 0; _c < centroids.length; _c++) {\n    for (var dim = 0; dim < opts.attributes.length; dim++) {\n      numerator = 0;\n      denominator = 0;\n      for (var _n2 = 0; _n2 < nodes.length; _n2++) {\n        numerator += weight[_n2][_c] * opts.attributes[dim](nodes[_n2]);\n        denominator += weight[_n2][_c];\n      }\n      centroids[_c][dim] = numerator / denominator;\n    }\n  }\n};\nvar updateMembership = function updateMembership(U, _U, centroids, nodes, opts) {\n  // Save previous step\n  for (var i = 0; i < U.length; i++) {\n    _U[i] = U[i].slice();\n  }\n  var sum, numerator, denominator;\n  var pow = 2 / (opts.m - 1);\n  for (var c = 0; c < centroids.length; c++) {\n    for (var n = 0; n < nodes.length; n++) {\n      sum = 0;\n      for (var k = 0; k < centroids.length; k++) {\n        // against all other centroids\n        numerator = getDist(opts.distance, nodes[n], centroids[c], opts.attributes, 'cmeans');\n        denominator = getDist(opts.distance, nodes[n], centroids[k], opts.attributes, 'cmeans');\n        sum += Math.pow(numerator / denominator, pow);\n      }\n      U[n][c] = 1 / sum;\n    }\n  }\n};\nvar assign$1 = function assign(nodes, U, opts, cy) {\n  var clusters = new Array(opts.k);\n  for (var c = 0; c < clusters.length; c++) {\n    clusters[c] = [];\n  }\n  var max;\n  var index;\n  for (var n = 0; n < U.length; n++) {\n    // for each node (U is N x C matrix)\n    max = -Infinity;\n    index = -1;\n    // Determine which cluster the node is most likely to belong in\n    for (var _c2 = 0; _c2 < U[0].length; _c2++) {\n      if (U[n][_c2] > max) {\n        max = U[n][_c2];\n        index = _c2;\n      }\n    }\n    clusters[index].push(nodes[n]);\n  }\n\n  // Turn every array into a collection of nodes\n  for (var _c3 = 0; _c3 < clusters.length; _c3++) {\n    clusters[_c3] = cy.collection(clusters[_c3]);\n  }\n  return clusters;\n};\nvar fuzzyCMeans = function fuzzyCMeans(options) {\n  var cy = this.cy();\n  var nodes = this.nodes();\n  var opts = setOptions$2(options);\n\n  // Begin fuzzy c-means algorithm\n  var clusters;\n  var centroids;\n  var U;\n  var _U;\n  var weight;\n\n  // Step 1: Initialize letiables.\n  _U = new Array(nodes.length);\n  for (var i = 0; i < nodes.length; i++) {\n    // N x C matrix\n    _U[i] = new Array(opts.k);\n  }\n  U = new Array(nodes.length);\n  for (var _i3 = 0; _i3 < nodes.length; _i3++) {\n    // N x C matrix\n    U[_i3] = new Array(opts.k);\n  }\n  for (var _i4 = 0; _i4 < nodes.length; _i4++) {\n    var total = 0;\n    for (var j = 0; j < opts.k; j++) {\n      U[_i4][j] = Math.random();\n      total += U[_i4][j];\n    }\n    for (var _j = 0; _j < opts.k; _j++) {\n      U[_i4][_j] = U[_i4][_j] / total;\n    }\n  }\n  centroids = new Array(opts.k);\n  for (var _i5 = 0; _i5 < opts.k; _i5++) {\n    centroids[_i5] = new Array(opts.attributes.length);\n  }\n  weight = new Array(nodes.length);\n  for (var _i6 = 0; _i6 < nodes.length; _i6++) {\n    // N x C matrix\n    weight[_i6] = new Array(opts.k);\n  }\n  // end init FCM\n\n  var isStillMoving = true;\n  var iterations = 0;\n  while (isStillMoving && iterations < opts.maxIterations) {\n    isStillMoving = false;\n\n    // Step 2: Calculate the centroids for each step.\n    updateCentroids(centroids, nodes, U, weight, opts);\n\n    // Step 3: Update the partition matrix U.\n    updateMembership(U, _U, centroids, nodes, opts);\n\n    // Step 4: Check for convergence.\n    if (!haveMatricesConverged(U, _U, opts.sensitivityThreshold)) {\n      isStillMoving = true;\n    }\n    iterations++;\n  }\n\n  // Assign nodes to clusters with highest probability.\n  clusters = assign$1(nodes, U, opts, cy);\n  return {\n    clusters: clusters,\n    degreeOfMembership: U\n  };\n};\nvar kClustering = {\n  kMeans: kMeans,\n  kMedoids: kMedoids,\n  fuzzyCMeans: fuzzyCMeans,\n  fcm: fuzzyCMeans\n};\n\n// Implemented by Zoe Xi @zoexi for GSOC 2016\n// https://github.com/cytoscape/cytoscape.js-hierarchical\n\nvar defaults$a = defaults$g({\n  distance: 'euclidean',\n  // distance metric to compare nodes\n  linkage: 'min',\n  // linkage criterion : how to determine the distance between clusters of nodes\n  mode: 'threshold',\n  // mode:'threshold' => clusters must be threshold distance apart\n  threshold: Infinity,\n  // the distance threshold\n  // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters\n  addDendrogram: false,\n  // whether to add the dendrogram to the graph for viz\n  dendrogramDepth: 0,\n  // depth at which dendrogram branches are merged into the returned clusters\n  attributes: [] // array of attr functions\n});\nvar linkageAliases = {\n  'single': 'min',\n  'complete': 'max'\n};\nvar setOptions$1 = function setOptions(options) {\n  var opts = defaults$a(options);\n  var preferredAlias = linkageAliases[opts.linkage];\n  if (preferredAlias != null) {\n    opts.linkage = preferredAlias;\n  }\n  return opts;\n};\nvar mergeClosest = function mergeClosest(clusters, index, dists, mins, opts) {\n  // Find two closest clusters from cached mins\n  var minKey = 0;\n  var min = Infinity;\n  var dist;\n  var attrs = opts.attributes;\n  var getDist = function getDist(n1, n2) {\n    return clusteringDistance(opts.distance, attrs.length, function (i) {\n      return attrs[i](n1);\n    }, function (i) {\n      return attrs[i](n2);\n    }, n1, n2);\n  };\n  for (var i = 0; i < clusters.length; i++) {\n    var key = clusters[i].key;\n    var _dist = dists[key][mins[key]];\n    if (_dist < min) {\n      minKey = key;\n      min = _dist;\n    }\n  }\n  if (opts.mode === 'threshold' && min >= opts.threshold || opts.mode === 'dendrogram' && clusters.length === 1) {\n    return false;\n  }\n  var c1 = index[minKey];\n  var c2 = index[mins[minKey]];\n  var merged;\n\n  // Merge two closest clusters\n  if (opts.mode === 'dendrogram') {\n    merged = {\n      left: c1,\n      right: c2,\n      key: c1.key\n    };\n  } else {\n    merged = {\n      value: c1.value.concat(c2.value),\n      key: c1.key\n    };\n  }\n  clusters[c1.index] = merged;\n  clusters.splice(c2.index, 1);\n  index[c1.key] = merged;\n\n  // Update distances with new merged cluster\n  for (var _i = 0; _i < clusters.length; _i++) {\n    var cur = clusters[_i];\n    if (c1.key === cur.key) {\n      dist = Infinity;\n    } else if (opts.linkage === 'min') {\n      dist = dists[c1.key][cur.key];\n      if (dists[c1.key][cur.key] > dists[c2.key][cur.key]) {\n        dist = dists[c2.key][cur.key];\n      }\n    } else if (opts.linkage === 'max') {\n      dist = dists[c1.key][cur.key];\n      if (dists[c1.key][cur.key] < dists[c2.key][cur.key]) {\n        dist = dists[c2.key][cur.key];\n      }\n    } else if (opts.linkage === 'mean') {\n      dist = (dists[c1.key][cur.key] * c1.size + dists[c2.key][cur.key] * c2.size) / (c1.size + c2.size);\n    } else {\n      if (opts.mode === 'dendrogram') dist = getDist(cur.value, c1.value);else dist = getDist(cur.value[0], c1.value[0]);\n    }\n    dists[c1.key][cur.key] = dists[cur.key][c1.key] = dist; // distance matrix is symmetric\n  }\n\n  // Update cached mins\n  for (var _i2 = 0; _i2 < clusters.length; _i2++) {\n    var key1 = clusters[_i2].key;\n    if (mins[key1] === c1.key || mins[key1] === c2.key) {\n      var _min = key1;\n      for (var j = 0; j < clusters.length; j++) {\n        var key2 = clusters[j].key;\n        if (dists[key1][key2] < dists[key1][_min]) {\n          _min = key2;\n        }\n      }\n      mins[key1] = _min;\n    }\n    clusters[_i2].index = _i2;\n  }\n\n  // Clean up meta data used for clustering\n  c1.key = c2.key = c1.index = c2.index = null;\n  return true;\n};\nvar _getAllChildren = function getAllChildren(root, arr, cy) {\n  if (!root) return;\n  if (root.value) {\n    arr.push(root.value);\n  } else {\n    if (root.left) _getAllChildren(root.left, arr);\n    if (root.right) _getAllChildren(root.right, arr);\n  }\n};\nvar _buildDendrogram = function buildDendrogram(root, cy) {\n  if (!root) return '';\n  if (root.left && root.right) {\n    var leftStr = _buildDendrogram(root.left, cy);\n    var rightStr = _buildDendrogram(root.right, cy);\n    var node = cy.add({\n      group: 'nodes',\n      data: {\n        id: leftStr + ',' + rightStr\n      }\n    });\n    cy.add({\n      group: 'edges',\n      data: {\n        source: leftStr,\n        target: node.id()\n      }\n    });\n    cy.add({\n      group: 'edges',\n      data: {\n        source: rightStr,\n        target: node.id()\n      }\n    });\n    return node.id();\n  } else if (root.value) {\n    return root.value.id();\n  }\n};\nvar _buildClustersFromTree = function buildClustersFromTree(root, k, cy) {\n  if (!root) return [];\n  var left = [],\n    right = [],\n    leaves = [];\n  if (k === 0) {\n    // don't cut tree, simply return all nodes as 1 single cluster\n    if (root.left) _getAllChildren(root.left, left);\n    if (root.right) _getAllChildren(root.right, right);\n    leaves = left.concat(right);\n    return [cy.collection(leaves)];\n  } else if (k === 1) {\n    // cut at root\n\n    if (root.value) {\n      // leaf node\n      return [cy.collection(root.value)];\n    } else {\n      if (root.left) _getAllChildren(root.left, left);\n      if (root.right) _getAllChildren(root.right, right);\n      return [cy.collection(left), cy.collection(right)];\n    }\n  } else {\n    if (root.value) {\n      return [cy.collection(root.value)];\n    } else {\n      if (root.left) left = _buildClustersFromTree(root.left, k - 1, cy);\n      if (root.right) right = _buildClustersFromTree(root.right, k - 1, cy);\n      return left.concat(right);\n    }\n  }\n};\n\nvar hierarchicalClustering = function hierarchicalClustering(options) {\n  var cy = this.cy();\n  var nodes = this.nodes();\n\n  // Set parameters of algorithm: linkage type, distance metric, etc.\n  var opts = setOptions$1(options);\n  var attrs = opts.attributes;\n  var getDist = function getDist(n1, n2) {\n    return clusteringDistance(opts.distance, attrs.length, function (i) {\n      return attrs[i](n1);\n    }, function (i) {\n      return attrs[i](n2);\n    }, n1, n2);\n  };\n\n  // Begin hierarchical algorithm\n  var clusters = [];\n  var dists = []; // distances between each pair of clusters\n  var mins = []; // closest cluster for each cluster\n  var index = []; // hash of all clusters by key\n\n  // In agglomerative (bottom-up) clustering, each node starts as its own cluster\n  for (var n = 0; n < nodes.length; n++) {\n    var cluster = {\n      value: opts.mode === 'dendrogram' ? nodes[n] : [nodes[n]],\n      key: n,\n      index: n\n    };\n    clusters[n] = cluster;\n    index[n] = cluster;\n    dists[n] = [];\n    mins[n] = 0;\n  }\n\n  // Calculate the distance between each pair of clusters\n  for (var i = 0; i < clusters.length; i++) {\n    for (var j = 0; j <= i; j++) {\n      var dist = undefined;\n      if (opts.mode === 'dendrogram') {\n        // modes store cluster values differently\n        dist = i === j ? Infinity : getDist(clusters[i].value, clusters[j].value);\n      } else {\n        dist = i === j ? Infinity : getDist(clusters[i].value[0], clusters[j].value[0]);\n      }\n      dists[i][j] = dist;\n      dists[j][i] = dist;\n      if (dist < dists[i][mins[i]]) {\n        mins[i] = j; // Cache mins: closest cluster to cluster i is cluster j\n      }\n    }\n  }\n\n  // Find the closest pair of clusters and merge them into a single cluster.\n  // Update distances between new cluster and each of the old clusters, and loop until threshold reached.\n  var merged = mergeClosest(clusters, index, dists, mins, opts);\n  while (merged) {\n    merged = mergeClosest(clusters, index, dists, mins, opts);\n  }\n  var retClusters;\n\n  // Dendrogram mode builds the hierarchy and adds intermediary nodes + edges\n  // in addition to returning the clusters.\n  if (opts.mode === 'dendrogram') {\n    retClusters = _buildClustersFromTree(clusters[0], opts.dendrogramDepth, cy);\n    if (opts.addDendrogram) _buildDendrogram(clusters[0], cy);\n  } else {\n    // Regular mode simply returns the clusters\n\n    retClusters = new Array(clusters.length);\n    clusters.forEach(function (cluster, i) {\n      // Clean up meta data used for clustering\n      cluster.key = cluster.index = null;\n      retClusters[i] = cy.collection(cluster.value);\n    });\n  }\n  return retClusters;\n};\nvar hierarchicalClustering$1 = {\n  hierarchicalClustering: hierarchicalClustering,\n  hca: hierarchicalClustering\n};\n\n// Implemented by Zoe Xi @zoexi for GSOC 2016\n// https://github.com/cytoscape/cytoscape.js-affinity-propagation\n\nvar defaults$9 = defaults$g({\n  distance: 'euclidean',\n  // distance metric to compare attributes between two nodes\n  preference: 'median',\n  // suitability of a data point to serve as an exemplar\n  damping: 0.8,\n  // damping factor between [0.5, 1)\n  maxIterations: 1000,\n  // max number of iterations to run\n  minIterations: 100,\n  // min number of iterations to run in order for clustering to stop\n  attributes: [// functions to quantify the similarity between any two points\n    // e.g. node => node.data('weight')\n  ]\n});\nvar setOptions = function setOptions(options) {\n  var dmp = options.damping;\n  var pref = options.preference;\n  if (!(0.5 <= dmp && dmp < 1)) {\n    error(\"Damping must range on [0.5, 1).  Got: \".concat(dmp));\n  }\n  var validPrefs = ['median', 'mean', 'min', 'max'];\n  if (!(validPrefs.some(function (v) {\n    return v === pref;\n  }) || number$1(pref))) {\n    error(\"Preference must be one of [\".concat(validPrefs.map(function (p) {\n      return \"'\".concat(p, \"'\");\n    }).join(', '), \"] or a number.  Got: \").concat(pref));\n  }\n  return defaults$9(options);\n};\n\nvar getSimilarity = function getSimilarity(type, n1, n2, attributes) {\n  var attr = function attr(n, i) {\n    return attributes[i](n);\n  };\n\n  // nb negative because similarity should have an inverse relationship to distance\n  return -clusteringDistance(type, attributes.length, function (i) {\n    return attr(n1, i);\n  }, function (i) {\n    return attr(n2, i);\n  }, n1, n2);\n};\nvar getPreference = function getPreference(S, preference) {\n  // larger preference = greater # of clusters\n  var p = null;\n  if (preference === 'median') {\n    p = median(S);\n  } else if (preference === 'mean') {\n    p = mean(S);\n  } else if (preference === 'min') {\n    p = min(S);\n  } else if (preference === 'max') {\n    p = max(S);\n  } else {\n    // Custom preference number, as set by user\n    p = preference;\n  }\n  return p;\n};\nvar findExemplars = function findExemplars(n, R, A) {\n  var indices = [];\n  for (var i = 0; i < n; i++) {\n    if (R[i * n + i] + A[i * n + i] > 0) {\n      indices.push(i);\n    }\n  }\n  return indices;\n};\nvar assignClusters = function assignClusters(n, S, exemplars) {\n  var clusters = [];\n  for (var i = 0; i < n; i++) {\n    var index = -1;\n    var max = -Infinity;\n    for (var ei = 0; ei < exemplars.length; ei++) {\n      var e = exemplars[ei];\n      if (S[i * n + e] > max) {\n        index = e;\n        max = S[i * n + e];\n      }\n    }\n    if (index > 0) {\n      clusters.push(index);\n    }\n  }\n  for (var _ei = 0; _ei < exemplars.length; _ei++) {\n    clusters[exemplars[_ei]] = exemplars[_ei];\n  }\n  return clusters;\n};\nvar assign = function assign(n, S, exemplars) {\n  var clusters = assignClusters(n, S, exemplars);\n  for (var ei = 0; ei < exemplars.length; ei++) {\n    var ii = [];\n    for (var c = 0; c < clusters.length; c++) {\n      if (clusters[c] === exemplars[ei]) {\n        ii.push(c);\n      }\n    }\n    var maxI = -1;\n    var maxSum = -Infinity;\n    for (var i = 0; i < ii.length; i++) {\n      var sum = 0;\n      for (var j = 0; j < ii.length; j++) {\n        sum += S[ii[j] * n + ii[i]];\n      }\n      if (sum > maxSum) {\n        maxI = i;\n        maxSum = sum;\n      }\n    }\n    exemplars[ei] = ii[maxI];\n  }\n  clusters = assignClusters(n, S, exemplars);\n  return clusters;\n};\nvar affinityPropagation = function affinityPropagation(options) {\n  var cy = this.cy();\n  var nodes = this.nodes();\n  var opts = setOptions(options);\n\n  // Map each node to its position in node array\n  var id2position = {};\n  for (var i = 0; i < nodes.length; i++) {\n    id2position[nodes[i].id()] = i;\n  }\n\n  // Begin affinity propagation algorithm\n\n  var n; // number of data points\n  var n2; // size of matrices\n  var S; // similarity matrix (1D array)\n  var p; // preference/suitability of a data point to serve as an exemplar\n  var R; // responsibility matrix (1D array)\n  var A; // availability matrix (1D array)\n\n  n = nodes.length;\n  n2 = n * n;\n\n  // Initialize and build S similarity matrix\n  S = new Array(n2);\n  for (var _i = 0; _i < n2; _i++) {\n    S[_i] = -Infinity; // for cases where two data points shouldn't be linked together\n  }\n  for (var _i2 = 0; _i2 < n; _i2++) {\n    for (var j = 0; j < n; j++) {\n      if (_i2 !== j) {\n        S[_i2 * n + j] = getSimilarity(opts.distance, nodes[_i2], nodes[j], opts.attributes);\n      }\n    }\n  }\n\n  // Place preferences on the diagonal of S\n  p = getPreference(S, opts.preference);\n  for (var _i3 = 0; _i3 < n; _i3++) {\n    S[_i3 * n + _i3] = p;\n  }\n\n  // Initialize R responsibility matrix\n  R = new Array(n2);\n  for (var _i4 = 0; _i4 < n2; _i4++) {\n    R[_i4] = 0.0;\n  }\n\n  // Initialize A availability matrix\n  A = new Array(n2);\n  for (var _i5 = 0; _i5 < n2; _i5++) {\n    A[_i5] = 0.0;\n  }\n  var old = new Array(n);\n  var Rp = new Array(n);\n  var se = new Array(n);\n  for (var _i6 = 0; _i6 < n; _i6++) {\n    old[_i6] = 0.0;\n    Rp[_i6] = 0.0;\n    se[_i6] = 0;\n  }\n  var e = new Array(n * opts.minIterations);\n  for (var _i7 = 0; _i7 < e.length; _i7++) {\n    e[_i7] = 0;\n  }\n  var iter;\n  for (iter = 0; iter < opts.maxIterations; iter++) {\n    // main algorithmic loop\n\n    // Update R responsibility matrix\n    for (var _i8 = 0; _i8 < n; _i8++) {\n      var max = -Infinity,\n        max2 = -Infinity,\n        maxI = -1,\n        AS = 0.0;\n      for (var _j = 0; _j < n; _j++) {\n        old[_j] = R[_i8 * n + _j];\n        AS = A[_i8 * n + _j] + S[_i8 * n + _j];\n        if (AS >= max) {\n          max2 = max;\n          max = AS;\n          maxI = _j;\n        } else if (AS > max2) {\n          max2 = AS;\n        }\n      }\n      for (var _j2 = 0; _j2 < n; _j2++) {\n        R[_i8 * n + _j2] = (1 - opts.damping) * (S[_i8 * n + _j2] - max) + opts.damping * old[_j2];\n      }\n      R[_i8 * n + maxI] = (1 - opts.damping) * (S[_i8 * n + maxI] - max2) + opts.damping * old[maxI];\n    }\n\n    // Update A availability matrix\n    for (var _i9 = 0; _i9 < n; _i9++) {\n      var sum = 0;\n      for (var _j3 = 0; _j3 < n; _j3++) {\n        old[_j3] = A[_j3 * n + _i9];\n        Rp[_j3] = Math.max(0, R[_j3 * n + _i9]);\n        sum += Rp[_j3];\n      }\n      sum -= Rp[_i9];\n      Rp[_i9] = R[_i9 * n + _i9];\n      sum += Rp[_i9];\n      for (var _j4 = 0; _j4 < n; _j4++) {\n        A[_j4 * n + _i9] = (1 - opts.damping) * Math.min(0, sum - Rp[_j4]) + opts.damping * old[_j4];\n      }\n      A[_i9 * n + _i9] = (1 - opts.damping) * (sum - Rp[_i9]) + opts.damping * old[_i9];\n    }\n\n    // Check for convergence\n    var K = 0;\n    for (var _i10 = 0; _i10 < n; _i10++) {\n      var E = A[_i10 * n + _i10] + R[_i10 * n + _i10] > 0 ? 1 : 0;\n      e[iter % opts.minIterations * n + _i10] = E;\n      K += E;\n    }\n    if (K > 0 && (iter >= opts.minIterations - 1 || iter == opts.maxIterations - 1)) {\n      var _sum = 0;\n      for (var _i11 = 0; _i11 < n; _i11++) {\n        se[_i11] = 0;\n        for (var _j5 = 0; _j5 < opts.minIterations; _j5++) {\n          se[_i11] += e[_j5 * n + _i11];\n        }\n        if (se[_i11] === 0 || se[_i11] === opts.minIterations) {\n          _sum++;\n        }\n      }\n      if (_sum === n) {\n        // then we have convergence\n        break;\n      }\n    }\n  }\n\n  // Identify exemplars (cluster centers)\n  var exemplarsIndices = findExemplars(n, R, A);\n\n  // Assign nodes to clusters\n  var clusterIndices = assign(n, S, exemplarsIndices);\n  var clusters = {};\n  for (var c = 0; c < exemplarsIndices.length; c++) {\n    clusters[exemplarsIndices[c]] = [];\n  }\n  for (var _i12 = 0; _i12 < nodes.length; _i12++) {\n    var pos = id2position[nodes[_i12].id()];\n    var clusterIndex = clusterIndices[pos];\n    if (clusterIndex != null) {\n      // the node may have not been assigned a cluster if no valid attributes were specified\n      clusters[clusterIndex].push(nodes[_i12]);\n    }\n  }\n  var retClusters = new Array(exemplarsIndices.length);\n  for (var _c = 0; _c < exemplarsIndices.length; _c++) {\n    retClusters[_c] = cy.collection(clusters[exemplarsIndices[_c]]);\n  }\n  return retClusters;\n};\nvar affinityPropagation$1 = {\n  affinityPropagation: affinityPropagation,\n  ap: affinityPropagation\n};\n\nvar hierholzerDefaults = defaults$g({\n  root: undefined,\n  directed: false\n});\nvar elesfn$k = {\n  hierholzer: function hierholzer(options) {\n    if (!plainObject(options)) {\n      var args = arguments;\n      options = {\n        root: args[0],\n        directed: args[1]\n      };\n    }\n    var _hierholzerDefaults = hierholzerDefaults(options),\n      root = _hierholzerDefaults.root,\n      directed = _hierholzerDefaults.directed;\n    var eles = this;\n    var dflag = false;\n    var oddIn;\n    var oddOut;\n    var startVertex;\n    if (root) startVertex = string(root) ? this.filter(root)[0].id() : root[0].id();\n    var nodes = {};\n    var edges = {};\n    if (directed) {\n      eles.forEach(function (ele) {\n        var id = ele.id();\n        if (ele.isNode()) {\n          var ind = ele.indegree(true);\n          var outd = ele.outdegree(true);\n          var d1 = ind - outd;\n          var d2 = outd - ind;\n          if (d1 == 1) {\n            if (oddIn) dflag = true;else oddIn = id;\n          } else if (d2 == 1) {\n            if (oddOut) dflag = true;else oddOut = id;\n          } else if (d2 > 1 || d1 > 1) {\n            dflag = true;\n          }\n          nodes[id] = [];\n          ele.outgoers().forEach(function (e) {\n            if (e.isEdge()) nodes[id].push(e.id());\n          });\n        } else {\n          edges[id] = [undefined, ele.target().id()];\n        }\n      });\n    } else {\n      eles.forEach(function (ele) {\n        var id = ele.id();\n        if (ele.isNode()) {\n          var d = ele.degree(true);\n          if (d % 2) {\n            if (!oddIn) oddIn = id;else if (!oddOut) oddOut = id;else dflag = true;\n          }\n          nodes[id] = [];\n          ele.connectedEdges().forEach(function (e) {\n            return nodes[id].push(e.id());\n          });\n        } else {\n          edges[id] = [ele.source().id(), ele.target().id()];\n        }\n      });\n    }\n    var result = {\n      found: false,\n      trail: undefined\n    };\n    if (dflag) return result;else if (oddOut && oddIn) {\n      if (directed) {\n        if (startVertex && oddOut != startVertex) {\n          return result;\n        }\n        startVertex = oddOut;\n      } else {\n        if (startVertex && oddOut != startVertex && oddIn != startVertex) {\n          return result;\n        } else if (!startVertex) {\n          startVertex = oddOut;\n        }\n      }\n    } else {\n      if (!startVertex) startVertex = eles[0].id();\n    }\n    var walk = function walk(v) {\n      var currentNode = v;\n      var subtour = [v];\n      var adj, adjTail, adjHead;\n      while (nodes[currentNode].length) {\n        adj = nodes[currentNode].shift();\n        adjTail = edges[adj][0];\n        adjHead = edges[adj][1];\n        if (currentNode != adjHead) {\n          nodes[adjHead] = nodes[adjHead].filter(function (e) {\n            return e != adj;\n          });\n          currentNode = adjHead;\n        } else if (!directed && currentNode != adjTail) {\n          nodes[adjTail] = nodes[adjTail].filter(function (e) {\n            return e != adj;\n          });\n          currentNode = adjTail;\n        }\n        subtour.unshift(adj);\n        subtour.unshift(currentNode);\n      }\n      return subtour;\n    };\n    var trail = [];\n    var subtour = [];\n    subtour = walk(startVertex);\n    while (subtour.length != 1) {\n      if (nodes[subtour[0]].length == 0) {\n        trail.unshift(eles.getElementById(subtour.shift()));\n        trail.unshift(eles.getElementById(subtour.shift()));\n      } else {\n        subtour = walk(subtour.shift()).concat(subtour);\n      }\n    }\n    trail.unshift(eles.getElementById(subtour.shift())); // final node\n\n    for (var d in nodes) {\n      if (nodes[d].length) {\n        return result;\n      }\n    }\n    result.found = true;\n    result.trail = this.spawn(trail, true);\n    return result;\n  }\n};\n\nvar hopcroftTarjanBiconnected = function hopcroftTarjanBiconnected() {\n  var eles = this;\n  var nodes = {};\n  var id = 0;\n  var edgeCount = 0;\n  var components = [];\n  var stack = [];\n  var visitedEdges = {};\n  var buildComponent = function buildComponent(x, y) {\n    var i = stack.length - 1;\n    var cutset = [];\n    var component = eles.spawn();\n    while (stack[i].x != x || stack[i].y != y) {\n      cutset.push(stack.pop().edge);\n      i--;\n    }\n    cutset.push(stack.pop().edge);\n    cutset.forEach(function (edge) {\n      var connectedNodes = edge.connectedNodes().intersection(eles);\n      component.merge(edge);\n      connectedNodes.forEach(function (node) {\n        var nodeId = node.id();\n        var connectedEdges = node.connectedEdges().intersection(eles);\n        component.merge(node);\n        if (!nodes[nodeId].cutVertex) {\n          component.merge(connectedEdges);\n        } else {\n          component.merge(connectedEdges.filter(function (edge) {\n            return edge.isLoop();\n          }));\n        }\n      });\n    });\n    components.push(component);\n  };\n  var _biconnectedSearch = function biconnectedSearch(root, currentNode, parent) {\n    if (root === parent) edgeCount += 1;\n    nodes[currentNode] = {\n      id: id,\n      low: id++,\n      cutVertex: false\n    };\n    var edges = eles.getElementById(currentNode).connectedEdges().intersection(eles);\n    if (edges.size() === 0) {\n      components.push(eles.spawn(eles.getElementById(currentNode)));\n    } else {\n      var sourceId, targetId, otherNodeId, edgeId;\n      edges.forEach(function (edge) {\n        sourceId = edge.source().id();\n        targetId = edge.target().id();\n        otherNodeId = sourceId === currentNode ? targetId : sourceId;\n        if (otherNodeId !== parent) {\n          edgeId = edge.id();\n          if (!visitedEdges[edgeId]) {\n            visitedEdges[edgeId] = true;\n            stack.push({\n              x: currentNode,\n              y: otherNodeId,\n              edge: edge\n            });\n          }\n          if (!(otherNodeId in nodes)) {\n            _biconnectedSearch(root, otherNodeId, currentNode);\n            nodes[currentNode].low = Math.min(nodes[currentNode].low, nodes[otherNodeId].low);\n            if (nodes[currentNode].id <= nodes[otherNodeId].low) {\n              nodes[currentNode].cutVertex = true;\n              buildComponent(currentNode, otherNodeId);\n            }\n          } else {\n            nodes[currentNode].low = Math.min(nodes[currentNode].low, nodes[otherNodeId].id);\n          }\n        }\n      });\n    }\n  };\n  eles.forEach(function (ele) {\n    if (ele.isNode()) {\n      var nodeId = ele.id();\n      if (!(nodeId in nodes)) {\n        edgeCount = 0;\n        _biconnectedSearch(nodeId, nodeId);\n        nodes[nodeId].cutVertex = edgeCount > 1;\n      }\n    }\n  });\n  var cutVertices = Object.keys(nodes).filter(function (id) {\n    return nodes[id].cutVertex;\n  }).map(function (id) {\n    return eles.getElementById(id);\n  });\n  return {\n    cut: eles.spawn(cutVertices),\n    components: components\n  };\n};\nvar hopcroftTarjanBiconnected$1 = {\n  hopcroftTarjanBiconnected: hopcroftTarjanBiconnected,\n  htbc: hopcroftTarjanBiconnected,\n  htb: hopcroftTarjanBiconnected,\n  hopcroftTarjanBiconnectedComponents: hopcroftTarjanBiconnected\n};\n\nvar tarjanStronglyConnected = function tarjanStronglyConnected() {\n  var eles = this;\n  var nodes = {};\n  var index = 0;\n  var components = [];\n  var stack = [];\n  var cut = eles.spawn(eles);\n  var _stronglyConnectedSearch = function stronglyConnectedSearch(sourceNodeId) {\n    stack.push(sourceNodeId);\n    nodes[sourceNodeId] = {\n      index: index,\n      low: index++,\n      explored: false\n    };\n    var connectedEdges = eles.getElementById(sourceNodeId).connectedEdges().intersection(eles);\n    connectedEdges.forEach(function (edge) {\n      var targetNodeId = edge.target().id();\n      if (targetNodeId !== sourceNodeId) {\n        if (!(targetNodeId in nodes)) {\n          _stronglyConnectedSearch(targetNodeId);\n        }\n        if (!nodes[targetNodeId].explored) {\n          nodes[sourceNodeId].low = Math.min(nodes[sourceNodeId].low, nodes[targetNodeId].low);\n        }\n      }\n    });\n    if (nodes[sourceNodeId].index === nodes[sourceNodeId].low) {\n      var componentNodes = eles.spawn();\n      for (;;) {\n        var nodeId = stack.pop();\n        componentNodes.merge(eles.getElementById(nodeId));\n        nodes[nodeId].low = nodes[sourceNodeId].index;\n        nodes[nodeId].explored = true;\n        if (nodeId === sourceNodeId) {\n          break;\n        }\n      }\n      var componentEdges = componentNodes.edgesWith(componentNodes);\n      var component = componentNodes.merge(componentEdges);\n      components.push(component);\n      cut = cut.difference(component);\n    }\n  };\n  eles.forEach(function (ele) {\n    if (ele.isNode()) {\n      var nodeId = ele.id();\n      if (!(nodeId in nodes)) {\n        _stronglyConnectedSearch(nodeId);\n      }\n    }\n  });\n  return {\n    cut: cut,\n    components: components\n  };\n};\nvar tarjanStronglyConnected$1 = {\n  tarjanStronglyConnected: tarjanStronglyConnected,\n  tsc: tarjanStronglyConnected,\n  tscc: tarjanStronglyConnected,\n  tarjanStronglyConnectedComponents: tarjanStronglyConnected\n};\n\nvar elesfn$j = {};\n[elesfn$v, elesfn$u, elesfn$t, elesfn$s, elesfn$r, elesfn$q, elesfn$p, elesfn$o, elesfn$n, elesfn$m, elesfn$l, markovClustering$1, kClustering, hierarchicalClustering$1, affinityPropagation$1, elesfn$k, hopcroftTarjanBiconnected$1, tarjanStronglyConnected$1].forEach(function (props) {\n  extend(elesfn$j, props);\n});\n\n/*!\nEmbeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable\nCopyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)\nLicensed under The MIT License (http://opensource.org/licenses/MIT)\n*/\n\n/*  promise states [Promises/A+ 2.1]  */\nvar STATE_PENDING = 0; /*  [Promises/A+ 2.1.1]  */\nvar STATE_FULFILLED = 1; /*  [Promises/A+ 2.1.2]  */\nvar STATE_REJECTED = 2; /*  [Promises/A+ 2.1.3]  */\n\n/*  promise object constructor  */\nvar _api = function api(executor) {\n  /*  optionally support non-constructor/plain-function call  */\n  if (!(this instanceof _api)) return new _api(executor);\n\n  /*  initialize object  */\n  this.id = 'Thenable/1.0.7';\n  this.state = STATE_PENDING; /*  initial state  */\n  this.fulfillValue = undefined; /*  initial value  */ /*  [Promises/A+ 1.3, 2.1.2.2]  */\n  this.rejectReason = undefined; /*  initial reason */ /*  [Promises/A+ 1.5, 2.1.3.2]  */\n  this.onFulfilled = []; /*  initial handlers  */\n  this.onRejected = []; /*  initial handlers  */\n\n  /*  provide optional information-hiding proxy  */\n  this.proxy = {\n    then: this.then.bind(this)\n  };\n\n  /*  support optional executor function  */\n  if (typeof executor === 'function') executor.call(this, this.fulfill.bind(this), this.reject.bind(this));\n};\n\n/*  promise API methods  */\n_api.prototype = {\n  /*  promise resolving methods  */\n  fulfill: function fulfill(value) {\n    return deliver(this, STATE_FULFILLED, 'fulfillValue', value);\n  },\n  reject: function reject(value) {\n    return deliver(this, STATE_REJECTED, 'rejectReason', value);\n  },\n  /*  \"The then Method\" [Promises/A+ 1.1, 1.2, 2.2]  */\n  then: function then(onFulfilled, onRejected) {\n    var curr = this;\n    var next = new _api(); /*  [Promises/A+ 2.2.7]  */\n    curr.onFulfilled.push(resolver(onFulfilled, next, 'fulfill')); /*  [Promises/A+ 2.2.2/2.2.6]  */\n    curr.onRejected.push(resolver(onRejected, next, 'reject')); /*  [Promises/A+ 2.2.3/2.2.6]  */\n    execute(curr);\n    return next.proxy; /*  [Promises/A+ 2.2.7, 3.3]  */\n  }\n};\n\n/*  deliver an action  */\nvar deliver = function deliver(curr, state, name, value) {\n  if (curr.state === STATE_PENDING) {\n    curr.state = state; /*  [Promises/A+ 2.1.2.1, 2.1.3.1]  */\n    curr[name] = value; /*  [Promises/A+ 2.1.2.2, 2.1.3.2]  */\n    execute(curr);\n  }\n  return curr;\n};\n\n/*  execute all handlers  */\nvar execute = function execute(curr) {\n  if (curr.state === STATE_FULFILLED) execute_handlers(curr, 'onFulfilled', curr.fulfillValue);else if (curr.state === STATE_REJECTED) execute_handlers(curr, 'onRejected', curr.rejectReason);\n};\n\n/*  execute particular set of handlers  */\nvar execute_handlers = function execute_handlers(curr, name, value) {\n  /* global setImmediate: true */\n  /* global setTimeout: true */\n\n  /*  short-circuit processing  */\n  if (curr[name].length === 0) return;\n\n  /*  iterate over all handlers, exactly once  */\n  var handlers = curr[name];\n  curr[name] = []; /*  [Promises/A+ 2.2.2.3, 2.2.3.3]  */\n  var func = function func() {\n    for (var i = 0; i < handlers.length; i++) handlers[i](value); /*  [Promises/A+ 2.2.5]  */\n  };\n\n  /*  execute procedure asynchronously  */ /*  [Promises/A+ 2.2.4, 3.1]  */\n  if (typeof setImmediate === 'function') setImmediate(func);else setTimeout(func, 0);\n};\n\n/*  generate a resolver function  */\nvar resolver = function resolver(cb, next, method) {\n  return function (value) {\n    if (typeof cb !== 'function') /*  [Promises/A+ 2.2.1, 2.2.7.3, 2.2.7.4]  */\n      next[method].call(next, value); /*  [Promises/A+ 2.2.7.3, 2.2.7.4]  */else {\n      var result;\n      try {\n        result = cb(value);\n      } /*  [Promises/A+ 2.2.2.1, 2.2.3.1, 2.2.5, 3.2]  */ catch (e) {\n        next.reject(e); /*  [Promises/A+ 2.2.7.2]  */\n        return;\n      }\n      _resolve(next, result); /*  [Promises/A+ 2.2.7.1]  */\n    }\n  };\n};\n\n/*  \"Promise Resolution Procedure\"  */ /*  [Promises/A+ 2.3]  */\nvar _resolve = function resolve(promise, x) {\n  /*  sanity check arguments  */ /*  [Promises/A+ 2.3.1]  */\n  if (promise === x || promise.proxy === x) {\n    promise.reject(new TypeError('cannot resolve promise with itself'));\n    return;\n  }\n\n  /*  surgically check for a \"then\" method\n    (mainly to just call the \"getter\" of \"then\" only once)  */\n  var then;\n  if (_typeof(x) === 'object' && x !== null || typeof x === 'function') {\n    try {\n      then = x.then;\n    } /*  [Promises/A+ 2.3.3.1, 3.5]  */ catch (e) {\n      promise.reject(e); /*  [Promises/A+ 2.3.3.2]  */\n      return;\n    }\n  }\n\n  /*  handle own Thenables    [Promises/A+ 2.3.2]\n    and similar \"thenables\" [Promises/A+ 2.3.3]  */\n  if (typeof then === 'function') {\n    var resolved = false;\n    try {\n      /*  call retrieved \"then\" method */ /*  [Promises/A+ 2.3.3.3]  */\n      then.call(x, /*  resolvePromise  */ /*  [Promises/A+ 2.3.3.3.1]  */\n      function (y) {\n        if (resolved) return;\n        resolved = true; /*  [Promises/A+ 2.3.3.3.3]  */\n        if (y === x) /*  [Promises/A+ 3.6]  */\n          promise.reject(new TypeError('circular thenable chain'));else _resolve(promise, y);\n      }, /*  rejectPromise  */ /*  [Promises/A+ 2.3.3.3.2]  */\n      function (r) {\n        if (resolved) return;\n        resolved = true; /*  [Promises/A+ 2.3.3.3.3]  */\n        promise.reject(r);\n      });\n    } catch (e) {\n      if (!resolved) /*  [Promises/A+ 2.3.3.3.3]  */\n        promise.reject(e); /*  [Promises/A+ 2.3.3.3.4]  */\n    }\n    return;\n  }\n\n  /*  handle other values  */\n  promise.fulfill(x); /*  [Promises/A+ 2.3.4, 2.3.3.4]  */\n};\n\n// so we always have Promise.all()\n_api.all = function (ps) {\n  return new _api(function (resolveAll, rejectAll) {\n    var vals = new Array(ps.length);\n    var doneCount = 0;\n    var fulfill = function fulfill(i, val) {\n      vals[i] = val;\n      doneCount++;\n      if (doneCount === ps.length) {\n        resolveAll(vals);\n      }\n    };\n    for (var i = 0; i < ps.length; i++) {\n      (function (i) {\n        var p = ps[i];\n        var isPromise = p != null && p.then != null;\n        if (isPromise) {\n          p.then(function (val) {\n            fulfill(i, val);\n          }, function (err) {\n            rejectAll(err);\n          });\n        } else {\n          var val = p;\n          fulfill(i, val);\n        }\n      })(i);\n    }\n  });\n};\n_api.resolve = function (val) {\n  return new _api(function (resolve, reject) {\n    resolve(val);\n  });\n};\n_api.reject = function (val) {\n  return new _api(function (resolve, reject) {\n    reject(val);\n  });\n};\nvar Promise$1 = typeof Promise !== 'undefined' ? Promise : _api; // eslint-disable-line no-undef\n\nvar Animation = function Animation(target, opts, opts2) {\n  var isCore = core(target);\n  var isEle = !isCore;\n  var _p = this._private = extend({\n    duration: 1000\n  }, opts, opts2);\n  _p.target = target;\n  _p.style = _p.style || _p.css;\n  _p.started = false;\n  _p.playing = false;\n  _p.hooked = false;\n  _p.applying = false;\n  _p.progress = 0;\n  _p.completes = [];\n  _p.frames = [];\n  if (_p.complete && fn$6(_p.complete)) {\n    _p.completes.push(_p.complete);\n  }\n  if (isEle) {\n    var pos = target.position();\n    _p.startPosition = _p.startPosition || {\n      x: pos.x,\n      y: pos.y\n    };\n    _p.startStyle = _p.startStyle || target.cy().style().getAnimationStartStyle(target, _p.style);\n  }\n  if (isCore) {\n    var pan = target.pan();\n    _p.startPan = {\n      x: pan.x,\n      y: pan.y\n    };\n    _p.startZoom = target.zoom();\n  }\n\n  // for future timeline/animations impl\n  this.length = 1;\n  this[0] = this;\n};\nvar anifn = Animation.prototype;\nextend(anifn, {\n  instanceString: function instanceString() {\n    return 'animation';\n  },\n  hook: function hook() {\n    var _p = this._private;\n    if (!_p.hooked) {\n      // add to target's animation queue\n      var q;\n      var tAni = _p.target._private.animation;\n      if (_p.queue) {\n        q = tAni.queue;\n      } else {\n        q = tAni.current;\n      }\n      q.push(this);\n\n      // add to the animation loop pool\n      if (elementOrCollection(_p.target)) {\n        _p.target.cy().addToAnimationPool(_p.target);\n      }\n      _p.hooked = true;\n    }\n    return this;\n  },\n  play: function play() {\n    var _p = this._private;\n\n    // autorewind\n    if (_p.progress === 1) {\n      _p.progress = 0;\n    }\n    _p.playing = true;\n    _p.started = false; // needs to be started by animation loop\n    _p.stopped = false;\n    this.hook();\n\n    // the animation loop will start the animation...\n\n    return this;\n  },\n  playing: function playing() {\n    return this._private.playing;\n  },\n  apply: function apply() {\n    var _p = this._private;\n    _p.applying = true;\n    _p.started = false; // needs to be started by animation loop\n    _p.stopped = false;\n    this.hook();\n\n    // the animation loop will apply the animation at this progress\n\n    return this;\n  },\n  applying: function applying() {\n    return this._private.applying;\n  },\n  pause: function pause() {\n    var _p = this._private;\n    _p.playing = false;\n    _p.started = false;\n    return this;\n  },\n  stop: function stop() {\n    var _p = this._private;\n    _p.playing = false;\n    _p.started = false;\n    _p.stopped = true; // to be removed from animation queues\n\n    return this;\n  },\n  rewind: function rewind() {\n    return this.progress(0);\n  },\n  fastforward: function fastforward() {\n    return this.progress(1);\n  },\n  time: function time(t) {\n    var _p = this._private;\n    if (t === undefined) {\n      return _p.progress * _p.duration;\n    } else {\n      return this.progress(t / _p.duration);\n    }\n  },\n  progress: function progress(p) {\n    var _p = this._private;\n    var wasPlaying = _p.playing;\n    if (p === undefined) {\n      return _p.progress;\n    } else {\n      if (wasPlaying) {\n        this.pause();\n      }\n      _p.progress = p;\n      _p.started = false;\n      if (wasPlaying) {\n        this.play();\n      }\n    }\n    return this;\n  },\n  completed: function completed() {\n    return this._private.progress === 1;\n  },\n  reverse: function reverse() {\n    var _p = this._private;\n    var wasPlaying = _p.playing;\n    if (wasPlaying) {\n      this.pause();\n    }\n    _p.progress = 1 - _p.progress;\n    _p.started = false;\n    var swap = function swap(a, b) {\n      var _pa = _p[a];\n      if (_pa == null) {\n        return;\n      }\n      _p[a] = _p[b];\n      _p[b] = _pa;\n    };\n    swap('zoom', 'startZoom');\n    swap('pan', 'startPan');\n    swap('position', 'startPosition');\n\n    // swap styles\n    if (_p.style) {\n      for (var i = 0; i < _p.style.length; i++) {\n        var prop = _p.style[i];\n        var name = prop.name;\n        var startStyleProp = _p.startStyle[name];\n        _p.startStyle[name] = prop;\n        _p.style[i] = startStyleProp;\n      }\n    }\n    if (wasPlaying) {\n      this.play();\n    }\n    return this;\n  },\n  promise: function promise(type) {\n    var _p = this._private;\n    var arr;\n    switch (type) {\n      case 'frame':\n        arr = _p.frames;\n        break;\n      default:\n      case 'complete':\n      case 'completed':\n        arr = _p.completes;\n    }\n    return new Promise$1(function (resolve, reject) {\n      arr.push(function () {\n        resolve();\n      });\n    });\n  }\n});\nanifn.complete = anifn.completed;\nanifn.run = anifn.play;\nanifn.running = anifn.playing;\n\nvar define$3 = {\n  animated: function animated() {\n    return function animatedImpl() {\n      var self = this;\n      var selfIsArrayLike = self.length !== undefined;\n      var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n      var cy = this._private.cy || this;\n      if (!cy.styleEnabled()) {\n        return false;\n      }\n      var ele = all[0];\n      if (ele) {\n        return ele._private.animation.current.length > 0;\n      }\n    };\n  },\n  // animated\n\n  clearQueue: function clearQueue() {\n    return function clearQueueImpl() {\n      var self = this;\n      var selfIsArrayLike = self.length !== undefined;\n      var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n      var cy = this._private.cy || this;\n      if (!cy.styleEnabled()) {\n        return this;\n      }\n      for (var i = 0; i < all.length; i++) {\n        var ele = all[i];\n        ele._private.animation.queue = [];\n      }\n      return this;\n    };\n  },\n  // clearQueue\n\n  delay: function delay() {\n    return function delayImpl(time, complete) {\n      var cy = this._private.cy || this;\n      if (!cy.styleEnabled()) {\n        return this;\n      }\n      return this.animate({\n        delay: time,\n        duration: time,\n        complete: complete\n      });\n    };\n  },\n  // delay\n\n  delayAnimation: function delayAnimation() {\n    return function delayAnimationImpl(time, complete) {\n      var cy = this._private.cy || this;\n      if (!cy.styleEnabled()) {\n        return this;\n      }\n      return this.animation({\n        delay: time,\n        duration: time,\n        complete: complete\n      });\n    };\n  },\n  // delay\n\n  animation: function animation() {\n    return function animationImpl(properties, params) {\n      var self = this;\n      var selfIsArrayLike = self.length !== undefined;\n      var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n      var cy = this._private.cy || this;\n      var isCore = !selfIsArrayLike;\n      var isEles = !isCore;\n      if (!cy.styleEnabled()) {\n        return this;\n      }\n      var style = cy.style();\n      properties = extend({}, properties, params);\n      var propertiesEmpty = Object.keys(properties).length === 0;\n      if (propertiesEmpty) {\n        return new Animation(all[0], properties); // nothing to animate\n      }\n      if (properties.duration === undefined) {\n        properties.duration = 400;\n      }\n      switch (properties.duration) {\n        case 'slow':\n          properties.duration = 600;\n          break;\n        case 'fast':\n          properties.duration = 200;\n          break;\n      }\n      if (isEles) {\n        properties.style = style.getPropsList(properties.style || properties.css);\n        properties.css = undefined;\n      }\n      if (isEles && properties.renderedPosition != null) {\n        var rpos = properties.renderedPosition;\n        var pan = cy.pan();\n        var zoom = cy.zoom();\n        properties.position = renderedToModelPosition(rpos, zoom, pan);\n      }\n\n      // override pan w/ panBy if set\n      if (isCore && properties.panBy != null) {\n        var panBy = properties.panBy;\n        var cyPan = cy.pan();\n        properties.pan = {\n          x: cyPan.x + panBy.x,\n          y: cyPan.y + panBy.y\n        };\n      }\n\n      // override pan w/ center if set\n      var center = properties.center || properties.centre;\n      if (isCore && center != null) {\n        var centerPan = cy.getCenterPan(center.eles, properties.zoom);\n        if (centerPan != null) {\n          properties.pan = centerPan;\n        }\n      }\n\n      // override pan & zoom w/ fit if set\n      if (isCore && properties.fit != null) {\n        var fit = properties.fit;\n        var fitVp = cy.getFitViewport(fit.eles || fit.boundingBox, fit.padding);\n        if (fitVp != null) {\n          properties.pan = fitVp.pan;\n          properties.zoom = fitVp.zoom;\n        }\n      }\n\n      // override zoom (& potentially pan) w/ zoom obj if set\n      if (isCore && plainObject(properties.zoom)) {\n        var vp = cy.getZoomedViewport(properties.zoom);\n        if (vp != null) {\n          if (vp.zoomed) {\n            properties.zoom = vp.zoom;\n          }\n          if (vp.panned) {\n            properties.pan = vp.pan;\n          }\n        } else {\n          properties.zoom = null; // an inavalid zoom (e.g. no delta) gets automatically destroyed\n        }\n      }\n      return new Animation(all[0], properties);\n    };\n  },\n  // animate\n\n  animate: function animate() {\n    return function animateImpl(properties, params) {\n      var self = this;\n      var selfIsArrayLike = self.length !== undefined;\n      var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n      var cy = this._private.cy || this;\n      if (!cy.styleEnabled()) {\n        return this;\n      }\n      if (params) {\n        properties = extend({}, properties, params);\n      }\n\n      // manually hook and run the animation\n      for (var i = 0; i < all.length; i++) {\n        var ele = all[i];\n        var queue = ele.animated() && (properties.queue === undefined || properties.queue);\n        var ani = ele.animation(properties, queue ? {\n          queue: true\n        } : undefined);\n        ani.play();\n      }\n      return this; // chaining\n    };\n  },\n  // animate\n\n  stop: function stop() {\n    return function stopImpl(clearQueue, jumpToEnd) {\n      var self = this;\n      var selfIsArrayLike = self.length !== undefined;\n      var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n      var cy = this._private.cy || this;\n      if (!cy.styleEnabled()) {\n        return this;\n      }\n      for (var i = 0; i < all.length; i++) {\n        var ele = all[i];\n        var _p = ele._private;\n        var anis = _p.animation.current;\n        for (var j = 0; j < anis.length; j++) {\n          var ani = anis[j];\n          var ani_p = ani._private;\n          if (jumpToEnd) {\n            // next iteration of the animation loop, the animation\n            // will go straight to the end and be removed\n            ani_p.duration = 0;\n          }\n        }\n\n        // clear the queue of future animations\n        if (clearQueue) {\n          _p.animation.queue = [];\n        }\n        if (!jumpToEnd) {\n          _p.animation.current = [];\n        }\n      }\n\n      // we have to notify (the animation loop doesn't do it for us on `stop`)\n      cy.notify('draw');\n      return this;\n    };\n  } // stop\n}; // define\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n\nvar isArray_1;\nvar hasRequiredIsArray;\n\nfunction requireIsArray () {\n\tif (hasRequiredIsArray) return isArray_1;\n\thasRequiredIsArray = 1;\n\tvar isArray = Array.isArray;\n\n\tisArray_1 = isArray;\n\treturn isArray_1;\n}\n\nvar _isKey;\nvar hasRequired_isKey;\n\nfunction require_isKey () {\n\tif (hasRequired_isKey) return _isKey;\n\thasRequired_isKey = 1;\n\tvar isArray = requireIsArray(),\n\t    isSymbol = requireIsSymbol();\n\n\t/** Used to match property names within property paths. */\n\tvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n\t    reIsPlainProp = /^\\w*$/;\n\n\t/**\n\t * Checks if `value` is a property name and not a property path.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {Object} [object] The object to query keys on.\n\t * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n\t */\n\tfunction isKey(value, object) {\n\t  if (isArray(value)) {\n\t    return false;\n\t  }\n\t  var type = typeof value;\n\t  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n\t      value == null || isSymbol(value)) {\n\t    return true;\n\t  }\n\t  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n\t    (object != null && value in Object(object));\n\t}\n\n\t_isKey = isKey;\n\treturn _isKey;\n}\n\nvar isFunction_1;\nvar hasRequiredIsFunction;\n\nfunction requireIsFunction () {\n\tif (hasRequiredIsFunction) return isFunction_1;\n\thasRequiredIsFunction = 1;\n\tvar baseGetTag = require_baseGetTag(),\n\t    isObject = requireIsObject();\n\n\t/** `Object#toString` result references. */\n\tvar asyncTag = '[object AsyncFunction]',\n\t    funcTag = '[object Function]',\n\t    genTag = '[object GeneratorFunction]',\n\t    proxyTag = '[object Proxy]';\n\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t  if (!isObject(value)) {\n\t    return false;\n\t  }\n\t  // The use of `Object#toString` avoids issues with the `typeof` operator\n\t  // in Safari 9 which returns 'object' for typed arrays and other constructors.\n\t  var tag = baseGetTag(value);\n\t  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n\t}\n\n\tisFunction_1 = isFunction;\n\treturn isFunction_1;\n}\n\nvar _coreJsData;\nvar hasRequired_coreJsData;\n\nfunction require_coreJsData () {\n\tif (hasRequired_coreJsData) return _coreJsData;\n\thasRequired_coreJsData = 1;\n\tvar root = require_root();\n\n\t/** Used to detect overreaching core-js shims. */\n\tvar coreJsData = root['__core-js_shared__'];\n\n\t_coreJsData = coreJsData;\n\treturn _coreJsData;\n}\n\nvar _isMasked;\nvar hasRequired_isMasked;\n\nfunction require_isMasked () {\n\tif (hasRequired_isMasked) return _isMasked;\n\thasRequired_isMasked = 1;\n\tvar coreJsData = require_coreJsData();\n\n\t/** Used to detect methods masquerading as native. */\n\tvar maskSrcKey = (function() {\n\t  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n\t  return uid ? ('Symbol(src)_1.' + uid) : '';\n\t}());\n\n\t/**\n\t * Checks if `func` has its source masked.\n\t *\n\t * @private\n\t * @param {Function} func The function to check.\n\t * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n\t */\n\tfunction isMasked(func) {\n\t  return !!maskSrcKey && (maskSrcKey in func);\n\t}\n\n\t_isMasked = isMasked;\n\treturn _isMasked;\n}\n\n/** Used for built-in method references. */\n\nvar _toSource;\nvar hasRequired_toSource;\n\nfunction require_toSource () {\n\tif (hasRequired_toSource) return _toSource;\n\thasRequired_toSource = 1;\n\tvar funcProto = Function.prototype;\n\n\t/** Used to resolve the decompiled source of functions. */\n\tvar funcToString = funcProto.toString;\n\n\t/**\n\t * Converts `func` to its source code.\n\t *\n\t * @private\n\t * @param {Function} func The function to convert.\n\t * @returns {string} Returns the source code.\n\t */\n\tfunction toSource(func) {\n\t  if (func != null) {\n\t    try {\n\t      return funcToString.call(func);\n\t    } catch (e) {}\n\t    try {\n\t      return (func + '');\n\t    } catch (e) {}\n\t  }\n\t  return '';\n\t}\n\n\t_toSource = toSource;\n\treturn _toSource;\n}\n\nvar _baseIsNative;\nvar hasRequired_baseIsNative;\n\nfunction require_baseIsNative () {\n\tif (hasRequired_baseIsNative) return _baseIsNative;\n\thasRequired_baseIsNative = 1;\n\tvar isFunction = requireIsFunction(),\n\t    isMasked = require_isMasked(),\n\t    isObject = requireIsObject(),\n\t    toSource = require_toSource();\n\n\t/**\n\t * Used to match `RegExp`\n\t * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n\t */\n\tvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n\t/** Used to detect host constructors (Safari). */\n\tvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n\t/** Used for built-in method references. */\n\tvar funcProto = Function.prototype,\n\t    objectProto = Object.prototype;\n\n\t/** Used to resolve the decompiled source of functions. */\n\tvar funcToString = funcProto.toString;\n\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\n\t/** Used to detect if a method is native. */\n\tvar reIsNative = RegExp('^' +\n\t  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n\t  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n\t);\n\n\t/**\n\t * The base implementation of `_.isNative` without bad shim checks.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a native function,\n\t *  else `false`.\n\t */\n\tfunction baseIsNative(value) {\n\t  if (!isObject(value) || isMasked(value)) {\n\t    return false;\n\t  }\n\t  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n\t  return pattern.test(toSource(value));\n\t}\n\n\t_baseIsNative = baseIsNative;\n\treturn _baseIsNative;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n\nvar _getValue;\nvar hasRequired_getValue;\n\nfunction require_getValue () {\n\tif (hasRequired_getValue) return _getValue;\n\thasRequired_getValue = 1;\n\tfunction getValue(object, key) {\n\t  return object == null ? undefined : object[key];\n\t}\n\n\t_getValue = getValue;\n\treturn _getValue;\n}\n\nvar _getNative;\nvar hasRequired_getNative;\n\nfunction require_getNative () {\n\tif (hasRequired_getNative) return _getNative;\n\thasRequired_getNative = 1;\n\tvar baseIsNative = require_baseIsNative(),\n\t    getValue = require_getValue();\n\n\t/**\n\t * Gets the native function at `key` of `object`.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {string} key The key of the method to get.\n\t * @returns {*} Returns the function if it's native, else `undefined`.\n\t */\n\tfunction getNative(object, key) {\n\t  var value = getValue(object, key);\n\t  return baseIsNative(value) ? value : undefined;\n\t}\n\n\t_getNative = getNative;\n\treturn _getNative;\n}\n\nvar _nativeCreate;\nvar hasRequired_nativeCreate;\n\nfunction require_nativeCreate () {\n\tif (hasRequired_nativeCreate) return _nativeCreate;\n\thasRequired_nativeCreate = 1;\n\tvar getNative = require_getNative();\n\n\t/* Built-in method references that are verified to be native. */\n\tvar nativeCreate = getNative(Object, 'create');\n\n\t_nativeCreate = nativeCreate;\n\treturn _nativeCreate;\n}\n\nvar _hashClear;\nvar hasRequired_hashClear;\n\nfunction require_hashClear () {\n\tif (hasRequired_hashClear) return _hashClear;\n\thasRequired_hashClear = 1;\n\tvar nativeCreate = require_nativeCreate();\n\n\t/**\n\t * Removes all key-value entries from the hash.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf Hash\n\t */\n\tfunction hashClear() {\n\t  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n\t  this.size = 0;\n\t}\n\n\t_hashClear = hashClear;\n\treturn _hashClear;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n\nvar _hashDelete;\nvar hasRequired_hashDelete;\n\nfunction require_hashDelete () {\n\tif (hasRequired_hashDelete) return _hashDelete;\n\thasRequired_hashDelete = 1;\n\tfunction hashDelete(key) {\n\t  var result = this.has(key) && delete this.__data__[key];\n\t  this.size -= result ? 1 : 0;\n\t  return result;\n\t}\n\n\t_hashDelete = hashDelete;\n\treturn _hashDelete;\n}\n\nvar _hashGet;\nvar hasRequired_hashGet;\n\nfunction require_hashGet () {\n\tif (hasRequired_hashGet) return _hashGet;\n\thasRequired_hashGet = 1;\n\tvar nativeCreate = require_nativeCreate();\n\n\t/** Used to stand-in for `undefined` hash values. */\n\tvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\n\t/**\n\t * Gets the hash value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction hashGet(key) {\n\t  var data = this.__data__;\n\t  if (nativeCreate) {\n\t    var result = data[key];\n\t    return result === HASH_UNDEFINED ? undefined : result;\n\t  }\n\t  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n\t}\n\n\t_hashGet = hashGet;\n\treturn _hashGet;\n}\n\nvar _hashHas;\nvar hasRequired_hashHas;\n\nfunction require_hashHas () {\n\tif (hasRequired_hashHas) return _hashHas;\n\thasRequired_hashHas = 1;\n\tvar nativeCreate = require_nativeCreate();\n\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\n\t/**\n\t * Checks if a hash value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf Hash\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction hashHas(key) {\n\t  var data = this.__data__;\n\t  return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n\t}\n\n\t_hashHas = hashHas;\n\treturn _hashHas;\n}\n\nvar _hashSet;\nvar hasRequired_hashSet;\n\nfunction require_hashSet () {\n\tif (hasRequired_hashSet) return _hashSet;\n\thasRequired_hashSet = 1;\n\tvar nativeCreate = require_nativeCreate();\n\n\t/** Used to stand-in for `undefined` hash values. */\n\tvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n\t/**\n\t * Sets the hash `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf Hash\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the hash instance.\n\t */\n\tfunction hashSet(key, value) {\n\t  var data = this.__data__;\n\t  this.size += this.has(key) ? 0 : 1;\n\t  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n\t  return this;\n\t}\n\n\t_hashSet = hashSet;\n\treturn _hashSet;\n}\n\nvar _Hash;\nvar hasRequired_Hash;\n\nfunction require_Hash () {\n\tif (hasRequired_Hash) return _Hash;\n\thasRequired_Hash = 1;\n\tvar hashClear = require_hashClear(),\n\t    hashDelete = require_hashDelete(),\n\t    hashGet = require_hashGet(),\n\t    hashHas = require_hashHas(),\n\t    hashSet = require_hashSet();\n\n\t/**\n\t * Creates a hash object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction Hash(entries) {\n\t  var index = -1,\n\t      length = entries == null ? 0 : entries.length;\n\n\t  this.clear();\n\t  while (++index < length) {\n\t    var entry = entries[index];\n\t    this.set(entry[0], entry[1]);\n\t  }\n\t}\n\n\t// Add methods to `Hash`.\n\tHash.prototype.clear = hashClear;\n\tHash.prototype['delete'] = hashDelete;\n\tHash.prototype.get = hashGet;\n\tHash.prototype.has = hashHas;\n\tHash.prototype.set = hashSet;\n\n\t_Hash = Hash;\n\treturn _Hash;\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n\nvar _listCacheClear;\nvar hasRequired_listCacheClear;\n\nfunction require_listCacheClear () {\n\tif (hasRequired_listCacheClear) return _listCacheClear;\n\thasRequired_listCacheClear = 1;\n\tfunction listCacheClear() {\n\t  this.__data__ = [];\n\t  this.size = 0;\n\t}\n\n\t_listCacheClear = listCacheClear;\n\treturn _listCacheClear;\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n\nvar eq_1;\nvar hasRequiredEq;\n\nfunction requireEq () {\n\tif (hasRequiredEq) return eq_1;\n\thasRequiredEq = 1;\n\tfunction eq(value, other) {\n\t  return value === other || (value !== value && other !== other);\n\t}\n\n\teq_1 = eq;\n\treturn eq_1;\n}\n\nvar _assocIndexOf;\nvar hasRequired_assocIndexOf;\n\nfunction require_assocIndexOf () {\n\tif (hasRequired_assocIndexOf) return _assocIndexOf;\n\thasRequired_assocIndexOf = 1;\n\tvar eq = requireEq();\n\n\t/**\n\t * Gets the index at which the `key` is found in `array` of key-value pairs.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {*} key The key to search for.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction assocIndexOf(array, key) {\n\t  var length = array.length;\n\t  while (length--) {\n\t    if (eq(array[length][0], key)) {\n\t      return length;\n\t    }\n\t  }\n\t  return -1;\n\t}\n\n\t_assocIndexOf = assocIndexOf;\n\treturn _assocIndexOf;\n}\n\nvar _listCacheDelete;\nvar hasRequired_listCacheDelete;\n\nfunction require_listCacheDelete () {\n\tif (hasRequired_listCacheDelete) return _listCacheDelete;\n\thasRequired_listCacheDelete = 1;\n\tvar assocIndexOf = require_assocIndexOf();\n\n\t/** Used for built-in method references. */\n\tvar arrayProto = Array.prototype;\n\n\t/** Built-in value references. */\n\tvar splice = arrayProto.splice;\n\n\t/**\n\t * Removes `key` and its value from the list cache.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction listCacheDelete(key) {\n\t  var data = this.__data__,\n\t      index = assocIndexOf(data, key);\n\n\t  if (index < 0) {\n\t    return false;\n\t  }\n\t  var lastIndex = data.length - 1;\n\t  if (index == lastIndex) {\n\t    data.pop();\n\t  } else {\n\t    splice.call(data, index, 1);\n\t  }\n\t  --this.size;\n\t  return true;\n\t}\n\n\t_listCacheDelete = listCacheDelete;\n\treturn _listCacheDelete;\n}\n\nvar _listCacheGet;\nvar hasRequired_listCacheGet;\n\nfunction require_listCacheGet () {\n\tif (hasRequired_listCacheGet) return _listCacheGet;\n\thasRequired_listCacheGet = 1;\n\tvar assocIndexOf = require_assocIndexOf();\n\n\t/**\n\t * Gets the list cache value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction listCacheGet(key) {\n\t  var data = this.__data__,\n\t      index = assocIndexOf(data, key);\n\n\t  return index < 0 ? undefined : data[index][1];\n\t}\n\n\t_listCacheGet = listCacheGet;\n\treturn _listCacheGet;\n}\n\nvar _listCacheHas;\nvar hasRequired_listCacheHas;\n\nfunction require_listCacheHas () {\n\tif (hasRequired_listCacheHas) return _listCacheHas;\n\thasRequired_listCacheHas = 1;\n\tvar assocIndexOf = require_assocIndexOf();\n\n\t/**\n\t * Checks if a list cache value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf ListCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction listCacheHas(key) {\n\t  return assocIndexOf(this.__data__, key) > -1;\n\t}\n\n\t_listCacheHas = listCacheHas;\n\treturn _listCacheHas;\n}\n\nvar _listCacheSet;\nvar hasRequired_listCacheSet;\n\nfunction require_listCacheSet () {\n\tif (hasRequired_listCacheSet) return _listCacheSet;\n\thasRequired_listCacheSet = 1;\n\tvar assocIndexOf = require_assocIndexOf();\n\n\t/**\n\t * Sets the list cache `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf ListCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the list cache instance.\n\t */\n\tfunction listCacheSet(key, value) {\n\t  var data = this.__data__,\n\t      index = assocIndexOf(data, key);\n\n\t  if (index < 0) {\n\t    ++this.size;\n\t    data.push([key, value]);\n\t  } else {\n\t    data[index][1] = value;\n\t  }\n\t  return this;\n\t}\n\n\t_listCacheSet = listCacheSet;\n\treturn _listCacheSet;\n}\n\nvar _ListCache;\nvar hasRequired_ListCache;\n\nfunction require_ListCache () {\n\tif (hasRequired_ListCache) return _ListCache;\n\thasRequired_ListCache = 1;\n\tvar listCacheClear = require_listCacheClear(),\n\t    listCacheDelete = require_listCacheDelete(),\n\t    listCacheGet = require_listCacheGet(),\n\t    listCacheHas = require_listCacheHas(),\n\t    listCacheSet = require_listCacheSet();\n\n\t/**\n\t * Creates an list cache object.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction ListCache(entries) {\n\t  var index = -1,\n\t      length = entries == null ? 0 : entries.length;\n\n\t  this.clear();\n\t  while (++index < length) {\n\t    var entry = entries[index];\n\t    this.set(entry[0], entry[1]);\n\t  }\n\t}\n\n\t// Add methods to `ListCache`.\n\tListCache.prototype.clear = listCacheClear;\n\tListCache.prototype['delete'] = listCacheDelete;\n\tListCache.prototype.get = listCacheGet;\n\tListCache.prototype.has = listCacheHas;\n\tListCache.prototype.set = listCacheSet;\n\n\t_ListCache = ListCache;\n\treturn _ListCache;\n}\n\nvar _Map;\nvar hasRequired_Map;\n\nfunction require_Map () {\n\tif (hasRequired_Map) return _Map;\n\thasRequired_Map = 1;\n\tvar getNative = require_getNative(),\n\t    root = require_root();\n\n\t/* Built-in method references that are verified to be native. */\n\tvar Map = getNative(root, 'Map');\n\n\t_Map = Map;\n\treturn _Map;\n}\n\nvar _mapCacheClear;\nvar hasRequired_mapCacheClear;\n\nfunction require_mapCacheClear () {\n\tif (hasRequired_mapCacheClear) return _mapCacheClear;\n\thasRequired_mapCacheClear = 1;\n\tvar Hash = require_Hash(),\n\t    ListCache = require_ListCache(),\n\t    Map = require_Map();\n\n\t/**\n\t * Removes all key-value entries from the map.\n\t *\n\t * @private\n\t * @name clear\n\t * @memberOf MapCache\n\t */\n\tfunction mapCacheClear() {\n\t  this.size = 0;\n\t  this.__data__ = {\n\t    'hash': new Hash,\n\t    'map': new (Map || ListCache),\n\t    'string': new Hash\n\t  };\n\t}\n\n\t_mapCacheClear = mapCacheClear;\n\treturn _mapCacheClear;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n\nvar _isKeyable;\nvar hasRequired_isKeyable;\n\nfunction require_isKeyable () {\n\tif (hasRequired_isKeyable) return _isKeyable;\n\thasRequired_isKeyable = 1;\n\tfunction isKeyable(value) {\n\t  var type = typeof value;\n\t  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n\t    ? (value !== '__proto__')\n\t    : (value === null);\n\t}\n\n\t_isKeyable = isKeyable;\n\treturn _isKeyable;\n}\n\nvar _getMapData;\nvar hasRequired_getMapData;\n\nfunction require_getMapData () {\n\tif (hasRequired_getMapData) return _getMapData;\n\thasRequired_getMapData = 1;\n\tvar isKeyable = require_isKeyable();\n\n\t/**\n\t * Gets the data for `map`.\n\t *\n\t * @private\n\t * @param {Object} map The map to query.\n\t * @param {string} key The reference key.\n\t * @returns {*} Returns the map data.\n\t */\n\tfunction getMapData(map, key) {\n\t  var data = map.__data__;\n\t  return isKeyable(key)\n\t    ? data[typeof key == 'string' ? 'string' : 'hash']\n\t    : data.map;\n\t}\n\n\t_getMapData = getMapData;\n\treturn _getMapData;\n}\n\nvar _mapCacheDelete;\nvar hasRequired_mapCacheDelete;\n\nfunction require_mapCacheDelete () {\n\tif (hasRequired_mapCacheDelete) return _mapCacheDelete;\n\thasRequired_mapCacheDelete = 1;\n\tvar getMapData = require_getMapData();\n\n\t/**\n\t * Removes `key` and its value from the map.\n\t *\n\t * @private\n\t * @name delete\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to remove.\n\t * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n\t */\n\tfunction mapCacheDelete(key) {\n\t  var result = getMapData(this, key)['delete'](key);\n\t  this.size -= result ? 1 : 0;\n\t  return result;\n\t}\n\n\t_mapCacheDelete = mapCacheDelete;\n\treturn _mapCacheDelete;\n}\n\nvar _mapCacheGet;\nvar hasRequired_mapCacheGet;\n\nfunction require_mapCacheGet () {\n\tif (hasRequired_mapCacheGet) return _mapCacheGet;\n\thasRequired_mapCacheGet = 1;\n\tvar getMapData = require_getMapData();\n\n\t/**\n\t * Gets the map value for `key`.\n\t *\n\t * @private\n\t * @name get\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to get.\n\t * @returns {*} Returns the entry value.\n\t */\n\tfunction mapCacheGet(key) {\n\t  return getMapData(this, key).get(key);\n\t}\n\n\t_mapCacheGet = mapCacheGet;\n\treturn _mapCacheGet;\n}\n\nvar _mapCacheHas;\nvar hasRequired_mapCacheHas;\n\nfunction require_mapCacheHas () {\n\tif (hasRequired_mapCacheHas) return _mapCacheHas;\n\thasRequired_mapCacheHas = 1;\n\tvar getMapData = require_getMapData();\n\n\t/**\n\t * Checks if a map value for `key` exists.\n\t *\n\t * @private\n\t * @name has\n\t * @memberOf MapCache\n\t * @param {string} key The key of the entry to check.\n\t * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n\t */\n\tfunction mapCacheHas(key) {\n\t  return getMapData(this, key).has(key);\n\t}\n\n\t_mapCacheHas = mapCacheHas;\n\treturn _mapCacheHas;\n}\n\nvar _mapCacheSet;\nvar hasRequired_mapCacheSet;\n\nfunction require_mapCacheSet () {\n\tif (hasRequired_mapCacheSet) return _mapCacheSet;\n\thasRequired_mapCacheSet = 1;\n\tvar getMapData = require_getMapData();\n\n\t/**\n\t * Sets the map `key` to `value`.\n\t *\n\t * @private\n\t * @name set\n\t * @memberOf MapCache\n\t * @param {string} key The key of the value to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns the map cache instance.\n\t */\n\tfunction mapCacheSet(key, value) {\n\t  var data = getMapData(this, key),\n\t      size = data.size;\n\n\t  data.set(key, value);\n\t  this.size += data.size == size ? 0 : 1;\n\t  return this;\n\t}\n\n\t_mapCacheSet = mapCacheSet;\n\treturn _mapCacheSet;\n}\n\nvar _MapCache;\nvar hasRequired_MapCache;\n\nfunction require_MapCache () {\n\tif (hasRequired_MapCache) return _MapCache;\n\thasRequired_MapCache = 1;\n\tvar mapCacheClear = require_mapCacheClear(),\n\t    mapCacheDelete = require_mapCacheDelete(),\n\t    mapCacheGet = require_mapCacheGet(),\n\t    mapCacheHas = require_mapCacheHas(),\n\t    mapCacheSet = require_mapCacheSet();\n\n\t/**\n\t * Creates a map cache object to store key-value pairs.\n\t *\n\t * @private\n\t * @constructor\n\t * @param {Array} [entries] The key-value pairs to cache.\n\t */\n\tfunction MapCache(entries) {\n\t  var index = -1,\n\t      length = entries == null ? 0 : entries.length;\n\n\t  this.clear();\n\t  while (++index < length) {\n\t    var entry = entries[index];\n\t    this.set(entry[0], entry[1]);\n\t  }\n\t}\n\n\t// Add methods to `MapCache`.\n\tMapCache.prototype.clear = mapCacheClear;\n\tMapCache.prototype['delete'] = mapCacheDelete;\n\tMapCache.prototype.get = mapCacheGet;\n\tMapCache.prototype.has = mapCacheHas;\n\tMapCache.prototype.set = mapCacheSet;\n\n\t_MapCache = MapCache;\n\treturn _MapCache;\n}\n\nvar memoize_1;\nvar hasRequiredMemoize;\n\nfunction requireMemoize () {\n\tif (hasRequiredMemoize) return memoize_1;\n\thasRequiredMemoize = 1;\n\tvar MapCache = require_MapCache();\n\n\t/** Error message constants. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\n\t/**\n\t * Creates a function that memoizes the result of `func`. If `resolver` is\n\t * provided, it determines the cache key for storing the result based on the\n\t * arguments provided to the memoized function. By default, the first argument\n\t * provided to the memoized function is used as the map cache key. The `func`\n\t * is invoked with the `this` binding of the memoized function.\n\t *\n\t * **Note:** The cache is exposed as the `cache` property on the memoized\n\t * function. Its creation may be customized by replacing the `_.memoize.Cache`\n\t * constructor with one whose instances implement the\n\t * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n\t * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Function\n\t * @param {Function} func The function to have its output memoized.\n\t * @param {Function} [resolver] The function to resolve the cache key.\n\t * @returns {Function} Returns the new memoized function.\n\t * @example\n\t *\n\t * var object = { 'a': 1, 'b': 2 };\n\t * var other = { 'c': 3, 'd': 4 };\n\t *\n\t * var values = _.memoize(_.values);\n\t * values(object);\n\t * // => [1, 2]\n\t *\n\t * values(other);\n\t * // => [3, 4]\n\t *\n\t * object.a = 2;\n\t * values(object);\n\t * // => [1, 2]\n\t *\n\t * // Modify the result cache.\n\t * values.cache.set(object, ['a', 'b']);\n\t * values(object);\n\t * // => ['a', 'b']\n\t *\n\t * // Replace `_.memoize.Cache`.\n\t * _.memoize.Cache = WeakMap;\n\t */\n\tfunction memoize(func, resolver) {\n\t  if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n\t    throw new TypeError(FUNC_ERROR_TEXT);\n\t  }\n\t  var memoized = function() {\n\t    var args = arguments,\n\t        key = resolver ? resolver.apply(this, args) : args[0],\n\t        cache = memoized.cache;\n\n\t    if (cache.has(key)) {\n\t      return cache.get(key);\n\t    }\n\t    var result = func.apply(this, args);\n\t    memoized.cache = cache.set(key, result) || cache;\n\t    return result;\n\t  };\n\t  memoized.cache = new (memoize.Cache || MapCache);\n\t  return memoized;\n\t}\n\n\t// Expose `MapCache`.\n\tmemoize.Cache = MapCache;\n\n\tmemoize_1 = memoize;\n\treturn memoize_1;\n}\n\nvar _memoizeCapped;\nvar hasRequired_memoizeCapped;\n\nfunction require_memoizeCapped () {\n\tif (hasRequired_memoizeCapped) return _memoizeCapped;\n\thasRequired_memoizeCapped = 1;\n\tvar memoize = requireMemoize();\n\n\t/** Used as the maximum memoize cache size. */\n\tvar MAX_MEMOIZE_SIZE = 500;\n\n\t/**\n\t * A specialized version of `_.memoize` which clears the memoized function's\n\t * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n\t *\n\t * @private\n\t * @param {Function} func The function to have its output memoized.\n\t * @returns {Function} Returns the new memoized function.\n\t */\n\tfunction memoizeCapped(func) {\n\t  var result = memoize(func, function(key) {\n\t    if (cache.size === MAX_MEMOIZE_SIZE) {\n\t      cache.clear();\n\t    }\n\t    return key;\n\t  });\n\n\t  var cache = result.cache;\n\t  return result;\n\t}\n\n\t_memoizeCapped = memoizeCapped;\n\treturn _memoizeCapped;\n}\n\nvar _stringToPath;\nvar hasRequired_stringToPath;\n\nfunction require_stringToPath () {\n\tif (hasRequired_stringToPath) return _stringToPath;\n\thasRequired_stringToPath = 1;\n\tvar memoizeCapped = require_memoizeCapped();\n\n\t/** Used to match property names within property paths. */\n\tvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n\t/** Used to match backslashes in property paths. */\n\tvar reEscapeChar = /\\\\(\\\\)?/g;\n\n\t/**\n\t * Converts `string` to a property path array.\n\t *\n\t * @private\n\t * @param {string} string The string to convert.\n\t * @returns {Array} Returns the property path array.\n\t */\n\tvar stringToPath = memoizeCapped(function(string) {\n\t  var result = [];\n\t  if (string.charCodeAt(0) === 46 /* . */) {\n\t    result.push('');\n\t  }\n\t  string.replace(rePropName, function(match, number, quote, subString) {\n\t    result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n\t  });\n\t  return result;\n\t});\n\n\t_stringToPath = stringToPath;\n\treturn _stringToPath;\n}\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n\nvar _arrayMap;\nvar hasRequired_arrayMap;\n\nfunction require_arrayMap () {\n\tif (hasRequired_arrayMap) return _arrayMap;\n\thasRequired_arrayMap = 1;\n\tfunction arrayMap(array, iteratee) {\n\t  var index = -1,\n\t      length = array == null ? 0 : array.length,\n\t      result = Array(length);\n\n\t  while (++index < length) {\n\t    result[index] = iteratee(array[index], index, array);\n\t  }\n\t  return result;\n\t}\n\n\t_arrayMap = arrayMap;\n\treturn _arrayMap;\n}\n\nvar _baseToString;\nvar hasRequired_baseToString;\n\nfunction require_baseToString () {\n\tif (hasRequired_baseToString) return _baseToString;\n\thasRequired_baseToString = 1;\n\tvar Symbol = require_Symbol(),\n\t    arrayMap = require_arrayMap(),\n\t    isArray = requireIsArray(),\n\t    isSymbol = requireIsSymbol();\n\n\t/** Used to convert symbols to primitives and strings. */\n\tvar symbolProto = Symbol ? Symbol.prototype : undefined,\n\t    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n\t/**\n\t * The base implementation of `_.toString` which doesn't convert nullish\n\t * values to empty strings.\n\t *\n\t * @private\n\t * @param {*} value The value to process.\n\t * @returns {string} Returns the string.\n\t */\n\tfunction baseToString(value) {\n\t  // Exit early for strings to avoid a performance hit in some environments.\n\t  if (typeof value == 'string') {\n\t    return value;\n\t  }\n\t  if (isArray(value)) {\n\t    // Recursively convert values (susceptible to call stack limits).\n\t    return arrayMap(value, baseToString) + '';\n\t  }\n\t  if (isSymbol(value)) {\n\t    return symbolToString ? symbolToString.call(value) : '';\n\t  }\n\t  var result = (value + '');\n\t  return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;\n\t}\n\n\t_baseToString = baseToString;\n\treturn _baseToString;\n}\n\nvar toString_1;\nvar hasRequiredToString;\n\nfunction requireToString () {\n\tif (hasRequiredToString) return toString_1;\n\thasRequiredToString = 1;\n\tvar baseToString = require_baseToString();\n\n\t/**\n\t * Converts `value` to a string. An empty string is returned for `null`\n\t * and `undefined` values. The sign of `-0` is preserved.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to convert.\n\t * @returns {string} Returns the converted string.\n\t * @example\n\t *\n\t * _.toString(null);\n\t * // => ''\n\t *\n\t * _.toString(-0);\n\t * // => '-0'\n\t *\n\t * _.toString([1, 2, 3]);\n\t * // => '1,2,3'\n\t */\n\tfunction toString(value) {\n\t  return value == null ? '' : baseToString(value);\n\t}\n\n\ttoString_1 = toString;\n\treturn toString_1;\n}\n\nvar _castPath;\nvar hasRequired_castPath;\n\nfunction require_castPath () {\n\tif (hasRequired_castPath) return _castPath;\n\thasRequired_castPath = 1;\n\tvar isArray = requireIsArray(),\n\t    isKey = require_isKey(),\n\t    stringToPath = require_stringToPath(),\n\t    toString = requireToString();\n\n\t/**\n\t * Casts `value` to a path array if it's not one.\n\t *\n\t * @private\n\t * @param {*} value The value to inspect.\n\t * @param {Object} [object] The object to query keys on.\n\t * @returns {Array} Returns the cast property path array.\n\t */\n\tfunction castPath(value, object) {\n\t  if (isArray(value)) {\n\t    return value;\n\t  }\n\t  return isKey(value, object) ? [value] : stringToPath(toString(value));\n\t}\n\n\t_castPath = castPath;\n\treturn _castPath;\n}\n\nvar _toKey;\nvar hasRequired_toKey;\n\nfunction require_toKey () {\n\tif (hasRequired_toKey) return _toKey;\n\thasRequired_toKey = 1;\n\tvar isSymbol = requireIsSymbol();\n\n\t/**\n\t * Converts `value` to a string key if it's not a string or symbol.\n\t *\n\t * @private\n\t * @param {*} value The value to inspect.\n\t * @returns {string|symbol} Returns the key.\n\t */\n\tfunction toKey(value) {\n\t  if (typeof value == 'string' || isSymbol(value)) {\n\t    return value;\n\t  }\n\t  var result = (value + '');\n\t  return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;\n\t}\n\n\t_toKey = toKey;\n\treturn _toKey;\n}\n\nvar _baseGet;\nvar hasRequired_baseGet;\n\nfunction require_baseGet () {\n\tif (hasRequired_baseGet) return _baseGet;\n\thasRequired_baseGet = 1;\n\tvar castPath = require_castPath(),\n\t    toKey = require_toKey();\n\n\t/**\n\t * The base implementation of `_.get` without support for default values.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} path The path of the property to get.\n\t * @returns {*} Returns the resolved value.\n\t */\n\tfunction baseGet(object, path) {\n\t  path = castPath(path, object);\n\n\t  var index = 0,\n\t      length = path.length;\n\n\t  while (object != null && index < length) {\n\t    object = object[toKey(path[index++])];\n\t  }\n\t  return (index && index == length) ? object : undefined;\n\t}\n\n\t_baseGet = baseGet;\n\treturn _baseGet;\n}\n\nvar get_1;\nvar hasRequiredGet;\n\nfunction requireGet () {\n\tif (hasRequiredGet) return get_1;\n\thasRequiredGet = 1;\n\tvar baseGet = require_baseGet();\n\n\t/**\n\t * Gets the value at `path` of `object`. If the resolved value is\n\t * `undefined`, the `defaultValue` is returned in its place.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.7.0\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} path The path of the property to get.\n\t * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n\t * @returns {*} Returns the resolved value.\n\t * @example\n\t *\n\t * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n\t *\n\t * _.get(object, 'a[0].b.c');\n\t * // => 3\n\t *\n\t * _.get(object, ['a', '0', 'b', 'c']);\n\t * // => 3\n\t *\n\t * _.get(object, 'a.b.c', 'default');\n\t * // => 'default'\n\t */\n\tfunction get(object, path, defaultValue) {\n\t  var result = object == null ? undefined : baseGet(object, path);\n\t  return result === undefined ? defaultValue : result;\n\t}\n\n\tget_1 = get;\n\treturn get_1;\n}\n\nvar getExports = requireGet();\nvar get = /*@__PURE__*/getDefaultExportFromCjs(getExports);\n\nvar _defineProperty;\nvar hasRequired_defineProperty;\n\nfunction require_defineProperty () {\n\tif (hasRequired_defineProperty) return _defineProperty;\n\thasRequired_defineProperty = 1;\n\tvar getNative = require_getNative();\n\n\tvar defineProperty = (function() {\n\t  try {\n\t    var func = getNative(Object, 'defineProperty');\n\t    func({}, '', {});\n\t    return func;\n\t  } catch (e) {}\n\t}());\n\n\t_defineProperty = defineProperty;\n\treturn _defineProperty;\n}\n\nvar _baseAssignValue;\nvar hasRequired_baseAssignValue;\n\nfunction require_baseAssignValue () {\n\tif (hasRequired_baseAssignValue) return _baseAssignValue;\n\thasRequired_baseAssignValue = 1;\n\tvar defineProperty = require_defineProperty();\n\n\t/**\n\t * The base implementation of `assignValue` and `assignMergeValue` without\n\t * value checks.\n\t *\n\t * @private\n\t * @param {Object} object The object to modify.\n\t * @param {string} key The key of the property to assign.\n\t * @param {*} value The value to assign.\n\t */\n\tfunction baseAssignValue(object, key, value) {\n\t  if (key == '__proto__' && defineProperty) {\n\t    defineProperty(object, key, {\n\t      'configurable': true,\n\t      'enumerable': true,\n\t      'value': value,\n\t      'writable': true\n\t    });\n\t  } else {\n\t    object[key] = value;\n\t  }\n\t}\n\n\t_baseAssignValue = baseAssignValue;\n\treturn _baseAssignValue;\n}\n\nvar _assignValue;\nvar hasRequired_assignValue;\n\nfunction require_assignValue () {\n\tif (hasRequired_assignValue) return _assignValue;\n\thasRequired_assignValue = 1;\n\tvar baseAssignValue = require_baseAssignValue(),\n\t    eq = requireEq();\n\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\n\t/**\n\t * Assigns `value` to `key` of `object` if the existing value is not equivalent\n\t * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n\t * for equality comparisons.\n\t *\n\t * @private\n\t * @param {Object} object The object to modify.\n\t * @param {string} key The key of the property to assign.\n\t * @param {*} value The value to assign.\n\t */\n\tfunction assignValue(object, key, value) {\n\t  var objValue = object[key];\n\t  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n\t      (value === undefined && !(key in object))) {\n\t    baseAssignValue(object, key, value);\n\t  }\n\t}\n\n\t_assignValue = assignValue;\n\treturn _assignValue;\n}\n\n/** Used as references for various `Number` constants. */\n\nvar _isIndex;\nvar hasRequired_isIndex;\n\nfunction require_isIndex () {\n\tif (hasRequired_isIndex) return _isIndex;\n\thasRequired_isIndex = 1;\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t  var type = typeof value;\n\t  length = length == null ? MAX_SAFE_INTEGER : length;\n\n\t  return !!length &&\n\t    (type == 'number' ||\n\t      (type != 'symbol' && reIsUint.test(value))) &&\n\t        (value > -1 && value % 1 == 0 && value < length);\n\t}\n\n\t_isIndex = isIndex;\n\treturn _isIndex;\n}\n\nvar _baseSet;\nvar hasRequired_baseSet;\n\nfunction require_baseSet () {\n\tif (hasRequired_baseSet) return _baseSet;\n\thasRequired_baseSet = 1;\n\tvar assignValue = require_assignValue(),\n\t    castPath = require_castPath(),\n\t    isIndex = require_isIndex(),\n\t    isObject = requireIsObject(),\n\t    toKey = require_toKey();\n\n\t/**\n\t * The base implementation of `_.set`.\n\t *\n\t * @private\n\t * @param {Object} object The object to modify.\n\t * @param {Array|string} path The path of the property to set.\n\t * @param {*} value The value to set.\n\t * @param {Function} [customizer] The function to customize path creation.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction baseSet(object, path, value, customizer) {\n\t  if (!isObject(object)) {\n\t    return object;\n\t  }\n\t  path = castPath(path, object);\n\n\t  var index = -1,\n\t      length = path.length,\n\t      lastIndex = length - 1,\n\t      nested = object;\n\n\t  while (nested != null && ++index < length) {\n\t    var key = toKey(path[index]),\n\t        newValue = value;\n\n\t    if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n\t      return object;\n\t    }\n\n\t    if (index != lastIndex) {\n\t      var objValue = nested[key];\n\t      newValue = customizer ? customizer(objValue, key, nested) : undefined;\n\t      if (newValue === undefined) {\n\t        newValue = isObject(objValue)\n\t          ? objValue\n\t          : (isIndex(path[index + 1]) ? [] : {});\n\t      }\n\t    }\n\t    assignValue(nested, key, newValue);\n\t    nested = nested[key];\n\t  }\n\t  return object;\n\t}\n\n\t_baseSet = baseSet;\n\treturn _baseSet;\n}\n\nvar set_1;\nvar hasRequiredSet;\n\nfunction requireSet () {\n\tif (hasRequiredSet) return set_1;\n\thasRequiredSet = 1;\n\tvar baseSet = require_baseSet();\n\n\t/**\n\t * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n\t * it's created. Arrays are created for missing index properties while objects\n\t * are created for all other missing properties. Use `_.setWith` to customize\n\t * `path` creation.\n\t *\n\t * **Note:** This method mutates `object`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.7.0\n\t * @category Object\n\t * @param {Object} object The object to modify.\n\t * @param {Array|string} path The path of the property to set.\n\t * @param {*} value The value to set.\n\t * @returns {Object} Returns `object`.\n\t * @example\n\t *\n\t * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n\t *\n\t * _.set(object, 'a[0].b.c', 4);\n\t * console.log(object.a[0].b.c);\n\t * // => 4\n\t *\n\t * _.set(object, ['x', '0', 'y', 'z'], 5);\n\t * console.log(object.x[0].y.z);\n\t * // => 5\n\t */\n\tfunction set(object, path, value) {\n\t  return object == null ? object : baseSet(object, path, value);\n\t}\n\n\tset_1 = set;\n\treturn set_1;\n}\n\nvar setExports = requireSet();\nvar set = /*@__PURE__*/getDefaultExportFromCjs(setExports);\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n\nvar _copyArray;\nvar hasRequired_copyArray;\n\nfunction require_copyArray () {\n\tif (hasRequired_copyArray) return _copyArray;\n\thasRequired_copyArray = 1;\n\tfunction copyArray(source, array) {\n\t  var index = -1,\n\t      length = source.length;\n\n\t  array || (array = Array(length));\n\t  while (++index < length) {\n\t    array[index] = source[index];\n\t  }\n\t  return array;\n\t}\n\n\t_copyArray = copyArray;\n\treturn _copyArray;\n}\n\nvar toPath_1;\nvar hasRequiredToPath;\n\nfunction requireToPath () {\n\tif (hasRequiredToPath) return toPath_1;\n\thasRequiredToPath = 1;\n\tvar arrayMap = require_arrayMap(),\n\t    copyArray = require_copyArray(),\n\t    isArray = requireIsArray(),\n\t    isSymbol = requireIsSymbol(),\n\t    stringToPath = require_stringToPath(),\n\t    toKey = require_toKey(),\n\t    toString = requireToString();\n\n\t/**\n\t * Converts `value` to a property path array.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Util\n\t * @param {*} value The value to convert.\n\t * @returns {Array} Returns the new property path array.\n\t * @example\n\t *\n\t * _.toPath('a.b.c');\n\t * // => ['a', 'b', 'c']\n\t *\n\t * _.toPath('a[0].b.c');\n\t * // => ['a', '0', 'b', 'c']\n\t */\n\tfunction toPath(value) {\n\t  if (isArray(value)) {\n\t    return arrayMap(value, toKey);\n\t  }\n\t  return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n\t}\n\n\ttoPath_1 = toPath;\n\treturn toPath_1;\n}\n\nvar toPathExports = requireToPath();\nvar toPath = /*@__PURE__*/getDefaultExportFromCjs(toPathExports);\n\nvar define$2 = {\n  // access data field\n  data: function data(params) {\n    var defaults = {\n      field: 'data',\n      bindingEvent: 'data',\n      allowBinding: false,\n      allowSetting: false,\n      allowGetting: false,\n      settingEvent: 'data',\n      settingTriggersEvent: false,\n      triggerFnName: 'trigger',\n      immutableKeys: {},\n      // key => true if immutable\n      updateStyle: false,\n      beforeGet: function beforeGet(self) {},\n      beforeSet: function beforeSet(self, obj) {},\n      onSet: function onSet(self) {},\n      canSet: function canSet(self) {\n        return true;\n      }\n    };\n    params = extend({}, defaults, params);\n    return function dataImpl(name, value) {\n      var p = params;\n      var self = this;\n      var selfIsArrayLike = self.length !== undefined;\n      var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n      var single = selfIsArrayLike ? self[0] : self;\n\n      // .data('foo', ...)\n      if (string(name)) {\n        // set or get property\n        var isPathLike = name.indexOf('.') !== -1; // there might be a normal field with a dot \n        var path = isPathLike && toPath(name);\n\n        // .data('foo')\n        if (p.allowGetting && value === undefined) {\n          // get\n\n          var ret;\n          if (single) {\n            p.beforeGet(single);\n\n            // check if it's path and a field with the same name doesn't exist\n            if (path && single._private[p.field][name] === undefined) {\n              ret = get(single._private[p.field], path);\n            } else {\n              ret = single._private[p.field][name];\n            }\n          }\n          return ret;\n\n          // .data('foo', 'bar')\n        } else if (p.allowSetting && value !== undefined) {\n          // set\n          var valid = !p.immutableKeys[name];\n          if (valid) {\n            var change = _defineProperty$1({}, name, value);\n            p.beforeSet(self, change);\n            for (var i = 0, l = all.length; i < l; i++) {\n              var ele = all[i];\n              if (p.canSet(ele)) {\n                if (path && single._private[p.field][name] === undefined) {\n                  set(ele._private[p.field], path, value);\n                } else {\n                  ele._private[p.field][name] = value;\n                }\n              }\n            }\n\n            // update mappers if asked\n            if (p.updateStyle) {\n              self.updateStyle();\n            }\n\n            // call onSet callback\n            p.onSet(self);\n            if (p.settingTriggersEvent) {\n              self[p.triggerFnName](p.settingEvent);\n            }\n          }\n        }\n\n        // .data({ 'foo': 'bar' })\n      } else if (p.allowSetting && plainObject(name)) {\n        // extend\n        var obj = name;\n        var k, v;\n        var keys = Object.keys(obj);\n        p.beforeSet(self, obj);\n        for (var _i = 0; _i < keys.length; _i++) {\n          k = keys[_i];\n          v = obj[k];\n          var _valid = !p.immutableKeys[k];\n          if (_valid) {\n            for (var j = 0; j < all.length; j++) {\n              var _ele = all[j];\n              if (p.canSet(_ele)) {\n                _ele._private[p.field][k] = v;\n              }\n            }\n          }\n        }\n\n        // update mappers if asked\n        if (p.updateStyle) {\n          self.updateStyle();\n        }\n\n        // call onSet callback\n        p.onSet(self);\n        if (p.settingTriggersEvent) {\n          self[p.triggerFnName](p.settingEvent);\n        }\n\n        // .data(function(){ ... })\n      } else if (p.allowBinding && fn$6(name)) {\n        // bind to event\n        var fn = name;\n        self.on(p.bindingEvent, fn);\n\n        // .data()\n      } else if (p.allowGetting && name === undefined) {\n        // get whole object\n        var _ret;\n        if (single) {\n          p.beforeGet(single);\n          _ret = single._private[p.field];\n        }\n        return _ret;\n      }\n      return self; // maintain chainability\n    }; // function\n  },\n  // data\n\n  // remove data field\n  removeData: function removeData(params) {\n    var defaults = {\n      field: 'data',\n      event: 'data',\n      triggerFnName: 'trigger',\n      triggerEvent: false,\n      immutableKeys: {} // key => true if immutable\n    };\n    params = extend({}, defaults, params);\n    return function removeDataImpl(names) {\n      var p = params;\n      var self = this;\n      var selfIsArrayLike = self.length !== undefined;\n      var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n\n      // .removeData('foo bar')\n      if (string(names)) {\n        // then get the list of keys, and delete them\n        var keys = names.split(/\\s+/);\n        var l = keys.length;\n        for (var i = 0; i < l; i++) {\n          // delete each non-empty key\n          var key = keys[i];\n          if (emptyString(key)) {\n            continue;\n          }\n          var valid = !p.immutableKeys[key]; // not valid if immutable\n          if (valid) {\n            for (var i_a = 0, l_a = all.length; i_a < l_a; i_a++) {\n              all[i_a]._private[p.field][key] = undefined;\n            }\n          }\n        }\n        if (p.triggerEvent) {\n          self[p.triggerFnName](p.event);\n        }\n\n        // .removeData()\n      } else if (names === undefined) {\n        // then delete all keys\n\n        for (var _i_a = 0, _l_a = all.length; _i_a < _l_a; _i_a++) {\n          var _privateFields = all[_i_a]._private[p.field];\n          var _keys = Object.keys(_privateFields);\n          for (var _i2 = 0; _i2 < _keys.length; _i2++) {\n            var _key = _keys[_i2];\n            var validKeyToDelete = !p.immutableKeys[_key];\n            if (validKeyToDelete) {\n              _privateFields[_key] = undefined;\n            }\n          }\n        }\n        if (p.triggerEvent) {\n          self[p.triggerFnName](p.event);\n        }\n      }\n      return self; // maintain chaining\n    }; // function\n  } // removeData\n}; // define\n\nvar define$1 = {\n  eventAliasesOn: function eventAliasesOn(proto) {\n    var p = proto;\n    p.addListener = p.listen = p.bind = p.on;\n    p.unlisten = p.unbind = p.off = p.removeListener;\n    p.trigger = p.emit;\n\n    // this is just a wrapper alias of .on()\n    p.pon = p.promiseOn = function (events, selector) {\n      var self = this;\n      var args = Array.prototype.slice.call(arguments, 0);\n      return new Promise$1(function (resolve, reject) {\n        var callback = function callback(e) {\n          self.off.apply(self, offArgs);\n          resolve(e);\n        };\n        var onArgs = args.concat([callback]);\n        var offArgs = onArgs.concat([]);\n        self.on.apply(self, onArgs);\n      });\n    };\n  }\n}; // define\n\n// use this module to cherry pick functions into your prototype\n// (useful for functions shared between the core and collections, for example)\n\nvar define = {};\n[define$3, define$2, define$1].forEach(function (m) {\n  extend(define, m);\n});\n\nvar elesfn$i = {\n  animate: define.animate(),\n  animation: define.animation(),\n  animated: define.animated(),\n  clearQueue: define.clearQueue(),\n  delay: define.delay(),\n  delayAnimation: define.delayAnimation(),\n  stop: define.stop()\n};\n\nvar elesfn$h = {\n  classes: function classes(_classes) {\n    var self = this;\n    if (_classes === undefined) {\n      var ret = [];\n      self[0]._private.classes.forEach(function (cls) {\n        return ret.push(cls);\n      });\n      return ret;\n    } else if (!array(_classes)) {\n      // extract classes from string\n      _classes = (_classes || '').match(/\\S+/g) || [];\n    }\n    var changed = [];\n    var classesSet = new Set$1(_classes);\n\n    // check and update each ele\n    for (var j = 0; j < self.length; j++) {\n      var ele = self[j];\n      var _p = ele._private;\n      var eleClasses = _p.classes;\n      var changedEle = false;\n\n      // check if ele has all of the passed classes\n      for (var i = 0; i < _classes.length; i++) {\n        var cls = _classes[i];\n        var eleHasClass = eleClasses.has(cls);\n        if (!eleHasClass) {\n          changedEle = true;\n          break;\n        }\n      }\n\n      // check if ele has classes outside of those passed\n      if (!changedEle) {\n        changedEle = eleClasses.size !== _classes.length;\n      }\n      if (changedEle) {\n        _p.classes = classesSet;\n        changed.push(ele);\n      }\n    }\n\n    // trigger update style on those eles that had class changes\n    if (changed.length > 0) {\n      this.spawn(changed).updateStyle().emit('class');\n    }\n    return self;\n  },\n  addClass: function addClass(classes) {\n    return this.toggleClass(classes, true);\n  },\n  hasClass: function hasClass(className) {\n    var ele = this[0];\n    return ele != null && ele._private.classes.has(className);\n  },\n  toggleClass: function toggleClass(classes, toggle) {\n    if (!array(classes)) {\n      // extract classes from string\n      classes = classes.match(/\\S+/g) || [];\n    }\n    var self = this;\n    var toggleUndefd = toggle === undefined;\n    var changed = []; // eles who had classes changed\n\n    for (var i = 0, il = self.length; i < il; i++) {\n      var ele = self[i];\n      var eleClasses = ele._private.classes;\n      var changedEle = false;\n      for (var j = 0; j < classes.length; j++) {\n        var cls = classes[j];\n        var hasClass = eleClasses.has(cls);\n        var changedNow = false;\n        if (toggle || toggleUndefd && !hasClass) {\n          eleClasses.add(cls);\n          changedNow = true;\n        } else if (!toggle || toggleUndefd && hasClass) {\n          eleClasses[\"delete\"](cls);\n          changedNow = true;\n        }\n        if (!changedEle && changedNow) {\n          changed.push(ele);\n          changedEle = true;\n        }\n      } // for j classes\n    } // for i eles\n\n    // trigger update style on those eles that had class changes\n    if (changed.length > 0) {\n      this.spawn(changed).updateStyle().emit('class');\n    }\n    return self;\n  },\n  removeClass: function removeClass(classes) {\n    return this.toggleClass(classes, false);\n  },\n  flashClass: function flashClass(classes, duration) {\n    var self = this;\n    if (duration == null) {\n      duration = 250;\n    } else if (duration === 0) {\n      return self; // nothing to do really\n    }\n    self.addClass(classes);\n    setTimeout(function () {\n      self.removeClass(classes);\n    }, duration);\n    return self;\n  }\n};\nelesfn$h.className = elesfn$h.classNames = elesfn$h.classes;\n\n// tokens in the query language\nvar tokens = {\n  metaChar: '[\\\\!\\\\\"\\\\#\\\\$\\\\%\\\\&\\\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\.\\\\/\\\\:\\\\;\\\\<\\\\=\\\\>\\\\?\\\\@\\\\[\\\\]\\\\^\\\\`\\\\{\\\\|\\\\}\\\\~]',\n  // chars we need to escape in let names, etc\n  comparatorOp: '=|\\\\!=|>|>=|<|<=|\\\\$=|\\\\^=|\\\\*=',\n  // binary comparison op (used in data selectors)\n  boolOp: '\\\\?|\\\\!|\\\\^',\n  // boolean (unary) operators (used in data selectors)\n  string: '\"(?:\\\\\\\\\"|[^\"])*\"' + '|' + \"'(?:\\\\\\\\'|[^'])*'\",\n  // string literals (used in data selectors) -- doublequotes | singlequotes\n  number: number,\n  // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123\n  meta: 'degree|indegree|outdegree',\n  // allowed metadata fields (i.e. allowed functions to use from Collection)\n  separator: '\\\\s*,\\\\s*',\n  // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass\n  descendant: '\\\\s+',\n  child: '\\\\s+>\\\\s+',\n  subject: '\\\\$',\n  group: 'node|edge|\\\\*',\n  directedEdge: '\\\\s+->\\\\s+',\n  undirectedEdge: '\\\\s+<->\\\\s+'\n};\ntokens.variable = '(?:[\\\\w-.]|(?:\\\\\\\\' + tokens.metaChar + '))+'; // a variable name can have letters, numbers, dashes, and periods\ntokens.className = '(?:[\\\\w-]|(?:\\\\\\\\' + tokens.metaChar + '))+'; // a class name has the same rules as a variable except it can't have a '.' in the name\ntokens.value = tokens.string + '|' + tokens.number; // a value literal, either a string or number\ntokens.id = tokens.variable; // an element id (follows variable conventions)\n\n(function () {\n  var ops, op, i;\n\n  // add @ variants to comparatorOp\n  ops = tokens.comparatorOp.split('|');\n  for (i = 0; i < ops.length; i++) {\n    op = ops[i];\n    tokens.comparatorOp += '|@' + op;\n  }\n\n  // add ! variants to comparatorOp\n  ops = tokens.comparatorOp.split('|');\n  for (i = 0; i < ops.length; i++) {\n    op = ops[i];\n    if (op.indexOf('!') >= 0) {\n      continue;\n    } // skip ops that explicitly contain !\n    if (op === '=') {\n      continue;\n    } // skip = b/c != is explicitly defined\n\n    tokens.comparatorOp += '|\\\\!' + op;\n  }\n})();\n\n/**\n * Make a new query object\n *\n * @prop type {Type} The type enum (int) of the query\n * @prop checks List of checks to make against an ele to test for a match\n */\nvar newQuery = function newQuery() {\n  return {\n    checks: []\n  };\n};\n\n/**\n * A check type enum-like object.  Uses integer values for fast match() lookup.\n * The ordering does not matter as long as the ints are unique.\n */\nvar Type = {\n  /** E.g. node */\n  GROUP: 0,\n  /** A collection of elements */\n  COLLECTION: 1,\n  /** A filter(ele) function */\n  FILTER: 2,\n  /** E.g. [foo > 1] */\n  DATA_COMPARE: 3,\n  /** E.g. [foo] */\n  DATA_EXIST: 4,\n  /** E.g. [?foo] */\n  DATA_BOOL: 5,\n  /** E.g. [[degree > 2]] */\n  META_COMPARE: 6,\n  /** E.g. :selected */\n  STATE: 7,\n  /** E.g. #foo */\n  ID: 8,\n  /** E.g. .foo */\n  CLASS: 9,\n  /** E.g. #foo <-> #bar */\n  UNDIRECTED_EDGE: 10,\n  /** E.g. #foo -> #bar */\n  DIRECTED_EDGE: 11,\n  /** E.g. $#foo -> #bar */\n  NODE_SOURCE: 12,\n  /** E.g. #foo -> $#bar */\n  NODE_TARGET: 13,\n  /** E.g. $#foo <-> #bar */\n  NODE_NEIGHBOR: 14,\n  /** E.g. #foo > #bar */\n  CHILD: 15,\n  /** E.g. #foo #bar */\n  DESCENDANT: 16,\n  /** E.g. $#foo > #bar */\n  PARENT: 17,\n  /** E.g. $#foo #bar */\n  ANCESTOR: 18,\n  /** E.g. #foo > $bar > #baz */\n  COMPOUND_SPLIT: 19,\n  /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */\n  TRUE: 20\n};\n\nvar stateSelectors = [{\n  selector: ':selected',\n  matches: function matches(ele) {\n    return ele.selected();\n  }\n}, {\n  selector: ':unselected',\n  matches: function matches(ele) {\n    return !ele.selected();\n  }\n}, {\n  selector: ':selectable',\n  matches: function matches(ele) {\n    return ele.selectable();\n  }\n}, {\n  selector: ':unselectable',\n  matches: function matches(ele) {\n    return !ele.selectable();\n  }\n}, {\n  selector: ':locked',\n  matches: function matches(ele) {\n    return ele.locked();\n  }\n}, {\n  selector: ':unlocked',\n  matches: function matches(ele) {\n    return !ele.locked();\n  }\n}, {\n  selector: ':visible',\n  matches: function matches(ele) {\n    return ele.visible();\n  }\n}, {\n  selector: ':hidden',\n  matches: function matches(ele) {\n    return !ele.visible();\n  }\n}, {\n  selector: ':transparent',\n  matches: function matches(ele) {\n    return ele.transparent();\n  }\n}, {\n  selector: ':grabbed',\n  matches: function matches(ele) {\n    return ele.grabbed();\n  }\n}, {\n  selector: ':free',\n  matches: function matches(ele) {\n    return !ele.grabbed();\n  }\n}, {\n  selector: ':removed',\n  matches: function matches(ele) {\n    return ele.removed();\n  }\n}, {\n  selector: ':inside',\n  matches: function matches(ele) {\n    return !ele.removed();\n  }\n}, {\n  selector: ':grabbable',\n  matches: function matches(ele) {\n    return ele.grabbable();\n  }\n}, {\n  selector: ':ungrabbable',\n  matches: function matches(ele) {\n    return !ele.grabbable();\n  }\n}, {\n  selector: ':animated',\n  matches: function matches(ele) {\n    return ele.animated();\n  }\n}, {\n  selector: ':unanimated',\n  matches: function matches(ele) {\n    return !ele.animated();\n  }\n}, {\n  selector: ':parent',\n  matches: function matches(ele) {\n    return ele.isParent();\n  }\n}, {\n  selector: ':childless',\n  matches: function matches(ele) {\n    return ele.isChildless();\n  }\n}, {\n  selector: ':child',\n  matches: function matches(ele) {\n    return ele.isChild();\n  }\n}, {\n  selector: ':orphan',\n  matches: function matches(ele) {\n    return ele.isOrphan();\n  }\n}, {\n  selector: ':nonorphan',\n  matches: function matches(ele) {\n    return ele.isChild();\n  }\n}, {\n  selector: ':compound',\n  matches: function matches(ele) {\n    if (ele.isNode()) {\n      return ele.isParent();\n    } else {\n      return ele.source().isParent() || ele.target().isParent();\n    }\n  }\n}, {\n  selector: ':loop',\n  matches: function matches(ele) {\n    return ele.isLoop();\n  }\n}, {\n  selector: ':simple',\n  matches: function matches(ele) {\n    return ele.isSimple();\n  }\n}, {\n  selector: ':active',\n  matches: function matches(ele) {\n    return ele.active();\n  }\n}, {\n  selector: ':inactive',\n  matches: function matches(ele) {\n    return !ele.active();\n  }\n}, {\n  selector: ':backgrounding',\n  matches: function matches(ele) {\n    return ele.backgrounding();\n  }\n}, {\n  selector: ':nonbackgrounding',\n  matches: function matches(ele) {\n    return !ele.backgrounding();\n  }\n}].sort(function (a, b) {\n  // n.b. selectors that are starting substrings of others must have the longer ones first\n  return descending(a.selector, b.selector);\n});\nvar lookup = function () {\n  var selToFn = {};\n  var s;\n  for (var i = 0; i < stateSelectors.length; i++) {\n    s = stateSelectors[i];\n    selToFn[s.selector] = s.matches;\n  }\n  return selToFn;\n}();\nvar stateSelectorMatches = function stateSelectorMatches(sel, ele) {\n  return lookup[sel](ele);\n};\nvar stateSelectorRegex = '(' + stateSelectors.map(function (s) {\n  return s.selector;\n}).join('|') + ')';\n\n// when a token like a variable has escaped meta characters, we need to clean the backslashes out\n// so that values get compared properly in Selector.filter()\nvar cleanMetaChars = function cleanMetaChars(str) {\n  return str.replace(new RegExp('\\\\\\\\(' + tokens.metaChar + ')', 'g'), function (match, $1) {\n    return $1;\n  });\n};\nvar replaceLastQuery = function replaceLastQuery(selector, examiningQuery, replacementQuery) {\n  selector[selector.length - 1] = replacementQuery;\n};\n\n// NOTE: add new expression syntax here to have it recognised by the parser;\n// - a query contains all adjacent (i.e. no separator in between) expressions;\n// - the current query is stored in selector[i]\n// - you need to check the query objects in match() for it actually filter properly, but that's pretty straight forward\nvar exprs = [{\n  name: 'group',\n  // just used for identifying when debugging\n  query: true,\n  regex: '(' + tokens.group + ')',\n  populate: function populate(selector, query, _ref) {\n    var _ref2 = _slicedToArray(_ref, 1),\n      group = _ref2[0];\n    query.checks.push({\n      type: Type.GROUP,\n      value: group === '*' ? group : group + 's'\n    });\n  }\n}, {\n  name: 'state',\n  query: true,\n  regex: stateSelectorRegex,\n  populate: function populate(selector, query, _ref3) {\n    var _ref4 = _slicedToArray(_ref3, 1),\n      state = _ref4[0];\n    query.checks.push({\n      type: Type.STATE,\n      value: state\n    });\n  }\n}, {\n  name: 'id',\n  query: true,\n  regex: '\\\\#(' + tokens.id + ')',\n  populate: function populate(selector, query, _ref5) {\n    var _ref6 = _slicedToArray(_ref5, 1),\n      id = _ref6[0];\n    query.checks.push({\n      type: Type.ID,\n      value: cleanMetaChars(id)\n    });\n  }\n}, {\n  name: 'className',\n  query: true,\n  regex: '\\\\.(' + tokens.className + ')',\n  populate: function populate(selector, query, _ref7) {\n    var _ref8 = _slicedToArray(_ref7, 1),\n      className = _ref8[0];\n    query.checks.push({\n      type: Type.CLASS,\n      value: cleanMetaChars(className)\n    });\n  }\n}, {\n  name: 'dataExists',\n  query: true,\n  regex: '\\\\[\\\\s*(' + tokens.variable + ')\\\\s*\\\\]',\n  populate: function populate(selector, query, _ref9) {\n    var _ref10 = _slicedToArray(_ref9, 1),\n      variable = _ref10[0];\n    query.checks.push({\n      type: Type.DATA_EXIST,\n      field: cleanMetaChars(variable)\n    });\n  }\n}, {\n  name: 'dataCompare',\n  query: true,\n  regex: '\\\\[\\\\s*(' + tokens.variable + ')\\\\s*(' + tokens.comparatorOp + ')\\\\s*(' + tokens.value + ')\\\\s*\\\\]',\n  populate: function populate(selector, query, _ref11) {\n    var _ref12 = _slicedToArray(_ref11, 3),\n      variable = _ref12[0],\n      comparatorOp = _ref12[1],\n      value = _ref12[2];\n    var valueIsString = new RegExp('^' + tokens.string + '$').exec(value) != null;\n    if (valueIsString) {\n      value = value.substring(1, value.length - 1);\n    } else {\n      value = parseFloat(value);\n    }\n    query.checks.push({\n      type: Type.DATA_COMPARE,\n      field: cleanMetaChars(variable),\n      operator: comparatorOp,\n      value: value\n    });\n  }\n}, {\n  name: 'dataBool',\n  query: true,\n  regex: '\\\\[\\\\s*(' + tokens.boolOp + ')\\\\s*(' + tokens.variable + ')\\\\s*\\\\]',\n  populate: function populate(selector, query, _ref13) {\n    var _ref14 = _slicedToArray(_ref13, 2),\n      boolOp = _ref14[0],\n      variable = _ref14[1];\n    query.checks.push({\n      type: Type.DATA_BOOL,\n      field: cleanMetaChars(variable),\n      operator: boolOp\n    });\n  }\n}, {\n  name: 'metaCompare',\n  query: true,\n  regex: '\\\\[\\\\[\\\\s*(' + tokens.meta + ')\\\\s*(' + tokens.comparatorOp + ')\\\\s*(' + tokens.number + ')\\\\s*\\\\]\\\\]',\n  populate: function populate(selector, query, _ref15) {\n    var _ref16 = _slicedToArray(_ref15, 3),\n      meta = _ref16[0],\n      comparatorOp = _ref16[1],\n      number = _ref16[2];\n    query.checks.push({\n      type: Type.META_COMPARE,\n      field: cleanMetaChars(meta),\n      operator: comparatorOp,\n      value: parseFloat(number)\n    });\n  }\n}, {\n  name: 'nextQuery',\n  separator: true,\n  regex: tokens.separator,\n  populate: function populate(selector, query) {\n    var currentSubject = selector.currentSubject;\n    var edgeCount = selector.edgeCount;\n    var compoundCount = selector.compoundCount;\n    var lastQ = selector[selector.length - 1];\n    if (currentSubject != null) {\n      lastQ.subject = currentSubject;\n      selector.currentSubject = null;\n    }\n    lastQ.edgeCount = edgeCount;\n    lastQ.compoundCount = compoundCount;\n    selector.edgeCount = 0;\n    selector.compoundCount = 0;\n\n    // go on to next query\n    var nextQuery = selector[selector.length++] = newQuery();\n    return nextQuery; // this is the new query to be filled by the following exprs\n  }\n}, {\n  name: 'directedEdge',\n  separator: true,\n  regex: tokens.directedEdge,\n  populate: function populate(selector, query) {\n    if (selector.currentSubject == null) {\n      // undirected edge\n      var edgeQuery = newQuery();\n      var source = query;\n      var target = newQuery();\n      edgeQuery.checks.push({\n        type: Type.DIRECTED_EDGE,\n        source: source,\n        target: target\n      });\n\n      // the query in the selector should be the edge rather than the source\n      replaceLastQuery(selector, query, edgeQuery);\n      selector.edgeCount++;\n\n      // we're now populating the target query with expressions that follow\n      return target;\n    } else {\n      // source/target\n      var srcTgtQ = newQuery();\n      var _source = query;\n      var _target = newQuery();\n      srcTgtQ.checks.push({\n        type: Type.NODE_SOURCE,\n        source: _source,\n        target: _target\n      });\n\n      // the query in the selector should be the neighbourhood rather than the node\n      replaceLastQuery(selector, query, srcTgtQ);\n      selector.edgeCount++;\n      return _target; // now populating the target with the following expressions\n    }\n  }\n}, {\n  name: 'undirectedEdge',\n  separator: true,\n  regex: tokens.undirectedEdge,\n  populate: function populate(selector, query) {\n    if (selector.currentSubject == null) {\n      // undirected edge\n      var edgeQuery = newQuery();\n      var source = query;\n      var target = newQuery();\n      edgeQuery.checks.push({\n        type: Type.UNDIRECTED_EDGE,\n        nodes: [source, target]\n      });\n\n      // the query in the selector should be the edge rather than the source\n      replaceLastQuery(selector, query, edgeQuery);\n      selector.edgeCount++;\n\n      // we're now populating the target query with expressions that follow\n      return target;\n    } else {\n      // neighbourhood\n      var nhoodQ = newQuery();\n      var node = query;\n      var neighbor = newQuery();\n      nhoodQ.checks.push({\n        type: Type.NODE_NEIGHBOR,\n        node: node,\n        neighbor: neighbor\n      });\n\n      // the query in the selector should be the neighbourhood rather than the node\n      replaceLastQuery(selector, query, nhoodQ);\n      return neighbor; // now populating the neighbor with following expressions\n    }\n  }\n}, {\n  name: 'child',\n  separator: true,\n  regex: tokens.child,\n  populate: function populate(selector, query) {\n    if (selector.currentSubject == null) {\n      // default: child query\n      var parentChildQuery = newQuery();\n      var child = newQuery();\n      var parent = selector[selector.length - 1];\n      parentChildQuery.checks.push({\n        type: Type.CHILD,\n        parent: parent,\n        child: child\n      });\n\n      // the query in the selector should be the '>' itself\n      replaceLastQuery(selector, query, parentChildQuery);\n      selector.compoundCount++;\n\n      // we're now populating the child query with expressions that follow\n      return child;\n    } else if (selector.currentSubject === query) {\n      // compound split query\n      var compound = newQuery();\n      var left = selector[selector.length - 1];\n      var right = newQuery();\n      var subject = newQuery();\n      var _child = newQuery();\n      var _parent = newQuery();\n\n      // set up the root compound q\n      compound.checks.push({\n        type: Type.COMPOUND_SPLIT,\n        left: left,\n        right: right,\n        subject: subject\n      });\n\n      // populate the subject and replace the q at the old spot (within left) with TRUE\n      subject.checks = query.checks; // take the checks from the left\n      query.checks = [{\n        type: Type.TRUE\n      }]; // checks under left refs the subject implicitly\n\n      // set up the right q\n      _parent.checks.push({\n        type: Type.TRUE\n      }); // parent implicitly refs the subject\n      right.checks.push({\n        type: Type.PARENT,\n        // type is swapped on right side queries\n        parent: _parent,\n        child: _child // empty for now\n      });\n      replaceLastQuery(selector, left, compound);\n\n      // update the ref since we moved things around for `query`\n      selector.currentSubject = subject;\n      selector.compoundCount++;\n      return _child; // now populating the right side's child\n    } else {\n      // parent query\n      // info for parent query\n      var _parent2 = newQuery();\n      var _child2 = newQuery();\n      var pcQChecks = [{\n        type: Type.PARENT,\n        parent: _parent2,\n        child: _child2\n      }];\n\n      // the parent-child query takes the place of the query previously being populated\n      _parent2.checks = query.checks; // the previous query contains the checks for the parent\n      query.checks = pcQChecks; // pc query takes over\n\n      selector.compoundCount++;\n      return _child2; // we're now populating the child\n    }\n  }\n}, {\n  name: 'descendant',\n  separator: true,\n  regex: tokens.descendant,\n  populate: function populate(selector, query) {\n    if (selector.currentSubject == null) {\n      // default: descendant query\n      var ancChQuery = newQuery();\n      var descendant = newQuery();\n      var ancestor = selector[selector.length - 1];\n      ancChQuery.checks.push({\n        type: Type.DESCENDANT,\n        ancestor: ancestor,\n        descendant: descendant\n      });\n\n      // the query in the selector should be the '>' itself\n      replaceLastQuery(selector, query, ancChQuery);\n      selector.compoundCount++;\n\n      // we're now populating the descendant query with expressions that follow\n      return descendant;\n    } else if (selector.currentSubject === query) {\n      // compound split query\n      var compound = newQuery();\n      var left = selector[selector.length - 1];\n      var right = newQuery();\n      var subject = newQuery();\n      var _descendant = newQuery();\n      var _ancestor = newQuery();\n\n      // set up the root compound q\n      compound.checks.push({\n        type: Type.COMPOUND_SPLIT,\n        left: left,\n        right: right,\n        subject: subject\n      });\n\n      // populate the subject and replace the q at the old spot (within left) with TRUE\n      subject.checks = query.checks; // take the checks from the left\n      query.checks = [{\n        type: Type.TRUE\n      }]; // checks under left refs the subject implicitly\n\n      // set up the right q\n      _ancestor.checks.push({\n        type: Type.TRUE\n      }); // ancestor implicitly refs the subject\n      right.checks.push({\n        type: Type.ANCESTOR,\n        // type is swapped on right side queries\n        ancestor: _ancestor,\n        descendant: _descendant // empty for now\n      });\n      replaceLastQuery(selector, left, compound);\n\n      // update the ref since we moved things around for `query`\n      selector.currentSubject = subject;\n      selector.compoundCount++;\n      return _descendant; // now populating the right side's descendant\n    } else {\n      // ancestor query\n      // info for parent query\n      var _ancestor2 = newQuery();\n      var _descendant2 = newQuery();\n      var adQChecks = [{\n        type: Type.ANCESTOR,\n        ancestor: _ancestor2,\n        descendant: _descendant2\n      }];\n\n      // the parent-child query takes the place of the query previously being populated\n      _ancestor2.checks = query.checks; // the previous query contains the checks for the parent\n      query.checks = adQChecks; // pc query takes over\n\n      selector.compoundCount++;\n      return _descendant2; // we're now populating the child\n    }\n  }\n}, {\n  name: 'subject',\n  modifier: true,\n  regex: tokens.subject,\n  populate: function populate(selector, query) {\n    if (selector.currentSubject != null && selector.currentSubject !== query) {\n      warn('Redefinition of subject in selector `' + selector.toString() + '`');\n      return false;\n    }\n    selector.currentSubject = query;\n    var topQ = selector[selector.length - 1];\n    var topChk = topQ.checks[0];\n    var topType = topChk == null ? null : topChk.type;\n    if (topType === Type.DIRECTED_EDGE) {\n      // directed edge with subject on the target\n\n      // change to target node check\n      topChk.type = Type.NODE_TARGET;\n    } else if (topType === Type.UNDIRECTED_EDGE) {\n      // undirected edge with subject on the second node\n\n      // change to neighbor check\n      topChk.type = Type.NODE_NEIGHBOR;\n      topChk.node = topChk.nodes[1]; // second node is subject\n      topChk.neighbor = topChk.nodes[0];\n\n      // clean up unused fields for new type\n      topChk.nodes = null;\n    }\n  }\n}];\nexprs.forEach(function (e) {\n  return e.regexObj = new RegExp('^' + e.regex);\n});\n\n/**\n * Of all the expressions, find the first match in the remaining text.\n * @param {string} remaining The remaining text to parse\n * @returns The matched expression and the newly remaining text `{ expr, match, name, remaining }`\n */\nvar consumeExpr = function consumeExpr(remaining) {\n  var expr;\n  var match;\n  var name;\n  for (var j = 0; j < exprs.length; j++) {\n    var e = exprs[j];\n    var n = e.name;\n    var m = remaining.match(e.regexObj);\n    if (m != null) {\n      match = m;\n      expr = e;\n      name = n;\n      var consumed = m[0];\n      remaining = remaining.substring(consumed.length);\n      break; // we've consumed one expr, so we can return now\n    }\n  }\n  return {\n    expr: expr,\n    match: match,\n    name: name,\n    remaining: remaining\n  };\n};\n\n/**\n * Consume all the leading whitespace\n * @param {string} remaining The text to consume\n * @returns The text with the leading whitespace removed\n */\nvar consumeWhitespace = function consumeWhitespace(remaining) {\n  var match = remaining.match(/^\\s+/);\n  if (match) {\n    var consumed = match[0];\n    remaining = remaining.substring(consumed.length);\n  }\n  return remaining;\n};\n\n/**\n * Parse the string and store the parsed representation in the Selector.\n * @param {string} selector The selector string\n * @returns `true` if the selector was successfully parsed, `false` otherwise\n */\nvar parse = function parse(selector) {\n  var self = this;\n  var remaining = self.inputText = selector;\n  var currentQuery = self[0] = newQuery();\n  self.length = 1;\n  remaining = consumeWhitespace(remaining); // get rid of leading whitespace\n\n  for (;;) {\n    var exprInfo = consumeExpr(remaining);\n    if (exprInfo.expr == null) {\n      warn('The selector `' + selector + '`is invalid');\n      return false;\n    } else {\n      var args = exprInfo.match.slice(1);\n\n      // let the token populate the selector object in currentQuery\n      var ret = exprInfo.expr.populate(self, currentQuery, args);\n      if (ret === false) {\n        return false; // exit if population failed\n      } else if (ret != null) {\n        currentQuery = ret; // change the current query to be filled if the expr specifies\n      }\n    }\n    remaining = exprInfo.remaining;\n\n    // we're done when there's nothing left to parse\n    if (remaining.match(/^\\s*$/)) {\n      break;\n    }\n  }\n  var lastQ = self[self.length - 1];\n  if (self.currentSubject != null) {\n    lastQ.subject = self.currentSubject;\n  }\n  lastQ.edgeCount = self.edgeCount;\n  lastQ.compoundCount = self.compoundCount;\n  for (var i = 0; i < self.length; i++) {\n    var q = self[i];\n\n    // in future, this could potentially be allowed if there were operator precedence and detection of invalid combinations\n    if (q.compoundCount > 0 && q.edgeCount > 0) {\n      warn('The selector `' + selector + '` is invalid because it uses both a compound selector and an edge selector');\n      return false;\n    }\n    if (q.edgeCount > 1) {\n      warn('The selector `' + selector + '` is invalid because it uses multiple edge selectors');\n      return false;\n    } else if (q.edgeCount === 1) {\n      warn('The selector `' + selector + '` is deprecated.  Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons.  Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.');\n    }\n  }\n  return true; // success\n};\n\n/**\n * Get the selector represented as a string.  This value uses default formatting,\n * so things like spacing may differ from the input text passed to the constructor.\n * @returns {string} The selector string\n */\nvar toString = function toString() {\n  if (this.toStringCache != null) {\n    return this.toStringCache;\n  }\n  var clean = function clean(obj) {\n    if (obj == null) {\n      return '';\n    } else {\n      return obj;\n    }\n  };\n  var cleanVal = function cleanVal(val) {\n    if (string(val)) {\n      return '\"' + val + '\"';\n    } else {\n      return clean(val);\n    }\n  };\n  var space = function space(val) {\n    return ' ' + val + ' ';\n  };\n  var checkToString = function checkToString(check, subject) {\n    var type = check.type,\n      value = check.value;\n    switch (type) {\n      case Type.GROUP:\n        {\n          var group = clean(value);\n          return group.substring(0, group.length - 1);\n        }\n      case Type.DATA_COMPARE:\n        {\n          var field = check.field,\n            operator = check.operator;\n          return '[' + field + space(clean(operator)) + cleanVal(value) + ']';\n        }\n      case Type.DATA_BOOL:\n        {\n          var _operator = check.operator,\n            _field = check.field;\n          return '[' + clean(_operator) + _field + ']';\n        }\n      case Type.DATA_EXIST:\n        {\n          var _field2 = check.field;\n          return '[' + _field2 + ']';\n        }\n      case Type.META_COMPARE:\n        {\n          var _operator2 = check.operator,\n            _field3 = check.field;\n          return '[[' + _field3 + space(clean(_operator2)) + cleanVal(value) + ']]';\n        }\n      case Type.STATE:\n        {\n          return value;\n        }\n      case Type.ID:\n        {\n          return '#' + value;\n        }\n      case Type.CLASS:\n        {\n          return '.' + value;\n        }\n      case Type.PARENT:\n      case Type.CHILD:\n        {\n          return queryToString(check.parent, subject) + space('>') + queryToString(check.child, subject);\n        }\n      case Type.ANCESTOR:\n      case Type.DESCENDANT:\n        {\n          return queryToString(check.ancestor, subject) + ' ' + queryToString(check.descendant, subject);\n        }\n      case Type.COMPOUND_SPLIT:\n        {\n          var lhs = queryToString(check.left, subject);\n          var sub = queryToString(check.subject, subject);\n          var rhs = queryToString(check.right, subject);\n          return lhs + (lhs.length > 0 ? ' ' : '') + sub + rhs;\n        }\n      case Type.TRUE:\n        {\n          return '';\n        }\n    }\n  };\n  var queryToString = function queryToString(query, subject) {\n    return query.checks.reduce(function (str, chk, i) {\n      return str + (subject === query && i === 0 ? '$' : '') + checkToString(chk, subject);\n    }, '');\n  };\n  var str = '';\n  for (var i = 0; i < this.length; i++) {\n    var query = this[i];\n    str += queryToString(query, query.subject);\n    if (this.length > 1 && i < this.length - 1) {\n      str += ', ';\n    }\n  }\n  this.toStringCache = str;\n  return str;\n};\nvar parse$1 = {\n  parse: parse,\n  toString: toString\n};\n\nvar valCmp = function valCmp(fieldVal, operator, value) {\n  var matches;\n  var isFieldStr = string(fieldVal);\n  var isFieldNum = number$1(fieldVal);\n  var isValStr = string(value);\n  var fieldStr, valStr;\n  var caseInsensitive = false;\n  var notExpr = false;\n  var isIneqCmp = false;\n  if (operator.indexOf('!') >= 0) {\n    operator = operator.replace('!', '');\n    notExpr = true;\n  }\n  if (operator.indexOf('@') >= 0) {\n    operator = operator.replace('@', '');\n    caseInsensitive = true;\n  }\n  if (isFieldStr || isValStr || caseInsensitive) {\n    fieldStr = !isFieldStr && !isFieldNum ? '' : '' + fieldVal;\n    valStr = '' + value;\n  }\n\n  // if we're doing a case insensitive comparison, then we're using a STRING comparison\n  // even if we're comparing numbers\n  if (caseInsensitive) {\n    fieldVal = fieldStr = fieldStr.toLowerCase();\n    value = valStr = valStr.toLowerCase();\n  }\n  switch (operator) {\n    case '*=':\n      matches = fieldStr.indexOf(valStr) >= 0;\n      break;\n    case '$=':\n      matches = fieldStr.indexOf(valStr, fieldStr.length - valStr.length) >= 0;\n      break;\n    case '^=':\n      matches = fieldStr.indexOf(valStr) === 0;\n      break;\n    case '=':\n      matches = fieldVal === value;\n      break;\n    case '>':\n      isIneqCmp = true;\n      matches = fieldVal > value;\n      break;\n    case '>=':\n      isIneqCmp = true;\n      matches = fieldVal >= value;\n      break;\n    case '<':\n      isIneqCmp = true;\n      matches = fieldVal < value;\n      break;\n    case '<=':\n      isIneqCmp = true;\n      matches = fieldVal <= value;\n      break;\n    default:\n      matches = false;\n      break;\n  }\n\n  // apply the not op, but null vals for inequalities should always stay non-matching\n  if (notExpr && (fieldVal != null || !isIneqCmp)) {\n    matches = !matches;\n  }\n  return matches;\n};\nvar boolCmp = function boolCmp(fieldVal, operator) {\n  switch (operator) {\n    case '?':\n      return fieldVal ? true : false;\n    case '!':\n      return fieldVal ? false : true;\n    case '^':\n      return fieldVal === undefined;\n  }\n};\nvar existCmp = function existCmp(fieldVal) {\n  return fieldVal !== undefined;\n};\nvar data$1 = function data(ele, field) {\n  return ele.data(field);\n};\nvar meta = function meta(ele, field) {\n  return ele[field]();\n};\n\n/** A lookup of `match(check, ele)` functions by `Type` int */\nvar match = [];\n\n/**\n * Returns whether the query matches for the element\n * @param query The `{ type, value, ... }` query object\n * @param ele The element to compare against\n*/\nvar matches$1 = function matches(query, ele) {\n  return query.checks.every(function (chk) {\n    return match[chk.type](chk, ele);\n  });\n};\nmatch[Type.GROUP] = function (check, ele) {\n  var group = check.value;\n  return group === '*' || group === ele.group();\n};\nmatch[Type.STATE] = function (check, ele) {\n  var stateSelector = check.value;\n  return stateSelectorMatches(stateSelector, ele);\n};\nmatch[Type.ID] = function (check, ele) {\n  var id = check.value;\n  return ele.id() === id;\n};\nmatch[Type.CLASS] = function (check, ele) {\n  var cls = check.value;\n  return ele.hasClass(cls);\n};\nmatch[Type.META_COMPARE] = function (check, ele) {\n  var field = check.field,\n    operator = check.operator,\n    value = check.value;\n  return valCmp(meta(ele, field), operator, value);\n};\nmatch[Type.DATA_COMPARE] = function (check, ele) {\n  var field = check.field,\n    operator = check.operator,\n    value = check.value;\n  return valCmp(data$1(ele, field), operator, value);\n};\nmatch[Type.DATA_BOOL] = function (check, ele) {\n  var field = check.field,\n    operator = check.operator;\n  return boolCmp(data$1(ele, field), operator);\n};\nmatch[Type.DATA_EXIST] = function (check, ele) {\n  var field = check.field;\n    check.operator;\n  return existCmp(data$1(ele, field));\n};\nmatch[Type.UNDIRECTED_EDGE] = function (check, ele) {\n  var qA = check.nodes[0];\n  var qB = check.nodes[1];\n  var src = ele.source();\n  var tgt = ele.target();\n  return matches$1(qA, src) && matches$1(qB, tgt) || matches$1(qB, src) && matches$1(qA, tgt);\n};\nmatch[Type.NODE_NEIGHBOR] = function (check, ele) {\n  return matches$1(check.node, ele) && ele.neighborhood().some(function (n) {\n    return n.isNode() && matches$1(check.neighbor, n);\n  });\n};\nmatch[Type.DIRECTED_EDGE] = function (check, ele) {\n  return matches$1(check.source, ele.source()) && matches$1(check.target, ele.target());\n};\nmatch[Type.NODE_SOURCE] = function (check, ele) {\n  return matches$1(check.source, ele) && ele.outgoers().some(function (n) {\n    return n.isNode() && matches$1(check.target, n);\n  });\n};\nmatch[Type.NODE_TARGET] = function (check, ele) {\n  return matches$1(check.target, ele) && ele.incomers().some(function (n) {\n    return n.isNode() && matches$1(check.source, n);\n  });\n};\nmatch[Type.CHILD] = function (check, ele) {\n  return matches$1(check.child, ele) && matches$1(check.parent, ele.parent());\n};\nmatch[Type.PARENT] = function (check, ele) {\n  return matches$1(check.parent, ele) && ele.children().some(function (c) {\n    return matches$1(check.child, c);\n  });\n};\nmatch[Type.DESCENDANT] = function (check, ele) {\n  return matches$1(check.descendant, ele) && ele.ancestors().some(function (a) {\n    return matches$1(check.ancestor, a);\n  });\n};\nmatch[Type.ANCESTOR] = function (check, ele) {\n  return matches$1(check.ancestor, ele) && ele.descendants().some(function (d) {\n    return matches$1(check.descendant, d);\n  });\n};\nmatch[Type.COMPOUND_SPLIT] = function (check, ele) {\n  return matches$1(check.subject, ele) && matches$1(check.left, ele) && matches$1(check.right, ele);\n};\nmatch[Type.TRUE] = function () {\n  return true;\n};\nmatch[Type.COLLECTION] = function (check, ele) {\n  var collection = check.value;\n  return collection.has(ele);\n};\nmatch[Type.FILTER] = function (check, ele) {\n  var filter = check.value;\n  return filter(ele);\n};\n\n// filter an existing collection\nvar filter = function filter(collection) {\n  var self = this;\n\n  // for 1 id #foo queries, just get the element\n  if (self.length === 1 && self[0].checks.length === 1 && self[0].checks[0].type === Type.ID) {\n    return collection.getElementById(self[0].checks[0].value).collection();\n  }\n  var selectorFunction = function selectorFunction(element) {\n    for (var j = 0; j < self.length; j++) {\n      var query = self[j];\n      if (matches$1(query, element)) {\n        return true;\n      }\n    }\n    return false;\n  };\n  if (self.text() == null) {\n    selectorFunction = function selectorFunction() {\n      return true;\n    };\n  }\n  return collection.filter(selectorFunction);\n}; // filter\n\n// does selector match a single element?\nvar matches = function matches(ele) {\n  var self = this;\n  for (var j = 0; j < self.length; j++) {\n    var query = self[j];\n    if (matches$1(query, ele)) {\n      return true;\n    }\n  }\n  return false;\n}; // matches\n\nvar matching = {\n  matches: matches,\n  filter: filter\n};\n\nvar Selector = function Selector(selector) {\n  this.inputText = selector;\n  this.currentSubject = null;\n  this.compoundCount = 0;\n  this.edgeCount = 0;\n  this.length = 0;\n  if (selector == null || string(selector) && selector.match(/^\\s*$/)) ; else if (elementOrCollection(selector)) {\n    this.addQuery({\n      checks: [{\n        type: Type.COLLECTION,\n        value: selector.collection()\n      }]\n    });\n  } else if (fn$6(selector)) {\n    this.addQuery({\n      checks: [{\n        type: Type.FILTER,\n        value: selector\n      }]\n    });\n  } else if (string(selector)) {\n    if (!this.parse(selector)) {\n      this.invalid = true;\n    }\n  } else {\n    error('A selector must be created from a string; found ');\n  }\n};\nvar selfn = Selector.prototype;\n[parse$1, matching].forEach(function (p) {\n  return extend(selfn, p);\n});\nselfn.text = function () {\n  return this.inputText;\n};\nselfn.size = function () {\n  return this.length;\n};\nselfn.eq = function (i) {\n  return this[i];\n};\nselfn.sameText = function (otherSel) {\n  return !this.invalid && !otherSel.invalid && this.text() === otherSel.text();\n};\nselfn.addQuery = function (q) {\n  this[this.length++] = q;\n};\nselfn.selector = selfn.toString;\n\nvar elesfn$g = {\n  allAre: function allAre(selector) {\n    var selObj = new Selector(selector);\n    return this.every(function (ele) {\n      return selObj.matches(ele);\n    });\n  },\n  is: function is(selector) {\n    var selObj = new Selector(selector);\n    return this.some(function (ele) {\n      return selObj.matches(ele);\n    });\n  },\n  some: function some(fn, thisArg) {\n    for (var i = 0; i < this.length; i++) {\n      var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]);\n      if (ret) {\n        return true;\n      }\n    }\n    return false;\n  },\n  every: function every(fn, thisArg) {\n    for (var i = 0; i < this.length; i++) {\n      var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]);\n      if (!ret) {\n        return false;\n      }\n    }\n    return true;\n  },\n  same: function same(collection) {\n    // cheap collection ref check\n    if (this === collection) {\n      return true;\n    }\n    collection = this.cy().collection(collection);\n    var thisLength = this.length;\n    var collectionLength = collection.length;\n\n    // cheap length check\n    if (thisLength !== collectionLength) {\n      return false;\n    }\n\n    // cheap element ref check\n    if (thisLength === 1) {\n      return this[0] === collection[0];\n    }\n    return this.every(function (ele) {\n      return collection.hasElementWithId(ele.id());\n    });\n  },\n  anySame: function anySame(collection) {\n    collection = this.cy().collection(collection);\n    return this.some(function (ele) {\n      return collection.hasElementWithId(ele.id());\n    });\n  },\n  allAreNeighbors: function allAreNeighbors(collection) {\n    collection = this.cy().collection(collection);\n    var nhood = this.neighborhood();\n    return collection.every(function (ele) {\n      return nhood.hasElementWithId(ele.id());\n    });\n  },\n  contains: function contains(collection) {\n    collection = this.cy().collection(collection);\n    var self = this;\n    return collection.every(function (ele) {\n      return self.hasElementWithId(ele.id());\n    });\n  }\n};\nelesfn$g.allAreNeighbours = elesfn$g.allAreNeighbors;\nelesfn$g.has = elesfn$g.contains;\nelesfn$g.equal = elesfn$g.equals = elesfn$g.same;\n\nvar cache = function cache(fn, name) {\n  return function traversalCache(arg1, arg2, arg3, arg4) {\n    var selectorOrEles = arg1;\n    var eles = this;\n    var key;\n    if (selectorOrEles == null) {\n      key = '';\n    } else if (elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) {\n      key = selectorOrEles.id();\n    }\n    if (eles.length === 1 && key) {\n      var _p = eles[0]._private;\n      var tch = _p.traversalCache = _p.traversalCache || {};\n      var ch = tch[name] = tch[name] || [];\n      var hash = hashString(key);\n      var cacheHit = ch[hash];\n      if (cacheHit) {\n        return cacheHit;\n      } else {\n        return ch[hash] = fn.call(eles, arg1, arg2, arg3, arg4);\n      }\n    } else {\n      return fn.call(eles, arg1, arg2, arg3, arg4);\n    }\n  };\n};\n\nvar elesfn$f = {\n  parent: function parent(selector) {\n    var parents = [];\n\n    // optimisation for single ele call\n    if (this.length === 1) {\n      var parent = this[0]._private.parent;\n      if (parent) {\n        return parent;\n      }\n    }\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      var _parent = ele._private.parent;\n      if (_parent) {\n        parents.push(_parent);\n      }\n    }\n    return this.spawn(parents, true).filter(selector);\n  },\n  parents: function parents(selector) {\n    var parents = [];\n    var eles = this.parent();\n    while (eles.nonempty()) {\n      for (var i = 0; i < eles.length; i++) {\n        var ele = eles[i];\n        parents.push(ele);\n      }\n      eles = eles.parent();\n    }\n    return this.spawn(parents, true).filter(selector);\n  },\n  commonAncestors: function commonAncestors(selector) {\n    var ancestors;\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      var parents = ele.parents();\n      ancestors = ancestors || parents;\n      ancestors = ancestors.intersect(parents); // current list must be common with current ele parents set\n    }\n    return ancestors.filter(selector);\n  },\n  orphans: function orphans(selector) {\n    return this.stdFilter(function (ele) {\n      return ele.isOrphan();\n    }).filter(selector);\n  },\n  nonorphans: function nonorphans(selector) {\n    return this.stdFilter(function (ele) {\n      return ele.isChild();\n    }).filter(selector);\n  },\n  children: cache(function (selector) {\n    var children = [];\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      var eleChildren = ele._private.children;\n      for (var j = 0; j < eleChildren.length; j++) {\n        children.push(eleChildren[j]);\n      }\n    }\n    return this.spawn(children, true).filter(selector);\n  }, 'children'),\n  siblings: function siblings(selector) {\n    return this.parent().children().not(this).filter(selector);\n  },\n  isParent: function isParent() {\n    var ele = this[0];\n    if (ele) {\n      return ele.isNode() && ele._private.children.length !== 0;\n    }\n  },\n  isChildless: function isChildless() {\n    var ele = this[0];\n    if (ele) {\n      return ele.isNode() && ele._private.children.length === 0;\n    }\n  },\n  isChild: function isChild() {\n    var ele = this[0];\n    if (ele) {\n      return ele.isNode() && ele._private.parent != null;\n    }\n  },\n  isOrphan: function isOrphan() {\n    var ele = this[0];\n    if (ele) {\n      return ele.isNode() && ele._private.parent == null;\n    }\n  },\n  descendants: function descendants(selector) {\n    var elements = [];\n    function add(eles) {\n      for (var i = 0; i < eles.length; i++) {\n        var ele = eles[i];\n        elements.push(ele);\n        if (ele.children().nonempty()) {\n          add(ele.children());\n        }\n      }\n    }\n    add(this.children());\n    return this.spawn(elements, true).filter(selector);\n  }\n};\nfunction forEachCompound(eles, fn, includeSelf, recursiveStep) {\n  var q = [];\n  var did = new Set$1();\n  var cy = eles.cy();\n  var hasCompounds = cy.hasCompoundNodes();\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    if (includeSelf) {\n      q.push(ele);\n    } else if (hasCompounds) {\n      recursiveStep(q, did, ele);\n    }\n  }\n  while (q.length > 0) {\n    var _ele = q.shift();\n    fn(_ele);\n    did.add(_ele.id());\n    if (hasCompounds) {\n      recursiveStep(q, did, _ele);\n    }\n  }\n  return eles;\n}\nfunction addChildren(q, did, ele) {\n  if (ele.isParent()) {\n    var children = ele._private.children;\n    for (var i = 0; i < children.length; i++) {\n      var child = children[i];\n      if (!did.has(child.id())) {\n        q.push(child);\n      }\n    }\n  }\n}\n\n// very efficient version of eles.add( eles.descendants() ).forEach()\n// for internal use\nelesfn$f.forEachDown = function (fn) {\n  var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n  return forEachCompound(this, fn, includeSelf, addChildren);\n};\nfunction addParent(q, did, ele) {\n  if (ele.isChild()) {\n    var parent = ele._private.parent;\n    if (!did.has(parent.id())) {\n      q.push(parent);\n    }\n  }\n}\nelesfn$f.forEachUp = function (fn) {\n  var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n  return forEachCompound(this, fn, includeSelf, addParent);\n};\nfunction addParentAndChildren(q, did, ele) {\n  addParent(q, did, ele);\n  addChildren(q, did, ele);\n}\nelesfn$f.forEachUpAndDown = function (fn) {\n  var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n  return forEachCompound(this, fn, includeSelf, addParentAndChildren);\n};\n\n// aliases\nelesfn$f.ancestors = elesfn$f.parents;\n\nvar fn$5, elesfn$e;\nfn$5 = elesfn$e = {\n  data: define.data({\n    field: 'data',\n    bindingEvent: 'data',\n    allowBinding: true,\n    allowSetting: true,\n    settingEvent: 'data',\n    settingTriggersEvent: true,\n    triggerFnName: 'trigger',\n    allowGetting: true,\n    immutableKeys: {\n      'id': true,\n      'source': true,\n      'target': true,\n      'parent': true\n    },\n    updateStyle: true\n  }),\n  removeData: define.removeData({\n    field: 'data',\n    event: 'data',\n    triggerFnName: 'trigger',\n    triggerEvent: true,\n    immutableKeys: {\n      'id': true,\n      'source': true,\n      'target': true,\n      'parent': true\n    },\n    updateStyle: true\n  }),\n  scratch: define.data({\n    field: 'scratch',\n    bindingEvent: 'scratch',\n    allowBinding: true,\n    allowSetting: true,\n    settingEvent: 'scratch',\n    settingTriggersEvent: true,\n    triggerFnName: 'trigger',\n    allowGetting: true,\n    updateStyle: true\n  }),\n  removeScratch: define.removeData({\n    field: 'scratch',\n    event: 'scratch',\n    triggerFnName: 'trigger',\n    triggerEvent: true,\n    updateStyle: true\n  }),\n  rscratch: define.data({\n    field: 'rscratch',\n    allowBinding: false,\n    allowSetting: true,\n    settingTriggersEvent: false,\n    allowGetting: true\n  }),\n  removeRscratch: define.removeData({\n    field: 'rscratch',\n    triggerEvent: false\n  }),\n  id: function id() {\n    var ele = this[0];\n    if (ele) {\n      return ele._private.data.id;\n    }\n  }\n};\n\n// aliases\nfn$5.attr = fn$5.data;\nfn$5.removeAttr = fn$5.removeData;\nvar data = elesfn$e;\n\nvar elesfn$d = {};\nfunction defineDegreeFunction(callback) {\n  return function (includeLoops) {\n    var self = this;\n    if (includeLoops === undefined) {\n      includeLoops = true;\n    }\n    if (self.length === 0) {\n      return;\n    }\n    if (self.isNode() && !self.removed()) {\n      var degree = 0;\n      var node = self[0];\n      var connectedEdges = node._private.edges;\n      for (var i = 0; i < connectedEdges.length; i++) {\n        var edge = connectedEdges[i];\n        if (!includeLoops && edge.isLoop()) {\n          continue;\n        }\n        degree += callback(node, edge);\n      }\n      return degree;\n    } else {\n      return;\n    }\n  };\n}\nextend(elesfn$d, {\n  degree: defineDegreeFunction(function (node, edge) {\n    if (edge.source().same(edge.target())) {\n      return 2;\n    } else {\n      return 1;\n    }\n  }),\n  indegree: defineDegreeFunction(function (node, edge) {\n    if (edge.target().same(node)) {\n      return 1;\n    } else {\n      return 0;\n    }\n  }),\n  outdegree: defineDegreeFunction(function (node, edge) {\n    if (edge.source().same(node)) {\n      return 1;\n    } else {\n      return 0;\n    }\n  })\n});\nfunction defineDegreeBoundsFunction(degreeFn, callback) {\n  return function (includeLoops) {\n    var ret;\n    var nodes = this.nodes();\n    for (var i = 0; i < nodes.length; i++) {\n      var ele = nodes[i];\n      var degree = ele[degreeFn](includeLoops);\n      if (degree !== undefined && (ret === undefined || callback(degree, ret))) {\n        ret = degree;\n      }\n    }\n    return ret;\n  };\n}\nextend(elesfn$d, {\n  minDegree: defineDegreeBoundsFunction('degree', function (degree, min) {\n    return degree < min;\n  }),\n  maxDegree: defineDegreeBoundsFunction('degree', function (degree, max) {\n    return degree > max;\n  }),\n  minIndegree: defineDegreeBoundsFunction('indegree', function (degree, min) {\n    return degree < min;\n  }),\n  maxIndegree: defineDegreeBoundsFunction('indegree', function (degree, max) {\n    return degree > max;\n  }),\n  minOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, min) {\n    return degree < min;\n  }),\n  maxOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, max) {\n    return degree > max;\n  })\n});\nextend(elesfn$d, {\n  totalDegree: function totalDegree(includeLoops) {\n    var total = 0;\n    var nodes = this.nodes();\n    for (var i = 0; i < nodes.length; i++) {\n      total += nodes[i].degree(includeLoops);\n    }\n    return total;\n  }\n});\n\nvar fn$4, elesfn$c;\nvar beforePositionSet = function beforePositionSet(eles, newPos, silent) {\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    if (!ele.locked()) {\n      var oldPos = ele._private.position;\n      var delta = {\n        x: newPos.x != null ? newPos.x - oldPos.x : 0,\n        y: newPos.y != null ? newPos.y - oldPos.y : 0\n      };\n      if (ele.isParent() && !(delta.x === 0 && delta.y === 0)) {\n        ele.children().shift(delta, silent);\n      }\n      ele.dirtyBoundingBoxCache();\n    }\n  }\n};\nvar positionDef = {\n  field: 'position',\n  bindingEvent: 'position',\n  allowBinding: true,\n  allowSetting: true,\n  settingEvent: 'position',\n  settingTriggersEvent: true,\n  triggerFnName: 'emitAndNotify',\n  allowGetting: true,\n  validKeys: ['x', 'y'],\n  beforeGet: function beforeGet(ele) {\n    ele.updateCompoundBounds();\n  },\n  beforeSet: function beforeSet(eles, newPos) {\n    beforePositionSet(eles, newPos, false);\n  },\n  onSet: function onSet(eles) {\n    eles.dirtyCompoundBoundsCache();\n  },\n  canSet: function canSet(ele) {\n    return !ele.locked();\n  }\n};\nfn$4 = elesfn$c = {\n  position: define.data(positionDef),\n  // position but no notification to renderer\n  silentPosition: define.data(extend({}, positionDef, {\n    allowBinding: false,\n    allowSetting: true,\n    settingTriggersEvent: false,\n    allowGetting: false,\n    beforeSet: function beforeSet(eles, newPos) {\n      beforePositionSet(eles, newPos, true);\n    },\n    onSet: function onSet(eles) {\n      eles.dirtyCompoundBoundsCache();\n    }\n  })),\n  positions: function positions(pos, silent) {\n    if (plainObject(pos)) {\n      if (silent) {\n        this.silentPosition(pos);\n      } else {\n        this.position(pos);\n      }\n    } else if (fn$6(pos)) {\n      var _fn = pos;\n      var cy = this.cy();\n      cy.startBatch();\n      for (var i = 0; i < this.length; i++) {\n        var ele = this[i];\n        var _pos = undefined;\n        if (_pos = _fn(ele, i)) {\n          if (silent) {\n            ele.silentPosition(_pos);\n          } else {\n            ele.position(_pos);\n          }\n        }\n      }\n      cy.endBatch();\n    }\n    return this; // chaining\n  },\n  silentPositions: function silentPositions(pos) {\n    return this.positions(pos, true);\n  },\n  shift: function shift(dim, val, silent) {\n    var delta;\n    if (plainObject(dim)) {\n      delta = {\n        x: number$1(dim.x) ? dim.x : 0,\n        y: number$1(dim.y) ? dim.y : 0\n      };\n      silent = val;\n    } else if (string(dim) && number$1(val)) {\n      delta = {\n        x: 0,\n        y: 0\n      };\n      delta[dim] = val;\n    }\n    if (delta != null) {\n      var cy = this.cy();\n      cy.startBatch();\n      for (var i = 0; i < this.length; i++) {\n        var ele = this[i];\n\n        // exclude any node that is a descendant of the calling collection\n        if (cy.hasCompoundNodes() && ele.isChild() && ele.ancestors().anySame(this)) {\n          continue;\n        }\n        var pos = ele.position();\n        var newPos = {\n          x: pos.x + delta.x,\n          y: pos.y + delta.y\n        };\n        if (silent) {\n          ele.silentPosition(newPos);\n        } else {\n          ele.position(newPos);\n        }\n      }\n      cy.endBatch();\n    }\n    return this;\n  },\n  silentShift: function silentShift(dim, val) {\n    if (plainObject(dim)) {\n      this.shift(dim, true);\n    } else if (string(dim) && number$1(val)) {\n      this.shift(dim, val, true);\n    }\n    return this;\n  },\n  // get/set the rendered (i.e. on screen) positon of the element\n  renderedPosition: function renderedPosition(dim, val) {\n    var ele = this[0];\n    var cy = this.cy();\n    var zoom = cy.zoom();\n    var pan = cy.pan();\n    var rpos = plainObject(dim) ? dim : undefined;\n    var setting = rpos !== undefined || val !== undefined && string(dim);\n    if (ele && ele.isNode()) {\n      // must have an element and must be a node to return position\n      if (setting) {\n        for (var i = 0; i < this.length; i++) {\n          var _ele = this[i];\n          if (val !== undefined) {\n            // set one dimension\n            _ele.position(dim, (val - pan[dim]) / zoom);\n          } else if (rpos !== undefined) {\n            // set whole position\n            _ele.position(renderedToModelPosition(rpos, zoom, pan));\n          }\n        }\n      } else {\n        // getting\n        var pos = ele.position();\n        rpos = modelToRenderedPosition$1(pos, zoom, pan);\n        if (dim === undefined) {\n          // then return the whole rendered position\n          return rpos;\n        } else {\n          // then return the specified dimension\n          return rpos[dim];\n        }\n      }\n    } else if (!setting) {\n      return undefined; // for empty collection case\n    }\n    return this; // chaining\n  },\n  // get/set the position relative to the parent\n  relativePosition: function relativePosition(dim, val) {\n    var ele = this[0];\n    var cy = this.cy();\n    var ppos = plainObject(dim) ? dim : undefined;\n    var setting = ppos !== undefined || val !== undefined && string(dim);\n    var hasCompoundNodes = cy.hasCompoundNodes();\n    if (ele && ele.isNode()) {\n      // must have an element and must be a node to return position\n      if (setting) {\n        for (var i = 0; i < this.length; i++) {\n          var _ele2 = this[i];\n          var parent = hasCompoundNodes ? _ele2.parent() : null;\n          var hasParent = parent && parent.length > 0;\n          var relativeToParent = hasParent;\n          if (hasParent) {\n            parent = parent[0];\n          }\n          var origin = relativeToParent ? parent.position() : {\n            x: 0,\n            y: 0\n          };\n          if (val !== undefined) {\n            // set one dimension\n            _ele2.position(dim, val + origin[dim]);\n          } else if (ppos !== undefined) {\n            // set whole position\n            _ele2.position({\n              x: ppos.x + origin.x,\n              y: ppos.y + origin.y\n            });\n          }\n        }\n      } else {\n        // getting\n        var pos = ele.position();\n        var _parent = hasCompoundNodes ? ele.parent() : null;\n        var _hasParent = _parent && _parent.length > 0;\n        var _relativeToParent = _hasParent;\n        if (_hasParent) {\n          _parent = _parent[0];\n        }\n        var _origin = _relativeToParent ? _parent.position() : {\n          x: 0,\n          y: 0\n        };\n        ppos = {\n          x: pos.x - _origin.x,\n          y: pos.y - _origin.y\n        };\n        if (dim === undefined) {\n          // then return the whole rendered position\n          return ppos;\n        } else {\n          // then return the specified dimension\n          return ppos[dim];\n        }\n      }\n    } else if (!setting) {\n      return undefined; // for empty collection case\n    }\n    return this; // chaining\n  }\n};\n\n// aliases\nfn$4.modelPosition = fn$4.point = fn$4.position;\nfn$4.modelPositions = fn$4.points = fn$4.positions;\nfn$4.renderedPoint = fn$4.renderedPosition;\nfn$4.relativePoint = fn$4.relativePosition;\nvar position = elesfn$c;\n\nvar fn$3, elesfn$b;\nfn$3 = elesfn$b = {};\nelesfn$b.renderedBoundingBox = function (options) {\n  var bb = this.boundingBox(options);\n  var cy = this.cy();\n  var zoom = cy.zoom();\n  var pan = cy.pan();\n  var x1 = bb.x1 * zoom + pan.x;\n  var x2 = bb.x2 * zoom + pan.x;\n  var y1 = bb.y1 * zoom + pan.y;\n  var y2 = bb.y2 * zoom + pan.y;\n  return {\n    x1: x1,\n    x2: x2,\n    y1: y1,\n    y2: y2,\n    w: x2 - x1,\n    h: y2 - y1\n  };\n};\nelesfn$b.dirtyCompoundBoundsCache = function () {\n  var silent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n  var cy = this.cy();\n  if (!cy.styleEnabled() || !cy.hasCompoundNodes()) {\n    return this;\n  }\n  this.forEachUp(function (ele) {\n    if (ele.isParent()) {\n      var _p = ele._private;\n      _p.compoundBoundsClean = false;\n      _p.bbCache = null;\n      if (!silent) {\n        ele.emitAndNotify('bounds');\n      }\n    }\n  });\n  return this;\n};\nelesfn$b.updateCompoundBounds = function () {\n  var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n  var cy = this.cy();\n\n  // not possible to do on non-compound graphs or with the style disabled\n  if (!cy.styleEnabled() || !cy.hasCompoundNodes()) {\n    return this;\n  }\n\n  // save cycles when batching -- but bounds will be stale (or not exist yet)\n  if (!force && cy.batching()) {\n    return this;\n  }\n  function update(parent) {\n    if (!parent.isParent()) {\n      return;\n    }\n    var _p = parent._private;\n    var children = parent.children();\n    var includeLabels = parent.pstyle('compound-sizing-wrt-labels').value === 'include';\n    var min = {\n      width: {\n        val: parent.pstyle('min-width').pfValue,\n        left: parent.pstyle('min-width-bias-left'),\n        right: parent.pstyle('min-width-bias-right')\n      },\n      height: {\n        val: parent.pstyle('min-height').pfValue,\n        top: parent.pstyle('min-height-bias-top'),\n        bottom: parent.pstyle('min-height-bias-bottom')\n      }\n    };\n    var bb = children.boundingBox({\n      includeLabels: includeLabels,\n      includeOverlays: false,\n      // updating the compound bounds happens outside of the regular\n      // cache cycle (i.e. before fired events)\n      useCache: false\n    });\n    var pos = _p.position;\n\n    // if children take up zero area then keep position and fall back on stylesheet w/h\n    if (bb.w === 0 || bb.h === 0) {\n      bb = {\n        w: parent.pstyle('width').pfValue,\n        h: parent.pstyle('height').pfValue\n      };\n      bb.x1 = pos.x - bb.w / 2;\n      bb.x2 = pos.x + bb.w / 2;\n      bb.y1 = pos.y - bb.h / 2;\n      bb.y2 = pos.y + bb.h / 2;\n    }\n    function computeBiasValues(propDiff, propBias, propBiasComplement) {\n      var biasDiff = 0;\n      var biasComplementDiff = 0;\n      var biasTotal = propBias + propBiasComplement;\n      if (propDiff > 0 && biasTotal > 0) {\n        biasDiff = propBias / biasTotal * propDiff;\n        biasComplementDiff = propBiasComplement / biasTotal * propDiff;\n      }\n      return {\n        biasDiff: biasDiff,\n        biasComplementDiff: biasComplementDiff\n      };\n    }\n    function computePaddingValues(width, height, paddingObject, relativeTo) {\n      // Assuming percentage is number from 0 to 1\n      if (paddingObject.units === '%') {\n        switch (relativeTo) {\n          case 'width':\n            return width > 0 ? paddingObject.pfValue * width : 0;\n          case 'height':\n            return height > 0 ? paddingObject.pfValue * height : 0;\n          case 'average':\n            return width > 0 && height > 0 ? paddingObject.pfValue * (width + height) / 2 : 0;\n          case 'min':\n            return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * height : paddingObject.pfValue * width : 0;\n          case 'max':\n            return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * width : paddingObject.pfValue * height : 0;\n          default:\n            return 0;\n        }\n      } else if (paddingObject.units === 'px') {\n        return paddingObject.pfValue;\n      } else {\n        return 0;\n      }\n    }\n    var leftVal = min.width.left.value;\n    if (min.width.left.units === 'px' && min.width.val > 0) {\n      leftVal = leftVal * 100 / min.width.val;\n    }\n    var rightVal = min.width.right.value;\n    if (min.width.right.units === 'px' && min.width.val > 0) {\n      rightVal = rightVal * 100 / min.width.val;\n    }\n    var topVal = min.height.top.value;\n    if (min.height.top.units === 'px' && min.height.val > 0) {\n      topVal = topVal * 100 / min.height.val;\n    }\n    var bottomVal = min.height.bottom.value;\n    if (min.height.bottom.units === 'px' && min.height.val > 0) {\n      bottomVal = bottomVal * 100 / min.height.val;\n    }\n    var widthBiasDiffs = computeBiasValues(min.width.val - bb.w, leftVal, rightVal);\n    var diffLeft = widthBiasDiffs.biasDiff;\n    var diffRight = widthBiasDiffs.biasComplementDiff;\n    var heightBiasDiffs = computeBiasValues(min.height.val - bb.h, topVal, bottomVal);\n    var diffTop = heightBiasDiffs.biasDiff;\n    var diffBottom = heightBiasDiffs.biasComplementDiff;\n    _p.autoPadding = computePaddingValues(bb.w, bb.h, parent.pstyle('padding'), parent.pstyle('padding-relative-to').value);\n    _p.autoWidth = Math.max(bb.w, min.width.val);\n    pos.x = (-diffLeft + bb.x1 + bb.x2 + diffRight) / 2;\n    _p.autoHeight = Math.max(bb.h, min.height.val);\n    pos.y = (-diffTop + bb.y1 + bb.y2 + diffBottom) / 2;\n  }\n  for (var i = 0; i < this.length; i++) {\n    var ele = this[i];\n    var _p = ele._private;\n    if (!_p.compoundBoundsClean || force) {\n      update(ele);\n      if (!cy.batching()) {\n        _p.compoundBoundsClean = true;\n      }\n    }\n  }\n  return this;\n};\nvar noninf = function noninf(x) {\n  if (x === Infinity || x === -Infinity) {\n    return 0;\n  }\n  return x;\n};\nvar updateBounds = function updateBounds(b, x1, y1, x2, y2) {\n  // don't update with zero area boxes\n  if (x2 - x1 === 0 || y2 - y1 === 0) {\n    return;\n  }\n\n  // don't update with null dim\n  if (x1 == null || y1 == null || x2 == null || y2 == null) {\n    return;\n  }\n  b.x1 = x1 < b.x1 ? x1 : b.x1;\n  b.x2 = x2 > b.x2 ? x2 : b.x2;\n  b.y1 = y1 < b.y1 ? y1 : b.y1;\n  b.y2 = y2 > b.y2 ? y2 : b.y2;\n  b.w = b.x2 - b.x1;\n  b.h = b.y2 - b.y1;\n};\nvar updateBoundsFromBox = function updateBoundsFromBox(b, b2) {\n  if (b2 == null) {\n    return b;\n  }\n  return updateBounds(b, b2.x1, b2.y1, b2.x2, b2.y2);\n};\nvar prefixedProperty = function prefixedProperty(obj, field, prefix) {\n  return getPrefixedProperty(obj, field, prefix);\n};\nvar updateBoundsFromArrow = function updateBoundsFromArrow(bounds, ele, prefix) {\n  if (ele.cy().headless()) {\n    return;\n  }\n  var _p = ele._private;\n  var rstyle = _p.rstyle;\n  var halfArW = rstyle.arrowWidth / 2;\n  var arrowType = ele.pstyle(prefix + '-arrow-shape').value;\n  var x;\n  var y;\n  if (arrowType !== 'none') {\n    if (prefix === 'source') {\n      x = rstyle.srcX;\n      y = rstyle.srcY;\n    } else if (prefix === 'target') {\n      x = rstyle.tgtX;\n      y = rstyle.tgtY;\n    } else {\n      x = rstyle.midX;\n      y = rstyle.midY;\n    }\n\n    // always store the individual arrow bounds\n    var bbs = _p.arrowBounds = _p.arrowBounds || {};\n    var bb = bbs[prefix] = bbs[prefix] || {};\n    bb.x1 = x - halfArW;\n    bb.y1 = y - halfArW;\n    bb.x2 = x + halfArW;\n    bb.y2 = y + halfArW;\n    bb.w = bb.x2 - bb.x1;\n    bb.h = bb.y2 - bb.y1;\n    expandBoundingBox(bb, 1);\n    updateBounds(bounds, bb.x1, bb.y1, bb.x2, bb.y2);\n  }\n};\nvar updateBoundsFromLabel = function updateBoundsFromLabel(bounds, ele, prefix) {\n  if (ele.cy().headless()) {\n    return;\n  }\n  var prefixDash;\n  if (prefix) {\n    prefixDash = prefix + '-';\n  } else {\n    prefixDash = '';\n  }\n  var _p = ele._private;\n  var rstyle = _p.rstyle;\n  var label = ele.pstyle(prefixDash + 'label').strValue;\n  if (label) {\n    var halign = ele.pstyle('text-halign');\n    var valign = ele.pstyle('text-valign');\n    var labelWidth = prefixedProperty(rstyle, 'labelWidth', prefix);\n    var labelHeight = prefixedProperty(rstyle, 'labelHeight', prefix);\n    var labelX = prefixedProperty(rstyle, 'labelX', prefix);\n    var labelY = prefixedProperty(rstyle, 'labelY', prefix);\n    var marginX = ele.pstyle(prefixDash + 'text-margin-x').pfValue;\n    var marginY = ele.pstyle(prefixDash + 'text-margin-y').pfValue;\n    var isEdge = ele.isEdge();\n    var rotation = ele.pstyle(prefixDash + 'text-rotation');\n    var outlineWidth = ele.pstyle('text-outline-width').pfValue;\n    var borderWidth = ele.pstyle('text-border-width').pfValue;\n    var halfBorderWidth = borderWidth / 2;\n    var padding = ele.pstyle('text-background-padding').pfValue;\n    var marginOfError = 2; // expand to work around browser dimension inaccuracies\n\n    var lh = labelHeight;\n    var lw = labelWidth;\n    var lw_2 = lw / 2;\n    var lh_2 = lh / 2;\n    var lx1, lx2, ly1, ly2;\n    if (isEdge) {\n      lx1 = labelX - lw_2;\n      lx2 = labelX + lw_2;\n      ly1 = labelY - lh_2;\n      ly2 = labelY + lh_2;\n    } else {\n      switch (halign.value) {\n        case 'left':\n          lx1 = labelX - lw;\n          lx2 = labelX;\n          break;\n        case 'center':\n          lx1 = labelX - lw_2;\n          lx2 = labelX + lw_2;\n          break;\n        case 'right':\n          lx1 = labelX;\n          lx2 = labelX + lw;\n          break;\n      }\n      switch (valign.value) {\n        case 'top':\n          ly1 = labelY - lh;\n          ly2 = labelY;\n          break;\n        case 'center':\n          ly1 = labelY - lh_2;\n          ly2 = labelY + lh_2;\n          break;\n        case 'bottom':\n          ly1 = labelY;\n          ly2 = labelY + lh;\n          break;\n      }\n    }\n\n    // shift by margin and expand by outline and border\n    var leftPad = marginX - Math.max(outlineWidth, halfBorderWidth) - padding - marginOfError;\n    var rightPad = marginX + Math.max(outlineWidth, halfBorderWidth) + padding + marginOfError;\n    var topPad = marginY - Math.max(outlineWidth, halfBorderWidth) - padding - marginOfError;\n    var botPad = marginY + Math.max(outlineWidth, halfBorderWidth) + padding + marginOfError;\n    lx1 += leftPad;\n    lx2 += rightPad;\n    ly1 += topPad;\n    ly2 += botPad;\n\n    // always store the unrotated label bounds separately\n    var bbPrefix = prefix || 'main';\n    var bbs = _p.labelBounds;\n    var bb = bbs[bbPrefix] = bbs[bbPrefix] || {};\n    bb.x1 = lx1;\n    bb.y1 = ly1;\n    bb.x2 = lx2;\n    bb.y2 = ly2;\n    bb.w = lx2 - lx1;\n    bb.h = ly2 - ly1;\n    bb.leftPad = leftPad;\n    bb.rightPad = rightPad;\n    bb.topPad = topPad;\n    bb.botPad = botPad;\n    var isAutorotate = isEdge && rotation.strValue === 'autorotate';\n    var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0;\n    if (isAutorotate || isPfValue) {\n      var theta = isAutorotate ? prefixedProperty(_p.rstyle, 'labelAngle', prefix) : rotation.pfValue;\n      var cos = Math.cos(theta);\n      var sin = Math.sin(theta);\n\n      // rotation point (default value for center-center)\n      var xo = (lx1 + lx2) / 2;\n      var yo = (ly1 + ly2) / 2;\n      if (!isEdge) {\n        switch (halign.value) {\n          case 'left':\n            xo = lx2;\n            break;\n          case 'right':\n            xo = lx1;\n            break;\n        }\n        switch (valign.value) {\n          case 'top':\n            yo = ly2;\n            break;\n          case 'bottom':\n            yo = ly1;\n            break;\n        }\n      }\n      var rotate = function rotate(x, y) {\n        x = x - xo;\n        y = y - yo;\n        return {\n          x: x * cos - y * sin + xo,\n          y: x * sin + y * cos + yo\n        };\n      };\n      var px1y1 = rotate(lx1, ly1);\n      var px1y2 = rotate(lx1, ly2);\n      var px2y1 = rotate(lx2, ly1);\n      var px2y2 = rotate(lx2, ly2);\n      lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x);\n      lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x);\n      ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y);\n      ly2 = Math.max(px1y1.y, px1y2.y, px2y1.y, px2y2.y);\n    }\n    var bbPrefixRot = bbPrefix + 'Rot';\n    var bbRot = bbs[bbPrefixRot] = bbs[bbPrefixRot] || {};\n    bbRot.x1 = lx1;\n    bbRot.y1 = ly1;\n    bbRot.x2 = lx2;\n    bbRot.y2 = ly2;\n    bbRot.w = lx2 - lx1;\n    bbRot.h = ly2 - ly1;\n    updateBounds(bounds, lx1, ly1, lx2, ly2);\n    updateBounds(_p.labelBounds.all, lx1, ly1, lx2, ly2);\n  }\n  return bounds;\n};\nvar updateBoundsFromOutline = function updateBoundsFromOutline(bounds, ele) {\n  if (ele.cy().headless()) {\n    return;\n  }\n  var outlineOpacity = ele.pstyle('outline-opacity').value;\n  var outlineWidth = ele.pstyle('outline-width').value;\n  var outlineOffset = ele.pstyle('outline-offset').value;\n  var expansion = outlineWidth + outlineOffset;\n  updateBoundsFromMiter(bounds, ele, outlineOpacity, expansion, 'outside', expansion / 2);\n};\nvar updateBoundsFromMiter = function updateBoundsFromMiter(bounds, ele, opacity, expansionSize, expansionPosition, useFallbackValue) {\n  if (opacity === 0 || expansionSize <= 0 || expansionPosition === 'inside') {\n    return;\n  }\n  var cy = ele.cy();\n  var r = cy.renderer();\n  var rshape = r.nodeShapes[r.getNodeShape(ele)];\n  if (!rshape) {\n    return;\n  }\n  var _ele$position = ele.position(),\n    x = _ele$position.x,\n    y = _ele$position.y;\n  var w = ele.width();\n  var h = ele.height();\n  if (rshape.hasMiterBounds) {\n    if (expansionPosition === 'center') {\n      expansionSize /= 2;\n    }\n    var mbb = rshape.miterBounds(x, y, w, h, expansionSize);\n    updateBoundsFromBox(bounds, mbb);\n  } else if (useFallbackValue != null && useFallbackValue > 0) {\n    expandBoundingBoxSides(bounds, [useFallbackValue, useFallbackValue, useFallbackValue, useFallbackValue]);\n  }\n};\nvar updateBoundsFromMiterBorder = function updateBoundsFromMiterBorder(bounds, ele) {\n  if (ele.cy().headless()) {\n    return;\n  }\n  var borderOpacity = ele.pstyle('border-opacity').value;\n  var borderWidth = ele.pstyle('border-width').pfValue;\n  var borderPosition = ele.pstyle('border-position').value;\n  updateBoundsFromMiter(bounds, ele, borderOpacity, borderWidth, borderPosition);\n};\n\n// get the bounding box of the elements (in raw model position)\nvar boundingBoxImpl = function boundingBoxImpl(ele, options) {\n  var cy = ele._private.cy;\n  var styleEnabled = cy.styleEnabled();\n  var headless = cy.headless();\n  var bounds = makeBoundingBox();\n  var _p = ele._private;\n  var isNode = ele.isNode();\n  var isEdge = ele.isEdge();\n  var ex1, ex2, ey1, ey2; // extrema of body / lines\n  var x, y; // node pos\n  var rstyle = _p.rstyle;\n  var manualExpansion = isNode && styleEnabled ? ele.pstyle('bounds-expansion').pfValue : [0];\n\n  // must use `display` prop only, as reading `compound.width()` causes recursion\n  // (other factors like width values will be considered later in this function anyway)\n  var isDisplayed = function isDisplayed(ele) {\n    return ele.pstyle('display').value !== 'none';\n  };\n  var displayed = !styleEnabled || isDisplayed(ele)\n\n  // must take into account connected nodes b/c of implicit edge hiding on display:none node\n  && (!isEdge || isDisplayed(ele.source()) && isDisplayed(ele.target()));\n  if (displayed) {\n    // displayed suffices, since we will find zero area eles anyway\n    var overlayOpacity = 0;\n    var overlayPadding = 0;\n    if (styleEnabled && options.includeOverlays) {\n      overlayOpacity = ele.pstyle('overlay-opacity').value;\n      if (overlayOpacity !== 0) {\n        overlayPadding = ele.pstyle('overlay-padding').value;\n      }\n    }\n    var underlayOpacity = 0;\n    var underlayPadding = 0;\n    if (styleEnabled && options.includeUnderlays) {\n      underlayOpacity = ele.pstyle('underlay-opacity').value;\n      if (underlayOpacity !== 0) {\n        underlayPadding = ele.pstyle('underlay-padding').value;\n      }\n    }\n    var padding = Math.max(overlayPadding, underlayPadding);\n    var w = 0;\n    var wHalf = 0;\n    if (styleEnabled) {\n      w = ele.pstyle('width').pfValue;\n      wHalf = w / 2;\n    }\n    if (isNode && options.includeNodes) {\n      var pos = ele.position();\n      x = pos.x;\n      y = pos.y;\n      var _w = ele.outerWidth();\n      var halfW = _w / 2;\n      var h = ele.outerHeight();\n      var halfH = h / 2;\n\n      // handle node dimensions\n      /////////////////////////\n\n      ex1 = x - halfW;\n      ex2 = x + halfW;\n      ey1 = y - halfH;\n      ey2 = y + halfH;\n      updateBounds(bounds, ex1, ey1, ex2, ey2);\n      if (styleEnabled) {\n        updateBoundsFromOutline(bounds, ele);\n      }\n      if (styleEnabled && options.includeOutlines && !headless) {\n        updateBoundsFromOutline(bounds, ele);\n      }\n      if (styleEnabled) {\n        updateBoundsFromMiterBorder(bounds, ele);\n      }\n    } else if (isEdge && options.includeEdges) {\n      if (styleEnabled && !headless) {\n        var curveStyle = ele.pstyle('curve-style').strValue;\n\n        // handle edge dimensions (rough box estimate)\n        //////////////////////////////////////////////\n\n        ex1 = Math.min(rstyle.srcX, rstyle.midX, rstyle.tgtX);\n        ex2 = Math.max(rstyle.srcX, rstyle.midX, rstyle.tgtX);\n        ey1 = Math.min(rstyle.srcY, rstyle.midY, rstyle.tgtY);\n        ey2 = Math.max(rstyle.srcY, rstyle.midY, rstyle.tgtY);\n\n        // take into account edge width\n        ex1 -= wHalf;\n        ex2 += wHalf;\n        ey1 -= wHalf;\n        ey2 += wHalf;\n        updateBounds(bounds, ex1, ey1, ex2, ey2);\n\n        // precise edges\n        ////////////////\n\n        if (curveStyle === 'haystack') {\n          var hpts = rstyle.haystackPts;\n          if (hpts && hpts.length === 2) {\n            ex1 = hpts[0].x;\n            ey1 = hpts[0].y;\n            ex2 = hpts[1].x;\n            ey2 = hpts[1].y;\n            if (ex1 > ex2) {\n              var temp = ex1;\n              ex1 = ex2;\n              ex2 = temp;\n            }\n            if (ey1 > ey2) {\n              var _temp = ey1;\n              ey1 = ey2;\n              ey2 = _temp;\n            }\n            updateBounds(bounds, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf);\n          }\n        } else if (curveStyle === 'bezier' || curveStyle === 'unbundled-bezier' || endsWith(curveStyle, 'segments') || endsWith(curveStyle, 'taxi')) {\n          var pts;\n          switch (curveStyle) {\n            case 'bezier':\n            case 'unbundled-bezier':\n              pts = rstyle.bezierPts;\n              break;\n            case 'segments':\n            case 'taxi':\n            case 'round-segments':\n            case 'round-taxi':\n              pts = rstyle.linePts;\n              break;\n          }\n          if (pts != null) {\n            for (var j = 0; j < pts.length; j++) {\n              var pt = pts[j];\n              ex1 = pt.x - wHalf;\n              ex2 = pt.x + wHalf;\n              ey1 = pt.y - wHalf;\n              ey2 = pt.y + wHalf;\n              updateBounds(bounds, ex1, ey1, ex2, ey2);\n            }\n          }\n        } // bezier-like or segment-like edge\n      } else {\n        // headless or style disabled\n\n        // fallback on source and target positions\n        //////////////////////////////////////////\n\n        var n1 = ele.source();\n        var n1pos = n1.position();\n        var n2 = ele.target();\n        var n2pos = n2.position();\n        ex1 = n1pos.x;\n        ex2 = n2pos.x;\n        ey1 = n1pos.y;\n        ey2 = n2pos.y;\n        if (ex1 > ex2) {\n          var _temp2 = ex1;\n          ex1 = ex2;\n          ex2 = _temp2;\n        }\n        if (ey1 > ey2) {\n          var _temp3 = ey1;\n          ey1 = ey2;\n          ey2 = _temp3;\n        }\n\n        // take into account edge width\n        ex1 -= wHalf;\n        ex2 += wHalf;\n        ey1 -= wHalf;\n        ey2 += wHalf;\n        updateBounds(bounds, ex1, ey1, ex2, ey2);\n      } // headless or style disabled\n    } // edges\n\n    // handle edge arrow size\n    /////////////////////////\n\n    if (styleEnabled && options.includeEdges && isEdge) {\n      updateBoundsFromArrow(bounds, ele, 'mid-source');\n      updateBoundsFromArrow(bounds, ele, 'mid-target');\n      updateBoundsFromArrow(bounds, ele, 'source');\n      updateBoundsFromArrow(bounds, ele, 'target');\n    }\n\n    // ghost\n    ////////\n\n    if (styleEnabled) {\n      var ghost = ele.pstyle('ghost').value === 'yes';\n      if (ghost) {\n        var gx = ele.pstyle('ghost-offset-x').pfValue;\n        var gy = ele.pstyle('ghost-offset-y').pfValue;\n        updateBounds(bounds, bounds.x1 + gx, bounds.y1 + gy, bounds.x2 + gx, bounds.y2 + gy);\n      }\n    }\n\n    // always store the body bounds separately from the labels\n    var bbBody = _p.bodyBounds = _p.bodyBounds || {};\n    assignBoundingBox(bbBody, bounds);\n    expandBoundingBoxSides(bbBody, manualExpansion);\n    expandBoundingBox(bbBody, 1); // expand to work around browser dimension inaccuracies\n\n    // overlay\n    //////////\n\n    if (styleEnabled) {\n      ex1 = bounds.x1;\n      ex2 = bounds.x2;\n      ey1 = bounds.y1;\n      ey2 = bounds.y2;\n      updateBounds(bounds, ex1 - padding, ey1 - padding, ex2 + padding, ey2 + padding);\n    }\n\n    // always store the body bounds separately from the labels\n    var bbOverlay = _p.overlayBounds = _p.overlayBounds || {};\n    assignBoundingBox(bbOverlay, bounds);\n    expandBoundingBoxSides(bbOverlay, manualExpansion);\n    expandBoundingBox(bbOverlay, 1); // expand to work around browser dimension inaccuracies\n\n    // handle label dimensions\n    //////////////////////////\n\n    var bbLabels = _p.labelBounds = _p.labelBounds || {};\n    if (bbLabels.all != null) {\n      clearBoundingBox(bbLabels.all);\n    } else {\n      bbLabels.all = makeBoundingBox();\n    }\n    if (styleEnabled && options.includeLabels) {\n      if (options.includeMainLabels) {\n        updateBoundsFromLabel(bounds, ele, null);\n      }\n      if (isEdge) {\n        if (options.includeSourceLabels) {\n          updateBoundsFromLabel(bounds, ele, 'source');\n        }\n        if (options.includeTargetLabels) {\n          updateBoundsFromLabel(bounds, ele, 'target');\n        }\n      }\n    } // style enabled for labels\n  } // if displayed\n\n  bounds.x1 = noninf(bounds.x1);\n  bounds.y1 = noninf(bounds.y1);\n  bounds.x2 = noninf(bounds.x2);\n  bounds.y2 = noninf(bounds.y2);\n  bounds.w = noninf(bounds.x2 - bounds.x1);\n  bounds.h = noninf(bounds.y2 - bounds.y1);\n  if (bounds.w > 0 && bounds.h > 0 && displayed) {\n    expandBoundingBoxSides(bounds, manualExpansion);\n\n    // expand bounds by 1 because antialiasing can increase the visual/effective size by 1 on all sides\n    expandBoundingBox(bounds, 1);\n  }\n  return bounds;\n};\nvar getKey = function getKey(opts) {\n  var i = 0;\n  var tf = function tf(val) {\n    return (val ? 1 : 0) << i++;\n  };\n  var key = 0;\n  key += tf(opts.incudeNodes);\n  key += tf(opts.includeEdges);\n  key += tf(opts.includeLabels);\n  key += tf(opts.includeMainLabels);\n  key += tf(opts.includeSourceLabels);\n  key += tf(opts.includeTargetLabels);\n  key += tf(opts.includeOverlays);\n  key += tf(opts.includeOutlines);\n  return key;\n};\nvar getBoundingBoxPosKey = function getBoundingBoxPosKey(ele) {\n  var r = function r(x) {\n    return Math.round(x);\n  };\n  if (ele.isEdge()) {\n    var p1 = ele.source().position();\n    var p2 = ele.target().position();\n    return hashIntsArray([r(p1.x), r(p1.y), r(p2.x), r(p2.y)]);\n  } else {\n    var p = ele.position();\n    return hashIntsArray([r(p.x), r(p.y)]);\n  }\n};\nvar cachedBoundingBoxImpl = function cachedBoundingBoxImpl(ele, opts) {\n  var _p = ele._private;\n  var bb;\n  var isEdge = ele.isEdge();\n  var key = opts == null ? defBbOptsKey : getKey(opts);\n  var usingDefOpts = key === defBbOptsKey;\n  if (_p.bbCache == null) {\n    bb = boundingBoxImpl(ele, defBbOpts);\n    _p.bbCache = bb;\n    _p.bbCachePosKey = getBoundingBoxPosKey(ele);\n  } else {\n    bb = _p.bbCache;\n  }\n\n  // not using def opts => need to build up bb from combination of sub bbs\n  if (!usingDefOpts) {\n    var isNode = ele.isNode();\n    bb = makeBoundingBox();\n    if (opts.includeNodes && isNode || opts.includeEdges && !isNode) {\n      if (opts.includeOverlays) {\n        updateBoundsFromBox(bb, _p.overlayBounds);\n      } else {\n        updateBoundsFromBox(bb, _p.bodyBounds);\n      }\n    }\n    if (opts.includeLabels) {\n      if (opts.includeMainLabels && (!isEdge || opts.includeSourceLabels && opts.includeTargetLabels)) {\n        updateBoundsFromBox(bb, _p.labelBounds.all);\n      } else {\n        if (opts.includeMainLabels) {\n          updateBoundsFromBox(bb, _p.labelBounds.mainRot);\n        }\n        if (opts.includeSourceLabels) {\n          updateBoundsFromBox(bb, _p.labelBounds.sourceRot);\n        }\n        if (opts.includeTargetLabels) {\n          updateBoundsFromBox(bb, _p.labelBounds.targetRot);\n        }\n      }\n    }\n    bb.w = bb.x2 - bb.x1;\n    bb.h = bb.y2 - bb.y1;\n  }\n  return bb;\n};\nvar defBbOpts = {\n  includeNodes: true,\n  includeEdges: true,\n  includeLabels: true,\n  includeMainLabels: true,\n  includeSourceLabels: true,\n  includeTargetLabels: true,\n  includeOverlays: true,\n  includeUnderlays: true,\n  includeOutlines: true,\n  useCache: true\n};\nvar defBbOptsKey = getKey(defBbOpts);\nvar filledBbOpts = defaults$g(defBbOpts);\nelesfn$b.boundingBox = function (options) {\n  var bounds;\n  var useCache = options === undefined || options.useCache === undefined || options.useCache === true;\n  var isDirty = memoize(function (ele) {\n    var _p = ele._private;\n    return _p.bbCache == null || _p.styleDirty || _p.bbCachePosKey !== getBoundingBoxPosKey(ele);\n  }, function (ele) {\n    return ele.id();\n  });\n\n  // the main usecase is ele.boundingBox() for a single element with no/def options\n  // specified s.t. the cache is used, so check for this case to make it faster by\n  // avoiding the overhead of the rest of the function\n  if (useCache && this.length === 1 && !isDirty(this[0])) {\n    if (options === undefined) {\n      options = defBbOpts;\n    } else {\n      options = filledBbOpts(options);\n    }\n    bounds = cachedBoundingBoxImpl(this[0], options);\n  } else {\n    bounds = makeBoundingBox();\n    options = options || defBbOpts;\n    var opts = filledBbOpts(options);\n    var eles = this;\n    var cy = eles.cy();\n    var styleEnabled = cy.styleEnabled();\n\n    // cache the isDirty state for all eles, edges first since they depend on node state\n    this.edges().forEach(isDirty);\n    this.nodes().forEach(isDirty);\n    if (styleEnabled) {\n      this.recalculateRenderedStyle(useCache);\n    }\n    this.updateCompoundBounds(!useCache);\n    for (var i = 0; i < eles.length; i++) {\n      var ele = eles[i];\n      if (isDirty(ele)) {\n        ele.dirtyBoundingBoxCache();\n      }\n      updateBoundsFromBox(bounds, cachedBoundingBoxImpl(ele, opts));\n    }\n  }\n  bounds.x1 = noninf(bounds.x1);\n  bounds.y1 = noninf(bounds.y1);\n  bounds.x2 = noninf(bounds.x2);\n  bounds.y2 = noninf(bounds.y2);\n  bounds.w = noninf(bounds.x2 - bounds.x1);\n  bounds.h = noninf(bounds.y2 - bounds.y1);\n  return bounds;\n};\nelesfn$b.dirtyBoundingBoxCache = function () {\n  for (var i = 0; i < this.length; i++) {\n    var _p = this[i]._private;\n    _p.bbCache = null;\n    _p.bbCachePosKey = null;\n    _p.bodyBounds = null;\n    _p.overlayBounds = null;\n    _p.labelBounds.all = null;\n    _p.labelBounds.source = null;\n    _p.labelBounds.target = null;\n    _p.labelBounds.main = null;\n    _p.labelBounds.sourceRot = null;\n    _p.labelBounds.targetRot = null;\n    _p.labelBounds.mainRot = null;\n    _p.arrowBounds.source = null;\n    _p.arrowBounds.target = null;\n    _p.arrowBounds['mid-source'] = null;\n    _p.arrowBounds['mid-target'] = null;\n  }\n  this.emitAndNotify('bounds');\n  return this;\n};\n\n// private helper to get bounding box for custom node positions\n// - good for perf in certain cases but currently requires dirtying the rendered style\n// - would be better to not modify the nodes but the nodes are read directly everywhere in the renderer...\n// - try to use for only things like discrete layouts where the node position would change anyway\nelesfn$b.boundingBoxAt = function (fn) {\n  var nodes = this.nodes();\n  var cy = this.cy();\n  var hasCompoundNodes = cy.hasCompoundNodes();\n  var parents = cy.collection();\n  if (hasCompoundNodes) {\n    parents = nodes.filter(function (node) {\n      return node.isParent();\n    });\n    nodes = nodes.not(parents);\n  }\n  if (plainObject(fn)) {\n    var obj = fn;\n    fn = function fn() {\n      return obj;\n    };\n  }\n  var storeOldPos = function storeOldPos(node, i) {\n    return node._private.bbAtOldPos = fn(node, i);\n  };\n  var getOldPos = function getOldPos(node) {\n    return node._private.bbAtOldPos;\n  };\n  cy.startBatch();\n  nodes.forEach(storeOldPos).silentPositions(fn);\n  if (hasCompoundNodes) {\n    parents.dirtyCompoundBoundsCache();\n    parents.dirtyBoundingBoxCache();\n    parents.updateCompoundBounds(true); // force update b/c we're inside a batch cycle\n  }\n  var bb = copyBoundingBox(this.boundingBox({\n    useCache: false\n  }));\n  nodes.silentPositions(getOldPos);\n  if (hasCompoundNodes) {\n    parents.dirtyCompoundBoundsCache();\n    parents.dirtyBoundingBoxCache();\n    parents.updateCompoundBounds(true); // force update b/c we're inside a batch cycle\n  }\n  cy.endBatch();\n  return bb;\n};\nfn$3.boundingbox = fn$3.bb = fn$3.boundingBox;\nfn$3.renderedBoundingbox = fn$3.renderedBoundingBox;\nvar bounds = elesfn$b;\n\nvar fn$2, elesfn$a;\nfn$2 = elesfn$a = {};\nvar defineDimFns = function defineDimFns(opts) {\n  opts.uppercaseName = capitalize(opts.name);\n  opts.autoName = 'auto' + opts.uppercaseName;\n  opts.labelName = 'label' + opts.uppercaseName;\n  opts.outerName = 'outer' + opts.uppercaseName;\n  opts.uppercaseOuterName = capitalize(opts.outerName);\n  fn$2[opts.name] = function dimImpl() {\n    var ele = this[0];\n    var _p = ele._private;\n    var cy = _p.cy;\n    var styleEnabled = cy._private.styleEnabled;\n    if (ele) {\n      if (styleEnabled) {\n        if (ele.isParent()) {\n          ele.updateCompoundBounds();\n          return _p[opts.autoName] || 0;\n        }\n        var d = ele.pstyle(opts.name);\n        switch (d.strValue) {\n          case 'label':\n            ele.recalculateRenderedStyle();\n            return _p.rstyle[opts.labelName] || 0;\n          default:\n            return d.pfValue;\n        }\n      } else {\n        return 1;\n      }\n    }\n  };\n  fn$2['outer' + opts.uppercaseName] = function outerDimImpl() {\n    var ele = this[0];\n    var _p = ele._private;\n    var cy = _p.cy;\n    var styleEnabled = cy._private.styleEnabled;\n    if (ele) {\n      if (styleEnabled) {\n        var dim = ele[opts.name]();\n        var borderPos = ele.pstyle('border-position').value;\n        var border;\n        if (borderPos === 'center') {\n          border = ele.pstyle('border-width').pfValue; // n.b. 1/2 each side\n        } else if (borderPos === 'outside') {\n          border = 2 * ele.pstyle('border-width').pfValue;\n        } else {\n          // 'inside'\n          border = 0;\n        }\n        var padding = 2 * ele.padding();\n        return dim + border + padding;\n      } else {\n        return 1;\n      }\n    }\n  };\n  fn$2['rendered' + opts.uppercaseName] = function renderedDimImpl() {\n    var ele = this[0];\n    if (ele) {\n      var d = ele[opts.name]();\n      return d * this.cy().zoom();\n    }\n  };\n  fn$2['rendered' + opts.uppercaseOuterName] = function renderedOuterDimImpl() {\n    var ele = this[0];\n    if (ele) {\n      var od = ele[opts.outerName]();\n      return od * this.cy().zoom();\n    }\n  };\n};\ndefineDimFns({\n  name: 'width'\n});\ndefineDimFns({\n  name: 'height'\n});\nelesfn$a.padding = function () {\n  var ele = this[0];\n  var _p = ele._private;\n  if (ele.isParent()) {\n    ele.updateCompoundBounds();\n    if (_p.autoPadding !== undefined) {\n      return _p.autoPadding;\n    } else {\n      return ele.pstyle('padding').pfValue;\n    }\n  } else {\n    return ele.pstyle('padding').pfValue;\n  }\n};\nelesfn$a.paddedHeight = function () {\n  var ele = this[0];\n  return ele.height() + 2 * ele.padding();\n};\nelesfn$a.paddedWidth = function () {\n  var ele = this[0];\n  return ele.width() + 2 * ele.padding();\n};\nvar widthHeight = elesfn$a;\n\nvar ifEdge = function ifEdge(ele, getValue) {\n  if (ele.isEdge() && ele.takesUpSpace()) {\n    return getValue(ele);\n  }\n};\nvar ifEdgeRenderedPosition = function ifEdgeRenderedPosition(ele, getPoint) {\n  if (ele.isEdge() && ele.takesUpSpace()) {\n    var cy = ele.cy();\n    return modelToRenderedPosition$1(getPoint(ele), cy.zoom(), cy.pan());\n  }\n};\nvar ifEdgeRenderedPositions = function ifEdgeRenderedPositions(ele, getPoints) {\n  if (ele.isEdge() && ele.takesUpSpace()) {\n    var cy = ele.cy();\n    var pan = cy.pan();\n    var zoom = cy.zoom();\n    return getPoints(ele).map(function (p) {\n      return modelToRenderedPosition$1(p, zoom, pan);\n    });\n  }\n};\nvar controlPoints = function controlPoints(ele) {\n  return ele.renderer().getControlPoints(ele);\n};\nvar segmentPoints = function segmentPoints(ele) {\n  return ele.renderer().getSegmentPoints(ele);\n};\nvar sourceEndpoint = function sourceEndpoint(ele) {\n  return ele.renderer().getSourceEndpoint(ele);\n};\nvar targetEndpoint = function targetEndpoint(ele) {\n  return ele.renderer().getTargetEndpoint(ele);\n};\nvar midpoint = function midpoint(ele) {\n  return ele.renderer().getEdgeMidpoint(ele);\n};\nvar pts = {\n  controlPoints: {\n    get: controlPoints,\n    mult: true\n  },\n  segmentPoints: {\n    get: segmentPoints,\n    mult: true\n  },\n  sourceEndpoint: {\n    get: sourceEndpoint\n  },\n  targetEndpoint: {\n    get: targetEndpoint\n  },\n  midpoint: {\n    get: midpoint\n  }\n};\nvar renderedName = function renderedName(name) {\n  return 'rendered' + name[0].toUpperCase() + name.substr(1);\n};\nvar edgePoints = Object.keys(pts).reduce(function (obj, name) {\n  var spec = pts[name];\n  var rName = renderedName(name);\n  obj[name] = function () {\n    return ifEdge(this, spec.get);\n  };\n  if (spec.mult) {\n    obj[rName] = function () {\n      return ifEdgeRenderedPositions(this, spec.get);\n    };\n  } else {\n    obj[rName] = function () {\n      return ifEdgeRenderedPosition(this, spec.get);\n    };\n  }\n  return obj;\n}, {});\n\nvar dimensions = extend({}, position, bounds, widthHeight, edgePoints);\n\n/*!\nEvent object based on jQuery events, MIT license\n\nhttps://jquery.org/license/\nhttps://tldrlegal.com/license/mit-license\nhttps://github.com/jquery/jquery/blob/master/src/event.js\n*/\n\nvar Event = function Event(src, props) {\n  this.recycle(src, props);\n};\nfunction returnFalse() {\n  return false;\n}\nfunction returnTrue() {\n  return true;\n}\n\n// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\nEvent.prototype = {\n  instanceString: function instanceString() {\n    return 'event';\n  },\n  recycle: function recycle(src, props) {\n    this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse;\n    if (src != null && src.preventDefault) {\n      // Browser Event object\n      this.type = src.type;\n\n      // Events bubbling up the document may have been marked as prevented\n      // by a handler lower down the tree; reflect the correct value.\n      this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse;\n    } else if (src != null && src.type) {\n      // Plain object containing all event details\n      props = src;\n    } else {\n      // Event string\n      this.type = src;\n    }\n\n    // Put explicitly provided properties onto the event object\n    if (props != null) {\n      // more efficient to manually copy fields we use\n      this.originalEvent = props.originalEvent;\n      this.type = props.type != null ? props.type : this.type;\n      this.cy = props.cy;\n      this.target = props.target;\n      this.position = props.position;\n      this.renderedPosition = props.renderedPosition;\n      this.namespace = props.namespace;\n      this.layout = props.layout;\n    }\n    if (this.cy != null && this.position != null && this.renderedPosition == null) {\n      // create a rendered position based on the passed position\n      var pos = this.position;\n      var zoom = this.cy.zoom();\n      var pan = this.cy.pan();\n      this.renderedPosition = {\n        x: pos.x * zoom + pan.x,\n        y: pos.y * zoom + pan.y\n      };\n    }\n\n    // Create a timestamp if incoming event doesn't have one\n    this.timeStamp = src && src.timeStamp || Date.now();\n  },\n  preventDefault: function preventDefault() {\n    this.isDefaultPrevented = returnTrue;\n    var e = this.originalEvent;\n    if (!e) {\n      return;\n    }\n\n    // if preventDefault exists run it on the original event\n    if (e.preventDefault) {\n      e.preventDefault();\n    }\n  },\n  stopPropagation: function stopPropagation() {\n    this.isPropagationStopped = returnTrue;\n    var e = this.originalEvent;\n    if (!e) {\n      return;\n    }\n\n    // if stopPropagation exists run it on the original event\n    if (e.stopPropagation) {\n      e.stopPropagation();\n    }\n  },\n  stopImmediatePropagation: function stopImmediatePropagation() {\n    this.isImmediatePropagationStopped = returnTrue;\n    this.stopPropagation();\n  },\n  isDefaultPrevented: returnFalse,\n  isPropagationStopped: returnFalse,\n  isImmediatePropagationStopped: returnFalse\n};\n\nvar eventRegex = /^([^.]+)(\\.(?:[^.]+))?$/; // regex for matching event strings (e.g. \"click.namespace\")\nvar universalNamespace = '.*'; // matches as if no namespace specified and prevents users from unbinding accidentally\n\nvar defaults$8 = {\n  qualifierCompare: function qualifierCompare(q1, q2) {\n    return q1 === q2;\n  },\n  eventMatches: function eventMatches(/*context, listener, eventObj*/\n  ) {\n    return true;\n  },\n  addEventFields: function addEventFields(/*context, evt*/\n  ) {},\n  callbackContext: function callbackContext(context /*, listener, eventObj*/) {\n    return context;\n  },\n  beforeEmit: function beforeEmit(/* context, listener, eventObj */\n  ) {},\n  afterEmit: function afterEmit(/* context, listener, eventObj */\n  ) {},\n  bubble: function bubble(/*context*/\n  ) {\n    return false;\n  },\n  parent: function parent(/*context*/\n  ) {\n    return null;\n  },\n  context: null\n};\nvar defaultsKeys = Object.keys(defaults$8);\nvar emptyOpts = {};\nfunction Emitter() {\n  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : emptyOpts;\n  var context = arguments.length > 1 ? arguments[1] : undefined;\n  // micro-optimisation vs Object.assign() -- reduces Element instantiation time\n  for (var i = 0; i < defaultsKeys.length; i++) {\n    var key = defaultsKeys[i];\n    this[key] = opts[key] || defaults$8[key];\n  }\n  this.context = context || this.context;\n  this.listeners = [];\n  this.emitting = 0;\n}\nvar p = Emitter.prototype;\nvar forEachEvent = function forEachEvent(self, handler, events, qualifier, callback, conf, confOverrides) {\n  if (fn$6(qualifier)) {\n    callback = qualifier;\n    qualifier = null;\n  }\n  if (confOverrides) {\n    if (conf == null) {\n      conf = confOverrides;\n    } else {\n      conf = extend({}, conf, confOverrides);\n    }\n  }\n  var eventList = array(events) ? events : events.split(/\\s+/);\n  for (var i = 0; i < eventList.length; i++) {\n    var evt = eventList[i];\n    if (emptyString(evt)) {\n      continue;\n    }\n    var match = evt.match(eventRegex); // type[.namespace]\n\n    if (match) {\n      var type = match[1];\n      var namespace = match[2] ? match[2] : null;\n      var ret = handler(self, evt, type, namespace, qualifier, callback, conf);\n      if (ret === false) {\n        break;\n      } // allow exiting early\n    }\n  }\n};\nvar makeEventObj = function makeEventObj(self, obj) {\n  self.addEventFields(self.context, obj);\n  return new Event(obj.type, obj);\n};\nvar forEachEventObj = function forEachEventObj(self, handler, events) {\n  if (event(events)) {\n    handler(self, events);\n    return;\n  } else if (plainObject(events)) {\n    handler(self, makeEventObj(self, events));\n    return;\n  }\n  var eventList = array(events) ? events : events.split(/\\s+/);\n  for (var i = 0; i < eventList.length; i++) {\n    var evt = eventList[i];\n    if (emptyString(evt)) {\n      continue;\n    }\n    var match = evt.match(eventRegex); // type[.namespace]\n\n    if (match) {\n      var type = match[1];\n      var namespace = match[2] ? match[2] : null;\n      var eventObj = makeEventObj(self, {\n        type: type,\n        namespace: namespace,\n        target: self.context\n      });\n      handler(self, eventObj);\n    }\n  }\n};\np.on = p.addListener = function (events, qualifier, callback, conf, confOverrides) {\n  forEachEvent(this, function (self, event, type, namespace, qualifier, callback, conf) {\n    if (fn$6(callback)) {\n      self.listeners.push({\n        event: event,\n        // full event string\n        callback: callback,\n        // callback to run\n        type: type,\n        // the event type (e.g. 'click')\n        namespace: namespace,\n        // the event namespace (e.g. \".foo\")\n        qualifier: qualifier,\n        // a restriction on whether to match this emitter\n        conf: conf // additional configuration\n      });\n    }\n  }, events, qualifier, callback, conf, confOverrides);\n  return this;\n};\np.one = function (events, qualifier, callback, conf) {\n  return this.on(events, qualifier, callback, conf, {\n    one: true\n  });\n};\np.removeListener = p.off = function (events, qualifier, callback, conf) {\n  var _this = this;\n  if (this.emitting !== 0) {\n    this.listeners = copyArray(this.listeners);\n  }\n  var listeners = this.listeners;\n  var _loop = function _loop(i) {\n    var listener = listeners[i];\n    forEachEvent(_this, function (self, event, type, namespace, qualifier, callback /*, conf*/) {\n      if ((listener.type === type || events === '*') && (!namespace && listener.namespace !== '.*' || listener.namespace === namespace) && (!qualifier || self.qualifierCompare(listener.qualifier, qualifier)) && (!callback || listener.callback === callback)) {\n        listeners.splice(i, 1);\n        return false;\n      }\n    }, events, qualifier, callback, conf);\n  };\n  for (var i = listeners.length - 1; i >= 0; i--) {\n    _loop(i);\n  }\n  return this;\n};\np.removeAllListeners = function () {\n  return this.removeListener('*');\n};\np.emit = p.trigger = function (events, extraParams, manualCallback) {\n  var listeners = this.listeners;\n  var numListenersBeforeEmit = listeners.length;\n  this.emitting++;\n  if (!array(extraParams)) {\n    extraParams = [extraParams];\n  }\n  forEachEventObj(this, function (self, eventObj) {\n    if (manualCallback != null) {\n      listeners = [{\n        event: eventObj.event,\n        type: eventObj.type,\n        namespace: eventObj.namespace,\n        callback: manualCallback\n      }];\n      numListenersBeforeEmit = listeners.length;\n    }\n    var _loop2 = function _loop2() {\n      var listener = listeners[i];\n      if (listener.type === eventObj.type && (!listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace) && self.eventMatches(self.context, listener, eventObj)) {\n        var args = [eventObj];\n        if (extraParams != null) {\n          push(args, extraParams);\n        }\n        self.beforeEmit(self.context, listener, eventObj);\n        if (listener.conf && listener.conf.one) {\n          self.listeners = self.listeners.filter(function (l) {\n            return l !== listener;\n          });\n        }\n        var context = self.callbackContext(self.context, listener, eventObj);\n        var ret = listener.callback.apply(context, args);\n        self.afterEmit(self.context, listener, eventObj);\n        if (ret === false) {\n          eventObj.stopPropagation();\n          eventObj.preventDefault();\n        }\n      } // if listener matches\n    };\n    for (var i = 0; i < numListenersBeforeEmit; i++) {\n      _loop2();\n    } // for listener\n\n    if (self.bubble(self.context) && !eventObj.isPropagationStopped()) {\n      self.parent(self.context).emit(eventObj, extraParams);\n    }\n  }, events);\n  this.emitting--;\n  return this;\n};\n\nvar emitterOptions$1 = {\n  qualifierCompare: function qualifierCompare(selector1, selector2) {\n    if (selector1 == null || selector2 == null) {\n      return selector1 == null && selector2 == null;\n    } else {\n      return selector1.sameText(selector2);\n    }\n  },\n  eventMatches: function eventMatches(ele, listener, eventObj) {\n    var selector = listener.qualifier;\n    if (selector != null) {\n      return ele !== eventObj.target && element(eventObj.target) && selector.matches(eventObj.target);\n    }\n    return true;\n  },\n  addEventFields: function addEventFields(ele, evt) {\n    evt.cy = ele.cy();\n    evt.target = ele;\n  },\n  callbackContext: function callbackContext(ele, listener, eventObj) {\n    return listener.qualifier != null ? eventObj.target : ele;\n  },\n  beforeEmit: function beforeEmit(context, listener /*, eventObj*/) {\n    if (listener.conf && listener.conf.once) {\n      listener.conf.onceCollection.removeListener(listener.event, listener.qualifier, listener.callback);\n    }\n  },\n  bubble: function bubble() {\n    return true;\n  },\n  parent: function parent(ele) {\n    return ele.isChild() ? ele.parent() : ele.cy();\n  }\n};\nvar argSelector$1 = function argSelector(arg) {\n  if (string(arg)) {\n    return new Selector(arg);\n  } else {\n    return arg;\n  }\n};\nvar elesfn$9 = {\n  createEmitter: function createEmitter() {\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      var _p = ele._private;\n      if (!_p.emitter) {\n        _p.emitter = new Emitter(emitterOptions$1, ele);\n      }\n    }\n    return this;\n  },\n  emitter: function emitter() {\n    return this._private.emitter;\n  },\n  on: function on(events, selector, callback) {\n    var argSel = argSelector$1(selector);\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      ele.emitter().on(events, argSel, callback);\n    }\n    return this;\n  },\n  removeListener: function removeListener(events, selector, callback) {\n    var argSel = argSelector$1(selector);\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      ele.emitter().removeListener(events, argSel, callback);\n    }\n    return this;\n  },\n  removeAllListeners: function removeAllListeners() {\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      ele.emitter().removeAllListeners();\n    }\n    return this;\n  },\n  one: function one(events, selector, callback) {\n    var argSel = argSelector$1(selector);\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      ele.emitter().one(events, argSel, callback);\n    }\n    return this;\n  },\n  once: function once(events, selector, callback) {\n    var argSel = argSelector$1(selector);\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      ele.emitter().on(events, argSel, callback, {\n        once: true,\n        onceCollection: this\n      });\n    }\n  },\n  emit: function emit(events, extraParams) {\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      ele.emitter().emit(events, extraParams);\n    }\n    return this;\n  },\n  emitAndNotify: function emitAndNotify(event, extraParams) {\n    // for internal use only\n    if (this.length === 0) {\n      return;\n    } // empty collections don't need to notify anything\n\n    // notify renderer\n    this.cy().notify(event, this);\n    this.emit(event, extraParams);\n    return this;\n  }\n};\ndefine.eventAliasesOn(elesfn$9);\n\nvar elesfn$8 = {\n  nodes: function nodes(selector) {\n    return this.filter(function (ele) {\n      return ele.isNode();\n    }).filter(selector);\n  },\n  edges: function edges(selector) {\n    return this.filter(function (ele) {\n      return ele.isEdge();\n    }).filter(selector);\n  },\n  // internal helper to get nodes and edges as separate collections with single iteration over elements\n  byGroup: function byGroup() {\n    var nodes = this.spawn();\n    var edges = this.spawn();\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      if (ele.isNode()) {\n        nodes.push(ele);\n      } else {\n        edges.push(ele);\n      }\n    }\n    return {\n      nodes: nodes,\n      edges: edges\n    };\n  },\n  filter: function filter(_filter, thisArg) {\n    if (_filter === undefined) {\n      // check this first b/c it's the most common/performant case\n      return this;\n    } else if (string(_filter) || elementOrCollection(_filter)) {\n      return new Selector(_filter).filter(this);\n    } else if (fn$6(_filter)) {\n      var filterEles = this.spawn();\n      var eles = this;\n      for (var i = 0; i < eles.length; i++) {\n        var ele = eles[i];\n        var include = thisArg ? _filter.apply(thisArg, [ele, i, eles]) : _filter(ele, i, eles);\n        if (include) {\n          filterEles.push(ele);\n        }\n      }\n      return filterEles;\n    }\n    return this.spawn(); // if not handled by above, give 'em an empty collection\n  },\n  not: function not(toRemove) {\n    if (!toRemove) {\n      return this;\n    } else {\n      if (string(toRemove)) {\n        toRemove = this.filter(toRemove);\n      }\n      var elements = this.spawn();\n      for (var i = 0; i < this.length; i++) {\n        var element = this[i];\n        var remove = toRemove.has(element);\n        if (!remove) {\n          elements.push(element);\n        }\n      }\n      return elements;\n    }\n  },\n  absoluteComplement: function absoluteComplement() {\n    var cy = this.cy();\n    return cy.mutableElements().not(this);\n  },\n  intersect: function intersect(other) {\n    // if a selector is specified, then filter by it instead\n    if (string(other)) {\n      var selector = other;\n      return this.filter(selector);\n    }\n    var elements = this.spawn();\n    var col1 = this;\n    var col2 = other;\n    var col1Smaller = this.length < other.length;\n    var colS = col1Smaller ? col1 : col2;\n    var colL = col1Smaller ? col2 : col1;\n    for (var i = 0; i < colS.length; i++) {\n      var ele = colS[i];\n      if (colL.has(ele)) {\n        elements.push(ele);\n      }\n    }\n    return elements;\n  },\n  xor: function xor(other) {\n    var cy = this._private.cy;\n    if (string(other)) {\n      other = cy.$(other);\n    }\n    var elements = this.spawn();\n    var col1 = this;\n    var col2 = other;\n    var add = function add(col, other) {\n      for (var i = 0; i < col.length; i++) {\n        var ele = col[i];\n        var id = ele._private.data.id;\n        var inOther = other.hasElementWithId(id);\n        if (!inOther) {\n          elements.push(ele);\n        }\n      }\n    };\n    add(col1, col2);\n    add(col2, col1);\n    return elements;\n  },\n  diff: function diff(other) {\n    var cy = this._private.cy;\n    if (string(other)) {\n      other = cy.$(other);\n    }\n    var left = this.spawn();\n    var right = this.spawn();\n    var both = this.spawn();\n    var col1 = this;\n    var col2 = other;\n    var add = function add(col, other, retEles) {\n      for (var i = 0; i < col.length; i++) {\n        var ele = col[i];\n        var id = ele._private.data.id;\n        var inOther = other.hasElementWithId(id);\n        if (inOther) {\n          both.merge(ele);\n        } else {\n          retEles.push(ele);\n        }\n      }\n    };\n    add(col1, col2, left);\n    add(col2, col1, right);\n    return {\n      left: left,\n      right: right,\n      both: both\n    };\n  },\n  add: function add(toAdd) {\n    var cy = this._private.cy;\n    if (!toAdd) {\n      return this;\n    }\n    if (string(toAdd)) {\n      var selector = toAdd;\n      toAdd = cy.mutableElements().filter(selector);\n    }\n    var elements = this.spawnSelf();\n    for (var i = 0; i < toAdd.length; i++) {\n      var ele = toAdd[i];\n      var add = !this.has(ele);\n      if (add) {\n        elements.push(ele);\n      }\n    }\n    return elements;\n  },\n  // in place merge on calling collection\n  merge: function merge(toAdd) {\n    var _p = this._private;\n    var cy = _p.cy;\n    if (!toAdd) {\n      return this;\n    }\n    if (toAdd && string(toAdd)) {\n      var selector = toAdd;\n      toAdd = cy.mutableElements().filter(selector);\n    }\n    var map = _p.map;\n    for (var i = 0; i < toAdd.length; i++) {\n      var toAddEle = toAdd[i];\n      var id = toAddEle._private.data.id;\n      var add = !map.has(id);\n      if (add) {\n        var index = this.length++;\n        this[index] = toAddEle;\n        map.set(id, {\n          ele: toAddEle,\n          index: index\n        });\n      }\n    }\n    return this; // chaining\n  },\n  unmergeAt: function unmergeAt(i) {\n    var ele = this[i];\n    var id = ele.id();\n    var _p = this._private;\n    var map = _p.map;\n\n    // remove ele\n    this[i] = undefined;\n    map[\"delete\"](id);\n    var unmergedLastEle = i === this.length - 1;\n\n    // replace empty spot with last ele in collection\n    if (this.length > 1 && !unmergedLastEle) {\n      var lastEleI = this.length - 1;\n      var lastEle = this[lastEleI];\n      var lastEleId = lastEle._private.data.id;\n      this[lastEleI] = undefined;\n      this[i] = lastEle;\n      map.set(lastEleId, {\n        ele: lastEle,\n        index: i\n      });\n    }\n\n    // the collection is now 1 ele smaller\n    this.length--;\n    return this;\n  },\n  // remove single ele in place in calling collection\n  unmergeOne: function unmergeOne(ele) {\n    ele = ele[0];\n    var _p = this._private;\n    var id = ele._private.data.id;\n    var map = _p.map;\n    var entry = map.get(id);\n    if (!entry) {\n      return this; // no need to remove\n    }\n    var i = entry.index;\n    this.unmergeAt(i);\n    return this;\n  },\n  // remove eles in place on calling collection\n  unmerge: function unmerge(toRemove) {\n    var cy = this._private.cy;\n    if (!toRemove) {\n      return this;\n    }\n    if (toRemove && string(toRemove)) {\n      var selector = toRemove;\n      toRemove = cy.mutableElements().filter(selector);\n    }\n    for (var i = 0; i < toRemove.length; i++) {\n      this.unmergeOne(toRemove[i]);\n    }\n    return this; // chaining\n  },\n  unmergeBy: function unmergeBy(toRmFn) {\n    for (var i = this.length - 1; i >= 0; i--) {\n      var ele = this[i];\n      if (toRmFn(ele)) {\n        this.unmergeAt(i);\n      }\n    }\n    return this;\n  },\n  map: function map(mapFn, thisArg) {\n    var arr = [];\n    var eles = this;\n    for (var i = 0; i < eles.length; i++) {\n      var ele = eles[i];\n      var ret = thisArg ? mapFn.apply(thisArg, [ele, i, eles]) : mapFn(ele, i, eles);\n      arr.push(ret);\n    }\n    return arr;\n  },\n  reduce: function reduce(fn, initialValue) {\n    var val = initialValue;\n    var eles = this;\n    for (var i = 0; i < eles.length; i++) {\n      val = fn(val, eles[i], i, eles);\n    }\n    return val;\n  },\n  max: function max(valFn, thisArg) {\n    var max = -Infinity;\n    var maxEle;\n    var eles = this;\n    for (var i = 0; i < eles.length; i++) {\n      var ele = eles[i];\n      var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles);\n      if (val > max) {\n        max = val;\n        maxEle = ele;\n      }\n    }\n    return {\n      value: max,\n      ele: maxEle\n    };\n  },\n  min: function min(valFn, thisArg) {\n    var min = Infinity;\n    var minEle;\n    var eles = this;\n    for (var i = 0; i < eles.length; i++) {\n      var ele = eles[i];\n      var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles);\n      if (val < min) {\n        min = val;\n        minEle = ele;\n      }\n    }\n    return {\n      value: min,\n      ele: minEle\n    };\n  }\n};\n\n// aliases\nvar fn$1 = elesfn$8;\nfn$1['u'] = fn$1['|'] = fn$1['+'] = fn$1.union = fn$1.or = fn$1.add;\nfn$1['\\\\'] = fn$1['!'] = fn$1['-'] = fn$1.difference = fn$1.relativeComplement = fn$1.subtract = fn$1.not;\nfn$1['n'] = fn$1['&'] = fn$1['.'] = fn$1.and = fn$1.intersection = fn$1.intersect;\nfn$1['^'] = fn$1['(+)'] = fn$1['(-)'] = fn$1.symmetricDifference = fn$1.symdiff = fn$1.xor;\nfn$1.fnFilter = fn$1.filterFn = fn$1.stdFilter = fn$1.filter;\nfn$1.complement = fn$1.abscomp = fn$1.absoluteComplement;\n\nvar elesfn$7 = {\n  isNode: function isNode() {\n    return this.group() === 'nodes';\n  },\n  isEdge: function isEdge() {\n    return this.group() === 'edges';\n  },\n  isLoop: function isLoop() {\n    return this.isEdge() && this.source()[0] === this.target()[0];\n  },\n  isSimple: function isSimple() {\n    return this.isEdge() && this.source()[0] !== this.target()[0];\n  },\n  group: function group() {\n    var ele = this[0];\n    if (ele) {\n      return ele._private.group;\n    }\n  }\n};\n\n/**\n *  Elements are drawn in a specific order based on compound depth (low to high), the element type (nodes above edges),\n *  and z-index (low to high).  These styles affect how this applies:\n *\n *  z-compound-depth: May be `bottom | orphan | auto | top`.  The first drawn is `bottom`, then `orphan` which is the\n *      same depth as the root of the compound graph, followed by the default value `auto` which draws in order from\n *      root to leaves of the compound graph.  The last drawn is `top`.\n *  z-index-compare: May be `auto | manual`.  The default value is `auto` which always draws edges under nodes.\n *      `manual` ignores this convention and draws based on the `z-index` value setting.\n *  z-index: An integer value that affects the relative draw order of elements.  In general, an element with a higher\n *      `z-index` will be drawn on top of an element with a lower `z-index`.\n */\nvar zIndexSort = function zIndexSort(a, b) {\n  var cy = a.cy();\n  var hasCompoundNodes = cy.hasCompoundNodes();\n  function getDepth(ele) {\n    var style = ele.pstyle('z-compound-depth');\n    if (style.value === 'auto') {\n      return hasCompoundNodes ? ele.zDepth() : 0;\n    } else if (style.value === 'bottom') {\n      return -1;\n    } else if (style.value === 'top') {\n      return MAX_INT$1;\n    }\n    // 'orphan'\n    return 0;\n  }\n  var depthDiff = getDepth(a) - getDepth(b);\n  if (depthDiff !== 0) {\n    return depthDiff;\n  }\n  function getEleDepth(ele) {\n    var style = ele.pstyle('z-index-compare');\n    if (style.value === 'auto') {\n      return ele.isNode() ? 1 : 0;\n    }\n    // 'manual'\n    return 0;\n  }\n  var eleDiff = getEleDepth(a) - getEleDepth(b);\n  if (eleDiff !== 0) {\n    return eleDiff;\n  }\n  var zDiff = a.pstyle('z-index').value - b.pstyle('z-index').value;\n  if (zDiff !== 0) {\n    return zDiff;\n  }\n  // compare indices in the core (order added to graph w/ last on top)\n  return a.poolIndex() - b.poolIndex();\n};\n\nvar elesfn$6 = {\n  forEach: function forEach(fn, thisArg) {\n    if (fn$6(fn)) {\n      var N = this.length;\n      for (var i = 0; i < N; i++) {\n        var ele = this[i];\n        var ret = thisArg ? fn.apply(thisArg, [ele, i, this]) : fn(ele, i, this);\n        if (ret === false) {\n          break;\n        } // exit each early on return false\n      }\n    }\n    return this;\n  },\n  toArray: function toArray() {\n    var array = [];\n    for (var i = 0; i < this.length; i++) {\n      array.push(this[i]);\n    }\n    return array;\n  },\n  slice: function slice(start, end) {\n    var array = [];\n    var thisSize = this.length;\n    if (end == null) {\n      end = thisSize;\n    }\n    if (start == null) {\n      start = 0;\n    }\n    if (start < 0) {\n      start = thisSize + start;\n    }\n    if (end < 0) {\n      end = thisSize + end;\n    }\n    for (var i = start; i >= 0 && i < end && i < thisSize; i++) {\n      array.push(this[i]);\n    }\n    return this.spawn(array);\n  },\n  size: function size() {\n    return this.length;\n  },\n  eq: function eq(i) {\n    return this[i] || this.spawn();\n  },\n  first: function first() {\n    return this[0] || this.spawn();\n  },\n  last: function last() {\n    return this[this.length - 1] || this.spawn();\n  },\n  empty: function empty() {\n    return this.length === 0;\n  },\n  nonempty: function nonempty() {\n    return !this.empty();\n  },\n  sort: function sort(sortFn) {\n    if (!fn$6(sortFn)) {\n      return this;\n    }\n    var sorted = this.toArray().sort(sortFn);\n    return this.spawn(sorted);\n  },\n  sortByZIndex: function sortByZIndex() {\n    return this.sort(zIndexSort);\n  },\n  zDepth: function zDepth() {\n    var ele = this[0];\n    if (!ele) {\n      return undefined;\n    }\n\n    // let cy = ele.cy();\n    var _p = ele._private;\n    var group = _p.group;\n    if (group === 'nodes') {\n      var depth = _p.data.parent ? ele.parents().size() : 0;\n      if (!ele.isParent()) {\n        return MAX_INT$1 - 1; // childless nodes always on top\n      }\n      return depth;\n    } else {\n      var src = _p.source;\n      var tgt = _p.target;\n      var srcDepth = src.zDepth();\n      var tgtDepth = tgt.zDepth();\n      return Math.max(srcDepth, tgtDepth, 0); // depth of deepest parent\n    }\n  }\n};\nelesfn$6.each = elesfn$6.forEach;\nvar defineSymbolIterator = function defineSymbolIterator() {\n  var typeofUndef = \"undefined\" ;\n  var isIteratorSupported = (typeof Symbol === \"undefined\" ? \"undefined\" : _typeof(Symbol)) != typeofUndef && _typeof(Symbol.iterator) != typeofUndef;\n  if (isIteratorSupported) {\n    elesfn$6[Symbol.iterator] = function () {\n      var _this = this;\n      var entry = {\n        value: undefined,\n        done: false\n      };\n      var i = 0;\n      var length = this.length;\n      return _defineProperty$1({\n        next: function next() {\n          if (i < length) {\n            entry.value = _this[i++];\n          } else {\n            entry.value = undefined;\n            entry.done = true;\n          }\n          return entry;\n        }\n      }, Symbol.iterator, function () {\n        return this;\n      });\n    };\n  }\n};\ndefineSymbolIterator();\n\nvar getLayoutDimensionOptions = defaults$g({\n  nodeDimensionsIncludeLabels: false\n});\nvar elesfn$5 = {\n  // Calculates and returns node dimensions { x, y } based on options given\n  layoutDimensions: function layoutDimensions(options) {\n    options = getLayoutDimensionOptions(options);\n    var dims;\n    if (!this.takesUpSpace()) {\n      dims = {\n        w: 0,\n        h: 0\n      };\n    } else if (options.nodeDimensionsIncludeLabels) {\n      var bbDim = this.boundingBox();\n      dims = {\n        w: bbDim.w,\n        h: bbDim.h\n      };\n    } else {\n      dims = {\n        w: this.outerWidth(),\n        h: this.outerHeight()\n      };\n    }\n\n    // sanitise the dimensions for external layouts (avoid division by zero)\n    if (dims.w === 0 || dims.h === 0) {\n      dims.w = dims.h = 1;\n    }\n    return dims;\n  },\n  // using standard layout options, apply position function (w/ or w/o animation)\n  layoutPositions: function layoutPositions(layout, options, fn) {\n    var nodes = this.nodes().filter(function (n) {\n      return !n.isParent();\n    });\n    var cy = this.cy();\n    var layoutEles = options.eles; // nodes & edges\n    var getMemoizeKey = function getMemoizeKey(node) {\n      return node.id();\n    };\n    var fnMem = memoize(fn, getMemoizeKey); // memoized version of position function\n\n    layout.emit({\n      type: 'layoutstart',\n      layout: layout\n    });\n    layout.animations = [];\n    var calculateSpacing = function calculateSpacing(spacing, nodesBb, pos) {\n      var center = {\n        x: nodesBb.x1 + nodesBb.w / 2,\n        y: nodesBb.y1 + nodesBb.h / 2\n      };\n      var spacingVector = {\n        // scale from center of bounding box (not necessarily 0,0)\n        x: (pos.x - center.x) * spacing,\n        y: (pos.y - center.y) * spacing\n      };\n      return {\n        x: center.x + spacingVector.x,\n        y: center.y + spacingVector.y\n      };\n    };\n    var useSpacingFactor = options.spacingFactor && options.spacingFactor !== 1;\n    var spacingBb = function spacingBb() {\n      if (!useSpacingFactor) {\n        return null;\n      }\n      var bb = makeBoundingBox();\n      for (var i = 0; i < nodes.length; i++) {\n        var node = nodes[i];\n        var pos = fnMem(node, i);\n        expandBoundingBoxByPoint(bb, pos.x, pos.y);\n      }\n      return bb;\n    };\n    var bb = spacingBb();\n    var getFinalPos = memoize(function (node, i) {\n      var newPos = fnMem(node, i);\n      if (useSpacingFactor) {\n        var spacing = Math.abs(options.spacingFactor);\n        newPos = calculateSpacing(spacing, bb, newPos);\n      }\n      if (options.transform != null) {\n        newPos = options.transform(node, newPos);\n      }\n      return newPos;\n    }, getMemoizeKey);\n    if (options.animate) {\n      for (var i = 0; i < nodes.length; i++) {\n        var node = nodes[i];\n        var newPos = getFinalPos(node, i);\n        var animateNode = options.animateFilter == null || options.animateFilter(node, i);\n        if (animateNode) {\n          var ani = node.animation({\n            position: newPos,\n            duration: options.animationDuration,\n            easing: options.animationEasing\n          });\n          layout.animations.push(ani);\n        } else {\n          node.position(newPos);\n        }\n      }\n      if (options.fit) {\n        var fitAni = cy.animation({\n          fit: {\n            boundingBox: layoutEles.boundingBoxAt(getFinalPos),\n            padding: options.padding\n          },\n          duration: options.animationDuration,\n          easing: options.animationEasing\n        });\n        layout.animations.push(fitAni);\n      } else if (options.zoom !== undefined && options.pan !== undefined) {\n        var zoomPanAni = cy.animation({\n          zoom: options.zoom,\n          pan: options.pan,\n          duration: options.animationDuration,\n          easing: options.animationEasing\n        });\n        layout.animations.push(zoomPanAni);\n      }\n      layout.animations.forEach(function (ani) {\n        return ani.play();\n      });\n      layout.one('layoutready', options.ready);\n      layout.emit({\n        type: 'layoutready',\n        layout: layout\n      });\n      Promise$1.all(layout.animations.map(function (ani) {\n        return ani.promise();\n      })).then(function () {\n        layout.one('layoutstop', options.stop);\n        layout.emit({\n          type: 'layoutstop',\n          layout: layout\n        });\n      });\n    } else {\n      nodes.positions(getFinalPos);\n      if (options.fit) {\n        cy.fit(options.eles, options.padding);\n      }\n      if (options.zoom != null) {\n        cy.zoom(options.zoom);\n      }\n      if (options.pan) {\n        cy.pan(options.pan);\n      }\n      layout.one('layoutready', options.ready);\n      layout.emit({\n        type: 'layoutready',\n        layout: layout\n      });\n      layout.one('layoutstop', options.stop);\n      layout.emit({\n        type: 'layoutstop',\n        layout: layout\n      });\n    }\n    return this; // chaining\n  },\n  layout: function layout(options) {\n    var cy = this.cy();\n    return cy.makeLayout(extend({}, options, {\n      eles: this\n    }));\n  }\n};\n\n// aliases:\nelesfn$5.createLayout = elesfn$5.makeLayout = elesfn$5.layout;\n\nfunction styleCache(key, fn, ele) {\n  var _p = ele._private;\n  var cache = _p.styleCache = _p.styleCache || [];\n  var val;\n  if ((val = cache[key]) != null) {\n    return val;\n  } else {\n    val = cache[key] = fn(ele);\n    return val;\n  }\n}\nfunction cacheStyleFunction(key, fn) {\n  key = hashString(key);\n  return function cachedStyleFunction(ele) {\n    return styleCache(key, fn, ele);\n  };\n}\nfunction cachePrototypeStyleFunction(key, fn) {\n  key = hashString(key);\n  var selfFn = function selfFn(ele) {\n    return fn.call(ele);\n  };\n  return function cachedPrototypeStyleFunction() {\n    var ele = this[0];\n    if (ele) {\n      return styleCache(key, selfFn, ele);\n    }\n  };\n}\nvar elesfn$4 = {\n  recalculateRenderedStyle: function recalculateRenderedStyle(useCache) {\n    var cy = this.cy();\n    var renderer = cy.renderer();\n    var styleEnabled = cy.styleEnabled();\n    if (renderer && styleEnabled) {\n      renderer.recalculateRenderedStyle(this, useCache);\n    }\n    return this;\n  },\n  dirtyStyleCache: function dirtyStyleCache() {\n    var cy = this.cy();\n    var dirty = function dirty(ele) {\n      return ele._private.styleCache = null;\n    };\n    if (cy.hasCompoundNodes()) {\n      var eles;\n      eles = this.spawnSelf().merge(this.descendants()).merge(this.parents());\n      eles.merge(eles.connectedEdges());\n      eles.forEach(dirty);\n    } else {\n      this.forEach(function (ele) {\n        dirty(ele);\n        ele.connectedEdges().forEach(dirty);\n      });\n    }\n    return this;\n  },\n  // fully updates (recalculates) the style for the elements\n  updateStyle: function updateStyle(notifyRenderer) {\n    var cy = this._private.cy;\n    if (!cy.styleEnabled()) {\n      return this;\n    }\n    if (cy.batching()) {\n      var bEles = cy._private.batchStyleEles;\n      bEles.merge(this);\n      return this; // chaining and exit early when batching\n    }\n    var hasCompounds = cy.hasCompoundNodes();\n    var updatedEles = this;\n    notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false;\n    if (hasCompounds) {\n      // then add everything up and down for compound selector checks\n      updatedEles = this.spawnSelf().merge(this.descendants()).merge(this.parents());\n    }\n\n    // let changedEles = style.apply( updatedEles );\n    var changedEles = updatedEles;\n    if (notifyRenderer) {\n      changedEles.emitAndNotify('style'); // let renderer know we changed style\n    } else {\n      changedEles.emit('style'); // just fire the event\n    }\n    updatedEles.forEach(function (ele) {\n      return ele._private.styleDirty = true;\n    });\n    return this; // chaining\n  },\n  // private: clears dirty flag and recalculates style\n  cleanStyle: function cleanStyle() {\n    var cy = this.cy();\n    if (!cy.styleEnabled()) {\n      return;\n    }\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      if (ele._private.styleDirty) {\n        // n.b. this flag should be set before apply() to avoid potential infinite recursion\n        ele._private.styleDirty = false;\n        cy.style().apply(ele);\n      }\n    }\n  },\n  // get the internal parsed style object for the specified property\n  parsedStyle: function parsedStyle(property) {\n    var includeNonDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n    var ele = this[0];\n    var cy = ele.cy();\n    if (!cy.styleEnabled()) {\n      return;\n    }\n    if (ele) {\n      // this.cleanStyle();\n\n      // Inline the important part of cleanStyle(), for raw performance\n      if (ele._private.styleDirty) {\n        // n.b. this flag should be set before apply() to avoid potential infinite recursion\n        ele._private.styleDirty = false;\n        cy.style().apply(ele);\n      }\n      var overriddenStyle = ele._private.style[property];\n      if (overriddenStyle != null) {\n        return overriddenStyle;\n      } else if (includeNonDefault) {\n        return cy.style().getDefaultProperty(property);\n      } else {\n        return null;\n      }\n    }\n  },\n  numericStyle: function numericStyle(property) {\n    var ele = this[0];\n    if (!ele.cy().styleEnabled()) {\n      return;\n    }\n    if (ele) {\n      var pstyle = ele.pstyle(property);\n      return pstyle.pfValue !== undefined ? pstyle.pfValue : pstyle.value;\n    }\n  },\n  numericStyleUnits: function numericStyleUnits(property) {\n    var ele = this[0];\n    if (!ele.cy().styleEnabled()) {\n      return;\n    }\n    if (ele) {\n      return ele.pstyle(property).units;\n    }\n  },\n  // get the specified css property as a rendered value (i.e. on-screen value)\n  // or get the whole rendered style if no property specified (NB doesn't allow setting)\n  renderedStyle: function renderedStyle(property) {\n    var cy = this.cy();\n    if (!cy.styleEnabled()) {\n      return this;\n    }\n    var ele = this[0];\n    if (ele) {\n      return cy.style().getRenderedStyle(ele, property);\n    }\n  },\n  // read the calculated css style of the element or override the style (via a bypass)\n  style: function style(name, value) {\n    var cy = this.cy();\n    if (!cy.styleEnabled()) {\n      return this;\n    }\n    var updateTransitions = false;\n    var style = cy.style();\n    if (plainObject(name)) {\n      // then extend the bypass\n      var props = name;\n      style.applyBypass(this, props, updateTransitions);\n      this.emitAndNotify('style'); // let the renderer know we've updated style\n    } else if (string(name)) {\n      if (value === undefined) {\n        // then get the property from the style\n        var ele = this[0];\n        if (ele) {\n          return style.getStylePropertyValue(ele, name);\n        } else {\n          // empty collection => can't get any value\n          return;\n        }\n      } else {\n        // then set the bypass with the property value\n        style.applyBypass(this, name, value, updateTransitions);\n        this.emitAndNotify('style'); // let the renderer know we've updated style\n      }\n    } else if (name === undefined) {\n      var _ele = this[0];\n      if (_ele) {\n        return style.getRawStyle(_ele);\n      } else {\n        // empty collection => can't get any value\n        return;\n      }\n    }\n    return this; // chaining\n  },\n  removeStyle: function removeStyle(names) {\n    var cy = this.cy();\n    if (!cy.styleEnabled()) {\n      return this;\n    }\n    var updateTransitions = false;\n    var style = cy.style();\n    var eles = this;\n    if (names === undefined) {\n      for (var i = 0; i < eles.length; i++) {\n        var ele = eles[i];\n        style.removeAllBypasses(ele, updateTransitions);\n      }\n    } else {\n      names = names.split(/\\s+/);\n      for (var _i = 0; _i < eles.length; _i++) {\n        var _ele2 = eles[_i];\n        style.removeBypasses(_ele2, names, updateTransitions);\n      }\n    }\n    this.emitAndNotify('style'); // let the renderer know we've updated style\n\n    return this; // chaining\n  },\n  show: function show() {\n    this.css('display', 'element');\n    return this; // chaining\n  },\n  hide: function hide() {\n    this.css('display', 'none');\n    return this; // chaining\n  },\n  effectiveOpacity: function effectiveOpacity() {\n    var cy = this.cy();\n    if (!cy.styleEnabled()) {\n      return 1;\n    }\n    var hasCompoundNodes = cy.hasCompoundNodes();\n    var ele = this[0];\n    if (ele) {\n      var _p = ele._private;\n      var parentOpacity = ele.pstyle('opacity').value;\n      if (!hasCompoundNodes) {\n        return parentOpacity;\n      }\n      var parents = !_p.data.parent ? null : ele.parents();\n      if (parents) {\n        for (var i = 0; i < parents.length; i++) {\n          var parent = parents[i];\n          var opacity = parent.pstyle('opacity').value;\n          parentOpacity = opacity * parentOpacity;\n        }\n      }\n      return parentOpacity;\n    }\n  },\n  transparent: function transparent() {\n    var cy = this.cy();\n    if (!cy.styleEnabled()) {\n      return false;\n    }\n    var ele = this[0];\n    var hasCompoundNodes = ele.cy().hasCompoundNodes();\n    if (ele) {\n      if (!hasCompoundNodes) {\n        return ele.pstyle('opacity').value === 0;\n      } else {\n        return ele.effectiveOpacity() === 0;\n      }\n    }\n  },\n  backgrounding: function backgrounding() {\n    var cy = this.cy();\n    if (!cy.styleEnabled()) {\n      return false;\n    }\n    var ele = this[0];\n    return ele._private.backgrounding ? true : false;\n  }\n};\nfunction checkCompound(ele, parentOk) {\n  var _p = ele._private;\n  var parents = _p.data.parent ? ele.parents() : null;\n  if (parents) {\n    for (var i = 0; i < parents.length; i++) {\n      var parent = parents[i];\n      if (!parentOk(parent)) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\nfunction defineDerivedStateFunction(specs) {\n  var ok = specs.ok;\n  var edgeOkViaNode = specs.edgeOkViaNode || specs.ok;\n  var parentOk = specs.parentOk || specs.ok;\n  return function () {\n    var cy = this.cy();\n    if (!cy.styleEnabled()) {\n      return true;\n    }\n    var ele = this[0];\n    var hasCompoundNodes = cy.hasCompoundNodes();\n    if (ele) {\n      var _p = ele._private;\n      if (!ok(ele)) {\n        return false;\n      }\n      if (ele.isNode()) {\n        return !hasCompoundNodes || checkCompound(ele, parentOk);\n      } else {\n        var src = _p.source;\n        var tgt = _p.target;\n        return edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode)));\n      }\n    }\n  };\n}\nvar eleTakesUpSpace = cacheStyleFunction('eleTakesUpSpace', function (ele) {\n  return ele.pstyle('display').value === 'element' && ele.width() !== 0 && (ele.isNode() ? ele.height() !== 0 : true);\n});\nelesfn$4.takesUpSpace = cachePrototypeStyleFunction('takesUpSpace', defineDerivedStateFunction({\n  ok: eleTakesUpSpace\n}));\nvar eleInteractive = cacheStyleFunction('eleInteractive', function (ele) {\n  return ele.pstyle('events').value === 'yes' && ele.pstyle('visibility').value === 'visible' && eleTakesUpSpace(ele);\n});\nvar parentInteractive = cacheStyleFunction('parentInteractive', function (parent) {\n  return parent.pstyle('visibility').value === 'visible' && eleTakesUpSpace(parent);\n});\nelesfn$4.interactive = cachePrototypeStyleFunction('interactive', defineDerivedStateFunction({\n  ok: eleInteractive,\n  parentOk: parentInteractive,\n  edgeOkViaNode: eleTakesUpSpace\n}));\nelesfn$4.noninteractive = function () {\n  var ele = this[0];\n  if (ele) {\n    return !ele.interactive();\n  }\n};\nvar eleVisible = cacheStyleFunction('eleVisible', function (ele) {\n  return ele.pstyle('visibility').value === 'visible' && ele.pstyle('opacity').pfValue !== 0 && eleTakesUpSpace(ele);\n});\nvar edgeVisibleViaNode = eleTakesUpSpace;\nelesfn$4.visible = cachePrototypeStyleFunction('visible', defineDerivedStateFunction({\n  ok: eleVisible,\n  edgeOkViaNode: edgeVisibleViaNode\n}));\nelesfn$4.hidden = function () {\n  var ele = this[0];\n  if (ele) {\n    return !ele.visible();\n  }\n};\nelesfn$4.isBundledBezier = cachePrototypeStyleFunction('isBundledBezier', function () {\n  if (!this.cy().styleEnabled()) {\n    return false;\n  }\n  return !this.removed() && this.pstyle('curve-style').value === 'bezier' && this.takesUpSpace();\n});\nelesfn$4.bypass = elesfn$4.css = elesfn$4.style;\nelesfn$4.renderedCss = elesfn$4.renderedStyle;\nelesfn$4.removeBypass = elesfn$4.removeCss = elesfn$4.removeStyle;\nelesfn$4.pstyle = elesfn$4.parsedStyle;\n\nvar elesfn$3 = {};\nfunction defineSwitchFunction(params) {\n  return function () {\n    var args = arguments;\n    var changedEles = [];\n\n    // e.g. cy.nodes().select( data, handler )\n    if (args.length === 2) {\n      var data = args[0];\n      var handler = args[1];\n      this.on(params.event, data, handler);\n    }\n\n    // e.g. cy.nodes().select( handler )\n    else if (args.length === 1 && fn$6(args[0])) {\n      var _handler = args[0];\n      this.on(params.event, _handler);\n    }\n\n    // e.g. cy.nodes().select()\n    // e.g. (private) cy.nodes().select(['tapselect'])\n    else if (args.length === 0 || args.length === 1 && array(args[0])) {\n      var addlEvents = args.length === 1 ? args[0] : null;\n      for (var i = 0; i < this.length; i++) {\n        var ele = this[i];\n        var able = !params.ableField || ele._private[params.ableField];\n        var changed = ele._private[params.field] != params.value;\n        if (params.overrideAble) {\n          var overrideAble = params.overrideAble(ele);\n          if (overrideAble !== undefined) {\n            able = overrideAble;\n            if (!overrideAble) {\n              return this;\n            } // to save cycles assume not able for all on override\n          }\n        }\n        if (able) {\n          ele._private[params.field] = params.value;\n          if (changed) {\n            changedEles.push(ele);\n          }\n        }\n      }\n      var changedColl = this.spawn(changedEles);\n      changedColl.updateStyle(); // change of state => possible change of style\n      changedColl.emit(params.event);\n      if (addlEvents) {\n        changedColl.emit(addlEvents);\n      }\n    }\n    return this;\n  };\n}\nfunction defineSwitchSet(params) {\n  elesfn$3[params.field] = function () {\n    var ele = this[0];\n    if (ele) {\n      if (params.overrideField) {\n        var val = params.overrideField(ele);\n        if (val !== undefined) {\n          return val;\n        }\n      }\n      return ele._private[params.field];\n    }\n  };\n  elesfn$3[params.on] = defineSwitchFunction({\n    event: params.on,\n    field: params.field,\n    ableField: params.ableField,\n    overrideAble: params.overrideAble,\n    value: true\n  });\n  elesfn$3[params.off] = defineSwitchFunction({\n    event: params.off,\n    field: params.field,\n    ableField: params.ableField,\n    overrideAble: params.overrideAble,\n    value: false\n  });\n}\ndefineSwitchSet({\n  field: 'locked',\n  overrideField: function overrideField(ele) {\n    return ele.cy().autolock() ? true : undefined;\n  },\n  on: 'lock',\n  off: 'unlock'\n});\ndefineSwitchSet({\n  field: 'grabbable',\n  overrideField: function overrideField(ele) {\n    return ele.cy().autoungrabify() || ele.pannable() ? false : undefined;\n  },\n  on: 'grabify',\n  off: 'ungrabify'\n});\ndefineSwitchSet({\n  field: 'selected',\n  ableField: 'selectable',\n  overrideAble: function overrideAble(ele) {\n    return ele.cy().autounselectify() ? false : undefined;\n  },\n  on: 'select',\n  off: 'unselect'\n});\ndefineSwitchSet({\n  field: 'selectable',\n  overrideField: function overrideField(ele) {\n    return ele.cy().autounselectify() ? false : undefined;\n  },\n  on: 'selectify',\n  off: 'unselectify'\n});\nelesfn$3.deselect = elesfn$3.unselect;\nelesfn$3.grabbed = function () {\n  var ele = this[0];\n  if (ele) {\n    return ele._private.grabbed;\n  }\n};\ndefineSwitchSet({\n  field: 'active',\n  on: 'activate',\n  off: 'unactivate'\n});\ndefineSwitchSet({\n  field: 'pannable',\n  on: 'panify',\n  off: 'unpanify'\n});\nelesfn$3.inactive = function () {\n  var ele = this[0];\n  if (ele) {\n    return !ele._private.active;\n  }\n};\n\nvar elesfn$2 = {};\n\n// DAG functions\n////////////////\n\nvar defineDagExtremity = function defineDagExtremity(params) {\n  return function dagExtremityImpl(selector) {\n    var eles = this;\n    var ret = [];\n    for (var i = 0; i < eles.length; i++) {\n      var ele = eles[i];\n      if (!ele.isNode()) {\n        continue;\n      }\n      var disqualified = false;\n      var edges = ele.connectedEdges();\n      for (var j = 0; j < edges.length; j++) {\n        var edge = edges[j];\n        var src = edge.source();\n        var tgt = edge.target();\n        if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) {\n          disqualified = true;\n          break;\n        }\n      }\n      if (!disqualified) {\n        ret.push(ele);\n      }\n    }\n    return this.spawn(ret, true).filter(selector);\n  };\n};\nvar defineDagOneHop = function defineDagOneHop(params) {\n  return function (selector) {\n    var eles = this;\n    var oEles = [];\n    for (var i = 0; i < eles.length; i++) {\n      var ele = eles[i];\n      if (!ele.isNode()) {\n        continue;\n      }\n      var edges = ele.connectedEdges();\n      for (var j = 0; j < edges.length; j++) {\n        var edge = edges[j];\n        var src = edge.source();\n        var tgt = edge.target();\n        if (params.outgoing && src === ele) {\n          oEles.push(edge);\n          oEles.push(tgt);\n        } else if (params.incoming && tgt === ele) {\n          oEles.push(edge);\n          oEles.push(src);\n        }\n      }\n    }\n    return this.spawn(oEles, true).filter(selector);\n  };\n};\nvar defineDagAllHops = function defineDagAllHops(params) {\n  return function (selector) {\n    var eles = this;\n    var sEles = [];\n    var sElesIds = {};\n    for (;;) {\n      var next = params.outgoing ? eles.outgoers() : eles.incomers();\n      if (next.length === 0) {\n        break;\n      } // done if none left\n\n      var newNext = false;\n      for (var i = 0; i < next.length; i++) {\n        var n = next[i];\n        var nid = n.id();\n        if (!sElesIds[nid]) {\n          sElesIds[nid] = true;\n          sEles.push(n);\n          newNext = true;\n        }\n      }\n      if (!newNext) {\n        break;\n      } // done if touched all outgoers already\n\n      eles = next;\n    }\n    return this.spawn(sEles, true).filter(selector);\n  };\n};\nelesfn$2.clearTraversalCache = function () {\n  for (var i = 0; i < this.length; i++) {\n    this[i]._private.traversalCache = null;\n  }\n};\nextend(elesfn$2, {\n  // get the root nodes in the DAG\n  roots: defineDagExtremity({\n    noIncomingEdges: true\n  }),\n  // get the leaf nodes in the DAG\n  leaves: defineDagExtremity({\n    noOutgoingEdges: true\n  }),\n  // normally called children in graph theory\n  // these nodes =edges=> outgoing nodes\n  outgoers: cache(defineDagOneHop({\n    outgoing: true\n  }), 'outgoers'),\n  // aka DAG descendants\n  successors: defineDagAllHops({\n    outgoing: true\n  }),\n  // normally called parents in graph theory\n  // these nodes <=edges= incoming nodes\n  incomers: cache(defineDagOneHop({\n    incoming: true\n  }), 'incomers'),\n  // aka DAG ancestors\n  predecessors: defineDagAllHops({\n    })\n});\n\n// Neighbourhood functions\n//////////////////////////\n\nextend(elesfn$2, {\n  neighborhood: cache(function (selector) {\n    var elements = [];\n    var nodes = this.nodes();\n    for (var i = 0; i < nodes.length; i++) {\n      // for all nodes\n      var node = nodes[i];\n      var connectedEdges = node.connectedEdges();\n\n      // for each connected edge, add the edge and the other node\n      for (var j = 0; j < connectedEdges.length; j++) {\n        var edge = connectedEdges[j];\n        var src = edge.source();\n        var tgt = edge.target();\n        var otherNode = node === src ? tgt : src;\n\n        // need check in case of loop\n        if (otherNode.length > 0) {\n          elements.push(otherNode[0]); // add node 1 hop away\n        }\n\n        // add connected edge\n        elements.push(edge[0]);\n      }\n    }\n    return this.spawn(elements, true).filter(selector);\n  }, 'neighborhood'),\n  closedNeighborhood: function closedNeighborhood(selector) {\n    return this.neighborhood().add(this).filter(selector);\n  },\n  openNeighborhood: function openNeighborhood(selector) {\n    return this.neighborhood(selector);\n  }\n});\n\n// aliases\nelesfn$2.neighbourhood = elesfn$2.neighborhood;\nelesfn$2.closedNeighbourhood = elesfn$2.closedNeighborhood;\nelesfn$2.openNeighbourhood = elesfn$2.openNeighborhood;\n\n// Edge functions\n/////////////////\n\nextend(elesfn$2, {\n  source: cache(function sourceImpl(selector) {\n    var ele = this[0];\n    var src;\n    if (ele) {\n      src = ele._private.source || ele.cy().collection();\n    }\n    return src && selector ? src.filter(selector) : src;\n  }, 'source'),\n  target: cache(function targetImpl(selector) {\n    var ele = this[0];\n    var tgt;\n    if (ele) {\n      tgt = ele._private.target || ele.cy().collection();\n    }\n    return tgt && selector ? tgt.filter(selector) : tgt;\n  }, 'target'),\n  sources: defineSourceFunction({\n    attr: 'source'\n  }),\n  targets: defineSourceFunction({\n    attr: 'target'\n  })\n});\nfunction defineSourceFunction(params) {\n  return function sourceImpl(selector) {\n    var sources = [];\n    for (var i = 0; i < this.length; i++) {\n      var ele = this[i];\n      var src = ele._private[params.attr];\n      if (src) {\n        sources.push(src);\n      }\n    }\n    return this.spawn(sources, true).filter(selector);\n  };\n}\nextend(elesfn$2, {\n  edgesWith: cache(defineEdgesWithFunction(), 'edgesWith'),\n  edgesTo: cache(defineEdgesWithFunction({\n    thisIsSrc: true\n  }), 'edgesTo')\n});\nfunction defineEdgesWithFunction(params) {\n  return function edgesWithImpl(otherNodes) {\n    var elements = [];\n    var cy = this._private.cy;\n    var p = params || {};\n\n    // get elements if a selector is specified\n    if (string(otherNodes)) {\n      otherNodes = cy.$(otherNodes);\n    }\n    for (var h = 0; h < otherNodes.length; h++) {\n      var edges = otherNodes[h]._private.edges;\n      for (var i = 0; i < edges.length; i++) {\n        var edge = edges[i];\n        var edgeData = edge._private.data;\n        var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target);\n        var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target);\n        var edgeConnectsThisAndOther = thisToOther || otherToThis;\n        if (!edgeConnectsThisAndOther) {\n          continue;\n        }\n        if (p.thisIsSrc || p.thisIsTgt) {\n          if (p.thisIsSrc && !thisToOther) {\n            continue;\n          }\n          if (p.thisIsTgt && !otherToThis) {\n            continue;\n          }\n        }\n        elements.push(edge);\n      }\n    }\n    return this.spawn(elements, true);\n  };\n}\nextend(elesfn$2, {\n  connectedEdges: cache(function (selector) {\n    var retEles = [];\n    var eles = this;\n    for (var i = 0; i < eles.length; i++) {\n      var node = eles[i];\n      if (!node.isNode()) {\n        continue;\n      }\n      var edges = node._private.edges;\n      for (var j = 0; j < edges.length; j++) {\n        var edge = edges[j];\n        retEles.push(edge);\n      }\n    }\n    return this.spawn(retEles, true).filter(selector);\n  }, 'connectedEdges'),\n  connectedNodes: cache(function (selector) {\n    var retEles = [];\n    var eles = this;\n    for (var i = 0; i < eles.length; i++) {\n      var edge = eles[i];\n      if (!edge.isEdge()) {\n        continue;\n      }\n      retEles.push(edge.source()[0]);\n      retEles.push(edge.target()[0]);\n    }\n    return this.spawn(retEles, true).filter(selector);\n  }, 'connectedNodes'),\n  parallelEdges: cache(defineParallelEdgesFunction(), 'parallelEdges'),\n  codirectedEdges: cache(defineParallelEdgesFunction({\n    codirected: true\n  }), 'codirectedEdges')\n});\nfunction defineParallelEdgesFunction(params) {\n  var defaults = {\n    codirected: false\n  };\n  params = extend({}, defaults, params);\n  return function parallelEdgesImpl(selector) {\n    // micro-optimised for renderer\n    var elements = [];\n    var edges = this.edges();\n    var p = params;\n\n    // look at all the edges in the collection\n    for (var i = 0; i < edges.length; i++) {\n      var edge1 = edges[i];\n      var edge1_p = edge1._private;\n      var src1 = edge1_p.source;\n      var srcid1 = src1._private.data.id;\n      var tgtid1 = edge1_p.data.target;\n      var srcEdges1 = src1._private.edges;\n\n      // look at edges connected to the src node of this edge\n      for (var j = 0; j < srcEdges1.length; j++) {\n        var edge2 = srcEdges1[j];\n        var edge2data = edge2._private.data;\n        var tgtid2 = edge2data.target;\n        var srcid2 = edge2data.source;\n        var codirected = tgtid2 === tgtid1 && srcid2 === srcid1;\n        var oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2;\n        if (p.codirected && codirected || !p.codirected && (codirected || oppdirected)) {\n          elements.push(edge2);\n        }\n      }\n    }\n    return this.spawn(elements, true).filter(selector);\n  };\n}\n\n// Misc functions\n/////////////////\n\nextend(elesfn$2, {\n  components: function components(root) {\n    var self = this;\n    var cy = self.cy();\n    var visited = cy.collection();\n    var unvisited = root == null ? self.nodes() : root.nodes();\n    var components = [];\n    if (root != null && unvisited.empty()) {\n      // root may contain only edges\n      unvisited = root.sources(); // doesn't matter which node to use (undirected), so just use the source sides\n    }\n    var visitInComponent = function visitInComponent(node, component) {\n      visited.merge(node);\n      unvisited.unmerge(node);\n      component.merge(node);\n    };\n    if (unvisited.empty()) {\n      return self.spawn();\n    }\n    var _loop = function _loop() {\n      // each iteration yields a component\n      var cmpt = cy.collection();\n      components.push(cmpt);\n      var root = unvisited[0];\n      visitInComponent(root, cmpt);\n      self.bfs({\n        directed: false,\n        roots: root,\n        visit: function visit(v) {\n          return visitInComponent(v, cmpt);\n        }\n      });\n      cmpt.forEach(function (node) {\n        node.connectedEdges().forEach(function (e) {\n          // connectedEdges() usually cached\n          if (self.has(e) && cmpt.has(e.source()) && cmpt.has(e.target())) {\n            // has() is cheap\n            cmpt.merge(e); // forEach() only considers nodes -- sets N at call time\n          }\n        });\n      });\n    };\n    do {\n      _loop();\n    } while (unvisited.length > 0);\n    return components;\n  },\n  component: function component() {\n    var ele = this[0];\n    return ele.cy().mutableElements().components(ele)[0];\n  }\n});\nelesfn$2.componentsOf = elesfn$2.components;\n\n// represents a set of nodes, edges, or both together\nvar Collection = function Collection(cy, elements) {\n  var unique = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n  var removed = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n  if (cy === undefined) {\n    error('A collection must have a reference to the core');\n    return;\n  }\n  var map = new Map$1();\n  var createdElements = false;\n  if (!elements) {\n    elements = [];\n  } else if (elements.length > 0 && plainObject(elements[0]) && !element(elements[0])) {\n    createdElements = true;\n\n    // make elements from json and restore all at once later\n    var eles = [];\n    var elesIds = new Set$1();\n    for (var i = 0, l = elements.length; i < l; i++) {\n      var json = elements[i];\n      if (json.data == null) {\n        json.data = {};\n      }\n      var _data = json.data;\n\n      // make sure newly created elements have valid ids\n      if (_data.id == null) {\n        _data.id = uuid();\n      } else if (cy.hasElementWithId(_data.id) || elesIds.has(_data.id)) {\n        continue; // can't create element if prior id already exists\n      }\n      var ele = new Element(cy, json, false);\n      eles.push(ele);\n      elesIds.add(_data.id);\n    }\n    elements = eles;\n  }\n  this.length = 0;\n  for (var _i = 0, _l = elements.length; _i < _l; _i++) {\n    var element$1 = elements[_i][0]; // [0] in case elements is an array of collections, rather than array of elements\n    if (element$1 == null) {\n      continue;\n    }\n    var id = element$1._private.data.id;\n    if (!unique || !map.has(id)) {\n      if (unique) {\n        map.set(id, {\n          index: this.length,\n          ele: element$1\n        });\n      }\n      this[this.length] = element$1;\n      this.length++;\n    }\n  }\n  this._private = {\n    eles: this,\n    cy: cy,\n    get map() {\n      if (this.lazyMap == null) {\n        this.rebuildMap();\n      }\n      return this.lazyMap;\n    },\n    set map(m) {\n      this.lazyMap = m;\n    },\n    rebuildMap: function rebuildMap() {\n      var m = this.lazyMap = new Map$1();\n      var eles = this.eles;\n      for (var _i2 = 0; _i2 < eles.length; _i2++) {\n        var _ele = eles[_i2];\n        m.set(_ele.id(), {\n          index: _i2,\n          ele: _ele\n        });\n      }\n    }\n  };\n  if (unique) {\n    this._private.map = map;\n  }\n\n  // restore the elements if we created them from json\n  if (createdElements && !removed) {\n    this.restore();\n  }\n};\n\n// Functions\n////////////////////////////////////////////////////////////////////////////////////////////////////\n\n// keep the prototypes in sync (an element has the same functions as a collection)\n// and use elefn and elesfn as shorthands to the prototypes\nvar elesfn$1 = Element.prototype = Collection.prototype = Object.create(Array.prototype);\nelesfn$1.instanceString = function () {\n  return 'collection';\n};\nelesfn$1.spawn = function (eles, unique) {\n  return new Collection(this.cy(), eles, unique);\n};\nelesfn$1.spawnSelf = function () {\n  return this.spawn(this);\n};\nelesfn$1.cy = function () {\n  return this._private.cy;\n};\nelesfn$1.renderer = function () {\n  return this._private.cy.renderer();\n};\nelesfn$1.element = function () {\n  return this[0];\n};\nelesfn$1.collection = function () {\n  if (collection(this)) {\n    return this;\n  } else {\n    // an element\n    return new Collection(this._private.cy, [this]);\n  }\n};\nelesfn$1.unique = function () {\n  return new Collection(this._private.cy, this, true);\n};\nelesfn$1.hasElementWithId = function (id) {\n  id = '' + id; // id must be string\n\n  return this._private.map.has(id);\n};\nelesfn$1.getElementById = function (id) {\n  id = '' + id; // id must be string\n\n  var cy = this._private.cy;\n  var entry = this._private.map.get(id);\n  return entry ? entry.ele : new Collection(cy); // get ele or empty collection\n};\nelesfn$1.$id = elesfn$1.getElementById;\nelesfn$1.poolIndex = function () {\n  var cy = this._private.cy;\n  var eles = cy._private.elements;\n  var id = this[0]._private.data.id;\n  return eles._private.map.get(id).index;\n};\nelesfn$1.indexOf = function (ele) {\n  var id = ele[0]._private.data.id;\n  return this._private.map.get(id).index;\n};\nelesfn$1.indexOfId = function (id) {\n  id = '' + id; // id must be string\n\n  return this._private.map.get(id).index;\n};\nelesfn$1.json = function (obj) {\n  var ele = this.element();\n  var cy = this.cy();\n  if (ele == null && obj) {\n    return this;\n  } // can't set to no eles\n\n  if (ele == null) {\n    return undefined;\n  } // can't get from no eles\n\n  var p = ele._private;\n  if (plainObject(obj)) {\n    // set\n\n    cy.startBatch();\n    if (obj.data) {\n      ele.data(obj.data);\n      var _data2 = p.data;\n      if (ele.isEdge()) {\n        // source and target are immutable via data()\n        var move = false;\n        var spec = {};\n        var src = obj.data.source;\n        var tgt = obj.data.target;\n        if (src != null && src != _data2.source) {\n          spec.source = '' + src; // id must be string\n          move = true;\n        }\n        if (tgt != null && tgt != _data2.target) {\n          spec.target = '' + tgt; // id must be string\n          move = true;\n        }\n        if (move) {\n          ele = ele.move(spec);\n        }\n      } else {\n        // parent is immutable via data()\n        var newParentValSpecd = 'parent' in obj.data;\n        var parent = obj.data.parent;\n        if (newParentValSpecd && (parent != null || _data2.parent != null) && parent != _data2.parent) {\n          if (parent === undefined) {\n            // can't set undefined imperatively, so use null\n            parent = null;\n          }\n          if (parent != null) {\n            parent = '' + parent; // id must be string\n          }\n          ele = ele.move({\n            parent: parent\n          });\n        }\n      }\n    }\n    if (obj.position) {\n      ele.position(obj.position);\n    }\n\n    // ignore group -- immutable\n\n    var checkSwitch = function checkSwitch(k, trueFnName, falseFnName) {\n      var obj_k = obj[k];\n      if (obj_k != null && obj_k !== p[k]) {\n        if (obj_k) {\n          ele[trueFnName]();\n        } else {\n          ele[falseFnName]();\n        }\n      }\n    };\n    checkSwitch('removed', 'remove', 'restore');\n    checkSwitch('selected', 'select', 'unselect');\n    checkSwitch('selectable', 'selectify', 'unselectify');\n    checkSwitch('locked', 'lock', 'unlock');\n    checkSwitch('grabbable', 'grabify', 'ungrabify');\n    checkSwitch('pannable', 'panify', 'unpanify');\n    if (obj.classes != null) {\n      ele.classes(obj.classes);\n    }\n    cy.endBatch();\n    return this;\n  } else if (obj === undefined) {\n    // get\n\n    var json = {\n      data: copy(p.data),\n      position: copy(p.position),\n      group: p.group,\n      removed: p.removed,\n      selected: p.selected,\n      selectable: p.selectable,\n      locked: p.locked,\n      grabbable: p.grabbable,\n      pannable: p.pannable,\n      classes: null\n    };\n    json.classes = '';\n    var i = 0;\n    p.classes.forEach(function (cls) {\n      return json.classes += i++ === 0 ? cls : ' ' + cls;\n    });\n    return json;\n  }\n};\nelesfn$1.jsons = function () {\n  var jsons = [];\n  for (var i = 0; i < this.length; i++) {\n    var ele = this[i];\n    var json = ele.json();\n    jsons.push(json);\n  }\n  return jsons;\n};\nelesfn$1.clone = function () {\n  var cy = this.cy();\n  var elesArr = [];\n  for (var i = 0; i < this.length; i++) {\n    var ele = this[i];\n    var json = ele.json();\n    var clone = new Element(cy, json, false); // NB no restore\n\n    elesArr.push(clone);\n  }\n  return new Collection(cy, elesArr);\n};\nelesfn$1.copy = elesfn$1.clone;\nelesfn$1.restore = function () {\n  var notifyRenderer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n  var addToPool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n  var self = this;\n  var cy = self.cy();\n  var cy_p = cy._private;\n\n  // create arrays of nodes and edges, since we need to\n  // restore the nodes first\n  var nodes = [];\n  var edges = [];\n  var elements;\n  for (var _i3 = 0, l = self.length; _i3 < l; _i3++) {\n    var ele = self[_i3];\n    if (addToPool && !ele.removed()) {\n      // don't need to handle this ele\n      continue;\n    }\n\n    // keep nodes first in the array and edges after\n    if (ele.isNode()) {\n      // put to front of array if node\n      nodes.push(ele);\n    } else {\n      // put to end of array if edge\n      edges.push(ele);\n    }\n  }\n  elements = nodes.concat(edges);\n  var i;\n  var removeFromElements = function removeFromElements() {\n    elements.splice(i, 1);\n    i--;\n  };\n\n  // now, restore each element\n  for (i = 0; i < elements.length; i++) {\n    var _ele2 = elements[i];\n    var _private = _ele2._private;\n    var _data3 = _private.data;\n\n    // the traversal cache should start fresh when ele is added\n    _ele2.clearTraversalCache();\n\n    // set id and validate\n    if (!addToPool && !_private.removed) ; else if (_data3.id === undefined) {\n      _data3.id = uuid();\n    } else if (number$1(_data3.id)) {\n      _data3.id = '' + _data3.id; // now it's a string\n    } else if (emptyString(_data3.id) || !string(_data3.id)) {\n      error('Can not create element with invalid string ID `' + _data3.id + '`');\n\n      // can't create element if it has empty string as id or non-string id\n      removeFromElements();\n      continue;\n    } else if (cy.hasElementWithId(_data3.id)) {\n      error('Can not create second element with ID `' + _data3.id + '`');\n\n      // can't create element if one already has that id\n      removeFromElements();\n      continue;\n    }\n    var id = _data3.id; // id is finalised, now let's keep a ref\n\n    if (_ele2.isNode()) {\n      // extra checks for nodes\n      var pos = _private.position;\n\n      // make sure the nodes have a defined position\n\n      if (pos.x == null) {\n        pos.x = 0;\n      }\n      if (pos.y == null) {\n        pos.y = 0;\n      }\n    }\n    if (_ele2.isEdge()) {\n      // extra checks for edges\n\n      var edge = _ele2;\n      var fields = ['source', 'target'];\n      var fieldsLength = fields.length;\n      var badSourceOrTarget = false;\n      for (var j = 0; j < fieldsLength; j++) {\n        var field = fields[j];\n        var val = _data3[field];\n        if (number$1(val)) {\n          val = _data3[field] = '' + _data3[field]; // now string\n        }\n        if (val == null || val === '') {\n          // can't create if source or target is not defined properly\n          error('Can not create edge `' + id + '` with unspecified ' + field);\n          badSourceOrTarget = true;\n        } else if (!cy.hasElementWithId(val)) {\n          // can't create edge if one of its nodes doesn't exist\n          error('Can not create edge `' + id + '` with nonexistent ' + field + ' `' + val + '`');\n          badSourceOrTarget = true;\n        }\n      }\n      if (badSourceOrTarget) {\n        removeFromElements();\n        continue;\n      } // can't create this\n\n      var src = cy.getElementById(_data3.source);\n      var tgt = cy.getElementById(_data3.target);\n\n      // only one edge in node if loop\n      if (src.same(tgt)) {\n        src._private.edges.push(edge);\n      } else {\n        src._private.edges.push(edge);\n        tgt._private.edges.push(edge);\n      }\n      edge._private.source = src;\n      edge._private.target = tgt;\n    } // if is edge\n\n    // create mock ids / indexes maps for element so it can be used like collections\n    _private.map = new Map$1();\n    _private.map.set(id, {\n      ele: _ele2,\n      index: 0\n    });\n    _private.removed = false;\n    if (addToPool) {\n      cy.addToPool(_ele2);\n    }\n  } // for each element\n\n  // do compound node sanity checks\n  for (var _i4 = 0; _i4 < nodes.length; _i4++) {\n    // each node\n    var node = nodes[_i4];\n    var _data4 = node._private.data;\n    if (number$1(_data4.parent)) {\n      // then automake string\n      _data4.parent = '' + _data4.parent;\n    }\n    var parentId = _data4.parent;\n    var specifiedParent = parentId != null;\n    if (specifiedParent || node._private.parent) {\n      var parent = node._private.parent ? cy.collection().merge(node._private.parent) : cy.getElementById(parentId);\n      if (parent.empty()) {\n        // non-existant parent; just remove it\n        _data4.parent = undefined;\n      } else if (parent[0].removed()) {\n        warn('Node added with missing parent, reference to parent removed');\n        _data4.parent = undefined;\n        node._private.parent = null;\n      } else {\n        var selfAsParent = false;\n        var ancestor = parent;\n        while (!ancestor.empty()) {\n          if (node.same(ancestor)) {\n            // mark self as parent and remove from data\n            selfAsParent = true;\n            _data4.parent = undefined; // remove parent reference\n\n            // exit or we loop forever\n            break;\n          }\n          ancestor = ancestor.parent();\n        }\n        if (!selfAsParent) {\n          // connect with children\n          parent[0]._private.children.push(node);\n          node._private.parent = parent[0];\n\n          // let the core know we have a compound graph\n          cy_p.hasCompoundNodes = true;\n        }\n      } // else\n    } // if specified parent\n  } // for each node\n\n  if (elements.length > 0) {\n    var restored = elements.length === self.length ? self : new Collection(cy, elements);\n    for (var _i5 = 0; _i5 < restored.length; _i5++) {\n      var _ele3 = restored[_i5];\n      if (_ele3.isNode()) {\n        continue;\n      }\n\n      // adding an edge invalidates the traversal caches for the parallel edges\n      _ele3.parallelEdges().clearTraversalCache();\n\n      // adding an edge invalidates the traversal cache for the connected nodes\n      _ele3.source().clearTraversalCache();\n      _ele3.target().clearTraversalCache();\n    }\n    var toUpdateStyle;\n    if (cy_p.hasCompoundNodes) {\n      toUpdateStyle = cy.collection().merge(restored).merge(restored.connectedNodes()).merge(restored.parent());\n    } else {\n      toUpdateStyle = restored;\n    }\n    toUpdateStyle.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(notifyRenderer);\n    if (notifyRenderer) {\n      restored.emitAndNotify('add');\n    } else if (addToPool) {\n      restored.emit('add');\n    }\n  }\n  return self; // chainability\n};\nelesfn$1.removed = function () {\n  var ele = this[0];\n  return ele && ele._private.removed;\n};\nelesfn$1.inside = function () {\n  var ele = this[0];\n  return ele && !ele._private.removed;\n};\nelesfn$1.remove = function () {\n  var notifyRenderer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n  var removeFromPool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n  var self = this;\n  var elesToRemove = [];\n  var elesToRemoveIds = {};\n  var cy = self._private.cy;\n\n  // add connected edges\n  function addConnectedEdges(node) {\n    var edges = node._private.edges;\n    for (var i = 0; i < edges.length; i++) {\n      add(edges[i]);\n    }\n  }\n\n  // add descendant nodes\n  function addChildren(node) {\n    var children = node._private.children;\n    for (var i = 0; i < children.length; i++) {\n      add(children[i]);\n    }\n  }\n  function add(ele) {\n    var alreadyAdded = elesToRemoveIds[ele.id()];\n    if (removeFromPool && ele.removed() || alreadyAdded) {\n      return;\n    } else {\n      elesToRemoveIds[ele.id()] = true;\n    }\n    if (ele.isNode()) {\n      elesToRemove.push(ele); // nodes are removed last\n\n      addConnectedEdges(ele);\n      addChildren(ele);\n    } else {\n      elesToRemove.unshift(ele); // edges are removed first\n    }\n  }\n\n  // make the list of elements to remove\n  // (may be removing more than specified due to connected edges etc)\n\n  for (var i = 0, l = self.length; i < l; i++) {\n    var ele = self[i];\n    add(ele);\n  }\n  function removeEdgeRef(node, edge) {\n    var connectedEdges = node._private.edges;\n    removeFromArray(connectedEdges, edge);\n\n    // removing an edges invalidates the traversal cache for its nodes\n    node.clearTraversalCache();\n  }\n  function removeParallelRef(pllEdge) {\n    // removing an edge invalidates the traversal caches for the parallel edges\n    pllEdge.clearTraversalCache();\n  }\n  var alteredParents = [];\n  alteredParents.ids = {};\n  function removeChildRef(parent, ele) {\n    ele = ele[0];\n    parent = parent[0];\n    var children = parent._private.children;\n    var pid = parent.id();\n    removeFromArray(children, ele); // remove parent => child ref\n\n    ele._private.parent = null; // remove child => parent ref\n\n    if (!alteredParents.ids[pid]) {\n      alteredParents.ids[pid] = true;\n      alteredParents.push(parent);\n    }\n  }\n  self.dirtyCompoundBoundsCache();\n  if (removeFromPool) {\n    cy.removeFromPool(elesToRemove); // remove from core pool\n  }\n  for (var _i6 = 0; _i6 < elesToRemove.length; _i6++) {\n    var _ele4 = elesToRemove[_i6];\n    if (_ele4.isEdge()) {\n      // remove references to this edge in its connected nodes\n      var src = _ele4.source()[0];\n      var tgt = _ele4.target()[0];\n      removeEdgeRef(src, _ele4);\n      removeEdgeRef(tgt, _ele4);\n      var pllEdges = _ele4.parallelEdges();\n      for (var j = 0; j < pllEdges.length; j++) {\n        var pllEdge = pllEdges[j];\n        removeParallelRef(pllEdge);\n        if (pllEdge.isBundledBezier()) {\n          pllEdge.dirtyBoundingBoxCache();\n        }\n      }\n    } else {\n      // remove reference to parent\n      var parent = _ele4.parent();\n      if (parent.length !== 0) {\n        removeChildRef(parent, _ele4);\n      }\n    }\n    if (removeFromPool) {\n      // mark as removed\n      _ele4._private.removed = true;\n    }\n  }\n\n  // check to see if we have a compound graph or not\n  var elesStillInside = cy._private.elements;\n  cy._private.hasCompoundNodes = false;\n  for (var _i7 = 0; _i7 < elesStillInside.length; _i7++) {\n    var _ele5 = elesStillInside[_i7];\n    if (_ele5.isParent()) {\n      cy._private.hasCompoundNodes = true;\n      break;\n    }\n  }\n  var removedElements = new Collection(this.cy(), elesToRemove);\n  if (removedElements.size() > 0) {\n    // must manually notify since trigger won't do this automatically once removed\n\n    if (notifyRenderer) {\n      removedElements.emitAndNotify('remove');\n    } else if (removeFromPool) {\n      removedElements.emit('remove');\n    }\n  }\n\n  // the parents who were modified by the removal need their style updated\n  for (var _i8 = 0; _i8 < alteredParents.length; _i8++) {\n    var _ele6 = alteredParents[_i8];\n    if (!removeFromPool || !_ele6.removed()) {\n      _ele6.updateStyle();\n    }\n  }\n  return removedElements;\n};\nelesfn$1.move = function (struct) {\n  var cy = this._private.cy;\n  var eles = this;\n\n  // just clean up refs, caches, etc. in the same way as when removing and then restoring\n  // (our calls to remove/restore do not remove from the graph or make events)\n  var notifyRenderer = false;\n  var modifyPool = false;\n  var toString = function toString(id) {\n    return id == null ? id : '' + id;\n  }; // id must be string\n\n  if (struct.source !== undefined || struct.target !== undefined) {\n    var srcId = toString(struct.source);\n    var tgtId = toString(struct.target);\n    var srcExists = srcId != null && cy.hasElementWithId(srcId);\n    var tgtExists = tgtId != null && cy.hasElementWithId(tgtId);\n    if (srcExists || tgtExists) {\n      cy.batch(function () {\n        // avoid duplicate style updates\n        eles.remove(notifyRenderer, modifyPool); // clean up refs etc.\n        eles.emitAndNotify('moveout');\n        for (var i = 0; i < eles.length; i++) {\n          var ele = eles[i];\n          var _data5 = ele._private.data;\n          if (ele.isEdge()) {\n            if (srcExists) {\n              _data5.source = srcId;\n            }\n            if (tgtExists) {\n              _data5.target = tgtId;\n            }\n          }\n        }\n        eles.restore(notifyRenderer, modifyPool); // make new refs, style, etc.\n      });\n      eles.emitAndNotify('move');\n    }\n  } else if (struct.parent !== undefined) {\n    // move node to new parent\n    var parentId = toString(struct.parent);\n    var parentExists = parentId === null || cy.hasElementWithId(parentId);\n    if (parentExists) {\n      var pidToAssign = parentId === null ? undefined : parentId;\n      cy.batch(function () {\n        // avoid duplicate style updates\n        var updated = eles.remove(notifyRenderer, modifyPool); // clean up refs etc.\n        updated.emitAndNotify('moveout');\n        for (var i = 0; i < eles.length; i++) {\n          var ele = eles[i];\n          var _data6 = ele._private.data;\n          if (ele.isNode()) {\n            _data6.parent = pidToAssign;\n          }\n        }\n        updated.restore(notifyRenderer, modifyPool); // make new refs, style, etc.\n      });\n      eles.emitAndNotify('move');\n    }\n  }\n  return this;\n};\n[elesfn$j, elesfn$i, elesfn$h, elesfn$g, elesfn$f, data, elesfn$d, dimensions, elesfn$9, elesfn$8, elesfn$7, elesfn$6, elesfn$5, elesfn$4, elesfn$3, elesfn$2].forEach(function (props) {\n  extend(elesfn$1, props);\n});\n\nvar corefn$9 = {\n  add: function add(opts) {\n    var elements;\n    var cy = this;\n\n    // add the elements\n    if (elementOrCollection(opts)) {\n      var eles = opts;\n      if (eles._private.cy === cy) {\n        // same instance => just restore\n        elements = eles.restore();\n      } else {\n        // otherwise, copy from json\n        var jsons = [];\n        for (var i = 0; i < eles.length; i++) {\n          var ele = eles[i];\n          jsons.push(ele.json());\n        }\n        elements = new Collection(cy, jsons);\n      }\n    }\n\n    // specify an array of options\n    else if (array(opts)) {\n      var _jsons = opts;\n      elements = new Collection(cy, _jsons);\n    }\n\n    // specify via opts.nodes and opts.edges\n    else if (plainObject(opts) && (array(opts.nodes) || array(opts.edges))) {\n      var elesByGroup = opts;\n      var _jsons2 = [];\n      var grs = ['nodes', 'edges'];\n      for (var _i = 0, il = grs.length; _i < il; _i++) {\n        var group = grs[_i];\n        var elesArray = elesByGroup[group];\n        if (array(elesArray)) {\n          for (var j = 0, jl = elesArray.length; j < jl; j++) {\n            var json = extend({\n              group: group\n            }, elesArray[j]);\n            _jsons2.push(json);\n          }\n        }\n      }\n      elements = new Collection(cy, _jsons2);\n    }\n\n    // specify options for one element\n    else {\n      var _json = opts;\n      elements = new Element(cy, _json).collection();\n    }\n    return elements;\n  },\n  remove: function remove(collection) {\n    if (elementOrCollection(collection)) ; else if (string(collection)) {\n      var selector = collection;\n      collection = this.$(selector);\n    }\n    return collection.remove();\n  }\n};\n\n/* global Float32Array */\n\n/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */\nfunction generateCubicBezier(mX1, mY1, mX2, mY2) {\n  var NEWTON_ITERATIONS = 4,\n    NEWTON_MIN_SLOPE = 0.001,\n    SUBDIVISION_PRECISION = 0.0000001,\n    SUBDIVISION_MAX_ITERATIONS = 10,\n    kSplineTableSize = 11,\n    kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n    float32ArraySupported = typeof Float32Array !== 'undefined';\n\n  /* Must contain four arguments. */\n  if (arguments.length !== 4) {\n    return false;\n  }\n\n  /* Arguments must be numbers. */\n  for (var i = 0; i < 4; ++i) {\n    if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n      return false;\n    }\n  }\n\n  /* X values must be in the [0, 1] range. */\n  mX1 = Math.min(mX1, 1);\n  mX2 = Math.min(mX2, 1);\n  mX1 = Math.max(mX1, 0);\n  mX2 = Math.max(mX2, 0);\n  var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n  function A(aA1, aA2) {\n    return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n  }\n  function B(aA1, aA2) {\n    return 3.0 * aA2 - 6.0 * aA1;\n  }\n  function C(aA1) {\n    return 3.0 * aA1;\n  }\n  function calcBezier(aT, aA1, aA2) {\n    return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n  }\n  function getSlope(aT, aA1, aA2) {\n    return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n  }\n  function newtonRaphsonIterate(aX, aGuessT) {\n    for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) {\n      var currentSlope = getSlope(aGuessT, mX1, mX2);\n      if (currentSlope === 0.0) {\n        return aGuessT;\n      }\n      var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n      aGuessT -= currentX / currentSlope;\n    }\n    return aGuessT;\n  }\n  function calcSampleValues() {\n    for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) {\n      mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2);\n    }\n  }\n  function binarySubdivide(aX, aA, aB) {\n    var currentX,\n      currentT,\n      i = 0;\n    do {\n      currentT = aA + (aB - aA) / 2.0;\n      currentX = calcBezier(currentT, mX1, mX2) - aX;\n      if (currentX > 0.0) {\n        aB = currentT;\n      } else {\n        aA = currentT;\n      }\n    } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n    return currentT;\n  }\n  function getTForX(aX) {\n    var intervalStart = 0.0,\n      currentSample = 1,\n      lastSample = kSplineTableSize - 1;\n    for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n      intervalStart += kSampleStepSize;\n    }\n    --currentSample;\n    var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n      guessForT = intervalStart + dist * kSampleStepSize,\n      initialSlope = getSlope(guessForT, mX1, mX2);\n    if (initialSlope >= NEWTON_MIN_SLOPE) {\n      return newtonRaphsonIterate(aX, guessForT);\n    } else if (initialSlope === 0.0) {\n      return guessForT;\n    } else {\n      return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n    }\n  }\n  var _precomputed = false;\n  function precompute() {\n    _precomputed = true;\n    if (mX1 !== mY1 || mX2 !== mY2) {\n      calcSampleValues();\n    }\n  }\n  var f = function f(aX) {\n    if (!_precomputed) {\n      precompute();\n    }\n    if (mX1 === mY1 && mX2 === mY2) {\n      return aX;\n    }\n    if (aX === 0) {\n      return 0;\n    }\n    if (aX === 1) {\n      return 1;\n    }\n    return calcBezier(getTForX(aX), mY1, mY2);\n  };\n  f.getControlPoints = function () {\n    return [{\n      x: mX1,\n      y: mY1\n    }, {\n      x: mX2,\n      y: mY2\n    }];\n  };\n  var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n  f.toString = function () {\n    return str;\n  };\n  return f;\n}\n\n/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */\n/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass\n   then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */\nvar generateSpringRK4 = function () {\n  function springAccelerationForState(state) {\n    return -state.tension * state.x - state.friction * state.v;\n  }\n  function springEvaluateStateWithDerivative(initialState, dt, derivative) {\n    var state = {\n      x: initialState.x + derivative.dx * dt,\n      v: initialState.v + derivative.dv * dt,\n      tension: initialState.tension,\n      friction: initialState.friction\n    };\n    return {\n      dx: state.v,\n      dv: springAccelerationForState(state)\n    };\n  }\n  function springIntegrateState(state, dt) {\n    var a = {\n        dx: state.v,\n        dv: springAccelerationForState(state)\n      },\n      b = springEvaluateStateWithDerivative(state, dt * 0.5, a),\n      c = springEvaluateStateWithDerivative(state, dt * 0.5, b),\n      d = springEvaluateStateWithDerivative(state, dt, c),\n      dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx),\n      dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv);\n    state.x = state.x + dxdt * dt;\n    state.v = state.v + dvdt * dt;\n    return state;\n  }\n  return function springRK4Factory(tension, friction, duration) {\n    var initState = {\n        x: -1,\n        v: 0,\n        tension: null,\n        friction: null\n      },\n      path = [0],\n      time_lapsed = 0,\n      tolerance = 1 / 10000,\n      DT = 16 / 1000,\n      have_duration,\n      dt,\n      last_state;\n    tension = parseFloat(tension) || 500;\n    friction = parseFloat(friction) || 20;\n    duration = duration || null;\n    initState.tension = tension;\n    initState.friction = friction;\n    have_duration = duration !== null;\n\n    /* Calculate the actual time it takes for this animation to complete with the provided conditions. */\n    if (have_duration) {\n      /* Run the simulation without a duration. */\n      time_lapsed = springRK4Factory(tension, friction);\n      /* Compute the adjusted time delta. */\n      dt = time_lapsed / duration * DT;\n    } else {\n      dt = DT;\n    }\n    for (;;) {\n      /* Next/step function .*/\n      last_state = springIntegrateState(last_state || initState, dt);\n      /* Store the position. */\n      path.push(1 + last_state.x);\n      time_lapsed += 16;\n      /* If the change threshold is reached, break. */\n      if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) {\n        break;\n      }\n    }\n\n    /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the\n       computed path and returns a snapshot of the position according to a given percentComplete. */\n    return !have_duration ? time_lapsed : function (percentComplete) {\n      return path[percentComplete * (path.length - 1) | 0];\n    };\n  };\n}();\n\nvar cubicBezier = function cubicBezier(t1, p1, t2, p2) {\n  var bezier = generateCubicBezier(t1, p1, t2, p2);\n  return function (start, end, percent) {\n    return start + (end - start) * bezier(percent);\n  };\n};\nvar easings = {\n  'linear': function linear(start, end, percent) {\n    return start + (end - start) * percent;\n  },\n  // default easings\n  'ease': cubicBezier(0.25, 0.1, 0.25, 1),\n  'ease-in': cubicBezier(0.42, 0, 1, 1),\n  'ease-out': cubicBezier(0, 0, 0.58, 1),\n  'ease-in-out': cubicBezier(0.42, 0, 0.58, 1),\n  // sine\n  'ease-in-sine': cubicBezier(0.47, 0, 0.745, 0.715),\n  'ease-out-sine': cubicBezier(0.39, 0.575, 0.565, 1),\n  'ease-in-out-sine': cubicBezier(0.445, 0.05, 0.55, 0.95),\n  // quad\n  'ease-in-quad': cubicBezier(0.55, 0.085, 0.68, 0.53),\n  'ease-out-quad': cubicBezier(0.25, 0.46, 0.45, 0.94),\n  'ease-in-out-quad': cubicBezier(0.455, 0.03, 0.515, 0.955),\n  // cubic\n  'ease-in-cubic': cubicBezier(0.55, 0.055, 0.675, 0.19),\n  'ease-out-cubic': cubicBezier(0.215, 0.61, 0.355, 1),\n  'ease-in-out-cubic': cubicBezier(0.645, 0.045, 0.355, 1),\n  // quart\n  'ease-in-quart': cubicBezier(0.895, 0.03, 0.685, 0.22),\n  'ease-out-quart': cubicBezier(0.165, 0.84, 0.44, 1),\n  'ease-in-out-quart': cubicBezier(0.77, 0, 0.175, 1),\n  // quint\n  'ease-in-quint': cubicBezier(0.755, 0.05, 0.855, 0.06),\n  'ease-out-quint': cubicBezier(0.23, 1, 0.32, 1),\n  'ease-in-out-quint': cubicBezier(0.86, 0, 0.07, 1),\n  // expo\n  'ease-in-expo': cubicBezier(0.95, 0.05, 0.795, 0.035),\n  'ease-out-expo': cubicBezier(0.19, 1, 0.22, 1),\n  'ease-in-out-expo': cubicBezier(1, 0, 0, 1),\n  // circ\n  'ease-in-circ': cubicBezier(0.6, 0.04, 0.98, 0.335),\n  'ease-out-circ': cubicBezier(0.075, 0.82, 0.165, 1),\n  'ease-in-out-circ': cubicBezier(0.785, 0.135, 0.15, 0.86),\n  // user param easings...\n\n  'spring': function spring(tension, friction, duration) {\n    if (duration === 0) {\n      // can't get a spring w/ duration 0\n      return easings.linear; // duration 0 => jump to end so impl doesn't matter\n    }\n    var spring = generateSpringRK4(tension, friction, duration);\n    return function (start, end, percent) {\n      return start + (end - start) * spring(percent);\n    };\n  },\n  'cubic-bezier': cubicBezier\n};\n\nfunction getEasedValue(type, start, end, percent, easingFn) {\n  if (percent === 1) {\n    return end;\n  }\n  if (start === end) {\n    return end;\n  }\n  var val = easingFn(start, end, percent);\n  if (type == null) {\n    return val;\n  }\n  if (type.roundValue || type.color) {\n    val = Math.round(val);\n  }\n  if (type.min !== undefined) {\n    val = Math.max(val, type.min);\n  }\n  if (type.max !== undefined) {\n    val = Math.min(val, type.max);\n  }\n  return val;\n}\nfunction getValue(prop, spec) {\n  if (prop.pfValue != null || prop.value != null) {\n    if (prop.pfValue != null && (spec == null || spec.type.units !== '%')) {\n      return prop.pfValue;\n    } else {\n      return prop.value;\n    }\n  } else {\n    return prop;\n  }\n}\nfunction ease(startProp, endProp, percent, easingFn, propSpec) {\n  var type = propSpec != null ? propSpec.type : null;\n  if (percent < 0) {\n    percent = 0;\n  } else if (percent > 1) {\n    percent = 1;\n  }\n  var start = getValue(startProp, propSpec);\n  var end = getValue(endProp, propSpec);\n  if (number$1(start) && number$1(end)) {\n    return getEasedValue(type, start, end, percent, easingFn);\n  } else if (array(start) && array(end)) {\n    var easedArr = [];\n    for (var i = 0; i < end.length; i++) {\n      var si = start[i];\n      var ei = end[i];\n      if (si != null && ei != null) {\n        var val = getEasedValue(type, si, ei, percent, easingFn);\n        easedArr.push(val);\n      } else {\n        easedArr.push(ei);\n      }\n    }\n    return easedArr;\n  }\n  return undefined;\n}\n\nfunction step$1(self, ani, now, isCore) {\n  var isEles = !isCore;\n  var _p = self._private;\n  var ani_p = ani._private;\n  var pEasing = ani_p.easing;\n  var startTime = ani_p.startTime;\n  var cy = isCore ? self : self.cy();\n  var style = cy.style();\n  if (!ani_p.easingImpl) {\n    if (pEasing == null) {\n      // use default\n      ani_p.easingImpl = easings['linear'];\n    } else {\n      // then define w/ name\n      var easingVals;\n      if (string(pEasing)) {\n        var easingProp = style.parse('transition-timing-function', pEasing);\n        easingVals = easingProp.value;\n      } else {\n        // then assume preparsed array\n        easingVals = pEasing;\n      }\n      var name, args;\n      if (string(easingVals)) {\n        name = easingVals;\n        args = [];\n      } else {\n        name = easingVals[1];\n        args = easingVals.slice(2).map(function (n) {\n          return +n;\n        });\n      }\n      if (args.length > 0) {\n        // create with args\n        if (name === 'spring') {\n          args.push(ani_p.duration); // need duration to generate spring\n        }\n        ani_p.easingImpl = easings[name].apply(null, args);\n      } else {\n        // static impl by name\n        ani_p.easingImpl = easings[name];\n      }\n    }\n  }\n  var easing = ani_p.easingImpl;\n  var percent;\n  if (ani_p.duration === 0) {\n    percent = 1;\n  } else {\n    percent = (now - startTime) / ani_p.duration;\n  }\n  if (ani_p.applying) {\n    percent = ani_p.progress;\n  }\n  if (percent < 0) {\n    percent = 0;\n  } else if (percent > 1) {\n    percent = 1;\n  }\n  if (ani_p.delay == null) {\n    // then update\n\n    var startPos = ani_p.startPosition;\n    var endPos = ani_p.position;\n    if (endPos && isEles && !self.locked()) {\n      var newPos = {};\n      if (valid(startPos.x, endPos.x)) {\n        newPos.x = ease(startPos.x, endPos.x, percent, easing);\n      }\n      if (valid(startPos.y, endPos.y)) {\n        newPos.y = ease(startPos.y, endPos.y, percent, easing);\n      }\n      self.position(newPos);\n    }\n    var startPan = ani_p.startPan;\n    var endPan = ani_p.pan;\n    var pan = _p.pan;\n    var animatingPan = endPan != null && isCore;\n    if (animatingPan) {\n      if (valid(startPan.x, endPan.x)) {\n        pan.x = ease(startPan.x, endPan.x, percent, easing);\n      }\n      if (valid(startPan.y, endPan.y)) {\n        pan.y = ease(startPan.y, endPan.y, percent, easing);\n      }\n      self.emit('pan');\n    }\n    var startZoom = ani_p.startZoom;\n    var endZoom = ani_p.zoom;\n    var animatingZoom = endZoom != null && isCore;\n    if (animatingZoom) {\n      if (valid(startZoom, endZoom)) {\n        _p.zoom = bound(_p.minZoom, ease(startZoom, endZoom, percent, easing), _p.maxZoom);\n      }\n      self.emit('zoom');\n    }\n    if (animatingPan || animatingZoom) {\n      self.emit('viewport');\n    }\n    var props = ani_p.style;\n    if (props && props.length > 0 && isEles) {\n      for (var i = 0; i < props.length; i++) {\n        var prop = props[i];\n        var _name = prop.name;\n        var end = prop;\n        var start = ani_p.startStyle[_name];\n        var propSpec = style.properties[start.name];\n        var easedVal = ease(start, end, percent, easing, propSpec);\n        style.overrideBypass(self, _name, easedVal);\n      } // for props\n\n      self.emit('style');\n    } // if\n  }\n  ani_p.progress = percent;\n  return percent;\n}\nfunction valid(start, end) {\n  if (start == null || end == null) {\n    return false;\n  }\n  if (number$1(start) && number$1(end)) {\n    return true;\n  } else if (start && end) {\n    return true;\n  }\n  return false;\n}\n\nfunction startAnimation(self, ani, now, isCore) {\n  var ani_p = ani._private;\n  ani_p.started = true;\n  ani_p.startTime = now - ani_p.progress * ani_p.duration;\n}\n\nfunction stepAll(now, cy) {\n  var eles = cy._private.aniEles;\n  var doneEles = [];\n  function stepOne(ele, isCore) {\n    var _p = ele._private;\n    var current = _p.animation.current;\n    var queue = _p.animation.queue;\n    var ranAnis = false;\n\n    // if nothing currently animating, get something from the queue\n    if (current.length === 0) {\n      var next = queue.shift();\n      if (next) {\n        current.push(next);\n      }\n    }\n    var callbacks = function callbacks(_callbacks) {\n      for (var j = _callbacks.length - 1; j >= 0; j--) {\n        var cb = _callbacks[j];\n        cb();\n      }\n      _callbacks.splice(0, _callbacks.length);\n    };\n\n    // step and remove if done\n    for (var i = current.length - 1; i >= 0; i--) {\n      var ani = current[i];\n      var ani_p = ani._private;\n      if (ani_p.stopped) {\n        current.splice(i, 1);\n        ani_p.hooked = false;\n        ani_p.playing = false;\n        ani_p.started = false;\n        callbacks(ani_p.frames);\n        continue;\n      }\n      if (!ani_p.playing && !ani_p.applying) {\n        continue;\n      }\n\n      // an apply() while playing shouldn't do anything\n      if (ani_p.playing && ani_p.applying) {\n        ani_p.applying = false;\n      }\n      if (!ani_p.started) {\n        startAnimation(ele, ani, now);\n      }\n      step$1(ele, ani, now, isCore);\n      if (ani_p.applying) {\n        ani_p.applying = false;\n      }\n      callbacks(ani_p.frames);\n      if (ani_p.step != null) {\n        ani_p.step(now);\n      }\n      if (ani.completed()) {\n        current.splice(i, 1);\n        ani_p.hooked = false;\n        ani_p.playing = false;\n        ani_p.started = false;\n        callbacks(ani_p.completes);\n      }\n      ranAnis = true;\n    }\n    if (!isCore && current.length === 0 && queue.length === 0) {\n      doneEles.push(ele);\n    }\n    return ranAnis;\n  } // stepElement\n\n  // handle all eles\n  var ranEleAni = false;\n  for (var e = 0; e < eles.length; e++) {\n    var ele = eles[e];\n    var handledThisEle = stepOne(ele);\n    ranEleAni = ranEleAni || handledThisEle;\n  } // each element\n\n  var ranCoreAni = stepOne(cy, true);\n\n  // notify renderer\n  if (ranEleAni || ranCoreAni) {\n    if (eles.length > 0) {\n      cy.notify('draw', eles);\n    } else {\n      cy.notify('draw');\n    }\n  }\n\n  // remove elements from list of currently animating if its queues are empty\n  eles.unmerge(doneEles);\n  cy.emit('step');\n} // stepAll\n\nvar corefn$8 = {\n  // pull in animation functions\n  animate: define.animate(),\n  animation: define.animation(),\n  animated: define.animated(),\n  clearQueue: define.clearQueue(),\n  delay: define.delay(),\n  delayAnimation: define.delayAnimation(),\n  stop: define.stop(),\n  addToAnimationPool: function addToAnimationPool(eles) {\n    var cy = this;\n    if (!cy.styleEnabled()) {\n      return;\n    } // save cycles when no style used\n\n    cy._private.aniEles.merge(eles);\n  },\n  stopAnimationLoop: function stopAnimationLoop() {\n    this._private.animationsRunning = false;\n  },\n  startAnimationLoop: function startAnimationLoop() {\n    var cy = this;\n    cy._private.animationsRunning = true;\n    if (!cy.styleEnabled()) {\n      return;\n    } // save cycles when no style used\n\n    // NB the animation loop will exec in headless environments if style enabled\n    // and explicit cy.destroy() is necessary to stop the loop\n\n    function headlessStep() {\n      if (!cy._private.animationsRunning) {\n        return;\n      }\n      requestAnimationFrame(function animationStep(now) {\n        stepAll(now, cy);\n        headlessStep();\n      });\n    }\n    var renderer = cy.renderer();\n    if (renderer && renderer.beforeRender) {\n      // let the renderer schedule animations\n      renderer.beforeRender(function rendererAnimationStep(willDraw, now) {\n        stepAll(now, cy);\n      }, renderer.beforeRenderPriorities.animations);\n    } else {\n      // manage the animation loop ourselves\n      headlessStep(); // first call\n    }\n  }\n};\n\nvar emitterOptions = {\n  qualifierCompare: function qualifierCompare(selector1, selector2) {\n    if (selector1 == null || selector2 == null) {\n      return selector1 == null && selector2 == null;\n    } else {\n      return selector1.sameText(selector2);\n    }\n  },\n  eventMatches: function eventMatches(cy, listener, eventObj) {\n    var selector = listener.qualifier;\n    if (selector != null) {\n      return cy !== eventObj.target && element(eventObj.target) && selector.matches(eventObj.target);\n    }\n    return true;\n  },\n  addEventFields: function addEventFields(cy, evt) {\n    evt.cy = cy;\n    evt.target = cy;\n  },\n  callbackContext: function callbackContext(cy, listener, eventObj) {\n    return listener.qualifier != null ? eventObj.target : cy;\n  }\n};\nvar argSelector = function argSelector(arg) {\n  if (string(arg)) {\n    return new Selector(arg);\n  } else {\n    return arg;\n  }\n};\nvar elesfn = {\n  createEmitter: function createEmitter() {\n    var _p = this._private;\n    if (!_p.emitter) {\n      _p.emitter = new Emitter(emitterOptions, this);\n    }\n    return this;\n  },\n  emitter: function emitter() {\n    return this._private.emitter;\n  },\n  on: function on(events, selector, callback) {\n    this.emitter().on(events, argSelector(selector), callback);\n    return this;\n  },\n  removeListener: function removeListener(events, selector, callback) {\n    this.emitter().removeListener(events, argSelector(selector), callback);\n    return this;\n  },\n  removeAllListeners: function removeAllListeners() {\n    this.emitter().removeAllListeners();\n    return this;\n  },\n  one: function one(events, selector, callback) {\n    this.emitter().one(events, argSelector(selector), callback);\n    return this;\n  },\n  once: function once(events, selector, callback) {\n    this.emitter().one(events, argSelector(selector), callback);\n    return this;\n  },\n  emit: function emit(events, extraParams) {\n    this.emitter().emit(events, extraParams);\n    return this;\n  },\n  emitAndNotify: function emitAndNotify(event, eles) {\n    this.emit(event);\n    this.notify(event, eles);\n    return this;\n  }\n};\ndefine.eventAliasesOn(elesfn);\n\nvar corefn$7 = {\n  png: function png(options) {\n    var renderer = this._private.renderer;\n    options = options || {};\n    return renderer.png(options);\n  },\n  jpg: function jpg(options) {\n    var renderer = this._private.renderer;\n    options = options || {};\n    options.bg = options.bg || '#fff';\n    return renderer.jpg(options);\n  }\n};\ncorefn$7.jpeg = corefn$7.jpg;\n\nvar corefn$6 = {\n  layout: function layout(options) {\n    var cy = this;\n    if (options == null) {\n      error('Layout options must be specified to make a layout');\n      return;\n    }\n    if (options.name == null) {\n      error('A `name` must be specified to make a layout');\n      return;\n    }\n    var name = options.name;\n    var Layout = cy.extension('layout', name);\n    if (Layout == null) {\n      error('No such layout `' + name + '` found.  Did you forget to import it and `cytoscape.use()` it?');\n      return;\n    }\n    var eles;\n    if (string(options.eles)) {\n      eles = cy.$(options.eles);\n    } else {\n      eles = options.eles != null ? options.eles : cy.$();\n    }\n    var layout = new Layout(extend({}, options, {\n      cy: cy,\n      eles: eles\n    }));\n    return layout;\n  }\n};\ncorefn$6.createLayout = corefn$6.makeLayout = corefn$6.layout;\n\nvar corefn$5 = {\n  notify: function notify(eventName, eventEles) {\n    var _p = this._private;\n    if (this.batching()) {\n      _p.batchNotifications = _p.batchNotifications || {};\n      var eles = _p.batchNotifications[eventName] = _p.batchNotifications[eventName] || this.collection();\n      if (eventEles != null) {\n        eles.merge(eventEles);\n      }\n      return; // notifications are disabled during batching\n    }\n    if (!_p.notificationsEnabled) {\n      return;\n    } // exit on disabled\n\n    var renderer = this.renderer();\n\n    // exit if destroy() called on core or renderer in between frames #1499 #1528\n    if (this.destroyed() || !renderer) {\n      return;\n    }\n    renderer.notify(eventName, eventEles);\n  },\n  notifications: function notifications(bool) {\n    var p = this._private;\n    if (bool === undefined) {\n      return p.notificationsEnabled;\n    } else {\n      p.notificationsEnabled = bool ? true : false;\n    }\n    return this;\n  },\n  noNotifications: function noNotifications(callback) {\n    this.notifications(false);\n    callback();\n    this.notifications(true);\n  },\n  batching: function batching() {\n    return this._private.batchCount > 0;\n  },\n  startBatch: function startBatch() {\n    var _p = this._private;\n    if (_p.batchCount == null) {\n      _p.batchCount = 0;\n    }\n    if (_p.batchCount === 0) {\n      _p.batchStyleEles = this.collection();\n      _p.batchNotifications = {};\n    }\n    _p.batchCount++;\n    return this;\n  },\n  endBatch: function endBatch() {\n    var _p = this._private;\n    if (_p.batchCount === 0) {\n      return this;\n    }\n    _p.batchCount--;\n    if (_p.batchCount === 0) {\n      // update style for dirty eles\n      _p.batchStyleEles.updateStyle();\n      var renderer = this.renderer();\n\n      // notify the renderer of queued eles and event types\n      Object.keys(_p.batchNotifications).forEach(function (eventName) {\n        var eles = _p.batchNotifications[eventName];\n        if (eles.empty()) {\n          renderer.notify(eventName);\n        } else {\n          renderer.notify(eventName, eles);\n        }\n      });\n    }\n    return this;\n  },\n  batch: function batch(callback) {\n    this.startBatch();\n    callback();\n    this.endBatch();\n    return this;\n  },\n  // for backwards compatibility\n  batchData: function batchData(map) {\n    var cy = this;\n    return this.batch(function () {\n      var ids = Object.keys(map);\n      for (var i = 0; i < ids.length; i++) {\n        var id = ids[i];\n        var data = map[id];\n        var ele = cy.getElementById(id);\n        ele.data(data);\n      }\n    });\n  }\n};\n\nvar rendererDefaults = defaults$g({\n  hideEdgesOnViewport: false,\n  textureOnViewport: false,\n  motionBlur: false,\n  motionBlurOpacity: 0.05,\n  pixelRatio: undefined,\n  desktopTapThreshold: 4,\n  touchTapThreshold: 8,\n  wheelSensitivity: 1,\n  debug: false,\n  showFps: false,\n  // webgl options\n  webgl: false,\n  webglDebug: false,\n  webglDebugShowAtlases: false,\n  // defaults good for mobile\n  webglTexSize: 2048,\n  webglTexRows: 36,\n  webglTexRowsNodes: 18,\n  webglBatchSize: 2048,\n  webglTexPerBatch: 14,\n  webglBgColor: [255, 255, 255]\n});\nvar corefn$4 = {\n  renderTo: function renderTo(context, zoom, pan, pxRatio) {\n    var r = this._private.renderer;\n    r.renderTo(context, zoom, pan, pxRatio);\n    return this;\n  },\n  renderer: function renderer() {\n    return this._private.renderer;\n  },\n  forceRender: function forceRender() {\n    this.notify('draw');\n    return this;\n  },\n  resize: function resize() {\n    this.invalidateSize();\n    this.emitAndNotify('resize');\n    return this;\n  },\n  initRenderer: function initRenderer(options) {\n    var cy = this;\n    var RendererProto = cy.extension('renderer', options.name);\n    if (RendererProto == null) {\n      error(\"Can not initialise: No such renderer `\".concat(options.name, \"` found. Did you forget to import it and `cytoscape.use()` it?\"));\n      return;\n    }\n    if (options.wheelSensitivity !== undefined) {\n      warn(\"You have set a custom wheel sensitivity.  This will make your app zoom unnaturally when using mainstream mice.  You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.\");\n    }\n    var rOpts = rendererDefaults(options);\n    rOpts.cy = cy;\n    cy._private.renderer = new RendererProto(rOpts);\n    this.notify('init');\n  },\n  destroyRenderer: function destroyRenderer() {\n    var cy = this;\n    cy.notify('destroy'); // destroy the renderer\n\n    var domEle = cy.container();\n    if (domEle) {\n      domEle._cyreg = null;\n      while (domEle.childNodes.length > 0) {\n        domEle.removeChild(domEle.childNodes[0]);\n      }\n    }\n    cy._private.renderer = null; // to be extra safe, remove the ref\n    cy.mutableElements().forEach(function (ele) {\n      var _p = ele._private;\n      _p.rscratch = {};\n      _p.rstyle = {};\n      _p.animation.current = [];\n      _p.animation.queue = [];\n    });\n  },\n  onRender: function onRender(fn) {\n    return this.on('render', fn);\n  },\n  offRender: function offRender(fn) {\n    return this.off('render', fn);\n  }\n};\ncorefn$4.invalidateDimensions = corefn$4.resize;\n\nvar corefn$3 = {\n  // get a collection\n  // - empty collection on no args\n  // - collection of elements in the graph on selector arg\n  // - guarantee a returned collection when elements or collection specified\n  collection: function collection(eles, opts) {\n    if (string(eles)) {\n      return this.$(eles);\n    } else if (elementOrCollection(eles)) {\n      return eles.collection();\n    } else if (array(eles)) {\n      if (!opts) {\n        opts = {};\n      }\n      return new Collection(this, eles, opts.unique, opts.removed);\n    }\n    return new Collection(this);\n  },\n  nodes: function nodes(selector) {\n    var nodes = this.$(function (ele) {\n      return ele.isNode();\n    });\n    if (selector) {\n      return nodes.filter(selector);\n    }\n    return nodes;\n  },\n  edges: function edges(selector) {\n    var edges = this.$(function (ele) {\n      return ele.isEdge();\n    });\n    if (selector) {\n      return edges.filter(selector);\n    }\n    return edges;\n  },\n  // search the graph like jQuery\n  $: function $(selector) {\n    var eles = this._private.elements;\n    if (selector) {\n      return eles.filter(selector);\n    } else {\n      return eles.spawnSelf();\n    }\n  },\n  mutableElements: function mutableElements() {\n    return this._private.elements;\n  }\n};\n\n// aliases\ncorefn$3.elements = corefn$3.filter = corefn$3.$;\n\nvar styfn$8 = {};\n\n// keys for style blocks, e.g. ttfftt\nvar TRUE = 't';\nvar FALSE = 'f';\n\n// (potentially expensive calculation)\n// apply the style to the element based on\n// - its bypass\n// - what selectors match it\nstyfn$8.apply = function (eles) {\n  var self = this;\n  var _p = self._private;\n  var cy = _p.cy;\n  var updatedEles = cy.collection();\n  for (var ie = 0; ie < eles.length; ie++) {\n    var ele = eles[ie];\n    var cxtMeta = self.getContextMeta(ele);\n    if (cxtMeta.empty) {\n      continue;\n    }\n    var cxtStyle = self.getContextStyle(cxtMeta);\n    var app = self.applyContextStyle(cxtMeta, cxtStyle, ele);\n    if (ele._private.appliedInitStyle) {\n      self.updateTransitions(ele, app.diffProps);\n    } else {\n      ele._private.appliedInitStyle = true;\n    }\n    var hintsDiff = self.updateStyleHints(ele);\n    if (hintsDiff) {\n      updatedEles.push(ele);\n    }\n  } // for elements\n\n  return updatedEles;\n};\nstyfn$8.getPropertiesDiff = function (oldCxtKey, newCxtKey) {\n  var self = this;\n  var cache = self._private.propDiffs = self._private.propDiffs || {};\n  var dualCxtKey = oldCxtKey + '-' + newCxtKey;\n  var cachedVal = cache[dualCxtKey];\n  if (cachedVal) {\n    return cachedVal;\n  }\n  var diffProps = [];\n  var addedProp = {};\n  for (var i = 0; i < self.length; i++) {\n    var cxt = self[i];\n    var oldHasCxt = oldCxtKey[i] === TRUE;\n    var newHasCxt = newCxtKey[i] === TRUE;\n    var cxtHasDiffed = oldHasCxt !== newHasCxt;\n    var cxtHasMappedProps = cxt.mappedProperties.length > 0;\n    if (cxtHasDiffed || newHasCxt && cxtHasMappedProps) {\n      var props = undefined;\n      if (cxtHasDiffed && cxtHasMappedProps) {\n        props = cxt.properties; // suffices b/c mappedProperties is a subset of properties\n      } else if (cxtHasDiffed) {\n        props = cxt.properties; // need to check them all\n      } else if (cxtHasMappedProps) {\n        props = cxt.mappedProperties; // only need to check mapped\n      }\n      for (var j = 0; j < props.length; j++) {\n        var prop = props[j];\n        var name = prop.name;\n\n        // if a later context overrides this property, then the fact that this context has switched/diffed doesn't matter\n        // (semi expensive check since it makes this function O(n^2) on context length, but worth it since overall result\n        // is cached)\n        var laterCxtOverrides = false;\n        for (var k = i + 1; k < self.length; k++) {\n          var laterCxt = self[k];\n          var hasLaterCxt = newCxtKey[k] === TRUE;\n          if (!hasLaterCxt) {\n            continue;\n          } // can't override unless the context is active\n\n          laterCxtOverrides = laterCxt.properties[prop.name] != null;\n          if (laterCxtOverrides) {\n            break;\n          } // exit early as long as one later context overrides\n        }\n        if (!addedProp[name] && !laterCxtOverrides) {\n          addedProp[name] = true;\n          diffProps.push(name);\n        }\n      } // for props\n    } // if\n  } // for contexts\n\n  cache[dualCxtKey] = diffProps;\n  return diffProps;\n};\nstyfn$8.getContextMeta = function (ele) {\n  var self = this;\n  var cxtKey = '';\n  var diffProps;\n  var prevKey = ele._private.styleCxtKey || '';\n\n  // get the cxt key\n  for (var i = 0; i < self.length; i++) {\n    var context = self[i];\n    var contextSelectorMatches = context.selector && context.selector.matches(ele); // NB: context.selector may be null for 'core'\n\n    if (contextSelectorMatches) {\n      cxtKey += TRUE;\n    } else {\n      cxtKey += FALSE;\n    }\n  } // for context\n\n  diffProps = self.getPropertiesDiff(prevKey, cxtKey);\n  ele._private.styleCxtKey = cxtKey;\n  return {\n    key: cxtKey,\n    diffPropNames: diffProps,\n    empty: diffProps.length === 0\n  };\n};\n\n// gets a computed ele style object based on matched contexts\nstyfn$8.getContextStyle = function (cxtMeta) {\n  var cxtKey = cxtMeta.key;\n  var self = this;\n  var cxtStyles = this._private.contextStyles = this._private.contextStyles || {};\n\n  // if already computed style, returned cached copy\n  if (cxtStyles[cxtKey]) {\n    return cxtStyles[cxtKey];\n  }\n  var style = {\n    _private: {\n      key: cxtKey\n    }\n  };\n  for (var i = 0; i < self.length; i++) {\n    var cxt = self[i];\n    var hasCxt = cxtKey[i] === TRUE;\n    if (!hasCxt) {\n      continue;\n    }\n    for (var j = 0; j < cxt.properties.length; j++) {\n      var prop = cxt.properties[j];\n      style[prop.name] = prop;\n    }\n  }\n  cxtStyles[cxtKey] = style;\n  return style;\n};\nstyfn$8.applyContextStyle = function (cxtMeta, cxtStyle, ele) {\n  var self = this;\n  var diffProps = cxtMeta.diffPropNames;\n  var retDiffProps = {};\n  var types = self.types;\n  for (var i = 0; i < diffProps.length; i++) {\n    var diffPropName = diffProps[i];\n    var cxtProp = cxtStyle[diffPropName];\n    var eleProp = ele.pstyle(diffPropName);\n    if (!cxtProp) {\n      // no context prop means delete\n      if (!eleProp) {\n        continue; // no existing prop means nothing needs to be removed\n        // nb affects initial application on mapped values like control-point-distances\n      } else if (eleProp.bypass) {\n        cxtProp = {\n          name: diffPropName,\n          deleteBypassed: true\n        };\n      } else {\n        cxtProp = {\n          name: diffPropName,\n          \"delete\": true\n        };\n      }\n    }\n\n    // save cycles when the context prop doesn't need to be applied\n    if (eleProp === cxtProp) {\n      continue;\n    }\n\n    // save cycles when a mapped context prop doesn't need to be applied\n    if (cxtProp.mapped === types.fn // context prop is function mapper\n    && eleProp != null // some props can be null even by default (e.g. a prop that overrides another one)\n    && eleProp.mapping != null // ele prop is a concrete value from from a mapper\n    && eleProp.mapping.value === cxtProp.value // the current prop on the ele is a flat prop value for the function mapper\n    ) {\n      // NB don't write to cxtProp, as it's shared among eles (stored in stylesheet)\n      var mapping = eleProp.mapping; // can write to mapping, as it's a per-ele copy\n      var fnValue = mapping.fnValue = cxtProp.value(ele); // temporarily cache the value in case of a miss\n\n      if (fnValue === mapping.prevFnValue) {\n        continue;\n      }\n    }\n    var retDiffProp = retDiffProps[diffPropName] = {\n      prev: eleProp\n    };\n    self.applyParsedProperty(ele, cxtProp);\n    retDiffProp.next = ele.pstyle(diffPropName);\n    if (retDiffProp.next && retDiffProp.next.bypass) {\n      retDiffProp.next = retDiffProp.next.bypassed;\n    }\n  }\n  return {\n    diffProps: retDiffProps\n  };\n};\nstyfn$8.updateStyleHints = function (ele) {\n  var _p = ele._private;\n  var self = this;\n  var propNames = self.propertyGroupNames;\n  var propGrKeys = self.propertyGroupKeys;\n  var propHash = function propHash(ele, propNames, seedKey) {\n    return self.getPropertiesHash(ele, propNames, seedKey);\n  };\n  var oldStyleKey = _p.styleKey;\n  if (ele.removed()) {\n    return false;\n  }\n  var isNode = _p.group === 'nodes';\n\n  // get the style key hashes per prop group\n  // but lazily -- only use non-default prop values to reduce the number of hashes\n  //\n\n  var overriddenStyles = ele._private.style;\n  propNames = Object.keys(overriddenStyles);\n  for (var i = 0; i < propGrKeys.length; i++) {\n    var grKey = propGrKeys[i];\n    _p.styleKeys[grKey] = [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT];\n  }\n  var updateGrKey1 = function updateGrKey1(val, grKey) {\n    return _p.styleKeys[grKey][0] = hashInt(val, _p.styleKeys[grKey][0]);\n  };\n  var updateGrKey2 = function updateGrKey2(val, grKey) {\n    return _p.styleKeys[grKey][1] = hashIntAlt(val, _p.styleKeys[grKey][1]);\n  };\n  var updateGrKey = function updateGrKey(val, grKey) {\n    updateGrKey1(val, grKey);\n    updateGrKey2(val, grKey);\n  };\n  var updateGrKeyWStr = function updateGrKeyWStr(strVal, grKey) {\n    for (var j = 0; j < strVal.length; j++) {\n      var ch = strVal.charCodeAt(j);\n      updateGrKey1(ch, grKey);\n      updateGrKey2(ch, grKey);\n    }\n  };\n\n  // - hashing works on 32 bit ints b/c we use bitwise ops\n  // - small numbers get cut off (e.g. 0.123 is seen as 0 by the hashing function)\n  // - raise up small numbers so more significant digits are seen by hashing\n  // - make small numbers larger than a normal value to avoid collisions\n  // - works in practice and it's relatively cheap\n  var N = 2000000000;\n  var cleanNum = function cleanNum(val) {\n    return -128 < val && val < 128 && Math.floor(val) !== val ? N - (val * 1024 | 0) : val;\n  };\n  for (var _i = 0; _i < propNames.length; _i++) {\n    var name = propNames[_i];\n    var parsedProp = overriddenStyles[name];\n    if (parsedProp == null) {\n      continue;\n    }\n    var propInfo = this.properties[name];\n    var type = propInfo.type;\n    var _grKey = propInfo.groupKey;\n    var normalizedNumberVal = undefined;\n    if (propInfo.hashOverride != null) {\n      normalizedNumberVal = propInfo.hashOverride(ele, parsedProp);\n    } else if (parsedProp.pfValue != null) {\n      normalizedNumberVal = parsedProp.pfValue;\n    }\n\n    // might not be a number if it allows enums\n    var numberVal = propInfo.enums == null ? parsedProp.value : null;\n    var haveNormNum = normalizedNumberVal != null;\n    var haveUnitedNum = numberVal != null;\n    var haveNum = haveNormNum || haveUnitedNum;\n    var units = parsedProp.units;\n\n    // numbers are cheaper to hash than strings\n    // 1 hash op vs n hash ops (for length n string)\n    if (type.number && haveNum && !type.multiple) {\n      var v = haveNormNum ? normalizedNumberVal : numberVal;\n      updateGrKey(cleanNum(v), _grKey);\n      if (!haveNormNum && units != null) {\n        updateGrKeyWStr(units, _grKey);\n      }\n    } else {\n      updateGrKeyWStr(parsedProp.strValue, _grKey);\n    }\n  }\n\n  // overall style key\n  //\n\n  var hash = [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT];\n  for (var _i2 = 0; _i2 < propGrKeys.length; _i2++) {\n    var _grKey2 = propGrKeys[_i2];\n    var grHash = _p.styleKeys[_grKey2];\n    hash[0] = hashInt(grHash[0], hash[0]);\n    hash[1] = hashIntAlt(grHash[1], hash[1]);\n  }\n  _p.styleKey = combineHashes(hash[0], hash[1]);\n\n  // label dims\n  //\n\n  var sk = _p.styleKeys;\n  _p.labelDimsKey = combineHashesArray(sk.labelDimensions);\n  var labelKeys = propHash(ele, ['label'], sk.labelDimensions);\n  _p.labelKey = combineHashesArray(labelKeys);\n  _p.labelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, labelKeys));\n  if (!isNode) {\n    var sourceLabelKeys = propHash(ele, ['source-label'], sk.labelDimensions);\n    _p.sourceLabelKey = combineHashesArray(sourceLabelKeys);\n    _p.sourceLabelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, sourceLabelKeys));\n    var targetLabelKeys = propHash(ele, ['target-label'], sk.labelDimensions);\n    _p.targetLabelKey = combineHashesArray(targetLabelKeys);\n    _p.targetLabelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, targetLabelKeys));\n  }\n\n  // node\n  //\n\n  if (isNode) {\n    var _p$styleKeys = _p.styleKeys,\n      nodeBody = _p$styleKeys.nodeBody,\n      nodeBorder = _p$styleKeys.nodeBorder,\n      nodeOutline = _p$styleKeys.nodeOutline,\n      backgroundImage = _p$styleKeys.backgroundImage,\n      compound = _p$styleKeys.compound,\n      pie = _p$styleKeys.pie,\n      stripe = _p$styleKeys.stripe;\n    var nodeKeys = [nodeBody, nodeBorder, nodeOutline, backgroundImage, compound, pie, stripe].filter(function (k) {\n      return k != null;\n    }).reduce(hashArrays, [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT]);\n    _p.nodeKey = combineHashesArray(nodeKeys);\n    _p.hasPie = pie != null && pie[0] !== DEFAULT_HASH_SEED && pie[1] !== DEFAULT_HASH_SEED_ALT;\n    _p.hasStripe = stripe != null && stripe[0] !== DEFAULT_HASH_SEED && stripe[1] !== DEFAULT_HASH_SEED_ALT;\n  }\n  return oldStyleKey !== _p.styleKey;\n};\nstyfn$8.clearStyleHints = function (ele) {\n  var _p = ele._private;\n  _p.styleCxtKey = '';\n  _p.styleKeys = {};\n  _p.styleKey = null;\n  _p.labelKey = null;\n  _p.labelStyleKey = null;\n  _p.sourceLabelKey = null;\n  _p.sourceLabelStyleKey = null;\n  _p.targetLabelKey = null;\n  _p.targetLabelStyleKey = null;\n  _p.nodeKey = null;\n  _p.hasPie = null;\n  _p.hasStripe = null;\n};\n\n// apply a property to the style (for internal use)\n// returns whether application was successful\n//\n// now, this function flattens the property, and here's how:\n//\n// for parsedProp:{ bypass: true, deleteBypass: true }\n// no property is generated, instead the bypass property in the\n// element's style is replaced by what's pointed to by the `bypassed`\n// field in the bypass property (i.e. restoring the property the\n// bypass was overriding)\n//\n// for parsedProp:{ mapped: truthy }\n// the generated flattenedProp:{ mapping: prop }\n//\n// for parsedProp:{ bypass: true }\n// the generated flattenedProp:{ bypassed: parsedProp }\nstyfn$8.applyParsedProperty = function (ele, parsedProp) {\n  var self = this;\n  var prop = parsedProp;\n  var style = ele._private.style;\n  var flatProp;\n  var types = self.types;\n  var type = self.properties[prop.name].type;\n  var propIsBypass = prop.bypass;\n  var origProp = style[prop.name];\n  var origPropIsBypass = origProp && origProp.bypass;\n  var _p = ele._private;\n  var flatPropMapping = 'mapping';\n  var getVal = function getVal(p) {\n    if (p == null) {\n      return null;\n    } else if (p.pfValue != null) {\n      return p.pfValue;\n    } else {\n      return p.value;\n    }\n  };\n  var checkTriggers = function checkTriggers() {\n    var fromVal = getVal(origProp);\n    var toVal = getVal(prop);\n    self.checkTriggers(ele, prop.name, fromVal, toVal);\n  };\n\n  // edge sanity checks to prevent the client from making serious mistakes\n  if (parsedProp.name === 'curve-style' && ele.isEdge() && (\n  // loops must be bundled beziers\n  parsedProp.value !== 'bezier' && ele.isLoop() ||\n  // edges connected to compound nodes can not be haystacks\n  parsedProp.value === 'haystack' && (ele.source().isParent() || ele.target().isParent()))) {\n    prop = parsedProp = this.parse(parsedProp.name, 'bezier', propIsBypass);\n  }\n  if (prop[\"delete\"]) {\n    // delete the property and use the default value on falsey value\n    style[prop.name] = undefined;\n    checkTriggers();\n    return true;\n  }\n  if (prop.deleteBypassed) {\n    // delete the property that the\n    if (!origProp) {\n      checkTriggers();\n      return true; // can't delete if no prop\n    } else if (origProp.bypass) {\n      // delete bypassed\n      origProp.bypassed = undefined;\n      checkTriggers();\n      return true;\n    } else {\n      return false; // we're unsuccessful deleting the bypassed\n    }\n  }\n\n  // check if we need to delete the current bypass\n  if (prop.deleteBypass) {\n    // then this property is just here to indicate we need to delete\n    if (!origProp) {\n      checkTriggers();\n      return true; // property is already not defined\n    } else if (origProp.bypass) {\n      // then replace the bypass property with the original\n      // because the bypassed property was already applied (and therefore parsed), we can just replace it (no reapplying necessary)\n      style[prop.name] = origProp.bypassed;\n      checkTriggers();\n      return true;\n    } else {\n      return false; // we're unsuccessful deleting the bypass\n    }\n  }\n  var printMappingErr = function printMappingErr() {\n    warn('Do not assign mappings to elements without corresponding data (i.e. ele `' + ele.id() + '` has no mapping for property `' + prop.name + '` with data field `' + prop.field + '`); try a `[' + prop.field + ']` selector to limit scope to elements with `' + prop.field + '` defined');\n  };\n\n  // put the property in the style objects\n  switch (prop.mapped) {\n    // flatten the property if mapped\n    case types.mapData:\n      {\n        // flatten the field (e.g. data.foo.bar)\n        var fields = prop.field.split('.');\n        var fieldVal = _p.data;\n        for (var i = 0; i < fields.length && fieldVal; i++) {\n          var field = fields[i];\n          fieldVal = fieldVal[field];\n        }\n        if (fieldVal == null) {\n          printMappingErr();\n          return false;\n        }\n        var percent;\n        if (!number$1(fieldVal)) {\n          // then don't apply and fall back on the existing style\n          warn('Do not use continuous mappers without specifying numeric data (i.e. `' + prop.field + ': ' + fieldVal + '` for `' + ele.id() + '` is non-numeric)');\n          return false;\n        } else {\n          var fieldWidth = prop.fieldMax - prop.fieldMin;\n          if (fieldWidth === 0) {\n            // safety check -- not strictly necessary as no props of zero range should be passed here\n            percent = 0;\n          } else {\n            percent = (fieldVal - prop.fieldMin) / fieldWidth;\n          }\n        }\n\n        // make sure to bound percent value\n        if (percent < 0) {\n          percent = 0;\n        } else if (percent > 1) {\n          percent = 1;\n        }\n        if (type.color) {\n          var r1 = prop.valueMin[0];\n          var r2 = prop.valueMax[0];\n          var g1 = prop.valueMin[1];\n          var g2 = prop.valueMax[1];\n          var b1 = prop.valueMin[2];\n          var b2 = prop.valueMax[2];\n          var a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3];\n          var a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3];\n          var clr = [Math.round(r1 + (r2 - r1) * percent), Math.round(g1 + (g2 - g1) * percent), Math.round(b1 + (b2 - b1) * percent), Math.round(a1 + (a2 - a1) * percent)];\n          flatProp = {\n            // colours are simple, so just create the flat property instead of expensive string parsing\n            bypass: prop.bypass,\n            // we're a bypass if the mapping property is a bypass\n            name: prop.name,\n            value: clr,\n            strValue: 'rgb(' + clr[0] + ', ' + clr[1] + ', ' + clr[2] + ')'\n          };\n        } else if (type.number) {\n          var calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent;\n          flatProp = this.parse(prop.name, calcValue, prop.bypass, flatPropMapping);\n        } else {\n          return false; // can only map to colours and numbers\n        }\n        if (!flatProp) {\n          // if we can't flatten the property, then don't apply the property and fall back on the existing style\n          printMappingErr();\n          return false;\n        }\n        flatProp.mapping = prop; // keep a reference to the mapping\n        prop = flatProp; // the flattened (mapped) property is the one we want\n\n        break;\n      }\n\n    // direct mapping\n    case types.data:\n      {\n        // flatten the field (e.g. data.foo.bar)\n        var _fields = prop.field.split('.');\n        var _fieldVal = _p.data;\n        for (var _i3 = 0; _i3 < _fields.length && _fieldVal; _i3++) {\n          var _field = _fields[_i3];\n          _fieldVal = _fieldVal[_field];\n        }\n        if (_fieldVal != null) {\n          flatProp = this.parse(prop.name, _fieldVal, prop.bypass, flatPropMapping);\n        }\n        if (!flatProp) {\n          // if we can't flatten the property, then don't apply and fall back on the existing style\n          printMappingErr();\n          return false;\n        }\n        flatProp.mapping = prop; // keep a reference to the mapping\n        prop = flatProp; // the flattened (mapped) property is the one we want\n\n        break;\n      }\n    case types.fn:\n      {\n        var fn = prop.value;\n        var fnRetVal = prop.fnValue != null ? prop.fnValue : fn(ele); // check for cached value before calling function\n\n        prop.prevFnValue = fnRetVal;\n        if (fnRetVal == null) {\n          warn('Custom function mappers may not return null (i.e. `' + prop.name + '` for ele `' + ele.id() + '` is null)');\n          return false;\n        }\n        flatProp = this.parse(prop.name, fnRetVal, prop.bypass, flatPropMapping);\n        if (!flatProp) {\n          warn('Custom function mappers may not return invalid values for the property type (i.e. `' + prop.name + '` for ele `' + ele.id() + '` is invalid)');\n          return false;\n        }\n        flatProp.mapping = copy(prop); // keep a reference to the mapping\n        prop = flatProp; // the flattened (mapped) property is the one we want\n\n        break;\n      }\n    case undefined:\n      break;\n    // just set the property\n\n    default:\n      return false;\n    // not a valid mapping\n  }\n\n  // if the property is a bypass property, then link the resultant property to the original one\n  if (propIsBypass) {\n    if (origPropIsBypass) {\n      // then this bypass overrides the existing one\n      prop.bypassed = origProp.bypassed; // steal bypassed prop from old bypass\n    } else {\n      // then link the orig prop to the new bypass\n      prop.bypassed = origProp;\n    }\n    style[prop.name] = prop; // and set\n  } else {\n    // prop is not bypass\n    if (origPropIsBypass) {\n      // then keep the orig prop (since it's a bypass) and link to the new prop\n      origProp.bypassed = prop;\n    } else {\n      // then just replace the old prop with the new one\n      style[prop.name] = prop;\n    }\n  }\n  checkTriggers();\n  return true;\n};\nstyfn$8.cleanElements = function (eles, keepBypasses) {\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    this.clearStyleHints(ele);\n    ele.dirtyCompoundBoundsCache();\n    ele.dirtyBoundingBoxCache();\n    if (!keepBypasses) {\n      ele._private.style = {};\n    } else {\n      var style = ele._private.style;\n      var propNames = Object.keys(style);\n      for (var j = 0; j < propNames.length; j++) {\n        var propName = propNames[j];\n        var eleProp = style[propName];\n        if (eleProp != null) {\n          if (eleProp.bypass) {\n            eleProp.bypassed = null;\n          } else {\n            style[propName] = null;\n          }\n        }\n      }\n    }\n  }\n};\n\n// updates the visual style for all elements (useful for manual style modification after init)\nstyfn$8.update = function () {\n  var cy = this._private.cy;\n  var eles = cy.mutableElements();\n  eles.updateStyle();\n};\n\n// diffProps : { name => { prev, next } }\nstyfn$8.updateTransitions = function (ele, diffProps) {\n  var self = this;\n  var _p = ele._private;\n  var props = ele.pstyle('transition-property').value;\n  var duration = ele.pstyle('transition-duration').pfValue;\n  var delay = ele.pstyle('transition-delay').pfValue;\n  if (props.length > 0 && duration > 0) {\n    var style = {};\n\n    // build up the style to animate towards\n    var anyPrev = false;\n    for (var i = 0; i < props.length; i++) {\n      var prop = props[i];\n      var styProp = ele.pstyle(prop);\n      var diffProp = diffProps[prop];\n      if (!diffProp) {\n        continue;\n      }\n      var prevProp = diffProp.prev;\n      var fromProp = prevProp;\n      var toProp = diffProp.next != null ? diffProp.next : styProp;\n      var diff = false;\n      var initVal = undefined;\n      var initDt = 0.000001; // delta time % value for initVal (allows animating out of init zero opacity)\n\n      if (!fromProp) {\n        continue;\n      }\n\n      // consider px values\n      if (number$1(fromProp.pfValue) && number$1(toProp.pfValue)) {\n        diff = toProp.pfValue - fromProp.pfValue; // nonzero is truthy\n        initVal = fromProp.pfValue + initDt * diff;\n\n        // consider numerical values\n      } else if (number$1(fromProp.value) && number$1(toProp.value)) {\n        diff = toProp.value - fromProp.value; // nonzero is truthy\n        initVal = fromProp.value + initDt * diff;\n\n        // consider colour values\n      } else if (array(fromProp.value) && array(toProp.value)) {\n        diff = fromProp.value[0] !== toProp.value[0] || fromProp.value[1] !== toProp.value[1] || fromProp.value[2] !== toProp.value[2];\n        initVal = fromProp.strValue;\n      }\n\n      // the previous value is good for an animation only if it's different\n      if (diff) {\n        style[prop] = toProp.strValue; // to val\n        this.applyBypass(ele, prop, initVal); // from val\n        anyPrev = true;\n      }\n    } // end if props allow ani\n\n    // can't transition if there's nothing previous to transition from\n    if (!anyPrev) {\n      return;\n    }\n    _p.transitioning = true;\n    new Promise$1(function (resolve) {\n      if (delay > 0) {\n        ele.delayAnimation(delay).play().promise().then(resolve);\n      } else {\n        resolve();\n      }\n    }).then(function () {\n      return ele.animation({\n        style: style,\n        duration: duration,\n        easing: ele.pstyle('transition-timing-function').value,\n        queue: false\n      }).play().promise();\n    }).then(function () {\n      // if( !isBypass ){\n      self.removeBypasses(ele, props);\n      ele.emitAndNotify('style');\n      // }\n\n      _p.transitioning = false;\n    });\n  } else if (_p.transitioning) {\n    this.removeBypasses(ele, props);\n    ele.emitAndNotify('style');\n    _p.transitioning = false;\n  }\n};\nstyfn$8.checkTrigger = function (ele, name, fromValue, toValue, getTrigger, onTrigger) {\n  var prop = this.properties[name];\n  var triggerCheck = getTrigger(prop);\n  if (ele.removed()) {\n    return;\n  }\n  if (triggerCheck != null && triggerCheck(fromValue, toValue, ele)) {\n    onTrigger(prop);\n  }\n};\nstyfn$8.checkZOrderTrigger = function (ele, name, fromValue, toValue) {\n  var _this = this;\n  this.checkTrigger(ele, name, fromValue, toValue, function (prop) {\n    return prop.triggersZOrder;\n  }, function () {\n    _this._private.cy.notify('zorder', ele);\n  });\n};\nstyfn$8.checkBoundsTrigger = function (ele, name, fromValue, toValue) {\n  this.checkTrigger(ele, name, fromValue, toValue, function (prop) {\n    return prop.triggersBounds;\n  }, function (prop) {\n    ele.dirtyCompoundBoundsCache();\n    ele.dirtyBoundingBoxCache();\n  });\n};\nstyfn$8.checkConnectedEdgesBoundsTrigger = function (ele, name, fromValue, toValue) {\n  this.checkTrigger(ele, name, fromValue, toValue, function (prop) {\n    return prop.triggersBoundsOfConnectedEdges;\n  }, function (prop) {\n    ele.connectedEdges().forEach(function (edge) {\n      edge.dirtyBoundingBoxCache();\n    });\n  });\n};\nstyfn$8.checkParallelEdgesBoundsTrigger = function (ele, name, fromValue, toValue) {\n  this.checkTrigger(ele, name, fromValue, toValue, function (prop) {\n    return prop.triggersBoundsOfParallelEdges;\n  }, function (prop) {\n    ele.parallelEdges().forEach(function (pllEdge) {\n      pllEdge.dirtyBoundingBoxCache();\n    });\n  });\n};\nstyfn$8.checkTriggers = function (ele, name, fromValue, toValue) {\n  ele.dirtyStyleCache();\n  this.checkZOrderTrigger(ele, name, fromValue, toValue);\n  this.checkBoundsTrigger(ele, name, fromValue, toValue);\n  this.checkConnectedEdgesBoundsTrigger(ele, name, fromValue, toValue);\n  this.checkParallelEdgesBoundsTrigger(ele, name, fromValue, toValue);\n};\n\nvar styfn$7 = {};\n\n// bypasses are applied to an existing style on an element, and just tacked on temporarily\n// returns true iff application was successful for at least 1 specified property\nstyfn$7.applyBypass = function (eles, name, value, updateTransitions) {\n  var self = this;\n  var props = [];\n  var isBypass = true;\n\n  // put all the properties (can specify one or many) in an array after parsing them\n  if (name === '*' || name === '**') {\n    // apply to all property names\n\n    if (value !== undefined) {\n      for (var i = 0; i < self.properties.length; i++) {\n        var prop = self.properties[i];\n        var _name = prop.name;\n        var parsedProp = this.parse(_name, value, true);\n        if (parsedProp) {\n          props.push(parsedProp);\n        }\n      }\n    }\n  } else if (string(name)) {\n    // then parse the single property\n    var _parsedProp = this.parse(name, value, true);\n    if (_parsedProp) {\n      props.push(_parsedProp);\n    }\n  } else if (plainObject(name)) {\n    // then parse each property\n    var specifiedProps = name;\n    updateTransitions = value;\n    var names = Object.keys(specifiedProps);\n    for (var _i = 0; _i < names.length; _i++) {\n      var _name2 = names[_i];\n      var _value = specifiedProps[_name2];\n      if (_value === undefined) {\n        // try camel case name too\n        _value = specifiedProps[dash2camel(_name2)];\n      }\n      if (_value !== undefined) {\n        var _parsedProp2 = this.parse(_name2, _value, true);\n        if (_parsedProp2) {\n          props.push(_parsedProp2);\n        }\n      }\n    }\n  } else {\n    // can't do anything without well defined properties\n    return false;\n  }\n\n  // we've failed if there are no valid properties\n  if (props.length === 0) {\n    return false;\n  }\n\n  // now, apply the bypass properties on the elements\n  var ret = false; // return true if at least one succesful bypass applied\n  for (var _i2 = 0; _i2 < eles.length; _i2++) {\n    // for each ele\n    var ele = eles[_i2];\n    var diffProps = {};\n    var diffProp = undefined;\n    for (var j = 0; j < props.length; j++) {\n      // for each prop\n      var _prop = props[j];\n      if (updateTransitions) {\n        var prevProp = ele.pstyle(_prop.name);\n        diffProp = diffProps[_prop.name] = {\n          prev: prevProp\n        };\n      }\n      ret = this.applyParsedProperty(ele, copy(_prop)) || ret;\n      if (updateTransitions) {\n        diffProp.next = ele.pstyle(_prop.name);\n      }\n    } // for props\n\n    if (ret) {\n      this.updateStyleHints(ele);\n    }\n    if (updateTransitions) {\n      this.updateTransitions(ele, diffProps, isBypass);\n    }\n  } // for eles\n\n  return ret;\n};\n\n// only useful in specific cases like animation\nstyfn$7.overrideBypass = function (eles, name, value) {\n  name = camel2dash(name);\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    var prop = ele._private.style[name];\n    var type = this.properties[name].type;\n    var isColor = type.color;\n    var isMulti = type.mutiple;\n    var oldValue = !prop ? null : prop.pfValue != null ? prop.pfValue : prop.value;\n    if (!prop || !prop.bypass) {\n      // need a bypass if one doesn't exist\n      this.applyBypass(ele, name, value);\n    } else {\n      prop.value = value;\n      if (prop.pfValue != null) {\n        prop.pfValue = value;\n      }\n      if (isColor) {\n        prop.strValue = 'rgb(' + value.join(',') + ')';\n      } else if (isMulti) {\n        prop.strValue = value.join(' ');\n      } else {\n        prop.strValue = '' + value;\n      }\n      this.updateStyleHints(ele);\n    }\n    this.checkTriggers(ele, name, oldValue, value);\n  }\n};\nstyfn$7.removeAllBypasses = function (eles, updateTransitions) {\n  return this.removeBypasses(eles, this.propertyNames, updateTransitions);\n};\nstyfn$7.removeBypasses = function (eles, props, updateTransitions) {\n  var isBypass = true;\n  for (var j = 0; j < eles.length; j++) {\n    var ele = eles[j];\n    var diffProps = {};\n    for (var i = 0; i < props.length; i++) {\n      var name = props[i];\n      var prop = this.properties[name];\n      var prevProp = ele.pstyle(prop.name);\n      if (!prevProp || !prevProp.bypass) {\n        // if a bypass doesn't exist for the prop, nothing needs to be removed\n        continue;\n      }\n      var value = ''; // empty => remove bypass\n      var parsedProp = this.parse(name, value, true);\n      var diffProp = diffProps[prop.name] = {\n        prev: prevProp\n      };\n      this.applyParsedProperty(ele, parsedProp);\n      diffProp.next = ele.pstyle(prop.name);\n    } // for props\n\n    this.updateStyleHints(ele);\n    if (updateTransitions) {\n      this.updateTransitions(ele, diffProps, isBypass);\n    }\n  } // for eles\n};\n\nvar styfn$6 = {};\n\n// gets what an em size corresponds to in pixels relative to a dom element\nstyfn$6.getEmSizeInPixels = function () {\n  var px = this.containerCss('font-size');\n  if (px != null) {\n    return parseFloat(px);\n  } else {\n    return 1; // for headless\n  }\n};\n\n// gets css property from the core container\nstyfn$6.containerCss = function (propName) {\n  var cy = this._private.cy;\n  var domElement = cy.container();\n  var containerWindow = cy.window();\n  if (containerWindow && domElement && containerWindow.getComputedStyle) {\n    return containerWindow.getComputedStyle(domElement).getPropertyValue(propName);\n  }\n};\n\nvar styfn$5 = {};\n\n// gets the rendered style for an element\nstyfn$5.getRenderedStyle = function (ele, prop) {\n  if (prop) {\n    return this.getStylePropertyValue(ele, prop, true);\n  } else {\n    return this.getRawStyle(ele, true);\n  }\n};\n\n// gets the raw style for an element\nstyfn$5.getRawStyle = function (ele, isRenderedVal) {\n  var self = this;\n  ele = ele[0]; // insure it's an element\n\n  if (ele) {\n    var rstyle = {};\n    for (var i = 0; i < self.properties.length; i++) {\n      var prop = self.properties[i];\n      var val = self.getStylePropertyValue(ele, prop.name, isRenderedVal);\n      if (val != null) {\n        rstyle[prop.name] = val;\n        rstyle[dash2camel(prop.name)] = val;\n      }\n    }\n    return rstyle;\n  }\n};\nstyfn$5.getIndexedStyle = function (ele, property, subproperty, index) {\n  var pstyle = ele.pstyle(property)[subproperty][index];\n  return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty(property)[subproperty][0];\n};\nstyfn$5.getStylePropertyValue = function (ele, propName, isRenderedVal) {\n  var self = this;\n  ele = ele[0]; // insure it's an element\n\n  if (ele) {\n    var prop = self.properties[propName];\n    if (prop.alias) {\n      prop = prop.pointsTo;\n    }\n    var type = prop.type;\n    var styleProp = ele.pstyle(prop.name);\n    if (styleProp) {\n      var value = styleProp.value,\n        units = styleProp.units,\n        strValue = styleProp.strValue;\n      if (isRenderedVal && type.number && value != null && number$1(value)) {\n        var zoom = ele.cy().zoom();\n        var getRenderedValue = function getRenderedValue(val) {\n          return val * zoom;\n        };\n        var getValueStringWithUnits = function getValueStringWithUnits(val, units) {\n          return getRenderedValue(val) + units;\n        };\n        var isArrayValue = array(value);\n        var haveUnits = isArrayValue ? units.every(function (u) {\n          return u != null;\n        }) : units != null;\n        if (haveUnits) {\n          if (isArrayValue) {\n            return value.map(function (v, i) {\n              return getValueStringWithUnits(v, units[i]);\n            }).join(' ');\n          } else {\n            return getValueStringWithUnits(value, units);\n          }\n        } else {\n          if (isArrayValue) {\n            return value.map(function (v) {\n              return string(v) ? v : '' + getRenderedValue(v);\n            }).join(' ');\n          } else {\n            return '' + getRenderedValue(value);\n          }\n        }\n      } else if (strValue != null) {\n        return strValue;\n      }\n    }\n    return null;\n  }\n};\nstyfn$5.getAnimationStartStyle = function (ele, aniProps) {\n  var rstyle = {};\n  for (var i = 0; i < aniProps.length; i++) {\n    var aniProp = aniProps[i];\n    var name = aniProp.name;\n    var styleProp = ele.pstyle(name);\n    if (styleProp !== undefined) {\n      // then make a prop of it\n      if (plainObject(styleProp)) {\n        styleProp = this.parse(name, styleProp.strValue);\n      } else {\n        styleProp = this.parse(name, styleProp);\n      }\n    }\n    if (styleProp) {\n      rstyle[name] = styleProp;\n    }\n  }\n  return rstyle;\n};\nstyfn$5.getPropsList = function (propsObj) {\n  var self = this;\n  var rstyle = [];\n  var style = propsObj;\n  var props = self.properties;\n  if (style) {\n    var names = Object.keys(style);\n    for (var i = 0; i < names.length; i++) {\n      var name = names[i];\n      var val = style[name];\n      var prop = props[name] || props[camel2dash(name)];\n      var styleProp = this.parse(prop.name, val);\n      if (styleProp) {\n        rstyle.push(styleProp);\n      }\n    }\n  }\n  return rstyle;\n};\nstyfn$5.getNonDefaultPropertiesHash = function (ele, propNames, seed) {\n  var hash = seed.slice();\n  var name, val, strVal, chVal;\n  var i, j;\n  for (i = 0; i < propNames.length; i++) {\n    name = propNames[i];\n    val = ele.pstyle(name, false);\n    if (val == null) {\n      continue;\n    } else if (val.pfValue != null) {\n      hash[0] = hashInt(chVal, hash[0]);\n      hash[1] = hashIntAlt(chVal, hash[1]);\n    } else {\n      strVal = val.strValue;\n      for (j = 0; j < strVal.length; j++) {\n        chVal = strVal.charCodeAt(j);\n        hash[0] = hashInt(chVal, hash[0]);\n        hash[1] = hashIntAlt(chVal, hash[1]);\n      }\n    }\n  }\n  return hash;\n};\nstyfn$5.getPropertiesHash = styfn$5.getNonDefaultPropertiesHash;\n\nvar styfn$4 = {};\nstyfn$4.appendFromJson = function (json) {\n  var style = this;\n  for (var i = 0; i < json.length; i++) {\n    var context = json[i];\n    var selector = context.selector;\n    var props = context.style || context.css;\n    var names = Object.keys(props);\n    style.selector(selector); // apply selector\n\n    for (var j = 0; j < names.length; j++) {\n      var name = names[j];\n      var value = props[name];\n      style.css(name, value); // apply property\n    }\n  }\n  return style;\n};\n\n// accessible cy.style() function\nstyfn$4.fromJson = function (json) {\n  var style = this;\n  style.resetToDefault();\n  style.appendFromJson(json);\n  return style;\n};\n\n// get json from cy.style() api\nstyfn$4.json = function () {\n  var json = [];\n  for (var i = this.defaultLength; i < this.length; i++) {\n    var cxt = this[i];\n    var selector = cxt.selector;\n    var props = cxt.properties;\n    var css = {};\n    for (var j = 0; j < props.length; j++) {\n      var prop = props[j];\n      css[prop.name] = prop.strValue;\n    }\n    json.push({\n      selector: !selector ? 'core' : selector.toString(),\n      style: css\n    });\n  }\n  return json;\n};\n\nvar styfn$3 = {};\nstyfn$3.appendFromString = function (string) {\n  var self = this;\n  var style = this;\n  var remaining = '' + string;\n  var selAndBlockStr;\n  var blockRem;\n  var propAndValStr;\n\n  // remove comments from the style string\n  remaining = remaining.replace(/[/][*](\\s|.)+?[*][/]/g, '');\n  function removeSelAndBlockFromRemaining() {\n    // remove the parsed selector and block from the remaining text to parse\n    if (remaining.length > selAndBlockStr.length) {\n      remaining = remaining.substr(selAndBlockStr.length);\n    } else {\n      remaining = '';\n    }\n  }\n  function removePropAndValFromRem() {\n    // remove the parsed property and value from the remaining block text to parse\n    if (blockRem.length > propAndValStr.length) {\n      blockRem = blockRem.substr(propAndValStr.length);\n    } else {\n      blockRem = '';\n    }\n  }\n  for (;;) {\n    var nothingLeftToParse = remaining.match(/^\\s*$/);\n    if (nothingLeftToParse) {\n      break;\n    }\n    var selAndBlock = remaining.match(/^\\s*((?:.|\\s)+?)\\s*\\{((?:.|\\s)+?)\\}/);\n    if (!selAndBlock) {\n      warn('Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: ' + remaining);\n      break;\n    }\n    selAndBlockStr = selAndBlock[0];\n\n    // parse the selector\n    var selectorStr = selAndBlock[1];\n    if (selectorStr !== 'core') {\n      var selector = new Selector(selectorStr);\n      if (selector.invalid) {\n        warn('Skipping parsing of block: Invalid selector found in string stylesheet: ' + selectorStr);\n\n        // skip this selector and block\n        removeSelAndBlockFromRemaining();\n        continue;\n      }\n    }\n\n    // parse the block of properties and values\n    var blockStr = selAndBlock[2];\n    var invalidBlock = false;\n    blockRem = blockStr;\n    var props = [];\n    for (;;) {\n      var _nothingLeftToParse = blockRem.match(/^\\s*$/);\n      if (_nothingLeftToParse) {\n        break;\n      }\n      var propAndVal = blockRem.match(/^\\s*(.+?)\\s*:\\s*(.+?)(?:\\s*;|\\s*$)/);\n      if (!propAndVal) {\n        warn('Skipping parsing of block: Invalid formatting of style property and value definitions found in:' + blockStr);\n        invalidBlock = true;\n        break;\n      }\n      propAndValStr = propAndVal[0];\n      var propStr = propAndVal[1];\n      var valStr = propAndVal[2];\n      var prop = self.properties[propStr];\n      if (!prop) {\n        warn('Skipping property: Invalid property name in: ' + propAndValStr);\n\n        // skip this property in the block\n        removePropAndValFromRem();\n        continue;\n      }\n      var parsedProp = style.parse(propStr, valStr);\n      if (!parsedProp) {\n        warn('Skipping property: Invalid property definition in: ' + propAndValStr);\n\n        // skip this property in the block\n        removePropAndValFromRem();\n        continue;\n      }\n      props.push({\n        name: propStr,\n        val: valStr\n      });\n      removePropAndValFromRem();\n    }\n    if (invalidBlock) {\n      removeSelAndBlockFromRemaining();\n      break;\n    }\n\n    // put the parsed block in the style\n    style.selector(selectorStr);\n    for (var i = 0; i < props.length; i++) {\n      var _prop = props[i];\n      style.css(_prop.name, _prop.val);\n    }\n    removeSelAndBlockFromRemaining();\n  }\n  return style;\n};\nstyfn$3.fromString = function (string) {\n  var style = this;\n  style.resetToDefault();\n  style.appendFromString(string);\n  return style;\n};\n\nvar styfn$2 = {};\n(function () {\n  var number$1 = number;\n  var rgba = rgbaNoBackRefs;\n  var hsla = hslaNoBackRefs;\n  var hex3$1 = hex3;\n  var hex6$1 = hex6;\n  var data = function data(prefix) {\n    return '^' + prefix + '\\\\s*\\\\(\\\\s*([\\\\w\\\\.]+)\\\\s*\\\\)$';\n  };\n  var mapData = function mapData(prefix) {\n    var mapArg = number$1 + '|\\\\w+|' + rgba + '|' + hsla + '|' + hex3$1 + '|' + hex6$1;\n    return '^' + prefix + '\\\\s*\\\\(([\\\\w\\\\.]+)\\\\s*\\\\,\\\\s*(' + number$1 + ')\\\\s*\\\\,\\\\s*(' + number$1 + ')\\\\s*,\\\\s*(' + mapArg + ')\\\\s*\\\\,\\\\s*(' + mapArg + ')\\\\)$';\n  };\n  var urlRegexes = ['^url\\\\s*\\\\(\\\\s*[\\'\"]?(.+?)[\\'\"]?\\\\s*\\\\)$', '^(none)$', '^(.+)$'];\n\n  // each visual style property has a type and needs to be validated according to it\n  styfn$2.types = {\n    time: {\n      number: true,\n      min: 0,\n      units: 's|ms',\n      implicitUnits: 'ms'\n    },\n    percent: {\n      number: true,\n      min: 0,\n      max: 100,\n      units: '%',\n      implicitUnits: '%'\n    },\n    percentages: {\n      number: true,\n      min: 0,\n      max: 100,\n      units: '%',\n      implicitUnits: '%',\n      multiple: true\n    },\n    zeroOneNumber: {\n      number: true,\n      min: 0,\n      max: 1,\n      unitless: true\n    },\n    zeroOneNumbers: {\n      number: true,\n      min: 0,\n      max: 1,\n      unitless: true,\n      multiple: true\n    },\n    nOneOneNumber: {\n      number: true,\n      min: -1,\n      max: 1,\n      unitless: true\n    },\n    nonNegativeInt: {\n      number: true,\n      min: 0,\n      integer: true,\n      unitless: true\n    },\n    nonNegativeNumber: {\n      number: true,\n      min: 0,\n      unitless: true\n    },\n    position: {\n      enums: ['parent', 'origin']\n    },\n    nodeSize: {\n      number: true,\n      min: 0,\n      enums: ['label']\n    },\n    number: {\n      number: true,\n      unitless: true\n    },\n    numbers: {\n      number: true,\n      unitless: true,\n      multiple: true\n    },\n    positiveNumber: {\n      number: true,\n      unitless: true,\n      min: 0,\n      strictMin: true\n    },\n    size: {\n      number: true,\n      min: 0\n    },\n    bidirectionalSize: {\n      number: true\n    },\n    // allows negative\n    bidirectionalSizeMaybePercent: {\n      number: true,\n      allowPercent: true\n    },\n    // allows negative\n    bidirectionalSizes: {\n      number: true,\n      multiple: true\n    },\n    // allows negative\n    sizeMaybePercent: {\n      number: true,\n      min: 0,\n      allowPercent: true\n    },\n    axisDirection: {\n      enums: ['horizontal', 'leftward', 'rightward', 'vertical', 'upward', 'downward', 'auto']\n    },\n    axisDirectionExplicit: {\n      enums: ['leftward', 'rightward', 'upward', 'downward']\n    },\n    axisDirectionPrimary: {\n      enums: ['horizontal', 'vertical']\n    },\n    paddingRelativeTo: {\n      enums: ['width', 'height', 'average', 'min', 'max']\n    },\n    bgWH: {\n      number: true,\n      min: 0,\n      allowPercent: true,\n      enums: ['auto'],\n      multiple: true\n    },\n    bgPos: {\n      number: true,\n      allowPercent: true,\n      multiple: true\n    },\n    bgRelativeTo: {\n      enums: ['inner', 'include-padding'],\n      multiple: true\n    },\n    bgRepeat: {\n      enums: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'],\n      multiple: true\n    },\n    bgFit: {\n      enums: ['none', 'contain', 'cover'],\n      multiple: true\n    },\n    bgCrossOrigin: {\n      enums: ['anonymous', 'use-credentials', 'null'],\n      multiple: true\n    },\n    bgClip: {\n      enums: ['none', 'node'],\n      multiple: true\n    },\n    bgContainment: {\n      enums: ['inside', 'over'],\n      multiple: true\n    },\n    boxSelection: {\n      enums: ['contain', 'overlap', 'none']\n    },\n    color: {\n      color: true\n    },\n    colors: {\n      color: true,\n      multiple: true\n    },\n    fill: {\n      enums: ['solid', 'linear-gradient', 'radial-gradient']\n    },\n    bool: {\n      enums: ['yes', 'no']\n    },\n    bools: {\n      enums: ['yes', 'no'],\n      multiple: true\n    },\n    lineStyle: {\n      enums: ['solid', 'dotted', 'dashed']\n    },\n    lineCap: {\n      enums: ['butt', 'round', 'square']\n    },\n    linePosition: {\n      enums: ['center', 'inside', 'outside']\n    },\n    lineJoin: {\n      enums: ['round', 'bevel', 'miter']\n    },\n    borderStyle: {\n      enums: ['solid', 'dotted', 'dashed', 'double']\n    },\n    curveStyle: {\n      enums: ['bezier', 'unbundled-bezier', 'haystack', 'segments', 'straight', 'straight-triangle', 'taxi', 'round-segments', 'round-taxi']\n    },\n    radiusType: {\n      enums: ['arc-radius', 'influence-radius'],\n      multiple: true\n    },\n    fontFamily: {\n      regex: '^([\\\\w- \\\\\"]+(?:\\\\s*,\\\\s*[\\\\w- \\\\\"]+)*)$'\n    },\n    fontStyle: {\n      enums: ['italic', 'normal', 'oblique']\n    },\n    fontWeight: {\n      enums: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, 900]\n    },\n    textDecoration: {\n      enums: ['none', 'underline', 'overline', 'line-through']\n    },\n    textTransform: {\n      enums: ['none', 'uppercase', 'lowercase']\n    },\n    textWrap: {\n      enums: ['none', 'wrap', 'ellipsis']\n    },\n    textOverflowWrap: {\n      enums: ['whitespace', 'anywhere']\n    },\n    textBackgroundShape: {\n      enums: ['rectangle', 'roundrectangle', 'round-rectangle', 'circle']\n    },\n    nodeShape: {\n      enums: ['rectangle', 'roundrectangle', 'round-rectangle', 'cutrectangle', 'cut-rectangle', 'bottomroundrectangle', 'bottom-round-rectangle', 'barrel', 'ellipse', 'triangle', 'round-triangle', 'square', 'pentagon', 'round-pentagon', 'hexagon', 'round-hexagon', 'concavehexagon', 'concave-hexagon', 'heptagon', 'round-heptagon', 'octagon', 'round-octagon', 'tag', 'round-tag', 'star', 'diamond', 'round-diamond', 'vee', 'rhomboid', 'right-rhomboid', 'polygon']\n    },\n    overlayShape: {\n      enums: ['roundrectangle', 'round-rectangle', 'ellipse']\n    },\n    cornerRadius: {\n      number: true,\n      min: 0,\n      units: 'px|em',\n      implicitUnits: 'px',\n      enums: ['auto']\n    },\n    compoundIncludeLabels: {\n      enums: ['include', 'exclude']\n    },\n    arrowShape: {\n      enums: ['tee', 'triangle', 'triangle-tee', 'circle-triangle', 'triangle-cross', 'triangle-backcurve', 'vee', 'square', 'circle', 'diamond', 'chevron', 'none']\n    },\n    arrowFill: {\n      enums: ['filled', 'hollow']\n    },\n    arrowWidth: {\n      number: true,\n      units: '%|px|em',\n      implicitUnits: 'px',\n      enums: ['match-line']\n    },\n    display: {\n      enums: ['element', 'none']\n    },\n    visibility: {\n      enums: ['hidden', 'visible']\n    },\n    zCompoundDepth: {\n      enums: ['bottom', 'orphan', 'auto', 'top']\n    },\n    zIndexCompare: {\n      enums: ['auto', 'manual']\n    },\n    valign: {\n      enums: ['top', 'center', 'bottom']\n    },\n    halign: {\n      enums: ['left', 'center', 'right']\n    },\n    justification: {\n      enums: ['left', 'center', 'right', 'auto']\n    },\n    text: {\n      string: true\n    },\n    data: {\n      mapping: true,\n      regex: data('data')\n    },\n    layoutData: {\n      mapping: true,\n      regex: data('layoutData')\n    },\n    scratch: {\n      mapping: true,\n      regex: data('scratch')\n    },\n    mapData: {\n      mapping: true,\n      regex: mapData('mapData')\n    },\n    mapLayoutData: {\n      mapping: true,\n      regex: mapData('mapLayoutData')\n    },\n    mapScratch: {\n      mapping: true,\n      regex: mapData('mapScratch')\n    },\n    fn: {\n      mapping: true,\n      fn: true\n    },\n    url: {\n      regexes: urlRegexes,\n      singleRegexMatchValue: true\n    },\n    urls: {\n      regexes: urlRegexes,\n      singleRegexMatchValue: true,\n      multiple: true\n    },\n    propList: {\n      propList: true\n    },\n    angle: {\n      number: true,\n      units: 'deg|rad',\n      implicitUnits: 'rad'\n    },\n    textRotation: {\n      number: true,\n      units: 'deg|rad',\n      implicitUnits: 'rad',\n      enums: ['none', 'autorotate']\n    },\n    polygonPointList: {\n      number: true,\n      multiple: true,\n      evenMultiple: true,\n      min: -1,\n      max: 1,\n      unitless: true\n    },\n    edgeDistances: {\n      enums: ['intersection', 'node-position', 'endpoints']\n    },\n    edgeEndpoint: {\n      number: true,\n      multiple: true,\n      units: '%|px|em|deg|rad',\n      implicitUnits: 'px',\n      enums: ['inside-to-node', 'outside-to-node', 'outside-to-node-or-label', 'outside-to-line', 'outside-to-line-or-label'],\n      singleEnum: true,\n      validate: function validate(valArr, unitsArr) {\n        switch (valArr.length) {\n          case 2:\n            // can be % or px only\n            return unitsArr[0] !== 'deg' && unitsArr[0] !== 'rad' && unitsArr[1] !== 'deg' && unitsArr[1] !== 'rad';\n          case 1:\n            // can be enum, deg, or rad only\n            return string(valArr[0]) || unitsArr[0] === 'deg' || unitsArr[0] === 'rad';\n          default:\n            return false;\n        }\n      }\n    },\n    easing: {\n      regexes: ['^(spring)\\\\s*\\\\(\\\\s*(' + number$1 + ')\\\\s*,\\\\s*(' + number$1 + ')\\\\s*\\\\)$', '^(cubic-bezier)\\\\s*\\\\(\\\\s*(' + number$1 + ')\\\\s*,\\\\s*(' + number$1 + ')\\\\s*,\\\\s*(' + number$1 + ')\\\\s*,\\\\s*(' + number$1 + ')\\\\s*\\\\)$'],\n      enums: ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'ease-in-sine', 'ease-out-sine', 'ease-in-out-sine', 'ease-in-quad', 'ease-out-quad', 'ease-in-out-quad', 'ease-in-cubic', 'ease-out-cubic', 'ease-in-out-cubic', 'ease-in-quart', 'ease-out-quart', 'ease-in-out-quart', 'ease-in-quint', 'ease-out-quint', 'ease-in-out-quint', 'ease-in-expo', 'ease-out-expo', 'ease-in-out-expo', 'ease-in-circ', 'ease-out-circ', 'ease-in-out-circ']\n    },\n    gradientDirection: {\n      enums: ['to-bottom', 'to-top', 'to-left', 'to-right', 'to-bottom-right', 'to-bottom-left', 'to-top-right', 'to-top-left', 'to-right-bottom', 'to-left-bottom', 'to-right-top', 'to-left-top' // different order\n      ]\n    },\n    boundsExpansion: {\n      number: true,\n      multiple: true,\n      min: 0,\n      validate: function validate(valArr) {\n        var length = valArr.length;\n        return length === 1 || length === 2 || length === 4;\n      }\n    }\n  };\n  var diff = {\n    zeroNonZero: function zeroNonZero(val1, val2) {\n      if ((val1 == null || val2 == null) && val1 !== val2) {\n        return true; // null cases could represent any value\n      }\n      if (val1 == 0 && val2 != 0) {\n        return true;\n      } else if (val1 != 0 && val2 == 0) {\n        return true;\n      } else {\n        return false;\n      }\n    },\n    any: function any(val1, val2) {\n      return val1 != val2;\n    },\n    emptyNonEmpty: function emptyNonEmpty(str1, str2) {\n      var empty1 = emptyString(str1);\n      var empty2 = emptyString(str2);\n      return empty1 && !empty2 || !empty1 && empty2;\n    }\n  };\n\n  // define visual style properties\n  //\n  // - n.b. adding a new group of props may require updates to updateStyleHints()\n  // - adding new props to an existing group gets handled automatically\n\n  var t = styfn$2.types;\n  var mainLabel = [{\n    name: 'label',\n    type: t.text,\n    triggersBounds: diff.any,\n    triggersZOrder: diff.emptyNonEmpty\n  }, {\n    name: 'text-rotation',\n    type: t.textRotation,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-margin-x',\n    type: t.bidirectionalSize,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-margin-y',\n    type: t.bidirectionalSize,\n    triggersBounds: diff.any\n  }];\n  var sourceLabel = [{\n    name: 'source-label',\n    type: t.text,\n    triggersBounds: diff.any\n  }, {\n    name: 'source-text-rotation',\n    type: t.textRotation,\n    triggersBounds: diff.any\n  }, {\n    name: 'source-text-margin-x',\n    type: t.bidirectionalSize,\n    triggersBounds: diff.any\n  }, {\n    name: 'source-text-margin-y',\n    type: t.bidirectionalSize,\n    triggersBounds: diff.any\n  }, {\n    name: 'source-text-offset',\n    type: t.size,\n    triggersBounds: diff.any\n  }];\n  var targetLabel = [{\n    name: 'target-label',\n    type: t.text,\n    triggersBounds: diff.any\n  }, {\n    name: 'target-text-rotation',\n    type: t.textRotation,\n    triggersBounds: diff.any\n  }, {\n    name: 'target-text-margin-x',\n    type: t.bidirectionalSize,\n    triggersBounds: diff.any\n  }, {\n    name: 'target-text-margin-y',\n    type: t.bidirectionalSize,\n    triggersBounds: diff.any\n  }, {\n    name: 'target-text-offset',\n    type: t.size,\n    triggersBounds: diff.any\n  }];\n  var labelDimensions = [{\n    name: 'font-family',\n    type: t.fontFamily,\n    triggersBounds: diff.any\n  }, {\n    name: 'font-style',\n    type: t.fontStyle,\n    triggersBounds: diff.any\n  }, {\n    name: 'font-weight',\n    type: t.fontWeight,\n    triggersBounds: diff.any\n  }, {\n    name: 'font-size',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-transform',\n    type: t.textTransform,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-wrap',\n    type: t.textWrap,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-overflow-wrap',\n    type: t.textOverflowWrap,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-max-width',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-outline-width',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'line-height',\n    type: t.positiveNumber,\n    triggersBounds: diff.any\n  }];\n  var commonLabel = [{\n    name: 'text-valign',\n    type: t.valign,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-halign',\n    type: t.halign,\n    triggersBounds: diff.any\n  }, {\n    name: 'color',\n    type: t.color\n  }, {\n    name: 'text-outline-color',\n    type: t.color\n  }, {\n    name: 'text-outline-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'text-background-color',\n    type: t.color\n  }, {\n    name: 'text-background-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'text-background-padding',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-border-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'text-border-color',\n    type: t.color\n  }, {\n    name: 'text-border-width',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-border-style',\n    type: t.borderStyle,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-background-shape',\n    type: t.textBackgroundShape,\n    triggersBounds: diff.any\n  }, {\n    name: 'text-justification',\n    type: t.justification\n  }, {\n    name: 'box-select-labels',\n    type: t.bool,\n    triggersBounds: diff.any\n  }];\n  var behavior = [{\n    name: 'events',\n    type: t.bool,\n    triggersZOrder: diff.any\n  }, {\n    name: 'text-events',\n    type: t.bool,\n    triggersZOrder: diff.any\n  }, {\n    name: 'box-selection',\n    type: t.boxSelection,\n    triggersZOrder: diff.any\n  }];\n  var visibility = [{\n    name: 'display',\n    type: t.display,\n    triggersZOrder: diff.any,\n    triggersBounds: diff.any,\n    triggersBoundsOfConnectedEdges: diff.any,\n    triggersBoundsOfParallelEdges: function triggersBoundsOfParallelEdges(fromValue, toValue, ele) {\n      if (fromValue === toValue) {\n        return false;\n      }\n\n      // only if edge is bundled bezier (so as not to affect performance of other edges)\n      return ele.pstyle('curve-style').value === 'bezier';\n    }\n  }, {\n    name: 'visibility',\n    type: t.visibility,\n    triggersZOrder: diff.any\n  }, {\n    name: 'opacity',\n    type: t.zeroOneNumber,\n    triggersZOrder: diff.zeroNonZero\n  }, {\n    name: 'text-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'min-zoomed-font-size',\n    type: t.size\n  }, {\n    name: 'z-compound-depth',\n    type: t.zCompoundDepth,\n    triggersZOrder: diff.any\n  }, {\n    name: 'z-index-compare',\n    type: t.zIndexCompare,\n    triggersZOrder: diff.any\n  }, {\n    name: 'z-index',\n    type: t.number,\n    triggersZOrder: diff.any\n  }];\n  var overlay = [{\n    name: 'overlay-padding',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'overlay-color',\n    type: t.color\n  }, {\n    name: 'overlay-opacity',\n    type: t.zeroOneNumber,\n    triggersBounds: diff.zeroNonZero\n  }, {\n    name: 'overlay-shape',\n    type: t.overlayShape,\n    triggersBounds: diff.any\n  }, {\n    name: 'overlay-corner-radius',\n    type: t.cornerRadius\n  }];\n  var underlay = [{\n    name: 'underlay-padding',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'underlay-color',\n    type: t.color\n  }, {\n    name: 'underlay-opacity',\n    type: t.zeroOneNumber,\n    triggersBounds: diff.zeroNonZero\n  }, {\n    name: 'underlay-shape',\n    type: t.overlayShape,\n    triggersBounds: diff.any\n  }, {\n    name: 'underlay-corner-radius',\n    type: t.cornerRadius\n  }];\n  var transition = [{\n    name: 'transition-property',\n    type: t.propList\n  }, {\n    name: 'transition-duration',\n    type: t.time\n  }, {\n    name: 'transition-delay',\n    type: t.time\n  }, {\n    name: 'transition-timing-function',\n    type: t.easing\n  }];\n  var nodeSizeHashOverride = function nodeSizeHashOverride(ele, parsedProp) {\n    if (parsedProp.value === 'label') {\n      return -ele.poolIndex(); // no hash key hits is using label size (hitrate for perf probably low anyway)\n    } else {\n      return parsedProp.pfValue;\n    }\n  };\n  var nodeBody = [{\n    name: 'height',\n    type: t.nodeSize,\n    triggersBounds: diff.any,\n    hashOverride: nodeSizeHashOverride\n  }, {\n    name: 'width',\n    type: t.nodeSize,\n    triggersBounds: diff.any,\n    hashOverride: nodeSizeHashOverride\n  }, {\n    name: 'shape',\n    type: t.nodeShape,\n    triggersBounds: diff.any\n  }, {\n    name: 'shape-polygon-points',\n    type: t.polygonPointList,\n    triggersBounds: diff.any\n  }, {\n    name: 'corner-radius',\n    type: t.cornerRadius\n  }, {\n    name: 'background-color',\n    type: t.color\n  }, {\n    name: 'background-fill',\n    type: t.fill\n  }, {\n    name: 'background-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'background-blacken',\n    type: t.nOneOneNumber\n  }, {\n    name: 'background-gradient-stop-colors',\n    type: t.colors\n  }, {\n    name: 'background-gradient-stop-positions',\n    type: t.percentages\n  }, {\n    name: 'background-gradient-direction',\n    type: t.gradientDirection\n  }, {\n    name: 'padding',\n    type: t.sizeMaybePercent,\n    triggersBounds: diff.any\n  }, {\n    name: 'padding-relative-to',\n    type: t.paddingRelativeTo,\n    triggersBounds: diff.any\n  }, {\n    name: 'bounds-expansion',\n    type: t.boundsExpansion,\n    triggersBounds: diff.any\n  }];\n  var nodeBorder = [{\n    name: 'border-color',\n    type: t.color\n  }, {\n    name: 'border-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'border-width',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'border-style',\n    type: t.borderStyle\n  }, {\n    name: 'border-cap',\n    type: t.lineCap\n  }, {\n    name: 'border-join',\n    type: t.lineJoin\n  }, {\n    name: 'border-dash-pattern',\n    type: t.numbers\n  }, {\n    name: 'border-dash-offset',\n    type: t.number\n  }, {\n    name: 'border-position',\n    type: t.linePosition\n  }];\n  var nodeOutline = [{\n    name: 'outline-color',\n    type: t.color\n  }, {\n    name: 'outline-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'outline-width',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'outline-style',\n    type: t.borderStyle\n  }, {\n    name: 'outline-offset',\n    type: t.size,\n    triggersBounds: diff.any\n  }];\n  var backgroundImage = [{\n    name: 'background-image',\n    type: t.urls\n  }, {\n    name: 'background-image-crossorigin',\n    type: t.bgCrossOrigin\n  }, {\n    name: 'background-image-opacity',\n    type: t.zeroOneNumbers\n  }, {\n    name: 'background-image-containment',\n    type: t.bgContainment\n  }, {\n    name: 'background-image-smoothing',\n    type: t.bools\n  }, {\n    name: 'background-position-x',\n    type: t.bgPos\n  }, {\n    name: 'background-position-y',\n    type: t.bgPos\n  }, {\n    name: 'background-width-relative-to',\n    type: t.bgRelativeTo\n  }, {\n    name: 'background-height-relative-to',\n    type: t.bgRelativeTo\n  }, {\n    name: 'background-repeat',\n    type: t.bgRepeat\n  }, {\n    name: 'background-fit',\n    type: t.bgFit\n  }, {\n    name: 'background-clip',\n    type: t.bgClip\n  }, {\n    name: 'background-width',\n    type: t.bgWH\n  }, {\n    name: 'background-height',\n    type: t.bgWH\n  }, {\n    name: 'background-offset-x',\n    type: t.bgPos\n  }, {\n    name: 'background-offset-y',\n    type: t.bgPos\n  }];\n  var compound = [{\n    name: 'position',\n    type: t.position,\n    triggersBounds: diff.any\n  }, {\n    name: 'compound-sizing-wrt-labels',\n    type: t.compoundIncludeLabels,\n    triggersBounds: diff.any\n  }, {\n    name: 'min-width',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'min-width-bias-left',\n    type: t.sizeMaybePercent,\n    triggersBounds: diff.any\n  }, {\n    name: 'min-width-bias-right',\n    type: t.sizeMaybePercent,\n    triggersBounds: diff.any\n  }, {\n    name: 'min-height',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'min-height-bias-top',\n    type: t.sizeMaybePercent,\n    triggersBounds: diff.any\n  }, {\n    name: 'min-height-bias-bottom',\n    type: t.sizeMaybePercent,\n    triggersBounds: diff.any\n  }];\n  var edgeLine = [{\n    name: 'line-style',\n    type: t.lineStyle\n  }, {\n    name: 'line-color',\n    type: t.color\n  }, {\n    name: 'line-fill',\n    type: t.fill\n  }, {\n    name: 'line-cap',\n    type: t.lineCap\n  }, {\n    name: 'line-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'line-dash-pattern',\n    type: t.numbers\n  }, {\n    name: 'line-dash-offset',\n    type: t.number\n  }, {\n    name: 'line-outline-width',\n    type: t.size\n  }, {\n    name: 'line-outline-color',\n    type: t.color\n  }, {\n    name: 'line-gradient-stop-colors',\n    type: t.colors\n  }, {\n    name: 'line-gradient-stop-positions',\n    type: t.percentages\n  }, {\n    name: 'curve-style',\n    type: t.curveStyle,\n    triggersBounds: diff.any,\n    triggersBoundsOfParallelEdges: function triggersBoundsOfParallelEdges(fromValue, toValue) {\n      if (fromValue === toValue) {\n        return false;\n      } // must have diff\n\n      return fromValue === 'bezier' ||\n      // remove from bundle\n      toValue === 'bezier'; // add to bundle\n    }\n  }, {\n    name: 'haystack-radius',\n    type: t.zeroOneNumber,\n    triggersBounds: diff.any\n  }, {\n    name: 'source-endpoint',\n    type: t.edgeEndpoint,\n    triggersBounds: diff.any\n  }, {\n    name: 'target-endpoint',\n    type: t.edgeEndpoint,\n    triggersBounds: diff.any\n  }, {\n    name: 'control-point-step-size',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'control-point-distances',\n    type: t.bidirectionalSizes,\n    triggersBounds: diff.any\n  }, {\n    name: 'control-point-weights',\n    type: t.numbers,\n    triggersBounds: diff.any\n  }, {\n    name: 'segment-distances',\n    type: t.bidirectionalSizes,\n    triggersBounds: diff.any\n  }, {\n    name: 'segment-weights',\n    type: t.numbers,\n    triggersBounds: diff.any\n  }, {\n    name: 'segment-radii',\n    type: t.numbers,\n    triggersBounds: diff.any\n  }, {\n    name: 'radius-type',\n    type: t.radiusType,\n    triggersBounds: diff.any\n  }, {\n    name: 'taxi-turn',\n    type: t.bidirectionalSizeMaybePercent,\n    triggersBounds: diff.any\n  }, {\n    name: 'taxi-turn-min-distance',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'taxi-direction',\n    type: t.axisDirection,\n    triggersBounds: diff.any\n  }, {\n    name: 'taxi-radius',\n    type: t.number,\n    triggersBounds: diff.any\n  }, {\n    name: 'edge-distances',\n    type: t.edgeDistances,\n    triggersBounds: diff.any\n  }, {\n    name: 'arrow-scale',\n    type: t.positiveNumber,\n    triggersBounds: diff.any\n  }, {\n    name: 'loop-direction',\n    type: t.angle,\n    triggersBounds: diff.any\n  }, {\n    name: 'loop-sweep',\n    type: t.angle,\n    triggersBounds: diff.any\n  }, {\n    name: 'source-distance-from-node',\n    type: t.size,\n    triggersBounds: diff.any\n  }, {\n    name: 'target-distance-from-node',\n    type: t.size,\n    triggersBounds: diff.any\n  }];\n  var ghost = [{\n    name: 'ghost',\n    type: t.bool,\n    triggersBounds: diff.any\n  }, {\n    name: 'ghost-offset-x',\n    type: t.bidirectionalSize,\n    triggersBounds: diff.any\n  }, {\n    name: 'ghost-offset-y',\n    type: t.bidirectionalSize,\n    triggersBounds: diff.any\n  }, {\n    name: 'ghost-opacity',\n    type: t.zeroOneNumber\n  }];\n  var core = [{\n    name: 'selection-box-color',\n    type: t.color\n  }, {\n    name: 'selection-box-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'selection-box-border-color',\n    type: t.color\n  }, {\n    name: 'selection-box-border-width',\n    type: t.size\n  }, {\n    name: 'active-bg-color',\n    type: t.color\n  }, {\n    name: 'active-bg-opacity',\n    type: t.zeroOneNumber\n  }, {\n    name: 'active-bg-size',\n    type: t.size\n  }, {\n    name: 'outside-texture-bg-color',\n    type: t.color\n  }, {\n    name: 'outside-texture-bg-opacity',\n    type: t.zeroOneNumber\n  }];\n\n  // pie backgrounds for nodes\n  var pie = [];\n  styfn$2.pieBackgroundN = 16; // because the pie properties are numbered, give access to a constant N (for renderer use)\n  pie.push({\n    name: 'pie-size',\n    type: t.sizeMaybePercent\n  });\n  pie.push({\n    name: 'pie-hole',\n    type: t.sizeMaybePercent\n  });\n  pie.push({\n    name: 'pie-start-angle',\n    type: t.angle\n  });\n  for (var i = 1; i <= styfn$2.pieBackgroundN; i++) {\n    pie.push({\n      name: 'pie-' + i + '-background-color',\n      type: t.color\n    });\n    pie.push({\n      name: 'pie-' + i + '-background-size',\n      type: t.percent\n    });\n    pie.push({\n      name: 'pie-' + i + '-background-opacity',\n      type: t.zeroOneNumber\n    });\n  }\n\n  // stripe backgrounds for nodes\n  var stripe = [];\n  styfn$2.stripeBackgroundN = 16; // because the stripe properties are numbered, give access to a constant N (for renderer use)\n  stripe.push({\n    name: 'stripe-size',\n    type: t.sizeMaybePercent\n  });\n  stripe.push({\n    name: 'stripe-direction',\n    type: t.axisDirectionPrimary\n  });\n  for (var _i = 1; _i <= styfn$2.stripeBackgroundN; _i++) {\n    stripe.push({\n      name: 'stripe-' + _i + '-background-color',\n      type: t.color\n    });\n    stripe.push({\n      name: 'stripe-' + _i + '-background-size',\n      type: t.percent\n    });\n    stripe.push({\n      name: 'stripe-' + _i + '-background-opacity',\n      type: t.zeroOneNumber\n    });\n  }\n\n  // edge arrows\n  var edgeArrow = [];\n  var arrowPrefixes = styfn$2.arrowPrefixes = ['source', 'mid-source', 'target', 'mid-target'];\n  [{\n    name: 'arrow-shape',\n    type: t.arrowShape,\n    triggersBounds: diff.any\n  }, {\n    name: 'arrow-color',\n    type: t.color\n  }, {\n    name: 'arrow-fill',\n    type: t.arrowFill\n  }, {\n    name: 'arrow-width',\n    type: t.arrowWidth\n  }].forEach(function (prop) {\n    arrowPrefixes.forEach(function (prefix) {\n      var name = prefix + '-' + prop.name;\n      var type = prop.type,\n        triggersBounds = prop.triggersBounds;\n      edgeArrow.push({\n        name: name,\n        type: type,\n        triggersBounds: triggersBounds\n      });\n    });\n  }, {});\n  var props = styfn$2.properties = [].concat(behavior, transition, visibility, overlay, underlay, ghost, commonLabel, labelDimensions, mainLabel, sourceLabel, targetLabel, nodeBody, nodeBorder, nodeOutline, backgroundImage, pie, stripe, compound, edgeLine, edgeArrow, core);\n  var propGroups = styfn$2.propertyGroups = {\n    // common to all eles\n    behavior: behavior,\n    transition: transition,\n    visibility: visibility,\n    overlay: overlay,\n    underlay: underlay,\n    ghost: ghost,\n    // labels\n    commonLabel: commonLabel,\n    labelDimensions: labelDimensions,\n    mainLabel: mainLabel,\n    sourceLabel: sourceLabel,\n    targetLabel: targetLabel,\n    // node props\n    nodeBody: nodeBody,\n    nodeBorder: nodeBorder,\n    nodeOutline: nodeOutline,\n    backgroundImage: backgroundImage,\n    pie: pie,\n    stripe: stripe,\n    compound: compound,\n    // edge props\n    edgeLine: edgeLine,\n    edgeArrow: edgeArrow,\n    core: core\n  };\n  var propGroupNames = styfn$2.propertyGroupNames = {};\n  var propGroupKeys = styfn$2.propertyGroupKeys = Object.keys(propGroups);\n  propGroupKeys.forEach(function (key) {\n    propGroupNames[key] = propGroups[key].map(function (prop) {\n      return prop.name;\n    });\n    propGroups[key].forEach(function (prop) {\n      return prop.groupKey = key;\n    });\n  });\n\n  // define aliases\n  var aliases = styfn$2.aliases = [{\n    name: 'content',\n    pointsTo: 'label'\n  }, {\n    name: 'control-point-distance',\n    pointsTo: 'control-point-distances'\n  }, {\n    name: 'control-point-weight',\n    pointsTo: 'control-point-weights'\n  }, {\n    name: 'segment-distance',\n    pointsTo: 'segment-distances'\n  }, {\n    name: 'segment-weight',\n    pointsTo: 'segment-weights'\n  }, {\n    name: 'segment-radius',\n    pointsTo: 'segment-radii'\n  }, {\n    name: 'edge-text-rotation',\n    pointsTo: 'text-rotation'\n  }, {\n    name: 'padding-left',\n    pointsTo: 'padding'\n  }, {\n    name: 'padding-right',\n    pointsTo: 'padding'\n  }, {\n    name: 'padding-top',\n    pointsTo: 'padding'\n  }, {\n    name: 'padding-bottom',\n    pointsTo: 'padding'\n  }];\n\n  // list of property names\n  styfn$2.propertyNames = props.map(function (p) {\n    return p.name;\n  });\n\n  // allow access of properties by name ( e.g. style.properties.height )\n  for (var _i2 = 0; _i2 < props.length; _i2++) {\n    var prop = props[_i2];\n    props[prop.name] = prop; // allow lookup by name\n  }\n\n  // map aliases\n  for (var _i3 = 0; _i3 < aliases.length; _i3++) {\n    var alias = aliases[_i3];\n    var pointsToProp = props[alias.pointsTo];\n    var aliasProp = {\n      name: alias.name,\n      alias: true,\n      pointsTo: pointsToProp\n    };\n\n    // add alias prop for parsing\n    props.push(aliasProp);\n    props[alias.name] = aliasProp; // allow lookup by name\n  }\n})();\nstyfn$2.getDefaultProperty = function (name) {\n  return this.getDefaultProperties()[name];\n};\nstyfn$2.getDefaultProperties = function () {\n  var _p = this._private;\n  if (_p.defaultProperties != null) {\n    return _p.defaultProperties;\n  }\n  var rawProps = extend({\n    // core props\n    'selection-box-color': '#ddd',\n    'selection-box-opacity': 0.65,\n    'selection-box-border-color': '#aaa',\n    'selection-box-border-width': 1,\n    'active-bg-color': 'black',\n    'active-bg-opacity': 0.15,\n    'active-bg-size': 30,\n    'outside-texture-bg-color': '#000',\n    'outside-texture-bg-opacity': 0.125,\n    // common node/edge props\n    'events': 'yes',\n    'text-events': 'no',\n    'text-valign': 'top',\n    'text-halign': 'center',\n    'text-justification': 'auto',\n    'line-height': 1,\n    'color': '#000',\n    'box-selection': 'contain',\n    'text-outline-color': '#000',\n    'text-outline-width': 0,\n    'text-outline-opacity': 1,\n    'text-opacity': 1,\n    'text-decoration': 'none',\n    'text-transform': 'none',\n    'text-wrap': 'none',\n    'text-overflow-wrap': 'whitespace',\n    'text-max-width': 9999,\n    'text-background-color': '#000',\n    'text-background-opacity': 0,\n    'text-background-shape': 'rectangle',\n    'text-background-padding': 0,\n    'text-border-opacity': 0,\n    'text-border-width': 0,\n    'text-border-style': 'solid',\n    'text-border-color': '#000',\n    'font-family': 'Helvetica Neue, Helvetica, sans-serif',\n    'font-style': 'normal',\n    'font-weight': 'normal',\n    'font-size': 16,\n    'min-zoomed-font-size': 0,\n    'text-rotation': 'none',\n    'source-text-rotation': 'none',\n    'target-text-rotation': 'none',\n    'visibility': 'visible',\n    'display': 'element',\n    'opacity': 1,\n    'z-compound-depth': 'auto',\n    'z-index-compare': 'auto',\n    'z-index': 0,\n    'label': '',\n    'text-margin-x': 0,\n    'text-margin-y': 0,\n    'source-label': '',\n    'source-text-offset': 0,\n    'source-text-margin-x': 0,\n    'source-text-margin-y': 0,\n    'target-label': '',\n    'target-text-offset': 0,\n    'target-text-margin-x': 0,\n    'target-text-margin-y': 0,\n    'overlay-opacity': 0,\n    'overlay-color': '#000',\n    'overlay-padding': 10,\n    'overlay-shape': 'round-rectangle',\n    'overlay-corner-radius': 'auto',\n    'underlay-opacity': 0,\n    'underlay-color': '#000',\n    'underlay-padding': 10,\n    'underlay-shape': 'round-rectangle',\n    'underlay-corner-radius': 'auto',\n    'transition-property': 'none',\n    'transition-duration': 0,\n    'transition-delay': 0,\n    'transition-timing-function': 'linear',\n    'box-select-labels': 'no',\n    // node props\n    'background-blacken': 0,\n    'background-color': '#999',\n    'background-fill': 'solid',\n    'background-opacity': 1,\n    'background-image': 'none',\n    'background-image-crossorigin': 'anonymous',\n    'background-image-opacity': 1,\n    'background-image-containment': 'inside',\n    'background-image-smoothing': 'yes',\n    'background-position-x': '50%',\n    'background-position-y': '50%',\n    'background-offset-x': 0,\n    'background-offset-y': 0,\n    'background-width-relative-to': 'include-padding',\n    'background-height-relative-to': 'include-padding',\n    'background-repeat': 'no-repeat',\n    'background-fit': 'none',\n    'background-clip': 'node',\n    'background-width': 'auto',\n    'background-height': 'auto',\n    'border-color': '#000',\n    'border-opacity': 1,\n    'border-width': 0,\n    'border-style': 'solid',\n    'border-dash-pattern': [4, 2],\n    'border-dash-offset': 0,\n    'border-cap': 'butt',\n    'border-join': 'miter',\n    'border-position': 'center',\n    'outline-color': '#999',\n    'outline-opacity': 1,\n    'outline-width': 0,\n    'outline-offset': 0,\n    'outline-style': 'solid',\n    'height': 30,\n    'width': 30,\n    'shape': 'ellipse',\n    'shape-polygon-points': '-1, -1,   1, -1,   1, 1,   -1, 1',\n    'corner-radius': 'auto',\n    'bounds-expansion': 0,\n    // node gradient\n    'background-gradient-direction': 'to-bottom',\n    'background-gradient-stop-colors': '#999',\n    'background-gradient-stop-positions': '0%',\n    // ghost props\n    'ghost': 'no',\n    'ghost-offset-y': 0,\n    'ghost-offset-x': 0,\n    'ghost-opacity': 0,\n    // compound props\n    'padding': 0,\n    'padding-relative-to': 'width',\n    'position': 'origin',\n    'compound-sizing-wrt-labels': 'include',\n    'min-width': 0,\n    'min-width-bias-left': 0,\n    'min-width-bias-right': 0,\n    'min-height': 0,\n    'min-height-bias-top': 0,\n    'min-height-bias-bottom': 0\n  }, {\n    // node pie bg\n    'pie-size': '100%',\n    'pie-hole': 0,\n    'pie-start-angle': '0deg'\n  }, [{\n    name: 'pie-{{i}}-background-color',\n    value: 'black'\n  }, {\n    name: 'pie-{{i}}-background-size',\n    value: '0%'\n  }, {\n    name: 'pie-{{i}}-background-opacity',\n    value: 1\n  }].reduce(function (css, prop) {\n    for (var i = 1; i <= styfn$2.pieBackgroundN; i++) {\n      var name = prop.name.replace('{{i}}', i);\n      var val = prop.value;\n      css[name] = val;\n    }\n    return css;\n  }, {}), {\n    // node stripes bg\n    'stripe-size': '100%',\n    'stripe-direction': 'horizontal'\n  }, [{\n    name: 'stripe-{{i}}-background-color',\n    value: 'black'\n  }, {\n    name: 'stripe-{{i}}-background-size',\n    value: '0%'\n  }, {\n    name: 'stripe-{{i}}-background-opacity',\n    value: 1\n  }].reduce(function (css, prop) {\n    for (var i = 1; i <= styfn$2.stripeBackgroundN; i++) {\n      var name = prop.name.replace('{{i}}', i);\n      var val = prop.value;\n      css[name] = val;\n    }\n    return css;\n  }, {}), {\n    // edge props\n    'line-style': 'solid',\n    'line-color': '#999',\n    'line-fill': 'solid',\n    'line-cap': 'butt',\n    'line-opacity': 1,\n    'line-outline-width': 0,\n    'line-outline-color': '#000',\n    'line-gradient-stop-colors': '#999',\n    'line-gradient-stop-positions': '0%',\n    'control-point-step-size': 40,\n    'control-point-weights': 0.5,\n    'segment-weights': 0.5,\n    'segment-distances': 20,\n    'segment-radii': 15,\n    'radius-type': 'arc-radius',\n    'taxi-turn': '50%',\n    'taxi-radius': 15,\n    'taxi-turn-min-distance': 10,\n    'taxi-direction': 'auto',\n    'edge-distances': 'intersection',\n    'curve-style': 'haystack',\n    'haystack-radius': 0,\n    'arrow-scale': 1,\n    'loop-direction': '-45deg',\n    'loop-sweep': '-90deg',\n    'source-distance-from-node': 0,\n    'target-distance-from-node': 0,\n    'source-endpoint': 'outside-to-node',\n    'target-endpoint': 'outside-to-node',\n    'line-dash-pattern': [6, 3],\n    'line-dash-offset': 0\n  }, [{\n    name: 'arrow-shape',\n    value: 'none'\n  }, {\n    name: 'arrow-color',\n    value: '#999'\n  }, {\n    name: 'arrow-fill',\n    value: 'filled'\n  }, {\n    name: 'arrow-width',\n    value: 1\n  }].reduce(function (css, prop) {\n    styfn$2.arrowPrefixes.forEach(function (prefix) {\n      var name = prefix + '-' + prop.name;\n      var val = prop.value;\n      css[name] = val;\n    });\n    return css;\n  }, {}));\n  var parsedProps = {};\n  for (var i = 0; i < this.properties.length; i++) {\n    var prop = this.properties[i];\n    if (prop.pointsTo) {\n      continue;\n    }\n    var name = prop.name;\n    var val = rawProps[name];\n    var parsedProp = this.parse(name, val);\n    parsedProps[name] = parsedProp;\n  }\n  _p.defaultProperties = parsedProps;\n  return _p.defaultProperties;\n};\nstyfn$2.addDefaultStylesheet = function () {\n  this.selector(':parent').css({\n    'shape': 'rectangle',\n    'padding': 10,\n    'background-color': '#eee',\n    'border-color': '#ccc',\n    'border-width': 1\n  }).selector('edge').css({\n    'width': 3\n  }).selector(':loop').css({\n    'curve-style': 'bezier'\n  }).selector('edge:compound').css({\n    'curve-style': 'bezier',\n    'source-endpoint': 'outside-to-line',\n    'target-endpoint': 'outside-to-line'\n  }).selector(':selected').css({\n    'background-color': '#0169D9',\n    'line-color': '#0169D9',\n    'source-arrow-color': '#0169D9',\n    'target-arrow-color': '#0169D9',\n    'mid-source-arrow-color': '#0169D9',\n    'mid-target-arrow-color': '#0169D9'\n  }).selector(':parent:selected').css({\n    'background-color': '#CCE1F9',\n    'border-color': '#aec8e5'\n  }).selector(':active').css({\n    'overlay-color': 'black',\n    'overlay-padding': 10,\n    'overlay-opacity': 0.25\n  });\n  this.defaultLength = this.length;\n};\n\nvar styfn$1 = {};\n\n// a caching layer for property parsing\nstyfn$1.parse = function (name, value, propIsBypass, propIsFlat) {\n  var self = this;\n\n  // function values can't be cached in all cases, and there isn't much benefit of caching them anyway\n  if (fn$6(value)) {\n    return self.parseImplWarn(name, value, propIsBypass, propIsFlat);\n  }\n  var flatKey = propIsFlat === 'mapping' || propIsFlat === true || propIsFlat === false || propIsFlat == null ? 'dontcare' : propIsFlat;\n  var bypassKey = propIsBypass ? 't' : 'f';\n  var valueKey = '' + value;\n  var argHash = hashStrings(name, valueKey, bypassKey, flatKey);\n  var propCache = self.propCache = self.propCache || [];\n  var ret;\n  if (!(ret = propCache[argHash])) {\n    ret = propCache[argHash] = self.parseImplWarn(name, value, propIsBypass, propIsFlat);\n  }\n\n  // - bypasses can't be shared b/c the value can be changed by animations or otherwise overridden\n  // - mappings can't be shared b/c mappings are per-element\n  if (propIsBypass || propIsFlat === 'mapping') {\n    // need a copy since props are mutated later in their lifecycles\n    ret = copy(ret);\n    if (ret) {\n      ret.value = copy(ret.value); // because it could be an array, e.g. colour\n    }\n  }\n  return ret;\n};\nstyfn$1.parseImplWarn = function (name, value, propIsBypass, propIsFlat) {\n  var prop = this.parseImpl(name, value, propIsBypass, propIsFlat);\n  if (!prop && value != null) {\n    warn(\"The style property `\".concat(name, \": \").concat(value, \"` is invalid\"));\n  }\n  if (prop && (prop.name === 'width' || prop.name === 'height') && value === 'label') {\n    warn('The style value of `label` is deprecated for `' + prop.name + '`');\n  }\n  return prop;\n};\n\n// parse a property; return null on invalid; return parsed property otherwise\n// fields :\n// - name : the name of the property\n// - value : the parsed, native-typed value of the property\n// - strValue : a string value that represents the property value in valid css\n// - bypass : true iff the property is a bypass property\nstyfn$1.parseImpl = function (name, value, propIsBypass, propIsFlat) {\n  var self = this;\n  name = camel2dash(name); // make sure the property name is in dash form (e.g. 'property-name' not 'propertyName')\n\n  var property = self.properties[name];\n  var passedValue = value;\n  var types = self.types;\n  if (!property) {\n    return null;\n  } // return null on property of unknown name\n  if (value === undefined) {\n    return null;\n  } // can't assign undefined\n\n  // the property may be an alias\n  if (property.alias) {\n    property = property.pointsTo;\n    name = property.name;\n  }\n  var valueIsString = string(value);\n  if (valueIsString) {\n    // trim the value to make parsing easier\n    value = value.trim();\n  }\n  var type = property.type;\n  if (!type) {\n    return null;\n  } // no type, no luck\n\n  // check if bypass is null or empty string (i.e. indication to delete bypass property)\n  if (propIsBypass && (value === '' || value === null)) {\n    return {\n      name: name,\n      value: value,\n      bypass: true,\n      deleteBypass: true\n    };\n  }\n\n  // check if value is a function used as a mapper\n  if (fn$6(value)) {\n    return {\n      name: name,\n      value: value,\n      strValue: 'fn',\n      mapped: types.fn,\n      bypass: propIsBypass\n    };\n  }\n\n  // check if value is mapped\n  var data, mapData;\n  if (!valueIsString || propIsFlat || value.length < 7 || value[1] !== 'a') ; else if (value.length >= 7 && value[0] === 'd' && (data = new RegExp(types.data.regex).exec(value))) {\n    if (propIsBypass) {\n      return false;\n    } // mappers not allowed in bypass\n\n    var mapped = types.data;\n    return {\n      name: name,\n      value: data,\n      strValue: '' + value,\n      mapped: mapped,\n      field: data[1],\n      bypass: propIsBypass\n    };\n  } else if (value.length >= 10 && value[0] === 'm' && (mapData = new RegExp(types.mapData.regex).exec(value))) {\n    if (propIsBypass) {\n      return false;\n    } // mappers not allowed in bypass\n    if (type.multiple) {\n      return false;\n    } // impossible to map to num\n\n    var _mapped = types.mapData;\n\n    // we can map only if the type is a colour or a number\n    if (!(type.color || type.number)) {\n      return false;\n    }\n    var valueMin = this.parse(name, mapData[4]); // parse to validate\n    if (!valueMin || valueMin.mapped) {\n      return false;\n    } // can't be invalid or mapped\n\n    var valueMax = this.parse(name, mapData[5]); // parse to validate\n    if (!valueMax || valueMax.mapped) {\n      return false;\n    } // can't be invalid or mapped\n\n    // check if valueMin and valueMax are the same\n    if (valueMin.pfValue === valueMax.pfValue || valueMin.strValue === valueMax.strValue) {\n      warn('`' + name + ': ' + value + '` is not a valid mapper because the output range is zero; converting to `' + name + ': ' + valueMin.strValue + '`');\n      return this.parse(name, valueMin.strValue); // can't make much of a mapper without a range\n    } else if (type.color) {\n      var c1 = valueMin.value;\n      var c2 = valueMax.value;\n      var same = c1[0] === c2[0] // red\n      && c1[1] === c2[1] // green\n      && c1[2] === c2[2] // blue\n      && (\n      // optional alpha\n      c1[3] === c2[3] // same alpha outright\n      || (c1[3] == null || c1[3] === 1 // full opacity for colour 1?\n      ) && (c2[3] == null || c2[3] === 1) // full opacity for colour 2?\n      );\n      if (same) {\n        return false;\n      } // can't make a mapper without a range\n    }\n    return {\n      name: name,\n      value: mapData,\n      strValue: '' + value,\n      mapped: _mapped,\n      field: mapData[1],\n      fieldMin: parseFloat(mapData[2]),\n      // min & max are numeric\n      fieldMax: parseFloat(mapData[3]),\n      valueMin: valueMin.value,\n      valueMax: valueMax.value,\n      bypass: propIsBypass\n    };\n  }\n  if (type.multiple && propIsFlat !== 'multiple') {\n    var vals;\n    if (valueIsString) {\n      vals = value.split(/\\s+/);\n    } else if (array(value)) {\n      vals = value;\n    } else {\n      vals = [value];\n    }\n    if (type.evenMultiple && vals.length % 2 !== 0) {\n      return null;\n    }\n    var valArr = [];\n    var unitsArr = [];\n    var pfValArr = [];\n    var strVal = '';\n    var hasEnum = false;\n    for (var i = 0; i < vals.length; i++) {\n      var p = self.parse(name, vals[i], propIsBypass, 'multiple');\n      hasEnum = hasEnum || string(p.value);\n      valArr.push(p.value);\n      pfValArr.push(p.pfValue != null ? p.pfValue : p.value);\n      unitsArr.push(p.units);\n      strVal += (i > 0 ? ' ' : '') + p.strValue;\n    }\n    if (type.validate && !type.validate(valArr, unitsArr)) {\n      return null;\n    }\n    if (type.singleEnum && hasEnum) {\n      if (valArr.length === 1 && string(valArr[0])) {\n        return {\n          name: name,\n          value: valArr[0],\n          strValue: valArr[0],\n          bypass: propIsBypass\n        };\n      } else {\n        return null;\n      }\n    }\n    return {\n      name: name,\n      value: valArr,\n      pfValue: pfValArr,\n      strValue: strVal,\n      bypass: propIsBypass,\n      units: unitsArr\n    };\n  }\n\n  // several types also allow enums\n  var checkEnums = function checkEnums() {\n    for (var _i = 0; _i < type.enums.length; _i++) {\n      var en = type.enums[_i];\n      if (en === value) {\n        return {\n          name: name,\n          value: value,\n          strValue: '' + value,\n          bypass: propIsBypass\n        };\n      }\n    }\n    return null;\n  };\n\n  // check the type and return the appropriate object\n  if (type.number) {\n    var units;\n    var implicitUnits = 'px'; // not set => px\n\n    if (type.units) {\n      // use specified units if set\n      units = type.units;\n    }\n    if (type.implicitUnits) {\n      implicitUnits = type.implicitUnits;\n    }\n    if (!type.unitless) {\n      if (valueIsString) {\n        var unitsRegex = 'px|em' + (type.allowPercent ? '|\\\\%' : '');\n        if (units) {\n          unitsRegex = units;\n        } // only allow explicit units if so set\n        var match = value.match('^(' + number + ')(' + unitsRegex + ')?' + '$');\n        if (match) {\n          value = match[1];\n          units = match[2] || implicitUnits;\n        }\n      } else if (!units || type.implicitUnits) {\n        units = implicitUnits; // implicitly px if unspecified\n      }\n    }\n    value = parseFloat(value);\n\n    // if not a number and enums not allowed, then the value is invalid\n    if (isNaN(value) && type.enums === undefined) {\n      return null;\n    }\n\n    // check if this number type also accepts special keywords in place of numbers\n    // (i.e. `left`, `auto`, etc)\n    if (isNaN(value) && type.enums !== undefined) {\n      value = passedValue;\n      return checkEnums();\n    }\n\n    // check if value must be an integer\n    if (type.integer && !integer(value)) {\n      return null;\n    }\n\n    // check value is within range\n    if (type.min !== undefined && (value < type.min || type.strictMin && value === type.min) || type.max !== undefined && (value > type.max || type.strictMax && value === type.max)) {\n      return null;\n    }\n    var ret = {\n      name: name,\n      value: value,\n      strValue: '' + value + (units ? units : ''),\n      units: units,\n      bypass: propIsBypass\n    };\n\n    // normalise value in pixels\n    if (type.unitless || units !== 'px' && units !== 'em') {\n      ret.pfValue = value;\n    } else {\n      ret.pfValue = units === 'px' || !units ? value : this.getEmSizeInPixels() * value;\n    }\n\n    // normalise value in ms\n    if (units === 'ms' || units === 's') {\n      ret.pfValue = units === 'ms' ? value : 1000 * value;\n    }\n\n    // normalise value in rad\n    if (units === 'deg' || units === 'rad') {\n      ret.pfValue = units === 'rad' ? value : deg2rad(value);\n    }\n\n    // normalize value in %\n    if (units === '%') {\n      ret.pfValue = value / 100;\n    }\n    return ret;\n  } else if (type.propList) {\n    var props = [];\n    var propsStr = '' + value;\n    if (propsStr === 'none') ; else {\n      // go over each prop\n\n      var propsSplit = propsStr.split(/\\s*,\\s*|\\s+/);\n      for (var _i2 = 0; _i2 < propsSplit.length; _i2++) {\n        var propName = propsSplit[_i2].trim();\n        if (self.properties[propName]) {\n          props.push(propName);\n        } else {\n          warn('`' + propName + '` is not a valid property name');\n        }\n      }\n      if (props.length === 0) {\n        return null;\n      }\n    }\n    return {\n      name: name,\n      value: props,\n      strValue: props.length === 0 ? 'none' : props.join(' '),\n      bypass: propIsBypass\n    };\n  } else if (type.color) {\n    var tuple = color2tuple(value);\n    if (!tuple) {\n      return null;\n    }\n    return {\n      name: name,\n      value: tuple,\n      pfValue: tuple,\n      strValue: 'rgb(' + tuple[0] + ',' + tuple[1] + ',' + tuple[2] + ')',\n      // n.b. no spaces b/c of multiple support\n      bypass: propIsBypass\n    };\n  } else if (type.regex || type.regexes) {\n    // first check enums\n    if (type.enums) {\n      var enumProp = checkEnums();\n      if (enumProp) {\n        return enumProp;\n      }\n    }\n    var regexes = type.regexes ? type.regexes : [type.regex];\n    for (var _i3 = 0; _i3 < regexes.length; _i3++) {\n      var regex = new RegExp(regexes[_i3]); // make a regex from the type string\n      var m = regex.exec(value);\n      if (m) {\n        // regex matches\n        return {\n          name: name,\n          value: type.singleRegexMatchValue ? m[1] : m,\n          strValue: '' + value,\n          bypass: propIsBypass\n        };\n      }\n    }\n    return null; // didn't match any\n  } else if (type.string) {\n    // just return\n    return {\n      name: name,\n      value: '' + value,\n      strValue: '' + value,\n      bypass: propIsBypass\n    };\n  } else if (type.enums) {\n    // check enums last because it's a combo type in others\n    return checkEnums();\n  } else {\n    return null; // not a type we can handle\n  }\n};\n\nvar _Style = function Style(cy) {\n  if (!(this instanceof _Style)) {\n    return new _Style(cy);\n  }\n  if (!core(cy)) {\n    error('A style must have a core reference');\n    return;\n  }\n  this._private = {\n    cy: cy,\n    coreStyle: {}\n  };\n  this.length = 0;\n  this.resetToDefault();\n};\nvar styfn = _Style.prototype;\nstyfn.instanceString = function () {\n  return 'style';\n};\n\n// remove all contexts\nstyfn.clear = function () {\n  var _p = this._private;\n  var cy = _p.cy;\n  var eles = cy.elements();\n  for (var i = 0; i < this.length; i++) {\n    this[i] = undefined;\n  }\n  this.length = 0;\n  _p.contextStyles = {};\n  _p.propDiffs = {};\n  this.cleanElements(eles, true);\n  eles.forEach(function (ele) {\n    var ele_p = ele[0]._private;\n    ele_p.styleDirty = true;\n    ele_p.appliedInitStyle = false;\n  });\n  return this; // chaining\n};\nstyfn.resetToDefault = function () {\n  this.clear();\n  this.addDefaultStylesheet();\n  return this;\n};\n\n// builds a style object for the 'core' selector\nstyfn.core = function (propName) {\n  return this._private.coreStyle[propName] || this.getDefaultProperty(propName);\n};\n\n// create a new context from the specified selector string and switch to that context\nstyfn.selector = function (selectorStr) {\n  // 'core' is a special case and does not need a selector\n  var selector = selectorStr === 'core' ? null : new Selector(selectorStr);\n  var i = this.length++; // new context means new index\n  this[i] = {\n    selector: selector,\n    properties: [],\n    mappedProperties: [],\n    index: i\n  };\n  return this; // chaining\n};\n\n// add one or many css rules to the current context\nstyfn.css = function () {\n  var self = this;\n  var args = arguments;\n  if (args.length === 1) {\n    var map = args[0];\n    for (var i = 0; i < self.properties.length; i++) {\n      var prop = self.properties[i];\n      var mapVal = map[prop.name];\n      if (mapVal === undefined) {\n        mapVal = map[dash2camel(prop.name)];\n      }\n      if (mapVal !== undefined) {\n        this.cssRule(prop.name, mapVal);\n      }\n    }\n  } else if (args.length === 2) {\n    this.cssRule(args[0], args[1]);\n  }\n\n  // do nothing if args are invalid\n\n  return this; // chaining\n};\nstyfn.style = styfn.css;\n\n// add a single css rule to the current context\nstyfn.cssRule = function (name, value) {\n  // name-value pair\n  var property = this.parse(name, value);\n\n  // add property to current context if valid\n  if (property) {\n    var i = this.length - 1;\n    this[i].properties.push(property);\n    this[i].properties[property.name] = property; // allow access by name as well\n\n    if (property.name.match(/pie-(\\d+)-background-size/) && property.value) {\n      this._private.hasPie = true;\n    }\n    if (property.name.match(/stripe-(\\d+)-background-size/) && property.value) {\n      this._private.hasStripe = true;\n    }\n    if (property.mapped) {\n      this[i].mappedProperties.push(property);\n    }\n\n    // add to core style if necessary\n    var currentSelectorIsCore = !this[i].selector;\n    if (currentSelectorIsCore) {\n      this._private.coreStyle[property.name] = property;\n    }\n  }\n  return this; // chaining\n};\nstyfn.append = function (style) {\n  if (stylesheet(style)) {\n    style.appendToStyle(this);\n  } else if (array(style)) {\n    this.appendFromJson(style);\n  } else if (string(style)) {\n    this.appendFromString(style);\n  } // you probably wouldn't want to append a Style, since you'd duplicate the default parts\n\n  return this;\n};\n\n// static function\n_Style.fromJson = function (cy, json) {\n  var style = new _Style(cy);\n  style.fromJson(json);\n  return style;\n};\n_Style.fromString = function (cy, string) {\n  return new _Style(cy).fromString(string);\n};\n[styfn$8, styfn$7, styfn$6, styfn$5, styfn$4, styfn$3, styfn$2, styfn$1].forEach(function (props) {\n  extend(styfn, props);\n});\n_Style.types = styfn.types;\n_Style.properties = styfn.properties;\n_Style.propertyGroups = styfn.propertyGroups;\n_Style.propertyGroupNames = styfn.propertyGroupNames;\n_Style.propertyGroupKeys = styfn.propertyGroupKeys;\n\nvar corefn$2 = {\n  style: function style(newStyle) {\n    if (newStyle) {\n      var s = this.setStyle(newStyle);\n      s.update();\n    }\n    return this._private.style;\n  },\n  setStyle: function setStyle(style) {\n    var _p = this._private;\n    if (stylesheet(style)) {\n      _p.style = style.generateStyle(this);\n    } else if (array(style)) {\n      _p.style = _Style.fromJson(this, style);\n    } else if (string(style)) {\n      _p.style = _Style.fromString(this, style);\n    } else {\n      _p.style = _Style(this);\n    }\n    return _p.style;\n  },\n  // e.g. cy.data() changed => recalc ele mappers\n  updateStyle: function updateStyle() {\n    this.mutableElements().updateStyle(); // just send to all eles\n  }\n};\n\nvar defaultSelectionType = 'single';\nvar corefn$1 = {\n  autolock: function autolock(bool) {\n    if (bool !== undefined) {\n      this._private.autolock = bool ? true : false;\n    } else {\n      return this._private.autolock;\n    }\n    return this; // chaining\n  },\n  autoungrabify: function autoungrabify(bool) {\n    if (bool !== undefined) {\n      this._private.autoungrabify = bool ? true : false;\n    } else {\n      return this._private.autoungrabify;\n    }\n    return this; // chaining\n  },\n  autounselectify: function autounselectify(bool) {\n    if (bool !== undefined) {\n      this._private.autounselectify = bool ? true : false;\n    } else {\n      return this._private.autounselectify;\n    }\n    return this; // chaining\n  },\n  selectionType: function selectionType(selType) {\n    var _p = this._private;\n    if (_p.selectionType == null) {\n      _p.selectionType = defaultSelectionType;\n    }\n    if (selType !== undefined) {\n      if (selType === 'additive' || selType === 'single') {\n        _p.selectionType = selType;\n      }\n    } else {\n      return _p.selectionType;\n    }\n    return this;\n  },\n  panningEnabled: function panningEnabled(bool) {\n    if (bool !== undefined) {\n      this._private.panningEnabled = bool ? true : false;\n    } else {\n      return this._private.panningEnabled;\n    }\n    return this; // chaining\n  },\n  userPanningEnabled: function userPanningEnabled(bool) {\n    if (bool !== undefined) {\n      this._private.userPanningEnabled = bool ? true : false;\n    } else {\n      return this._private.userPanningEnabled;\n    }\n    return this; // chaining\n  },\n  zoomingEnabled: function zoomingEnabled(bool) {\n    if (bool !== undefined) {\n      this._private.zoomingEnabled = bool ? true : false;\n    } else {\n      return this._private.zoomingEnabled;\n    }\n    return this; // chaining\n  },\n  userZoomingEnabled: function userZoomingEnabled(bool) {\n    if (bool !== undefined) {\n      this._private.userZoomingEnabled = bool ? true : false;\n    } else {\n      return this._private.userZoomingEnabled;\n    }\n    return this; // chaining\n  },\n  boxSelectionEnabled: function boxSelectionEnabled(bool) {\n    if (bool !== undefined) {\n      this._private.boxSelectionEnabled = bool ? true : false;\n    } else {\n      return this._private.boxSelectionEnabled;\n    }\n    return this; // chaining\n  },\n  pan: function pan() {\n    var args = arguments;\n    var pan = this._private.pan;\n    var dim, val, dims, x, y;\n    switch (args.length) {\n      case 0:\n        // .pan()\n        return pan;\n      case 1:\n        if (string(args[0])) {\n          // .pan('x')\n          dim = args[0];\n          return pan[dim];\n        } else if (plainObject(args[0])) {\n          // .pan({ x: 0, y: 100 })\n          if (!this._private.panningEnabled) {\n            return this;\n          }\n          dims = args[0];\n          x = dims.x;\n          y = dims.y;\n          if (number$1(x)) {\n            pan.x = x;\n          }\n          if (number$1(y)) {\n            pan.y = y;\n          }\n          this.emit('pan viewport');\n        }\n        break;\n      case 2:\n        // .pan('x', 100)\n        if (!this._private.panningEnabled) {\n          return this;\n        }\n        dim = args[0];\n        val = args[1];\n        if ((dim === 'x' || dim === 'y') && number$1(val)) {\n          pan[dim] = val;\n        }\n        this.emit('pan viewport');\n        break;\n      // invalid\n    }\n    this.notify('viewport');\n    return this; // chaining\n  },\n  panBy: function panBy(arg0, arg1) {\n    var args = arguments;\n    var pan = this._private.pan;\n    var dim, val, dims, x, y;\n    if (!this._private.panningEnabled) {\n      return this;\n    }\n    switch (args.length) {\n      case 1:\n        if (plainObject(arg0)) {\n          // .panBy({ x: 0, y: 100 })\n          dims = args[0];\n          x = dims.x;\n          y = dims.y;\n          if (number$1(x)) {\n            pan.x += x;\n          }\n          if (number$1(y)) {\n            pan.y += y;\n          }\n          this.emit('pan viewport');\n        }\n        break;\n      case 2:\n        // .panBy('x', 100)\n        dim = arg0;\n        val = arg1;\n        if ((dim === 'x' || dim === 'y') && number$1(val)) {\n          pan[dim] += val;\n        }\n        this.emit('pan viewport');\n        break;\n      // invalid\n    }\n    this.notify('viewport');\n    return this; // chaining\n  },\n  gc: function gc() {\n    this.notify('gc');\n  },\n  fit: function fit(elements, padding) {\n    var viewportState = this.getFitViewport(elements, padding);\n    if (viewportState) {\n      var _p = this._private;\n      _p.zoom = viewportState.zoom;\n      _p.pan = viewportState.pan;\n      this.emit('pan zoom viewport');\n      this.notify('viewport');\n    }\n    return this; // chaining\n  },\n  getFitViewport: function getFitViewport(elements, padding) {\n    if (number$1(elements) && padding === undefined) {\n      // elements is optional\n      padding = elements;\n      elements = undefined;\n    }\n    if (!this._private.panningEnabled || !this._private.zoomingEnabled) {\n      return;\n    }\n    var bb;\n    if (string(elements)) {\n      var sel = elements;\n      elements = this.$(sel);\n    } else if (boundingBox(elements)) {\n      // assume bb\n      var bbe = elements;\n      bb = {\n        x1: bbe.x1,\n        y1: bbe.y1,\n        x2: bbe.x2,\n        y2: bbe.y2\n      };\n      bb.w = bb.x2 - bb.x1;\n      bb.h = bb.y2 - bb.y1;\n    } else if (!elementOrCollection(elements)) {\n      elements = this.mutableElements();\n    }\n    if (elementOrCollection(elements) && elements.empty()) {\n      return;\n    } // can't fit to nothing\n\n    bb = bb || elements.boundingBox();\n    var w = this.width();\n    var h = this.height();\n    var zoom;\n    padding = number$1(padding) ? padding : 0;\n    if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) {\n      zoom = Math.min((w - 2 * padding) / bb.w, (h - 2 * padding) / bb.h);\n\n      // crop zoom\n      zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom;\n      zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom;\n      var pan = {\n        // now pan to middle\n        x: (w - zoom * (bb.x1 + bb.x2)) / 2,\n        y: (h - zoom * (bb.y1 + bb.y2)) / 2\n      };\n      return {\n        zoom: zoom,\n        pan: pan\n      };\n    }\n    return;\n  },\n  zoomRange: function zoomRange(min, max) {\n    var _p = this._private;\n    if (max == null) {\n      var opts = min;\n      min = opts.min;\n      max = opts.max;\n    }\n    if (number$1(min) && number$1(max) && min <= max) {\n      _p.minZoom = min;\n      _p.maxZoom = max;\n    } else if (number$1(min) && max === undefined && min <= _p.maxZoom) {\n      _p.minZoom = min;\n    } else if (number$1(max) && min === undefined && max >= _p.minZoom) {\n      _p.maxZoom = max;\n    }\n    return this;\n  },\n  minZoom: function minZoom(zoom) {\n    if (zoom === undefined) {\n      return this._private.minZoom;\n    } else {\n      return this.zoomRange({\n        min: zoom\n      });\n    }\n  },\n  maxZoom: function maxZoom(zoom) {\n    if (zoom === undefined) {\n      return this._private.maxZoom;\n    } else {\n      return this.zoomRange({\n        max: zoom\n      });\n    }\n  },\n  getZoomedViewport: function getZoomedViewport(params) {\n    var _p = this._private;\n    var currentPan = _p.pan;\n    var currentZoom = _p.zoom;\n    var pos; // in rendered px\n    var zoom;\n    var bail = false;\n    if (!_p.zoomingEnabled) {\n      // zooming disabled\n      bail = true;\n    }\n    if (number$1(params)) {\n      // then set the zoom\n      zoom = params;\n    } else if (plainObject(params)) {\n      // then zoom about a point\n      zoom = params.level;\n      if (params.position != null) {\n        pos = modelToRenderedPosition$1(params.position, currentZoom, currentPan);\n      } else if (params.renderedPosition != null) {\n        pos = params.renderedPosition;\n      }\n      if (pos != null && !_p.panningEnabled) {\n        // panning disabled\n        bail = true;\n      }\n    }\n\n    // crop zoom\n    zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom;\n    zoom = zoom < _p.minZoom ? _p.minZoom : zoom;\n\n    // can't zoom with invalid params\n    if (bail || !number$1(zoom) || zoom === currentZoom || pos != null && (!number$1(pos.x) || !number$1(pos.y))) {\n      return null;\n    }\n    if (pos != null) {\n      // set zoom about position\n      var pan1 = currentPan;\n      var zoom1 = currentZoom;\n      var zoom2 = zoom;\n      var pan2 = {\n        x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x,\n        y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y\n      };\n      return {\n        zoomed: true,\n        panned: true,\n        zoom: zoom2,\n        pan: pan2\n      };\n    } else {\n      // just set the zoom\n      return {\n        zoomed: true,\n        panned: false,\n        zoom: zoom,\n        pan: currentPan\n      };\n    }\n  },\n  zoom: function zoom(params) {\n    if (params === undefined) {\n      // get\n      return this._private.zoom;\n    } else {\n      // set\n      var vp = this.getZoomedViewport(params);\n      var _p = this._private;\n      if (vp == null || !vp.zoomed) {\n        return this;\n      }\n      _p.zoom = vp.zoom;\n      if (vp.panned) {\n        _p.pan.x = vp.pan.x;\n        _p.pan.y = vp.pan.y;\n      }\n      this.emit('zoom' + (vp.panned ? ' pan' : '') + ' viewport');\n      this.notify('viewport');\n      return this; // chaining\n    }\n  },\n  viewport: function viewport(opts) {\n    var _p = this._private;\n    var zoomDefd = true;\n    var panDefd = true;\n    var events = []; // to trigger\n    var zoomFailed = false;\n    var panFailed = false;\n    if (!opts) {\n      return this;\n    }\n    if (!number$1(opts.zoom)) {\n      zoomDefd = false;\n    }\n    if (!plainObject(opts.pan)) {\n      panDefd = false;\n    }\n    if (!zoomDefd && !panDefd) {\n      return this;\n    }\n    if (zoomDefd) {\n      var z = opts.zoom;\n      if (z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled) {\n        zoomFailed = true;\n      } else {\n        _p.zoom = z;\n        events.push('zoom');\n      }\n    }\n    if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) {\n      var p = opts.pan;\n      if (number$1(p.x)) {\n        _p.pan.x = p.x;\n        panFailed = false;\n      }\n      if (number$1(p.y)) {\n        _p.pan.y = p.y;\n        panFailed = false;\n      }\n      if (!panFailed) {\n        events.push('pan');\n      }\n    }\n    if (events.length > 0) {\n      events.push('viewport');\n      this.emit(events.join(' '));\n      this.notify('viewport');\n    }\n    return this; // chaining\n  },\n  center: function center(elements) {\n    var pan = this.getCenterPan(elements);\n    if (pan) {\n      this._private.pan = pan;\n      this.emit('pan viewport');\n      this.notify('viewport');\n    }\n    return this; // chaining\n  },\n  getCenterPan: function getCenterPan(elements, zoom) {\n    if (!this._private.panningEnabled) {\n      return;\n    }\n    if (string(elements)) {\n      var selector = elements;\n      elements = this.mutableElements().filter(selector);\n    } else if (!elementOrCollection(elements)) {\n      elements = this.mutableElements();\n    }\n    if (elements.length === 0) {\n      return;\n    } // can't centre pan to nothing\n\n    var bb = elements.boundingBox();\n    var w = this.width();\n    var h = this.height();\n    zoom = zoom === undefined ? this._private.zoom : zoom;\n    var pan = {\n      // middle\n      x: (w - zoom * (bb.x1 + bb.x2)) / 2,\n      y: (h - zoom * (bb.y1 + bb.y2)) / 2\n    };\n    return pan;\n  },\n  reset: function reset() {\n    if (!this._private.panningEnabled || !this._private.zoomingEnabled) {\n      return this;\n    }\n    this.viewport({\n      pan: {\n        x: 0,\n        y: 0\n      },\n      zoom: 1\n    });\n    return this; // chaining\n  },\n  invalidateSize: function invalidateSize() {\n    this._private.sizeCache = null;\n  },\n  size: function size() {\n    var _p = this._private;\n    var container = _p.container;\n    var cy = this;\n    return _p.sizeCache = _p.sizeCache || (container ? function () {\n      var style = cy.window().getComputedStyle(container);\n      var val = function val(name) {\n        return parseFloat(style.getPropertyValue(name));\n      };\n      return {\n        width: container.clientWidth - val('padding-left') - val('padding-right'),\n        height: container.clientHeight - val('padding-top') - val('padding-bottom')\n      };\n    }() : {\n      // fallback if no container (not 0 b/c can be used for dividing etc)\n      width: 1,\n      height: 1\n    });\n  },\n  width: function width() {\n    return this.size().width;\n  },\n  height: function height() {\n    return this.size().height;\n  },\n  extent: function extent() {\n    var pan = this._private.pan;\n    var zoom = this._private.zoom;\n    var rb = this.renderedExtent();\n    var b = {\n      x1: (rb.x1 - pan.x) / zoom,\n      x2: (rb.x2 - pan.x) / zoom,\n      y1: (rb.y1 - pan.y) / zoom,\n      y2: (rb.y2 - pan.y) / zoom\n    };\n    b.w = b.x2 - b.x1;\n    b.h = b.y2 - b.y1;\n    return b;\n  },\n  renderedExtent: function renderedExtent() {\n    var width = this.width();\n    var height = this.height();\n    return {\n      x1: 0,\n      y1: 0,\n      x2: width,\n      y2: height,\n      w: width,\n      h: height\n    };\n  },\n  multiClickDebounceTime: function multiClickDebounceTime(_int) {\n    if (_int) this._private.multiClickDebounceTime = _int;else return this._private.multiClickDebounceTime;\n    return this; // chaining\n  }\n};\n\n// aliases\ncorefn$1.centre = corefn$1.center;\n\n// backwards compatibility\ncorefn$1.autolockNodes = corefn$1.autolock;\ncorefn$1.autoungrabifyNodes = corefn$1.autoungrabify;\n\nvar fn = {\n  data: define.data({\n    field: 'data',\n    bindingEvent: 'data',\n    allowBinding: true,\n    allowSetting: true,\n    settingEvent: 'data',\n    settingTriggersEvent: true,\n    triggerFnName: 'trigger',\n    allowGetting: true,\n    updateStyle: true\n  }),\n  removeData: define.removeData({\n    field: 'data',\n    event: 'data',\n    triggerFnName: 'trigger',\n    triggerEvent: true,\n    updateStyle: true\n  }),\n  scratch: define.data({\n    field: 'scratch',\n    bindingEvent: 'scratch',\n    allowBinding: true,\n    allowSetting: true,\n    settingEvent: 'scratch',\n    settingTriggersEvent: true,\n    triggerFnName: 'trigger',\n    allowGetting: true,\n    updateStyle: true\n  }),\n  removeScratch: define.removeData({\n    field: 'scratch',\n    event: 'scratch',\n    triggerFnName: 'trigger',\n    triggerEvent: true,\n    updateStyle: true\n  })\n};\n\n// aliases\nfn.attr = fn.data;\nfn.removeAttr = fn.removeData;\n\nvar Core = function Core(opts) {\n  var cy = this;\n  opts = extend({}, opts);\n  var container = opts.container;\n\n  // allow for passing a wrapped jquery object\n  // e.g. cytoscape({ container: $('#cy') })\n  if (container && !htmlElement(container) && htmlElement(container[0])) {\n    container = container[0];\n  }\n  var reg = container ? container._cyreg : null; // e.g. already registered some info (e.g. readies) via jquery\n  reg = reg || {};\n  if (reg && reg.cy) {\n    reg.cy.destroy();\n    reg = {}; // old instance => replace reg completely\n  }\n  var readies = reg.readies = reg.readies || [];\n  if (container) {\n    container._cyreg = reg;\n  } // make sure container assoc'd reg points to this cy\n  reg.cy = cy;\n  var head = _window !== undefined && container !== undefined && !opts.headless;\n  var options = opts;\n  options.layout = extend({\n    name: head ? 'grid' : 'null'\n  }, options.layout);\n  options.renderer = extend({\n    name: head ? 'canvas' : 'null'\n  }, options.renderer);\n  var defVal = function defVal(def, val, altVal) {\n    if (val !== undefined) {\n      return val;\n    } else if (altVal !== undefined) {\n      return altVal;\n    } else {\n      return def;\n    }\n  };\n  var _p = this._private = {\n    container: container,\n    // html dom ele container\n    ready: false,\n    // whether ready has been triggered\n    options: options,\n    // cached options\n    elements: new Collection(this),\n    // elements in the graph\n    listeners: [],\n    // list of listeners\n    aniEles: new Collection(this),\n    // elements being animated\n    data: options.data || {},\n    // data for the core\n    scratch: {},\n    // scratch object for core\n    layout: null,\n    renderer: null,\n    destroyed: false,\n    // whether destroy was called\n    notificationsEnabled: true,\n    // whether notifications are sent to the renderer\n    minZoom: 1e-50,\n    maxZoom: 1e50,\n    zoomingEnabled: defVal(true, options.zoomingEnabled),\n    userZoomingEnabled: defVal(true, options.userZoomingEnabled),\n    panningEnabled: defVal(true, options.panningEnabled),\n    userPanningEnabled: defVal(true, options.userPanningEnabled),\n    boxSelectionEnabled: defVal(true, options.boxSelectionEnabled),\n    autolock: defVal(false, options.autolock, options.autolockNodes),\n    autoungrabify: defVal(false, options.autoungrabify, options.autoungrabifyNodes),\n    autounselectify: defVal(false, options.autounselectify),\n    styleEnabled: options.styleEnabled === undefined ? head : options.styleEnabled,\n    zoom: number$1(options.zoom) ? options.zoom : 1,\n    pan: {\n      x: plainObject(options.pan) && number$1(options.pan.x) ? options.pan.x : 0,\n      y: plainObject(options.pan) && number$1(options.pan.y) ? options.pan.y : 0\n    },\n    animation: {\n      // object for currently-running animations\n      current: [],\n      queue: []\n    },\n    hasCompoundNodes: false,\n    multiClickDebounceTime: defVal(250, options.multiClickDebounceTime)\n  };\n  this.createEmitter();\n\n  // set selection type\n  this.selectionType(options.selectionType);\n\n  // init zoom bounds\n  this.zoomRange({\n    min: options.minZoom,\n    max: options.maxZoom\n  });\n  var loadExtData = function loadExtData(extData, next) {\n    var anyIsPromise = extData.some(promise);\n    if (anyIsPromise) {\n      return Promise$1.all(extData).then(next); // load all data asynchronously, then exec rest of init\n    } else {\n      next(extData); // exec synchronously for convenience\n    }\n  };\n\n  // start with the default stylesheet so we have something before loading an external stylesheet\n  if (_p.styleEnabled) {\n    cy.setStyle([]);\n  }\n\n  // create the renderer\n  var rendererOptions = extend({}, options, options.renderer); // allow rendering hints in top level options\n  cy.initRenderer(rendererOptions);\n  var setElesAndLayout = function setElesAndLayout(elements, onload, ondone) {\n    cy.notifications(false);\n\n    // remove old elements\n    var oldEles = cy.mutableElements();\n    if (oldEles.length > 0) {\n      oldEles.remove();\n    }\n    if (elements != null) {\n      if (plainObject(elements) || array(elements)) {\n        cy.add(elements);\n      }\n    }\n    cy.one('layoutready', function (e) {\n      cy.notifications(true);\n      cy.emit(e); // we missed this event by turning notifications off, so pass it on\n\n      cy.one('load', onload);\n      cy.emitAndNotify('load');\n    }).one('layoutstop', function () {\n      cy.one('done', ondone);\n      cy.emit('done');\n    });\n    var layoutOpts = extend({}, cy._private.options.layout);\n    layoutOpts.eles = cy.elements();\n    cy.layout(layoutOpts).run();\n  };\n  loadExtData([options.style, options.elements], function (thens) {\n    var initStyle = thens[0];\n    var initEles = thens[1];\n\n    // init style\n    if (_p.styleEnabled) {\n      cy.style().append(initStyle);\n    }\n\n    // initial load\n    setElesAndLayout(initEles, function () {\n      // onready\n      cy.startAnimationLoop();\n      _p.ready = true;\n\n      // if a ready callback is specified as an option, the bind it\n      if (fn$6(options.ready)) {\n        cy.on('ready', options.ready);\n      }\n\n      // bind all the ready handlers registered before creating this instance\n      for (var i = 0; i < readies.length; i++) {\n        var fn = readies[i];\n        cy.on('ready', fn);\n      }\n      if (reg) {\n        reg.readies = [];\n      } // clear b/c we've bound them all and don't want to keep it around in case a new core uses the same div etc\n\n      cy.emit('ready');\n    }, options.done);\n  });\n};\nvar corefn = Core.prototype; // short alias\n\nextend(corefn, {\n  instanceString: function instanceString() {\n    return 'core';\n  },\n  isReady: function isReady() {\n    return this._private.ready;\n  },\n  destroyed: function destroyed() {\n    return this._private.destroyed;\n  },\n  ready: function ready(fn) {\n    if (this.isReady()) {\n      this.emitter().emit('ready', [], fn); // just calls fn as though triggered via ready event\n    } else {\n      this.on('ready', fn);\n    }\n    return this;\n  },\n  destroy: function destroy() {\n    var cy = this;\n    if (cy.destroyed()) return;\n    cy.stopAnimationLoop();\n    cy.destroyRenderer();\n    this.emit('destroy');\n    cy._private.destroyed = true;\n    return cy;\n  },\n  hasElementWithId: function hasElementWithId(id) {\n    return this._private.elements.hasElementWithId(id);\n  },\n  getElementById: function getElementById(id) {\n    return this._private.elements.getElementById(id);\n  },\n  hasCompoundNodes: function hasCompoundNodes() {\n    return this._private.hasCompoundNodes;\n  },\n  headless: function headless() {\n    return this._private.renderer.isHeadless();\n  },\n  styleEnabled: function styleEnabled() {\n    return this._private.styleEnabled;\n  },\n  addToPool: function addToPool(eles) {\n    this._private.elements.merge(eles);\n    return this; // chaining\n  },\n  removeFromPool: function removeFromPool(eles) {\n    this._private.elements.unmerge(eles);\n    return this;\n  },\n  container: function container() {\n    return this._private.container || null;\n  },\n  window: function window() {\n    var container = this._private.container;\n    if (container == null) return _window;\n    var ownerDocument = this._private.container.ownerDocument;\n    if (ownerDocument === undefined || ownerDocument == null) {\n      return _window;\n    }\n    return ownerDocument.defaultView || _window;\n  },\n  mount: function mount(container) {\n    if (container == null) {\n      return;\n    }\n    var cy = this;\n    var _p = cy._private;\n    var options = _p.options;\n    if (!htmlElement(container) && htmlElement(container[0])) {\n      container = container[0];\n    }\n    cy.stopAnimationLoop();\n    cy.destroyRenderer();\n    _p.container = container;\n    _p.styleEnabled = true;\n    cy.invalidateSize();\n    cy.initRenderer(extend({}, options, options.renderer, {\n      // allow custom renderer name to be re-used, otherwise use canvas\n      name: options.renderer.name === 'null' ? 'canvas' : options.renderer.name\n    }));\n    cy.startAnimationLoop();\n    cy.style(options.style);\n    cy.emit('mount');\n    return cy;\n  },\n  unmount: function unmount() {\n    var cy = this;\n    cy.stopAnimationLoop();\n    cy.destroyRenderer();\n    cy.initRenderer({\n      name: 'null'\n    });\n    cy.emit('unmount');\n    return cy;\n  },\n  options: function options() {\n    return copy(this._private.options);\n  },\n  json: function json(obj) {\n    var cy = this;\n    var _p = cy._private;\n    var eles = cy.mutableElements();\n    var getFreshRef = function getFreshRef(ele) {\n      return cy.getElementById(ele.id());\n    };\n    if (plainObject(obj)) {\n      // set\n\n      cy.startBatch();\n      if (obj.elements) {\n        var idInJson = {};\n        var updateEles = function updateEles(jsons, gr) {\n          var toAdd = [];\n          var toMod = [];\n          for (var i = 0; i < jsons.length; i++) {\n            var json = jsons[i];\n            if (!json.data.id) {\n              warn('cy.json() cannot handle elements without an ID attribute');\n              continue;\n            }\n            var id = '' + json.data.id; // id must be string\n            var ele = cy.getElementById(id);\n            idInJson[id] = true;\n            if (ele.length !== 0) {\n              // existing element should be updated\n              toMod.push({\n                ele: ele,\n                json: json\n              });\n            } else {\n              // otherwise should be added\n              if (gr) {\n                json.group = gr;\n                toAdd.push(json);\n              } else {\n                toAdd.push(json);\n              }\n            }\n          }\n          cy.add(toAdd);\n          for (var _i = 0; _i < toMod.length; _i++) {\n            var _toMod$_i = toMod[_i],\n              _ele = _toMod$_i.ele,\n              _json = _toMod$_i.json;\n            _ele.json(_json);\n          }\n        };\n        if (array(obj.elements)) {\n          // elements: []\n          updateEles(obj.elements);\n        } else {\n          // elements: { nodes: [], edges: [] }\n          var grs = ['nodes', 'edges'];\n          for (var i = 0; i < grs.length; i++) {\n            var gr = grs[i];\n            var elements = obj.elements[gr];\n            if (array(elements)) {\n              updateEles(elements, gr);\n            }\n          }\n        }\n        var parentsToRemove = cy.collection();\n        eles.filter(function (ele) {\n          return !idInJson[ele.id()];\n        }).forEach(function (ele) {\n          if (ele.isParent()) {\n            parentsToRemove.merge(ele);\n          } else {\n            ele.remove();\n          }\n        });\n\n        // so that children are not removed w/parent\n        parentsToRemove.forEach(function (ele) {\n          return ele.children().move({\n            parent: null\n          });\n        });\n\n        // intermediate parents may be moved by prior line, so make sure we remove by fresh refs\n        parentsToRemove.forEach(function (ele) {\n          return getFreshRef(ele).remove();\n        });\n      }\n      if (obj.style) {\n        cy.style(obj.style);\n      }\n      if (obj.zoom != null && obj.zoom !== _p.zoom) {\n        cy.zoom(obj.zoom);\n      }\n      if (obj.pan) {\n        if (obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y) {\n          cy.pan(obj.pan);\n        }\n      }\n      if (obj.data) {\n        cy.data(obj.data);\n      }\n      var fields = ['minZoom', 'maxZoom', 'zoomingEnabled', 'userZoomingEnabled', 'panningEnabled', 'userPanningEnabled', 'boxSelectionEnabled', 'autolock', 'autoungrabify', 'autounselectify', 'multiClickDebounceTime'];\n      for (var _i2 = 0; _i2 < fields.length; _i2++) {\n        var f = fields[_i2];\n        if (obj[f] != null) {\n          cy[f](obj[f]);\n        }\n      }\n      cy.endBatch();\n      return this; // chaining\n    } else {\n      // get\n      var flat = !!obj;\n      var json = {};\n      if (flat) {\n        json.elements = this.elements().map(function (ele) {\n          return ele.json();\n        });\n      } else {\n        json.elements = {};\n        eles.forEach(function (ele) {\n          var group = ele.group();\n          if (!json.elements[group]) {\n            json.elements[group] = [];\n          }\n          json.elements[group].push(ele.json());\n        });\n      }\n      if (this._private.styleEnabled) {\n        json.style = cy.style().json();\n      }\n      json.data = copy(cy.data());\n      var options = _p.options;\n      json.zoomingEnabled = _p.zoomingEnabled;\n      json.userZoomingEnabled = _p.userZoomingEnabled;\n      json.zoom = _p.zoom;\n      json.minZoom = _p.minZoom;\n      json.maxZoom = _p.maxZoom;\n      json.panningEnabled = _p.panningEnabled;\n      json.userPanningEnabled = _p.userPanningEnabled;\n      json.pan = copy(_p.pan);\n      json.boxSelectionEnabled = _p.boxSelectionEnabled;\n      json.renderer = copy(options.renderer);\n      json.hideEdgesOnViewport = options.hideEdgesOnViewport;\n      json.textureOnViewport = options.textureOnViewport;\n      json.wheelSensitivity = options.wheelSensitivity;\n      json.motionBlur = options.motionBlur;\n      json.multiClickDebounceTime = options.multiClickDebounceTime;\n      return json;\n    }\n  }\n});\ncorefn.$id = corefn.getElementById;\n[corefn$9, corefn$8, elesfn, corefn$7, corefn$6, corefn$5, corefn$4, corefn$3, corefn$2, corefn$1, fn].forEach(function (props) {\n  extend(corefn, props);\n});\n\n/* eslint-disable no-unused-vars */\nvar defaults$7 = {\n  fit: true,\n  // whether to fit the viewport to the graph\n  directed: false,\n  // whether the tree is directed downwards (or edges can point in any direction if false)\n  direction: 'downward',\n  // determines the direction in which the tree structure is drawn.  The possible values are 'downward', 'upward', 'rightward', or 'leftward'.\n  padding: 30,\n  // padding on fit\n  circle: false,\n  // put depths in concentric circles if true, put depths top down if false\n  grid: false,\n  // whether to create an even grid into which the DAG is placed (circle:false only)\n  spacingFactor: 1.75,\n  // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap)\n  boundingBox: undefined,\n  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n  avoidOverlap: true,\n  // prevents node overlap, may overflow boundingBox if not enough space\n  nodeDimensionsIncludeLabels: false,\n  // Excludes the label when calculating node bounding boxes for the layout algorithm\n  roots: undefined,\n  // the roots of the trees\n  depthSort: undefined,\n  // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') }\n  animate: false,\n  // whether to transition the node positions\n  animationDuration: 500,\n  // duration of animation in ms if enabled\n  animationEasing: undefined,\n  // easing of animation if enabled,\n  animateFilter: function animateFilter(node, i) {\n    return true;\n  },\n  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts\n  ready: undefined,\n  // callback on layoutready\n  stop: undefined,\n  // callback on layoutstop\n  transform: function transform(node, position) {\n    return position;\n  } // transform a given node position. Useful for changing flow direction in discrete layouts\n};\nvar deprecatedOptionDefaults = {\n  maximal: false,\n  // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only); setting acyclic to true sets maximal to true also\n  acyclic: false // whether the tree is acyclic and thus a node could be shifted (due to the maximal option) multiple times without causing an infinite loop; setting to true sets maximal to true also; if you are uncertain whether a tree is acyclic, set to false to avoid potential infinite loops\n};\n\n/* eslint-enable */\n\nvar getInfo = function getInfo(ele) {\n  return ele.scratch('breadthfirst');\n};\nvar setInfo = function setInfo(ele, obj) {\n  return ele.scratch('breadthfirst', obj);\n};\nfunction BreadthFirstLayout(options) {\n  this.options = extend({}, defaults$7, deprecatedOptionDefaults, options);\n}\nBreadthFirstLayout.prototype.run = function () {\n  var options = this.options;\n  var cy = options.cy;\n  var eles = options.eles;\n  var nodes = eles.nodes().filter(function (n) {\n    return n.isChildless();\n  });\n  var graph = eles;\n  var directed = options.directed;\n  var maximal = options.acyclic || options.maximal || options.maximalAdjustments > 0; // maximalAdjustments for compat. w/ old code; also, setting acyclic to true sets maximal to true\n\n  var hasBoundingBox = !!options.boundingBox;\n  var bb = makeBoundingBox(hasBoundingBox ? options.boundingBox : structuredClone(cy.extent()));\n  var roots;\n  if (elementOrCollection(options.roots)) {\n    roots = options.roots;\n  } else if (array(options.roots)) {\n    var rootsArray = [];\n    for (var i = 0; i < options.roots.length; i++) {\n      var id = options.roots[i];\n      var ele = cy.getElementById(id);\n      rootsArray.push(ele);\n    }\n    roots = cy.collection(rootsArray);\n  } else if (string(options.roots)) {\n    roots = cy.$(options.roots);\n  } else {\n    if (directed) {\n      roots = nodes.roots();\n    } else {\n      var components = eles.components();\n      roots = cy.collection();\n      var _loop = function _loop() {\n        var comp = components[_i];\n        var maxDegree = comp.maxDegree(false);\n        var compRoots = comp.filter(function (ele) {\n          return ele.degree(false) === maxDegree;\n        });\n        roots = roots.add(compRoots);\n      };\n      for (var _i = 0; _i < components.length; _i++) {\n        _loop();\n      }\n    }\n  }\n  var depths = [];\n  var foundByBfs = {};\n  var addToDepth = function addToDepth(ele, d) {\n    if (depths[d] == null) {\n      depths[d] = [];\n    }\n    var i = depths[d].length;\n    depths[d].push(ele);\n    setInfo(ele, {\n      index: i,\n      depth: d\n    });\n  };\n  var changeDepth = function changeDepth(ele, newDepth) {\n    var _getInfo = getInfo(ele),\n      depth = _getInfo.depth,\n      index = _getInfo.index;\n    depths[depth][index] = null;\n\n    // add only childless nodes\n    if (ele.isChildless()) addToDepth(ele, newDepth);\n  };\n\n  // find the depths of the nodes\n  graph.bfs({\n    roots: roots,\n    directed: options.directed,\n    visit: function visit(node, edge, pNode, i, depth) {\n      var ele = node[0];\n      var id = ele.id();\n\n      // add only childless nodes\n      if (ele.isChildless()) addToDepth(ele, depth);\n      foundByBfs[id] = true;\n    }\n  });\n\n  // check for nodes not found by bfs\n  var orphanNodes = [];\n  for (var _i2 = 0; _i2 < nodes.length; _i2++) {\n    var _ele = nodes[_i2];\n    if (foundByBfs[_ele.id()]) {\n      continue;\n    } else {\n      orphanNodes.push(_ele);\n    }\n  }\n\n  // assign the nodes a depth and index\n  var assignDepthsAt = function assignDepthsAt(i) {\n    var eles = depths[i];\n    for (var j = 0; j < eles.length; j++) {\n      var _ele2 = eles[j];\n      if (_ele2 == null) {\n        eles.splice(j, 1);\n        j--;\n        continue;\n      }\n      setInfo(_ele2, {\n        depth: i,\n        index: j\n      });\n    }\n  };\n  var adjustMaximally = function adjustMaximally(ele, shifted) {\n    var eInfo = getInfo(ele);\n    var incomers = ele.incomers().filter(function (el) {\n      return el.isNode() && eles.has(el);\n    });\n    var maxDepth = -1;\n    var id = ele.id();\n    for (var k = 0; k < incomers.length; k++) {\n      var incmr = incomers[k];\n      var iInfo = getInfo(incmr);\n      maxDepth = Math.max(maxDepth, iInfo.depth);\n    }\n    if (eInfo.depth <= maxDepth) {\n      if (!options.acyclic && shifted[id]) {\n        return null;\n      }\n      var newDepth = maxDepth + 1;\n      changeDepth(ele, newDepth);\n      shifted[id] = newDepth;\n      return true;\n    }\n    return false;\n  };\n\n  // for the directed case, try to make the edges all go down (i.e. depth i => depth i + 1)\n  if (directed && maximal) {\n    var Q = [];\n    var shifted = {};\n    var enqueue = function enqueue(n) {\n      return Q.push(n);\n    };\n    var dequeue = function dequeue() {\n      return Q.shift();\n    };\n    nodes.forEach(function (n) {\n      return Q.push(n);\n    });\n    while (Q.length > 0) {\n      var _ele3 = dequeue();\n      var didShift = adjustMaximally(_ele3, shifted);\n      if (didShift) {\n        _ele3.outgoers().filter(function (el) {\n          return el.isNode() && eles.has(el);\n        }).forEach(enqueue);\n      } else if (didShift === null) {\n        warn('Detected double maximal shift for node `' + _ele3.id() + '`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.');\n        break; // exit on failure\n      }\n    }\n  }\n\n  // find min distance we need to leave between nodes\n  var minDistance = 0;\n  if (options.avoidOverlap) {\n    for (var _i3 = 0; _i3 < nodes.length; _i3++) {\n      var n = nodes[_i3];\n      var nbb = n.layoutDimensions(options);\n      var w = nbb.w;\n      var h = nbb.h;\n      minDistance = Math.max(minDistance, w, h);\n    }\n  }\n\n  // get the weighted percent for an element based on its connectivity to other levels\n  var cachedWeightedPercent = {};\n  var getWeightedPercent = function getWeightedPercent(ele) {\n    if (cachedWeightedPercent[ele.id()]) {\n      return cachedWeightedPercent[ele.id()];\n    }\n    var eleDepth = getInfo(ele).depth;\n    var neighbors = ele.neighborhood();\n    var percent = 0;\n    var samples = 0;\n    for (var _i4 = 0; _i4 < neighbors.length; _i4++) {\n      var neighbor = neighbors[_i4];\n      if (neighbor.isEdge() || neighbor.isParent() || !nodes.has(neighbor)) {\n        continue;\n      }\n      var bf = getInfo(neighbor);\n      if (bf == null) {\n        continue;\n      }\n      var index = bf.index;\n      var depth = bf.depth;\n\n      // unassigned neighbours shouldn't affect the ordering\n      if (index == null || depth == null) {\n        continue;\n      }\n      var nDepth = depths[depth].length;\n      if (depth < eleDepth) {\n        // only get influenced by elements above\n        percent += index / nDepth;\n        samples++;\n      }\n    }\n    samples = Math.max(1, samples);\n    percent = percent / samples;\n    if (samples === 0) {\n      // put lone nodes at the start\n      percent = 0;\n    }\n    cachedWeightedPercent[ele.id()] = percent;\n    return percent;\n  };\n\n  // rearrange the indices in each depth level based on connectivity\n  var sortFn = function sortFn(a, b) {\n    var apct = getWeightedPercent(a);\n    var bpct = getWeightedPercent(b);\n    var diff = apct - bpct;\n    if (diff === 0) {\n      return ascending(a.id(), b.id()); // make sure sort doesn't have don't-care comparisons\n    } else {\n      return diff;\n    }\n  };\n  if (options.depthSort !== undefined) {\n    sortFn = options.depthSort;\n  }\n  var depthsLen = depths.length;\n\n  // sort each level to make connected nodes closer\n  for (var _i5 = 0; _i5 < depthsLen; _i5++) {\n    depths[_i5].sort(sortFn);\n    assignDepthsAt(_i5);\n  }\n\n  // assign orphan nodes to a new top-level depth\n  var orphanDepth = [];\n  for (var _i6 = 0; _i6 < orphanNodes.length; _i6++) {\n    orphanDepth.push(orphanNodes[_i6]);\n  }\n  var assignDepths = function assignDepths() {\n    for (var _i7 = 0; _i7 < depthsLen; _i7++) {\n      assignDepthsAt(_i7);\n    }\n  };\n\n  // add a new top-level depth only when there are orphan nodes\n  if (orphanDepth.length) {\n    depths.unshift(orphanDepth);\n    depthsLen = depths.length;\n    assignDepths();\n  }\n  var biggestDepthSize = 0;\n  for (var _i8 = 0; _i8 < depthsLen; _i8++) {\n    biggestDepthSize = Math.max(depths[_i8].length, biggestDepthSize);\n  }\n  var center = {\n    x: bb.x1 + bb.w / 2,\n    y: bb.y1 + bb.h / 2\n  };\n\n  // average node size\n  var aveNodeSize = nodes.reduce(function (acc, node) {\n    return function (box) {\n      return {\n        w: acc.w === -1 ? box.w : (acc.w + box.w) / 2,\n        h: acc.h === -1 ? box.h : (acc.h + box.h) / 2\n      };\n    }(node.boundingBox({\n      includeLabels: options.nodeDimensionsIncludeLabels\n    }));\n  }, {\n    w: -1,\n    h: -1\n  });\n  var distanceY = Math.max(\n  // only one depth\n  depthsLen === 1 ? 0 :\n  // inside a bounding box, no need for top & bottom padding\n  hasBoundingBox ? (bb.h - options.padding * 2 - aveNodeSize.h) / (depthsLen - 1) : (bb.h - options.padding * 2 - aveNodeSize.h) / (depthsLen + 1), minDistance);\n  var maxDepthSize = depths.reduce(function (max, eles) {\n    return Math.max(max, eles.length);\n  }, 0);\n  var getPositionTopBottom = function getPositionTopBottom(ele) {\n    var _getInfo2 = getInfo(ele),\n      depth = _getInfo2.depth,\n      index = _getInfo2.index;\n    if (options.circle) {\n      var radiusStepSize = Math.min(bb.w / 2 / depthsLen, bb.h / 2 / depthsLen);\n      radiusStepSize = Math.max(radiusStepSize, minDistance);\n      var radius = radiusStepSize * depth + radiusStepSize - (depthsLen > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0);\n      var theta = 2 * Math.PI / depths[depth].length * index;\n      if (depth === 0 && depths[0].length === 1) {\n        radius = 1;\n      }\n      return {\n        x: center.x + radius * Math.cos(theta),\n        y: center.y + radius * Math.sin(theta)\n      };\n    } else {\n      var depthSize = depths[depth].length;\n      var distanceX = Math.max(\n      // only one depth\n      depthSize === 1 ? 0 :\n      // inside a bounding box, no need for left & right padding\n      hasBoundingBox ? (bb.w - options.padding * 2 - aveNodeSize.w) / ((options.grid ? maxDepthSize : depthSize) - 1) : (bb.w - options.padding * 2 - aveNodeSize.w) / ((options.grid ? maxDepthSize : depthSize) + 1), minDistance);\n      var epos = {\n        x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX,\n        y: center.y + (depth + 1 - (depthsLen + 1) / 2) * distanceY\n      };\n      return epos;\n    }\n  };\n  var rotateDegrees = {\n    'downward': 0,\n    'leftward': 90,\n    'upward': 180,\n    'rightward': -90\n  };\n  if (Object.keys(rotateDegrees).indexOf(options.direction) === -1) {\n    error(\"Invalid direction '\".concat(options.direction, \"' specified for breadthfirst layout. Valid values are: \").concat(Object.keys(rotateDegrees).join(', ')));\n  }\n  var getPosition = function getPosition(ele) {\n    return rotatePosAndSkewByBox(getPositionTopBottom(ele), bb, rotateDegrees[options.direction]);\n  };\n  eles.nodes().layoutPositions(this, options, getPosition);\n  return this; // chaining\n};\n\nvar defaults$6 = {\n  fit: true,\n  // whether to fit the viewport to the graph\n  padding: 30,\n  // the padding on fit\n  boundingBox: undefined,\n  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n  avoidOverlap: true,\n  // prevents node overlap, may overflow boundingBox and radius if not enough space\n  nodeDimensionsIncludeLabels: false,\n  // Excludes the label when calculating node bounding boxes for the layout algorithm\n  spacingFactor: undefined,\n  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n  radius: undefined,\n  // the radius of the circle\n  startAngle: 3 / 2 * Math.PI,\n  // where nodes start in radians\n  sweep: undefined,\n  // how many radians should be between the first and last node (defaults to full circle)\n  clockwise: true,\n  // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)\n  sort: undefined,\n  // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }\n  animate: false,\n  // whether to transition the node positions\n  animationDuration: 500,\n  // duration of animation in ms if enabled\n  animationEasing: undefined,\n  // easing of animation if enabled\n  animateFilter: function animateFilter(node, i) {\n    return true;\n  },\n  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts\n  ready: undefined,\n  // callback on layoutready\n  stop: undefined,\n  // callback on layoutstop\n  transform: function transform(node, position) {\n    return position;\n  } // transform a given node position. Useful for changing flow direction in discrete layouts \n};\nfunction CircleLayout(options) {\n  this.options = extend({}, defaults$6, options);\n}\nCircleLayout.prototype.run = function () {\n  var params = this.options;\n  var options = params;\n  var cy = params.cy;\n  var eles = options.eles;\n  var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise;\n  var nodes = eles.nodes().not(':parent');\n  if (options.sort) {\n    nodes = nodes.sort(options.sort);\n  }\n  var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n    x1: 0,\n    y1: 0,\n    w: cy.width(),\n    h: cy.height()\n  });\n  var center = {\n    x: bb.x1 + bb.w / 2,\n    y: bb.y1 + bb.h / 2\n  };\n  var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / nodes.length : options.sweep;\n  var dTheta = sweep / Math.max(1, nodes.length - 1);\n  var r;\n  var minDistance = 0;\n  for (var i = 0; i < nodes.length; i++) {\n    var n = nodes[i];\n    var nbb = n.layoutDimensions(options);\n    var w = nbb.w;\n    var h = nbb.h;\n    minDistance = Math.max(minDistance, w, h);\n  }\n  if (number$1(options.radius)) {\n    r = options.radius;\n  } else if (nodes.length <= 1) {\n    r = 0;\n  } else {\n    r = Math.min(bb.h, bb.w) / 2 - minDistance;\n  }\n\n  // calculate the radius\n  if (nodes.length > 1 && options.avoidOverlap) {\n    // but only if more than one node (can't overlap)\n    minDistance *= 1.75; // just to have some nice spacing\n\n    var dcos = Math.cos(dTheta) - Math.cos(0);\n    var dsin = Math.sin(dTheta) - Math.sin(0);\n    var rMin = Math.sqrt(minDistance * minDistance / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping\n    r = Math.max(rMin, r);\n  }\n  var getPos = function getPos(ele, i) {\n    var theta = options.startAngle + i * dTheta * (clockwise ? 1 : -1);\n    var rx = r * Math.cos(theta);\n    var ry = r * Math.sin(theta);\n    var pos = {\n      x: center.x + rx,\n      y: center.y + ry\n    };\n    return pos;\n  };\n  eles.nodes().layoutPositions(this, options, getPos);\n  return this; // chaining\n};\n\nvar defaults$5 = {\n  fit: true,\n  // whether to fit the viewport to the graph\n  padding: 30,\n  // the padding on fit\n  startAngle: 3 / 2 * Math.PI,\n  // where nodes start in radians\n  sweep: undefined,\n  // how many radians should be between the first and last node (defaults to full circle)\n  clockwise: true,\n  // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)\n  equidistant: false,\n  // whether levels have an equal radial distance betwen them, may cause bounding box overflow\n  minNodeSpacing: 10,\n  // min spacing between outside of nodes (used for radius adjustment)\n  boundingBox: undefined,\n  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n  avoidOverlap: true,\n  // prevents node overlap, may overflow boundingBox if not enough space\n  nodeDimensionsIncludeLabels: false,\n  // Excludes the label when calculating node bounding boxes for the layout algorithm\n  height: undefined,\n  // height of layout area (overrides container height)\n  width: undefined,\n  // width of layout area (overrides container width)\n  spacingFactor: undefined,\n  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n  concentric: function concentric(node) {\n    // returns numeric value for each node, placing higher nodes in levels towards the centre\n    return node.degree();\n  },\n  levelWidth: function levelWidth(nodes) {\n    // the variation of concentric values in each level\n    return nodes.maxDegree() / 4;\n  },\n  animate: false,\n  // whether to transition the node positions\n  animationDuration: 500,\n  // duration of animation in ms if enabled\n  animationEasing: undefined,\n  // easing of animation if enabled\n  animateFilter: function animateFilter(node, i) {\n    return true;\n  },\n  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts\n  ready: undefined,\n  // callback on layoutready\n  stop: undefined,\n  // callback on layoutstop\n  transform: function transform(node, position) {\n    return position;\n  } // transform a given node position. Useful for changing flow direction in discrete layouts\n};\nfunction ConcentricLayout(options) {\n  this.options = extend({}, defaults$5, options);\n}\nConcentricLayout.prototype.run = function () {\n  var params = this.options;\n  var options = params;\n  var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise;\n  var cy = params.cy;\n  var eles = options.eles;\n  var nodes = eles.nodes().not(':parent');\n  var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n    x1: 0,\n    y1: 0,\n    w: cy.width(),\n    h: cy.height()\n  });\n  var center = {\n    x: bb.x1 + bb.w / 2,\n    y: bb.y1 + bb.h / 2\n  };\n  var nodeValues = []; // { node, value }\n  var maxNodeSize = 0;\n  for (var i = 0; i < nodes.length; i++) {\n    var node = nodes[i];\n    var value = undefined;\n\n    // calculate the node value\n    value = options.concentric(node);\n    nodeValues.push({\n      value: value,\n      node: node\n    });\n\n    // for style mapping\n    node._private.scratch.concentric = value;\n  }\n\n  // in case we used the `concentric` in style\n  nodes.updateStyle();\n\n  // calculate max size now based on potentially updated mappers\n  for (var _i = 0; _i < nodes.length; _i++) {\n    var _node = nodes[_i];\n    var nbb = _node.layoutDimensions(options);\n    maxNodeSize = Math.max(maxNodeSize, nbb.w, nbb.h);\n  }\n\n  // sort node values in descreasing order\n  nodeValues.sort(function (a, b) {\n    return b.value - a.value;\n  });\n  var levelWidth = options.levelWidth(nodes);\n\n  // put the values into levels\n  var levels = [[]];\n  var currentLevel = levels[0];\n  for (var _i2 = 0; _i2 < nodeValues.length; _i2++) {\n    var val = nodeValues[_i2];\n    if (currentLevel.length > 0) {\n      var diff = Math.abs(currentLevel[0].value - val.value);\n      if (diff >= levelWidth) {\n        currentLevel = [];\n        levels.push(currentLevel);\n      }\n    }\n    currentLevel.push(val);\n  }\n\n  // create positions from levels\n\n  var minDist = maxNodeSize + options.minNodeSpacing; // min dist between nodes\n\n  if (!options.avoidOverlap) {\n    // then strictly constrain to bb\n    var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1;\n    var maxR = Math.min(bb.w, bb.h) / 2 - minDist;\n    var rStep = maxR / (levels.length + firstLvlHasMulti ? 1 : 0);\n    minDist = Math.min(minDist, rStep);\n  }\n\n  // find the metrics for each level\n  var r = 0;\n  for (var _i3 = 0; _i3 < levels.length; _i3++) {\n    var level = levels[_i3];\n    var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / level.length : options.sweep;\n    var dTheta = level.dTheta = sweep / Math.max(1, level.length - 1);\n\n    // calculate the radius\n    if (level.length > 1 && options.avoidOverlap) {\n      // but only if more than one node (can't overlap)\n      var dcos = Math.cos(dTheta) - Math.cos(0);\n      var dsin = Math.sin(dTheta) - Math.sin(0);\n      var rMin = Math.sqrt(minDist * minDist / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping\n\n      r = Math.max(rMin, r);\n    }\n    level.r = r;\n    r += minDist;\n  }\n  if (options.equidistant) {\n    var rDeltaMax = 0;\n    var _r = 0;\n    for (var _i4 = 0; _i4 < levels.length; _i4++) {\n      var _level = levels[_i4];\n      var rDelta = _level.r - _r;\n      rDeltaMax = Math.max(rDeltaMax, rDelta);\n    }\n    _r = 0;\n    for (var _i5 = 0; _i5 < levels.length; _i5++) {\n      var _level2 = levels[_i5];\n      if (_i5 === 0) {\n        _r = _level2.r;\n      }\n      _level2.r = _r;\n      _r += rDeltaMax;\n    }\n  }\n\n  // calculate the node positions\n  var pos = {}; // id => position\n  for (var _i6 = 0; _i6 < levels.length; _i6++) {\n    var _level3 = levels[_i6];\n    var _dTheta = _level3.dTheta;\n    var _r2 = _level3.r;\n    for (var j = 0; j < _level3.length; j++) {\n      var _val = _level3[j];\n      var theta = options.startAngle + (clockwise ? 1 : -1) * _dTheta * j;\n      var p = {\n        x: center.x + _r2 * Math.cos(theta),\n        y: center.y + _r2 * Math.sin(theta)\n      };\n      pos[_val.node.id()] = p;\n    }\n  }\n\n  // position the nodes\n  eles.nodes().layoutPositions(this, options, function (ele) {\n    var id = ele.id();\n    return pos[id];\n  });\n  return this; // chaining\n};\n\n/*\nThe CoSE layout was written by Gerardo Huck.\nhttps://www.linkedin.com/in/gerardohuck/\n\nBased on the following article:\nhttp://dl.acm.org/citation.cfm?id=1498047\n\nModifications tracked on Github.\n*/\n\nvar DEBUG;\n\n/**\n * @brief :  default layout options\n */\nvar defaults$4 = {\n  // Called on `layoutready`\n  ready: function ready() {},\n  // Called on `layoutstop`\n  stop: function stop() {},\n  // Whether to animate while running the layout\n  // true : Animate continuously as the layout is running\n  // false : Just show the end result\n  // 'end' : Animate with the end result, from the initial positions to the end positions\n  animate: true,\n  // Easing of the animation for animate:'end'\n  animationEasing: undefined,\n  // The duration of the animation for animate:'end'\n  animationDuration: undefined,\n  // A function that determines whether the node should be animated\n  // All nodes animated by default on animate enabled\n  // Non-animated nodes are positioned immediately when the layout starts\n  animateFilter: function animateFilter(node, i) {\n    return true;\n  },\n  // The layout animates only after this many milliseconds for animate:true\n  // (prevents flashing on fast runs)\n  animationThreshold: 250,\n  // Number of iterations between consecutive screen positions update\n  refresh: 20,\n  // Whether to fit the network view after when done\n  fit: true,\n  // Padding on fit\n  padding: 30,\n  // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n  boundingBox: undefined,\n  // Excludes the label when calculating node bounding boxes for the layout algorithm\n  nodeDimensionsIncludeLabels: false,\n  // Randomize the initial positions of the nodes (true) or use existing positions (false)\n  randomize: false,\n  // Extra spacing between components in non-compound graphs\n  componentSpacing: 40,\n  // Node repulsion (non overlapping) multiplier\n  nodeRepulsion: function nodeRepulsion(node) {\n    return 2048;\n  },\n  // Node repulsion (overlapping) multiplier\n  nodeOverlap: 4,\n  // Ideal edge (non nested) length\n  idealEdgeLength: function idealEdgeLength(edge) {\n    return 32;\n  },\n  // Divisor to compute edge forces\n  edgeElasticity: function edgeElasticity(edge) {\n    return 32;\n  },\n  // Nesting factor (multiplier) to compute ideal edge length for nested edges\n  nestingFactor: 1.2,\n  // Gravity force (constant)\n  gravity: 1,\n  // Maximum number of iterations to perform\n  numIter: 1000,\n  // Initial temperature (maximum node displacement)\n  initialTemp: 1000,\n  // Cooling factor (how the temperature is reduced between consecutive iterations\n  coolingFactor: 0.99,\n  // Lower temperature threshold (below this point the layout will end)\n  minTemp: 1.0\n};\n\n/**\n * @brief       : constructor\n * @arg options : object containing layout options\n */\nfunction CoseLayout(options) {\n  this.options = extend({}, defaults$4, options);\n  this.options.layout = this;\n\n  // Exclude any edge that has a source or target node that is not in the set of passed-in nodes\n  var nodes = this.options.eles.nodes();\n  var edges = this.options.eles.edges();\n  var notEdges = edges.filter(function (e) {\n    var sourceId = e.source().data('id');\n    var targetId = e.target().data('id');\n    var hasSource = nodes.some(function (n) {\n      return n.data('id') === sourceId;\n    });\n    var hasTarget = nodes.some(function (n) {\n      return n.data('id') === targetId;\n    });\n    return !hasSource || !hasTarget;\n  });\n  this.options.eles = this.options.eles.not(notEdges);\n}\n\n/**\n * @brief : runs the layout\n */\nCoseLayout.prototype.run = function () {\n  var options = this.options;\n  var cy = options.cy;\n  var layout = this;\n  layout.stopped = false;\n  if (options.animate === true || options.animate === false) {\n    layout.emit({\n      type: 'layoutstart',\n      layout: layout\n    });\n  }\n\n  // Set DEBUG - Global variable\n  if (true === options.debug) {\n    DEBUG = true;\n  } else {\n    DEBUG = false;\n  }\n\n  // Initialize layout info\n  var layoutInfo = createLayoutInfo(cy, layout, options);\n\n  // Show LayoutInfo contents if debugging\n  if (DEBUG) {\n    printLayoutInfo(layoutInfo);\n  }\n\n  // If required, randomize node positions\n  if (options.randomize) {\n    randomizePositions(layoutInfo);\n  }\n  var startTime = performanceNow();\n  var refresh = function refresh() {\n    refreshPositions(layoutInfo, cy, options);\n\n    // Fit the graph if necessary\n    if (true === options.fit) {\n      cy.fit(options.padding);\n    }\n  };\n  var mainLoop = function mainLoop(i) {\n    if (layout.stopped || i >= options.numIter) {\n      // logDebug(\"Layout manually stopped. Stopping computation in step \" + i);\n      return false;\n    }\n\n    // Do one step in the phisical simulation\n    step(layoutInfo, options);\n\n    // Update temperature\n    layoutInfo.temperature = layoutInfo.temperature * options.coolingFactor;\n    // logDebug(\"New temperature: \" + layoutInfo.temperature);\n\n    if (layoutInfo.temperature < options.minTemp) {\n      // logDebug(\"Temperature drop below minimum threshold. Stopping computation in step \" + i);\n      return false;\n    }\n    return true;\n  };\n  var done = function done() {\n    if (options.animate === true || options.animate === false) {\n      refresh();\n\n      // Layout has finished\n      layout.one('layoutstop', options.stop);\n      layout.emit({\n        type: 'layoutstop',\n        layout: layout\n      });\n    } else {\n      var nodes = options.eles.nodes();\n      var getScaledPos = getScaleInBoundsFn(layoutInfo, options, nodes);\n      nodes.layoutPositions(layout, options, getScaledPos);\n    }\n  };\n  var i = 0;\n  var loopRet = true;\n  if (options.animate === true) {\n    var _frame = function frame() {\n      var f = 0;\n      while (loopRet && f < options.refresh) {\n        loopRet = mainLoop(i);\n        i++;\n        f++;\n      }\n      if (!loopRet) {\n        // it's done\n        separateComponents(layoutInfo, options);\n        done();\n      } else {\n        var now = performanceNow();\n        if (now - startTime >= options.animationThreshold) {\n          refresh();\n        }\n        requestAnimationFrame(_frame);\n      }\n    };\n    _frame();\n  } else {\n    while (loopRet) {\n      loopRet = mainLoop(i);\n      i++;\n    }\n    separateComponents(layoutInfo, options);\n    done();\n  }\n  return this; // chaining\n};\n\n/**\n * @brief : called on continuous layouts to stop them before they finish\n */\nCoseLayout.prototype.stop = function () {\n  this.stopped = true;\n  if (this.thread) {\n    this.thread.stop();\n  }\n  this.emit('layoutstop');\n  return this; // chaining\n};\nCoseLayout.prototype.destroy = function () {\n  if (this.thread) {\n    this.thread.stop();\n  }\n  return this; // chaining\n};\n\n/**\n * @brief     : Creates an object which is contains all the data\n *              used in the layout process\n * @arg cy    : cytoscape.js object\n * @return    : layoutInfo object initialized\n */\nvar createLayoutInfo = function createLayoutInfo(cy, layout, options) {\n  // Shortcut\n  var edges = options.eles.edges();\n  var nodes = options.eles.nodes();\n  var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n    x1: 0,\n    y1: 0,\n    w: cy.width(),\n    h: cy.height()\n  });\n  var layoutInfo = {\n    isCompound: cy.hasCompoundNodes(),\n    layoutNodes: [],\n    idToIndex: {},\n    nodeSize: nodes.size(),\n    graphSet: [],\n    indexToGraph: [],\n    layoutEdges: [],\n    edgeSize: edges.size(),\n    temperature: options.initialTemp,\n    clientWidth: bb.w,\n    clientHeight: bb.h,\n    boundingBox: bb\n  };\n  var components = options.eles.components();\n  var id2cmptId = {};\n  for (var i = 0; i < components.length; i++) {\n    var component = components[i];\n    for (var j = 0; j < component.length; j++) {\n      var node = component[j];\n      id2cmptId[node.id()] = i;\n    }\n  }\n\n  // Iterate over all nodes, creating layout nodes\n  for (var i = 0; i < layoutInfo.nodeSize; i++) {\n    var n = nodes[i];\n    var nbb = n.layoutDimensions(options);\n    var tempNode = {};\n    tempNode.isLocked = n.locked();\n    tempNode.id = n.data('id');\n    tempNode.parentId = n.data('parent');\n    tempNode.cmptId = id2cmptId[n.id()];\n    tempNode.children = [];\n    tempNode.positionX = n.position('x');\n    tempNode.positionY = n.position('y');\n    tempNode.offsetX = 0;\n    tempNode.offsetY = 0;\n    tempNode.height = nbb.w;\n    tempNode.width = nbb.h;\n    tempNode.maxX = tempNode.positionX + tempNode.width / 2;\n    tempNode.minX = tempNode.positionX - tempNode.width / 2;\n    tempNode.maxY = tempNode.positionY + tempNode.height / 2;\n    tempNode.minY = tempNode.positionY - tempNode.height / 2;\n    tempNode.padLeft = parseFloat(n.style('padding'));\n    tempNode.padRight = parseFloat(n.style('padding'));\n    tempNode.padTop = parseFloat(n.style('padding'));\n    tempNode.padBottom = parseFloat(n.style('padding'));\n\n    // forces\n    tempNode.nodeRepulsion = fn$6(options.nodeRepulsion) ? options.nodeRepulsion(n) : options.nodeRepulsion;\n\n    // Add new node\n    layoutInfo.layoutNodes.push(tempNode);\n    // Add entry to id-index map\n    layoutInfo.idToIndex[tempNode.id] = i;\n  }\n\n  // Inline implementation of a queue, used for traversing the graph in BFS order\n  var queue = [];\n  var start = 0; // Points to the start the queue\n  var end = -1; // Points to the end of the queue\n\n  var tempGraph = [];\n\n  // Second pass to add child information and\n  // initialize queue for hierarchical traversal\n  for (var i = 0; i < layoutInfo.nodeSize; i++) {\n    var n = layoutInfo.layoutNodes[i];\n    var p_id = n.parentId;\n    // Check if node n has a parent node\n    if (null != p_id) {\n      // Add node Id to parent's list of children\n      layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n.id);\n    } else {\n      // If a node doesn't have a parent, then it's in the root graph\n      queue[++end] = n.id;\n      tempGraph.push(n.id);\n    }\n  }\n\n  // Add root graph to graphSet\n  layoutInfo.graphSet.push(tempGraph);\n\n  // Traverse the graph, level by level,\n  while (start <= end) {\n    // Get the node to visit and remove it from queue\n    var node_id = queue[start++];\n    var node_ix = layoutInfo.idToIndex[node_id];\n    var node = layoutInfo.layoutNodes[node_ix];\n    var children = node.children;\n    if (children.length > 0) {\n      // Add children nodes as a new graph to graph set\n      layoutInfo.graphSet.push(children);\n      // Add children to que queue to be visited\n      for (var i = 0; i < children.length; i++) {\n        queue[++end] = children[i];\n      }\n    }\n  }\n\n  // Create indexToGraph map\n  for (var i = 0; i < layoutInfo.graphSet.length; i++) {\n    var graph = layoutInfo.graphSet[i];\n    for (var j = 0; j < graph.length; j++) {\n      var index = layoutInfo.idToIndex[graph[j]];\n      layoutInfo.indexToGraph[index] = i;\n    }\n  }\n\n  // Iterate over all edges, creating Layout Edges\n  for (var i = 0; i < layoutInfo.edgeSize; i++) {\n    var e = edges[i];\n    var tempEdge = {};\n    tempEdge.id = e.data('id');\n    tempEdge.sourceId = e.data('source');\n    tempEdge.targetId = e.data('target');\n\n    // Compute ideal length\n    var idealLength = fn$6(options.idealEdgeLength) ? options.idealEdgeLength(e) : options.idealEdgeLength;\n    var elasticity = fn$6(options.edgeElasticity) ? options.edgeElasticity(e) : options.edgeElasticity;\n\n    // Check if it's an inter graph edge\n    var sourceIx = layoutInfo.idToIndex[tempEdge.sourceId];\n    var targetIx = layoutInfo.idToIndex[tempEdge.targetId];\n    var sourceGraph = layoutInfo.indexToGraph[sourceIx];\n    var targetGraph = layoutInfo.indexToGraph[targetIx];\n    if (sourceGraph != targetGraph) {\n      // Find lowest common graph ancestor\n      var lca = findLCA(tempEdge.sourceId, tempEdge.targetId, layoutInfo);\n\n      // Compute sum of node depths, relative to lca graph\n      var lcaGraph = layoutInfo.graphSet[lca];\n      var depth = 0;\n\n      // Source depth\n      var tempNode = layoutInfo.layoutNodes[sourceIx];\n      while (-1 === lcaGraph.indexOf(tempNode.id)) {\n        tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]];\n        depth++;\n      }\n\n      // Target depth\n      tempNode = layoutInfo.layoutNodes[targetIx];\n      while (-1 === lcaGraph.indexOf(tempNode.id)) {\n        tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]];\n        depth++;\n      }\n\n      // logDebug('LCA of nodes ' + tempEdge.sourceId + ' and ' + tempEdge.targetId +\n      //  \". Index: \" + lca + \" Contents: \" + lcaGraph.toString() +\n      //  \". Depth: \" + depth);\n\n      // Update idealLength\n      idealLength *= depth * options.nestingFactor;\n    }\n    tempEdge.idealLength = idealLength;\n    tempEdge.elasticity = elasticity;\n    layoutInfo.layoutEdges.push(tempEdge);\n  }\n\n  // Finally, return layoutInfo object\n  return layoutInfo;\n};\n\n/**\n * @brief : This function finds the index of the lowest common\n *          graph ancestor between 2 nodes in the subtree\n *          (from the graph hierarchy induced tree) whose\n *          root is graphIx\n *\n * @arg node1: node1's ID\n * @arg node2: node2's ID\n * @arg layoutInfo: layoutInfo object\n *\n */\nvar findLCA = function findLCA(node1, node2, layoutInfo) {\n  // Find their common ancester, starting from the root graph\n  var res = _findLCA_aux(node1, node2, 0, layoutInfo);\n  if (2 > res.count) {\n    // If aux function couldn't find the common ancester,\n    // then it is the root graph\n    return 0;\n  } else {\n    return res.graph;\n  }\n};\n\n/**\n * @brief          : Auxiliary function used for LCA computation\n *\n * @arg node1      : node1's ID\n * @arg node2      : node2's ID\n * @arg graphIx    : subgraph index\n * @arg layoutInfo : layoutInfo object\n *\n * @return         : object of the form {count: X, graph: Y}, where:\n *                   X is the number of ancestors (max: 2) found in\n *                   graphIx (and it's subgraphs),\n *                   Y is the graph index of the lowest graph containing\n *                   all X nodes\n */\nvar _findLCA_aux = function findLCA_aux(node1, node2, graphIx, layoutInfo) {\n  var graph = layoutInfo.graphSet[graphIx];\n  // If both nodes belongs to graphIx\n  if (-1 < graph.indexOf(node1) && -1 < graph.indexOf(node2)) {\n    return {\n      count: 2,\n      graph: graphIx\n    };\n  }\n\n  // Make recursive calls for all subgraphs\n  var c = 0;\n  for (var i = 0; i < graph.length; i++) {\n    var nodeId = graph[i];\n    var nodeIx = layoutInfo.idToIndex[nodeId];\n    var children = layoutInfo.layoutNodes[nodeIx].children;\n\n    // If the node has no child, skip it\n    if (0 === children.length) {\n      continue;\n    }\n    var childGraphIx = layoutInfo.indexToGraph[layoutInfo.idToIndex[children[0]]];\n    var result = _findLCA_aux(node1, node2, childGraphIx, layoutInfo);\n    if (0 === result.count) {\n      // Neither node1 nor node2 are present in this subgraph\n      continue;\n    } else if (1 === result.count) {\n      // One of (node1, node2) is present in this subgraph\n      c++;\n      if (2 === c) {\n        // We've already found both nodes, no need to keep searching\n        break;\n      }\n    } else {\n      // Both nodes are present in this subgraph\n      return result;\n    }\n  }\n  return {\n    count: c,\n    graph: graphIx\n  };\n};\n\n/**\n * @brief: printsLayoutInfo into js console\n *         Only used for debbuging\n */\nvar printLayoutInfo; \n\n/**\n * @brief : Randomizes the position of all nodes\n */\nvar randomizePositions = function randomizePositions(layoutInfo, cy) {\n  var width = layoutInfo.clientWidth;\n  var height = layoutInfo.clientHeight;\n  for (var i = 0; i < layoutInfo.nodeSize; i++) {\n    var n = layoutInfo.layoutNodes[i];\n\n    // No need to randomize compound nodes or locked nodes\n    if (0 === n.children.length && !n.isLocked) {\n      n.positionX = Math.random() * width;\n      n.positionY = Math.random() * height;\n    }\n  }\n};\nvar getScaleInBoundsFn = function getScaleInBoundsFn(layoutInfo, options, nodes) {\n  var bb = layoutInfo.boundingBox;\n  var coseBB = {\n    x1: Infinity,\n    x2: -Infinity,\n    y1: Infinity,\n    y2: -Infinity\n  };\n  if (options.boundingBox) {\n    nodes.forEach(function (node) {\n      var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]];\n      coseBB.x1 = Math.min(coseBB.x1, lnode.positionX);\n      coseBB.x2 = Math.max(coseBB.x2, lnode.positionX);\n      coseBB.y1 = Math.min(coseBB.y1, lnode.positionY);\n      coseBB.y2 = Math.max(coseBB.y2, lnode.positionY);\n    });\n    coseBB.w = coseBB.x2 - coseBB.x1;\n    coseBB.h = coseBB.y2 - coseBB.y1;\n  }\n  return function (ele, i) {\n    var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data('id')]];\n    if (options.boundingBox) {\n      // then add extra bounding box constraint\n      // Handle single node case where coseBB.w or coseBB.h is 0\n      var pctX = coseBB.w === 0 ? 0.5 : (lnode.positionX - coseBB.x1) / coseBB.w;\n      var pctY = coseBB.h === 0 ? 0.5 : (lnode.positionY - coseBB.y1) / coseBB.h;\n      return {\n        x: bb.x1 + pctX * bb.w,\n        y: bb.y1 + pctY * bb.h\n      };\n    } else {\n      return {\n        x: lnode.positionX,\n        y: lnode.positionY\n      };\n    }\n  };\n};\n\n/**\n * @brief          : Updates the positions of nodes in the network\n * @arg layoutInfo : LayoutInfo object\n * @arg cy         : Cytoscape object\n * @arg options    : Layout options\n */\nvar refreshPositions = function refreshPositions(layoutInfo, cy, options) {\n  // var s = 'Refreshing positions';\n  // logDebug(s);\n\n  var layout = options.layout;\n  var nodes = options.eles.nodes();\n  var getScaledPos = getScaleInBoundsFn(layoutInfo, options, nodes);\n  nodes.positions(getScaledPos);\n\n  // Trigger layoutReady only on first call\n  if (true !== layoutInfo.ready) {\n    // s = 'Triggering layoutready';\n    // logDebug(s);\n    layoutInfo.ready = true;\n    layout.one('layoutready', options.ready);\n    layout.emit({\n      type: 'layoutready',\n      layout: this\n    });\n  }\n};\n\n/**\n * @brief : Logs a debug message in JS console, if DEBUG is ON\n */\n// var logDebug = function(text) {\n//   if (DEBUG) {\n//     console.debug(text);\n//   }\n// };\n\n/**\n * @brief          : Performs one iteration of the physical simulation\n * @arg layoutInfo : LayoutInfo object already initialized\n * @arg cy         : Cytoscape object\n * @arg options    : Layout options\n */\nvar step = function step(layoutInfo, options, _step) {\n  // var s = \"\\n\\n###############################\";\n  // s += \"\\nSTEP: \" + step;\n  // s += \"\\n###############################\\n\";\n  // logDebug(s);\n\n  // Calculate node repulsions\n  calculateNodeForces(layoutInfo, options);\n  // Calculate edge forces\n  calculateEdgeForces(layoutInfo);\n  // Calculate gravity forces\n  calculateGravityForces(layoutInfo, options);\n  // Propagate forces from parent to child\n  propagateForces(layoutInfo);\n  // Update positions based on calculated forces\n  updatePositions(layoutInfo);\n};\n\n/**\n * @brief : Computes the node repulsion forces\n */\nvar calculateNodeForces = function calculateNodeForces(layoutInfo, options) {\n  // Go through each of the graphs in graphSet\n  // Nodes only repel each other if they belong to the same graph\n  // var s = 'calculateNodeForces';\n  // logDebug(s);\n  for (var i = 0; i < layoutInfo.graphSet.length; i++) {\n    var graph = layoutInfo.graphSet[i];\n    var numNodes = graph.length;\n\n    // s = \"Set: \" + graph.toString();\n    // logDebug(s);\n\n    // Now get all the pairs of nodes\n    // Only get each pair once, (A, B) = (B, A)\n    for (var j = 0; j < numNodes; j++) {\n      var node1 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]];\n      for (var k = j + 1; k < numNodes; k++) {\n        var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[k]]];\n        nodeRepulsion(node1, node2, layoutInfo, options);\n      }\n    }\n  }\n};\nvar randomDistance = function randomDistance(max) {\n  return -1 + 2 * max * Math.random();\n};\n\n/**\n * @brief : Compute the node repulsion forces between a pair of nodes\n */\nvar nodeRepulsion = function nodeRepulsion(node1, node2, layoutInfo, options) {\n  // var s = \"Node repulsion. Node1: \" + node1.id + \" Node2: \" + node2.id;\n\n  var cmptId1 = node1.cmptId;\n  var cmptId2 = node2.cmptId;\n  if (cmptId1 !== cmptId2 && !layoutInfo.isCompound) {\n    return;\n  }\n\n  // Get direction of line connecting both node centers\n  var directionX = node2.positionX - node1.positionX;\n  var directionY = node2.positionY - node1.positionY;\n  var maxRandDist = 1;\n  // s += \"\\ndirectionX: \" + directionX + \", directionY: \" + directionY;\n\n  // If both centers are the same, apply a random force\n  if (0 === directionX && 0 === directionY) {\n    directionX = randomDistance(maxRandDist);\n    directionY = randomDistance(maxRandDist);\n  }\n  var overlap = nodesOverlap(node1, node2, directionX, directionY);\n  if (overlap > 0) {\n    // s += \"\\nNodes DO overlap.\";\n    // s += \"\\nOverlap: \" + overlap;\n    // If nodes overlap, repulsion force is proportional\n    // to the overlap\n    var force = options.nodeOverlap * overlap;\n\n    // Compute the module and components of the force vector\n    var distance = Math.sqrt(directionX * directionX + directionY * directionY);\n    // s += \"\\nDistance: \" + distance;\n    var forceX = force * directionX / distance;\n    var forceY = force * directionY / distance;\n  } else {\n    // s += \"\\nNodes do NOT overlap.\";\n    // If there's no overlap, force is inversely proportional\n    // to squared distance\n\n    // Get clipping points for both nodes\n    var point1 = findClippingPoint(node1, directionX, directionY);\n    var point2 = findClippingPoint(node2, -1 * directionX, -1 * directionY);\n\n    // Use clipping points to compute distance\n    var distanceX = point2.x - point1.x;\n    var distanceY = point2.y - point1.y;\n    var distanceSqr = distanceX * distanceX + distanceY * distanceY;\n    var distance = Math.sqrt(distanceSqr);\n    // s += \"\\nDistance: \" + distance;\n\n    // Compute the module and components of the force vector\n    var force = (node1.nodeRepulsion + node2.nodeRepulsion) / distanceSqr;\n    var forceX = force * distanceX / distance;\n    var forceY = force * distanceY / distance;\n  }\n\n  // Apply force\n  if (!node1.isLocked) {\n    node1.offsetX -= forceX;\n    node1.offsetY -= forceY;\n  }\n  if (!node2.isLocked) {\n    node2.offsetX += forceX;\n    node2.offsetY += forceY;\n  }\n\n  // s += \"\\nForceX: \" + forceX + \" ForceY: \" + forceY;\n  // logDebug(s);\n\n  return;\n};\n\n/**\n * @brief  : Determines whether two nodes overlap or not\n * @return : Amount of overlapping (0 => no overlap)\n */\nvar nodesOverlap = function nodesOverlap(node1, node2, dX, dY) {\n  if (dX > 0) {\n    var overlapX = node1.maxX - node2.minX;\n  } else {\n    var overlapX = node2.maxX - node1.minX;\n  }\n  if (dY > 0) {\n    var overlapY = node1.maxY - node2.minY;\n  } else {\n    var overlapY = node2.maxY - node1.minY;\n  }\n  if (overlapX >= 0 && overlapY >= 0) {\n    return Math.sqrt(overlapX * overlapX + overlapY * overlapY);\n  } else {\n    return 0;\n  }\n};\n\n/**\n * @brief : Finds the point in which an edge (direction dX, dY) intersects\n *          the rectangular bounding box of it's source/target node\n */\nvar findClippingPoint = function findClippingPoint(node, dX, dY) {\n  // Shorcuts\n  var X = node.positionX;\n  var Y = node.positionY;\n  var H = node.height || 1;\n  var W = node.width || 1;\n  var dirSlope = dY / dX;\n  var nodeSlope = H / W;\n\n  // var s = 'Computing clipping point of node ' + node.id +\n  //   \" . Height:  \" + H + \", Width: \" + W +\n  //   \"\\nDirection \" + dX + \", \" + dY;\n  //\n  // Compute intersection\n  var res = {};\n\n  // Case: Vertical direction (up)\n  if (0 === dX && 0 < dY) {\n    res.x = X;\n    // s += \"\\nUp direction\";\n    res.y = Y + H / 2;\n    return res;\n  }\n\n  // Case: Vertical direction (down)\n  if (0 === dX && 0 > dY) {\n    res.x = X;\n    res.y = Y + H / 2;\n    // s += \"\\nDown direction\";\n\n    return res;\n  }\n\n  // Case: Intersects the right border\n  if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) {\n    res.x = X + W / 2;\n    res.y = Y + W * dY / 2 / dX;\n    // s += \"\\nRightborder\";\n\n    return res;\n  }\n\n  // Case: Intersects the left border\n  if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) {\n    res.x = X - W / 2;\n    res.y = Y - W * dY / 2 / dX;\n    // s += \"\\nLeftborder\";\n\n    return res;\n  }\n\n  // Case: Intersects the top border\n  if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) {\n    res.x = X + H * dX / 2 / dY;\n    res.y = Y + H / 2;\n    // s += \"\\nTop border\";\n\n    return res;\n  }\n\n  // Case: Intersects the bottom border\n  if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) {\n    res.x = X - H * dX / 2 / dY;\n    res.y = Y - H / 2;\n    // s += \"\\nBottom border\";\n\n    return res;\n  }\n\n  // s += \"\\nClipping point found at \" + res.x + \", \" + res.y;\n  // logDebug(s);\n  return res;\n};\n\n/**\n * @brief : Calculates all edge forces\n */\nvar calculateEdgeForces = function calculateEdgeForces(layoutInfo, options) {\n  // Iterate over all edges\n  for (var i = 0; i < layoutInfo.edgeSize; i++) {\n    // Get edge, source & target nodes\n    var edge = layoutInfo.layoutEdges[i];\n    var sourceIx = layoutInfo.idToIndex[edge.sourceId];\n    var source = layoutInfo.layoutNodes[sourceIx];\n    var targetIx = layoutInfo.idToIndex[edge.targetId];\n    var target = layoutInfo.layoutNodes[targetIx];\n\n    // Get direction of line connecting both node centers\n    var directionX = target.positionX - source.positionX;\n    var directionY = target.positionY - source.positionY;\n\n    // If both centers are the same, do nothing.\n    // A random force has already been applied as node repulsion\n    if (0 === directionX && 0 === directionY) {\n      continue;\n    }\n\n    // Get clipping points for both nodes\n    var point1 = findClippingPoint(source, directionX, directionY);\n    var point2 = findClippingPoint(target, -1 * directionX, -1 * directionY);\n    var lx = point2.x - point1.x;\n    var ly = point2.y - point1.y;\n    var l = Math.sqrt(lx * lx + ly * ly);\n    var force = Math.pow(edge.idealLength - l, 2) / edge.elasticity;\n    if (0 !== l) {\n      var forceX = force * lx / l;\n      var forceY = force * ly / l;\n    } else {\n      var forceX = 0;\n      var forceY = 0;\n    }\n\n    // Add this force to target and source nodes\n    if (!source.isLocked) {\n      source.offsetX += forceX;\n      source.offsetY += forceY;\n    }\n    if (!target.isLocked) {\n      target.offsetX -= forceX;\n      target.offsetY -= forceY;\n    }\n\n    // var s = 'Edge force between nodes ' + source.id + ' and ' + target.id;\n    // s += \"\\nDistance: \" + l + \" Force: (\" + forceX + \", \" + forceY + \")\";\n    // logDebug(s);\n  }\n};\n\n/**\n * @brief : Computes gravity forces for all nodes\n */\nvar calculateGravityForces = function calculateGravityForces(layoutInfo, options) {\n  if (options.gravity === 0) {\n    return;\n  }\n  var distThreshold = 1;\n\n  // var s = 'calculateGravityForces';\n  // logDebug(s);\n  for (var i = 0; i < layoutInfo.graphSet.length; i++) {\n    var graph = layoutInfo.graphSet[i];\n    var numNodes = graph.length;\n\n    // s = \"Set: \" + graph.toString();\n    // logDebug(s);\n\n    // Compute graph center\n    if (0 === i) {\n      var centerX = layoutInfo.clientHeight / 2;\n      var centerY = layoutInfo.clientWidth / 2;\n    } else {\n      // Get Parent node for this graph, and use its position as center\n      var temp = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[0]]];\n      var parent = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]];\n      var centerX = parent.positionX;\n      var centerY = parent.positionY;\n    }\n    // s = \"Center found at: \" + centerX + \", \" + centerY;\n    // logDebug(s);\n\n    // Apply force to all nodes in graph\n    for (var j = 0; j < numNodes; j++) {\n      var node = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]];\n      // s = \"Node: \" + node.id;\n\n      if (node.isLocked) {\n        continue;\n      }\n      var dx = centerX - node.positionX;\n      var dy = centerY - node.positionY;\n      var d = Math.sqrt(dx * dx + dy * dy);\n      if (d > distThreshold) {\n        var fx = options.gravity * dx / d;\n        var fy = options.gravity * dy / d;\n        node.offsetX += fx;\n        node.offsetY += fy;\n        // s += \": Applied force: \" + fx + \", \" + fy;\n      }\n      // logDebug(s);\n    }\n  }\n};\n\n/**\n * @brief          : This function propagates the existing offsets from\n *                   parent nodes to its descendents.\n * @arg layoutInfo : layoutInfo Object\n * @arg cy         : cytoscape Object\n * @arg options    : Layout options\n */\nvar propagateForces = function propagateForces(layoutInfo, options) {\n  // Inline implementation of a queue, used for traversing the graph in BFS order\n  var queue = [];\n  var start = 0; // Points to the start the queue\n  var end = -1; // Points to the end of the queue\n\n  // logDebug('propagateForces');\n\n  // Start by visiting the nodes in the root graph\n  queue.push.apply(queue, layoutInfo.graphSet[0]);\n  end += layoutInfo.graphSet[0].length;\n\n  // Traverse the graph, level by level,\n  while (start <= end) {\n    // Get the node to visit and remove it from queue\n    var nodeId = queue[start++];\n    var nodeIndex = layoutInfo.idToIndex[nodeId];\n    var node = layoutInfo.layoutNodes[nodeIndex];\n    var children = node.children;\n\n    // We only need to process the node if it's compound\n    if (0 < children.length && !node.isLocked) {\n      var offX = node.offsetX;\n      var offY = node.offsetY;\n\n      // var s = \"Propagating offset from parent node : \" + node.id +\n      //   \". OffsetX: \" + offX + \". OffsetY: \" + offY;\n      // s += \"\\n Children: \" + children.toString();\n      // logDebug(s);\n\n      for (var i = 0; i < children.length; i++) {\n        var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children[i]]];\n        // Propagate offset\n        childNode.offsetX += offX;\n        childNode.offsetY += offY;\n        // Add children to queue to be visited\n        queue[++end] = children[i];\n      }\n\n      // Reset parent offsets\n      node.offsetX = 0;\n      node.offsetY = 0;\n    }\n  }\n};\n\n/**\n * @brief : Updates the layout model positions, based on\n *          the accumulated forces\n */\nvar updatePositions = function updatePositions(layoutInfo, options) {\n  // var s = 'Updating positions';\n  // logDebug(s);\n\n  // Reset boundaries for compound nodes\n  for (var i = 0; i < layoutInfo.nodeSize; i++) {\n    var n = layoutInfo.layoutNodes[i];\n    if (0 < n.children.length) {\n      // logDebug(\"Resetting boundaries of compound node: \" + n.id);\n      n.maxX = undefined;\n      n.minX = undefined;\n      n.maxY = undefined;\n      n.minY = undefined;\n    }\n  }\n  for (var i = 0; i < layoutInfo.nodeSize; i++) {\n    var n = layoutInfo.layoutNodes[i];\n    if (0 < n.children.length || n.isLocked) {\n      // No need to set compound or locked node position\n      // logDebug(\"Skipping position update of node: \" + n.id);\n      continue;\n    }\n    // s = \"Node: \" + n.id + \" Previous position: (\" +\n    // n.positionX + \", \" + n.positionY + \").\";\n\n    // Limit displacement in order to improve stability\n    var tempForce = limitForce(n.offsetX, n.offsetY, layoutInfo.temperature);\n    n.positionX += tempForce.x;\n    n.positionY += tempForce.y;\n    n.offsetX = 0;\n    n.offsetY = 0;\n    n.minX = n.positionX - n.width;\n    n.maxX = n.positionX + n.width;\n    n.minY = n.positionY - n.height;\n    n.maxY = n.positionY + n.height;\n    // s += \" New Position: (\" + n.positionX + \", \" + n.positionY + \").\";\n    // logDebug(s);\n\n    // Update ancestry boudaries\n    _updateAncestryBoundaries(n, layoutInfo);\n  }\n\n  // Update size, position of compund nodes\n  for (var i = 0; i < layoutInfo.nodeSize; i++) {\n    var n = layoutInfo.layoutNodes[i];\n    if (0 < n.children.length && !n.isLocked) {\n      n.positionX = (n.maxX + n.minX) / 2;\n      n.positionY = (n.maxY + n.minY) / 2;\n      n.width = n.maxX - n.minX;\n      n.height = n.maxY - n.minY;\n      // s = \"Updating position, size of compound node \" + n.id;\n      // s += \"\\nPositionX: \" + n.positionX + \", PositionY: \" + n.positionY;\n      // s += \"\\nWidth: \" + n.width + \", Height: \" + n.height;\n      // logDebug(s);\n    }\n  }\n};\n\n/**\n * @brief : Limits a force (forceX, forceY) to be not\n *          greater (in modulo) than max.\n 8          Preserves force direction.\n  */\nvar limitForce = function limitForce(forceX, forceY, max) {\n  // var s = \"Limiting force: (\" + forceX + \", \" + forceY + \"). Max: \" + max;\n  var force = Math.sqrt(forceX * forceX + forceY * forceY);\n  if (force > max) {\n    var res = {\n      x: max * forceX / force,\n      y: max * forceY / force\n    };\n  } else {\n    var res = {\n      x: forceX,\n      y: forceY\n    };\n  }\n\n  // s += \".\\nResult: (\" + res.x + \", \" + res.y + \")\";\n  // logDebug(s);\n\n  return res;\n};\n\n/**\n * @brief : Function used for keeping track of compound node\n *          sizes, since they should bound all their subnodes.\n */\nvar _updateAncestryBoundaries = function updateAncestryBoundaries(node, layoutInfo) {\n  // var s = \"Propagating new position/size of node \" + node.id;\n  var parentId = node.parentId;\n  if (null == parentId) {\n    // If there's no parent, we are done\n    // s += \". No parent node.\";\n    // logDebug(s);\n    return;\n  }\n\n  // Get Parent Node\n  var p = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]];\n  var flag = false;\n\n  // MaxX\n  if (null == p.maxX || node.maxX + p.padRight > p.maxX) {\n    p.maxX = node.maxX + p.padRight;\n    flag = true;\n    // s += \"\\nNew maxX for parent node \" + p.id + \": \" + p.maxX;\n  }\n\n  // MinX\n  if (null == p.minX || node.minX - p.padLeft < p.minX) {\n    p.minX = node.minX - p.padLeft;\n    flag = true;\n    // s += \"\\nNew minX for parent node \" + p.id + \": \" + p.minX;\n  }\n\n  // MaxY\n  if (null == p.maxY || node.maxY + p.padBottom > p.maxY) {\n    p.maxY = node.maxY + p.padBottom;\n    flag = true;\n    // s += \"\\nNew maxY for parent node \" + p.id + \": \" + p.maxY;\n  }\n\n  // MinY\n  if (null == p.minY || node.minY - p.padTop < p.minY) {\n    p.minY = node.minY - p.padTop;\n    flag = true;\n    // s += \"\\nNew minY for parent node \" + p.id + \": \" + p.minY;\n  }\n\n  // If updated boundaries, propagate changes upward\n  if (flag) {\n    // logDebug(s);\n    return _updateAncestryBoundaries(p, layoutInfo);\n  }\n\n  // s += \". No changes in boundaries/position of parent node \" + p.id;\n  // logDebug(s);\n  return;\n};\nvar separateComponents = function separateComponents(layoutInfo, options) {\n  var nodes = layoutInfo.layoutNodes;\n  var components = [];\n  for (var i = 0; i < nodes.length; i++) {\n    var node = nodes[i];\n    var cid = node.cmptId;\n    var component = components[cid] = components[cid] || [];\n    component.push(node);\n  }\n  var totalA = 0;\n  for (var i = 0; i < components.length; i++) {\n    var c = components[i];\n    if (!c) {\n      continue;\n    }\n    c.x1 = Infinity;\n    c.x2 = -Infinity;\n    c.y1 = Infinity;\n    c.y2 = -Infinity;\n    for (var j = 0; j < c.length; j++) {\n      var n = c[j];\n      c.x1 = Math.min(c.x1, n.positionX - n.width / 2);\n      c.x2 = Math.max(c.x2, n.positionX + n.width / 2);\n      c.y1 = Math.min(c.y1, n.positionY - n.height / 2);\n      c.y2 = Math.max(c.y2, n.positionY + n.height / 2);\n    }\n    c.w = c.x2 - c.x1;\n    c.h = c.y2 - c.y1;\n    totalA += c.w * c.h;\n  }\n  components.sort(function (c1, c2) {\n    return c2.w * c2.h - c1.w * c1.h;\n  });\n  var x = 0;\n  var y = 0;\n  var usedW = 0;\n  var rowH = 0;\n  var maxRowW = Math.sqrt(totalA) * layoutInfo.clientWidth / layoutInfo.clientHeight;\n  for (var i = 0; i < components.length; i++) {\n    var c = components[i];\n    if (!c) {\n      continue;\n    }\n    for (var j = 0; j < c.length; j++) {\n      var n = c[j];\n      if (!n.isLocked) {\n        n.positionX += x - c.x1;\n        n.positionY += y - c.y1;\n      }\n    }\n    x += c.w + options.componentSpacing;\n    usedW += c.w + options.componentSpacing;\n    rowH = Math.max(rowH, c.h);\n    if (usedW > maxRowW) {\n      y += rowH + options.componentSpacing;\n      x = 0;\n      usedW = 0;\n      rowH = 0;\n    }\n  }\n};\n\nvar defaults$3 = {\n  fit: true,\n  // whether to fit the viewport to the graph\n  padding: 30,\n  // padding used on fit\n  boundingBox: undefined,\n  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n  avoidOverlap: true,\n  // prevents node overlap, may overflow boundingBox if not enough space\n  avoidOverlapPadding: 10,\n  // extra spacing around nodes when avoidOverlap: true\n  nodeDimensionsIncludeLabels: false,\n  // Excludes the label when calculating node bounding boxes for the layout algorithm\n  spacingFactor: undefined,\n  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n  condense: false,\n  // uses all available space on false, uses minimal space on true\n  rows: undefined,\n  // force num of rows in the grid\n  cols: undefined,\n  // force num of columns in the grid\n  position: function position(node) {},\n  // returns { row, col } for element\n  sort: undefined,\n  // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }\n  animate: false,\n  // whether to transition the node positions\n  animationDuration: 500,\n  // duration of animation in ms if enabled\n  animationEasing: undefined,\n  // easing of animation if enabled\n  animateFilter: function animateFilter(node, i) {\n    return true;\n  },\n  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts\n  ready: undefined,\n  // callback on layoutready\n  stop: undefined,\n  // callback on layoutstop\n  transform: function transform(node, position) {\n    return position;\n  } // transform a given node position. Useful for changing flow direction in discrete layouts \n};\nfunction GridLayout(options) {\n  this.options = extend({}, defaults$3, options);\n}\nGridLayout.prototype.run = function () {\n  var params = this.options;\n  var options = params;\n  var cy = params.cy;\n  var eles = options.eles;\n  var nodes = eles.nodes().not(':parent');\n  if (options.sort) {\n    nodes = nodes.sort(options.sort);\n  }\n  var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n    x1: 0,\n    y1: 0,\n    w: cy.width(),\n    h: cy.height()\n  });\n  if (bb.h === 0 || bb.w === 0) {\n    eles.nodes().layoutPositions(this, options, function (ele) {\n      return {\n        x: bb.x1,\n        y: bb.y1\n      };\n    });\n  } else {\n    // width/height * splits^2 = cells where splits is number of times to split width\n    var cells = nodes.size();\n    var splits = Math.sqrt(cells * bb.h / bb.w);\n    var rows = Math.round(splits);\n    var cols = Math.round(bb.w / bb.h * splits);\n    var small = function small(val) {\n      if (val == null) {\n        return Math.min(rows, cols);\n      } else {\n        var min = Math.min(rows, cols);\n        if (min == rows) {\n          rows = val;\n        } else {\n          cols = val;\n        }\n      }\n    };\n    var large = function large(val) {\n      if (val == null) {\n        return Math.max(rows, cols);\n      } else {\n        var max = Math.max(rows, cols);\n        if (max == rows) {\n          rows = val;\n        } else {\n          cols = val;\n        }\n      }\n    };\n    var oRows = options.rows;\n    var oCols = options.cols != null ? options.cols : options.columns;\n\n    // if rows or columns were set in options, use those values\n    if (oRows != null && oCols != null) {\n      rows = oRows;\n      cols = oCols;\n    } else if (oRows != null && oCols == null) {\n      rows = oRows;\n      cols = Math.ceil(cells / rows);\n    } else if (oRows == null && oCols != null) {\n      cols = oCols;\n      rows = Math.ceil(cells / cols);\n    }\n\n    // otherwise use the automatic values and adjust accordingly\n\n    // if rounding was up, see if we can reduce rows or columns\n    else if (cols * rows > cells) {\n      var sm = small();\n      var lg = large();\n\n      // reducing the small side takes away the most cells, so try it first\n      if ((sm - 1) * lg >= cells) {\n        small(sm - 1);\n      } else if ((lg - 1) * sm >= cells) {\n        large(lg - 1);\n      }\n    } else {\n      // if rounding was too low, add rows or columns\n      while (cols * rows < cells) {\n        var _sm = small();\n        var _lg = large();\n\n        // try to add to larger side first (adds less in multiplication)\n        if ((_lg + 1) * _sm >= cells) {\n          large(_lg + 1);\n        } else {\n          small(_sm + 1);\n        }\n      }\n    }\n    var cellWidth = bb.w / cols;\n    var cellHeight = bb.h / rows;\n    if (options.condense) {\n      cellWidth = 0;\n      cellHeight = 0;\n    }\n    if (options.avoidOverlap) {\n      for (var i = 0; i < nodes.length; i++) {\n        var node = nodes[i];\n        var pos = node._private.position;\n        if (pos.x == null || pos.y == null) {\n          // for bb\n          pos.x = 0;\n          pos.y = 0;\n        }\n        var nbb = node.layoutDimensions(options);\n        var p = options.avoidOverlapPadding;\n        var w = nbb.w + p;\n        var h = nbb.h + p;\n        cellWidth = Math.max(cellWidth, w);\n        cellHeight = Math.max(cellHeight, h);\n      }\n    }\n    var cellUsed = {}; // e.g. 'c-0-2' => true\n\n    var used = function used(row, col) {\n      return cellUsed['c-' + row + '-' + col] ? true : false;\n    };\n    var use = function use(row, col) {\n      cellUsed['c-' + row + '-' + col] = true;\n    };\n\n    // to keep track of current cell position\n    var row = 0;\n    var col = 0;\n    var moveToNextCell = function moveToNextCell() {\n      col++;\n      if (col >= cols) {\n        col = 0;\n        row++;\n      }\n    };\n\n    // get a cache of all the manual positions\n    var id2manPos = {};\n    for (var _i = 0; _i < nodes.length; _i++) {\n      var _node = nodes[_i];\n      var rcPos = options.position(_node);\n      if (rcPos && (rcPos.row !== undefined || rcPos.col !== undefined)) {\n        // must have at least row or col def'd\n        var _pos = {\n          row: rcPos.row,\n          col: rcPos.col\n        };\n        if (_pos.col === undefined) {\n          // find unused col\n          _pos.col = 0;\n          while (used(_pos.row, _pos.col)) {\n            _pos.col++;\n          }\n        } else if (_pos.row === undefined) {\n          // find unused row\n          _pos.row = 0;\n          while (used(_pos.row, _pos.col)) {\n            _pos.row++;\n          }\n        }\n        id2manPos[_node.id()] = _pos;\n        use(_pos.row, _pos.col);\n      }\n    }\n    var getPos = function getPos(element, i) {\n      var x, y;\n      if (element.locked() || element.isParent()) {\n        return false;\n      }\n\n      // see if we have a manual position set\n      var rcPos = id2manPos[element.id()];\n      if (rcPos) {\n        x = rcPos.col * cellWidth + cellWidth / 2 + bb.x1;\n        y = rcPos.row * cellHeight + cellHeight / 2 + bb.y1;\n      } else {\n        // otherwise set automatically\n\n        while (used(row, col)) {\n          moveToNextCell();\n        }\n        x = col * cellWidth + cellWidth / 2 + bb.x1;\n        y = row * cellHeight + cellHeight / 2 + bb.y1;\n        use(row, col);\n        moveToNextCell();\n      }\n      return {\n        x: x,\n        y: y\n      };\n    };\n    nodes.layoutPositions(this, options, getPos);\n  }\n  return this; // chaining\n};\n\n// default layout options\nvar defaults$2 = {\n  ready: function ready() {},\n  // on layoutready\n  stop: function stop() {} // on layoutstop\n};\n\n// constructor\n// options : object containing layout options\nfunction NullLayout(options) {\n  this.options = extend({}, defaults$2, options);\n}\n\n// runs the layout\nNullLayout.prototype.run = function () {\n  var options = this.options;\n  var eles = options.eles; // elements to consider in the layout\n  var layout = this;\n\n  // cy is automatically populated for us in the constructor\n  // (disable eslint for next line as this serves as example layout code to external developers)\n  // eslint-disable-next-line no-unused-vars\n  options.cy;\n  layout.emit('layoutstart');\n\n  // puts all nodes at (0, 0)\n  // n.b. most layouts would use layoutPositions(), instead of positions() and manual events\n  eles.nodes().positions(function () {\n    return {\n      x: 0,\n      y: 0\n    };\n  });\n\n  // trigger layoutready when each node has had its position set at least once\n  layout.one('layoutready', options.ready);\n  layout.emit('layoutready');\n\n  // trigger layoutstop when the layout stops (e.g. finishes)\n  layout.one('layoutstop', options.stop);\n  layout.emit('layoutstop');\n  return this; // chaining\n};\n\n// called on continuous layouts to stop them before they finish\nNullLayout.prototype.stop = function () {\n  return this; // chaining\n};\n\nvar defaults$1 = {\n  positions: undefined,\n  // map of (node id) => (position obj); or function(node){ return somPos; }\n  zoom: undefined,\n  // the zoom level to set (prob want fit = false if set)\n  pan: undefined,\n  // the pan level to set (prob want fit = false if set)\n  fit: true,\n  // whether to fit to viewport\n  padding: 30,\n  // padding on fit\n  spacingFactor: undefined,\n  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n  animate: false,\n  // whether to transition the node positions\n  animationDuration: 500,\n  // duration of animation in ms if enabled\n  animationEasing: undefined,\n  // easing of animation if enabled\n  animateFilter: function animateFilter(node, i) {\n    return true;\n  },\n  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts\n  ready: undefined,\n  // callback on layoutready\n  stop: undefined,\n  // callback on layoutstop\n  transform: function transform(node, position) {\n    return position;\n  } // transform a given node position. Useful for changing flow direction in discrete layouts\n};\nfunction PresetLayout(options) {\n  this.options = extend({}, defaults$1, options);\n}\nPresetLayout.prototype.run = function () {\n  var options = this.options;\n  var eles = options.eles;\n  var nodes = eles.nodes();\n  var posIsFn = fn$6(options.positions);\n  function getPosition(node) {\n    if (options.positions == null) {\n      return copyPosition(node.position());\n    }\n    if (posIsFn) {\n      return options.positions(node);\n    }\n    var pos = options.positions[node._private.data.id];\n    if (pos == null) {\n      return null;\n    }\n    return pos;\n  }\n  nodes.layoutPositions(this, options, function (node, i) {\n    var position = getPosition(node);\n    if (node.locked() || position == null) {\n      return false;\n    }\n    return position;\n  });\n  return this; // chaining\n};\n\nvar defaults = {\n  fit: true,\n  // whether to fit to viewport\n  padding: 30,\n  // fit padding\n  boundingBox: undefined,\n  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n  animate: false,\n  // whether to transition the node positions\n  animationDuration: 500,\n  // duration of animation in ms if enabled\n  animationEasing: undefined,\n  // easing of animation if enabled\n  animateFilter: function animateFilter(node, i) {\n    return true;\n  },\n  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts\n  ready: undefined,\n  // callback on layoutready\n  stop: undefined,\n  // callback on layoutstop\n  transform: function transform(node, position) {\n    return position;\n  } // transform a given node position. Useful for changing flow direction in discrete layouts \n};\nfunction RandomLayout(options) {\n  this.options = extend({}, defaults, options);\n}\nRandomLayout.prototype.run = function () {\n  var options = this.options;\n  var cy = options.cy;\n  var eles = options.eles;\n  var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n    x1: 0,\n    y1: 0,\n    w: cy.width(),\n    h: cy.height()\n  });\n  var getPos = function getPos(node, i) {\n    return {\n      x: bb.x1 + Math.round(Math.random() * bb.w),\n      y: bb.y1 + Math.round(Math.random() * bb.h)\n    };\n  };\n  eles.nodes().layoutPositions(this, options, getPos);\n  return this; // chaining\n};\n\nvar layout = [{\n  name: 'breadthfirst',\n  impl: BreadthFirstLayout\n}, {\n  name: 'circle',\n  impl: CircleLayout\n}, {\n  name: 'concentric',\n  impl: ConcentricLayout\n}, {\n  name: 'cose',\n  impl: CoseLayout\n}, {\n  name: 'grid',\n  impl: GridLayout\n}, {\n  name: 'null',\n  impl: NullLayout\n}, {\n  name: 'preset',\n  impl: PresetLayout\n}, {\n  name: 'random',\n  impl: RandomLayout\n}];\n\nfunction NullRenderer(options) {\n  this.options = options;\n  this.notifications = 0; // for testing\n}\nvar noop = function noop() {};\nvar throwImgErr = function throwImgErr() {\n  throw new Error('A headless instance can not render images');\n};\nNullRenderer.prototype = {\n  recalculateRenderedStyle: noop,\n  notify: function notify() {\n    this.notifications++;\n  },\n  init: noop,\n  isHeadless: function isHeadless() {\n    return true;\n  },\n  png: throwImgErr,\n  jpg: throwImgErr\n};\n\nvar BRp$f = {};\nBRp$f.arrowShapeWidth = 0.3;\nBRp$f.registerArrowShapes = function () {\n  var arrowShapes = this.arrowShapes = {};\n  var renderer = this;\n\n  // Contract for arrow shapes:\n  // 0, 0 is arrow tip\n  // (0, 1) is direction towards node\n  // (1, 0) is right\n  //\n  // functional api:\n  // collide: check x, y in shape\n  // roughCollide: called before collide, no false negatives\n  // draw: draw\n  // spacing: dist(arrowTip, nodeBoundary)\n  // gap: dist(edgeTip, nodeBoundary), edgeTip may != arrowTip\n\n  var bbCollide = function bbCollide(x, y, size, angle, translation, edgeWidth, padding) {\n    var x1 = translation.x - size / 2 - padding;\n    var x2 = translation.x + size / 2 + padding;\n    var y1 = translation.y - size / 2 - padding;\n    var y2 = translation.y + size / 2 + padding;\n    var inside = x1 <= x && x <= x2 && y1 <= y && y <= y2;\n    return inside;\n  };\n  var transform = function transform(x, y, size, angle, translation) {\n    var xRotated = x * Math.cos(angle) - y * Math.sin(angle);\n    var yRotated = x * Math.sin(angle) + y * Math.cos(angle);\n    var xScaled = xRotated * size;\n    var yScaled = yRotated * size;\n    var xTranslated = xScaled + translation.x;\n    var yTranslated = yScaled + translation.y;\n    return {\n      x: xTranslated,\n      y: yTranslated\n    };\n  };\n  var transformPoints = function transformPoints(pts, size, angle, translation) {\n    var retPts = [];\n    for (var i = 0; i < pts.length; i += 2) {\n      var x = pts[i];\n      var y = pts[i + 1];\n      retPts.push(transform(x, y, size, angle, translation));\n    }\n    return retPts;\n  };\n  var pointsToArr = function pointsToArr(pts) {\n    var ret = [];\n    for (var i = 0; i < pts.length; i++) {\n      var p = pts[i];\n      ret.push(p.x, p.y);\n    }\n    return ret;\n  };\n  var standardGap = function standardGap(edge) {\n    return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').pfValue * 2;\n  };\n  var defineArrowShape = function defineArrowShape(name, defn) {\n    if (string(defn)) {\n      defn = arrowShapes[defn];\n    }\n    arrowShapes[name] = extend({\n      name: name,\n      points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3],\n      collide: function collide(x, y, size, angle, translation, padding) {\n        var points = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation));\n        var inside = pointInsidePolygonPoints(x, y, points);\n        return inside;\n      },\n      roughCollide: bbCollide,\n      draw: function draw(context, size, angle, translation) {\n        var points = transformPoints(this.points, size, angle, translation);\n        renderer.arrowShapeImpl('polygon')(context, points);\n      },\n      spacing: function spacing(edge) {\n        return 0;\n      },\n      gap: standardGap\n    }, defn);\n  };\n  defineArrowShape('none', {\n    collide: falsify,\n    roughCollide: falsify,\n    draw: noop$1,\n    spacing: zeroify,\n    gap: zeroify\n  });\n  defineArrowShape('triangle', {\n    points: [-0.15, -0.3, 0, 0, 0.15, -0.3]\n  });\n  defineArrowShape('arrow', 'triangle');\n  defineArrowShape('triangle-backcurve', {\n    points: arrowShapes['triangle'].points,\n    controlPoint: [0, -0.15],\n    roughCollide: bbCollide,\n    draw: function draw(context, size, angle, translation, edgeWidth) {\n      var ptsTrans = transformPoints(this.points, size, angle, translation);\n      var ctrlPt = this.controlPoint;\n      var ctrlPtTrans = transform(ctrlPt[0], ctrlPt[1], size, angle, translation);\n      renderer.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans);\n    },\n    gap: function gap(edge) {\n      return standardGap(edge) * 0.8;\n    }\n  });\n  defineArrowShape('triangle-tee', {\n    points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],\n    pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4],\n    collide: function collide(x, y, size, angle, translation, edgeWidth, padding) {\n      var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation));\n      var teePts = pointsToArr(transformPoints(this.pointsTee, size + 2 * padding, angle, translation));\n      var inside = pointInsidePolygonPoints(x, y, triPts) || pointInsidePolygonPoints(x, y, teePts);\n      return inside;\n    },\n    draw: function draw(context, size, angle, translation, edgeWidth) {\n      var triPts = transformPoints(this.points, size, angle, translation);\n      var teePts = transformPoints(this.pointsTee, size, angle, translation);\n      renderer.arrowShapeImpl(this.name)(context, triPts, teePts);\n    }\n  });\n  defineArrowShape('circle-triangle', {\n    radius: 0.15,\n    pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15],\n    collide: function collide(x, y, size, angle, translation, edgeWidth, padding) {\n      var t = translation;\n      var circleInside = Math.pow(t.x - x, 2) + Math.pow(t.y - y, 2) <= Math.pow((size + 2 * padding) * this.radius, 2);\n      var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation));\n      return pointInsidePolygonPoints(x, y, triPts) || circleInside;\n    },\n    draw: function draw(context, size, angle, translation, edgeWidth) {\n      var triPts = transformPoints(this.pointsTr, size, angle, translation);\n      renderer.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size);\n    },\n    spacing: function spacing(edge) {\n      return renderer.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.radius;\n    }\n  });\n  defineArrowShape('triangle-cross', {\n    points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],\n    baseCrossLinePts: [-0.15, -0.4,\n    // first half of the rectangle\n    -0.15, -0.4, 0.15, -0.4,\n    // second half of the rectangle\n    0.15, -0.4],\n    crossLinePts: function crossLinePts(size, edgeWidth) {\n      // shift points so that the distance between the cross points matches edge width\n      var p = this.baseCrossLinePts.slice();\n      var shiftFactor = edgeWidth / size;\n      var y0 = 3;\n      var y1 = 5;\n      p[y0] = p[y0] - shiftFactor;\n      p[y1] = p[y1] - shiftFactor;\n      return p;\n    },\n    collide: function collide(x, y, size, angle, translation, edgeWidth, padding) {\n      var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation));\n      var teePts = pointsToArr(transformPoints(this.crossLinePts(size, edgeWidth), size + 2 * padding, angle, translation));\n      var inside = pointInsidePolygonPoints(x, y, triPts) || pointInsidePolygonPoints(x, y, teePts);\n      return inside;\n    },\n    draw: function draw(context, size, angle, translation, edgeWidth) {\n      var triPts = transformPoints(this.points, size, angle, translation);\n      var crossLinePts = transformPoints(this.crossLinePts(size, edgeWidth), size, angle, translation);\n      renderer.arrowShapeImpl(this.name)(context, triPts, crossLinePts);\n    }\n  });\n  defineArrowShape('vee', {\n    points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15],\n    gap: function gap(edge) {\n      return standardGap(edge) * 0.525;\n    }\n  });\n  defineArrowShape('circle', {\n    radius: 0.15,\n    collide: function collide(x, y, size, angle, translation, edgeWidth, padding) {\n      var t = translation;\n      var inside = Math.pow(t.x - x, 2) + Math.pow(t.y - y, 2) <= Math.pow((size + 2 * padding) * this.radius, 2);\n      return inside;\n    },\n    draw: function draw(context, size, angle, translation, edgeWidth) {\n      renderer.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size);\n    },\n    spacing: function spacing(edge) {\n      return renderer.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.radius;\n    }\n  });\n  defineArrowShape('tee', {\n    points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0],\n    spacing: function spacing(edge) {\n      return 1;\n    },\n    gap: function gap(edge) {\n      return 1;\n    }\n  });\n  defineArrowShape('square', {\n    points: [-0.15, 0.00, 0.15, 0.00, 0.15, -0.3, -0.15, -0.3]\n  });\n  defineArrowShape('diamond', {\n    points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0],\n    gap: function gap(edge) {\n      return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').value;\n    }\n  });\n  defineArrowShape('chevron', {\n    points: [0, 0, -0.15, -0.15, -0.1, -0.2, 0, -0.1, 0.1, -0.2, 0.15, -0.15],\n    gap: function gap(edge) {\n      return 0.95 * edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').value;\n    }\n  });\n};\n\nvar BRp$e = {};\n\n// Project mouse\nBRp$e.projectIntoViewport = function (clientX, clientY) {\n  var cy = this.cy;\n  var offsets = this.findContainerClientCoords();\n  var offsetLeft = offsets[0];\n  var offsetTop = offsets[1];\n  var scale = offsets[4];\n  var pan = cy.pan();\n  var zoom = cy.zoom();\n  var x = ((clientX - offsetLeft) / scale - pan.x) / zoom;\n  var y = ((clientY - offsetTop) / scale - pan.y) / zoom;\n  return [x, y];\n};\nBRp$e.findContainerClientCoords = function () {\n  if (this.containerBB) {\n    return this.containerBB;\n  }\n  var container = this.container;\n  var rect = container.getBoundingClientRect();\n  var style = this.cy.window().getComputedStyle(container);\n  var styleValue = function styleValue(name) {\n    return parseFloat(style.getPropertyValue(name));\n  };\n  var padding = {\n    left: styleValue('padding-left'),\n    right: styleValue('padding-right'),\n    top: styleValue('padding-top'),\n    bottom: styleValue('padding-bottom')\n  };\n  var border = {\n    left: styleValue('border-left-width'),\n    right: styleValue('border-right-width'),\n    top: styleValue('border-top-width'),\n    bottom: styleValue('border-bottom-width')\n  };\n  var clientWidth = container.clientWidth;\n  var clientHeight = container.clientHeight;\n  var paddingHor = padding.left + padding.right;\n  var paddingVer = padding.top + padding.bottom;\n  var borderHor = border.left + border.right;\n  var scale = rect.width / (clientWidth + borderHor);\n  var unscaledW = clientWidth - paddingHor;\n  var unscaledH = clientHeight - paddingVer;\n  var left = rect.left + padding.left + border.left;\n  var top = rect.top + padding.top + border.top;\n  return this.containerBB = [left, top, unscaledW, unscaledH, scale];\n};\nBRp$e.invalidateContainerClientCoordsCache = function () {\n  this.containerBB = null;\n};\nBRp$e.findNearestElement = function (x, y, interactiveElementsOnly, isTouch) {\n  return this.findNearestElements(x, y, interactiveElementsOnly, isTouch)[0];\n};\nBRp$e.findNearestElements = function (x, y, interactiveElementsOnly, isTouch) {\n  var self = this;\n  var r = this;\n  var eles = r.getCachedZSortedEles();\n  var near = []; // 1 node max, 1 edge max\n  var zoom = r.cy.zoom();\n  var hasCompounds = r.cy.hasCompoundNodes();\n  var edgeThreshold = (isTouch ? 24 : 8) / zoom;\n  var nodeThreshold = (isTouch ? 8 : 2) / zoom;\n  var labelThreshold = (isTouch ? 8 : 2) / zoom;\n  var minSqDist = Infinity;\n  var nearEdge;\n  var nearNode;\n  if (interactiveElementsOnly) {\n    eles = eles.interactive;\n  }\n  function addEle(ele, sqDist) {\n    if (ele.isNode()) {\n      if (nearNode) {\n        return; // can't replace node\n      } else {\n        nearNode = ele;\n        near.push(ele);\n      }\n    }\n    if (ele.isEdge() && (sqDist == null || sqDist < minSqDist)) {\n      if (nearEdge) {\n        // then replace existing edge\n        // can replace only if same z-index\n        if (nearEdge.pstyle('z-compound-depth').value === ele.pstyle('z-compound-depth').value && nearEdge.pstyle('z-compound-depth').value === ele.pstyle('z-compound-depth').value) {\n          for (var i = 0; i < near.length; i++) {\n            if (near[i].isEdge()) {\n              near[i] = ele;\n              nearEdge = ele;\n              minSqDist = sqDist != null ? sqDist : minSqDist;\n              break;\n            }\n          }\n        }\n      } else {\n        near.push(ele);\n        nearEdge = ele;\n        minSqDist = sqDist != null ? sqDist : minSqDist;\n      }\n    }\n  }\n  function checkNode(node) {\n    var width = node.outerWidth() + 2 * nodeThreshold;\n    var height = node.outerHeight() + 2 * nodeThreshold;\n    var hw = width / 2;\n    var hh = height / 2;\n    var pos = node.position();\n    var cornerRadius = node.pstyle('corner-radius').value === 'auto' ? 'auto' : node.pstyle('corner-radius').pfValue;\n    var rs = node._private.rscratch;\n    if (pos.x - hw <= x && x <= pos.x + hw // bb check x\n    && pos.y - hh <= y && y <= pos.y + hh // bb check y\n    ) {\n      var shape = r.nodeShapes[self.getNodeShape(node)];\n      if (shape.checkPoint(x, y, 0, width, height, pos.x, pos.y, cornerRadius, rs)) {\n        addEle(node, 0);\n        return true;\n      }\n    }\n  }\n  function checkEdge(edge) {\n    var _p = edge._private;\n    var rs = _p.rscratch;\n    var styleWidth = edge.pstyle('width').pfValue;\n    var scale = edge.pstyle('arrow-scale').value;\n    var width = styleWidth / 2 + edgeThreshold; // more like a distance radius from centre\n    var widthSq = width * width;\n    var width2 = width * 2;\n    var src = _p.source;\n    var tgt = _p.target;\n    var sqDist;\n    if (rs.edgeType === 'segments' || rs.edgeType === 'straight' || rs.edgeType === 'haystack') {\n      var pts = rs.allpts;\n      for (var i = 0; i + 3 < pts.length; i += 2) {\n        if (inLineVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], width2) && widthSq > (sqDist = sqdistToFiniteLine(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3]))) {\n          addEle(edge, sqDist);\n          return true;\n        }\n      }\n    } else if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') {\n      var pts = rs.allpts;\n      for (var i = 0; i + 5 < rs.allpts.length; i += 4) {\n        if (inBezierVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5], width2) && widthSq > (sqDist = sqdistToQuadraticBezier(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5]))) {\n          addEle(edge, sqDist);\n          return true;\n        }\n      }\n    }\n\n    // if we're close to the edge but didn't hit it, maybe we hit its arrows\n\n    var src = src || _p.source;\n    var tgt = tgt || _p.target;\n    var arSize = self.getArrowWidth(styleWidth, scale);\n    var arrows = [{\n      name: 'source',\n      x: rs.arrowStartX,\n      y: rs.arrowStartY,\n      angle: rs.srcArrowAngle\n    }, {\n      name: 'target',\n      x: rs.arrowEndX,\n      y: rs.arrowEndY,\n      angle: rs.tgtArrowAngle\n    }, {\n      name: 'mid-source',\n      x: rs.midX,\n      y: rs.midY,\n      angle: rs.midsrcArrowAngle\n    }, {\n      name: 'mid-target',\n      x: rs.midX,\n      y: rs.midY,\n      angle: rs.midtgtArrowAngle\n    }];\n    for (var i = 0; i < arrows.length; i++) {\n      var ar = arrows[i];\n      var shape = r.arrowShapes[edge.pstyle(ar.name + '-arrow-shape').value];\n      var edgeWidth = edge.pstyle('width').pfValue;\n      if (shape.roughCollide(x, y, arSize, ar.angle, {\n        x: ar.x,\n        y: ar.y\n      }, edgeWidth, edgeThreshold) && shape.collide(x, y, arSize, ar.angle, {\n        x: ar.x,\n        y: ar.y\n      }, edgeWidth, edgeThreshold)) {\n        addEle(edge);\n        return true;\n      }\n    }\n\n    // for compound graphs, hitting edge may actually want a connected node instead (b/c edge may have greater z-index precedence)\n    if (hasCompounds && near.length > 0) {\n      checkNode(src);\n      checkNode(tgt);\n    }\n  }\n  function preprop(obj, name, pre) {\n    return getPrefixedProperty(obj, name, pre);\n  }\n  function checkLabel(ele, prefix) {\n    var _p = ele._private;\n    var th = labelThreshold;\n    var prefixDash;\n    if (prefix) {\n      prefixDash = prefix + '-';\n    } else {\n      prefixDash = '';\n    }\n    ele.boundingBox();\n    var bb = _p.labelBounds[prefix || 'main'];\n    var text = ele.pstyle(prefixDash + 'label').value;\n    var eventsEnabled = ele.pstyle('text-events').strValue === 'yes';\n    if (!eventsEnabled || !text) {\n      return;\n    }\n    var lx = preprop(_p.rscratch, 'labelX', prefix);\n    var ly = preprop(_p.rscratch, 'labelY', prefix);\n    var theta = preprop(_p.rscratch, 'labelAngle', prefix);\n    var ox = ele.pstyle(prefixDash + 'text-margin-x').pfValue;\n    var oy = ele.pstyle(prefixDash + 'text-margin-y').pfValue;\n    var lx1 = bb.x1 - th - ox; // (-ox, -oy) as bb already includes margin\n    var lx2 = bb.x2 + th - ox; // and rotation is about (lx, ly)\n    var ly1 = bb.y1 - th - oy;\n    var ly2 = bb.y2 + th - oy;\n    if (theta) {\n      var cos = Math.cos(theta);\n      var sin = Math.sin(theta);\n      var rotate = function rotate(x, y) {\n        x = x - lx;\n        y = y - ly;\n        return {\n          x: x * cos - y * sin + lx,\n          y: x * sin + y * cos + ly\n        };\n      };\n      var px1y1 = rotate(lx1, ly1);\n      var px1y2 = rotate(lx1, ly2);\n      var px2y1 = rotate(lx2, ly1);\n      var px2y2 = rotate(lx2, ly2);\n      var points = [\n      // with the margin added after the rotation is applied\n      px1y1.x + ox, px1y1.y + oy, px2y1.x + ox, px2y1.y + oy, px2y2.x + ox, px2y2.y + oy, px1y2.x + ox, px1y2.y + oy];\n      if (pointInsidePolygonPoints(x, y, points)) {\n        addEle(ele);\n        return true;\n      }\n    } else {\n      // do a cheaper bb check\n      if (inBoundingBox(bb, x, y)) {\n        addEle(ele);\n        return true;\n      }\n    }\n  }\n  for (var i = eles.length - 1; i >= 0; i--) {\n    // reverse order for precedence\n    var ele = eles[i];\n    if (ele.isNode()) {\n      checkNode(ele) || checkLabel(ele);\n    } else {\n      // then edge\n      checkEdge(ele) || checkLabel(ele) || checkLabel(ele, 'source') || checkLabel(ele, 'target');\n    }\n  }\n  return near;\n};\n\n// 'Give me everything from this box'\nBRp$e.getAllInBox = function (x1, y1, x2, y2) {\n  var eles = this.getCachedZSortedEles().interactive;\n  var zoom = this.cy.zoom();\n  var labelThreshold = 2 / zoom;\n  var box = [];\n  var x1c = Math.min(x1, x2);\n  var x2c = Math.max(x1, x2);\n  var y1c = Math.min(y1, y2);\n  var y2c = Math.max(y1, y2);\n  x1 = x1c;\n  x2 = x2c;\n  y1 = y1c;\n  y2 = y2c;\n  var boxBb = makeBoundingBox({\n    x1: x1,\n    y1: y1,\n    x2: x2,\n    y2: y2\n  });\n  var selectionBox = [{\n    x: boxBb.x1,\n    y: boxBb.y1\n  }, {\n    x: boxBb.x2,\n    y: boxBb.y1\n  }, {\n    x: boxBb.x2,\n    y: boxBb.y2\n  }, {\n    x: boxBb.x1,\n    y: boxBb.y2\n  }];\n  var boxEdges = [[selectionBox[0], selectionBox[1]], [selectionBox[1], selectionBox[2]], [selectionBox[2], selectionBox[3]], [selectionBox[3], selectionBox[0]]];\n  function preprop(obj, name, pre) {\n    return getPrefixedProperty(obj, name, pre);\n  }\n  function getRotatedLabelBox(ele, prefix) {\n    var _p = ele._private;\n    var th = labelThreshold;\n    var prefixDash = '';\n    ele.boundingBox();\n    var bb = _p.labelBounds['main'];\n\n    // If the bounding box is not available, return null.\n    // This indicates that the label box cannot be calculated, which is consistent\n    // with the expected behavior of this function. Returning null allows the caller\n    // to handle the absence of a bounding box explicitly.\n    if (!bb) {\n      return null;\n    }\n    var lx = preprop(_p.rscratch, 'labelX', prefix);\n    var ly = preprop(_p.rscratch, 'labelY', prefix);\n    var theta = preprop(_p.rscratch, 'labelAngle', prefix);\n    var ox = ele.pstyle(prefixDash + 'text-margin-x').pfValue;\n    var oy = ele.pstyle(prefixDash + 'text-margin-y').pfValue;\n    var lx1 = bb.x1 - th - ox;\n    var lx2 = bb.x2 + th - ox;\n    var ly1 = bb.y1 - th - oy;\n    var ly2 = bb.y2 + th - oy;\n    if (theta) {\n      var cos = Math.cos(theta);\n      var sin = Math.sin(theta);\n      var rotate = function rotate(x, y) {\n        x = x - lx;\n        y = y - ly;\n        return {\n          x: x * cos - y * sin + lx,\n          y: x * sin + y * cos + ly\n        };\n      };\n      return [rotate(lx1, ly1), rotate(lx2, ly1), rotate(lx2, ly2), rotate(lx1, ly2)];\n    } else {\n      return [{\n        x: lx1,\n        y: ly1\n      }, {\n        x: lx2,\n        y: ly1\n      }, {\n        x: lx2,\n        y: ly2\n      }, {\n        x: lx1,\n        y: ly2\n      }];\n    }\n  }\n  function doLinesIntersect(p1, p2, q1, q2) {\n    function ccw(a, b, c) {\n      return (c.y - a.y) * (b.x - a.x) > (b.y - a.y) * (c.x - a.x);\n    }\n    return ccw(p1, q1, q2) !== ccw(p2, q1, q2) && ccw(p1, p2, q1) !== ccw(p1, p2, q2);\n  }\n  for (var e = 0; e < eles.length; e++) {\n    var ele = eles[e];\n    if (ele.isNode()) {\n      var node = ele;\n      var textEvents = node.pstyle('text-events').strValue === 'yes';\n      var nodeBoxSelectMode = node.pstyle('box-selection').strValue;\n      var labelBoxSelectEnabled = node.pstyle('box-select-labels').strValue === 'yes';\n      if (nodeBoxSelectMode === 'none') {\n        continue;\n      }\n      var includeLabels = (nodeBoxSelectMode === 'overlap' || labelBoxSelectEnabled) && textEvents;\n      var nodeBb = node.boundingBox({\n        includeNodes: true,\n        includeEdges: false,\n        includeLabels: includeLabels\n      });\n      if (nodeBoxSelectMode === 'contain') {\n        var selected = false;\n        if (labelBoxSelectEnabled && textEvents) {\n          var rotatedLabelBox = getRotatedLabelBox(node);\n          if (rotatedLabelBox && satPolygonIntersection(rotatedLabelBox, selectionBox)) {\n            box.push(node);\n            selected = true;\n          }\n        }\n        if (!selected && boundingBoxInBoundingBox(boxBb, nodeBb)) {\n          box.push(node);\n        }\n      } else if (nodeBoxSelectMode === 'overlap') {\n        if (boundingBoxesIntersect(boxBb, nodeBb)) {\n          var nodeBodyBb = node.boundingBox({\n            includeNodes: true,\n            includeEdges: true,\n            includeLabels: false,\n            includeMainLabels: false,\n            includeSourceLabels: false,\n            includeTargetLabels: false\n          });\n          var nodeBodyCorners = [{\n            x: nodeBodyBb.x1,\n            y: nodeBodyBb.y1\n          }, {\n            x: nodeBodyBb.x2,\n            y: nodeBodyBb.y1\n          }, {\n            x: nodeBodyBb.x2,\n            y: nodeBodyBb.y2\n          }, {\n            x: nodeBodyBb.x1,\n            y: nodeBodyBb.y2\n          }];\n\n          // if node body intersects, no need to check label\n          if (satPolygonIntersection(nodeBodyCorners, selectionBox)) {\n            box.push(node);\n          } else {\n            // only check label if node body didn't intersect\n            var _rotatedLabelBox = getRotatedLabelBox(node);\n            if (_rotatedLabelBox && satPolygonIntersection(_rotatedLabelBox, selectionBox)) {\n              box.push(node);\n            }\n          }\n        }\n      }\n    } else {\n      var edge = ele;\n      var _p = edge._private;\n      var rs = _p.rscratch;\n      var edgeBoxSelectMode = edge.pstyle('box-selection').strValue;\n      if (edgeBoxSelectMode === 'none') {\n        continue;\n      }\n      if (edgeBoxSelectMode === 'contain') {\n        if (rs.startX != null && rs.startY != null && !inBoundingBox(boxBb, rs.startX, rs.startY)) {\n          continue;\n        }\n        if (rs.endX != null && rs.endY != null && !inBoundingBox(boxBb, rs.endX, rs.endY)) {\n          continue;\n        }\n        if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' || rs.edgeType === 'segments' || rs.edgeType === 'haystack') {\n          var pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts;\n          var allInside = true;\n          for (var i = 0; i < pts.length; i++) {\n            if (!pointInBoundingBox(boxBb, pts[i])) {\n              allInside = false;\n              break;\n            }\n          }\n          if (allInside) {\n            box.push(edge);\n          }\n        } else if (rs.edgeType === 'straight') {\n          box.push(edge);\n        }\n      } else if (edgeBoxSelectMode === 'overlap') {\n        var _selected = false;\n\n        // Check: either endpoint inside box\n        if (rs.startX != null && rs.startY != null && rs.endX != null && rs.endY != null && (inBoundingBox(boxBb, rs.startX, rs.startY) || inBoundingBox(boxBb, rs.endX, rs.endY))) {\n          box.push(edge);\n          _selected = true;\n        }\n\n        // Haystack fallback (only check if not already selected)\n        else if (!_selected && rs.edgeType === 'haystack') {\n          var haystackPts = _p.rstyle.haystackPts;\n          for (var _i = 0; _i < haystackPts.length; _i++) {\n            if (pointInBoundingBox(boxBb, haystackPts[_i])) {\n              box.push(edge);\n              _selected = true;\n              break;\n            }\n          }\n        }\n\n        // Segment intersection check (only if not already selected)\n        if (!_selected) {\n          var _pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts;\n\n          // straight edges\n          if ((!_pts || _pts.length < 2) && rs.edgeType === 'straight') {\n            if (rs.startX != null && rs.startY != null && rs.endX != null && rs.endY != null) {\n              _pts = [{\n                x: rs.startX,\n                y: rs.startY\n              }, {\n                x: rs.endX,\n                y: rs.endY\n              }];\n            }\n          }\n          if (!_pts || _pts.length < 2) continue;\n          for (var _i2 = 0; _i2 < _pts.length - 1; _i2++) {\n            var segStart = _pts[_i2];\n            var segEnd = _pts[_i2 + 1];\n            for (var b = 0; b < boxEdges.length; b++) {\n              var _boxEdges$b = _slicedToArray(boxEdges[b], 2),\n                boxStart = _boxEdges$b[0],\n                boxEnd = _boxEdges$b[1];\n              if (doLinesIntersect(segStart, segEnd, boxStart, boxEnd)) {\n                box.push(edge);\n                _selected = true;\n                break;\n              }\n            }\n            if (_selected) break;\n          }\n        }\n      }\n    }\n  }\n  return box;\n};\n\nvar BRp$d = {};\nBRp$d.calculateArrowAngles = function (edge) {\n  var rs = edge._private.rscratch;\n  var isHaystack = rs.edgeType === 'haystack';\n  var isBezier = rs.edgeType === 'bezier';\n  var isMultibezier = rs.edgeType === 'multibezier';\n  var isSegments = rs.edgeType === 'segments';\n  var isCompound = rs.edgeType === 'compound';\n  var isSelf = rs.edgeType === 'self';\n\n  // Displacement gives direction for arrowhead orientation\n  var dispX, dispY;\n  var startX, startY, endX, endY, midX, midY;\n  if (isHaystack) {\n    startX = rs.haystackPts[0];\n    startY = rs.haystackPts[1];\n    endX = rs.haystackPts[2];\n    endY = rs.haystackPts[3];\n  } else {\n    startX = rs.arrowStartX;\n    startY = rs.arrowStartY;\n    endX = rs.arrowEndX;\n    endY = rs.arrowEndY;\n  }\n  midX = rs.midX;\n  midY = rs.midY;\n\n  // source\n  //\n\n  if (isSegments) {\n    dispX = startX - rs.segpts[0];\n    dispY = startY - rs.segpts[1];\n  } else if (isMultibezier || isCompound || isSelf || isBezier) {\n    var pts = rs.allpts;\n    var bX = qbezierAt(pts[0], pts[2], pts[4], 0.1);\n    var bY = qbezierAt(pts[1], pts[3], pts[5], 0.1);\n    dispX = startX - bX;\n    dispY = startY - bY;\n  } else {\n    dispX = startX - midX;\n    dispY = startY - midY;\n  }\n  rs.srcArrowAngle = getAngleFromDisp(dispX, dispY);\n\n  // mid target\n  //\n\n  var midX = rs.midX;\n  var midY = rs.midY;\n  if (isHaystack) {\n    midX = (startX + endX) / 2;\n    midY = (startY + endY) / 2;\n  }\n  dispX = endX - startX;\n  dispY = endY - startY;\n  if (isSegments) {\n    var pts = rs.allpts;\n    if (pts.length / 2 % 2 === 0) {\n      var i2 = pts.length / 2;\n      var i1 = i2 - 2;\n      dispX = pts[i2] - pts[i1];\n      dispY = pts[i2 + 1] - pts[i1 + 1];\n    } else if (rs.isRound) {\n      dispX = rs.midVector[1];\n      dispY = -rs.midVector[0];\n    } else {\n      var i2 = pts.length / 2 - 1;\n      var i1 = i2 - 2;\n      dispX = pts[i2] - pts[i1];\n      dispY = pts[i2 + 1] - pts[i1 + 1];\n    }\n  } else if (isMultibezier || isCompound || isSelf) {\n    var pts = rs.allpts;\n    var cpts = rs.ctrlpts;\n    var bp0x, bp0y;\n    var bp1x, bp1y;\n    if (cpts.length / 2 % 2 === 0) {\n      var p0 = pts.length / 2 - 1; // startpt\n      var ic = p0 + 2;\n      var p1 = ic + 2;\n      bp0x = qbezierAt(pts[p0], pts[ic], pts[p1], 0.0);\n      bp0y = qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0);\n      bp1x = qbezierAt(pts[p0], pts[ic], pts[p1], 0.0001);\n      bp1y = qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0001);\n    } else {\n      var ic = pts.length / 2 - 1; // ctrpt\n      var p0 = ic - 2; // startpt\n      var p1 = ic + 2; // endpt\n\n      bp0x = qbezierAt(pts[p0], pts[ic], pts[p1], 0.4999);\n      bp0y = qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.4999);\n      bp1x = qbezierAt(pts[p0], pts[ic], pts[p1], 0.5);\n      bp1y = qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.5);\n    }\n    dispX = bp1x - bp0x;\n    dispY = bp1y - bp0y;\n  }\n  rs.midtgtArrowAngle = getAngleFromDisp(dispX, dispY);\n  rs.midDispX = dispX;\n  rs.midDispY = dispY;\n\n  // mid source\n  //\n\n  dispX *= -1;\n  dispY *= -1;\n  if (isSegments) {\n    var pts = rs.allpts;\n    if (pts.length / 2 % 2 === 0) ; else if (!rs.isRound) {\n      var i2 = pts.length / 2 - 1;\n      var i3 = i2 + 2;\n      dispX = -(pts[i3] - pts[i2]);\n      dispY = -(pts[i3 + 1] - pts[i2 + 1]);\n    }\n  }\n  rs.midsrcArrowAngle = getAngleFromDisp(dispX, dispY);\n\n  // target\n  //\n\n  if (isSegments) {\n    dispX = endX - rs.segpts[rs.segpts.length - 2];\n    dispY = endY - rs.segpts[rs.segpts.length - 1];\n  } else if (isMultibezier || isCompound || isSelf || isBezier) {\n    var pts = rs.allpts;\n    var l = pts.length;\n    var bX = qbezierAt(pts[l - 6], pts[l - 4], pts[l - 2], 0.9);\n    var bY = qbezierAt(pts[l - 5], pts[l - 3], pts[l - 1], 0.9);\n    dispX = endX - bX;\n    dispY = endY - bY;\n  } else {\n    dispX = endX - midX;\n    dispY = endY - midY;\n  }\n  rs.tgtArrowAngle = getAngleFromDisp(dispX, dispY);\n};\nBRp$d.getArrowWidth = BRp$d.getArrowHeight = function (edgeWidth, scale) {\n  var cache = this.arrowWidthCache = this.arrowWidthCache || {};\n  var cachedVal = cache[edgeWidth + ', ' + scale];\n  if (cachedVal) {\n    return cachedVal;\n  }\n  cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale;\n  cache[edgeWidth + ', ' + scale] = cachedVal;\n  return cachedVal;\n};\n\n/**\n * Explained by Blindman67 at https://stackoverflow.com/a/44856925/11028828\n */\n\n// Declare reused variable to avoid reallocating variables every time the function is called\nvar x,\n  y,\n  v1 = {},\n  v2 = {},\n  sinA,\n  sinA90,\n  radDirection,\n  drawDirection,\n  angle,\n  halfAngle,\n  cRadius,\n  lenOut,\n  radius,\n  limit;\nvar startX, startY, stopX, stopY;\nvar lastPoint;\n\n// convert 2 points into vector form, polar form, and normalised\nvar asVec = function asVec(p, pp, v) {\n  v.x = pp.x - p.x;\n  v.y = pp.y - p.y;\n  v.len = Math.sqrt(v.x * v.x + v.y * v.y);\n  v.nx = v.x / v.len;\n  v.ny = v.y / v.len;\n  v.ang = Math.atan2(v.ny, v.nx);\n};\nvar invertVec = function invertVec(originalV, invertedV) {\n  invertedV.x = originalV.x * -1;\n  invertedV.y = originalV.y * -1;\n  invertedV.nx = originalV.nx * -1;\n  invertedV.ny = originalV.ny * -1;\n  invertedV.ang = originalV.ang > 0 ? -(Math.PI - originalV.ang) : Math.PI + originalV.ang;\n};\nvar calcCornerArc = function calcCornerArc(previousPoint, currentPoint, nextPoint, radiusMax, isArcRadius) {\n  //-----------------------------------------\n  // Part 1\n  previousPoint !== lastPoint ? asVec(currentPoint, previousPoint, v1) : invertVec(v2, v1); // Avoid recalculating vec if it is the invert of the last one calculated\n  asVec(currentPoint, nextPoint, v2);\n  sinA = v1.nx * v2.ny - v1.ny * v2.nx;\n  sinA90 = v1.nx * v2.nx - v1.ny * -v2.ny;\n  angle = Math.asin(Math.max(-1, Math.min(1, sinA)));\n  if (Math.abs(angle) < 1e-6) {\n    x = currentPoint.x;\n    y = currentPoint.y;\n    cRadius = radius = 0;\n    return;\n  }\n  //-----------------------------------------\n  radDirection = 1;\n  drawDirection = false;\n  if (sinA90 < 0) {\n    if (angle < 0) {\n      angle = Math.PI + angle;\n    } else {\n      angle = Math.PI - angle;\n      radDirection = -1;\n      drawDirection = true;\n    }\n  } else {\n    if (angle > 0) {\n      radDirection = -1;\n      drawDirection = true;\n    }\n  }\n  if (currentPoint.radius !== undefined) {\n    radius = currentPoint.radius;\n  } else {\n    radius = radiusMax;\n  }\n  //-----------------------------------------\n  // Part 2\n  halfAngle = angle / 2;\n  //-----------------------------------------\n\n  limit = Math.min(v1.len / 2, v2.len / 2);\n  if (isArcRadius) {\n    //-----------------------------------------\n    // Part 3\n    lenOut = Math.abs(Math.cos(halfAngle) * radius / Math.sin(halfAngle));\n\n    //-----------------------------------------\n    // Special part A\n    if (lenOut > limit) {\n      lenOut = limit;\n      cRadius = Math.abs(lenOut * Math.sin(halfAngle) / Math.cos(halfAngle));\n    } else {\n      cRadius = radius;\n    }\n  } else {\n    lenOut = Math.min(limit, radius);\n    cRadius = Math.abs(lenOut * Math.sin(halfAngle) / Math.cos(halfAngle));\n  }\n  //-----------------------------------------\n\n  //-----------------------------------------\n  // Part 4\n  stopX = currentPoint.x + v2.nx * lenOut;\n  stopY = currentPoint.y + v2.ny * lenOut;\n  //-----------------------------------------\n  // Part 5\n  x = stopX - v2.ny * cRadius * radDirection;\n  y = stopY + v2.nx * cRadius * radDirection;\n  //-----------------------------------------\n  // Additional Part : calculate start point E\n  startX = currentPoint.x + v1.nx * lenOut;\n  startY = currentPoint.y + v1.ny * lenOut;\n\n  // Save last point to avoid recalculating vector when not needed\n  lastPoint = currentPoint;\n};\n\n/**\n * Draw corner provided by {@link getRoundCorner}\n *\n * @param ctx :CanvasRenderingContext2D\n * @param roundCorner {{cx:number, cy:number, radius:number, endAngle: number, startAngle: number, counterClockwise: boolean}}\n */\nfunction drawPreparedRoundCorner(ctx, roundCorner) {\n  if (roundCorner.radius === 0) ctx.lineTo(roundCorner.cx, roundCorner.cy);else ctx.arc(roundCorner.cx, roundCorner.cy, roundCorner.radius, roundCorner.startAngle, roundCorner.endAngle, roundCorner.counterClockwise);\n}\n\n/**\n * Get round corner from a point and its previous and next neighbours in a path\n *\n * @param previousPoint {{x: number, y:number, radius: number?}}\n * @param currentPoint {{x: number, y:number, radius: number?}}\n * @param nextPoint {{x: number, y:number, radius: number?}}\n * @param radiusMax :number\n * @param isArcRadius :boolean\n * @return {{\n * cx:number, cy:number, radius:number,\n * startX:number, startY:number,\n * stopX:number, stopY: number,\n * endAngle: number, startAngle: number, counterClockwise: boolean\n * }}\n */\nfunction getRoundCorner(previousPoint, currentPoint, nextPoint, radiusMax) {\n  var isArcRadius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n  if (radiusMax === 0 || currentPoint.radius === 0) return {\n    cx: currentPoint.x,\n    cy: currentPoint.y,\n    radius: 0,\n    startX: currentPoint.x,\n    startY: currentPoint.y,\n    stopX: currentPoint.x,\n    stopY: currentPoint.y,\n    startAngle: undefined,\n    endAngle: undefined,\n    counterClockwise: undefined\n  };\n  calcCornerArc(previousPoint, currentPoint, nextPoint, radiusMax, isArcRadius);\n  return {\n    cx: x,\n    cy: y,\n    radius: cRadius,\n    startX: startX,\n    startY: startY,\n    stopX: stopX,\n    stopY: stopY,\n    startAngle: v1.ang + Math.PI / 2 * radDirection,\n    endAngle: v2.ang - Math.PI / 2 * radDirection,\n    counterClockwise: drawDirection\n  };\n}\n\nvar AVOID_IMPOSSIBLE_BEZIER_CONSTANT = 0.01;\nvar AVOID_IMPOSSIBLE_BEZIER_CONSTANT_L = Math.sqrt(2 * AVOID_IMPOSSIBLE_BEZIER_CONSTANT);\nvar BRp$c = {};\nBRp$c.findMidptPtsEtc = function (edge, pairInfo) {\n  var posPts = pairInfo.posPts,\n    intersectionPts = pairInfo.intersectionPts,\n    vectorNormInverse = pairInfo.vectorNormInverse;\n  var midptPts;\n\n  // n.b. assumes all edges in bezier bundle have same endpoints specified\n  var srcManEndpt = edge.pstyle('source-endpoint');\n  var tgtManEndpt = edge.pstyle('target-endpoint');\n  var haveManualEndPts = srcManEndpt.units != null && tgtManEndpt.units != null;\n  var recalcVectorNormInverse = function recalcVectorNormInverse(x1, y1, x2, y2) {\n    var dy = y2 - y1;\n    var dx = x2 - x1;\n    var l = Math.sqrt(dx * dx + dy * dy);\n    return {\n      x: -dy / l,\n      y: dx / l\n    };\n  };\n  var edgeDistances = edge.pstyle('edge-distances').value;\n  switch (edgeDistances) {\n    case 'node-position':\n      midptPts = posPts;\n      break;\n    case 'intersection':\n      midptPts = intersectionPts;\n      break;\n    case 'endpoints':\n      {\n        if (haveManualEndPts) {\n          var _this$manualEndptToPx = this.manualEndptToPx(edge.source()[0], srcManEndpt),\n            _this$manualEndptToPx2 = _slicedToArray(_this$manualEndptToPx, 2),\n            x1 = _this$manualEndptToPx2[0],\n            y1 = _this$manualEndptToPx2[1];\n          var _this$manualEndptToPx3 = this.manualEndptToPx(edge.target()[0], tgtManEndpt),\n            _this$manualEndptToPx4 = _slicedToArray(_this$manualEndptToPx3, 2),\n            x2 = _this$manualEndptToPx4[0],\n            y2 = _this$manualEndptToPx4[1];\n          var endPts = {\n            x1: x1,\n            y1: y1,\n            x2: x2,\n            y2: y2\n          };\n          vectorNormInverse = recalcVectorNormInverse(x1, y1, x2, y2);\n          midptPts = endPts;\n        } else {\n          warn(\"Edge \".concat(edge.id(), \" has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint.  Falling back on edge-distances:intersection (default).\"));\n          midptPts = intersectionPts; // back to default\n        }\n        break;\n      }\n  }\n  return {\n    midptPts: midptPts,\n    vectorNormInverse: vectorNormInverse\n  };\n};\nBRp$c.findHaystackPoints = function (edges) {\n  for (var i = 0; i < edges.length; i++) {\n    var edge = edges[i];\n    var _p = edge._private;\n    var rs = _p.rscratch;\n    if (!rs.haystack) {\n      var angle = Math.random() * 2 * Math.PI;\n      rs.source = {\n        x: Math.cos(angle),\n        y: Math.sin(angle)\n      };\n      angle = Math.random() * 2 * Math.PI;\n      rs.target = {\n        x: Math.cos(angle),\n        y: Math.sin(angle)\n      };\n    }\n    var src = _p.source;\n    var tgt = _p.target;\n    var srcPos = src.position();\n    var tgtPos = tgt.position();\n    var srcW = src.width();\n    var tgtW = tgt.width();\n    var srcH = src.height();\n    var tgtH = tgt.height();\n    var radius = edge.pstyle('haystack-radius').value;\n    var halfRadius = radius / 2; // b/c have to half width/height\n\n    rs.haystackPts = rs.allpts = [rs.source.x * srcW * halfRadius + srcPos.x, rs.source.y * srcH * halfRadius + srcPos.y, rs.target.x * tgtW * halfRadius + tgtPos.x, rs.target.y * tgtH * halfRadius + tgtPos.y];\n    rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2;\n    rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2;\n\n    // always override as haystack in case set to different type previously\n    rs.edgeType = 'haystack';\n    rs.haystack = true;\n    this.storeEdgeProjections(edge);\n    this.calculateArrowAngles(edge);\n    this.recalculateEdgeLabelProjections(edge);\n    this.calculateLabelAngles(edge);\n  }\n};\nBRp$c.findSegmentsPoints = function (edge, pairInfo) {\n  // Segments (multiple straight lines)\n\n  var rs = edge._private.rscratch;\n  var segmentWs = edge.pstyle('segment-weights');\n  var segmentDs = edge.pstyle('segment-distances');\n  var segmentRs = edge.pstyle('segment-radii');\n  var segmentTs = edge.pstyle('radius-type');\n  var segmentsN = Math.min(segmentWs.pfValue.length, segmentDs.pfValue.length);\n  var lastRadius = segmentRs.pfValue[segmentRs.pfValue.length - 1];\n  var lastRadiusType = segmentTs.pfValue[segmentTs.pfValue.length - 1];\n  rs.edgeType = 'segments';\n  rs.segpts = [];\n  rs.radii = [];\n  rs.isArcRadius = [];\n  for (var s = 0; s < segmentsN; s++) {\n    var w = segmentWs.pfValue[s];\n    var d = segmentDs.pfValue[s];\n    var w1 = 1 - w;\n    var w2 = w;\n    var _this$findMidptPtsEtc = this.findMidptPtsEtc(edge, pairInfo),\n      midptPts = _this$findMidptPtsEtc.midptPts,\n      vectorNormInverse = _this$findMidptPtsEtc.vectorNormInverse;\n    var adjustedMidpt = {\n      x: midptPts.x1 * w1 + midptPts.x2 * w2,\n      y: midptPts.y1 * w1 + midptPts.y2 * w2\n    };\n    rs.segpts.push(adjustedMidpt.x + vectorNormInverse.x * d, adjustedMidpt.y + vectorNormInverse.y * d);\n    rs.radii.push(segmentRs.pfValue[s] !== undefined ? segmentRs.pfValue[s] : lastRadius);\n    rs.isArcRadius.push((segmentTs.pfValue[s] !== undefined ? segmentTs.pfValue[s] : lastRadiusType) === 'arc-radius');\n  }\n};\nBRp$c.findLoopPoints = function (edge, pairInfo, i, edgeIsUnbundled) {\n  // Self-edge\n\n  var rs = edge._private.rscratch;\n  var dirCounts = pairInfo.dirCounts,\n    srcPos = pairInfo.srcPos;\n  var ctrlptDists = edge.pstyle('control-point-distances');\n  var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined;\n  var loopDir = edge.pstyle('loop-direction').pfValue;\n  var loopSwp = edge.pstyle('loop-sweep').pfValue;\n  var stepSize = edge.pstyle('control-point-step-size').pfValue;\n  rs.edgeType = 'self';\n  var j = i;\n  var loopDist = stepSize;\n  if (edgeIsUnbundled) {\n    j = 0;\n    loopDist = ctrlptDist;\n  }\n  var loopAngle = loopDir - Math.PI / 2;\n  var outAngle = loopAngle - loopSwp / 2;\n  var inAngle = loopAngle + loopSwp / 2;\n\n  // increase by step size for overlapping loops, keyed on direction and sweep values\n  var dc = String(loopDir + '_' + loopSwp);\n  j = dirCounts[dc] === undefined ? dirCounts[dc] = 0 : ++dirCounts[dc];\n  rs.ctrlpts = [srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1)];\n};\nBRp$c.findCompoundLoopPoints = function (edge, pairInfo, i, edgeIsUnbundled) {\n  // Compound edge\n\n  var rs = edge._private.rscratch;\n  rs.edgeType = 'compound';\n  var srcPos = pairInfo.srcPos,\n    tgtPos = pairInfo.tgtPos,\n    srcW = pairInfo.srcW,\n    srcH = pairInfo.srcH,\n    tgtW = pairInfo.tgtW,\n    tgtH = pairInfo.tgtH;\n  var stepSize = edge.pstyle('control-point-step-size').pfValue;\n  var ctrlptDists = edge.pstyle('control-point-distances');\n  var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined;\n  var j = i;\n  var loopDist = stepSize;\n  if (edgeIsUnbundled) {\n    j = 0;\n    loopDist = ctrlptDist;\n  }\n  var loopW = 50;\n  var loopaPos = {\n    x: srcPos.x - srcW / 2,\n    y: srcPos.y - srcH / 2\n  };\n  var loopbPos = {\n    x: tgtPos.x - tgtW / 2,\n    y: tgtPos.y - tgtH / 2\n  };\n  var loopPos = {\n    x: Math.min(loopaPos.x, loopbPos.x),\n    y: Math.min(loopaPos.y, loopbPos.y)\n  };\n\n  // avoids cases with impossible beziers\n  var minCompoundStretch = 0.5;\n  var compoundStretchA = Math.max(minCompoundStretch, Math.log(srcW * AVOID_IMPOSSIBLE_BEZIER_CONSTANT));\n  var compoundStretchB = Math.max(minCompoundStretch, Math.log(tgtW * AVOID_IMPOSSIBLE_BEZIER_CONSTANT));\n  rs.ctrlpts = [loopPos.x, loopPos.y - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, loopPos.y];\n};\nBRp$c.findStraightEdgePoints = function (edge) {\n  // Straight edge within bundle\n\n  edge._private.rscratch.edgeType = 'straight';\n};\nBRp$c.findBezierPoints = function (edge, pairInfo, i, edgeIsUnbundled, edgeIsSwapped) {\n  var rs = edge._private.rscratch;\n  var stepSize = edge.pstyle('control-point-step-size').pfValue;\n  var ctrlptDists = edge.pstyle('control-point-distances');\n  var ctrlptWs = edge.pstyle('control-point-weights');\n  var bezierN = ctrlptDists && ctrlptWs ? Math.min(ctrlptDists.value.length, ctrlptWs.value.length) : 1;\n  var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined;\n  var ctrlptWeight = ctrlptWs.value[0];\n\n  // (Multi)bezier\n\n  var multi = edgeIsUnbundled;\n  rs.edgeType = multi ? 'multibezier' : 'bezier';\n  rs.ctrlpts = [];\n  for (var b = 0; b < bezierN; b++) {\n    var normctrlptDist = (0.5 - pairInfo.eles.length / 2 + i) * stepSize * (edgeIsSwapped ? -1 : 1);\n    var manctrlptDist = undefined;\n    var sign = signum(normctrlptDist);\n    if (multi) {\n      ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b] : stepSize; // fall back on step size\n      ctrlptWeight = ctrlptWs.value[b];\n    }\n    if (edgeIsUnbundled) {\n      // multi or single unbundled\n      manctrlptDist = ctrlptDist;\n    } else {\n      manctrlptDist = ctrlptDist !== undefined ? sign * ctrlptDist : undefined;\n    }\n    var distanceFromMidpoint = manctrlptDist !== undefined ? manctrlptDist : normctrlptDist;\n    var w1 = 1 - ctrlptWeight;\n    var w2 = ctrlptWeight;\n    var _this$findMidptPtsEtc2 = this.findMidptPtsEtc(edge, pairInfo),\n      midptPts = _this$findMidptPtsEtc2.midptPts,\n      vectorNormInverse = _this$findMidptPtsEtc2.vectorNormInverse;\n    var adjustedMidpt = {\n      x: midptPts.x1 * w1 + midptPts.x2 * w2,\n      y: midptPts.y1 * w1 + midptPts.y2 * w2\n    };\n    rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint);\n  }\n};\nBRp$c.findTaxiPoints = function (edge, pairInfo) {\n  // Taxicab geometry with two turns maximum\n\n  var rs = edge._private.rscratch;\n  rs.edgeType = 'segments';\n  var VERTICAL = 'vertical';\n  var HORIZONTAL = 'horizontal';\n  var LEFTWARD = 'leftward';\n  var RIGHTWARD = 'rightward';\n  var DOWNWARD = 'downward';\n  var UPWARD = 'upward';\n  var AUTO = 'auto';\n  var posPts = pairInfo.posPts,\n    srcW = pairInfo.srcW,\n    srcH = pairInfo.srcH,\n    tgtW = pairInfo.tgtW,\n    tgtH = pairInfo.tgtH;\n  var edgeDistances = edge.pstyle('edge-distances').value;\n  var dIncludesNodeBody = edgeDistances !== 'node-position';\n  var taxiDir = edge.pstyle('taxi-direction').value;\n  var rawTaxiDir = taxiDir; // unprocessed value\n  var taxiTurn = edge.pstyle('taxi-turn');\n  var turnIsPercent = taxiTurn.units === '%';\n  var taxiTurnPfVal = taxiTurn.pfValue;\n  var turnIsNegative = taxiTurnPfVal < 0; // i.e. from target side\n  var minD = edge.pstyle('taxi-turn-min-distance').pfValue;\n  var dw = dIncludesNodeBody ? (srcW + tgtW) / 2 : 0;\n  var dh = dIncludesNodeBody ? (srcH + tgtH) / 2 : 0;\n  var pdx = posPts.x2 - posPts.x1;\n  var pdy = posPts.y2 - posPts.y1;\n\n  // take away the effective w/h from the magnitude of the delta value\n  var subDWH = function subDWH(dxy, dwh) {\n    if (dxy > 0) {\n      return Math.max(dxy - dwh, 0);\n    } else {\n      return Math.min(dxy + dwh, 0);\n    }\n  };\n  var dx = subDWH(pdx, dw);\n  var dy = subDWH(pdy, dh);\n  var isExplicitDir = false;\n  if (rawTaxiDir === AUTO) {\n    taxiDir = Math.abs(dx) > Math.abs(dy) ? HORIZONTAL : VERTICAL;\n  } else if (rawTaxiDir === UPWARD || rawTaxiDir === DOWNWARD) {\n    taxiDir = VERTICAL;\n    isExplicitDir = true;\n  } else if (rawTaxiDir === LEFTWARD || rawTaxiDir === RIGHTWARD) {\n    taxiDir = HORIZONTAL;\n    isExplicitDir = true;\n  }\n  var isVert = taxiDir === VERTICAL;\n  var l = isVert ? dy : dx;\n  var pl = isVert ? pdy : pdx;\n  var sgnL = signum(pl);\n  var forcedDir = false;\n  if (!(isExplicitDir && (turnIsPercent || turnIsNegative)) // forcing in this case would cause weird growing in the opposite direction\n  && (rawTaxiDir === DOWNWARD && pl < 0 || rawTaxiDir === UPWARD && pl > 0 || rawTaxiDir === LEFTWARD && pl > 0 || rawTaxiDir === RIGHTWARD && pl < 0)) {\n    sgnL *= -1;\n    l = sgnL * Math.abs(l);\n    forcedDir = true;\n  }\n  var d;\n  if (turnIsPercent) {\n    var p = taxiTurnPfVal < 0 ? 1 + taxiTurnPfVal : taxiTurnPfVal;\n    d = p * l;\n  } else {\n    var k = taxiTurnPfVal < 0 ? l : 0;\n    d = k + taxiTurnPfVal * sgnL;\n  }\n  var getIsTooClose = function getIsTooClose(d) {\n    return Math.abs(d) < minD || Math.abs(d) >= Math.abs(l);\n  };\n  var isTooCloseSrc = getIsTooClose(d);\n  var isTooCloseTgt = getIsTooClose(Math.abs(l) - Math.abs(d));\n  var isTooClose = isTooCloseSrc || isTooCloseTgt;\n  if (isTooClose && !forcedDir) {\n    // non-ideal routing\n    if (isVert) {\n      // vertical fallbacks\n      var lShapeInsideSrc = Math.abs(pl) <= srcH / 2;\n      var lShapeInsideTgt = Math.abs(pdx) <= tgtW / 2;\n      if (lShapeInsideSrc) {\n        // horizontal Z-shape (direction not respected)\n        var x = (posPts.x1 + posPts.x2) / 2;\n        var y1 = posPts.y1,\n          y2 = posPts.y2;\n        rs.segpts = [x, y1, x, y2];\n      } else if (lShapeInsideTgt) {\n        // vertical Z-shape (distance not respected)\n        var y = (posPts.y1 + posPts.y2) / 2;\n        var x1 = posPts.x1,\n          x2 = posPts.x2;\n        rs.segpts = [x1, y, x2, y];\n      } else {\n        // L-shape fallback (turn distance not respected, but works well with tree siblings)\n        rs.segpts = [posPts.x1, posPts.y2];\n      }\n    } else {\n      // horizontal fallbacks\n      var _lShapeInsideSrc = Math.abs(pl) <= srcW / 2;\n      var _lShapeInsideTgt = Math.abs(pdy) <= tgtH / 2;\n      if (_lShapeInsideSrc) {\n        // vertical Z-shape (direction not respected)\n        var _y = (posPts.y1 + posPts.y2) / 2;\n        var _x = posPts.x1,\n          _x2 = posPts.x2;\n        rs.segpts = [_x, _y, _x2, _y];\n      } else if (_lShapeInsideTgt) {\n        // horizontal Z-shape (turn distance not respected)\n        var _x3 = (posPts.x1 + posPts.x2) / 2;\n        var _y2 = posPts.y1,\n          _y3 = posPts.y2;\n        rs.segpts = [_x3, _y2, _x3, _y3];\n      } else {\n        // L-shape (turn distance not respected, but works well for tree siblings)\n        rs.segpts = [posPts.x2, posPts.y1];\n      }\n    }\n  } else {\n    // ideal routing\n    if (isVert) {\n      var _y4 = posPts.y1 + d + (dIncludesNodeBody ? srcH / 2 * sgnL : 0);\n      var _x4 = posPts.x1,\n        _x5 = posPts.x2;\n      rs.segpts = [_x4, _y4, _x5, _y4];\n    } else {\n      // horizontal\n      var _x6 = posPts.x1 + d + (dIncludesNodeBody ? srcW / 2 * sgnL : 0);\n      var _y5 = posPts.y1,\n        _y6 = posPts.y2;\n      rs.segpts = [_x6, _y5, _x6, _y6];\n    }\n  }\n  if (rs.isRound) {\n    var radius = edge.pstyle('taxi-radius').value;\n    var isArcRadius = edge.pstyle('radius-type').value[0] === 'arc-radius';\n    rs.radii = new Array(rs.segpts.length / 2).fill(radius);\n    rs.isArcRadius = new Array(rs.segpts.length / 2).fill(isArcRadius);\n  }\n};\nBRp$c.tryToCorrectInvalidPoints = function (edge, pairInfo) {\n  var rs = edge._private.rscratch;\n\n  // can only correct beziers for now...\n  if (rs.edgeType === 'bezier') {\n    var srcPos = pairInfo.srcPos,\n      tgtPos = pairInfo.tgtPos,\n      srcW = pairInfo.srcW,\n      srcH = pairInfo.srcH,\n      tgtW = pairInfo.tgtW,\n      tgtH = pairInfo.tgtH,\n      srcShape = pairInfo.srcShape,\n      tgtShape = pairInfo.tgtShape,\n      srcCornerRadius = pairInfo.srcCornerRadius,\n      tgtCornerRadius = pairInfo.tgtCornerRadius,\n      srcRs = pairInfo.srcRs,\n      tgtRs = pairInfo.tgtRs;\n    var badStart = !number$1(rs.startX) || !number$1(rs.startY);\n    var badAStart = !number$1(rs.arrowStartX) || !number$1(rs.arrowStartY);\n    var badEnd = !number$1(rs.endX) || !number$1(rs.endY);\n    var badAEnd = !number$1(rs.arrowEndX) || !number$1(rs.arrowEndY);\n    var minCpADistFactor = 3;\n    var arrowW = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth;\n    var minCpADist = minCpADistFactor * arrowW;\n    var startACpDist = dist({\n      x: rs.ctrlpts[0],\n      y: rs.ctrlpts[1]\n    }, {\n      x: rs.startX,\n      y: rs.startY\n    });\n    var closeStartACp = startACpDist < minCpADist;\n    var endACpDist = dist({\n      x: rs.ctrlpts[0],\n      y: rs.ctrlpts[1]\n    }, {\n      x: rs.endX,\n      y: rs.endY\n    });\n    var closeEndACp = endACpDist < minCpADist;\n    var overlapping = false;\n    if (badStart || badAStart || closeStartACp) {\n      overlapping = true;\n\n      // project control point along line from src centre to outside the src shape\n      // (otherwise intersection will yield nothing)\n      var cpD = {\n        // delta\n        x: rs.ctrlpts[0] - srcPos.x,\n        y: rs.ctrlpts[1] - srcPos.y\n      };\n      var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line\n      var cpM = {\n        // normalised delta\n        x: cpD.x / cpL,\n        y: cpD.y / cpL\n      };\n      var radius = Math.max(srcW, srcH);\n      var cpProj = {\n        // *2 radius guarantees outside shape\n        x: rs.ctrlpts[0] + cpM.x * 2 * radius,\n        y: rs.ctrlpts[1] + cpM.y * 2 * radius\n      };\n      var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0, srcCornerRadius, srcRs);\n      if (closeStartACp) {\n        rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist);\n        rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist);\n      } else {\n        rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist;\n        rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist;\n      }\n    }\n    if (badEnd || badAEnd || closeEndACp) {\n      overlapping = true;\n\n      // project control point along line from tgt centre to outside the tgt shape\n      // (otherwise intersection will yield nothing)\n      var _cpD = {\n        // delta\n        x: rs.ctrlpts[0] - tgtPos.x,\n        y: rs.ctrlpts[1] - tgtPos.y\n      };\n      var _cpL = Math.sqrt(_cpD.x * _cpD.x + _cpD.y * _cpD.y); // length of line\n      var _cpM = {\n        // normalised delta\n        x: _cpD.x / _cpL,\n        y: _cpD.y / _cpL\n      };\n      var _radius = Math.max(srcW, srcH);\n      var _cpProj = {\n        // *2 radius guarantees outside shape\n        x: rs.ctrlpts[0] + _cpM.x * 2 * _radius,\n        y: rs.ctrlpts[1] + _cpM.y * 2 * _radius\n      };\n      var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, _cpProj.x, _cpProj.y, 0, tgtCornerRadius, tgtRs);\n      if (closeEndACp) {\n        rs.ctrlpts[0] = rs.ctrlpts[0] + _cpM.x * (minCpADist - endACpDist);\n        rs.ctrlpts[1] = rs.ctrlpts[1] + _cpM.y * (minCpADist - endACpDist);\n      } else {\n        rs.ctrlpts[0] = tgtCtrlPtIntn[0] + _cpM.x * minCpADist;\n        rs.ctrlpts[1] = tgtCtrlPtIntn[1] + _cpM.y * minCpADist;\n      }\n    }\n    if (overlapping) {\n      // recalc endpts\n      this.findEndpoints(edge);\n    }\n  }\n};\nBRp$c.storeAllpts = function (edge) {\n  var rs = edge._private.rscratch;\n  if (rs.edgeType === 'multibezier' || rs.edgeType === 'bezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') {\n    rs.allpts = [];\n    rs.allpts.push(rs.startX, rs.startY);\n    for (var b = 0; b + 1 < rs.ctrlpts.length; b += 2) {\n      // ctrl pt itself\n      rs.allpts.push(rs.ctrlpts[b], rs.ctrlpts[b + 1]);\n\n      // the midpt between ctrlpts as intermediate destination pts\n      if (b + 3 < rs.ctrlpts.length) {\n        rs.allpts.push((rs.ctrlpts[b] + rs.ctrlpts[b + 2]) / 2, (rs.ctrlpts[b + 1] + rs.ctrlpts[b + 3]) / 2);\n      }\n    }\n    rs.allpts.push(rs.endX, rs.endY);\n    var m, mt;\n    if (rs.ctrlpts.length / 2 % 2 === 0) {\n      m = rs.allpts.length / 2 - 1;\n      rs.midX = rs.allpts[m];\n      rs.midY = rs.allpts[m + 1];\n    } else {\n      m = rs.allpts.length / 2 - 3;\n      mt = 0.5;\n      rs.midX = qbezierAt(rs.allpts[m], rs.allpts[m + 2], rs.allpts[m + 4], mt);\n      rs.midY = qbezierAt(rs.allpts[m + 1], rs.allpts[m + 3], rs.allpts[m + 5], mt);\n    }\n  } else if (rs.edgeType === 'straight') {\n    // need to calc these after endpts\n    rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY];\n\n    // default midpt for labels etc\n    rs.midX = (rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX) / 4;\n    rs.midY = (rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY) / 4;\n  } else if (rs.edgeType === 'segments') {\n    rs.allpts = [];\n    rs.allpts.push(rs.startX, rs.startY);\n    rs.allpts.push.apply(rs.allpts, rs.segpts);\n    rs.allpts.push(rs.endX, rs.endY);\n    if (rs.isRound) {\n      rs.roundCorners = [];\n      for (var i = 2; i + 3 < rs.allpts.length; i += 2) {\n        var radius = rs.radii[i / 2 - 1];\n        var isArcRadius = rs.isArcRadius[i / 2 - 1];\n        rs.roundCorners.push(getRoundCorner({\n          x: rs.allpts[i - 2],\n          y: rs.allpts[i - 1]\n        }, {\n          x: rs.allpts[i],\n          y: rs.allpts[i + 1],\n          radius: radius\n        }, {\n          x: rs.allpts[i + 2],\n          y: rs.allpts[i + 3]\n        }, radius, isArcRadius));\n      }\n    }\n    if (rs.segpts.length % 4 === 0) {\n      var i2 = rs.segpts.length / 2;\n      var i1 = i2 - 2;\n      rs.midX = (rs.segpts[i1] + rs.segpts[i2]) / 2;\n      rs.midY = (rs.segpts[i1 + 1] + rs.segpts[i2 + 1]) / 2;\n    } else {\n      var _i = rs.segpts.length / 2 - 1;\n      if (!rs.isRound) {\n        rs.midX = rs.segpts[_i];\n        rs.midY = rs.segpts[_i + 1];\n      } else {\n        var point = {\n          x: rs.segpts[_i],\n          y: rs.segpts[_i + 1]\n        };\n        var corner = rs.roundCorners[_i / 2];\n        if (corner.radius === 0) {\n          // On collinear points\n          var nextPoint = {\n            x: rs.segpts[_i + 2],\n            y: rs.segpts[_i + 3]\n          };\n          rs.midX = point.x;\n          rs.midY = point.y;\n          rs.midVector = [point.y - nextPoint.y, nextPoint.x - point.x];\n        } else {\n          // On rounded points\n          var v = [point.x - corner.cx, point.y - corner.cy];\n          var factor = corner.radius / Math.sqrt(Math.pow(v[0], 2) + Math.pow(v[1], 2));\n          v = v.map(function (c) {\n            return c * factor;\n          });\n          rs.midX = corner.cx + v[0];\n          rs.midY = corner.cy + v[1];\n          rs.midVector = v;\n        }\n      }\n    }\n  }\n};\nBRp$c.checkForInvalidEdgeWarning = function (edge) {\n  var rs = edge[0]._private.rscratch;\n  if (rs.nodesOverlap || number$1(rs.startX) && number$1(rs.startY) && number$1(rs.endX) && number$1(rs.endY)) {\n    rs.loggedErr = false;\n  } else {\n    if (!rs.loggedErr) {\n      rs.loggedErr = true;\n      warn('Edge `' + edge.id() + '` has invalid endpoints and so it is impossible to draw.  Adjust your edge style (e.g. control points) accordingly or use an alternative edge type.  This is expected behaviour when the source node and the target node overlap.');\n    }\n  }\n};\nBRp$c.findEdgeControlPoints = function (edges) {\n  var _this = this;\n  if (!edges || edges.length === 0) {\n    return;\n  }\n  var r = this;\n  var cy = r.cy;\n  var hasCompounds = cy.hasCompoundNodes();\n  var hashTable = new Map$1();\n  var getKey = function getKey(pairId, edgeIsUnbundled) {\n    return [].concat(_toConsumableArray(pairId), [edgeIsUnbundled ? 1 : 0]).join('-');\n  };\n  var pairIds = [];\n  var haystackEdges = [];\n\n  // create a table of edge (src, tgt) => list of edges between them\n  for (var i = 0; i < edges.length; i++) {\n    var edge = edges[i];\n    var _p = edge._private;\n    var curveStyle = edge.pstyle('curve-style').value;\n\n    // ignore edges who are not to be displayed\n    // they shouldn't take up space\n    if (edge.removed() || !edge.takesUpSpace()) {\n      continue;\n    }\n    if (curveStyle === 'haystack') {\n      haystackEdges.push(edge);\n      continue;\n    }\n    var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || endsWith(curveStyle, 'segments') || curveStyle === 'straight' || curveStyle === 'straight-triangle' || endsWith(curveStyle, 'taxi');\n    var edgeIsBezier = curveStyle === 'unbundled-bezier' || curveStyle === 'bezier';\n    var src = _p.source;\n    var tgt = _p.target;\n    var srcIndex = src.poolIndex();\n    var tgtIndex = tgt.poolIndex();\n    var pairId = [srcIndex, tgtIndex].sort();\n    var key = getKey(pairId, edgeIsUnbundled);\n    var tableEntry = hashTable.get(key);\n    if (tableEntry == null) {\n      tableEntry = {\n        eles: []\n      };\n      pairIds.push({\n        pairId: pairId,\n        edgeIsUnbundled: edgeIsUnbundled\n      });\n      hashTable.set(key, tableEntry);\n    }\n    tableEntry.eles.push(edge);\n    if (edgeIsUnbundled) {\n      tableEntry.hasUnbundled = true;\n    }\n    if (edgeIsBezier) {\n      tableEntry.hasBezier = true;\n    }\n  }\n\n  // for each pair (src, tgt), create the ctrl pts\n  // Nested for loop is OK; total number of iterations for both loops = edgeCount\n  var _loop = function _loop() {\n    var _pairIds$p = pairIds[p],\n      pairId = _pairIds$p.pairId,\n      edgeIsUnbundled = _pairIds$p.edgeIsUnbundled;\n    var key = getKey(pairId, edgeIsUnbundled);\n    var pairInfo = hashTable.get(key);\n    var swappedpairInfo;\n    if (!pairInfo.hasUnbundled) {\n      var pllEdges = pairInfo.eles[0].parallelEdges().filter(function (e) {\n        return e.isBundledBezier();\n      });\n      clearArray(pairInfo.eles);\n      pllEdges.forEach(function (edge) {\n        return pairInfo.eles.push(edge);\n      });\n\n      // for each pair id, the edges should be sorted by index\n      pairInfo.eles.sort(function (edge1, edge2) {\n        return edge1.poolIndex() - edge2.poolIndex();\n      });\n    }\n    var firstEdge = pairInfo.eles[0];\n    var src = firstEdge.source();\n    var tgt = firstEdge.target();\n\n    // make sure src/tgt distinction is consistent w.r.t. pairId\n    if (src.poolIndex() > tgt.poolIndex()) {\n      var temp = src;\n      src = tgt;\n      tgt = temp;\n    }\n    var srcPos = pairInfo.srcPos = src.position();\n    var tgtPos = pairInfo.tgtPos = tgt.position();\n    var srcW = pairInfo.srcW = src.outerWidth();\n    var srcH = pairInfo.srcH = src.outerHeight();\n    var tgtW = pairInfo.tgtW = tgt.outerWidth();\n    var tgtH = pairInfo.tgtH = tgt.outerHeight();\n    var srcShape = pairInfo.srcShape = r.nodeShapes[_this.getNodeShape(src)];\n    var tgtShape = pairInfo.tgtShape = r.nodeShapes[_this.getNodeShape(tgt)];\n    var srcCornerRadius = pairInfo.srcCornerRadius = src.pstyle('corner-radius').value === 'auto' ? 'auto' : src.pstyle('corner-radius').pfValue;\n    var tgtCornerRadius = pairInfo.tgtCornerRadius = tgt.pstyle('corner-radius').value === 'auto' ? 'auto' : tgt.pstyle('corner-radius').pfValue;\n    var tgtRs = pairInfo.tgtRs = tgt._private.rscratch;\n    var srcRs = pairInfo.srcRs = src._private.rscratch;\n    pairInfo.dirCounts = {\n      'north': 0,\n      'west': 0,\n      'south': 0,\n      'east': 0,\n      'northwest': 0,\n      'southwest': 0,\n      'northeast': 0,\n      'southeast': 0\n    };\n    for (var _i2 = 0; _i2 < pairInfo.eles.length; _i2++) {\n      var _edge = pairInfo.eles[_i2];\n      var rs = _edge[0]._private.rscratch;\n      var _curveStyle = _edge.pstyle('curve-style').value;\n      var _edgeIsUnbundled = _curveStyle === 'unbundled-bezier' || endsWith(_curveStyle, 'segments') || endsWith(_curveStyle, 'taxi');\n\n      // whether the normalised pair order is the reverse of the edge's src-tgt order\n      var edgeIsSwapped = !src.same(_edge.source());\n      if (!pairInfo.calculatedIntersection && src !== tgt && (pairInfo.hasBezier || pairInfo.hasUnbundled)) {\n        pairInfo.calculatedIntersection = true;\n\n        // pt outside src shape to calc distance/displacement from src to tgt\n        var srcOutside = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, tgtPos.x, tgtPos.y, 0, srcCornerRadius, srcRs);\n        var srcIntn = pairInfo.srcIntn = srcOutside;\n\n        // pt outside tgt shape to calc distance/displacement from src to tgt\n        var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0, tgtCornerRadius, tgtRs);\n        var tgtIntn = pairInfo.tgtIntn = tgtOutside;\n        var intersectionPts = pairInfo.intersectionPts = {\n          x1: srcOutside[0],\n          x2: tgtOutside[0],\n          y1: srcOutside[1],\n          y2: tgtOutside[1]\n        };\n        var posPts = pairInfo.posPts = {\n          x1: srcPos.x,\n          x2: tgtPos.x,\n          y1: srcPos.y,\n          y2: tgtPos.y\n        };\n        var dy = tgtOutside[1] - srcOutside[1];\n        var dx = tgtOutside[0] - srcOutside[0];\n        var l = Math.sqrt(dx * dx + dy * dy);\n        if (number$1(l) && l >= AVOID_IMPOSSIBLE_BEZIER_CONSTANT_L) ; else {\n          l = Math.sqrt(Math.max(dx * dx, AVOID_IMPOSSIBLE_BEZIER_CONSTANT) + Math.max(dy * dy, AVOID_IMPOSSIBLE_BEZIER_CONSTANT));\n        }\n        var vector = pairInfo.vector = {\n          x: dx,\n          y: dy\n        };\n        var vectorNorm = pairInfo.vectorNorm = {\n          x: vector.x / l,\n          y: vector.y / l\n        };\n        var vectorNormInverse = {\n          x: -vectorNorm.y,\n          y: vectorNorm.x\n        };\n\n        // if node shapes overlap, then no ctrl pts to draw\n        pairInfo.nodesOverlap = !number$1(l) || tgtShape.checkPoint(srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y, tgtCornerRadius, tgtRs) || srcShape.checkPoint(tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y, srcCornerRadius, srcRs);\n        pairInfo.vectorNormInverse = vectorNormInverse;\n        swappedpairInfo = {\n          nodesOverlap: pairInfo.nodesOverlap,\n          dirCounts: pairInfo.dirCounts,\n          calculatedIntersection: true,\n          hasBezier: pairInfo.hasBezier,\n          hasUnbundled: pairInfo.hasUnbundled,\n          eles: pairInfo.eles,\n          srcPos: tgtPos,\n          srcRs: tgtRs,\n          tgtPos: srcPos,\n          tgtRs: srcRs,\n          srcW: tgtW,\n          srcH: tgtH,\n          tgtW: srcW,\n          tgtH: srcH,\n          srcIntn: tgtIntn,\n          tgtIntn: srcIntn,\n          srcShape: tgtShape,\n          tgtShape: srcShape,\n          posPts: {\n            x1: posPts.x2,\n            y1: posPts.y2,\n            x2: posPts.x1,\n            y2: posPts.y1\n          },\n          intersectionPts: {\n            x1: intersectionPts.x2,\n            y1: intersectionPts.y2,\n            x2: intersectionPts.x1,\n            y2: intersectionPts.y1\n          },\n          vector: {\n            x: -vector.x,\n            y: -vector.y\n          },\n          vectorNorm: {\n            x: -vectorNorm.x,\n            y: -vectorNorm.y\n          },\n          vectorNormInverse: {\n            x: -vectorNormInverse.x,\n            y: -vectorNormInverse.y\n          }\n        };\n      }\n      var passedPairInfo = edgeIsSwapped ? swappedpairInfo : pairInfo;\n      rs.nodesOverlap = passedPairInfo.nodesOverlap;\n      rs.srcIntn = passedPairInfo.srcIntn;\n      rs.tgtIntn = passedPairInfo.tgtIntn;\n      rs.isRound = _curveStyle.startsWith('round');\n      if (hasCompounds && (src.isParent() || src.isChild() || tgt.isParent() || tgt.isChild()) && (src.parents().anySame(tgt) || tgt.parents().anySame(src) || src.same(tgt) && src.isParent())) {\n        _this.findCompoundLoopPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled);\n      } else if (src === tgt) {\n        _this.findLoopPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled);\n      } else if (_curveStyle.endsWith('segments')) {\n        _this.findSegmentsPoints(_edge, passedPairInfo);\n      } else if (_curveStyle.endsWith('taxi')) {\n        _this.findTaxiPoints(_edge, passedPairInfo);\n      } else if (_curveStyle === 'straight' || !_edgeIsUnbundled && pairInfo.eles.length % 2 === 1 && _i2 === Math.floor(pairInfo.eles.length / 2)) {\n        _this.findStraightEdgePoints(_edge);\n      } else {\n        _this.findBezierPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled, edgeIsSwapped);\n      }\n      _this.findEndpoints(_edge);\n      _this.tryToCorrectInvalidPoints(_edge, passedPairInfo);\n      _this.checkForInvalidEdgeWarning(_edge);\n      _this.storeAllpts(_edge);\n      _this.storeEdgeProjections(_edge);\n      _this.calculateArrowAngles(_edge);\n      _this.recalculateEdgeLabelProjections(_edge);\n      _this.calculateLabelAngles(_edge);\n    } // for pair edges\n  };\n  for (var p = 0; p < pairIds.length; p++) {\n    _loop();\n  } // for pair ids\n\n  // haystacks avoid the expense of pairInfo stuff (intersections etc.)\n  this.findHaystackPoints(haystackEdges);\n};\nfunction getPts(pts) {\n  var retPts = [];\n  if (pts == null) {\n    return;\n  }\n  for (var i = 0; i < pts.length; i += 2) {\n    var x = pts[i];\n    var y = pts[i + 1];\n    retPts.push({\n      x: x,\n      y: y\n    });\n  }\n  return retPts;\n}\nBRp$c.getSegmentPoints = function (edge) {\n  var rs = edge[0]._private.rscratch;\n  this.recalculateRenderedStyle(edge);\n  var type = rs.edgeType;\n  if (type === 'segments') {\n    return getPts(rs.segpts);\n  }\n};\nBRp$c.getControlPoints = function (edge) {\n  var rs = edge[0]._private.rscratch;\n  this.recalculateRenderedStyle(edge);\n  var type = rs.edgeType;\n  if (type === 'bezier' || type === 'multibezier' || type === 'self' || type === 'compound') {\n    return getPts(rs.ctrlpts);\n  }\n};\nBRp$c.getEdgeMidpoint = function (edge) {\n  var rs = edge[0]._private.rscratch;\n  this.recalculateRenderedStyle(edge);\n  return {\n    x: rs.midX,\n    y: rs.midY\n  };\n};\n\nvar BRp$b = {};\nBRp$b.manualEndptToPx = function (node, prop) {\n  var r = this;\n  var npos = node.position();\n  var w = node.outerWidth();\n  var h = node.outerHeight();\n  var rs = node._private.rscratch;\n  if (prop.value.length === 2) {\n    var p = [prop.pfValue[0], prop.pfValue[1]];\n    if (prop.units[0] === '%') {\n      p[0] = p[0] * w;\n    }\n    if (prop.units[1] === '%') {\n      p[1] = p[1] * h;\n    }\n    p[0] += npos.x;\n    p[1] += npos.y;\n    return p;\n  } else {\n    var angle = prop.pfValue[0];\n    angle = -Math.PI / 2 + angle; // start at 12 o'clock\n\n    var l = 2 * Math.max(w, h);\n    var _p = [npos.x + Math.cos(angle) * l, npos.y + Math.sin(angle) * l];\n    return r.nodeShapes[this.getNodeShape(node)].intersectLine(npos.x, npos.y, w, h, _p[0], _p[1], 0, node.pstyle('corner-radius').value === 'auto' ? 'auto' : node.pstyle('corner-radius').pfValue, rs);\n  }\n};\nBRp$b.findEndpoints = function (edge) {\n  var _ref, _tgtManEndpt$pfValue, _ref2, _srcManEndpt$pfValue;\n  var r = this;\n  var intersect;\n  var source = edge.source()[0];\n  var target = edge.target()[0];\n  var srcPos = source.position();\n  var tgtPos = target.position();\n  var tgtArShape = edge.pstyle('target-arrow-shape').value;\n  var srcArShape = edge.pstyle('source-arrow-shape').value;\n  var tgtDist = edge.pstyle('target-distance-from-node').pfValue;\n  var srcDist = edge.pstyle('source-distance-from-node').pfValue;\n  var srcRs = source._private.rscratch;\n  var tgtRs = target._private.rscratch;\n  var curveStyle = edge.pstyle('curve-style').value;\n  var rs = edge._private.rscratch;\n  var et = rs.edgeType;\n  var taxi = endsWith(curveStyle, 'taxi'); // Covers taxi and round-taxi\n  var self = et === 'self' || et === 'compound';\n  var bezier = et === 'bezier' || et === 'multibezier' || self;\n  var multi = et !== 'bezier';\n  var lines = et === 'straight' || et === 'segments';\n  var segments = et === 'segments';\n  var hasEndpts = bezier || multi || lines;\n  var overrideEndpts = self || taxi;\n  var srcManEndpt = edge.pstyle('source-endpoint');\n  var srcManEndptVal = overrideEndpts ? 'outside-to-node' : srcManEndpt.value;\n  var srcCornerRadius = source.pstyle('corner-radius').value === 'auto' ? 'auto' : source.pstyle('corner-radius').pfValue;\n  var tgtManEndpt = edge.pstyle('target-endpoint');\n  var tgtManEndptVal = overrideEndpts ? 'outside-to-node' : tgtManEndpt.value;\n  var tgtCornerRadius = target.pstyle('corner-radius').value === 'auto' ? 'auto' : target.pstyle('corner-radius').pfValue;\n  rs.srcManEndpt = srcManEndpt;\n  rs.tgtManEndpt = tgtManEndpt;\n  var p1; // last known point of edge on target side\n  var p2; // last known point of edge on source side\n\n  var p1_i; // point to intersect with target shape\n  var p2_i; // point to intersect with source shape\n\n  var tgtManEndptPt = (_ref = (tgtManEndpt === null || tgtManEndpt === undefined || (_tgtManEndpt$pfValue = tgtManEndpt.pfValue) === null || _tgtManEndpt$pfValue === undefined ? undefined : _tgtManEndpt$pfValue.length) === 2 ? tgtManEndpt.pfValue : null) !== null && _ref !== undefined ? _ref : [0, 0];\n  var srcManEndptPt = (_ref2 = (srcManEndpt === null || srcManEndpt === undefined || (_srcManEndpt$pfValue = srcManEndpt.pfValue) === null || _srcManEndpt$pfValue === undefined ? undefined : _srcManEndpt$pfValue.length) === 2 ? srcManEndpt.pfValue : null) !== null && _ref2 !== undefined ? _ref2 : [0, 0];\n  if (bezier) {\n    var cpStart = [rs.ctrlpts[0], rs.ctrlpts[1]];\n    var cpEnd = multi ? [rs.ctrlpts[rs.ctrlpts.length - 2], rs.ctrlpts[rs.ctrlpts.length - 1]] : cpStart;\n    p1 = cpEnd;\n    p2 = cpStart;\n  } else if (lines) {\n    var srcArrowFromPt = !segments ? [tgtPos.x + tgtManEndptPt[0], tgtPos.y + tgtManEndptPt[1]] : rs.segpts.slice(0, 2);\n    var tgtArrowFromPt = !segments ? [srcPos.x + srcManEndptPt[0], srcPos.y + srcManEndptPt[1]] : rs.segpts.slice(rs.segpts.length - 2);\n    p1 = tgtArrowFromPt;\n    p2 = srcArrowFromPt;\n  }\n  if (tgtManEndptVal === 'inside-to-node') {\n    intersect = [tgtPos.x, tgtPos.y];\n  } else if (tgtManEndpt.units) {\n    intersect = this.manualEndptToPx(target, tgtManEndpt);\n  } else if (tgtManEndptVal === 'outside-to-line') {\n    intersect = rs.tgtIntn; // use cached value from ctrlpt calc\n  } else {\n    if (tgtManEndptVal === 'outside-to-node' || tgtManEndptVal === 'outside-to-node-or-label') {\n      p1_i = p1;\n    } else if (tgtManEndptVal === 'outside-to-line' || tgtManEndptVal === 'outside-to-line-or-label') {\n      p1_i = [srcPos.x, srcPos.y];\n    }\n    intersect = r.nodeShapes[this.getNodeShape(target)].intersectLine(tgtPos.x, tgtPos.y, target.outerWidth(), target.outerHeight(), p1_i[0], p1_i[1], 0, tgtCornerRadius, tgtRs);\n    if (tgtManEndptVal === 'outside-to-node-or-label' || tgtManEndptVal === 'outside-to-line-or-label') {\n      var trs = target._private.rscratch;\n      var lw = trs.labelWidth;\n      var lh = trs.labelHeight;\n      var lx = trs.labelX;\n      var ly = trs.labelY;\n      var lw2 = lw / 2;\n      var lh2 = lh / 2;\n      var va = target.pstyle('text-valign').value;\n      if (va === 'top') {\n        ly -= lh2;\n      } else if (va === 'bottom') {\n        ly += lh2;\n      }\n      var ha = target.pstyle('text-halign').value;\n      if (ha === 'left') {\n        lx -= lw2;\n      } else if (ha === 'right') {\n        lx += lw2;\n      }\n      var labelIntersect = polygonIntersectLine(p1_i[0], p1_i[1], [lx - lw2, ly - lh2, lx + lw2, ly - lh2, lx + lw2, ly + lh2, lx - lw2, ly + lh2], tgtPos.x, tgtPos.y);\n      if (labelIntersect.length > 0) {\n        var refPt = srcPos;\n        var intSqdist = sqdist(refPt, array2point(intersect));\n        var labIntSqdist = sqdist(refPt, array2point(labelIntersect));\n        var minSqDist = intSqdist;\n        if (labIntSqdist < intSqdist) {\n          intersect = labelIntersect;\n          minSqDist = labIntSqdist;\n        }\n        if (labelIntersect.length > 2) {\n          var labInt2SqDist = sqdist(refPt, {\n            x: labelIntersect[2],\n            y: labelIntersect[3]\n          });\n          if (labInt2SqDist < minSqDist) {\n            intersect = [labelIntersect[2], labelIntersect[3]];\n          }\n        }\n      }\n    }\n  }\n  var arrowEnd = shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].spacing(edge) + tgtDist);\n  var edgeEnd = shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].gap(edge) + tgtDist);\n  rs.endX = edgeEnd[0];\n  rs.endY = edgeEnd[1];\n  rs.arrowEndX = arrowEnd[0];\n  rs.arrowEndY = arrowEnd[1];\n  if (srcManEndptVal === 'inside-to-node') {\n    intersect = [srcPos.x, srcPos.y];\n  } else if (srcManEndpt.units) {\n    intersect = this.manualEndptToPx(source, srcManEndpt);\n  } else if (srcManEndptVal === 'outside-to-line') {\n    intersect = rs.srcIntn; // use cached value from ctrlpt calc\n  } else {\n    if (srcManEndptVal === 'outside-to-node' || srcManEndptVal === 'outside-to-node-or-label') {\n      p2_i = p2;\n    } else if (srcManEndptVal === 'outside-to-line' || srcManEndptVal === 'outside-to-line-or-label') {\n      p2_i = [tgtPos.x, tgtPos.y];\n    }\n    intersect = r.nodeShapes[this.getNodeShape(source)].intersectLine(srcPos.x, srcPos.y, source.outerWidth(), source.outerHeight(), p2_i[0], p2_i[1], 0, srcCornerRadius, srcRs);\n    if (srcManEndptVal === 'outside-to-node-or-label' || srcManEndptVal === 'outside-to-line-or-label') {\n      var srs = source._private.rscratch;\n      var _lw = srs.labelWidth;\n      var _lh = srs.labelHeight;\n      var _lx = srs.labelX;\n      var _ly = srs.labelY;\n      var _lw2 = _lw / 2;\n      var _lh2 = _lh / 2;\n      var _va = source.pstyle('text-valign').value;\n      if (_va === 'top') {\n        _ly -= _lh2;\n      } else if (_va === 'bottom') {\n        _ly += _lh2;\n      }\n      var _ha = source.pstyle('text-halign').value;\n      if (_ha === 'left') {\n        _lx -= _lw2;\n      } else if (_ha === 'right') {\n        _lx += _lw2;\n      }\n      var _labelIntersect = polygonIntersectLine(p2_i[0], p2_i[1], [_lx - _lw2, _ly - _lh2, _lx + _lw2, _ly - _lh2, _lx + _lw2, _ly + _lh2, _lx - _lw2, _ly + _lh2], srcPos.x, srcPos.y);\n      if (_labelIntersect.length > 0) {\n        var _refPt = tgtPos;\n        var _intSqdist = sqdist(_refPt, array2point(intersect));\n        var _labIntSqdist = sqdist(_refPt, array2point(_labelIntersect));\n        var _minSqDist = _intSqdist;\n        if (_labIntSqdist < _intSqdist) {\n          intersect = [_labelIntersect[0], _labelIntersect[1]];\n          _minSqDist = _labIntSqdist;\n        }\n        if (_labelIntersect.length > 2) {\n          var _labInt2SqDist = sqdist(_refPt, {\n            x: _labelIntersect[2],\n            y: _labelIntersect[3]\n          });\n          if (_labInt2SqDist < _minSqDist) {\n            intersect = [_labelIntersect[2], _labelIntersect[3]];\n          }\n        }\n      }\n    }\n  }\n  var arrowStart = shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].spacing(edge) + srcDist);\n  var edgeStart = shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].gap(edge) + srcDist);\n  rs.startX = edgeStart[0];\n  rs.startY = edgeStart[1];\n  rs.arrowStartX = arrowStart[0];\n  rs.arrowStartY = arrowStart[1];\n  if (hasEndpts) {\n    if (!number$1(rs.startX) || !number$1(rs.startY) || !number$1(rs.endX) || !number$1(rs.endY)) {\n      rs.badLine = true;\n    } else {\n      rs.badLine = false;\n    }\n  }\n};\nBRp$b.getSourceEndpoint = function (edge) {\n  var rs = edge[0]._private.rscratch;\n  this.recalculateRenderedStyle(edge);\n  switch (rs.edgeType) {\n    case 'haystack':\n      return {\n        x: rs.haystackPts[0],\n        y: rs.haystackPts[1]\n      };\n    default:\n      return {\n        x: rs.arrowStartX,\n        y: rs.arrowStartY\n      };\n  }\n};\nBRp$b.getTargetEndpoint = function (edge) {\n  var rs = edge[0]._private.rscratch;\n  this.recalculateRenderedStyle(edge);\n  switch (rs.edgeType) {\n    case 'haystack':\n      return {\n        x: rs.haystackPts[2],\n        y: rs.haystackPts[3]\n      };\n    default:\n      return {\n        x: rs.arrowEndX,\n        y: rs.arrowEndY\n      };\n  }\n};\n\nvar BRp$a = {};\nfunction pushBezierPts(r, edge, pts) {\n  var qbezierAt$1 = function qbezierAt$1(p1, p2, p3, t) {\n    return qbezierAt(p1, p2, p3, t);\n  };\n  var _p = edge._private;\n  var bpts = _p.rstyle.bezierPts;\n  for (var i = 0; i < r.bezierProjPcts.length; i++) {\n    var p = r.bezierProjPcts[i];\n    bpts.push({\n      x: qbezierAt$1(pts[0], pts[2], pts[4], p),\n      y: qbezierAt$1(pts[1], pts[3], pts[5], p)\n    });\n  }\n}\nBRp$a.storeEdgeProjections = function (edge) {\n  var _p = edge._private;\n  var rs = _p.rscratch;\n  var et = rs.edgeType;\n\n  // clear the cached points state\n  _p.rstyle.bezierPts = null;\n  _p.rstyle.linePts = null;\n  _p.rstyle.haystackPts = null;\n  if (et === 'multibezier' || et === 'bezier' || et === 'self' || et === 'compound') {\n    _p.rstyle.bezierPts = [];\n    for (var i = 0; i + 5 < rs.allpts.length; i += 4) {\n      pushBezierPts(this, edge, rs.allpts.slice(i, i + 6));\n    }\n  } else if (et === 'segments') {\n    var lpts = _p.rstyle.linePts = [];\n    for (var i = 0; i + 1 < rs.allpts.length; i += 2) {\n      lpts.push({\n        x: rs.allpts[i],\n        y: rs.allpts[i + 1]\n      });\n    }\n  } else if (et === 'haystack') {\n    var hpts = rs.haystackPts;\n    _p.rstyle.haystackPts = [{\n      x: hpts[0],\n      y: hpts[1]\n    }, {\n      x: hpts[2],\n      y: hpts[3]\n    }];\n  }\n  _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth;\n};\nBRp$a.recalculateEdgeProjections = function (edges) {\n  this.findEdgeControlPoints(edges);\n};\n\nvar BRp$9 = {};\nBRp$9.recalculateNodeLabelProjection = function (node) {\n  var content = node.pstyle('label').strValue;\n  if (emptyString(content)) {\n    return;\n  }\n  var textX, textY;\n  var _p = node._private;\n  var nodeWidth = node.width();\n  var nodeHeight = node.height();\n  var padding = node.padding();\n  var nodePos = node.position();\n  var textHalign = node.pstyle('text-halign').strValue;\n  var textValign = node.pstyle('text-valign').strValue;\n  var rs = _p.rscratch;\n  var rstyle = _p.rstyle;\n  switch (textHalign) {\n    case 'left':\n      textX = nodePos.x - nodeWidth / 2 - padding;\n      break;\n    case 'right':\n      textX = nodePos.x + nodeWidth / 2 + padding;\n      break;\n    default:\n      // e.g. center\n      textX = nodePos.x;\n  }\n  switch (textValign) {\n    case 'top':\n      textY = nodePos.y - nodeHeight / 2 - padding;\n      break;\n    case 'bottom':\n      textY = nodePos.y + nodeHeight / 2 + padding;\n      break;\n    default:\n      // e.g. middle\n      textY = nodePos.y;\n  }\n  rs.labelX = textX;\n  rs.labelY = textY;\n  rstyle.labelX = textX;\n  rstyle.labelY = textY;\n  this.calculateLabelAngles(node);\n  this.applyLabelDimensions(node);\n};\nvar lineAngleFromDelta = function lineAngleFromDelta(dx, dy) {\n  var angle = Math.atan(dy / dx);\n  if (dx === 0 && angle < 0) {\n    angle = angle * -1;\n  }\n  return angle;\n};\nvar lineAngle = function lineAngle(p0, p1) {\n  var dx = p1.x - p0.x;\n  var dy = p1.y - p0.y;\n  return lineAngleFromDelta(dx, dy);\n};\nvar bezierAngle = function bezierAngle(p0, p1, p2, t) {\n  var t0 = bound(0, t - 0.001, 1);\n  var t1 = bound(0, t + 0.001, 1);\n  var lp0 = qbezierPtAt(p0, p1, p2, t0);\n  var lp1 = qbezierPtAt(p0, p1, p2, t1);\n  return lineAngle(lp0, lp1);\n};\nBRp$9.recalculateEdgeLabelProjections = function (edge) {\n  var p;\n  var _p = edge._private;\n  var rs = _p.rscratch;\n  var r = this;\n  var content = {\n    mid: edge.pstyle('label').strValue,\n    source: edge.pstyle('source-label').strValue,\n    target: edge.pstyle('target-label').strValue\n  };\n  if (content.mid || content.source || content.target) ; else {\n    return; // no labels => no calcs\n  }\n\n  // add center point to style so bounding box calculations can use it\n  //\n  p = {\n    x: rs.midX,\n    y: rs.midY\n  };\n  var setRs = function setRs(propName, prefix, value) {\n    setPrefixedProperty(_p.rscratch, propName, prefix, value);\n    setPrefixedProperty(_p.rstyle, propName, prefix, value);\n  };\n  setRs('labelX', null, p.x);\n  setRs('labelY', null, p.y);\n  var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY);\n  setRs('labelAutoAngle', null, midAngle);\n  var _createControlPointInfo = function createControlPointInfo() {\n    if (_createControlPointInfo.cache) {\n      return _createControlPointInfo.cache;\n    } // use cache so only 1x per edge\n\n    var ctrlpts = [];\n\n    // store each ctrlpt info init\n    for (var i = 0; i + 5 < rs.allpts.length; i += 4) {\n      var p0 = {\n        x: rs.allpts[i],\n        y: rs.allpts[i + 1]\n      };\n      var p1 = {\n        x: rs.allpts[i + 2],\n        y: rs.allpts[i + 3]\n      }; // ctrlpt\n      var p2 = {\n        x: rs.allpts[i + 4],\n        y: rs.allpts[i + 5]\n      };\n      ctrlpts.push({\n        p0: p0,\n        p1: p1,\n        p2: p2,\n        startDist: 0,\n        length: 0,\n        segments: []\n      });\n    }\n    var bpts = _p.rstyle.bezierPts;\n    var nProjs = r.bezierProjPcts.length;\n    function addSegment(cp, p0, p1, t0, t1) {\n      var length = dist(p0, p1);\n      var prevSegment = cp.segments[cp.segments.length - 1];\n      var segment = {\n        p0: p0,\n        p1: p1,\n        t0: t0,\n        t1: t1,\n        startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0,\n        length: length\n      };\n      cp.segments.push(segment);\n      cp.length += length;\n    }\n\n    // update each ctrlpt with segment info\n    for (var _i = 0; _i < ctrlpts.length; _i++) {\n      var cp = ctrlpts[_i];\n      var prevCp = ctrlpts[_i - 1];\n      if (prevCp) {\n        cp.startDist = prevCp.startDist + prevCp.length;\n      }\n      addSegment(cp, cp.p0, bpts[_i * nProjs], 0, r.bezierProjPcts[0]); // first\n\n      for (var j = 0; j < nProjs - 1; j++) {\n        addSegment(cp, bpts[_i * nProjs + j], bpts[_i * nProjs + j + 1], r.bezierProjPcts[j], r.bezierProjPcts[j + 1]);\n      }\n      addSegment(cp, bpts[_i * nProjs + nProjs - 1], cp.p2, r.bezierProjPcts[nProjs - 1], 1); // last\n    }\n    return _createControlPointInfo.cache = ctrlpts;\n  };\n  var calculateEndProjection = function calculateEndProjection(prefix) {\n    var angle;\n    var isSrc = prefix === 'source';\n    if (!content[prefix]) {\n      return;\n    }\n    var offset = edge.pstyle(prefix + '-text-offset').pfValue;\n    switch (rs.edgeType) {\n      case 'self':\n      case 'compound':\n      case 'bezier':\n      case 'multibezier':\n        {\n          var cps = _createControlPointInfo();\n          var selected;\n          var startDist = 0;\n          var totalDist = 0;\n\n          // find the segment we're on\n          for (var i = 0; i < cps.length; i++) {\n            var _cp = cps[isSrc ? i : cps.length - 1 - i];\n            for (var j = 0; j < _cp.segments.length; j++) {\n              var _seg = _cp.segments[isSrc ? j : _cp.segments.length - 1 - j];\n              var lastSeg = i === cps.length - 1 && j === _cp.segments.length - 1;\n              startDist = totalDist;\n              totalDist += _seg.length;\n              if (totalDist >= offset || lastSeg) {\n                selected = {\n                  cp: _cp,\n                  segment: _seg\n                };\n                break;\n              }\n            }\n            if (selected) {\n              break;\n            }\n          }\n          var cp = selected.cp;\n          var seg = selected.segment;\n          var tSegment = (offset - startDist) / seg.length;\n          var segDt = seg.t1 - seg.t0;\n          var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment;\n          t = bound(0, t, 1);\n          p = qbezierPtAt(cp.p0, cp.p1, cp.p2, t);\n          angle = bezierAngle(cp.p0, cp.p1, cp.p2, t);\n          break;\n        }\n      case 'straight':\n      case 'segments':\n      case 'haystack':\n        {\n          var d = 0,\n            di,\n            d0;\n          var p0, p1;\n          var l = rs.allpts.length;\n          for (var _i2 = 0; _i2 + 3 < l; _i2 += 2) {\n            if (isSrc) {\n              p0 = {\n                x: rs.allpts[_i2],\n                y: rs.allpts[_i2 + 1]\n              };\n              p1 = {\n                x: rs.allpts[_i2 + 2],\n                y: rs.allpts[_i2 + 3]\n              };\n            } else {\n              p0 = {\n                x: rs.allpts[l - 2 - _i2],\n                y: rs.allpts[l - 1 - _i2]\n              };\n              p1 = {\n                x: rs.allpts[l - 4 - _i2],\n                y: rs.allpts[l - 3 - _i2]\n              };\n            }\n            di = dist(p0, p1);\n            d0 = d;\n            d += di;\n            if (d >= offset) {\n              break;\n            }\n          }\n          var pD = offset - d0;\n          var _t = pD / di;\n          _t = bound(0, _t, 1);\n          p = lineAt(p0, p1, _t);\n          angle = lineAngle(p0, p1);\n          break;\n        }\n    }\n    setRs('labelX', prefix, p.x);\n    setRs('labelY', prefix, p.y);\n    setRs('labelAutoAngle', prefix, angle);\n  };\n  calculateEndProjection('source');\n  calculateEndProjection('target');\n  this.applyLabelDimensions(edge);\n};\nBRp$9.applyLabelDimensions = function (ele) {\n  this.applyPrefixedLabelDimensions(ele);\n  if (ele.isEdge()) {\n    this.applyPrefixedLabelDimensions(ele, 'source');\n    this.applyPrefixedLabelDimensions(ele, 'target');\n  }\n};\nBRp$9.applyPrefixedLabelDimensions = function (ele, prefix) {\n  var _p = ele._private;\n  var text = this.getLabelText(ele, prefix);\n  var cacheKey = hashString(text, ele._private.labelDimsKey);\n\n  // save recalc if the label is the same as before\n  if (getPrefixedProperty(_p.rscratch, 'prefixedLabelDimsKey', prefix) === cacheKey) {\n    return; // then the label dimensions + text are the same\n  }\n\n  // save the key\n  setPrefixedProperty(_p.rscratch, 'prefixedLabelDimsKey', prefix, cacheKey);\n  var labelDims = this.calculateLabelDimensions(ele, text);\n  var lineHeight = ele.pstyle('line-height').pfValue;\n  var textWrap = ele.pstyle('text-wrap').strValue;\n  var lines = getPrefixedProperty(_p.rscratch, 'labelWrapCachedLines', prefix) || [];\n  var numLines = textWrap !== 'wrap' ? 1 : Math.max(lines.length, 1);\n  var normPerLineHeight = labelDims.height / numLines;\n  var labelLineHeight = normPerLineHeight * lineHeight;\n  var width = labelDims.width;\n  var height = labelDims.height + (numLines - 1) * (lineHeight - 1) * normPerLineHeight;\n  setPrefixedProperty(_p.rstyle, 'labelWidth', prefix, width);\n  setPrefixedProperty(_p.rscratch, 'labelWidth', prefix, width);\n  setPrefixedProperty(_p.rstyle, 'labelHeight', prefix, height);\n  setPrefixedProperty(_p.rscratch, 'labelHeight', prefix, height);\n  setPrefixedProperty(_p.rscratch, 'labelLineHeight', prefix, labelLineHeight);\n};\nBRp$9.getLabelText = function (ele, prefix) {\n  var _p = ele._private;\n  var pfd = prefix ? prefix + '-' : '';\n  var text = ele.pstyle(pfd + 'label').strValue;\n  var textTransform = ele.pstyle('text-transform').value;\n  var rscratch = function rscratch(propName, value) {\n    if (value) {\n      setPrefixedProperty(_p.rscratch, propName, prefix, value);\n      return value;\n    } else {\n      return getPrefixedProperty(_p.rscratch, propName, prefix);\n    }\n  };\n\n  // for empty text, skip all processing\n  if (!text) {\n    return '';\n  }\n  if (textTransform == 'none') ; else if (textTransform == 'uppercase') {\n    text = text.toUpperCase();\n  } else if (textTransform == 'lowercase') {\n    text = text.toLowerCase();\n  }\n  var wrapStyle = ele.pstyle('text-wrap').value;\n  if (wrapStyle === 'wrap') {\n    var labelKey = rscratch('labelKey');\n\n    // save recalc if the label is the same as before\n    if (labelKey != null && rscratch('labelWrapKey') === labelKey) {\n      return rscratch('labelWrapCachedText');\n    }\n    var zwsp = \"\\u200B\";\n    var lines = text.split('\\n');\n    var maxW = ele.pstyle('text-max-width').pfValue;\n    var overflow = ele.pstyle('text-overflow-wrap').value;\n    var overflowAny = overflow === 'anywhere';\n    var wrappedLines = [];\n    var separatorRegex = /[\\s\\u200b]+|$/g; // Include end of string to add last word\n\n    for (var l = 0; l < lines.length; l++) {\n      var line = lines[l];\n      var lineDims = this.calculateLabelDimensions(ele, line);\n      var lineW = lineDims.width;\n      if (overflowAny) {\n        var processedLine = line.split('').join(zwsp);\n        line = processedLine;\n      }\n      if (lineW > maxW) {\n        // line is too long\n        var separatorMatches = line.matchAll(separatorRegex);\n        var subline = '';\n        var previousIndex = 0;\n        // Add fake match\n        var _iterator = _createForOfIteratorHelper(separatorMatches),\n          _step;\n        try {\n          for (_iterator.s(); !(_step = _iterator.n()).done;) {\n            var separatorMatch = _step.value;\n            var wordSeparator = separatorMatch[0];\n            var word = line.substring(previousIndex, separatorMatch.index);\n            previousIndex = separatorMatch.index + wordSeparator.length;\n            var testLine = subline.length === 0 ? word : subline + word + wordSeparator;\n            var testDims = this.calculateLabelDimensions(ele, testLine);\n            var testW = testDims.width;\n            if (testW <= maxW) {\n              // word fits on current line\n              subline += word + wordSeparator;\n            } else {\n              // word starts new line\n              if (subline) {\n                wrappedLines.push(subline);\n              }\n              subline = word + wordSeparator;\n            }\n          }\n\n          // if there's remaining text, put it in a wrapped line\n        } catch (err) {\n          _iterator.e(err);\n        } finally {\n          _iterator.f();\n        }\n        if (!subline.match(/^[\\s\\u200b]+$/)) {\n          wrappedLines.push(subline);\n        }\n      } else {\n        // line is already short enough\n        wrappedLines.push(line);\n      }\n    } // for\n\n    rscratch('labelWrapCachedLines', wrappedLines);\n    text = rscratch('labelWrapCachedText', wrappedLines.join('\\n'));\n    rscratch('labelWrapKey', labelKey);\n  } else if (wrapStyle === 'ellipsis') {\n    var _maxW = ele.pstyle('text-max-width').pfValue;\n    var ellipsized = '';\n    var ellipsis = \"\\u2026\";\n    var incLastCh = false;\n    if (this.calculateLabelDimensions(ele, text).width < _maxW) {\n      // the label already fits\n      return text;\n    }\n    for (var i = 0; i < text.length; i++) {\n      var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text[i] + ellipsis).width;\n      if (widthWithNextCh > _maxW) {\n        break;\n      }\n      ellipsized += text[i];\n      if (i === text.length - 1) {\n        incLastCh = true;\n      }\n    }\n    if (!incLastCh) {\n      ellipsized += ellipsis;\n    }\n    return ellipsized;\n  } // if ellipsize\n\n  return text;\n};\nBRp$9.getLabelJustification = function (ele) {\n  var justification = ele.pstyle('text-justification').strValue;\n  var textHalign = ele.pstyle('text-halign').strValue;\n  if (justification === 'auto') {\n    if (ele.isNode()) {\n      switch (textHalign) {\n        case 'left':\n          return 'right';\n        case 'right':\n          return 'left';\n        default:\n          return 'center';\n      }\n    } else {\n      return 'center';\n    }\n  } else {\n    return justification;\n  }\n};\nBRp$9.calculateLabelDimensions = function (ele, text) {\n  var r = this;\n  var containerWindow = r.cy.window();\n  var document = containerWindow.document;\n  var padding = 0; // add padding around text dims, as the measurement isn't that accurate\n  var fStyle = ele.pstyle('font-style').strValue;\n  var size = ele.pstyle('font-size').pfValue;\n  var family = ele.pstyle('font-family').strValue;\n  var weight = ele.pstyle('font-weight').strValue;\n  var canvas = this.labelCalcCanvas;\n  var c2d = this.labelCalcCanvasContext;\n  if (!canvas) {\n    canvas = this.labelCalcCanvas = document.createElement('canvas');\n    c2d = this.labelCalcCanvasContext = canvas.getContext('2d');\n    var ds = canvas.style;\n    ds.position = 'absolute';\n    ds.left = '-9999px';\n    ds.top = '-9999px';\n    ds.zIndex = '-1';\n    ds.visibility = 'hidden';\n    ds.pointerEvents = 'none';\n  }\n  c2d.font = \"\".concat(fStyle, \" \").concat(weight, \" \").concat(size, \"px \").concat(family);\n  var width = 0;\n  var height = 0;\n  var lines = text.split('\\n');\n  for (var i = 0; i < lines.length; i++) {\n    var line = lines[i];\n    var metrics = c2d.measureText(line);\n    var w = Math.ceil(metrics.width);\n    var h = size;\n    width = Math.max(w, width);\n    height += h;\n  }\n  width += padding;\n  height += padding;\n  return {\n    width: width,\n    height: height\n  };\n};\nBRp$9.calculateLabelAngle = function (ele, prefix) {\n  var _p = ele._private;\n  var rs = _p.rscratch;\n  var isEdge = ele.isEdge();\n  var prefixDash = prefix ? prefix + '-' : '';\n  var rot = ele.pstyle(prefixDash + 'text-rotation');\n  var rotStr = rot.strValue;\n  if (rotStr === 'none') {\n    return 0;\n  } else if (isEdge && rotStr === 'autorotate') {\n    return rs.labelAutoAngle;\n  } else if (rotStr === 'autorotate') {\n    return 0;\n  } else {\n    return rot.pfValue;\n  }\n};\nBRp$9.calculateLabelAngles = function (ele) {\n  var r = this;\n  var isEdge = ele.isEdge();\n  var _p = ele._private;\n  var rs = _p.rscratch;\n  rs.labelAngle = r.calculateLabelAngle(ele);\n  if (isEdge) {\n    rs.sourceLabelAngle = r.calculateLabelAngle(ele, 'source');\n    rs.targetLabelAngle = r.calculateLabelAngle(ele, 'target');\n  }\n};\n\nvar BRp$8 = {};\nvar TOO_SMALL_CUT_RECT = 28;\nvar warnedCutRect = false;\nBRp$8.getNodeShape = function (node) {\n  var r = this;\n  var shape = node.pstyle('shape').value;\n  if (shape === 'cutrectangle' && (node.width() < TOO_SMALL_CUT_RECT || node.height() < TOO_SMALL_CUT_RECT)) {\n    if (!warnedCutRect) {\n      warn('The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead');\n      warnedCutRect = true;\n    }\n    return 'rectangle';\n  }\n  if (node.isParent()) {\n    if (shape === 'rectangle' || shape === 'roundrectangle' || shape === 'round-rectangle' || shape === 'cutrectangle' || shape === 'cut-rectangle' || shape === 'barrel') {\n      return shape;\n    } else {\n      return 'rectangle';\n    }\n  }\n  if (shape === 'polygon') {\n    var points = node.pstyle('shape-polygon-points').value;\n    return r.nodeShapes.makePolygon(points).name;\n  }\n  return shape;\n};\n\nvar BRp$7 = {};\nBRp$7.registerCalculationListeners = function () {\n  var cy = this.cy;\n  var elesToUpdate = cy.collection();\n  var r = this;\n  var enqueue = function enqueue(eles) {\n    var dirtyStyleCaches = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n    elesToUpdate.merge(eles);\n    if (dirtyStyleCaches) {\n      for (var i = 0; i < eles.length; i++) {\n        var ele = eles[i];\n        var _p = ele._private;\n        var rstyle = _p.rstyle;\n        rstyle.clean = false;\n        rstyle.cleanConnected = false;\n      }\n    }\n  };\n  r.binder(cy).on('bounds.* dirty.*', function onDirtyBounds(e) {\n    var ele = e.target;\n    enqueue(ele);\n  }).on('style.* background.*', function onDirtyStyle(e) {\n    var ele = e.target;\n    enqueue(ele, false);\n  });\n  var updateEleCalcs = function updateEleCalcs(willDraw) {\n    if (willDraw) {\n      var fns = r.onUpdateEleCalcsFns;\n\n      // because we need to have up-to-date style (e.g. stylesheet mappers)\n      // before calculating rendered style (and pstyle might not be called yet)\n      elesToUpdate.cleanStyle();\n      for (var i = 0; i < elesToUpdate.length; i++) {\n        var ele = elesToUpdate[i];\n        var rstyle = ele._private.rstyle;\n        if (ele.isNode() && !rstyle.cleanConnected) {\n          enqueue(ele.connectedEdges());\n          rstyle.cleanConnected = true;\n        }\n      }\n      if (fns) {\n        for (var _i = 0; _i < fns.length; _i++) {\n          var fn = fns[_i];\n          fn(willDraw, elesToUpdate);\n        }\n      }\n      r.recalculateRenderedStyle(elesToUpdate);\n      elesToUpdate = cy.collection();\n    }\n  };\n  r.flushRenderedStyleQueue = function () {\n    updateEleCalcs(true);\n  };\n  r.beforeRender(updateEleCalcs, r.beforeRenderPriorities.eleCalcs);\n};\nBRp$7.onUpdateEleCalcs = function (fn) {\n  var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || [];\n  fns.push(fn);\n};\nBRp$7.recalculateRenderedStyle = function (eles, useCache) {\n  var isCleanConnected = function isCleanConnected(ele) {\n    return ele._private.rstyle.cleanConnected;\n  };\n  if (eles.length === 0) {\n    return;\n  }\n  var edges = [];\n  var nodes = [];\n\n  // the renderer can't be used for calcs when destroyed, e.g. ele.boundingBox()\n  if (this.destroyed) {\n    return;\n  }\n\n  // use cache by default for perf\n  if (useCache === undefined) {\n    useCache = true;\n  }\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    var _p = ele._private;\n    var rstyle = _p.rstyle;\n\n    // an edge may be implicitly dirty b/c of one of its connected nodes\n    // (and a request for recalc may come in between frames)\n    if (ele.isEdge() && (!isCleanConnected(ele.source()) || !isCleanConnected(ele.target()))) {\n      rstyle.clean = false;\n    }\n    if (ele.isEdge() && ele.isBundledBezier()) {\n      if (ele.parallelEdges().some(function (ele) {\n        return !ele._private.rstyle.clean && ele.isBundledBezier();\n      })) {\n        rstyle.clean = false;\n      }\n    }\n\n    // only update if dirty and in graph\n    if (useCache && rstyle.clean || ele.removed()) {\n      continue;\n    }\n\n    // only update if not display: none\n    if (ele.pstyle('display').value === 'none') {\n      continue;\n    }\n    if (_p.group === 'nodes') {\n      nodes.push(ele);\n    } else {\n      // edges\n      edges.push(ele);\n    }\n    rstyle.clean = true;\n  }\n\n  // update node data from projections\n  for (var _i2 = 0; _i2 < nodes.length; _i2++) {\n    var _ele = nodes[_i2];\n    var _p2 = _ele._private;\n    var _rstyle = _p2.rstyle;\n    var pos = _ele.position();\n    this.recalculateNodeLabelProjection(_ele);\n    _rstyle.nodeX = pos.x;\n    _rstyle.nodeY = pos.y;\n    _rstyle.nodeW = _ele.pstyle('width').pfValue;\n    _rstyle.nodeH = _ele.pstyle('height').pfValue;\n  }\n  this.recalculateEdgeProjections(edges);\n\n  // update edge data from projections\n  for (var _i3 = 0; _i3 < edges.length; _i3++) {\n    var _ele2 = edges[_i3];\n    var _p3 = _ele2._private;\n    var _rstyle2 = _p3.rstyle;\n    var rs = _p3.rscratch;\n\n    // update rstyle positions\n    _rstyle2.srcX = rs.arrowStartX;\n    _rstyle2.srcY = rs.arrowStartY;\n    _rstyle2.tgtX = rs.arrowEndX;\n    _rstyle2.tgtY = rs.arrowEndY;\n    _rstyle2.midX = rs.midX;\n    _rstyle2.midY = rs.midY;\n    _rstyle2.labelAngle = rs.labelAngle;\n    _rstyle2.sourceLabelAngle = rs.sourceLabelAngle;\n    _rstyle2.targetLabelAngle = rs.targetLabelAngle;\n  }\n};\n\nvar BRp$6 = {};\nBRp$6.updateCachedGrabbedEles = function () {\n  var eles = this.cachedZSortedEles;\n  if (!eles) {\n    // just let this be recalculated on the next z sort tick\n    return;\n  }\n  eles.drag = [];\n  eles.nondrag = [];\n  var grabTargets = [];\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    var rs = ele._private.rscratch;\n    if (ele.grabbed() && !ele.isParent()) {\n      grabTargets.push(ele);\n    } else if (rs.inDragLayer) {\n      eles.drag.push(ele);\n    } else {\n      eles.nondrag.push(ele);\n    }\n  }\n\n  // put the grab target nodes last so it's on top of its neighbourhood\n  for (var i = 0; i < grabTargets.length; i++) {\n    var ele = grabTargets[i];\n    eles.drag.push(ele);\n  }\n};\nBRp$6.invalidateCachedZSortedEles = function () {\n  this.cachedZSortedEles = null;\n};\nBRp$6.getCachedZSortedEles = function (forceRecalc) {\n  if (forceRecalc || !this.cachedZSortedEles) {\n    var eles = this.cy.mutableElements().toArray();\n    eles.sort(zIndexSort);\n    eles.interactive = eles.filter(function (ele) {\n      return ele.interactive();\n    });\n    this.cachedZSortedEles = eles;\n    this.updateCachedGrabbedEles();\n  } else {\n    eles = this.cachedZSortedEles;\n  }\n  return eles;\n};\n\nvar BRp$5 = {};\n[BRp$e, BRp$d, BRp$c, BRp$b, BRp$a, BRp$9, BRp$8, BRp$7, BRp$6].forEach(function (props) {\n  extend(BRp$5, props);\n});\n\nvar BRp$4 = {};\nBRp$4.getCachedImage = function (url, crossOrigin, onLoad) {\n  var r = this;\n  var imageCache = r.imageCache = r.imageCache || {};\n  var cache = imageCache[url];\n  if (cache) {\n    if (!cache.image.complete) {\n      cache.image.addEventListener('load', onLoad);\n    }\n    return cache.image;\n  } else {\n    cache = imageCache[url] = imageCache[url] || {};\n    var image = cache.image = new Image(); // eslint-disable-line no-undef\n\n    image.addEventListener('load', onLoad);\n    image.addEventListener('error', function () {\n      image.error = true;\n    });\n\n    // #1582 safari doesn't load data uris with crossOrigin properly\n    // https://bugs.webkit.org/show_bug.cgi?id=123978\n    var dataUriPrefix = 'data:';\n    var isDataUri = url.substring(0, dataUriPrefix.length).toLowerCase() === dataUriPrefix;\n    if (!isDataUri) {\n      // if crossorigin is 'null'(stringified), then manually set it to null \n      crossOrigin = crossOrigin === 'null' ? null : crossOrigin;\n      image.crossOrigin = crossOrigin; // prevent tainted canvas\n    }\n    image.src = url;\n    return image;\n  }\n};\n\nvar setGrabState = function setGrabState(ele, grabbed) {\n  var ele0 = ele[0];\n  if (!ele0 || ele0._private.grabbed === grabbed) {\n    return;\n  }\n  ele0._private.grabbed = grabbed;\n  ele.updateStyle(false);\n};\nvar setGrabbed = function setGrabbed(ele) {\n  setGrabState(ele, true);\n};\nvar setFreed = function setFreed(ele) {\n  setGrabState(ele, false);\n};\n\nvar BRp$3 = {};\n\n/* global document, ResizeObserver, MutationObserver */\n\nBRp$3.registerBinding = function (target, event, handler, useCapture) {\n  // eslint-disable-line no-unused-vars\n  var args = Array.prototype.slice.apply(arguments, [1]); // copy\n\n  if (Array.isArray(target)) {\n    var res = [];\n    for (var i = 0; i < target.length; i++) {\n      var t = target[i];\n      if (t !== undefined) {\n        var b = this.binder(t);\n        res.push(b.on.apply(b, args));\n      }\n    }\n    return res;\n  }\n  var b = this.binder(target);\n  return b.on.apply(b, args);\n};\nBRp$3.binder = function (tgt) {\n  var r = this;\n  var containerWindow = r.cy.window();\n  var tgtIsDom = tgt === containerWindow || tgt === containerWindow.document || tgt === containerWindow.document.body || domElement(tgt);\n  if (r.supportsPassiveEvents == null) {\n    // from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection\n    var supportsPassive = false;\n    try {\n      var opts = Object.defineProperty({}, 'passive', {\n        get: function get() {\n          supportsPassive = true;\n          return true;\n        }\n      });\n      containerWindow.addEventListener('test', null, opts);\n    } catch (err) {\n      // not supported\n    }\n    r.supportsPassiveEvents = supportsPassive;\n  }\n  var on = function on(event, handler, useCapture) {\n    var args = Array.prototype.slice.call(arguments);\n    if (tgtIsDom && r.supportsPassiveEvents) {\n      // replace useCapture w/ opts obj\n      args[2] = {\n        capture: useCapture != null ? useCapture : false,\n        passive: false,\n        once: false\n      };\n    }\n    r.bindings.push({\n      target: tgt,\n      args: args\n    });\n    (tgt.addEventListener || tgt.on).apply(tgt, args);\n    return this;\n  };\n  return {\n    on: on,\n    addEventListener: on,\n    addListener: on,\n    bind: on\n  };\n};\nBRp$3.nodeIsDraggable = function (node) {\n  return node && node.isNode() && !node.locked() && node.grabbable();\n};\nBRp$3.nodeIsGrabbable = function (node) {\n  return this.nodeIsDraggable(node) && node.interactive();\n};\nBRp$3.load = function () {\n  var r = this;\n  var containerWindow = r.cy.window();\n  var isSelected = function isSelected(ele) {\n    return ele.selected();\n  };\n  var getShadowRoot = function getShadowRoot(element) {\n    var rootNode = element.getRootNode();\n    // Check if the root node is a shadow root\n    if (rootNode && rootNode.nodeType === 11 && rootNode.host !== undefined) {\n      return rootNode;\n    }\n  };\n  var triggerEvents = function triggerEvents(target, names, e, position) {\n    if (target == null) {\n      target = r.cy;\n    }\n    for (var i = 0; i < names.length; i++) {\n      var name = names[i];\n      target.emit({\n        originalEvent: e,\n        type: name,\n        position: position\n      });\n    }\n  };\n  var isMultSelKeyDown = function isMultSelKeyDown(e) {\n    return e.shiftKey || e.metaKey || e.ctrlKey; // maybe e.altKey\n  };\n  var allowPanningPassthrough = function allowPanningPassthrough(down, downs) {\n    var allowPassthrough = true;\n    if (r.cy.hasCompoundNodes() && down && down.pannable()) {\n      // a grabbable compound node below the ele => no passthrough panning\n      for (var i = 0; downs && i < downs.length; i++) {\n        var down = downs[i];\n\n        //if any parent node in event hierarchy isn't pannable, reject passthrough\n        if (down.isNode() && down.isParent() && !down.pannable()) {\n          allowPassthrough = false;\n          break;\n        }\n      }\n    } else {\n      allowPassthrough = true;\n    }\n    return allowPassthrough;\n  };\n  var setInDragLayer = function setInDragLayer(ele) {\n    ele[0]._private.rscratch.inDragLayer = true;\n  };\n  var setOutDragLayer = function setOutDragLayer(ele) {\n    ele[0]._private.rscratch.inDragLayer = false;\n  };\n  var setGrabTarget = function setGrabTarget(ele) {\n    ele[0]._private.rscratch.isGrabTarget = true;\n  };\n  var removeGrabTarget = function removeGrabTarget(ele) {\n    ele[0]._private.rscratch.isGrabTarget = false;\n  };\n  var addToDragList = function addToDragList(ele, opts) {\n    var list = opts.addToList;\n    var listHasEle = list.has(ele);\n    if (!listHasEle && ele.grabbable() && !ele.locked()) {\n      list.merge(ele);\n      setGrabbed(ele);\n    }\n  };\n\n  // helper function to determine which child nodes and inner edges\n  // of a compound node to be dragged as well as the grabbed and selected nodes\n  var addDescendantsToDrag = function addDescendantsToDrag(node, opts) {\n    if (!node.cy().hasCompoundNodes()) {\n      return;\n    }\n    if (opts.inDragLayer == null && opts.addToList == null) {\n      return;\n    } // nothing to do\n\n    var innerNodes = node.descendants();\n    if (opts.inDragLayer) {\n      innerNodes.forEach(setInDragLayer);\n      innerNodes.connectedEdges().forEach(setInDragLayer);\n    }\n    if (opts.addToList) {\n      addToDragList(innerNodes, opts);\n    }\n  };\n\n  // adds the given nodes and its neighbourhood to the drag layer\n  var addNodesToDrag = function addNodesToDrag(nodes, opts) {\n    opts = opts || {};\n    var hasCompoundNodes = nodes.cy().hasCompoundNodes();\n    if (opts.inDragLayer) {\n      nodes.forEach(setInDragLayer);\n      nodes.neighborhood().stdFilter(function (ele) {\n        return !hasCompoundNodes || ele.isEdge();\n      }).forEach(setInDragLayer);\n    }\n    if (opts.addToList) {\n      nodes.forEach(function (ele) {\n        addToDragList(ele, opts);\n      });\n    }\n    addDescendantsToDrag(nodes, opts); // always add to drag\n\n    // also add nodes and edges related to the topmost ancestor\n    updateAncestorsInDragLayer(nodes, {\n      inDragLayer: opts.inDragLayer\n    });\n    r.updateCachedGrabbedEles();\n  };\n  var addNodeToDrag = addNodesToDrag;\n  var freeDraggedElements = function freeDraggedElements(grabbedEles) {\n    if (!grabbedEles) {\n      return;\n    }\n\n    // just go over all elements rather than doing a bunch of (possibly expensive) traversals\n    r.getCachedZSortedEles().forEach(function (ele) {\n      setFreed(ele);\n      setOutDragLayer(ele);\n      removeGrabTarget(ele);\n    });\n    r.updateCachedGrabbedEles();\n  };\n\n  // helper function to determine which ancestor nodes and edges should go\n  // to the drag layer (or should be removed from drag layer).\n  var updateAncestorsInDragLayer = function updateAncestorsInDragLayer(node, opts) {\n    if (opts.inDragLayer == null && opts.addToList == null) {\n      return;\n    } // nothing to do\n\n    if (!node.cy().hasCompoundNodes()) {\n      return;\n    }\n\n    // find top-level parent\n    var parent = node.ancestors().orphans();\n\n    // no parent node: no nodes to add to the drag layer\n    if (parent.same(node)) {\n      return;\n    }\n    var nodes = parent.descendants().spawnSelf().merge(parent).unmerge(node).unmerge(node.descendants());\n    var edges = nodes.connectedEdges();\n    if (opts.inDragLayer) {\n      edges.forEach(setInDragLayer);\n      nodes.forEach(setInDragLayer);\n    }\n    if (opts.addToList) {\n      nodes.forEach(function (ele) {\n        addToDragList(ele, opts);\n      });\n    }\n  };\n  var blurActiveDomElement = function blurActiveDomElement() {\n    if (document.activeElement != null && document.activeElement.blur != null) {\n      document.activeElement.blur();\n    }\n  };\n  var haveMutationsApi = typeof MutationObserver !== 'undefined';\n  var haveResizeObserverApi = typeof ResizeObserver !== 'undefined';\n\n  // watch for when the cy container is removed from the dom\n  if (haveMutationsApi) {\n    r.removeObserver = new MutationObserver(function (mutns) {\n      // eslint-disable-line no-undef\n      for (var i = 0; i < mutns.length; i++) {\n        var mutn = mutns[i];\n        var rNodes = mutn.removedNodes;\n        if (rNodes) {\n          for (var j = 0; j < rNodes.length; j++) {\n            var rNode = rNodes[j];\n            if (rNode === r.container) {\n              r.destroy();\n              break;\n            }\n          }\n        }\n      }\n    });\n    if (r.container.parentNode) {\n      r.removeObserver.observe(r.container.parentNode, {\n        childList: true\n      });\n    }\n  } else {\n    r.registerBinding(r.container, 'DOMNodeRemoved', function (e) {\n      // eslint-disable-line no-unused-vars\n      r.destroy();\n    });\n  }\n  var onResize = debounce(function () {\n    r.cy.resize();\n  }, 100);\n  if (haveMutationsApi) {\n    r.styleObserver = new MutationObserver(onResize); // eslint-disable-line no-undef\n\n    r.styleObserver.observe(r.container, {\n      attributes: true\n    });\n  }\n\n  // auto resize\n  r.registerBinding(containerWindow, 'resize', onResize); // eslint-disable-line no-undef\n\n  if (haveResizeObserverApi) {\n    r.resizeObserver = new ResizeObserver(onResize); // eslint-disable-line no-undef\n\n    r.resizeObserver.observe(r.container);\n  }\n  var forEachUp = function forEachUp(domEle, fn) {\n    while (domEle != null) {\n      fn(domEle);\n      domEle = domEle.parentNode;\n    }\n  };\n  var invalidateCoords = function invalidateCoords() {\n    r.invalidateContainerClientCoordsCache();\n  };\n  forEachUp(r.container, function (domEle) {\n    r.registerBinding(domEle, 'transitionend', invalidateCoords);\n    r.registerBinding(domEle, 'animationend', invalidateCoords);\n    r.registerBinding(domEle, 'scroll', invalidateCoords);\n  });\n\n  // stop right click menu from appearing on cy\n  r.registerBinding(r.container, 'contextmenu', function (e) {\n    e.preventDefault();\n  });\n  var inBoxSelection = function inBoxSelection() {\n    return r.selection[4] !== 0;\n  };\n  var eventInContainer = function eventInContainer(e) {\n    // save cycles if mouse events aren't to be captured\n    var containerPageCoords = r.findContainerClientCoords();\n    var x = containerPageCoords[0];\n    var y = containerPageCoords[1];\n    var width = containerPageCoords[2];\n    var height = containerPageCoords[3];\n    var positions = e.touches ? e.touches : [e];\n    var atLeastOnePosInside = false;\n    for (var i = 0; i < positions.length; i++) {\n      var p = positions[i];\n      if (x <= p.clientX && p.clientX <= x + width && y <= p.clientY && p.clientY <= y + height) {\n        atLeastOnePosInside = true;\n        break;\n      }\n    }\n    if (!atLeastOnePosInside) {\n      return false;\n    }\n    var container = r.container;\n    var target = e.target;\n    var tParent = target.parentNode;\n    var containerIsTarget = false;\n    while (tParent) {\n      if (tParent === container) {\n        containerIsTarget = true;\n        break;\n      }\n      tParent = tParent.parentNode;\n    }\n    if (!containerIsTarget) {\n      return false;\n    } // if target is outisde cy container, then this event is not for us\n\n    return true;\n  };\n\n  // Primary key\n  r.registerBinding(r.container, 'mousedown', function mousedownHandler(e) {\n    if (!eventInContainer(e)) {\n      return;\n    }\n\n    // during left mouse button gestures, ignore other buttons\n    if (r.hoverData.which === 1 && e.which !== 1) {\n      return;\n    }\n    e.preventDefault();\n    blurActiveDomElement();\n    r.hoverData.capture = true;\n    r.hoverData.which = e.which;\n    var cy = r.cy;\n    var gpos = [e.clientX, e.clientY];\n    var pos = r.projectIntoViewport(gpos[0], gpos[1]);\n    var select = r.selection;\n    var nears = r.findNearestElements(pos[0], pos[1], true, false);\n    var near = nears[0];\n    var draggedElements = r.dragData.possibleDragElements;\n    r.hoverData.mdownPos = pos;\n    r.hoverData.mdownGPos = gpos;\n    var makeEvent = function makeEvent(type) {\n      return {\n        originalEvent: e,\n        type: type,\n        position: {\n          x: pos[0],\n          y: pos[1]\n        }\n      };\n    };\n    var checkForTaphold = function checkForTaphold() {\n      r.hoverData.tapholdCancelled = false;\n      clearTimeout(r.hoverData.tapholdTimeout);\n      r.hoverData.tapholdTimeout = setTimeout(function () {\n        if (r.hoverData.tapholdCancelled) {\n          return;\n        } else {\n          var ele = r.hoverData.down;\n          if (ele) {\n            ele.emit(makeEvent('taphold'));\n          } else {\n            cy.emit(makeEvent('taphold'));\n          }\n        }\n      }, r.tapholdDuration);\n    };\n\n    // Right click button\n    if (e.which == 3) {\n      r.hoverData.cxtStarted = true;\n      var cxtEvt = {\n        originalEvent: e,\n        type: 'cxttapstart',\n        position: {\n          x: pos[0],\n          y: pos[1]\n        }\n      };\n      if (near) {\n        near.activate();\n        near.emit(cxtEvt);\n        r.hoverData.down = near;\n      } else {\n        cy.emit(cxtEvt);\n      }\n      r.hoverData.downTime = new Date().getTime();\n      r.hoverData.cxtDragged = false;\n\n      // Primary button\n    } else if (e.which == 1) {\n      if (near) {\n        near.activate();\n      }\n\n      // Element dragging\n      {\n        // If something is under the cursor and it is draggable, prepare to grab it\n        if (near != null) {\n          if (r.nodeIsGrabbable(near)) {\n            var triggerGrab = function triggerGrab(ele) {\n              ele.emit(makeEvent('grab'));\n            };\n            setGrabTarget(near);\n            if (!near.selected()) {\n              draggedElements = r.dragData.possibleDragElements = cy.collection();\n              addNodeToDrag(near, {\n                addToList: draggedElements\n              });\n              near.emit(makeEvent('grabon')).emit(makeEvent('grab'));\n            } else {\n              draggedElements = r.dragData.possibleDragElements = cy.collection();\n              var selectedNodes = cy.$(function (ele) {\n                return ele.isNode() && ele.selected() && r.nodeIsGrabbable(ele);\n              });\n              addNodesToDrag(selectedNodes, {\n                addToList: draggedElements\n              });\n              near.emit(makeEvent('grabon'));\n              selectedNodes.forEach(triggerGrab);\n            }\n            r.redrawHint('eles', true);\n            r.redrawHint('drag', true);\n          }\n        }\n        r.hoverData.down = near;\n        r.hoverData.downs = nears;\n        r.hoverData.downTime = new Date().getTime();\n      }\n      triggerEvents(near, ['mousedown', 'tapstart', 'vmousedown'], e, {\n        x: pos[0],\n        y: pos[1]\n      });\n      if (near == null) {\n        select[4] = 1;\n        r.data.bgActivePosistion = {\n          x: pos[0],\n          y: pos[1]\n        };\n        r.redrawHint('select', true);\n        r.redraw();\n      } else if (near.pannable()) {\n        select[4] = 1; // for future pan\n      }\n      checkForTaphold();\n    }\n\n    // Initialize selection box coordinates\n    select[0] = select[2] = pos[0];\n    select[1] = select[3] = pos[1];\n  }, false);\n  var shadowRoot = getShadowRoot(r.container);\n  r.registerBinding([containerWindow, shadowRoot], 'mousemove', function mousemoveHandler(e) {\n    // eslint-disable-line no-undef\n    var capture = r.hoverData.capture;\n    if (!capture && !eventInContainer(e)) {\n      return;\n    }\n    var preventDefault = false;\n    var cy = r.cy;\n    var zoom = cy.zoom();\n    var gpos = [e.clientX, e.clientY];\n    var pos = r.projectIntoViewport(gpos[0], gpos[1]);\n    var mdownPos = r.hoverData.mdownPos;\n    var mdownGPos = r.hoverData.mdownGPos;\n    var select = r.selection;\n    var near = null;\n    if (!r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting) {\n      near = r.findNearestElement(pos[0], pos[1], true, false);\n    }\n    var last = r.hoverData.last;\n    var down = r.hoverData.down;\n    var disp = [pos[0] - select[2], pos[1] - select[3]];\n    var draggedElements = r.dragData.possibleDragElements;\n    var isOverThresholdDrag;\n    if (mdownGPos) {\n      var dx = gpos[0] - mdownGPos[0];\n      var dx2 = dx * dx;\n      var dy = gpos[1] - mdownGPos[1];\n      var dy2 = dy * dy;\n      var dist2 = dx2 + dy2;\n      r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist2 >= r.desktopTapThreshold2;\n    }\n    var multSelKeyDown = isMultSelKeyDown(e);\n    if (isOverThresholdDrag) {\n      r.hoverData.tapholdCancelled = true;\n    }\n    var updateDragDelta = function updateDragDelta() {\n      var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || [];\n      if (dragDelta.length === 0) {\n        dragDelta.push(disp[0]);\n        dragDelta.push(disp[1]);\n      } else {\n        dragDelta[0] += disp[0];\n        dragDelta[1] += disp[1];\n      }\n    };\n    preventDefault = true;\n    triggerEvents(near, ['mousemove', 'vmousemove', 'tapdrag'], e, {\n      x: pos[0],\n      y: pos[1]\n    });\n    var makeEvent = function makeEvent(type) {\n      return {\n        originalEvent: e,\n        type: type,\n        position: {\n          x: pos[0],\n          y: pos[1]\n        }\n      };\n    };\n    var goIntoBoxMode = function goIntoBoxMode() {\n      r.data.bgActivePosistion = undefined;\n      if (!r.hoverData.selecting) {\n        cy.emit(makeEvent('boxstart'));\n      }\n      select[4] = 1;\n      r.hoverData.selecting = true;\n      r.redrawHint('select', true);\n      r.redraw();\n    };\n\n    // trigger context drag if rmouse down\n    if (r.hoverData.which === 3) {\n      // but only if over threshold\n      if (isOverThresholdDrag) {\n        var cxtEvt = makeEvent('cxtdrag');\n        if (down) {\n          down.emit(cxtEvt);\n        } else {\n          cy.emit(cxtEvt);\n        }\n        r.hoverData.cxtDragged = true;\n        if (!r.hoverData.cxtOver || near !== r.hoverData.cxtOver) {\n          if (r.hoverData.cxtOver) {\n            r.hoverData.cxtOver.emit(makeEvent('cxtdragout'));\n          }\n          r.hoverData.cxtOver = near;\n          if (near) {\n            near.emit(makeEvent('cxtdragover'));\n          }\n        }\n      }\n\n      // Check if we are drag panning the entire graph\n    } else if (r.hoverData.dragging) {\n      preventDefault = true;\n      if (cy.panningEnabled() && cy.userPanningEnabled()) {\n        var deltaP;\n        if (r.hoverData.justStartedPan) {\n          var mdPos = r.hoverData.mdownPos;\n          deltaP = {\n            x: (pos[0] - mdPos[0]) * zoom,\n            y: (pos[1] - mdPos[1]) * zoom\n          };\n          r.hoverData.justStartedPan = false;\n        } else {\n          deltaP = {\n            x: disp[0] * zoom,\n            y: disp[1] * zoom\n          };\n        }\n        cy.panBy(deltaP);\n        cy.emit(makeEvent('dragpan'));\n        r.hoverData.dragged = true;\n      }\n\n      // Needs reproject due to pan changing viewport\n      pos = r.projectIntoViewport(e.clientX, e.clientY);\n\n      // Checks primary button down & out of time & mouse not moved much\n    } else if (select[4] == 1 && (down == null || down.pannable())) {\n      if (isOverThresholdDrag) {\n        if (!r.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) {\n          goIntoBoxMode();\n        } else if (!r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) {\n          var allowPassthrough = allowPanningPassthrough(down, r.hoverData.downs);\n          if (allowPassthrough) {\n            r.hoverData.dragging = true;\n            r.hoverData.justStartedPan = true;\n            select[4] = 0;\n            r.data.bgActivePosistion = array2point(mdownPos);\n            r.redrawHint('select', true);\n            r.redraw();\n          }\n        }\n        if (down && down.pannable() && down.active()) {\n          down.unactivate();\n        }\n      }\n    } else {\n      if (down && down.pannable() && down.active()) {\n        down.unactivate();\n      }\n      if ((!down || !down.grabbed()) && near != last) {\n        if (last) {\n          triggerEvents(last, ['mouseout', 'tapdragout'], e, {\n            x: pos[0],\n            y: pos[1]\n          });\n        }\n        if (near) {\n          triggerEvents(near, ['mouseover', 'tapdragover'], e, {\n            x: pos[0],\n            y: pos[1]\n          });\n        }\n        r.hoverData.last = near;\n      }\n      if (down) {\n        if (isOverThresholdDrag) {\n          // then we can take action\n\n          if (cy.boxSelectionEnabled() && multSelKeyDown) {\n            // then selection overrides\n            if (down && down.grabbed()) {\n              freeDraggedElements(draggedElements);\n              down.emit(makeEvent('freeon'));\n              draggedElements.emit(makeEvent('free'));\n              if (r.dragData.didDrag) {\n                down.emit(makeEvent('dragfreeon'));\n                draggedElements.emit(makeEvent('dragfree'));\n              }\n            }\n            goIntoBoxMode();\n          } else if (down && down.grabbed() && r.nodeIsDraggable(down)) {\n            // drag node\n            var justStartedDrag = !r.dragData.didDrag;\n            if (justStartedDrag) {\n              r.redrawHint('eles', true);\n            }\n            r.dragData.didDrag = true; // indicate that we actually did drag the node\n\n            // now, add the elements to the drag layer if not done already\n            if (!r.hoverData.draggingEles) {\n              addNodesToDrag(draggedElements, {\n                inDragLayer: true\n              });\n            }\n            var totalShift = {\n              x: 0,\n              y: 0\n            };\n            if (number$1(disp[0]) && number$1(disp[1])) {\n              totalShift.x += disp[0];\n              totalShift.y += disp[1];\n              if (justStartedDrag) {\n                var dragDelta = r.hoverData.dragDelta;\n                if (dragDelta && number$1(dragDelta[0]) && number$1(dragDelta[1])) {\n                  totalShift.x += dragDelta[0];\n                  totalShift.y += dragDelta[1];\n                }\n              }\n            }\n            r.hoverData.draggingEles = true;\n            draggedElements.silentShift(totalShift).emit(makeEvent('position')).emit(makeEvent('drag'));\n            r.redrawHint('drag', true);\n            r.redraw();\n          }\n        } else {\n          // otherwise save drag delta for when we actually start dragging so the relative grab pos is constant\n          updateDragDelta();\n        }\n      }\n\n      // prevent the dragging from triggering text selection on the page\n      preventDefault = true;\n    }\n    select[2] = pos[0];\n    select[3] = pos[1];\n    if (preventDefault) {\n      if (e.stopPropagation) e.stopPropagation();\n      if (e.preventDefault) e.preventDefault();\n      return false;\n    }\n  }, false);\n  var clickTimeout, didDoubleClick, prevClickTimeStamp;\n  r.registerBinding(containerWindow, 'mouseup', function mouseupHandler(e) {\n    // eslint-disable-line no-undef\n    // during left mouse button gestures, ignore other buttons\n    if (r.hoverData.which === 1 && e.which !== 1 && r.hoverData.capture) {\n      return;\n    }\n    var capture = r.hoverData.capture;\n    if (!capture) {\n      return;\n    }\n    r.hoverData.capture = false;\n    var cy = r.cy;\n    var pos = r.projectIntoViewport(e.clientX, e.clientY);\n    var select = r.selection;\n    var near = r.findNearestElement(pos[0], pos[1], true, false);\n    var draggedElements = r.dragData.possibleDragElements;\n    var down = r.hoverData.down;\n    var multSelKeyDown = isMultSelKeyDown(e);\n    if (r.data.bgActivePosistion) {\n      r.redrawHint('select', true);\n      r.redraw();\n    }\n    r.hoverData.tapholdCancelled = true;\n    r.data.bgActivePosistion = undefined; // not active bg now\n\n    if (down) {\n      down.unactivate();\n    }\n    var makeEvent = function makeEvent(type) {\n      return {\n        originalEvent: e,\n        type: type,\n        position: {\n          x: pos[0],\n          y: pos[1]\n        }\n      };\n    };\n    if (r.hoverData.which === 3) {\n      var cxtEvt = makeEvent('cxttapend');\n      if (down) {\n        down.emit(cxtEvt);\n      } else {\n        cy.emit(cxtEvt);\n      }\n      if (!r.hoverData.cxtDragged) {\n        var cxtTap = makeEvent('cxttap');\n        if (down) {\n          down.emit(cxtTap);\n        } else {\n          cy.emit(cxtTap);\n        }\n      }\n      r.hoverData.cxtDragged = false;\n      r.hoverData.which = null;\n    } else if (r.hoverData.which === 1) {\n      triggerEvents(near, ['mouseup', 'tapend', 'vmouseup'], e, {\n        x: pos[0],\n        y: pos[1]\n      });\n      if (!r.dragData.didDrag &&\n      // didn't move a node around\n      !r.hoverData.dragged &&\n      // didn't pan\n      !r.hoverData.selecting &&\n      // not box selection\n      !r.hoverData.isOverThresholdDrag // didn't move too much\n      ) {\n        triggerEvents(down, [\"click\", \"tap\", \"vclick\"], e, {\n          x: pos[0],\n          y: pos[1]\n        });\n        didDoubleClick = false;\n        if (e.timeStamp - prevClickTimeStamp <= cy.multiClickDebounceTime()) {\n          clickTimeout && clearTimeout(clickTimeout);\n          didDoubleClick = true;\n          prevClickTimeStamp = null;\n          triggerEvents(down, [\"dblclick\", \"dbltap\", \"vdblclick\"], e, {\n            x: pos[0],\n            y: pos[1]\n          });\n        } else {\n          clickTimeout = setTimeout(function () {\n            if (didDoubleClick) return;\n            triggerEvents(down, [\"oneclick\", \"onetap\", \"voneclick\"], e, {\n              x: pos[0],\n              y: pos[1]\n            });\n          }, cy.multiClickDebounceTime());\n          prevClickTimeStamp = e.timeStamp;\n        }\n      }\n\n      // Deselect all elements if nothing is currently under the mouse cursor and we aren't dragging something\n      if (down == null // not mousedown on node\n      && !r.dragData.didDrag // didn't move the node around\n      && !r.hoverData.selecting // not box selection\n      && !r.hoverData.dragged // didn't pan\n      && !isMultSelKeyDown(e)) {\n        cy.$(isSelected).unselect(['tapunselect']);\n        if (draggedElements.length > 0) {\n          r.redrawHint('eles', true);\n        }\n        r.dragData.possibleDragElements = draggedElements = cy.collection();\n      }\n\n      // Single selection\n      if (near == down && !r.dragData.didDrag && !r.hoverData.selecting) {\n        if (near != null && near._private.selectable) {\n          if (r.hoverData.dragging) ; else if (cy.selectionType() === 'additive' || multSelKeyDown) {\n            if (near.selected()) {\n              near.unselect(['tapunselect']);\n            } else {\n              near.select(['tapselect']);\n            }\n          } else {\n            if (!multSelKeyDown) {\n              cy.$(isSelected).unmerge(near).unselect(['tapunselect']);\n              near.select(['tapselect']);\n            }\n          }\n          r.redrawHint('eles', true);\n        }\n      }\n      if (r.hoverData.selecting) {\n        var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3]));\n        r.redrawHint('select', true);\n        if (box.length > 0) {\n          r.redrawHint('eles', true);\n        }\n        cy.emit(makeEvent('boxend'));\n        var eleWouldBeSelected = function eleWouldBeSelected(ele) {\n          return ele.selectable() && !ele.selected();\n        };\n        if (cy.selectionType() === 'additive') {\n          box.emit(makeEvent('box')).stdFilter(eleWouldBeSelected).select().emit(makeEvent('boxselect'));\n        } else {\n          if (!multSelKeyDown) {\n            cy.$(isSelected).unmerge(box).unselect();\n          }\n          box.emit(makeEvent('box')).stdFilter(eleWouldBeSelected).select().emit(makeEvent('boxselect'));\n        }\n\n        // always need redraw in case eles unselectable\n        r.redraw();\n      }\n\n      // Cancel drag pan\n      if (r.hoverData.dragging) {\n        r.hoverData.dragging = false;\n        r.redrawHint('select', true);\n        r.redrawHint('eles', true);\n        r.redraw();\n      }\n      if (!select[4]) {\n        r.redrawHint('drag', true);\n        r.redrawHint('eles', true);\n        var downWasGrabbed = down && down.grabbed();\n        freeDraggedElements(draggedElements);\n        if (downWasGrabbed) {\n          down.emit(makeEvent('freeon'));\n          draggedElements.emit(makeEvent('free'));\n          if (r.dragData.didDrag) {\n            down.emit(makeEvent('dragfreeon'));\n            draggedElements.emit(makeEvent('dragfree'));\n          }\n        }\n      }\n    } // else not right mouse\n\n    select[4] = 0;\n    r.hoverData.down = null;\n    r.hoverData.cxtStarted = false;\n    r.hoverData.draggingEles = false;\n    r.hoverData.selecting = false;\n    r.hoverData.isOverThresholdDrag = false;\n    r.dragData.didDrag = false;\n    r.hoverData.dragged = false;\n    r.hoverData.dragDelta = [];\n    r.hoverData.mdownPos = null;\n    r.hoverData.mdownGPos = null;\n    r.hoverData.which = null;\n  }, false);\n  var wheelDeltas = []; // log of first N wheel deltas\n  var wheelDeltaN = 4; // how many events to log\n  var inaccurateScrollDevice;\n  var inaccurateScrollFactor = 100000; // base of inaccurate wheel deltas (e.g. base 5 could yield wheels of 10, 25, 50, etc.)\n\n  var allAreDivisibleBy = function allAreDivisibleBy(list, factor) {\n    for (var i = 0; i < list.length; i++) {\n      if (list[i] % factor !== 0) {\n        return false;\n      }\n    }\n    return true;\n  };\n  var allAreSameMagnitude = function allAreSameMagnitude(list) {\n    var firstMag = Math.abs(list[0]);\n    for (var i = 1; i < list.length; i++) {\n      if (Math.abs(list[i]) !== firstMag) {\n        return false;\n      }\n    }\n    return true;\n  };\n  var wheelHandler = function wheelHandler(e) {\n    var clamp = false;\n    var delta = e.deltaY;\n    if (delta == null) {\n      // compatibility with old browsers\n      if (e.wheelDeltaY != null) {\n        delta = e.wheelDeltaY / 4;\n      } else if (e.wheelDelta != null) {\n        delta = e.wheelDelta / 4;\n      }\n    }\n    if (delta === 0) {\n      return; // no change in zoom (Bug: Zoom becomes erratic on rapid scroll due to deltaY: 0 event #3394)\n    }\n    if (inaccurateScrollDevice == null) {\n      if (wheelDeltas.length >= wheelDeltaN) {\n        // use log to determine if inaccurate\n        var wds = wheelDeltas;\n        inaccurateScrollDevice = allAreDivisibleBy(wds, 5);\n        if (!inaccurateScrollDevice) {\n          // check for all large values of exact same magnitude\n          var firstMag = Math.abs(wds[0]);\n          inaccurateScrollDevice = allAreSameMagnitude(wds) && firstMag > 5;\n        }\n        if (inaccurateScrollDevice) {\n          for (var i = 0; i < wds.length; i++) {\n            inaccurateScrollFactor = Math.min(Math.abs(wds[i]), inaccurateScrollFactor);\n          }\n        }\n\n        // console.log('Sampled wheel deltas:', wds);\n        // console.log('inaccurateScrollDevice:', inaccurateScrollDevice);\n        // console.log('inaccurateScrollFactor:', inaccurateScrollFactor);\n      } else {\n        // clamp and log until we reach N\n        wheelDeltas.push(delta);\n        clamp = true;\n        // console.log('Clamping initial wheel events until we get a good sample');\n      }\n    } else if (inaccurateScrollDevice) {\n      // keep updating\n      inaccurateScrollFactor = Math.min(Math.abs(delta), inaccurateScrollFactor);\n      // console.log('Keep updating inaccurateScrollFactor beyond sample in case we did not get the smallest possible val:', inaccurateScrollFactor);\n    }\n    if (r.scrollingPage) {\n      return;\n    } // while scrolling, ignore wheel-to-zoom\n\n    var cy = r.cy;\n    var zoom = cy.zoom();\n    var pan = cy.pan();\n    var pos = r.projectIntoViewport(e.clientX, e.clientY);\n    var rpos = [pos[0] * zoom + pan.x, pos[1] * zoom + pan.y];\n    if (r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection()) {\n      // if pan dragging or cxt dragging, wheel movements make no zoom\n      e.preventDefault();\n      return;\n    }\n    if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) {\n      e.preventDefault();\n      r.data.wheelZooming = true;\n      clearTimeout(r.data.wheelTimeout);\n      r.data.wheelTimeout = setTimeout(function () {\n        r.data.wheelZooming = false;\n        r.redrawHint('eles', true);\n        r.redraw();\n      }, 150);\n      var diff;\n      if (clamp && Math.abs(delta) > 5) {\n        delta = signum(delta) * 5;\n      }\n      diff = delta / -250;\n      if (inaccurateScrollDevice) {\n        diff /= inaccurateScrollFactor;\n        diff *= 3;\n      }\n      diff = diff * r.wheelSensitivity;\n\n      // console.log(`delta = ${delta}, diff = ${diff}, mode = ${e.deltaMode}`)\n\n      var needsWheelFix = e.deltaMode === 1;\n      if (needsWheelFix) {\n        // fixes slow wheel events on ff/linux and ff/windows\n        diff *= 33;\n      }\n      var newZoom = cy.zoom() * Math.pow(10, diff);\n      if (e.type === 'gesturechange') {\n        newZoom = r.gestureStartZoom * e.scale;\n      }\n      cy.zoom({\n        level: newZoom,\n        renderedPosition: {\n          x: rpos[0],\n          y: rpos[1]\n        }\n      });\n      cy.emit({\n        type: e.type === 'gesturechange' ? 'pinchzoom' : 'scrollzoom',\n        originalEvent: e,\n        position: {\n          x: pos[0],\n          y: pos[1]\n        }\n      });\n    }\n  };\n\n  // Functions to help with whether mouse wheel should trigger zooming\n  // --\n  r.registerBinding(r.container, 'wheel', wheelHandler, true);\n\n  // disable nonstandard wheel events\n  // r.registerBinding(r.container, 'mousewheel', wheelHandler, true);\n  // r.registerBinding(r.container, 'DOMMouseScroll', wheelHandler, true);\n  // r.registerBinding(r.container, 'MozMousePixelScroll', wheelHandler, true); // older firefox\n\n  r.registerBinding(containerWindow, 'scroll', function scrollHandler(e) {\n    // eslint-disable-line no-unused-vars\n    r.scrollingPage = true;\n    clearTimeout(r.scrollingPageTimeout);\n    r.scrollingPageTimeout = setTimeout(function () {\n      r.scrollingPage = false;\n    }, 250);\n  }, true);\n\n  // desktop safari pinch to zoom start\n  r.registerBinding(r.container, 'gesturestart', function gestureStartHandler(e) {\n    r.gestureStartZoom = r.cy.zoom();\n    if (!r.hasTouchStarted) {\n      // don't affect touch devices like iphone\n      e.preventDefault();\n    }\n  }, true);\n  r.registerBinding(r.container, 'gesturechange', function (e) {\n    if (!r.hasTouchStarted) {\n      // don't affect touch devices like iphone\n      wheelHandler(e);\n    }\n  }, true);\n\n  // Functions to help with handling mouseout/mouseover on the Cytoscape container\n  // Handle mouseout on Cytoscape container\n  r.registerBinding(r.container, 'mouseout', function mouseOutHandler(e) {\n    var pos = r.projectIntoViewport(e.clientX, e.clientY);\n    r.cy.emit({\n      originalEvent: e,\n      type: 'mouseout',\n      position: {\n        x: pos[0],\n        y: pos[1]\n      }\n    });\n  }, false);\n  r.registerBinding(r.container, 'mouseover', function mouseOverHandler(e) {\n    var pos = r.projectIntoViewport(e.clientX, e.clientY);\n    r.cy.emit({\n      originalEvent: e,\n      type: 'mouseover',\n      position: {\n        x: pos[0],\n        y: pos[1]\n      }\n    });\n  }, false);\n  var f1x1, f1y1, f2x1, f2y1; // starting points for pinch-to-zoom\n  var distance1, distance1Sq; // initial distance between finger 1 and finger 2 for pinch-to-zoom\n  var center1, modelCenter1; // center point on start pinch to zoom\n  var offsetLeft, offsetTop;\n  var containerWidth, containerHeight;\n  var twoFingersStartInside;\n  var distance = function distance(x1, y1, x2, y2) {\n    return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n  };\n  var distanceSq = function distanceSq(x1, y1, x2, y2) {\n    return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);\n  };\n  var touchstartHandler;\n  r.registerBinding(r.container, 'touchstart', touchstartHandler = function touchstartHandler(e) {\n    r.hasTouchStarted = true;\n    if (!eventInContainer(e)) {\n      return;\n    }\n    blurActiveDomElement();\n    r.touchData.capture = true;\n    r.data.bgActivePosistion = undefined;\n    var cy = r.cy;\n    var now = r.touchData.now;\n    var earlier = r.touchData.earlier;\n    if (e.touches[0]) {\n      var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n      now[0] = pos[0];\n      now[1] = pos[1];\n    }\n    if (e.touches[1]) {\n      var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);\n      now[2] = pos[0];\n      now[3] = pos[1];\n    }\n    if (e.touches[2]) {\n      var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);\n      now[4] = pos[0];\n      now[5] = pos[1];\n    }\n    var makeEvent = function makeEvent(type) {\n      return {\n        originalEvent: e,\n        type: type,\n        position: {\n          x: now[0],\n          y: now[1]\n        }\n      };\n    };\n\n    // record starting points for pinch-to-zoom\n    if (e.touches[1]) {\n      r.touchData.singleTouchMoved = true;\n      freeDraggedElements(r.dragData.touchDragEles);\n      var offsets = r.findContainerClientCoords();\n      offsetLeft = offsets[0];\n      offsetTop = offsets[1];\n      containerWidth = offsets[2];\n      containerHeight = offsets[3];\n      f1x1 = e.touches[0].clientX - offsetLeft;\n      f1y1 = e.touches[0].clientY - offsetTop;\n      f2x1 = e.touches[1].clientX - offsetLeft;\n      f2y1 = e.touches[1].clientY - offsetTop;\n      twoFingersStartInside = 0 <= f1x1 && f1x1 <= containerWidth && 0 <= f2x1 && f2x1 <= containerWidth && 0 <= f1y1 && f1y1 <= containerHeight && 0 <= f2y1 && f2y1 <= containerHeight;\n      var pan = cy.pan();\n      var zoom = cy.zoom();\n      distance1 = distance(f1x1, f1y1, f2x1, f2y1);\n      distance1Sq = distanceSq(f1x1, f1y1, f2x1, f2y1);\n      center1 = [(f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2];\n      modelCenter1 = [(center1[0] - pan.x) / zoom, (center1[1] - pan.y) / zoom];\n\n      // consider context tap\n      var cxtDistThreshold = 200;\n      var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold;\n      if (distance1Sq < cxtDistThresholdSq && !e.touches[2]) {\n        var near1 = r.findNearestElement(now[0], now[1], true, true);\n        var near2 = r.findNearestElement(now[2], now[3], true, true);\n        if (near1 && near1.isNode()) {\n          near1.activate().emit(makeEvent('cxttapstart'));\n          r.touchData.start = near1;\n        } else if (near2 && near2.isNode()) {\n          near2.activate().emit(makeEvent('cxttapstart'));\n          r.touchData.start = near2;\n        } else {\n          cy.emit(makeEvent('cxttapstart'));\n        }\n        if (r.touchData.start) {\n          r.touchData.start._private.grabbed = false;\n        }\n        r.touchData.cxt = true;\n        r.touchData.cxtDragged = false;\n        r.data.bgActivePosistion = undefined;\n        r.redraw();\n        return;\n      }\n    }\n    if (e.touches[2]) {\n      // ignore\n\n      // safari on ios pans the page otherwise (normally you should be able to preventdefault on touchmove...)\n      if (cy.boxSelectionEnabled()) {\n        e.preventDefault();\n      }\n    } else if (e.touches[1]) ; else if (e.touches[0]) {\n      var nears = r.findNearestElements(now[0], now[1], true, true);\n      var near = nears[0];\n      if (near != null) {\n        near.activate();\n        r.touchData.start = near;\n        r.touchData.starts = nears;\n        if (r.nodeIsGrabbable(near)) {\n          var draggedEles = r.dragData.touchDragEles = cy.collection();\n          var selectedNodes = null;\n          r.redrawHint('eles', true);\n          r.redrawHint('drag', true);\n          if (near.selected()) {\n            // reset drag elements, since near will be added again\n\n            selectedNodes = cy.$(function (ele) {\n              return ele.selected() && r.nodeIsGrabbable(ele);\n            });\n            addNodesToDrag(selectedNodes, {\n              addToList: draggedEles\n            });\n          } else {\n            addNodeToDrag(near, {\n              addToList: draggedEles\n            });\n          }\n          setGrabTarget(near);\n          near.emit(makeEvent('grabon'));\n          if (selectedNodes) {\n            selectedNodes.forEach(function (n) {\n              n.emit(makeEvent('grab'));\n            });\n          } else {\n            near.emit(makeEvent('grab'));\n          }\n        }\n      }\n      triggerEvents(near, ['touchstart', 'tapstart', 'vmousedown'], e, {\n        x: now[0],\n        y: now[1]\n      });\n      if (near == null) {\n        r.data.bgActivePosistion = {\n          x: pos[0],\n          y: pos[1]\n        };\n        r.redrawHint('select', true);\n        r.redraw();\n      }\n\n      // Tap, taphold\n      // -----\n\n      r.touchData.singleTouchMoved = false;\n      r.touchData.singleTouchStartTime = +new Date();\n      clearTimeout(r.touchData.tapholdTimeout);\n      r.touchData.tapholdTimeout = setTimeout(function () {\n        if (r.touchData.singleTouchMoved === false && !r.pinching // if pinching, then taphold unselect shouldn't take effect\n        && !r.touchData.selecting // box selection shouldn't allow taphold through\n        ) {\n          triggerEvents(r.touchData.start, ['taphold'], e, {\n            x: now[0],\n            y: now[1]\n          });\n        }\n      }, r.tapholdDuration);\n    }\n    if (e.touches.length >= 1) {\n      var sPos = r.touchData.startPosition = [null, null, null, null, null, null];\n      for (var i = 0; i < now.length; i++) {\n        sPos[i] = earlier[i] = now[i];\n      }\n      var touch0 = e.touches[0];\n      r.touchData.startGPosition = [touch0.clientX, touch0.clientY];\n    }\n  }, false);\n  var touchmoveHandler;\n  r.registerBinding(containerWindow, 'touchmove', touchmoveHandler = function touchmoveHandler(e) {\n    // eslint-disable-line no-undef\n    var capture = r.touchData.capture;\n    if (!capture && !eventInContainer(e)) {\n      return;\n    }\n    var select = r.selection;\n    var cy = r.cy;\n    var now = r.touchData.now;\n    var earlier = r.touchData.earlier;\n    var zoom = cy.zoom();\n    if (e.touches[0]) {\n      var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n      now[0] = pos[0];\n      now[1] = pos[1];\n    }\n    if (e.touches[1]) {\n      var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);\n      now[2] = pos[0];\n      now[3] = pos[1];\n    }\n    if (e.touches[2]) {\n      var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);\n      now[4] = pos[0];\n      now[5] = pos[1];\n    }\n    var makeEvent = function makeEvent(type) {\n      return {\n        originalEvent: e,\n        type: type,\n        position: {\n          x: now[0],\n          y: now[1]\n        }\n      };\n    };\n    var startGPos = r.touchData.startGPosition;\n    var isOverThresholdDrag;\n    if (capture && e.touches[0] && startGPos) {\n      var disp = [];\n      for (var j = 0; j < now.length; j++) {\n        disp[j] = now[j] - earlier[j];\n      }\n      var dx = e.touches[0].clientX - startGPos[0];\n      var dx2 = dx * dx;\n      var dy = e.touches[0].clientY - startGPos[1];\n      var dy2 = dy * dy;\n      var dist2 = dx2 + dy2;\n      isOverThresholdDrag = dist2 >= r.touchTapThreshold2;\n    }\n\n    // context swipe cancelling\n    if (capture && r.touchData.cxt) {\n      e.preventDefault();\n      var f1x2 = e.touches[0].clientX - offsetLeft,\n        f1y2 = e.touches[0].clientY - offsetTop;\n      var f2x2 = e.touches[1].clientX - offsetLeft,\n        f2y2 = e.touches[1].clientY - offsetTop;\n      // var distance2 = distance( f1x2, f1y2, f2x2, f2y2 );\n      var distance2Sq = distanceSq(f1x2, f1y2, f2x2, f2y2);\n      var factorSq = distance2Sq / distance1Sq;\n      var distThreshold = 150;\n      var distThresholdSq = distThreshold * distThreshold;\n      var factorThreshold = 1.5;\n      var factorThresholdSq = factorThreshold * factorThreshold;\n\n      // cancel ctx gestures if the distance b/t the fingers increases\n      if (factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq) {\n        r.touchData.cxt = false;\n        r.data.bgActivePosistion = undefined;\n        r.redrawHint('select', true);\n        var cxtEvt = makeEvent('cxttapend');\n        if (r.touchData.start) {\n          r.touchData.start.unactivate().emit(cxtEvt);\n          r.touchData.start = null;\n        } else {\n          cy.emit(cxtEvt);\n        }\n      }\n    }\n\n    // context swipe\n    if (capture && r.touchData.cxt) {\n      var cxtEvt = makeEvent('cxtdrag');\n      r.data.bgActivePosistion = undefined;\n      r.redrawHint('select', true);\n      if (r.touchData.start) {\n        r.touchData.start.emit(cxtEvt);\n      } else {\n        cy.emit(cxtEvt);\n      }\n      if (r.touchData.start) {\n        r.touchData.start._private.grabbed = false;\n      }\n      r.touchData.cxtDragged = true;\n      var near = r.findNearestElement(now[0], now[1], true, true);\n      if (!r.touchData.cxtOver || near !== r.touchData.cxtOver) {\n        if (r.touchData.cxtOver) {\n          r.touchData.cxtOver.emit(makeEvent('cxtdragout'));\n        }\n        r.touchData.cxtOver = near;\n        if (near) {\n          near.emit(makeEvent('cxtdragover'));\n        }\n      }\n\n      // box selection\n    } else if (capture && e.touches[2] && cy.boxSelectionEnabled()) {\n      e.preventDefault();\n      r.data.bgActivePosistion = undefined;\n      this.lastThreeTouch = +new Date();\n      if (!r.touchData.selecting) {\n        cy.emit(makeEvent('boxstart'));\n      }\n      r.touchData.selecting = true;\n      r.touchData.didSelect = true;\n      select[4] = 1;\n      if (!select || select.length === 0 || select[0] === undefined) {\n        select[0] = (now[0] + now[2] + now[4]) / 3;\n        select[1] = (now[1] + now[3] + now[5]) / 3;\n        select[2] = (now[0] + now[2] + now[4]) / 3 + 1;\n        select[3] = (now[1] + now[3] + now[5]) / 3 + 1;\n      } else {\n        select[2] = (now[0] + now[2] + now[4]) / 3;\n        select[3] = (now[1] + now[3] + now[5]) / 3;\n      }\n      r.redrawHint('select', true);\n      r.redraw();\n\n      // pinch to zoom\n    } else if (capture && e.touches[1] && !r.touchData.didSelect // don't allow box selection to degrade to pinch-to-zoom\n    && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) {\n      // two fingers => pinch to zoom\n      e.preventDefault();\n      r.data.bgActivePosistion = undefined;\n      r.redrawHint('select', true);\n      var draggedEles = r.dragData.touchDragEles;\n      if (draggedEles) {\n        r.redrawHint('drag', true);\n        for (var i = 0; i < draggedEles.length; i++) {\n          var de_p = draggedEles[i]._private;\n          de_p.grabbed = false;\n          de_p.rscratch.inDragLayer = false;\n        }\n      }\n      var _start = r.touchData.start;\n\n      // (x2, y2) for fingers 1 and 2\n      var f1x2 = e.touches[0].clientX - offsetLeft,\n        f1y2 = e.touches[0].clientY - offsetTop;\n      var f2x2 = e.touches[1].clientX - offsetLeft,\n        f2y2 = e.touches[1].clientY - offsetTop;\n      var distance2 = distance(f1x2, f1y2, f2x2, f2y2);\n      // var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 );\n      // var factor = Math.sqrt( distance2Sq ) / Math.sqrt( distance1Sq );\n      var factor = distance2 / distance1;\n      if (twoFingersStartInside) {\n        // delta finger1\n        var df1x = f1x2 - f1x1;\n        var df1y = f1y2 - f1y1;\n\n        // delta finger 2\n        var df2x = f2x2 - f2x1;\n        var df2y = f2y2 - f2y1;\n\n        // translation is the normalised vector of the two fingers movement\n        // i.e. so pinching cancels out and moving together pans\n        var tx = (df1x + df2x) / 2;\n        var ty = (df1y + df2y) / 2;\n\n        // now calculate the zoom\n        var zoom1 = cy.zoom();\n        var zoom2 = zoom1 * factor;\n        var pan1 = cy.pan();\n\n        // the model center point converted to the current rendered pos\n        var ctrx = modelCenter1[0] * zoom1 + pan1.x;\n        var ctry = modelCenter1[1] * zoom1 + pan1.y;\n        var pan2 = {\n          x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx,\n          y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry\n        };\n\n        // remove dragged eles\n        if (_start && _start.active()) {\n          var draggedEles = r.dragData.touchDragEles;\n          freeDraggedElements(draggedEles);\n          r.redrawHint('drag', true);\n          r.redrawHint('eles', true);\n          _start.unactivate().emit(makeEvent('freeon'));\n          draggedEles.emit(makeEvent('free'));\n          if (r.dragData.didDrag) {\n            _start.emit(makeEvent('dragfreeon'));\n            draggedEles.emit(makeEvent('dragfree'));\n          }\n        }\n        cy.viewport({\n          zoom: zoom2,\n          pan: pan2,\n          cancelOnFailedZoom: true\n        });\n        cy.emit(makeEvent('pinchzoom'));\n        distance1 = distance2;\n        f1x1 = f1x2;\n        f1y1 = f1y2;\n        f2x1 = f2x2;\n        f2y1 = f2y2;\n        r.pinching = true;\n      }\n\n      // Re-project\n      if (e.touches[0]) {\n        var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n        now[0] = pos[0];\n        now[1] = pos[1];\n      }\n      if (e.touches[1]) {\n        var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);\n        now[2] = pos[0];\n        now[3] = pos[1];\n      }\n      if (e.touches[2]) {\n        var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);\n        now[4] = pos[0];\n        now[5] = pos[1];\n      }\n    } else if (e.touches[0] && !r.touchData.didSelect // don't allow box selection to degrade to single finger events like panning\n    ) {\n      var start = r.touchData.start;\n      var last = r.touchData.last;\n      var near;\n      if (!r.hoverData.draggingEles && !r.swipePanning) {\n        near = r.findNearestElement(now[0], now[1], true, true);\n      }\n      if (capture && start != null) {\n        e.preventDefault();\n      }\n\n      // dragging nodes\n      if (capture && start != null && r.nodeIsDraggable(start)) {\n        if (isOverThresholdDrag) {\n          // then dragging can happen\n          var draggedEles = r.dragData.touchDragEles;\n          var justStartedDrag = !r.dragData.didDrag;\n          if (justStartedDrag) {\n            addNodesToDrag(draggedEles, {\n              inDragLayer: true\n            });\n          }\n          r.dragData.didDrag = true;\n          var totalShift = {\n            x: 0,\n            y: 0\n          };\n          if (number$1(disp[0]) && number$1(disp[1])) {\n            totalShift.x += disp[0];\n            totalShift.y += disp[1];\n            if (justStartedDrag) {\n              r.redrawHint('eles', true);\n              var dragDelta = r.touchData.dragDelta;\n              if (dragDelta && number$1(dragDelta[0]) && number$1(dragDelta[1])) {\n                totalShift.x += dragDelta[0];\n                totalShift.y += dragDelta[1];\n              }\n            }\n          }\n          r.hoverData.draggingEles = true;\n          draggedEles.silentShift(totalShift).emit(makeEvent('position')).emit(makeEvent('drag'));\n          r.redrawHint('drag', true);\n          if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) {\n            r.redrawHint('eles', true);\n          }\n          r.redraw();\n        } else {\n          // otherwise keep track of drag delta for later\n          var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || [];\n          if (dragDelta.length === 0) {\n            dragDelta.push(disp[0]);\n            dragDelta.push(disp[1]);\n          } else {\n            dragDelta[0] += disp[0];\n            dragDelta[1] += disp[1];\n          }\n        }\n      }\n\n      // touchmove\n      {\n        triggerEvents(start || near, ['touchmove', 'tapdrag', 'vmousemove'], e, {\n          x: now[0],\n          y: now[1]\n        });\n        if ((!start || !start.grabbed()) && near != last) {\n          if (last) {\n            last.emit(makeEvent('tapdragout'));\n          }\n          if (near) {\n            near.emit(makeEvent('tapdragover'));\n          }\n        }\n        r.touchData.last = near;\n      }\n\n      // check to cancel taphold\n      if (capture) {\n        for (var i = 0; i < now.length; i++) {\n          if (now[i] && r.touchData.startPosition[i] && isOverThresholdDrag) {\n            r.touchData.singleTouchMoved = true;\n          }\n        }\n      }\n\n      // panning\n      if (capture && (start == null || start.pannable()) && cy.panningEnabled() && cy.userPanningEnabled()) {\n        var allowPassthrough = allowPanningPassthrough(start, r.touchData.starts);\n        if (allowPassthrough) {\n          e.preventDefault();\n          if (!r.data.bgActivePosistion) {\n            r.data.bgActivePosistion = array2point(r.touchData.startPosition);\n          }\n          if (r.swipePanning) {\n            cy.panBy({\n              x: disp[0] * zoom,\n              y: disp[1] * zoom\n            });\n            cy.emit(makeEvent('dragpan'));\n          } else if (isOverThresholdDrag) {\n            r.swipePanning = true;\n            cy.panBy({\n              x: dx * zoom,\n              y: dy * zoom\n            });\n            cy.emit(makeEvent('dragpan'));\n            if (start) {\n              start.unactivate();\n              r.redrawHint('select', true);\n              r.touchData.start = null;\n            }\n          }\n        }\n\n        // Re-project\n        var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n        now[0] = pos[0];\n        now[1] = pos[1];\n      }\n    }\n    for (var j = 0; j < now.length; j++) {\n      earlier[j] = now[j];\n    }\n\n    // the active bg indicator should be removed when making a swipe that is neither for dragging nodes or panning\n    if (capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null) {\n      r.data.bgActivePosistion = undefined;\n      r.redrawHint('select', true);\n      r.redraw();\n    }\n  }, false);\n  var touchcancelHandler;\n  r.registerBinding(containerWindow, 'touchcancel', touchcancelHandler = function touchcancelHandler(e) {\n    // eslint-disable-line no-unused-vars\n    var start = r.touchData.start;\n    r.touchData.capture = false;\n    if (start) {\n      start.unactivate();\n    }\n  });\n  var touchendHandler, didDoubleTouch, touchTimeout, prevTouchTimeStamp;\n  r.registerBinding(containerWindow, 'touchend', touchendHandler = function touchendHandler(e) {\n    // eslint-disable-line no-unused-vars\n    var start = r.touchData.start;\n    var capture = r.touchData.capture;\n    if (capture) {\n      if (e.touches.length === 0) {\n        r.touchData.capture = false;\n      }\n      e.preventDefault();\n    } else {\n      return;\n    }\n    var select = r.selection;\n    r.swipePanning = false;\n    r.hoverData.draggingEles = false;\n    var cy = r.cy;\n    var zoom = cy.zoom();\n    var now = r.touchData.now;\n    var earlier = r.touchData.earlier;\n    if (e.touches[0]) {\n      var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n      now[0] = pos[0];\n      now[1] = pos[1];\n    }\n    if (e.touches[1]) {\n      var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);\n      now[2] = pos[0];\n      now[3] = pos[1];\n    }\n    if (e.touches[2]) {\n      var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);\n      now[4] = pos[0];\n      now[5] = pos[1];\n    }\n    var makeEvent = function makeEvent(type) {\n      return {\n        originalEvent: e,\n        type: type,\n        position: {\n          x: now[0],\n          y: now[1]\n        }\n      };\n    };\n    if (start) {\n      start.unactivate();\n    }\n    var ctxTapend;\n    if (r.touchData.cxt) {\n      ctxTapend = makeEvent('cxttapend');\n      if (start) {\n        start.emit(ctxTapend);\n      } else {\n        cy.emit(ctxTapend);\n      }\n      if (!r.touchData.cxtDragged) {\n        var ctxTap = makeEvent('cxttap');\n        if (start) {\n          start.emit(ctxTap);\n        } else {\n          cy.emit(ctxTap);\n        }\n      }\n      if (r.touchData.start) {\n        r.touchData.start._private.grabbed = false;\n      }\n      r.touchData.cxt = false;\n      r.touchData.start = null;\n      r.redraw();\n      return;\n    }\n\n    // no more box selection if we don't have three fingers\n    if (!e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting) {\n      r.touchData.selecting = false;\n      var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3]));\n      select[0] = undefined;\n      select[1] = undefined;\n      select[2] = undefined;\n      select[3] = undefined;\n      select[4] = 0;\n      r.redrawHint('select', true);\n      cy.emit(makeEvent('boxend'));\n      var eleWouldBeSelected = function eleWouldBeSelected(ele) {\n        return ele.selectable() && !ele.selected();\n      };\n      box.emit(makeEvent('box')).stdFilter(eleWouldBeSelected).select().emit(makeEvent('boxselect'));\n      if (box.nonempty()) {\n        r.redrawHint('eles', true);\n      }\n      r.redraw();\n    }\n    if (start != null) {\n      start.unactivate();\n    }\n    if (e.touches[2]) {\n      r.data.bgActivePosistion = undefined;\n      r.redrawHint('select', true);\n    } else if (e.touches[1]) ; else if (e.touches[0]) ; else if (!e.touches[0]) {\n      r.data.bgActivePosistion = undefined;\n      r.redrawHint('select', true);\n      var draggedEles = r.dragData.touchDragEles;\n      if (start != null) {\n        var startWasGrabbed = start._private.grabbed;\n        freeDraggedElements(draggedEles);\n        r.redrawHint('drag', true);\n        r.redrawHint('eles', true);\n        if (startWasGrabbed) {\n          start.emit(makeEvent('freeon'));\n          draggedEles.emit(makeEvent('free'));\n          if (r.dragData.didDrag) {\n            start.emit(makeEvent('dragfreeon'));\n            draggedEles.emit(makeEvent('dragfree'));\n          }\n        }\n        triggerEvents(start, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, {\n          x: now[0],\n          y: now[1]\n        });\n        start.unactivate();\n        r.touchData.start = null;\n      } else {\n        var near = r.findNearestElement(now[0], now[1], true, true);\n        triggerEvents(near, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, {\n          x: now[0],\n          y: now[1]\n        });\n      }\n      var dx = r.touchData.startPosition[0] - now[0];\n      var dx2 = dx * dx;\n      var dy = r.touchData.startPosition[1] - now[1];\n      var dy2 = dy * dy;\n      var dist2 = dx2 + dy2;\n      var rdist2 = dist2 * zoom * zoom;\n\n      // Tap event, roughly same as mouse click event for touch\n      if (!r.touchData.singleTouchMoved) {\n        if (!start) {\n          cy.$(':selected').unselect(['tapunselect']);\n        }\n        triggerEvents(start, ['tap', 'vclick'], e, {\n          x: now[0],\n          y: now[1]\n        });\n        didDoubleTouch = false;\n        if (e.timeStamp - prevTouchTimeStamp <= cy.multiClickDebounceTime()) {\n          touchTimeout && clearTimeout(touchTimeout);\n          didDoubleTouch = true;\n          prevTouchTimeStamp = null;\n          triggerEvents(start, ['dbltap', 'vdblclick'], e, {\n            x: now[0],\n            y: now[1]\n          });\n        } else {\n          touchTimeout = setTimeout(function () {\n            if (didDoubleTouch) return;\n            triggerEvents(start, ['onetap', 'voneclick'], e, {\n              x: now[0],\n              y: now[1]\n            });\n          }, cy.multiClickDebounceTime());\n          prevTouchTimeStamp = e.timeStamp;\n        }\n      }\n\n      // Prepare to select the currently touched node, only if it hasn't been dragged past a certain distance\n      if (start != null && !r.dragData.didDrag // didn't drag nodes around\n      && start._private.selectable && rdist2 < r.touchTapThreshold2 && !r.pinching // pinch to zoom should not affect selection\n      ) {\n        if (cy.selectionType() === 'single') {\n          cy.$(isSelected).unmerge(start).unselect(['tapunselect']);\n          start.select(['tapselect']);\n        } else {\n          if (start.selected()) {\n            start.unselect(['tapunselect']);\n          } else {\n            start.select(['tapselect']);\n          }\n        }\n        r.redrawHint('eles', true);\n      }\n      r.touchData.singleTouchMoved = true;\n    }\n    for (var j = 0; j < now.length; j++) {\n      earlier[j] = now[j];\n    }\n    r.dragData.didDrag = false; // reset for next touchstart\n\n    if (e.touches.length === 0) {\n      r.touchData.dragDelta = [];\n      r.touchData.startPosition = [null, null, null, null, null, null];\n      r.touchData.startGPosition = null;\n      r.touchData.didSelect = false;\n    }\n    if (e.touches.length < 2) {\n      if (e.touches.length === 1) {\n        // the old start global pos'n may not be the same finger that remains\n        r.touchData.startGPosition = [e.touches[0].clientX, e.touches[0].clientY];\n      }\n      r.pinching = false;\n      r.redrawHint('eles', true);\n      r.redraw();\n    }\n\n    //r.redraw();\n  }, false);\n\n  // fallback compatibility layer for ms pointer events\n  if (typeof TouchEvent === 'undefined') {\n    var pointers = [];\n    var makeTouch = function makeTouch(e) {\n      return {\n        clientX: e.clientX,\n        clientY: e.clientY,\n        force: 1,\n        identifier: e.pointerId,\n        pageX: e.pageX,\n        pageY: e.pageY,\n        radiusX: e.width / 2,\n        radiusY: e.height / 2,\n        screenX: e.screenX,\n        screenY: e.screenY,\n        target: e.target\n      };\n    };\n    var makePointer = function makePointer(e) {\n      return {\n        event: e,\n        touch: makeTouch(e)\n      };\n    };\n    var addPointer = function addPointer(e) {\n      pointers.push(makePointer(e));\n    };\n    var removePointer = function removePointer(e) {\n      for (var i = 0; i < pointers.length; i++) {\n        var p = pointers[i];\n        if (p.event.pointerId === e.pointerId) {\n          pointers.splice(i, 1);\n          return;\n        }\n      }\n    };\n    var updatePointer = function updatePointer(e) {\n      var p = pointers.filter(function (p) {\n        return p.event.pointerId === e.pointerId;\n      })[0];\n      p.event = e;\n      p.touch = makeTouch(e);\n    };\n    var addTouchesToEvent = function addTouchesToEvent(e) {\n      e.touches = pointers.map(function (p) {\n        return p.touch;\n      });\n    };\n    var pointerIsMouse = function pointerIsMouse(e) {\n      return e.pointerType === 'mouse' || e.pointerType === 4;\n    };\n    r.registerBinding(r.container, 'pointerdown', function (e) {\n      if (pointerIsMouse(e)) {\n        return;\n      } // mouse already handled\n\n      e.preventDefault();\n      addPointer(e);\n      addTouchesToEvent(e);\n      touchstartHandler(e);\n    });\n    r.registerBinding(r.container, 'pointerup', function (e) {\n      if (pointerIsMouse(e)) {\n        return;\n      } // mouse already handled\n\n      removePointer(e);\n      addTouchesToEvent(e);\n      touchendHandler(e);\n    });\n    r.registerBinding(r.container, 'pointercancel', function (e) {\n      if (pointerIsMouse(e)) {\n        return;\n      } // mouse already handled\n\n      removePointer(e);\n      addTouchesToEvent(e);\n      touchcancelHandler(e);\n    });\n    r.registerBinding(r.container, 'pointermove', function (e) {\n      if (pointerIsMouse(e)) {\n        return;\n      } // mouse already handled\n\n      e.preventDefault();\n      updatePointer(e);\n      addTouchesToEvent(e);\n      touchmoveHandler(e);\n    });\n  }\n};\n\nvar BRp$2 = {};\nBRp$2.generatePolygon = function (name, points) {\n  return this.nodeShapes[name] = {\n    renderer: this,\n    name: name,\n    points: points,\n    draw: function draw(context, centerX, centerY, width, height, cornerRadius) {\n      this.renderer.nodeShapeImpl('polygon', context, centerX, centerY, width, height, this.points);\n    },\n    intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding, cornerRadius) {\n      return polygonIntersectLine(x, y, this.points, nodeX, nodeY, width / 2, height / 2, padding);\n    },\n    checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY, cornerRadius) {\n      return pointInsidePolygon(x, y, this.points, centerX, centerY, width, height, [0, -1], padding);\n    },\n    hasMiterBounds: name !== 'rectangle',\n    miterBounds: function miterBounds(centerX, centerY, width, height, strokeWidth, strokePosition) {\n      return miterBox(this.points, centerX, centerY, width, height, strokeWidth);\n    }\n  };\n};\nBRp$2.generateEllipse = function () {\n  return this.nodeShapes['ellipse'] = {\n    renderer: this,\n    name: 'ellipse',\n    draw: function draw(context, centerX, centerY, width, height, cornerRadius) {\n      this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height);\n    },\n    intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding, cornerRadius) {\n      return intersectLineEllipse(x, y, nodeX, nodeY, width / 2 + padding, height / 2 + padding);\n    },\n    checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY, cornerRadius) {\n      return checkInEllipse(x, y, width, height, centerX, centerY, padding);\n    }\n  };\n};\nBRp$2.generateRoundPolygon = function (name, points) {\n  return this.nodeShapes[name] = {\n    renderer: this,\n    name: name,\n    points: points,\n    getOrCreateCorners: function getOrCreateCorners(centerX, centerY, width, height, cornerRadius, rs, field) {\n      if (rs[field] !== undefined && rs[field + '-cx'] === centerX && rs[field + '-cy'] === centerY) {\n        return rs[field];\n      }\n      rs[field] = new Array(points.length / 2);\n      rs[field + '-cx'] = centerX;\n      rs[field + '-cy'] = centerY;\n      var halfW = width / 2;\n      var halfH = height / 2;\n      cornerRadius = cornerRadius === 'auto' ? getRoundPolygonRadius(width, height) : cornerRadius;\n      var p = new Array(points.length / 2);\n      for (var _i = 0; _i < points.length / 2; _i++) {\n        p[_i] = {\n          x: centerX + halfW * points[_i * 2],\n          y: centerY + halfH * points[_i * 2 + 1]\n        };\n      }\n      var i,\n        p1,\n        p2,\n        p3,\n        len = p.length;\n      p1 = p[len - 1];\n      // for each point\n      for (i = 0; i < len; i++) {\n        p2 = p[i % len];\n        p3 = p[(i + 1) % len];\n        rs[field][i] = getRoundCorner(p1, p2, p3, cornerRadius);\n        p1 = p2;\n        p2 = p3;\n      }\n      return rs[field];\n    },\n    draw: function draw(context, centerX, centerY, width, height, cornerRadius, rs) {\n      this.renderer.nodeShapeImpl('round-polygon', context, centerX, centerY, width, height, this.points, this.getOrCreateCorners(centerX, centerY, width, height, cornerRadius, rs, 'drawCorners'));\n    },\n    intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding, cornerRadius, rs) {\n      return roundPolygonIntersectLine(x, y, this.points, nodeX, nodeY, width, height, padding, this.getOrCreateCorners(nodeX, nodeY, width, height, cornerRadius, rs, 'corners'));\n    },\n    checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY, cornerRadius, rs) {\n      return pointInsideRoundPolygon(x, y, this.points, centerX, centerY, width, height, this.getOrCreateCorners(centerX, centerY, width, height, cornerRadius, rs, 'corners'));\n    }\n  };\n};\nBRp$2.generateRoundRectangle = function () {\n  return this.nodeShapes['round-rectangle'] = this.nodeShapes['roundrectangle'] = {\n    renderer: this,\n    name: 'round-rectangle',\n    points: generateUnitNgonPointsFitToSquare(4, 0),\n    draw: function draw(context, centerX, centerY, width, height, cornerRadius) {\n      this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height, this.points, cornerRadius);\n    },\n    intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding, cornerRadius) {\n      return roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding, cornerRadius);\n    },\n    checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY, cornerRadius) {\n      var halfWidth = width / 2;\n      var halfHeight = height / 2;\n      cornerRadius = cornerRadius === 'auto' ? getRoundRectangleRadius(width, height) : cornerRadius;\n      cornerRadius = Math.min(halfWidth, halfHeight, cornerRadius);\n      var diam = cornerRadius * 2;\n\n      // Check hBox\n      if (pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) {\n        return true;\n      }\n\n      // Check vBox\n      if (pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) {\n        return true;\n      }\n\n      // Check top left quarter circle\n      if (checkInEllipse(x, y, diam, diam, centerX - halfWidth + cornerRadius, centerY - halfHeight + cornerRadius, padding)) {\n        return true;\n      }\n\n      // Check top right quarter circle\n      if (checkInEllipse(x, y, diam, diam, centerX + halfWidth - cornerRadius, centerY - halfHeight + cornerRadius, padding)) {\n        return true;\n      }\n\n      // Check bottom right quarter circle\n      if (checkInEllipse(x, y, diam, diam, centerX + halfWidth - cornerRadius, centerY + halfHeight - cornerRadius, padding)) {\n        return true;\n      }\n\n      // Check bottom left quarter circle\n      if (checkInEllipse(x, y, diam, diam, centerX - halfWidth + cornerRadius, centerY + halfHeight - cornerRadius, padding)) {\n        return true;\n      }\n      return false;\n    }\n  };\n};\nBRp$2.generateCutRectangle = function () {\n  return this.nodeShapes['cut-rectangle'] = this.nodeShapes['cutrectangle'] = {\n    renderer: this,\n    name: 'cut-rectangle',\n    cornerLength: getCutRectangleCornerLength(),\n    points: generateUnitNgonPointsFitToSquare(4, 0),\n    draw: function draw(context, centerX, centerY, width, height, cornerRadius) {\n      this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height, null, cornerRadius);\n    },\n    generateCutTrianglePts: function generateCutTrianglePts(width, height, centerX, centerY, cornerRadius) {\n      var cl = cornerRadius === 'auto' ? this.cornerLength : cornerRadius;\n      var hh = height / 2;\n      var hw = width / 2;\n      var xBegin = centerX - hw;\n      var xEnd = centerX + hw;\n      var yBegin = centerY - hh;\n      var yEnd = centerY + hh;\n\n      // points are in clockwise order, inner (imaginary) triangle pt on [4, 5]\n      return {\n        topLeft: [xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl],\n        topRight: [xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl],\n        bottomRight: [xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl],\n        bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl]\n      };\n    },\n    intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding, cornerRadius) {\n      var cPts = this.generateCutTrianglePts(width + 2 * padding, height + 2 * padding, nodeX, nodeY, cornerRadius);\n      var pts = [].concat.apply([], [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4)]);\n      return polygonIntersectLine(x, y, pts, nodeX, nodeY);\n    },\n    checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY, cornerRadius) {\n      var cl = cornerRadius === 'auto' ? this.cornerLength : cornerRadius;\n      // Check hBox\n      if (pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * cl, [0, -1], padding)) {\n        return true;\n      }\n\n      // Check vBox\n      if (pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * cl, height, [0, -1], padding)) {\n        return true;\n      }\n      var cutTrianglePts = this.generateCutTrianglePts(width, height, centerX, centerY);\n      return pointInsidePolygonPoints(x, y, cutTrianglePts.topLeft) || pointInsidePolygonPoints(x, y, cutTrianglePts.topRight) || pointInsidePolygonPoints(x, y, cutTrianglePts.bottomRight) || pointInsidePolygonPoints(x, y, cutTrianglePts.bottomLeft);\n    }\n  };\n};\nBRp$2.generateBarrel = function () {\n  return this.nodeShapes['barrel'] = {\n    renderer: this,\n    name: 'barrel',\n    points: generateUnitNgonPointsFitToSquare(4, 0),\n    draw: function draw(context, centerX, centerY, width, height, cornerRadius) {\n      this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height);\n    },\n    intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding, cornerRadius) {\n      // use two fixed t values for the bezier curve approximation\n\n      var t0 = 0.15;\n      var t1 = 0.5;\n      var t2 = 0.85;\n      var bPts = this.generateBarrelBezierPts(width + 2 * padding, height + 2 * padding, nodeX, nodeY);\n      var approximateBarrelCurvePts = function approximateBarrelCurvePts(pts) {\n        // approximate curve pts based on the two t values\n        var m0 = qbezierPtAt({\n          x: pts[0],\n          y: pts[1]\n        }, {\n          x: pts[2],\n          y: pts[3]\n        }, {\n          x: pts[4],\n          y: pts[5]\n        }, t0);\n        var m1 = qbezierPtAt({\n          x: pts[0],\n          y: pts[1]\n        }, {\n          x: pts[2],\n          y: pts[3]\n        }, {\n          x: pts[4],\n          y: pts[5]\n        }, t1);\n        var m2 = qbezierPtAt({\n          x: pts[0],\n          y: pts[1]\n        }, {\n          x: pts[2],\n          y: pts[3]\n        }, {\n          x: pts[4],\n          y: pts[5]\n        }, t2);\n        return [pts[0], pts[1], m0.x, m0.y, m1.x, m1.y, m2.x, m2.y, pts[4], pts[5]];\n      };\n      var pts = [].concat(approximateBarrelCurvePts(bPts.topLeft), approximateBarrelCurvePts(bPts.topRight), approximateBarrelCurvePts(bPts.bottomRight), approximateBarrelCurvePts(bPts.bottomLeft));\n      return polygonIntersectLine(x, y, pts, nodeX, nodeY);\n    },\n    generateBarrelBezierPts: function generateBarrelBezierPts(width, height, centerX, centerY) {\n      var hh = height / 2;\n      var hw = width / 2;\n      var xBegin = centerX - hw;\n      var xEnd = centerX + hw;\n      var yBegin = centerY - hh;\n      var yEnd = centerY + hh;\n      var curveConstants = getBarrelCurveConstants(width, height);\n      var hOffset = curveConstants.heightOffset;\n      var wOffset = curveConstants.widthOffset;\n      var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width;\n\n      // points are in clockwise order, inner (imaginary) control pt on [4, 5]\n      var pts = {\n        topLeft: [xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin],\n        topRight: [xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset],\n        bottomRight: [xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd],\n        bottomLeft: [xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset]\n      };\n      pts.topLeft.isTop = true;\n      pts.topRight.isTop = true;\n      pts.bottomLeft.isBottom = true;\n      pts.bottomRight.isBottom = true;\n      return pts;\n    },\n    checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY, cornerRadius) {\n      var curveConstants = getBarrelCurveConstants(width, height);\n      var hOffset = curveConstants.heightOffset;\n      var wOffset = curveConstants.widthOffset;\n\n      // Check hBox\n      if (pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * hOffset, [0, -1], padding)) {\n        return true;\n      }\n\n      // Check vBox\n      if (pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * wOffset, height, [0, -1], padding)) {\n        return true;\n      }\n      var barrelCurvePts = this.generateBarrelBezierPts(width, height, centerX, centerY);\n      var getCurveT = function getCurveT(x, y, curvePts) {\n        var x0 = curvePts[4];\n        var x1 = curvePts[2];\n        var x2 = curvePts[0];\n        var y0 = curvePts[5];\n        // var y1 = curvePts[ 3 ];\n        var y2 = curvePts[1];\n        var xMin = Math.min(x0, x2);\n        var xMax = Math.max(x0, x2);\n        var yMin = Math.min(y0, y2);\n        var yMax = Math.max(y0, y2);\n        if (xMin <= x && x <= xMax && yMin <= y && y <= yMax) {\n          var coeff = bezierPtsToQuadCoeff(x0, x1, x2);\n          var roots = solveQuadratic(coeff[0], coeff[1], coeff[2], x);\n          var validRoots = roots.filter(function (r) {\n            return 0 <= r && r <= 1;\n          });\n          if (validRoots.length > 0) {\n            return validRoots[0];\n          }\n        }\n        return null;\n      };\n      var curveRegions = Object.keys(barrelCurvePts);\n      for (var i = 0; i < curveRegions.length; i++) {\n        var corner = curveRegions[i];\n        var cornerPts = barrelCurvePts[corner];\n        var t = getCurveT(x, y, cornerPts);\n        if (t == null) {\n          continue;\n        }\n        var y0 = cornerPts[5];\n        var y1 = cornerPts[3];\n        var y2 = cornerPts[1];\n        var bezY = qbezierAt(y0, y1, y2, t);\n        if (cornerPts.isTop && bezY <= y) {\n          return true;\n        }\n        if (cornerPts.isBottom && y <= bezY) {\n          return true;\n        }\n      }\n      return false;\n    }\n  };\n};\nBRp$2.generateBottomRoundrectangle = function () {\n  return this.nodeShapes['bottom-round-rectangle'] = this.nodeShapes['bottomroundrectangle'] = {\n    renderer: this,\n    name: 'bottom-round-rectangle',\n    points: generateUnitNgonPointsFitToSquare(4, 0),\n    draw: function draw(context, centerX, centerY, width, height, cornerRadius) {\n      this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height, this.points, cornerRadius);\n    },\n    intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding, cornerRadius) {\n      var topStartX = nodeX - (width / 2 + padding);\n      var topStartY = nodeY - (height / 2 + padding);\n      var topEndY = topStartY;\n      var topEndX = nodeX + (width / 2 + padding);\n      var topIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false);\n      if (topIntersections.length > 0) {\n        return topIntersections;\n      }\n      return roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding, cornerRadius);\n    },\n    checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY, cornerRadius) {\n      cornerRadius = cornerRadius === 'auto' ? getRoundRectangleRadius(width, height) : cornerRadius;\n      var diam = 2 * cornerRadius;\n\n      // Check hBox\n      if (pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) {\n        return true;\n      }\n\n      // Check vBox\n      if (pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) {\n        return true;\n      }\n\n      // check non-rounded top side\n      var outerWidth = width / 2 + 2 * padding;\n      var outerHeight = height / 2 + 2 * padding;\n      var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight];\n      if (pointInsidePolygonPoints(x, y, points)) {\n        return true;\n      }\n\n      // Check bottom right quarter circle\n      if (checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) {\n        return true;\n      }\n\n      // Check bottom left quarter circle\n      if (checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) {\n        return true;\n      }\n      return false;\n    }\n  };\n};\nBRp$2.registerNodeShapes = function () {\n  var nodeShapes = this.nodeShapes = {};\n  var renderer = this;\n  this.generateEllipse();\n  this.generatePolygon('triangle', generateUnitNgonPointsFitToSquare(3, 0));\n  this.generateRoundPolygon('round-triangle', generateUnitNgonPointsFitToSquare(3, 0));\n  this.generatePolygon('rectangle', generateUnitNgonPointsFitToSquare(4, 0));\n  nodeShapes['square'] = nodeShapes['rectangle'];\n  this.generateRoundRectangle();\n  this.generateCutRectangle();\n  this.generateBarrel();\n  this.generateBottomRoundrectangle();\n  {\n    var diamondPoints = [0, 1, 1, 0, 0, -1, -1, 0];\n    this.generatePolygon('diamond', diamondPoints);\n    this.generateRoundPolygon('round-diamond', diamondPoints);\n  }\n  this.generatePolygon('pentagon', generateUnitNgonPointsFitToSquare(5, 0));\n  this.generateRoundPolygon('round-pentagon', generateUnitNgonPointsFitToSquare(5, 0));\n  this.generatePolygon('hexagon', generateUnitNgonPointsFitToSquare(6, 0));\n  this.generateRoundPolygon('round-hexagon', generateUnitNgonPointsFitToSquare(6, 0));\n  this.generatePolygon('heptagon', generateUnitNgonPointsFitToSquare(7, 0));\n  this.generateRoundPolygon('round-heptagon', generateUnitNgonPointsFitToSquare(7, 0));\n  this.generatePolygon('octagon', generateUnitNgonPointsFitToSquare(8, 0));\n  this.generateRoundPolygon('round-octagon', generateUnitNgonPointsFitToSquare(8, 0));\n  var star5Points = new Array(20);\n  {\n    var outerPoints = generateUnitNgonPoints(5, 0);\n    var innerPoints = generateUnitNgonPoints(5, Math.PI / 5);\n\n    // Outer radius is 1; inner radius of star is smaller\n    var innerRadius = 0.5 * (3 - Math.sqrt(5));\n    innerRadius *= 1.57;\n    for (var i = 0; i < innerPoints.length / 2; i++) {\n      innerPoints[i * 2] *= innerRadius;\n      innerPoints[i * 2 + 1] *= innerRadius;\n    }\n    for (var i = 0; i < 20 / 4; i++) {\n      star5Points[i * 4] = outerPoints[i * 2];\n      star5Points[i * 4 + 1] = outerPoints[i * 2 + 1];\n      star5Points[i * 4 + 2] = innerPoints[i * 2];\n      star5Points[i * 4 + 3] = innerPoints[i * 2 + 1];\n    }\n  }\n  star5Points = fitPolygonToSquare(star5Points);\n  this.generatePolygon('star', star5Points);\n  this.generatePolygon('vee', [-1, -1, 0, -0.333, 1, -1, 0, 1]);\n  this.generatePolygon('rhomboid', [-1, -1, 0.333, -1, 1, 1, -0.333, 1]);\n  this.generatePolygon('right-rhomboid', [-0.333, -1, 1, -1, 0.333, 1, -1, 1]);\n  this.nodeShapes['concavehexagon'] = this.generatePolygon('concave-hexagon', [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]);\n  {\n    var tagPoints = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1];\n    this.generatePolygon('tag', tagPoints);\n    this.generateRoundPolygon('round-tag', tagPoints);\n  }\n  nodeShapes.makePolygon = function (points) {\n    // use caching on user-specified polygons so they are as fast as native shapes\n\n    var key = points.join('$');\n    var name = 'polygon-' + key;\n    var shape;\n    if (shape = this[name]) {\n      // got cached shape\n      return shape;\n    }\n\n    // create and cache new shape\n    return renderer.generatePolygon(name, points);\n  };\n};\n\nvar BRp$1 = {};\nBRp$1.timeToRender = function () {\n  return this.redrawTotalTime / this.redrawCount;\n};\nBRp$1.redraw = function (options) {\n  options = options || staticEmptyObject();\n  var r = this;\n  if (r.averageRedrawTime === undefined) {\n    r.averageRedrawTime = 0;\n  }\n  if (r.lastRedrawTime === undefined) {\n    r.lastRedrawTime = 0;\n  }\n  if (r.lastDrawTime === undefined) {\n    r.lastDrawTime = 0;\n  }\n  r.requestedFrame = true;\n  r.renderOptions = options;\n};\nBRp$1.beforeRender = function (fn, priority) {\n  // the renderer can't add tick callbacks when destroyed\n  if (this.destroyed) {\n    return;\n  }\n  if (priority == null) {\n    error('Priority is not optional for beforeRender');\n  }\n  var cbs = this.beforeRenderCallbacks;\n  cbs.push({\n    fn: fn,\n    priority: priority\n  });\n\n  // higher priority callbacks executed first\n  cbs.sort(function (a, b) {\n    return b.priority - a.priority;\n  });\n};\nvar beforeRenderCallbacks = function beforeRenderCallbacks(r, willDraw, startTime) {\n  var cbs = r.beforeRenderCallbacks;\n  for (var i = 0; i < cbs.length; i++) {\n    cbs[i].fn(willDraw, startTime);\n  }\n};\nBRp$1.startRenderLoop = function () {\n  var r = this;\n  var cy = r.cy;\n  if (r.renderLoopStarted) {\n    return;\n  } else {\n    r.renderLoopStarted = true;\n  }\n  var _renderFn = function renderFn(requestTime) {\n    if (r.destroyed) {\n      return;\n    }\n    if (cy.batching()) ; else if (r.requestedFrame && !r.skipFrame) {\n      beforeRenderCallbacks(r, true, requestTime);\n      var startTime = performanceNow();\n      r.render(r.renderOptions);\n      var endTime = r.lastDrawTime = performanceNow();\n      if (r.averageRedrawTime === undefined) {\n        r.averageRedrawTime = endTime - startTime;\n      }\n      if (r.redrawCount === undefined) {\n        r.redrawCount = 0;\n      }\n      r.redrawCount++;\n      if (r.redrawTotalTime === undefined) {\n        r.redrawTotalTime = 0;\n      }\n      var duration = endTime - startTime;\n      r.redrawTotalTime += duration;\n      r.lastRedrawTime = duration;\n\n      // use a weighted average with a bias from the previous average so we don't spike so easily\n      r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2;\n      r.requestedFrame = false;\n    } else {\n      beforeRenderCallbacks(r, false, requestTime);\n    }\n    r.skipFrame = false;\n    requestAnimationFrame(_renderFn);\n  };\n  requestAnimationFrame(_renderFn);\n};\n\nvar BaseRenderer = function BaseRenderer(options) {\n  this.init(options);\n};\nvar BR = BaseRenderer;\nvar BRp = BR.prototype;\nBRp.clientFunctions = ['redrawHint', 'render', 'renderTo', 'matchCanvasSize', 'nodeShapeImpl', 'arrowShapeImpl'];\nBRp.init = function (options) {\n  var r = this;\n  r.options = options;\n  r.cy = options.cy;\n  var ctr = r.container = options.cy.container();\n  var containerWindow = r.cy.window();\n\n  // prepend a stylesheet in the head such that\n  if (containerWindow) {\n    var document = containerWindow.document;\n    var head = document.head;\n    var stylesheetId = '__________cytoscape_stylesheet';\n    var className = '__________cytoscape_container';\n    var stylesheetAlreadyExists = document.getElementById(stylesheetId) != null;\n    if (ctr.className.indexOf(className) < 0) {\n      ctr.className = (ctr.className || '') + ' ' + className;\n    }\n    if (!stylesheetAlreadyExists) {\n      var stylesheet = document.createElement('style');\n      stylesheet.id = stylesheetId;\n      stylesheet.textContent = '.' + className + ' { position: relative; }';\n      head.insertBefore(stylesheet, head.children[0]); // first so lowest priority\n    }\n    var computedStyle = containerWindow.getComputedStyle(ctr);\n    var position = computedStyle.getPropertyValue('position');\n    if (position === 'static') {\n      warn('A Cytoscape container has style position:static and so can not use UI extensions properly');\n    }\n  }\n  r.selection = [undefined, undefined, undefined, undefined, 0]; // Coordinates for selection box, plus enabled flag\n\n  r.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95];\n\n  //--Pointer-related data\n  r.hoverData = {\n    down: null,\n    last: null,\n    downTime: null,\n    triggerMode: null,\n    dragging: false,\n    initialPan: [null, null],\n    capture: false\n  };\n  r.dragData = {\n    possibleDragElements: []\n  };\n  r.touchData = {\n    start: null,\n    capture: false,\n    // These 3 fields related to tap, taphold events\n    startPosition: [null, null, null, null, null, null],\n    singleTouchStartTime: null,\n    singleTouchMoved: true,\n    now: [null, null, null, null, null, null],\n    earlier: [null, null, null, null, null, null]\n  };\n  r.redraws = 0;\n  r.showFps = options.showFps;\n  r.debug = options.debug;\n  r.webgl = options.webgl;\n  r.hideEdgesOnViewport = options.hideEdgesOnViewport;\n  r.textureOnViewport = options.textureOnViewport;\n  r.wheelSensitivity = options.wheelSensitivity;\n  r.motionBlurEnabled = options.motionBlur; // on by default\n  r.forcedPixelRatio = number$1(options.pixelRatio) ? options.pixelRatio : null;\n  r.motionBlur = options.motionBlur; // for initial kick off\n  r.motionBlurOpacity = options.motionBlurOpacity;\n  r.motionBlurTransparency = 1 - r.motionBlurOpacity;\n  r.motionBlurPxRatio = 1;\n  r.mbPxRBlurry = 1; //0.8;\n  r.minMbLowQualFrames = 4;\n  r.fullQualityMb = false;\n  r.clearedForMotionBlur = [];\n  r.desktopTapThreshold = options.desktopTapThreshold;\n  r.desktopTapThreshold2 = options.desktopTapThreshold * options.desktopTapThreshold;\n  r.touchTapThreshold = options.touchTapThreshold;\n  r.touchTapThreshold2 = options.touchTapThreshold * options.touchTapThreshold;\n  r.tapholdDuration = 500;\n  r.bindings = [];\n  r.beforeRenderCallbacks = [];\n  r.beforeRenderPriorities = {\n    // higher priority execs before lower one\n    animations: 400,\n    eleCalcs: 300,\n    eleTxrDeq: 200,\n    lyrTxrDeq: 150,\n    lyrTxrSkip: 100\n  };\n  r.registerNodeShapes();\n  r.registerArrowShapes();\n  r.registerCalculationListeners();\n};\nBRp.notify = function (eventName, eles) {\n  var r = this;\n  var cy = r.cy;\n\n  // the renderer can't be notified after it's destroyed\n  if (this.destroyed) {\n    return;\n  }\n  if (eventName === 'init') {\n    r.load();\n    return;\n  }\n  if (eventName === 'destroy') {\n    r.destroy();\n    return;\n  }\n  if (eventName === 'add' || eventName === 'remove' || eventName === 'move' && cy.hasCompoundNodes() || eventName === 'load' || eventName === 'zorder' || eventName === 'mount') {\n    r.invalidateCachedZSortedEles();\n  }\n  if (eventName === 'viewport') {\n    r.redrawHint('select', true);\n  }\n  if (eventName === 'gc') {\n    r.redrawHint('gc', true);\n  }\n  if (eventName === 'load' || eventName === 'resize' || eventName === 'mount') {\n    r.invalidateContainerClientCoordsCache();\n    r.matchCanvasSize(r.container);\n  }\n  r.redrawHint('eles', true);\n  r.redrawHint('drag', true);\n  this.startRenderLoop();\n  this.redraw();\n};\nBRp.destroy = function () {\n  var r = this;\n  r.destroyed = true;\n  r.cy.stopAnimationLoop();\n  for (var i = 0; i < r.bindings.length; i++) {\n    var binding = r.bindings[i];\n    var b = binding;\n    var tgt = b.target;\n    (tgt.off || tgt.removeEventListener).apply(tgt, b.args);\n  }\n  r.bindings = [];\n  r.beforeRenderCallbacks = [];\n  r.onUpdateEleCalcsFns = [];\n  if (r.removeObserver) {\n    r.removeObserver.disconnect();\n  }\n  if (r.styleObserver) {\n    r.styleObserver.disconnect();\n  }\n  if (r.resizeObserver) {\n    r.resizeObserver.disconnect();\n  }\n  if (r.labelCalcDiv) {\n    try {\n      document.body.removeChild(r.labelCalcDiv); // eslint-disable-line no-undef\n    } catch (e) {\n      // ie10 issue #1014\n    }\n  }\n};\nBRp.isHeadless = function () {\n  return false;\n};\n[BRp$f, BRp$5, BRp$4, BRp$3, BRp$2, BRp$1].forEach(function (props) {\n  extend(BRp, props);\n});\n\nvar fullFpsTime = 1000 / 60; // assume 60 frames per second\n\nvar defs = {\n  setupDequeueing: function setupDequeueing(opts) {\n    return function setupDequeueingImpl() {\n      var self = this;\n      var r = this.renderer;\n      if (self.dequeueingSetup) {\n        return;\n      } else {\n        self.dequeueingSetup = true;\n      }\n      var queueRedraw = debounce(function () {\n        r.redrawHint('eles', true);\n        r.redrawHint('drag', true);\n        r.redraw();\n      }, opts.deqRedrawThreshold);\n      var dequeue = function dequeue(willDraw, frameStartTime) {\n        var startTime = performanceNow();\n        var avgRenderTime = r.averageRedrawTime;\n        var renderTime = r.lastRedrawTime;\n        var deqd = [];\n        var extent = r.cy.extent();\n        var pixelRatio = r.getPixelRatio();\n\n        // if we aren't in a tick that causes a draw, then the rendered style\n        // queue won't automatically be flushed before dequeueing starts\n        if (!willDraw) {\n          r.flushRenderedStyleQueue();\n        }\n        while (true) {\n          // eslint-disable-line no-constant-condition\n          var now = performanceNow();\n          var duration = now - startTime;\n          var frameDuration = now - frameStartTime;\n          if (renderTime < fullFpsTime) {\n            // if we're rendering faster than the ideal fps, then do dequeueing\n            // during all of the remaining frame time\n\n            var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0);\n            if (frameDuration >= opts.deqFastCost * timeAvailable) {\n              break;\n            }\n          } else {\n            if (willDraw) {\n              if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) {\n                break;\n              }\n            } else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) {\n              break;\n            }\n          }\n          var thisDeqd = opts.deq(self, pixelRatio, extent);\n          if (thisDeqd.length > 0) {\n            for (var i = 0; i < thisDeqd.length; i++) {\n              deqd.push(thisDeqd[i]);\n            }\n          } else {\n            break;\n          }\n        }\n\n        // callbacks on dequeue\n        if (deqd.length > 0) {\n          opts.onDeqd(self, deqd);\n          if (!willDraw && opts.shouldRedraw(self, deqd, pixelRatio, extent)) {\n            queueRedraw();\n          }\n        }\n      };\n      var priority = opts.priority || noop$1;\n      r.beforeRender(dequeue, priority(self));\n    };\n  }\n};\n\n// Allows lookups for (ele, lvl) => cache.\n// Uses keys so elements may share the same cache.\nvar ElementTextureCacheLookup = /*#__PURE__*/function () {\n  function ElementTextureCacheLookup(getKey) {\n    var doesEleInvalidateKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : falsify;\n    _classCallCheck(this, ElementTextureCacheLookup);\n    this.idsByKey = new Map$1();\n    this.keyForId = new Map$1();\n    this.cachesByLvl = new Map$1();\n    this.lvls = [];\n    this.getKey = getKey;\n    this.doesEleInvalidateKey = doesEleInvalidateKey;\n  }\n  return _createClass(ElementTextureCacheLookup, [{\n    key: \"getIdsFor\",\n    value: function getIdsFor(key) {\n      if (key == null) {\n        error(\"Can not get id list for null key\");\n      }\n      var idsByKey = this.idsByKey;\n      var ids = this.idsByKey.get(key);\n      if (!ids) {\n        ids = new Set$1();\n        idsByKey.set(key, ids);\n      }\n      return ids;\n    }\n  }, {\n    key: \"addIdForKey\",\n    value: function addIdForKey(key, id) {\n      if (key != null) {\n        this.getIdsFor(key).add(id);\n      }\n    }\n  }, {\n    key: \"deleteIdForKey\",\n    value: function deleteIdForKey(key, id) {\n      if (key != null) {\n        this.getIdsFor(key)[\"delete\"](id);\n      }\n    }\n  }, {\n    key: \"getNumberOfIdsForKey\",\n    value: function getNumberOfIdsForKey(key) {\n      if (key == null) {\n        return 0;\n      } else {\n        return this.getIdsFor(key).size;\n      }\n    }\n  }, {\n    key: \"updateKeyMappingFor\",\n    value: function updateKeyMappingFor(ele) {\n      var id = ele.id();\n      var prevKey = this.keyForId.get(id);\n      var currKey = this.getKey(ele);\n      this.deleteIdForKey(prevKey, id);\n      this.addIdForKey(currKey, id);\n      this.keyForId.set(id, currKey);\n    }\n  }, {\n    key: \"deleteKeyMappingFor\",\n    value: function deleteKeyMappingFor(ele) {\n      var id = ele.id();\n      var prevKey = this.keyForId.get(id);\n      this.deleteIdForKey(prevKey, id);\n      this.keyForId[\"delete\"](id);\n    }\n  }, {\n    key: \"keyHasChangedFor\",\n    value: function keyHasChangedFor(ele) {\n      var id = ele.id();\n      var prevKey = this.keyForId.get(id);\n      var newKey = this.getKey(ele);\n      return prevKey !== newKey;\n    }\n  }, {\n    key: \"isInvalid\",\n    value: function isInvalid(ele) {\n      return this.keyHasChangedFor(ele) || this.doesEleInvalidateKey(ele);\n    }\n  }, {\n    key: \"getCachesAt\",\n    value: function getCachesAt(lvl) {\n      var cachesByLvl = this.cachesByLvl,\n        lvls = this.lvls;\n      var caches = cachesByLvl.get(lvl);\n      if (!caches) {\n        caches = new Map$1();\n        cachesByLvl.set(lvl, caches);\n        lvls.push(lvl);\n      }\n      return caches;\n    }\n  }, {\n    key: \"getCache\",\n    value: function getCache(key, lvl) {\n      return this.getCachesAt(lvl).get(key);\n    }\n  }, {\n    key: \"get\",\n    value: function get(ele, lvl) {\n      var key = this.getKey(ele);\n      var cache = this.getCache(key, lvl);\n\n      // getting for an element may need to add to the id list b/c eles can share keys\n      if (cache != null) {\n        this.updateKeyMappingFor(ele);\n      }\n      return cache;\n    }\n  }, {\n    key: \"getForCachedKey\",\n    value: function getForCachedKey(ele, lvl) {\n      var key = this.keyForId.get(ele.id()); // n.b. use cached key, not newly computed key\n      var cache = this.getCache(key, lvl);\n      return cache;\n    }\n  }, {\n    key: \"hasCache\",\n    value: function hasCache(key, lvl) {\n      return this.getCachesAt(lvl).has(key);\n    }\n  }, {\n    key: \"has\",\n    value: function has(ele, lvl) {\n      var key = this.getKey(ele);\n      return this.hasCache(key, lvl);\n    }\n  }, {\n    key: \"setCache\",\n    value: function setCache(key, lvl, cache) {\n      cache.key = key;\n      this.getCachesAt(lvl).set(key, cache);\n    }\n  }, {\n    key: \"set\",\n    value: function set(ele, lvl, cache) {\n      var key = this.getKey(ele);\n      this.setCache(key, lvl, cache);\n      this.updateKeyMappingFor(ele);\n    }\n  }, {\n    key: \"deleteCache\",\n    value: function deleteCache(key, lvl) {\n      this.getCachesAt(lvl)[\"delete\"](key);\n    }\n  }, {\n    key: \"delete\",\n    value: function _delete(ele, lvl) {\n      var key = this.getKey(ele);\n      this.deleteCache(key, lvl);\n    }\n  }, {\n    key: \"invalidateKey\",\n    value: function invalidateKey(key) {\n      var _this = this;\n      this.lvls.forEach(function (lvl) {\n        return _this.deleteCache(key, lvl);\n      });\n    }\n\n    // returns true if no other eles reference the invalidated cache (n.b. other eles may need the cache with the same key)\n  }, {\n    key: \"invalidate\",\n    value: function invalidate(ele) {\n      var id = ele.id();\n      var key = this.keyForId.get(id); // n.b. use stored key rather than current (potential key)\n\n      this.deleteKeyMappingFor(ele);\n      var entireKeyInvalidated = this.doesEleInvalidateKey(ele);\n      if (entireKeyInvalidated) {\n        // clear mapping for current key\n        this.invalidateKey(key);\n      }\n      return entireKeyInvalidated || this.getNumberOfIdsForKey(key) === 0;\n    }\n  }]);\n}();\n\nvar minTxrH = 25; // the size of the texture cache for small height eles (special case)\nvar txrStepH = 50; // the min size of the regular cache, and the size it increases with each step up\nvar minLvl$1 = -4; // when scaling smaller than that we don't need to re-render\nvar maxLvl$1 = 3; // when larger than this scale just render directly (caching is not helpful)\nvar maxZoom$1 = 7.99; // beyond this zoom level, layered textures are not used\nvar eleTxrSpacing = 8; // spacing between elements on textures to avoid blitting overlaps\nvar defTxrWidth = 1024; // default/minimum texture width\nvar maxTxrW = 1024; // the maximum width of a texture\nvar maxTxrH = 1024; // the maximum height of a texture\nvar minUtility = 0.2; // if usage of texture is less than this, it is retired\nvar maxFullness = 0.8; // fullness of texture after which queue removal is checked\nvar maxFullnessChecks = 10; // dequeued after this many checks\nvar deqCost$1 = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame\nvar deqAvgCost$1 = 0.1; // % of add'l rendering cost compared to average overall redraw time\nvar deqNoDrawCost$1 = 0.9; // % of avg frame time that can be used for dequeueing when not drawing\nvar deqFastCost$1 = 0.9; // % of frame time to be used when >60fps\nvar deqRedrawThreshold$1 = 100; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile\nvar maxDeqSize$1 = 1; // number of eles to dequeue and render at higher texture in each batch\n\nvar getTxrReasons = {\n  dequeue: 'dequeue',\n  downscale: 'downscale',\n  highQuality: 'highQuality'\n};\nvar initDefaults = defaults$g({\n  getKey: null,\n  doesEleInvalidateKey: falsify,\n  drawElement: null,\n  getBoundingBox: null,\n  getRotationPoint: null,\n  getRotationOffset: null,\n  isVisible: trueify,\n  allowEdgeTxrCaching: true,\n  allowParentTxrCaching: true\n});\nvar ElementTextureCache = function ElementTextureCache(renderer, initOptions) {\n  var self = this;\n  self.renderer = renderer;\n  self.onDequeues = [];\n  var opts = initDefaults(initOptions);\n  extend(self, opts);\n  self.lookup = new ElementTextureCacheLookup(opts.getKey, opts.doesEleInvalidateKey);\n  self.setupDequeueing();\n};\nvar ETCp = ElementTextureCache.prototype;\nETCp.reasons = getTxrReasons;\n\n// the list of textures in which new subtextures for elements can be placed\nETCp.getTextureQueue = function (txrH) {\n  var self = this;\n  self.eleImgCaches = self.eleImgCaches || {};\n  return self.eleImgCaches[txrH] = self.eleImgCaches[txrH] || [];\n};\n\n// the list of usused textures which can be recycled (in use in texture queue)\nETCp.getRetiredTextureQueue = function (txrH) {\n  var self = this;\n  var rtxtrQs = self.eleImgCaches.retired = self.eleImgCaches.retired || {};\n  var rtxtrQ = rtxtrQs[txrH] = rtxtrQs[txrH] || [];\n  return rtxtrQ;\n};\n\n// queue of element draw requests at different scale levels\nETCp.getElementQueue = function () {\n  var self = this;\n  var q = self.eleCacheQueue = self.eleCacheQueue || new Heap(function (a, b) {\n    return b.reqs - a.reqs;\n  });\n  return q;\n};\n\n// queue of element draw requests at different scale levels (element id lookup)\nETCp.getElementKeyToQueue = function () {\n  var self = this;\n  var k2q = self.eleKeyToCacheQueue = self.eleKeyToCacheQueue || {};\n  return k2q;\n};\nETCp.getElement = function (ele, bb, pxRatio, lvl, reason) {\n  var self = this;\n  var r = this.renderer;\n  var zoom = r.cy.zoom();\n  var lookup = this.lookup;\n  if (!bb || bb.w === 0 || bb.h === 0 || isNaN(bb.w) || isNaN(bb.h) || !ele.visible() || ele.removed()) {\n    return null;\n  }\n  if (!self.allowEdgeTxrCaching && ele.isEdge() || !self.allowParentTxrCaching && ele.isParent()) {\n    return null;\n  }\n  if (lvl == null) {\n    lvl = Math.ceil(log2(zoom * pxRatio));\n  }\n  if (lvl < minLvl$1) {\n    lvl = minLvl$1;\n  } else if (zoom >= maxZoom$1 || lvl > maxLvl$1) {\n    return null;\n  }\n  var scale = Math.pow(2, lvl);\n  var eleScaledH = bb.h * scale;\n  var eleScaledW = bb.w * scale;\n  var scaledLabelShown = r.eleTextBiggerThanMin(ele, scale);\n  if (!this.isVisible(ele, scaledLabelShown)) {\n    return null;\n  }\n  var eleCache = lookup.get(ele, lvl);\n\n  // if this get was on an unused/invalidated cache, then restore the texture usage metric\n  if (eleCache && eleCache.invalidated) {\n    eleCache.invalidated = false;\n    eleCache.texture.invalidatedWidth -= eleCache.width;\n  }\n  if (eleCache) {\n    return eleCache;\n  }\n  var txrH; // which texture height this ele belongs to\n\n  if (eleScaledH <= minTxrH) {\n    txrH = minTxrH;\n  } else if (eleScaledH <= txrStepH) {\n    txrH = txrStepH;\n  } else {\n    txrH = Math.ceil(eleScaledH / txrStepH) * txrStepH;\n  }\n  if (eleScaledH > maxTxrH || eleScaledW > maxTxrW) {\n    return null; // caching large elements is not efficient\n  }\n  var txrQ = self.getTextureQueue(txrH);\n\n  // first try the second last one in case it has space at the end\n  var txr = txrQ[txrQ.length - 2];\n  var addNewTxr = function addNewTxr() {\n    return self.recycleTexture(txrH, eleScaledW) || self.addTexture(txrH, eleScaledW);\n  };\n\n  // try the last one if there is no second last one\n  if (!txr) {\n    txr = txrQ[txrQ.length - 1];\n  }\n\n  // if the last one doesn't exist, we need a first one\n  if (!txr) {\n    txr = addNewTxr();\n  }\n\n  // if there's no room in the current texture, we need a new one\n  if (txr.width - txr.usedWidth < eleScaledW) {\n    txr = addNewTxr();\n  }\n  var scalableFrom = function scalableFrom(otherCache) {\n    return otherCache && otherCache.scaledLabelShown === scaledLabelShown;\n  };\n  var deqing = reason && reason === getTxrReasons.dequeue;\n  var highQualityReq = reason && reason === getTxrReasons.highQuality;\n  var downscaleReq = reason && reason === getTxrReasons.downscale;\n  var higherCache; // the nearest cache with a higher level\n  for (var l = lvl + 1; l <= maxLvl$1; l++) {\n    var c = lookup.get(ele, l);\n    if (c) {\n      higherCache = c;\n      break;\n    }\n  }\n  var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null;\n  var downscale = function downscale() {\n    txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH);\n  };\n\n  // reset ele area in texture\n  txr.context.setTransform(1, 0, 0, 1, 0, 0);\n  txr.context.clearRect(txr.usedWidth, 0, eleScaledW, txrH);\n  if (scalableFrom(oneUpCache)) {\n    // then we can relatively cheaply rescale the existing image w/o rerendering\n    downscale();\n  } else if (scalableFrom(higherCache)) {\n    // then use the higher cache for now and queue the next level down\n    // to cheaply scale towards the smaller level\n\n    if (highQualityReq) {\n      for (var _l = higherCache.level; _l > lvl; _l--) {\n        oneUpCache = self.getElement(ele, bb, pxRatio, _l, getTxrReasons.downscale);\n      }\n      downscale();\n    } else {\n      self.queueElement(ele, higherCache.level - 1);\n      return higherCache;\n    }\n  } else {\n    var lowerCache; // the nearest cache with a lower level\n    if (!deqing && !highQualityReq && !downscaleReq) {\n      for (var _l2 = lvl - 1; _l2 >= minLvl$1; _l2--) {\n        var _c = lookup.get(ele, _l2);\n        if (_c) {\n          lowerCache = _c;\n          break;\n        }\n      }\n    }\n    if (scalableFrom(lowerCache)) {\n      // then use the lower quality cache for now and queue the better one for later\n\n      self.queueElement(ele, lvl);\n      return lowerCache;\n    }\n    txr.context.translate(txr.usedWidth, 0);\n    txr.context.scale(scale, scale);\n    this.drawElement(txr.context, ele, bb, scaledLabelShown, false);\n    txr.context.scale(1 / scale, 1 / scale);\n    txr.context.translate(-txr.usedWidth, 0);\n  }\n  eleCache = {\n    x: txr.usedWidth,\n    texture: txr,\n    level: lvl,\n    scale: scale,\n    width: eleScaledW,\n    height: eleScaledH,\n    scaledLabelShown: scaledLabelShown\n  };\n  txr.usedWidth += Math.ceil(eleScaledW + eleTxrSpacing);\n  txr.eleCaches.push(eleCache);\n  lookup.set(ele, lvl, eleCache);\n  self.checkTextureFullness(txr);\n  return eleCache;\n};\nETCp.invalidateElements = function (eles) {\n  for (var i = 0; i < eles.length; i++) {\n    this.invalidateElement(eles[i]);\n  }\n};\nETCp.invalidateElement = function (ele) {\n  var self = this;\n  var lookup = self.lookup;\n  var caches = [];\n  var invalid = lookup.isInvalid(ele);\n  if (!invalid) {\n    return; // override the invalidation request if the element key has not changed\n  }\n  for (var lvl = minLvl$1; lvl <= maxLvl$1; lvl++) {\n    var cache = lookup.getForCachedKey(ele, lvl);\n    if (cache) {\n      caches.push(cache);\n    }\n  }\n  var noOtherElesUseCache = lookup.invalidate(ele);\n  if (noOtherElesUseCache) {\n    for (var i = 0; i < caches.length; i++) {\n      var _cache = caches[i];\n      var txr = _cache.texture;\n\n      // remove space from the texture it belongs to\n      txr.invalidatedWidth += _cache.width;\n\n      // mark the cache as invalidated\n      _cache.invalidated = true;\n\n      // retire the texture if its utility is low\n      self.checkTextureUtility(txr);\n    }\n  }\n\n  // remove from queue since the old req was for the old state\n  self.removeFromQueue(ele);\n};\nETCp.checkTextureUtility = function (txr) {\n  // invalidate all entries in the cache if the cache size is small\n  if (txr.invalidatedWidth >= minUtility * txr.width) {\n    this.retireTexture(txr);\n  }\n};\nETCp.checkTextureFullness = function (txr) {\n  // if texture has been mostly filled and passed over several times, remove\n  // it from the queue so we don't need to waste time looking at it to put new things\n\n  var self = this;\n  var txrQ = self.getTextureQueue(txr.height);\n  if (txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks) {\n    removeFromArray(txrQ, txr);\n  } else {\n    txr.fullnessChecks++;\n  }\n};\nETCp.retireTexture = function (txr) {\n  var self = this;\n  var txrH = txr.height;\n  var txrQ = self.getTextureQueue(txrH);\n  var lookup = this.lookup;\n\n  // retire the texture from the active / searchable queue:\n\n  removeFromArray(txrQ, txr);\n  txr.retired = true;\n\n  // remove the refs from the eles to the caches:\n\n  var eleCaches = txr.eleCaches;\n  for (var i = 0; i < eleCaches.length; i++) {\n    var eleCache = eleCaches[i];\n    lookup.deleteCache(eleCache.key, eleCache.level);\n  }\n  clearArray(eleCaches);\n\n  // add the texture to a retired queue so it can be recycled in future:\n\n  var rtxtrQ = self.getRetiredTextureQueue(txrH);\n  rtxtrQ.push(txr);\n};\nETCp.addTexture = function (txrH, minW) {\n  var self = this;\n  var txrQ = self.getTextureQueue(txrH);\n  var txr = {};\n  txrQ.push(txr);\n  txr.eleCaches = [];\n  txr.height = txrH;\n  txr.width = Math.max(defTxrWidth, minW);\n  txr.usedWidth = 0;\n  txr.invalidatedWidth = 0;\n  txr.fullnessChecks = 0;\n  txr.canvas = self.renderer.makeOffscreenCanvas(txr.width, txr.height);\n  txr.context = txr.canvas.getContext('2d');\n  return txr;\n};\nETCp.recycleTexture = function (txrH, minW) {\n  var self = this;\n  var txrQ = self.getTextureQueue(txrH);\n  var rtxtrQ = self.getRetiredTextureQueue(txrH);\n  for (var i = 0; i < rtxtrQ.length; i++) {\n    var txr = rtxtrQ[i];\n    if (txr.width >= minW) {\n      txr.retired = false;\n      txr.usedWidth = 0;\n      txr.invalidatedWidth = 0;\n      txr.fullnessChecks = 0;\n      clearArray(txr.eleCaches);\n      txr.context.setTransform(1, 0, 0, 1, 0, 0);\n      txr.context.clearRect(0, 0, txr.width, txr.height);\n      removeFromArray(rtxtrQ, txr);\n      txrQ.push(txr);\n      return txr;\n    }\n  }\n};\nETCp.queueElement = function (ele, lvl) {\n  var self = this;\n  var q = self.getElementQueue();\n  var k2q = self.getElementKeyToQueue();\n  var key = this.getKey(ele);\n  var existingReq = k2q[key];\n  if (existingReq) {\n    // use the max lvl b/c in between lvls are cheap to make\n    existingReq.level = Math.max(existingReq.level, lvl);\n    existingReq.eles.merge(ele);\n    existingReq.reqs++;\n    q.updateItem(existingReq);\n  } else {\n    var req = {\n      eles: ele.spawn().merge(ele),\n      level: lvl,\n      reqs: 1,\n      key: key\n    };\n    q.push(req);\n    k2q[key] = req;\n  }\n};\nETCp.dequeue = function (pxRatio /*, extent*/) {\n  var self = this;\n  var q = self.getElementQueue();\n  var k2q = self.getElementKeyToQueue();\n  var dequeued = [];\n  var lookup = self.lookup;\n  for (var i = 0; i < maxDeqSize$1; i++) {\n    if (q.size() > 0) {\n      var req = q.pop();\n      var key = req.key;\n      var ele = req.eles[0]; // all eles have the same key\n      var cacheExists = lookup.hasCache(ele, req.level);\n\n      // clear out the key to req lookup\n      k2q[key] = null;\n\n      // dequeueing isn't necessary with an existing cache\n      if (cacheExists) {\n        continue;\n      }\n      dequeued.push(req);\n      var bb = self.getBoundingBox(ele);\n      self.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue);\n    } else {\n      break;\n    }\n  }\n  return dequeued;\n};\nETCp.removeFromQueue = function (ele) {\n  var self = this;\n  var q = self.getElementQueue();\n  var k2q = self.getElementKeyToQueue();\n  var key = this.getKey(ele);\n  var req = k2q[key];\n  if (req != null) {\n    if (req.eles.length === 1) {\n      // remove if last ele in the req\n      // bring to front of queue\n      req.reqs = MAX_INT$1;\n      q.updateItem(req);\n      q.pop(); // remove from queue\n\n      k2q[key] = null; // remove from lookup map\n    } else {\n      // otherwise just remove ele from req\n      req.eles.unmerge(ele);\n    }\n  }\n};\nETCp.onDequeue = function (fn) {\n  this.onDequeues.push(fn);\n};\nETCp.offDequeue = function (fn) {\n  removeFromArray(this.onDequeues, fn);\n};\nETCp.setupDequeueing = defs.setupDequeueing({\n  deqRedrawThreshold: deqRedrawThreshold$1,\n  deqCost: deqCost$1,\n  deqAvgCost: deqAvgCost$1,\n  deqNoDrawCost: deqNoDrawCost$1,\n  deqFastCost: deqFastCost$1,\n  deq: function deq(self, pxRatio, extent) {\n    return self.dequeue(pxRatio, extent);\n  },\n  onDeqd: function onDeqd(self, deqd) {\n    for (var i = 0; i < self.onDequeues.length; i++) {\n      var fn = self.onDequeues[i];\n      fn(deqd);\n    }\n  },\n  shouldRedraw: function shouldRedraw(self, deqd, pxRatio, extent) {\n    for (var i = 0; i < deqd.length; i++) {\n      var eles = deqd[i].eles;\n      for (var j = 0; j < eles.length; j++) {\n        var bb = eles[j].boundingBox();\n        if (boundingBoxesIntersect(bb, extent)) {\n          return true;\n        }\n      }\n    }\n    return false;\n  },\n  priority: function priority(self) {\n    return self.renderer.beforeRenderPriorities.eleTxrDeq;\n  }\n});\n\nvar defNumLayers = 1; // default number of layers to use\nvar minLvl = -4; // when scaling smaller than that we don't need to re-render\nvar maxLvl = 2; // when larger than this scale just render directly (caching is not helpful)\nvar maxZoom = 3.99; // beyond this zoom level, layered textures are not used\nvar deqRedrawThreshold = 50; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile\nvar refineEleDebounceTime = 50; // time to debounce sharper ele texture updates\nvar deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame\nvar deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time\nvar deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing\nvar deqFastCost = 0.9; // % of frame time to be used when >60fps\nvar maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch\nvar invalidThreshold = 250; // time threshold for disabling b/c of invalidations\nvar maxLayerArea = 4000 * 4000; // layers can't be bigger than this\nvar maxLayerDim = 32767; // maximum size for the width/height of layer canvases\nvar useHighQualityEleTxrReqs = true; // whether to use high quality ele txr requests (generally faster and cheaper in the longterm)\n\n// var log = function(){ console.log.apply( console, arguments ); };\n\nvar LayeredTextureCache = function LayeredTextureCache(renderer) {\n  var self = this;\n  var r = self.renderer = renderer;\n  var cy = r.cy;\n  self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ]\n\n  self.firstGet = true;\n  self.lastInvalidationTime = performanceNow() - 2 * invalidThreshold;\n  self.skipping = false;\n  self.eleTxrDeqs = cy.collection();\n  self.scheduleElementRefinement = debounce(function () {\n    self.refineElementTextures(self.eleTxrDeqs);\n    self.eleTxrDeqs.unmerge(self.eleTxrDeqs);\n  }, refineEleDebounceTime);\n  r.beforeRender(function (willDraw, now) {\n    if (now - self.lastInvalidationTime <= invalidThreshold) {\n      self.skipping = true;\n    } else {\n      self.skipping = false;\n    }\n  }, r.beforeRenderPriorities.lyrTxrSkip);\n  var qSort = function qSort(a, b) {\n    return b.reqs - a.reqs;\n  };\n  self.layersQueue = new Heap(qSort);\n  self.setupDequeueing();\n};\nvar LTCp = LayeredTextureCache.prototype;\nvar layerIdPool = 0;\nvar MAX_INT = Math.pow(2, 53) - 1;\nLTCp.makeLayer = function (bb, lvl) {\n  var scale = Math.pow(2, lvl);\n  var w = Math.ceil(bb.w * scale);\n  var h = Math.ceil(bb.h * scale);\n  var canvas = this.renderer.makeOffscreenCanvas(w, h);\n  var layer = {\n    id: layerIdPool = ++layerIdPool % MAX_INT,\n    bb: bb,\n    level: lvl,\n    width: w,\n    height: h,\n    canvas: canvas,\n    context: canvas.getContext('2d'),\n    eles: [],\n    elesQueue: [],\n    reqs: 0\n  };\n\n  // log('make layer %s with w %s and h %s and lvl %s', layer.id, layer.width, layer.height, layer.level);\n\n  var cxt = layer.context;\n  var dx = -layer.bb.x1;\n  var dy = -layer.bb.y1;\n\n  // do the transform on creation to save cycles (it's the same for all eles)\n  cxt.scale(scale, scale);\n  cxt.translate(dx, dy);\n  return layer;\n};\nLTCp.getLayers = function (eles, pxRatio, lvl) {\n  var self = this;\n  var r = self.renderer;\n  var cy = r.cy;\n  var zoom = cy.zoom();\n  var firstGet = self.firstGet;\n  self.firstGet = false;\n\n  // log('--\\nget layers with %s eles', eles.length);\n  //log eles.map(function(ele){ return ele.id() }) );\n\n  if (lvl == null) {\n    lvl = Math.ceil(log2(zoom * pxRatio));\n    if (lvl < minLvl) {\n      lvl = minLvl;\n    } else if (zoom >= maxZoom || lvl > maxLvl) {\n      return null;\n    }\n  }\n  self.validateLayersElesOrdering(lvl, eles);\n  var layersByLvl = self.layersByLevel;\n  var scale = Math.pow(2, lvl);\n  var layers = layersByLvl[lvl] = layersByLvl[lvl] || [];\n  var bb;\n  var lvlComplete = self.levelIsComplete(lvl, eles);\n  var tmpLayers;\n  var checkTempLevels = function checkTempLevels() {\n    var canUseAsTmpLvl = function canUseAsTmpLvl(l) {\n      self.validateLayersElesOrdering(l, eles);\n      if (self.levelIsComplete(l, eles)) {\n        tmpLayers = layersByLvl[l];\n        return true;\n      }\n    };\n    var checkLvls = function checkLvls(dir) {\n      if (tmpLayers) {\n        return;\n      }\n      for (var l = lvl + dir; minLvl <= l && l <= maxLvl; l += dir) {\n        if (canUseAsTmpLvl(l)) {\n          break;\n        }\n      }\n    };\n    checkLvls(1);\n    checkLvls(-1);\n\n    // remove the invalid layers; they will be replaced as needed later in this function\n    for (var i = layers.length - 1; i >= 0; i--) {\n      var layer = layers[i];\n      if (layer.invalid) {\n        removeFromArray(layers, layer);\n      }\n    }\n  };\n  if (!lvlComplete) {\n    // if the current level is incomplete, then use the closest, best quality layerset temporarily\n    // and later queue the current layerset so we can get the proper quality level soon\n\n    checkTempLevels();\n  } else {\n    // log('level complete, using existing layers\\n--');\n    return layers;\n  }\n  var getBb = function getBb() {\n    if (!bb) {\n      bb = makeBoundingBox();\n      for (var i = 0; i < eles.length; i++) {\n        updateBoundingBox(bb, eles[i].boundingBox());\n      }\n    }\n    return bb;\n  };\n  var makeLayer = function makeLayer(opts) {\n    opts = opts || {};\n    var after = opts.after;\n    getBb();\n    var w = Math.ceil(bb.w * scale);\n    var h = Math.ceil(bb.h * scale);\n    if (w > maxLayerDim || h > maxLayerDim) {\n      return null;\n    }\n    var area = w * h;\n    if (area > maxLayerArea) {\n      return null;\n    }\n    var layer = self.makeLayer(bb, lvl);\n    if (after != null) {\n      var index = layers.indexOf(after) + 1;\n      layers.splice(index, 0, layer);\n    } else if (opts.insert === undefined || opts.insert) {\n      // no after specified => first layer made so put at start\n      layers.unshift(layer);\n    }\n\n    // if( tmpLayers ){\n    //self.queueLayer( layer );\n    // }\n\n    return layer;\n  };\n  if (self.skipping && !firstGet) {\n    // log('skip layers');\n    return null;\n  }\n\n  // log('do layers');\n\n  var layer = null;\n  var maxElesPerLayer = eles.length / defNumLayers;\n  var allowLazyQueueing = !firstGet;\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    var rs = ele._private.rscratch;\n    var caches = rs.imgLayerCaches = rs.imgLayerCaches || {};\n\n    // log('look at ele', ele.id());\n\n    var existingLayer = caches[lvl];\n    if (existingLayer) {\n      // reuse layer for later eles\n      // log('reuse layer for', ele.id());\n      layer = existingLayer;\n      continue;\n    }\n    if (!layer || layer.eles.length >= maxElesPerLayer || !boundingBoxInBoundingBox(layer.bb, ele.boundingBox())) {\n      // log('make new layer for ele %s', ele.id());\n\n      layer = makeLayer({\n        insert: true,\n        after: layer\n      });\n\n      // if now layer can be built then we can't use layers at this level\n      if (!layer) {\n        return null;\n      }\n\n      // log('new layer with id %s', layer.id);\n    }\n    if (tmpLayers || allowLazyQueueing) {\n      // log('queue ele %s in layer %s', ele.id(), layer.id);\n      self.queueLayer(layer, ele);\n    } else {\n      // log('draw ele %s in layer %s', ele.id(), layer.id);\n      self.drawEleInLayer(layer, ele, lvl, pxRatio);\n    }\n    layer.eles.push(ele);\n    caches[lvl] = layer;\n  }\n\n  // log('--');\n\n  if (tmpLayers) {\n    // then we only queued the current layerset and can't draw it yet\n    return tmpLayers;\n  }\n  if (allowLazyQueueing) {\n    // log('lazy queue level', lvl);\n    return null;\n  }\n  return layers;\n};\n\n// a layer may want to use an ele cache of a higher level to avoid blurriness\n// so the layer level might not equal the ele level\nLTCp.getEleLevelForLayerLevel = function (lvl, pxRatio) {\n  return lvl;\n};\nLTCp.drawEleInLayer = function (layer, ele, lvl, pxRatio) {\n  var self = this;\n  var r = this.renderer;\n  var context = layer.context;\n  var bb = ele.boundingBox();\n  if (bb.w === 0 || bb.h === 0 || !ele.visible()) {\n    return;\n  }\n  lvl = self.getEleLevelForLayerLevel(lvl, pxRatio);\n  {\n    r.setImgSmoothing(context, false);\n  }\n  {\n    r.drawCachedElement(context, ele, null, null, lvl, useHighQualityEleTxrReqs);\n  }\n  {\n    r.setImgSmoothing(context, true);\n  }\n};\nLTCp.levelIsComplete = function (lvl, eles) {\n  var self = this;\n  var layers = self.layersByLevel[lvl];\n  if (!layers || layers.length === 0) {\n    return false;\n  }\n  var numElesInLayers = 0;\n  for (var i = 0; i < layers.length; i++) {\n    var layer = layers[i];\n\n    // if there are any eles needed to be drawn yet, the level is not complete\n    if (layer.reqs > 0) {\n      return false;\n    }\n\n    // if the layer is invalid, the level is not complete\n    if (layer.invalid) {\n      return false;\n    }\n    numElesInLayers += layer.eles.length;\n  }\n\n  // we should have exactly the number of eles passed in to be complete\n  if (numElesInLayers !== eles.length) {\n    return false;\n  }\n  return true;\n};\nLTCp.validateLayersElesOrdering = function (lvl, eles) {\n  var layers = this.layersByLevel[lvl];\n  if (!layers) {\n    return;\n  }\n\n  // if in a layer the eles are not in the same order, then the layer is invalid\n  // (i.e. there is an ele in between the eles in the layer)\n\n  for (var i = 0; i < layers.length; i++) {\n    var layer = layers[i];\n    var offset = -1;\n\n    // find the offset\n    for (var j = 0; j < eles.length; j++) {\n      if (layer.eles[0] === eles[j]) {\n        offset = j;\n        break;\n      }\n    }\n    if (offset < 0) {\n      // then the layer has nonexistent elements and is invalid\n      this.invalidateLayer(layer);\n      continue;\n    }\n\n    // the eles in the layer must be in the same continuous order, else the layer is invalid\n\n    var o = offset;\n    for (var j = 0; j < layer.eles.length; j++) {\n      if (layer.eles[j] !== eles[o + j]) {\n        // log('invalidate based on ordering', layer.id);\n\n        this.invalidateLayer(layer);\n        break;\n      }\n    }\n  }\n};\nLTCp.updateElementsInLayers = function (eles, update) {\n  var self = this;\n  var isEles = element(eles[0]);\n\n  // collect udpated elements (cascaded from the layers) and update each\n  // layer itself along the way\n  for (var i = 0; i < eles.length; i++) {\n    var req = isEles ? null : eles[i];\n    var ele = isEles ? eles[i] : eles[i].ele;\n    var rs = ele._private.rscratch;\n    var caches = rs.imgLayerCaches = rs.imgLayerCaches || {};\n    for (var l = minLvl; l <= maxLvl; l++) {\n      var layer = caches[l];\n      if (!layer) {\n        continue;\n      }\n\n      // if update is a request from the ele cache, then it affects only\n      // the matching level\n      if (req && self.getEleLevelForLayerLevel(layer.level) !== req.level) {\n        continue;\n      }\n      update(layer, ele, req);\n    }\n  }\n};\nLTCp.haveLayers = function () {\n  var self = this;\n  var haveLayers = false;\n  for (var l = minLvl; l <= maxLvl; l++) {\n    var layers = self.layersByLevel[l];\n    if (layers && layers.length > 0) {\n      haveLayers = true;\n      break;\n    }\n  }\n  return haveLayers;\n};\nLTCp.invalidateElements = function (eles) {\n  var self = this;\n  if (eles.length === 0) {\n    return;\n  }\n  self.lastInvalidationTime = performanceNow();\n\n  // log('update invalidate layer time from eles');\n\n  if (eles.length === 0 || !self.haveLayers()) {\n    return;\n  }\n  self.updateElementsInLayers(eles, function invalAssocLayers(layer, ele, req) {\n    self.invalidateLayer(layer);\n  });\n};\nLTCp.invalidateLayer = function (layer) {\n  // log('update invalidate layer time');\n\n  this.lastInvalidationTime = performanceNow();\n  if (layer.invalid) {\n    return;\n  } // save cycles\n\n  var lvl = layer.level;\n  var eles = layer.eles;\n  var layers = this.layersByLevel[lvl];\n\n  // log('invalidate layer', layer.id );\n\n  removeFromArray(layers, layer);\n  // layer.eles = [];\n\n  layer.elesQueue = [];\n  layer.invalid = true;\n  if (layer.replacement) {\n    layer.replacement.invalid = true;\n  }\n  for (var i = 0; i < eles.length; i++) {\n    var caches = eles[i]._private.rscratch.imgLayerCaches;\n    if (caches) {\n      caches[lvl] = null;\n    }\n  }\n};\nLTCp.refineElementTextures = function (eles) {\n  var self = this;\n\n  // log('refine', eles.length);\n\n  self.updateElementsInLayers(eles, function refineEachEle(layer, ele, req) {\n    var rLyr = layer.replacement;\n    if (!rLyr) {\n      rLyr = layer.replacement = self.makeLayer(layer.bb, layer.level);\n      rLyr.replaces = layer;\n      rLyr.eles = layer.eles;\n\n      // log('make replacement layer %s for %s with level %s', rLyr.id, layer.id, rLyr.level);\n    }\n    if (!rLyr.reqs) {\n      for (var i = 0; i < rLyr.eles.length; i++) {\n        self.queueLayer(rLyr, rLyr.eles[i]);\n      }\n\n      // log('queue replacement layer refinement', rLyr.id);\n    }\n  });\n};\nLTCp.enqueueElementRefinement = function (ele) {\n  this.eleTxrDeqs.merge(ele);\n  this.scheduleElementRefinement();\n};\nLTCp.queueLayer = function (layer, ele) {\n  var self = this;\n  var q = self.layersQueue;\n  var elesQ = layer.elesQueue;\n  var hasId = elesQ.hasId = elesQ.hasId || {};\n\n  // if a layer is going to be replaced, queuing is a waste of time\n  if (layer.replacement) {\n    return;\n  }\n  if (ele) {\n    if (hasId[ele.id()]) {\n      return;\n    }\n    elesQ.push(ele);\n    hasId[ele.id()] = true;\n  }\n  if (layer.reqs) {\n    layer.reqs++;\n    q.updateItem(layer);\n  } else {\n    layer.reqs = 1;\n    q.push(layer);\n  }\n};\nLTCp.dequeue = function (pxRatio) {\n  var self = this;\n  var q = self.layersQueue;\n  var deqd = [];\n  var eleDeqs = 0;\n  while (eleDeqs < maxDeqSize) {\n    if (q.size() === 0) {\n      break;\n    }\n    var layer = q.peek();\n\n    // if a layer has been or will be replaced, then don't waste time with it\n    if (layer.replacement) {\n      // log('layer %s in queue skipped b/c it already has a replacement', layer.id);\n      q.pop();\n      continue;\n    }\n\n    // if this is a replacement layer that has been superceded, then forget it\n    if (layer.replaces && layer !== layer.replaces.replacement) {\n      // log('layer is no longer the most uptodate replacement; dequeued', layer.id)\n      q.pop();\n      continue;\n    }\n    if (layer.invalid) {\n      // log('replacement layer %s is invalid; dequeued', layer.id);\n      q.pop();\n      continue;\n    }\n    var ele = layer.elesQueue.shift();\n    if (ele) {\n      // log('dequeue layer %s', layer.id);\n\n      self.drawEleInLayer(layer, ele, layer.level, pxRatio);\n      eleDeqs++;\n    }\n    if (deqd.length === 0) {\n      // we need only one entry in deqd to queue redrawing etc\n      deqd.push(true);\n    }\n\n    // if the layer has all its eles done, then remove from the queue\n    if (layer.elesQueue.length === 0) {\n      q.pop();\n      layer.reqs = 0;\n\n      // log('dequeue of layer %s complete', layer.id);\n\n      // when a replacement layer is dequeued, it replaces the old layer in the level\n      if (layer.replaces) {\n        self.applyLayerReplacement(layer);\n      }\n      self.requestRedraw();\n    }\n  }\n  return deqd;\n};\nLTCp.applyLayerReplacement = function (layer) {\n  var self = this;\n  var layersInLevel = self.layersByLevel[layer.level];\n  var replaced = layer.replaces;\n  var index = layersInLevel.indexOf(replaced);\n\n  // if the replaced layer is not in the active list for the level, then replacing\n  // refs would be a mistake (i.e. overwriting the true active layer)\n  if (index < 0 || replaced.invalid) {\n    // log('replacement layer would have no effect', layer.id);\n    return;\n  }\n  layersInLevel[index] = layer; // replace level ref\n\n  // replace refs in eles\n  for (var i = 0; i < layer.eles.length; i++) {\n    var _p = layer.eles[i]._private;\n    var cache = _p.imgLayerCaches = _p.imgLayerCaches || {};\n    if (cache) {\n      cache[layer.level] = layer;\n    }\n  }\n\n  // log('apply replacement layer %s over %s', layer.id, replaced.id);\n\n  self.requestRedraw();\n};\nLTCp.requestRedraw = debounce(function () {\n  var r = this.renderer;\n  r.redrawHint('eles', true);\n  r.redrawHint('drag', true);\n  r.redraw();\n}, 100);\nLTCp.setupDequeueing = defs.setupDequeueing({\n  deqRedrawThreshold: deqRedrawThreshold,\n  deqCost: deqCost,\n  deqAvgCost: deqAvgCost,\n  deqNoDrawCost: deqNoDrawCost,\n  deqFastCost: deqFastCost,\n  deq: function deq(self, pxRatio) {\n    return self.dequeue(pxRatio);\n  },\n  onDeqd: noop$1,\n  shouldRedraw: trueify,\n  priority: function priority(self) {\n    return self.renderer.beforeRenderPriorities.lyrTxrDeq;\n  }\n});\n\nvar CRp$b = {};\nvar impl;\nfunction polygon(context, points) {\n  for (var i = 0; i < points.length; i++) {\n    var pt = points[i];\n    context.lineTo(pt.x, pt.y);\n  }\n}\nfunction triangleBackcurve(context, points, controlPoint) {\n  var firstPt;\n  for (var i = 0; i < points.length; i++) {\n    var pt = points[i];\n    if (i === 0) {\n      firstPt = pt;\n    }\n    context.lineTo(pt.x, pt.y);\n  }\n  context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y);\n}\nfunction triangleTee(context, trianglePoints, teePoints) {\n  if (context.beginPath) {\n    context.beginPath();\n  }\n  var triPts = trianglePoints;\n  for (var i = 0; i < triPts.length; i++) {\n    var pt = triPts[i];\n    context.lineTo(pt.x, pt.y);\n  }\n  var teePts = teePoints;\n  var firstTeePt = teePoints[0];\n  context.moveTo(firstTeePt.x, firstTeePt.y);\n  for (var i = 1; i < teePts.length; i++) {\n    var pt = teePts[i];\n    context.lineTo(pt.x, pt.y);\n  }\n  if (context.closePath) {\n    context.closePath();\n  }\n}\nfunction circleTriangle(context, trianglePoints, rx, ry, r) {\n  if (context.beginPath) {\n    context.beginPath();\n  }\n  context.arc(rx, ry, r, 0, Math.PI * 2, false);\n  var triPts = trianglePoints;\n  var firstTrPt = triPts[0];\n  context.moveTo(firstTrPt.x, firstTrPt.y);\n  for (var i = 0; i < triPts.length; i++) {\n    var pt = triPts[i];\n    context.lineTo(pt.x, pt.y);\n  }\n  if (context.closePath) {\n    context.closePath();\n  }\n}\nfunction circle$1(context, rx, ry, r) {\n  context.arc(rx, ry, r, 0, Math.PI * 2, false);\n}\nCRp$b.arrowShapeImpl = function (name) {\n  return (impl || (impl = {\n    'polygon': polygon,\n    'triangle-backcurve': triangleBackcurve,\n    'triangle-tee': triangleTee,\n    'circle-triangle': circleTriangle,\n    'triangle-cross': triangleTee,\n    'circle': circle$1\n  }))[name];\n};\n\nvar CRp$a = {};\nCRp$a.drawElement = function (context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity) {\n  var r = this;\n  if (ele.isNode()) {\n    r.drawNode(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity);\n  } else {\n    r.drawEdge(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity);\n  }\n};\nCRp$a.drawElementOverlay = function (context, ele) {\n  var r = this;\n  if (ele.isNode()) {\n    r.drawNodeOverlay(context, ele);\n  } else {\n    r.drawEdgeOverlay(context, ele);\n  }\n};\nCRp$a.drawElementUnderlay = function (context, ele) {\n  var r = this;\n  if (ele.isNode()) {\n    r.drawNodeUnderlay(context, ele);\n  } else {\n    r.drawEdgeUnderlay(context, ele);\n  }\n};\nCRp$a.drawCachedElementPortion = function (context, ele, eleTxrCache, pxRatio, lvl, reason, getRotation, getOpacity) {\n  var r = this;\n  var bb = eleTxrCache.getBoundingBox(ele);\n  if (bb.w === 0 || bb.h === 0) {\n    return;\n  } // ignore zero size case\n\n  var eleCache = eleTxrCache.getElement(ele, bb, pxRatio, lvl, reason);\n  if (eleCache != null) {\n    var opacity = getOpacity(r, ele);\n    if (opacity === 0) {\n      return;\n    }\n    var theta = getRotation(r, ele);\n    var x1 = bb.x1,\n      y1 = bb.y1,\n      w = bb.w,\n      h = bb.h;\n    var x, y, sx, sy, smooth;\n    if (theta !== 0) {\n      var rotPt = eleTxrCache.getRotationPoint(ele);\n      sx = rotPt.x;\n      sy = rotPt.y;\n      context.translate(sx, sy);\n      context.rotate(theta);\n      smooth = r.getImgSmoothing(context);\n      if (!smooth) {\n        r.setImgSmoothing(context, true);\n      }\n      var off = eleTxrCache.getRotationOffset(ele);\n      x = off.x;\n      y = off.y;\n    } else {\n      x = x1;\n      y = y1;\n    }\n    var oldGlobalAlpha;\n    if (opacity !== 1) {\n      oldGlobalAlpha = context.globalAlpha;\n      context.globalAlpha = oldGlobalAlpha * opacity;\n    }\n    context.drawImage(eleCache.texture.canvas, eleCache.x, 0, eleCache.width, eleCache.height, x, y, w, h);\n    if (opacity !== 1) {\n      context.globalAlpha = oldGlobalAlpha;\n    }\n    if (theta !== 0) {\n      context.rotate(-theta);\n      context.translate(-sx, -sy);\n      if (!smooth) {\n        r.setImgSmoothing(context, false);\n      }\n    }\n  } else {\n    eleTxrCache.drawElement(context, ele); // direct draw fallback\n  }\n};\nvar getZeroRotation = function getZeroRotation() {\n  return 0;\n};\nvar getLabelRotation = function getLabelRotation(r, ele) {\n  return r.getTextAngle(ele, null);\n};\nvar getSourceLabelRotation = function getSourceLabelRotation(r, ele) {\n  return r.getTextAngle(ele, 'source');\n};\nvar getTargetLabelRotation = function getTargetLabelRotation(r, ele) {\n  return r.getTextAngle(ele, 'target');\n};\nvar getOpacity = function getOpacity(r, ele) {\n  return ele.effectiveOpacity();\n};\nvar getTextOpacity = function getTextOpacity(e, ele) {\n  return ele.pstyle('text-opacity').pfValue * ele.effectiveOpacity();\n};\nCRp$a.drawCachedElement = function (context, ele, pxRatio, extent, lvl, requestHighQuality) {\n  var r = this;\n  var _r$data = r.data,\n    eleTxrCache = _r$data.eleTxrCache,\n    lblTxrCache = _r$data.lblTxrCache,\n    slbTxrCache = _r$data.slbTxrCache,\n    tlbTxrCache = _r$data.tlbTxrCache;\n  var bb = ele.boundingBox();\n  var reason = requestHighQuality === true ? eleTxrCache.reasons.highQuality : null;\n  if (bb.w === 0 || bb.h === 0 || !ele.visible()) {\n    return;\n  }\n  if (!extent || boundingBoxesIntersect(bb, extent)) {\n    var isEdge = ele.isEdge();\n    var badLine = ele.element()._private.rscratch.badLine;\n    r.drawElementUnderlay(context, ele);\n    r.drawCachedElementPortion(context, ele, eleTxrCache, pxRatio, lvl, reason, getZeroRotation, getOpacity);\n    if (!isEdge || !badLine) {\n      r.drawCachedElementPortion(context, ele, lblTxrCache, pxRatio, lvl, reason, getLabelRotation, getTextOpacity);\n    }\n    if (isEdge && !badLine) {\n      r.drawCachedElementPortion(context, ele, slbTxrCache, pxRatio, lvl, reason, getSourceLabelRotation, getTextOpacity);\n      r.drawCachedElementPortion(context, ele, tlbTxrCache, pxRatio, lvl, reason, getTargetLabelRotation, getTextOpacity);\n    }\n    r.drawElementOverlay(context, ele);\n  }\n};\nCRp$a.drawElements = function (context, eles) {\n  var r = this;\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    r.drawElement(context, ele);\n  }\n};\nCRp$a.drawCachedElements = function (context, eles, pxRatio, extent) {\n  var r = this;\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    r.drawCachedElement(context, ele, pxRatio, extent);\n  }\n};\nCRp$a.drawCachedNodes = function (context, eles, pxRatio, extent) {\n  var r = this;\n  for (var i = 0; i < eles.length; i++) {\n    var ele = eles[i];\n    if (!ele.isNode()) {\n      continue;\n    }\n    r.drawCachedElement(context, ele, pxRatio, extent);\n  }\n};\nCRp$a.drawLayeredElements = function (context, eles, pxRatio, extent) {\n  var r = this;\n  var layers = r.data.lyrTxrCache.getLayers(eles, pxRatio);\n  if (layers) {\n    for (var i = 0; i < layers.length; i++) {\n      var layer = layers[i];\n      var bb = layer.bb;\n      if (bb.w === 0 || bb.h === 0) {\n        continue;\n      }\n      context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h);\n    }\n  } else {\n    // fall back on plain caching if no layers\n    r.drawCachedElements(context, eles, pxRatio, extent);\n  }\n};\n\nvar CRp$9 = {};\nCRp$9.drawEdge = function (context, edge, shiftToOriginWithBb) {\n  var drawLabel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n  var shouldDrawOverlay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n  var shouldDrawOpacity = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n  var r = this;\n  var rs = edge._private.rscratch;\n  if (shouldDrawOpacity && !edge.visible()) {\n    return;\n  }\n\n  // if bezier ctrl pts can not be calculated, then die\n  if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) {\n    // isNaN in case edge is impossible and browser bugs (e.g. safari)\n    return;\n  }\n  var bb;\n  if (shiftToOriginWithBb) {\n    bb = shiftToOriginWithBb;\n    context.translate(-bb.x1, -bb.y1);\n  }\n  var opacity = shouldDrawOpacity ? edge.pstyle('opacity').value : 1;\n  var lineOpacity = shouldDrawOpacity ? edge.pstyle('line-opacity').value : 1;\n  var curveStyle = edge.pstyle('curve-style').value;\n  var lineStyle = edge.pstyle('line-style').value;\n  var edgeWidth = edge.pstyle('width').pfValue;\n  var lineCap = edge.pstyle('line-cap').value;\n  var lineOutlineWidth = edge.pstyle('line-outline-width').value;\n  var lineOutlineColor = edge.pstyle('line-outline-color').value;\n  var effectiveLineOpacity = opacity * lineOpacity;\n  // separate arrow opacity would require arrow-opacity property\n  var effectiveArrowOpacity = opacity * lineOpacity;\n  var drawLine = function drawLine() {\n    var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : effectiveLineOpacity;\n    if (curveStyle === 'straight-triangle') {\n      r.eleStrokeStyle(context, edge, strokeOpacity);\n      r.drawEdgeTrianglePath(edge, context, rs.allpts);\n    } else {\n      context.lineWidth = edgeWidth;\n      context.lineCap = lineCap;\n      r.eleStrokeStyle(context, edge, strokeOpacity);\n      r.drawEdgePath(edge, context, rs.allpts, lineStyle);\n      context.lineCap = 'butt'; // reset for other drawing functions\n    }\n  };\n  var drawLineOutline = function drawLineOutline() {\n    var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : effectiveLineOpacity;\n    context.lineWidth = edgeWidth + lineOutlineWidth;\n    context.lineCap = lineCap;\n    if (lineOutlineWidth > 0) {\n      r.colorStrokeStyle(context, lineOutlineColor[0], lineOutlineColor[1], lineOutlineColor[2], strokeOpacity);\n    } else {\n      // do not draw any lineOutline\n      context.lineCap = 'butt'; // reset for other drawing functions\n      return;\n    }\n    if (curveStyle === 'straight-triangle') {\n      r.drawEdgeTrianglePath(edge, context, rs.allpts);\n    } else {\n      r.drawEdgePath(edge, context, rs.allpts, lineStyle);\n      context.lineCap = 'butt'; // reset for other drawing functions\n    }\n  };\n  var drawOverlay = function drawOverlay() {\n    if (!shouldDrawOverlay) {\n      return;\n    }\n    r.drawEdgeOverlay(context, edge);\n  };\n  var drawUnderlay = function drawUnderlay() {\n    if (!shouldDrawOverlay) {\n      return;\n    }\n    r.drawEdgeUnderlay(context, edge);\n  };\n  var drawArrows = function drawArrows() {\n    var arrowOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : effectiveArrowOpacity;\n    r.drawArrowheads(context, edge, arrowOpacity);\n  };\n  var drawText = function drawText() {\n    r.drawElementText(context, edge, null, drawLabel);\n  };\n  context.lineJoin = 'round';\n  var ghost = edge.pstyle('ghost').value === 'yes';\n  if (ghost) {\n    var gx = edge.pstyle('ghost-offset-x').pfValue;\n    var gy = edge.pstyle('ghost-offset-y').pfValue;\n    var ghostOpacity = edge.pstyle('ghost-opacity').value;\n    var effectiveGhostOpacity = effectiveLineOpacity * ghostOpacity;\n    context.translate(gx, gy);\n    drawLine(effectiveGhostOpacity);\n    drawArrows(effectiveGhostOpacity);\n    context.translate(-gx, -gy);\n  } else {\n    drawLineOutline();\n  }\n  drawUnderlay();\n  drawLine();\n  drawArrows();\n  drawOverlay();\n  drawText();\n  if (shiftToOriginWithBb) {\n    context.translate(bb.x1, bb.y1);\n  }\n};\nvar drawEdgeOverlayUnderlay = function drawEdgeOverlayUnderlay(overlayOrUnderlay) {\n  if (!['overlay', 'underlay'].includes(overlayOrUnderlay)) {\n    throw new Error('Invalid state');\n  }\n  return function (context, edge) {\n    if (!edge.visible()) {\n      return;\n    }\n    var opacity = edge.pstyle(\"\".concat(overlayOrUnderlay, \"-opacity\")).value;\n    if (opacity === 0) {\n      return;\n    }\n    var r = this;\n    var usePaths = r.usePaths();\n    var rs = edge._private.rscratch;\n    var padding = edge.pstyle(\"\".concat(overlayOrUnderlay, \"-padding\")).pfValue;\n    var width = 2 * padding;\n    var color = edge.pstyle(\"\".concat(overlayOrUnderlay, \"-color\")).value;\n    context.lineWidth = width;\n    if (rs.edgeType === 'self' && !usePaths) {\n      context.lineCap = 'butt';\n    } else {\n      context.lineCap = 'round';\n    }\n    r.colorStrokeStyle(context, color[0], color[1], color[2], opacity);\n    r.drawEdgePath(edge, context, rs.allpts, 'solid');\n  };\n};\nCRp$9.drawEdgeOverlay = drawEdgeOverlayUnderlay('overlay');\nCRp$9.drawEdgeUnderlay = drawEdgeOverlayUnderlay('underlay');\nCRp$9.drawEdgePath = function (edge, context, pts, type) {\n  var rs = edge._private.rscratch;\n  var canvasCxt = context;\n  var path;\n  var pathCacheHit = false;\n  var usePaths = this.usePaths();\n  var lineDashPattern = edge.pstyle('line-dash-pattern').pfValue;\n  var lineDashOffset = edge.pstyle('line-dash-offset').pfValue;\n  if (usePaths) {\n    var pathCacheKey = pts.join('$');\n    var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey;\n    if (keyMatches) {\n      path = context = rs.pathCache;\n      pathCacheHit = true;\n    } else {\n      path = context = new Path2D();\n      rs.pathCacheKey = pathCacheKey;\n      rs.pathCache = path;\n    }\n  }\n  if (canvasCxt.setLineDash) {\n    // for very outofdate browsers\n    switch (type) {\n      case 'dotted':\n        canvasCxt.setLineDash([1, 1]);\n        break;\n      case 'dashed':\n        canvasCxt.setLineDash(lineDashPattern);\n        canvasCxt.lineDashOffset = lineDashOffset;\n        break;\n      case 'solid':\n        canvasCxt.setLineDash([]);\n        break;\n    }\n  }\n  if (!pathCacheHit && !rs.badLine) {\n    if (context.beginPath) {\n      context.beginPath();\n    }\n    context.moveTo(pts[0], pts[1]);\n    switch (rs.edgeType) {\n      case 'bezier':\n      case 'self':\n      case 'compound':\n      case 'multibezier':\n        for (var i = 2; i + 3 < pts.length; i += 4) {\n          context.quadraticCurveTo(pts[i], pts[i + 1], pts[i + 2], pts[i + 3]);\n        }\n        break;\n      case 'straight':\n      case 'haystack':\n        for (var _i = 2; _i + 1 < pts.length; _i += 2) {\n          context.lineTo(pts[_i], pts[_i + 1]);\n        }\n        break;\n      case 'segments':\n        if (rs.isRound) {\n          var _iterator = _createForOfIteratorHelper(rs.roundCorners),\n            _step;\n          try {\n            for (_iterator.s(); !(_step = _iterator.n()).done;) {\n              var corner = _step.value;\n              drawPreparedRoundCorner(context, corner);\n            }\n          } catch (err) {\n            _iterator.e(err);\n          } finally {\n            _iterator.f();\n          }\n          context.lineTo(pts[pts.length - 2], pts[pts.length - 1]);\n        } else {\n          for (var _i2 = 2; _i2 + 1 < pts.length; _i2 += 2) {\n            context.lineTo(pts[_i2], pts[_i2 + 1]);\n          }\n        }\n        break;\n    }\n  }\n  context = canvasCxt;\n  if (usePaths) {\n    context.stroke(path);\n  } else {\n    context.stroke();\n  }\n\n  // reset any line dashes\n  if (context.setLineDash) {\n    // for very outofdate browsers\n    context.setLineDash([]);\n  }\n};\nCRp$9.drawEdgeTrianglePath = function (edge, context, pts) {\n  // use line stroke style for triangle fill style\n  context.fillStyle = context.strokeStyle;\n  var edgeWidth = edge.pstyle('width').pfValue;\n  for (var i = 0; i + 1 < pts.length; i += 2) {\n    var vector = [pts[i + 2] - pts[i], pts[i + 3] - pts[i + 1]];\n    var length = Math.sqrt(vector[0] * vector[0] + vector[1] * vector[1]);\n    var normal = [vector[1] / length, -vector[0] / length];\n    var triangleHead = [normal[0] * edgeWidth / 2, normal[1] * edgeWidth / 2];\n    context.beginPath();\n    context.moveTo(pts[i] - triangleHead[0], pts[i + 1] - triangleHead[1]);\n    context.lineTo(pts[i] + triangleHead[0], pts[i + 1] + triangleHead[1]);\n    context.lineTo(pts[i + 2], pts[i + 3]);\n    context.closePath();\n    context.fill();\n  }\n};\nCRp$9.drawArrowheads = function (context, edge, opacity) {\n  var rs = edge._private.rscratch;\n  var isHaystack = rs.edgeType === 'haystack';\n  if (!isHaystack) {\n    this.drawArrowhead(context, edge, 'source', rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity);\n  }\n  this.drawArrowhead(context, edge, 'mid-target', rs.midX, rs.midY, rs.midtgtArrowAngle, opacity);\n  this.drawArrowhead(context, edge, 'mid-source', rs.midX, rs.midY, rs.midsrcArrowAngle, opacity);\n  if (!isHaystack) {\n    this.drawArrowhead(context, edge, 'target', rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity);\n  }\n};\nCRp$9.drawArrowhead = function (context, edge, prefix, x, y, angle, opacity) {\n  if (isNaN(x) || x == null || isNaN(y) || y == null || isNaN(angle) || angle == null) {\n    return;\n  }\n  var self = this;\n  var arrowShape = edge.pstyle(prefix + '-arrow-shape').value;\n  if (arrowShape === 'none') {\n    return;\n  }\n  var arrowClearFill = edge.pstyle(prefix + '-arrow-fill').value === 'hollow' ? 'both' : 'filled';\n  var arrowFill = edge.pstyle(prefix + '-arrow-fill').value;\n  var edgeWidth = edge.pstyle('width').pfValue;\n  var pArrowWidth = edge.pstyle(prefix + '-arrow-width');\n  var arrowWidth = pArrowWidth.value === 'match-line' ? edgeWidth : pArrowWidth.pfValue;\n  if (pArrowWidth.units === '%') arrowWidth *= edgeWidth;\n  var edgeOpacity = edge.pstyle('opacity').value;\n  if (opacity === undefined) {\n    opacity = edgeOpacity;\n  }\n  var gco = context.globalCompositeOperation;\n  if (opacity !== 1 || arrowFill === 'hollow') {\n    // then extra clear is needed\n    context.globalCompositeOperation = 'destination-out';\n    self.colorFillStyle(context, 255, 255, 255, 1);\n    self.colorStrokeStyle(context, 255, 255, 255, 1);\n    self.drawArrowShape(edge, context, arrowClearFill, edgeWidth, arrowShape, arrowWidth, x, y, angle);\n    context.globalCompositeOperation = gco;\n  } // otherwise, the opaque arrow clears it for free :)\n\n  var color = edge.pstyle(prefix + '-arrow-color').value;\n  self.colorFillStyle(context, color[0], color[1], color[2], opacity);\n  self.colorStrokeStyle(context, color[0], color[1], color[2], opacity);\n  self.drawArrowShape(edge, context, arrowFill, edgeWidth, arrowShape, arrowWidth, x, y, angle);\n};\nCRp$9.drawArrowShape = function (edge, context, fill, edgeWidth, shape, shapeWidth, x, y, angle) {\n  var r = this;\n  var usePaths = this.usePaths() && shape !== 'triangle-cross';\n  var pathCacheHit = false;\n  var path;\n  var canvasContext = context;\n  var translation = {\n    x: x,\n    y: y\n  };\n  var scale = edge.pstyle('arrow-scale').value;\n  var size = this.getArrowWidth(edgeWidth, scale);\n  var shapeImpl = r.arrowShapes[shape];\n  if (usePaths) {\n    var cache = r.arrowPathCache = r.arrowPathCache || [];\n    var key = hashString(shape);\n    var cachedPath = cache[key];\n    if (cachedPath != null) {\n      path = context = cachedPath;\n      pathCacheHit = true;\n    } else {\n      path = context = new Path2D();\n      cache[key] = path;\n    }\n  }\n  if (!pathCacheHit) {\n    if (context.beginPath) {\n      context.beginPath();\n    }\n    if (usePaths) {\n      // store in the path cache with values easily manipulated later\n      shapeImpl.draw(context, 1, 0, {\n        x: 0,\n        y: 0\n      }, 1);\n    } else {\n      shapeImpl.draw(context, size, angle, translation, edgeWidth);\n    }\n    if (context.closePath) {\n      context.closePath();\n    }\n  }\n  context = canvasContext;\n  if (usePaths) {\n    // set transform to arrow position/orientation\n    context.translate(x, y);\n    context.rotate(angle);\n    context.scale(size, size);\n  }\n  if (fill === 'filled' || fill === 'both') {\n    if (usePaths) {\n      context.fill(path);\n    } else {\n      context.fill();\n    }\n  }\n  if (fill === 'hollow' || fill === 'both') {\n    context.lineWidth = shapeWidth / (usePaths ? size : 1);\n    context.lineJoin = 'miter';\n    if (usePaths) {\n      context.stroke(path);\n    } else {\n      context.stroke();\n    }\n  }\n  if (usePaths) {\n    // reset transform by applying inverse\n    context.scale(1 / size, 1 / size);\n    context.rotate(-angle);\n    context.translate(-x, -y);\n  }\n};\n\nvar CRp$8 = {};\nCRp$8.safeDrawImage = function (context, img, ix, iy, iw, ih, x, y, w, h) {\n  // detect problematic cases for old browsers with bad images (cheaper than try-catch)\n  if (iw <= 0 || ih <= 0 || w <= 0 || h <= 0) {\n    return;\n  }\n  try {\n    context.drawImage(img, ix, iy, iw, ih, x, y, w, h);\n  } catch (e) {\n    warn(e);\n  }\n};\nCRp$8.drawInscribedImage = function (context, img, node, index, nodeOpacity) {\n  var r = this;\n  var pos = node.position();\n  var nodeX = pos.x;\n  var nodeY = pos.y;\n  var styleObj = node.cy().style();\n  var getIndexedStyle = styleObj.getIndexedStyle.bind(styleObj);\n  var fit = getIndexedStyle(node, 'background-fit', 'value', index);\n  var repeat = getIndexedStyle(node, 'background-repeat', 'value', index);\n  var nodeW = node.width();\n  var nodeH = node.height();\n  var paddingX2 = node.padding() * 2;\n  var nodeTW = nodeW + (getIndexedStyle(node, 'background-width-relative-to', 'value', index) === 'inner' ? 0 : paddingX2);\n  var nodeTH = nodeH + (getIndexedStyle(node, 'background-height-relative-to', 'value', index) === 'inner' ? 0 : paddingX2);\n  var rs = node._private.rscratch;\n  var clip = getIndexedStyle(node, 'background-clip', 'value', index);\n  var shouldClip = clip === 'node';\n  var imgOpacity = getIndexedStyle(node, 'background-image-opacity', 'value', index) * nodeOpacity;\n  var smooth = getIndexedStyle(node, 'background-image-smoothing', 'value', index);\n  var cornerRadius = node.pstyle('corner-radius').value;\n  if (cornerRadius !== 'auto') cornerRadius = node.pstyle('corner-radius').pfValue;\n  var imgW = img.width || img.cachedW;\n  var imgH = img.height || img.cachedH;\n\n  // workaround for broken browsers like ie\n  if (null == imgW || null == imgH) {\n    document.body.appendChild(img); // eslint-disable-line no-undef\n\n    imgW = img.cachedW = img.width || img.offsetWidth;\n    imgH = img.cachedH = img.height || img.offsetHeight;\n    document.body.removeChild(img); // eslint-disable-line no-undef\n  }\n  var w = imgW;\n  var h = imgH;\n  if (getIndexedStyle(node, 'background-width', 'value', index) !== 'auto') {\n    if (getIndexedStyle(node, 'background-width', 'units', index) === '%') {\n      w = getIndexedStyle(node, 'background-width', 'pfValue', index) * nodeTW;\n    } else {\n      w = getIndexedStyle(node, 'background-width', 'pfValue', index);\n    }\n  }\n  if (getIndexedStyle(node, 'background-height', 'value', index) !== 'auto') {\n    if (getIndexedStyle(node, 'background-height', 'units', index) === '%') {\n      h = getIndexedStyle(node, 'background-height', 'pfValue', index) * nodeTH;\n    } else {\n      h = getIndexedStyle(node, 'background-height', 'pfValue', index);\n    }\n  }\n  if (w === 0 || h === 0) {\n    return; // no point in drawing empty image (and chrome is broken in this case)\n  }\n  if (fit === 'contain') {\n    var scale = Math.min(nodeTW / w, nodeTH / h);\n    w *= scale;\n    h *= scale;\n  } else if (fit === 'cover') {\n    var scale = Math.max(nodeTW / w, nodeTH / h);\n    w *= scale;\n    h *= scale;\n  }\n  var x = nodeX - nodeTW / 2; // left\n  var posXUnits = getIndexedStyle(node, 'background-position-x', 'units', index);\n  var posXPfVal = getIndexedStyle(node, 'background-position-x', 'pfValue', index);\n  if (posXUnits === '%') {\n    x += (nodeTW - w) * posXPfVal;\n  } else {\n    x += posXPfVal;\n  }\n  var offXUnits = getIndexedStyle(node, 'background-offset-x', 'units', index);\n  var offXPfVal = getIndexedStyle(node, 'background-offset-x', 'pfValue', index);\n  if (offXUnits === '%') {\n    x += (nodeTW - w) * offXPfVal;\n  } else {\n    x += offXPfVal;\n  }\n  var y = nodeY - nodeTH / 2; // top\n  var posYUnits = getIndexedStyle(node, 'background-position-y', 'units', index);\n  var posYPfVal = getIndexedStyle(node, 'background-position-y', 'pfValue', index);\n  if (posYUnits === '%') {\n    y += (nodeTH - h) * posYPfVal;\n  } else {\n    y += posYPfVal;\n  }\n  var offYUnits = getIndexedStyle(node, 'background-offset-y', 'units', index);\n  var offYPfVal = getIndexedStyle(node, 'background-offset-y', 'pfValue', index);\n  if (offYUnits === '%') {\n    y += (nodeTH - h) * offYPfVal;\n  } else {\n    y += offYPfVal;\n  }\n  if (rs.pathCache) {\n    x -= nodeX;\n    y -= nodeY;\n    nodeX = 0;\n    nodeY = 0;\n  }\n  var gAlpha = context.globalAlpha;\n  context.globalAlpha = imgOpacity;\n  var smoothingEnabled = r.getImgSmoothing(context);\n  var isSmoothingSwitched = false;\n  if (smooth === 'no' && smoothingEnabled) {\n    r.setImgSmoothing(context, false);\n    isSmoothingSwitched = true;\n  } else if (smooth === 'yes' && !smoothingEnabled) {\n    r.setImgSmoothing(context, true);\n    isSmoothingSwitched = true;\n  }\n  if (repeat === 'no-repeat') {\n    if (shouldClip) {\n      context.save();\n      if (rs.pathCache) {\n        context.clip(rs.pathCache);\n      } else {\n        r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH, cornerRadius, rs);\n        context.clip();\n      }\n    }\n    r.safeDrawImage(context, img, 0, 0, imgW, imgH, x, y, w, h);\n    if (shouldClip) {\n      context.restore();\n    }\n  } else {\n    var pattern = context.createPattern(img, repeat);\n    context.fillStyle = pattern;\n    r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH, cornerRadius, rs);\n    context.translate(x, y);\n    context.fill();\n    context.translate(-x, -y);\n  }\n  context.globalAlpha = gAlpha;\n  if (isSmoothingSwitched) {\n    r.setImgSmoothing(context, smoothingEnabled);\n  }\n};\n\nvar CRp$7 = {};\nCRp$7.eleTextBiggerThanMin = function (ele, scale) {\n  if (!scale) {\n    var zoom = ele.cy().zoom();\n    var pxRatio = this.getPixelRatio();\n    var lvl = Math.ceil(log2(zoom * pxRatio)); // the effective texture level\n\n    scale = Math.pow(2, lvl);\n  }\n  var computedSize = ele.pstyle('font-size').pfValue * scale;\n  var minSize = ele.pstyle('min-zoomed-font-size').pfValue;\n  if (computedSize < minSize) {\n    return false;\n  }\n  return true;\n};\nCRp$7.drawElementText = function (context, ele, shiftToOriginWithBb, force, prefix) {\n  var useEleOpacity = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n  var r = this;\n  if (force == null) {\n    if (useEleOpacity && !r.eleTextBiggerThanMin(ele)) {\n      return;\n    }\n  } else if (force === false) {\n    return;\n  }\n  if (ele.isNode()) {\n    var label = ele.pstyle('label');\n    if (!label || !label.value) {\n      return;\n    }\n    var justification = r.getLabelJustification(ele);\n    context.textAlign = justification;\n    context.textBaseline = 'bottom';\n  } else {\n    var badLine = ele.element()._private.rscratch.badLine;\n    var _label = ele.pstyle('label');\n    var srcLabel = ele.pstyle('source-label');\n    var tgtLabel = ele.pstyle('target-label');\n    if (badLine || (!_label || !_label.value) && (!srcLabel || !srcLabel.value) && (!tgtLabel || !tgtLabel.value)) {\n      return;\n    }\n    context.textAlign = 'center';\n    context.textBaseline = 'bottom';\n  }\n  var applyRotation = !shiftToOriginWithBb;\n  var bb;\n  if (shiftToOriginWithBb) {\n    bb = shiftToOriginWithBb;\n    context.translate(-bb.x1, -bb.y1);\n  }\n  if (prefix == null) {\n    r.drawText(context, ele, null, applyRotation, useEleOpacity);\n    if (ele.isEdge()) {\n      r.drawText(context, ele, 'source', applyRotation, useEleOpacity);\n      r.drawText(context, ele, 'target', applyRotation, useEleOpacity);\n    }\n  } else {\n    r.drawText(context, ele, prefix, applyRotation, useEleOpacity);\n  }\n  if (shiftToOriginWithBb) {\n    context.translate(bb.x1, bb.y1);\n  }\n};\nCRp$7.getFontCache = function (context) {\n  var cache;\n  this.fontCaches = this.fontCaches || [];\n  for (var i = 0; i < this.fontCaches.length; i++) {\n    cache = this.fontCaches[i];\n    if (cache.context === context) {\n      return cache;\n    }\n  }\n  cache = {\n    context: context\n  };\n  this.fontCaches.push(cache);\n  return cache;\n};\n\n// set up canvas context with font\n// returns transformed text string\nCRp$7.setupTextStyle = function (context, ele) {\n  var useEleOpacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n  // Font style\n  var labelStyle = ele.pstyle('font-style').strValue;\n  var labelSize = ele.pstyle('font-size').pfValue + 'px';\n  var labelFamily = ele.pstyle('font-family').strValue;\n  var labelWeight = ele.pstyle('font-weight').strValue;\n  var opacity = useEleOpacity ? ele.effectiveOpacity() * ele.pstyle('text-opacity').value : 1;\n  var outlineOpacity = ele.pstyle('text-outline-opacity').value * opacity;\n  var color = ele.pstyle('color').value;\n  var outlineColor = ele.pstyle('text-outline-color').value;\n  context.font = labelStyle + ' ' + labelWeight + ' ' + labelSize + ' ' + labelFamily;\n  context.lineJoin = 'round'; // so text outlines aren't jagged\n\n  this.colorFillStyle(context, color[0], color[1], color[2], opacity);\n  this.colorStrokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity);\n};\nfunction circle(ctx, x, y, width, height) {\n  var diameter = Math.min(width, height);\n  var radius = diameter / 2;\n  var centerX = x + width / 2;\n  var centerY = y + height / 2;\n  ctx.beginPath();\n  ctx.arc(centerX, centerY, radius, 0, Math.PI * 2);\n  ctx.closePath();\n}\nfunction roundRect(ctx, x, y, width, height) {\n  var radius = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 5;\n  var r = Math.min(radius, width / 2, height / 2); // prevent overflow\n  ctx.beginPath();\n  ctx.moveTo(x + r, y);\n  ctx.lineTo(x + width - r, y);\n  ctx.quadraticCurveTo(x + width, y, x + width, y + r);\n  ctx.lineTo(x + width, y + height - r);\n  ctx.quadraticCurveTo(x + width, y + height, x + width - r, y + height);\n  ctx.lineTo(x + r, y + height);\n  ctx.quadraticCurveTo(x, y + height, x, y + height - r);\n  ctx.lineTo(x, y + r);\n  ctx.quadraticCurveTo(x, y, x + r, y);\n  ctx.closePath();\n}\nCRp$7.getTextAngle = function (ele, prefix) {\n  var theta;\n  var _p = ele._private;\n  var rscratch = _p.rscratch;\n  var pdash = prefix ? prefix + '-' : '';\n  var rotation = ele.pstyle(pdash + 'text-rotation');\n  if (rotation.strValue === 'autorotate') {\n    var textAngle = getPrefixedProperty(rscratch, 'labelAngle', prefix);\n    theta = ele.isEdge() ? textAngle : 0;\n  } else if (rotation.strValue === 'none') {\n    theta = 0;\n  } else {\n    theta = rotation.pfValue;\n  }\n  return theta;\n};\nCRp$7.drawText = function (context, ele, prefix) {\n  var applyRotation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n  var useEleOpacity = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n  var _p = ele._private;\n  var rscratch = _p.rscratch;\n  var parentOpacity = useEleOpacity ? ele.effectiveOpacity() : 1;\n  if (useEleOpacity && (parentOpacity === 0 || ele.pstyle('text-opacity').value === 0)) {\n    return;\n  }\n\n  // use 'main' as an alias for the main label (i.e. null prefix)\n  if (prefix === 'main') {\n    prefix = null;\n  }\n  var textX = getPrefixedProperty(rscratch, 'labelX', prefix);\n  var textY = getPrefixedProperty(rscratch, 'labelY', prefix);\n  var orgTextX, orgTextY; // used for rotation\n  var text = this.getLabelText(ele, prefix);\n  if (text != null && text !== '' && !isNaN(textX) && !isNaN(textY)) {\n    this.setupTextStyle(context, ele, useEleOpacity);\n    var pdash = prefix ? prefix + '-' : '';\n    var textW = getPrefixedProperty(rscratch, 'labelWidth', prefix);\n    var textH = getPrefixedProperty(rscratch, 'labelHeight', prefix);\n    var marginX = ele.pstyle(pdash + 'text-margin-x').pfValue;\n    var marginY = ele.pstyle(pdash + 'text-margin-y').pfValue;\n    var isEdge = ele.isEdge();\n    var halign = ele.pstyle('text-halign').value;\n    var valign = ele.pstyle('text-valign').value;\n    if (isEdge) {\n      halign = 'center';\n      valign = 'center';\n    }\n    textX += marginX;\n    textY += marginY;\n    var theta;\n    if (!applyRotation) {\n      theta = 0;\n    } else {\n      theta = this.getTextAngle(ele, prefix);\n    }\n    if (theta !== 0) {\n      orgTextX = textX;\n      orgTextY = textY;\n      context.translate(orgTextX, orgTextY);\n      context.rotate(theta);\n      textX = 0;\n      textY = 0;\n    }\n    switch (valign) {\n      case 'top':\n        break;\n      case 'center':\n        textY += textH / 2;\n        break;\n      case 'bottom':\n        textY += textH;\n        break;\n    }\n    var backgroundOpacity = ele.pstyle('text-background-opacity').value;\n    var borderOpacity = ele.pstyle('text-border-opacity').value;\n    var textBorderWidth = ele.pstyle('text-border-width').pfValue;\n    var backgroundPadding = ele.pstyle('text-background-padding').pfValue;\n    var styleShape = ele.pstyle('text-background-shape').strValue;\n    var rounded = styleShape === 'round-rectangle' || styleShape === 'roundrectangle';\n    var circled = styleShape === 'circle';\n    var roundRadius = 2;\n    if (backgroundOpacity > 0 || textBorderWidth > 0 && borderOpacity > 0) {\n      var textFill = context.fillStyle;\n      var textStroke = context.strokeStyle;\n      var textLineWidth = context.lineWidth;\n      var textBackgroundColor = ele.pstyle('text-background-color').value;\n      var textBorderColor = ele.pstyle('text-border-color').value;\n      var textBorderStyle = ele.pstyle('text-border-style').value;\n      var doFill = backgroundOpacity > 0;\n      var doStroke = textBorderWidth > 0 && borderOpacity > 0;\n      var bgX = textX - backgroundPadding;\n      switch (halign) {\n        case 'left':\n          bgX -= textW;\n          break;\n        case 'center':\n          bgX -= textW / 2;\n          break;\n      }\n      var bgY = textY - textH - backgroundPadding;\n      var bgW = textW + 2 * backgroundPadding;\n      var bgH = textH + 2 * backgroundPadding;\n      if (doFill) {\n        context.fillStyle = \"rgba(\".concat(textBackgroundColor[0], \",\").concat(textBackgroundColor[1], \",\").concat(textBackgroundColor[2], \",\").concat(backgroundOpacity * parentOpacity, \")\");\n      }\n      if (doStroke) {\n        context.strokeStyle = \"rgba(\".concat(textBorderColor[0], \",\").concat(textBorderColor[1], \",\").concat(textBorderColor[2], \",\").concat(borderOpacity * parentOpacity, \")\");\n        context.lineWidth = textBorderWidth;\n        if (context.setLineDash) {\n          switch (textBorderStyle) {\n            case 'dotted':\n              context.setLineDash([1, 1]);\n              break;\n            case 'dashed':\n              context.setLineDash([4, 2]);\n              break;\n            case 'double':\n              context.lineWidth = textBorderWidth / 4;\n              context.setLineDash([]);\n              break;\n            case 'solid':\n            default:\n              context.setLineDash([]);\n              break;\n          }\n        }\n      }\n      if (rounded) {\n        context.beginPath();\n        roundRect(context, bgX, bgY, bgW, bgH, roundRadius);\n      } else if (circled) {\n        context.beginPath();\n        circle(context, bgX, bgY, bgW, bgH);\n      } else {\n        context.beginPath();\n        context.rect(bgX, bgY, bgW, bgH);\n      }\n      if (doFill) context.fill();\n      if (doStroke) context.stroke();\n\n      // Double border pass for 'double' style\n      if (doStroke && textBorderStyle === 'double') {\n        var whiteWidth = textBorderWidth / 2;\n        context.beginPath();\n        if (rounded) {\n          roundRect(context, bgX + whiteWidth, bgY + whiteWidth, bgW - 2 * whiteWidth, bgH - 2 * whiteWidth, roundRadius);\n        } else {\n          context.rect(bgX + whiteWidth, bgY + whiteWidth, bgW - 2 * whiteWidth, bgH - 2 * whiteWidth);\n        }\n        context.stroke();\n      }\n      context.fillStyle = textFill;\n      context.strokeStyle = textStroke;\n      context.lineWidth = textLineWidth;\n      if (context.setLineDash) context.setLineDash([]);\n    }\n    var lineWidth = 2 * ele.pstyle('text-outline-width').pfValue; // *2 b/c the stroke is drawn centred on the middle\n\n    if (lineWidth > 0) {\n      context.lineWidth = lineWidth;\n    }\n    if (ele.pstyle('text-wrap').value === 'wrap') {\n      var lines = getPrefixedProperty(rscratch, 'labelWrapCachedLines', prefix);\n      var lineHeight = getPrefixedProperty(rscratch, 'labelLineHeight', prefix);\n      var halfTextW = textW / 2;\n      var justification = this.getLabelJustification(ele);\n      if (justification === 'auto') ; else if (halign === 'left') {\n        // auto justification : right\n        if (justification === 'left') {\n          textX += -textW;\n        } else if (justification === 'center') {\n          textX += -halfTextW;\n        } // else same as auto\n      } else if (halign === 'center') {\n        // auto justfication : center\n        if (justification === 'left') {\n          textX += -halfTextW;\n        } else if (justification === 'right') {\n          textX += halfTextW;\n        } // else same as auto\n      } else if (halign === 'right') {\n        // auto justification : left\n        if (justification === 'center') {\n          textX += halfTextW;\n        } else if (justification === 'right') {\n          textX += textW;\n        } // else same as auto\n      }\n      switch (valign) {\n        case 'top':\n          textY -= (lines.length - 1) * lineHeight;\n          break;\n        case 'center':\n        case 'bottom':\n          textY -= (lines.length - 1) * lineHeight;\n          break;\n      }\n      for (var l = 0; l < lines.length; l++) {\n        if (lineWidth > 0) {\n          context.strokeText(lines[l], textX, textY);\n        }\n        context.fillText(lines[l], textX, textY);\n        textY += lineHeight;\n      }\n    } else {\n      if (lineWidth > 0) {\n        context.strokeText(text, textX, textY);\n      }\n      context.fillText(text, textX, textY);\n    }\n    if (theta !== 0) {\n      context.rotate(-theta);\n      context.translate(-orgTextX, -orgTextY);\n    }\n  }\n};\n\n/* global Path2D */\n\nvar CRp$6 = {};\nCRp$6.drawNode = function (context, node, shiftToOriginWithBb) {\n  var drawLabel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n  var shouldDrawOverlay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n  var shouldDrawOpacity = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n  var r = this;\n  var nodeWidth, nodeHeight;\n  var _p = node._private;\n  var rs = _p.rscratch;\n  var pos = node.position();\n  if (!number$1(pos.x) || !number$1(pos.y)) {\n    return; // can't draw node with undefined position\n  }\n  if (shouldDrawOpacity && !node.visible()) {\n    return;\n  }\n  var eleOpacity = shouldDrawOpacity ? node.effectiveOpacity() : 1;\n  var usePaths = r.usePaths();\n  var path;\n  var pathCacheHit = false;\n  var padding = node.padding();\n  nodeWidth = node.width() + 2 * padding;\n  nodeHeight = node.height() + 2 * padding;\n\n  //\n  // setup shift\n\n  var bb;\n  if (shiftToOriginWithBb) {\n    bb = shiftToOriginWithBb;\n    context.translate(-bb.x1, -bb.y1);\n  }\n\n  //\n  // load bg image\n\n  var bgImgProp = node.pstyle('background-image');\n  var urls = bgImgProp.value;\n  var urlDefined = new Array(urls.length);\n  var image = new Array(urls.length);\n  var numImages = 0;\n  for (var i = 0; i < urls.length; i++) {\n    var url = urls[i];\n    var defd = urlDefined[i] = url != null && url !== 'none';\n    if (defd) {\n      var bgImgCrossOrigin = node.cy().style().getIndexedStyle(node, 'background-image-crossorigin', 'value', i);\n      numImages++;\n\n      // get image, and if not loaded then ask to redraw when later loaded\n      image[i] = r.getCachedImage(url, bgImgCrossOrigin, function () {\n        _p.backgroundTimestamp = Date.now();\n        node.emitAndNotify('background');\n      });\n    }\n  }\n\n  //\n  // setup styles\n\n  var darkness = node.pstyle('background-blacken').value;\n  var borderWidth = node.pstyle('border-width').pfValue;\n  var bgOpacity = node.pstyle('background-opacity').value * eleOpacity;\n  var borderColor = node.pstyle('border-color').value;\n  var borderStyle = node.pstyle('border-style').value;\n  var borderJoin = node.pstyle('border-join').value;\n  var borderCap = node.pstyle('border-cap').value;\n  var borderPosition = node.pstyle('border-position').value;\n  var borderPattern = node.pstyle('border-dash-pattern').pfValue;\n  var borderOffset = node.pstyle('border-dash-offset').pfValue;\n  var borderOpacity = node.pstyle('border-opacity').value * eleOpacity;\n  var outlineWidth = node.pstyle('outline-width').pfValue;\n  var outlineColor = node.pstyle('outline-color').value;\n  var outlineStyle = node.pstyle('outline-style').value;\n  var outlineOpacity = node.pstyle('outline-opacity').value * eleOpacity;\n  var outlineOffset = node.pstyle('outline-offset').value;\n  var cornerRadius = node.pstyle('corner-radius').value;\n  if (cornerRadius !== 'auto') cornerRadius = node.pstyle('corner-radius').pfValue;\n  var setupShapeColor = function setupShapeColor() {\n    var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity;\n    r.eleFillStyle(context, node, bgOpy);\n  };\n  var setupBorderColor = function setupBorderColor() {\n    var bdrOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : borderOpacity;\n    r.colorStrokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy);\n  };\n  var setupOutlineColor = function setupOutlineColor() {\n    var otlnOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : outlineOpacity;\n    r.colorStrokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], otlnOpy);\n  };\n\n  //\n  // setup shape\n\n  var getPath = function getPath(width, height, shape, points) {\n    var pathCache = r.nodePathCache = r.nodePathCache || [];\n    var key = hashStrings(shape === 'polygon' ? shape + ',' + points.join(',') : shape, '' + height, '' + width, '' + cornerRadius);\n    var cachedPath = pathCache[key];\n    var path;\n    var cacheHit = false;\n    if (cachedPath != null) {\n      path = cachedPath;\n      cacheHit = true;\n      rs.pathCache = path;\n    } else {\n      path = new Path2D();\n      pathCache[key] = rs.pathCache = path;\n    }\n    return {\n      path: path,\n      cacheHit: cacheHit\n    };\n  };\n  var styleShape = node.pstyle('shape').strValue;\n  var shapePts = node.pstyle('shape-polygon-points').pfValue;\n  if (usePaths) {\n    context.translate(pos.x, pos.y);\n    var shapePath = getPath(nodeWidth, nodeHeight, styleShape, shapePts);\n    path = shapePath.path;\n    pathCacheHit = shapePath.cacheHit;\n  }\n  var drawShape = function drawShape() {\n    if (!pathCacheHit) {\n      var npos = pos;\n      if (usePaths) {\n        npos = {\n          x: 0,\n          y: 0\n        };\n      }\n      r.nodeShapes[r.getNodeShape(node)].draw(path || context, npos.x, npos.y, nodeWidth, nodeHeight, cornerRadius, rs);\n    }\n    if (usePaths) {\n      context.fill(path);\n    } else {\n      context.fill();\n    }\n  };\n  var drawImages = function drawImages() {\n    var nodeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : eleOpacity;\n    var inside = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n    var prevBging = _p.backgrounding;\n    var totalCompleted = 0;\n    for (var _i = 0; _i < image.length; _i++) {\n      var bgContainment = node.cy().style().getIndexedStyle(node, 'background-image-containment', 'value', _i);\n      if (inside && bgContainment === 'over' || !inside && bgContainment === 'inside') {\n        totalCompleted++;\n        continue;\n      }\n      if (urlDefined[_i] && image[_i].complete && !image[_i].error) {\n        totalCompleted++;\n        r.drawInscribedImage(context, image[_i], node, _i, nodeOpacity);\n      }\n    }\n    _p.backgrounding = !(totalCompleted === numImages);\n    if (prevBging !== _p.backgrounding) {\n      // update style b/c :backgrounding state changed\n      node.updateStyle(false);\n    }\n  };\n  var drawPie = function drawPie() {\n    var redrawShape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n    var pieOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : eleOpacity;\n    if (r.hasPie(node)) {\n      r.drawPie(context, node, pieOpacity);\n\n      // redraw/restore path if steps after pie need it\n      if (redrawShape) {\n        if (!usePaths) {\n          r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight, cornerRadius, rs);\n        }\n      }\n    }\n  };\n  var drawStripe = function drawStripe() {\n    var redrawShape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n    var stripeOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : eleOpacity;\n    if (r.hasStripe(node)) {\n      context.save();\n      if (usePaths) {\n        context.clip(rs.pathCache);\n      } else {\n        r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight, cornerRadius, rs);\n        context.clip();\n      }\n      r.drawStripe(context, node, stripeOpacity);\n      context.restore();\n\n      // redraw/restore path if steps after stripes need it\n      if (redrawShape) {\n        if (!usePaths) {\n          r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight, cornerRadius, rs);\n        }\n      }\n    }\n  };\n  var darken = function darken() {\n    var darkenOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : eleOpacity;\n    var opacity = (darkness > 0 ? darkness : -darkness) * darkenOpacity;\n    var c = darkness > 0 ? 0 : 255;\n    if (darkness !== 0) {\n      r.colorFillStyle(context, c, c, c, opacity);\n      if (usePaths) {\n        context.fill(path);\n      } else {\n        context.fill();\n      }\n    }\n  };\n  var drawBorder = function drawBorder() {\n    if (borderWidth > 0) {\n      context.lineWidth = borderWidth;\n      context.lineCap = borderCap;\n      context.lineJoin = borderJoin;\n      if (context.setLineDash) {\n        // for very outofdate browsers\n        switch (borderStyle) {\n          case 'dotted':\n            context.setLineDash([1, 1]);\n            break;\n          case 'dashed':\n            context.setLineDash(borderPattern);\n            context.lineDashOffset = borderOffset;\n            break;\n          case 'solid':\n          case 'double':\n            context.setLineDash([]);\n            break;\n        }\n      }\n      if (borderPosition !== 'center') {\n        context.save();\n        context.lineWidth *= 2;\n        if (borderPosition === 'inside') {\n          usePaths ? context.clip(path) : context.clip();\n        } else {\n          var region = new Path2D();\n          region.rect(-nodeWidth / 2 - borderWidth, -nodeHeight / 2 - borderWidth, nodeWidth + 2 * borderWidth, nodeHeight + 2 * borderWidth);\n          region.addPath(path);\n          context.clip(region, 'evenodd');\n        }\n        usePaths ? context.stroke(path) : context.stroke();\n        context.restore();\n      } else {\n        usePaths ? context.stroke(path) : context.stroke();\n      }\n      if (borderStyle === 'double') {\n        context.lineWidth = borderWidth / 3;\n        var gco = context.globalCompositeOperation;\n        context.globalCompositeOperation = 'destination-out';\n        if (usePaths) {\n          context.stroke(path);\n        } else {\n          context.stroke();\n        }\n        context.globalCompositeOperation = gco;\n      }\n\n      // reset in case we changed the border style\n      if (context.setLineDash) {\n        // for very outofdate browsers\n        context.setLineDash([]);\n      }\n    }\n  };\n  var drawOutline = function drawOutline() {\n    if (outlineWidth > 0) {\n      context.lineWidth = outlineWidth;\n      context.lineCap = 'butt';\n      if (context.setLineDash) {\n        // for very outofdate browsers\n        switch (outlineStyle) {\n          case 'dotted':\n            context.setLineDash([1, 1]);\n            break;\n          case 'dashed':\n            context.setLineDash([4, 2]);\n            break;\n          case 'solid':\n          case 'double':\n            context.setLineDash([]);\n            break;\n        }\n      }\n      var npos = pos;\n      if (usePaths) {\n        npos = {\n          x: 0,\n          y: 0\n        };\n      }\n      var shape = r.getNodeShape(node);\n      var bWidth = borderWidth;\n      if (borderPosition === 'inside') bWidth = 0;\n      if (borderPosition === 'outside') bWidth *= 2;\n      var scaleX = (nodeWidth + bWidth + (outlineWidth + outlineOffset)) / nodeWidth;\n      var scaleY = (nodeHeight + bWidth + (outlineWidth + outlineOffset)) / nodeHeight;\n      var sWidth = nodeWidth * scaleX;\n      var sHeight = nodeHeight * scaleY;\n      var points = r.nodeShapes[shape].points;\n      var _path;\n      if (usePaths) {\n        var outlinePath = getPath(sWidth, sHeight, shape, points);\n        _path = outlinePath.path;\n      }\n\n      // draw the outline path, either by using expanded points or by scaling \n      // the dimensions, depending on shape\n      if (shape === \"ellipse\") {\n        r.drawEllipsePath(_path || context, npos.x, npos.y, sWidth, sHeight);\n      } else if (['round-diamond', 'round-heptagon', 'round-hexagon', 'round-octagon', 'round-pentagon', 'round-polygon', 'round-triangle', 'round-tag'].includes(shape)) {\n        var sMult = 0;\n        var offsetX = 0;\n        var offsetY = 0;\n        if (shape === 'round-diamond') {\n          sMult = (bWidth + outlineOffset + outlineWidth) * 1.4;\n        } else if (shape === 'round-heptagon') {\n          sMult = (bWidth + outlineOffset + outlineWidth) * 1.075;\n          offsetY = -(bWidth / 2 + outlineOffset + outlineWidth) / 35;\n        } else if (shape === 'round-hexagon') {\n          sMult = (bWidth + outlineOffset + outlineWidth) * 1.12;\n        } else if (shape === 'round-pentagon') {\n          sMult = (bWidth + outlineOffset + outlineWidth) * 1.13;\n          offsetY = -(bWidth / 2 + outlineOffset + outlineWidth) / 15;\n        } else if (shape === 'round-tag') {\n          sMult = (bWidth + outlineOffset + outlineWidth) * 1.12;\n          offsetX = (bWidth / 2 + outlineWidth + outlineOffset) * .07;\n        } else if (shape === 'round-triangle') {\n          sMult = (bWidth + outlineOffset + outlineWidth) * (Math.PI / 2);\n          offsetY = -(bWidth + outlineOffset / 2 + outlineWidth) / Math.PI;\n        }\n        if (sMult !== 0) {\n          scaleX = (nodeWidth + sMult) / nodeWidth;\n          sWidth = nodeWidth * scaleX;\n          if (!['round-hexagon', 'round-tag'].includes(shape)) {\n            scaleY = (nodeHeight + sMult) / nodeHeight;\n            sHeight = nodeHeight * scaleY;\n          }\n        }\n        cornerRadius = cornerRadius === 'auto' ? getRoundPolygonRadius(sWidth, sHeight) : cornerRadius;\n        var halfW = sWidth / 2;\n        var halfH = sHeight / 2;\n        var radius = cornerRadius + (bWidth + outlineWidth + outlineOffset) / 2;\n        var p = new Array(points.length / 2);\n        var corners = new Array(points.length / 2);\n        for (var _i2 = 0; _i2 < points.length / 2; _i2++) {\n          p[_i2] = {\n            x: npos.x + offsetX + halfW * points[_i2 * 2],\n            y: npos.y + offsetY + halfH * points[_i2 * 2 + 1]\n          };\n        }\n        var _i3,\n          p1,\n          p2,\n          p3,\n          len = p.length;\n        p1 = p[len - 1];\n        // for each point\n        for (_i3 = 0; _i3 < len; _i3++) {\n          p2 = p[_i3 % len];\n          p3 = p[(_i3 + 1) % len];\n          corners[_i3] = getRoundCorner(p1, p2, p3, radius);\n          p1 = p2;\n          p2 = p3;\n        }\n        r.drawRoundPolygonPath(_path || context, npos.x + offsetX, npos.y + offsetY, nodeWidth * scaleX, nodeHeight * scaleY, points, corners);\n      } else if (['roundrectangle', 'round-rectangle'].includes(shape)) {\n        cornerRadius = cornerRadius === 'auto' ? getRoundRectangleRadius(sWidth, sHeight) : cornerRadius;\n        r.drawRoundRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight, cornerRadius + (bWidth + outlineWidth + outlineOffset) / 2);\n      } else if (['cutrectangle', 'cut-rectangle'].includes(shape)) {\n        cornerRadius = cornerRadius === 'auto' ? getCutRectangleCornerLength() : cornerRadius;\n        r.drawCutRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight, null, cornerRadius + (bWidth + outlineWidth + outlineOffset) / 4);\n      } else if (['bottomroundrectangle', 'bottom-round-rectangle'].includes(shape)) {\n        cornerRadius = cornerRadius === 'auto' ? getRoundRectangleRadius(sWidth, sHeight) : cornerRadius;\n        r.drawBottomRoundRectanglePath(_path || context, npos.x, npos.y, sWidth, sHeight, cornerRadius + (bWidth + outlineWidth + outlineOffset) / 2);\n      } else if (shape === \"barrel\") {\n        r.drawBarrelPath(_path || context, npos.x, npos.y, sWidth, sHeight);\n      } else if (shape.startsWith(\"polygon\") || ['rhomboid', 'right-rhomboid', 'round-tag', 'tag', 'vee'].includes(shape)) {\n        var pad = (bWidth + outlineWidth + outlineOffset) / nodeWidth;\n        points = joinLines(expandPolygon(points, pad));\n        r.drawPolygonPath(_path || context, npos.x, npos.y, nodeWidth, nodeHeight, points);\n      } else {\n        var _pad = (bWidth + outlineWidth + outlineOffset) / nodeWidth;\n        points = joinLines(expandPolygon(points, -_pad));\n        r.drawPolygonPath(_path || context, npos.x, npos.y, nodeWidth, nodeHeight, points);\n      }\n      if (usePaths) {\n        context.stroke(_path);\n      } else {\n        context.stroke();\n      }\n      if (outlineStyle === 'double') {\n        context.lineWidth = bWidth / 3;\n        var gco = context.globalCompositeOperation;\n        context.globalCompositeOperation = 'destination-out';\n        if (usePaths) {\n          context.stroke(_path);\n        } else {\n          context.stroke();\n        }\n        context.globalCompositeOperation = gco;\n      }\n\n      // reset in case we changed the border style\n      if (context.setLineDash) {\n        // for very outofdate browsers\n        context.setLineDash([]);\n      }\n    }\n  };\n  var drawOverlay = function drawOverlay() {\n    if (shouldDrawOverlay) {\n      r.drawNodeOverlay(context, node, pos, nodeWidth, nodeHeight);\n    }\n  };\n  var drawUnderlay = function drawUnderlay() {\n    if (shouldDrawOverlay) {\n      r.drawNodeUnderlay(context, node, pos, nodeWidth, nodeHeight);\n    }\n  };\n  var drawText = function drawText() {\n    r.drawElementText(context, node, null, drawLabel);\n  };\n  var ghost = node.pstyle('ghost').value === 'yes';\n  if (ghost) {\n    var gx = node.pstyle('ghost-offset-x').pfValue;\n    var gy = node.pstyle('ghost-offset-y').pfValue;\n    var ghostOpacity = node.pstyle('ghost-opacity').value;\n    var effGhostOpacity = ghostOpacity * eleOpacity;\n    context.translate(gx, gy);\n    setupOutlineColor();\n    drawOutline();\n    setupShapeColor(ghostOpacity * bgOpacity);\n    drawShape();\n    drawImages(effGhostOpacity, true);\n    setupBorderColor(ghostOpacity * borderOpacity);\n    drawBorder();\n    drawPie(darkness !== 0 || borderWidth !== 0);\n    drawStripe(darkness !== 0 || borderWidth !== 0);\n    drawImages(effGhostOpacity, false);\n    darken(effGhostOpacity);\n    context.translate(-gx, -gy);\n  }\n  if (usePaths) {\n    context.translate(-pos.x, -pos.y);\n  }\n  drawUnderlay();\n  if (usePaths) {\n    context.translate(pos.x, pos.y);\n  }\n  setupOutlineColor();\n  drawOutline();\n  setupShapeColor();\n  drawShape();\n  drawImages(eleOpacity, true);\n  setupBorderColor();\n  drawBorder();\n  drawPie(darkness !== 0 || borderWidth !== 0);\n  drawStripe(darkness !== 0 || borderWidth !== 0);\n  drawImages(eleOpacity, false);\n  darken();\n  if (usePaths) {\n    context.translate(-pos.x, -pos.y);\n  }\n  drawText();\n  drawOverlay();\n\n  //\n  // clean up shift\n\n  if (shiftToOriginWithBb) {\n    context.translate(bb.x1, bb.y1);\n  }\n};\nvar drawNodeOverlayUnderlay = function drawNodeOverlayUnderlay(overlayOrUnderlay) {\n  if (!['overlay', 'underlay'].includes(overlayOrUnderlay)) {\n    throw new Error('Invalid state');\n  }\n  return function (context, node, pos, nodeWidth, nodeHeight) {\n    var r = this;\n    if (!node.visible()) {\n      return;\n    }\n    var padding = node.pstyle(\"\".concat(overlayOrUnderlay, \"-padding\")).pfValue;\n    var opacity = node.pstyle(\"\".concat(overlayOrUnderlay, \"-opacity\")).value;\n    var color = node.pstyle(\"\".concat(overlayOrUnderlay, \"-color\")).value;\n    var shape = node.pstyle(\"\".concat(overlayOrUnderlay, \"-shape\")).value;\n    var radius = node.pstyle(\"\".concat(overlayOrUnderlay, \"-corner-radius\")).value;\n    if (opacity > 0) {\n      pos = pos || node.position();\n      if (nodeWidth == null || nodeHeight == null) {\n        var _padding = node.padding();\n        nodeWidth = node.width() + 2 * _padding;\n        nodeHeight = node.height() + 2 * _padding;\n      }\n      r.colorFillStyle(context, color[0], color[1], color[2], opacity);\n      r.nodeShapes[shape].draw(context, pos.x, pos.y, nodeWidth + padding * 2, nodeHeight + padding * 2, radius);\n      context.fill();\n    }\n  };\n};\nCRp$6.drawNodeOverlay = drawNodeOverlayUnderlay('overlay');\nCRp$6.drawNodeUnderlay = drawNodeOverlayUnderlay('underlay');\n\n// does the node have at least one pie piece?\nCRp$6.hasPie = function (node) {\n  node = node[0]; // ensure ele ref\n\n  return node._private.hasPie;\n};\nCRp$6.hasStripe = function (node) {\n  node = node[0]; // ensure ele ref\n\n  return node._private.hasStripe;\n};\nCRp$6.drawPie = function (context, node, nodeOpacity, pos) {\n  node = node[0]; // ensure ele ref\n  pos = pos || node.position();\n  var cyStyle = node.cy().style();\n  var pieSize = node.pstyle('pie-size');\n  var hole = node.pstyle('pie-hole');\n  var overallStartAngle = node.pstyle('pie-start-angle').pfValue;\n  var x = pos.x;\n  var y = pos.y;\n  var nodeW = node.width();\n  var nodeH = node.height();\n  var radius = Math.min(nodeW, nodeH) / 2; // must fit in node\n  var holeRadius;\n  var lastPercent = 0; // what % to continue drawing pie slices from on [0, 1]\n  var usePaths = this.usePaths();\n  if (usePaths) {\n    x = 0;\n    y = 0;\n  }\n  if (pieSize.units === '%') {\n    radius = radius * pieSize.pfValue;\n  } else if (pieSize.pfValue !== undefined) {\n    radius = pieSize.pfValue / 2; // diameter in pixels => radius\n  }\n  if (hole.units === '%') {\n    holeRadius = radius * hole.pfValue;\n  } else if (hole.pfValue !== undefined) {\n    holeRadius = hole.pfValue / 2; // diameter in pixels => radius\n  }\n  if (holeRadius >= radius) {\n    return; // the pie would be invisible anyway\n  }\n  for (var i = 1; i <= cyStyle.pieBackgroundN; i++) {\n    // 1..N\n    var size = node.pstyle('pie-' + i + '-background-size').value;\n    var color = node.pstyle('pie-' + i + '-background-color').value;\n    var opacity = node.pstyle('pie-' + i + '-background-opacity').value * nodeOpacity;\n    var percent = size / 100; // map integer range [0, 100] to [0, 1]\n\n    // percent can't push beyond 1\n    if (percent + lastPercent > 1) {\n      percent = 1 - lastPercent;\n    }\n    var angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; // start at 12 o'clock and go clockwise\n    angleStart += overallStartAngle; // shift by the overall pie start angle\n    var angleDelta = 2 * Math.PI * percent;\n    var angleEnd = angleStart + angleDelta;\n\n    // ignore if\n    // - zero size\n    // - we're already beyond the full circle\n    // - adding the current slice would go beyond the full circle\n    if (size === 0 || lastPercent >= 1 || lastPercent + percent > 1) {\n      continue;\n    }\n    if (holeRadius === 0) {\n      // make a pie slice\n      context.beginPath();\n      context.moveTo(x, y);\n      context.arc(x, y, radius, angleStart, angleEnd);\n      context.closePath();\n    } else {\n      // make a pie slice that's like the above but with a hole in the middle\n      context.beginPath();\n      context.arc(x, y, radius, angleStart, angleEnd);\n      context.arc(x, y, holeRadius, angleEnd, angleStart, true); // true for anticlockwise\n      context.closePath();\n    }\n    this.colorFillStyle(context, color[0], color[1], color[2], opacity);\n    context.fill();\n    lastPercent += percent;\n  }\n};\nCRp$6.drawStripe = function (context, node, nodeOpacity, pos) {\n  node = node[0]; // ensure ele ref\n  pos = pos || node.position();\n  var cyStyle = node.cy().style();\n  var x = pos.x;\n  var y = pos.y;\n  var nodeW = node.width();\n  var nodeH = node.height();\n  var lastPercent = 0; // what % to continue drawing pie slices from on [0, 1]\n  var usePaths = this.usePaths();\n  context.save();\n  var direction = node.pstyle('stripe-direction').value;\n  var stripeSize = node.pstyle('stripe-size');\n  switch (direction) {\n    case 'vertical':\n      break;\n    // default\n    case 'righward':\n      context.rotate(-Math.PI / 2);\n      break;\n  }\n  var stripeW = nodeW;\n  var stripeH = nodeH;\n  if (stripeSize.units === '%') {\n    stripeW = stripeW * stripeSize.pfValue;\n    stripeH = stripeH * stripeSize.pfValue;\n  } else if (stripeSize.pfValue !== undefined) {\n    stripeW = stripeSize.pfValue;\n    stripeH = stripeSize.pfValue;\n  }\n  if (usePaths) {\n    x = 0;\n    y = 0;\n  }\n\n  // shift up from the centre of the node to the top-left corner\n  y -= stripeW / 2;\n  x -= stripeH / 2;\n  for (var i = 1; i <= cyStyle.stripeBackgroundN; i++) {\n    // 1..N\n    var size = node.pstyle('stripe-' + i + '-background-size').value;\n    var color = node.pstyle('stripe-' + i + '-background-color').value;\n    var opacity = node.pstyle('stripe-' + i + '-background-opacity').value * nodeOpacity;\n    var percent = size / 100; // map integer range [0, 100] to [0, 1]\n\n    // percent can't push beyond 1\n    if (percent + lastPercent > 1) {\n      percent = 1 - lastPercent;\n    }\n\n    // ignore if\n    // - zero size\n    // - we're already beyond the full chart\n    // - adding the current slice would go beyond the full chart\n    if (size === 0 || lastPercent >= 1 || lastPercent + percent > 1) {\n      continue;\n    }\n\n    // draw rect for the current stripe\n    context.beginPath();\n    context.rect(x, y + stripeH * lastPercent, stripeW, stripeH * percent);\n    context.closePath();\n    this.colorFillStyle(context, color[0], color[1], color[2], opacity);\n    context.fill();\n    lastPercent += percent;\n  }\n  context.restore();\n};\n\nvar CRp$5 = {};\nvar motionBlurDelay = 100;\n\n// var isFirefox = typeof InstallTrigger !== 'undefined';\n\nCRp$5.getPixelRatio = function () {\n  var context = this.data.contexts[0];\n  if (this.forcedPixelRatio != null) {\n    return this.forcedPixelRatio;\n  }\n  var containerWindow = this.cy.window();\n  var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;\n  return (containerWindow.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef\n};\nCRp$5.paintCache = function (context) {\n  var caches = this.paintCaches = this.paintCaches || [];\n  var needToCreateCache = true;\n  var cache;\n  for (var i = 0; i < caches.length; i++) {\n    cache = caches[i];\n    if (cache.context === context) {\n      needToCreateCache = false;\n      break;\n    }\n  }\n  if (needToCreateCache) {\n    cache = {\n      context: context\n    };\n    caches.push(cache);\n  }\n  return cache;\n};\nCRp$5.createGradientStyleFor = function (context, shapeStyleName, ele, fill, opacity) {\n  var gradientStyle;\n  var usePaths = this.usePaths();\n  var colors = ele.pstyle(shapeStyleName + '-gradient-stop-colors').value,\n    positions = ele.pstyle(shapeStyleName + '-gradient-stop-positions').pfValue;\n  if (fill === 'radial-gradient') {\n    if (ele.isEdge()) {\n      var start = ele.sourceEndpoint(),\n        end = ele.targetEndpoint(),\n        mid = ele.midpoint();\n      var d1 = dist(start, mid);\n      var d2 = dist(end, mid);\n      gradientStyle = context.createRadialGradient(mid.x, mid.y, 0, mid.x, mid.y, Math.max(d1, d2));\n    } else {\n      var pos = usePaths ? {\n          x: 0,\n          y: 0\n        } : ele.position(),\n        width = ele.paddedWidth(),\n        height = ele.paddedHeight();\n      gradientStyle = context.createRadialGradient(pos.x, pos.y, 0, pos.x, pos.y, Math.max(width, height));\n    }\n  } else {\n    if (ele.isEdge()) {\n      var _start = ele.sourceEndpoint(),\n        _end = ele.targetEndpoint();\n      gradientStyle = context.createLinearGradient(_start.x, _start.y, _end.x, _end.y);\n    } else {\n      var _pos = usePaths ? {\n          x: 0,\n          y: 0\n        } : ele.position(),\n        _width = ele.paddedWidth(),\n        _height = ele.paddedHeight(),\n        halfWidth = _width / 2,\n        halfHeight = _height / 2;\n      var direction = ele.pstyle('background-gradient-direction').value;\n      switch (direction) {\n        case 'to-bottom':\n          gradientStyle = context.createLinearGradient(_pos.x, _pos.y - halfHeight, _pos.x, _pos.y + halfHeight);\n          break;\n        case 'to-top':\n          gradientStyle = context.createLinearGradient(_pos.x, _pos.y + halfHeight, _pos.x, _pos.y - halfHeight);\n          break;\n        case 'to-left':\n          gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y, _pos.x - halfWidth, _pos.y);\n          break;\n        case 'to-right':\n          gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y, _pos.x + halfWidth, _pos.y);\n          break;\n        case 'to-bottom-right':\n        case 'to-right-bottom':\n          gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y - halfHeight, _pos.x + halfWidth, _pos.y + halfHeight);\n          break;\n        case 'to-top-right':\n        case 'to-right-top':\n          gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y + halfHeight, _pos.x + halfWidth, _pos.y - halfHeight);\n          break;\n        case 'to-bottom-left':\n        case 'to-left-bottom':\n          gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y - halfHeight, _pos.x - halfWidth, _pos.y + halfHeight);\n          break;\n        case 'to-top-left':\n        case 'to-left-top':\n          gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y + halfHeight, _pos.x - halfWidth, _pos.y - halfHeight);\n          break;\n      }\n    }\n  }\n  if (!gradientStyle) return null; // invalid gradient style\n\n  var hasPositions = positions.length === colors.length;\n  var length = colors.length;\n  for (var i = 0; i < length; i++) {\n    gradientStyle.addColorStop(hasPositions ? positions[i] : i / (length - 1), 'rgba(' + colors[i][0] + ',' + colors[i][1] + ',' + colors[i][2] + ',' + opacity + ')');\n  }\n  return gradientStyle;\n};\nCRp$5.gradientFillStyle = function (context, ele, fill, opacity) {\n  var gradientStyle = this.createGradientStyleFor(context, 'background', ele, fill, opacity);\n  if (!gradientStyle) return null; // error\n  context.fillStyle = gradientStyle;\n};\nCRp$5.colorFillStyle = function (context, r, g, b, a) {\n  context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n  // turn off for now, seems context does its own caching\n\n  // var cache = this.paintCache(context);\n\n  // var fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n\n  // if( cache.fillStyle !== fillStyle ){\n  //   context.fillStyle = cache.fillStyle = fillStyle;\n  // }\n};\nCRp$5.eleFillStyle = function (context, ele, opacity) {\n  var backgroundFill = ele.pstyle('background-fill').value;\n  if (backgroundFill === 'linear-gradient' || backgroundFill === 'radial-gradient') {\n    this.gradientFillStyle(context, ele, backgroundFill, opacity);\n  } else {\n    var backgroundColor = ele.pstyle('background-color').value;\n    this.colorFillStyle(context, backgroundColor[0], backgroundColor[1], backgroundColor[2], opacity);\n  }\n};\nCRp$5.gradientStrokeStyle = function (context, ele, fill, opacity) {\n  var gradientStyle = this.createGradientStyleFor(context, 'line', ele, fill, opacity);\n  if (!gradientStyle) return null; // error\n  context.strokeStyle = gradientStyle;\n};\nCRp$5.colorStrokeStyle = function (context, r, g, b, a) {\n  context.strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n  // turn off for now, seems context does its own caching\n\n  // var cache = this.paintCache(context);\n\n  // var strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n\n  // if( cache.strokeStyle !== strokeStyle ){\n  //   context.strokeStyle = cache.strokeStyle = strokeStyle;\n  // }\n};\nCRp$5.eleStrokeStyle = function (context, ele, opacity) {\n  var lineFill = ele.pstyle('line-fill').value;\n  if (lineFill === 'linear-gradient' || lineFill === 'radial-gradient') {\n    this.gradientStrokeStyle(context, ele, lineFill, opacity);\n  } else {\n    var lineColor = ele.pstyle('line-color').value;\n    this.colorStrokeStyle(context, lineColor[0], lineColor[1], lineColor[2], opacity);\n  }\n};\n\n// Resize canvas\nCRp$5.matchCanvasSize = function (container) {\n  var r = this;\n  var data = r.data;\n  var bb = r.findContainerClientCoords();\n  var width = bb[2];\n  var height = bb[3];\n  var pixelRatio = r.getPixelRatio();\n  var mbPxRatio = r.motionBlurPxRatio;\n  if (container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE] || container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]) {\n    pixelRatio = mbPxRatio;\n  }\n  var canvasWidth = width * pixelRatio;\n  var canvasHeight = height * pixelRatio;\n  var canvas;\n  if (canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight) {\n    return; // save cycles if same\n  }\n  r.fontCaches = null; // resizing resets the style\n\n  var canvasContainer = data.canvasContainer;\n  canvasContainer.style.width = width + 'px';\n  canvasContainer.style.height = height + 'px';\n  for (var i = 0; i < r.CANVAS_LAYERS; i++) {\n    canvas = data.canvases[i];\n    canvas.width = canvasWidth;\n    canvas.height = canvasHeight;\n    canvas.style.width = width + 'px';\n    canvas.style.height = height + 'px';\n  }\n  for (var i = 0; i < r.BUFFER_COUNT; i++) {\n    canvas = data.bufferCanvases[i];\n    canvas.width = canvasWidth;\n    canvas.height = canvasHeight;\n    canvas.style.width = width + 'px';\n    canvas.style.height = height + 'px';\n  }\n  r.textureMult = 1;\n  if (pixelRatio <= 1) {\n    canvas = data.bufferCanvases[r.TEXTURE_BUFFER];\n    r.textureMult = 2;\n    canvas.width = canvasWidth * r.textureMult;\n    canvas.height = canvasHeight * r.textureMult;\n  }\n  r.canvasWidth = canvasWidth;\n  r.canvasHeight = canvasHeight;\n  r.pixelRatio = pixelRatio;\n};\nCRp$5.renderTo = function (cxt, zoom, pan, pxRatio) {\n  this.render({\n    forcedContext: cxt,\n    forcedZoom: zoom,\n    forcedPan: pan,\n    drawAllLayers: true,\n    forcedPxRatio: pxRatio\n  });\n};\nCRp$5.clearCanvas = function () {\n  var r = this;\n  var data = r.data;\n  function clear(context) {\n    context.clearRect(0, 0, r.canvasWidth, r.canvasHeight);\n  }\n  clear(data.contexts[r.NODE]);\n  clear(data.contexts[r.DRAG]);\n};\nCRp$5.render = function (options) {\n  var r = this;\n  options = options || staticEmptyObject();\n  var cy = r.cy;\n  var forcedContext = options.forcedContext;\n  var drawAllLayers = options.drawAllLayers;\n  var drawOnlyNodeLayer = options.drawOnlyNodeLayer;\n  var forcedZoom = options.forcedZoom;\n  var forcedPan = options.forcedPan;\n  var pixelRatio = options.forcedPxRatio === undefined ? this.getPixelRatio() : options.forcedPxRatio;\n  var data = r.data;\n  var needDraw = data.canvasNeedsRedraw;\n  var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming);\n  var motionBlur = options.motionBlur !== undefined ? options.motionBlur : r.motionBlur;\n  var mbPxRatio = r.motionBlurPxRatio;\n  var hasCompoundNodes = cy.hasCompoundNodes();\n  var inNodeDragGesture = r.hoverData.draggingEles;\n  var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false;\n  motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection;\n  var motionBlurFadeEffect = motionBlur;\n  if (!forcedContext) {\n    if (r.prevPxRatio !== pixelRatio) {\n      r.invalidateContainerClientCoordsCache();\n      r.matchCanvasSize(r.container);\n      r.redrawHint('eles', true);\n      r.redrawHint('drag', true);\n    }\n    r.prevPxRatio = pixelRatio;\n  }\n  if (!forcedContext && r.motionBlurTimeout) {\n    clearTimeout(r.motionBlurTimeout);\n  }\n  if (motionBlur) {\n    if (r.mbFrames == null) {\n      r.mbFrames = 0;\n    }\n    r.mbFrames++;\n    if (r.mbFrames < 3) {\n      // need several frames before even high quality motionblur\n      motionBlurFadeEffect = false;\n    }\n\n    // go to lower quality blurry frames when several m/b frames have been rendered (avoids flashing)\n    if (r.mbFrames > r.minMbLowQualFrames) {\n      //r.fullQualityMb = false;\n      r.motionBlurPxRatio = r.mbPxRBlurry;\n    }\n  }\n  if (r.clearingMotionBlur) {\n    r.motionBlurPxRatio = 1;\n  }\n\n  // b/c drawToContext() may be async w.r.t. redraw(), keep track of last texture frame\n  // because a rogue async texture frame would clear needDraw\n  if (r.textureDrawLastFrame && !textureDraw) {\n    needDraw[r.NODE] = true;\n    needDraw[r.SELECT_BOX] = true;\n  }\n  var style = cy.style();\n  var zoom = cy.zoom();\n  var effectiveZoom = forcedZoom !== undefined ? forcedZoom : zoom;\n  var pan = cy.pan();\n  var effectivePan = {\n    x: pan.x,\n    y: pan.y\n  };\n  var vp = {\n    zoom: zoom,\n    pan: {\n      x: pan.x,\n      y: pan.y\n    }\n  };\n  var prevVp = r.prevViewport;\n  var viewportIsDiff = prevVp === undefined || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y;\n\n  // we want the low quality motionblur only when the viewport is being manipulated etc (where it's not noticed)\n  if (!viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes)) {\n    r.motionBlurPxRatio = 1;\n  }\n  if (forcedPan) {\n    effectivePan = forcedPan;\n  }\n\n  // apply pixel ratio\n\n  effectiveZoom *= pixelRatio;\n  effectivePan.x *= pixelRatio;\n  effectivePan.y *= pixelRatio;\n  var eles = r.getCachedZSortedEles();\n  function mbclear(context, x, y, w, h) {\n    var gco = context.globalCompositeOperation;\n    context.globalCompositeOperation = 'destination-out';\n    r.colorFillStyle(context, 255, 255, 255, r.motionBlurTransparency);\n    context.fillRect(x, y, w, h);\n    context.globalCompositeOperation = gco;\n  }\n  function setContextTransform(context, clear) {\n    var ePan, eZoom, w, h;\n    if (!r.clearingMotionBlur && (context === data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] || context === data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG])) {\n      ePan = {\n        x: pan.x * mbPxRatio,\n        y: pan.y * mbPxRatio\n      };\n      eZoom = zoom * mbPxRatio;\n      w = r.canvasWidth * mbPxRatio;\n      h = r.canvasHeight * mbPxRatio;\n    } else {\n      ePan = effectivePan;\n      eZoom = effectiveZoom;\n      w = r.canvasWidth;\n      h = r.canvasHeight;\n    }\n    context.setTransform(1, 0, 0, 1, 0, 0);\n    if (clear === 'motionBlur') {\n      mbclear(context, 0, 0, w, h);\n    } else if (!forcedContext && (clear === undefined || clear)) {\n      context.clearRect(0, 0, w, h);\n    }\n    if (!drawAllLayers) {\n      context.translate(ePan.x, ePan.y);\n      context.scale(eZoom, eZoom);\n    }\n    if (forcedPan) {\n      context.translate(forcedPan.x, forcedPan.y);\n    }\n    if (forcedZoom) {\n      context.scale(forcedZoom, forcedZoom);\n    }\n  }\n  if (!textureDraw) {\n    r.textureDrawLastFrame = false;\n  }\n  if (textureDraw) {\n    r.textureDrawLastFrame = true;\n    if (!r.textureCache) {\n      r.textureCache = {};\n      r.textureCache.bb = cy.mutableElements().boundingBox();\n      r.textureCache.texture = r.data.bufferCanvases[r.TEXTURE_BUFFER];\n      var cxt = r.data.bufferContexts[r.TEXTURE_BUFFER];\n      cxt.setTransform(1, 0, 0, 1, 0, 0);\n      cxt.clearRect(0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult);\n      r.render({\n        forcedContext: cxt,\n        drawOnlyNodeLayer: true,\n        forcedPxRatio: pixelRatio * r.textureMult\n      });\n      var vp = r.textureCache.viewport = {\n        zoom: cy.zoom(),\n        pan: cy.pan(),\n        width: r.canvasWidth,\n        height: r.canvasHeight\n      };\n      vp.mpan = {\n        x: (0 - vp.pan.x) / vp.zoom,\n        y: (0 - vp.pan.y) / vp.zoom\n      };\n    }\n    needDraw[r.DRAG] = false;\n    needDraw[r.NODE] = false;\n    var context = data.contexts[r.NODE];\n    var texture = r.textureCache.texture;\n    var vp = r.textureCache.viewport;\n    context.setTransform(1, 0, 0, 1, 0, 0);\n    if (motionBlur) {\n      mbclear(context, 0, 0, vp.width, vp.height);\n    } else {\n      context.clearRect(0, 0, vp.width, vp.height);\n    }\n    var outsideBgColor = style.core('outside-texture-bg-color').value;\n    var outsideBgOpacity = style.core('outside-texture-bg-opacity').value;\n    r.colorFillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity);\n    context.fillRect(0, 0, vp.width, vp.height);\n    var zoom = cy.zoom();\n    setContextTransform(context, false);\n    context.clearRect(vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio);\n    context.drawImage(texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio);\n  } else if (r.textureOnViewport && !forcedContext) {\n    // clear the cache since we don't need it\n    r.textureCache = null;\n  }\n  var extent = cy.extent();\n  var vpManip = r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles || r.cy.animated();\n  var hideEdges = r.hideEdgesOnViewport && vpManip;\n  var needMbClear = [];\n  needMbClear[r.NODE] = !needDraw[r.NODE] && motionBlur && !r.clearedForMotionBlur[r.NODE] || r.clearingMotionBlur;\n  if (needMbClear[r.NODE]) {\n    r.clearedForMotionBlur[r.NODE] = true;\n  }\n  needMbClear[r.DRAG] = !needDraw[r.DRAG] && motionBlur && !r.clearedForMotionBlur[r.DRAG] || r.clearingMotionBlur;\n  if (needMbClear[r.DRAG]) {\n    r.clearedForMotionBlur[r.DRAG] = true;\n  }\n  if (needDraw[r.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r.NODE]) {\n    var useBuffer = motionBlur && !needMbClear[r.NODE] && mbPxRatio !== 1;\n    var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] : data.contexts[r.NODE]);\n    var clear = motionBlur && !useBuffer ? 'motionBlur' : undefined;\n    setContextTransform(context, clear);\n    if (hideEdges) {\n      r.drawCachedNodes(context, eles.nondrag, pixelRatio, extent);\n    } else {\n      r.drawLayeredElements(context, eles.nondrag, pixelRatio, extent);\n    }\n    if (r.debug) {\n      r.drawDebugPoints(context, eles.nondrag);\n    }\n    if (!drawAllLayers && !motionBlur) {\n      needDraw[r.NODE] = false;\n    }\n  }\n  if (!drawOnlyNodeLayer && (needDraw[r.DRAG] || drawAllLayers || needMbClear[r.DRAG])) {\n    var useBuffer = motionBlur && !needMbClear[r.DRAG] && mbPxRatio !== 1;\n    var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG] : data.contexts[r.DRAG]);\n    setContextTransform(context, motionBlur && !useBuffer ? 'motionBlur' : undefined);\n    if (hideEdges) {\n      r.drawCachedNodes(context, eles.drag, pixelRatio, extent);\n    } else {\n      r.drawCachedElements(context, eles.drag, pixelRatio, extent);\n    }\n    if (r.debug) {\n      r.drawDebugPoints(context, eles.drag);\n    }\n    if (!drawAllLayers && !motionBlur) {\n      needDraw[r.DRAG] = false;\n    }\n  }\n  this.drawSelectionRectangle(options, setContextTransform);\n\n  // motionblur: blit rendered blurry frames\n  if (motionBlur && mbPxRatio !== 1) {\n    var cxtNode = data.contexts[r.NODE];\n    var txtNode = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE];\n    var cxtDrag = data.contexts[r.DRAG];\n    var txtDrag = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG];\n    var drawMotionBlur = function drawMotionBlur(cxt, txt, needClear) {\n      cxt.setTransform(1, 0, 0, 1, 0, 0);\n      if (needClear || !motionBlurFadeEffect) {\n        cxt.clearRect(0, 0, r.canvasWidth, r.canvasHeight);\n      } else {\n        mbclear(cxt, 0, 0, r.canvasWidth, r.canvasHeight);\n      }\n      var pxr = mbPxRatio;\n      cxt.drawImage(txt,\n      // img\n      0, 0,\n      // sx, sy\n      r.canvasWidth * pxr, r.canvasHeight * pxr,\n      // sw, sh\n      0, 0,\n      // x, y\n      r.canvasWidth, r.canvasHeight // w, h\n      );\n    };\n    if (needDraw[r.NODE] || needMbClear[r.NODE]) {\n      drawMotionBlur(cxtNode, txtNode, needMbClear[r.NODE]);\n      needDraw[r.NODE] = false;\n    }\n    if (needDraw[r.DRAG] || needMbClear[r.DRAG]) {\n      drawMotionBlur(cxtDrag, txtDrag, needMbClear[r.DRAG]);\n      needDraw[r.DRAG] = false;\n    }\n  }\n  r.prevViewport = vp;\n  if (r.clearingMotionBlur) {\n    r.clearingMotionBlur = false;\n    r.motionBlurCleared = true;\n    r.motionBlur = true;\n  }\n  if (motionBlur) {\n    r.motionBlurTimeout = setTimeout(function () {\n      r.motionBlurTimeout = null;\n      r.clearedForMotionBlur[r.NODE] = false;\n      r.clearedForMotionBlur[r.DRAG] = false;\n      r.motionBlur = false;\n      r.clearingMotionBlur = !textureDraw;\n      r.mbFrames = 0;\n      needDraw[r.NODE] = true;\n      needDraw[r.DRAG] = true;\n      r.redraw();\n    }, motionBlurDelay);\n  }\n  if (!forcedContext) {\n    cy.emit('render');\n  }\n};\nvar fpsHeight;\nCRp$5.drawSelectionRectangle = function (options, setContextTransform) {\n  var r = this;\n  var cy = r.cy;\n  var data = r.data;\n  var style = cy.style();\n  var drawOnlyNodeLayer = options.drawOnlyNodeLayer;\n  var drawAllLayers = options.drawAllLayers;\n  var needDraw = data.canvasNeedsRedraw;\n  var forcedContext = options.forcedContext;\n  if (r.showFps || !drawOnlyNodeLayer && needDraw[r.SELECT_BOX] && !drawAllLayers) {\n    var context = forcedContext || data.contexts[r.SELECT_BOX];\n    setContextTransform(context);\n    if (r.selection[4] == 1 && (r.hoverData.selecting || r.touchData.selecting)) {\n      var zoom = r.cy.zoom();\n      var borderWidth = style.core('selection-box-border-width').value / zoom;\n      context.lineWidth = borderWidth;\n      context.fillStyle = 'rgba(' + style.core('selection-box-color').value[0] + ',' + style.core('selection-box-color').value[1] + ',' + style.core('selection-box-color').value[2] + ',' + style.core('selection-box-opacity').value + ')';\n      context.fillRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]);\n      if (borderWidth > 0) {\n        context.strokeStyle = 'rgba(' + style.core('selection-box-border-color').value[0] + ',' + style.core('selection-box-border-color').value[1] + ',' + style.core('selection-box-border-color').value[2] + ',' + style.core('selection-box-opacity').value + ')';\n        context.strokeRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]);\n      }\n    }\n    if (data.bgActivePosistion && !r.hoverData.selecting) {\n      var zoom = r.cy.zoom();\n      var pos = data.bgActivePosistion;\n      context.fillStyle = 'rgba(' + style.core('active-bg-color').value[0] + ',' + style.core('active-bg-color').value[1] + ',' + style.core('active-bg-color').value[2] + ',' + style.core('active-bg-opacity').value + ')';\n      context.beginPath();\n      context.arc(pos.x, pos.y, style.core('active-bg-size').pfValue / zoom, 0, 2 * Math.PI);\n      context.fill();\n    }\n    var timeToRender = r.lastRedrawTime;\n    if (r.showFps && timeToRender) {\n      timeToRender = Math.round(timeToRender);\n      var fps = Math.round(1000 / timeToRender);\n      var text = '1 frame = ' + timeToRender + ' ms = ' + fps + ' fps';\n      context.setTransform(1, 0, 0, 1, 0, 0);\n      context.fillStyle = 'rgba(255, 0, 0, 0.75)';\n      context.strokeStyle = 'rgba(255, 0, 0, 0.75)';\n      // context.lineWidth = 1;\n      context.font = '30px Arial';\n      if (!fpsHeight) {\n        var dims = context.measureText(text);\n        fpsHeight = dims.actualBoundingBoxAscent;\n      }\n      context.fillText(text, 0, fpsHeight);\n      var maxFps = 60;\n      context.strokeRect(0, fpsHeight + 10, 250, 20);\n      context.fillRect(0, fpsHeight + 10, 250 * Math.min(fps / maxFps, 1), 20);\n    }\n    if (!drawAllLayers) {\n      needDraw[r.SELECT_BOX] = false;\n    }\n  }\n};\n\n/**\n * Notes:\n * - All colors have premultiplied alpha. Very important for textues and \n *   blending to work correctly.\n */\n\nfunction compileShader(gl, type, source) {\n  var shader = gl.createShader(type);\n  gl.shaderSource(shader, source);\n  gl.compileShader(shader);\n  if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n    throw new Error(gl.getShaderInfoLog(shader));\n  }\n  // console.log(gl.getShaderInfoLog(shader));\n  return shader;\n}\nfunction createProgram(gl, vertexSource, fragementSource) {\n  var vertexShader = compileShader(gl, gl.VERTEX_SHADER, vertexSource);\n  var fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fragementSource);\n  var program = gl.createProgram();\n  gl.attachShader(program, vertexShader);\n  gl.attachShader(program, fragmentShader);\n  gl.linkProgram(program);\n  if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n    throw new Error('Could not initialize shaders');\n  }\n  return program;\n}\n\n/**\n * Creates an offscren canvas with a 2D context, for the\n * canvas renderer to use for drawing textures.\n */\nfunction createTextureCanvas(r, width, height) {\n  if (height === undefined) {\n    height = width;\n  }\n  var canvas = r.makeOffscreenCanvas(width, height);\n  var ctx = canvas.context = canvas.getContext('2d');\n  canvas.clear = function () {\n    return ctx.clearRect(0, 0, canvas.width, canvas.height);\n  };\n  canvas.clear();\n  return canvas;\n}\n\n/**\n * Returns the current pan & zoom values, scaled by the pixel ratio.\n */\nfunction getEffectivePanZoom(r) {\n  var pixelRatio = r.pixelRatio;\n  var zoom = r.cy.zoom();\n  var pan = r.cy.pan();\n  return {\n    zoom: zoom * pixelRatio,\n    pan: {\n      x: pan.x * pixelRatio,\n      y: pan.y * pixelRatio\n    }\n  };\n}\n\n/**\n * Returns the zoom value, scaled by the pixel ratio.\n */\nfunction getEffectiveZoom(r) {\n  var pixelRatio = r.pixelRatio;\n  var zoom = r.cy.zoom();\n  return zoom * pixelRatio;\n}\nfunction modelToRenderedPosition(r, pan, zoom, x, y) {\n  var rx = x * zoom + pan.x;\n  var ry = y * zoom + pan.y;\n  ry = Math.round(r.canvasHeight - ry); // adjust for webgl\n  return [rx, ry];\n}\nfunction isSimpleShape(node, renderTarget) {\n  // the actual shape is checked in ElementDrawingWebGL._getVertTypeForShape()\n  // no need to check it twice, this just checks other visual properties\n  if (renderTarget.picking) {\n    // We don't care about the border or background style for picking\n    return true;\n  } else {\n    if (node.pstyle('background-fill').value !== 'solid') return false;\n    if (node.pstyle('background-image').strValue !== 'none') return false;\n    if (node.pstyle('border-width').value === 0) return true;\n    if (node.pstyle('border-opacity').value === 0) return true;\n    // we have a border but it must be simple\n    if (node.pstyle('border-style').value !== 'solid') return false;\n    // TODO ignoring 'border-cap', 'border-join' and 'border-position' for now\n    return true;\n  }\n}\nfunction arrayEqual(a1, a2) {\n  if (a1.length !== a2.length) {\n    return false;\n  }\n  for (var i = 0; i < a1.length; i++) {\n    if (a1[i] !== a2[i]) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Takes color & opacity style values and converts them to WebGL format. \n * Alpha is premultiplied.\n */\nfunction toWebGLColor(color, opacity, outArray) {\n  var r = color[0] / 255;\n  var g = color[1] / 255;\n  var b = color[2] / 255;\n  var a = opacity;\n  var arr = outArray || new Array(4);\n  arr[0] = r * a;\n  arr[1] = g * a;\n  arr[2] = b * a;\n  arr[3] = a;\n  return arr;\n}\nfunction indexToVec4(index, outArray) {\n  var arr = outArray || new Array(4);\n  arr[0] = (index >> 0 & 0xFF) / 0xFF;\n  arr[1] = (index >> 8 & 0xFF) / 0xFF;\n  arr[2] = (index >> 16 & 0xFF) / 0xFF;\n  arr[3] = (index >> 24 & 0xFF) / 0xFF;\n  return arr;\n}\nfunction vec4ToIndex(vec4) {\n  return vec4[0] + (vec4[1] << 8) + (vec4[2] << 16) + (vec4[3] << 24);\n}\nfunction createTexture(gl, debugID) {\n  var texture = gl.createTexture();\n  texture.buffer = function (offscreenCanvas) {\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);\n\n    // very important, this tells webgl to premultiply colors by the alpha channel\n    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, offscreenCanvas);\n    gl.generateMipmap(gl.TEXTURE_2D);\n    gl.bindTexture(gl.TEXTURE_2D, null);\n  };\n  texture.deleteTexture = function () {\n    gl.deleteTexture(texture);\n  };\n  return texture;\n}\nfunction getTypeInfo(gl, glslType) {\n  switch (glslType) {\n    case 'float':\n      return [1, gl.FLOAT, 4];\n    case 'vec2':\n      return [2, gl.FLOAT, 4];\n    case 'vec3':\n      return [3, gl.FLOAT, 4];\n    case 'vec4':\n      return [4, gl.FLOAT, 4];\n    case 'int':\n      return [1, gl.INT, 4];\n    case 'ivec2':\n      return [2, gl.INT, 4];\n  }\n}\nfunction createTypedArray(gl, glType, dataOrSize) {\n  switch (glType) {\n    case gl.FLOAT:\n      return new Float32Array(dataOrSize);\n    case gl.INT:\n      return new Int32Array(dataOrSize);\n  }\n}\nfunction createTypedArrayView(gl, glType, array, stride, size, i) {\n  switch (glType) {\n    case gl.FLOAT:\n      return new Float32Array(array.buffer, i * stride, size);\n    case gl.INT:\n      return new Int32Array(array.buffer, i * stride, size);\n  }\n}\n\n/** @param {WebGLRenderingContext} gl */\nfunction createBufferStaticDraw(gl, type, attributeLoc, dataArray) {\n  var _getTypeInfo = getTypeInfo(gl, type),\n    _getTypeInfo2 = _slicedToArray(_getTypeInfo, 2),\n    size = _getTypeInfo2[0],\n    glType = _getTypeInfo2[1];\n  var data = createTypedArray(gl, glType, dataArray);\n  var buffer = gl.createBuffer();\n  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n  gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n  if (glType === gl.FLOAT) {\n    gl.vertexAttribPointer(attributeLoc, size, glType, false, 0, 0);\n  } else if (glType === gl.INT) {\n    gl.vertexAttribIPointer(attributeLoc, size, glType, 0, 0);\n  }\n  gl.enableVertexAttribArray(attributeLoc);\n  gl.bindBuffer(gl.ARRAY_BUFFER, null);\n  return buffer;\n}\n\n/** \n * Creates a float buffer with gl.DYNAMIC_DRAW.\n * The returned buffer object contains functions to easily set instance data and buffer the data before a draw call.\n * @param {WebGLRenderingContext} gl \n */\nfunction createBufferDynamicDraw(gl, instances, type, attributeLoc) {\n  var _getTypeInfo3 = getTypeInfo(gl, type),\n    _getTypeInfo4 = _slicedToArray(_getTypeInfo3, 3),\n    size = _getTypeInfo4[0],\n    glType = _getTypeInfo4[1],\n    bytes = _getTypeInfo4[2];\n  var dataArray = createTypedArray(gl, glType, instances * size);\n  var stride = size * bytes;\n  var buffer = gl.createBuffer();\n  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n  gl.bufferData(gl.ARRAY_BUFFER, instances * stride, gl.DYNAMIC_DRAW);\n  gl.enableVertexAttribArray(attributeLoc);\n  if (glType === gl.FLOAT) {\n    gl.vertexAttribPointer(attributeLoc, size, glType, false, stride, 0);\n  } else if (glType === gl.INT) {\n    gl.vertexAttribIPointer(attributeLoc, size, glType, stride, 0);\n  }\n  gl.vertexAttribDivisor(attributeLoc, 1);\n  gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n  // use array views to set values directly into the buffer array\n  var views = new Array(instances);\n  for (var i = 0; i < instances; i++) {\n    views[i] = createTypedArrayView(gl, glType, dataArray, stride, size, i);\n  }\n  buffer.dataArray = dataArray;\n  buffer.stride = stride;\n  buffer.size = size;\n  buffer.getView = function (i) {\n    return views[i];\n  };\n  buffer.setPoint = function (i, x, y) {\n    var view = views[i];\n    view[0] = x;\n    view[1] = y;\n  };\n  buffer.bufferSubData = function (count) {\n    gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n    if (count) {\n      gl.bufferSubData(gl.ARRAY_BUFFER, 0, dataArray, 0, count * size);\n    } else {\n      gl.bufferSubData(gl.ARRAY_BUFFER, 0, dataArray);\n    }\n  };\n  return buffer;\n}\n\n/** \n * Creates a buffer of 3x3 matrix data for use as attribute data.\n * @param {WebGLRenderingContext} gl \n */\nfunction create3x3MatrixBufferDynamicDraw(gl, instances, attributeLoc) {\n  var matrixSize = 9; // 3x3 matrix\n  var matrixData = new Float32Array(instances * matrixSize);\n\n  // use matrix views to set values directly into the matrixData array\n  var matrixViews = new Array(instances);\n  for (var i = 0; i < instances; i++) {\n    var byteOffset = i * matrixSize * 4; // 4 bytes per float\n    matrixViews[i] = new Float32Array(matrixData.buffer, byteOffset, matrixSize); // array view\n  }\n  var buffer = gl.createBuffer();\n  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n  gl.bufferData(gl.ARRAY_BUFFER, matrixData.byteLength, gl.DYNAMIC_DRAW);\n\n  // each row of the matrix needs to be a separate attribute\n  for (var _i = 0; _i < 3; _i++) {\n    var loc = attributeLoc + _i;\n    gl.enableVertexAttribArray(loc);\n    gl.vertexAttribPointer(loc, 3, gl.FLOAT, false, 3 * 12, _i * 12);\n    gl.vertexAttribDivisor(loc, 1);\n  }\n  gl.bindBuffer(gl.ARRAY_BUFFER, null);\n  buffer.getMatrixView = function (i) {\n    return matrixViews[i];\n  };\n\n  // TODO this is too slow, use getMatrixView and pass the view directly to the glmatrix library\n  buffer.setData = function (matrix, i) {\n    matrixViews[i].set(matrix, 0);\n  };\n  buffer.bufferSubData = function () {\n    gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n    gl.bufferSubData(gl.ARRAY_BUFFER, 0, matrixData);\n  };\n  return buffer;\n}\n\n/** \n * Creates a Frame Buffer to use for offscreen rendering.\n * @param {WebGLRenderingContext} gl \n */\nfunction createPickingFrameBuffer(gl) {\n  // Create and bind the framebuffer\n  var fb = gl.createFramebuffer();\n  gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\n\n  // Create a texture to render to\n  var targetTexture = gl.createTexture();\n  gl.bindTexture(gl.TEXTURE_2D, targetTexture);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n  // attach the texture as the first color attachment\n  gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, targetTexture, 0);\n  gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n  fb.setFramebufferAttachmentSizes = function (width, height) {\n    gl.bindTexture(gl.TEXTURE_2D, targetTexture);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n  };\n  return fb;\n}\n\n/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nvar ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nif (!Math.hypot) Math.hypot = function () {\n  var y = 0,\n      i = arguments.length;\n\n  while (i--) {\n    y += arguments[i] * arguments[i];\n  }\n\n  return Math.sqrt(y);\n};\n\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\n\nfunction create() {\n  var out = new ARRAY_TYPE(9);\n\n  if (ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[5] = 0;\n    out[6] = 0;\n    out[7] = 0;\n  }\n\n  out[0] = 1;\n  out[4] = 1;\n  out[8] = 1;\n  return out;\n}\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\n\nfunction identity(out) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 1;\n  out[5] = 0;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 1;\n  return out;\n}\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nfunction multiply(out, a, b) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2];\n  var a10 = a[3],\n      a11 = a[4],\n      a12 = a[5];\n  var a20 = a[6],\n      a21 = a[7],\n      a22 = a[8];\n  var b00 = b[0],\n      b01 = b[1],\n      b02 = b[2];\n  var b10 = b[3],\n      b11 = b[4],\n      b12 = b[5];\n  var b20 = b[6],\n      b21 = b[7],\n      b22 = b[8];\n  out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n  out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n  out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n  out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n  out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n  out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n  out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n  out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n  out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n  return out;\n}\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to translate\n * @param {ReadonlyVec2} v vector to translate by\n * @returns {mat3} out\n */\n\nfunction translate(out, a, v) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a10 = a[3],\n      a11 = a[4],\n      a12 = a[5],\n      a20 = a[6],\n      a21 = a[7],\n      a22 = a[8],\n      x = v[0],\n      y = v[1];\n  out[0] = a00;\n  out[1] = a01;\n  out[2] = a02;\n  out[3] = a10;\n  out[4] = a11;\n  out[5] = a12;\n  out[6] = x * a00 + y * a10 + a20;\n  out[7] = x * a01 + y * a11 + a21;\n  out[8] = x * a02 + y * a12 + a22;\n  return out;\n}\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nfunction rotate(out, a, rad) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a10 = a[3],\n      a11 = a[4],\n      a12 = a[5],\n      a20 = a[6],\n      a21 = a[7],\n      a22 = a[8],\n      s = Math.sin(rad),\n      c = Math.cos(rad);\n  out[0] = c * a00 + s * a10;\n  out[1] = c * a01 + s * a11;\n  out[2] = c * a02 + s * a12;\n  out[3] = c * a10 - s * a00;\n  out[4] = c * a11 - s * a01;\n  out[5] = c * a12 - s * a02;\n  out[6] = a20;\n  out[7] = a21;\n  out[8] = a22;\n  return out;\n}\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\n\nfunction scale(out, a, v) {\n  var x = v[0],\n      y = v[1];\n  out[0] = x * a[0];\n  out[1] = x * a[1];\n  out[2] = x * a[2];\n  out[3] = y * a[3];\n  out[4] = y * a[4];\n  out[5] = y * a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  return out;\n}\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\n\nfunction projection(out, width, height) {\n  out[0] = 2 / width;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = -2 / height;\n  out[5] = 0;\n  out[6] = -1;\n  out[7] = 1;\n  out[8] = 1;\n  return out;\n}\n\n// A \"texture atlas\" is a big canvas, and sections of it are used as textures for nodes/labels.\n\n/**\n * A single square texture atlas (also known as a \"sprite sheet\").\n */\nvar Atlas = /*#__PURE__*/function () {\n  function Atlas(r, texSize, texRows, createTextureCanvas) {\n    _classCallCheck(this, Atlas);\n    this.debugID = Math.floor(Math.random() * 10000);\n    this.r = r;\n    this.texSize = texSize;\n    this.texRows = texRows;\n    this.texHeight = Math.floor(texSize / texRows);\n    this.enableWrapping = true; // hardcoded for now, can be made an option\n\n    this.locked = false; // once an atlas is locked it can no longer be drawn to\n    this.texture = null; // WebGLTexture object\n    this.needsBuffer = true;\n\n    // a \"location\" is an pointer into the atlas with a 'row' and 'x' fields\n    this.freePointer = {\n      x: 0,\n      row: 0\n    };\n\n    // map from the style key to the row/x where the texture starts\n    // if the texture wraps then there's a second location\n    this.keyToLocation = new Map(); // styleKey -> [ location, location ]\n\n    this.canvas = createTextureCanvas(r, texSize, texSize);\n    this.scratch = createTextureCanvas(r, texSize, this.texHeight, 'scratch');\n  }\n  return _createClass(Atlas, [{\n    key: \"lock\",\n    value: function lock() {\n      this.locked = true;\n    }\n  }, {\n    key: \"getKeys\",\n    value: function getKeys() {\n      return new Set(this.keyToLocation.keys());\n    }\n  }, {\n    key: \"getScale\",\n    value: function getScale(_ref) {\n      var w = _ref.w,\n        h = _ref.h;\n      var texHeight = this.texHeight,\n        maxTexWidth = this.texSize;\n      // try to fit to the height of a row\n      var scale = texHeight / h; // TODO what about pixelRatio?\n      var texW = w * scale;\n      var texH = h * scale;\n      // if the scaled width is too wide then scale to fit max width instead\n      if (texW > maxTexWidth) {\n        scale = maxTexWidth / w;\n        texW = w * scale;\n        texH = h * scale;\n      }\n      return {\n        scale: scale,\n        texW: texW,\n        texH: texH\n      };\n    }\n  }, {\n    key: \"draw\",\n    value: function draw(key, bb, doDrawing) {\n      var _this = this;\n      if (this.locked) throw new Error('can\\'t draw, atlas is locked');\n      var texSize = this.texSize,\n        texRows = this.texRows,\n        texHeight = this.texHeight;\n      var _this$getScale = this.getScale(bb),\n        scale = _this$getScale.scale,\n        texW = _this$getScale.texW,\n        texH = _this$getScale.texH;\n      var drawAt = function drawAt(location, canvas) {\n        if (doDrawing && canvas) {\n          var context = canvas.context;\n          var x = location.x,\n            row = location.row;\n          var xOffset = x;\n          var yOffset = texHeight * row;\n          context.save();\n          context.translate(xOffset, yOffset);\n          context.scale(scale, scale);\n          doDrawing(context, bb);\n          context.restore();\n        }\n      };\n      var locations = [null, null];\n      var drawNormal = function drawNormal() {\n        // don't need to wrap, draw directly on the canvas\n        drawAt(_this.freePointer, _this.canvas);\n        locations[0] = {\n          x: _this.freePointer.x,\n          y: _this.freePointer.row * texHeight,\n          w: texW,\n          h: texH\n        };\n        locations[1] = {\n          // create a second location with a width of 0, for convenience\n          x: _this.freePointer.x + texW,\n          y: _this.freePointer.row * texHeight,\n          w: 0,\n          h: texH\n        };\n\n        // move the pointer to the end of the texture\n        _this.freePointer.x += texW;\n        if (_this.freePointer.x == texSize) {\n          _this.freePointer.x = 0;\n          _this.freePointer.row++;\n        }\n      };\n      var drawWrapped = function drawWrapped() {\n        var scratch = _this.scratch,\n          canvas = _this.canvas;\n\n        // Draw to the scratch canvas\n        scratch.clear();\n        drawAt({\n          x: 0,\n          row: 0\n        }, scratch);\n        var firstTexW = texSize - _this.freePointer.x;\n        var secondTexW = texW - firstTexW;\n        var h = texHeight;\n        {\n          // copy first part of scratch to the first texture\n          var dx = _this.freePointer.x;\n          var dy = _this.freePointer.row * texHeight;\n          var w = firstTexW;\n          canvas.context.drawImage(scratch, 0, 0, w, h, dx, dy, w, h);\n          locations[0] = {\n            x: dx,\n            y: dy,\n            w: w,\n            h: texH\n          };\n        }\n        {\n          // copy second part of scratch to the second texture\n          var sx = firstTexW;\n          var _dy = (_this.freePointer.row + 1) * texHeight;\n          var _w = secondTexW;\n          if (canvas) {\n            canvas.context.drawImage(scratch, sx, 0, _w, h, 0, _dy, _w, h);\n          }\n          locations[1] = {\n            x: 0,\n            y: _dy,\n            w: _w,\n            h: texH\n          };\n        }\n        _this.freePointer.x = secondTexW;\n        _this.freePointer.row++;\n      };\n      var moveToStartOfNextRow = function moveToStartOfNextRow() {\n        _this.freePointer.x = 0;\n        _this.freePointer.row++;\n      };\n      if (this.freePointer.x + texW <= texSize) {\n        // There's enough space in the current row\n        drawNormal();\n      } else if (this.freePointer.row >= texRows - 1) {\n        // Need to move to the next row, but there are no more rows, atlas is full.\n        return false;\n      } else if (this.freePointer.x === texSize) {\n        // happen to be right at end of current row\n        moveToStartOfNextRow();\n        drawNormal();\n      } else if (this.enableWrapping) {\n        // draw part of the texture to the end of the curent row, then wrap to the next row\n        drawWrapped();\n      } else {\n        // move to the start of the next row, then draw normally\n        moveToStartOfNextRow();\n        drawNormal();\n      }\n      this.keyToLocation.set(key, locations);\n      this.needsBuffer = true;\n      return locations;\n    }\n  }, {\n    key: \"getOffsets\",\n    value: function getOffsets(key) {\n      return this.keyToLocation.get(key);\n    }\n  }, {\n    key: \"isEmpty\",\n    value: function isEmpty() {\n      return this.freePointer.x === 0 && this.freePointer.row === 0;\n    }\n  }, {\n    key: \"canFit\",\n    value: function canFit(bb) {\n      if (this.locked) return false;\n      var texSize = this.texSize,\n        texRows = this.texRows;\n      var _this$getScale2 = this.getScale(bb),\n        texW = _this$getScale2.texW;\n      if (this.freePointer.x + texW > texSize) {\n        // need to wrap\n        return this.freePointer.row < texRows - 1; // return true if there's a row to wrap to\n      }\n      return true;\n    }\n\n    // called on every frame\n  }, {\n    key: \"bufferIfNeeded\",\n    value: function bufferIfNeeded(gl) {\n      if (!this.texture) {\n        this.texture = createTexture(gl, this.debugID);\n      }\n      if (this.needsBuffer) {\n        this.texture.buffer(this.canvas);\n        this.needsBuffer = false;\n        if (this.locked) {\n          this.canvas = null;\n          this.scratch = null;\n        }\n      }\n    }\n  }, {\n    key: \"dispose\",\n    value: function dispose() {\n      if (this.texture) {\n        this.texture.deleteTexture();\n        this.texture = null;\n      }\n      this.canvas = null;\n      this.scratch = null;\n      this.locked = true;\n    }\n  }]);\n}();\n\n/**\n * A collection of texture atlases, all of the same \"render type\". \n * ('node-body' is an example of a render type.)\n * An AtlasCollection can also be notified when a texture is no longer needed, \n * and it can garbage collect the unused textures.\n */\nvar AtlasCollection = /*#__PURE__*/function () {\n  function AtlasCollection(r, texSize, texRows, createTextureCanvas) {\n    _classCallCheck(this, AtlasCollection);\n    this.r = r;\n    this.texSize = texSize;\n    this.texRows = texRows;\n    this.createTextureCanvas = createTextureCanvas;\n    this.atlases = [];\n    this.styleKeyToAtlas = new Map();\n    this.markedKeys = new Set(); // marked for garbage collection\n  }\n  return _createClass(AtlasCollection, [{\n    key: \"getKeys\",\n    value: function getKeys() {\n      return new Set(this.styleKeyToAtlas.keys());\n    }\n  }, {\n    key: \"_createAtlas\",\n    value: function _createAtlas() {\n      var r = this.r,\n        texSize = this.texSize,\n        texRows = this.texRows,\n        createTextureCanvas = this.createTextureCanvas;\n      return new Atlas(r, texSize, texRows, createTextureCanvas);\n    }\n  }, {\n    key: \"_getScratchCanvas\",\n    value: function _getScratchCanvas() {\n      if (!this.scratch) {\n        var r = this.r,\n          texSize = this.texSize,\n          texRows = this.texRows,\n          createTextureCanvas = this.createTextureCanvas;\n        var texHeight = Math.floor(texSize / texRows);\n        this.scratch = createTextureCanvas(r, texSize, texHeight, 'scratch');\n      }\n      return this.scratch;\n    }\n  }, {\n    key: \"draw\",\n    value: function draw(key, bb, doDrawing) {\n      var atlas = this.styleKeyToAtlas.get(key);\n      if (!atlas) {\n        // check for space at the end of the last atlas\n        atlas = this.atlases[this.atlases.length - 1];\n        if (!atlas || !atlas.canFit(bb)) {\n          if (atlas) atlas.lock();\n          // create a new atlas\n          atlas = this._createAtlas();\n          this.atlases.push(atlas);\n        }\n        atlas.draw(key, bb, doDrawing);\n        this.styleKeyToAtlas.set(key, atlas);\n      }\n      return atlas;\n    }\n  }, {\n    key: \"getAtlas\",\n    value: function getAtlas(key) {\n      return this.styleKeyToAtlas.get(key);\n    }\n  }, {\n    key: \"hasAtlas\",\n    value: function hasAtlas(key) {\n      return this.styleKeyToAtlas.has(key);\n    }\n  }, {\n    key: \"markKeyForGC\",\n    value: function markKeyForGC(key) {\n      this.markedKeys.add(key);\n    }\n  }, {\n    key: \"gc\",\n    value: function gc() {\n      var _this2 = this;\n      var markedKeys = this.markedKeys;\n      if (markedKeys.size === 0) {\n        console.log('nothing to garbage collect');\n        return;\n      }\n      var newAtlases = [];\n      var newStyleKeyToAtlas = new Map();\n      var newAtlas = null;\n      var _iterator = _createForOfIteratorHelper(this.atlases),\n        _step;\n      try {\n        var _loop = function _loop() {\n          var atlas = _step.value;\n          var keys = atlas.getKeys();\n          var keysToCollect = intersection(markedKeys, keys);\n          if (keysToCollect.size === 0) {\n            // this atlas can still be used\n            newAtlases.push(atlas);\n            keys.forEach(function (k) {\n              return newStyleKeyToAtlas.set(k, atlas);\n            });\n            return 1; // continue\n          }\n          if (!newAtlas) {\n            newAtlas = _this2._createAtlas();\n            newAtlases.push(newAtlas);\n          }\n          var _iterator2 = _createForOfIteratorHelper(keys),\n            _step2;\n          try {\n            for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n              var key = _step2.value;\n              if (!keysToCollect.has(key)) {\n                var _atlas$getOffsets = atlas.getOffsets(key),\n                  _atlas$getOffsets2 = _slicedToArray(_atlas$getOffsets, 2),\n                  s1 = _atlas$getOffsets2[0],\n                  s2 = _atlas$getOffsets2[1];\n                if (!newAtlas.canFit({\n                  w: s1.w + s2.w,\n                  h: s1.h\n                })) {\n                  newAtlas.lock();\n                  newAtlas = _this2._createAtlas();\n                  newAtlases.push(newAtlas);\n                }\n                if (atlas.canvas) {\n                  // if the texture can't be copied then it will have to be redrawn on the next frame\n                  _this2._copyTextureToNewAtlas(key, atlas, newAtlas);\n                  newStyleKeyToAtlas.set(key, newAtlas);\n                }\n              }\n            }\n          } catch (err) {\n            _iterator2.e(err);\n          } finally {\n            _iterator2.f();\n          }\n          atlas.dispose();\n        };\n        for (_iterator.s(); !(_step = _iterator.n()).done;) {\n          if (_loop()) continue;\n        }\n      } catch (err) {\n        _iterator.e(err);\n      } finally {\n        _iterator.f();\n      }\n      this.atlases = newAtlases;\n      this.styleKeyToAtlas = newStyleKeyToAtlas;\n      this.markedKeys = new Set();\n    }\n  }, {\n    key: \"_copyTextureToNewAtlas\",\n    value: function _copyTextureToNewAtlas(key, oldAtlas, newAtlas) {\n      var _oldAtlas$getOffsets = oldAtlas.getOffsets(key),\n        _oldAtlas$getOffsets2 = _slicedToArray(_oldAtlas$getOffsets, 2),\n        s1 = _oldAtlas$getOffsets2[0],\n        s2 = _oldAtlas$getOffsets2[1];\n      if (s2.w === 0) {\n        // the texture does not wrap, draw directly to new atlas\n        newAtlas.draw(key, s1, function (context) {\n          context.drawImage(oldAtlas.canvas, s1.x, s1.y, s1.w, s1.h, 0, 0, s1.w, s1.h);\n        });\n      } else {\n        // the texture wraps, first draw both parts to a scratch canvas\n        var scratch = this._getScratchCanvas();\n        scratch.clear();\n        scratch.context.drawImage(oldAtlas.canvas, s1.x, s1.y, s1.w, s1.h, 0, 0, s1.w, s1.h);\n        scratch.context.drawImage(oldAtlas.canvas, s2.x, s2.y, s2.w, s2.h, s1.w, 0, s2.w, s2.h);\n\n        // now draw the scratch to the new atlas\n        var w = s1.w + s2.w;\n        var h = s1.h;\n        newAtlas.draw(key, {\n          w: w,\n          h: h\n        }, function (context) {\n          context.drawImage(scratch, 0, 0, w, h, 0, 0, w, h // the destination context has already been translated to the correct position\n          );\n        });\n      }\n    }\n  }, {\n    key: \"getCounts\",\n    value: function getCounts() {\n      return {\n        keyCount: this.styleKeyToAtlas.size,\n        atlasCount: new Set(this.styleKeyToAtlas.values()).size\n      };\n    }\n  }]);\n}();\nfunction intersection(set1, set2) {\n  // TODO why no Set.intersection in node 16???\n  if (set1.intersection) return set1.intersection(set2);else return new Set(_toConsumableArray(set1).filter(function (x) {\n    return set2.has(x);\n  }));\n}\n\n/**\n * Used to manage batches of Atlases for drawing nodes and labels.\n * Supports different types of AtlasCollections for different render types,\n * for example 'node-body' and 'node-label' would be different render types.\n * Render types are kept separate because they will likely need to be garbage collected\n * separately and its not entierly guaranteed that their style keys won't collide.\n */\nvar AtlasManager = /*#__PURE__*/function () {\n  function AtlasManager(r, globalOptions) {\n    _classCallCheck(this, AtlasManager);\n    this.r = r;\n    this.globalOptions = globalOptions;\n    this.atlasSize = globalOptions.webglTexSize;\n    this.maxAtlasesPerBatch = globalOptions.webglTexPerBatch;\n    this.renderTypes = new Map(); // renderType:string -> renderTypeOptions\n    this.collections = new Map(); // collectionName:string -> AtlasCollection\n\n    this.typeAndIdToKey = new Map(); // [renderType,id] => Array<style key>\n  }\n  return _createClass(AtlasManager, [{\n    key: \"getAtlasSize\",\n    value: function getAtlasSize() {\n      return this.atlasSize;\n    }\n  }, {\n    key: \"addAtlasCollection\",\n    value: function addAtlasCollection(collectionName, atlasCollectionOptions) {\n      var _this$globalOptions = this.globalOptions,\n        webglTexSize = _this$globalOptions.webglTexSize,\n        createTextureCanvas = _this$globalOptions.createTextureCanvas;\n      var texRows = atlasCollectionOptions.texRows;\n      var cachedCreateTextureCanvas = this._cacheScratchCanvas(createTextureCanvas);\n      var atlasCollection = new AtlasCollection(this.r, webglTexSize, texRows, cachedCreateTextureCanvas);\n      this.collections.set(collectionName, atlasCollection);\n    }\n  }, {\n    key: \"addRenderType\",\n    value: function addRenderType(type, renderTypeOptions) {\n      var collection = renderTypeOptions.collection;\n      if (!this.collections.has(collection)) throw new Error(\"invalid atlas collection name '\".concat(collection, \"'\"));\n      var atlasCollection = this.collections.get(collection);\n      var opts = extend({\n        type: type,\n        atlasCollection: atlasCollection\n      }, renderTypeOptions);\n      this.renderTypes.set(type, opts);\n    }\n  }, {\n    key: \"getRenderTypeOpts\",\n    value: function getRenderTypeOpts(type) {\n      return this.renderTypes.get(type);\n    }\n  }, {\n    key: \"getAtlasCollection\",\n    value: function getAtlasCollection(name) {\n      return this.collections.get(name);\n    }\n  }, {\n    key: \"_cacheScratchCanvas\",\n    value: function _cacheScratchCanvas(createTextureCanvas) {\n      // all scratch canvases for the same render type will have the same width and height (ie webglTexRows option)\n      // but we'll keep track of the width and height just to be safe\n      var prevW = -1;\n      var prevH = -1;\n      var scratchCanvas = null;\n      return function (r, w, h, scratch) {\n        if (scratch) {\n          if (!scratchCanvas || w != prevW || h != prevH) {\n            prevW = w;\n            prevH = h;\n            scratchCanvas = createTextureCanvas(r, w, h);\n          }\n          return scratchCanvas;\n        } else {\n          return createTextureCanvas(r, w, h);\n        }\n      };\n    }\n  }, {\n    key: \"_key\",\n    value: function _key(renderType, id) {\n      return \"\".concat(renderType, \"-\").concat(id); // TODO not very efficient\n    }\n\n    /** Marks textues associated with the element for garbage collection. */\n  }, {\n    key: \"invalidate\",\n    value: function invalidate(eles) {\n      var _this3 = this;\n      var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n        _ref2$forceRedraw = _ref2.forceRedraw,\n        forceRedraw = _ref2$forceRedraw === undefined ? false : _ref2$forceRedraw,\n        _ref2$filterEle = _ref2.filterEle,\n        filterEle = _ref2$filterEle === undefined ? function () {\n          return true;\n        } : _ref2$filterEle,\n        _ref2$filterType = _ref2.filterType,\n        filterType = _ref2$filterType === undefined ? function () {\n          return true;\n        } : _ref2$filterType;\n      var needGC = false;\n      var runGCNow = false;\n      var _iterator3 = _createForOfIteratorHelper(eles),\n        _step3;\n      try {\n        for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n          var ele = _step3.value;\n          if (filterEle(ele)) {\n            var _iterator4 = _createForOfIteratorHelper(this.renderTypes.values()),\n              _step4;\n            try {\n              var _loop2 = function _loop2() {\n                var opts = _step4.value;\n                var renderType = opts.type;\n                if (filterType(renderType)) {\n                  var atlasCollection = _this3.collections.get(opts.collection);\n                  var key = opts.getKey(ele);\n                  var keyArray = Array.isArray(key) ? key : [key];\n\n                  // when a node's background image finishes loading, the style key doesn't change but still needs to be redrawn\n                  if (forceRedraw) {\n                    keyArray.forEach(function (key) {\n                      return atlasCollection.markKeyForGC(key);\n                    });\n                    runGCNow = true; // run GC to remove the old texture right now, that way we don't need to remember for the next gc \n                  } else {\n                    var id = opts.getID ? opts.getID(ele) : ele.id();\n                    var mapKey = _this3._key(renderType, id);\n                    var oldKeyArray = _this3.typeAndIdToKey.get(mapKey);\n                    if (oldKeyArray !== undefined && !arrayEqual(keyArray, oldKeyArray)) {\n                      // conservative approach, if any of the keys don't match then throw them all away\n                      needGC = true;\n                      _this3.typeAndIdToKey[\"delete\"](mapKey);\n                      oldKeyArray.forEach(function (oldKey) {\n                        return atlasCollection.markKeyForGC(oldKey);\n                      });\n                    }\n                  }\n                }\n              };\n              for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n                _loop2();\n              }\n            } catch (err) {\n              _iterator4.e(err);\n            } finally {\n              _iterator4.f();\n            }\n          }\n        }\n      } catch (err) {\n        _iterator3.e(err);\n      } finally {\n        _iterator3.f();\n      }\n      if (runGCNow) {\n        this.gc();\n        needGC = false;\n      }\n      return needGC;\n    }\n\n    /** Garbage collect */\n  }, {\n    key: \"gc\",\n    value: function gc() {\n      var _iterator5 = _createForOfIteratorHelper(this.collections.values()),\n        _step5;\n      try {\n        for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n          var collection = _step5.value;\n          collection.gc();\n        }\n      } catch (err) {\n        _iterator5.e(err);\n      } finally {\n        _iterator5.f();\n      }\n    }\n  }, {\n    key: \"getOrCreateAtlas\",\n    value: function getOrCreateAtlas(ele, type, bb, styleKey) {\n      // styleKey is not an array here\n      var opts = this.renderTypes.get(type);\n      var atlasCollection = this.collections.get(opts.collection);\n\n      // draws the texture only if needed\n      var drawn = false;\n      var atlas = atlasCollection.draw(styleKey, bb, function (context) {\n        if (opts.drawClipped) {\n          context.save();\n          context.beginPath();\n          context.rect(0, 0, bb.w, bb.h);\n          context.clip();\n          opts.drawElement(context, ele, bb, true, true);\n          context.restore();\n        } else {\n          opts.drawElement(context, ele, bb, true, true);\n        }\n        drawn = true;\n      });\n      if (drawn) {\n        var id = opts.getID ? opts.getID(ele) : ele.id(); // for testing\n        var mapKey = this._key(type, id);\n        if (this.typeAndIdToKey.has(mapKey)) {\n          this.typeAndIdToKey.get(mapKey).push(styleKey);\n        } else {\n          this.typeAndIdToKey.set(mapKey, [styleKey]);\n        }\n      }\n      return atlas;\n    }\n  }, {\n    key: \"getAtlasInfo\",\n    value: function getAtlasInfo(ele, type) {\n      var _this4 = this;\n      var opts = this.renderTypes.get(type);\n      var key = opts.getKey(ele);\n      var keyArray = Array.isArray(key) ? key : [key];\n      return keyArray.map(function (styleKey) {\n        var bb = opts.getBoundingBox(ele, styleKey); // pass the key back to the getBoundingBox method\n        var atlas = _this4.getOrCreateAtlas(ele, type, bb, styleKey);\n        var _atlas$getOffsets3 = atlas.getOffsets(styleKey),\n          _atlas$getOffsets4 = _slicedToArray(_atlas$getOffsets3, 2),\n          tex1 = _atlas$getOffsets4[0],\n          tex2 = _atlas$getOffsets4[1];\n        return {\n          atlas: atlas,\n          tex: tex1,\n          tex1: tex1,\n          tex2: tex2,\n          bb: bb\n        };\n      });\n    }\n  }, {\n    key: \"getDebugInfo\",\n    value: function getDebugInfo() {\n      var debugInfo = [];\n      var _iterator6 = _createForOfIteratorHelper(this.collections),\n        _step6;\n      try {\n        for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n          var _step6$value = _slicedToArray(_step6.value, 2),\n            name = _step6$value[0],\n            collection = _step6$value[1];\n          var _collection$getCounts = collection.getCounts(),\n            keyCount = _collection$getCounts.keyCount,\n            atlasCount = _collection$getCounts.atlasCount;\n          debugInfo.push({\n            type: name,\n            keyCount: keyCount,\n            atlasCount: atlasCount\n          });\n        }\n      } catch (err) {\n        _iterator6.e(err);\n      } finally {\n        _iterator6.f();\n      }\n      return debugInfo;\n    }\n  }]);\n}();\nvar AtlasBatchManager = /*#__PURE__*/function () {\n  function AtlasBatchManager(globalOptions) {\n    _classCallCheck(this, AtlasBatchManager);\n    this.globalOptions = globalOptions;\n    this.atlasSize = globalOptions.webglTexSize;\n    this.maxAtlasesPerBatch = globalOptions.webglTexPerBatch;\n    this.batchAtlases = [];\n  }\n  return _createClass(AtlasBatchManager, [{\n    key: \"getMaxAtlasesPerBatch\",\n    value: function getMaxAtlasesPerBatch() {\n      return this.maxAtlasesPerBatch;\n    }\n  }, {\n    key: \"getAtlasSize\",\n    value: function getAtlasSize() {\n      return this.atlasSize;\n    }\n  }, {\n    key: \"getIndexArray\",\n    value: function getIndexArray() {\n      return Array.from({\n        length: this.maxAtlasesPerBatch\n      }, function (v, i) {\n        return i;\n      });\n    }\n  }, {\n    key: \"startBatch\",\n    value: function startBatch() {\n      this.batchAtlases = [];\n    }\n  }, {\n    key: \"getAtlasCount\",\n    value: function getAtlasCount() {\n      return this.batchAtlases.length;\n    }\n  }, {\n    key: \"getAtlases\",\n    value: function getAtlases() {\n      return this.batchAtlases;\n    }\n  }, {\n    key: \"canAddToCurrentBatch\",\n    value: function canAddToCurrentBatch(atlas) {\n      if (this.batchAtlases.length === this.maxAtlasesPerBatch) {\n        return this.batchAtlases.includes(atlas);\n      }\n      return true; // not full\n    }\n  }, {\n    key: \"getAtlasIndexForBatch\",\n    value: function getAtlasIndexForBatch(atlas) {\n      var atlasID = this.batchAtlases.indexOf(atlas);\n      if (atlasID < 0) {\n        if (this.batchAtlases.length === this.maxAtlasesPerBatch) {\n          throw new Error('cannot add more atlases to batch');\n        }\n        this.batchAtlases.push(atlas);\n        atlasID = this.batchAtlases.length - 1;\n      }\n      return atlasID;\n    }\n  }]);\n}();\n\n// Fragment shader functions to calculate signed distance\n// https://iquilezles.org/articles/distfunctions2d/\n// ellipse: https://www.shadertoy.com/view/4lsXDN \n\n/**\n * param p - point\n * float r - circle radius, eg 0.5 for unit circle\n */\nvar circleSD = \"\\n  float circleSD(vec2 p, float r) {\\n    return distance(vec2(0), p) - r; // signed distance\\n  }\\n\";\n\n/**\n * param p - point\n * param b - b.x = half width, b.y = half height\n */\nvar rectangleSD = \"\\n  float rectangleSD(vec2 p, vec2 b) {\\n    vec2 d = abs(p)-b;\\n    return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);\\n  }\\n\";\n\n/**\n * param p - point\n * param b - b.x = half width, b.y = half height\n * param cr - vector of corner radiuses\n */\nvar roundRectangleSD = \"\\n  float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {\\n    cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;\\n    cr.x  = (p.y > 0.0) ? cr.x  : cr.y;\\n    vec2 q = abs(p) - b + cr.x;\\n    return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;\\n  }\\n\";\n\n/**\n * param p - point\n * param ab - a.x = horizontal radius, a.y = vertical radius\n */\nvar ellipseSD = \"\\n  float ellipseSD(vec2 p, vec2 ab) {\\n    p = abs( p ); // symmetry\\n\\n    // find root with Newton solver\\n    vec2 q = ab*(p-ab);\\n    float w = (q.x<q.y)? 1.570796327 : 0.0;\\n    for( int i=0; i<5; i++ ) {\\n      vec2 cs = vec2(cos(w),sin(w));\\n      vec2 u = ab*vec2( cs.x,cs.y);\\n      vec2 v = ab*vec2(-cs.y,cs.x);\\n      w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));\\n    }\\n    \\n    // compute final point and distance\\n    float d = length(p-ab*vec2(cos(w),sin(w)));\\n    \\n    // return signed distance\\n    return (dot(p/ab,p/ab)>1.0) ? d : -d;\\n  }\\n\";\n\n/**\n * Two render modes. Each mode has its own shader program. They are almost identical, the main difference is the output.\n * SCREEN:  output pixel colors to the screen\n * PICKING: output z-order index to an offscreen framebuffer, used to detect what's under the mouse cursor\n */\nvar RENDER_TARGET = {\n  SCREEN: {\n    name: 'screen',\n    screen: true\n  },\n  PICKING: {\n    name: 'picking',\n    picking: true\n  }\n};\n\n/**\n * Special handing for label textures in PICKING mode. See issue #3337.\n */\nvar TEX_PICKING_MODE = {\n  // render the texture just like in RENDER_TARGET.SCREEN mode\n  IGNORE: 1,\n  // don't render the texture at all\n  USE_BB: 2 // render the bounding box as an opaque rectangle\n};\n\n// Vertex types.\n// Used directly in the shaders so must be numeric.\n// There is only one shader program used for an entire frame that renders all types of elements.\n// There are if-else blocks in the shaders that do different things depending on the vertex type.\n// This allows all elements to be rendererd in large batches without switching shader programs.\nvar TEXTURE = 0;\nvar EDGE_STRAIGHT = 1;\nvar EDGE_CURVE_SEGMENT = 2;\nvar EDGE_ARROW = 3;\nvar RECTANGLE = 4;\nvar ROUND_RECTANGLE = 5;\nvar BOTTOM_ROUND_RECTANGLE = 6;\nvar ELLIPSE = 7;\nvar ElementDrawingWebGL = /*#__PURE__*/function () {\n  /**\n   * @param {WebGLRenderingContext} gl\n   */\n  function ElementDrawingWebGL(r, gl, opts) {\n    _classCallCheck(this, ElementDrawingWebGL);\n    this.r = r; // reference to the canvas renderer\n    this.gl = gl;\n    this.maxInstances = opts.webglBatchSize;\n    this.atlasSize = opts.webglTexSize;\n    this.bgColor = opts.bgColor;\n    this.debug = opts.webglDebug;\n    this.batchDebugInfo = [];\n    opts.enableWrapping = true;\n    opts.createTextureCanvas = createTextureCanvas; // Unit tests mock this\n\n    this.atlasManager = new AtlasManager(r, opts);\n    this.batchManager = new AtlasBatchManager(opts);\n    this.simpleShapeOptions = new Map();\n    this.program = this._createShaderProgram(RENDER_TARGET.SCREEN);\n    this.pickingProgram = this._createShaderProgram(RENDER_TARGET.PICKING);\n    this.vao = this._createVAO();\n  }\n\n  /**\n   * @param { string } collectionName\n   * @param {{ texRows: number }} opts\n   */\n  return _createClass(ElementDrawingWebGL, [{\n    key: \"addAtlasCollection\",\n    value: function addAtlasCollection(collectionName, opts) {\n      this.atlasManager.addAtlasCollection(collectionName, opts);\n    }\n\n    /**\n     * @typedef { Object } TextureRenderTypeOpts\n     * @property { string } collection - name of atlas collection to render textures to\n     * @property { function } getKey - returns the \"style key\" for an element, may be a single value or an array for multi-line lables\n     * @property { function } drawElement - uses a canvas renderer to draw the element to the texture atlas\n     * @property { boolean  } drawClipped - if true the context will be clipped to the bounding box before drawElement() is called, may affect performance\n     * @property { function } getBoundingBox - returns the bounding box for an element\n     * @property { function } getRotation\n     * @property { function } getRotationPoint\n     * @property { function } getRotationOffset\n     * @property { function } isVisible - an extra check for visibility in addition to ele.visible()\n     * @property { function } getTexPickingMode - returns a value from the TEX_PICKING_MODE enum\n     */\n    /**\n     * @param { string } typeName\n     * @param { TextureRenderTypeOpts } opts\n     */\n  }, {\n    key: \"addTextureAtlasRenderType\",\n    value: function addTextureAtlasRenderType(typeName, opts) {\n      this.atlasManager.addRenderType(typeName, opts);\n    }\n\n    /**\n     * @typedef { Object } SimpleShapeRenderTypeOpts\n     * @property { function } getBoundingBox - returns the bounding box for an element\n     * @property { function } isVisible - this is an extra check for visibility in addition to ele.visible()\n     * @property { function } isSimple - check if element is a simple shape, or if it needs to fall back to texture rendering\n     * @property { ShapeVisualProperties } shapeProps\n     */\n    /**\n     * @typedef { Object } ShapeVisualProperties\n     * @property { string } shape\n     * @property { string } color\n     * @property { string } opacity\n     * @property { string } padding\n     * @property { string } radius\n     * @property { boolean } border\n    */\n    /**\n     * @param { string } typeName\n     * @param { SimpleShapeRenderTypeOpts } opts\n     */\n  }, {\n    key: \"addSimpleShapeRenderType\",\n    value: function addSimpleShapeRenderType(typeName, opts) {\n      this.simpleShapeOptions.set(typeName, opts);\n    }\n\n    /**\n     * Inform the atlasManager when element style keys may have changed.\n     * The atlasManager can then mark unused textures for \"garbage collection\".\n     */\n  }, {\n    key: \"invalidate\",\n    value: function invalidate(eles) {\n      var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n        type = _ref.type;\n      var atlasManager = this.atlasManager;\n      if (type) {\n        return atlasManager.invalidate(eles, {\n          filterType: function filterType(t) {\n            return t === type;\n          },\n          forceRedraw: true\n        });\n      } else {\n        return atlasManager.invalidate(eles);\n      }\n    }\n\n    /**\n     * Run texture garbage collection.\n     */\n  }, {\n    key: \"gc\",\n    value: function gc() {\n      this.atlasManager.gc();\n    }\n  }, {\n    key: \"_createShaderProgram\",\n    value: function _createShaderProgram(renderTarget) {\n      var gl = this.gl;\n      var vertexShaderSource = \"#version 300 es\\n      precision highp float;\\n\\n      uniform mat3 uPanZoomMatrix;\\n      uniform int  uAtlasSize;\\n      \\n      // instanced\\n      in vec2 aPosition; // a vertex from the unit square\\n      \\n      in mat3 aTransform; // used to transform verticies, eg into a bounding box\\n      in int aVertType; // the type of thing we are rendering\\n\\n      // the z-index that is output when using picking mode\\n      in vec4 aIndex;\\n      \\n      // For textures\\n      in int aAtlasId; // which shader unit/atlas to use\\n      in vec4 aTex; // x/y/w/h of texture in atlas\\n\\n      // for edges\\n      in vec4 aPointAPointB;\\n      in vec4 aPointCPointD;\\n      in vec2 aLineWidth; // also used for node border width\\n\\n      // simple shapes\\n      in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]\\n      in vec4 aColor; // also used for edges\\n      in vec4 aBorderColor; // aLineWidth is used for border width\\n\\n      // output values passed to the fragment shader\\n      out vec2 vTexCoord;\\n      out vec4 vColor;\\n      out vec2 vPosition;\\n      // flat values are not interpolated\\n      flat out int vAtlasId; \\n      flat out int vVertType;\\n      flat out vec2 vTopRight;\\n      flat out vec2 vBotLeft;\\n      flat out vec4 vCornerRadius;\\n      flat out vec4 vBorderColor;\\n      flat out vec2 vBorderWidth;\\n      flat out vec4 vIndex;\\n      \\n      void main(void) {\\n        int vid = gl_VertexID;\\n        vec2 position = aPosition; // TODO make this a vec3, simplifies some code below\\n\\n        if(aVertType == \".concat(TEXTURE, \") {\\n          float texX = aTex.x; // texture coordinates\\n          float texY = aTex.y;\\n          float texW = aTex.z;\\n          float texH = aTex.w;\\n\\n          if(vid == 1 || vid == 2 || vid == 4) {\\n            texX += texW;\\n          }\\n          if(vid == 2 || vid == 4 || vid == 5) {\\n            texY += texH;\\n          }\\n\\n          float d = float(uAtlasSize);\\n          vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\\n\\n          gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\\n        }\\n        else if(aVertType == \").concat(RECTANGLE, \" || aVertType == \").concat(ELLIPSE, \" \\n             || aVertType == \").concat(ROUND_RECTANGLE, \" || aVertType == \").concat(BOTTOM_ROUND_RECTANGLE, \") { // simple shapes\\n\\n          // the bounding box is needed by the fragment shader\\n          vBotLeft  = (aTransform * vec3(0, 0, 1)).xy; // flat\\n          vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat\\n          vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated\\n\\n          // calculations are done in the fragment shader, just pass these along\\n          vColor = aColor;\\n          vCornerRadius = aCornerRadius;\\n          vBorderColor = aBorderColor;\\n          vBorderWidth = aLineWidth;\\n\\n          gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\\n        }\\n        else if(aVertType == \").concat(EDGE_STRAIGHT, \") {\\n          vec2 source = aPointAPointB.xy;\\n          vec2 target = aPointAPointB.zw;\\n\\n          // adjust the geometry so that the line is centered on the edge\\n          position.y = position.y - 0.5;\\n\\n          // stretch the unit square into a long skinny rectangle\\n          vec2 xBasis = target - source;\\n          vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\\n          vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;\\n\\n          gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\\n          vColor = aColor;\\n        } \\n        else if(aVertType == \").concat(EDGE_CURVE_SEGMENT, \") {\\n          vec2 pointA = aPointAPointB.xy;\\n          vec2 pointB = aPointAPointB.zw;\\n          vec2 pointC = aPointCPointD.xy;\\n          vec2 pointD = aPointCPointD.zw;\\n\\n          // adjust the geometry so that the line is centered on the edge\\n          position.y = position.y - 0.5;\\n\\n          vec2 p0, p1, p2, pos;\\n          if(position.x == 0.0) { // The left side of the unit square\\n            p0 = pointA;\\n            p1 = pointB;\\n            p2 = pointC;\\n            pos = position;\\n          } else { // The right side of the unit square, use same approach but flip the geometry upside down\\n            p0 = pointD;\\n            p1 = pointC;\\n            p2 = pointB;\\n            pos = vec2(0.0, -position.y);\\n          }\\n\\n          vec2 p01 = p1 - p0;\\n          vec2 p12 = p2 - p1;\\n          vec2 p21 = p1 - p2;\\n\\n          // Find the normal vector.\\n          vec2 tangent = normalize(normalize(p12) + normalize(p01));\\n          vec2 normal = vec2(-tangent.y, tangent.x);\\n\\n          // Find the vector perpendicular to p0 -> p1.\\n          vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\\n\\n          // Determine the bend direction.\\n          float sigma = sign(dot(p01 + p21, normal));\\n          float width = aLineWidth[0];\\n\\n          if(sign(pos.y) == -sigma) {\\n            // This is an intersecting vertex. Adjust the position so that there's no overlap.\\n            vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\\n            gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\\n          } else {\\n            // This is a non-intersecting vertex. Treat it like a mitre join.\\n            vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\\n            gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\\n          }\\n\\n          vColor = aColor;\\n        } \\n        else if(aVertType == \").concat(EDGE_ARROW, \" && vid < 3) {\\n          // massage the first triangle into an edge arrow\\n          if(vid == 0)\\n            position = vec2(-0.15, -0.3);\\n          if(vid == 1)\\n            position = vec2(  0.0,  0.0);\\n          if(vid == 2)\\n            position = vec2( 0.15, -0.3);\\n\\n          gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\\n          vColor = aColor;\\n        }\\n        else {\\n          gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\\n        }\\n\\n        vAtlasId = aAtlasId;\\n        vVertType = aVertType;\\n        vIndex = aIndex;\\n      }\\n    \");\n      var idxs = this.batchManager.getIndexArray();\n      var fragmentShaderSource = \"#version 300 es\\n      precision highp float;\\n\\n      // declare texture unit for each texture atlas in the batch\\n      \".concat(idxs.map(function (i) {\n        return \"uniform sampler2D uTexture\".concat(i, \";\");\n      }).join('\\n\\t'), \"\\n\\n      uniform vec4 uBGColor;\\n      uniform float uZoom;\\n\\n      in vec2 vTexCoord;\\n      in vec4 vColor;\\n      in vec2 vPosition; // model coordinates\\n\\n      flat in int vAtlasId;\\n      flat in vec4 vIndex;\\n      flat in int vVertType;\\n      flat in vec2 vTopRight;\\n      flat in vec2 vBotLeft;\\n      flat in vec4 vCornerRadius;\\n      flat in vec4 vBorderColor;\\n      flat in vec2 vBorderWidth;\\n\\n      out vec4 outColor;\\n\\n      \").concat(circleSD, \"\\n      \").concat(rectangleSD, \"\\n      \").concat(roundRectangleSD, \"\\n      \").concat(ellipseSD, \"\\n\\n      vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha\\n        return vec4( \\n          top.rgb + (bot.rgb * (1.0 - top.a)),\\n          top.a   + (bot.a   * (1.0 - top.a)) \\n        );\\n      }\\n\\n      vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance\\n        // scale to the zoom level so that borders don't look blurry when zoomed in\\n        // note 1.5 is an aribitrary value chosen because it looks good\\n        return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); \\n      }\\n\\n      void main(void) {\\n        if(vVertType == \").concat(TEXTURE, \") {\\n          // look up the texel from the texture unit\\n          \").concat(idxs.map(function (i) {\n        return \"if(vAtlasId == \".concat(i, \") outColor = texture(uTexture\").concat(i, \", vTexCoord);\");\n      }).join('\\n\\telse '), \"\\n        } \\n        else if(vVertType == \").concat(EDGE_ARROW, \") {\\n          // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';\\n          outColor = blend(vColor, uBGColor);\\n          outColor.a = 1.0; // make opaque, masks out line under arrow\\n        }\\n        else if(vVertType == \").concat(RECTANGLE, \" && vBorderWidth == vec2(0.0)) { // simple rectangle with no border\\n          outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done\\n        }\\n        else if(vVertType == \").concat(RECTANGLE, \" || vVertType == \").concat(ELLIPSE, \" \\n          || vVertType == \").concat(ROUND_RECTANGLE, \" || vVertType == \").concat(BOTTOM_ROUND_RECTANGLE, \") { // use SDF\\n\\n          float outerBorder = vBorderWidth[0];\\n          float innerBorder = vBorderWidth[1];\\n          float borderPadding = outerBorder * 2.0;\\n          float w = vTopRight.x - vBotLeft.x - borderPadding;\\n          float h = vTopRight.y - vBotLeft.y - borderPadding;\\n          vec2 b = vec2(w/2.0, h/2.0); // half width, half height\\n          vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center\\n\\n          float d; // signed distance\\n          if(vVertType == \").concat(RECTANGLE, \") {\\n            d = rectangleSD(p, b);\\n          } else if(vVertType == \").concat(ELLIPSE, \" && w == h) {\\n            d = circleSD(p, b.x); // faster than ellipse\\n          } else if(vVertType == \").concat(ELLIPSE, \") {\\n            d = ellipseSD(p, b);\\n          } else {\\n            d = roundRectangleSD(p, b, vCornerRadius.wzyx);\\n          }\\n\\n          // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling\\n          // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box\\n          if(d > 0.0) {\\n            if(d > outerBorder) {\\n              discard;\\n            } else {\\n              outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);\\n            }\\n          } else {\\n            if(d > innerBorder) {\\n              vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;\\n              vec4 innerBorderColor = blend(vBorderColor, vColor);\\n              outColor = distInterp(innerBorderColor, outerColor, d);\\n            } \\n            else {\\n              vec4 outerColor;\\n              if(innerBorder == 0.0 && outerBorder == 0.0) {\\n                outerColor = vec4(0);\\n              } else if(innerBorder == 0.0) {\\n                outerColor = vBorderColor;\\n              } else {\\n                outerColor = blend(vBorderColor, vColor);\\n              }\\n              outColor = distInterp(vColor, outerColor, d - innerBorder);\\n            }\\n          }\\n        }\\n        else {\\n          outColor = vColor;\\n        }\\n\\n        \").concat(renderTarget.picking ? \"if(outColor.a == 0.0) discard;\\n             else outColor = vIndex;\" : '', \"\\n      }\\n    \");\n      var program = createProgram(gl, vertexShaderSource, fragmentShaderSource);\n\n      // instance geometry\n      program.aPosition = gl.getAttribLocation(program, 'aPosition');\n\n      // attributes\n      program.aIndex = gl.getAttribLocation(program, 'aIndex');\n      program.aVertType = gl.getAttribLocation(program, 'aVertType');\n      program.aTransform = gl.getAttribLocation(program, 'aTransform');\n      program.aAtlasId = gl.getAttribLocation(program, 'aAtlasId');\n      program.aTex = gl.getAttribLocation(program, 'aTex');\n      program.aPointAPointB = gl.getAttribLocation(program, 'aPointAPointB');\n      program.aPointCPointD = gl.getAttribLocation(program, 'aPointCPointD');\n      program.aLineWidth = gl.getAttribLocation(program, 'aLineWidth');\n      program.aColor = gl.getAttribLocation(program, 'aColor');\n      program.aCornerRadius = gl.getAttribLocation(program, 'aCornerRadius');\n      program.aBorderColor = gl.getAttribLocation(program, 'aBorderColor');\n\n      // uniforms\n      program.uPanZoomMatrix = gl.getUniformLocation(program, 'uPanZoomMatrix');\n      program.uAtlasSize = gl.getUniformLocation(program, 'uAtlasSize');\n      program.uBGColor = gl.getUniformLocation(program, 'uBGColor');\n      program.uZoom = gl.getUniformLocation(program, 'uZoom');\n      program.uTextures = [];\n      for (var i = 0; i < this.batchManager.getMaxAtlasesPerBatch(); i++) {\n        program.uTextures.push(gl.getUniformLocation(program, \"uTexture\".concat(i)));\n      }\n      return program;\n    }\n  }, {\n    key: \"_createVAO\",\n    value: function _createVAO() {\n      var unitSquare = [0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1];\n      this.vertexCount = unitSquare.length / 2;\n      var n = this.maxInstances;\n      var gl = this.gl,\n        program = this.program;\n      var vao = gl.createVertexArray();\n      gl.bindVertexArray(vao);\n      createBufferStaticDraw(gl, 'vec2', program.aPosition, unitSquare);\n\n      // Create buffers for all the attributes\n      this.transformBuffer = create3x3MatrixBufferDynamicDraw(gl, n, program.aTransform);\n      this.indexBuffer = createBufferDynamicDraw(gl, n, 'vec4', program.aIndex);\n      this.vertTypeBuffer = createBufferDynamicDraw(gl, n, 'int', program.aVertType);\n      this.atlasIdBuffer = createBufferDynamicDraw(gl, n, 'int', program.aAtlasId);\n      this.texBuffer = createBufferDynamicDraw(gl, n, 'vec4', program.aTex);\n      this.pointAPointBBuffer = createBufferDynamicDraw(gl, n, 'vec4', program.aPointAPointB);\n      this.pointCPointDBuffer = createBufferDynamicDraw(gl, n, 'vec4', program.aPointCPointD);\n      this.lineWidthBuffer = createBufferDynamicDraw(gl, n, 'vec2', program.aLineWidth);\n      this.colorBuffer = createBufferDynamicDraw(gl, n, 'vec4', program.aColor);\n      this.cornerRadiusBuffer = createBufferDynamicDraw(gl, n, 'vec4', program.aCornerRadius);\n      this.borderColorBuffer = createBufferDynamicDraw(gl, n, 'vec4', program.aBorderColor);\n      gl.bindVertexArray(null);\n      return vao;\n    }\n  }, {\n    key: \"buffers\",\n    get: function get() {\n      var _this = this;\n      if (!this._buffers) {\n        this._buffers = Object.keys(this).filter(function (k) {\n          return endsWith(k, 'Buffer');\n        }).map(function (k) {\n          return _this[k];\n        });\n      }\n      return this._buffers;\n    }\n  }, {\n    key: \"startFrame\",\n    value: function startFrame(panZoomMatrix) {\n      var renderTarget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RENDER_TARGET.SCREEN;\n      this.panZoomMatrix = panZoomMatrix;\n      this.renderTarget = renderTarget;\n      this.batchDebugInfo = [];\n      this.wrappedCount = 0;\n      this.simpleCount = 0;\n      this.startBatch();\n    }\n  }, {\n    key: \"startBatch\",\n    value: function startBatch() {\n      this.instanceCount = 0;\n      this.batchManager.startBatch();\n    }\n  }, {\n    key: \"endFrame\",\n    value: function endFrame() {\n      this.endBatch();\n    }\n  }, {\n    key: \"_isVisible\",\n    value: function _isVisible(ele, opts) {\n      if (ele.visible()) {\n        if (opts && opts.isVisible) {\n          return opts.isVisible(ele);\n        }\n        return true;\n      }\n      return false;\n    }\n\n    /**\n     * Draws a texture using the texture atlas.\n     */\n  }, {\n    key: \"drawTexture\",\n    value: function drawTexture(ele, eleIndex, type) {\n      var atlasManager = this.atlasManager,\n        batchManager = this.batchManager;\n      var opts = atlasManager.getRenderTypeOpts(type);\n      if (!this._isVisible(ele, opts)) {\n        return;\n      }\n\n      // Edges with invalid points could be passed here (labels), causing errors\n      // Ref: Random \"Script Error\" thrown when generating nodes and edges in newest webgl version #3365\n      // https://github.com/cytoscape/cytoscape.js/issues/3365\n      if (ele.isEdge() && !this._isValidEdge(ele)) {\n        return;\n      }\n      if (this.renderTarget.picking && opts.getTexPickingMode) {\n        var mode = opts.getTexPickingMode(ele);\n        if (mode === TEX_PICKING_MODE.IGNORE) {\n          return;\n        } else if (mode == TEX_PICKING_MODE.USE_BB) {\n          this.drawPickingRectangle(ele, eleIndex, type);\n          return;\n        }\n      }\n\n      // Get the atlas and the texture coordinates, will draw the texture if it hasn't been drawn yet\n      // May be more than one texture if for example the label has multiple lines\n      var atlasInfoArray = atlasManager.getAtlasInfo(ele, type);\n      var _iterator = _createForOfIteratorHelper(atlasInfoArray),\n        _step;\n      try {\n        for (_iterator.s(); !(_step = _iterator.n()).done;) {\n          var atlasInfo = _step.value;\n          var atlas = atlasInfo.atlas,\n            tex1 = atlasInfo.tex1,\n            tex2 = atlasInfo.tex2; // tex2 is used if the label wraps and there are two textures\n\n          if (!batchManager.canAddToCurrentBatch(atlas)) {\n            this.endBatch();\n          }\n          var atlasIndex = batchManager.getAtlasIndexForBatch(atlas);\n          for (var _i = 0, _arr = [[tex1, true], [tex2, false]]; _i < _arr.length; _i++) {\n            var _arr$_i = _slicedToArray(_arr[_i], 2),\n              tex = _arr$_i[0],\n              first = _arr$_i[1];\n            if (tex.w != 0) {\n              var instance = this.instanceCount;\n              this.vertTypeBuffer.getView(instance)[0] = TEXTURE;\n              var indexView = this.indexBuffer.getView(instance);\n              indexToVec4(eleIndex, indexView);\n\n              // Set values in the buffers using Typed Array Views for performance.\n              var atlasIdView = this.atlasIdBuffer.getView(instance);\n              atlasIdView[0] = atlasIndex;\n\n              // we have two sets of texture coordinates and transforms because textures can wrap in the atlas\n              var texView = this.texBuffer.getView(instance);\n              texView[0] = tex.x;\n              texView[1] = tex.y;\n              texView[2] = tex.w;\n              texView[3] = tex.h;\n              var matrixView = this.transformBuffer.getMatrixView(instance);\n              this.setTransformMatrix(ele, matrixView, opts, atlasInfo, first);\n              this.instanceCount++;\n              if (!first) this.wrappedCount++;\n              if (this.instanceCount >= this.maxInstances) {\n                this.endBatch();\n              }\n            }\n          }\n        }\n      } catch (err) {\n        _iterator.e(err);\n      } finally {\n        _iterator.f();\n      }\n    }\n\n    /**\n     * matrix is expected to be a 9 element array\n     * this function follows same pattern as CRp.drawCachedElementPortion(...)\n     */\n  }, {\n    key: \"setTransformMatrix\",\n    value: function setTransformMatrix(ele, matrix, opts, atlasInfo) {\n      var first = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n      var padding = 0;\n      if (opts.shapeProps && opts.shapeProps.padding) {\n        padding = ele.pstyle(opts.shapeProps.padding).pfValue;\n      }\n      if (atlasInfo) {\n        // we've already computed the bb and tex bounds for a texture\n        var bb = atlasInfo.bb,\n          tex1 = atlasInfo.tex1,\n          tex2 = atlasInfo.tex2;\n        // wrapped textures need separate matrix for each part\n        var ratio = tex1.w / (tex1.w + tex2.w);\n        if (!first) {\n          // first = true means its the first part of the wrapped texture\n          ratio = 1 - ratio;\n        }\n        var adjBB = this._getAdjustedBB(bb, padding, first, ratio);\n        this._applyTransformMatrix(matrix, adjBB, opts, ele);\n      } else {\n        // we don't have a texture, or we want to avoid creating a texture for simple shapes\n        var _bb = opts.getBoundingBox(ele);\n        var _adjBB = this._getAdjustedBB(_bb, padding, true, 1);\n        this._applyTransformMatrix(matrix, _adjBB, opts, ele);\n      }\n    }\n  }, {\n    key: \"_applyTransformMatrix\",\n    value: function _applyTransformMatrix(matrix, adjBB, opts, ele) {\n      var x, y;\n      identity(matrix);\n      var theta = opts.getRotation ? opts.getRotation(ele) : 0;\n      if (theta !== 0) {\n        var _opts$getRotationPoin = opts.getRotationPoint(ele),\n          sx = _opts$getRotationPoin.x,\n          sy = _opts$getRotationPoin.y;\n        translate(matrix, matrix, [sx, sy]);\n        rotate(matrix, matrix, theta);\n        var offset = opts.getRotationOffset(ele);\n        x = offset.x + (adjBB.xOffset || 0);\n        y = offset.y + (adjBB.yOffset || 0);\n      } else {\n        x = adjBB.x1;\n        y = adjBB.y1;\n      }\n      translate(matrix, matrix, [x, y]);\n      scale(matrix, matrix, [adjBB.w, adjBB.h]);\n    }\n\n    /**\n     * Adjusts a node or label BB to accomodate padding and split for wrapped textures.\n     * @param bb - the original bounding box\n     * @param padding - the padding to add to the bounding box\n     * @param first - whether this is the first part of a wrapped texture\n     * @param ratio - the ratio of the texture width of part of the text to the entire texture\n     */\n  }, {\n    key: \"_getAdjustedBB\",\n    value: function _getAdjustedBB(bb, padding, first, ratio) {\n      var x1 = bb.x1,\n        y1 = bb.y1,\n        w = bb.w,\n        h = bb.h,\n        yOffset = bb.yOffset;\n      if (padding) {\n        x1 -= padding;\n        y1 -= padding;\n        w += 2 * padding;\n        h += 2 * padding;\n      }\n      var xOffset = 0;\n      var adjW = w * ratio;\n      if (first && ratio < 1) {\n        w = adjW;\n      } else if (!first && ratio < 1) {\n        xOffset = w - adjW;\n        x1 += xOffset;\n        w = adjW;\n      }\n      return {\n        x1: x1,\n        y1: y1,\n        w: w,\n        h: h,\n        xOffset: xOffset,\n        yOffset: yOffset\n      };\n    }\n\n    /**\n     * Draw a solid opaque rectangle matching the element's Bounding Box.\n     * Used by the PICKING mode to make the entire BB of a label clickable.\n     */\n  }, {\n    key: \"drawPickingRectangle\",\n    value: function drawPickingRectangle(ele, eleIndex, type) {\n      var opts = this.atlasManager.getRenderTypeOpts(type);\n      var instance = this.instanceCount;\n      this.vertTypeBuffer.getView(instance)[0] = RECTANGLE;\n      var indexView = this.indexBuffer.getView(instance);\n      indexToVec4(eleIndex, indexView);\n      var colorView = this.colorBuffer.getView(instance);\n      toWebGLColor([0, 0, 0], 1, colorView); // opaque, so entire label BB is clickable\n\n      var matrixView = this.transformBuffer.getMatrixView(instance);\n      this.setTransformMatrix(ele, matrixView, opts);\n      this.simpleCount++;\n      this.instanceCount++;\n      if (this.instanceCount >= this.maxInstances) {\n        this.endBatch();\n      }\n    }\n\n    /**\n     * Draw a node using either a texture or a \"simple shape\".\n     */\n  }, {\n    key: \"drawNode\",\n    value: function drawNode(node, eleIndex, type) {\n      var opts = this.simpleShapeOptions.get(type);\n      if (!this._isVisible(node, opts)) {\n        return;\n      }\n      var props = opts.shapeProps;\n\n      // Check if we have to use a texture\n      var vertType = this._getVertTypeForShape(node, props.shape);\n      if (vertType === undefined || opts.isSimple && !opts.isSimple(node, this.renderTarget)) {\n        this.drawTexture(node, eleIndex, type);\n        return;\n      }\n\n      // Render a \"simple shape\" using SDF (signed distance fields)\n      var instance = this.instanceCount;\n      this.vertTypeBuffer.getView(instance)[0] = vertType;\n      if (vertType === ROUND_RECTANGLE || vertType === BOTTOM_ROUND_RECTANGLE) {\n        // get corner radius\n        var bb = opts.getBoundingBox(node);\n        var radius = this._getCornerRadius(node, props.radius, bb);\n        var radiusView = this.cornerRadiusBuffer.getView(instance);\n        radiusView[0] = radius; // top-right\n        radiusView[1] = radius; // bottom-right\n        radiusView[2] = radius; // top-left\n        radiusView[3] = radius; // bottom-left\n        if (vertType === BOTTOM_ROUND_RECTANGLE) {\n          radiusView[0] = 0;\n          radiusView[2] = 0;\n        }\n      }\n      var indexView = this.indexBuffer.getView(instance);\n      indexToVec4(eleIndex, indexView);\n\n      // Nodes should still be clickable if they pass the visibility check but\n      // have background-opacity: 0\n      // Also: everything but node-body is exempt from effective opacity inheritence/stacking\n      var opacity = this.renderTarget.picking ? 1 : type === 'node-body' ? node.effectiveOpacity() : 1;\n      var bgOpacity = this.renderTarget.picking ? 1 : node.pstyle(props.opacity).value * opacity;\n      var color = node.pstyle(props.color).value;\n      var colorView = this.colorBuffer.getView(instance);\n      toWebGLColor(color, bgOpacity, colorView);\n      var lineWidthView = this.lineWidthBuffer.getView(instance); // reuse edge line width attribute for node border\n      lineWidthView[0] = 0;\n      lineWidthView[1] = 0;\n      if (props.border) {\n        var borderWidth = node.pstyle('border-width').value;\n        if (borderWidth > 0) {\n          var borderColor = node.pstyle('border-color').value;\n          var borderOpacity = opacity * node.pstyle('border-opacity').value;\n          var borderColorView = this.borderColorBuffer.getView(instance);\n          toWebGLColor(borderColor, borderOpacity, borderColorView);\n\n          // SDF distance is negative inside the shape and positive outside\n          var borderPos = node.pstyle('border-position').value;\n          if (borderPos === 'inside') {\n            lineWidthView[0] = 0;\n            lineWidthView[1] = -borderWidth;\n          } else if (borderPos === 'outside') {\n            lineWidthView[0] = borderWidth;\n            lineWidthView[1] = 0;\n          } else {\n            // 'center'\n            var halfWidth = borderWidth / 2;\n            lineWidthView[0] = halfWidth;\n            lineWidthView[1] = -halfWidth;\n          }\n        }\n      }\n      var matrixView = this.transformBuffer.getMatrixView(instance);\n      this.setTransformMatrix(node, matrixView, opts);\n      this.simpleCount++;\n      this.instanceCount++;\n      if (this.instanceCount >= this.maxInstances) {\n        this.endBatch();\n      }\n    }\n  }, {\n    key: \"_getVertTypeForShape\",\n    value: function _getVertTypeForShape(node, shapeProp) {\n      var shape = node.pstyle(shapeProp).value;\n      switch (shape) {\n        case 'rectangle':\n          return RECTANGLE;\n        case 'ellipse':\n          return ELLIPSE;\n        case 'roundrectangle':\n        case 'round-rectangle':\n          return ROUND_RECTANGLE;\n        case 'bottom-round-rectangle':\n          return BOTTOM_ROUND_RECTANGLE;\n        default:\n          return undefined;\n      }\n    }\n  }, {\n    key: \"_getCornerRadius\",\n    value: function _getCornerRadius(node, radiusProp, _ref2) {\n      var w = _ref2.w,\n        h = _ref2.h;\n      // see CRp.drawRoundRectanglePath\n      if (node.pstyle(radiusProp).value === 'auto') {\n        return getRoundRectangleRadius(w, h);\n      } else {\n        var radius = node.pstyle(radiusProp).pfValue;\n        var halfWidth = w / 2;\n        var halfHeight = h / 2;\n        return Math.min(radius, halfHeight, halfWidth);\n      }\n    }\n\n    /**\n     * Only supports drawing triangles at the moment.\n     */\n  }, {\n    key: \"drawEdgeArrow\",\n    value: function drawEdgeArrow(edge, eleIndex, prefix) {\n      if (!edge.visible()) {\n        return;\n      }\n      // Edge points and arrow angles etc are calculated by the base renderer and cached in the rscratch object.\n      var rs = edge._private.rscratch;\n      var x, y, angle;\n      if (prefix === 'source') {\n        x = rs.arrowStartX;\n        y = rs.arrowStartY;\n        angle = rs.srcArrowAngle;\n      } else {\n        x = rs.arrowEndX;\n        y = rs.arrowEndY;\n        angle = rs.tgtArrowAngle;\n      }\n\n      // taken from CRp.drawArrowhead\n      if (isNaN(x) || x == null || isNaN(y) || y == null || isNaN(angle) || angle == null) {\n        return;\n      }\n\n      // check shape after the x/y check because pstyle() is a bit slow\n      var arrowShape = edge.pstyle(prefix + '-arrow-shape').value;\n      if (arrowShape === 'none') {\n        return;\n      }\n      var color = edge.pstyle(prefix + '-arrow-color').value;\n      var baseOpacity = edge.pstyle('opacity').value;\n      var lineOpacity = edge.pstyle('line-opacity').value;\n      var opacity = baseOpacity * lineOpacity;\n      var lineWidth = edge.pstyle('width').pfValue;\n      var scale$1 = edge.pstyle('arrow-scale').value;\n      var size = this.r.getArrowWidth(lineWidth, scale$1);\n      var instance = this.instanceCount;\n      var transform = this.transformBuffer.getMatrixView(instance);\n      identity(transform);\n      translate(transform, transform, [x, y]);\n      scale(transform, transform, [size, size]);\n      rotate(transform, transform, angle);\n      this.vertTypeBuffer.getView(instance)[0] = EDGE_ARROW;\n      var indexView = this.indexBuffer.getView(instance);\n      indexToVec4(eleIndex, indexView);\n      var colorView = this.colorBuffer.getView(instance);\n      toWebGLColor(color, opacity, colorView);\n      this.instanceCount++;\n      if (this.instanceCount >= this.maxInstances) {\n        this.endBatch();\n      }\n    }\n\n    /**\n     * Draw straight-line or bezier curve edges.\n     */\n  }, {\n    key: \"drawEdgeLine\",\n    value: function drawEdgeLine(edge, eleIndex) {\n      if (!edge.visible()) {\n        return;\n      }\n      var points = this._getEdgePoints(edge);\n      if (!points) {\n        return;\n      }\n\n      // line style\n      var baseOpacity = edge.pstyle('opacity').value;\n      var lineOpacity = edge.pstyle('line-opacity').value;\n      var width = edge.pstyle('width').pfValue;\n      var color = edge.pstyle('line-color').value;\n      var opacity = baseOpacity * lineOpacity;\n      if (points.length / 2 + this.instanceCount > this.maxInstances) {\n        this.endBatch();\n      }\n      if (points.length == 4) {\n        // straight line\n        var instance = this.instanceCount;\n        this.vertTypeBuffer.getView(instance)[0] = EDGE_STRAIGHT;\n        var indexView = this.indexBuffer.getView(instance);\n        indexToVec4(eleIndex, indexView);\n        var colorView = this.colorBuffer.getView(instance);\n        toWebGLColor(color, opacity, colorView);\n        var lineWidthBuffer = this.lineWidthBuffer.getView(instance);\n        lineWidthBuffer[0] = width;\n        var sourceTargetView = this.pointAPointBBuffer.getView(instance);\n        sourceTargetView[0] = points[0]; // source x\n        sourceTargetView[1] = points[1]; // source y\n        sourceTargetView[2] = points[2]; // target x\n        sourceTargetView[3] = points[3]; // target y\n\n        this.instanceCount++;\n        if (this.instanceCount >= this.maxInstances) {\n          this.endBatch();\n        }\n      } else {\n        // curved line\n        for (var i = 0; i < points.length - 2; i += 2) {\n          var _instance = this.instanceCount;\n          this.vertTypeBuffer.getView(_instance)[0] = EDGE_CURVE_SEGMENT;\n          var _indexView = this.indexBuffer.getView(_instance);\n          indexToVec4(eleIndex, _indexView);\n          var _colorView = this.colorBuffer.getView(_instance);\n          toWebGLColor(color, opacity, _colorView);\n          var _lineWidthBuffer = this.lineWidthBuffer.getView(_instance);\n          _lineWidthBuffer[0] = width;\n          var pAx = points[i - 2],\n            pAy = points[i - 1];\n          var pBx = points[i],\n            pBy = points[i + 1];\n          var pCx = points[i + 2],\n            pCy = points[i + 3];\n          var pDx = points[i + 4],\n            pDy = points[i + 5];\n\n          // make phantom points for the first and last segments\n          // TODO adding 0.001 to avoid division by zero in the shader (I think), need a better solution\n          if (i == 0) {\n            pAx = 2 * pBx - pCx + 0.001;\n            pAy = 2 * pBy - pCy + 0.001;\n          }\n          if (i == points.length - 4) {\n            pDx = 2 * pCx - pBx + 0.001;\n            pDy = 2 * pCy - pBy + 0.001;\n          }\n          var pointABView = this.pointAPointBBuffer.getView(_instance);\n          pointABView[0] = pAx;\n          pointABView[1] = pAy;\n          pointABView[2] = pBx;\n          pointABView[3] = pBy;\n          var pointCDView = this.pointCPointDBuffer.getView(_instance);\n          pointCDView[0] = pCx;\n          pointCDView[1] = pCy;\n          pointCDView[2] = pDx;\n          pointCDView[3] = pDy;\n          this.instanceCount++;\n          if (this.instanceCount >= this.maxInstances) {\n            this.endBatch();\n          }\n        }\n      }\n    }\n  }, {\n    key: \"_isValidEdge\",\n    value: function _isValidEdge(edge) {\n      var rs = edge._private.rscratch;\n      if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) {\n        // isNaN in case edge is impossible and browser bugs (e.g. safari)\n        return false;\n      }\n      return true;\n    }\n  }, {\n    key: \"_getEdgePoints\",\n    value: function _getEdgePoints(edge) {\n      var rs = edge._private.rscratch;\n\n      // if bezier ctrl pts can not be calculated, then die\n      if (!this._isValidEdge(edge)) {\n        // isNaN in case edge is impossible and browser bugs (e.g. safari)\n        return;\n      }\n      var controlPoints = rs.allpts;\n      if (controlPoints.length == 4) {\n        return controlPoints;\n      }\n      var numSegments = this._getNumSegments(edge);\n      return this._getCurveSegmentPoints(controlPoints, numSegments);\n    }\n  }, {\n    key: \"_getNumSegments\",\n    value: function _getNumSegments(edge) {\n      // TODO Need a heuristic that decides how many segments to use. Factors to consider:\n      // - edge width/length\n      // - edge curvature (the more the curvature, the more segments)\n      // - zoom level (more segments when zoomed in)\n      // - number of visible edges (more segments when there are fewer edges)\n      // - performance (fewer segments when performance is a concern)\n      // - user configurable option(s)\n      // note: number of segments must be less than the max number of instances\n      // note: segments don't need to be evenly spaced out, it might make sense to have shorter segments nearer to the control points\n      var numSegments = 15;\n      return Math.min(Math.max(numSegments, 5), this.maxInstances);\n    }\n  }, {\n    key: \"_getCurveSegmentPoints\",\n    value: function _getCurveSegmentPoints(controlPoints, segments) {\n      if (controlPoints.length == 4) {\n        return controlPoints; // straight line\n      }\n      var curvePoints = Array((segments + 1) * 2);\n      for (var i = 0; i <= segments; i++) {\n        // the first and last points are the same as the first and last control points\n        if (i == 0) {\n          curvePoints[0] = controlPoints[0];\n          curvePoints[1] = controlPoints[1];\n        } else if (i == segments) {\n          curvePoints[i * 2] = controlPoints[controlPoints.length - 2];\n          curvePoints[i * 2 + 1] = controlPoints[controlPoints.length - 1];\n        } else {\n          var t = i / segments; // segments have equal length, its not strictly necessary to do it this way\n          // pass in curvePoints to set the values in the array directly\n          this._setCurvePoint(controlPoints, t, curvePoints, i * 2);\n        }\n      }\n      return curvePoints;\n    }\n  }, {\n    key: \"_setCurvePoint\",\n    value: function _setCurvePoint(points, t, curvePoints, cpi) {\n      if (points.length <= 2) {\n        curvePoints[cpi] = points[0];\n        curvePoints[cpi + 1] = points[1];\n      } else {\n        var newpoints = Array(points.length - 2);\n        for (var i = 0; i < newpoints.length; i += 2) {\n          var x = (1 - t) * points[i] + t * points[i + 2];\n          var y = (1 - t) * points[i + 1] + t * points[i + 3];\n          newpoints[i] = x;\n          newpoints[i + 1] = y;\n        }\n        return this._setCurvePoint(newpoints, t, curvePoints, cpi);\n      }\n    }\n  }, {\n    key: \"endBatch\",\n    value: function endBatch() {\n      var gl = this.gl,\n        vao = this.vao,\n        vertexCount = this.vertexCount,\n        count = this.instanceCount;\n      if (count === 0) return;\n      var program = this.renderTarget.picking ? this.pickingProgram : this.program;\n      gl.useProgram(program);\n      gl.bindVertexArray(vao);\n\n      // buffer the attribute data\n      var _iterator2 = _createForOfIteratorHelper(this.buffers),\n        _step2;\n      try {\n        for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n          var buffer = _step2.value;\n          buffer.bufferSubData(count);\n        }\n      } catch (err) {\n        _iterator2.e(err);\n      } finally {\n        _iterator2.f();\n      }\n      var atlases = this.batchManager.getAtlases();\n      // must buffer before activating texture units\n      for (var i = 0; i < atlases.length; i++) {\n        atlases[i].bufferIfNeeded(gl);\n      }\n      // Activate all the texture units that we need\n      for (var _i2 = 0; _i2 < atlases.length; _i2++) {\n        gl.activeTexture(gl.TEXTURE0 + _i2);\n        gl.bindTexture(gl.TEXTURE_2D, atlases[_i2].texture);\n        gl.uniform1i(program.uTextures[_i2], _i2);\n      }\n\n      // Set the uniforms\n      gl.uniform1f(program.uZoom, getEffectiveZoom(this.r));\n      gl.uniformMatrix3fv(program.uPanZoomMatrix, false, this.panZoomMatrix);\n      gl.uniform1i(program.uAtlasSize, this.batchManager.getAtlasSize());\n      // set background color, needed for edge arrow color blending\n      var webglBgColor = toWebGLColor(this.bgColor, 1);\n      gl.uniform4fv(program.uBGColor, webglBgColor);\n\n      // draw!\n      gl.drawArraysInstanced(gl.TRIANGLES, 0, vertexCount, count);\n      gl.bindVertexArray(null);\n      gl.bindTexture(gl.TEXTURE_2D, null); // TODO is this right when having multiple texture units?\n\n      if (this.debug) {\n        this.batchDebugInfo.push({\n          count: count,\n          // instance count\n          atlasCount: atlases.length\n        });\n      }\n\n      // start the next batch, even if not needed\n      this.startBatch();\n    }\n  }, {\n    key: \"getDebugInfo\",\n    value: function getDebugInfo() {\n      var atlasInfo = this.atlasManager.getDebugInfo();\n      var totalAtlases = atlasInfo.reduce(function (count, info) {\n        return count + info.atlasCount;\n      }, 0);\n      var batchInfo = this.batchDebugInfo;\n      var totalInstances = batchInfo.reduce(function (count, info) {\n        return count + info.count;\n      }, 0);\n      return {\n        atlasInfo: atlasInfo,\n        totalAtlases: totalAtlases,\n        wrappedCount: this.wrappedCount,\n        simpleCount: this.simpleCount,\n        batchCount: batchInfo.length,\n        batchInfo: batchInfo,\n        totalInstances: totalInstances\n      };\n    }\n  }]);\n}();\n\nvar CRp$4 = {};\n\n/**\n * Initialize the WebGL rendering mode after the Canvas renderer has been initialized.\n */\nCRp$4.initWebgl = function (opts, fns) {\n  var r = this;\n  var gl = r.data.contexts[r.WEBGL];\n\n  // Set defaults and limits for configuration options.\n  opts.bgColor = getBGColor(r);\n  opts.webglTexSize = Math.min(opts.webglTexSize, gl.getParameter(gl.MAX_TEXTURE_SIZE));\n  opts.webglTexRows = Math.min(opts.webglTexRows, 54);\n  opts.webglTexRowsNodes = Math.min(opts.webglTexRowsNodes, 54);\n  opts.webglBatchSize = Math.min(opts.webglBatchSize, 16384);\n  opts.webglTexPerBatch = Math.min(opts.webglTexPerBatch, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n\n  // Turn debug mode on or off.\n  r.webglDebug = opts.webglDebug;\n  r.webglDebugShowAtlases = opts.webglDebugShowAtlases;\n\n  // Create offscreen framebuffer that stores the results when RENDER_TARGET.PICKING is enabled.\n  // This is used to store the topmost element z-index for each pixel, which is used to tell whats under the mouse cursor point.\n  r.pickingFrameBuffer = createPickingFrameBuffer(gl);\n  r.pickingFrameBuffer.needsDraw = true;\n\n  // Create an ElementDrawingWebGL instance wich is used to do the actual WebGL rendering.\n  // This instance needs to be configured to draw various types of elements.\n  r.drawing = new ElementDrawingWebGL(r, gl, opts);\n\n  // Some functions that are used to configure ElementDrawingWebGL\n  var getLabelRotation = function getLabelRotation(prop) {\n    return function (ele) {\n      return r.getTextAngle(ele, prop);\n    };\n  };\n  var isLabelVisible = function isLabelVisible(prop) {\n    return function (ele) {\n      var label = ele.pstyle(prop);\n      return label && label.value;\n    };\n  };\n  var isLayerVisible = function isLayerVisible(prefix) {\n    return function (node) {\n      // prefix is 'overlay' or 'underlay'\n      return node.pstyle(\"\".concat(prefix, \"-opacity\")).value > 0;\n    };\n  };\n  var getTexPickingMode = function getTexPickingMode(ele) {\n    // tells when a label should be clickable\n    var enabled = ele.pstyle('text-events').strValue === 'yes';\n    return enabled ? TEX_PICKING_MODE.USE_BB : TEX_PICKING_MODE.IGNORE;\n  };\n  var getBBForSimpleShape = function getBBForSimpleShape(node) {\n    // \"simple\" shapes need their BB to include border and padding\n    var _node$position = node.position(),\n      x = _node$position.x,\n      y = _node$position.y;\n    var w = node.outerWidth(); // includes border and padding\n    var h = node.outerHeight();\n    return {\n      w: w,\n      h: h,\n      x1: x - w / 2,\n      y1: y - h / 2\n    };\n  };\n\n  // An AtlasCollection is a collection of Atlases that have the same configuraiton options.\n  // Create one for node bodies and one for all types of labels.\n  r.drawing.addAtlasCollection('node', {\n    texRows: opts.webglTexRowsNodes\n  });\n  r.drawing.addAtlasCollection('label', {\n    texRows: opts.webglTexRows\n  });\n\n  // Configure the different types of elements that can be rendered.\n\n  // Node bodies can be rendered as textures or as \"simple shapes\". \n  // Simple shapes are preferred because they do not use texture memory.\n  // Textures are required if the node body uses complex styles. \n  r.drawing.addTextureAtlasRenderType('node-body', {\n    collection: 'node',\n    getKey: fns.getStyleKey,\n    getBoundingBox: fns.getElementBox,\n    drawElement: fns.drawElement\n  });\n  r.drawing.addSimpleShapeRenderType('node-body', {\n    getBoundingBox: getBBForSimpleShape,\n    isSimple: isSimpleShape,\n    shapeProps: {\n      shape: 'shape',\n      color: 'background-color',\n      opacity: 'background-opacity',\n      radius: 'corner-radius',\n      border: true\n    }\n  });\n  r.drawing.addSimpleShapeRenderType('node-overlay', {\n    getBoundingBox: getBBForSimpleShape,\n    isVisible: isLayerVisible('overlay'),\n    shapeProps: {\n      shape: 'overlay-shape',\n      color: 'overlay-color',\n      opacity: 'overlay-opacity',\n      padding: 'overlay-padding',\n      radius: 'overlay-corner-radius'\n    }\n  });\n  r.drawing.addSimpleShapeRenderType('node-underlay', {\n    getBoundingBox: getBBForSimpleShape,\n    isVisible: isLayerVisible('underlay'),\n    shapeProps: {\n      shape: 'underlay-shape',\n      color: 'underlay-color',\n      opacity: 'underlay-opacity',\n      padding: 'underlay-padding',\n      radius: 'underlay-corner-radius'\n    }\n  });\n  r.drawing.addTextureAtlasRenderType('label', {\n    // node label or edge mid label\n    collection: 'label',\n    getTexPickingMode: getTexPickingMode,\n    getKey: getStyleKeysForLabel(fns.getLabelKey, null),\n    getBoundingBox: getBoundingBoxForLabel(fns.getLabelBox, null),\n    drawClipped: true,\n    drawElement: fns.drawLabel,\n    getRotation: getLabelRotation(null),\n    getRotationPoint: fns.getLabelRotationPoint,\n    getRotationOffset: fns.getLabelRotationOffset,\n    isVisible: isLabelVisible('label')\n  });\n  r.drawing.addTextureAtlasRenderType('edge-source-label', {\n    collection: 'label',\n    getTexPickingMode: getTexPickingMode,\n    getKey: getStyleKeysForLabel(fns.getSourceLabelKey, 'source'),\n    getBoundingBox: getBoundingBoxForLabel(fns.getSourceLabelBox, 'source'),\n    drawClipped: true,\n    drawElement: fns.drawSourceLabel,\n    getRotation: getLabelRotation('source'),\n    getRotationPoint: fns.getSourceLabelRotationPoint,\n    getRotationOffset: fns.getSourceLabelRotationOffset,\n    isVisible: isLabelVisible('source-label')\n  });\n  r.drawing.addTextureAtlasRenderType('edge-target-label', {\n    collection: 'label',\n    getTexPickingMode: getTexPickingMode,\n    getKey: getStyleKeysForLabel(fns.getTargetLabelKey, 'target'),\n    getBoundingBox: getBoundingBoxForLabel(fns.getTargetLabelBox, 'target'),\n    drawClipped: true,\n    drawElement: fns.drawTargetLabel,\n    getRotation: getLabelRotation('target'),\n    getRotationPoint: fns.getTargetLabelRotationPoint,\n    getRotationOffset: fns.getTargetLabelRotationOffset,\n    isVisible: isLabelVisible('target-label')\n  });\n\n  // Very simplistic way of triggering garbage collection, just use a timer.\n  var setGCFlag = debounce(function () {\n    console.log('garbage collect flag set');\n    r.data.gc = true;\n  }, 10000);\n\n  // Event listener checks if style keys are no longer in use.\n  r.onUpdateEleCalcs(function (willDraw, eles) {\n    var gcNeeded = false;\n    if (eles && eles.length > 0) {\n      gcNeeded |= r.drawing.invalidate(eles);\n    }\n    if (gcNeeded) {\n      setGCFlag();\n    }\n  });\n\n  // \"Override\" certain functions in canvas and base renderer\n  overrideCanvasRendererFunctions(r);\n};\nfunction getBGColor(r) {\n  var container = r.cy.container();\n  var cssColor = container && container.style && container.style.backgroundColor || 'white';\n  return color2tuple(cssColor);\n}\nfunction getLabelLines(ele, prefix) {\n  var rs = ele._private.rscratch;\n  return getPrefixedProperty(rs, 'labelWrapCachedLines', prefix) || [];\n}\n\n/** \n * Handle multi-line labels by rendering each line as a seperate texture.\n * That means each line needs its own style key.\n */\nvar getStyleKeysForLabel = function getStyleKeysForLabel(getKey, prefix) {\n  return function (ele) {\n    var key = getKey(ele);\n    var lines = getLabelLines(ele, prefix);\n    if (lines.length > 1) {\n      return lines.map(function (line, index) {\n        return \"\".concat(key, \"_\").concat(index);\n      });\n    }\n    return key;\n  };\n};\n\n/**\n * Need to create a separate bounding box for each line of a multi-line label.\n * Note that 'drawClipped: true' should be used with this.\n */\nvar getBoundingBoxForLabel = function getBoundingBoxForLabel(getBoundingBox, prefix) {\n  return function (ele, styleKey) {\n    var bb = getBoundingBox(ele);\n    if (typeof styleKey === 'string') {\n      var ui = styleKey.indexOf('_');\n      if (ui > 0) {\n        var lineIndex = Number(styleKey.substring(ui + 1));\n        var lines = getLabelLines(ele, prefix);\n        // Adjust the height and Y coordinate for one line of the label.\n        var h = bb.h / lines.length;\n        var yOffset = h * lineIndex;\n        var y1 = bb.y1 + yOffset;\n        // the yOffset is needed when rotating the label\n        return {\n          x1: bb.x1,\n          w: bb.w,\n          y1: y1,\n          h: h,\n          yOffset: yOffset\n        };\n      }\n    }\n    return bb;\n  };\n};\n\n/**\n * Plug into the canvas renderer by dynamically overriding some of its functions.\n * This requires minimal changes to the canvas rendrerer.\n */\nfunction overrideCanvasRendererFunctions(r) {\n  {\n    // Override the render function to call the webgl render function if the zoom level is appropriate\n    var renderCanvas = r.render;\n    r.render = function (options) {\n      options = options || {};\n      var cy = r.cy;\n      if (r.webgl) {\n        // If the zoom level is greater than the max zoom level, then disable webgl and switch back to \n        // the canvas renderer.\n        if (cy.zoom() > maxZoom$1) {\n          clearWebgl(r);\n          renderCanvas.call(r, options);\n        } else {\n          clearCanvas(r);\n          renderWebgl(r, options, RENDER_TARGET.SCREEN);\n        }\n      }\n    };\n  }\n  {\n    // Override the matchCanvasSize function to update the picking frame buffer size\n    var baseFunc = r.matchCanvasSize;\n    r.matchCanvasSize = function (container) {\n      baseFunc.call(r, container);\n      r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth, r.canvasHeight);\n      r.pickingFrameBuffer.needsDraw = true;\n    };\n  }\n  {\n    // Override function to call the webgl version for picking.\n    // Don't override r.getAllInBox() selction box picking, its not accurate enough with webgl\n    r.findNearestElements = function (x, y, interactiveElementsOnly, isTouch) {\n      // the canvas version of this function is very slow on large graphs\n      return findNearestElementsWebgl(r, x, y);\n    };\n  }\n  {\n    // need to know when the cached elements have changed so we can invalidate our caches\n    var _baseFunc = r.invalidateCachedZSortedEles;\n    r.invalidateCachedZSortedEles = function () {\n      _baseFunc.call(r);\n      r.pickingFrameBuffer.needsDraw = true;\n    };\n  }\n  {\n    // need to know when the cached elements have changed so we can invalidate our caches\n    var _baseFunc2 = r.notify;\n    r.notify = function (eventName, eles) {\n      _baseFunc2.call(r, eventName, eles);\n      if (eventName === 'viewport' || eventName === 'bounds') {\n        r.pickingFrameBuffer.needsDraw = true;\n      } else if (eventName === 'background') {\n        // background image finished loading, need to redraw\n        r.drawing.invalidate(eles, {\n          type: 'node-body'\n        });\n      }\n    };\n  }\n}\nfunction clearWebgl(r) {\n  var gl = r.data.contexts[r.WEBGL];\n  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n}\nfunction clearCanvas(r) {\n  // the CRp.clearCanvas() function doesn't take the transform into account\n  var clear = function clear(context) {\n    context.save();\n    context.setTransform(1, 0, 0, 1, 0, 0);\n    context.clearRect(0, 0, r.canvasWidth, r.canvasHeight);\n    context.restore();\n  };\n  clear(r.data.contexts[r.NODE]);\n  clear(r.data.contexts[r.DRAG]);\n}\nfunction createPanZoomMatrix(r) {\n  var width = r.canvasWidth;\n  var height = r.canvasHeight;\n  var _util$getEffectivePan = getEffectivePanZoom(r),\n    pan = _util$getEffectivePan.pan,\n    zoom = _util$getEffectivePan.zoom;\n  var transform = create();\n  translate(transform, transform, [pan.x, pan.y]);\n  scale(transform, transform, [zoom, zoom]);\n  var projection$1 = create();\n  projection(projection$1, width, height);\n  var product = create();\n  multiply(product, projection$1, transform);\n  return product;\n}\nfunction setContextTransform(r, context) {\n  var width = r.canvasWidth;\n  var height = r.canvasHeight;\n  var _util$getEffectivePan2 = getEffectivePanZoom(r),\n    pan = _util$getEffectivePan2.pan,\n    zoom = _util$getEffectivePan2.zoom;\n  context.setTransform(1, 0, 0, 1, 0, 0);\n  context.clearRect(0, 0, width, height);\n  context.translate(pan.x, pan.y);\n  context.scale(zoom, zoom);\n}\nfunction drawSelectionRectangle(r, options) {\n  r.drawSelectionRectangle(options, function (context) {\n    return setContextTransform(r, context);\n  });\n}\nfunction drawAxes(r) {\n  // for debgging\n  var context = r.data.contexts[r.NODE];\n  context.save();\n  setContextTransform(r, context);\n  context.strokeStyle = 'rgba(0, 0, 0, 0.3)';\n  context.beginPath();\n  context.moveTo(-1e3, 0);\n  context.lineTo(1000, 0);\n  context.stroke();\n  context.beginPath();\n  context.moveTo(0, -1e3);\n  context.lineTo(0, 1000);\n  context.stroke();\n  context.restore();\n}\nfunction drawAtlases(r) {\n  // For debugging the atlases, this doesn't work for Atlases that are locked\n  var draw = function draw(drawing, name, row) {\n    var collection = drawing.atlasManager.getAtlasCollection(name);\n    var context = r.data.contexts[r.NODE];\n    var atlases = collection.atlases;\n    for (var _i = 0; _i < atlases.length; _i++) {\n      var atlas = atlases[_i];\n      var canvas = atlas.canvas;\n      if (canvas) {\n        var w = canvas.width;\n        var h = canvas.height;\n        var x = w * _i;\n        var y = canvas.height * row;\n        var scale = 0.4;\n        context.save();\n        context.scale(scale, scale);\n        context.drawImage(canvas, x, y);\n        context.strokeStyle = 'black';\n        context.rect(x, y, w, h);\n        context.stroke();\n        context.restore();\n      }\n    }\n  };\n  var i = 0;\n  draw(r.drawing, 'node', i++);\n  draw(r.drawing, 'label', i++);\n}\n\n/**\n * Returns the z-order index of elments under or very close to the mouse cursor point.\n * Arguments are in model coordinates.\n * (x1, y1) is top left corner\n * (x2, y2) is bottom right corner (optional)\n * Returns a Set of indexes.\n */\nfunction getPickingIndexes(r, mX1, mY1, mX2, mY2) {\n  var x, y, w, h;\n  var _util$getEffectivePan3 = getEffectivePanZoom(r),\n    pan = _util$getEffectivePan3.pan,\n    zoom = _util$getEffectivePan3.zoom;\n  {\n    var _util$modelToRendered = modelToRenderedPosition(r, pan, zoom, mX1, mY1),\n      _util$modelToRendered2 = _slicedToArray(_util$modelToRendered, 2),\n      cX1 = _util$modelToRendered2[0],\n      cY1 = _util$modelToRendered2[1];\n    var t = 6; // should be even\n    x = cX1 - t / 2;\n    y = cY1 - t / 2;\n    w = t;\n    h = t;\n  }\n  if (w === 0 || h === 0) {\n    return [];\n  }\n  var gl = r.data.contexts[r.WEBGL];\n  gl.bindFramebuffer(gl.FRAMEBUFFER, r.pickingFrameBuffer);\n  if (r.pickingFrameBuffer.needsDraw) {\n    // Draw element z-indexes to the picking framebuffer\n    gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n    renderWebgl(r, null, RENDER_TARGET.PICKING);\n    r.pickingFrameBuffer.needsDraw = false;\n  }\n  var n = w * h; // number of pixels to read\n  var data = new Uint8Array(n * 4); // 4 bytes per pixel\n  gl.readPixels(x, y, w, h, gl.RGBA, gl.UNSIGNED_BYTE, data);\n  gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n  var indexes = new Set();\n  for (var i = 0; i < n; i++) {\n    var pixel = data.slice(i * 4, i * 4 + 4);\n    var index = vec4ToIndex(pixel) - 1; // The framebuffer is cleared with 0s, so z-indexes are offset by 1\n    if (index >= 0) {\n      indexes.add(index);\n    }\n  }\n  return indexes;\n}\n\n/**\n * Cy.js: model coordinate y axis goes down\n */\nfunction findNearestElementsWebgl(r, x, y) {\n  // model coordinates\n  var indexes = getPickingIndexes(r, x, y);\n  var eles = r.getCachedZSortedEles();\n  var node, edge;\n  var _iterator = _createForOfIteratorHelper(indexes),\n    _step;\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var index = _step.value;\n      var ele = eles[index];\n      if (!node && ele.isNode()) {\n        node = ele;\n      }\n      if (!edge && ele.isEdge()) {\n        edge = ele;\n      }\n      if (node && edge) {\n        break;\n      }\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n  return [node, edge].filter(Boolean);\n}\n\n/**\n * Draw one node or edge. \n */\nfunction drawEle(r, index, ele) {\n  var drawing = r.drawing;\n  index += 1; // 0 is used to clear the background, need to offset all z-indexes by one\n  if (ele.isNode()) {\n    drawing.drawNode(ele, index, 'node-underlay');\n    drawing.drawNode(ele, index, 'node-body');\n    drawing.drawTexture(ele, index, 'label');\n    drawing.drawNode(ele, index, 'node-overlay');\n  } else {\n    drawing.drawEdgeLine(ele, index);\n    drawing.drawEdgeArrow(ele, index, 'source');\n    drawing.drawEdgeArrow(ele, index, 'target');\n    drawing.drawTexture(ele, index, 'label');\n    drawing.drawTexture(ele, index, 'edge-source-label');\n    drawing.drawTexture(ele, index, 'edge-target-label');\n  }\n}\n\n/**\n * Render one frame.\n */\nfunction renderWebgl(r, options, renderTarget) {\n  var start;\n  if (r.webglDebug) {\n    start = performance.now(); // eslint-disable-line no-undef\n  }\n  var drawing = r.drawing;\n  var eleCount = 0;\n  if (renderTarget.screen) {\n    if (r.data.canvasNeedsRedraw[r.SELECT_BOX]) {\n      drawSelectionRectangle(r, options);\n    }\n  }\n\n  // see drawing-elements.js drawCachedElement()\n  if (r.data.canvasNeedsRedraw[r.NODE] || renderTarget.picking) {\n    var gl = r.data.contexts[r.WEBGL];\n    if (renderTarget.screen) {\n      gl.clearColor(0, 0, 0, 0); // background color\n      gl.enable(gl.BLEND); // enable alpha blending of colors\n      gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); // webgl colors use premultiplied alpha\n    } else {\n      gl.disable(gl.BLEND); // don't blend z-order index values! they are not colors\n    }\n    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n    gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n    var panZoomMatrix = createPanZoomMatrix(r);\n    var eles = r.getCachedZSortedEles();\n    eleCount = eles.length;\n    drawing.startFrame(panZoomMatrix, renderTarget);\n    if (renderTarget.screen) {\n      for (var i = 0; i < eles.nondrag.length; i++) {\n        drawEle(r, i, eles.nondrag[i]);\n      }\n      for (var _i2 = 0; _i2 < eles.drag.length; _i2++) {\n        drawEle(r, _i2, eles.drag[_i2]);\n      }\n    } else if (renderTarget.picking) {\n      for (var _i3 = 0; _i3 < eles.length; _i3++) {\n        drawEle(r, _i3, eles[_i3]);\n      }\n    }\n    drawing.endFrame();\n    if (renderTarget.screen && r.webglDebugShowAtlases) {\n      drawAxes(r);\n      drawAtlases(r);\n    }\n    r.data.canvasNeedsRedraw[r.NODE] = false;\n    r.data.canvasNeedsRedraw[r.DRAG] = false;\n  }\n  if (r.webglDebug) {\n    // eslint-disable-next-line no-undef\n    var end = performance.now();\n    var compact = false;\n    var time = Math.ceil(end - start);\n    var debugInfo = drawing.getDebugInfo();\n    var report = [\"\".concat(eleCount, \" elements\"), \"\".concat(debugInfo.totalInstances, \" instances\"), \"\".concat(debugInfo.batchCount, \" batches\"), \"\".concat(debugInfo.totalAtlases, \" atlases\"), \"\".concat(debugInfo.wrappedCount, \" wrapped textures\"), \"\".concat(debugInfo.simpleCount, \" simple shapes\")].join(', ');\n    if (compact) {\n      console.log(\"WebGL (\".concat(renderTarget.name, \") - time \").concat(time, \"ms, \").concat(report));\n    } else {\n      console.log(\"WebGL (\".concat(renderTarget.name, \") - frame time \").concat(time, \"ms\"));\n      console.log('Totals:');\n      console.log(\"  \".concat(report));\n      console.log('Texture Atlases Used:');\n      var atlasInfo = debugInfo.atlasInfo;\n      var _iterator2 = _createForOfIteratorHelper(atlasInfo),\n        _step2;\n      try {\n        for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n          var info = _step2.value;\n          console.log(\"  \".concat(info.type, \": \").concat(info.keyCount, \" keys, \").concat(info.atlasCount, \" atlases\"));\n        }\n      } catch (err) {\n        _iterator2.e(err);\n      } finally {\n        _iterator2.f();\n      }\n      console.log('');\n    }\n  }\n  if (r.data.gc) {\n    console.log('Garbage Collect!');\n    r.data.gc = false;\n    drawing.gc();\n  }\n}\n\nvar CRp$3 = {};\n\n// @O Polygon drawing\nCRp$3.drawPolygonPath = function (context, x, y, width, height, points) {\n  var halfW = width / 2;\n  var halfH = height / 2;\n  if (context.beginPath) {\n    context.beginPath();\n  }\n  context.moveTo(x + halfW * points[0], y + halfH * points[1]);\n  for (var i = 1; i < points.length / 2; i++) {\n    context.lineTo(x + halfW * points[i * 2], y + halfH * points[i * 2 + 1]);\n  }\n  context.closePath();\n};\nCRp$3.drawRoundPolygonPath = function (context, x, y, width, height, points, corners) {\n  corners.forEach(function (corner) {\n    return drawPreparedRoundCorner(context, corner);\n  });\n  context.closePath();\n};\n\n// Round rectangle drawing\nCRp$3.drawRoundRectanglePath = function (context, x, y, width, height, radius) {\n  var halfWidth = width / 2;\n  var halfHeight = height / 2;\n  var cornerRadius = radius === 'auto' ? getRoundRectangleRadius(width, height) : Math.min(radius, halfHeight, halfWidth);\n  if (context.beginPath) {\n    context.beginPath();\n  }\n\n  // Start at top middle\n  context.moveTo(x, y - halfHeight);\n  // Arc from middle top to right side\n  context.arcTo(x + halfWidth, y - halfHeight, x + halfWidth, y, cornerRadius);\n  // Arc from right side to bottom\n  context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius);\n  // Arc from bottom to left side\n  context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius);\n  // Arc from left side to topBorder\n  context.arcTo(x - halfWidth, y - halfHeight, x, y - halfHeight, cornerRadius);\n  // Join line\n  context.lineTo(x, y - halfHeight);\n  context.closePath();\n};\nCRp$3.drawBottomRoundRectanglePath = function (context, x, y, width, height, radius) {\n  var halfWidth = width / 2;\n  var halfHeight = height / 2;\n  var cornerRadius = radius === 'auto' ? getRoundRectangleRadius(width, height) : radius;\n  if (context.beginPath) {\n    context.beginPath();\n  }\n\n  // Start at top middle\n  context.moveTo(x, y - halfHeight);\n  context.lineTo(x + halfWidth, y - halfHeight);\n  context.lineTo(x + halfWidth, y);\n  context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius);\n  context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius);\n  context.lineTo(x - halfWidth, y - halfHeight);\n  context.lineTo(x, y - halfHeight);\n  context.closePath();\n};\nCRp$3.drawCutRectanglePath = function (context, x, y, width, height, points, corners) {\n  var halfWidth = width / 2;\n  var halfHeight = height / 2;\n  var cornerLength = corners === 'auto' ? getCutRectangleCornerLength() : corners;\n  if (context.beginPath) {\n    context.beginPath();\n  }\n  context.moveTo(x - halfWidth + cornerLength, y - halfHeight);\n  context.lineTo(x + halfWidth - cornerLength, y - halfHeight);\n  context.lineTo(x + halfWidth, y - halfHeight + cornerLength);\n  context.lineTo(x + halfWidth, y + halfHeight - cornerLength);\n  context.lineTo(x + halfWidth - cornerLength, y + halfHeight);\n  context.lineTo(x - halfWidth + cornerLength, y + halfHeight);\n  context.lineTo(x - halfWidth, y + halfHeight - cornerLength);\n  context.lineTo(x - halfWidth, y - halfHeight + cornerLength);\n  context.closePath();\n};\nCRp$3.drawBarrelPath = function (context, x, y, width, height) {\n  var halfWidth = width / 2;\n  var halfHeight = height / 2;\n  var xBegin = x - halfWidth;\n  var xEnd = x + halfWidth;\n  var yBegin = y - halfHeight;\n  var yEnd = y + halfHeight;\n  var barrelCurveConstants = getBarrelCurveConstants(width, height);\n  var wOffset = barrelCurveConstants.widthOffset;\n  var hOffset = barrelCurveConstants.heightOffset;\n  var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset;\n  if (context.beginPath) {\n    context.beginPath();\n  }\n  context.moveTo(xBegin, yBegin + hOffset);\n  context.lineTo(xBegin, yEnd - hOffset);\n  context.quadraticCurveTo(xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd);\n  context.lineTo(xEnd - wOffset, yEnd);\n  context.quadraticCurveTo(xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset);\n  context.lineTo(xEnd, yBegin + hOffset);\n  context.quadraticCurveTo(xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin);\n  context.lineTo(xBegin + wOffset, yBegin);\n  context.quadraticCurveTo(xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset);\n  context.closePath();\n};\nvar sin0 = Math.sin(0);\nvar cos0 = Math.cos(0);\nvar sin = {};\nvar cos = {};\nvar ellipseStepSize = Math.PI / 40;\nfor (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) {\n  sin[i] = Math.sin(i);\n  cos[i] = Math.cos(i);\n}\nCRp$3.drawEllipsePath = function (context, centerX, centerY, width, height) {\n  if (context.beginPath) {\n    context.beginPath();\n  }\n  if (context.ellipse) {\n    context.ellipse(centerX, centerY, width / 2, height / 2, 0, 0, 2 * Math.PI);\n  } else {\n    var xPos, yPos;\n    var rw = width / 2;\n    var rh = height / 2;\n    for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) {\n      xPos = centerX - rw * sin[i] * sin0 + rw * cos[i] * cos0;\n      yPos = centerY + rh * cos[i] * sin0 + rh * sin[i] * cos0;\n      if (i === 0) {\n        context.moveTo(xPos, yPos);\n      } else {\n        context.lineTo(xPos, yPos);\n      }\n    }\n  }\n  context.closePath();\n};\n\n/* global atob, ArrayBuffer, Uint8Array, Blob */\n\nvar CRp$2 = {};\nCRp$2.createBuffer = function (w, h) {\n  var buffer = document.createElement('canvas'); // eslint-disable-line no-undef\n  buffer.width = w;\n  buffer.height = h;\n  return [buffer, buffer.getContext('2d')];\n};\nCRp$2.bufferCanvasImage = function (options) {\n  var cy = this.cy;\n  var eles = cy.mutableElements();\n  var bb = eles.boundingBox();\n  var ctrRect = this.findContainerClientCoords();\n  var width = options.full ? Math.ceil(bb.w) : ctrRect[2];\n  var height = options.full ? Math.ceil(bb.h) : ctrRect[3];\n  var specdMaxDims = number$1(options.maxWidth) || number$1(options.maxHeight);\n  var pxRatio = this.getPixelRatio();\n  var scale = 1;\n  if (options.scale !== undefined) {\n    width *= options.scale;\n    height *= options.scale;\n    scale = options.scale;\n  } else if (specdMaxDims) {\n    var maxScaleW = Infinity;\n    var maxScaleH = Infinity;\n    if (number$1(options.maxWidth)) {\n      maxScaleW = scale * options.maxWidth / width;\n    }\n    if (number$1(options.maxHeight)) {\n      maxScaleH = scale * options.maxHeight / height;\n    }\n    scale = Math.min(maxScaleW, maxScaleH);\n    width *= scale;\n    height *= scale;\n  }\n  if (!specdMaxDims) {\n    width *= pxRatio;\n    height *= pxRatio;\n    scale *= pxRatio;\n  }\n  var buffCanvas = document.createElement('canvas'); // eslint-disable-line no-undef\n\n  buffCanvas.width = width;\n  buffCanvas.height = height;\n  buffCanvas.style.width = width + 'px';\n  buffCanvas.style.height = height + 'px';\n  var buffCxt = buffCanvas.getContext('2d');\n\n  // Rasterize the layers, but only if container has nonzero size\n  if (width > 0 && height > 0) {\n    buffCxt.clearRect(0, 0, width, height);\n    buffCxt.globalCompositeOperation = 'source-over';\n    var zsortedEles = this.getCachedZSortedEles();\n    if (options.full) {\n      // draw the full bounds of the graph\n      buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale);\n      buffCxt.scale(scale, scale);\n      this.drawElements(buffCxt, zsortedEles);\n      buffCxt.scale(1 / scale, 1 / scale);\n      buffCxt.translate(bb.x1 * scale, bb.y1 * scale);\n    } else {\n      // draw the current view\n      var pan = cy.pan();\n      var translation = {\n        x: pan.x * scale,\n        y: pan.y * scale\n      };\n      scale *= cy.zoom();\n      buffCxt.translate(translation.x, translation.y);\n      buffCxt.scale(scale, scale);\n      this.drawElements(buffCxt, zsortedEles);\n      buffCxt.scale(1 / scale, 1 / scale);\n      buffCxt.translate(-translation.x, -translation.y);\n    }\n\n    // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs\n    if (options.bg) {\n      buffCxt.globalCompositeOperation = 'destination-over';\n      buffCxt.fillStyle = options.bg;\n      buffCxt.rect(0, 0, width, height);\n      buffCxt.fill();\n    }\n  }\n  return buffCanvas;\n};\nfunction b64ToBlob(b64, mimeType) {\n  var bytes = atob(b64);\n  var buff = new ArrayBuffer(bytes.length);\n  var buffUint8 = new Uint8Array(buff);\n  for (var i = 0; i < bytes.length; i++) {\n    buffUint8[i] = bytes.charCodeAt(i);\n  }\n  return new Blob([buff], {\n    type: mimeType\n  });\n}\nfunction b64UriToB64(b64uri) {\n  var i = b64uri.indexOf(',');\n  return b64uri.substr(i + 1);\n}\nfunction output(options, canvas, mimeType) {\n  var getB64Uri = function getB64Uri() {\n    return canvas.toDataURL(mimeType, options.quality);\n  };\n  switch (options.output) {\n    case 'blob-promise':\n      return new Promise$1(function (resolve, reject) {\n        try {\n          canvas.toBlob(function (blob) {\n            if (blob != null) {\n              resolve(blob);\n            } else {\n              reject(new Error('`canvas.toBlob()` sent a null value in its callback'));\n            }\n          }, mimeType, options.quality);\n        } catch (err) {\n          reject(err);\n        }\n      });\n    case 'blob':\n      return b64ToBlob(b64UriToB64(getB64Uri()), mimeType);\n    case 'base64':\n      return b64UriToB64(getB64Uri());\n    case 'base64uri':\n    default:\n      return getB64Uri();\n  }\n}\nCRp$2.png = function (options) {\n  return output(options, this.bufferCanvasImage(options), 'image/png');\n};\nCRp$2.jpg = function (options) {\n  return output(options, this.bufferCanvasImage(options), 'image/jpeg');\n};\n\nvar CRp$1 = {};\nCRp$1.nodeShapeImpl = function (name, context, centerX, centerY, width, height, points, corners) {\n  switch (name) {\n    case 'ellipse':\n      return this.drawEllipsePath(context, centerX, centerY, width, height);\n    case 'polygon':\n      return this.drawPolygonPath(context, centerX, centerY, width, height, points);\n    case 'round-polygon':\n      return this.drawRoundPolygonPath(context, centerX, centerY, width, height, points, corners);\n    case 'roundrectangle':\n    case 'round-rectangle':\n      return this.drawRoundRectanglePath(context, centerX, centerY, width, height, corners);\n    case 'cutrectangle':\n    case 'cut-rectangle':\n      return this.drawCutRectanglePath(context, centerX, centerY, width, height, points, corners);\n    case 'bottomroundrectangle':\n    case 'bottom-round-rectangle':\n      return this.drawBottomRoundRectanglePath(context, centerX, centerY, width, height, corners);\n    case 'barrel':\n      return this.drawBarrelPath(context, centerX, centerY, width, height);\n  }\n};\n\nvar CR = CanvasRenderer;\nvar CRp = CanvasRenderer.prototype;\nCRp.CANVAS_LAYERS = 3;\n//\nCRp.SELECT_BOX = 0;\nCRp.DRAG = 1;\nCRp.NODE = 2;\nCRp.WEBGL = 3;\nCRp.CANVAS_TYPES = ['2d', '2d', '2d', 'webgl2'];\nCRp.BUFFER_COUNT = 3;\n//\nCRp.TEXTURE_BUFFER = 0;\nCRp.MOTIONBLUR_BUFFER_NODE = 1;\nCRp.MOTIONBLUR_BUFFER_DRAG = 2;\nfunction CanvasRenderer(options) {\n  var r = this;\n  var containerWindow = r.cy.window();\n  var document = containerWindow.document;\n  if (options.webgl) {\n    CRp.CANVAS_LAYERS = r.CANVAS_LAYERS = 4;\n    console.log('webgl rendering enabled');\n  }\n  r.data = {\n    canvases: new Array(CRp.CANVAS_LAYERS),\n    contexts: new Array(CRp.CANVAS_LAYERS),\n    canvasNeedsRedraw: new Array(CRp.CANVAS_LAYERS),\n    bufferCanvases: new Array(CRp.BUFFER_COUNT),\n    bufferContexts: new Array(CRp.CANVAS_LAYERS)\n  };\n  var tapHlOffAttr = '-webkit-tap-highlight-color';\n  var tapHlOffStyle = 'rgba(0,0,0,0)';\n  r.data.canvasContainer = document.createElement('div'); // eslint-disable-line no-undef\n  var containerStyle = r.data.canvasContainer.style;\n  r.data.canvasContainer.style[tapHlOffAttr] = tapHlOffStyle;\n  containerStyle.position = 'relative';\n  containerStyle.zIndex = '0';\n  containerStyle.overflow = 'hidden';\n  var container = options.cy.container();\n  container.appendChild(r.data.canvasContainer);\n  container.style[tapHlOffAttr] = tapHlOffStyle;\n  var styleMap = {\n    '-webkit-user-select': 'none',\n    '-moz-user-select': '-moz-none',\n    'user-select': 'none',\n    '-webkit-tap-highlight-color': 'rgba(0,0,0,0)',\n    'outline-style': 'none'\n  };\n  if (ms()) {\n    styleMap['-ms-touch-action'] = 'none';\n    styleMap['touch-action'] = 'none';\n  }\n  for (var i = 0; i < CRp.CANVAS_LAYERS; i++) {\n    var canvas = r.data.canvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef\n    var type = CRp.CANVAS_TYPES[i];\n    r.data.contexts[i] = canvas.getContext(type);\n    if (!r.data.contexts[i]) {\n      error('Could not create canvas of type ' + type);\n    }\n    Object.keys(styleMap).forEach(function (k) {\n      canvas.style[k] = styleMap[k];\n    });\n    canvas.style.position = 'absolute';\n    canvas.setAttribute('data-id', 'layer' + i);\n    canvas.style.zIndex = String(CRp.CANVAS_LAYERS - i);\n    r.data.canvasContainer.appendChild(canvas);\n    r.data.canvasNeedsRedraw[i] = false;\n  }\n  r.data.topCanvas = r.data.canvases[0];\n  r.data.canvases[CRp.NODE].setAttribute('data-id', 'layer' + CRp.NODE + '-node');\n  r.data.canvases[CRp.SELECT_BOX].setAttribute('data-id', 'layer' + CRp.SELECT_BOX + '-selectbox');\n  r.data.canvases[CRp.DRAG].setAttribute('data-id', 'layer' + CRp.DRAG + '-drag');\n  if (r.data.canvases[CRp.WEBGL]) {\n    r.data.canvases[CRp.WEBGL].setAttribute('data-id', 'layer' + CRp.WEBGL + '-webgl');\n  }\n  for (var i = 0; i < CRp.BUFFER_COUNT; i++) {\n    r.data.bufferCanvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef\n    r.data.bufferContexts[i] = r.data.bufferCanvases[i].getContext('2d');\n    r.data.bufferCanvases[i].style.position = 'absolute';\n    r.data.bufferCanvases[i].setAttribute('data-id', 'buffer' + i);\n    r.data.bufferCanvases[i].style.zIndex = String(-i - 1);\n    r.data.bufferCanvases[i].style.visibility = 'hidden';\n    //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]);\n  }\n  r.pathsEnabled = true;\n  var emptyBb = makeBoundingBox();\n  var getBoxCenter = function getBoxCenter(bb) {\n    return {\n      x: (bb.x1 + bb.x2) / 2,\n      y: (bb.y1 + bb.y2) / 2\n    };\n  };\n  var getCenterOffset = function getCenterOffset(bb) {\n    return {\n      x: -bb.w / 2,\n      y: -bb.h / 2\n    };\n  };\n  var backgroundTimestampHasChanged = function backgroundTimestampHasChanged(ele) {\n    var _p = ele[0]._private;\n    var same = _p.oldBackgroundTimestamp === _p.backgroundTimestamp;\n    return !same;\n  };\n  var getStyleKey = function getStyleKey(ele) {\n    return ele[0]._private.nodeKey;\n  };\n  var getLabelKey = function getLabelKey(ele) {\n    return ele[0]._private.labelStyleKey;\n  };\n  var getSourceLabelKey = function getSourceLabelKey(ele) {\n    return ele[0]._private.sourceLabelStyleKey;\n  };\n  var getTargetLabelKey = function getTargetLabelKey(ele) {\n    return ele[0]._private.targetLabelStyleKey;\n  };\n  var drawElement = function drawElement(context, ele, bb, scaledLabelShown, useEleOpacity) {\n    return r.drawElement(context, ele, bb, false, false, useEleOpacity);\n  };\n  var drawLabel = function drawLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {\n    return r.drawElementText(context, ele, bb, scaledLabelShown, 'main', useEleOpacity);\n  };\n  var drawSourceLabel = function drawSourceLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {\n    return r.drawElementText(context, ele, bb, scaledLabelShown, 'source', useEleOpacity);\n  };\n  var drawTargetLabel = function drawTargetLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {\n    return r.drawElementText(context, ele, bb, scaledLabelShown, 'target', useEleOpacity);\n  };\n  var getElementBox = function getElementBox(ele) {\n    ele.boundingBox();\n    return ele[0]._private.bodyBounds;\n  };\n  var getLabelBox = function getLabelBox(ele) {\n    ele.boundingBox();\n    return ele[0]._private.labelBounds.main || emptyBb;\n  };\n  var getSourceLabelBox = function getSourceLabelBox(ele) {\n    ele.boundingBox();\n    return ele[0]._private.labelBounds.source || emptyBb;\n  };\n  var getTargetLabelBox = function getTargetLabelBox(ele) {\n    ele.boundingBox();\n    return ele[0]._private.labelBounds.target || emptyBb;\n  };\n  var isLabelVisibleAtScale = function isLabelVisibleAtScale(ele, scaledLabelShown) {\n    return scaledLabelShown;\n  };\n  var getElementRotationPoint = function getElementRotationPoint(ele) {\n    return getBoxCenter(getElementBox(ele));\n  };\n  var addTextMargin = function addTextMargin(prefix, pt, ele) {\n    var pre = prefix ? prefix + '-' : '';\n    return {\n      x: pt.x + ele.pstyle(pre + 'text-margin-x').pfValue,\n      y: pt.y + ele.pstyle(pre + 'text-margin-y').pfValue\n    };\n  };\n  var getRsPt = function getRsPt(ele, x, y) {\n    var rs = ele[0]._private.rscratch;\n    return {\n      x: rs[x],\n      y: rs[y]\n    };\n  };\n  var getLabelRotationPoint = function getLabelRotationPoint(ele) {\n    return addTextMargin('', getRsPt(ele, 'labelX', 'labelY'), ele);\n  };\n  var getSourceLabelRotationPoint = function getSourceLabelRotationPoint(ele) {\n    return addTextMargin('source', getRsPt(ele, 'sourceLabelX', 'sourceLabelY'), ele);\n  };\n  var getTargetLabelRotationPoint = function getTargetLabelRotationPoint(ele) {\n    return addTextMargin('target', getRsPt(ele, 'targetLabelX', 'targetLabelY'), ele);\n  };\n  var getElementRotationOffset = function getElementRotationOffset(ele) {\n    return getCenterOffset(getElementBox(ele));\n  };\n  var getSourceLabelRotationOffset = function getSourceLabelRotationOffset(ele) {\n    return getCenterOffset(getSourceLabelBox(ele));\n  };\n  var getTargetLabelRotationOffset = function getTargetLabelRotationOffset(ele) {\n    return getCenterOffset(getTargetLabelBox(ele));\n  };\n  var getLabelRotationOffset = function getLabelRotationOffset(ele) {\n    var bb = getLabelBox(ele);\n    var p = getCenterOffset(getLabelBox(ele));\n    if (ele.isNode()) {\n      switch (ele.pstyle('text-halign').value) {\n        case 'left':\n          p.x = -bb.w - (bb.leftPad || 0);\n          break;\n        case 'right':\n          p.x = -(bb.rightPad || 0);\n          break;\n      }\n      switch (ele.pstyle('text-valign').value) {\n        case 'top':\n          p.y = -bb.h - (bb.topPad || 0);\n          break;\n        case 'bottom':\n          p.y = -(bb.botPad || 0);\n          break;\n      }\n    }\n    return p;\n  };\n  var eleTxrCache = r.data.eleTxrCache = new ElementTextureCache(r, {\n    getKey: getStyleKey,\n    doesEleInvalidateKey: backgroundTimestampHasChanged,\n    drawElement: drawElement,\n    getBoundingBox: getElementBox,\n    getRotationPoint: getElementRotationPoint,\n    getRotationOffset: getElementRotationOffset,\n    allowEdgeTxrCaching: false,\n    allowParentTxrCaching: false\n  });\n  var lblTxrCache = r.data.lblTxrCache = new ElementTextureCache(r, {\n    getKey: getLabelKey,\n    drawElement: drawLabel,\n    getBoundingBox: getLabelBox,\n    getRotationPoint: getLabelRotationPoint,\n    getRotationOffset: getLabelRotationOffset,\n    isVisible: isLabelVisibleAtScale\n  });\n  var slbTxrCache = r.data.slbTxrCache = new ElementTextureCache(r, {\n    getKey: getSourceLabelKey,\n    drawElement: drawSourceLabel,\n    getBoundingBox: getSourceLabelBox,\n    getRotationPoint: getSourceLabelRotationPoint,\n    getRotationOffset: getSourceLabelRotationOffset,\n    isVisible: isLabelVisibleAtScale\n  });\n  var tlbTxrCache = r.data.tlbTxrCache = new ElementTextureCache(r, {\n    getKey: getTargetLabelKey,\n    drawElement: drawTargetLabel,\n    getBoundingBox: getTargetLabelBox,\n    getRotationPoint: getTargetLabelRotationPoint,\n    getRotationOffset: getTargetLabelRotationOffset,\n    isVisible: isLabelVisibleAtScale\n  });\n  var lyrTxrCache = r.data.lyrTxrCache = new LayeredTextureCache(r);\n  r.onUpdateEleCalcs(function invalidateTextureCaches(willDraw, eles) {\n    // each cache should check for sub-key diff to see that the update affects that cache particularly\n    eleTxrCache.invalidateElements(eles);\n    lblTxrCache.invalidateElements(eles);\n    slbTxrCache.invalidateElements(eles);\n    tlbTxrCache.invalidateElements(eles);\n\n    // any change invalidates the layers\n    lyrTxrCache.invalidateElements(eles);\n\n    // update the old bg timestamp so diffs can be done in the ele txr caches\n    for (var _i = 0; _i < eles.length; _i++) {\n      var _p = eles[_i]._private;\n      _p.oldBackgroundTimestamp = _p.backgroundTimestamp;\n    }\n  });\n  var refineInLayers = function refineInLayers(reqs) {\n    for (var i = 0; i < reqs.length; i++) {\n      lyrTxrCache.enqueueElementRefinement(reqs[i].ele);\n    }\n  };\n  eleTxrCache.onDequeue(refineInLayers);\n  lblTxrCache.onDequeue(refineInLayers);\n  slbTxrCache.onDequeue(refineInLayers);\n  tlbTxrCache.onDequeue(refineInLayers);\n  if (options.webgl) {\n    r.initWebgl(options, {\n      getStyleKey: getStyleKey,\n      getLabelKey: getLabelKey,\n      getSourceLabelKey: getSourceLabelKey,\n      getTargetLabelKey: getTargetLabelKey,\n      drawElement: drawElement,\n      drawLabel: drawLabel,\n      drawSourceLabel: drawSourceLabel,\n      drawTargetLabel: drawTargetLabel,\n      getElementBox: getElementBox,\n      getLabelBox: getLabelBox,\n      getSourceLabelBox: getSourceLabelBox,\n      getTargetLabelBox: getTargetLabelBox,\n      getElementRotationPoint: getElementRotationPoint,\n      getElementRotationOffset: getElementRotationOffset,\n      getLabelRotationPoint: getLabelRotationPoint,\n      getSourceLabelRotationPoint: getSourceLabelRotationPoint,\n      getTargetLabelRotationPoint: getTargetLabelRotationPoint,\n      getLabelRotationOffset: getLabelRotationOffset,\n      getSourceLabelRotationOffset: getSourceLabelRotationOffset,\n      getTargetLabelRotationOffset: getTargetLabelRotationOffset\n    });\n  }\n}\nCRp.redrawHint = function (group, bool) {\n  var r = this;\n  switch (group) {\n    case 'eles':\n      r.data.canvasNeedsRedraw[CRp.NODE] = bool;\n      break;\n    case 'drag':\n      r.data.canvasNeedsRedraw[CRp.DRAG] = bool;\n      break;\n    case 'select':\n      r.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool;\n      break;\n    case 'gc':\n      r.data.gc = true;\n      break;\n  }\n};\n\n// whether to use Path2D caching for drawing\nvar pathsImpld = typeof Path2D !== 'undefined';\nCRp.path2dEnabled = function (on) {\n  if (on === undefined) {\n    return this.pathsEnabled;\n  }\n  this.pathsEnabled = on ? true : false;\n};\nCRp.usePaths = function () {\n  return pathsImpld && this.pathsEnabled;\n};\nCRp.setImgSmoothing = function (context, bool) {\n  if (context.imageSmoothingEnabled != null) {\n    context.imageSmoothingEnabled = bool;\n  } else {\n    context.webkitImageSmoothingEnabled = bool;\n    context.mozImageSmoothingEnabled = bool;\n    context.msImageSmoothingEnabled = bool;\n  }\n};\nCRp.getImgSmoothing = function (context) {\n  if (context.imageSmoothingEnabled != null) {\n    return context.imageSmoothingEnabled;\n  } else {\n    return context.webkitImageSmoothingEnabled || context.mozImageSmoothingEnabled || context.msImageSmoothingEnabled;\n  }\n};\nCRp.makeOffscreenCanvas = function (width, height) {\n  var canvas;\n  if ((typeof OffscreenCanvas === \"undefined\" ? \"undefined\" : _typeof(OffscreenCanvas)) !== (\"undefined\" )) {\n    canvas = new OffscreenCanvas(width, height);\n  } else {\n    var containerWindow = this.cy.window();\n    var document = containerWindow.document;\n    canvas = document.createElement('canvas'); // eslint-disable-line no-undef\n    canvas.width = width;\n    canvas.height = height;\n  }\n  return canvas;\n};\n[CRp$b, CRp$a, CRp$9, CRp$8, CRp$7, CRp$6, CRp$5, CRp$4, CRp$3, CRp$2, CRp$1].forEach(function (props) {\n  extend(CRp, props);\n});\n\nvar renderer = [{\n  name: 'null',\n  impl: NullRenderer\n}, {\n  name: 'base',\n  impl: BR\n}, {\n  name: 'canvas',\n  impl: CR\n}];\n\nvar incExts = [{\n  type: 'layout',\n  extensions: layout\n}, {\n  type: 'renderer',\n  extensions: renderer\n}];\n\n// registered extensions to cytoscape, indexed by name\nvar extensions = {};\n\n// registered modules for extensions, indexed by name\nvar modules = {};\nfunction setExtension(type, name, registrant) {\n  var ext = registrant;\n  var overrideErr = function overrideErr(field) {\n    warn('Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden');\n  };\n  if (type === 'core') {\n    if (Core.prototype[name]) {\n      return overrideErr(name);\n    } else {\n      Core.prototype[name] = registrant;\n    }\n  } else if (type === 'collection') {\n    if (Collection.prototype[name]) {\n      return overrideErr(name);\n    } else {\n      Collection.prototype[name] = registrant;\n    }\n  } else if (type === 'layout') {\n    // fill in missing layout functions in the prototype\n\n    var Layout = function Layout(options) {\n      this.options = options;\n      registrant.call(this, options);\n\n      // make sure layout has _private for use w/ std apis like .on()\n      if (!plainObject(this._private)) {\n        this._private = {};\n      }\n      this._private.cy = options.cy;\n      this._private.listeners = [];\n      this.createEmitter();\n    };\n    var layoutProto = Layout.prototype = Object.create(registrant.prototype);\n    var optLayoutFns = [];\n    for (var i = 0; i < optLayoutFns.length; i++) {\n      var fnName = optLayoutFns[i];\n      layoutProto[fnName] = layoutProto[fnName] || function () {\n        return this;\n      };\n    }\n\n    // either .start() or .run() is defined, so autogen the other\n    if (layoutProto.start && !layoutProto.run) {\n      layoutProto.run = function () {\n        this.start();\n        return this;\n      };\n    } else if (!layoutProto.start && layoutProto.run) {\n      layoutProto.start = function () {\n        this.run();\n        return this;\n      };\n    }\n    var regStop = registrant.prototype.stop;\n    layoutProto.stop = function () {\n      var opts = this.options;\n      if (opts && opts.animate) {\n        var anis = this.animations;\n        if (anis) {\n          for (var _i = 0; _i < anis.length; _i++) {\n            anis[_i].stop();\n          }\n        }\n      }\n      if (regStop) {\n        regStop.call(this);\n      } else {\n        this.emit('layoutstop');\n      }\n      return this;\n    };\n    if (!layoutProto.destroy) {\n      layoutProto.destroy = function () {\n        return this;\n      };\n    }\n    layoutProto.cy = function () {\n      return this._private.cy;\n    };\n    var getCy = function getCy(layout) {\n      return layout._private.cy;\n    };\n    var emitterOpts = {\n      addEventFields: function addEventFields(layout, evt) {\n        evt.layout = layout;\n        evt.cy = getCy(layout);\n        evt.target = layout;\n      },\n      bubble: function bubble() {\n        return true;\n      },\n      parent: function parent(layout) {\n        return getCy(layout);\n      }\n    };\n    extend(layoutProto, {\n      createEmitter: function createEmitter() {\n        this._private.emitter = new Emitter(emitterOpts, this);\n        return this;\n      },\n      emitter: function emitter() {\n        return this._private.emitter;\n      },\n      on: function on(evt, cb) {\n        this.emitter().on(evt, cb);\n        return this;\n      },\n      one: function one(evt, cb) {\n        this.emitter().one(evt, cb);\n        return this;\n      },\n      once: function once(evt, cb) {\n        this.emitter().one(evt, cb);\n        return this;\n      },\n      removeListener: function removeListener(evt, cb) {\n        this.emitter().removeListener(evt, cb);\n        return this;\n      },\n      removeAllListeners: function removeAllListeners() {\n        this.emitter().removeAllListeners();\n        return this;\n      },\n      emit: function emit(evt, params) {\n        this.emitter().emit(evt, params);\n        return this;\n      }\n    });\n    define.eventAliasesOn(layoutProto);\n    ext = Layout; // replace with our wrapped layout\n  } else if (type === 'renderer' && name !== 'null' && name !== 'base') {\n    // user registered renderers inherit from base\n\n    var BaseRenderer = getExtension('renderer', 'base');\n    var bProto = BaseRenderer.prototype;\n    var RegistrantRenderer = registrant;\n    var rProto = registrant.prototype;\n    var Renderer = function Renderer() {\n      BaseRenderer.apply(this, arguments);\n      RegistrantRenderer.apply(this, arguments);\n    };\n    var proto = Renderer.prototype;\n    for (var pName in bProto) {\n      var pVal = bProto[pName];\n      var existsInR = rProto[pName] != null;\n      if (existsInR) {\n        return overrideErr(pName);\n      }\n      proto[pName] = pVal; // take impl from base\n    }\n    for (var _pName in rProto) {\n      proto[_pName] = rProto[_pName]; // take impl from registrant\n    }\n    bProto.clientFunctions.forEach(function (name) {\n      proto[name] = proto[name] || function () {\n        error('Renderer does not implement `renderer.' + name + '()` on its prototype');\n      };\n    });\n    ext = Renderer;\n  } else if (type === '__proto__' || type === 'constructor' || type === 'prototype') {\n    // to avoid potential prototype pollution\n    return error(type + ' is an illegal type to be registered, possibly lead to prototype pollutions');\n  }\n  return setMap({\n    map: extensions,\n    keys: [type, name],\n    value: ext\n  });\n}\nfunction getExtension(type, name) {\n  return getMap({\n    map: extensions,\n    keys: [type, name]\n  });\n}\nfunction setModule(type, name, moduleType, moduleName, registrant) {\n  return setMap({\n    map: modules,\n    keys: [type, name, moduleType, moduleName],\n    value: registrant\n  });\n}\nfunction getModule(type, name, moduleType, moduleName) {\n  return getMap({\n    map: modules,\n    keys: [type, name, moduleType, moduleName]\n  });\n}\nvar extension = function extension() {\n  // e.g. extension('renderer', 'svg')\n  if (arguments.length === 2) {\n    return getExtension.apply(null, arguments);\n  }\n\n  // e.g. extension('renderer', 'svg', { ... })\n  else if (arguments.length === 3) {\n    return setExtension.apply(null, arguments);\n  }\n\n  // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse')\n  else if (arguments.length === 4) {\n    return getModule.apply(null, arguments);\n  }\n\n  // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... })\n  else if (arguments.length === 5) {\n    return setModule.apply(null, arguments);\n  } else {\n    error('Invalid extension access syntax');\n  }\n};\n\n// allows a core instance to access extensions internally\nCore.prototype.extension = extension;\n\n// included extensions\nincExts.forEach(function (group) {\n  group.extensions.forEach(function (ext) {\n    setExtension(group.type, ext.name, ext.impl);\n  });\n});\n\n// a dummy stylesheet object that doesn't need a reference to the core\n// (useful for init)\nvar _Stylesheet = function Stylesheet() {\n  if (!(this instanceof _Stylesheet)) {\n    return new _Stylesheet();\n  }\n  this.length = 0;\n};\nvar sheetfn = _Stylesheet.prototype;\nsheetfn.instanceString = function () {\n  return 'stylesheet';\n};\n\n// just store the selector to be parsed later\nsheetfn.selector = function (selector) {\n  var i = this.length++;\n  this[i] = {\n    selector: selector,\n    properties: []\n  };\n  return this; // chaining\n};\n\n// just store the property to be parsed later\nsheetfn.css = function (name, value) {\n  var i = this.length - 1;\n  if (string(name)) {\n    this[i].properties.push({\n      name: name,\n      value: value\n    });\n  } else if (plainObject(name)) {\n    var map = name;\n    var propNames = Object.keys(map);\n    for (var j = 0; j < propNames.length; j++) {\n      var key = propNames[j];\n      var mapVal = map[key];\n      if (mapVal == null) {\n        continue;\n      }\n      var prop = _Style.properties[key] || _Style.properties[dash2camel(key)];\n      if (prop == null) {\n        continue;\n      }\n      var _name = prop.name;\n      var _value = mapVal;\n      this[i].properties.push({\n        name: _name,\n        value: _value\n      });\n    }\n  }\n  return this; // chaining\n};\nsheetfn.style = sheetfn.css;\n\n// generate a real style object from the dummy stylesheet\nsheetfn.generateStyle = function (cy) {\n  var style = new _Style(cy);\n  return this.appendToStyle(style);\n};\n\n// append a dummy stylesheet object on a real style object\nsheetfn.appendToStyle = function (style) {\n  for (var i = 0; i < this.length; i++) {\n    var context = this[i];\n    var selector = context.selector;\n    var props = context.properties;\n    style.selector(selector); // apply selector\n\n    for (var j = 0; j < props.length; j++) {\n      var prop = props[j];\n      style.css(prop.name, prop.value); // apply property\n    }\n  }\n  return style;\n};\n\nvar version = \"3.33.4\";\n\nvar cytoscape = function cytoscape(options) {\n  // if no options specified, use default\n  if (options === undefined) {\n    options = {};\n  }\n\n  // create instance\n  if (plainObject(options)) {\n    return new Core(options);\n  }\n\n  // allow for registration of extensions\n  else if (string(options)) {\n    return extension.apply(extension, arguments);\n  }\n};\n\n// e.g. cytoscape.use( require('cytoscape-foo'), bar )\ncytoscape.use = function (ext) {\n  var args = Array.prototype.slice.call(arguments, 1); // args to pass to ext\n\n  args.unshift(cytoscape); // cytoscape is first arg to ext\n\n  ext.apply(null, args);\n  return this;\n};\ncytoscape.warnings = function (bool) {\n  return warnings(bool);\n};\n\n// replaced by build system\ncytoscape.version = version;\n\n// expose public apis (mostly for extensions)\ncytoscape.stylesheet = cytoscape.Stylesheet = _Stylesheet;\n\nexport { cytoscape as default };\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"layoutBase\"] = factory();\n\telse\n\t\troot[\"layoutBase\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 26);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction LayoutConstants() {}\n\n/**\r\n * Layout Quality: 0:draft, 1:default, 2:proof\r\n */\nLayoutConstants.QUALITY = 1;\n\n/**\r\n * Default parameters\r\n */\nLayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED = false;\nLayoutConstants.DEFAULT_INCREMENTAL = false;\nLayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT = true;\nLayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT = false;\nLayoutConstants.DEFAULT_ANIMATION_PERIOD = 50;\nLayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = false;\n\n// -----------------------------------------------------------------------------\n// Section: General other constants\n// -----------------------------------------------------------------------------\n/*\r\n * Margins of a graph to be applied on bouding rectangle of its contents. We\r\n * assume margins on all four sides to be uniform.\r\n */\nLayoutConstants.DEFAULT_GRAPH_MARGIN = 15;\n\n/*\r\n * Whether to consider labels in node dimensions or not\r\n */\nLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = false;\n\n/*\r\n * Default dimension of a non-compound node.\r\n */\nLayoutConstants.SIMPLE_NODE_SIZE = 40;\n\n/*\r\n * Default dimension of a non-compound node.\r\n */\nLayoutConstants.SIMPLE_NODE_HALF_SIZE = LayoutConstants.SIMPLE_NODE_SIZE / 2;\n\n/*\r\n * Empty compound node size. When a compound node is empty, its both\r\n * dimensions should be of this value.\r\n */\nLayoutConstants.EMPTY_COMPOUND_NODE_SIZE = 40;\n\n/*\r\n * Minimum length that an edge should take during layout\r\n */\nLayoutConstants.MIN_EDGE_LENGTH = 1;\n\n/*\r\n * World boundaries that layout operates on\r\n */\nLayoutConstants.WORLD_BOUNDARY = 1000000;\n\n/*\r\n * World boundaries that random positioning can be performed with\r\n */\nLayoutConstants.INITIAL_WORLD_BOUNDARY = LayoutConstants.WORLD_BOUNDARY / 1000;\n\n/*\r\n * Coordinates of the world center\r\n */\nLayoutConstants.WORLD_CENTER_X = 1200;\nLayoutConstants.WORLD_CENTER_Y = 900;\n\nmodule.exports = LayoutConstants;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraphObject = __webpack_require__(2);\nvar IGeometry = __webpack_require__(8);\nvar IMath = __webpack_require__(9);\n\nfunction LEdge(source, target, vEdge) {\n  LGraphObject.call(this, vEdge);\n\n  this.isOverlapingSourceAndTarget = false;\n  this.vGraphObject = vEdge;\n  this.bendpoints = [];\n  this.source = source;\n  this.target = target;\n}\n\nLEdge.prototype = Object.create(LGraphObject.prototype);\n\nfor (var prop in LGraphObject) {\n  LEdge[prop] = LGraphObject[prop];\n}\n\nLEdge.prototype.getSource = function () {\n  return this.source;\n};\n\nLEdge.prototype.getTarget = function () {\n  return this.target;\n};\n\nLEdge.prototype.isInterGraph = function () {\n  return this.isInterGraph;\n};\n\nLEdge.prototype.getLength = function () {\n  return this.length;\n};\n\nLEdge.prototype.isOverlapingSourceAndTarget = function () {\n  return this.isOverlapingSourceAndTarget;\n};\n\nLEdge.prototype.getBendpoints = function () {\n  return this.bendpoints;\n};\n\nLEdge.prototype.getLca = function () {\n  return this.lca;\n};\n\nLEdge.prototype.getSourceInLca = function () {\n  return this.sourceInLca;\n};\n\nLEdge.prototype.getTargetInLca = function () {\n  return this.targetInLca;\n};\n\nLEdge.prototype.getOtherEnd = function (node) {\n  if (this.source === node) {\n    return this.target;\n  } else if (this.target === node) {\n    return this.source;\n  } else {\n    throw \"Node is not incident with this edge\";\n  }\n};\n\nLEdge.prototype.getOtherEndInGraph = function (node, graph) {\n  var otherEnd = this.getOtherEnd(node);\n  var root = graph.getGraphManager().getRoot();\n\n  while (true) {\n    if (otherEnd.getOwner() == graph) {\n      return otherEnd;\n    }\n\n    if (otherEnd.getOwner() == root) {\n      break;\n    }\n\n    otherEnd = otherEnd.getOwner().getParent();\n  }\n\n  return null;\n};\n\nLEdge.prototype.updateLength = function () {\n  var clipPointCoordinates = new Array(4);\n\n  this.isOverlapingSourceAndTarget = IGeometry.getIntersection(this.target.getRect(), this.source.getRect(), clipPointCoordinates);\n\n  if (!this.isOverlapingSourceAndTarget) {\n    this.lengthX = clipPointCoordinates[0] - clipPointCoordinates[2];\n    this.lengthY = clipPointCoordinates[1] - clipPointCoordinates[3];\n\n    if (Math.abs(this.lengthX) < 1.0) {\n      this.lengthX = IMath.sign(this.lengthX);\n    }\n\n    if (Math.abs(this.lengthY) < 1.0) {\n      this.lengthY = IMath.sign(this.lengthY);\n    }\n\n    this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);\n  }\n};\n\nLEdge.prototype.updateLengthSimple = function () {\n  this.lengthX = this.target.getCenterX() - this.source.getCenterX();\n  this.lengthY = this.target.getCenterY() - this.source.getCenterY();\n\n  if (Math.abs(this.lengthX) < 1.0) {\n    this.lengthX = IMath.sign(this.lengthX);\n  }\n\n  if (Math.abs(this.lengthY) < 1.0) {\n    this.lengthY = IMath.sign(this.lengthY);\n  }\n\n  this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);\n};\n\nmodule.exports = LEdge;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction LGraphObject(vGraphObject) {\n  this.vGraphObject = vGraphObject;\n}\n\nmodule.exports = LGraphObject;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraphObject = __webpack_require__(2);\nvar Integer = __webpack_require__(10);\nvar RectangleD = __webpack_require__(13);\nvar LayoutConstants = __webpack_require__(0);\nvar RandomSeed = __webpack_require__(16);\nvar PointD = __webpack_require__(4);\n\nfunction LNode(gm, loc, size, vNode) {\n  //Alternative constructor 1 : LNode(LGraphManager gm, Point loc, Dimension size, Object vNode)\n  if (size == null && vNode == null) {\n    vNode = loc;\n  }\n\n  LGraphObject.call(this, vNode);\n\n  //Alternative constructor 2 : LNode(Layout layout, Object vNode)\n  if (gm.graphManager != null) gm = gm.graphManager;\n\n  this.estimatedSize = Integer.MIN_VALUE;\n  this.inclusionTreeDepth = Integer.MAX_VALUE;\n  this.vGraphObject = vNode;\n  this.edges = [];\n  this.graphManager = gm;\n\n  if (size != null && loc != null) this.rect = new RectangleD(loc.x, loc.y, size.width, size.height);else this.rect = new RectangleD();\n}\n\nLNode.prototype = Object.create(LGraphObject.prototype);\nfor (var prop in LGraphObject) {\n  LNode[prop] = LGraphObject[prop];\n}\n\nLNode.prototype.getEdges = function () {\n  return this.edges;\n};\n\nLNode.prototype.getChild = function () {\n  return this.child;\n};\n\nLNode.prototype.getOwner = function () {\n  //  if (this.owner != null) {\n  //    if (!(this.owner == null || this.owner.getNodes().indexOf(this) > -1)) {\n  //      throw \"assert failed\";\n  //    }\n  //  }\n\n  return this.owner;\n};\n\nLNode.prototype.getWidth = function () {\n  return this.rect.width;\n};\n\nLNode.prototype.setWidth = function (width) {\n  this.rect.width = width;\n};\n\nLNode.prototype.getHeight = function () {\n  return this.rect.height;\n};\n\nLNode.prototype.setHeight = function (height) {\n  this.rect.height = height;\n};\n\nLNode.prototype.getCenterX = function () {\n  return this.rect.x + this.rect.width / 2;\n};\n\nLNode.prototype.getCenterY = function () {\n  return this.rect.y + this.rect.height / 2;\n};\n\nLNode.prototype.getCenter = function () {\n  return new PointD(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);\n};\n\nLNode.prototype.getLocation = function () {\n  return new PointD(this.rect.x, this.rect.y);\n};\n\nLNode.prototype.getRect = function () {\n  return this.rect;\n};\n\nLNode.prototype.getDiagonal = function () {\n  return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);\n};\n\n/**\n * This method returns half the diagonal length of this node.\n */\nLNode.prototype.getHalfTheDiagonal = function () {\n  return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;\n};\n\nLNode.prototype.setRect = function (upperLeft, dimension) {\n  this.rect.x = upperLeft.x;\n  this.rect.y = upperLeft.y;\n  this.rect.width = dimension.width;\n  this.rect.height = dimension.height;\n};\n\nLNode.prototype.setCenter = function (cx, cy) {\n  this.rect.x = cx - this.rect.width / 2;\n  this.rect.y = cy - this.rect.height / 2;\n};\n\nLNode.prototype.setLocation = function (x, y) {\n  this.rect.x = x;\n  this.rect.y = y;\n};\n\nLNode.prototype.moveBy = function (dx, dy) {\n  this.rect.x += dx;\n  this.rect.y += dy;\n};\n\nLNode.prototype.getEdgeListToNode = function (to) {\n  var edgeList = [];\n  var edge;\n  var self = this;\n\n  self.edges.forEach(function (edge) {\n\n    if (edge.target == to) {\n      if (edge.source != self) throw \"Incorrect edge source!\";\n\n      edgeList.push(edge);\n    }\n  });\n\n  return edgeList;\n};\n\nLNode.prototype.getEdgesBetween = function (other) {\n  var edgeList = [];\n  var edge;\n\n  var self = this;\n  self.edges.forEach(function (edge) {\n\n    if (!(edge.source == self || edge.target == self)) throw \"Incorrect edge source and/or target\";\n\n    if (edge.target == other || edge.source == other) {\n      edgeList.push(edge);\n    }\n  });\n\n  return edgeList;\n};\n\nLNode.prototype.getNeighborsList = function () {\n  var neighbors = new Set();\n\n  var self = this;\n  self.edges.forEach(function (edge) {\n\n    if (edge.source == self) {\n      neighbors.add(edge.target);\n    } else {\n      if (edge.target != self) {\n        throw \"Incorrect incidency!\";\n      }\n\n      neighbors.add(edge.source);\n    }\n  });\n\n  return neighbors;\n};\n\nLNode.prototype.withChildren = function () {\n  var withNeighborsList = new Set();\n  var childNode;\n  var children;\n\n  withNeighborsList.add(this);\n\n  if (this.child != null) {\n    var nodes = this.child.getNodes();\n    for (var i = 0; i < nodes.length; i++) {\n      childNode = nodes[i];\n      children = childNode.withChildren();\n      children.forEach(function (node) {\n        withNeighborsList.add(node);\n      });\n    }\n  }\n\n  return withNeighborsList;\n};\n\nLNode.prototype.getNoOfChildren = function () {\n  var noOfChildren = 0;\n  var childNode;\n\n  if (this.child == null) {\n    noOfChildren = 1;\n  } else {\n    var nodes = this.child.getNodes();\n    for (var i = 0; i < nodes.length; i++) {\n      childNode = nodes[i];\n\n      noOfChildren += childNode.getNoOfChildren();\n    }\n  }\n\n  if (noOfChildren == 0) {\n    noOfChildren = 1;\n  }\n  return noOfChildren;\n};\n\nLNode.prototype.getEstimatedSize = function () {\n  if (this.estimatedSize == Integer.MIN_VALUE) {\n    throw \"assert failed\";\n  }\n  return this.estimatedSize;\n};\n\nLNode.prototype.calcEstimatedSize = function () {\n  if (this.child == null) {\n    return this.estimatedSize = (this.rect.width + this.rect.height) / 2;\n  } else {\n    this.estimatedSize = this.child.calcEstimatedSize();\n    this.rect.width = this.estimatedSize;\n    this.rect.height = this.estimatedSize;\n\n    return this.estimatedSize;\n  }\n};\n\nLNode.prototype.scatter = function () {\n  var randomCenterX;\n  var randomCenterY;\n\n  var minX = -LayoutConstants.INITIAL_WORLD_BOUNDARY;\n  var maxX = LayoutConstants.INITIAL_WORLD_BOUNDARY;\n  randomCenterX = LayoutConstants.WORLD_CENTER_X + RandomSeed.nextDouble() * (maxX - minX) + minX;\n\n  var minY = -LayoutConstants.INITIAL_WORLD_BOUNDARY;\n  var maxY = LayoutConstants.INITIAL_WORLD_BOUNDARY;\n  randomCenterY = LayoutConstants.WORLD_CENTER_Y + RandomSeed.nextDouble() * (maxY - minY) + minY;\n\n  this.rect.x = randomCenterX;\n  this.rect.y = randomCenterY;\n};\n\nLNode.prototype.updateBounds = function () {\n  if (this.getChild() == null) {\n    throw \"assert failed\";\n  }\n  if (this.getChild().getNodes().length != 0) {\n    // wrap the children nodes by re-arranging the boundaries\n    var childGraph = this.getChild();\n    childGraph.updateBounds(true);\n\n    this.rect.x = childGraph.getLeft();\n    this.rect.y = childGraph.getTop();\n\n    this.setWidth(childGraph.getRight() - childGraph.getLeft());\n    this.setHeight(childGraph.getBottom() - childGraph.getTop());\n\n    // Update compound bounds considering its label properties    \n    if (LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {\n\n      var width = childGraph.getRight() - childGraph.getLeft();\n      var height = childGraph.getBottom() - childGraph.getTop();\n\n      if (this.labelWidth > width) {\n        this.rect.x -= (this.labelWidth - width) / 2;\n        this.setWidth(this.labelWidth);\n      }\n\n      if (this.labelHeight > height) {\n        if (this.labelPos == \"center\") {\n          this.rect.y -= (this.labelHeight - height) / 2;\n        } else if (this.labelPos == \"top\") {\n          this.rect.y -= this.labelHeight - height;\n        }\n        this.setHeight(this.labelHeight);\n      }\n    }\n  }\n};\n\nLNode.prototype.getInclusionTreeDepth = function () {\n  if (this.inclusionTreeDepth == Integer.MAX_VALUE) {\n    throw \"assert failed\";\n  }\n  return this.inclusionTreeDepth;\n};\n\nLNode.prototype.transform = function (trans) {\n  var left = this.rect.x;\n\n  if (left > LayoutConstants.WORLD_BOUNDARY) {\n    left = LayoutConstants.WORLD_BOUNDARY;\n  } else if (left < -LayoutConstants.WORLD_BOUNDARY) {\n    left = -LayoutConstants.WORLD_BOUNDARY;\n  }\n\n  var top = this.rect.y;\n\n  if (top > LayoutConstants.WORLD_BOUNDARY) {\n    top = LayoutConstants.WORLD_BOUNDARY;\n  } else if (top < -LayoutConstants.WORLD_BOUNDARY) {\n    top = -LayoutConstants.WORLD_BOUNDARY;\n  }\n\n  var leftTop = new PointD(left, top);\n  var vLeftTop = trans.inverseTransformPoint(leftTop);\n\n  this.setLocation(vLeftTop.x, vLeftTop.y);\n};\n\nLNode.prototype.getLeft = function () {\n  return this.rect.x;\n};\n\nLNode.prototype.getRight = function () {\n  return this.rect.x + this.rect.width;\n};\n\nLNode.prototype.getTop = function () {\n  return this.rect.y;\n};\n\nLNode.prototype.getBottom = function () {\n  return this.rect.y + this.rect.height;\n};\n\nLNode.prototype.getParent = function () {\n  if (this.owner == null) {\n    return null;\n  }\n\n  return this.owner.getParent();\n};\n\nmodule.exports = LNode;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction PointD(x, y) {\n  if (x == null && y == null) {\n    this.x = 0;\n    this.y = 0;\n  } else {\n    this.x = x;\n    this.y = y;\n  }\n}\n\nPointD.prototype.getX = function () {\n  return this.x;\n};\n\nPointD.prototype.getY = function () {\n  return this.y;\n};\n\nPointD.prototype.setX = function (x) {\n  this.x = x;\n};\n\nPointD.prototype.setY = function (y) {\n  this.y = y;\n};\n\nPointD.prototype.getDifference = function (pt) {\n  return new DimensionD(this.x - pt.x, this.y - pt.y);\n};\n\nPointD.prototype.getCopy = function () {\n  return new PointD(this.x, this.y);\n};\n\nPointD.prototype.translate = function (dim) {\n  this.x += dim.width;\n  this.y += dim.height;\n  return this;\n};\n\nmodule.exports = PointD;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraphObject = __webpack_require__(2);\nvar Integer = __webpack_require__(10);\nvar LayoutConstants = __webpack_require__(0);\nvar LGraphManager = __webpack_require__(6);\nvar LNode = __webpack_require__(3);\nvar LEdge = __webpack_require__(1);\nvar RectangleD = __webpack_require__(13);\nvar Point = __webpack_require__(12);\nvar LinkedList = __webpack_require__(11);\n\nfunction LGraph(parent, obj2, vGraph) {\n  LGraphObject.call(this, vGraph);\n  this.estimatedSize = Integer.MIN_VALUE;\n  this.margin = LayoutConstants.DEFAULT_GRAPH_MARGIN;\n  this.edges = [];\n  this.nodes = [];\n  this.isConnected = false;\n  this.parent = parent;\n\n  if (obj2 != null && obj2 instanceof LGraphManager) {\n    this.graphManager = obj2;\n  } else if (obj2 != null && obj2 instanceof Layout) {\n    this.graphManager = obj2.graphManager;\n  }\n}\n\nLGraph.prototype = Object.create(LGraphObject.prototype);\nfor (var prop in LGraphObject) {\n  LGraph[prop] = LGraphObject[prop];\n}\n\nLGraph.prototype.getNodes = function () {\n  return this.nodes;\n};\n\nLGraph.prototype.getEdges = function () {\n  return this.edges;\n};\n\nLGraph.prototype.getGraphManager = function () {\n  return this.graphManager;\n};\n\nLGraph.prototype.getParent = function () {\n  return this.parent;\n};\n\nLGraph.prototype.getLeft = function () {\n  return this.left;\n};\n\nLGraph.prototype.getRight = function () {\n  return this.right;\n};\n\nLGraph.prototype.getTop = function () {\n  return this.top;\n};\n\nLGraph.prototype.getBottom = function () {\n  return this.bottom;\n};\n\nLGraph.prototype.isConnected = function () {\n  return this.isConnected;\n};\n\nLGraph.prototype.add = function (obj1, sourceNode, targetNode) {\n  if (sourceNode == null && targetNode == null) {\n    var newNode = obj1;\n    if (this.graphManager == null) {\n      throw \"Graph has no graph mgr!\";\n    }\n    if (this.getNodes().indexOf(newNode) > -1) {\n      throw \"Node already in graph!\";\n    }\n    newNode.owner = this;\n    this.getNodes().push(newNode);\n\n    return newNode;\n  } else {\n    var newEdge = obj1;\n    if (!(this.getNodes().indexOf(sourceNode) > -1 && this.getNodes().indexOf(targetNode) > -1)) {\n      throw \"Source or target not in graph!\";\n    }\n\n    if (!(sourceNode.owner == targetNode.owner && sourceNode.owner == this)) {\n      throw \"Both owners must be this graph!\";\n    }\n\n    if (sourceNode.owner != targetNode.owner) {\n      return null;\n    }\n\n    // set source and target\n    newEdge.source = sourceNode;\n    newEdge.target = targetNode;\n\n    // set as intra-graph edge\n    newEdge.isInterGraph = false;\n\n    // add to graph edge list\n    this.getEdges().push(newEdge);\n\n    // add to incidency lists\n    sourceNode.edges.push(newEdge);\n\n    if (targetNode != sourceNode) {\n      targetNode.edges.push(newEdge);\n    }\n\n    return newEdge;\n  }\n};\n\nLGraph.prototype.remove = function (obj) {\n  var node = obj;\n  if (obj instanceof LNode) {\n    if (node == null) {\n      throw \"Node is null!\";\n    }\n    if (!(node.owner != null && node.owner == this)) {\n      throw \"Owner graph is invalid!\";\n    }\n    if (this.graphManager == null) {\n      throw \"Owner graph manager is invalid!\";\n    }\n    // remove incident edges first (make a copy to do it safely)\n    var edgesToBeRemoved = node.edges.slice();\n    var edge;\n    var s = edgesToBeRemoved.length;\n    for (var i = 0; i < s; i++) {\n      edge = edgesToBeRemoved[i];\n\n      if (edge.isInterGraph) {\n        this.graphManager.remove(edge);\n      } else {\n        edge.source.owner.remove(edge);\n      }\n    }\n\n    // now the node itself\n    var index = this.nodes.indexOf(node);\n    if (index == -1) {\n      throw \"Node not in owner node list!\";\n    }\n\n    this.nodes.splice(index, 1);\n  } else if (obj instanceof LEdge) {\n    var edge = obj;\n    if (edge == null) {\n      throw \"Edge is null!\";\n    }\n    if (!(edge.source != null && edge.target != null)) {\n      throw \"Source and/or target is null!\";\n    }\n    if (!(edge.source.owner != null && edge.target.owner != null && edge.source.owner == this && edge.target.owner == this)) {\n      throw \"Source and/or target owner is invalid!\";\n    }\n\n    var sourceIndex = edge.source.edges.indexOf(edge);\n    var targetIndex = edge.target.edges.indexOf(edge);\n    if (!(sourceIndex > -1 && targetIndex > -1)) {\n      throw \"Source and/or target doesn't know this edge!\";\n    }\n\n    edge.source.edges.splice(sourceIndex, 1);\n\n    if (edge.target != edge.source) {\n      edge.target.edges.splice(targetIndex, 1);\n    }\n\n    var index = edge.source.owner.getEdges().indexOf(edge);\n    if (index == -1) {\n      throw \"Not in owner's edge list!\";\n    }\n\n    edge.source.owner.getEdges().splice(index, 1);\n  }\n};\n\nLGraph.prototype.updateLeftTop = function () {\n  var top = Integer.MAX_VALUE;\n  var left = Integer.MAX_VALUE;\n  var nodeTop;\n  var nodeLeft;\n  var margin;\n\n  var nodes = this.getNodes();\n  var s = nodes.length;\n\n  for (var i = 0; i < s; i++) {\n    var lNode = nodes[i];\n    nodeTop = lNode.getTop();\n    nodeLeft = lNode.getLeft();\n\n    if (top > nodeTop) {\n      top = nodeTop;\n    }\n\n    if (left > nodeLeft) {\n      left = nodeLeft;\n    }\n  }\n\n  // Do we have any nodes in this graph?\n  if (top == Integer.MAX_VALUE) {\n    return null;\n  }\n\n  if (nodes[0].getParent().paddingLeft != undefined) {\n    margin = nodes[0].getParent().paddingLeft;\n  } else {\n    margin = this.margin;\n  }\n\n  this.left = left - margin;\n  this.top = top - margin;\n\n  // Apply the margins and return the result\n  return new Point(this.left, this.top);\n};\n\nLGraph.prototype.updateBounds = function (recursive) {\n  // calculate bounds\n  var left = Integer.MAX_VALUE;\n  var right = -Integer.MAX_VALUE;\n  var top = Integer.MAX_VALUE;\n  var bottom = -Integer.MAX_VALUE;\n  var nodeLeft;\n  var nodeRight;\n  var nodeTop;\n  var nodeBottom;\n  var margin;\n\n  var nodes = this.nodes;\n  var s = nodes.length;\n  for (var i = 0; i < s; i++) {\n    var lNode = nodes[i];\n\n    if (recursive && lNode.child != null) {\n      lNode.updateBounds();\n    }\n    nodeLeft = lNode.getLeft();\n    nodeRight = lNode.getRight();\n    nodeTop = lNode.getTop();\n    nodeBottom = lNode.getBottom();\n\n    if (left > nodeLeft) {\n      left = nodeLeft;\n    }\n\n    if (right < nodeRight) {\n      right = nodeRight;\n    }\n\n    if (top > nodeTop) {\n      top = nodeTop;\n    }\n\n    if (bottom < nodeBottom) {\n      bottom = nodeBottom;\n    }\n  }\n\n  var boundingRect = new RectangleD(left, top, right - left, bottom - top);\n  if (left == Integer.MAX_VALUE) {\n    this.left = this.parent.getLeft();\n    this.right = this.parent.getRight();\n    this.top = this.parent.getTop();\n    this.bottom = this.parent.getBottom();\n  }\n\n  if (nodes[0].getParent().paddingLeft != undefined) {\n    margin = nodes[0].getParent().paddingLeft;\n  } else {\n    margin = this.margin;\n  }\n\n  this.left = boundingRect.x - margin;\n  this.right = boundingRect.x + boundingRect.width + margin;\n  this.top = boundingRect.y - margin;\n  this.bottom = boundingRect.y + boundingRect.height + margin;\n};\n\nLGraph.calculateBounds = function (nodes) {\n  var left = Integer.MAX_VALUE;\n  var right = -Integer.MAX_VALUE;\n  var top = Integer.MAX_VALUE;\n  var bottom = -Integer.MAX_VALUE;\n  var nodeLeft;\n  var nodeRight;\n  var nodeTop;\n  var nodeBottom;\n\n  var s = nodes.length;\n\n  for (var i = 0; i < s; i++) {\n    var lNode = nodes[i];\n    nodeLeft = lNode.getLeft();\n    nodeRight = lNode.getRight();\n    nodeTop = lNode.getTop();\n    nodeBottom = lNode.getBottom();\n\n    if (left > nodeLeft) {\n      left = nodeLeft;\n    }\n\n    if (right < nodeRight) {\n      right = nodeRight;\n    }\n\n    if (top > nodeTop) {\n      top = nodeTop;\n    }\n\n    if (bottom < nodeBottom) {\n      bottom = nodeBottom;\n    }\n  }\n\n  var boundingRect = new RectangleD(left, top, right - left, bottom - top);\n\n  return boundingRect;\n};\n\nLGraph.prototype.getInclusionTreeDepth = function () {\n  if (this == this.graphManager.getRoot()) {\n    return 1;\n  } else {\n    return this.parent.getInclusionTreeDepth();\n  }\n};\n\nLGraph.prototype.getEstimatedSize = function () {\n  if (this.estimatedSize == Integer.MIN_VALUE) {\n    throw \"assert failed\";\n  }\n  return this.estimatedSize;\n};\n\nLGraph.prototype.calcEstimatedSize = function () {\n  var size = 0;\n  var nodes = this.nodes;\n  var s = nodes.length;\n\n  for (var i = 0; i < s; i++) {\n    var lNode = nodes[i];\n    size += lNode.calcEstimatedSize();\n  }\n\n  if (size == 0) {\n    this.estimatedSize = LayoutConstants.EMPTY_COMPOUND_NODE_SIZE;\n  } else {\n    this.estimatedSize = size / Math.sqrt(this.nodes.length);\n  }\n\n  return this.estimatedSize;\n};\n\nLGraph.prototype.updateConnected = function () {\n  var self = this;\n  if (this.nodes.length == 0) {\n    this.isConnected = true;\n    return;\n  }\n\n  var queue = new LinkedList();\n  var visited = new Set();\n  var currentNode = this.nodes[0];\n  var neighborEdges;\n  var currentNeighbor;\n  var childrenOfNode = currentNode.withChildren();\n  childrenOfNode.forEach(function (node) {\n    queue.push(node);\n    visited.add(node);\n  });\n\n  while (queue.length !== 0) {\n    currentNode = queue.shift();\n\n    // Traverse all neighbors of this node\n    neighborEdges = currentNode.getEdges();\n    var size = neighborEdges.length;\n    for (var i = 0; i < size; i++) {\n      var neighborEdge = neighborEdges[i];\n      currentNeighbor = neighborEdge.getOtherEndInGraph(currentNode, this);\n\n      // Add unvisited neighbors to the list to visit\n      if (currentNeighbor != null && !visited.has(currentNeighbor)) {\n        var childrenOfNeighbor = currentNeighbor.withChildren();\n\n        childrenOfNeighbor.forEach(function (node) {\n          queue.push(node);\n          visited.add(node);\n        });\n      }\n    }\n  }\n\n  this.isConnected = false;\n\n  if (visited.size >= this.nodes.length) {\n    var noOfVisitedInThisGraph = 0;\n\n    visited.forEach(function (visitedNode) {\n      if (visitedNode.owner == self) {\n        noOfVisitedInThisGraph++;\n      }\n    });\n\n    if (noOfVisitedInThisGraph == this.nodes.length) {\n      this.isConnected = true;\n    }\n  }\n};\n\nmodule.exports = LGraph;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraph;\nvar LEdge = __webpack_require__(1);\n\nfunction LGraphManager(layout) {\n  LGraph = __webpack_require__(5); // It may be better to initilize this out of this function but it gives an error (Right-hand side of 'instanceof' is not callable) now.\n  this.layout = layout;\n\n  this.graphs = [];\n  this.edges = [];\n}\n\nLGraphManager.prototype.addRoot = function () {\n  var ngraph = this.layout.newGraph();\n  var nnode = this.layout.newNode(null);\n  var root = this.add(ngraph, nnode);\n  this.setRootGraph(root);\n  return this.rootGraph;\n};\n\nLGraphManager.prototype.add = function (newGraph, parentNode, newEdge, sourceNode, targetNode) {\n  //there are just 2 parameters are passed then it adds an LGraph else it adds an LEdge\n  if (newEdge == null && sourceNode == null && targetNode == null) {\n    if (newGraph == null) {\n      throw \"Graph is null!\";\n    }\n    if (parentNode == null) {\n      throw \"Parent node is null!\";\n    }\n    if (this.graphs.indexOf(newGraph) > -1) {\n      throw \"Graph already in this graph mgr!\";\n    }\n\n    this.graphs.push(newGraph);\n\n    if (newGraph.parent != null) {\n      throw \"Already has a parent!\";\n    }\n    if (parentNode.child != null) {\n      throw \"Already has a child!\";\n    }\n\n    newGraph.parent = parentNode;\n    parentNode.child = newGraph;\n\n    return newGraph;\n  } else {\n    //change the order of the parameters\n    targetNode = newEdge;\n    sourceNode = parentNode;\n    newEdge = newGraph;\n    var sourceGraph = sourceNode.getOwner();\n    var targetGraph = targetNode.getOwner();\n\n    if (!(sourceGraph != null && sourceGraph.getGraphManager() == this)) {\n      throw \"Source not in this graph mgr!\";\n    }\n    if (!(targetGraph != null && targetGraph.getGraphManager() == this)) {\n      throw \"Target not in this graph mgr!\";\n    }\n\n    if (sourceGraph == targetGraph) {\n      newEdge.isInterGraph = false;\n      return sourceGraph.add(newEdge, sourceNode, targetNode);\n    } else {\n      newEdge.isInterGraph = true;\n\n      // set source and target\n      newEdge.source = sourceNode;\n      newEdge.target = targetNode;\n\n      // add edge to inter-graph edge list\n      if (this.edges.indexOf(newEdge) > -1) {\n        throw \"Edge already in inter-graph edge list!\";\n      }\n\n      this.edges.push(newEdge);\n\n      // add edge to source and target incidency lists\n      if (!(newEdge.source != null && newEdge.target != null)) {\n        throw \"Edge source and/or target is null!\";\n      }\n\n      if (!(newEdge.source.edges.indexOf(newEdge) == -1 && newEdge.target.edges.indexOf(newEdge) == -1)) {\n        throw \"Edge already in source and/or target incidency list!\";\n      }\n\n      newEdge.source.edges.push(newEdge);\n      newEdge.target.edges.push(newEdge);\n\n      return newEdge;\n    }\n  }\n};\n\nLGraphManager.prototype.remove = function (lObj) {\n  if (lObj instanceof LGraph) {\n    var graph = lObj;\n    if (graph.getGraphManager() != this) {\n      throw \"Graph not in this graph mgr\";\n    }\n    if (!(graph == this.rootGraph || graph.parent != null && graph.parent.graphManager == this)) {\n      throw \"Invalid parent node!\";\n    }\n\n    // first the edges (make a copy to do it safely)\n    var edgesToBeRemoved = [];\n\n    edgesToBeRemoved = edgesToBeRemoved.concat(graph.getEdges());\n\n    var edge;\n    var s = edgesToBeRemoved.length;\n    for (var i = 0; i < s; i++) {\n      edge = edgesToBeRemoved[i];\n      graph.remove(edge);\n    }\n\n    // then the nodes (make a copy to do it safely)\n    var nodesToBeRemoved = [];\n\n    nodesToBeRemoved = nodesToBeRemoved.concat(graph.getNodes());\n\n    var node;\n    s = nodesToBeRemoved.length;\n    for (var i = 0; i < s; i++) {\n      node = nodesToBeRemoved[i];\n      graph.remove(node);\n    }\n\n    // check if graph is the root\n    if (graph == this.rootGraph) {\n      this.setRootGraph(null);\n    }\n\n    // now remove the graph itself\n    var index = this.graphs.indexOf(graph);\n    this.graphs.splice(index, 1);\n\n    // also reset the parent of the graph\n    graph.parent = null;\n  } else if (lObj instanceof LEdge) {\n    edge = lObj;\n    if (edge == null) {\n      throw \"Edge is null!\";\n    }\n    if (!edge.isInterGraph) {\n      throw \"Not an inter-graph edge!\";\n    }\n    if (!(edge.source != null && edge.target != null)) {\n      throw \"Source and/or target is null!\";\n    }\n\n    // remove edge from source and target nodes' incidency lists\n\n    if (!(edge.source.edges.indexOf(edge) != -1 && edge.target.edges.indexOf(edge) != -1)) {\n      throw \"Source and/or target doesn't know this edge!\";\n    }\n\n    var index = edge.source.edges.indexOf(edge);\n    edge.source.edges.splice(index, 1);\n    index = edge.target.edges.indexOf(edge);\n    edge.target.edges.splice(index, 1);\n\n    // remove edge from owner graph manager's inter-graph edge list\n\n    if (!(edge.source.owner != null && edge.source.owner.getGraphManager() != null)) {\n      throw \"Edge owner graph or owner graph manager is null!\";\n    }\n    if (edge.source.owner.getGraphManager().edges.indexOf(edge) == -1) {\n      throw \"Not in owner graph manager's edge list!\";\n    }\n\n    var index = edge.source.owner.getGraphManager().edges.indexOf(edge);\n    edge.source.owner.getGraphManager().edges.splice(index, 1);\n  }\n};\n\nLGraphManager.prototype.updateBounds = function () {\n  this.rootGraph.updateBounds(true);\n};\n\nLGraphManager.prototype.getGraphs = function () {\n  return this.graphs;\n};\n\nLGraphManager.prototype.getAllNodes = function () {\n  if (this.allNodes == null) {\n    var nodeList = [];\n    var graphs = this.getGraphs();\n    var s = graphs.length;\n    for (var i = 0; i < s; i++) {\n      nodeList = nodeList.concat(graphs[i].getNodes());\n    }\n    this.allNodes = nodeList;\n  }\n  return this.allNodes;\n};\n\nLGraphManager.prototype.resetAllNodes = function () {\n  this.allNodes = null;\n};\n\nLGraphManager.prototype.resetAllEdges = function () {\n  this.allEdges = null;\n};\n\nLGraphManager.prototype.resetAllNodesToApplyGravitation = function () {\n  this.allNodesToApplyGravitation = null;\n};\n\nLGraphManager.prototype.getAllEdges = function () {\n  if (this.allEdges == null) {\n    var edgeList = [];\n    var graphs = this.getGraphs();\n    var s = graphs.length;\n    for (var i = 0; i < graphs.length; i++) {\n      edgeList = edgeList.concat(graphs[i].getEdges());\n    }\n\n    edgeList = edgeList.concat(this.edges);\n\n    this.allEdges = edgeList;\n  }\n  return this.allEdges;\n};\n\nLGraphManager.prototype.getAllNodesToApplyGravitation = function () {\n  return this.allNodesToApplyGravitation;\n};\n\nLGraphManager.prototype.setAllNodesToApplyGravitation = function (nodeList) {\n  if (this.allNodesToApplyGravitation != null) {\n    throw \"assert failed\";\n  }\n\n  this.allNodesToApplyGravitation = nodeList;\n};\n\nLGraphManager.prototype.getRoot = function () {\n  return this.rootGraph;\n};\n\nLGraphManager.prototype.setRootGraph = function (graph) {\n  if (graph.getGraphManager() != this) {\n    throw \"Root not in this graph mgr!\";\n  }\n\n  this.rootGraph = graph;\n  // root graph must have a root node associated with it for convenience\n  if (graph.parent == null) {\n    graph.parent = this.layout.newNode(\"Root node\");\n  }\n};\n\nLGraphManager.prototype.getLayout = function () {\n  return this.layout;\n};\n\nLGraphManager.prototype.isOneAncestorOfOther = function (firstNode, secondNode) {\n  if (!(firstNode != null && secondNode != null)) {\n    throw \"assert failed\";\n  }\n\n  if (firstNode == secondNode) {\n    return true;\n  }\n  // Is second node an ancestor of the first one?\n  var ownerGraph = firstNode.getOwner();\n  var parentNode;\n\n  do {\n    parentNode = ownerGraph.getParent();\n\n    if (parentNode == null) {\n      break;\n    }\n\n    if (parentNode == secondNode) {\n      return true;\n    }\n\n    ownerGraph = parentNode.getOwner();\n    if (ownerGraph == null) {\n      break;\n    }\n  } while (true);\n  // Is first node an ancestor of the second one?\n  ownerGraph = secondNode.getOwner();\n\n  do {\n    parentNode = ownerGraph.getParent();\n\n    if (parentNode == null) {\n      break;\n    }\n\n    if (parentNode == firstNode) {\n      return true;\n    }\n\n    ownerGraph = parentNode.getOwner();\n    if (ownerGraph == null) {\n      break;\n    }\n  } while (true);\n\n  return false;\n};\n\nLGraphManager.prototype.calcLowestCommonAncestors = function () {\n  var edge;\n  var sourceNode;\n  var targetNode;\n  var sourceAncestorGraph;\n  var targetAncestorGraph;\n\n  var edges = this.getAllEdges();\n  var s = edges.length;\n  for (var i = 0; i < s; i++) {\n    edge = edges[i];\n\n    sourceNode = edge.source;\n    targetNode = edge.target;\n    edge.lca = null;\n    edge.sourceInLca = sourceNode;\n    edge.targetInLca = targetNode;\n\n    if (sourceNode == targetNode) {\n      edge.lca = sourceNode.getOwner();\n      continue;\n    }\n\n    sourceAncestorGraph = sourceNode.getOwner();\n\n    while (edge.lca == null) {\n      edge.targetInLca = targetNode;\n      targetAncestorGraph = targetNode.getOwner();\n\n      while (edge.lca == null) {\n        if (targetAncestorGraph == sourceAncestorGraph) {\n          edge.lca = targetAncestorGraph;\n          break;\n        }\n\n        if (targetAncestorGraph == this.rootGraph) {\n          break;\n        }\n\n        if (edge.lca != null) {\n          throw \"assert failed\";\n        }\n        edge.targetInLca = targetAncestorGraph.getParent();\n        targetAncestorGraph = edge.targetInLca.getOwner();\n      }\n\n      if (sourceAncestorGraph == this.rootGraph) {\n        break;\n      }\n\n      if (edge.lca == null) {\n        edge.sourceInLca = sourceAncestorGraph.getParent();\n        sourceAncestorGraph = edge.sourceInLca.getOwner();\n      }\n    }\n\n    if (edge.lca == null) {\n      throw \"assert failed\";\n    }\n  }\n};\n\nLGraphManager.prototype.calcLowestCommonAncestor = function (firstNode, secondNode) {\n  if (firstNode == secondNode) {\n    return firstNode.getOwner();\n  }\n  var firstOwnerGraph = firstNode.getOwner();\n\n  do {\n    if (firstOwnerGraph == null) {\n      break;\n    }\n    var secondOwnerGraph = secondNode.getOwner();\n\n    do {\n      if (secondOwnerGraph == null) {\n        break;\n      }\n\n      if (secondOwnerGraph == firstOwnerGraph) {\n        return secondOwnerGraph;\n      }\n      secondOwnerGraph = secondOwnerGraph.getParent().getOwner();\n    } while (true);\n\n    firstOwnerGraph = firstOwnerGraph.getParent().getOwner();\n  } while (true);\n\n  return firstOwnerGraph;\n};\n\nLGraphManager.prototype.calcInclusionTreeDepths = function (graph, depth) {\n  if (graph == null && depth == null) {\n    graph = this.rootGraph;\n    depth = 1;\n  }\n  var node;\n\n  var nodes = graph.getNodes();\n  var s = nodes.length;\n  for (var i = 0; i < s; i++) {\n    node = nodes[i];\n    node.inclusionTreeDepth = depth;\n\n    if (node.child != null) {\n      this.calcInclusionTreeDepths(node.child, depth + 1);\n    }\n  }\n};\n\nLGraphManager.prototype.includesInvalidEdge = function () {\n  var edge;\n\n  var s = this.edges.length;\n  for (var i = 0; i < s; i++) {\n    edge = this.edges[i];\n\n    if (this.isOneAncestorOfOther(edge.source, edge.target)) {\n      return true;\n    }\n  }\n  return false;\n};\n\nmodule.exports = LGraphManager;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LayoutConstants = __webpack_require__(0);\n\nfunction FDLayoutConstants() {}\n\n//FDLayoutConstants inherits static props in LayoutConstants\nfor (var prop in LayoutConstants) {\n  FDLayoutConstants[prop] = LayoutConstants[prop];\n}\n\nFDLayoutConstants.MAX_ITERATIONS = 2500;\n\nFDLayoutConstants.DEFAULT_EDGE_LENGTH = 50;\nFDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45;\nFDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500.0;\nFDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4;\nFDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1.0;\nFDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8;\nFDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5;\nFDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true;\nFDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true;\nFDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3;\nFDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33;\nFDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1000;\nFDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5000;\nFDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100.0;\nFDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3;\nFDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10.0;\nFDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100;\nFDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1;\nFDLayoutConstants.MIN_EDGE_LENGTH = 1;\nFDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10;\n\nmodule.exports = FDLayoutConstants;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * This class maintains a list of static geometry related utility methods.\n *\n *\n * Copyright: i-Vis Research Group, Bilkent University, 2007 - present\n */\n\nvar Point = __webpack_require__(12);\n\nfunction IGeometry() {}\n\n/**\n * This method calculates *half* the amount in x and y directions of the two\n * input rectangles needed to separate them keeping their respective\n * positioning, and returns the result in the input array. An input\n * separation buffer added to the amount in both directions. We assume that\n * the two rectangles do intersect.\n */\nIGeometry.calcSeparationAmount = function (rectA, rectB, overlapAmount, separationBuffer) {\n  if (!rectA.intersects(rectB)) {\n    throw \"assert failed\";\n  }\n\n  var directions = new Array(2);\n\n  this.decideDirectionsForOverlappingNodes(rectA, rectB, directions);\n\n  overlapAmount[0] = Math.min(rectA.getRight(), rectB.getRight()) - Math.max(rectA.x, rectB.x);\n  overlapAmount[1] = Math.min(rectA.getBottom(), rectB.getBottom()) - Math.max(rectA.y, rectB.y);\n\n  // update the overlapping amounts for the following cases:\n  if (rectA.getX() <= rectB.getX() && rectA.getRight() >= rectB.getRight()) {\n    /* Case x.1:\n    *\n    * rectA\n    * \t|                       |\n    * \t|        _________      |\n    * \t|        |       |      |\n    * \t|________|_______|______|\n    * \t\t\t |       |\n    *           |       |\n    *        rectB\n    */\n    overlapAmount[0] += Math.min(rectB.getX() - rectA.getX(), rectA.getRight() - rectB.getRight());\n  } else if (rectB.getX() <= rectA.getX() && rectB.getRight() >= rectA.getRight()) {\n    /* Case x.2:\n    *\n    * rectB\n    * \t|                       |\n    * \t|        _________      |\n    * \t|        |       |      |\n    * \t|________|_______|______|\n    * \t\t\t |       |\n    *           |       |\n    *        rectA\n    */\n    overlapAmount[0] += Math.min(rectA.getX() - rectB.getX(), rectB.getRight() - rectA.getRight());\n  }\n  if (rectA.getY() <= rectB.getY() && rectA.getBottom() >= rectB.getBottom()) {\n    /* Case y.1:\n     *          ________ rectA\n     *         |\n     *         |\n     *   ______|____  rectB\n     *         |    |\n     *         |    |\n     *   ______|____|\n     *         |\n     *         |\n     *         |________\n     *\n     */\n    overlapAmount[1] += Math.min(rectB.getY() - rectA.getY(), rectA.getBottom() - rectB.getBottom());\n  } else if (rectB.getY() <= rectA.getY() && rectB.getBottom() >= rectA.getBottom()) {\n    /* Case y.2:\n    *          ________ rectB\n    *         |\n    *         |\n    *   ______|____  rectA\n    *         |    |\n    *         |    |\n    *   ______|____|\n    *         |\n    *         |\n    *         |________\n    *\n    */\n    overlapAmount[1] += Math.min(rectA.getY() - rectB.getY(), rectB.getBottom() - rectA.getBottom());\n  }\n\n  // find slope of the line passes two centers\n  var slope = Math.abs((rectB.getCenterY() - rectA.getCenterY()) / (rectB.getCenterX() - rectA.getCenterX()));\n  // if centers are overlapped\n  if (rectB.getCenterY() === rectA.getCenterY() && rectB.getCenterX() === rectA.getCenterX()) {\n    // assume the slope is 1 (45 degree)\n    slope = 1.0;\n  }\n\n  var moveByY = slope * overlapAmount[0];\n  var moveByX = overlapAmount[1] / slope;\n  if (overlapAmount[0] < moveByX) {\n    moveByX = overlapAmount[0];\n  } else {\n    moveByY = overlapAmount[1];\n  }\n  // return half the amount so that if each rectangle is moved by these\n  // amounts in opposite directions, overlap will be resolved\n  overlapAmount[0] = -1 * directions[0] * (moveByX / 2 + separationBuffer);\n  overlapAmount[1] = -1 * directions[1] * (moveByY / 2 + separationBuffer);\n};\n\n/**\n * This method decides the separation direction of overlapping nodes\n *\n * if directions[0] = -1, then rectA goes left\n * if directions[0] = 1,  then rectA goes right\n * if directions[1] = -1, then rectA goes up\n * if directions[1] = 1,  then rectA goes down\n */\nIGeometry.decideDirectionsForOverlappingNodes = function (rectA, rectB, directions) {\n  if (rectA.getCenterX() < rectB.getCenterX()) {\n    directions[0] = -1;\n  } else {\n    directions[0] = 1;\n  }\n\n  if (rectA.getCenterY() < rectB.getCenterY()) {\n    directions[1] = -1;\n  } else {\n    directions[1] = 1;\n  }\n};\n\n/**\n * This method calculates the intersection (clipping) points of the two\n * input rectangles with line segment defined by the centers of these two\n * rectangles. The clipping points are saved in the input double array and\n * whether or not the two rectangles overlap is returned.\n */\nIGeometry.getIntersection2 = function (rectA, rectB, result) {\n  //result[0-1] will contain clipPoint of rectA, result[2-3] will contain clipPoint of rectB\n  var p1x = rectA.getCenterX();\n  var p1y = rectA.getCenterY();\n  var p2x = rectB.getCenterX();\n  var p2y = rectB.getCenterY();\n\n  //if two rectangles intersect, then clipping points are centers\n  if (rectA.intersects(rectB)) {\n    result[0] = p1x;\n    result[1] = p1y;\n    result[2] = p2x;\n    result[3] = p2y;\n    return true;\n  }\n  //variables for rectA\n  var topLeftAx = rectA.getX();\n  var topLeftAy = rectA.getY();\n  var topRightAx = rectA.getRight();\n  var bottomLeftAx = rectA.getX();\n  var bottomLeftAy = rectA.getBottom();\n  var bottomRightAx = rectA.getRight();\n  var halfWidthA = rectA.getWidthHalf();\n  var halfHeightA = rectA.getHeightHalf();\n  //variables for rectB\n  var topLeftBx = rectB.getX();\n  var topLeftBy = rectB.getY();\n  var topRightBx = rectB.getRight();\n  var bottomLeftBx = rectB.getX();\n  var bottomLeftBy = rectB.getBottom();\n  var bottomRightBx = rectB.getRight();\n  var halfWidthB = rectB.getWidthHalf();\n  var halfHeightB = rectB.getHeightHalf();\n\n  //flag whether clipping points are found\n  var clipPointAFound = false;\n  var clipPointBFound = false;\n\n  // line is vertical\n  if (p1x === p2x) {\n    if (p1y > p2y) {\n      result[0] = p1x;\n      result[1] = topLeftAy;\n      result[2] = p2x;\n      result[3] = bottomLeftBy;\n      return false;\n    } else if (p1y < p2y) {\n      result[0] = p1x;\n      result[1] = bottomLeftAy;\n      result[2] = p2x;\n      result[3] = topLeftBy;\n      return false;\n    } else {\n      //not line, return null;\n    }\n  }\n  // line is horizontal\n  else if (p1y === p2y) {\n      if (p1x > p2x) {\n        result[0] = topLeftAx;\n        result[1] = p1y;\n        result[2] = topRightBx;\n        result[3] = p2y;\n        return false;\n      } else if (p1x < p2x) {\n        result[0] = topRightAx;\n        result[1] = p1y;\n        result[2] = topLeftBx;\n        result[3] = p2y;\n        return false;\n      } else {\n        //not valid line, return null;\n      }\n    } else {\n      //slopes of rectA's and rectB's diagonals\n      var slopeA = rectA.height / rectA.width;\n      var slopeB = rectB.height / rectB.width;\n\n      //slope of line between center of rectA and center of rectB\n      var slopePrime = (p2y - p1y) / (p2x - p1x);\n      var cardinalDirectionA = void 0;\n      var cardinalDirectionB = void 0;\n      var tempPointAx = void 0;\n      var tempPointAy = void 0;\n      var tempPointBx = void 0;\n      var tempPointBy = void 0;\n\n      //determine whether clipping point is the corner of nodeA\n      if (-slopeA === slopePrime) {\n        if (p1x > p2x) {\n          result[0] = bottomLeftAx;\n          result[1] = bottomLeftAy;\n          clipPointAFound = true;\n        } else {\n          result[0] = topRightAx;\n          result[1] = topLeftAy;\n          clipPointAFound = true;\n        }\n      } else if (slopeA === slopePrime) {\n        if (p1x > p2x) {\n          result[0] = topLeftAx;\n          result[1] = topLeftAy;\n          clipPointAFound = true;\n        } else {\n          result[0] = bottomRightAx;\n          result[1] = bottomLeftAy;\n          clipPointAFound = true;\n        }\n      }\n\n      //determine whether clipping point is the corner of nodeB\n      if (-slopeB === slopePrime) {\n        if (p2x > p1x) {\n          result[2] = bottomLeftBx;\n          result[3] = bottomLeftBy;\n          clipPointBFound = true;\n        } else {\n          result[2] = topRightBx;\n          result[3] = topLeftBy;\n          clipPointBFound = true;\n        }\n      } else if (slopeB === slopePrime) {\n        if (p2x > p1x) {\n          result[2] = topLeftBx;\n          result[3] = topLeftBy;\n          clipPointBFound = true;\n        } else {\n          result[2] = bottomRightBx;\n          result[3] = bottomLeftBy;\n          clipPointBFound = true;\n        }\n      }\n\n      //if both clipping points are corners\n      if (clipPointAFound && clipPointBFound) {\n        return false;\n      }\n\n      //determine Cardinal Direction of rectangles\n      if (p1x > p2x) {\n        if (p1y > p2y) {\n          cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 4);\n          cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 2);\n        } else {\n          cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 3);\n          cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 1);\n        }\n      } else {\n        if (p1y > p2y) {\n          cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 1);\n          cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 3);\n        } else {\n          cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 2);\n          cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 4);\n        }\n      }\n      //calculate clipping Point if it is not found before\n      if (!clipPointAFound) {\n        switch (cardinalDirectionA) {\n          case 1:\n            tempPointAy = topLeftAy;\n            tempPointAx = p1x + -halfHeightA / slopePrime;\n            result[0] = tempPointAx;\n            result[1] = tempPointAy;\n            break;\n          case 2:\n            tempPointAx = bottomRightAx;\n            tempPointAy = p1y + halfWidthA * slopePrime;\n            result[0] = tempPointAx;\n            result[1] = tempPointAy;\n            break;\n          case 3:\n            tempPointAy = bottomLeftAy;\n            tempPointAx = p1x + halfHeightA / slopePrime;\n            result[0] = tempPointAx;\n            result[1] = tempPointAy;\n            break;\n          case 4:\n            tempPointAx = bottomLeftAx;\n            tempPointAy = p1y + -halfWidthA * slopePrime;\n            result[0] = tempPointAx;\n            result[1] = tempPointAy;\n            break;\n        }\n      }\n      if (!clipPointBFound) {\n        switch (cardinalDirectionB) {\n          case 1:\n            tempPointBy = topLeftBy;\n            tempPointBx = p2x + -halfHeightB / slopePrime;\n            result[2] = tempPointBx;\n            result[3] = tempPointBy;\n            break;\n          case 2:\n            tempPointBx = bottomRightBx;\n            tempPointBy = p2y + halfWidthB * slopePrime;\n            result[2] = tempPointBx;\n            result[3] = tempPointBy;\n            break;\n          case 3:\n            tempPointBy = bottomLeftBy;\n            tempPointBx = p2x + halfHeightB / slopePrime;\n            result[2] = tempPointBx;\n            result[3] = tempPointBy;\n            break;\n          case 4:\n            tempPointBx = bottomLeftBx;\n            tempPointBy = p2y + -halfWidthB * slopePrime;\n            result[2] = tempPointBx;\n            result[3] = tempPointBy;\n            break;\n        }\n      }\n    }\n  return false;\n};\n\n/**\n * This method returns in which cardinal direction does input point stays\n * 1: North\n * 2: East\n * 3: South\n * 4: West\n */\nIGeometry.getCardinalDirection = function (slope, slopePrime, line) {\n  if (slope > slopePrime) {\n    return line;\n  } else {\n    return 1 + line % 4;\n  }\n};\n\n/**\n * This method calculates the intersection of the two lines defined by\n * point pairs (s1,s2) and (f1,f2).\n */\nIGeometry.getIntersection = function (s1, s2, f1, f2) {\n  if (f2 == null) {\n    return this.getIntersection2(s1, s2, f1);\n  }\n\n  var x1 = s1.x;\n  var y1 = s1.y;\n  var x2 = s2.x;\n  var y2 = s2.y;\n  var x3 = f1.x;\n  var y3 = f1.y;\n  var x4 = f2.x;\n  var y4 = f2.y;\n  var x = void 0,\n      y = void 0; // intersection point\n  var a1 = void 0,\n      a2 = void 0,\n      b1 = void 0,\n      b2 = void 0,\n      c1 = void 0,\n      c2 = void 0; // coefficients of line eqns.\n  var denom = void 0;\n\n  a1 = y2 - y1;\n  b1 = x1 - x2;\n  c1 = x2 * y1 - x1 * y2; // { a1*x + b1*y + c1 = 0 is line 1 }\n\n  a2 = y4 - y3;\n  b2 = x3 - x4;\n  c2 = x4 * y3 - x3 * y4; // { a2*x + b2*y + c2 = 0 is line 2 }\n\n  denom = a1 * b2 - a2 * b1;\n\n  if (denom === 0) {\n    return null;\n  }\n\n  x = (b1 * c2 - b2 * c1) / denom;\n  y = (a2 * c1 - a1 * c2) / denom;\n\n  return new Point(x, y);\n};\n\n/**\n * This method finds and returns the angle of the vector from the + x-axis\n * in clockwise direction (compatible w/ Java coordinate system!).\n */\nIGeometry.angleOfVector = function (Cx, Cy, Nx, Ny) {\n  var C_angle = void 0;\n\n  if (Cx !== Nx) {\n    C_angle = Math.atan((Ny - Cy) / (Nx - Cx));\n\n    if (Nx < Cx) {\n      C_angle += Math.PI;\n    } else if (Ny < Cy) {\n      C_angle += this.TWO_PI;\n    }\n  } else if (Ny < Cy) {\n    C_angle = this.ONE_AND_HALF_PI; // 270 degrees\n  } else {\n    C_angle = this.HALF_PI; // 90 degrees\n  }\n\n  return C_angle;\n};\n\n/**\n * This method checks whether the given two line segments (one with point\n * p1 and p2, the other with point p3 and p4) intersect at a point other\n * than these points.\n */\nIGeometry.doIntersect = function (p1, p2, p3, p4) {\n  var a = p1.x;\n  var b = p1.y;\n  var c = p2.x;\n  var d = p2.y;\n  var p = p3.x;\n  var q = p3.y;\n  var r = p4.x;\n  var s = p4.y;\n  var det = (c - a) * (s - q) - (r - p) * (d - b);\n\n  if (det === 0) {\n    return false;\n  } else {\n    var lambda = ((s - q) * (r - a) + (p - r) * (s - b)) / det;\n    var gamma = ((b - d) * (r - a) + (c - a) * (s - b)) / det;\n    return 0 < lambda && lambda < 1 && 0 < gamma && gamma < 1;\n  }\n};\n\n// -----------------------------------------------------------------------------\n// Section: Class Constants\n// -----------------------------------------------------------------------------\n/**\n * Some useful pre-calculated constants\n */\nIGeometry.HALF_PI = 0.5 * Math.PI;\nIGeometry.ONE_AND_HALF_PI = 1.5 * Math.PI;\nIGeometry.TWO_PI = 2.0 * Math.PI;\nIGeometry.THREE_PI = 3.0 * Math.PI;\n\nmodule.exports = IGeometry;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction IMath() {}\n\n/**\n * This method returns the sign of the input value.\n */\nIMath.sign = function (value) {\n  if (value > 0) {\n    return 1;\n  } else if (value < 0) {\n    return -1;\n  } else {\n    return 0;\n  }\n};\n\nIMath.floor = function (value) {\n  return value < 0 ? Math.ceil(value) : Math.floor(value);\n};\n\nIMath.ceil = function (value) {\n  return value < 0 ? Math.floor(value) : Math.ceil(value);\n};\n\nmodule.exports = IMath;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction Integer() {}\n\nInteger.MAX_VALUE = 2147483647;\nInteger.MIN_VALUE = -2147483648;\n\nmodule.exports = Integer;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar nodeFrom = function nodeFrom(value) {\n  return { value: value, next: null, prev: null };\n};\n\nvar add = function add(prev, node, next, list) {\n  if (prev !== null) {\n    prev.next = node;\n  } else {\n    list.head = node;\n  }\n\n  if (next !== null) {\n    next.prev = node;\n  } else {\n    list.tail = node;\n  }\n\n  node.prev = prev;\n  node.next = next;\n\n  list.length++;\n\n  return node;\n};\n\nvar _remove = function _remove(node, list) {\n  var prev = node.prev,\n      next = node.next;\n\n\n  if (prev !== null) {\n    prev.next = next;\n  } else {\n    list.head = next;\n  }\n\n  if (next !== null) {\n    next.prev = prev;\n  } else {\n    list.tail = prev;\n  }\n\n  node.prev = node.next = null;\n\n  list.length--;\n\n  return node;\n};\n\nvar LinkedList = function () {\n  function LinkedList(vals) {\n    var _this = this;\n\n    _classCallCheck(this, LinkedList);\n\n    this.length = 0;\n    this.head = null;\n    this.tail = null;\n\n    if (vals != null) {\n      vals.forEach(function (v) {\n        return _this.push(v);\n      });\n    }\n  }\n\n  _createClass(LinkedList, [{\n    key: \"size\",\n    value: function size() {\n      return this.length;\n    }\n  }, {\n    key: \"insertBefore\",\n    value: function insertBefore(val, otherNode) {\n      return add(otherNode.prev, nodeFrom(val), otherNode, this);\n    }\n  }, {\n    key: \"insertAfter\",\n    value: function insertAfter(val, otherNode) {\n      return add(otherNode, nodeFrom(val), otherNode.next, this);\n    }\n  }, {\n    key: \"insertNodeBefore\",\n    value: function insertNodeBefore(newNode, otherNode) {\n      return add(otherNode.prev, newNode, otherNode, this);\n    }\n  }, {\n    key: \"insertNodeAfter\",\n    value: function insertNodeAfter(newNode, otherNode) {\n      return add(otherNode, newNode, otherNode.next, this);\n    }\n  }, {\n    key: \"push\",\n    value: function push(val) {\n      return add(this.tail, nodeFrom(val), null, this);\n    }\n  }, {\n    key: \"unshift\",\n    value: function unshift(val) {\n      return add(null, nodeFrom(val), this.head, this);\n    }\n  }, {\n    key: \"remove\",\n    value: function remove(node) {\n      return _remove(node, this);\n    }\n  }, {\n    key: \"pop\",\n    value: function pop() {\n      return _remove(this.tail, this).value;\n    }\n  }, {\n    key: \"popNode\",\n    value: function popNode() {\n      return _remove(this.tail, this);\n    }\n  }, {\n    key: \"shift\",\n    value: function shift() {\n      return _remove(this.head, this).value;\n    }\n  }, {\n    key: \"shiftNode\",\n    value: function shiftNode() {\n      return _remove(this.head, this);\n    }\n  }, {\n    key: \"get_object_at\",\n    value: function get_object_at(index) {\n      if (index <= this.length()) {\n        var i = 1;\n        var current = this.head;\n        while (i < index) {\n          current = current.next;\n          i++;\n        }\n        return current.value;\n      }\n    }\n  }, {\n    key: \"set_object_at\",\n    value: function set_object_at(index, value) {\n      if (index <= this.length()) {\n        var i = 1;\n        var current = this.head;\n        while (i < index) {\n          current = current.next;\n          i++;\n        }\n        current.value = value;\n      }\n    }\n  }]);\n\n  return LinkedList;\n}();\n\nmodule.exports = LinkedList;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/*\r\n *This class is the javascript implementation of the Point.java class in jdk\r\n */\nfunction Point(x, y, p) {\n  this.x = null;\n  this.y = null;\n  if (x == null && y == null && p == null) {\n    this.x = 0;\n    this.y = 0;\n  } else if (typeof x == 'number' && typeof y == 'number' && p == null) {\n    this.x = x;\n    this.y = y;\n  } else if (x.constructor.name == 'Point' && y == null && p == null) {\n    p = x;\n    this.x = p.x;\n    this.y = p.y;\n  }\n}\n\nPoint.prototype.getX = function () {\n  return this.x;\n};\n\nPoint.prototype.getY = function () {\n  return this.y;\n};\n\nPoint.prototype.getLocation = function () {\n  return new Point(this.x, this.y);\n};\n\nPoint.prototype.setLocation = function (x, y, p) {\n  if (x.constructor.name == 'Point' && y == null && p == null) {\n    p = x;\n    this.setLocation(p.x, p.y);\n  } else if (typeof x == 'number' && typeof y == 'number' && p == null) {\n    //if both parameters are integer just move (x,y) location\n    if (parseInt(x) == x && parseInt(y) == y) {\n      this.move(x, y);\n    } else {\n      this.x = Math.floor(x + 0.5);\n      this.y = Math.floor(y + 0.5);\n    }\n  }\n};\n\nPoint.prototype.move = function (x, y) {\n  this.x = x;\n  this.y = y;\n};\n\nPoint.prototype.translate = function (dx, dy) {\n  this.x += dx;\n  this.y += dy;\n};\n\nPoint.prototype.equals = function (obj) {\n  if (obj.constructor.name == \"Point\") {\n    var pt = obj;\n    return this.x == pt.x && this.y == pt.y;\n  }\n  return this == obj;\n};\n\nPoint.prototype.toString = function () {\n  return new Point().constructor.name + \"[x=\" + this.x + \",y=\" + this.y + \"]\";\n};\n\nmodule.exports = Point;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction RectangleD(x, y, width, height) {\n  this.x = 0;\n  this.y = 0;\n  this.width = 0;\n  this.height = 0;\n\n  if (x != null && y != null && width != null && height != null) {\n    this.x = x;\n    this.y = y;\n    this.width = width;\n    this.height = height;\n  }\n}\n\nRectangleD.prototype.getX = function () {\n  return this.x;\n};\n\nRectangleD.prototype.setX = function (x) {\n  this.x = x;\n};\n\nRectangleD.prototype.getY = function () {\n  return this.y;\n};\n\nRectangleD.prototype.setY = function (y) {\n  this.y = y;\n};\n\nRectangleD.prototype.getWidth = function () {\n  return this.width;\n};\n\nRectangleD.prototype.setWidth = function (width) {\n  this.width = width;\n};\n\nRectangleD.prototype.getHeight = function () {\n  return this.height;\n};\n\nRectangleD.prototype.setHeight = function (height) {\n  this.height = height;\n};\n\nRectangleD.prototype.getRight = function () {\n  return this.x + this.width;\n};\n\nRectangleD.prototype.getBottom = function () {\n  return this.y + this.height;\n};\n\nRectangleD.prototype.intersects = function (a) {\n  if (this.getRight() < a.x) {\n    return false;\n  }\n\n  if (this.getBottom() < a.y) {\n    return false;\n  }\n\n  if (a.getRight() < this.x) {\n    return false;\n  }\n\n  if (a.getBottom() < this.y) {\n    return false;\n  }\n\n  return true;\n};\n\nRectangleD.prototype.getCenterX = function () {\n  return this.x + this.width / 2;\n};\n\nRectangleD.prototype.getMinX = function () {\n  return this.getX();\n};\n\nRectangleD.prototype.getMaxX = function () {\n  return this.getX() + this.width;\n};\n\nRectangleD.prototype.getCenterY = function () {\n  return this.y + this.height / 2;\n};\n\nRectangleD.prototype.getMinY = function () {\n  return this.getY();\n};\n\nRectangleD.prototype.getMaxY = function () {\n  return this.getY() + this.height;\n};\n\nRectangleD.prototype.getWidthHalf = function () {\n  return this.width / 2;\n};\n\nRectangleD.prototype.getHeightHalf = function () {\n  return this.height / 2;\n};\n\nmodule.exports = RectangleD;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction UniqueIDGeneretor() {}\n\nUniqueIDGeneretor.lastID = 0;\n\nUniqueIDGeneretor.createID = function (obj) {\n  if (UniqueIDGeneretor.isPrimitive(obj)) {\n    return obj;\n  }\n  if (obj.uniqueID != null) {\n    return obj.uniqueID;\n  }\n  obj.uniqueID = UniqueIDGeneretor.getString();\n  UniqueIDGeneretor.lastID++;\n  return obj.uniqueID;\n};\n\nUniqueIDGeneretor.getString = function (id) {\n  if (id == null) id = UniqueIDGeneretor.lastID;\n  return \"Object#\" + id + \"\";\n};\n\nUniqueIDGeneretor.isPrimitive = function (arg) {\n  var type = typeof arg === \"undefined\" ? \"undefined\" : _typeof(arg);\n  return arg == null || type != \"object\" && type != \"function\";\n};\n\nmodule.exports = UniqueIDGeneretor;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar LayoutConstants = __webpack_require__(0);\nvar LGraphManager = __webpack_require__(6);\nvar LNode = __webpack_require__(3);\nvar LEdge = __webpack_require__(1);\nvar LGraph = __webpack_require__(5);\nvar PointD = __webpack_require__(4);\nvar Transform = __webpack_require__(17);\nvar Emitter = __webpack_require__(27);\n\nfunction Layout(isRemoteUse) {\n  Emitter.call(this);\n\n  //Layout Quality: 0:draft, 1:default, 2:proof\n  this.layoutQuality = LayoutConstants.QUALITY;\n  //Whether layout should create bendpoints as needed or not\n  this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;\n  //Whether layout should be incremental or not\n  this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;\n  //Whether we animate from before to after layout node positions\n  this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;\n  //Whether we animate the layout process or not\n  this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;\n  //Number iterations that should be done between two successive animations\n  this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;\n  /**\r\n   * Whether or not leaf nodes (non-compound nodes) are of uniform sizes. When\r\n   * they are, both spring and repulsion forces between two leaf nodes can be\r\n   * calculated without the expensive clipping point calculations, resulting\r\n   * in major speed-up.\r\n   */\n  this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;\n  /**\r\n   * This is used for creation of bendpoints by using dummy nodes and edges.\r\n   * Maps an LEdge to its dummy bendpoint path.\r\n   */\n  this.edgeToDummyNodes = new Map();\n  this.graphManager = new LGraphManager(this);\n  this.isLayoutFinished = false;\n  this.isSubLayout = false;\n  this.isRemoteUse = false;\n\n  if (isRemoteUse != null) {\n    this.isRemoteUse = isRemoteUse;\n  }\n}\n\nLayout.RANDOM_SEED = 1;\n\nLayout.prototype = Object.create(Emitter.prototype);\n\nLayout.prototype.getGraphManager = function () {\n  return this.graphManager;\n};\n\nLayout.prototype.getAllNodes = function () {\n  return this.graphManager.getAllNodes();\n};\n\nLayout.prototype.getAllEdges = function () {\n  return this.graphManager.getAllEdges();\n};\n\nLayout.prototype.getAllNodesToApplyGravitation = function () {\n  return this.graphManager.getAllNodesToApplyGravitation();\n};\n\nLayout.prototype.newGraphManager = function () {\n  var gm = new LGraphManager(this);\n  this.graphManager = gm;\n  return gm;\n};\n\nLayout.prototype.newGraph = function (vGraph) {\n  return new LGraph(null, this.graphManager, vGraph);\n};\n\nLayout.prototype.newNode = function (vNode) {\n  return new LNode(this.graphManager, vNode);\n};\n\nLayout.prototype.newEdge = function (vEdge) {\n  return new LEdge(null, null, vEdge);\n};\n\nLayout.prototype.checkLayoutSuccess = function () {\n  return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();\n};\n\nLayout.prototype.runLayout = function () {\n  this.isLayoutFinished = false;\n\n  if (this.tilingPreLayout) {\n    this.tilingPreLayout();\n  }\n\n  this.initParameters();\n  var isLayoutSuccessfull;\n\n  if (this.checkLayoutSuccess()) {\n    isLayoutSuccessfull = false;\n  } else {\n    isLayoutSuccessfull = this.layout();\n  }\n\n  if (LayoutConstants.ANIMATE === 'during') {\n    // If this is a 'during' layout animation. Layout is not finished yet. \n    // We need to perform these in index.js when layout is really finished.\n    return false;\n  }\n\n  if (isLayoutSuccessfull) {\n    if (!this.isSubLayout) {\n      this.doPostLayout();\n    }\n  }\n\n  if (this.tilingPostLayout) {\n    this.tilingPostLayout();\n  }\n\n  this.isLayoutFinished = true;\n\n  return isLayoutSuccessfull;\n};\n\n/**\r\n * This method performs the operations required after layout.\r\n */\nLayout.prototype.doPostLayout = function () {\n  //assert !isSubLayout : \"Should not be called on sub-layout!\";\n  // Propagate geometric changes to v-level objects\n  if (!this.incremental) {\n    this.transform();\n  }\n  this.update();\n};\n\n/**\r\n * This method updates the geometry of the target graph according to\r\n * calculated layout.\r\n */\nLayout.prototype.update2 = function () {\n  // update bend points\n  if (this.createBendsAsNeeded) {\n    this.createBendpointsFromDummyNodes();\n\n    // reset all edges, since the topology has changed\n    this.graphManager.resetAllEdges();\n  }\n\n  // perform edge, node and root updates if layout is not called\n  // remotely\n  if (!this.isRemoteUse) {\n    // update all edges\n    var edge;\n    var allEdges = this.graphManager.getAllEdges();\n    for (var i = 0; i < allEdges.length; i++) {\n      edge = allEdges[i];\n      //      this.update(edge);\n    }\n\n    // recursively update nodes\n    var node;\n    var nodes = this.graphManager.getRoot().getNodes();\n    for (var i = 0; i < nodes.length; i++) {\n      node = nodes[i];\n      //      this.update(node);\n    }\n\n    // update root graph\n    this.update(this.graphManager.getRoot());\n  }\n};\n\nLayout.prototype.update = function (obj) {\n  if (obj == null) {\n    this.update2();\n  } else if (obj instanceof LNode) {\n    var node = obj;\n    if (node.getChild() != null) {\n      // since node is compound, recursively update child nodes\n      var nodes = node.getChild().getNodes();\n      for (var i = 0; i < nodes.length; i++) {\n        update(nodes[i]);\n      }\n    }\n\n    // if the l-level node is associated with a v-level graph object,\n    // then it is assumed that the v-level node implements the\n    // interface Updatable.\n    if (node.vGraphObject != null) {\n      // cast to Updatable without any type check\n      var vNode = node.vGraphObject;\n\n      // call the update method of the interface\n      vNode.update(node);\n    }\n  } else if (obj instanceof LEdge) {\n    var edge = obj;\n    // if the l-level edge is associated with a v-level graph object,\n    // then it is assumed that the v-level edge implements the\n    // interface Updatable.\n\n    if (edge.vGraphObject != null) {\n      // cast to Updatable without any type check\n      var vEdge = edge.vGraphObject;\n\n      // call the update method of the interface\n      vEdge.update(edge);\n    }\n  } else if (obj instanceof LGraph) {\n    var graph = obj;\n    // if the l-level graph is associated with a v-level graph object,\n    // then it is assumed that the v-level object implements the\n    // interface Updatable.\n\n    if (graph.vGraphObject != null) {\n      // cast to Updatable without any type check\n      var vGraph = graph.vGraphObject;\n\n      // call the update method of the interface\n      vGraph.update(graph);\n    }\n  }\n};\n\n/**\r\n * This method is used to set all layout parameters to default values\r\n * determined at compile time.\r\n */\nLayout.prototype.initParameters = function () {\n  if (!this.isSubLayout) {\n    this.layoutQuality = LayoutConstants.QUALITY;\n    this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;\n    this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;\n    this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;\n    this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;\n    this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;\n    this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;\n  }\n\n  if (this.animationDuringLayout) {\n    this.animationOnLayout = false;\n  }\n};\n\nLayout.prototype.transform = function (newLeftTop) {\n  if (newLeftTop == undefined) {\n    this.transform(new PointD(0, 0));\n  } else {\n    // create a transformation object (from Eclipse to layout). When an\n    // inverse transform is applied, we get upper-left coordinate of the\n    // drawing or the root graph at given input coordinate (some margins\n    // already included in calculation of left-top).\n\n    var trans = new Transform();\n    var leftTop = this.graphManager.getRoot().updateLeftTop();\n\n    if (leftTop != null) {\n      trans.setWorldOrgX(newLeftTop.x);\n      trans.setWorldOrgY(newLeftTop.y);\n\n      trans.setDeviceOrgX(leftTop.x);\n      trans.setDeviceOrgY(leftTop.y);\n\n      var nodes = this.getAllNodes();\n      var node;\n\n      for (var i = 0; i < nodes.length; i++) {\n        node = nodes[i];\n        node.transform(trans);\n      }\n    }\n  }\n};\n\nLayout.prototype.positionNodesRandomly = function (graph) {\n\n  if (graph == undefined) {\n    //assert !this.incremental;\n    this.positionNodesRandomly(this.getGraphManager().getRoot());\n    this.getGraphManager().getRoot().updateBounds(true);\n  } else {\n    var lNode;\n    var childGraph;\n\n    var nodes = graph.getNodes();\n    for (var i = 0; i < nodes.length; i++) {\n      lNode = nodes[i];\n      childGraph = lNode.getChild();\n\n      if (childGraph == null) {\n        lNode.scatter();\n      } else if (childGraph.getNodes().length == 0) {\n        lNode.scatter();\n      } else {\n        this.positionNodesRandomly(childGraph);\n        lNode.updateBounds();\n      }\n    }\n  }\n};\n\n/**\r\n * This method returns a list of trees where each tree is represented as a\r\n * list of l-nodes. The method returns a list of size 0 when:\r\n * - The graph is not flat or\r\n * - One of the component(s) of the graph is not a tree.\r\n */\nLayout.prototype.getFlatForest = function () {\n  var flatForest = [];\n  var isForest = true;\n\n  // Quick reference for all nodes in the graph manager associated with\n  // this layout. The list should not be changed.\n  var allNodes = this.graphManager.getRoot().getNodes();\n\n  // First be sure that the graph is flat\n  var isFlat = true;\n\n  for (var i = 0; i < allNodes.length; i++) {\n    if (allNodes[i].getChild() != null) {\n      isFlat = false;\n    }\n  }\n\n  // Return empty forest if the graph is not flat.\n  if (!isFlat) {\n    return flatForest;\n  }\n\n  // Run BFS for each component of the graph.\n\n  var visited = new Set();\n  var toBeVisited = [];\n  var parents = new Map();\n  var unProcessedNodes = [];\n\n  unProcessedNodes = unProcessedNodes.concat(allNodes);\n\n  // Each iteration of this loop finds a component of the graph and\n  // decides whether it is a tree or not. If it is a tree, adds it to the\n  // forest and continued with the next component.\n\n  while (unProcessedNodes.length > 0 && isForest) {\n    toBeVisited.push(unProcessedNodes[0]);\n\n    // Start the BFS. Each iteration of this loop visits a node in a\n    // BFS manner.\n    while (toBeVisited.length > 0 && isForest) {\n      //pool operation\n      var currentNode = toBeVisited[0];\n      toBeVisited.splice(0, 1);\n      visited.add(currentNode);\n\n      // Traverse all neighbors of this node\n      var neighborEdges = currentNode.getEdges();\n\n      for (var i = 0; i < neighborEdges.length; i++) {\n        var currentNeighbor = neighborEdges[i].getOtherEnd(currentNode);\n\n        // If BFS is not growing from this neighbor.\n        if (parents.get(currentNode) != currentNeighbor) {\n          // We haven't previously visited this neighbor.\n          if (!visited.has(currentNeighbor)) {\n            toBeVisited.push(currentNeighbor);\n            parents.set(currentNeighbor, currentNode);\n          }\n          // Since we have previously visited this neighbor and\n          // this neighbor is not parent of currentNode, given\n          // graph contains a component that is not tree, hence\n          // it is not a forest.\n          else {\n              isForest = false;\n              break;\n            }\n        }\n      }\n    }\n\n    // The graph contains a component that is not a tree. Empty\n    // previously found trees. The method will end.\n    if (!isForest) {\n      flatForest = [];\n    }\n    // Save currently visited nodes as a tree in our forest. Reset\n    // visited and parents lists. Continue with the next component of\n    // the graph, if any.\n    else {\n        var temp = [].concat(_toConsumableArray(visited));\n        flatForest.push(temp);\n        //flatForest = flatForest.concat(temp);\n        //unProcessedNodes.removeAll(visited);\n        for (var i = 0; i < temp.length; i++) {\n          var value = temp[i];\n          var index = unProcessedNodes.indexOf(value);\n          if (index > -1) {\n            unProcessedNodes.splice(index, 1);\n          }\n        }\n        visited = new Set();\n        parents = new Map();\n      }\n  }\n\n  return flatForest;\n};\n\n/**\r\n * This method creates dummy nodes (an l-level node with minimal dimensions)\r\n * for the given edge (one per bendpoint). The existing l-level structure\r\n * is updated accordingly.\r\n */\nLayout.prototype.createDummyNodesForBendpoints = function (edge) {\n  var dummyNodes = [];\n  var prev = edge.source;\n\n  var graph = this.graphManager.calcLowestCommonAncestor(edge.source, edge.target);\n\n  for (var i = 0; i < edge.bendpoints.length; i++) {\n    // create new dummy node\n    var dummyNode = this.newNode(null);\n    dummyNode.setRect(new Point(0, 0), new Dimension(1, 1));\n\n    graph.add(dummyNode);\n\n    // create new dummy edge between prev and dummy node\n    var dummyEdge = this.newEdge(null);\n    this.graphManager.add(dummyEdge, prev, dummyNode);\n\n    dummyNodes.add(dummyNode);\n    prev = dummyNode;\n  }\n\n  var dummyEdge = this.newEdge(null);\n  this.graphManager.add(dummyEdge, prev, edge.target);\n\n  this.edgeToDummyNodes.set(edge, dummyNodes);\n\n  // remove real edge from graph manager if it is inter-graph\n  if (edge.isInterGraph()) {\n    this.graphManager.remove(edge);\n  }\n  // else, remove the edge from the current graph\n  else {\n      graph.remove(edge);\n    }\n\n  return dummyNodes;\n};\n\n/**\r\n * This method creates bendpoints for edges from the dummy nodes\r\n * at l-level.\r\n */\nLayout.prototype.createBendpointsFromDummyNodes = function () {\n  var edges = [];\n  edges = edges.concat(this.graphManager.getAllEdges());\n  edges = [].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges);\n\n  for (var k = 0; k < edges.length; k++) {\n    var lEdge = edges[k];\n\n    if (lEdge.bendpoints.length > 0) {\n      var path = this.edgeToDummyNodes.get(lEdge);\n\n      for (var i = 0; i < path.length; i++) {\n        var dummyNode = path[i];\n        var p = new PointD(dummyNode.getCenterX(), dummyNode.getCenterY());\n\n        // update bendpoint's location according to dummy node\n        var ebp = lEdge.bendpoints.get(i);\n        ebp.x = p.x;\n        ebp.y = p.y;\n\n        // remove the dummy node, dummy edges incident with this\n        // dummy node is also removed (within the remove method)\n        dummyNode.getOwner().remove(dummyNode);\n      }\n\n      // add the real edge to graph\n      this.graphManager.add(lEdge, lEdge.source, lEdge.target);\n    }\n  }\n};\n\nLayout.transform = function (sliderValue, defaultValue, minDiv, maxMul) {\n  if (minDiv != undefined && maxMul != undefined) {\n    var value = defaultValue;\n\n    if (sliderValue <= 50) {\n      var minValue = defaultValue / minDiv;\n      value -= (defaultValue - minValue) / 50 * (50 - sliderValue);\n    } else {\n      var maxValue = defaultValue * maxMul;\n      value += (maxValue - defaultValue) / 50 * (sliderValue - 50);\n    }\n\n    return value;\n  } else {\n    var a, b;\n\n    if (sliderValue <= 50) {\n      a = 9.0 * defaultValue / 500.0;\n      b = defaultValue / 10.0;\n    } else {\n      a = 9.0 * defaultValue / 50.0;\n      b = -8 * defaultValue;\n    }\n\n    return a * sliderValue + b;\n  }\n};\n\n/**\r\n * This method finds and returns the center of the given nodes, assuming\r\n * that the given nodes form a tree in themselves.\r\n */\nLayout.findCenterOfTree = function (nodes) {\n  var list = [];\n  list = list.concat(nodes);\n\n  var removedNodes = [];\n  var remainingDegrees = new Map();\n  var foundCenter = false;\n  var centerNode = null;\n\n  if (list.length == 1 || list.length == 2) {\n    foundCenter = true;\n    centerNode = list[0];\n  }\n\n  for (var i = 0; i < list.length; i++) {\n    var node = list[i];\n    var degree = node.getNeighborsList().size;\n    remainingDegrees.set(node, node.getNeighborsList().size);\n\n    if (degree == 1) {\n      removedNodes.push(node);\n    }\n  }\n\n  var tempList = [];\n  tempList = tempList.concat(removedNodes);\n\n  while (!foundCenter) {\n    var tempList2 = [];\n    tempList2 = tempList2.concat(tempList);\n    tempList = [];\n\n    for (var i = 0; i < list.length; i++) {\n      var node = list[i];\n\n      var index = list.indexOf(node);\n      if (index >= 0) {\n        list.splice(index, 1);\n      }\n\n      var neighbours = node.getNeighborsList();\n\n      neighbours.forEach(function (neighbour) {\n        if (removedNodes.indexOf(neighbour) < 0) {\n          var otherDegree = remainingDegrees.get(neighbour);\n          var newDegree = otherDegree - 1;\n\n          if (newDegree == 1) {\n            tempList.push(neighbour);\n          }\n\n          remainingDegrees.set(neighbour, newDegree);\n        }\n      });\n    }\n\n    removedNodes = removedNodes.concat(tempList);\n\n    if (list.length == 1 || list.length == 2) {\n      foundCenter = true;\n      centerNode = list[0];\n    }\n  }\n\n  return centerNode;\n};\n\n/**\r\n * During the coarsening process, this layout may be referenced by two graph managers\r\n * this setter function grants access to change the currently being used graph manager\r\n */\nLayout.prototype.setGraphManager = function (gm) {\n  this.graphManager = gm;\n};\n\nmodule.exports = Layout;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction RandomSeed() {}\n// adapted from: https://stackoverflow.com/a/19303725\nRandomSeed.seed = 1;\nRandomSeed.x = 0;\n\nRandomSeed.nextDouble = function () {\n  RandomSeed.x = Math.sin(RandomSeed.seed++) * 10000;\n  return RandomSeed.x - Math.floor(RandomSeed.x);\n};\n\nmodule.exports = RandomSeed;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar PointD = __webpack_require__(4);\n\nfunction Transform(x, y) {\n  this.lworldOrgX = 0.0;\n  this.lworldOrgY = 0.0;\n  this.ldeviceOrgX = 0.0;\n  this.ldeviceOrgY = 0.0;\n  this.lworldExtX = 1.0;\n  this.lworldExtY = 1.0;\n  this.ldeviceExtX = 1.0;\n  this.ldeviceExtY = 1.0;\n}\n\nTransform.prototype.getWorldOrgX = function () {\n  return this.lworldOrgX;\n};\n\nTransform.prototype.setWorldOrgX = function (wox) {\n  this.lworldOrgX = wox;\n};\n\nTransform.prototype.getWorldOrgY = function () {\n  return this.lworldOrgY;\n};\n\nTransform.prototype.setWorldOrgY = function (woy) {\n  this.lworldOrgY = woy;\n};\n\nTransform.prototype.getWorldExtX = function () {\n  return this.lworldExtX;\n};\n\nTransform.prototype.setWorldExtX = function (wex) {\n  this.lworldExtX = wex;\n};\n\nTransform.prototype.getWorldExtY = function () {\n  return this.lworldExtY;\n};\n\nTransform.prototype.setWorldExtY = function (wey) {\n  this.lworldExtY = wey;\n};\n\n/* Device related */\n\nTransform.prototype.getDeviceOrgX = function () {\n  return this.ldeviceOrgX;\n};\n\nTransform.prototype.setDeviceOrgX = function (dox) {\n  this.ldeviceOrgX = dox;\n};\n\nTransform.prototype.getDeviceOrgY = function () {\n  return this.ldeviceOrgY;\n};\n\nTransform.prototype.setDeviceOrgY = function (doy) {\n  this.ldeviceOrgY = doy;\n};\n\nTransform.prototype.getDeviceExtX = function () {\n  return this.ldeviceExtX;\n};\n\nTransform.prototype.setDeviceExtX = function (dex) {\n  this.ldeviceExtX = dex;\n};\n\nTransform.prototype.getDeviceExtY = function () {\n  return this.ldeviceExtY;\n};\n\nTransform.prototype.setDeviceExtY = function (dey) {\n  this.ldeviceExtY = dey;\n};\n\nTransform.prototype.transformX = function (x) {\n  var xDevice = 0.0;\n  var worldExtX = this.lworldExtX;\n  if (worldExtX != 0.0) {\n    xDevice = this.ldeviceOrgX + (x - this.lworldOrgX) * this.ldeviceExtX / worldExtX;\n  }\n\n  return xDevice;\n};\n\nTransform.prototype.transformY = function (y) {\n  var yDevice = 0.0;\n  var worldExtY = this.lworldExtY;\n  if (worldExtY != 0.0) {\n    yDevice = this.ldeviceOrgY + (y - this.lworldOrgY) * this.ldeviceExtY / worldExtY;\n  }\n\n  return yDevice;\n};\n\nTransform.prototype.inverseTransformX = function (x) {\n  var xWorld = 0.0;\n  var deviceExtX = this.ldeviceExtX;\n  if (deviceExtX != 0.0) {\n    xWorld = this.lworldOrgX + (x - this.ldeviceOrgX) * this.lworldExtX / deviceExtX;\n  }\n\n  return xWorld;\n};\n\nTransform.prototype.inverseTransformY = function (y) {\n  var yWorld = 0.0;\n  var deviceExtY = this.ldeviceExtY;\n  if (deviceExtY != 0.0) {\n    yWorld = this.lworldOrgY + (y - this.ldeviceOrgY) * this.lworldExtY / deviceExtY;\n  }\n  return yWorld;\n};\n\nTransform.prototype.inverseTransformPoint = function (inPoint) {\n  var outPoint = new PointD(this.inverseTransformX(inPoint.x), this.inverseTransformY(inPoint.y));\n  return outPoint;\n};\n\nmodule.exports = Transform;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar Layout = __webpack_require__(15);\nvar FDLayoutConstants = __webpack_require__(7);\nvar LayoutConstants = __webpack_require__(0);\nvar IGeometry = __webpack_require__(8);\nvar IMath = __webpack_require__(9);\n\nfunction FDLayout() {\n  Layout.call(this);\n\n  this.useSmartIdealEdgeLengthCalculation = FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;\n  this.idealEdgeLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH;\n  this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;\n  this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;\n  this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;\n  this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;\n  this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;\n  this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;\n  this.displacementThresholdPerNode = 3.0 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100;\n  this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;\n  this.initialCoolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;\n  this.totalDisplacement = 0.0;\n  this.oldTotalDisplacement = 0.0;\n  this.maxIterations = FDLayoutConstants.MAX_ITERATIONS;\n}\n\nFDLayout.prototype = Object.create(Layout.prototype);\n\nfor (var prop in Layout) {\n  FDLayout[prop] = Layout[prop];\n}\n\nFDLayout.prototype.initParameters = function () {\n  Layout.prototype.initParameters.call(this, arguments);\n\n  this.totalIterations = 0;\n  this.notAnimatedIterations = 0;\n\n  this.useFRGridVariant = FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION;\n\n  this.grid = [];\n};\n\nFDLayout.prototype.calcIdealEdgeLengths = function () {\n  var edge;\n  var lcaDepth;\n  var source;\n  var target;\n  var sizeOfSourceInLca;\n  var sizeOfTargetInLca;\n\n  var allEdges = this.getGraphManager().getAllEdges();\n  for (var i = 0; i < allEdges.length; i++) {\n    edge = allEdges[i];\n\n    edge.idealLength = this.idealEdgeLength;\n\n    if (edge.isInterGraph) {\n      source = edge.getSource();\n      target = edge.getTarget();\n\n      sizeOfSourceInLca = edge.getSourceInLca().getEstimatedSize();\n      sizeOfTargetInLca = edge.getTargetInLca().getEstimatedSize();\n\n      if (this.useSmartIdealEdgeLengthCalculation) {\n        edge.idealLength += sizeOfSourceInLca + sizeOfTargetInLca - 2 * LayoutConstants.SIMPLE_NODE_SIZE;\n      }\n\n      lcaDepth = edge.getLca().getInclusionTreeDepth();\n\n      edge.idealLength += FDLayoutConstants.DEFAULT_EDGE_LENGTH * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth);\n    }\n  }\n};\n\nFDLayout.prototype.initSpringEmbedder = function () {\n\n  var s = this.getAllNodes().length;\n  if (this.incremental) {\n    if (s > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {\n      this.coolingFactor = Math.max(this.coolingFactor * FDLayoutConstants.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));\n    }\n    this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL;\n  } else {\n    if (s > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {\n      this.coolingFactor = Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR, 1.0 - (s - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));\n    } else {\n      this.coolingFactor = 1.0;\n    }\n    this.initialCoolingFactor = this.coolingFactor;\n    this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT;\n  }\n\n  this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations);\n\n  this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length;\n\n  this.repulsionRange = this.calcRepulsionRange();\n};\n\nFDLayout.prototype.calcSpringForces = function () {\n  var lEdges = this.getAllEdges();\n  var edge;\n\n  for (var i = 0; i < lEdges.length; i++) {\n    edge = lEdges[i];\n\n    this.calcSpringForce(edge, edge.idealLength);\n  }\n};\n\nFDLayout.prototype.calcRepulsionForces = function () {\n  var gridUpdateAllowed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n  var forceToNodeSurroundingUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n  var i, j;\n  var nodeA, nodeB;\n  var lNodes = this.getAllNodes();\n  var processedNodeSet;\n\n  if (this.useFRGridVariant) {\n    if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed) {\n      this.updateGrid();\n    }\n\n    processedNodeSet = new Set();\n\n    // calculate repulsion forces between each nodes and its surrounding\n    for (i = 0; i < lNodes.length; i++) {\n      nodeA = lNodes[i];\n      this.calculateRepulsionForceOfANode(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate);\n      processedNodeSet.add(nodeA);\n    }\n  } else {\n    for (i = 0; i < lNodes.length; i++) {\n      nodeA = lNodes[i];\n\n      for (j = i + 1; j < lNodes.length; j++) {\n        nodeB = lNodes[j];\n\n        // If both nodes are not members of the same graph, skip.\n        if (nodeA.getOwner() != nodeB.getOwner()) {\n          continue;\n        }\n\n        this.calcRepulsionForce(nodeA, nodeB);\n      }\n    }\n  }\n};\n\nFDLayout.prototype.calcGravitationalForces = function () {\n  var node;\n  var lNodes = this.getAllNodesToApplyGravitation();\n\n  for (var i = 0; i < lNodes.length; i++) {\n    node = lNodes[i];\n    this.calcGravitationalForce(node);\n  }\n};\n\nFDLayout.prototype.moveNodes = function () {\n  var lNodes = this.getAllNodes();\n  var node;\n\n  for (var i = 0; i < lNodes.length; i++) {\n    node = lNodes[i];\n    node.move();\n  }\n};\n\nFDLayout.prototype.calcSpringForce = function (edge, idealLength) {\n  var sourceNode = edge.getSource();\n  var targetNode = edge.getTarget();\n\n  var length;\n  var springForce;\n  var springForceX;\n  var springForceY;\n\n  // Update edge length\n  if (this.uniformLeafNodeSizes && sourceNode.getChild() == null && targetNode.getChild() == null) {\n    edge.updateLengthSimple();\n  } else {\n    edge.updateLength();\n\n    if (edge.isOverlapingSourceAndTarget) {\n      return;\n    }\n  }\n\n  length = edge.getLength();\n\n  if (length == 0) return;\n\n  // Calculate spring forces\n  springForce = this.springConstant * (length - idealLength);\n\n  // Project force onto x and y axes\n  springForceX = springForce * (edge.lengthX / length);\n  springForceY = springForce * (edge.lengthY / length);\n\n  // Apply forces on the end nodes\n  sourceNode.springForceX += springForceX;\n  sourceNode.springForceY += springForceY;\n  targetNode.springForceX -= springForceX;\n  targetNode.springForceY -= springForceY;\n};\n\nFDLayout.prototype.calcRepulsionForce = function (nodeA, nodeB) {\n  var rectA = nodeA.getRect();\n  var rectB = nodeB.getRect();\n  var overlapAmount = new Array(2);\n  var clipPoints = new Array(4);\n  var distanceX;\n  var distanceY;\n  var distanceSquared;\n  var distance;\n  var repulsionForce;\n  var repulsionForceX;\n  var repulsionForceY;\n\n  if (rectA.intersects(rectB)) // two nodes overlap\n    {\n      // calculate separation amount in x and y directions\n      IGeometry.calcSeparationAmount(rectA, rectB, overlapAmount, FDLayoutConstants.DEFAULT_EDGE_LENGTH / 2.0);\n\n      repulsionForceX = 2 * overlapAmount[0];\n      repulsionForceY = 2 * overlapAmount[1];\n\n      var childrenConstant = nodeA.noOfChildren * nodeB.noOfChildren / (nodeA.noOfChildren + nodeB.noOfChildren);\n\n      // Apply forces on the two nodes\n      nodeA.repulsionForceX -= childrenConstant * repulsionForceX;\n      nodeA.repulsionForceY -= childrenConstant * repulsionForceY;\n      nodeB.repulsionForceX += childrenConstant * repulsionForceX;\n      nodeB.repulsionForceY += childrenConstant * repulsionForceY;\n    } else // no overlap\n    {\n      // calculate distance\n\n      if (this.uniformLeafNodeSizes && nodeA.getChild() == null && nodeB.getChild() == null) // simply base repulsion on distance of node centers\n        {\n          distanceX = rectB.getCenterX() - rectA.getCenterX();\n          distanceY = rectB.getCenterY() - rectA.getCenterY();\n        } else // use clipping points\n        {\n          IGeometry.getIntersection(rectA, rectB, clipPoints);\n\n          distanceX = clipPoints[2] - clipPoints[0];\n          distanceY = clipPoints[3] - clipPoints[1];\n        }\n\n      // No repulsion range. FR grid variant should take care of this.\n      if (Math.abs(distanceX) < FDLayoutConstants.MIN_REPULSION_DIST) {\n        distanceX = IMath.sign(distanceX) * FDLayoutConstants.MIN_REPULSION_DIST;\n      }\n\n      if (Math.abs(distanceY) < FDLayoutConstants.MIN_REPULSION_DIST) {\n        distanceY = IMath.sign(distanceY) * FDLayoutConstants.MIN_REPULSION_DIST;\n      }\n\n      distanceSquared = distanceX * distanceX + distanceY * distanceY;\n      distance = Math.sqrt(distanceSquared);\n\n      repulsionForce = this.repulsionConstant * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared;\n\n      // Project force onto x and y axes\n      repulsionForceX = repulsionForce * distanceX / distance;\n      repulsionForceY = repulsionForce * distanceY / distance;\n\n      // Apply forces on the two nodes    \n      nodeA.repulsionForceX -= repulsionForceX;\n      nodeA.repulsionForceY -= repulsionForceY;\n      nodeB.repulsionForceX += repulsionForceX;\n      nodeB.repulsionForceY += repulsionForceY;\n    }\n};\n\nFDLayout.prototype.calcGravitationalForce = function (node) {\n  var ownerGraph;\n  var ownerCenterX;\n  var ownerCenterY;\n  var distanceX;\n  var distanceY;\n  var absDistanceX;\n  var absDistanceY;\n  var estimatedSize;\n  ownerGraph = node.getOwner();\n\n  ownerCenterX = (ownerGraph.getRight() + ownerGraph.getLeft()) / 2;\n  ownerCenterY = (ownerGraph.getTop() + ownerGraph.getBottom()) / 2;\n  distanceX = node.getCenterX() - ownerCenterX;\n  distanceY = node.getCenterY() - ownerCenterY;\n  absDistanceX = Math.abs(distanceX) + node.getWidth() / 2;\n  absDistanceY = Math.abs(distanceY) + node.getHeight() / 2;\n\n  if (node.getOwner() == this.graphManager.getRoot()) // in the root graph\n    {\n      estimatedSize = ownerGraph.getEstimatedSize() * this.gravityRangeFactor;\n\n      if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {\n        node.gravitationForceX = -this.gravityConstant * distanceX;\n        node.gravitationForceY = -this.gravityConstant * distanceY;\n      }\n    } else // inside a compound\n    {\n      estimatedSize = ownerGraph.getEstimatedSize() * this.compoundGravityRangeFactor;\n\n      if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {\n        node.gravitationForceX = -this.gravityConstant * distanceX * this.compoundGravityConstant;\n        node.gravitationForceY = -this.gravityConstant * distanceY * this.compoundGravityConstant;\n      }\n    }\n};\n\nFDLayout.prototype.isConverged = function () {\n  var converged;\n  var oscilating = false;\n\n  if (this.totalIterations > this.maxIterations / 3) {\n    oscilating = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2;\n  }\n\n  converged = this.totalDisplacement < this.totalDisplacementThreshold;\n\n  this.oldTotalDisplacement = this.totalDisplacement;\n\n  return converged || oscilating;\n};\n\nFDLayout.prototype.animate = function () {\n  if (this.animationDuringLayout && !this.isSubLayout) {\n    if (this.notAnimatedIterations == this.animationPeriod) {\n      this.update();\n      this.notAnimatedIterations = 0;\n    } else {\n      this.notAnimatedIterations++;\n    }\n  }\n};\n\n//This method calculates the number of children (weight) for all nodes\nFDLayout.prototype.calcNoOfChildrenForAllNodes = function () {\n  var node;\n  var allNodes = this.graphManager.getAllNodes();\n\n  for (var i = 0; i < allNodes.length; i++) {\n    node = allNodes[i];\n    node.noOfChildren = node.getNoOfChildren();\n  }\n};\n\n// -----------------------------------------------------------------------------\n// Section: FR-Grid Variant Repulsion Force Calculation\n// -----------------------------------------------------------------------------\n\nFDLayout.prototype.calcGrid = function (graph) {\n\n  var sizeX = 0;\n  var sizeY = 0;\n\n  sizeX = parseInt(Math.ceil((graph.getRight() - graph.getLeft()) / this.repulsionRange));\n  sizeY = parseInt(Math.ceil((graph.getBottom() - graph.getTop()) / this.repulsionRange));\n\n  var grid = new Array(sizeX);\n\n  for (var i = 0; i < sizeX; i++) {\n    grid[i] = new Array(sizeY);\n  }\n\n  for (var i = 0; i < sizeX; i++) {\n    for (var j = 0; j < sizeY; j++) {\n      grid[i][j] = new Array();\n    }\n  }\n\n  return grid;\n};\n\nFDLayout.prototype.addNodeToGrid = function (v, left, top) {\n\n  var startX = 0;\n  var finishX = 0;\n  var startY = 0;\n  var finishY = 0;\n\n  startX = parseInt(Math.floor((v.getRect().x - left) / this.repulsionRange));\n  finishX = parseInt(Math.floor((v.getRect().width + v.getRect().x - left) / this.repulsionRange));\n  startY = parseInt(Math.floor((v.getRect().y - top) / this.repulsionRange));\n  finishY = parseInt(Math.floor((v.getRect().height + v.getRect().y - top) / this.repulsionRange));\n\n  for (var i = startX; i <= finishX; i++) {\n    for (var j = startY; j <= finishY; j++) {\n      this.grid[i][j].push(v);\n      v.setGridCoordinates(startX, finishX, startY, finishY);\n    }\n  }\n};\n\nFDLayout.prototype.updateGrid = function () {\n  var i;\n  var nodeA;\n  var lNodes = this.getAllNodes();\n\n  this.grid = this.calcGrid(this.graphManager.getRoot());\n\n  // put all nodes to proper grid cells\n  for (i = 0; i < lNodes.length; i++) {\n    nodeA = lNodes[i];\n    this.addNodeToGrid(nodeA, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());\n  }\n};\n\nFDLayout.prototype.calculateRepulsionForceOfANode = function (nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate) {\n\n  if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed || forceToNodeSurroundingUpdate) {\n    var surrounding = new Set();\n    nodeA.surrounding = new Array();\n    var nodeB;\n    var grid = this.grid;\n\n    for (var i = nodeA.startX - 1; i < nodeA.finishX + 2; i++) {\n      for (var j = nodeA.startY - 1; j < nodeA.finishY + 2; j++) {\n        if (!(i < 0 || j < 0 || i >= grid.length || j >= grid[0].length)) {\n          for (var k = 0; k < grid[i][j].length; k++) {\n            nodeB = grid[i][j][k];\n\n            // If both nodes are not members of the same graph, \n            // or both nodes are the same, skip.\n            if (nodeA.getOwner() != nodeB.getOwner() || nodeA == nodeB) {\n              continue;\n            }\n\n            // check if the repulsion force between\n            // nodeA and nodeB has already been calculated\n            if (!processedNodeSet.has(nodeB) && !surrounding.has(nodeB)) {\n              var distanceX = Math.abs(nodeA.getCenterX() - nodeB.getCenterX()) - (nodeA.getWidth() / 2 + nodeB.getWidth() / 2);\n              var distanceY = Math.abs(nodeA.getCenterY() - nodeB.getCenterY()) - (nodeA.getHeight() / 2 + nodeB.getHeight() / 2);\n\n              // if the distance between nodeA and nodeB \n              // is less then calculation range\n              if (distanceX <= this.repulsionRange && distanceY <= this.repulsionRange) {\n                //then add nodeB to surrounding of nodeA\n                surrounding.add(nodeB);\n              }\n            }\n          }\n        }\n      }\n    }\n\n    nodeA.surrounding = [].concat(_toConsumableArray(surrounding));\n  }\n  for (i = 0; i < nodeA.surrounding.length; i++) {\n    this.calcRepulsionForce(nodeA, nodeA.surrounding[i]);\n  }\n};\n\nFDLayout.prototype.calcRepulsionRange = function () {\n  return 0.0;\n};\n\nmodule.exports = FDLayout;\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LEdge = __webpack_require__(1);\nvar FDLayoutConstants = __webpack_require__(7);\n\nfunction FDLayoutEdge(source, target, vEdge) {\n  LEdge.call(this, source, target, vEdge);\n  this.idealLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH;\n}\n\nFDLayoutEdge.prototype = Object.create(LEdge.prototype);\n\nfor (var prop in LEdge) {\n  FDLayoutEdge[prop] = LEdge[prop];\n}\n\nmodule.exports = FDLayoutEdge;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LNode = __webpack_require__(3);\n\nfunction FDLayoutNode(gm, loc, size, vNode) {\n  // alternative constructor is handled inside LNode\n  LNode.call(this, gm, loc, size, vNode);\n  //Spring, repulsion and gravitational forces acting on this node\n  this.springForceX = 0;\n  this.springForceY = 0;\n  this.repulsionForceX = 0;\n  this.repulsionForceY = 0;\n  this.gravitationForceX = 0;\n  this.gravitationForceY = 0;\n  //Amount by which this node is to be moved in this iteration\n  this.displacementX = 0;\n  this.displacementY = 0;\n\n  //Start and finish grid coordinates that this node is fallen into\n  this.startX = 0;\n  this.finishX = 0;\n  this.startY = 0;\n  this.finishY = 0;\n\n  //Geometric neighbors of this node\n  this.surrounding = [];\n}\n\nFDLayoutNode.prototype = Object.create(LNode.prototype);\n\nfor (var prop in LNode) {\n  FDLayoutNode[prop] = LNode[prop];\n}\n\nFDLayoutNode.prototype.setGridCoordinates = function (_startX, _finishX, _startY, _finishY) {\n  this.startX = _startX;\n  this.finishX = _finishX;\n  this.startY = _startY;\n  this.finishY = _finishY;\n};\n\nmodule.exports = FDLayoutNode;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction DimensionD(width, height) {\n  this.width = 0;\n  this.height = 0;\n  if (width !== null && height !== null) {\n    this.height = height;\n    this.width = width;\n  }\n}\n\nDimensionD.prototype.getWidth = function () {\n  return this.width;\n};\n\nDimensionD.prototype.setWidth = function (width) {\n  this.width = width;\n};\n\nDimensionD.prototype.getHeight = function () {\n  return this.height;\n};\n\nDimensionD.prototype.setHeight = function (height) {\n  this.height = height;\n};\n\nmodule.exports = DimensionD;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar UniqueIDGeneretor = __webpack_require__(14);\n\nfunction HashMap() {\n  this.map = {};\n  this.keys = [];\n}\n\nHashMap.prototype.put = function (key, value) {\n  var theId = UniqueIDGeneretor.createID(key);\n  if (!this.contains(theId)) {\n    this.map[theId] = value;\n    this.keys.push(key);\n  }\n};\n\nHashMap.prototype.contains = function (key) {\n  var theId = UniqueIDGeneretor.createID(key);\n  return this.map[key] != null;\n};\n\nHashMap.prototype.get = function (key) {\n  var theId = UniqueIDGeneretor.createID(key);\n  return this.map[theId];\n};\n\nHashMap.prototype.keySet = function () {\n  return this.keys;\n};\n\nmodule.exports = HashMap;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar UniqueIDGeneretor = __webpack_require__(14);\n\nfunction HashSet() {\n  this.set = {};\n}\n;\n\nHashSet.prototype.add = function (obj) {\n  var theId = UniqueIDGeneretor.createID(obj);\n  if (!this.contains(theId)) this.set[theId] = obj;\n};\n\nHashSet.prototype.remove = function (obj) {\n  delete this.set[UniqueIDGeneretor.createID(obj)];\n};\n\nHashSet.prototype.clear = function () {\n  this.set = {};\n};\n\nHashSet.prototype.contains = function (obj) {\n  return this.set[UniqueIDGeneretor.createID(obj)] == obj;\n};\n\nHashSet.prototype.isEmpty = function () {\n  return this.size() === 0;\n};\n\nHashSet.prototype.size = function () {\n  return Object.keys(this.set).length;\n};\n\n//concats this.set to the given list\nHashSet.prototype.addAllTo = function (list) {\n  var keys = Object.keys(this.set);\n  var length = keys.length;\n  for (var i = 0; i < length; i++) {\n    list.push(this.set[keys[i]]);\n  }\n};\n\nHashSet.prototype.size = function () {\n  return Object.keys(this.set).length;\n};\n\nHashSet.prototype.addAll = function (list) {\n  var s = list.length;\n  for (var i = 0; i < s; i++) {\n    var v = list[i];\n    this.add(v);\n  }\n};\n\nmodule.exports = HashSet;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A classic Quicksort algorithm with Hoare's partition\n * - Works also on LinkedList objects\n *\n * Copyright: i-Vis Research Group, Bilkent University, 2007 - present\n */\n\nvar LinkedList = __webpack_require__(11);\n\nvar Quicksort = function () {\n    function Quicksort(A, compareFunction) {\n        _classCallCheck(this, Quicksort);\n\n        if (compareFunction !== null || compareFunction !== undefined) this.compareFunction = this._defaultCompareFunction;\n\n        var length = void 0;\n        if (A instanceof LinkedList) length = A.size();else length = A.length;\n\n        this._quicksort(A, 0, length - 1);\n    }\n\n    _createClass(Quicksort, [{\n        key: '_quicksort',\n        value: function _quicksort(A, p, r) {\n            if (p < r) {\n                var q = this._partition(A, p, r);\n                this._quicksort(A, p, q);\n                this._quicksort(A, q + 1, r);\n            }\n        }\n    }, {\n        key: '_partition',\n        value: function _partition(A, p, r) {\n            var x = this._get(A, p);\n            var i = p;\n            var j = r;\n            while (true) {\n                while (this.compareFunction(x, this._get(A, j))) {\n                    j--;\n                }while (this.compareFunction(this._get(A, i), x)) {\n                    i++;\n                }if (i < j) {\n                    this._swap(A, i, j);\n                    i++;\n                    j--;\n                } else return j;\n            }\n        }\n    }, {\n        key: '_get',\n        value: function _get(object, index) {\n            if (object instanceof LinkedList) return object.get_object_at(index);else return object[index];\n        }\n    }, {\n        key: '_set',\n        value: function _set(object, index, value) {\n            if (object instanceof LinkedList) object.set_object_at(index, value);else object[index] = value;\n        }\n    }, {\n        key: '_swap',\n        value: function _swap(A, i, j) {\n            var temp = this._get(A, i);\n            this._set(A, i, this._get(A, j));\n            this._set(A, j, temp);\n        }\n    }, {\n        key: '_defaultCompareFunction',\n        value: function _defaultCompareFunction(a, b) {\n            return b > a;\n        }\n    }]);\n\n    return Quicksort;\n}();\n\nmodule.exports = Quicksort;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n *   Needleman-Wunsch algorithm is an procedure to compute the optimal global alignment of two string\n *   sequences by S.B.Needleman and C.D.Wunsch (1970).\n *\n *   Aside from the inputs, you can assign the scores for,\n *   - Match: The two characters at the current index are same.\n *   - Mismatch: The two characters at the current index are different.\n *   - Insertion/Deletion(gaps): The best alignment involves one letter aligning to a gap in the other string.\n */\n\nvar NeedlemanWunsch = function () {\n    function NeedlemanWunsch(sequence1, sequence2) {\n        var match_score = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n        var mismatch_penalty = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;\n        var gap_penalty = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;\n\n        _classCallCheck(this, NeedlemanWunsch);\n\n        this.sequence1 = sequence1;\n        this.sequence2 = sequence2;\n        this.match_score = match_score;\n        this.mismatch_penalty = mismatch_penalty;\n        this.gap_penalty = gap_penalty;\n\n        // Just the remove redundancy\n        this.iMax = sequence1.length + 1;\n        this.jMax = sequence2.length + 1;\n\n        // Grid matrix of scores\n        this.grid = new Array(this.iMax);\n        for (var i = 0; i < this.iMax; i++) {\n            this.grid[i] = new Array(this.jMax);\n\n            for (var j = 0; j < this.jMax; j++) {\n                this.grid[i][j] = 0;\n            }\n        }\n\n        // Traceback matrix (2D array, each cell is an array of boolean values for [`Diag`, `Up`, `Left`] positions)\n        this.tracebackGrid = new Array(this.iMax);\n        for (var _i = 0; _i < this.iMax; _i++) {\n            this.tracebackGrid[_i] = new Array(this.jMax);\n\n            for (var _j = 0; _j < this.jMax; _j++) {\n                this.tracebackGrid[_i][_j] = [null, null, null];\n            }\n        }\n\n        // The aligned sequences (return multiple possibilities)\n        this.alignments = [];\n\n        // Final alignment score\n        this.score = -1;\n\n        // Calculate scores and tracebacks\n        this.computeGrids();\n    }\n\n    _createClass(NeedlemanWunsch, [{\n        key: \"getScore\",\n        value: function getScore() {\n            return this.score;\n        }\n    }, {\n        key: \"getAlignments\",\n        value: function getAlignments() {\n            return this.alignments;\n        }\n\n        // Main dynamic programming procedure\n\n    }, {\n        key: \"computeGrids\",\n        value: function computeGrids() {\n            // Fill in the first row\n            for (var j = 1; j < this.jMax; j++) {\n                this.grid[0][j] = this.grid[0][j - 1] + this.gap_penalty;\n                this.tracebackGrid[0][j] = [false, false, true];\n            }\n\n            // Fill in the first column\n            for (var i = 1; i < this.iMax; i++) {\n                this.grid[i][0] = this.grid[i - 1][0] + this.gap_penalty;\n                this.tracebackGrid[i][0] = [false, true, false];\n            }\n\n            // Fill the rest of the grid\n            for (var _i2 = 1; _i2 < this.iMax; _i2++) {\n                for (var _j2 = 1; _j2 < this.jMax; _j2++) {\n                    // Find the max score(s) among [`Diag`, `Up`, `Left`]\n                    var diag = void 0;\n                    if (this.sequence1[_i2 - 1] === this.sequence2[_j2 - 1]) diag = this.grid[_i2 - 1][_j2 - 1] + this.match_score;else diag = this.grid[_i2 - 1][_j2 - 1] + this.mismatch_penalty;\n\n                    var up = this.grid[_i2 - 1][_j2] + this.gap_penalty;\n                    var left = this.grid[_i2][_j2 - 1] + this.gap_penalty;\n\n                    // If there exists multiple max values, capture them for multiple paths\n                    var maxOf = [diag, up, left];\n                    var indices = this.arrayAllMaxIndexes(maxOf);\n\n                    // Update Grids\n                    this.grid[_i2][_j2] = maxOf[indices[0]];\n                    this.tracebackGrid[_i2][_j2] = [indices.includes(0), indices.includes(1), indices.includes(2)];\n                }\n            }\n\n            // Update alignment score\n            this.score = this.grid[this.iMax - 1][this.jMax - 1];\n        }\n\n        // Gets all possible valid sequence combinations\n\n    }, {\n        key: \"alignmentTraceback\",\n        value: function alignmentTraceback() {\n            var inProcessAlignments = [];\n\n            inProcessAlignments.push({ pos: [this.sequence1.length, this.sequence2.length],\n                seq1: \"\",\n                seq2: \"\"\n            });\n\n            while (inProcessAlignments[0]) {\n                var current = inProcessAlignments[0];\n                var directions = this.tracebackGrid[current.pos[0]][current.pos[1]];\n\n                if (directions[0]) {\n                    inProcessAlignments.push({ pos: [current.pos[0] - 1, current.pos[1] - 1],\n                        seq1: this.sequence1[current.pos[0] - 1] + current.seq1,\n                        seq2: this.sequence2[current.pos[1] - 1] + current.seq2\n                    });\n                }\n                if (directions[1]) {\n                    inProcessAlignments.push({ pos: [current.pos[0] - 1, current.pos[1]],\n                        seq1: this.sequence1[current.pos[0] - 1] + current.seq1,\n                        seq2: '-' + current.seq2\n                    });\n                }\n                if (directions[2]) {\n                    inProcessAlignments.push({ pos: [current.pos[0], current.pos[1] - 1],\n                        seq1: '-' + current.seq1,\n                        seq2: this.sequence2[current.pos[1] - 1] + current.seq2\n                    });\n                }\n\n                if (current.pos[0] === 0 && current.pos[1] === 0) this.alignments.push({ sequence1: current.seq1,\n                    sequence2: current.seq2\n                });\n\n                inProcessAlignments.shift();\n            }\n\n            return this.alignments;\n        }\n\n        // Helper Functions\n\n    }, {\n        key: \"getAllIndexes\",\n        value: function getAllIndexes(arr, val) {\n            var indexes = [],\n                i = -1;\n            while ((i = arr.indexOf(val, i + 1)) !== -1) {\n                indexes.push(i);\n            }\n            return indexes;\n        }\n    }, {\n        key: \"arrayAllMaxIndexes\",\n        value: function arrayAllMaxIndexes(array) {\n            return this.getAllIndexes(array, Math.max.apply(null, array));\n        }\n    }]);\n\n    return NeedlemanWunsch;\n}();\n\nmodule.exports = NeedlemanWunsch;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar layoutBase = function layoutBase() {\n  return;\n};\n\nlayoutBase.FDLayout = __webpack_require__(18);\nlayoutBase.FDLayoutConstants = __webpack_require__(7);\nlayoutBase.FDLayoutEdge = __webpack_require__(19);\nlayoutBase.FDLayoutNode = __webpack_require__(20);\nlayoutBase.DimensionD = __webpack_require__(21);\nlayoutBase.HashMap = __webpack_require__(22);\nlayoutBase.HashSet = __webpack_require__(23);\nlayoutBase.IGeometry = __webpack_require__(8);\nlayoutBase.IMath = __webpack_require__(9);\nlayoutBase.Integer = __webpack_require__(10);\nlayoutBase.Point = __webpack_require__(12);\nlayoutBase.PointD = __webpack_require__(4);\nlayoutBase.RandomSeed = __webpack_require__(16);\nlayoutBase.RectangleD = __webpack_require__(13);\nlayoutBase.Transform = __webpack_require__(17);\nlayoutBase.UniqueIDGeneretor = __webpack_require__(14);\nlayoutBase.Quicksort = __webpack_require__(24);\nlayoutBase.LinkedList = __webpack_require__(11);\nlayoutBase.LGraphObject = __webpack_require__(2);\nlayoutBase.LGraph = __webpack_require__(5);\nlayoutBase.LEdge = __webpack_require__(1);\nlayoutBase.LGraphManager = __webpack_require__(6);\nlayoutBase.LNode = __webpack_require__(3);\nlayoutBase.Layout = __webpack_require__(15);\nlayoutBase.LayoutConstants = __webpack_require__(0);\nlayoutBase.NeedlemanWunsch = __webpack_require__(25);\n\nmodule.exports = layoutBase;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction Emitter() {\n  this.listeners = [];\n}\n\nvar p = Emitter.prototype;\n\np.addListener = function (event, callback) {\n  this.listeners.push({\n    event: event,\n    callback: callback\n  });\n};\n\np.removeListener = function (event, callback) {\n  for (var i = this.listeners.length; i >= 0; i--) {\n    var l = this.listeners[i];\n\n    if (l.event === event && l.callback === callback) {\n      this.listeners.splice(i, 1);\n    }\n  }\n};\n\np.emit = function (event, data) {\n  for (var i = 0; i < this.listeners.length; i++) {\n    var l = this.listeners[i];\n\n    if (event === l.event) {\n      l.callback(data);\n    }\n  }\n};\n\nmodule.exports = Emitter;\n\n/***/ })\n/******/ ]);\n});","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"layout-base\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"layout-base\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"coseBase\"] = factory(require(\"layout-base\"));\n\telse\n\t\troot[\"coseBase\"] = factory(root[\"layoutBase\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 7);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;\n\nfunction CoSEConstants() {}\n\n//CoSEConstants inherits static props in FDLayoutConstants\nfor (var prop in FDLayoutConstants) {\n  CoSEConstants[prop] = FDLayoutConstants[prop];\n}\n\nCoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false;\nCoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;\nCoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60;\nCoSEConstants.TILE = true;\nCoSEConstants.TILING_PADDING_VERTICAL = 10;\nCoSEConstants.TILING_PADDING_HORIZONTAL = 10;\nCoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false; // make this true when cose is used incrementally as a part of other non-incremental layout\n\nmodule.exports = CoSEConstants;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutEdge = __webpack_require__(0).FDLayoutEdge;\n\nfunction CoSEEdge(source, target, vEdge) {\n  FDLayoutEdge.call(this, source, target, vEdge);\n}\n\nCoSEEdge.prototype = Object.create(FDLayoutEdge.prototype);\nfor (var prop in FDLayoutEdge) {\n  CoSEEdge[prop] = FDLayoutEdge[prop];\n}\n\nmodule.exports = CoSEEdge;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraph = __webpack_require__(0).LGraph;\n\nfunction CoSEGraph(parent, graphMgr, vGraph) {\n  LGraph.call(this, parent, graphMgr, vGraph);\n}\n\nCoSEGraph.prototype = Object.create(LGraph.prototype);\nfor (var prop in LGraph) {\n  CoSEGraph[prop] = LGraph[prop];\n}\n\nmodule.exports = CoSEGraph;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraphManager = __webpack_require__(0).LGraphManager;\n\nfunction CoSEGraphManager(layout) {\n  LGraphManager.call(this, layout);\n}\n\nCoSEGraphManager.prototype = Object.create(LGraphManager.prototype);\nfor (var prop in LGraphManager) {\n  CoSEGraphManager[prop] = LGraphManager[prop];\n}\n\nmodule.exports = CoSEGraphManager;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutNode = __webpack_require__(0).FDLayoutNode;\nvar IMath = __webpack_require__(0).IMath;\n\nfunction CoSENode(gm, loc, size, vNode) {\n  FDLayoutNode.call(this, gm, loc, size, vNode);\n}\n\nCoSENode.prototype = Object.create(FDLayoutNode.prototype);\nfor (var prop in FDLayoutNode) {\n  CoSENode[prop] = FDLayoutNode[prop];\n}\n\nCoSENode.prototype.move = function () {\n  var layout = this.graphManager.getLayout();\n  this.displacementX = layout.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren;\n  this.displacementY = layout.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren;\n\n  if (Math.abs(this.displacementX) > layout.coolingFactor * layout.maxNodeDisplacement) {\n    this.displacementX = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementX);\n  }\n\n  if (Math.abs(this.displacementY) > layout.coolingFactor * layout.maxNodeDisplacement) {\n    this.displacementY = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementY);\n  }\n\n  // a simple node, just move it\n  if (this.child == null) {\n    this.moveBy(this.displacementX, this.displacementY);\n  }\n  // an empty compound node, again just move it\n  else if (this.child.getNodes().length == 0) {\n      this.moveBy(this.displacementX, this.displacementY);\n    }\n    // non-empty compound node, propogate movement to children as well\n    else {\n        this.propogateDisplacementToChildren(this.displacementX, this.displacementY);\n      }\n\n  layout.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY);\n\n  this.springForceX = 0;\n  this.springForceY = 0;\n  this.repulsionForceX = 0;\n  this.repulsionForceY = 0;\n  this.gravitationForceX = 0;\n  this.gravitationForceY = 0;\n  this.displacementX = 0;\n  this.displacementY = 0;\n};\n\nCoSENode.prototype.propogateDisplacementToChildren = function (dX, dY) {\n  var nodes = this.getChild().getNodes();\n  var node;\n  for (var i = 0; i < nodes.length; i++) {\n    node = nodes[i];\n    if (node.getChild() == null) {\n      node.moveBy(dX, dY);\n      node.displacementX += dX;\n      node.displacementY += dY;\n    } else {\n      node.propogateDisplacementToChildren(dX, dY);\n    }\n  }\n};\n\nCoSENode.prototype.setPred1 = function (pred1) {\n  this.pred1 = pred1;\n};\n\nCoSENode.prototype.getPred1 = function () {\n  return pred1;\n};\n\nCoSENode.prototype.getPred2 = function () {\n  return pred2;\n};\n\nCoSENode.prototype.setNext = function (next) {\n  this.next = next;\n};\n\nCoSENode.prototype.getNext = function () {\n  return next;\n};\n\nCoSENode.prototype.setProcessed = function (processed) {\n  this.processed = processed;\n};\n\nCoSENode.prototype.isProcessed = function () {\n  return processed;\n};\n\nmodule.exports = CoSENode;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayout = __webpack_require__(0).FDLayout;\nvar CoSEGraphManager = __webpack_require__(4);\nvar CoSEGraph = __webpack_require__(3);\nvar CoSENode = __webpack_require__(5);\nvar CoSEEdge = __webpack_require__(2);\nvar CoSEConstants = __webpack_require__(1);\nvar FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;\nvar LayoutConstants = __webpack_require__(0).LayoutConstants;\nvar Point = __webpack_require__(0).Point;\nvar PointD = __webpack_require__(0).PointD;\nvar Layout = __webpack_require__(0).Layout;\nvar Integer = __webpack_require__(0).Integer;\nvar IGeometry = __webpack_require__(0).IGeometry;\nvar LGraph = __webpack_require__(0).LGraph;\nvar Transform = __webpack_require__(0).Transform;\n\nfunction CoSELayout() {\n  FDLayout.call(this);\n\n  this.toBeTiled = {}; // Memorize if a node is to be tiled or is tiled\n}\n\nCoSELayout.prototype = Object.create(FDLayout.prototype);\n\nfor (var prop in FDLayout) {\n  CoSELayout[prop] = FDLayout[prop];\n}\n\nCoSELayout.prototype.newGraphManager = function () {\n  var gm = new CoSEGraphManager(this);\n  this.graphManager = gm;\n  return gm;\n};\n\nCoSELayout.prototype.newGraph = function (vGraph) {\n  return new CoSEGraph(null, this.graphManager, vGraph);\n};\n\nCoSELayout.prototype.newNode = function (vNode) {\n  return new CoSENode(this.graphManager, vNode);\n};\n\nCoSELayout.prototype.newEdge = function (vEdge) {\n  return new CoSEEdge(null, null, vEdge);\n};\n\nCoSELayout.prototype.initParameters = function () {\n  FDLayout.prototype.initParameters.call(this, arguments);\n  if (!this.isSubLayout) {\n    if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) {\n      this.idealEdgeLength = 10;\n    } else {\n      this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH;\n    }\n\n    this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;\n    this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;\n    this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;\n    this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;\n    this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;\n    this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;\n    this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;\n\n    // variables for tree reduction support\n    this.prunedNodesAll = [];\n    this.growTreeIterations = 0;\n    this.afterGrowthIterations = 0;\n    this.isTreeGrowing = false;\n    this.isGrowthFinished = false;\n\n    // variables for cooling\n    this.coolingCycle = 0;\n    this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD;\n    this.finalTemperature = FDLayoutConstants.CONVERGENCE_CHECK_PERIOD / this.maxIterations;\n    this.coolingAdjuster = 1;\n  }\n};\n\nCoSELayout.prototype.layout = function () {\n  var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;\n  if (createBendsAsNeeded) {\n    this.createBendpoints();\n    this.graphManager.resetAllEdges();\n  }\n\n  this.level = 0;\n  return this.classicLayout();\n};\n\nCoSELayout.prototype.classicLayout = function () {\n  this.nodesWithGravity = this.calculateNodesToApplyGravitationTo();\n  this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);\n  this.calcNoOfChildrenForAllNodes();\n  this.graphManager.calcLowestCommonAncestors();\n  this.graphManager.calcInclusionTreeDepths();\n  this.graphManager.getRoot().calcEstimatedSize();\n  this.calcIdealEdgeLengths();\n\n  if (!this.incremental) {\n    var forest = this.getFlatForest();\n\n    // The graph associated with this layout is flat and a forest\n    if (forest.length > 0) {\n      this.positionNodesRadially(forest);\n    }\n    // The graph associated with this layout is not flat or a forest\n    else {\n        // Reduce the trees when incremental mode is not enabled and graph is not a forest \n        this.reduceTrees();\n        // Update nodes that gravity will be applied\n        this.graphManager.resetAllNodesToApplyGravitation();\n        var allNodes = new Set(this.getAllNodes());\n        var intersection = this.nodesWithGravity.filter(function (x) {\n          return allNodes.has(x);\n        });\n        this.graphManager.setAllNodesToApplyGravitation(intersection);\n\n        this.positionNodesRandomly();\n      }\n  } else {\n    if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) {\n      // Reduce the trees in incremental mode if only this constant is set to true \n      this.reduceTrees();\n      // Update nodes that gravity will be applied\n      this.graphManager.resetAllNodesToApplyGravitation();\n      var allNodes = new Set(this.getAllNodes());\n      var intersection = this.nodesWithGravity.filter(function (x) {\n        return allNodes.has(x);\n      });\n      this.graphManager.setAllNodesToApplyGravitation(intersection);\n    }\n  }\n\n  this.initSpringEmbedder();\n  this.runSpringEmbedder();\n\n  return true;\n};\n\nCoSELayout.prototype.tick = function () {\n  this.totalIterations++;\n\n  if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {\n    if (this.prunedNodesAll.length > 0) {\n      this.isTreeGrowing = true;\n    } else {\n      return true;\n    }\n  }\n\n  if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {\n    if (this.isConverged()) {\n      if (this.prunedNodesAll.length > 0) {\n        this.isTreeGrowing = true;\n      } else {\n        return true;\n      }\n    }\n\n    this.coolingCycle++;\n\n    if (this.layoutQuality == 0) {\n      // quality - \"draft\"\n      this.coolingAdjuster = this.coolingCycle;\n    } else if (this.layoutQuality == 1) {\n      // quality - \"default\"\n      this.coolingAdjuster = this.coolingCycle / 3;\n    }\n\n    // cooling schedule is based on http://www.btluke.com/simanf1.html -> cooling schedule 3\n    this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature);\n    this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));\n  }\n  // Operations while tree is growing again \n  if (this.isTreeGrowing) {\n    if (this.growTreeIterations % 10 == 0) {\n      if (this.prunedNodesAll.length > 0) {\n        this.graphManager.updateBounds();\n        this.updateGrid();\n        this.growTree(this.prunedNodesAll);\n        // Update nodes that gravity will be applied\n        this.graphManager.resetAllNodesToApplyGravitation();\n        var allNodes = new Set(this.getAllNodes());\n        var intersection = this.nodesWithGravity.filter(function (x) {\n          return allNodes.has(x);\n        });\n        this.graphManager.setAllNodesToApplyGravitation(intersection);\n\n        this.graphManager.updateBounds();\n        this.updateGrid();\n        this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;\n      } else {\n        this.isTreeGrowing = false;\n        this.isGrowthFinished = true;\n      }\n    }\n    this.growTreeIterations++;\n  }\n  // Operations after growth is finished\n  if (this.isGrowthFinished) {\n    if (this.isConverged()) {\n      return true;\n    }\n    if (this.afterGrowthIterations % 10 == 0) {\n      this.graphManager.updateBounds();\n      this.updateGrid();\n    }\n    this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100);\n    this.afterGrowthIterations++;\n  }\n\n  var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished;\n  var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;\n\n  this.totalDisplacement = 0;\n  this.graphManager.updateBounds();\n  this.calcSpringForces();\n  this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate);\n  this.calcGravitationalForces();\n  this.moveNodes();\n  this.animate();\n\n  return false; // Layout is not ended yet return false\n};\n\nCoSELayout.prototype.getPositionsData = function () {\n  var allNodes = this.graphManager.getAllNodes();\n  var pData = {};\n  for (var i = 0; i < allNodes.length; i++) {\n    var rect = allNodes[i].rect;\n    var id = allNodes[i].id;\n    pData[id] = {\n      id: id,\n      x: rect.getCenterX(),\n      y: rect.getCenterY(),\n      w: rect.width,\n      h: rect.height\n    };\n  }\n\n  return pData;\n};\n\nCoSELayout.prototype.runSpringEmbedder = function () {\n  this.initialAnimationPeriod = 25;\n  this.animationPeriod = this.initialAnimationPeriod;\n  var layoutEnded = false;\n\n  // If aminate option is 'during' signal that layout is supposed to start iterating\n  if (FDLayoutConstants.ANIMATE === 'during') {\n    this.emit('layoutstarted');\n  } else {\n    // If aminate option is 'during' tick() function will be called on index.js\n    while (!layoutEnded) {\n      layoutEnded = this.tick();\n    }\n\n    this.graphManager.updateBounds();\n  }\n};\n\nCoSELayout.prototype.calculateNodesToApplyGravitationTo = function () {\n  var nodeList = [];\n  var graph;\n\n  var graphs = this.graphManager.getGraphs();\n  var size = graphs.length;\n  var i;\n  for (i = 0; i < size; i++) {\n    graph = graphs[i];\n\n    graph.updateConnected();\n\n    if (!graph.isConnected) {\n      nodeList = nodeList.concat(graph.getNodes());\n    }\n  }\n\n  return nodeList;\n};\n\nCoSELayout.prototype.createBendpoints = function () {\n  var edges = [];\n  edges = edges.concat(this.graphManager.getAllEdges());\n  var visited = new Set();\n  var i;\n  for (i = 0; i < edges.length; i++) {\n    var edge = edges[i];\n\n    if (!visited.has(edge)) {\n      var source = edge.getSource();\n      var target = edge.getTarget();\n\n      if (source == target) {\n        edge.getBendpoints().push(new PointD());\n        edge.getBendpoints().push(new PointD());\n        this.createDummyNodesForBendpoints(edge);\n        visited.add(edge);\n      } else {\n        var edgeList = [];\n\n        edgeList = edgeList.concat(source.getEdgeListToNode(target));\n        edgeList = edgeList.concat(target.getEdgeListToNode(source));\n\n        if (!visited.has(edgeList[0])) {\n          if (edgeList.length > 1) {\n            var k;\n            for (k = 0; k < edgeList.length; k++) {\n              var multiEdge = edgeList[k];\n              multiEdge.getBendpoints().push(new PointD());\n              this.createDummyNodesForBendpoints(multiEdge);\n            }\n          }\n          edgeList.forEach(function (edge) {\n            visited.add(edge);\n          });\n        }\n      }\n    }\n\n    if (visited.size == edges.length) {\n      break;\n    }\n  }\n};\n\nCoSELayout.prototype.positionNodesRadially = function (forest) {\n  // We tile the trees to a grid row by row; first tree starts at (0,0)\n  var currentStartingPoint = new Point(0, 0);\n  var numberOfColumns = Math.ceil(Math.sqrt(forest.length));\n  var height = 0;\n  var currentY = 0;\n  var currentX = 0;\n  var point = new PointD(0, 0);\n\n  for (var i = 0; i < forest.length; i++) {\n    if (i % numberOfColumns == 0) {\n      // Start of a new row, make the x coordinate 0, increment the\n      // y coordinate with the max height of the previous row\n      currentX = 0;\n      currentY = height;\n\n      if (i != 0) {\n        currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION;\n      }\n\n      height = 0;\n    }\n\n    var tree = forest[i];\n\n    // Find the center of the tree\n    var centerNode = Layout.findCenterOfTree(tree);\n\n    // Set the staring point of the next tree\n    currentStartingPoint.x = currentX;\n    currentStartingPoint.y = currentY;\n\n    // Do a radial layout starting with the center\n    point = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint);\n\n    if (point.y > height) {\n      height = Math.floor(point.y);\n    }\n\n    currentX = Math.floor(point.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION);\n  }\n\n  this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point.x / 2, LayoutConstants.WORLD_CENTER_Y - point.y / 2));\n};\n\nCoSELayout.radialLayout = function (tree, centerNode, startingPoint) {\n  var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION);\n  CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);\n  var bounds = LGraph.calculateBounds(tree);\n\n  var transform = new Transform();\n  transform.setDeviceOrgX(bounds.getMinX());\n  transform.setDeviceOrgY(bounds.getMinY());\n  transform.setWorldOrgX(startingPoint.x);\n  transform.setWorldOrgY(startingPoint.y);\n\n  for (var i = 0; i < tree.length; i++) {\n    var node = tree[i];\n    node.transform(transform);\n  }\n\n  var bottomRight = new PointD(bounds.getMaxX(), bounds.getMaxY());\n\n  return transform.inverseTransformPoint(bottomRight);\n};\n\nCoSELayout.branchRadialLayout = function (node, parentOfNode, startAngle, endAngle, distance, radialSeparation) {\n  // First, position this node by finding its angle.\n  var halfInterval = (endAngle - startAngle + 1) / 2;\n\n  if (halfInterval < 0) {\n    halfInterval += 180;\n  }\n\n  var nodeAngle = (halfInterval + startAngle) % 360;\n  var teta = nodeAngle * IGeometry.TWO_PI / 360;\n\n  // Make polar to java cordinate conversion.\n  var cos_teta = Math.cos(teta);\n  var x_ = distance * Math.cos(teta);\n  var y_ = distance * Math.sin(teta);\n\n  node.setCenter(x_, y_);\n\n  // Traverse all neighbors of this node and recursively call this\n  // function.\n  var neighborEdges = [];\n  neighborEdges = neighborEdges.concat(node.getEdges());\n  var childCount = neighborEdges.length;\n\n  if (parentOfNode != null) {\n    childCount--;\n  }\n\n  var branchCount = 0;\n\n  var incEdgesCount = neighborEdges.length;\n  var startIndex;\n\n  var edges = node.getEdgesBetween(parentOfNode);\n\n  // If there are multiple edges, prune them until there remains only one\n  // edge.\n  while (edges.length > 1) {\n    //neighborEdges.remove(edges.remove(0));\n    var temp = edges[0];\n    edges.splice(0, 1);\n    var index = neighborEdges.indexOf(temp);\n    if (index >= 0) {\n      neighborEdges.splice(index, 1);\n    }\n    incEdgesCount--;\n    childCount--;\n  }\n\n  if (parentOfNode != null) {\n    //assert edges.length == 1;\n    startIndex = (neighborEdges.indexOf(edges[0]) + 1) % incEdgesCount;\n  } else {\n    startIndex = 0;\n  }\n\n  var stepAngle = Math.abs(endAngle - startAngle) / childCount;\n\n  for (var i = startIndex; branchCount != childCount; i = ++i % incEdgesCount) {\n    var currentNeighbor = neighborEdges[i].getOtherEnd(node);\n\n    // Don't back traverse to root node in current tree.\n    if (currentNeighbor == parentOfNode) {\n      continue;\n    }\n\n    var childStartAngle = (startAngle + branchCount * stepAngle) % 360;\n    var childEndAngle = (childStartAngle + stepAngle) % 360;\n\n    CoSELayout.branchRadialLayout(currentNeighbor, node, childStartAngle, childEndAngle, distance + radialSeparation, radialSeparation);\n\n    branchCount++;\n  }\n};\n\nCoSELayout.maxDiagonalInTree = function (tree) {\n  var maxDiagonal = Integer.MIN_VALUE;\n\n  for (var i = 0; i < tree.length; i++) {\n    var node = tree[i];\n    var diagonal = node.getDiagonal();\n\n    if (diagonal > maxDiagonal) {\n      maxDiagonal = diagonal;\n    }\n  }\n\n  return maxDiagonal;\n};\n\nCoSELayout.prototype.calcRepulsionRange = function () {\n  // formula is 2 x (level + 1) x idealEdgeLength\n  return 2 * (this.level + 1) * this.idealEdgeLength;\n};\n\n// Tiling methods\n\n// Group zero degree members whose parents are not to be tiled, create dummy parents where needed and fill memberGroups by their dummp parent id's\nCoSELayout.prototype.groupZeroDegreeMembers = function () {\n  var self = this;\n  // array of [parent_id x oneDegreeNode_id]\n  var tempMemberGroups = {}; // A temporary map of parent node and its zero degree members\n  this.memberGroups = {}; // A map of dummy parent node and its zero degree members whose parents are not to be tiled\n  this.idToDummyNode = {}; // A map of id to dummy node \n\n  var zeroDegree = []; // List of zero degree nodes whose parents are not to be tiled\n  var allNodes = this.graphManager.getAllNodes();\n\n  // Fill zero degree list\n  for (var i = 0; i < allNodes.length; i++) {\n    var node = allNodes[i];\n    var parent = node.getParent();\n    // If a node has zero degree and its parent is not to be tiled if exists add that node to zeroDegres list\n    if (this.getNodeDegreeWithChildren(node) === 0 && (parent.id == undefined || !this.getToBeTiled(parent))) {\n      zeroDegree.push(node);\n    }\n  }\n\n  // Create a map of parent node and its zero degree members\n  for (var i = 0; i < zeroDegree.length; i++) {\n    var node = zeroDegree[i]; // Zero degree node itself\n    var p_id = node.getParent().id; // Parent id\n\n    if (typeof tempMemberGroups[p_id] === \"undefined\") tempMemberGroups[p_id] = [];\n\n    tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node); // Push node to the list belongs to its parent in tempMemberGroups\n  }\n\n  // If there are at least two nodes at a level, create a dummy compound for them\n  Object.keys(tempMemberGroups).forEach(function (p_id) {\n    if (tempMemberGroups[p_id].length > 1) {\n      var dummyCompoundId = \"DummyCompound_\" + p_id; // The id of dummy compound which will be created soon\n      self.memberGroups[dummyCompoundId] = tempMemberGroups[p_id]; // Add dummy compound to memberGroups\n\n      var parent = tempMemberGroups[p_id][0].getParent(); // The parent of zero degree nodes will be the parent of new dummy compound\n\n      // Create a dummy compound with calculated id\n      var dummyCompound = new CoSENode(self.graphManager);\n      dummyCompound.id = dummyCompoundId;\n      dummyCompound.paddingLeft = parent.paddingLeft || 0;\n      dummyCompound.paddingRight = parent.paddingRight || 0;\n      dummyCompound.paddingBottom = parent.paddingBottom || 0;\n      dummyCompound.paddingTop = parent.paddingTop || 0;\n\n      self.idToDummyNode[dummyCompoundId] = dummyCompound;\n\n      var dummyParentGraph = self.getGraphManager().add(self.newGraph(), dummyCompound);\n      var parentGraph = parent.getChild();\n\n      // Add dummy compound to parent the graph\n      parentGraph.add(dummyCompound);\n\n      // For each zero degree node in this level remove it from its parent graph and add it to the graph of dummy parent\n      for (var i = 0; i < tempMemberGroups[p_id].length; i++) {\n        var node = tempMemberGroups[p_id][i];\n\n        parentGraph.remove(node);\n        dummyParentGraph.add(node);\n      }\n    }\n  });\n};\n\nCoSELayout.prototype.clearCompounds = function () {\n  var childGraphMap = {};\n  var idToNode = {};\n\n  // Get compound ordering by finding the inner one first\n  this.performDFSOnCompounds();\n\n  for (var i = 0; i < this.compoundOrder.length; i++) {\n\n    idToNode[this.compoundOrder[i].id] = this.compoundOrder[i];\n    childGraphMap[this.compoundOrder[i].id] = [].concat(this.compoundOrder[i].getChild().getNodes());\n\n    // Remove children of compounds\n    this.graphManager.remove(this.compoundOrder[i].getChild());\n    this.compoundOrder[i].child = null;\n  }\n\n  this.graphManager.resetAllNodes();\n\n  // Tile the removed children\n  this.tileCompoundMembers(childGraphMap, idToNode);\n};\n\nCoSELayout.prototype.clearZeroDegreeMembers = function () {\n  var self = this;\n  var tiledZeroDegreePack = this.tiledZeroDegreePack = [];\n\n  Object.keys(this.memberGroups).forEach(function (id) {\n    var compoundNode = self.idToDummyNode[id]; // Get the dummy compound\n\n    tiledZeroDegreePack[id] = self.tileNodes(self.memberGroups[id], compoundNode.paddingLeft + compoundNode.paddingRight);\n\n    // Set the width and height of the dummy compound as calculated\n    compoundNode.rect.width = tiledZeroDegreePack[id].width;\n    compoundNode.rect.height = tiledZeroDegreePack[id].height;\n  });\n};\n\nCoSELayout.prototype.repopulateCompounds = function () {\n  for (var i = this.compoundOrder.length - 1; i >= 0; i--) {\n    var lCompoundNode = this.compoundOrder[i];\n    var id = lCompoundNode.id;\n    var horizontalMargin = lCompoundNode.paddingLeft;\n    var verticalMargin = lCompoundNode.paddingTop;\n\n    this.adjustLocations(this.tiledMemberPack[id], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin);\n  }\n};\n\nCoSELayout.prototype.repopulateZeroDegreeMembers = function () {\n  var self = this;\n  var tiledPack = this.tiledZeroDegreePack;\n\n  Object.keys(tiledPack).forEach(function (id) {\n    var compoundNode = self.idToDummyNode[id]; // Get the dummy compound by its id\n    var horizontalMargin = compoundNode.paddingLeft;\n    var verticalMargin = compoundNode.paddingTop;\n\n    // Adjust the positions of nodes wrt its compound\n    self.adjustLocations(tiledPack[id], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin);\n  });\n};\n\nCoSELayout.prototype.getToBeTiled = function (node) {\n  var id = node.id;\n  //firstly check the previous results\n  if (this.toBeTiled[id] != null) {\n    return this.toBeTiled[id];\n  }\n\n  //only compound nodes are to be tiled\n  var childGraph = node.getChild();\n  if (childGraph == null) {\n    this.toBeTiled[id] = false;\n    return false;\n  }\n\n  var children = childGraph.getNodes(); // Get the children nodes\n\n  //a compound node is not to be tiled if all of its compound children are not to be tiled\n  for (var i = 0; i < children.length; i++) {\n    var theChild = children[i];\n\n    if (this.getNodeDegree(theChild) > 0) {\n      this.toBeTiled[id] = false;\n      return false;\n    }\n\n    //pass the children not having the compound structure\n    if (theChild.getChild() == null) {\n      this.toBeTiled[theChild.id] = false;\n      continue;\n    }\n\n    if (!this.getToBeTiled(theChild)) {\n      this.toBeTiled[id] = false;\n      return false;\n    }\n  }\n  this.toBeTiled[id] = true;\n  return true;\n};\n\n// Get degree of a node depending of its edges and independent of its children\nCoSELayout.prototype.getNodeDegree = function (node) {\n  var id = node.id;\n  var edges = node.getEdges();\n  var degree = 0;\n\n  // For the edges connected\n  for (var i = 0; i < edges.length; i++) {\n    var edge = edges[i];\n    if (edge.getSource().id !== edge.getTarget().id) {\n      degree = degree + 1;\n    }\n  }\n  return degree;\n};\n\n// Get degree of a node with its children\nCoSELayout.prototype.getNodeDegreeWithChildren = function (node) {\n  var degree = this.getNodeDegree(node);\n  if (node.getChild() == null) {\n    return degree;\n  }\n  var children = node.getChild().getNodes();\n  for (var i = 0; i < children.length; i++) {\n    var child = children[i];\n    degree += this.getNodeDegreeWithChildren(child);\n  }\n  return degree;\n};\n\nCoSELayout.prototype.performDFSOnCompounds = function () {\n  this.compoundOrder = [];\n  this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());\n};\n\nCoSELayout.prototype.fillCompexOrderByDFS = function (children) {\n  for (var i = 0; i < children.length; i++) {\n    var child = children[i];\n    if (child.getChild() != null) {\n      this.fillCompexOrderByDFS(child.getChild().getNodes());\n    }\n    if (this.getToBeTiled(child)) {\n      this.compoundOrder.push(child);\n    }\n  }\n};\n\n/**\n* This method places each zero degree member wrt given (x,y) coordinates (top left).\n*/\nCoSELayout.prototype.adjustLocations = function (organization, x, y, compoundHorizontalMargin, compoundVerticalMargin) {\n  x += compoundHorizontalMargin;\n  y += compoundVerticalMargin;\n\n  var left = x;\n\n  for (var i = 0; i < organization.rows.length; i++) {\n    var row = organization.rows[i];\n    x = left;\n    var maxHeight = 0;\n\n    for (var j = 0; j < row.length; j++) {\n      var lnode = row[j];\n\n      lnode.rect.x = x; // + lnode.rect.width / 2;\n      lnode.rect.y = y; // + lnode.rect.height / 2;\n\n      x += lnode.rect.width + organization.horizontalPadding;\n\n      if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height;\n    }\n\n    y += maxHeight + organization.verticalPadding;\n  }\n};\n\nCoSELayout.prototype.tileCompoundMembers = function (childGraphMap, idToNode) {\n  var self = this;\n  this.tiledMemberPack = [];\n\n  Object.keys(childGraphMap).forEach(function (id) {\n    // Get the compound node\n    var compoundNode = idToNode[id];\n\n    self.tiledMemberPack[id] = self.tileNodes(childGraphMap[id], compoundNode.paddingLeft + compoundNode.paddingRight);\n\n    compoundNode.rect.width = self.tiledMemberPack[id].width;\n    compoundNode.rect.height = self.tiledMemberPack[id].height;\n  });\n};\n\nCoSELayout.prototype.tileNodes = function (nodes, minWidth) {\n  var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;\n  var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;\n  var organization = {\n    rows: [],\n    rowWidth: [],\n    rowHeight: [],\n    width: 0,\n    height: minWidth, // assume minHeight equals to minWidth\n    verticalPadding: verticalPadding,\n    horizontalPadding: horizontalPadding\n  };\n\n  // Sort the nodes in ascending order of their areas\n  nodes.sort(function (n1, n2) {\n    if (n1.rect.width * n1.rect.height > n2.rect.width * n2.rect.height) return -1;\n    if (n1.rect.width * n1.rect.height < n2.rect.width * n2.rect.height) return 1;\n    return 0;\n  });\n\n  // Create the organization -> tile members\n  for (var i = 0; i < nodes.length; i++) {\n    var lNode = nodes[i];\n\n    if (organization.rows.length == 0) {\n      this.insertNodeToRow(organization, lNode, 0, minWidth);\n    } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) {\n      this.insertNodeToRow(organization, lNode, this.getShortestRowIndex(organization), minWidth);\n    } else {\n      this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth);\n    }\n\n    this.shiftToLastRow(organization);\n  }\n\n  return organization;\n};\n\nCoSELayout.prototype.insertNodeToRow = function (organization, node, rowIndex, minWidth) {\n  var minCompoundSize = minWidth;\n\n  // Add new row if needed\n  if (rowIndex == organization.rows.length) {\n    var secondDimension = [];\n\n    organization.rows.push(secondDimension);\n    organization.rowWidth.push(minCompoundSize);\n    organization.rowHeight.push(0);\n  }\n\n  // Update row width\n  var w = organization.rowWidth[rowIndex] + node.rect.width;\n\n  if (organization.rows[rowIndex].length > 0) {\n    w += organization.horizontalPadding;\n  }\n\n  organization.rowWidth[rowIndex] = w;\n  // Update compound width\n  if (organization.width < w) {\n    organization.width = w;\n  }\n\n  // Update height\n  var h = node.rect.height;\n  if (rowIndex > 0) h += organization.verticalPadding;\n\n  var extraHeight = 0;\n  if (h > organization.rowHeight[rowIndex]) {\n    extraHeight = organization.rowHeight[rowIndex];\n    organization.rowHeight[rowIndex] = h;\n    extraHeight = organization.rowHeight[rowIndex] - extraHeight;\n  }\n\n  organization.height += extraHeight;\n\n  // Insert node\n  organization.rows[rowIndex].push(node);\n};\n\n//Scans the rows of an organization and returns the one with the min width\nCoSELayout.prototype.getShortestRowIndex = function (organization) {\n  var r = -1;\n  var min = Number.MAX_VALUE;\n\n  for (var i = 0; i < organization.rows.length; i++) {\n    if (organization.rowWidth[i] < min) {\n      r = i;\n      min = organization.rowWidth[i];\n    }\n  }\n  return r;\n};\n\n//Scans the rows of an organization and returns the one with the max width\nCoSELayout.prototype.getLongestRowIndex = function (organization) {\n  var r = -1;\n  var max = Number.MIN_VALUE;\n\n  for (var i = 0; i < organization.rows.length; i++) {\n\n    if (organization.rowWidth[i] > max) {\n      r = i;\n      max = organization.rowWidth[i];\n    }\n  }\n\n  return r;\n};\n\n/**\n* This method checks whether adding extra width to the organization violates\n* the aspect ratio(1) or not.\n*/\nCoSELayout.prototype.canAddHorizontal = function (organization, extraWidth, extraHeight) {\n\n  var sri = this.getShortestRowIndex(organization);\n\n  if (sri < 0) {\n    return true;\n  }\n\n  var min = organization.rowWidth[sri];\n\n  if (min + organization.horizontalPadding + extraWidth <= organization.width) return true;\n\n  var hDiff = 0;\n\n  // Adding to an existing row\n  if (organization.rowHeight[sri] < extraHeight) {\n    if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri];\n  }\n\n  var add_to_row_ratio;\n  if (organization.width - min >= extraWidth + organization.horizontalPadding) {\n    add_to_row_ratio = (organization.height + hDiff) / (min + extraWidth + organization.horizontalPadding);\n  } else {\n    add_to_row_ratio = (organization.height + hDiff) / organization.width;\n  }\n\n  // Adding a new row for this node\n  hDiff = extraHeight + organization.verticalPadding;\n  var add_new_row_ratio;\n  if (organization.width < extraWidth) {\n    add_new_row_ratio = (organization.height + hDiff) / extraWidth;\n  } else {\n    add_new_row_ratio = (organization.height + hDiff) / organization.width;\n  }\n\n  if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio;\n\n  if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio;\n\n  return add_to_row_ratio < add_new_row_ratio;\n};\n\n//If moving the last node from the longest row and adding it to the last\n//row makes the bounding box smaller, do it.\nCoSELayout.prototype.shiftToLastRow = function (organization) {\n  var longest = this.getLongestRowIndex(organization);\n  var last = organization.rowWidth.length - 1;\n  var row = organization.rows[longest];\n  var node = row[row.length - 1];\n\n  var diff = node.width + organization.horizontalPadding;\n\n  // Check if there is enough space on the last row\n  if (organization.width - organization.rowWidth[last] > diff && longest != last) {\n    // Remove the last element of the longest row\n    row.splice(-1, 1);\n\n    // Push it to the last row\n    organization.rows[last].push(node);\n\n    organization.rowWidth[longest] = organization.rowWidth[longest] - diff;\n    organization.rowWidth[last] = organization.rowWidth[last] + diff;\n    organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)];\n\n    // Update heights of the organization\n    var maxHeight = Number.MIN_VALUE;\n    for (var i = 0; i < row.length; i++) {\n      if (row[i].height > maxHeight) maxHeight = row[i].height;\n    }\n    if (longest > 0) maxHeight += organization.verticalPadding;\n\n    var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last];\n\n    organization.rowHeight[longest] = maxHeight;\n    if (organization.rowHeight[last] < node.height + organization.verticalPadding) organization.rowHeight[last] = node.height + organization.verticalPadding;\n\n    var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last];\n    organization.height += finalTotal - prevTotal;\n\n    this.shiftToLastRow(organization);\n  }\n};\n\nCoSELayout.prototype.tilingPreLayout = function () {\n  if (CoSEConstants.TILE) {\n    // Find zero degree nodes and create a compound for each level\n    this.groupZeroDegreeMembers();\n    // Tile and clear children of each compound\n    this.clearCompounds();\n    // Separately tile and clear zero degree nodes for each level\n    this.clearZeroDegreeMembers();\n  }\n};\n\nCoSELayout.prototype.tilingPostLayout = function () {\n  if (CoSEConstants.TILE) {\n    this.repopulateZeroDegreeMembers();\n    this.repopulateCompounds();\n  }\n};\n\n// -----------------------------------------------------------------------------\n// Section: Tree Reduction methods\n// -----------------------------------------------------------------------------\n// Reduce trees \nCoSELayout.prototype.reduceTrees = function () {\n  var prunedNodesAll = [];\n  var containsLeaf = true;\n  var node;\n\n  while (containsLeaf) {\n    var allNodes = this.graphManager.getAllNodes();\n    var prunedNodesInStepTemp = [];\n    containsLeaf = false;\n\n    for (var i = 0; i < allNodes.length; i++) {\n      node = allNodes[i];\n      if (node.getEdges().length == 1 && !node.getEdges()[0].isInterGraph && node.getChild() == null) {\n        prunedNodesInStepTemp.push([node, node.getEdges()[0], node.getOwner()]);\n        containsLeaf = true;\n      }\n    }\n    if (containsLeaf == true) {\n      var prunedNodesInStep = [];\n      for (var j = 0; j < prunedNodesInStepTemp.length; j++) {\n        if (prunedNodesInStepTemp[j][0].getEdges().length == 1) {\n          prunedNodesInStep.push(prunedNodesInStepTemp[j]);\n          prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]);\n        }\n      }\n      prunedNodesAll.push(prunedNodesInStep);\n      this.graphManager.resetAllNodes();\n      this.graphManager.resetAllEdges();\n    }\n  }\n  this.prunedNodesAll = prunedNodesAll;\n};\n\n// Grow tree one step \nCoSELayout.prototype.growTree = function (prunedNodesAll) {\n  var lengthOfPrunedNodesInStep = prunedNodesAll.length;\n  var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1];\n\n  var nodeData;\n  for (var i = 0; i < prunedNodesInStep.length; i++) {\n    nodeData = prunedNodesInStep[i];\n\n    this.findPlaceforPrunedNode(nodeData);\n\n    nodeData[2].add(nodeData[0]);\n    nodeData[2].add(nodeData[1], nodeData[1].source, nodeData[1].target);\n  }\n\n  prunedNodesAll.splice(prunedNodesAll.length - 1, 1);\n  this.graphManager.resetAllNodes();\n  this.graphManager.resetAllEdges();\n};\n\n// Find an appropriate position to replace pruned node, this method can be improved\nCoSELayout.prototype.findPlaceforPrunedNode = function (nodeData) {\n\n  var gridForPrunedNode;\n  var nodeToConnect;\n  var prunedNode = nodeData[0];\n  if (prunedNode == nodeData[1].source) {\n    nodeToConnect = nodeData[1].target;\n  } else {\n    nodeToConnect = nodeData[1].source;\n  }\n  var startGridX = nodeToConnect.startX;\n  var finishGridX = nodeToConnect.finishX;\n  var startGridY = nodeToConnect.startY;\n  var finishGridY = nodeToConnect.finishY;\n\n  var upNodeCount = 0;\n  var downNodeCount = 0;\n  var rightNodeCount = 0;\n  var leftNodeCount = 0;\n  var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount];\n\n  if (startGridY > 0) {\n    for (var i = startGridX; i <= finishGridX; i++) {\n      controlRegions[0] += this.grid[i][startGridY - 1].length + this.grid[i][startGridY].length - 1;\n    }\n  }\n  if (finishGridX < this.grid.length - 1) {\n    for (var i = startGridY; i <= finishGridY; i++) {\n      controlRegions[1] += this.grid[finishGridX + 1][i].length + this.grid[finishGridX][i].length - 1;\n    }\n  }\n  if (finishGridY < this.grid[0].length - 1) {\n    for (var i = startGridX; i <= finishGridX; i++) {\n      controlRegions[2] += this.grid[i][finishGridY + 1].length + this.grid[i][finishGridY].length - 1;\n    }\n  }\n  if (startGridX > 0) {\n    for (var i = startGridY; i <= finishGridY; i++) {\n      controlRegions[3] += this.grid[startGridX - 1][i].length + this.grid[startGridX][i].length - 1;\n    }\n  }\n  var min = Integer.MAX_VALUE;\n  var minCount;\n  var minIndex;\n  for (var j = 0; j < controlRegions.length; j++) {\n    if (controlRegions[j] < min) {\n      min = controlRegions[j];\n      minCount = 1;\n      minIndex = j;\n    } else if (controlRegions[j] == min) {\n      minCount++;\n    }\n  }\n\n  if (minCount == 3 && min == 0) {\n    if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) {\n      gridForPrunedNode = 1;\n    } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) {\n      gridForPrunedNode = 0;\n    } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {\n      gridForPrunedNode = 3;\n    } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {\n      gridForPrunedNode = 2;\n    }\n  } else if (minCount == 2 && min == 0) {\n    var random = Math.floor(Math.random() * 2);\n    if (controlRegions[0] == 0 && controlRegions[1] == 0) {\n      ;\n      if (random == 0) {\n        gridForPrunedNode = 0;\n      } else {\n        gridForPrunedNode = 1;\n      }\n    } else if (controlRegions[0] == 0 && controlRegions[2] == 0) {\n      if (random == 0) {\n        gridForPrunedNode = 0;\n      } else {\n        gridForPrunedNode = 2;\n      }\n    } else if (controlRegions[0] == 0 && controlRegions[3] == 0) {\n      if (random == 0) {\n        gridForPrunedNode = 0;\n      } else {\n        gridForPrunedNode = 3;\n      }\n    } else if (controlRegions[1] == 0 && controlRegions[2] == 0) {\n      if (random == 0) {\n        gridForPrunedNode = 1;\n      } else {\n        gridForPrunedNode = 2;\n      }\n    } else if (controlRegions[1] == 0 && controlRegions[3] == 0) {\n      if (random == 0) {\n        gridForPrunedNode = 1;\n      } else {\n        gridForPrunedNode = 3;\n      }\n    } else {\n      if (random == 0) {\n        gridForPrunedNode = 2;\n      } else {\n        gridForPrunedNode = 3;\n      }\n    }\n  } else if (minCount == 4 && min == 0) {\n    var random = Math.floor(Math.random() * 4);\n    gridForPrunedNode = random;\n  } else {\n    gridForPrunedNode = minIndex;\n  }\n\n  if (gridForPrunedNode == 0) {\n    prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2);\n  } else if (gridForPrunedNode == 1) {\n    prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY());\n  } else if (gridForPrunedNode == 2) {\n    prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2);\n  } else {\n    prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY());\n  }\n};\n\nmodule.exports = CoSELayout;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar coseBase = {};\n\ncoseBase.layoutBase = __webpack_require__(0);\ncoseBase.CoSEConstants = __webpack_require__(1);\ncoseBase.CoSEEdge = __webpack_require__(2);\ncoseBase.CoSEGraph = __webpack_require__(3);\ncoseBase.CoSEGraphManager = __webpack_require__(4);\ncoseBase.CoSELayout = __webpack_require__(6);\ncoseBase.CoSENode = __webpack_require__(5);\n\nmodule.exports = coseBase;\n\n/***/ })\n/******/ ]);\n});","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"cose-base\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"cose-base\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cytoscapeCoseBilkent\"] = factory(require(\"cose-base\"));\n\telse\n\t\troot[\"cytoscapeCoseBilkent\"] = factory(root[\"coseBase\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LayoutConstants = __webpack_require__(0).layoutBase.LayoutConstants;\nvar FDLayoutConstants = __webpack_require__(0).layoutBase.FDLayoutConstants;\nvar CoSEConstants = __webpack_require__(0).CoSEConstants;\nvar CoSELayout = __webpack_require__(0).CoSELayout;\nvar CoSENode = __webpack_require__(0).CoSENode;\nvar PointD = __webpack_require__(0).layoutBase.PointD;\nvar DimensionD = __webpack_require__(0).layoutBase.DimensionD;\n\nvar defaults = {\n  // Called on `layoutready`\n  ready: function ready() {},\n  // Called on `layoutstop`\n  stop: function stop() {},\n  // 'draft', 'default' or 'proof\" \n  // - 'draft' fast cooling rate \n  // - 'default' moderate cooling rate \n  // - \"proof\" slow cooling rate\n  quality: 'default',\n  // include labels in node dimensions\n  nodeDimensionsIncludeLabels: false,\n  // number of ticks per frame; higher is faster but more jerky\n  refresh: 30,\n  // Whether to fit the network view after when done\n  fit: true,\n  // Padding on fit\n  padding: 10,\n  // Whether to enable incremental mode\n  randomize: true,\n  // Node repulsion (non overlapping) multiplier\n  nodeRepulsion: 4500,\n  // Ideal edge (non nested) length\n  idealEdgeLength: 50,\n  // Divisor to compute edge forces\n  edgeElasticity: 0.45,\n  // Nesting factor (multiplier) to compute ideal edge length for nested edges\n  nestingFactor: 0.1,\n  // Gravity force (constant)\n  gravity: 0.25,\n  // Maximum number of iterations to perform\n  numIter: 2500,\n  // For enabling tiling\n  tile: true,\n  // Type of layout animation. The option set is {'during', 'end', false}\n  animate: 'end',\n  // Duration for animate:end\n  animationDuration: 500,\n  // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)\n  tilingPaddingVertical: 10,\n  // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)\n  tilingPaddingHorizontal: 10,\n  // Gravity range (constant) for compounds\n  gravityRangeCompound: 1.5,\n  // Gravity force (constant) for compounds\n  gravityCompound: 1.0,\n  // Gravity range (constant)\n  gravityRange: 3.8,\n  // Initial cooling factor for incremental layout\n  initialEnergyOnIncremental: 0.5\n};\n\nfunction extend(defaults, options) {\n  var obj = {};\n\n  for (var i in defaults) {\n    obj[i] = defaults[i];\n  }\n\n  for (var i in options) {\n    obj[i] = options[i];\n  }\n\n  return obj;\n};\n\nfunction _CoSELayout(_options) {\n  this.options = extend(defaults, _options);\n  getUserOptions(this.options);\n}\n\nvar getUserOptions = function getUserOptions(options) {\n  if (options.nodeRepulsion != null) CoSEConstants.DEFAULT_REPULSION_STRENGTH = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = options.nodeRepulsion;\n  if (options.idealEdgeLength != null) CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options.idealEdgeLength;\n  if (options.edgeElasticity != null) CoSEConstants.DEFAULT_SPRING_STRENGTH = FDLayoutConstants.DEFAULT_SPRING_STRENGTH = options.edgeElasticity;\n  if (options.nestingFactor != null) CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = options.nestingFactor;\n  if (options.gravity != null) CoSEConstants.DEFAULT_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = options.gravity;\n  if (options.numIter != null) CoSEConstants.MAX_ITERATIONS = FDLayoutConstants.MAX_ITERATIONS = options.numIter;\n  if (options.gravityRange != null) CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = options.gravityRange;\n  if (options.gravityCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = options.gravityCompound;\n  if (options.gravityRangeCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = options.gravityRangeCompound;\n  if (options.initialEnergyOnIncremental != null) CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = options.initialEnergyOnIncremental;\n\n  if (options.quality == 'draft') LayoutConstants.QUALITY = 0;else if (options.quality == 'proof') LayoutConstants.QUALITY = 2;else LayoutConstants.QUALITY = 1;\n\n  CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS = FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = options.nodeDimensionsIncludeLabels;\n  CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = !options.randomize;\n  CoSEConstants.ANIMATE = FDLayoutConstants.ANIMATE = LayoutConstants.ANIMATE = options.animate;\n  CoSEConstants.TILE = options.tile;\n  CoSEConstants.TILING_PADDING_VERTICAL = typeof options.tilingPaddingVertical === 'function' ? options.tilingPaddingVertical.call() : options.tilingPaddingVertical;\n  CoSEConstants.TILING_PADDING_HORIZONTAL = typeof options.tilingPaddingHorizontal === 'function' ? options.tilingPaddingHorizontal.call() : options.tilingPaddingHorizontal;\n};\n\n_CoSELayout.prototype.run = function () {\n  var ready;\n  var frameId;\n  var options = this.options;\n  var idToLNode = this.idToLNode = {};\n  var layout = this.layout = new CoSELayout();\n  var self = this;\n\n  self.stopped = false;\n\n  this.cy = this.options.cy;\n\n  this.cy.trigger({ type: 'layoutstart', layout: this });\n\n  var gm = layout.newGraphManager();\n  this.gm = gm;\n\n  var nodes = this.options.eles.nodes();\n  var edges = this.options.eles.edges();\n\n  this.root = gm.addRoot();\n  this.processChildrenList(this.root, this.getTopMostNodes(nodes), layout);\n\n  for (var i = 0; i < edges.length; i++) {\n    var edge = edges[i];\n    var sourceNode = this.idToLNode[edge.data(\"source\")];\n    var targetNode = this.idToLNode[edge.data(\"target\")];\n    if (sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) {\n      var e1 = gm.add(layout.newEdge(), sourceNode, targetNode);\n      e1.id = edge.id();\n    }\n  }\n\n  var getPositions = function getPositions(ele, i) {\n    if (typeof ele === \"number\") {\n      ele = i;\n    }\n    var theId = ele.data('id');\n    var lNode = self.idToLNode[theId];\n\n    return {\n      x: lNode.getRect().getCenterX(),\n      y: lNode.getRect().getCenterY()\n    };\n  };\n\n  /*\n   * Reposition nodes in iterations animatedly\n   */\n  var iterateAnimated = function iterateAnimated() {\n    // Thigs to perform after nodes are repositioned on screen\n    var afterReposition = function afterReposition() {\n      if (options.fit) {\n        options.cy.fit(options.eles, options.padding);\n      }\n\n      if (!ready) {\n        ready = true;\n        self.cy.one('layoutready', options.ready);\n        self.cy.trigger({ type: 'layoutready', layout: self });\n      }\n    };\n\n    var ticksPerFrame = self.options.refresh;\n    var isDone;\n\n    for (var i = 0; i < ticksPerFrame && !isDone; i++) {\n      isDone = self.stopped || self.layout.tick();\n    }\n\n    // If layout is done\n    if (isDone) {\n      // If the layout is not a sublayout and it is successful perform post layout.\n      if (layout.checkLayoutSuccess() && !layout.isSubLayout) {\n        layout.doPostLayout();\n      }\n\n      // If layout has a tilingPostLayout function property call it.\n      if (layout.tilingPostLayout) {\n        layout.tilingPostLayout();\n      }\n\n      layout.isLayoutFinished = true;\n\n      self.options.eles.nodes().positions(getPositions);\n\n      afterReposition();\n\n      // trigger layoutstop when the layout stops (e.g. finishes)\n      self.cy.one('layoutstop', self.options.stop);\n      self.cy.trigger({ type: 'layoutstop', layout: self });\n\n      if (frameId) {\n        cancelAnimationFrame(frameId);\n      }\n\n      ready = false;\n      return;\n    }\n\n    var animationData = self.layout.getPositionsData(); // Get positions of layout nodes note that all nodes may not be layout nodes because of tiling\n\n    // Position nodes, for the nodes whose id does not included in data (because they are removed from their parents and included in dummy compounds)\n    // use position of their ancestors or dummy ancestors\n    options.eles.nodes().positions(function (ele, i) {\n      if (typeof ele === \"number\") {\n        ele = i;\n      }\n      // If ele is a compound node, then its position will be defined by its children\n      if (!ele.isParent()) {\n        var theId = ele.id();\n        var pNode = animationData[theId];\n        var temp = ele;\n        // If pNode is undefined search until finding position data of its first ancestor (It may be dummy as well)\n        while (pNode == null) {\n          pNode = animationData[temp.data('parent')] || animationData['DummyCompound_' + temp.data('parent')];\n          animationData[theId] = pNode;\n          temp = temp.parent()[0];\n          if (temp == undefined) {\n            break;\n          }\n        }\n        if (pNode != null) {\n          return {\n            x: pNode.x,\n            y: pNode.y\n          };\n        } else {\n          return {\n            x: ele.position('x'),\n            y: ele.position('y')\n          };\n        }\n      }\n    });\n\n    afterReposition();\n\n    frameId = requestAnimationFrame(iterateAnimated);\n  };\n\n  /*\n  * Listen 'layoutstarted' event and start animated iteration if animate option is 'during'\n  */\n  layout.addListener('layoutstarted', function () {\n    if (self.options.animate === 'during') {\n      frameId = requestAnimationFrame(iterateAnimated);\n    }\n  });\n\n  layout.runLayout(); // Run cose layout\n\n  /*\n   * If animate option is not 'during' ('end' or false) perform these here (If it is 'during' similar things are already performed)\n   */\n  if (this.options.animate !== \"during\") {\n    self.options.eles.nodes().not(\":parent\").layoutPositions(self, self.options, getPositions); // Use layout positions to reposition the nodes it considers the options parameter\n    ready = false;\n  }\n\n  return this; // chaining\n};\n\n//Get the top most ones of a list of nodes\n_CoSELayout.prototype.getTopMostNodes = function (nodes) {\n  var nodesMap = {};\n  for (var i = 0; i < nodes.length; i++) {\n    nodesMap[nodes[i].id()] = true;\n  }\n  var roots = nodes.filter(function (ele, i) {\n    if (typeof ele === \"number\") {\n      ele = i;\n    }\n    var parent = ele.parent()[0];\n    while (parent != null) {\n      if (nodesMap[parent.id()]) {\n        return false;\n      }\n      parent = parent.parent()[0];\n    }\n    return true;\n  });\n\n  return roots;\n};\n\n_CoSELayout.prototype.processChildrenList = function (parent, children, layout) {\n  var size = children.length;\n  for (var i = 0; i < size; i++) {\n    var theChild = children[i];\n    var children_of_children = theChild.children();\n    var theNode;\n\n    var dimensions = theChild.layoutDimensions({\n      nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels\n    });\n\n    if (theChild.outerWidth() != null && theChild.outerHeight() != null) {\n      theNode = parent.add(new CoSENode(layout.graphManager, new PointD(theChild.position('x') - dimensions.w / 2, theChild.position('y') - dimensions.h / 2), new DimensionD(parseFloat(dimensions.w), parseFloat(dimensions.h))));\n    } else {\n      theNode = parent.add(new CoSENode(this.graphManager));\n    }\n    // Attach id to the layout node\n    theNode.id = theChild.data(\"id\");\n    // Attach the paddings of cy node to layout node\n    theNode.paddingLeft = parseInt(theChild.css('padding'));\n    theNode.paddingTop = parseInt(theChild.css('padding'));\n    theNode.paddingRight = parseInt(theChild.css('padding'));\n    theNode.paddingBottom = parseInt(theChild.css('padding'));\n\n    //Attach the label properties to compound if labels will be included in node dimensions  \n    if (this.options.nodeDimensionsIncludeLabels) {\n      if (theChild.isParent()) {\n        var labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false }).w;\n        var labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false }).h;\n        var labelPos = theChild.css(\"text-halign\");\n        theNode.labelWidth = labelWidth;\n        theNode.labelHeight = labelHeight;\n        theNode.labelPos = labelPos;\n      }\n    }\n\n    // Map the layout node\n    this.idToLNode[theChild.data(\"id\")] = theNode;\n\n    if (isNaN(theNode.rect.x)) {\n      theNode.rect.x = 0;\n    }\n\n    if (isNaN(theNode.rect.y)) {\n      theNode.rect.y = 0;\n    }\n\n    if (children_of_children != null && children_of_children.length > 0) {\n      var theNewGraph;\n      theNewGraph = layout.getGraphManager().add(layout.newGraph(), theNode);\n      this.processChildrenList(theNewGraph, children_of_children, layout);\n    }\n  }\n};\n\n/**\n * @brief : called on continuous layouts to stop them before they finish\n */\n_CoSELayout.prototype.stop = function () {\n  this.stopped = true;\n\n  return this; // chaining\n};\n\nvar register = function register(cytoscape) {\n  //  var Layout = getLayout( cytoscape );\n\n  cytoscape('layout', 'cose-bilkent', _CoSELayout);\n};\n\n// auto reg for globals\nif (typeof cytoscape !== 'undefined') {\n  register(cytoscape);\n}\n\nmodule.exports = register;\n\n/***/ })\n/******/ ]);\n});","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Force-directed layout for the ontology graph, ported from the\n * east-ontology webview. Picks between cose-bilkent / grid based on node /\n * link / group counts, then runs a post-pass to separate rectangular nodes\n * that ended up overlapping.\n *\n * @packageDocumentation\n */\n\nimport cytoscape from 'cytoscape';\n// @ts-expect-error no type declarations available\nimport coseBilkent from 'cytoscape-cose-bilkent';\nimport type { FlatNode, FlatLink } from './types.js';\n\ncytoscape.use(coseBilkent);\n\nexport interface LayoutResult {\n    positions: Map<string, { x: number; y: number }>;\n}\n\nconst NODE_WIDTH = 200;\nconst NODE_HEIGHT = 80;\n\nfunction getCoseBilkentOptions(nodeCount: number): cytoscape.LayoutOptions {\n    const baseSpacing = Math.max(300, nodeCount * 3);\n    const iterations = Math.max(2500, Math.min(5000, nodeCount * 40));\n    return {\n        name: 'cose-bilkent',\n        nodeRepulsion: baseSpacing * 12,\n        idealEdgeLength: baseSpacing,\n        edgeElasticity: 0.35,\n        nestingFactor: 0.1,\n        gravity: 0.08,\n        numIter: iterations,\n        tile: true,\n        tilingPaddingVertical: 30,\n        tilingPaddingHorizontal: 30,\n        quality: 'default',\n        randomize: false,\n        convergenceThreshold: 0.01,\n        animate: false,\n        fit: true,\n        padding: 50,\n    } as cytoscape.LayoutOptions;\n}\n\nfunction getConstrainedForceOptions(): cytoscape.LayoutOptions {\n    return {\n        name: 'cose-bilkent',\n        randomize: false,\n        nodeRepulsion: 15000,\n        idealEdgeLength: 200,\n        edgeElasticity: 0.3,\n        gravity: 0.15,\n        gravityRange: 2.5,\n        nestingFactor: 0.2,\n        numIter: 3000,\n        initialTemp: 1000,\n        coolingFactor: 0.95,\n        minTemp: 1.0,\n        tile: true,\n        tilingPaddingVertical: 40,\n        tilingPaddingHorizontal: 40,\n        animate: false,\n        fit: true,\n        padding: 50,\n    } as cytoscape.LayoutOptions;\n}\n\nfunction getCompoundOptions(): cytoscape.LayoutOptions {\n    return {\n        name: 'cose-bilkent',\n        nestingFactor: 0.5,\n        gravity: 0.2,\n        gravityCompound: 1.5,\n        gravityRange: 3.0,\n        nodeRepulsion: 8000,\n        idealEdgeLength: 160,\n        edgeElasticity: 0.3,\n        initialTemp: 300,\n        coolingFactor: 0.92,\n        minTemp: 1.0,\n        numIter: 3500,\n        tile: true,\n        tilingPaddingVertical: 50,\n        tilingPaddingHorizontal: 50,\n        animate: false,\n        fit: true,\n        padding: 50,\n    } as cytoscape.LayoutOptions;\n}\n\nfunction getGridOptions(nodeCount: number): cytoscape.LayoutOptions {\n    const gridSize = Math.ceil(Math.sqrt(nodeCount));\n    return {\n        name: 'grid',\n        rows: gridSize,\n        cols: gridSize,\n        spacingFactor: 2.5,\n        avoidOverlap: true,\n        avoidOverlapPadding: 50,\n        condense: false,\n        animate: false,\n        fit: true,\n        padding: 50,\n    } as cytoscape.LayoutOptions;\n}\n\nfunction selectLayout(nodes: FlatNode[], links: FlatLink[]): cytoscape.LayoutOptions {\n    const nodeCount = nodes.length;\n    const groupCount = nodes.filter(n => n.nodeType === 'group').length;\n    const linkCount = links.length;\n    if (nodeCount < 15) return getCoseBilkentOptions(nodeCount);\n    if (linkCount > nodeCount * 1.8) return getConstrainedForceOptions();\n    if (groupCount > 2) return getCompoundOptions();\n    return getCoseBilkentOptions(nodeCount);\n}\n\nexport function calculateLayout(nodes: FlatNode[], links: FlatLink[]): LayoutResult {\n    const positions = new Map<string, { x: number; y: number }>();\n    if (nodes.length === 0) return { positions };\n\n    const cy = cytoscape({\n        headless: true,\n        styleEnabled: true,\n        elements: {\n            nodes: nodes.map(n => ({\n                data: {\n                    id: n.id,\n                    width: NODE_WIDTH,\n                    height: NODE_HEIGHT,\n                    type: n.nodeType,\n                    isGroup: n.nodeType === 'group',\n                },\n            })),\n            edges: links.map(l => ({\n                data: { id: l.id, source: l.source, target: l.target, type: l.linkType },\n            })),\n        },\n        style: [\n            {\n                selector: 'node',\n                style: {\n                    width: NODE_WIDTH,\n                    height: NODE_HEIGHT,\n                    shape: 'rectangle' as const,\n                },\n            },\n        ],\n    });\n\n    let layoutSucceeded = false;\n    try {\n        const layout = cy.layout(selectLayout(nodes, links));\n        layout.run();\n        layoutSucceeded = true;\n    } catch {\n        layoutSucceeded = false;\n    }\n\n    if (layoutSucceeded) {\n        let allAtOrigin = true;\n        cy.nodes().forEach(node => {\n            const pos = node.position();\n            if (pos.x !== 0 || pos.y !== 0) allAtOrigin = false;\n        });\n        if (allAtOrigin) layoutSucceeded = false;\n    }\n\n    if (!layoutSucceeded) {\n        try {\n            cy.layout(getGridOptions(nodes.length)).run();\n        } catch {\n            // best-effort — fall through with whatever positions we have\n        }\n    }\n\n    const rawPositions: { id: string; x: number; y: number }[] = [];\n    cy.nodes().forEach(node => {\n        const pos = node.position();\n        rawPositions.push({ id: node.id(), x: pos.x, y: pos.y });\n    });\n    cy.destroy();\n\n    separateOverlappingNodes(rawPositions);\n\n    for (const p of rawPositions) {\n        positions.set(p.id, { x: p.x, y: p.y });\n    }\n    return { positions };\n}\n\nconst MIN_SPACING = 60;\n\nfunction separateOverlappingNodes(nodes: { id: string; x: number; y: number }[]) {\n    const maxIterations = 500;\n    const requiredW = NODE_WIDTH + MIN_SPACING;\n    const requiredH = NODE_HEIGHT + MIN_SPACING;\n    for (let iter = 0; iter < maxIterations; iter++) {\n        let hasOverlap = false;\n        const damping = Math.max(0.3, 0.8 - iter * 0.001);\n        for (let i = 0; i < nodes.length; i++) {\n            for (let j = i + 1; j < nodes.length; j++) {\n                const a = nodes[i]!;\n                const b = nodes[j]!;\n                const dx = a.x - b.x;\n                const dy = a.y - b.y;\n                const absDx = Math.abs(dx);\n                const absDy = Math.abs(dy);\n                if (absDx >= requiredW || absDy >= requiredH) continue;\n                hasOverlap = true;\n                const overlapX = requiredW - absDx;\n                const overlapY = requiredH - absDy;\n                let fx: number;\n                let fy: number;\n                if (absDx === 0 && absDy === 0) {\n                    const angle = Math.random() * Math.PI * 2;\n                    fx = Math.cos(angle) * requiredW;\n                    fy = Math.sin(angle) * requiredH;\n                } else if (overlapX < overlapY) {\n                    fx = Math.sign(dx) * overlapX * 0.6;\n                    fy = Math.sign(dy || 1) * overlapY * 0.15;\n                } else {\n                    fx = Math.sign(dx || 1) * overlapX * 0.15;\n                    fy = Math.sign(dy) * overlapY * 0.6;\n                }\n                a.x += fx * damping;\n                a.y += fy * damping;\n                b.x -= fx * damping;\n                b.y -= fy * damping;\n            }\n        }\n        if (!hasOverlap) return;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `useFlowState` — ReactFlow controller for the ontology editor.\n *\n * Ported from the east-ontology webview but decoupled from\n * `OntologyContext` — the ontology + flatten result + mutation callbacks\n * are injected by the parent (the renderer in `index.tsx`).\n *\n * Phase 2: read-only (no mutation surfaces are wired here yet; the\n * `onConnect` / `onNodesChange` removals just fire the injected callbacks\n * which the read-only renderer keeps as no-ops).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n    applyNodeChanges,\n    applyEdgeChanges,\n    useReactFlow,\n    type Node as FlowNode,\n    type Edge as FlowEdge,\n    type NodeChange,\n    type EdgeChange,\n} from '@xyflow/react';\nimport { calculateLayout } from './layout.js';\nimport type { FlatLink, FlatNode } from './types.js';\nimport type { OntologyFlowNodeData } from './OntologyNode.js';\nimport type { OntologyFlowEdgeData } from './OntologyEdge.js';\n\n/**\n * Mutation callbacks the parent renderer injects. In read-only mode the\n * parent passes no-ops; in editable mode each callback re-derives the\n * next-ontology and writes it back through `binding.write` via\n * `useBindingOntology`'s `mutate`.\n */\nexport interface OntologyMutations {\n    deleteNodes(ids: Set<string>): void;\n    deleteLinks(ids: Set<string>): void;\n}\n\nexport interface UseFlowStateArgs {\n    flatNodes: FlatNode[];\n    flatLinks: FlatLink[];\n    mutations: OntologyMutations;\n}\n\ninterface GetBestHandlesResult {\n    sourceHandle: string;\n    targetHandle: string;\n}\n\nfunction getBestHandles(\n    sourcePos: { x: number; y: number },\n    targetPos: { x: number; y: number },\n): GetBestHandlesResult {\n    const dx = targetPos.x - sourcePos.x;\n    const dy = targetPos.y - sourcePos.y;\n    if (Math.abs(dx) > Math.abs(dy)) {\n        return dx > 0\n            ? { sourceHandle: 'right',  targetHandle: 'left-target' }\n            : { sourceHandle: 'left',   targetHandle: 'right-target' };\n    }\n    return dy > 0\n        ? { sourceHandle: 'bottom', targetHandle: 'top-target' }\n        : { sourceHandle: 'top',    targetHandle: 'bottom-target' };\n}\n\nfunction buildFlowNodes(\n    flatNodes: FlatNode[],\n    positions: Map<string, { x: number; y: number }>,\n): FlowNode<OntologyFlowNodeData>[] {\n    return flatNodes.map(n => ({\n        id: n.id,\n        type: 'ontology' as const,\n        position: positions.get(n.id) ?? { x: 0, y: 0 },\n        data: {\n            name: n.name,\n            description: n.description,\n            type: n.nodeType,\n            attention: 'normal' as const,\n        },\n    }));\n}\n\nfunction buildFlowEdges(\n    flatLinks: FlatLink[],\n    positions: Map<string, { x: number; y: number }>,\n): FlowEdge<OntologyFlowEdgeData>[] {\n    return flatLinks.map(l => {\n        const sp = positions.get(l.source) ?? { x: 0, y: 0 };\n        const tp = positions.get(l.target) ?? { x: 0, y: 0 };\n        const handles = getBestHandles(sp, tp);\n        return {\n            id: l.id,\n            source: l.source,\n            target: l.target,\n            sourceHandle: handles.sourceHandle,\n            targetHandle: handles.targetHandle,\n            type: 'ontology' as const,\n            data: {\n                type: l.linkType,\n                label: l.linkType.replace(/_/g, ' '),\n                attention: 'normal' as const,\n            },\n        };\n    });\n}\n\nexport function useFlowState({ flatNodes, flatLinks, mutations }: UseFlowStateArgs) {\n    const { screenToFlowPosition } = useReactFlow();\n\n    // Initial positions — computed once per mount; tracked imperatively after.\n    const [initialPositions] = useState(() => {\n        const { positions } = calculateLayout(flatNodes, flatLinks);\n        return positions;\n    });\n    const positionsRef = useRef<Map<string, { x: number; y: number }>>(initialPositions);\n\n    // Seed a position for a not-yet-rendered node id (used by \"add node\" so\n    // the new node lands where the user clicked, before the binding refetch\n    // rebuilds the flow nodes).\n    const setNodePosition = useCallback((id: string, pos: { x: number; y: number }) => {\n        positionsRef.current.set(id, pos);\n    }, []);\n\n    const [nodes, setNodes] = useState<FlowNode<OntologyFlowNodeData>[]>(\n        () => buildFlowNodes(flatNodes, initialPositions),\n    );\n    const [edges, setEdges] = useState<FlowEdge<OntologyFlowEdgeData>[]>(\n        () => buildFlowEdges(flatLinks, initialPositions),\n    );\n\n    // Sync from binding refetch → local state. Preserves positions from\n    // drags; new nodes get (0,0) until the next layout pass.\n    const prevFlatNodesRef = useRef(flatNodes);\n    const prevFlatLinksRef = useRef(flatLinks);\n    useEffect(() => {\n        const nodesChanged = prevFlatNodesRef.current !== flatNodes;\n        const linksChanged = prevFlatLinksRef.current !== flatLinks;\n        if (!nodesChanged && !linksChanged) return;\n\n        prevFlatNodesRef.current = flatNodes;\n        prevFlatLinksRef.current = flatLinks;\n\n        for (const n of flatNodes) {\n            if (!positionsRef.current.has(n.id)) {\n                positionsRef.current.set(n.id, { x: 0, y: 0 });\n            }\n        }\n        if (nodesChanged) setNodes(buildFlowNodes(flatNodes, positionsRef.current));\n        if (linksChanged) setEdges(buildFlowEdges(flatLinks, positionsRef.current));\n    }, [flatNodes, flatLinks]);\n\n    const onNodesChange = useCallback((changes: NodeChange[]) => {\n        const removed = new Set(changes.filter(c => c.type === 'remove').map(c => c.id));\n        if (removed.size > 0) {\n            mutations.deleteNodes(removed);\n            return;\n        }\n        let hasPositionChanges = false;\n        for (const c of changes) {\n            if (c.type === 'position' && c.position) {\n                positionsRef.current.set(c.id, c.position);\n                hasPositionChanges = true;\n            }\n        }\n        setNodes(nds => applyNodeChanges(changes, nds) as FlowNode<OntologyFlowNodeData>[]);\n        if (hasPositionChanges) {\n            setEdges(prev => prev.map(e => {\n                const sp = positionsRef.current.get(e.source) ?? { x: 0, y: 0 };\n                const tp = positionsRef.current.get(e.target) ?? { x: 0, y: 0 };\n                const handles = getBestHandles(sp, tp);\n                if (e.sourceHandle === handles.sourceHandle && e.targetHandle === handles.targetHandle) return e;\n                return { ...e, sourceHandle: handles.sourceHandle, targetHandle: handles.targetHandle };\n            }));\n        }\n    }, [mutations]);\n\n    const onEdgesChange = useCallback((changes: EdgeChange[]) => {\n        const removed = new Set(changes.filter(c => c.type === 'remove').map(c => c.id));\n        if (removed.size > 0) {\n            mutations.deleteLinks(removed);\n            return;\n        }\n        setEdges(eds => applyEdgeChanges(changes, eds) as FlowEdge<OntologyFlowEdgeData>[]);\n    }, [mutations]);\n\n    return useMemo(\n        () => ({ nodes, edges, onNodesChange, onEdgesChange, screenToFlowPosition, setNodePosition }),\n        [nodes, edges, onNodesChange, onEdgesChange, screenToFlowPosition, setNodePosition],\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * How a view whose read failed tries it again by itself.\n *\n * @remarks\n * A view on a screen no one touches, such as a kiosk's, has no one to reload\n * it, so a read the view depends on is tried again after it fails, for as long\n * as the view is mounted. The waits back off from 1 s to 30 s, and each is drawn\n * at random from the second half of its own, so views that failed together,\n * such as a fleet of kiosks behind one server, do not try again together.\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useRef } from \"react\";\nimport type { QueryObserverResult } from \"@tanstack/react-query\";\n\n/** The most a view waits before it tries a read again after its first\n *  failure; each failure in a row doubles it, up to {@link RECOVERY_MAX_MS}. */\nexport const RECOVERY_FIRST_MS = 1_000;\n\n/** The most a view waits before it tries a read again. */\nexport const RECOVERY_MAX_MS = 30_000;\n\n/**\n * How long a view waits before it tries a failed read again.\n *\n * @remarks\n * The wait backs off: at most 1 s after the first failure in a row, doubling\n * with each failure after it, up to 30 s. It is a random point in the second\n * half of that: 0.5–1 s after the first failure, 1–2 s after the second, and\n * 15–30 s from the sixth on. So views that failed together try again apart,\n * and none tries again sooner than half its backoff.\n *\n * @param failures - How many times in a row the read has failed, from 1\n * @param random - A draw from [0, 1); `Math.random` unless a test gives one\n * @returns The wait, in milliseconds\n */\nexport function recoveryDelay(failures: number, random: () => number = Math.random): number {\n    const most = Math.min(RECOVERY_FIRST_MS * 2 ** Math.max(0, failures - 1), RECOVERY_MAX_MS);\n    return Math.round((most / 2) * (1 + random()));\n}\n\n/** What {@link useQueryRecovery} reads of a query, as `useQuery` returns it. */\nexport type RecoveringQuery = Pick<\n    QueryObserverResult<unknown, Error>,\n    \"error\" | \"errorUpdatedAt\" | \"dataUpdatedAt\" | \"fetchStatus\" | \"refetch\"\n>;\n\n/** The failures of a query in a row, each counted once, by when it failed,\n *  and the latest of them. */\ninterface Streak {\n    readonly failures: number;\n    readonly at: number;\n    readonly latest: Error | null;\n}\n\nconst NO_STREAK: Streak = { failures: 0, at: 0, latest: null };\n\n/**\n * Tries a failed query again by itself, for as long as the view is mounted,\n * and gives the failure to show meanwhile.\n *\n * @remarks\n * A query that failed fetches again only when the window regains focus or the\n * view mounts again, so a view on a screen no one touches would stay on the\n * failure. This fetches it again after {@link recoveryDelay}'s wait for each\n * failure in a row, once the query has stopped fetching.\n *\n * TanStack clears the error of a query that holds no data while it fetches\n * again, so a view that showed the query's error would go back to loading at\n * every try. The failure this gives stands until a fetch reads: the latest,\n * through each try.\n *\n * @param query - The query to keep trying while it fails\n * @returns The failure to show, or `null` while the query has not failed since\n *   it last read\n */\nexport function useQueryRecovery(query: RecoveringQuery): Error | null {\n    const { error, errorUpdatedAt, dataUpdatedAt, fetchStatus, refetch } = query;\n    // Whether the query has failed since it last read: a try in flight, which\n    // TanStack shows with no error, does not end that.\n    const failing = errorUpdatedAt > dataUpdatedAt;\n    const streak = useRef<Streak>(NO_STREAK);\n    useEffect(() => {\n        if (!failing) {\n            streak.current = NO_STREAK;\n            return;\n        }\n        if (error === null || fetchStatus !== \"idle\") return;\n        // An effect that runs again for the same failure backs off no further.\n        if (streak.current.at !== errorUpdatedAt) {\n            streak.current = { failures: streak.current.failures + 1, at: errorUpdatedAt, latest: error };\n        }\n        const timer = setTimeout(() => {\n            void refetch();\n        }, recoveryDelay(streak.current.failures));\n        return () => clearTimeout(timer);\n    }, [failing, error, errorUpdatedAt, fetchStatus, refetch]);\n    return error ?? (failing ? streak.current.latest : null);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<E3Provider>` — top-level React provider for e3 server identity and\n * auth.\n *\n * @remarks\n * Server identity (`apiUrl`, `repo`, `workspace`, `token`, and the `fetch`\n * requests go through) is shared\n * across every e3-talking surface in this package — the dataset cache,\n * task-detail queries, status polls, list endpoints, etc. It therefore\n * lives in a single context here, not threaded through individual\n * stores or read out of the dataset cache as a side effect of\n * construction.\n *\n * `<E3Provider>` also owns the `<QueryClientProvider>` wrap so the\n * package's TanStack-Query-backed hooks (`useTaskDetails`,\n * `useDatasetValue`, etc.) work without callers having to mount\n * TanStack themselves.\n *\n * Mount once near the React root. Inner providers (notably\n * `<ReactiveDatasetProvider>`) read this context to construct their\n * adapters; consumers like `<UITaskPreview>` read it directly to wire\n * their own queries.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { StringType, StructType, printFor } from \"@elaraai/east\";\nimport type { RequestOptions } from \"@elaraai/e3-api-client\";\n// The internal entry, never the main one: the main loads the markdown renderer, which reaches for a document as it\n// loads, and the bind runtimes load this module in Node.\nimport { EditingScope } from \"@elaraai/east-ui-components/internal\";\nimport { recoveryDelay } from \"./recovery.js\";\n\n/**\n * Server identity + auth for an e3 React tree.\n *\n * @property apiUrl - Base URL of the e3 API server.\n * @property repo - Repository name. Defaults to `\"default\"` when omitted.\n * @property workspace - Active workspace. Optional at the provider\n *  level — components that strictly require one (e.g. `<UITaskPreview>`,\n *  `Data.bind`) surface their own error if it's missing.\n * @property token - Optional bearer token for authenticated requests.\n *  May be `null` for \"anonymous.\" Rotates freely — every call re-reads.\n * @property fetch - The `fetch` every request goes through\n *  (`RequestOptions.fetch`); the global `fetch` when omitted. A host that\n *  answers e3's API itself — e3 running in a page — gives its own. Changes\n *  freely, as the token does.\n */\nexport interface E3Config {\n    apiUrl: string;\n    repo?: string;\n    workspace?: string;\n    token?: string | null;\n    fetch?: typeof globalThis.fetch;\n}\n\n/**\n * The request options an {@link E3Config} gives: its token, and its `fetch`\n * when it gives one.\n *\n * @remarks\n * The provider's runtimes and the previews build their requests' options\n * here, so a `fetch` the config gives reaches every request they make.\n *\n * @param config - The token and the `fetch` to send requests with\n * @returns The options for `@elaraai/e3-api-client`'s calls\n */\nexport function e3RequestOptions(config: {\n    token?: string | null | undefined;\n    fetch?: typeof globalThis.fetch | undefined;\n}): RequestOptions {\n    const token = config.token ?? null;\n    return config.fetch === undefined ? { token } : { token, fetch: config.fetch };\n}\n\nconst E3ConfigContext = createContext<E3Config | null>(null);\n\n/**\n * Props for {@link E3Provider}.\n *\n * @property children - Subtree that should see this config.\n * @property config - The {@link E3Config} to expose.\n * @property queryClient - Optional external `QueryClient`. One is\n *  created if omitted, which tries a failed query twice more before it\n *  reports the failure, after waits drawn as a view's own tries are\n *  ({@link recoveryDelay}), so views that failed together do not try\n *  again together. Pass an external instance to share a TanStack cache\n *  with the rest of your application; its own retries apply.\n */\nexport interface E3ProviderProps {\n    children: ReactNode;\n    config: E3Config;\n    queryClient?: QueryClient;\n}\n\n/** A data set's name, as the editing beneath a provider is held under it: its server, repository and workspace. */\nconst dataSetName = printFor(StructType({ server: StringType, repo: StringType, workspace: StringType }));\n\n/**\n * Provide e3 server identity + auth + a TanStack-Query client to a\n * React subtree, and name the data set its editing reads and writes — the\n * server, repository and workspace — so drafts made over one workspace never\n * reach another's whose records share their names.\n *\n * @example\n * ```tsx\n * <E3Provider config={{ apiUrl: \"http://localhost:3000\", workspace: \"prod\", token }}>\n *     <ReactiveDatasetProvider>\n *         <App />\n *     </ReactiveDatasetProvider>\n * </E3Provider>\n * ```\n */\nexport function E3Provider({ children, config, queryClient: externalClient }: E3ProviderProps) {\n    const client = useMemo(\n        () => externalClient ?? new QueryClient({\n            // TanStack counts the failures before a retry from 0.\n            defaultOptions: { queries: { retry: 2, retryDelay: (failures) => recoveryDelay(failures + 1), staleTime: 30000 } },\n        }),\n        [externalClient],\n    );\n    const scope = useMemo(() => dataSetName({ server: config.apiUrl, repo: config.repo ?? \"\", workspace: config.workspace ?? \"\" }),\n        [config.apiUrl, config.repo, config.workspace]);\n    return (\n        <E3ConfigContext.Provider value={config}>\n            <EditingScope.Provider value={scope}>\n                <QueryClientProvider client={client}>\n                    {children}\n                </QueryClientProvider>\n            </EditingScope.Provider>\n        </E3ConfigContext.Provider>\n    );\n}\n\n/**\n * Read the active {@link E3Config}. Throws if no `<E3Provider>` is\n * mounted — every component that talks to e3 needs one.\n */\nexport function useE3Config(): E3Config {\n    const cfg = useContext(E3ConfigContext);\n    if (!cfg) {\n        throw new Error(\n            \"useE3Config must be used within an <E3Provider>. \" +\n            \"Mount one near your React root with apiUrl / workspace / token.\",\n        );\n    }\n    return cfg;\n}\n\n/**\n * Read the active {@link E3Config}, or `null` if no provider is\n * mounted. Use this when a component should degrade gracefully\n * (e.g. an empty state) rather than throwing.\n */\nexport function useE3ConfigOptional(): E3Config | null {\n    return useContext(E3ConfigContext);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * React hooks and provider for ReactiveDataset platform functions.\n *\n * @packageDocumentation\n */\n\nimport {\n    createContext,\n    useContext,\n    useEffect,\n    useMemo,\n    useCallback,\n    useState,\n    useRef,\n    useSyncExternalStore,\n    type ReactNode,\n} from \"react\";\nimport type { TreePath } from \"@elaraai/e3-types\";\nimport type { RequestOptions } from \"@elaraai/e3-api-client\";\nimport {\n    ReactiveDatasetCache,\n    type ReactiveDatasetCacheInterface,\n    createDefaultDatasetApi,\n    datasetCacheKey,\n} from \"./dataset-store.js\";\nimport {\n    initializeReactiveDatasetCache,\n    clearReactiveDatasetCache,\n    clearBindingRegistry,\n} from \"./bind-runtime.js\";\nimport {\n    createDefaultFunctionApi,\n    initializeFunctionApi,\n    clearFunctionApi,\n} from \"./func-runtime.js\";\nimport {\n    createDefaultPagedApi,\n    initializePagedApi,\n    clearPagedApi,\n} from \"./paged-runtime.js\";\nimport {\n    createDefaultRecordApi,\n    initializeRecordApi,\n    clearRecordApi,\n} from \"./record-runtime.js\";\nimport { getStagedStore } from \"./staged-store.js\";\nimport { e3RequestOptions, useE3Config } from \"./e3-config.js\";\nimport { recoveryDelay } from \"./recovery.js\";\n\n// =============================================================================\n// Context\n// =============================================================================\n\nconst ReactiveDatasetCacheContext = createContext<ReactiveDatasetCacheInterface | null>(null);\n\n/**\n * Props for {@link ReactiveDatasetProvider}.\n *\n * @property children - Subtree that should see the dataset cache.\n */\nexport interface ReactiveDatasetProviderProps {\n    children: ReactNode;\n    /**\n     * The interval the cache polls a workspace at while what it shows\n     * changes, in milliseconds, unless a watch asks for a shorter one\n     * ({@link ReactiveDatasetCacheConfig.pollIntervalMs}). Default 1000.\n     */\n    pollIntervalMs?: number;\n    /**\n     * The longest the cache's poll of a workspace backs off to while nothing\n     * it shows changes, in milliseconds, unless a watch asks for a shorter one\n     * ({@link ReactiveDatasetCacheConfig.pollBackoffMs}). Default 5000.\n     */\n    pollBackoffMs?: number;\n}\n\n/** The cache a provider installed, and the server identity it was built for. */\ninterface InstalledCache {\n    readonly apiUrl: string;\n    readonly repo: string;\n    readonly workspace: string | undefined;\n    readonly cache: ReactiveDatasetCache;\n}\n\n/**\n * Provide a {@link ReactiveDatasetCache} to the component tree.\n *\n * @remarks\n * Reads server identity from the surrounding `<E3Provider>` to build a\n * default {@link DatasetApi} adapter and a workspace-scoped cache, and installs\n * them — with the `Func.bind`, `Data.bindPaged` and `Record.bind` adapters — in\n * the process-global runtimes the East-side bindings resolve through. The\n * cache's scheduler uses `queueMicrotask`, so cache notifications never fire\n * during a React render pass.\n *\n * The children render once the provider's cache is installed, so a\n * `Data.bind`'s first read finds it; they render again from nothing when the\n * server identity changes. A provider tears down only what it installed, so\n * one replacing another — re-keyed to a new workspace — or StrictMode's\n * mount → unmount → mount never leaves the runtimes empty.\n *\n * Must be mounted inside an `<E3Provider>` (which also owns the\n * `<QueryClientProvider>` wrap that this package's TanStack hooks\n * depend on). Throws otherwise.\n *\n * @example\n * ```tsx\n * <E3Provider config={{ apiUrl: \"http://localhost:3000\", workspace: \"prod\", token }}>\n *     <ReactiveDatasetProvider>\n *         <MyComponent />\n *     </ReactiveDatasetProvider>\n * </E3Provider>\n * ```\n */\nexport function ReactiveDatasetProvider({\n    children,\n    pollIntervalMs,\n    pollBackoffMs,\n}: ReactiveDatasetProviderProps) {\n    const e3 = useE3Config();\n    const { apiUrl, workspace } = e3;\n    const repo = e3.repo ?? \"default\";\n\n    // `getOptions` is a getter (not a snapshot) so a token or a `fetch` the\n    // surrounding context rotates propagates without rebuilding the cache.\n    const options = e3RequestOptions(e3);\n    const optionsRef = useRef<RequestOptions>(options);\n    optionsRef.current = options;\n\n    const [installed, setInstalled] = useState<InstalledCache | null>(null);\n\n    // One effect owns everything the provider installs. The runtimes behind\n    // Data.bind, Data.bindPaged, Func.bind and Record.bind are process-global,\n    // so the effect builds the cache and each adapter, installs them, and on\n    // cleanup removes only what IT installed. Built here rather than during\n    // render, StrictMode's setup → cleanup → setup builds a second cache\n    // instead of reviving the destroyed one, and a provider that replaces\n    // another installs after the old one has torn down, not before.\n    useEffect(() => {\n        const getOptions = (): RequestOptions => optionsRef.current;\n        const cache = new ReactiveDatasetCache(\n            {\n                ...(workspace !== undefined && { workspace }),\n                ...(pollIntervalMs !== undefined && { pollIntervalMs }),\n                ...(pollBackoffMs !== undefined && { pollBackoffMs }),\n            },\n            createDefaultDatasetApi(apiUrl, repo, getOptions),\n        );\n        cache.setScheduler((notify) => queueMicrotask(notify));\n        initializeReactiveDatasetCache(cache);\n        // The function and record runtimes share the cache's workspace and\n        // server identity; a record IS a dataset, so its current value is read\n        // through the same cache. A paged source reads windows through its own\n        // endpoints and follows its dataset through the cache's status poll.\n        const functionApi = createDefaultFunctionApi(apiUrl, repo, getOptions);\n        const pagedApi = createDefaultPagedApi(apiUrl, repo, getOptions, cache);\n        const recordApi = createDefaultRecordApi(apiUrl, repo, getOptions);\n        if (workspace !== undefined) {\n            initializeFunctionApi(functionApi, workspace);\n            initializePagedApi(pagedApi, workspace);\n            initializeRecordApi(recordApi, cache, workspace);\n        }\n        // Staged edits are kept per server and repository: one browser origin\n        // can serve several, and their edits must not meet.\n        const unscopeStaged = getStagedStore().setScope(JSON.stringify([apiUrl, repo]));\n        setInstalled({ apiUrl, repo, workspace, cache });\n        return () => {\n            // Order matters: drop the queued writes BEFORE destroying the\n            // cache, so a write already dequeued and mid-await never reaches a\n            // workspace the user has navigated away from.\n            clearReactiveDatasetCache(cache);\n            clearFunctionApi(functionApi);\n            clearPagedApi(pagedApi);\n            clearRecordApi(recordApi);\n            unscopeStaged();\n            cache.destroy();\n            // Drop binding-registry entries for this workspace so a long\n            // session navigating across workspaces doesn't leak metadata\n            // for paths it no longer consults.\n            if (workspace) clearBindingRegistry(workspace);\n            else clearBindingRegistry();\n        };\n    }, [apiUrl, repo, workspace, pollIntervalMs, pollBackoffMs]);\n\n    // The installed cache, while it is the one for the current identity: a\n    // render between an identity change and the new install shows nothing\n    // rather than the old workspace's data.\n    const cache = installed !== null\n        && installed.apiUrl === apiUrl && installed.repo === repo && installed.workspace === workspace\n        ? installed.cache\n        : null;\n\n    // Expose cache for debugging\n    useEffect(() => {\n        if (cache === null || typeof window === \"undefined\") return;\n        (window as unknown as Record<string, unknown>).__EAST_REACTIVE_DATASET_CACHE__ = cache;\n        return () => {\n            delete (window as unknown as Record<string, unknown>).__EAST_REACTIVE_DATASET_CACHE__;\n        };\n    }, [cache]);\n\n    if (cache === null) return null;\n    return (\n        <ReactiveDatasetCacheContext.Provider value={cache}>\n            {children}\n        </ReactiveDatasetCacheContext.Provider>\n    );\n}\n\n// =============================================================================\n// Hooks\n// =============================================================================\n\n/**\n * Hook to access the ReactiveDatasetCache from context.\n *\n * @returns The ReactiveDatasetCache instance\n * @throws Error if used outside of a ReactiveDatasetProvider\n */\nexport function useReactiveDatasetCache(): ReactiveDatasetCacheInterface {\n    const cache = useContext(ReactiveDatasetCacheContext);\n    if (!cache) {\n        throw new Error(\"useReactiveDatasetCache must be used within a ReactiveDatasetProvider\");\n    }\n    return cache;\n}\n\n/**\n * Like {@link useReactiveDatasetCache} but returns `null` instead of throwing\n * when used outside a `<ReactiveDatasetProvider>`. Use this when a component\n * has a graceful fallback (e.g. accepts an explicit config prop too).\n */\nexport function useReactiveDatasetCacheOptional(): ReactiveDatasetCacheInterface | null {\n    return useContext(ReactiveDatasetCacheContext);\n}\n\n/**\n * Hook to subscribe to reactive dataset cache changes using React 18's useSyncExternalStore.\n *\n * @returns The current snapshot version\n */\nexport function useReactiveDatasetCacheSubscription(): number {\n    const cache = useReactiveDatasetCache();\n    const subscribe = useCallback((cb: () => void) => cache.subscribe(cb), [cache]);\n    const getSnapshot = useCallback(() => cache.getSnapshot(), [cache]);\n\n    return useSyncExternalStore(subscribe, getSnapshot);\n}\n\n/**\n * Hook to subscribe to a specific reactive dataset key.\n *\n * @param workspace - The workspace name\n * @param path - The dataset path\n * @returns The cached value, or undefined if not loaded\n */\nexport function useReactiveDatasetKey(workspace: string, path: TreePath): Uint8Array | undefined {\n    const cache = useReactiveDatasetCache();\n    const key = datasetCacheKey(workspace, path);\n\n    const subscribe = useCallback(\n        (cb: () => void) => cache.subscribe(key, cb),\n        [cache, key]\n    );\n    const getSnapshot = useCallback(\n        () => cache.read(workspace, path),\n        [cache, workspace, path]\n    );\n\n    return useSyncExternalStore(subscribe, getSnapshot);\n}\n\n/**\n * Reactive dataset to preload.\n */\nexport interface ReactiveDatasetToPreload {\n    workspace: string;\n    path: TreePath;\n}\n\n/**\n * Result of usePreloadReactiveDatasets hook.\n */\nexport interface PreloadReactiveDatasetsResult {\n    /** True while the first preload is in flight */\n    loading: boolean;\n    /** The latest failure, while the preload is failing; it is tried again\n     *  until it succeeds */\n    error: Error | null;\n    /** Preload every dataset again, at once */\n    reload: () => void;\n}\n\n/**\n * Hook to preload reactive datasets before rendering.\n *\n * @remarks\n * A preload that fails is tried again for as long as the hook is mounted, so a\n * view recovers by itself from a network error, a repository whose upgrade is\n * being applied, or a dataset that moved while it was read. The waits back off\n * from 1 s to 30 s, each a random point in the second half of its own\n * ({@link recoveryDelay}), so views that failed together do not try again\n * together. `error` is the latest failure meanwhile. It clears as soon as the\n * cache holds every dataset that failed, whoever brought them in: a status poll\n * that watches a dataset fetches it once it can be read, usually before the\n * next try.\n *\n * @param datasets - Array of datasets to preload\n * @returns Loading state and error\n *\n * @example\n * ```tsx\n * import { variant } from \"@elaraai/east\";\n *\n * function MyComponent() {\n *     const { loading, error } = usePreloadReactiveDatasets([\n *         { workspace: \"production\", path: [variant(\"field\", \"inputs\"), variant(\"field\", \"config\")] },\n *         { workspace: \"production\", path: [variant(\"field\", \"data\")] },\n *     ]);\n *\n *     if (loading) return <Spinner />;\n *     if (error) return <ErrorMessage error={error} />;\n *\n *     return <EastComponent render={myApp} />;\n * }\n * ```\n */\nexport function usePreloadReactiveDatasets(datasets: ReactiveDatasetToPreload[]): PreloadReactiveDatasetsResult {\n    const cache = useReactiveDatasetCacheOptional();\n    const [loading, setLoading] = useState(!!cache && datasets.length > 0);\n    const [error, setError] = useState<Error | null>(null);\n    const [reloadTrigger, setReloadTrigger] = useState(0);\n\n    // Create stable key for the datasets array\n    const datasetsKey = useMemo(\n        () => datasets.map(d => datasetCacheKey(d.workspace, d.path)).join(\"|\"),\n        [datasets]\n    );\n\n    useEffect(() => {\n        if (!cache) {\n            // No provider — nothing to preload. Component renders without\n            // populating the cache; downstream Data.bind reads will throw.\n            setLoading(false);\n            setError(null);\n            return;\n        }\n        let cancelled = false;\n        let attempting = false;\n        // The cache keys the last try failed on, while the preload is failing.\n        let failed: string[] = [];\n        // The tries in a row that failed.\n        let failedTries = 0;\n        let timer: ReturnType<typeof setTimeout> | undefined;\n        const keys = datasets.map(({ workspace, path }) => datasetCacheKey(workspace, path));\n        const held = (i: number): boolean => cache.has(datasets[i]!.workspace, datasets[i]!.path);\n        setLoading(true);\n        setError(null);\n\n        const attempt = (): void => {\n            clearTimeout(timer);\n            attempting = true;\n            void Promise.allSettled(\n                datasets.map(({ workspace, path }) => cache.preload(workspace, path))\n            ).then((outcomes) => {\n                attempting = false;\n                if (cancelled) return;\n                const failures = outcomes.flatMap((outcome, i) => (outcome.status === \"rejected\" ? [i] : []));\n                if (failures.length === 0) {\n                    failed = [];\n                    setError(null);\n                    setLoading(false);\n                    return;\n                }\n                const reason: unknown = (outcomes[failures[0]!] as PromiseRejectedResult).reason;\n                setError(reason instanceof Error ? reason : new Error(String(reason)));\n                setLoading(false);\n                // A dataset that came into the cache while this try failed is in.\n                failed = failures.filter((i) => !held(i)).map((i) => keys[i]!);\n                if (failed.length === 0) {\n                    attempt();\n                    return;\n                }\n                failedTries += 1;\n                timer = setTimeout(attempt, recoveryDelay(failedTries));\n            });\n        };\n\n        // A dataset that failed and comes into the cache another way, such as\n        // the status poll of a view that watches it, ends the failure at once.\n        const unsubscribes = keys.map((key, i) => cache.subscribe(key, () => {\n            if (cancelled || attempting || !failed.includes(key) || !held(i)) return;\n            failed = failed.filter((k) => k !== key);\n            if (failed.length === 0) attempt();\n        }));\n        attempt();\n\n        return () => {\n            cancelled = true;\n            clearTimeout(timer);\n            for (const unsubscribe of unsubscribes) unsubscribe();\n        };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [cache, datasetsKey, reloadTrigger]);\n\n    const reload = useCallback(() => {\n        setReloadTrigger(t => t + 1);\n    }, []);\n\n    return { loading, error, reload };\n}\n\n/**\n * Props for the ReactiveDatasetLoader component.\n */\nexport interface ReactiveDatasetLoaderProps {\n    /** Datasets to preload */\n    datasets: ReactiveDatasetToPreload[];\n    /** Children to render when loaded */\n    children: ReactNode;\n    /** Loading fallback */\n    fallback?: ReactNode;\n    /** Error render function */\n    onError?: (error: Error, reload: () => void) => ReactNode;\n}\n\n/**\n * Component that preloads reactive datasets before rendering children.\n *\n * @example\n * ```tsx\n * import { variant } from \"@elaraai/east\";\n *\n * function App() {\n *     return (\n *         <ReactiveDatasetProvider config={{ apiUrl: \"...\" }}>\n *             <ReactiveDatasetLoader\n *                 datasets={[\n *                     { workspace: \"production\", path: [variant(\"field\", \"config\")] }\n *                 ]}\n *                 fallback={<Spinner />}\n *                 onError={(err, reload) => <ErrorWithRetry error={err} onRetry={reload} />}\n *             >\n *                 <EastComponent render={myApp} />\n *             </ReactiveDatasetLoader>\n *         </ReactiveDatasetProvider>\n *     );\n * }\n * ```\n */\nexport function ReactiveDatasetLoader({\n    datasets,\n    children,\n    fallback = null,\n    onError,\n}: ReactiveDatasetLoaderProps) {\n    const { loading, error, reload } = usePreloadReactiveDatasets(datasets);\n\n    if (loading) {\n        return <>{fallback}</>;\n    }\n\n    if (error) {\n        if (onError) {\n            return <>{onError(error, reload)}</>;\n        }\n        // Default error display\n        return (\n            <div style={{ color: \"red\", padding: \"16px\" }}>\n                <strong>Failed to load datasets:</strong> {error.message}\n                <button onClick={reload} style={{ marginLeft: \"8px\" }}>\n                    Retry\n                </button>\n            </div>\n        );\n    }\n\n    return <>{children}</>;\n}\n\n/**\n * Hook to write to a reactive dataset from React code.\n *\n * @returns A function to write to a dataset\n *\n * @example\n * ```tsx\n * import { encodeBeast2For, IntegerType, variant } from \"@elaraai/east\";\n *\n * function UpdateButton() {\n *     const writeDataset = useReactiveDatasetWrite();\n *\n *     const handleUpdate = async () => {\n *         await writeDataset(\n *             \"production\",\n *             [variant(\"field\", \"inputs\"), variant(\"field\", \"count\")],\n *             encodeBeast2For(IntegerType)(42n)\n *         );\n *     };\n *\n *     return <button onClick={handleUpdate}>Update</button>;\n * }\n * ```\n */\nexport function useReactiveDatasetWrite(): (\n    workspace: string,\n    path: TreePath,\n    value: Uint8Array\n) => Promise<void> {\n    const cache = useReactiveDatasetCache();\n    return useCallback(\n        (workspace: string, path: TreePath, value: Uint8Array) =>\n            cache.write(workspace, path, value),\n        [cache]\n    );\n}\n\n/**\n * Hook to check if a reactive dataset is cached.\n *\n * @param workspace - The workspace name\n * @param path - The dataset path\n * @returns True if the dataset is cached\n */\nexport function useReactiveDatasetHas(workspace: string, path: TreePath): boolean {\n    const cache = useReactiveDatasetCache();\n    const key = datasetCacheKey(workspace, path);\n\n    const subscribe = useCallback(\n        (cb: () => void) => cache.subscribe(key, cb),\n        [cache, key]\n    );\n    const getSnapshot = useCallback(\n        () => cache.has(workspace, path),\n        [cache, workspace, path]\n    );\n\n    return useSyncExternalStore(subscribe, getSnapshot);\n}\n\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * React-side binding integration for the Ontology editor.\n *\n * `useBindingOntology(binding)` is a thin reactive wrapper over the shared\n * `BindRuntime.buildBindHandle` — the same handle that powers every other\n * `Data.bind` consumer (the decision handle among them). It builds the handle for\n * the binding's `(sourceType, source, patch, mode)`, subscribes to the staged\n * store + reactive dataset cache so the canvas re-renders on edits, and exposes\n * the handle's `read` / `write` / `pending` / `commit` / `discard` as an\n * ontology-typed surface.\n *\n * Deliberately holds no decode/stage/commit logic of its own: mode semantics\n * (direct write-through, staged buffering, patch publish) live once, in the\n * runtime. In particular `pending` and `read` honour the handle's per-mode\n * behaviour — e.g. a direct binding never reports a staged buffer.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from 'react';\nimport { type ValueTypeOf } from '@elaraai/east';\nimport type { TreePath } from '@elaraai/e3-types';\nimport { DiffBindingType } from '@elaraai/e3-ui/internal';\nimport {\n    defaultBindRuntime,\n    getBindingTypes,\n    getReactiveDatasetCache,\n    getStagedStore,\n    awaitPendingWrites,\n    datasetCacheKey,\n    type BindHandle,\n} from '../platform/index.js';\nimport type { Ontology } from './types.js';\n\ntype DiffBindingValue = ValueTypeOf<typeof DiffBindingType>;\n\nexport interface UseBindingOntologyResult {\n    /** Current ontology value (buffered if staged, otherwise server). `null`\n     *  if the binding hasn't run yet (no registered types) or the source\n     *  dataset has no value. */\n    ontology: Ontology | null;\n    /** True when there is an in-flight staged change. Always false for direct\n     *  bindings — the handle writes through, never buffers. */\n    pending: boolean;\n    /** Replace the bound value. In staged mode buffers the write; in direct\n     *  mode writes through immediately. */\n    mutate: (next: Ontology) => void;\n    /** Resolve the in-flight change. */\n    commit: () => Promise<void>;\n    /** Drop the in-flight change. */\n    discard: () => void;\n}\n\n/**\n * Subscribe to a binding's source (and patch, if any) path on both the staged\n * store and the reactive dataset cache. Re-renders any time a version bumps.\n */\nfunction useBindingVersion(\n    workspace: string,\n    sourcePath: TreePath,\n    patchPath: TreePath | undefined,\n): number {\n    const staged = getStagedStore();\n    const cache  = getReactiveDatasetCache();\n    const keys = useMemo(() => {\n        const ks = [datasetCacheKey(workspace, sourcePath)];\n        if (patchPath) ks.push(datasetCacheKey(workspace, patchPath));\n        return ks;\n    }, [workspace, sourcePath, patchPath]);\n    const subscribe = useCallback((cb: () => void) => {\n        const unsubs = keys.flatMap(k => [staged.subscribe(k, cb), cache.subscribe(k, cb)]);\n        return () => { for (const u of unsubs) u(); };\n    }, [staged, cache, keys]);\n    const getSnapshot = useCallback(\n        () => keys.reduce((sum, k) => sum + staged.getKeyVersion(k) + cache.getKeyVersion(k), 0),\n        [staged, cache, keys],\n    );\n    return useSyncExternalStore(subscribe, getSnapshot);\n}\n\n/**\n * Resolve a {@link DiffBindingType} value into a live ontology + the\n * commit / discard / mutate handlers, delegating to the shared bind runtime.\n *\n * Returns `ontology: null` if the binding hasn't run yet (types not\n * registered) or no source value is present.\n */\nexport function useBindingOntology(binding: DiffBindingValue): UseBindingOntologyResult {\n    const cache = getReactiveDatasetCache();\n    const workspace = cache.getConfig().workspace ?? '';\n    const sourcePath = binding.source as TreePath;\n    const mode = binding.mode.type;\n    const patchPath = binding.patch.type === 'some' ? (binding.patch.value as TreePath) : undefined;\n\n    // Bump on every staged buffer or server value change for source/patch.\n    const version = useBindingVersion(workspace, sourcePath, patchPath);\n\n    const handle = useMemo<BindHandle | null>(() => {\n        // Only buildable once `Data.bind` has registered the binding's types.\n        if (!getBindingTypes(workspace, sourcePath)) return null;\n        const { sourceType } = getBindingTypes(workspace, sourcePath)!;\n        return defaultBindRuntime.buildBindHandle(sourceType, sourcePath, patchPath, mode);\n    }, [workspace, sourcePath, patchPath, mode]);\n\n    const { ontology, pending } = useMemo(() => {\n        if (!handle || !handle.has()) return { ontology: null, pending: false };\n        try {\n            return { ontology: handle.read() as Ontology, pending: handle.pending() };\n        } catch {\n            return { ontology: null, pending: false };\n        }\n        // `version` drives recompute when buffers / server values change.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [handle, version]);\n\n    const mutate = useCallback((next: Ontology) => {\n        handle?.write(next);\n    }, [handle]);\n\n    const commit = useCallback(async (): Promise<void> => {\n        handle?.commit();\n        await awaitPendingWrites();\n    }, [handle]);\n\n    const discard = useCallback(() => {\n        handle?.discard();\n    }, [handle]);\n\n    return { ontology, pending, mutate, commit, discard };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Tracks the Chakra v3 class-based colour mode (`dark` on `<html>`) so\n * non-Chakra chrome can follow it. React Flow themes its own canvas chrome\n * (node wrapper, MiniMap, Controls, edges) through `--xy-*` CSS variables\n * keyed on its `colorMode` prop — Chakra's `.dark` scope alone doesn't reach\n * them (#362).\n */\n\nimport { useEffect, useState } from 'react';\n\n/** Whether the document is currently in dark mode; live across toggles. */\nexport function useIsDarkMode(): boolean {\n    const [dark, setDark] = useState<boolean>(() =>\n        typeof document !== 'undefined' && document.documentElement.classList.contains('dark'));\n    useEffect(() => {\n        const el = document.documentElement;\n        const update = () => setDark(el.classList.contains('dark'));\n        update();\n        const observer = new MutationObserver(update);\n        observer.observe(el, { attributes: true, attributeFilter: ['class'] });\n        return () => observer.disconnect();\n    }, []);\n    return dark;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Which of a component's views an instance offers (e3-ui's `views` prop,\n * `utils/views.ts`): the component's own, in its own order, kept to those the\n * payload lists. An empty list, or one holding none of them, leaves every view:\n * nothing to show is no way to draw a component.\n *\n * @packageDocumentation\n */\n\n/**\n * The views offered, in the component's order.\n *\n * @param order - The component's views, in its switch's order\n * @param views - The payload's list, each entry a case of the component's view variant\n * @returns Those of `order` the list holds; every one where it holds none\n */\nexport function shownViews<K extends string>(order: readonly K[], views: readonly { readonly type: string }[]): readonly K[] {\n    const shown = order.filter(view => views.some(entry => entry.type === view));\n    return shown.length === 0 ? order : shown;\n}\n\n/**\n * The view to draw: the one held while it is offered, else the first offered. Whatever holds it — storage, state — is\n * left as it stands, so the view comes back should the list offer it again.\n *\n * @param held - The view held\n * @param shown - The views offered\n * @returns The view to draw\n */\nexport function shownView<K extends string>(held: K, shown: readonly K[]): K {\n    return shown.includes(held) ? held : shown[0]!;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraOntology` — Chakra v3 + ReactFlow renderer for the `Ontology`\n * extension component declared in `@elaraai/e3-ui`. Mounts the graph\n * editor over a bound `OntologyType` dataset, writing every edit through\n * the binding.\n *\n * Phase 2 wires the read side end-to-end (binding → decode → render);\n * `onMutate` is wired but the canvas mutation paths (add / delete /\n * connect) are inert until Phase 3 promotes them from no-ops.\n *\n * Registers itself against {@link Ontology.Component} at module load via\n * {@link implementUIComponent}.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useMemo, useState } from 'react';\nimport {\n    Background, BackgroundVariant, Controls, MiniMap, ReactFlow, ReactFlowProvider,\n    type Connection, type EdgeTypes, type Node as FlowNode, type NodeTypes,\n} from '@xyflow/react';\nimport { Global } from '@emotion/react';\n// xyflow ships a static stylesheet its nodes/edges need for positioning.\n// The rest of the design system is emotion CSS-in-JS (no static CSS files),\n// so rather than make every consumer remember a separate `.css` import (and\n// silently collapse if they don't), we bundle the stylesheet into the JS as\n// a string and inject it through emotion's <Global>, scoped to the editor —\n// same self-contained model as east-ui-components.\n// @ts-expect-error — `?inline` returns the stylesheet as a string at build time.\nimport xyflowCss from '@xyflow/react/dist/style.css?inline';\nimport { Box, Button, HStack, Input, Menu, Portal, SegmentGroup, Text } from '@chakra-ui/react';\nimport { faList, faMagnifyingGlass, faShareNodes, faXmark } from '@fortawesome/free-solid-svg-icons';\nimport { none, some, variant, type ValueTypeOf } from '@elaraai/east';\nimport { Ontology } from '@elaraai/e3-ui/internal';\nimport { implementUIComponent } from '@elaraai/east-ui-components';\n\nimport { OntologyNode, type OntologyFlowNodeData } from './OntologyNode.js';\nimport { OntologyEdge } from './OntologyEdge.js';\nimport { NodePropertiesDrawer } from './NodePropertiesDrawer.js';\nimport { OntologyTable } from './OntologyTable.js';\nimport {\n    ALL_NODE_KINDS,\n    ValidLinks,\n    flattenOntology,\n    type Ontology as OntologyValue,\n    type OntologyLink as OntologyLinkValue,\n    type OntologyNode as OntologyNodeValue,\n    type OntologyNodeKind,\n} from './types.js';\nimport { NODE_KIND_ACCENT } from './accents.js';\nimport { OntologyMark } from './mark.js';\nimport { useFlowState } from './flow-state.js';\nimport { useBindingOntology } from './bind-runtime.js';\nimport { useIsDarkMode } from './use-color-mode.js';\nimport { shownView, shownViews } from '../shared/views.js';\n\n// Monotonic counter for new node ids — synchronous so a pane \"add node\" can\n// seed the node's position before the binding refetch rebuilds the graph.\nlet nodeIdSeq = 0;\nfunction freshNodeId(): string {\n    nodeIdSeq += 1;\n    return `node-${Date.now()}-${nodeIdSeq}`;\n}\n\n/** The display modes, in the switch's order. */\nconst VIEWS = ['graph', 'table'] as const;\n/** Every mode: no `views` given. */\nconst NO_VIEWS: readonly { readonly type: string }[] = [];\n\nconst NODE_TYPES: NodeTypes = { ontology: OntologyNode };\nconst EDGE_TYPES: EdgeTypes = { ontology: OntologyEdge };\n\ntype OntologyValueIR = ValueTypeOf<typeof Ontology.Component.schema>;\n\nfunction getOpt<T>(opt: { type: 'none'; value: null } | { type: 'some'; value: T }): T | undefined {\n    return opt.type === 'some' ? opt.value : undefined;\n}\n\n/** Pick the smallest positive integer suffix not yet used by a link id of\n *  the form `l-<n>`. Falls back to timestamp if existing ids don't fit. */\nfunction nextLinkId(existing: OntologyLinkValue[]): string {\n    let max = 0;\n    for (const l of existing) {\n        const m = /^l-(\\d+)$/.exec(l.id);\n        if (m && m[1]) {\n            const n = Number(m[1]);\n            if (n > max) max = n;\n        }\n    }\n    return `l-${max + 1}`;\n}\n\nexport interface EastChakraOntologyProps {\n    value: OntologyValueIR;\n    storageKey: string;\n}\n\ninterface OntologyMutationHandlers {\n    updateNode(id: string, updates: { type?: OntologyNodeKind; name?: string; description?: string }): void;\n    deleteNodes(ids: Set<string>): void;\n    deleteLinks(ids: Set<string>): void;\n    addLink(source: string, target: string): void;\n    addNode(id: string, kind: OntologyNodeKind): void;\n}\n\ninterface OntologyEditorBodyProps {\n    ontology: OntologyValue;\n    readonly: boolean;\n    hideMiniMap: boolean;\n    hideSearch: boolean;\n    handlers: OntologyMutationHandlers;\n}\n\nfunction OntologyEditorBody({\n    ontology, readonly, hideMiniMap, hideSearch, handlers,\n}: OntologyEditorBodyProps) {\n    const [searchQuery, setSearchQuery] = useState('');\n    // React Flow themes its canvas chrome via `--xy-*` vars keyed on this\n    // prop — Chakra's `.dark` scope doesn't reach them (#362).\n    const isDark = useIsDarkMode();\n    const [focusedNodeId, setFocusedNodeId] = useState<string | null>(null);\n    const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);\n    // Context-menu anchors (screen coords); null = closed.\n    const [paneMenu, setPaneMenu] = useState<{ x: number; y: number } | null>(null);\n    const [nodeMenu, setNodeMenu] = useState<{ x: number; y: number; nodeId: string } | null>(null);\n    const [edgeMenu, setEdgeMenu] = useState<{ x: number; y: number; edgeId: string } | null>(null);\n\n    const flat = useMemo(() => flattenOntology(ontology), [ontology]);\n\n    const mutations = useMemo(() => ({\n        deleteNodes: (ids: Set<string>) => { if (!readonly) handlers.deleteNodes(ids); },\n        deleteLinks: (ids: Set<string>) => { if (!readonly) handlers.deleteLinks(ids); },\n    }), [readonly, handlers]);\n\n    const onConnect = useCallback((conn: Connection) => {\n        if (readonly || !conn.source || !conn.target) return;\n        handlers.addLink(conn.source, conn.target);\n    }, [readonly, handlers]);\n\n    const { nodes: flowNodes, edges: flowEdges, onNodesChange, onEdgesChange, screenToFlowPosition, setNodePosition } =\n        useFlowState({ flatNodes: flat.nodes, flatLinks: flat.links, mutations });\n\n    const closeMenus = useCallback(() => {\n        setPaneMenu(null);\n        setNodeMenu(null);\n        setEdgeMenu(null);\n    }, []);\n\n    const onPaneContextMenu = useCallback((event: MouseEvent | React.MouseEvent) => {\n        if (readonly) return;\n        event.preventDefault();\n        setNodeMenu(null);\n        setEdgeMenu(null);\n        setPaneMenu({ x: event.clientX, y: event.clientY });\n    }, [readonly]);\n\n    const onNodeContextMenu = useCallback((event: React.MouseEvent, node: FlowNode) => {\n        if (readonly) return;\n        event.preventDefault();\n        setPaneMenu(null);\n        setEdgeMenu(null);\n        setNodeMenu({ x: event.clientX, y: event.clientY, nodeId: node.id });\n    }, [readonly]);\n\n    const onEdgeContextMenu = useCallback((event: React.MouseEvent, edge: { id: string }) => {\n        if (readonly) return;\n        event.preventDefault();\n        setPaneMenu(null);\n        setNodeMenu(null);\n        setEdgeMenu({ x: event.clientX, y: event.clientY, edgeId: edge.id });\n    }, [readonly]);\n\n    const onAddNode = useCallback((kind: OntologyNodeKind) => {\n        if (!paneMenu) return;\n        const id = freshNodeId();\n        setNodePosition(id, screenToFlowPosition({ x: paneMenu.x, y: paneMenu.y }));\n        handlers.addNode(id, kind);\n        setPaneMenu(null);\n        setSelectedNodeId(id);\n    }, [paneMenu, screenToFlowPosition, setNodePosition, handlers]);\n\n    // Search match resolution.\n    const searchMatchIds = useMemo<Set<string> | null>(() => {\n        const q = searchQuery.trim().toLowerCase();\n        if (!q) return null;\n        const matched = new Set<string>();\n        for (const n of flowNodes) {\n            const data = n.data as OntologyFlowNodeData;\n            if (\n                data.name.toLowerCase().includes(q) ||\n                data.type.toLowerCase().includes(q) ||\n                (data.description && data.description.toLowerCase().includes(q))\n            ) {\n                matched.add(n.id);\n            }\n        }\n        return matched;\n    }, [flowNodes, searchQuery]);\n\n    // Focus / dim derived nodes + edges (search wins over click focus).\n    const displayNodes = useMemo(() => {\n        const focusSet = searchMatchIds ?? (focusedNodeId ? new Set([focusedNodeId]) : null);\n        if (!focusSet) return flowNodes;\n        const connected = new Set<string>(focusSet);\n        for (const e of flowEdges) {\n            if (focusSet.has(e.source) || focusSet.has(e.target)) {\n                connected.add(e.source);\n                connected.add(e.target);\n            }\n        }\n        return flowNodes.map(n => ({\n            ...n,\n            data: {\n                ...n.data,\n                attention: focusSet.has(n.id)\n                    ? ('focused' as const)\n                    : connected.has(n.id)\n                        ? ('normal' as const)\n                        : ('unfocused' as const),\n            },\n        }));\n    }, [flowNodes, flowEdges, focusedNodeId, searchMatchIds]);\n\n    const displayEdges = useMemo(() => {\n        const focusSet = searchMatchIds ?? (focusedNodeId ? new Set([focusedNodeId]) : null);\n        if (!focusSet) return flowEdges;\n        return flowEdges.map(e => ({\n            ...e,\n            data: {\n                ...e.data!,\n                attention: (focusSet.has(e.source) || focusSet.has(e.target))\n                    ? ('focused' as const)\n                    : ('unfocused' as const),\n            },\n        }));\n    }, [flowEdges, focusedNodeId, searchMatchIds]);\n\n    const onNodeClick = useCallback((_: React.MouseEvent, node: FlowNode) => {\n        setSearchQuery('');\n        setFocusedNodeId(prev => prev === node.id ? null : node.id);\n    }, []);\n\n    const onNodeDoubleClick = useCallback((_: React.MouseEvent, node: FlowNode) => {\n        if (readonly) return;\n        setSelectedNodeId(node.id);\n    }, [readonly]);\n\n    const onPaneClick = useCallback(() => {\n        setFocusedNodeId(null);\n        closeMenus();\n    }, [closeMenus]);\n\n    const proOptions = useMemo(() => ({ hideAttribution: true }), []);\n    const miniMapNodeColor = useCallback((node: FlowNode) => {\n        const data = node.data as OntologyFlowNodeData;\n        // Single source of truth: the same per-kind accents the node cards use.\n        // This was a hand-copied duplicate of NODE_KIND_ACCENT and had already\n        // drifted out of the theme (frozen hex, no dark-mode response).\n        return NODE_KIND_ACCENT[data.type as keyof typeof NODE_KIND_ACCENT] ?? 'fg.muted';\n    }, []);\n\n    const getNode = useCallback(\n        (id: string): OntologyNodeValue | undefined => ontology.nodes.find(n => n.id === id),\n        [ontology],\n    );\n\n    return (\n        <>\n            {!hideSearch && (\n                <Box position=\"absolute\" top=\"2\" left=\"2\" right=\"2\" zIndex={10}>\n                    <HStack gap=\"2\">\n                        <Box position=\"relative\" flex=\"1\">\n                            <Box position=\"absolute\" left=\"2\" top=\"50%\" transform=\"translateY(-50%)\" color=\"fg.subtle\" zIndex={1} pointerEvents=\"none\">\n                                <OntologyMark icon={faMagnifyingGlass} size=\"14\" />\n                            </Box>\n                            <Input\n                                size=\"sm\"\n                                placeholder=\"Search nodes…\"\n                                value={searchQuery}\n                                onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n                                    setSearchQuery(e.target.value);\n                                    setFocusedNodeId(null);\n                                }}\n                                bg=\"bg.surface\"\n                                borderRadius=\"sm\"\n                                border=\"1px solid\"\n                                borderColor={searchMatchIds ? (searchMatchIds.size > 0 ? 'brand.solid' : 'status.neg') : 'border.subtle'}\n                                pl=\"8\"\n                                pr={searchQuery ? '8' : '3'}\n                            />\n                            {searchQuery && (\n                                <Box\n                                    position=\"absolute\" right=\"2\" top=\"50%\" transform=\"translateY(-50%)\"\n                                    cursor=\"pointer\" color=\"fg.subtle\" zIndex={1}\n                                    onClick={() => setSearchQuery('')}\n                                    _hover={{ color: 'fg' }}\n                                >\n                                    <OntologyMark icon={faXmark} size=\"14\" />\n                                </Box>\n                            )}\n                            {searchMatchIds && (\n                                <Box position=\"absolute\" right={searchQuery ? '8' : '2'} top=\"50%\" transform=\"translateY(-50%)\" zIndex={1} pointerEvents=\"none\">\n                                    <Text fontFamily=\"mono\" fontSize=\"label.sm\" color={searchMatchIds.size > 0 ? 'brand.fg' : 'fg.danger'}>\n                                        {searchMatchIds.size}\n                                    </Text>\n                                </Box>\n                            )}\n                        </Box>\n                    </HStack>\n                </Box>\n            )}\n\n            <Box h=\"100%\" w=\"100%\">\n                <ReactFlow\n                    nodes={displayNodes}\n                    edges={displayEdges}\n                    nodeTypes={NODE_TYPES}\n                    edgeTypes={EDGE_TYPES}\n                    onNodesChange={onNodesChange}\n                    onEdgesChange={onEdgesChange}\n                    onConnect={onConnect}\n                    onNodeClick={onNodeClick}\n                    onNodeDoubleClick={onNodeDoubleClick}\n                    onPaneClick={onPaneClick}\n                    onPaneContextMenu={onPaneContextMenu}\n                    onNodeContextMenu={onNodeContextMenu}\n                    onEdgeContextMenu={onEdgeContextMenu}\n                    minZoom={0.1}\n                    maxZoom={2}\n                    proOptions={proOptions}\n                    deleteKeyCode={null}\n                    nodesDraggable={!readonly}\n                    nodesConnectable={!readonly}\n                    elementsSelectable\n                    fitView\n                    colorMode={isDark ? 'dark' : 'light'}\n                >\n                    {/* Dual line-grid per the schematic `.sch-canvas` spec:\n                        minor 24px + major 120px lines in `rule` (gray.200) at\n                        35% / 80% — gives the surface graph-paper texture so\n                        white node cards read clearly against it (esp. over\n                        video). */}\n                    <Background id=\"ont-minor\" variant={BackgroundVariant.Lines} gap={24} lineWidth={1} color=\"color-mix(in srgb, var(--chakra-colors-border-subtle) 35%, transparent)\" />\n                    <Background id=\"ont-major\" variant={BackgroundVariant.Lines} gap={120} lineWidth={1} color=\"color-mix(in srgb, var(--chakra-colors-border-subtle) 80%, transparent)\" />\n                    <Controls />\n                    {!hideMiniMap && <MiniMap nodeColor={miniMapNodeColor} maskColor=\"rgba(17, 27, 34, 0.10)\" />}\n                </ReactFlow>\n            </Box>\n\n            <NodePropertiesDrawer\n                nodeId={selectedNodeId}\n                getNode={getNode}\n                onClose={() => setSelectedNodeId(null)}\n                onUpdate={readonly ? null : handlers.updateNode}\n                onDelete={readonly ? null : (id) => handlers.deleteNodes(new Set([id]))}\n            />\n\n            {/* Pane context menu — add a node of the chosen kind at the cursor. */}\n            {paneMenu && (\n                <Menu.Root\n                    open\n                    onOpenChange={(d) => { if (!d.open) setPaneMenu(null); }}\n                    positioning={{ placement: 'bottom-start', getAnchorRect: () => ({ x: paneMenu.x, y: paneMenu.y, width: 0, height: 0 }) }}\n                >\n                    <Portal>\n                        <Menu.Positioner>\n                            <Menu.Content minW=\"180px\">\n                                <Menu.ItemGroup>\n                                    <Menu.ItemGroupLabel\n                                        fontFamily=\"mono\" fontSize=\"label.sm\" fontWeight=\"bold\"\n                                        letterSpacing=\"widest\" textTransform=\"uppercase\" color=\"fg.subtle\"\n                                    >\n                                        Add node\n                                    </Menu.ItemGroupLabel>\n                                    {ALL_NODE_KINDS.map(kind => (\n                                        <Menu.Item key={kind} value={kind} onClick={() => onAddNode(kind)}>\n                                            <HStack gap=\"2\">\n                                                <Box w=\"8px\" h=\"8px\" borderRadius=\"full\" bg={NODE_KIND_ACCENT[kind]} flexShrink={0} />\n                                                <Text fontSize=\"body.lg\" textTransform=\"capitalize\">{kind}</Text>\n                                            </HStack>\n                                        </Menu.Item>\n                                    ))}\n                                </Menu.ItemGroup>\n                            </Menu.Content>\n                        </Menu.Positioner>\n                    </Portal>\n                </Menu.Root>\n            )}\n\n            {/* Node context menu — edit properties or delete. */}\n            {nodeMenu && (\n                <Menu.Root\n                    open\n                    onOpenChange={(d) => { if (!d.open) setNodeMenu(null); }}\n                    positioning={{ placement: 'bottom-start', getAnchorRect: () => ({ x: nodeMenu.x, y: nodeMenu.y, width: 0, height: 0 }) }}\n                >\n                    <Portal>\n                        <Menu.Positioner>\n                            <Menu.Content minW=\"180px\">\n                                <Menu.Item value=\"edit\" onClick={() => { setSelectedNodeId(nodeMenu.nodeId); setNodeMenu(null); }}>\n                                    Edit properties\n                                </Menu.Item>\n                                <Menu.Separator />\n                                <Menu.Item\n                                    value=\"delete\"\n                                    color=\"fg.danger\"\n                                    onClick={() => { handlers.deleteNodes(new Set([nodeMenu.nodeId])); setNodeMenu(null); }}\n                                >\n                                    Delete node\n                                </Menu.Item>\n                            </Menu.Content>\n                        </Menu.Positioner>\n                    </Portal>\n                </Menu.Root>\n            )}\n\n            {/* Edge context menu — delete link. */}\n            {edgeMenu && (\n                <Menu.Root\n                    open\n                    onOpenChange={(d) => { if (!d.open) setEdgeMenu(null); }}\n                    positioning={{ placement: 'bottom-start', getAnchorRect: () => ({ x: edgeMenu.x, y: edgeMenu.y, width: 0, height: 0 }) }}\n                >\n                    <Portal>\n                        <Menu.Positioner>\n                            <Menu.Content minW=\"160px\">\n                                <Menu.Item\n                                    value=\"delete\"\n                                    color=\"fg.danger\"\n                                    onClick={() => { handlers.deleteLinks(new Set([edgeMenu.edgeId])); setEdgeMenu(null); }}\n                                >\n                                    Delete link\n                                </Menu.Item>\n                            </Menu.Content>\n                        </Menu.Positioner>\n                    </Portal>\n                </Menu.Root>\n            )}\n        </>\n    );\n}\n\nconst EastChakraOntology = memo(function EastChakraOntology({ value }: EastChakraOntologyProps) {\n    const binding = value.binding as ValueTypeOf<typeof Ontology.Component.schema>['binding'];\n    // The editor mutates the binding directly: direct mode writes through;\n    // staged mode buffers until Apply commits it or Discard drops it — the\n    // header's, or the page's own through the handle's commit and discard.\n    const { ontology, pending, mutate, commit, discard } = useBindingOntology(binding);\n    const readonly = getOpt(value.readonly) ?? false;\n    const onCommittedFn = useMemo(() => getOpt(value.onCommitted), [value.onCommitted]);\n    const onDiscardedFn = useMemo(() => getOpt(value.onDiscarded), [value.onDiscarded]);\n    // While an Apply is on its way: both buttons off, so it is sent once.\n    const [applying, setApplying] = useState(false);\n    const apply = useCallback(() => {\n        setApplying(true);\n        void commit().then(\n            () => { setApplying(false); if (onCommittedFn) queueMicrotask(() => onCommittedFn()); },\n            // A refused commit keeps the change pending, the header still saying so.\n            () => { setApplying(false); },\n        );\n    }, [commit, onCommittedFn]);\n    const drop = useCallback(() => {\n        discard();\n        if (onDiscardedFn) queueMicrotask(() => onDiscardedFn());\n    }, [discard, onDiscardedFn]);\n    const hideMiniMap = getOpt(value.hideMiniMap) ?? false;\n    const hideSearch = getOpt(value.hideSearch) ?? false;\n    const defaultView = getOpt(value.defaultView)?.type ?? 'graph';\n    const [picked, setView] = useState<'graph' | 'table'>(defaultView);\n    // The modes this instance offers (`views`): what is picked stands, so a mode comes back should it be offered again.\n    const views = shownViews(VIEWS, getOpt(value.views) ?? NO_VIEWS);\n    const view = shownView(picked, views);\n    // Node selected from the table view — opens the shared properties drawer.\n    const [tableSelectedId, setTableSelectedId] = useState<string | null>(null);\n\n    const handlers = useMemo<OntologyMutationHandlers>(() => {\n        const transform = (fn: (curr: OntologyValue) => OntologyValue) => {\n            if (!ontology) return;\n            mutate(fn(ontology));\n        };\n\n        return {\n            updateNode: (id, updates) => transform(curr => {\n                const ntMap = new Map(curr.nodes.map(n => [n.id, n.type.type]));\n                if (updates.type) ntMap.set(id, updates.type);\n                const nextNodes: OntologyNodeValue[] = curr.nodes.map(n => {\n                    if (n.id !== id) return n;\n                    const desc = updates.description !== undefined\n                        ? (updates.description === '' ? none : some(updates.description))\n                        : n.description;\n                    return {\n                        ...n,\n                        name: updates.name ?? n.name,\n                        description: desc,\n                        type: updates.type ? variant(updates.type, null) : n.type,\n                    };\n                });\n                // If a node's kind changed, drop links whose new endpoint\n                // combination has no valid relation (matches the webview's\n                // `reconcileLinks` semantics).\n                const nextLinks: OntologyLinkValue[] = curr.links.flatMap(link => {\n                    if (link.source !== id && link.target !== id) return [link];\n                    const valid = ValidLinks[ntMap.get(link.source)!]?.[ntMap.get(link.target)!];\n                    if (!valid) return [];\n                    return [link];\n                });\n                return { ...curr, nodes: nextNodes, links: nextLinks };\n            }),\n\n            deleteNodes: (ids) => transform(curr => ({\n                ...curr,\n                nodes: curr.nodes.filter(n => !ids.has(n.id)),\n                links: curr.links.filter(l => !ids.has(l.source) && !ids.has(l.target)),\n            })),\n\n            deleteLinks: (ids) => transform(curr => ({\n                ...curr,\n                links: curr.links.filter(l => !ids.has(l.id)),\n            })),\n\n            addLink: (source, target) => transform(curr => {\n                const srcKind = curr.nodes.find(n => n.id === source)?.type.type;\n                const tgtKind = curr.nodes.find(n => n.id === target)?.type.type;\n                if (!srcKind || !tgtKind) return curr;\n                const linkKind = ValidLinks[srcKind][tgtKind];\n                if (!linkKind) return curr;\n                const newLink: OntologyLinkValue = {\n                    id: nextLinkId(curr.links),\n                    source,\n                    target,\n                    type: variant(linkKind, null),\n                };\n                return { ...curr, links: [...curr.links, newLink] };\n            }),\n\n            addNode: (id, kind) => transform(curr => {\n                const newNode: OntologyNodeValue = {\n                    id,\n                    name: `New ${kind}`,\n                    description: none,\n                    type: variant(kind, null),\n                };\n                return { ...curr, nodes: [...curr.nodes, newNode] };\n            }),\n        };\n    }, [ontology, mutate]);\n\n    if (!ontology) {\n        return (\n            <Box\n                bg=\"bg.surface\" border=\"1px solid\" borderColor=\"border.subtle\" borderRadius=\"lg\"\n                p=\"9\" textAlign=\"center\"\n            >\n                <Text fontFamily=\"mono\" fontSize=\"body.lg\" color=\"fg.subtle\">\n                    Loading ontology…\n                </Text>\n            </Box>\n        );\n    }\n\n    const nodeCount = ontology.nodes.length;\n    const linkCount = ontology.links.length;\n    const getNode = (id: string): OntologyNodeValue | undefined => ontology.nodes.find(n => n.id === id);\n\n    return (\n        <Box\n            bg=\"bg.surface\"\n            border=\"1px solid\"\n            borderColor=\"border.subtle\"\n            borderRadius=\"lg\"\n            overflow=\"hidden\"\n            display=\"flex\"\n            flexDirection=\"column\"\n            h=\"600px\"\n            fontFeatureSettings='\"tnum\"'\n        >\n            {/* xyflow base stylesheet, injected via emotion (deduped by content)\n                so the graph renders wherever the component is mounted. */}\n            <Global styles={xyflowCss} />\n            {/* eyebrow header */}\n            <HStack\n                px=\"4\" py=\"3\"\n                borderBottom=\"1px solid\" borderColor=\"border.subtle\"\n                bg=\"bg.panel\"\n                justify=\"space-between\"\n            >\n                <HStack gap=\"3\">\n                    <Text fontFamily=\"mono\" fontSize=\"label.lg\" fontWeight=\"semibold\" letterSpacing=\"widest\" textTransform=\"uppercase\" color=\"fg\">\n                        Ontology\n                    </Text>\n                    <Text fontFamily=\"mono\" fontSize=\"label.sm\" letterSpacing=\"wider\" color=\"fg.muted\">\n                        {nodeCount} NODES · {linkCount} LINKS\n                    </Text>\n                </HStack>\n                <HStack gap=\"3\">\n                    {pending && (\n                        <Text fontFamily=\"mono\" fontSize=\"label.sm\" letterSpacing=\"wider\" textTransform=\"uppercase\" color=\"fg.warning\">\n                            Unsaved changes\n                        </Text>\n                    )}\n                    {/* A staged change's Discard and Apply; a direct binding is never pending. */}\n                    {pending && !readonly && (\n                        <HStack gap=\"1.5\">\n                            <Button size=\"xs\" variant=\"ghost\" disabled={applying} onClick={drop}>Discard</Button>\n                            <Button size=\"xs\" variant=\"solid\" disabled={applying} onClick={apply}>Apply</Button>\n                        </HStack>\n                    )}\n                    {/* Graph | Table — both are projections of the same bound\n                        value; the staged buffer and commit machinery are\n                        view-agnostic. One offered, no switch. */}\n                    {views.length > 1 && <SegmentGroup.Root\n                        size=\"xs\"\n                        value={view}\n                        onValueChange={(e: { value: string | null }) => {\n                            if (e.value === 'graph' || e.value === 'table') setView(e.value);\n                        }}\n                    >\n                        <SegmentGroup.Indicator />\n                        <SegmentGroup.Item value=\"graph\">\n                            <SegmentGroup.ItemText>\n                                <HStack gap=\"1.5\"><OntologyMark icon={faShareNodes} size=\"11\" /> Graph</HStack>\n                            </SegmentGroup.ItemText>\n                            <SegmentGroup.ItemHiddenInput />\n                        </SegmentGroup.Item>\n                        <SegmentGroup.Item value=\"table\">\n                            <SegmentGroup.ItemText>\n                                <HStack gap=\"1.5\"><OntologyMark icon={faList} size=\"11\" /> Table</HStack>\n                            </SegmentGroup.ItemText>\n                            <SegmentGroup.ItemHiddenInput />\n                        </SegmentGroup.Item>\n                    </SegmentGroup.Root>}\n                </HStack>\n            </HStack>\n\n            {/* body — graph canvas or process table */}\n            <Box flex=\"1\" position=\"relative\" bg=\"bg.panel\" minH=\"0\">\n                {view === 'graph' ? (\n                    <ReactFlowProvider>\n                        <OntologyEditorBody\n                            ontology={ontology}\n                            readonly={readonly}\n                            hideMiniMap={hideMiniMap}\n                            hideSearch={hideSearch}\n                            handlers={handlers}\n                        />\n                    </ReactFlowProvider>\n                ) : (\n                    <>\n                        <OntologyTable ontology={ontology} onSelectNode={setTableSelectedId} />\n                        <NodePropertiesDrawer\n                            nodeId={tableSelectedId}\n                            getNode={getNode}\n                            onClose={() => setTableSelectedId(null)}\n                            onUpdate={readonly ? null : handlers.updateNode}\n                            onDelete={readonly ? null : (id) => { handlers.deleteNodes(new Set([id])); setTableSelectedId(null); }}\n                        />\n                    </>\n                )}\n            </Box>\n        </Box>\n    );\n});\n\nimplementUIComponent(Ontology.Component, EastChakraOntology);\n\nexport { EastChakraOntology };\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Runtime implementation of `Decision.bind` (`decision_bind`) + the React\n * hook that consumes a handle.\n *\n * The platform implementation is the `Data.bind` / `Slice.bind` pattern:\n * given the binding descriptors, it builds the per-source bind handles\n * through the shared {@link defaultBindRuntime} and implements the handle's\n * closures once — union, write-routing by case id, judgement get-or-init and\n * writes, resolve (verdict + removal + selection clear), and the derived\n * commit gate. The case selection lives in workspace UI state under a key\n * derived from the bound source paths — owned entirely by this runtime,\n * visible nowhere.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from 'react';\nimport {\n    East,\n    OptionType,\n    StringType,\n    NullType,\n    ArrayType,\n    fromEastTypeValue,\n    toEastTypeValue,\n    encodeBeast2For,\n    decodeBeast2For,\n    variant,\n    some,\n    none,\n    StructType,\n    EastTypeValueType,\n    canonicalTypeValue,\n    printFor,\n    type ValueTypeOf,\n    type EastTypeValue,\n} from '@elaraai/east';\nimport type { PlatformFunction } from '@elaraai/east/internal';\nimport type { TreePath } from '@elaraai/e3-types';\nimport {\n    decisionBindPlatformFn,\n    DecisionBindPrimitives,\n    DiffBindingType,\n    DecisionType,\n    DecisionHandleType,\n    DecisionHandleRefType,\n    CommitStateType,\n    JudgementInputType,\n    DecisionConstraintType,\n    AnswerType,\n    VerdictType,\n    judgementInputType,\n    type AnswerLiteral,\n} from '@elaraai/e3-ui/internal';\nimport { StateRuntime, registerPlatformImplementation, getRegisteredPlatformImplementations } from '@elaraai/east-ui-components/platform';\nimport {\n    defaultBindRuntime,\n    getBindingTypes,\n    getReactiveDatasetCache,\n    getStagedStore,\n    datasetCacheKey,\n    datasetPathToString,\n    type BindHandle,\n} from '../platform/index.js';\nimport type { Decision } from './types.js';\n\ntype DiffBindingValue = ValueTypeOf<typeof DiffBindingType>;\n\n/** JS-side shape of a decoded {@link DecisionHandleType} value. */\nexport type DecisionHandleValue = ValueTypeOf<typeof DecisionHandleType>;\n/** JS-side shape of a decoded {@link DecisionHandleRefType} payload value —\n *  the binding descriptors an extension payload carries. */\nexport type DecisionHandleRefValue = ValueTypeOf<typeof DecisionHandleRefType>;\n/** JS-side shape of one staged judgement. */\nexport type Judgement = ValueTypeOf<typeof JudgementInputType>;\n/** JS-side shape of the derived commit gate. */\nexport type CommitState = ValueTypeOf<typeof CommitStateType>;\n/** JS-side shape of a verdict value. */\nexport type Verdict = ValueTypeOf<typeof VerdictType>;\n/** JS-side shape of one typed constraint (a contract-variant value — the\n *  default contract's shape stands in for any solution contract here). */\nexport type ConstraintValue = ValueTypeOf<typeof DecisionConstraintType>;\n\ntype SelectionValue = ValueTypeOf<OptionType<StringType>>;\n\nconst SELECTION_TYPE = OptionType(StringType);\nconst encodeSelection = encodeBeast2For(SELECTION_TYPE);\nconst decodeSelection = decodeBeast2For(SELECTION_TYPE);\n\n/** The UI-state key holding a handle's case selection — derived from the\n *  bound source paths so it is stable across reloads without anyone naming\n *  it. Shared by the platform impl (reads/writes) and the React hook\n *  (subscription). */\nexport function deriveSelectionKey(decisions: readonly DiffBindingValue[]): string {\n    return ['decision.selection', ...decisions.map(d => datasetPathToString(d.source as TreePath))].join('|');\n}\n\n// =============================================================================\n// Platform implementation.\n// =============================================================================\n\nfunction viewFor(binding: DiffBindingValue): BindHandle {\n    const workspace = getReactiveDatasetCache().getConfig().workspace ?? '';\n    const source = binding.source as TreePath;\n    const types = getBindingTypes(workspace, source);\n    if (!types) {\n        throw new Error(\n            `Decision.bind: no binding registered for ${datasetPathToString(source)} — bind it with Data.bind on the same surface first`,\n        );\n    }\n    const patch = binding.patch.type === 'some' ? (binding.patch.value as TreePath) : undefined;\n    return defaultBindRuntime.buildBindHandle(types.sourceType, source, patch, binding.mode.type);\n}\n\n/** East's text for a handle's binding descriptors — the plain data its\n *  compiled methods capture — so equal descriptors key one cache entry. */\nconst printDescriptors = printFor(StructType({ decisions: ArrayType(DiffBindingType), judgements: DiffBindingType }));\n\n/** East's text for a type value; a contract's recursive ids are renamed\n *  canonically first, so equal contracts print alike however they were built. */\nconst printTypeValue = printFor(EastTypeValueType);\n\n// =============================================================================\n// Host helpers (issue #106) — shared by the primitive impls and the slice rows\n// getter. Lifted to module scope so each takes the binding descriptor as a\n// parameter rather than closing over it: the IR-bearing handle methods carry\n// ONLY the plain-data descriptors, and these resolve the live views / store from\n// those descriptors at call time.\n// =============================================================================\n\nfunction readSelectionAt(selectionKey: string): SelectionValue {\n    StateRuntime.trackKey(selectionKey);\n    const bytes = StateRuntime.getStore().read(selectionKey);\n    return bytes === undefined ? none : decodeSelection(bytes) as SelectionValue;\n}\nfunction writeSelectionAt(selectionKey: string, value: SelectionValue): null {\n    StateRuntime.getStore().write(selectionKey, encodeSelection(value));\n    return null;\n}\nfunction hostQueue(decisions: DiffBindingValue[]): Decision[] {\n    return decisions.flatMap(b => viewFor(b).read() as Decision[]);\n}\nfunction readJudgementsAt(judgements: DiffBindingValue): Map<string, Judgement> {\n    return viewFor(judgements).read() as Map<string, Judgement>;\n}\nfunction judgementForAt(judgements: DiffBindingValue, caseId: string): Judgement {\n    return readJudgementsAt(judgements).get(caseId) ?? {\n        caseId,\n        answers: new Map(),\n        knowledge: none,\n        constraints: [],\n        verdict: none,\n        resolvedAt: none,\n    };\n}\nfunction stageJudgementAt(judgements: DiffBindingValue, caseId: string, change: Partial<Judgement>): null {\n    const dict = new Map(readJudgementsAt(judgements));\n    dict.set(caseId, { ...judgementForAt(judgements, caseId), ...change });\n    viewFor(judgements).write(dict);\n    return null;\n}\nfunction removeFromOwningView(decisions: DiffBindingValue[], caseId: string): void {\n    for (const binding of decisions) {\n        const view = viewFor(binding);\n        const rows = view.read() as Decision[];\n        if (rows.some(d => d.id === caseId)) {\n            view.write(rows.filter(d => d.id !== caseId));\n        }\n    }\n}\n\n// =============================================================================\n// Compiled handle methods (issue #106) — each method is a thin IR-bearing\n// East.function over a decision_* primitive, capturing only the plain-data\n// descriptors. Cached per (descriptors + contract): the method IR is a pure\n// function of them, and the primitives resolve the live views / store at call\n// time, so a cached set still re-binds.\n// =============================================================================\n\nconst decisionHandleCache = new Map<string, Record<string, unknown>>();\n\nfunction compileDecisionMethods(\n    constraintType: EastTypeValue,\n    decisions: DiffBindingValue[],\n    judgements: DiffBindingValue,\n    selectionKey: string,\n): Record<string, unknown> {\n    const platform = getRegisteredPlatformImplementations();\n    const c = fromEastTypeValue(constraintType);\n    const decisionsExpr = East.value(decisions as never, ArrayType(DiffBindingType));\n    const judgementsExpr = East.value(judgements as never, DiffBindingType);\n    const selKeyExpr = East.value(selectionKey, StringType);\n    const {\n        queue, selected, select, clearSelection, decision, update,\n        judgement, answer, addKnowledge, inject, resolve, commitState,\n    } = DecisionBindPrimitives;\n\n    return {\n        queue:          East.compile(East.function([], ArrayType(DecisionType), ($) => { $.return(queue(decisionsExpr)); }), platform),\n        selected:       East.compile(East.function([], OptionType(StringType), ($) => { $.return(selected(selKeyExpr)); }), platform),\n        select:         East.compile(East.function([StringType], NullType, ($, id) => { $.return(select(selKeyExpr, id)); }), platform),\n        clearSelection: East.compile(East.function([], NullType, ($) => { $.return(clearSelection(selKeyExpr)); }), platform),\n        decision:       East.compile(East.function([], OptionType(DecisionType), ($) => { $.return(decision(decisionsExpr, selKeyExpr)); }), platform),\n        update:         East.compile(East.function([DecisionType], NullType, ($, edited) => { $.return(update(decisionsExpr, edited)); }), platform),\n        judgement:      East.compile(East.function([StringType], judgementInputType(c), ($, id) => { $.return(judgement([c], judgementsExpr, id)); }), platform),\n        answer:         East.compile(East.function([StringType, StringType, AnswerType], NullType, ($, id, prompt, ans) => { $.return(answer(judgementsExpr, id, prompt, ans)); }), platform),\n        addKnowledge:   East.compile(East.function([StringType, StringType], NullType, ($, id, text) => { $.return(addKnowledge(judgementsExpr, id, text)); }), platform),\n        inject:         East.compile(East.function([StringType, c], NullType, ($, id, con) => { $.return(inject([c], judgementsExpr, id, con)); }), platform),\n        resolve:        East.compile(East.function([StringType, VerdictType], NullType, ($, id, verdict) => { $.return(resolve(decisionsExpr, judgementsExpr, selKeyExpr, id, verdict)); }), platform),\n        commitState:    East.compile(East.function([StringType], CommitStateType, ($, id) => { $.return(commitState(decisionsExpr, judgementsExpr, id)); }), platform),\n    };\n}\n\n/** The decoded/runtime shape of a {@link DecisionHandleType} value — the methods\n *  the renderer + React hook call. The compiled East.functions are typed loosely\n *  by inference, so we re-assert the call shapes here. */\ninterface DecisionHandleFns {\n    decisions: DiffBindingValue[];\n    judgements: DiffBindingValue;\n    queue: () => Decision[];\n    selected: () => SelectionValue;\n    select: (caseId: string) => unknown;\n    clearSelection: () => unknown;\n    decision: () => unknown;\n    update: (next: Decision) => unknown;\n    judgement: (caseId: string) => Judgement;\n    answer: (caseId: string, promptId: string, response: unknown) => unknown;\n    addKnowledge: (caseId: string, text: string) => unknown;\n    inject: (caseId: string, constraint: ConstraintValue) => unknown;\n    resolve: (caseId: string, verdict: Verdict) => unknown;\n    commitState: (caseId: string) => CommitState;\n    journal: () => Judgement[];\n}\n\n/**\n * Build a decision handle from its binding descriptors. The descriptor fields\n * (decisions / judgements) are plain data; the 12 methods are IR-bearing\n * East.functions capturing only those descriptors, so the whole handle is\n * serializable East data (issue #106). `journal` is a host-only helper the\n * React hook calls on the locally-built handle (not part of the encodable\n * handle type). `constraintType` is the contract `C` — supplied by the platform\n * resolver for East-side callers; the hook omits it (the methods' runtime\n * behaviour is contract-agnostic, so the default contract's types suffice for a\n * never-encoded local handle).\n */\nfunction buildDecisionHandle(\n    decisions: DiffBindingValue[],\n    judgements: DiffBindingValue,\n    constraintType?: EastTypeValue,\n): DecisionHandleFns {\n    const cType = constraintType ?? toEastTypeValue(DecisionConstraintType);\n    const selectionKey = deriveSelectionKey(decisions);\n\n    const journal = (): Judgement[] => {\n        const entries = [...readJudgementsAt(judgements).values()].filter(j => j.verdict.type === 'some');\n        const at = (j: Judgement) => (j.resolvedAt.type === 'some' ? j.resolvedAt.value.getTime() : 0);\n        return entries.sort((a, b) => at(b) - at(a));\n    };\n\n    // Keyed by the descriptors and the contract `C`, both as East prints them,\n    // so the cache never serves methods compiled for other bindings or another\n    // contract.\n    const cacheKey = `${printDescriptors({ decisions, judgements })}|${printTypeValue(canonicalTypeValue(cType))}`;\n    let methods = decisionHandleCache.get(cacheKey);\n    if (methods === undefined) {\n        methods = compileDecisionMethods(cType, decisions, judgements, selectionKey);\n        decisionHandleCache.set(cacheKey, methods);\n    }\n\n    return {\n        decisions,\n        judgements,\n        journal,\n        ...methods,\n    } as unknown as DecisionHandleFns;\n}\n\n/**\n * `Decision.bind`'s implementation: `decision_bind` and the `decision_*`\n * primitives its handle's methods call. Registered as the package loads, and\n * exported for a host that renders UI functions outside `UITaskPreview`: a UI\n * is decoded with the platforms `UITaskPreview` lists, this among them, or a\n * `Decision.bind` in it throws that `decision_bind` is not available.\n *\n * @example\n * ```ts\n * import { decodeBeast2For } from '@elaraai/east';\n * import { UIComponentType } from '@elaraai/east-ui';\n * import {\n *     StateImpl, SliceImpl, SliceApplyImpl, OverlayImpl, ClipboardImpl, DownloadImpl, ShareImpl,\n * } from '@elaraai/east-ui-components';\n * import { RecordSliceImpl } from '@elaraai/east-ui-components/platform';\n * import {\n *     DecisionBindPlatform, createScopedBindPlatform, createScopedPagedPlatform,\n *     createScopedFuncPlatform, createScopedRecordPlatform,\n * } from '@elaraai/e3-ui-components';\n *\n * // `manifest` is the UI task's (its role's `ui` value), `bytes` its output.\n * const platforms = [\n *     ...StateImpl, ...SliceImpl, ...RecordSliceImpl, ...SliceApplyImpl, ...OverlayImpl,\n *     ...ClipboardImpl, ...DownloadImpl, ...ShareImpl, ...DecisionBindPlatform,\n *     ...createScopedBindPlatform(manifest),\n *     ...createScopedPagedPlatform(manifest.pages),\n *     ...createScopedFuncPlatform(manifest.functions),\n *     ...createScopedRecordPlatform(manifest.records),\n * ];\n * const ui = decodeBeast2For(UIComponentType, { platform: platforms })(bytes);\n * ```\n */\nexport const DecisionBindPlatform: PlatformFunction[] = [\n    // Generic over the constraint contract — the resolver receives the contract\n    // type value and threads it into the IR-bearing judgement / inject methods.\n    decisionBindPlatformFn.implement((constraintType: EastTypeValue) =>\n        (decisionsArg: unknown, judgementsArg: unknown) =>\n            buildDecisionHandle(\n                decisionsArg as DiffBindingValue[],\n                judgementsArg as DiffBindingValue,\n                constraintType,\n            )),\n\n    // ── issue #106 primitives — host I/O backing the IR-bearing handle methods.\n    // Each is a faithful lift of the original closure body, taking the plain-data\n    // descriptor(s) + the selection key as arguments. ──\n    DecisionBindPrimitives.queue.implement((decisions: unknown) =>\n        hostQueue(decisions as DiffBindingValue[]) as never),\n    DecisionBindPrimitives.selected.implement((selectionKey: unknown) =>\n        readSelectionAt(selectionKey as string)),\n    DecisionBindPrimitives.select.implement((selectionKey: unknown, caseId: unknown) =>\n        writeSelectionAt(selectionKey as string, some(caseId as string))),\n    DecisionBindPrimitives.clearSelection.implement((selectionKey: unknown) =>\n        writeSelectionAt(selectionKey as string, none)),\n    DecisionBindPrimitives.decision.implement((decisions: unknown, selectionKey: unknown) => {\n        const sel = readSelectionAt(selectionKey as string);\n        if (sel.type === 'none') return none as never;\n        const found = hostQueue(decisions as DiffBindingValue[]).find(d => d.id === sel.value);\n        return (found === undefined ? none : some(found)) as never;\n    }),\n    DecisionBindPrimitives.update.implement((decisions: unknown, edited: unknown) => {\n        const e = edited as Decision;\n        for (const binding of decisions as DiffBindingValue[]) {\n            const view = viewFor(binding);\n            const rows = view.read() as Decision[];\n            if (rows.some(d => d.id === e.id)) {\n                view.write(rows.map(d => (d.id === e.id ? e : d)));\n            }\n        }\n        return null;\n    }),\n    DecisionBindPrimitives.judgement.implement((_c: EastTypeValue) =>\n        (judgements: unknown, caseId: unknown) =>\n            judgementForAt(judgements as DiffBindingValue, caseId as string) as never),\n    DecisionBindPrimitives.answer.implement((judgements: unknown, caseId: unknown, prompt: unknown, response: unknown) => {\n        const answers = new Map(judgementForAt(judgements as DiffBindingValue, caseId as string).answers);\n        answers.set(prompt as string, response as Judgement['answers'] extends Map<string, infer A> ? A : never);\n        return stageJudgementAt(judgements as DiffBindingValue, caseId as string, { answers });\n    }),\n    DecisionBindPrimitives.addKnowledge.implement((judgements: unknown, caseId: unknown, text: unknown) =>\n        stageJudgementAt(judgements as DiffBindingValue, caseId as string, { knowledge: some(text as string) })),\n    DecisionBindPrimitives.inject.implement((_c: EastTypeValue) =>\n        (judgements: unknown, caseId: unknown, constraint: unknown) => {\n            // Upsert by contract case name — one constraint per lever.\n            const con = constraint as ConstraintValue;\n            const constraints = judgementForAt(judgements as DiffBindingValue, caseId as string).constraints\n                .filter(x => x.type !== con.type)\n                .concat([con]);\n            return stageJudgementAt(judgements as DiffBindingValue, caseId as string, { constraints });\n        }),\n    DecisionBindPrimitives.resolve.implement((decisions: unknown, judgements: unknown, selectionKey: unknown, caseId: unknown, verdict: unknown) => {\n        stageJudgementAt(judgements as DiffBindingValue, caseId as string, { verdict: some(verdict as Verdict), resolvedAt: some(new Date()) });\n        removeFromOwningView(decisions as DiffBindingValue[], caseId as string);\n        writeSelectionAt(selectionKey as string, none);\n        return null;\n    }),\n    DecisionBindPrimitives.commitState.implement((decisions: unknown, judgements: unknown, caseId: unknown) => {\n        const cid = caseId as string;\n        const decision = hostQueue(decisions as DiffBindingValue[]).find(d => d.id === cid);\n        const prompts = decision?.prompts ?? [];\n        const answers = judgementForAt(judgements as DiffBindingValue, cid).answers;\n        const responses = prompts.map(p => answers.get(p.id)?.type);\n        if (responses.some(r => r === 'no')) return variant('blocked', null) as never;\n        if (responses.some(r => r === 'unknown')) return variant('handoff', null) as never;\n        const unanswered = responses.filter(r => r === undefined).length;\n        if (unanswered > 0) return variant('gated', BigInt(unanswered)) as never;\n        return variant('ready', null) as never;\n    }),\n];\n\nregisterPlatformImplementation(DecisionBindPlatform);\n\n// =============================================================================\n// React hook.\n// =============================================================================\n\nexport interface UseDecisionHandleResult {\n    /** The visible queue (union of every bound view). `null` until the\n     *  bindings' types are registered and readable. */\n    decisions: Decision[] | null;\n    /** The selected case id, or `null` when no case is open. */\n    selected: string | null;\n    /** Resolved cases (judgements carrying a verdict), newest first; `null`\n     *  while the bindings aren't readable. */\n    journal: Judgement[] | null;\n    /** The staged judgement for a case (a fresh empty one when nothing is\n     *  staged yet); `null` while the bindings aren't readable. */\n    judgementFor: (caseId: string) => Judgement | null;\n    /** The derived commit gate for a case; `null` while unreadable. */\n    commitStateFor: (caseId: string) => CommitState | null;\n    select: (caseId: string) => void;\n    clearSelection: () => void;\n    /** Probe edit — routed to the owning view's patch overlay by `id`. */\n    update: (next: Decision) => void;\n    /** Record the response to one judgement prompt (by prompt id). */\n    answer: (caseId: string, promptId: string, response: AnswerLiteral) => void;\n    addKnowledge: (caseId: string, text: string) => void;\n    /** Stage a typed constraint (a contract-variant value; upserts by case name). */\n    inject: (caseId: string, constraint: ConstraintValue) => void;\n    /** Commit a verdict: judgement write + removal through the owning patch\n     *  + selection clear. */\n    resolve: (caseId: string, verdict: Verdict) => void;\n}\n\n/** Subscribe to every store the handle projects from: each binding's source\n *  and patch (staged store + dataset cache) plus the selection state key. */\nfunction useHandleVersion(handle: DecisionHandleRefValue | null): number {\n    const staged = getStagedStore();\n    const cache = getReactiveDatasetCache();\n    const state = StateRuntime.getStore();\n    const workspace = cache.getConfig().workspace ?? '';\n\n    const keys = useMemo(() => {\n        if (!handle) return [] as string[];\n        const bindings = [...handle.decisions, handle.judgements];\n        const ks: string[] = [];\n        for (const b of bindings) {\n            ks.push(datasetCacheKey(workspace, b.source as TreePath));\n            if (b.patch.type === 'some') ks.push(datasetCacheKey(workspace, b.patch.value as TreePath));\n        }\n        return ks;\n    }, [workspace, handle]);\n\n    const selectionKey = handle ? deriveSelectionKey(handle.decisions) : undefined;\n\n    const subscribe = useCallback((cb: () => void) => {\n        const unsubs = keys.flatMap(k => [staged.subscribe(k, cb), cache.subscribe(k, cb)]);\n        if (selectionKey !== undefined) unsubs.push(state.subscribe(selectionKey, cb));\n        return () => { for (const u of unsubs) u(); };\n    }, [staged, cache, state, keys, selectionKey]);\n\n    const getSnapshot = useCallback(\n        () => keys.reduce((sum, k) => sum + staged.getKeyVersion(k) + cache.getKeyVersion(k), 0)\n            + (selectionKey !== undefined ? state.getKeyVersion(selectionKey) : 0),\n        [staged, cache, state, keys, selectionKey],\n    );\n\n    return useSyncExternalStore(subscribe, getSnapshot);\n}\n\n/**\n * Resolve a {@link DecisionHandleRefType} payload value into live reads +\n * stable writers. The hook reconstructs the handle from its descriptors\n * (the same construction the platform impl performs) and adds store\n * subscriptions so the surface re-renders when any bound value or the\n * selection changes.\n */\nexport function useDecisionHandle(ref: DecisionHandleRefValue | null): UseDecisionHandleResult {\n    const version = useHandleVersion(ref);\n\n    // The ref is the handle's encodable identity; the live handle is\n    // (re)constructed locally — the same construction the `decision_bind`\n    // platform impl performs for East-side callers.\n    const fns = useMemo(\n        () => (ref ? buildDecisionHandle([...ref.decisions], ref.judgements) : null),\n        [ref],\n    );\n\n    const { decisions, selected, journal } = useMemo(() => {\n        try {\n            if (!fns) return { decisions: null, selected: null, journal: null };\n            const sel = fns.selected();\n            return {\n                decisions: fns.queue(),\n                selected: sel.type === 'some' ? (sel.value as string) : null,\n                journal: fns.journal(),\n            };\n        } catch {\n            // Binding types not registered yet (first render before the\n            // surface's Data.bind calls run) — render the loading state.\n            return { decisions: null, selected: null, journal: null };\n        }\n        // `version` drives recompute when any underlying store changes.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [fns, version]);\n\n    const judgementFor = useCallback((caseId: string): Judgement | null => {\n        try { return fns ? fns.judgement(caseId) : null; } catch { return null; }\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [fns, version]);\n\n    const commitStateFor = useCallback((caseId: string): CommitState | null => {\n        try { return fns ? fns.commitState(caseId) : null; } catch { return null; }\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [fns, version]);\n\n    const select = useCallback((caseId: string) => { fns?.select(caseId); }, [fns]);\n    const clearSelection = useCallback(() => { fns?.clearSelection(); }, [fns]);\n    const update = useCallback((next: Decision) => { fns?.update(next); }, [fns]);\n    const answer = useCallback((caseId: string, promptId: string, response: AnswerLiteral) => {\n        fns?.answer(caseId, promptId, variant(response, null));\n    }, [fns]);\n    const addKnowledge = useCallback((caseId: string, text: string) => {\n        fns?.addKnowledge(caseId, text);\n    }, [fns]);\n    const inject = useCallback((caseId: string, constraint: ConstraintValue) => {\n        fns?.inject(caseId, constraint);\n    }, [fns]);\n    const resolve = useCallback((caseId: string, verdict: Verdict) => {\n        fns?.resolve(caseId, verdict);\n    }, [fns]);\n\n    return {\n        decisions,\n        selected,\n        journal,\n        judgementFor,\n        commitStateFor,\n        select,\n        clearSelection,\n        update,\n        answer,\n        addKnowledge,\n        inject,\n        resolve,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Formatting for injected constraints — one place that turns a\n * contract-variant value into the words a chip renders, shared by the\n * judgement facet and the journal.\n *\n * A constraint is `variant(leverCase, payload)`, a value of the solution's\n * contract `C`, and the contract case's East type says how its payload\n * prints: an op variant (`atMost 36`), a struct\n * (`person Patel · from Mar 12 · to Mar 15`), or a bare value. Nothing is\n * read off a value's JavaScript shape. The lever's display label comes from\n * the decision's `levers` when available, falling back to the contract case\n * name.\n */\n\nimport {\n    printFor,\n    type DateTimeType,\n    type EastTypeValue,\n    type FloatType,\n    type StringType,\n    type ValueTypeOf,\n    type variant,\n} from '@elaraai/east';\nimport type { LeverType } from '@elaraai/e3-ui/internal';\nimport { formatters, type Formatters } from '@elaraai/east-ui-components';\n\nimport type { ConstraintContract } from './contract.js';\n\ntype LeverValue = ValueTypeOf<typeof LeverType>;\n\n/** A struct's fields or a variant's cases, as East types. */\ntype Members = ReadonlyArray<{ name: string; type: EastTypeValue }>;\n\n/** Words for the well-known bounded-op case names. */\nexport const OP_WORDS: Record<string, string> = {\n    eq: '=',\n    neq: '≠',\n    atMost: 'at most',\n    atLeast: 'at least',\n    between: 'between',\n    before: 'before',\n    after: 'after',\n    in: 'in',\n    notIn: 'not in',\n    is: 'is',\n};\n\n/** East's printer for a type within a contract. */\ntype Printer = (type: EastTypeValue) => (value: unknown) => string;\n\nconst PRINTERS = new WeakMap<ConstraintContract, Printer>();\n\n/** East's printers within a contract's own type context, so a payload type\n *  that refers back to a recursive contract prints. One per contract. */\nfunction printerOf(contract: ConstraintContract): Printer {\n    let printer = PRINTERS.get(contract);\n    if (printer === undefined) {\n        const context = new Map();\n        printFor(contract.type, context);\n        printer = (type) => printFor(type, context);\n        PRINTERS.set(contract, printer);\n    }\n    return printer;\n}\n\n/** A payload value as chip text, through its East type, in the app's locale\n *  (#850): a date as its UTC month and day, a Float as East prints it in the\n *  locale's decimal separator, a String as itself, a Set's members and a\n *  struct's fields each through their own type, and anything else as East\n *  prints it. */\nfunction formatValue(value: unknown, type: EastTypeValue, words: Formatters, print: Printer): string {\n    switch (type.type) {\n        case 'DateTime':\n            return words.monthDay(value as ValueTypeOf<DateTimeType>);\n        case 'Float':\n            return words.float(value as ValueTypeOf<FloatType>);\n        case 'String':\n            return value as ValueTypeOf<StringType>;\n        case 'Set': {\n            const member = type.value as EastTypeValue;\n            return `{${[...(value as ReadonlySet<unknown>)].map(m => formatValue(m, member, words, print)).join(', ')}}`;\n        }\n        case 'Struct':\n            return (type.value as Members)\n                .map(f => `${f.name} ${formatValue((value as Record<string, unknown>)[f.name], f.type, words, print)}`)\n                .join(' · ');\n        default:\n            return print(type)(value);\n    }\n}\n\n/**\n * The lever's display words plus the formatted payload. Dispatch is\n * type-directed: the contract — walked off the judgements binding, as the\n * lever editor's — gives the payload's East type, and the value's shape is\n * never guessed. Without the contract (its binding not yet registered) the\n * chip names the lever alone.\n *\n * @param constraint - The injected constraint, a value of the contract `C`\n * @param contract - The solution's constraint contract\n * @param levers - The decision's levers, for the display label\n * @param words - The formatters dates and numbers print through (#850); the\n *   runtime locale's when omitted\n * @returns The chip's lever, op and value words\n */\nexport function formatConstraint(\n    constraint: variant<string, unknown>,\n    contract: ConstraintContract | undefined,\n    levers?: readonly LeverValue[],\n    words: Formatters = formatters(),\n): { lever: string; op: string; value: string } {\n    const lever = levers?.find(l => l.case === constraint.type)?.label ?? constraint.type;\n    const payload = contract?.payloads.get(constraint.type);\n    if (contract === undefined || payload === undefined) return { lever, op: '·', value: '' };\n    const print = printerOf(contract);\n    if (payload.type === 'Variant') {\n        // An op-variant payload: \"<lever> <op word> <value>\".\n        const op = constraint.value as variant<string, unknown>;\n        const word = OP_WORDS[op.type] ?? op.type;\n        const opType = (payload.value as Members).find(c => c.name === op.type)!.type;\n        if (opType.type === 'Struct') {\n            const fields = opType.value as Members;\n            const min = fields.find(f => f.name === 'min');\n            const max = fields.find(f => f.name === 'max');\n            if (min !== undefined && max !== undefined) {\n                const range = op.value as Record<'min' | 'max', unknown>;\n                return { lever, op: word, value: `${formatValue(range.min, min.type, words, print)} – ${formatValue(range.max, max.type, words, print)}` };\n            }\n        }\n        return { lever, op: word, value: formatValue(op.value, opType, words, print) };\n    }\n    // A struct or bare payload: \"<lever> · <payload>\".\n    return { lever, op: '·', value: formatValue(constraint.value, payload, words, print) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Internal — the judgement facet's typed constraint editor for one lever.\n *\n * The lever names a case of the solution's constraint contract (a by-name\n * `VariantType`); this editor derives its controls from that case's payload\n * East type, read off the judgements binding's registered type\n * ({@link constraintContractOf}):\n *\n * - variant of ops over primitives (`atMost` / `between {min,max}` / …) —\n *   an op select plus typed input(s);\n * - struct of primitives (a blackout `{person, from, to}`) — one typed\n *   input per field;\n * - bare primitive — a single typed input.\n *\n * Submission builds the contract-variant value and hands it to the handle's\n * `inject` (which upserts by case name).\n */\n\nimport { useMemo, useRef, useState, type ReactNode } from 'react';\nimport { Box, chakra, useRecipe } from '@chakra-ui/react';\nimport { NullType, defaultValue, none, some, toEastTypeValue, variant, type EastTypeValue } from '@elaraai/east';\nimport {\n    EastChakraSelect,\n    EastChakraStringInput,\n    EastChakraIntegerInput,\n    EastChakraFloatInput,\n    EastChakraDateTimeInput,\n} from '@elaraai/east-ui-components';\n\nimport type { ConstraintValue } from './handle-runtime.js';\nimport { OP_WORDS } from './constraint-format.js';\n\n/** A struct's fields or a variant's cases, as East types. */\ntype Members = ReadonlyArray<{ name: string; type: EastTypeValue }>;\n\nconst PRIMITIVES = new Set(['String', 'Integer', 'Float', 'DateTime', 'Boolean']);\n\n/** What an op the payload does not have edits — nothing. */\nconst NULL_TYPE = toEastTypeValue(NullType);\n\n/** The value an input of `type` starts from: East's default for it\n *  ({@link defaultValue}), except a DateTime, which opens on now rather than\n *  East's epoch — per field, for a struct. */\nfunction emptyFor(type: EastTypeValue): unknown {\n    if (type.type === 'DateTime') return new Date();\n    if (type.type === 'Struct') return Object.fromEntries((type.value as Members).map(f => [f.name, emptyFor(f.type)]));\n    return defaultValue(type);\n}\n\n/**\n * Whether the editor can edit a lever's payload: a bare primitive, a struct\n * of primitives, or an op variant whose case payloads are primitives or\n * structs of primitives.\n *\n * @param payload - The contract case's payload type; `undefined` when the\n *   contract is not known yet\n * @returns Whether the lever gets an editor\n */\nexport function leverPayloadEditable(payload: EastTypeValue | undefined): boolean {\n    if (payload === undefined) return false;\n    const primitive = (t: EastTypeValue) => PRIMITIVES.has(t.type);\n    const structOfPrimitives = (t: EastTypeValue) => t.type === 'Struct' && (t.value as Members).every(f => primitive(f.type));\n    if (primitive(payload) || structOfPrimitives(payload)) return true;\n    if (payload.type === 'Variant') return (payload.value as Members).every(c => primitive(c.type) || structOfPrimitives(c.type));\n    return false;\n}\n\nexport interface LeverEditorProps {\n    /** The contract case name this lever injects. */\n    leverCase: string;\n    /** The case's payload type, from the solution's contract. */\n    payload: EastTypeValue;\n    onInject: (constraint: ConstraintValue) => void;\n}\n\nconst inputStyle = some({ size: some(variant('sm', null)) });\n\nexport function LeverEditor({ leverCase, payload, onInject }: LeverEditorProps) {\n    const button = useRecipe({ key: 'button' });\n\n    const isOpVariant = payload.type === 'Variant';\n    const ops = useMemo(() => (payload.type === 'Variant' ? (payload.value as Members).map(c => c.name) : []), [payload]);\n    const [opTag, setOpTag] = useState(ops[0] ?? '');\n    const active: EastTypeValue = payload.type === 'Variant'\n        ? ((payload.value as Members).find(c => c.name === opTag)?.type ?? NULL_TYPE)\n        : payload;\n\n    // Typed controls own their in-progress state; commits land in a ref so\n    // typing never re-renders this component (the Ark NumberInput resets if\n    // its payload identity changes mid-edit).\n    const valRef = useRef<unknown>(emptyFor(active));\n    const keyRef = useRef(`${leverCase}:${opTag}`);\n    if (keyRef.current !== `${leverCase}:${opTag}`) {\n        keyRef.current = `${leverCase}:${opTag}`;\n        valRef.current = emptyFor(active);\n    }\n\n    const primitiveInput = (type: EastTypeValue, key: string, get: () => unknown, set: (v: unknown) => void): ReactNode => {\n        switch (type.type) {\n            case 'Integer':\n                return <EastChakraIntegerInput key={key} value={{ value: get() as bigint, onChange: some(set), style: inputStyle } as never} />;\n            case 'Float':\n                return <EastChakraFloatInput key={key} value={{ value: get() as number, onChange: some(set), style: inputStyle } as never} />;\n            case 'DateTime':\n                return <EastChakraDateTimeInput key={key} value={{ value: get() as Date, onChange: some(set), style: inputStyle } as never} />;\n            case 'Boolean':\n                return (\n                    <EastChakraSelect\n                        key={key}\n                        ariaLabel={key}\n                        value={{\n                            value: some(get() === true ? 'true' : 'false'),\n                            items: [{ value: 'true', label: 'true', disabled: none }, { value: 'false', label: 'false', disabled: none }],\n                            placeholder: none, multiple: none, disabled: none,\n                            onChange: some((v: string) => set(v === 'true')), onChangeMultiple: none, onOpenChange: none,\n                            style: inputStyle,\n                        } as never}\n                    />\n                );\n            case 'String':\n                return <EastChakraStringInput key={key} value={{ value: get() as string, onChange: some(set), style: inputStyle } as never} />;\n            default:\n                // A type the editor does not edit (an op whose case carries\n                // no value) has no input.\n                return null;\n        }\n    };\n\n    const valueControls = useMemo<ReactNode>(() => {\n        const k = keyRef.current;\n        if (active.type === 'Struct') {\n            return (active.value as Members).map(({ name: field, type }) => (\n                <Box key={`${k}.${field}`} display=\"flex\" alignItems=\"center\" gap=\"6px\" minW={0}>\n                    <Box as=\"span\" textStyle=\"caption.eyebrow\" color=\"fg.subtle\" flexShrink={0}>{field}</Box>\n                    {primitiveInput(type, `${k}.${field}.in`,\n                        () => (valRef.current as Record<string, unknown>)[field],\n                        v => { (valRef.current as Record<string, unknown>)[field] = v; })}\n                </Box>\n            ));\n        }\n        return (\n            <Box key={`${k}.wrap`} width=\"min(180px, 100%)\" flexShrink={0}>\n                {primitiveInput(active, `${k}.value`, () => valRef.current, v => { valRef.current = v; })}\n            </Box>\n        );\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [active, opTag, leverCase]);\n\n    const submit = () => {\n        const value = valRef.current;\n        const payloadValue = active.type === 'Struct' ? { ...(value as object) } : value;\n        const constraint = (isOpVariant\n            ? variant(leverCase, variant(opTag, payloadValue))\n            : variant(leverCase, payloadValue)) as unknown as ConstraintValue;\n        onInject(constraint);\n        valRef.current = emptyFor(active);\n    };\n\n    return (\n        <Box\n            display=\"flex\"\n            alignItems=\"center\"\n            gap=\"8px\"\n            flexWrap=\"wrap\"\n            minW={0}\n            css={{\n                '& [data-scope=select][data-part=root]': { width: 'auto', minWidth: '110px', flexShrink: 0 },\n                '& [data-scope=number-input][data-part=root]': { width: '150px', flexShrink: 0 },\n            }}\n        >\n            {isOpVariant && (\n                <EastChakraSelect\n                    ariaLabel=\"Operator\"\n                    value={{\n                        value: some(opTag),\n                        items: ops.map(o => ({ value: o, label: OP_WORDS[o] ?? o, disabled: none })),\n                        placeholder: none, multiple: none, disabled: none,\n                        onChange: some((v: string) => setOpTag(v)), onChangeMultiple: none, onOpenChange: none,\n                        style: inputStyle,\n                    } as never}\n                />\n            )}\n            {valueControls}\n            <chakra.button type=\"button\" css={button({ variant: 'solid', size: 'xs' })} onClick={submit}>\n                Add\n            </chakra.button>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Internal — the decision-queue row's facet panels. One facet open at a\n * time beneath the selected row, swapped by the row's segmented toggles:\n *\n * - `Evidence` — the model's argument: stakes / if-wrong / confidence line,\n *   typed evidence chips, and the host's per-decision `detail` canvas.\n * - `Options` — the ranked stack (recommendation + alternatives) with\n *   zero-anchored downside / uplift bars.\n * - `Judgement` — the operator's staged response: prompts, knowledge, and\n *   the lever builder (typed editors from the solution's constraint\n *   contract), with the gate hint + Defer as the footer.\n *\n * (The `Modify` facet is the host's probe editor, rendered by the queue\n * directly through the `modify` slot.)\n */\n\nimport { memo, useCallback, useEffect, useMemo, useState } from 'react';\nimport { Box, Text, chakra, useRecipe } from '@chakra-ui/react';\nimport { FloatType, compareFor, none, some, variant } from '@elaraai/east';\nimport { EastChakraSelect, getSomeorUndefined, useFormatters, type Formatters } from '@elaraai/east-ui-components';\n\nimport type { UseDecisionHandleResult, Judgement, ConstraintValue } from './handle-runtime.js';\nimport { LeverEditor, leverPayloadEditable } from './lever-editor.js';\nimport type { ConstraintContract } from './contract.js';\nimport { formatConstraint } from './constraint-format.js';\nimport type { Decision } from './types.js';\n\n/** A decision value through its declared format, in the app's locale (#850). */\nfunction fmt(words: Formatters, d: Decision, n: number, showSign = false): string {\n    return words.value(n, getSomeorUndefined(d.format), showSign);\n}\n\nconst caption = { textStyle: 'caption.eyebrow', color: 'fg.muted' } as const;\n\n// =============================================================================\n// Evidence — the model's argument + the host's detail canvas (rendered by\n// the queue as children, since it owns the component dispatcher).\n// =============================================================================\n\nexport interface EvidenceFacetProps {\n    decision: Decision;\n    /** The host's `detail` canvas, already rendered by the queue. */\n    children?: React.ReactNode;\n}\n\nexport const EvidenceFacet = memo(function EvidenceFacet({ decision, children }: EvidenceFacetProps) {\n    const words = useFormatters();\n    const stakes = getSomeorUndefined(decision.stakes);\n    const downside = getSomeorUndefined(decision.downside);\n    const confidence = getSomeorUndefined(decision.confidence);\n    const detail = getSomeorUndefined(decision.detail);\n    return (\n        <Box display=\"flex\" flexDirection=\"column\" gap=\"10px\">\n            <Box display=\"flex\" alignItems=\"baseline\" gap=\"12px\" flexWrap=\"wrap\">\n                <Text {...caption} color=\"fg\">Why this is recommended</Text>\n                <Text {...caption}>\n                    {stakes !== undefined && <>stakes <Text as=\"span\" fontFamily=\"mono\" fontWeight=\"semibold\">{stakes.type}</Text> · </>}\n                    {downside !== undefined && <>if wrong <Text as=\"span\" fontFamily=\"mono\" fontWeight=\"semibold\" color=\"fg.danger\">{fmt(words, decision, downside, true)}</Text> · </>}\n                    {confidence !== undefined && <>confidence <Text as=\"span\" fontFamily=\"mono\" fontWeight=\"semibold\">{words.percent(confidence)}</Text></>}\n                </Text>\n            </Box>\n            {detail !== undefined && <Text fontSize=\"12.5px\" color=\"fg.muted\">{detail}</Text>}\n            {decision.evidence.length > 0 && (\n                <Box display=\"grid\" gridTemplateColumns=\"repeat(auto-fit, minmax(180px, 1fr))\" gap=\"8px\">\n                    {decision.evidence.map((e, i) => {\n                        const note = getSomeorUndefined(e.note);\n                        return (\n                            <Box key={i} borderWidth=\"1px\" borderColor=\"border.subtle\" borderRadius=\"4px\" px=\"10px\" py=\"8px\" bg=\"bg.canvas\">\n                                <Text {...caption}>{e.label}</Text>\n                                <Text fontSize=\"13px\" fontWeight=\"medium\">{e.text}</Text>\n                                {note !== undefined && <Text fontSize=\"11px\" fontFamily=\"mono\" color=\"fg.subtle\">{note}</Text>}\n                            </Box>\n                        );\n                    })}\n                </Box>\n            )}\n            {children}\n        </Box>\n    );\n});\n\n// =============================================================================\n// Options — the ranked stack with zero-anchored bars.\n// =============================================================================\n\nexport interface RankedOption {\n    rank: number;\n    label: string;\n    value: number;\n    downside: number | undefined;\n    confidence: number | undefined;\n    note: string | undefined;\n    recommended: boolean;\n}\n\nconst compareValues = compareFor(FloatType);\n\n/**\n * The Options facet's stack: the recommendation first, then its alternatives,\n * the greater value first — values compared as East compares them.\n *\n * @param d - The decision\n * @returns The ranked options\n */\nexport function rankOptions(d: Decision): RankedOption[] {\n    const alternatives = [...d.alternatives]\n        .sort((a, b) => compareValues(b.value, a.value))\n        .map(a => ({\n            label: a.label,\n            value: a.value,\n            downside: getSomeorUndefined(a.downside),\n            confidence: getSomeorUndefined(a.confidence),\n            note: getSomeorUndefined(a.note),\n            recommended: false,\n        }));\n    return [\n        {\n            label: d.title,\n            value: d.value,\n            downside: getSomeorUndefined(d.downside),\n            confidence: getSomeorUndefined(d.confidence),\n            note: getSomeorUndefined(d.summary),\n            recommended: true,\n        },\n        ...alternatives,\n    ].map((o, i) => ({ ...o, rank: i + 1 }));\n}\n\nfunction metaLine(o: RankedOption, words: Formatters): string {\n    const parts: string[] = [];\n    if (o.recommended) parts.push('recommended');\n    if (o.confidence !== undefined) parts.push(`${words.percent(o.confidence)} conf`);\n    if (!o.recommended && o.note !== undefined) parts.push(o.note);\n    return parts.join(' · ');\n}\n\nexport interface OptionsFacetProps {\n    decision: Decision;\n    /** Narrow hosts render the stacked meter-card layout. */\n    narrow?: boolean;\n}\n\nexport const OptionsFacet = memo(function OptionsFacet({ decision, narrow }: OptionsFacetProps) {\n    const words = useFormatters();\n    const options = rankOptions(decision);\n    const maxUp = Math.max(...options.map(o => Math.max(o.value, 0)), 1e-9);\n    const maxDown = Math.max(...options.map(o => Math.abs(o.downside ?? 0)), 1e-9);\n    // Value-axis descriptor: relabel the \"Uplift\" column and, when `signed`\n    // is false, drop the force-sign + green so a non-benefit (likelihood /\n    // horizon / magnitude) reads as a plain value (#135).\n    const valueAxis = getSomeorUndefined(decision.valueAxis);\n    const upLabel = valueAxis?.label ?? 'Uplift';\n    const signed = valueAxis?.signed ?? true;\n\n    if (narrow) {\n        const meter = (label: string, frac: number, display: string, tone: 'success' | 'danger' | 'neutral') => (\n            <Box display=\"grid\" gridTemplateColumns=\"80px 1fr 64px\" alignItems=\"center\" gap=\"8px\">\n                <Text {...caption} whiteSpace=\"nowrap\">{label}</Text>\n                <Box height=\"6px\" bg=\"border.subtle\" borderRadius=\"3px\" overflow=\"hidden\">\n                    <Box height=\"100%\" style={{ width: `${Math.round(Math.min(Math.abs(frac), 1) * 100)}%` }} bg={tone === 'success' ? 'status.pos' : tone === 'danger' ? 'status.neg' : 'fg.subtle'} opacity={0.7} />\n                </Box>\n                <Text fontSize=\"11px\" fontFamily=\"mono\" fontWeight=\"semibold\" textAlign=\"right\">{display}</Text>\n            </Box>\n        );\n        return (\n            <Box display=\"flex\" flexDirection=\"column\" gap=\"10px\">\n                <Text {...caption} color=\"fg\">Options · {words.number(options.length)} evaluated</Text>\n                {options.map(o => (\n                    <Box key={o.rank} display=\"flex\" flexDirection=\"column\" gap=\"4px\" pl=\"8px\" {...(o.recommended ? { boxShadow: 'inset 2px 0 0 var(--chakra-colors-accent-brand)' } : {})}>\n                        <Text fontSize=\"12.5px\"><Text as=\"span\" fontFamily=\"mono\" color=\"fg.subtle\">{o.rank}</Text> <Text as=\"span\" fontWeight={o.recommended ? 'semibold' : 'normal'}>{o.label}</Text></Text>\n                        {meter(upLabel, o.value / maxUp, fmt(words, decision, o.value, signed), signed ? 'success' : 'neutral')}\n                        {meter('If wrong', (o.downside ?? 0) / maxDown, o.downside !== undefined ? fmt(words, decision, o.downside, true) : '—', 'danger')}\n                    </Box>\n                ))}\n            </Box>\n        );\n    }\n\n    return (\n        <Box display=\"flex\" flexDirection=\"column\" gap=\"6px\">\n            <Box display=\"grid\" gridTemplateColumns=\"minmax(180px, 1.1fr) 1fr 1fr\" alignItems=\"baseline\" gap=\"8px\">\n                <Text {...caption} color=\"fg\">Options · {words.number(options.length)} evaluated</Text>\n                <Text {...caption} textAlign=\"center\">If wrong</Text>\n                <Text {...caption} textAlign=\"right\">{upLabel}</Text>\n            </Box>\n            {options.map(o => {\n                const downFrac = Math.min(Math.abs(o.downside ?? 0) / maxDown, 1);\n                const upFrac = Math.min(Math.max(o.value, 0) / maxUp, 1);\n                return (\n                    <Box\n                        key={o.rank}\n                        display=\"grid\"\n                        gridTemplateColumns=\"minmax(180px, 1.1fr) 1fr 1fr\"\n                        alignItems=\"center\"\n                        gap=\"8px\"\n                        py=\"4px\"\n                        {...(o.recommended ? { bg: 'bg.brand.subtle', boxShadow: 'inset 2px 0 0 var(--chakra-colors-accent-brand)' } : {})}\n                    >\n                        <Box minW={0} pl={o.recommended ? '6px' : '0'} display=\"flex\" alignItems=\"baseline\" gap=\"6px\">\n                            <Text as=\"span\" fontFamily=\"mono\" fontSize=\"11px\" color=\"fg.subtle\" flexShrink={0}>{o.rank}</Text>\n                            <Text as=\"span\" fontSize=\"12.5px\" fontWeight={o.recommended ? 'semibold' : 'normal'} flexShrink={0}>{o.label}</Text>\n                            {metaLine(o, words) !== '' && (\n                                <Text as=\"span\" fontFamily=\"mono\" fontSize=\"10.5px\" color=\"fg.muted\" minW={0} truncate>{metaLine(o, words)}</Text>\n                            )}\n                        </Box>\n                        <Box display=\"flex\" justifyContent=\"flex-end\" alignItems=\"center\" gap=\"6px\" height=\"16px\">\n                            {o.downside !== undefined && (\n                                <>\n                                    <Text fontSize=\"10.5px\" fontFamily=\"mono\" color=\"fg.danger\" flexShrink={0}>{fmt(words, decision, o.downside, true)}</Text>\n                                    <Box height=\"12px\" style={{ width: `${Math.round(downFrac * 100)}%` }} bg=\"status.neg\" opacity={0.55} />\n                                </>\n                            )}\n                        </Box>\n                        <Box display=\"flex\" alignItems=\"center\" gap=\"6px\" height=\"16px\" borderLeftWidth=\"1px\" borderColor=\"border.strong\">\n                            {o.value > 0 && (\n                                <>\n                                    <Box height=\"12px\" style={{ width: `${Math.round(upFrac * 100)}%` }} bg={signed ? 'status.pos' : 'fg.subtle'} opacity={0.6} />\n                                    <Text fontSize=\"10.5px\" fontFamily=\"mono\" color={signed ? 'fg.success' : 'fg.muted'} flexShrink={0}>{fmt(words, decision, o.value, signed)}</Text>\n                                </>\n                            )}\n                        </Box>\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n});\n\n// =============================================================================\n// Judgement — prompts · knowledge · lever builder · gate footer.\n// =============================================================================\n\nconst ANSWERS = [\n    { literal: 'yes', label: 'Yes' },\n    { literal: 'no', label: 'No' },\n    { literal: 'unknown', label: \"Don't know\" },\n] as const;\n\nexport interface JudgementFacetProps {\n    decision: Decision;\n    handle: UseDecisionHandleResult;\n    /** The solution's constraint contract, walked off the judgements binding;\n     *  `undefined` until its type is registered. */\n    contract: ConstraintContract | undefined;\n}\n\nexport const JudgementFacet = memo(function JudgementFacet({ decision, handle, contract }: JudgementFacetProps) {\n    const words = useFormatters();\n    const button = useRecipe({ key: 'button' });\n    const input = useRecipe({ key: 'input' });\n\n    const judgement: Judgement | null = handle.judgementFor(decision.id);\n    const stagedKnowledge = judgement?.knowledge.type === 'some' ? judgement.knowledge.value : '';\n    const [knowledge, setKnowledge] = useState(stagedKnowledge);\n    useEffect(() => { setKnowledge(stagedKnowledge); }, [stagedKnowledge]);\n    const commitKnowledge = useCallback(() => {\n        if (knowledge !== stagedKnowledge) handle.addKnowledge(decision.id, knowledge);\n    }, [knowledge, stagedKnowledge, handle, decision.id]);\n\n    const levers = useMemo(\n        () => decision.levers.filter(l => leverPayloadEditable(contract?.payloads.get(l.case))),\n        [decision.levers, contract],\n    );\n    const [leverCase, setLeverCase] = useState(levers[0]?.case ?? '');\n    const activeLever = levers.find(l => l.case === leverCase) ?? levers[0];\n    const activePayload = activeLever === undefined ? undefined : contract?.payloads.get(activeLever.case);\n\n    const gate = handle.commitStateFor(decision.id);\n    const gateHint = gate?.type === 'gated'\n        ? (gate.value === 1n ? 'Answer the judgement question to enable apply' : `Answer the ${gate.value} judgement questions to enable apply`)\n        : gate?.type === 'blocked' ? 'Commit blocked — an answer contradicts the recommendation'\n        : gate?.type === 'handoff' ? \"Awaiting handoff — an answer was don't know\"\n        : null;\n\n    const onInject = useCallback((constraint: ConstraintValue) => {\n        handle.inject(decision.id, constraint);\n    }, [handle, decision.id]);\n\n    if (!judgement) return null;\n\n    return (\n        <Box display=\"flex\" flexDirection=\"column\" gap=\"10px\">\n            <Box display=\"flex\" alignItems=\"baseline\" gap=\"12px\">\n                <Text {...caption} color=\"fg.warning\">Required before commit</Text>\n                <Text {...caption} marginLeft=\"auto\">human-only signal · model can&rsquo;t see this</Text>\n            </Box>\n\n            {decision.prompts.map(prompt => {\n                const current = judgement.answers.get(prompt.id)?.type;\n                return (\n                    <Box key={prompt.id} display=\"flex\" alignItems=\"center\" gap=\"12px\" flexWrap=\"wrap\">\n                        <Text fontSize=\"13px\" fontWeight=\"medium\" flex=\"1\" minW=\"min(180px, 100%)\">{prompt.text}</Text>\n                        <Box display=\"flex\" gap=\"6px\" flexShrink={0}>\n                            {ANSWERS.map(a => (\n                                <chakra.button\n                                    key={a.literal}\n                                    type=\"button\"\n                                    css={button({ variant: current === a.literal ? 'solid' : 'outline', size: 'xs' })}\n                                    onClick={() => handle.answer(decision.id, prompt.id, a.literal)}\n                                >\n                                    {a.label}\n                                </chakra.button>\n                            ))}\n                        </Box>\n                    </Box>\n                );\n            })}\n\n            <Box display=\"flex\" flexDirection=\"column\" gap=\"4px\">\n                <Text {...caption}>Knowledge · what the model can&rsquo;t see</Text>\n                <chakra.textarea\n                    css={input({ size: 'sm' })}\n                    rows={2}\n                    value={knowledge}\n                    placeholder=\"Private context — persists with the case\"\n                    onChange={e => setKnowledge(e.target.value)}\n                    onBlur={commitKnowledge}\n                />\n            </Box>\n\n            {(levers.length > 0 || judgement.constraints.length > 0) && (\n                <Box display=\"flex\" flexDirection=\"column\" gap=\"6px\">\n                    <Text {...caption}>Inject constraint · next run folds it in</Text>\n                    {judgement.constraints.length > 0 && (\n                        <Box display=\"flex\" gap=\"12px\" flexWrap=\"wrap\">\n                            {judgement.constraints.map((c, i) => {\n                                const f = formatConstraint(c, contract, decision.levers, words);\n                                return (\n                                    <Text key={i} as=\"span\" fontFamily=\"mono\" fontSize=\"11px\">\n                                        <Text as=\"span\" color=\"accent.brand\" fontWeight=\"semibold\">{f.lever}</Text>{' '}\n                                        <Text as=\"span\" color=\"fg.subtle\">{f.op}</Text>{' '}\n                                        <Text as=\"span\" fontWeight=\"semibold\">{f.value}</Text>\n                                    </Text>\n                                );\n                            })}\n                        </Box>\n                    )}\n                    {activeLever !== undefined && activePayload !== undefined && (\n                        <Box display=\"flex\" alignItems=\"center\" gap=\"8px\" flexWrap=\"wrap\">\n                            {levers.length > 1 ? (\n                                <Box flexShrink={0} css={{ '& [data-scope=select][data-part=root]': { width: 'auto', minWidth: '160px' } }}>\n                                    <EastChakraSelect\n                                        ariaLabel=\"Lever\"\n                                        value={{\n                                            value: some(activeLever.case),\n                                            items: levers.map(l => ({ value: l.case, label: l.label, disabled: none })),\n                                            placeholder: none, multiple: none, disabled: none,\n                                            onChange: some((v: string) => setLeverCase(v)), onChangeMultiple: none, onOpenChange: none,\n                                            style: some({ size: some(variant('sm', null)) }),\n                                        } as never}\n                                    />\n                                </Box>\n                            ) : (\n                                <Text {...caption} color=\"fg\" flexShrink={0}>{activeLever.label}</Text>\n                            )}\n                            <Box flex=\"1\" minW=\"min(260px, 100%)\">\n                                <LeverEditor\n                                    key={activeLever.case}\n                                    leverCase={activeLever.case}\n                                    payload={activePayload}\n                                    onInject={onInject}\n                                />\n                            </Box>\n                        </Box>\n                    )}\n                </Box>\n            )}\n\n            {gateHint !== null && (\n                <Box display=\"flex\" alignItems=\"center\" gap=\"8px\" pt=\"4px\">\n                    <Box width=\"7px\" height=\"7px\" borderRadius=\"full\" bg=\"status.warn\" flexShrink={0} />\n                    <Text {...caption}>{gateHint}</Text>\n                    <chakra.button\n                        type=\"button\"\n                        css={button({ variant: 'outline', size: 'xs' })}\n                        marginLeft=\"auto\"\n                        onClick={() => handle.resolve(decision.id, variant('deferred', none))}\n                    >\n                        Defer\n                    </chakra.button>\n                </Box>\n            )}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Internal — a solution's constraint contract, read off the judgements\n * binding's registered East type.\n *\n * The judgements dataset is a `Dict<String, JudgementInput<C>>`\n * (`judgementInputType(C)` in `@elaraai/e3-ui`), whose `constraints` field is\n * an `Array<C>`: `C` is the solution's by-name contract variant. The lever\n * editor and the constraint chips dispatch on `C`'s cases, as East types.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from 'react';\nimport type { EastTypeValue } from '@elaraai/east';\nimport type { TreePath } from '@elaraai/e3-types';\n\nimport { getBindingTypes, getReactiveDatasetCache } from '../platform/index.js';\nimport type { DecisionHandleRefValue } from './handle-runtime.js';\n\n/** A solution's constraint contract, as East types. */\nexport interface ConstraintContract {\n    /** The contract `C` itself — a by-name `VariantType`, perhaps recursive. */\n    readonly type: EastTypeValue;\n    /** Each of `C`'s cases' payload types, by case name. */\n    readonly payloads: ReadonlyMap<string, EastTypeValue>;\n}\n\n/** A recursive type's body, or the type itself. */\nfunction body(type: EastTypeValue): EastTypeValue {\n    return type.type === 'Recursive' && type.value.type === 'wrapper' ? type.value.value.inner as EastTypeValue : type;\n}\n\n/**\n * The constraint contract a judgements dataset's type carries.\n *\n * @param judgementsType - The judgements binding's registered East type, a\n *   `Dict<String, JudgementInput<C>>`\n * @returns The contract `C` and its cases' payload types; `undefined` when the\n *   type is not a judgements record\n */\nexport function constraintContractOf(judgementsType: EastTypeValue): ConstraintContract | undefined {\n    const dict = body(judgementsType);\n    if (dict.type !== 'Dict') return undefined;\n    const record = body(dict.value.value as EastTypeValue);\n    if (record.type !== 'Struct') return undefined;\n    const field = (record.value as Array<{ name: string; type: EastTypeValue }>).find(f => f.name === 'constraints');\n    if (field === undefined) return undefined;\n    const constraints = body(field.type);\n    if (constraints.type !== 'Array') return undefined;\n    const contract = constraints.value as EastTypeValue;\n    const cases = body(contract);\n    if (cases.type !== 'Variant') return undefined;\n    return {\n        type: contract,\n        payloads: new Map((cases.value as Array<{ name: string; type: EastTypeValue }>).map(c => [c.name, c.type])),\n    };\n}\n\n/**\n * The constraint contract of a decision handle's judgements binding — what the\n * lever editor and the constraint chips dispatch on.\n *\n * @param ref - The decision handle's binding descriptors\n * @returns The contract; `undefined` until the judgements binding's type is\n *   registered\n */\nexport function useConstraintContract(ref: DecisionHandleRefValue | null): ConstraintContract | undefined {\n    const workspace = getReactiveDatasetCache().getConfig().workspace ?? '';\n    return useMemo(() => {\n        if (ref === null) return undefined;\n        const judgements = getBindingTypes(workspace, ref.judgements.source as TreePath);\n        return judgements === undefined ? undefined : constraintContractOf(judgements.sourceType);\n    }, [ref, workspace]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Renderer-side aliases derived from the East `DecisionType` so the renderer\n * tracks any structural change to the source-of-truth type as a compile error\n * — adding a field to `DecisionType` / `DecisionOptionType` or a tag to\n * `UrgencyType` surfaces here, not as silent runtime drift.\n *\n * @packageDocumentation\n */\n\nimport type { ValueTypeOf } from '@elaraai/east';\nimport { DecisionType as EastDecisionType, UrgencyType as EastUrgencyType } from '@elaraai/e3-ui/internal';\n\n/** JS-side shape of a `DecisionType` value. */\nexport type Decision = ValueTypeOf<typeof EastDecisionType>;\n\n/** JS-side shape of one `DecisionOptionType` (a decision's alternative). */\nexport type DecisionOption = Decision['alternatives'][number];\n\n/** JS string-union of every `UrgencyType` variant tag. */\nexport type UrgencyKind = ValueTypeOf<typeof EastUrgencyType>['type'];\n\n/** Queue sort weight — overdue first, routine last. */\nexport const URGENCY_RANK: Record<UrgencyKind, number> = {\n    overdue: 0,\n    due: 1,\n    routine: 2,\n};\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Pure grouping model behind the `DecisionQueue` Group-by toolbar — folds the\n * urgency-sorted rows into labelled sections for the active option (built-in\n * urgency / kind / none, or a custom accessor facet). React-free so the fold\n * is unit-testable without mounting the component.\n *\n * @packageDocumentation\n */\n\nimport { DateTimeType, FloatType, compareFor } from '@elaraai/east';\nimport { URGENCY_RANK, type Decision, type UrgencyKind } from './types.js';\n\nconst compareInstants = compareFor(DateTimeType);\nconst compareValues = compareFor(FloatType);\n\n/**\n * The queue's order: by urgency (overdue → due → routine), then the nearest\n * deadline first — a row with none after every row with one — then the greater\n * value first. Deadlines and values compare as East compares them, so a `NaN`\n * value takes its one place in East's order rather than scrambling the sort.\n *\n * @param a - A row\n * @param b - Another row\n * @returns Negative when `a` comes first, positive when `b` does, else 0\n */\nexport function compareByUrgency(a: Decision, b: Decision): number {\n    const rank = URGENCY_RANK[a.urgency.type] - URGENCY_RANK[b.urgency.type];\n    if (rank !== 0) return rank;\n    const da = a.deadline.type === 'some' ? a.deadline.value : undefined;\n    const db = b.deadline.type === 'some' ? b.deadline.value : undefined;\n    if (da !== undefined && db !== undefined) {\n        const byDeadline = compareInstants(da, db);\n        if (byDeadline !== 0) return byDeadline;\n    } else if (da !== db) {\n        return da === undefined ? 1 : -1;\n    }\n    return compareValues(b.value, a.value);\n}\n\n/** Section labels for the built-in urgency grouping. */\nexport const URGENCY_GROUP_LABEL: Record<UrgencyKind, string> = {\n    overdue: 'Overdue',\n    due: 'Due today',\n    routine: 'Routine',\n};\n\n/** One Group-by toolbar option — a built-in key or a custom accessor facet. */\nexport interface GroupOption {\n    key: string;\n    label: string;\n    accessor?: (d: Decision) => string;\n}\n\n/** One resolved queue section. */\nexport interface QueueGroup {\n    label: string;\n    decisions: Decision[];\n    pastSla: number;\n    total: number;\n    /** Hosts the bulk Accept all (the urgency grouping's Routine section). */\n    bulk: boolean;\n}\n\n/** Folds the sorted rows into sections for the active grouping. Rows arrive\n *  urgency-sorted, so first-appearance order gives Overdue → Due today →\n *  Routine for the built-in and stable insertion order for the rest. */\nexport function buildGroups(rows: Decision[], option: GroupOption): QueueGroup[] {\n    if (option.key === 'none') {\n        return [{ label: '', decisions: rows, pastSla: 0, total: 0, bulk: false }];\n    }\n    const labelFor = (d: Decision): string =>\n        option.key === 'urgency' ? URGENCY_GROUP_LABEL[d.urgency.type]\n            : option.key === 'kind' ? d.kind\n                : option.accessor?.(d) ?? '';\n    const out = new Map<string, QueueGroup>();\n    for (const d of rows) {\n        const label = labelFor(d);\n        let group = out.get(label);\n        if (group === undefined) {\n            group = {\n                label,\n                decisions: [],\n                pastSla: 0,\n                total: 0,\n                bulk: option.key === 'urgency' && d.urgency.type === 'routine',\n            };\n            out.set(label, group);\n        }\n        group.decisions.push(d);\n        group.total += d.value;\n        if (d.urgency.type === 'overdue') group.pastSla += 1;\n    }\n    return [...out.values()];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraDecisionQueue` — Chakra v3 renderer for the `DecisionQueue`\n * extension component declared in `@elaraai/e3-ui`: *the* Decide surface.\n * Urgency-sorted rows over the handle's unioned cases, the routine tail\n * collapsed under a bulk-accept band. Selecting a row opens one compact\n * facet beneath it (Evidence · Options · Judgement · Modify), swapped by\n * the row's segmented toggles; Apply / Reject stay on the row, Apply gated\n * by the judgement. Narrow hosts wrap rows to two lines: collapsed rows\n * are display-only, the toggles become a full-width segment, and the\n * Options facet stacks.\n *\n * With the payload's `groupBy` set, a Group-by toolbar folds the rows into\n * collapsible sections (built-in Urgency / Kind / None plus the payload's\n * custom `groups` accessors, run per decision), each head carrying a\n * `label · count` plus a roll-up summary; the urgency grouping's Routine\n * section hosts the bulk Accept all and ships collapsed.\n *\n * Composes the shared chrome recipes (`frame` / `eyebrowRow` / `status` /\n * `button` / `facetTabs`) plus the `decisionQueue` row recipe; holds no\n * design values of its own. Registers against\n * {@link DecisionQueue.Component} at module load via\n * {@link implementUIComponent}.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { Box, Text, useRecipe, useSlotRecipe } from '@chakra-ui/react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCaretDown, faCaretRight } from '@fortawesome/free-solid-svg-icons';\nimport { variant, type ValueTypeOf } from '@elaraai/east';\nimport { DecisionQueue } from '@elaraai/e3-ui/internal';\nimport { sliceMatches } from '@elaraai/east-ui/internal';\nimport {\n    EastChakraComponent,\n    implementUIComponent,\n    getSomeorUndefined,\n    useFormatters,\n    SliceRailCluster,\n    usePersistedState,\n    useSliceReactivity,\n    useContainerBelow,\n    type Formatters,\n} from '@elaraai/east-ui-components';\nimport { keptRead } from '@elaraai/east-ui-components/internal';\n\nimport { boundSliceConfig } from '@elaraai/east-ui-components/platform';\n\nimport { useDecisionHandle, type UseDecisionHandleResult } from './handle-runtime.js';\nimport { EvidenceFacet, OptionsFacet, JudgementFacet } from './facets.js';\nimport { useConstraintContract, type ConstraintContract } from './contract.js';\nimport { URGENCY_GROUP_LABEL, buildGroups, compareByUrgency, type GroupOption, type QueueGroup } from './grouping.js';\nimport { type Decision, type UrgencyKind } from './types.js';\n\ntype DecisionQueueValue = ValueTypeOf<typeof DecisionQueue.Component.schema>;\ntype FacetKey = 'evidence' | 'options' | 'judgement' | 'modify';\n/** The author's per-kind probe editor — the payload's own East function. */\ntype ModifyFn = Extract<DecisionQueueValue['modify'], { type: 'some' }>['value'];\n/** The author's per-decision Evidence canvas — the payload's own East function. */\ntype EvidenceFn = Extract<DecisionQueueValue['evidence'], { type: 'some' }>['value'];\n\nconst FACETS: ReadonlyArray<{ key: FacetKey; label: string }> = [\n    { key: 'evidence', label: 'Evidence' },\n    { key: 'options', label: 'Options' },\n    { key: 'judgement', label: 'Judgement' },\n    { key: 'modify', label: 'Modify' },\n];\n\n/** Urgency tag → `status` recipe tone + display label. */\nconst URGENCY_TONE: Record<UrgencyKind, 'danger' | 'warning' | 'neutral'> = {\n    overdue: 'danger',\n    due: 'warning',\n    routine: 'neutral',\n};\n\n/** How a row left the queue — selects the exit treatment in the `rowShell`\n *  recipe (apply sweeps right in the success tone, reject sweeps left in the\n *  danger tone, an external removal fades quietly). */\ntype ExitReason = 'apply' | 'reject' | 'removed';\n\n/** Slightly past the `rowShell` transition chain so the height collapse\n *  completes before an exited row unmounts. */\nconst EXIT_MS = 560;\n\n/** Hosts narrower than this wrap rows to the two-line rail layout. */\nconst NARROW_PX = 560;\n\n/** Toolbar state persisted per `storageKey`: the active grouping + collapsed\n *  section labels. */\ninterface DecisionQueueToolbarState {\n    groupKey: string;\n    collapsed: string[];\n}\n\n/** The toolbar's state, as storage keeps it. */\nconst readQueueToolbar = keptRead.record<DecisionQueueToolbarState>({ groupKey: keptRead.string, collapsed: keptRead.array(keptRead.string) });\n\n/** A decision value through its declared format, in the app's locale (#850). */\nfunction decisionValue(words: Formatters, d: Decision, n: number, showSign = false): string {\n    return words.value(n, getSomeorUndefined(d.format), showSign);\n}\n\n/** Deadline qualifier for the urgency flag — \"overdue 2h\" / \"due 16:00\" (the\n *  deadline's UTC time, in the app's locale — #850). */\nfunction deadlineSuffix(d: Decision, words: Formatters): string {\n    const deadline = getSomeorUndefined(d.deadline);\n    if (deadline === undefined) return '';\n    if (d.urgency.type === 'overdue') {\n        const hours = Math.round((Date.now() - deadline.getTime()) / 3_600_000);\n        if (hours < 1) return ' <1h';\n        if (hours < 48) return ` ${hours}h`;\n        return ` ${Math.round(hours / 24)}d`;\n    }\n    if (d.urgency.type === 'due') return ` ${words.time(deadline)}`;\n    return '';\n}\n\n// =============================================================================\n// Row — one line; selected row opens one facet beneath, toggled by the\n// segmented group. Apply / Reject are commands on the row.\n// =============================================================================\n\ninterface RowProps {\n    decision: Decision;\n    handle: UseDecisionHandleResult;\n    selected: boolean;\n    narrow: boolean;\n    /** The solution's constraint contract; `undefined` until its type is registered. */\n    contract: ConstraintContract | undefined;\n    modify: ModifyFn | undefined;\n    evidence: EvidenceFn | undefined;\n    defaultFacet: FacetKey;\n    /** Author include-list of data facets; `null` ⇒ all. `modify` stays callback-gated. */\n    facetInclude: ReadonlySet<FacetKey> | null;\n    apply: (d: Decision) => void;\n    reject: (d: Decision) => void;\n    leaving: ExitReason | undefined;\n    storageKey: string;\n}\n\nconst Row = memo(function Row({ decision, handle, selected, narrow, contract, modify, evidence, defaultFacet, facetInclude, apply, reject, leaving, storageKey }: RowProps) {\n    const dq = useSlotRecipe({ key: 'decisionQueue' });\n    const status = useSlotRecipe({ key: 'status' });\n    const tabs = useSlotRecipe({ key: 'facetTabs' });\n    const button = useRecipe({ key: 'button' });\n    const words = useFormatters();\n    const rs = dq({});\n    const ts = tabs({});\n    const st = status({ status: URGENCY_TONE[decision.urgency.type], size: 'md' });\n\n    // Visible facets: the author include-list ANDed with the modify callback gate.\n    const visibleFacets = useMemo(\n        () => FACETS.filter(f => f.key === 'modify' ? modify !== undefined : (facetInclude === null || facetInclude.has(f.key))),\n        [modify, facetInclude],\n    );\n    // Open the configured default facet, or the first available one when it is disabled.\n    const effectiveDefault = visibleFacets.some(f => f.key === defaultFacet)\n        ? defaultFacet\n        : (visibleFacets[0]?.key ?? defaultFacet);\n\n    const [facet, setFacet] = useState<FacetKey>(effectiveDefault);\n    useEffect(() => { if (!selected) setFacet(effectiveDefault); }, [selected, effectiveDefault]);\n\n    const gate = handle.commitStateFor(decision.id);\n    const applyEnabled = gate === null || gate.type === 'ready';\n    const gatePulse = !applyEnabled && decision.prompts.length > 0;\n\n    const summary = getSomeorUndefined(decision.summary);\n\n    const handleSelect = useCallback(() => {\n        if (!selected) handle.select(decision.id);\n    }, [selected, handle, decision.id]);\n\n    const handleApply = useCallback(() => { if (applyEnabled) apply(decision); }, [applyEnabled, apply, decision]);\n    const handleReject = useCallback(() => { reject(decision); }, [reject, decision]);\n\n    // Host slots — `UIComponentType` values rendered by the nested dispatcher.\n    // The probe's `update` is an East `(Decision) => Null` — it stages the edit.\n    const stageUpdate = handle.update;\n    const updateDecision = useCallback((next: Decision): null => { stageUpdate(next); return null; }, [stageUpdate]);\n    const probe = useMemo(() => {\n        if (!selected || facet !== 'modify' || !modify) return null;\n        return modify(decision, updateDecision);\n    }, [selected, facet, modify, decision, updateDecision]);\n    const canvas = useMemo(() => {\n        if (!selected || facet !== 'evidence' || !evidence) return null;\n        return evidence(decision);\n    }, [selected, facet, evidence, decision]);\n\n    // One facet shown, no tabs: there is nothing to choose.\n    const facetTabs = visibleFacets.length > 1 && (\n        <Box css={ts.root} {...(narrow ? { display: 'flex', width: '100%' } : {})}>\n            {visibleFacets.map(f => (\n                <Box\n                    key={f.key}\n                    as=\"button\"\n                    css={ts.tab}\n                    {...(narrow ? { flex: 1 } : {})}\n                    {...(facet === f.key ? { 'data-on': '' } : {})}\n                    {...(f.key === 'judgement' && gatePulse ? { 'data-pulse': '' } : {})}\n                    aria-pressed={facet === f.key}\n                    onClick={() => setFacet(f.key)}\n                >\n                    {f.label}\n                </Box>\n            ))}\n        </Box>\n    );\n\n    const commands = (\n        <Box display=\"flex\" gap=\"6px\" {...(narrow ? { justifyContent: 'flex-end' } : {})}>\n            <Box\n                as=\"button\"\n                css={button({ variant: 'solid', size: 'xs' })}\n                aria-disabled={!applyEnabled}\n                opacity={applyEnabled ? undefined : 0.5}\n                cursor={applyEnabled ? undefined : 'not-allowed'}\n                title={applyEnabled ? undefined : 'Answer the judgement to enable apply'}\n                onClick={handleApply}\n            >\n                Apply\n            </Box>\n            <Box as=\"button\" css={button({ variant: 'ghost', size: 'xs' })} onClick={handleReject}>\n                Reject\n            </Box>\n        </Box>\n    );\n\n    // The truncating element must DIRECTLY contain the spans (a block child\n    // defeats text-overflow); the native title carries the untruncated line.\n    const fullTitle = `${decision.kind} · ${decision.title}${summary !== undefined ? ` · ${summary}` : ''}`;\n    const title = (\n        <Box css={rs.titleText} title={fullTitle} cursor={selected ? undefined : 'pointer'} onClick={handleSelect}>\n            <Text as=\"span\" fontWeight=\"semibold\">{decision.kind}</Text>\n            <Text as=\"span\" color=\"fg.subtle\"> · </Text>\n            <Text as=\"span\">{decision.title}</Text>\n            {summary !== undefined && !narrow && (\n                <>\n                    <Text as=\"span\" color=\"fg.subtle\"> · </Text>\n                    <Text as=\"span\" color=\"fg.muted\">{summary}</Text>\n                </>\n            )}\n        </Box>\n    );\n\n    const urgency = (\n        <Box as=\"span\" css={st.root} flexShrink={0}>\n            <Box as=\"span\" css={st.indicator} />\n            <Box as=\"span\" css={st.label}>{decision.urgency.type}{deadlineSuffix(decision, words)}</Box>\n        </Box>\n    );\n    // Value-axis descriptor: when `signed` is false, the headline value reads\n    // as a plain magnitude — no force-sign, no green-when-positive (#135).\n    const valueSigned = getSomeorUndefined(decision.valueAxis)?.signed ?? true;\n    const valueText = (\n        <Text fontFamily=\"mono\" fontWeight=\"semibold\" textAlign=\"right\" {...(valueSigned && decision.value >= 0 && selected ? { color: 'fg.success' } : {})}>\n            {decisionValue(words, decision, decision.value, valueSigned && selected)}\n        </Text>\n    );\n\n    return (\n        <Box css={rs.rowShell} {...(leaving ? { 'data-leaving': leaving } : {})}>\n            {narrow ? (\n                <Box px=\"14px\" py=\"10px\">\n                    <Box display=\"flex\" justifyContent=\"space-between\" alignItems=\"baseline\">\n                        {urgency}\n                        {valueText}\n                    </Box>\n                    <Box mt=\"2px\" fontSize=\"13px\">{title}</Box>\n                    {selected && (\n                        <>\n                            <Box mt=\"8px\">{facetTabs}</Box>\n                            <Box mt=\"8px\">{commands}</Box>\n                        </>\n                    )}\n                </Box>\n            ) : (\n                <Box css={rs.row}>\n                    {urgency}\n                    <Box css={rs.title} p={0}>{title}</Box>\n                    {valueText}\n                    <Box display=\"flex\" alignItems=\"center\" gap=\"12px\">\n                        {selected && facetTabs}\n                        {commands}\n                    </Box>\n                </Box>\n            )}\n\n            {selected && (\n                <Box px={narrow ? '14px' : '18px'} py=\"12px\" borderTopWidth=\"1px\" borderColor=\"border.subtle\" bg=\"bg.canvas\">\n                    {facet === 'evidence' && (\n                        <EvidenceFacet decision={decision}>\n                            {canvas != null && (\n                                <EastChakraComponent value={canvas} storageKey={`${storageKey}-evidence-${decision.id}`} />\n                            )}\n                        </EvidenceFacet>\n                    )}\n                    {facet === 'options' && <OptionsFacet decision={decision} narrow={narrow} />}\n                    {facet === 'judgement' && (\n                        <JudgementFacet decision={decision} handle={handle} contract={contract} />\n                    )}\n                    {facet === 'modify' && probe != null && (\n                        <EastChakraComponent value={probe} storageKey={`${storageKey}-modify-${decision.id}`} />\n                    )}\n                </Box>\n            )}\n        </Box>\n    );\n});\n\n// =============================================================================\n// Routine collapse — compact rows + a single bulk-accept summary.\n// =============================================================================\n\ninterface RoutineGroupProps {\n    routine: Decision[];\n    acceptAll: ((ds: Decision[]) => void) | undefined;\n    leaving: ReadonlyMap<string, ExitReason>;\n    narrow: boolean;\n}\n\nconst RoutineGroup = memo(function RoutineGroup({ routine, acceptAll, leaving, narrow }: RoutineGroupProps) {\n    const dq = useSlotRecipe({ key: 'decisionQueue' });\n    const status = useSlotRecipe({ key: 'status' });\n    const button = useRecipe({ key: 'button' });\n    const words = useFormatters();\n    const rs = dq({});\n    const st = status({ status: 'neutral', size: 'md' });\n\n    const total = useMemo(() => routine.reduce((acc, d) => acc + d.value, 0), [routine]);\n    const format = routine[0] ? getSomeorUndefined(routine[0].format) : undefined;\n\n    const handleAcceptAll = useCallback(() => {\n        if (acceptAll) acceptAll(routine);\n    }, [acceptAll, routine]);\n\n    if (routine.length === 0) return null;\n\n    return (\n        <Box css={rs.routineGroup}>\n            {routine.map(d => (\n                <Box key={d.id} css={rs.rowShell} {...(leaving.has(d.id) ? { 'data-leaving': leaving.get(d.id) } : {})}>\n                    <Box css={rs.routineRow}>\n                        <Box as=\"span\" css={st.root}>\n                            <Box as=\"span\" css={st.indicator} />\n                            <Box as=\"span\" css={st.label}>routine</Box>\n                        </Box>\n                        <Box minW={0} overflow=\"hidden\" textOverflow=\"ellipsis\" whiteSpace=\"nowrap\">\n                            <Text as=\"span\" fontFamily=\"mono\">{d.id}</Text>\n                            <Text as=\"span\" color=\"fg.muted\"> · {d.kind}</Text>\n                        </Box>\n                        <Box css={rs.routineValue}>{decisionValue(words, d, d.value)}</Box>\n                    </Box>\n                </Box>\n            ))}\n            <Box css={rs.summary} {...(narrow ? { marginLeft: '0', flexWrap: 'wrap' } : {})}>\n                <Box as=\"span\" css={rs.summaryCap}>{words.number(routine.length)} routine</Box>\n                <Text as=\"span\" color=\"fg.subtle\">·</Text>\n                <Text as=\"span\" fontFamily=\"mono\" fontWeight=\"semibold\">{words.value(total, format)}</Text>\n                <Text as=\"span\" color=\"fg.muted\">total</Text>\n                {acceptAll && (\n                    <Box as=\"button\" css={button({ variant: 'solid', size: 'xs' })} ml=\"auto\" onClick={handleAcceptAll}>\n                        Accept all\n                    </Box>\n                )}\n            </Box>\n        </Box>\n    );\n});\n\n// =============================================================================\n// Group head — one collapsible section band: caret (Font Awesome's, #1263),\n// label · count, roll-up summary, and the bulk Accept all on the routine\n// section.\n// =============================================================================\n\ninterface GroupHeadProps {\n    group: QueueGroup;\n    collapsible: boolean;\n    collapsed: boolean;\n    onToggle: (label: string) => void;\n    acceptAll: ((ds: Decision[]) => void) | undefined;\n}\n\nconst GroupHead = memo(function GroupHead({ group, collapsible, collapsed, onToggle, acceptAll }: GroupHeadProps) {\n    const dq = useSlotRecipe({ key: 'decisionQueue' });\n    const button = useRecipe({ key: 'button' });\n    const words = useFormatters();\n    const rs = dq({});\n\n    const format = group.decisions[0] ? getSomeorUndefined(group.decisions[0].format) : undefined;\n\n    const handleToggle = useCallback(() => {\n        if (collapsible) onToggle(group.label);\n    }, [collapsible, onToggle, group.label]);\n    const handleAcceptAll = useCallback((e: { stopPropagation: () => void }) => {\n        e.stopPropagation();\n        if (acceptAll) acceptAll(group.decisions);\n    }, [acceptAll, group.decisions]);\n\n    return (\n        <Box css={rs.groupHead} {...(collapsible ? { 'data-collapsible': '' } : {})} onClick={handleToggle}>\n            {collapsible && (\n                <Box as=\"span\" css={rs.groupCaret} aria-hidden=\"true\" data-collapsed={collapsed ? '' : undefined}>\n                    <FontAwesomeIcon icon={collapsed ? faCaretRight : faCaretDown} />\n                </Box>\n            )}\n            <Box as=\"span\" css={rs.groupLabel}>{group.label} · {words.number(group.decisions.length)}</Box>\n            <Box as=\"span\" css={rs.groupSummary}>\n                {words.value(group.total, format)}{group.pastSla > 0 ? ` · ${words.number(group.pastSla)} past SLA` : ''}\n            </Box>\n            {acceptAll && (\n                <Box as=\"button\" css={button({ variant: 'solid', size: 'xs' })} onClick={handleAcceptAll}>\n                    Accept all\n                </Box>\n            )}\n        </Box>\n    );\n});\n\n// =============================================================================\n// Main component.\n// =============================================================================\n\nexport interface EastChakraDecisionQueueProps {\n    value: DecisionQueueValue;\n    storageKey: string;\n}\n\nconst EastChakraDecisionQueue = memo(function EastChakraDecisionQueue({ value, storageKey }: EastChakraDecisionQueueProps) {\n    const eyebrow = useSlotRecipe({ key: 'eyebrowRow' });\n    const es = eyebrow({});\n    const dq = useSlotRecipe({ key: 'decisionQueue' });\n    const qs = dq({});\n    // Group-by toggle pills share the slice vocabulary: the `chip` recipe,\n    // brand tone when active (the Library toolbar precedent).\n    const chip = useRecipe({ key: 'chip' });\n    const words = useFormatters();\n\n    const handleRef = value.handle;\n    const handle = useDecisionHandle(handleRef);\n    const decisions = handle.decisions;\n    const contract = useConstraintContract(handleRef);\n\n    // The slice is author-owned (a `Slice.bind` handle passed in the payload,\n    // the `Table` pattern); `affordances` lists what mounts in the rail. Its\n    // narrowing applies whether or not a rail shows — a seeded state with no\n    // rail is an invisible author scope.\n    const railAffordances = getSomeorUndefined(value.affordances);\n    // The decoded handle's closures re-bind by key on decode (issue #106).\n    const sliceHandle = getSomeorUndefined(value.slice) ?? null;\n    useSliceReactivity(sliceHandle?.key);\n    // Read at render level: the handle's identity is stable across slice\n    // writes, so the narrowing memo must depend on the state value itself\n    // (a fresh decode per write — the subscription above drives the render).\n    const sliceState = sliceHandle !== null ? sliceHandle.read() : null;\n\n    // Narrow hosts (a rail) wrap rows to two lines. Shared adaptive\n    // contract (#346) — same threshold as the previous inline observer.\n    const rootRef = useRef<HTMLDivElement | null>(null);\n    const narrow = useContainerBelow(rootRef, NARROW_PX);\n\n    // Exit animation is data-driven: a row leaves because the bound array no\n    // longer contains its id — whoever wrote the change (Apply here, another\n    // operator's commit, a dataflow re-run). Just-removed rows keep rendering\n    // from their last-seen value with `data-leaving` until the `rowShell`\n    // transition completes, then unmount.\n    const [exiting, setExiting] = useState<ReadonlyMap<string, { decision: Decision; reason: ExitReason }>>(new Map());\n    const prevRef = useRef<Decision[] | null>(null);\n    const reasonsRef = useRef(new Map<string, ExitReason>());\n    const timersRef = useRef<ReturnType<typeof setTimeout>[]>([]);\n    useLayoutEffect(() => {\n        const prev = prevRef.current;\n        prevRef.current = decisions;\n        if (!prev || !decisions) return;\n        const ids = new Set(decisions.map(d => d.id));\n        const removed = prev.filter(d => !ids.has(d.id));\n        if (removed.length === 0) return;\n        setExiting(old => {\n            const next = new Map(old);\n            for (const d of removed) {\n                next.set(d.id, { decision: d, reason: reasonsRef.current.get(d.id) ?? 'removed' });\n                reasonsRef.current.delete(d.id);\n            }\n            return next;\n        });\n        timersRef.current.push(setTimeout(() => {\n            setExiting(old => {\n                const next = new Map(old);\n                for (const d of removed) next.delete(d.id);\n                return next;\n            });\n        }, EXIT_MS));\n    }, [decisions]);\n    useEffect(() => () => { for (const t of timersRef.current) clearTimeout(t); }, []);\n\n    const heading = getSomeorUndefined(value.heading) ?? 'Decisions waiting';\n    const onApply = useMemo(() => getSomeorUndefined(value.onApply), [value.onApply]);\n    const onReject = useMemo(() => getSomeorUndefined(value.onReject), [value.onReject]);\n    const modify = useMemo(() => getSomeorUndefined(value.modify), [value.modify]);\n    const evidence = useMemo(() => getSomeorUndefined(value.evidence), [value.evidence]);\n    const defaultFacet = (getSomeorUndefined(value.defaultFacet)?.type ?? 'evidence') as FacetKey;\n    // Author include-list of data facets (`null` ⇒ all). `modify` stays callback-gated.\n    const facetInclude = useMemo<ReadonlySet<FacetKey> | null>(() => {\n        const facets = getSomeorUndefined(value.facets);\n        // An empty list says nothing, as leaving it out does: every facet.\n        return facets === undefined || facets.length === 0 ? null : new Set(facets.map(f => f.type as FacetKey));\n    }, [value.facets]);\n    const defaultExpanded = getSomeorUndefined(value.defaultExpanded);\n\n    // Grouping — a present `groupBy` mounts the Group-by toolbar (the factory\n    // defaults it to \"urgency\" whenever custom `groups` are given). Custom\n    // accessors decode to callable functions run per decision, like `modify`.\n    const groupDefs = useMemo(\n        () => (getSomeorUndefined(value.groups) ?? []) as ReadonlyArray<{ label: string; value: (d: Decision) => string }>,\n        [value.groups],\n    );\n    const defaultGroupKey = getSomeorUndefined(value.groupBy);\n    const grouped = defaultGroupKey !== undefined;\n    const collapsible = grouped && (getSomeorUndefined(value.collapsible) ?? true);\n    const groupOptions = useMemo<GroupOption[]>(() => [\n        { key: 'urgency', label: 'Urgency' },\n        { key: 'kind', label: 'Kind' },\n        ...groupDefs.map(g => ({ key: g.label, label: g.label, accessor: g.value })),\n        { key: 'none', label: 'None' },\n    ], [groupDefs]);\n    const { state: toolbar, setState: setToolbar } = usePersistedState<DecisionQueueToolbarState>(`${storageKey}.toolbar`, {\n        groupKey: defaultGroupKey ?? 'urgency',\n        // The urgency grouping's routine tail ships collapsed.\n        collapsed: [URGENCY_GROUP_LABEL.routine],\n    }, readQueueToolbar);\n    // A stale persisted key (a custom facet since removed) falls back to the default.\n    const activeOption = groupOptions.find(o => o.key === toolbar.groupKey) ?? groupOptions[0]!;\n\n    // Selection is the expanded row; before any selection exists the host's\n    // display-only default (derived from data) shows expanded.\n    const selectedId = handle.selected ?? defaultExpanded?.id ?? null;\n\n    // Apply / Reject resolve through the handle: verdict → judgement, removal\n    // → the owning patch overlay, selection cleared. Host callbacks are\n    // side-effect hooks; the row's exit falls out of the data diff above.\n    const resolve = useCallback((ds: Decision[], hook: ((d: Decision) => unknown) | undefined, reason: ExitReason) => {\n        if (hook) for (const d of ds) {\n            const decision = d;\n            queueMicrotask(() => hook(decision));\n        }\n        for (const d of ds) {\n            reasonsRef.current.set(d.id, reason);\n            handle.resolve(d.id, reason === 'reject' ? variant('rejected', null) : variant('accepted', ''));\n        }\n    }, [handle]);\n    const apply = useCallback((d: Decision) => resolve([d], onApply, 'apply'), [resolve, onApply]);\n    const reject = useCallback((d: Decision) => resolve([d], onReject, 'reject'), [resolve, onReject]);\n    const acceptAll = useCallback((ds: Decision[]) => resolve(ds, onApply, 'apply'), [resolve, onApply]);\n\n    // Urgency sort (overdue → due → routine; deadline within bucket), with\n    // exiting rows merged back in at their old positions.\n    const { merged, active, routine, pastSla, visible } = useMemo(() => {\n        const scoped = decisions ?? [];\n        const now = new Date();\n        // Match with the slice's own bound config (registered by the author's\n        // `Slice.bind` in the enclosing Reactive — it runs before this mounts),\n        // so the rail's fields and the narrowing always agree.\n        const sliceConfig = sliceHandle !== null ? boundSliceConfig(sliceHandle.key) : undefined;\n        const live = sliceState !== null && sliceConfig !== undefined\n            ? scoped.filter(d => sliceMatches(sliceState, sliceConfig, d, now))\n            : scoped;\n        const merged = [...live];\n        for (const { decision } of exiting.values()) {\n            if (!merged.some(d => d.id === decision.id)) merged.push(decision);\n        }\n        merged.sort(compareByUrgency);\n        return {\n            merged,\n            active: merged.filter(d => d.urgency.type !== 'routine'),\n            routine: merged.filter(d => d.urgency.type === 'routine'),\n            pastSla: merged.filter(d => d.urgency.type === 'overdue').length,\n            visible: live.length,\n        };\n    }, [decisions, exiting, sliceState, sliceHandle]);\n\n    const groups = useMemo(\n        () => (grouped ? buildGroups(merged, activeOption) : []),\n        [grouped, merged, activeOption],\n    );\n    const allCollapsed = groups.length > 0 && groups.every(g => g.label === '' || toolbar.collapsed.includes(g.label));\n    const toggleGroup = useCallback((label: string) => {\n        setToolbar(prev => ({\n            ...prev,\n            collapsed: prev.collapsed.includes(label)\n                ? prev.collapsed.filter(l => l !== label)\n                : [...prev.collapsed, label],\n        }));\n    }, [setToolbar]);\n    const toggleAll = useCallback(() => {\n        const next = allCollapsed ? [] : groups.map(g => g.label).filter(l => l !== '');\n        setToolbar(prev => ({ ...prev, collapsed: next }));\n    }, [setToolbar, allCollapsed, groups]);\n    const setGroupKey = useCallback((key: string) => {\n        setToolbar(prev => (prev.groupKey === key ? prev : { ...prev, groupKey: key }));\n    }, [setToolbar]);\n\n    const exitingReasons = useMemo(() => {\n        const m = new Map<string, ExitReason>();\n        for (const [id, e] of exiting) m.set(id, e.reason);\n        return m;\n    }, [exiting]);\n\n    const renderRow = (d: Decision) => (\n        <Row\n            key={d.id}\n            decision={d}\n            handle={handle}\n            selected={selectedId === d.id}\n            narrow={narrow}\n            contract={contract}\n            modify={modify}\n            evidence={evidence}\n            defaultFacet={defaultFacet}\n            facetInclude={facetInclude}\n            apply={apply}\n            reject={reject}\n            leaving={exitingReasons.get(d.id)}\n            storageKey={storageKey}\n        />\n    );\n\n    if (decisions === null) {\n        return (\n            <Box layerStyle=\"surface.frameless\" p=\"16px\">\n                <Text color=\"fg.muted\" fontSize=\"13px\">Loading decisions…</Text>\n            </Box>\n        );\n    }\n\n    return (\n        <Box ref={rootRef} layerStyle=\"surface.frameless\" overflow=\"hidden\">\n            <Box css={es.root}>\n                <Box css={es.lbl}>{heading}</Box>\n                {sliceHandle !== null && railAffordances !== undefined && (\n                    <Box display=\"flex\" alignItems=\"center\" minWidth=\"0\" flex=\"1\" justifyContent=\"flex-end\" marginRight=\"10px\">\n                        <SliceRailCluster\n                            slice={sliceHandle}\n                            affordanceKinds={railAffordances.map(a => a.type)}\n                        />\n                    </Box>\n                )}\n                <Box css={es.meta} gap=\"10px\">\n                    <Box as=\"span\"><Text as=\"span\" color=\"fg\" fontWeight=\"semibold\">{words.number(visible)}</Text>{narrow ? '' : ' decisions'}</Box>\n                    {pastSla > 0 && (\n                        <>\n                            <Box as=\"span\" css={es.sep}>·</Box>\n                            <Box as=\"span\"><Text as=\"span\" color=\"fg.danger\" fontWeight=\"semibold\">{words.number(pastSla)}</Text>{narrow ? ' SLA' : ' past SLA'}</Box>\n                        </>\n                    )}\n                </Box>\n            </Box>\n\n            {grouped && (\n                <Box css={qs.toolbar}>\n                    <Box as=\"span\" css={qs.segLabel}>Group by</Box>\n                    {groupOptions.map(o => (\n                        <Box\n                            as=\"button\"\n                            key={o.key}\n                            css={{ ...chip({ tone: toolbar.groupKey === o.key ? 'brand' : 'neutral', size: 'sm' }), cursor: 'pointer' }}\n                            aria-pressed={toolbar.groupKey === o.key}\n                            onClick={() => setGroupKey(o.key)}\n                        >\n                            {o.label}\n                        </Box>\n                    ))}\n                    {collapsible && (\n                        <Box as=\"button\" css={qs.collapseAll} onClick={toggleAll}>\n                            {allCollapsed ? 'Expand all' : 'Collapse all'}\n                        </Box>\n                    )}\n                </Box>\n            )}\n\n            <Box\n                maxHeight={getSomeorUndefined(value.maxHeight)}\n                overflowY={value.maxHeight.type === 'some' ? 'auto' : undefined}\n            >\n                {grouped ? groups.map(g => {\n                    const isCollapsed = collapsible && g.label !== '' && toolbar.collapsed.includes(g.label);\n                    return (\n                        <Box key={g.label || '_flat'}>\n                            {g.label !== '' && (\n                                <GroupHead\n                                    group={g}\n                                    collapsible={collapsible}\n                                    collapsed={isCollapsed}\n                                    onToggle={toggleGroup}\n                                    acceptAll={g.bulk ? acceptAll : undefined}\n                                />\n                            )}\n                            {!isCollapsed && g.decisions.map(renderRow)}\n                        </Box>\n                    );\n                }) : (\n                    <>\n                        {active.map(renderRow)}\n                        <RoutineGroup routine={routine} acceptAll={acceptAll} leaving={exitingReasons} narrow={narrow} />\n                    </>\n                )}\n            </Box>\n        </Box>\n    );\n});\n\nimplementUIComponent(DecisionQueue.Component, EastChakraDecisionQueue);\n\nexport { EastChakraDecisionQueue };\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraDecisionJournal` — Chakra v3 renderer for the `DecisionJournal`\n * extension component declared in `@elaraai/e3-ui`: the resolved-cases\n * read-back. One row per judgement carrying a verdict, newest first — the\n * verdict (accepted / rejected / deferred / handoff), the case id, the\n * operator's captured knowledge as the rationale quote, injected constraints\n * as the meta line, and the resolution time on the right edge.\n *\n * @packageDocumentation\n */\n\nimport { memo, useMemo } from 'react';\nimport { Box, Text, useSlotRecipe } from '@chakra-ui/react';\nimport { type ValueTypeOf } from '@elaraai/east';\nimport { DecisionJournal } from '@elaraai/e3-ui/internal';\nimport { implementUIComponent, getSomeorUndefined, ClauseChip, useFormatters, type Formatters } from '@elaraai/east-ui-components';\n\nimport { useDecisionHandle, type Judgement, type Verdict } from './handle-runtime.js';\nimport { useConstraintContract } from './contract.js';\nimport { formatConstraint } from './constraint-format.js';\n\ntype DecisionJournalValue = ValueTypeOf<typeof DecisionJournal.Component.schema>;\n\ntype StatusTone = 'success' | 'danger' | 'warning' | 'neutral';\n\nfunction verdictPresentation(verdict: Verdict): { tone: StatusTone; verb: string; detail: string | null } {\n    switch (verdict.type) {\n        case 'accepted':\n            return { tone: 'success', verb: 'accepted', detail: verdict.value !== '' ? verdict.value : null };\n        case 'rejected':\n            return { tone: 'danger', verb: 'rejected', detail: null };\n        case 'deferred':\n            return { tone: 'neutral', verb: 'deferred', detail: verdict.value.type === 'some' ? verdict.value.value : null };\n        case 'handoff':\n            return { tone: 'warning', verb: 'handed off', detail: verdict.value !== '' ? verdict.value : null };\n    }\n}\n\n/** When a case was resolved — its UTC month, day and 24-hour time, in the app's locale (#850). */\nfunction formatResolvedAt(j: Judgement, words: Formatters): string | null {\n    if (j.resolvedAt.type !== 'some') return null;\n    const d = j.resolvedAt.value;\n    return `${words.monthDay(d)} · ${words.time(d)}`;\n}\n\nexport interface EastChakraDecisionJournalProps {\n    value: DecisionJournalValue;\n    storageKey: string;\n}\n\nconst EastChakraDecisionJournal = memo(function EastChakraDecisionJournal({ value }: EastChakraDecisionJournalProps) {\n    const eyebrow = useSlotRecipe({ key: 'eyebrowRow' });\n    const status = useSlotRecipe({ key: 'status' });\n    const es = eyebrow({});\n    const words = useFormatters();\n\n    const handle = useDecisionHandle(value.handle);\n    const heading = getSomeorUndefined(value.heading) ?? 'Decision journal';\n    const contract = useConstraintContract(value.handle);\n\n    const entries = useMemo(() => handle.journal ?? [], [handle.journal]);\n\n    return (\n        <Box borderWidth=\"1px\" borderColor=\"border.strong\" borderRadius=\"6px\" background=\"bg.canvas\" overflow=\"hidden\">\n            <Box css={es.root}>\n                <Box css={es.lbl}>{heading}</Box>\n                <Box css={es.meta}>\n                    {entries.length === 1 ? '1 entry' : `${words.number(entries.length)} entries`}\n                </Box>\n            </Box>\n\n            <Box\n                maxHeight={getSomeorUndefined(value.maxHeight)}\n                overflowY={value.maxHeight.type === 'some' ? 'auto' : undefined}\n            >\n            {entries.length === 0 ? (\n                <Text px=\"16px\" py=\"14px\" fontSize=\"13px\" color=\"fg.muted\">\n                    No resolved cases yet — verdicts land here as the queue clears.\n                </Text>\n            ) : entries.map((j, i) => {\n                const verdict = j.verdict.type === 'some' ? j.verdict.value : null;\n                if (!verdict) return null;\n                const { tone, verb, detail } = verdictPresentation(verdict);\n                const st = status({ status: tone, size: 'md' });\n                const when = formatResolvedAt(j, words);\n                const knowledge = j.knowledge.type === 'some' && j.knowledge.value !== '' ? j.knowledge.value : null;\n                return (\n                    <Box\n                        key={j.caseId}\n                        px=\"16px\"\n                        py=\"10px\"\n                        borderTopWidth={i === 0 ? undefined : '1px'}\n                        borderColor=\"border.subtle\"\n                        display=\"flex\"\n                        flexDirection=\"column\"\n                        gap=\"6px\"\n                    >\n                        <Box display=\"flex\" alignItems=\"baseline\" gap=\"10px\">\n                            <Box as=\"span\" css={st.root} flexShrink={0}>\n                                <Box as=\"span\" css={st.indicator} />\n                                <Box as=\"span\" css={st.label}>{verb}</Box>\n                            </Box>\n                            <Text as=\"span\" fontFamily=\"mono\" fontSize=\"12px\" color=\"fg.muted\">{j.caseId}</Text>\n                            {detail !== null && (\n                                <Text as=\"span\" fontSize=\"13px\" minW={0} flex=\"1\" truncate>{detail}</Text>\n                            )}\n                            {when !== null && (\n                                <Text as=\"span\" fontFamily=\"mono\" fontSize=\"11.5px\" color=\"fg.muted\" marginLeft=\"auto\" flexShrink={0}>\n                                    {when}\n                                </Text>\n                            )}\n                        </Box>\n                        {knowledge !== null && (\n                            <Text\n                                fontSize=\"12.5px\"\n                                fontStyle=\"italic\"\n                                color=\"fg.muted\"\n                                borderLeftWidth=\"2px\"\n                                borderColor=\"border.strong\"\n                                paddingLeft=\"10px\"\n                            >\n                                &ldquo;{knowledge}&rdquo;\n                            </Text>\n                        )}\n                        {j.constraints.length > 0 && (\n                            <Box display=\"flex\" gap=\"12px\" flexWrap=\"wrap\">\n                                {j.constraints.map((c, k) => {\n                                    const f = formatConstraint(c, contract, undefined, words);\n                                    return <ClauseChip key={k} field={f.lever} op={f.op} value={f.value} />;\n                                })}\n                            </Box>\n                        )}\n                    </Box>\n                );\n            })}\n            </Box>\n        </Box>\n    );\n});\n\nimplementUIComponent(DecisionJournal.Component, EastChakraDecisionJournal);\n\nexport { EastChakraDecisionJournal };\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Every word the Studio's renderers say themselves (#996, #997, #998, #1000) —\n * ONE typed message table: the builder's toolbar, its palette and its\n * placeholders; the inspector's section heads, its fields and its controls'\n * names, its footer, and what it says with nothing selected; the page\n * library's toolbar, pane, section heads and cards; the popovers that name a\n * new page or a template; the publish preview's bar, its aside and its\n * footer; and what a page says when it has nothing to draw. What the AUTHOR wrote — a component's name, key, reads and\n * description, a placement's title, a project's, a page's and an\n * environment's names, the audience and the rollout — is data, and never\n * passes through it.\n *\n * English is the default. A host overrides any subset for a subtree with\n * {@link StudioMessagesProvider}; numbers format in the locale react-aria's\n * `I18nProvider` above the app sets (the browser's otherwise).\n *\n * @packageDocumentation\n */\n\nimport { createContext, createElement, useContext, useMemo, type ReactNode } from \"react\";\n\n/**\n * The Studio's message table.\n *\n * @remarks\n * Numbers — `span`, `px`, the counts, a version's number — arrive already\n * formatted for the locale; `np`, `nt` and `n` are the raw counts, for plurals.\n */\nexport interface StudioMessages {\n    /** The builder toolbar's status: never published. */\n    statusDraft: () => string;\n    /** Published, its draft its live layout. */\n    statusLive: () => string;\n    /** Published, its draft changed since. */\n    statusLiveEdited: () => string;\n    /** A template is open. */\n    statusTemplate: () => string;\n    /** The builder toolbar's Publish. */\n    publish: () => string;\n    /** The ⋯ chip a row short of room folds Save as template, Preview and Publish into (#1229) — its accessible name. */\n    more: () => string;\n    /** Save as template in the ⋯ chip's menu, which opens its popover. */\n    saveAsTemplateItem: () => string;\n    /** The builder with no page of the project open — its heading. */\n    noPageOpen: () => string;\n    /** Under it, what to do. */\n    noPageOpenHint: (p: { project: string; page: string }) => string;\n    /** The palette's pane — its tab and its rail's name. */\n    components: () => string;\n    /** One component, and any other count — the palette's noun. */\n    componentNoun: () => { singular: string; plural: string };\n    /** One page, and any other count — the palette's noun. */\n    pageNoun: () => { singular: string; plural: string };\n    /** A palette card's lock. */\n    logicFixed: () => string;\n    /** The palette's grouping and filter facet. */\n    category: () => string;\n    /** The palette's tags facet. */\n    tags: () => string;\n    /** The palette's collections facet. */\n    collections: () => string;\n    /** The inspector's pane — its tab and its rail's name. */\n    inspector: () => string;\n    /** The inspector's rail badge — the selected placement's span, `8/12`. */\n    spanBadge: (p: { span: string }) => string;\n    /** A placement whose component the surface does not list — its heading. */\n    noComponent: (p: { key: string }) => string;\n    /** Under it. */\n    noComponentHint: () => string;\n    /** A placement whose key two listed components share — its heading. */\n    twoComponents: (p: { key: string }) => string;\n    /** Under it. */\n    twoComponentsHint: () => string;\n    /** A page whose live version is asked for before it is published — its heading. */\n    notPublished: (p: { page: string }) => string;\n    /** Under it. */\n    notPublishedHint: () => string;\n    /** A page the record does not hold — its heading. */\n    noPage: (p: { page: string }) => string;\n    /** Under it. */\n    noPageHint: (p: { project: string }) => string;\n    /** Blank grid's card — what it places. */\n    blankSummary: () => string;\n    /** A page card's count of placements — `3 components`. */\n    placements: (p: { n: number; count: string }) => string;\n    /** A page card's action. */\n    openInBuilder: () => string;\n    /** The Pages row's dashed last card. */\n    newPageFromTemplate: () => string;\n    /** The inspector's selection block — its eyebrow. */\n    selectedComponent: () => string;\n    /** The Data block's eyebrow. */\n    data: () => string;\n    /** A component whose code reads no dataset. */\n    readsNothing: () => string;\n    /** The Configuration block's eyebrow. */\n    configuration: () => string;\n    /** Beside it, what the lock says. */\n    fixedByDeveloper: () => string;\n    /** A component with no description. */\n    noDescription: () => string;\n    /** The Layout block's eyebrow. */\n    layout: () => string;\n    /** The span stepper's label. */\n    columnSpan: () => string;\n    /** The span as the stepper shows it — `8 / 12`. */\n    spanOf: (p: { span: string }) => string;\n    /** The stepper's minus button. */\n    decreaseSpan: () => string;\n    /** The stepper's plus button. */\n    increaseSpan: () => string;\n    /** The row field's label. */\n    row: () => string;\n    /** The height field's label. */\n    height: () => string;\n    /** A height that is its content's own. */\n    auto: () => string;\n    /** A height in px — `240 px`. */\n    px: (p: { px: string }) => string;\n    /** The alignment's label. */\n    align: () => string;\n    /** At the row's top. */\n    alignTop: () => string;\n    /** Centred in the row. */\n    alignCenter: () => string;\n    /** As tall as the row. */\n    alignStretch: () => string;\n    /** The inspector's footer. */\n    published: () => string;\n    /** The inspector with nothing selected — its heading. */\n    nothingSelected: () => string;\n    /** Under it, what to do. */\n    nothingSelectedHint: () => string;\n    /** The page library's search, counting what it searches — `Search 4 pages and 4 templates…`. */\n    searchLibrary: (p: { pages: string; templates: string; np: number; nt: number }) => string;\n    /** The search field's name. */\n    searchLabel: () => string;\n    /** The search's clear button. */\n    clearSearch: () => string;\n    /** The Sort menu's trigger. */\n    sortByName: () => string;\n    /** Name, A to Z. */\n    nameAz: () => string;\n    /** Name, Z to A. */\n    nameZa: () => string;\n    /** The primary action — `New page in Ops console`. */\n    newPageIn: (p: { project: string }) => string;\n    /** The primary action, folded, and the New page popover's head. */\n    newPage: () => string;\n    /** The pane's projects caption. */\n    projects: () => string;\n    /** The pane's pages caption, and the Pages section's head. */\n    pages: () => string;\n    /** The legend's live status. */\n    live: () => string;\n    /** The legend's draft status. */\n    draft: () => string;\n    /** The Templates section's head. */\n    templates: () => string;\n    /** Beside it. */\n    cloneToStart: () => string;\n    /** Beside the Pages head — `4 in Ops console`, or `1 of 4 in Ops console` while the search narrows. */\n    pagesIn: (p: { shown: string; total: string; project: string; narrowed: boolean }) => string;\n    /** The New page popover's name field. */\n    pageName: () => string;\n    /** Under it, while it is empty. */\n    pageNameMissing: () => string;\n    /** The New page popover's template field. */\n    template: () => string;\n    /** Blank grid — no template. */\n    blankGrid: () => string;\n    /** The New page popover's commit. */\n    createPage: () => string;\n    /** A popover's cancel. */\n    cancel: () => string;\n    /** A name the project holds already. */\n    nameTaken: (p: { name: string }) => string;\n    /** The builder toolbar's Save as template, and its popover's head. */\n    saveAsTemplate: () => string;\n    /** Its popover's name field. */\n    templateName: () => string;\n    /** Under it, while it is empty. */\n    templateNameMissing: () => string;\n    /** Its popover's commit. */\n    saveTemplate: () => string;\n    /** The name it offers — `Overview template`. */\n    templateNameFor: (p: { page: string }) => string;\n    /** Why it is disabled while a template is open. */\n    templateOpen: () => string;\n    /** The publish preview's bar — `● Preview`. */\n    preview: () => string;\n    /** The device strip's accessible name. */\n    devices: () => string;\n    /** The device the page is drawn for. */\n    device: (p: { device: \"desktop\" | \"tablet\" | \"mobile\" }) => string;\n    /** The Env pill's label, before the environment's name. */\n    env: () => string;\n    /** Back to the builder. */\n    exit: () => string;\n    /** The aside's head while there is something to publish. */\n    readyToPublish: () => string;\n    /** The aside's head while the page is live as it stands. */\n    upToDate: () => string;\n    /** The aside's head while a template is open. */\n    templateNotPublished: () => string;\n    /** A version — `v4`. */\n    version: (p: { version: string }) => string;\n    /** After the live version in the aside's head — `v4 live`. */\n    liveVersion: () => string;\n    /** After a template's name in the aside's head. */\n    templateKind: () => string;\n    /** The change list's head — `3 changes since v3`. */\n    changesSince: (p: { n: number; count: string; version: string }) => string;\n    /** The change list's head on a first publish — `3 changes · first version`. */\n    changesFirst: (p: { n: number; count: string }) => string;\n    /** The change list's head while nothing changed — `No changes since v4`. */\n    noChangesSince: (p: { version: string }) => string;\n    /** A change's verb, before the placement's name — `Added`, `Resized`. */\n    changeVerb: (p: { change: \"added\" | \"removed\" | \"moved\" | \"resized\" | \"height\" | \"aligned\" | \"retitled\" }) => string;\n    /** The Audience row's label. */\n    audience: () => string;\n    /** The Rollout row's label. */\n    rollout: () => string;\n    /** The footer's Apply. */\n    saveAsDraft: () => string;\n    /** The footer's publish — `Publish v4 to Staging`; with no environment, `Publish v4`; for a template, `Publish`. */\n    publishTo: (p: { version?: string | undefined; env?: string | undefined }) => string;\n    /** A phone's Components tab: what to do. */\n    phoneComponentsIntro: () => string;\n    /** A phone's Pages tab: what to do. */\n    phonePagesIntro: () => string;\n    /** A card's line once its component is on the page. */\n    phoneOnPage: () => string;\n    /** A phone's inspector's one tab. */\n    phoneDetails: () => string;\n    /** The strip's Inspector meta — `row 2`. */\n    phoneRowMeta: (p: { row: string }) => string;\n    /** The inspector's meta line — `row 2 · columns 1–8`. */\n    phoneWhere: (p: { row: string; first: string; last: string }) => string;\n    /** The inspector's Row readout — `2 of 3`. */\n    phoneRowOf: (p: { row: string; rows: string }) => string;\n    /** The inspector's Move. */\n    phoneMove: () => string;\n    /** Nothing selected on a phone: first. */\n    phoneNothingFirst: () => string;\n    /** Then. */\n    phoneNothingThen: () => string;\n    /** Save as template's help line on a phone. */\n    phoneTemplateHelp: (p: { project: string; page: string }) => string;\n    /** Back to the builder, from a phone's preview. */\n    phoneBack: () => string;\n    /** A phone's preview's Page tab. */\n    phonePage: () => string;\n    /** A phone's preview's Changes tab. */\n    phoneChanges: () => string;\n    /** Under Tablet or Desktop — `Desktop · 1,440 px · the layout, each tile by name`. */\n    phoneWireCaption: (p: { device: string; px: string }) => string;\n}\n\n/** The Studio's English messages — the default table. */\nexport const studioMessages: StudioMessages = {\n    statusDraft: () => \"Draft\",\n    statusLive: () => \"Live\",\n    statusLiveEdited: () => \"Live · edited\",\n    statusTemplate: () => \"Template\",\n    publish: () => \"Publish\",\n    more: () => \"More\",\n    saveAsTemplateItem: () => \"Save as template…\",\n    noPageOpen: () => \"No page open\",\n    noPageOpenHint: ({ project, page }) =>\n        `${project} has no page ${page}. Open a page from the palette's Pages tab, or start one from the page library.`,\n    components: () => \"Components\",\n    componentNoun: () => ({ singular: \"component\", plural: \"components\" }),\n    pageNoun: () => ({ singular: \"page\", plural: \"pages\" }),\n    logicFixed: () => \"Logic fixed by the developer\",\n    category: () => \"Category\",\n    tags: () => \"Tags\",\n    collections: () => \"Collections\",\n    inspector: () => \"Inspector\",\n    spanBadge: ({ span }) => `${span}/12`,\n    noComponent: ({ key }) => `No component \"${key}\"`,\n    noComponentHint: () => \"This surface lists no component with this key.\",\n    twoComponents: ({ key }) => `Two components share the key \"${key}\"`,\n    twoComponentsHint: () => \"A surface lists each component once.\",\n    notPublished: ({ page }) => `${page} is not published yet`,\n    notPublishedHint: () => \"Publish it to show it here.\",\n    noPage: ({ page }) => `No page ${page}`,\n    noPageHint: ({ project }) => `The project ${project} has no page by this name.`,\n    blankSummary: () => \"12-col · empty\",\n    placements: ({ n, count }) => `${count} ${n === 1 ? \"component\" : \"components\"}`,\n    openInBuilder: () => \"Open in builder →\",\n    newPageFromTemplate: () => \"New page from template\",\n    selectedComponent: () => \"Selected component\",\n    data: () => \"Data\",\n    readsNothing: () => \"reads no data\",\n    configuration: () => \"Configuration\",\n    fixedByDeveloper: () => \"fixed by developer\",\n    noDescription: () => \"No description\",\n    layout: () => \"Layout\",\n    columnSpan: () => \"Column span\",\n    spanOf: ({ span }) => `${span} / 12`,\n    decreaseSpan: () => \"Decrease span\",\n    increaseSpan: () => \"Increase span\",\n    row: () => \"Row\",\n    height: () => \"Height\",\n    auto: () => \"Auto\",\n    px: ({ px }) => `${px} px`,\n    align: () => \"Align\",\n    alignTop: () => \"Top\",\n    alignCenter: () => \"Center\",\n    alignStretch: () => \"Stretch\",\n    published: () => \"Published component · logic immutable\",\n    nothingSelected: () => \"Nothing selected\",\n    nothingSelectedHint: () => \"Click a component on the grid to see what it reads and its layout.\",\n    searchLibrary: ({ pages, templates, np, nt }) =>\n        `Search ${pages} ${np === 1 ? \"page\" : \"pages\"} and ${templates} ${nt === 1 ? \"template\" : \"templates\"}…`,\n    searchLabel: () => \"Search pages and templates\",\n    clearSearch: () => \"Clear search\",\n    sortByName: () => \"Sort · Name\",\n    nameAz: () => \"Name A–Z\",\n    nameZa: () => \"Name Z–A\",\n    newPageIn: ({ project }) => `New page in ${project}`,\n    newPage: () => \"New page\",\n    projects: () => \"Projects\",\n    pages: () => \"Pages\",\n    live: () => \"Live\",\n    draft: () => \"Draft\",\n    templates: () => \"Templates\",\n    cloneToStart: () => \"clone to start a page\",\n    pagesIn: ({ shown, total, project, narrowed }) => (narrowed ? `${shown} of ${total} in ${project}` : `${total} in ${project}`),\n    pageName: () => \"Page name\",\n    pageNameMissing: () => \"Give the page a name to create it.\",\n    template: () => \"Template\",\n    blankGrid: () => \"Blank grid\",\n    createPage: () => \"Create page\",\n    cancel: () => \"Cancel\",\n    nameTaken: ({ name }) => `${name} is already a page or a template here.`,\n    saveAsTemplate: () => \"Save as template\",\n    templateName: () => \"Template name\",\n    templateNameMissing: () => \"Give the template a name to save it.\",\n    saveTemplate: () => \"Save template\",\n    templateNameFor: ({ page }) => `${page} template`,\n    templateOpen: () => \"A template is open — open a page to save it as a template\",\n    preview: () => \"Preview\",\n    devices: () => \"Device\",\n    device: ({ device }) => (device === \"desktop\" ? \"Desktop\" : device === \"tablet\" ? \"Tablet\" : \"Mobile\"),\n    env: () => \"Env\",\n    exit: () => \"Exit\",\n    readyToPublish: () => \"Ready to publish\",\n    upToDate: () => \"Up to date\",\n    templateNotPublished: () => \"Templates are not published\",\n    version: ({ version }) => `v${version}`,\n    liveVersion: () => \"live\",\n    templateKind: () => \"template\",\n    changesSince: ({ n, count, version }) => `${count} ${n === 1 ? \"change\" : \"changes\"} since ${version}`,\n    changesFirst: ({ n, count }) => `${count} ${n === 1 ? \"change\" : \"changes\"} · first version`,\n    noChangesSince: ({ version }) => `No changes since ${version}`,\n    changeVerb: ({ change }) => {\n        switch (change) {\n            case \"added\": return \"Added\";\n            case \"removed\": return \"Removed\";\n            case \"moved\": return \"Moved\";\n            case \"resized\": case \"height\": return \"Resized\";\n            case \"aligned\": return \"Aligned\";\n            case \"retitled\": return \"Retitled\";\n        }\n    },\n    audience: () => \"Audience\",\n    rollout: () => \"Rollout\",\n    saveAsDraft: () => \"Save as draft\",\n    publishTo: ({ version, env }) => (version === undefined ? \"Publish\" : env === undefined ? `Publish ${version}` : `Publish ${version} to ${env}`),\n    phoneComponentsIntro: () => \"Tap a component, then tap where it goes on the page. On desktop you drag it onto the grid.\",\n    phonePagesIntro: () => \"Tap a page to open it in the builder.\",\n    phoneOnPage: () => \"on page\",\n    phoneDetails: () => \"Details\",\n    phoneRowMeta: ({ row }) => `row ${row}`,\n    phoneWhere: ({ row, first, last }) => `row ${row} · columns ${first}–${last}`,\n    phoneRowOf: ({ row, rows }) => `${row} of ${rows}`,\n    phoneMove: () => \"Move\",\n    phoneNothingFirst: () => \"Tap a tile on the page to see what it reads and its layout.\",\n    phoneNothingThen: () => \"Open Components to add one.\",\n    phoneTemplateHelp: ({ project, page }) => `Joins ${project}'s templates. ${page} stays as it is.`,\n    phoneBack: () => \"Back to the builder\",\n    phonePage: () => \"Page\",\n    phoneChanges: () => \"Changes\",\n    phoneWireCaption: ({ device, px }) => `${device} · ${px} px · the layout, each tile by name`,\n};\n\nconst StudioMessagesContext = createContext<StudioMessages>(studioMessages);\n\n/**\n * The message table in effect — {@link studioMessages} with every\n * {@link StudioMessagesProvider} above overriding it.\n *\n * @returns The table\n */\nexport function useStudioMessages(): StudioMessages {\n    return useContext(StudioMessagesContext);\n}\n\n/** Props of {@link StudioMessagesProvider}. */\nexport interface StudioMessagesProviderProps {\n    /** The messages to override — any subset; the rest come from the table above. */\n    messages: Partial<StudioMessages>;\n    /** The subtree the overrides apply to. */\n    children?: ReactNode;\n}\n\n/**\n * Override the Studio's words for a subtree — a translation, or a house style.\n * Providers nest: each overrides the table the one above it resolved.\n *\n * @remarks\n * The overrides are read by identity: define them once (module scope, or a\n * memo), as below.\n *\n * @param props - The overrides and the subtree\n * @returns The provider\n *\n * @example\n * ```tsx\n * const GERMAN: Partial<StudioMessages> = {\n *     nothingSelected: () => \"Nichts ausgewählt\",\n *     columnSpan: () => \"Spaltenbreite\",\n * };\n *\n * <I18nProvider locale=\"de-DE\">\n *     <StudioMessagesProvider messages={GERMAN}>\n *         <EastChakraComponent value={builder} />\n *     </StudioMessagesProvider>\n * </I18nProvider>\n * ```\n */\nexport function StudioMessagesProvider({ messages, children }: StudioMessagesProviderProps) {\n    const parent = useStudioMessages();\n    const value = useMemo(() => ({ ...parent, ...messages }), [parent, messages]);\n    return createElement(StudioMessagesContext.Provider, { value }, children);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `StudioInspector` — the builder's inspector (#996), the body of its pane\n * after the canvas, under the pane's tab row. It draws the selected placement\n * East computed — its name and key, what it reads (each named in words,\n * never a keypath), its description, its layout — and sends every layout\n * edit through `onRequest`, which asks the canvas for it; the canvas takes it\n * as one gesture of the page's session, and the placement comes back drawn\n * anew.\n *\n * Its layout is the `studioInspector` recipe's; its controls are the theme's\n * shared ones — the brand `stepper` for the span, the numeric `input` for the\n * row, the `select` for the height — its chevron and check Font Awesome's\n * (#1263) — and the `seg` strip for the alignment.\n *\n * In a phone's frame (`Studio Mobile Spec.md` ST24–ST26) its sections stay and\n * its layout is at touch size: the span stepper as the tile bar's, Row a readout\n * with Move, which starts placing, Height a view of its options, and Align three\n * 48 segments. With nothing selected, a checklist that says tap.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useId, useMemo, useState, type KeyboardEvent } from \"react\";\nimport {\n    Box, chakra, createListCollection, Portal, Select as ChakraSelect, useRecipe, useSlotRecipe, type SystemStyleObject,\n} from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n    faArrowsToDot, faArrowsUpDown, faArrowsUpToLine, faCheck, faChevronDown, faLock, faMinus, faPlus, faUpDownLeftRight,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { none, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { StudioInspectorPayloadType } from \"@elaraai/e3-ui/internal\";\nimport { SliceEditPopover, useFormatters } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\n\nimport { useStudioMessages, type StudioMessages } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The inspector, as the builder draws it. */\ntype StudioInspectorValue = ValueTypeOf<typeof StudioInspectorPayloadType>;\n/** The selected placement, as East computed it. */\ntype Selection = Extract<StudioInspectorValue[\"selection\"], { type: \"some\" }>[\"value\"];\n/** A change asked of the canvas. */\ntype Change = Parameters<StudioInspectorValue[\"onRequest\"]>[0][\"change\"];\n/** Where a placement sits in a taller row. */\ntype Align = Selection[\"layout\"][\"align\"][\"type\"];\n\n/** The least span the canvas leaves a tile — the stepper's floor. */\nconst LEAST_SPAN = 2;\n/** The heights the Height select offers, in px, after Auto. */\nconst HEIGHTS = [160, 240, 320, 400, 480];\n/** The alignments, in the strip's order, with their icons. */\nconst ALIGNS = [\n    { align: \"top\", icon: faArrowsUpToLine, name: (m: StudioMessages) => m.alignTop() },\n    { align: \"center\", icon: faArrowsToDot, name: (m: StudioMessages) => m.alignCenter() },\n    { align: \"stretch\", icon: faArrowsUpDown, name: (m: StudioMessages) => m.alignStretch() },\n] as const;\n\n/** Props of {@link StudioInspector}. */\nexport interface StudioInspectorProps {\n    /** The selected placement, and where a layout edit goes. */\n    value: StudioInspectorValue;\n    /** In a phone's frame: where the placement stands, whether its span is drafted, and what Move does. */\n    phone?: { rows: number; first: number; dirty: boolean; onMove: (key: string) => void } | undefined;\n}\n\n/**\n * The placement's row, as a field: Enter or leaving it asks for the row\n * typed; Esc puts the row back; ↑ / ↓ step to the next row or the one before.\n */\nfunction RowField({ row, onRow, css, id }: { row: number; onRow: (row: number) => void; css: SystemStyleObject[]; id: string }) {\n    const [text, setText] = useState(String(row));\n    useEffect(() => { setText(String(row)); }, [row]);\n    const commit = () => {\n        const asked = Number.parseInt(text, 10);\n        if (!Number.isInteger(asked) || asked < 1 || asked === row) {\n            setText(String(row));\n            return;\n        }\n        onRow(asked);\n    };\n    const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n        if (e.key === \"Enter\") {\n            e.preventDefault();\n            commit();\n        } else if (e.key === \"Escape\") {\n            e.preventDefault();\n            setText(String(row));\n        } else if (e.key === \"ArrowUp\") {\n            e.preventDefault();\n            onRow(row + 1);\n        } else if (e.key === \"ArrowDown\" && row > 1) {\n            e.preventDefault();\n            onRow(row - 1);\n        }\n    };\n    return (\n        <chakra.input\n            id={id}\n            css={css}\n            value={text}\n            inputMode=\"numeric\"\n            autoComplete=\"off\"\n            data-inspector-row=\"\"\n            onChange={(e) => setText(e.target.value.replace(/[^0-9]/g, \"\"))}\n            onBlur={commit}\n            onKeyDown={onKeyDown}\n        />\n    );\n}\n\n/**\n * Renders the builder's inspector body — see the module docs.\n *\n * @param props - The selected placement, and where a layout edit goes\n * @returns The inspector's body\n */\nexport const StudioInspector = memo(function StudioInspector({ value, phone }: StudioInspectorProps) {\n    const styles = useSlotRecipe({ key: \"studioInspector\" })() as Styles;\n    const ps = useSlotStyles(\"studioPhone\");\n    const grid = useSlotStyles(\"snapGridPhone\");\n    const [picking, setPicking] = useState(false);\n    const stepper = useSlotRecipe({ key: \"stepper\" })({ tone: \"brand\", size: \"md\" }) as Styles;\n    const seg = useSlotRecipe({ key: \"seg\" })() as Styles;\n    const input = useRecipe({ key: \"input\" })({ variant: \"numeric\", size: \"sm\" }) as SystemStyleObject;\n    const m = useStudioMessages();\n    const words = useFormatters();\n    const rowId = useId();\n    const selection = value.selection.type === \"some\" ? value.selection.value : undefined;\n    const onRequest = value.onRequest;\n    const key = selection?.key;\n    const ask = useCallback((change: Change) => {\n        if (key === undefined) return;\n        try {\n            onRequest({ key, change });\n        } catch (err) {\n            console.error(\"[Studio.Builder] the inspector's layout request failed:\", err);\n        }\n    }, [key, onRequest]);\n\n    const height = selection !== undefined && selection.layout.height.type === \"some\" ? Number(selection.layout.height.value) : undefined;\n    // Auto and the presets — and a height a drag left between them, where it is.\n    // Each item carries its height, so a pick is never read back from its text.\n    const heights = useMemo(() => createListCollection({\n        items: [\n            { value: \"auto\", label: m.auto(), px: undefined },\n            ...[...new Set([...HEIGHTS, ...(height !== undefined ? [height] : [])])].sort((a, b) => a - b)\n                .map((px) => ({ value: String(px), label: m.px({ px: words.bare(px) }), px })),\n        ],\n    }), [height, m, words]);\n\n    if (selection === undefined && phone !== undefined) {\n        return (\n            <Box css={styles.root} data-studio-inspector=\"\">\n                <Box css={ps.inspectorEmpty} data-inspector=\"empty\">\n                    <Box as=\"span\" css={ps.inspectorEmptyGlyph} aria-hidden />\n                    <Box as=\"span\" css={ps.inspectorEmptyTitle}>{m.nothingSelected()}</Box>\n                    <Box as=\"ul\" css={ps.inspectorEmptyList}><li>{m.phoneNothingFirst()}</li><li>{m.phoneNothingThen()}</li></Box>\n                </Box>\n            </Box>\n        );\n    }\n    if (selection === undefined) {\n        return (\n            <Box css={styles.root} data-studio-inspector=\"\">\n                <Box css={styles.empty} data-inspector=\"empty\">\n                    <Box as=\"span\" css={styles.emptyTitle}>{m.nothingSelected()}</Box>\n                    <Box as=\"span\" css={styles.emptyHint}>{m.nothingSelectedHint()}</Box>\n                </Box>\n            </Box>\n        );\n    }\n\n    const layout = selection.layout;\n    const span = Number(layout.span);\n    const most = Number(layout.most);\n    const description = selection.description.type === \"some\" ? selection.description.value : undefined;\n    const aligned: Align = layout.align.type;\n    const heightKey = height === undefined ? \"auto\" : String(height);\n\n    return (\n        <Box css={styles.root} data-studio-inspector=\"\">\n            <Box css={styles.selection} data-inspector=\"selection\">\n                <Box as=\"span\" css={styles.eyebrow}>{m.selectedComponent()}</Box>\n                <Box as=\"span\" css={styles.name} data-inspector-name=\"\">{selection.name}</Box>\n                {phone !== undefined && <Box as=\"span\" css={ps.meta} data-inspector-where=\"\">{m.phoneWhere({ row: words.number(Number(layout.row)), first: words.number(phone.first), last: words.number(phone.first + span - 1) })}</Box>}\n            </Box>\n            <Box css={styles.data} data-inspector=\"data\">\n                <Box as=\"span\" css={styles.eyebrow}>{m.data()}</Box>\n                {selection.reads.length > 0 ? (\n                    <Box as=\"ul\" css={styles.reads} aria-label={m.data()}>\n                        {selection.reads.map((name, at) => <Box as=\"li\" key={at} css={styles.read}>{name}</Box>)}\n                    </Box>\n                ) : (\n                    <Box as=\"span\" css={styles.noReads}>{m.readsNothing()}</Box>\n                )}\n            </Box>\n            <Box css={styles.config} data-inspector=\"config\">\n                <Box css={styles.configHead}>\n                    <Box as=\"span\" css={styles.eyebrow}>{m.configuration()}</Box>\n                    <Box as=\"span\" css={styles.lockNote}>\n                        <FontAwesomeIcon icon={faLock} />\n                        {m.fixedByDeveloper()}\n                    </Box>\n                </Box>\n                <Box as=\"p\" css={styles.description} data-empty={description === undefined ? \"\" : undefined}>\n                    {description ?? m.noDescription()}\n                </Box>\n            </Box>\n            <Box css={styles.layout} data-inspector=\"layout\">\n                <Box as=\"span\" css={styles.eyebrow}>{m.layout()}</Box>\n                {phone !== undefined ? (\n                    <Box css={ps.layoutRows} data-inspector-phone=\"\">\n                        <Box css={ps.layoutRow}>\n                            <Box as=\"span\" css={ps.layoutLabel}>{m.columnSpan()}</Box>\n                            <Box css={grid.stepper} role=\"group\" aria-label={m.columnSpan()}>\n                                <chakra.button type=\"button\" css={grid.stepperButton} aria-label={m.decreaseSpan()} disabled={span <= LEAST_SPAN} onClick={() => ask(variant(\"span\", BigInt(span - 1)))}><FontAwesomeIcon icon={faMinus} /></chakra.button>\n                                <Box as=\"output\" css={grid.stepperValue} data-dirty={phone.dirty ? \"\" : undefined} data-inspector-span=\"\">{m.spanOf({ span: words.number(span) })}</Box>\n                                <chakra.button type=\"button\" css={grid.stepperButton} aria-label={m.increaseSpan()} disabled={span >= most} onClick={() => ask(variant(\"span\", BigInt(span + 1)))}><FontAwesomeIcon icon={faPlus} /></chakra.button>\n                            </Box>\n                        </Box>\n                        <Box css={ps.layoutRow}>\n                            <Box as=\"span\" css={ps.layoutLabel}>{m.row()}</Box>\n                            <Box css={ps.rowControl}>\n                                <Box as=\"span\" css={ps.rowValue} data-inspector-row=\"\">{m.phoneRowOf({ row: words.number(Number(layout.row)), rows: words.number(phone.rows) })}</Box>\n                                <chakra.button type=\"button\" css={ps.move} data-inspector-move=\"\" onClick={() => phone.onMove(selection.key)}><FontAwesomeIcon icon={faUpDownLeftRight} aria-hidden />{m.phoneMove()}</chakra.button>\n                            </Box>\n                        </Box>\n                        <Box css={ps.layoutRow}>\n                            <Box as=\"span\" css={ps.layoutLabel}>{m.height()}</Box>\n                            <SliceEditPopover open={picking} onOpenChange={setPicking} label={m.height()}\n                                trigger={<chakra.button type=\"button\" css={ps.heightTrigger} aria-label={m.height()} data-inspector-height=\"\"><span>{heights.items.find((item) => item.value === heightKey)?.label}</span><FontAwesomeIcon icon={faChevronDown} aria-hidden /></chakra.button>}>\n                                <Box css={ps.heights} role=\"listbox\" aria-label={m.height()} data-inspector-heights=\"\">\n                                    {heights.items.map((item) => (\n                                        <chakra.button key={item.value} type=\"button\" css={ps.heightRow} role=\"option\" aria-selected={item.value === heightKey} onClick={() => {\n                                            setPicking(false);\n                                            if (item.value !== heightKey) ask(variant(\"height\", item.px === undefined ? none : some(BigInt(item.px))));\n                                        }}>{item.label}{item.value === heightKey && <FontAwesomeIcon icon={faCheck} aria-hidden />}</chakra.button>\n                                    ))}\n                                </Box>\n                            </SliceEditPopover>\n                        </Box>\n                        <Box css={ps.layoutRow}>\n                            <Box as=\"span\" css={ps.layoutLabel}>{m.align()}</Box>\n                            <Box css={ps.alignSeg} role=\"group\" aria-label={m.align()}>\n                                {ALIGNS.map(({ align, icon, name }) => (\n                                    <chakra.button key={align} type=\"button\" css={ps.alignItem} data-state={aligned === align ? \"on\" : \"off\"} aria-pressed={aligned === align} aria-label={name(m)}\n                                        onClick={() => ask(variant(\"align\", variant(align, null)))}><FontAwesomeIcon icon={icon} /></chakra.button>\n                                ))}\n                            </Box>\n                        </Box>\n                    </Box>\n                ) : <>\n                <Box css={styles.field}>\n                    <Box as=\"span\" css={styles.fieldLabel}>{m.columnSpan()}</Box>\n                    <Box css={stepper.root} role=\"group\" aria-label={m.columnSpan()}>\n                        <chakra.button type=\"button\" css={stepper.button} aria-label={m.decreaseSpan()} title={m.decreaseSpan()}\n                            disabled={span <= LEAST_SPAN} onClick={() => ask(variant(\"span\", BigInt(span - 1)))}>\n                            <FontAwesomeIcon icon={faMinus} />\n                        </chakra.button>\n                        <Box as=\"output\" css={stepper.value} data-inspector-span=\"\">{m.spanOf({ span: words.number(span) })}</Box>\n                        <chakra.button type=\"button\" css={stepper.button} aria-label={m.increaseSpan()} title={m.increaseSpan()}\n                            disabled={span >= most} onClick={() => ask(variant(\"span\", BigInt(span + 1)))}>\n                            <FontAwesomeIcon icon={faPlus} />\n                        </chakra.button>\n                    </Box>\n                </Box>\n                <Box css={styles.field}>\n                    <chakra.label css={styles.fieldLabel} htmlFor={rowId}>{m.row()}</chakra.label>\n                    <RowField row={Number(layout.row)} onRow={(row) => ask(variant(\"row\", BigInt(row)))} css={[input, styles.rowField!]} id={rowId} />\n                </Box>\n                <Box css={styles.field}>\n                    <Box as=\"span\" css={styles.fieldLabel}>{m.height()}</Box>\n                    <ChakraSelect.Root\n                        collection={heights}\n                        value={[heightKey]}\n                        size=\"sm\"\n                        variant=\"numeric\"\n                        css={styles.heightField}\n                        onValueChange={(details) => {\n                            const picked = heights.items.find((item) => item.value === details.value[0]);\n                            if (picked === undefined || picked.value === heightKey) return;\n                            const px = picked.px;\n                            queueMicrotask(() => ask(variant(\"height\", px === undefined ? none : some(BigInt(px)))));\n                        }}\n                    >\n                        <ChakraSelect.HiddenSelect />\n                        <ChakraSelect.Control>\n                            <ChakraSelect.Trigger aria-label={m.height()} data-inspector-height=\"\">\n                                <ChakraSelect.ValueText />\n                            </ChakraSelect.Trigger>\n                            <ChakraSelect.IndicatorGroup>\n                                <ChakraSelect.Indicator><FontAwesomeIcon icon={faChevronDown} /></ChakraSelect.Indicator>\n                            </ChakraSelect.IndicatorGroup>\n                        </ChakraSelect.Control>\n                        <Portal>\n                            <ChakraSelect.Positioner>\n                                <ChakraSelect.Content>\n                                    {heights.items.map((item) => (\n                                        <ChakraSelect.Item key={item.value} item={item}>\n                                            {item.label}\n                                            <ChakraSelect.ItemIndicator><FontAwesomeIcon icon={faCheck} /></ChakraSelect.ItemIndicator>\n                                        </ChakraSelect.Item>\n                                    ))}\n                                </ChakraSelect.Content>\n                            </ChakraSelect.Positioner>\n                        </Portal>\n                    </ChakraSelect.Root>\n                </Box>\n                <Box css={styles.field}>\n                    <Box as=\"span\" css={styles.fieldLabel}>{m.align()}</Box>\n                    <Box css={seg.root} role=\"group\" aria-label={m.align()}>\n                        {ALIGNS.map(({ align, icon, name }) => (\n                            <chakra.button key={align} type=\"button\" css={seg.item} data-state={aligned === align ? \"on\" : \"off\"}\n                                aria-pressed={aligned === align} aria-label={name(m)} title={name(m)}\n                                onClick={() => ask(variant(\"align\", variant(align, null)))}>\n                                <FontAwesomeIcon icon={icon} />\n                            </chakra.button>\n                        ))}\n                    </Box>\n                </Box>\n                </>}\n            </Box>\n            <Box css={styles.footer} data-inspector=\"footer\">\n                <FontAwesomeIcon icon={faLock} />\n                {m.published()}\n            </Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The page open in a builder (#1000) — held in the UI store under the\n * builder's key (`builderKeys(id).page`), where `State.bind` keeps its State,\n * so a builder and a page library with the same `id` open one page together.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport { decodeBeast2For, encodeBeast2For, type ValueTypeOf } from \"@elaraai/east\";\nimport { StudioKeyType } from \"@elaraai/e3-ui/internal\";\nimport { StateRuntime } from \"@elaraai/east-ui-components\";\n\n/** A page's key. */\nexport type StudioKey = ValueTypeOf<typeof StudioKeyType>;\n\nconst encodeKey = encodeBeast2For(StudioKeyType);\nconst decodeKey = decodeBeast2For(StudioKeyType);\n\n/**\n * The page open in the builder the key names, and a way to open another.\n *\n * @param key - The builder's open-page key\n * @param first - The page it opens before any is written — its project's first\n * @returns The open page, and the write that opens another\n */\nexport function useOpenPage(key: string, first: StudioKey): [StudioKey, (next: StudioKey) => void] {\n    const store = StateRuntime.getStore();\n    const subscribe = useCallback((notify: () => void) => store.subscribe(key, notify), [store, key]);\n    const snapshot = useCallback(() => store.read(key), [store, key]);\n    const bytes = useSyncExternalStore(subscribe, snapshot);\n    const open = useMemo(() => (bytes === undefined ? first : decodeKey(bytes)), [bytes, first]);\n    const write = useCallback((next: StudioKey) => { store.write(key, encodeKey(next)); }, [store, key]);\n    return [open, write];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraStudioPage` — the renderer of the `StudioPage` extension declared\n * in `@elaraai/e3-ui` (#993): one page's live or draft layout on the snap\n * grid, each placement its component's own UI, and what a page says when it\n * has nothing to draw — a page the record does not hold, or a live version\n * not yet published.\n *\n * {@link StudioLayout} draws a layout's placements — the page's, and the\n * builder's publish preview's. A placement renders its component's function,\n * re-run when what it read changes; a frameless component (`frame: \"none\"`)\n * is bare; a placement whose component the surface does not list is a\n * placeholder naming its key, and one whose key two listed components share\n * is an error naming it.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useMemo } from \"react\";\nimport { equalFor, equivalentFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { StudioCellType, StudioComponentType, StudioEntryType, StudioKeyType, StudioPageComponent } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView,\n    EastChakraComponent,\n    EmptyStateView,\n    SnapGridTiles,\n    implementUIComponent,\n    useTrackedEvaluation,\n    type SnapGridLayoutCell,\n} from \"@elaraai/east-ui-components\";\n\nimport { useStudioMessages } from \"./messages.js\";\n\n/** The renderer's payload, decoded. */\ntype StudioPageValue = ValueTypeOf<typeof StudioPageComponent.schema>;\n/** A listed component. */\ntype Component = ValueTypeOf<typeof StudioComponentType>;\n/** One placement. */\ntype Cell = ValueTypeOf<typeof StudioCellType>;\n/** One entry of the pages record. */\ntype Entry = ValueTypeOf<typeof StudioEntryType>;\n\nconst pageEqual = equivalentFor(StudioPageComponent.schema);\nconst keyEqual = equalFor(StudioKeyType);\n\n/** Props of {@link StudioComponentView}. */\ninterface StudioComponentViewProps {\n    /** The component. */\n    component: Component;\n    /** Where its UI keeps its state. */\n    storageKey: string;\n}\n\n/**\n * A listed component's own UI: its function, re-run when what it read\n * changes; what it threw, when it throws.\n */\nfunction StudioComponentView({ component, storageKey }: StudioComponentViewProps) {\n    const render = useCallback(() => component.render(), [component]);\n    const { result } = useTrackedEvaluation(render);\n    if (!result.ok) {\n        const message = result.error instanceof Error ? result.error.message : String(result.error);\n        return <BannerView status=\"error\" title={component.name} description={message} />;\n    }\n    return <EastChakraComponent value={result.value} storageKey={storageKey} />;\n}\n\n/** Props of {@link StudioPlacement}. */\nexport interface StudioPlacementProps {\n    /** The key of the component it places. */\n    component: string;\n    /** The listed components under that key — one, when the surface lists it once. */\n    listed: readonly Component[];\n    /** Where its component's UI keeps its state. */\n    storageKey: string;\n}\n\n/**\n * One placement's content: its component's own UI; a placeholder naming its\n * component's key when the surface lists none under it; an error naming the\n * key when two listed components share it.\n *\n * @param props - The component's key and the components listed under it\n * @returns The content\n */\nexport function StudioPlacement({ component: key, listed, storageKey }: StudioPlacementProps) {\n    const m = useStudioMessages();\n    if (listed.length > 1) {\n        return <BannerView status=\"error\" title={m.twoComponents({ key })} description={m.twoComponentsHint()} />;\n    }\n    const component = listed[0];\n    if (component === undefined) {\n        return (\n            <EmptyStateView icon={{ prefix: \"fas\", name: \"puzzle-piece\" }}\n                title={m.noComponent({ key })} description={m.noComponentHint()} />\n        );\n    }\n    return <StudioComponentView component={component} storageKey={storageKey} />;\n}\n\n/** Props of {@link StudioLayout}. */\nexport interface StudioLayoutProps {\n    /** The layout's placements, in order. */\n    cells: readonly Cell[];\n    /** The components the surface lists. */\n    components: readonly Component[];\n    /** Where its placements' UIs keep their state. */\n    storageKey: string;\n}\n\n/**\n * A layout's placements on the snap grid, each its component's own UI — a\n * frameless component bare, a placement the surface cannot draw its\n * placeholder, in a tile. Under a narrow container the tiles stack in row\n * order.\n *\n * @param props - The placements and the listed components\n * @returns The grid\n */\nexport function StudioLayout({ cells, components, storageKey }: StudioLayoutProps) {\n    // The listed components under each key — more than one is an error.\n    const listed = useMemo(() => {\n        const byKey = new Map<string, Component[]>();\n        for (const component of components) {\n            const same = byKey.get(component.key);\n            if (same === undefined) byKey.set(component.key, [component]);\n            else same.push(component);\n        }\n        return byKey;\n    }, [components]);\n    const tiles = useMemo(() => cells.map((cell): SnapGridLayoutCell & { cell: Cell } => {\n        const first = listed.get(cell.component)?.[0];\n        return {\n            key: cell.key,\n            row: cell.row,\n            span: cell.span,\n            height: cell.height,\n            align: cell.align,\n            frame: first === undefined ? true : first.frame.type === \"card\",\n            cell,\n        };\n    }), [cells, listed]);\n    return (\n        <SnapGridTiles\n            cells={tiles}\n            content={(tile) => (\n                <StudioPlacement component={tile.cell.component} listed={listed.get(tile.cell.component) ?? []} storageKey={`${storageKey}.${tile.key}`} />\n            )}\n        />\n    );\n}\n\n/** Props of {@link EastChakraStudioPage}. */\nexport interface EastChakraStudioPageProps {\n    /** The payload, decoded. */\n    value: StudioPageValue;\n    /** The structural storage key. */\n    storageKey: string;\n}\n\n/**\n * Renders one page — see the module docs.\n *\n * @param props - The payload and its storage key\n * @returns The page\n */\nexport const EastChakraStudioPage = memo(function EastChakraStudioPage({ value, storageKey }: EastChakraStudioPageProps) {\n    const m = useStudioMessages();\n    const key = value.page;\n    // The record's key order is its own: the entry is found by the key's value.\n    let entry: Entry | undefined;\n    for (const [at, found] of value.pages) {\n        if (keyEqual(at, key)) {\n            entry = found;\n            break;\n        }\n    }\n    if (entry === undefined) {\n        return (\n            <EmptyStateView icon={{ prefix: \"fas\", name: \"file-circle-question\" }}\n                title={m.noPage({ page: key.page })} description={m.noPageHint({ project: key.project })} />\n        );\n    }\n    const layout = entry.type === \"template\" ? entry.value\n        : value.version.type === \"draft\" ? entry.value.draft\n            : entry.value.live.type === \"some\" ? entry.value.live.value.page : undefined;\n    if (layout === undefined) {\n        return (\n            <EmptyStateView icon={{ prefix: \"fas\", name: \"file-circle-question\" }}\n                title={m.notPublished({ page: key.page })} description={m.notPublishedHint()} />\n        );\n    }\n    return <StudioLayout cells={layout.cells} components={value.components} storageKey={storageKey} />;\n}, (prev, next) => pageEqual(prev.value, next.value) && prev.storageKey === next.storageKey);\n\nimplementUIComponent(StudioPageComponent, EastChakraStudioPage);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `useStudioPalette` — the builder's palette (#994), the pane before the\n * canvas: the components a surface lists, grouped by category, and the\n * project's pages, each a tab of one pane.\n *\n * - **Components.** Every listed component but the deprecated, in the\n *   surface's order, grouped by category, with a Filter menu over category,\n *   tags and collections. A card shows the component's icon, its name, the\n *   datasets its code reads, and a lock — what it shows is fixed by its\n *   developer. A card drags onto the canvas, which takes cards from the\n *   components library's id. The component the canvas has selected is\n *   placed, `ON CANVAS · ×N`; a click selects its first placement.\n * - **Pages.** The project's pages in key order, each with its status, and a\n *   status dot. The open page is placed; a click opens a page.\n * - **Collapsed**, the pane is a rail: the expand control, its icon, the\n *   number of components and its name.\n *\n * What a card says is East's (`paletteCards`, `palettePages`). The palette is\n * a pane description: the canvas's builder frame draws it (#1125), `auto` —\n * pinned beside the canvas on a desktop, over it on a narrow screen — and\n * each tab is the Library's.\n *\n * On a phone (`Studio Mobile Spec.md` ST22, ST23) each tab opens with a line of\n * what to do; a card has no grip, and a tap on it starts placing it; a card says\n * when its component is on the page.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { none, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { PaletteCardType, PalettePageType, StudioComponentType } from \"@elaraai/e3-ui/internal\";\nimport {\n    EastChakraLibrary,\n    useFormatters,\n    type BuilderFrameDock,\n    type LibraryItemValue,\n    type LibraryValue,\n} from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\n\nimport { useStudioMessages } from \"./messages.js\";\n\n/** A listed component. */\ntype Component = ValueTypeOf<typeof StudioComponentType>;\n/** A component's card, as East computed it. */\ntype PaletteCard = ValueTypeOf<typeof PaletteCardType>;\n/** A page of the project, as East computed it. */\ntype PalettePage = ValueTypeOf<typeof PalettePageType>;\n\n/** What {@link useStudioPalette} lists, and what its clicks do. */\nexport interface StudioPaletteProps {\n    /** The components the palette offers — the listed, less the deprecated — in the surface's order. */\n    components: readonly Component[];\n    /** Each one's card: its meta line, and whether it is placed. */\n    cards: ReadonlyMap<string, PaletteCard>;\n    /** The project's pages, in key order. */\n    pages: readonly PalettePage[];\n    /** The open page's name in the project. */\n    open: string;\n    /** The ids of the palette's libraries — the components library's, which the canvas takes cards from, and the pages'. */\n    ids: { components: string; pages: string };\n    /** Selects the component's first placement on the page. */\n    onSelect: (component: string) => void;\n    /** Opens a page of the project. */\n    onOpen: (page: string) => void;\n    /** Where the palette's libraries keep their state. */\n    storageKey: string;\n    /** In a phone's frame: what a card's tap starts, and the components on the page. */\n    phone?: { onPlace: (component: Component) => void; onPage: ReadonlySet<string> } | undefined;\n}\n\n/**\n * The builder's palette, as the pane the canvas's frame draws — see the\n * module docs.\n *\n * @param props - The components and pages it lists, and what its clicks do\n * @returns The palette's pane: the Components and Pages tabs, 264px wide\n */\nexport function useStudioPalette({\n    components, cards, pages, open, ids, onSelect, onOpen, storageKey, phone,\n}: StudioPaletteProps): BuilderFrameDock {\n    const m = useStudioMessages();\n    const styles = useSlotStyles(\"studioPhone\");\n    const words = useFormatters();\n\n    const componentsLibrary = useMemo((): LibraryValue => ({\n        id: ids.components,\n        hint: none,\n        items: components.map((component): LibraryItemValue => {\n            const card = cards.get(component.key);\n            return {\n                key: component.key,\n                label: component.name,\n                sublabel: card === undefined ? none : some(phone?.onPage.has(component.key) === true && card.meta !== \"\" ? `${card.meta} · ${m.phoneOnPage()}` : card.meta),\n                icon: some(component.icon),\n                status: none,\n                trailing: some({ icon: \"lock\", label: m.logicFixed(), tone: none }),\n                draggable: phone === undefined,\n                filtered: false,\n                placed: card?.placed ?? false,\n                media: none,\n                avatar: none,\n                byline: none,\n                action: none,\n                search: some(`${component.name} ${component.category} ${component.tags.join(\" \")}`),\n                groups: new Map([[\"category\", component.category]]),\n                facets: new Map([[\"category\", [component.category]], [\"tags\", component.tags], [\"collections\", component.collections]]),\n                dims: new Map(),\n            };\n        }),\n        groupOptions: [{ key: \"category\", label: m.category() }],\n        groupSummaries: new Map(),\n        dimOptions: [],\n        defaultDimensions: [],\n        filterOptions: [\n            { key: \"category\", label: m.category() },\n            { key: \"tags\", label: m.tags() },\n            { key: \"collections\", label: m.collections() },\n        ],\n        searchable: true,\n        noun: some(m.componentNoun()),\n        addLabel: none,\n        onAdd: none,\n        onCardClick: some((key: string) => {\n            const picked = phone === undefined ? undefined : components.find((c) => c.key === key);\n            if (picked !== undefined) phone?.onPlace(picked);\n            else onSelect(key);\n            return null;\n        }),\n        slice: none,\n        style: some({ height: some(\"fill\"), maxHeight: none, virtualization: some(false), columns: none, mediaPlacement: none, mediaSize: none }),\n        variant: none,\n        layout: none,\n        toolbar: true,\n    }), [ids.components, components, cards, m, onSelect, phone]);\n\n    const pagesLibrary = useMemo((): LibraryValue => ({\n        id: ids.pages,\n        hint: none,\n        items: pages.map((page): LibraryItemValue => ({\n            key: page.page,\n            label: page.title,\n            sublabel: some(page.meta),\n            icon: some(\"file-lines\"),\n            status: none,\n            trailing: some({\n                icon: \"circle\",\n                label: page.live ? m.live() : m.draft(),\n                tone: some(page.live ? variant(\"success\", null) : variant(\"neutral\", null)),\n            }),\n            draggable: false,\n            filtered: false,\n            placed: page.page === open,\n            media: none,\n            avatar: none,\n            byline: none,\n            action: none,\n            search: some(page.title),\n            groups: new Map(),\n            facets: new Map(),\n            dims: new Map(),\n        })),\n        groupOptions: [],\n        groupSummaries: new Map(),\n        dimOptions: [],\n        defaultDimensions: [],\n        filterOptions: [],\n        searchable: true,\n        noun: some(m.pageNoun()),\n        addLabel: none,\n        onAdd: none,\n        onCardClick: some((key: string) => { onOpen(key); return null; }),\n        slice: none,\n        style: some({ height: some(\"fill\"), maxHeight: none, virtualization: some(false), columns: none, mediaPlacement: none, mediaSize: none }),\n        variant: none,\n        layout: none,\n        toolbar: true,\n    }), [ids.pages, pages, open, m, onOpen]);\n\n    return useMemo((): BuilderFrameDock => ({\n        label: m.components(),\n        icon: \"shapes\",\n        badge: words.number(components.length),\n        size: \"264px\",\n        tabs: [\n            {\n                key: \"components\", label: m.components(), count: phone === undefined ? undefined : words.number(components.length),\n                body: phone === undefined ? <EastChakraLibrary value={componentsLibrary} storageKey={`${storageKey}.palette.components`} />\n                    : <Box css={styles.paneBody} data-library-phone=\"studio\"><Box css={styles.intro} data-studio-intro=\"\">{m.phoneComponentsIntro()}</Box><EastChakraLibrary value={componentsLibrary} storageKey={`${storageKey}.palette.components`} /></Box>,\n            },\n            {\n                key: \"pages\", label: m.pages(), count: phone === undefined ? undefined : words.number(pages.length),\n                body: phone === undefined ? <EastChakraLibrary value={pagesLibrary} storageKey={`${storageKey}.palette.pages`} />\n                    : <Box css={styles.paneBody} data-library-phone=\"studio\"><Box css={styles.intro} data-studio-intro=\"\">{m.phonePagesIntro()}</Box><EastChakraLibrary value={pagesLibrary} storageKey={`${storageKey}.palette.pages`} /></Box>,\n            },\n        ],\n    }), [m, words, components.length, pages.length, componentsLibrary, pagesLibrary, storageKey, phone, styles]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The popover a screen names something new in — a page in Studio's page\n * library and a template in its builder (#997), a query in the query builder\n * (#936). It asks for a name its host does not hold, takes any further fields\n * its host puts under it, and hands the name to its host's write: it closes\n * once the write is made, and says what refused it otherwise, so a name\n * another write took first is never lost silently.\n *\n * It is the design system's edit popover (`SliceEditPopover`), in the grammar\n * of its Save as cohort: the name field with its hint — help while the name\n * is missing, the field's error while its host holds it — and Cancel and\n * the named commit in the foot, both Default, the commit disabled while a\n * hint shows and loading while the write runs. ⏎ in the name commits — the\n * form's own submission, through its commit — and a field its host adds\n * commits by submitting the form (`requestSubmit`); Esc, ×, a click outside\n * and Cancel close it. It is never a modal: the design system's one modal is\n * a confirmation step, not a form.\n *\n * It says no words of its own: its host passes each one, from its own message\n * table. Its layout is the `sliceEdit` recipe's `form` and `field` slots, and\n * its field the `input` recipe's.\n *\n * It hangs from its trigger — the one button that opens it — or, opened from\n * a toolbar chip's menu (#1229), from that chip, as its anchor.\n *\n * @packageDocumentation\n */\n\nimport { useId, useState, type ReactNode } from \"react\";\nimport { Box, Button as ChakraButton, chakra, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { SliceEditPopover, type SliceEditPopoverAnchor } from \"@elaraai/east-ui-components\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** Props of {@link NamePopover}: the button it hangs from (`trigger`) or its `anchor`, and the rest. */\nexport type NamePopoverProps = SliceEditPopoverAnchor & {\n    /** Whether it is open. */\n    open: boolean;\n    /** Opens or closes it — its trigger, ×, Esc, a click outside, Cancel, or a write that was made. */\n    onOpenChange: (open: boolean) => void;\n    /** Its head — what it makes, and where. */\n    label: ReactNode;\n    /** The name field's placeholder, and its accessible name. */\n    placeholder: string;\n    /** The name it offers when it opens. */\n    initial: string;\n    /** The names its host holds — the new one must be none of them. */\n    taken: ReadonlySet<string>;\n    /** The hint while the name is empty. */\n    missing: string;\n    /** The field's error while its host holds the name — given the name, as typed and trimmed. */\n    nameTaken: (name: string) => string;\n    /** Its commit verb — the commit button's words. */\n    confirm: string;\n    /** The cancel button's words. */\n    cancel: string;\n    /** Further fields, under the name. */\n    children?: ReactNode;\n    /** The name field's label, above it: a phone's view. */\n    nameLabel?: string | undefined;\n    /** The name field's help under it, while no hint shows. */\n    nameHelp?: string | undefined;\n    /** The commit as the Primary: a phone's view. */\n    primary?: boolean | undefined;\n    /** Makes the thing under the name — resolves to what refused it, or `undefined` once it is made. */\n    onConfirm: (name: string) => Promise<string | undefined>;\n};\n\n/**\n * Renders the popover — see the module docs.\n *\n * @param props - What it names, in its host's words, and what it does with the name\n * @returns The trigger or the anchor, and the popover while open\n */\nexport function NamePopover(props: NamePopoverProps) {\n    const { open, onOpenChange, label, placeholder, initial, taken, missing, nameTaken, confirm, cancel, children, onConfirm, nameLabel, nameHelp, primary = false } = props;\n    const hangs: SliceEditPopoverAnchor = props.trigger !== undefined ? { trigger: props.trigger } : { anchor: props.anchor };\n    const edit = useSlotRecipe({ key: \"sliceEdit\" })() as Styles;\n    const input = useRecipe({ key: \"input\" })({}) as SystemStyleObject;\n    const id = useId();\n    const [name, setName] = useState(initial);\n    const [refused, setRefused] = useState<string | undefined>(undefined);\n    const [busy, setBusy] = useState(false);\n    // Each time it opens, it starts from the name it offers.\n    const [wasOpen, setWasOpen] = useState(open);\n    if (open !== wasOpen) {\n        setWasOpen(open);\n        if (open) {\n            setName(initial);\n            setRefused(undefined);\n            setBusy(false);\n        }\n    }\n\n    const trimmed = name.trim();\n    const isTaken = trimmed !== \"\" && taken.has(trimmed);\n    const submit = async () => {\n        if (trimmed === \"\" || isTaken || busy) return;\n        setBusy(true);\n        setRefused(undefined);\n        try {\n            const why = await onConfirm(trimmed);\n            if (why === undefined) onOpenChange(false);\n            else setRefused(why);\n        } catch (err) {\n            setRefused(err instanceof Error ? err.message : String(err));\n        } finally {\n            setBusy(false);\n        }\n    };\n\n    return (\n        <SliceEditPopover\n            {...hangs}\n            open={open}\n            onOpenChange={onOpenChange}\n            label={label}\n            footActions={\n                <>\n                    <ChakraButton type=\"button\" variant=\"outline\" size=\"xs\" disabled={busy} onClick={() => onOpenChange(false)}>\n                        {cancel}\n                    </ChakraButton>\n                    <ChakraButton type=\"submit\" form={`${id}-form`} variant={primary ? \"solid\" : \"outline\"} size=\"xs\" loading={busy}\n                        disabled={trimmed === \"\" || isTaken}>\n                        {confirm}\n                    </ChakraButton>\n                </>\n            }\n        >\n            <chakra.form id={`${id}-form`} css={edit.form} noValidate\n                onSubmit={(e: React.FormEvent) => { e.preventDefault(); void submit(); }}>\n                <Box css={edit.field}>\n                    {nameLabel !== undefined && <chakra.label htmlFor={`${id}-name`} css={edit.viewFieldLabel}>{nameLabel}</chakra.label>}\n                    <chakra.input id={`${id}-name`} css={input} value={name} placeholder={placeholder} aria-label={placeholder}\n                        autoComplete=\"off\" autoFocus aria-invalid={isTaken ? true : undefined}\n                        aria-describedby={trimmed === \"\" || isTaken ? `${id}-hint` : undefined}\n                        onChange={(e: React.ChangeEvent<HTMLInputElement>) => setName(e.target.value)} />\n                    {trimmed === \"\" && <Box as=\"span\" id={`${id}-hint`} css={edit.hint}>{missing}</Box>}\n                    {isTaken && <Box as=\"span\" id={`${id}-hint`} css={edit.hintError}>{nameTaken(trimmed)}</Box>}\n                    {nameHelp !== undefined && trimmed !== \"\" && !isTaken && <Box as=\"span\" css={edit.hint}>{nameHelp}</Box>}\n                </Box>\n                {children}\n                {refused !== undefined && <Box as=\"span\" role=\"alert\" css={edit.hintError} data-refused=\"\">{refused}</Box>}\n            </chakra.form>\n        </SliceEditPopover>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `StudioSaveTemplate` — the builder toolbar's Save as template (#997), before\n * Preview and Publish. Its button opens the popover that names the template —\n * offering \"<page> template\" — and saves the open page, as last saved, under\n * the name: one commit. A name the project holds is refused in the popover,\n * and so is a name another write took first. While a template is open the\n * button is disabled: a template is not saved again.\n *\n * Its button is the `button` recipe's outline, as its neighbours in the\n * toolbar are, and as tall as every control in the row (`sm`, 28px, ruled 23\n * Oct 2026); its popover is the shared {@link NamePopover}, in the Studio's\n * words.\n *\n * On a row short of room the button folds into the toolbar's ⋯ chip (#1229),\n * whose menu's Save as template… opens the same popover: its host then holds\n * it open and hangs it from the chip, as its `anchor`. On a phone (`Studio Mobile\n * Spec.md` ST28) its host gives the trigger, and it opens as a view, its field\n * labelled and a help line under it.\n *\n * @packageDocumentation\n */\n\nimport { memo, useState, type ReactElement, type ReactNode } from \"react\";\nimport { Box, Button as ChakraButton, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { type ValueTypeOf } from \"@elaraai/east\";\nimport { StudioSaveTemplatePayloadType } from \"@elaraai/e3-ui/internal\";\n\nimport { NamePopover } from \"../shared/name-popover.js\";\nimport { useStudioMessages } from \"./messages.js\";\n\n/** Save as template, as the builder draws it. */\ntype StudioSaveTemplateValue = ValueTypeOf<typeof StudioSaveTemplatePayloadType>;\n\n/** Props of {@link StudioSaveTemplate}: its button, or the chip its host hangs it from, open while its host says. */\nexport type StudioSaveTemplateProps = {\n    /** The open page's title, whether it can be saved, the names taken, and the save. */\n    value: StudioSaveTemplateValue;\n} & (\n    | {\n        anchor?: undefined;\n        /** A phone's trigger, in place of its button: the first row's. */\n        phoneTrigger?: ReactElement;\n        /** The project, which a phone's help line names. */\n        project?: string | undefined;\n    }\n    | {\n        /** The chip it hangs from — the toolbar's ⋯, whose menu opened it. */\n        anchor: ReactNode;\n        phoneTrigger?: undefined;\n        project?: undefined;\n        /** Whether it is open. */\n        open: boolean;\n        /** Opens or closes it. */\n        onOpenChange: (open: boolean) => void;\n    }\n);\n\n/**\n * Renders Save as template — see the module docs.\n *\n * @param props - What it saves, and how\n * @returns The button, or the chip, and its popover while open\n */\nexport const StudioSaveTemplate = memo(function StudioSaveTemplate(props: StudioSaveTemplateProps) {\n    const { value } = props;\n    const edit = useSlotRecipe({ key: \"sliceEdit\" })() as Record<string, SystemStyleObject>;\n    const m = useStudioMessages();\n    const [own, setOwn] = useState(false);\n    const open = props.anchor === undefined ? own : props.open;\n    const setOpen = props.anchor === undefined ? setOwn : props.onOpenChange;\n    const onSave = value.onSave;\n    const button = (\n        <ChakraButton variant=\"outline\" size=\"sm\" disabled={!value.enabled} data-studio-save-template=\"\"\n            {...(value.enabled ? {} : { title: m.templateOpen() })}>\n            {m.saveAsTemplate()}\n        </ChakraButton>\n    );\n    return (\n        <NamePopover\n            open={open}\n            onOpenChange={(next) => setOpen(next && value.enabled)}\n            {...(props.anchor === undefined ? { trigger: props.phoneTrigger ?? button } : { anchor: props.anchor })}\n            {...(props.anchor === undefined && props.phoneTrigger !== undefined ? {\n                nameLabel: m.templateName(),\n                ...(props.project !== undefined ? { nameHelp: m.phoneTemplateHelp({ project: props.project, page: value.title }) } : {}),\n            } : {})}\n            label={<>{m.saveAsTemplate()} · <Box as=\"span\" css={edit.clauseField}>{value.title}</Box></>}\n            placeholder={m.templateName()}\n            initial={m.templateNameFor({ page: value.title })}\n            taken={value.taken}\n            missing={m.templateNameMissing()}\n            nameTaken={(name) => m.nameTaken({ name })}\n            confirm={m.saveTemplate()}\n            cancel={m.cancel()}\n            onConfirm={async (name) => {\n                const refused = await onSave(name);\n                return refused.type === \"some\" ? refused.value : undefined;\n            }}\n        />\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The builder's first row on a phone (`Studio Mobile Spec.md` ST1–ST5): the\n * page's status, Save as template while it fits (from 372 px), Preview and\n * Publish, each a 32 box in a 44 target; below 372 Save as template leaves the\n * row for ⋯, which goes straight to its view — a phone has no menu of one.\n *\n * @packageDocumentation\n */\n\nimport { memo, useLayoutEffect, useRef, useState } from \"react\";\nimport { Box, chakra, VisuallyHidden } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faEllipsis } from \"@fortawesome/free-solid-svg-icons\";\nimport { useContainerWidth } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { useStudioMessages } from \"./messages.js\";\nimport { StudioSaveTemplate, type StudioSaveTemplateProps } from \"./save-template.js\";\n\n/** The narrowest frame whose first row holds Save as template (ST3). */\nconst TEMPLATE_INLINE_FROM = 372;\n\n/** Props of {@link StudioPhoneBar}. */\nexport interface StudioPhoneBarProps {\n    /** The page's status: its word and its tone. */\n    readonly status: { readonly label: string; readonly tone: string } | undefined;\n    /** Save as template. */\n    readonly saveTemplate: StudioSaveTemplateProps[\"value\"];\n    /** The project. */\n    readonly project: string;\n    /** Opens the preview on Page (ST5). */\n    readonly onPreview: () => void;\n    /** Opens the preview on Changes (ST5). */\n    readonly onPublish: () => void;\n}\n\n/**\n * The first row — see the module docs.\n *\n * @param props - The status, and what the buttons do\n * @returns The row\n */\nexport const StudioPhoneBar = memo(function StudioPhoneBar({ status, saveTemplate, project, onPreview, onPublish }: StudioPhoneBarProps) {\n    const styles = useSlotStyles(\"studioPhone\");\n    const m = useStudioMessages();\n    // The row's own width, the frame's whatever holds it. Unmeasured, the narrow form: nothing to cut.\n    const barRef = useRef<HTMLDivElement | null>(null);\n    const width = useContainerWidth(barRef);\n    // Past the width's own rule (ST3), a status too long for the row gives way: Save as template goes to ⋯, then the\n    // status keeps its dot, its word whole or not at all (ST39). Measured before paint, again as the width or the word moves.\n    const [gave, setGave] = useState(0);\n    const label = status?.label;\n    useLayoutEffect(() => { setGave(0); }, [width, label]);\n    useLayoutEffect(() => {\n        const bar = barRef.current;\n        if (bar !== null && gave < 2 && bar.scrollWidth > bar.clientWidth + 0.5) setGave(gave + 1);\n    }, [gave, width, label]);\n    const inline = width >= TEMPLATE_INLINE_FROM && gave === 0;\n    const trigger = inline\n        ? <chakra.button type=\"button\" css={styles.target} disabled={!saveTemplate.enabled} data-studio-save-template=\"\"><Box as=\"span\" css={styles.box}>{m.saveAsTemplate()}</Box></chakra.button>\n        : <chakra.button type=\"button\" css={styles.more} disabled={!saveTemplate.enabled} aria-label={m.saveAsTemplate()} data-studio-more=\"\"><FontAwesomeIcon icon={faEllipsis} /></chakra.button>;\n    const template = <StudioSaveTemplate value={saveTemplate} phoneTrigger={trigger} project={project} />;\n    return (\n        <Box ref={barRef} css={styles.bar} data-studio-phone-bar=\"\" data-ends-more={inline ? undefined : \"\"}>\n            {status !== undefined && (\n                <Box as=\"span\" css={styles.status} data-studio-status={status.tone}>\n                    <Box as=\"span\" css={styles.statusDot} data-tone={status.tone} aria-hidden />{gave < 2 ? status.label : <VisuallyHidden>{status.label}</VisuallyHidden>}\n                </Box>\n            )}\n            {inline && template}\n            <chakra.button type=\"button\" css={styles.target} data-studio-preview=\"\" onClick={onPreview}><Box as=\"span\" css={styles.box}>{m.preview()}</Box></chakra.button>\n            <chakra.button type=\"button\" css={styles.target} data-studio-open-publish=\"\" onClick={onPublish}><Box as=\"span\" css={styles.box}>{m.publish()}</Box></chakra.button>\n            {!inline && template}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `StudioPublishPreview` — the builder's publish preview (#998), in the\n * canvas's place while it shows.\n *\n * - **The bar**, headerless, on the inverse ground: \"● Preview\"; Desktop ·\n *   Tablet · Mobile, which draw the page 1440, 1024 or 390 px wide at most;\n *   the Env pill; and Exit, back to the canvas.\n * - **The page**: its project, its title, and the page as it will publish —\n *   which the builder draws — together at most the device's width.\n * - **The aside**: where the page stands, the version it replaces and the one\n *   it becomes, the change list, the Audience and Rollout rows, and what\n *   refused a write.\n * - **The footer**: Save as draft asks the canvas for an Apply; Publish asks\n *   for one when the canvas has drafts, waits for the canvas's answer, then\n *   commits the publish.\n *\n * The canvas answers an Apply under the id asked, so the answer to another\n * ask is never taken for this one's. Every word is the Studio's message\n * table's; numbers print in the locale. The preview draws no border around\n * itself.\n *\n * Its layout and its bar are the `studioPublish` recipe's, and its buttons the\n * `button` recipe's. Every mark is Font Awesome's, never a text glyph (#1263):\n * a change's sign its plus, minus or plus-minus.\n *\n * In a phone's frame (`Studio Mobile Spec.md` ST30–ST33) it takes the builder's\n * place: a head with ← and the versions; Page · Changes, which Preview and\n * Publish open; Mobile · Tablet · Desktop over the page, the page itself on\n * Mobile and on the others the layout at that device's proportions, each tile by\n * name, a name that would not fit whole left out; and the foot sticky under them.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { Box, Button as ChakraButton, chakra, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n    faArrowLeft, faChevronDown, faDesktop, faMinus, faMobileScreen, faPlus, faPlusMinus, faTabletScreenButton,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { type ValueTypeOf } from \"@elaraai/east\";\nimport { StudioPublishPayloadType } from \"@elaraai/e3-ui/internal\";\nimport { useFormatters } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\n\nimport { useStudioMessages } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The publish preview, as the builder draws it. */\ntype StudioPublishValue = ValueTypeOf<typeof StudioPublishPayloadType>;\n\n/** The devices the bar offers, and the most each draws the page wide, in px. */\nconst DEVICES = [\n    { device: \"desktop\", icon: faDesktop, width: 1440 },\n    { device: \"tablet\", icon: faTabletScreenButton, width: 1024 },\n    { device: \"mobile\", icon: faMobileScreen, width: 390 },\n] as const;\n\n/** A device the bar offers. */\ntype Device = (typeof DEVICES)[number][\"device\"];\n\n/**\n * Where the footer's writes stand: at rest; an Apply asked of the canvas,\n * under its id, and whether a publish follows it; a publish committing; or a\n * write refused, and why.\n */\ntype Phase =\n    | { kind: \"idle\" }\n    | { kind: \"applying\"; id: string; publish: boolean }\n    | { kind: \"publishing\" }\n    | { kind: \"refused\"; reason: string };\n\n/** Props of {@link StudioPublishPreview}. */\nexport interface StudioPublishPreviewProps {\n    /** Where the page stands, what changed, the words the aside shows, and the actions. */\n    value: StudioPublishValue;\n    /** The page as it will publish. */\n    page: ReactNode;\n    /** In a phone's frame: its open tab, its tiles for the wireframes, and its width. */\n    phone?: StudioPublishPhone | undefined;\n}\n\n/** What a phone's preview needs beyond the wide one's. */\nexport interface StudioPublishPhone {\n    /** The open tab. */\n    readonly tab: \"page\" | \"changes\";\n    /** Opens a tab. */\n    readonly onTab: (tab: \"page\" | \"changes\") => void;\n    /** The page's tiles in order, each by name. */\n    readonly tiles: readonly { readonly key: string; readonly row: string; readonly name: string; readonly span: number }[];\n    /** The builder's width, px. */\n    readonly width: number;\n}\n\n/** The narrowest frame whose foot's buttons sit side by side (ST33). */\nconst FOOT_SIDE_BY_SIDE_FROM = 372;\n\n/** The layout at a device's proportions, each tile by name (ST31): a name that would not fit whole is left out, its span kept. */\nfunction PhoneWire({ tiles, width }: { tiles: StudioPublishPhone[\"tiles\"]; width: number }) {\n    const styles = useSlotStyles(\"studioPhone\");\n    const words = useFormatters();\n    const ref = useRef<HTMLDivElement | null>(null);\n    const rows = useMemo(() => {\n        const out: { key: string; tiles: StudioPublishPhone[\"tiles\"][number][] }[] = [];\n        for (const tile of tiles) {\n            const last = out[out.length - 1];\n            if (last?.key === tile.row) last.tiles.push(tile);\n            else out.push({ key: tile.row, tiles: [tile] });\n        }\n        return out;\n    }, [tiles]);\n    useLayoutEffect(() => {\n        for (const name of ref.current?.querySelectorAll<HTMLElement>(\"[data-wire-name]\") ?? []) {\n            name.removeAttribute(\"data-unfit\");\n            if (name.scrollWidth > name.clientWidth) name.setAttribute(\"data-unfit\", \"\");\n        }\n    }, [rows, width]);\n    return (\n        <Box ref={ref} css={styles.wire} data-publish-wire=\"\">\n            {rows.map((row) => {\n                const free = 12 - row.tiles.reduce((sum, t) => sum + t.span, 0);\n                return (\n                    <Box key={row.key} css={styles.wireRow}>\n                        {row.tiles.map((tile) => (\n                            <Box key={tile.key} css={styles.wireTile} style={{ gridColumn: `span ${tile.span}` }}>\n                                <Box as=\"span\" css={styles.wireName} data-wire-name=\"\">{tile.name}</Box>\n                                <Box as=\"span\" css={styles.wireSpan}>{words.number(tile.span)}</Box>\n                            </Box>\n                        ))}\n                        {free > 0 && <Box css={styles.wireFree} style={{ gridColumn: `span ${free}` }} data-wire-free=\"\" />}\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n}\n\n/**\n * Renders the publish preview — see the module docs.\n *\n * @param props - What the preview shows and does, and the page as it will publish\n * @returns The publish preview\n */\nexport const StudioPublishPreview = memo(function StudioPublishPreview({ value, page, phone }: StudioPublishPreviewProps) {\n    const styles = useSlotRecipe({ key: \"studioPublish\" })() as Styles;\n    const ps = useSlotStyles(\"studioPhone\");\n    // A phone's device: Mobile first, the phone's own (D3).\n    const [phoneDevice, setPhoneDevice] = useState<Device>(\"mobile\");\n    const m = useStudioMessages();\n    const words = useFormatters();\n    const [device, setDevice] = useState<Device>(\"desktop\");\n    const [phase, setPhase] = useState<Phase>({ kind: \"idle\" });\n    // What the writes read when they run — this render's payload.\n    const latest = useRef(value);\n    latest.current = value;\n\n    const summary = value.summary;\n    const standing = summary.standing.type;\n    const live = summary.live.type === \"some\" ? summary.live.value : undefined;\n    const liveVersion = live === undefined ? \"\" : m.version({ version: words.number(live) });\n    const nextVersion = m.version({ version: words.number(live === undefined ? 1n : live + 1n) });\n    const env = value.env.type === \"some\" ? value.env.value : undefined;\n    const exit = value.onExit.type === \"some\" ? value.onExit.value : undefined;\n    const busy = phase.kind === \"applying\" || phase.kind === \"publishing\";\n    const width = DEVICES.find((d) => d.device === device)!.width;\n\n    // The publish, from the payload as it stands when it runs.\n    const publish = useCallback(async () => {\n        setPhase({ kind: \"publishing\" });\n        let reason: string | undefined;\n        try {\n            const refused = await latest.current.onPublish();\n            reason = refused.type === \"some\" ? refused.value : undefined;\n        } catch (err) {\n            reason = err instanceof Error ? err.message : String(err);\n        }\n        setPhase(reason === undefined ? { kind: \"idle\" } : { kind: \"refused\", reason });\n    }, []);\n    // An Apply asked of the canvas, under an id of its own.\n    const ask = (then: \"save\" | \"publish\") => {\n        const id = Array.from(crypto.getRandomValues(new Uint8Array(8)), (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n        setPhase({ kind: \"applying\", id, publish: then === \"publish\" });\n        const onApply = value.onApply;\n        queueMicrotask(() => {\n            try {\n                onApply(id);\n            } catch (err) {\n                setPhase({ kind: \"refused\", reason: err instanceof Error ? err.message : String(err) });\n            }\n        });\n    };\n    // The canvas's answer, under the id asked: the drafts landed — publish if\n    // asked to — or what refused them.\n    const answer = value.apply;\n    useEffect(() => {\n        if (phase.kind !== \"applying\") return;\n        if (answer.type === \"applied\" && answer.value === phase.id) {\n            if (phase.publish) void publish();\n            else setPhase({ kind: \"idle\" });\n        } else if (answer.type === \"refused\" && answer.value.id === phase.id) {\n            setPhase({ kind: \"refused\", reason: answer.value.reason });\n        }\n    }, [answer, phase, publish]);\n\n    const changes = summary.changes;\n    const count = changes.length;\n    const head = standing === \"ready\" ? m.readyToPublish() : standing === \"current\" ? m.upToDate() : m.templateNotPublished();\n    const listHead = live === undefined ? m.changesFirst({ n: count, count: words.number(count) })\n        : count === 0 ? m.noChangesSince({ version: liveVersion })\n            : m.changesSince({ n: count, count: words.number(count), version: liveVersion });\n    const audience = value.audience.type === \"some\" ? value.audience.value : undefined;\n    const rollout = value.rollout.type === \"some\" ? value.rollout.value : undefined;\n\n    if (phone !== undefined) {\n        const versions = standing === \"template\" ? `${value.title} · ${m.templateKind()}`\n            : standing === \"current\" ? `${value.title} · ${liveVersion} ${m.liveVersion()}`\n                : live === undefined ? `${value.title} · ${nextVersion}` : `${value.title} · ${liveVersion} → ${nextVersion}`;\n        const target = [standing === \"template\" ? undefined : env === undefined ? nextVersion : `${nextVersion} to ${env}`, audience, rollout].filter((part) => part !== undefined).join(\" · \");\n        const facts = [\n            ...(env !== undefined ? [{ label: m.env(), text: env }] : []),\n            ...(audience !== undefined ? [{ label: m.audience(), text: audience }] : []),\n            ...(rollout !== undefined ? [{ label: m.rollout(), text: rollout }] : []),\n        ];\n        const pixels = DEVICES.find((d) => d.device === phoneDevice)!.width;\n        return (\n            <Box css={ps.preview} data-studio-publish=\"\" data-publish-phone=\"\">\n                <Box css={ps.previewHead}>\n                    <chakra.button type=\"button\" css={ps.previewBack} aria-label={m.phoneBack()} disabled={exit === undefined} data-publish-exit=\"\"\n                        onClick={() => { if (exit !== undefined) queueMicrotask(() => exit()); }}><FontAwesomeIcon icon={faArrowLeft} /></chakra.button>\n                    <Box as=\"span\" css={ps.previewTitle}>{m.preview()}</Box>\n                    <Box as=\"span\" css={ps.previewSub} data-publish-versions=\"\">{versions}</Box>\n                </Box>\n                <Box css={ps.previewTabs} role=\"tablist\">\n                    {([\"page\", \"changes\"] as const).map((tab) => (\n                        <chakra.button key={tab} type=\"button\" role=\"tab\" css={ps.previewTab} aria-selected={phone.tab === tab} data-publish-tab={tab} onClick={() => phone.onTab(tab)}>\n                            {tab === \"page\" ? m.phonePage() : `${m.phoneChanges()} ${words.number(count)}`}\n                        </chakra.button>\n                    ))}\n                </Box>\n                <Box css={ps.previewBody} data-tab={phone.tab}>\n                    {phone.tab === \"page\" ? (\n                        <>\n                            <Box css={ps.devices} role=\"group\" aria-label={m.devices()} data-publish-devices=\"\">\n                                {([\"mobile\", \"tablet\", \"desktop\"] as const).map((d) => (\n                                    <chakra.button key={d} type=\"button\" css={ps.device} data-state={phoneDevice === d ? \"on\" : \"off\"} aria-pressed={phoneDevice === d} data-publish-device={d} onClick={() => setPhoneDevice(d)}>{m.device({ device: d })}</chakra.button>\n                                ))}\n                            </Box>\n                            <Box css={ps.pageHead}>\n                                <Box as=\"span\" css={ps.pageEyebrow}>{value.project}</Box>\n                                <Box as=\"h2\" css={ps.pageTitle}>{value.title}</Box>\n                            </Box>\n                            <Box css={ps.pageBody} data-publish-frame={phoneDevice}>\n                                {phoneDevice === \"mobile\" ? page : <>\n                                    <Box css={ps.wireCaption}>{m.phoneWireCaption({ device: m.device({ device: phoneDevice }), px: words.number(pixels) })}</Box>\n                                    <PhoneWire tiles={phone.tiles} width={phone.width} />\n                                </>}\n                            </Box>\n                        </>\n                    ) : (\n                        <>\n                            {standing !== \"template\" && <Box css={ps.changesHead} data-publish-count=\"\">{listHead}</Box>}\n                            {standing !== \"template\" && count > 0 && (\n                                <Box as=\"ul\" css={ps.changes} aria-label={listHead} data-publish-changes=\"\">\n                                    {changes.map((row, i) => {\n                                        const kind = row.change.type;\n                                        return (\n                                            <Box as=\"li\" key={`${row.change.value.cell}-${kind}-${i}`} css={ps.change} data-publish-change={kind}>\n                                                <Box as=\"span\" css={ps.changeSign} aria-hidden><FontAwesomeIcon icon={kind === \"added\" ? faPlus : kind === \"removed\" ? faMinus : faPlusMinus} /></Box>\n                                                <Box css={ps.changeText}>\n                                                    <Box as=\"span\" css={ps.changeLine}>{m.changeVerb({ change: kind })} <strong>{row.name}</strong></Box>\n                                                    <Box as=\"span\" css={ps.changeDetail}>{row.change.value.detail}</Box>\n                                                </Box>\n                                            </Box>\n                                        );\n                                    })}\n                                </Box>\n                            )}\n                            <Box css={ps.facts} data-publish-facts=\"\">\n                                {facts.map((fact) => (\n                                    <Box key={fact.label} css={ps.fact}>\n                                        <Box as=\"span\" css={ps.factLabel}>{fact.label}</Box>\n                                        <Box as=\"span\" css={ps.factValue}>{fact.text}</Box>\n                                    </Box>\n                                ))}\n                            </Box>\n                        </>\n                    )}\n                    {phase.kind === \"refused\" && <Box as=\"p\" role=\"alert\" css={ps.refusal} data-publish-refused=\"\">{phase.reason}</Box>}\n                </Box>\n                <Box css={ps.foot} data-publish-foot=\"\">\n                    {target !== \"\" && <Box css={ps.footLine} data-publish-target=\"\">{target}</Box>}\n                    <Box css={ps.footButtons} data-stacked={phone.width < FOOT_SIDE_BY_SIDE_FROM ? \"\" : undefined}>\n                        <ChakraButton type=\"button\" variant=\"outline\" size=\"md\" css={ps.footButton} data-publish-save=\"\"\n                            disabled={!summary.unsaved || busy} loading={phase.kind === \"applying\" && !phase.publish} onClick={() => ask(\"save\")}>{m.saveAsDraft()}</ChakraButton>\n                        <ChakraButton type=\"button\" size=\"md\" colorPalette=\"brand\" css={ps.footButton} data-publish-publish=\"\"\n                            disabled={standing !== \"ready\" || busy} loading={(phase.kind === \"applying\" && phase.publish) || phase.kind === \"publishing\"}\n                            onClick={() => { if (summary.unsaved) ask(\"publish\"); else void publish(); }}>{m.publishTo({ version: standing === \"template\" ? undefined : nextVersion, env })}</ChakraButton>\n                    </Box>\n                </Box>\n            </Box>\n        );\n    }\n\n    return (\n        <Box css={styles.root} data-studio-publish=\"\">\n            <Box css={styles.bar} data-publish-bar=\"\">\n                <Box as=\"span\" css={styles.barLabel}>\n                    <Box as=\"span\" css={styles.barDot} aria-hidden />\n                    {m.preview()}\n                </Box>\n                <Box css={styles.devices} role=\"group\" aria-label={m.devices()} data-publish-devices=\"\">\n                    {DEVICES.map(({ device: d, icon }) => (\n                        <chakra.button key={d} type=\"button\" css={styles.device} data-state={device === d ? \"on\" : \"off\"}\n                            aria-pressed={device === d} data-publish-device={d} onClick={() => setDevice(d)}>\n                            <Box as=\"span\" css={styles.deviceIcon} aria-hidden><FontAwesomeIcon icon={icon} /></Box>\n                            {m.device({ device: d })}\n                        </chakra.button>\n                    ))}\n                </Box>\n                {env !== undefined && (\n                    <Box as=\"span\" css={styles.env} data-publish-env=\"\">\n                        {m.env()} ·\n                        <Box as=\"span\" css={styles.envName}>{env}</Box>\n                        <Box as=\"span\" css={styles.envCaret} aria-hidden><FontAwesomeIcon icon={faChevronDown} /></Box>\n                    </Box>\n                )}\n                <chakra.button type=\"button\" css={styles.exit} disabled={exit === undefined} data-publish-exit=\"\"\n                    onClick={() => { if (exit !== undefined) queueMicrotask(() => exit()); }}>\n                    {m.exit()}\n                </chakra.button>\n            </Box>\n            <Box css={styles.body}>\n                <Box css={styles.main} data-publish-main=\"\">\n                    <Box css={styles.frame} style={{ maxWidth: `${width}px` }} data-publish-frame={device}>\n                        <Box css={styles.head}>\n                            <Box as=\"span\" css={styles.eyebrow}>{value.project}</Box>\n                            <Box as=\"h2\" css={styles.title}>{value.title}</Box>\n                        </Box>\n                        {page}\n                    </Box>\n                </Box>\n                <Box as=\"aside\" css={styles.aside} aria-label={head} data-publish-aside=\"\">\n                    <Box css={styles.asideHead}>\n                        <Box as=\"span\" css={styles.asideTitle} data-publish-head=\"\">{head}</Box>\n                        <Box as=\"span\" css={styles.asideSub} data-publish-versions=\"\">\n                            {value.title} ·{\" \"}\n                            {standing === \"template\" ? m.templateKind()\n                                : standing === \"current\" ? `${liveVersion} ${m.liveVersion()}`\n                                    : live === undefined ? <Box as=\"span\" css={styles.asideVersion}>{nextVersion}</Box>\n                                        : <>{liveVersion} → <Box as=\"span\" css={styles.asideVersion}>{nextVersion}</Box></>}\n                        </Box>\n                    </Box>\n                    <Box css={styles.asideBody}>\n                        {standing !== \"template\" && (\n                            <>\n                                <Box as=\"span\" css={styles.listHead} data-publish-count=\"\">{listHead}</Box>\n                                {count > 0 && (\n                                    <Box as=\"ul\" css={styles.list} aria-label={listHead} data-publish-changes=\"\">\n                                        {changes.map((row, i) => {\n                                            const kind = row.change.type;\n                                            return (\n                                                <Box as=\"li\" key={`${row.change.value.cell}-${kind}-${i}`} css={styles.change} data-publish-change={kind}>\n                                                    <Box as=\"span\" css={styles.sign} data-sign={kind} aria-hidden>\n                                                        <FontAwesomeIcon icon={kind === \"added\" ? faPlus : kind === \"removed\" ? faMinus : faPlusMinus} />\n                                                    </Box>\n                                                    <Box css={styles.changeText}>\n                                                        <Box as=\"span\" css={styles.changeLine}>\n                                                            {m.changeVerb({ change: kind })}{\" \"}\n                                                            <Box as=\"strong\" css={styles.changeName}>{row.name}</Box>\n                                                        </Box>\n                                                        <Box as=\"span\" css={styles.changeDetail}>{row.change.value.detail}</Box>\n                                                    </Box>\n                                                </Box>\n                                            );\n                                        })}\n                                    </Box>\n                                )}\n                            </>\n                        )}\n                        {(audience !== undefined || rollout !== undefined) && (\n                            <Box css={styles.facts} data-publish-facts=\"\">\n                                {audience !== undefined && (\n                                    <Box css={styles.fact}>\n                                        <Box as=\"span\" css={styles.factLabel}>{m.audience()}</Box>\n                                        <Box as=\"span\" css={styles.factValue}>{audience}</Box>\n                                    </Box>\n                                )}\n                                {rollout !== undefined && (\n                                    <Box css={styles.fact}>\n                                        <Box as=\"span\" css={styles.factLabel}>{m.rollout()}</Box>\n                                        <Box as=\"span\" css={styles.factValue}>{rollout}</Box>\n                                    </Box>\n                                )}\n                            </Box>\n                        )}\n                        {phase.kind === \"refused\" && (\n                            <Box as=\"span\" role=\"alert\" css={styles.refusal} data-publish-refused=\"\">{phase.reason}</Box>\n                        )}\n                    </Box>\n                    <Box css={styles.foot} data-publish-foot=\"\">\n                        <ChakraButton type=\"button\" variant=\"outline\" size=\"sm\" data-publish-save=\"\"\n                            disabled={!summary.unsaved || busy} loading={phase.kind === \"applying\" && !phase.publish}\n                            onClick={() => ask(\"save\")}>\n                            {m.saveAsDraft()}\n                        </ChakraButton>\n                        <ChakraButton type=\"button\" size=\"sm\" colorPalette=\"brand\" data-publish-publish=\"\"\n                            disabled={standing !== \"ready\" || busy}\n                            loading={(phase.kind === \"applying\" && phase.publish) || phase.kind === \"publishing\"}\n                            onClick={() => { if (summary.unsaved) ask(\"publish\"); else void publish(); }}>\n                            {m.publishTo({ version: standing === \"template\" ? undefined : nextVersion, env })}\n                        </ChakraButton>\n                    </Box>\n                </Box>\n            </Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Studio's East, compiled for its renderers (#1000) — what the builder's\n * palette, canvas, inspector and publish preview, and the page library, show\n * and write is computed by the functions `@elaraai/e3-ui` declares, compiled\n * once, on first use; nothing here restates them.\n *\n * @packageDocumentation\n */\n\nimport { East, type TypeOf, type ValueTypeOf } from \"@elaraai/east\";\nimport {\n    Studio,\n    canvasTiles,\n    inspectorSelection,\n    libraryPages,\n    libraryProjects,\n    libraryTemplates,\n    nameWriteRefusal,\n    paletteCards,\n    palettePages,\n    publishRefusal,\n    publishSummary,\n    saveCells,\n} from \"@elaraai/e3-ui/internal\";\n\n/** The JavaScript function an East function compiles to. */\ntype Compiled<F> = ValueTypeOf<TypeOf<F>>;\n\n/** The Studio's compiled East — see the module docs. */\nexport interface StudioEast {\n    /** Each listed component's palette card. */\n    paletteCards: Compiled<typeof paletteCards>;\n    /** A project's pages, as the palette lists them. */\n    palettePages: Compiled<typeof palettePages>;\n    /** Each listed component's tile on the canvas. */\n    canvasTiles: Compiled<typeof canvasTiles>;\n    /** The selected placement, as the inspector shows it. */\n    inspectorSelection: Compiled<typeof inspectorSelection>;\n    /** What the publish preview shows of the open entry. */\n    publishSummary: Compiled<typeof publishSummary>;\n    /** What refused a publish. */\n    publishRefusal: Compiled<typeof publishRefusal>;\n    /** The projects the record holds. */\n    libraryProjects: Compiled<typeof libraryProjects>;\n    /** A project's pages, as the page library draws them. */\n    libraryPages: Compiled<typeof libraryPages>;\n    /** A project's templates, as the page library draws them. */\n    libraryTemplates: Compiled<typeof libraryTemplates>;\n    /** What refused a write under a new name. */\n    nameWriteRefusal: Compiled<typeof nameWriteRefusal>;\n    /** The changes from one layout of a page to another. */\n    changes: Compiled<typeof Studio.changes>;\n    /** The patch that publishes a page. */\n    publish: Compiled<typeof Studio.publish>;\n    /** The patch that starts a page. */\n    newPage: Compiled<typeof Studio.newPage>;\n    /** The patch that saves a page's draft as a template. */\n    saveTemplate: Compiled<typeof Studio.saveTemplate>;\n    /** The canvas's Apply: a batch of placements, one patch through the record's patch write. */\n    save: Compiled<typeof saveCells>;\n}\n\n/** Compiles every function the renderers call. */\nfunction compileStudio(): StudioEast {\n    return {\n        /** Each listed component's palette card. */\n        paletteCards: East.compile(paletteCards, []),\n        /** A project's pages, as the palette lists them. */\n        palettePages: East.compile(palettePages, []),\n        /** Each listed component's tile on the canvas. */\n        canvasTiles: East.compile(canvasTiles, []),\n        /** The selected placement, as the inspector shows it. */\n        inspectorSelection: East.compile(inspectorSelection, []),\n        /** What the publish preview shows of the open entry. */\n        publishSummary: East.compile(publishSummary, []),\n        /** What refused a publish. */\n        publishRefusal: East.compile(publishRefusal, []),\n        /** The projects the record holds. */\n        libraryProjects: East.compile(libraryProjects, []),\n        /** A project's pages, as the page library draws them. */\n        libraryPages: East.compile(libraryPages, []),\n        /** A project's templates, as the page library draws them. */\n        libraryTemplates: East.compile(libraryTemplates, []),\n        /** What refused a write under a new name. */\n        nameWriteRefusal: East.compile(nameWriteRefusal, []),\n        /** The changes from one layout of a page to another. */\n        changes: East.compile(Studio.changes, []),\n        /** The patch that publishes a page. */\n        publish: East.compile(Studio.publish, []),\n        /** The patch that starts a page. */\n        newPage: East.compile(Studio.newPage, []),\n        /** The patch that saves a page's draft as a template. */\n        saveTemplate: East.compile(Studio.saveTemplate, []),\n        /** The canvas's Apply: a batch of placements, one patch through the record's patch write. */\n        save: East.compileAsync(saveCells, []),\n    };\n}\n\nlet compiled: StudioEast | undefined;\n\n/**\n * The Studio's East, compiled on first use.\n *\n * @returns The compiled functions\n */\nexport function studioEast(): StudioEast {\n    compiled ??= compileStudio();\n    return compiled;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraStudioBuilder` — the renderer of the `StudioBuilder` extension\n * declared in `@elaraai/e3-ui` (#1000): the builder, built in the browser from\n * its interface — the pages record bound with its patch, the listed\n * components, the project, and the publish preview's words.\n *\n * - **The canvas** is the snap grid's editing canvas over the open page's\n *   placements: every gesture a draft of the page's editing session, Apply one\n *   patch through the record's patch write (`saveCells`). Its one toolbar\n *   holds the page's status, the canvas's own items, Save as template, Preview\n *   and Publish; its selection bar names the selected placement. A row short\n *   of room (#1229), once the canvas's own items have folded, folds Save as\n *   template, Preview and Publish into one ⋯ chip, whose menu holds the three\n *   — Save as template… opening its popover from the chip — then the status.\n * - **The palette** ({@link useStudioPalette}) is the pane before it, **the\n *   inspector** ({@link StudioInspector}) the body of the pane after it; the\n *   inspector's edits are requests the canvas takes as one gesture each. Both\n *   are pane descriptions the canvas's builder frame draws (#1125), `auto`:\n *   pinned beside the canvas on a desktop, over it on a narrow screen.\n * - **The publish preview** ({@link StudioPublishPreview}) takes the canvas's\n *   place while it shows. The canvas stays mounted, so its drafts stay its own,\n *   and it applies them when the preview asks before it publishes.\n *\n * What each part shows is e3-ui's East, compiled once ({@link studioEast}).\n * The page open in the builder is the UI store's, by the builder's id, which\n * the page library writes when it opens a page; the selection, the drafts\n * the canvas draws and the preview's state are the builder's own. The builder\n * fills its host and draws no border around itself.\n *\n * In a phone's frame (`Studio Mobile Spec.md`) the canvas is its phone form, which\n * the snap grid draws by itself; the builder gives it the page's head, Add a\n * component and what a card or the inspector's Move starts placing. A tap on a\n * card or a page closes the pane's view; opening a pane ends placing. Its first\n * row is {@link StudioPhoneBar}. The preview's two tabs are what Preview and\n * Publish open.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { Box, Button as ChakraButton, HStack as ChakraHStack, Menu as ChakraMenu, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { faEllipsis } from \"@fortawesome/free-solid-svg-icons\";\nimport {\n    ArrayType, decodeBeast2For, encodeBeast2For, equalFor, none, printFor, some, toEastTypeValue, variant, type ValueTypeOf,\n} from \"@elaraai/east\";\nimport { Editing, EditingDraftFieldType, SnapGrid } from \"@elaraai/east-ui/internal\";\nimport {\n    StudioBuilderComponent, StudioCellType, StudioComponentType, StudioEntryType, StudioKeyType, builderKeys,\n} from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView,\n    ChipMenu,\n    EmptyStateView,\n    NARROW_FRAME,\n    SNAP_GRID_HOST_RANK,\n    SnapGridEditor,\n    implementUIComponent,\n    useContainerWidth,\n    useFormatters,\n    useTrackedEvaluation,\n    type BuilderFrameDock,\n    type SnapGridEditorCell,\n    type SnapGridEditorEditing,\n    type SnapGridEditorValue,\n    type SnapGridPlacing,\n    type ToolbarItem,\n} from \"@elaraai/east-ui-components\";\n\nimport { StudioInspector } from \"./inspector.js\";\nimport { useStudioMessages } from \"./messages.js\";\nimport { useOpenPage, type StudioKey } from \"./open-page.js\";\nimport { StudioLayout, StudioPlacement } from \"./page.js\";\nimport { useStudioPalette } from \"./palette.js\";\nimport { StudioPhoneBar } from \"./phone.js\";\nimport { StudioPublishPreview } from \"./publish.js\";\nimport { StudioSaveTemplate } from \"./save-template.js\";\nimport { studioEast } from \"./studio-east.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The renderer's payload, decoded. */\ntype StudioBuilderValue = ValueTypeOf<typeof StudioBuilderComponent.schema>;\n/** A listed component. */\ntype Component = ValueTypeOf<typeof StudioComponentType>;\n/** One placement. */\ntype Cell = ValueTypeOf<typeof StudioCellType>;\n/** One entry of the pages record. */\ntype Entry = ValueTypeOf<typeof StudioEntryType>;\n/** The canvas's selection, and a change asked of it. */\ntype UiState = ValueTypeOf<typeof SnapGrid.Types.UiState>;\n/** An Apply asked of the canvas, and its answer. */\ntype ApplyState = ValueTypeOf<typeof SnapGrid.Types.ApplyState>;\n/** A change the inspector asks of the canvas. */\ntype Request = ValueTypeOf<typeof SnapGrid.Types.Request>;\n\nconst CellsType = ArrayType(StudioCellType);\nconst encodeCells = encodeBeast2For(CellsType);\nconst decodeCells = decodeBeast2For(CellsType);\nconst encodeCell = encodeBeast2For(StudioCellType);\nconst decodeBatch = decodeBeast2For(Editing.Types.ChangeSet(StudioCellType));\n/** The canvas's entries — a page's placements — and their drafts, as its editing session types them. */\nconst CELL_TYPE = toEastTypeValue(StudioCellType);\nconst CELL_DRAFT_TYPE = toEastTypeValue(EditingDraftFieldType(StudioCellType));\nconst keyEqual = equalFor(StudioKeyType);\nconst printKey = printFor(StudioKeyType);\nconst NOTHING_SELECTED: UiState = { selected: none, request: none };\n\n/**\n * The fold order of the builder's own toolbar items (#1229), after every step\n * of the canvas's own ({@link SNAP_GRID_HOST_RANK}) and before the history\n * item's: Save as template, Preview and Publish fold into the ⋯ chip in one\n * step, then the page's status goes.\n */\nconst RANK_MORE = SNAP_GRID_HOST_RANK;\nconst RANK_STATUS = SNAP_GRID_HOST_RANK + 10;\n/** The fold of Save as template, Preview and Publish into the ⋯ chip: one bundle, applied together. */\nconst MORE_BUNDLE = \"studio.more\";\n\n/** Props of {@link EastChakraStudioBuilder}. */\nexport interface EastChakraStudioBuilderProps {\n    /** The payload, decoded. */\n    value: StudioBuilderValue;\n    /** The structural storage key. */\n    storageKey: string;\n}\n\n/**\n * Renders the builder — see the module docs.\n *\n * @param props - The payload and its storage key\n * @returns The builder\n */\nexport const EastChakraStudioBuilder = memo(function EastChakraStudioBuilder({ value, storageKey }: EastChakraStudioBuilderProps) {\n    const styles = useSlotRecipe({ key: \"studioBuilder\" })() as Styles;\n    const statusRecipe = useSlotRecipe({ key: \"status\" });\n    const m = useStudioMessages();\n    const words = useFormatters();\n    const east = studioEast();\n    const { pages: handle, components, project } = value;\n    const id = value.id.type === \"some\" ? value.id.value : undefined;\n    const keys = useMemo(() => builderKeys(id), [id]);\n\n    // The record, read where the builder renders, and again when it moves.\n    const read = useCallback(() => handle.read(), [handle]);\n    const { result } = useTrackedEvaluation(read);\n    const pages = result.ok ? result.value : undefined;\n\n    // The page open in the builder — the project's first until one is opened.\n    const first = useMemo((): StudioKey => {\n        if (pages !== undefined) {\n            for (const [key, entry] of pages) {\n                if (key.project === project && entry.type === \"page\") return key;\n            }\n        }\n        return { project, page: \"\" };\n    }, [pages, project]);\n    const [open, writeOpen] = useOpenPage(keys.page, first);\n    const openName = printKey(open);\n    let entry: Entry | undefined;\n    if (pages !== undefined) {\n        for (const [key, found] of pages) {\n            if (keyEqual(key, open)) {\n                entry = found;\n                break;\n            }\n        }\n    }\n\n    // The selection, the Apply the preview asks of the canvas, the placements\n    // the canvas draws, and whether the preview shows — the builder's own.\n    const [ui, setUi] = useState<UiState>(NOTHING_SELECTED);\n    const [applying, setApplying] = useState<ApplyState>(variant(\"idle\", null));\n    const [drafted, setDrafted] = useState<{ page: string; cells: readonly Cell[] } | undefined>(undefined);\n    const [previewing, setPreviewing] = useState(false);\n    // A phone's frame: the builder's own width, its open preview tab, what is being placed, and its panes' views.\n    const widthRef = useRef<HTMLDivElement | null>(null);\n    const width = useContainerWidth(widthRef);\n    const phone = width > 0 && width <= NARROW_FRAME;\n    const [previewTab, setPreviewTab] = useState<\"page\" | \"changes\">(\"page\");\n    const [placing, setPlacing] = useState<SnapGridPlacing | undefined>(undefined);\n    const [collapsed, setCollapsed] = useState({ start: false, end: false });\n    // Save as template's popover, opened from the ⋯ chip's menu (#1229).\n    const [naming, setNaming] = useState(false);\n    // A page opened from anywhere — the palette, the page library — opens with nothing selected.\n    const shown = useRef(openName);\n    useEffect(() => {\n        if (shown.current === openName) return;\n        shown.current = openName;\n        setUi(NOTHING_SELECTED);\n    }, [openName]);\n\n    // The open page's placements as saved, and as the canvas draws them (its\n    // drafts in place).\n    const saved = useMemo((): readonly Cell[] => (entry === undefined ? [] : entry.type === \"page\" ? entry.value.draft.cells : entry.value.cells), [entry]);\n    const cells = drafted !== undefined && drafted.page === openName ? drafted.cells : saved;\n    const title = entry === undefined ? \"\" : entry.type === \"page\" ? entry.value.draft.title : entry.value.title;\n\n    // ── The canvas ────────────────────────────────────────────────────────\n    const tiles = useMemo(() => east.canvasTiles(components), [east, components]);\n    // Each tile's component, for the tile's content — kept as the canvas's\n    // cells are drawn, so a dropped card's tile finds its component at once.\n    const componentOf = useRef(new Map<string, string>());\n    const cellView = useCallback((cell: Cell): SnapGridEditorCell => {\n        componentOf.current.set(cell.key, cell.component);\n        const tile = tiles.get(cell.component);\n        return {\n            key: cell.key,\n            row: cell.row,\n            span: cell.span,\n            height: cell.height,\n            minHeight: none,\n            align: cell.align,\n            // A frameless component renders bare; one the surface does not\n            // list is its placeholder, in a tile.\n            frame: tile === undefined ? true : tile.frame,\n            label: cell.title.type === \"some\" ? cell.title : tile === undefined ? none : some(tile.name),\n            icon: tile === undefined ? none : some(tile.icon),\n            // What its code reads, never its key; a component the surface does not list is known by its key alone.\n            meta: tile === undefined ? some(cell.component) : tile.meta.length === 0 ? none : some(tile.meta),\n        };\n    }, [tiles]);\n    const snapshot = useMemo(() => encodeCells([...saved]), [saved]);\n    const editing = useMemo((): SnapGridEditorEditing => ({\n        sourceId: `studio.page:${openName}`,\n        entryType: CELL_TYPE,\n        idField: some(\"key\"),\n        draftType: CELL_DRAFT_TYPE,\n        children: none,\n        keyType: none,\n        snapshot: some(snapshot),\n        readEntry: (entryId: string) => {\n            const cell = saved.find((c) => c.key === entryId);\n            return cell === undefined ? none : some(encodeCell(cell));\n        },\n        onPatch: none,\n        // Apply: the batch, one patch on the page through the record's patch write.\n        onApply: some(variant(\"async\", (bytes: Uint8Array) => east.save(handle, open, decodeBatch(bytes)))),\n        fields: { key: \"key\", row: \"row\", span: \"span\", height: some(\"height\"), align: some(\"align\") },\n        derive: (bytes: Uint8Array) => decodeCells(bytes).map(cellView),\n        // A component dropped from the palette: a placement at its span; the\n        // canvas fits the span to the row.\n        create: some((card: { library: string; key: string }, at: { key: string; row: string }) => {\n            const component = components.find((c) => c.key === card.key);\n            if (component === undefined) throw new Error(`No component \"${card.key}\" is listed`);\n            return encodeCell({\n                key: at.key,\n                row: at.row,\n                span: component.span,\n                height: none,\n                align: variant(\"top\", null),\n                title: none,\n                component: component.key,\n            });\n        }),\n        ready: none,\n        // The rows the canvas draws, for the palette's counts, the inspector and the preview.\n        onDrafted: some((bytes: Uint8Array) => {\n            setDrafted({ page: openName, cells: decodeCells(bytes) });\n            return null;\n        }),\n    }), [openName, snapshot, saved, east, handle, open, cellView, components]);\n    const uiBind = useMemo(() => ({\n        read: () => ui,\n        write: (next: UiState) => { setUi(next); return null; },\n        has: () => true,\n    }), [ui]);\n    const applyBind = useMemo(() => ({\n        read: () => applying,\n        write: (next: ApplyState) => { setApplying(next); return null; },\n        has: () => true,\n    }), [applying]);\n    const canvas = useMemo((): SnapGridEditorValue => ({\n        cells: saved.map(cellView),\n        variant: none,\n        width: some(\"1440px\"),\n        height: some(\"fill\"),\n        maxHeight: none,\n        zoom: none,\n        guides: true,\n        editing: some(editing),\n        ui: some(uiBind),\n        view: none,\n        apply: some(applyBind),\n        id: none,\n        sources: [keys.components],\n        canDrop: none,\n        widths: [\n            { label: m.device({ device: \"desktop\" }), icon: some(\"desktop\"), width: \"1440px\" },\n            { label: m.device({ device: \"tablet\" }), icon: some(\"tablet-screen-button\"), width: \"1024px\" },\n        ],\n        toolbar: { start: [], end: [] },\n        panes: { start: none, end: none },\n        surface: some(variant(\"shell\", null)),\n    }), [saved, cellView, editing, uiBind, applyBind, keys.components, m]);\n\n    // Each tile's content: its component's own UI, or its placeholder.\n    const listedByKey = useMemo(() => {\n        const byKey = new Map<string, Component[]>();\n        for (const component of components) {\n            const same = byKey.get(component.key);\n            if (same === undefined) byKey.set(component.key, [component]);\n            else same.push(component);\n        }\n        return byKey;\n    }, [components]);\n    const renderContent = useCallback((cell: SnapGridEditorCell) => {\n        const component = componentOf.current.get(cell.key) ?? \"\";\n        return <StudioPlacement component={component} listed={listedByKey.get(component) ?? []} storageKey={`${storageKey}.canvas.${cell.key}`} />;\n    }, [listedByKey, storageKey]);\n\n    // ── The toolbar: the page's status, Save as template, Preview and Publish ──\n    const status = entry === undefined ? undefined\n        : entry.type === \"template\" ? { label: m.statusTemplate(), tone: \"neutral\" as const, ring: false }\n            : entry.value.live.type === \"none\" ? { label: m.statusDraft(), tone: \"neutral\" as const, ring: true }\n                : east.changes(entry.value.live.value.page, entry.value.draft).length === 0\n                    ? { label: m.statusLive(), tone: \"success\" as const, ring: false }\n                    : { label: m.statusLiveEdited(), tone: \"warning\" as const, ring: false };\n    const statusStyles = status === undefined ? undefined : statusRecipe({ status: status.tone, size: \"md\", ring: status.ring }) as Styles;\n    const taken = useMemo(() => {\n        const names = new Set<string>();\n        if (pages !== undefined) {\n            for (const [key] of pages) {\n                if (key.project === open.project) names.add(key.page);\n            }\n        }\n        return names;\n    }, [pages, open.project]);\n    const saveTemplate = useMemo(() => ({\n        title,\n        enabled: entry !== undefined && entry.type === \"page\",\n        taken,\n        // The open page, as last saved, as a template under a name — one commit.\n        onSave: async (name: string) => {\n            const now = handle.read();\n            const patch = east.saveTemplate(now, open, { project: open.project, page: name }, name);\n            const outcome = await handle.commit.patch(\"\", patch);\n            return east.nameWriteRefusal(outcome, name);\n        },\n    }), [title, entry, taken, handle, east, open]);\n    // Folded, the three are one ⋯ chip: its menu holds them, and Save as\n    // template… opens their popover from the chip, which holds its item open.\n    const more = (\n        <StudioSaveTemplate value={saveTemplate} open={naming} onOpenChange={setNaming} anchor={\n            <ChipMenu label={m.more()} icon={faEllipsis} data=\"data-studio-more\" onSelect={(picked) => {\n                if (picked === \"save-template\") setNaming(true);\n                else if (picked === \"preview\" || picked === \"publish\") setPreviewing(true);\n            }}>\n                <ChakraMenu.Item value=\"save-template\" disabled={!saveTemplate.enabled}\n                    {...(saveTemplate.enabled ? {} : { title: m.templateOpen() })}>{m.saveAsTemplateItem()}</ChakraMenu.Item>\n                <ChakraMenu.Item value=\"preview\">{m.preview()}</ChakraMenu.Item>\n                <ChakraMenu.Item value=\"publish\">{m.publish()}</ChakraMenu.Item>\n            </ChipMenu>\n        } />\n    );\n    const toolbar = phone ? {\n        end: [{\n            key: \"studio.phone\", forms: [null], phone: {\n                grow: true,\n                form: <StudioPhoneBar status={status} saveTemplate={saveTemplate} project={open.project}\n                    onPreview={() => { setPreviewTab(\"page\"); setPreviewing(true); }} onPublish={() => { setPreviewTab(\"changes\"); setPreviewing(true); }} />,\n            },\n        } satisfies ToolbarItem],\n    } : {\n        start: [status !== undefined && statusStyles !== undefined && {\n            key: \"status\",\n            side: \"start\",\n            version: status.label,\n            rank: RANK_STATUS,\n            forms: [\n                <ChakraHStack css={statusStyles.root} data-studio-status={status.tone}>\n                    <Box as=\"span\" css={statusStyles.indicator} />\n                    <Box css={statusStyles.label}>{status.label}</Box>\n                </ChakraHStack>,\n                null,\n            ],\n        } satisfies ToolbarItem],\n        end: [\n            {\n                key: \"save-template\", side: \"end\", rank: RANK_MORE, bundle: MORE_BUNDLE,\n                forms: [<StudioSaveTemplate value={saveTemplate} />, null],\n            } satisfies ToolbarItem,\n            // As tall as every control in the row (`sm`, 28px, ruled 23 Oct 2026).\n            {\n                key: \"preview\", side: \"end\", rank: RANK_MORE, bundle: MORE_BUNDLE,\n                forms: [<ChakraButton variant=\"outline\" size=\"sm\" data-studio-preview=\"\" onClick={() => setPreviewing(true)}>{m.preview()}</ChakraButton>, null],\n            } satisfies ToolbarItem,\n            {\n                key: \"publish\", side: \"end\", rank: RANK_MORE, bundle: MORE_BUNDLE,\n                forms: [<ChakraButton variant=\"outline\" size=\"sm\" data-studio-open-publish=\"\" onClick={() => setPreviewing(true)}>{m.publish()}</ChakraButton>, null],\n            } satisfies ToolbarItem,\n            { key: \"more\", side: \"end\", rank: RANK_MORE, bundle: MORE_BUNDLE, held: naming, forms: [null, more] } satisfies ToolbarItem,\n        ],\n    };\n\n    // ── The palette, before the canvas ───────────────────────────────────\n    const listed = useMemo(() => components.filter((c) => !c.deprecated), [components]);\n    const cards = useMemo(() => east.paletteCards(listed, [...cells], phone ? none : ui.selected), [east, listed, cells, ui.selected, phone]);\n    const projectPages = useMemo(() => (pages === undefined ? [] : east.palettePages(pages, project)), [east, pages, project]);\n    // A card's click selects its component's first placement on the page.\n    const selectFirst = useCallback((component: string) => {\n        const placement = cells.find((c) => c.component === component);\n        if (placement !== undefined) setUi({ selected: some(placement.key), request: none });\n    }, [cells]);\n    // A page's click opens it, with nothing selected.\n    const openPage = useCallback((page: string) => {\n        writeOpen({ project, page });\n        setUi(NOTHING_SELECTED);\n        setPlacing(undefined);\n        setCollapsed((was) => (phone ? { ...was, start: true } : was));\n    }, [writeOpen, project, phone]);\n    // A card's tap on a phone: the view closes and placing starts (ST22).\n    const onPage = useMemo(() => new Set(cells.map((c) => c.component)), [cells]);\n    const palettePhone = useMemo(() => (!phone ? undefined : {\n        onPage,\n        onPlace: (component: Component) => {\n            setUi(NOTHING_SELECTED);\n            setPlacing({ kind: \"add\", card: { library: keys.components, key: component.key }, label: component.name, span: Number(component.span) });\n            setCollapsed((was) => ({ ...was, start: true }));\n        },\n    }), [phone, onPage, keys.components]);\n    const paletteIds = useMemo(() => ({ components: keys.components, pages: keys.pages }), [keys.components, keys.pages]);\n    const palette = useStudioPalette({\n        components: listed, cards, pages: projectPages, open: open.project === project ? open.page : \"\", ids: paletteIds,\n        onSelect: selectFirst, onOpen: openPage, storageKey, phone: palettePhone,\n    });\n\n    // ── The inspector, after it ──────────────────────────────────────────\n    const selection = useMemo(() => east.inspectorSelection(components, [...cells], ui.selected),\n        [east, components, cells, ui.selected]);\n    // A layout edit is a request on the selection: the canvas takes it as one gesture.\n    const onRequest = useCallback((request: Request) => {\n        setUi({ selected: some(request.key), request: some(request) });\n        return null;\n    }, []);\n    const inspector = useMemo(() => ({ selection, onRequest }), [selection, onRequest]);\n    const selected = selection.type === \"some\" ? selection.value : undefined;\n    // Where the selected placement stands, for a phone's inspector (ST24).\n    const inspectorPhone = useMemo(() => {\n        if (!phone) return undefined;\n        const rowKeys = [...new Set(cells.map((c) => c.row))];\n        const key = selected?.key;\n        const cell = cells.find((c) => c.key === key);\n        let first = 1;\n        for (const c of cells) {\n            if (c.key === key) break;\n            if (c.row === cell?.row) first += Number(c.span);\n        }\n        const was = saved.find((c) => c.key === key);\n        return {\n            rows: rowKeys.length, first, dirty: was !== undefined && cell !== undefined && was.span !== cell.span,\n            onMove: (moved: string) => {\n                setPlacing({ kind: \"move\", key: moved });\n                setCollapsed((c) => ({ ...c, end: true }));\n            },\n        };\n    }, [phone, cells, saved, selected?.key]);\n    // One body, 300px wide; its rail names the selected placement, in the brand while there is one.\n    const inspectorBody = <StudioInspector value={inspector} phone={inspectorPhone} />;\n    const inspectorPane = useMemo((): BuilderFrameDock => (inspectorPhone !== undefined ? {\n        label: m.inspector(),\n        icon: \"sliders\",\n        // The strip's meta: its row, while something is selected (ST21).\n        ...(selected === undefined ? {} : { detail: m.phoneRowMeta({ row: words.number(Number(selected.layout.row)) }) }),\n        tabs: [{ key: \"details\", label: m.phoneDetails(), body: inspectorBody }],\n    } : {\n        label: m.inspector(),\n        icon: \"sliders\",\n        badge: selected === undefined ? \"\" : m.spanBadge({ span: words.number(Number(selected.layout.span)) }),\n        active: selected !== undefined,\n        detail: selected === undefined ? m.nothingSelected() : selected.name,\n        size: \"300px\",\n        body: inspectorBody,\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- the body is made again with what it reads.\n    }), [m, words, selected, inspector, inspectorPhone]);\n    // The panes' collapse is the builder's, so a card's tap can close its view; every width's goes through here.\n    const panePaletteCollapse = (next: boolean) => {\n        setCollapsed((was) => (was.start === next ? was : { ...was, start: next }));\n        if (!next && phone) setPlacing(undefined);\n    };\n    const paneInspectorCollapse = (next: boolean) => {\n        setCollapsed((was) => (was.end === next ? was : { ...was, end: next }));\n        if (!next && phone) setPlacing(undefined);\n    };\n\n    // ── The publish preview, in the canvas's place ───────────────────────\n    const summary = useMemo(() => (entry === undefined ? undefined\n        : east.publishSummary(components, entry.type === \"page\" ? entry.value.live : none, { title, cells: [...cells] }, [...saved], entry.type === \"template\")),\n    [east, components, entry, title, cells, saved]);\n    const preview = useMemo(() => (summary === undefined ? undefined : {\n        project: open.project,\n        title,\n        summary,\n        env: value.env,\n        audience: value.audience,\n        rollout: value.rollout,\n        apply: applying,\n        // The canvas applies its drafts, and answers under the id.\n        onApply: (ask: string) => { setApplying(variant(\"asked\", ask)); return null; },\n        // The publish, from the record as it stands when it commits — what an\n        // Apply just before it left.\n        onPublish: async () => {\n            const now = handle.read();\n            const patch = east.publish(now, open);\n            const outcome = await handle.commit.patch(\"\", patch);\n            return east.publishRefusal(outcome);\n        },\n        onExit: some(() => { setPreviewing(false); return null; }),\n    }), [summary, open, title, value.env, value.audience, value.rollout, applying, handle, east]);\n\n    if (!result.ok) {\n        const message = result.error instanceof Error ? result.error.message : String(result.error);\n        return <BannerView status=\"error\" title={message} />;\n    }\n    if (entry === undefined) {\n        return (\n            <EmptyStateView icon={{ prefix: \"fas\", name: \"file-circle-question\" }}\n                title={m.noPageOpen()} description={m.noPageOpenHint({ project, page: open.page })} />\n        );\n    }\n    return (\n        <Box ref={widthRef} css={styles.root} data-studio-builder=\"\">\n            <Box css={styles.canvas} hidden={previewing} data-studio-canvas=\"\">\n                <SnapGridEditor\n                    value={canvas}\n                    storageKey={`${storageKey}.canvas`}\n                    toolbar={toolbar}\n                    renderContent={renderContent}\n                    panes={{\n                        start: { ...palette, collapsed: collapsed.start, onCollapsedChange: panePaletteCollapse },\n                        end: { ...inspectorPane, collapsed: collapsed.end, onCollapsedChange: paneInspectorCollapse },\n                    }}\n                    phone={{\n                        eyebrow: open.project, title, placing, onPlacing: setPlacing,\n                        onAdd: () => { setPlacing(undefined); setCollapsed((was) => ({ ...was, start: false })); },\n                    }}\n                />\n            </Box>\n            {previewing && preview !== undefined && (\n                <StudioPublishPreview value={preview}\n                    page={<StudioLayout cells={cells} components={components} storageKey={`${storageKey}.preview`} />}\n                    phone={!phone ? undefined : {\n                        tab: previewTab, onTab: setPreviewTab, width,\n                        tiles: cells.map((cell) => ({\n                            key: cell.key, row: cell.row, span: Number(cell.span),\n                            name: cell.title.type === \"some\" ? cell.title.value : tiles.get(cell.component)?.name ?? cell.component,\n                        })),\n                    }} />\n            )}\n        </Box>\n    );\n});\n\nimplementUIComponent(StudioBuilderComponent, EastChakraStudioBuilder);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraStudioLibrary` — the renderer of the `StudioLibrary`\n * extension declared in `@elaraai/e3-ui` (#997): the page library, built in\n * the browser from its interface — the pages record bound with its patch, the\n * listed components, the project it shows first, the builder it opens pages\n * in, and who to tell.\n *\n * - **One toolbar row**, the shared `Toolbar`: the search over both rows,\n *   Sort · Name, the Pages row's Grid · List, a rule, and the primary\n *   \"+ New page in <project>\", folded on one ladder.\n * - **The pane**: the projects, the shown one in the brand; the project's\n *   pages with their status dots, the one open in the builder in the strong\n *   ink; the legend at its foot.\n * - **The Templates and Pages rows**, under their heads: two Library\n *   galleries, which draw no toolbar of their own, each card's media a\n *   wireframe of its layout.\n * - **The New page popover**, under the primary action however it opens —\n *   from it, a template's card or the dashed card, which pick its template —\n *   taking a name the project does not hold and a template, or Blank grid.\n *\n * What it shows is e3-ui's East, compiled once ({@link studioEast}); the\n * project shown, the search, the order, the layout and the popover are its\n * own. \"Open in builder →\" writes the builder's open page, shared by `id`,\n * and tells the host; a new page is one commit through the record's patch\n * write. It draws no border around itself.\n *\n * Its layout is the `studioLibrary` recipe's; its controls are the\n * theme's shared ones — the Library's search box, the `button` recipe, the\n * `seg` strip, the `status` dots, the edit popover and the `select`, its\n * chevron and check Font Awesome's (#1263).\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useId, useMemo, useState, type ReactNode } from \"react\";\nimport {\n    Box, chakra, createListCollection, Menu as ChakraMenu, Portal, Select as ChakraSelect, useRecipe, useSlotRecipe,\n    type SystemStyleObject,\n} from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n    faArrowDownAZ, faArrowDownZA, faCaretDown, faCheck, faChevronDown, faFolder, faFolderOpen, faMagnifyingGlass, faPlus, faXmark,\n    type IconDefinition,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { none, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { StudioCellType, StudioLibraryComponent, builderKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, EastChakraLibrary, LibraryLayoutSwitch, SnapGridTiles, Toolbar, implementUIComponent, useFormatters,\n    useTrackedEvaluation, type LibraryItemValue, type LibraryValue, type SnapGridLayoutCell, type ToolbarItem,\n} from \"@elaraai/east-ui-components\";\n\nimport { NamePopover } from \"../shared/name-popover.js\";\nimport { useStudioMessages, type StudioMessages } from \"./messages.js\";\nimport { useOpenPage, type StudioKey } from \"./open-page.js\";\nimport { studioEast } from \"./studio-east.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The renderer's payload, decoded. */\ntype StudioLibraryValue = ValueTypeOf<typeof StudioLibraryComponent.schema>;\n/** One placement. */\ntype Cell = ValueTypeOf<typeof StudioCellType>;\n/** How the rows are ordered by name: A to Z, the record's key order, or Z to A. */\ntype Sort = \"az\" | \"za\";\n/** How the Pages row lays its cards out. */\ntype Layout = \"grid\" | \"list\";\n\n/** The toolbar's fold ranks: the primary action drops its project, Sort\n *  folds to its icon, the primary action to its plus, and last the search\n *  narrows twice. The layout switch never folds. */\nconst RANK = { newPage: 0, sort: 1, newPageIcon: 2, searchMid: 3, searchNarrow: 4 } as const;\n\n/** The orders Sort offers, in its menu's order, with the icon it folds to. */\nconst SORTS: ReadonlyArray<{ key: Sort; icon: IconDefinition; name: (m: StudioMessages) => string }> = [\n    { key: \"az\", icon: faArrowDownAZ, name: (m) => m.nameAz() },\n    { key: \"za\", icon: faArrowDownZA, name: (m) => m.nameZa() },\n];\n\n/** The template picker's value for Blank grid — no template's name can be it. */\nconst BLANK = \"\\u0000blank\";\n\n/** Props of {@link EastChakraStudioLibrary}. */\nexport interface EastChakraStudioLibraryProps {\n    /** The payload, decoded. */\n    value: StudioLibraryValue;\n    /** The structural storage key. */\n    storageKey: string;\n}\n\n/**\n * Sort · Name, opening a menu of the two orders — folded, the trigger is the\n * order's icon, the words its name and tooltip.\n */\nfunction SortMenu({ sort, onPick, compact, trigger, caret, check }: {\n    sort: Sort;\n    onPick: (sort: Sort) => void;\n    compact: boolean;\n    trigger: SystemStyleObject;\n    caret: SystemStyleObject;\n    check: SystemStyleObject;\n}) {\n    const m = useStudioMessages();\n    const current = SORTS.find((s) => s.key === sort) ?? SORTS[0]!;\n    const words = m.sortByName();\n    return (\n        <ChakraMenu.Root positioning={{ placement: \"bottom-end\" }}>\n            <ChakraMenu.Trigger asChild>\n                <chakra.button type=\"button\" css={trigger} data-page-library-sort=\"\"\n                    {...(compact ? { \"aria-label\": words, title: words } : {})}>\n                    {compact ? <FontAwesomeIcon icon={current.icon} /> : (\n                        <>\n                            {words}\n                            <Box as=\"span\" css={caret} aria-hidden><FontAwesomeIcon icon={faCaretDown} /></Box>\n                        </>\n                    )}\n                </chakra.button>\n            </ChakraMenu.Trigger>\n            <Portal>\n                <ChakraMenu.Positioner>\n                    <ChakraMenu.Content>\n                        <ChakraMenu.RadioItemGroup value={sort} onValueChange={(d) => {\n                            const picked = SORTS.find((s) => s.key === d.value);\n                            if (picked !== undefined && picked.key !== sort) onPick(picked.key);\n                        }}>\n                            {SORTS.map((s) => (\n                                <ChakraMenu.RadioItem key={s.key} value={s.key}>\n                                    <Box as=\"span\" css={check}>{s.key === sort && <FontAwesomeIcon icon={faCheck} />}</Box>\n                                    {s.name(m)}\n                                </ChakraMenu.RadioItem>\n                            ))}\n                        </ChakraMenu.RadioItemGroup>\n                    </ChakraMenu.Content>\n                </ChakraMenu.Positioner>\n            </Portal>\n        </ChakraMenu.Root>\n    );\n}\n\n/**\n * Renders the page library — see the module docs.\n *\n * @param props - The payload and its storage key\n * @returns The page library\n */\nexport const EastChakraStudioLibrary = memo(function EastChakraStudioLibrary({ value, storageKey }: EastChakraStudioLibraryProps) {\n    const styles = useSlotRecipe({ key: \"studioLibrary\" })() as Styles;\n    const library = useSlotRecipe({ key: \"library\" })() as Styles;\n    const edit = useSlotRecipe({ key: \"sliceEdit\" })() as Styles;\n    const status = useSlotRecipe({ key: \"status\" });\n    const liveDot = status({ status: \"success\" }) as Styles;\n    const draftDot = status({ status: \"neutral\", ring: true }) as Styles;\n    const button = useRecipe({ key: \"button\" });\n    const m = useStudioMessages();\n    const words = useFormatters();\n    const id = useId();\n    const east = studioEast();\n    const { pages: handle, components } = value;\n    const home = value.project;\n    const keys = useMemo(() => builderKeys(value.id.type === \"some\" ? value.id.value : undefined), [value.id]);\n    const tellHost = value.onOpen.type === \"some\" ? value.onOpen.value : undefined;\n\n    // The record, read where the page library renders, and again when it moves.\n    const read = useCallback(() => handle.read(), [handle]);\n    const { result } = useTrackedEvaluation(read);\n    const records = result.ok ? result.value : undefined;\n\n    // Its own view: the project it shows, the search, the order, the Pages\n    // row's layout, and the New page popover — the template it starts from,\n    // `\"\"` for Blank grid, while it is open.\n    const [project, setProject] = useState(home);\n    const [text, setText] = useState(\"\");\n    const [sort, setSort] = useState<Sort>(\"az\");\n    const [layout, setLayout] = useState<Layout>(\"grid\");\n    const [popover, setPopover] = useState<string | undefined>(undefined);\n    const needle = text.toLowerCase();\n\n    // The builder's open page — the project's first to begin with.\n    const first = useMemo((): StudioKey => {\n        if (records !== undefined) {\n            for (const [key, entry] of records) {\n                if (key.project === home && entry.type === \"page\") return key;\n            }\n        }\n        return { project: home, page: \"\" };\n    }, [records, home]);\n    const [open, writeOpen] = useOpenPage(keys.page, first);\n\n    // The rows: the search narrows them by title, and Sort orders them by name\n    // — the record's key order, or its reverse.\n    const za = sort === \"za\";\n    const everyPage = useMemo(() => (records === undefined ? [] : east.libraryPages(records, project)), [east, records, project]);\n    const everyTemplate = useMemo(() => (records === undefined ? [] : east.libraryTemplates(records, project, components)),\n        [east, records, project, components]);\n    const pageRows = useMemo(() => {\n        const matching = everyPage.filter((p) => p.title.toLowerCase().includes(needle));\n        return za ? matching.reverse() : matching;\n    }, [everyPage, needle, za]);\n    const paneRows = useMemo(() => {\n        const byName = records === undefined ? [] : east.palettePages(records, project);\n        return za ? [...byName].reverse() : byName;\n    }, [east, records, project, za]);\n    const templateRows = useMemo(() => {\n        const matching = everyTemplate.filter((t) => t.title.toLowerCase().includes(needle));\n        const ordered = za ? matching.reverse() : matching;\n        // Blank grid is built in, first; its name is none a template can have.\n        const blank = { name: \"\", title: m.blankGrid(), summary: m.blankSummary(), cells: [] };\n        return m.blankGrid().toLowerCase().includes(needle) ? [blank, ...ordered] : ordered;\n    }, [everyTemplate, needle, za, m]);\n    const projects = useMemo(() => (records === undefined ? [home] : east.libraryProjects(records, home)), [east, records, home]);\n    const taken = useMemo(() => {\n        const names = new Set<string>();\n        if (records !== undefined) {\n            for (const [key] of records) {\n                if (key.project === project) names.add(key.page);\n            }\n        }\n        return names;\n    }, [records, project]);\n\n    // \"Open in builder →\": the builder's open page, and the host told.\n    const openPage = useCallback((name: string) => {\n        const key = { project, page: name };\n        writeOpen(key);\n        if (tellHost !== undefined) queueMicrotask(() => tellHost(key));\n    }, [project, writeOpen, tellHost]);\n\n    // A template's card starts a new page from it, Blank grid's from nothing,\n    // and the dashed card from nothing too — each opening the popover under\n    // the New page button.\n    const startFrom = useCallback((name: string) => setPopover(name), []);\n    const startBlank = useCallback(() => setPopover(\"\"), []);\n    // Each card's media: a wireframe of its layout, at a twelfth of the page's\n    // scale, a content-height placement a KPI's.\n    const wireframes = useMemo(() => {\n        const out = new Map<string, SnapGridLayoutCell[]>();\n        const layouts: ReadonlyArray<readonly [string, readonly Cell[]]> = [\n            ...templateRows.map((t) => [`template:${t.name}`, t.cells] as const),\n            ...pageRows.map((p) => [`page:${p.page}`, p.cells] as const),\n        ];\n        for (const [card, cells] of layouts) {\n            out.set(card, cells.map((c) => ({\n                key: c.key,\n                row: c.row,\n                span: c.span,\n                height: some(c.height.type === \"some\" ? c.height.value / 12n : 12n),\n                align: c.align,\n                frame: true,\n            })));\n        }\n        return out;\n    }, [templateRows, pageRows]);\n    const templateMedia = useCallback((item: LibraryItemValue) => (\n        <SnapGridTiles wireframe cells={wireframes.get(`template:${item.key}`) ?? []} content={() => null} />\n    ), [wireframes]);\n    const pageMedia = useCallback((item: LibraryItemValue) => (\n        <SnapGridTiles wireframe cells={wireframes.get(`page:${item.key}`) ?? []} content={() => null} />\n    ), [wireframes]);\n\n    const templatesGallery = useMemo((): LibraryValue => ({\n        id: `${storageKey}.templates`,\n        hint: none,\n        items: templateRows.map((t): LibraryItemValue => ({\n            key: t.name, label: t.title, sublabel: some(t.summary), icon: none, status: none, trailing: none,\n            draggable: false, filtered: false, placed: false, media: none, avatar: none, byline: none, action: none,\n            search: none, groups: new Map(), facets: new Map(), dims: new Map(),\n        })),\n        groupOptions: [], groupSummaries: new Map(), dimOptions: [], defaultDimensions: [], filterOptions: [],\n        searchable: false, noun: none, addLabel: none, onAdd: none,\n        onCardClick: some((name: string) => { startFrom(name); return null; }),\n        slice: none,\n        style: some({ height: none, maxHeight: none, virtualization: none, columns: some(4n), mediaPlacement: none, mediaSize: some(\"80px\") }),\n        variant: some(variant(\"gallery\", null)),\n        layout: none,\n        toolbar: false,\n    }), [storageKey, templateRows, startFrom]);\n    const pagesGallery = useMemo((): LibraryValue => ({\n        id: `${storageKey}.pages`,\n        hint: none,\n        items: pageRows.map((p): LibraryItemValue => ({\n            key: p.page, label: p.title,\n            sublabel: some(m.placements({ n: p.cells.length, count: words.number(p.cells.length) })),\n            icon: none,\n            status: some(p.live\n                ? { label: m.live(), tone: variant(\"success\", null), ring: false }\n                : { label: m.draft(), tone: variant(\"neutral\", null), ring: true }),\n            trailing: none, draggable: false, filtered: false, placed: false, media: none, avatar: none, byline: none,\n            action: some(m.openInBuilder()),\n            search: none, groups: new Map(), facets: new Map(), dims: new Map(),\n        })),\n        groupOptions: [], groupSummaries: new Map(), dimOptions: [], defaultDimensions: [], filterOptions: [],\n        searchable: false, noun: none,\n        addLabel: some(m.newPageFromTemplate()),\n        onAdd: some(() => { startBlank(); return null; }),\n        onCardClick: some((name: string) => { openPage(name); return null; }),\n        slice: none,\n        style: some({ height: none, maxHeight: none, virtualization: none, columns: some(2n), mediaPlacement: some(variant(\"start\", null)), mediaSize: some(\"156px\") }),\n        variant: some(variant(\"gallery\", null)),\n        layout: some(layout === \"list\" ? variant(\"list\", null) : variant(\"grid\", null)),\n        toolbar: false,\n    }), [storageKey, pageRows, m, words, startBlank, openPage, layout]);\n\n    // The New page popover, and the template it starts from — the one whose\n    // card opened it, else Blank grid; each opening starts over.\n    const from = popover !== undefined && popover !== \"\" ? popover : BLANK;\n    const [template, setTemplate] = useState(from);\n    const [openedFrom, setOpenedFrom] = useState(popover);\n    if (popover !== openedFrom) {\n        setOpenedFrom(popover);\n        if (popover !== undefined) setTemplate(from);\n    }\n    const picker = useMemo(() => createListCollection({\n        items: [{ value: BLANK, label: m.blankGrid() }, ...everyTemplate.map((t) => ({ value: t.name, label: t.title }))],\n    }), [everyTemplate, m]);\n    // A new page: one commit inserting it, its draft the template's placements.\n    const create = async (name: string) => {\n        const now = handle.read();\n        const key = { project, page: name };\n        const patch = east.newPage(now, key, name, template === BLANK ? none : some({ project, page: template }));\n        const outcome = await handle.commit.patch(\"\", patch);\n        const refused = east.nameWriteRefusal(outcome, name);\n        return refused.type === \"some\" ? refused.value : undefined;\n    };\n\n    const np = everyPage.length;\n    const nt = everyTemplate.length + 1;\n    const shown = pageRows.length;\n    const current = open.project === project ? open.page : \"\";\n\n    // The search box at a width the toolbar folds it to — one element in\n    // every form, so the field keeps its focus and its text as the row folds.\n    const searchBox = (size: \"wide\" | \"mid\" | \"narrow\") => (\n        <Box css={library.searchBox} data-size={size}>\n            <Box as=\"span\" css={library.searchIcon} aria-hidden>\n                <FontAwesomeIcon icon={faMagnifyingGlass} />\n            </Box>\n            <chakra.input\n                css={library.searchInput}\n                placeholder={m.searchLibrary({ pages: words.number(np), templates: words.number(nt), np, nt })}\n                aria-label={m.searchLabel()}\n                value={text}\n                data-page-library-search=\"\"\n                onChange={(e: React.ChangeEvent<HTMLInputElement>) => setText(e.target.value)}\n                onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\n                    if (e.key === \"Escape\" && text !== \"\") {\n                        e.preventDefault();\n                        setText(\"\");\n                    }\n                }}\n            />\n            {text !== \"\" && (\n                <chakra.button type=\"button\" css={library.searchClear} aria-label={m.clearSearch()} onClick={() => setText(\"\")}>\n                    <FontAwesomeIcon icon={faXmark} />\n                </chakra.button>\n            )}\n        </Box>\n    );\n    const sortMenu = (compact: boolean) => (\n        <SortMenu sort={sort} compact={compact} trigger={button({ variant: \"outline\", size: \"sm\" }) as SystemStyleObject}\n            caret={styles.caret!} check={library.menuCheck!} onPick={setSort} />\n    );\n    // The primary action, in each of its forms, is the New page popover's trigger.\n    const newPage = (form: \"full\" | \"short\" | \"icon\"): ReactNode => (\n        <NamePopover\n            open={popover !== undefined}\n            onOpenChange={(next) => setPopover(next ? \"\" : undefined)}\n            trigger={\n                <chakra.button type=\"button\" css={button({ variant: \"solid\", size: \"sm\" })} colorPalette=\"brand\" data-page-library-new=\"\"\n                    {...(form !== \"full\" ? { title: m.newPageIn({ project }) } : {})}\n                    {...(form === \"icon\" ? { \"aria-label\": m.newPageIn({ project }) } : {})}>\n                    <Box as=\"span\" css={styles.buttonIcon} aria-hidden><FontAwesomeIcon icon={faPlus} /></Box>\n                    {form === \"full\" ? m.newPageIn({ project }) : form === \"short\" ? m.newPage() : null}\n                </chakra.button>\n            }\n            label={<>{m.newPage()} · <Box as=\"span\" css={edit.clauseField}>{project}</Box></>}\n            placeholder={m.pageName()}\n            initial=\"\"\n            taken={taken}\n            missing={m.pageNameMissing()}\n            nameTaken={(name) => m.nameTaken({ name })}\n            confirm={m.createPage()}\n            cancel={m.cancel()}\n            onConfirm={create}\n        >\n            <ChakraSelect.Root collection={picker} value={[template]} onValueChange={(d) => setTemplate(d.value[0] ?? BLANK)}>\n                <ChakraSelect.HiddenSelect />\n                <ChakraSelect.Label>{m.template()}</ChakraSelect.Label>\n                <ChakraSelect.Control>\n                    <ChakraSelect.Trigger data-page-library-template=\"\">\n                        <ChakraSelect.ValueText />\n                    </ChakraSelect.Trigger>\n                    <ChakraSelect.IndicatorGroup>\n                        <ChakraSelect.Indicator><FontAwesomeIcon icon={faChevronDown} /></ChakraSelect.Indicator>\n                    </ChakraSelect.IndicatorGroup>\n                </ChakraSelect.Control>\n                <Portal>\n                    <ChakraSelect.Positioner>\n                        <ChakraSelect.Content>\n                            {picker.items.map((item) => (\n                                <ChakraSelect.Item key={item.value} item={item}>\n                                    {item.label}\n                                    <ChakraSelect.ItemIndicator><FontAwesomeIcon icon={faCheck} /></ChakraSelect.ItemIndicator>\n                                </ChakraSelect.Item>\n                            ))}\n                        </ChakraSelect.Content>\n                    </ChakraSelect.Positioner>\n                </Portal>\n            </ChakraSelect.Root>\n        </NamePopover>\n    );\n    const toolbarItems: ReadonlyArray<ToolbarItem> = [\n        {\n            key: \"search\",\n            forms: [searchBox(\"wide\"), searchBox(\"mid\"), searchBox(\"narrow\")],\n            rank: [RANK.searchMid, RANK.searchNarrow],\n        },\n        { key: \"sort\", side: \"end\", forms: [sortMenu(false), sortMenu(true)], rank: RANK.sort, version: sort },\n        {\n            key: \"layout\",\n            side: \"end\",\n            forms: [<LibraryLayoutSwitch layout={layout} onPick={setLayout} />],\n        },\n        { key: \"rule\", side: \"end\", forms: [<Box as=\"span\" css={styles.divider} aria-hidden />] },\n        {\n            key: \"new\",\n            side: \"end\",\n            forms: [newPage(\"full\"), newPage(\"short\"), newPage(\"icon\")],\n            rank: [RANK.newPage, RANK.newPageIcon],\n            version: project,\n        },\n    ];\n\n    if (!result.ok) {\n        const message = result.error instanceof Error ? result.error.message : String(result.error);\n        return <BannerView status=\"error\" title={message} />;\n    }\n    return (\n        <Box css={styles.root} data-studio-page-library=\"\">\n            <Box css={styles.toolbar} data-slot=\"toolbar\">\n                <Toolbar items={toolbarItems} />\n            </Box>\n            <Box css={styles.body}>\n                <Box css={styles.pane} data-page-library-pane=\"\">\n                    <Box css={styles.paneSection} role=\"group\" aria-labelledby={`${id}-projects`}>\n                        <Box css={styles.paneHead}>\n                            <Box as=\"span\" id={`${id}-projects`} css={styles.paneCaption}>{m.projects()}</Box>\n                        </Box>\n                        {projects.map((p) => {\n                            const active = p === project;\n                            return (\n                                <chakra.button key={p} type=\"button\" css={styles.paneRow} data-page-library-project={p}\n                                    {...(active ? { \"data-active\": \"\", \"aria-current\": \"true\" } : {})}\n                                    onClick={() => { if (!active) setProject(p); }}>\n                                    <Box as=\"span\" css={styles.paneIcon} aria-hidden>\n                                        <FontAwesomeIcon icon={active ? faFolderOpen : faFolder} />\n                                    </Box>\n                                    <Box as=\"span\" css={styles.paneTitle}>{p}</Box>\n                                </chakra.button>\n                            );\n                        })}\n                    </Box>\n                    <Box css={styles.paneRule} aria-hidden />\n                    <Box css={styles.paneSection} role=\"group\" aria-labelledby={`${id}-pages`}>\n                        <Box css={styles.paneHead}>\n                            <Box as=\"span\" id={`${id}-pages`} css={styles.paneCaption}>{m.pages()}</Box>\n                            <Box as=\"span\" css={styles.paneCount}>{words.number(np)}</Box>\n                        </Box>\n                        {paneRows.map((p) => {\n                            const dot = p.live ? liveDot : draftDot;\n                            const state = p.live ? m.live() : m.draft();\n                            return (\n                                <chakra.button key={p.page} type=\"button\" css={styles.paneRow} data-page=\"\" data-page-library-page={p.page}\n                                    {...(p.page === current ? { \"data-current\": \"\", \"aria-current\": \"page\" } : {})}\n                                    onClick={() => openPage(p.page)}>\n                                    <Box as=\"span\" css={styles.paneTitle}>{p.title}</Box>\n                                    <Box as=\"span\" css={dot.root} role=\"img\" aria-label={state} title={state}>\n                                        <Box as=\"span\" css={dot.indicator} />\n                                    </Box>\n                                </chakra.button>\n                            );\n                        })}\n                    </Box>\n                    <Box css={styles.legend} data-page-library-legend=\"\">\n                        <Box as=\"span\" css={liveDot.root}>\n                            <Box as=\"span\" css={liveDot.indicator} />\n                            <Box as=\"span\" css={liveDot.label}>{m.live()}</Box>\n                        </Box>\n                        <Box as=\"span\" css={draftDot.root}>\n                            <Box as=\"span\" css={draftDot.indicator} />\n                            <Box as=\"span\" css={draftDot.label}>{m.draft()}</Box>\n                        </Box>\n                    </Box>\n                </Box>\n                <Box css={styles.main}>\n                    <Box as=\"section\" css={styles.section} data-section=\"templates\" aria-labelledby={`${id}-templates`}>\n                        <Box css={styles.sectionHead}>\n                            <Box as=\"h3\" id={`${id}-templates`} css={styles.sectionTitle}>{m.templates()}</Box>\n                            <Box as=\"span\" css={styles.sectionSub}>{m.cloneToStart()}</Box>\n                        </Box>\n                        <EastChakraLibrary value={templatesGallery} storageKey={`${storageKey}.templates`} renderMedia={templateMedia} />\n                    </Box>\n                    <Box as=\"section\" css={styles.section} data-section=\"pages\" aria-labelledby={`${id}-rows`}>\n                        <Box css={styles.sectionHead}>\n                            <Box as=\"h3\" id={`${id}-rows`} css={styles.sectionTitle}>{m.pages()}</Box>\n                            <Box as=\"span\" css={styles.sectionSub} data-page-library-shown=\"\">\n                                {m.pagesIn({ shown: words.number(shown), total: words.number(np), project, narrowed: shown !== np })}\n                            </Box>\n                        </Box>\n                        <EastChakraLibrary value={pagesGallery} storageKey={`${storageKey}.pages`} renderMedia={pageMedia} />\n                    </Box>\n                </Box>\n            </Box>\n        </Box>\n    );\n});\n\nimplementUIComponent(StudioLibraryComponent, EastChakraStudioLibrary);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The slot autocomplete (#936) — the popover a step card's slot opens in the\n * query builder (`Query Editor Spec.md` §4.5): its label and a filter, the\n * slot's offers in their groups, as #934's `slotItems` gives them, and a footer\n * naming where the offers come from and the keys.\n *\n * - **Keys**: ↓ and ↑ move over the offers that can be picked, wrapping; ⏎ —\n *   not with ⌘ or Ctrl, which run the query — or Tab picks the active offer;\n *   Esc closes. A click picks; a press outside it and its slot closes it.\n * - **Typing** filters: the host is told the text and gives the offers for\n *   it, and the first offer that can be picked becomes active.\n * - **Placement** ({@link placeAutocomplete}): left-aligned with its slot and\n *   clamped inside the builder; below the slot, or above it when under 280px\n *   remain below and more is above; in the builder's own pixels when the\n *   builder is CSS-scaled.\n *\n * It is the `popover` recipe's chrome around the `combobox` recipe's list,\n * with the `queryAutocomplete` recipe's parts; its measured position is its\n * one inline style.\n *\n * @packageDocumentation\n */\n\nimport {\n    memo, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState,\n    type ChangeEvent, type KeyboardEvent, type MouseEvent,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Box, Portal, Tooltip, chakra, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { library, type IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { fas, faArrowLeft, faCheck, faMagnifyingGlass } from \"@fortawesome/free-solid-svg-icons\";\nimport { useValueSync } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport type { SlotItem } from \"./model/slots.js\";\n\n// An offer's icon is a Font Awesome solid name (e.g. \"filter\"); register the\n// free-solid set so it resolves by name (idempotent — safe if already added).\nlibrary.add(fas);\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The room the popover keeps from the builder's edges, in its own pixels. */\nconst INSET = 8;\n/** The gap between the slot and the popover. */\nconst GAP = 4;\n/** Under this much room below its slot, the popover opens above it when more is there. */\nconst FLIP_BELOW = 280;\n\n// ─── Placement ───────────────────────────────────────────────────────────────\n\n/** A box as the viewport measures it — what `getBoundingClientRect` gives. */\nexport interface PlacementBox {\n    /** Its left edge. */\n    readonly left: number;\n    /** Its top edge. */\n    readonly top: number;\n    /** Its width. */\n    readonly width: number;\n    /** Its height. */\n    readonly height: number;\n}\n\n/** What {@link placeAutocomplete} places the popover by. */\nexport interface AutocompletePlacementInput {\n    /** The slot's box, as the viewport measures it. */\n    readonly anchor: PlacementBox;\n    /** The builder's box, as the viewport measures it. */\n    readonly bounds: PlacementBox;\n    /** The popover's width, in the builder's own pixels (its `offsetWidth`). */\n    readonly width: number;\n    /** How much the builder is CSS-scaled: its measured width over its own (`offsetWidth`); 1 when it is not. */\n    readonly scale: number;\n}\n\n/** The popover below its slot, in the builder's own pixels. */\nexport interface AutocompleteBelow {\n    /** The side of its slot it opens on. */\n    readonly side: \"below\";\n    /** Its left edge, from the builder's. */\n    readonly left: number;\n    /** Its top edge, from the builder's. */\n    readonly top: number;\n    /** Its greatest height, to end inside the builder. */\n    readonly maxHeight: number;\n}\n\n/** The popover above its slot, in the builder's own pixels: its bottom edge is held, so it grows upward. */\nexport interface AutocompleteAbove {\n    /** The side of its slot it opens on. */\n    readonly side: \"above\";\n    /** Its left edge, from the builder's. */\n    readonly left: number;\n    /** Its bottom edge, from the builder's bottom edge. */\n    readonly bottom: number;\n    /** Its greatest height, to start inside the builder. */\n    readonly maxHeight: number;\n}\n\n/** Where the popover goes, in the builder's own pixels. */\nexport type AutocompletePlacement = AutocompleteBelow | AutocompleteAbove;\n\n/**\n * Where the slot autocomplete goes (`Query Editor Spec.md` §4.5): left-aligned\n * with its slot and clamped 8px inside the builder; 4px below the slot, or 4px\n * above it when under 280px remain below and more is above. A CSS-scaled\n * builder measures scaled, so every measure is divided by its scale into the\n * builder's own pixels, the ones its absolutely positioned popover is laid\n * out in.\n *\n * @param input - the slot's and the builder's boxes as measured, the popover's width and the builder's scale\n * @returns the side it opens on, its left edge and its top edge (below) or bottom edge (above), and its greatest height\n */\nexport function placeAutocomplete({ anchor, bounds, width, scale }: AutocompletePlacementInput): AutocompletePlacement {\n    const k = scale > 0 && Number.isFinite(scale) ? scale : 1;\n    const outerWidth = bounds.width / k;\n    const outerHeight = bounds.height / k;\n    const left = Math.max(INSET, Math.min(outerWidth - width - INSET, (anchor.left - bounds.left) / k));\n    const below = (anchor.top + anchor.height - bounds.top) / k + GAP;\n    const above = (anchor.top - bounds.top) / k - GAP;\n    const roomBelow = outerHeight - below;\n    if (roomBelow < FLIP_BELOW && above > roomBelow) {\n        return { side: \"above\", left, bottom: outerHeight - above, maxHeight: Math.max(0, above - INSET) };\n    }\n    return { side: \"below\", left, top: below, maxHeight: Math.max(0, roomBelow - INSET) };\n}\n\n/** Whether two placements put the popover in the same place. */\nfunction samePlace(a: AutocompletePlacement, b: AutocompletePlacement): boolean {\n    if (a.left !== b.left || a.maxHeight !== b.maxHeight) return false;\n    return a.side === \"below\" ? b.side === \"below\" && a.top === b.top : b.side === \"above\" && a.bottom === b.bottom;\n}\n\n// ─── The active offer ────────────────────────────────────────────────────────\n\n/** The active offer: where it was, and which it was. */\ninterface Active {\n    /** Its index in the offers it was made active in. */\n    readonly index: number;\n    /** Its group and label ({@link keyOf}). */\n    readonly key: string;\n}\n\n/** An offer's identity across the lists the host recomputes: its group and its label. */\nfunction keyOf(item: SlotItem): string {\n    return `${item.group}\\u0000${item.label}`;\n}\n\n/** Whether an offer is there and can be picked. */\nfunction pickable(item: SlotItem | undefined): item is SlotItem {\n    return item !== undefined && item.disabled !== true;\n}\n\n/** The offer at an index as the active one, when it can be picked. */\nfunction activeAt(items: readonly SlotItem[], index: number): Active | undefined {\n    const item = items[index];\n    return pickable(item) ? { index, key: keyOf(item) } : undefined;\n}\n\n/**\n * The active offer's index in the offers shown: where it was when it is still\n * there, else where it moved to, else the first that can be picked; `-1` when\n * none can be.\n */\nfunction indexOf(items: readonly SlotItem[], active: Active | undefined): number {\n    if (active !== undefined) {\n        const at = items[active.index];\n        if (pickable(at) && keyOf(at) === active.key) return active.index;\n        const moved = items.findIndex(item => pickable(item) && keyOf(item) === active.key);\n        if (moved >= 0) return moved;\n    }\n    return items.findIndex(item => pickable(item));\n}\n\n/** The next offer that can be picked, moving down or up from one and wrapping; from none, the first or the last. */\nfunction stepFrom(items: readonly SlotItem[], from: number, by: 1 | -1): number {\n    const n = items.length;\n    for (let k = 1; k <= n; k++) {\n        const i = from < 0 ? (by > 0 ? k - 1 : n - k) : (((from + by * k) % n) + n) % n;\n        if (pickable(items[i])) return i;\n    }\n    return -1;\n}\n\n/** A run of offers of one group, in the order they come, each with its index. */\ninterface Run {\n    /** The group's heading. */\n    readonly group: string;\n    /** Its offers, each with its index in the list. */\n    readonly offers: { readonly item: SlotItem; readonly index: number }[];\n}\n\n/** The offers in runs of one group: a group's heading starts each run, as the offers come. */\nfunction runsOf(items: readonly SlotItem[]): Run[] {\n    const runs: Run[] = [];\n    items.forEach((item, index) => {\n        const last = runs[runs.length - 1];\n        if (last !== undefined && last.group === item.group) last.offers.push({ item, index });\n        else runs.push({ group: item.group, offers: [{ item, index }] });\n    });\n    return runs;\n}\n\n/** The re-sync gate of the text the host gives: a change of text. */\nfunction sameText(a: string, b: string): boolean {\n    return a === b;\n}\n\n// ─── An offer ────────────────────────────────────────────────────────────────\n\n/** A field's glyph in a view, by the kind its sub-line names (QP33's 16 icon column). */\nfunction kindIcon(detail: string | undefined): string | undefined {\n    if (detail === undefined) return undefined;\n    if (/number/.test(detail)) return \"hashtag\";\n    if (/^text/.test(detail)) return \"font\";\n    if (/^date/.test(detail)) return \"calendar\";\n    if (/^list/.test(detail)) return \"list\";\n    if (/^one of/.test(detail)) return \"shapes\";\n    return undefined;\n}\n\n/** Props of {@link AutocompleteOption}. */\ninterface AutocompleteOptionProps {\n    /** The offer. */\n    readonly item: SlotItem;\n    /** Its index in the list. */\n    readonly index: number;\n    /** Its element's id, which the filter's `aria-activedescendant` names while it is active. */\n    readonly id: string;\n    /** Whether it is the active offer. */\n    readonly active: boolean;\n    /** The `combobox` recipe's styles. */\n    readonly combobox: Styles;\n    /** The `queryAutocomplete` recipe's styles. */\n    readonly styles: Styles;\n    /** Told it was clicked. */\n    readonly onPick: (item: SlotItem) => void;\n    /** Told the pointer moved over it. */\n    readonly onHover: (index: number) => void;\n    /** A view's: a disabled offer's reason its sub-line, where nothing hovers (QP33). */\n    readonly reasonShown?: boolean | undefined;\n}\n\n/**\n * One offer: its icon, its label (as data when `mono`), its sub-line — its\n * detail, and its note in the warning tone — and its meta at its end. A\n * disabled offer is listed but never picked, and its note, the reason, is its\n * Tooltip.\n *\n * @param props - the offer, its place and state, the recipes' styles and the handlers\n * @returns the option\n */\nfunction AutocompleteOption({ item, index, id, active, combobox, styles, onPick, onHover, reasonShown = false }: AutocompleteOptionProps) {\n    const disabled = item.disabled === true;\n    const note = disabled && !reasonShown ? undefined : item.note;\n    const option = (\n        <Box\n            id={id}\n            role=\"option\"\n            aria-selected={active}\n            aria-disabled={disabled ? true : undefined}\n            data-highlighted={active ? \"\" : undefined}\n            data-disabled={disabled ? \"\" : undefined}\n            css={[combobox.item, styles.item]}\n            onPointerMove={disabled ? undefined : () => onHover(index)}\n            onClick={disabled ? undefined : () => onPick(item)}\n        >\n            {item.icon !== undefined && (\n                <chakra.span css={styles.itemIcon}>\n                    <FontAwesomeIcon icon={item.icon as IconName} />\n                </chakra.span>\n            )}\n            <Box css={[combobox.itemText, styles.itemBody]}>\n                <chakra.span css={styles.itemLabel} data-label=\"\" data-mono={item.mono === true ? \"\" : undefined} data-typed={item.typed === true ? \"\" : undefined}>\n                    {item.label}\n                </chakra.span>\n                {(item.detail !== undefined || note !== undefined) && (\n                    <chakra.span css={styles.itemSub}>\n                        {item.detail !== undefined && <span data-detail=\"\">{item.detail}</span>}\n                        {note !== undefined && <chakra.span css={styles.itemNote} data-note=\"\">{note}</chakra.span>}\n                    </chakra.span>\n                )}\n            </Box>\n            {item.meta !== undefined && <chakra.span css={styles.itemMeta} data-meta=\"\">{item.meta}</chakra.span>}\n        </Box>\n    );\n    if (!disabled || item.note === undefined || reasonShown) return option;\n    return (\n        <Tooltip.Root ids={{ trigger: id }} openDelay={250} positioning={{ placement: \"right\" }}>\n            <Tooltip.Trigger asChild>{option}</Tooltip.Trigger>\n            <Portal>\n                <Tooltip.Positioner>\n                    <Tooltip.Content>{item.note}</Tooltip.Content>\n                </Tooltip.Positioner>\n            </Portal>\n        </Tooltip.Root>\n    );\n}\n\n// ─── The popover ─────────────────────────────────────────────────────────────\n\n/** Props of {@link SlotAutocomplete}. */\nexport interface SlotAutocompleteProps {\n    /** The slot's element: the popover hangs from it, and a press on it is the host's (it toggles the slot), not a press outside. */\n    anchor: HTMLElement;\n    /**\n     * The builder's element: the popover is portaled into it and stays inside\n     * it, absolutely positioned in its coordinates — so it is the popover's\n     * containing block (positioned, or transformed).\n     */\n    bounds: HTMLElement;\n    /** Its label — `FIELD` (#934's `slotLabel`). */\n    label: string;\n    /** The filter's placeholder (#934's `slotPlaceholder`). */\n    placeholder: string;\n    /** The footer's hint: where the offers come from (#934's `slotHint`). */\n    hint: string;\n    /** What it says with nothing to offer (#934's `slotEmpty`). */\n    empty: string;\n    /** The keys' hint, `↑↓ ⏎ esc` (#934's `slotKeys`). */\n    keys: string;\n    /**\n     * The offers for the text typed — #934's `slotItems`, which the host\n     * recomputes on each change of text. A new list for the same text (a\n     * summary arrived) keeps the active offer, found by its group and label,\n     * while it is still offered.\n     */\n    items: readonly SlotItem[];\n    /** The text typed; a text the host sets, other than the one typed, replaces it. */\n    text: string;\n    /** Told each change of the text. */\n    onText: (text: string) => void;\n    /**\n     * The offer active when it opens — #934's `activeItem`; `-1` when none can\n     * be picked. Typing makes the first offer that can be picked active.\n     */\n    initialActive: number;\n    /** Told the offer picked: ⏎, Tab or a click. */\n    onPick: (item: SlotItem) => void;\n    /** Told it closes: Esc, or a press outside it and its anchor. */\n    onClose: () => void;\n    /**\n     * A phone's frame's overlay slot: drawn there, a view over the whole builder (`Query Builder Phone Spec.md` QP33) —\n     * ← back and its label at its head, the filter in a 56 band, its rows at least 44, where the offers come from at its\n     * foot — placed nowhere and floating over nothing. Esc goes back, wherever the focus is.\n     */\n    view?: HTMLElement | null | undefined;\n    /** The name of the view's ←. */\n    backLabel?: string | undefined;\n    /** What it is for, beside the view's title: `Step 1 · condition 2`. */\n    context?: string | undefined;\n    /** A view with no filter: a short list of steps (QP34). */\n    noFilter?: boolean | undefined;\n}\n\n/**\n * The slot autocomplete — see the module docs. It opens with `initialActive`\n * active and its filter focused (without scrolling); the active offer stays in\n * view. While it is open it follows its slot as the page scrolls or resizes,\n * and when it closes with the focus in it, the focus returns to its slot.\n * Callbacks reach the host through `queueMicrotask`.\n *\n * @param props - its slot and builder, its words, the offers, the text typed, and the callbacks ({@link SlotAutocompleteProps})\n * @returns the popover, portaled into the builder\n */\nexport const SlotAutocomplete = memo(function SlotAutocomplete({\n    anchor, bounds, label, placeholder, hint, empty, keys, items, text, onText, initialActive, onPick, onClose, view, backLabel, context, noFilter = false,\n}: SlotAutocompleteProps) {\n    const phoneStyles = useSlotStyles(\"queryPhone\");\n    const isView = view !== undefined && view !== null;\n    const popoverRecipe = useSlotRecipe({ key: \"popover\" });\n    const comboboxRecipe = useSlotRecipe({ key: \"combobox\" });\n    const recipe = useSlotRecipe({ key: \"queryAutocomplete\" });\n    const popover = useMemo(() => popoverRecipe() as Styles, [popoverRecipe]);\n    const combobox = useMemo(() => comboboxRecipe() as Styles, [comboboxRecipe]);\n    const styles = useMemo(() => recipe() as Styles, [recipe]);\n\n    const ids = useId();\n    const inputId = `${ids}-input`;\n    const labelId = `${ids}-label`;\n    const listId = `${ids}-list`;\n    const optionId = useCallback((index: number): string => `${ids}-option-${index}`, [ids]);\n\n    // ── The text typed, and the active offer ────────────────────────────\n    // The filter's own text, told to the host; a text the host sets instead\n    // of the one typed replaces it, and the first offer becomes active.\n    const [typed, setTyped] = useState(text);\n    const [active, setActive] = useState<Active | undefined>(() => activeAt(items, initialActive));\n    useValueSync(text, sameText, () => {\n        if (text === typed) return;\n        setTyped(text);\n        setActive(undefined);\n    });\n    const activeIndex = indexOf(items, active);\n\n    // ── The elements ────────────────────────────────────────────────────\n    const rootRef = useRef<HTMLDivElement | null>(null);\n    const setRoot = useCallback((element: HTMLDivElement | null) => {\n        rootRef.current = element;\n    }, []);\n    const inputRef = useRef<HTMLInputElement>(null);\n    const listRef = useRef<HTMLDivElement>(null);\n    const anchorRef = useRef(anchor);\n    useLayoutEffect(() => {\n        anchorRef.current = anchor;\n    }, [anchor]);\n\n    // ── Placement: on open, and as the page scrolls or the builder resizes ─\n    const [place, setPlace] = useState<AutocompletePlacement | undefined>(undefined);\n    const measure = useCallback(() => {\n        const root = rootRef.current;\n        if (root === null || isView) return;\n        const box = bounds.getBoundingClientRect();\n        const scale = bounds.offsetWidth > 0 && box.width > 0 ? box.width / bounds.offsetWidth : 1;\n        const next = placeAutocomplete({ anchor: anchor.getBoundingClientRect(), bounds: box, width: root.offsetWidth, scale });\n        setPlace(prev => (prev !== undefined && samePlace(prev, next) ? prev : next));\n    }, [anchor, bounds, isView]);\n    useLayoutEffect(() => {\n        measure();\n        const view = bounds.ownerDocument.defaultView;\n        view?.addEventListener(\"scroll\", measure, true);\n        view?.addEventListener(\"resize\", measure);\n        const observer = typeof ResizeObserver === \"function\" ? new ResizeObserver(() => measure()) : undefined;\n        observer?.observe(bounds);\n        return () => {\n            view?.removeEventListener(\"scroll\", measure, true);\n            view?.removeEventListener(\"resize\", measure);\n            observer?.disconnect();\n        };\n    }, [measure, bounds]);\n    const placed = place !== undefined || isView;\n\n    // ── Focus: the filter on open; the slot again on close ──────────────\n    useEffect(() => {\n        inputRef.current?.focus({ preventScroll: true });\n    }, []);\n    // A view hears Esc wherever the focus is, ahead of the pane it lies over.\n    useEffect(() => {\n        if (!isView) return undefined;\n        const onEscape = (event: globalThis.KeyboardEvent) => {\n            if (event.key !== \"Escape\") return;\n            event.preventDefault();\n            event.stopPropagation();\n            queueMicrotask(() => onClose());\n        };\n        document.addEventListener(\"keydown\", onEscape, true);\n        return () => document.removeEventListener(\"keydown\", onEscape, true);\n    }, [isView, onClose]);\n    useLayoutEffect(() => () => {\n        // Closing with the focus inside — a pick, Esc — hands it back to the\n        // slot; a press outside has already moved it.\n        const root = rootRef.current;\n        if (root !== null && root.contains(root.ownerDocument.activeElement)) anchorRef.current.focus({ preventScroll: true });\n    }, []);\n\n    // ── The active offer stays in view, once the popover is placed ──────\n    useLayoutEffect(() => {\n        if (!placed) return;\n        const option = listRef.current?.querySelector<HTMLElement>(\"[data-highlighted]\");\n        if (option != null && typeof option.scrollIntoView === \"function\") option.scrollIntoView({ block: \"nearest\" });\n    }, [placed, activeIndex, items]);\n\n    // ── A press outside it and its slot closes it ───────────────────────\n    useEffect(() => {\n        const doc = anchor.ownerDocument;\n        const onPointerDown = (event: PointerEvent): void => {\n            const target = event.target;\n            if (!(target instanceof Node)) return;\n            if (rootRef.current?.contains(target) === true || anchor.contains(target)) return;\n            queueMicrotask(() => onClose());\n        };\n        doc.addEventListener(\"pointerdown\", onPointerDown, true);\n        return () => doc.removeEventListener(\"pointerdown\", onPointerDown, true);\n    }, [anchor, onClose]);\n\n    // ── Handlers ────────────────────────────────────────────────────────\n    const pick = useCallback((item: SlotItem | undefined) => {\n        if (!pickable(item)) return;\n        queueMicrotask(() => onPick(item));\n    }, [onPick]);\n    const onHover = useCallback((index: number) => {\n        if (index !== activeIndex) setActive(activeAt(items, index));\n    }, [activeIndex, items]);\n    const onChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n        const next = event.target.value;\n        setTyped(next);\n        setActive(undefined);\n        queueMicrotask(() => onText(next));\n    }, [onText]);\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n        if (event.nativeEvent.isComposing) return;\n        switch (event.key) {\n            case \"ArrowDown\":\n            case \"ArrowUp\":\n                event.preventDefault();\n                setActive(activeAt(items, stepFrom(items, activeIndex, event.key === \"ArrowDown\" ? 1 : -1)));\n                return;\n            case \"Enter\":\n                // ⌘⏎ and Ctrl ⏎ run the query: the builder's, not a pick.\n                if (event.metaKey || event.ctrlKey) return;\n                event.preventDefault();\n                pick(items[activeIndex]);\n                return;\n            case \"Tab\":\n                event.preventDefault();\n                pick(items[activeIndex]);\n                return;\n            case \"Escape\":\n                event.preventDefault();\n                queueMicrotask(() => onClose());\n                return;\n            default:\n                return;\n        }\n    }, [items, activeIndex, pick, onClose]);\n    const onMouseDown = useCallback((event: MouseEvent<HTMLDivElement>) => {\n        // A press on an offer, a heading or the footer keeps the filter focused.\n        if (event.target !== inputRef.current) event.preventDefault();\n    }, []);\n\n    // ── The popover ─────────────────────────────────────────────────────\n    const runs = useMemo(() => runsOf(items), [items]);\n    const position = place === undefined ? undefined\n        : place.side === \"below\" ? { left: place.left, top: place.top, maxHeight: place.maxHeight }\n        : { left: place.left, bottom: place.bottom, maxHeight: place.maxHeight };\n    if (isView) {\n        return createPortal(\n            <Box ref={setRoot} css={phoneStyles.view} data-query-autocomplete=\"\" data-query-view-picker=\"\" role=\"dialog\" aria-labelledby={labelId}>\n                <Box css={phoneStyles.viewHead}>\n                    <chakra.button type=\"button\" css={phoneStyles.viewBack} aria-label={backLabel} onClick={() => onClose()}><FontAwesomeIcon icon={faArrowLeft} aria-hidden /></chakra.button>\n                    <chakra.label id={labelId} htmlFor={inputId} css={phoneStyles.viewTitle}>{label}</chakra.label>\n                    {context !== undefined && <Box as=\"span\" css={phoneStyles.viewContext}>{context}</Box>}\n                </Box>\n                {!noFilter && <Box css={phoneStyles.viewBand}>\n                    <Box as=\"span\" css={phoneStyles.viewFieldIcon} aria-hidden><FontAwesomeIcon icon={faMagnifyingGlass} /></Box>\n                    <chakra.input ref={inputRef} id={inputId} type=\"text\" role=\"combobox\" aria-expanded={true} aria-controls={listId} aria-autocomplete=\"list\"\n                        aria-activedescendant={activeIndex >= 0 ? optionId(activeIndex) : undefined} autoComplete=\"off\" spellCheck={false} placeholder={placeholder} value={typed}\n                        css={phoneStyles.viewField} onChange={onChange} onKeyDown={onKeyDown} />\n                </Box>}\n                <Box ref={listRef} css={phoneStyles.viewList}>\n                    <Box role=\"listbox\" id={listId} aria-labelledby={labelId}>\n                        {runs.map((run, r) => {\n                            const headingId = `${ids}-group-${r}`;\n                            return (\n                                <Box key={`${r}:${run.group}`} role=\"group\" aria-labelledby={run.group === \"\" ? undefined : headingId}>\n                                    {run.group !== \"\" && <Box id={headingId} role=\"presentation\" css={phoneStyles.viewGroup}>{run.group}</Box>}\n                                    {run.offers.map(({ item, index }) => {\n                                        const off = item.disabled === true;\n                                        const sub = (off ? [item.note ?? item.detail] : [item.detail, item.meta, item.note]).filter((part): part is string => part !== undefined && part !== \"\").join(\" · \");\n                                        const icon = item.icon ?? kindIcon(item.detail);\n                                        // The value its slot holds now, by what the slot shows: checked and on the third paper.\n                                        const current = !off && item.label === anchor.querySelector(\"span\")?.textContent;\n                                        return (\n                                            <Box key={`${index}:${keyOf(item)}`} id={optionId(index)} role=\"option\" aria-selected={current} aria-disabled={off ? true : undefined}\n                                                css={phoneStyles.optionRow} data-current={current ? \"\" : undefined} data-disabled={off ? \"\" : undefined}\n                                                data-highlighted={index === activeIndex ? \"\" : undefined} onClick={off ? undefined : () => pick(item)}>\n                                                <chakra.span css={phoneStyles.optionIcon}>{icon !== undefined && <FontAwesomeIcon icon={icon as IconName} />}</chakra.span>\n                                                <Box css={phoneStyles.optionBody}>\n                                                    <chakra.span css={phoneStyles.optionLabel} data-label=\"\" data-mono={item.mono === true ? \"\" : undefined}>{item.label.replace(/…$/, \"\")}</chakra.span>\n                                                    {sub !== \"\" && <chakra.span css={phoneStyles.optionSub}>{sub}</chakra.span>}\n                                                </Box>\n                                                {current && <chakra.span css={phoneStyles.optionCheck}><FontAwesomeIcon icon={faCheck} /></chakra.span>}\n                                            </Box>\n                                        );\n                                    })}\n                                </Box>\n                            );\n                        })}\n                    </Box>\n                    {items.length === 0 && <Box css={[combobox.empty, styles.empty]} data-empty=\"\">{empty}</Box>}\n                </Box>\n                <Box css={phoneStyles.viewFoot}><span data-hint=\"\">{hint}</span></Box>\n            </Box>,\n            view,\n        );\n    }\n    return createPortal(\n        <Box\n            ref={setRoot}\n            css={[popover.content, styles.root]}\n            data-query-autocomplete=\"\"\n            data-side={place?.side}\n            style={position}\n            onMouseDown={onMouseDown}\n        >\n            <Box css={[popover.header, styles.header]}>\n                <chakra.label id={labelId} htmlFor={inputId} css={[popover.title, styles.label]}>{label}</chakra.label>\n                <chakra.input\n                    ref={inputRef}\n                    id={inputId}\n                    type=\"text\"\n                    role=\"combobox\"\n                    aria-expanded={true}\n                    aria-controls={listId}\n                    aria-autocomplete=\"list\"\n                    aria-activedescendant={activeIndex >= 0 ? optionId(activeIndex) : undefined}\n                    autoComplete=\"off\"\n                    spellCheck={false}\n                    placeholder={placeholder}\n                    value={typed}\n                    css={combobox.input}\n                    onChange={onChange}\n                    onKeyDown={onKeyDown}\n                />\n            </Box>\n            <Box ref={listRef} css={[popover.body, styles.body]}>\n                <Box role=\"listbox\" id={listId} aria-labelledby={labelId} css={[combobox.list, styles.list]}>\n                    {runs.map((run, r) => {\n                        const headingId = `${ids}-group-${r}`;\n                        return (\n                            <Box key={`${r}:${run.group}`} role=\"group\" aria-labelledby={run.group === \"\" ? undefined : headingId} css={combobox.itemGroup}>\n                                {run.group !== \"\" && <Box id={headingId} role=\"presentation\" css={combobox.itemGroupLabel}>{run.group}</Box>}\n                                {run.offers.map(({ item, index }) => (\n                                    <AutocompleteOption\n                                        key={`${index}:${keyOf(item)}`}\n                                        item={item}\n                                        index={index}\n                                        id={optionId(index)}\n                                        active={index === activeIndex}\n                                        combobox={combobox}\n                                        styles={styles}\n                                        onPick={pick}\n                                        onHover={onHover}\n                                    />\n                                ))}\n                            </Box>\n                        );\n                    })}\n                </Box>\n                {items.length === 0 && <Box css={[combobox.empty, styles.empty]} data-empty=\"\">{empty}</Box>}\n            </Box>\n            <Box css={[popover.footer, styles.footer]}>\n                <span data-hint=\"\">{hint}</span>\n                <span data-keys=\"\">{keys}</span>\n            </Box>\n        </Box>,\n        bounds,\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The shape of a query at a step (#933): what the checker says a stage gives,\n * and what the steps know besides — the cases rows are narrowed to, a Keep\n * the first bound, and what a row is called.\n *\n * @packageDocumentation\n */\n\nimport { NeverType, OptionType, isTypeEqual, type EastType, type JqMultiplicity } from \"@elaraai/east\";\n\n/**\n * What a stage gives: `rows` — an array (or set) of records, which the\n * steps that keep, reshape and total rows take; `one` — any other value, or a\n * stream; `unknown` — the checker could not tell, after a problem.\n */\nexport type ShapeKind = \"rows\" | \"one\" | \"unknown\";\n\n/** The shape of a query at a step. */\nexport interface Shape {\n    /** What it gives. */\n    readonly kind: ShapeKind;\n    /** The stage's type, as the checker gives it; `Never` when unknown. */\n    readonly type: EastType;\n    /** For rows, the record each row is. */\n    readonly row: EastType | undefined;\n    /** How many outputs the program has given here, as the checker counts them. */\n    readonly multiplicity: JqMultiplicity | null;\n    /**\n     * For rows, each variant field a Keep rows where step narrowed to one\n     * case, with the case: its payload's fields are exact, not missing.\n     */\n    readonly narrowed: ReadonlyMap<string, string>;\n    /** For rows, the most a Keep the first step lets through. */\n    readonly limit: number | undefined;\n    /** What one row, or the value, is called: \"order\", \"line\", \"part\". */\n    readonly noun: string;\n}\n\nconst NONE_NARROWED: ReadonlyMap<string, string> = new Map();\n\n/** The shape after a problem the checker stopped at. */\nexport const UNKNOWN: Shape = {\n    kind: \"unknown\",\n    type: NeverType,\n    row: undefined,\n    multiplicity: null,\n    narrowed: NONE_NARROWED,\n    limit: undefined,\n    noun: \"row\",\n};\n\n/**\n * A type read through its recursive wrapper: what a value of it is made of.\n *\n * @param type - a type\n * @returns its node, for a recursive type; itself otherwise\n */\nexport function unwrapRecursive(type: EastType): EastType {\n    let t = type;\n    while (t.type === \"Recursive\") t = t.node as EastType;\n    return t;\n}\n\n/**\n * The payload of an option type.\n *\n * @param type - a type\n * @returns `T` when the type is `Option<T>`, decided by East's type equality;\n *   `undefined` otherwise\n */\nexport function optionPayload(type: EastType): EastType | undefined {\n    const t = unwrapRecursive(type);\n    if (t.type !== \"Variant\") return undefined;\n    const payload = (t.cases as Record<string, EastType>)[\"some\"];\n    return payload !== undefined && isTypeEqual(t, OptionType(payload)) ? payload : undefined;\n}\n\n/**\n * A type read through its option and recursive wrappers.\n *\n * @param type - a type\n * @returns what a present value of it is made of\n */\nexport function baseType(type: EastType): EastType {\n    const payload = optionPayload(type);\n    return unwrapRecursive(payload ?? type);\n}\n\n/**\n * The type a read gives where the value can be missing: `Option<T>`, or `T`\n * itself when it is already an option or `Null`.\n *\n * @param type - the value's type\n * @returns the type of a read that can miss it\n */\nexport function orMissing(type: EastType): EastType {\n    const t = unwrapRecursive(type);\n    if (t.type === \"Null\" || optionPayload(t) !== undefined) return type;\n    return OptionType(type);\n}\n\n/**\n * The record of each row, when a type is rows: an array or a set of structs.\n *\n * @param type - a stage's type\n * @returns the struct, or `undefined` when the type is not rows\n */\nexport function rowOf(type: EastType): EastType | undefined {\n    const t = unwrapRecursive(type);\n    const element = t.type === \"Array\" ? t.value as EastType : t.type === \"Set\" ? t.key as EastType : undefined;\n    if (element === undefined) return undefined;\n    const row = unwrapRecursive(element);\n    return row.type === \"Struct\" ? row : undefined;\n}\n\n/**\n * The shape of a stage.\n *\n * @param type - the stage's type\n * @param multiplicity - how many outputs the program has given there\n * @param known - what the steps know besides: the narrowed variant fields,\n *   a Keep the first bound, and the noun\n * @returns the shape: rows when one value is an array or set of structs\n */\nexport function shapeOf(\n    type: EastType,\n    multiplicity: JqMultiplicity | null,\n    known: { narrowed?: ReadonlyMap<string, string>; limit?: number | undefined; noun: string },\n): Shape {\n    const row = multiplicity === \"one\" ? rowOf(type) : undefined;\n    return {\n        kind: row !== undefined ? \"rows\" : \"one\",\n        type,\n        row,\n        multiplicity,\n        narrowed: row !== undefined ? known.narrowed ?? NONE_NARROWED : NONE_NARROWED,\n        limit: row !== undefined ? known.limit : undefined,\n        noun: known.noun,\n    };\n}\n\n/**\n * The singular of a plural name, as English mostly forms it: `orders` →\n * `order`, `categories` → `category`, `statuses` → `status`; a name that is\n * not plural is itself.\n *\n * @param word - the name\n * @returns its singular\n */\nexport function singular(word: string): string {\n    if (/ies$/.test(word)) return `${word.slice(0, -3)}y`;\n    if (/(ss|us|x|ch|sh)es$/.test(word)) return word.slice(0, -2);\n    if (/[^s]s$/.test(word)) return word.slice(0, -1);\n    return word;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The fields a step can name (#933): the field catalog of a rows shape, and\n * the comparisons each kind of field takes (`Query Editor Spec.md` §4.4).\n *\n * @packageDocumentation\n */\n\nimport type { EastType } from \"@elaraai/east\";\nimport { baseType, optionPayload, orMissing, unwrapRecursive, type Shape } from \"./shape.js\";\nimport type { ComparisonKind } from \"./values.js\";\n\n/**\n * What kind of value a field holds, as the builder offers it: text, a whole\n * number, a number, a date, yes or no, one of some cases, a list, a record,\n * a lookup table, a calculation, or anything else.\n */\nexport type FieldKind = \"text\" | \"int\" | \"num\" | \"date\" | \"bool\" | \"case\" | \"list\" | \"record\" | \"dict\" | \"fn\" | \"other\";\n\n/** A field a step can name, in a shape. */\nexport interface StepField {\n    /** How a step names it: `\"total\"`, `\"status\"`, `\"status.shipped.date\"`. */\n    readonly ref: string;\n    /** The name a step gives a field made from it: `\"total\"`, `\"status\"`, `\"shipped_date\"`. */\n    readonly name: string;\n    /** What kind of value it holds. */\n    readonly kind: FieldKind;\n    /** The type a read of it gives here: a payload field not narrowed to its case is an option. */\n    readonly type: EastType;\n    /** Whether it can be missing: an option, or a payload field not narrowed to its case. */\n    readonly optional: boolean;\n    /** The fields jq reads it through from a row: `[\"total\"]`, `[\"status\", \"type\"]`, `[\"status\", \"value\", \"date\"]`. */\n    readonly path: readonly string[];\n    /** A case field's cases. */\n    readonly cases?: readonly string[];\n    /** A payload field's variant field, the case whose payload has it, its name in the payload, and whether the rows are narrowed to that case. */\n    readonly payload?: { readonly parent: string; readonly case: string; readonly leaf: string; readonly narrowed: boolean };\n    /** A list's item type. */\n    readonly element?: EastType;\n}\n\n/**\n * The kind of value a type holds.\n *\n * @param type - a field's type\n * @returns its kind, read through an option and a recursive wrapper\n */\nexport function kindOf(type: EastType): FieldKind {\n    const base = baseType(type);\n    switch (base.type) {\n        case \"String\": return \"text\";\n        case \"Integer\": return \"int\";\n        case \"Float\": return \"num\";\n        case \"DateTime\": return \"date\";\n        case \"Boolean\": return \"bool\";\n        case \"Variant\": return \"case\";\n        case \"Array\": case \"Set\": case \"Vector\": return \"list\";\n        case \"Struct\": return \"record\";\n        case \"Dict\": return \"dict\";\n        case \"Function\": case \"AsyncFunction\": return \"fn\";\n        default: return \"other\";\n    }\n}\n\n/**\n * A list's item type.\n *\n * @param type - a field's type\n * @returns the type of each item, for an array, a set or a vector\n */\nfunction elementOf(type: EastType): EastType | undefined {\n    const base = baseType(type);\n    switch (base.type) {\n        case \"Array\": return base.value as EastType;\n        case \"Set\": return base.key as EastType;\n        case \"Vector\": return base.element as EastType;\n        default: return undefined;\n    }\n}\n\n/**\n * The fields of a record, as steps name them: each field; for a variant\n * field, its case and each field of each struct case's payload.\n *\n * @param record - the record's type\n * @param narrowed - the variant fields narrowed to one case, with the case\n * @returns the fields, in the record's order, each variant's case before its payloads' fields\n */\nexport function fieldsOfRecord(record: EastType, narrowed: ReadonlyMap<string, string>): StepField[] {\n    const struct = unwrapRecursive(record);\n    if (struct.type !== \"Struct\") return [];\n    const fields: StepField[] = [];\n    for (const [name, type] of Object.entries(struct.fields as Record<string, EastType>)) {\n        const optional = optionPayload(type) !== undefined;\n        const base = baseType(type);\n        if (base.type !== \"Variant\") {\n            const element = elementOf(type);\n            fields.push({ ref: name, name, kind: kindOf(type), type, optional, path: [name], ...(element === undefined ? {} : { element }) });\n            continue;\n        }\n        const cases = base.cases as Record<string, EastType>;\n        fields.push({ ref: name, name, kind: \"case\", type, optional, path: [name, \"type\"], cases: Object.keys(cases) });\n        for (const [caseName, caseType] of Object.entries(cases)) {\n            const payload = unwrapRecursive(caseType);\n            if (payload.type !== \"Struct\") continue;\n            const isNarrowed = !optional && narrowed.get(name) === caseName;\n            for (const [leaf, leafType] of Object.entries(payload.fields as Record<string, EastType>)) {\n                const element = elementOf(leafType);\n                fields.push({\n                    ref: `${name}.${caseName}.${leaf}`,\n                    name: `${caseName}_${leaf}`,\n                    kind: kindOf(leafType),\n                    type: isNarrowed ? leafType : orMissing(leafType),\n                    optional: !isNarrowed || optionPayload(leafType) !== undefined,\n                    path: [name, \"value\", leaf],\n                    payload: { parent: name, case: caseName, leaf, narrowed: isNarrowed },\n                    ...(element === undefined ? {} : { element }),\n                });\n            }\n        }\n    }\n    return fields;\n}\n\n/**\n * The field catalog of a shape: the fields of its rows.\n *\n * @param shape - the shape\n * @returns its rows' fields; none when it is not rows\n */\nexport function fieldsOf(shape: Shape): StepField[] {\n    return shape.kind === \"rows\" && shape.row !== undefined ? fieldsOfRecord(shape.row, shape.narrowed) : [];\n}\n\n/**\n * The field a step names, in a shape.\n *\n * @param shape - the shape\n * @param ref - how the step names it\n * @returns the field, or `undefined` when the shape has none of that name\n */\nexport function fieldByRef(shape: Shape, ref: string): StepField | undefined {\n    return fieldsOf(shape).find(f => f.ref === ref);\n}\n\n/**\n * The fields jq reads a field through, for one the shape does not have: a\n * name is read as itself, and `parent.case.leaf` as a payload's field, so the\n * check names what is wrong.\n *\n * @param ref - how a step names it\n * @returns the fields jq reads\n */\nexport function pathOfUnknown(ref: string): string[] {\n    const parts = ref.split(\".\");\n    return parts.length === 3 ? [parts[0]!, \"value\", parts[2]!] : [ref];\n}\n\n/**\n * The record each item of a list is, when the items are records.\n *\n * @param field - a list field\n * @returns its item record, or `undefined`\n */\nexport function itemRecordOf(field: StepField): EastType | undefined {\n    if (field.element === undefined) return undefined;\n    const item = unwrapRecursive(optionPayload(field.element) ?? field.element);\n    return item.type === \"Struct\" ? item : undefined;\n}\n\nconst BY_KIND: Readonly<Record<FieldKind, readonly ComparisonKind[]>> = {\n    text: [\"eq\", \"ne\", \"contains\", \"startsWith\"],\n    int: [\"eq\", \"ne\", \"ge\", \"le\", \"gt\", \"lt\"],\n    num: [\"eq\", \"ne\", \"ge\", \"le\", \"gt\", \"lt\"],\n    date: [\"inYear\", \"inMonth\", \"onOrAfter\", \"before\"],\n    case: [\"eq\", \"ne\"],\n    bool: [\"yes\", \"no\"],\n    list: [\"lengthAtLeast\", \"anyWhere\"],\n    record: [],\n    dict: [],\n    fn: [],\n    other: [],\n};\n\n/**\n * The comparisons a field takes (`Query Editor Spec.md` §4.4): its kind's,\n * and is missing and has a value for an optional field that is not a\n * payload's; a list takes has any where only when its items are records.\n *\n * @param field - the field\n * @returns the comparisons, in the order the builder offers them\n */\nexport function comparisonsFor(field: StepField): ComparisonKind[] {\n    let kinds = [...BY_KIND[field.kind]];\n    if (field.kind === \"list\" && itemRecordOf(field) === undefined) kinds = kinds.filter(k => k !== \"anyWhere\");\n    return field.optional && field.payload === undefined ? [...kinds, \"missing\", \"present\"] : kinds;\n}\n\n/**\n * The comparison a field starts with when it is picked: is in year for a\n * date, has at least for a list, is yes for yes or no, is at least for a\n * number, and is otherwise.\n *\n * @param field - the field\n * @returns the comparison\n */\nexport function defaultComparison(field: StepField): ComparisonKind {\n    switch (field.kind) {\n        case \"date\": return \"inYear\";\n        case \"list\": return \"lengthAtLeast\";\n        case \"bool\": return \"yes\";\n        case \"int\": case \"num\": return \"ge\";\n        default: return \"eq\";\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Building and reading jq programs as East values (#933): the nodes of\n * `JqType` the steps print as, and the readers their recognisers parse back\n * with. A literal is the typed East value it writes (`JqLiteralType`), as\n * east's parser makes it.\n *\n * @packageDocumentation\n */\n\nimport {\n    BooleanType,\n    FloatType,\n    IntegerType,\n    NullType,\n    StringType,\n    none,\n    some,\n    variant,\n    type EastType,\n    type JqNode,\n} from \"@elaraai/east\";\nimport type { StepValue } from \"./values.js\";\n\n/**\n * A child's path, as the parser and the printer key a node's span: the\n * parent's path, then the step to the child.\n *\n * @param path - the parent's path, `\"\"` for the root\n * @param step - the steps to the child: `\"pipe.left\"`, `\"call.args[0]\"`, …; `\"\"` for the node itself\n * @returns the child's path\n */\nexport function at(path: string, step: string): string {\n    if (path === \"\") return step;\n    return step === \"\" ? path : `${path}.${step}`;\n}\n\n/** A name jq reads as an identifier: a variable's, a field's written bare. */\nconst IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\n/** The words jq keeps for itself, which no variable may be named. */\nconst KEYWORDS: ReadonlySet<string> = new Set([\n    \"and\", \"or\", \"not\", \"def\", \"if\", \"then\", \"elif\", \"else\", \"end\", \"as\", \"reduce\", \"foreach\", \"try\", \"catch\",\n    \"label\", \"import\", \"include\", \"module\", \"break\", \"__loc__\",\n]);\n\n/**\n * Whether a name can name a jq variable.\n *\n * @param name - the name\n * @returns whether `$name` reads as a variable\n */\nexport function isVariableName(name: string): boolean {\n    return IDENTIFIER.test(name) && !KEYWORDS.has(name);\n}\n\n// ============================================================================\n// Building\n// ============================================================================\n\n/** `.` */\nexport const IDENTITY: JqNode = variant(\"identity\", null);\n\n/** `target.name` */\nexport function fieldNode(target: JqNode, name: string): JqNode {\n    return variant(\"field\", { name, optional: false, target });\n}\n\n/**\n * The read of a field path: `.a.b` from `.`, or from another node.\n *\n * @param names - the fields read, outermost first\n * @param from - what they are read from; `.` by default\n * @returns the node\n */\nexport function pathNode(names: readonly string[], from: JqNode = IDENTITY): JqNode {\n    return names.reduce((target, name) => fieldNode(target, name), from);\n}\n\n/** `left | right` */\nexport function pipe(left: JqNode, right: JqNode): JqNode {\n    return variant(\"pipe\", { left, right });\n}\n\n/**\n * Segments piped in order, as the parser nests them: `a | (b | c)`.\n *\n * @param nodes - the segments, one or more\n * @returns the pipe\n */\nexport function pipeAll(nodes: readonly JqNode[]): JqNode {\n    if (nodes.length === 0) throw new Error(\"pipeAll: no segments\");\n    let node = nodes[nodes.length - 1]!;\n    for (let i = nodes.length - 2; i >= 0; i--) node = pipe(nodes[i]!, node);\n    return node;\n}\n\n/**\n * The path of the `i`th of `n` segments piped by {@link pipeAll}, relative\n * to the pipe.\n *\n * @param i - the segment's index\n * @param n - how many segments\n * @returns its path\n */\nexport function pipedPath(i: number, n: number): string {\n    let path = \"\";\n    for (let k = 0; k < i; k++) path = at(path, \"pipe.right\");\n    return i === n - 1 ? path : at(path, \"pipe.left\");\n}\n\n/** `name(args…)` */\nexport function call(name: string, args: readonly JqNode[] = []): JqNode {\n    return variant(\"call\", { args: [...args], name });\n}\n\n/** `left op right` */\nexport function binary(left: JqNode, op: string, right: JqNode): JqNode {\n    return variant(\"binary\", { left, op, right });\n}\n\n/**\n * Operands joined by one operator, as the parser nests them: `(a and b) and c`.\n *\n * @param operands - the operands, one or more\n * @param op - `and` or `or`\n * @returns the chain\n */\nexport function chain(operands: readonly JqNode[], op: string): JqNode {\n    if (operands.length === 0) throw new Error(\"chain: no operands\");\n    return operands.slice(1).reduce((left, right) => binary(left, op, right), operands[0]!);\n}\n\n/**\n * The path of the `i`th of `n` operands joined by {@link chain}, relative to\n * the chain.\n *\n * @param i - the operand's index\n * @param n - how many operands\n * @returns its path\n */\nexport function chainedPath(i: number, n: number): string {\n    // `((e0 op e1) op e2) op e3`: e3 is the right of the root, e2 the right of its left, …, e0 the leftmost.\n    const lefts = i === 0 ? n - 1 : n - 1 - i;\n    let path = \"\";\n    for (let k = 0; k < lefts; k++) path = at(path, \"binary.left\");\n    return i === 0 ? path : at(path, \"binary.right\");\n}\n\n/** `-operand` */\nexport function negate(operand: JqNode): JqNode {\n    return variant(\"negate\", operand);\n}\n\n/** `$name` */\nexport function variable(name: string): JqNode {\n    return variant(\"variable\", name);\n}\n\n/**\n * `{key: value, key, …}`: each entry a name, with a value or none.\n *\n * @param entries - the entries\n * @returns the object\n */\nexport function objectNode(entries: readonly { key: string; value?: JqNode }[]): JqNode {\n    return variant(\"object\", entries.map(entry => ({\n        key: variant(\"name\", entry.key),\n        value: entry.value === undefined ? none : some(entry.value),\n    })));\n}\n\n/** `[body]`, or `[]` with no body. */\nexport function arrayNode(body?: JqNode): JqNode {\n    return variant(\"array\", body === undefined ? none : some(body));\n}\n\n/**\n * Outputs one after another, as the parser nests them: `(a, b), c`.\n *\n * @param nodes - the outputs, one or more\n * @returns the comma\n */\nexport function commaAll(nodes: readonly JqNode[]): JqNode {\n    if (nodes.length === 0) throw new Error(\"commaAll: no outputs\");\n    return nodes.slice(1).reduce((left, right) => variant(\"comma\", { left, right }), nodes[0]!);\n}\n\n/** `target[]` */\nexport function iterate(target: JqNode): JqNode {\n    return variant(\"iterate\", { optional: false, target });\n}\n\n/** `target[key]` */\nexport function index(target: JqNode, key: JqNode): JqNode {\n    return variant(\"index\", { index: key, optional: false, target });\n}\n\n/** `target[:to]` */\nexport function sliceTo(target: JqNode, to: JqNode): JqNode {\n    return variant(\"slice\", { from: none, optional: false, target, to: some(to) });\n}\n\n/** `source as $name | body` */\nexport function bind(source: JqNode, name: string, body: JqNode): JqNode {\n    return variant(\"bind\", { body, patterns: [variant(\"variable\", name)], source });\n}\n\n/** `path op value`, for an update operator */\nexport function updateNode(path: JqNode, op: string, value: JqNode): JqNode {\n    return variant(\"update\", { op, path, value });\n}\n\n/** A String literal. */\nexport function stringLiteral(text: string): JqNode {\n    return variant(\"literal\", variant(\"string\", text));\n}\n\n/** An Integer literal. */\nexport function integerLiteral(n: bigint): JqNode {\n    return variant(\"literal\", variant(\"integer\", n));\n}\n\n/** A Float literal. */\nexport function floatLiteral(x: number): JqNode {\n    return variant(\"literal\", variant(\"float\", x));\n}\n\n/** A Boolean literal. */\nexport function booleanLiteral(b: boolean): JqNode {\n    return variant(\"literal\", variant(\"boolean\", b));\n}\n\n/** `null` */\nexport function nullLiteral(): JqNode {\n    return variant(\"literal\", variant(\"null\", null));\n}\n\n/**\n * A number as jq writes it: an Integer when it is whole, which a Float\n * compares with as its own, and a Float otherwise.\n *\n * @param x - the number\n * @returns the literal\n */\nexport function numberLiteral(x: number): JqNode {\n    return Number.isSafeInteger(x) ? integerLiteral(BigInt(x)) : floatLiteral(x);\n}\n\n/**\n * The literal of a step's value.\n *\n * @param value - the value\n * @returns its literal\n */\nexport function valueLiteral(value: StepValue): JqNode {\n    switch (value.type) {\n        case \"text\": return stringLiteral(value.value);\n        case \"number\": return numberLiteral(value.value);\n        case \"boolean\": return booleanLiteral(value.value);\n        case \"null\": return nullLiteral();\n    }\n}\n\n// ============================================================================\n// Reading\n// ============================================================================\n\n/**\n * The fields a node reads in a row, from `.`: `.a.b` gives `[\"a\", \"b\"]`.\n *\n * @param node - the node\n * @param from - what the reads start from; `.` when omitted, else a test of the base node\n * @returns the names, or `undefined` when the node is not a plain path\n */\nexport function readPath(node: JqNode, from?: (base: JqNode) => boolean): string[] | undefined {\n    const names: string[] = [];\n    let n = node;\n    while (n.type === \"field\" && !n.value.optional) {\n        names.unshift(n.value.name);\n        n = n.value.target;\n    }\n    const based = from === undefined ? n.type === \"identity\" : from(n);\n    return based ? names : undefined;\n}\n\n/**\n * A call's arguments.\n *\n * @param node - the node\n * @param name - the function's name\n * @param arity - how many arguments\n * @returns the arguments, or `undefined` when the node is not that call\n */\nexport function readCall(node: JqNode, name: string, arity: number): JqNode[] | undefined {\n    return node.type === \"call\" && node.value.name === name && node.value.args.length === arity ? node.value.args : undefined;\n}\n\n/**\n * A literal's value, with its type.\n *\n * @param node - the node\n * @returns the type and value, or `undefined` when it is not a literal\n */\nexport function readLiteral(node: JqNode): { type: EastType; value: unknown } | undefined {\n    if (node.type !== \"literal\") return undefined;\n    const literal = node.value;\n    switch (literal.type) {\n        case \"boolean\": return { type: BooleanType, value: literal.value };\n        case \"float\": return { type: FloatType, value: literal.value };\n        case \"integer\": return { type: IntegerType, value: literal.value };\n        case \"null\": return { type: NullType, value: null };\n        case \"string\": return { type: StringType, value: literal.value };\n    }\n}\n\n/**\n * A literal as a step's value: text, a number, yes or no, or nothing.\n *\n * @param node - the node\n * @returns the value, or `undefined` when it is not a literal\n */\nexport function readStepValue(node: JqNode): StepValue | undefined {\n    if (node.type !== \"literal\") return undefined;\n    const literal = node.value;\n    switch (literal.type) {\n        case \"string\": return variant(\"text\", literal.value);\n        case \"integer\": return variant(\"number\", Number(literal.value));\n        case \"float\": return variant(\"number\", literal.value);\n        case \"boolean\": return variant(\"boolean\", literal.value);\n        case \"null\": return variant(\"null\", null);\n    }\n}\n\n/**\n * A pipe's segments, in order.\n *\n * @param node - the node\n * @returns the segments; the node alone when it is no pipe\n */\nexport function readPipe(node: JqNode): JqNode[] {\n    const segments: JqNode[] = [];\n    let n = node;\n    while (n.type === \"pipe\") {\n        segments.push(n.value.left);\n        n = n.value.right;\n    }\n    segments.push(n);\n    return segments;\n}\n\n/**\n * An object's entries, when every key is a name.\n *\n * @param node - the node\n * @returns each entry's key and value, or `undefined` when it is no such object\n */\nexport function readObject(node: JqNode): { key: string; value: JqNode | undefined }[] | undefined {\n    if (node.type !== \"object\") return undefined;\n    const entries: { key: string; value: JqNode | undefined }[] = [];\n    for (const entry of node.value) {\n        if (entry.key.type !== \"name\") return undefined;\n        entries.push({ key: entry.key.value, value: entry.value.type === \"some\" ? entry.value.value : undefined });\n    }\n    return entries;\n}\n\n/**\n * The operands of a chain of one operator, as {@link chain} builds it: the\n * left side read down while it is the same operator.\n *\n * @param node - the node\n * @param op - `and` or `or`\n * @returns the operands; the node alone when it is no such chain\n */\nexport function readChain(node: JqNode, op: string): JqNode[] {\n    const operands: JqNode[] = [];\n    let n = node;\n    while (n.type === \"binary\" && n.value.op === op) {\n        operands.unshift(n.value.right);\n        n = n.value.left;\n    }\n    operands.unshift(n);\n    return operands;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A query's steps as the step functions take them (#933): the decoded values\n * of `Query.Types`, their ids, and when a step is finished.\n *\n * @packageDocumentation\n */\n\nimport { variant, type ValueTypeOf } from \"@elaraai/east\";\nimport type {\n    QueryAggregateType,\n    QueryComparisonType,\n    QueryConditionType,\n    QueryMatchType,\n    QueryPickFieldType,\n    QueryStepInputType,\n    QueryStepType,\n    QueryStepValueType,\n    QueryStepsType,\n} from \"@elaraai/e3-ui/internal\";\n\n/** A query as steps: its data source and its steps. */\nexport type StepQuery = ValueTypeOf<typeof QueryStepsType>;\n/** One step of a query. */\nexport type Step = ValueTypeOf<typeof QueryStepType>;\n/** A step's kind: `filter`, `lookup`, … */\nexport type StepKind = Step[\"type\"];\n/** One step of a kind. */\nexport type StepOf<K extends StepKind> = Extract<Step, { type: K }>;\n/** A condition of a Keep rows where step. */\nexport type Condition = ValueTypeOf<typeof QueryConditionType>;\n/** A test of one field. */\nexport type TestCondition = Extract<Condition, { type: \"test\" }>;\n/** A group of conditions. */\nexport type GroupCondition = Extract<Condition, { type: \"group\" }>;\n/** How a condition compares a field. */\nexport type Comparison = ValueTypeOf<typeof QueryComparisonType>;\n/** A comparison's kind: `eq`, `inYear`, … */\nexport type ComparisonKind = Comparison[\"type\"];\n/** How conditions combine. */\nexport type Match = ValueTypeOf<typeof QueryMatchType>;\n/** One total of a Group and total step. */\nexport type Aggregate = ValueTypeOf<typeof QueryAggregateType>;\n/** One field a Show only fields step shows. */\nexport type PickField = ValueTypeOf<typeof QueryPickFieldType>;\n/** A value a step compares with or fills in. */\nexport type StepValue = ValueTypeOf<typeof QueryStepValueType>;\n/** A count or a bound a step takes. */\nexport type StepInput = ValueTypeOf<typeof QueryStepInputType>;\n\n/** What an id names: a step, a condition, a total or a field shown. */\nexport type IdKind = \"step\" | \"condition\" | \"aggregate\" | \"pick\";\n\nconst PREFIX: Readonly<Record<IdKind, string>> = { step: \"s\", condition: \"c\", aggregate: \"a\", pick: \"p\" };\n\nlet issued = 0;\n\n/**\n * A fresh id, unique for the life of the page: each call gives a new one, so\n * an id is never reused, even by a query parsed again.\n *\n * @param kind - what it names\n * @returns the id\n */\nexport function freshId(kind: IdKind): string {\n    issued += 1;\n    return `${PREFIX[kind]}${issued.toString(36)}`;\n}\n\n/**\n * A comparison of a kind.\n *\n * @param kind - the comparison\n * @returns its value\n */\nexport function comparison(kind: ComparisonKind): Comparison {\n    return variant(kind, null) as Comparison;\n}\n\n/**\n * Whether a value is filled in: any value but empty text.\n *\n * @param value - the value\n * @returns whether it counts as given\n */\nexport function isGiven(value: StepValue): boolean {\n    return value.type !== \"text\" || value.value.trim() !== \"\";\n}\n\n/**\n * Whether a comparison takes a value: every one but missing, present, yes,\n * no, and any where, which takes an inner condition instead.\n *\n * @param kind - the comparison\n * @returns whether it needs a value\n */\nexport function needsValue(kind: ComparisonKind): boolean {\n    return kind !== \"missing\" && kind !== \"present\" && kind !== \"yes\" && kind !== \"no\" && kind !== \"anyWhere\";\n}\n\n/**\n * Whether a condition is finished: a test with its field, its comparison and\n * the value or inner condition it needs; a group with a finished condition.\n *\n * @param condition - the condition\n * @returns whether it is printed\n */\nexport function isConditionComplete(condition: Condition): boolean {\n    if (condition.type === \"group\") return condition.value.conds.some(isConditionComplete);\n    const { field, cmp, value, inner } = condition.value;\n    if (field.type === \"none\" || cmp.type === \"none\") return false;\n    if (cmp.value.type === \"anyWhere\") return inner.type === \"some\" && isConditionComplete(inner.value);\n    if (!needsValue(cmp.value.type)) return true;\n    return value.type === \"some\" && isGiven(value.value);\n}\n\n/**\n * Whether an input is filled in: a number, or text typed, which the check\n * reports when it is not one.\n *\n * @param input - the input\n * @returns whether it counts as given\n */\nfunction isInputGiven(input: StepInput): boolean {\n    return input.type === \"number\" || input.value.trim() !== \"\";\n}\n\n/**\n * Whether a step is finished: every slot it needs is filled. An unfinished\n * step is left out of the program until it is.\n *\n * @param step - the step\n * @returns whether it is printed\n */\nexport function isComplete(step: Step): boolean {\n    switch (step.type) {\n        case \"filter\":\n            return step.value.conds.some(isConditionComplete);\n        case \"lookup\":\n            return step.value.dataset.type === \"some\" && step.value.key.type === \"some\" && step.value.fields.length > 0;\n        case \"group\": {\n            const { by, aggs } = step.value;\n            if (by.type === \"none\") return false;\n            if (by.value.type === \"all\" && aggs.length === 0) return false;\n            return aggs.every(a => a.fn.type === \"count\" || a.field.type === \"some\");\n        }\n        case \"sort\":\n            return step.value.field.type === \"some\";\n        case \"limit\":\n            return isInputGiven(step.value.n);\n        case \"count\":\n            return true;\n        case \"pick\":\n            return step.value.fields.length > 0 && step.value.fields.every(p => p.field.type === \"some\");\n        case \"fill\":\n            return step.value.field.type === \"some\" && step.value.value.type === \"some\" && isGiven(step.value.value.value);\n        case \"drill\":\n            return step.value.field.type === \"some\";\n        case \"datepart\":\n            return step.value.field.type === \"some\" && step.value.as.trim() !== \"\";\n        case \"walk\":\n            return step.value.via.type === \"some\";\n        case \"tabulate\":\n            return step.value.over.trim() !== \"\" && step.value.as.trim() !== \"\"\n                && isInputGiven(step.value.from) && isInputGiven(step.value.to) && isInputGiven(step.value.step);\n        case \"jq\":\n            return step.value.text.trim() !== \"\";\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Printing steps (#933): each step as its canonical form of jq\n * (`Query Editor Spec.md` §4.7), built as a `JqType` program and printed by\n * east's `printJq`, one segment per line of the pipeline, with the span of\n * every step and condition.\n *\n * A step prints for the shape of the rows it takes — `.status.type` for a\n * variant's case, `sort_by(-.total)` for a number — so the program is laid\n * out a step at a time, each prefix checked by east's `checkJq`, whose stages\n * are the shapes. A step that does not check leaves the shape as it was, so\n * the steps after it still print; the whole program's check reports it.\n *\n * @packageDocumentation\n */\n\nimport { checkJq, parseJq, printJq, type CheckJqResult, type EastType, type JqNode } from \"@elaraai/east\";\nimport { fieldByRef, fieldsOfRecord, itemRecordOf, pathOfUnknown, type StepField } from \"./fields.js\";\nimport {\n    IDENTITY, arrayNode, at, binary, bind, booleanLiteral, call, chain, chainedPath, fieldNode, floatLiteral, index,\n    integerLiteral, isVariableName, iterate, negate, nullLiteral, numberLiteral, objectNode, pathNode, pipe, pipeAll,\n    pipedPath, sliceTo, stringLiteral, updateNode, valueLiteral, variable,\n} from \"./jq.js\";\nimport { UNKNOWN, shapeOf, singular, unwrapRecursive, type Shape } from \"./shape.js\";\nimport {\n    isComplete, isConditionComplete, type Condition, type StepInput, type Step, type StepOf, type StepQuery, type TestCondition,\n} from \"./values.js\";\n\n/** A printed step's range of text. */\nexport interface StepRange {\n    /** The step's id. */\n    readonly id: string;\n    /** Its first offset. */\n    readonly from: number;\n    /** The offset after its last. */\n    readonly to: number;\n}\n\n/** A printed condition's range of text, and the ranges of its field and its value. */\nexport interface ConditionRange {\n    /** The step it is in. */\n    readonly stepId: string;\n    /** The condition's id. */\n    readonly condId: string;\n    /** Its first offset. */\n    readonly from: number;\n    /** The offset after its last. */\n    readonly to: number;\n    /** Where its field's read is, and its value's literal. */\n    readonly parts: { readonly field?: readonly [number, number]; readonly value?: readonly [number, number] };\n}\n\n/**\n * A step's slot: what a check's diagnostic is placed on, besides a\n * condition. `dataset`, `key` and `fields` are a Look up's; `by` and\n * `agg-field` (a total's field, with the total's id) a Group and total's;\n * `pick-field` (with the field shown's id) a Show only fields'; `n` a Keep\n * the first's; `field` the field of a Sort, a Fill, an Open each list or a\n * Take part of a date; `value` a Fill's; `via` a List every part's; `range`\n * and `fixed` (with the input's name) a Try the model's.\n */\nexport type StepSlot = \"dataset\" | \"key\" | \"fields\" | \"by\" | \"agg-field\" | \"pick-field\" | \"n\" | \"field\" | \"value\" | \"via\" | \"range\" | \"fixed\";\n\n/** A printed slot's range of text. */\nexport interface SlotRange {\n    /** The step it is in. */\n    readonly stepId: string;\n    /** The slot. */\n    readonly slot: StepSlot;\n    /** The total, field shown, field brought in or input it is for. */\n    readonly id?: string;\n    /** Its first offset. */\n    readonly from: number;\n    /** The offset after its last. */\n    readonly to: number;\n}\n\n/** Steps printed as canonical jq. */\nexport interface PrintedSteps {\n    /** The program's text. */\n    readonly text: string;\n    /** The program, or `null` when a jq step's text breaks it. */\n    readonly program: JqNode | null;\n    /** Where the data source's read is. */\n    readonly source: { readonly from: number; readonly to: number };\n    /** Each printed step's range, in order; an unfinished step is not printed. */\n    readonly steps: readonly StepRange[];\n    /** Each printed condition's range, groups included. */\n    readonly conds: readonly ConditionRange[];\n    /** Each printed slot's range. */\n    readonly slots: readonly SlotRange[];\n}\n\n/** One step laid out: the shape it takes and gives, and whether it printed and checked. */\nexport interface LaidOutStep {\n    /** The step. */\n    readonly step: Step;\n    /** The shape of the rows it takes. */\n    readonly before: Shape;\n    /** The shape it gives: its input's when it is unfinished or does not check. */\n    readonly after: Shape;\n    /** Whether it is in the program: unfinished steps are left out. */\n    readonly printed: boolean;\n    /** Whether it checked in the program before it. */\n    readonly checked: boolean;\n}\n\n/** A segment of the program, as the counting program reads it. */\nexport interface LaidOutSegment {\n    /** The step it is part of; `undefined` for the prologue and the source. */\n    readonly stepId: string | undefined;\n    /** Its text. */\n    readonly text: string;\n    /** Whether it is the source, or a step's last segment, after which the step's shape holds. */\n    readonly last: boolean;\n}\n\n/** A query laid out: the printed program, each step's shapes, and the program's check. */\nexport interface StepLayout {\n    /** The printed program. */\n    readonly printed: PrintedSteps;\n    /** The shape the data source gives. */\n    readonly source: Shape;\n    /** Each step, in order. */\n    readonly steps: readonly LaidOutStep[];\n    /** The shape the query gives. */\n    readonly final: Shape;\n    /** The whole program's check, against the root. */\n    readonly check: CheckJqResult;\n    /** The program's segments, in order. */\n    readonly segments: readonly LaidOutSegment[];\n}\n\n/** What separates two segments of the pipeline layout. */\nexport const SEP = \"\\n| \";\n\n/** jq's operator for each comparison that is one. */\nconst OPERATOR: Readonly<Record<string, string>> = { eq: \"==\", ne: \"!=\", ge: \">=\", le: \"<=\", gt: \">\", lt: \"<\" };\n\n/**\n * A part of a step whose range a check's diagnostics are placed in: a\n * condition, with its field's read and its value, or a slot.\n */\ninterface PartPaths {\n    /** The condition's id, for a condition. */\n    readonly condId?: string;\n    /** The slot, for a slot. */\n    readonly slot?: StepSlot;\n    /** What the slot is for: a total, a field shown or brought in, an input. */\n    readonly id?: string;\n    readonly path: string;\n    readonly field?: string;\n    readonly value?: string;\n}\n\n/** A condition built: its node, and the paths of it and of what is inside it, relative to it. */\ninterface BuiltCondition {\n    readonly node: JqNode;\n    readonly parts: readonly PartPaths[];\n}\n\n/** A step's segment built: its node, or a jq step's own text. */\ninterface BuiltSegment {\n    readonly node: JqNode | undefined;\n    readonly text: string | undefined;\n    readonly parts: readonly PartPaths[];\n}\n\n/**\n * The fields jq reads a step's field through, in a shape.\n *\n * @param shape - the shape\n * @param ref - how the step names the field\n * @param whole - read a variant as its whole value, not its case\n * @returns the fields read\n */\nexport function pathFor(shape: Shape, ref: string, whole = false): readonly string[] {\n    const field = fieldByRef(shape, ref);\n    if (field === undefined) return pathOfUnknown(ref);\n    return whole && field.kind === \"case\" && field.payload === undefined ? [field.ref] : field.path;\n}\n\n/**\n * The read of a field a step shows or keeps whole: a variant field as its\n * value, any other as {@link pathFor} reads it.\n */\nfunction wholePathFor(shape: Shape, ref: string): readonly string[] {\n    return pathFor(shape, ref, true);\n}\n\n/** A number or text a step takes as its literal: text that is not a number is printed as written, which the check refuses. */\nfunction inputLiteral(input: StepInput, float = false): JqNode {\n    if (input.type === \"text\") return stringLiteral(input.value);\n    return float ? floatLiteral(input.value) : numberLiteral(input.value);\n}\n\n/**\n * The shape of each item of a list field, for the conditions inside has any\n * where.\n *\n * @param field - the list field\n * @returns the items as rows of their record, or {@link UNKNOWN}\n */\nexport function itemShape(field: StepField | undefined): Shape {\n    const record = field === undefined ? undefined : itemRecordOf(field);\n    if (record === undefined) return UNKNOWN;\n    return { ...UNKNOWN, kind: \"rows\", type: record, row: record, multiplicity: \"one\", noun: singular(field!.name) };\n}\n\n/**\n * Builds a finished condition.\n *\n * @param condition - the condition, finished\n * @param shape - the shape of the rows it tests\n * @returns its node and its parts' paths\n */\nfunction buildCondition(condition: Condition, shape: Shape): BuiltCondition {\n    if (condition.type === \"group\") {\n        const conds = condition.value.conds.filter(isConditionComplete);\n        const built = conds.map(c => buildCondition(c, shape));\n        const node = chain(built.map(b => b.node), condition.value.match.type === \"any\" ? \"or\" : \"and\");\n        const parts: PartPaths[] = [{ condId: condition.value.id, path: \"\" }];\n        built.forEach((b, i) => {\n            const prefix = chainedPath(i, built.length);\n            for (const part of b.parts) parts.push(rebase(part, prefix));\n        });\n        return { node, parts };\n    }\n    return buildTest(condition, shape);\n}\n\n/** A part's paths under a prefix. */\nfunction rebase(part: PartPaths, prefix: string): PartPaths {\n    return {\n        ...part,\n        path: at(prefix, part.path),\n        ...(part.field === undefined ? {} : { field: at(prefix, part.field) }),\n        ...(part.value === undefined ? {} : { value: at(prefix, part.value) }),\n    };\n}\n\n/** A slot's part, at a path in its segment. */\nfunction slotAt(slot: StepSlot, path: string, id?: string): PartPaths {\n    return { slot, path, ...(id === undefined ? {} : { id }) };\n}\n\n/** Builds a finished test of one field. */\nfunction buildTest(condition: TestCondition, shape: Shape): BuiltCondition {\n    const { id, field: fieldRef, cmp, value, inner, whole } = condition.value;\n    const ref = fieldRef.type === \"some\" ? fieldRef.value : \"\";\n    const p = pathNode(pathFor(shape, ref, whole));\n    const kind = cmp.type === \"some\" ? cmp.value.type : \"eq\";\n    const given = value.type === \"some\" ? value.value : undefined;\n    const literal = (): JqNode => given === undefined ? nullLiteral() : valueLiteral(given);\n    const op = OPERATOR[kind];\n    if (op !== undefined) {\n        return { node: binary(p, op, literal()), parts: [{ condId: id, path: \"\", field: \"binary.left\", value: \"binary.right\" }] };\n    }\n    switch (kind) {\n        // A condition's field is its whole read: a problem with `p | year` or `p | contains(v)` is the field's.\n        case \"contains\": case \"startsWith\":\n            return {\n                node: pipe(p, call(kind === \"contains\" ? \"contains\" : \"startswith\", [literal()])),\n                parts: [{ condId: id, path: \"\", field: \"\", value: \"pipe.right.call.args[0]\" }],\n            };\n        case \"missing\": case \"present\":\n            return { node: binary(p, kind === \"missing\" ? \"==\" : \"!=\", nullLiteral()), parts: [{ condId: id, path: \"\", field: \"binary.left\" }] };\n        case \"yes\": case \"no\":\n            return { node: binary(p, \"==\", booleanLiteral(kind === \"yes\")), parts: [{ condId: id, path: \"\", field: \"binary.left\" }] };\n        case \"inYear\": case \"inMonth\": case \"lengthAtLeast\": {\n            const read = kind === \"inYear\" ? call(\"year\") : kind === \"inMonth\" ? call(\"strftime\", [stringLiteral(\"%Y-%m\")]) : call(\"length\");\n            return {\n                node: binary(pipe(p, read), kind === \"lengthAtLeast\" ? \">=\" : \"==\", literal()),\n                parts: [{ condId: id, path: \"\", field: \"binary.left\", value: \"binary.right\" }],\n            };\n        }\n        case \"onOrAfter\": case \"before\":\n            return { node: binary(p, kind === \"onOrAfter\" ? \">=\" : \"<\", literal()), parts: [{ condId: id, path: \"\", field: \"binary.left\", value: \"binary.right\" }] };\n        case \"anyWhere\": {\n            // A finished any where has its inner condition.\n            const built = inner.type === \"some\" ? buildCondition(inner.value, itemShape(fieldByRef(shape, ref))) : { node: booleanLiteral(true), parts: [] };\n            return {\n                node: call(\"any\", [iterate(p), built.node]),\n                parts: [{ condId: id, path: \"\", field: \"call.args[0]\" }, ...built.parts.map(part => rebase(part, \"call.args[1]\"))],\n            };\n        }\n        default:\n            return { node: binary(p, \"==\", literal()), parts: [{ condId: id, path: \"\", field: \"binary.left\", value: \"binary.right\" }] };\n    }\n}\n\n/**\n * Whether a condition of an all filter narrows the rows to a case, and so\n * prints in a `select` of its own before the rest: a variant field is one of\n * its cases.\n *\n * @param condition - a top-level condition of the filter\n * @param shape - the rows it tests\n * @returns the variant field and the case, or `undefined`\n */\nexport function narrowingOf(condition: Condition, shape: Shape): { field: string; case: string | undefined } | undefined {\n    if (condition.type !== \"test\") return undefined;\n    const { field: ref, cmp, value, whole } = condition.value;\n    if (whole || ref.type !== \"some\" || cmp.type !== \"some\" || cmp.value.type !== \"eq\") return undefined;\n    const field = fieldByRef(shape, ref.value);\n    if (field === undefined || field.kind !== \"case\" || field.payload !== undefined || field.optional) return undefined;\n    const name = value.type === \"some\" && value.value.type === \"text\" ? value.value.value : undefined;\n    return { field: field.ref, case: name !== undefined && field.cases!.includes(name) ? name : undefined };\n}\n\n/** Builds a Keep rows where step. */\nfunction buildFilter(step: StepOf<\"filter\">, shape: Shape): BuiltSegment {\n    const conds = step.value.conds.filter(isConditionComplete);\n    const all = step.value.match.type === \"all\";\n    // An all filter's case conditions narrow the rows, each in a select of its own before the rest.\n    const hoisted = all ? conds.filter(c => narrowingOf(c, shape) !== undefined) : [];\n    const rest = conds.filter(c => !hoisted.includes(c));\n    const groups: Condition[][] = [...hoisted.map(c => [c]), ...(rest.length > 0 ? [rest] : [])];\n    const selects: JqNode[] = [];\n    const parts: PartPaths[] = [];\n    groups.forEach((group, s) => {\n        const built = group.map(c => buildCondition(c, shape));\n        selects.push(call(\"select\", [chain(built.map(b => b.node), all ? \"and\" : \"or\")]));\n        const selectArg = at(at(\"call.args[0]\", pipedPath(s, groups.length)), \"call.args[0]\");\n        built.forEach((b, i) => {\n            const prefix = at(selectArg, chainedPath(i, built.length));\n            for (const part of b.parts) parts.push(rebase(part, prefix));\n        });\n    });\n    return { node: call(\"map\", [pipeAll(selects)]), text: undefined, parts };\n}\n\n/** The node of one total, over the rows of a group. */\nfunction aggregateNode(shape: Shape, fn: string, ref: string | undefined): JqNode {\n    if (fn === \"count\") return call(\"length\");\n    const values = call(\"map\", [pathNode(pathFor(shape, ref ?? \"\"))]);\n    switch (fn) {\n        case \"sum\": return pipe(values, call(\"add\"));\n        case \"mean\": return pipe(values, binary(call(\"add\"), \"/\", call(\"length\")));\n        case \"min\": return pipe(values, call(\"min\"));\n        case \"max\": return pipe(values, call(\"max\"));\n        default: return pipe(values, pipe(call(\"unique\"), call(\"length\")));\n    }\n}\n\n/** The name a step gives a field made from another: the field's own, or the step's name for it. */\nexport function nameFor(shape: Shape, ref: string): string {\n    return fieldByRef(shape, ref)?.name ?? ref;\n}\n\n/** The scalar fields of a tree's node, which List every part keeps. */\nexport function scalarFieldsOf(record: EastType): string[] {\n    return fieldsOfRecord(record, new Map())\n        .filter(f => f.payload === undefined && (f.kind === \"text\" || f.kind === \"int\" || f.kind === \"num\" || f.kind === \"date\" || f.kind === \"bool\"))\n        .map(f => f.ref);\n}\n\n/** The name of a variable a step binds, from a name it would like: the name, or `value` when jq cannot read it as one. */\nexport function variableName(name: string): string {\n    return isVariableName(name) ? name : \"value\";\n}\n\n/**\n * Builds a finished step's segments: one, or two for a grouped total and a\n * sort reversed.\n *\n * @param step - the step, finished\n * @param shape - the shape of the rows it takes\n * @returns its segments\n */\nfunction buildStep(step: Step, shape: Shape): BuiltSegment[] {\n    const segment = (node: JqNode, parts: readonly PartPaths[] = []): BuiltSegment => ({ node, text: undefined, parts });\n    switch (step.type) {\n        case \"filter\":\n            return [buildFilter(step, shape)];\n        case \"lookup\": {\n            const dataset = step.value.dataset.type === \"some\" ? step.value.dataset.value : \"\";\n            const key = pathNode(pathFor(shape, step.value.key.type === \"some\" ? step.value.key.value : \"\"));\n            const entries = step.value.fields.map(f => ({ key: f, value: fieldNode(index(variable(dataset), key), f) }));\n            const entry = (i: number): string => `call.args[0].binary.right.object[${i}].value.some`;\n            return [segment(call(\"map\", [binary(IDENTITY, \"+\", objectNode(entries))]), [\n                ...step.value.fields.map((f, i) => slotAt(\"fields\", entry(i), f)),\n                ...(entries.length > 0 ? [\n                    slotAt(\"dataset\", at(entry(0), \"field.target.index.target\")),\n                    slotAt(\"key\", at(entry(0), \"field.target.index.index\")),\n                ] : []),\n            ])];\n        }\n        case \"group\": {\n            const { by, aggs } = step.value;\n            const totals = aggs.map(a => ({ key: a.as, value: aggregateNode(shape, a.fn.type, a.field.type === \"some\" ? a.field.value : undefined) }));\n            if (by.type === \"none\" || by.value.type === \"all\") {\n                return [segment(objectNode(totals), aggs.map((a, i) => slotAt(\"agg-field\", `object[${i}].value.some`, a.id)))];\n            }\n            const byPath = pathFor(shape, by.value.value);\n            const first = pathNode(byPath, index(IDENTITY, integerLiteral(0n)));\n            return [\n                segment(call(\"group_by\", [pathNode(byPath)]), [slotAt(\"by\", \"call.args[0]\")]),\n                segment(call(\"map\", [objectNode([{ key: nameFor(shape, by.value.value), value: first }, ...totals])]), [\n                    slotAt(\"by\", \"call.args[0].object[0].value.some\"),\n                    ...aggs.map((a, i) => slotAt(\"agg-field\", `call.args[0].object[${i + 1}].value.some`, a.id)),\n                ]),\n            ];\n        }\n        case \"sort\": {\n            const ref = step.value.field.type === \"some\" ? step.value.field.value : \"\";\n            const field = fieldByRef(shape, ref);\n            const desc = step.value.dir.type === \"desc\";\n            const read = pathNode(pathFor(shape, ref));\n            if (desc && field !== undefined && (field.kind === \"int\" || field.kind === \"num\") && !field.optional) {\n                return [segment(call(\"sort_by\", [negate(read)]), [slotAt(\"field\", \"call.args[0].negate\")])];\n            }\n            const sorted = segment(call(\"sort_by\", [read]), [slotAt(\"field\", \"call.args[0]\")]);\n            return desc ? [sorted, segment(call(\"reverse\"))] : [sorted];\n        }\n        case \"limit\":\n            return [segment(sliceTo(IDENTITY, inputLiteral(step.value.n)), [slotAt(\"n\", \"slice.to.some\")])];\n        case \"count\":\n            return [segment(call(\"length\"))];\n        case \"pick\": {\n            const entries = step.value.fields.map(p => {\n                const read = wholePathFor(shape, p.field.type === \"some\" ? p.field.value : \"\");\n                return read.length === 1 && read[0] === p.as ? { key: p.as } : { key: p.as, value: pathNode(read) };\n            });\n            return [segment(call(\"map\", [objectNode(entries)]), step.value.fields.flatMap((p, i) =>\n                entries[i]!.value === undefined ? [] : [slotAt(\"pick-field\", `call.args[0].object[${i}].value.some`, p.id)]))];\n        }\n        case \"fill\": {\n            const read = pathNode(wholePathFor(shape, step.value.field.type === \"some\" ? step.value.field.value : \"\"));\n            const value = step.value.value.type === \"some\" ? valueLiteral(step.value.value.value) : nullLiteral();\n            return [segment(call(\"map\", [updateNode(read, \"//=\", value)]), [slotAt(\"field\", \"call.args[0].update.path\"), slotAt(\"value\", \"call.args[0].update.value\")])];\n        }\n        case \"drill\": {\n            const list = pathNode(pathFor(shape, step.value.field.type === \"some\" ? step.value.field.value : \"\"));\n            const hasId = shape.row !== undefined && fieldsOfRecord(shape.row, new Map()).some(f => f.ref === \"id\");\n            if (!hasId) return [segment(arrayNode(pipe(iterate(IDENTITY), iterate(list))), [slotAt(\"field\", \"array.some.pipe.right.iterate.target\")])];\n            // Each item keeps its row's id, as {noun}_id.\n            const name = variableName(shape.noun);\n            const keep = binary(IDENTITY, \"+\", objectNode([{ key: `${shape.noun}_id`, value: fieldNode(variable(name), \"id\") }]));\n            return [segment(arrayNode(pipe(iterate(IDENTITY), bind(IDENTITY, name, pipe(iterate(list), keep)))),\n                [slotAt(\"field\", \"array.some.pipe.right.bind.body.pipe.left.iterate.target\")])];\n        }\n        case \"datepart\": {\n            const read = pathNode(pathFor(shape, step.value.field.type === \"some\" ? step.value.field.value : \"\"));\n            const part = step.value.part.type === \"year\" ? call(\"year\")\n                : call(\"strftime\", [stringLiteral(step.value.part.type === \"month\" ? \"%Y-%m\" : \"%A\")]);\n            return [segment(call(\"map\", [binary(IDENTITY, \"+\", objectNode([{ key: step.value.as, value: pipe(read, part) }]))]),\n                [slotAt(\"field\", \"call.args[0].binary.right.object[0].value.some\")])];\n        }\n        case \"walk\": {\n            const via = step.value.via.type === \"some\" ? step.value.via.value : \"\";\n            const node = unwrapRecursive(shape.type);\n            const kept = node.type === \"Struct\" ? scalarFieldsOf(node) : [];\n            return [segment(arrayNode(pipe(call(\"recurse\", [iterate(pathNode([via]))]), objectNode(kept.map(key => ({ key }))))),\n                [slotAt(\"via\", \"array.some.pipe.left.call.args[0]\")])];\n        }\n        case \"tabulate\": {\n            const { over, from, to, step: by, fixed, as } = step.value;\n            const name = variableName(over);\n            const upto = to.type === \"number\" && by.type === \"number\"\n                ? binary(floatLiteral(to.value), \"+\", binary(floatLiteral(by.value), \"/\", integerLiteral(2n)))\n                : inputLiteral(to, true);\n            const fn = unwrapRecursive(shape.type);\n            const input = fn.type === \"Function\" && (fn.inputs as EastType[]).length === 1 ? unwrapRecursive((fn.inputs as EastType[])[0]!) : undefined;\n            const inputs = input?.type === \"Struct\" ? Object.keys(input.fields as Record<string, EastType>) : [over];\n            const args = objectNode(inputs.map(key => {\n                if (key === over) return { key, value: variable(name) };\n                const value = fixed.get(key);\n                return { key, value: value === undefined ? nullLiteral() : valueLiteral(value) };\n            }));\n            const range = call(\"range\", [inputLiteral(from, true), upto, inputLiteral(by, true)]);\n            return [segment(arrayNode(bind(range, name, objectNode([\n                { key: over, value: variable(name) },\n                { key: as, value: call(\"call\", [IDENTITY, args]) },\n            ]))), [\n                slotAt(\"range\", \"array.some.bind.source\"),\n                ...inputs.flatMap((key, j) => key === over ? [] : [slotAt(\"fixed\", `array.some.bind.body.object[1].value.some.call.args[1].object[${j}].value.some`, key)]),\n            ])];\n        }\n        case \"jq\":\n            return [{ node: undefined, text: step.value.text.trim(), parts: [] }];\n    }\n}\n\n/**\n * Whether a finished step can be printed: a Look up's dataset must be one jq\n * can bind as a variable.\n *\n * @param step - the step\n * @returns whether it prints\n */\nexport function printable(step: Step): boolean {\n    return step.type !== \"lookup\" || (step.value.dataset.type === \"some\" && isVariableName(step.value.dataset.value));\n}\n\n/**\n * What the steps know of the shape a step gives, besides its type: the cases\n * its rows are narrowed to, a Keep the first bound, and what a row is called.\n *\n * @param step - the step\n * @param before - the shape it takes\n * @returns the narrowed fields, the bound and the noun\n */\nexport function knownAfter(step: Step, before: Shape): { narrowed: ReadonlyMap<string, string>; limit: number | undefined; noun: string } {\n    const kept = { narrowed: before.narrowed, limit: before.limit, noun: before.noun };\n    switch (step.type) {\n        case \"filter\": {\n            if (step.value.match.type !== \"all\") return kept;\n            const narrowed = new Map(before.narrowed);\n            for (const c of step.value.conds.filter(isConditionComplete)) {\n                const narrowing = narrowingOf(c, before);\n                if (narrowing?.case !== undefined) narrowed.set(narrowing.field, narrowing.case);\n            }\n            return { ...kept, narrowed };\n        }\n        case \"lookup\": case \"sort\": case \"datepart\":\n            return kept;\n        case \"limit\": {\n            const n = step.value.n;\n            if (n.type !== \"number\" || !Number.isSafeInteger(n.value)) return kept;\n            return { ...kept, limit: before.limit === undefined ? n.value : Math.min(before.limit, n.value) };\n        }\n        case \"pick\": {\n            // A variant shown whole keeps its case, under the name it is shown as.\n            const narrowed = new Map<string, string>();\n            for (const p of step.value.fields) {\n                const ref = p.field.type === \"some\" ? p.field.value : undefined;\n                const narrowedTo = ref === undefined ? undefined : before.narrowed.get(ref);\n                if (narrowedTo !== undefined && fieldByRef(before, ref!)?.kind === \"case\") narrowed.set(p.as, narrowedTo);\n            }\n            return { ...kept, narrowed };\n        }\n        case \"group\":\n            return {\n                narrowed: new Map(),\n                limit: undefined,\n                noun: step.value.by.type === \"some\" && step.value.by.value.type === \"field\" ? nameFor(before, step.value.by.value.value) : \"total\",\n            };\n        case \"drill\":\n            return { narrowed: new Map(), limit: undefined, noun: singular(nameFor(before, step.value.field.type === \"some\" ? step.value.field.value : \"item\")) };\n        case \"tabulate\":\n            return { narrowed: new Map(), limit: undefined, noun: step.value.over };\n        // An update rebuilds each row, and the checker keeps no narrowing through it.\n        case \"fill\": case \"count\": case \"walk\": case \"jq\":\n            return { narrowed: new Map(), limit: undefined, noun: before.noun };\n    }\n}\n\n/** A step's built segments with their texts. */\ninterface PrintedStep {\n    readonly segments: readonly { text: string; spans: ReadonlyMap<string, { from: number; to: number }> | undefined; parts: readonly PartPaths[] }[];\n}\n\n/** Prints a step's segments. */\nfunction printStep(step: Step, shape: Shape): PrintedStep {\n    return {\n        segments: buildStep(step, shape).map(built => {\n            if (built.node === undefined) return { text: built.text!, spans: undefined, parts: [] };\n            const printed = printJq(built.node);\n            return { text: printed.text, spans: printed.spans, parts: built.parts };\n        }),\n    };\n}\n\n/** The shape a stage of a checked prefix gives, found by where the segment starts. */\nexport function stageAt(check: CheckJqResult, from: number): { type: EastType; multiplicity: CheckJqResult[\"stages\"][number][\"multiplicity\"] } | undefined {\n    const stage = check.stages.find(s => s.from === from);\n    return stage === undefined ? undefined : { type: stage.type, multiplicity: stage.multiplicity };\n}\n\n/**\n * Lays a query out: prints each finished step for the shape before it,\n * checking each prefix against the root, and checks the whole program.\n *\n * @param query - the query\n * @param root - the root's type: a struct of the data sources\n * @returns the printed program, each step's shapes, and the program's check\n */\nexport function layOutSteps(query: StepQuery, root: EastType): StepLayout {\n    const lookups: string[] = [];\n    for (const step of query.steps) {\n        if (step.type !== \"lookup\" || !isComplete(step) || !printable(step)) continue;\n        const dataset = step.value.dataset.type === \"some\" ? step.value.dataset.value : \"\";\n        if (!lookups.includes(dataset)) lookups.push(dataset);\n    }\n\n    // The prologue binds each looked-up dataset; the source follows.\n    const segments: LaidOutSegment[] = lookups.map(ds => ({ stepId: undefined, text: `${printJq(pathNode([ds])).text} as $${ds}`, last: false }));\n    const sourceText = printJq(pathNode([query.source])).text;\n    segments.push({ stepId: undefined, text: sourceText, last: true });\n    const offsetOf = (list: readonly { text: string }[]): number => list.reduce((n, s) => n + s.text.length + SEP.length, 0);\n    const sourceFrom = offsetOf(segments.slice(0, -1));\n    const textOf = (list: readonly { text: string }[]): string => list.map(s => s.text).join(SEP);\n\n    // The segments that checked, which each next step is checked after.\n    let working: { text: string }[] = [...segments];\n    let check = checkJq(parseJq(textOf(working)), root, { root: true });\n    const sourceStage = stageAt(check, sourceFrom);\n    const noun = singular(query.source);\n    const source = sourceStage === undefined ? { ...UNKNOWN, noun } : shapeOf(sourceStage.type, sourceStage.multiplicity, { noun });\n\n    const laidOut: LaidOutStep[] = [];\n    const stepRanges: StepRange[] = [];\n    const condRanges: ConditionRange[] = [];\n    const slotRanges: SlotRange[] = [];\n    let shape = source;\n    let allChecked = true;\n    for (const step of query.steps) {\n        if (!isComplete(step) || !printable(step)) {\n            laidOut.push({ step, before: shape, after: shape, printed: false, checked: false });\n            continue;\n        }\n        const printed = printStep(step, shape);\n        // Where each segment starts in the whole program.\n        let offset = offsetOf(segments);\n        const stepFrom = offset;\n        printed.segments.forEach((seg, i) => {\n            segments.push({ stepId: step.value.id, text: seg.text, last: i === printed.segments.length - 1 });\n            const segFrom = offset;\n            const range = (path: string | undefined): readonly [number, number] | undefined => {\n                const s = path === undefined ? undefined : seg.spans?.get(path);\n                return s === undefined ? undefined : [segFrom + s.from, segFrom + s.to];\n            };\n            for (const part of seg.parts) {\n                const span = range(part.path);\n                if (span === undefined) continue;\n                if (part.slot !== undefined) {\n                    slotRanges.push({ stepId: step.value.id, slot: part.slot, ...(part.id === undefined ? {} : { id: part.id }), from: span[0], to: span[1] });\n                    continue;\n                }\n                const field = range(part.field);\n                const value = range(part.value);\n                condRanges.push({\n                    stepId: step.value.id, condId: part.condId!, from: span[0], to: span[1],\n                    parts: { ...(field === undefined ? {} : { field }), ...(value === undefined ? {} : { value }) },\n                });\n            }\n            offset += seg.text.length + SEP.length;\n        });\n        stepRanges.push({ id: step.value.id, from: stepFrom, to: offset - SEP.length });\n\n        // Checked after the steps that checked: a step that does not leaves the shape as it was.\n        const tentative = [...working, ...printed.segments.map(s => ({ text: s.text }))];\n        const lastFrom = offsetOf(tentative.slice(0, -1));\n        const tentativeCheck = checkJq(parseJq(textOf(tentative)), root, { root: true });\n        const stage = stageAt(tentativeCheck, lastFrom);\n        if (stage === undefined || tentativeCheck.diagnostics.some(d => d.severity.type === \"error\")) {\n            allChecked = false;\n            laidOut.push({ step, before: shape, after: shape, printed: true, checked: false });\n            continue;\n        }\n        const after = shapeOf(stage.type, stage.multiplicity, knownAfter(step, shape));\n        laidOut.push({ step, before: shape, after, printed: true, checked: true });\n        working = tentative;\n        check = tentativeCheck;\n        shape = after;\n    }\n\n    const text = textOf(segments);\n    const parsed = parseJq(text);\n    if (!allChecked) check = checkJq(parsed, root, { root: true });\n    return {\n        printed: {\n            text,\n            program: parsed.program.type === \"some\" ? parsed.program.value : null,\n            source: { from: sourceFrom, to: sourceFrom + sourceText.length },\n            steps: stepRanges,\n            conds: condRanges,\n            slots: slotRanges,\n        },\n        source,\n        steps: laidOut,\n        final: shape,\n        check,\n        segments,\n    };\n}\n\n/**\n * Prints a query's steps as canonical jq (`Query Editor Spec.md` §4.7), with\n * the span of every step and condition.\n *\n * @param query - the query\n * @param root - the root's type: a struct of the data sources\n * @returns the program's text, the program, and the ranges\n *\n * @remarks\n * The program starts with `.ds as $ds` for each dataset a finished Look up\n * reads, then the data source; each finished step follows on its own line.\n * Unfinished steps are left out. A jq step's text is printed as written.\n */\nexport function printSteps(query: StepQuery, root: EastType): PrintedSteps {\n    return layOutSteps(query, root).printed;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Counting a query's rows (#933): the program a run uses when the builder\n * wants each shape line's count — the query, with the number of rows bound\n * after each stage whose shape is rows, and the counts and a bounded result\n * as its output — so one run gives every count (`Query Editor Spec.md` §4.11).\n *\n * @packageDocumentation\n */\n\nimport { ArrayType, IntegerType, isValueOf, printJq, type EastType, type ValueTypeOf } from \"@elaraai/east\";\nimport { IDENTITY, arrayNode, commaAll, integerLiteral, objectNode, sliceTo, variable } from \"./jq.js\";\nimport { SEP, layOutSteps } from \"./print.js\";\nimport type { StepQuery } from \"./values.js\";\n\n/** The id a count of the data source's rows is given, beside the steps' ids. */\nexport const SOURCE_COUNT = \"$source\";\n\n/** How many rows a counting run returns, by default. */\nexport const DEFAULT_MAX_ROWS = 1000;\n\n/** The counts a counting program gives: one per counted stage. */\nconst CountsType = ArrayType(IntegerType);\n\n/** A counting program, and what its counts count. */\nexport interface CountingProgram {\n    /** The program's text. */\n    readonly text: string;\n    /** What each count is of, in order: {@link SOURCE_COUNT}, or a step's id. */\n    readonly counted: readonly string[];\n}\n\n/**\n * The program that runs a query and counts each stage's rows.\n *\n * @param query - the query\n * @param root - the root's type: a struct of the data sources\n * @param options - `maxRows`, how many rows of a rows result to return (1 000 by default)\n * @returns the program, and what its counts are of\n *\n * @remarks\n * After the data source and each step whose shape is rows, the program binds\n * `length as $nK`; it ends `{counts: [$n0, …], result: …}`, the result\n * `.[:maxRows]` when the query gives rows and `.` otherwise. It checks against\n * the root as the query does.\n */\nexport function countingProgram(query: StepQuery, root: EastType, options: { maxRows?: number } = {}): CountingProgram {\n    const layout = layOutSteps(query, root);\n    const after = new Map(layout.steps.map(s => [s.step.value.id, s.after]));\n    const lines: string[] = [];\n    const counted: string[] = [];\n    for (const segment of layout.segments) {\n        lines.push(segment.text);\n        if (!segment.last) continue;\n        const shape = segment.stepId === undefined ? layout.source : after.get(segment.stepId);\n        if (shape?.kind !== \"rows\") continue;\n        lines.push(`length as $n${counted.length}`);\n        counted.push(segment.stepId ?? SOURCE_COUNT);\n    }\n    const counts = arrayNode(counted.length === 0 ? undefined : commaAll(counted.map((_, i) => variable(`n${i}`))));\n    const result = layout.final.kind === \"rows\" ? sliceTo(IDENTITY, integerLiteral(BigInt(options.maxRows ?? DEFAULT_MAX_ROWS))) : IDENTITY;\n    lines.push(printJq(objectNode([{ key: \"counts\", value: counts }, { key: \"result\", value: result }])).text);\n    return { text: lines.join(SEP), counted };\n}\n\n/**\n * Reads a counting run's output.\n *\n * @param output - what the counting program gave: its counts and its result\n * @param counted - what each count is of, as {@link countingProgram} gave it\n * @returns each count, by {@link SOURCE_COUNT} or step id, and the result\n * @throws {Error} When the counts are not one whole number per counted stage.\n */\nexport function readCounts<T>(\n    output: { readonly counts: ValueTypeOf<typeof CountsType>; readonly result: T },\n    counted: readonly string[],\n): { counts: ReadonlyMap<string, number>; value: T } {\n    if (!isValueOf(output.counts, CountsType) || output.counts.length !== counted.length) {\n        throw new Error(`readCounts: expected ${counted.length} counts, one per counted stage`);\n    }\n    return {\n        counts: new Map(counted.map((id, i) => [id, Number(output.counts[i]!)])),\n        value: output.result,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Checking steps (#933): the printed program goes through east's checker\n * once, and each diagnostic is placed by its span on the step, condition and\n * slot it came from, with fixes as step edits. What the checker cannot see —\n * a step not finished, which is not in the program; a number a slot needs to\n * be whole — the steps check themselves (`Query Editor Spec.md` §4.6).\n *\n * @packageDocumentation\n */\n\nimport {\n    BooleanType, FloatType, plainKind, printFor, variant,\n    type EastType, type QueryErrorType, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport { DEFAULT_MAX_ROWS } from \"./count.js\";\nimport { comparisonsFor, fieldByRef, fieldsOf, type FieldKind, type StepField } from \"./fields.js\";\nimport { itemShape, layOutSteps, type ConditionRange, type SlotRange, type StepLayout, type StepSlot } from \"./print.js\";\nimport { unwrapRecursive, type Shape } from \"./shape.js\";\nimport { needsValue, type Condition, type Step, type StepQuery, type StepValue } from \"./values.js\";\n\n/** A diagnostic of the checker, as the query wire types hold it. */\ntype JqDiagnostic = ValueTypeOf<typeof QueryErrorType>;\n\n/** A jq step's note, in the checker's manner: a part of the program the visual view keeps as jq. */\nexport const JQ_STEP_NOTE = \"custom: not a visual step; it stays as jq in the visual editor.\";\n\nconst printFloat = printFor(FloatType);\nconst printBoolean = printFor(BooleanType);\n\n/**\n * Where a diagnostic is placed in a step besides a condition: a step's\n * {@link StepSlot}; `cmp` and `inner`, a condition's comparison and inner\n * condition; `as` and `over`, the names a step gives; `source`, the data\n * source; `text`, a jq step's text.\n */\nexport type DiagnosticSlot = StepSlot | \"cmp\" | \"inner\" | \"as\" | \"over\" | \"source\" | \"text\";\n\n/** A fix, as an edit of the steps, which `applyFix` applies. */\nexport type StepFix =\n    /** Keep only the rows of a case first: `field is case` at the front of this filter, or a filter of it before this step. */\n    | { readonly kind: \"addCaseCondition\"; readonly label: string; readonly stepId: string; readonly field: string; readonly case: string }\n    /** Use another field in a slot or a condition. */\n    | { readonly kind: \"setField\"; readonly label: string; readonly stepId: string; readonly slot: DiagnosticSlot; readonly condId?: string; readonly id?: string; readonly field: string }\n    /** Use another value in a condition. */\n    | { readonly kind: \"setValue\"; readonly label: string; readonly stepId: string; readonly condId: string; readonly value: StepValue }\n    /** Compare a variant's case, not the whole value. */\n    | { readonly kind: \"unwhole\"; readonly label: string; readonly stepId: string; readonly condId: string }\n    /** Take the step out. */\n    | { readonly kind: \"removeStep\"; readonly label: string; readonly stepId: string }\n    /** Edit a jq step's text: the checker's own fix, at offsets in the step's text. */\n    | { readonly kind: \"editJq\"; readonly label: string; readonly stepId: string; readonly edits: readonly { readonly from: number; readonly to: number; readonly insert: string }[] };\n\n/** A problem in a query's steps, where it is, and how to fix it. */\nexport interface StepDiagnostic {\n    /** The step it is in; `\"\"` for the data source. */\n    readonly stepId: string;\n    /** The condition it is in. */\n    readonly condId?: string;\n    /** The slot it is on. */\n    readonly slot?: DiagnosticSlot;\n    /** What the slot is for: a total's id, a field shown's, a field brought in, an input's name. */\n    readonly id?: string;\n    /** An error stops the query running; a warning does not; a note says what a jq step is. */\n    readonly severity: \"error\" | \"warning\" | \"note\";\n    /** The checker's code; `incomplete` for a slot not filled in; `custom` for a jq step; `too_many_rows` for a range a run cuts off. */\n    readonly code: string;\n    /** The checker's sentence, or the steps' own, in jq's words. */\n    readonly message: string;\n    /**\n     * What the builder's plain words need: `field` (the field's ref), `kind`,\n     * `name` and, for a payload's field, `parent`, `case` and `leaf`; `value`\n     * the condition's value; `suggestion` the checker's first; `what` what an\n     * unfinished slot needs; `cmp` and `fn` the comparison and the total;\n     * `dataset` a Look up's data source, with its `kind`; `rows` and `max` a\n     * range's rows and the most a run returns.\n     */\n    readonly context: Readonly<Record<string, string>>;\n    /** Its fixes, best first. */\n    readonly fixes: readonly StepFix[];\n}\n\n/** One step's shapes, as the check found them. */\nexport interface CheckedStepStage {\n    /** The step's id. */\n    readonly stepId: string;\n    /** The shape of the rows it takes. */\n    readonly before: Shape;\n    /** The shape it gives: its input's when it is unfinished or does not check. */\n    readonly after: Shape;\n}\n\n/** What checking a query's steps found. */\nexport interface CheckedSteps {\n    /** The printed program. */\n    readonly program: string;\n    /** The shape the data source gives. */\n    readonly source: Shape;\n    /** Each step's shapes, in order. */\n    readonly stages: readonly CheckedStepStage[];\n    /** The shape the query gives. */\n    readonly final: Shape;\n    /** The problems, by step. */\n    readonly diagnostics: readonly StepDiagnostic[];\n    /** How many are errors. */\n    readonly errors: number;\n    /** How many are warnings, unfinished slots included. */\n    readonly warnings: number;\n    /** The layout the check was made on: the program's ranges, and east's check. */\n    readonly layout: StepLayout;\n}\n\n/** Where a diagnostic is, in a step. */\ninterface Where {\n    readonly condId?: string;\n    readonly slot?: DiagnosticSlot;\n    readonly id?: string;\n}\n\n/** The kinds a slot's field takes, and what the slot calls one. */\nconst FIELD_RULES: Readonly<Record<\"sort\" | \"drill\" | \"datepart\", { kinds: readonly FieldKind[]; what: string; form: string }>> = {\n    sort: { kinds: [\"text\", \"int\", \"num\", \"date\", \"case\", \"bool\"], what: \"field to sort by\", form: \"sort_by\" },\n    drill: { kinds: [\"list\"], what: \"list\", form: \".[]\" },\n    datepart: { kinds: [\"date\"], what: \"date\", form: \"strftime\" },\n};\n\n/** The steps that take rows. */\nconst NEEDS_ROWS: ReadonlySet<Step[\"type\"]> = new Set([\"filter\", \"lookup\", \"group\", \"sort\", \"limit\", \"count\", \"pick\", \"fill\", \"drill\", \"datepart\"]);\n\n/** The kinds Group and total groups by. */\nconst GROUP_KINDS: readonly FieldKind[] = [\"text\", \"int\", \"num\", \"date\", \"case\", \"bool\"];\n\n/** An option's value, or `undefined`. */\nfunction valueOf<T>(o: option<T>): T | undefined {\n    return o.type === \"some\" ? o.value : undefined;\n}\n\n/**\n * The type of a data source of the root.\n *\n * @param root - the root's type: a struct of the data sources\n * @param name - the data source's name\n * @returns its type, or `undefined` when the root has none of that name\n */\nexport function datasetType(root: EastType, name: string): EastType | undefined {\n    const struct = unwrapRecursive(root);\n    if (struct.type !== \"Struct\") return undefined;\n    const fields = struct.fields as Record<string, EastType>;\n    return Object.hasOwn(fields, name) ? fields[name] : undefined;\n}\n\n/** How many rows `range(from; to + step / 2; step)` gives. */\nfunction rangeRows(from: number, to: number, step: number): number {\n    return Math.ceil((to - from) / step + 0.5);\n}\n\n/** A value as East prints it, for the words: text as written. */\nfunction valueText(value: StepValue): string {\n    switch (value.type) {\n        case \"text\": return value.value;\n        case \"number\": return printFloat(value.value);\n        case \"boolean\": return printBoolean(value.value);\n        case \"null\": return \"null\";\n    }\n}\n\n/** Builds a diagnostic of the steps' own. */\nfunction own(\n    stepId: string, severity: StepDiagnostic[\"severity\"], code: string, message: string,\n    where: Where = {}, context: Record<string, string> = {}, fixes: StepFix[] = [],\n): StepDiagnostic {\n    return { stepId, ...where, severity, code, message, context, fixes };\n}\n\n/** An unfinished slot: `incomplete`, saying what it needs. */\nfunction incomplete(stepId: string, what: string, where: Where = {}): StepDiagnostic {\n    return own(stepId, \"warning\", \"incomplete\", `incomplete: ${what}.`, where, { what });\n}\n\n/** What the words need of a field. */\nfunction fieldContext(field: StepField | undefined, ref: string): Record<string, string> {\n    if (field === undefined) return { field: ref };\n    return {\n        field: ref,\n        kind: field.kind,\n        name: field.name,\n        ...(field.payload === undefined ? {} : { parent: field.payload.parent, case: field.payload.case, leaf: field.payload.leaf }),\n    };\n}\n\n/** Checks what a condition needs that the checker cannot see: its slots, and a value no comparison can use. */\nfunction checkCondition(stepId: string, condition: Condition, shape: Shape, out: StepDiagnostic[]): void {\n    if (condition.type === \"group\") {\n        if (condition.value.conds.length === 0) out.push(incomplete(stepId, \"a condition in this group\", { condId: condition.value.id }));\n        for (const c of condition.value.conds) checkCondition(stepId, c, shape, out);\n        return;\n    }\n    const { id, field: ref, cmp, value, inner, whole } = condition.value;\n    if (ref.type === \"none\") { out.push(incomplete(stepId, \"a field\", { condId: id, slot: \"field\" })); return; }\n    if (cmp.type === \"none\") { out.push(incomplete(stepId, \"a comparison\", { condId: id, slot: \"cmp\" })); return; }\n    const field = fieldByRef(shape, ref.value);\n    const kind = cmp.value.type;\n    const context = { ...fieldContext(field, ref.value), cmp: kind };\n    if (field !== undefined && !whole && !comparisonsFor(field).includes(kind)) {\n        out.push(own(stepId, \"error\", \"type_mismatch\", `type_mismatch: ${kind} does not compare ${field.kind} values.`, { condId: id, slot: \"cmp\" }, context));\n        return;\n    }\n    if (kind === \"anyWhere\") {\n        if (inner.type === \"none\") out.push(incomplete(stepId, \"the inner condition\", { condId: id, slot: \"inner\" }));\n        else checkCondition(stepId, inner.value, itemShape(field), out);\n        return;\n    }\n    if (!needsValue(kind)) return;\n    if (value.type === \"none\" || (value.value.type === \"text\" && value.value.value.trim() === \"\")) {\n        out.push(incomplete(stepId, \"a value\", { condId: id, slot: \"value\" }));\n        return;\n    }\n    const v = value.value;\n    if (kind === \"inMonth\" && !(v.type === \"text\" && /^\\d{4}-(0[1-9]|1[0-2])$/.test(v.value))) {\n        out.push(own(stepId, \"error\", \"type_mismatch\", \"type_mismatch: strftime(\\\"%Y-%m\\\") gives a month like \\\"2026-03\\\".\", { condId: id, slot: \"value\" }, { ...context, value: valueText(v) }));\n    }\n    if (kind === \"lengthAtLeast\" && !(v.type === \"number\" && Number.isSafeInteger(v.value) && v.value >= 0)) {\n        out.push(own(stepId, \"error\", \"type_mismatch\", \"type_mismatch: length gives a whole number of items, 0 or more.\", { condId: id, slot: \"value\" }, { ...context, value: valueText(v) }));\n    }\n}\n\n/** Checks what a step needs that the checker cannot see. */\nfunction checkStep(step: Step, before: Shape, root: EastType, out: StepDiagnostic[]): void {\n    const id = step.value.id;\n    switch (step.type) {\n        case \"filter\":\n            if (step.value.conds.length === 0) out.push(incomplete(id, \"a condition\"));\n            for (const c of step.value.conds) checkCondition(id, c, before, out);\n            return;\n        case \"lookup\": {\n            const { dataset, key, fields } = step.value;\n            if (dataset.type === \"none\") out.push(incomplete(id, \"a dataset to look up in\", { slot: \"dataset\" }));\n            else {\n                // A Look up finds a row of a Dict by its key: a data source of any other type has no rows to find, whatever the key.\n                const table = datasetType(root, dataset.value);\n                if (table !== undefined && unwrapRecursive(table).type !== \"Dict\") {\n                    out.push(own(id, \"error\", \"not_indexable\", `not_indexable: $${dataset.value} is not a Dict, so a Look up cannot find a row of it by key.`,\n                        { slot: \"dataset\" }, { dataset: dataset.value, kind: plainKind(table) }));\n                }\n            }\n            if (key.type === \"none\") out.push(incomplete(id, \"a field to find by\", { slot: \"key\" }));\n            if (fields.length === 0) out.push(incomplete(id, \"a field to bring in\", { slot: \"fields\" }));\n            return;\n        }\n        case \"group\": {\n            const { by, aggs } = step.value;\n            if (by.type === \"none\") out.push(incomplete(id, \"what to group by\", { slot: \"by\" }));\n            else if (by.value.type === \"field\") {\n                const field = fieldByRef(before, by.value.value);\n                if (field !== undefined && !GROUP_KINDS.includes(field.kind)) {\n                    out.push(own(id, \"error\", \"type_mismatch\", `type_mismatch: group_by groups on a value, not ${field.kind}.`, { slot: \"by\" }, { ...fieldContext(field, field.ref), what: \"field to group by\" }));\n                }\n            } else if (aggs.length === 0) out.push(incomplete(id, \"a total\", { slot: \"agg-field\" }));\n            for (const a of aggs) {\n                if (a.fn.type === \"count\") continue;\n                const ref = valueOf(a.field);\n                if (ref === undefined) { out.push(incomplete(id, \"a field to total\", { slot: \"agg-field\", id: a.id })); continue; }\n                const field = fieldByRef(before, ref);\n                if (field === undefined) continue;\n                const context = { ...fieldContext(field, ref), fn: a.fn.type };\n                if ((a.fn.type === \"sum\" || a.fn.type === \"mean\") && field.kind !== \"int\" && field.kind !== \"num\") {\n                    // jq's add joins text, which is no total: offer the numbers instead.\n                    const numbers = fieldsOf(before).filter(f => f.kind === \"int\" || f.kind === \"num\");\n                    out.push(own(id, \"error\", \"type_mismatch\", `type_mismatch: ${a.fn.type === \"sum\" ? \"add\" : \"add / length\"} totals numbers; ${field.name} is ${field.kind}.`,\n                        { slot: \"agg-field\", id: a.id }, context,\n                        numbers.slice(0, 2).map(n => ({ kind: \"setField\", label: `Use ${n.name}`, stepId: id, slot: \"agg-field\", id: a.id, field: n.ref }))));\n                } else if ((a.fn.type === \"min\" || a.fn.type === \"max\") && ![\"int\", \"num\", \"date\", \"text\"].includes(field.kind)) {\n                    out.push(own(id, \"error\", \"type_mismatch\", `type_mismatch: ${a.fn.type} takes values in order; ${field.name} is ${field.kind}.`, { slot: \"agg-field\", id: a.id }, context));\n                }\n            }\n            return;\n        }\n        case \"limit\": {\n            const n = step.value.n;\n            if (n.type === \"text\" && n.value.trim() === \"\") out.push(incomplete(id, \"how many to keep\", { slot: \"n\" }));\n            else if (n.type === \"number\" && !(Number.isSafeInteger(n.value) && n.value >= 1)) {\n                out.push(own(id, \"error\", \"type_mismatch\", \"type_mismatch: .[:n] keeps a whole number of rows, 1 or more.\", { slot: \"n\" }, { value: printFloat(n.value) }));\n            }\n            return;\n        }\n        case \"pick\":\n            if (step.value.fields.length === 0) out.push(incomplete(id, \"a field to show\", { slot: \"pick-field\" }));\n            for (const p of step.value.fields) if (p.field.type === \"none\") out.push(incomplete(id, \"a field to show\", { slot: \"pick-field\", id: p.id }));\n            return;\n        case \"fill\":\n            if (step.value.field.type === \"none\") out.push(incomplete(id, \"a field to fill in\", { slot: \"field\" }));\n            if (step.value.value.type === \"none\") out.push(incomplete(id, \"a value to use\", { slot: \"value\" }));\n            return;\n        case \"sort\": case \"drill\": case \"datepart\": {\n            const rule = FIELD_RULES[step.type];\n            const ref = valueOf(step.value.field);\n            if (ref === undefined) out.push(incomplete(id, `a ${rule.what}`, { slot: \"field\" }));\n            else {\n                const field = fieldByRef(before, ref);\n                if (field !== undefined && !rule.kinds.includes(field.kind)) {\n                    const form = step.type === \"datepart\" && step.value.part.type === \"year\" ? \"year\" : rule.form;\n                    out.push(own(id, \"error\", \"type_mismatch\", `type_mismatch: ${form} takes a ${rule.what}, not ${field.kind}.`, { slot: \"field\" }, { ...fieldContext(field, ref), what: rule.what }));\n                }\n            }\n            if (step.type === \"datepart\" && step.value.as.trim() === \"\") out.push(incomplete(id, \"a name for the part\", { slot: \"as\" }));\n            return;\n        }\n        case \"walk\":\n            if (step.value.via.type === \"none\") out.push(incomplete(id, \"the list of parts\", { slot: \"via\" }));\n            return;\n        case \"tabulate\": {\n            const { from, to, step: by, as, over } = step.value;\n            if (over.trim() === \"\") out.push(incomplete(id, \"the input to try\", { slot: \"over\" }));\n            if (as.trim() === \"\") out.push(incomplete(id, \"a name for the result\", { slot: \"as\" }));\n            if ([from, to, by].some(x => x.type === \"text\" && x.value.trim() === \"\")) out.push(incomplete(id, \"the range\", { slot: \"range\" }));\n            else if (from.type === \"number\" && to.type === \"number\" && by.type === \"number\") {\n                const range = `range(${printFloat(from.value)}; ${printFloat(to.value)}; ${printFloat(by.value)})`;\n                if (!(by.value > 0 && to.value >= from.value)) {\n                    out.push(own(id, \"error\", \"type_mismatch\", `type_mismatch: ${range} yields nothing.`, { slot: \"range\" }));\n                } else {\n                    // A run returns its first rows, so a longer range is cut off.\n                    const rows = rangeRows(from.value, to.value, by.value);\n                    if (rows > DEFAULT_MAX_ROWS) {\n                        out.push(own(id, \"warning\", \"too_many_rows\", `too_many_rows: ${range} gives ${rows} rows; a run returns the first ${DEFAULT_MAX_ROWS}.`,\n                            { slot: \"range\" }, { rows: `${rows}`, max: `${DEFAULT_MAX_ROWS}` }));\n                    }\n                }\n            }\n            return;\n        }\n        case \"count\":\n            return;\n        case \"jq\":\n            if (step.value.text.trim() === \"\") out.push(incomplete(id, \"the jq\", { slot: \"text\" }));\n            return;\n    }\n}\n\n/** Whether a range holds an offset, its ends included. */\nfunction inRange(range: { readonly from: number; readonly to: number }, at: number): boolean {\n    return at >= range.from && at <= range.to;\n}\n\n/** Whether a part's range holds an offset. */\nfunction inPart(part: readonly [number, number] | undefined, at: number): boolean {\n    return part !== undefined && at >= part[0] && at <= part[1];\n}\n\n/** Whether a span covers a part's range whole. */\nfunction covers(from: number, to: number, part: readonly [number, number] | undefined): boolean {\n    return part !== undefined && from <= part[0] && to >= part[1];\n}\n\n/** The innermost of some ranges that holds an offset. */\nfunction innermost<R extends { readonly from: number; readonly to: number }>(ranges: readonly R[], at: number): R | undefined {\n    let best: R | undefined;\n    for (const r of ranges) if (inRange(r, at) && (best === undefined || r.to - r.from < best.to - best.from)) best = r;\n    return best;\n}\n\n/**\n * A condition of a filter by its id, with the rows it tests: the step's, or\n * a list's items for a condition inside has any where.\n *\n * @param conds - the filter's conditions\n * @param id - the condition's id\n * @param shape - the rows the filter takes\n * @returns the condition and the rows it tests, or `undefined` when no condition has that id\n */\nexport function conditionIn(conds: readonly Condition[], id: string, shape: Shape): { condition: Condition; shape: Shape } | undefined {\n    for (const c of conds) {\n        if (c.value.id === id) return { condition: c, shape };\n        if (c.type === \"group\") {\n            const inside = conditionIn(c.value.conds, id, shape);\n            if (inside !== undefined) return inside;\n        } else if (c.value.inner.type === \"some\") {\n            const ref = valueOf(c.value.field);\n            const inside = conditionIn([c.value.inner.value], id, itemShape(ref === undefined ? undefined : fieldByRef(shape, ref)));\n            if (inside !== undefined) return inside;\n        }\n    }\n    return undefined;\n}\n\n/** The field a step reads in a slot. */\nfunction slotRef(step: Step, where: Where): string | undefined {\n    switch (step.type) {\n        case \"lookup\": return where.slot === \"key\" ? valueOf(step.value.key) : undefined;\n        case \"group\": {\n            if (where.slot === \"by\") return step.value.by.type === \"some\" && step.value.by.value.type === \"field\" ? step.value.by.value.value : undefined;\n            const total = where.slot === \"agg-field\" ? step.value.aggs.find(a => a.id === where.id) : undefined;\n            return total === undefined ? undefined : valueOf(total.field);\n        }\n        case \"pick\": {\n            const shown = step.value.fields.find(p => p.id === where.id);\n            return shown === undefined ? undefined : valueOf(shown.field);\n        }\n        case \"sort\": case \"fill\": case \"drill\": case \"datepart\":\n            return where.slot === \"field\" ? valueOf(step.value.field) : undefined;\n        default:\n            return undefined;\n    }\n}\n\n/** The name a fix's text gives: `.total` → `total`. */\nfunction suggestedName(text: string): string | undefined {\n    return /^\\.([A-Za-z_][A-Za-z0-9_]*)$/.exec(text.trim())?.[1];\n}\n\n/**\n * Places one of the checker's diagnostics on the steps.\n *\n * @param d - the diagnostic\n * @param layout - the laid-out query\n * @returns the diagnostic on its step, condition and slot, with fixes as step edits\n */\nfunction place(d: JqDiagnostic, layout: StepLayout): StepDiagnostic {\n    const text = layout.printed.text;\n    const base = { severity: d.severity.type === \"warning\" ? \"warning\" as const : \"error\" as const, code: d.code, message: d.message };\n    if (d.span.type === \"none\") return { stepId: \"\", ...base, context: {}, fixes: [] };\n    const from = Number(d.span.value.offset);\n    const to = from + Number(d.span.value.length);\n    const named = text.slice(from, to);\n    const context: Record<string, string> = { name: named.replace(/^\\./, \"\"), ...(d.suggestions[0] === undefined ? {} : { suggestion: d.suggestions[0] }) };\n\n    const stepRange = layout.printed.steps.find(r => inRange(r, from));\n    if (stepRange === undefined) {\n        // The data source, or the prologue that binds a Look up's dataset.\n        const looked = layout.steps.find(s => s.step.type === \"lookup\" && named === `.${valueOf(s.step.value.dataset)}`);\n        return looked === undefined\n            ? { stepId: \"\", slot: \"source\", ...base, context, fixes: [] }\n            : { stepId: looked.step.value.id, slot: \"dataset\", ...base, context, fixes: [] };\n    }\n    const stepId = stepRange.id;\n    const laid = layout.steps.find(s => s.step.value.id === stepId)!;\n    const step = laid.step;\n\n    // A jq step keeps the checker's words, and its fixes edit its text.\n    if (step.type === \"jq\") {\n        return {\n            stepId, slot: \"text\", ...base, context,\n            fixes: d.fixes.map(f => ({\n                kind: \"editJq\", label: f.label, stepId,\n                edits: f.edits.map(e => ({ from: Number(e.offset) - stepRange.from, to: Number(e.offset + e.length) - stepRange.from, insert: e.insert })),\n            })),\n        };\n    }\n\n    const cond: ConditionRange | undefined = innermost(layout.printed.conds.filter(c => c.stepId === stepId), from);\n    const slotRange: SlotRange | undefined = cond === undefined ? innermost(layout.printed.slots.filter(s => s.stepId === stepId), from) : undefined;\n    // A value is inside its condition's read, so it is looked for first. A problem\n    // with the whole comparison is its value's: the steps chose the field, and\n    // a comparison its kind takes.\n    const onValue = inPart(cond?.parts.value, from) || covers(from, to, cond?.parts.value);\n    const where: Where = cond !== undefined\n        ? { condId: cond.condId, ...(onValue ? { slot: \"value\" as const } : inPart(cond.parts.field, from) ? { slot: \"field\" as const } : {}) }\n        : slotRange !== undefined ? { slot: slotRange.slot, ...(slotRange.id === undefined ? {} : { id: slotRange.id }) } : {};\n\n    // The field it is about, in the rows it reads.\n    const found = cond !== undefined && step.type === \"filter\" ? conditionIn(step.value.conds, cond.condId, laid.before) : undefined;\n    const condition = found?.condition;\n    const shape = found?.shape ?? laid.before;\n    const ref = condition?.type === \"test\" ? valueOf(condition.value.field) : slotRef(step, where);\n    const field = ref === undefined ? undefined : fieldByRef(shape, ref);\n    if (ref !== undefined) Object.assign(context, fieldContext(field, ref));\n    if (condition?.type === \"test\" && condition.value.value.type === \"some\") context[\"value\"] = valueText(condition.value.value.value);\n\n    const fixes: StepFix[] = [];\n    for (const f of d.fixes) {\n        if (f.label === \"Narrow first\") {\n            // A payload's field read before the rows are narrowed to its case: keep only that case's rows first.\n            const payload = field?.payload ?? fieldsOf(shape).find(x => x.payload !== undefined && named.endsWith(`.${x.payload.parent}.value.${x.payload.leaf}`))?.payload;\n            if (payload !== undefined) fixes.push({ kind: \"addCaseCondition\", label: f.label, stepId, field: payload.parent, case: payload.case });\n            continue;\n        }\n        if (f.label === \"Use .type\") {\n            if (condition?.type === \"test\") fixes.push({ kind: \"unwhole\", label: f.label, stepId, condId: condition.value.id });\n            continue;\n        }\n        const replacement = f.edits.length === 1 ? f.edits[0]!.insert : undefined;\n        if (replacement === undefined) continue;\n        if (d.code === \"unknown_case\" && condition?.type === \"test\") {\n            const name = /^\"(.*)\"$/.exec(replacement)?.[1];\n            if (name !== undefined) fixes.push({ kind: \"setValue\", label: f.label, stepId, condId: condition.value.id, value: variant(\"text\", name) });\n        } else if (d.code === \"unknown_field\" && (where.slot !== undefined || where.condId !== undefined)) {\n            const name = suggestedName(replacement);\n            if (name === undefined) continue;\n            // A payload's field misspelt is another field of the same case: `status.shipped.date` for `status.shipped.dat`.\n            const parts = ref?.split(\".\") ?? [];\n            fixes.push({\n                kind: \"setField\", label: f.label, stepId, slot: where.slot ?? \"field\",\n                field: parts.length === 3 ? `${parts[0]}.${parts[1]}.${name}` : name,\n                ...(where.condId === undefined ? {} : { condId: where.condId }),\n                ...(where.id === undefined ? {} : { id: where.id }),\n            });\n        }\n    }\n    // A step that keeps, reshapes or totals rows, on one value, has nothing to work on.\n    if (base.severity === \"error\" && laid.before.kind === \"one\" && NEEDS_ROWS.has(step.type)) fixes.push({ kind: \"removeStep\", label: \"Remove this step\", stepId });\n    return { stepId, ...where, ...base, context, fixes };\n}\n\n/**\n * Checks a query's steps: once, through east's checker, with what the steps\n * check themselves.\n *\n * @param query - the query\n * @param root - the root's type: a struct of the data sources\n * @returns the program, each step's shapes, and the diagnostics by step\n *\n * @remarks\n * An unfinished slot is an `incomplete` warning, since an unfinished step is\n * not in the program. The checker's diagnostics keep their code and message,\n * placed by span on the step, condition and slot they came from; each jq\n * step gets a `custom` note. Where the steps find a problem themselves — a\n * field of the wrong kind in a slot, a comparison the field's kind does not\n * take, a Look up in a data source that is not a Dict — what the checker\n * finds in that slot, that condition or that step follows from it and is\n * left out, so one problem is reported once.\n */\nexport function checkSteps(query: StepQuery, root: EastType): CheckedSteps {\n    const layout = layOutSteps(query, root);\n    const diagnostics: StepDiagnostic[] = [];\n    for (const laid of layout.steps) checkStep(laid.step, laid.before, root, diagnostics);\n    const causes = diagnostics.filter(d => d.severity === \"error\");\n    const follows = (placed: StepDiagnostic): boolean => causes.some(c => c.stepId === placed.stepId && (\n        c.code === \"not_indexable\"\n        || (c.condId !== undefined\n            ? c.condId === placed.condId && (c.slot === \"cmp\" || c.slot === placed.slot)\n            : placed.condId === undefined && c.slot !== undefined && c.slot === placed.slot && c.id === placed.id)));\n    for (const d of layout.check.diagnostics) {\n        const placed = place(d, layout);\n        if (!follows(placed)) diagnostics.push(placed);\n    }\n    for (const laid of layout.steps) {\n        if (laid.step.type === \"jq\" && laid.printed) {\n            diagnostics.push(own(laid.step.value.id, \"note\", \"custom\", JQ_STEP_NOTE, { slot: \"text\" }));\n        }\n    }\n    return {\n        program: layout.printed.text,\n        source: layout.source,\n        stages: layout.steps.map(s => ({ stepId: s.step.value.id, before: s.before, after: s.after })),\n        final: layout.final,\n        diagnostics,\n        errors: diagnostics.filter(d => d.severity === \"error\").length,\n        warnings: diagnostics.filter(d => d.severity === \"warning\").length,\n        layout,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The article English gives a noun, by its first sound rather than its first\n * letter — `a user`, `an hour` — the one rule every builder's words choose\n * `a` or `an` by.\n *\n * @packageDocumentation\n */\n\n/** A vowel letter that starts with a consonant's sound: `a user`, `a unit`, `a euro`, `a one-off`. */\nconst SOUNDS_CONSONANT = /^(?:u[bcfhjkqrstn][aeiou]|eu|ew|one\\b|once\\b)/i;\n/** A first letter that is silent: `an hour`, `an honest`, `an heir`. */\nconst SILENT_H = /^(?:hour|honest|hono|heir)/i;\n\n/**\n * The article a noun takes, by its first sound: `a` before `person`, `user` and `one-off`; `an` before `operator`,\n * `umbrella` and `hour`.\n *\n * @param noun - The noun, as running text writes it\n * @returns `a` or `an`\n */\nexport function articleOf(noun: string): \"a\" | \"an\" {\n    return (/^[aeiou]/i.test(noun) && !SOUNDS_CONSONANT.test(noun)) || SILENT_H.test(noun) ? \"an\" : \"a\";\n}\n\n/**\n * A noun with its article, by its first sound: `a person`, `an operator`, `a user`, `an hour`.\n *\n * @param noun - The noun, as running text writes it\n * @returns The noun after its article\n */\nexport function withArticle(noun: string): string {\n    return `${articleOf(noun)} ${noun}`;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Every word the query builder's model says (#934) — ONE typed message table:\n * the steps' titles, verbs and add-step entries; the comparisons; kinds,\n * shapes and counts; the parts of a step card; the autocomplete's labels,\n * groups and offers; a summary's words; the plain sentence for each problem\n * and fix (`Query Editor Spec.md` §4.6); the generated description (§4.13);\n * the builder's own chrome (#935); and a run's plan, its path and why, its\n * stages and its pruning (#941). What the AUTHOR wrote, and what the\n * data holds — a field's name, a case, a value, a saved query's name — is\n * data, and never passes through it.\n *\n * English is the default. The model's functions take the table as a\n * parameter, so a renderer passes its own; numbers arrive already formatted\n * for the locale, and `n` is the raw count, for plurals.\n *\n * @packageDocumentation\n */\n\nimport type { JqTotal, JqWholeReason } from \"@elaraai/east\";\nimport { withArticle } from \"../../shared/article.js\";\nimport type { ComparisonKind, StepKind } from \"../steps/values.js\";\nimport type { InputKind } from \"./refs.js\";\n\n/** What a slot asks for: each kind of slot a step card has. */\nexport type SlotKind =\n    | \"match\" | \"group-match\"\n    | \"field\" | \"cmp\" | \"value\"\n    | \"key\" | \"dataset\" | \"lookup-add\"\n    | \"by\" | \"agg-fn\" | \"agg-field\"\n    | \"sort-field\" | \"dir\"\n    | \"pick-field\" | \"pick-add\"\n    | \"fill-field\" | \"drill-field\" | \"via\"\n    | \"part\" | \"date-field\"\n    | \"fixed\"\n    | \"add-step\";\n\n/** A kind of value, in plain words. */\nexport type KindName =\n    | \"text\" | \"wholeNumber\" | \"number\" | \"date\" | \"yesNo\" | \"nothing\" | \"bytes\"\n    | \"oneOf\" | \"list\" | \"lookupTable\" | \"calculation\" | \"record\" | \"tree\" | \"value\";\n\n/** A total's function. */\nexport type TotalName = \"count\" | \"sum\" | \"mean\" | \"min\" | \"max\" | \"distinct\";\n\n/** What one value is, for the shape of a query that gives one. */\nexport type OneKind = \"wholeNumber\" | \"number\" | \"text\" | \"record\" | \"tree\" | \"calculation\" | \"list\" | \"lookupTable\" | \"value\";\n\n/** Why a query runs as one unit: the code of east's reason (`JqWholeReason`). */\nexport type PlanWholeCode = JqWholeReason[\"code\"];\n\n/** How one total's parts combine: east's rule (`JqTotal`). */\nexport type PlanTotalRule = JqTotal[\"rule\"];\n\n/**\n * How a split's pieces' outputs combine, as a plan's explanation says it: the\n * rows joined; totals; rows grouped by a key, then each group's totals\n * combined or its rows collected; the distinct rows; the first row of each\n * key; a reduce's updates, added or the last kept.\n */\nexport type PlanCombineKind = \"concat\" | \"totals\" | \"group\" | \"groupTotals\" | \"groupRows\" | \"distinct\" | \"distinctBy\" | \"reduceAdd\" | \"reduceReplace\";\n\n/** The query builder's message table. */\nexport interface QueryMessages {\n    // ── Steps ────────────────────────────────────────────────────────────\n    /** A step card's title — `Open each order's list` names the rows. */\n    stepTitle: (p: { kind: StepKind; noun: string }) => string;\n    /** What a step does to rows, for \"there are no rows to {verb} here\". */\n    stepVerb: (p: { kind: StepKind }) => string;\n    /** A step in the add-step list. */\n    addStepLabel: (p: { kind: StepKind; noun: string }) => string;\n    /** Under it. */\n    addStepHint: (p: { kind: StepKind }) => string;\n    /** The words the add-step list's filter matches, besides the label. */\n    addStepKeywords: (p: { kind: StepKind }) => string;\n    /** A step's Quick add button. */\n    quickAddLabel: (p: { kind: StepKind }) => string;\n    /** Why List every part does not fit here. */\n    needsTree: () => string;\n    /** Why Try the model does not fit here. */\n    needsCalculation: () => string;\n    /** Why a step that takes a kind of field the rows lack does not fit. */\n    nothingToUse: () => string;\n    /** Why a step that takes rows does not fit — `Needs rows — the query gives one whole number here`. */\n    needsRows: (p: { shape: string }) => string;\n    /** Under an unfinished step. */\n    notFinished: () => string;\n    /** The Query tab with no steps. */\n    noSteps: () => string;\n    /** The foot's dashed add. */\n    addStepAtEnd: () => string;\n    /** Before the Quick add buttons. */\n    quickAdd: () => string;\n    /** A shape line's add. */\n    insert: () => string;\n    /** The source's title — `Start with orders`. */\n    startWith: (p: { source: string }) => string;\n\n    // ── Comparisons ──────────────────────────────────────────────────────\n    /** A comparison — `is at least`. */\n    comparison: (p: { cmp: ComparisonKind }) => string;\n    /** Beside a comparison in the list, when it needs saying. */\n    comparisonDetail: (p: { cmp: ComparisonKind }) => string;\n\n    // ── Kinds, shapes and counts ─────────────────────────────────────────\n    /** A kind of value — `list of lines`, `one of cancelled, pending, shipped`. */\n    kind: (p: { kind: KindName; items?: string; cases?: string }) => string;\n    /** A kind that can be missing — `number, sometimes missing`. */\n    sometimesMissing: (p: { kind: string }) => string;\n    /** Rows, not counted — `Many shipped orders`. */\n    shapeMany: (p: { rows: string }) => string;\n    /** Rows a Keep the first bounds — `Up to 10 shipped orders`. */\n    shapeUpTo: (p: { count: string; rows: string }) => string;\n    /** One value — `One whole number`, `One bom tree`. */\n    shapeOne: (p: { kind: OneKind; noun: string }) => string;\n    /** A shape the checker could not tell, after a problem. */\n    shapeUnknown: () => string;\n    /** Rows counted — `16 shipped orders`. */\n    countRows: (p: { count: string; rows: string }) => string;\n    /** Rows described: an adjective and a noun, already in the right number — `shipped orders`. */\n    rows: (p: { adjective: string; noun: string }) => string;\n    /** The fields a step added — `+ name, region`. */\n    fieldsAdded: (p: { fields: string }) => string;\n    /** The status line's shape — `Gives 10 orders`. */\n    gives: (p: { shape: string }) => string;\n\n    // ── A step card's parts ──────────────────────────────────────────────\n    /** A match. */\n    match: (p: { match: \"all\" | \"any\" }) => string;\n    /** After it — `of these are true`. */\n    ofThese: (p: { match: \"all\" | \"any\" }) => string;\n    /** A joiner between conditions. */\n    joiner: (p: { match: \"all\" | \"any\" }) => string;\n    /** Look up: before its key. */\n    find: () => string;\n    /** Look up: before its dataset. */\n    inDataset: () => string;\n    /** Look up: before its fields. */\n    bringIn: () => string;\n    /** Look up's note. */\n    leftEmpty: (p: { noun: string }) => string;\n    /** Group and total, Sort: before the field. */\n    by: () => string;\n    /** Group and total: before the first total, and each after it. */\n    thenTotal: (p: { first: boolean }) => string;\n    /** Before a name. */\n    as: () => string;\n    /** Group and total: all rows together. */\n    allRowsTogether: () => string;\n    /** Count the rows' row. */\n    givesOneWholeNumber: () => string;\n    /** Fill: before the field. */\n    where: () => string;\n    /** Fill: before the value. */\n    isMissingUse: () => string;\n    /** Open each list: before the list. */\n    open: () => string;\n    /** Open each list: after it — `one row per line, keeping the order ID`. */\n    onePer: (p: { item: string; keeping?: string }) => string;\n    /** Take part of a date: before the part. */\n    takeThe: () => string;\n    /** Take part of a date: before the date. */\n    of: () => string;\n    /** List every part's row. */\n    everyLevel: (p: { fields: string }) => string;\n    /** Try the model: before the start — `price from`. */\n    inputFrom: (p: { input: string }) => string;\n    /** Try the model: before the end. */\n    to: () => string;\n    /** Try the model: before the step. */\n    every: () => string;\n    /** Try the model: before the result's name. */\n    callTheResult: () => string;\n    /** A filter's foot. */\n    addCondition: () => string;\n    /** A filter's foot. */\n    addGroup: () => string;\n    /** Group and total's foot. */\n    addTotal: () => string;\n    /** Show only fields' foot, Look up's add. */\n    addField: () => string;\n    /** A row's remove. */\n    remove: () => string;\n    /** A group's remove. */\n    removeGroup: () => string;\n    /** An empty slot's word. */\n    placeholder: (p: { slot: SlotKind }) => string;\n    /** A total. */\n    total: (p: { fn: TotalName }) => string;\n    /** An order — `highest first`. */\n    direction: (p: { dir: \"asc\" | \"desc\"; kind: \"date\" | \"text\" | \"number\" }) => string;\n    /** A part of a date. */\n    part: (p: { part: \"year\" | \"month\" | \"weekday\" }) => string;\n    /** What a part of a date gives, for the list. */\n    partExample: (p: { part: \"year\" | \"month\" | \"weekday\" }) => string;\n    /** A list of names — `a, b and c`. */\n    list: (p: { items: readonly string[] }) => string;\n\n    // ── The autocomplete ─────────────────────────────────────────────────\n    /** A slot's popover label. */\n    slotLabel: (p: { slot: SlotKind }) => string;\n    /** Its filter's placeholder. */\n    slotPlaceholder: (p: { slot: SlotKind }) => string;\n    /** Its footer: where its options come from. */\n    slotHint: (p: { slot: SlotKind }) => string;\n    /** What it says with nothing to offer. */\n    slotEmpty: (p: { slot: SlotKind }) => string;\n    /** The footer's keys. */\n    slotKeys: () => string;\n    /** A group of the rows' own fields. */\n    fieldsGroup: () => string;\n    /** A group of a variant's payload fields — `Inside status`. */\n    insideGroup: (p: { parent: string }) => string;\n    /** A group of a list item's fields — `Each line`. */\n    eachGroup: (p: { noun: string }) => string;\n    /** A payload field before the rows are narrowed — `shipped orders only`. */\n    onlyCase: (p: { rows: string }) => string;\n    /** The comparisons' group. */\n    compareGroup: () => string;\n    /** A variant's cases. */\n    casesGroup: () => string;\n    /** Text values in the data. */\n    valuesGroup: () => string;\n    /** Numbers from the summary. */\n    fromDataGroup: () => string;\n    /** Years in the data. */\n    yearsGroup: () => string;\n    /** Months in the data. */\n    monthsGroup: () => string;\n    /** How many items. */\n    itemsGroup: () => string;\n    /** A value typed. */\n    typedGroup: () => string;\n    /** The match's group. */\n    matchGroup: () => string;\n    /** Group by's own entries. */\n    groupGroup: () => string;\n    /** The totals' group. */\n    totalGroup: () => string;\n    /** The orders' group. */\n    orderGroup: () => string;\n    /** The parts' group. */\n    partGroup: () => string;\n    /** The lookup tables' group. */\n    datasetsGroup: () => string;\n    /** A lookup table's fields — `From customers`. */\n    fromDatasetGroup: (p: { dataset: string }) => string;\n    /** A model's other inputs: values typed or offered. */\n    inputGroup: () => string;\n    /** The add-step list's steps. */\n    addStepGroup: () => string;\n    /** Saved queries offered when there are no steps. */\n    savedGroup: () => string;\n    /** A value typed, offered first — `Use “2026”`. */\n    useTyped: (p: { text: string }) => string;\n    /** A match's detail. */\n    matchDetail: (p: { match: \"all\" | \"any\" }) => string;\n    /** All rows together's detail. */\n    oneRowOfTotals: () => string;\n    /** A number's place in the data. */\n    stat: (p: { stat: \"lowest\" | \"median\" | \"average\" | \"highest\" }) => string;\n    /** A day offered for on or after — `start of month · 4 orders`. */\n    startOfMonth: (p: { rows: string }) => string;\n    /** How many items — `items`. */\n    itemsWord: (p: { n: number }) => string;\n    /** A lookup table's size — `8 customers`. */\n    entries: (p: { count: string; noun: string }) => string;\n\n    // ── A summary in words ───────────────────────────────────────────────\n    /** How many different values — `8 values`. */\n    distinctValues: (p: { count: string; n: number }) => string;\n    /** How many cases occur — `3 cases`. */\n    casesUsed: (p: { count: string; n: number }) => string;\n    /** The least and greatest — `0.85 – 3,646.84`. */\n    span: (p: { from: string; to: string }) => string;\n    /** The shortest and longest list — `1–4 each`. */\n    lengths: (p: { from: string; to: string }) => string;\n    /** How many are missing — `12 missing`. */\n    missing: (p: { count: string; n: number }) => string;\n    /** Joins a summary's parts. */\n    summaryJoin: (p: { parts: readonly string[] }) => string;\n\n    // ── Problems (§4.6) ──────────────────────────────────────────────────\n    /** A step that takes rows, on one value. */\n    noRowsHere: (p: { shape: string; verb: string }) => string;\n    /** A slot not filled in — `Choose a field.` */\n    choose: (p: { what: string }) => string;\n    /** What an unfinished slot asks for, by the steps' word for it. */\n    what: (p: { what: string }) => string;\n    /** A field of the wrong kind. */\n    wrongKind: (p: { label: string; kind: string; what: string }) => string;\n    /** A field the rows do not have. */\n    unknownField: (p: { name: string; labels: string; more: boolean }) => string;\n    /** A payload field before the rows are narrowed. */\n    onlyCaseHas: (p: { rows: string; label: string }) => string;\n    /** A case the variant does not have. */\n    unknownCase: (p: { label: string; cases: string; value: string }) => string;\n    /** A variant compared whole. */\n    wholeVariant: (p: { label: string }) => string;\n    /** No comparison. */\n    chooseComparison: () => string;\n    /** No value. */\n    enterValue: () => string;\n    /** A comparison the field's kind does not take. */\n    comparisonNotForKind: (p: { cmp: string; kind: string }) => string;\n    /** Has at least, given no whole number. */\n    enterItems: () => string;\n    /** In year, given no year. */\n    enterYear: () => string;\n    /** In month, given no month. */\n    enterMonth: () => string;\n    /** On or after and before, given no date. */\n    enterDate: () => string;\n    /** A number field given text. */\n    notANumber: (p: { label: string; kind: string; value: string }) => string;\n    /** A whole number compared with a fraction. */\n    neverEqual: (p: { label: string; value: string }) => string;\n    /** An inner condition not finished. */\n    finishInner: () => string;\n    /** An empty group. */\n    emptyGroup: () => string;\n    /** A filter with no conditions. */\n    emptyFilter: () => string;\n    /** A Look up in a data source that is not a lookup table. */\n    notLookupTable: (p: { dataset: string }) => string;\n    /** A Look up by a key of another kind. */\n    keyKind: (p: { dataset: string; kind: string; label: string; keyKind: string }) => string;\n    /** A Look up of a field its records lack. */\n    noRecordField: (p: { noun: string; field: string }) => string;\n    /** Group and total with nothing to group by. */\n    chooseGroupBy: () => string;\n    /** Adding up what is not a number. */\n    cannotAddUp: (p: { label: string; kind: string }) => string;\n    /** The lowest or highest of what has no order. */\n    noLowestHighest: (p: { label: string }) => string;\n    /** Two fields of one name. */\n    duplicateName: (p: { name: string }) => string;\n    /** Keep the first, given no count. */\n    keepFirstCount: () => string;\n    /** Fill on a field never missing. */\n    neverMissing: (p: { label: string }) => string;\n    /** List every part with no tree. */\n    noTree: () => string;\n    /** Try the model with no calculation. */\n    noCalculation: () => string;\n    /** A range that gives nothing. */\n    emptyRange: () => string;\n    /** A range longer than a run returns. */\n    longRange: (p: { max: string }) => string;\n    /** A bracket closed that was never opened. */\n    strayBracket: () => string;\n    /** Text without its closing quote. */\n    unclosedText: () => string;\n    /** A bracket never closed. */\n    unclosedBracket: () => string;\n    /** A pipe at the end. */\n    trailingPipe: () => string;\n    /** Nothing written. */\n    emptyQuery: () => string;\n    /** A data source the root does not have. */\n    noDataSource: (p: { name: string }) => string;\n    /** A program that does not start from a data source. */\n    startFromSource: () => string;\n    /** A jq step's note. */\n    customJq: () => string;\n    /** A builtin queries leave out. */\n    excludedBuiltin: (p: { name: string }) => string;\n    /** A select over a list's items. */\n    rowsMoreThanOnce: () => string;\n\n    // ── Fixes ────────────────────────────────────────────────────────────\n    /** Keep only a case's rows first. */\n    fixNarrow: (p: { rows: string }) => string;\n    /** Use another field or value. */\n    fixUse: (p: { label: string }) => string;\n    /** Compare a variant's case. */\n    fixUnwhole: (p: { field: string }) => string;\n    /** Take the step out. */\n    fixRemoveStep: () => string;\n\n    // ── The generated description (§4.13) ───────────────────────────────\n    /** Try the model — `Demand over price from 10 to 12 in steps of 0.5, region NSW`. */\n    describeModel: (p: { result: string; input: string; from: string; to: string; step: string; fixed: readonly string[] }) => string;\n    /** A fixed input — `region NSW`. */\n    describeFixed: (p: { name: string; value: string }) => string;\n    /** Totals of all rows — `Total cost, parts and dearest across every part in the tree`. */\n    describeAllTotals: (p: { totals: string; source: string; where: string }) => string;\n    /** The top groups — `Top 3 regions by revenue from orders where …`. */\n    describeTopGroups: (p: { n: string; groups: string; sort: string; source: string; where: string }) => string;\n    /** Totals per group — `Revenue and orders per region from orders`. */\n    describeGroups: (p: { totals: string; group: string; source: string; where: string; sorted: string }) => string;\n    /** A count — `Count of orders where status is cancelled`. */\n    describeCount: (p: { source: string; where: string }) => string;\n    /** The first rows — `Top 10 orders by total where …, with name and region from customers`. */\n    describeFirst: (p: { top: boolean; n: string; source: string; sort: string; where: string; with: string }) => string;\n    /** Rows — `Orders where …, sorted by total, highest first`. */\n    describeRows: (p: { source: string; where: string; with: string; sorted: string }) => string;\n    /** The filters — ` where status is shipped and total is at least 100`. */\n    describeWhere: (p: { conditions: readonly string[] }) => string;\n    /** A filter's conditions joined — `status is shipped or total is at least 1,500`. */\n    describeConditions: (p: { match: \"all\" | \"any\"; conditions: readonly string[] }) => string;\n    /** A group of conditions in a sentence. */\n    describeGroup: (p: { match: \"all\" | \"any\"; conditions: readonly string[] }) => string;\n    /** A condition — `total is at least 100`. */\n    describeCondition: (p: { field: string; cmp: ComparisonKind; value: string }) => string;\n    /** Look ups — `, with name and region from customers`. */\n    describeWith: (p: { lookups: readonly { fields: string; dataset: string }[] }) => string;\n    /** A sort — `, sorted by total, highest first`. */\n    describeSorted: (p: { field: string; desc: boolean }) => string;\n    /** A sort for the top rows — ` by total`. */\n    describeBy: (p: { field: string }) => string;\n    /** The rows a list opens — `order lines`. */\n    describeDrilled: (p: { noun: string; list: string }) => string;\n    /** The parts of a tree — `every bom in the tree`. */\n    describeWalked: (p: { noun: string }) => string;\n    /** Cut at a word. */\n    ellipsis: () => string;\n\n    // ── A step in words, for an outline ──────────────────────────────────\n    /** Look up — `name and region from customers by customer ID`. */\n    outlineLookup: (p: { fields: string; dataset: string; key: string }) => string;\n    /** Group and total — `revenue and orders per region`, `total cost and parts of all rows`. */\n    outlineGroup: (p: { totals: string; group?: string }) => string;\n    /** Sort — `by total, highest first`. */\n    outlineSort: (p: { field: string; direction: string }) => string;\n    /** Keep the first — `10 orders`, after its title. */\n    outlineLimit: (p: { rows: string }) => string;\n    /** Fill in missing values — `0 where discount is missing`. */\n    outlineFill: (p: { field: string; value: string }) => string;\n    /** Take part of a date — `the month of shipped date as ship month`. */\n    outlineDatePart: (p: { part: string; field: string; name: string }) => string;\n    /** Try the model — `price from 10 to 12 every 0.5, region NSW`. */\n    outlineModel: (p: { input: string; from: string; to: string; step: string; fixed: readonly string[] }) => string;\n\n    // ── The toolbar, the Query tab and the status line (#936) ────────────\n    /** The Visual · jq switch's name. */\n    viewLabel: () => string;\n    /** A view of the query. */\n    view: (p: { view: \"visual\" | \"jq\" }) => string;\n    /** Copy jq. */\n    copyJq: () => string;\n    /** Copy jq, just after it copied. */\n    copied: () => string;\n    /** The toolbar's Save…, which opens the save popover. */\n    saveAs: () => string;\n    /** Run. */\n    run: () => string;\n    /** Run, while a run goes. */\n    running: () => string;\n    /** Run's keys, in its `Kbd`. */\n    runKeys: () => string;\n    /** Run's tooltip. */\n    runTip: () => string;\n    /** The ⋯ chip a row short of room folds Copy jq and Save… into (#1229) — its accessible name. */\n    more: () => string;\n    /** The steps' list, for a screen reader. */\n    stepsLabel: () => string;\n    /** A step's place, before its title — `1`. */\n    stepNumber: (p: { n: string }) => string;\n    /** Move a step up. */\n    moveUp: () => string;\n    /** Move a step down. */\n    moveDown: () => string;\n    /** Take a step out. */\n    removeStep: () => string;\n    /** A shape line's Insert, in full. */\n    insertHere: () => string;\n    /** The check, clean. */\n    checksClean: () => string;\n    /** Steps left to finish — `2 to finish`. */\n    toFinish: (p: { count: string; n: number }) => string;\n    /** Problems that stop the query running — `1 problem`. */\n    problemCount: (p: { count: string; n: number }) => string;\n    /** Warnings, in the jq view — `2 warnings`. */\n    warningCount: (p: { count: string; n: number }) => string;\n    /** The shape's East type and multiplicity, on hover — `Array<Struct{…}> · one`. */\n    typeHover: (p: { type: string; multiplicity: string }) => string;\n    /** The fields of the rows the query gives, after its shape — `· order, customer, total`. */\n    givesFields: (p: { fields: readonly string[] }) => string;\n    /** The source's line under its title — `dev.orders · list of orders`. */\n    sourceLine: (p: { path: string; kind: string }) => string;\n    /** What an input of a step card edits, for a screen reader. */\n    inputLabel: (p: { input: InputKind }) => string;\n    /** The save state: saved just now, drafts not yet saved, or never saved. */\n    saveState: (p: { state: \"saved\" | \"unsaved\" | \"new\" }) => string;\n    /** The jq view's note: unfinished steps left out of the jq. */\n    unfinishedLeftOut: (p: { count: string; n: number }) => string;\n    /** The jq kept, because it does not parse. */\n    fixSyntaxFirst: () => string;\n    /** The notice after leaving the jq: parts of it that stay jq steps. */\n    jqPartsStay: (p: { count: string; n: number }) => string;\n    /** The jq view's text, for a screen reader. */\n    jqLabel: () => string;\n    /** A gesture's label in the history: a slot set — `Set status`. */\n    setGesture: (p: { what: string }) => string;\n    /** A step added — `Add Sort`. */\n    addStepGesture: (p: { step: string }) => string;\n    /** A step taken out — `Remove step 3`. */\n    removeStepGesture: (p: { n: string }) => string;\n    /** A step moved — `Move step 2 up`. */\n    moveStepGesture: (p: { n: string; up: boolean }) => string;\n    /** The jq edited and left. */\n    editJqGesture: () => string;\n    /** The query named, and described, as it saves. */\n    nameGesture: () => string;\n\n    // ── The builder (#935) ───────────────────────────────────────────────\n    /** The pane's name — its rail's label. */\n    pane: () => string;\n    /** A tab of the pane. */\n    tab: (p: { tab: \"query\" | \"datasets\" | \"library\" }) => string;\n    /** A new query's name — `Untitled orders query`. */\n    untitled: (p: { source: string }) => string;\n    /** The saved queries could not be read. */\n    savedUnreadable: (p: { message: string }) => string;\n    /** The open saved query is not in the record — its heading. */\n    queryGone: (p: { name: string }) => string;\n    /** Under it. */\n    queryGoneHint: () => string;\n    /** A paged data source read through one of a record's indexes. */\n    sourceThroughIndex: (p: { name: string; index: string }) => string;\n    /** A paged data source no handle on the page serves. */\n    sourceUnbound: (p: { name: string }) => string;\n    /** A saved query reads a data source not bound here — `Reads customers, which isn't here`. */\n    rootMissing: (p: { name: string }) => string;\n    /** One bound here at another path — `Reads .inputs.archive.orders, not this builder's orders`. */\n    rootElsewhere: (p: { path: string; name: string }) => string;\n    /** A save under a name another write took first. */\n    nameTaken: (p: { name: string }) => string;\n    /** A save of a query another write changed since the edit began, and who changed the record last, when known. */\n    savedChanged: (p: { name: string; by: string | undefined }) => string;\n\n    // ── Saving (#936) ────────────────────────────────────────────────────\n    /** The save popover's head, before the open query's name — `Save query`. */\n    saveQuery: () => string;\n    /** Its name field's placeholder, and its accessible name. */\n    queryName: () => string;\n    /** Under the name, while it is empty. */\n    queryNameMissing: () => string;\n    /** Under the name, while another saved query holds it — `Order count is taken`. */\n    queryNameHeld: (p: { name: string }) => string;\n    /** Its description field's placeholder, and its accessible name. */\n    descriptionPlaceholder: () => string;\n    /** Under the description, while it is the sentence generated from the steps. */\n    descriptionGenerated: () => string;\n    /** Under the description once it is edited: its length and the most it holds — `52/140 · shown under the name in the library`. */\n    descriptionCount: (p: { count: string; max: string; n: number }) => string;\n    /** Returns the description to the sentence generated from the steps. */\n    restoreGenerated: () => string;\n    /** The save popover's commit. */\n    saveConfirm: () => string;\n    /** The save popover's cancel. */\n    cancel: () => string;\n\n    // ── The jq view (#937) ───────────────────────────────────────────────\n    /** The problems panel's check — `2 problems · 1 warning`, `1 warning`, `Checks clean`; notes are not counted. */\n    jqCheck: (p: { problems: string; n: number; warnings: string; w: number }) => string;\n    /** The problems panel's hint, after the check. */\n    jqHint: () => string;\n    /** The problems' list, for a screen reader. */\n    jqProblemsLabel: () => string;\n    /** A problem's code as the panel shows it: the checker's, its underscores as spaces; a note's, `note`. */\n    jqProblemCode: (p: { code: string; note: boolean }) => string;\n    /** Where a problem starts — `L3:9`. */\n    jqProblemAt: (p: { line: string; column: string }) => string;\n    /** The completions' list, for a screen reader. */\n    jqCompletionsLabel: () => string;\n    /** The footer's line for a completion with no doc — `total · Float`. */\n    jqCompletionLine: (p: { label: string; detail: string }) => string;\n    /** The completions' keys, in the footer. */\n    jqCompletionKeys: () => string;\n\n    // ── Runs and results (#938) ──────────────────────────────────────────\n    /** The results' band, for a screen reader. */\n    resultControls: () => string;\n    /** The Table · Tree switch's name. */\n    resultViewLabel: () => string;\n    /** A view of the result. */\n    resultView: (p: { view: \"table\" | \"tree\" }) => string;\n    /** The view a run picked, on hover — `Table · picked for many rows`. */\n    resultViewPicked: (p: { view: \"table\" | \"tree\" }) => string;\n    /** Download ▾. */\n    download: () => string;\n    /** A download's format. */\n    downloadFormat: (p: { format: \"csv\" | \"beast2\" }) => string;\n    /** Beside a format in the menu — `table`, `typed`. */\n    downloadFormatMeta: (p: { format: \"csv\" | \"beast2\" }) => string;\n    /** The note after a download — `Downloaded top-shipped-orders-2026.csv — 10 orders, one row per output.` */\n    downloaded: (p: { format: \"csv\" | \"beast2\"; file: string; count: string }) => string;\n    /** The stale strip's tag, before its words. */\n    staleTag: () => string;\n    /** The stale strip. */\n    staleResult: () => string;\n    /** Its run again. */\n    runAgain: () => string;\n    /** A run the checker refused. */\n    notRunProblems: () => string;\n    /** A run that raised an error, or that the server refused. */\n    notRun: () => string;\n    /** A run cut off by its time limit — `Stopped after 30 s`. */\n    stoppedAfter: (p: { seconds: string }) => string;\n    /** Under it. */\n    stoppedHint: () => string;\n    /** A result over the call's size limit. */\n    tooLarge: () => string;\n    /** Under it — `1.4 MB is over the 1 MB limit. Total or narrow the query.` */\n    tooLargeHint: (p: { bytes: string; limit: string }) => string;\n    /** A query that needs a platform function the server lacks. */\n    needsPlatform: () => string;\n    /** Under it — `It needs sales_lookup.` */\n    needsPlatformHint: (p: { functions: string }) => string;\n    /** A call that never reached the server. */\n    unreachable: () => string;\n    /** The results before any run. */\n    idleTitle: () => string;\n    /** Its first line. */\n    idleChecks: () => string;\n    /** Its second. */\n    idleRun: () => string;\n    /** The same on a phone: no key to name (QP15). */\n    idleRunPhone: () => string;\n    clearTheSearch: () => string;\n    /** While a run reads — `Reading orders, customers`. */\n    reading: (p: { sources: string }) => string;\n    /** The footer while a run goes. */\n    runningWord: () => string;\n    /** The footer after a run that gave no result. */\n    noResult: () => string;\n    /** The footer before any run. */\n    noResultYet: () => string;\n    /** Rows a run cut, of the rows the query gives — `Showing 1–1,000 of 4,210`. */\n    showing: (p: { shown: string; total: string }) => string;\n    /** Rows a run cut at the call's most, the total unknown — `1,000+`. */\n    atLeast: (p: { count: string }) => string;\n    /** A run's own line — `run #3 · 14:02:07 · 412 ms`. */\n    runLine: (p: { n: string; time: string; ms: string }) => string;\n    /** What a run read — `reads orders #4f2a1c8d · customers #9b07e3a4`. */\n    readsLine: (p: { sources: readonly { name: string; hash: string }[] }) => string;\n    /** Rows, when the query's rows have no name — `10 rows`. */\n    rowCount: (p: { count: string; n: number }) => string;\n    /** One value, when its shape has no words. */\n    oneValue: () => string;\n    /** A size — `1.4 MB`. */\n    byteSize: (p: { value: string; unit: \"B\" | \"KB\" | \"MB\" | \"GB\" }) => string;\n    /** A duration — `420 ms`, `2.9 s`, `2.5 min` (#1143). */\n    duration: (p: { value: string; unit: \"ms\" | \"s\" | \"min\" }) => string;\n\n    // ── Plans (#941) ─────────────────────────────────────────────────────\n    /**\n     * The plan's read-out in the results' footer — `One call`, `Split call ·\n     * 12 pieces`, `Split call · 3 of 12 pieces done`, `Re-keyed join · 12\n     * pieces` (#942), `Split call · 12 pieces · 11 units cached` (#1105).\n     */\n    planBadge: (p: { kind: \"one_shot\" | \"split\" | \"rekey\"; detail: string }) => string;\n    /** The plan's popover's title, and the read-out's name for a screen reader. */\n    planTitle: () => string;\n    /** A phone's count line and its view (`Query Builder Phone Spec.md` QP3, QP34). */\n    notRunYet: () => string;\n    thisResult: () => string;\n    thisResultQuery: () => string;\n    thisResultGives: () => string;\n    thisResultRun: () => string;\n    thisResultReads: () => string;\n    thisResultPlan: () => string;\n    /** The Query view's head (QP21), and a step's ⋯ (QP27). */\n    queryEyebrow: (p: { state: string; n: number; count: string }) => string;\n    stepActions: () => string;\n    backToStep: () => string;\n    removeCondition: () => string;\n    checkerFound: (p: { n: number; count: string; text: string }) => string;\n    clearSearchEvery: () => string;\n    rowsFromRun: (p: { n: string; time: string }) => string;\n    showProblem: () => string;\n    thisResultDownload: () => string;\n    savedAs: (p: { slug: string }) => string;\n    readingShort: () => string;\n    noStepsYet: () => string;\n    noStepsAdd: () => string;\n    noStepsSaved: () => string;\n    openLibrary: () => string;\n    tapDataset: () => string;\n    tapQuery: () => string;\n    nameLabel: () => string;\n    nameHelp: () => string;\n    descriptionLabel: () => string;\n    changesCount: (p: { n: number; count: string }) => string;\n    filterSlot: (p: { what: string }) => string;\n    quickAddGroup: () => string;\n    moreStepsGroup: () => string;\n    atEnd: () => string;\n    beforeStep: (p: { n: string }) => string;\n    stepContext: (p: { n: string }) => string;\n    conditionContext: (p: { n: string; c: string }) => string;\n    stepFitNote: () => string;\n    /** A phone's band of one notice (QP16). */\n    dismissNotice: () => string;\n    savedNotice: (p: { name: string; time: string }) => string;\n    /**\n     * A split call, and why — `Split call over orders: it weighs 1.4 GB, more\n     * than one piece (16 MB).`; with a dataset cut at the same keys that weighs\n     * more, `heaviest` names it (#942).\n     */\n    planSplit: (p: { over: string; heaviest: string; bytes: string; piece: string }) => string;\n    /** The datasets cut at the same keys as the one the pieces work through (#942) — `Prices is cut at the same keys as stock: each piece reads only its own keys of it.` */\n    planCopartitioned: (p: { over: string; names: string; n: number }) => string;\n    /** A re-keyed join, and why (#942) — `Re-key: both sides large and unaligned — customers weighs more than one piece too.` */\n    planRekey: (p: { name: string }) => string;\n    /** Its re-key stage, before the join key's jq — `First, orders is re-keyed by this, about 1.4 GB, and each piece then reads customers cut at the same keys:`. */\n    planRekeyStage: (p: { over: string; name: string; bytes: string }) => string;\n    /** The first rows of a sort, kept in each piece then together (#942), before the key's jq — `The first 10 rows of the sort are kept, each piece's and then theirs together, by:`. */\n    planTop: (p: { count: string; n: number }) => string;\n    /** A stream's first rows, in input order (#1113), before the `first` or `limit` that keeps them — `The first 3 rows, in input order, are kept: each piece stops once it has 3, and the call once the pieces before the rest have them:`. */\n    planFirst: (p: { count: string; n: number }) => string;\n    /** One call: it would split over a dataset within one piece — `One call: orders weighs 4 KB, within one piece (16 MB).` */\n    planSmall: (p: { over: string; bytes: string; piece: string }) => string;\n    /** One call: it would split over a dataset whose weight is not known. */\n    planUnweighed: (p: { over: string }) => string;\n    /**\n     * A split call chosen by its estimates (#1143) — `Split call over orders:\n     * estimated faster than one call.`; `Split call over orders: one call\n     * would hold more memory than it may use.`; or one a run went on as when\n     * its one call's answer was too large for one (#1113).\n     */\n    planSplitBy: (p: { over: string; why: \"time\" | \"memory\" | \"size\" }) => string;\n    /** One call: it would split over a dataset larger than one piece, and one call is estimated no slower (#1143). */\n    planFaster: (p: { over: string }) => string;\n    /**\n     * One call's estimate (#1143) — `As one call: about 17 s, holding about\n     * 20 MB.`; with the memory one call may use, whether it is more or within.\n     */\n    planEstimateOneCall: (p: { seconds: string; peak: string; memory: string | undefined; over: boolean }) => string;\n    /**\n     * A split call's estimate (#1143) — `As a split call: about 2.9 s, 63\n     * pieces, 14 at a time, each holding about 14 MB.`; a re-keyed join's,\n     * two calls of as many pieces.\n     */\n    planEstimateSplit: (p: { rekey: boolean; seconds: string; pieces: string; n: number; cores: string; peak: string }) => string;\n    /**\n     * What the estimates assumed (#1143) — `Assumed: 29,000,000 rows of\n     * orders, each about 1 µs in one call and 1.4 µs in a piece.`; for a\n     * stream's first rows, the rows both paths read before they stop\n     * (`first`, #1113); and, when one call holds every row, what it holds of\n     * each.\n     */\n    planAssumed: (p: {\n        rows: string; n: number; over: string; first: { count: string; n: number } | undefined; oneCall: string; piece: string; held: string | undefined;\n    }) => string;\n    /** One call: it would split, and the split call could not be made — the planner's message. */\n    planUnsplit: (p: { message: string }) => string;\n    /**\n     * One call, for the reason the query runs as one unit; `name` the\n     * builtin or the data source the reason names; `at` whether the jq it is\n     * about follows.\n     */\n    planWhole: (p: { code: PlanWholeCode; name: string | undefined; at: boolean }) => string;\n    /** What each piece runs, before its jq — `Each piece of orders runs:`. */\n    planPiece: (p: { over: string }) => string;\n    /** How the pieces' outputs combine, by kind — a key's, a total's or the step's jq following where it ends with a colon. */\n    planCombine: (p: { kind: PlanCombineKind }) => string;\n    /** A total's rule, before its jq — `Added up:`. */\n    planTotal: (p: { rule: PlanTotalRule }) => string;\n    /** What runs once after the combine, before its jq. */\n    planThen: () => string;\n    /** The data sources every piece reads whole — `Every piece reads customers whole.` */\n    planBroadcast: (p: { names: string }) => string;\n    /** The pieces and what they weigh, once known — `orders is cut into 12 pieces, about 120 MB each.` */\n    planPieces: (p: { over: string; count: string; n: number; size: string }) => string;\n    /** How many pieces, for the read-out — `12 pieces`. */\n    planPieceCount: (p: { count: string; n: number }) => string;\n    /** How many of a split call's units the cache served, for the read-out (#1105) — `11 units cached`; `all cached` for a call it served whole. */\n    planCachedCount: (p: { count: string; n: number; whole: boolean }) => string;\n    /**\n     * How a split call's units ran, once it answered (#1105) — `The cache\n     * served 11 of its 14 units, and 3 ran.`; `The cache served the whole\n     * call: no unit ran.`; `All 14 of its units ran: the cache held none.`\n     */\n    planUnits: (p: { kind: \"whole\" | \"some\" | \"none\"; cached: string; ran: string; units: string; n: number }) => string;\n    /** How far a split run has got — `3 of 12 pieces done`, `1 of 3 merges done`. */\n    planProgress: (p: { phase: \"partition\" | \"merge\" | \"combine\"; done: string; units: string; n: number }) => string;\n    /** A read that skips what it doesn't need, before its jq — `Reads the count from orders's index, and no segment:`. */\n    planPruning: (p: { kind: \"count\" | \"seek\" | \"stop\"; name: string }) => string;\n\n    // ── Results: the Table (#938) ────────────────────────────────────────\n    /** The header of a result's one column, when the result is not records. */\n    resultValue: () => string;\n    /** A missing value in a result's cell. */\n    resultMissing: () => string;\n    /** A list in a result's cell, by its size — `3 lines`, `1 line`; the noun already in the count's number. */\n    resultList: (p: { count: string; noun: string }) => string;\n    /** A lookup table in a result's cell, by its size — `1 entry`, `8 entries`. */\n    resultEntries: (p: { count: string; n: number }) => string;\n    /** A grid of numbers in a result's cell, by its shape — `3 × 4`. */\n    resultGrid: (p: { rows: string; cols: string }) => string;\n    /** The parts of a record or a case in a result's cell, joined — `shipped · Jun 1, 2026, 14:00`. */\n    resultJoin: (p: { parts: readonly string[] }) => string;\n    /** A calculation in a result's cell. */\n    resultFunction: () => string;\n\n    // ── The Datasets and Library tabs (#939) ─────────────────────────────\n    /** A group of the Datasets tab, by its data sources' kind. */\n    datasetGroup: (p: { kind: \"rows\" | \"lookups\" | \"values\" | \"models\" }) => string;\n    /** What the Datasets tab lists, for its search — `data source`, `data sources`. */\n    dataSourceNoun: (p: { n: number }) => string;\n    /** A data source of rows, counted — `40 orders`; the noun already in the count's number. */\n    sourceRows: (p: { count: string; noun: string }) => string;\n    /** A lookup table, counted — `8 customers by ID`; the noun already in the count's number. */\n    sourceLookup: (p: { count: string; noun: string }) => string;\n    /** A tree, uncounted. */\n    sourceTree: () => string;\n    /** A record. */\n    sourceRecord: () => string;\n    /** A calculation, by its inputs and what it gives — `price, region → number`. */\n    sourceModel: (p: { inputs: string; output: string }) => string;\n    /** A data source's size, then its hash when it is known — `40 orders · #4f2a1c8d`. */\n    sourceMeta: (p: { size: string; hash: string | undefined }) => string;\n    /** What the open query reads a data source as — Source, Looked up. */\n    sourceRole: (p: { role: \"source\" | \"lookedUp\" }) => string;\n    /** What the Library tab lists, for its search — `query`, `queries`. */\n    savedNoun: (p: { n: number }) => string;\n    /** The Library tab's group of this viewer's recent runs. */\n    recentGroup: () => string;\n    /** The notice after a query is started on a data source — `Started a new query on customers.` */\n    startedOn: (p: { name: string }) => string;\n    /** The notice after a query is opened from the Library tab — `Opened “Big orders” from the library.` */\n    openedFromLibrary: (p: { name: string }) => string;\n    /** The notice after a query library's card is dropped on the builder — `Opened “Big orders” from the query library.` */\n    openedFromQueryLibrary: (p: { name: string }) => string;\n\n    // ── Dropping (#939) ──────────────────────────────────────────────────\n    /** Over the builder while a query library's card rests on it — `Drop to open “Revenue by region”`. */\n    dropToOpen: (p: { name: string }) => string;\n    /** Under it: how many steps that query has — `5 steps.` */\n    dropSteps: (p: { count: string; n: number }) => string;\n    /** The builder, as the drag layer names it in what it says — `Revenue by region is over the query builder.` */\n    dropTargetName: () => string;\n    /** The builder refusing a card, as the drag layer names it, with why — `the query builder (Reads customers, which isn't here) does not take Big orders.` */\n    dropRefusedName: (p: { reason: string }) => string;\n\n    // ── The query library (#1063) ────────────────────────────────────────\n    /** Its search's placeholder — `Search 7 queries…`. */\n    librarySearch: (p: { count: string; n: number }) => string;\n    /** Its search's accessible name. */\n    librarySearchLabel: () => string;\n    /** Clears the search. */\n    clearSearch: () => string;\n    /** Sort, by the order it shows — `Sort · Recent`. */\n    librarySort: (p: { sort: \"recent\" | \"name\" }) => string;\n    /** An order in Sort's menu. */\n    librarySortOption: (p: { sort: \"recent\" | \"name\" }) => string;\n    /** The primary action — `New query on orders`. */\n    newQueryOn: (p: { source: string }) => string;\n    /** It, folded. */\n    newQuery: () => string;\n    /** The pane's caption. */\n    dataSources: () => string;\n    /** The pane's first row: every saved query. */\n    allQueries: () => string;\n    /** A card's action. */\n    openInBuilder: () => string;\n    /**\n     * A card's byline — `orders · 5 steps · up to 10 shipped orders · saved\n     * Tue`: what it starts from, its steps (none for a program that is not\n     * steps), what it gives or its problems, and when it was saved — or, for a\n     * recent run, ran.\n     */\n    libraryByline: (p: { source: string; steps: { count: string; n: number } | undefined; gives: string; when: string; run: boolean }) => string;\n    /** A wireframe's last line, for the steps it leaves out — `+2 more`. */\n    moreSteps: (p: { count: string; n: number }) => string;\n    /** A wireframe's line for a program that is not steps. */\n    jqProgram: () => string;\n    /** The gallery when nothing matches the search — `No queries match “sku”`. */\n    noMatch: (p: { text: string }) => string;\n    /** Under it. */\n    checkSpelling: () => string;\n    /** Under it, while the pane shows a data source or Recent. */\n    clearFilter: () => string;\n    /** Under it, while the pane shows every query. */\n    searchWhat: () => string;\n    /** No saved queries — on the data source shown, or at all. */\n    noQueries: () => string;\n    /** Under it. */\n    saveInBuilder: () => string;\n    /** No recent runs. */\n    noRecent: () => string;\n    /** Under it. */\n    runInBuilder: () => string;\n}\n\nconst STEP_TITLE: Readonly<Record<Exclude<StepKind, \"drill\">, string>> = {\n    filter: \"Keep rows where\",\n    lookup: \"Look up from another dataset\",\n    group: \"Group and total\",\n    sort: \"Sort\",\n    limit: \"Keep the first\",\n    count: \"Count the rows\",\n    pick: \"Show only these fields\",\n    fill: \"Fill in missing values\",\n    datepart: \"Take part of a date\",\n    walk: \"List every part in the tree\",\n    tabulate: \"Try the model over a range\",\n    jq: \"jq step\",\n};\n\nconst STEP_VERB: Readonly<Record<StepKind, string>> = {\n    filter: \"filter\", lookup: \"look up\", group: \"group\", sort: \"sort\", limit: \"keep\", count: \"count\", pick: \"choose fields from\",\n    fill: \"fill in\", drill: \"open\", datepart: \"read dates from\", walk: \"walk\", tabulate: \"call\", jq: \"run\",\n};\n\nconst ADD_STEP_HINT: Readonly<Record<StepKind, string>> = {\n    filter: \"Keep only the rows that match\",\n    lookup: \"Bring in fields from a lookup table by key\",\n    group: \"One row per group, with totals\",\n    sort: \"Order the rows\",\n    limit: \"The first rows only\",\n    count: \"Gives one number\",\n    pick: \"Pick and rename fields\",\n    fill: \"Use a default where a value is missing\",\n    drill: \"One row per item in a list\",\n    datepart: \"Year, month or weekday\",\n    walk: \"Walk every nested level\",\n    tabulate: \"One row per input value\",\n    jq: \"Write the step in jq\",\n};\n\nconst ADD_STEP_KEYWORDS: Readonly<Record<StepKind, string>> = {\n    filter: \"filter where select only matching remove exclude\",\n    lookup: \"join lookup bring match\",\n    group: \"group sum total add up count average mean aggregate pivot per by\",\n    sort: \"sort order rank highest lowest top\",\n    limit: \"first top limit head n\",\n    count: \"count how many number length total rows\",\n    pick: \"pick select columns fields rename show only hide choose\",\n    fill: \"missing default null empty fill blank\",\n    drill: \"flatten expand lines unnest open list each items\",\n    datepart: \"date year month week day part time\",\n    walk: \"recurse tree walk nested children parts flatten all\",\n    tabulate: \"call model function range what if tabulate\",\n    jq: \"jq code custom\",\n};\n\nconst COMPARISON: Readonly<Record<ComparisonKind, string>> = {\n    eq: \"is\", ne: \"is not\", ge: \"is at least\", le: \"is at most\", gt: \"is more than\", lt: \"is less than\",\n    contains: \"contains\", startsWith: \"starts with\", missing: \"is missing\", present: \"has a value\", yes: \"is yes\", no: \"is no\",\n    inYear: \"is in year\", inMonth: \"is in month\", onOrAfter: \"is on or after\", before: \"is before\",\n    lengthAtLeast: \"has at least\", anyWhere: \"has any where\",\n};\n\nconst SLOT_LABEL: Readonly<Record<SlotKind, string>> = {\n    \"match\": \"Match\", \"group-match\": \"Match\",\n    \"field\": \"Field\", \"cmp\": \"Compare\", \"value\": \"Value\",\n    \"key\": \"Find by\", \"dataset\": \"Dataset\", \"lookup-add\": \"Bring in\",\n    \"by\": \"Group by\", \"agg-fn\": \"Total\", \"agg-field\": \"Of\",\n    \"sort-field\": \"Sort by\", \"dir\": \"Order\",\n    \"pick-field\": \"Field\", \"pick-add\": \"Add field\",\n    \"fill-field\": \"Field\", \"drill-field\": \"List\", \"via\": \"List\",\n    \"part\": \"Part\", \"date-field\": \"Date\",\n    \"fixed\": \"Value\",\n    \"add-step\": \"Add a step\",\n};\n\nconst PLACEHOLDER: Readonly<Record<SlotKind, string>> = {\n    \"match\": \"choose\", \"group-match\": \"choose\",\n    \"field\": \"field\", \"cmp\": \"compare\", \"value\": \"value\",\n    \"key\": \"field\", \"dataset\": \"dataset\", \"lookup-add\": \"field\",\n    \"by\": \"field\", \"agg-fn\": \"total\", \"agg-field\": \"field\",\n    \"sort-field\": \"field\", \"dir\": \"order\",\n    \"pick-field\": \"field\", \"pick-add\": \"field\",\n    \"fill-field\": \"field\", \"drill-field\": \"list\", \"via\": \"list\",\n    \"part\": \"part\", \"date-field\": \"date\",\n    \"fixed\": \"value\",\n    \"add-step\": \"step\",\n};\n\nconst INPUT_LABEL: Readonly<Record<InputKind, string>> = {\n    \"limit-n\": \"How many\", \"agg-as\": \"Total's name\", \"pick-as\": \"Field's name\", \"fill-value\": \"Value to use\", \"datepart-as\": \"Part's name\",\n    \"tab-from\": \"From\", \"tab-to\": \"To\", \"tab-step\": \"Every\", \"tab-as\": \"Result's name\",\n};\n\n/** How the pieces' outputs combine, in words; one that ends with a colon has its jq after it. */\nconst PLAN_COMBINE: Readonly<Record<PlanCombineKind, string>> = {\n    concat: \"Their rows are joined in order.\",\n    totals: \"Their totals combine, each by its rule:\",\n    group: \"Their rows are grouped by:\",\n    groupTotals: \"Each group's totals combine, each by its rule:\",\n    groupRows: \"Each group's rows are collected.\",\n    distinct: \"Their distinct rows are kept:\",\n    distinctBy: \"The first row of each key is kept, by:\",\n    reduceAdd: \"Their updates combine by key, added:\",\n    reduceReplace: \"Their updates combine by key, the last kept:\",\n};\n\n/** How a total's parts combine, before its jq. */\nconst PLAN_TOTAL: Readonly<Record<PlanTotalRule, string>> = {\n    count: \"Counted:\",\n    add: \"Added up:\",\n    min: \"The lowest kept:\",\n    max: \"The highest kept:\",\n    first: \"The first kept:\",\n    last: \"The last kept:\",\n    any: \"True if any is:\",\n    all: \"True if all are:\",\n    union: \"The distinct values kept:\",\n};\n\n/** A split run's units, by its stage: one, and more. */\nconst PLAN_UNITS: Readonly<Record<\"partition\" | \"merge\" | \"combine\", readonly [string, string]>> = {\n    partition: [\"piece\", \"pieces\"],\n    merge: [\"merge\", \"merges\"],\n    combine: [\"fold\", \"folds\"],\n};\n\n/** Whether a slot takes a value, typed or offered. */\nconst takesValue = (slot: SlotKind): boolean => slot === \"value\" || slot === \"fixed\";\n/** Whether a slot offers fields of the checked type. */\nconst takesField = (slot: SlotKind): boolean =>\n    slot === \"field\" || slot === \"key\" || slot === \"by\" || slot === \"agg-field\" || slot === \"sort-field\" || slot === \"pick-field\"\n    || slot === \"pick-add\" || slot === \"fill-field\" || slot === \"drill-field\" || slot === \"via\" || slot === \"date-field\" || slot === \"lookup-add\";\n\n/** `a`, `a and b`, `a, b and c`. */\nfunction englishList(items: readonly string[]): string {\n    if (items.length < 2) return items[0] ?? \"\";\n    return `${items.slice(0, -1).join(\", \")} and ${items[items.length - 1]}`;\n}\n\n/** A sentence's first letter in capitals. */\nfunction capital(text: string): string {\n    return text.length === 0 ? text : text.charAt(0).toUpperCase() + text.slice(1);\n}\n\n/** The query builder's English messages — the default table. */\nexport const queryMessages: QueryMessages = {\n    stepTitle: ({ kind, noun }) => (kind === \"drill\" ? `Open each ${noun}'s list` : STEP_TITLE[kind]),\n    stepVerb: ({ kind }) => STEP_VERB[kind],\n    addStepLabel: ({ kind, noun }) => {\n        switch (kind) {\n            case \"filter\": return \"Keep rows where…\";\n            case \"lookup\": return \"Look up from another dataset…\";\n            case \"group\": return \"Group and total…\";\n            case \"sort\": return \"Sort by…\";\n            case \"limit\": return \"Keep the first…\";\n            case \"count\": return \"Count the rows\";\n            case \"pick\": return \"Show only some fields…\";\n            case \"fill\": return \"Fill in missing values…\";\n            case \"drill\": return `Open each ${noun}'s list…`;\n            case \"datepart\": return \"Take part of a date…\";\n            case \"walk\": return \"List every part in the tree\";\n            case \"tabulate\": return \"Try the model over a range…\";\n            case \"jq\": return \"jq step\";\n        }\n    },\n    addStepHint: ({ kind }) => ADD_STEP_HINT[kind],\n    addStepKeywords: ({ kind }) => ADD_STEP_KEYWORDS[kind],\n    quickAddLabel: ({ kind }) => {\n        switch (kind) {\n            case \"filter\": return \"Keep rows\";\n            case \"group\": return \"Group and total\";\n            case \"sort\": return \"Sort by\";\n            case \"limit\": return \"Keep the first\";\n            case \"pick\": return \"Show only fields\";\n            case \"walk\": return \"List every part in the tree\";\n            case \"tabulate\": return \"Try the model over a range\";\n            default: return STEP_VERB[kind];\n        }\n    },\n    needsTree: () => \"Needs a tree of parts\",\n    needsCalculation: () => \"Needs a calculation\",\n    nothingToUse: () => \"Nothing to use it on here\",\n    needsRows: ({ shape }) => `Needs rows — the query gives ${shape} here`,\n    notFinished: () => \"Not in the query until it's finished.\",\n    noSteps: () => \"Add a step to narrow, reshape or total the rows, or start from a saved query.\",\n    addStepAtEnd: () => \"Add a step at the end\",\n    quickAdd: () => \"Quick add\",\n    insert: () => \"Insert\",\n    startWith: ({ source }) => `Start with ${source}`,\n\n    comparison: ({ cmp }) => COMPARISON[cmp],\n    comparisonDetail: ({ cmp }) => (cmp === \"anyWhere\" ? \"check the items in the list\" : \"\"),\n\n    kind: ({ kind, items, cases }) => {\n        switch (kind) {\n            case \"text\": return \"text\";\n            case \"wholeNumber\": return \"whole number\";\n            case \"number\": return \"number\";\n            case \"date\": return \"date\";\n            case \"yesNo\": return \"yes or no\";\n            case \"nothing\": return \"nothing\";\n            case \"bytes\": return \"bytes\";\n            case \"oneOf\": return cases === undefined ? \"one of\" : `one of ${cases}`;\n            case \"list\": return items === undefined ? \"list\" : `list of ${items}`;\n            case \"lookupTable\": return \"lookup table\";\n            case \"calculation\": return \"calculation\";\n            case \"record\": return \"record\";\n            case \"tree\": return items === undefined ? \"tree\" : `tree of ${items}`;\n            case \"value\": return \"value\";\n        }\n    },\n    sometimesMissing: ({ kind }) => `${kind}, sometimes missing`,\n    shapeMany: ({ rows }) => `Many ${rows}`,\n    shapeUpTo: ({ count, rows }) => `Up to ${count} ${rows}`,\n    shapeOne: ({ kind, noun }) => {\n        switch (kind) {\n            case \"wholeNumber\": return \"One whole number\";\n            case \"number\": return \"One number\";\n            case \"text\": return \"One text value\";\n            case \"record\": return \"One record\";\n            case \"tree\": return `One ${noun} tree`;\n            case \"calculation\": return \"One calculation\";\n            case \"list\": return \"One list\";\n            case \"lookupTable\": return \"One lookup table\";\n            case \"value\": return \"One value\";\n        }\n    },\n    shapeUnknown: () => \"Shape not known until the problems above are fixed\",\n    countRows: ({ count, rows }) => `${count} ${rows}`,\n    rows: ({ adjective, noun }) => (adjective === \"\" ? noun : `${adjective} ${noun}`),\n    fieldsAdded: ({ fields }) => `+ ${fields}`,\n    gives: ({ shape }) => `Gives ${shape.length === 0 ? shape : shape.charAt(0).toLowerCase() + shape.slice(1)}`,\n\n    match: ({ match }) => match,\n    ofThese: ({ match }) => (match === \"any\" ? \"of these is true\" : \"of these are true\"),\n    joiner: ({ match }) => (match === \"any\" ? \"or\" : \"and\"),\n    find: () => \"find\",\n    inDataset: () => \"in\",\n    bringIn: () => \"bring in\",\n    leftEmpty: ({ noun }) => `Left empty when a ${noun} isn't found.`,\n    by: () => \"by\",\n    thenTotal: ({ first }) => (first ? \"then\" : \"and\"),\n    as: () => \"as\",\n    allRowsTogether: () => \"all rows together\",\n    givesOneWholeNumber: () => \"gives one whole number\",\n    where: () => \"where\",\n    isMissingUse: () => \"is missing, use\",\n    open: () => \"open\",\n    onePer: ({ item, keeping }) => (keeping === undefined ? `one row per ${item}` : `one row per ${item}, keeping the ${keeping} ID`),\n    takeThe: () => \"take the\",\n    of: () => \"of\",\n    everyLevel: ({ fields }) => `every level, keeping ${fields}`,\n    inputFrom: ({ input }) => `${input} from`,\n    to: () => \"to\",\n    every: () => \"every\",\n    callTheResult: () => \"call the result\",\n    addCondition: () => \"Add condition\",\n    addGroup: () => \"Add group\",\n    addTotal: () => \"Add a total\",\n    addField: () => \"Add field\",\n    remove: () => \"Remove\",\n    removeGroup: () => \"Remove group\",\n    placeholder: ({ slot }) => PLACEHOLDER[slot],\n    total: ({ fn }) => {\n        switch (fn) {\n            case \"sum\": return \"add up\";\n            case \"count\": return \"count\";\n            case \"mean\": return \"average\";\n            case \"min\": return \"lowest\";\n            case \"max\": return \"highest\";\n            case \"distinct\": return \"count different\";\n        }\n    },\n    direction: ({ dir, kind }) => {\n        const [desc, asc] = kind === \"date\" ? [\"newest first\", \"oldest first\"] : kind === \"text\" ? [\"Z to A\", \"A to Z\"] : [\"highest first\", \"lowest first\"];\n        return dir === \"desc\" ? desc! : asc!;\n    },\n    part: ({ part }) => part,\n    partExample: ({ part }) => (part === \"year\" ? \"2026\" : part === \"month\" ? \"2026-03\" : \"Tuesday\"),\n    list: ({ items }) => englishList(items),\n\n    slotLabel: ({ slot }) => SLOT_LABEL[slot],\n    slotPlaceholder: ({ slot }) => (takesValue(slot) ? \"Type or pick a value\" : \"Type to filter\"),\n    slotHint: ({ slot }) => (takesValue(slot) ? \"Values from the dataset summary\"\n        : slot === \"add-step\" ? \"Only steps that fit the current shape\"\n        : slot === \"dataset\" ? \"The lookup tables this builder reads\"\n        : takesField(slot) ? \"Fields from the checked type\"\n        : \"\"),\n    slotEmpty: ({ slot }) => (takesValue(slot) ? \"Type a value, then press ⏎.\" : \"Nothing matches.\"),\n    slotKeys: () => \"↑↓ ⏎ esc\",\n    fieldsGroup: () => \"Fields\",\n    insideGroup: ({ parent }) => `Inside ${parent}`,\n    eachGroup: ({ noun }) => `Each ${noun}`,\n    onlyCase: ({ rows }) => `${rows} only`,\n    compareGroup: () => \"Compare\",\n    casesGroup: () => \"Cases\",\n    valuesGroup: () => \"Values in the data\",\n    fromDataGroup: () => \"From the data\",\n    yearsGroup: () => \"Years in the data\",\n    monthsGroup: () => \"Months in the data\",\n    itemsGroup: () => \"Items\",\n    typedGroup: () => \"Typed\",\n    matchGroup: () => \"Match\",\n    groupGroup: () => \"Group\",\n    totalGroup: () => \"Total\",\n    orderGroup: () => \"Order\",\n    partGroup: () => \"Part\",\n    datasetsGroup: () => \"Lookup tables\",\n    fromDatasetGroup: ({ dataset }) => `From ${dataset}`,\n    inputGroup: () => \"Values\",\n    addStepGroup: () => \"Add a step\",\n    savedGroup: () => \"Start from a saved query\",\n    useTyped: ({ text }) => `Use “${text}”`,\n    matchDetail: ({ match }) => (match === \"any\" ? \"at least one holds\" : \"every condition holds\"),\n    oneRowOfTotals: () => \"one row of totals\",\n    stat: ({ stat }) => stat,\n    startOfMonth: ({ rows }) => `start of month · ${rows}`,\n    itemsWord: ({ n }) => (n === 1 ? \"item\" : \"items\"),\n    entries: ({ count, noun }) => `${count} ${noun}`,\n\n    distinctValues: ({ count, n }) => `${count} ${n === 1 ? \"value\" : \"values\"}`,\n    casesUsed: ({ count, n }) => `${count} ${n === 1 ? \"case\" : \"cases\"}`,\n    span: ({ from, to }) => `${from} – ${to}`,\n    lengths: ({ from, to }) => `${from}–${to} each`,\n    missing: ({ count }) => `${count} missing`,\n    summaryJoin: ({ parts }) => parts.join(\" · \"),\n\n    noRowsHere: ({ shape, verb }) => `${shape} — there are no rows to ${verb} here.`,\n    choose: ({ what }) => `Choose ${withArticle(what)}.`,\n    what: ({ what }) => what,\n    wrongKind: ({ label, kind, what }) => `${capital(label)} is ${kind} — pick ${withArticle(what)}.`,\n    unknownField: ({ name, labels, more }) => `There's no “${name}” here. The rows have ${labels}${more ? \"…\" : \".\"}`,\n    onlyCaseHas: ({ rows, label }) => `Only ${rows} have a ${label}.`,\n    unknownCase: ({ label, cases, value }) => `${capital(label)} can be ${cases} — not “${value}”.`,\n    wholeVariant: ({ label }) => `Compare the ${label} case, not the whole value.`,\n    chooseComparison: () => \"Choose how to compare.\",\n    enterValue: () => \"Enter a value.\",\n    comparisonNotForKind: ({ cmp, kind }) => `“${cmp}” doesn't work on ${kind}.`,\n    enterItems: () => \"Enter a whole number of items.\",\n    enterYear: () => \"Enter a year, like 2026.\",\n    enterMonth: () => \"Enter a month, like 2026-03.\",\n    enterDate: () => \"Enter a date, like 2026-03-01.\",\n    notANumber: ({ label, kind, value }) => `${capital(label)} is a ${kind} — “${value}” isn't one.`,\n    neverEqual: ({ label, value }) => `${capital(label)} is a whole number, so it can never equal ${value}.`,\n    finishInner: () => \"Finish the inner condition.\",\n    emptyGroup: () => \"This group is empty.\",\n    emptyFilter: () => \"Add a condition, or remove this step.\",\n    notLookupTable: ({ dataset }) => `${capital(dataset)} can't be looked up by key.`,\n    keyKind: ({ dataset, kind, label, keyKind }) => `${capital(dataset)} are found by ${kind} ids, but ${label} is ${withArticle(keyKind)}.`,\n    noRecordField: ({ noun, field }) => `${capital(noun)} records have no “${field}”.`,\n    chooseGroupBy: () => \"Choose what to group by.\",\n    cannotAddUp: ({ label, kind }) => `Can't add up ${label} — it's ${kind}. Pick a number, or count instead.`,\n    noLowestHighest: ({ label }) => `${capital(label)} has no lowest or highest.`,\n    duplicateName: ({ name }) => `Two fields are called ${name}; the last one wins.`,\n    keepFirstCount: () => \"Keep the first needs a whole number, 1 or more.\",\n    neverMissing: ({ label }) => `${capital(label)} is never missing, so this changes nothing.`,\n    noTree: () => \"There is no tree to walk here.\",\n    noCalculation: () => \"There is no calculation to try here.\",\n    emptyRange: () => \"The range needs a start below the end and a step above 0.\",\n    longRange: ({ max }) => `That range gives more than ${max} rows; results will be cut off.`,\n    strayBracket: () => \"The jq has a stray bracket.\",\n    unclosedText: () => \"A text value is missing its closing quote.\",\n    unclosedBracket: () => \"A bracket is never closed.\",\n    trailingPipe: () => \"The query ends with a pipe.\",\n    emptyQuery: () => \"The query is empty.\",\n    noDataSource: ({ name }) => `There's no data source called “${name}”.`,\n    startFromSource: () => \"Start the query from a data source.\",\n    customJq: () => \"Custom jq step.\",\n    excludedBuiltin: ({ name }) => `${name} isn't available in queries.`,\n    rowsMoreThanOnce: () => \"Rows can appear more than once.\",\n\n    fixNarrow: ({ rows }) => `Keep only ${rows} first`,\n    fixUse: ({ label }) => `Use ${label}`,\n    fixUnwhole: ({ field }) => `Use .${field}.type`,\n    fixRemoveStep: () => \"Remove this step\",\n\n    describeModel: ({ result, input, from, to, step, fixed }) =>\n        `${capital(result)} over ${input} from ${from} to ${to} in steps of ${step}${fixed.map(f => `, ${f}`).join(\"\")}`,\n    describeFixed: ({ name, value }) => `${name} ${value}`,\n    describeAllTotals: ({ totals, source, where }) => `${capital(totals)} across ${source}${where}`,\n    describeTopGroups: ({ n, groups, sort, source, where }) => `Top ${n} ${groups} by ${sort} from ${source}${where}`,\n    describeGroups: ({ totals, group, source, where, sorted }) => `${capital(totals)} per ${group} from ${source}${where}${sorted}`,\n    describeCount: ({ source, where }) => `Count of ${source}${where}`,\n    describeFirst: ({ top, n, source, sort, where, with: withs }) => `${top ? \"Top\" : \"First\"} ${n} ${source}${sort}${where}${withs}`,\n    describeRows: ({ source, where, with: withs, sorted }) => `${capital(source)}${where}${withs}${sorted}`,\n    describeWhere: ({ conditions }) => (conditions.length === 0 ? \"\" : ` where ${conditions.join(\" and \")}`),\n    describeConditions: ({ match, conditions }) => (match === \"any\" ? conditions.join(\" or \") : englishList(conditions)),\n    describeGroup: ({ match, conditions }) => (conditions.length > 1 ? `(${conditions.join(match === \"any\" ? \" or \" : \" and \")})` : conditions[0] ?? \"\"),\n    describeCondition: ({ field, cmp, value }) => {\n        // \"is in year 2026\" reads better as \"is in 2026\".\n        const words = cmp === \"inYear\" || cmp === \"inMonth\" ? \"is in\" : COMPARISON[cmp];\n        return value === \"\" ? `${field} ${words}` : `${field} ${words} ${value}`;\n    },\n    describeWith: ({ lookups }) => (lookups.length === 0 ? \"\" : `, with ${lookups.map(l => `${l.fields} from ${l.dataset}`).join(\" and \")}`),\n    describeSorted: ({ field, desc }) => `, sorted by ${field}${desc ? \", highest first\" : \"\"}`,\n    describeBy: ({ field }) => ` by ${field}`,\n    describeDrilled: ({ noun, list }) => `${noun} ${list}`,\n    describeWalked: ({ noun }) => `every ${noun} in the tree`,\n    ellipsis: () => \"…\",\n\n    outlineLookup: ({ fields, dataset, key }) => `${fields} from ${dataset} by ${key}`,\n    outlineGroup: ({ totals, group }) => (group === undefined ? `${totals} of all rows` : `${totals} per ${group}`),\n    outlineSort: ({ field, direction }) => `by ${field}, ${direction}`,\n    outlineLimit: ({ rows }) => rows,\n    outlineFill: ({ field, value }) => `${value} where ${field} is missing`,\n    outlineDatePart: ({ part, field, name }) => `the ${part} of ${field} as ${name}`,\n    outlineModel: ({ input, from, to, step, fixed }) => `${input} from ${from} to ${to} every ${step}${fixed.map(f => `, ${f}`).join(\"\")}`,\n\n    viewLabel: () => \"View\",\n    view: ({ view }) => (view === \"visual\" ? \"Visual\" : \"jq\"),\n    copyJq: () => \"Copy jq\",\n    copied: () => \"Copied\",\n    saveAs: () => \"Save…\",\n    run: () => \"Run\",\n    running: () => \"Running\",\n    runKeys: () => \"⌘⏎\",\n    runTip: () => \"Run · ⌘⏎\",\n    more: () => \"More\",\n    stepsLabel: () => \"Steps\",\n    stepNumber: ({ n }) => n,\n    moveUp: () => \"Move up\",\n    moveDown: () => \"Move down\",\n    removeStep: () => \"Remove step\",\n    insertHere: () => \"Insert a step here\",\n    checksClean: () => \"Checks clean\",\n    toFinish: ({ count }) => `${count} to finish`,\n    problemCount: ({ count, n }) => `${count} ${n === 1 ? \"problem\" : \"problems\"}`,\n    warningCount: ({ count, n }) => `${count} ${n === 1 ? \"warning\" : \"warnings\"}`,\n    typeHover: ({ type, multiplicity }) => `${type} · ${multiplicity}`,\n    givesFields: ({ fields }) => (fields.length === 0 ? \"\" : `· ${fields.join(\", \")}`),\n    sourceLine: ({ path, kind }) => (kind === \"\" ? path : `${path} · ${kind}`),\n    inputLabel: ({ input }) => INPUT_LABEL[input],\n    saveState: ({ state }) => (state === \"saved\" ? \"Saved\" : state === \"unsaved\" ? \"Unsaved changes\" : \"Not saved\"),\n    unfinishedLeftOut: ({ count, n }) => (n === 1\n        ? `${count} unfinished step is left out of the jq until it is finished.`\n        : `${count} unfinished steps are left out of the jq until they are finished.`),\n    fixSyntaxFirst: () => \"Fix the syntax problem first — the visual steps are built from the jq.\",\n    jqPartsStay: ({ count, n }) => (n === 1\n        ? `${count} part of the jq doesn't match a visual step, so it stays as jq.`\n        : `${count} parts of the jq don't match a visual step, so they stay as jq.`),\n    jqLabel: () => \"jq query\",\n    setGesture: ({ what }) => `Set ${what}`,\n    addStepGesture: ({ step }) => `Add ${step}`,\n    removeStepGesture: ({ n }) => `Remove step ${n}`,\n    moveStepGesture: ({ n, up }) => `Move step ${n} ${up ? \"up\" : \"down\"}`,\n    editJqGesture: () => \"Edit the jq\",\n    nameGesture: () => \"Name the query\",\n\n    pane: () => \"Query\",\n    tab: ({ tab }) => (tab === \"query\" ? \"Query\" : tab === \"datasets\" ? \"Datasets\" : \"Library\"),\n    untitled: ({ source }) => `Untitled ${source} query`,\n    savedUnreadable: ({ message }) => `The saved queries couldn't be read: ${message}`,\n    queryGone: ({ name }) => `“${name}” isn't saved here`,\n    queryGoneHint: () => \"It was renamed or removed. Open another from the Library tab, or start a new query from the Datasets tab.\",\n    sourceThroughIndex: ({ name, index }) => `${capital(name)} reads through the index ${index}; bind the record itself to query it.`,\n    sourceUnbound: ({ name }) => `${capital(name)} isn't bound on this page yet.`,\n    rootMissing: ({ name }) => `Reads ${name}, which isn't here`,\n    rootElsewhere: ({ path, name }) => `Reads ${path}, not this builder's ${name}`,\n    nameTaken: ({ name }) => `Another query took the name ${name} first — choose another.`,\n    savedChanged: ({ name, by }) => `${name} changed since this edit began${by === undefined ? \"\" : ` — last changed by ${by}`}. Discard your changes to see it, or save under another name.`,\n\n    saveQuery: () => \"Save query\",\n    queryName: () => \"Query name\",\n    queryNameMissing: () => \"Give the query a name to save it.\",\n    queryNameHeld: ({ name }) => `${name} is taken`,\n    descriptionPlaceholder: () => \"What the query answers, in one sentence\",\n    descriptionGenerated: () => \"Generated from the steps · edit to write your own\",\n    descriptionCount: ({ count, max }) => `${count}/${max} · shown under the name in the library`,\n    restoreGenerated: () => \"Use generated\",\n    saveConfirm: () => \"Save\",\n    cancel: () => \"Cancel\",\n\n    jqCheck: ({ problems, n, warnings, w }) => {\n        const warned = `${warnings} ${w === 1 ? \"warning\" : \"warnings\"}`;\n        if (n > 0) return `${problems} ${n === 1 ? \"problem\" : \"problems\"}${w > 0 ? ` · ${warned}` : \"\"}`;\n        return w > 0 ? warned : \"Checks clean\";\n    },\n    jqHint: () => \"ctrl space · suggestions\",\n    jqProblemsLabel: () => \"Problems\",\n    jqProblemCode: ({ code, note }) => (note ? \"note\" : code.replace(/_/g, \" \")),\n    jqProblemAt: ({ line, column }) => `L${line}:${column}`,\n    jqCompletionsLabel: () => \"Completions\",\n    jqCompletionLine: ({ label, detail }) => (detail === \"\" ? label : `${label} · ${detail}`),\n    jqCompletionKeys: () => \"↑↓ · ⏎ · esc\",\n\n    resultControls: () => \"Result controls\",\n    resultViewLabel: () => \"Result view\",\n    resultView: ({ view }) => (view === \"table\" ? \"Table\" : \"Tree\"),\n    resultViewPicked: ({ view }) => (view === \"table\" ? \"Table · picked for many rows\" : \"Tree · picked for one value\"),\n    download: () => \"Download\",\n    downloadFormat: ({ format }) => (format === \"csv\" ? \"CSV\" : \"BEAST2\"),\n    downloadFormatMeta: ({ format }) => (format === \"csv\" ? \"table\" : \"typed\"),\n    downloaded: ({ format, file, count }) => (format === \"csv\"\n        ? `Downloaded ${file} — ${count}, one row per output.`\n        : `Downloaded ${file} — the result as the run returned it, with its type.`),\n    staleTag: () => \"Stale\",\n    staleResult: () => \"The query changed after this run.\",\n    runAgain: () => \"Run again\",\n    notRunProblems: () => \"Not run — the checker found problems\",\n    notRun: () => \"Not run\",\n    stoppedAfter: ({ seconds }) => `Stopped after ${seconds} s`,\n    stoppedHint: () => \"Narrow the query, or ask for fewer rows.\",\n    tooLarge: () => \"The result is too large\",\n    tooLargeHint: ({ bytes, limit }) => `${bytes} is over the ${limit} limit. Total or narrow the query.`,\n    needsPlatform: () => \"Not run — the query calls a function this server can't run\",\n    needsPlatformHint: ({ functions }) => `It needs ${functions}.`,\n    unreachable: () => \"Couldn't reach the server\",\n    idleTitle: () => \"Run the query to see results\",\n    idleChecks: () => \"Checks run as you edit; nothing reads data yet.\",\n    idleRun: () => \"Press Run or ⌘⏎ to read the datasets the query uses.\",\n    idleRunPhone: () => \"Press Run to read the datasets the query uses.\",\n    clearTheSearch: () => \"Clear the search\",\n    reading: ({ sources }) => `Reading ${sources}`,\n    runningWord: () => \"Running…\",\n    noResult: () => \"No result\",\n    noResultYet: () => \"No result yet\",\n    showing: ({ shown, total }) => `Showing 1–${shown} of ${total}`,\n    atLeast: ({ count }) => `${count}+`,\n    runLine: ({ n, time, ms }) => `run #${n} · ${time} · ${ms} ms`,\n    readsLine: ({ sources }) => (sources.length === 0 ? \"\" : `reads ${sources.map(s => `${s.name} #${s.hash}`).join(\" · \")}`),\n    rowCount: ({ count, n }) => `${count} ${n === 1 ? \"row\" : \"rows\"}`,\n    oneValue: () => \"1 value\",\n    byteSize: ({ value, unit }) => `${value} ${unit}`,\n    duration: ({ value, unit }) => `${value} ${unit}`,\n\n    planBadge: ({ kind, detail }) => {\n        if (kind === \"one_shot\") return \"One call\";\n        const word = kind === \"rekey\" ? \"Re-keyed join\" : \"Split call\";\n        return detail === \"\" ? word : `${word} · ${detail}`;\n    },\n    planTitle: () => \"How this run reads its data\",\n    notRunYet: () => \"not run\",\n    thisResult: () => \"This result\",\n    thisResultQuery: () => \"Query\",\n    thisResultGives: () => \"Gives\",\n    thisResultRun: () => \"Run\",\n    thisResultReads: () => \"Reads\",\n    thisResultPlan: () => \"Plan\",\n    dismissNotice: () => \"Dismiss\",\n    queryEyebrow: ({ state, n, count }) => (n === 0 ? `${state} · no steps` : `${state} · ${count} ${n === 1 ? \"step\" : \"steps\"}`),\n    stepActions: () => \"Step actions\",\n    backToStep: () => \"Back to the step\",\n    removeCondition: () => \"Remove condition\",\n    checkerFound: ({ n, count, text }) => `The checker found ${count} ${n === 1 ? \"problem\" : \"problems\"}: ${text.charAt(0).toLowerCase()}${text.slice(1)}`,\n    clearSearchEvery: () => \"Clear the search to see every query.\",\n    rowsFromRun: ({ n, time }) => `The rows below are from run #${n} at ${time}.`,\n    showProblem: () => \"Show the problem\",\n    thisResultDownload: () => \"Download\",\n    savedAs: ({ slug }) => `Saved as ${slug}.csv or .beast2`,\n    readingShort: () => \"Reading\",\n    noStepsYet: () => \"No steps yet\",\n    noStepsAdd: () => \"Add a step to narrow, reshape or total the rows.\",\n    noStepsSaved: () => \"Or start from a saved query in Library.\",\n    openLibrary: () => \"Open Library\",\n    tapDataset: () => \"Tap a dataset to start a new query on it.\",\n    tapQuery: () => \"Tap a query to open it and run it.\",\n    nameLabel: () => \"Name\",\n    nameHelp: () => \"A name another query holds is refused; this one's own updates it.\",\n    descriptionLabel: () => \"Description\",\n    changesCount: ({ n, count }) => `${count} ${n === 1 ? \"change\" : \"changes\"}`,\n    filterSlot: ({ what }) => `Filter ${what}`,\n    quickAddGroup: () => \"Quick add\",\n    moreStepsGroup: () => \"More steps\",\n    atEnd: () => \"at the end\",\n    beforeStep: ({ n }) => `before step ${n}`,\n    stepContext: ({ n }) => `Step ${n}`,\n    conditionContext: ({ n, c }) => `Step ${n} · condition ${c}`,\n    stepFitNote: () => \"A step that doesn't fit the rows here says why.\",\n    savedNotice: ({ name, time }) => `Saved “${name}” · ${time}`,\n    planSplit: ({ over, heaviest, bytes, piece }) => (heaviest === over\n        ? `Split call over ${over}: it weighs ${bytes}, more than one piece (${piece}).`\n        : `Split call over ${over}: ${heaviest}, cut with it, weighs ${bytes}, more than one piece (${piece}).`),\n    planCopartitioned: ({ over, names, n }) => `${capital(names)} ${n === 1 ? \"is\" : \"are\"} cut at the same keys as ${over}: each piece reads only its own keys of ${n === 1 ? \"it\" : \"them\"}.`,\n    planRekey: ({ name }) => `Re-key: both sides large and unaligned — ${name} weighs more than one piece too.`,\n    planRekeyStage: ({ over, name, bytes }) => `First, ${over} is re-keyed by this, about ${bytes}, and each piece then reads ${name} cut at the same keys:`,\n    planTop: ({ count, n }) => (n === 1\n        ? \"The first row of the sort is kept, each piece's and then theirs together, by:\"\n        : `The first ${count} rows of the sort are kept, each piece's and then theirs together, by:`),\n    planFirst: ({ count, n }) => (n === 1\n        ? \"The first row, in input order, is kept: each piece stops at its first, and the call once the pieces before the rest have one:\"\n        : `The first ${count} rows, in input order, are kept: each piece stops once it has ${count}, and the call once the pieces before the rest have them:`),\n    planSmall: ({ over, bytes, piece }) => `One call: ${over} weighs ${bytes}, within one piece (${piece}).`,\n    planUnweighed: ({ over }) => `One call: what ${over} weighs isn't known.`,\n    planSplitBy: ({ over, why }) => (why === \"time\"\n        ? `Split call over ${over}: estimated faster than one call.`\n        : why === \"memory\"\n            ? `Split call over ${over}: one call would hold more memory than it may use.`\n            : `Split call over ${over}: one call's answer was too large for one, and a split call's is read a page at a time.`),\n    planFaster: ({ over }) => `One call: estimated faster than a split call over ${over}.`,\n    planEstimateOneCall: ({ seconds, peak, memory, over }) => {\n        const may = memory === undefined ? \"\" : over ? `, more than the ${memory} it may use` : `, within the ${memory} it may use`;\n        return `As one call: about ${seconds}, holding about ${peak}${may}.`;\n    },\n    planEstimateSplit: ({ rekey, seconds, pieces, n, cores, peak }) => {\n        const cut = `${pieces} ${n === 1 ? \"piece\" : \"pieces\"}`;\n        return rekey\n            ? `As a re-keyed join: about ${seconds}, two calls of ${cut}, ${cores} at a time, each holding about ${peak}.`\n            : `As a split call: about ${seconds}, ${cut}, ${cores} at a time, each holding about ${peak}.`;\n    },\n    planAssumed: ({ rows, n, over, first, oneCall, piece, held }) => {\n        const holding = held === undefined ? \"\" : `, one call holding every row at about ${held} each`;\n        const stopping = first === undefined ? \"\" : first.n === 1 ? \"; both paths stop after the first\" : `; both paths stop after the first ${first.count}`;\n        return `Assumed: ${rows} ${n === 1 ? \"row\" : \"rows\"} of ${over}, each about ${oneCall} µs in one call and ${piece} µs in a piece${holding}${stopping}.`;\n    },\n    planUnsplit: ({ message }) => `One call: the split call couldn't be made — ${message}`,\n    planWhole: ({ code, name, at }) => {\n        const end = at ? \":\" : \".\";\n        switch (code) {\n            case \"no_stream\":\n                return name === undefined\n                    ? \"One call: it reads a count, a key or a value, and works through no data source's rows.\"\n                    : `One call: it reads a count, a key or a value of ${name}, and works through none of its rows.`;\n            case \"nested\": return `One call: it works through rows inside an expression, not as its own pipeline${end}`;\n            case \"stops_early\":\n                return at\n                    ? \"One call: it keeps only its first outputs, and one call stops as soon as it has them:\"\n                    : `One call: its outputs stream from ${name ?? \"a data source\"}, and one call stops once it has as many as a run returns.`;\n            case \"position\": return `One call: it takes rows by their position, and one call reads only as far as it needs${end}`;\n            case \"every_row\": return `One call: a step needs every row at once, and no work is done row by row before it${end}`;\n            case \"state\": return `One call: a step carries state from row to row${end}`;\n            case \"calls\": return `One call: the work on each row calls a function value, which may call a platform function the runner doesn't load${end}`;\n            case \"reads_again\": return `One call: it reads ${name ?? \"a data source\"} again, outside the rows it works through${end}`;\n            case \"key\": return `One call: it groups by a key that isn't one value a lookup table can hold${end}`;\n            case \"shape\": return `One call: it isn't a pipeline the planner splits${end}`;\n        }\n    },\n    planPiece: ({ over }) => `Each piece of ${over} runs:`,\n    planCombine: ({ kind }) => PLAN_COMBINE[kind],\n    planTotal: ({ rule }) => PLAN_TOTAL[rule],\n    planThen: () => \"Then, once, over what they combine to:\",\n    planBroadcast: ({ names }) => `Every piece reads ${names} whole.`,\n    planPieces: ({ over, count, n, size }) => `${capital(over)} is cut into ${count} ${n === 1 ? \"piece\" : \"pieces\"}, about ${size} each.`,\n    planPieceCount: ({ count, n }) => `${count} ${n === 1 ? \"piece\" : \"pieces\"}`,\n    planCachedCount: ({ count, n, whole }) => (whole ? \"all cached\" : `${count} ${n === 1 ? \"unit\" : \"units\"} cached`),\n    planUnits: ({ kind, cached, ran, units, n }) => {\n        switch (kind) {\n            case \"whole\": return \"The cache served the whole call: no unit ran.\";\n            case \"some\": return `The cache served ${cached} of its ${units} ${n === 1 ? \"unit\" : \"units\"}, and ${ran} ran.`;\n            case \"none\": return n === 1 ? \"Its one unit ran: the cache didn't hold it.\" : `All ${units} of its units ran: the cache held none.`;\n        }\n    },\n    planProgress: ({ phase, done, units, n }) => `${done} of ${units} ${PLAN_UNITS[phase][n === 1 ? 0 : 1]} done`,\n    planPruning: ({ kind, name }) => (kind === \"count\" ? `Reads the count from the index of ${name}, and no segment:`\n        : kind === \"seek\" ? `Reads only the segment of ${name} that holds the key:`\n            : `Reads only the segments of ${name} it reaches before it stops:`),\n\n    resultValue: () => \"value\",\n    resultMissing: () => \"—\",\n    resultList: ({ count, noun }) => `${count} ${noun}`,\n    resultEntries: ({ count, n }) => `${count} ${n === 1 ? \"entry\" : \"entries\"}`,\n    resultGrid: ({ rows, cols }) => `${rows} × ${cols}`,\n    resultJoin: ({ parts }) => parts.join(\" · \"),\n    resultFunction: () => \"function\",\n\n    datasetGroup: ({ kind }) => (kind === \"rows\" ? \"Rows\" : kind === \"lookups\" ? \"Lookups\" : kind === \"values\" ? \"Values\" : \"Models\"),\n    dataSourceNoun: ({ n }) => (n === 1 ? \"data source\" : \"data sources\"),\n    sourceRows: ({ count, noun }) => `${count} ${noun}`,\n    sourceLookup: ({ count, noun }) => `${count} ${noun} by ID`,\n    sourceTree: () => \"one tree\",\n    sourceRecord: () => \"one record\",\n    sourceModel: ({ inputs, output }) => `${inputs} → ${output}`,\n    sourceMeta: ({ size, hash }) => (hash === undefined ? size : size === \"\" ? `#${hash}` : `${size} · #${hash}`),\n    sourceRole: ({ role }) => (role === \"source\" ? \"Source\" : \"Looked up\"),\n    savedNoun: ({ n }) => (n === 1 ? \"query\" : \"queries\"),\n    recentGroup: () => \"Recent\",\n    startedOn: ({ name }) => `Started a new query on ${name}.`,\n    openedFromLibrary: ({ name }) => `Opened “${name}” from the library.`,\n    openedFromQueryLibrary: ({ name }) => `Opened “${name}” from the query library.`,\n\n    dropToOpen: ({ name }) => `Drop to open “${name}”`,\n    dropSteps: ({ count, n }) => `${count} ${n === 1 ? \"step\" : \"steps\"}.`,\n    dropTargetName: () => \"the query builder\",\n    dropRefusedName: ({ reason }) => `the query builder (${reason})`,\n\n    librarySearch: ({ count, n }) => `Search ${count} ${n === 1 ? \"query\" : \"queries\"}…`,\n    librarySearchLabel: () => \"Search queries\",\n    clearSearch: () => \"Clear search\",\n    librarySort: ({ sort }) => `Sort · ${sort === \"recent\" ? \"Recent\" : \"Name\"}`,\n    librarySortOption: ({ sort }) => (sort === \"recent\" ? \"Recent\" : \"Name\"),\n    newQueryOn: ({ source }) => `New query on ${source}`,\n    newQuery: () => \"New query\",\n    dataSources: () => \"Data sources\",\n    allQueries: () => \"All queries\",\n    openInBuilder: () => \"Open in builder →\",\n    libraryByline: ({ source, steps, gives, when, run }) => [\n        source,\n        steps === undefined ? \"jq\" : `${steps.count} ${steps.n === 1 ? \"step\" : \"steps\"}`,\n        gives.length === 0 ? gives : gives.charAt(0).toLowerCase() + gives.slice(1),\n        `${run ? \"ran\" : \"saved\"} ${when}`,\n    ].filter((part) => part !== \"\").join(\" · \"),\n    moreSteps: ({ count }) => `+${count} more`,\n    jqProgram: () => \"jq\",\n    noMatch: ({ text }) => `No queries match “${text}”`,\n    checkSpelling: () => \"Check the spelling\",\n    clearFilter: () => \"Clear the filter to search every query\",\n    searchWhat: () => \"Search by query name, description or data source\",\n    noQueries: () => \"No queries yet\",\n    saveInBuilder: () => \"Save a query in the builder\",\n    noRecent: () => \"No recent runs\",\n    runInBuilder: () => \"Run a query in the builder to see it here\",\n};\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The query builder's plain words (#934): what a step, a field, a kind, a\n * shape, a count, a summary and a problem are called in the visual view\n * (`Query Editor Spec.md` §4.3–§4.6), the sentence a saved query shows when\n * its author wrote none (§4.13), and a run's plan, its path, stages and\n * pruning (#941). Every string comes from the message table; every number\n * from the locale's formatters.\n *\n * @packageDocumentation\n */\n\nimport {\n    none, some, variant,\n    type EastType, type JqRange, type JqTotal, type SummaryLeafType, type ValueTypeOf,\n} from \"@elaraai/east\";\nimport type { SplitCallProgress, SplitCallReport } from \"@elaraai/e3-types\";\nimport type { Formatters, TickFormatOpt } from \"@elaraai/east-ui-components\";\nimport type { PlanExplanation, QueryPlan } from \"../plan.js\";\nimport { conditionIn, datasetType, type CheckedSteps, type StepDiagnostic, type StepFix } from \"../steps/check.js\";\nimport { DEFAULT_MAX_ROWS } from \"../steps/count.js\";\nimport { fieldByRef, fieldsOf, itemRecordOf, type StepField } from \"../steps/fields.js\";\nimport { nameFor, scalarFieldsOf } from \"../steps/print.js\";\nimport { baseType, optionPayload, singular, unwrapRecursive, type Shape } from \"../steps/shape.js\";\nimport type { StepParseError } from \"../steps/parse.js\";\nimport {\n    isComplete, needsValue, type Condition, type Step, type StepKind, type StepQuery, type StepValue,\n} from \"../steps/values.js\";\nimport { queryMessages, type KindName, type OneKind, type QueryMessages } from \"./messages.js\";\n\n/** A summary leaf: what a summary says about one path of the rows. */\nexport type SummaryLeaf = ValueTypeOf<typeof SummaryLeafType>;\n\n/** The words the model says, and how it prints numbers and dates. */\nexport interface QueryWords {\n    /** The message table. */\n    readonly messages: QueryMessages;\n    /** The locale's formatters. */\n    readonly formatters: Formatters;\n}\n\n/**\n * The words of a locale.\n *\n * @param formatters - the locale's formatters (`useFormatters()` in a renderer)\n * @param messages - the message table; English by default\n * @returns the words\n */\nexport function queryWords(formatters: Formatters, messages: QueryMessages = queryMessages): QueryWords {\n    return { messages, formatters };\n}\n\n/** Each step's icon (Font Awesome's names, `Query Editor Spec.md` §4.4). */\nexport const STEP_ICON: Readonly<Record<StepKind, string>> = {\n    filter: \"filter\",\n    lookup: \"arrow-right-arrow-left\",\n    group: \"layer-group\",\n    sort: \"arrow-down-wide-short\",\n    limit: \"list-ol\",\n    count: \"hashtag\",\n    pick: \"table-columns\",\n    fill: \"fill-drip\",\n    drill: \"arrow-turn-down\",\n    datepart: \"calendar-day\",\n    walk: \"sitemap\",\n    tabulate: \"chart-line\",\n    jq: \"code\",\n};\n\n/** A whole number, grouped, as the summaries print one. */\nconst WHOLE: TickFormatOpt = variant(\"number\", { minimumFractionDigits: some(0n), maximumFractionDigits: some(0n), signDisplay: none });\n/** A number with two decimals, grouped, as the summaries print one. */\nconst CENTS: TickFormatOpt = variant(\"number\", { minimumFractionDigits: some(2n), maximumFractionDigits: some(2n), signDisplay: none });\n\n// ─── Names ───────────────────────────────────────────────────────────────────\n\n/**\n * A field's name as a person reads it: underscores as spaces, and `id` and\n * `sku` in capitals — `customer_id` is `customer ID`.\n *\n * @param name - the name\n * @returns the label\n */\nexport function human(name: string): string {\n    return name.replace(/_/g, \" \").replace(/\\b(id|sku)\\b/g, w => w.toUpperCase());\n}\n\n/**\n * The plural of a noun, as English mostly forms it: `order` → `orders`,\n * `category` → `categories`, `status` → `statuses`; a noun already plural is\n * itself.\n *\n * @param word - the noun\n * @returns its plural\n */\nexport function plural(word: string): string {\n    if (/(us|ss|x|ch|sh)$/.test(word)) return `${word}es`;\n    if (/s$/.test(word)) return word;\n    if (/[^aeiou]y$/.test(word)) return `${word.slice(0, -1)}ies`;\n    return `${word}s`;\n}\n\n/**\n * A field's label: its name as a person reads it, and a payload's field\n * with its case — `shipped date`.\n *\n * @param field - the field\n * @returns the label\n */\nexport function fieldLabel(field: StepField): string {\n    return field.payload === undefined ? human(field.name) : `${field.payload.case} ${human(field.payload.leaf)}`;\n}\n\n/**\n * The label of the field a step names: its field's in the shape, or the\n * last part of the name when the shape has none.\n *\n * @param shape - the rows it is read in\n * @param ref - how the step names it\n * @returns the label\n */\nexport function refLabel(shape: Shape, ref: string): string {\n    const field = fieldByRef(shape, ref);\n    return field === undefined ? human(ref.split(\".\").pop() ?? ref) : fieldLabel(field);\n}\n\n/**\n * Whether a field holds IDs, which print as written: `id`, a name ending\n * `_id`, or `order`.\n *\n * @param name - the field's name\n * @returns whether it is an ID\n */\nexport function isIdName(name: string): boolean {\n    return /(^|_)(id|order)$/.test(name);\n}\n\n// ─── Kinds, shapes and counts ────────────────────────────────────────────────\n\n/**\n * A kind of value in plain words (`Query Editor Spec.md` §4.4): `text`,\n * `whole number`, `number, sometimes missing`, `one of gold, standard`, `list\n * of lines`, `lookup table`, `calculation`, `record`, `tree of boms`.\n *\n * @param type - the type\n * @param words - the words\n * @param items - what a list's or a tree's items are called, already plural: a field's or a data source's name\n * @returns the kind\n */\nexport function plainKind(type: EastType, words: QueryWords, items?: string): string {\n    const m = words.messages;\n    const payload = optionPayload(type);\n    if (payload !== undefined) return m.sometimesMissing({ kind: plainKind(payload, words, items) });\n    if (type.type === \"Recursive\") return m.kind({ kind: \"tree\", ...(items === undefined ? {} : { items }) });\n    const t = unwrapRecursive(type);\n    const kind = (k: KindName, extra: { items?: string; cases?: string } = {}): string => m.kind({ kind: k, ...extra });\n    switch (t.type) {\n        case \"String\": return kind(\"text\");\n        case \"Integer\": return kind(\"wholeNumber\");\n        case \"Float\": return kind(\"number\");\n        case \"DateTime\": return kind(\"date\");\n        case \"Boolean\": return kind(\"yesNo\");\n        case \"Null\": return kind(\"nothing\");\n        case \"Blob\": return kind(\"bytes\");\n        case \"Variant\": return kind(\"oneOf\", { cases: Object.keys(t.cases as Record<string, EastType>).join(\", \") });\n        case \"Array\": case \"Set\": case \"Vector\": {\n            if (items !== undefined) return kind(\"list\", { items });\n            const element = unwrapRecursive((t.type === \"Array\" ? t.value : t.type === \"Set\" ? t.key : t.element) as EastType);\n            return kind(\"list\", { items: element.type === \"Struct\" ? \"records\" : plural(plainKind(element, words)) });\n        }\n        case \"Dict\": return kind(\"lookupTable\");\n        case \"Function\": case \"AsyncFunction\": return kind(\"calculation\");\n        case \"Struct\": return kind(\"record\");\n        default: return kind(\"value\");\n    }\n}\n\n/**\n * A field's kind in plain words, its items named after it.\n *\n * @param field - the field\n * @param words - the words\n * @returns the kind\n */\nexport function fieldKind(field: StepField, words: QueryWords): string {\n    return plainKind(field.type, words, field.kind === \"list\" ? field.name : undefined);\n}\n\n/**\n * The case a shape's rows are narrowed to, as an adjective: `shipped`.\n *\n * @param shape - the shape\n * @returns the first narrowed case, or `\"\"`\n */\nexport function adjectiveOf(shape: Shape): string {\n    for (const c of shape.narrowed.values()) return c;\n    return \"\";\n}\n\n/**\n * A shape's rows in words, in the number a count gives: `shipped orders`,\n * `shipped order`.\n *\n * @param shape - the shape\n * @param words - the words\n * @param n - how many, for the noun's number; plural when omitted\n * @param adjective - an adjective in place of the shape's own\n * @returns the rows\n */\nexport function rowsWords(shape: Shape, words: QueryWords, n?: number, adjective: string = adjectiveOf(shape)): string {\n    const noun = human(shape.noun);\n    return words.messages.rows({ adjective, noun: n === 1 ? noun : plural(noun) });\n}\n\n/** What one value is. */\nfunction oneKind(type: EastType): OneKind {\n    if (type.type === \"Recursive\") return \"tree\";\n    const t = unwrapRecursive(type);\n    switch (t.type) {\n        case \"Integer\": return \"wholeNumber\";\n        case \"Float\": return \"number\";\n        case \"String\": return \"text\";\n        case \"Struct\": return \"record\";\n        case \"Function\": case \"AsyncFunction\": return \"calculation\";\n        case \"Array\": case \"Set\": case \"Vector\": return \"list\";\n        case \"Dict\": return \"lookupTable\";\n        default: return \"value\";\n    }\n}\n\n/**\n * A shape in plain words (`Query Editor Spec.md` §4.3): `Many shipped\n * orders`, `Up to 10 orders`, `One whole number`, `One bom tree`.\n *\n * @param shape - the shape\n * @param words - the words\n * @returns the words\n */\nexport function shapeWords(shape: Shape, words: QueryWords): string {\n    const m = words.messages;\n    if (shape.kind === \"unknown\") return m.shapeUnknown();\n    if (shape.kind === \"rows\") {\n        return shape.limit === undefined\n            ? m.shapeMany({ rows: rowsWords(shape, words) })\n            : m.shapeUpTo({ count: words.formatters.number(shape.limit), rows: rowsWords(shape, words, shape.limit) });\n    }\n    return m.shapeOne({ kind: oneKind(shape.type), noun: human(shape.noun) });\n}\n\n/**\n * A shape counted: `16 shipped orders`; one value is its shape.\n *\n * @param shape - the shape\n * @param n - how many rows a run counted\n * @param words - the words\n * @returns the words\n */\nexport function countWords(shape: Shape, n: number, words: QueryWords): string {\n    if (shape.kind !== \"rows\") return shapeWords(shape, words);\n    return words.messages.countRows({ count: words.formatters.number(n), rows: rowsWords(shape, words, n) });\n}\n\n/**\n * The fields of a shape's rows as a person reads them, payloads aside.\n *\n * @param shape - the shape\n * @returns the labels\n */\nexport function fieldLabels(shape: Shape): string[] {\n    return fieldsOf(shape).filter(f => f.payload === undefined).map(fieldLabel);\n}\n\n// ─── Values ──────────────────────────────────────────────────────────────────\n\n/**\n * A number from the data as a summary prints it: an ID as written, a whole\n * number grouped, any other with two decimals.\n *\n * @param n - the number\n * @param field - the field it belongs to\n * @param words - the words\n * @returns the text\n */\nexport function dataNumber(n: number, field: StepField, words: QueryWords): string {\n    const f = words.formatters;\n    if (isIdName(field.name)) return f.bare(n);\n    return f.value(n, field.kind === \"int\" ? WHOLE : CENTS);\n}\n\n/**\n * A value a step holds, as its slot shows it: text as written, a number as\n * data — every digit, never grouped.\n *\n * @param value - the value\n * @param words - the words\n * @returns the text\n */\nexport function valueWords(value: StepValue, words: QueryWords): string {\n    switch (value.type) {\n        case \"text\": return value.value;\n        case \"number\": return words.formatters.bare(value.value);\n        case \"boolean\": return value.value ? \"true\" : \"false\";\n        case \"null\": return \"null\";\n    }\n}\n\n// ─── A summary in words ──────────────────────────────────────────────────────\n\n/**\n * The jq path from a row a summary keys a field's leaf by: `.total`,\n * `.status.type`, `.status.value.date`; an item's field under its list —\n * `.lines[].sku`.\n *\n * @param field - the field\n * @param list - the list field the field is an item's field of, if any\n * @returns the path\n */\nexport function leafPath(field: StepField, list?: StepField): string {\n    const own = field.path.map(p => `.${p}`).join(\"\");\n    return list === undefined ? own : `${list.path.map(p => `.${p}`).join(\"\")}[]${own}`;\n}\n\n/**\n * What a summary says of a field, as a slot's offer shows it\n * (`Query Editor Spec.md` §4.5): `8 values`, `0.85 – 3,646.84`, `3 cases`,\n * `1–4 each`, `· 12 missing`.\n *\n * @param field - the field\n * @param leaf - its leaf of the summary\n * @param words - the words\n * @returns the words, or `\"\"` when the summary says nothing worth showing\n */\nexport function fieldSummaryWords(field: StepField, leaf: SummaryLeaf | undefined, words: QueryWords): string {\n    if (leaf === undefined) return \"\";\n    const m = words.messages;\n    const f = words.formatters;\n    const parts: string[] = [];\n    const missing = Number(leaf.missing);\n    switch (field.kind) {\n        case \"case\": {\n            const used = leaf.cases.type === \"some\" ? leaf.cases.value.filter(c => c.n > 0n).length : 0;\n            parts.push(m.casesUsed({ count: f.number(used), n: used }));\n            break;\n        }\n        case \"text\": {\n            if (leaf.distinct.type === \"some\") {\n                const n = Number(leaf.distinct.value);\n                parts.push(m.distinctValues({ count: f.number(n), n }));\n            }\n            break;\n        }\n        case \"int\": case \"num\": {\n            if (leaf.numbers.type === \"some\") {\n                parts.push(m.span({ from: dataNumber(leaf.numbers.value.min, field, words), to: dataNumber(leaf.numbers.value.max, field, words) }));\n            }\n            break;\n        }\n        case \"date\": {\n            if (leaf.dates.type === \"some\") parts.push(f.range(leaf.dates.value.min, leaf.dates.value.max));\n            break;\n        }\n        case \"list\": {\n            if (leaf.lengths.type === \"some\") parts.push(m.lengths({ from: f.number(leaf.lengths.value.min), to: f.number(leaf.lengths.value.max) }));\n            break;\n        }\n        default:\n            break;\n    }\n    if (missing > 0 && field.payload === undefined) parts.push(m.missing({ count: f.number(missing), n: missing }));\n    return m.summaryJoin({ parts });\n}\n\n// ─── Problems ────────────────────────────────────────────────────────────────\n\n/** A problem in plain words, and its fixes' labels. */\nexport interface ProblemWords {\n    /** The sentence. */\n    readonly text: string;\n    /** Each fix, with its label in plain words. */\n    readonly fixes: readonly { readonly fix: StepFix; readonly label: string }[];\n}\n\n/** Where a diagnostic is: its step, the rows it takes, and its condition and the rows that tests. */\ninterface Place {\n    readonly step: Step | undefined;\n    readonly before: Shape | undefined;\n    readonly condition: Condition | undefined;\n    readonly shape: Shape | undefined;\n}\n\n/** Finds a diagnostic's step and condition. */\nfunction placeOf(d: StepDiagnostic, query: StepQuery, checked: CheckedSteps): Place {\n    const step = query.steps.find(s => s.value.id === d.stepId);\n    const before = checked.stages.find(s => s.stepId === d.stepId)?.before;\n    const found = step?.type === \"filter\" && d.condId !== undefined && before !== undefined ? conditionIn(step.value.conds, d.condId, before) : undefined;\n    return { step, before, condition: found?.condition, shape: found?.shape ?? before };\n}\n\n/** The name two fields of a step's object share: a group's key and its totals, or the fields a step shows. */\nfunction duplicateNameIn(step: Step | undefined, before: Shape | undefined): string | undefined {\n    if (step === undefined || before === undefined) return undefined;\n    let names: string[] = [];\n    if (step.type === \"group\") {\n        const by = step.value.by;\n        names = [...(by.type === \"some\" && by.value.type === \"field\" ? [nameFor(before, by.value.value)] : []), ...step.value.aggs.map(a => a.as)];\n    } else if (step.type === \"pick\") {\n        names = step.value.fields.map(p => p.as);\n    }\n    return names.find((name, i) => names.indexOf(name) !== i);\n}\n\n/** Strips a leading article: `a field` → `field`. */\nfunction bare(what: string): string {\n    return what.replace(/^(a|an|the) /, \"\");\n}\n\n/** The words for an unfinished slot. */\nfunction incompleteWords(d: StepDiagnostic, words: QueryWords): string {\n    const m = words.messages;\n    const what = d.context[\"what\"] ?? \"\";\n    switch (what) {\n        case \"a comparison\": return m.chooseComparison();\n        case \"a value\": case \"a value to use\": case \"the range\": return m.enterValue();\n        case \"the inner condition\": return m.finishInner();\n        case \"a condition in this group\": return m.emptyGroup();\n        case \"a condition\": return m.emptyFilter();\n        case \"what to group by\": return m.chooseGroupBy();\n        case \"how many to keep\": return m.keepFirstCount();\n        default: return m.choose({ what: m.what({ what: bare(what) }) });\n    }\n}\n\n/** The label of a fix, in plain words. */\nfunction fixLabel(fix: StepFix, place: Place, words: QueryWords): string {\n    const m = words.messages;\n    switch (fix.kind) {\n        case \"addCaseCondition\": {\n            const shape = place.shape ?? place.before;\n            const rows = shape === undefined ? fix.case : rowsWords(shape, words, undefined, fix.case);\n            return m.fixNarrow({ rows });\n        }\n        case \"setField\": {\n            const shape = place.shape ?? place.before;\n            return m.fixUse({ label: shape === undefined ? human(fix.field) : refLabel(shape, fix.field) });\n        }\n        case \"setValue\": return m.fixUse({ label: valueWords(fix.value, words) });\n        case \"unwhole\": {\n            const field = place.condition?.type === \"test\" && place.condition.value.field.type === \"some\" ? place.condition.value.field.value : \"\";\n            return m.fixUnwhole({ field });\n        }\n        case \"removeStep\": return m.fixRemoveStep();\n        case \"editJq\": return fix.label;\n    }\n}\n\n/** The words of a syntax problem, by the parser's sentence. */\nfunction syntaxWords(message: string, words: QueryWords): string | undefined {\n    const m = words.messages;\n    if (/^syntax: unexpected \"[)\\]}]\"/.test(message)) return m.strayBracket();\n    if (message === \"syntax: this string is never closed.\") return m.unclosedText();\n    if (/^syntax: \"[([{]\" is never closed\\.$/.test(message)) return m.unclosedBracket();\n    if (message === \"syntax: expected a filter after \\\"|\\\".\") return m.trailingPipe();\n    if (message === \"syntax: empty program.\") return m.emptyQuery();\n    return undefined;\n}\n\n/**\n * A problem of the steps in plain words (`Query Editor Spec.md` §4.6), with\n * its fixes' labels; a problem the words have no sentence for keeps the\n * checker's.\n *\n * @param d - the diagnostic, as `checkSteps` placed it\n * @param query - the query\n * @param root - the root's type: a struct of the data sources\n * @param checked - the query's check\n * @param words - the words\n * @returns the sentence and the fixes\n */\nexport function problemWords(d: StepDiagnostic, query: StepQuery, root: EastType, checked: CheckedSteps, words: QueryWords): ProblemWords {\n    const m = words.messages;\n    const place = placeOf(d, query, checked);\n    const fixes = d.fixes.map(fix => ({ fix, label: fixLabel(fix, place, words) }));\n    const shape = place.shape;\n    const ref = d.context[\"field\"];\n    const field = ref === undefined || shape === undefined ? undefined : fieldByRef(shape, ref);\n    const label = field === undefined ? human(d.context[\"name\"] ?? \"\") : fieldLabel(field);\n    const kindOf = (f: StepField | undefined): string => (f === undefined ? d.context[\"kind\"] ?? \"\" : fieldKind(f, words));\n    const say = (text: string): ProblemWords => ({ text, fixes });\n\n    if (d.code === \"incomplete\") return say(incompleteWords(d, words));\n    if (d.code === \"custom\") return say(m.customJq());\n    if (d.code === \"duplicate_outputs\") return say(m.rowsMoreThanOnce());\n    if (d.code === \"duplicate_key\") return say(m.duplicateName({ name: duplicateNameIn(place.step, place.before) ?? \"\" }));\n    if (d.code === \"never_missing\") return say(m.neverMissing({ label }));\n    if (d.code === \"too_many_rows\") return say(m.longRange({ max: words.formatters.number(DEFAULT_MAX_ROWS) }));\n    if (d.code === \"syntax\") return say(syntaxWords(d.message, words) ?? d.message);\n    if (d.code === \"unsupported\") {\n        const excluded = /^unsupported: (\\S+) is excluded/.exec(d.message);\n        return say(excluded === null ? d.message : m.excludedBuiltin({ name: excluded[1]! }));\n    }\n    // A step that takes rows, on one value.\n    if (fixes.some(f => f.fix.kind === \"removeStep\") && place.step !== undefined && place.before !== undefined) {\n        return say(m.noRowsHere({ shape: shapeWords(place.before, words), verb: m.stepVerb({ kind: place.step.type }) }));\n    }\n    if (d.stepId === \"\" && d.slot === \"source\" && d.code === \"unknown_field\") return say(m.noDataSource({ name: d.context[\"name\"] ?? \"\" }));\n\n    const step = place.step;\n    if (step?.type === \"lookup\") {\n        const dataset = step.value.dataset.type === \"some\" ? step.value.dataset.value : \"\";\n        if (d.code === \"not_indexable\") return say(m.notLookupTable({ dataset }));\n        if (d.code === \"unknown_field\" && d.slot === \"dataset\") return say(m.noDataSource({ name: dataset }));\n        if (d.code === \"unknown_field\" && d.slot === \"fields\") return say(m.noRecordField({ noun: singular(dataset), field: d.context[\"name\"] ?? \"\" }));\n        if (d.code === \"type_mismatch\" && d.slot === \"key\") {\n            const table = datasetType(root, dataset);\n            const dict = table === undefined ? undefined : unwrapRecursive(table);\n            return say(m.keyKind({\n                dataset, kind: dict?.type === \"Dict\" ? plainKind(dict.key as EastType, words) : \"\", label,\n                keyKind: field === undefined ? \"\" : plainKind(baseType(field.type), words),\n            }));\n        }\n    }\n    if (d.code === \"unknown_field\") {\n        const labels = shape === undefined ? [] : fieldLabels(shape);\n        return say(m.unknownField({ name: human(d.context[\"name\"] ?? \"\"), labels: labels.slice(0, 6).join(\", \"), more: labels.length > 6 }));\n    }\n    if (d.code === \"unknown_case\") {\n        const cases = field?.cases ?? [];\n        return say(m.unknownCase({ label, cases: m.list({ items: cases }), value: d.context[\"value\"] ?? \"\" }));\n    }\n    if (d.code === \"type_mismatch\") {\n        if (step?.type === \"filter\") {\n            if (fixes.some(f => f.fix.kind === \"unwhole\")) return say(m.wholeVariant({ label }));\n            const narrow = fixes.find(f => f.fix.kind === \"addCaseCondition\");\n            if (narrow !== undefined && narrow.fix.kind === \"addCaseCondition\" && shape !== undefined) {\n                return say(m.onlyCaseHas({ rows: rowsWords(shape, words, undefined, narrow.fix.case), label }));\n            }\n            const test = place.condition?.type === \"test\" ? place.condition.value : undefined;\n            if (d.slot === \"cmp\" && test?.cmp.type === \"some\") return say(m.comparisonNotForKind({ cmp: m.comparison({ cmp: test.cmp.value.type }), kind: kindOf(field) }));\n            if (d.slot === \"value\") {\n                const cmp = test?.cmp.type === \"some\" ? test.cmp.value.type : undefined;\n                const value = d.context[\"value\"] ?? \"\";\n                if (cmp === \"inMonth\") return say(m.enterMonth());\n                if (cmp === \"lengthAtLeast\") return say(m.enterItems());\n                if (cmp === \"inYear\") return say(m.enterYear());\n                if (cmp === \"onOrAfter\" || cmp === \"before\") return say(m.enterDate());\n                const given = test?.value.type === \"some\" ? test.value.value : undefined;\n                if ((field?.kind === \"int\" || field?.kind === \"num\") && given?.type === \"text\") {\n                    return say(m.notANumber({ label, kind: plainKind(baseType(field.type), words), value }));\n                }\n                if (field?.kind === \"int\" && given?.type === \"number\" && !Number.isInteger(given.value)) {\n                    return say(m.neverEqual({ label, value: valueWords(given, words) }));\n                }\n            }\n        }\n        if (step?.type === \"group\") {\n            if (d.slot === \"by\") return say(m.wrongKind({ label, kind: kindOf(field), what: d.context[\"what\"] ?? \"\" }));\n            if (d.slot === \"agg-field\") {\n                const fn = d.context[\"fn\"];\n                if (fn === \"sum\" || fn === \"mean\") return say(m.cannotAddUp({ label, kind: kindOf(field) }));\n                if (fn === \"min\" || fn === \"max\") return say(m.noLowestHighest({ label }));\n            }\n        }\n        if ((step?.type === \"sort\" || step?.type === \"drill\" || step?.type === \"datepart\") && d.slot === \"field\" && d.context[\"what\"] !== undefined) {\n            return say(m.wrongKind({ label, kind: kindOf(field), what: d.context[\"what\"] }));\n        }\n        if (step?.type === \"limit\") return say(m.keepFirstCount());\n        if (step?.type === \"walk\") return say(m.noTree());\n        if (step?.type === \"tabulate\") return say(d.slot === \"range\" ? m.emptyRange() : m.noCalculation());\n    }\n    return say(d.message);\n}\n\n/**\n * A problem that keeps a program from being steps, in plain words\n * (`Query Editor Spec.md` §4.6, \"the program\"); one the words have no\n * sentence for keeps the parser's or the checker's.\n *\n * @param error - the problem `parseSteps` gave\n * @param words - the words\n * @returns the sentence\n */\nexport function parseErrorWords(error: StepParseError, words: QueryWords): string {\n    const m = words.messages;\n    if (error.code === \"syntax\") return syntaxWords(error.message, words) ?? error.message;\n    const unknown = /^unknown_field: \\.(\\S+) is not a dataset in this workspace\\./.exec(error.message);\n    if (unknown !== null) return m.noDataSource({ name: unknown[1]! });\n    if (error.code === \"unsupported\" && /starts from a dataset/.test(error.message)) return m.startFromSource();\n    return error.message;\n}\n\n// ─── The generated description ───────────────────────────────────────────────\n\n/** The most a generated description holds (`Query Editor Spec.md` §4.13). */\nexport const DESCRIPTION_MAX = 140;\n\n/**\n * A condition in a sentence: `status is shipped`, `lines has any where SKU\n * is BRK-100`; a group in brackets.\n *\n * @param condition - the condition\n * @param shape - the rows it tests\n * @param words - the words\n * @returns the words, or `\"\"` for a condition not finished\n */\nexport function conditionWords(condition: Condition, shape: Shape, words: QueryWords): string {\n    const m = words.messages;\n    if (condition.type === \"group\") {\n        const parts = condition.value.conds.map(c => conditionWords(c, shape, words)).filter(p => p !== \"\");\n        return m.describeGroup({ match: condition.value.match.type, conditions: parts });\n    }\n    const { field, cmp, value, inner } = condition.value;\n    if (field.type === \"none\" || cmp.type === \"none\") return \"\";\n    const kind = cmp.value.type;\n    const label = refLabel(shape, field.value);\n    if (kind === \"anyWhere\") {\n        if (inner.type === \"none\") return \"\";\n        const item = fieldByRef(shape, field.value);\n        const record = item === undefined ? undefined : itemRecordOf(item);\n        const itemShape: Shape = { ...shape, kind: \"rows\", type: record ?? shape.type, row: record, narrowed: new Map(), noun: singular(field.value) };\n        return m.describeCondition({ field: label, cmp: kind, value: conditionWords(inner.value, itemShape, words) });\n    }\n    if (!needsValue(kind)) return m.describeCondition({ field: label, cmp: kind, value: \"\" });\n    if (value.type === \"none\") return \"\";\n    const v = value.value;\n    // A year or a month reads as written; any other number grouped, as a person writes it.\n    const text = v.type === \"number\" && kind !== \"inYear\" && kind !== \"inMonth\" ? words.formatters.number(v.value) : valueWords(v, words);\n    return m.describeCondition({ field: label, cmp: kind, value: text });\n}\n\n/**\n * How a field's order is said: dates newest or oldest first, text A to Z,\n * anything else highest or lowest first.\n *\n * @param field - the field sorted by, if known\n * @returns the kind of order\n */\nexport function orderKind(field: StepField | undefined): \"date\" | \"text\" | \"number\" {\n    if (field === undefined) return \"number\";\n    if (field.kind === \"date\") return \"date\";\n    return field.kind === \"text\" || field.kind === \"case\" || field.kind === \"bool\" ? \"text\" : \"number\";\n}\n\n/**\n * A step in words, from its own values: what an outline line says\n * (`Query Editor Spec.md` §5) — `status is shipped and total is at least\n * 100`, `name and region from customers by customer ID`, `revenue and orders\n * per region`, `by total, highest first`.\n *\n * @param step - the step\n * @param before - the rows it takes\n * @param words - the words\n * @returns the words; a jq step's text as written\n */\nexport function stepWords(step: Step, before: Shape, words: QueryWords): string {\n    const m = words.messages;\n    const f = words.formatters;\n    const label = (ref: { type: \"some\"; value: string } | { type: \"none\" }): string => (ref.type === \"some\" ? refLabel(before, ref.value) : \"\");\n    const input = (x: { type: \"number\"; value: number } | { type: \"text\"; value: string }): string => (x.type === \"number\" ? f.number(x.value) : x.value);\n    switch (step.type) {\n        case \"filter\":\n            return m.describeConditions({\n                match: step.value.match.type,\n                conditions: step.value.conds.map(c => conditionWords(c, before, words)).filter(w => w !== \"\"),\n            });\n        case \"lookup\":\n            return m.outlineLookup({\n                fields: m.list({ items: step.value.fields.map(human) }),\n                dataset: step.value.dataset.type === \"some\" ? step.value.dataset.value : \"\",\n                key: label(step.value.key),\n            });\n        case \"group\": {\n            const totals = m.list({ items: step.value.aggs.map(a => human(a.as)) });\n            const by = step.value.by;\n            return by.type === \"some\" && by.value.type === \"field\" ? m.outlineGroup({ totals, group: refLabel(before, by.value.value) }) : m.outlineGroup({ totals });\n        }\n        case \"sort\": {\n            const field = step.value.field.type === \"some\" ? fieldByRef(before, step.value.field.value) : undefined;\n            return m.outlineSort({ field: label(step.value.field), direction: m.direction({ dir: step.value.dir.type, kind: orderKind(field) }) });\n        }\n        case \"limit\": {\n            const n = step.value.n;\n            const rows = n.type === \"number\" ? m.countRows({ count: f.number(n.value), rows: rowsWords(before, words, n.value) }) : n.value;\n            return m.outlineLimit({ rows });\n        }\n        case \"count\":\n            return m.givesOneWholeNumber();\n        case \"pick\":\n            return m.list({ items: step.value.fields.map(p => human(p.as)) });\n        case \"fill\":\n            return m.outlineFill({ field: label(step.value.field), value: step.value.value.type === \"some\" ? valueWords(step.value.value.value, words) : \"\" });\n        case \"drill\": {\n            const field = step.value.field.type === \"some\" ? fieldByRef(before, step.value.field.value) : undefined;\n            return m.onePer({ item: human(singular(field?.name ?? \"item\")) });\n        }\n        case \"datepart\":\n            return m.outlineDatePart({ part: m.part({ part: step.value.part.type }), field: label(step.value.field), name: human(step.value.as) });\n        case \"walk\": {\n            const node = unwrapRecursive(before.type);\n            return m.everyLevel({ fields: m.list({ items: node.type === \"Struct\" ? scalarFieldsOf(node).map(human) : [] }) });\n        }\n        case \"tabulate\":\n            return m.outlineModel({\n                input: human(step.value.over), from: input(step.value.from), to: input(step.value.to), step: input(step.value.step),\n                fixed: [...step.value.fixed.entries()].map(([name, value]) => m.describeFixed({ name: human(name), value: valueWords(value, words) })),\n            });\n        case \"jq\":\n            return step.value.text.trim();\n    }\n}\n\n/**\n * The sentence a saved query shows when its author wrote none\n * (`Query Editor Spec.md` §4.13): one sentence from the finished steps, at\n * most {@link DESCRIPTION_MAX} characters, cut at a word.\n *\n * @param query - the query\n * @param checked - its check, for each step's rows\n * @param words - the words\n * @returns the sentence, or `\"\"` when no step is finished\n */\nexport function describeQuery(query: StepQuery, checked: CheckedSteps, words: QueryWords): string {\n    const m = words.messages;\n    const f = words.formatters;\n    const finished = query.steps.filter(isComplete);\n    if (finished.length === 0) return \"\";\n    let source = plural(checked.source.noun);\n    let group: { key: string | undefined; totals: string[] } | undefined;\n    let sort: { field: string; desc: boolean } | undefined;\n    let limit: string | undefined;\n    let count = false;\n    let model: string | undefined;\n    const where: string[] = [];\n    const lookups: { fields: string; dataset: string }[] = [];\n    query.steps.forEach((step, i) => {\n        if (!isComplete(step)) return;\n        const before = checked.stages[i]?.before ?? checked.source;\n        switch (step.type) {\n            case \"filter\": {\n                const parts = step.value.conds.map(c => conditionWords(c, before, words)).filter(p => p !== \"\");\n                if (parts.length > 0) where.push(m.describeConditions({ match: step.value.match.type, conditions: parts }));\n                return;\n            }\n            case \"lookup\":\n                lookups.push({ fields: m.list({ items: step.value.fields.map(human) }), dataset: step.value.dataset.type === \"some\" ? step.value.dataset.value : \"\" });\n                return;\n            case \"group\": {\n                const by = step.value.by.type === \"some\" && step.value.by.value.type === \"field\" ? refLabel(before, step.value.by.value.value) : undefined;\n                group = { key: by, totals: step.value.aggs.map(a => human(a.as)) };\n                return;\n            }\n            case \"sort\":\n                sort = { field: step.value.field.type === \"some\" ? refLabel(before, step.value.field.value) : \"\", desc: step.value.dir.type === \"desc\" };\n                return;\n            case \"limit\":\n                limit = step.value.n.type === \"number\" ? f.number(step.value.n.value) : step.value.n.value;\n                return;\n            case \"count\":\n                count = true;\n                return;\n            case \"drill\":\n                source = m.describeDrilled({ noun: checked.source.noun, list: step.value.field.type === \"some\" ? human(step.value.field.value) : \"\" });\n                return;\n            case \"walk\":\n                source = m.describeWalked({ noun: checked.source.noun });\n                return;\n            case \"tabulate\": {\n                const input = (x: typeof step.value.from): string => (x.type === \"number\" ? f.number(x.value) : x.value);\n                const fixed = [...step.value.fixed.entries()].map(([name, value]) => m.describeFixed({ name: human(name), value: valueWords(value, words) }));\n                model = m.describeModel({ result: human(step.value.as), input: human(step.value.over), from: input(step.value.from), to: input(step.value.to), step: input(step.value.step), fixed });\n                return;\n            }\n            default:\n                return;\n        }\n    });\n    const whereText = m.describeWhere({ conditions: where });\n    const withText = m.describeWith({ lookups });\n    const sorted = sort === undefined ? \"\" : m.describeSorted({ field: sort.field, desc: sort.desc });\n    let sentence: string;\n    if (model !== undefined) sentence = model;\n    else if (group !== undefined && group.key === undefined) sentence = m.describeAllTotals({ totals: m.list({ items: group.totals }), source, where: whereText });\n    else if (group !== undefined && limit !== undefined && sort !== undefined) {\n        sentence = m.describeTopGroups({ n: limit, groups: plural(group.key ?? \"\"), sort: sort.field, source, where: whereText });\n    } else if (group !== undefined) sentence = m.describeGroups({ totals: m.list({ items: group.totals }), group: group.key ?? \"\", source, where: whereText, sorted });\n    else if (count) sentence = m.describeCount({ source, where: whereText });\n    else if (limit !== undefined) {\n        sentence = m.describeFirst({ top: sort?.desc === true, n: limit, source, sort: sort === undefined ? \"\" : m.describeBy({ field: sort.field }), where: whereText, with: withText });\n    } else sentence = m.describeRows({ source, where: whereText, with: withText, sorted });\n    sentence = `${sentence}.`;\n    if (sentence.length <= DESCRIPTION_MAX) return sentence;\n    const ellipsis = m.ellipsis();\n    return sentence.slice(0, DESCRIPTION_MAX - ellipsis.length).replace(/[\\s,]+\\S*$/, \"\") + ellipsis;\n}\n\n// ─── Sizes ───────────────────────────────────────────────────────────────────\n\n/** The units a size is said in, each 1,024 of the one before. */\nconst BYTE_UNITS = [\"B\", \"KB\", \"MB\", \"GB\"] as const;\n\n/**\n * A size in bytes, in words — `1.4 MB`, `16 MB`, `512 B`: in the largest unit\n * it holds one of, to GB.\n *\n * @param bytes - the size\n * @param words - the words\n * @param figures - the significant figures to round an estimate to (#1143) —\n *   `300 MB` rather than `300.394 MB`; every one when not given\n * @returns the size\n */\nexport function byteWords(bytes: number | bigint, words: QueryWords, figures?: number): string {\n    let value = Number(bytes);\n    let unit = 0;\n    while (value >= 1024 && unit < BYTE_UNITS.length - 1) {\n        value /= 1024;\n        unit += 1;\n    }\n    if (figures !== undefined) value = roundTo(value, figures);\n    return words.messages.byteSize({ value: unit === 0 ? words.formatters.number(value) : words.formatters.value(value, undefined), unit: BYTE_UNITS[unit]! });\n}\n\n/** A number rounded to some significant figures: an estimate's. */\nfunction roundTo(value: number, figures: number): number {\n    return value === 0 ? 0 : Number(value.toPrecision(figures));\n}\n\n/**\n * An estimated duration in words (#1143), to two figures — `430 ms`, `2.9 s`,\n * `17 s`, `4.9 min`: in milliseconds under a second, in seconds under two\n * minutes, and in minutes after.\n *\n * @param seconds - the duration, in seconds\n * @param words - the words\n * @returns the duration\n */\nexport function durationWords(seconds: number, words: QueryWords): string {\n    const [value, unit] = seconds < 1 ? [Math.max(1, seconds * 1000), \"ms\" as const] : seconds < 120 ? [seconds, \"s\" as const] : [seconds / 60, \"min\" as const];\n    return words.messages.duration({ value: words.formatters.number(roundTo(value, 2)), unit });\n}\n\n// ─── A plan in words (#941) ──────────────────────────────────────────────────\n\n/** A line of a plan's explanation: a sentence, and the jq it is about. */\nexport interface PlanLine {\n    /**\n     * What it says: the path and why; both paths' estimates and what they\n     * assumed (#1143); a re-key and its stage (#942); what each piece runs,\n     * what it reads cut at the same keys (#942), how the pieces combine, a\n     * total, what runs once; what every piece reads whole; the pieces; how the\n     * call's units ran, once it answered (#1105); a read that prunes.\n     */\n    readonly kind: \"path\" | \"estimate\" | \"rekey\" | \"piece\" | \"copartitioned\" | \"combine\" | \"total\" | \"then\" | \"broadcast\" | \"pieces\" | \"units\" | \"pruning\";\n    /** Its sentence: one that ends with a colon has its jq after it. */\n    readonly text: string;\n    /** The jq it is about, as the query writes it; `undefined` when it is about none. */\n    readonly code: string | undefined;\n}\n\n/** What a run knows of its plan as it goes: a split call's progress, how many pieces it cut, and how its units ran. */\nexport interface PlanRun {\n    /** A split call's progress, while it goes. */\n    readonly progress?: SplitCallProgress | undefined;\n    /** How many pieces it cut, once e3 says. */\n    readonly pieces?: number | undefined;\n    /** How a split call ran, once it answered (#1105): the units it ran, and those the cache served. */\n    readonly report?: SplitCallReport | undefined;\n}\n\n/**\n * How a split call's units ran, in words, once it answered (#1105) — `The\n * cache served 11 of its 14 units, and 3 ran.`; a call the cache served whole\n * consulted no unit, and says so.\n *\n * @param report - how it ran, as e3 reports it\n * @param words - the words\n * @returns the words\n */\nexport function planUnitsWords(report: SplitCallReport, words: QueryWords): string {\n    const f = words.formatters;\n    const ran = Number(report.ran);\n    const cached = Number(report.cached);\n    const units = ran + cached;\n    const kind = units === 0 ? \"whole\" : cached > 0 ? \"some\" : \"none\";\n    return words.messages.planUnits({ kind, cached: f.number(cached), ran: f.number(ran), units: f.number(units), n: units });\n}\n\n/**\n * How far a split run has got, in words — `3 of 12 pieces done`, `1 of 1\n * merges done`.\n *\n * @param progress - its progress, as e3 reports it\n * @param words - the words\n * @returns the words\n */\nexport function planProgressWords(progress: SplitCallProgress, words: QueryWords): string {\n    const f = words.formatters;\n    const units = Number(progress.units);\n    return words.messages.planProgress({ phase: progress.phase.type, done: f.number(Number(progress.done)), units: f.number(units), n: units });\n}\n\n/**\n * A plan's explanation in words: one line per sentence, each with the jq it\n * is about.\n *\n * @param explanation - the plan's explanation (`plan.ts`)\n * @param words - the words\n * @param run - what the run knows of its plan: a split call's progress while\n *   it goes, how many pieces it cut once e3 says, and how its units ran once\n *   it answered\n * @returns the lines, in order\n *\n * @remarks\n * - **The path**, first: a split call over a dataset, estimated faster than\n *   one call or one call holding more memory than it may use (#1143), or the\n *   one a run went on as when its one call's answer was too large for one\n *   (#1113), or, its rows not known, what it weighs, more than one piece — or what the\n *   heaviest dataset cut with it weighs; or one call — estimated faster,\n *   within one piece, a weight not known, a split call that could not be\n *   made, or the reason the query runs as one unit, with the jq the reason is\n *   about.\n * - **The estimates** beside it, when the path was chosen by them (#1143):\n *   one call's time and what it holds, and the memory it may use; the split\n *   call's time, its pieces and how many run at once, and what each holds;\n *   and what they assumed — the rows, those a stream's first rows stop both\n *   paths after, what each costs in one call and in a piece, and what one call\n *   holding every row holds of each. A re-keyed\n *   join says so next, and its re-key stage with the join key and what the\n *   re-keyed rows are estimated to weigh (#942).\n * - **A split's stages**: what each piece runs; the data sources cut at the\n *   same keys with it (#942); how their outputs combine — rows joined;\n *   totals, each by its rule; grouped by a key, each group's totals combined\n *   or its rows collected; the distinct rows; the first row of each key; a\n *   reduce's updates by key, added or the last kept; the first rows of a sort\n *   (#942); what runs once after them; the data sources every piece reads\n *   whole; and the pieces — how far the run has got while it goes, then how\n *   many and about what each weighs, and how the call's units ran: how many\n *   the cache served, or that it served the whole call (#1105).\n * - **The reads that prune**, last: a count from a dataset's index, a key\n *   seek, a stream that stops.\n */\nexport function planWords(explanation: PlanExplanation, words: QueryWords, run: PlanRun = {}): PlanLine[] {\n    const m = words.messages;\n    const f = words.formatters;\n    const jq = (range: JqRange | null): string | undefined => (range === null ? undefined : explanation.program.slice(range.from, range.to));\n    const lines: PlanLine[] = [];\n    const say = (kind: PlanLine[\"kind\"], text: string, code?: string): void => {\n        lines.push({ kind, text, code });\n    };\n    const totals = (list: readonly { readonly range: JqRange; readonly rule: JqTotal[\"rule\"] }[]): void => {\n        for (const total of list) say(\"total\", m.planTotal({ rule: total.rule }), jq(total.range));\n    };\n    // Both paths' estimates and what they assumed, beside the path (#1143).\n    const estimated = (): void => {\n        const e = explanation.estimates;\n        if (e === null) return;\n        const memory = e.memoryBytes === null ? undefined : byteWords(e.memoryBytes, words);\n        say(\"estimate\", m.planEstimateOneCall({\n            seconds: durationWords(e.oneCall.seconds, words), peak: byteWords(e.oneCall.peakBytes, words, 2), memory,\n            over: e.memoryBytes !== null && e.oneCall.peakBytes > e.memoryBytes,\n        }));\n        say(\"estimate\", m.planEstimateSplit({\n            rekey: e.kind === \"rekey\", seconds: durationWords(e.split.seconds, words), pieces: f.number(e.pieces), n: e.pieces, cores: f.number(e.cores),\n            peak: byteWords(e.split.peakBytes, words, 2),\n        }));\n        say(\"estimate\", m.planAssumed({\n            rows: f.number(e.rows), n: e.rows, over: e.over, first: e.firstRows === null ? undefined : { count: f.number(e.firstRows), n: e.firstRows },\n            oneCall: f.number(e.row.oneCallUs), piece: f.number(e.row.pieceUs),\n            held: e.holdsRows ? byteWords(e.row.heldBytes, words) : undefined,\n        }));\n    };\n    const path = explanation.path;\n    if (path.kind === \"one_shot\") {\n        const why = path.why;\n        switch (why.kind) {\n            case \"whole\":\n                say(\"path\", m.planWhole({ code: why.reason.code, name: why.reason.name ?? undefined, at: why.reason.range !== null }), jq(why.reason.range));\n                break;\n            case \"small\":\n                say(\"path\", m.planSmall({ over: why.over, bytes: byteWords(why.bytes, words), piece: byteWords(why.pieceBytes, words) }));\n                break;\n            case \"unweighed\":\n                say(\"path\", m.planUnweighed({ over: why.over }));\n                break;\n            case \"unsplit\":\n                say(\"path\", m.planUnsplit({ message: why.message }));\n                break;\n            case \"faster\":\n                say(\"path\", m.planFaster({ over: why.over }));\n                break;\n        }\n        estimated();\n    } else {\n        say(\"path\", path.why === \"weight\"\n            ? m.planSplit({ over: path.over, heaviest: path.heaviest, bytes: byteWords(path.bytes, words), piece: byteWords(path.pieceBytes, words) })\n            : m.planSplitBy({ over: path.over, why: path.why }));\n        estimated();\n        if (path.rekey !== null) {\n            say(\"rekey\", m.planRekey({ name: path.rekey.name }));\n            say(\"rekey\", m.planRekeyStage({ over: path.over, name: path.rekey.name, bytes: byteWords(path.rekey.bytes, words) }), jq(path.rekey.key));\n        }\n        say(\"piece\", m.planPiece({ over: path.over }), jq(path.stages.piece));\n        if (path.copartitioned.length > 0) {\n            say(\"copartitioned\", m.planCopartitioned({ over: path.over, names: m.list({ items: path.copartitioned }), n: path.copartitioned.length }));\n        }\n        const combine = path.stages.combine;\n        switch (combine.kind) {\n            case \"concat\":\n                say(\"combine\", m.planCombine({ kind: \"concat\" }));\n                break;\n            case \"totals\":\n                say(\"combine\", m.planCombine({ kind: \"totals\" }));\n                totals(combine.totals);\n                break;\n            case \"group\":\n                say(\"combine\", m.planCombine({ kind: \"group\" }), jq(combine.key));\n                if (combine.totals === null) {\n                    say(\"combine\", m.planCombine({ kind: \"groupRows\" }));\n                } else {\n                    say(\"combine\", m.planCombine({ kind: \"groupTotals\" }));\n                    totals(combine.totals);\n                }\n                break;\n            case \"distinct\":\n                say(\"combine\", m.planCombine({ kind: \"distinct\" }), jq(combine.range));\n                break;\n            case \"distinct_by\":\n                say(\"combine\", m.planCombine({ kind: \"distinctBy\" }), jq(combine.key));\n                break;\n            case \"reduce\":\n                say(\"combine\", m.planCombine({ kind: combine.update === \"add\" ? \"reduceAdd\" : \"reduceReplace\" }), jq(combine.key));\n                break;\n            case \"top\":\n                // By the key `sort_by` sorts by, or for `sort` by the rows themselves: the sort and the step that keeps its first rows.\n                say(\"combine\", m.planTop({ count: f.number(combine.rows), n: combine.rows }), jq(combine.key ?? combine.range));\n                break;\n            case \"first\":\n                // The `first` or `limit` that keeps them (#1113).\n                say(\"combine\", m.planFirst({ count: f.number(combine.rows), n: combine.rows }), jq(combine.range));\n                break;\n        }\n        if (path.stages.then !== null) say(\"then\", m.planThen(), jq(path.stages.then));\n        if (path.broadcast.length > 0) say(\"broadcast\", m.planBroadcast({ names: m.list({ items: path.broadcast }) }));\n        if (run.progress !== undefined) {\n            say(\"pieces\", planProgressWords(run.progress, words));\n        } else if (run.pieces !== undefined && run.pieces > 0) {\n            say(\"pieces\", m.planPieces({ over: path.over, count: f.number(run.pieces), n: run.pieces, size: byteWords(Math.round(path.bytes / run.pieces), words) }));\n        }\n        if (run.progress === undefined && run.report !== undefined) say(\"units\", planUnitsWords(run.report, words));\n    }\n    for (const read of explanation.pruning) say(\"pruning\", m.planPruning({ kind: read.kind, name: read.name }), jq(read.range));\n    return lines;\n}\n\n/**\n * A plan's read-out, beside a run's: `One call`; `Split call`, with how far it\n * has got while it goes — `Split call · 3 of 12 pieces done` — and how many\n * pieces it cut once e3 says — `Split call · 12 pieces`; and a re-keyed join's\n * two calls the same way — `Re-keyed join · 12 pieces`, the join call's\n * pieces (#942). Once the call answered, the units the cache served follow —\n * `Split call · 12 pieces · 11 units cached`, `Split call · 12 pieces · all\n * cached` for a call it served whole (#1105).\n *\n * @param planned - the run's plan\n * @param words - the words\n * @param run - what the run knows of its plan\n * @returns the read-out\n */\nexport function planBadge(planned: QueryPlan, words: QueryWords, run: PlanRun = {}): string {\n    const m = words.messages;\n    if (planned.kind === \"one_shot\") return m.planBadge({ kind: \"one_shot\", detail: \"\" });\n    if (run.progress !== undefined) return m.planBadge({ kind: planned.kind, detail: planProgressWords(run.progress, words) });\n    const parts: string[] = [];\n    if (run.pieces !== undefined) parts.push(m.planPieceCount({ count: words.formatters.number(run.pieces), n: run.pieces }));\n    // The units the cache served: none said, and a call it served whole, which consulted none, said so (#1105).\n    const cached = run.report === undefined ? 0 : Number(run.report.cached);\n    const whole = run.report !== undefined && Number(run.report.ran) + cached === 0;\n    if (cached > 0 || whole) parts.push(m.planCachedCount({ count: words.formatters.number(cached), n: cached, whole }));\n    return m.planBadge({ kind: planned.kind, detail: parts.join(\" · \") });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Summaries (#934): what the rows at a step hold, for a slot's offers and a\n * field's summary (`Query Editor Spec.md` §4.5). A summary is #875's summary\n * program (`summaryProgram`) after the program up to the step, which the\n * builder runs as a one-shot call (#935); this module gives the program and\n * keeps the answers. Nothing here reads data: a summary is fetched only when\n * a slot that needs it opens, never on an edit.\n *\n * @packageDocumentation\n */\n\nimport { SummaryType, summaryProgram, type EastType, type ValueTypeOf } from \"@elaraai/east\";\nimport type { StepField } from \"../steps/fields.js\";\nimport { SEP, layOutSteps } from \"../steps/print.js\";\nimport type { Shape } from \"../steps/shape.js\";\nimport { isComplete, type StepQuery } from \"../steps/values.js\";\nimport type { SlotKind } from \"./messages.js\";\nimport { leafPath, type SummaryLeaf } from \"./words.js\";\n\n/** A summary of rows: how many, and each leaf path's summary. */\nexport type Summary = ValueTypeOf<typeof SummaryType>;\n\n/** The limits a summary's run takes: one output, and five seconds. */\nexport const SUMMARY_LIMITS = { maxOutputs: 1, timeoutMs: 5_000 } as const;\n\n/** A summary to fetch: the rows at a step, and the program that summarises them. */\nexport interface SummaryRequest {\n    /** The canonical program of the steps before: what the summary is of, and its cache key. */\n    readonly prefix: string;\n    /** The program to run: the prefix, then the summary. */\n    readonly program: string;\n    /** The shape of the rows it summarises. */\n    readonly shape: Shape;\n    /** The data sources it reads, by name: the source, and each Look up's. */\n    readonly reads: readonly string[];\n}\n\n/**\n * The summary of the rows a step takes.\n *\n * @param query - the query\n * @param stepIndex - the step; the query's length for the rows it gives\n * @param root - the root's type: a struct of the data sources\n * @returns the request, or `undefined` when the rows are not known there: a step before has a problem, or the stage is not rows\n */\nexport function summaryAt(query: StepQuery, stepIndex: number, root: EastType): SummaryRequest | undefined {\n    const prefix: StepQuery = { source: query.source, steps: query.steps.slice(0, stepIndex) };\n    const layout = layOutSteps(prefix, root);\n    const shape = layout.final;\n    if (shape.kind !== \"rows\" || layout.check.diagnostics.some(d => d.severity.type === \"error\")) return undefined;\n    const text = layout.printed.text;\n    const lookups = prefix.steps.flatMap(s => s.type === \"lookup\" && isComplete(s) && s.value.dataset.type === \"some\" ? [s.value.dataset.value] : []);\n    return {\n        prefix: text,\n        program: `${text}${SEP}${summaryProgram(shape.type)}`,\n        shape,\n        reads: [query.source, ...new Set(lookups)],\n    };\n}\n\n/**\n * A field's leaf of a summary.\n *\n * @param summary - the summary of the rows the field is read in\n * @param field - the field\n * @param list - the list field the field is an item's field of, for an inner condition\n * @returns the leaf, or `undefined` when the summary has none for it\n */\nexport function leafOf(summary: Summary | undefined, field: StepField, list?: StepField): SummaryLeaf | undefined {\n    return summary?.leaves.get(leafPath(field, list));\n}\n\n/**\n * Whether a slot's offers come from a summary: a condition's field and\n * value, a field to show, group by, total or sort by, and an input's value.\n *\n * @param slot - the slot's kind\n * @returns whether opening it fetches the summary\n */\nexport function summaryNeeded(slot: SlotKind): boolean {\n    switch (slot) {\n        case \"field\": case \"value\": case \"by\": case \"agg-field\": case \"sort-field\": case \"pick-field\": case \"pick-add\": case \"fill-field\":\n            return true;\n        default:\n            return false;\n    }\n}\n\n/** What a summary's run gave: the summary, and the hash of each data source it read. */\nexport interface SummaryResult {\n    /** The summary. */\n    readonly summary: Summary;\n    /** Each data source read, by name, with the hash the run read. */\n    readonly hashes: ReadonlyMap<string, string>;\n}\n\n/**\n * Runs a summary's program: the builder's one-shot call (#935).\n *\n * @param request - the summary to fetch\n * @returns what it gave, or `undefined` when it failed: the popover then lists no values\n */\nexport type SummaryRun = (request: SummaryRequest) => Promise<SummaryResult | undefined>;\n\n/**\n * The summaries a builder has fetched, while it is mounted: one per prefix,\n * kept with the hashes of the data sources the run read, so a newer dataset\n * misses.\n *\n * @example\n * ```ts\n * const cache = new SummaryCache(request => runOneShot(request.program, SUMMARY_LIMITS));\n * const request = summaryAt(query, 2, root);\n * if (request !== undefined && summaryNeeded(\"value\")) await cache.ensure(request, hashes);\n * const summary = request === undefined ? undefined : cache.get(request, hashes);\n * ```\n */\nexport class SummaryCache {\n    private readonly entries = new Map<string, SummaryResult>();\n    private readonly pending = new Map<string, Promise<Summary | undefined>>();\n\n    /**\n     * @param run - runs a summary's program\n     */\n    constructor(private readonly run: SummaryRun) {}\n\n    /**\n     * The summary of a request, when the cache holds it for the data sources as they are.\n     *\n     * @param request - the request\n     * @param hashes - each data source's current hash, by name; a source not listed is taken as unchanged\n     * @returns the summary, or `undefined` when it has not been fetched, or a source it read has changed since\n     */\n    get(request: SummaryRequest, hashes: ReadonlyMap<string, string>): Summary | undefined {\n        const entry = this.entries.get(request.prefix);\n        if (entry === undefined) return undefined;\n        for (const source of request.reads) {\n            const now = hashes.get(source);\n            if (now !== undefined && entry.hashes.get(source) !== now) return undefined;\n        }\n        return entry.summary;\n    }\n\n    /**\n     * Fetches a request's summary unless the cache holds it: once per prefix\n     * and hashes, however often it is asked for while the run is in flight.\n     *\n     * @param request - the request\n     * @param hashes - each data source's current hash, by name\n     * @returns the summary, or `undefined` when the run failed\n     */\n    ensure(request: SummaryRequest, hashes: ReadonlyMap<string, string>): Promise<Summary | undefined> {\n        const held = this.get(request, hashes);\n        if (held !== undefined) return Promise.resolve(held);\n        const key = `${request.prefix}\\u0000${request.reads.map(s => hashes.get(s) ?? \"\").join(\"\\u0000\")}`;\n        const inFlight = this.pending.get(key);\n        if (inFlight !== undefined) return inFlight;\n        const fetched = this.run(request).then(result => {\n            this.pending.delete(key);\n            if (result === undefined) return undefined;\n            this.entries.set(request.prefix, result);\n            return result.summary;\n        }, () => {\n            this.pending.delete(key);\n            return undefined;\n        });\n        this.pending.set(key, fetched);\n        return fetched;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The query builder's hooks (#935) — what its surfaces use to resolve the\n * root, make a one-shot call and summarise a query, and to keep this viewer's\n * recent runs. A run is `run.ts`'s (#938).\n *\n * - **The root** (`useQueryRoot`): each bound data source as a root field —\n *   its name, its dataset's path and its value's type — in the order given.\n * - **The call** (`useQueryCall`): how a one-shot call is made — against the\n *   `E3Provider`'s server, a run's started and kept as a call of the workspace\n *   (e3-api-client's `oneShotCall`), so it outlives any request and is listed\n *   among the workspace's calls, and a summary's within one request\n *   (`oneShotExecute`); or a host's own ({@link QueryCallProvider}).\n * - **The split call** (`useQuerySplitCall`, #941): how a split call is made —\n *   e3-api-client's `splitCall` against the `E3Provider`'s server, which\n *   launches it, polls it with backoff and reports its progress; or a host's\n *   own ({@link QuerySplitCallProvider}). And how its pieces are counted when\n *   a run answered before e3 reported them (`useQuerySplitExplain`, #1132):\n *   e3-api-client's `splitCallExplain`, or the host's own beside its split\n *   call. And how a split call's output is opened, when its answer was too\n *   large for one (`useQueryCollection`, #1113): e3-api-client's\n *   `collectionOpen`, which reads it a page at a time.\n * - **A data source's status** (`useQuerySourceStatus`, #941): what it weighs\n *   and how many rows it holds, which a run reads before it plans — e3's\n *   dataset status, through the query the Datasets tab polls; or a host's own\n *   ({@link QuerySourceStatusProvider}).\n * - **The plan's options** (`useQueryPlanOptions`, #941): the most a dataset\n *   may weigh and still be read by one call, and what the estimates take of\n *   the server — the memory one call may use and the pieces it runs at once\n *   (#1143) ({@link QueryPlanOptionsProvider}).\n * - **Summaries** (`useQuerySummaries`): #934's summary programs, run the same\n *   way, kept by prefix and the hashes of what they read.\n * - **Recent runs** (`useRecentQueries`): this viewer's last ten, kept in the\n *   browser under the builder's key.\n *\n * @packageDocumentation\n */\n\nimport { createContext, createElement, useCallback, useContext, useMemo, useState, type ReactNode } from \"react\";\nimport { QueryClientContext } from \"@tanstack/react-query\";\nimport {\n    ArrayType, SummaryType, decodeBeast2, equalFor, isValueOf, parseFor, printFor, variant,\n    type ValueTypeOf,\n} from \"@elaraai/east\";\nimport { DataSourceType, SavedQueryType } from \"@elaraai/e3-ui/internal\";\nimport {\n    collectionOpen, datasetGetStatus, oneShotCall, oneShotExecute, splitCall, splitCallExplain, type RemoteCollection, type SplitCallAnswer,\n} from \"@elaraai/e3-api-client\";\nimport {\n    pathToString,\n    type DatasetStatusDetail, type ExecuteResult, type OneShotRequest, type SplitCallPlan, type SplitCallProgress, type SplitCallRequest, type TreePath,\n} from \"@elaraai/e3-types\";\nimport { useDataStable, usePersistedState } from \"@elaraai/east-ui-components\";\nimport { keptRead } from \"@elaraai/east-ui-components/internal\";\nimport { e3RequestOptions, useE3ConfigOptional, type E3Config } from \"../platform/e3-config.js\";\nimport { pagedSourceOf } from \"../platform/paged-runtime.js\";\nimport { SUMMARY_LIMITS, SummaryCache, type Summary, type SummaryRequest } from \"./model/summaries.js\";\nimport type { QueryWords } from \"./model/words.js\";\nimport { prepareQuery, queryResultOf, queryRoot, type QueryRoot, type QueryRootEntry } from \"./one-shot.js\";\nimport type { PlanOptions } from \"./plan.js\";\n\n/** A data source the builder is handed. */\nexport type DataSource = ValueTypeOf<typeof DataSourceType>;\n/** A saved query, or a recent run of one. */\ntype SavedQuery = ValueTypeOf<typeof SavedQueryType>;\n\nconst sourcesEqual = equalFor(ArrayType(DataSourceType));\nconst printSaved = printFor(SavedQueryType);\nconst parseSaved = parseFor(SavedQueryType);\nconst savedEqual = equalFor(SavedQueryType);\n\n// ============================================================================\n// The root\n// ============================================================================\n\n/**\n * The root a builder's queries read: each bound data source as a root field,\n * in the order given — or why it cannot be queried, in the builder's words.\n *\n * @remarks\n * A `Data.bind` source is its dataset's path, a record `[records, name]`, and a\n * `Data.bindPaged` source the path its handle was bound with, which the paged\n * runtime that built it holds. A paged source read through one of a record's\n * indexes is refused: its rows are the index's, not the record's a query reads.\n *\n * @param datasets - The data sources, as the payload holds them\n * @param words - The words, for a refusal\n * @returns The root, or the refusal\n */\nexport function useQueryRoot(datasets: DataSource[], words: QueryWords): QueryRoot | string {\n    // The sources' identity is their data: a new payload with the same sources keeps the root.\n    const stable = useDataStable(datasets, sourcesEqual);\n    const m = words.messages;\n    return useMemo(() => resolveRoot(stable, m), [stable, m]);\n}\n\n/** The root of the data sources, or the first reason one cannot be queried. */\nfunction resolveRoot(datasets: readonly DataSource[], m: QueryWords[\"messages\"]): QueryRoot | string {\n    const entries: QueryRootEntry[] = [];\n    for (const source of datasets) {\n        let path: TreePath;\n        switch (source.source.type) {\n            case \"value\":\n                path = source.source.value;\n                break;\n            case \"record\":\n                path = [variant(\"field\", \"records\"), variant(\"field\", source.source.value)];\n                break;\n            case \"paged\": {\n                const bound = pagedSourceOf(source.source.value);\n                if (bound === undefined) return m.sourceUnbound({ name: source.name });\n                if (bound.selector.index !== null) return m.sourceThroughIndex({ name: source.name, index: bound.selector.index });\n                path = bound.path;\n                break;\n            }\n        }\n        entries.push({ name: source.name, path, type: source.type });\n    }\n    try {\n        return queryRoot(entries);\n    } catch (err) {\n        return err instanceof Error ? err.message : String(err);\n    }\n}\n\n// ============================================================================\n// The call\n// ============================================================================\n\n/** How a one-shot call is made ({@link QueryCall}): a run's, or a summary's. */\nexport interface QueryCallOptions {\n    /**\n     * Whether the call is a run's: started and kept by the server as a call of\n     * the workspace, held to no request's deadline and listed among its calls,\n     * rather than made within one request, as a summary's is. Default `false`.\n     */\n    readonly run?: boolean;\n    /**\n     * Gives the call up: it rejects with the signal's reason, and a run's call\n     * is asked to stop on the server, which ends it `cancelled`.\n     */\n    readonly signal?: AbortSignal;\n}\n\n/**\n * Makes a one-shot call: the request, answered by the call's result.\n *\n * @param request - The request — a query's or a summary's, platform-free\n * @param options - Whether it is a run's, and the signal that gives it up\n * @returns The result\n *\n * @remarks\n * It rejects with e3-api-client's `ApiError` or `AuthError` when the server\n * refuses the call — `internal` for a run's call someone cancelled, or the\n * server lost — and with a `TypeError` when the server cannot be reached, as\n * `fetch` does; and with the signal's reason once it is given up.\n */\nexport type QueryCall = (request: OneShotRequest, options?: QueryCallOptions) => Promise<ExecuteResult>;\n\nconst QueryCallContext = createContext<QueryCall | null>(null);\n\n/** Props of {@link QueryCallProvider}. */\nexport interface QueryCallProviderProps {\n    /** How a one-shot call is made for the subtree. */\n    call: QueryCall;\n    /** The subtree. */\n    children?: ReactNode;\n}\n\n/**\n * Makes the query builder's one-shot calls with a host's own function — a\n * test's, or a host that reaches e3 another way.\n *\n * @param props - The call and the subtree\n * @returns The provider\n */\nexport function QueryCallProvider({ call, children }: QueryCallProviderProps) {\n    return createElement(QueryCallContext.Provider, { value: call }, children);\n}\n\n/**\n * How the builder makes a one-shot call: a {@link QueryCallProvider}'s, else\n * against the `E3Provider`'s server and workspace, with its token and through\n * its `fetch`: a run's by e3-api-client's `oneShotCall`, started and kept as a\n * call of the workspace, polled to its end and stopped once its signal\n * aborts, so a run takes as long as its limits allow, never a request's\n * deadline; a summary's by `oneShotExecute`, within one request, and kept by\n * nothing.\n *\n * @returns The call, or `undefined` when there is no server to call\n */\nexport function useQueryCall(): QueryCall | undefined {\n    const provided = useContext(QueryCallContext);\n    const config = useE3ConfigOptional();\n    return useMemo((): QueryCall | undefined => {\n        if (provided !== null) return provided;\n        if (config === null || config.workspace === undefined) return undefined;\n        const { apiUrl, workspace } = config;\n        const repo = config.repo ?? \"default\";\n        return (request, options) => (options?.run === true\n            ? oneShotCall(apiUrl, repo, workspace, request, e3RequestOptions(config), {\n                ...(options.signal !== undefined && { signal: options.signal }),\n            })\n            : oneShotExecute(apiUrl, repo, workspace, request, e3RequestOptions(config)));\n    }, [provided, config]);\n}\n\n// ============================================================================\n// The split call (#941)\n// ============================================================================\n\n/** What a split call is given: the signal that gives it up, and where its progress goes. */\nexport interface QuerySplitCallOptions {\n    /**\n     * Gives the call up: it stops polling, its job is cancelled, so e3 stops\n     * its units (#1104), and it rejects with the signal's reason. The units\n     * that finished are cached, so a run of the same call again is served them.\n     */\n    readonly signal: AbortSignal;\n    /** Told the call's progress each time e3 reports it: its stage, and the units of it done of all. */\n    readonly onProgress: (progress: SplitCallProgress) => void;\n}\n\n/**\n * Makes a split call: the request, answered once its job ends by the call's\n * result — read as a one-shot call's is — the hash of its assembled output,\n * which a re-keyed join's second call reads (#942) and a result too large for\n * one answer is read a page at a time from (#1113), and how it ran: its\n * pieces, and the units it ran and the cache served (#1105).\n *\n * @param request - The request — a plan's, platform-free (`splitCallRequest`,\n *   `rekeyCallRequests`)\n * @param options - The signal that gives it up, and where its progress goes\n * @returns The call's result, its assembled output's hash once its pieces ran\n *   (`null` before), and its report (`null` when the call reports none)\n *\n * @remarks\n * It rejects with e3-api-client's `ApiError` or `AuthError` when the server\n * refuses the call, with a `TypeError` when the server cannot be reached, as\n * `fetch` does, and with any other error when e3 could not run it (a job that\n * ended `failed`); and with the signal's reason once it is given up, its job\n * cancelled (#1104).\n */\nexport type QuerySplitCall = (request: SplitCallRequest, options: QuerySplitCallOptions) => Promise<SplitCallAnswer>;\n\n/**\n * Plans a split call's pieces without running it: e3's explain, a job that\n * plans them as the call's run plans them and runs no unit, so the count is\n * the run's (#1132).\n *\n * @param request - The call, as its run sent it\n * @param options - The signal that abandons it\n * @returns How many pieces, the argument they are cut over, by its position,\n *   and what that argument weighs in the store\n *\n * @remarks\n * It rejects as a split call does ({@link QuerySplitCall}), and with an\n * `Error` naming what is wrong when e3 finds the call wrong.\n */\nexport type QuerySplitExplain = (request: SplitCallRequest, options: { readonly signal: AbortSignal }) => Promise<SplitCallPlan>;\n\nconst QuerySplitCallContext = createContext<QuerySplitCall | null>(null);\nconst QuerySplitExplainContext = createContext<QuerySplitExplain | null>(null);\n\n/** Props of {@link QuerySplitCallProvider}. */\nexport interface QuerySplitCallProviderProps {\n    /** How a split call is made for the subtree. */\n    call: QuerySplitCall;\n    /**\n     * How the subtree's split calls' pieces are counted when a run answered\n     * before its call reported them (#1132): the in-memory call's `explain`,\n     * say. Without it, such a run's pieces go uncounted.\n     */\n    explain?: QuerySplitExplain;\n    /** The subtree. */\n    children?: ReactNode;\n}\n\n/**\n * Makes the query builder's split calls with a host's own function — a\n * test's (`createInMemorySplitCall`), or a host that reaches e3 another way —\n * and counts their pieces with the host's explain, when it gives one.\n *\n * @param props - The call, its explain and the subtree\n * @returns The provider\n */\nexport function QuerySplitCallProvider({ call, explain, children }: QuerySplitCallProviderProps) {\n    return createElement(QuerySplitCallContext.Provider, { value: call },\n        createElement(QuerySplitExplainContext.Provider, { value: explain ?? null }, children));\n}\n\n/**\n * How the builder makes a split call: a {@link QuerySplitCallProvider}'s, else\n * e3-api-client's `splitCall` against the `E3Provider`'s server and workspace,\n * with its token and through its `fetch`, which launches the call, polls it —\n * 100 ms apart at first, backing off to a second — reports each progress it\n * finds, and cancels the job once its signal aborts (#1104).\n *\n * @returns The call, or `undefined` when there is no server to call\n */\nexport function useQuerySplitCall(): QuerySplitCall | undefined {\n    const provided = useContext(QuerySplitCallContext);\n    const config = useE3ConfigOptional();\n    return useMemo((): QuerySplitCall | undefined => {\n        if (provided !== null) return provided;\n        if (config === null || config.workspace === undefined) return undefined;\n        const { apiUrl, workspace } = config;\n        const repo = config.repo ?? \"default\";\n        return (request, { signal, onProgress }) => splitCall(apiUrl, repo, workspace, request, e3RequestOptions(config), { signal, onProgress });\n    }, [provided, config]);\n}\n\n/**\n * How the builder counts a split call's pieces when its run answered before\n * e3 reported them (#1132): a {@link QuerySplitCallProvider}'s explain — a\n * host's split calls are explained by the host, or not at all — else\n * e3-api-client's `splitCallExplain` against the `E3Provider`'s server and\n * workspace, with its token and through its `fetch`, which launches the\n * explain and polls it until it has planned.\n *\n * @returns The explain, or `undefined` when there is none to make\n */\nexport function useQuerySplitExplain(): QuerySplitExplain | undefined {\n    const host = useContext(QuerySplitCallContext);\n    const provided = useContext(QuerySplitExplainContext);\n    const config = useE3ConfigOptional();\n    return useMemo((): QuerySplitExplain | undefined => {\n        if (host !== null) return provided ?? undefined;\n        if (config === null || config.workspace === undefined) return undefined;\n        const { apiUrl, workspace } = config;\n        const repo = config.repo ?? \"default\";\n        return (request, { signal }) => splitCallExplain(apiUrl, repo, workspace, request, e3RequestOptions(config), { signal });\n    }, [host, provided, config]);\n}\n\n// ============================================================================\n// A split call's output, opened (#1113)\n// ============================================================================\n\n/**\n * Opens a stored collection by its hash, to read it a window at a time: the\n * output of a split call whose answer was too large for one (#1113).\n *\n * @param hash - The collection's hash: its manifest's, as the call's answer names it\n * @returns The collection — its type, how many elements it holds, and a\n *   window of them as beast2\n *\n * @remarks\n * It rejects as e3-api-client's `collectionOpen` does: with an `ApiError` for\n * a manifest the repository does not hold, and with an `Error` for an object\n * that is no collection.\n */\nexport type QueryCollection = (hash: string) => Promise<RemoteCollection>;\n\n/**\n * How the builder opens a split call's output whose answer was too large for\n * one (#1113): e3-api-client's `collectionOpen` against the `E3Provider`'s\n * server, with its token and through its `fetch`, which reads the manifest\n * once and each window from the segments it overlaps. A host's split calls\n * (a {@link QuerySplitCallProvider}'s) are not e3's, so their outputs are not\n * opened: such an answer stays too large.\n *\n * @returns The opener, or `undefined` when there is none to open with\n */\nexport function useQueryCollection(): QueryCollection | undefined {\n    const host = useContext(QuerySplitCallContext);\n    const config = useE3ConfigOptional();\n    return useMemo((): QueryCollection | undefined => {\n        if (host !== null) return undefined;\n        if (config === null || config.workspace === undefined) return undefined;\n        const { apiUrl } = config;\n        const repo = config.repo ?? \"default\";\n        return (hash) => collectionOpen(apiUrl, repo, hash, e3RequestOptions(config));\n    }, [host, config]);\n}\n\n// ============================================================================\n// A data source's status (#941)\n// ============================================================================\n\n/** What e3's status says of a data source: how many rows it holds, its hash, and what it weighs. */\nexport interface SourceStatus {\n    /** How many elements a stored list or lookup table holds; `undefined` for a value that is not a collection, or not known. */\n    readonly rows: number | undefined;\n    /** The hash of its value; `undefined` when it has none, or it is not known. */\n    readonly hash: string | undefined;\n    /** What its value weighs in the store, in bytes — a collection's segments and its manifest; `undefined` when not known. */\n    readonly bytes: number | undefined;\n}\n\n/**\n * Reads a data source's status: what a run weighs before it plans.\n *\n * @param path - The dataset's path, as the root holds it\n * @returns Its status\n */\nexport type QuerySourceStatus = (path: TreePath) => Promise<SourceStatus>;\n\nconst QuerySourceStatusContext = createContext<QuerySourceStatus | null>(null);\n\n/** Props of {@link QuerySourceStatusProvider}. */\nexport interface QuerySourceStatusProviderProps {\n    /** How a data source's status is read for the subtree. */\n    status: QuerySourceStatus;\n    /** The subtree. */\n    children?: ReactNode;\n}\n\n/**\n * Reads the data sources' statuses with a host's own function — a test's, or\n * a host's over datasets in memory (`createInMemorySourceStatus`).\n *\n * @param props - The status and the subtree\n * @returns The provider\n */\nexport function QuerySourceStatusProvider({ status, children }: QuerySourceStatusProviderProps) {\n    return createElement(QuerySourceStatusContext.Provider, { value: status }, children);\n}\n\n/** How long a status a run reads stays fresh: as long as the Datasets tab waits to poll it again. */\nconst STATUS_FRESH_MS = 5_000;\n\n/** A data source's status query, as TanStack Query takes it: its key, and its function. */\nexport interface SourceStatusQuery {\n    /** Its key: the server, the repository, the workspace and the dataset's path. */\n    readonly queryKey: readonly unknown[];\n    /** Its function: e3-api-client's `datasetGetStatus`. */\n    readonly queryFn: () => Promise<DatasetStatusDetail>;\n}\n\n/**\n * A data source's status query on e3, as TanStack Query takes it: the Datasets\n * tab polls it, and a run reads it through the same cache before it plans.\n *\n * @param config - The server: its token, and the `fetch` its requests go through\n * @param workspace - The workspace\n * @param path - The dataset's path\n * @returns The query's key, and its function: e3-api-client's `datasetGetStatus`\n */\nexport function sourceStatusQuery(config: E3Config, workspace: string, path: TreePath): SourceStatusQuery {\n    const { apiUrl } = config;\n    const repo = config.repo ?? \"default\";\n    return {\n        queryKey: [\"querySourceStatus\", apiUrl, repo, workspace, pathToString(path)],\n        queryFn: () => datasetGetStatus(apiUrl, repo, workspace, path, e3RequestOptions(config)),\n    };\n}\n\n/**\n * A data source's status, as e3's dataset status gives it.\n *\n * @param detail - The dataset's status detail\n * @returns Its rows, hash and stored bytes\n */\nexport function sourceStatusOf(detail: DatasetStatusDetail): SourceStatus {\n    return {\n        rows: detail.rows.type === \"none\" ? undefined : Number(detail.rows.value),\n        hash: detail.hash.type === \"none\" ? undefined : detail.hash.value,\n        bytes: detail.size.type === \"none\" ? undefined : Number(detail.size.value),\n    };\n}\n\n/**\n * How the builder reads a data source's status: a\n * {@link QuerySourceStatusProvider}'s, else e3's dataset status against the\n * `E3Provider`'s server and workspace, through the TanStack Query cache the\n * Datasets tab polls, a status read in the last 5 seconds serving again.\n *\n * @returns The status, or `undefined` when there is no server to ask\n */\nexport function useQuerySourceStatus(): QuerySourceStatus | undefined {\n    const provided = useContext(QuerySourceStatusContext);\n    const config = useE3ConfigOptional();\n    const client = useContext(QueryClientContext);\n    return useMemo((): QuerySourceStatus | undefined => {\n        if (provided !== null) return provided;\n        if (config === null || config.workspace === undefined) return undefined;\n        const workspace = config.workspace;\n        return async (path) => {\n            const query = sourceStatusQuery(config, workspace, path);\n            const detail = client === undefined ? await query.queryFn() : await client.fetchQuery({ ...query, staleTime: STATUS_FRESH_MS });\n            return sourceStatusOf(detail);\n        };\n    }, [provided, config, client]);\n}\n\n// ============================================================================\n// The plan's options (#941)\n// ============================================================================\n\n/** The builder's plan's options: the default, e3's smallest piece. */\nconst NO_PLAN_OPTIONS: PlanOptions = {};\n\nconst QueryPlanOptionsContext = createContext<PlanOptions>(NO_PLAN_OPTIONS);\n\n/** Props of {@link QueryPlanOptionsProvider}. */\nexport interface QueryPlanOptionsProviderProps {\n    /**\n     * The most a dataset may weigh, in stored bytes, and still be read by one\n     * call: e3's smallest piece (`PIECE_SIZES.min`, 16 MiB) when omitted. A\n     * host over a server that cuts small pieces (`E3_TEST_PIECE_BYTES`) sets\n     * it small, so its runs split: a run it plans is by weight alone.\n     */\n    pieceBytes?: number;\n    /**\n     * The memory one call may use, in bytes (#1143): a run whose one call is\n     * estimated to hold more is split. When omitted, a run takes the path\n     * estimated faster.\n     */\n    memoryBytes?: number;\n    /** How many pieces the server runs at once — its budget's cores (#1143): the planner's assumption when omitted. */\n    cores?: number;\n    /** The subtree. */\n    children?: ReactNode;\n}\n\n/**\n * Sets how the query builder plans its runs for a subtree: the most a dataset\n * may weigh and still be read by one call, and what the estimates take of the\n * server (#1143).\n *\n * @param props - The options and the subtree\n * @returns The provider\n */\nexport function QueryPlanOptionsProvider({ pieceBytes, memoryBytes, cores, children }: QueryPlanOptionsProviderProps) {\n    const value = useMemo((): PlanOptions => (pieceBytes === undefined && memoryBytes === undefined && cores === undefined\n        ? NO_PLAN_OPTIONS\n        : {\n            ...(pieceBytes === undefined ? {} : { pieceBytes }),\n            ...(memoryBytes === undefined ? {} : { memoryBytes }),\n            ...(cores === undefined ? {} : { cores }),\n        }), [pieceBytes, memoryBytes, cores]);\n    return createElement(QueryPlanOptionsContext.Provider, { value }, children);\n}\n\n/**\n * How the builder plans its runs: a {@link QueryPlanOptionsProvider}'s options,\n * else the defaults.\n *\n * @returns The options\n */\nexport function useQueryPlanOptions(): PlanOptions {\n    return useContext(QueryPlanOptionsContext);\n}\n\n// ============================================================================\n// Summaries\n// ============================================================================\n\n/**\n * The builder's summaries: #934's summary programs, each run as a one-shot\n * call with small limits when a slot that needs it opens, and kept by prefix\n * and the hashes of the datasets it read. A summary that fails leaves the\n * slot's offers without values.\n *\n * @param root - The root, or why it cannot be queried\n * @param call - How a one-shot call is made\n * @returns The cache, and the latest hash of each data source a run has read\n */\nexport function useQuerySummaries(root: QueryRoot | string, call: QueryCall | undefined): { cache: SummaryCache; hashes: ReadonlyMap<string, string> } {\n    const [hashes, setHashes] = useState<ReadonlyMap<string, string>>(new Map());\n    const cache = useMemo(() => new SummaryCache(async (request: SummaryRequest) => {\n        if (typeof root === \"string\" || call === undefined) return undefined;\n        const prepared = prepareQuery(request.program, root, SUMMARY_LIMITS);\n        if (\"result\" in prepared) return undefined;\n        const result = queryResultOf(prepared.prepared, await call(prepared.prepared.request));\n        if (result.outcome.type !== \"ok\") return undefined;\n        const decoded = decodeBeast2(result.outcome.value.result);\n        if (!isValueOf(decoded.value, SummaryType)) return undefined;\n        const read = new Map(result.inputs.map(input => [input.name, input.hash]));\n        setHashes(previous => new Map([...previous, ...read]));\n        return { summary: decoded.value as Summary, hashes: read };\n    }), [root, call]);\n    return { cache, hashes };\n}\n\n// ============================================================================\n// Recent runs\n// ============================================================================\n\n/** How many recent runs a viewer keeps. */\nexport const RECENT_RUNS = 10;\n\n/**\n * This viewer's recent runs, newest first, kept in the browser under the\n * builder's key — each a saved query's form, printed as East text. A query run\n * again moves to the front.\n *\n * @param key - The builder's recent-runs key (`queryKeys(id).recent`)\n * @returns The runs, and `remember(run)`\n */\nexport function useRecentQueries(key: string): { recent: readonly SavedQuery[]; remember: (run: SavedQuery) => void } {\n    const { state, setState } = usePersistedState<string[]>(key, [], keptRead.array(keptRead.string));\n    const recent = useMemo(() => state.flatMap((text) => {\n        const read = parseSaved(text);\n        return read.success ? [read.value] : [];\n    }), [state]);\n    const remember = useCallback((run: SavedQuery) => {\n        const text = printSaved(run);\n        setState(previous => [text, ...previous.filter((other) => {\n            const read = parseSaved(other);\n            // The same query, run before, gives way to this run.\n            return read.success && !savedEqual({ ...read.value, saved_at: run.saved_at }, run);\n        })].slice(0, RECENT_RUNS));\n    }, [setState]);\n    return { recent, remember };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The pane's Datasets tab (#939, `Query Editor Spec.md` §4.9) — the data\n * sources the builder is handed, as a `Library`, as Studio's Components tab is\n * one of the components a surface lists:\n *\n * - **groups** by kind: Rows (lists), Lookups (lookup tables), Values (trees\n *   and records) and Models (calculations), each with its count;\n * - **an item**: its kind's icon, its name, and under it its size and its\n *   hash — \"40 orders · #4f2a1c8d\", \"8 customers by ID\", \"one tree\", \"price,\n *   region → number\" — the count of a list or a lookup table and the hash from\n *   the dataset's status on e3, once it loads; and, trailing, **Source** or\n *   **Looked up** where the open query reads it, the item placed;\n * - **a click** starts a new query on it.\n *\n * With no e3 server — a test, an offline host — nothing is fetched, and an\n * item says only what its type says.\n *\n * @packageDocumentation\n */\n\nimport { memo, useMemo } from \"react\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { none, some, type EastType } from \"@elaraai/east\";\nimport { EastChakraLibrary, type LibraryItemValue, type LibraryValue } from \"@elaraai/east-ui-components\";\nimport { useE3ConfigOptional, type E3Config } from \"../platform/e3-config.js\";\nimport { sourceStatusOf, sourceStatusQuery, type SourceStatus } from \"./hooks.js\";\nimport { human, plainKind, plural, type QueryWords } from \"./model/words.js\";\nimport type { QueryRoot } from \"./one-shot.js\";\nimport { optionPayload, singular } from \"./steps/shape.js\";\nimport { fromEastTypeValue } from \"@elaraai/east\";\n\n/** A kind of data source: the Datasets tab's group. */\nexport type SourceKind = \"rows\" | \"lookups\" | \"values\" | \"models\";\n\n/** The groups, in the order the tab shows them. */\nconst KIND_ORDER: readonly SourceKind[] = [\"rows\", \"lookups\", \"values\", \"models\"];\n\n/** How the open query reads a data source: as its source, or looked up. */\nexport type SourceRole = \"source\" | \"lookedUp\";\n\n/** A data source not read yet: nothing known of it. */\nconst UNREAD: SourceStatus = { rows: undefined, hash: undefined, bytes: undefined };\n\n/** How many characters of a hash an item shows. */\nconst HASH_CHARS = 8;\n\n/**\n * What a data source is, by its type: its group and its icon.\n *\n * @param type - its type\n * @returns the group and the icon\n */\nexport function sourceKind(type: EastType): { kind: SourceKind; icon: string } {\n    const payload = optionPayload(type);\n    if (payload !== undefined) return sourceKind(payload);\n    switch (type.type) {\n        case \"Array\": case \"Set\": case \"Vector\": return { kind: \"rows\", icon: \"table-list\" };\n        case \"Dict\": return { kind: \"lookups\", icon: \"key\" };\n        case \"Recursive\": return { kind: \"values\", icon: \"sitemap\" };\n        case \"Function\": case \"AsyncFunction\": return { kind: \"models\", icon: \"calculator\" };\n        default: return { kind: \"values\", icon: \"cube\" };\n    }\n}\n\n/**\n * A data source's size in words: a list's or a lookup table's count, once its\n * status gives one; a tree, a record, a calculation's inputs and result, or a\n * value's kind otherwise.\n *\n * @param name - its name, which names its items\n * @param type - its type\n * @param rows - how many elements its status counts, if it does\n * @param words - the words\n * @returns the size, or `\"\"` for a list or a lookup table not counted yet\n */\nexport function sourceSize(name: string, type: EastType, rows: number | undefined, words: QueryWords): string {\n    const m = words.messages;\n    const payload = optionPayload(type);\n    if (payload !== undefined) return sourceSize(name, payload, rows, words);\n    const noun = (n: number): string => (n === 1 ? human(singular(name)) : plural(human(singular(name))));\n    switch (type.type) {\n        case \"Array\": case \"Set\": case \"Vector\":\n            return rows === undefined ? \"\" : m.sourceRows({ count: words.formatters.number(rows), noun: noun(rows) });\n        case \"Dict\":\n            return rows === undefined ? \"\" : m.sourceLookup({ count: words.formatters.number(rows), noun: noun(rows) });\n        case \"Recursive\":\n            return m.sourceTree();\n        case \"Function\": case \"AsyncFunction\": {\n            const inputs = type.inputs as EastType[];\n            const only = inputs.length === 1 ? inputs[0]! : undefined;\n            const names = only !== undefined && only.type === \"Struct\"\n                ? Object.keys(only.fields as Record<string, EastType>).map(human)\n                : inputs.map((input) => plainKind(input, words));\n            return m.sourceModel({ inputs: m.list({ items: names }).replace(/ and /, \", \"), output: plainKind(type.output as EastType, words) });\n        }\n        case \"Struct\":\n            return m.sourceRecord();\n        default:\n            return plainKind(type, words);\n    }\n}\n\n/** Props of {@link DatasetsTab}. */\nexport interface DatasetsTabProps {\n    /** The data sources, as the root holds them. */\n    readonly root: QueryRoot;\n    /** How the open query reads each data source it reads, by name. */\n    readonly reads: ReadonlyMap<string, SourceRole>;\n    /** Starts a new query on a data source. */\n    readonly onStart: (name: string) => void;\n    /** The tab's library's id. */\n    readonly id: string;\n    /** The words. */\n    readonly words: QueryWords;\n    /** Where the library keeps its state. */\n    readonly storageKey: string;\n}\n\n/** No statuses: a host with no e3 server. */\nconst NO_STATUSES: ReadonlyMap<string, SourceStatus> = new Map();\n\n/**\n * Renders the Datasets tab — see the module docs.\n *\n * @param props - The data sources, how the open query reads them, and what a click does ({@link DatasetsTabProps})\n * @returns The tab's library\n */\nexport const DatasetsTab = memo(function DatasetsTab(props: DatasetsTabProps) {\n    const config = useE3ConfigOptional();\n    // Statuses come from e3 through the provider's query client; with none, there is nothing to ask.\n    if (config === null || config.workspace === undefined) return <DatasetsLibrary {...props} statuses={NO_STATUSES} />;\n    return <DatasetsWithStatus {...props} config={config} workspace={config.workspace} />;\n});\n\n/** The tab over e3: each data source's status polled — the query a run reads through too — and the library over them. */\nfunction DatasetsWithStatus({ config, workspace, ...props }: DatasetsTabProps & { config: E3Config; workspace: string }) {\n    const results = useQueries({\n        queries: props.root.entries.map((entry) => ({ ...sourceStatusQuery(config, workspace, entry.path), refetchInterval: 5000 })),\n    });\n    const statuses = useMemo(() => new Map(props.root.entries.map((entry, i): [string, SourceStatus] => {\n        const detail = results[i]?.data;\n        return [entry.name, detail === undefined ? UNREAD : sourceStatusOf(detail)];\n    })), [props.root, results]);\n    return <DatasetsLibrary {...props} statuses={statuses} />;\n}\n\n/** The tab's library, over the data sources' statuses. */\nfunction DatasetsLibrary({ root, reads, onStart, id, words, storageKey, statuses }: DatasetsTabProps & { statuses: ReadonlyMap<string, SourceStatus> }) {\n    const m = words.messages;\n    const value = useMemo((): LibraryValue => {\n        const items = root.entries.map((entry) => {\n            const type = fromEastTypeValue(entry.type);\n            const { kind, icon } = sourceKind(type);\n            const status = statuses.get(entry.name);\n            const size = sourceSize(entry.name, type, status?.rows, words);\n            const hash = status?.hash?.slice(0, HASH_CHARS);\n            const meta = size === \"\" && hash === undefined ? undefined : m.sourceMeta({ size, hash });\n            const role = reads.get(entry.name);\n            const item: LibraryItemValue = {\n                key: entry.name,\n                label: entry.name,\n                sublabel: meta === undefined ? none : some(meta),\n                icon: some(icon),\n                status: none,\n                // A placed card draws its glyph in the brand ink.\n                trailing: role === undefined ? none : some({ icon: role === \"source\" ? \"play\" : \"arrow-right-arrow-left\", label: m.sourceRole({ role }), tone: none }),\n                draggable: false,\n                filtered: false,\n                placed: role !== undefined,\n                media: none,\n                avatar: none,\n                byline: none,\n                action: none,\n                search: some(entry.name),\n                groups: new Map([[\"kind\", m.datasetGroup({ kind })]]),\n                facets: new Map(),\n                dims: new Map(),\n            };\n            return { kind, item };\n        });\n        // The groups in their order; each group's sources in the order the builder is handed them.\n        const ordered = KIND_ORDER.flatMap((kind) => items.filter((i) => i.kind === kind).map((i) => i.item));\n        return {\n            id,\n            hint: none,\n            items: ordered,\n            groupOptions: [{ key: \"kind\", label: m.tab({ tab: \"datasets\" }) }],\n            groupSummaries: new Map(),\n            dimOptions: [],\n            defaultDimensions: [],\n            filterOptions: [],\n            searchable: true,\n            noun: some({ singular: m.dataSourceNoun({ n: 1 }), plural: m.dataSourceNoun({ n: 2 }) }),\n            addLabel: none,\n            onAdd: none,\n            onCardClick: some((key: string) => { onStart(key); return null; }),\n            slice: none,\n            style: some({ height: some(\"fill\"), maxHeight: none, virtualization: some(false), columns: none, mediaPlacement: none, mediaSize: none }),\n            variant: none,\n            layout: none,\n            toolbar: true,\n        };\n    }, [root, reads, onStart, id, words, m, statuses]);\n    return <EastChakraLibrary value={value} storageKey={storageKey} />;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Dropping a query into the builder (#939, `Query Editor Spec.md` §4.13): a\n * card of a `<Query.Library>` dragged onto the builder opens its query, as\n * Studio's canvas takes the palette's cards — through the shared drag layer.\n *\n * - **The target** is the builder's, named by its id. It takes `add`s from\n *   the query library that shares the id (`queryKeys(id).library`, the cards\n *   keyed by the saved query's name) on one cell: the builder's frame\n *   (#1125) — its toolbar, the pane, the results and the status line.\n * - **Its veto** takes a card whose query can open here and refuses any\n *   other: the ⊘ stage. The cell's name is what the drag layer says the drag\n *   rests over, so a refused card's name carries the builder's reason, and the\n *   layer announces it.\n * - **A drop** opens the dropped query.\n * - **Its look** is the `queryBuilder` recipe's `dropTarget` over the frame:\n *   armed while a card it takes is dragged, over while one rests on it — pure\n *   CSS on the layer's `data-drop-valid` / `data-drop-active` — with \"Drop to\n *   open “{name}”\" and \"{n} steps.\", the name kept from the veto's candidate.\n *\n * Without a `DragLayerProvider` on the page there is no target: the frame\n * renders alone, as it would without one.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useState, type ReactElement, type ReactNode } from \"react\";\nimport { Box, useSlotRecipe } from \"@chakra-ui/react\";\nimport { queryKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    useDragLayerOptional, useDragTarget, useDropCell,\n    type CellCoord, type DragEventValue, type DragTargetConfig, type DropCellOptions, type DropVeto,\n} from \"@elaraai/east-ui-components\";\nimport type { QueryWords } from \"./model/words.js\";\nimport type { Styles } from \"./parts.js\";\n\n/** The drop target's one cell's row: the builder's body, in its frame. */\nconst BODY = \"body\";\n\n/**\n * The builder's drop target's id: the builder's name, as `queryKeys` names\n * the builder's keys — so two builders on one surface are two targets.\n *\n * @param id - The builder's id; omitted, the one builder\n * @returns The target's id\n */\nfunction dropTargetId(id: string | undefined): string {\n    return id === undefined ? \"query.builder\" : `query.builder.${id}`;\n}\n\n/** Props of {@link QueryDropTarget}. */\nexport interface QueryDropTargetProps {\n    /** The builder's id (`queryKeys(id)`'s), naming its drop target. */\n    readonly id: string | undefined;\n    /** Why a query of a name can't open here, in the builder's words; undefined when it can. */\n    readonly refusal: (name: string) => string | undefined;\n    /** How many steps the query of a name has, for the target's words; undefined when unknown. */\n    readonly steps: (name: string) => number | undefined;\n    /** Opens the query of a name — what dropping it does. */\n    readonly onOpen: (name: string) => void;\n    /** The words. */\n    readonly words: QueryWords;\n    /** The builder's frame: the toolbar, the pane, the results and the status line. */\n    readonly children: ReactNode;\n}\n\n/**\n * The builder's frame as a drop target for the query library's cards — see\n * the module docs. The builder wraps its frame in it: with a drag layer on the\n * page the frame sits in the target's zone, which takes the frame's place;\n * without one, the frame renders alone.\n *\n * @param props - The builder's id, the refusal and the steps of a query by name, what a drop does, the words and the frame ({@link QueryDropTargetProps})\n * @returns The frame, in its drop zone when a drag layer is on the page\n */\nexport function QueryDropTarget({ id, refusal, steps, onOpen, words, children }: QueryDropTargetProps): ReactElement {\n    const layer = useDragLayerOptional();\n    const styles = useSlotRecipe({ key: \"queryBuilder\" })() as Styles;\n    const m = words.messages;\n    const surface = dropTargetId(id);\n    const library = queryKeys(id).library;\n    const dragging = layer?.active ?? false;\n\n    // The query a card in flight would open: kept from the veto's candidate,\n    // for the target's words, until the drag ends.\n    const [candidate, setCandidate] = useState<string | undefined>(undefined);\n    useEffect(() => {\n        if (!dragging) setCandidate(undefined);\n    }, [dragging]);\n    const veto = useCallback<DropVeto>((event) => {\n        if (event.type !== \"add\") return false;\n        const name = event.value.from.key;\n        setCandidate(name);\n        return refusal(name) === undefined;\n    }, [refusal]);\n\n    // A drop opens its query; one that can't open here was refused before it reached here.\n    const onDrag = useCallback((event: DragEventValue): boolean => {\n        if (event.type !== \"add\") return false;\n        const name = event.value.from.key;\n        if (refusal(name) !== undefined) return false;\n        onOpen(name);\n        return true;\n    }, [refusal, onOpen]);\n    const target = useMemo((): DragTargetConfig => ({ id: surface, sources: [library], kinds: { add: true }, onDrag }), [surface, library, onDrag]);\n    useDragTarget(target);\n\n    // The one cell. Its name is what the layer says the drag rests over — the builder, and for a card it refuses, why.\n    const coord = useMemo((): CellCoord => ({ surface, row: BODY, slot: \"\" }), [surface]);\n    const options = useMemo((): DropCellOptions => ({\n        name: (_at, payload) => {\n            const reason = payload.kind === \"item\" ? refusal(payload.from.key) : undefined;\n            return reason === undefined ? m.dropTargetName() : m.dropRefusedName({ reason });\n        },\n    }), [refusal, m]);\n    const cell = useDropCell(coord, false, veto, undefined, options);\n\n    if (layer === null) return <>{children}</>;\n    const name = dragging ? candidate : undefined;\n    const count = name === undefined ? undefined : steps(name);\n    return (\n        <Box ref={cell} css={styles.dropZone} data-query-drop=\"\">\n            {children}\n            {name !== undefined && (\n                <Box css={styles.dropTarget} aria-hidden data-query-drop-target=\"\">\n                    <Box as=\"span\" css={styles.dropTitle} data-query-drop-title=\"\">{m.dropToOpen({ name })}</Box>\n                    {count !== undefined && (\n                        <Box as=\"span\" css={styles.dropMeta} data-query-drop-steps=\"\">\n                            {m.dropSteps({ count: words.formatters.number(count), n: count })}\n                        </Box>\n                    )}\n                </Box>\n            )}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { Box, Text, VStack, Code, Clipboard, IconButton } from '@chakra-ui/react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCopy, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport { LoadingIcon } from '@elaraai/east-ui-components';\n\ntype StatusVariant = 'error' | 'warning' | 'info' | 'loading';\n\nexport interface StatusDisplayProps {\n    variant: StatusVariant;\n    title: string;\n    message?: string;\n    /** Optional code/details block to show below the message */\n    details?: string;\n}\n\nconst variantStyles: Record<StatusVariant, {\n    bg: string;\n    titleColor: string;\n    messageColor: string;\n    detailsBg: string;\n    detailsColor: string;\n}> = {\n    // Mode-aware semantic tokens (the raw `red.50` / `gray.50` washes rendered\n    // as bright light boxes in dark mode — #362).\n    error: {\n        bg: 'bg.danger.subtle',\n        titleColor: 'fg.danger',\n        messageColor: 'fg.muted',\n        detailsBg: 'bg.muted',\n        detailsColor: 'fg.default',\n    },\n    warning: {\n        bg: 'bg.warning.subtle',\n        titleColor: 'fg.warning',\n        messageColor: 'fg.muted',\n        detailsBg: 'bg.muted',\n        detailsColor: 'fg.default',\n    },\n    info: {\n        bg: 'transparent',\n        titleColor: 'fg.muted',\n        messageColor: 'fg.subtle',\n        detailsBg: 'bg.muted',\n        detailsColor: 'fg.default',\n    },\n    loading: {\n        bg: 'transparent',\n        titleColor: 'fg.muted',\n        messageColor: 'fg.subtle',\n        detailsBg: 'bg.muted',\n        detailsColor: 'fg.default',\n    },\n};\n\n/**\n * Reusable component for displaying status messages (errors, warnings, info, loading).\n */\nexport function StatusDisplay({ variant, title, message, details }: StatusDisplayProps) {\n    const styles = variantStyles[variant];\n\n    // Centered layout for info and loading states\n    if (variant === 'info' || variant === 'loading') {\n        return (\n            <Box\n                data-status={variant}\n                height=\"100%\"\n                width=\"100%\"\n                display=\"flex\"\n                alignItems=\"center\"\n                justifyContent=\"center\"\n                bg={styles.bg}\n            >\n                <VStack gap={2}>\n                    {variant === 'loading' && <LoadingIcon animate size=\"52px\" />}\n                    <Text color={styles.titleColor} fontSize={variant === 'loading' ? 'body.lg' : 'title.md'}>\n                        {title}\n                    </Text>\n                    {message && (\n                        <Text color={styles.messageColor} fontSize=\"body.lg\">\n                            {message}\n                        </Text>\n                    )}\n                    {details && (\n                        <Box position=\"relative\" mt={2} width=\"100%\">\n                            <Code\n                                display=\"block\"\n                                whiteSpace=\"pre-wrap\"\n                                p={4}\n                                pr={10}\n                                bg={styles.detailsBg}\n                                color={styles.detailsColor}\n                                borderRadius=\"md\"\n                                fontSize=\"body.lg\"\n                                overflow=\"auto\"\n                                maxHeight=\"300px\"\n                            >\n                                {details}\n                            </Code>\n                            <Clipboard.Root value={details} position=\"absolute\" top={1} right={1}>\n                                <Clipboard.Trigger asChild>\n                                    <IconButton size=\"xs\" variant=\"ghost\" aria-label=\"Copy error details\">\n                                        <Clipboard.Indicator copied={<FontAwesomeIcon icon={faCheck} />}>\n                                            <FontAwesomeIcon icon={faCopy} />\n                                        </Clipboard.Indicator>\n                                    </IconButton>\n                                </Clipboard.Trigger>\n                            </Clipboard.Root>\n                        </Box>\n                    )}\n                </VStack>\n            </Box>\n        );\n    }\n\n    // Block layout for error and warning states\n    return (\n        <Box data-status={variant} p={6} bg={styles.bg} height=\"100%\" width=\"100%\">\n            <Text fontSize=\"title.md\" fontWeight=\"bold\" color={styles.titleColor} mb={4}>\n                {title}\n            </Text>\n            {message && (\n                <Text color={styles.messageColor} mb={details ? 4 : 0}>\n                    {message}\n                </Text>\n            )}\n            {details && (\n                <Box position=\"relative\">\n                    <Code\n                        display=\"block\"\n                        whiteSpace=\"pre-wrap\"\n                        p={4}\n                        pr={10}\n                        bg={styles.detailsBg}\n                        color={styles.detailsColor}\n                        borderRadius=\"md\"\n                        fontSize=\"body.lg\"\n                        overflow=\"auto\"\n                        maxHeight=\"300px\"\n                    >\n                        {details}\n                    </Code>\n                    <Clipboard.Root value={details} position=\"absolute\" top={1} right={1}>\n                        <Clipboard.Trigger asChild>\n                            <IconButton size=\"xs\" variant=\"ghost\" aria-label=\"Copy error details\">\n                                <Clipboard.Indicator copied={<FontAwesomeIcon icon={faCheck} />}>\n                                    <FontAwesomeIcon icon={faCopy} />\n                                </Clipboard.Indicator>\n                            </IconButton>\n                        </Clipboard.Trigger>\n                    </Clipboard.Root>\n                </Box>\n            )}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useMemo } from 'react';\nimport { useQuery, type UseQueryResult } from '@tanstack/react-query';\nimport { datasetGetStatus, pollRequestOptions } from '@elaraai/e3-api-client';\nimport type { RequestOptions } from '@elaraai/e3-api-client';\nimport { variant, type EastTypeValue } from '@elaraai/east';\nimport type { QueryOverrides } from './types.js';\n\n/**\n * How often a dataset's status is polled unless asked otherwise: every half\n * minute. The status — the dataset's hash, type and size — is what a preview\n * reads its value by, so a preview follows a change within this long, which\n * a host showing a value as it changes shortens (`pollInterval`).\n */\nexport const DATASET_STATUS_POLL_MS = 30_000;\n\nexport interface DatasetStatus {\n    path: string;\n    type: EastTypeValue;\n    /** \"unassigned\" | \"null\" | \"value\" */\n    refType: string;\n    hash: string | null;\n    sizeBytes: number | null;\n}\n\nexport interface UseDatasetStatusOptions {\n    requestOptions?: RequestOptions;\n    /** How often the status is polled, in milliseconds\n     *  (default {@link DATASET_STATUS_POLL_MS}) */\n    pollInterval?: number;\n    queryOverrides?: QueryOverrides;\n}\n\n/**\n * Lightweight status fetch — hash, type, size. No value bytes. Polled every\n * {@link DATASET_STATUS_POLL_MS} unless `options.pollInterval` says\n * otherwise, each poll one request attempt: its next poll is its retry.\n *\n * @param apiUrl - Base URL of the e3 API server\n * @param repo - Repository name\n * @param workspace - Workspace name; nothing is read while `null`\n * @param datasetPath - The dataset's dotted path; nothing is read while `null`\n * @param options - The requests' options, the poll's interval and react-query overrides\n * @returns The query of the status\n */\nexport function useDatasetStatus(\n    apiUrl: string,\n    repo: string,\n    workspace: string | null,\n    datasetPath: string | null,\n    options?: UseDatasetStatusOptions,\n): UseQueryResult<DatasetStatus, Error> {\n    const { requestOptions, pollInterval = DATASET_STATUS_POLL_MS, queryOverrides } = options ?? {};\n    const reqOpts = pollRequestOptions(requestOptions ?? { token: null });\n\n    const pathParts = useMemo(() =>\n        datasetPath?.split('.').filter(Boolean).map((v) => variant('field', v)) ?? [],\n        [datasetPath],\n    );\n\n    return useQuery({\n        queryKey: ['datasetStatus', apiUrl, repo, workspace, datasetPath],\n        queryFn: async (): Promise<DatasetStatus> => {\n            const raw = await datasetGetStatus(apiUrl, repo, workspace!, pathParts, reqOpts);\n            return {\n                path: raw.path,\n                type: raw.type as EastTypeValue,\n                refType: raw.refType,\n                hash: raw.hash?.type === 'some' ? raw.hash.value : null,\n                sizeBytes: raw.size?.type === 'some' ? Number(raw.size.value) : null,\n            };\n        },\n        enabled: !!workspace && !!datasetPath,\n        refetchInterval: pollInterval,\n        ...queryOverrides,\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useMemo, useCallback } from 'react';\nimport { useQuery, useQueryClient, type UseQueryResult } from '@tanstack/react-query';\nimport { datasetGet } from '@elaraai/e3-api-client';\nimport type { RequestOptions } from '@elaraai/e3-api-client';\nimport { variant, decodeBeast2For, type EastTypeValue } from '@elaraai/east';\nimport {\n    StateImpl,\n    SliceImpl,\n    SliceApplyImpl,\n    OverlayImpl,\n    ClipboardImpl,\n    DownloadImpl,\n    ShareImpl,\n} from '@elaraai/east-ui-components';\nimport { RecordSliceImpl } from '@elaraai/east-ui-components/platform';\nimport type { PlatformFunction } from '@elaraai/east/internal';\nimport { BindPlatform } from '../platform/bind-runtime.js';\nimport { PagedPlatform } from '../platform/paged-runtime.js';\nimport { FuncPlatform } from '../platform/func-runtime.js';\nimport { RecordPlatform } from '../platform/record-runtime.js';\nimport { DecisionBindPlatform } from '../decision/handle-runtime.js';\nimport type { QueryOverrides } from './types.js';\n\n// Fallback platform set (used when a caller doesn't pass `platforms`). It must include EVERY browser-local impl\n// from east-ui-components + e3-ui-components, plus the UNSCOPED global data/func/record binds — so a ui() value\n// decoded through this path never throws \"Platform function 'X' is not available\" (see east-contribute\n// \"Common traps\"). UITaskPreview passes a manifest-scoped set instead; this is the unscoped fallback.\nconst defaultPlatformImplementations: PlatformFunction[] =\n    [\n        ...StateImpl,  ...SliceImpl, ...RecordSliceImpl, ...SliceApplyImpl, ...OverlayImpl,\n        ...ClipboardImpl, ...DownloadImpl, ...ShareImpl, ...DecisionBindPlatform,\n        ...BindPlatform, ...PagedPlatform, ...FuncPlatform, ...RecordPlatform,\n    ];\n\nexport interface UseDatasetValueOptions {\n    requestOptions?: RequestOptions;\n    queryOverrides?: QueryOverrides;\n    /** Set false to skip the fetch (e.g. when oversized). Defaults to true. */\n    enabled?: boolean;\n    /**\n     * Hash of the current dataset version. Used as part of the query key so\n     * the cached value invalidates when the underlying data changes. Pass\n     * `null` if not yet known — the fetch is gated on it being non-null.\n     */\n    hash?: string | null;\n    /**\n     * Platform implementations passed to `decodeBeast2For`. Closures inside\n     * the decoded value (callbacks, etc) close over these. Defaults to the\n     * global Data/State/Overlay impls. Pass a manifest-scoped variant for\n     * per-subtree read/write validation.\n     */\n    platforms?: PlatformFunction[];\n    /** East type to decode against. Required. */\n    type: EastTypeValue;\n}\n\nexport interface DatasetValueResult {\n    decoded: unknown;\n    sizeBytes: number;\n    /** The content hash of the value read, as the response names it. */\n    hash: string | null;\n}\n\n/**\n * Fetch + decode a dataset value. Caller is responsible for size gating.\n *\n * @remarks\n * The value is read as the dataset holds it now, which is not always the\n * value of the `hash` asked for: the dataset may have moved on since its\n * status named that hash. A value is cached under the hash its response names,\n * and the status is fetched again, so a reader moves to the value it got; an\n * entry that holds another hash's value is never shown as this hash's.\n */\nexport function useDatasetValue(\n    apiUrl: string,\n    repo: string,\n    workspace: string | null,\n    datasetPath: string | null,\n    options: UseDatasetValueOptions,\n): UseQueryResult<DatasetValueResult | undefined, Error> {\n    const { requestOptions, queryOverrides, enabled = true, hash, platforms, type } = options;\n    const platformImpls = platforms ?? defaultPlatformImplementations;\n    const reqOpts = requestOptions ?? { token: null };\n    const queryClient = useQueryClient();\n\n    const pathParts = useMemo(() =>\n        datasetPath?.split('.').filter(Boolean).map((v) => variant('field', v)) ?? [],\n        [datasetPath],\n    );\n\n    return useQuery({\n        queryKey: ['datasetValue', apiUrl, repo, workspace, datasetPath, hash ?? null],\n        queryFn: async (): Promise<DatasetValueResult> => {\n            const result = await datasetGet(apiUrl, repo, workspace!, pathParts, reqOpts);\n            const decoded = decodeBeast2For(type, { platform: platformImpls })(result.data);\n            const value = { decoded, sizeBytes: result.data.length, hash: result.hash ?? hash ?? null };\n            if (value.hash !== hash) {\n                queryClient.setQueryData(['datasetValue', apiUrl, repo, workspace, datasetPath, value.hash], value);\n                void queryClient.invalidateQueries({ queryKey: ['datasetStatus', apiUrl, repo, workspace, datasetPath] });\n            }\n            return value;\n        },\n        select: (value) => (value.hash === (hash ?? null) ? value : undefined),\n        enabled: enabled && !!workspace && !!datasetPath && hash != null,\n        ...queryOverrides,\n    });\n}\n\n/**\n * Downloads a dataset's value: its beast2 bytes, which the browser saves as\n * `<path>.beast2`, the path's dots as underscores. What a preview's Download\n * does, for a host that draws Download itself (#1120).\n *\n * @param apiUrl - The e3 API's base URL\n * @param repo - The repository\n * @param workspace - The workspace\n * @param path - The dataset's dotted path, e.g. `\"inputs.rows\"`\n * @param requestOptions - The token, and the fetch the request goes through\n * @returns Once the browser has the file\n *\n * @example\n * ```tsx\n * <Button onClick={() => downloadDataset(apiUrl, 'default', 'main', 'tasks.report.output')}>Download</Button>\n * ```\n */\nexport async function downloadDataset(\n    apiUrl: string,\n    repo: string,\n    workspace: string,\n    path: string,\n    requestOptions?: RequestOptions,\n): Promise<void> {\n    const pathParts = path.split('.').filter(Boolean).map((v) => variant('field', v));\n    const result = await datasetGet(apiUrl, repo, workspace, pathParts, requestOptions ?? { token: null });\n    const blob = new Blob([new Uint8Array(result.data)], { type: 'application/octet-stream' });\n    const url = URL.createObjectURL(blob);\n    const a = document.createElement('a');\n    a.href = url;\n    a.download = `${path.replace(/\\./g, '_')}.beast2`;\n    document.body.appendChild(a);\n    a.click();\n    document.body.removeChild(a);\n    URL.revokeObjectURL(url);\n}\n\n/** Trigger a binary download of a dataset value: {@link downloadDataset}, once the workspace and path are known. */\nexport function useDatasetDownload(\n    apiUrl: string,\n    repo: string,\n    workspace: string | null,\n    datasetPath: string | null,\n    requestOptions?: RequestOptions,\n) {\n    return useCallback(async () => {\n        if (!workspace || !datasetPath) return;\n        await downloadDataset(apiUrl, repo, workspace, datasetPath, requestOptions);\n    }, [apiUrl, repo, workspace, datasetPath, requestOptions]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useQuery, useMutation, type UseQueryResult } from '@tanstack/react-query';\nimport type { QueryOverrides } from './types.js';\nimport { datasetList, datasetListAt, datasetListRecursive, datasetListRecursivePaths, datasetListWithStatus, datasetGet, datasetGetStatus, datasetSet } from '@elaraai/e3-api-client';\nimport type { RequestOptions, ListEntry, DatasetStatusDetail } from '@elaraai/e3-api-client';\nimport type { TreePath } from '@elaraai/e3-types';\n\nexport function useDatasetList(url: string, repo: string, workspace: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['datasetList', url, repo, workspace],\n        queryFn: () => datasetList(url, repo, workspace!, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\nexport function useDatasetListAt(url: string, repo: string, workspace: string | null, path: TreePath, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['datasetListAt', url, repo, workspace, path],\n        queryFn: () => datasetListAt(url, repo, workspace!, path, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\nexport function useDatasetListRecursive(url: string, repo: string, workspace: string | null, path: TreePath, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<ListEntry[], Error> {\n    return useQuery({\n        queryKey: ['datasetListRecursive', url, repo, workspace, path],\n        queryFn: () => datasetListRecursive(url, repo, workspace!, path, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\nexport function useDatasetListRecursivePaths(url: string, repo: string, workspace: string | null, path: TreePath, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['datasetListRecursivePaths', url, repo, workspace, path],\n        queryFn: () => datasetListRecursivePaths(url, repo, workspace!, path, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\nexport function useDatasetListWithStatus(url: string, repo: string, workspace: string | null, path: TreePath, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<ListEntry[], Error> {\n    return useQuery({\n        queryKey: ['datasetListWithStatus', url, repo, workspace, path],\n        queryFn: () => datasetListWithStatus(url, repo, workspace!, path, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\nexport function useDatasetGetStatus(url: string, repo: string, workspace: string | null, path: TreePath, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<DatasetStatusDetail, Error> {\n    return useQuery({\n        queryKey: ['datasetGetStatus', url, repo, workspace, path],\n        queryFn: () => datasetGetStatus(url, repo, workspace!, path, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\nexport function useDatasetGet(url: string, repo: string, workspace: string | null, path: TreePath, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['datasetGet', url, repo, workspace, path],\n        queryFn: () => datasetGet(url, repo, workspace!, path, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\nexport function useDatasetSet(url: string, repo: string, workspace: string | null, requestOptions?: RequestOptions) {\n    return useMutation<void, Error, { path: TreePath; data: Uint8Array }>({\n        mutationFn: ({ path, data }) => datasetSet(url, repo, workspace!, path, data, requestOptions ?? { token: null }),\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A key search a host controls (#1120): the text the host's own input holds,\n * read in the key search's grammar, found as the preview's own search box\n * finds a query, and its first match jumped to.\n *\n * @packageDocumentation\n */\n\nimport { useEffect } from 'react';\nimport type { EastTypeValue } from '@elaraai/east';\nimport { parseKeyInput, type DatasetKeyMatchRange, type DatasetKeyQuery } from '@elaraai/east-ui-components';\n\n/** How long a paged preview waits for the text to hold before it finds it, as its search box does: each find is a request. */\nexport const SEARCH_DEBOUNCE_MS = 250;\n\n/**\n * Finds a controlled search's text and jumps to its first match.\n *\n * @param search - The host's text, or `undefined` when the host does not\n *   control the search\n * @param keyType - The collection's key type, or `null` when it has no keys\n *   to search\n * @param onFind - Locates a query, as the search box's own `onFind` does\n * @param onJump - Jumps the tree to a row, or clears its jump given\n *   `undefined`\n * @param debounceMs - How long the text must hold before it is found\n *\n * @remarks\n * `''`, a text the grammar refuses and a text with no match each clear the\n * jump. A find the text has since moved past is dropped.\n */\nexport function useControlledKeySearch(\n    search: string | undefined,\n    keyType: EastTypeValue | null,\n    onFind: (query: DatasetKeyQuery) => Promise<DatasetKeyMatchRange>,\n    onJump: (row: number | undefined) => void,\n    debounceMs: number,\n): void {\n    useEffect(() => {\n        if (search === undefined || keyType === null) return;\n        const parsed = search === '' ? null : parseKeyInput(keyType, search);\n        if (parsed === null || parsed.kind === 'hint') {\n            onJump(undefined);\n            return;\n        }\n        let current = true;\n        const timer = setTimeout(() => {\n            onFind(parsed.query).then(\n                (range) => { if (current) onJump(range.found ? range.row : undefined); },\n                () => { if (current) onJump(undefined); },\n            );\n        }, debounceMs);\n        return () => {\n            current = false;\n            clearTimeout(timer);\n        };\n    }, [search, keyType, onFind, onJump, debounceMs]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A preview's controls, drawn by its host (#1209): a handle the host makes\n * with {@link usePreviewControls} and gives the preview as `controls`, whose\n * methods do what the preview's own bands do, for a host that draws them in\n * its own header.\n *\n * @packageDocumentation\n */\n\nimport { useState, type RefObject } from 'react';\nimport type { ValueTreeControls } from '@elaraai/east-ui-components';\n\n/** What a log view does for a host's own controls (#1209). */\nexport interface LogViewerControls {\n    /** Goes to the search's next match, after the last its first, as the band's chevron does. */\n    nextMatch(): void;\n    /** Goes to the search's previous match, before the first its last, as the band's chevron does. */\n    previousMatch(): void;\n    /**\n     * Copies the log shown, as the band's Copy does.\n     *\n     * @returns `true` once the log is on the clipboard, `false` when the\n     *   clipboard refuses it\n     */\n    copy(): Promise<boolean>;\n}\n\n/**\n * What a host's header does to the preview it is given to (#1209). Each\n * method does nothing while its view is not mounted: the Output tab shows no\n * log, and a value too large to show has no tree.\n */\nexport interface PreviewControls {\n    /** Collapses every row of the value's tree, as its Collapse all does. */\n    collapseAll(): void;\n    /** Expands every row of the value's tree, as its Expand all does. */\n    expandAll(): void;\n    /** Goes to the log search's next match, as the log's chevron does. */\n    nextMatch(): void;\n    /** Goes to the log search's previous match, as the log's chevron does. */\n    previousMatch(): void;\n    /**\n     * Copies the log shown, as the log's Copy does.\n     *\n     * @returns `true` once the log is on the clipboard, `false` when no log\n     *   is shown or the clipboard refuses it\n     */\n    copyLog(): Promise<boolean>;\n}\n\n/** Where a preview's tree and log view put their controls, by the handle they were given. */\ninterface Parts {\n    tree: RefObject<ValueTreeControls | null>;\n    log: RefObject<LogViewerControls | null>;\n}\n\nconst partsOf = new WeakMap<PreviewControls, Parts>();\n\n/**\n * Makes the handle a host gives a preview as `controls`, to draw the\n * preview's controls in its own header (#1209).\n *\n * @returns A handle that stays the same for the life of the component, and\n *   serves one preview at a time\n *\n * @remarks\n * It holds no query, so a header outside `<E3Provider>` can make it.\n *\n * @example\n * ```tsx\n * const controls = usePreviewControls();\n *\n * <Button onClick={controls.collapseAll}>Collapse all</Button>\n * <TaskPreview apiUrl={url} repo=\"default\" workspace={ws} task={task}\n *     toolbar={false} controls={controls} />\n * ```\n */\nexport function usePreviewControls(): PreviewControls {\n    const [controls] = useState(() => {\n        const parts: Parts = { tree: { current: null }, log: { current: null } };\n        const made: PreviewControls = {\n            collapseAll: () => parts.tree.current?.collapseAll(),\n            expandAll: () => parts.tree.current?.expandAll(),\n            nextMatch: () => parts.log.current?.nextMatch(),\n            previousMatch: () => parts.log.current?.previousMatch(),\n            copyLog: () => parts.log.current?.copy() ?? Promise.resolve(false),\n        };\n        partsOf.set(made, parts);\n        return made;\n    });\n    return controls;\n}\n\n/**\n * The ref a preview's value tree is given, for the controls it was given.\n *\n * @param controls - The host's handle, if it gave one\n * @returns The tree's ref, or `undefined` without a handle\n */\nexport function treeControlsOf(controls: PreviewControls | undefined): RefObject<ValueTreeControls | null> | undefined {\n    return controls === undefined ? undefined : partsOf.get(controls)?.tree;\n}\n\n/**\n * The ref a preview's log view is given, for the controls it was given.\n *\n * @param controls - The host's handle, if it gave one\n * @returns The log view's ref, or `undefined` without a handle\n */\nexport function logControlsOf(controls: PreviewControls | undefined): RefObject<LogViewerControls | null> | undefined {\n    return controls === undefined ? undefined : partsOf.get(controls)?.log;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { ApiError } from '@elaraai/e3-api-client';\nimport { EastError } from '@elaraai/east';\n\n/**\n * Extract a human-readable message and optional details from an error.\n * For ApiError, separates the error code from the actual error details.\n */\nexport function formatApiError(error: unknown): { message: string; details?: string } {\n    if (error instanceof ApiError && error.details != null) {\n        const details = error.details;\n        if (typeof details === 'string') return { message: error.message, details };\n        if (typeof details === 'object' && 'message' in details) return { message: error.message, details: String((details as Record<string, unknown>).message) };\n        return { message: error.message, details: JSON.stringify(details) };\n    }\n    return { message: error instanceof Error ? error.message : String(error) };\n}\n\n/**\n * Format an error for display. For EastError, includes location stack trace.\n */\nexport function formatError(error: Error): string {\n    if (error instanceof EastError) return error.formattedMessage;\n    return error.message;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<DatasetPreview>` — size-aware preview of a raw dataset value.\n *\n * Pipeline: status → fetch + decode if size < limit → materialize + render as\n * an interactive `ValueTree`; otherwise show a \"download\" button. With\n * `editable`, leaf edits / inserts / removes / tag switches reconcile through\n * `ValueTree.applyEdit` and persist via `useDatasetSet` (for mutable inputs).\n *\n * Used for inputs and other \"show me this dataset's value\" cases. NOT used\n * for UI tasks (those go through `<UITaskPreview>`).\n *\n * A host that draws the preview's controls in its own header passes\n * `toolbar={false}`, so the preview draws no band above the value (#1120) and\n * its tree no Collapse all and Expand all, which the host does through the\n * `controls` it makes with `usePreviewControls` (#1209).\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faDownload } from '@fortawesome/free-solid-svg-icons';\nimport { useQueryClient, keepPreviousData } from '@tanstack/react-query';\nimport type { RequestOptions } from '@elaraai/e3-api-client';\nimport { variant, some, none, compareFor, encodeBeast2For, parseFor, type EastTypeValue } from '@elaraai/east';\nimport { ValueTree } from '@elaraai/east-ui';\nimport {\n    EastChakraValueTree,\n    formatters,\n    useFormatters,\n    type Formatters,\n    type TickFormatOpt,\n    type ValueTreeValue,\n    type ValueTreeStepValue,\n    type ValueTreeLeafValue,\n} from '@elaraai/east-ui-components';\nimport { useDatasetStatus } from '../hooks/useDatasetStatus.js';\nimport { useDatasetValue, useDatasetDownload } from '../hooks/useDatasetValue.js';\nimport { useDatasetSet } from '../hooks/datasets.js';\nimport { StatusDisplay } from './StatusDisplay.js';\nimport { DatasetKeySearch, keyRangePredicates, type DatasetKeyMatchRange, type DatasetKeyQuery } from '@elaraai/east-ui-components';\nimport { PagedDatasetPreview } from './PagedDatasetPreview.js';\nimport { useControlledKeySearch } from './controlled-search.js';\nimport { treeControlsOf, type PreviewControls } from './preview-controls.js';\nimport { formatApiError, formatError } from '../errors.js';\n\nconst DEFAULT_SIZE_LIMIT = 200 * 1024; // 200KB\n\nexport interface DatasetPreviewProps {\n    apiUrl: string;\n    repo: string;\n    workspace: string | null;\n    /** Dotted path string, e.g. \"inputs.threshold\". */\n    path: string | null;\n    requestOptions?: RequestOptions;\n    /** Max bytes to fetch + render inline. Above this → download button. */\n    sizeLimit?: number;\n    /** How often the dataset's status is polled, in milliseconds, which says\n     *  when its value changed. Default 30 000 (`DATASET_STATUS_POLL_MS`). */\n    pollInterval?: number;\n    /** When set, leaf edits / inserts / removes / tag switches write back to\n     *  this dataset path (for mutable inputs). Task outputs stay read-only. */\n    editable?: boolean;\n    /** `false` draws no band above the value — no key search, size or\n     *  Download — for a host that draws them in its own header (#1120), and\n     *  no Collapse all and Expand all above the tree (#1209). A value too\n     *  large to show keeps its Download, which is the body. Default `true`. */\n    toolbar?: boolean;\n    /** The key search, controlled: the host draws its input, and the preview\n     *  draws no search box of its own. The text is read in the key search's\n     *  grammar and scrolled to its first match; `''` clears (#1120). */\n    search?: string;\n    /** Told the text of the preview's own search box as it is edited, unless\n     *  `search` is given. */\n    onSearchChange?: (search: string) => void;\n    /** The handle a host's own Collapse all and Expand all act on the tree\n     *  through, made with `usePreviewControls` (#1209). */\n    controls?: PreviewControls;\n}\n\n/** A size in KB, to one decimal. */\nconst KB_FORMAT: TickFormatOpt = variant('number', { minimumFractionDigits: some(1n), maximumFractionDigits: some(1n), signDisplay: none });\n/** A size in MB, to two decimals. */\nconst MB_FORMAT: TickFormatOpt = variant('number', { minimumFractionDigits: some(2n), maximumFractionDigits: some(2n), signDisplay: none });\n\n/**\n * Human-readable byte size, shared with the paged preview — its digits in the\n * app's locale (#850).\n *\n * @param bytes - The size in bytes\n * @param words - The formatters; the runtime locale's when omitted\n * @returns `512 B`, `1.5 KB` or `2.25 MB` (`1,5 KB` in `de-DE`)\n */\nexport function formatSize(bytes: number, words: Formatters = formatters()): string {\n    if (bytes < 1024) return `${words.number(bytes)} B`;\n    if (bytes < 1024 * 1024) return `${words.value(bytes / 1024, KB_FORMAT)} KB`;\n    return `${words.value(bytes / 1024 / 1024, MB_FORMAT)} MB`;\n}\n\n/** Download trigger with its own in-flight state, shared with the paged preview. */\nexport function DownloadButton({ onClick, label }: { onClick: () => void; label?: string }) {\n    const [downloading, setDownloading] = useState(false);\n    const handleClick = async () => {\n        setDownloading(true);\n        try { await onClick(); } finally { setDownloading(false); }\n    };\n    return (\n        <Button size=\"sm\" variant=\"outline\" onClick={handleClick} loading={downloading} loadingText=\"Downloading...\">\n            <FontAwesomeIcon icon={faDownload} />\n            {label ?? 'Download'}\n        </Button>\n    );\n}\n\nexport const DatasetPreview = memo(function DatasetPreview({\n    apiUrl,\n    repo,\n    workspace,\n    path,\n    requestOptions,\n    sizeLimit = DEFAULT_SIZE_LIMIT,\n    pollInterval,\n    editable = false,\n    toolbar = true,\n    search,\n    onSearchChange,\n    controls,\n}: DatasetPreviewProps) {\n    // Counts and sizes, in the app's locale (#850).\n    const words = useFormatters();\n    const statusQuery = useDatasetStatus(apiUrl, repo, workspace, path, {\n        ...(requestOptions != null && { requestOptions }),\n        ...(pollInterval !== undefined && { pollInterval }),\n    });\n    const status = statusQuery.data;\n    const hasValue = status?.refType === 'value' && status.hash !== null;\n    const sizeBytes = status?.sizeBytes ?? 0;\n    const isOversized = hasValue && sizeBytes > sizeLimit;\n    const type = status?.type as EastTypeValue | undefined;\n    // Content hash the server refused to page (`dataset_not_indexed` — a\n    // legacy blob predating the stored-segmented contract). Keyed by hash so\n    // a re-written (indexed) value automatically pages again.\n    const [notIndexedHash, setNotIndexedHash] = useState<string | null>(null);\n    // Read-only collection roots render through the paged windowed view, at\n    // every size — whole-value materialization is reserved for editable\n    // inputs and non-collection roots, so an entry-heavy collection can\n    // never exhaust the inline materializer mid-list. Editable collections\n    // keep the inline (editing) path until they outgrow the size limit, at\n    // which point they page read-only like before. Legacy pre-index blobs\n    // fall back to the inline tree (or the oversize download) instead of\n    // dead-ending in the paged view.\n    const pageable = hasValue && type !== undefined &&\n        (type.type === 'Array' || type.type === 'Set' || type.type === 'Dict');\n    const usePaged = pageable && (!editable || isOversized) &&\n        workspace != null && path != null && status?.hash != null &&\n        status.hash !== notIndexedHash;\n    const shouldFetch = hasValue && !isOversized && !usePaged;\n\n    const valueQuery = useDatasetValue(apiUrl, repo, workspace, path, {\n        ...(requestOptions != null && { requestOptions }),\n        type: status?.type as never,\n        hash: status?.hash ?? null,\n        enabled: shouldFetch,\n        // An edit changes the value's content hash → a new query key. Keep the\n        // current value on screen while the new one loads so an edit doesn't\n        // flash the loading state (only the FIRST load has no previous value).\n        queryOverrides: { placeholderData: keepPreviousData },\n    });\n    const download = useDatasetDownload(apiUrl, repo, workspace, path, requestOptions);\n\n    // Editable path: persist a ValueTree edit back to the dataset. `applyEdit`\n    // reconciles the decoded value at the reported path, then the existing\n    // `useDatasetSet` writer encodes + PUTs it; invalidating the status/value\n    // queries refetches the new value, which re-materializes the tree. The\n    // mutation's own write stays one function across renders, where the result\n    // TanStack hands back is a new object on each: a write made on the result\n    // would make the tree anew on every render.\n    const { mutateAsync: setDataset } = useDatasetSet(apiUrl, repo, workspace, requestOptions);\n    const queryClient = useQueryClient();\n    const decoded = valueQuery.data?.decoded;\n\n    // The value the last edit wrote, until it has loaded. An edit made before\n    // then applies to it: applied to the value on screen, which the edit before\n    // has already moved on from, it would write that edit away.\n    const edited = useRef<{ value: unknown } | null>(null);\n    const writing = useRef(0);\n    const writes = useRef<Promise<void>>(Promise.resolve());\n    useEffect(() => { if (writing.current === 0) edited.current = null; }, [decoded]);\n\n    const write = useCallback((next: unknown): Promise<void> => {\n        if (workspace == null || path == null || type === undefined) return Promise.resolve();\n        const treePath = path.split('.').filter(Boolean).map((p) => variant('field', p));\n        const data = encodeBeast2For(type as never)(next as never);\n        edited.current = { value: next };\n        writing.current++;\n        // One write at a time, in the order they were made, so the last edit's\n        // value is the one the dataset keeps.\n        const run = writes.current.then(async () => {\n            await setDataset({ path: treePath, data });\n            // Refetch the status only — the new content hash it returns re-keys\n            // the value query, which loads the new value (kept smooth by\n            // placeholderData above). Invalidating the value query too would\n            // refetch the stale hash.\n            await queryClient.invalidateQueries({ queryKey: ['datasetStatus', apiUrl, repo, workspace, path] });\n        });\n        writes.current = run.catch(() => undefined);\n        return run\n            .catch((err: unknown) => {\n                // A write that failed wrote nothing: the next edit applies to\n                // the dataset's value.\n                edited.current = null;\n                throw err;\n            })\n            .finally(() => { writing.current--; });\n    }, [apiUrl, repo, workspace, path, type, setDataset, queryClient]);\n\n    // Inline key search (#520): the same control as the paged preview, with\n    // a client-side jump over the already-decoded keys (decoded Set/Dict\n    // values iterate in canonical East key order, so index = row).\n    const keyType = useMemo<EastTypeValue | null>(() => (\n        type === undefined ? null\n        : type.type === 'Dict' ? (type.value as { key: EastTypeValue; value: EastTypeValue }).key\n        : type.type === 'Set' ? type.value as EastTypeValue\n        : null\n    ), [type]);\n    const inlineKeys = useMemo<unknown[] | null>(() => (\n        decoded === undefined || type === undefined ? null\n        : type.type === 'Dict' ? [...(decoded as Map<unknown, unknown>).keys()]\n        : type.type === 'Set' ? [...(decoded as Set<unknown>).values()]\n        : null\n    ), [type, decoded]);\n    const [jumpRow, setJumpRow] = useState<number | undefined>(undefined);\n    useEffect(() => { setJumpRow(undefined); }, [decoded]);\n    const onFindInline = useCallback(async (query: DatasetKeyQuery): Promise<DatasetKeyMatchRange> => {\n        if (inlineKeys === null || keyType === null) return { found: false, row: 0, count: 0 };\n        const range = keyRangePredicates(keyType, query);\n        if (range === null) {\n            // Whole-key literal: an exact lookup in the sorted keys.\n            const parsed = parseFor(keyType)((query as { key: string }).key);\n            if (!parsed.success) return { found: false, row: 0, count: 0 };\n            const cmp = compareFor(keyType);\n            for (let i = 0; i < inlineKeys.length; i++) {\n                const order = cmp(inlineKeys[i], parsed.value);\n                if (order === 0) return { found: true, row: i, count: 1 };\n                if (order > 0) return { found: false, row: i, count: 0 };\n            }\n            return { found: false, row: inlineKeys.length, count: 0 };\n        }\n        let row = inlineKeys.findIndex(range.lower);\n        if (row === -1) row = inlineKeys.length;\n        let count = 0;\n        while (row + count < inlineKeys.length && !range.upper(inlineKeys[row + count])) count++;\n        return { found: count > 0, row, count };\n    }, [inlineKeys, keyType]);\n    // A search the host controls, over the keys shown inline: found at once,\n    // the scan being local (#1120).\n    useControlledKeySearch(search, inlineKeys === null ? null : keyType, onFindInline, setJumpRow, 0);\n    const onListInline = useCallback(async (row: number, limit: number): Promise<string[]> => {\n        if (inlineKeys === null || keyType === null) return [];\n        const stringKeys = keyType.type === 'String';\n        return inlineKeys.slice(row, row + limit)\n            .map((k) => (stringKeys ? k as string : ValueTree.keyLabel(keyType as never, k)));\n    }, [inlineKeys, keyType]);\n\n    const treeValue = useMemo<ValueTreeValue | null>(() => {\n        if (type === undefined || decoded === undefined) return null;\n        const root = ValueTree.materialize(type, decoded);\n        const base = (): unknown => (edited.current !== null ? edited.current.value : decoded);\n        const wire = editable\n            ? {\n                onEdit: some((p: ValueTreeStepValue[], leaf: ValueTreeLeafValue) => write(ValueTree.applyEdit(type, base(), p, { kind: 'edit', leaf }))),\n                onInsert: some((p: ValueTreeStepValue[]) => write(ValueTree.applyEdit(type, base(), p, { kind: 'insert' }))),\n                onRemove: some((p: ValueTreeStepValue[]) => write(ValueTree.applyEdit(type, base(), p, { kind: 'remove' }))),\n                onTag: some((p: ValueTreeStepValue[], tag: string) => write(ValueTree.applyEdit(type, base(), p, { kind: 'tag', tag }))),\n            }\n            : { onEdit: none, onInsert: none, onRemove: none, onTag: none };\n        // The tree's Collapse all and Expand all are a band too (#1209).\n        return { root, ...wire, style: some({ height: some('100%'), maxHeight: none, openDepth: none, toolbar: some(toolbar) }) } as unknown as ValueTreeValue;\n    }, [type, decoded, editable, write, toolbar]);\n\n    if (statusQuery.isLoading) return <StatusDisplay variant=\"loading\" title=\"Loading...\" />;\n    if (statusQuery.error) {\n        const { message, details } = formatApiError(statusQuery.error);\n        return <StatusDisplay variant=\"error\" title=\"Error\" message={message} details={details ?? formatError(statusQuery.error)} />;\n    }\n    if (!status) return <StatusDisplay variant=\"info\" title=\"No status\" />;\n    if (!hasValue) return <StatusDisplay variant=\"info\" title=\"No data available\" message=\"Waiting for a value to be set\" />;\n\n    if (usePaged && type !== undefined && workspace != null && path != null && status.hash != null) {\n        const pagedHash = status.hash;\n        return (\n            <PagedDatasetPreview\n                apiUrl={apiUrl}\n                repo={repo}\n                workspace={workspace}\n                path={path}\n                type={type}\n                hash={pagedHash}\n                sizeBytes={sizeBytes}\n                {...(requestOptions != null && { requestOptions })}\n                onDownload={download}\n                onNotIndexed={() => setNotIndexedHash(pagedHash)}\n                toolbar={toolbar}\n                {...(search !== undefined && { search })}\n                {...(onSearchChange !== undefined && { onSearchChange })}\n                {...(controls !== undefined && { controls })}\n            />\n        );\n    }\n\n    if (isOversized) {\n        return (\n            <Flex height=\"100%\" direction=\"column\" align=\"center\" justify=\"center\" layerStyle=\"banner.stale\" borderRadius=\"0\" gap={3} p={6}>\n                <Text fontSize=\"title.md\" color=\"fg.warning\" fontWeight=\"bold\">Value too large to display</Text>\n                <Text color=\"fg.muted\" fontSize=\"body.lg\">\n                    The data is {formatSize(sizeBytes, words)}, which exceeds the {formatSize(sizeLimit, words)} display limit.\n                </Text>\n                <DownloadButton onClick={download} label=\"Download value\" />\n            </Flex>\n        );\n    }\n\n    // The error first: a load that failed has no data, and would otherwise\n    // show as loading forever.\n    if (valueQuery.error) {\n        const { message, details } = formatApiError(valueQuery.error);\n        return <StatusDisplay variant=\"error\" title=\"Load failed\" message={message} details={details ?? formatError(valueQuery.error)} />;\n    }\n    if (valueQuery.isLoading || !valueQuery.data) return <StatusDisplay variant=\"loading\" title=\"Loading...\" />;\n\n    // Collection roots show their entry count beside the byte size — the\n    // same header the paged view renders, so small and large datasets read\n    // identically.\n    const count = type === undefined || decoded === undefined ? null\n        : type.type === 'Array' ? (decoded as unknown[]).length\n        : type.type === 'Set' || type.type === 'Dict' ? (decoded as { size: number }).size\n        : null;\n    const countText = count === null ? ''\n        : `${words.number(count)} ${type?.type === 'Dict' ? 'entries' : 'items'} · `;\n\n    return (\n        <Flex direction=\"column\" height=\"100%\" overflow=\"hidden\">\n            {toolbar && (\n                <Flex px={4} py={2} gap={2} align=\"center\" flexShrink={0} borderBottom=\"1px solid\" borderColor=\"border.subtle\">\n                    {search === undefined && keyType !== null && inlineKeys !== null && (\n                        <DatasetKeySearch keyType={keyType} onFind={onFindInline} onListRange={onListInline}\n                            onJump={setJumpRow} onClear={() => setJumpRow(undefined)} onInputChange={onSearchChange} />\n                    )}\n                    <Flex flex={1} justify=\"flex-end\" align=\"center\" gap={2}>\n                        <Text fontSize=\"body.sm\" color=\"fg.muted\">{countText}{formatSize(sizeBytes, words)}</Text>\n                        <DownloadButton onClick={download} />\n                    </Flex>\n                </Flex>\n            )}\n            <Box flex={1} minHeight={0} overflow=\"hidden\">\n                {treeValue !== null && <EastChakraValueTree value={treeValue} storageKey={path ?? 'value'} scrollToRow={jumpRow}\n                    controlsRef={treeControlsOf(controls)} />}\n            </Box>\n        </Flex>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A collection read a page at a time, as a paged view reads it: the page\n * cache `<PagedDatasetPreview>` and the query builder's result too large for\n * one answer (`query/paged-result.ts`, #1113) share.\n *\n * - Each page is read once while it is wanted. Those far from what the view\n *   shows are let go past a cap — a page's rows become the view's nodes, so\n *   the pages held are bounded — and read again when they are wanted again.\n * - A page that lands for a collection the view no longer shows, or after the\n *   pages started afresh, lands nothing.\n * - A page that cannot be read says why, once; it is read again when it is\n *   wanted again.\n * - Its `need` and `keep` are new whenever the pages start afresh — another\n *   collection, or a reset — and only then, so a view that asks from an effect\n *   keyed on them asks for the new pages, and never again for the same ones.\n *\n * How a page is fetched, and what it holds, is its reader's.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useReducer, useRef } from 'react';\nimport { pruneRetainedPages } from '@elaraai/east-ui/internal';\n\n/** What a view reads its pages from ({@link usePageReads}). */\nexport interface PageReader<V> {\n    /** The collection the pages are of: when it changes the pages start afresh, and a page read for an earlier one lands nothing. */\n    readonly identity: string;\n    /**\n     * Reads a page.\n     *\n     * @param page - The page's index\n     * @param live - Whether the read still lands: what a reader checks before it does anything beside answering the page\n     * @returns What the page holds; or `undefined` for a page that lands nothing — its reader started the pages afresh,\n     *   say — which is read again when it is wanted\n     */\n    read(page: number, live: () => boolean): Promise<V | undefined>;\n    /** The most pages held: those far from what the view shows go past it. */\n    readonly retain: number;\n}\n\n/** A collection's pages, as a view reads them ({@link usePageReads}). */\nexport interface PageReads<V> {\n    /** The pages that landed, by index. */\n    readonly pages: ReadonlyMap<number, V>;\n    /** How many pages are being read. */\n    readonly loading: number;\n    /** Why the first page that could not be read could not be; `undefined` while every one could. */\n    readonly failure: Error | undefined;\n    /**\n     * Reads the pages `[first, last]` that have not landed and are not being\n     * read. It sets nothing as it is asked, so a renderer may ask in its render.\n     * It is new whenever the pages start afresh, and asks only for those.\n     */\n    need(first: number, last: number): void;\n    /**\n     * Lets go of the pages far from `[first, last]`, past the most held; under\n     * it, the same pages stay. It is new whenever the pages start afresh.\n     */\n    keep(first: number, last: number): void;\n    /** Starts the pages afresh, holding `pages`: what a reader does that learns its pages are addressed otherwise. */\n    reset(pages?: ReadonlyMap<number, V>): void;\n}\n\n/** What the pages of one collection hold, until they start afresh. */\ninterface Held<V> {\n    readonly identity: string;\n    pages: ReadonlyMap<number, V>;\n    readonly reading: Set<number>;\n    failure: Error | undefined;\n}\n\n/** The pages of a collection, started afresh. */\nfunction heldOf<V>(identity: string, pages: ReadonlyMap<number, V> = new Map()): Held<V> {\n    return { identity, pages, reading: new Set(), failure: undefined };\n}\n\n/**\n * Reads a collection a page at a time: see the module docs.\n *\n * @param reader - What the pages are of, how one is read, and the most held\n * @returns The pages, and how to ask for more and let go of some\n */\nexport function usePageReads<V>(reader: PageReader<V>): PageReads<V> {\n    const { identity, retain } = reader;\n    // The latest render's read: a page asked for after it reads as it does — with its token, say.\n    const read = useRef(reader.read);\n    read.current = reader.read;\n    const held = useRef<Held<V>>(heldOf(identity));\n    if (held.current.identity !== identity) held.current = heldOf(identity);\n    // The pages this render shows, which its need and keep act on: each is new\n    // once the pages start afresh, so an effect keyed on it asks for the new ones.\n    const at = held.current;\n    const [, rendered] = useReducer((n: number) => n + 1, 0);\n    // Shows what changed in a render after the one that asked: never an update while one renders.\n    const show = useCallback(() => queueMicrotask(rendered), []);\n\n    const need = useCallback((first: number, last: number) => {\n        let asked = false;\n        for (let page = Math.max(0, first); page <= last; page++) {\n            if (at.pages.has(page) || at.reading.has(page)) continue;\n            at.reading.add(page);\n            asked = true;\n            const live = (): boolean => held.current === at;\n            new Promise<V | undefined>((resolve) => resolve(read.current(page, live))).then((value) => {\n                if (live() && value !== undefined) at.pages = new Map(at.pages).set(page, value);\n            }, (err: unknown) => {\n                if (live()) at.failure ??= err instanceof Error ? err : new Error(String(err));\n            }).finally(() => {\n                if (!live()) return;\n                at.reading.delete(page);\n                rendered();\n            });\n        }\n        if (asked) show();\n    }, [at, show]);\n    const keep = useCallback((first: number, last: number) => {\n        const kept = pruneRetainedPages(at.pages, first, last, retain);\n        if (kept === at.pages) return;\n        at.pages = kept;\n        show();\n    }, [at, retain, show]);\n    const reset = useCallback((pages?: ReadonlyMap<number, V>) => {\n        held.current = heldOf(held.current.identity, pages);\n        rendered();\n    }, []);\n    return { pages: at.pages, loading: at.reading.size, failure: at.failure, need, keep, reset };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { debugFlag } from '@elaraai/east-ui-components/internal';\n\n/**\n * Opt-in debug logging for the paged dataset preview (#497).\n *\n * Silent by default. Enable with `localStorage['e3-paging-debug'] = '1'`\n * (any value except 'off') to trace page fetches, resets, and short-page\n * clamps in the console — everything is prefixed `[e3-paging]`.\n */\nexport function pagingDebug(...args: unknown[]): void {\n    if (!debugFlag('e3-paging-debug')) return;\n    console.info('[e3-paging]', ...args);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<PagedDatasetPreview>` — virtual-scroll preview of a large collection\n * dataset.\n *\n * Rides the ValueTree renderer's remote-paging contract: the tree's\n * scrollbar spans the WHOLE collection, unloaded rows render as\n * placeholders, and scrolling requests the element windows that come into\n * view (fetched through the paged dataset API, one page per window, deduped\n * and cached by content hash, and held as the page cache the query builder's\n * paged result shares holds them, `page-reads.ts`). Used by `<DatasetPreview>` when a dataset's\n * type is pageable (Array/Set/Dict) and its value exceeds the inline display\n * limit — pageable datasets always load, they never dead-end on size.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Box, Flex, Text } from '@chakra-ui/react';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { ApiError, DatasetHashMismatchError, datasetFindKey, datasetGetPage } from '@elaraai/e3-api-client';\nimport type { DatasetPage, RequestOptions } from '@elaraai/e3-api-client';\nimport { none, some, variant, decodeBeast2For, type EastTypeValue } from '@elaraai/east';\nimport { ValueTree } from '@elaraai/east-ui';\nimport { pruneRetainedPages } from '@elaraai/east-ui/internal';\nimport {\n    EastChakraValueTree,\n    useFormatters,\n    type ValueTreeValue,\n    type ValueTreePagedRow,\n    type ValueTreePaging,\n} from '@elaraai/east-ui-components';\nimport { StatusDisplay } from './StatusDisplay.js';\nimport { DatasetKeySearch, type DatasetKeyMatchRange, type DatasetKeyQuery } from '@elaraai/east-ui-components';\nimport { DownloadButton, formatSize } from './DatasetPreview.js';\nimport { SEARCH_DEBOUNCE_MS, useControlledKeySearch } from './controlled-search.js';\nimport { usePageReads } from './page-reads.js';\nimport { treeControlsOf, type PreviewControls } from './preview-controls.js';\nimport { pagingDebug } from '../debug.js';\n\n/** Elements REQUESTED per page — one remote window per scroll-ahead page.\n *  The server may serve fewer (it trims pages of wide rows to a byte\n *  budget); the preview then addresses pages by what it serves — see\n *  {@link servedPageSize}. */\nconst PAGE_SIZE = 500;\n\n/**\n * The page size to address pages by, given one landed page (#829).\n *\n * The server trims every page of a dataset to the same byte budget, so a page\n * that came back SHORT while the dataset has more beyond it tells the size\n * every later page will be served at. Addressing pages by the requested size\n * instead would start page `p + 1` past the trimmed page's end and skip the\n * rows between for good. A short FINAL page is only the data ending.\n *\n * @param requested - Elements the page asked for\n * @param page - The landed page's placement\n * @returns The size to address pages by from here on\n */\nexport function servedPageSize(\n    requested: number,\n    page: Pick<DatasetPage, 'offset' | 'count' | 'totalElements'>,\n): number {\n    const trimmed = page.count < requested && page.offset + page.count < page.totalElements;\n    return trimmed ? Math.max(1, page.count) : requested;\n}\n\n/** Loaded pages retained around the current window. Materialized rows are\n *  heavy (each row's whole value becomes ValueTree node IR — wide rows run\n *  to tens of KB apiece), so unbounded retention OOMs the webview on\n *  GB-scale datasets, and re-flattening every retained page on each page\n *  arrival is what made scrolling degrade over time. Evicted pages fall\n *  back to placeholders and reload on return (raw page bytes stay in the\n *  hash-pinned query cache, so a return pays decode + materialize only). */\nconst MAX_RETAINED_PAGES = 8;\n\n/** Page retention — the row model's `pruneRetainedPages` (moved to\n *  `@elaraai/east-ui` in #719), re-exported here for its existing importers. */\nexport { pruneRetainedPages };\n\nexport interface PagedDatasetPreviewProps {\n    apiUrl: string;\n    repo: string;\n    workspace: string;\n    /** Dotted path string, e.g. \"inputs.rows\". */\n    path: string;\n    /** The dataset's East type (an Array/Set/Dict root). */\n    type: EastTypeValue;\n    /** Content hash of the current value — resets pages when it changes. */\n    hash: string;\n    /** Stored blob size, shown alongside the totals. */\n    sizeBytes: number;\n    requestOptions?: RequestOptions;\n    /** Triggers a whole-value download (the existing download flow). */\n    onDownload: () => void | Promise<void>;\n    /** Called when the server refuses the blob as un-pageable\n     *  (`dataset_not_indexed` — a legacy blob predating the stored-segmented\n     *  contract). The parent falls back to the inline tree so pre-index\n     *  values keep rendering instead of dead-ending here. */\n    onNotIndexed?: () => void;\n    /** `false` draws no band above the rows — no totals, key search or\n     *  Download (#1120), nor the tree's Collapse all and Expand all (#1209).\n     *  Default `true`. */\n    toolbar?: boolean;\n    /** The key search, controlled: found on the server as the search box\n     *  finds a query, scrolled to its first match; the preview draws no\n     *  search box of its own (#1120). */\n    search?: string;\n    /** Told the text of the preview's own search box as it is edited, unless\n     *  `search` is given. */\n    onSearchChange?: (search: string) => void;\n    /** The handle a host's own Collapse all and Expand all act on the tree\n     *  through (#1209). */\n    controls?: PreviewControls;\n}\n\n/**\n * Materializes one decoded page into the ValueTree renderer's paged-row\n * contract: an Array's or a Set's elements by their place in the whole, a\n * Dict's values under their keys — String keys as steps, others labelled.\n *\n * @param type - The collection's type: an Array, a Set or a Dict\n * @param decoded - The page, a value of that type\n * @param offset - The page's first element's place in the whole collection\n * @returns The page's root rows\n *\n * @internal\n */\nexport function pageRows(type: EastTypeValue, decoded: unknown, offset: number): ValueTreePagedRow[] {\n    if (type.type === 'Array') {\n        const elemType = type.value as EastTypeValue;\n        return (decoded as unknown[]).map((el, i) => ({\n            node: ValueTree.materialize(elemType, el),\n            step: variant('index', BigInt(offset + i)),\n        }));\n    }\n    if (type.type === 'Dict') {\n        const { key: keyType, value: valueType } = type.value as { key: EastTypeValue; value: EastTypeValue };\n        const stringKeys = keyType.type === 'String';\n        return Array.from((decoded as Map<unknown, unknown>).entries()).map(([k, v], i) => ({\n            node: ValueTree.materialize(valueType, v),\n            step: stringKeys ? variant('key', k as string) : variant('index', BigInt(offset + i)),\n            label: stringKeys ? (k as string) : ValueTree.keyLabel(keyType, k),\n        }));\n    }\n    const elemType = type.value as EastTypeValue;\n    return Array.from((decoded as Set<unknown>).values()).map((el, i) => ({\n        node: ValueTree.materialize(elemType, el),\n        step: variant('index', BigInt(offset + i)),\n    }));\n}\n\n/**\n * The empty collection value of a pageable root — the paged tree's root node\n * carries kind only; rows come from the pages.\n *\n * @param type - The collection's type: an Array, a Set or a Dict\n * @returns The empty value of it\n *\n * @internal\n */\nexport function emptyOf(type: EastTypeValue): unknown {\n    return type.type === 'Array' ? [] : type.type === 'Dict' ? new Map() : new Set();\n}\n\nexport const PagedDatasetPreview = memo(function PagedDatasetPreview({\n    apiUrl,\n    repo,\n    workspace,\n    path,\n    type,\n    hash,\n    sizeBytes,\n    requestOptions,\n    onDownload,\n    onNotIndexed,\n    toolbar = true,\n    search,\n    onSearchChange,\n    controls,\n}: PagedDatasetPreviewProps) {\n    // The totals line, in the app's locale (#850).\n    const words = useFormatters();\n    const queryClient = useQueryClient();\n    const [totals, setTotals] = useState<{ elements: number; bytes: number } | null>(null);\n    /** Key-search jump target — the tree's controlled scrollToRow (#520). */\n    const [jumpRow, setJumpRow] = useState<number | undefined>(undefined);\n    // The size pages are addressed by — requested at PAGE_SIZE, then whatever\n    // the server actually serves (#829). The ref is what an in-flight load\n    // checks when it lands: a page fetched at a size since abandoned covers\n    // the wrong rows.\n    const [pageSize, setPageSize] = useState(PAGE_SIZE);\n    const pageSizeRef = useRef(PAGE_SIZE);\n    // How a trimmed page starts the pages afresh: the reads' own, once made.\n    const resetPages = useRef<(pages?: ReadonlyMap<number, readonly ValueTreePagedRow[]>) => void>(() => {});\n\n    // A new value (content hash) invalidates every page: the reads start\n    // afresh by it, and its totals, its jump and its page size here.\n    useEffect(() => {\n        pagingDebug(`reset (path=${path}, hash=${hash.slice(0, 8)})`);\n        setTotals(null);\n        setJumpRow(undefined);\n        pageSizeRef.current = PAGE_SIZE;\n        setPageSize(PAGE_SIZE);\n    }, [path, hash]);\n\n    // One page, read for the value the preview shows: a page that lands once\n    // the value has moved belongs to the old value, and lands nothing.\n    const readPage = useCallback(async (pageIdx: number, live: () => boolean): Promise<readonly ValueTreePagedRow[] | undefined> => {\n        const size = pageSizeRef.current;\n        pagingDebug(`fetch p${pageIdx} (offset=${pageIdx * size}, limit=${size}, hash=${hash.slice(0, 8)})`);\n        const pathParts = path.split('.').filter(Boolean).map((v) => variant('field', v));\n        const reqOpts = requestOptions ?? { token: null };\n        let page: DatasetPage;\n        try {\n            page = await queryClient.fetchQuery({\n                queryKey: ['datasetPage', apiUrl, repo, workspace, path, hash, `p${pageIdx}@${size}`],\n                // Hash-pinned: the URL is a pure function of the bytes, so any\n                // HTTP cache between here and the server can hold it immutably.\n                queryFn: () => datasetGetPage(apiUrl, repo, workspace, pathParts, { offset: pageIdx * size, limit: size, hash }, reqOpts),\n                staleTime: Infinity, // pages of one content hash are immutable\n            });\n        } catch (err) {\n            pagingDebug(`p${pageIdx} FAILED:`, err);\n            if (!live()) return undefined;\n            if (err instanceof DatasetHashMismatchError) {\n                // The dataset holds another value now, which is no failure:\n                // its status, fetched again, names the new hash, and the new\n                // hash re-keys this preview.\n                void queryClient.invalidateQueries({ queryKey: ['datasetStatus', apiUrl, repo, workspace, path] });\n                return undefined;\n            }\n            if (err instanceof ApiError && err.code === 'dataset_not_indexed') {\n                // A legacy (pre-index) blob cannot page — hand back to the\n                // parent, which falls back to the inline tree. The error\n                // state below stays as the backstop UI if no parent handles.\n                onNotIndexed?.();\n            }\n            throw err;\n        }\n        if (!live()) return undefined;\n        if (size !== pageSizeRef.current) return undefined; // addressed at an abandoned size — the tree re-asks\n        const decoded = decodeBeast2For(type)(page.data);\n        const rows = pageRows(type, decoded, page.offset);\n        pagingDebug(`p${pageIdx} ok: count=${page.count} rows=${rows.length} offset=${page.offset} total=${page.totalElements} segs=${page.segmentCount}`,\n            rows.length > 0 ? `first=${JSON.stringify(rows[0]!.label ?? '(derived)')}` : '(empty)');\n        setTotals({ elements: page.totalElements, bytes: page.totalBytes });\n        const served = servedPageSize(size, page);\n        if (served === size) return rows;\n        // Trimmed: every later page is served at this size, so address\n        // pages by it. Page 0 keeps its place — `[0, served)` is exactly\n        // what it holds; a later page re-learning (a server that did not\n        // trim uniformly) drops everything and the tree re-asks.\n        pagingDebug(`p${pageIdx} SHORT page: served ${page.count} of ${size} — addressing pages by ${served}`);\n        pageSizeRef.current = served;\n        setPageSize(served);\n        resetPages.current(pageIdx === 0 ? new Map([[0, rows]]) : new Map());\n        return undefined;\n    }, [queryClient, apiUrl, repo, workspace, path, hash, requestOptions, type, onNotIndexed]);\n    // Each page read once while it is wanted, those far from the window let\n    // go: materialized rows are heavy (see MAX_RETAINED_PAGES).\n    const reads = usePageReads({ identity: `${path}\\u0000${hash}`, read: readPage, retain: MAX_RETAINED_PAGES });\n    resetPages.current = reads.reset;\n    const { pages, need, keep } = reads;\n    const error = reads.failure;\n\n    // First page carries the totals that size the virtual scrollbar. A new\n    // value's pages are read afresh, and `need` with them, so it asks again.\n    useEffect(() => {\n        if (totals === null && error === undefined) need(0, 0);\n    }, [totals, error, need]);\n\n    const onNeedRows = useCallback((startRow: number, endRow: number) => {\n        const first = Math.max(0, Math.floor(startRow / pageSize));\n        const last = Math.max(first, Math.ceil(endRow / pageSize) - 1);\n        pagingDebug(`need rows [${startRow}, ${endRow}) → pages ${first}..${last}`);\n        // Retention: drop pages far from this window (the same pages while\n        // under the cap), so heap and per-arrival re-flatten stay bounded\n        // however far the user roams.\n        keep(first, last);\n        need(first, last);\n    }, [need, keep, pageSize]);\n\n    // Key search (#520): queries resolve server-side against the segment\n    // fences; results and popup windows are hash-pinned and immutable, so\n    // repeated type-ahead queries are cache hits.\n    const keyType = useMemo<EastTypeValue | null>(() => (\n        type.type === 'Dict' ? (type.value as { key: EastTypeValue; value: EastTypeValue }).key\n        : type.type === 'Set' ? type.value as EastTypeValue\n        : null\n    ), [type]);\n    const pathParts = useMemo(() => path.split('.').filter(Boolean).map((v) => variant('field', v)), [path]);\n    const onFindKey = useCallback(async (query: DatasetKeyQuery): Promise<DatasetKeyMatchRange> => {\n        const reqOpts = requestOptions ?? { token: null };\n        const queryTag = JSON.stringify(query);\n        const result = await queryClient.fetchQuery({\n            queryKey: ['datasetFind', apiUrl, repo, workspace, path, hash, queryTag],\n            queryFn: () => datasetFindKey(apiUrl, repo, workspace, pathParts, { ...query, hash }, reqOpts),\n            staleTime: Infinity, // hash-pinned: one content hash, one answer\n        });\n        pagingDebug(`find ${queryTag}: found=${result.found} row=${result.row} count=${result.count}`);\n        return result;\n    }, [queryClient, apiUrl, repo, workspace, path, hash, pathParts, requestOptions]);\n    const onListRange = useCallback(async (row: number, limit: number): Promise<string[]> => {\n        const reqOpts = requestOptions ?? { token: null };\n        const page = await queryClient.fetchQuery({\n            queryKey: ['datasetPage', apiUrl, repo, workspace, path, hash, `w${row}:${limit}`],\n            queryFn: () => datasetGetPage(apiUrl, repo, workspace, pathParts, { offset: row, limit, hash }, reqOpts),\n            staleTime: Infinity,\n        });\n        const decoded = decodeBeast2For(type)(page.data);\n        const stringKeys = keyType !== null && keyType.type === 'String';\n        const keys = type.type === 'Dict'\n            ? [...(decoded as Map<unknown, unknown>).keys()]\n            : [...(decoded as Set<unknown>).values()];\n        return keys.map((k) => (stringKeys ? k as string : ValueTree.keyLabel(keyType as never, k)));\n    }, [queryClient, apiUrl, repo, workspace, path, hash, pathParts, requestOptions, type, keyType]);\n    // A search the host controls: each find a request, so the text must hold\n    // a moment first, as in the search box (#1120).\n    useControlledKeySearch(search, keyType, onFindKey, setJumpRow, SEARCH_DEBOUNCE_MS);\n\n    const treeValue = useMemo<ValueTreeValue>(() => ({\n        root: ValueTree.materialize(type, emptyOf(type)),\n        onEdit: none,\n        onInsert: none,\n        onRemove: none,\n        onTag: none,\n        // The tree's Collapse all and Expand all are a band too (#1209).\n        style: some({ height: some('100%'), maxHeight: none, openDepth: none, toolbar: some(toolbar) }),\n    }) as unknown as ValueTreeValue, [type, toolbar]);\n\n    const paging = useMemo<ValueTreePaging | null>(() => (\n        totals === null ? null : {\n            totalRows: totals.elements,\n            pageSize,\n            pages,\n            onNeedRows,\n            scrollToRow: jumpRow,\n        }\n    ), [totals, pageSize, pages, onNeedRows, jumpRow]);\n\n    if (error !== undefined) {\n        // The server refusing for its own safety (read cap) is not a\n        // failure — show the remedy and the download escape hatch.\n        if (error instanceof ApiError && error.code === 'dataset_too_large') {\n            return (\n                <Flex height=\"100%\" direction=\"column\" align=\"center\" justify=\"center\" gap={3} p={6}>\n                    <Text fontSize=\"title.md\" color=\"fg.warning\" fontWeight=\"bold\">Too large to page</Text>\n                    <Text color=\"fg.muted\" fontSize=\"body.lg\" textAlign=\"center\" maxW=\"32rem\">\n                        {typeof error.details === 'string' ? error.details : 'This dataset cannot be paged server-side.'}\n                    </Text>\n                    <DownloadButton onClick={onDownload} label=\"Download value\" />\n                </Flex>\n            );\n        }\n        return <StatusDisplay variant=\"error\" title=\"Paged load failed\" message={error.message} />;\n    }\n    if (paging === null || totals === null) {\n        return <StatusDisplay variant=\"loading\" title=\"Loading...\" />;\n    }\n\n    const itemNoun = type.type === 'Dict' ? 'entries' : 'items';\n    return (\n        <Flex direction=\"column\" height=\"100%\" overflow=\"hidden\">\n            {toolbar && (\n                <Flex px={4} py={2} gap={2} align=\"center\" flexShrink={0} borderBottom=\"1px solid\" borderColor=\"border.subtle\">\n                    <Text fontSize=\"body.sm\" color=\"fg.muted\" whiteSpace=\"nowrap\">\n                        {words.number(totals.elements)} {itemNoun} · {formatSize(totals.bytes > 0 ? totals.bytes : sizeBytes, words)}\n                    </Text>\n                    {reads.loading > 0 && <Text fontSize=\"body.sm\" color=\"fg.muted\">Loading…</Text>}\n                    {search === undefined && keyType !== null && (\n                        <DatasetKeySearch keyType={keyType} onFind={onFindKey} onListRange={onListRange}\n                            onJump={setJumpRow} onClear={() => setJumpRow(undefined)} onInputChange={onSearchChange} />\n                    )}\n                    <Flex flex={1} justify=\"flex-end\">\n                        <DownloadButton onClick={onDownload} />\n                    </Flex>\n                </Flex>\n            )}\n            <Box flex={1} minHeight={0} overflow=\"hidden\">\n                <EastChakraValueTree value={treeValue} storageKey={`${path}:page`} paging={paging} controlsRef={treeControlsOf(controls)} />\n            </Box>\n        </Flex>\n    );\n}, (prev, next) => prev.apiUrl === next.apiUrl && prev.repo === next.repo && prev.workspace === next.workspace\n    && prev.path === next.path && prev.hash === next.hash && prev.sizeBytes === next.sizeBytes\n    // A rotated token, or another fetch, re-renders the preview, or its reads\n    // keep the old one.\n    && prev.requestOptions?.token === next.requestOptions?.token\n    && Object.is(prev.requestOptions?.fetch, next.requestOptions?.fetch)\n    // The host's controls (#1120, #1209).\n    && prev.toolbar === next.toolbar && prev.search === next.search\n    && Object.is(prev.onSearchChange, next.onSearchChange) && Object.is(prev.controls, next.controls));\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A step card's parts (#936) — #934's `CardPart`s and `CardLine`s as the\n * Query tab draws them (`Query Editor Spec.md` §4.3): words, with joiners in\n * a fixed column so conditions line up; slots, each the `select` trigger —\n * dashed while empty, the danger ink with a problem — which open the\n * autocomplete; inputs, which edit on leaving; chips with their ×; adds,\n * dashed in a row and quiet in a foot; a row's ×; a jq step's code; groups\n * with their own head; and the problem lines under the rows that caused\n * them, with the checker's own sentence on hover and its fixes as buttons.\n *\n * Every part says what it was asked to do through {@link PartActions}; the\n * Query tab makes each one gesture of the editing session. State reaches the\n * styles through data attributes on the `queryBuilder` recipe's slots.\n *\n * @packageDocumentation\n */\n\nimport { Fragment, memo, useRef, useState, type KeyboardEvent, type ReactElement, type ReactNode } from \"react\";\nimport { Box, Button, Portal, Tooltip, chakra, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { library } from \"@fortawesome/fontawesome-svg-core\";\nimport { fas, faCaretDown, faCircleExclamation, faCircleInfo, faPlus, faTriangleExclamation, faXmark, type IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { useValueSync } from \"@elaraai/east-ui-components\";\nimport type { CardLine, CardPart, ProblemLine } from \"./model/cards.js\";\nimport type { ActionRef, InputRef, RemoveRef, SlotRef } from \"./model/refs.js\";\nimport type { QueryWords } from \"./model/words.js\";\nimport type { StepFix } from \"./steps/check.js\";\n\n// A step's and an offer's icons are Font Awesome names; register the free-solid\n// set so they resolve by name (idempotent).\nlibrary.add(fas);\n\n/** A recipe's styles, by slot. */\nexport type Styles = Record<string, SystemStyleObject>;\n\nconst textEqual = equalFor(StringType);\n\n/** What the parts ask of the Query tab. */\nexport interface PartActions {\n    /** The key of the slot whose autocomplete is open. */\n    readonly openSlot: string | undefined;\n    /** Opens a slot's autocomplete, hanging from its element. */\n    readonly onSlot: (slot: SlotRef, anchor: HTMLElement) => void;\n    /** An input typed in and left. */\n    readonly onInput: (input: InputRef, raw: string) => void;\n    /** A × pressed. */\n    readonly onRemove: (ref: RemoveRef) => void;\n    /** An add pressed: one that adds, or one that opens a slot, hanging from its element. */\n    readonly onAction: (ref: ActionRef, anchor: HTMLElement) => void;\n    /** A problem's fix taken. */\n    readonly onFix: (fix: StepFix, label: string) => void;\n}\n\n/** What drawing the parts needs: the styles of the recipes they are made of, and the words. */\nexport interface PartStyles {\n    /** The `queryBuilder` recipe's. */\n    readonly styles: Styles;\n    /** The `select` recipe's, small: a slot is its trigger. */\n    readonly select: Styles;\n    /** The `input` recipe's, small. */\n    readonly input: SystemStyleObject;\n    /** The `iconButton` recipe's, quiet and extra small. */\n    readonly icon: SystemStyleObject;\n    /** The `codeBlock` recipe's. */\n    readonly code: Styles;\n    /** The words. */\n    readonly words: QueryWords;\n}\n\n/**\n * The parts' styles: the `queryBuilder` recipe's, and the core recipes' a\n * part is made of.\n *\n * @param words - The words\n * @returns The styles, and the words\n */\nexport function usePartStyles(words: QueryWords): PartStyles {\n    const styles = useSlotRecipe({ key: \"queryBuilder\" })() as Styles;\n    const select = useSlotRecipe({ key: \"select\" })({ size: \"sm\" }) as Styles;\n    const input = useRecipe({ key: \"input\" })({ size: \"xs\" }) as SystemStyleObject;\n    const icon = useRecipe({ key: \"iconButton\" })({ size: \"xs\", variant: \"ghost\" }) as SystemStyleObject;\n    const code = useSlotRecipe({ key: \"codeBlock\" })() as Styles;\n    return { styles, select, input, icon, code, words };\n}\n\n/**\n * A slot's key: what its element carries as `data-slot-key`, so the slot a\n * pick opens next is found after the query renders again.\n *\n * @param slot - The slot\n * @returns Its key\n */\nexport function slotKey(slot: SlotRef): string {\n    return [slot.kind, slot.stepId, slot.condId ?? \"\", slot.id ?? \"\", slot.at === undefined ? \"\" : String(slot.at)].join(\"|\");\n}\n\n/**\n * A tooltip over a control: the design system's, after a moment's hover.\n *\n * @param props - The words it shows, and the control\n * @returns The control, with its tooltip\n */\nexport function Tip({ label, children }: { label: string; children: ReactElement }) {\n    if (label === \"\") return children;\n    return (\n        <Tooltip.Root openDelay={250}>\n            <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>\n            <Portal><Tooltip.Positioner><Tooltip.Content>{label}</Tooltip.Content></Tooltip.Positioner></Portal>\n        </Tooltip.Root>\n    );\n}\n\n/**\n * An icon button, named for a screen reader and by its tooltip.\n *\n * @param props - Its name, its icon, whether it is off, what it does, and its styles\n * @returns The button\n */\nexport function IconPart({ label, icon, disabled = false, css, onClick }: {\n    label: string; icon: IconDefinition; disabled?: boolean; css: SystemStyleObject | SystemStyleObject[]; onClick: () => void;\n}) {\n    return (\n        <Tip label={label}>\n            <chakra.button type=\"button\" css={css} aria-label={label} disabled={disabled} onClick={onClick}>\n                <FontAwesomeIcon icon={icon} />\n            </chakra.button>\n        </Tip>\n    );\n}\n\n/** An input of a step card: typed in, and edited on leaving. */\nexport const InputPart = memo(function InputPart({ part, ps, actions }: {\n    part: Extract<CardPart, { t: \"input\" }>; ps: PartStyles; actions: PartActions;\n}) {\n    // Interactive state: the text typed, seeded from the step, re-synced when the step's value moves.\n    const [text, setText] = useState(part.value);\n    useValueSync(part.value, textEqual, () => setText(part.value));\n    const cancelled = useRef(false);\n    const commit = () => {\n        if (cancelled.current) {\n            cancelled.current = false;\n            return;\n        }\n        if (!textEqual(text, part.value)) actions.onInput(part.input, text);\n    };\n    const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n        if (event.key === \"Enter\" && !event.metaKey && !event.ctrlKey) {\n            event.preventDefault();\n            event.currentTarget.blur();\n        } else if (event.key === \"Escape\") {\n            event.preventDefault();\n            cancelled.current = true;\n            setText(part.value);\n            event.currentTarget.blur();\n        }\n    };\n    return (\n        <chakra.input css={[ps.input, ps.styles.input!]} value={text}\n            aria-label={ps.words.messages.inputLabel({ input: part.input.kind })}\n            aria-invalid={part.error ? true : undefined}\n            data-width={part.width} data-mono={part.mono ? \"\" : undefined} data-error={part.error ? \"\" : undefined}\n            onChange={(event) => setText(event.target.value)} onBlur={commit} onKeyDown={onKeyDown} />\n    );\n});\n\n/** One part of a row. */\nfunction Part({ part, ps, actions, ghost }: { part: CardPart; ps: PartStyles; actions: PartActions; ghost: boolean }) {\n    const { styles, words } = ps;\n    const m = words.messages;\n    switch (part.t) {\n        case \"word\":\n            return <Box as=\"span\" css={part.joiner === true ? styles.joiner : styles.word}>{part.text}</Box>;\n        case \"slot\": {\n            const key = slotKey(part.slot);\n            const open = actions.openSlot === key;\n            return (\n                <chakra.button type=\"button\" css={[ps.select.trigger!, styles.slot!]} data-slot-key={key}\n                    data-empty={part.empty ? \"\" : undefined} data-error={part.error ? \"\" : undefined}\n                    data-open={open ? \"\" : undefined} data-mono={part.mono ? \"\" : undefined}\n                    aria-haspopup=\"listbox\" aria-expanded={open}\n                    onClick={(event) => actions.onSlot(part.slot, event.currentTarget)}>\n                    <Box as=\"span\" css={styles.slotText}>{part.empty ? part.placeholder : part.text}</Box>\n                    <Box as=\"span\" css={styles.slotCaret} aria-hidden><FontAwesomeIcon icon={faCaretDown} /></Box>\n                </chakra.button>\n            );\n        }\n        case \"input\":\n            return <InputPart part={part} ps={ps} actions={actions} />;\n        case \"chip\":\n            return (\n                <Box as=\"span\" css={styles.chip} data-query-chip=\"\">\n                    {part.text}\n                    <IconPart label={`${m.remove()} ${part.text}`} icon={faXmark} css={[ps.icon, styles.chipRemove!]}\n                        onClick={() => actions.onRemove(part.remove)} />\n                </Box>\n            );\n        case \"add\": {\n            const opens = part.action.kind === \"open\" && part.action.slot !== undefined ? slotKey(part.action.slot) : undefined;\n            return (\n                <Button size=\"xs\" variant=\"ghost\" css={styles.add} data-ghost={ghost || part.ghost ? \"\" : undefined}\n                    data-slot-key={opens} onClick={(event) => actions.onAction(part.action, event.currentTarget)}>\n                    <FontAwesomeIcon icon={faPlus} />{part.text}\n                </Button>\n            );\n        }\n        case \"remove\":\n            return <IconPart label={part.label} icon={faXmark} css={[ps.icon, styles.remove!]} onClick={() => actions.onRemove(part.target)} />;\n        case \"code\":\n            return (\n                <Box css={ps.code.root} data-query-code=\"\">\n                    <Box as=\"pre\" css={ps.code.content}><Box as=\"code\" css={ps.code.code}>{part.text}</Box></Box>\n                </Box>\n            );\n    }\n}\n\n/**\n * A row's parts, in order.\n *\n * @param props - The parts, their styles and what they ask\n * @returns The parts\n */\nexport function Parts({ parts, ps, actions, ghost = false }: { parts: readonly CardPart[]; ps: PartStyles; actions: PartActions; ghost?: boolean }): ReactNode {\n    return parts.map((part, i) => <Part key={i} part={part} ps={ps} actions={actions} ghost={ghost} />);\n}\n\n/** Each severity's icon. */\nconst SEVERITY_ICON: Readonly<Record<ProblemLine[\"severity\"], IconDefinition>> = {\n    error: faCircleExclamation,\n    warning: faTriangleExclamation,\n    note: faCircleInfo,\n};\n\n/**\n * The problems under a row: each in its severity's ink, the checker's own\n * sentence on hover, and its fixes as buttons.\n *\n * @param props - The problems, their styles and what a fix asks\n * @returns The problem lines\n */\nexport function Problems({ problems, ps, actions }: { problems: readonly ProblemLine[]; ps: PartStyles; actions: PartActions }): ReactNode {\n    const { styles } = ps;\n    return problems.map((problem, i) => (\n        <Box key={i} css={styles.problem} data-severity={problem.severity} data-query-problem={problem.code}>\n            <Box as=\"span\" css={styles.problemIcon} aria-hidden><FontAwesomeIcon icon={SEVERITY_ICON[problem.severity]} /></Box>\n            <Tip label={problem.message === problem.text ? \"\" : problem.message}>\n                <Box as=\"span\" css={styles.problemText}>{problem.text}</Box>\n            </Tip>\n            {problem.fixes.map((fix, j) => (\n                <Button key={j} size=\"xs\" variant=\"outline\" data-query-fix=\"\" onClick={() => actions.onFix(fix.fix, fix.label)}>{fix.label}</Button>\n            ))}\n        </Box>\n    ));\n}\n\n/**\n * A card's lines: rows, groups with their head and lines, feet, notes and a\n * jq step's code, each with the problems under it.\n *\n * @param props - The lines, their styles and what they ask\n * @returns The lines\n */\nexport function Lines({ lines, ps, actions }: { lines: readonly CardLine[]; ps: PartStyles; actions: PartActions }): ReactNode {\n    const { styles } = ps;\n    return lines.map((line, i) => {\n        switch (line.kind) {\n            case \"row\":\n                return (\n                    <Fragment key={i}>\n                        <Box css={styles.row} data-query-line=\"row\"><Parts parts={line.parts} ps={ps} actions={actions} /></Box>\n                        <Problems problems={line.problems} ps={ps} actions={actions} />\n                    </Fragment>\n                );\n            case \"group\": {\n                const head = line.head ?? [];\n                return (\n                    <Fragment key={i}>\n                        <Box css={styles.group} data-query-line=\"group\">\n                            <Parts parts={line.parts} ps={ps} actions={actions} />\n                            <Box css={styles.groupBox}>\n                                <Box css={styles.groupHead}>\n                                    <Parts parts={head.filter(p => p.t !== \"remove\")} ps={ps} actions={actions} />\n                                    <Box css={styles.cardSpacer} />\n                                    <Parts parts={head.filter(p => p.t === \"remove\")} ps={ps} actions={actions} />\n                                </Box>\n                                <Lines lines={line.lines ?? []} ps={ps} actions={actions} />\n                            </Box>\n                        </Box>\n                        <Problems problems={line.problems} ps={ps} actions={actions} />\n                    </Fragment>\n                );\n            }\n            case \"foot\":\n                return (\n                    <Fragment key={i}>\n                        <Box css={styles.cardFoot} data-query-line=\"foot\"><Parts parts={line.parts} ps={ps} actions={actions} ghost /></Box>\n                        <Problems problems={line.problems} ps={ps} actions={actions} />\n                    </Fragment>\n                );\n            case \"note\":\n                return (\n                    <Box key={i} as=\"span\" css={styles.note} data-query-line=\"note\">\n                        {line.parts.map(p => (p.t === \"word\" ? p.text : \"\")).join(\" \")}\n                    </Box>\n                );\n            case \"code\":\n                return (\n                    <Fragment key={i}>\n                        <Parts parts={line.parts} ps={ps} actions={actions} />\n                        <Problems problems={line.problems} ps={ps} actions={actions} />\n                    </Fragment>\n                );\n        }\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A run's result as a Table (#938, `Query Editor Spec.md` §4.11): the rows a\n * result gives and their columns, the words a cell shows where the Table\n * words a value rather than shows it — a list by its size, a record by its\n * first fields, a case with its payload, a missing value as \"—\" — and the\n * value east-ui-components' Table renderer shows, built here, in the browser,\n * from the decoded result.\n *\n * The Table and the CSV download read the same rows ({@link resultRows}) and\n * word a cell through the same {@link cellText}, so the two never differ. A\n * result too large for one answer is the Table's paged source, read a window\n * at a time ({@link pagedResultTable}, #1113).\n *\n * @packageDocumentation\n */\n\nimport {\n    BlobType, BooleanType, NullType, SortedMap, StringType,\n    compareFor, isPrimitiveType, none, printFor, some, toEastTypeValue, variant,\n    type ArrayType, type EastType, type SetType, type StructType, type ValueTypeOf, type VariantType, type VectorType,\n    type matrix, type option, type ref,\n} from \"@elaraai/east\";\nimport type { Table } from \"@elaraai/east-ui/internal\";\nimport type { TableColumnValue, TableRootValue } from \"@elaraai/east-ui-components\";\nimport { baseType, optionPayload, singular, unwrapRecursive } from \"./steps/shape.js\";\nimport { human, isIdName, plural, type QueryWords } from \"./model/words.js\";\n\n/** One row of a Table: its cells by column key, where it sits, and whether it starts folded. */\ntype TableRow = ValueTypeOf<typeof Table.Types.Row>;\n\n/** One cell of a Table: a primitive value, under its own tag. */\ntype TableCell = ValueTypeOf<typeof Table.Types.Cell>;\n\n/**\n * A run's result, decoded: its East type and its value.\n *\n * @remarks\n * The type is the one the run's self-describing beast2 answer carries: `T`\n * for a query giving one value, `Option<T>` for none or one, `Array<T>` for\n * many.\n *\n * @property type - The result's East type\n * @property value - The decoded value, of that type\n */\nexport interface DecodedResult {\n    /** The result's East type: `T`, `Option<T>` or `Array<T>`, as the run gave it. */\n    readonly type: EastType;\n    /** The decoded value, of that type. */\n    readonly value: unknown;\n}\n\n/**\n * A column of a result's rows.\n *\n * @property key - The key each row holds the column's value under\n * @property type - The column's East type\n * @property field - The field the column reads; `undefined` for the one column of a result that is not records\n */\nexport interface ResultColumn {\n    /** The key each row holds the column's value under: a record's field name, or `value`. */\n    readonly key: string;\n    /** The column's East type: the field's, or the type of the values a result that is not records gives. */\n    readonly type: EastType;\n    /**\n     * The field the column reads, whose name names a list's items in it\n     * (`3 lines`); `undefined` for the one `value` column of a result that is\n     * not records, whose lists' items are `items`.\n     */\n    readonly field: string | undefined;\n}\n\n/**\n * A result's rows, as the Table shows them and the CSV writes them.\n *\n * @property columns - The columns, in order\n * @property rows - The rows, each a struct value keyed by column key\n */\nexport interface ResultRows {\n    /** The columns, in order: a record's fields, in declared order, or the one `value` column. */\n    readonly columns: readonly ResultColumn[];\n    /** The rows, each a struct value keyed by column key: a record itself, or `{ value }`. */\n    readonly rows: readonly unknown[];\n}\n\n/** The key of the one column a result that is not records gives. */\nconst VALUE_KEY = \"value\";\n\n/** How many of a record's fields its summary shows, at most. */\nconst SUMMARY_FIELDS = 3;\n\n/** The kinds a summary leaves out of a record's: collections and records, which say little in a few words. */\nconst NESTED_KINDS: ReadonlySet<EastType[\"type\"]> = new Set([\"Array\", \"Set\", \"Vector\", \"Matrix\", \"Dict\", \"Struct\"]);\n\n/** Cells keyed in East's order of their keys. */\nconst compareKeys = compareFor(StringType);\n\n/** How East prints the values a summary shows as East prints them. */\nconst printBoolean = printFor(BooleanType);\nconst printNull = printFor(NullType);\nconst printBlob = printFor(BlobType);\n\n// ─── Rows and columns ────────────────────────────────────────────────────────\n\n/**\n * A result's rows and columns, as the Table shows them (`Query Editor\n * Spec.md` §4.11).\n *\n * @param result - the decoded result: its type, and its value\n * @returns the columns, in order, and the rows, each a struct value keyed by\n *   column key\n *\n * @remarks\n * - **Records.** An array or a set of records — a recursive element read as\n *   its node — is one row per element and one column per field, in declared\n *   order; a record is one row.\n * - **An option.** `none` is no rows, with the columns its payload would\n *   give; `some` is its payload's rows.\n * - **Anything else.** An array, a set or a vector of other values is one\n *   row per value — a vector's numbers or booleans, as East reads them out of\n *   it — and any other value one row, in one `value` column: each row is\n *   `{ value }`.\n *\n * @example\n * ```ts\n * const { columns, rows } = resultRows({ type: ArrayType(Order), value: orders });\n * // columns: customer_id, discount, id, lines, status, total — one row per order\n *\n * resultRows({ type: IntegerType, value: 40n });\n * // columns: value — rows: [{ value: 40n }]\n * ```\n */\nexport function resultRows(result: DecodedResult): ResultRows {\n    return { columns: columnsOf(result.type), rows: rowsOf(result.type, result.value) };\n}\n\n/**\n * The columns a value of a type gives: an option's payload's, a record's\n * fields, an array's or a set's records' fields, or one `value` column.\n *\n * @param type - the type\n * @returns the columns, in order\n */\nfunction columnsOf(type: EastType): ResultColumn[] {\n    const payload = optionPayload(type);\n    if (payload !== undefined) return columnsOf(payload);\n    const t = unwrapRecursive(type);\n    if (t.type === \"Array\" || t.type === \"Set\" || t.type === \"Vector\") {\n        const element = elementOf(t);\n        const record = recordOf(element);\n        return record === undefined ? [valueColumn(element)] : fieldColumns(record);\n    }\n    return t.type === \"Struct\" ? fieldColumns(t) : [valueColumn(type)];\n}\n\n/**\n * The rows a value of a type gives, in the order {@link columnsOf} reads them.\n *\n * @param type - the type\n * @param value - the value\n * @returns the rows, each a struct value keyed by column key\n */\nfunction rowsOf(type: EastType, value: unknown): readonly unknown[] {\n    const payload = optionPayload(type);\n    if (payload !== undefined) {\n        const option = value as option<unknown>;\n        return option.type === \"some\" ? rowsOf(payload, option.value) : [];\n    }\n    const t = unwrapRecursive(type);\n    if (t.type === \"Array\" || t.type === \"Set\" || t.type === \"Vector\") {\n        // A set iterates in East's order of its keys.\n        const items = t.type === \"Array\" ? value as readonly unknown[]\n            : t.type === \"Set\" ? [...value as ReadonlySet<unknown>]\n            : vectorItems(t, value);\n        return recordOf(elementOf(t)) === undefined ? items.map(item => ({ [VALUE_KEY]: item })) : items;\n    }\n    return t.type === \"Struct\" ? [value] : [{ [VALUE_KEY]: value }];\n}\n\n/** An array's, a set's or a vector's element type. */\nfunction elementOf(type: ArrayType | SetType | VectorType): EastType {\n    return (type.type === \"Array\" ? type.value : type.type === \"Set\" ? type.key : type.element) as EastType;\n}\n\n/**\n * A vector's elements as East values, as East's own `VectorToArray` reads\n * them out: a vector of numbers holds them as they are, and a vector of\n * booleans holds each as a byte, 0 for false.\n */\nfunction vectorItems(type: VectorType, value: unknown): readonly unknown[] {\n    switch (unwrapRecursive(type.element as EastType).type) {\n        case \"Boolean\": return Array.from(value as Uint8ClampedArray, byte => byte !== 0);\n        case \"Integer\": return Array.from(value as BigInt64Array);\n        default: return Array.from(value as Float64Array);\n    }\n}\n\n/** The record an element is, read through its recursive wrapper; `undefined` when it is no record. */\nfunction recordOf(element: EastType): StructType | undefined {\n    const node = unwrapRecursive(element);\n    return node.type === \"Struct\" ? node : undefined;\n}\n\n/** A record's fields, as columns, in declared order. */\nfunction fieldColumns(record: StructType): ResultColumn[] {\n    return Object.entries(record.fields as Record<string, EastType>).map(([name, type]) => ({ key: name, type, field: name }));\n}\n\n/** The one column of a result that is not records. */\nfunction valueColumn(type: EastType): ResultColumn {\n    return { key: VALUE_KEY, type, field: undefined };\n}\n\n// ─── A cell's words ──────────────────────────────────────────────────────────\n\n/**\n * The words a result's cell shows for a value the Table words rather than\n * shows as itself (`Query Editor Spec.md` §4.11): a nested value summarised,\n * and a missing one.\n *\n * @param type - the value's East type\n * @param value - the value\n * @param words - the words\n * @param field - the field the value sits in, whose name names a list's\n *   items: a column's `field`; `undefined` for the one `value` column, whose\n *   lists' items are `items`\n * @returns the words; `undefined` for a primitive value — Null, Boolean,\n *   Integer, Float, String, DateTime, Blob, under any options — which a cell\n *   holds as itself\n *\n * @remarks\n * - **Missing.** An option's `none` is the missing word, \"—\"; its `some` is\n *   its payload's words. A recursive value is its node's.\n * - **A list** (an array, a set, a vector) is its size and its items, named\n *   after its field: \"1 line\", \"3 lines\"; \"3 items\" where no field names\n *   them. **A lookup table** is \"1 entry\", \"8 entries\"; **a grid** its shape,\n *   \"3 × 4\".\n * - **A record** is up to its first three fields that are neither a\n *   collection nor a record, missing ones left out, joined \" · \".\n * - **A case** is its name; with a payload, \"{case} · {payload}\" — a record\n *   payload's every field, missing ones left out; a Null payload, the case\n *   alone. **A calculation** is \"function\".\n * - **Inside a summary**, a number prints in the viewer's language through\n *   the words' formatters, exactly: an ID field's as written, a whole number\n *   grouped, any other with every digit (§9 — never rounded); a DateTime as\n *   its date and time, and a Boolean, a Null and a Blob as East prints them.\n *\n * @example\n * ```ts\n * cellText(ArrayType(Line), lines, words, \"lines\");            // \"3 lines\"\n * cellText(Status, variant(\"shipped\", { date }), words, \"status\"); // \"shipped · Jun 1, 2026, 14:00\"\n * cellText(OptionType(FloatType), none, words, \"discount\");     // \"—\"\n * cellText(FloatType, 1234.5, words, \"total\");                  // undefined: the cell holds 1234.5\n * ```\n */\nexport function cellText(type: EastType, value: unknown, words: QueryWords, field: string | undefined): string | undefined {\n    const payload = optionPayload(type);\n    if (payload !== undefined) {\n        const option = value as option<unknown>;\n        return option.type === \"some\" ? cellText(payload, option.value, words, field) : words.messages.resultMissing();\n    }\n    if (isPrimitiveType(unwrapRecursive(type))) return undefined;\n    return summaryText(type, value, words, field) ?? words.messages.resultMissing();\n}\n\n/**\n * A value's text inside a summary: a primitive printed, a nested value in\n * words.\n *\n * @param type - the value's East type\n * @param value - the value\n * @param words - the words\n * @param field - the field the value sits in, if any\n * @returns the text; `undefined` for a missing value, which a summary leaves out\n */\nfunction summaryText(type: EastType, value: unknown, words: QueryWords, field: string | undefined): string | undefined {\n    const payload = optionPayload(type);\n    if (payload !== undefined) {\n        const option = value as option<unknown>;\n        return option.type === \"some\" ? summaryText(payload, option.value, words, field) : undefined;\n    }\n    const t = unwrapRecursive(type);\n    const f = words.formatters;\n    const m = words.messages;\n    const id = field !== undefined && isIdName(field);\n    switch (t.type) {\n        case \"Never\": return undefined;\n        case \"Null\": return printNull(value as null);\n        case \"Boolean\": return printBoolean(value as boolean);\n        case \"Integer\": return id ? f.bare(value as bigint) : f.number(value as bigint);\n        case \"Float\": return id ? f.bare(value as number) : f.float(value as number);\n        case \"String\": return value as string;\n        case \"DateTime\": return f.dateTime(value as Date);\n        case \"Blob\": return printBlob(value as Uint8Array);\n        case \"Ref\": return summaryText(t.value as EastType, (value as ref<unknown>).value, words, field);\n        case \"Array\": return listText((value as readonly unknown[]).length, words, field);\n        case \"Set\": return listText((value as ReadonlySet<unknown>).size, words, field);\n        // A typed array of its numbers or booleans.\n        case \"Vector\": return listText((value as ArrayLike<unknown>).length, words, field);\n        case \"Matrix\": {\n            const grid = value as matrix;\n            return m.resultGrid({ rows: f.number(grid.rows), cols: f.number(grid.cols) });\n        }\n        case \"Dict\": {\n            const n = (value as ReadonlyMap<unknown, unknown>).size;\n            return m.resultEntries({ count: f.number(n), n });\n        }\n        case \"Struct\": return recordText(t, value, words);\n        case \"Variant\": return caseText(t, value, words);\n        case \"Recursive\": return summaryText(t.node as EastType, value, words, field);\n        case \"Function\": case \"AsyncFunction\": return m.resultFunction();\n    }\n}\n\n/**\n * A list by its size and its items: \"1 line\", \"3 lines\", named after the\n * field holding it; \"3 items\" where no field does.\n *\n * @param n - how many items\n * @param words - the words\n * @param field - the field holding the list, if any\n * @returns the words\n */\nfunction listText(n: number, words: QueryWords, field: string | undefined): string {\n    return words.messages.resultList({ count: words.formatters.number(n), noun: field === undefined ? words.messages.itemsWord({ n }) : itemNoun(field, n) });\n}\n\n/**\n * What a list's items are called, from the field holding it: its singular for\n * one, and its plural — the field's own name when that is not a regular\n * plural, as `children` is not, since a list's field names its items\n * (`plainKind`'s `items`).\n *\n * @param field - the field's name\n * @param n - how many items\n * @returns the noun, in the count's number\n */\nfunction itemNoun(field: string, n: number): string {\n    const one = singular(field);\n    if (n === 1) return human(one);\n    return one === field ? human(field) : plural(human(one));\n}\n\n/**\n * A record in a summary: up to its first {@link SUMMARY_FIELDS} fields that\n * are neither a collection nor a record, missing ones left out.\n *\n * @param record - the record's type\n * @param value - the record\n * @param words - the words\n * @returns the fields' texts, joined\n */\nfunction recordText(record: StructType, value: unknown, words: QueryWords): string {\n    const fields = value as Readonly<Record<string, unknown>>;\n    const parts = Object.entries(record.fields as Record<string, EastType>)\n        .filter(([, type]) => !NESTED_KINDS.has(baseType(type).type))\n        .slice(0, SUMMARY_FIELDS)\n        .map(([name, type]) => summaryText(type, fields[name], words, name));\n    return words.messages.resultJoin({ parts: parts.filter((part): part is string => part !== undefined) });\n}\n\n/**\n * A case in a summary: its name, then its payload — a record payload's every\n * field, missing ones left out; a Null payload adds nothing.\n *\n * @param type - the variant's type\n * @param value - the case\n * @param words - the words\n * @returns the case's name and its payload's texts, joined\n */\nfunction caseText(type: VariantType, value: unknown, words: QueryWords): string {\n    const chosen = value as variant<string, unknown>;\n    const payload = (type.cases as Record<string, EastType>)[chosen.type];\n    if (payload === undefined) return chosen.type;\n    const node = unwrapRecursive(payload);\n    if (node.type === \"Null\") return chosen.type;\n    const parts = node.type === \"Struct\"\n        ? Object.entries(node.fields as Record<string, EastType>).map(([name, fieldType]) => summaryText(fieldType, (chosen.value as Readonly<Record<string, unknown>>)[name], words, name))\n        : [summaryText(payload, chosen.value, words, undefined)];\n    return words.messages.resultJoin({ parts: [chosen.type, ...parts.filter((part): part is string => part !== undefined)] });\n}\n\n// ─── The Table ───────────────────────────────────────────────────────────────\n\n/**\n * A result's rows read a window at a time (#1113): what\n * {@link pagedResultTable} serves the Table from.\n *\n * @property id - The result's identity: its collection's hash\n * @property total - How many rows it holds\n * @property rows - Its rows in a window, or `undefined` while they are read\n */\nexport interface ResultWindows {\n    /** The result's identity, the same rows for as long as it is shown: its collection's hash. */\n    readonly id: string;\n    /** How many rows it holds. */\n    readonly total: number;\n    /**\n     * Its rows `[offset, offset + limit)`, fewer at its end, each as\n     * {@link resultRows} gives a row.\n     *\n     * @param offset - The first row\n     * @param limit - The most rows\n     * @returns The rows; `undefined` while they are being read\n     * @throws {Error} When they cannot be read.\n     */\n    rows(offset: number, limit: number): readonly unknown[] | undefined;\n}\n\n/**\n * A run's result as the value east-ui-components' Table renderer shows\n * (`EastChakraTable`, `Query Editor Spec.md` §4.11): its rows inline,\n * virtualised, under a sticky header, filling the height of the box it is\n * placed in.\n *\n * @param result - the decoded result: its type, and its value\n * @param words - the words: the message table, and the viewer's formatters\n * @returns the Table's value\n *\n * @remarks\n * - **Rows and columns** are {@link resultRows}': one column per field of a\n *   record, headed by its name as a person reads it (`customer ID`), or one\n *   `value` column, headed by the message table's word.\n * - **A cell** holds a primitive value as itself, under its own tag — Null,\n *   Boolean, Integer, Float, String, DateTime, Blob; an option's present\n *   value is its payload. Every other value is a String cell of its words\n *   ({@link cellText}): \"—\" where it is missing, \"3 lines\" where it is nested.\n * - **Printing** is the renderer's: no column declares a format, so a number\n *   prints every digit, never grouped — an ID as written, a total exact\n *   (§9) — and a column whose present values are numbers is a number column,\n *   right-aligned in tabular mono, its missing \"—\" with them.\n *\n * @example\n * ```tsx\n * const { type, value } = decodeBeast2(result.outcome.value.result);\n * const table = resultTable({ type: fromEastTypeValue(type), value }, queryWords(useFormatters()));\n * return <EastChakraTable value={table} storageKey=\"query-results\" />;\n * ```\n */\nexport function resultTable(result: DecodedResult, words: QueryWords): TableRootValue {\n    const { columns, rows } = resultRows(result);\n    return tableRoot(columns, variant(\"inline\", rows.map(row => tableRow(columns, row, words))), words);\n}\n\n/**\n * A result too large for one answer as the Table's value (#1113): its rows a\n * window at a time, east-ui's paged row source, which the Table walks from the\n * first row, a window at a time, and reads `none` for while a window is read;\n * otherwise as {@link resultTable}'s.\n *\n * @param type - The result's type: an Array or a Set of the rows\n * @param windows - Its rows a window at a time\n * @param words - The words: the message table, and the viewer's formatters\n * @returns The Table's value\n */\nexport function pagedResultTable(type: EastType, windows: ResultWindows, words: QueryWords): TableRootValue {\n    const columns = columnsOf(type);\n    return tableRoot(columns, variant(\"paged\", {\n        id: windows.id,\n        page: (offset: bigint, limit: bigint): option<TableRow[]> => {\n            const rows = windows.rows(Number(offset), Number(limit));\n            return rows === undefined ? none : some(rows.map(row => tableRow(columns, row, words)));\n        },\n        total: () => some(BigInt(windows.total)),\n        seek: none,\n    }), words);\n}\n\n/** A row of the Table: its cells by column key, at the top, open. */\nfunction tableRow(columns: readonly ResultColumn[], row: unknown, words: QueryWords): TableRow {\n    return {\n        cells: new SortedMap(columns.map((column): [string, TableCell] => [column.key, cellOf(column, row, words)]), compareKeys),\n        depth: 0n,\n        collapsed: false,\n    };\n}\n\n/** The Table's value over its rows: their columns, virtualised, under a sticky header, filling its box. */\nfunction tableRoot(columns: readonly ResultColumn[], rows: TableRootValue[\"rows\"], words: QueryWords): TableRootValue {\n    return {\n        rows,\n        columns: columns.map(column => tableColumn(column, words)),\n        frozen: [],\n        columnGroups: none,\n        footer: none,\n        footerRows: none,\n        expandedContent: none,\n        interactive: none,\n        columnResize: none,\n        virtualization: some(true),\n        density: none,\n        rowStatus: none,\n        pagination: none,\n        selection: none,\n        onCellClick: none,\n        onCellDoubleClick: none,\n        onRowClick: none,\n        onRowDoubleClick: none,\n        onRowSelectionChange: none,\n        onSortChange: none,\n        review: none,\n        reviewStatus: none,\n        reviewApproval: none,\n        slice: none,\n        style: some({\n            // \"fill\" is the renderer's own word for the height of the box the table is placed in.\n            height: some(\"fill\"),\n            maxHeight: none,\n            variant: none,\n            size: none,\n            striped: none,\n            stickyHeader: some(true),\n            showColumnBorder: none,\n            colorPalette: none,\n            headerBackground: none,\n            headerColor: none,\n            borderColor: none,\n            zebraBackground: none,\n            hoverBackground: none,\n            selectedBackground: none,\n            selectedBorderColor: none,\n            footerBackground: none,\n            rowHeight: none,\n            plotGutter: none,\n        }),\n    };\n}\n\n/**\n * A column of the Table: headed by its field's name as a person reads it, or\n * by the message table's word for the one `value` column, with no format, so\n * the renderer prints its cells exactly.\n *\n * @param column - the result's column\n * @param words - the words\n * @returns the Table's column\n */\nfunction tableColumn(column: ResultColumn, words: QueryWords): TableColumnValue {\n    return {\n        key: column.key,\n        dataType: toEastTypeValue(column.type),\n        valueType: toEastTypeValue(cellType(column.type)),\n        header: some(column.field === undefined ? words.messages.resultValue() : human(column.field)),\n        width: none,\n        minWidth: none,\n        maxWidth: none,\n        render: none,\n        format: none,\n        aggregate: none,\n    };\n}\n\n/**\n * The kind of cell a column's present values make: a primitive's own, through\n * its options; String for every value the Table words.\n *\n * @param type - the column's type\n * @returns the cells' type\n */\nfunction cellType(type: EastType): EastType {\n    const payload = optionPayload(type);\n    if (payload !== undefined) return cellType(payload);\n    const t = unwrapRecursive(type);\n    return isPrimitiveType(t) && t.type !== \"Never\" ? t : StringType;\n}\n\n/**\n * A row's cell in a column: its words where the Table words its value, else\n * the primitive value itself, under its own tag.\n *\n * @param column - the column\n * @param row - the row, a struct value keyed by column key\n * @param words - the words\n * @returns the cell\n */\nfunction cellOf(column: ResultColumn, row: unknown, words: QueryWords): TableCell {\n    return literalOf(column.type, (row as Readonly<Record<string, unknown>>)[column.key], words, column.field);\n}\n\n/**\n * A value as a cell: a String of its words where {@link cellText} words it,\n * else the primitive value under its own tag, read through its options.\n *\n * @param type - the value's East type\n * @param value - the value\n * @param words - the words\n * @param field - the field the value sits in, if any\n * @returns the cell\n */\nfunction literalOf(type: EastType, value: unknown, words: QueryWords, field: string | undefined): TableCell {\n    const text = cellText(type, value, words, field);\n    if (text !== undefined) return variant(\"String\", text);\n    const payload = optionPayload(type);\n    if (payload !== undefined) {\n        // `cellText` words a missing value, so the option holds one here.\n        const option = value as option<unknown>;\n        return option.type === \"some\" ? literalOf(payload, option.value, words, field) : variant(\"String\", words.messages.resultMissing());\n    }\n    const t = unwrapRecursive(type);\n    switch (t.type) {\n        case \"Null\": return variant(\"Null\", null);\n        case \"Boolean\": return variant(\"Boolean\", value as boolean);\n        case \"Integer\": return variant(\"Integer\", value as bigint);\n        case \"Float\": return variant(\"Float\", value as number);\n        case \"String\": return variant(\"String\", value as string);\n        case \"DateTime\": return variant(\"DateTime\", value as Date);\n        case \"Blob\": return variant(\"Blob\", value as Uint8Array);\n        // A Never value cannot exist; `cellText` worded every other kind.\n        default: return variant(\"String\", words.messages.resultMissing());\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A result too large for one answer (#1113): the output of a split call with\n * no final step, which e3 answered `too_large` and names by its hash, opened\n * as a stored collection (e3-api-client's `collectionOpen`, #1106) and read a\n * page at a time.\n *\n * - **The result** ({@link PagedResult}): its type, how many rows it holds,\n *   and a page of them, decoded.\n * - **Its pages** ({@link usePagedResult}): each read once, as the results'\n *   Table or Tree asks for it, {@link RESULT_PAGE_ROWS} rows a page; those far\n *   from what the Tree shows are let go; a page that can't be read says why —\n *   the page cache the dataset preview reads by (`components/page-reads.ts`).\n * - **Its rows a window at a time** ({@link resultWindows}): what the Table's\n *   paged row source serves.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo } from \"react\";\nimport { decodeBeast2For, fromEastTypeValue, type EastType } from \"@elaraai/east\";\nimport type { RemoteCollection } from \"@elaraai/e3-api-client\";\nimport { usePageReads } from \"../components/page-reads.js\";\nimport { resultRows, type ResultWindows } from \"./results-table.js\";\n\n/** How many rows a page of a result holds: as many as a run returns. */\nexport const RESULT_PAGE_ROWS = 1000;\n\n/** Pages held beyond those the view shows: a page's rows become the Tree's nodes, so the pages held are bounded. */\nconst MAX_RETAINED_PAGES = 8;\n\n/**\n * A result read a page at a time: a split call's output, opened by its hash.\n *\n * @property hash - The collection's hash: what the result is\n * @property type - Its type: an Array or a Set of the rows\n * @property total - How many rows it holds\n * @property page - Reads its rows `[offset, offset + limit)`, a value of its type\n */\nexport interface PagedResult {\n    /** The collection's hash: what the result is. */\n    readonly hash: string;\n    /** Its type, as the run's result is typed: an Array or a Set of the rows. */\n    readonly type: EastType;\n    /** How many rows it holds. */\n    readonly total: number;\n    /**\n     * Reads its rows `[offset, offset + limit)`, fewer at its end.\n     *\n     * @param offset - The first row\n     * @param limit - The most rows\n     * @returns The rows, a value of its type\n     */\n    page(offset: number, limit: number): Promise<unknown>;\n}\n\n/**\n * A result from its collection, opened (e3-api-client's `collectionOpen`): an\n * Array's or a Set's rows, which the results show a row each.\n *\n * @param collection - The collection, opened by its hash\n * @returns The result, read a page at a time; `undefined` for a Dict, whose\n *   entries the results show no rows of\n */\nexport function pagedResultOf(collection: RemoteCollection): PagedResult | undefined {\n    if (collection.type.type === \"Dict\") return undefined;\n    const decode = decodeBeast2For(collection.type);\n    return {\n        hash: collection.hash,\n        type: fromEastTypeValue(collection.type),\n        total: collection.totalElements,\n        page: async (offset, limit) => decode((await collection.page({ offset, limit })).data),\n    };\n}\n\n/** A result's pages, as the results read them ({@link usePagedResult}). */\nexport interface PagedResultPages {\n    /** The pages that landed, by index — page `p` holds rows from `p × RESULT_PAGE_ROWS` — each a value of the result's type. */\n    readonly pages: ReadonlyMap<number, unknown>;\n    /** Why a page could not be read, once one could not. */\n    readonly failure: string | undefined;\n    /**\n     * Reads the pages `[first, last]` that have not landed and are not being\n     * read; each lands in {@link PagedResultPages.pages}. It sets nothing as\n     * it is asked, so a renderer may ask in its render.\n     */\n    need(first: number, last: number): void;\n    /**\n     * Lets go of the pages far from `[first, last]`, past those the results\n     * hold: what a Tree scrolled far away asks.\n     */\n    keep(first: number, last: number): void;\n}\n\n/**\n * Reads a result a page at a time: each page once, as the Table or the Tree\n * asks for it, through the page cache the dataset preview reads by\n * (`usePageReads`). A failure is said once, and the pages read stay; the page\n * that failed is read again when it is asked for again.\n *\n * @param paged - The result\n * @returns Its pages, and how to ask for more\n *\n * @remarks\n * Its pages are the result's, by its hash: a run whose result is another\n * reads its pages afresh, and a page read for the one before lands nothing.\n */\nexport function usePagedResult(paged: PagedResult): PagedResultPages {\n    const read = useCallback((page: number) => paged.page(page * RESULT_PAGE_ROWS, RESULT_PAGE_ROWS), [paged]);\n    const { pages, failure, need: needPages, keep } = usePageReads<unknown>({ identity: paged.hash, read, retain: MAX_RETAINED_PAGES });\n    const lastPage = Math.floor((paged.total - 1) / RESULT_PAGE_ROWS);\n    const need = useCallback((first: number, last: number) => needPages(first, Math.min(last, lastPage)), [needPages, lastPage]);\n    const message = failure?.message;\n    return useMemo(() => ({ pages, failure: message, need, keep }), [pages, message, need, keep]);\n}\n\n/**\n * A result's rows a window at a time, from the pages that landed: what the\n * Table's paged row source serves (`pagedResultTable`). A window whose pages\n * have not landed asks for them, and reads `undefined` until they do.\n *\n * @param paged - The result\n * @param read - Its pages ({@link usePagedResult})\n * @returns Its windows\n */\nexport function resultWindows(paged: PagedResult, read: PagedResultPages): ResultWindows {\n    // Each page's rows, as the Table's rows are read: once a page, for every window over it.\n    const rowsOf = new Map<number, readonly unknown[]>();\n    const pageRows = (p: number): readonly unknown[] => {\n        let rows = rowsOf.get(p);\n        if (rows === undefined) {\n            rows = resultRows({ type: paged.type, value: read.pages.get(p) }).rows;\n            rowsOf.set(p, rows);\n        }\n        return rows;\n    };\n    return {\n        id: paged.hash,\n        total: paged.total,\n        rows(offset, limit) {\n            const end = Math.min(paged.total, offset + limit);\n            if (offset >= end) return [];\n            if (read.failure !== undefined) throw new Error(read.failure);\n            const first = Math.floor(offset / RESULT_PAGE_ROWS);\n            const last = Math.floor((end - 1) / RESULT_PAGE_ROWS);\n            for (let p = first; p <= last; p++) {\n                if (!read.pages.has(p)) {\n                    read.need(first, last);\n                    return undefined;\n                }\n            }\n            const rows: unknown[] = [];\n            for (let p = first; p <= last; p++) rows.push(...pageRows(p));\n            return rows.slice(offset - first * RESULT_PAGE_ROWS, end - first * RESULT_PAGE_ROWS);\n        },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The plan's read-out (#941), beside a run's read-outs in the results'\n * footer (`Query Editor Spec.md` §4.11): how the run reads its data, in a\n * word — \"One call\", \"Split call · 3 of 12 pieces done\" while it goes,\n * \"Split call · 12 pieces\" once it has, and the units the cache served —\n * \"Split call · 12 pieces · 11 units cached\" (#1105) — and, on a click, the\n * plan's explanation (`planWords`) in the design system's popover\n * (`SliceEditPopover`, as the builder's save popover is): the path and why, a\n * split's stages with the jq each is about, how its units ran, and the reads\n * that prune.\n *\n * Its parts are the `queryResults` recipe's: the read-out's `footerPlan`, its\n * `data-state` open while the popover is, and the explanation's `planLines` of\n * `planLine`s, each a `planText` and its `planCode`, a line's kind in\n * `data-kind`. The popover's head, body and arrow are the `sliceEdit`\n * recipe's.\n *\n * @packageDocumentation\n */\n\nimport { memo, useMemo, useState } from \"react\";\nimport { Box, chakra, useSlotRecipe } from \"@chakra-ui/react\";\nimport type { SplitCallProgress, SplitCallReport } from \"@elaraai/e3-types\";\nimport { SliceEditPopover } from \"@elaraai/east-ui-components\";\nimport { planBadge, planWords, type QueryWords } from \"./model/words.js\";\nimport type { Styles } from \"./parts.js\";\nimport type { QueryPlan } from \"./plan.js\";\n\n/** Props of {@link QueryPlanReadout}. */\nexport interface QueryPlanReadoutProps {\n    /** The run's plan. */\n    readonly planned: QueryPlan;\n    /** A split call's progress, while it goes. */\n    readonly progress: SplitCallProgress | undefined;\n    /** How many pieces a split call cut, once e3 says. */\n    readonly pieces: number | undefined;\n    /** How a split call ran, once it answered (#1105): the units it ran, and those the cache served. */\n    readonly report: SplitCallReport | undefined;\n    /** The words. */\n    readonly words: QueryWords;\n}\n\n/**\n * Renders the plan's read-out — see the module docs.\n *\n * @param props - The plan, a split call's progress, pieces and report, and the words ({@link QueryPlanReadoutProps})\n * @returns The read-out, and its popover while open\n */\nexport const QueryPlanReadout = memo(function QueryPlanReadout({ planned, progress, pieces, report, words }: QueryPlanReadoutProps) {\n    const styles = useSlotRecipe({ key: \"queryResults\" })() as Styles;\n    const [open, setOpen] = useState(false);\n    const badge = useMemo(() => planBadge(planned, words, { progress, pieces, report }), [planned, words, progress, pieces, report]);\n    const lines = useMemo(() => planWords(planned.explanation, words, { progress, pieces, report }), [planned, words, progress, pieces, report]);\n    return (\n        <SliceEditPopover open={open} onOpenChange={setOpen} size=\"lg\" label={words.messages.planTitle()}\n            trigger={\n                <chakra.button type=\"button\" css={styles.footerPlan} data-query-result-plan={planned.kind} data-state={open ? \"open\" : \"closed\"}>\n                    {badge}\n                </chakra.button>\n            }>\n            <Box as=\"ul\" css={styles.planLines} data-query-plan={planned.kind}>\n                {lines.map((line, i) => (\n                    <Box as=\"li\" key={i} css={styles.planLine} data-kind={line.kind} data-query-plan-line=\"\">\n                        <Box as=\"span\" css={styles.planText}>{line.text}</Box>\n                        {line.code !== undefined && <Box as=\"code\" css={styles.planCode}>{line.code}</Box>}\n                    </Box>\n                ))}\n            </Box>\n        </SliceEditPopover>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The results (#938) — beside the pane, the last run's result\n * (`Query Editor Spec.md` §4.11), the builder frame's main (#1125):\n *\n * - **the band**, at the top, as tall as the pane's tab row, so the two line\n *   up across the builder: the result's controls ({@link resultToolbarItems}),\n *   Table · Tree and Download ▾ with CSV and BEAST2, on the shared toolbar's\n *   row — the band a `Library` holds its search box in;\n * - **the strips** ({@link ResultStrips}), which the builder draws under its\n *   toolbar, its full width: the stale strip — its \"Stale\" tag, \"The query\n *   changed after this run.\", and Run again with its keys — while the query\n *   differs from the one the result is of; a run that gave no result, worded by\n *   how it ended; and the note after a download, dismissible by Font\n *   Awesome's xmark (#1263);\n * - **the body**: before any run, the empty state; while a run goes, the data\n *   sources it reads over skeleton rows — and a split run's progress, pieces\n *   done of all (#941); a result as a Table (east-ui's Table renderer, over\n *   `results-table.ts`'s rows) or as a Value tree (east-ui's ValueTree\n *   renderer, read-only). Rows open as a Table and one value as a tree; the\n *   toolbar's switch overrides it until the next run. A result too large for\n *   one answer is read a page at a time, as either (`paged-result.ts`,\n *   #1113): the Table's paged source, or the Tree's paging over every row. A\n *   stale result's body is dashed;\n * - **the footer**: the result's read-outs — its count in words and its\n *   fields, or how many of how many it shows; how the run reads its data, its\n *   plan's explanation on a click (`plan-popover.tsx`, #941); the run's\n *   number, time and duration, its East type on hover; and each data source\n *   it read, with its hash. Its parts give way as the results narrow.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { Box, Button, CloseButton, Menu as ChakraMenu, Portal, Skeleton, chakra, useRecipe, useSlotRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCaretDown, faCircleExclamation, faCircleInfo, faDownload, faSitemap, faTableList, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport { describeJqType, none, some, toEastTypeValue } from \"@elaraai/east\";\nimport { ValueTree } from \"@elaraai/east-ui\";\nimport {\n    EastChakraTable, EastChakraValueTree, EmptyStateView, Toolbar,\n    type ToolbarItem, type ValueTreePagedRow, type ValueTreePaging, type ValueTreeValue,\n} from \"@elaraai/east-ui-components\";\nimport { emptyOf, pageRows } from \"../components/PagedDatasetPreview.js\";\nimport { byteWords, countWords, fieldLabels, planProgressWords, shapeWords, type QueryWords } from \"./model/words.js\";\nimport { Tip, type Styles } from \"./parts.js\";\nimport { RESULT_PAGE_ROWS, resultWindows, usePagedResult, type PagedResult } from \"./paged-result.js\";\nimport { QueryPlanReadout } from \"./plan-popover.js\";\nimport { pagedResultTable, resultTable } from \"./results-table.js\";\nimport type { RunOutput, RunState } from \"./run.js\";\nimport { unwrapRecursive } from \"./steps/shape.js\";\n\n/** How a result shows: as a Table of its rows, or as a Value tree. */\nexport type ResultView = \"table\" | \"tree\";\n\n/** A download's format. */\nexport type DownloadFormat = \"csv\" | \"beast2\";\n\n/** The fold order of the result's controls in their band: the menu to its icon first, then the switch to its icons. */\nconst RANK_DOWNLOAD = 25;\nconst RANK_VIEW = 30;\n\n/** The results narrower than this drop the result's fields; narrower than `TIGHT`, what the run read. */\nconst NARROW = 600;\nconst TIGHT = 470;\n\n/** Skeleton rows while a run goes. */\nconst SKELETON_ROWS = 6;\n\n/** The empty state's icon before any run: Font Awesome's play, as Run is the way to a result (#1263). */\nconst IDLE_ICON = { prefix: \"fas\", name: \"play\" } as const;\n\n/**\n * How a result opens: rows — an array, a set or a vector — as a Table, one\n * value as a tree.\n *\n * @param output - the result\n * @returns its view\n */\nexport function pickedView(output: RunOutput): ResultView {\n    const t = unwrapRecursive(output.type);\n    return t.type === \"Array\" || t.type === \"Set\" || t.type === \"Vector\" ? \"table\" : \"tree\";\n}\n\n/** How many rows a result of rows holds — all of them, for one read a page at a time; `undefined` for one value. */\nfunction rowCount(output: RunOutput): number | undefined {\n    if (output.paged !== undefined) return output.paged.total;\n    const t = unwrapRecursive(output.type);\n    if (t.type === \"Array\" || t.type === \"Vector\") return (output.value as readonly unknown[]).length;\n    if (t.type === \"Set\") return (output.value as ReadonlySet<unknown>).size;\n    return undefined;\n}\n\n/** What a run that gave no result says: its title, and the words under it. */\nexport interface RunFailure {\n    readonly title: string;\n    readonly message: string;\n}\n\n/**\n * Why a run gave no result, in the builder's words (`Query Editor Spec.md`\n * §4.11): the checker's problems; a runtime error or e3's refusal; the time\n * limit; the size limit; a platform function the server lacks; a call that\n * never reached the server, or that the server refused.\n *\n * @param state - the run\n * @param words - the words\n * @returns the banner's title and message; `undefined` for a run that gave a result, or none yet\n */\nexport function runFailure(state: RunState, words: QueryWords): RunFailure | undefined {\n    const m = words.messages;\n    if (state.status === \"failed\") {\n        return state.reason === \"unreachable\" ? { title: m.unreachable(), message: state.message } : { title: m.notRun(), message: state.message };\n    }\n    if (state.status !== \"done\" || state.output !== undefined) return undefined;\n    const outcome = state.result.outcome;\n    switch (outcome.type) {\n        case \"ok\":\n            return undefined;\n        case \"error\": {\n            const first = outcome.value[0];\n            const ran = first !== undefined && (first.code === \"runtime\" || first.code === \"no_value\" || first.code === \"invalid\");\n            return { title: ran ? m.notRun() : m.notRunProblems(), message: first?.message ?? \"\" };\n        }\n        case \"timed_out\":\n            return { title: m.stoppedAfter({ seconds: words.formatters.number(Number(outcome.value.ms) / 1000) }), message: m.stoppedHint() };\n        case \"too_large\":\n            return { title: m.tooLarge(), message: m.tooLargeHint({ bytes: byteWords(outcome.value.bytes, words), limit: byteWords(outcome.value.limit, words) }) };\n        case \"needs_platform\":\n            return { title: m.needsPlatform(), message: m.needsPlatformHint({ functions: m.list({ items: outcome.value.functions }) }) };\n    }\n}\n\n/** The footer's read-outs of a run: its count, its fields, the run's own line and what it read. */\nexport interface ResultFooter {\n    /** The count in words, or the run's state — `10 orders`, `Showing 1–1,000 of 4,210`, `Running…`. */\n    readonly count: string;\n    /** The rows' fields — `· order, customer, total`. */\n    readonly fields: string;\n    /** The run's own line — `run #3 · 14:02 · 412 ms`. */\n    readonly run: string;\n    /** Its East type and multiplicity, on hover. */\n    readonly type: string;\n    /** What it read — `reads orders #4f2a1c8d · customers #9b07e3a4`. */\n    readonly reads: string;\n}\n\n/**\n * The footer's read-outs of a run (`Query Editor Spec.md` §4.11).\n *\n * @param state - the run\n * @param words - the words\n * @returns the footer's parts\n */\nexport function resultFooter(state: RunState, words: QueryWords): ResultFooter {\n    const m = words.messages;\n    const f = words.formatters;\n    const empty = { fields: \"\", run: \"\", type: \"\", reads: \"\" };\n    if (state.status === \"idle\") return { count: m.noResultYet(), ...empty };\n    if (state.status === \"running\") return { count: m.runningWord(), ...empty };\n    const run = m.runLine({ n: f.bare(state.n), time: f.time(state.at), ms: f.bare(state.status === \"done\" ? Math.round(state.ms) : 0) });\n    if (state.status === \"failed\") return { count: m.noResult(), fields: \"\", run, type: \"\", reads: \"\" };\n    const { result, output, plan, planned } = state;\n    const reads = m.readsLine({ sources: result.inputs.map(i => ({ name: i.name, hash: i.hash.slice(0, 8) })) });\n    // The call that ran, as the checker typed it: none when the query did not check, so nothing ran.\n    const reading = planned === undefined ? undefined : planned.kind === \"one_shot\" ? planned.prepared : planned.reading;\n    const type = reading === undefined ? \"\" : m.typeHover({\n        type: describeJqType(reading.checked.elementType, { maxDepth: 2 }), multiplicity: reading.checked.multiplicity,\n    });\n    if (output === undefined) return { count: m.noResult(), fields: \"\", run, type, reads };\n    const shape = plan.shape;\n    const n = rowCount(output);\n    if (n === undefined) {\n        const count = shape !== undefined && shape.kind === \"one\" ? shapeWords(shape, words) : m.oneValue();\n        return { count, fields: \"\", run, type, reads };\n    }\n    // Rows cut at the call's most: how many came, and that there are more.\n    const shownCount = output.truncated ? m.atLeast({ count: f.number(n) }) : f.number(n);\n    const rows = shape?.kind === \"rows\" && !output.truncated ? countWords(shape, n, words) : m.rowCount({ count: shownCount, n });\n    const count = output.total !== undefined ? m.showing({ shown: f.number(n), total: f.number(output.total) }) : rows;\n    const fields = shape?.kind === \"rows\" ? m.givesFields({ fields: fieldLabels(shape) }) : \"\";\n    return { count, fields, run, type, reads };\n}\n\n/** Props of {@link QueryResults}. */\nexport interface QueryResultsProps {\n    /** The run. */\n    readonly state: RunState;\n    /** Whether the query changed after the run that gave the result. */\n    readonly stale: boolean;\n    /** How the result shows. */\n    readonly view: ResultView;\n    /** The words. */\n    readonly words: QueryWords;\n    /** The builder's storage key: the result's renderers keep their state under it. */\n    readonly storageKey: string;\n    /** The result's controls, for the band ({@link resultToolbarItems}). */\n    readonly controls: readonly ToolbarItem[];\n    /** A phone's: no band and no footer, whose parts have moved to the first row and *This result* (QP3, QP4). */\n    readonly phone?: boolean | undefined;\n    /** A phone's strips, under the pager (QP14; the builder's banners hold them elsewhere). */\n    readonly strips?: ReactNode;\n}\n\n/**\n * Renders the results — see the module docs.\n *\n * @param props - The run, whether it is stale, the view, the words and the result's controls ({@link QueryResultsProps})\n * @returns The results\n */\nexport const QueryResults = memo(function QueryResults({ state, stale, view, words, storageKey, controls, phone = false, strips }: QueryResultsProps) {\n    const m = words.messages;\n    const styles = useSlotRecipe({ key: \"queryResults\" })() as Styles;\n    // The band a Library draws over its cards: as tall as the pane's tab row, which it lines up with.\n    const band = useSlotRecipe({ key: \"library\" })() as Styles;\n    const live = useSlotRecipe({ key: \"status\" })({ status: \"brand\", size: \"sm\", live: true }) as Styles;\n    const rootRef = useRef<HTMLDivElement>(null);\n    const [width, setWidth] = useState<\"wide\" | \"narrow\" | \"tight\">(\"wide\");\n    useEffect(() => {\n        const el = rootRef.current;\n        if (el === null || typeof ResizeObserver !== \"function\") return;\n        const observer = new ResizeObserver(() => {\n            const w = el.offsetWidth;\n            setWidth(w < TIGHT ? \"tight\" : w < NARROW ? \"narrow\" : \"wide\");\n        });\n        observer.observe(el);\n        return () => observer.disconnect();\n    }, []);\n\n    const fresh = state.status === \"done\" ? state.output : undefined;\n    // A phone keeps the last result under a run that gave none, and under one that goes (QP14), dashed.\n    const lastRef = useRef<RunOutput | undefined>(undefined);\n    if (fresh !== undefined) lastRef.current = fresh;\n    if (state.status === \"idle\") lastRef.current = undefined;\n    const output = phone ? fresh ?? lastRef.current : fresh;\n    const footer = resultFooter(state, words);\n    const n = state.status === \"idle\" ? 0 : state.n;\n    // A result in hand: a result read a page at a time is its own body's.\n    const held = output?.paged === undefined ? output : undefined;\n    const table = useMemo(() => (held === undefined || view !== \"table\" ? undefined : resultTable({ type: held.type, value: held.value }, words)), [held, view, words]);\n    const tree = useMemo((): ValueTreeValue | undefined => (held === undefined || view !== \"tree\" ? undefined : {\n        root: ValueTree.materialize(held.type, held.value),\n        onEdit: none, onInsert: none, onRemove: none, onTag: none,\n        style: some({ height: some(\"100%\"), maxHeight: none, openDepth: some(1n), toolbar: some(false) }),\n    }), [held, view]);\n\n    let body: ReactNode;\n    if (phone && state.status === \"idle\") {\n        body = (\n            <Box css={styles.phoneIdle} data-query-results-idle=\"\">\n                <Box as=\"span\" css={styles.phoneIdleGlyph} aria-hidden />\n                <Box css={styles.phoneIdleTitle}>{m.idleTitle()}</Box>\n                <Box as=\"ul\" css={styles.phoneIdleList}><li>{m.idleChecks()}</li><li>{m.idleRunPhone()}</li></Box>\n            </Box>\n        );\n    } else if (phone && state.status === \"running\" && table !== undefined) {\n        // The headers drawn and bars laid out as the final table, under the band naming what it reads (QP14).\n        body = <EastChakraTable key={n} value={table} storageKey={`${storageKey}.result.table`} phoneReading\n            phoneBand={<Box css={styles.phoneReading} data-query-results-running=\"\"><Box as=\"span\" css={live.indicator} aria-hidden /><span>{m.reading({ sources: m.list({ items: state.reads }) })}</span></Box>} />;\n    } else if (state.status === \"idle\") {\n        body = (\n            <Box css={styles.idle} data-query-results-idle=\"\">\n                <EmptyStateView icon={IDLE_ICON} title={m.idleTitle()} description={\n                    <Box as=\"ul\" css={styles.idleList}>\n                        <li>{m.idleChecks()}</li>\n                        <li>{m.idleRun()}</li>\n                    </Box>\n                } />\n            </Box>\n        );\n    } else if (state.status === \"running\") {\n        body = (\n            <Box css={styles.running} data-query-results-running=\"\">\n                <Box css={styles.runningHead}>\n                    <Box as=\"span\" css={live.indicator} aria-hidden />\n                    <span>{m.reading({ sources: m.list({ items: state.reads }) })}</span>\n                    {state.progress !== undefined && (\n                        <Box as=\"span\" css={styles.runningProgress} data-query-results-progress=\"\">{planProgressWords(state.progress, words)}</Box>\n                    )}\n                </Box>\n                {Array.from({ length: SKELETON_ROWS }, (_, i) => (\n                    <Box key={i} css={styles.skeletonRow} aria-hidden>\n                        <Skeleton css={styles.skeletonCell} data-width=\"short\" />\n                        <Skeleton css={styles.skeletonCell} data-width=\"long\" />\n                        <Skeleton css={styles.skeletonCell} data-width=\"mid\" />\n                    </Box>\n                ))}\n            </Box>\n        );\n    } else if (output?.paged !== undefined) {\n        body = <PagedResultBody key={n} paged={output.paged} view={view} words={words} storageKey={storageKey} phone={phone} strips={strips} />;\n    } else if (table !== undefined) {\n        body = <EastChakraTable key={n} value={table} storageKey={`${storageKey}.result.table`} phoneBand={strips} />;\n    } else if (tree !== undefined) {\n        // One storage key per builder, so runs never pile keys up: the tree keeps its expansion across runs, as a dataset's does.\n        body = <>{phone && strips}<EastChakraValueTree key={n} value={tree} storageKey={`${storageKey}.result.tree`} phoneFirstOnly /></>;\n    }\n\n    return (\n        <Box ref={rootRef} css={styles.root} data-query-results=\"\" data-query-results-view={output === undefined ? undefined : view} data-width={width}>\n            {!phone && <Box css={band.toolbar} role=\"toolbar\" aria-label={m.resultControls()} data-slot=\"toolbar\" data-query-results-bar=\"\">\n                <Toolbar items={controls} />\n            </Box>}\n            <Box css={styles.body} data-phone={phone ? \"\" : undefined} data-stale={(stale || (phone && fresh === undefined)) && output !== undefined ? \"\" : undefined}>\n                {phone && output === undefined && state.status !== \"idle\" && strips}\n                {body}\n            </Box>\n            {!phone && <Box css={styles.footer} data-query-results-footer=\"\">\n                <Box as=\"span\" css={styles.footerCount} data-query-result-count=\"\">{footer.count}</Box>\n                {footer.fields !== \"\" && <Box as=\"span\" css={styles.footerFields} data-query-result-fields=\"\">{footer.fields}</Box>}\n                <Box css={styles.footerSpacer} />\n                {state.status !== \"idle\" && state.planned !== undefined && (\n                    <QueryPlanReadout planned={state.planned} words={words}\n                        progress={state.status === \"running\" ? state.progress : undefined}\n                        pieces={state.status === \"failed\" ? undefined : state.pieces}\n                        report={state.status === \"done\" ? state.report : undefined} />\n                )}\n                {footer.run !== \"\" && (\n                    <Tip label={footer.type}>\n                        <Box as=\"span\" css={styles.footerRun} data-query-result-run=\"\">{footer.run}</Box>\n                    </Tip>\n                )}\n                {footer.reads !== \"\" && <Box as=\"span\" css={styles.footerReads} data-query-result-reads=\"\">{footer.reads}</Box>}\n            </Box>}\n        </Box>\n    );\n});\n\n/** Props of {@link PagedResultBody}. */\ninterface PagedResultBodyProps {\n    /** The result, read a page at a time. */\n    readonly paged: PagedResult;\n    /** How it shows. */\n    readonly view: ResultView;\n    /** The words. */\n    readonly words: QueryWords;\n    /** The builder's storage key: the renderers keep their state under it. */\n    readonly storageKey: string;\n    /** A phone's. */\n    readonly phone: boolean;\n    /** A phone's strips: under the Table's pager, over the Tree, as a result in hand has them (QP14). */\n    readonly strips: ReactNode;\n}\n\n/**\n * A result too large for one answer, read a page at a time (#1113): as a\n * Table, east-ui's paged row source over its pages, which the Table walks from\n * its first row; as a Tree, the ValueTree's paging, its scrollbar over every\n * row and each page read as it comes into view. Mounted once a run, so its\n * pages are the run's.\n *\n * @param props - The result, the view, the words, the storage key and a phone's strips ({@link PagedResultBodyProps})\n * @returns The Table or the Tree\n */\nconst PagedResultBody = memo(function PagedResultBody({ paged, view, words, storageKey, phone, strips }: PagedResultBodyProps) {\n    const read = usePagedResult(paged);\n    const table = useMemo(() => (view === \"table\" ? pagedResultTable(paged.type, resultWindows(paged, read), words) : undefined), [view, paged, read, words]);\n    const type = useMemo(() => toEastTypeValue(paged.type), [paged]);\n    // The Tree's root: the collection's kind, its rows the pages'.\n    const tree = useMemo((): ValueTreeValue => ({\n        root: ValueTree.materialize(type, emptyOf(type)),\n        onEdit: none, onInsert: none, onRemove: none, onTag: none,\n        style: some({ height: some(\"100%\"), maxHeight: none, openDepth: some(1n), toolbar: some(false) }),\n    }), [type]);\n    const treePages = useMemo(() => new Map([...read.pages].map(([p, value]): [number, readonly ValueTreePagedRow[]] => [p, pageRows(type, value, p * RESULT_PAGE_ROWS)])), [read.pages, type]);\n    const { need, keep } = read;\n    const onNeedRows = useCallback((startRow: number, endRow: number) => {\n        const first = Math.floor(startRow / RESULT_PAGE_ROWS);\n        const last = Math.max(first, Math.ceil(endRow / RESULT_PAGE_ROWS) - 1);\n        keep(first, last);\n        need(first, last);\n    }, [need, keep]);\n    const paging = useMemo((): ValueTreePaging => ({ totalRows: paged.total, pageSize: RESULT_PAGE_ROWS, pages: treePages, onNeedRows }), [paged, treePages, onNeedRows]);\n    if (table !== undefined) return <EastChakraTable value={table} storageKey={`${storageKey}.result.table`} phoneBand={strips} />;\n    return <>{phone && strips}<EastChakraValueTree value={tree} storageKey={`${storageKey}.result.tree`} paging={paging} /></>;\n});\n\n/** Props of {@link ResultStrips}. */\nexport interface ResultStripsProps {\n    /** The run. */\n    readonly state: RunState;\n    /** Whether the query changed after the run that gave the result. */\n    readonly stale: boolean;\n    /** The note after a download, until it is dismissed or the next run. */\n    readonly note: string | undefined;\n    /** Dismisses the note. */\n    readonly onDismissNote: () => void;\n    /** Runs the query again. */\n    readonly onRunAgain: () => void;\n    /** The words. */\n    readonly words: QueryWords;\n    /** A phone's: its note in the band over the strip instead (QP16). */\n    readonly phone?: boolean | undefined;\n    /** A phone's link to what stopped a run (QP14). */\n    readonly onShowProblem?: (() => void) | undefined;\n    /** A phone's: the run the rows below are from, and when. */\n    readonly shownRun?: number | undefined;\n    readonly shownAt?: Date | undefined;\n    /** A phone's: the first problem in the steps' plain words, for a run the checker refused (5d). */\n    readonly problem?: { readonly n: number; readonly text: string } | undefined;\n}\n\n/**\n * The result's strips (`Query Editor Spec.md` §4.11): under the builder's\n * toolbar, the builder's full width, edge to edge, each over a rule — the\n * stale strip while the query differs from the one the result is of; a run\n * that gave no result, worded by how it ended; and the note after a download,\n * dismissible. None, and the strips take no room.\n *\n * @param props - The run, whether it is stale, the note and the words ({@link ResultStripsProps})\n * @returns The strips\n */\nexport const ResultStrips = memo(function ResultStrips({ state, stale, note, onDismissNote, onRunAgain, words, phone = false, onShowProblem, shownRun, shownAt, problem }: ResultStripsProps) {\n    const m = words.messages;\n    const styles = useSlotRecipe({ key: \"queryResults\" })() as Styles;\n    // The note's close draws its xmark at the size Chakra's icon took in a 2xs button.\n    const closeMark = useRecipe({ key: \"iconButtonMark\" })({ size: \"2xs\" });\n    const output = state.status === \"done\" ? state.output : undefined;\n    const failure = runFailure(state, words);\n    return (\n        <Box css={styles.banners} data-query-strips=\"\">\n            {stale && output !== undefined && (\n                <Box css={styles.strip} data-tone=\"stale\" role=\"status\">\n                    <Box as=\"span\" css={styles.stripTag}>{m.staleTag()}</Box>\n                    <Box as=\"span\" css={styles.stripText}>{m.staleResult()}</Box>\n                    <Button size=\"xs\" variant=\"ghost\" colorPalette=\"brand\" css={styles.stripAction} data-query-run-again=\"\" onClick={onRunAgain}>\n                        {m.runAgain()}{!phone && <Box as=\"span\" css={styles.stripKeys}>{m.runKeys()}</Box>}\n                    </Button>\n                </Box>\n            )}\n            {failure !== undefined && phone && (\n                <Box css={styles.phoneNotRun} data-tone=\"error\" role=\"alert\" data-query-not-run=\"\">\n                    <Box css={styles.phoneNotRunHead}><FontAwesomeIcon icon={faCircleExclamation} aria-hidden /><span>{m.notRun()}</span></Box>\n                    <Box css={styles.phoneNotRunText}>{failure.title === m.notRunProblems() && problem !== undefined ? m.checkerFound({ n: problem.n, count: words.formatters.number(problem.n), text: problem.text }) : state.status === \"failed\" && state.reason === \"unreachable\" ? `${failure.title}.` : failure.message === \"\" ? failure.title : /[.!?]$/.test(failure.message) ? failure.message : `${failure.message}.`}{shownRun !== undefined && shownAt !== undefined && ` ${m.rowsFromRun({ n: words.formatters.bare(shownRun), time: words.formatters.time(shownAt) })}`}</Box>\n                    {failure.title === m.notRunProblems() && onShowProblem !== undefined\n                        ? <chakra.button type=\"button\" css={styles.phoneNotRunLink} onClick={onShowProblem}>{m.showProblem()} →</chakra.button>\n                        : <chakra.button type=\"button\" css={styles.phoneNotRunLink} onClick={onRunAgain}>{m.runAgain()} →</chakra.button>}\n                </Box>\n            )}\n            {failure !== undefined && !phone && (\n                <Box css={styles.strip} data-tone=\"error\" role=\"alert\">\n                    <Box as=\"span\" css={styles.stripIcon} aria-hidden><FontAwesomeIcon icon={faCircleExclamation} /></Box>\n                    <Box css={styles.stripBody}>\n                        <Box as=\"span\" css={styles.stripTitle}>{failure.title}</Box>\n                        {failure.message !== \"\" && <Box as=\"span\">{failure.message}</Box>}\n                    </Box>\n                </Box>\n            )}\n            {note !== undefined && !phone && (\n                <Box css={styles.strip} data-tone=\"note\" role=\"status\">\n                    <Box as=\"span\" css={styles.stripIcon} aria-hidden><FontAwesomeIcon icon={faCircleInfo} /></Box>\n                    <Box as=\"span\" css={styles.stripText}>{note}</Box>\n                    <CloseButton size=\"2xs\" css={[styles.stripAction, closeMark]} onClick={onDismissNote}><FontAwesomeIcon icon={faXmark} /></CloseButton>\n                </Box>\n            )}\n        </Box>\n    );\n});\n\n/** What the result's toolbar items show, and do. */\nexport interface ResultToolbarOptions {\n    /** The view shown; `undefined` without a result. */\n    readonly view: ResultView | undefined;\n    /** Whether the result can be downloaded: one in hand, not one read a page at a time (#1113). */\n    readonly downloadable: boolean;\n    /** The view the run picked. */\n    readonly picked: ResultView | undefined;\n    /** Shows a view. */\n    readonly onView: (view: ResultView) => void;\n    /** The result's views this builder offers, in the switch's order: Table · Tree shows only where there are two. */\n    readonly views: readonly ResultView[];\n    /** Downloads the result. */\n    readonly onDownload: (format: DownloadFormat) => void;\n    /** The words. */\n    readonly words: QueryWords;\n    /** The `queryBuilder` recipe's styles. */\n    readonly styles: Styles;\n    /** The `seg` recipe's styles. */\n    readonly seg: Styles;\n}\n\n/**\n * The result's controls, the items of the results' band (`Query Editor\n * Spec.md` §4.11): **Table · Tree**, the `seg` strip, folding to its icons;\n * and **Download ▾**, a menu of CSV and BEAST2, folding to its icon. Both are\n * off without a result, and Download for a result read a page at a time.\n *\n * @param options - The view, the picked view, the downloads and the words ({@link ResultToolbarOptions})\n * @returns The items, in their order along the row\n */\nexport function resultToolbarItems(options: ResultToolbarOptions): ToolbarItem[] {\n    const { view, downloadable, picked, onView, views: offered, onDownload, words, styles, seg } = options;\n    const m = words.messages;\n    const off = view === undefined;\n    const noDownload = off || !downloadable;\n    const views = (iconsOnly: boolean) => (\n        <Box css={seg.root} role=\"group\" aria-label={m.resultViewLabel()} data-query-result-view={view}>\n            {offered.map((v) => {\n                const pressed = v === view;\n                const label = m.resultView({ view: v });\n                const hover = v === picked ? m.resultViewPicked({ view: v }) : label;\n                return (\n                    <Tip key={v} label={iconsOnly || v === picked ? hover : \"\"}>\n                        <chakra.button type=\"button\" css={seg.item} data-state={pressed ? \"on\" : \"off\"} aria-pressed={pressed} disabled={off}\n                            {...(iconsOnly ? { \"aria-label\": label } : {})} onClick={() => onView(v)}>\n                            <Box as=\"span\" css={styles.viewIcon} aria-hidden><FontAwesomeIcon icon={v === \"table\" ? faTableList : faSitemap} /></Box>\n                            {!iconsOnly && <span>{label}</span>}\n                        </chakra.button>\n                    </Tip>\n                );\n            })}\n        </Box>\n    );\n    const download = (iconOnly: boolean) => (\n        <ChakraMenu.Root positioning={{ placement: \"bottom-end\" }}>\n            <ChakraMenu.Trigger asChild>\n                <Button size=\"sm\" variant=\"outline\" disabled={noDownload} data-query-download=\"\" {...(iconOnly ? { \"aria-label\": m.download() } : {})}>\n                    <FontAwesomeIcon icon={faDownload} />{!iconOnly && <>{m.download()}<FontAwesomeIcon icon={faCaretDown} /></>}\n                </Button>\n            </ChakraMenu.Trigger>\n            <Portal>\n                <ChakraMenu.Positioner>\n                    <ChakraMenu.Content>\n                        {([\"csv\", \"beast2\"] as const).map((format) => (\n                            <ChakraMenu.Item key={format} value={format} data-query-download-format={format} onSelect={() => onDownload(format)}>\n                                <Box as=\"span\" css={styles.menuLabel}>{m.downloadFormat({ format })}</Box>\n                                <Box as=\"span\" css={styles.menuMeta}>{m.downloadFormatMeta({ format })}</Box>\n                            </ChakraMenu.Item>\n                        ))}\n                    </ChakraMenu.Content>\n                </ChakraMenu.Positioner>\n            </Portal>\n        </ChakraMenu.Root>\n    );\n    return [\n        ...(offered.length > 1 ? [{ key: \"result-view\", side: \"end\" as const, forms: [views(false), views(true)], rank: RANK_VIEW, version: `${view ?? \"\"}|${picked ?? \"\"}` }] : []),\n        { key: \"download\", side: \"end\", forms: [download(false), download(true)], rank: RANK_DOWNLOAD, version: noDownload ? \"off\" : \"on\" },\n    ];\n}\n\n/**\n * A result's file name, from the query's name: lower-cased, every other\n * character a \"-\" — `top-shipped-orders-2026`.\n *\n * @param name - the query's name\n * @returns the file's name, without its extension\n */\nexport function resultFileName(name: string): string {\n    const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\");\n    return slug === \"\" ? \"query-result\" : slug;\n}\n\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Downloads (#938) — a run's result saved as a file (`Query Editor Spec.md`\n * §4.11), named after the query (`top-shipped-orders-2026.csv`):\n *\n * - **CSV** (\"table\"): the rows the Table shows, one row per output, through\n *   East's CSV (`encodeCsvFor` over the row type, RFC 4180 quoting): a value\n *   CSV holds as itself — a number, a date, text, an option of one — and a\n *   nested value as the words the Table shows for it;\n * - **BEAST2** (\"typed\"): the result with its type, self-describing.\n *\n * Each goes through east-ui-components' `downloadFile`, the save the\n * `Download` platform functions use.\n *\n * @packageDocumentation\n */\n\nimport { OptionType, StringType, StructType, encodeBeast2For, encodeCsvFor, none, some, type EastType, type option } from \"@elaraai/east\";\nimport { downloadFile } from \"@elaraai/east-ui-components\";\nimport { countWords, type QueryWords } from \"./model/words.js\";\nimport { resultFileName, type DownloadFormat } from \"./results.js\";\nimport { cellText, resultRows } from \"./results-table.js\";\nimport type { RunOutput, RunState } from \"./run.js\";\nimport { optionPayload } from \"./steps/shape.js\";\n\n/** The types a CSV cell holds as itself. */\nconst CSV_KINDS: ReadonlySet<string> = new Set([\"Never\", \"Null\", \"Boolean\", \"Integer\", \"Float\", \"String\", \"DateTime\", \"Blob\"]);\n\n/** How a column goes into the CSV: as itself, as its words, or an option of its payload's words. */\ntype CsvColumn = { readonly type: EastType; readonly words: \"none\" | \"value\" | \"payload\" };\n\n/** A column as the CSV holds it: its own type where CSV holds it, else its words — an option's payload's too. */\nfunction csvColumn(type: EastType): CsvColumn {\n    if (CSV_KINDS.has(type.type)) return { type, words: \"none\" };\n    const payload = optionPayload(type);\n    if (payload !== undefined) return CSV_KINDS.has(payload.type) ? { type, words: \"none\" } : { type: OptionType(StringType), words: \"payload\" };\n    return { type: StringType, words: \"value\" };\n}\n\n/**\n * A result's rows as CSV: one row per output, its header the fields' names.\n *\n * @param output - the run's result\n * @param words - the words, for a nested value\n * @returns the CSV's bytes, UTF-8\n */\nexport function resultCsv(output: RunOutput, words: QueryWords): Uint8Array {\n    const { columns, rows } = resultRows({ type: output.type, value: output.value });\n    const shaped = columns.map(c => ({ ...c, csv: csvColumn(c.type) }));\n    // The columns in the result's order, as a list: an object would list a column named like an integer first (#1574)\n    const RowType = StructType(shaped.map(c => [c.key, c.csv.type] as const));\n    const cells = rows.map(row => Object.fromEntries(shaped.map((c): [string, unknown] => {\n        const value = (row as Readonly<Record<string, unknown>>)[c.key];\n        switch (c.csv.words) {\n            case \"none\":\n                return [c.key, value];\n            case \"value\":\n                return [c.key, cellText(c.type, value, words, c.field) ?? \"\"];\n            case \"payload\": {\n                const held = value as option<unknown>;\n                return [c.key, held.type === \"some\" ? some(cellText(optionPayload(c.type)!, held.value, words, c.field) ?? \"\") : none];\n            }\n        }\n    })));\n    return encodeCsvFor(RowType)(cells as never);\n}\n\n/**\n * A result with its type, self-describing beast2: what the run returned.\n *\n * @param output - the run's result\n * @returns the bytes\n */\nexport function resultBeast2(output: RunOutput): Uint8Array {\n    return encodeBeast2For(output.type)(output.value as never);\n}\n\n/**\n * Downloads a run's result, and says so.\n *\n * @param run - the run, answered with a result\n * @param format - CSV or BEAST2\n * @param name - the query's name: the file's\n * @param words - the words\n * @returns the note the results show after it; `undefined` when the run has no\n *   result in hand — none, or one read a page at a time (#1113)\n */\nexport function downloadResult(run: RunState, format: DownloadFormat, name: string, words: QueryWords): string | undefined {\n    if (run.status !== \"done\" || run.output === undefined || run.output.paged !== undefined) return undefined;\n    const output = run.output;\n    const file = `${resultFileName(name)}.${format === \"csv\" ? \"csv\" : \"beast2\"}`;\n    if (format === \"csv\") downloadFile(file, \"text/csv;charset=utf-8\", resultCsv(output, words));\n    else downloadFile(file, \"application/octet-stream\", resultBeast2(output));\n    // One row per output, as the CSV writes them.\n    const n = resultRows({ type: output.type, value: output.value }).rows.length;\n    const shape = run.plan.shape;\n    const count = shape?.kind === \"rows\" ? countWords(shape, n, words) : words.messages.rowCount({ count: words.formatters.number(n), n });\n    return words.messages.downloaded({ format, file, count });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Step cards (#934): a query's steps as the Query tab draws them\n * (`Query Editor Spec.md` §4.3, §4.4) — each step's title and icon, its rows\n * of words, slots, inputs and chips, its feet and notes, the problem lines\n * under the rows that caused them, and the shape line after it; and a\n * query's outline, one line of words per finished step, which a library\n * card's wireframe draws (§5).\n *\n * @packageDocumentation\n */\n\nimport { describeJqType, isTypeEqual, type EastType } from \"@elaraai/east\";\nimport type { CheckedSteps, DiagnosticSlot, StepDiagnostic, StepFix } from \"../steps/check.js\";\nimport { SOURCE_COUNT } from \"../steps/count.js\";\nimport { fieldByRef, fieldsOf, type StepField } from \"../steps/fields.js\";\nimport { itemShape, scalarFieldsOf } from \"../steps/print.js\";\nimport { singular, unwrapRecursive, type Shape } from \"../steps/shape.js\";\nimport { isComplete, needsValue, type Condition, type Step, type StepQuery, type TestCondition } from \"../steps/values.js\";\nimport type { ActionRef, InputRef, RemoveRef, SlotRef } from \"./refs.js\";\nimport {\n    STEP_ICON, countWords, fieldLabels, human, isIdName, orderKind, plainKind, plural, problemWords, refLabel, rowsWords, shapeWords, stepWords, valueWords,\n    type QueryWords,\n} from \"./words.js\";\n\n/** One part of a card's row. */\nexport type CardPart =\n    /** Words; a joiner (`and`, `or`) sits in the joiner column. */\n    | { readonly t: \"word\"; readonly text: string; readonly joiner?: boolean }\n    /** A slot: what it shows, its placeholder while empty, and whether it reads as data or has a problem. */\n    | { readonly t: \"slot\"; readonly slot: SlotRef; readonly text: string; readonly empty: boolean; readonly placeholder: string; readonly mono: boolean; readonly error: boolean }\n    /** An input: a count, a name, a value or a bound. */\n    | { readonly t: \"input\"; readonly input: InputRef; readonly value: string; readonly width: \"count\" | \"name\" | \"value\" | \"range\"; readonly mono: boolean; readonly error: boolean }\n    /** A chip with its ×: a field a Look up brings in. */\n    | { readonly t: \"chip\"; readonly text: string; readonly remove: RemoveRef }\n    /** An add: a foot's, or Look up's Add field. */\n    | { readonly t: \"add\"; readonly text: string; readonly action: ActionRef; readonly ghost: boolean }\n    /** A row's ×. */\n    | { readonly t: \"remove\"; readonly label: string; readonly target: RemoveRef }\n    /** A jq step's code. */\n    | { readonly t: \"code\"; readonly text: string };\n\n/** A problem under a row: its plain words, the checker's, and its fixes. */\nexport interface ProblemLine {\n    /** An error, a warning, or a jq step's note. */\n    readonly severity: \"error\" | \"warning\" | \"note\";\n    /** Its code. */\n    readonly code: string;\n    /** The plain sentence. */\n    readonly text: string;\n    /** The checker's own sentence, one step away (on hover). */\n    readonly message: string;\n    /** Its fixes, best first. */\n    readonly fixes: readonly { readonly label: string; readonly fix: StepFix }[];\n}\n\n/** One line of a card. */\nexport interface CardLine {\n    /** A row of parts; a group, with its own head and lines; a foot of adds; a note; a jq step's code. */\n    readonly kind: \"row\" | \"group\" | \"foot\" | \"note\" | \"code\";\n    /** Its parts. */\n    readonly parts: readonly CardPart[];\n    /** A group's head: its match and its words. */\n    readonly head?: readonly CardPart[];\n    /** A group's lines. */\n    readonly lines?: readonly CardLine[];\n    /** The problems under it. */\n    readonly problems: readonly ProblemLine[];\n}\n\n/** The line between two steps: the shape in words. */\nexport interface ShapeLine {\n    /** The shape, or the count after a fresh run — `16 shipped orders`. */\n    readonly text: string;\n    /** What changed: `+ name, region` after a Look up or a date part, or the fields after a reshaping step. */\n    readonly extra: string;\n    /** The East type, for hover. */\n    readonly type: string;\n    /** Whether the text is a count. */\n    readonly counted: boolean;\n}\n\n/** A step's card. */\nexport interface Card {\n    /** The step's id. */\n    readonly stepId: string;\n    /** Its place, from 0. */\n    readonly index: number;\n    /** Its kind. */\n    readonly kind: Step[\"type\"];\n    /** Its title. */\n    readonly title: string;\n    /** Its icon. */\n    readonly icon: string;\n    /** Its head: a filter's match, when it has two conditions or more. */\n    readonly head: readonly CardPart[];\n    /** Its lines. */\n    readonly lines: readonly CardLine[];\n    /** Whether it is finished, and so in the program. */\n    readonly complete: boolean;\n    /** Its problems that stop the query running. */\n    readonly errors: number;\n    /** Its warnings, unfinished slots aside. */\n    readonly warnings: number;\n    /** The shape after it. */\n    readonly shape: ShapeLine;\n}\n\n/** The source's card: what the query starts with. */\nexport interface SourceCard {\n    /** `Start with orders`. */\n    readonly title: string;\n    /** The source's plain kind — `list of orders`. */\n    readonly kind: string;\n    /** The shape it gives. */\n    readonly shape: ShapeLine;\n}\n\n/** What building a step's card needs. */\ninterface CardContext {\n    readonly query: StepQuery;\n    readonly root: EastType;\n    readonly checked: CheckedSteps;\n    readonly words: QueryWords;\n    readonly step: Step;\n    readonly before: Shape;\n    readonly diagnostics: readonly StepDiagnostic[];\n}\n\n/** Whether an error lies on a place of a step. */\nfunction errorAt(ctx: CardContext, where: { condId?: string; slot?: DiagnosticSlot; id?: string; anySlot?: boolean }): boolean {\n    return ctx.diagnostics.some(d => d.severity === \"error\"\n        && (where.condId === undefined || d.condId === where.condId)\n        && (where.anySlot === true || d.slot === where.slot || (where.slot === \"field\" && d.slot === undefined && where.condId !== undefined))\n        && (where.id === undefined || d.id === where.id));\n}\n\n/** The problem lines of the diagnostics a test picks, unfinished slots aside. */\nfunction problemsWhere(ctx: CardContext, pick: (d: StepDiagnostic) => boolean): ProblemLine[] {\n    return ctx.diagnostics.filter(d => d.code !== \"incomplete\" && pick(d)).map(d => {\n        const words = problemWords(d, ctx.query, ctx.root, ctx.checked, ctx.words);\n        return { severity: d.severity, code: d.code, text: words.text, message: d.message, fixes: words.fixes };\n    });\n}\n\n/** A slot part. */\nfunction slot(ctx: CardContext, ref: Omit<SlotRef, \"stepId\">, text: string | undefined, error: boolean, mono = false): CardPart {\n    const full: SlotRef = { stepId: ctx.step.value.id, ...ref };\n    return {\n        t: \"slot\", slot: full, text: text ?? \"\", empty: text === undefined || text === \"\",\n        placeholder: ctx.words.messages.placeholder({ slot: ref.kind }), mono: mono && text !== undefined && text !== \"\", error,\n    };\n}\n\n/** A word part. */\nconst word = (text: string, joiner = false): CardPart => (joiner ? { t: \"word\", text, joiner } : { t: \"word\", text });\n\n/** An input part. */\nfunction input(ctx: CardContext, ref: Omit<InputRef, \"stepId\">, value: string, width: \"count\" | \"name\" | \"value\" | \"range\", mono: boolean, error: boolean): CardPart {\n    return { t: \"input\", input: { stepId: ctx.step.value.id, ...ref }, value, width, mono, error };\n}\n\n/** A remove part. */\nfunction remove(ctx: CardContext, kind: RemoveRef[\"kind\"], id: string, label?: string): CardPart {\n    return { t: \"remove\", label: label ?? ctx.words.messages.remove(), target: { kind, stepId: ctx.step.value.id, id } };\n}\n\n/** An add part. */\nfunction add(ctx: CardContext, text: string, action: Omit<ActionRef, \"stepId\">): CardPart {\n    return { t: \"add\", text, action: { stepId: ctx.step.value.id, ...action }, ghost: false };\n}\n\n/** Whether a value reads as data: a number, an ID or a date. */\nfunction monoField(field: StepField | undefined): boolean {\n    return field !== undefined && ((field.kind !== \"text\" && field.kind !== \"case\") || isIdName(field.name));\n}\n\n/** The ids of a condition and every condition inside it. */\nfunction conditionIds(condition: Condition): string[] {\n    if (condition.type === \"group\") return [condition.value.id, ...condition.value.conds.flatMap(conditionIds)];\n    return [condition.value.id, ...(condition.value.inner.type === \"some\" ? conditionIds(condition.value.inner.value) : [])];\n}\n\n/** A test's parts: its field, its comparison, and its value or inner condition. */\nfunction testParts(ctx: CardContext, condition: TestCondition, shape: Shape): CardPart[] {\n    const m = ctx.words.messages;\n    const { id, field, cmp, value, inner } = condition.value;\n    const ref = field.type === \"some\" ? field.value : undefined;\n    const f = ref === undefined ? undefined : fieldByRef(shape, ref);\n    const parts: CardPart[] = [slot(ctx, { kind: \"field\", condId: id }, ref === undefined ? undefined : refLabel(shape, ref), errorAt(ctx, { condId: id, slot: \"field\" }))];\n    if (ref === undefined) return parts;\n    const kind = cmp.type === \"some\" ? cmp.value.type : undefined;\n    parts.push(slot(ctx, { kind: \"cmp\", condId: id }, kind === undefined ? undefined : m.comparison({ cmp: kind }), errorAt(ctx, { condId: id, slot: \"cmp\" })));\n    if (kind === undefined) return parts;\n    if (kind === \"anyWhere\") {\n        if (inner.type === \"none\") {\n            parts.push(slot(ctx, { kind: \"field\", condId: id, id: \"inner\" }, undefined, false));\n            return parts;\n        }\n        parts.push(...conditionParts(ctx, inner.value, itemShape(f)));\n        return parts;\n    }\n    if (needsValue(kind)) {\n        const text = value.type === \"some\" ? valueWords(value.value, ctx.words) : undefined;\n        parts.push(slot(ctx, { kind: \"value\", condId: id }, text, errorAt(ctx, { condId: id, slot: \"value\" }), monoField(f)));\n    }\n    return parts;\n}\n\n/** A condition's parts inline: a test's, or a group's tests joined. */\nfunction conditionParts(ctx: CardContext, condition: Condition, shape: Shape): CardPart[] {\n    if (condition.type === \"test\") return testParts(ctx, condition, shape);\n    const m = ctx.words.messages;\n    return condition.value.conds.flatMap((c, i) => [...(i === 0 ? [] : [word(m.joiner({ match: condition.value.match.type }), true)]), ...conditionParts(ctx, c, shape)]);\n}\n\n/** A filter's lines. */\nfunction filterLines(ctx: CardContext, step: Extract<Step, { type: \"filter\" }>): { head: CardPart[]; lines: CardLine[] } {\n    const m = ctx.words.messages;\n    const match = step.value.match.type;\n    const head: CardPart[] = step.value.conds.length > 1 ? [slot(ctx, { kind: \"match\" }, m.match({ match }), false), word(m.ofThese({ match }))] : [];\n    const lines: CardLine[] = [];\n    step.value.conds.forEach((c, i) => {\n        const joiner = i === 0 ? [word(\"\", true)] : [word(m.joiner({ match }), true)];\n        if (c.type === \"group\") {\n            const g = c.value;\n            const inner: CardLine[] = g.conds.map((gc, gi) => ({\n                kind: \"row\",\n                parts: [gi === 0 ? word(\"\", true) : word(m.joiner({ match: g.match.type }), true), ...conditionParts(ctx, gc, ctx.before), remove(ctx, \"condition\", gc.value.id)],\n                problems: problemsWhere(ctx, d => d.condId !== undefined && conditionIds(gc).includes(d.condId)),\n            }));\n            inner.push({ kind: \"foot\", parts: [add(ctx, m.addCondition(), { kind: \"add-condition\", groupId: g.id })], problems: problemsWhere(ctx, d => d.condId === g.id) });\n            lines.push({\n                kind: \"group\",\n                parts: joiner,\n                head: [slot(ctx, { kind: \"group-match\", condId: g.id }, m.match({ match: g.match.type }), false), word(m.ofThese({ match: g.match.type })), remove(ctx, \"condition\", g.id, m.removeGroup())],\n                lines: inner,\n                problems: [],\n            });\n            return;\n        }\n        lines.push({\n            kind: \"row\",\n            parts: [...joiner, ...testParts(ctx, c, ctx.before), remove(ctx, \"condition\", c.value.id)],\n            problems: problemsWhere(ctx, d => d.condId !== undefined && conditionIds(c).includes(d.condId)),\n        });\n    });\n    lines.push({ kind: \"foot\", parts: [add(ctx, m.addCondition(), { kind: \"add-condition\" }), add(ctx, m.addGroup(), { kind: \"add-group\" })], problems: problemsWhere(ctx, d => d.condId === undefined) });\n    return { head, lines };\n}\n\n/** A step's lines. */\nfunction stepLines(ctx: CardContext): { head: CardPart[]; lines: CardLine[] } {\n    const m = ctx.words.messages;\n    const step = ctx.step;\n    const before = ctx.before;\n    const label = (ref: { type: \"some\"; value: string } | { type: \"none\" }): string | undefined => (ref.type === \"some\" ? refLabel(before, ref.value) : undefined);\n    const all = (): ProblemLine[] => problemsWhere(ctx, () => true);\n    switch (step.type) {\n        case \"filter\":\n            return filterLines(ctx, step);\n        case \"lookup\": {\n            const dataset = step.value.dataset.type === \"some\" ? step.value.dataset.value : undefined;\n            return {\n                head: [],\n                lines: [\n                    {\n                        kind: \"row\",\n                        parts: [word(m.find()), slot(ctx, { kind: \"key\" }, label(step.value.key), errorAt(ctx, { slot: \"key\" })), word(m.inDataset()),\n                            slot(ctx, { kind: \"dataset\" }, dataset, errorAt(ctx, { slot: \"dataset\" }))],\n                        problems: problemsWhere(ctx, d => d.slot === \"key\" || d.slot === \"dataset\"),\n                    },\n                    {\n                        kind: \"row\",\n                        parts: [word(m.bringIn()), ...step.value.fields.map((f): CardPart => ({ t: \"chip\", text: human(f), remove: { kind: \"lookup-field\", stepId: step.value.id, id: f } })),\n                            add(ctx, m.addField(), { kind: \"open\", slot: { kind: \"lookup-add\", stepId: step.value.id } })],\n                        problems: problemsWhere(ctx, d => d.slot === \"fields\" || (d.slot !== \"key\" && d.slot !== \"dataset\")),\n                    },\n                    { kind: \"note\", parts: [word(m.leftEmpty({ noun: singular(dataset ?? \"\") }))], problems: [] },\n                ],\n            };\n        }\n        case \"group\": {\n            const by = step.value.by;\n            const byText = by.type === \"none\" ? undefined : by.value.type === \"all\" ? m.allRowsTogether() : refLabel(before, by.value.value);\n            const lines: CardLine[] = [{ kind: \"row\", parts: [word(m.by()), slot(ctx, { kind: \"by\" }, byText, errorAt(ctx, { slot: \"by\" }))], problems: problemsWhere(ctx, d => d.slot === \"by\") }];\n            step.value.aggs.forEach((a, k) => {\n                const fn = a.fn.type;\n                lines.push({\n                    kind: \"row\",\n                    parts: [\n                        word(m.thenTotal({ first: k === 0 })),\n                        slot(ctx, { kind: \"agg-fn\", id: a.id }, m.total({ fn }), false),\n                        ...(fn === \"count\" ? [] : [slot(ctx, { kind: \"agg-field\", id: a.id }, label(a.field), errorAt(ctx, { slot: \"agg-field\", id: a.id }))]),\n                        word(m.as()),\n                        input(ctx, { kind: \"agg-as\", id: a.id }, a.as, \"name\", false, false),\n                        remove(ctx, \"total\", a.id),\n                    ],\n                    problems: problemsWhere(ctx, d => d.id === a.id),\n                });\n            });\n            lines.push({ kind: \"foot\", parts: [add(ctx, m.addTotal(), { kind: \"add-total\" })], problems: problemsWhere(ctx, d => d.slot !== \"by\" && d.id === undefined) });\n            return { head: [], lines };\n        }\n        case \"sort\": {\n            const f = step.value.field.type === \"some\" ? fieldByRef(before, step.value.field.value) : undefined;\n            return {\n                head: [],\n                lines: [{\n                    kind: \"row\",\n                    parts: [word(m.by()), slot(ctx, { kind: \"sort-field\" }, label(step.value.field), errorAt(ctx, { anySlot: true })),\n                        slot(ctx, { kind: \"dir\" }, m.direction({ dir: step.value.dir.type, kind: orderKind(f) }), false)],\n                    problems: all(),\n                }],\n            };\n        }\n        case \"limit\": {\n            const n = step.value.n;\n            const text = n.type === \"number\" ? ctx.words.formatters.bare(n.value) : n.value;\n            const count = n.type === \"number\" && Number.isSafeInteger(n.value) ? n.value : undefined;\n            return {\n                head: [],\n                lines: [{ kind: \"row\", parts: [input(ctx, { kind: \"limit-n\" }, text, \"count\", true, errorAt(ctx, { anySlot: true })), word(rowsWords(before, ctx.words, count))], problems: all() }],\n            };\n        }\n        case \"count\":\n            return { head: [], lines: [{ kind: \"row\", parts: [word(m.givesOneWholeNumber())], problems: all() }] };\n        case \"pick\": {\n            const lines: CardLine[] = step.value.fields.map(p => ({\n                kind: \"row\",\n                parts: [slot(ctx, { kind: \"pick-field\", id: p.id }, label(p.field), errorAt(ctx, { slot: \"pick-field\", id: p.id })), word(m.as()),\n                    input(ctx, { kind: \"pick-as\", id: p.id }, p.as, \"name\", false, false), remove(ctx, \"pick\", p.id)],\n                problems: problemsWhere(ctx, d => d.id === p.id),\n            }));\n            lines.push({ kind: \"foot\", parts: [add(ctx, m.addField(), { kind: \"open\", slot: { kind: \"pick-add\", stepId: step.value.id } })], problems: problemsWhere(ctx, d => d.id === undefined) });\n            return { head: [], lines };\n        }\n        case \"fill\": {\n            const f = step.value.field.type === \"some\" ? fieldByRef(before, step.value.field.value) : undefined;\n            const value = step.value.value.type === \"some\" ? valueWords(step.value.value.value, ctx.words) : \"\";\n            return {\n                head: [],\n                lines: [{\n                    kind: \"row\",\n                    parts: [word(m.where()), slot(ctx, { kind: \"fill-field\" }, label(step.value.field), errorAt(ctx, { slot: \"field\" })), word(m.isMissingUse()),\n                        input(ctx, { kind: \"fill-value\" }, value, \"value\", monoField(f), errorAt(ctx, { slot: \"value\" }))],\n                    problems: all(),\n                }],\n            };\n        }\n        case \"drill\": {\n            const f = step.value.field.type === \"some\" ? fieldByRef(before, step.value.field.value) : undefined;\n            const hasId = before.row !== undefined && fieldsOf(before).some(x => x.ref === \"id\");\n            return {\n                head: [],\n                lines: [{\n                    kind: \"row\",\n                    parts: [word(m.open()), slot(ctx, { kind: \"drill-field\" }, label(step.value.field), errorAt(ctx, { anySlot: true })),\n                        word(m.onePer({ item: singular(f?.name ?? \"item\"), ...(hasId ? { keeping: before.noun } : {}) }))],\n                    problems: all(),\n                }],\n            };\n        }\n        case \"datepart\":\n            return {\n                head: [],\n                lines: [{\n                    kind: \"row\",\n                    parts: [word(m.takeThe()), slot(ctx, { kind: \"part\" }, m.part({ part: step.value.part.type }), false), word(m.of()),\n                        slot(ctx, { kind: \"date-field\" }, label(step.value.field), errorAt(ctx, { slot: \"field\" })), word(m.as()),\n                        input(ctx, { kind: \"datepart-as\" }, step.value.as, \"name\", false, errorAt(ctx, { slot: \"as\" }))],\n                    problems: all(),\n                }],\n            };\n        case \"walk\": {\n            const node = unwrapRecursive(before.type);\n            const kept = node.type === \"Struct\" ? scalarFieldsOf(node).map(human) : [];\n            const parts: CardPart[] = [word(m.everyLevel({ fields: m.list({ items: kept }) }))];\n            if (step.value.via.type === \"none\") parts.push(slot(ctx, { kind: \"via\" }, undefined, errorAt(ctx, { slot: \"via\" })));\n            return { head: [], lines: [{ kind: \"row\", parts, problems: all() }] };\n        }\n        case \"tabulate\": {\n            const { over, from, to, step: by, fixed, as } = step.value;\n            const show = (x: typeof from): string => (x.type === \"number\" ? ctx.words.formatters.bare(x.value) : x.value);\n            const rangeError = errorAt(ctx, { slot: \"range\" });\n            const fn = unwrapRecursive(before.type);\n            const inputType = fn.type === \"Function\" && (fn.inputs as EastType[]).length === 1 ? unwrapRecursive((fn.inputs as EastType[])[0]!) : undefined;\n            const others = inputType?.type === \"Struct\" ? Object.keys(inputType.fields as Record<string, EastType>).filter(k => k !== over) : [];\n            const lines: CardLine[] = [{\n                kind: \"row\",\n                parts: [word(m.inputFrom({ input: human(over) })), input(ctx, { kind: \"tab-from\" }, show(from), \"range\", true, rangeError), word(m.to()),\n                    input(ctx, { kind: \"tab-to\" }, show(to), \"range\", true, rangeError), word(m.every()), input(ctx, { kind: \"tab-step\" }, show(by), \"range\", true, rangeError)],\n                problems: problemsWhere(ctx, d => d.slot === \"range\" || d.slot === undefined),\n            }];\n            if (others.length > 0) {\n                lines.push({\n                    kind: \"row\",\n                    parts: others.flatMap(k => {\n                        const v = fixed.get(k);\n                        return [word(human(k)), slot(ctx, { kind: \"fixed\", id: k }, v === undefined ? undefined : valueWords(v, ctx.words), errorAt(ctx, { slot: \"fixed\", id: k }))];\n                    }),\n                    problems: problemsWhere(ctx, d => d.slot === \"fixed\"),\n                });\n            }\n            lines.push({ kind: \"row\", parts: [word(m.callTheResult()), input(ctx, { kind: \"tab-as\" }, as, \"name\", false, errorAt(ctx, { slot: \"as\" }))], problems: problemsWhere(ctx, d => d.slot === \"as\" || d.slot === \"over\") });\n            return { head: [], lines };\n        }\n        case \"jq\":\n            return { head: [], lines: [{ kind: \"code\", parts: [{ t: \"code\", text: step.value.text }], problems: all() }] };\n    }\n}\n\n/**\n * The shape line after a step, or after the source.\n *\n * @param before - the shape the step takes; `undefined` for the source\n * @param after - the shape it gives\n * @param kind - the step's kind\n * @param n - the rows a fresh run counted there, if any\n * @param words - the words\n * @returns the line\n */\nfunction shapeLine(before: Shape | undefined, after: Shape, kind: Step[\"type\"] | undefined, n: number | undefined, words: QueryWords): ShapeLine {\n    const counted = n !== undefined && after.kind === \"rows\";\n    let extra = \"\";\n    if (before !== undefined && after.kind === \"rows\" && !isTypeEqual(after.type, before.type)) {\n        const now = fieldLabels(after);\n        const was = new Set(fieldLabels(before));\n        extra = kind === \"lookup\" || kind === \"datepart\"\n            ? words.messages.fieldsAdded({ fields: now.filter(l => !was.has(l)).join(\", \") })\n            : now.join(\", \");\n    }\n    return {\n        text: counted ? countWords(after, n, words) : shapeWords(after, words),\n        extra,\n        type: after.kind === \"unknown\" ? \"\" : describeJqType(after.type, { maxDepth: 2 }),\n        counted,\n    };\n}\n\n/**\n * A query's step cards (`Query Editor Spec.md` §4.3, §4.4).\n *\n * @param query - the query\n * @param root - the root's type: a struct of the data sources\n * @param checked - its check (`checkSteps`)\n * @param words - the words\n * @param counts - the rows a fresh run counted, by step id (`readCounts`), so the shape lines count\n * @returns one card per step, in order\n */\nexport function cardsFor(query: StepQuery, root: EastType, checked: CheckedSteps, words: QueryWords, counts?: ReadonlyMap<string, number>): Card[] {\n    return query.steps.map((step, index) => {\n        const stage = checked.stages[index]!;\n        const diagnostics = checked.diagnostics.filter(d => d.stepId === step.value.id);\n        const ctx: CardContext = { query, root, checked, words, step, before: stage.before, diagnostics };\n        const { head, lines } = stepLines(ctx);\n        return {\n            stepId: step.value.id,\n            index,\n            kind: step.type,\n            title: words.messages.stepTitle({ kind: step.type, noun: stage.before.noun }),\n            icon: STEP_ICON[step.type],\n            head,\n            lines,\n            complete: isComplete(step),\n            errors: diagnostics.filter(d => d.severity === \"error\").length,\n            warnings: diagnostics.filter(d => d.severity === \"warning\" && d.code !== \"incomplete\").length,\n            shape: shapeLine(stage.before, stage.after, step.type, counts?.get(step.value.id), words),\n        };\n    });\n}\n\n/**\n * The source's card: `Start with orders`, its plain kind and its shape.\n *\n * @param query - the query\n * @param root - the root's type\n * @param checked - its check\n * @param words - the words\n * @param counts - the rows a fresh run counted (`SOURCE_COUNT` for the source's)\n * @returns the card\n */\nexport function sourceCard(query: StepQuery, root: EastType, checked: CheckedSteps, words: QueryWords, counts?: ReadonlyMap<string, number>): SourceCard {\n    const struct = unwrapRecursive(root);\n    const type = struct.type === \"Struct\" ? (struct.fields as Record<string, EastType>)[query.source] : undefined;\n    return {\n        title: words.messages.startWith({ source: query.source }),\n        kind: type === undefined ? \"\" : plainKind(type, words, plural(human(checked.source.noun))),\n        shape: shapeLine(undefined, checked.source, undefined, counts?.get(SOURCE_COUNT), words),\n    };\n}\n\n/** One line of an outline: a finished step's icon, title and words. */\nexport interface OutlineLine {\n    /** The step's icon. */\n    readonly icon: string;\n    /** Its title. */\n    readonly title: string;\n    /** What it does, in words — `status is shipped and total is at least 100`. */\n    readonly words: string;\n}\n\n/**\n * A query's outline: one line per finished step, which a library card's\n * wireframe draws (`Query Editor Spec.md` §5).\n *\n * @param query - the query\n * @param checked - its check, for the rows each step takes\n * @param words - the words\n * @returns the lines, in order: each step's icon, title and {@link stepWords}\n */\nexport function outlineOf(query: StepQuery, checked: CheckedSteps, words: QueryWords): OutlineLine[] {\n    return query.steps.flatMap((step, i) => {\n        if (!isComplete(step)) return [];\n        const before = checked.stages[i]!.before;\n        return [{ icon: STEP_ICON[step.type], title: words.messages.stepTitle({ kind: step.type, noun: human(before.noun) }), words: stepWords(step, before, words) }];\n    });\n}\n\n/**\n * The first empty slot of a card: where an added step opens.\n *\n * @param card - the card\n * @returns the slot, or `undefined` when every slot is filled\n */\nexport function firstEmptySlot(card: Card): SlotRef | undefined {\n    const parts = (lines: readonly CardLine[]): CardPart[] => lines.flatMap(l => [...(l.head ?? []), ...l.parts, ...parts(l.lines ?? [])]);\n    const found = [...card.head, ...parts(card.lines)].find(p => p.t === \"slot\" && p.empty);\n    return found?.t === \"slot\" ? found.slot : undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Parsing steps (#933): a jq program back into the steps it is made of. Each\n * canonical form (`Query Editor Spec.md` §4.7) is recognised on the program\n * east's `parseJq` makes, never on its text, so layout and comments do not\n * matter; a segment no recogniser takes is a jq step, and so is every\n * segment after it.\n *\n * @packageDocumentation\n */\n\nimport {\n    SortedMap, StringType, checkJq, compareFor, none, parseJq, some, toQuerySpan, variant,\n    type EastType, type JqNode, type ParsedJq, type QueryErrorType, type ValueTypeOf,\n} from \"@elaraai/east\";\nimport { comparisonsFor, fieldsOf, type StepField } from \"./fields.js\";\nimport {\n    at, readCall, readChain, readLiteral, readObject, readPath, readPipe, readStepValue,\n} from \"./jq.js\";\nimport { SEP, itemShape, knownAfter, nameFor, pathFor, scalarFieldsOf, stageAt, variableName } from \"./print.js\";\nimport { UNKNOWN, shapeOf, singular, unwrapRecursive, type Shape } from \"./shape.js\";\nimport {\n    comparison, freshId, type Aggregate, type ComparisonKind, type Condition, type PickField, type Step, type StepInput,\n    type StepQuery, type StepValue,\n} from \"./values.js\";\n\n/** A problem that keeps a program from being steps, as the query wire types hold one. */\nexport type StepParseError = ValueTypeOf<typeof QueryErrorType>;\n\n/** Where a step was read from in the program's text: the segments it was made of, first to last. */\nexport interface StepSpan {\n    /** The step's id. */\n    readonly stepId: string;\n    /** The offset its first segment starts at. */\n    readonly from: number;\n    /** The offset after its last segment. */\n    readonly to: number;\n}\n\n/** A segment of the program's pipeline, and where it is. */\ninterface Segment {\n    readonly node: JqNode;\n    readonly path: string;\n    readonly from: number;\n    readonly to: number;\n}\n\n/** jq's comparison operators, by the comparison each is. */\nconst COMPARISON: Readonly<Record<string, ComparisonKind>> = { \"==\": \"eq\", \"!=\": \"ne\", \">=\": \"ge\", \"<=\": \"le\", \">\": \"gt\", \"<\": \"lt\" };\n\n/**\n * A problem, at a range of the text.\n *\n * @param text - the program's text\n * @param code - its code\n * @param message - its sentence\n * @param from - where it starts\n * @param to - where it ends\n * @returns the problem\n */\nfunction problem(text: string, code: string, message: string, from: number, to: number): StepParseError {\n    return { code, fixes: [], message, severity: variant(\"error\", null), span: some(toQuerySpan(text, from, to)), suggestions: [] };\n}\n\n/**\n * The field a path reads, when printing that field reads the same path: so a\n * step parsed prints back as it was read.\n *\n * @param shape - the rows the path reads in\n * @param names - the fields read, as `readPath` gives them\n * @param whole - the field is read as a whole value: a variant, not its case\n * @returns the field's ref, or `undefined` when no field reads that path\n */\nfunction refOf(shape: Shape, names: readonly string[], whole = false): string | undefined {\n    const same = (path: readonly string[]): boolean => path.length === names.length && path.every((n, i) => n === names[i]);\n    const field = fieldsOf(shape).find(f => same(pathFor(shape, f.ref, whole)));\n    if (field !== undefined) return field.ref;\n    // A field the rows do not have is read as written, so the check can say so.\n    return names.length === 1 && same(pathFor(shape, names[0]!, whole)) ? names[0] : undefined;\n}\n\n/** The field a node reads, as {@link refOf} finds it. */\nfunction refOfNode(shape: Shape, node: JqNode | undefined, whole = false): string | undefined {\n    const names = node === undefined ? undefined : readPath(node);\n    return names === undefined ? undefined : refOf(shape, names, whole);\n}\n\n/** A test of a field. */\nfunction test(ref: string, kind: ComparisonKind, value: StepValue | undefined, extra: { inner?: Condition; whole?: boolean } = {}): Condition {\n    return variant(\"test\", {\n        id: freshId(\"condition\"),\n        field: some(ref),\n        cmp: some(comparison(kind)),\n        value: value === undefined ? none : some(value),\n        inner: extra.inner === undefined ? none : some(extra.inner),\n        whole: extra.whole ?? false,\n    }) as Condition;\n}\n\n/** Whether a field takes a comparison: one the rows do not have takes any, which the check judges. */\nfunction takes(field: StepField | undefined, kind: ComparisonKind, whole: boolean): boolean {\n    if (field === undefined) return true;\n    if (whole) return field.kind === \"case\" && (kind === \"eq\" || kind === \"ne\");\n    return comparisonsFor(field).includes(kind);\n}\n\n/**\n * Reads one condition: a test in a canonical form, or a group.\n *\n * @param node - the condition's node\n * @param shape - the rows it tests\n * @returns the condition, or `undefined` when it is no canonical form\n */\nfunction readCondition(node: JqNode, shape: Shape): Condition | undefined {\n    if (node.type === \"binary\" && (node.value.op === \"and\" || node.value.op === \"or\")) {\n        const op = node.value.op;\n        const conds = readChain(node, op).map(n => readCondition(n, shape));\n        if (conds.some(c => c === undefined)) return undefined;\n        return variant(\"group\", { id: freshId(\"condition\"), match: variant(op === \"or\" ? \"any\" : \"all\", null), conds: conds as Condition[] }) as Condition;\n    }\n    const field = (ref: string): StepField | undefined => fieldsOf(shape).find(f => f.ref === ref);\n    if (node.type === \"binary\") {\n        const { left, op, right } = node.value;\n        const segments = readPipe(left);\n        // `(p | year) == 2026`, `(p | strftime(\"%Y-%m\")) == \"2026-03\"`, `(p | length) >= 1`\n        if (segments.length === 2) {\n            const ref = refOfNode(shape, segments[0]);\n            const read = segments[1]!;\n            const value = readStepValue(right);\n            if (ref === undefined || value === undefined) return undefined;\n            let kind: ComparisonKind | undefined;\n            if (op === \"==\" && readCall(read, \"year\", 0) !== undefined && value.type === \"number\") kind = \"inYear\";\n            else if (op === \">=\" && readCall(read, \"length\", 0) !== undefined && value.type === \"number\") kind = \"lengthAtLeast\";\n            else if (op === \"==\" && value.type === \"text\") {\n                const format = readCall(read, \"strftime\", 1);\n                const literal = format === undefined ? undefined : readLiteral(format[0]!);\n                if (literal?.type.type === \"String\" && literal.value === \"%Y-%m\") kind = \"inMonth\";\n            }\n            return kind !== undefined && takes(field(ref), kind, false) ? test(ref, kind, value) : undefined;\n        }\n        const cmp = COMPARISON[op];\n        if (cmp === undefined) return undefined;\n        const literal = readLiteral(right);\n        if (literal === undefined) return undefined;\n        // A variant compared as a whole value, which the check refuses: kept, so it can say so.\n        const wholeRef = refOfNode(shape, left, true);\n        const whole = wholeRef !== undefined && field(wholeRef)?.kind === \"case\" && refOfNode(shape, left) === undefined;\n        const ref = whole ? wholeRef : refOfNode(shape, left);\n        if (ref === undefined) return undefined;\n        const f = field(ref);\n        if (literal.type.type === \"Null\") {\n            const kind: ComparisonKind | undefined = op === \"==\" ? \"missing\" : op === \"!=\" ? \"present\" : undefined;\n            return kind !== undefined && takes(f, kind, false) ? test(ref, kind, undefined) : undefined;\n        }\n        if (literal.type.type === \"Boolean\" && op === \"==\") {\n            const kind: ComparisonKind = literal.value === true ? \"yes\" : \"no\";\n            return takes(f, kind, false) ? test(ref, kind, undefined) : undefined;\n        }\n        const value = readStepValue(right);\n        if (value === undefined) return undefined;\n        let kind: ComparisonKind = cmp;\n        if (f?.kind === \"date\" && value.type === \"text\") {\n            if (op === \">=\") kind = \"onOrAfter\";\n            else if (op === \"<\") kind = \"before\";\n            else return undefined;\n        }\n        return takes(f, kind, whole) ? test(ref, kind, value, { whole }) : undefined;\n    }\n    // `(p | contains(\"x\"))`, `(p | startswith(\"x\"))`\n    if (node.type === \"pipe\") {\n        const segments = readPipe(node);\n        if (segments.length !== 2) return undefined;\n        const ref = refOfNode(shape, segments[0]);\n        const contains = readCall(segments[1]!, \"contains\", 1);\n        const starts = readCall(segments[1]!, \"startswith\", 1);\n        const arg = contains ?? starts;\n        const value = arg === undefined ? undefined : readStepValue(arg[0]!);\n        if (ref === undefined || value?.type !== \"text\") return undefined;\n        const kind: ComparisonKind = contains !== undefined ? \"contains\" : \"startsWith\";\n        return takes(field(ref), kind, false) ? test(ref, kind, value) : undefined;\n    }\n    // `any(p[]; inner)`\n    const any = readCall(node, \"any\", 2);\n    if (any !== undefined && any[0]!.type === \"iterate\" && !any[0]!.value.optional) {\n        const ref = refOfNode(shape, any[0]!.value.target);\n        if (ref === undefined || !takes(field(ref), \"anyWhere\", false)) return undefined;\n        const inner = readCondition(any[1]!, itemShape(field(ref)));\n        return inner === undefined ? undefined : test(ref, \"anyWhere\", undefined, { inner });\n    }\n    return undefined;\n}\n\n/** Reads a Keep rows where step: `map(select(c) | …)`. */\nfunction readFilter(node: JqNode, shape: Shape): Step | undefined {\n    const map = readCall(node, \"map\", 1);\n    if (map === undefined) return undefined;\n    const selects = readPipe(map[0]!).map(s => readCall(s, \"select\", 1)?.[0]);\n    if (selects.length === 0 || selects.some(s => s === undefined)) return undefined;\n    const bodies = selects as JqNode[];\n    let match: \"all\" | \"any\" = \"all\";\n    const conds: Condition[] = [];\n    if (bodies.length === 1) {\n        const body = bodies[0]!;\n        const op = body.type === \"binary\" && (body.value.op === \"and\" || body.value.op === \"or\") ? body.value.op : \"and\";\n        match = op === \"or\" ? \"any\" : \"all\";\n        for (const n of readChain(body, op)) {\n            const c = readCondition(n, shape);\n            if (c === undefined) return undefined;\n            conds.push(c);\n        }\n    } else {\n        for (const body of bodies) {\n            const operands = body.type === \"binary\" && body.value.op === \"or\" ? [body] : readChain(body, \"and\");\n            for (const n of operands) {\n                const c = readCondition(n, shape);\n                if (c === undefined) return undefined;\n                conds.push(c);\n            }\n        }\n    }\n    return variant(\"filter\", { id: freshId(\"step\"), match: variant(match, null), conds });\n}\n\n/** The name a total takes until its author names it: count, the field's name for a sum, `fn_field` otherwise. */\nexport function defaultTotalName(shape: Shape, fn: Aggregate[\"fn\"][\"type\"], ref: string | undefined): string {\n    if (fn === \"count\") return \"count\";\n    const name = ref === undefined ? \"value\" : nameFor(shape, ref);\n    return fn === \"sum\" ? name : `${fn}_${name}`;\n}\n\n/** Reads one total of a Group and total step. */\nfunction readAggregate(shape: Shape, as: string, node: JqNode | undefined): Aggregate | undefined {\n    if (node === undefined) return undefined;\n    const total = (fn: Aggregate[\"fn\"][\"type\"], ref: string | undefined): Aggregate => ({\n        id: freshId(\"aggregate\"),\n        fn: variant(fn, null) as Aggregate[\"fn\"],\n        field: ref === undefined ? none : some(ref),\n        as,\n    });\n    if (readCall(node, \"length\", 0) !== undefined) return total(\"count\", undefined);\n    const segments = readPipe(node);\n    const map = segments.length >= 2 ? readCall(segments[0]!, \"map\", 1) : undefined;\n    const ref = map === undefined ? undefined : refOfNode(shape, map[0]);\n    if (ref === undefined) return undefined;\n    const rest = segments.slice(1);\n    if (rest.length === 1 && readCall(rest[0]!, \"add\", 0) !== undefined) return total(\"sum\", ref);\n    if (rest.length === 1 && readCall(rest[0]!, \"min\", 0) !== undefined) return total(\"min\", ref);\n    if (rest.length === 1 && readCall(rest[0]!, \"max\", 0) !== undefined) return total(\"max\", ref);\n    if (rest.length === 1 && rest[0]!.type === \"binary\" && rest[0]!.value.op === \"/\"\n        && readCall(rest[0]!.value.left, \"add\", 0) !== undefined && readCall(rest[0]!.value.right, \"length\", 0) !== undefined) {\n        return total(\"mean\", ref);\n    }\n    if (rest.length === 2 && readCall(rest[0]!, \"unique\", 0) !== undefined && readCall(rest[1]!, \"length\", 0) !== undefined) return total(\"distinct\", ref);\n    return undefined;\n}\n\n/** Reads the totals of an object: `{name: total, …}`. */\nfunction readTotals(shape: Shape, entries: readonly { key: string; value: JqNode | undefined }[]): Aggregate[] | undefined {\n    const aggs = entries.map(e => readAggregate(shape, e.key, e.value));\n    return aggs.some(a => a === undefined) ? undefined : aggs as Aggregate[];\n}\n\n/** Whether a node is `.[0]`, the first row of a group. */\nfunction isFirstRow(node: JqNode): boolean {\n    if (node.type !== \"index\" || node.value.optional || node.value.target.type !== \"identity\") return false;\n    const literal = readLiteral(node.value.index);\n    return literal?.type.type === \"Integer\" && literal.value === 0n;\n}\n\n/**\n * Recognises the step a segment, and maybe the next, are.\n *\n * @param seg - the segment\n * @param next - the segment after it, for the forms that take two\n * @param shape - the rows it takes\n * @param binds - the prologue's variables, each a dataset of its own name\n * @returns the step and how many segments it took, or `undefined`\n */\nfunction recognise(seg: JqNode, next: JqNode | undefined, shape: Shape, binds: ReadonlySet<string>): { step: Step; used: 1 | 2 } | undefined {\n    const one = (step: Step | undefined): { step: Step; used: 1 } | undefined => step === undefined ? undefined : { step, used: 1 };\n\n    // group_by(p) | map({name: .[0]p, totals…})\n    const groupBy = readCall(seg, \"group_by\", 1);\n    if (groupBy !== undefined && next !== undefined) {\n        const byRef = refOfNode(shape, groupBy[0]);\n        const entries = readCall(next, \"map\", 1)?.[0];\n        const object = entries === undefined ? undefined : readObject(entries);\n        if (byRef !== undefined && object !== undefined && object.length >= 1) {\n            const [key, ...rest] = object;\n            const firstPath = key!.value === undefined ? undefined : readPath(key!.value, isFirstRow);\n            const byPath = pathFor(shape, byRef);\n            const same = firstPath !== undefined && firstPath.length === byPath.length && firstPath.every((n, i) => n === byPath[i]);\n            const aggs = readTotals(shape, rest);\n            if (same && key!.key === nameFor(shape, byRef) && aggs !== undefined) {\n                return { step: variant(\"group\", { id: freshId(\"step\"), by: some(variant(\"field\", byRef)), aggs }), used: 2 };\n            }\n        }\n        return undefined;\n    }\n    // sort_by(-p), sort_by(p), sort_by(p) | reverse\n    const sortBy = readCall(seg, \"sort_by\", 1);\n    if (sortBy !== undefined) {\n        const arg = sortBy[0]!;\n        if (arg.type === \"negate\") {\n            const ref = refOfNode(shape, arg.value);\n            const f = ref === undefined ? undefined : fieldsOf(shape).find(x => x.ref === ref);\n            if (ref === undefined || f === undefined || (f.kind !== \"int\" && f.kind !== \"num\") || f.optional) return undefined;\n            return one(variant(\"sort\", { id: freshId(\"step\"), field: some(ref), dir: variant(\"desc\", null) }));\n        }\n        const ref = refOfNode(shape, arg);\n        if (ref === undefined) return undefined;\n        const reversed = next !== undefined && readCall(next, \"reverse\", 0) !== undefined;\n        return { step: variant(\"sort\", { id: freshId(\"step\"), field: some(ref), dir: variant(reversed ? \"desc\" : \"asc\", null) }), used: reversed ? 2 : 1 };\n    }\n    // .[:n]\n    if (seg.type === \"slice\" && !seg.value.optional && seg.value.target.type === \"identity\" && seg.value.from.type === \"none\" && seg.value.to.type === \"some\") {\n        const value = readStepValue(seg.value.to.value);\n        const n: StepInput | undefined = value?.type === \"number\" ? variant(\"number\", value.value) : value?.type === \"text\" ? variant(\"text\", value.value) : undefined;\n        return n === undefined ? undefined : one(variant(\"limit\", { id: freshId(\"step\"), n }));\n    }\n    // length\n    if (readCall(seg, \"length\", 0) !== undefined) return one(variant(\"count\", { id: freshId(\"step\") }));\n    // {totals…}: all rows together\n    const allTotals = readObject(seg);\n    if (allTotals !== undefined && allTotals.length > 0) {\n        const aggs = readTotals(shape, allTotals);\n        return aggs === undefined ? undefined : one(variant(\"group\", { id: freshId(\"step\"), by: some(variant(\"all\", null)), aggs }));\n    }\n    const map = readCall(seg, \"map\", 1)?.[0];\n    if (map !== undefined) {\n        // map(. + {…}): a Look up, or a part of a date\n        if (map.type === \"binary\" && map.value.op === \"+\" && map.value.left.type === \"identity\") {\n            const entries = readObject(map.value.right);\n            if (entries === undefined || entries.length === 0) return undefined;\n            return one(readLookup(entries, shape, binds) ?? readDatePart(entries, shape));\n        }\n        // map(p //= v)\n        if (map.type === \"update\" && map.value.op === \"//=\") {\n            const ref = refOfNode(shape, map.value.path, true);\n            const value = readStepValue(map.value.value);\n            if (ref === undefined || value === undefined) return undefined;\n            return one(variant(\"fill\", { id: freshId(\"step\"), field: some(ref), value: some(value) }));\n        }\n        // map({a, b: p})\n        const picked = readObject(map);\n        if (picked !== undefined && picked.length > 0) {\n            const fields: PickField[] = [];\n            for (const entry of picked) {\n                const ref = entry.value === undefined ? refOf(shape, [entry.key], true) : refOfNode(shape, entry.value, true);\n                if (ref === undefined) return undefined;\n                fields.push({ id: freshId(\"pick\"), field: some(ref), as: entry.key });\n            }\n            return one(variant(\"pick\", { id: freshId(\"step\"), fields }));\n        }\n        return one(readFilter(seg, shape));\n    }\n    if (seg.type === \"array\" && seg.value.type === \"some\") return one(readArrayStep(seg.value.value, shape));\n    return undefined;\n}\n\n/** `map(. + {f: $ds[k].f, …})` */\nfunction readLookup(entries: readonly { key: string; value: JqNode | undefined }[], shape: Shape, binds: ReadonlySet<string>): Step | undefined {\n    let dataset: string | undefined;\n    let key: JqNode | undefined;\n    const fields: string[] = [];\n    for (const entry of entries) {\n        const value = entry.value;\n        if (value?.type !== \"field\" || value.value.optional || value.value.name !== entry.key) return undefined;\n        const target = value.value.target;\n        if (target.type !== \"index\" || target.value.optional || target.value.target.type !== \"variable\") return undefined;\n        const name = target.value.target.value;\n        if (!binds.has(name) || (dataset !== undefined && dataset !== name)) return undefined;\n        dataset = name;\n        key ??= target.value.index;\n        fields.push(entry.key);\n    }\n    const keyRef = refOfNode(shape, key);\n    if (dataset === undefined || keyRef === undefined) return undefined;\n    // Every entry reads by the same key.\n    for (const entry of entries) {\n        const index = (entry.value as Extract<JqNode, { type: \"field\" }>).value.target as Extract<JqNode, { type: \"index\" }>;\n        if (refOfNode(shape, index.value.index) !== keyRef) return undefined;\n    }\n    return variant(\"lookup\", { id: freshId(\"step\"), dataset: some(dataset), key: some(keyRef), fields });\n}\n\n/** `map(. + {name: (p | year)})` */\nfunction readDatePart(entries: readonly { key: string; value: JqNode | undefined }[], shape: Shape): Step | undefined {\n    if (entries.length !== 1 || entries[0]!.value === undefined) return undefined;\n    const segments = readPipe(entries[0]!.value);\n    if (segments.length !== 2) return undefined;\n    const ref = refOfNode(shape, segments[0]);\n    let part: \"year\" | \"month\" | \"weekday\" | undefined;\n    if (readCall(segments[1]!, \"year\", 0) !== undefined) part = \"year\";\n    else {\n        const format = readCall(segments[1]!, \"strftime\", 1);\n        const literal = format === undefined ? undefined : readLiteral(format[0]!);\n        if (literal?.type.type === \"String\") part = literal.value === \"%Y-%m\" ? \"month\" : literal.value === \"%A\" ? \"weekday\" : undefined;\n    }\n    if (ref === undefined || part === undefined) return undefined;\n    return variant(\"datepart\", { id: freshId(\"step\"), field: some(ref), part: variant(part, null), as: entries[0]!.key });\n}\n\n/** `[.[] | p[]]`, `[.[] | . as $row | p[] | . + {row_id: $row.id}]`, `[recurse(.p[]) | {…}]`, `[range(…) as $x | {…}]` */\nfunction readArrayStep(body: JqNode, shape: Shape): Step | undefined {\n    // Open each list.\n    const segments = readPipe(body);\n    if (segments.length === 2 && segments[0]!.type === \"iterate\" && !segments[0]!.value.optional && segments[0]!.value.target.type === \"identity\") {\n        const rest = segments[1]!;\n        if (rest.type === \"iterate\" && !rest.value.optional) {\n            const ref = refOfNode(shape, rest.value.target);\n            return ref === undefined ? undefined : variant(\"drill\", { id: freshId(\"step\"), field: some(ref) });\n        }\n        if (rest.type === \"bind\" && rest.value.source.type === \"identity\" && rest.value.patterns.length === 1) {\n            const pattern = rest.value.patterns[0]!;\n            const name = variableName(shape.noun);\n            if (pattern.type !== \"variable\" || pattern.value !== name) return undefined;\n            const inner = readPipe(rest.value.body);\n            if (inner.length !== 2 || inner[0]!.type !== \"iterate\" || inner[0]!.value.optional) return undefined;\n            const ref = refOfNode(shape, inner[0]!.value.target);\n            const keep = inner[1]!;\n            if (keep.type !== \"binary\" || keep.value.op !== \"+\" || keep.value.left.type !== \"identity\") return undefined;\n            const entries = readObject(keep.value.right);\n            const idRead = entries?.length === 1 ? entries[0]!.value : undefined;\n            const idPath = idRead === undefined ? undefined : readPath(idRead, base => base.type === \"variable\" && base.value === name);\n            if (ref === undefined || entries![0]!.key !== `${shape.noun}_id` || idPath?.length !== 1 || idPath[0] !== \"id\") return undefined;\n            return variant(\"drill\", { id: freshId(\"step\"), field: some(ref) });\n        }\n        return undefined;\n    }\n    // List every part in the tree.\n    if (segments.length === 2) {\n        const recurse = readCall(segments[0]!, \"recurse\", 1);\n        const via = recurse?.[0]?.type === \"iterate\" && !recurse[0].value.optional ? readPath(recurse[0].value.target) : undefined;\n        const kept = readObject(segments[1]!);\n        const node = unwrapRecursive(shape.type);\n        if (via?.length === 1 && kept !== undefined && node.type === \"Struct\") {\n            const scalars = scalarFieldsOf(node);\n            const same = kept.length === scalars.length && kept.every((e, i) => e.value === undefined && e.key === scalars[i]);\n            return same ? variant(\"walk\", { id: freshId(\"step\"), via: some(via[0]!) }) : undefined;\n        }\n        return undefined;\n    }\n    // Try the model over a range.\n    if (body.type === \"bind\" && body.value.patterns.length === 1 && body.value.patterns[0]!.type === \"variable\") {\n        const name = body.value.patterns[0]!.value;\n        const range = readCall(body.value.source, \"range\", 3);\n        const object = readObject(body.value.body);\n        if (range === undefined || object?.length !== 2) return undefined;\n        const [overEntry, resultEntry] = object;\n        if (overEntry!.value?.type !== \"variable\" || overEntry!.value.value !== name || name !== variableName(overEntry!.key)) return undefined;\n        const from = readStepValue(range[0]!);\n        const by = readStepValue(range[2]!);\n        const upto = range[1]!;\n        if (from?.type !== \"number\" || by?.type !== \"number\" || upto.type !== \"binary\" || upto.value.op !== \"+\") return undefined;\n        const to = readStepValue(upto.value.left);\n        const half = upto.value.right;\n        if (to?.type !== \"number\" || half.type !== \"binary\" || half.value.op !== \"/\") return undefined;\n        const halfStep = readStepValue(half.value.left);\n        const two = readLiteral(half.value.right);\n        if (halfStep?.type !== \"number\" || halfStep.value !== by.value || two?.type.type !== \"Integer\" || two.value !== 2n) return undefined;\n        const called = resultEntry!.value === undefined ? undefined : readCall(resultEntry!.value, \"call\", 2);\n        const args = called === undefined || called[0]!.type !== \"identity\" ? undefined : readObject(called[1]!);\n        if (args === undefined) return undefined;\n        const fixed: [string, StepValue][] = [];\n        for (const arg of args) {\n            if (arg.key === overEntry!.key) {\n                if (arg.value?.type !== \"variable\" || arg.value.value !== name) return undefined;\n                continue;\n            }\n            const value = arg.value === undefined ? undefined : readStepValue(arg.value);\n            if (value === undefined) return undefined;\n            if (value.type !== \"null\") fixed.push([arg.key, value]);\n        }\n        return variant(\"tabulate\", {\n            id: freshId(\"step\"), over: overEntry!.key,\n            from: variant(\"number\", from.value), to: variant(\"number\", to.value), step: variant(\"number\", by.value),\n            fixed: new SortedMap(fixed, compareFor(StringType)), as: resultEntry!.key,\n        });\n    }\n    return undefined;\n}\n\n/**\n * Parses a jq program into steps.\n *\n * @param program - the program's text, or what east's `parseJq` made of it\n * @param root - the root's type: a struct of the data sources\n * @returns the query as steps, with where each was read from in the text; or\n *   the problem that keeps it from being steps\n *\n * @remarks\n * The program starts with the `.ds as $ds` binds of its Look ups, then reads\n * a data source; every canonical form after it becomes its step, and a\n * segment no form takes is a jq step, as is every segment after it. Ids are\n * fresh on every parse. A program that does not parse, or does not start\n * from a data source, is not steps.\n */\nexport function parseSteps(program: string | ParsedJq, root: EastType): { query: StepQuery; spans: readonly StepSpan[] } | { error: StepParseError } {\n    const parsed = typeof program === \"string\" ? parseJq(program) : program;\n    const text = parsed.text;\n    if (parsed.program.type === \"none\") return { error: parsed.diagnostics[0]! };\n    const span = (path: string): { from: number; to: number } => parsed.spans.get(path)!;\n\n    // The prologue: `.ds as $ds` for each dataset a Look up reads.\n    let node = parsed.program.value;\n    let path = \"\";\n    const binds: { name: string; from: number; to: number; text: string }[] = [];\n    while (node.type === \"bind\" && node.value.patterns.length === 1 && node.value.patterns[0]!.type === \"variable\") {\n        const source = readPath(node.value.source);\n        const name = node.value.patterns[0]!.value;\n        const at0 = span(at(path, \"bind.source\"));\n        if (source?.length !== 1 || source[0] !== name) {\n            return { error: problem(text, \"unsupported\", \"unsupported: the visual editor binds a dataset only as itself, like .customers as $customers.\", at0.from, span(at(path, \"bind.patterns[0]\")).to) };\n        }\n        binds.push({ name, from: at0.from, to: span(at(path, \"bind.patterns[0]\")).to, text: `${text.slice(at0.from, at0.to)} as $${name}` });\n        path = at(path, \"bind.body\");\n        node = node.value.body;\n    }\n\n    // The pipeline's segments; a bind among them takes the rest.\n    const segments: Segment[] = [];\n    for (;;) {\n        if (node.type === \"pipe\") {\n            const left = at(path, \"pipe.left\");\n            segments.push({ node: node.value.left, path: left, ...span(left) });\n            path = at(path, \"pipe.right\");\n            node = node.value.right;\n            continue;\n        }\n        segments.push({ node, path, ...span(path) });\n        break;\n    }\n\n    const first = segments[0]!;\n    const sourceNames = readPath(first.node);\n    if (sourceNames?.length !== 1) {\n        return { error: problem(text, \"unsupported\", \"unsupported: the visual editor starts from a dataset, like .orders.\", first.from, first.to) };\n    }\n    const source = sourceNames[0]!;\n    const sliceOf = (s: Segment): string => text.slice(s.from, s.to);\n\n    // Shapes come from the checker, a prefix at a time, as printing finds them.\n    let working: string[] = [...binds.map(b => b.text), sliceOf(first)];\n    const offsetOf = (list: readonly string[]): number => list.reduce((n, s) => n + s.length + SEP.length, 0);\n    const sourceCheck = checkJq(parseJq(working.join(SEP)), root, { root: true });\n    const sourceStage = stageAt(sourceCheck, offsetOf(working.slice(0, -1)));\n    if (sourceStage === undefined) {\n        const problemAt = sourceCheck.diagnostics.find(d => d.severity.type === \"error\");\n        if (problemAt !== undefined) {\n            // The checker's words, and its fixes, at the source's place in the program.\n            const shift = BigInt(first.from - offsetOf(working.slice(0, -1)));\n            const s = problemAt.span.type === \"some\" ? problemAt.span.value : undefined;\n            return {\n                error: {\n                    ...problemAt,\n                    span: s === undefined ? none : some(toQuerySpan(text, Number(s.offset + shift), Number(s.offset + s.length + shift))),\n                    fixes: problemAt.fixes.map(f => ({ label: f.label, edits: f.edits.map(e => ({ ...e, offset: e.offset + shift })) })),\n                },\n            };\n        }\n    }\n    let shape: Shape = sourceStage === undefined ? { ...UNKNOWN, noun: singular(source) } : shapeOf(sourceStage.type, sourceStage.multiplicity, { noun: singular(source) });\n\n    const bound = new Set(binds.map(b => b.name));\n    const steps: Step[] = [];\n    const spans: StepSpan[] = [];\n    let jqFrom: number | undefined;\n    for (let i = 1; i < segments.length;) {\n        const seg = segments[i]!;\n        const next = segments[i + 1];\n        const found = jqFrom === undefined ? recognise(seg.node, next?.node, shape, bound) : undefined;\n        if (found === undefined) {\n            jqFrom ??= i;\n            const step: Step = variant(\"jq\", { id: freshId(\"step\"), text: sliceOf(seg) });\n            steps.push(step);\n            spans.push({ stepId: step.value.id, from: seg.from, to: seg.to });\n            i += 1;\n            continue;\n        }\n        spans.push({ stepId: found.step.value.id, from: seg.from, to: segments[i + found.used - 1]!.to });\n        const taken = segments.slice(i, i + found.used).map(sliceOf);\n        const tentative = [...working, ...taken];\n        const check = checkJq(parseJq(tentative.join(SEP)), root, { root: true });\n        const stage = stageAt(check, offsetOf(tentative.slice(0, -1)));\n        if (stage !== undefined && !check.diagnostics.some(d => d.severity.type === \"error\")) {\n            shape = shapeOf(stage.type, stage.multiplicity, knownAfter(found.step, shape));\n            working = tentative;\n        }\n        steps.push(found.step);\n        i += found.used;\n    }\n\n    // A dataset bound but read by no Look up would be lost when the steps print again.\n    const looked = new Set(steps.flatMap(s => s.type === \"lookup\" && s.value.dataset.type === \"some\" ? [s.value.dataset.value] : []));\n    const unused = binds.find(b => !looked.has(b.name));\n    if (unused !== undefined) {\n        return { error: problem(text, \"unsupported\", `unsupported: $${unused.name} is bound but no Look up reads it, so the visual editor cannot keep it.`, unused.from, unused.to) };\n    }\n    return { query: { source, steps }, spans };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The query builder's East, compiled for its renderers (#935) — what a save\n * writes, what refused a write under a new name, and whether a saved query's\n * data sources are bound here are computed by the functions `@elaraai/e3-ui`\n * declares, compiled once, on first use; nothing here restates them.\n *\n * @packageDocumentation\n */\n\nimport { East, type TypeOf, type ValueTypeOf } from \"@elaraai/east\";\nimport { Query } from \"@elaraai/e3-ui/internal\";\n\n/** The JavaScript function an East function compiles to. */\ntype Compiled<F> = ValueTypeOf<TypeOf<F>>;\n\n/** The query builder's compiled East — see the module docs. */\nexport interface QueryEast {\n    /** The patch a save commits: the entries it writes, by name. */\n    save: Compiled<typeof Query.save>;\n    /** What refused a write under a new name, or `none` when it committed. */\n    nameWriteRefusal: Compiled<typeof Query.nameWriteRefusal>;\n    /** Whether a saved query's data sources are bound here, and if not, why not. */\n    rootBound: Compiled<typeof Query.rootBound>;\n}\n\n/** Compiles every function the renderers call. */\nfunction compileQuery(): QueryEast {\n    return {\n        save: East.compile(Query.save, []),\n        nameWriteRefusal: East.compile(Query.nameWriteRefusal, []),\n        rootBound: East.compile(Query.rootBound, []),\n    };\n}\n\nlet compiled: QueryEast | undefined;\n\n/**\n * The query builder's East, compiled on first use.\n *\n * @returns The compiled functions\n */\nexport function queryEast(): QueryEast {\n    compiled ??= compileQuery();\n    return compiled;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Who a record's commit names, as a person reads it — what a builder says\n * after \"saved … by\": the person who made it, and no one for the platform's\n * own writers or a write that named no one.\n *\n * @packageDocumentation\n */\nimport { StringType, equalFor } from \"@elaraai/east\";\n\nconst textEqual = equalFor(StringType);\n\n/**\n * The person a commit's actor names: a signed-in person (`auth:` and their\n * email), a command line's user (`cli:` and their name), or a name a client\n * gave with no kind before it; `undefined` for the platform's own writers —\n * the deploy's (`system:deploy`), a feed's (`files:sync`) — and for a write\n * that named no one (`api`).\n *\n * @param actor - The commit's actor\n * @returns The person, or `undefined` where it names no one\n */\nexport function authorOf(actor: string): string | undefined {\n    const colon = actor.indexOf(\":\");\n    if (colon < 0) return actor.trim().length === 0 || textEqual(actor, \"api\") ? undefined : actor;\n    const name = actor.slice(colon + 1).trim();\n    const kind = actor.slice(0, colon);\n    return name.length > 0 && (textEqual(kind, \"auth\") || textEqual(kind, \"cli\")) ? name : undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A query's editing session (#935) — the open query as the shared editing\n * session (#879) holds it, one session per open query, as Studio's is one per\n * open page.\n *\n * - **Entries.** A query is its header — its name, its description, the data\n *   source it starts from, and its jq when it is not steps — and its steps, in\n *   order, each drafted whole (`DraftField(QueryEntry)`), as Studio drafts a\n *   placement. The header's id is `$query`; a step's is its own.\n * - **The snapshot** is the saved query's header and its steps, or a new\n *   query's header alone. A saved query's steps are parsed once per saved\n *   entry and kept, because a parse gives fresh ids: the same entry must give\n *   the same snapshot, render after render.\n * - **Apply** applies the batch to the snapshot, prints the steps as canonical\n *   jq, checks and prepares the program over the root, and commits the query\n *   as one patch through the record's patch write. The entries it applied\n *   become the snapshot of the query it saved, so the session acknowledges its\n *   own request when the record reads back as it wrote it.\n * - **Readiness** is the check's: a problem is an `invalid` issue, an\n *   unfinished slot an `incomplete` one, so Apply waits for both.\n *\n * @packageDocumentation\n */\n\nimport {\n    ArrayType, East, OptionType, SortedMap, StringType, StructType, VariantType, checkJq, compareFor, decodeBeast2For, encodeBeast2For,\n    equalFor, none, printJq, some, toEastTypeValue, variant,\n    type EastType, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport { Editing, EditingDraftFieldType } from \"@elaraai/east-ui/internal\";\nimport { QueryStepType, SavedQueriesType, SavedQueryType, type QueriesHandleType } from \"@elaraai/e3-ui/internal\";\nimport { pathToString } from \"@elaraai/e3-types\";\nimport type { BatchReadiness, EditIssue, EditSession, EntryVersion, Origin, Placement } from \"@elaraai/east-ui-components\";\nimport type { UIStoreInterface } from \"@elaraai/east-ui-components\";\nimport { checkSteps, type CheckedSteps } from \"./steps/check.js\";\nimport { parseSteps } from \"./steps/parse.js\";\nimport { printSteps } from \"./steps/print.js\";\nimport type { Step, StepQuery } from \"./steps/values.js\";\nimport type { SavedOffer } from \"./model/slots.js\";\nimport { problemWords, type QueryWords } from \"./model/words.js\";\nimport { prepareQuery, type QueryRoot } from \"./one-shot.js\";\nimport type { QueryOpen } from \"./open-query.js\";\nimport { queryEast } from \"./query-east.js\";\nimport { authorOf } from \"../shared/records/author.js\";\n\n// ============================================================================\n// Entries\n// ============================================================================\n\n/** The header entry's id. */\nexport const QUERY_HEADER_ID = \"$query\";\n\n/**\n * A query's header, as its editing session drafts it.\n *\n * @property id - Always {@link QUERY_HEADER_ID}\n * @property name - Its name: its key in the saved queries, once saved\n * @property description - Its description; `none` shows the generated sentence\n * @property source - The data source its steps start from\n * @property jq - The program as jq, when it is not steps — a program that\n *   does not start from a data source; its steps are then empty\n */\nexport const QueryHeaderType = StructType({\n    id: StringType,\n    name: StringType,\n    description: OptionType(StringType),\n    source: StringType,\n    jq: OptionType(StringType),\n});\n\n/** A query's header. */\nexport type QueryHeader = ValueTypeOf<typeof QueryHeaderType>;\n\n/**\n * One entry of a query's editing session.\n *\n * @property header - Its header\n * @property step - One of its steps\n */\nexport const QueryEntryType = VariantType({\n    header: QueryHeaderType,\n    step: QueryStepType,\n});\n\n/** One entry of a query's editing session. */\nexport type QueryEntry = ValueTypeOf<typeof QueryEntryType>;\n\n/** A query's entries: its header, then its steps. */\nconst QueryEntriesType = ArrayType(QueryEntryType);\n\n/** The session's entry schema, as its wire names it. */\nexport const QUERY_ENTRY_TYPE = toEastTypeValue(QueryEntryType);\n/** The session's draft schema: each entry drafted whole. */\nexport const QUERY_DRAFT_TYPE = toEastTypeValue(EditingDraftFieldType(QueryEntryType));\n\nconst encodeEntries = encodeBeast2For(QueryEntriesType);\nconst encodeEntry = encodeBeast2For(QueryEntryType);\nconst decodeBatch = decodeBeast2For(Editing.Types.ChangeSet(QueryEntryType));\nconst savedEqual = equalFor(SavedQueryType);\nconst headerEqual = equalFor(QueryHeaderType);\nconst stepEqual = equalFor(QueryStepType);\nconst stringCompare = compareFor(StringType);\n\n/** The batch Apply hands the session's `onApply`. */\ntype Batch = ValueTypeOf<ReturnType<typeof Editing.Types.ChangeSet<typeof QueryEntryType>>>;\n/** The session's answer to a batch. */\ntype ApplyResult = ValueTypeOf<typeof Editing.Types.ApplyResult>;\n/** A saved query. */\nexport type SavedQuery = ValueTypeOf<typeof SavedQueryType>;\n/** The saved queries record. */\nexport type SavedQueries = ValueTypeOf<typeof SavedQueriesType>;\n/** The bound saved queries record. */\nexport type QueriesHandle = ValueTypeOf<typeof QueriesHandleType>;\n\n/**\n * The id an entry has in the session.\n *\n * @param entry - The entry\n * @returns Its id: `$query` for the header, a step's own\n */\nexport function entryId(entry: QueryEntry): string {\n    return entry.type === \"header\" ? entry.value.id : entry.value.value.id;\n}\n\n/**\n * A query as entries: its header, then its steps.\n *\n * @param header - Its header\n * @param steps - Its steps, in order\n * @returns The entries\n */\nexport function queryEntries(header: QueryHeader, steps: readonly Step[]): QueryEntry[] {\n    return [variant(\"header\", header), ...steps.map((step): QueryEntry => variant(\"step\", step))];\n}\n\n/**\n * The query a session's entries make.\n *\n * @param entries - The entries\n * @returns The header, and the steps as a query on its data source\n * @throws {Error} When the entries hold no header\n */\nexport function entriesQuery(entries: readonly QueryEntry[]): { header: QueryHeader; query: StepQuery } {\n    let header: QueryHeader | undefined;\n    const steps: Step[] = [];\n    for (const entry of entries) {\n        if (entry.type === \"header\") header = entry.value;\n        else steps.push(entry.value);\n    }\n    if (header === undefined) throw new Error(\"A query's entries hold its header\");\n    return { header, query: { source: header.source, steps } };\n}\n\n/**\n * The program a query's entries make: its jq when it is not steps, else its\n * steps printed as canonical jq.\n *\n * @param header - Its header\n * @param query - Its steps\n * @param root - The root's type\n * @returns The program's text\n */\nexport function queryProgram(header: QueryHeader, query: StepQuery, root: EastType): string {\n    return header.jq.type === \"some\" ? header.jq.value : printSteps(query, root).text;\n}\n\n// ============================================================================\n// The snapshot a session begins from\n// ============================================================================\n\n/**\n * What a query's session begins from: the saved entry, and its entries.\n *\n * @property saved - The saved query the entries are of; `undefined` for a query never saved\n * @property entries - The header and the steps\n */\nexport interface QueryBase {\n    readonly saved: SavedQuery | undefined;\n    readonly entries: readonly QueryEntry[];\n}\n\n/** Each session's base, by its source id, per UI store: the snapshot it was given last. */\nconst bases = new WeakMap<UIStoreInterface, Map<string, QueryBase>>();\n\n/** Each session's committed save, by its source id, per UI store, until the record reads it back. */\nconst saves = new WeakMap<UIStoreInterface, Map<string, QueryBase>>();\n\n/** One UI store's map of the two. */\nfunction mapOf(maps: WeakMap<UIStoreInterface, Map<string, QueryBase>>, store: UIStoreInterface): Map<string, QueryBase> {\n    let map = maps.get(store);\n    if (map === undefined) {\n        map = new Map();\n        maps.set(store, map);\n    }\n    return map;\n}\n\n/**\n * A saved query's entries: its header, and its steps parsed from its\n * program — or, for a program that is not steps, its jq.\n *\n * @param saved - The saved query\n * @param root - The root's type\n * @returns The entries; the steps' ids are fresh\n */\nexport function savedEntries(saved: SavedQuery, root: EastType): QueryEntry[] {\n    const text = printJq(saved.program, { layout: \"pipeline\" }).text;\n    const parsed = parseSteps(text, root);\n    if (\"error\" in parsed) {\n        return queryEntries({ id: QUERY_HEADER_ID, name: saved.name, description: saved.description, source: \"\", jq: some(text) }, []);\n    }\n    return queryEntries({ id: QUERY_HEADER_ID, name: saved.name, description: saved.description, source: parsed.query.source, jq: none }, parsed.query.steps);\n}\n\n/**\n * The base the open query's session begins from: a save it committed; else\n * the base it was given last, while the record still holds the entry it is\n * of; else the saved query's entries, parsed once; else a new query's header\n * alone — or, for a new query begun as a run never saved, the run's entries,\n * its name and description with them.\n *\n * @remarks\n * A save the session committed is its base from the moment it commits, while\n * the record has not read it back yet — the session acknowledges its own\n * request by it, whichever comes first, its answer or the record's re-read —\n * and its base for good once the record holds it. A record that holds another\n * entry under its name has moved on since: the record's entry is the base\n * again.\n *\n * @param store - The UI store the sessions live in\n * @param sourceId - The open query's session's source id\n * @param open - The open query\n * @param record - The saved queries\n * @param root - The root's type\n * @param untitled - A new query's name on a data source\n * @returns The base, or `undefined` when the open saved query is not in the record\n */\nexport function queryBase(\n    store: UIStoreInterface, sourceId: string, open: QueryOpen, record: SavedQueries, root: EastType, untitled: (source: string) => string,\n): QueryBase | undefined {\n    const known = mapOf(bases, store);\n    const saving = mapOf(saves, store);\n    const save = saving.get(sourceId);\n    if (save?.saved !== undefined) {\n        const now = record.get(save.saved.name);\n        if (now !== undefined && savedEqual(now, save.saved)) {\n            known.set(sourceId, save);\n            saving.delete(sourceId);\n            return save;\n        }\n        // Not read back yet: the record holds nothing under its name, or the entry the edit began from.\n        const began = known.get(sourceId)?.saved;\n        if (now === undefined || (began !== undefined && savedEqual(now, began))) return save;\n        saving.delete(sourceId);\n    }\n    const last = known.get(sourceId);\n    // The base it was given last, while the record holds its entry as it was —\n    // after a save, under the name it saved, which a rename moves.\n    if (last?.saved !== undefined) {\n        const now = record.get(last.saved.name);\n        if (now !== undefined && savedEqual(now, last.saved)) return last;\n    }\n    if (open.type === \"new\") {\n        if (last !== undefined && last.saved === undefined) return last;\n        const from = open.value.from;\n        const base: QueryBase = {\n            saved: undefined,\n            entries: from.type === \"some\"\n                ? savedEntries(from.value, root)\n                : queryEntries({ id: QUERY_HEADER_ID, name: untitled(open.value.source), description: none, source: open.value.source, jq: none }, []),\n        };\n        known.set(sourceId, base);\n        return base;\n    }\n    const saved = record.get(open.value);\n    if (saved === undefined) return undefined;\n    const base: QueryBase = { saved, entries: savedEntries(saved, root) };\n    known.set(sourceId, base);\n    return base;\n}\n\n/**\n * Remembers a save a session's Apply committed, as the base it continues\n * from: the saved entry it wrote, and the entries it applied — for the session\n * that applied them, and for the saved query's own, which a new query and a\n * rename open next ({@link queryBase}).\n *\n * @param store - The UI store the sessions live in\n * @param sourceIds - The source ids to remember it under\n * @param base - The saved entry and the entries\n */\nexport function rememberSave(store: UIStoreInterface, sourceIds: readonly string[], base: QueryBase): void {\n    const saving = mapOf(saves, store);\n    for (const id of sourceIds) saving.set(id, base);\n}\n\n/**\n * The snapshot a base is, as the session's wire carries it.\n *\n * @param base - The base\n * @returns Its entries, encoded\n */\nexport function encodeBase(base: QueryBase): Uint8Array {\n    return encodeEntries([...base.entries]);\n}\n\n/**\n * One entry of a base, by id, as the session's wire carries it.\n *\n * @param base - The base\n * @param id - The entry's id\n * @returns The entry, encoded, or `none` when the base has no entry of that id\n */\nexport function readBaseEntry(base: QueryBase, id: string): option<Uint8Array> {\n    const entry = base.entries.find(e => stringCompare(entryId(e), id) === 0);\n    return entry === undefined ? none : some(encodeEntry(entry));\n}\n\n/**\n * The saved queries a builder offers to start from, as the add-step list of a\n * query with no steps offers them (#934): each whose data sources are all\n * bound here, by the same name and at the same path (`QueryInternal.rootBound`),\n * with the data source its steps start from.\n *\n * @param record - The saved queries\n * @param root - The root the builder's data sources make\n * @returns The offers, in name order\n */\nexport function savedOffers(record: SavedQueries, root: QueryRoot): SavedOffer[] {\n    const east = queryEast();\n    const bound = root.entries.map(e => ({ name: e.name, path: e.path }));\n    const offers: SavedOffer[] = [];\n    for (const saved of record.values()) {\n        if (east.rootBound(saved, bound).type !== \"bound\") continue;\n        const { header } = entriesQuery(savedEntries(saved, root.type));\n        if (header.jq.type === \"some\") continue;\n        offers.push({ name: saved.name, source: header.source });\n    }\n    return offers;\n}\n\n/**\n * Why a saved query — or a recent run — can't open here, in the builder's\n * words (`Query Editor Spec.md` §4.10): a data source it reads that no binding\n * here has the name of, or one bound here at another path\n * (`QueryInternal.rootBound`).\n *\n * @param saved - The saved query, or the run\n * @param root - The root the builder's data sources make\n * @param words - The words\n * @returns The reason — \"Reads customers, which isn't here\", \"Reads\n *   .inputs.archive.orders, not this builder's orders\" — or `undefined` when\n *   it can open\n */\nexport function rootRefusal(saved: SavedQuery, root: QueryRoot, words: QueryWords): string | undefined {\n    const m = words.messages;\n    const reason = queryEast().rootBound(saved, root.entries.map(e => ({ name: e.name, path: e.path })));\n    switch (reason.type) {\n        case \"bound\": return undefined;\n        case \"missing\": return m.rootMissing({ name: reason.value });\n        case \"elsewhere\": return m.rootElsewhere({ path: pathToString(reason.value.path), name: reason.value.name });\n    }\n}\n\n// ============================================================================\n// Readiness: the check's problems as the session's issues\n// ============================================================================\n\n/**\n * The query's problems as the session's readiness: each error an `invalid`\n * issue, each unfinished slot an `incomplete` one, in plain words, on the step\n * and the slot they are about.\n *\n * @param header - The query's header\n * @param query - Its steps\n * @param root - The root, or a reason it cannot be queried\n * @param words - The words\n * @returns The readiness, and the check it was made from\n */\nexport function queryReadiness(\n    header: QueryHeader, query: StepQuery, root: QueryRoot | string, words: QueryWords,\n): { readiness: BatchReadiness; checked: CheckedSteps | undefined } {\n    const issue = (entry: string, message: string, slot?: string): EditIssue =>\n        ({ entry, row: none, field: slot === undefined ? none : some(slot), message });\n    if (typeof root === \"string\") return { readiness: variant(\"invalid\", [issue(QUERY_HEADER_ID, root)]), checked: undefined };\n    if (header.jq.type === \"some\") {\n        const errors = checkJq(header.jq.value, root.type, { root: true }).diagnostics.filter(d => d.severity.type === \"error\");\n        return {\n            readiness: errors.length === 0 ? variant(\"ready\", null) : variant(\"invalid\", errors.map(d => issue(QUERY_HEADER_ID, d.message))),\n            checked: undefined,\n        };\n    }\n    const checked = checkSteps(query, root.type);\n    const issues: EditIssue[] = [];\n    let invalid = false;\n    for (const d of checked.diagnostics) {\n        const unfinished = d.code === \"incomplete\";\n        if (!unfinished && d.severity !== \"error\") continue;\n        invalid ||= !unfinished;\n        issues.push(issue(d.stepId === \"\" ? QUERY_HEADER_ID : d.stepId, problemWords(d, query, root.type, checked, words).text, d.slot));\n    }\n    return { readiness: issues.length === 0 ? variant(\"ready\", null) : variant(invalid ? \"invalid\" : \"incomplete\", issues), checked };\n}\n\n// ============================================================================\n// Apply: the batch as one patch commit\n// ============================================================================\n\n/** What a query's Apply needs. */\nexport interface QueryApplyContext {\n    /** The saved queries record, bound with its patch. */\n    readonly handle: QueriesHandle;\n    /** The open query. */\n    readonly open: QueryOpen;\n    /** The base its session began from. */\n    readonly base: QueryBase;\n    /** The root. */\n    readonly root: QueryRoot;\n    /** The UI store the sessions live in. */\n    readonly store: UIStoreInterface;\n    /** The session's own source id. */\n    readonly sourceId: string;\n    /** The source id a query of a name has. */\n    readonly sourceIdOf: (name: string) => string;\n    /** What a refused write says, in the builder's words. */\n    readonly refused: (outcome: \"changed\" | \"renamed\", name: string, by: string | undefined) => string;\n    /** Told the name a commit saved the query under, once its save is remembered: the base is the save's from then on. */\n    readonly onSaved: (name: string) => void;\n    /** The clock a save is stamped with. */\n    readonly now?: () => Date;\n}\n\nconst applyEntries = Editing.apply(QueryEntryType, \"id\");\n\n/**\n * A query's `onApply`: the batch applied to the base, the program printed,\n * checked and prepared over the root, and the query committed as one patch.\n *\n * @param ctx - The record, the open query, its base and root, and the words\n * @returns The session's async apply, over the batch's bytes\n */\nexport function queryApply(ctx: QueryApplyContext): (bytes: Uint8Array) => Promise<ApplyResult> {\n    const apply = compiledApply();\n    const east = queryEast();\n    return async (bytes) => {\n        const batch: Batch = decodeBatch(bytes);\n        const base = batch.base.type === \"snapshot\" ? batch.base.value : [...ctx.base.entries];\n        const applied = apply(base, batch, none);\n        if (applied.type === \"conflict\") return variant(\"conflict\", applied.value);\n        const { header, query } = entriesQuery(applied.value);\n        const program = queryProgram(header, query, ctx.root.type);\n        const prepared = prepareQuery(program, ctx.root);\n        if (\"result\" in prepared) {\n            const outcome = prepared.result.outcome;\n            const messages = outcome.type === \"error\" ? outcome.value.map(e => e.message) : [outcome.type];\n            return variant(\"rejected\", messages.map(message => ({ entry: QUERY_HEADER_ID, row: none, field: none, message })));\n        }\n        const reads = new Set(prepared.prepared.checked.reads);\n        const next: SavedQuery = {\n            name: header.name,\n            description: header.description,\n            program: prepared.prepared.checked.program,\n            root: ctx.root.entries.filter(e => reads.has(e.name)).map(e => ({ name: e.name, path: e.path })),\n            saved_at: (ctx.now ?? (() => new Date()))(),\n        };\n        // The record as the edit began: the open query's entry as its session's base holds it.\n        const began: SavedQueries = new SortedMap(ctx.base.saved === undefined ? [] : [[ctx.base.saved.name, ctx.base.saved]], stringCompare);\n        const open = ctx.base.saved === undefined ? none : some(ctx.base.saved.name);\n        const patch = east.save(began, open, next);\n        const outcome = await ctx.handle.commit.patch(batch.requestId, patch);\n        switch (outcome.type) {\n            case \"committed\": {\n                rememberSave(ctx.store, [ctx.sourceId, ctx.sourceIdOf(next.name)], { saved: next, entries: applied.value });\n                ctx.onSaved(next.name);\n                return variant(\"applied\", { revision: some(outcome.value.stateHash) });\n            }\n            case \"conflict\": {\n                const renamed = open.type === \"none\" || stringCompare(open.value, next.name) !== 0;\n                const by = latestActor(ctx.handle);\n                return variant(\"conflict\", [{ entry: QUERY_HEADER_ID, row: none, field: none, message: ctx.refused(renamed ? \"renamed\" : \"changed\", next.name, by) }]);\n            }\n            case \"transport\":\n                // It may have committed: the session keeps the request, and its\n                // retry sends the same id, which resolves to that commit.\n                throw new Error(outcome.value.message);\n            default: {\n                const refusal = east.nameWriteRefusal(outcome, next.name);\n                return variant(\"rejected\", [{ entry: QUERY_HEADER_ID, row: none, field: none, message: refusal.type === \"some\" ? refusal.value : outcome.type }]);\n            }\n        }\n    };\n}\n\n/** `Editing.apply` over a query's entries, as it compiles. */\ntype ApplyEntries = (base: QueryEntry[], batch: Batch, revision: option<string>) => ValueTypeOf<ReturnType<typeof Editing.Types.Applied<typeof QueryEntryType>>>;\n\nlet compiledEntries: ApplyEntries | undefined;\n\n/** `Editing.apply` over a query's entries, compiled on first use. */\nfunction compiledApply(): ApplyEntries {\n    compiledEntries ??= East.compile(applyEntries, []) as unknown as ApplyEntries;\n    return compiledEntries;\n}\n\n/** The person who changed the record last, when its history is in and its last commit names one. */\nfunction latestActor(handle: QueriesHandle): string | undefined {\n    const history = handle.history();\n    if (history.type !== \"some\") return undefined;\n    const head = history.value[0];\n    return head === undefined ? undefined : authorOf(head.actor);\n}\n\n// ============================================================================\n// Gestures: one transaction per gesture\n// ============================================================================\n\n/** An entry's placement among the drafted entries: before its next, else after its previous. */\nfunction placementIn(entries: readonly QueryEntry[], index: number): Placement {\n    const next = entries[index + 1];\n    const previous = entries[index - 1];\n    if (next !== undefined) return some(variant(\"ordered\", variant(\"before\", entryId(next))));\n    if (previous !== undefined) return some(variant(\"ordered\", variant(\"after\", entryId(previous))));\n    return some(variant(\"ordered\", variant(\"start\", null)));\n}\n\n/**\n * The entries a gesture moved: those outside the longest run of entries that\n * kept their order, so a move places the entry moved, not its neighbours.\n */\nfunction movedIn(before: readonly string[], after: readonly string[]): Set<string> {\n    const common = after.filter(id => before.includes(id));\n    const at = common.map(id => before.indexOf(id));\n    const length = at.map(() => 1);\n    const previous = at.map(() => -1);\n    for (let i = 0; i < at.length; i++) {\n        for (let j = 0; j < i; j++) {\n            if (at[j]! < at[i]! && length[j]! + 1 > length[i]!) {\n                length[i] = length[j]! + 1;\n                previous[i] = j;\n            }\n        }\n    }\n    let best = -1;\n    for (let i = 0; i < at.length; i++) if (best < 0 || length[i]! > length[best]!) best = i;\n    const kept = new Set<string>();\n    for (let i = best; i >= 0; i = previous[i]!) kept.add(common[i]!);\n    return new Set(common.filter(id => !kept.has(id)));\n}\n\n/**\n * Records one gesture: the query as it was and as the gesture leaves it, as\n * one undoable transaction of every entry it changed, added, removed or moved.\n *\n * @param session - The open query's session\n * @param original - An entry's version before any draft of it\n * @param current - The entries as the drafts stand\n * @param next - The entries after the gesture\n * @param origin - The gesture\n * @param label - Its label in the history\n * @returns Whether anything changed\n */\nexport function recordGesture(\n    session: EditSession<QueryEntry>,\n    original: (id: string) => EntryVersion<QueryEntry>,\n    current: readonly QueryEntry[],\n    next: readonly QueryEntry[],\n    origin: Origin,\n    label: string,\n): boolean {\n    const was = new Map(current.map((e, i) => [entryId(e), { entry: e, index: i }]));\n    const now = new Map(next.map((e, i) => [entryId(e), { entry: e, index: i }]));\n    const moved = movedIn(current.map(entryId), next.map(entryId));\n    const versionOf = (id: string): EntryVersion<QueryEntry> => session.entries.get(id) ?? original(id);\n    const updates: { id: string; before: EntryVersion<QueryEntry>; after: EntryVersion<QueryEntry> }[] = [];\n    for (const [id, { entry, index }] of now) {\n        const old = was.get(id);\n        const before = old === undefined ? { draft: undefined, wire: undefined, place: none } : versionOf(id);\n        const placed = old === undefined || moved.has(id);\n        const changed = old === undefined || !sameEntry(old.entry, entry);\n        if (!changed && !placed) continue;\n        updates.push({ id, before, after: { draft: variant(\"value\", entry), wire: entry, place: placed ? placementIn(next, index) : before.place } });\n    }\n    for (const [id] of was) {\n        if (now.has(id)) continue;\n        updates.push({ id, before: versionOf(id), after: { draft: undefined, wire: undefined, place: none } });\n    }\n    return updates.length > 0 && session.record(updates, origin, label);\n}\n\n/** Whether two entries are the same value. */\nfunction sameEntry(a: QueryEntry, b: QueryEntry): boolean {\n    if (a.type === \"header\" && b.type === \"header\") return headerEqual(a.value, b.value);\n    if (a.type === \"step\" && b.type === \"step\") return stepEqual(a.value, b.value);\n    return false;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a saved query is, where it is shown (#939, #1063) — one reading of a\n * saved query, or of a recent run, against the root a surface's data sources\n * make, which the builder's Library tab and the query library share: the data\n * source its steps start from, its description, why it can't open here, its\n * outline, its problems and what it gives. And when it was saved, in words.\n *\n * @packageDocumentation\n */\n\nimport { DateTimeType, checkJq, lessFor } from \"@elaraai/east\";\nimport type { Formatters } from \"@elaraai/east-ui-components\";\nimport { outlineOf, type OutlineLine } from \"./model/cards.js\";\nimport { describeQuery, problemWords, shapeWords, type QueryWords } from \"./model/words.js\";\nimport type { QueryRoot } from \"./one-shot.js\";\nimport { entriesQuery, rootRefusal, savedEntries, type SavedQuery } from \"./session.js\";\nimport { checkSteps } from \"./steps/check.js\";\nimport { shapeOf } from \"./steps/shape.js\";\n\nconst earlier = lessFor(DateTimeType);\n\n/** How long ago a time still reads as its weekday — \"saved Tue\" — before it reads as its date. */\nconst WEEK_MS = 6 * 24 * 60 * 60 * 1000;\n\n/** What a saved query, or a recent run, is here. */\nexport interface QueryAbout {\n    /**\n     * The data source its steps start from; for a program that is not steps,\n     * the first its root reads — else the first bound.\n     */\n    readonly source: string;\n    /** Its description: the author's, else the sentence generated from its steps; `undefined` when there is neither. */\n    readonly description: string | undefined;\n    /** Why it can't open here, in the builder's words; `undefined` when it can. */\n    readonly refusal: string | undefined;\n    /** Its steps: how many, and one outline line per finished step; `undefined` for a program that is not steps. */\n    readonly steps: { readonly count: number; readonly outline: readonly OutlineLine[] } | undefined;\n    /** How many problems it has here: the errors its check finds. */\n    readonly problems: number;\n    /** The first, in plain words; `undefined` when it has none. */\n    readonly problem: string | undefined;\n    /** What it gives, in words — \"Up to 10 shipped orders\"; `undefined` while it has problems. */\n    readonly gives: string | undefined;\n}\n\n/**\n * What a saved query, or a recent run, is against a root: its steps parsed\n * and checked once (`Query Editor Spec.md` §4.10, §5).\n *\n * @param saved - The saved query, or the run\n * @param root - The root the surface's data sources make\n * @param words - The words\n * @returns What it is here\n */\nexport function queryAbout(saved: SavedQuery, root: QueryRoot, words: QueryWords): QueryAbout {\n    const refusal = rootRefusal(saved, root, words);\n    const authored = saved.description.type === \"some\" ? saved.description.value : undefined;\n    const { header, query } = entriesQuery(savedEntries(saved, root.type));\n    if (header.jq.type === \"some\") {\n        const checked = checkJq(header.jq.value, root.type, { root: true });\n        const errors = checked.diagnostics.filter((d) => d.severity.type === \"error\");\n        const shape = checked.elementType === null ? undefined : shapeOf(checked.elementType, checked.multiplicity, { noun: \"row\" });\n        return {\n            source: saved.root[0]?.name ?? root.entries[0]?.name ?? \"\",\n            description: authored,\n            refusal,\n            steps: undefined,\n            problems: errors.length,\n            problem: errors[0]?.message,\n            gives: errors.length > 0 || shape === undefined ? undefined : shapeWords(shape, words),\n        };\n    }\n    const checked = checkSteps(query, root.type);\n    const errors = checked.diagnostics.filter((d) => d.severity === \"error\");\n    const generated = authored === undefined ? describeQuery(query, checked, words) : \"\";\n    const first = errors[0];\n    return {\n        source: query.source,\n        description: authored ?? (generated === \"\" ? undefined : generated),\n        refusal,\n        steps: { count: query.steps.length, outline: outlineOf(query, checked, words) },\n        problems: errors.length,\n        problem: first === undefined ? undefined : problemWords(first, query, root.type, checked, words).text,\n        gives: errors.length > 0 || checked.final.kind === \"unknown\" ? undefined : shapeWords(checked.final, words),\n    };\n}\n\n/**\n * When a query was saved, or a run ran, in a card's words — \"14:02\" today,\n * \"Tue\" within the last six days, \"Sep 12\" this year, else \"Sep 12, 2025\" —\n * in the viewer's locale and time zone.\n *\n * @param at - When\n * @param now - The moment it is read at\n * @param formatters - The locale's formatters\n * @returns The words\n */\nexport function whenWords(at: Date, now: Date, formatters: Formatters): string {\n    if (formatters.date(at) === formatters.date(now)) return formatters.time(at);\n    if (earlier(new Date(now.getTime() - WEEK_MS), at)) return formatters.weekday(at);\n    return formatters.year(at) === formatters.year(now) ? formatters.monthDay(at) : formatters.date(at);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The pane's Library tab (#939, `Query Editor Spec.md` §4.10) — this viewer's\n * recent runs and the saved queries, as a `Library`, as Studio's Pages tab is\n * one of the project's pages:\n *\n * - **groups**: Recent, the most recent first; then the saved queries by the\n *   data source they start from — \"From orders\" — each by name;\n * - **an item**: its name, and under it its description — the author's, else\n *   the sentence generated from its steps; the open query is placed;\n * - **a click** opens it: a saved query as itself; a recent run as the saved\n *   query of its name when there is one, else as a new query begun as the run;\n * - **a query whose data sources aren't bound here**, by name and by path,\n *   carries its reason, trailing, in the warning tone, and a click on it says\n *   so in a notice at the top of the tab instead of opening;\n * - the `Library`'s own search, over names and descriptions.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useMemo, useState } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { StringType, equalFor, none, some, variant } from \"@elaraai/east\";\nimport { SavedQueryType } from \"@elaraai/e3-ui/internal\";\nimport { BannerView, EastChakraLibrary, type LibraryItemValue, type LibraryValue } from \"@elaraai/east-ui-components\";\nimport { queryAbout, type QueryAbout } from \"./about.js\";\nimport type { QueryRoot } from \"./one-shot.js\";\nimport type { QueryOpen } from \"./open-query.js\";\nimport type { PartStyles } from \"./parts.js\";\nimport type { SavedQueries, SavedQuery } from \"./session.js\";\n\nconst nameEqual = equalFor(StringType);\nconst runEqual = equalFor(SavedQueryType);\n\n/** Props of {@link LibraryTab}. */\n/** What a card takes of a phone's width beside its description: the list's 16 each side, the card's 12 each side and its rule, the tile and its gap, the trailing glyph at Font Awesome's fixed width and its gap. */\nconst PHONE_CARD_INSET = 32 + 24 + 2 + 36 + 12 + 17.5 + 12;\n\nlet measuring: CanvasRenderingContext2D | null | undefined;\n\n/**\n * A description as two lines at most, ending on a whole word and `…` (QP36): what\n * a line clamp cannot do, which cuts where the room ends.\n *\n * @param text - The description\n * @param width - The room each line has, px\n * @returns The text to show\n */\nfunction twoLines(text: string, width: number): string {\n    if (measuring === undefined) measuring = document.createElement(\"canvas\").getContext(\"2d\");\n    if (measuring === null) return text;\n    const probe = document.createElement(\"span\");\n    probe.style.fontFamily = \"var(--chakra-fonts-body)\";\n    document.body.appendChild(probe);\n    measuring.font = `400 12.5px ${getComputedStyle(probe).fontFamily}`;\n    probe.remove();\n    const context = measuring;\n    const fits = (line: string) => context.measureText(line).width <= width;\n    const words = text.split(\" \");\n    let line = \"\";\n    let lines = 1;\n    for (let i = 0; i < words.length; i++) {\n        const next = line === \"\" ? words[i]! : `${line} ${words[i]!}`;\n        if (fits(next)) { line = next; continue; }\n        if (lines === 2) {\n            // The room for the ellipsis, in whole words.\n            let last = i;\n            while (last > 0 && !fits(`${words.slice(last - countOnLine(words, last, line), last).join(\" \")}…`)) last -= 1;\n            return `${words.slice(0, last).join(\" \")}…`;\n        }\n        lines = 2;\n        line = words[i]!;\n    }\n    return text;\n}\n\n/** How many of the words before an index stand on the line. */\nfunction countOnLine(words: readonly string[], end: number, line: string): number {\n    let count = 0;\n    let at = line.length;\n    for (let i = end - 1; i >= 0 && at > 0; i--) { at -= words[i]!.length + 1; count += 1; }\n    return count;\n}\n\nexport interface LibraryTabProps {\n    /** The saved queries. */\n    readonly record: SavedQueries;\n    /** This viewer's recent runs, the most recent first. */\n    readonly recent: readonly SavedQuery[];\n    /** The root the builder's data sources make. */\n    readonly root: QueryRoot;\n    /** The open query. */\n    readonly open: QueryOpen;\n    /** Opens a saved query. */\n    readonly onOpenSaved: (name: string) => void;\n    /** Opens a recent run never saved, as a new query begun as it. */\n    readonly onOpenRun: (run: SavedQuery) => void;\n    /** The tab's library's id. */\n    readonly id: string;\n    /** The parts' styles, and the words. */\n    readonly ps: PartStyles;\n    /** Where the library keeps its state. */\n    readonly storageKey: string;\n    /** A phone's builder's width: each description two lines at most, ending on a whole word (QP36). */\n    readonly phoneWidth?: number | undefined;\n}\n\n/**\n * Renders the Library tab — see the module docs.\n *\n * @param props - The saved queries, the recent runs, the root, the open query and what a click does ({@link LibraryTabProps})\n * @returns The tab's notice, and its library\n */\nexport const LibraryTab = memo(function LibraryTab({ record, recent, root, open, onOpenSaved, onOpenRun, id, ps, storageKey, phoneWidth }: LibraryTabProps) {\n    const { styles, words } = ps;\n    const m = words.messages;\n    const phone = useSlotStyles(\"queryPhone\");\n    const [notice, setNotice] = useState<string | undefined>(undefined);\n\n    // What each query is — the data source it starts from, its description, why it can't open here — once per record, run list and root.\n    const about = useCallback((saved: SavedQuery): QueryAbout => queryAbout(saved, root, words), [root, words]);\n\n    const savedList = useMemo(() => [...record.values()].map((saved) => ({ saved, about: about(saved) })), [record, about]);\n    const runList = useMemo(() => recent.map((run) => ({ run, about: about(run) })), [recent, about]);\n\n    const isOpenSaved = useCallback((name: string) => open.type === \"saved\" && nameEqual(open.value, name), [open]);\n    // A run is the same run whenever it ran: running it again remembers it anew, as the recent list does.\n    const isOpenRun = useCallback((run: SavedQuery) => open.type === \"new\" && open.value.from.type === \"some\"\n        && runEqual({ ...open.value.from.value, saved_at: run.saved_at }, run), [open]);\n\n    const onCardClick = useCallback((key: string) => {\n        const [kind, rest] = [key.slice(0, key.indexOf(\":\")), key.slice(key.indexOf(\":\") + 1)];\n        if (kind === \"saved\") {\n            const entry = savedList.find((s) => nameEqual(s.saved.name, rest));\n            if (entry === undefined) return;\n            if (entry.about.refusal !== undefined) setNotice(entry.about.refusal);\n            else onOpenSaved(entry.saved.name);\n            return;\n        }\n        const entry = runList[Number(rest)];\n        if (entry === undefined) return;\n        // A run of a saved query opens the query as it is saved now.\n        const saved = savedList.find((s) => nameEqual(s.saved.name, entry.run.name));\n        const refusal = saved?.about.refusal ?? entry.about.refusal;\n        if (refusal !== undefined) setNotice(refusal);\n        else if (saved !== undefined) onOpenSaved(saved.saved.name);\n        else onOpenRun(entry.run);\n    }, [savedList, runList, onOpenSaved, onOpenRun]);\n\n    const value = useMemo((): LibraryValue => {\n        const item = (key: string, name: string, about: QueryAbout, group: string, icon: string, placed: boolean): LibraryItemValue => ({\n            key,\n            label: name,\n            sublabel: about.description === undefined ? none : some(phoneWidth === undefined ? about.description : twoLines(about.description, phoneWidth - PHONE_CARD_INSET)),\n            icon: some(icon),\n            status: none,\n            trailing: about.refusal === undefined ? none : some({ icon: \"triangle-exclamation\", label: about.refusal, tone: some(variant(\"warning\", null)) }),\n            draggable: false,\n            filtered: false,\n            placed,\n            media: none,\n            avatar: none,\n            byline: none,\n            action: none,\n            search: some(about.description === undefined ? name : `${name} ${about.description}`),\n            groups: new Map([[\"group\", group]]),\n            facets: new Map(),\n            dims: new Map(),\n        });\n        const runs = runList.map(({ run, about }, i) => {\n            const saved = savedList.find((s) => nameEqual(s.saved.name, run.name));\n            return item(`recent:${i}`, run.name, saved?.about ?? about, m.recentGroup(), \"clock-rotate-left\", saved === undefined ? isOpenRun(run) : isOpenSaved(run.name));\n        });\n        // The saved queries by the data source they start from, each by name; the record is in name order.\n        const sources = [...new Set(savedList.map((s) => s.about.source))].sort();\n        const saved = sources.flatMap((source) => savedList.filter((s) => s.about.source === source)\n            .map((s) => item(`saved:${s.saved.name}`, s.saved.name, s.about, m.fromDatasetGroup({ dataset: source }), \"diagram-project\", isOpenSaved(s.saved.name))));\n        return {\n            id,\n            hint: none,\n            items: [...runs, ...saved],\n            groupOptions: [{ key: \"group\", label: m.tab({ tab: \"library\" }) }],\n            groupSummaries: new Map(),\n            dimOptions: [],\n            defaultDimensions: [],\n            filterOptions: [],\n            searchable: true,\n            noun: some({ singular: m.savedNoun({ n: 1 }), plural: m.savedNoun({ n: 2 }) }),\n            addLabel: none,\n            onAdd: none,\n            onCardClick: some((key: string) => { onCardClick(key); return null; }),\n            slice: none,\n            style: some({ height: some(\"fill\"), maxHeight: none, virtualization: some(false), columns: none, mediaPlacement: none, mediaSize: none }),\n            variant: none,\n            layout: none,\n            toolbar: true,\n        };\n    }, [runList, savedList, isOpenRun, isOpenSaved, onCardClick, id, m, phoneWidth]);\n\n    // A search that hides every query, on a phone (QP37): the × glyph, what it looked for, a checklist and the way back.\n    const noMatchView = useCallback((query: string, clear: () => void) => (\n        <Box css={phone.noMatch} data-library-empty=\"\" data-query-no-match=\"\">\n            <Box as=\"span\" css={phone.emptyGlyph} aria-hidden>×</Box>\n            <Box css={phone.emptyTitle}>{m.noMatch({ text: query })}</Box>\n            <Box as=\"ul\" css={phone.emptyList}><li>{m.checkSpelling()}.</li><li>{m.clearSearchEvery()}</li></Box>\n            <chakra.button type=\"button\" css={phone.emptyLink} onClick={clear}>{m.clearTheSearch()} →</chakra.button>\n        </Box>\n    ), [m, phone]);\n    return (\n        <>\n            {notice !== undefined && (\n                <Box css={styles.notices} data-query-library-notice=\"\">\n                    <BannerView status=\"warning\" title={notice} dismissible onDismiss={() => setNotice(undefined)} />\n                </Box>\n            )}\n            <EastChakraLibrary value={value} storageKey={storageKey} noMatchView={phoneWidth === undefined ? undefined : noMatchView} />\n        </>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The query open in a builder (#935) — held in the UI store under the\n * builder's key (`queryKeys(id).query`), where `State.bind` keeps its State,\n * so a builder and a query library with the same `id` open one query together,\n * as Studio's builder and page library open one page. Beside it, under the\n * same key, the notice the query arrived with (#939, #1063) — \"Opened “Big\n * orders” from the query library.\" — which the builder shows when the query\n * opens, whichever surface opened it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport { OptionType, StringType, StructType, VariantType, decodeBeast2For, encodeBeast2For, none, printFor, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { SavedQueryType } from \"@elaraai/e3-ui/internal\";\nimport { StateRuntime } from \"@elaraai/east-ui-components\";\n\n/**\n * The query open in a builder.\n *\n * @property new - A query not yet saved: `id` tells it from every other new\n *   query, so each keeps its own drafts; `source` is the data source it starts\n *   from; `from`, when it begins as a run of this viewer's that was never\n *   saved, is that run — its name, its description and its checked query\n * @property saved - A saved query, by its name\n */\nexport const QueryOpenType = VariantType({\n    new: StructType({ id: StringType, source: StringType, from: OptionType(SavedQueryType) }),\n    saved: StringType,\n});\n\n/** The query open in a builder. */\nexport type QueryOpen = ValueTypeOf<typeof QueryOpenType>;\n\n/**\n * The notice a query arrived with.\n *\n * @property sourceId - The session of the query it arrived with ({@link querySourceId})\n * @property text - What the Query tab says when that query opens\n */\nexport const QueryArrivalType = StructType({ sourceId: StringType, text: StringType });\n\n/** The notice a query arrived with. */\nexport type QueryArrival = ValueTypeOf<typeof QueryArrivalType>;\n\nconst encodeOpen = encodeBeast2For(QueryOpenType);\nconst decodeOpen = decodeBeast2For(QueryOpenType);\nconst encodeArrival = encodeBeast2For(QueryArrivalType);\nconst decodeArrival = decodeBeast2For(QueryArrivalType);\nconst printString = printFor(StringType);\n\n/**\n * The open query's editing session's source id — `query.saved:\"Big orders\"`,\n * or `query.new:\"1\"` — one session, and its drafts, per query.\n *\n * @param open - The open query\n * @returns Its source id\n */\nexport function querySourceId(open: QueryOpen): string {\n    return open.type === \"saved\" ? `query.saved:${printString(open.value)}` : `query.new:${printString(open.value.id)}`;\n}\n\n/** How many new queries this page has started: each gets an id of its own. */\nlet started = 0;\n\n/**\n * A new query: on a data source, or begun as a run of this viewer's that was\n * never saved — its own id, so its drafts are its own.\n *\n * @param source - The data source it starts from\n * @param from - The run it begins as, when it does\n * @returns The query to open\n */\nexport function newQuery(source: string, from?: ValueTypeOf<typeof SavedQueryType>): QueryOpen {\n    started += 1;\n    return variant(\"new\", { id: `${Date.now().toString(36)}-${started}`, source, from: from === undefined ? none : some(from) });\n}\n\n/**\n * Opens a query: writes it as the open query, with the notice it arrives with.\n *\n * @param next - The query to open\n * @param notice - What the Query tab says when it opens — none for a query opened without one\n */\nexport type OpenQueryWrite = (next: QueryOpen, notice?: string) => void;\n\n/**\n * The query open in the builder the key names, a way to open another, and the\n * notice the open query arrived with.\n *\n * @param key - The builder's open-query key\n * @param first - The query it opens before any is written — a new query on its first data source\n * @returns The open query; the write that opens another, with the notice it arrives with; and the last notice written\n */\nexport function useOpenQuery(key: string, first: QueryOpen): [QueryOpen, OpenQueryWrite, QueryArrival | undefined] {\n    const store = StateRuntime.getStore();\n    const arrivalKey = `${key}.arrival`;\n    const subscribe = useCallback((notify: () => void) => store.subscribe(key, notify), [store, key]);\n    const snapshot = useCallback(() => store.read(key), [store, key]);\n    const bytes = useSyncExternalStore(subscribe, snapshot);\n    const subscribeArrival = useCallback((notify: () => void) => store.subscribe(arrivalKey, notify), [store, arrivalKey]);\n    const snapshotArrival = useCallback(() => store.read(arrivalKey), [store, arrivalKey]);\n    const arrivalBytes = useSyncExternalStore(subscribeArrival, snapshotArrival);\n    const open = useMemo(() => (bytes === undefined ? first : decodeOpen(bytes)), [bytes, first]);\n    const arrival = useMemo(() => (arrivalBytes === undefined ? undefined : decodeArrival(arrivalBytes)), [arrivalBytes]);\n    // The notice first, so the builder finds it when the query it arrives with opens.\n    const write = useCallback<OpenQueryWrite>((next, notice) => {\n        if (notice !== undefined) store.write(arrivalKey, encodeArrival({ sourceId: querySourceId(next), text: notice }));\n        store.write(key, encodeOpen(next));\n    }, [store, key, arrivalKey]);\n    return [open, write, arrival];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Query tab's foot (#936), under the steps (`Query Editor Spec.md`\n * §4.3): \"Add a step at the end\", dashed, which opens the add-step list; and\n * **Quick add** — Keep rows, Group and total, Sort by, Keep the first and Show\n * only fields, and List every part in the tree and Try the model over a range\n * where they fit (#934's `quickAddOptions`). A step that does not fit there\n * is off, with its reason on hover.\n *\n * @packageDocumentation\n */\n\nimport { memo } from \"react\";\nimport { Box, Button, chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { faPlus } from \"@fortawesome/free-solid-svg-icons\";\nimport type { SlotRef } from \"./model/refs.js\";\nimport type { StepOption } from \"./model/slots.js\";\nimport type { StepKind } from \"./steps/values.js\";\nimport { Tip, slotKey, type PartActions, type PartStyles } from \"./parts.js\";\n\n/** Props of {@link QueryFoot}. */\nexport interface QueryFootProps {\n    /** The Quick add buttons, each saying whether its step fits. */\n    readonly options: readonly StepOption[];\n    /** The parts' styles, and the words. */\n    readonly ps: PartStyles;\n    /** What \"Add a step at the end\" asks: the add-step list, hanging from it. */\n    readonly onSlot: PartActions[\"onSlot\"];\n    /** A Quick add button pressed: its step, added at the end. */\n    readonly onQuick: (kind: StepKind) => void;\n}\n\n/** The add-step list at the end of the query. */\nconst AT_END: SlotRef = { kind: \"add-step\", stepId: \"\" };\n\n/**\n * Renders the foot — see the module docs.\n *\n * @param props - The Quick add buttons, and what the foot asks ({@link QueryFootProps})\n * @returns The foot\n */\nexport const QueryFoot = memo(function QueryFoot({ options, ps, onSlot, onQuick }: QueryFootProps) {\n    const { styles, words } = ps;\n    const m = words.messages;\n    const button = useRecipe({ key: \"button\" })({ size: \"md\", variant: \"ghost\" });\n    return (\n        <Box css={styles.tabFoot} data-query-foot=\"\">\n            <chakra.button type=\"button\" css={[button, styles.addAtEnd!]} data-slot-key={slotKey(AT_END)}\n                onClick={(event) => onSlot(AT_END, event.currentTarget)}>\n                <FontAwesomeIcon icon={faPlus} />{m.addStepAtEnd()}\n            </chakra.button>\n            <Box css={styles.quick} role=\"group\" aria-label={m.quickAdd()}>\n                <Box as=\"span\" css={styles.quickLabel} aria-hidden>{m.quickAdd()}</Box>\n                {options.map((option) => {\n                    const pressable = (\n                        <Button key={option.kind} size=\"xs\" variant=\"outline\" disabled={!option.fits} data-quick={option.kind}\n                            onClick={() => onQuick(option.kind)}>\n                            <FontAwesomeIcon icon={[\"fas\", option.icon as IconName]} />{option.label}\n                        </Button>\n                    );\n                    // A button that is off takes no hover: its reason hangs from a wrapper.\n                    return option.fits ? pressable : (\n                        <Tip key={option.kind} label={option.reason}><span>{pressable}</span></Tip>\n                    );\n                })}\n            </Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The jq view's editor (#937) — the Query tab in jq (`Query Editor Spec.md`\n * §4.8): the program as text, filling the tab, with\n *\n * - **a gutter** of line numbers, each with a dot in the tone of the worst\n *   problem starting on its line;\n * - **highlighting** from east's lexer (`lexJq`): a layer of tokens behind a\n *   text field whose text is transparent, each token's kind, the problem it is\n *   part of and the range gone to from the panel set as data attributes the\n *   `jqEditor` recipe colours, underlines and tints;\n * - **completions** from east's `completeJq` after a word character, `.`, `\"`\n *   or `$`, and on Ctrl Space: the data sources in plain words, a path's\n *   fields with their types, a variant's `type` and `value`, case names, the\n *   variables bound and the builtins; and the data's values where the builder\n *   already holds a summary of the rows there (#934's cache: the jq view\n *   fetches none). They close when the caret moves, on blur and on ⌘⏎;\n * - **the problems panel**: the check in words, then each of the checker's\n *   diagnostics — its code, where it starts and its sentence — and a note on\n *   each part of the jq that stays a jq step in the visual view. Going to one\n *   selects its range; a fix applies its text edits and puts the caret after\n *   them.\n *\n * Keys: ⌘/Ctrl ⏎ runs (the builder's); Tab inserts two spaces, or takes the\n * completion offered; ↓ ↑ move through the completions, wrapping, ⏎ takes one\n * and Esc closes them. The text is the host's while it is typed, with the\n * browser's own undo; focus leaving the editor is the jq left (`onLeave`), and\n * a fix is a gesture of its own (`onFix`). The completions' measured position\n * is the editor's one inline style.\n *\n * @packageDocumentation\n */\n\nimport {\n    memo, useCallback, useId, useLayoutEffect, useMemo, useRef, useState,\n    type ChangeEvent, type FocusEvent, type KeyboardEvent, type MouseEvent, type SyntheticEvent,\n} from \"react\";\nimport { Box, Button, Kbd, chakra, useSlotRecipe } from \"@chakra-ui/react\";\nimport {\n    completeJq, lexJq,\n    type CheckJqResult, type CompleteJqOptions, type EastType, type JqCompletion, type JqCompletionKind, type JqTokenKind,\n} from \"@elaraai/east\";\nimport type { QueryMessages } from \"./model/messages.js\";\nimport { summaryAt, type Summary, type SummaryCache } from \"./model/summaries.js\";\nimport { human, plainKind, plural, type QueryWords } from \"./model/words.js\";\nimport type { QueryRoot } from \"./one-shot.js\";\nimport type { PartStyles, Styles } from \"./parts.js\";\nimport { JQ_STEP_NOTE, datasetType } from \"./steps/check.js\";\nimport { parseSteps } from \"./steps/parse.js\";\nimport { singular } from \"./steps/shape.js\";\n\n/** What Tab inserts without completions open. */\nconst TAB = \"  \";\n/** The run of characters a character's width is measured by. */\nconst MEASURE = \"x\".repeat(50);\n/** The gap between the caret's line and the completions, and the room they keep from the code's edge. */\nconst GAP = 4;\nconst INSET = 4;\n\n/** Each completion's glyph, by what it is (`Query Editor Spec.md` §4.8). */\nconst GLYPH: Readonly<Record<JqCompletionKind, string>> = {\n    dataset: \"ds\", field: \".f\", case: \"cs\", key: \"[k]\", value: \"\\\"v\", variable: \"$\", builtin: \"fn\",\n};\n\n/** How bad a problem is: an error stops the query running; a warning does not; a note says what a part of the jq is. */\ntype Severity = \"error\" | \"warning\" | \"note\";\nconst RANK: Readonly<Record<Severity, number>> = { note: 1, warning: 2, error: 3 };\n\n/** A range of the text: its first offset, and the offset after its last. */\ninterface Range {\n    readonly from: number;\n    readonly to: number;\n}\n\n/** A fix the panel offers: its label, and the text edits it makes, which do not overlap. */\ninterface JqFix {\n    readonly label: string;\n    readonly edits: readonly { readonly from: number; readonly to: number; readonly insert: string }[];\n}\n\n/** A problem, as the panel lists it and the code marks it. */\ninterface JqProblem {\n    readonly severity: Severity;\n    /** The checker's code; `custom` for a part that stays a jq step. */\n    readonly code: string;\n    /** The checker's sentence. */\n    readonly message: string;\n    /** The text it is about, when it is about some, and where that starts: 1-based. */\n    readonly range: Range | undefined;\n    readonly line: number;\n    readonly column: number;\n    readonly fixes: readonly JqFix[];\n}\n\n/** A run of one token's text on one line, as the highlighting draws it. */\ninterface Piece {\n    readonly text: string;\n    readonly kind: JqTokenKind;\n    /** The worst problem it is part of. */\n    readonly mark: Severity | undefined;\n    /** Whether it is in the range gone to. */\n    readonly active: boolean;\n}\n\n/** The completions open: the range they replace, and the active one. */\ninterface Completions {\n    /** The start of the word being typed. */\n    readonly from: number;\n    /** The end of the word under the caret. */\n    readonly to: number;\n    readonly items: readonly JqCompletion[];\n    readonly index: number;\n}\n\n/** The worse of two severities. */\nfunction worse(a: Severity | undefined, b: Severity): Severity {\n    return a === undefined || RANK[b] > RANK[a] ? b : a;\n}\n\n/** The 0-based line and column of an offset. */\nfunction positionOf(text: string, offset: number): { line: number; column: number } {\n    let line = 0;\n    let start = 0;\n    for (let i = text.indexOf(\"\\n\"); i !== -1 && i < offset; i = text.indexOf(\"\\n\", i + 1)) {\n        line += 1;\n        start = i + 1;\n    }\n    return { line, column: offset - start };\n}\n\n/** The ranges of the parts of the text that stay jq steps in the visual view; none when it is not steps. */\nfunction jqStepRanges(text: string, root: EastType): Range[] {\n    const parsed = parseSteps(text, root);\n    if (\"error\" in parsed) return [];\n    const jq = new Set(parsed.query.steps.flatMap(s => (s.type === \"jq\" ? [s.value.id] : [])));\n    return parsed.spans.flatMap(s => (jq.has(s.stepId) ? [{ from: s.from, to: s.to }] : []));\n}\n\n/** The checker's diagnostics, then a note on each part that stays a jq step. */\nfunction problemsOf(text: string, checked: CheckJqResult, notes: readonly Range[]): JqProblem[] {\n    const problems = checked.diagnostics.map((d): JqProblem => {\n        const span = d.span.type === \"some\" ? d.span.value : undefined;\n        return {\n            severity: d.severity.type === \"warning\" ? \"warning\" : \"error\",\n            code: d.code,\n            message: d.message,\n            range: span === undefined ? undefined : { from: Number(span.offset), to: Number(span.offset + span.length) },\n            line: span === undefined ? 0 : Number(span.line),\n            column: span === undefined ? 0 : Number(span.column),\n            fixes: d.fixes.map(fix => ({\n                label: fix.label,\n                edits: fix.edits.map(e => ({ from: Number(e.offset), to: Number(e.offset + e.length), insert: e.insert })),\n            })),\n        };\n    });\n    for (const note of notes) {\n        const { line, column } = positionOf(text, note.from);\n        problems.push({ severity: \"note\", code: \"custom\", message: JQ_STEP_NOTE, range: note, line: line + 1, column: column + 1, fixes: [] });\n    }\n    return problems;\n}\n\n/**\n * The text as lines of pieces: each token of east's lexer, cut where a\n * problem's range or the range gone to starts or ends, and at line breaks.\n */\nfunction layOut(text: string, marks: readonly (Range & { readonly severity: Severity })[], active: Range | undefined): Piece[][] {\n    const cuts = [...new Set([...marks.flatMap(m => [m.from, m.to]), ...(active === undefined ? [] : [active.from, active.to])])].sort((a, b) => a - b);\n    const lines: Piece[][] = [[]];\n    const push = (from: number, to: number, kind: JqTokenKind): void => {\n        let mark: Severity | undefined;\n        for (const m of marks) if (m.from < to && m.to > from) mark = worse(mark, m.severity);\n        lines[lines.length - 1]!.push({ text: text.slice(from, to), kind, mark, active: active !== undefined && from >= active.from && to <= active.to });\n    };\n    for (const token of lexJq(text)) {\n        let at = token.from;\n        for (const cut of [...cuts.filter(c => c > token.from && c < token.to), token.to]) {\n            let start = at;\n            for (let i = text.indexOf(\"\\n\", start); i !== -1 && i < cut; i = text.indexOf(\"\\n\", start)) {\n                if (i > start) push(start, i, token.kind);\n                lines.push([]);\n                start = i + 1;\n            }\n            if (cut > start) push(start, cut, token.kind);\n            at = cut;\n        }\n    }\n    return lines;\n}\n\n/** A fix's edits applied, and the caret after the last. */\nfunction applyEdits(text: string, edits: JqFix[\"edits\"]): { text: string; caret: number } {\n    let out = \"\";\n    let at = 0;\n    let caret = 0;\n    for (const edit of [...edits].sort((a, b) => a.from - b.from)) {\n        out += text.slice(at, edit.from) + edit.insert;\n        caret = out.length;\n        at = edit.to;\n    }\n    return { text: out + text.slice(at), caret };\n}\n\n/**\n * The summary of the rows at the caret's stage, when the builder holds one:\n * the program before the last pipe outside every bracket, read as steps.\n */\nfunction stageSummary(text: string, caret: number, root: EastType, summaries: JqEditorProps[\"summaries\"]): Summary | undefined {\n    let depth = 0;\n    let cut = -1;\n    for (const token of lexJq(text.slice(0, caret))) {\n        if (token.kind === \"punctuation\") {\n            if (token.text === \"(\" || token.text === \"[\" || token.text === \"{\") depth += 1;\n            else if (token.text === \")\" || token.text === \"]\" || token.text === \"}\") depth = Math.max(0, depth - 1);\n        } else if (token.kind === \"pipe\" && depth === 0) cut = token.from;\n    }\n    if (cut < 0) return undefined;\n    const parsed = parseSteps(text.slice(0, cut), root);\n    if (\"error\" in parsed) return undefined;\n    const request = summaryAt(parsed.query, parsed.query.steps.length, root);\n    return request === undefined ? undefined : summaries.cache.get(request, summaries.hashes);\n}\n\n/** The most common values at a path of a summary's rows that start with a prefix. */\nfunction summaryValues(summary: Summary | undefined, path: string, prefix: string): { value: string; count: number }[] {\n    const leaf = summary?.leaves.get(path);\n    if (leaf === undefined || leaf.values.type !== \"some\") return [];\n    const typed = prefix.toLowerCase();\n    return leaf.values.value.filter(v => v.value.toLowerCase().startsWith(typed)).map(v => ({ value: v.value, count: Number(v.n) }));\n}\n\n/** The footer's words for a completion: its doc, a builtin's signature, or its label and detail. */\nfunction docOf(item: JqCompletion, m: QueryMessages): string {\n    if (item.doc !== undefined && item.doc !== \"\") return item.doc;\n    return item.kind === \"builtin\" ? item.detail : m.jqCompletionLine({ label: item.label, detail: item.detail });\n}\n\n/** Keeps the focus where it is: a press on the completions. */\nfunction keepFocus(event: MouseEvent): void {\n    event.preventDefault();\n}\n\n/** Props of {@link JqEditor}. */\nexport interface JqEditorProps {\n    /** The jq as typed. */\n    readonly text: string;\n    /** Its check: east's checker over the root. */\n    readonly checked: CheckJqResult;\n    /** The root: what completions offer, and what the text is read as steps over. */\n    readonly root: QueryRoot;\n    /** The builder's summaries: the values completions offer, where one is held. */\n    readonly summaries: { readonly cache: SummaryCache; readonly hashes: ReadonlyMap<string, string> };\n    /** The parts' styles, and the words. */\n    readonly ps: PartStyles;\n    /** Told each change of the text. */\n    readonly onText: (text: string) => void;\n    /** Told the focus left the editor: the jq typed, one gesture. */\n    readonly onLeave: () => void;\n    /** Told a fix taken: the text it makes, and its label — one gesture of its own. */\n    readonly onFix: (text: string, label: string) => void;\n    /** A phone's: lines wrap, a number on each first row, completions docked, no keys told of (QP30–QP32). */\n    readonly phone?: boolean | undefined;\n}\n\n/**\n * Renders the jq view's editor — see the module docs.\n *\n * @param props - The text and its check, the root, the summaries, the words and what it tells ({@link JqEditorProps})\n * @returns The editor\n */\nexport const JqEditor = memo(function JqEditor({ text, checked, root, summaries, ps, onText, onLeave, onFix, phone = false }: JqEditorProps) {\n    const words: QueryWords = ps.words;\n    const m = words.messages;\n    const f = words.formatters;\n    const jqRecipe = useSlotRecipe({ key: \"jqEditor\" });\n    const popoverRecipe = useSlotRecipe({ key: \"popover\" });\n    const comboboxRecipe = useSlotRecipe({ key: \"combobox\" });\n    const statusRecipe = useSlotRecipe({ key: \"status\" });\n    const jq = useMemo(() => jqRecipe() as Styles, [jqRecipe]);\n    const popover = useMemo(() => popoverRecipe() as Styles, [popoverRecipe]);\n    const combobox = useMemo(() => comboboxRecipe() as Styles, [comboboxRecipe]);\n    const dots = useMemo(() => ({\n        error: statusRecipe({ status: \"danger\", size: \"sm\" }) as Styles,\n        warning: statusRecipe({ status: \"warning\", size: \"sm\" }) as Styles,\n        note: statusRecipe({ status: \"neutral\", size: \"sm\" }) as Styles,\n        success: statusRecipe({ status: \"success\", size: \"sm\" }) as Styles,\n    }), [statusRecipe]);\n\n    const ids = useId();\n    const listId = `${ids}-completions`;\n    const optionId = (index: number): string => `${ids}-completion-${index}`;\n    const scrollerRef = useRef<HTMLDivElement>(null);\n    const highlightRef = useRef<HTMLDivElement>(null);\n    const areaRef = useRef<HTMLTextAreaElement>(null);\n    const measureRef = useRef<HTMLSpanElement>(null);\n    const popRef = useRef<HTMLDivElement>(null);\n    const listRef = useRef<HTMLDivElement>(null);\n\n    // ── The problems, the marks they make, and the lines ────────────────\n    const notes = useMemo(() => jqStepRanges(text, root.type), [text, root]);\n    const problems = useMemo(() => problemsOf(text, checked, notes), [text, checked, notes]);\n    const [active, setActive] = useState<Range | undefined>(undefined);\n    const marks = useMemo(() => problems.flatMap(p => (p.range === undefined ? []\n        : [{ from: p.range.from, to: Math.max(p.range.to, p.range.from + 1), severity: p.severity }])), [problems]);\n    const lines = useMemo(() => layOut(text, marks, active), [text, marks, active]);\n    const worst = useMemo(() => {\n        const byLine = new Map<number, Severity>();\n        for (const p of problems) if (p.range !== undefined) byLine.set(p.line - 1, worse(byLine.get(p.line - 1), p.severity));\n        return byLine;\n    }, [problems]);\n    const errors = problems.filter(p => p.severity === \"error\").length;\n    const warnings = problems.filter(p => p.severity === \"warning\").length;\n    const tone = errors > 0 ? \"error\" : warnings > 0 ? \"warning\" : \"success\";\n\n    // ── A character's width, once the fonts are ready ───────────────────\n    const [charWidth, setCharWidth] = useState(0);\n    useLayoutEffect(() => {\n        const measure = (): void => {\n            const el = measureRef.current;\n            const width = el === null ? 0 : el.getBoundingClientRect().width / MEASURE.length;\n            if (width > 0) setCharWidth(width);\n        };\n        measure();\n        let live = true;\n        const fonts: FontFaceSet | undefined = measureRef.current?.ownerDocument.fonts;\n        void fonts?.ready.then(() => { if (live) measure(); });\n        return () => { live = false; };\n    }, []);\n\n    // ── Completions ─────────────────────────────────────────────────────\n    const [open, setOpen] = useState<Completions | undefined>(undefined);\n    // The caret the completions were made at: moving it closes them.\n    const caret = useRef(0);\n    // The caret to set once a change the editor made has rendered.\n    const pending = useRef<number | undefined>(undefined);\n    const complete = useCallback((t: string, at: number, forced: boolean): Completions | undefined => {\n        if (!forced && !/[\\w.$\"]$/.test(t.slice(0, at))) return undefined;\n        // The values are the summary's of the rows at the caret, read only when a string asks for them.\n        let summary: Summary | undefined | null = null;\n        const options: CompleteJqOptions = {\n            root: true,\n            values: (path, prefix) => {\n                if (summary === null) summary = stageSummary(t, at, root.type, summaries);\n                return summaryValues(summary, path, prefix);\n            },\n            describeRoot: (name) => {\n                const type = datasetType(root.type, name);\n                return type === undefined ? undefined : plainKind(type, words, plural(human(singular(name))));\n            },\n        };\n        const found = completeJq(t, at, root.type, options);\n        if (found === null || found.items.length === 0) return undefined;\n        let to = at;\n        while (to < t.length && /\\w/.test(t[to]!)) to += 1;\n        return { from: found.from, to, items: found.items, index: 0 };\n    }, [root, summaries, words]);\n\n    /** Replaces a range of the text, and puts the caret where it belongs once the text renders. */\n    const replace = useCallback((from: number, to: number, insert: string, after: number = from + insert.length) => {\n        const next = text.slice(0, from) + insert + text.slice(to);\n        caret.current = after;\n        setOpen(undefined);\n        setActive(undefined);\n        if (next === text) {\n            areaRef.current?.setSelectionRange(after, after);\n            return;\n        }\n        pending.current = after;\n        onText(next);\n    }, [text, onText]);\n    useLayoutEffect(() => {\n        const at = pending.current;\n        const area = areaRef.current;\n        if (at === undefined || area === null) return;\n        pending.current = undefined;\n        area.focus({ preventScroll: true });\n        area.setSelectionRange(at, at);\n    }, [text]);\n\n    /** Takes a completion: from the start of the word to its end, its closing quote not doubled. */\n    const accept = useCallback((at: Completions, item: JqCompletion) => {\n        let insert = item.insert;\n        let after = at.from + insert.length;\n        if (insert.endsWith(\"\\\"\") && text[at.to] === \"\\\"\") {\n            insert = insert.slice(0, -1);\n            after = at.from + insert.length + 1;\n        }\n        replace(at.from, at.to, insert, after);\n    }, [text, replace]);\n\n    // ── The text field ──────────────────────────────────────────────────\n    const onChange = useCallback((event: ChangeEvent<HTMLTextAreaElement>) => {\n        const next = event.target.value;\n        const at = event.target.selectionStart;\n        caret.current = at;\n        setActive(undefined);\n        setOpen(complete(next, at, false));\n        onText(next);\n    }, [complete, onText]);\n    const onSelect = useCallback((event: SyntheticEvent<HTMLTextAreaElement>) => {\n        const at = event.currentTarget.selectionStart;\n        if (at === caret.current) return;\n        caret.current = at;\n        setOpen(undefined);\n    }, []);\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLTextAreaElement>) => {\n        if (event.nativeEvent.isComposing) return;\n        const area = event.currentTarget;\n        if ((event.metaKey || event.ctrlKey) && event.key === \"Enter\") {\n            // ⌘⏎ runs: the builder's. The completions close.\n            setOpen(undefined);\n            return;\n        }\n        if (event.ctrlKey && (event.key === \" \" || event.code === \"Space\")) {\n            event.preventDefault();\n            caret.current = area.selectionStart;\n            setOpen(complete(area.value, area.selectionStart, true));\n            return;\n        }\n        if (open !== undefined) {\n            const n = open.items.length;\n            switch (event.key) {\n                case \"ArrowDown\":\n                case \"ArrowUp\":\n                    event.preventDefault();\n                    setOpen({ ...open, index: (open.index + (event.key === \"ArrowDown\" ? 1 : n - 1)) % n });\n                    return;\n                case \"Enter\":\n                case \"Tab\":\n                    event.preventDefault();\n                    accept(open, open.items[open.index]!);\n                    return;\n                case \"Escape\":\n                    event.preventDefault();\n                    setOpen(undefined);\n                    return;\n                default:\n                    break;\n            }\n        }\n        if (event.key === \"Tab\" && !event.shiftKey && !event.altKey && !event.metaKey && !event.ctrlKey) {\n            event.preventDefault();\n            replace(area.selectionStart, area.selectionEnd, TAB);\n        }\n    }, [open, complete, accept, replace]);\n    const onAreaBlur = useCallback(() => setOpen(undefined), []);\n    // The focus leaving the editor — not moving within it — is the jq left.\n    const onRootBlur = useCallback((event: FocusEvent<HTMLDivElement>) => {\n        const next = event.relatedTarget;\n        if (next instanceof Node && event.currentTarget.contains(next)) return;\n        onLeave();\n    }, [onLeave]);\n\n    // ── The problems panel ──────────────────────────────────────────────\n    const go = useCallback((problem: JqProblem) => {\n        const range = problem.range;\n        const area = areaRef.current;\n        if (range === undefined || area === null) return;\n        setActive(range);\n        setOpen(undefined);\n        caret.current = range.from;\n        area.focus({ preventScroll: true });\n        area.setSelectionRange(range.from, range.to);\n        const row = highlightRef.current?.children[problem.line - 1];\n        if (row instanceof HTMLElement && typeof row.scrollIntoView === \"function\") row.scrollIntoView({ block: \"nearest\" });\n    }, []);\n    const fix = useCallback((taken: JqFix) => {\n        const { text: next, caret: after } = applyEdits(text, taken.edits);\n        caret.current = after;\n        pending.current = after;\n        setActive(undefined);\n        setOpen(undefined);\n        onFix(next, taken.label);\n    }, [text, onFix]);\n\n    // ── Where the completions go: under the caret's line, the label over the word ──\n    const [place, setPlace] = useState<{ left: number; top: number } | undefined>(undefined);\n    const openFrom = open?.from;\n    const openIndex = open?.index;\n    useLayoutEffect(() => {\n        if (openFrom === undefined) {\n            setPlace(undefined);\n            return;\n        }\n        const highlight = highlightRef.current;\n        const pop = popRef.current;\n        if (highlight === null || pop === null) return;\n        const { line, column } = positionOf(text, openFrom);\n        const row = highlight.children[line];\n        const lineTop = row instanceof HTMLElement ? row.offsetTop : 0;\n        const lineHeight = row instanceof HTMLElement ? row.offsetHeight : 0;\n        const lineLeft = row instanceof HTMLElement ? row.offsetLeft : 0;\n        const box = pop.getBoundingClientRect();\n        const scale = pop.offsetWidth > 0 && box.width > 0 ? box.width / pop.offsetWidth : 1;\n        const label = pop.querySelector<HTMLElement>(\"[data-label]\");\n        const shift = label === null ? 0 : (label.getBoundingClientRect().left - box.left) / scale;\n        const left = Math.max(INSET, lineLeft + column * charWidth - shift);\n        // Below the line; above it when it does not fit below and does above.\n        const height = pop.offsetHeight;\n        const below = lineTop + lineHeight + GAP;\n        const above = lineTop - GAP - height;\n        const scroller = scrollerRef.current;\n        const flip = scroller !== null && below + height > scroller.scrollTop + scroller.clientHeight && above >= scroller.scrollTop;\n        const top = flip ? above : below;\n        setPlace(prev => (prev !== undefined && prev.left === left && prev.top === top ? prev : { left, top }));\n    }, [openFrom, text, charWidth]);\n    // The active completion stays in view, in the list.\n    useLayoutEffect(() => {\n        const list = listRef.current;\n        if (openIndex === undefined || list === null) return;\n        const item = list.children[openIndex];\n        if (!(item instanceof HTMLElement)) return;\n        const top = item.offsetTop;\n        const bottom = top + item.offsetHeight;\n        if (top < list.scrollTop) list.scrollTop = top;\n        else if (bottom > list.scrollTop + list.clientHeight) list.scrollTop = bottom - list.clientHeight;\n    }, [openIndex]);\n\n    // A phone's lines wrap: each number as tall as its line, on its first row.\n    const gutterRef = useRef<HTMLDivElement>(null);\n    useLayoutEffect(() => {\n        if (!phone) return;\n        const rows = highlightRef.current?.children;\n        const numbers = gutterRef.current?.children;\n        if (rows === undefined || numbers === undefined) return;\n        for (let i = 0; i < numbers.length; i++) {\n            const row = rows[i], number = numbers[i];\n            if (row instanceof HTMLElement && number instanceof HTMLElement) number.style.height = `${row.offsetHeight}px`;\n        }\n    });\n    const activeItem = open === undefined ? undefined : open.items[open.index];\n    const check = dots[tone];\n    const completions = open !== undefined && (\n        <Box ref={popRef} css={[popover.content!, jq.completions!]} data-query-completions=\"\" style={phone ? undefined : place} onMouseDown={keepFocus}>\n            <Box ref={listRef} id={listId} role=\"listbox\" aria-label={m.jqCompletionsLabel()} css={jq.completionList}>\n                {open.items.map((item, i) => (\n                    <Box\n                        key={`${i}:${item.label}`}\n                        id={optionId(i)}\n                        role=\"option\"\n                        aria-selected={i === open.index}\n                        data-highlighted={i === open.index ? \"\" : undefined}\n                        data-kind={item.kind}\n                        css={[combobox.item!, jq.completion!]}\n                        onPointerMove={i === open.index ? undefined : () => setOpen({ ...open, index: i })}\n                        onClick={() => accept(open, item)}\n                    >\n                        <chakra.span css={jq.glyph} data-glyph=\"\">{GLYPH[item.kind]}</chakra.span>\n                        <chakra.span css={jq.completionLabel} data-label=\"\">{item.label}</chakra.span>\n                        <chakra.span css={jq.completionDetail} data-detail=\"\" data-warn={item.warn === true ? \"\" : undefined}>{item.detail}</chakra.span>\n                    </Box>\n                ))}\n            </Box>\n            <Box css={[popover.footer!, jq.completionFooter!]}>\n                <chakra.span css={jq.completionDoc} data-doc=\"\">{activeItem === undefined ? \"\" : docOf(activeItem, m)}</chakra.span>\n                <Kbd css={jq.completionKeys}>{m.jqCompletionKeys()}</Kbd>\n            </Box>\n        </Box>\n    );\n    return (\n        <Box css={jq.root} data-query-jq-editor=\"\" data-jq-phone={phone ? \"\" : undefined} onBlur={onRootBlur}>\n            <Box ref={scrollerRef} css={jq.editor}>\n                <Box css={jq.content}>\n                    <Box ref={gutterRef} css={jq.gutter} aria-hidden data-query-jq-gutter=\"\">\n                        {lines.map((_, i) => (\n                            <Box key={i} css={jq.line}>\n                                <Box as=\"span\" css={jq.dot} data-severity={worst.get(i)} />\n                                {f.bare(i + 1)}\n                            </Box>\n                        ))}\n                    </Box>\n                    <Box css={jq.code}>\n                        <Box ref={highlightRef} css={jq.highlight} aria-hidden data-query-jq-highlight=\"\">\n                            {lines.map((pieces, i) => (\n                                <Box key={i} css={jq.codeLine}>\n                                    {pieces.map((p, j) => (\n                                        <chakra.span key={j} css={jq.token} data-kind={p.kind} data-mark={p.mark} data-active={p.active ? \"\" : undefined}>\n                                            {p.text}\n                                        </chakra.span>\n                                    ))}\n                                </Box>\n                            ))}\n                        </Box>\n                        <chakra.textarea\n                            ref={areaRef}\n                            css={jq.input}\n                            value={text}\n                            wrap={phone ? \"soft\" : \"off\"}\n                            aria-label={m.jqLabel()}\n                            aria-autocomplete=\"list\"\n                            aria-controls={open === undefined ? undefined : listId}\n                            aria-activedescendant={open === undefined ? undefined : optionId(open.index)}\n                            spellCheck={false}\n                            autoComplete=\"off\"\n                            autoCapitalize=\"off\"\n                            autoCorrect=\"off\"\n                            data-query-jq=\"\"\n                            onChange={onChange}\n                            onKeyDown={onKeyDown}\n                            onSelect={onSelect}\n                            onBlur={onAreaBlur}\n                        />\n                        <chakra.span ref={measureRef} css={jq.measure} aria-hidden>{MEASURE}</chakra.span>\n                        {!phone && completions}\n                    </Box>\n                </Box>\n            </Box>\n            {phone && completions}\n            <Box css={jq.problems} data-query-jq-problems=\"\" hidden={phone && problems.length === 0}>\n                {!phone && <Box css={jq.summary}>\n                    <Box as=\"span\" css={check.root} data-query-jq-check={tone}>\n                        <Box as=\"span\" css={check.indicator} aria-hidden />\n                        <Box as=\"span\" css={check.label}>{m.jqCheck({ problems: f.number(errors), n: errors, warnings: f.number(warnings), w: warnings })}</Box>\n                    </Box>\n                    <Box as=\"span\" css={jq.hint}>{m.jqHint()}</Box>\n                </Box>}\n                <Box css={jq.problemList} role=\"list\" aria-label={m.jqProblemsLabel()}>\n                    {problems.map((p, i) => (\n                        <Box key={i} role=\"listitem\" css={jq.problem} data-severity={p.severity} data-query-jq-problem={p.code}>\n                            <Box as=\"span\" css={[dots[p.severity].indicator!, jq.problemDot!]} aria-hidden />\n                            <chakra.button type=\"button\" css={jq.problemGo} disabled={p.range === undefined} onClick={() => go(p)}>\n                                <Box as=\"span\" css={jq.problemHead}>\n                                    <Box as=\"span\" css={jq.problemCode} data-severity={p.severity}>\n                                        {m.jqProblemCode({ code: p.code, note: p.severity === \"note\" })}\n                                    </Box>\n                                    {p.range !== undefined && (\n                                        <Box as=\"span\" css={jq.problemAt}>{m.jqProblemAt({ line: f.bare(p.line), column: f.bare(p.column) })}</Box>\n                                    )}\n                                </Box>\n                                <Box as=\"span\" css={jq.problemMessage}>{p.message}</Box>\n                            </chakra.button>\n                            {p.fixes.length > 0 && (\n                                <Box css={jq.problemFixes}>\n                                    {p.fixes.map((fx, j) => (\n                                        <Button key={j} size=\"xs\" variant=\"outline\" data-query-jq-fix=\"\" onClick={() => fix(fx)}>{fx.label}</Button>\n                                    ))}\n                                </Box>\n                            )}\n                        </Box>\n                    ))}\n                </Box>\n            </Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The line between two steps (#936) — #934's `ShapeLine` as the Query tab\n * draws it after the source and after every step (`Query Editor Spec.md`\n * §4.3): a rule down the steps' spine; the shape in plain words (\"Many\n * shipped orders\"), or counted after a fresh run (\"16 shipped orders\"); what\n * changed (\"+ name, region\"), or the fields after a reshaping step; the East\n * type on hover; and **Insert**, which opens the add-step list for that point.\n *\n * @packageDocumentation\n */\n\nimport { memo } from \"react\";\nimport { Box, Button } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faPlus } from \"@fortawesome/free-solid-svg-icons\";\nimport type { ShapeLine } from \"./model/cards.js\";\nimport type { SlotRef } from \"./model/refs.js\";\nimport { Tip, slotKey, type PartActions, type PartStyles } from \"./parts.js\";\n\n/** Props of {@link ShapeLineView}. */\nexport interface ShapeLineViewProps {\n    /** The shape. */\n    readonly shape: ShapeLine;\n    /** Where Insert adds a step: before the step at this index. */\n    readonly at: number;\n    /** The parts' styles, and the words. */\n    readonly ps: PartStyles;\n    /** What Insert asks: the add-step list, hanging from it. */\n    readonly onSlot: PartActions[\"onSlot\"];\n}\n\n/**\n * Renders the line after the source or a step — see the module docs.\n *\n * @param props - The shape, Insert's place, and what it asks ({@link ShapeLineViewProps})\n * @returns The line\n */\nexport const ShapeLineView = memo(function ShapeLineView({ shape, at, ps, onSlot }: ShapeLineViewProps) {\n    const { styles, words } = ps;\n    const m = words.messages;\n    const slot: SlotRef = { kind: \"add-step\", stepId: \"\", at };\n    return (\n        <Box css={styles.shape} data-query-shape={at}>\n            <Box as=\"span\" css={styles.shapeRule} aria-hidden />\n            <Tip label={shape.type}>\n                <Box as=\"span\" css={styles.shapeText} data-query-shape-text=\"\" data-counted={shape.counted ? \"\" : undefined}>\n                    <span>{shape.text}</span>\n                    {shape.extra !== \"\" && <Box as=\"span\" css={styles.shapeExtra}>{shape.extra}</Box>}\n                </Box>\n            </Tip>\n            <Button size=\"xs\" variant=\"ghost\" css={styles.insert} data-slot-key={slotKey(slot)} aria-label={m.insertHere()}\n                onClick={(event) => onSlot(slot, event.currentTarget)}>\n                <FontAwesomeIcon icon={faPlus} />{m.insert()}\n            </Button>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The source's card (#936) — what a query starts with, as the Query tab draws\n * it at the top of the steps (`Query Editor Spec.md` §4.3): \"Start with\n * orders\" over \"{workspace}.orders · list of orders\".\n *\n * @packageDocumentation\n */\n\nimport { memo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faDatabase } from \"@fortawesome/free-solid-svg-icons\";\nimport type { SourceCard } from \"./model/cards.js\";\nimport type { PartStyles } from \"./parts.js\";\n\n/** Props of {@link SourceCardView}. */\nexport interface SourceCardViewProps {\n    /** The card. */\n    readonly card: SourceCard;\n    /** The data source's name. */\n    readonly source: string;\n    /** The workspace it is read in, when the builder knows it. */\n    readonly workspace: string | undefined;\n    /** The parts' styles, and the words. */\n    readonly ps: PartStyles;\n}\n\n/**\n * Renders the source's card — see the module docs.\n *\n * @param props - The card, the source, the workspace and the styles ({@link SourceCardViewProps})\n * @returns The card\n */\nexport const SourceCardView = memo(function SourceCardView({ card, source, workspace, ps }: SourceCardViewProps) {\n    const { styles, words } = ps;\n    const path = workspace === undefined ? source : `${workspace}.${source}`;\n    return (\n        <Box css={styles.source} data-query-source={source}>\n            <Box as=\"span\" css={styles.sourceIcon} aria-hidden><FontAwesomeIcon icon={faDatabase} /></Box>\n            <Box css={styles.sourceText}>\n                <Box as=\"span\" css={styles.sourceTitle}>{card.title}</Box>\n                <Box as=\"span\" css={styles.sourceKind}>{words.messages.sourceLine({ path, kind: card.kind })}</Box>\n            </Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A step's card (#936) — #934's `Card` as the Query tab draws it\n * (`Query Editor Spec.md` §4.3): its number, icon and title, its head slot\n * when it has one (\"all of these are true\"), and Move up, Move down and\n * Remove, quiet until hovered — Move up off on the first step, Move down on\n * the last; then its lines, and, while it is not finished, dashed, with \"Not\n * in the query until it's finished.\"\n *\n * @packageDocumentation\n */\n\nimport { memo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { faArrowDown, faArrowUp, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport type { Card } from \"./model/cards.js\";\nimport { IconPart, Lines, Parts, type PartActions, type PartStyles } from \"./parts.js\";\n\n/** What a card asks of the Query tab, besides its parts'. */\nexport interface CardActions extends PartActions {\n    /** Moves a step up (`-1`) or down (`1`). */\n    readonly onMove: (stepId: string, by: -1 | 1) => void;\n    /** Takes a step out. */\n    readonly onRemoveStep: (stepId: string) => void;\n}\n\n/** Props of {@link StepCard}. */\nexport interface StepCardProps {\n    /** The card. */\n    readonly card: Card;\n    /** How many steps the query has. */\n    readonly count: number;\n    /** Whether an issue the history item went to is on it. */\n    readonly focused: boolean;\n    /** The parts' styles, and the words. */\n    readonly ps: PartStyles;\n    /** What its parts and its buttons ask. */\n    readonly actions: CardActions;\n}\n\n/**\n * Renders a step's card — see the module docs.\n *\n * @param props - The card, the step count, and what it asks ({@link StepCardProps})\n * @returns The card\n */\nexport const StepCard = memo(function StepCard({ card, count, focused, ps, actions }: StepCardProps) {\n    const { styles, words } = ps;\n    const m = words.messages;\n    return (\n        <Box css={styles.card} role=\"group\" aria-label={card.title} data-step-id={card.stepId} data-step-kind={card.kind}\n            data-unfinished={card.complete ? undefined : \"\"} data-error={card.errors > 0 ? \"\" : undefined}\n            data-focus={focused ? \"\" : undefined}>\n            <Box css={styles.cardHead}>\n                <Box as=\"span\" css={styles.cardNumber}>{m.stepNumber({ n: words.formatters.bare(card.index + 1) })}</Box>\n                <Box as=\"span\" css={styles.cardIcon} aria-hidden><FontAwesomeIcon icon={[\"fas\", card.icon as IconName]} /></Box>\n                <Box as=\"span\" css={styles.cardTitle}>{card.title}</Box>\n                <Parts parts={card.head} ps={ps} actions={actions} />\n                <Box css={styles.cardSpacer} />\n                <Box css={styles.cardActions}>\n                    <IconPart label={m.moveUp()} icon={faArrowUp} disabled={card.index === 0} css={ps.icon}\n                        onClick={() => actions.onMove(card.stepId, -1)} />\n                    <IconPart label={m.moveDown()} icon={faArrowDown} disabled={card.index === count - 1} css={ps.icon}\n                        onClick={() => actions.onMove(card.stepId, 1)} />\n                    <IconPart label={m.removeStep()} icon={faXmark} css={ps.icon} onClick={() => actions.onRemoveStep(card.stepId)} />\n                </Box>\n            </Box>\n            <Box css={styles.cardBody}>\n                <Lines lines={card.lines} ps={ps} actions={actions} />\n                {!card.complete && <Box as=\"span\" css={styles.unfinished}>{m.notFinished()}</Box>}\n            </Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The builder's one toolbar (#936), as the shared `Toolbar`'s items\n * (`Query Editor Spec.md` §4.1), folding on one ladder as Studio's toolbars\n * do: the history item (#935), **Copy jq**, which shows its check for a\n * moment after it copies and folds to its icon,\n * **Save…** (the save popover's trigger), and **Run**, the one primary\n * button, its shortcut in a `Kbd`, which folds away first, and \"Running\" with\n * a spinner while a run goes. A row short of room still (#1229) folds Copy jq\n * and Save… into one ⋯ chip, in one step: its menu holds the two, Save…\n * opening the save popover from the chip; Run keeps its folded form. Where\n * even the whole ladder leaves the row too wide — a phone's — Run is its icon\n * alone, named Run, a rung of the row's floor (`FLOOR_RANK`, hand retest, 27\n * Oct 2026), so the row never runs past its end.\n *\n * **Visual · jq** is the Query tab's own ({@link viewToolbarItem}): the `seg`\n * strip Studio's canvas holds Desktop · Tablet in, at the top of the tab's\n * body, where a Library's band holds its search box, folding to its icons.\n * The result's controls are the results' own, in their band (#938).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { Box, Button, Kbd, Menu as ChakraMenu, chakra, useSlotRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCheck, faCode, faCopy, faDiagramProject, faEllipsis, faPlay } from \"@fortawesome/free-solid-svg-icons\";\nimport { ChipMenu, FLOOR_RANK, type ToolbarItem } from \"@elaraai/east-ui-components\";\nimport type { QueryWords } from \"./model/words.js\";\nimport { Tip, type Styles } from \"./parts.js\";\n\n/** A view of the query: its steps, or its jq. */\nexport type QueryView = \"visual\" | \"jq\";\n\n/**\n * The fold order of the builder's own items, lowest first, as Studio's\n * canvas ranks its own: Run's keys go first, then Copy jq folds to its icon,\n * then Copy jq and Save… fold into the ⋯ chip, in one step (#1229). The\n * history item folds after them all, at its own rank.\n */\nconst RANK_RUN_KEYS = 10;\nconst RANK_COPY = 20;\nconst RANK_MORE = 30;\n\n/** The fold of Copy jq and Save… into the ⋯ chip: one bundle, applied together. */\nconst MORE_BUNDLE = \"query.more\";\n\n/** Visual · jq's fold in the Query tab's band: to its icons. */\nconst RANK_VIEW = 40;\n\n/** How long Copy jq shows its check. */\nexport const COPIED_MS = 1600;\n\n/** What the builder's toolbar holds. */\nexport interface QueryToolbarOptions {\n    /** The history item (#935). */\n    readonly history: ToolbarItem;\n    /** The text Copy jq copies: the program, or the jq as typed in the jq view. */\n    readonly copyText: () => string;\n    /** The save popover, its trigger the toolbar's Save…. */\n    readonly save: ReactNode;\n    /** The save popover hanging from the ⋯ chip Copy jq and Save… fold into — given the chip, as its anchor. */\n    readonly saveFrom: (anchor: ReactNode) => ReactNode;\n    /** Opens the save popover — Save… in the ⋯ chip's menu. */\n    readonly onSaveAs: () => void;\n    /** Whether the save popover is open: the item it hangs from keeps its form. */\n    readonly saving: boolean;\n    /** Whether a run goes. */\n    readonly running: boolean;\n    /** Runs the query. */\n    readonly onRun: () => void;\n    /** The words. */\n    readonly words: QueryWords;\n    /** The `queryBuilder` recipe's styles. */\n    readonly styles: Styles;\n}\n\n/** Copying the program: it goes to the clipboard, and `copied` holds for a moment after. */\nexport function useCopy(copyText: () => string): { copied: boolean; copy: () => void } {\n    const [copied, setCopied] = useState(false);\n    const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n    useEffect(() => () => clearTimeout(timer.current), []);\n    const copy = useCallback(() => {\n        const text = copyText();\n        if (typeof navigator !== \"undefined\" && navigator.clipboard !== undefined) void navigator.clipboard.writeText(text).catch(() => {});\n        setCopied(true);\n        clearTimeout(timer.current);\n        timer.current = setTimeout(() => setCopied(false), COPIED_MS);\n    }, [copyText]);\n    return { copied, copy };\n}\n\n/** Copy jq: the program to the clipboard, and its check for a moment. */\nfunction CopyJq({ copyText, label, done, iconOnly, styles }: {\n    copyText: () => string; label: string; done: string; iconOnly: boolean; styles: Styles;\n}) {\n    const { copied, copy } = useCopy(copyText);\n    const words = copied ? done : label;\n    return (\n        <Tip label={iconOnly ? words : \"\"}>\n            <Button size=\"sm\" variant=\"ghost\" css={styles.copy} data-copied={copied ? \"\" : undefined} data-query-copy=\"\"\n                aria-label={iconOnly ? words : undefined} onClick={copy}>\n                <FontAwesomeIcon icon={copied ? faCheck : faCopy} />{!iconOnly && words}\n            </Button>\n        </Tip>\n    );\n}\n\n/**\n * The ⋯ chip Copy jq and Save… fold into (#1229): Copy jq copies — the menu\n * stays open, the item showing its check for a moment, as the button does —\n * and Save… opens the save popover, which hangs from the chip.\n */\nfunction QueryMore({ copyText, onSaveAs, words }: { copyText: () => string; onSaveAs: () => void; words: QueryWords }) {\n    const m = words.messages;\n    const menu = useSlotRecipe({ key: \"menu\" })() as Styles;\n    const { copied, copy } = useCopy(copyText);\n    return (\n        <ChipMenu label={m.more()} icon={faEllipsis} data=\"data-query-more\" onSelect={(picked) => {\n            if (picked === \"copy\") copy();\n            else if (picked === \"save\") onSaveAs();\n        }}>\n            <ChakraMenu.Item value=\"copy\" closeOnSelect={false} data-copied={copied ? \"\" : undefined}>\n                <Box as=\"span\" css={menu.itemIndicator}><FontAwesomeIcon icon={copied ? faCheck : faCopy} /></Box>\n                {copied ? m.copied() : m.copyJq()}\n            </ChakraMenu.Item>\n            <ChakraMenu.Item value=\"save\">{m.saveAs()}</ChakraMenu.Item>\n        </ChipMenu>\n    );\n}\n\n/** What the Query tab's band holds: Visual · jq. */\nexport interface ViewItemOptions {\n    /** The view shown. */\n    readonly view: QueryView;\n    /** Shows a view. */\n    readonly onView: (view: QueryView) => void;\n    /** The words. */\n    readonly words: QueryWords;\n    /** The `queryBuilder` recipe's styles. */\n    readonly styles: Styles;\n    /** The `seg` recipe's styles. */\n    readonly seg: Styles;\n}\n\n/**\n * Visual · jq, an item of the Query tab's band (`Query Editor Spec.md` §4.2):\n * the `seg` strip, folding to its icons.\n *\n * @param options - The view, what picking one does, the words and the styles ({@link ViewItemOptions})\n * @returns The item\n */\nexport function viewToolbarItem(options: ViewItemOptions): ToolbarItem {\n    const { view, onView, words, styles, seg } = options;\n    const m = words.messages;\n    const views = (iconsOnly: boolean) => (\n        <Box css={seg.root} role=\"group\" aria-label={m.viewLabel()} data-query-view={view}>\n            {([\"visual\", \"jq\"] as const).map((v) => {\n                const pressed = v === view;\n                const label = m.view({ view: v });\n                return (\n                    <chakra.button key={v} type=\"button\" css={seg.item} data-state={pressed ? \"on\" : \"off\"} aria-pressed={pressed}\n                        {...(iconsOnly ? { \"aria-label\": label, title: label } : {})} onClick={() => onView(v)}>\n                        <Box as=\"span\" css={styles.viewIcon} aria-hidden><FontAwesomeIcon icon={v === \"visual\" ? faDiagramProject : faCode} /></Box>\n                        {!iconsOnly && <span>{label}</span>}\n                    </chakra.button>\n                );\n            })}\n        </Box>\n    );\n    return { key: \"view\", side: \"start\", forms: [views(false), views(true)], rank: RANK_VIEW, version: view };\n}\n\n/**\n * The builder's toolbar items — see the module docs.\n *\n * @param options - The history item, the result's controls, the save popover, the run, and the words ({@link QueryToolbarOptions})\n * @returns The items, in their order along the row\n */\nexport function queryToolbarItems(options: QueryToolbarOptions): ToolbarItem[] {\n    const { history, copyText, save, saveFrom, onSaveAs, saving, running, onRun, words, styles } = options;\n    const m = words.messages;\n    const run = (keys: boolean) => (\n        <Tip label={m.runTip()}>\n            <Button size=\"sm\" variant=\"solid\" loading={running} loadingText={m.running()} data-query-run=\"\" onClick={onRun}>\n                <FontAwesomeIcon icon={faPlay} />{m.run()}{keys && <Kbd>{m.runKeys()}</Kbd>}\n            </Button>\n        </Tip>\n    );\n    // At the row's floor: the icon alone, named Run, its spinner alone while a run goes.\n    const runIcon = (\n        <Tip label={m.runTip()}>\n            <Button size=\"sm\" variant=\"solid\" loading={running} aria-label={m.run()} data-query-run=\"\" onClick={onRun}>\n                <FontAwesomeIcon icon={faPlay} />\n            </Button>\n        </Tip>\n    );\n    const copy = (iconOnly: boolean) => (\n        <CopyJq copyText={copyText} label={m.copyJq()} done={m.copied()} iconOnly={iconOnly} styles={styles} />\n    );\n    return [\n        history,\n        { key: \"copy\", side: \"end\", forms: [copy(false), copy(true), null], rank: [RANK_COPY, RANK_MORE], bundle: [undefined, MORE_BUNDLE] },\n        { key: \"save\", side: \"end\", forms: [save, null], rank: RANK_MORE, bundle: MORE_BUNDLE, held: saving },\n        // The save popover hangs from whichever of Save… and the ⋯ chip shows: open, it holds them both.\n        {\n            key: \"more\", side: \"end\", rank: RANK_MORE, bundle: MORE_BUNDLE, held: saving,\n            forms: [null, saveFrom(<QueryMore copyText={copyText} onSaveAs={onSaveAs} words={words} />)],\n        },\n        { key: \"run\", side: \"end\", forms: [run(true), run(false), runIcon], rank: [RANK_RUN_KEYS, FLOOR_RANK], version: running },\n    ];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The pane's Query tab (#936) — the open query as steps, or as jq\n * (`Query Editor Spec.md` §4.2, §4.3, §4.8), under its band: **Visual · jq**,\n * at the top of the tab's body, where a `Library`'s band holds its search box\n * — the Library's own band, the shared toolbar's row:\n *\n * - **visual**: the notices — what just happened, as dismissible banners —\n *   then the steps' scroller: the source's card, and after it and after every\n *   step its shape line; \"Add a step to narrow, reshape or total the rows, or\n *   start from a saved query.\" while there are none; and the foot, with Add a\n *   step at the end and Quick add;\n * - **jq**: the note, while visual steps are left out or the jq does not\n *   parse, then the jq view's editor (#937), filling the tab. Leaving it is\n *   one gesture.\n *\n * What it draws and does is {@link useQueryEditor}'s.\n *\n * @packageDocumentation\n */\n\nimport { Fragment, memo, useMemo } from \"react\";\nimport { Box, useSlotRecipe } from \"@chakra-ui/react\";\nimport { BannerView, Toolbar } from \"@elaraai/east-ui-components\";\nimport { QueryFoot } from \"./foot.js\";\nimport { JqEditor } from \"./jq-editor.js\";\nimport type { PartStyles, Styles } from \"./parts.js\";\nimport { ShapeLineView } from \"./shape-line.js\";\nimport { SourceCardView } from \"./source.js\";\nimport { StepCard } from \"./step-card.js\";\nimport { viewToolbarItem } from \"./toolbar.js\";\nimport type { QueryEditor } from \"./use-query-editor.js\";\n\n/** Props of {@link QueryTabPanel}. */\nexport interface QueryTabPanelProps {\n    /** Editing the open query: what the tab draws, and does. */\n    readonly editor: QueryEditor;\n    /** The parts' styles, and the words. */\n    readonly ps: PartStyles;\n    /** The workspace the data sources are read in, when the builder knows it. */\n    readonly workspace: string | undefined;\n    /** The step an issue the history item went to is on. */\n    readonly focus: string | undefined;\n}\n\n/**\n * Renders the Query tab — see the module docs.\n *\n * @param props - The editor, the styles, the workspace and the focus ({@link QueryTabPanelProps})\n * @returns The tab\n */\nexport const QueryTabPanel = memo(function QueryTabPanel({ editor, ps, workspace, focus }: QueryTabPanelProps) {\n    const { styles, words } = ps;\n    const m = words.messages;\n    // The band a Library draws over its cards, so Visual · jq sits where a Library's search box does.\n    const band = useSlotRecipe({ key: \"library\" })() as Styles;\n    const seg = useSlotRecipe({ key: \"seg\" })() as Styles;\n    const { view, setView } = editor;\n    const items = useMemo(() => [viewToolbarItem({ view, onView: setView, words, styles, seg })], [view, setView, words, styles, seg]);\n    // One view offered, no band: there is nothing to choose.\n    const bar = editor.views.length > 1 && (\n        <Box css={band.toolbar} data-slot=\"toolbar\" data-query-tab-bar=\"\">\n            <Toolbar items={items} />\n        </Box>\n    );\n    if (editor.view === \"jq\" && editor.jqChecked !== undefined) {\n        return (\n            <Box css={styles.tab} data-query-tab=\"query\" data-mode=\"jq\">\n                {bar}\n                {editor.jqNote !== undefined && (\n                    <Box css={styles.notices}><BannerView status=\"warning\" title={editor.jqNote} /></Box>\n                )}\n                <JqEditor text={editor.jqText} checked={editor.jqChecked} root={editor.root} summaries={editor.summaries} ps={ps}\n                    onText={editor.onJqText} onLeave={editor.leaveJq} onFix={editor.onJqFix} />\n            </Box>\n        );\n    }\n    const { source, cards, actions } = editor;\n    return (\n        <Box css={styles.tab} data-query-tab=\"query\" data-mode=\"visual\">\n            {bar}\n            <Box css={styles.notices}>\n                {editor.notices.map((notice) => (\n                    <BannerView key={notice.id} status=\"info\" title={notice.text} dismissible onDismiss={() => editor.dismiss(notice.id)} />\n                ))}\n            </Box>\n            <Box css={styles.steps} role=\"group\" aria-label={m.stepsLabel()} data-query-steps=\"\">\n                {source !== undefined && (\n                    <>\n                        <SourceCardView card={source} source={editor.query.source} workspace={workspace} ps={ps} />\n                        <ShapeLineView shape={source.shape} at={0} ps={ps} onSlot={actions.onSlot} />\n                    </>\n                )}\n                {cards.map((card) => (\n                    <Fragment key={card.stepId}>\n                        <StepCard card={card} count={cards.length} focused={focus === card.stepId} ps={ps} actions={actions} />\n                        <ShapeLineView shape={card.shape} at={card.index + 1} ps={ps} onSlot={actions.onSlot} />\n                    </Fragment>\n                ))}\n                {cards.length === 0 && <Box as=\"p\" css={styles.empty} data-query-empty=\"\">{m.noSteps()}</Box>}\n            </Box>\n            <QueryFoot options={editor.quick} ps={ps} onSlot={actions.onSlot} onQuick={editor.onQuick} />\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The query builder's parts on a phone (`Query Builder Phone Spec.md`): the\n * first row ({@link phoneQueryToolbar}, QP1–QP4) — Table · Tree, the count line\n * that opens *This result*, and Run — and the band of one notice over the pane\n * strip ({@link QueryLiveBand}, QP16). *This result* (QP34) is a\n * `SliceEditPopover` in the toolbar, which a phone's frame opens as a view over\n * the builder: the query, what it gives, the run and what it read, how it read\n * them, and its downloads.\n *\n * @packageDocumentation\n */\n\nimport { memo, useMemo, useState, type ReactNode } from \"react\";\nimport { Box, Button, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCaretDown, faCheck, faDownload, faPlay, faSitemap, faTableList, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport { SliceEditPopover, type ToolbarItem } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { planBadge, planWords, type QueryWords } from \"./model/words.js\";\nimport { resultFileName, resultFooter, type DownloadFormat, type ResultView } from \"./results.js\";\nimport type { RunState } from \"./run.js\";\n\n/** The narrowest frame whose Table · Tree says its words (QP2). */\nconst SEG_WORDS_FROM = 366;\n\n/** What a phone's first row holds, and does. */\nexport interface PhoneToolbarOptions {\n    readonly history: ToolbarItem;\n    readonly state: RunState;\n    readonly view: ResultView | undefined;\n    /** The count of the result kept under a run that gave none (5e). */\n    readonly keptCount: string | undefined;\n    readonly onView: (view: ResultView) => void;\n    /** The result's views this builder offers, in the switch's order: Table · Tree shows only where there are two. */\n    readonly views: readonly ResultView[];\n    readonly onDownload: (format: DownloadFormat) => void;\n    readonly onRun: () => void;\n    /** The query's name. */\n    readonly name: string;\n    /** The builder's width, px. */\n    readonly width: number;\n    readonly words: QueryWords;\n}\n\n/** A run's result, when it gave one. */\nconst output = (state: RunState) => (state.status === \"done\" ? state.output : undefined);\n\n/** The first row, one item (QP1). */\nconst QueryPhoneBar = memo(function QueryPhoneBar({ state, view, keptCount, onView, views, onDownload, onRun, name, width, words }: Omit<PhoneToolbarOptions, \"history\">) {\n    const styles = useSlotStyles(\"queryPhone\");\n    const m = words.messages;\n    const [open, setOpen] = useState(false);\n    const footer = resultFooter(state, words);\n    const running = state.status === \"running\";\n    const hasResult = state.status === \"done\" || state.status === \"failed\";\n    const icons = width < SEG_WORDS_FROM;\n    const off = view === undefined;\n    // A result read a page at a time is not in the browser to download (#1113).\n    const noDownload = off || output(state)?.paged !== undefined;\n    const planned = state.status === \"idle\" ? undefined : state.planned;\n    const pieces = state.status === \"done\" ? state.pieces : undefined;\n    const progress = running ? state.progress : undefined;\n    const lines = useMemo(() => (planned === undefined ? [] : planWords(planned.explanation, words, { progress, pieces })), [planned, words, progress, pieces]);\n    const badge = planned === undefined ? undefined : planBadge(planned, words, { progress, pieces });\n    const row = (key: string, text: ReactNode, mono = false) => text === \"\" ? null : (\n        <Box css={styles.resultRow}>\n            <Box as=\"span\" css={styles.resultKey}>{key}</Box>\n            <Box as=\"span\" css={styles.resultValue} data-mono={mono ? \"\" : undefined}>{text}</Box>\n        </Box>\n    );\n    const fieldCount = footer.fields === \"\" ? 0 : footer.fields.split(\",\").length;\n    const givesLine = fieldCount === 0 ? footer.count : `${footer.count} · ${words.formatters.number(fieldCount)} ${fieldCount === 1 ? \"field\" : \"fields\"}`;\n    const runLine = footer.run.replace(/^run /, \"\");\n    const reads = footer.reads.replace(/^reads /, \"\").split(\" · \").filter((part) => part !== \"\");\n    const countText = state.status === \"idle\" ? m.notRunYet() : running ? \"…\" : output(state) === undefined ? keptCount ?? footer.count : footer.count;\n    const trigger = (\n        <chakra.button type=\"button\" css={styles.countTarget} disabled={!hasResult} data-query-count=\"\" aria-label={hasResult ? m.thisResult() : undefined}>\n            <Box as=\"span\" css={styles.count} data-idle={state.status === \"idle\" ? \"\" : undefined}>\n                <span>{countText}</span>\n                {hasResult && <FontAwesomeIcon icon={faCaretDown} aria-hidden />}\n            </Box>\n        </chakra.button>\n    );\n    return (\n        <Box css={styles.bar} data-query-phone-bar=\"\">\n            {views.length > 1 && <Box css={styles.seg} role=\"group\" aria-label={m.resultViewLabel()} data-query-result-view={view}>\n                {views.map((v) => (\n                    <chakra.button key={v} type=\"button\" css={styles.segItem} data-state={v === view ? \"on\" : \"off\"} data-icons={icons ? \"\" : undefined} aria-pressed={v === view} disabled={off}\n                        {...(icons ? { \"aria-label\": m.resultView({ view: v }) } : {})} onClick={() => onView(v)}>\n                        <Box as=\"span\" css={styles.segIcon} aria-hidden><FontAwesomeIcon icon={v === \"table\" ? faTableList : faSitemap} /></Box>\n                        {!icons && <span>{m.resultView({ view: v })}</span>}\n                    </chakra.button>\n                ))}\n            </Box>}\n            <SliceEditPopover open={open} onOpenChange={setOpen} trigger={trigger}\n                label={<>{m.thisResult()} {footer.run !== \"\" && <Box as=\"span\" css={styles.viewContext}>{footer.run.split(\" · \").slice(0, 2).join(\" · \")}</Box>}</>}>\n                <Box css={styles.result} data-query-this-result=\"\">\n                    <Box css={styles.resultSection}>\n                        <Box css={styles.resultHead}>{m.thisResult()}</Box>\n                        {row(m.thisResultQuery(), name)}\n                        {row(m.thisResultGives(), givesLine)}\n                        {row(m.thisResultRun(), runLine, true)}\n                        {reads.length > 0 && row(m.thisResultReads(), <>{reads.map((source, i) => <Box as=\"span\" key={i} display=\"block\">{source}</Box>)}</>, true)}\n                    </Box>\n                    {badge !== undefined && (\n                        <Box css={styles.resultSection}>\n                            <Box css={styles.resultHead}>{m.planTitle()}</Box>\n                            <Box as=\"ul\" css={styles.resultLines} data-query-plan={planned?.kind}>\n                                {lines.map((line, i) => <li key={i}>{line.text}{line.code !== undefined && <code>{line.code}</code>}</li>)}\n                            </Box>\n                        </Box>\n                    )}\n                    <Box css={styles.resultSection}>\n                        <Box css={styles.resultHead}>{m.thisResultDownload()}</Box>\n                        <Box css={styles.resultActions}>\n                            {([\"csv\", \"beast2\"] as const).map((format) => (\n                                <Button key={format} size=\"md\" variant=\"outline\" css={styles.resultAction} disabled={noDownload} data-query-download-format={format}\n                                    onClick={() => onDownload(format)}><FontAwesomeIcon icon={faDownload} />{m.downloadFormat({ format })}</Button>\n                            ))}\n                        </Box>\n                        <Box css={styles.resultNote}>{m.savedAs({ slug: resultFileName(name) })}</Box>\n                    </Box>\n                </Box>\n            </SliceEditPopover>\n            <chakra.button type=\"button\" css={styles.runTarget} aria-busy={running ? true : undefined} data-query-run=\"\" onClick={onRun}>\n                <Box as=\"span\" css={styles.run}>\n                    {running ? <Box as=\"span\" css={styles.runLive} aria-hidden /> : <Box as=\"span\" css={styles.runIcon} aria-hidden><FontAwesomeIcon icon={faPlay} /></Box>}\n                    {m.run()}\n                </Box>\n            </chakra.button>\n        </Box>\n    );\n});\n\n/**\n * A phone's first row (QP1): the history for the second row, and one item of\n * Table · Tree, the count line and Run.\n *\n * @param options - What the row holds ({@link PhoneToolbarOptions})\n * @returns The items\n */\nexport function phoneQueryToolbar(options: PhoneToolbarOptions): ToolbarItem[] {\n    const { history, ...rest } = options;\n    return [history, { key: \"query.phone\", forms: [null], phone: { form: <QueryPhoneBar {...rest} />, grow: true } }];\n}\n\n/** Props of {@link QueryLiveBand}. */\nexport interface QueryLiveBandProps {\n    readonly text: string;\n    /** A save's notice, its mark the success ink's. */\n    readonly saved: boolean;\n    readonly onDismiss: () => void;\n    readonly words: QueryWords;\n}\n\n/**\n * The band over the pane strip (QP16): one notice until another replaces it or\n * × dismisses it. It describes main, so a pane's view covers it.\n *\n * @param props - The notice ({@link QueryLiveBandProps})\n * @returns The band\n */\nexport const QueryLiveBand = memo(function QueryLiveBand({ text, saved, onDismiss, words }: QueryLiveBandProps) {\n    const styles = useSlotStyles(\"queryPhone\");\n    return (\n        <Box css={styles.live} role=\"status\" data-footer-live=\"\" data-footer-ambient=\"\" data-query-live=\"\">\n            {saved ? <Box as=\"span\" css={styles.liveCheck} aria-hidden><FontAwesomeIcon icon={faCheck} /></Box> : <Box as=\"span\" css={styles.liveDot} aria-hidden />}\n            <Box as=\"span\" css={styles.liveText}>{text}</Box>\n            <chakra.button type=\"button\" css={styles.liveClose} aria-label={words.messages.dismissNotice()} onClick={onDismiss}><FontAwesomeIcon icon={faXmark} /></chakra.button>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Editing steps (#933): pure functions from a query to a new one, every value\n * built with East's constructors; the fixes the check offers, applied; and a\n * new step of each kind with its defaults (`Query Editor Spec.md` §4.4).\n *\n * @packageDocumentation\n */\n\nimport {\n    SortedMap, StringType, compareFor, isTypeEqual, none, some, variant,\n    type EastType, type option,\n} from \"@elaraai/east\";\nimport type { StepFix } from \"./check.js\";\nimport { comparisonsFor, defaultComparison, fieldByRef, fieldsOf, fieldsOfRecord, type StepField } from \"./fields.js\";\nimport { layOutSteps, itemShape } from \"./print.js\";\nimport { baseType, optionPayload, singular, unwrapRecursive, type Shape } from \"./shape.js\";\nimport {\n    comparison, freshId, type Aggregate, type Condition, type Match, type Step, type StepKind, type StepOf, type StepQuery, type StepValue,\n} from \"./values.js\";\n\n/** A query with one step replaced. */\nfunction mapStep(query: StepQuery, stepId: string, update: (step: Step) => Step): StepQuery {\n    return { source: query.source, steps: query.steps.map(s => s.value.id === stepId ? update(s) : s) };\n}\n\n/** A filter's conditions replaced. */\nfunction mapFilter(query: StepQuery, stepId: string, update: (filter: StepOf<\"filter\">) => StepOf<\"filter\">): StepQuery {\n    return mapStep(query, stepId, s => s.type === \"filter\" ? update(s) : s);\n}\n\n/** Conditions with one, wherever it is, replaced by what `update` gives; `undefined` removes it. */\nfunction mapConditions(conds: readonly Condition[], id: string, update: (c: Condition) => Condition | undefined): Condition[] {\n    const out: Condition[] = [];\n    for (const c of conds) {\n        if (c.value.id === id) {\n            const next = update(c);\n            if (next !== undefined) out.push(next);\n        } else if (c.type === \"group\") {\n            out.push(variant(\"group\", { ...c.value, conds: mapConditions(c.value.conds, id, update) }) as Condition);\n        } else if (c.value.inner.type === \"some\") {\n            const inner = mapConditions([c.value.inner.value], id, update);\n            out.push(variant(\"test\", { ...c.value, inner: inner.length === 0 ? none : some(inner[0]!) }) as Condition);\n        } else {\n            out.push(c);\n        }\n    }\n    return out;\n}\n\n/** The opposite match. */\nfunction opposite(match: Match): Match {\n    return variant(match.type === \"all\" ? \"any\" : \"all\", null);\n}\n\n/**\n * An empty test, its slots not chosen.\n *\n * @param id - its id; a fresh one when omitted\n * @returns the condition\n */\nexport function emptyCondition(id: string = freshId(\"condition\")): Condition {\n    return variant(\"test\", { id, field: none, cmp: none, value: none, inner: none, whole: false }) as Condition;\n}\n\n/**\n * A query with a step inserted.\n *\n * @param query - the query\n * @param step - the step\n * @param at - where: before the step at this index; at the end when omitted\n * @returns the new query\n */\nexport function insertStep(query: StepQuery, step: Step, at?: number): StepQuery {\n    const steps = [...query.steps];\n    steps.splice(at ?? steps.length, 0, step);\n    return { source: query.source, steps };\n}\n\n/** A query without a step. */\nexport function removeStep(query: StepQuery, stepId: string): StepQuery {\n    return { source: query.source, steps: query.steps.filter(s => s.value.id !== stepId) };\n}\n\n/**\n * A query with a step moved.\n *\n * @param query - the query\n * @param stepId - the step\n * @param by - how many places, up (negative) or down; a move past an end is no move\n * @returns the new query\n */\nexport function moveStep(query: StepQuery, stepId: string, by: number): StepQuery {\n    const i = query.steps.findIndex(s => s.value.id === stepId);\n    const j = i + by;\n    if (i < 0 || j < 0 || j >= query.steps.length) return query;\n    const steps = [...query.steps];\n    const [step] = steps.splice(i, 1);\n    steps.splice(j, 0, step!);\n    return { source: query.source, steps };\n}\n\n/** A query with a step replaced whole: the step given keeps its place. */\nexport function updateStep(query: StepQuery, stepId: string, step: Step): StepQuery {\n    return mapStep(query, stepId, () => step);\n}\n\n/**\n * A query with an empty condition added to a filter, or to a group in it.\n *\n * @param query - the query\n * @param stepId - the filter\n * @param groupId - the group; the filter itself when omitted\n * @param id - the new condition's id; a fresh one when omitted\n * @returns the new query\n */\nexport function addCondition(query: StepQuery, stepId: string, groupId?: string, id: string = freshId(\"condition\")): StepQuery {\n    return mapFilter(query, stepId, s => {\n        if (groupId === undefined) return variant(\"filter\", { ...s.value, conds: [...s.value.conds, emptyCondition(id)] });\n        return variant(\"filter\", {\n            ...s.value,\n            conds: mapConditions(s.value.conds, groupId, g => g.type === \"group\" ? variant(\"group\", { ...g.value, conds: [...g.value.conds, emptyCondition(id)] }) as Condition : g),\n        });\n    });\n}\n\n/**\n * A query with a group added to a filter, or to a group in it: the opposite\n * match to where it is, with two empty conditions.\n *\n * @param query - the query\n * @param stepId - the filter\n * @param groupId - the group it goes in; the filter itself when omitted\n * @returns the new query\n */\nexport function addGroup(query: StepQuery, stepId: string, groupId?: string): StepQuery {\n    const make = (parent: Match): Condition => variant(\"group\", { id: freshId(\"condition\"), match: opposite(parent), conds: [emptyCondition(), emptyCondition()] }) as Condition;\n    return mapFilter(query, stepId, s => {\n        if (groupId === undefined) return variant(\"filter\", { ...s.value, conds: [...s.value.conds, make(s.value.match)] });\n        return variant(\"filter\", {\n            ...s.value,\n            conds: mapConditions(s.value.conds, groupId, g => g.type === \"group\" ? variant(\"group\", { ...g.value, conds: [...g.value.conds, make(g.value.match)] }) as Condition : g),\n        });\n    });\n}\n\n/** A query without a condition, wherever it is in a filter. */\nexport function removeCondition(query: StepQuery, stepId: string, condId: string): StepQuery {\n    return mapFilter(query, stepId, s => variant(\"filter\", { ...s.value, conds: mapConditions(s.value.conds, condId, () => undefined) }));\n}\n\n/** Conditions with each group of a match taken apart into them. */\nfunction dissolve(conds: readonly Condition[], match: Match): Condition[] {\n    return conds.flatMap(c => c.type === \"group\" && c.value.match.type === match.type ? c.value.conds : [c]);\n}\n\n/**\n * A query with a filter's or a group's match changed. A group inside it of\n * the same match is no group any more, and its conditions join it.\n *\n * @param query - the query\n * @param stepId - the filter\n * @param groupId - the group; the filter itself when omitted\n * @param match - the new match\n * @returns the new query\n */\nexport function setMatch(query: StepQuery, stepId: string, groupId: string | undefined, match: Match): StepQuery {\n    return mapFilter(query, stepId, s => {\n        if (groupId === undefined) return variant(\"filter\", { ...s.value, match, conds: dissolve(s.value.conds, match) });\n        return variant(\"filter\", {\n            ...s.value,\n            conds: mapConditions(s.value.conds, groupId, g => g.type === \"group\" ? variant(\"group\", { ...g.value, match, conds: dissolve(g.value.conds, match) }) as Condition : g),\n        });\n    });\n}\n\n/** A query with a test's slots updated. */\nfunction updateTest(query: StepQuery, stepId: string, condId: string, update: (test: Extract<Condition, { type: \"test\" }>[\"value\"]) => Extract<Condition, { type: \"test\" }>[\"value\"]): StepQuery {\n    return mapFilter(query, stepId, s => variant(\"filter\", {\n        ...s.value,\n        conds: mapConditions(s.value.conds, condId, c => c.type === \"test\" ? variant(\"test\", update(c.value)) as Condition : c),\n    }));\n}\n\n/** A query with a condition's value set. */\nexport function setConditionValue(query: StepQuery, stepId: string, condId: string, value: option<StepValue>): StepQuery {\n    return updateTest(query, stepId, condId, t => ({ ...t, value }));\n}\n\n/** The shape of the rows a step takes, and those a condition in it tests. */\nfunction shapesAt(query: StepQuery, stepId: string, root: EastType): { before: Shape; conditionShape: (condId: string) => Shape } {\n    const layout = layOutSteps(query, root);\n    const laid = layout.steps.find(s => s.step.value.id === stepId);\n    const before = laid?.before ?? layout.source;\n    const conditionShape = (condId: string): Shape => {\n        const step = laid?.step;\n        if (step?.type !== \"filter\") return before;\n        const find = (conds: readonly Condition[], shape: Shape): Shape | undefined => {\n            for (const c of conds) {\n                if (c.value.id === condId) return shape;\n                if (c.type === \"group\") {\n                    const inside = find(c.value.conds, shape);\n                    if (inside !== undefined) return inside;\n                } else if (c.value.inner.type === \"some\") {\n                    const ref = c.value.field.type === \"some\" ? c.value.field.value : undefined;\n                    const inside = find([c.value.inner.value], itemShape(ref === undefined ? undefined : fieldByRef(shape, ref)));\n                    if (inside !== undefined) return inside;\n                }\n            }\n            return undefined;\n        };\n        return find(step.value.conds, before) ?? before;\n    };\n    return { before, conditionShape };\n}\n\n/** Whether two kinds of field take the same comparisons and values: the same kind, or both numbers. */\nfunction sameKind(a: StepField, b: StepField): boolean {\n    const number = (f: StepField): boolean => f.kind === \"int\" || f.kind === \"num\";\n    return a.kind === b.kind || (number(a) && number(b));\n}\n\n/**\n * A query with a condition's field set. A new field of the kind the old one\n * was (a whole number and a number are one kind here) keeps the comparison\n * and the value; another starts from its own comparison (is in year for a\n * date, has at least 1 for a list, …).\n *\n * @param query - the query\n * @param stepId - the filter\n * @param condId - the condition\n * @param field - the new field's ref\n * @param root - the root's type\n * @returns the new query\n */\nexport function setConditionField(query: StepQuery, stepId: string, condId: string, field: string, root: EastType): StepQuery {\n    const shape = shapesAt(query, stepId, root).conditionShape(condId);\n    const next = fieldByRef(shape, field);\n    return updateTest(query, stepId, condId, t => {\n        const old = t.field.type === \"some\" ? fieldByRef(shape, t.field.value) : undefined;\n        const keeps = old !== undefined && next !== undefined && sameKind(old, next)\n            && t.cmp.type === \"some\" && comparisonsFor(next).includes(t.cmp.value.type);\n        if (keeps) return { ...t, field: some(field), whole: false };\n        const cmp = next === undefined ? none : some(comparison(defaultComparison(next)));\n        return {\n            ...t,\n            field: some(field),\n            cmp,\n            value: next?.kind === \"list\" ? some(variant(\"number\", 1)) : none,\n            inner: next?.kind === \"list\" ? t.inner : none,\n            whole: false,\n        };\n    });\n}\n\n/** A query with a field set in one of a step's slots, as a fix names it. */\nfunction setSlotField(query: StepQuery, fix: Extract<StepFix, { kind: \"setField\" }>, root: EastType): StepQuery {\n    if (fix.condId !== undefined) return setConditionField(query, fix.stepId, fix.condId, fix.field, root);\n    return mapStep(query, fix.stepId, s => {\n        switch (s.type) {\n            case \"group\":\n                if (fix.slot === \"by\") return variant(\"group\", { ...s.value, by: some(variant(\"field\", fix.field)) });\n                return variant(\"group\", { ...s.value, aggs: s.value.aggs.map(a => a.id === fix.id ? { ...a, field: some(fix.field) } : a) });\n            case \"pick\":\n                return variant(\"pick\", { ...s.value, fields: s.value.fields.map(p => p.id === fix.id ? { ...p, field: some(fix.field) } : p) });\n            case \"lookup\":\n                // A field brought in is named by itself, the slot's id.\n                return fix.slot === \"key\" ? variant(\"lookup\", { ...s.value, key: some(fix.field) })\n                    : fix.slot === \"dataset\" ? variant(\"lookup\", { ...s.value, dataset: some(fix.field) })\n                    : fix.slot === \"fields\" ? variant(\"lookup\", { ...s.value, fields: s.value.fields.map(f => f === fix.id ? fix.field : f) }) : s;\n            case \"sort\": return variant(\"sort\", { ...s.value, field: some(fix.field) });\n            case \"fill\": return variant(\"fill\", { ...s.value, field: some(fix.field) });\n            case \"drill\": return variant(\"drill\", { ...s.value, field: some(fix.field) });\n            case \"datepart\": return variant(\"datepart\", { ...s.value, field: some(fix.field) });\n            default: return s;\n        }\n    });\n}\n\n/** A test that a variant field is one of its cases. */\nfunction caseCondition(field: string, caseName: string): Condition {\n    return variant(\"test\", {\n        id: freshId(\"condition\"), field: some(field), cmp: some(comparison(\"eq\")), value: some(variant(\"text\", caseName)), inner: none, whole: false,\n    }) as Condition;\n}\n\n/** Whether a condition tests a variant field for one case. */\nfunction isCaseTest(c: Condition, field: string): boolean {\n    return c.type === \"test\" && !c.value.whole && c.value.field.type === \"some\" && c.value.field.value === field\n        && c.value.cmp.type === \"some\" && c.value.cmp.value.type === \"eq\";\n}\n\n/**\n * A query with a fix the check offers applied.\n *\n * @param query - the query\n * @param fix - the fix\n * @param root - the root's type\n * @returns the new query\n *\n * @remarks\n * Keep only a case's rows first puts `field is case` at the front of the\n * filter the problem is in (in place of a case test of that field), and an\n * any filter becomes all of it and the old conditions as a group; for a step\n * of another kind, a filter of it goes before the step.\n */\nexport function applyFix(query: StepQuery, fix: StepFix, root: EastType): StepQuery {\n    switch (fix.kind) {\n        case \"removeStep\":\n            return removeStep(query, fix.stepId);\n        case \"setValue\":\n            return setConditionValue(query, fix.stepId, fix.condId, some(fix.value));\n        case \"unwhole\":\n            return updateTest(query, fix.stepId, fix.condId, t => ({ ...t, whole: false }));\n        case \"setField\":\n            return setSlotField(query, fix, root);\n        case \"addCaseCondition\": {\n            const step = query.steps.find(s => s.value.id === fix.stepId);\n            const condition = caseCondition(fix.field, fix.case);\n            if (step?.type === \"filter\") {\n                return mapFilter(query, fix.stepId, s => s.value.match.type === \"any\"\n                    ? variant(\"filter\", { ...s.value, match: variant(\"all\", null), conds: [condition, variant(\"group\", { id: freshId(\"condition\"), match: variant(\"any\", null), conds: s.value.conds }) as Condition] })\n                    : variant(\"filter\", { ...s.value, conds: [condition, ...s.value.conds.filter(c => !isCaseTest(c, fix.field))] }));\n            }\n            const at = query.steps.findIndex(s => s.value.id === fix.stepId);\n            return insertStep(query, variant(\"filter\", { id: freshId(\"step\"), match: variant(\"all\", null), conds: [condition] }), at < 0 ? undefined : at);\n        }\n        case \"editJq\":\n            return mapStep(query, fix.stepId, s => {\n                if (s.type !== \"jq\") return s;\n                let text = s.value.text.trim();\n                for (const e of [...fix.edits].sort((a, b) => b.from - a.from)) text = text.slice(0, e.from) + e.insert + text.slice(e.to);\n                return variant(\"jq\", { ...s.value, text });\n            });\n    }\n}\n\n/** The fields a row has that a new step can start from. */\nfunction plainFields(before: Shape): StepField[] {\n    return fieldsOf(before).filter(f => f.payload === undefined);\n}\n\n/**\n * The Look up a new step starts with: the first bound lookup table a field of\n * the rows can key, preferring one named after the field (`customer_id` for\n * `customers`); its first value field.\n */\nfunction defaultLookup(before: Shape, root: EastType): { dataset: string; key: string; field: string } | undefined {\n    const rootStruct = unwrapRecursive(root);\n    if (rootStruct.type !== \"Struct\") return undefined;\n    const candidates: { dataset: string; key: StepField; field: string; named: boolean }[] = [];\n    for (const [dataset, type] of Object.entries(rootStruct.fields as Record<string, EastType>)) {\n        const dict = unwrapRecursive(type);\n        if (dict.type !== \"Dict\") continue;\n        const value = fieldsOfRecord(dict.value as EastType, new Map());\n        const keys = plainFields(before).filter(f => isTypeEqual(f.type, dict.key as EastType));\n        if (value.length === 0 || keys.length === 0) continue;\n        const named = keys.find(k => k.ref === `${singular(dataset)}_id` || k.ref === singular(dataset));\n        candidates.push({ dataset, key: named ?? keys[0]!, field: value[0]!.ref, named: named !== undefined });\n    }\n    const pick = candidates.find(c => c.named) ?? candidates[0];\n    return pick === undefined ? undefined : { dataset: pick.dataset, key: pick.key.ref, field: pick.field };\n}\n\n/** The list of parts a tree's node holds: a list field whose items are the tree's own nodes. */\nfunction treeList(before: Shape): string | undefined {\n    const node = unwrapRecursive(before.type);\n    if (node.type !== \"Struct\") return undefined;\n    const lists = fieldsOfRecord(node, new Map()).filter(f => f.kind === \"list\");\n    const own = lists.find(f => f.element !== undefined && isTypeEqual(unwrapRecursive(f.element), node));\n    return (own ?? lists[0])?.ref;\n}\n\n/**\n * A new step of a kind, with the defaults it starts with\n * (`Query Editor Spec.md` §4.4).\n *\n * @param kind - the kind of step\n * @param before - the shape of the rows it will take\n * @param root - the root's type, whose lookup tables a Look up starts from\n * @returns the step, with fresh ids\n */\nexport function newStep(kind: StepKind, before: Shape, root: EastType): Step {\n    const id = freshId(\"step\");\n    const fields = fieldsOf(before);\n    const ref = (f: StepField | undefined): option<string> => f === undefined ? none : some(f.ref);\n    switch (kind) {\n        case \"filter\":\n            return variant(\"filter\", { id, match: variant(\"all\", null), conds: [emptyCondition()] });\n        case \"lookup\": {\n            const found = defaultLookup(before, root);\n            return variant(\"lookup\", {\n                id, dataset: found === undefined ? none : some(found.dataset), key: found === undefined ? none : some(found.key),\n                fields: found === undefined ? [] : [found.field],\n            });\n        }\n        case \"group\": {\n            const count: Aggregate = { id: freshId(\"aggregate\"), fn: variant(\"count\", null), field: none, as: \"count\" };\n            return variant(\"group\", { id, by: none, aggs: [count] });\n        }\n        case \"sort\":\n            return variant(\"sort\", { id, field: none, dir: variant(\"desc\", null) });\n        case \"limit\":\n            return variant(\"limit\", { id, n: variant(\"number\", 10) });\n        case \"count\":\n            return variant(\"count\", { id });\n        case \"pick\":\n            return variant(\"pick\", {\n                id,\n                fields: fields.filter(f => f.payload === undefined && f.kind !== \"list\").slice(0, 3).map(f => ({ id: freshId(\"pick\"), field: some(f.ref), as: f.name })),\n            });\n        case \"fill\": {\n            const optional = fields.find(f => f.optional && f.payload === undefined);\n            const zero = optional !== undefined && (optional.kind === \"int\" || optional.kind === \"num\");\n            return variant(\"fill\", { id, field: ref(optional), value: zero ? some(variant(\"number\", 0)) : none });\n        }\n        case \"drill\":\n            return variant(\"drill\", { id, field: ref(fields.find(f => f.kind === \"list\")) });\n        case \"datepart\": {\n            const date = fields.find(f => f.kind === \"date\");\n            const as = date === undefined ? \"month\" : `${date.payload?.case ?? date.name}_month`;\n            return variant(\"datepart\", { id, field: ref(date), part: variant(\"month\", null), as });\n        }\n        case \"walk\": {\n            const via = treeList(before);\n            return variant(\"walk\", { id, via: via === undefined ? none : some(via) });\n        }\n        case \"tabulate\": {\n            const fn = unwrapRecursive(before.type);\n            const input = fn.type === \"Function\" && (fn.inputs as EastType[]).length === 1 ? unwrapRecursive((fn.inputs as EastType[])[0]!) : undefined;\n            const inputs = input?.type === \"Struct\" ? Object.entries(input.fields as Record<string, EastType>) : [];\n            const over = inputs.find(([, t]) => baseType(t).type === \"Float\")?.[0] ?? inputs[0]?.[0] ?? \"x\";\n            // Every other input starts from a value of its type, for the author to set.\n            const fixed = new SortedMap<string, StepValue>(inputs.filter(([name]) => name !== over).map(([name, t]): [string, StepValue] => {\n                const b = baseType(t);\n                const value: StepValue = optionPayload(t) !== undefined ? variant(\"null\", null)\n                    : b.type === \"Integer\" || b.type === \"Float\" ? variant(\"number\", 0)\n                    : b.type === \"Boolean\" ? variant(\"boolean\", false)\n                    : variant(\"text\", \"\");\n                return [name, value];\n            }), compareFor(StringType));\n            return variant(\"tabulate\", {\n                id, over, from: variant(\"number\", 10), to: variant(\"number\", 12), step: variant(\"number\", 0.5), fixed, as: \"result\",\n            });\n        }\n        case \"jq\":\n            return variant(\"jq\", { id, text: \".\" });\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Slots and autocomplete (#934): what each slot of a step card offers, grouped,\n * with details and meta (`Query Editor Spec.md` §4.5); the steps that fit at a\n * point, and why the others don't; and what picking an offer, typing in an\n * input, removing and adding do — each one gesture of the editing session\n * (#935), as a function from a query value to a query value.\n *\n * @packageDocumentation\n */\n\nimport {\n    FloatType, SortedMap, StringType, compareFor, equalFor, isTypeEqual, none, parseFor, some, variant,\n    type EastType,\n} from \"@elaraai/east\";\nimport { QueryStepValueType } from \"@elaraai/e3-ui/internal\";\nimport { checkSteps, conditionIn, datasetType } from \"../steps/check.js\";\nimport {\n    addCondition, addGroup, emptyCondition, insertStep, newStep, removeCondition, setConditionField, setConditionValue, setMatch,\n} from \"../steps/edit.js\";\nimport { comparisonsFor, defaultComparison, fieldByRef, fieldsOf, fieldsOfRecord, type FieldKind, type StepField } from \"../steps/fields.js\";\nimport { defaultTotalName } from \"../steps/parse.js\";\nimport { itemShape, layOutSteps, narrowingOf } from \"../steps/print.js\";\nimport { baseType, singular, unwrapRecursive, type Shape } from \"../steps/shape.js\";\nimport {\n    comparison, freshId, needsValue,\n    type Aggregate, type ComparisonKind, type Condition, type Step, type StepInput, type StepKind, type StepOf, type StepQuery,\n    type StepValue, type TestCondition,\n} from \"../steps/values.js\";\nimport { cardsFor, firstEmptySlot } from \"./cards.js\";\nimport type { TotalName } from \"./messages.js\";\nimport type { ActionRef, InputRef, RemoveRef, SlotRef, SlotValue } from \"./refs.js\";\nimport { leafOf, type Summary } from \"./summaries.js\";\nimport {\n    STEP_ICON, dataNumber, fieldKind, fieldLabel, fieldSummaryWords, human, orderKind, plural, rowsWords, shapeWords, type QueryWords,\n} from \"./words.js\";\n\n/** One offer of a slot's list. */\nexport interface SlotItem {\n    /** What picking it sets. */\n    readonly value: SlotValue;\n    /** Its label. */\n    readonly label: string;\n    /** A sub-line: a field's kind, a step's hint. */\n    readonly detail?: string;\n    /** A note: a payload field's case, or why a step is disabled. */\n    readonly note?: string;\n    /** A meta at the end: a summary, a count, a stat. */\n    readonly meta?: string;\n    /** The group it is listed under. */\n    readonly group: string;\n    /** Its icon. */\n    readonly icon?: string;\n    /** Whether it is listed but cannot be picked. */\n    readonly disabled?: boolean;\n    /** Whether it is the value typed, offered first. */\n    readonly typed?: boolean;\n    /** Whether its label reads as data: a number, an ID, a date. */\n    readonly mono?: boolean;\n}\n\n/** A saved query a builder can open, for the add-step list of a query with no steps. */\nexport interface SavedOffer {\n    /** Its name. */\n    readonly name: string;\n    /** The data source it starts from. */\n    readonly source: string;\n    /** When it was saved or run, in words. */\n    readonly when?: string;\n    /** Whether it is a recent run rather than a saved query. */\n    readonly recent?: boolean;\n}\n\n/** What a slot's offers draw on. */\nexport interface SlotContext {\n    /** The words. */\n    readonly words: QueryWords;\n    /** The summary of the rows the slot's step takes, once fetched. */\n    readonly summary?: Summary;\n    /** The saved queries this builder can open (#935's `QueryInternal.rootBound`). */\n    readonly saved?: readonly SavedOffer[];\n    /** Each lookup table's size, by name, where the builder knows it. */\n    readonly sizes?: ReadonlyMap<string, number>;\n}\n\n/** What picking does: the query after, the slot it opens next, and a step added or a saved query to open. */\nexport interface SlotResult {\n    /** The query after. */\n    readonly query: StepQuery;\n    /** The slot to open next, if any. */\n    readonly open?: SlotRef;\n    /** The step added, for the builder to scroll to. */\n    readonly added?: string;\n    /** A saved query picked from the add-step list: the builder opens it (§4.13). */\n    readonly opened?: string;\n}\n\n/** The kinds Group and total groups by, and Sort sorts by. */\nconst ORDERED: readonly FieldKind[] = [\"text\", \"int\", \"num\", \"date\", \"case\", \"bool\"];\n\n/** How many text values a value slot offers. */\nconst TOP_VALUES = 12;\n\n/** Whether an offer matches the text typed. */\nfunction matches(text: string, ...labels: readonly string[]): boolean {\n    const t = text.trim().toLowerCase();\n    return t === \"\" || labels.some(l => l.toLowerCase().includes(t));\n}\n\n// ─── Where a slot is ─────────────────────────────────────────────────────────\n\n/** A slot's place: its step, the rows the step takes, and the condition and its rows. */\ninterface SlotPlace {\n    readonly step: Step | undefined;\n    readonly index: number;\n    readonly before: Shape;\n    readonly condition: Condition | undefined;\n    /** The rows the condition tests: the step's, or a list's items. */\n    readonly shape: Shape;\n    /** The list a condition inside has any where reads the items of. */\n    readonly list: StepField | undefined;\n}\n\n/** The list a condition's rows are the items of, when it sits inside has any where. */\nfunction listOf(conds: readonly Condition[], id: string, shape: Shape): StepField | undefined {\n    for (const c of conds) {\n        if (c.type === \"group\") {\n            const inside = listOf(c.value.conds, id, shape);\n            if (inside !== undefined) return inside;\n        } else if (c.value.inner.type === \"some\" && c.value.field.type === \"some\") {\n            const list = fieldByRef(shape, c.value.field.value);\n            const inner = c.value.inner.value;\n            if (inner.value.id === id) return list;\n            const deeper = listOf([inner], id, itemShape(list));\n            if (deeper !== undefined) return deeper;\n        }\n    }\n    return undefined;\n}\n\n/** Finds a slot's place. */\nfunction placeOf(query: StepQuery, root: EastType, slot: SlotRef): SlotPlace {\n    const layout = layOutSteps(query, root);\n    const index = slot.kind === \"add-step\" ? (slot.at ?? query.steps.length) : query.steps.findIndex(s => s.value.id === slot.stepId);\n    const before = layout.steps[index]?.before ?? layout.final;\n    const step = query.steps[index];\n    if (step?.type !== \"filter\" || slot.condId === undefined) return { step, index, before, condition: undefined, shape: before, list: undefined };\n    const found = conditionIn(step.value.conds, slot.condId, before);\n    return { step, index, before, condition: found?.condition, shape: found?.shape ?? before, list: listOf(step.value.conds, slot.condId, before) };\n}\n\n/**\n * The rows a condition's field is picked in: the step's, narrowed by the\n * case conditions of an all filter around it — as its jq prints them, each\n * in a select of its own first.\n */\nfunction narrowedFor(place: SlotPlace): Shape {\n    const step = place.step;\n    if (step?.type !== \"filter\" || step.value.match.type !== \"all\" || place.list !== undefined) return place.shape;\n    const narrowed = new Map(place.shape.narrowed);\n    for (const c of step.value.conds) {\n        if (c.value.id === place.condition?.value.id) continue;\n        const n = narrowingOf(c, place.before);\n        if (n?.case !== undefined) narrowed.set(n.field, n.case);\n    }\n    return { ...place.shape, narrowed };\n}\n\n/** A test's field, in its rows. */\nfunction testField(place: SlotPlace, test: TestCondition | undefined): StepField | undefined {\n    return test?.value.field.type === \"some\" ? fieldByRef(narrowedFor(place), test.value.field.value) : undefined;\n}\n\n/** The condition a slot is on, as a test. */\nfunction testOf(place: SlotPlace): TestCondition | undefined {\n    return place.condition?.type === \"test\" ? place.condition : undefined;\n}\n\n// ─── Offers ──────────────────────────────────────────────────────────────────\n\n/** The fields of some rows, as a field slot offers them. */\nfunction fieldItems(shape: Shape, ctx: SlotContext, text: string, opts: { kinds?: readonly FieldKind[]; exclude?: readonly string[]; list?: StepField; pick?: (f: StepField) => boolean } = {}): SlotItem[] {\n    const m = ctx.words.messages;\n    const items: SlotItem[] = [];\n    for (const f of fieldsOf(shape)) {\n        if (opts.kinds !== undefined && !opts.kinds.includes(f.kind)) continue;\n        if (opts.exclude?.includes(f.ref) === true) continue;\n        if (opts.pick !== undefined && !opts.pick(f)) continue;\n        const label = fieldLabel(f);\n        if (!matches(text, label, f.name)) continue;\n        const meta = fieldSummaryWords(f, leafOf(ctx.summary, f, opts.list), ctx.words);\n        const note = f.payload !== undefined && !f.payload.narrowed ? m.onlyCase({ rows: rowsWords(shape, ctx.words, undefined, f.payload.case) }) : undefined;\n        const group = opts.list !== undefined ? m.eachGroup({ noun: singular(opts.list.name) })\n            : f.payload !== undefined ? m.insideGroup({ parent: human(f.payload.parent) })\n            : m.fieldsGroup();\n        items.push({\n            value: { kind: \"field\", ref: f.ref }, label, detail: fieldKind(f, ctx.words), group,\n            ...(meta === \"\" ? {} : { meta }), ...(note === undefined ? {} : { note }),\n        });\n    }\n    return items;\n}\n\n/** A number typed, read as the locale writes it: group separators dropped. */\nfunction readNumber(raw: string, words: QueryWords): number | undefined {\n    const { group, decimal } = words.formatters.separators;\n    const text = raw.trim().split(group).join(\"\").split(decimal).join(\".\");\n    if (text === \"\") return undefined;\n    const read = parseFor(FloatType)(text);\n    return read.success ? read.value : undefined;\n}\n\n/** A value typed: a number where the slot takes one, else text. */\nfunction typedValue(raw: string, numeric: boolean, words: QueryWords): StepValue {\n    const n = numeric ? readNumber(raw, words) : undefined;\n    return n === undefined ? variant(\"text\", raw.trim()) : variant(\"number\", n);\n}\n\n/** The value typed, offered first unless an offer already says it. */\nfunction withTyped(items: SlotItem[], text: string, numeric: boolean, ctx: SlotContext): SlotItem[] {\n    const t = text.trim();\n    if (t === \"\" || items.some(i => i.label.toLowerCase() === t.toLowerCase())) return items;\n    return [{ value: { kind: \"value\", value: typedValue(t, numeric, ctx.words) }, label: ctx.words.messages.useTyped({ text: t }), group: ctx.words.messages.typedGroup(), typed: true }, ...items];\n}\n\n/** The values a condition's value slot offers, from the summary (§4.5). */\nfunction valueItems(place: SlotPlace, test: TestCondition, ctx: SlotContext, text: string): SlotItem[] {\n    const m = ctx.words.messages;\n    const f = ctx.words.formatters;\n    const field = testField(place, test);\n    const cmp = test.value.cmp.type === \"some\" ? test.value.cmp.value.type : undefined;\n    if (field === undefined || cmp === undefined) return withTyped([], text, false, ctx);\n    const leaf = leafOf(ctx.summary, field, place.list);\n    const rows = (n: bigint): string => m.countRows({ count: f.number(n), rows: rowsWords(place.shape, ctx.words, Number(n)) });\n    const numeric = cmp === \"inYear\" || cmp === \"lengthAtLeast\" || ((field.kind === \"int\" || field.kind === \"num\") && cmp !== \"missing\" && cmp !== \"present\");\n    let items: SlotItem[] = [];\n    if (field.kind === \"case\") {\n        const counts = leaf?.cases.type === \"some\" ? leaf.cases.value : [];\n        items = (field.cases ?? []).map(c => {\n            const n = counts.find(x => x.value === c)?.n;\n            return { value: { kind: \"value\", value: variant(\"text\", c) }, label: c, group: m.casesGroup(), ...(n === undefined ? {} : { meta: rows(n) }) };\n        });\n    } else if (cmp === \"inYear\") {\n        const years = leaf?.dates.type === \"some\" ? leaf.dates.value.years : [];\n        items = years.map(y => ({ value: { kind: \"value\", value: variant(\"number\", Number(y.value)) }, label: f.bare(y.value), meta: rows(y.n), group: m.yearsGroup(), mono: true }));\n    } else if (cmp === \"inMonth\" || cmp === \"onOrAfter\" || cmp === \"before\") {\n        const months = leaf?.dates.type === \"some\" ? leaf.dates.value.months : [];\n        items = months.map(mo => cmp === \"inMonth\"\n            ? { value: { kind: \"value\", value: variant(\"text\", mo.value) }, label: mo.value, meta: rows(mo.n), group: m.monthsGroup(), mono: true }\n            : { value: { kind: \"value\", value: variant(\"text\", `${mo.value}-01`) }, label: `${mo.value}-01`, meta: m.startOfMonth({ rows: rows(mo.n) }), group: m.monthsGroup(), mono: true });\n    } else if (cmp === \"lengthAtLeast\") {\n        items = [1, 2, 3, 4].map(n => ({ value: { kind: \"value\", value: variant(\"number\", n) }, label: f.bare(n), meta: m.itemsWord({ n }), group: m.itemsGroup(), mono: true }));\n    } else if (field.kind === \"text\") {\n        const values = leaf?.values.type === \"some\" ? leaf.values.value : [];\n        items = values.slice(0, TOP_VALUES).map(v => ({ value: { kind: \"value\", value: variant(\"text\", v.value) }, label: v.value, meta: rows(v.n), group: m.valuesGroup() }));\n    } else if ((field.kind === \"int\" || field.kind === \"num\") && leaf?.numbers.type === \"some\") {\n        const s = leaf.numbers.value;\n        const round = (x: number): number => (field.kind === \"int\" ? Math.round(x) : Math.round(x * 100) / 100);\n        const stats: [(\"lowest\" | \"median\" | \"average\" | \"highest\"), number][] = [[\"lowest\", s.min], [\"median\", s.median], [\"average\", s.mean], [\"highest\", s.max]];\n        items = stats.map(([stat, x]) => ({\n            value: { kind: \"value\", value: variant(\"number\", round(x)) }, label: dataNumber(round(x), field, ctx.words), meta: m.stat({ stat }), group: m.fromDataGroup(), mono: true,\n        }));\n    }\n    return withTyped(items.filter(i => matches(text, i.label)), text, numeric, ctx);\n}\n\n/** The totals a total's function offers: adding up and averaging only for numbers. */\nfunction totalItems(field: StepField | undefined, ctx: SlotContext, text: string): SlotItem[] {\n    const m = ctx.words.messages;\n    const number = field === undefined || field.kind === \"int\" || field.kind === \"num\";\n    const fns: TotalName[] = [\"sum\", \"count\", \"mean\", \"min\", \"max\", \"distinct\"];\n    return fns\n        .filter(fn => number || (fn !== \"sum\" && fn !== \"mean\"))\n        .map(fn => ({ value: { kind: \"total\", fn } as const, label: m.total({ fn }), group: m.totalGroup() }))\n        .filter(i => matches(text, i.label));\n}\n\n/** The kinds a total's field takes. */\nfunction totalKinds(fn: TotalName): readonly FieldKind[] | undefined {\n    switch (fn) {\n        case \"sum\": case \"mean\": return [\"int\", \"num\"];\n        case \"min\": case \"max\": return [\"int\", \"num\", \"date\", \"text\"];\n        default: return undefined;\n    }\n}\n\n/** A Look up's lookup table, when its dataset is one. */\nfunction lookupTable(root: EastType, step: StepOf<\"lookup\">): { key: EastType; value: EastType } | undefined {\n    const dataset = step.value.dataset.type === \"some\" ? step.value.dataset.value : undefined;\n    const table = dataset === undefined ? undefined : datasetType(root, dataset);\n    const dict = table === undefined ? undefined : unwrapRecursive(table);\n    return dict?.type === \"Dict\" ? { key: dict.key as EastType, value: dict.value as EastType } : undefined;\n}\n\n/** The lookup tables the root holds. */\nfunction lookupTables(root: EastType): { name: string; type: EastType }[] {\n    const struct = unwrapRecursive(root);\n    if (struct.type !== \"Struct\") return [];\n    return Object.entries(struct.fields as Record<string, EastType>).filter(([, t]) => unwrapRecursive(t).type === \"Dict\").map(([name, type]) => ({ name, type }));\n}\n\n/** A step that can be added, and whether it fits. */\nexport interface StepOption {\n    /** The step's kind. */\n    readonly kind: StepKind;\n    /** Its label in the add-step list. */\n    readonly label: string;\n    /** Its hint. */\n    readonly hint: string;\n    /** The words the list's filter matches. */\n    readonly keywords: string;\n    /** Its icon. */\n    readonly icon: string;\n    /** Whether it fits the shape there. */\n    readonly fits: boolean;\n    /** Why not, when it does not. */\n    readonly reason: string;\n}\n\n/** The steps the add-step list offers, in order. */\nconst ADDABLE: readonly StepKind[] = [\"filter\", \"lookup\", \"group\", \"sort\", \"limit\", \"count\", \"pick\", \"fill\", \"drill\", \"datepart\", \"walk\", \"tabulate\"];\n\n/** The steps Quick add offers (§4.3): the common ones, and the tree's and the model's where they fit. */\nconst QUICK: readonly StepKind[] = [\"filter\", \"group\", \"sort\", \"limit\", \"pick\"];\n\n/**\n * The steps that can be added at a point, and why the others cannot\n * (`Query Editor Spec.md` §4.5).\n *\n * @param shape - the shape there\n * @param root - the root's type, whose lookup tables a Look up reads\n * @param words - the words\n * @returns every step of the add-step list, each saying whether it fits\n */\nexport function stepOptions(shape: Shape, root: EastType, words: QueryWords): StepOption[] {\n    const m = words.messages;\n    const rows = shape.kind === \"rows\";\n    const fields = fieldsOf(shape);\n    const has = (kind: FieldKind): boolean => fields.some(f => f.kind === kind && f.payload === undefined);\n    const keys = lookupTables(root).map(t => (unwrapRecursive(t.type) as Extract<EastType, { type: \"Dict\" }>).key as EastType);\n    const fn = unwrapRecursive(shape.type);\n    const fits = (kind: StepKind): boolean => {\n        switch (kind) {\n            case \"lookup\": return rows && fields.some(f => f.payload === undefined && keys.some(k => isTypeEqual(k, baseType(f.type)) && !f.optional));\n            case \"fill\": return rows && fields.some(f => f.optional && f.payload === undefined);\n            case \"drill\": return rows && has(\"list\");\n            case \"datepart\": return rows && fields.some(f => f.kind === \"date\");\n            case \"walk\": return shape.kind === \"one\" && shape.type.type === \"Recursive\";\n            case \"tabulate\": return shape.kind === \"one\" && fn.type === \"Function\" && (fn.inputs as EastType[]).length === 1;\n            default: return rows;\n        }\n    };\n    const shapeText = shapeWords(shape, words);\n    const lower = shapeText.length === 0 ? shapeText : shapeText.charAt(0).toLowerCase() + shapeText.slice(1);\n    return ADDABLE.map(kind => {\n        const ok = fits(kind);\n        const reason = ok ? \"\" : kind === \"walk\" ? m.needsTree() : kind === \"tabulate\" ? m.needsCalculation() : rows ? m.nothingToUse() : m.needsRows({ shape: lower });\n        return {\n            kind, label: m.addStepLabel({ kind, noun: shape.noun }), hint: m.addStepHint({ kind }), keywords: m.addStepKeywords({ kind }),\n            icon: STEP_ICON[kind], fits: ok, reason,\n        };\n    });\n}\n\n/**\n * The Quick add buttons at a point (§4.3): Keep rows, Group and total, Sort\n * by, Keep the first and Show only fields, and List every part and Try the\n * model where they fit.\n *\n * @param shape - the shape at the end of the query\n * @param root - the root's type\n * @param words - the words\n * @returns the buttons, each saying whether it fits\n */\nexport function quickAddOptions(shape: Shape, root: EastType, words: QueryWords): StepOption[] {\n    const all = stepOptions(shape, root, words);\n    return all\n        .filter(o => QUICK.includes(o.kind) || ((o.kind === \"walk\" || o.kind === \"tabulate\") && o.fits))\n        .map(o => ({ ...o, label: words.messages.quickAddLabel({ kind: o.kind }) }));\n}\n\n/** Whether a slot holds a value: its offers are values, typed or offered. */\nfunction inputKindOf(place: SlotPlace, slot: SlotRef): EastType | undefined {\n    const step = place.step;\n    if (step?.type !== \"tabulate\" || slot.id === undefined) return undefined;\n    const fn = unwrapRecursive(place.before.type);\n    const input = fn.type === \"Function\" && (fn.inputs as EastType[]).length === 1 ? unwrapRecursive((fn.inputs as EastType[])[0]!) : undefined;\n    return input?.type === \"Struct\" ? (input.fields as Record<string, EastType>)[slot.id] : undefined;\n}\n\n/**\n * What a slot offers (`Query Editor Spec.md` §4.5): every row of the table,\n * filtered by the text typed.\n *\n * @param query - the query\n * @param root - the root's type: a struct of the data sources\n * @param slot - the slot\n * @param text - what is typed in its filter\n * @param ctx - the words, the summary of the rows there, the saved queries a builder can open and the lookup tables' sizes\n * @returns the offers, in their groups' order; disabled ones carry their reason\n */\nexport function slotItems(query: StepQuery, root: EastType, slot: SlotRef, text: string, ctx: SlotContext): SlotItem[] {\n    const m = ctx.words.messages;\n    const place = placeOf(query, root, slot);\n    const step = place.step;\n    const test = testOf(place);\n    switch (slot.kind) {\n        case \"match\": case \"group-match\":\n            return ([\"all\", \"any\"] as const).map(match => ({ value: { kind: \"match\", match }, label: m.match({ match }), detail: m.matchDetail({ match }), group: m.matchGroup() }));\n        case \"field\": {\n            if (slot.id === \"inner\") {\n                const list = testField(place, test);\n                return fieldItems(itemShape(list), ctx, text, list === undefined ? {} : { list });\n            }\n            return fieldItems(narrowedFor(place), ctx, text, place.list === undefined ? {} : { list: place.list });\n        }\n        case \"cmp\": {\n            const field = testField(place, test);\n            if (field === undefined) return [];\n            return comparisonsFor(field)\n                .map(cmp => {\n                    const detail = m.comparisonDetail({ cmp });\n                    return { value: { kind: \"cmp\", cmp } as const, label: m.comparison({ cmp }), group: m.compareGroup(), ...(detail === \"\" ? {} : { detail }) };\n                })\n                .filter(i => matches(text, i.label));\n        }\n        case \"value\":\n            return test === undefined ? [] : valueItems(place, test, ctx, text);\n        case \"key\": {\n            if (step?.type !== \"lookup\") return [];\n            const table = lookupTable(root, step);\n            return fieldItems(place.before, ctx, text, {\n                pick: f => f.payload === undefined && (table === undefined ? f.kind === \"text\" : isTypeEqual(table.key, baseType(f.type))),\n            });\n        }\n        case \"dataset\":\n            return lookupTables(root)\n                .filter(t => matches(text, t.name))\n                .map(t => {\n                    const n = ctx.sizes?.get(t.name);\n                    return {\n                        value: { kind: \"dataset\", name: t.name } as const, label: t.name, group: m.datasetsGroup(),\n                        ...(n === undefined ? {} : { meta: m.entries({ count: ctx.words.formatters.number(n), noun: n === 1 ? singular(t.name) : plural(singular(t.name)) }) }),\n                    };\n                });\n        case \"lookup-add\": {\n            if (step?.type !== \"lookup\") return [];\n            const table = lookupTable(root, step);\n            if (table === undefined) return [];\n            const dataset = step.value.dataset.type === \"some\" ? step.value.dataset.value : \"\";\n            return fieldsOfRecord(table.value, new Map())\n                .filter(f => f.payload === undefined && !step.value.fields.includes(f.ref) && matches(text, human(f.name)))\n                .map(f => ({ value: { kind: \"lookup-field\", name: f.ref } as const, label: human(f.name), detail: fieldKind(f, ctx.words), group: m.fromDatasetGroup({ dataset }) }));\n        }\n        case \"by\": {\n            const all: SlotItem[] = matches(text, m.allRowsTogether())\n                ? [{ value: { kind: \"all-rows\" }, label: m.allRowsTogether(), detail: m.oneRowOfTotals(), group: m.groupGroup() }]\n                : [];\n            return [...all, ...fieldItems(place.before, ctx, text, { kinds: ORDERED, pick: f => f.payload === undefined || f.payload.narrowed })];\n        }\n        case \"agg-fn\": {\n            if (step?.type !== \"group\") return [];\n            const agg = step.value.aggs.find(a => a.id === slot.id);\n            const field = agg !== undefined && agg.fn.type !== \"count\" && agg.field.type === \"some\" ? fieldByRef(place.before, agg.field.value) : undefined;\n            return totalItems(field, ctx, text);\n        }\n        case \"agg-field\": {\n            if (step?.type !== \"group\") return [];\n            const agg = step.value.aggs.find(a => a.id === slot.id);\n            const kinds = agg === undefined ? undefined : totalKinds(agg.fn.type);\n            return fieldItems(place.before, ctx, text, kinds === undefined ? {} : { kinds });\n        }\n        case \"sort-field\":\n            return fieldItems(place.before, ctx, text, { kinds: ORDERED });\n        case \"dir\": {\n            if (step?.type !== \"sort\") return [];\n            const field = step.value.field.type === \"some\" ? fieldByRef(place.before, step.value.field.value) : undefined;\n            return ([\"desc\", \"asc\"] as const).map(dir => ({ value: { kind: \"dir\", dir }, label: m.direction({ dir, kind: orderKind(field) }), group: m.orderGroup() }));\n        }\n        case \"pick-field\": case \"pick-add\": {\n            const chosen = step?.type === \"pick\" ? step.value.fields.flatMap(p => p.field.type === \"some\" ? [p.field.value] : []) : [];\n            return fieldItems(place.before, ctx, text, slot.kind === \"pick-add\" ? { exclude: chosen } : {});\n        }\n        case \"fill-field\":\n            return fieldItems(place.before, ctx, text, { pick: f => f.optional && f.payload === undefined });\n        case \"drill-field\":\n            return fieldItems(place.before, ctx, text, { kinds: [\"list\"] });\n        case \"via\": {\n            const node = unwrapRecursive(place.before.type);\n            return fieldsOfRecord(node, new Map())\n                .filter(f => f.kind === \"list\" && matches(text, human(f.name)))\n                .map(f => ({ value: { kind: \"field\", ref: f.ref } as const, label: human(f.name), detail: fieldKind(f, ctx.words), group: m.fieldsGroup() }));\n        }\n        case \"part\":\n            return ([\"year\", \"month\", \"weekday\"] as const)\n                .map(part => ({ value: { kind: \"part\", part } as const, label: m.part({ part }), meta: m.partExample({ part }), group: m.partGroup() }))\n                .filter(i => matches(text, i.label));\n        case \"date-field\":\n            return fieldItems(place.before, ctx, text, { kinds: [\"date\"] });\n        case \"fixed\": {\n            const type = inputKindOf(place, slot);\n            const numeric = type !== undefined && (baseType(type).type === \"Float\" || baseType(type).type === \"Integer\");\n            return withTyped([], text, numeric, ctx);\n        }\n        case \"add-step\": {\n            const options = stepOptions(place.before, root, ctx.words)\n                .filter(o => matches(text, o.label, o.keywords))\n                .map((o): SlotItem => ({\n                    value: { kind: \"step\", step: o.kind }, label: o.label, detail: o.hint, icon: o.icon, group: m.addStepGroup(),\n                    ...(o.fits ? {} : { disabled: true, note: o.reason }),\n                }));\n            const saved = query.steps.length === 0\n                ? (ctx.saved ?? []).filter(s => s.source === query.source && matches(text, s.name)).slice(0, 5).map((s): SlotItem => ({\n                    value: { kind: \"saved\", name: s.name }, label: s.name, icon: s.recent === true ? \"clock-rotate-left\" : \"bookmark\", group: m.savedGroup(),\n                    ...(s.when === undefined ? {} : { detail: s.when }),\n                }))\n                : [];\n            return [...options, ...saved];\n        }\n    }\n}\n\n// ─── The slot's own words ────────────────────────────────────────────────────\n\n/**\n * A slot's popover label — `FIELD`, `COMPARE` as the design system sets it.\n *\n * @param slot - the slot\n * @param words - the words\n * @returns the label\n */\nexport function slotLabel(slot: SlotRef, words: QueryWords): string {\n    return words.messages.slotLabel({ slot: slot.kind });\n}\n\n/**\n * A slot's filter placeholder: `Type or pick a value`, `Type to filter`.\n *\n * @param slot - the slot\n * @param words - the words\n * @returns the placeholder\n */\nexport function slotPlaceholder(slot: SlotRef, words: QueryWords): string {\n    return words.messages.slotPlaceholder({ slot: slot.kind });\n}\n\n/**\n * A slot's footer: where its offers come from — `Fields from the checked type`.\n *\n * @param slot - the slot\n * @param words - the words\n * @returns the hint\n */\nexport function slotHint(slot: SlotRef, words: QueryWords): string {\n    return words.messages.slotHint({ slot: slot.kind });\n}\n\n/**\n * What a slot says with nothing to offer: `Type a value, then press ⏎.`\n *\n * @param slot - the slot\n * @param words - the words\n * @returns the words\n */\nexport function slotEmpty(slot: SlotRef, words: QueryWords): string {\n    return words.messages.slotEmpty({ slot: slot.kind });\n}\n\n// ─── The active offer ────────────────────────────────────────────────────────\n\nconst valueEqual = equalFor(QueryStepValueType);\n\n/** What a slot holds now, as an offer would set it. */\nfunction currentValue(query: StepQuery, root: EastType, slot: SlotRef): SlotValue | undefined {\n    const place = placeOf(query, root, slot);\n    const step = place.step;\n    const test = testOf(place);\n    switch (slot.kind) {\n        case \"match\": return step?.type === \"filter\" ? { kind: \"match\", match: step.value.match.type } : undefined;\n        case \"group-match\": return place.condition?.type === \"group\" ? { kind: \"match\", match: place.condition.value.match.type } : undefined;\n        case \"field\": return test?.value.field.type === \"some\" && slot.id !== \"inner\" ? { kind: \"field\", ref: test.value.field.value } : undefined;\n        case \"cmp\": return test?.value.cmp.type === \"some\" ? { kind: \"cmp\", cmp: test.value.cmp.value.type } : undefined;\n        case \"value\": return test?.value.value.type === \"some\" ? { kind: \"value\", value: test.value.value.value } : undefined;\n        case \"key\": return step?.type === \"lookup\" && step.value.key.type === \"some\" ? { kind: \"field\", ref: step.value.key.value } : undefined;\n        case \"dataset\": return step?.type === \"lookup\" && step.value.dataset.type === \"some\" ? { kind: \"dataset\", name: step.value.dataset.value } : undefined;\n        case \"by\":\n            if (step?.type !== \"group\" || step.value.by.type === \"none\") return undefined;\n            return step.value.by.value.type === \"all\" ? { kind: \"all-rows\" } : { kind: \"field\", ref: step.value.by.value.value };\n        case \"agg-fn\": {\n            const agg = step?.type === \"group\" ? step.value.aggs.find(a => a.id === slot.id) : undefined;\n            return agg === undefined ? undefined : { kind: \"total\", fn: agg.fn.type };\n        }\n        case \"agg-field\": {\n            const agg = step?.type === \"group\" ? step.value.aggs.find(a => a.id === slot.id) : undefined;\n            return agg?.field.type === \"some\" ? { kind: \"field\", ref: agg.field.value } : undefined;\n        }\n        case \"sort-field\": case \"fill-field\": case \"drill-field\": case \"date-field\":\n            return (step?.type === \"sort\" || step?.type === \"fill\" || step?.type === \"drill\" || step?.type === \"datepart\") && step.value.field.type === \"some\"\n                ? { kind: \"field\", ref: step.value.field.value } : undefined;\n        case \"dir\": return step?.type === \"sort\" ? { kind: \"dir\", dir: step.value.dir.type } : undefined;\n        case \"pick-field\": {\n            const pick = step?.type === \"pick\" ? step.value.fields.find(p => p.id === slot.id) : undefined;\n            return pick?.field.type === \"some\" ? { kind: \"field\", ref: pick.field.value } : undefined;\n        }\n        case \"via\": return step?.type === \"walk\" && step.value.via.type === \"some\" ? { kind: \"field\", ref: step.value.via.value } : undefined;\n        case \"part\": return step?.type === \"datepart\" ? { kind: \"part\", part: step.value.part.type } : undefined;\n        case \"fixed\": {\n            const v = step?.type === \"tabulate\" && slot.id !== undefined ? step.value.fixed.get(slot.id) : undefined;\n            return v === undefined ? undefined : { kind: \"value\", value: v };\n        }\n        default: return undefined;\n    }\n}\n\n/** Whether two offers set the same thing. */\nfunction sameValue(a: SlotValue, b: SlotValue): boolean {\n    switch (a.kind) {\n        case \"match\": return b.kind === \"match\" && a.match === b.match;\n        case \"field\": return b.kind === \"field\" && a.ref === b.ref;\n        case \"all-rows\": return b.kind === \"all-rows\";\n        case \"cmp\": return b.kind === \"cmp\" && a.cmp === b.cmp;\n        case \"value\": return b.kind === \"value\" && valueEqual(a.value, b.value);\n        case \"dataset\": return b.kind === \"dataset\" && a.name === b.name;\n        case \"lookup-field\": return b.kind === \"lookup-field\" && a.name === b.name;\n        case \"total\": return b.kind === \"total\" && a.fn === b.fn;\n        case \"dir\": return b.kind === \"dir\" && a.dir === b.dir;\n        case \"part\": return b.kind === \"part\" && a.part === b.part;\n        case \"step\": return b.kind === \"step\" && a.step === b.step;\n        case \"saved\": return b.kind === \"saved\" && a.name === b.name;\n    }\n}\n\n/**\n * The offer a slot's list opens on (§4.5): the slot's current value when it\n * is listed, else the first that can be picked.\n *\n * @param items - the offers\n * @param query - the query\n * @param root - the root's type\n * @param slot - the slot\n * @returns its index, or `-1` when none can be picked\n */\nexport function activeItem(items: readonly SlotItem[], query: StepQuery, root: EastType, slot: SlotRef): number {\n    const now = currentValue(query, root, slot);\n    const current = now === undefined ? -1 : items.findIndex(i => !i.typed && sameValue(i.value, now));\n    return current >= 0 ? current : items.findIndex(i => i.disabled !== true);\n}\n\n// ─── Picking ─────────────────────────────────────────────────────────────────\n\n/** A query with one step replaced by what `update` makes of it. */\nfunction mapStep<K extends Step[\"type\"]>(query: StepQuery, stepId: string, kind: K, update: (step: StepOf<K>) => Step): StepQuery {\n    return { source: query.source, steps: query.steps.map(s => (s.value.id === stepId && s.type === kind ? update(s as StepOf<K>) : s)) };\n}\n\n/** A query with one test's slots updated, wherever it is in a filter. */\nfunction updateTest(query: StepQuery, stepId: string, condId: string, update: (test: TestCondition[\"value\"]) => TestCondition[\"value\"]): StepQuery {\n    const visit = (conds: readonly Condition[]): Condition[] => conds.map(c => {\n        if (c.type === \"group\") return variant(\"group\", { ...c.value, conds: visit(c.value.conds) }) as Condition;\n        if (c.value.id === condId) return variant(\"test\", update(c.value)) as Condition;\n        if (c.value.inner.type === \"some\") return variant(\"test\", { ...c.value, inner: some(visit([c.value.inner.value])[0]!) }) as Condition;\n        return c;\n    });\n    return mapStep(query, stepId, \"filter\", s => variant(\"filter\", { ...s.value, conds: visit(s.value.conds) }));\n}\n\n/** A test, found by id, in a query. */\nfunction findTest(query: StepQuery, stepId: string, condId: string): TestCondition | undefined {\n    const step = query.steps.find(s => s.value.id === stepId);\n    if (step?.type !== \"filter\") return undefined;\n    const visit = (conds: readonly Condition[]): TestCondition | undefined => {\n        for (const c of conds) {\n            if (c.type === \"group\") {\n                const inside = visit(c.value.conds);\n                if (inside !== undefined) return inside;\n                continue;\n            }\n            if (c.value.id === condId) return c;\n            if (c.value.inner.type === \"some\") {\n                const inside = visit([c.value.inner.value]);\n                if (inside !== undefined) return inside;\n            }\n        }\n        return undefined;\n    };\n    return visit(step.value.conds);\n}\n\n/** Whether a comparison takes a value of its own kind — a year, a month, a count — which another comparison would misread. */\nconst OWN_VALUE: ReadonlySet<ComparisonKind> = new Set([\"inYear\", \"inMonth\", \"lengthAtLeast\"]);\n\n/** The slot a test opens next: its inner condition's field, or its value, while empty. */\nfunction nextOfTest(query: StepQuery, stepId: string, condId: string): SlotRef | undefined {\n    const test = findTest(query, stepId, condId);\n    if (test === undefined || test.value.cmp.type === \"none\") return undefined;\n    const cmp = test.value.cmp.value.type;\n    if (cmp === \"anyWhere\") {\n        const inner = test.value.inner;\n        if (inner.type === \"some\" && inner.value.type === \"test\" && inner.value.value.field.type === \"none\") return { kind: \"field\", stepId, condId: inner.value.value.id };\n        return undefined;\n    }\n    return needsValue(cmp) && test.value.value.type === \"none\" ? { kind: \"value\", stepId, condId } : undefined;\n}\n\n/** A total renamed when its name is still the one its function and field give it. */\nfunction renamed(before: Shape, agg: Aggregate, fn: TotalName, field: string | undefined): string {\n    const was = defaultTotalName(before, agg.fn.type, agg.field.type === \"some\" ? agg.field.value : undefined);\n    return agg.as === was ? defaultTotalName(before, fn, field) : agg.as;\n}\n\n/** The name a field shown takes: its own. */\nfunction shownName(before: Shape, ref: string): string {\n    return fieldByRef(before, ref)?.name ?? ref.split(\".\").pop() ?? ref;\n}\n\n/**\n * What picking an offer does (`Query Editor Spec.md` §4.5): the query after,\n * and the slot it opens next.\n *\n * @param query - the query\n * @param slot - the slot\n * @param item - the offer picked\n * @param root - the root's type\n * @param words - the words, to find an added step's first empty slot\n * @returns the query after, the slot to open, and a step added or a saved query to open\n *\n * @remarks\n * - A field keeps its comparison and value when its kind matches, and opens\n *   the value, or the inner condition's field for has any where.\n * - A comparison keeps the value unless either side is a year, a month or a\n *   count; has any where gives the condition an inner one, and opens its field.\n * - A total renames itself while its name is its own (`defaultTotalName`).\n * - A field shown is named by its own name; a date part rewrites a trailing\n *   year, month or weekday in its name.\n * - An added step takes its defaults (`newStep`) and opens its first empty slot.\n */\nexport function applySlot(query: StepQuery, slot: SlotRef, item: SlotItem, root: EastType, words: QueryWords): SlotResult {\n    const v = item.value;\n    const id = slot.stepId;\n    const place = placeOf(query, root, slot);\n    const before = place.before;\n    switch (slot.kind) {\n        case \"match\":\n            return v.kind === \"match\" ? { query: setMatch(query, id, undefined, variant(v.match, null)) } : { query };\n        case \"group-match\":\n            return v.kind === \"match\" && slot.condId !== undefined ? { query: setMatch(query, id, slot.condId, variant(v.match, null)) } : { query };\n        case \"field\": {\n            if (v.kind !== \"field\" || slot.condId === undefined) return { query };\n            if (slot.id === \"inner\") {\n                // The inner condition of has any where, made with its field.\n                const list = testField(place, testOf(place));\n                const field = fieldByRef(itemShape(list), v.ref);\n                const inner = variant(\"test\", {\n                    id: freshId(\"condition\"), field: some(v.ref), cmp: field === undefined ? none : some(comparison(defaultComparison(field))),\n                    value: field?.kind === \"list\" ? some(variant(\"number\", 1)) : none, inner: none, whole: false,\n                }) as Condition;\n                const out = updateTest(query, id, slot.condId, t => ({ ...t, inner: some(inner) }));\n                const open = nextOfTest(out, id, inner.value.id);\n                return open === undefined ? { query: out } : { query: out, open };\n            }\n            const out = setConditionField(query, id, slot.condId, v.ref, root);\n            const test = findTest(out, id, slot.condId);\n            // has any where needs its inner condition.\n            const withInner = test?.value.cmp.type === \"some\" && test.value.cmp.value.type === \"anyWhere\" && test.value.inner.type === \"none\"\n                ? updateTest(out, id, slot.condId, t => ({ ...t, inner: some(emptyCondition()) }))\n                : out;\n            const open = nextOfTest(withInner, id, slot.condId);\n            return open === undefined ? { query: withInner } : { query: withInner, open };\n        }\n        case \"cmp\": {\n            if (v.kind !== \"cmp\" || slot.condId === undefined) return { query };\n            const out = updateTest(query, id, slot.condId, t => {\n                const old = t.cmp.type === \"some\" ? t.cmp.value.type : undefined;\n                const keep = needsValue(v.cmp) && t.value.type === \"some\" && !OWN_VALUE.has(v.cmp) && (old === undefined || !OWN_VALUE.has(old));\n                return {\n                    ...t,\n                    cmp: some(comparison(v.cmp)) as typeof t.cmp,\n                    value: keep ? t.value : none,\n                    inner: v.cmp === \"anyWhere\" ? (t.inner.type === \"some\" ? t.inner : some(emptyCondition())) : none,\n                };\n            });\n            const open = nextOfTest(out, id, slot.condId);\n            return open === undefined ? { query: out } : { query: out, open };\n        }\n        case \"value\":\n            return v.kind === \"value\" && slot.condId !== undefined ? { query: setConditionValue(query, id, slot.condId, some(v.value)) } : { query };\n        case \"key\":\n            return v.kind === \"field\" ? { query: mapStep(query, id, \"lookup\", s => variant(\"lookup\", { ...s.value, key: some(v.ref) })) } : { query };\n        case \"dataset\":\n            return v.kind === \"dataset\" ? { query: mapStep(query, id, \"lookup\", s => variant(\"lookup\", { ...s.value, dataset: some(v.name) })) } : { query };\n        case \"lookup-add\":\n            return v.kind === \"lookup-field\" ? { query: mapStep(query, id, \"lookup\", s => variant(\"lookup\", { ...s.value, fields: [...s.value.fields, v.name] })) } : { query };\n        case \"by\": {\n            if (v.kind !== \"field\" && v.kind !== \"all-rows\") return { query };\n            const by = v.kind === \"all-rows\" ? variant(\"all\", null) : variant(\"field\", v.ref);\n            return { query: mapStep(query, id, \"group\", s => variant(\"group\", { ...s.value, by: some(by) as typeof s.value.by })) };\n        }\n        case \"agg-fn\": {\n            if (v.kind !== \"total\") return { query };\n            let open: SlotRef | undefined;\n            const out = mapStep(query, id, \"group\", s => variant(\"group\", {\n                ...s.value,\n                aggs: s.value.aggs.map(a => {\n                    if (a.id !== slot.id) return a;\n                    const field = v.fn === \"count\" ? none : a.field;\n                    if (v.fn !== \"count\" && field.type === \"none\") open = { kind: \"agg-field\", stepId: id, id: a.id };\n                    return { ...a, fn: variant(v.fn, null) as Aggregate[\"fn\"], field, as: renamed(before, a, v.fn, field.type === \"some\" ? field.value : undefined) };\n                }),\n            }));\n            return open === undefined ? { query: out } : { query: out, open };\n        }\n        case \"agg-field\": {\n            if (v.kind !== \"field\") return { query };\n            return {\n                query: mapStep(query, id, \"group\", s => variant(\"group\", {\n                    ...s.value,\n                    aggs: s.value.aggs.map(a => (a.id === slot.id ? { ...a, field: some(v.ref), as: renamed(before, a, a.fn.type, v.ref) } : a)),\n                })),\n            };\n        }\n        case \"sort-field\":\n            return v.kind === \"field\" ? { query: mapStep(query, id, \"sort\", s => variant(\"sort\", { ...s.value, field: some(v.ref) })) } : { query };\n        case \"dir\":\n            return v.kind === \"dir\" ? { query: mapStep(query, id, \"sort\", s => variant(\"sort\", { ...s.value, dir: variant(v.dir, null) })) } : { query };\n        case \"pick-field\":\n            return v.kind === \"field\"\n                ? { query: mapStep(query, id, \"pick\", s => variant(\"pick\", { ...s.value, fields: s.value.fields.map(p => (p.id === slot.id ? { ...p, field: some(v.ref), as: shownName(before, v.ref) } : p)) })) }\n                : { query };\n        case \"pick-add\":\n            return v.kind === \"field\"\n                ? { query: mapStep(query, id, \"pick\", s => variant(\"pick\", { ...s.value, fields: [...s.value.fields, { id: freshId(\"pick\"), field: some(v.ref), as: shownName(before, v.ref) }] })) }\n                : { query };\n        case \"fill-field\":\n            return v.kind === \"field\" ? { query: mapStep(query, id, \"fill\", s => variant(\"fill\", { ...s.value, field: some(v.ref) })) } : { query };\n        case \"drill-field\":\n            return v.kind === \"field\" ? { query: mapStep(query, id, \"drill\", s => variant(\"drill\", { ...s.value, field: some(v.ref) })) } : { query };\n        case \"via\":\n            return v.kind === \"field\" ? { query: mapStep(query, id, \"walk\", s => variant(\"walk\", { ...s.value, via: some(v.ref) })) } : { query };\n        case \"part\":\n            return v.kind === \"part\"\n                ? { query: mapStep(query, id, \"datepart\", s => variant(\"datepart\", { ...s.value, part: variant(v.part, null), as: s.value.as.replace(/(year|month|weekday)$/, v.part) })) }\n                : { query };\n        case \"date-field\":\n            return v.kind === \"field\" ? { query: mapStep(query, id, \"datepart\", s => variant(\"datepart\", { ...s.value, field: some(v.ref) })) } : { query };\n        case \"fixed\": {\n            if (v.kind !== \"value\" || slot.id === undefined) return { query };\n            const name = slot.id;\n            return {\n                query: mapStep(query, id, \"tabulate\", s => variant(\"tabulate\", {\n                    ...s.value,\n                    fixed: new SortedMap([...s.value.fixed.entries()].filter(([k]) => k !== name).concat([[name, v.value]]), compareFor(StringType)),\n                })),\n            };\n        }\n        case \"add-step\": {\n            if (v.kind === \"saved\") return { query, opened: v.name };\n            if (v.kind !== \"step\") return { query };\n            const at = slot.at ?? query.steps.length;\n            const step = newStep(v.step, before, root);\n            const out = insertStep(query, step, at);\n            const card = cardsFor(out, root, checkSteps(out, root), words).find(c => c.stepId === step.value.id);\n            const open = card === undefined ? undefined : firstEmptySlot(card);\n            return open === undefined ? { query: out, added: step.value.id } : { query: out, open, added: step.value.id };\n        }\n    }\n}\n\n// ─── Inputs, removes and adds ────────────────────────────────────────────────\n\n/** A name typed, as an identifier: runs of other characters as `_`, and `value` when nothing is left. */\nfunction identifier(raw: string): string {\n    return raw.replace(/[^\\w]+/g, \"_\").replace(/^_+|_+$/g, \"\") || \"value\";\n}\n\n/** A count or a bound typed: a number, or the text when it is not one, which the check reports. */\nfunction stepInput(raw: string, words: QueryWords): StepInput {\n    const n = readNumber(raw, words);\n    return n === undefined ? variant(\"text\", raw.trim()) : variant(\"number\", n);\n}\n\n/**\n * What typing in an input does (`Query Editor Spec.md` §4.5): counts and\n * numbers read as numbers, the locale's group separators dropped, and names\n * become identifiers.\n *\n * @param query - the query\n * @param input - the input\n * @param raw - what is typed\n * @param root - the root's type\n * @param words - the words, for the locale's separators\n * @returns the query after\n */\nexport function applyInput(query: StepQuery, input: InputRef, raw: string, root: EastType, words: QueryWords): StepQuery {\n    const id = input.stepId;\n    switch (input.kind) {\n        case \"limit-n\":\n            return mapStep(query, id, \"limit\", s => variant(\"limit\", { ...s.value, n: stepInput(raw, words) }));\n        case \"agg-as\":\n            return mapStep(query, id, \"group\", s => variant(\"group\", { ...s.value, aggs: s.value.aggs.map(a => (a.id === input.id ? { ...a, as: identifier(raw) } : a)) }));\n        case \"pick-as\":\n            return mapStep(query, id, \"pick\", s => variant(\"pick\", { ...s.value, fields: s.value.fields.map(p => (p.id === input.id ? { ...p, as: identifier(raw) } : p)) }));\n        case \"fill-value\": {\n            const place = placeOf(query, root, { kind: \"fill-field\", stepId: id });\n            const step = place.step;\n            const field = step?.type === \"fill\" && step.value.field.type === \"some\" ? fieldByRef(place.before, step.value.field.value) : undefined;\n            const numeric = field?.kind === \"int\" || field?.kind === \"num\";\n            return mapStep(query, id, \"fill\", s => variant(\"fill\", { ...s.value, value: raw.trim() === \"\" ? none : some(typedValue(raw, numeric, words)) }));\n        }\n        case \"datepart-as\":\n            return mapStep(query, id, \"datepart\", s => variant(\"datepart\", { ...s.value, as: identifier(raw) }));\n        case \"tab-from\":\n            return mapStep(query, id, \"tabulate\", s => variant(\"tabulate\", { ...s.value, from: stepInput(raw, words) }));\n        case \"tab-to\":\n            return mapStep(query, id, \"tabulate\", s => variant(\"tabulate\", { ...s.value, to: stepInput(raw, words) }));\n        case \"tab-step\":\n            return mapStep(query, id, \"tabulate\", s => variant(\"tabulate\", { ...s.value, step: stepInput(raw, words) }));\n        case \"tab-as\":\n            return mapStep(query, id, \"tabulate\", s => variant(\"tabulate\", { ...s.value, as: identifier(raw) }));\n    }\n}\n\n/**\n * What a × does: a condition or a group, a total, a field shown, or a field\n * a Look up brings in, taken out.\n *\n * @param query - the query\n * @param ref - what to take out\n * @returns the query after\n */\nexport function applyRemove(query: StepQuery, ref: RemoveRef): StepQuery {\n    switch (ref.kind) {\n        case \"condition\":\n            return removeCondition(query, ref.stepId, ref.id);\n        case \"total\":\n            return mapStep(query, ref.stepId, \"group\", s => variant(\"group\", { ...s.value, aggs: s.value.aggs.filter(a => a.id !== ref.id) }));\n        case \"pick\":\n            return mapStep(query, ref.stepId, \"pick\", s => variant(\"pick\", { ...s.value, fields: s.value.fields.filter(p => p.id !== ref.id) }));\n        case \"lookup-field\":\n            return mapStep(query, ref.stepId, \"lookup\", s => variant(\"lookup\", { ...s.value, fields: s.value.fields.filter(f => f !== ref.id) }));\n    }\n}\n\n/**\n * What an add does: a condition, a group or a total added, and the slot it\n * opens; or a slot opened, as Add field does.\n *\n * @param query - the query\n * @param ref - the add\n * @param root - the root's type\n * @returns the query after, and the slot to open\n */\nexport function applyAction(query: StepQuery, ref: ActionRef, root: EastType): { query: StepQuery; open?: SlotRef } {\n    const id = ref.stepId;\n    switch (ref.kind) {\n        case \"add-condition\": {\n            const condId = freshId(\"condition\");\n            return { query: addCondition(query, id, ref.groupId, condId), open: { kind: \"field\", stepId: id, condId } };\n        }\n        case \"add-group\": {\n            const out = addGroup(query, id, ref.groupId);\n            const step = out.steps.find(s => s.value.id === id);\n            const conds = step?.type === \"filter\" ? step.value.conds : [];\n            const holder = ref.groupId === undefined ? conds : (conds.find(c => c.value.id === ref.groupId)?.type === \"group\" ? (conds.find(c => c.value.id === ref.groupId) as Extract<Condition, { type: \"group\" }>).value.conds : []);\n            const added = holder[holder.length - 1];\n            const first = added?.type === \"group\" ? added.value.conds[0] : undefined;\n            return first === undefined ? { query: out } : { query: out, open: { kind: \"field\", stepId: id, condId: first.value.id } };\n        }\n        case \"add-total\": {\n            const before = placeOf(query, root, { kind: \"agg-field\", stepId: id }).before;\n            const agg: Aggregate = { id: freshId(\"aggregate\"), fn: variant(\"sum\", null) as Aggregate[\"fn\"], field: none, as: defaultTotalName(before, \"sum\", undefined) };\n            return { query: mapStep(query, id, \"group\", s => variant(\"group\", { ...s.value, aggs: [...s.value.aggs, agg] })), open: { kind: \"agg-field\", stepId: id, id: agg.id } };\n        }\n        case \"open\":\n            return ref.slot === undefined ? { query } : { query, open: ref.slot };\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Query view on a phone (`Query Builder Phone Spec.md` QP20–QP29), #934's\n * cards as sentences: each row of a step is one sentence in a 44 row, a tap opens\n * its slots under it as full-width rows, and one clause is open at a time across\n * the query. A step's actions open inline under ⋯. Over them the band (Visual ·\n * jq and Copy jq) and the query's head; under them the foot, its check and what\n * the query gives, Save… and Run. A slot's choices are the builder's\n * `SlotAutocomplete`, a full-height view here. Nothing floats.\n *\n * @packageDocumentation\n */\n\nimport { Fragment, memo, useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { Box, Button, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { faArrowDown, faArrowUp, faCaretDown, faCheck, faChevronDown, faCircleExclamation, faCode, faDatabase, faDiagramProject, faEllipsis, faPlay, faPlus, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport { BannerView } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { JqEditor } from \"./jq-editor.js\";\nimport type { Card, CardLine, CardPart, ProblemLine } from \"./model/cards.js\";\nimport type { SlotRef } from \"./model/refs.js\";\nimport { slotLabel } from \"./model/slots.js\";\nimport { InputPart, slotKey, type PartActions, type PartStyles } from \"./parts.js\";\nimport type { QueryNotice } from \"./use-query-editor.js\";\nimport type { QueryEditor } from \"./use-query-editor.js\";\nimport { useCopy } from \"./toolbar.js\";\nimport type { QuerySaveLine } from \"./status-line.js\";\n\ntype Styles = ReturnType<typeof useSlotStyles>;\n\n/** What a sentence reads of a part; none for what only its editor holds. */\nfunction sentencePart(part: CardPart, i: number, styles: Styles): ReactNode {\n    switch (part.t) {\n        case \"word\":\n            return part.joiner === true ? null : <Box as=\"span\" key={i} css={styles.clauseWord}>{part.text} </Box>;\n        case \"slot\":\n            // The field and the value 500 in ink; what compares them in the words' ink (QP24).\n            return part.empty\n                ? <Box as=\"span\" key={i} css={styles.clauseEmpty}>{part.placeholder} </Box>\n                : part.slot.kind === \"cmp\" ? <Box as=\"span\" key={i} css={styles.clauseWord}>{part.text} </Box>\n                : <Box as=\"span\" key={i} css={styles.clauseValue} data-mono={part.mono ? \"\" : undefined}>{part.text} </Box>;\n        case \"input\":\n            return part.value === \"\" ? null : <Box as=\"span\" key={i} css={styles.clauseValue} data-mono={part.mono ? \"\" : undefined}>{part.value} </Box>;\n        case \"chip\":\n            return <Box as=\"span\" key={i} css={styles.clauseValue}>{part.text} </Box>;\n        default:\n            return null;\n    }\n}\n\n/** A problem under its clause: the checker's words and its fix (QP26). */\nfunction PhoneProblems({ problems, styles, actions }: { problems: readonly ProblemLine[]; styles: Styles; actions: PartActions }): ReactNode {\n    return problems.map((problem, i) => (\n        <Box key={i} css={styles.problem} data-severity={problem.severity} data-query-problem={problem.code}>\n            <Box css={styles.problemLine}>\n                <Box as=\"span\" css={styles.problemIcon} aria-hidden><FontAwesomeIcon icon={faCircleExclamation} /></Box>\n                <span>{problem.text}</span>\n            </Box>\n            {problem.fixes.map((fix, j) => (\n                <Button key={j} size=\"md\" variant=\"outline\" css={styles.problemFix} data-query-fix=\"\" onClick={() => actions.onFix(fix.fix, fix.label)}>{fix.label}</Button>\n            ))}\n        </Box>\n    ));\n}\n\n/** A slot's row in an open clause: its label, then its trigger (QP25). */\nfunction SlotRow({ part, ps, actions, styles, dirty }: { part: Extract<CardPart, { t: \"slot\" }>; ps: PartStyles; actions: PartActions; styles: Styles; dirty: boolean }) {\n    const key = slotKey(part.slot);\n    return (\n        <Box css={styles.slotRow}>\n            <Box as=\"span\" css={styles.slotLabel}>{slotLabel(part.slot, ps.words)}</Box>\n            <chakra.button type=\"button\" css={styles.slotTrigger} data-slot-key={key} data-empty={part.empty ? \"\" : undefined} data-error={part.error ? \"\" : undefined} data-dirty={dirty ? \"\" : undefined}\n                data-mono={part.mono ? \"\" : undefined} aria-haspopup=\"dialog\" aria-expanded={actions.openSlot === key}\n                onClick={(event) => actions.onSlot(part.slot, event.currentTarget)}>\n                <span>{part.empty ? part.placeholder : part.text}</span>\n                <FontAwesomeIcon icon={faCaretDown} aria-hidden />\n            </chakra.button>\n        </Box>\n    );\n}\n\n/** Whether a row has anything to open. */\nfunction editable(parts: readonly CardPart[]): boolean {\n    return parts.some((p) => p.t === \"slot\" || p.t === \"input\" || p.t === \"chip\" || p.t === \"remove\");\n}\n\n/** Props of {@link Clause}. */\ninterface ClauseProps {\n    readonly id: string;\n    readonly parts: readonly CardPart[];\n    readonly problems: readonly ProblemLine[];\n    readonly open: string | undefined;\n    readonly onOpen: (id: string | undefined) => void;\n    readonly ps: PartStyles;\n    readonly actions: PartActions;\n    /** Whether a slot's value differs from what the query saved holds (QP25). */\n    readonly isDirty: (key: string, text: string) => boolean;\n}\n\n/** One clause: its sentence in a 44 row, and, open, its slots under it (QP24, QP25). */\nfunction Clause({ id, parts, problems, open, onOpen, ps, actions, isDirty }: ClauseProps) {\n    const styles = useSlotStyles(\"queryPhone\");\n    const joiner = parts.find((p): p is Extract<CardPart, { t: \"word\" }> => p.t === \"word\" && p.joiner === true);\n    const isOpen = open === id;\n    const adds = parts.filter((p): p is Extract<CardPart, { t: \"add\" }> => p.t === \"add\");\n    if (!editable(parts)) {\n        return (\n            <Box css={styles.clauseStatic} data-query-clause=\"\">\n                <Box css={styles.clauseRead}>{joiner !== undefined && <Box as=\"span\" css={styles.clauseJoiner}>{joiner.text}</Box>}<Box as=\"span\" css={styles.clauseText}>{parts.map((p, i) => sentencePart(p, i, styles))}</Box></Box>\n                {adds.map((add, i) => (\n                    <chakra.button key={i} type=\"button\" css={styles.addLink} onClick={(event) => actions.onAction(add.action, event.currentTarget)}>\n                        <FontAwesomeIcon icon={faPlus} />{add.text}\n                    </chakra.button>\n                ))}\n                <PhoneProblems problems={problems} styles={styles} actions={actions} />\n            </Box>\n        );\n    }\n    return (\n        <Box data-query-clause=\"\" data-open={isOpen ? \"\" : undefined}>\n            <chakra.button type=\"button\" css={styles.clause} aria-expanded={isOpen} onClick={() => onOpen(isOpen ? undefined : id)}>\n                <Box css={styles.clauseRead}>\n                    <Box as=\"span\" css={styles.clauseJoiner}>{joiner?.text}</Box>\n                    <Box as=\"span\" css={styles.clauseText}>{parts.map((p, i) => sentencePart(p, i, styles))}</Box>\n                </Box>\n                <Box as=\"span\" css={styles.clauseChevron} data-open={isOpen ? \"\" : undefined} aria-hidden><FontAwesomeIcon icon={faChevronDown} /></Box>\n            </chakra.button>\n            {isOpen && (\n                <Box css={styles.clauseEditor} data-query-clause-editor=\"\">\n                    {parts.map((part, i) => {\n                        switch (part.t) {\n                            case \"slot\": return <SlotRow key={i} part={part} ps={ps} actions={actions} styles={styles} dirty={isDirty(slotKey(part.slot), part.text)} />;\n                            case \"input\": return (\n                                <Box key={i} css={styles.slotRow}>\n                                    <Box as=\"span\" css={styles.slotLabel}>{ps.words.messages.inputLabel({ input: part.input.kind })}</Box>\n                                    <Box css={styles.slotField}><InputPart part={part} ps={ps} actions={actions} /></Box>\n                                </Box>\n                            );\n                            case \"chip\": return (\n                                <chakra.button key={i} type=\"button\" css={styles.removeLink} onClick={() => actions.onRemove(part.remove)}>\n                                    <FontAwesomeIcon icon={faXmark} />{ps.words.messages.remove()} {part.text}\n                                </chakra.button>\n                            );\n                            case \"add\": return (\n                                <chakra.button key={i} type=\"button\" css={styles.addLink} onClick={(event) => actions.onAction(part.action, event.currentTarget)}>\n                                    <FontAwesomeIcon icon={faPlus} />{part.text}\n                                </chakra.button>\n                            );\n                            case \"remove\": return (\n                                <chakra.button key={i} type=\"button\" css={styles.removeLink} onClick={() => actions.onRemove(part.target)}>\n                                    <FontAwesomeIcon icon={faXmark} />{part.target.kind === \"condition\" ? ps.words.messages.removeCondition() : part.label}\n                                </chakra.button>\n                            );\n                            default: return null;\n                        }\n                    })}\n                </Box>\n            )}\n            <PhoneProblems problems={problems} styles={styles} actions={actions} />\n        </Box>\n    );\n}\n\n/** A card's lines as clauses: a group's head a clause, its lines under it; a foot's adds as links. */\nfunction PhoneLines({ lines, at, open, onOpen, ps, actions, isDirty }: { lines: readonly CardLine[]; at: string; open: string | undefined; onOpen: (id: string | undefined) => void; ps: PartStyles; actions: PartActions; isDirty: ClauseProps[\"isDirty\"] }): ReactNode {\n    const styles = useSlotStyles(\"queryPhone\");\n    return lines.map((line, i) => {\n        const id = `${at}.${i}`;\n        switch (line.kind) {\n            case \"row\":\n                return <Clause key={i} id={id} parts={line.parts} problems={line.problems} open={open} onOpen={onOpen} ps={ps} actions={actions} isDirty={isDirty} />;\n            case \"group\":\n                return (\n                    <Box key={i} css={styles.group} data-query-line=\"group\">\n                        <Clause id={id} parts={[...line.parts, ...(line.head ?? [])]} problems={line.problems} open={open} onOpen={onOpen} ps={ps} actions={actions} isDirty={isDirty} />\n                        <Box css={styles.groupLines}><PhoneLines lines={line.lines ?? []} at={id} open={open} onOpen={onOpen} ps={ps} actions={actions} isDirty={isDirty} /></Box>\n                    </Box>\n                );\n            case \"foot\":\n                return (\n                    <Fragment key={i}>\n                        <Box css={styles.feet}>\n                            {line.parts.map((part, j) => part.t === \"add\" ? (\n                                <chakra.button key={j} type=\"button\" css={styles.addLink} data-slot-key={part.action.kind === \"open\" && part.action.slot !== undefined ? slotKey(part.action.slot) : undefined}\n                                    onClick={(event) => actions.onAction(part.action, event.currentTarget)}>\n                                    <FontAwesomeIcon icon={faPlus} />{part.text}\n                                </chakra.button>\n                            ) : null)}\n                        </Box>\n                        <PhoneProblems problems={line.problems} styles={styles} actions={actions} />\n                    </Fragment>\n                );\n            case \"note\":\n                return <Box key={i} css={styles.note}>{line.parts.map((p) => (p.t === \"word\" ? p.text : \"\")).join(\" \")}</Box>;\n            case \"code\":\n                return (\n                    <Fragment key={i}>\n                        <Box as=\"pre\" css={styles.code}>{line.parts.map((p) => (p.t === \"code\" ? p.text : \"\")).join(\"\")}</Box>\n                        <PhoneProblems problems={line.problems} styles={styles} actions={actions} />\n                    </Fragment>\n                );\n        }\n    });\n}\n\n/** A step's card (QP23, QP27). */\nconst PhoneStepCard = memo(function PhoneStepCard({ card, count, focused, open, onOpen, ps, actions, isDirty }: {\n    card: Card; count: number; focused: boolean; open: string | undefined; onOpen: (id: string | undefined) => void; ps: PartStyles; actions: QueryEditor[\"actions\"]; isDirty: ClauseProps[\"isDirty\"];\n}) {\n    const styles = useSlotStyles(\"queryPhone\");\n    const { words } = ps;\n    const m = words.messages;\n    const [more, setMore] = useState(false);\n    return (\n        <Box css={styles.card} role=\"group\" aria-label={card.title} data-step-id={card.stepId} data-step-kind={card.kind}\n            data-unfinished={card.complete ? undefined : \"\"} data-error={card.errors > 0 ? \"\" : undefined} data-focus={focused ? \"\" : undefined}>\n            <Box css={styles.cardHead}>\n                <Box as=\"span\" css={styles.cardNumber}>{words.formatters.bare(card.index + 1)}</Box>\n                <Box as=\"span\" css={styles.cardIcon} aria-hidden><FontAwesomeIcon icon={[\"fas\", card.icon as IconName]} /></Box>\n                <Box as=\"span\" css={styles.cardTitle}>{card.title}</Box>\n                <chakra.button type=\"button\" css={styles.cardMore} aria-label={m.stepActions()} aria-expanded={more} data-query-step-more=\"\" onClick={() => setMore(!more)}>\n                    <FontAwesomeIcon icon={faEllipsis} />\n                </chakra.button>\n            </Box>\n            {more && (\n                <Box css={styles.cardActions} data-query-step-actions=\"\">\n                    <Button size=\"md\" variant=\"outline\" css={styles.cardAction} disabled={card.index === 0} onClick={() => actions.onMove(card.stepId, -1)}><FontAwesomeIcon icon={faArrowUp} />{m.moveUp()}</Button>\n                    <Button size=\"md\" variant=\"outline\" css={styles.cardAction} disabled={card.index === count - 1} onClick={() => actions.onMove(card.stepId, 1)}><FontAwesomeIcon icon={faArrowDown} />{m.moveDown()}</Button>\n                    <Button size=\"md\" variant=\"outline\" css={styles.cardAction} onClick={() => actions.onRemoveStep(card.stepId)}><FontAwesomeIcon icon={faXmark} />{m.removeStep()}</Button>\n                </Box>\n            )}\n            {card.head.length > 0 && <Clause id={`${card.stepId}.head`} parts={card.head} problems={[]} open={open} onOpen={onOpen} ps={ps} actions={actions} isDirty={isDirty} />}\n            <PhoneLines lines={card.lines} at={card.stepId} open={open} onOpen={onOpen} ps={ps} actions={actions} isDirty={isDirty} />\n            {!card.complete && <Box css={styles.note}>{m.notFinished()}</Box>}\n        </Box>\n    );\n});\n\n/** Props of {@link QueryPhoneView}. */\nexport interface QueryPhoneViewProps {\n    readonly editor: QueryEditor;\n    readonly ps: PartStyles;\n    readonly workspace: string | undefined;\n    /** The step an issue went to; the clause it opens. */\n    readonly focus: string | undefined;\n    /** The notice a phone says over the strip instead. */\n    readonly elsewhere: QueryNotice | undefined;\n    /** Where the query stands, its name's eyebrow. */\n    readonly save: QuerySaveLine;\n    /** Its description: the author's, else the generated one. */\n    readonly description: string;\n    /** Save…, whose popover is a view here. */\n    readonly saveButton: ReactNode;\n    readonly onRun: () => void;\n    readonly running: boolean;\n    /** Whether the session holds drafts: a slot's value is dirty against what it held before any. */\n    readonly drafted: boolean;\n    /** Opens the Library tab: a query with no steps' way on (5a). */\n    readonly onOpenLibrary: () => void;\n}\n\nconst AT_END: SlotRef = { kind: \"add-step\", stepId: \"\" };\n\n/**\n * The Query view — see the module docs.\n *\n * @param props - The editor, its parts and the query's standing ({@link QueryPhoneViewProps})\n * @returns The view's body\n */\nexport const QueryPhoneView = memo(function QueryPhoneView({ editor, ps, workspace, focus, elsewhere, save, description, saveButton, onRun, running, drafted, onOpenLibrary }: QueryPhoneViewProps) {\n    const styles = useSlotStyles(\"queryPhone\");\n    const { words } = ps;\n    const m = words.messages;\n    const { view, setView, source, cards, actions } = editor;\n    const [open, setOpen] = useState<string | undefined>(undefined);\n    const { copied, copy } = useCopy(() => editor.program);\n    const n = words.formatters.number(cards.length);\n    // An issue gone to opens its clause: the first of its step with a problem, else the step's first.\n    useEffect(() => {\n        if (focus === undefined) return;\n        const card = cards.find((c) => c.stepId === focus);\n        if (card === undefined) return;\n        const at = card.lines.findIndex((l) => l.problems.length > 0);\n        setOpen(`${card.stepId}.${at < 0 ? 0 : at}`);\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- going to an issue is what opens it, not the cards moving after.\n    }, [focus]);\n    const notices = editor.notices.filter((notice) => notice.id !== elsewhere?.id);\n    // A changed value is dirty (QP25): against each slot's text while the session held no drafts.\n    const clean = useRef(new Map<string, string>());\n    const seen: [string, string][] = [];\n    const walk = (parts: readonly CardPart[]) => { for (const part of parts) if (part.t === \"slot\") seen.push([slotKey(part.slot), part.text]); };\n    const walkLines = (lines: readonly CardLine[]) => { for (const line of lines) { walk(line.parts); walk(line.head ?? []); walkLines(line.lines ?? []); } };\n    for (const card of cards) { walk(card.head); walkLines(card.lines); }\n    if (!drafted) clean.current = new Map(seen);\n    const isDirty = (key: string, text: string) => drafted && clean.current.has(key) && clean.current.get(key) !== text;\n    return (\n        <Box css={styles.queryView} data-query-tab=\"query\" data-mode={view} data-query-phone-view=\"\">\n            <Box css={styles.queryBand}>\n                {editor.views.length > 1 && <Box css={styles.seg} role=\"group\" aria-label={m.viewLabel()} data-query-view={view}>\n                    {editor.views.map((v) => (\n                        <chakra.button key={v} type=\"button\" css={styles.segItem} data-state={v === view ? \"on\" : \"off\"} aria-pressed={v === view} onClick={() => setView(v)}>\n                            <Box as=\"span\" css={styles.segIcon} aria-hidden><FontAwesomeIcon icon={v === \"visual\" ? faDiagramProject : faCode} /></Box>\n                            <span>{m.view({ view: v })}</span>\n                        </chakra.button>\n                    ))}\n                </Box>}\n                <chakra.button type=\"button\" css={styles.copy} data-copied={copied ? \"\" : undefined} data-query-copy=\"\" onClick={copy}>\n                    {copied && <FontAwesomeIcon icon={faCheck} />}{copied ? m.copied() : m.copyJq()}\n                </chakra.button>\n            </Box>\n            {notices.map((notice) => (\n                <Box key={notice.id} css={styles.queryNotice} role=\"status\">\n                    <Box as=\"span\" css={styles.liveDot} aria-hidden />\n                    <Box as=\"span\" css={styles.liveText}>{notice.text}</Box>\n                    <chakra.button type=\"button\" css={styles.liveClose} aria-label={m.dismissNotice()} onClick={() => editor.dismiss(notice.id)}><FontAwesomeIcon icon={faXmark} /></chakra.button>\n                </Box>\n            ))}\n            <Box css={styles.queryScroll} data-mode={view}>\n                {view !== \"jq\" && <Box css={styles.queryHead} data-query-head=\"\">\n                    <Box css={styles.queryEyebrow}>{m.queryEyebrow({ state: save.word, n: cards.length, count: n })}</Box>\n                    <Box css={styles.queryName} data-query-name=\"\">{editor.header.name}</Box>\n                    {description !== \"\" && <Box css={styles.queryDescription}>{description}</Box>}\n                </Box>}\n                {view === \"jq\" && editor.jqChecked !== undefined ? (\n                    <Box css={styles.queryJq} data-query-jq-phone=\"\">\n                        {editor.jqNote !== undefined && <BannerView status=\"warning\" title={editor.jqNote} />}\n                        <JqEditor text={editor.jqText} checked={editor.jqChecked} root={editor.root} summaries={editor.summaries} ps={ps}\n                            onText={editor.onJqText} onLeave={editor.leaveJq} onFix={editor.onJqFix} phone />\n                    </Box>\n                ) : (\n                    <Box css={styles.querySteps} role=\"group\" aria-label={m.stepsLabel()} data-query-steps=\"\">\n                        {source !== undefined && <>\n                            <Box css={styles.source} data-query-source={editor.query.source}>\n                                <Box as=\"span\" css={styles.sourceTile} aria-hidden><FontAwesomeIcon icon={faDatabase} /></Box>\n                                <Box css={styles.sourceText}>\n                                    <Box as=\"span\" css={styles.sourceTitle}>{source.title}</Box>\n                                    <Box as=\"span\" css={styles.sourceKind}>{m.sourceLine({ path: workspace === undefined ? editor.query.source : `${workspace}.${editor.query.source}`, kind: source.kind })}</Box>\n                                </Box>\n                            </Box>\n                            <ShapeRow text={source.shape.text} extra={source.shape.extra} counted={source.shape.counted} at={0} insert={cards.length > 0} ps={ps} onSlot={actions.onSlot} />\n                        </>}\n                        {cards.map((card) => (\n                            <Fragment key={card.stepId}>\n                                <PhoneStepCard card={card} count={cards.length} focused={focus === card.stepId} open={open} onOpen={setOpen} ps={ps} actions={actions} isDirty={isDirty} />\n                                <ShapeRow text={card.shape.text} extra={card.shape.extra} counted={card.shape.counted} at={card.index + 1} insert ps={ps} onSlot={actions.onSlot} />\n                            </Fragment>\n                        ))}\n                        {cards.length === 0 && (\n                            <Box css={styles.emptySteps} data-query-empty=\"\">\n                                <Box as=\"span\" css={styles.emptyGlyph} aria-hidden />\n                                <Box css={styles.emptyTitle}>{m.noStepsYet()}</Box>\n                                <Box as=\"ul\" css={styles.emptyList}><li>{m.noStepsAdd()}</li><li>{m.noStepsSaved()}</li></Box>\n                                <chakra.button type=\"button\" css={styles.emptyLink} onClick={onOpenLibrary}>{m.openLibrary()} →</chakra.button>\n                            </Box>\n                        )}\n                        <chakra.button type=\"button\" css={styles.addEnd} data-slot-key={slotKey(AT_END)} data-query-add-end=\"\" onClick={(event) => actions.onSlot(AT_END, event.currentTarget)}>\n                            <FontAwesomeIcon icon={faPlus} />{m.addStepAtEnd()}\n                        </chakra.button>\n                    </Box>\n                )}\n            </Box>\n            <Box css={styles.queryFoot} data-query-foot=\"\">\n                <Box css={styles.footStatus} data-query-check={editor.check.tone}>\n                    <Box as=\"span\" css={styles.footDot} data-tone={editor.check.tone} aria-hidden />\n                    <Box as=\"span\" css={styles.footWord} data-tone={editor.check.tone}>{editor.check.word}</Box>\n                    {editor.gives !== undefined && <Box as=\"span\" css={styles.footGives} data-query-gives=\"\">{editor.gives.text}</Box>}\n                </Box>\n                <Box css={styles.footButtons}>\n                    {saveButton}\n                    <Button size=\"md\" variant=\"solid\" css={styles.footButton} aria-busy={running ? true : undefined} data-query-run=\"\" onClick={onRun}>\n                        <FontAwesomeIcon icon={faPlay} />{m.run()}\n                    </Button>\n                </Box>\n            </Box>\n        </Box>\n    );\n});\n\n/** The line between steps (QP22): the shape's words, and Insert as a 44 ghost. */\nfunction ShapeRow({ text, extra, counted, at, insert, ps, onSlot }: { text: string; extra: string; counted: boolean; at: number; insert: boolean; ps: PartStyles; onSlot: PartActions[\"onSlot\"] }) {\n    const styles = useSlotStyles(\"queryPhone\");\n    const m = ps.words.messages;\n    const slot: SlotRef = { kind: \"add-step\", stepId: \"\", at };\n    // After a fresh run, the count in 600 ink, then the words (QP22).\n    const space = text.indexOf(\" \");\n    const shown = counted && space > 0 ? <><b>{text.slice(0, space)}</b>{text.slice(space)}</> : text;\n    return (\n        <Box css={styles.shape} data-query-shape={at}>\n            <Box as=\"span\" css={styles.shapeText} data-query-shape-text=\"\"><span>{shown}</span>{extra !== \"\" && <span> {extra}</span>}</Box>\n            {insert && <chakra.button type=\"button\" css={styles.shapeInsert} data-slot-key={slotKey(slot)} aria-label={m.insertHere()} onClick={(event) => onSlot(slot, event.currentTarget)}>\n                <FontAwesomeIcon icon={faPlus} />{m.insert()}\n            </chakra.button>}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Runs (#938, #941) — a query read on e3 (`Query Editor Spec.md` §4.11). The\n * builder prepares each run itself, and plans it (`plan.ts`) as one one-shot\n * call over its root, with the call's limits (#935), or as a split call over\n * the pieces of the dataset it works through, when that dataset weighs more\n * than one piece:\n *\n * - **what runs** ({@link planRun}): in the visual view, the counting program\n *   (#933), so a one-shot run gives the result and every shape line's count —\n *   and, for a split run, the query itself, a rows result wrapped to count its\n *   rows, since a split run counts the source and the result only; in the jq\n *   view, the jq as typed, printed canonically when it parses — a text that\n *   does not parse is never sent, its run being the checker's refusal;\n * - **how it runs** ({@link useQueryRun}): the query checked and split; the\n *   dataset it would cut weighed, by its status; then the plan's call, a\n *   split call's progress told as it goes, and how it ran once it answered —\n *   its pieces, and the units it ran and the cache served (#1105); a host's\n *   split call that reports none has its pieces counted by its explain once\n *   it has answered (#1132);\n * - **one at a time**: a new run gives the one before up by its signal, which\n *   cancels its split call's job, so e3 stops its units (#1104), or its one\n *   call, which e3 keeps as a call of the workspace and stops; and a run\n *   given up has its answer dropped when it lands; while it goes, the run\n *   names the data sources it reads. The builder going gives up the run in\n *   flight too, and its coming back — React's mount → unmount → mount, a\n *   hidden builder shown again — starts it again: a run is never lost, or\n *   failed, for the builder remounting;\n * - **what came back** ({@link runOutput}): the result's type and value, the\n *   counts, and whether the rows were cut; or a result too large for one\n *   answer, the output of a split call with no final step — the run's own, or\n *   the one a run whose one call answered too large goes on as — opened to be\n *   read a page at a time (`paged-result.ts`, #1113);\n * - **fresh or stale** ({@link canonicalProgram}): a result is fresh while\n *   the query's canonical program is the one it ran.\n *\n * Runs happen on Run, ⌘⏎ and the opening of a saved query — never on an edit.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport {\n    decodeBeast2, fromEastTypeValue, parseJq, printJq,\n    type CheckJqResult, type EastType, type option,\n} from \"@elaraai/east\";\nimport { ApiError, AuthError } from \"@elaraai/e3-api-client\";\nimport type { ExecuteResult, SplitCallProgress, SplitCallReport, SplitCallRequest } from \"@elaraai/e3-types\";\nimport type { QueryCall, QueryCollection, QuerySourceStatus, QuerySplitCall, QuerySplitExplain } from \"./hooks.js\";\nimport { queryResultOf, type QueryReading, type QueryResult, type QueryRoot } from \"./one-shot.js\";\nimport { pagedResultOf, type PagedResult } from \"./paged-result.js\";\nimport { draftPlan, weighPlan, type PlanDraft, type PlanOptions, type QueryPlan, type SourceWeight } from \"./plan.js\";\nimport type { QueryHeader } from \"./session.js\";\nimport type { CheckedSteps } from \"./steps/check.js\";\nimport { SOURCE_COUNT, countingProgram, readCounts } from \"./steps/count.js\";\nimport { printSteps } from \"./steps/print.js\";\nimport { shapeOf, type Shape } from \"./steps/shape.js\";\nimport type { StepQuery } from \"./steps/values.js\";\nimport type { QueryView } from \"./toolbar.js\";\n\n/** The most rows a visual run returns; the counting program counts them all. */\nexport const RUN_MAX_ROWS = 1000;\n\n/** How the pipeline layout joins one stage to the next. */\nconst NEXT_STAGE = \"\\n| \";\n\n/**\n * A program's canonical text: printed in the pipeline layout when it parses,\n * as written when it does not — what a result is fresh against.\n *\n * @param program - the program's text\n * @returns its canonical text\n */\nexport function canonicalProgram(program: string): string {\n    const parsed = parseJq(program);\n    return parsed.program.type === \"some\" ? printJq(parsed.program.value, { layout: \"pipeline\" }).text : program;\n}\n\n/** What a run sends as a split call, and what reading its answer needs. */\nexport interface SplitRun {\n    /**\n     * The program: in the visual view the query, a rows result followed by\n     * `{counts: [length], result: .[:1000]}` — the rows joined, and that run\n     * once after them; in the jq view, the jq.\n     */\n    readonly program: string;\n    /** What each of its counts is of — the last counted stage, for a visual run of rows; `undefined` when it answers the result alone. */\n    readonly counted: readonly string[] | undefined;\n    /** The data source whose stored row count is the source's count — a visual run's, when its source counts; `undefined` otherwise. */\n    readonly source: string | undefined;\n}\n\n/** What a run sends, and what reading its answer needs. */\nexport interface RunPlan {\n    /** The program a one-shot call runs: the counting program, or the jq. */\n    readonly program: string;\n    /** The query's own program, canonical: what its result is fresh against, and what its plan splits and explains. */\n    readonly canonical: string;\n    /** What each of the counting program's counts is of — `undefined` for a jq run. */\n    readonly counted: readonly string[] | undefined;\n    /** What a split call runs instead. */\n    readonly split: SplitRun;\n    /** The shape the query gives, as the editor knew it when it ran: what its rows are called. */\n    readonly shape: Shape | undefined;\n    /** The query's name and description when it ran: what its recent query is called. */\n    readonly name: string;\n    readonly description: option<string>;\n}\n\n/** What planning a run needs of the open query. */\nexport interface RunEditor {\n    /** The view shown. */\n    readonly view: QueryView;\n    /** The header: its jq, when the program is not steps. */\n    readonly header: QueryHeader;\n    /** The steps. */\n    readonly query: StepQuery;\n    /** The steps' check; `undefined` while the program is jq. */\n    readonly checked: CheckedSteps | undefined;\n    /** The jq as typed, in the jq view. */\n    readonly jqText: string;\n    /** The jq view's check of it. */\n    readonly jqChecked: CheckJqResult | undefined;\n}\n\n/**\n * What a run of the open query sends.\n *\n * @param editor - the open query, as the editor holds it\n * @param root - the root\n * @returns the plan: in the visual view the counting program, or for a split\n *   call the query, a rows result wrapped to count its rows; in the jq view the jq\n */\nexport function planRun(editor: RunEditor, root: QueryRoot): RunPlan {\n    const { view, header, query, checked, jqText, jqChecked } = editor;\n    if (view === \"visual\" && header.jq.type === \"none\") {\n        const plain = printSteps(query, root.type).text;\n        const counting = countingProgram(query, root.type, { maxRows: RUN_MAX_ROWS });\n        const canonical = canonicalProgram(plain);\n        // A split run counts the source, from its stored rows, and a rows result's rows: nothing between.\n        const source = counting.counted.includes(SOURCE_COUNT) ? query.source : undefined;\n        const last = counting.counted.at(-1);\n        const split: SplitRun = checked?.final.kind === \"rows\" && last !== undefined\n            ? { program: `${canonical}${NEXT_STAGE}{counts: [length], result: .[:${RUN_MAX_ROWS}]}`, counted: [last], source }\n            : { program: canonical, counted: undefined, source };\n        return {\n            program: counting.text, canonical, counted: counting.counted, split, shape: checked?.final,\n            name: header.name, description: header.description,\n        };\n    }\n    const text = view === \"jq\" ? jqText : header.jq.type === \"some\" ? header.jq.value : jqText;\n    const canonical = canonicalProgram(text);\n    const shape = jqChecked !== undefined && jqChecked.elementType !== null\n        ? shapeOf(jqChecked.elementType, jqChecked.multiplicity, { noun: \"row\" })\n        : undefined;\n    return {\n        program: canonical, canonical, counted: undefined, split: { program: canonical, counted: undefined, source: undefined },\n        shape, name: header.name, description: header.description,\n    };\n}\n\n/** What a run that answered gave: the query's result, and what the counting program counted. */\nexport interface RunOutput {\n    /** The result's type: `T`, `Option<T>` or `Array<T>` by the query's multiplicity. */\n    readonly type: EastType;\n    /** The result; `undefined` for one read a page at a time, whose rows are its pages'. */\n    readonly value: unknown;\n    /** The rows each stage gave, by step id (`SOURCE_COUNT` for the source's): a visual run's. */\n    readonly counts: ReadonlyMap<string, number> | undefined;\n    /** The rows the query gives in all, when the run returned fewer: the counting program's last count. */\n    readonly total: number | undefined;\n    /** Whether the answer was cut at the call's most outputs, its total unknown: a jq run's. */\n    readonly truncated: boolean;\n    /**\n     * A result too large for one answer, read a page at a time (#1113): the\n     * output of a split call with no final step, opened by its hash;\n     * `undefined` for a result in hand.\n     */\n    readonly paged: PagedResult | undefined;\n}\n\n/** No counts known before a run answers. */\nconst NO_COUNTS: ReadonlyMap<string, number> = new Map();\n\n/**\n * Reads a run's answer.\n *\n * @param program - what the run's program counts: a {@link RunPlan}'s\n *   counting program, or a {@link SplitRun}'s\n * @param result - what the call answered\n * @param known - counts known before the run answered, by step id: a split\n *   run's source's stored rows\n * @returns the result and its counts; `undefined` for a run that gave no result\n * @throws {Error} When a counting run's answer does not hold one count per counted stage.\n */\nexport function runOutput(\n    program: { readonly counted: readonly string[] | undefined }, result: QueryResult, known: ReadonlyMap<string, number> = NO_COUNTS,\n): RunOutput | undefined {\n    if (result.outcome.type !== \"ok\") return undefined;\n    const { result: bytes, truncated } = result.outcome.value;\n    const decoded = decodeBeast2(bytes);\n    const type = fromEastTypeValue(decoded.type);\n    const counted = program.counted;\n    if (counted === undefined) return { type, value: decoded.value, counts: known.size === 0 ? undefined : known, total: undefined, truncated, paged: undefined };\n    if (type.type !== \"Struct\") throw new Error(\"runOutput: a counting run answers {counts, result}\");\n    const read = readCounts(decoded.value as { counts: bigint[]; result: unknown }, counted);\n    const resultType = (type.fields as Record<string, EastType>)[\"result\"]!;\n    const last = counted.length === 0 ? undefined : read.counts.get(counted[counted.length - 1]!);\n    const shown = resultType.type === \"Array\" ? (read.value as readonly unknown[]).length : undefined;\n    const total = last !== undefined && shown !== undefined && last > shown ? last : undefined;\n    const counts = known.size === 0 ? read.counts : new Map([...known, ...read.counts]);\n    return { type: resultType, value: read.value, counts, total, truncated: false, paged: undefined };\n}\n\n/** Where the builder's run stands. */\nexport type RunState =\n    | { readonly status: \"idle\" }\n    /**\n     * A run going: its number, its plan, the data sources it reads; how it\n     * reads them, once planned; and a split call's progress, and how many\n     * pieces it cut, once e3 says.\n     */\n    | {\n        readonly status: \"running\"; readonly n: number; readonly plan: RunPlan; readonly reads: readonly string[];\n        readonly planned: QueryPlan | undefined; readonly progress: SplitCallProgress | undefined; readonly pieces: number | undefined;\n    }\n    /**\n     * A run answered — a result, or the checker's, the runner's or e3's\n     * refusal — how it read its data; how many pieces it cut, once e3 says —\n     * its report, or for a host's split call that reports none, its explain,\n     * after the answer (#1132); and how its split call ran, as e3 reports it,\n     * for a call that gave its output: the units it ran and the cache served\n     * (#1105) — the join call's, for a re-keyed join.\n     */\n    | {\n        readonly status: \"done\"; readonly n: number; readonly plan: RunPlan; readonly result: QueryResult;\n        readonly output: RunOutput | undefined; readonly at: Date; readonly ms: number;\n        readonly planned: QueryPlan | undefined; readonly pieces: number | undefined; readonly report: SplitCallReport | undefined;\n    }\n    /** A call that never answered: unreachable, or refused by the server — and how it was to read its data. */\n    | {\n        readonly status: \"failed\"; readonly n: number; readonly plan: RunPlan; readonly reason: \"unreachable\" | \"refused\";\n        readonly message: string; readonly at: Date; readonly planned: QueryPlan | undefined;\n    };\n\n/** What a run reaches e3 through, and how it plans. */\nexport interface QueryRunSeams {\n    /** How a one-shot call is made; `undefined` when there is no server. */\n    readonly call: QueryCall | undefined;\n    /** How a split call is made; `undefined` when there is no server. */\n    readonly split: QuerySplitCall | undefined;\n    /** How a split call's pieces are counted when its answer reported none (a host's); `undefined` when there is none to ask, and they go uncounted. */\n    readonly explain: QuerySplitExplain | undefined;\n    /** How a split call's output is opened, when its answer was too large for one (#1113); `undefined` when there is none to open, and the answer stays too large. */\n    readonly collection: QueryCollection | undefined;\n    /** How a data source's status is read; `undefined` when there is none to read, and every dataset's weight is unknown. */\n    readonly status: QuerySourceStatus | undefined;\n    /** How the run plans: the most a dataset may weigh and still be read by one call. */\n    readonly options: PlanOptions;\n}\n\n/** An error's message. */\nfunction messageOf(err: unknown): string {\n    return err instanceof Error ? err.message : String(err);\n}\n\n/**\n * Whether an error a call rejected with is the server's refusal of it, not a\n * failure to reach it: an `ApiError` or an `AuthError`; and, from a split call,\n * anything but the `TypeError` `fetch` rejects with — a job that ended\n * `failed` is e3's refusal to run it.\n */\nfunction refusedBy(err: unknown, split: boolean): boolean {\n    if (err instanceof ApiError || err instanceof AuthError) return true;\n    return split && !(err instanceof TypeError);\n}\n\n/**\n * What the datasets a run plans over weigh, by name: those whose weights\n * decide its path — the one a split call would cut, those cut at the same keys\n * with it, and a join's other side (#942) — and the source whose stored rows a\n * split visual run counts. A status that cannot be read leaves its dataset's\n * weight unknown.\n */\nasync function weigh(draft: PlanDraft, source: string | undefined, root: QueryRoot, status: QuerySourceStatus | undefined): Promise<ReadonlyMap<string, SourceWeight>> {\n    const weights = new Map<string, SourceWeight>();\n    if (status === undefined || draft.weighs.length === 0) return weights;\n    const names = [...new Set([...draft.weighs, ...(source === undefined ? [] : [source])])];\n    await Promise.all(names.map(async (name) => {\n        const entry = root.entries.find(e => e.name === name);\n        if (entry === undefined) return;\n        try {\n            weights.set(name, await status(entry.path));\n        } catch {\n            // Not weighed: the plan says its weight is not known, and the run is one call.\n        }\n    }));\n    return weights;\n}\n\n/**\n * The split call a run goes on as when its one call, which the estimates\n * chose, answered too large for one answer (#1113): one with no final step,\n * whose output is read a page at a time.\n *\n * @param planned - the run's one call\n * @param draft - its query, checked and split\n * @param weights - what its datasets weigh\n * @returns the split call; `undefined` when the estimates did not choose the\n *   one call, or the run has no such split call to make — it does not split,\n *   or its split has a final step, which answers inline as one call does\n */\nfunction pagedInstead(\n    planned: Extract<QueryPlan, { kind: \"one_shot\" }>, draft: PlanDraft, weights: ReadonlyMap<string, SourceWeight>,\n): Extract<QueryPlan, { kind: \"split\" }> | undefined {\n    const path = planned.explanation.path;\n    if (path.kind !== \"one_shot\" || path.why.kind !== \"faster\") return undefined;\n    try {\n        const again = weighPlan(draft, weights, { tooLarge: true });\n        return \"plan\" in again && again.plan.kind === \"split\" && again.plan.request.then.type === \"none\" ? again.plan : undefined;\n    } catch {\n        // A split program the translator cannot express: the one call's answer stands.\n        return undefined;\n    }\n}\n\n/**\n * Runs the open query: each run planned in the browser and sent as one\n * one-shot call, or as a split call over the dataset it works through; one\n * run in flight at a time, a new run abandoning the old.\n *\n * @param root - The root, or why it cannot be queried\n * @param seams - How a one-shot call, a split call and a data source's status\n *   are made, and how the run plans\n * @param onRan - Told each run that answered, with its result, for the recent queries\n * @returns The run's state, and `run(plan)`\n *\n * @remarks\n * A run checks and splits the query (`draftPlan`); reads the status of the\n * datasets whose weights decide its path, when it would cut one; plans the\n * call by what they weigh (`weighPlan`); and makes it — a re-keyed join's two\n * calls one after the other, the second over the first's output (#942). A\n * split call's progress is the run's as e3 reports it, and how many pieces it\n * cut is the partition's units — the join call's, for a re-keyed join. A\n * split visual run counts the source from its dataset's stored rows, and a\n * rows result's rows from the call; nothing between.\n *\n * Once a split call answers, its report says how it ran (#1105): its pieces —\n * which a call that ended between two polls, or one the cache served whole,\n * never said as it went — and the units it ran and the cache served. A host's\n * split call that reports none, and answered before it said its pieces, has\n * them counted once it has answered, by its explain, which plans them as the\n * run did and runs no unit (#1132): the answer shows at once, and the count\n * lands after it. An explain is work in proportion to the dataset, so a call\n * whose progress or report named its pieces is never explained. An explain\n * that fails leaves the count unknown; a new run gives it up with the run.\n *\n * A split call with no final step whose answer was too large for one has its\n * output — the hash the answer names — opened (`collection`), and the run's\n * result is read a page at a time (#1113). An output that can't be opened\n * leaves the answer too large. A one call's answer too large for one names no\n * output: a run whose estimates chose one call, and whose split call has no\n * final step, goes on as that split call (`weighPlan`'s `tooLarge`), so its\n * result is read a page at a time too.\n *\n * A one call is a run's (`QueryCall`'s `run`): e3 starts and keeps it as a call\n * of the workspace, listed among its calls, so it runs as long as its limits\n * allow, never a request's deadline. A new run gives the one before up by its\n * signal, and so does the builder going — unmounted, or hidden: its one call\n * is asked to stop, and its split call stops polling and its job is\n * cancelled, so e3 stops its units (#1104); and its answer is dropped when it\n * lands. The builder's coming back starts that run again, under its number:\n * React's development check of a component's effects, which mounts it,\n * unmounts it and mounts it again, would otherwise fail the run a saved query\n * starts as it opens, with the given-up call's \"signal is aborted\"; the units\n * the cancelled job finished are cached, and serve the run started again.\n */\nexport function useQueryRun(\n    root: QueryRoot | string, seams: QueryRunSeams, onRan?: (result: QueryResult, plan: RunPlan) => void,\n): { state: RunState; run: (plan: RunPlan) => void } {\n    const [state, setState] = useState<RunState>({ status: \"idle\" });\n    // The latest run's number: an answer to an earlier one is dropped.\n    const seq = useRef(0);\n    // The latest run's abandon: a new run, or the builder going, abandons it.\n    const abandon = useRef<AbortController | undefined>(undefined);\n    // The run in flight, until it answers or fails: what the builder going abandons.\n    const inFlight = useRef<{ readonly n: number; readonly plan: RunPlan } | undefined>(undefined);\n    // The run the builder's going abandoned in flight: what its coming back starts again, under its number.\n    const resume = useRef<{ readonly n: number; readonly plan: RunPlan } | undefined>(undefined);\n    const { call, split, explain, collection, status, options } = seams;\n    // Starts run `n`: a new one, or one the builder's going abandoned, started again.\n    const start = useCallback((plan: RunPlan, n: number) => {\n        abandon.current?.abort();\n        const controller = new AbortController();\n        abandon.current = controller;\n        inFlight.current = { n, plan };\n        // The latest run, and not abandoned: an abandoned run started again is a run of the same number.\n        const live = (): boolean => seq.current === n && !controller.signal.aborted;\n        /** The run ends, answered or failed: no longer in flight. */\n        const ended = (next: RunState): void => {\n            if (inFlight.current?.n === n) inFlight.current = undefined;\n            setState(next);\n        };\n        const failed = (reason: \"unreachable\" | \"refused\", message: string, planned: QueryPlan | undefined): void =>\n            ended({ status: \"failed\", n, plan, reason, message, at: new Date(), planned });\n        if (typeof root === \"string\") {\n            failed(\"refused\", root, undefined);\n            return;\n        }\n        let drafted: ReturnType<typeof draftPlan>;\n        try {\n            drafted = draftPlan({ query: plan.canonical, oneShot: plan.program, split: plan.split.program }, root, options);\n        } catch (err) {\n            failed(\"refused\", messageOf(err), undefined);\n            return;\n        }\n        if (\"result\" in drafted) {\n            ended({ status: \"done\", n, plan, result: drafted.result, output: undefined, at: new Date(), ms: 0, planned: undefined, pieces: undefined, report: undefined });\n            return;\n        }\n        const draft = drafted.draft;\n        const reads = draft.reads;\n        setState({ status: \"running\", n, plan, reads, planned: undefined, progress: undefined, pieces: undefined });\n        const started = performance.now();\n\n        /** The run answered: its result read, its output, and the recent queries told. Whether its answer could be read. */\n        const answered = (\n            planned: QueryPlan, reading: QueryReading, answer: ExecuteResult, read: (result: QueryResult) => RunOutput | undefined,\n            pieces: number | undefined, report: SplitCallReport | undefined,\n        ): boolean => {\n            let result: QueryResult;\n            let output: RunOutput | undefined;\n            try {\n                result = queryResultOf(reading, answer);\n                output = read(result);\n            } catch (err) {\n                failed(\"refused\", messageOf(err), planned);\n                return false;\n            }\n            ended({ status: \"done\", n, plan, result, output, at: new Date(), ms: performance.now() - started, planned, pieces, report });\n            if (onRan !== undefined) queueMicrotask(() => onRan(result, plan));\n            return true;\n        };\n\n        /** Counts an answered run's pieces by the explain of its call, given up with the run: the count lands in its read-out. */\n        const countPieces = (request: SplitCallRequest): void => {\n            if (explain === undefined) return;\n            void explain(request, { signal: controller.signal }).then(({ pieces: count }) => {\n                if (!live()) return;\n                setState((was) => (was.status === \"done\" && was.n === n && was.pieces === undefined ? { ...was, pieces: Number(count) } : was));\n            }, () => {\n                // An explain e3 refuses, or that never reaches it, leaves the count unknown, as the run left it.\n            });\n        };\n\n        void (async () => {\n            const weights = await weigh(draft, plan.split.source, root, status);\n            if (!live()) return;\n            let planned: QueryPlan;\n            try {\n                const weighed = weighPlan(draft, weights);\n                if (\"result\" in weighed) {\n                    ended({ status: \"done\", n, plan, result: weighed.result, output: undefined, at: new Date(), ms: 0, planned: undefined, pieces: undefined, report: undefined });\n                    return;\n                }\n                planned = weighed.plan;\n            } catch (err) {\n                failed(\"refused\", messageOf(err), undefined);\n                return;\n            }\n            setState({ status: \"running\", n, plan, reads, planned, progress: undefined, pieces: undefined });\n\n            if (planned.kind === \"one_shot\") {\n                if (call === undefined) {\n                    failed(\"unreachable\", \"\", planned);\n                    return;\n                }\n                let answer: ExecuteResult;\n                try {\n                    // Started as a call of the workspace, held to no request's deadline, and stopped once the run is given up\n                    answer = await call(planned.prepared.request, { run: true, signal: controller.signal });\n                } catch (err) {\n                    if (live()) failed(refusedBy(err, false) ? \"refused\" : \"unreachable\", messageOf(err), planned);\n                    return;\n                }\n                if (!live()) return;\n                // Too large for one answer, a one call's result is never read a page at a time, and a split call's output is.\n                const instead = answer.outcome.type === \"too_large\" && split !== undefined && collection !== undefined\n                    ? pagedInstead(planned, draft, weights) : undefined;\n                if (instead === undefined) {\n                    answered(planned, planned.prepared, answer, (result) => runOutput(plan, result), undefined, undefined);\n                    return;\n                }\n                planned = instead;\n                setState({ status: \"running\", n, plan, reads, planned, progress: undefined, pieces: undefined });\n            }\n\n            if (split === undefined) {\n                failed(\"unreachable\", \"\", planned);\n                return;\n            }\n            let pieces: number | undefined;\n            // The call whose pieces the read-out names: the split call, or a re-keyed join's join call.\n            let counted: SplitCallRequest | undefined;\n            // How it ran, when it reports so (#1105), and its assembled output's hash.\n            let report: SplitCallReport | undefined;\n            let output: string | null = null;\n            /** A split call, its progress told as it goes. */\n            const send = (request: SplitCallRequest) => split(request, {\n                signal: controller.signal,\n                onProgress: (progress) => {\n                    if (!live()) return;\n                    if (progress.phase.type === \"partition\") pieces = Number(progress.units);\n                    setState({ status: \"running\", n, plan, reads, planned, progress, pieces });\n                },\n            });\n            let answer: ExecuteResult;\n            try {\n                if (planned.kind === \"split\") {\n                    counted = planned.request;\n                    const done = await send(counted);\n                    ({ result: answer, output } = done);\n                    report = done.report ?? undefined;\n                } else {\n                    // A re-keyed join (#942): the re-key call, then the join call over its output, by its hash.\n                    const first = await send(planned.first);\n                    if (!live()) return;\n                    pieces = undefined;\n                    if (first.output === null) {\n                        answer = planned.answer(first.result, undefined);\n                    } else {\n                        counted = planned.join(first.output);\n                        const joined = await send(counted);\n                        answer = planned.answer(first.result, joined.result);\n                        output = joined.output;\n                        report = joined.report ?? undefined;\n                    }\n                }\n            } catch (err) {\n                if (live()) failed(refusedBy(err, true) ? \"refused\" : \"unreachable\", messageOf(err), planned);\n                return;\n            }\n            if (!live()) return;\n            // The pieces its report says it cut: which a call that never said them as it went says once it answered (#1105).\n            if (report !== undefined) pieces = Number(report.pieces);\n            // The source's count is its dataset's stored rows; a rows result's, the call's.\n            const rows = plan.split.source === undefined ? undefined : weights.get(plan.split.source)?.rows;\n            const known: ReadonlyMap<string, number> = rows === undefined ? NO_COUNTS : new Map([[SOURCE_COUNT, rows]]);\n            // An answer too large for one, which no final step made — the assembled output itself — is read a page at a time (#1113).\n            let paged: PagedResult | undefined;\n            if (answer.outcome.type === \"too_large\" && counted?.then.type === \"none\" && output !== null && collection !== undefined) {\n                try {\n                    paged = pagedResultOf(await collection(output));\n                } catch {\n                    // Not opened: the answer stays too large.\n                }\n                if (!live()) return;\n            }\n            const readOutput = (result: QueryResult): RunOutput | undefined => (paged === undefined ? runOutput(plan.split, result, known)\n                : { type: paged.type, value: undefined, counts: known.size === 0 ? undefined : known, total: undefined, truncated: false, paged });\n            // How its units ran, for a call that gave its output: a unit that failed is neither run nor served (#1105).\n            const gave = answer.outcome.type === \"success\" || answer.outcome.type === \"too_large\";\n            const read = answered(planned, planned.reading, answer, readOutput, pieces, gave ? report : undefined);\n            // A call that answered with no report — a host's — before it said how many pieces it cut, and cut some: one e3 found wrong cut none.\n            if (read && pieces === undefined && counted !== undefined && answer.outcome.type !== \"invalid\") countPieces(counted);\n        })();\n    }, [root, call, split, explain, collection, status, options, onRan]);\n    const run = useCallback((plan: RunPlan) => start(plan, ++seq.current), [start]);\n    // The latest `start`: what the builder's coming back starts an abandoned run with.\n    const latest = useRef(start);\n    latest.current = start;\n    useEffect(() => {\n        // Coming back starts the run the builder's going abandoned, unless another run has started since.\n        const again = resume.current;\n        resume.current = undefined;\n        if (again !== undefined && seq.current === again.n) latest.current(again.plan, again.n);\n        return () => {\n            // Going gives up the run in flight: its split call stops polling, its job is cancelled, and its answer is dropped.\n            const going = inFlight.current;\n            if (going === undefined) return;\n            inFlight.current = undefined;\n            resume.current = going;\n            abandon.current?.abort();\n        };\n    }, []);\n    return { state, run };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The query builder's words in React (#935) — the model's message table\n * (`model/messages.ts`) in effect for a subtree, with the locale's formatters,\n * and the editing session's words, the shared table every builder's history\n * item speaks: its commit is **Save** (#1260).\n *\n * English is the default. A host overrides any subset for a subtree with\n * {@link QueryMessagesProvider}; numbers format in the locale react-aria's\n * `I18nProvider` above the app sets (the browser's otherwise).\n *\n * @packageDocumentation\n */\n\nimport { createContext, createElement, useContext, useMemo, type ReactNode } from \"react\";\nimport { editingMessages, useFormatters, type EditingWords } from \"@elaraai/east-ui-components\";\nimport { queryMessages, type QueryMessages } from \"./model/messages.js\";\nimport { queryWords, type QueryWords } from \"./model/words.js\";\n\nconst QueryMessagesContext = createContext<QueryMessages>(queryMessages);\n\n/**\n * The message table in effect — {@link queryMessages} with every\n * {@link QueryMessagesProvider} above overriding it.\n *\n * @returns The table\n */\nexport function useQueryMessages(): QueryMessages {\n    return useContext(QueryMessagesContext);\n}\n\n/** Props of {@link QueryMessagesProvider}. */\nexport interface QueryMessagesProviderProps {\n    /** The messages to override — any subset; the rest come from the table above. */\n    messages: Partial<QueryMessages>;\n    /** The subtree the overrides apply to. */\n    children?: ReactNode;\n}\n\n/**\n * Override the query builder's words for a subtree — a translation, or a\n * house style. Providers nest: each overrides the table the one above it\n * resolved.\n *\n * @remarks\n * The overrides are read by identity: define them once (module scope, or a\n * memo), as below.\n *\n * @param props - The overrides and the subtree\n * @returns The provider\n *\n * @example\n * ```tsx\n * const GERMAN: Partial<QueryMessages> = {\n *     tab: ({ tab }) => (tab === \"query\" ? \"Abfrage\" : tab === \"datasets\" ? \"Datensätze\" : \"Bibliothek\"),\n *     saveAs: () => \"Speichern…\",\n * };\n *\n * <I18nProvider locale=\"de-DE\">\n *     <QueryMessagesProvider messages={GERMAN}>\n *         <EastChakraComponent value={builder} />\n *     </QueryMessagesProvider>\n * </I18nProvider>\n * ```\n */\nexport function QueryMessagesProvider({ messages, children }: QueryMessagesProviderProps) {\n    const parent = useQueryMessages();\n    const value = useMemo(() => ({ ...parent, ...messages }), [parent, messages]);\n    return createElement(QueryMessagesContext.Provider, { value }, children);\n}\n\n/**\n * The words the builder says: the message table in effect, and the locale's\n * formatters — what the model's functions take.\n *\n * @returns The words\n */\nexport function useQueryWords(): QueryWords {\n    const formatters = useFormatters();\n    const messages = useQueryMessages();\n    return useMemo(() => queryWords(formatters, messages), [formatters, messages]);\n}\n\n/**\n * The editing session's words for the builder's history item: the shared\n * table, whose commit is Save in every builder (#1260), with the locale's\n * formatters.\n *\n * @returns The words the history item speaks\n */\nexport function useQueryEditingWords(): EditingWords {\n    const formatters = useFormatters();\n    return useMemo(() => ({ ...formatters, m: editingMessages }), [formatters]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `QuerySavePopover` — the query builder's save popover (#936,\n * `Query Editor Spec.md` §4.13). The toolbar's Save… opens it, as Studio's\n * Save as template opens its own: it is the shared {@link NamePopover}, the\n * design system's edit popover, headed \"Save query · {name}\".\n *\n * - **The name**, offering the open query's. A name another saved query\n *   holds is the field's error, \"{name} is taken\"; the open query's own is\n *   not, and saving under it updates the query.\n * - **The description**, under the name: one sentence, at most\n *   {@link DESCRIPTION_MAX} characters. Untouched, it holds the sentence\n *   generated from the steps, muted, and says so; once edited it counts its\n *   characters and offers **Use generated**, which returns it to the\n *   generated sentence. A query that has a description opens edited, showing\n *   it.\n * - **Cancel** and **Save**. ⏎ saves from the name, and from the description\n *   unless Shift is held — Shift ⏎ is a new line; Esc cancels.\n *\n * Save hands its host the name and the description — `none` while it is the\n * generated sentence, or cleared; the text as edited and trimmed once it is the author's —\n * and closes once its host has saved; what refused the save shows in the\n * popover, which stays open. While the save runs, Save is loading and Cancel\n * and Save are disabled. Each opening starts from the open query's name and\n * description.\n *\n * Its words are the query builder's message table's, its numbers the\n * locale's; its layout is the `sliceEdit` recipe's, and its description the\n * `input` recipe's field, as its name is.\n *\n * It hangs from Save…, or — the row short of room, Save… folded into the\n * toolbar's ⋯ chip (#1229) — from that chip, as its anchor.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useId, useState, type ChangeEvent, type KeyboardEvent } from \"react\";\nimport { Box, chakra, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { OptionType, StringType, equalFor, equivalentFor, none, some, type option } from \"@elaraai/east\";\nimport { useValueSync, type SliceEditPopoverAnchor } from \"@elaraai/east-ui-components\";\nimport { NamePopover } from \"../shared/name-popover.js\";\nimport { DESCRIPTION_MAX } from \"./model/words.js\";\nimport { useQueryWords } from \"./words.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** A saved query's description: `none` shows the sentence generated from its steps. */\nconst DescriptionType = OptionType(StringType);\n/** The memo's comparison of two descriptions. */\nconst descriptionEquivalent = equivalentFor(DescriptionType);\n/** Whether a description's data changed — what re-syncs the field. */\nconst descriptionEqual = equalFor(DescriptionType);\n\n/** Props of {@link QuerySavePopover}: what it hangs from — the toolbar's Save… (`trigger`), which its host renders, or the ⋯ chip (`anchor`) — and the rest. */\nexport type QuerySavePopoverProps = SliceEditPopoverAnchor & {\n    /** Whether it is open. */\n    open: boolean;\n    /** Opens or closes it — its trigger, ×, Esc, a click outside, Cancel, or a save that was made. */\n    onOpenChange: (open: boolean) => void;\n    /** The open query's name — its head names it, and its name field offers it each time it opens. */\n    name: string;\n    /** The names the other saved queries hold; the open query's own saved name is not among them. */\n    taken: ReadonlySet<string>;\n    /** The open query's description: `none` while it is the generated sentence, which the field then shows. */\n    description: option<string>;\n    /** The sentence generated from the steps (the model's `describeQuery`), `\"\"` while no step is finished. */\n    generated: string;\n    /** Saves the query under the name, with the description — `none` for the generated sentence — and resolves to what refused the save, or `undefined` once it is saved. */\n    onSave: (name: string, description: option<string>) => Promise<string | undefined>;\n    /** A phone's view (QP34): its fields labelled, its head the drafts' count, its Save the Primary. */\n    phone?: boolean | undefined;\n    /** How many drafts the session holds. */\n    pending?: number | undefined;\n};\n\n/**\n * Renders the save popover — see the module docs.\n *\n * @param props - The query it saves, and the save\n * @returns The trigger or the anchor, and the popover while open\n */\nexport const QuerySavePopover = memo(function QuerySavePopover(props: QuerySavePopoverProps) {\n    const { open, onOpenChange, name, taken, description, generated, onSave, phone = false, pending = 0 } = props;\n    const hangs: SliceEditPopoverAnchor = props.trigger !== undefined ? { trigger: props.trigger } : { anchor: props.anchor };\n    const edit = useSlotRecipe({ key: \"sliceEdit\" })() as Styles;\n    const input = useRecipe({ key: \"input\" })({}) as SystemStyleObject;\n    const { messages: m, formatters: f } = useQueryWords();\n    const id = useId();\n\n    // The description as the field holds it: `none` while it is the generated\n    // sentence. Each time the popover opens it starts from the query's, and it\n    // follows the query's when that changes.\n    const [draft, setDraft] = useState<option<string>>(description);\n    const [wasOpen, setWasOpen] = useState(open);\n    if (open !== wasOpen) {\n        setWasOpen(open);\n        if (open) setDraft(description);\n    }\n    useValueSync(description, descriptionEqual, () => setDraft(description));\n\n    // Typing makes it the author's own, starting from what the field shows.\n    const onDescription = useCallback((e: ChangeEvent<HTMLTextAreaElement>) => {\n        setDraft(some(e.target.value));\n    }, []);\n    // ⏎ saves, as it does from the name: it submits the popover's form, whose\n    // commit checks the name. Shift ⏎ is a new line, and a key that ends an\n    // input method's composition is the composition's.\n    const onDescriptionKey = useCallback((e: KeyboardEvent<HTMLTextAreaElement>) => {\n        if (e.key !== \"Enter\" || e.shiftKey || e.nativeEvent.isComposing) return;\n        e.preventDefault();\n        e.currentTarget.form?.requestSubmit();\n    }, []);\n    const restore = useCallback(() => setDraft(none), []);\n    // A description cleared is no description: the generated sentence shows in its place.\n    const save = (confirmed: string) => {\n        const written = draft.type === \"some\" ? draft.value.trim() : \"\";\n        return onSave(confirmed, written === \"\" ? none : some(written));\n    };\n\n    const edited = draft.type === \"some\";\n    const text = edited ? draft.value : generated;\n    const hint = edited\n        ? m.descriptionCount({ count: f.number(text.length), max: f.number(DESCRIPTION_MAX), n: text.length })\n        : m.descriptionGenerated();\n    return (\n        <NamePopover\n            {...hangs}\n            open={open}\n            onOpenChange={onOpenChange}\n            label={phone\n                ? <>{m.saveQuery()}{pending > 0 && <> <Box as=\"span\" css={edit.hint}>{m.changesCount({ n: pending, count: f.number(pending) })}</Box></>}</>\n                : <>{m.saveQuery()} · <Box as=\"span\" css={edit.clauseField}>{name}</Box></>}\n            nameLabel={phone ? m.nameLabel() : undefined}\n            nameHelp={phone ? m.nameHelp() : undefined}\n            primary={phone}\n            placeholder={m.queryName()}\n            initial={name}\n            taken={taken}\n            missing={m.queryNameMissing()}\n            nameTaken={(held) => m.queryNameHeld({ name: held })}\n            confirm={m.saveConfirm()}\n            cancel={m.cancel()}\n            onConfirm={save}\n        >\n            <Box css={edit.field} data-query-description=\"\">\n                {phone && <chakra.label css={edit.viewFieldLabel}>{m.descriptionLabel()}</chakra.label>}\n                <chakra.textarea css={[input, edit.textArea]} rows={3} maxLength={DESCRIPTION_MAX} value={text}\n                    placeholder={m.descriptionPlaceholder()} aria-label={m.descriptionPlaceholder()} aria-describedby={`${id}-hint`}\n                    data-generated={edited ? undefined : \"\"} onChange={onDescription} onKeyDown={onDescriptionKey} />\n                <Box css={edit.hintRow}>\n                    <Box as=\"span\" id={`${id}-hint`} css={edit.hint}>{hint}</Box>\n                    {edited && (\n                        <chakra.button type=\"button\" css={edit.hintAction} onClick={restore}>{m.restoreGenerated()}</chakra.button>\n                    )}\n                </Box>\n            </Box>\n        </NamePopover>\n    );\n}, (prev, next) =>\n    prev.open === next.open && prev.name === next.name && prev.generated === next.generated\n    && descriptionEquivalent(prev.description, next.description)\n    && Object.is(prev.taken, next.taken) && Object.is(prev.trigger, next.trigger) && Object.is(prev.anchor, next.anchor)\n    && Object.is(prev.onOpenChange, next.onOpenChange) && Object.is(prev.onSave, next.onSave) && prev.phone === next.phone && prev.pending === next.pending);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The builder's status line (#936), under the pane and the results\n * (`Query Editor Spec.md` §4.12), in the `status` recipe's dots and words:\n *\n * - **its start**: the check — \"Checks clean\", \"{n} to finish\", \"{n}\n *   problems\", or \"{n} warnings\" in the jq view — then \"Gives {shape}\", its\n *   East type and multiplicity on hover, and its fields;\n * - **its end**: the save state — \"Saved\", its dot the success ink just\n *   after a save, then quiet; \"Unsaved changes\" while the session has drafts;\n *   \"Not saved\" for a query never saved — and the query's name.\n *\n * @packageDocumentation\n */\n\nimport { memo } from \"react\";\nimport { Box, useSlotRecipe } from \"@chakra-ui/react\";\nimport { Tip, type Styles } from \"./parts.js\";\n\n/** The check, as the status line says it. */\nexport interface QueryCheckLine {\n    /** Its dot's tone. */\n    readonly tone: \"success\" | \"warning\" | \"danger\";\n    /** Its word: \"Checks clean\", \"2 to finish\", \"1 problem\". */\n    readonly word: string;\n}\n\n/** The shape the query gives, as the status line says it. */\nexport interface QueryGivesLine {\n    /** \"Gives up to 10 shipped orders\". */\n    readonly text: string;\n    /** Its East type and multiplicity, on hover. */\n    readonly hover: string;\n    /** Its fields: \"· order, customer, total\". */\n    readonly fields: string;\n}\n\n/** The save state, as the status line says it. */\nexport interface QuerySaveLine {\n    /** Saved, drafts not yet saved, or never saved. */\n    readonly state: \"saved\" | \"unsaved\" | \"new\";\n    /** Whether it saved just now: its dot is the success ink for a moment, then quiet. */\n    readonly fresh: boolean;\n    /** Its word. */\n    readonly word: string;\n}\n\n/** Props of {@link QueryStatusLine}. */\nexport interface QueryStatusLineProps {\n    /** The check. */\n    readonly check: QueryCheckLine;\n    /** The shape the query gives, when it is known. */\n    readonly gives: QueryGivesLine | undefined;\n    /** The save state. */\n    readonly save: QuerySaveLine;\n    /** The query's name. */\n    readonly name: string;\n}\n\n/** The save state's dot: the success ink just after a save, then quiet; the brand's with drafts; an open ring for a query never saved. */\nfunction saveDot(save: QuerySaveLine): { status: \"success\" | \"brand\" | \"neutral\"; ring: boolean } {\n    switch (save.state) {\n        case \"saved\": return { status: save.fresh ? \"success\" : \"neutral\", ring: false };\n        case \"unsaved\": return { status: \"brand\", ring: false };\n        case \"new\": return { status: \"neutral\", ring: true };\n    }\n}\n\n/**\n * Renders the status line — see the module docs.\n *\n * @param props - The check, the shape, the save state and the name ({@link QueryStatusLineProps})\n * @returns The status line\n */\nexport const QueryStatusLine = memo(function QueryStatusLine({ check, gives, save, name }: QueryStatusLineProps) {\n    const styles = useSlotRecipe({ key: \"queryBuilder\" })() as Styles;\n    const statusRecipe = useSlotRecipe({ key: \"status\" });\n    const checkDot = statusRecipe({ status: check.tone, size: \"sm\" }) as Styles;\n    const saveStyles = statusRecipe({ ...saveDot(save), size: \"sm\" }) as Styles;\n    return (\n        <Box css={styles.status} data-query-status=\"\">\n            <Box css={styles.statusCheck} data-query-check={check.tone}>\n                <Box as=\"span\" css={checkDot.root}>\n                    <Box as=\"span\" css={checkDot.indicator} aria-hidden />\n                    <Box as=\"span\" css={checkDot.label}>{check.word}</Box>\n                </Box>\n                {gives !== undefined && (\n                    <>\n                        <Box as=\"span\" css={styles.statusRule} aria-hidden />\n                        <Tip label={gives.hover}>\n                            <Box as=\"span\" css={styles.statusShape} data-query-gives=\"\">{gives.text}</Box>\n                        </Tip>\n                        <Box as=\"span\" css={styles.statusFields}>{gives.fields}</Box>\n                    </>\n                )}\n            </Box>\n            <Box css={styles.statusSave} data-query-save={save.state} data-fresh={save.fresh ? \"\" : undefined}>\n                <Box as=\"span\" css={saveStyles.root}>\n                    <Box as=\"span\" css={saveStyles.indicator} aria-hidden />\n                    <Box as=\"span\" css={saveStyles.label}>{save.word}</Box>\n                </Box>\n                <Box as=\"span\" css={styles.statusName} data-query-name=\"\">{name}</Box>\n            </Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Editing the open query (#936) — what the Query tab's parts, the toolbar and\n * the status line do to the open query, each one gesture of its editing\n * session (#935), with its label in the history:\n *\n * - **the parts** (`Query Editor Spec.md` §4.3, §4.5): a slot opens the\n *   autocomplete, and picking its offer sets it (#934's `applySlot`); an\n *   input typed in and left; a ×; an add; a fix; a step moved or taken out;\n *   Quick add. A pick opens the slot it names next, by its key, once the\n *   query has rendered again, and a step added scrolls into view;\n * - **Visual · jq** (§4.8): to jq prints the program, a note counting the\n *   unfinished steps left out; the jq typed in and left is one gesture —\n *   steps where it parses into them, else the program as jq — and a fix taken\n *   in the jq view (#937) one more, after the jq typed before it; back to\n *   visual keeps jq while the jq does not parse, and says which parts stay jq\n *   steps;\n * - **the check** (§4.12): the steps' check in the visual view, the jq's in\n *   the jq view, and the shape the query gives.\n *\n * Nothing here reads data but a slot's summary, fetched when a slot that\n * needs one opens (#934, #935).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { checkJq, describeJqType, none, some, type CheckJqResult } from \"@elaraai/east\";\nimport type { Origin } from \"@elaraai/east-ui-components\";\nimport { cardsFor, sourceCard, type Card, type SourceCard } from \"./model/cards.js\";\nimport type { ActionRef, InputRef, RemoveRef, SlotRef } from \"./model/refs.js\";\nimport {\n    activeItem, applyAction, applyInput, applyRemove, applySlot, quickAddOptions, slotEmpty, slotHint, slotItems, slotLabel, slotPlaceholder,\n    type SavedOffer, type SlotItem, type StepOption,\n} from \"./model/slots.js\";\nimport { summaryAt, summaryNeeded, type SummaryCache } from \"./model/summaries.js\";\nimport { fieldLabels, parseErrorWords, shapeWords, type QueryWords } from \"./model/words.js\";\nimport type { QueryRoot } from \"./one-shot.js\";\nimport { slotKey } from \"./parts.js\";\nimport { entriesQuery, queryEntries, queryProgram, type QueryEntry, type QueryHeader } from \"./session.js\";\nimport type { CardActions } from \"./step-card.js\";\nimport type { QueryCheckLine, QueryGivesLine } from \"./status-line.js\";\nimport { checkSteps, type CheckedSteps, type StepFix } from \"./steps/check.js\";\nimport { applyFix, moveStep, removeStep } from \"./steps/edit.js\";\nimport { parseSteps } from \"./steps/parse.js\";\nimport { printSteps } from \"./steps/print.js\";\nimport { shapeOf, type Shape } from \"./steps/shape.js\";\nimport { isComplete, type StepKind, type StepQuery } from \"./steps/values.js\";\nimport { shownView } from \"../shared/views.js\";\nimport type { QueryView } from \"./toolbar.js\";\n\n/** A notice at the top of the Query tab: what just happened. */\nexport interface QueryNotice {\n    /** Its identity among the notices. */\n    readonly id: number;\n    /** What it says. */\n    readonly text: string;\n}\n\n/** A slot's autocomplete, open. */\nexport interface OpenSlot {\n    /** The slot. */\n    readonly ref: SlotRef;\n    /** Its key. */\n    readonly key: string;\n    /** The element it hangs from. */\n    readonly anchor: HTMLElement;\n}\n\n/** What the autocomplete of the open slot shows, and what it is told. */\nexport interface SlotPopover {\n    /** The slot. */\n    readonly slot: OpenSlot;\n    /** Changes when the offers' source does — a summary arriving — so the list opens afresh on its current value. */\n    readonly generation: string;\n    /** Its label, filter placeholder, footer, empty words and keys. */\n    readonly label: string;\n    readonly placeholder: string;\n    readonly hint: string;\n    readonly empty: string;\n    readonly keys: string;\n    /** The offers for the text typed. */\n    readonly items: readonly SlotItem[];\n    /** The text typed. */\n    readonly text: string;\n    /** The offer active as it opens. */\n    readonly initialActive: number;\n    /** Told each change of the text. */\n    readonly onText: (text: string) => void;\n    /** Told the offer picked. */\n    readonly onPick: (item: SlotItem) => void;\n    /** Told it closes. */\n    readonly onClose: () => void;\n}\n\n/** What editing the open query needs. */\nexport interface QueryEditorOptions {\n    /** The query's entries as its drafts stand. */\n    readonly entries: readonly QueryEntry[];\n    /** The query's entries as the drafts stand this moment — after a gesture in the same event, too. */\n    readonly current: () => readonly QueryEntry[] | undefined;\n    /** Records a gesture: the entries it leaves, as one transaction. */\n    readonly gesture: (next: readonly QueryEntry[], origin: Origin, label: string) => boolean;\n    /** Moves with every change of the session. */\n    readonly version: number;\n    /** The root. */\n    readonly root: QueryRoot;\n    /** The views this builder offers, in the switch's order: the `views` prop's. */\n    readonly views: readonly QueryView[];\n    /** The words. */\n    readonly words: QueryWords;\n    /** The builder's summaries, and the latest hash of each data source a run has read. */\n    readonly summaries: { readonly cache: SummaryCache; readonly hashes: ReadonlyMap<string, string> };\n    /** The saved queries the add-step list of a query with no steps offers. */\n    readonly saved: readonly SavedOffer[];\n    /** Opens a saved query picked from the add-step list. */\n    readonly onOpenSaved: (name: string) => void;\n    /** Shows the Query tab, the pane expanded: Visual · jq picked. */\n    readonly onShowQuery: () => void;\n    /** The builder's element: the autocomplete hangs inside it, and the slots are found in it. */\n    readonly bounds: () => HTMLElement | null;\n    /** Its session's source id: another query opened starts afresh. */\n    readonly sourceId: string;\n    /** The rows a fresh run of the steps counted at each stage, by step id (#938): the shape lines count them. */\n    readonly counts?: ReadonlyMap<string, number> | undefined;\n    /**\n     * The notice a query arrives with when it opens (#939) — \"Opened “Big\n     * orders” from the library.\", \"Started a new query on customers.\" — by its\n     * session's source id: shown when that query opens, in place of the last\n     * query's notices.\n     */\n    readonly arrival?: { readonly sourceId: string; readonly text: string } | undefined;\n}\n\n/** Editing the open query: what the surfaces draw, and what they do. */\nexport interface QueryEditor {\n    /** The header. */\n    readonly header: QueryHeader;\n    /** The steps, as a query on the header's data source. */\n    readonly query: StepQuery;\n    /** The steps' check; `undefined` while the program is jq. */\n    readonly checked: CheckedSteps | undefined;\n    /** The source's card, and each step's; empty while the program is jq. */\n    readonly source: SourceCard | undefined;\n    readonly cards: readonly Card[];\n    /** The Quick add buttons at the end of the query. */\n    readonly quick: readonly StepOption[];\n    /** The view shown. */\n    readonly view: QueryView;\n    /** The views this builder offers: Visual · jq shows only where there are two. */\n    readonly views: readonly QueryView[];\n    /** Shows a view: to jq prints the program; back to visual parses it. */\n    readonly setView: (view: QueryView) => void;\n    /** The jq as typed, in the jq view. */\n    readonly jqText: string;\n    /** Told each change of the jq typed. */\n    readonly onJqText: (text: string) => void;\n    /** The jq typed in and left: one gesture. */\n    readonly leaveJq: () => void;\n    /** A fix taken in the jq view: the jq typed so far left, then the text the fix makes, a gesture of its own, under its label. */\n    readonly onJqFix: (text: string, label: string) => void;\n    /** The jq view's check of the jq as typed; `undefined` in the visual view. */\n    readonly jqChecked: CheckJqResult | undefined;\n    /** The jq view's note: unfinished steps left out, or the jq kept for its syntax. */\n    readonly jqNote: string | undefined;\n    /** The root, which the jq view completes and reads steps over. */\n    readonly root: QueryRoot;\n    /** The builder's summaries, whose values the jq view's completions offer. */\n    readonly summaries: QueryEditorOptions[\"summaries\"];\n    /** The program as it stands: what Run runs and Copy jq copies — in the jq view, the jq as typed. */\n    readonly program: string;\n    /** The status line's check, and the shape the query gives. */\n    readonly check: QueryCheckLine;\n    readonly gives: QueryGivesLine | undefined;\n    /** The notices, newest last; a notice dismissed. */\n    readonly notices: readonly QueryNotice[];\n    readonly dismiss: (id: number) => void;\n    /** The parts' and the cards' asks. */\n    readonly actions: CardActions;\n    /** A Quick add button pressed. */\n    readonly onQuick: (kind: StepKind) => void;\n    /** The open slot's autocomplete. */\n    readonly popover: SlotPopover | undefined;\n}\n\n/** The shape a query gives, in the status line's words. */\nfunction givesLine(shape: Shape, words: QueryWords): QueryGivesLine | undefined {\n    if (shape.kind === \"unknown\") return undefined;\n    const m = words.messages;\n    return {\n        text: m.gives({ shape: shapeWords(shape, words) }),\n        hover: m.typeHover({ type: describeJqType(shape.type, { maxDepth: 2 }), multiplicity: shape.multiplicity ?? \"\" }),\n        fields: m.givesFields({ fields: shape.kind === \"rows\" ? fieldLabels(shape) : [] }),\n    };\n}\n\n/** The element in the builder that carries a slot's key. */\nfunction slotElement(bounds: HTMLElement | null, key: string): HTMLElement | undefined {\n    if (bounds === null) return undefined;\n    for (const el of bounds.querySelectorAll<HTMLElement>(\"[data-slot-key]\")) {\n        if (el.getAttribute(\"data-slot-key\") === key) return el;\n    }\n    return undefined;\n}\n\n/**\n * Editing the open query — see the module docs.\n *\n * @param options - The session's entries and gesture, the root, the words and the builder's element\n * @returns What the surfaces draw, and what they do\n */\nexport function useQueryEditor(options: QueryEditorOptions): QueryEditor {\n    const { entries, current, gesture, version, root, views, words, summaries, saved, onOpenSaved, onShowQuery, bounds, sourceId, counts, arrival } = options;\n    const m = words.messages;\n    const { header, query } = useMemo(() => entriesQuery(entries), [entries]);\n    const isJq = header.jq.type === \"some\";\n    const checked = useMemo(() => (isJq ? undefined : checkSteps(query, root.type)), [isJq, query, root]);\n    const source = useMemo(() => (checked === undefined ? undefined : sourceCard(query, root.type, checked, words, counts)), [checked, query, root, words, counts]);\n    const cards = useMemo(() => (checked === undefined ? [] : cardsFor(query, root.type, checked, words, counts)), [checked, query, root, words, counts]);\n    const quick = useMemo(() => (checked === undefined ? [] : quickAddOptions(checked.final, root.type, words)), [checked, root, words]);\n    const held = useMemo(() => queryProgram(header, query, root.type), [header, query, root]);\n\n    // ── Notices ─────────────────────────────────────────────────────────\n    const [notices, setNotices] = useState<readonly QueryNotice[]>([]);\n    const noticeId = useRef(0);\n    const notify = useCallback((text: string) => {\n        noticeId.current += 1;\n        const id = noticeId.current;\n        setNotices((was) => [...was, { id, text }]);\n    }, []);\n    const dismiss = useCallback((id: number) => setNotices((was) => was.filter((n) => n.id !== id)), []);\n\n    // ── The view, and the jq as typed: the open query's own ─────────────\n    // Each is held with the session it is of, so a query opened shows its own\n    // from its first render: the visual view, its program as jq, no note.\n    // Never, for a render, the last query's view and jq — which the run opening\n    // it would run, and leave on it as a draft (#1132).\n    const [viewState, setViewState] = useState<{ readonly sourceId: string; readonly view: QueryView }>({ sourceId, view: \"visual\" });\n    const [typed, setTyped] = useState<{ readonly sourceId: string; readonly text: string }>(() => ({ sourceId, text: held }));\n    const [noteState, setNoteState] = useState<{ readonly sourceId: string; readonly note: string | undefined }>({ sourceId, note: undefined });\n    const jqText = typed.sourceId === sourceId ? typed.text : held;\n    const setJqText = useCallback((text: string) => setTyped({ sourceId, text }), [sourceId]);\n    const setJqNote = useCallback((note: string | undefined) => setNoteState({ sourceId, note }), [sourceId]);\n    // A program that is not steps shows as jq, and says why, whatever the views offered: it can show no other way.\n    const view: QueryView = isJq ? \"jq\" : shownView(viewState.sourceId === sourceId ? viewState.view : \"visual\", views);\n    const whyJq = useMemo(() => {\n        if (!isJq) return undefined;\n        const parsed = parseSteps(held, root.type);\n        return \"error\" in parsed ? (parsed.error.code === \"syntax\" ? m.fixSyntaxFirst() : parseErrorWords(parsed.error, words)) : undefined;\n    }, [isJq, held, root, m, words]);\n    const jqNote = (noteState.sourceId === sourceId ? noteState.note : undefined) ?? whyJq;\n    // The program the jq typed and left made: the session's change that is not\n    // the jq's own — an undo — puts the program back in the jq view.\n    const flushed = useRef<string | undefined>(undefined);\n    useEffect(() => {\n        if (flushed.current !== undefined && flushed.current === held) {\n            flushed.current = undefined;\n            return;\n        }\n        flushed.current = undefined;\n        setJqText(held);\n    }, [held, setJqText]);\n    // Another query opened: its own notices — the notice it arrives with, if any.\n    const arriving = useRef(arrival);\n    useEffect(() => { arriving.current = arrival; }, [arrival]);\n    const shown = useRef(sourceId);\n    useEffect(() => {\n        if (shown.current === sourceId) return;\n        shown.current = sourceId;\n        const notice = arriving.current;\n        if (notice !== undefined && notice.sourceId === sourceId) {\n            noticeId.current += 1;\n            setNotices([{ id: noticeId.current, text: notice.text }]);\n        } else {\n            setNotices([]);\n        }\n    }, [sourceId]);\n\n    /**\n     * The jq typed in and left, under a label: steps where it parses into them,\n     * else the program as jq. It is taken against the drafts as they stand,\n     * so a gesture before it in the same event composes. Whether it parses.\n     */\n    const flushJq = useCallback((text: string, label: string = m.editJqGesture()): boolean => {\n        const now = entriesQuery(current() ?? entries);\n        const program = queryProgram(now.header, now.query, root.type);\n        const parsed = parseSteps(text, root.type);\n        if (\"error\" in parsed) {\n            if (text !== program) {\n                flushed.current = text;\n                gesture(queryEntries({ ...now.header, jq: some(text) }, []), \"typed\", label);\n            }\n            return false;\n        }\n        const printed = printSteps(parsed.query, root.type).text;\n        if (printed !== program || now.header.jq.type === \"some\") {\n            flushed.current = printed;\n            gesture(queryEntries({ ...now.header, jq: none, source: parsed.query.source }, parsed.query.steps), \"typed\", label);\n        }\n        return true;\n    }, [current, entries, root, gesture, m]);\n\n    const leaveJq = useCallback(() => {\n        if (view !== \"jq\" || jqText === held) return;\n        flushJq(jqText);\n    }, [view, jqText, held, flushJq]);\n\n    const onJqFix = useCallback((text: string, label: string) => {\n        leaveJq();\n        setJqText(text);\n        flushJq(text, label);\n    }, [leaveJq, setJqText, flushJq]);\n\n    const setView = useCallback((next: QueryView) => {\n        onShowQuery();\n        if (next === view) return;\n        if (next === \"jq\") {\n            const unfinished = query.steps.filter((s) => !isComplete(s)).length;\n            setJqText(held);\n            setJqNote(unfinished === 0 ? undefined : m.unfinishedLeftOut({ count: words.formatters.number(unfinished), n: unfinished }));\n            setViewState({ sourceId, view: \"jq\" });\n            return;\n        }\n        // Back to visual: the jq parsed into steps, or kept while it does not parse.\n        const parsed = parseSteps(jqText, root.type);\n        if (\"error\" in parsed) {\n            if (jqText !== held) flushJq(jqText);\n            setJqNote(parsed.error.code === \"syntax\" ? m.fixSyntaxFirst() : parseErrorWords(parsed.error, words));\n            return;\n        }\n        flushJq(jqText);\n        setJqNote(undefined);\n        setViewState({ sourceId, view: \"visual\" });\n        const raw = parsed.query.steps.filter((s) => s.type === \"jq\").length;\n        if (raw > 0) notify(m.jqPartsStay({ count: words.formatters.number(raw), n: raw }));\n    }, [onShowQuery, view, query, held, jqText, setJqText, setJqNote, sourceId, root, flushJq, notify, m, words]);\n\n    // ── The check, and the shape the query gives ────────────────────────\n    const jqCheck = useMemo(() => (view === \"jq\" || isJq ? checkJq(view === \"jq\" ? jqText : held, root.type, { root: true }) : undefined), [view, isJq, jqText, held, root]);\n    const { check, gives } = useMemo((): { check: QueryCheckLine; gives: QueryGivesLine | undefined } => {\n        const f = words.formatters;\n        if (jqCheck !== undefined) {\n            const errors = jqCheck.diagnostics.filter((d) => d.severity.type === \"error\").length;\n            const warnings = jqCheck.diagnostics.filter((d) => d.severity.type === \"warning\").length;\n            const shape = jqCheck.elementType === null ? undefined : shapeOf(jqCheck.elementType, jqCheck.multiplicity, { noun: \"row\" });\n            return {\n                check: errors > 0 ? { tone: \"danger\", word: m.problemCount({ count: f.number(errors), n: errors }) }\n                    : warnings > 0 ? { tone: \"warning\", word: m.warningCount({ count: f.number(warnings), n: warnings }) }\n                        : { tone: \"success\", word: m.checksClean() },\n                gives: errors > 0 || shape === undefined ? undefined : givesLine(shape, words),\n            };\n        }\n        const errors = checked?.errors ?? 0;\n        const unfinished = query.steps.filter((s) => !isComplete(s)).length;\n        return {\n            check: errors > 0 ? { tone: \"danger\", word: m.problemCount({ count: f.number(errors), n: errors }) }\n                : unfinished > 0 ? { tone: \"warning\", word: m.toFinish({ count: f.number(unfinished), n: unfinished }) }\n                    : { tone: \"success\", word: m.checksClean() },\n            gives: checked === undefined ? undefined : givesLine(checked.final, words),\n        };\n    }, [jqCheck, checked, query, words, m]);\n\n    // ── Gestures ────────────────────────────────────────────────────────\n    const commit = useCallback((next: StepQuery, origin: Origin, label: string): boolean =>\n        gesture(queryEntries({ ...header, source: next.source }, next.steps), origin, label), [gesture, header]);\n    // The slot a gesture opens next, and the step it added: found once the query renders again.\n    const chained = useRef<{ open: SlotRef | undefined; added: string | undefined } | undefined>(undefined);\n    const [open, setOpen] = useState<OpenSlot | undefined>(undefined);\n    const [text, setText] = useState(\"\");\n    useEffect(() => {\n        const next = chained.current;\n        if (next === undefined) return;\n        chained.current = undefined;\n        const el = bounds();\n        if (next.added !== undefined) {\n            const card = el?.querySelector<HTMLElement>(`[data-step-id=\"${next.added}\"]`);\n            card?.scrollIntoView?.({ block: \"nearest\" });\n        }\n        if (next.open === undefined) return;\n        const key = slotKey(next.open);\n        const anchor = slotElement(el, key);\n        if (anchor !== undefined) {\n            setOpen({ ref: next.open, key, anchor });\n            setText(\"\");\n        }\n    }, [version, bounds]);\n    const chain = (openNext: SlotRef | undefined, added: string | undefined) => {\n        chained.current = { open: openNext, added };\n    };\n\n    const stepNumber = useCallback((stepId: string) => words.formatters.bare(query.steps.findIndex((s) => s.value.id === stepId) + 1), [query, words]);\n\n    const onSlot = useCallback((ref: SlotRef, anchor: HTMLElement) => {\n        const key = slotKey(ref);\n        if (open?.key === key) {\n            setOpen(undefined);\n            return;\n        }\n        setOpen({ ref, key, anchor });\n        setText(\"\");\n    }, [open]);\n    const onInput = useCallback((input: InputRef, raw: string) => {\n        commit(applyInput(query, input, raw, root.type, words), \"typed\", m.setGesture({ what: m.inputLabel({ input: input.kind }) }));\n    }, [commit, query, root, words, m]);\n    const onRemove = useCallback((ref: RemoveRef) => {\n        commit(applyRemove(query, ref), \"remove\", m.remove());\n    }, [commit, query, m]);\n    const onAction = useCallback((ref: ActionRef, anchor: HTMLElement) => {\n        if (ref.kind === \"open\") {\n            if (ref.slot !== undefined) onSlot(ref.slot, anchor);\n            return;\n        }\n        const result = applyAction(query, ref, root.type);\n        const label = ref.kind === \"add-condition\" ? m.addCondition() : ref.kind === \"add-group\" ? m.addGroup() : m.addTotal();\n        if (commit(result.query, \"insert\", label)) chain(result.open, undefined);\n    }, [query, root, commit, onSlot, m]);\n    const onFix = useCallback((fix: StepFix, label: string) => {\n        commit(applyFix(query, fix, root.type), fix.kind === \"removeStep\" ? \"remove\" : \"typed\", label);\n    }, [commit, query, root]);\n    const onMove = useCallback((stepId: string, by: -1 | 1) => {\n        commit(moveStep(query, stepId, by), \"move\", m.moveStepGesture({ n: stepNumber(stepId), up: by < 0 }));\n    }, [commit, query, stepNumber, m]);\n    const onRemoveStep = useCallback((stepId: string) => {\n        commit(removeStep(query, stepId), \"remove\", m.removeStepGesture({ n: stepNumber(stepId) }));\n    }, [commit, query, stepNumber, m]);\n\n    /** A step picked from the add-step list, or pressed in Quick add: added with its defaults, its first empty slot opened. */\n    const addStep = useCallback((slot: SlotRef, item: SlotItem): void => {\n        const result = applySlot(query, slot, item, root.type, words);\n        if (result.opened !== undefined) {\n            onOpenSaved(result.opened);\n            return;\n        }\n        const added = result.added === undefined ? undefined : result.query.steps.find((s) => s.value.id === result.added);\n        const label = added === undefined ? m.setGesture({ what: item.label }) : m.addStepGesture({ step: m.stepTitle({ kind: added.type, noun: query.source }) });\n        if (commit(result.query, \"insert\", label)) chain(result.open, result.added);\n    }, [query, root, words, onOpenSaved, commit, m]);\n    const onQuick = useCallback((kind: StepKind) => {\n        addStep({ kind: \"add-step\", stepId: \"\" }, { value: { kind: \"step\", step: kind }, label: m.quickAddLabel({ kind }), group: m.addStepGroup() });\n    }, [addStep, m]);\n\n    const actions = useMemo((): CardActions => ({\n        openSlot: open?.key, onSlot, onInput, onRemove, onAction, onFix, onMove, onRemoveStep,\n    }), [open, onSlot, onInput, onRemove, onAction, onFix, onMove, onRemoveStep]);\n\n    // ── The open slot's autocomplete ────────────────────────────────────\n    // A slot whose step is gone — undone, removed — closes.\n    const openRef = open?.ref;\n    const openStep = openRef === undefined || openRef.kind === \"add-step\" ? -1 : query.steps.findIndex((s) => s.value.id === openRef.stepId);\n    const gone = openRef !== undefined && openRef.kind !== \"add-step\" && openStep < 0;\n    useEffect(() => { if (gone) setOpen(undefined); }, [gone]);\n    const request = useMemo(() => (openRef === undefined || openStep < 0 || !summaryNeeded(openRef.kind) || isJq ? undefined\n        : summaryAt(query, openStep, root.type)), [openRef, openStep, query, root, isJq]);\n    const { cache, hashes } = summaries;\n    const [arrived, setArrived] = useState(0);\n    useEffect(() => {\n        if (request === undefined || cache.get(request, hashes) !== undefined) return;\n        let live = true;\n        void cache.ensure(request, hashes).then((summary) => { if (live && summary !== undefined) setArrived((n) => n + 1); });\n        return () => { live = false; };\n    }, [request, cache, hashes]);\n    const summary = request === undefined ? undefined : cache.get(request, hashes);\n    const items = useMemo(() => (openRef === undefined || gone ? []\n        : slotItems(query, root.type, openRef, text, { words, ...(summary === undefined ? {} : { summary }), saved })),\n    // `arrived` moves when a summary lands in the cache.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [openRef, gone, query, root, text, words, summary, saved, arrived]);\n    const initialActive = useMemo(() => (openRef === undefined ? -1 : activeItem(items, query, root.type, openRef)),\n    // It opens on the slot's current value: the offers as they were when they arrived.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [openRef, summary === undefined, query]);\n\n    const onPick = useCallback((item: SlotItem) => {\n        if (open === undefined) return;\n        const slot = open.ref;\n        setOpen(undefined);\n        setText(\"\");\n        if (slot.kind === \"add-step\") {\n            addStep(slot, item);\n            return;\n        }\n        const result = applySlot(query, slot, item, root.type, words);\n        if (commit(result.query, \"typed\", m.setGesture({ what: item.label }))) chain(result.open, result.added);\n    }, [open, addStep, query, root, words, commit, m]);\n    const onClose = useCallback(() => {\n        setOpen(undefined);\n        setText(\"\");\n    }, []);\n\n    const popover = useMemo((): SlotPopover | undefined => (open === undefined || gone ? undefined : {\n        slot: open,\n        generation: `${open.key}|${summary === undefined ? \"\" : \"summary\"}`,\n        label: slotLabel(open.ref, words),\n        placeholder: slotPlaceholder(open.ref, words),\n        hint: slotHint(open.ref, words),\n        empty: slotEmpty(open.ref, words),\n        keys: m.slotKeys(),\n        items,\n        text,\n        initialActive,\n        onText: setText,\n        onPick,\n        onClose,\n    }), [open, gone, summary, words, m, items, text, initialActive, onPick, onClose]);\n\n    return {\n        header, query, checked, source, cards, quick,\n        view, views, setView, jqText, onJqText: setJqText, leaveJq, onJqFix, jqChecked: view === \"jq\" ? jqCheck : undefined, jqNote, root, summaries,\n        program: view === \"jq\" ? jqText : held,\n        check, gives, notices, dismiss, actions, onQuick, popover,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The open query's editing session, in React (#935) — the shared editing\n * session (`useEditSession`) over the query's entries, one per open query,\n * kept in the UI store with its drafts, so opening another query and back\n * finds them as they were.\n *\n * The surfaces edit through it: each gesture is one `gesture(next, origin,\n * label)` — the query's entries after it — and one undoable transaction. The\n * history item's actions go through `onAction`: Apply saves the open query as\n * one patch commit, but a query never saved is named first. A save under a\n * new name opens the query it saved once its session has acknowledged the\n * commit.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { none, some, variant } from \"@elaraai/east\";\nimport {\n    StateRuntime, useEditSession,\n    type BatchReadiness, type EditSession, type EditingValue, type EntryVersion, type HistoryAction, type Origin,\n} from \"@elaraai/east-ui-components\";\nimport type { QueryWords } from \"./model/words.js\";\nimport type { QueryRoot } from \"./one-shot.js\";\nimport { querySourceId, type QueryOpen } from \"./open-query.js\";\nimport {\n    QUERY_DRAFT_TYPE, QUERY_ENTRY_TYPE, encodeBase, entriesQuery, entryId, queryApply, queryBase, queryReadiness, readBaseEntry,\n    recordGesture,\n    type QueriesHandle, type QueryBase, type QueryEntry, type SavedQueries,\n} from \"./session.js\";\n\n/** What the open query's session needs. */\nexport interface QuerySessionOptions {\n    /** The saved queries record, bound with its patch. */\n    readonly handle: QueriesHandle;\n    /** The record as it reads now; `undefined` while it has not been read. */\n    readonly record: SavedQueries | undefined;\n    /** The root, or why it cannot be queried. */\n    readonly root: QueryRoot | string;\n    /** The open query. */\n    readonly open: QueryOpen;\n    /** Opens another query. */\n    readonly writeOpen: (next: QueryOpen) => void;\n    /** The builder's storage key: the session's view. */\n    readonly storageKey: string;\n    /** The words. */\n    readonly words: QueryWords;\n}\n\n/** The open query's session, and what the surfaces do through it. */\nexport interface QuerySessionState {\n    /** The session: its history, its drafts, its request. */\n    readonly session: EditSession<QueryEntry>;\n    /** Its session's source id. */\n    readonly sourceId: string;\n    /** What it began from; `undefined` while the record has not been read, or the open saved query is not in it. */\n    readonly base: QueryBase | undefined;\n    /** The query's entries as its drafts stand. */\n    readonly entries: readonly QueryEntry[] | undefined;\n    /** Whether a gesture may be recorded now. */\n    readonly available: boolean;\n    /** Moves with every change of the session. */\n    readonly version: number;\n    /** The query's entries as the drafts stand this moment — after a gesture in the same event, too. */\n    readonly current: () => readonly QueryEntry[] | undefined;\n    /** Records a gesture: the entries it leaves, as one transaction. */\n    readonly gesture: (next: readonly QueryEntry[], origin: Origin, label: string) => boolean;\n    /** Runs a history item's action. */\n    readonly onAction: (action: HistoryAction) => void;\n    /** Whether a query never saved has asked for its name, with Apply. */\n    readonly naming: boolean;\n    /** Asks for, or stops asking for, a name. */\n    readonly setNaming: (naming: boolean) => void;\n}\n\n/**\n * The open query's editing session — see the module docs.\n *\n * @param options - The record, the root, the open query and the words\n * @returns The session, and what the surfaces do through it\n */\nexport function useQuerySession(options: QuerySessionOptions): QuerySessionState {\n    const { handle, record, root, open, writeOpen, storageKey, words } = options;\n    const m = words.messages;\n    const store = StateRuntime.getStore();\n    const sourceId = querySourceId(open);\n\n    // The base it begins from: the saved query's entries, parsed once, or a\n    // new query's header.\n    // A save moves the base to the entries it applied, the moment it commits:\n    // `saves` counts them, so the base is found again whichever comes first,\n    // the commit's answer or the record's re-read.\n    const [saves, setSaves] = useState(0);\n    const untitled = useCallback((source: string) => m.untitled({ source }), [m]);\n    const base = useMemo(() => (record === undefined || typeof root === \"string\"\n        ? undefined\n        : queryBase(store, sourceId, open, record, root.type, untitled)),\n    // `saves` is read through queryBase's memory of the save.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [record, root, store, sourceId, open, untitled, saves]);\n\n    const [renamedTo, setRenamedTo] = useState<string | undefined>(undefined);\n    const [naming, setNaming] = useState(false);\n    const session = useRef<EditSession<QueryEntry> | undefined>(undefined);\n    const snapshot = useMemo(() => (base === undefined ? undefined : encodeBase(base)), [base]);\n    const onApply = useMemo(() => (base === undefined || typeof root === \"string\" ? undefined : queryApply({\n        handle, open, base, root, store, sourceId,\n        sourceIdOf: (name) => querySourceId(variant(\"saved\", name)),\n        refused: (why, name, by) => (why === \"renamed\" ? m.nameTaken({ name }) : m.savedChanged({ name, by })),\n        onSaved: (name) => {\n            setSaves((n) => n + 1);\n            if (open.type === \"new\" || open.value !== name) setRenamedTo(name);\n        },\n    })), [base, root, handle, open, store, sourceId, m]);\n    const editing = useMemo((): EditingValue => ({\n        sourceId,\n        entryType: QUERY_ENTRY_TYPE,\n        idField: some(\"id\"),\n        draftType: QUERY_DRAFT_TYPE,\n        children: none,\n        keyType: none,\n        snapshot: snapshot === undefined ? none : some(snapshot),\n        readEntry: (entry: string) => (base === undefined ? none : readBaseEntry(base, entry)),\n        onPatch: none,\n        onApply: onApply === undefined ? none : some(variant(\"async\", onApply)),\n    }), [sourceId, snapshot, base, onApply]);\n    const rows = useMemo(() => base?.entries ?? [], [base]);\n    const positions = useMemo(() => rows.map((_, i) => i), [rows]);\n    // The check is the session's readiness, over the query as its drafts stand.\n    const ready = useCallback((): BatchReadiness => {\n        if (base === undefined) return variant(\"ready\", null);\n        const drafted = session.current?.applied() as readonly QueryEntry[] | undefined;\n        const { header, query } = entriesQuery(drafted ?? base.entries);\n        return queryReadiness(header, query, root, words).readiness;\n    }, [base, root, words]);\n    // A query's steps are parsed afresh from its saved program each time it is read, so their identities do not survive\n    // a re-read: a query another session saved under these drafts is out of date — saved under another name, or the\n    // drafts discarded (#936) — never carried over.\n    // Every Save of a query is a person's: one never saved asks its name first, and a saved one is a program others run —\n    // so the builder keeps no choice of an automatic Save.\n    const edit = useEditSession<QueryEntry>(editing, undefined, rows, positions, storageKey, { idOf: entryId, ready, carryOver: false, manualSave: true });\n    session.current = edit.session;\n    const { version, available, original } = edit;\n\n    // The query as its drafts stand, this moment: while a gesture may be\n    // recorded, and while a save of them goes — from Apply until the record\n    // reads back as it left it, the drafts it saves are the query, never the\n    // record as it stood before them. Out of date under another save, the\n    // person's own edits still show, over the query they began from, until\n    // they discard them.\n    const drafts = useCallback((): readonly QueryEntry[] | undefined => {\n        const drafted = available || edit.session.locked || edit.session.stale ? edit.session.applied() as readonly QueryEntry[] | undefined : undefined;\n        return drafted ?? base?.entries;\n    }, [edit.session, available, base]);\n    const entries = useMemo(() => drafts(),\n        // A gesture, and a save's progress, move the session's version, not its identity.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [drafts, version]);\n\n    // A save under a new name opens the query it saved, once its session has\n    // acknowledged the commit.\n    useEffect(() => {\n        if (renamedTo === undefined || edit.session.status !== \"idle\" || edit.session.pending !== 0) return;\n        writeOpen(variant(\"saved\", renamedTo));\n        setRenamedTo(undefined);\n    }, [renamedTo, edit.session, version, writeOpen]);\n\n    // Another query opened: its own name is asked for afresh.\n    const shown = useRef(sourceId);\n    useEffect(() => {\n        if (shown.current === sourceId) return;\n        shown.current = sourceId;\n        setNaming(false);\n    }, [sourceId]);\n\n    // A gesture is taken against the drafts as they stand when it is made, so\n    // two gestures in one event — the jq left, then the query named — compose.\n    const current = drafts;\n    const gesture = useCallback((next: readonly QueryEntry[], origin: Origin, label: string): boolean => {\n        const now = current();\n        if (now === undefined) return false;\n        return recordGesture(edit.session, original as (id: string) => EntryVersion<QueryEntry>, now, next, origin, label);\n    }, [edit.session, original, current]);\n\n    const onAction = useCallback((action: HistoryAction) => {\n        const s = edit.session;\n        switch (action) {\n            case \"undo\": s.undo(); return;\n            case \"redo\": s.redo(); return;\n            case \"discard\": s.discard(); return;\n            case \"refresh\": s.refresh(); return;\n            case \"apply\":\n                // A query never saved is named first (the save popover, #936).\n                if (open.type === \"new\") setNaming(true);\n                else void s.apply();\n                return;\n        }\n    }, [edit.session, open]);\n\n    return { session: edit.session, sourceId, base, entries, available, version, current, gesture, onAction, naming, setNaming };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraQueryBuilder` — the renderer of the `QueryBuilder` extension\n * declared in `@elaraai/e3-ui` (#935): the query builder, built in the browser\n * from its interface — the saved queries record bound with its patch, the data\n * sources it may read, and its name.\n *\n * As Studio's builder is the canvas's, it is:\n * - **the record**, read where the builder renders and again when it moves;\n *   a failed read is a banner;\n * - **the root**, each bound data source a root field, by its name\n *   ({@link useQueryRoot});\n * - **the open query**, the UI store's under the builder's key, which the\n *   query library writes when it opens a query; it begins as the saved query\n *   the payload names, else a new query on the first bound data source;\n * - **the editing session**, one per open query ({@link useQuerySession}):\n *   every gesture of the surfaces is one transaction, which the history item\n *   in the one toolbar undoes, redoes and discards, and Apply — the builder's\n *   Save — commits the query as one patch on the record, once it is finished\n *   and checks;\n * - **the layout**, the shared `BuilderFrame` (#1125): the one toolbar (#936:\n *   the history item, Copy jq, Save… and Run — a row short of room folding\n *   Copy jq and Save… into one ⋯ chip, #1229); the result's strips as its\n *   banners, under the toolbar, the builder's full width; the pane at its\n *   start, with the tabs Query — Visual · jq at the top of its body —\n *   Datasets and Library, its open tab and its collapse the builder's to\n *   drive, pinned beside the results while they keep their room and over\n *   them otherwise; the results as main, Table · Tree and Download ▾ in their\n *   band, which lines up with the pane's tab row; and the status line as its\n *   footer.\n *\n * The Query tab (#936) edits the open query ({@link useQueryEditor}), its\n * slots' autocomplete hanging inside the builder; Save… names and describes it\n * in the save popover, and saves it through the session's Apply. Run, ⌘/Ctrl ⏎\n * anywhere in the builder, and opening a saved query run it (#938, `run.ts`),\n * each run planned as one call or as a split call over a dataset larger than\n * one piece (#941, `plan.ts`): the results show what came back and how it was\n * read, a fresh visual run's counts its shape lines, and each run that answers\n * joins this viewer's recent queries. The\n * Datasets tab (#939) lists the data sources, and a click starts a new query\n * on one; the Library tab lists this viewer's recent runs and the saved\n * queries, and a click opens one, which runs. A query opened or started there\n * arrives with its notice — as one a query library sharing the builder's id\n * opens does (#1063) — and ⌘/Ctrl / opens the Datasets tab. The builder fills\n * its host and draws no border around itself.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { Box, Button, useSlotRecipe } from \"@chakra-ui/react\";\nimport { StringType, checkJq, equalFor, equivalentFor, none, variant, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { QueryBuilderComponent, QueryBuilderPayloadType, queryKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, BuilderFrame, EmptyStateView, NARROW_FRAME, SessionBanners, historyShortcut, historyToolbarItem, implementUIComponent, sessionErrorText, typedInto, useContainerWidth, usePersistedState,\n    useTrackedEvaluation,\n    type BuilderFrameDock, type EditIssue, type EditSession, type EditingWords,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingLine, keptRead } from \"@elaraai/east-ui-components/internal\";\nimport { useE3ConfigOptional } from \"../platform/e3-config.js\";\nimport { SlotAutocomplete } from \"./autocomplete.js\";\nimport { DatasetsTab, type SourceRole } from \"./datasets-tab.js\";\nimport { QueryDropTarget } from \"./drops.js\";\nimport {\n    useQueryCall, useQueryCollection, useQueryPlanOptions, useQueryRoot, useQuerySourceStatus, useQuerySplitCall, useQuerySplitExplain, useQuerySummaries, useRecentQueries,\n} from \"./hooks.js\";\nimport { downloadResult } from \"./downloads.js\";\nimport { describeQuery, type QueryWords } from \"./model/words.js\";\nimport type { Card } from \"./model/cards.js\";\nimport type { QueryResult, QueryRoot } from \"./one-shot.js\";\nimport { LibraryTab } from \"./library-tab.js\";\nimport { newQuery, useOpenQuery, type OpenQueryWrite, type QueryArrival, type QueryOpen } from \"./open-query.js\";\nimport { usePartStyles, type Styles } from \"./parts.js\";\nimport { QueryTabPanel } from \"./query-tab.js\";\nimport { QueryLiveBand, phoneQueryToolbar } from \"./phone.js\";\nimport { QueryPhoneView } from \"./phone-steps.js\";\nimport { QueryResults, ResultStrips, pickedView, resultFooter, resultToolbarItems, type DownloadFormat, type ResultView } from \"./results.js\";\nimport { canonicalProgram, planRun, useQueryRun, type RunPlan } from \"./run.js\";\nimport { QuerySavePopover } from \"./save-popover.js\";\nimport {\n    entriesQuery, queryEntries, queryProgram, rootRefusal, savedEntries, savedOffers, type QueryEntry, type SavedQueries, type SavedQuery,\n} from \"./session.js\";\nimport { QueryStatusLine, type QuerySaveLine } from \"./status-line.js\";\nimport { queryToolbarItems, type QueryView } from \"./toolbar.js\";\nimport { useQueryEditor } from \"./use-query-editor.js\";\nimport { useQuerySession, type QuerySessionState } from \"./use-query-session.js\";\nimport { useQueryEditingWords, useQueryWords } from \"./words.js\";\nimport { shownView, shownViews } from \"../shared/views.js\";\n\n/** The renderer's payload, decoded. */\ntype QueryBuilderValue = ValueTypeOf<typeof QueryBuilderComponent.schema>;\n\n/** The payload's equivalence: its data, and its functions by their IR and what they capture. */\nconst payloadEquivalent = equivalentFor(QueryBuilderPayloadType);\nconst nameEqual = equalFor(StringType);\n\n/** The query's views, in the switch's order. */\nconst QUERY_VIEWS = [\"visual\", \"jq\"] as const;\n/** The result's views, in the switch's order. */\nconst RESULT_VIEWS = [\"table\", \"tree\"] as const;\n\n/** How long \"Saved\" keeps the success ink after a save. */\nconst SAVED_MS = 1800;\n\n/** A tab of the pane. */\nexport type QueryTab = \"query\" | \"datasets\" | \"library\";\n\n/** Where an issue the history item goes to is: its step, and its slot. */\nexport interface QueryFocus {\n    /** The step's id, or `$query` for the query as a whole. */\n    readonly entry: string;\n    /** The slot, when the issue is on one. */\n    readonly slot: string | undefined;\n}\n\n/** Props of {@link EastChakraQueryBuilder}. */\nexport interface EastChakraQueryBuilderProps {\n    /** The payload, decoded. */\n    value: QueryBuilderValue;\n    /** The structural storage key. */\n    storageKey: string;\n}\n\n/**\n * Why the open query cannot be saved now, in the history item's words: the\n * first issue — a problem, a step not finished, the source's refusal — else\n * the session's error, else its state: drafts gone stale under a change of the\n * record, or another save of the query still running.\n */\nfunction refusalOf(session: EditSession<QueryEntry>, words: EditingWords): string {\n    const readiness = session.readiness;\n    const issues = readiness.type === \"ready\" ? session.issues : readiness.value;\n    if (issues.length > 0) return issues[0]!.message;\n    if (session.error !== undefined) return sessionErrorText(session.error, words);\n    if (session.stale) return words.m.historyStatus({ status: \"stale\" });\n    return words.m.historyStatus({ status: session.status === \"idle\" ? \"applying\" : session.status });\n}\n\n/**\n * Renders the query builder — see the module docs.\n *\n * @param props - The payload and its storage key\n * @returns The builder\n */\nexport const EastChakraQueryBuilder = memo(function EastChakraQueryBuilder({ value, storageKey }: EastChakraQueryBuilderProps) {\n    const words = useQueryWords();\n    const m = words.messages;\n    const { queries: handle, datasets } = value;\n    const id = value.id.type === \"some\" ? value.id.value : undefined;\n    const keys = useMemo(() => queryKeys(id), [id]);\n\n    // The record, read where the builder renders, and again when it moves.\n    const read = useCallback(() => handle.read(), [handle]);\n    const { result } = useTrackedEvaluation(read);\n    const record = result.ok ? result.value : undefined;\n\n    // The root: each bound data source, by its name.\n    const root = useQueryRoot(datasets, words);\n\n    // The open query — the saved query the payload names, else a new query on the first data source, until another is opened.\n    const firstSource = datasets[0]?.name ?? \"\";\n    const opening = value.query.type === \"some\" ? value.query.value : undefined;\n    const first = useMemo((): QueryOpen => (opening !== undefined ? variant(\"saved\", opening) : variant(\"new\", { id: \"first\", source: firstSource, from: none })),\n        [opening, firstSource]);\n    const [open, writeOpen, arrival] = useOpenQuery(keys.query, first);\n    const session = useQuerySession({ handle, record, root, open, writeOpen, storageKey: `${storageKey}.query`, words });\n    const views = useMemo(() => shownViews(QUERY_VIEWS, value.views), [value.views]);\n    const resultViews = useMemo(() => shownViews(RESULT_VIEWS, value.resultViews), [value.resultViews]);\n\n    if (!result.ok) {\n        const message = result.error instanceof Error ? result.error.message : String(result.error);\n        return <BannerView status=\"error\" title={m.savedUnreadable({ message })} />;\n    }\n    if (typeof root === \"string\") return <BannerView status=\"error\" title={root} />;\n    if (session.entries === undefined || record === undefined) {\n        const name = open.type === \"saved\" ? open.value : \"\";\n        return <EmptyStateView icon={{ prefix: \"fas\", name: \"magnifying-glass\" }} title={m.queryGone({ name })} description={m.queryGoneHint()} />;\n    }\n    return (\n        <QueryBuilderView session={session} entries={session.entries} record={record} root={root} open={open}\n            writeOpen={writeOpen} arrival={arrival} words={words} storageKey={storageKey} recentKey={keys.recent} id={id} views={views} resultViews={resultViews} />\n    );\n}, (prev, next) => payloadEquivalent(prev.value, next.value) && prev.storageKey === next.storageKey);\n\n/** Props of {@link QueryBuilderView}. */\ninterface QueryBuilderViewProps {\n    /** The open query's session. */\n    readonly session: QuerySessionState;\n    /** The query's entries as the drafts stand. */\n    readonly entries: readonly QueryEntry[];\n    /** The saved queries. */\n    readonly record: SavedQueries;\n    /** The root. */\n    readonly root: QueryRoot;\n    /** The open query. */\n    readonly open: QueryOpen;\n    /** Opens another query, with the notice it arrives with. */\n    readonly writeOpen: OpenQueryWrite;\n    /** The notice the last query opened arrived with. */\n    readonly arrival: QueryArrival | undefined;\n    /** The words. */\n    readonly words: QueryWords;\n    /** The structural storage key. */\n    readonly storageKey: string;\n    /** This viewer's recent runs' storage key. */\n    readonly recentKey: string;\n    /** The builder's id: its drop target's, and the query library's it takes cards from. */\n    readonly id: string | undefined;\n    /** The query's views this builder offers. */\n    readonly views: readonly QueryView[];\n    /** The result's views this builder offers. */\n    readonly resultViews: readonly ResultView[];\n}\n\n/** The builder over a query it can edit: the toolbar, the pane, the results and the status line. */\nfunction QueryBuilderView({ session: state, entries, record, root, open, writeOpen, arrival, words, storageKey, recentKey, id, views, resultViews }: QueryBuilderViewProps) {\n    const ps = usePartStyles(words);\n    const { styles } = ps;\n    const seg = useSlotRecipe({ key: \"seg\" })() as Styles;\n    const editingWords = useQueryEditingWords();\n    const m = words.messages;\n    const { session, sourceId, onAction, naming, setNaming, base } = state;\n    const workspace = useE3ConfigOptional()?.workspace;\n    const [element, setElement] = useState<HTMLDivElement | null>(null);\n    const bounds = useCallback(() => element, [element]);\n    // A phone's frame: the builder's own width, as the frame's is (`Query Builder Phone Spec.md`).\n    const widthRef = useRef<HTMLDivElement | null>(null);\n    const width = useContainerWidth(widthRef);\n    const phone = width > 0 && width <= NARROW_FRAME;\n\n    // ── The pane: its open tab and its collapse, the builder's to drive ──\n    const [tab, setTab] = useState<QueryTab>(\"query\");\n    const [focus, setFocus] = useState<QueryFocus | undefined>(undefined);\n    const { state: pane, setState: setPane } = usePersistedState<{ collapsed: boolean }>(`${storageKey}.pane.collapsed`, { collapsed: false }, keptRead.record({ collapsed: keptRead.boolean }));\n    const shown = useRef(sourceId);\n    useEffect(() => {\n        // Opening or starting a query opens the Query tab.\n        if (shown.current === sourceId) return;\n        shown.current = sourceId;\n        setTab(\"query\");\n        setFocus(undefined);\n    }, [sourceId]);\n    const onTabChange = useCallback((key: string) => {\n        if (key === \"query\" || key === \"datasets\" || key === \"library\") setTab(key);\n    }, []);\n    const onCollapsedChange = useCallback((collapsed: boolean) => setPane({ collapsed }), [setPane]);\n    const onShowQuery = useCallback(() => {\n        setTab(\"query\");\n        setPane({ collapsed: false });\n    }, [setPane]);\n\n    // ── Runs and summaries: one-shot calls, and a run's split call (#941), its explain (#1132) and its output (#1113) ──\n    const call = useQueryCall();\n    const split = useQuerySplitCall();\n    const explain = useQuerySplitExplain();\n    const collection = useQueryCollection();\n    const status = useQuerySourceStatus();\n    const planOptions = useQueryPlanOptions();\n    const seams = useMemo(() => ({ call, split, explain, collection, status, options: planOptions }), [call, split, explain, collection, status, planOptions]);\n    // Each run that answers is one of this viewer's recent queries: the query's own program checked — a visual\n    // run sends the counting program, which is not the query — its name and what it read.\n    const { recent, remember } = useRecentQueries(recentKey);\n    const onRan = useCallback((result: QueryResult, plan: RunPlan) => {\n        const own = checkJq(plan.canonical, root.type, { root: true }).program;\n        if (own === null) return;\n        remember({\n            name: plan.name, description: plan.description, program: own,\n            root: result.inputs.map(input => ({ name: input.name, path: input.path })), saved_at: new Date(),\n        });\n    }, [remember, root]);\n    const { state: lastRunState, run: start } = useQueryRun(root, seams, onRan);\n    // A query never run has nothing to read on a phone, whatever the query before it gave (QP15, 5b).\n    const ranQuery = useRef<string | undefined>(undefined);\n    const neverRun = phone && ranQuery.current !== sourceId;\n    const run = useMemo((): typeof lastRunState => (neverRun ? { status: \"idle\" } : lastRunState), [neverRun, lastRunState]);\n    const summaries = useQuerySummaries(root, call);\n    const saved = useMemo(() => savedOffers(record, root), [record, root]);\n    const onOpenSaved = useCallback((name: string) => writeOpen(variant(\"saved\", name)), [writeOpen]);\n\n    // ── Opening and starting queries from the Datasets and Library tabs (#939) ──\n    // The query opened arrives with its notice, shown when it opens — as one a query library opens does (#1063).\n    const arrive = useCallback((next: QueryOpen, text: string) => writeOpen(next, text), [writeOpen]);\n    const onStart = useCallback((name: string) => arrive(newQuery(name), m.startedOn({ name })), [arrive, m]);\n    const onOpenFromLibrary = useCallback((name: string) => arrive(variant(\"saved\", name), m.openedFromLibrary({ name })), [arrive, m]);\n    const onOpenRun = useCallback((run: SavedQuery) => {\n        const { header, query } = entriesQuery(savedEntries(run, root.type));\n        const source = header.jq.type === \"none\" ? query.source : run.root[0]?.name ?? root.entries[0]?.name ?? \"\";\n        arrive(newQuery(source, run), m.openedFromLibrary({ name: run.name }));\n    }, [arrive, root, m]);\n    // A query library's card dropped on the builder opens its query; one whose data sources aren't bound here is refused, with why.\n    const dropRefusal = useCallback((name: string): string | undefined => {\n        const query = record.get(name);\n        return query === undefined ? m.queryGone({ name }) : rootRefusal(query, root, words);\n    }, [record, root, words, m]);\n    const dropSteps = useCallback((name: string): number | undefined => {\n        const query = record.get(name);\n        if (query === undefined) return undefined;\n        const { header, query: steps } = entriesQuery(savedEntries(query, root.type));\n        return header.jq.type === \"some\" ? undefined : steps.steps.length;\n    }, [record, root]);\n    const onDrop = useCallback((name: string) => arrive(variant(\"saved\", name), m.openedFromQueryLibrary({ name })), [arrive, m]);\n    // A fresh run of the steps counts their shape lines: fresh while the steps print as the program it ran.\n    const steps = useMemo(() => {\n        const { header, query } = entriesQuery(entries);\n        return canonicalProgram(queryProgram(header, query, root.type));\n    }, [entries, root]);\n    const counts = run.status === \"done\" && run.output?.counts !== undefined && run.plan.canonical === steps ? run.output.counts : undefined;\n\n    // ── Editing the open query ──────────────────────────────────────────\n    const editor = useQueryEditor({\n        entries, current: state.current, gesture: state.gesture, version: state.version, root, views, words, summaries, saved, onOpenSaved, onShowQuery,\n        bounds, sourceId, counts, arrival,\n    });\n    const { leaveJq } = editor;\n    // A run takes the jq as typed: left first, one gesture.\n    const onRun = useCallback(() => {\n        leaveJq();\n        ranQuery.current = sourceId;\n        start(planRun(editor, root));\n    }, [leaveJq, start, editor, root, sourceId]);\n    // Run in the Query view closes it onto the fresh result; with an issue it stays, the issue's clause open (QP29).\n    const onRunFromView = useCallback(() => {\n        const issue = session.readiness.type === \"ready\" ? session.issues[0] : session.readiness.value[0];\n        if (issue !== undefined) {\n            setFocus({ entry: issue.entry, slot: issue.field.type === \"some\" ? issue.field.value : undefined });\n            return;\n        }\n        onRun();\n        setPane({ collapsed: true });\n    }, [session, onRun, setPane]);\n    // Starting a query opens its Query view; opening a saved one lands on its result (QP38).\n    useEffect(() => {\n        if (!phone) return undefined;\n        const toResult = open.type === \"saved\" || open.value.from.type === \"some\";\n        let live = true;\n        // After the frame closes a pane that starts to overlay, which it tells through a microtask.\n        queueMicrotask(() => {\n            if (!live) return;\n            if (!toResult) setTab(\"query\");\n            setPane({ collapsed: toResult });\n        });\n        return () => { live = false; };\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- a phone's frame, and each query opened.\n    }, [phone, sourceId]);\n    // Opening a saved query runs it, and so does opening a recent run as a new query; starting a new one does not.\n    const ranFor = useRef<string | undefined>(undefined);\n    useEffect(() => {\n        if (ranFor.current === sourceId) return;\n        ranFor.current = sourceId;\n        if (open.type === \"saved\" || open.value.from.type === \"some\") onRun();\n    }, [sourceId, open, onRun]);\n\n    // What the open query reads, for the Datasets tab: its source and what it looks up, or, as jq, what it reads.\n    const reads = useMemo((): ReadonlyMap<string, SourceRole> => {\n        const roles = new Map<string, SourceRole>();\n        const { header, query } = editor;\n        if (header.jq.type === \"some\") {\n            for (const name of checkJq(header.jq.value, root.type, { root: true }).reads) roles.set(name, \"source\");\n            return roles;\n        }\n        roles.set(query.source, \"source\");\n        for (const step of query.steps) {\n            if (step.type === \"lookup\" && step.value.dataset.type === \"some\" && !roles.has(step.value.dataset.value)) roles.set(step.value.dataset.value, \"lookedUp\");\n        }\n        return roles;\n    }, [editor, root]);\n\n    // ── The result: fresh or stale, how it shows, and its downloads ─────\n    const now = useMemo(() => canonicalProgram(editor.program), [editor.program]);\n    const output = run.status === \"done\" ? run.output : undefined;\n    const stale = run.status === \"done\" && run.plan.canonical !== now;\n    const picked = output === undefined ? undefined : pickedView(output);\n    const [chosen, setChosen] = useState<{ n: number; view: ResultView } | undefined>(undefined);\n    const [noted, setNoted] = useState<{ n: number; text: string } | undefined>(undefined);\n    const n = run.status === \"idle\" ? 0 : run.n;\n    // The run the rows a phone keeps under a failed one are from (QP14).\n    const lastRun = useRef<number | undefined>(undefined);\n    const lastRunAt = useRef<Date | undefined>(undefined);\n    const lastCount = useRef<string | undefined>(undefined);\n    const lastView = useRef<ResultView | undefined>(undefined);\n    if (run.status === \"idle\") {\n        lastRun.current = undefined; lastRunAt.current = undefined; lastCount.current = undefined; lastView.current = undefined;\n    } else if (run.status === \"done\" && run.output !== undefined) {\n        lastRun.current = run.n; lastRunAt.current = run.at; lastCount.current = resultFooter(run, words).count;\n    }\n    // The view chosen and the note last until the next run.\n    const asked = chosen !== undefined && chosen.n === n ? chosen.view : picked;\n    const view = asked === undefined ? undefined : shownView(asked, resultViews);\n    const note = noted !== undefined && noted.n === n ? noted.text : undefined;\n    if (view !== undefined && output !== undefined) lastView.current = view;\n    // A phone keeps the last result under a run that goes or gave none (QP14), and so its view and its count.\n    const phoneView = output !== undefined ? view : lastView.current;\n    const onView = useCallback((next: ResultView) => setChosen({ n, view: next }), [n]);\n    const onDismissNote = useCallback(() => setNoted(undefined), []);\n    const onDownload = useCallback((format: DownloadFormat) => {\n        if (run.status !== \"done\" || run.output === undefined) return;\n        const text = downloadResult(run, format, editor.header.name, words);\n        if (text !== undefined) setNoted({ n, text });\n    }, [run, n, editor.header.name, words]);\n\n    // ── The history item, and the keys ──────────────────────────────────\n    const onIssue = useCallback((issue: EditIssue) => {\n        onShowQuery();\n        setFocus({ entry: issue.entry, slot: issue.field.type === \"some\" ? issue.field.value : undefined });\n    }, [onShowQuery]);\n    useEffect(() => {\n        if (focus === undefined || element === null) return;\n        for (const card of element.querySelectorAll<HTMLElement>(\"[data-step-id]\")) {\n            if (card.getAttribute(\"data-step-id\") === focus.entry) card.scrollIntoView?.({ block: \"nearest\" });\n        }\n    }, [focus, element]);\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n        if (event.defaultPrevented) return;\n        // ⌘/Ctrl ⏎ runs, anywhere in the builder — a field too.\n        if ((event.metaKey || event.ctrlKey) && event.key === \"Enter\") {\n            event.preventDefault();\n            onRun();\n            return;\n        }\n        // ⌘/Ctrl / opens the Datasets tab, the pane expanded.\n        if ((event.metaKey || event.ctrlKey) && event.key === \"/\") {\n            event.preventDefault();\n            setTab(\"datasets\");\n            setPane({ collapsed: false });\n            return;\n        }\n        // A field typed into keeps its own undo.\n        if (typedInto(event.target)) return;\n        const action = historyShortcut(event);\n        if (action === undefined) return;\n        event.preventDefault();\n        onAction(action);\n    }, [onRun, onAction, setPane]);\n\n    // ── Saving ──────────────────────────────────────────────────────────\n    const taken = useMemo(() => {\n        const names = new Set<string>();\n        for (const name of record.keys()) {\n            if (base?.saved === undefined || !nameEqual(name, base.saved.name)) names.add(name);\n        }\n        return names;\n    }, [record, base]);\n    const generated = useMemo(() => (editor.checked === undefined ? \"\" : describeQuery(editor.query, editor.checked, words)),\n        [editor.query, editor.checked, words]);\n    const { current, gesture } = state;\n    const onSave = useCallback(async (name: string, description: option<string>): Promise<string | undefined> => {\n        // The jq as typed first, then the name and the description: one gesture each, on the drafts as they stand.\n        leaveJq();\n        const now = current();\n        if (now === undefined) return undefined;\n        const { header, query } = entriesQuery(now);\n        gesture(queryEntries({ ...header, name, description }, query.steps), \"typed\", m.nameGesture());\n        // Nothing to save closes the popover; drafts that cannot be saved say why, and keep it open.\n        if (session.pending > 0 && !session.canApply) return refusalOf(session, editingWords);\n        await session.apply();\n        switch (session.status) {\n            case \"rejected\": case \"conflict\": case \"unknown\": return refusalOf(session, editingWords);\n            default: return undefined;\n        }\n    }, [leaveJq, current, gesture, session, editingWords, m]);\n    const trigger = useMemo(() => <Button size=\"sm\" variant=\"outline\" data-query-save-open=\"\">{m.saveAs()}</Button>, [m]);\n    const phoneTrigger = useMemo(() => <Button size=\"md\" variant=\"outline\" css={styles.phoneSave} data-query-save-open=\"\">{m.saveAs()}</Button>, [m, styles]);\n    const savePopover = (\n        <QuerySavePopover open={naming} onOpenChange={setNaming} trigger={trigger}\n            name={editor.header.name} taken={taken} description={editor.header.description} generated={generated} onSave={onSave} />\n    );\n    // Save… folded into the toolbar's ⋯ chip (#1229): the popover hangs from the chip.\n    const saveFrom = (anchor: ReactNode) => (\n        <QuerySavePopover open={naming} onOpenChange={setNaming} anchor={anchor}\n            name={editor.header.name} taken={taken} description={editor.header.description} generated={generated} onSave={onSave} />\n    );\n\n    // ── The save state: Saved for a moment after a save, then quiet ─────\n    const [fresh, setFresh] = useState(false);\n    const [savedAt, setSavedAt] = useState<Date | undefined>(undefined);\n    useEffect(() => {\n        let was = session.status;\n        let timer: ReturnType<typeof setTimeout> | undefined;\n        const unsubscribe = session.subscribe(() => {\n            if (was === \"reconciling\" && session.status === \"idle\") {\n                setFresh(true);\n                setSavedAt(new Date());\n                clearTimeout(timer);\n                timer = setTimeout(() => setFresh(false), SAVED_MS);\n            }\n            was = session.status;\n        });\n        return () => {\n            unsubscribe();\n            clearTimeout(timer);\n        };\n    }, [session]);\n    const saveState: QuerySaveLine[\"state\"] = base?.saved === undefined ? \"new\" : session.pending > 0 ? \"unsaved\" : \"saved\";\n    const save: QuerySaveLine = { state: saveState, fresh: fresh && saveState === \"saved\", word: m.saveState({ state: saveState }) };\n\n    // ── The layout: the builder frame (#1125) ───────────────────────────\n    const history = historyToolbarItem({ session, words: editingWords, editing: false, onIssue, onAction });\n    const toolbar = phone ? phoneQueryToolbar({\n        history, state: run, view: phoneView, keptCount: lastCount.current, onView, views: resultViews, onDownload, onRun, name: editor.header.name, width, words,\n    }) : queryToolbarItems({\n        history,\n        copyText: () => editor.program,\n        save: savePopover,\n        saveFrom,\n        onSaveAs: () => setNaming(true),\n        saving: naming,\n        running: run.status === \"running\",\n        onRun,\n        words,\n        styles,\n    });\n    const openedNotice = phone && arrival !== undefined && (open.type === \"saved\" || open.value.from.type === \"some\")\n        ? editor.notices.find((notice) => notice.text === arrival.text) : undefined;\n    // A phone's one notice over the strip (QP16): the newest of a download's, a save's and the query opened's.\n    const controls = resultToolbarItems({\n        view: output === undefined ? undefined : view, downloadable: output?.paged === undefined, picked, onView, views: resultViews, onDownload, words, styles, seg,\n    });\n    const tabs = ([\"query\", \"datasets\", \"library\"] as const).map((key) => ({\n        key,\n        label: m.tab({ tab: key }),\n        body: key === \"query\"\n            ? phone\n                ? <QueryPhoneView editor={editor} ps={ps} workspace={workspace} focus={focus?.entry} elsewhere={openedNotice} save={save}\n                    description={editor.header.description.type === \"some\" ? editor.header.description.value : generated} running={run.status === \"running\"} onRun={onRunFromView} drafted={session.pending > 0} onOpenLibrary={() => setTab(\"library\")}\n                    saveButton={<QuerySavePopover phone pending={session.pending} open={naming} onOpenChange={setNaming} trigger={phoneTrigger}\n                        name={editor.header.name} taken={taken} description={editor.header.description} generated={generated} onSave={onSave} />} />\n                : <QueryTabPanel editor={editor} ps={ps} workspace={workspace} focus={focus?.entry} />\n            : (\n                <Box css={styles.tab} data-query-tab={key} data-library-phone={phone ? \"query\" : undefined}>\n                    {key === \"datasets\"\n                        // Each tab's library has an id of its own, under the builder's keys.\n                        ? <DatasetsTab root={root} reads={reads} onStart={onStart} id={`${recentKey}.datasets`} words={words} storageKey={`${storageKey}.datasets`} />\n                        : <LibraryTab record={record} recent={recent} root={root} open={open} onOpenSaved={onOpenFromLibrary} onOpenRun={onOpenRun}\n                            id={`${recentKey}.library`} ps={ps} storageKey={`${storageKey}.library`} phoneWidth={phone ? width : undefined} />}\n                    {phone && <Box css={styles.phoneTabHint} data-query-tab-hint=\"\">{key === \"datasets\" ? m.tapDataset() : m.tapQuery()}</Box>}\n                </Box>\n            ),\n    }));\n    // The pane: its open tab and its collapse, the builder's to drive.\n    const liveBand = !phone ? undefined\n        : note !== undefined ? <QueryLiveBand text={note} saved={false} onDismiss={onDismissNote} words={words} />\n        : savedAt !== undefined ? <QueryLiveBand text={m.savedNotice({ name: editor.header.name, time: words.formatters.time(savedAt) })} saved onDismiss={() => setSavedAt(undefined)} words={words} />\n        : openedNotice !== undefined ? <QueryLiveBand text={openedNotice.text} saved={false} onDismiss={() => editor.dismiss(openedNotice.id)} words={words} />\n        : undefined;\n    const queryPane: BuilderFrameDock = {\n        phoneTabs: [\n            { key: \"query\", label: m.tab({ tab: \"query\" }), icon: \"diagram-project\", detail: editor.query.steps.length === 0 ? undefined : words.formatters.number(editor.query.steps.length) },\n            { key: \"datasets\", label: m.tab({ tab: \"datasets\" }), icon: \"database\", detail: words.formatters.number(root.entries.length) },\n            { key: \"library\", label: m.tab({ tab: \"library\" }), icon: \"layer-group\", detail: words.formatters.number(record.size + recent.length) },\n        ],\n        label: m.pane(),\n        icon: \"diagram-project\",\n        badge: words.formatters.number(editor.query.steps.length),\n        // One width whichever view the Query tab shows: the pane never jumps as Visual · jq switches.\n        size: \"min(480px, 52%)\",\n        tabs,\n        tab,\n        onTabChange,\n        collapsed: pane.collapsed,\n        onCollapsedChange,\n    };\n    const popover = editor.popover;\n    const shownRun = lastRun.current;\n    // The steps' own words for what the checker refused, as a phone's Not run says it (5d).\n    const firstProblem = useMemo(() => {\n        const found: string[] = [];\n        const walk = (lines: Card[\"lines\"]) => { for (const line of lines) {\n            for (const problem of line.problems) if (problem.severity === \"error\") found.push(problem.text);\n            walk(line.lines ?? []);\n        } };\n        for (const card of editor.cards) walk(card.lines);\n        return found[0] === undefined ? undefined : { n: found.length, text: found[0] };\n    }, [editor.cards]);\n    const phoneStrips = useMemo(() => (phone ? <ResultStrips state={run} stale={stale} note={note} onDismissNote={onDismissNote} onRunAgain={onRun} words={words} phone\n        onShowProblem={onShowQuery} shownRun={shownRun} shownAt={lastRunAt.current} problem={firstProblem} /> : undefined), [phone, run, stale, note, onDismissNote, onRun, words, onShowQuery, shownRun, firstProblem]);\n    // A picker's view on a phone (QP34): what it is for; Add a step's Quick add's five first, each row its name alone.\n    const phoneContext = useMemo(() => {\n        if (popover === undefined) return undefined;\n        const ref = popover.slot.ref;\n        if (ref.kind === \"add-step\") {\n            return ref.at === undefined || ref.at >= editor.cards.length ? m.atEnd() : m.beforeStep({ n: words.formatters.bare(ref.at + 1) });\n        }\n        const card = editor.cards.find((c) => c.stepId === ref.stepId);\n        if (card === undefined) return undefined;\n        const step = words.formatters.bare(card.index + 1);\n        if (ref.condId === undefined) return m.stepContext({ n: step });\n        const conds: string[] = [];\n        const walk = (lines: Card[\"lines\"]) => { for (const line of lines) {\n            for (const part of line.parts) if (part.t === \"slot\" && part.slot.condId !== undefined && !conds.includes(part.slot.condId)) conds.push(part.slot.condId);\n            walk(line.lines ?? []);\n        } };\n        walk(card.lines);\n        return m.conditionContext({ n: step, c: words.formatters.bare(conds.indexOf(ref.condId) + 1) });\n    }, [popover, editor.cards, m, words]);\n    const phoneItems = useMemo(() => {\n        if (!phone || popover === undefined || popover.slot.ref.kind !== \"add-step\") return undefined;\n        const quick = new Set(editor.quick.map((option) => option.icon));\n        const shown = popover.items.map((item) => (item.disabled === true ? item : { ...item, detail: undefined as unknown as string }));\n        return [\n            ...shown.filter((item) => item.icon !== undefined && quick.has(item.icon)).map((item) => ({ ...item, group: m.quickAddGroup() })),\n            ...shown.filter((item) => item.icon === undefined || !quick.has(item.icon)).map((item) => ({ ...item, group: m.moreStepsGroup() })),\n        ];\n    }, [phone, popover, editor.quick, m]);\n    return (\n        <Box ref={setElement} css={styles.root} data-query-builder=\"\" data-query-open={sourceId} data-query-naming={naming ? \"\" : undefined}\n            data-query-focus={focus === undefined ? undefined : focus.entry} onKeyDown={onKeyDown}>\n            <QueryDropTarget id={id} refusal={dropRefusal} steps={dropSteps} onOpen={onDrop} words={words}>\n                <BuilderFrame\n                    ref={widthRef}\n                    storageKey={`${storageKey}.frame`}\n                    toolbar={toolbar}\n                    banners={<>\n                        {/* The session's: a query saved elsewhere under these edits, which its Discard takes; a Save refused. */}\n                        <SessionBanners session={session} words={editingWords} onAction={onAction} />\n                        {!phone && <ResultStrips state={run} stale={stale} note={note} onDismissNote={onDismissNote} onRunAgain={onRun} words={words} />}\n                    </>}\n                    start={queryPane}\n                    phoneViews\n                    footer={phone ? <>{run.status === \"running\" && <LoadingLine value={{ kind: \"loading\", text: m.readingShort(), short: m.readingShort() }} shown form=\"short\" />}{liveBand}</> : <QueryStatusLine check={editor.check} gives={editor.gives} save={save} name={editor.header.name} />}\n                >\n                    <QueryResults state={run} stale={stale} view={(phone ? phoneView : view) ?? resultViews[0]!} words={words} storageKey={storageKey} controls={controls} phone={phone}\n                        strips={phoneStrips} />\n                </BuilderFrame>\n            </QueryDropTarget>\n            {popover !== undefined && element !== null && (\n                <SlotAutocomplete key={popover.generation} anchor={popover.slot.anchor} bounds={element}\n                    label={popover.label} placeholder={phone && popover.slot.ref.kind === \"field\" ? m.filterSlot({ what: \"fields\" }) : popover.placeholder}\n                    hint={phone && popover.slot.ref.kind === \"add-step\" ? m.stepFitNote() : popover.hint} empty={popover.empty} keys={popover.keys}\n                    items={phoneItems ?? popover.items} text={popover.text} onText={popover.onText} initialActive={popover.initialActive}\n                    onPick={popover.onPick} onClose={popover.onClose}\n                    view={phone ? element.querySelector<HTMLElement>('[data-frame-slot=\"overlay\"]') : undefined} backLabel={m.backToStep()} context={phone ? phoneContext : undefined} noFilter={phone && popover.slot.ref.kind === \"add-step\"} />\n            )}\n        </Box>\n    );\n}\n\nimplementUIComponent(QueryBuilderComponent, EastChakraQueryBuilder);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraQueryLibrary` — the renderer of the `QueryLibrary` extension\n * declared in `@elaraai/e3-ui` (#1063): the query library, built in the\n * browser from its interface — the saved queries record bound with its patch,\n * the data sources a query may read, the builder it opens queries in, and who\n * to tell — as Studio's page library is built from its own\n * (`Query Editor Spec.md` §5):\n *\n * - **One toolbar row**, the shared `Toolbar`: the search, \"Search N\n *   queries…\", over names, descriptions and data sources; Sort · Recent or\n *   Name; Grid · List; a rule; and the primary \"+ New query on <data source>\" —\n *   the one the pane shows, else the first bound — folded on one ladder.\n * - **The pane**: Data sources — All queries, then each bound data source with\n *   the count of saved queries that start from it — the one shown in the\n *   brand; at its foot, Recent: this viewer's runs, the builder's (#935).\n * - **The gallery**: one `Library` gallery, three across or a row each, which\n *   draws no toolbar of its own. Each card's media is a wireframe of the\n *   query — its source, then a bar per step with its icon and title — or, for\n *   a query with problems here, their count in a dashed box; then its name,\n *   its description (the author's, else the generated sentence), \"{source} ·\n *   {n} steps · {what it gives} · saved {when}\", and \"Open in builder →\". A\n *   saved query's card drags onto the builder that shares the id (#939).\n * - **Opening**: a card's click writes the builder's open query, shared by\n *   `id`, with the notice it arrives with, and tells the host — a saved query\n *   as itself, a recent run of one as the saved query, a run never saved as a\n *   new query begun as it. A query whose data sources aren't bound here\n *   carries the reason in the warning tone, and its click says so in a notice\n *   instead of opening.\n * - **Empty**: no queries yet, no recent runs, or none matching the search —\n *   each with what to do.\n *\n * The data source shown, the search, the order and the layout are its own.\n * It reads no dataset — a card draws a query, never its data — and draws no\n * border around itself. Its layout is the `queryLibrary` recipe's; its\n * controls are the theme's shared ones — the Library's search box, the\n * `button` recipe, the `seg` strip and the menu.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useId, useMemo, useState, type ChangeEvent, type KeyboardEvent, type ReactNode } from \"react\";\nimport { Box, chakra, Menu as ChakraMenu, Portal, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { library as iconLibrary, type IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport {\n    fas, faArrowDownAZ, faCaretDown, faCheck, faClockRotateLeft, faMagnifyingGlass, faPlus, faXmark, type IconDefinition,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport {\n    DateTimeType, StringType, compareFor, equalFor, equivalentFor, fromEastTypeValue, none, some, variant, type ValueTypeOf,\n} from \"@elaraai/east\";\nimport { QueryLibraryComponent, QueryLibraryPayloadType, SavedQueryType, queryKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, EastChakraLibrary, EmptyStateView, LibraryLayoutSwitch, Toolbar, implementUIComponent, useTrackedEvaluation,\n    type LibraryItemValue, type LibraryValue, type ToolbarItem,\n} from \"@elaraai/east-ui-components\";\nimport { queryAbout, whenWords, type QueryAbout } from \"./about.js\";\nimport { sourceKind } from \"./datasets-tab.js\";\nimport { useQueryRoot, useRecentQueries } from \"./hooks.js\";\nimport type { QueryWords } from \"./model/words.js\";\nimport type { QueryRoot } from \"./one-shot.js\";\nimport { newQuery, useOpenQuery, type QueryOpen } from \"./open-query.js\";\nimport type { SavedQueries, SavedQuery } from \"./session.js\";\nimport { useQueryWords } from \"./words.js\";\n\n// A step's icon is a Font Awesome name; register the free-solid set so it resolves by name (idempotent).\niconLibrary.add(fas);\n\n/** A recipe's styles, by slot. */\ntype Styles = Record<string, SystemStyleObject>;\n/** The renderer's payload, decoded. */\ntype QueryLibraryValue = ValueTypeOf<typeof QueryLibraryComponent.schema>;\n/** How the cards are ordered: the most recently saved — or run — first, or by name. */\ntype Sort = \"recent\" | \"name\";\n/** How the gallery lays its cards out. */\ntype Layout = \"grid\" | \"list\";\n/** What the pane shows: every saved query, those that start from a data source, or this viewer's recent runs. */\ntype Shown = { readonly kind: \"all\" } | { readonly kind: \"source\"; readonly name: string } | { readonly kind: \"recent\" };\n\n/** A card of the gallery. */\ninterface Card {\n    /** Its key: a saved query's name, or `recent:<n>` for a run. */\n    readonly key: string;\n    /** The saved query, or the run. */\n    readonly query: SavedQuery;\n    /** What it is here. */\n    readonly about: QueryAbout;\n    /** Whether it is one of this viewer's recent runs. */\n    readonly run: boolean;\n    /** For a run of a saved query, the saved query it opens as. */\n    readonly opens: SavedQuery | undefined;\n    /** Why it can't open here — a run of a saved query, the saved query's reason; `undefined` when it can. */\n    readonly refusal: string | undefined;\n}\n\n/** The payload's equivalence: its data, and its functions by their IR and what they capture. */\nconst payloadEquivalent = equivalentFor(QueryLibraryPayloadType);\nconst nameEqual = equalFor(StringType);\nconst runEqual = equalFor(SavedQueryType);\nconst byName = compareFor(StringType);\nconst byTime = compareFor(DateTimeType);\n\n/** The toolbar's fold ranks: the primary action drops its data source, Sort\n *  folds to its icon, the primary action to its plus, and last the search\n *  narrows twice. The layout switch never folds. */\nconst RANK = { newQuery: 0, sort: 1, newQueryIcon: 2, searchMid: 3, searchNarrow: 4 } as const;\n\n/** The orders Sort offers, in its menu's order, with the icon it folds to. */\nconst SORTS: ReadonlyArray<{ key: Sort; icon: IconDefinition }> = [\n    { key: \"recent\", icon: faClockRotateLeft },\n    { key: \"name\", icon: faArrowDownAZ },\n];\n\n/** How many of a query's steps its wireframe draws before it counts the rest. */\nconst WIRE_STEPS = 4;\n\n/** The empty state's icon: an empty box, as a Library's — Font Awesome's open box (#1263). */\nconst EMPTY_ICON = { prefix: \"fas\", name: \"box-open\" } as const;\n\n/** Props of {@link EastChakraQueryLibrary}. */\nexport interface EastChakraQueryLibraryProps {\n    /** The payload, decoded. */\n    value: QueryLibraryValue;\n    /** The structural storage key. */\n    storageKey: string;\n}\n\n/**\n * Sort · Recent or Name, opening a menu of the two orders — folded, the\n * trigger is the order's icon, the words its name and tooltip.\n */\nfunction SortMenu({ sort, onPick, compact, trigger, caret, check, words }: {\n    sort: Sort;\n    onPick: (sort: Sort) => void;\n    compact: boolean;\n    trigger: SystemStyleObject;\n    caret: SystemStyleObject;\n    check: SystemStyleObject;\n    words: QueryWords;\n}) {\n    const m = words.messages;\n    const current = SORTS.find((s) => s.key === sort) ?? SORTS[0]!;\n    const label = m.librarySort({ sort });\n    return (\n        <ChakraMenu.Root positioning={{ placement: \"bottom-end\" }}>\n            <ChakraMenu.Trigger asChild>\n                <chakra.button type=\"button\" css={trigger} data-query-library-sort=\"\"\n                    {...(compact ? { \"aria-label\": label, title: label } : {})}>\n                    {compact ? <FontAwesomeIcon icon={current.icon} /> : (\n                        <>\n                            {label}\n                            <Box as=\"span\" css={caret} aria-hidden><FontAwesomeIcon icon={faCaretDown} /></Box>\n                        </>\n                    )}\n                </chakra.button>\n            </ChakraMenu.Trigger>\n            <Portal>\n                <ChakraMenu.Positioner>\n                    <ChakraMenu.Content>\n                        <ChakraMenu.RadioItemGroup value={sort} onValueChange={(d) => {\n                            const picked = SORTS.find((s) => s.key === d.value);\n                            if (picked !== undefined && picked.key !== sort) onPick(picked.key);\n                        }}>\n                            {SORTS.map((s) => (\n                                <ChakraMenu.RadioItem key={s.key} value={s.key}>\n                                    <Box as=\"span\" css={check}>{s.key === sort && <FontAwesomeIcon icon={faCheck} />}</Box>\n                                    {m.librarySortOption({ sort: s.key })}\n                                </ChakraMenu.RadioItem>\n                            ))}\n                        </ChakraMenu.RadioItemGroup>\n                    </ChakraMenu.Content>\n                </ChakraMenu.Positioner>\n            </Portal>\n        </ChakraMenu.Root>\n    );\n}\n\n/**\n * A row of the pane: its label, its count at the right, and Recent's icon;\n * the one shown in the brand.\n */\nfunction PaneRow({ label, count, active, icon, at, styles, onPick }: {\n    label: string;\n    count: string;\n    active: boolean;\n    icon: IconDefinition | undefined;\n    at: string;\n    styles: Styles;\n    onPick: () => void;\n}) {\n    return (\n        <chakra.button type=\"button\" css={styles.paneRow} data-query-library-shows={at}\n            {...(active ? { \"data-active\": \"\", \"aria-current\": \"true\" } : {})}\n            onClick={onPick}>\n            {icon !== undefined && <Box as=\"span\" css={styles.paneIcon} aria-hidden><FontAwesomeIcon icon={icon} /></Box>}\n            <Box as=\"span\" css={styles.paneTitle}>{label}</Box>\n            <Box as=\"span\" css={styles.paneCount}>{count}</Box>\n        </chakra.button>\n    );\n}\n\n/**\n * A card's media: the query's wireframe — its source, then a bar per step,\n * each its icon and title, the steps past {@link WIRE_STEPS} counted — or, for\n * a query with problems here, their count, dashed, and why.\n */\nfunction QueryWireframe({ about, icon, styles, words }: { about: QueryAbout; icon: string; styles: Styles; words: QueryWords }) {\n    const m = words.messages;\n    const f = words.formatters;\n    if (about.problems > 0) {\n        const why = about.refusal ?? about.problem;\n        return (\n            <Box css={styles.problems} data-query-wireframe=\"problems\">\n                <Box as=\"span\" css={styles.problemCount}>{m.problemCount({ count: f.number(about.problems), n: about.problems })}</Box>\n                {why !== undefined && <Box as=\"span\" css={styles.problemText}>{why}</Box>}\n            </Box>\n        );\n    }\n    const outline = about.steps?.outline ?? [];\n    const drawn = outline.length > WIRE_STEPS ? outline.slice(0, WIRE_STEPS - 1) : outline;\n    const more = outline.length - drawn.length;\n    return (\n        <Box css={styles.wireframe} data-query-wireframe=\"steps\">\n            <Box css={styles.wireRow} data-wire=\"source\">\n                <Box as=\"span\" css={styles.wireIcon} aria-hidden><FontAwesomeIcon icon={[\"fas\", icon as IconName]} /></Box>\n                <Box as=\"span\" css={styles.wireTitle}>{about.source}</Box>\n            </Box>\n            {about.steps === undefined ? (\n                <Box css={styles.wireRow} data-wire=\"jq\">\n                    <Box as=\"span\" css={styles.wireIcon} aria-hidden><FontAwesomeIcon icon={[\"fas\", \"code\"]} /></Box>\n                    <Box as=\"span\" css={styles.wireTitle}>{m.jqProgram()}</Box>\n                </Box>\n            ) : drawn.map((line, i) => (\n                <Box key={i} css={styles.wireRow} data-wire=\"step\">\n                    <Box as=\"span\" css={styles.wireIcon} aria-hidden><FontAwesomeIcon icon={[\"fas\", line.icon as IconName]} /></Box>\n                    <Box as=\"span\" css={styles.wireTitle}>{line.title}</Box>\n                </Box>\n            ))}\n            {more > 0 && <Box as=\"span\" css={styles.wireMore}>{m.moreSteps({ count: f.number(more), n: more })}</Box>}\n        </Box>\n    );\n}\n\n/**\n * Renders the query library — see the module docs.\n *\n * @param props - The payload and its storage key\n * @returns The query library\n */\nexport const EastChakraQueryLibrary = memo(function EastChakraQueryLibrary({ value, storageKey }: EastChakraQueryLibraryProps) {\n    const words = useQueryWords();\n    const m = words.messages;\n\n    // The record, read where the query library renders, and again when it moves.\n    const read = useCallback(() => value.queries.read(), [value.queries]);\n    const { result } = useTrackedEvaluation(read);\n    // The root: each bound data source, by its name.\n    const root = useQueryRoot(value.datasets, words);\n\n    if (!result.ok) {\n        const message = result.error instanceof Error ? result.error.message : String(result.error);\n        return <BannerView status=\"error\" title={m.savedUnreadable({ message })} />;\n    }\n    if (typeof root === \"string\") return <BannerView status=\"error\" title={root} />;\n    return <QueryLibraryView value={value} record={result.value} root={root} words={words} storageKey={storageKey} />;\n}, (prev, next) => payloadEquivalent(prev.value, next.value) && prev.storageKey === next.storageKey);\n\n/** Props of {@link QueryLibraryView}. */\ninterface QueryLibraryViewProps {\n    /** The payload: the builder's id, and who to tell. */\n    readonly value: QueryLibraryValue;\n    /** The saved queries. */\n    readonly record: SavedQueries;\n    /** The root. */\n    readonly root: QueryRoot;\n    /** The words. */\n    readonly words: QueryWords;\n    /** The structural storage key. */\n    readonly storageKey: string;\n}\n\n/** The query library over the record it read: the toolbar, the pane and the gallery. */\nfunction QueryLibraryView({ value, record, root, words, storageKey }: QueryLibraryViewProps) {\n    const styles = useSlotRecipe({ key: \"queryLibrary\" })() as Styles;\n    const library = useSlotRecipe({ key: \"library\" })() as Styles;\n    const button = useRecipe({ key: \"button\" });\n    const m = words.messages;\n    const f = words.formatters;\n    const id = useId();\n    const builder = value.id.type === \"some\" ? value.id.value : undefined;\n    const keys = useMemo(() => queryKeys(builder), [builder]);\n    const tellHost = value.onOpen.type === \"some\" ? value.onOpen.value : undefined;\n\n    // This viewer's recent runs, the builder's; and the builder's open query —\n    // a new query on the first data source until one opens.\n    const { recent } = useRecentQueries(keys.recent);\n    const firstSource = root.entries[0]?.name ?? \"\";\n    const first = useMemo((): QueryOpen => variant(\"new\", { id: \"first\", source: firstSource, from: none }), [firstSource]);\n    const [open, writeOpen] = useOpenQuery(keys.query, first);\n\n    // Its own view: what the pane shows, the search, the order and the layout; and a notice.\n    const [shown, setShown] = useState<Shown>({ kind: \"all\" });\n    const [text, setText] = useState(\"\");\n    const [sort, setSort] = useState<Sort>(\"recent\");\n    const [layout, setLayout] = useState<Layout>(\"grid\");\n    const [notice, setNotice] = useState<string | undefined>(undefined);\n    const show = useCallback((next: Shown) => {\n        setShown(next);\n        setNotice(undefined);\n    }, []);\n\n    // What each saved query and each run is here: read once per record, run list and root.\n    const saved = useMemo(() => [...record.values()].map((query) => ({ query, about: queryAbout(query, root, words) })), [record, root, words]);\n    const runs = useMemo(() => recent.map((query) => ({ query, about: queryAbout(query, root, words) })), [recent, root, words]);\n    // How many saved queries start from each data source.\n    const counts = useMemo(() => {\n        const out = new Map<string, number>();\n        for (const { about } of saved) out.set(about.source, (out.get(about.source) ?? 0) + 1);\n        return out;\n    }, [saved]);\n\n    // The cards the pane shows: the saved queries — all, or those that start\n    // from a data source — or the recent runs, each a run of a saved query\n    // opening as it.\n    const cards = useMemo((): Card[] => {\n        if (shown.kind === \"recent\") {\n            return runs.map(({ query, about }, i) => {\n                const opens = saved.find((s) => nameEqual(s.query.name, query.name));\n                return { key: `recent:${i}`, query, about, run: true, opens: opens?.query, refusal: (opens?.about ?? about).refusal };\n            });\n        }\n        return saved\n            .filter((s) => shown.kind === \"all\" || nameEqual(s.about.source, shown.name))\n            .map(({ query, about }) => ({ key: query.name, query, about, run: false, opens: undefined, refusal: about.refusal }));\n    }, [shown, runs, saved]);\n\n    // The search narrows them by name, description and data source; Sort orders them.\n    const needle = text.trim().toLowerCase();\n    const rows = useMemo(() => {\n        const matching = needle === \"\" ? cards\n            : cards.filter((c) => [c.query.name, c.about.description ?? \"\", c.about.source].join(\" \").toLowerCase().includes(needle));\n        return [...matching].sort(sort === \"name\"\n            ? (a, b) => byName(a.query.name, b.query.name)\n            : (a, b) => byTime(b.query.saved_at, a.query.saved_at) || byName(a.query.name, b.query.name));\n    }, [cards, needle, sort]);\n    const byKey = useMemo(() => new Map(rows.map((c) => [c.key, c])), [rows]);\n\n    // The query the builder has open is placed: a saved query by its name; a run never saved by itself, whenever it ran.\n    const isOpenSaved = useCallback((name: string) => open.type === \"saved\" && nameEqual(open.value, name), [open]);\n    const isOpenRun = useCallback((run: SavedQuery) => open.type === \"new\" && open.value.from.type === \"some\"\n        && runEqual({ ...open.value.from.value, saved_at: run.saved_at }, run), [open]);\n\n    // A card opens its query in the builder, with its notice, and tells the host.\n    const onOpenCard = useCallback((key: string) => {\n        const card = byKey.get(key);\n        if (card === undefined) return;\n        if (card.refusal !== undefined) {\n            setNotice(card.refusal);\n            return;\n        }\n        setNotice(undefined);\n        const name = card.query.name;\n        const target = card.run ? card.opens : card.query;\n        writeOpen(target !== undefined ? variant(\"saved\", target.name) : newQuery(card.about.source, card.query), m.openedFromQueryLibrary({ name }));\n        if (tellHost !== undefined) queueMicrotask(() => tellHost(name));\n    }, [byKey, writeOpen, tellHost, m]);\n\n    // \"+ New query on …\": the data source the pane shows, else the first bound.\n    const startOn = shown.kind === \"source\" ? shown.name : firstSource;\n    const onNew = useCallback(() => {\n        if (startOn === \"\") return;\n        setNotice(undefined);\n        writeOpen(newQuery(startOn), m.startedOn({ name: startOn }));\n        const name = m.untitled({ source: startOn });\n        if (tellHost !== undefined) queueMicrotask(() => tellHost(name));\n    }, [startOn, writeOpen, tellHost, m]);\n\n    // Each card: its name, its description, what it reads and gives, and its action; the reason it can't open, in the warning tone.\n    const items = useMemo(() => {\n        const now = new Date();\n        return rows.map((card): LibraryItemValue => {\n            const { query, about, refusal } = card;\n            const steps = about.steps === undefined ? undefined : { count: f.number(about.steps.count), n: about.steps.count };\n            const gives = about.gives ?? (about.problems > 0 ? m.problemCount({ count: f.number(about.problems), n: about.problems }) : \"\");\n            return {\n                key: card.key,\n                label: query.name,\n                sublabel: about.description === undefined ? none : some(about.description),\n                icon: none,\n                status: none,\n                trailing: refusal === undefined ? none : some({ icon: \"triangle-exclamation\", label: refusal, tone: some(variant(\"warning\", null)) }),\n                // A saved query's card drags onto the builder, which opens it by name.\n                draggable: !card.run,\n                filtered: false,\n                placed: card.run ? (card.opens !== undefined ? isOpenSaved(card.opens.name) : isOpenRun(query)) : isOpenSaved(query.name),\n                media: none,\n                avatar: none,\n                byline: some(m.libraryByline({ source: about.source, steps, gives, when: whenWords(query.saved_at, now, f), run: card.run })),\n                action: refusal === undefined ? some(m.openInBuilder()) : none,\n                search: none,\n                groups: new Map(),\n                facets: new Map(),\n                dims: new Map(),\n            };\n        });\n    }, [rows, isOpenSaved, isOpenRun, m, f]);\n\n    // Each card's media: the query's wireframe, its source's icon at its head.\n    const icons = useMemo(() => new Map(root.entries.map((e) => [e.name, sourceKind(fromEastTypeValue(e.type)).icon])), [root]);\n    const media = useCallback((item: LibraryItemValue): ReactNode => {\n        const card = byKey.get(item.key);\n        return card === undefined ? null\n            : <QueryWireframe about={card.about} icon={icons.get(card.about.source) ?? \"table-list\"} styles={styles} words={words} />;\n    }, [byKey, icons, styles, words]);\n    const gallery = useMemo((): LibraryValue => ({\n        id: keys.library,\n        hint: none,\n        items,\n        groupOptions: [],\n        groupSummaries: new Map(),\n        dimOptions: [],\n        defaultDimensions: [],\n        filterOptions: [],\n        searchable: false,\n        noun: none,\n        addLabel: none,\n        onAdd: none,\n        onCardClick: some((key: string) => { onOpenCard(key); return null; }),\n        slice: none,\n        style: some({ height: none, maxHeight: none, virtualization: none, columns: some(3n), mediaPlacement: none, mediaSize: none }),\n        variant: some(variant(\"gallery\", null)),\n        layout: some(layout === \"list\" ? variant(\"list\", null) : variant(\"grid\", null)),\n        toolbar: false,\n    }), [keys, items, onOpenCard, layout]);\n\n    // Nothing to show: none match the search, no recent runs, or no saved queries here.\n    const total = saved.length;\n    const empty = rows.length > 0 ? undefined\n        : needle !== \"\" ? { title: m.noMatch({ text: text.trim() }), hints: [m.checkSpelling(), shown.kind === \"all\" ? m.searchWhat() : m.clearFilter()] }\n            : shown.kind === \"recent\" ? { title: m.noRecent(), hints: [m.runInBuilder()] }\n                : { title: m.noQueries(), hints: [m.saveInBuilder()] };\n\n    // The search box at a width the toolbar folds it to — one element in\n    // every form, so the field keeps its focus and its text as the row folds.\n    const searchBox = (size: \"wide\" | \"mid\" | \"narrow\") => (\n        <Box css={library.searchBox} data-size={size}>\n            <Box as=\"span\" css={library.searchIcon} aria-hidden>\n                <FontAwesomeIcon icon={faMagnifyingGlass} />\n            </Box>\n            <chakra.input\n                css={library.searchInput}\n                placeholder={m.librarySearch({ count: f.number(total), n: total })}\n                aria-label={m.librarySearchLabel()}\n                value={text}\n                data-query-library-search=\"\"\n                onChange={(e: ChangeEvent<HTMLInputElement>) => setText(e.target.value)}\n                onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {\n                    if (e.key === \"Escape\" && text !== \"\") {\n                        e.preventDefault();\n                        setText(\"\");\n                    }\n                }}\n            />\n            {text !== \"\" && (\n                <chakra.button type=\"button\" css={library.searchClear} aria-label={m.clearSearch()} onClick={() => setText(\"\")}>\n                    <FontAwesomeIcon icon={faXmark} />\n                </chakra.button>\n            )}\n        </Box>\n    );\n    const sortMenu = (compact: boolean) => (\n        <SortMenu sort={sort} compact={compact} trigger={button({ variant: \"outline\", size: \"sm\" }) as SystemStyleObject}\n            caret={styles.caret!} check={library.menuCheck!} onPick={setSort} words={words} />\n    );\n    // The primary action, in each of its forms.\n    const newButton = (form: \"full\" | \"short\" | \"icon\"): ReactNode => (\n        <chakra.button type=\"button\" css={button({ variant: \"solid\", size: \"sm\" })} colorPalette=\"brand\" data-query-library-new=\"\"\n            disabled={startOn === \"\"}\n            {...(form !== \"full\" ? { title: m.newQueryOn({ source: startOn }) } : {})}\n            {...(form === \"icon\" ? { \"aria-label\": m.newQueryOn({ source: startOn }) } : {})}\n            onClick={onNew}>\n            <Box as=\"span\" css={styles.buttonIcon} aria-hidden><FontAwesomeIcon icon={faPlus} /></Box>\n            {form === \"full\" ? m.newQueryOn({ source: startOn }) : form === \"short\" ? m.newQuery() : null}\n        </chakra.button>\n    );\n    const toolbarItems: ReadonlyArray<ToolbarItem> = [\n        {\n            key: \"search\",\n            forms: [searchBox(\"wide\"), searchBox(\"mid\"), searchBox(\"narrow\")],\n            rank: [RANK.searchMid, RANK.searchNarrow],\n        },\n        { key: \"sort\", side: \"end\", forms: [sortMenu(false), sortMenu(true)], rank: RANK.sort, version: sort },\n        {\n            key: \"layout\",\n            side: \"end\",\n            forms: [<LibraryLayoutSwitch layout={layout} onPick={setLayout} />],\n        },\n        { key: \"rule\", side: \"end\", forms: [<Box as=\"span\" css={styles.divider} aria-hidden />] },\n        {\n            key: \"new\",\n            side: \"end\",\n            forms: [newButton(\"full\"), newButton(\"short\"), newButton(\"icon\")],\n            rank: [RANK.newQuery, RANK.newQueryIcon],\n            version: startOn,\n        },\n    ];\n\n    return (\n        <Box css={styles.root} data-query-library=\"\">\n            <Box css={styles.toolbar} data-slot=\"toolbar\">\n                <Toolbar items={toolbarItems} />\n            </Box>\n            <Box css={styles.body}>\n                <Box css={styles.pane} data-query-library-pane=\"\">\n                    <Box css={styles.paneSection} role=\"group\" aria-labelledby={`${id}-sources`}>\n                        <Box css={styles.paneHead}>\n                            <Box as=\"span\" id={`${id}-sources`} css={styles.paneCaption}>{m.dataSources()}</Box>\n                        </Box>\n                        <PaneRow label={m.allQueries()} count={f.number(total)} active={shown.kind === \"all\"} icon={undefined} at=\"all\"\n                            styles={styles} onPick={() => show({ kind: \"all\" })} />\n                        {root.entries.map((entry) => (\n                            <PaneRow key={entry.name} label={entry.name} count={f.number(counts.get(entry.name) ?? 0)}\n                                active={shown.kind === \"source\" && nameEqual(shown.name, entry.name)} icon={undefined} at={`source:${entry.name}`}\n                                styles={styles} onPick={() => show({ kind: \"source\", name: entry.name })} />\n                        ))}\n                    </Box>\n                    <Box css={styles.paneFoot}>\n                        <PaneRow label={m.recentGroup()} count={f.number(recent.length)} active={shown.kind === \"recent\"} icon={faClockRotateLeft}\n                            at=\"recent\" styles={styles} onPick={() => show({ kind: \"recent\" })} />\n                    </Box>\n                </Box>\n                <Box css={styles.main} data-query-library-main=\"\">\n                    {notice !== undefined && (\n                        <Box css={styles.notice} data-query-library-notice=\"\">\n                            <BannerView status=\"warning\" title={notice} dismissible onDismiss={() => setNotice(undefined)} />\n                        </Box>\n                    )}\n                    {empty !== undefined ? (\n                        <Box css={styles.empty} data-query-library-empty=\"\">\n                            <EmptyStateView icon={EMPTY_ICON} title={empty.title} description={\n                                <Box as=\"ul\" css={styles.emptyList}>\n                                    {empty.hints.map((hint) => <li key={hint}>{hint}</li>)}\n                                </Box>\n                            } />\n                        </Box>\n                    ) : (\n                        <Box css={styles.gallery}>\n                            <EastChakraLibrary value={gallery} storageKey={`${storageKey}.gallery`} renderMedia={media} />\n                        </Box>\n                    )}\n                </Box>\n            </Box>\n        </Box>\n    );\n}\n\nimplementUIComponent(QueryLibraryComponent, EastChakraQueryLibrary);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Which of a form's fields hold a number to bounds (#1585): what every builder\n * checks its rows against — through the form's own check and words,\n * `fieldBreaches` — and where a form holds none, it checks nothing. A\n * builder's readiness raises each breach of a changed row as an issue\n * (`breachIssue`), which a builder wording its own issues knows for one\n * (`breachOf`). A builder reads each row it draws through `rowBreaches`:\n * the row wears the warn ring, stored or changed, and a stored row's breach\n * is a warning that holds no Save.\n *\n * @packageDocumentation\n */\n\nimport { decodeBeast2For, type EastType } from \"@elaraai/east\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { fieldBreachIssue, fieldBreaches, getSomeorUndefined, type EditIssue, type FieldBreach } from \"@elaraai/east-ui-components\";\n\n/**\n * Whether a field holds a number to a least or a most.\n *\n * @param spec - The field, as `Fields.specs` resolved it\n * @returns Whether its editor is a number's with a least or a most\n */\nexport function isBounded(spec: FieldSpecValue): boolean {\n    return spec.editor.type === \"number\"\n        && (getSomeorUndefined(spec.editor.value.min) !== undefined || getSomeorUndefined(spec.editor.value.max) !== undefined);\n}\n\n/** Each breach a builder's readiness raised, by its issue. */\nconst raised = new WeakMap<EditIssue, FieldBreach>();\n\n/**\n * A changed row's breach as an issue of a builder's readiness, as\n * `fieldBreachIssue` raises it, kept for {@link breachOf}.\n *\n * @param breach - The bound broken\n * @param entry - The row's entry\n * @returns The issue\n */\nexport function breachIssue(breach: FieldBreach, entry: string): EditIssue {\n    const issue = fieldBreachIssue(breach, { entry });\n    raised.set(issue, breach);\n    return issue;\n}\n\n/**\n * The breach an issue of a builder's readiness says: what a builder wording\n * its own issues names the field and the bound by.\n *\n * @param issue - The issue\n * @returns The breach; `undefined` for any other issue\n */\nexport function breachOf(issue: EditIssue): FieldBreach | undefined {\n    return raised.get(issue);\n}\n\n/** No breach: a row its form's bounds hold, or a form holding none. */\nconst NO_BREACHES: readonly FieldBreach[] = [];\n\n/**\n * A form's check over its rows as bytes: each row decoded once and checked against the form's bounded fields — those its\n * builder holds the row to, where it says, as its Save does — kept while its bytes are the same object. A form holding no\n * bounded field decodes nothing.\n *\n * @param specs - The row's form, as `Fields.specs` resolved it\n * @param rowType - The row's type\n * @param heldTo - The bounded fields a row is held to, from the row: every one unless given\n * @returns Each row's breaches, by its bytes\n */\nexport function rowBreaches(specs: readonly FieldSpecValue[], rowType: EastType, heldTo?: (row: unknown) => readonly FieldSpecValue[]): (bytes: Uint8Array) => readonly FieldBreach[] {\n    const bounded = specs.filter(isBounded);\n    if (bounded.length === 0) return () => NO_BREACHES;\n    const decode = decodeBeast2For(rowType) as (bytes: Uint8Array) => unknown;\n    const kept = new WeakMap<Uint8Array, readonly FieldBreach[]>();\n    return (bytes) => {\n        let found = kept.get(bytes);\n        if (found === undefined) {\n            const row = decode(bytes);\n            found = fieldBreaches(heldTo?.(row) ?? bounded, row);\n            kept.set(bytes, found);\n        }\n        return found;\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Imperative `Func.bind` orchestration for a renderer that calls a bound\n * function itself (#1323): the Allocation's fit.\n *\n * A surface receives only the function *name* in its payload\n * ({@link FuncBindingType}), not a live handle — the bound function runs after\n * the user acts, so the renderer rebuilds the call handle itself. This hook\n * takes the handle's signature (the Allocation's from its plans' bin values),\n * builds a handle on the shared {@link defaultFuncRuntime}, subscribes\n * to its tracked channel, and exposes `call` / `result` / `status` / `pending`\n * for React.\n *\n * All handles bound to the same `(workspace, name)` share one channel, so\n * calls observe independently and re-render the surface as each settles —\n * exactly the launch/observe split `Func.bind` uses.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from 'react';\nimport { isTypeValueEqual, toEastTypeValue, type EastType, type ValueTypeOf } from '@elaraai/east';\nimport { FuncBindHandleType, type FuncErrorType, type FuncStatusType } from '@elaraai/e3-ui/internal';\nimport { useDataStable } from '@elaraai/east-ui-components';\nimport {\n    defaultFuncRuntime,\n    funcChannelKey,\n    getReactiveDatasetCache,\n} from '../../platform/index.js';\n\n/** Lifecycle of the most recent call on a bound function's channel. */\nexport type FuncStatus = ValueTypeOf<FuncStatusType>['type'];\n\n/** A failed call's detail (the runner's outcome + captured output tails). */\nexport type FuncCallError = ValueTypeOf<FuncErrorType>;\n\n/** What {@link useFuncCall} returns for one bound function. */\nexport interface FuncCall<R> {\n    /** Launch the call, fire-and-forget (latest-wins). No-op when not ready. */\n    call: (...args: unknown[]) => void;\n    /** Cancel the call in flight, client-side: its response is ignored, and the channel reads `cancelled`. No-op when not ready. */\n    cancel: () => void;\n    /** Last successful result, or `null` until the first success. */\n    result: R | null;\n    /** Lifecycle of the most recent call. */\n    status: FuncStatus;\n    /** True while a call is in flight. */\n    pending: boolean;\n    /** Failure detail when the most recent call failed, else `null`. */\n    error: FuncCallError | null;\n}\n\n/** A bound function's call handle, as the runtime builds it. */\ntype FuncHandle = ValueTypeOf<ReturnType<typeof FuncBindHandleType<EastType[], EastType>>>;\n\n/** A bound function's signature: its parameter types (`null` until the row\n *  type is known) and its return type. */\ninterface Signature { inputs: EastType[] | null; output: EastType }\n\n/** Whether two types are one East type — East's own type equality. */\nfunction sameType(a: EastType, b: EastType): boolean {\n    return isTypeValueEqual(toEastTypeValue(a), toEastTypeValue(b));\n}\n\n/** Whether two signatures name the same East types. */\nfunction sameSignature(a: Signature, b: Signature): boolean {\n    const ai = a.inputs;\n    const bi = b.inputs;\n    return sameType(a.output, b.output) && (ai === null || bi === null\n        ? ai === bi\n        : ai.length === bi.length && ai.every((t, i) => sameType(t, bi[i]!)));\n}\n\nconst IDLE: FuncCall<never> = { call: () => {}, cancel: () => {}, result: null, status: 'idle', pending: false, error: null };\n\n/**\n * Build + observe a reactive call handle for a named workspace function.\n *\n * @typeParam R - The function's return type (decoded JS shape).\n * @param name - The bound function name, or `null` when the binding is absent\n *   (the hook degrades to an inert idle handle — safe for the rules of hooks —\n *   and asks nothing of the page: a surface with no function bound renders\n *   without a reactive provider, as a plain test or a static host mounts it).\n * @param inputs - The positional parameter East types (e.g. `[Array(Row), Spec]`).\n *   `null` until the row type is known.\n * @param output - The return East type.\n * @returns A {@link FuncCall} — stable `call` plus the reactive `result` /\n *   `status` / `pending` of this function's shared channel.\n */\nexport function useFuncCall<R>(\n    name: string | null,\n    inputs: EastType[] | null,\n    output: EastType,\n): FuncCall<R> {\n    // Without a binding the page's cache is never asked for: a builder with no optimiser, no fit, mounts without a provider.\n    const workspace = name === null ? '' : getReactiveDatasetCache().getConfig().workspace ?? '';\n    const ready = !!name && !!inputs && workspace !== '';\n\n    // The signature, held while it names the same East types — the inputs and\n    // output are fresh objects each render, but the types they name are stable,\n    // so the handle is rebuilt only when the signature really changes.\n    const signature = useDataStable<Signature>({ inputs, output }, sameSignature);\n\n    const handle = useMemo<FuncHandle | null>(() => {\n        if (!ready || signature.inputs === null) return null;\n        const handleType = toEastTypeValue(FuncBindHandleType(signature.inputs, signature.output));\n        return defaultFuncRuntime.buildHandle(handleType, name!) as FuncHandle;\n        // A new workspace is a new channel: rebuild the handle over it.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [ready, name, workspace, signature]);\n\n    const channelKey = ready ? funcChannelKey(workspace, name!) : '';\n    const version = useSyncExternalStore(\n        useCallback(\n            (cb: () => void) => (channelKey ? defaultFuncRuntime.subscribe(channelKey, cb) : () => {}),\n            [channelKey],\n        ),\n        useCallback(() => (channelKey ? defaultFuncRuntime.getKeyVersion(channelKey) : 0), [channelKey]),\n    );\n\n    return useMemo<FuncCall<R>>(() => {\n        if (!handle) return IDLE;\n        let result: R | null = null;\n        let status: FuncStatus = 'idle';\n        let pending = false;\n        let error: FuncCallError | null = null;\n        try {\n            const read = handle.read();\n            result = read.type === 'some' ? (read.value as R) : null;\n            status = handle.status().type;\n            pending = handle.pending();\n            const err = handle.error();\n            if (err.type === 'some') error = err.value;\n        } catch {\n            // Workspace not yet resolvable — treat as idle.\n        }\n        return {\n            call: (...args: unknown[]) => { try { handle.call(...args); } catch { /* not ready */ } },\n            cancel: () => { try { handle.cancel(); } catch { /* not ready */ } },\n            result, status, pending, error,\n        };\n        // `version` drives recompute as the channel advances.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [handle, version]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A run of the app's optimiser, as a builder asks it (#1409, #1414; `Optimise\n * Spec.md` §6, §9.1, R1–R6, R10; O3, O4, D2, D5): the app's `e3.function`,\n * bound as `fit` is and called by name through the shared `Func` runtime\n * (`useFuncCall`). One run per builder instance: {@link OptimiseRun.start}\n * sends one call with the request the builder makes for the run's number —\n * the period in view, every row of it as the session holds it, base plus\n * every unapplied draft — and while the call is out the run counts its\n * seconds and the builder holds its lock. {@link OptimiseRun.stop} cancels\n * the call: a response arriving after it is ignored, and `stopped` holds for\n * 2.5s while the footer says so. A change of scope — the period in view —\n * stops the run as Stop does (O4); a layout, view or filter change does not,\n * and the result lands in the period it was asked of. Unmount aborts. No\n * timeout of the client's: the e3 call's own deadline is the limit (D2).\n *\n * When the result lands the builder is told, with the request it answers and\n * the run's number: it diffs the two by key and records one step\n * ({@link OptimiseArgs.onLanded}), answering what it counted — changes, the\n * `done` outcome; none, the `none` outcome and one blink of the eye; a\n * refusal, a failure saying why — an answer that would change what the\n * builder takes no edit of (#1553); or no answer for an invalid response, a\n * failure. A rejected call, a transport error and a timed-out call are\n * failures too (R10). Runs are numbered per builder per browser, from 1, under\n * the builder's key (D5).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport type { EastType } from \"@elaraai/east\";\nimport { usePersistedState } from \"@elaraai/east-ui-components\";\nimport { keptRead } from \"@elaraai/east-ui-components/internal\";\nimport { useFuncCall, type FuncCall } from \"./use-func-call.js\";\n\n/** How long the footer says `Stopped · nothing changed` after Stop (§8): 2.5s. */\nexport const OPTIMISE_STOPPED_MS = 2500;\n\n/** What a builder counted of a result it landed as one step (R7, R8). */\nexport interface OptimiseCounts {\n    readonly added: number;\n    readonly changed: number;\n    readonly removed: number;\n}\n\n/**\n * A result the builder would not land (#1553): why, in its words — the\n * banner's line — such as an answer changing a duty of a published week.\n */\nexport interface OptimiseRefused {\n    readonly refused: string;\n}\n\n/**\n * What a run asks, and what the builder does with its answer.\n *\n * @typeParam Req - The request: the builder's `OptimiseRequest`\n * @typeParam Res - The result: its `OptimiseResult`\n */\nexport interface OptimiseArgs<Req, Res> {\n    /** The bound optimiser's name; `null` without one, and there is no eye. */\n    readonly name: string | null;\n    /** What the function takes. */\n    readonly requestType: EastType;\n    /** What it answers. */\n    readonly resultType: EastType;\n    /** The scope in view, by its key — the period: a change stops a run out (O4). */\n    readonly scope: string;\n    /** The builder's key: the run counter is kept under it (D5). */\n    readonly storageKey: string;\n    /**\n     * The result landed, for the run it was asked of: the builder diffs it\n     * against the request by key and records one step (R7, R8), answering\n     * what it counted; a refusal, recording nothing, for an answer it would\n     * not take, naming why (#1553); `undefined` for an invalid response — a\n     * key outside the scope, a row of another type — which is a failure (R10,\n     * §12).\n     */\n    readonly onLanded: (result: Res, request: Req, run: number) => OptimiseCounts | OptimiseRefused | undefined;\n}\n\n/** What a run came to (R10): its number, the period it was asked of, and what changed — or why not, `refused` the builder's words where it refused the answer (#1553). */\nexport type OptimiseRunOutcome =\n    | { readonly kind: \"done\"; readonly run: number; readonly period: string; readonly counts: OptimiseCounts }\n    | { readonly kind: \"none\"; readonly run: number; readonly period: string }\n    | { readonly kind: \"fail\"; readonly run: number; readonly period: string; readonly message: string; readonly refused?: string };\n\n/**\n * A run of the app's optimiser (see the module docs).\n *\n * @typeParam Req - The request\n */\nexport interface OptimiseRun<Req> {\n    /** Whether the app bound an optimiser: the eye shows only then. */\n    readonly offered: boolean;\n    /** Whether a call is out: the eye runs, the footer counts, the builder holds its lock (R2). */\n    readonly running: boolean;\n    /** The seconds since the call left, from 1, while a call is out. */\n    readonly seconds: number;\n    /** The latest run's number: the call out, or the last that landed or stopped; 0 before any. */\n    readonly run: number;\n    /**\n     * Starts a run (R1): one call with the request the builder makes for the\n     * run's number, over the period named. Nothing while one is out, or with\n     * no optimiser.\n     *\n     * @param request - The request for the run's number\n     * @param period - The period's label — `W11` — which the outcome names\n     */\n    start(request: (run: number) => Req, period: string): void;\n    /** Stops the run out (R3): the call cancelled, a late response ignored, nothing recorded. */\n    stop(): void;\n    /** Whether the footer says `Stopped · nothing changed`: for 2.5s after Stop. */\n    readonly stopped: boolean;\n    /** What the last run came to; `undefined` until one lands, after `dismiss`, and from the next `start`. */\n    readonly outcome: OptimiseRunOutcome | undefined;\n    /** Moves at each run that landed with nothing to change: the eye blinks once each time. */\n    readonly blinks: number;\n    /** Clears the outcome: the banner dismissed. */\n    dismiss(): void;\n}\n\n/** A call out: what it asked, for which run, over which scope, and what the channel held before it. */\ninterface Flight<Req> {\n    readonly run: number;\n    readonly period: string;\n    readonly scope: string;\n    readonly request: Req;\n    readonly resultBefore: unknown;\n    readonly errorBefore: unknown;\n    /** Whether the channel was seen running for it: a landing is told from what the channel held before. */\n    seenRunning: boolean;\n}\n\n/**\n * A run of the app's optimiser (see the module docs).\n *\n * @typeParam Req - The request\n * @typeParam Res - The result\n * @param args - The function, the scope, the builder's key, and what the builder does with a result\n * @returns The run\n */\nexport function useOptimise<Req, Res>(args: OptimiseArgs<Req, Res>): OptimiseRun<Req> {\n    const { name, requestType, resultType, scope, storageKey, onLanded } = args;\n    const call = useFuncCall<Res>(name, name === null ? null : [requestType], resultType);\n    // Runs are numbered per builder per browser, from 1 (D5).\n    const { state: counter, setState: setCounter } = usePersistedState<number>(`${storageKey}.optimise.run`, 0, keptRead.number);\n    const [running, setRunning] = useState(false);\n    const [startedAt, setStartedAt] = useState(0);\n    const [seconds, setSeconds] = useState(1);\n    const [stopped, setStopped] = useState(false);\n    const [outcome, setOutcome] = useState<OptimiseRunOutcome | undefined>(undefined);\n    const [blinks, setBlinks] = useState(0);\n    const flight = useRef<Flight<Req> | undefined>(undefined);\n    const stoppedTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n    // The latest render's call and callback: what the run's effects and commands act through.\n    const live = useRef<{ call: FuncCall<Res>; onLanded: OptimiseArgs<Req, Res>[\"onLanded\"] }>({ call, onLanded });\n    live.current = { call, onLanded };\n    // The call lands (R10): for the run out, told from the channel seen running, or moved on from what it held before.\n    useEffect(() => {\n        const out = flight.current;\n        if (out === undefined) return;\n        if (call.pending) { out.seenRunning = true; return; }\n        // The same objects the channel held before: nothing has landed yet (a new result is a new object, as a new error is).\n        if (!out.seenRunning && Object.is(call.result, out.resultBefore) && Object.is(call.error, out.errorBefore)) return;\n        flight.current = undefined;\n        setRunning(false);\n        if (call.status === \"succeeded\" && call.result !== null) {\n            let landed: OptimiseCounts | OptimiseRefused | undefined;\n            try {\n                landed = live.current.onLanded(call.result, out.request, out.run);\n            } catch (err) {\n                console.error(\"[Optimise] the result could not be landed:\", err);\n                landed = undefined;\n            }\n            if (landed === undefined) setOutcome({ kind: \"fail\", run: out.run, period: out.period, message: \"the optimiser's answer could not be used\" });\n            else if (\"refused\" in landed) setOutcome({ kind: \"fail\", run: out.run, period: out.period, message: landed.refused, refused: landed.refused });\n            else if (landed.added + landed.changed + landed.removed === 0) { setOutcome({ kind: \"none\", run: out.run, period: out.period }); setBlinks((n) => n + 1); }\n            else setOutcome({ kind: \"done\", run: out.run, period: out.period, counts: landed });\n        } else if (call.status === \"failed\") {\n            setOutcome({ kind: \"fail\", run: out.run, period: out.period, message: call.error?.message ?? \"the call failed\" });\n        }\n        // A channel cancelled elsewhere: nothing landed, nothing recorded.\n    }, [call]);\n    // The seconds, from 1, every second while the call is out.\n    useEffect(() => {\n        if (!running) return undefined;\n        // Rounded, as the mock's counter is: `2 s` from a second and a half out.\n        const tick = () => setSeconds(Math.max(1, Math.round((Date.now() - startedAt) / 1000)));\n        const timer = setInterval(tick, 1000);\n        return () => clearInterval(timer);\n    }, [running, startedAt]);\n    const stop = useCallback(() => {\n        const out = flight.current;\n        if (out === undefined) return;\n        flight.current = undefined;\n        live.current.call.cancel();\n        setRunning(false);\n        setStopped(true);\n        if (stoppedTimer.current !== undefined) clearTimeout(stoppedTimer.current);\n        stoppedTimer.current = setTimeout(() => { stoppedTimer.current = undefined; setStopped(false); }, OPTIMISE_STOPPED_MS);\n    }, []);\n    // A change of scope stops the run as Stop does (O4).\n    useEffect(() => {\n        const out = flight.current;\n        if (out !== undefined && out.scope !== scope) stop();\n    }, [scope, stop]);\n    // Unmount aborts the call, and lets the stopped note's timer go.\n    useEffect(() => () => {\n        if (flight.current !== undefined) { flight.current = undefined; live.current.call.cancel(); }\n        if (stoppedTimer.current !== undefined) clearTimeout(stoppedTimer.current);\n    }, []);\n    const start = useCallback((request: (run: number) => Req, period: string) => {\n        if (name === null || flight.current !== undefined) return;\n        const run = counter + 1;\n        setCounter(run);\n        const now = live.current.call;\n        const asked = request(run);\n        flight.current = { run, period, scope, request: asked, resultBefore: now.result, errorBefore: now.error, seenRunning: false };\n        setOutcome(undefined);\n        setStopped(false);\n        if (stoppedTimer.current !== undefined) { clearTimeout(stoppedTimer.current); stoppedTimer.current = undefined; }\n        setStartedAt(Date.now());\n        setSeconds(1);\n        setRunning(true);\n        now.call(asked);\n    }, [name, counter, setCounter, scope]);\n    const dismiss = useCallback(() => setOutcome(undefined), []);\n    return useMemo(() => ({ offered: name !== null, running, seconds, run: counter, start, stop, stopped, outcome, blinks, dismiss }),\n        [name, running, seconds, counter, start, stop, stopped, outcome, blinks, dismiss]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What every builder draws of a run of the app's optimiser (#1409; `Optimise\n * Spec.md` §6, §7): the eye in its toolbar, before the history item, and its\n * entry, which a builder whose View bundles the period's controls on a phone\n * lists in the eye's place where the row's floor needs the eye's room (ruled\n * 27 Oct 2026, \"Into the View menu\"); the banner in its banners slot while\n * the highlight is on, or until the next run on failure — a title and one\n * line, no actions and no close, as the mock's alert is; the footer line\n * while the call is out and for 2.5s after Stop;\n * the legend's `Elara change` during the highlight; and the lock while the\n * call is out. One hook over the run (`useOptimise`) and the landing\n * (east-ui-components' `useLanding`), so each builder lists the parts in its\n * frame and draws nothing of them itself.\n *\n * A result lands once the builder's own reads hold it: a step recorded moves\n * the drafts, the builder reads its rows again, and only then do its entries\n * carry the run's marks. So the landing waits for the builder's data to move\n * ({@link OptimisePartsArgs.landKey}) before it measures the entries and\n * starts the cascade — on a result, and on a Redo that re-inserts the run's\n * step, which replays the landing without the banner (R9).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactElement, type ReactNode } from \"react\";\nimport {\n    OptimiseBanner, OptimiseEntry, optimiseRunningLine, optimiseStoppedLine, optimiseToolbarItem,\n    type HistoryAction, type Landing, type OptimiseButtonSize, type OptimiseOutcome, type ToolbarItem,\n} from \"@elaraai/east-ui-components\";\nimport type { LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport type { OptimiseRun } from \"./use-optimise.js\";\n\n/**\n * What the parts are made over.\n *\n * @typeParam Req - The run's request\n */\nexport interface OptimisePartsArgs<Req> {\n    /** The run. */\n    readonly run: OptimiseRun<Req>;\n    /** The landing over the builder's frame. */\n    readonly landing: Landing;\n    /** The period's label — `W11`, `Oct 5 – 9`, `8 work orders` — which the eye, the footer line and the banner name. */\n    readonly period: string;\n    /**\n     * Whether the period cannot be optimised at all — read only, published, a month in view (ruled 25 Oct 2026, over\n     * D1): the builder lists no eye, rather than a disabled one.\n     */\n    readonly readOnly: boolean;\n    /**\n     * Whether the period cannot take a run yet — its reads in flight, a save under way: the eye disabled, its place\n     * kept, so a period step moves nothing in the toolbar.\n     */\n    readonly busy?: boolean | undefined;\n    /** The run's request for a run number: the period's rows as the session holds them, and the builder's context. */\n    readonly request: (run: number) => Req;\n    /**\n     * What moves when the builder's reads hold a step's drafts — its rows as read, by identity: a result lands once it\n     * has moved from where it stood as the step was recorded.\n     */\n    readonly landKey: unknown;\n    /** The eye's size: `toolbar` — 32 × 28, the builders' toolbar rows' — unless given. */\n    readonly size?: OptimiseButtonSize | undefined;\n}\n\n/** The parts, as a builder lists them in its frame. */\nexport interface OptimiseParts {\n    /** The eye's toolbar item, to list immediately before the history item; `undefined` with no optimiser, or where the period cannot be optimised. */\n    readonly toolbarItem: ToolbarItem | undefined;\n    /**\n     * The eye as an entry of the builder's View (`OptimiseEntry`): what a builder whose View bundles the period's controls\n     * on a phone lists in the eye's place where the row's floor folds the eye into it (ruled 27 Oct 2026, \"Into the View\n     * menu\") — the same run, its Stop and why it is off. `undefined` wherever {@link OptimiseParts.toolbarItem} is.\n     */\n    readonly entry: ReactElement | undefined;\n    /** The banner, for the banners slot; nothing with no optimiser. */\n    readonly banner: ReactNode;\n    /** The footer line while the call is out or just stopped; `undefined` otherwise, when the builder's own line shows. */\n    readonly line: LoadingLineValue | undefined;\n    /** Whether the legend's `Elara change` shows: the highlight is on over a run that changed something. */\n    readonly legend: boolean;\n    /** Whether the builder holds its lock (R2): a call is out. */\n    readonly locked: boolean;\n    /**\n     * Lands a run's result once the builder's reads hold it: called as the step is recorded, it waits for `landKey`\n     * to move, then starts the cascade and the highlight.\n     *\n     * @param run - The run that landed\n     */\n    landAfter(run: number): void;\n    /**\n     * A history action the builder is about to run, heard first (R9, R16): Undo, Apply and Discard end the highlight;\n     * a Redo that re-inserts a run's step replays its landing without the banner.\n     *\n     * @param action - The action\n     * @param redoOrigin - The origin of the step the Redo would re-insert, when the action is one\n     */\n    acted(action: HistoryAction, redoOrigin?: string | undefined): void;\n}\n\n/**\n * The parts of a run, over the run and the landing (see the module docs).\n *\n * @typeParam Req - The run's request\n * @param args - The run, the landing, the period, its request and what moves as the builder's reads do\n * @returns The parts\n */\nexport function useOptimiseParts<Req>({ run, landing, period, readOnly, busy = false, request, landKey, size = \"toolbar\" }: OptimisePartsArgs<Req>): OptimiseParts {\n    // Whether the banner stays away for this highlight: a Redo's replay (R9).\n    const [quiet, setQuiet] = useState(false);\n    // A landing waiting for the builder's reads to move from where they stood as its step was recorded.\n    const [waiting, setWaiting] = useState<{ run: number; key: unknown } | undefined>(undefined);\n    const live = useRef({ request, period, landKey });\n    live.current = { request, period, landKey };\n    // The landing's commands hold still while its phase moves: what the effects below hang on, never the landing itself.\n    const { land, light, end, lit } = landing;\n    useLayoutEffect(() => {\n        if (waiting === undefined || Object.is(waiting.key, landKey)) return;\n        setWaiting(undefined);\n        land(waiting.run);\n    }, [waiting, landKey, land]);\n    const landAfter = useCallback((landed: number) => { setWaiting({ run: landed, key: live.current.landKey }); }, []);\n    const onRun = useCallback(() => {\n        // A run during a highlight ends the highlight first (R12).\n        end();\n        setQuiet(false);\n        run.start(live.current.request, live.current.period);\n    }, [end, run]);\n    const { outcome } = run;\n    // A result with nothing to change lights the highlight with no landing: its banner shows for the 8s (R10) — once per outcome.\n    useEffect(() => {\n        if (outcome?.kind === \"none\") light();\n    }, [outcome, light]);\n    // A period that can no longer be optimised while its run is out — a month opened over the week, the week published —\n    // takes the eye with it, so the run stops as a period change stops one (O4): nothing is left running with no Stop.\n    const { running, stop } = run;\n    useEffect(() => {\n        if (readOnly && running) stop();\n    }, [readOnly, running, stop]);\n    const toolbarItem = useMemo(() => run.offered && !readOnly ? optimiseToolbarItem({\n        period, running: run.running, blink: run.blinks, disabled: busy, onRun, onStop: run.stop, size,\n    }) : undefined, [run.offered, run.running, run.blinks, run.stop, period, readOnly, busy, onRun, size]);\n    // The eye's entry in the View: the same run, named and off as the eye is.\n    const entry = useMemo(() => run.offered && !readOnly\n        ? <OptimiseEntry period={period} running={run.running} disabled={busy} onRun={onRun} onStop={run.stop} />\n        : undefined, [run.offered, run.running, run.stop, period, readOnly, busy, onRun]);\n    const shown: OptimiseOutcome | undefined = useMemo(() => {\n        if (outcome === undefined) return undefined;\n        if (outcome.kind === \"fail\") return { kind: \"fail\", period: outcome.period, ...(outcome.refused === undefined ? {} : { reason: outcome.refused }) };\n        if (!lit || quiet) return undefined;\n        return outcome.kind === \"done\"\n            ? { kind: \"done\", period: outcome.period, added: outcome.counts.added, changed: outcome.counts.changed, removed: outcome.counts.removed }\n            : { kind: \"none\", period: outcome.period };\n    }, [outcome, lit, quiet]);\n    // No close on the banner (§8): done and none go with the highlight, a failure with the next run.\n    const banner = useMemo(() => run.offered ? <OptimiseBanner outcome={shown} /> : null, [run.offered, shown]);\n    const line = run.running ? optimiseRunningLine(period, run.seconds) : run.stopped ? optimiseStoppedLine() : undefined;\n    const acted = useCallback((action: HistoryAction, redoOrigin?: string) => {\n        if (action === \"undo\" || action === \"apply\" || action === \"discard\") end();\n        else if (action === \"redo\" && redoOrigin === \"optimise\" && outcome?.kind === \"done\") { setQuiet(true); landAfter(outcome.run); }\n    }, [end, outcome, landAfter]);\n    return useMemo(() => ({ toolbarItem, entry, banner, line, legend: lit && outcome?.kind === \"done\", locked: run.running, landAfter, acted }),\n        [toolbarItem, entry, banner, line, lit, outcome, run.running, landAfter, acted]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a builder's footer loading line says (#1398, CL3) — the same shared\n * line (east-ui-components' `LoadingLine`) in every builder, its words the\n * builder's, in its record's noun:\n *\n * - **a paged source** — the Sheet's and the Plan's rows: `Loading work\n *   orders 8,301–8,500` (`Loading work orders…` while the rows read are not\n *   known yet), `Filtering work orders…` while a narrowing's rows are read\n *   and the last narrowing's stand in, `Couldn't read work orders\n *   8,301–8,500` with Retry ({@link PagedLoading}, {@link pagedLoadingLine});\n * - **a period** — the Roster's week, the Calendar's window, the\n *   Allocation's day: `Loading 12–18 Mar`, `Filtering people…` while a\n *   source the builder follows reads a new narrowing, `Couldn't read Wed 12\n *   May` with Retry ({@link periodLoading}, {@link periodLoadingLine}).\n *\n * Never a count of what has loaded: the toolbar's count is the only count.\n * Each builder's message table carries its words — the Sheet's and the\n * Plan's their own, extending {@link PagedLoadingMessages}; the period\n * builders share {@link scheduleLoadingMessages}.\n *\n * @packageDocumentation\n */\n\nimport { none, type option } from \"@elaraai/east\";\nimport { loadingLineText, loadingMessages, type LoadingLineText, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\n\n/**\n * What a paged source reads now, or could not read: its elements in flight\n * (`from`–`to`, 0-based and inclusive, both `undefined` before the rows read\n * are known), a narrowing's rows read while the last narrowing's stand in, or\n * a read that failed — a window's elements, or the source's own count or\n * revision, with no range — and why.\n */\nexport type PagedLoading =\n    | { readonly kind: \"loading\"; readonly from: number | undefined; readonly to: number | undefined }\n    | { readonly kind: \"filtering\" }\n    | { readonly kind: \"failed\"; readonly from: number | undefined; readonly to: number | undefined; readonly reason: string };\n\n/** The loading line's words over a paged source: numbers arrive formatted, 1-based. */\nexport interface PagedLoadingMessages {\n    /** A read in flight — `Loading work orders 8,301–8,500`, the range strong; `Loading work orders…` before the rows read are known. */\n    lineLoading: (p: { noun: string; from: string | undefined; to: string | undefined }) => LoadingLineText;\n    /** A narrowing's rows read, the last narrowing's standing in — `Filtering work orders…`. */\n    lineFiltering: (p: { noun: string }) => LoadingLineText;\n    /** A read that failed — `Couldn't read work orders 8,301–8,500`, or the source's, with no range. */\n    lineFailed: (p: { noun: string; from: string | undefined; to: string | undefined }) => LoadingLineText;\n    /** The line's short form, where its full text does not fit the rail — `Loading…`, `Filtering…`, `Couldn't read`. */\n    lineShort: (p: { kind: \"loading\" | \"filtering\" | \"failed\" }) => string;\n    /** The failed line's Retry. */\n    retry: () => string;\n    /** A failed run's Retry, by what it asks again — its accessible name, `Retry work orders 8,301–8,500` (#1398, CL11). */\n    retryRange: (p: { noun: string; from: string; to: string }) => string;\n}\n\n/** The short forms, in the shared parts' words. */\nfunction shortOf(kind: \"loading\" | \"filtering\" | \"failed\"): string {\n    return kind === \"loading\" ? loadingMessages.loading() : kind === \"filtering\" ? loadingMessages.filtering() : loadingMessages.failed();\n}\n\n/** The loading line's words over a paged source, in English. */\nexport const pagedLoadingMessages: PagedLoadingMessages = {\n    lineLoading: ({ noun, from, to }) => (from === undefined || to === undefined ? [`Loading ${noun}…`] : [`Loading ${noun} `, { strong: `${from}–${to}` }]),\n    lineFiltering: ({ noun }) => [`Filtering ${noun}…`],\n    lineFailed: ({ noun, from, to }) => (from === undefined || to === undefined ? [`Couldn't read ${noun}`] : [`Couldn't read ${noun} `, { strong: `${from}–${to}` }]),\n    lineShort: ({ kind }) => shortOf(kind),\n    retry: () => loadingMessages.retry(),\n    retryRange: ({ noun, from, to }) => `Retry ${noun} ${from}–${to}`,\n};\n\n/**\n * The line a paged source's read says, in a builder's words.\n *\n * @param loading - What is read, or failed; `undefined` while nothing is\n * @param noun - What the rail counts the rows in — `work orders`\n * @param m - The builder's message table\n * @param number - The builder's locale's number formatter\n * @param onRetry - What the failed line's Retry asks again\n * @returns The line's value; `undefined` while nothing is read\n */\nexport function pagedLoadingLine(\n    loading: PagedLoading | undefined, noun: string, m: PagedLoadingMessages, number: (n: number) => string, onRetry: () => void,\n): LoadingLineValue | undefined {\n    if (loading === undefined) return undefined;\n    const range = (from: number | undefined, to: number | undefined) =>\n        ({ from: from === undefined ? undefined : number(from + 1), to: to === undefined ? undefined : number(to + 1) });\n    switch (loading.kind) {\n        case \"loading\": return { kind: \"loading\", text: m.lineLoading({ noun, ...range(loading.from, loading.to) }), short: m.lineShort({ kind: \"loading\" }) };\n        case \"filtering\": return { kind: \"loading\", text: m.lineFiltering({ noun }), short: m.lineShort({ kind: \"filtering\" }) };\n        case \"failed\": return {\n            kind: \"failed\", text: m.lineFailed({ noun, ...range(loading.from, loading.to) }), short: m.lineShort({ kind: \"failed\" }),\n            reason: loading.reason, onRetry, retry: m.retry(),\n        };\n    }\n}\n\n/**\n * What a period builder reads now, or could not read: the period's own reads\n * — its events, its own row, the Roster's targets — or, after a source of the\n * slice it follows has first resolved, that source's new narrowing, the last\n * standing in; or a read that failed — the period's, or a source's, named by\n * its noun — why, and what asks it again.\n */\nexport type PeriodLoading =\n    | { readonly kind: \"loading\" }\n    | { readonly kind: \"filtering\"; readonly noun: string }\n    | { readonly kind: \"failed\"; readonly reason: string; readonly noun?: string | undefined; readonly onRetry: () => void };\n\n/** A source of the slice a period builder follows beside its period — the Roster's people, the Allocation's lanes. */\nexport interface PeriodNarrowing {\n    /** What its rows are, in the rail's words — `people`. */\n    readonly noun: string;\n    /** Whether a complete membership has resolved: until one has, its read is part of the frame's first. */\n    readonly ready: boolean;\n    /** Whether a membership is being read. */\n    readonly loading: boolean;\n    /** Why its read failed. */\n    readonly error: string | undefined;\n    /** Reads it again. */\n    readonly retry: () => void;\n}\n\n/**\n * What a period builder's line says of its reads (#1398, CL3): a failure\n * first — the period's, then a source's — then the period's reads, a source's\n * first membership among them, then a source's new narrowing.\n *\n * @param period - The period's own reads: whether one is in flight, why the latest failed, and what asks them again\n * @param narrowings - The sources the builder follows beside the period, in the rail's order\n * @returns What the line says; `undefined` while nothing is read\n */\nexport function periodLoading(period: { readonly loading: boolean; readonly error: string | undefined; readonly retry: () => void },\n    narrowings: readonly PeriodNarrowing[]): PeriodLoading | undefined {\n    if (period.error !== undefined) return { kind: \"failed\", reason: period.error, onRetry: period.retry };\n    for (const source of narrowings) if (source.error !== undefined) return { kind: \"failed\", reason: source.error, noun: source.noun, onRetry: source.retry };\n    if (period.loading || narrowings.some(source => !source.ready && source.loading)) return { kind: \"loading\" };\n    const filtering = narrowings.find(source => source.loading);\n    return filtering === undefined ? undefined : { kind: \"filtering\", noun: filtering.noun };\n}\n\n/** The loading line's words over a period — the Roster's week, the Calendar's window, the Allocation's day. */\nexport interface ScheduleLoadingMessages {\n    /** A period read — `Loading 12–18 Mar`, the period strong. */\n    periodLoading: (p: { period: string }) => LoadingLineText;\n    /** A source's new narrowing read, the last standing in — `Filtering people…`. */\n    periodFiltering: (p: { noun: string }) => LoadingLineText;\n    /** A period whose read failed — `Couldn't read Wed 12 May`. */\n    periodFailed: (p: { period: string }) => LoadingLineText;\n    /** A source whose narrowing could not be read — `Couldn't read people`. */\n    sourceFailed: (p: { noun: string }) => LoadingLineText;\n    /** The line's short form, where its full text does not fit the rail — `Loading…`, `Filtering…`, `Couldn't read`. */\n    periodShort: (p: { kind: \"loading\" | \"filtering\" | \"failed\" }) => string;\n    /** The failed line's Retry. */\n    retry: () => string;\n}\n\n/** The period builders' loading line words, in English. */\nexport const scheduleLoadingMessages: ScheduleLoadingMessages = {\n    periodLoading: ({ period }) => [\"Loading \", { strong: period }],\n    periodFiltering: ({ noun }) => [`Filtering ${noun}…`],\n    periodFailed: ({ period }) => [\"Couldn't read \", { strong: period }],\n    sourceFailed: ({ noun }) => [`Couldn't read ${noun}`],\n    periodShort: ({ kind }) => shortOf(kind),\n    retry: () => loadingMessages.retry(),\n};\n\n/**\n * The line a period builder's reads say (#1398, CL3).\n *\n * @param state - What is read, or failed (`periodLoading`); `undefined` while nothing is\n * @param period - The period, as its builder names it — `12–18 Mar`\n * @param m - The words: the shared schedule table unless given\n * @returns The line's value; `undefined` while nothing is read\n */\nexport function periodLoadingLine(state: PeriodLoading | undefined, period: string, m: ScheduleLoadingMessages = scheduleLoadingMessages): LoadingLineValue | undefined {\n    if (state === undefined) return undefined;\n    switch (state.kind) {\n        case \"loading\": return { kind: \"loading\", text: m.periodLoading({ period }), short: m.periodShort({ kind: \"loading\" }) };\n        case \"filtering\": return { kind: \"loading\", text: m.periodFiltering({ noun: state.noun }), short: m.periodShort({ kind: \"filtering\" }) };\n        case \"failed\": return {\n            kind: \"failed\", text: state.noun === undefined ? m.periodFailed({ period }) : m.sourceFailed({ noun: state.noun }),\n            short: m.periodShort({ kind: \"failed\" }), reason: state.reason, onRetry: state.onRetry, retry: m.retry(),\n        };\n    }\n}\n\n/**\n * What a period builder's views draw of the period they show (#1398):\n *\n * - `held`: the period as read;\n * - `pending`: a period not read yet — its geometry and what is known without\n *   its read at once, and a placeholder where its content goes (CL2), never a\n *   value it has not read (CL13); each placeholder unseen at its footprint\n *   until the builder's one reveal clock says so (CL4: its `LoadingReveal`,\n *   which each placeholder reads itself, so the clock's flip renders the\n *   placeholders and never the frame);\n * - `failed`: a period whose read failed — its geometry, its cells blank, and\n *   the failure said once, in its first row in view, with Retry (CL11).\n */\nexport type PeriodRead =\n    | { readonly state: \"held\" }\n    | { readonly state: \"pending\" }\n    | { readonly state: \"failed\"; readonly message: string; readonly retry: () => void };\n\n/** The period as read. */\nexport const HELD_PERIOD: PeriodRead = { state: \"held\" };\n\n/** A period not read yet. */\nconst PENDING_PERIOD: PeriodRead = { state: \"pending\" };\n\n/**\n * What a period builder's views draw of its period ({@link PeriodRead}): the\n * period as read once it has landed; else, its read failed, the failure in the\n * builder's words — `Couldn't read Wed 12 May` — and what asks it again; else\n * pending.\n *\n * @param period - Whether the period shown has landed, why its read failed, what it is called — `Wed 12 May` — and what asks it again\n * @param m - The words: the shared schedule table unless given\n * @returns What the views draw\n */\nexport function periodRead(period: { readonly current: boolean; readonly error: string | undefined; readonly name: string; readonly retry: () => void },\n    m: ScheduleLoadingMessages = scheduleLoadingMessages): PeriodRead {\n    if (period.current) return HELD_PERIOD;\n    if (period.error !== undefined) return { state: \"failed\", message: loadingLineText(m.periodFailed({ period: period.name })), retry: period.retry };\n    return PENDING_PERIOD;\n}\n\n/** A record a period's read reads: its `entries` where it is read a window at a time, and its source of the slice, if any. */\nexport interface PeriodRecord {\n    /** The record read by key: `none` for a record read whole. */\n    readonly entries: option<{ readonly refresh: (target: option<string>) => unknown }>;\n    /** Its source's part of the slice. */\n    readonly part?: { readonly retry: () => unknown } | undefined;\n}\n\n/**\n * Ask again every record a period's read reads (#1398, the line's Retry):\n * each read a window at a time through its `entries` — a refresh, which asks\n * again at once what failed — and each other through its source of the\n * slice, whose Retry is the same refresh.\n *\n * @param records - The records the period's read reads\n */\nexport function retryPeriod(records: readonly PeriodRecord[]): void {\n    for (const record of records) {\n        if (record.entries.type === \"some\") record.entries.value.refresh(none);\n        else record.part?.retry();\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Shared record editing for Plan, Calendar and the builders over the app's own\n * records: one history, checked saves and windowed reads. Each event kind is a\n * session of the history, and so is each record a builder writes beside its\n * kinds a row at a time — the Roster's weeks and targets (#1369) — so a gesture\n * across them is one step, and Save sends each record's changes as a request\n * of its own. A kind whose events a reader reads by its cells (#1424) keeps\n * what each Save lands of them, as the Save left them, for that reader to draw\n * over cells read before the commit until it has read them again (`landed`,\n * `shown`): a Save's confirmation reads its events by their keys, never the\n * cells.\n */\nimport { useCallback, useMemo, useRef, type RefObject } from \"react\";\nimport {\n    BlobType, DictType, IntegerType, OptionType, SortedMap, StringType, compareFor, decodeBeast2For, encodeBeast2For, equalFor, fromEastTypeValue,\n    isVariant, none, parseFor, some, variant, type EastType, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport type { ScheduleKindType, ScheduleItemType, ScheduleDraftsType, ScheduleGestureType, ScheduleReadType } from \"@elaraai/e3-ui/internal\";\nimport {\n    EntryRefType, drawnFromKeys, fieldBreaches, historyKeyOf, madeFromKeys, nextIntegerKeys, onceKeys, pastKeys, randomKeys, useEditHistory,\n    useTrackedEvaluation,\n    type EditHistory, type EditHistoryJoined, type EditHistoryPaged, type EditHistoryPart, type EditHistorySource, type EditSession,\n    type EntryKeys, type EntryVersion, type LandedEntry, type Origin,\n} from \"@elaraai/east-ui-components\";\nimport { boundedReadiness, wholeEntryReadiness, prepareRecordSliceSave } from \"@elaraai/east-ui-components/internal\";\nimport type { FieldSpecValue, RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { breachIssue, isBounded } from \"../bounds.js\";\nimport { entriesByKeyOf, readSinceAnswerOf } from \"../../platform/paged-runtime.js\";\n\n/** The common event projection decoded from Schedule. */\ntype Item = ValueTypeOf<typeof ScheduleItemType>;\n/** An event's projected facts and its full record row. */\nexport type ScheduleRead<I extends Item = Item> = Omit<ValueTypeOf<typeof ScheduleReadType>, \"item\"> & { readonly item: I };\n/**\n * The common kind, with a renderer's richer projection when it has one: one event by its key's text, the drafts in\n * place, its row as a reader of the kind's cells holds it given (#1039) — `none` for a kind given no cells, which reads\n * the window; `some(none)` for an event they do not hold, read by its key ({@link heldRowOf}).\n */\nexport type ScheduleEditingKind<I extends Item = Item> = Omit<ValueTypeOf<typeof ScheduleKindType>, \"event\"> & {\n    readonly event: (id: string, drafts: ScheduleKindDraftsValue, from: Date, to: Date, held: option<option<Uint8Array>>) => option<ScheduleRead<I>>;\n};\n/**\n * The rows a builder's reads hold of one kind, by the event's key's text: each its row's bytes — read one at a time by a\n * gesture or an inspector, or every one in turn by a check over them all.\n */\nexport interface ScheduleKindRows extends Iterable<readonly [string, { readonly row: Uint8Array }]> {\n    /**\n     * Whether they hold an event.\n     *\n     * @param id - The event's key's text\n     */\n    has(id: string): boolean;\n    /**\n     * An event's row.\n     *\n     * @param id - The event's key's text\n     * @returns Its row's bytes; `undefined` for an event they do not hold\n     */\n    get(id: string): { readonly row: Uint8Array } | undefined;\n}\n/**\n * The rows each kind a reader gives cells holds (#1039, #1599) — a kind read by its series index's cells, or its\n * window's own rows — by the kind's slot, then by the event's key's text: where a gesture, the inspector and a banner\n * find one of its events, with no read of its own.\n */\nexport type ScheduleHeldRows = ReadonlyMap<string, ScheduleKindRows>;\n/**\n * What the cells' reader holds of one event of a kind (#1039), as the kind's `event` takes it: `none` for a kind it gives\n * no cells, which reads the window; `some(none)` for an event they do not hold, read by its key; else the event's row.\n *\n * @param held - The rows each kind given cells holds, by its slot\n * @param kind - The event's kind's slot\n * @param id - The event's key's text\n * @returns What its `event` is given\n */\nexport function heldRowOf(held: ScheduleHeldRows | undefined, kind: string, id: string): option<option<Uint8Array>> {\n    const rows = held?.get(kind);\n    if (rows === undefined) return none;\n    const row = rows.get(id);\n    return some(row === undefined ? none : some(row.row));\n}\n/**\n * Where an issue of a kind's session is, as a builder names it — its event's\n * title, read with the drafts in place; for an event the drafts removed, its\n * title as its record held it when last read ({@link ScheduleEditing.heldEvent}):\n * a conflict's card names the event a person removed, never its key — or its\n * key's text while the event is read, or where its read fails; empty for the\n * source as a whole.\n *\n * @param editing - The shared editing\n * @param kind - The kind's slot\n * @param entry - The issue's entry: its event's key's text\n * @returns The event's name\n */\nexport function scheduleIssueName(editing: Pick<ScheduleEditing, \"read\" | \"heldEvent\">, kind: string, entry: string): string {\n    if (entry === \"\") return \"\";\n    try {\n        return (editing.read(kind, entry) ?? editing.heldEvent(kind, entry))?.item.title ?? entry;\n    } catch {\n        return entry;\n    }\n}\n\n/** One event entry's identity in the shared session. */\nexport interface ScheduleEntryRef { readonly id: string }\n/** The time range the renderer reads. */\nexport interface ScheduleRange { readonly from: Date; readonly to: Date }\n/** Every kind's drafts, by kind then entry id. */\nexport type ScheduleEventDraftsValue = ValueTypeOf<DictType<StringType, typeof ScheduleDraftsType>>;\n/** One kind's drafts. */\nexport type ScheduleKindDraftsValue = ValueTypeOf<typeof ScheduleDraftsType>;\n/** A write through a kind's field names. */\nexport type ScheduleGestureValue = ValueTypeOf<typeof ScheduleGestureType>;\n\n/**\n * One event a gesture changes, and how: through its kind's `write` (a move,\n * a resize, a drop, a schedule or an unschedule, a field edited), its new row\n * whole (an author's `update`, a duplicate — `created`, an event under a new\n * key), or deleted. A row of a record beside the kinds is given whole,\n * rewritten from the row as the gesture finds it (#1388: the Schematic's\n * gestures, each through its kind's own `write`; Publish's status, over the\n * period's row as its Save left it), or deleted.\n */\nexport type ScheduleChange =\n    | { readonly kind: string; readonly id: string; readonly gesture: ScheduleGestureValue }\n    | { readonly kind: string; readonly id: string; readonly row: Uint8Array; readonly created?: true | undefined }\n    | {\n        readonly kind: string; readonly id: string;\n        /**\n         * The row as the gesture leaves it, from the row as it finds it — drafted, else as the record holds it: the\n         * row the session's original is, so a rewrite never rests on a copy older than it. `undefined` refuses\n         * it, and the gesture records nothing.\n         */\n        readonly rewrite: (row: Uint8Array) => Uint8Array | undefined;\n        /**\n         * The row the gesture writes where it finds none, made only then: a period its record holds no row of, which\n         * Publish writes afresh from the app's `values`. Left out, or making none — `values` that fail as they run —\n         * a gesture that finds no row records nothing.\n         */\n        readonly absent?: (() => Uint8Array | undefined) | undefined;\n    }\n    | { readonly kind: string; readonly id: string; readonly remove: true };\n\n/**\n * A record a builder writes beside its event kinds, a whole row at a time\n * (#1369): the Roster's weeks (`Schedule.periods`) and targets\n * (`Roster.targets`), and each of the Schematic's kinds and their details\n * (#1388). Its session joins the history as a kind's does; a change names it\n * by its key, and gives its new row whole, rewrites it, or removes it.\n */\nexport interface ScheduleEditingRecord {\n    /** What a change names it by (`periods`, `targets`, a Schematic kind's slot): distinct from every other's. */\n    readonly key: string;\n    /** What its banners call it. */\n    readonly name: string;\n    /** Its session over the record: its entry and key types, and its patch door. */\n    readonly editing: ValueTypeOf<typeof ScheduleKindType>[\"editing\"];\n    /** The record read by key, for one read a window at a time; `none` for one read whole. */\n    readonly entries: ValueTypeOf<typeof ScheduleKindType>[\"entries\"];\n    /** The app's check over its drafted rows, which holds Save, naming the row; none unless given. */\n    readonly ready?: ValueTypeOf<typeof ScheduleKindType>[\"ready\"] | undefined;\n    /**\n     * Its row's form, as its builder's inspector draws it (#1585): a changed row's number outside its field's bounds\n     * holds Save as the app's check does, naming the row and the field. None unless given.\n     */\n    readonly fields?: readonly FieldSpecValue[] | undefined;\n    /**\n     * Whether the builder draws what a confirmed Save landed of it over the rows it read before the commit, until they\n     * are read again (`EditSession.landed`): a record read by key whose rows the builder reads apart from the\n     * confirmation — the Schematic's kinds read by area, their windows. `false` by default.\n     */\n    readonly drawsLanded?: boolean | undefined;\n}\n\n/**\n * A row as a builder's own reads hold it, by its key's text (#1369): `undefined`\n * for one they do not hold, which is read by its key; `none` while they are\n * read; `some(none)` for one they hold the record has none of; else its bytes.\n * Every read of a record is pinned to one revision, so a builder's window\n * holds its rows at the revision a Save committed once it lands: the Save\n * confirms what the window holds from it, and reads by key only the rest.\n */\nexport type ScheduleRowRead = (id: string) => option<option<Uint8Array>> | undefined;\n\n/**\n * Each kind's or record's rows as its builder draws them now, by its slot or key, then by the row's key's text: its\n * bytes, or `undefined` for one the builder draws none of ({@link ScheduleEditingArgs.standing}).\n */\nexport type ScheduleStandingRows = Readonly<Record<string, (id: string) => Uint8Array | undefined>>;\n\n/** An event a confirmed Save landed, as it left it ({@link ScheduleLandedRows}). */\nexport interface ScheduleLandedRow {\n    /** The event as the Save left it, as the seams take a draft: its row, or `missing` for one the Save deleted. */\n    readonly draft: Uint8Array;\n    /** Its row as the Save left it, as a reader of the kind's cells holds a row; `undefined` for one the Save deleted. */\n    readonly row: Uint8Array | undefined;\n}\n\n/**\n * What confirmed Saves landed of a kind whose events its builder reads apart from a Save's confirmation — a kind a reader\n * reads by its cells (#1424) — as its session keeps them (`EditSession.landed`), each event encoded once; and the\n * revision each of their Saves was drafted at, which tells a read of the kind from before them from one that holds them\n * (east-ui-components' `readBeforeSaves`).\n */\nexport interface ScheduleLandedRows {\n    /** Each event a Save landed, by its key's text. */\n    readonly rows: ReadonlyMap<string, ScheduleLandedRow>;\n    /** The revisions the Saves' requests were drafted at; `undefined` among them for an event held from none (`LandedEntry.from`). */\n    readonly from: ReadonlySet<string | undefined>;\n}\n\n/** What confirmed Saves landed of each kind that draws them, by the kind's slot. */\nexport type ScheduleLanded = ReadonlyMap<string, ScheduleLandedRows>;\n\n/**\n * The new events the last carry-over of each kind's drafts gave another key (#1583), by the kind's slot, then by the key\n * the event had (`EditSession.renumbered`): the key made for each was taken by another Save's own new event.\n */\nexport type ScheduleRenumbered = ReadonlyMap<string, ReadonlyMap<string, string>>;\n\n/** One kind's session, or one record's, as the history holds it, for its banners. */\nexport interface ScheduleKindSession {\n    /** The kind's slot, or the record's key. */\n    readonly kind: string;\n    /** Its key in the history. */\n    readonly key: string;\n    /** Its session. */\n    readonly session: EditSession<ScheduleEntryRef>;\n    /** Its row's form, as its builder's inspector draws it: what its issues name a field by (#1585). */\n    readonly fields: readonly FieldSpecValue[];\n}\n\n/** What {@link useScheduleEditing} hands the canvas. */\nexport interface ScheduleEditing<I extends Item = Item> {\n    /** The one history across the kinds, the records and the joined sessions — `data`'s. */\n    readonly history: EditHistory<ScheduleEntryRef>;\n    /** Each kind's session, in the kinds' order, then each record's. */\n    readonly sessions: readonly ScheduleKindSession[];\n    /** Every kind's drafts and every record's, by kind or record then by entry id — the same object while their bytes hold. */\n    readonly drafts: ScheduleEventDraftsValue;\n    /** Moves each time the drafts do. */\n    readonly draftsVersion: number;\n    /**\n     * What confirmed Saves landed of each kind given {@link ScheduleEditingArgs.drawsLanded}, by its slot: what a reader\n     * of its cells draws over cells read before the commit, until they are read again ({@link ScheduleEditing.shown}).\n     * The same object while nothing landed moves, a kind's the same while its own holds; one empty object while nothing\n     * is held.\n     */\n    readonly landed: ScheduleLanded;\n    /**\n     * The new events the last carry-over of each kind's drafts gave another key ({@link ScheduleEditingArgs.rekeys}):\n     * what a builder moves on to the new key with them — its selection. The same object until a carry-over gives an\n     * event another key; one empty object while none has.\n     */\n    readonly renumbered: ScheduleRenumbered;\n    /** The history's version: it moves with every change of it or of its sessions. */\n    readonly version: number;\n    /**\n     * Lets go of what Saves landed of a kind's events, once its builder's reads hold them as the record does now\n     * ({@link ScheduleEditing.landed}).\n     *\n     * @param kind - The kind's slot\n     * @param ids - The events' keys' texts\n     */\n    shown(kind: string, ids: Iterable<string>): void;\n    /**\n     * A kind's drafts, or a record's, by entry id: what its seams read.\n     *\n     * @param kind - The kind's slot, or the record's key\n     * @returns Its drafts; none for one with none\n     */\n    draftsOf(kind: string): ScheduleKindDraftsValue;\n    /**\n     * Whether a kind or a record takes a gesture now: its record read, its session writable.\n     *\n     * @param kind - The kind's slot, or the record's key\n     */\n    available(kind: string): boolean;\n    /**\n     * Whether a kind's session — or a record's — has yet to judge its drafts where its record reads now (#1599): it is\n     * carrying them over to a record that moved, or — from the very render the record moves in, before the session is\n     * told — it stands, no request of its own out, at another revision than the one its record reads at. What it says\n     * of a drafted row meanwhile, that its record holds it ({@link ScheduleEditing.held}), is of the record as it was: a\n     * builder keeps such a row as it last drew it (`drafted-rows.ts`' `DraftedStanding`). Tracked where it is called:\n     * it reads the record's revision.\n     *\n     * @param kind - The kind's slot, or the record's key\n     * @returns Whether it has; never for one read whole, whose session judges its drafts as its record is read\n     */\n    carrying(kind: string): boolean;\n    /**\n     * Whether an event — or a row of a record a builder writes — holds a\n     * conflict not yet chosen: what wears the warn ring on a canvas.\n     *\n     * @param kind - The kind's slot, or the record's key\n     * @param id - The event's key's text\n     */\n    conflicted(kind: string, id: string): boolean;\n    /**\n     * An event's row as its kind's record held it when last read — what its\n     * drafts are tinted against — or a row of a record a builder writes.\n     *\n     * @param kind - The kind's slot, or the record's key\n     * @param id - The event's key's text\n     * @returns The row, decoded; `undefined` for an event the record does not hold — and, for a kind read a window at\n     *   a time (#1199), for one its drafts do not hold, which stands as the record holds it\n     */\n    held(kind: string, id: string): unknown;\n    /**\n     * An event as its kind's record held it when last read ({@link ScheduleEditing.held}), read as its kind reads a row\n     * — its title, its start and its end — with none of its drafts in place and no read of the record: what names an\n     * event its drafts removed.\n     *\n     * @param kind - The kind's slot\n     * @param id - The event's key's text\n     * @returns The event; `undefined` for one {@link ScheduleEditing.held} holds no row of, or a record beside the kinds\n     * @throws {Error} When the kind's read of the row fails\n     */\n    heldEvent(kind: string, id: string): ScheduleRead<I> | undefined;\n    /**\n     * One event as its kind reads it now, its drafts in place (#1197, #1199):\n     * what a gesture, the inspector and a banner read of it. Where the\n     * builder's own reads hold its row (`reads`: a page of the Calendar's\n     * Backlog, #1424), it is read from that row; else a kind read a window at\n     * a time looks for it among the rows its windows hold over the range the\n     * canvas reads, then reads it by its key — tracked, inside a tracked\n     * evaluation, so the read lands there.\n     *\n     * @param kind - The kind's slot\n     * @param id - The event's key's text\n     * @returns The event as Plan draws it, and its row; `undefined` for no such event, or one whose read is in flight\n     * @throws {Error} When the kind's read fails\n     */\n    read(kind: string, id: string): ScheduleRead<I> | undefined;\n    /**\n     * A new event's key, as its text — its kind's session's to make\n     * (`EditSession.mint`): a text key from an event's key or a template's,\n     * else made up — the next in a row (`J-1001-2`) for a kind whose record\n     * its session holds whole, and with a suffix drawn at random\n     * (`J-1001-5f3a9c2e`) for one read a window at a time, whose earlier\n     * copies stand out of view; an Integer key one past the largest; past\n     * every key the record is known to hold, the drafts hold, the builder\n     * shows a row under and `minted` holds. Two sessions that hold a record\n     * whole make the same key from the same one: where another Save takes it\n     * first, a kind given {@link ScheduleEditingArgs.rekeys} has the event\n     * made another, and any other raises the two as a conflict.\n     *\n     * @param kind - The kind's slot, or the record's key\n     * @param from - The key's text it is made from; empty for a row made from none\n     * @param minted - The keys a gesture has made already\n     * @returns The key's text; `undefined` for a kind keyed by neither String nor Integer, and while an Integer kind\n     *   read a window at a time has its largest key read\n     */\n    mint(kind: string, from: string, minted: ReadonlySet<string>): string | undefined;\n    /**\n     * Record one gesture as one step of the history: each event it changes,\n     * in its kind's session, and each row of a record, in the record's — a\n     * record's row given whole, rewritten from the row as it stands, or\n     * removed.\n     *\n     * @param changes - Each event or row it changes, and how; one changed twice composes, in order\n     * @param origin - The gesture\n     * @param label - Its label in the history\n     * @returns Whether anything changed; nothing is, when a rewrite refuses, or finds no row and gives none in its place\n     */\n    record(changes: readonly ScheduleChange[], origin: Origin, label: string): boolean;\n}\n\n/** What {@link useScheduleEditing} reads. */\nexport interface ScheduleEditingArgs<I extends Item = Item> {\n    /** The event kinds, as the payload carries them. */\n    kinds: readonly ScheduleEditingKind<I>[];\n    /** The records the builder writes beside its kinds, a whole row at a time (#1369): a session each, after the kinds'. */\n    records?: readonly ScheduleEditingRecord[] | undefined;\n    /**\n     * Each kind's or record's rows as the builder's own reads hold them, by its slot or key (#1369): what a gesture\n     * finds an entry as before it, and what a Save confirms its entries by, before any is read by its key.\n     */\n    reads?: Readonly<Record<string, ScheduleRowRead>> | undefined;\n    /**\n     * Where the rows the builder draws now are kept, by kind or record ({@link ScheduleStandingRows}): what its person\n     * sees. A gesture's original is found there first, after the session's own version and what its last Save left\n     * (`EditSession.startOf`) — so a gesture begins from the row shown, and is taken at once while a record's rows are\n     * read again after a Save, or after another session's write, never refused for a read on its way (a Save never\n     * stops the editing). Never a Save's confirmation, which reads the revision it committed. A row drawn may have been\n     * read at the revision before: where another write changed the same part of it since, the source refuses the Save\n     * that sends it, and the session carries its drafts over at its own revision (`EditSession.nameConflicts`), the\n     * part both changed a conflict to choose. Read as a gesture is recorded, so rows moving make no new session.\n     */\n    standing?: RefObject<ScheduleStandingRows | undefined> | undefined;\n    /** The canvas's storage key: the sessions and their history are kept under it. */\n    storageKey: string;\n    /** Sessions made elsewhere that join the history, ahead of the kinds': `data`'s. */\n    joined: readonly EditHistoryJoined<ScheduleEntryRef>[];\n    /** The range the canvas reads its event kinds' rows over (#1199): a kind read a window at a time holds every event it draws there. */\n    range?: ScheduleRange | undefined;\n    /**\n     * The record Slices over the edited kinds' primary records, for confirmed Save feedback: each kind's is the one\n     * over its record (`sourceId`) — the Calendar's, its slice's part named after the kind (#1343).\n     */\n    recordSlices?: readonly ValueTypeOf<RecordSliceBindType>[] | undefined;\n    /**\n     * Where the rows each kind read by its cells holds are kept (#1039), by the kind's slot, then by the event's key's\n     * text: where a gesture, the inspector and a banner find one of its events, with no read of its own; one they do not\n     * hold is read by its key, never over the window. Read as each read runs, so new cells make no new kinds and draw\n     * nothing (#1594).\n     */\n    held?: RefObject<ScheduleHeldRows | undefined> | undefined;\n    /**\n     * The kinds whose events the builder reads apart from a Save's confirmation, by their slots: those a reader may read\n     * by their cells (#1424), whose cells stand at the revision they were read at until they are read again. What each\n     * Save lands of them is kept (`EditSession.landed`) and handed on ({@link ScheduleEditing.landed}) until the builder\n     * lets it go. None by default: a kind read over the window keeps its drafted read until the read again lands.\n     */\n    drawsLanded?: ReadonlySet<string> | undefined;\n    /**\n     * The kinds whose new events take another key where another Save took the one made for them (#1583), by their\n     * slots: two people who each make an event from one template, over a kind whose record their sessions hold whole,\n     * are given the same key ({@link ScheduleEditing.mint}), and the event made here goes on under another its session\n     * makes — both kept, nothing to choose. Only for a kind none of whose events anything else the builder drafts names by its key: under\n     * a new key, such a name would be left on the other session's event (keys.ts' `onceKeys`). None by default: the\n     * two are a conflict to choose between. Its builder moves on what it holds by the old key\n     * ({@link ScheduleEditing.renumbered}).\n     */\n    rekeys?: ReadonlySet<string> | undefined;\n    /**\n     * What a conflict at a kind's quantity, or at its split across resources, is called — the builder's own word for\n     * a quantity: the two change together, so the conflicts popover shows them as one card under it.\n     */\n    quantityLabel?: string | undefined;\n    /**\n     * The fields of a kind's form a changed row's numbers are held to the bounds of (#1585), by the kind's slot, from the\n     * row as its draft holds it — every bounded field of its form unless given: an Allocation's reservation holds no\n     * quantity until an arrival is booked into it, so none of its quantity's bounds are its own.\n     */\n    boundsOf?: Readonly<Record<string, (row: unknown) => readonly FieldSpecValue[]>> | undefined;\n    /**\n     * What the builder's author begins its Autosave at — its payload's `autosave`, which every builder hands on, so none\n     * leaves its author's word unread. Its viewer's own choice, once made, stands over it (east-ui-components'\n     * `useEditHistory`).\n     */\n    autosave: boolean;\n}\n\n/** An event kind or a record, as the history holds its session. */\ninterface EditedPart<I extends Item> {\n    /** The kind's slot, or the record's key. */\n    readonly key: string;\n    /** Its name. */\n    readonly name: string;\n    /** Its session's wire. */\n    readonly editing: ScheduleEditingKind<I>[\"editing\"];\n    /** Its record read by key, for one read a window at a time. */\n    readonly entries: ScheduleEditingKind<I>[\"entries\"];\n    /** The author's check over its drafts: a kind's. */\n    readonly ready: ScheduleEditingKind<I>[\"ready\"];\n    /** Its row's form: its numbers held to bounds (#1585). */\n    readonly fields: readonly FieldSpecValue[];\n    /** The event kind; `undefined` for a record a builder writes beside its kinds. */\n    readonly kind: ScheduleEditingKind<I> | undefined;\n    /** Its rows as its builder's own reads hold them. */\n    readonly read: ScheduleRowRead | undefined;\n    /** Whether its builder draws what a Save landed over the rows it read before the commit: a record's own say. */\n    readonly drawsLanded: boolean | undefined;\n    /** Whether a new event of its whose made key another Save took goes on under the next it makes ({@link ScheduleEditingArgs.rekeys}). */\n    readonly rekeys: boolean;\n}\n\n/** A kind's codecs, or a record's, read once per kind. */\ninterface KindCodecs {\n    readonly encodeRow: (row: unknown) => Uint8Array;\n    readonly decodeRow: (bytes: Uint8Array) => unknown;\n    readonly encodeDraft: (draft: unknown) => Uint8Array;\n    readonly sameDraft: (a: EntryVersion<ScheduleEntryRef> | undefined, b: EntryVersion<ScheduleEntryRef>) => boolean;\n    /** How a new key is made: a String key, an Integer key, or none. */\n    readonly keys: \"string\" | \"integer\" | undefined;\n    /** A key of the kind's type, by its text; `undefined` for text naming none. */\n    readonly keyOf: (id: string) => unknown;\n}\n\n/** A deleted entry's draft, as the seams read it. */\nconst MISSING = variant(\"missing\", null);\n/** Where an event stands in its record: in key order. */\nconst KEY_ORDER = some(variant(\"keyOrder\", null));\n/** An entry the gesture deletes. */\nconst DELETED: EntryVersion<ScheduleEntryRef> = { draft: undefined, wire: undefined, place: none };\n/** An entry a gesture makes under a new key: absent before it, read nowhere. */\nconst ABSENT: EntryVersion<ScheduleEntryRef> = { draft: undefined, wire: undefined, place: none };\n/** A gesture that writes no existing entry: a template's create. */\nconst NO_ENTRY = new Uint8Array(0);\n/** No range: a canvas with no time window reads a windowed kind's events by their keys alone. */\nconst NO_RANGE: ScheduleRange = { from: new Date(0), to: new Date(0) };\n/** No kind read a window at a time is keyed by Integer: no largest key is read. */\nconst NO_LAST: ReadonlyMap<string, option<option<string>>> = new Map();\n/** A builder that writes no record beside its kinds. */\nconst NO_RECORDS: readonly ScheduleEditingRecord[] = [];\n/** A record given no form. */\nconst NO_FIELDS: readonly FieldSpecValue[] = [];\n/** Nothing a Save landed is held. */\nconst NO_LANDED: ScheduleLanded = new Map();\n/** No carry-over gave a new event another key. */\nconst NO_RENUMBERED: ScheduleRenumbered = new Map();\n\nconst compareString = compareFor(StringType);\nconst stringEqual = equalFor(StringType);\nconst blobEqual = equalFor(BlobType);\nconst parseInteger = parseFor(IntegerType);\nexport const EMPTY_SCHEDULE_DRAFTS: ScheduleKindDraftsValue = new SortedMap([], compareString);\nconst NO_DRAFTS: ScheduleEventDraftsValue = new SortedMap([], compareString);\n\n/** An entry version's row: what its draft holds, when it holds one. */\nfunction rowOf(version: EntryVersion<ScheduleEntryRef>): unknown {\n    const draft = version.draft;\n    return isVariant(draft) && draft.type === \"value\" ? draft.value : undefined;\n}\n\n/** Two drafts hold the same bytes, kind by kind and entry by entry. */\nfunction sameDrafts(a: ScheduleEventDraftsValue, b: ScheduleEventDraftsValue): boolean {\n    if (a.size !== b.size) return false;\n    for (const [kind, entries] of b) {\n        const held = a.get(kind);\n        if (held === undefined || held.size !== entries.size) return false;\n        for (const [id, bytes] of entries) {\n            const was = held.get(id);\n            if (was === undefined || !blobEqual(was, bytes)) return false;\n        }\n    }\n    return true;\n}\n\n/**\n * The event kinds' sessions and the records' under one history with the\n * joined ones — see the module docs.\n *\n * @param args - The kinds, the records beside them, the canvas's storage key, the sessions that join, and the range the canvas reads\n * @returns The history, the kinds' and the records' sessions and drafts, how an event is read, and how a gesture is recorded\n */\nexport function useScheduleEditing<I extends Item = Item>({\n    kinds, records = NO_RECORDS, reads, standing, storageKey, joined, range, recordSlices, held: cellRows, drawsLanded, rekeys, quantityLabel, boundsOf, autosave,\n}: ScheduleEditingArgs<I>): ScheduleEditing<I> {\n    // The history, as the kinds' checks read their originals through it.\n    const historyRef = useRef<EditHistory<ScheduleEntryRef> | undefined>(undefined);\n    // Each windowed Integer kind's largest key as last read (below): what its session's rule for a new key reads as it\n    // makes one, so the read landing makes no new sessions.\n    const lastKeysRef = useRef<ReadonlyMap<string, option<option<string>>>>(NO_LAST);\n    // The latest fields each kind's rows are held to the bounds of (#1585): the checks read them as they run, so a builder's\n    // new ones make no new sessions.\n    const boundsRef = useRef(boundsOf);\n    boundsRef.current = boundsOf;\n    // Each kind, then each record: a session each, in that order.\n    const parts = useMemo((): EditedPart<I>[] => [\n        ...kinds.map((kind) => ({\n            key: kind.key, name: kind.name, editing: kind.editing, entries: kind.entries, ready: kind.ready, fields: kind.fields, kind, read: reads?.[kind.key],\n            drawsLanded: drawsLanded?.has(kind.key) === true ? true : undefined, rekeys: rekeys?.has(kind.key) === true,\n        })),\n        ...records.map((record) => ({ key: record.key, name: record.name, editing: record.editing, entries: record.entries, ready: record.ready ?? none,\n            fields: record.fields ?? NO_FIELDS, kind: undefined, read: reads?.[record.key], drawsLanded: record.drawsLanded, rekeys: false })),\n    ], [kinds, records, reads, drawsLanded, rekeys]);\n    const codecs = useMemo(() => parts.map((kind): KindCodecs => {\n        const entryType = fromEastTypeValue(kind.editing.entryType) as EastType;\n        const draftType = fromEastTypeValue(kind.editing.draftType) as EastType;\n        const keyType = kind.editing.keyType.type === \"some\" ? fromEastTypeValue(kind.editing.keyType.value) as EastType : undefined;\n        const draftEqual = equalFor(OptionType(draftType));\n        const optionOf = (version: EntryVersion<ScheduleEntryRef> | undefined) => (version?.draft === undefined ? none : some(version.draft));\n        const parseKey = keyType === undefined || keyType.type === \"String\" ? undefined : parseFor(keyType);\n        return {\n            encodeRow: encodeBeast2For(entryType) as (row: unknown) => Uint8Array,\n            decodeRow: decodeBeast2For(entryType) as (bytes: Uint8Array) => unknown,\n            encodeDraft: encodeBeast2For(draftType) as (draft: unknown) => Uint8Array,\n            sameDraft: (a, b) => draftEqual(optionOf(a) as never, optionOf(b) as never),\n            keys: keyType?.type === \"String\" ? \"string\" : keyType?.type === \"Integer\" ? \"integer\" : undefined,\n            keyOf: parseKey === undefined ? (id) => id : (id) => {\n                const read = parseKey(id);\n                return read.success ? read.value : undefined;\n            },\n        };\n    }), [parts]);\n    // Each kind's source and each record's: its closed editing; a kind's author's check over drafted events; and, for\n    // one read a window at a time (#1199), its record read by key — its revision the session's base, and an entry read\n    // by its key, decoded.\n    const sources = useMemo(() => parts.map((kind, i): EditHistorySource<ScheduleEntryRef> => {\n        const editing = kind.editing;\n        // The Slice over this kind's own record, if one narrows it: its Save notice counts what leaves it.\n        const prepare = prepareRecordSliceSave(recordSlices?.find(slice => stringEqual(slice.sourceId, editing.sourceId)),\n            kind.entries.type === \"some\" ? kind.entries.value.revision : undefined);\n        const check = kind.ready.type === \"some\" ? kind.ready.value : undefined;\n        const key = historyKeyOf(storageKey, editing);\n        const entryType = fromEastTypeValue(kind.editing.entryType) as EastType;\n        // An event's start and end read as one, its dates: a conflict at either is one card of the popover, settled with the\n        // fields that place it with them — a duty's shift and group, a bin's bay. So do a quantity and its split across\n        // resources, which change together.\n        const roles = kind.kind?.schedule;\n        const ranges = roles === undefined ? undefined\n            : [{ start: roles.start, end: roles.end, ...(roles.withTimes.length === 0 ? {} : { with: roles.withTimes }) }];\n        const together = roles !== undefined && roles.quantity.type === \"some\" && roles.parts.type === \"some\"\n            ? [{ lead: roles.quantity.value, with: [roles.parts.value], label: quantityLabel }] : undefined;\n        const originals = () => historyRef.current?.session(key)?.originals;\n        const app = check === undefined ? undefined : wholeEntryReadiness(check, originals, {\n            encode: encodeBeast2For(entryType) as (value: unknown) => Uint8Array,\n            equal: equalFor(entryType) as (a: unknown, b: unknown) => boolean,\n        });\n        // A changed row's number outside its field's bounds holds Save as the app's check does, naming the row and the\n        // field (#1585) — the form's own check and words, over the fields its builder holds the row to.\n        const bounded = kind.fields.filter(isBounded);\n        const heldTo = (held: unknown) => (held === undefined ? undefined : boundsRef.current?.[kind.key]?.(held)) ?? bounded;\n        const ready = bounded.length === 0 ? app : boundedReadiness(fromEastTypeValue(kind.editing.draftType) as EastType,\n            (id, held) => fieldBreaches(heldTo(held), held).map((breach) => breachIssue(breach, id)), originals, app);\n        // How its new entries are keyed (#1583, east-ui-components' `keys.ts`): its session makes each key, and holds it as\n        // its own until the entry is saved. A text key is made from the key its entry is made from — a template's, a\n        // copied event's — else made up: the next in a row (`brackets-2`) where the session holds the record whole, and\n        // with a suffix drawn at random where it is read a window at a time — there the session cannot know which of a\n        // row's keys are taken, and the next in a row is, as often as not, an earlier copy's out of view. An Integer key\n        // is one past the largest, the record's own largest read by its key order where it is read a window at a time;\n        // a key of another type is given none here. A kind given `rekeys` has it made another where another Save took\n        // it; any other part keeps the key, the two a conflict.\n        const windowed = kind.entries.type === \"some\";\n        const rule: EntryKeys | undefined = codecs[i]!.keys === \"string\" ? (windowed ? drawnFromKeys(randomKeys()) : madeFromKeys(randomKeys()))\n            : codecs[i]!.keys !== \"integer\" ? undefined\n                : nextIntegerKeys(!windowed ? undefined : () => {\n                    const last = lastKeysRef.current.get(kind.key);\n                    if (last === undefined || last.type !== \"some\") return undefined;\n                    if (last.value.type !== \"some\") return { key: undefined };\n                    const read = parseInteger(last.value.value);\n                    return read.success ? { key: read.value } : undefined;\n                });\n        const once = rule === undefined || kind.rekeys ? rule : onceKeys(rule);\n        // Read a window at a time, its session knows none of its record's keys but those it has met: each key is made\n        // past those its builder shows a row under — what it draws, what its own reads and its cells hold — so a new row\n        // is never drawn over one on the page. One the record holds out of view is refused at Save, and made another.\n        const shows = (id: string): boolean => {\n            if (standing?.current?.[kind.key]?.(id) !== undefined) return true;\n            const own = kind.read?.(id);\n            if (own !== undefined && own.type === \"some\" && own.value.type === \"some\") return true;\n            const held = heldRowOf(cellRows?.current, kind.key, id);\n            return held.type === \"some\" && held.value.type === \"some\";\n        };\n        const made = once === undefined || !windowed ? once : pastKeys(once, shows);\n        // An entry's projection is its id: under another key, that key's.\n        const underKey = (id: string, entry: EntryVersion<ScheduleEntryRef>): EntryVersion<ScheduleEntryRef> => ({ ...entry, wire: { id } });\n        if (!windowed) return { editing, ready, prepare, wireType: EntryRefType, ranges, together, keys: made, underKey };\n        const seam = kind.entries.value;\n        const { decodeRow, keyOf } = codecs[i]!;\n        const own = kind.read;\n        // Where the builder's own reads hold an entry, at the revision every read of the record is pinned to: read with no\n        // request, so a Save's confirmation judges every one of them at once.\n        const heldRow = own === undefined ? undefined : (id: string): option<option<unknown>> | undefined => {\n            const held = own(id);\n            if (held === undefined) return undefined;\n            return held.type !== \"some\" ? none : some(held.value.type === \"some\" ? some(decodeRow(held.value.value)) : none);\n        };\n        const paged: EditHistoryPaged = {\n            revision: () => seam.revision(),\n            refresh: (revision) => seam.refresh(revision),\n            held: heldRow,\n            entry: (id) => {\n                // Where the builder's own reads hold it; else by its key.\n                const held = heldRow?.(id);\n                if (held !== undefined) return held;\n                // A text no key prints as — a new row's placeholder, its key still to be typed (#1549) — names no row the\n                // record holds: never sought, so a source moving under it carries it over.\n                if (keyOf(id) === undefined) return some(none);\n                const read = seam.entry(id);\n                if (read.type !== \"some\") return none;\n                return read.value.type === \"some\" ? some(some(decodeRow(read.value.value))) : some(none);\n            },\n            // Every entry a Save wrote, in one read of the record's own rows (#1596).\n            entriesAll: kind.editing.keyType.type === \"some\" ? entriesByKeyOf(seam.paged, fromEastTypeValue(kind.editing.keyType.value) as EastType, entryType) : undefined,\n            // Whether the workspace has read the record since its last write from here was answered: a Save's answer\n            // that comes after the record's pages have moved on never puts them back at the revision it names (#1599).\n            followed: readSinceAnswerOf(seam.paged),\n        };\n        return { editing, ready, paged, prepare, wireType: EntryRefType, ranges, together, drawsLanded: kind.drawsLanded, keys: made, underKey };\n    }), [parts, codecs, storageKey, recordSlices, quantityLabel, standing, cellRows]);\n    const historyOptions = useMemo(() => ({ autosave }), [autosave]);\n    const state = useEditHistory<ScheduleEntryRef>(sources, storageKey, joined, historyOptions);\n    historyRef.current = state.history;\n    const { history, keys, version } = state;\n    const indexOf = useCallback((kind: string) => parts.findIndex((k) => stringEqual(k.key, kind)), [parts]);\n    // The latest range the canvas reads (#1199): where a gesture's event is read.\n    const rangeRef = useRef(range);\n    rangeRef.current = range;\n    // A kind read a window at a time keyed by Integer: its record's largest key, read by its key order and kept current\n    // (tracked), so a gesture makes a new key at once (#1199).\n    const readLast = useCallback(() => {\n        const out = new Map<string, option<option<string>>>();\n        parts.forEach((kind, i) => {\n            if (kind.entries.type === \"some\" && codecs[i]!.keys === \"integer\") out.set(kind.key, kind.entries.value.last());\n        });\n        return out;\n    }, [parts, codecs]);\n    const { result: lastRead } = useTrackedEvaluation(readLast);\n    const lastKeys = useMemo(() => {\n        if (lastRead.ok) return lastRead.value;\n        console.error(\"[Schedule] an event kind's largest key could not be read:\", lastRead.error);\n        return NO_LAST;\n    }, [lastRead]);\n    lastKeysRef.current = lastKeys;\n    const sessions = useMemo(() => parts.flatMap((kind, i): ScheduleKindSession[] => {\n        const session = history.session(keys[i]!);\n        return session === undefined ? [] : [{ kind: kind.key, key: keys[i]!, session, fields: kind.fields }];\n        // The history holds the kinds' sessions once it is synced: its version says so.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }), [parts, keys, history, version]);\n\n    // ── The drafts, as the seams read them ─────────────────────────────────\n    const fresh = useMemo(() => {\n        const out = new SortedMap<string, ScheduleKindDraftsValue>([], compareString);\n        parts.forEach((kind, i) => {\n            const session = history.session(keys[i]!);\n            const codec = codecs[i]!;\n            if (session === undefined) return;\n            const byId = new SortedMap<string, Uint8Array>([], compareString);\n            for (const [id, entry] of session.entries) {\n                if (codec.sameDraft(session.originals.get(id), entry)) continue;\n                byId.set(id, codec.encodeDraft(entry.draft === undefined ? MISSING : entry.draft));\n            }\n            if (byId.size > 0) out.set(kind.key, byId);\n        });\n        return out as ScheduleEventDraftsValue;\n        // The sessions' maps are mutable: the history's version records each change.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [parts, codecs, keys, history, version]);\n    // Held while the bytes hold: a status change moves the version, not the drafts.\n    const heldDrafts = useRef<{ drafts: ScheduleEventDraftsValue; version: number }>({ drafts: NO_DRAFTS, version: 0 });\n    const drafts = useMemo(() => {\n        const previous = heldDrafts.current;\n        if (sameDrafts(previous.drafts, fresh)) return previous;\n        heldDrafts.current = { drafts: fresh, version: previous.version + 1 };\n        return heldDrafts.current;\n    }, [fresh]);\n\n    // ── What Saves landed, as a reader of a kind's cells draws it ─────────────\n    // Each kind given `drawsLanded`: its session's landed events, each encoded once — a session keeps a landed entry the\n    // same object until it lets it go — and the revision each one's Save was drafted at.\n    const heldLanded = useRef<{ landed: ScheduleLanded; readonly encoded: WeakMap<LandedEntry<ScheduleEntryRef>, ScheduleLandedRow> }>(\n        { landed: NO_LANDED, encoded: new WeakMap() });\n    const landed = useMemo((): ScheduleLanded => {\n        const was = heldLanded.current;\n        const out = new Map<string, ScheduleLandedRows>();\n        let moved = false;\n        parts.forEach((part, i) => {\n            if (part.kind === undefined || part.drawsLanded !== true) return;\n            const entries = history.session(keys[i]!)?.landed;\n            if (entries === undefined || entries.size === 0) return;\n            const codec = codecs[i]!;\n            const before = was.landed.get(part.key);\n            const rows = new Map<string, ScheduleLandedRow>();\n            const from = new Set<string | undefined>();\n            let same = before !== undefined && before.rows.size === entries.size;\n            for (const [id, entry] of entries) {\n                let row = was.encoded.get(entry);\n                if (row === undefined) {\n                    // A deleted event is none, its draft `missing`, as a draft deleting it is.\n                    const saved = rowOf(entry.after);\n                    row = { draft: codec.encodeDraft(entry.after.draft === undefined ? MISSING : entry.after.draft), row: saved === undefined ? undefined : codec.encodeRow(saved) };\n                    was.encoded.set(entry, row);\n                }\n                if (before?.rows.get(id) !== row) same = false;\n                rows.set(id, row);\n                from.add(entry.from);\n            }\n            // The same events, each the same entry's: drafted at the same revisions, an entry keeping its own.\n            if (same && before !== undefined) { out.set(part.key, before); return; }\n            out.set(part.key, { rows, from });\n            moved = true;\n        });\n        // Every kind as it was: the same object, so what reads it holds still while gestures move the history.\n        if (!moved && out.size === was.landed.size) return was.landed;\n        was.landed = out.size === 0 ? NO_LANDED : out;\n        return was.landed;\n        // The sessions' maps are mutable: the history's version records each change.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [parts, codecs, keys, history, version]);\n\n    // ── The new events a carry-over gave another key ─────────────────────────\n    // Each kind's session says them once, a new map at each carry-over: handed on as one object, the same until one moves.\n    const heldRenumbered = useRef<ScheduleRenumbered>(NO_RENUMBERED);\n    const renumbered = useMemo((): ScheduleRenumbered => {\n        const was = heldRenumbered.current;\n        const out = new Map<string, ReadonlyMap<string, string>>();\n        parts.forEach((part, i) => {\n            const moved = history.session(keys[i]!)?.renumbered;\n            if (moved !== undefined && moved.size > 0) out.set(part.key, moved);\n        });\n        if (out.size === was.size && [...out].every(([kind, moved]) => was.get(kind) === moved)) return was;\n        heldRenumbered.current = out.size === 0 ? NO_RENUMBERED : out;\n        return heldRenumbered.current;\n        // The sessions are mutable: the history's version records each carry-over.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [parts, keys, history, version]);\n\n    // ── The gestures ─────────────────────────────────────────────────────────\n    /**\n     * An entry as its builder shows it, for a kind or a record read a window at a time (#1199) whose session holds none\n     * of it — what a gesture on it begins from, after the session's own version and what its last Save left\n     * (`EditSession.startOf`, ruled 11 Nov 2026: an edit starts from the row its person is looking at). Absent for one\n     * a gesture makes under a new key — a template's create, a duplicate, a new row. Else the row as the builder draws\n     * it now (`standing`), at whatever revision it was read: while its rows are read again — after a Save, or another\n     * session's write — a gesture on what the page shows is taken at once, never refused for a read on its way. Else,\n     * for a row the builder draws none of, the record's row where its builder's own reads hold it (`reads`), a kind's\n     * read where the canvas holds it (`read`, with no drafts: the session holds none for it), or a record's by its key —\n     * absent for a key the record does not hold, which a gesture writes a new row under.\n     *\n     * @returns The version; `undefined` while its read is in flight and the builder draws none of it, or for an event the record no longer holds\n     */\n    const originalOf = (part: EditedPart<I>, change: ScheduleChange): EntryVersion<ScheduleEntryRef> | undefined => {\n        if ((\"gesture\" in change && change.gesture.type === \"create\") || (\"row\" in change && change.created === true)) return ABSENT;\n        const codec = codecs[indexOf(part.key)]!;\n        // The row as the builder draws it now, where it draws one: what its person sees and acts on.\n        const drawn = standing?.current?.[part.key]?.(change.id);\n        if (drawn !== undefined) return { draft: variant(\"value\", codec.decodeRow(drawn)), wire: undefined, place: KEY_ORDER };\n        // Where the builder's own reads hold it: in flight, absent, or its row.\n        const held = part.read?.(change.id);\n        if (held !== undefined) {\n            if (held.type !== \"some\") return undefined;\n            return held.value.type === \"some\" ? { draft: variant(\"value\", codec.decodeRow(held.value.value)), wire: undefined, place: KEY_ORDER } : ABSENT;\n        }\n        const kind = part.kind;\n        if (kind === undefined) {\n            if (part.entries.type !== \"some\") return undefined;\n            // A text no key prints as names no row the record holds (#1549): a placeholder, never sought.\n            if (codec.keyOf(change.id) === undefined) return ABSENT;\n            let row: option<option<Uint8Array>>;\n            try {\n                row = part.entries.value.entry(change.id);\n            } catch (err) {\n                console.error(`[Schedule] ${part.name}'s row ${change.id} could not be read:`, err);\n                return undefined;\n            }\n            if (row.type !== \"some\") return undefined;\n            return row.value.type === \"some\" ? { draft: variant(\"value\", codec.decodeRow(row.value.value)), wire: undefined, place: KEY_ORDER } : ABSENT;\n        }\n        const at = rangeRef.current ?? NO_RANGE;\n        let got: ReturnType<ScheduleEditingKind<I>[\"event\"]>;\n        try {\n            got = kind.event(change.id, EMPTY_SCHEDULE_DRAFTS, at.from, at.to, heldRowOf(cellRows?.current, kind.key, change.id));\n        } catch (err) {\n            console.error(`[Schedule] ${kind.name}'s event ${change.id} could not be read:`, err);\n            return undefined;\n        }\n        if (got.type !== \"some\") return undefined;\n        return { draft: variant(\"value\", codec.decodeRow(got.value.row)), wire: undefined, place: KEY_ORDER };\n    };\n    /** An event's row as its kind's record held it when last read, or a row of a record a builder writes ({@link ScheduleEditing.held}). */\n    const heldRow = (kind: string, id: string): unknown => {\n        const i = indexOf(kind);\n        if (i < 0) return undefined;\n        // A kind read a window at a time holds no snapshot (#1199): an event its session holds was read before\n        // its first gesture, and one it does not hold stands as the record holds it.\n        if (parts[i]!.entries.type === \"some\") {\n            const original = history.session(keys[i]!)?.originals.get(id);\n            return original === undefined ? undefined : rowOf(original);\n        }\n        const at = codecs[i]!.keyOf(id);\n        return at === undefined ? undefined : state.held(keys[i]!)?.get(at);\n    };\n    const api = {\n        shown(kind: string, ids: Iterable<string>): void {\n            const i = indexOf(kind);\n            if (i >= 0) history.session(keys[i]!)?.shown(ids);\n        },\n        draftsOf(kind: string): ScheduleKindDraftsValue {\n            return drafts.drafts.get(kind) ?? EMPTY_SCHEDULE_DRAFTS;\n        },\n        available(kind: string): boolean {\n            const i = indexOf(kind);\n            return i >= 0 && state.available(keys[i]!);\n        },\n        carrying(kind: string): boolean {\n            const i = indexOf(kind);\n            const session = i < 0 ? undefined : history.session(keys[i]!);\n            if (session === undefined) return false;\n            if (session.carrying) return true;\n            // At another revision than its record reads at, no request of its own out: told of it only after this render.\n            // A session whose Save is out reads its own commit back, and carries nothing over meanwhile.\n            const seam = parts[i]!.entries;\n            if (seam.type !== \"some\" || session.locked) return false;\n            const base = session.drafts.revision;\n            const now = seam.value.revision();\n            return base !== undefined && now.type === \"some\" && !stringEqual(base, now.value);\n        },\n        conflicted(kind: string, id: string): boolean {\n            const i = indexOf(kind);\n            return i >= 0 && history.session(keys[i]!)?.conflicts.has(id) === true;\n        },\n        held(kind: string, id: string): unknown {\n            return heldRow(kind, id);\n        },\n        heldEvent(kind: string, id: string): ScheduleRead<I> | undefined {\n            const i = indexOf(kind);\n            const event = i < 0 ? undefined : parts[i]!.kind;\n            if (event === undefined) return undefined;\n            const row = heldRow(kind, id);\n            if (row === undefined) return undefined;\n            const at = rangeRef.current ?? NO_RANGE;\n            // The row as the one draft in place: the kind reads its event from a draft before anything else, so it reads\n            // nothing of the record — nor the event's other drafts, which removed it.\n            const alone = new SortedMap<string, Uint8Array>([[id, codecs[i]!.encodeDraft(variant(\"value\", row))]], compareString);\n            const got = event.event(id, alone, at.from, at.to, heldRowOf(cellRows?.current, kind, id));\n            return got.type === \"some\" ? got.value : undefined;\n        },\n        read(kind: string, id: string): ScheduleRead<I> | undefined {\n            const i = indexOf(kind);\n            const event = i < 0 ? undefined : parts[i]!.kind;\n            // A record beside the kinds holds rows, not events: its builder reads them itself.\n            if (event === undefined) return undefined;\n            const at = rangeRef.current ?? NO_RANGE;\n            // Where the builder's own reads hold its row — a page of the Calendar's Backlog (#1424) — from them, read no more.\n            const own = parts[i]!.read?.(id);\n            const held = own !== undefined && own.type === \"some\" && own.value.type === \"some\" ? some(own.value) : heldRowOf(cellRows?.current, kind, id);\n            const got = event.event(id, drafts.drafts.get(kind) ?? EMPTY_SCHEDULE_DRAFTS, at.from, at.to, held);\n            return got.type === \"some\" ? got.value : undefined;\n        },\n        mint(kind: string, from: string, minted: ReadonlySet<string>): string | undefined {\n            const i = indexOf(kind);\n            // Its session's to make (#1583): by the kind's rule, past every key its drafts and its record are known to\n            // hold and `minted` holds — none until the history holds the session.\n            return i < 0 ? undefined : history.session(keys[i]!)?.mint(from === \"\" ? undefined : from, minted);\n        },\n        record(changes: readonly ScheduleChange[], origin: Origin, label: string): boolean {\n            // Each kind's events and each record's rows the gesture changes: as it found them, and as it leaves them.\n            const touched = new Map<string, Map<string, { before: EntryVersion<ScheduleEntryRef>; after: EntryVersion<ScheduleEntryRef> }>>();\n            for (const change of changes) {\n                const i = indexOf(change.kind);\n                if (i < 0) return false;\n                const part = parts[i]!;\n                const key = keys[i]!;\n                const codec = codecs[i]!;\n                if (!state.available(key)) return false;\n                let entries = touched.get(key);\n                if (entries === undefined) { entries = new Map(); touched.set(key, entries); }\n                const at = entries.get(change.id);\n                const before = at?.before ?? state.original(key, change.id) ?? originalOf(part, change);\n                // An entry read a window at a time whose read is in flight: the gesture waits for none of it.\n                if (before === undefined) return false;\n                // A new row is begun from none. Under a key a row stands under — its session's own, one its last Save\n                // landed, its record's as last read — it would begin from that row and be saved over it: nothing of the\n                // gesture is recorded. Its session makes no such key (`EditSession.mint`); this holds whoever made it.\n                const creates = (\"gesture\" in change && change.gesture.type === \"create\") || (\"row\" in change && change.created === true);\n                if (creates && at === undefined && before.draft !== undefined) return false;\n                const now = at?.after ?? before;\n                let row: unknown;\n                if (\"remove\" in change) {\n                    entries.set(change.id, { before, after: DELETED });\n                    continue;\n                } else if (\"row\" in change) {\n                    row = codec.decodeRow(change.row);\n                } else if (\"rewrite\" in change) {\n                    // The row as the gesture finds it, rewritten whole; where it finds none, the row the change makes in\n                    // its place, made only then. One it finds none of and is given none for, or a rewrite that refuses,\n                    // records nothing of the gesture.\n                    const current = rowOf(now);\n                    if (current === undefined) {\n                        const made = change.absent?.();\n                        if (made === undefined) return false;\n                        row = codec.decodeRow(made);\n                    } else {\n                        let rewritten: Uint8Array | undefined;\n                        try {\n                            rewritten = change.rewrite(codec.encodeRow(current));\n                        } catch (err) {\n                            console.error(`[Schedule] ${part.name}'s rewrite of ${change.id} failed:`, err);\n                            return false;\n                        }\n                        if (rewritten === undefined) return false;\n                        row = codec.decodeRow(rewritten);\n                    }\n                } else {\n                    // The kind's own write of the gesture into the entry as it stands; a create writes none. A record's\n                    // row is given whole: it has no gestures of its own.\n                    const kind = part.kind;\n                    if (kind === undefined) {\n                        console.error(`[Schedule] ${part.name} takes its rows whole: a gesture writes none of them`);\n                        continue;\n                    }\n                    const current = rowOf(now);\n                    if (current === undefined && change.gesture.type !== \"create\") continue;\n                    let written: ReturnType<ScheduleEditingKind<I>[\"write\"]>[number] | undefined;\n                    try {\n                        written = kind.write([{ id: change.id, entry: current === undefined ? NO_ENTRY : codec.encodeRow(current), gesture: change.gesture }])[0];\n                    } catch (err) {\n                        console.error(`[Schedule] ${kind.name}'s write of a gesture failed:`, err);\n                        continue;\n                    }\n                    // A gesture the kind refuses leaves the entry as it was.\n                    if (written === undefined || written.type !== \"some\") continue;\n                    row = codec.decodeRow(written.value);\n                }\n                entries.set(change.id, { before, after: { draft: variant(\"value\", row), wire: { id: change.id }, place: KEY_ORDER } });\n            }\n            const recorded: EditHistoryPart<ScheduleEntryRef>[] = [...touched]\n                .map(([key, entries]) => ({ key, updates: [...entries].map(([id, versions]) => ({ id, ...versions })) }))\n                .filter((part) => part.updates.length > 0);\n            return recorded.length > 0 && history.record(recorded, origin, label);\n        },\n    };\n    // Stable to the canvas and the inspector: each runs the latest render's.\n    const latest = useRef(api);\n    latest.current = api;\n    const shown = useCallback((kind: string, ids: Iterable<string>) => latest.current.shown(kind, ids), []);\n    const draftsOf = useCallback((kind: string) => latest.current.draftsOf(kind), []);\n    const available = useCallback((kind: string) => latest.current.available(kind), []);\n    const carrying = useCallback((kind: string) => latest.current.carrying(kind), []);\n    const conflicted = useCallback((kind: string, id: string) => latest.current.conflicted(kind, id), []);\n    const held = useCallback((kind: string, id: string) => latest.current.held(kind, id), []);\n    const heldEvent = useCallback((kind: string, id: string) => latest.current.heldEvent(kind, id), []);\n    const read = useCallback((kind: string, id: string) => latest.current.read(kind, id), []);\n    const mint = useCallback((kind: string, from: string, minted: ReadonlySet<string>) => latest.current.mint(kind, from, minted), []);\n    const record = useCallback((changes: readonly ScheduleChange[], origin: Origin, label: string) => latest.current.record(changes, origin, label), []);\n\n    return useMemo(() => ({\n        history, sessions, drafts: drafts.drafts, draftsVersion: drafts.version, landed, renumbered, version,\n        shown, draftsOf, available, carrying, conflicted, held, heldEvent, read, mint, record,\n    }), [history, sessions, drafts, landed, renumbered, version, shown, draftsOf, available, carrying, conflicted, held, heldEvent, read, mint, record]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The field an issue gone to asks for: the warning button's first issue, or a\n * refusal pressed in the Issues tab, selects its entry — and the field its\n * refusal names, ringed in the entry's form, takes the keyboard as the form\n * draws it, which brings it into view in its pane, as the Record's issue gone\n * to does. A builder holds its asks ({@link useFieldAsks}) and provides them\n * ({@link FieldAskProvider}); an entry's form reads the field asked of it\n * ({@link useFieldAsk}) for its `FieldForm`'s `focus`, and answers the ask —\n * the pane it is drawn in opening where it is collapsed, as its rail opens it,\n * at the tab it is drawn in, as its tab opens it, so the field shows (#1585) —\n * in a phone's drawer without taking the keyboard, the field left to a tap, so\n * no keyboard rises over the drawer unasked. An entry's form drawn anew while\n * another's ask stands drops it: the viewer moved on before it was drawn. A\n * form whose row is still read, its fields placeholders the keyboard can't\n * land in, opens its pane and tab at once and answers the ask as its row\n * lands, the field taking the keyboard then.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from \"react\";\nimport { StringType, equalFor, type option } from \"@elaraai/east\";\nimport { DockTab, FrameDrawer, FramePane } from \"@elaraai/east-ui-components/internal\";\n\n/** An ask for the keyboard in one field of an entry's form. */\nexport interface FieldAsk {\n    /** The entry's kind: its slot, or its record's key — whose session refuses it. */\n    readonly kind: string;\n    /** The entry's key. */\n    readonly entry: string;\n    /** The field, by its form's key. */\n    readonly field: string;\n    /** Which ask it is: each later than the one before. */\n    readonly seq: number;\n}\n\n/** What an entry's form reads of its builder's asks. */\nexport interface FieldAsks {\n    /** The ask standing, until a form answers it. */\n    readonly ask: FieldAsk | undefined;\n    /** Says a form answered an ask: its entry's, or another's drawn anew. */\n    readonly answered: (seq: number) => void;\n}\n\nconst NO_ASKS: FieldAsks = { ask: undefined, answered: () => undefined };\nconst FieldAskContext = createContext<FieldAsks>(NO_ASKS);\n\n/** Provides a builder's asks to its entries' forms: the `asks` {@link useFieldAsks} gives. */\nexport const FieldAskProvider = FieldAskContext.Provider;\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * A builder's asks: the one standing, for its {@link FieldAskProvider}, and how an issue gone to asks.\n *\n * @returns The asks, and `request`: an issue gone to on its entry, asking for the field it names — an issue naming none\n * drops any ask standing\n */\nexport function useFieldAsks(): { readonly asks: FieldAsks; readonly request: (kind: string, entry: string, field: option<string>) => void } {\n    const [ask, setAsk] = useState<FieldAsk>();\n    const last = useRef(0);\n    const answered = useCallback((seq: number) => setAsk((was) => (was !== undefined && was.seq === seq ? undefined : was)), []);\n    const request = useCallback((kind: string, entry: string, field: option<string>) => {\n        last.current += 1;\n        setAsk(field.type === \"some\" ? { kind, entry, field: field.value, seq: last.current } : undefined);\n    }, []);\n    const asks = useMemo(() => ({ ask, answered }), [ask, answered]);\n    return { asks, request };\n}\n\n/**\n * The field an issue gone to asks of an entry's form, for its `FieldForm`'s `focus` (see the module docs).\n *\n * @param kind - The entry's kind: its slot, or its record's key\n * @param entry - The entry's key\n * @param drawn - Whether the form is drawn with its row: `false` while the row is read, its fields placeholders — the\n *   ask waits for it, and so does dropping another entry's\n * @returns The field, by its form's key, while its ask stands and the form is drawn — never in a phone's drawer\n */\nexport function useFieldAsk(kind: string, entry: string, drawn = true): string | undefined {\n    const { ask, answered } = useContext(FieldAskContext);\n    const phone = useContext(FrameDrawer);\n    const pane = useContext(FramePane);\n    const tab = useContext(DockTab);\n    const mine = ask !== undefined && stringEqual(ask.kind, kind) && stringEqual(ask.entry, entry) ? ask : undefined;\n    // Drawn anew while another entry's ask stands: the viewer moved on before that entry was drawn.\n    const fresh = useRef(true);\n    // The ask whose pane and tab it opened: once, so the row landing after never pulls the viewer back to it.\n    const opened = useRef<number | undefined>(undefined);\n    useEffect(() => {\n        if (mine !== undefined) {\n            // Collapsed, or behind another tab, the pane would leave the issue gone to nowhere: it opens as its rail opens\n            // it, at the form's tab, and the field shows — at once, though its row is still read.\n            if (opened.current !== mine.seq) {\n                opened.current = mine.seq;\n                pane?.open();\n                tab?.open();\n            }\n            if (drawn) answered(mine.seq);\n        }\n        else if (fresh.current && drawn && ask !== undefined) answered(ask.seq);\n        if (drawn) fresh.current = false;\n    }, [ask, mine, answered, pane, tab, drawn]);\n    return phone || mine === undefined || !drawn ? undefined : mine.field;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A read per source of a builder's rail, each in a component of its own, in\n * order — the one chain every builder reads its sources by: what each source\n * a builder's tabs follow shows (`follow-sources.tsx`), and each source's\n * hidden pick (`hidden-pick.tsx`' `HideSources`), the Calendar's event and\n * resource kinds' and the Schematic's kinds'. A read is a hook, and the hooks\n * of a component run in one order: a component a source keeps each source's\n * in order, whatever the number of sources a payload names. What renders with\n * them renders again only as a read is another value: a source whose read\n * holds renders nothing under it.\n *\n * @packageDocumentation\n */\n\nimport { useMemo, type ReactNode } from \"react\";\n\n/** Props of {@link EachSource}. */\nexport interface EachSourceProps<S, C, R> {\n    /** The sources, in order: one component reads each. */\n    readonly sources: readonly S[];\n    /** What every source's read is given beside its source: the builder's own. */\n    readonly context: C;\n    /**\n     * A source's read: a hook, called in the source's own component, the same function for every source and every render\n     * — what it returns stands for the source until it returns another value.\n     */\n    readonly read: (source: S, context: C) => R;\n    /** What renders once every source is read: each source's read, in the sources' order. */\n    readonly children: (read: readonly R[]) => ReactNode;\n}\n\n/** A step of the chain: the source at `at`, and the reads of those before it. */\ninterface ReadAtProps<S, C, R> extends EachSourceProps<S, C, R> {\n    readonly at: number;\n    readonly done: readonly R[];\n}\n\n/** No source read yet. */\nconst NOTHING_READ: readonly never[] = [];\n\n/**\n * Reads each source in a component of its own, in order, and renders `children` with what each read — see the module\n * docs.\n *\n * @param props - The sources, the context their reads are given, the read, and what renders with them\n * @returns What `children` renders\n */\nexport function EachSource<S, C, R>(props: EachSourceProps<S, C, R>): ReactNode {\n    return <ReadAt {...props} at={0} done={NOTHING_READ} />;\n}\n\n/** The source at `at`, or — every source read — what `children` renders. */\nfunction ReadAt<S, C, R>(props: ReadAtProps<S, C, R>): ReactNode {\n    return props.at < props.sources.length ? <ReadOne {...props} /> : <Read done={props.done} render={props.children} />;\n}\n\n/** Reads one source, then the ones after it. */\nfunction ReadOne<S, C, R>(props: ReadAtProps<S, C, R>): ReactNode {\n    const { sources, context, read, at, done } = props;\n    // The source's read, in this component alone: its hooks keep their order whatever the other sources.\n    const one = read(sources[at]!, context);\n    const next = useMemo(() => [...done, one], [done, one]);\n    return <ReadAt {...props} at={at + 1} done={next} />;\n}\n\n/** Every source read: what `render` renders with their reads — the same element while they and `render` hold. */\nfunction Read<R>({ done, render }: { done: readonly R[]; render: (read: readonly R[]) => ReactNode }): ReactNode {\n    return useMemo(() => <>{render(done)}</>, [render, done]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Which rows a builder shows, by key, apart from the rows it calculates over\n * (the Roster's people, the Allocation's resources): a Set of keys, or a\n * record Slice's narrowed rows read through their paged source. It keeps the\n * previous complete membership while a new narrowing resolves, and never\n * touches an editing session. A builder bound to `Slice.bindRecords` reads\n * each source through {@link useSourceVisibility}, so each source narrows\n * every place its rows appear — the board, its Choosers and its Library's\n * tabs alike (#1339).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { SortedSet, StringType, compareFor, none, some, type ArrayType, type option, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RowSourceType } from \"@elaraai/east-ui\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { useSliceReactivity, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { PagedScan, snapshotOf } from \"@elaraai/east-ui-components/internal\";\n\nconst compareString = compareFor(StringType);\nconst PAGE = 256n;\nconst EMPTY = some(new SortedSet<string>([], compareString));\n\n/** What a builder's payload says about which rows show. */\nexport interface KeyVisibilityInput {\n    /** The narrowed rows' keys, paged through a record Slice; `none` with no record Slice. */\n    visibleSource: option<ValueTypeOf<RowSourceType<ArrayType<StringType>>>> | undefined;\n    /** The keys to show when no record Slice narrows: a Set, or `none` for every row. */\n    visible: option<Set<string>>;\n    /** Every row, in its order: what shows when nothing narrows. */\n    rows: readonly { key: string }[];\n    /** The record Slice chrome, whose Retry a failed narrowing offers. */\n    recordSlice: option<{ slice: { retry: () => void } }> | undefined;\n}\n\n/** The words a failed narrowing says. */\nexport interface KeyVisibilityWords {\n    /** The results moved while they were read (`Staff results changed; retry the narrowing.`). */\n    changed: string;\n    /** The results could not be read (`Could not load staff results`). */\n    failed: string;\n}\n\n/** Which rows show, and the narrowing's state. */\nexport interface KeyVisibility {\n    /** The keys to show: `none` for every row. */\n    keys: option<Set<string>>;\n    /** Whether a complete membership has resolved yet. */\n    ready: boolean;\n    /** Whether a new narrowing is resolving (the previous membership still shows). */\n    loading: boolean;\n    /** Why the narrowing could not be read. */\n    error: string | undefined;\n    /** Read the narrowing again. */\n    retry: () => void;\n}\n\n/**\n * Which rows show (see the module docs).\n *\n * @param value - What the payload says about which rows show\n * @param words - What a failed narrowing says\n * @returns The keys to show, and the narrowing's state\n */\nexport function useKeyVisibility(value: KeyVisibilityInput, words: KeyVisibilityWords): KeyVisibility {\n    const source = value.visibleSource?.type === \"some\" ? value.visibleSource.value : undefined;\n    // A pinned source's keys belong to its revision, a live one's — a rail's narrowed source — to its narrowing too.\n    const snapshotted = source?.type === \"pinned\" || source?.type === \"live\" ? source.value : undefined;\n    const scan = useMemo(() => snapshotted !== undefined ? new PagedScan<string, Set<string>>(\n        () => new SortedSet<string>([], compareString),\n        (keys, page) => { for (const key of page) keys.add(key); },\n    ) : undefined, [snapshotted]);\n    const read = useCallback((): option<Set<string>> => {\n        if (source === undefined) return some(value.visible.type === \"some\" ? value.visible.value : new SortedSet(value.rows.map(row => row.key), compareString));\n        if (source.type === \"inline\") return some(new SortedSet(source.value, compareString));\n        // The scan starts again when the snapshot moves — a write, or a choice (#1354) — whatever the count.\n        if (snapshotted !== undefined && scan !== undefined) return scan.read(() => snapshotOf(snapshotted) ?? none, snapshotted.total, snapshotted.page);\n        const handle = source.value;\n        const count = handle.total();\n        if (count.type === \"none\") return none;\n        const keys = new SortedSet<string>([], compareString);\n        for (let offset = 0n; offset < count.value;) {\n            const remaining = count.value - offset;\n            const page = handle.page(offset, remaining < PAGE ? remaining : PAGE);\n            if (page.type === \"none\") return none;\n            if (page.value.length === 0) throw new Error(words.changed);\n            for (const key of page.value) keys.add(key);\n            offset += BigInt(page.value.length);\n        }\n        return some(keys);\n    }, [source, snapshotted, scan, value.visible, value.rows, words.changed]);\n    const { result } = useTrackedEvaluation(read);\n    // The last complete membership as it showed: what stands in while a new narrowing resolves (#1398, CL8) — every row\n    // while nothing narrowed (the payload's own keys, or `none`), never the keys read of no row, so a first choice keeps\n    // every row showing until its own rows land.\n    const last = useRef<{ readonly keys: option<Set<string>> } | undefined>(undefined);\n    if (result.ok && result.value.type === \"some\") last.current = { keys: source === undefined ? value.visible : result.value };\n    const keys = last.current?.keys ?? EMPTY;\n    const loading = result.ok && result.value.type === \"none\";\n    const error = result.ok ? undefined : result.error instanceof Error ? result.error.message : words.failed;\n    const retry = () => {\n        if (value.recordSlice?.type === \"some\") value.recordSlice.value.slice.retry();\n        else if (snapshotted !== undefined) snapshotted.refresh(none);\n    };\n    return { keys: source === undefined ? value.visible : keys, ready: last.current !== undefined, loading, error, retry };\n}\n\n/** A Slice over several records' chrome, as a builder's payload carries it: each source's part. */\nexport interface SourcesChrome {\n    slice: { parts: readonly { source: string; slice: ValueTypeOf<RecordSliceBindType> }[] };\n}\n\n/**\n * One source's part of a Slice over several records (#1339).\n *\n * @param chrome - The payload's chrome; `undefined` with no slice\n * @param source - The source's name (`resources`)\n * @returns Its record Slice's controls, if the slice has the source\n */\nexport function sourcePart(chrome: SourcesChrome | undefined, source: string): ValueTypeOf<RecordSliceBindType> | undefined {\n    return chrome?.slice.parts.find(part => part.source === source)?.slice;\n}\n\n/**\n * Which of a source's rows show (#1339): the keys its part of a Slice over\n * several records narrows to while a choice narrows it, every row — and no\n * read — while none does. Every place a builder shows the source's rows reads\n * these keys, so one choice narrows them all.\n *\n * @param chrome - The payload's chrome; `undefined` with no slice\n * @param source - The source's name (`resources`)\n * @param keys - The source's narrowed keys, paged through its part, as the payload carries them\n * @param rows - Every row of the source, in order\n * @param words - What a failed narrowing says\n * @returns The keys to show, and the narrowing's state\n */\nexport function useSourceVisibility(chrome: SourcesChrome | undefined, source: string, keys: option<ValueTypeOf<RowSourceType<ArrayType<StringType>>>>,\n    rows: readonly { key: string }[], words: KeyVisibilityWords): KeyVisibility {\n    const part = sourcePart(chrome, source);\n    useSliceReactivity(part?.key);\n    const narrowing = part !== undefined && part.read().where.size > 0;\n    return useKeyVisibility({ visibleSource: narrowing ? keys : none, visible: none, rows, recordSlice: part === undefined ? none : some({ slice: part }) }, words);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A Library tab over a source of a builder's rail (#1339, #1340): the cards\n * the source shows, the tab's count (`12 of 69`), what the tab says when the\n * rail empties it, with Clear filters for that source alone, and its pane's\n * busy state while the source resolves. Every builder's tab that lists a\n * record's rows reads its source through this, so a filter narrows a tab as it\n * narrows the board. A tab over several sources — the Sheet's Rows tab over\n * its templates lists, the Calendar's templates — reads each card's own\n * (`sourcesTab`, #1345).\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport type { option, ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport type { LibraryEmpty, LibraryNarrowing } from \"@elaraai/east-ui-components\";\nimport { narrowedCount, type CountWords } from \"@elaraai/east-ui-components/internal\";\nimport type { KeyVisibility } from \"./visibility.js\";\n\n/** What one source of the rail shows of a tab. */\nexport interface SourceShown {\n    /** The keys that show: `none` while the source narrows nothing. */\n    keys: option<Set<string>>;\n    /** A new membership resolving, or the last read failed: the tab's cards are retained, as main's are. */\n    busy: boolean;\n    /** Whether a complete membership has resolved: until it has, an empty tab says nothing of the filters. */\n    ready: boolean;\n    /** Clears the source's choices, the rail's other sources keeping theirs; `undefined` with no such source. */\n    clear: (() => void) | undefined;\n}\n\n/**\n * A source's visibility as a tab reads it: the same object while the source's\n * membership, its state and its part stand, so a tab's cards are filtered again\n * only when what it shows changes.\n *\n * @param shown - The source's visibility (`useSourceVisibility`)\n * @param part - The source's part of the slice, whose Clear all clears it alone\n * @returns What the source shows of a tab\n */\nexport function useSourceShown(shown: KeyVisibility, part: ValueTypeOf<RecordSliceBindType> | undefined): SourceShown {\n    const { keys, ready } = shown, busy = shown.loading || shown.error !== undefined;\n    return useMemo(() => ({ keys, busy, ready, clear: part === undefined ? undefined : () => { part.clearAll(); } }), [keys, busy, ready, part]);\n}\n\n/** A tab over a source, as its Library and its pane take it. */\nexport interface SourceTab<C> {\n    /** The cards the source shows, in their order. */\n    cards: readonly C[];\n    /** The tab's count: `12 of 69` while its source narrows, else the count alone. */\n    count: string | number;\n    /** While its source narrows: what the tab says when that leaves it no card of the source's — above any the source does not touch (#1342) — and its Clear filters. */\n    narrowing: LibraryNarrowing | undefined;\n    /** An empty tab's own words; none while its narrowing has not resolved (the rail's banner speaks for it). */\n    empty: LibraryEmpty | undefined;\n    /**\n     * The pane's attributes while its source resolves or after its read fails: busy, and its cards retained (#1398,\n     * CL8) — readable, focusable and selectable, aria-disabled; the builder's commands take no drag of them meanwhile.\n     */\n    pane: { \"aria-busy\"?: true; \"aria-disabled\"?: true };\n}\n\n/**\n * A tab over a source (see the module docs) — {@link sourcesTab} over its one\n * source, every card of the tab that source's.\n *\n * @param args - The tab's cards, each one's key in the source's record, what the source shows, the tab's plural noun as running text writes it, and the app's number formatter\n * @returns The cards it shows, its count, its narrowed and its own empty states, and its pane's attributes\n */\nexport function sourceTab<C>(args: {\n    cards: readonly C[]; keyOf: (card: C) => string; shown: SourceShown; noun: string; words: CountWords;\n}): SourceTab<C> {\n    const { cards, keyOf, shown, noun, words } = args;\n    return sourcesTab({ cards, keyOf, sources: [shown], sourceOf: () => shown, noun, words });\n}\n\n/**\n * A tab over several sources (#1345): each card follows its own source — the\n * Sheet's Rows tab, its templates lists each a record of their own, and the\n * Calendar's templates. It shows each card its source shows, and every card\n * of a source that narrows nothing or of none; counts what it shows of every\n * card (`3 of 11`) while any source narrows; and is emptied when no card of a\n * narrowing source shows, while the cards of sources that narrow nothing\n * still show — its words then said above them. Its Clear filters clears each\n * narrowing source, the rail's other sources keeping theirs. Until every\n * narrowing source has resolved, an empty tab says nothing of its own, and\n * while any resolves or failed its pane is busy.\n *\n * @param args - The tab's cards, each one's key in its source's record, the sources, the source each card follows (`undefined`: none), the tab's plural noun as running text writes it, and the app's number formatter\n * @returns The cards it shows, its count, its narrowed and its own empty states, and its pane's attributes\n */\nexport function sourcesTab<C>(args: {\n    cards: readonly C[]; keyOf: (card: C) => string; sources: readonly SourceShown[]; sourceOf: (card: C) => SourceShown | undefined; noun: string; words: CountWords;\n}): SourceTab<C> {\n    const { cards, keyOf, sources, sourceOf, noun, words } = args;\n    const shows = (card: C): boolean => {\n        const keys = sourceOf(card)?.keys;\n        return keys === undefined || keys.type === \"none\" || keys.value.has(keyOf(card));\n    };\n    const shownCards = cards.filter(shows);\n    // The sources that narrow, once resolved: what the tab's narrowing is, and what it clears.\n    const narrowed = sources.filter(source => source.keys.type === \"some\" && source.ready);\n    const clears = narrowed.flatMap(source => (source.clear === undefined ? [] : [source.clear]));\n    const emptied = !cards.some(card => { const source = sourceOf(card); return source !== undefined && narrowed.includes(source) && shows(card); });\n    // One source's Clear filters is its own, held still while the source stands: the Library's memo compares it.\n    const onClear = clears.length === 1 ? clears[0]! : () => { for (const clear of clears) clear(); };\n    const narrowing = clears.length === 0 ? undefined\n        : { empty: { title: `No ${noun} match the filters`, description: `Change or clear the filters to see more ${noun}.` }, onClear, emptied };\n    return {\n        cards: shownCards,\n        count: narrowedCount(words, shownCards.length, cards.length, sources.some(source => source.keys.type === \"some\")),\n        narrowing,\n        empty: sources.some(source => source.keys.type === \"some\" && !source.ready) ? undefined : { title: `No ${noun}` },\n        pane: sources.some(source => source.busy) ? { \"aria-busy\": true, \"aria-disabled\": true } : {},\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The sources of a builder's rail its tabs follow (#1340, #1345): a tab over\n * a source's rows — the Sheet's templates lists and its author's tabs, the\n * Calendar's templates — shows what that source shows. Each source's\n * visibility is read through the shared source visibility\n * (`useSourceVisibility`), so a choice on the rail narrows every place the\n * source's rows appear; a source the rail does not narrow reads no page and\n * hides nothing. One component reads one source — the shared chain,\n * `each-source.tsx` — so a payload naming another set of sources keeps each\n * one's hooks in order.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef, type ReactNode } from \"react\";\nimport { StringType, equalFor, none, some, type ArrayType, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RowSourceType } from \"@elaraai/east-ui\";\nimport type { RecordSlicesChromeType } from \"@elaraai/east-ui/internal\";\nimport { EachSource } from \"./each-source.js\";\nimport { useSourceVisibility, type KeyVisibilityWords } from \"./visibility.js\";\nimport { useSourceShown, type SourceShown } from \"./source-tab.js\";\n\n/** The rail's chrome, as a builder's payload carries it. */\ntype Chrome = ValueTypeOf<typeof RecordSlicesChromeType>;\n\n/** A source's narrowed keys, paged through its part, as a builder's payload carries them. */\ntype NarrowedKeys = ValueTypeOf<RowSourceType<ArrayType<StringType>>>;\n\nconst stringEqual = equalFor(StringType);\n\n/** What one source a builder's tabs follow shows, and how its narrowing stands. */\nexport interface FollowedSource {\n    /** What the source shows of a tab: its keys, whether it is busy or ready, and its own Clear filters. */\n    shown: SourceShown;\n    /** Why its narrowing could not be read; `undefined` while it reads, or has read. */\n    error: string | undefined;\n    /** Reads its narrowing again. */\n    retry: () => void;\n    /** Its name, as its banner says it: its label, else the noun the builder counts it in, else its name. */\n    name: string;\n}\n\n/** The sources a builder's tabs follow, by the source's name. */\nexport type FollowedSources = ReadonlyMap<string, FollowedSource>;\n\n/** What it does not narrow shows every row, which no read needs. */\nconst NO_ROWS: readonly { key: string }[] = [];\n\n/** Props of {@link FollowSources}. */\nexport interface FollowSourcesProps {\n    /** The rail; `undefined` with no slice. */\n    chrome: Chrome | undefined;\n    /** Each source's narrowed keys, paged through its part, by the source's name, as the payload carries them. */\n    narrowed: ReadonlyMap<string, NarrowedKeys>;\n    /** The sources the builder's tabs follow, each once. */\n    sources: readonly string[];\n    /** What the builder counts each source in, by its name: a source's name where it has no label of its own. */\n    nouns: ReadonlyMap<string, string>;\n    /** What a source's failed narrowing says, by the source's name: its results moved while read, or could not be read. */\n    said: (name: string) => KeyVisibilityWords;\n    /** What renders once every source is read. */\n    children: (followed: FollowedSources) => ReactNode;\n}\n\n/** What every source's read is given: the rail, the narrowed keys, the nouns and the words. */\ntype FollowContext = Pick<FollowSourcesProps, \"chrome\" | \"narrowed\" | \"nouns\" | \"said\">;\n\n/** One source read: its name, and what it shows. */\ntype FollowedEntry = readonly [string, FollowedSource];\n\n/**\n * Reads each source a builder's tabs follow, and renders `children` with\n * what each shows — see the module docs.\n *\n * @param props - The rail, the narrowed keys, the sources, their nouns and what a failed narrowing says\n * @returns What `children` renders\n */\nexport function FollowSources({ chrome, narrowed, sources, nouns, said, children }: FollowSourcesProps): ReactNode {\n    const context = useMemo((): FollowContext => ({ chrome, narrowed, nouns, said }), [chrome, narrowed, nouns, said]);\n    return (\n        <EachSource sources={sources} context={context} read={useFollowedSource}>\n            {(read) => <Followed read={read} render={children} />}\n        </EachSource>\n    );\n}\n\n/**\n * One source a builder's tabs follow, read in its own component: what it shows and how its narrowing stands.\n *\n * @param source - The source's name\n * @param context - The rail, the narrowed keys, the nouns and the words\n * @returns The source's name and what it shows, the same pair while they hold\n */\nfunction useFollowedSource(source: string, context: FollowContext): FollowedEntry {\n    const { chrome, narrowed, nouns, said } = context;\n    const part = useMemo(() => chrome?.slice.parts.find((p) => stringEqual(p.source, source)), [chrome, source]);\n    const name = part !== undefined && part.label.type === \"some\" ? part.label.value : nouns.get(source) ?? source;\n    const words = useMemo(() => said(name), [said, name]);\n    const keys = narrowed.get(source);\n    const visibility = useSourceVisibility(chrome, source, keys === undefined ? none : some(keys), NO_ROWS, words);\n    const shown = useSourceShown(visibility, part?.slice);\n    // The retry reads the part as it stands: one function, whatever renders between.\n    const retryRef = useRef(visibility.retry);\n    retryRef.current = visibility.retry;\n    const retry = useCallback(() => retryRef.current(), []);\n    const error = visibility.error;\n    return useMemo((): FollowedEntry => [source, { shown, error, retry, name }], [source, shown, error, retry, name]);\n}\n\n/** Every source read: what `render` renders with them, by name — the same map while each source's read holds. */\nfunction Followed({ read, render }: { read: readonly FollowedEntry[]; render: FollowSourcesProps[\"children\"] }): ReactNode {\n    const followed = useMemo((): FollowedSources => new Map(read), [read]);\n    return <>{render(followed)}</>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A kind's keys as the Flowchart and the Schematic speak them (#1549): a\n * kind's record may be keyed by any type a Dict takes, and every key travels\n * as its text — a String key as itself, any other as East prints it — which a\n * reference, a row's id, the drawing and a kind's `rowsOf` name a row by. A\n * text is read back at the record's key type where the record is read by key,\n * asked of its narrowing or sought; and where a builder orders keys, it orders\n * them by their type, each text parsed once — never inside a comparison — and\n * never by their text.\n *\n * A new row's key is typed in the inspector where its kind makes none (#1549):\n * its field is the form's own editor for the key type — a struct key's fields,\n * a variant's block under its choice, a date's input, a number's — and a type\n * the form can't type, a Blob or a recursive type among them, keys no row the\n * viewer adds. Until it is typed the\n * row is held under a placeholder — a text no key prints as — and read as keyed\n * by the type's default, as a kind's `read`, which reads its key back, takes it.\n *\n * @packageDocumentation\n */\n\nimport {\n    StringType, StructType, compareFor, defaultValue, fromEastTypeValue, isVariant, none, parseFor, printFor, some, toEastTypeValue, variant,\n    type EastType, type EastTypeValue,\n} from \"@elaraai/east\";\nimport { Fields, type FieldSpecValue } from \"@elaraai/east-ui/internal\";\n\nconst compareString = compareFor(StringType);\n\n/** A key's text, beside the key it reads back as: `undefined` for a text no key prints as. */\nexport interface KeyText {\n    /** The text. */\n    readonly text: string;\n    /** The key, at the record's key type; `undefined` for a text no key prints as. */\n    readonly key: unknown;\n}\n\n/** A kind's keys (see the module docs). */\nexport interface KindKeys {\n    /** The record's key type. */\n    readonly keyType: EastTypeValue;\n    /** Whether the record is keyed by String: a key's text is the key itself. */\n    readonly text: boolean;\n    /** A key's text: a String key as itself, any other as East prints it. */\n    readonly textOf: (key: unknown) => string;\n    /** A text read back at the record's key type; `undefined` for a text no key prints as. */\n    readonly keyOf: (text: string) => unknown;\n    /**\n     * Some keys' texts in their keys' order at the record's key type, each beside its key: each read back once, and a\n     * text no key prints as after every key, in its text's order.\n     */\n    readonly order: (texts: Iterable<string>) => KeyText[];\n    /** Each of some keys' texts' place in their keys' order ({@link KindKeys.order}): what a sort by something and then by key compares. */\n    readonly ranks: (texts: Iterable<string>) => ReadonlyMap<string, number>;\n    /** Whether a text is a key's: any text, keyed by String; one that reads back at the record's key type, by any other — never a placeholder. */\n    readonly isKey: (text: string) => boolean;\n    /**\n     * The key's field as the form edits it, under `key`: the form's own editor for the key type (`Fields.specs`) — a\n     * struct key's fields, a date's input, a number's. Each spec's words are the form's; {@link keyFieldSpecs} gives\n     * them a host's.\n     */\n    readonly specs: readonly FieldSpecValue[];\n    /** Whether the form types a key of the type: an editor for each of its fields, which a Blob or a recursive type has not. */\n    readonly typed: boolean;\n    /**\n     * The text a kind's `read` takes for a row's key, which it reads back at the record's key type: the row's own, or —\n     * for a placeholder, which no key prints as — the key type's default, printed, until its key is typed.\n     */\n    readonly readKey: (text: string) => string;\n}\n\n/** Each text's place in an order. */\nfunction ranksOf(order: KindKeys[\"order\"]): KindKeys[\"ranks\"] {\n    return (texts) => new Map(order(texts).map(({ text }, i) => [text, i]));\n}\n\n/** Each key type's keys, made once a key type. */\nconst keysOf = new WeakMap<EastTypeValue, KindKeys>();\n\n/** A key's field: the key type under `key`, which the form edits as a struct's field. */\nfunction keySpecsOf(keyType: EastTypeValue): FieldSpecValue[] {\n    return Fields.specs(StructType({ key: fromEastTypeValue(keyType) as EastType }));\n}\n\n/**\n * A kind's keys (see the module docs), made once for its key type.\n *\n * @param keyType - The kind's record's key type, as its wire carries it: its details' too, which are keyed as it is\n * @returns Its keys' text, a text read back, and their order\n */\nexport function kindKeys(keyType: EastTypeValue): KindKeys {\n    let keys = keysOf.get(keyType);\n    if (keys !== undefined) return keys;\n    if (keyType.type === \"String\") {\n        const order: KindKeys[\"order\"] = (texts) => [...texts].sort(compareString).map((text) => ({ text, key: text }));\n        const specs = keySpecsOf(keyType);\n        keys = {\n            keyType, text: true, textOf: (key) => key as string, keyOf: (text) => text, order, ranks: ranksOf(order), isKey: () => true,\n            specs, typed: true, readKey: (text) => text,\n        };\n    } else {\n        const print = printFor(keyType);\n        const parse = parseFor(keyType);\n        const compare = compareFor(fromEastTypeValue(keyType)) as (a: unknown, b: unknown) => number;\n        const keyOf = (text: string): unknown => {\n            const read = parse(text);\n            return read.success ? read.value : undefined;\n        };\n        const order: KindKeys[\"order\"] = (texts) => [...texts].map((text) => ({ text, key: keyOf(text) })).sort((a, b) => {\n            if (a.key !== undefined && b.key !== undefined) return compare(a.key, b.key);\n            // A text no key prints as — a placeholder — after every key, in its text's order.\n            if (a.key !== undefined) return -1;\n            if (b.key !== undefined) return 1;\n            return compareString(a.text, b.text);\n        });\n        const specs = keySpecsOf(keyType);\n        // The key type's default, printed, made the first time a placeholder is read: a type with none — a recursive one,\n        // or one holding one — the form never types, so no row of it waits under a placeholder.\n        let standIn: string | undefined;\n        keys = {\n            keyType, text: false, textOf: (key) => print(key), keyOf, order, ranks: ranksOf(order), isKey: (text) => keyOf(text) !== undefined,\n            specs, typed: specs.length > 0 && specs.every((spec) => spec.editor.type !== \"readonly\"),\n            readKey: (text) => {\n                if (keyOf(text) !== undefined) return text;\n                standIn ??= print(defaultValue(fromEastTypeValue(keyType) as EastType));\n                return standIn;\n            },\n        };\n    }\n    keysOf.set(keyType, keys);\n    return keys;\n}\n\n/** A record keyed by String's keys: every builder's but the Flowchart's and the Schematic's. */\nexport const STRING_KEYS: KindKeys = kindKeys(toEastTypeValue(StringType));\n\n/**\n * A row's key field as an inspector shows it, under `key` (#1549): the form's\n * own editor for its kind's key type, labelled as the host names a key, with\n * its help line under it while it takes an edit — printed, while it takes none.\n * A struct key's fields sit under the key's label, each its own name's.\n *\n * @param keys - The kind's keys\n * @param label - What the host calls a key: the field's label, or a struct key's fields' heading\n * @param help - The line under it while it takes an edit\n * @param edits - Whether it takes an edit: a new row's key, the viewer's until Save\n * @returns The specs, at paths under `key`\n */\nexport function keyFieldSpecs(keys: KindKeys, label: string, help: string | undefined, edits: boolean): FieldSpecValue[] {\n    const heading = keys.specs[0]?.group.type === \"some\" ? keys.specs[0].group.value.split(\" · \")[0] : undefined;\n    return keys.specs.map((spec, i) => ({\n        ...spec,\n        label: spec.path.length === 1 ? label : spec.label,\n        // A struct key's fields under the host's word for a key, as deep as the key's structs go.\n        group: spec.group.type === \"some\" && heading !== undefined ? some(`${label}${spec.group.value.slice(heading.length)}`) : spec.group,\n        help: edits && i === 0 && help !== undefined ? some(help) : none,\n        editor: edits ? spec.editor : variant(\"readonly\", null),\n    }));\n}\n\n/**\n * A key with one of its field's parts edited in the form (#1549): the key as\n * the form's spec at `path` — under `key` — sets it, the rest as the key held\n * them, a step into a variant setting its case's value while it holds that\n * case; a key not typed yet starts from its type's default.\n *\n * @param keys - The kind's keys\n * @param held - The key as it stands: `undefined` for a placeholder, typed no key yet\n * @param path - The edited spec's path, from `key` down\n * @param next - Its new value\n * @returns The key\n */\nexport function keyEdited(keys: KindKeys, held: unknown, path: readonly string[], next: unknown): unknown {\n    const within = (at: unknown, rest: readonly string[]): unknown => {\n        if (rest.length === 0) return next;\n        const [name, ...more] = rest;\n        if (isVariant(at)) return compareString(at.type, name!) === 0 ? variant(name!, within(at.value, more)) : at;\n        const fields = at as Record<string, unknown>;\n        return { ...fields, [name!]: within(fields[name!], more) };\n    };\n    return within(held ?? defaultValue(fromEastTypeValue(keys.keyType) as EastType), path.slice(1));\n}\n\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * Words the schedule builders share (#1424): a kind's name in the plural,\n * a count and what it counts, words joined as English lists them, what a figure says of the kinds it\n * does not count — the Plan's footer and the Calendar's counts alike, a kind\n * past the cap counted none of, never 0 — and the hidden pick's words for a\n * row the rail's narrowing hides (`hidden.ts`): what a builder's message table\n * gives its line ({@link HiddenWords}) and their English — hidden by the\n * choices, or dimmed by them where the narrowing draws the row as context —\n * here, with no DOM to load, so a builder's message table that says them loads\n * with none.\n *\n * @packageDocumentation\n */\n\n/**\n * A word in running text: lower case, unless it is written in capitals (`QA` stays `QA`).\n *\n * @param word - The word as a heading writes it\n * @returns The word as a sentence writes it\n */\nexport function lowerWord(word: string): string {\n    return word.length > 1 && word === word.toLocaleUpperCase() && word !== word.toLocaleLowerCase() ? word : word.toLocaleLowerCase();\n}\n\n/**\n * A kind's name in the plural, as English makes one — `Stop` → `Stops`,\n * `Delivery` → `Deliveries`; a name that ends in `s` stays.\n *\n * @param name - The kind's name\n * @returns Its plural\n */\nexport function kindPlural(name: string): string {\n    if (/s$/i.test(name)) return name;\n    if (/[^aeiou]y$/i.test(name)) return `${name.slice(0, -1)}ies`;\n    if (/(x|z|ch|sh)$/i.test(name)) return `${name}es`;\n    return `${name}s`;\n}\n\n/**\n * A count and what it counts, as English says it: `1 issue`, `3 issues` — the\n * word's plural as English makes one ({@link kindPlural}): `1 breach`,\n * `4 breaches`.\n *\n * @param n - How many\n * @param word - What it counts, in the singular\n * @returns The words\n */\nexport function plural(n: number, word: string): string {\n    return `${n} ${n === 1 ? word : kindPlural(word)}`;\n}\n\n/**\n * Words joined as English reads a list — `a`, `a or b`, `a, b or c` — `and`\n * in place of `or` when asked.\n *\n * @param words - The words, in order\n * @param last - The word before the last\n * @returns The list\n */\nexport function joinedWords(words: readonly string[], last: \"or\" | \"and\"): string {\n    return words.length <= 1 ? (words[0] ?? \"\") : `${words.slice(0, -1).join(\", \")} ${last} ${words[words.length - 1]}`;\n}\n\n/**\n * What a count of events says when some kinds' events are not counted (#1039,\n * #1424): `13 events, print jobs not counted`; with no count of the others,\n * `print jobs not counted`.\n *\n * @param p - The count, `count` formatted for the locale beside its raw `n`, `undefined` when no kind's are counted; and\n *   the names of the kinds not counted, as running text writes them\n * @returns The words\n */\nexport function eventsNotCounted(p: { n: number; count: string | undefined; kinds: readonly string[] }): string {\n    const notCounted = `${joinedWords(p.kinds.map(kindPlural), \"and\")} not counted`;\n    return p.count === undefined ? notCounted : `${p.count} ${p.n === 1 ? \"event\" : \"events\"}, ${notCounted}`;\n}\n\n/**\n * A builder's words for a row the rail's narrowing hides, as its line says\n * it — its message table's, so a translation words them (the hidden pick,\n * `hidden.ts`' `hiddenLine`).\n */\nexport interface HiddenWords {\n    /** Until e3 has said which choices hide it, for each source that does — `hidden by the filters`. */\n    readonly hiddenByFilters: () => string;\n    /**\n     * Once it has: the choices that hide it, each as the rail words it, and those a pick clears with them — `hidden by\n     * Status: Ready — picking it clears that filter` ({@link hiddenByText} in English).\n     */\n    readonly hiddenBy: (p: { readonly filters: readonly string[]; readonly also: readonly string[] }) => string;\n}\n\n/**\n * The English of a row the rail's narrowing hides, by the choices that do —\n * joined as the rail's `Replaces …` joins them — and what a pick of it clears:\n * `hidden by Status: Ready — picking it clears that filter`; or, of a row a\n * narrowing draws as context where it leaves it out (the Schematic's\n * `narrowed=\"dim\"`), `dimmed by Status: Ready — …`. A builder's message table\n * says it so in English, and a translation in its own words.\n *\n * @param filters - The choices that hide the row, as the rail words them\n * @param also - The choices a pick clears with them\n * @param verb - What the choices do to the row: `hidden`, the default, or `dimmed`, where the narrowing draws it as context\n * @returns The words\n */\nexport function hiddenByText(filters: readonly string[], also: readonly string[], verb: \"hidden\" | \"dimmed\" = \"hidden\"): string {\n    const one = filters.length === 1;\n    const extra = also.length === 0 ? \"\" : `, and ${also.join(\"; \")} with ${one ? \"it\" : \"them\"}`;\n    return `${verb} by ${filters.join(\"; \")} — picking it clears ${one ? \"that filter\" : \"those filters\"}${extra}`;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The hidden pick: what every builder does with a row the rail's narrowing\n * hides that its Search Records lists, or an issue names (#1376, #1398) —\n * which of a source's choices hide the row, asked of e3 through the record's\n * indexes, never worked out in the browser; its line naming them as the rail's\n * `Replaces …` names the choices a pick drops; and a pick of it clearing just\n * them. A builder supplies only what is its own: how its rows are found, which\n * of its sources hide a row in the layout it shows — the Sheet's `rows`\n * source, the Roster's people's, each of the Calendar's event kinds' and,\n * where a view lays resources out, its resource kinds', the Allocation's lanes',\n * arrivals' and resources', the Schematic's kinds' — what its line names, and\n * how it selects and reveals a row once drawn (`hidden-pick.tsx`' pick).\n *\n * - **A choice alone.** For each choice the index rules let stand alone\n *   (`recordChoiceWhere` from no narrowing), whether the narrowing of that\n *   choice alone holds the row: the record Slice's membership read\n *   (`recordSliceWithin`) over the row's maintained keys. A choice they do not\n *   let stand alone — a trailing field of an index no other index leads, which\n *   the rail offers only once the fields before it are chosen — is asked as the\n *   rail holds it: with the choices before it, the narrowing's leading path\n *   through it. Its own answer is known once every other choice in its\n *   question holds the row; while one of them hides it, it goes with that one.\n * - **What a pick clears.** The choices that hide the row, each cleared as the\n *   rail clears a choice (`recordChoiceWhere` with none), which drops any\n *   choice that cannot stand without one it clears — named beside them — and a\n *   choice that could not be told apart from them. Every other choice stays,\n *   and the narrowing left holds the row: every choice in it holds it. While\n *   e3 has not said, a pick clears every choice of the source; a window a\n *   builder's navigation writes into the source is kept ({@link clearHidden}).\n * - **What it reads.** Only the rows it is asked of — a listing's, by the page\n *   the listing read them from (`askListed`), or rows by their ids, a\n *   source at a time ({@link askHiding}) — each question's membership of all of\n *   them in one request, kept by the source, the record's revision and the\n *   narrowing: a row asked of again reads nothing.\n * - **What hides a row** ({@link hiddenOf}): each source the builder reads as\n *   hiding it but one e3 says holds it, with what e3 said hides it there — and\n *   a box lists its lines again as answers land, or a source's narrowing, or\n *   what else its lines read, moves ({@link useRelist}).\n * - **How it says so** ({@link hiddenLine}): `hidden by the filters` until e3\n *   has said for each source that hides the row; then each choice as the rail\n *   words it (`Status: Ready`, {@link hidingWords}), every source's in the order\n *   given, in the sentence the builder's message table makes of them\n *   ({@link HiddenWords}) — in English, {@link hiddenByText}.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { SortedMap, StringType, compareFor, equalFor, none, printFor, some, type EastTypeValue, type option, type ValueTypeOf } from \"@elaraai/east\";\nimport {\n    RecordSliceWhereType, recordChoiceWhere, recordPlanIndex,\n    type RecordSliceBindType, type RecordSliceChoiceType, type RecordSliceEntry, type RecordSliceFieldType, type RecordSliceIndexType,\n} from \"@elaraai/east-ui/internal\";\nimport { useSliceReactivity, useTrackedEvaluation, type Formatters } from \"@elaraai/east-ui-components\";\nimport { awaitTracked, recordChoiceLabel, recordSlicePage, recordSliceRevision, recordSliceRows, recordSliceWithin } from \"@elaraai/east-ui-components/internal\";\nimport { STRING_KEYS, kindKeys } from \"./kind-keys.js\";\nimport type { HiddenWords } from \"./words.js\";\n\ntype Where = ValueTypeOf<typeof RecordSliceWhereType>;\ntype Index = ValueTypeOf<RecordSliceIndexType>;\ntype Bind = ValueTypeOf<RecordSliceBindType>;\ntype Field = ValueTypeOf<RecordSliceFieldType>;\n\nconst printWhere = printFor(RecordSliceWhereType);\nconst stringEqual = equalFor(StringType);\nconst compareString = compareFor(StringType);\n\n/**\n * A narrowing without one field's choice: a source's choices but the window a builder's navigation writes into it.\n *\n * @param where - The narrowing\n * @param field - The field left out\n * @returns The narrowing without it\n */\nfunction without(where: Where, field: string): Where {\n    return new SortedMap<string, ValueTypeOf<RecordSliceChoiceType>>([...where].filter(([at]) => !stringEqual(at, field)), compareString);\n}\n\n/** No narrowing: the record's own rows, in its order. */\nconst WHOLE_RECORD: Where = new Map();\n\n/** One question the hidden pick asks of a row: whether a narrowing standing for one of the choices holds it. */\nexport interface HidingQuestion {\n    /** The choice it asks of, by its field. */\n    readonly field: string;\n    /** The narrowing asked: the choice alone, or — one the rail lets stand only after the choices before it — with them. */\n    readonly where: Where;\n}\n\n/**\n * A narrowing's choices in its index's order: the order the rail holds them\n * in, each after the ones it stands on.\n *\n * @param indexes - The record's indexes, as its source lists them\n * @param where - The narrowing\n * @returns Its fields, in that order\n */\nfunction narrowingOrder(indexes: readonly Index[], where: Where): string[] {\n    const index = recordPlanIndex(indexes, where);\n    const order = index === undefined ? [] : index.fields.filter((field) => where.has(field));\n    for (const field of where.keys()) if (!order.some((f) => stringEqual(f, field))) order.push(field);\n    return order;\n}\n\n/**\n * The questions that tell which of a narrowing's choices hide a row (see the\n * module docs): each choice alone where the index rules let it stand alone,\n * else with the choices before it, as the rail holds it.\n *\n * @param indexes - The record's indexes, as its source lists them\n * @param where - The narrowing\n * @returns One question for each choice, in the narrowing's order\n */\nexport function hidingQuestions(indexes: readonly Index[], where: Where): HidingQuestion[] {\n    const order = narrowingOrder(indexes, where);\n    return order.map((field, at) => {\n        const alone = recordChoiceWhere(indexes, WHOLE_RECORD, field, where.get(field)!);\n        if (alone !== null) return { field, where: alone };\n        // As the rail holds it: after the choices before it — and, where those are no path an index answers, the ones\n        // after it too, until they are one.\n        for (let end = at + 1; end <= order.length; end++) {\n            const path: Where = new Map(order.slice(0, end).map((f) => [f, where.get(f)!] as const));\n            if (recordPlanIndex(indexes, path) !== undefined) return { field, where: path };\n        }\n        return { field, where };\n    });\n}\n\n/** Which choices hide a row, by their fields, as its questions' answers say. */\nexport interface HidingVerdict {\n    /** The choices that hide it, in the narrowing's order. */\n    readonly by: readonly string[];\n    /** The choices whose own answer is not known: each asked only beside one that hides the row. */\n    readonly unknown: readonly string[];\n}\n\n/**\n * Which choices hide a row, from whether each question holds it (see the\n * module docs). A question that holds the row holds it by every choice in it,\n * a narrowing being all of its choices at once; one that does not, asked of a\n * choice alone, says that choice hides it, and asked of a choice with others,\n * says so once every other choice in it holds the row.\n *\n * @param questions - The questions, as {@link hidingQuestions} asks them\n * @param holds - Whether each holds the row, in their order\n * @returns The choices that hide it, and those that cannot be told apart from them; `undefined` when the answers say\n *   nothing hides it, which a row the narrowing hides cannot be: they were read at another revision\n */\nexport function hidingOf(questions: readonly HidingQuestion[], holds: readonly boolean[]): HidingVerdict | undefined {\n    const known = new Map<string, boolean>();\n    questions.forEach((q, i) => { if (holds[i]) for (const field of q.where.keys()) known.set(field, true); });\n    questions.forEach((q, i) => { if (!holds[i] && q.where.size === 1) known.set(q.field, false); });\n    const heldBy = (field: string) => known.get(field) ?? false;\n    for (let moved = true; moved;) {\n        moved = false;\n        questions.forEach((q, i) => {\n            if (known.has(q.field) || holds[i]) return;\n            if ([...q.where.keys()].every((field) => stringEqual(field, q.field) || heldBy(field))) {\n                known.set(q.field, false);\n                moved = true;\n            }\n        });\n    }\n    const by = questions.filter((q) => known.has(q.field) && !heldBy(q.field)).map((q) => q.field);\n    const unknown = questions.filter((q) => !known.has(q.field)).map((q) => q.field);\n    // None told apart from the others: each might hide it, so each is named.\n    if (by.length === 0) return unknown.length === 0 ? undefined : { by: unknown, unknown: [] };\n    return { by, unknown };\n}\n\n/** What e3 said hides a row the narrowing hides, and what a pick of it clears (the hidden pick). */\nexport interface HiddenAnswer {\n    /** The choices that hide it, by their fields, in the narrowing's order. */\n    readonly by: readonly string[];\n    /**\n     * The choices a pick clears beside them, by their fields: each one the rail clears with one of them, as it cannot\n     * stand without it, or one that could not be told apart from them.\n     */\n    readonly also: readonly string[];\n    /** The narrowing a pick leaves: every other choice. */\n    readonly where: Where;\n}\n\n/**\n * What a pick of a row clears: the choices that hide it, each cleared as the\n * rail clears a choice — dropping one that cannot stand without it — and any\n * that could not be told apart from them still standing.\n *\n * @param indexes - The record's indexes, as its source lists them\n * @param where - The narrowing\n * @param verdict - Which choices hide the row\n * @returns The answer: what hides it, what a pick clears besides, and the narrowing it leaves\n */\nexport function clearingOf(indexes: readonly Index[], where: Where, verdict: HidingVerdict): HiddenAnswer {\n    let next: Where = where;\n    for (const field of verdict.by) next = recordChoiceWhere(indexes, next, field, undefined) ?? next;\n    for (const field of verdict.unknown) if (next.has(field)) next = recordChoiceWhere(indexes, next, field, undefined) ?? next;\n    const left = next;\n    const also = narrowingOrder(indexes, where).filter((field) => !verdict.by.some((f) => stringEqual(f, field)) && !left.has(field));\n    return { by: verdict.by, also, where: left };\n}\n\n/** The choices that hide a row and those a pick clears with them, each as the rail words it — `Status: Ready`. */\nexport interface HidingWords {\n    /** The choices that hide it. */\n    readonly filters: readonly string[];\n    /** The choices a pick clears with them. */\n    readonly also: readonly string[];\n}\n\n/**\n * What e3 said hides a row, each choice as the rail words it: its field's\n * label and the choice the narrowing holds of it (`recordChoiceLabel`).\n *\n * @param fields - The source's fields, as its part of the slice lists them\n * @param where - The narrowing the answer was asked of\n * @param answer - What e3 said hides the row\n * @param words - The app's formatters, which word a date or a number of a choice\n * @returns The choices that hide it, and those a pick clears with them\n */\nexport function hidingWords(fields: readonly Field[], where: Where, answer: HiddenAnswer, words: Formatters): HidingWords {\n    const label = (fieldId: string): string => {\n        const field = fields.find((f) => stringEqual(f.fieldId, fieldId));\n        return field === undefined ? fieldId : recordChoiceLabel(field, where.get(fieldId), words);\n    };\n    return { filters: answer.by.map(label), also: answer.also.map(label) };\n}\n\n// A builder's words for a row the rail's narrowing hides, and their English: pure, in `words.ts`, so a message table\n// that says them loads with no DOM.\nexport { hiddenByText, type HiddenWords } from \"./words.js\";\n\n/** What the narrowing holds of a row it was asked of, and — of one it hides — what e3 said hides it, once it has. */\nexport type HiddenState =\n    /** The narrowing holds it, or the record holds no row by its key: nothing hides it. */\n    | { readonly hidden: false }\n    /** The narrowing hides it: what does, `undefined` until e3 has said — or where it could not. */\n    | { readonly hidden: true; readonly answer: HiddenAnswer | undefined };\n\nconst SHOWN: HiddenState = { hidden: false };\nconst HIDDEN: HiddenState = { hidden: true, answer: undefined };\n\n/** What the hidden pick has asked and been told, at one source, revision and narrowing. */\ninterface Asked {\n    /** The source, the revision and the narrowing, as one key. */\n    readonly key: string;\n    /** Each row's state, by its id. */\n    readonly states: Map<string, HiddenState>;\n    /** The rows asked of, by their ids: each asked once. */\n    readonly asked: Set<string>;\n}\n\n/** What {@link useHiddenRows} asks e3 through. */\nexport interface HiddenRowsInput {\n    /** Who asks, as its console names it when a read fails: `Sheet`, `Allocation`. */\n    readonly name: string;\n    /** The source's part of the slice; `undefined` while nothing narrows its rows. */\n    readonly part: Bind | undefined;\n    /** Its narrowing. */\n    readonly where: Where | undefined;\n    /** The record's revision the builder reads at: what the answers are kept by, with the source and the narrowing. */\n    readonly revision: string | undefined;\n    /** A row's record key, by its id: none for an id that names no key. */\n    readonly keyOf: (id: string) => option<unknown>;\n    /** A row's id, by its record key. */\n    readonly idOf: (key: unknown) => string;\n}\n\n/** The hidden pick's reads, and what they have been told. */\nexport interface HiddenRows {\n    /**\n     * Asks which choices hide the rows a listing of the record holds from its row `from` that the narrowing hides — the\n     * key search's lines: their rows are those the listing read, so nothing is read again for them.\n     *\n     * @param from - The listing's first row, in the record's order\n     * @param ids - Each listed row's id, in order\n     * @param held - Whether the narrowing holds each, as the listing read it\n     */\n    askListed(from: number, ids: readonly string[], held: readonly boolean[]): void;\n    /**\n     * Asks of some rows by their ids — an issue's, or the rows the key search's lines stand on — whether the narrowing\n     * hides them, and which choices hide those it does: their rows read by their keys in one request, which the narrowing\n     * holds in one more — none more where the builder knows already that it hides them all, as the source's shown keys\n     * have said.\n     *\n     * @param ids - The rows' ids\n     * @param hidden - Whether the narrowing is known to hide every one of them\n     */\n    askIds(ids: readonly string[], hidden?: boolean): void;\n    /**\n     * What is known of a row at the revision and the narrowing now.\n     *\n     * @param id - The row's id\n     * @returns Its state; `undefined` while it has not been asked of, or is being asked whether the narrowing hides it\n     */\n    stateOf(id: string): HiddenState | undefined;\n    /** Moves as answers land. */\n    readonly version: number;\n}\n\n/**\n * Reads which of a source's choices hide the rows its narrowing hides, for\n * the rows a builder is asked to say so of — see the module docs.\n *\n * @param input - Who asks, the source's part, its narrowing, the record's revision, and its rows' keys\n * @returns The reads and what they have been told\n */\nexport function useHiddenRows(input: HiddenRowsInput): HiddenRows {\n    const [version, setVersion] = useState(0);\n    const latest = useRef(input);\n    latest.current = input;\n    const held = useRef<Asked>({ key: \"\", states: new Map(), asked: new Set() });\n\n    /**\n     * What is asked and known at the source, the revision and the narrowing now — none kept from another, a source in\n     * this one's place among them — or `undefined` while any is not known.\n     */\n    const now = useCallback((): Asked | undefined => {\n        const { part, where, revision } = latest.current;\n        if (part === undefined || where === undefined || revision === undefined) return undefined;\n        const key = `${part.key}\\u0000${revision}\\u0000${printWhere(where)}`;\n        if (!stringEqual(held.current.key, key)) held.current = { key, states: new Map(), asked: new Set() };\n        return held.current;\n    }, []);\n\n    /**\n     * Asks every question of some rows the narrowing hides, each one request holding all of them, and keeps what each\n     * row's answers say hides it — at the revision and the narrowing asked at, while they stand.\n     */\n    const answer = useCallback((at: Asked, ids: readonly string[], rows: readonly { key: unknown; row: unknown }[]) => {\n        const { part, where, name } = latest.current;\n        if (part === undefined || where === undefined) return;\n        const indexes = part.config.indexes;\n        const questions = hidingQuestions(indexes, where);\n        void awaitTracked(() => {\n            // Every question asked in one turn, so its reads go together.\n            const asked = questions.map((q) => recordSliceWithin(part, q.where, rows));\n            const answers: boolean[][] = [];\n            for (const a of asked) {\n                if (a.type === \"none\") return none;\n                answers.push(a.value);\n            }\n            return some(answers);\n        }).then((answers) => {\n            if (!Object.is(now(), at)) return;\n            ids.forEach((id, j) => {\n                const verdict = hidingOf(questions, answers.map((a) => a[j]!));\n                at.states.set(id, { hidden: true, answer: verdict === undefined ? undefined : clearingOf(indexes, where, verdict) });\n            });\n            setVersion((v) => v + 1);\n        }, (error: unknown) => {\n            // Not told: each line goes on saying the filters hide the row, and a pick of it clears every one.\n            console.error(`[${name}] could not read which filters hide a row:`, error);\n        });\n    }, [now]);\n\n    const askListed = useCallback((from: number, ids: readonly string[], holds: readonly boolean[]) => {\n        const at = now();\n        const { part, idOf, name } = latest.current;\n        if (at === undefined || part === undefined) return;\n        const asking: number[] = [];\n        ids.forEach((id, i) => {\n            if (holds[i]) { if (!at.states.has(id)) at.states.set(id, SHOWN); return; }\n            if (!at.states.has(id)) at.states.set(id, HIDDEN);\n            if (at.asked.has(id)) return;\n            at.asked.add(id);\n            asking.push(i);\n        });\n        if (asking.length === 0) return;\n        // Their rows as the record holds them: the page the listing read them from, held already.\n        void awaitTracked(() => recordSlicePage(part, { where: WHOLE_RECORD, area: none }, BigInt(from), BigInt(ids.length))).then((page) => {\n            if (!Object.is(now(), at)) return;\n            const entries = page as readonly RecordSliceEntry[];\n            const rows = asking.map((i) => {\n                const entry = entries[i];\n                if (entry === undefined || entry.row?.type !== \"some\" || !stringEqual(idOf(entry.key), ids[i]!)) {\n                    throw new Error(\"The record's rows moved while they were listed\");\n                }\n                return { key: entry.key, row: entry.row.value };\n            });\n            answer(at, asking.map((i) => ids[i]!), rows);\n        }).catch((error: unknown) => {\n            console.error(`[${name}] could not read the listed rows the filters hide:`, error);\n        });\n    }, [now, answer]);\n\n    const askIds = useCallback((ids: readonly string[], hidden = false) => {\n        const at = now();\n        const { part, where, keyOf, name } = latest.current;\n        if (at === undefined || part === undefined || where === undefined) return;\n        const asking: { id: string; key: unknown }[] = [];\n        for (const id of ids) {\n            // Known hidden, a row says so at once — `hidden by the filters` — while e3 is asked which choices hide it.\n            if (hidden && !at.states.has(id)) at.states.set(id, HIDDEN);\n            if (at.asked.has(id)) continue;\n            at.asked.add(id);\n            const key = keyOf(id);\n            if (key.type === \"some\") asking.push({ id, key: key.value });\n        }\n        if (asking.length === 0) return;\n        void awaitTracked(() => {\n            // Their rows as the record holds them, by their keys in one request, and which of them the narrowing holds in\n            // one more — unless it is known to hide them all.\n            const rows = recordSliceRows(part, asking.map(({ key }) => key));\n            if (rows.type === \"none\") return none;\n            const stored = asking.flatMap(({ id, key }, i) => {\n                const row = rows.value[i]!;\n                return row.type === \"some\" ? [{ id, key, row: row.value }] : [];\n            });\n            if (hidden) return some({ stored, inside: stored.map(() => false) });\n            const inside = stored.length === 0 ? some<boolean[]>([]) : recordSliceWithin(part, where, stored.map(({ key, row }) => ({ key, row })));\n            return inside.type === \"none\" ? none : some({ stored, inside: inside.value });\n        }).then(({ stored, inside }) => {\n            if (!Object.is(now(), at)) return;\n            // A key the record holds no row by is a new row's: the builder draws it among the rows, and nothing hides it.\n            for (const { id } of asking) at.states.set(id, SHOWN);\n            const hidden = stored.filter((_row, i) => !inside[i]);\n            for (const { id } of hidden) at.states.set(id, HIDDEN);\n            setVersion((v) => v + 1);\n            if (hidden.length > 0) answer(at, hidden.map(({ id }) => id), hidden.map(({ key, row }) => ({ key, row })));\n        }, (error: unknown) => {\n            console.error(`[${name}] could not read whether the filters hide the rows asked of:`, error);\n        });\n    }, [now, answer]);\n\n    const stateOf = useCallback((id: string): HiddenState | undefined => now()?.states.get(id), [now]);\n    return useMemo(() => ({ askListed, askIds, stateOf, version }), [askListed, askIds, stateOf, version]);\n}\n\n/**\n * The revision a source's record is read at, tracked: what a builder that\n * reads the record through its part — not through a lens of its own — keeps\n * its hidden pick's answers by.\n *\n * @param part - The source's part of the slice; `undefined` with none\n * @returns Its revision; `undefined` while it is not known, or with no part\n */\nexport function usePartRevision(part: Bind | undefined): string | undefined {\n    const read = useCallback((): option<string> => (part === undefined ? none : recordSliceRevision(part)), [part]);\n    const { result } = useTrackedEvaluation(read);\n    return result.ok && result.value.type === \"some\" ? result.value.value : undefined;\n}\n\n/** The hidden pick over one source: what it asks and is told, the source's part, its narrowing and the window it keeps. */\nexport interface SourceHidden {\n    /** The pick's reads, and what they have been told. */\n    readonly rows: HiddenRows;\n    /** The source's part of the slice; `undefined` with none. */\n    readonly part: Bind | undefined;\n    /** Its narrowing now — but the window a builder's navigation writes into it; `undefined` with no part. */\n    readonly where: Where | undefined;\n    /**\n     * The field of its narrowing a builder's navigation writes — the Calendar's event kinds' range, their window — which\n     * hides no row: left out of what is asked, and kept as a pick clears ({@link clearHidden}); `undefined` with none.\n     */\n    readonly window: string | undefined;\n    /**\n     * Whether it can ask e3 now — its part, its narrowing and its record's revision known. The pick is another object once\n     * it can, so what asks of it as it renders asks again then.\n     */\n    readonly ready: boolean;\n}\n\n/** What {@link useHidden} reads a source's rows through: {@link useHiddenRows}' input, and the window the builder keeps. */\nexport interface SourceHiddenInput extends HiddenRowsInput {\n    /** The field of the source's narrowing the builder's own navigation writes, which hides no row; none by default. */\n    readonly window?: string | undefined;\n}\n\n/**\n * The hidden pick over one source, as the builder reads the source's rows —\n * the Sheet's `rows` source through its lens, at the lens's revision, its rows\n * keyed by its record's key type ({@link useSourceHidden} for a source read\n * through its part).\n *\n * @param input - Who asks, the source's part, its narrowing, the record's revision, its rows' keys and its window\n * @returns The pick, the same object while what it has been told, its narrowing and its readiness hold\n */\nexport function useHidden(input: SourceHiddenInput): SourceHidden {\n    const rows = useHiddenRows(input);\n    const { part, where, revision, window } = input;\n    const ready = part !== undefined && where !== undefined && revision !== undefined;\n    return useMemo(() => ({ rows, part, where, window, ready }), [rows, part, where, window, ready]);\n}\n\n/**\n * The hidden pick over one source of a builder's `Slice.bindRecords`, read\n * through its part — never through a lens of its own, as the Sheet's is — its\n * rows by their ids, each its key's text (#1549): by String, a row's id its\n * key, as `recordSources` binds every source but the Flowchart's and the\n * Schematic's, whose records may be keyed by any type, each id read back at it.\n * Its narrowing followed as a choice moves it, the same object while its\n * choices hold, its answers kept by its record's revision: the Allocation's\n * lanes, resources and arrivals, the Roster's people, each of the Calendar's\n * event and resource kinds, and the Flowchart's and the Schematic's kinds\n * (`hidden-pick.tsx`' `HideSources`).\n *\n * @param name - Who asks, as its console names it when a read fails\n * @param part - The source's part of the slice; `undefined` with none\n * @param window - The field of its narrowing the builder's own navigation writes — the Calendar's event kinds' range,\n *   their window — which hides no row: left out of what is asked, and kept as a pick clears ({@link clearHidden})\n * @param keyType - Its record's key type, which a row's id is read back at; String by default\n * @returns The pick\n */\nexport function useSourceHidden(name: string, part: Bind | undefined, window?: string, keyType?: EastTypeValue): SourceHidden {\n    const keys = keyType === undefined ? STRING_KEYS : kindKeys(keyType);\n    // Its narrowing, read again as a choice moves it.\n    const moved = useSliceReactivity(part?.key);\n    const read = useMemo(() => {\n        const where = part?.read().where;\n        return where === undefined || window === undefined ? where : without(where, window);\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- a choice moves `moved`, which the part's `read()` follows\n    }, [part, moved, window]);\n    // The same narrowing while its choices hold: a step of the window alone moves none of it.\n    const text = read === undefined ? undefined : printWhere(read);\n    const kept = useRef<{ readonly text: string | undefined; readonly where: Where | undefined } | undefined>(undefined);\n    const was = kept.current?.text;\n    const holds = kept.current !== undefined && (was === undefined || text === undefined ? was === text : stringEqual(was, text));\n    if (!holds) kept.current = { text, where: read };\n    const where = kept.current!.where;\n    const keyOf = (id: string): option<unknown> => {\n        const key = keys.keyOf(id);\n        return key === undefined ? none : some(key);\n    };\n    return useHidden({ name, part, where, revision: usePartRevision(part), keyOf, idOf: keys.textOf, window });\n}\n\n/**\n * Clears the choices that hide a row, as the rail clears a choice: those e3\n * named — and what goes with them — else, while it has not said, every choice\n * of the source; the source's narrowing written once, a write of the rail like\n * a chip's. A window the builder's navigation writes into the source is kept.\n *\n * @param part - The source's part of the slice\n * @param answer - What e3 said hides the row; `undefined` while it has not\n * @param window - The field of the narrowing that holds the builder's window ({@link useSourceHidden}): kept as it is\n */\nexport function clearHiding(part: Bind, answer: HiddenAnswer | undefined, window?: string): void {\n    const state = part.read();\n    const held = window === undefined ? undefined : state.where.get(window);\n    if (window === undefined || held === undefined) {\n        part.write({ ...state, where: answer?.where ?? WHOLE_RECORD, preset: none });\n        return;\n    }\n    const left = new SortedMap<string, ValueTypeOf<RecordSliceChoiceType>>([...(answer?.where ?? WHOLE_RECORD)], compareString);\n    left.set(window, held);\n    part.write({ ...state, where: left, preset: none });\n}\n\n/**\n * A source a builder reads as hiding a row — as the layout it shows draws the row: the source's hidden pick, and the\n * source's row the row stands on, by its id — the row itself, or the lane a bin stands in, the resource an event is drawn\n * on.\n */\nexport interface RowHiding {\n    /** The source's hidden pick. */\n    readonly pick: SourceHidden;\n    /** The source's row the row stands on, by its id. */\n    readonly id: string;\n}\n\n/** A source that hides a row, as a pick clears it: its hidden pick, and what e3 said hides the row there. */\nexport interface SourceHiding {\n    /** The source's hidden pick. */\n    readonly pick: SourceHidden;\n    /** What e3 said hides the source's row; `undefined` until it has — or where it could not — when a pick clears every choice of the source. */\n    readonly answer: HiddenAnswer | undefined;\n}\n\n/** A source that hides a row: the source's row the row stands on, and what e3 said hides that. */\nexport interface RowHidden extends RowHiding, SourceHiding {}\n\n/**\n * What hides a row, as far as e3 has said: each source the builder reads as hiding it — but one e3 says holds the\n * source's row, the builder's reading of what the source shows catching up — with what e3 said hides it there.\n *\n * @param hidings - The sources the builder reads as hiding the row, in the order its line names them\n * @returns Those that hide it; `undefined` where none does\n */\nexport function hiddenOf(hidings: readonly RowHiding[]): readonly RowHidden[] | undefined {\n    const hidden = hidings.flatMap((hiding): RowHidden[] => {\n        const state = hiding.pick.rows.stateOf(hiding.id);\n        if (state !== undefined && !state.hidden) return [];\n        return [{ ...hiding, answer: state?.hidden === true ? state.answer : undefined }];\n    });\n    return hidden.length === 0 ? undefined : hidden;\n}\n\n/**\n * Asks e3 which choices hide some rows the narrowing hides — the rows a list shows, or an issue names — a source at a\n * time: each source's rows the hidings stand on, each once, in one ask of the source (`askIds`). Nothing a source has\n * been asked at its revision and narrowing is asked again.\n *\n * @param hidings - The sources the builder reads as hiding the rows, each with the source's row a row stands on\n * @param known - Whether the builder knows already that each source hides its rows — as the source's shown keys, or its\n *   rows' membership, have said — so each row's line says so at once, while e3 is asked which choices hide it\n */\nexport function askHiding(hidings: readonly RowHiding[], known: boolean): void {\n    const asked = new Map<HiddenRows, Set<string>>();\n    for (const { pick, id } of hidings) {\n        const ids = asked.get(pick.rows) ?? new Set<string>();\n        ids.add(id);\n        asked.set(pick.rows, ids);\n    }\n    for (const [rows, ids] of asked) rows.askIds([...ids], known);\n}\n\n/**\n * Clears what hides a row, as the rail clears a choice — each source's choices e3 named and what goes with them, else,\n * while it has not said, every choice of the source; each source's window kept — one write of the rail a source. A\n * source whose narrowing holds no choice hides nothing: nothing of it is written.\n *\n * @param hidden - Each source that hides the row, and what e3 said hides it there\n * @throws {Error} Where a source's narrowing could not be written: the sources before it are cleared\n */\nexport function clearHidden(hidden: readonly SourceHiding[]): void {\n    for (const { pick, answer } of hidden) {\n        if (pick.part === undefined || pick.where === undefined || pick.where.size === 0) continue;\n        clearHiding(pick.part, answer, pick.window);\n    }\n}\n\n/**\n * What a row's line says of what hides it: that the filters do, until e3 has said for each source that hides it; then\n * the choices that do, every source's in the order given, each as the rail words it, in the builder's words.\n *\n * @param hidden - Each source that hides the row, and what e3 said hides it there: one at least\n * @param formatters - The app's formatters, which word a date or a number of a choice\n * @param words - The builder's words for it\n * @returns The words\n */\nexport function hiddenLine(hidden: readonly SourceHiding[], formatters: Formatters, words: HiddenWords): string {\n    const said: HidingWords[] = [];\n    for (const { pick, answer } of hidden) {\n        if (answer === undefined || pick.part === undefined) return words.hiddenByFilters();\n        said.push(hidingWords(pick.part.config.fields, pick.where ?? WHOLE_RECORD, answer, formatters));\n    }\n    return words.hiddenBy({ filters: said.flatMap((w) => w.filters), also: said.flatMap((w) => w.also) });\n}\n\n/** Nothing else a box's lines read. */\nconst NOTHING_ELSE: readonly unknown[] = [];\n\n/**\n * A count that moves each time one of some values is another object than it was, or their number moves.\n *\n * @param values - The values\n * @returns The count: 0 at first\n */\nexport function useMoves(values: readonly unknown[]): number {\n    const seen = useRef<{ readonly values: readonly unknown[]; readonly moves: number } | undefined>(undefined);\n    const was = seen.current;\n    if (was === undefined) seen.current = { values, moves: 0 };\n    else if (was.values.length !== values.length || was.values.some((value, i) => !Object.is(value, values[i]))) seen.current = { values, moves: was.moves + 1 };\n    return seen.current!.moves;\n}\n\n/**\n * What a key search's box lists its lines again by (`relist`): it moves as what the lines say of a row could — e3\n * saying which choices hide a row, a source's narrowing, a source coming to ask — each pick another object then — and as\n * whatever else the builder's lines read moves: what a source shows, the layout.\n *\n * @param picks - The hidden picks the lines read\n * @param also - What else they read, each another object as it moves\n * @returns The count\n */\nexport function useRelist(picks: readonly SourceHidden[], also: readonly unknown[] = NOTHING_ELSE): number {\n    return useMoves([...picks, ...also]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The hidden pick's React parts (#1398), beside its reads and its words\n * (`hidden.ts`): each source's pick read in a component of its own, in order\n * ({@link HideSources}, over the shared chain `each-source.tsx`), and the pick\n * of a row — of the key search, or Go to issue — that the rail's narrowing may\n * hide ({@link useHiddenPick}).\n *\n * A pick clears what hides the row — each source's choices e3 named, every\n * choice of a source while it has not said — catching a clear that throws and\n * saying why where the builder says a gesture's error, the keyboard left where\n * it is; then goes to the row, as the builder goes — its selection, a step to\n * its period; then, once the builder draws it under the narrowing the pick\n * left, selects it where the builder selects it only then, and hands it the\n * keyboard (east-ui-components' `usePickHandOff`): a pick of the box's does,\n * once the box has let the keyboard go, unless the viewer has moved on; a step\n * through the matches, or Go to issue, leaves it where it is.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport type { EastTypeValue, ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { usePickHandOff, type PickHandOff, type PickingSource } from \"@elaraai/east-ui-components/internal\";\nimport { EachSource } from \"./each-source.js\";\nimport { clearHidden, useSourceHidden, type SourceHidden, type SourceHiding } from \"./hidden.js\";\n\n/** One source a builder's hidden picks are read over. */\nexport interface HiddenSource {\n    /** What its pick is kept by: the source's name — a kind's slot. */\n    readonly key: string;\n    /** The source's part of the slice. */\n    readonly part: ValueTypeOf<RecordSliceBindType>;\n    /** The field of its narrowing the builder's navigation writes — an event kind's window — which hides no row; none by default. */\n    readonly window?: string | undefined;\n    /**\n     * Its record's key type (#1549): a row's id is its key's text, read back at it — the Flowchart's and the Schematic's\n     * kinds, keyed by any type; String by default, as `recordSources` binds every other builder's sources.\n     */\n    readonly keyType?: EastTypeValue | undefined;\n}\n\n/** Each source's hidden pick, by its key. */\nexport type HiddenPicks = ReadonlyMap<string, SourceHidden>;\n\n/** Props of {@link HideSources}. */\nexport interface HideSourcesProps {\n    /** Who asks, as the console names it when a read fails: `Calendar`, `Schematic`. */\n    readonly name: string;\n    /** The sources, in the builder's order, each once. */\n    readonly sources: readonly HiddenSource[];\n    /** What renders with their picks. */\n    readonly children: (picks: HiddenPicks) => ReactNode;\n}\n\n/**\n * Reads each source's hidden pick in a component of its own, in order — so a payload naming another set of sources keeps\n * each one's hooks in order — and renders `children` with them, again only as a pick moves: a step of a window it keeps,\n * or a revision that says nothing new, renders nothing under it.\n *\n * @param props - Who asks, the sources, and what renders with their picks\n * @returns What `children` renders\n */\nexport function HideSources({ name, sources, children }: HideSourcesProps): ReactNode {\n    return (\n        <EachSource sources={sources} context={name} read={useHiddenSource}>\n            {(read) => <Picked read={read} render={children} />}\n        </EachSource>\n    );\n}\n\n/** One source's pick read: its key, and the pick. */\ntype PickedEntry = readonly [string, SourceHidden];\n\n/**\n * One source's hidden pick, read in its own component.\n *\n * @param source - The source\n * @param name - Who asks\n * @returns Its key and its pick, the same pair while they hold\n */\nfunction useHiddenSource(source: HiddenSource, name: string): PickedEntry {\n    const pick = useSourceHidden(name, source.part, source.window, source.keyType);\n    const { key } = source;\n    return useMemo((): PickedEntry => [key, pick], [key, pick]);\n}\n\n/** Every source's pick read: what `render` renders with them, by key — the same map while each source's pick holds. */\nfunction Picked({ read, render }: { read: readonly PickedEntry[]; render: HideSourcesProps[\"children\"] }): ReactNode {\n    const picks = useMemo((): HiddenPicks => new Map(read), [read]);\n    return <>{render(picks)}</>;\n}\n\n/** How a pick lands, where the builder waits for it to draw the row the pick goes to. */\nexport interface PickLanding<T> {\n    /** Whether the builder draws the row now, under the narrowing the pick left and in the period it went to, read: it lands then. */\n    readonly drawn: (target: T) => boolean;\n    /**\n     * What the builder does as it lands, beside the keyboard: the Allocation selects its bin then, its day read, and the\n     * Schematic its item, the narrowing it was context under gone; none where it selected the row as it went.\n     */\n    readonly selects?: ((target: T) => void) | undefined;\n    /**\n     * Brings the keyboard to the row, drawn: where its ring is — a person's name, an event's block, a bin's card; none\n     * where the builder hands its view no keyboard (the Schematic's Find).\n     */\n    readonly focus?: ((target: T) => void) | undefined;\n}\n\n/** What {@link useHiddenPick} says a failed clear in, and how a pick lands. */\nexport interface HiddenPickOptions<T> {\n    /** Says why the choices hiding a row could not be cleared, where the builder says a gesture's error: the clear's own words, else `uncleared`. */\n    readonly onError: (words: string, reason: unknown) => void;\n    /** What it says where a clear threw no words of its own: `The filters hiding the bin could not be cleared`. */\n    readonly uncleared: string;\n    /** How a pick lands; none where the builder lands its rows itself — the Sheet's lens's jump, the Schematic's canvas. */\n    readonly landing?: PickLanding<T> | undefined;\n}\n\n/** A builder's pick of a row the rail's narrowing may hide — see the module docs. */\nexport interface HiddenPick<T> {\n    /**\n     * The key search's source, as the box drives it: a pick arms the hand-off of the keyboard, a step or a clear drops\n     * it. A builder keeps the one it made while its source holds.\n     */\n    readonly search: <S extends PickingSource>(source: S) => S;\n    /**\n     * A pick of a row: what hides it cleared, then the builder's own `go`, then — while it lands — the row selected and\n     * handed the keyboard once the builder draws it.\n     *\n     * @param hidden - What hides the row, each source's and what e3 said hides it there; `undefined` where nothing does\n     * @param target - The row, as the builder's landing reads it\n     * @param go - The builder's own going to it — its selection, a step to its period — `false` where it draws the row\n     *   nowhere (an event waiting in the backlog): nothing lands, the keyboard left where it is\n     */\n    readonly pick: (hidden: readonly SourceHiding[] | undefined, target: T, go: () => boolean | void) => void;\n    /**\n     * Clears what hides a row, for a builder whose own reveal lands it — the Sheet's lens's jump, the Schematic's canvas.\n     *\n     * @param hidden - What hides it; `undefined` where nothing does\n     * @returns Whether every source's choices were cleared; `false` where a clear threw — said where the builder says a\n     *   gesture's error, the keyboard left where it is\n     */\n    readonly clear: (hidden: readonly SourceHiding[] | undefined) => boolean;\n    /** The hand-off of the keyboard the box's picks arm: what a builder that lands its rows itself lands it through. */\n    readonly handOff: PickHandOff;\n}\n\n/**\n * A builder's pick of a row the rail's narrowing may hide — see the module docs.\n *\n * @param options - Where a failed clear is said, and how a pick lands\n * @returns The pick: the box's source, the pick, the clear alone, and the hand-off\n */\nexport function useHiddenPick<T = never>(options: HiddenPickOptions<T>): HiddenPick<T> {\n    const handOff = usePickHandOff();\n    // The latest options: a pick and its landing read them as they run.\n    const latest = useRef(options);\n    latest.current = options;\n    // The row a pick goes to, waiting for the builder to draw it; a pick renders the builder again, so whether it is drawn\n    // already is asked at once.\n    const waiting = useRef<{ readonly target: T } | undefined>(undefined);\n    const [, setPicked] = useState(0);\n    const clear = useCallback((hidden: readonly SourceHiding[] | undefined): boolean => {\n        if (hidden === undefined) return true;\n        try {\n            clearHidden(hidden);\n            return true;\n        } catch (reason) {\n            // The narrowing stands, so nothing will draw the row: nothing takes the keyboard, which stays where it is.\n            handOff.drop();\n            const { onError, uncleared } = latest.current;\n            onError(reason instanceof Error ? reason.message : uncleared, reason);\n            return false;\n        }\n    }, [handOff]);\n    const pick = useCallback((hidden: readonly SourceHiding[] | undefined, target: T, go: () => boolean | void) => {\n        if (!clear(hidden)) return;\n        if (go() === false || latest.current.landing === undefined) {\n            handOff.drop();\n            waiting.current = undefined;\n            return;\n        }\n        waiting.current = { target };\n        setPicked((n) => n + 1);\n    }, [clear, handOff]);\n    // Landed once the builder draws the row: asked after every render, as what draws it — the narrowing the pick left, the\n    // period it went to — lands in renders of its own.\n    useEffect(() => {\n        const landing = latest.current.landing;\n        const now = waiting.current;\n        if (now === undefined || landing === undefined || !landing.drawn(now.target)) return;\n        waiting.current = undefined;\n        landing.selects?.(now.target);\n        const focus = landing.focus;\n        if (focus !== undefined) handOff.land(() => focus(now.target));\n    });\n    const search = useCallback(<S extends PickingSource>(source: S): S => handOff.search(source), [handOff]);\n    return useMemo(() => ({ search, pick, clear, handOff }), [search, pick, clear, handOff]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Overlaps (#1198): two events on one resource at once — what the Plan's\n * builder flags (`Plan Builder Spec.md` PB51–PB53), and the Calendar's built-in\n * conflict (`Calendar Spec.md` B43–B45, #1155), which shares the kinds.\n *\n * Events pair within a GROUP the caller gives: on a Plan, each kind that warns\n * of its overlaps is a group of its own, as two events of a kind are a pair\n * (PB51); on a Calendar, every event is in one. Within a group, per resource —\n * its kind and its key together — sorted by start, a sweep keeps the events\n * still running, and each event pairs with every one of them whose end is past\n * its start. Spans are half-open, `[start, end)`, as the lanes' are\n * (`../time/lanes.ts`): two events that only meet do not overlap, and an\n * instant, which spans nothing, overlaps nothing. An event with no time (in the\n * backlog) or on no resource never overlaps.\n *\n * The pairs come earliest first, as the Calendar's mock picks its first pair:\n * by the earlier event's start, then the later's, each tie broken by the\n * events' keys. Every time is compared as East compares a DateTime, a resource\n * as East compares its ref, and a key as East compares a String.\n *\n * @packageDocumentation\n */\n\nimport { DateTimeType, SortedMap, StringType, compareFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { Schedule, ScheduleEventRefType, ScheduleResourceRefType } from \"@elaraai/e3-ui/internal\";\n\n/** One event as every view draws it — `Schedule.Types.Item`, decoded. */\nexport type ScheduleItemValue = ValueTypeOf<typeof Schedule.Types.Item>;\n\n/** The resource an event is on, decoded. */\ntype ScheduleResourceRefValue = ValueTypeOf<typeof ScheduleResourceRefType>;\n\n/** Two events on one resource whose times overlap. */\nexport interface ScheduleOverlapPair<I extends ScheduleItemValue> {\n    /** The one that starts first — the one whose key sorts first, when they start together. */\n    readonly first: I;\n    /** The other. */\n    readonly second: I;\n    /** When they begin to overlap: the later start. */\n    readonly from: Date;\n    /** When they stop: the earlier end. */\n    readonly to: Date;\n}\n\n/** The overlaps among some events. */\nexport interface ScheduleOverlaps<I extends ScheduleItemValue> {\n    /** Every pair, earliest first. */\n    readonly pairs: readonly ScheduleOverlapPair<I>[];\n    /**\n     * Each event in a pair — by its element's key, the text East prints of its\n     * `Schedule.Types.EventRef` — and the events it overlaps, earliest first.\n     */\n    readonly peers: ReadonlyMap<string, readonly I[]>;\n}\n\n/** An event with a span: its times, and its element's key. */\ninterface Spanned<I extends ScheduleItemValue> {\n    readonly item: I;\n    readonly start: Date;\n    readonly end: Date;\n    readonly ref: string;\n}\n\n/** No overlaps: none of the events overlaps another. */\nconst NONE: ScheduleOverlaps<never> = { pairs: [], peers: new Map() };\n\nconst compareDateTime = compareFor(DateTimeType);\nconst compareString = compareFor(StringType);\nconst compareResource = compareFor(ScheduleResourceRefType);\nconst printEvent = printFor(ScheduleEventRefType);\n\n/** Earliest first: by start, then by key. */\nfunction byStart<I extends ScheduleItemValue>(a: Spanned<I>, b: Spanned<I>): number {\n    return compareDateTime(a.start, b.start) || compareString(a.ref, b.ref);\n}\n\n/**\n * The element key of an event: East's print of its `Schedule.Types.EventRef`,\n * which every element it draws carries.\n *\n * @param item - The event\n * @returns Its key\n */\nexport function scheduleEventKey(item: ScheduleItemValue): string {\n    return printEvent({ kind: item.kind, key: item.key });\n}\n\n/**\n * The overlaps among events — see the module docs.\n *\n * @typeParam I - The events' type: `Schedule.Types.Item`'s, or a view's own with its fields (the Plan's `PlanItem`)\n * @param groups - The events, in the groups whose events may pair: each kind that warns of its overlaps on a Plan, all of them on a Calendar\n * @returns The pairs, earliest first, and each event's peers\n */\nexport function scheduleOverlaps<I extends ScheduleItemValue>(groups: Iterable<readonly I[]>): ScheduleOverlaps<I> {\n    const pairs: { first: Spanned<I>; second: Spanned<I>; to: Date }[] = [];\n    const peers = new Map<string, I[]>();\n    const meet = (a: Spanned<I>, b: Spanned<I>) => {\n        const at = peers.get(a.ref);\n        if (at !== undefined) at.push(b.item);\n        else peers.set(a.ref, [b.item]);\n    };\n    for (const items of groups) {\n        const spanned: (Spanned<I> & { readonly on: ScheduleResourceRefValue })[] = [];\n        for (const item of items) {\n            const { resource, start, end }: ScheduleItemValue = item;\n            if (resource.type === \"none\" || start.type === \"none\" || end.type === \"none\") continue;\n            // An instant spans nothing, and nor does an end before its start.\n            if (compareDateTime(start.value, end.value) >= 0) continue;\n            spanned.push({ item, start: start.value, end: end.value, ref: scheduleEventKey(item), on: resource.value });\n        }\n        // Per resource, its kind and its key together.\n        for (const events of SortedMap.groupBy(spanned, (e) => e.on, compareResource).values()) {\n            events.sort(byStart);\n            let running: Spanned<I>[] = [];\n            for (const event of events) {\n                running = running.filter((r) => compareDateTime(r.end, event.start) > 0);\n                for (const r of running) {\n                    pairs.push({ first: r, second: event, to: compareDateTime(r.end, event.end) <= 0 ? r.end : event.end });\n                    // Each peer list grows in sweep order: by start, then key.\n                    meet(r, event);\n                    meet(event, r);\n                }\n                running.push(event);\n            }\n        }\n    }\n    if (pairs.length === 0) return NONE;\n    // By the earlier event's start, then the later's; then by their keys.\n    pairs.sort((a, b) => compareDateTime(a.first.start, b.first.start) || compareDateTime(a.second.start, b.second.start)\n        || compareString(a.first.ref, b.first.ref) || compareString(a.second.ref, b.second.ref));\n    return {\n        pairs: pairs.map(({ first, second, to }) => ({ first: first.item, second: second.item, from: second.start, to })),\n        peers,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The refusals holding a builder's Save (#1525): the app's `ready` refusing a\n * drafted entry, each its session's, while it stands — what the Roster's and\n * the Allocation's Issues tabs list ahead of their own issues, and an entry's\n * panel shows over its form, the Plan's and the Calendar's included. Each names\n * its field by its form's label, and the field says the refusal's words under\n * it in every builder's panel — the Schematic's and the Flowchart's too, which\n * list their refusals in Issues alone ({@link entryRefusals}).\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { spellOut, type FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport type { EditIssue } from \"@elaraai/east-ui-components\";\nimport type { ScheduleKindSession } from \"./editing.js\";\n\n/** One refusal holding Save: whose session it is, and its issue. */\nexport interface ScheduleRefusal {\n    /** The kind's slot, or the record's key, whose session refuses. */\n    readonly kind: string;\n    /** The issue: its entry's key's text, the field it names, if any, and the app's message. */\n    readonly issue: EditIssue;\n}\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * Every refusal holding Save, in the sessions' order: each session's drafts'\n * readiness while it refuses.\n *\n * @param sessions - Each kind's session and each record's, as the shared editing holds them\n * @returns The refusals\n */\nexport function scheduleRefusals(sessions: readonly ScheduleKindSession[]): ScheduleRefusal[] {\n    const out: ScheduleRefusal[] = [];\n    for (const held of sessions) {\n        const readiness = held.session.readiness;\n        if (readiness.type !== \"ready\") for (const issue of readiness.value) out.push({ kind: held.kind, issue });\n    }\n    return out;\n}\n\n/**\n * What one record's session refuses of one entry: its drafts' readiness's issues naming the entry, while it refuses —\n * the app's check, a bound a changed row breaks, a new row waiting for its key. An entry with any holds its record's\n * Save; each naming a field is what the entry's form says under it ({@link refusedFields}).\n *\n * @param sessions - Each kind's session and each record's, as the shared editing holds them\n * @param kind - The record: its kind's slot, or its record's key\n * @param entry - The entry's key's text\n * @returns Its refusals, in the readiness's order; none while the session is ready, or holds no session of the record\n */\nexport function entryRefusals(sessions: readonly ScheduleKindSession[], kind: string, entry: string): EditIssue[] {\n    const readiness = sessions.find((held) => stringEqual(held.kind, kind))?.session.readiness;\n    return readiness === undefined || readiness.type === \"ready\" ? [] : readiness.value.filter((issue) => stringEqual(issue.entry, entry));\n}\n\n/**\n * A field as a refusal names it: by its form's label — a nested field, a\n * case's among them, by its path joined by \".\" (#1585) — or, for one no form\n * draws (a role the builder draws itself), its name spelled out.\n *\n * @param specs - The entry's form, whose labels name its fields\n * @param field - The field's name, a nested one's path joined by \".\"\n * @returns Its words\n */\nexport function fieldLabelOf(specs: readonly FieldSpecValue[], field: string): string {\n    return specs.find((s) => stringEqual(s.path.join(\".\"), field))?.label ?? spellOut(field);\n}\n\n/**\n * The fields an entry's issues name, each with what its issues say of it, in their order: what the entry's form is\n * handed as its `issues` (east-ui-components' `FieldForm`), so each field it rings says its reason under it (ruled 13\n * Nov 2026) — where the keyboard lands when the issue is gone to, whatever of the banner over the form is in view.\n */\nexport type RefusedFields = ReadonlyMap<string, readonly string[]>;\n\n/** No field an issue names. */\nexport const NO_REFUSED_FIELDS: RefusedFields = new Map();\n\n/**\n * The fields an entry's issues name ({@link RefusedFields}): an app's refusal of a field in the app's own words, a\n * bound a changed row breaks in the bound's — which the form says once, in the field's help line. An issue naming no\n * field rings none.\n *\n * @param issues - The entry's issues: its refusals holding Save, or what its session raises of it\n * @returns Each field they name, by its key as the form keys it, and the words under it; the one empty map for none\n */\nexport function refusedFields(issues: readonly EditIssue[]): RefusedFields {\n    let out: Map<string, string[]> | undefined;\n    for (const issue of issues) {\n        if (issue.field.type !== \"some\") continue;\n        out ??= new Map();\n        const said = out.get(issue.field.value);\n        if (said === undefined) out.set(issue.field.value, [issue.message]);\n        else said.push(issue.message);\n    }\n    return out ?? NO_REFUSED_FIELDS;\n}\n\n/**\n * A refusal in words: the field it names ({@link fieldLabelOf}), then the\n * app's message: `Cost centre: Choose the cost centre`. A refusal naming no\n * field is its message alone.\n *\n * @param issue - The refusal's issue\n * @param specs - The entry's form, whose labels name its fields\n * @returns The words\n */\nexport function refusalText(issue: EditIssue, specs: readonly FieldSpecValue[]): string {\n    return issue.field.type !== \"some\" ? issue.message : `${fieldLabelOf(specs, issue.field.value)}: ${issue.message}`;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The now line (#1148): the instant a time view marks as now, the same line\n * on every canvas that draws one (Plan's rows and ruler, the Calendar's time\n * grid and timeline). It is 1.5px of the brand: down the box for an instant\n * on a horizontal axis (`along=\"x\"`), across it for one on a vertical axis\n * (`along=\"y\"`), with a 7px dot at its start where the view wants one. Its\n * chip says what the instant is called, `NOW` on Plan's ruler, or the time in\n * a time grid's gutter.\n *\n * The parts set data attributes and geometry only, the geometry written on\n * the element (`left` or `top`, and a chip's translation), as every position\n * that follows data is. Their look is the host recipe's `nowLine`, `nowDot`\n * and `nowChip` slots, which every host merges from the one shared part in the\n * theme (east-ui-components' `slot-recipes/time/now.ts`). Data attributes a\n * host gives (`data-plan-now`) land on the element, so its tests and\n * selectors find it.\n *\n * Where now is comes from the host: a test or a showcase pins it, and\n * {@link useNow} reads the clock when nothing does.\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** The axis an instant is on: `x` draws down the box (a horizontal axis), `y` across it (a vertical one). */\nexport type NowAlong = \"x\" | \"y\";\n\n/** Data attributes a host puts on a part. */\ntype DataAttributes = { [name: `data-${string}`]: string | boolean | undefined };\n\n/** {@link NowLine}'s props. */\nexport type NowLineProps = DataAttributes & {\n    /** The host recipe's styles: its `nowLine` and `nowDot` slots. */\n    styles: Styles;\n    /** Where now is, as a fraction of the box along the axis: 0 to 1. */\n    at: number;\n    /** The axis the instant is on: `x` when omitted. */\n    along?: NowAlong | undefined;\n    /** Whether a dot marks the line's start. */\n    dot?: boolean | undefined;\n};\n\n/**\n * The line (see the module docs).\n *\n * @param props - See {@link NowLineProps}\n * @returns The line\n */\nexport function NowLine({ styles, at, along = \"x\", dot, ...data }: NowLineProps) {\n    const position = `${at * 100}%`;\n    return (\n        <Box css={styles.nowLine} data-along={along} style={along === \"x\" ? { left: position } : { top: position }} {...data}>\n            {dot === true && <Box css={styles.nowDot} />}\n        </Box>\n    );\n}\n\n/** {@link NowChip}'s props. */\nexport type NowChipProps = DataAttributes & {\n    /** The host recipe's styles: its `nowChip` slot. */\n    styles: Styles;\n    /** Where now is, as a fraction of the box along the axis: 0 to 1. */\n    at: number;\n    /** The axis the instant is on: `x` when omitted. */\n    along?: NowAlong | undefined;\n    /**\n     * On an `x` axis, where the chip sits across the instant, as its own\n     * horizontal translation: centred (`-50%`) unless the host keeps it\n     * inside a clipped band at either end, as Plan's ruler does.\n     */\n    anchor?: string | undefined;\n    /** What the instant is called. */\n    children: ReactNode;\n};\n\n/**\n * The chip (see the module docs).\n *\n * @param props - See {@link NowChipProps}\n * @returns The chip\n */\nexport function NowChip({ styles, at, along = \"x\", anchor, children, ...data }: NowChipProps) {\n    const position = `${at * 100}%`;\n    return along === \"x\"\n        ? (\n            <Box css={styles.nowChip} data-along=\"x\" {...data}\n                style={anchor !== undefined ? { left: position, transform: `translate(${anchor}, -50%)` } : { left: position }}>\n                {children}\n            </Box>\n        )\n        : <Box css={styles.nowChip} data-along=\"y\" style={{ top: position }} {...data}>{children}</Box>;\n}\n\n/**\n * The instant now is: the host's when it gives one (a test or a showcase pins\n * it), else the clock, read again at each whole `every` (a minute by default).\n *\n * @param given - The host's now, if any\n * @param every - How often the clock is read again, in ms\n * @returns Now\n */\nexport function useNow(given: Date | undefined, every: number = 60_000): Date {\n    const [clock, setClock] = useState(() => new Date());\n    useEffect(() => {\n        if (given !== undefined) return undefined;\n        let timer: ReturnType<typeof setTimeout> | undefined;\n        const read = (): void => {\n            const now = new Date();\n            setClock(now);\n            timer = setTimeout(read, every - (now.getTime() % every));\n        };\n        read();\n        return () => { if (timer !== undefined) clearTimeout(timer); };\n    }, [given, every]);\n    return given ?? clock;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * When a builder's backlog events are due, and how long a template or a\n * backlog event takes (#1195): what a builder's library pane groups and\n * labels its cards by — the Plan's (`Plan Builder Spec.md` PB27, PB28), and\n * the Calendar's (`Calendar Spec.md` B18, B20), which shares the kinds.\n *\n * Days and weeks are UTC, as every instant on a builder's axis is (#326),\n * and a week starts on Monday, as the ruler's ISO weeks do.\n *\n * @packageDocumentation\n */\n\nimport { DateTimeType, compareFor, match, type ValueTypeOf } from \"@elaraai/east\";\nimport { Schedule } from \"@elaraai/e3-ui/internal\";\n\n/** How long something takes, decoded — `Schedule.Types.Duration`. */\nexport type ScheduleDurationValue = ValueTypeOf<typeof Schedule.Types.Duration>;\n\n/** When a backlog event is due, as a library's Backlog tab groups it. */\nexport type DueGroup = \"thisWeek\" | \"nextWeek\" | \"later\" | \"none\";\n\n/** The groups, in the order the tab lists them. */\nexport const DUE_GROUPS: readonly DueGroup[] = [\"thisWeek\", \"nextWeek\", \"later\", \"none\"];\n\nconst DAY_MS = 86_400_000;\nconst WEEK_MS = 7 * DAY_MS;\nconst compareDateTime = compareFor(DateTimeType);\n\n/**\n * The Monday, 00:00 UTC, that begins the week a moment is in.\n *\n * @param at - The moment\n * @returns Its week's first instant\n */\nexport function weekStartUTC(at: Date): Date {\n    const day = Date.UTC(at.getUTCFullYear(), at.getUTCMonth(), at.getUTCDate());\n    // Mon = 1 … Sun = 7, as the ruler's ISO weeks count them.\n    const weekday = new Date(day).getUTCDay() || 7;\n    return new Date(day - (weekday - 1) * DAY_MS);\n}\n\n/**\n * The group a backlog event falls in by when it is due, counted from the week\n * `now` is in: due before the next week begins — overdue included, as it is\n * due now — this week; before the week after, next week; any later, later;\n * with no due date, none.\n *\n * @param due - When it is due, if it is\n * @param now - The moment the weeks are counted from\n * @returns Its group\n */\nexport function dueGroupOf(due: Date | undefined, now: Date): DueGroup {\n    if (due === undefined) return \"none\";\n    const next = new Date(weekStartUTC(now).getTime() + WEEK_MS);\n    if (compareDateTime(due, next) < 0) return \"thisWeek\";\n    return compareDateTime(due, new Date(next.getTime() + WEEK_MS)) < 0 ? \"nextWeek\" : \"later\";\n}\n\n/**\n * A duration in whole minutes, as a kind counts a backlog event's: a month is\n * 30 days.\n *\n * @param step - The duration\n * @returns Its minutes, rounded half up\n */\nexport function durationMinutes(step: ScheduleDurationValue): number {\n    return Math.round(match(step, {\n        minutes: (n) => n,\n        hours: (n) => n * 60,\n        days: (n) => n * 1_440,\n        weeks: (n) => n * 10_080,\n        months: (n) => n * 43_200,\n    }));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** UTC calendar steps shared by scale, navigation and Node-safe window models. */\n/** A calendar resolution: the period a time scale cuts its window into. */\nexport type TimeResolution = \"hour\" | \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\";\n\nconst HOUR_MS = 3_600_000;\nconst DAY_MS = 86_400_000;\n\n/**\n * A UTC date `months` calendar months on, its day clamped to the target\n * month's last: Jan 31 plus one month is Feb 28 (or 29), never Mar 3.\n *\n * @param d - The date\n * @param months - The signed number of months\n * @returns The date, at the same time of day\n */\nexport function addMonthsClamped(d: Date, months: number): Date {\n    const total = d.getUTCMonth() + months;\n    const year = d.getUTCFullYear() + Math.floor(total / 12);\n    const month = ((total % 12) + 12) % 12;\n    const days = new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n    return new Date(Date.UTC(\n        year, month, Math.min(d.getUTCDate(), days),\n        d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds(),\n    ));\n}\n\n/**\n * A UTC date `k` of a resolution's periods on, by the calendar: an element\n * moved a month keeps its day of the month (clamped), an hour or a week keeps\n * its time.\n *\n * @param d - The date\n * @param res - The resolution\n * @param k - The signed number of periods\n * @returns The date\n */\nexport function shiftCalendar(d: Date, res: TimeResolution, k: number): Date {\n    switch (res) {\n        case \"hour\": return new Date(d.getTime() + k * HOUR_MS);\n        case \"day\": return new Date(d.getTime() + k * DAY_MS);\n        case \"week\": return new Date(d.getTime() + k * 7 * DAY_MS);\n        case \"month\": return addMonthsClamped(d, k);\n        case \"quarter\": return addMonthsClamped(d, 3 * k);\n        case \"year\": return addMonthsClamped(d, 12 * k);\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n/** Shared UTC boundaries for Calendar and Roster. */\nexport const DAY = 86_400_000;\n/** Main-panel width at which scheduling builders use explicit-action cards. */\nexport const NARROW_WIDTH = 480;\n/** The start of a UTC day. */\nexport function dayStart(date: Date | number): Date {\n    const value = typeof date === \"number\" ? new Date(date) : date;\n    return new Date(Date.UTC(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate()));\n}\n/** The first day of a week, without local-time or daylight-saving shifts. */\nexport function weekStart(date: Date, sunday: boolean): Date {\n    const day = dayStart(date);\n    const offset = (day.getUTCDay() + (sunday ? 0 : 6)) % 7;\n    return new Date(day.getTime() - offset * DAY);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Calendar's UTC windows and projected data; no UI or record writes. */\nimport { DateTimeType, SortedSet, StringType, compareFor, equalFor, parseFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { CalendarPayloadType, ScheduleEventRefType, ScheduleResourceRefType } from \"@elaraai/e3-ui/internal\";\nimport type { Formatters } from \"@elaraai/east-ui-components\";\nimport { shiftCalendar } from \"../shared/time/calendar-math.js\";\nimport { type ScheduleItemValue } from \"../shared/schedule/overlaps.js\";\n\n/** Calendar's closed payload, decoded. */\nexport type CalendarValue = ValueTypeOf<typeof CalendarPayloadType>;\n/** A bound event kind. */\nexport type CalendarKind = CalendarValue[\"events\"][number];\n/** An event's shared projection. */\nexport type CalendarItem = ScheduleItemValue;\n/** The resource an event is on. */\nexport type CalendarResource = ValueTypeOf<typeof ScheduleResourceRefType>;\n/** An event's identity, independent of its position or record's key type. */\nexport type CalendarRef = ValueTypeOf<typeof ScheduleEventRefType>;\n/** One template, as its record mapping projected it. */\nexport type CalendarTemplate = CalendarKind[\"templates\"][number];\n/** A persisted view uses an epoch, since local storage serializes JSON. */\nexport interface CalendarView {\n    layout: CalendarValue[\"settings\"][\"layout\"][\"type\"];\n    period: CalendarValue[\"settings\"][\"period\"][\"type\"];\n    date: number;\n}\n/** The rendered period and its days. */\nexport interface CalendarRange { from: Date; to: Date; days: readonly Date[] }\n/** A resource column/row. Unassigned has no resource ref. */\nexport interface CalendarRow { key: string; label: string; meta: string; group: string; icon?: string; resource: CalendarItem[\"resource\"] }\n/**\n * What the Calendar's figures leave out (#1424): the kinds past the cap, none of whose events is drawn but their drafts\n * — their names, as running text writes them — and the resource kinds they are placed on, whose resources' figures\n * count none of them. A figure that would count them says they are not counted, never 0.\n */\nexport interface CalendarUncounted {\n    /** The kinds' names, as running text writes them: `print job`. */\n    readonly names: readonly string[];\n    /** Whether every kind is among them: a figure then counts no event at all, and says no number. */\n    readonly all: boolean;\n    /** The resource kinds they are placed on, by slot. */\n    readonly resources: ReadonlySet<string>;\n}\n/** No kind past the cap: every figure counts every kind. */\nexport const NOTHING_UNCOUNTED: CalendarUncounted = { names: [], all: false, resources: new Set() };\n/** A slot recipe's styles. */\nexport type CalendarStyles = Record<string, Record<string, unknown>>;\n\nimport { DAY, dayStart, weekStart } from \"../shared/schedule/window.js\";\nexport { DAY, NARROW_WIDTH, dayStart, weekStart } from \"../shared/schedule/window.js\";\n/** A calendar gesture's smallest span. */\nexport const QUARTER = 15 * 60_000;\n/** Canonical ids avoid collisions across record kinds and arbitrary keys. */\nexport const eventKey = printFor(ScheduleEventRefType);\n/** Resource ids use the shared East codec, not delimiter concatenation. */\nexport const resourceKey = printFor(ScheduleResourceRefType);\n/** Reads an event id as its shared East type. */\nexport const parseEventKey = parseFor(ScheduleEventRefType);\n/** Reads a resource id as its shared East type. */\nexport const parseResourceKey = parseFor(ScheduleResourceRefType);\n/** Drag coordinates use East's DateTime representation. */\nexport const timeKey = printFor(DateTimeType);\n/** Reads a drag coordinate. */\nexport const parseTimeKey = parseFor(DateTimeType);\n/** Resource equality is the record contract's equality. */\nexport const sameResource = equalFor(ScheduleResourceRefType);\nconst compareDate = compareFor(DateTimeType);\nconst compareRef = compareFor(ScheduleEventRefType);\nconst compareString = compareFor(StringType);\n\n/** Calendar days including the surrounding weeks of a month. */\nexport function calendarRange(view: CalendarView, settings: CalendarValue[\"settings\"]): CalendarRange {\n    const current = dayStart(view.date);\n    const period = view.layout === \"resources\" ? \"day\" : view.period;\n    let from = current;\n    let to = new Date(from.getTime() + DAY);\n    if (period === \"week\") {\n        from = weekStart(current, settings.weekStart.type === \"sunday\");\n        to = new Date(from.getTime() + 7 * DAY);\n    } else if (period === \"month\") {\n        from = new Date(Date.UTC(current.getUTCFullYear(), current.getUTCMonth(), 1));\n        to = new Date(Date.UTC(current.getUTCFullYear(), current.getUTCMonth() + 1, 1));\n        if (view.layout === \"calendar\") {\n            from = weekStart(from, settings.weekStart.type === \"sunday\");\n            const final = weekStart(new Date(to.getTime() - 1), settings.weekStart.type === \"sunday\");\n            to = new Date(final.getTime() + 7 * DAY);\n        }\n    }\n    const days: Date[] = [];\n    for (let at = from.getTime(); at < to.getTime(); at += DAY) {\n        const day = new Date(at);\n        if (period === \"day\" || settings.weekends || (day.getUTCDay() !== 0 && day.getUTCDay() !== 6)) days.push(day);\n    }\n    return { from, to, days };\n}\n/**\n * The periods either side of the view, read ahead once its window lands\n * (#1398, CL7): the ranges a step to the next and the previous period reads,\n * on every layout — the timeline's among them, which shows its period as the\n * others do (ruled 9 Nov 2026).\n *\n * @param view - The view\n * @param settings - The Calendar's settings: its week's first day and its weekends\n * @returns The next period's range, then the previous one's\n */\nexport function calendarAhead(view: CalendarView, settings: CalendarValue[\"settings\"]): readonly CalendarRange[] {\n    return [calendarRange(navigate(view, 1), settings), calendarRange(navigate(view, -1), settings)];\n}\n/**\n * The period a window is, as the footer's loading line names it (#1398, CL3):\n * where the window is the view's own period, a day's name or a month's —\n * `Tue, Nov 3, 2026`, `November 2026` — else its days, from its first to its\n * last: a week, or a range the slice holds.\n *\n * @param view - The view\n * @param range - The window read\n * @param settings - The Calendar's settings: its week's first day and its weekends\n * @param format - The locale's formatters\n * @returns The period's words\n */\nexport function periodWords(view: CalendarView, range: CalendarRange, settings: CalendarValue[\"settings\"],\n    format: Pick<Formatters, \"weekdayDate\" | \"monthYear\" | \"range\">): string {\n    const own = calendarRange(view, settings);\n    const period = view.layout === \"resources\" ? \"day\" : view.period;\n    const same = compareDate(range.from, own.from) === 0 && compareDate(range.to, own.to) === 0;\n    if (same && period === \"day\") return format.weekdayDate(range.from);\n    if (same && period === \"month\") return format.monthYear(dayStart(view.date));\n    return format.range(range.from, new Date(range.to.getTime() - 1));\n}\n/** Previous/next period, with resource columns retaining one day. */\nexport function navigate(view: CalendarView, step: number): CalendarView {\n    const date = new Date(view.date);\n    const period = view.layout === \"resources\" ? \"day\" : view.period;\n    return { ...view, date: shiftCalendar(date, period, step).getTime() };\n}\n/** Whether a scheduled event intersects a half-open window. */\nexport function inWindow(item: CalendarItem, from: Date, to: Date): boolean {\n    return item.start.type === \"some\" && item.end.type === \"some\"\n        && compareDate(item.start.value, to) < 0\n        && (compareDate(item.end.value, from) > 0 || compareDate(item.start.value, from) >= 0);\n}\n/** Stable chronological order, including a tie-break across record kinds. */\nexport function chronological(items: readonly CalendarItem[]): CalendarItem[] {\n    return [...items].sort((a, b) => {\n        const time = a.start.type === \"some\" && b.start.type === \"some\" ? compareDate(a.start.value, b.start.value) : 0;\n        return time || compareRef(a, b);\n    });\n}\n/**\n * What a resource Chooser offers (#1343): each kind's rows the rail shows and,\n * whatever it hides, the rows `keep` names — an event's own resource stays\n * choosable, in the kind's order.\n *\n * @param all - Every resource kind, every row\n * @param shown - Each kind's rows the rail shows\n * @param keep - The rows to offer whatever the rail shows\n * @returns Each kind with the rows its Chooser offers\n */\nexport function resourceChoices(all: CalendarValue[\"resources\"], shown: CalendarValue[\"resources\"], keep: readonly CalendarResource[]): CalendarValue[\"resources\"] {\n    return all.map((kind, i) => {\n        const offered = shown[i]?.rows ?? kind.rows;\n        if (offered.length === kind.rows.length) return kind;\n        const shows = new SortedSet(offered.map(row => row.key), compareString);\n        return { ...kind, rows: kind.rows.filter(row => shows.has(row.key)\n            || keep.some(ref => sameResource(ref, { kind: kind.key, key: row.key }))) };\n    });\n}\n/** Whether an event is on a row, including the unassigned row. */\nexport function onResource(item: CalendarItem, row: CalendarRow): boolean {\n    return item.resource.type === \"none\" ? row.resource.type === \"none\"\n        : row.resource.type === \"some\" && sameResource(item.resource.value, row.resource.value);\n}\n/**\n * The resource an event is on, by name, wherever the Calendar names it — the views and a Backlog card: its row's label;\n * a resource no row the frame holds names — a paged kind's whose window is not read (#1424) — by its key, never\n * \"Unassigned\", which is an event on no resource's.\n *\n * @param item - The event\n * @param rows - Every resource row the frame holds: each kind's, a paged kind's of the windows held, and the unassigned one\n * @returns Its resource's name\n */\nexport function resourceLabel(item: CalendarItem, rows: readonly CalendarRow[]): string {\n    const row = rows.find(row => onResource(item, row));\n    if (row !== undefined) return row.label;\n    return item.resource.type === \"some\" ? item.resource.value.key : \"Unassigned\";\n}\n/** A UTC time, used in fixed-size grid labels and editable time fields. */\nexport function clockText(date: Date): string { return date.toISOString().slice(11, 16); }\n/** A UTC date, used in date fields. */\nexport function dateText(date: Date): string { return date.toISOString().slice(0, 10); }\n/** Parses only a complete valid UTC date/time from an action form. */\nexport function inputInstant(date: string, time: string): Date | undefined {\n    if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(date) || !/^\\d{2}:\\d{2}$/.test(time)) return undefined;\n    const value = new Date(`${date}T${time}:00.000Z`);\n    return Number.isFinite(value.getTime()) && dateText(value) === date && clockText(value) === time ? value : undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** One command path for desktop gestures and explicit agenda actions. */\nimport { DateTimeType, compareFor, encodeBeast2For, fromEastTypeValue, none, some, variant, type StructType } from \"@elaraai/east\";\nimport type { Origin } from \"@elaraai/east-ui-components\";\nimport type { ScheduleChange, ScheduleEditing } from \"../shared/schedule/editing.js\";\nimport { durationMinutes } from \"../shared/schedule/due.js\";\nimport { lowerWord } from \"../shared/schedule/words.js\";\nimport {\n    QUARTER, resourceKey, type CalendarItem, type CalendarKind, type CalendarRef, type CalendarResource, type CalendarRow, type CalendarTemplate, type CalendarValue,\n} from \"./model.js\";\n\nconst compareDate = compareFor(DateTimeType);\n\n/** A placement proposed by a form, a drop or a draw gesture. */\nexport interface CalendarPlacement {\n    start: Date;\n    end: Date;\n    resource: CalendarItem[\"resource\"];\n}\n/** A source to create from or to schedule/move. */\nexport type CalendarSource = { kind: CalendarKind; template: CalendarTemplate } | { kind: CalendarKind; item: CalendarItem };\n/** The editor used by views, library and inspector. */\nexport interface CalendarCommands {\n    editing: ScheduleEditing;\n    place(source: CalendarSource, placement: CalendarPlacement, origin?: Origin, checkOnly?: boolean): string | undefined;\n    move(items: readonly CalendarItem[], delta: number, resource?: CalendarItem[\"resource\"], checkOnly?: boolean): string | undefined;\n    remove(items: readonly CalendarItem[]): void;\n    unschedule(items: readonly CalendarItem[], checkOnly?: boolean): string | undefined;\n    duplicate(items: readonly CalendarItem[]): string | undefined;\n    status(items: readonly CalendarItem[], name: string): string | undefined;\n    field(item: CalendarItem, path: readonly string[], value: unknown): void;\n    patch(items: readonly CalendarItem[], fields: readonly { path: readonly string[]; value: Uint8Array }[]): void;\n}\n\n/** Default placement used by both the library's form and whole-day drops. */\nexport function initialPlacement(source: CalendarSource, day: Date): CalendarPlacement {\n    const template = \"template\" in source ? source.template : undefined;\n    const item = \"item\" in source ? source.item : undefined;\n    const start = item?.start.type === \"some\" ? item.start.value : new Date(day);\n    if (item?.start.type !== \"some\") {\n        const at = template?.at.type === \"some\" ? template.at.value : { hour: 9n, minute: 0n };\n        start.setUTCHours(Number(at.hour), Number(at.minute), 0, 0);\n    }\n    const minutes = template === undefined ? Number(item?.minutes ?? 60n) : durationMinutes(template.duration);\n    return { start, end: item?.end.type === \"some\" ? item.end.value : new Date(start.getTime() + Math.max(15, minutes) * 60_000), resource: item?.resource ?? none };\n}\n\n/**\n * The paged resource kind's resources the frame holds (#1424), as a creation with no resource may land on one: the rows\n * of the windows held, in the kind's order, and the resources among them whose events are read, which alone can be said\n * to be free — every one where the kind's events are read over the window (`known` undefined).\n */\nexport interface CalendarPagedRows {\n    readonly rows: readonly CalendarRow[];\n    readonly known: ReadonlySet<string> | undefined;\n}\n/** No paged kind's resource held. */\nconst NO_PAGED_ROWS: CalendarPagedRows = { rows: [], known: undefined };\n\n/**\n * Commands write through the shared Schedule seams and one EditHistory. Their checks read every resource, whatever\n * the rail hides; a creation with no resource lands on one the rail shows (`shown`, #1343) — of a paged kind, one of the\n * windows the frame holds (`paged`, #1424).\n */\nexport function calendarCommands(value: CalendarValue, editing: ScheduleEditing, select: (refs: CalendarRef[]) => void, scheduled: readonly CalendarItem[] = [],\n    shown: CalendarValue[\"resources\"] = value.resources, paged: CalendarPagedRows = NO_PAGED_ROWS): CalendarCommands {\n    const kindOf = (item: CalendarItem) => value.events.find(kind => kind.key === item.kind);\n    const validate = (source: CalendarSource, at: CalendarPlacement): string | undefined => {\n        const { kind } = source;\n        if (!editing.available(kind.key)) return `${kind.name} is not ready to edit`;\n        if (!Number.isFinite(at.start.getTime()) || !Number.isFinite(at.end.getTime()) || at.end.getTime() - at.start.getTime() < QUARTER) return \"An event must last at least 15 minutes\";\n        if (at.resource.type === \"some\") {\n            const ref = at.resource.value;\n            if (!kind.takes.includes(ref.kind)) return `Needs ${kind.takes.map(key => value.resources.find(resource => resource.key === key)?.name ?? key).join(\" or \")}`;\n            // A paged kind's resources come a window at a time (#1424): one is chosen from a window held, or by its key.\n            const paged = value.paged.type === \"some\" && value.paged.value.kind === ref.kind;\n            if (!paged && !value.resources.some(resource => resource.key === ref.kind && resource.rows.some(row => row.key === ref.key))) return \"This resource is no longer available\";\n        }\n        if (value.canDrop.type === \"some\") {\n            const from = \"template\" in source ? variant(\"template\", source.template.key)\n                : source.item.start.type === \"none\" ? variant(\"backlog\", source.item.key) : variant(\"event\", source.item.key);\n            try {\n                const refusal = value.canDrop.value({ kind: kind.key, from, ...at });\n                if (refusal.type === \"some\") return refusal.value;\n            } catch { return \"The placement check failed\"; }\n        }\n        return undefined;\n    };\n    const checkedWrite = (kind: CalendarKind, id: string, gesture: Extract<ScheduleChange, { gesture: unknown }>[\"gesture\"]): string | undefined => {\n        const row = gesture.type === \"create\" ? new Uint8Array(0) : editing.read(kind.key, id)?.row;\n        if (row === undefined) return \"This event is still loading or has been removed\";\n        try { if (kind.write([{ id, entry: row, gesture }])[0]?.type !== \"some\") return \"This event cannot use that placement\"; }\n        catch { return \"This event cannot use that placement\"; }\n        return undefined;\n    };\n    // The key a check of a template's placement makes its event under, minted once a template while these commands stand\n    // — the record and the drafts they were made over — so a drag checking each place it rests on never walks the record's\n    // keys at each (#1594); one not mintable yet is asked again. A placement made mints its own.\n    const checkKeys = new Map<string, Map<string, string>>();\n    const keyFor = (kind: string, template: string, checkOnly: boolean): string | undefined => {\n        if (!checkOnly) return editing.mint(kind, template, new Set());\n        const held = checkKeys.get(kind)?.get(template);\n        if (held !== undefined) return held;\n        const minted = editing.mint(kind, template, new Set());\n        if (minted !== undefined) {\n            let ofKind = checkKeys.get(kind);\n            if (ofKind === undefined) { ofKind = new Map(); checkKeys.set(kind, ofKind); }\n            ofKind.set(template, minted);\n        }\n        return minted;\n    };\n    return {\n        editing,\n        place(source, given, origin = \"typed\", checkOnly = false) {\n            const at = given.resource.type === \"none\" && (\"template\" in source || source.item.start.type === \"none\")\n                ? { ...given, resource: firstResource({ ...value, resources: shown }, source.kind, given, scheduled, paged) } : given;\n            const refusal = validate(source, at); if (refusal !== undefined) return refusal;\n            const creating = \"template\" in source;\n            const id = creating ? keyFor(source.kind.key, source.template.key, checkOnly) : source.item.key;\n            if (id === undefined) return \"This record's key type needs an application-provided new key\";\n            const gesture = creating ? variant(\"create\", { template: source.template.key, ...at }) : variant(\"place\", at);\n            const refused = checkedWrite(source.kind, id, gesture); if (refused !== undefined) return refused;\n            if (!checkOnly && editing.record([{ kind: source.kind.key, id, gesture }], creating ? \"insert\" : origin,\n                `${creating ? \"Create\" : \"Schedule\"} ${creating ? source.template.name : source.item.title}`)) select([{ kind: source.kind.key, key: id }]);\n            return undefined;\n        },\n        move(items, delta, resource, checkOnly = false) {\n            const changes: ScheduleChange[] = [];\n            for (const item of items) {\n                const kind = kindOf(item);\n                if (kind === undefined || item.start.type !== \"some\" || item.end.type !== \"some\") return \"This event is not scheduled\";\n                const at = { start: new Date(item.start.value.getTime() + delta), end: new Date(item.end.value.getTime() + delta), resource: resource ?? item.resource };\n                const refused = validate({ kind, item }, at) ?? checkedWrite(kind, item.key, variant(\"place\", at));\n                if (refused !== undefined) return refused;\n                changes.push({ kind: item.kind, id: item.key, gesture: variant(\"place\", at) });\n            }\n            if (!checkOnly) editing.record(changes, \"move\", `Move ${items.length} events`);\n            return undefined;\n        },\n        remove(items) { if (editing.record(items.map(item => ({ kind: item.kind, id: item.key, remove: true })), \"remove\", `Delete ${items.length} events`)) select([]); },\n        unschedule(items, checkOnly = false) {\n            for (const item of items) {\n                const kind = kindOf(item);\n                if (kind === undefined || !kind.backlog) return `This event kind has no ${lowerWord(value.vocabulary.backlog)}`;\n                if (!editing.available(item.kind)) return `${kind.name} is not ready to edit`;\n                const refused = checkedWrite(kind, item.key, variant(\"unplace\", null));\n                if (refused !== undefined) return refused;\n            }\n            if (!checkOnly) editing.record(items.map(item => ({ kind: item.kind, id: item.key, gesture: variant(\"unplace\", null) })), \"move\", `Return ${items.length} events to ${lowerWord(value.vocabulary.backlog)}`);\n            return undefined;\n        },\n        duplicate(items) {\n            const changes: ScheduleChange[] = []; const refs: CalendarRef[] = []; const minted = new Set<string>();\n            for (const item of items) {\n                const kind = kindOf(item); const read = editing.read(item.kind, item.key);\n                const id = editing.mint(item.kind, item.key, minted);\n                if (kind === undefined || read === undefined || id === undefined) return \"This event cannot be duplicated yet\";\n                if (!editing.available(kind.key)) return `${kind.name} is not ready to edit`;\n                if (item.start.type === \"some\" && item.end.type === \"some\") {\n                    const at = { start: item.end.value, end: new Date(2 * item.end.value.getTime() - item.start.value.getTime()), resource: item.resource };\n                    const refusal = validate({ kind, item }, at);\n                    if (refusal !== undefined) return refusal;\n                    if (kind.write([{ id, entry: read.row, gesture: variant(\"place\", at) }])[0]?.type !== \"some\") return \"This copy cannot use that placement\";\n                }\n                minted.add(id);\n                changes.push({ kind: item.kind, id, row: read.row, created: true });\n                if (item.start.type === \"some\" && item.end.type === \"some\") changes.push({ kind: item.kind, id, gesture: variant(\"place\", {\n                    start: item.end.value, end: new Date(2 * item.end.value.getTime() - item.start.value.getTime()), resource: item.resource,\n                }) });\n                if (kind.schedule.status.type === \"some\" && kind.status[0] !== undefined) {\n                    const rowType = fromEastTypeValue(kind.editing.entryType) as StructType;\n                    const field = kind.schedule.status.value;\n                    changes.push({ kind: item.kind, id, gesture: variant(\"field\", { path: [field], value: encodeBeast2For(rowType.fields[field]!)(variant(kind.status[0].case, null) as never) }) });\n                }\n                refs.push({ kind: item.kind, key: id });\n            }\n            if (editing.record(changes, \"insert\", `Duplicate ${items.length} events`)) select(refs);\n            return undefined;\n        },\n        status(items, name) {\n            const changes: ScheduleChange[] = [];\n            for (const item of items) {\n                const kind = kindOf(item);\n                if (kind === undefined || kind.schedule.status.type === \"none\" || !kind.status.some(status => status.case === name)) return \"The selection does not share that status\";\n                if (!editing.available(kind.key)) return `${kind.name} is not ready to edit`;\n                const path = kind.schedule.status.value;\n                const rowType = fromEastTypeValue(kind.editing.entryType) as StructType;\n                changes.push({ kind: kind.key, id: item.key, gesture: variant(\"field\", { path: [path], value: encodeBeast2For(rowType.fields[path]!)(variant(name, null) as never) }) });\n            }\n            editing.record(changes, \"typed\", `Set status of ${items.length} events`);\n            return undefined;\n        },\n        field(item, path, next) {\n            const kind = kindOf(item); if (kind === undefined) return;\n            const spec = kind.fields.find(field => field.path.length === path.length && field.path.every((part, i) => part === path[i]));\n            const rowType = fromEastTypeValue(kind.editing.entryType) as StructType;\n            const type = spec?.type ?? (path.length === 1 ? rowType.fields[path[0]!] : undefined);\n            if (type === undefined) return;\n            editing.record([{ kind: item.kind, id: item.key, gesture: variant(\"field\", { path: [...path], value: encodeBeast2For(type)(next as never) }) }], \"typed\", `Edit ${item.title}`);\n        },\n        patch(items, fields) {\n            const changes = items.flatMap(item => fields.map(field => ({ kind: item.kind, id: item.key,\n                gesture: variant(\"field\", { path: [...field.path], value: field.value }) })));\n            editing.record(changes, \"drop\", `Update ${items.length} events`);\n        },\n    };\n}\n\n/**\n * A creation without a resource uses the first compatible free row, then the first compatible row — of a paged kind\n * (#1424), whose rows come a window at a time, those of the windows the frame holds, free only where their events are\n * read.\n *\n * @param value - The payload, each kind's rows those a creation may land on\n * @param kind - The event kind created\n * @param at - When the event is\n * @param items - The events read: what makes a row busy then\n * @param paged - The paged kind's rows the frame holds, and those whose events are read\n * @returns The resource it lands on; none where no row is compatible\n */\nexport function firstResource(value: CalendarValue, kind: CalendarKind, at: Pick<CalendarPlacement, \"start\" | \"end\">, items: readonly CalendarItem[],\n    paged: CalendarPagedRows = NO_PAGED_ROWS): CalendarItem[\"resource\"] {\n    const pagedKind = value.paged.type === \"some\" ? value.paged.value.kind : undefined;\n    const resources = value.resources.filter(resource => kind.takes.includes(resource.key)).flatMap((resource): CalendarResource[] => resource.key === pagedKind\n        ? paged.rows.flatMap(row => row.resource.type === \"some\" && row.resource.value.kind === pagedKind ? [row.resource.value] : [])\n        : resource.rows.map(row => ({ kind: resource.key, key: row.key })));\n    // A row is free when no event read is on it then — a paged kind's only where its events are read. The rows busy then\n    // are found in one pass over the events, never the events walked again for each row (#1594).\n    const known = (resource: CalendarResource) => resource.kind !== pagedKind || paged.known === undefined || paged.known.has(resource.key);\n    const busy = new Set<string>();\n    for (const item of items) {\n        if (item.resource.type === \"some\" && item.start.type === \"some\" && item.end.type === \"some\"\n            && compareDate(item.start.value, at.end) < 0 && compareDate(item.end.value, at.start) > 0) busy.add(resourceKey(item.resource.value));\n    }\n    const free = resources.find(resource => known(resource) && !busy.has(resourceKey(resource)));\n    const selected = free ?? resources[0];\n    return selected === undefined ? none : some(selected);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a builder's rail hides of its event kinds' backlog (#1343, #1344): each\n * backlog kind narrowed through its source of the slice reads its unscheduled\n * events by its source's choices but its window — a backlog event has no time\n * — so the Backlog tab counts `N of M`, what shows beside the stored events\n * those choices hide, two index counts a kind, and its Clear filters clears\n * those choices alone, each source keeping its window. The Calendar's and the\n * Plan's Backlog tabs read it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo } from \"react\";\nimport { DateTimeType, OptionType, SortedMap, StringType, compareFor, equalFor, none, printFor, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType, RecordSliceChoiceType, RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { useSlicesReactivity, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\n\n/** One record Slice's controls. */\ntype Bind = ValueTypeOf<RecordSliceBindType>;\n\nconst stringEqual = equalFor(StringType);\nconst compareString = compareFor(StringType);\n/** A backlog kind's start unset, as the record Slice writes the choice and its index keys it: the kind's backlog. */\nconst UNSET: ValueTypeOf<RecordSliceChoiceType> = variant(\"values\", [printFor(OptionType(DateTimeType))(none)]);\n\n/** An event kind narrowed through its source of the slice: the kind — its key, whether it has a backlog and its start field — and its part. */\nexport interface BacklogPart {\n    /** The event kind. */\n    readonly kind: { readonly key: string; readonly backlog: boolean; readonly schedule: { readonly start: string } };\n    /** Its source's part of the slice. */\n    readonly part: Bind;\n}\n\n/** What the rail hides of the backlog. */\nexport interface BacklogNarrowing<P extends BacklogPart = BacklogPart> {\n    /** The backlog kinds whose source's choices — its window aside, which the backlog never reads — narrow their backlog. */\n    readonly narrowing: readonly P[];\n    /** The stored unscheduled events those choices hide; `undefined` while a count is read, or none narrows. */\n    readonly hidden: number | undefined;\n    /** Whether a count of what those choices hide is being read: `hidden` is `undefined` meanwhile. */\n    readonly counting: boolean;\n    /** Clears those choices, each source keeping its window; `undefined` while none narrows. */\n    readonly clear: (() => void) | undefined;\n}\n\n/**\n * A source's choices but its start's, its start Unset: what lists its backlog.\n *\n * @param where - The source's narrowing\n * @param start - The kind's start field\n * @returns The narrowing its backlog is read under\n */\nexport function backlogWhere(where: ValueTypeOf<RecordSliceWhereType>, start: string): SortedMap<string, ValueTypeOf<RecordSliceChoiceType>> {\n    const kept = new SortedMap([...where].filter(([field]) => !stringEqual(field, start)), compareString);\n    kept.set(start, UNSET);\n    return kept;\n}\n\n/**\n * A kind's start Unset alone: every unscheduled event its record holds, whatever its source's choices.\n *\n * @param start - The kind's start field\n * @returns The narrowing\n */\nexport function backlogWhole(start: string): SortedMap<string, ValueTypeOf<RecordSliceChoiceType>> {\n    return new SortedMap([[start, UNSET]], compareString);\n}\n\n/**\n * What the rail hides of the backlog (see the module docs).\n *\n * @param eventParts - Each event kind narrowed through its source\n * @returns The narrowing kinds, what they hide and how they clear\n */\nexport function useBacklogNarrowing<P extends BacklogPart>(eventParts: readonly P[]): BacklogNarrowing<P> {\n    const parts = useMemo(() => eventParts.filter(({ kind }) => kind.backlog), [eventParts]);\n    const version = useSlicesReactivity(parts.map(({ part }) => part.key));\n    const narrowing = useMemo(() => parts.filter(({ kind, part }) => [...part.read().where.keys()].some(field => !stringEqual(field, kind.schedule.start))),\n        // `version` moves with each source's choices.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [parts, version]);\n    const read = useCallback(() => {\n        let hidden = 0n;\n        for (const { kind, part } of narrowing) {\n            const start = kind.schedule.start;\n            // Each a read of a narrowing alone, never a read by area (#1432).\n            const all = part.countWhere({ where: backlogWhole(start), area: none });\n            const shown = part.countWhere({ where: backlogWhere(part.read().where, start), area: none });\n            if (all.type === \"none\" || shown.type === \"none\") return none;\n            hidden += all.value - shown.value;\n        }\n        return some(hidden);\n    }, [narrowing]);\n    const { result } = useTrackedEvaluation(read);\n    const clear = useMemo(() => narrowing.length === 0 ? undefined : () => {\n        for (const { kind, part } of narrowing) {\n            const state = part.read();\n            const window = new SortedMap([...state.where].filter(([field]) => stringEqual(field, kind.schedule.start)), compareString);\n            part.write({ ...state, where: window, preset: none });\n        }\n    }, [narrowing]);\n    const hidden = narrowing.length > 0 && result.ok && result.value.type === \"some\" ? Number(result.value.value) : undefined;\n    const counting = narrowing.length > 0 && result.ok && result.value.type === \"none\";\n    return useMemo(() => ({ narrowing, hidden, counting, clear }), [narrowing, hidden, counting, clear]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Calendar's Backlog a page at a time (#1424), as the Schematic's Backlog\n * pages its unplaced rows (D51): every backlog kind's events with no start as\n * one paged list, which the library's Backlog tab draws with the shared\n * `PagedLibrary`. Nothing it reads is a record whole, nor every unscheduled\n * event of a kind's narrowing.\n *\n * - **The events in hand come first**: those of the kinds whose backlog is read\n *   apart — read whole, or through their backlog index — and, of a kind paged\n *   here, the drafted events with no start that no page lists: one a gesture\n *   returned to the backlog, or one it created there — each told by the row\n *   its editing session began from, so a gesture reads nothing for the list.\n * - **Then each kind narrowed through its source of the slice**, a page at a\n *   time through the source with its start Unset — its choices but its window,\n *   which a backlog event has none of. Each page's entries carry their rows, so\n *   each event is its kind's projection of its own row, its drafts in place\n *   (the kind's `event` seam, with the row held): one a draft scheduled or\n *   deleted draws as context, faded and never dragged; one a draft only edits,\n *   as drafted, in place.\n * - **Its count** ({@link CalendarBacklogPages.count}): the events it lists,\n *   each paged kind's an index count — and while a kind's source narrows it,\n *   `N of M`, every unscheduled event its record holds counted beside them. The\n *   list counts nothing ({@link CalendarBacklogPages.total}) until every count\n *   is read, so the list and the tab's count swap together.\n * - **What a card is** ({@link CalendarBacklogPages.served}): each event it has\n *   listed, and not as context, by its card's id — what a drag of it, or its\n *   Schedule, finds it by — and a page's event's row at the revision the page\n *   read it at ({@link CalendarBacklogPages.servedRow}): the original a gesture\n *   placing it rewrites, read by no other request, as the Schematic's are. The\n *   rows its pages listed are kept by the frame ({@link BacklogServed}), across\n *   the lists it makes as the drafts move, and a card is its kind's projection\n *   of its row with the drafts as they stand: a draft of another event — a list\n *   made again before its pages are read — leaves the chosen card what it is,\n *   its Schedule with it.\n *\n * The drafts it is given are the shared schedule reader's (`cells.ts`): those\n * of events a kind's narrowing does not hold left out, so a draft never brings\n * an event of another narrowing into the list. It has no search of its own, as\n * the Schematic's paged Backlog has none: the rail's choices narrow it (ruled\n * 27 Oct 2026).\n *\n * Every read is a tracked read of the kinds' sources, so the list's reader runs\n * again as a page, a count or a row read by its key lands, and as a narrowing\n * or a revision moves; no step of the dates moves any of it.\n *\n * @packageDocumentation\n */\n\nimport {\n    StringType, encodeBeast2For, equalFor, fromEastTypeValue, none, printFor, some,\n    type ArrayType, type EastType, type StructType, type option,\n} from \"@elaraai/east\";\nimport { RecordSliceWhereType, type RecordSliceEntry } from \"@elaraai/east-ui/internal\";\nimport { recordSlicePage, recordSliceRevision, type LibraryPageSource } from \"@elaraai/east-ui-components/internal\";\nimport { backlogWhere, backlogWhole } from \"../shared/schedule/backlog.js\";\nimport { EMPTY_SCHEDULE_DRAFTS, type ScheduleEventDraftsValue } from \"../shared/schedule/editing.js\";\nimport { eventKey, type CalendarItem, type CalendarKind } from \"./model.js\";\nimport type { CalendarEventPart } from \"./window.js\";\n\nconst stringEqual = equalFor(StringType);\nconst printWhere = printFor(RecordSliceWhereType);\n/** The whole of time: what an event read by its key is read over — its row held or read, never a window. */\nconst EVER = { from: new Date(-8_640_000_000_000_000), to: new Date(8_640_000_000_000_000) };\n/** The most events the list keeps for what a drag finds them by, past which the oldest go: the pages around the view hold far fewer. */\nconst MAX_SERVED = 4_096;\n\n/** One event the paged Backlog lists: the event, and whether it draws as context. */\nexport interface BacklogPageEvent {\n    /** The event, its drafts in place — or, as context, as its record holds it. */\n    readonly item: CalendarItem;\n    /** Whether it draws as context, faded and never dragged: a draft scheduled or deleted it. */\n    readonly context: boolean;\n    /** Its row as the record holds it, and the revision its page read it at; `undefined` for an event in hand. */\n    readonly stored?: { readonly revision: string; readonly row: Uint8Array } | undefined;\n}\n\n/** What the paged Backlog counts: the events it lists, every unscheduled event, and whether a source's choices narrow the list. */\nexport interface BacklogPageCount {\n    /** The events it lists. */\n    readonly shown: number;\n    /** Every unscheduled event the kinds hold, the events in hand among them. */\n    readonly total: number;\n    /** Whether a source's choices narrow what it lists. */\n    readonly narrowing: boolean;\n}\n\n/** A kind's row codec: what its `event` seam takes a row held as. */\nconst codecs = new WeakMap<object, (row: unknown) => Uint8Array>();\nfunction encoderOf(kind: CalendarKind): (row: unknown) => Uint8Array {\n    let encode = codecs.get(kind.editing.entryType);\n    if (encode === undefined) {\n        encode = encodeBeast2For(fromEastTypeValue(kind.editing.entryType) as EastType) as (row: unknown) => Uint8Array;\n        codecs.set(kind.editing.entryType, encode);\n    }\n    return encode;\n}\n\n/** A kind's events' ids by their keys: an event's id is its key's text — a String key as it is, any other key as East prints it. */\nconst idPrinters = new WeakMap<object, (key: unknown) => string>();\nfunction idsOf(kind: CalendarKind): (key: unknown) => string {\n    let idOf = idPrinters.get(kind.cellsType);\n    if (idOf === undefined) {\n        const cellsType = fromEastTypeValue(kind.cellsType) as ArrayType<StructType>;\n        const keyType = (cellsType.value.fields as Record<string, EastType>)[\"key\"]!;\n        const print = printFor(keyType);\n        idOf = keyType.type === \"String\" ? (key) => key as string : (key) => print(key as never);\n        idPrinters.set(kind.cellsType, idOf);\n    }\n    return idOf;\n}\n\n/** A page's event the paged Backlog listed, not as context: its kind's slot, its key's text, and its row as its page read it. */\ninterface ServedRow {\n    readonly kind: string;\n    readonly key: string;\n    /** Its row as the record held it, and the revision its page read it at. */\n    readonly row: { readonly revision: string; readonly row: Uint8Array };\n}\n\n/**\n * What the paged Backlog's pages have listed (#1424): each event a page listed, and not as context, by its card's id —\n * its row as its page read it — kept for the narrowing it was listed under. The frame keeps one while it is mounted and\n * gives it to every list it makes as the drafts move, so what a card is never waits on the new list's pages being read.\n */\nexport class BacklogServed {\n    private rows = new Map<string, ServedRow>();\n    private listing = \"\";\n\n    /**\n     * Starts afresh for another listing: the narrowings the kinds' backlogs are read under.\n     *\n     * @param listing - The listing, as {@link CalendarBacklogPages.query} prints it\n     */\n    under(listing: string): void {\n        if (stringEqual(listing, this.listing)) return;\n        this.rows = new Map();\n        this.listing = listing;\n    }\n\n    /**\n     * Keeps a page's event, the most recent last: past the most it keeps — far more than the pages around a view hold —\n     * the oldest go.\n     *\n     * @param id - Its card's id: the event's key, as `eventKey` prints it\n     * @param row - Its kind, its key and its row as its page read it\n     */\n    keep(id: string, row: ServedRow): void {\n        this.rows.delete(id);\n        this.rows.set(id, row);\n        if (this.rows.size > MAX_SERVED) this.rows.delete(this.rows.keys().next().value!);\n    }\n\n    /**\n     * A page's event, by its card's id.\n     *\n     * @param id - Its card's id\n     * @returns Its kind, its key and its row; `undefined` for one no page of this listing has listed, or listed as context\n     */\n    get(id: string): ServedRow | undefined {\n        return this.rows.get(id);\n    }\n}\n\n/**\n * The Calendar's paged Backlog — see the module docs.\n */\nexport class CalendarBacklogPages implements LibraryPageSource<BacklogPageEvent> {\n    /**\n     * @param id - The list's id: the Backlog's library, which its cards drag from\n     * @param apart - The events of the kinds whose backlog is read apart, in the kinds' order: in hand\n     * @param kinds - The backlog kinds narrowed through their sources, paged here, in the Calendar's order\n     * @param drafts - Every kind's drafts as the shared reader gives them: those of events a kind's narrowing does not hold left out\n     * @param original - A drafted event's row as its kind's record held it when its session first read it, decoded — the\n     *   editing's `held`; `undefined` for an event a gesture made, which no stored row names\n     * @param servedRows - What the pages have listed, the frame's, kept across the lists it makes ({@link BacklogServed})\n     */\n    constructor(readonly id: string, private readonly apart: readonly CalendarItem[], private readonly kinds: readonly CalendarEventPart[],\n        private readonly drafts: ScheduleEventDraftsValue, private readonly original: (kind: string, id: string) => unknown,\n        private readonly servedRows: BacklogServed) {}\n\n    /** A kind's drafts. */\n    private draftsOf(kind: CalendarKind) {\n        return this.drafts.get(kind.key) ?? EMPTY_SCHEDULE_DRAFTS;\n    }\n\n    /**\n     * The kinds' revisions, as one: `none` while any is not yet known.\n     *\n     * @returns The revisions\n     */\n    revision(): option<string> {\n        const revisions: string[] = [];\n        for (const { part } of this.kinds) {\n            const revision = recordSliceRevision(part);\n            if (revision.type !== \"some\") return none;\n            revisions.push(revision.value);\n        }\n        return some(revisions.join(\"\\u0000\"));\n    }\n\n    /**\n     * The narrowings the kinds' backlogs are read under, as one: the list starts its viewport again as one moves.\n     *\n     * @returns The narrowings, printed\n     */\n    query(): string {\n        return this.kinds.map(({ kind, part }) => printWhere(backlogWhere(part.read().where, kind.schedule.start))).join(\"\\u0001\");\n    }\n\n    /**\n     * The events in hand: the kinds' read apart, then each paged kind's drafted events with no start that its pages do\n     * not list — returned to the backlog, or made there — each told by the row its session began from, so no gesture\n     * reads anything for it.\n     *\n     * @returns The events\n     */\n    private inHand(): CalendarItem[] {\n        const out = [...this.apart];\n        for (const { kind } of this.kinds) {\n            const drafts = this.draftsOf(kind);\n            if (drafts.size === 0) continue;\n            const encode = encoderOf(kind);\n            for (const id of drafts.keys()) {\n                // Its row as the record held it — none for an event a gesture made, which only its draft holds.\n                const began = this.original(kind.key, id);\n                const held = some(began === undefined ? none : some(encode(began)));\n                const drafted = kind.event(id, drafts, EVER.from, EVER.to, held);\n                // Deleted, or placed: not in the backlog.\n                if (drafted.type !== \"some\" || drafted.value.item.start.type === \"some\") continue;\n                if (began !== undefined) {\n                    // Its stored row in the backlog: a page lists it, its draft in place.\n                    const was = kind.event(id, EMPTY_SCHEDULE_DRAFTS, EVER.from, EVER.to, held);\n                    if (was.type === \"some\" && was.value.item.start.type === \"none\") continue;\n                }\n                out.push(drafted.value.item);\n            }\n        }\n        return out;\n    }\n\n    /** Each paged kind's count of the events it lists; `undefined` while any is read. */\n    private listed(): bigint[] | undefined {\n        const counts: bigint[] = [];\n        for (const { kind, part } of this.kinds) {\n            const count = part.countWhere({ where: backlogWhere(part.read().where, kind.schedule.start), area: none });\n            if (count.type !== \"some\") return undefined;\n            counts.push(count.value);\n        }\n        return counts;\n    }\n\n    /**\n     * How many events it lists — the events in hand, and each paged kind's its source's choices hold — once every count\n     * the tab says is read ({@link CalendarBacklogPages.count}): the list and the tab's count swap together.\n     *\n     * @returns The count; `none` while any is read\n     */\n    total(): option<bigint> {\n        const count = this.count();\n        return count === undefined ? none : some(BigInt(count.shown));\n    }\n\n    /**\n     * What the Backlog tab counts (see {@link BacklogPageCount}).\n     *\n     * @returns The count; `undefined` while any count is read\n     */\n    count(): BacklogPageCount | undefined {\n        const hand = this.inHand();\n        const counts = this.listed();\n        if (counts === undefined) return undefined;\n        let shown = hand.length, total = hand.length, narrowing = false;\n        for (const [i, { kind, part }] of this.kinds.entries()) {\n            shown += Number(counts[i]!);\n            const where = part.read().where;\n            // A source's choices but its window narrow its backlog: then `M` counts every unscheduled event of its record.\n            if ([...where.keys()].some((field) => !stringEqual(field, kind.schedule.start))) {\n                narrowing = true;\n                const all = part.countWhere({ where: backlogWhole(kind.schedule.start), area: none });\n                if (all.type !== \"some\") return undefined;\n                total += Number(all.value);\n            } else {\n                total += Number(counts[i]!);\n            }\n        }\n        return { shown, total, narrowing };\n    }\n\n    /**\n     * The events `[offset, offset + limit)` of the list: the events in hand, then each paged kind's, a page read through\n     * its source with its start Unset, each event its kind's projection of its row with its drafts in place.\n     *\n     * @param offset - The first event\n     * @param limit - How many events\n     * @returns The events; `none` while a count or a page is read\n     */\n    page(offset: bigint, limit: bigint): option<BacklogPageEvent[]> {\n        const hand = this.inHand();\n        const counts = this.listed();\n        if (counts === undefined) return none;\n        this.servedRows.under(this.query());\n        const rows: BacklogPageEvent[] = [];\n        let at = offset;\n        let left = limit;\n        const fresh = BigInt(hand.length);\n        if (at < fresh) {\n            const end = at + left < fresh ? at + left : fresh;\n            for (const item of hand.slice(Number(at), Number(end))) rows.push({ item, context: false });\n            left -= end - at;\n            at = end;\n        }\n        let base = fresh;\n        for (const [i, kind] of this.kinds.entries()) {\n            if (left <= 0n) break;\n            const count = counts[i]!;\n            if (at < base + count) {\n                const from = at - base;\n                const take = from + left < count ? left : count - from;\n                const got = this.kindPage(kind, from, take);\n                if (got.type !== \"some\") return none;\n                rows.push(...got.value);\n                at += take;\n                left -= take;\n            }\n            base += count;\n        }\n        // A page's events, kept by the frame across the lists it makes; an event in hand is found among them as it stands.\n        for (const row of rows) {\n            if (row.context || row.stored === undefined) continue;\n            this.servedRows.keep(eventKey({ kind: row.item.kind, key: row.item.key }), { kind: row.item.kind, key: row.item.key, row: row.stored });\n        }\n        return some(rows);\n    }\n\n    /**\n     * One kind's events `[offset, offset + limit)`: a page of its backlog, each its projection of its row, its drafts in\n     * place.\n     */\n    private kindPage({ kind, part }: CalendarEventPart, offset: bigint, limit: bigint): option<BacklogPageEvent[]> {\n        const got = recordSlicePage(part, { where: backlogWhere(part.read().where, kind.schedule.start), area: none }, offset, limit);\n        const revision = recordSliceRevision(part);\n        if (got.type !== \"some\" || revision.type !== \"some\") return none;\n        const encode = encoderOf(kind);\n        const idOf = idsOf(kind);\n        const drafts = this.draftsOf(kind);\n        const out: BacklogPageEvent[] = [];\n        for (const entry of got.value as RecordSliceEntry[]) {\n            const key = idOf(entry.key);\n            const row = entry.row?.type === \"some\" ? entry.row.value : entry.value?.type === \"some\" ? entry.value.value : undefined;\n            if (row === undefined) continue;\n            const bytes = encode(row);\n            const held = some(some(bytes));\n            const read = { revision: revision.value, row: bytes };\n            const stored = kind.event(key, EMPTY_SCHEDULE_DRAFTS, EVER.from, EVER.to, held);\n            if (stored.type !== \"some\") return none;\n            if (!drafts.has(key)) {\n                out.push({ item: stored.value.item, context: false, stored: read });\n                continue;\n            }\n            // A draft decides: deleted, or scheduled, the event draws as its record holds it, as context; edited, as drafted, in place.\n            const drafted = kind.event(key, drafts, EVER.from, EVER.to, held);\n            if (drafted.type !== \"some\" || drafted.value.item.start.type === \"some\") out.push({ item: stored.value.item, context: true, stored: read });\n            else out.push({ item: drafted.value.item, context: false, stored: read });\n        }\n        return some(out);\n    }\n\n    /**\n     * An event the list has served, by its card's id: what a drag of its card, or its Schedule, finds it by — a page's\n     * event as its kind projects the row its page read with the drafts as they stand, whichever list listed it, and an\n     * event in hand as it stands.\n     *\n     * @param id - The card's id: the event's key, as `eventKey` prints it\n     * @returns The event; `undefined` for one it has not listed, or one a draft has scheduled or deleted since: context\n     */\n    served(id: string): CalendarItem | undefined {\n        const listed = this.servedRows.get(id);\n        const kind = listed === undefined ? undefined : this.kinds.find(({ kind }) => stringEqual(kind.key, listed.kind))?.kind;\n        if (listed !== undefined && kind !== undefined) {\n            const drafted = kind.event(listed.key, this.draftsOf(kind), EVER.from, EVER.to, some(some(listed.row.row)));\n            return drafted.type === \"some\" && drafted.value.item.start.type === \"none\" ? drafted.value.item : undefined;\n        }\n        return this.inHand().find(item => stringEqual(eventKey({ kind: item.kind, key: item.key }), id));\n    }\n\n    /**\n     * The row of an event a page listed, as the record held it at the revision the page read it at (#1424): the\n     * original a gesture placing it rewrites, as the Schematic's Backlog gives its rows (#1393).\n     *\n     * @param kind - The event's kind's slot\n     * @param id - The event's key's text\n     * @returns Its row and that revision; `undefined` for an event no page listed, or one in hand\n     */\n    servedRow(kind: string, id: string): { readonly revision: string; readonly row: Uint8Array } | undefined {\n        return this.servedRows.get(eventKey({ kind, key: id }))?.row;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The one rule a builder reads its rows by (#1599, ruled 11 Nov 2026): how\n * what a board shows stands to what it is asked for now, and so whether it\n * takes a gesture.\n *\n * A builder reads its rows for a **view**: a period — a day, a week, a window\n * of dates — under the choices its rail holds. Each read takes a round trip, so\n * what a board shows is its last complete read, which stands while a newer one\n * is on its way. The rule says what that read is, by the view it was made for:\n *\n * - **cold** — nothing read yet: the frame's cold load.\n * - **stepping** — the period asked is another than the one read: the board\n *   draws none of the old period's rows under the new one's labels.\n * - **filtering** — the same period under other choices: the rows the last\n *   choices left stand in, *retained* — readable, focusable and selectable,\n *   taking no gesture — until the new choices' rows land. A gesture there\n *   would act on a row its person has asked not to see.\n * - **rereading** — the same period and the same choices, read again: a Save\n *   of the page's own, or another session's write, moved the record. What the\n *   board shows is what its person asked for, so it is *live*: a gesture is\n *   taken at once, beginning from the row shown (east-ui-components'\n *   `EditSession.startOf`), and a Save never stops the editing.\n * - **current** — what is shown is what is asked, and nothing is on its way.\n *\n * A board is held back, then, only while what it shows is another view's —\n * never for a read again of its own. Every builder that reads its rows apart\n * from its editing session asks this rule, each giving its own period and\n * choices as text; none keeps a rule of its own.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\n\nconst stringEqual = equalFor(StringType);\n\n/** The view a read of a builder's rows is made for: its period, and the choices it was read under. */\nexport interface ReadView {\n    /**\n     * The period it is of, as text: what a step of the dates moves — a window's bounds, a week's start. The same text\n     * for the same period; the empty text for a builder whose rows follow no period.\n     */\n    readonly period: string;\n    /** The choices it was read under, as text: each source's narrowing, printed. The same text for the same choices. */\n    readonly choices: string;\n}\n\n/** How what a board shows stands to what it is asked for now (see the module docs). */\nexport type ViewState = \"cold\" | \"stepping\" | \"filtering\" | \"rereading\" | \"current\";\n\n/**\n * Whether two views are one: the same period under the same choices.\n *\n * @param a - A view\n * @param b - Another\n * @returns Whether they are the same view\n */\nexport function sameView(a: ReadView, b: ReadView): boolean {\n    return stringEqual(a.period, b.period) && stringEqual(a.choices, b.choices);\n}\n\n/**\n * How what a board shows stands to what it is asked for now (see the module docs).\n *\n * @param shown - The view the last complete read was made for; `undefined` before one has landed\n * @param asked - The view asked for now\n * @param reading - Whether a read of the view asked is on its way\n * @returns The state\n */\nexport function viewState(shown: ReadView | undefined, asked: ReadView, reading: boolean): ViewState {\n    if (shown === undefined) return \"cold\";\n    if (!stringEqual(shown.period, asked.period)) return \"stepping\";\n    if (!stringEqual(shown.choices, asked.choices)) return \"filtering\";\n    return reading ? \"rereading\" : \"current\";\n}\n\n/**\n * Whether what a board holds is of the period asked: while it is not — nothing read, or a period stepped to — it draws\n * none of it.\n *\n * @param state - The view's state\n * @returns Whether the rows held are the period's\n */\nexport function viewOfPeriod(state: ViewState): boolean {\n    return state !== \"cold\" && state !== \"stepping\";\n}\n\n/**\n * Whether a board takes a gesture: what it shows is the view asked, read again or not.\n *\n * @param state - The view's state\n * @returns Whether it is live\n */\nexport function viewLive(state: ViewState): boolean {\n    return state === \"current\" || state === \"rereading\";\n}\n\n/**\n * Whether what a board shows stands in for other choices' rows of the same period: retained — readable, focusable and\n * selectable, taking no gesture — until they land.\n *\n * @param state - The view's state\n * @returns Whether it is retained\n */\nexport function viewRetained(state: ViewState): boolean {\n    return state === \"filtering\";\n}\n\n/**\n * The last complete read of a builder's rows, and the view it was made for: what stands while a newer read is on its\n * way. A builder's reader lands each complete read here and asks how it stands to what is asked now; it keeps no rule\n * of its own.\n *\n * @typeParam T - What a read holds: the builder's rows, in its own shape\n */\nexport class StandingRead<T> {\n    private held: { readonly rows: T; readonly view: ReadView } | undefined;\n\n    /**\n     * A read that completed: it stands from now.\n     *\n     * @param rows - What it read\n     * @param view - The view it was made for\n     */\n    land(rows: T, view: ReadView): void {\n        this.held = { rows, view };\n    }\n\n    /** What the last complete read holds; `undefined` before one has landed. */\n    get rows(): T | undefined {\n        return this.held?.rows;\n    }\n\n    /** The view the last complete read was made for; `undefined` before one has landed. */\n    get view(): ReadView | undefined {\n        return this.held?.view;\n    }\n\n    /**\n     * How what stands is to what is asked for now.\n     *\n     * @param asked - The view asked for now\n     * @param reading - Whether a read of it is on its way\n     * @returns The state\n     */\n    state(asked: ReadView, reading: boolean): ViewState {\n        return viewState(this.held?.view, asked, reading);\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the builders over the app's own records share (#1372, `Builder\n * Interfaces Spec.md` §7): the Roster's and the Allocation's. A new row's key,\n * minted unique among every key the builder holds (§7.6); a window of a\n * record kept at the revision it was read at, and a row read from it, which a\n * Save confirms its entries by and a gesture finds a row's original in\n * (`ScheduleRowRead`); the period's own row, read the same way; a record's\n * rows as bytes and back; a field of an event's row edited, as the kind writes\n * it; and Publish: Save first, then the period's status once every record\n * reads back as saved (§7.3).\n *\n * @packageDocumentation\n */\n\nimport {\n    DateTimeType, EastTypeType, StringType, decodeBeast2For, encodeBeast2For, equalFor, fromEastTypeValue, isVariant, none, parseFor, some, variant, type EastType,\n    type EastTypeValue, type StructType, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport type { ScheduleKindType, SchedulePeriodsKindType } from \"@elaraai/e3-ui/internal\";\nimport type { EditHistory, EntryVersion } from \"@elaraai/east-ui-components\";\nimport type { ScheduleChange, ScheduleEditingRecord, ScheduleEntryRef, ScheduleRowRead } from \"./editing.js\";\n\n/** A builder's periods, as the payload carries them. */\nexport type SchedulePeriodsValue = ValueTypeOf<typeof SchedulePeriodsKindType>;\n\nconst stringEqual = equalFor(StringType);\nconst sameTypeValue = equalFor(EastTypeType);\nconst dateCompare = (a: Date, b: Date) => a.getTime() - b.getTime();\nconst parseInstant = parseFor(DateTimeType);\n\n/** A record's rows, as bytes and back: a period's, a target's, by their row type. */\nexport interface RowCodec { readonly encode: (row: unknown) => Uint8Array; readonly decode: (bytes: Uint8Array) => unknown }\nconst codecs: { type: EastTypeValue; codec: RowCodec }[] = [];\n\n/**\n * A record's row codec, made the first time its row type is seen — East\n * decides which types are the same.\n *\n * @param rowType - The row type\n * @returns Its codec\n */\nexport function rowCodec(rowType: EastTypeValue): RowCodec {\n    const known = codecs.find(c => sameTypeValue(c.type, rowType));\n    if (known !== undefined) return known.codec;\n    const type = fromEastTypeValue(rowType) as EastType;\n    const codec: RowCodec = { encode: encodeBeast2For(type) as (row: unknown) => Uint8Array, decode: decodeBeast2For(type) as (bytes: Uint8Array) => unknown };\n    codecs.push({ type: rowType, codec });\n    return codec;\n}\n\n/**\n * A field of an event's row edited, as its kind writes it: the inspector's\n * form's edit of one of the fields no role of the builder's maps, its value as\n * bytes at the field's type — the kind's form's spec's, else the row's own\n * field's.\n *\n * @param kind - The event kind: its form's specs and its row type\n * @param id - The event's key's text\n * @param path - The field's path\n * @param next - Its new value\n * @returns The change; `undefined` for a path that names no field of the row\n */\nexport function fieldChange(kind: Pick<ValueTypeOf<typeof ScheduleKindType>, \"key\" | \"fields\" | \"editing\">, id: string, path: readonly string[],\n    next: unknown): ScheduleChange | undefined {\n    const spec = kind.fields.find(field => field.path.length === path.length && field.path.every((part, i) => stringEqual(part, path[i]!)));\n    const rowType = fromEastTypeValue(kind.editing.entryType) as StructType;\n    const type = spec !== undefined ? fromEastTypeValue(spec.type) as EastType : path.length === 1 ? rowType.fields[path[0]!] : undefined;\n    if (type === undefined) return undefined;\n    return { kind: kind.key, id, gesture: variant(\"field\", { path: [...path], value: encodeBeast2For(type)(next as never) }) };\n}\n\n/**\n * A new key, minted unique among the keys given (a UUID, retried): a record\n * read whole holds every key, and a key a record read a window at a time holds\n * unread is its Save's own conflict, never an overwrite. The UUID is\n * `crypto.randomUUID()`'s, else — a page served over plain HTTP has none — a\n * version 4 UUID drawn from `crypto.getRandomValues`, which every page has.\n *\n * @param taken - Whether a key is held already\n * @returns The key\n */\nexport function mintKey(taken: (key: string) => boolean): string {\n    for (;;) {\n        const key = \"randomUUID\" in crypto ? crypto.randomUUID() : randomUUID();\n        if (!taken(key)) return key;\n    }\n}\n\n/** A version 4 UUID from the page's random bytes: its version and variant bits set, printed 8-4-4-4-12. */\nfunction randomUUID(): string {\n    const bytes = crypto.getRandomValues(new Uint8Array(16));\n    bytes[6] = (bytes[6]! & 0x0f) | 0x40;\n    bytes[8] = (bytes[8]! & 0x3f) | 0x80;\n    const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n    return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n\n/**\n * What a builder makes over the app's `values` (#1526) — a new row, or the\n * period's row it writes first — or `undefined` where they fail as they run,\n * which the console says: a gesture then records nothing and a probe draws\n * nothing, and the builder goes on.\n *\n * @param builder - The builder, as the console names it: `Roster`\n * @param what - What it makes, as the console names it: `a new duty`\n * @param make - Its kind's function over the app's `values`, called\n * @returns What it makes\n */\nexport function madeFromValues<T>(builder: string, what: string, make: () => T): T | undefined {\n    try {\n        return make();\n    } catch (err) {\n        console.error(`[${builder}] ${what} could not be made from the app's values:`, err);\n        return undefined;\n    }\n}\n\n/**\n * An entry's drafted row, when its draft holds one: what a builder decodes a\n * draft of a record into once.\n *\n * @param entry - The entry's version in its session\n * @returns The row; `undefined` for an entry its draft removes, or one the session holds no version of\n */\nexport function draftedRow(entry: EntryVersion<ScheduleEntryRef> | undefined): { row: unknown } | undefined {\n    const draft = entry?.draft;\n    return isVariant(draft) && draft.type === \"value\" ? { row: draft.value } : undefined;\n}\n\n/**\n * A window of a record as a builder reads it, kept at the revision it was\n * read at: every read of a record is pinned to one revision, whose rows stay\n * as they are however often they are read, so a Save's confirmation, which\n * reads its entries a batch at a time, reads the window once. Tracked where it\n * is called: the record moving, or the window's read landing, runs it again.\n *\n * @param entries - The record read by key, whose revision the window is kept at; `none` for one read whole, read each time\n * @param read - The window's read: `none` while it is in flight\n * @returns The window's read, kept\n */\nexport function keptAtRevision<R>(entries: ScheduleEditingRecord[\"entries\"], read: () => option<R>): () => option<R> {\n    let kept: { readonly revision: string; readonly rows: R } | undefined;\n    return () => {\n        const at = entries.type === \"some\" ? entries.value.revision() : none;\n        if (at.type === \"some\" && kept !== undefined && stringEqual(kept.revision, at.value)) return some(kept.rows);\n        const rows = read();\n        if (rows.type === \"some\" && at.type === \"some\") kept = { revision: at.value, rows: rows.value };\n        return rows;\n    };\n}\n\n/**\n * A row of a window read by key: its bytes where the window holds it; `none`\n * while the window is read; `undefined` for one it does not hold, which is\n * read by its key — the record may hold it outside the window.\n *\n * @param rows - The window's rows, by key, each its row's bytes\n * @param key - The row's key's text\n * @returns The row as the window holds it\n */\nexport function heldInWindow(rows: option<ReadonlyMap<string, { readonly row: Uint8Array }>>, key: string): ReturnType<ScheduleRowRead> {\n    if (rows.type !== \"some\") return none;\n    const row = rows.value.get(key);\n    return row === undefined ? undefined : some(some(row.row));\n}\n\n/**\n * The period's own row as the builder's read of it holds it, by its key's\n * text: the period's row, or none where the record holds none of it; another\n * period's is read by its key.\n *\n * @param periods - The builder's periods\n * @param from - The read's start: the period's\n * @param to - The read's end: the next period's start\n * @param id - The period's key's text\n * @returns The read\n */\nexport function periodRowRead(periods: SchedulePeriodsValue, from: Date, to: Date, id: string): ScheduleRowRead {\n    const rows = keptAtRevision(periods.entries, () => periods.rows(from, to));\n    return key => {\n        if (!stringEqual(key, id)) return undefined;\n        const got = rows();\n        if (got.type !== \"some\") return none;\n        const row = got.value.get(from);\n        return some(row === undefined ? none : some(row));\n    };\n}\n\n/**\n * The rows of every period in a span, as the builder's read of them holds\n * them, by each one's key's text — the Roster's month, its four to six weeks\n * (#1406): a period's row, or none where the record holds none of it; a period\n * outside the span is read by its key.\n *\n * @param periods - The builder's periods\n * @param from - The read's start: the first period's\n * @param to - The read's end: the period after the last's start\n * @returns The read\n */\nexport function periodRowsRead(periods: SchedulePeriodsValue, from: Date, to: Date): ScheduleRowRead {\n    const rows = keptAtRevision(periods.entries, () => periods.rows(from, to));\n    return key => {\n        const at = parseInstant(key);\n        if (!at.success || dateCompare(at.value, from) < 0 || dateCompare(at.value, to) >= 0) return undefined;\n        const got = rows();\n        if (got.type !== \"some\") return none;\n        const row = got.value.get(at.value);\n        return some(row === undefined ? none : some(row));\n    };\n}\n\n/**\n * The period's row as Publish writes it: its status the published case, at\n * the time given — rewritten from the row as the periods' session finds it as\n * the change is recorded, once the Save has settled: drafted, else as the\n * record holds it then (`ScheduleChange`'s `rewrite`), so the write changes its\n * status alone and never puts back what the Save, or another session, wrote\n * since Publish was pressed; where it finds none, a new one, its own fields\n * the periods' `values` of its start (#1526) — asked only then\n * (`ScheduleChange`'s `absent`), and a new row they fail to make records\n * nothing, so it publishes nothing and the console says why.\n *\n * @param periods - The builder's periods\n * @param record - What a change names the periods' record by\n * @param id - The period's key's text\n * @param start - The period's start: its key\n * @param at - When it is published\n * @param builder - The builder, as the console names it where the periods' `values` fail\n * @returns The change\n */\nexport function periodPublishChange(periods: SchedulePeriodsValue, record: string, id: string, start: Date, at: Date, builder: string): ScheduleChange {\n    return {\n        kind: record, id, rewrite: row => periods.publish(start, some(row), at),\n        absent: () => madeFromValues(builder, \"the period's row\", () => periods.publish(start, none, at)),\n    };\n}\n\n/**\n * Waits until no record's request is in flight or confirming.\n *\n * @param history - The history over the records\n * @returns The history's status then: idle once every record reads back as saved\n */\nexport function settled(history: EditHistory<ScheduleEntryRef>): Promise<EditHistory<ScheduleEntryRef>[\"status\"]> {\n    return new Promise(resolve => {\n        let off: (() => void) | undefined;\n        const check = () => {\n            const status = history.status;\n            if (status === \"applying\" || status === \"reconciling\") return;\n            off?.();\n            resolve(status);\n        };\n        off = history.subscribe(check);\n        check();\n    });\n}\n\n/**\n * Publishes periods (§4.3 rule 4, B7): Save first; once every record's\n * session reads back as saved, each period's status the published case, and\n * the periods saved — one period, or several in one request: a Roster\n * publishing by the day publishes each day of its week not yet published\n * (#1550). A Save that fails, or drafts that cannot be saved yet, leave each\n * period a draft with its drafts kept, so a published period never sits over\n * unsaved rows.\n *\n * @param history - The history over the records\n * @param change - The periods' rows as Publish writes them, worked out once the Save has settled; none publishes nothing\n * @param record - Records them, as one step\n * @returns Whether the periods' statuses were written and saved\n */\nexport async function publishPeriod(history: EditHistory<ScheduleEntryRef>, change: () => readonly ScheduleChange[],\n    record: (changes: readonly ScheduleChange[]) => boolean): Promise<boolean> {\n    await history.apply();\n    if (await settled(history) !== \"idle\" || history.pending > 0) return false;\n    const published = change();\n    if (published.length === 0 || !record(published)) return false;\n    await history.apply();\n    return await settled(history) === \"idle\" && history.pending === 0;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A record's drafted rows as a builder that draws its records' own rows takes\n * them (#1599) — the Schematic's and the Flowchart's: each drafted row read\n * through its kind's `read`, whether its draft adds it, and the roles of the\n * row its session began from.\n *\n * - **Whether a draft adds its row is its session's word**, never the\n *   gesture's that made the draft: the session's original of the row holds\n *   none. The original moves apart from the draft. A row a gesture created is\n *   one its record holds once its Save lands, a later draft of it a change of\n *   that row; and a row its record held is one its draft adds once another\n *   session removes it — the draft standing, a conflict to choose. Read once\n *   as the draft was first decoded, a row changed here and removed by another\n *   session was still a row its record held: its builder, which draws a\n *   drafted row its read does not hold only where the draft adds it — any\n *   other is one a narrowing hides, waiting in its session — drew nothing of\n *   it, while its person was asked to choose over it.\n * - **Decoded once** for the version its session holds of the row and the\n *   original beside it: a session keeps each the same object until a gesture,\n *   a Save or a carry-over replaces it.\n * - **Held while nothing moves** (`use-drafted-rows.ts`). The rows are read\n *   again whenever the history moves — an original moves with no change of\n *   the drafts' bytes, which is all the shared editing's `drafts` follows —\n *   and a kind's rows are the same map while each row is the same object, so\n *   what draws from them holds still while a Save is sent or read back.\n * - **Which drafted rows a builder draws** is one rule ({@link DraftedStanding},\n *   asked by the Schematic, the Flowchart, and the shared cells reader of the\n *   Plan's and the Calendar's events):\n *   a row its read holds, as drafted; a row its draft adds, though no read\n *   holds it; and of any other — a row its record holds, as its session\n *   knows, that the read does not: one a narrowing hides — none, unless the\n *   builder's narrowing is asked of the row itself and holds it. It waits in\n *   its session, and Save sends it.\n * - **Through a carry-over a drafted row stands as it last stood.** A record\n *   that moves is read again by its builder, and the session reads each\n *   drafted row there by its key only after: until that read lands, what the\n *   session says of a row — that its record holds it — is of the record as it\n *   was (the shared editing's `carrying`). A row drafted here that another session removed is then\n *   in no read, and not yet one its draft adds: taken for one a narrowing\n *   hides, it left its builder for a round trip, and came back with its\n *   conflict. Each drafted row is remembered as its builder last drew it, and\n *   stands so until its session has judged it where the record is.\n *\n * Pure: the hook that reads the rows as a builder renders is\n * `use-drafted-rows.ts`.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, type EastTypeValue } from \"@elaraai/east\";\nimport type { EntryVersion } from \"@elaraai/east-ui-components\";\nimport type { ScheduleEntryRef } from \"./editing.js\";\nimport { kindKeys } from \"./kind-keys.js\";\nimport { draftedRow, rowCodec } from \"./records.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** A drafted row, as its builder takes it: its roles, as its kind reads them, and whether its draft adds it. */\nexport interface DraftedRow<R> {\n    /** Its roles. */\n    readonly roles: R;\n    /**\n     * Whether its draft adds it: its session's original holds no row of its key — a row a gesture created and no Save has\n     * landed, or one another session removed under the draft. No read holds a row of its key for a narrowing's sake.\n     */\n    readonly created: boolean;\n    /**\n     * The roles of the row its session began from — what its record holds of it, as the session knows it — as its kind\n     * reads them. `undefined` for a row its draft adds.\n     */\n    readonly began?: R | undefined;\n    /**\n     * Whether its session is carrying its drafts over to a record that moved, and has yet to judge them there\n     * (`EditSession.carrying`): what it says of the row — whether its record holds it — is of the record as it was.\n     * `undefined` for a row whose session is not said — one a Save landed.\n     */\n    readonly carrying?: boolean | undefined;\n}\n\n/** One kind's drafted rows, by key: the drafted row, or `undefined` for one its draft deletes. */\nexport type DraftedRows<R> = ReadonlyMap<string, DraftedRow<R> | undefined>;\n\n/** A kind whose drafted rows are read. */\nexport interface DraftedRowsKind<R = unknown> {\n    /** What its session is named by in the editing: a kind's slot, a sort. */\n    readonly key: string;\n    /** Its rows' type. */\n    readonly rowType: EastTypeValue;\n    /** Its keys' type. */\n    readonly keyType: EastTypeValue;\n    /** A row's roles, read from its bytes and its key's text. */\n    readonly read: (bytes: Uint8Array, key: string) => R;\n}\n\n/** A session, as its drafted rows are read from it: each entry's version, and the original beside it. */\nexport interface DraftedRowsSession {\n    /** Each entry the session holds a version of. */\n    readonly entries: ReadonlyMap<string, EntryVersion<ScheduleEntryRef>>;\n    /** Each entry as the session's source holds it, as the session knows it. */\n    readonly originals: ReadonlyMap<string, EntryVersion<ScheduleEntryRef>>;\n    /** Whether the session is carrying its drafts over to a source that moved, and has yet to judge them there. */\n    readonly carrying: boolean;\n}\n\n/** What each drafted row was read as, by the version its session holds of it: under which key, and beside which original. */\nexport type DraftedRowsCache = WeakMap<EntryVersion<ScheduleEntryRef>, {\n    readonly id: string;\n    readonly original: EntryVersion<ScheduleEntryRef> | undefined;\n    readonly row: DraftedRow<unknown>;\n}>;\n\n/** Every kind's drafted rows, by what its session is named by: none of a kind with no draft. */\nexport type DraftedRowsByKind = ReadonlyMap<string, DraftedRows<unknown>>;\n\n/** No kind's drafted rows. */\nexport const NO_DRAFTED_ROWS: DraftedRowsByKind = new Map<string, DraftedRows<unknown>>();\n\n/** Whether two kinds' rows are the same: the same keys in the same order, each the same object. */\nfunction sameRows(a: DraftedRows<unknown>, b: DraftedRows<unknown>): boolean {\n    if (a.size !== b.size) return false;\n    const others = b.entries();\n    for (const [key, row] of a) {\n        const other = others.next().value;\n        if (other === undefined || !stringEqual(other[0], key) || !Object.is(other[1], row)) return false;\n    }\n    return true;\n}\n\n/** Nothing lets a row show that its builder's read holds none of. */\nconst NEVER = (): boolean => false;\n\n/**\n * Which drafted rows a builder draws, and what it last drew of each (see the module docs): one for a builder, kept\n * while it is mounted.\n */\nexport class DraftedStanding {\n    /** The drafted rows the builder last drew: by what each kind's session is named by, their keys. */\n    private drawn: ReadonlyMap<string, ReadonlySet<string>> = new Map();\n\n    /**\n     * Whether a drafted row is drawn: a row its read holds; one its draft adds; one the builder's narrowing holds, asked\n     * of the row itself; and, while its session has yet to judge it where its record is, one the builder last drew.\n     *\n     * @param kind - What the row's kind's session is named by\n     * @param key - The row's key\n     * @param row - The drafted row: whether its draft adds it, and whether its session has yet to judge it\n     * @param held - Whether the builder's read holds a row of its key, and shows it\n     * @param shown - Whether the builder's narrowing holds the row though its read holds none of it — a builder that\n     *   reads a window of its record asks its narrowing of the row itself; never, unless given\n     * @returns Whether it is drawn; a row not drawn waits in its session\n     */\n    stands(kind: string, key: string, row: Pick<DraftedRow<unknown>, \"created\" | \"carrying\">, held: boolean, shown: () => boolean = NEVER): boolean {\n        return held || row.created || shown() || (row.carrying === true && this.stood(kind, key));\n    }\n\n    /**\n     * Whether the builder last drew a drafted row: what a row its draft deletes meanwhile is remembered by, drawn\n     * nowhere, so the deletion taken back finds it standing as it did.\n     *\n     * @param kind - What the row's kind's session is named by\n     * @param key - The row's key\n     * @returns Whether it did\n     */\n    stood(kind: string, key: string): boolean {\n        return this.drawn.get(kind)?.has(key) === true;\n    }\n\n    /**\n     * Remembers a drawing, once every drafted row of it has been asked: the drafted rows it drew, which stand through a\n     * carry-over, in place of the last drawing's.\n     *\n     * @param drawn - Each kind's drafted rows drawn, by key; a kind not named drew none\n     */\n    drew(drawn: ReadonlyMap<string, ReadonlySet<string>>): void {\n        this.drawn = drawn;\n    }\n\n    /**\n     * Remembers one kind's part of a drawing, the other kinds' as they were: what a reader that draws its kinds one at\n     * a time tells, once every drafted row of the kind has been asked.\n     *\n     * @param kind - What the kind's session is named by\n     * @param keys - The kind's drafted rows drawn, by key\n     */\n    drewKind(kind: string, keys: ReadonlySet<string>): void {\n        if (keys.size === 0 && !this.drawn.has(kind)) return;\n        const drawn = new Map(this.drawn);\n        if (keys.size === 0) drawn.delete(kind);\n        else drawn.set(kind, keys);\n        this.drawn = drawn;\n    }\n}\n\n/**\n * One kind's drafted rows (see the module docs): each read once for the version its session holds of it and the\n * original beside it.\n *\n * @param kind - The kind\n * @param ids - The keys its drafts hold, in the order the rows are listed\n * @param session - Its session; `undefined` for a kind with none, whose every row reads as deleted\n * @param cache - What each drafted row was read as, kept across calls\n * @param held - The rows as last read: handed back, the same map, where no row moved\n * @returns The rows, by key: `undefined` for one its draft deletes\n */\nexport function draftedRowsOf<R>(kind: DraftedRowsKind<R>, ids: Iterable<string>, session: DraftedRowsSession | undefined, cache: DraftedRowsCache,\n    held?: DraftedRows<R>): DraftedRows<R> {\n    const codec = rowCodec(kind.rowType);\n    // A row under a placeholder is read as keyed by its key type's default, its key still to be typed (#1549).\n    const keys = kindKeys(kind.keyType);\n    const rows = new Map<string, DraftedRow<R> | undefined>();\n    const carrying = session?.carrying === true;\n    for (const id of ids) {\n        const entry = session?.entries.get(id);\n        const row = draftedRow(entry);\n        if (entry === undefined || row === undefined) { rows.set(id, undefined); continue; }\n        const original = session?.originals.get(id);\n        const was = cache.get(entry);\n        if (was !== undefined && Object.is(was.original, original) && stringEqual(was.id, id)) {\n            // As it was read, and said to be carried over or not: its roles the same object either way.\n            const now = (was.row.carrying === true) === carrying ? was.row : { ...was.row, carrying };\n            if (!Object.is(now, was.row)) cache.set(entry, { id, original, row: now });\n            rows.set(id, now as DraftedRow<R>);\n            continue;\n        }\n        // A row its session's original holds none of is one the draft adds; any other began as the row its record holds.\n        const began = draftedRow(original)?.row;\n        const drafted: DraftedRow<R> = {\n            roles: kind.read(codec.encode(row.row), keys.readKey(id)), created: began === undefined,\n            began: began === undefined ? undefined : kind.read(codec.encode(began), keys.readKey(id)), carrying,\n        };\n        cache.set(entry, { id, original, row: drafted });\n        rows.set(id, drafted);\n    }\n    return held !== undefined && sameRows(held, rows) ? held : rows;\n}\n\n/**\n * A kind's drafted rows, of every kind's: read as the kind's `read` gives them.\n *\n * @param rows - Every kind's drafted rows ({@link useDraftedRows})\n * @param kind - The kind\n * @returns Its rows; `undefined` for a kind with no draft\n */\nexport function draftedOf<R>(rows: DraftedRowsByKind, kind: Pick<DraftedRowsKind<R>, \"key\" | \"read\">): DraftedRows<R> | undefined {\n    return rows.get(kind.key) as DraftedRows<R> | undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * A schedule's event kinds as a builder reads them (#1039): each kind placed on\n * a paged resource kind read a cell at a time, and every other kind counted\n * before one of its events is read. It is the shared reader the Plan reads its\n * kinds through (`plan/root/cells.ts`, its adapter), and the Calendar next. It\n * holds no builder's type: its host gives it, in the terms below, each event\n * kind ({@link ScheduleCellKind}), the resource kinds read whole and the paged\n * one, the range it reads and its buckets, the drafts and the paged kind's rows\n * in view, and hands what it read to its own seams.\n *\n * # Cells\n *\n * A kind placed on the paged resource kind, whose source of the slice lists a\n * series index of its record, reads the events of the resources in view — and\n * of no resource, its Unassigned row's — a level at a time, never every event\n * over the range. The series index files each event once, at the level its\n * length fits (#1433), so a cell is a block of {@link SCHEDULE_CELL_BLOCK} of\n * the paged kind's resources, in the kind's order, over one level's run of\n * tiles (`levelRuns`: from two tiles before the range read to one after it):\n * one range a resource (`levelCellQueries`), whatever the range's width. The\n * cells wanted are the blocks meeting the rows in view and\n * {@link SCHEDULE_CELL_MARGIN} resources either side, each a level, with the\n * cells of no resource. The reader keeps what it read by block, level and\n * tile — a range's entries split by the tile each names — so a pan or a zoom\n * asks, a block a level, one range a resource over the tiles it does not hold\n * (two, when a zoom out grows the run both ways): their searches in one\n * request, which counts their entries before one is read, beside the entries\n * of the tiles held; their entries in one more. Tiles are kept while their run\n * is wanted, at the revision they were read at: a pan or a scroll within the\n * tiles held reads nothing, and a commit reads the wanted runs again, the old\n * ones standing in until they land. An event past a year, filed under each\n * year it touches, is one event, kept by its key. A window of\n * the paged kind's resources whose read failed — the paging runtime throws a\n * `PagedReadError` for it — gives no block, its host saying so where its rows\n * would be, with Retry, until a Retry lands it; anything else a read of it\n * throws is thrown on ({@link scheduleWindowKeys}).\n *\n * A paged kind its source of the slice narrows is the narrowing's resources, in\n * the source's index's order (#1344): its blocks are the narrowing's, so only\n * the narrowed resources in view have their events read. The rows in view are\n * reported under the narrowing their windows are, and a choice's rows still to\n * land are reported by none: until they are, a span of the last narrowing's\n * reads no cell, and its cells stand in.\n *\n * # Counted first\n *\n * Every other kind is counted before one of its events is read: one read\n * through its source of the slice, over the range for every resource, through\n * the source's interval index — the count its window's read asks first, so\n * counting asks e3 nothing of its own; one read through a day index, by the\n * entries it files under the days of the range, the search its window's read\n * asks first — an event under each day it runs on, so an upper bound on the\n * events, never their number (`exact` false); and one held whole in memory. A\n * kind within {@link SCHEDULE_EVENT_CAP} in the range is left to its host,\n * which reads it over the range as it reads a kind no reader names; past it,\n * its events are never read or drawn, and the reader names it among the kinds\n * past the cap (`capped`): a host counts none of its events on a resource's\n * row, nor its hours anywhere, and says so. Its host's other readers, which\n * read it over the range or within it — a footer's counts, an inspector's —\n * read it only once the same count over the range says it is within the cap\n * ({@link scheduleWithinCap}), never by what the reader last decided, which a\n * new narrowing outruns; past it they wait for the reader, which gives it no\n * cells.\n *\n * # The cap\n *\n * While the wanted cells hold at most {@link SCHEDULE_EVENT_CAP} entries, their\n * events draw. Past it — or past one batch of searches — and for a counted\n * kind past the cap, the kind's summary index draws its shading instead: its\n * cells, at the largest of its tiles that divides the host's bucket and serves\n * the narrowing whole, folded into the buckets — the share of each booked for a\n * kind whose rows book their buckets (`booked`), how many events touch it for\n * one whose rows mark them. With none to shade, a kind read by cells is read\n * over the range while its count there is within the cap, and past it, as a\n * counted kind with no summary, the notice: its rows hatched, and the host's\n * banner naming how many events there are — or, where the count is no number\n * of them (a day index's), that they are not counted — and the resolution its\n * smallest summary shades at, or none. A hidden kind is read for nothing:\n * given no cells, it draws nothing, and a host leaves it out of every figure\n * of its own — the kinds past the cap name none.\n *\n * # The narrowing, the drafts and the link ends\n *\n * A series index led by the narrowed fields serves the narrowing exactly; the\n * fields it leaves are asked of the events read, in one read\n * (`recordSliceWithin`). The drafts are the host's sessions', and each draws\n * where it places its event, read or not — but a draft of an event the\n * narrowing does not hold, which a narrowed range leaves out too: the stored\n * rows of the drafted events the cells do not hold are read by their keys, in\n * one read, and asked of the narrowing in the same read as the cells' events.\n * An event whose row the host wants though no cell holds it — a link's end\n * ({@link ScheduleCellKind.wanted}) — is read by its key in that read. A kind\n * its host reads over the window's rows alone, every draft it is given drawing\n * where it places its event ({@link ScheduleCellKind.windowField}: the\n * Calendar's, whose backlog it pages itself, #1424), has its drafts asked of\n * the narrowing the same way — but the window's range — so a draft of an event\n * the narrowing does not hold draws nowhere, and a backlog event a gesture\n * scheduled draws where it is placed.\n *\n * # A window's rows\n *\n * A counted kind within the cap whose events are read a window at a time —\n * through its source's interval index, or a day index, one event by its key —\n * is given cells too (#1599): its window's own stored rows, which its host\n * hands the reader a read of ({@link ScheduleCellKind.stored}). The reader\n * keeps them as it keeps a kind's cells, at the revision they were read at,\n * while its record, its narrowing and the range hold — a draft's redraw asks\n * e3 nothing, nor the kind's own read — and they stand while they are read\n * again: after a Save, after another session's write, under new choices. Its\n * host's seams draw the kind from them, so a draft made meanwhile draws at\n * once, and a gesture finds its event's row among them: a Save never stops the\n * editing. A kind read whole has no such read to wait on, and is left to its\n * host as before. Which of its drafts draw is as its window's own read drew\n * them: for a kind whose window draws a draft only of an event it holds, or of\n * a new one ({@link ScheduleCellKind.isNew}, #1343) — or, while its session has\n * yet to judge its drafts where its record reads now, of one the reader last\n * drew ({@link ScheduleCellKind.carrying}, #1599) — the drafts of the other\n * events are left out, told by the rows held and the row each draft's session\n * began from — e3 asked nothing.\n *\n * # The view\n *\n * What the reader hands on is its last complete read, made for a view: its\n * host's period, and the choices each kind's source holds. How that stands to\n * what is asked now is the one rule every builder reads its rows by\n * (`../view-read.ts`): a read again of the same view leaves its host live,\n * other choices of the same period leave what stands retained, and a period\n * stepped to draws none of a windowed kind's rows of the last.\n *\n * # What a Save landed\n *\n * A Save's confirmation reads its events by their keys, never the cells, which\n * stand at the revision they were read at until the commit's are read again —\n * a round trip a deployed server makes long. A host that draws what Saves\n * landed hands the reader them as its editing keeps them\n * ({@link ScheduleCellsArgs.landed}): over a kind's cells read before them —\n * at another revision than the one its record reads at now, the rule every\n * host that draws what a Save landed reads its rows by (east-ui-components'\n * `readBeforeSaves`) — every event they landed draws as the Save left it,\n * laid under the drafts — a draft made since draws in its place, and one the\n * narrowing did not hold draws nowhere, as before the Save — and its row is\n * held as the Save left it, where a gesture and an inspector read it; one it\n * deleted draws nowhere, and is read by its key. Once a kind's cells are read\n * at the revision its record reads at now — or none of its cells is read, the\n * kind counted, past the cap or hidden — what landed of it is let go\n * ({@link ScheduleCellsArgs.shown}), so no frame draws both. Whichever\n * revision a Save was drafted at, cells read before the record's revision now\n * are from before it: two Saves before the cells are read again each keep\n * their events, and so does a Save drafted over another session's write the\n * cells have still to read.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport {\n    ArrayType, BlobType, DateTimeType, DictType, FloatType, OptionType, SortedMap, StringType, StructType,\n    compareFor, decodeBeast2For, encodeBeast2For, equalFor, fromEastTypeValue, none, parseFor, printFor, some,\n    type EastType, type EastTypeValue, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport { SeekQueryType } from \"@elaraai/east-ui\";\nimport {\n    MAX_RECORD_SLICE_BATCH, RecordSliceChoiceType, RecordSliceWhereType, levelCellQueries, levelRuns, summaryCellQueries, summaryRun, tileIndexFor, tilingOf,\n    type RecordSliceBindType, type RecordSliceCell, type RecordSliceCellRuns, type RecordSliceEntry, type RecordSliceIndexType,\n    type RecordTile, type TileRun,\n} from \"@elaraai/east-ui/internal\";\nimport { SCHEDULE_EVENT_CAP, ScheduleDraftsType } from \"@elaraai/e3-ui/internal\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport {\n    readBeforeSaves, recordSliceCellEntries, recordSliceCellRuns, recordSliceRevision, recordSliceRows, recordSliceWithin,\n} from \"@elaraai/east-ui-components/internal\";\nimport { isPagedReadError } from \"../../platform/paged-read-error.js\";\nimport type { TimeResolution } from \"../time/scale.js\";\nimport { sameView, viewState, type ReadView, type ViewState } from \"../view-read.js\";\nimport { DraftedStanding } from \"./drafted-rows.js\";\nimport type { ScheduleEventDraftsValue, ScheduleKindRows, ScheduleLanded, ScheduleLandedRow, ScheduleLandedRows } from \"./editing.js\";\n\n/** How many of a paged resource kind's resources a cell holds: a block of them, in the kind's order. */\nexport const SCHEDULE_CELL_BLOCK = 50;\n\n/** The resources either side of the rows in view whose blocks are read too. */\nexport const SCHEDULE_CELL_MARGIN = 25;\n\n/** A kind's source of the slice: a record Slice's controls — its reads, its counts and its cells go through it. */\nexport type ScheduleCellPart = ValueTypeOf<RecordSliceBindType>;\n\n/** One bucket of a resource's shading, as the reader hands it to its host's seams: the bucket's start, and its value. */\nconst ShadeType = StructType({ at: DateTimeType, value: OptionType(FloatType) });\n\n/** The resources' shading, as the reader hands it to its host's seams: by the key of the rows it stands in for, then by the resource key's text. */\nconst ShadingType = DictType(StringType, DictType(StringType, ArrayType(ShadeType)));\n\n/** One bucket of a resource's shading: its start, and the share of it booked, how many events touch it, or `none` — the hatch. */\nexport type ScheduleCellShade = ValueTypeOf<typeof ShadeType>;\n\n/** The resources' shading: by the key of the rows it stands in for, then by the resource key's text, each its buckets. */\nexport type ScheduleCellShading = ValueTypeOf<typeof ShadingType>;\n\n/** What the reader read of each kind it gives cells, by the kind's slot: one beast2 of the kind's `cellsType` each. */\nexport type ScheduleCellReads = ValueTypeOf<DictType<StringType, BlobType>>;\n\n/** One index of a record Slice's binding. */\ntype Index = ValueTypeOf<typeof RecordSliceIndexType>;\n/** A record Slice's narrowing. */\ntype Where = ReadonlyMap<string, ValueTypeOf<typeof RecordSliceChoiceType>>;\n\nconst compareString = compareFor(StringType);\nconst stringEqual = equalFor(StringType);\n/** Whether two narrowings, as a source names them, are one — none being none (#1344). */\nconst sameNarrowing = (a: string | undefined, b: string | undefined): boolean => (a === undefined || b === undefined ? a === b : stringEqual(a, b));\nconst blobEqual = equalFor(BlobType);\nconst shadingEqual = equalFor(ShadingType);\nconst draftsEqual = equalFor(DictType(StringType, ScheduleDraftsType));\nconst printQueries = printFor(ArrayType(SeekQueryType));\nconst printWhere = printFor(RecordSliceWhereType);\n\n// ============================================================================\n// What a host gives the reader\n// ============================================================================\n\n/** One event kind, as the reader reads it (see the module docs). */\nexport interface ScheduleCellKind {\n    /** Its slot: what its cells, its shading and its notice are named by. */\n    readonly key: string;\n    /** Its name, as the notice names it: `Print job`. */\n    readonly name: string;\n    /** The resource kinds its events are placed on, by their slots. */\n    readonly takes: readonly string[];\n    /** Whether its rows shade the share of each bucket its events book — bars and chips — rather than how many touch it. */\n    readonly booked: boolean;\n    /** The key of the rows its shading stands in for on a resource kind's resources, by the resource kind's slot: its host's. */\n    readonly shadeKey: (resources: string) => string;\n    /** What its cells are encoded in: an Array of `{ key, row }`, at its record's key and row types. */\n    readonly cellsType: EastTypeValue;\n    /**\n     * The `.east` text its series and summary indexes file a resource's events under, or no resource's: the key its\n     * cells search for; `none` where its resource field cannot hold it.\n     */\n    readonly seriesKey: (resource: option<{ readonly kind: string; readonly key: string }>) => option<string>;\n    /**\n     * How many of its stored events overlap `[from, to)`, counted before one is read; `none` while the count is in\n     * flight. For a kind read through a day index, the entries it files under the days of `[from, to)`: an upper bound\n     * on the events, never their number ({@link ScheduleCellKind.exact}).\n     */\n    readonly count: (from: Date, to: Date) => option<bigint>;\n    /** Whether {@link ScheduleCellKind.count} counts its events themselves: `false` for a kind read through a day index. */\n    readonly exact: boolean;\n    /** Its source of the slice, when it has one: what its cells, its summary and its narrowing are read through. */\n    readonly part: ScheduleCellPart | undefined;\n    /** Whether the viewer hides it: nothing of it draws, so no cell of it is read, and it gives no notice or shading. */\n    readonly hidden: boolean;\n    /** The keys' texts of its events whose rows its host wants though no cell holds them — a link's ends — read by their keys. */\n    readonly wanted: readonly string[];\n    /**\n     * The field its host's window narrows — its events' start — for a kind narrowed through its source whose every draft\n     * given draws where it places its event (#1424: the Calendar's kinds whose backlog it pages itself). The reader asks\n     * the narrowing — but that field's range — of the stored rows of the kind's drafted events its window does not hold,\n     * read by their keys in one read, and leaves out the drafts of those the narrowing does not hold either, as it does\n     * for a kind read by its cells; a new event, which no stored row names, keeps its draft. `undefined` leaves the\n     * drafts to the host's seams, or to {@link ScheduleCellKind.isNew}.\n     */\n    readonly windowField?: string | undefined;\n    /**\n     * Whether an event is a new one — its editing session began from no stored row — for a kind narrowed through its\n     * source whose window's read draws a draft only of an event it holds, or of a new one (#1343): a draft of an\n     * existing event the narrowing does not hold, its window among it, never leaks into it. Given beside\n     * {@link ScheduleCellKind.stored}, the reader leaves out the drafts of the events its window's rows do not hold that\n     * are no new ones, asking e3 nothing. `undefined` for a kind every draft of which draws where it places its event,\n     * and for one no source narrows.\n     */\n    readonly isNew?: ((id: string) => boolean) | undefined;\n    /**\n     * Whether its editing session has yet to judge its drafts where its record reads now (the shared editing's\n     * `carrying`, #1599), for a kind given {@link ScheduleCellKind.isNew}: what the session says of an event — that it\n     * is no new one — is then of the record as it was, and a draft the reader last drew stays drawn though its window's\n     * rows, read again, hold its event no more. Another session removed it: left out as one the narrowing does not\n     * hold, it left its builder until the session's read of it landed. `undefined` for a kind whose session judges its\n     * drafts as its record is read.\n     */\n    readonly carrying?: (() => boolean) | undefined;\n    /**\n     * Its window's own stored rows over `[from, to)`, as one beast2 of {@link ScheduleCellKind.cellsType} — each row once\n     * by its key, no draft in place — or `none` while their read is in flight: its host's, for a kind read a window at a\n     * time whose events are read by their keys (through its source of the slice, or a day index). Within the cap the\n     * reader keeps them as it keeps a kind's cells (see the module docs, \"A window's rows\"). `undefined` for a kind read\n     * whole, which its host reads over the range itself.\n     */\n    readonly stored?: ((from: Date, to: Date) => option<Uint8Array>) | undefined;\n    /**\n     * The revision its record reads at now, for a kind given {@link ScheduleCellKind.stored} that no source of the slice\n     * narrows — one read through a day index: what its rows standing are told from, as from before a Save or holding\n     * it. A kind with a source reads its source's.\n     */\n    readonly revision?: (() => option<string>) | undefined;\n}\n\n/** A resource kind read whole, as the reader hatches and shades its rows: its slot, and its resources' keys' texts in order. */\nexport interface ScheduleCellResources {\n    /** Its slot. */\n    readonly key: string;\n    /** Its resources' keys' texts, in order. */\n    readonly keys: readonly string[];\n}\n\n/** The paged resource kind, as the reader reads the blocks of it in view (see the module docs). */\nexport interface ScheduleCellPaged {\n    /** Its slot. */\n    readonly kind: string;\n    /** How many of its resources a window of it holds: what a row in view's window places it by. */\n    readonly window: number;\n    /** Whether the viewer hides it: none of its rows draws, so no cell of it is read. */\n    readonly hidden: boolean;\n    /**\n     * The keys' texts of its resources `[offset, offset + limit)`, in the order its rows draw them; `none` while that\n     * window is in flight.\n     */\n    keys(offset: bigint, limit: bigint): option<readonly string[]>;\n    /** How many resources it has — its narrowing holds, when its source narrows it — once known. */\n    total(): option<bigint>;\n    /** The narrowing its windows belong to, as its source names it (#1344); `undefined` for a kind no source narrows. */\n    narrowing(): string | undefined;\n}\n\n/**\n * The paged kind's rows in view, as its host reports them: the first and the\n * last, each by its window and its key's text, and the narrowing they were\n * drawn under.\n */\nexport interface ScheduleCellSpan {\n    /** The first row in view. */\n    readonly first: { readonly w: number; readonly key: string };\n    /** The last row in view. */\n    readonly last: { readonly w: number; readonly key: string };\n    /**\n     * The narrowing the rows were drawn under, as the kind's source names it\n     * (#1344): their windows are its. `undefined` for a kind its source does\n     * not narrow.\n     */\n    readonly narrowing: string | undefined;\n}\n\n/** One bucket of the host's, by its start and its end, in ms. */\nexport interface ScheduleCellBucket {\n    /** Its start. */\n    readonly start: number;\n    /** Its end, exclusive. */\n    readonly end: number;\n}\n\n/** A range the reader read over, in ms: its start and its end, exclusive. */\nexport interface ScheduleCellRange {\n    /** Its start. */\n    readonly from: number;\n    /** Its end, exclusive. */\n    readonly to: number;\n}\n\n/** What {@link useScheduleCells} reads over. */\nexport interface ScheduleCellsArgs {\n    /** The host's name, which heads what the reader logs — `Plan`: a read that fails is said as the host's. */\n    readonly host: string;\n    /** The event kinds. */\n    readonly kinds: readonly ScheduleCellKind[];\n    /** The resource kinds read whole: a counted kind past the cap shades, or is hatched, over their rows. */\n    readonly resources: readonly ScheduleCellResources[];\n    /** The paged resource kind, when one pages. */\n    readonly paged: ScheduleCellPaged | undefined;\n    /** The range the host reads its events over. */\n    readonly range: { readonly from: Date; readonly to: Date } | undefined;\n    /**\n     * The period the range is, as text, for a host whose rows are a period's — the Calendar's day, week or month: a read\n     * for another is a step, and none of a windowed kind's rows of the last draws under it (`../view-read.ts`). Left out\n     * by a host whose range is a window panned over its rows — the Plan's — where what the last range held stands.\n     */\n    readonly period?: string | undefined;\n    /** The range cut into the host's buckets, in order: what a summary's shading is folded into. */\n    readonly buckets: readonly ScheduleCellBucket[] | undefined;\n    /** The host's resolution, which a summary's tile must divide; `undefined` on an axis of no time. */\n    readonly resolution: TimeResolution | undefined;\n    /** Every kind's drafts — the same object while they hold. */\n    readonly drafts: ScheduleEventDraftsValue;\n    /** The paged kind's rows in view, as the host last reported them; `undefined` before it has. */\n    readonly span: ScheduleCellSpan | undefined;\n    /**\n     * What confirmed Saves landed of the kinds read by their cells, as the host's editing hands them on (its `landed`):\n     * drawn over a kind's cells read before the commit until they are read again (see the module docs); `undefined` for\n     * a host that draws none.\n     */\n    readonly landed?: ScheduleLanded | undefined;\n    /**\n     * Lets go of what Saves landed of a kind once its cells are read since them, or none of them is read (its editing's\n     * `shown`).\n     */\n    readonly shown?: ((kind: string, ids: Iterable<string>) => void) | undefined;\n}\n\n// ============================================================================\n// What the reader hands its host\n// ============================================================================\n\n/** A kind giving the notice in place of its events: too many of them in the range, and no summary that shades them here. */\nexport interface ScheduleCellNotice {\n    /** The kind's slot. */\n    readonly kind: string;\n    /** Its name. */\n    readonly name: string;\n    /** How many of its events there are; `undefined` where its count is no number of them — a day index's — so they are not counted. */\n    readonly events: number | undefined;\n    /** The resolution its smallest summary shades at; `undefined` when it has none. */\n    readonly resolution: RecordTile | undefined;\n}\n\n/** The rows a kind's cells hold, by the event's key's text, each its row's bytes. */\ntype HeldRows = ScheduleKindRows;\n\n/** A read of the event kinds that failed: why, and the kinds whose own read threw. */\nexport interface ScheduleCellsFailure {\n    /** Why it failed, in the read's own words. */\n    readonly reason: string;\n    /** The slots of the kinds whose own read threw, in the kinds' order; none where the failure was no one kind's. */\n    readonly kinds: readonly string[];\n    /**\n     * Whether it was a kind's window that could not be read — its count over the range, its window's own rows, or what\n     * its narrowing holds of its drafts: what its host says its period's read failed by, with Retry. `false` for a read\n     * over the paged kind's blocks — a block's cells, the paged kind's own windows — which its host says where those\n     * rows are.\n     */\n    readonly window: boolean;\n}\n\n/** What the reader read: what its host's seams draw the kinds from, and what a gesture finds an event's row in. */\nexport interface ScheduleCellsRead {\n    /**\n     * What it read of each kind it gives cells, by the kind's slot: a kind read by its cells, their entries; one past\n     * the cap, or hidden, none. A kind it names not is read over the range by its host — a counted kind only once its\n     * count there is within the cap ({@link scheduleWithinCap}).\n     */\n    readonly reads: ScheduleCellReads;\n    /** The resources' shading. */\n    readonly shading: ScheduleCellShading;\n    /**\n     * Every kind's drafts as the seams take them: a kind read by its cells, or by its host over the window's rows alone\n     * ({@link ScheduleCellKind.windowField}), those of events its narrowing does not hold left out; over a kind's cells\n     * read before a Save of it, what the Save landed laid under them (see the module docs).\n     */\n    readonly drafts: ScheduleEventDraftsValue;\n    /**\n     * Each kind it gives cells, by its slot: the rows they hold, by the event's key's text — where a gesture finds an\n     * event's row, one it does not hold read by its key; none for a kind given none, whose range is never read. Over\n     * cells read before a Save of the kind, each event it landed as the Save left it, one it deleted read by its key.\n     */\n    readonly held: ReadonlyMap<string, HeldRows>;\n    /** The kinds giving the notice in place of their events. */\n    readonly notices: readonly ScheduleCellNotice[];\n    /**\n     * The kinds past the cap the viewer shows, by their slots: none of their events is read or drawn, so a host counts\n     * none of them on a resource's row, nor their hours anywhere — it says they are not counted, never 0. A count of them\n     * over the window that counts the events themselves still counts them there. A hidden kind is in no host's figure,\n     * and none of them.\n     */\n    readonly capped: ReadonlySet<string>;\n    /**\n     * Whether a read is in flight over a paged kind a kind is read by the cells of: the rows its cells have not landed\n     * for wait on it ({@link ScheduleCellsRead.drawn}); `false` where no kind is read so, whose reads nothing waits on,\n     * and while a read has thrown, which is in flight no more.\n     */\n    readonly reading: boolean;\n    /**\n     * The paged kind's resources whose rows draw what is known of them (#1398, CL2): those whose cells the last read\n     * landed for — while a read over another range is in flight, less those it reads again, whose cells there never\n     * landed; a read over the same range — a commit, another narrowing — leaves its cells standing in. Any other\n     * resource's rows are unread and draw the region wash under what they hold, never an empty row, and a host's\n     * figures of such a resource — an inspector's row facts — are placeholders until its cells land, never 0.\n     * `undefined` where no kind is read by its cells over a paged kind.\n     */\n    readonly drawn: ReadonlySet<string> | undefined;\n    /**\n     * The kinds whose cells are their window's own rows (see the module docs, \"A window's rows\"), by their slots: what\n     * it holds of each is of the range it was read over alone, so a host whose range is a period draws none of it under\n     * another ({@link ScheduleCellsRead.view}).\n     */\n    readonly windowed: ReadonlySet<string>;\n    /**\n     * How what it hands on stands to what its host asks now (`../view-read.ts`, the one rule every builder reads its\n     * rows by): its last complete read's period and choices beside those asked, and whether a read is on its way.\n     */\n    readonly view: ViewState;\n    /** Why its latest read failed, and the kinds whose own read threw; `undefined` while it reads, or has read. */\n    readonly error: ScheduleCellsFailure | undefined;\n}\n\n/**\n * Whether a kind is within the cap over a range (see the module docs): its\n * count there at most {@link SCHEDULE_EVENT_CAP} — the rule the reader decides\n * a counted kind by, over the range it reads, and a host's other readers ask\n * over the same range before they read the kind over it or within it.\n *\n * @param count - The kind's count ({@link ScheduleCellKind.count}) — every kind has one; a day index's, an upper bound, is past the cap wherever it is\n * @param from - The range's start\n * @param to - Its end, exclusive\n * @returns `some(true)` within the cap; `some(false)` past it; `none` while the count is in flight\n */\nexport function scheduleWithinCap(count: ScheduleCellKind[\"count\"], from: Date, to: Date): option<boolean> {\n    const counted = count(from, to);\n    return counted.type === \"some\" ? some(counted.value <= BigInt(SCHEDULE_EVENT_CAP)) : none;\n}\n\n/** A window of a paged resource kind's resources whose read failed: its host says so where its rows would be, with Retry. */\nexport const SCHEDULE_WINDOW_FAILED = \"failed\";\n\n/**\n * One window of a paged resource kind's resources, as the reader reads it\n * (see the module docs): its resources' keys' texts, in order; `undefined`\n * while it is in flight; {@link SCHEDULE_WINDOW_FAILED} for a window whose read\n * failed — the paging runtime throws a `PagedReadError` for it\n * (`isPagedReadError`). Anything else a read of it throws is no read that\n * failed, and is thrown on.\n *\n * @param paged - The paged resource kind\n * @param w - The window, by its place among the kind's\n * @returns Its keys; `undefined` in flight; {@link SCHEDULE_WINDOW_FAILED} for a read that failed\n * @throws Whatever else reading the window throws\n */\nexport function scheduleWindowKeys(paged: ScheduleCellPaged, w: number): readonly string[] | undefined | typeof SCHEDULE_WINDOW_FAILED {\n    try {\n        const keys = paged.keys(BigInt(w * paged.window), BigInt(paged.window));\n        return keys.type === \"some\" ? keys.value : undefined;\n    } catch (error) {\n        if (isPagedReadError(error)) return SCHEDULE_WINDOW_FAILED;\n        throw error;\n    }\n}\n\n// ============================================================================\n// What a reader wants: blocks, tiles and buckets\n// ============================================================================\n\n/** The resources in view of a paged resource kind, by their place in its order: the first and the last. */\nexport interface ScheduleCellView {\n    /** The first resource in view. */\n    readonly first: number;\n    /** The last resource in view. */\n    readonly last: number;\n}\n\n/**\n * No row in view reported yet: the first resource, where a view opens — the\n * first block, and the next only once the rows in view reach within\n * {@link SCHEDULE_CELL_MARGIN} of it.\n */\nexport const SCHEDULE_CELL_OPENING: ScheduleCellView = { first: 0, last: 0 };\n\n/**\n * The blocks of a paged resource kind's resources a reader wants: those\n * meeting the resources in view and {@link SCHEDULE_CELL_MARGIN} either side.\n *\n * @param view - The resources in view\n * @param total - How many resources the kind has, once known\n * @returns The blocks, by their place, ascending\n */\nexport function wantedBlocks(view: ScheduleCellView, total: number | undefined): number[] {\n    const lo = Math.max(0, view.first - SCHEDULE_CELL_MARGIN);\n    const hi = total === undefined ? view.last + SCHEDULE_CELL_MARGIN : Math.min(view.last + SCHEDULE_CELL_MARGIN, total - 1);\n    const out: number[] = [];\n    for (let b = Math.floor(lo / SCHEDULE_CELL_BLOCK); b <= Math.floor(hi / SCHEDULE_CELL_BLOCK); b++) out.push(b);\n    return hi < lo ? [] : out;\n}\n\n/** The tiles that divide a bucket of each resolution — a bucket is a union of whole ones — the largest first. */\nconst DIVIDING: Readonly<Record<TimeResolution, readonly RecordTile[]>> = {\n    hour: [],\n    day: [\"day\"],\n    week: [\"week\", \"day\"],\n    month: [\"month\", \"day\"],\n    quarter: [\"quarter\", \"month\", \"day\"],\n    year: [\"year\", \"quarter\", \"month\", \"day\"],\n};\n\n/**\n * The tiles a summary may shade a resolution's buckets by: those that divide\n * its bucket, the largest first — an ISO week divides no month.\n *\n * @param resolution - The host's resolution; `undefined` on an axis of no time\n * @returns The tiles\n */\nexport function dividingTiles(resolution: TimeResolution | undefined): readonly RecordTile[] {\n    return resolution === undefined ? [] : DIVIDING[resolution];\n}\n\n/** How many events touch a tile, and the milliseconds of it they cover: a summary's totals, as numbers. */\nexport interface ScheduleCellTotals {\n    /** How many events touch it. */\n    readonly count: number;\n    /** The milliseconds of it they cover. */\n    readonly ms: number;\n}\n\n/**\n * One resource's shading over the buckets (#1039): the totals of the summary\n * tiles inside each bucket added up — a tile that divides the bucket lies\n * wholly inside it — as the share of the bucket booked, at most all of it,\n * or how many events touch it.\n *\n * @param totals - The resource's totals, by tile start in ms\n * @param buckets - The buckets\n * @param booked - Whether its rows book their buckets: the share booked; else how many\n * @returns Its shading, a bucket each\n */\nexport function shadesOf(totals: ReadonlyMap<number, ScheduleCellTotals> | undefined, buckets: readonly ScheduleCellBucket[], booked: boolean): ScheduleCellShade[] {\n    return buckets.map(({ start, end }) => {\n        let count = 0;\n        let ms = 0;\n        for (const [at, t] of totals ?? []) {\n            if (at < start || at >= end) continue;\n            count += t.count;\n            ms += t.ms;\n        }\n        return { at: new Date(start), value: some(booked ? Math.min(1, ms / (end - start)) : count) };\n    });\n}\n\n/** The no-data hatch over the buckets: the notice's, a resource's row that shows nothing at this resolution. */\nfunction hatchOf(buckets: readonly ScheduleCellBucket[]): ScheduleCellShade[] {\n    return buckets.map(({ start }) => ({ at: new Date(start), value: none }));\n}\n\n// ============================================================================\n// What a reader reads\n// ============================================================================\n\n/** A read whose counts or cells are still in flight. */\nconst READING = \"reading\";\n\n/** The shading's totals, by a row's key, then by the resource's key: each tile's totals, or the hatch. */\ntype Totals = Map<string, { booked: boolean; byKey: Map<string, Map<number, ScheduleCellTotals> | \"hatch\"> }>;\n\n/**\n * One read of every kind, the drafts each kind read by its cells leaves out, by the kind's slot, the paged kind's\n * resources whose cells it holds — `undefined` where no kind reads its cells over a paged kind — the range it was made\n * over, `undefined` before the first, and the revision each kind read by its cells was read at, by its slot.\n */\ntype Read = Omit<ScheduleCellsRead, \"reading\" | \"drawn\" | \"view\" | \"error\"> & {\n    readonly dropped: ReadonlyMap<string, ReadonlySet<string>>;\n    readonly covered: ReadonlySet<string> | undefined;\n    readonly range: ScheduleCellRange | undefined;\n    readonly revisions: ReadonlyMap<string, string>;\n    /** The view it was made for: its host's period, and each kind's source's choices. */\n    readonly made: ReadView;\n};\n\n/** No resource: what a reader that has read no block of the paged kind's wants. */\nconst NO_RESOURCES: ReadonlySet<string> = new Set();\n/** No kind past the cap. */\nconst NONE_CAPPED: ReadonlySet<string> = new Set();\n/** No rows: what a kind given no cells holds — a gesture reads one of its events by its key, never over the range. */\nconst NO_ROWS: HeldRows = new Map();\n/** No drafted event left out. */\nconst NO_IDS: ReadonlySet<string> = new Set();\n/** No kind read by its cells: no revision any was read at. */\nconst NO_REVISIONS: ReadonlyMap<string, string> = new Map();\n/** No kind whose cells stand from before a Save of it: nothing laid. */\nconst NOTHING_LAID: ReadonlyMap<string, ScheduleLandedRows> = new Map();\n/** No kind whose cells are its window's rows. */\nconst NONE_WINDOWED: ReadonlySet<string> = new Set();\n/** No view asked yet: before a reader's first read. */\nconst NO_VIEW: ReadView = { period: \"\", choices: \"\" };\n\n/** Whether two sets of resource keys hold the same keys. */\nfunction sameKeys(a: ReadonlySet<string> | undefined, b: ReadonlySet<string> | undefined): boolean {\n    if (a === undefined || b === undefined) return a === b;\n    return a.size === b.size && [...a].every((key) => b.has(key));\n}\n\n/** Whether two ranges are the same range. */\nfunction sameRange(a: ScheduleCellRange | undefined, b: ScheduleCellRange | undefined): boolean {\n    if (a === undefined || b === undefined) return a === b;\n    return a.from === b.from && a.to === b.to;\n}\n\n/** One kind's read: by its cells, at the revision they were read at. */\ntype KindRead =\n    | {\n        readonly mode: \"cells\"; readonly cells: Uint8Array; readonly held: HeldRows; readonly dropped: ReadonlySet<string>; readonly revision: string;\n        /** Whether they are a series index's cells over the paged kind's blocks; `false` for its window's own rows. */\n        readonly paged: boolean;\n    }\n    | { readonly mode: \"shade\"; readonly cells: Uint8Array; readonly notice: ScheduleCellNotice | undefined; readonly paged: boolean }\n    | { readonly mode: \"window\" };\n\n/** A kind's types, as its cells are encoded in. */\ninterface KindCodec {\n    readonly compareKey: (a: unknown, b: unknown) => number;\n    readonly idOf: (key: unknown) => string;\n    readonly keyOf: (id: string) => unknown;\n    readonly encodeCells: (entries: { key: unknown; row: unknown }[]) => Uint8Array;\n    readonly decodeCells: (bytes: Uint8Array) => { key: unknown; row: unknown }[];\n    readonly encodeRow: (row: unknown) => Uint8Array;\n    readonly empty: Uint8Array;\n}\n\n/**\n * The rows a window's stored cells hold, by the event's key's text (see the module docs, \"A window's rows\"): decoded\n * when one is first asked for, and each row's bytes made when it is. A window's rows are handed on at every draft's\n * redraw, and asked for a row only as a gesture or an inspector wants one.\n */\nclass StoredRows implements ScheduleKindRows {\n    private decoded: Map<string, unknown> | undefined;\n    private readonly encoded = new Map<string, { readonly row: Uint8Array }>();\n\n    /**\n     * @param codec - The kind's codec\n     * @param bytes - Its window's rows, one beast2 of its cells' type\n     */\n    constructor(private readonly codec: KindCodec, private readonly bytes: Uint8Array) {}\n\n    /** The rows by the event's key's text, decoded once. */\n    private rows(): Map<string, unknown> {\n        if (this.decoded === undefined) {\n            this.decoded = new Map();\n            for (const entry of this.codec.decodeCells(this.bytes)) this.decoded.set(this.codec.idOf(entry.key), entry.row);\n        }\n        return this.decoded;\n    }\n\n    has(id: string): boolean {\n        return this.rows().has(id);\n    }\n\n    get(id: string): { readonly row: Uint8Array } | undefined {\n        const made = this.encoded.get(id);\n        if (made !== undefined) return made;\n        const rows = this.rows();\n        if (!rows.has(id)) return undefined;\n        const row = { row: this.codec.encodeRow(rows.get(id)) };\n        this.encoded.set(id, row);\n        return row;\n    }\n\n    *[Symbol.iterator](): Iterator<readonly [string, { readonly row: Uint8Array }]> {\n        for (const id of this.rows().keys()) yield [id, this.get(id)!];\n    }\n}\n\n/** A kind's rows with what Saves landed laid over them: each landed event's row as its Save left it, one it deleted gone. */\nclass LaidRows implements ScheduleKindRows {\n    /**\n     * @param under - The rows the kind's cells hold\n     * @param landed - What Saves landed of the kind, by the event's key's text\n     */\n    constructor(private readonly under: ScheduleKindRows, private readonly landed: ReadonlyMap<string, ScheduleLandedRow>) {}\n\n    has(id: string): boolean {\n        const laid = this.landed.get(id);\n        return laid === undefined ? this.under.has(id) : laid.row !== undefined;\n    }\n\n    get(id: string): { readonly row: Uint8Array } | undefined {\n        const laid = this.landed.get(id);\n        if (laid === undefined) return this.under.get(id);\n        return laid.row === undefined ? undefined : { row: laid.row };\n    }\n\n    *[Symbol.iterator](): Iterator<readonly [string, { readonly row: Uint8Array }]> {\n        for (const entry of this.under) if (!this.landed.has(entry[0])) yield entry;\n        for (const [id, laid] of this.landed) if (laid.row !== undefined) yield [id, { row: laid.row }];\n    }\n}\n\n/** What a read of one kind threw, and the kind: what a failed read names the kinds it could not read by. */\nclass KindReadFailure extends Error {\n    /**\n     * @param thrown - What the kind's read threw\n     * @param kind - The kind's slot\n     * @param window - Whether it was the kind's window that threw: its count over the range, its window's own rows, or\n     *   what its narrowing holds of its drafts\n     */\n    constructor(readonly thrown: unknown, readonly kind: string, readonly window: boolean) {\n        super(thrown instanceof Error ? thrown.message : String(thrown));\n        this.name = \"KindReadFailure\";\n    }\n}\n\n/** A cell's searches, as a key of what the reader keeps. */\nfunction cellText(index: string, cell: RecordSliceCell): string {\n    return `${index}\\u0000${printQueries([...cell.queries])}`;\n}\n\n/** A narrowing without its range of the field an index's tiles cover: the tiles hold the range. */\nfunction withoutTiled(where: Where, from: string): Map<string, ValueTypeOf<typeof RecordSliceChoiceType>> {\n    return new Map([...where].filter(([field, choice]) => !(stringEqual(field, from) && choice.type === \"range\")));\n}\n\n/** The fields of a narrowing an index's cells do not answer: all but its leading fields, and a range of its start. */\nfunction residualOf(index: Index, where: Where): string[] {\n    const tiling = tilingOf(index)!;\n    // An index's fields are its leading fields alone, its key's `on` (#1432).\n    const leading = index.fields;\n    return [...where].filter(([field, choice]) => !leading.some((l) => stringEqual(l, field)) && !(stringEqual(field, tiling.from) && choice.type === \"range\"))\n        .map(([field]) => field);\n}\n\n/** A block of resources and their keys' texts: what a cell holds of them. */\ninterface Block {\n    /** Where the block's rows draw: a resource kind's slot. */\n    readonly slot: string;\n    /** Its place, among its kind's blocks. */\n    readonly index: number;\n    /** Its resources' keys' texts, in order. */\n    readonly keys: readonly string[];\n}\n\n/** A block of keys a series cell is read for (#1433): a block of the paged kind's resources by its place, or the events on none. */\ninterface CellGroup {\n    /** Its name among the groups a read asks for. */\n    readonly id: string;\n    /** Its keys, as `.east` literals of the index's key field, in order. */\n    readonly literals: readonly string[];\n}\n\n/**\n * A group's tiles of one level a reader holds (#1433): contiguous, from `from`\n * to `to`, half-open, each tile's entries by its start — a tile no entry is\n * filed under holds none — and the entries of them all, in the tiles' order.\n */\ninterface Span {\n    /** What its searches were made from: the group's keys and the narrowing's choices of the index's leading fields. */\n    readonly identity: string;\n    readonly from: number;\n    readonly to: number;\n    readonly byTile: ReadonlyMap<number, readonly RecordSliceEntry[]>;\n    readonly entries: readonly RecordSliceEntry[];\n}\n\n/**\n * A series read's outcome (#1433): each group's entries a level, at the revision they were read at, or how many its runs\n * hold, past the cap.\n */\ntype SeriesEntries = { readonly entries: readonly (readonly RecordSliceEntry[])[]; readonly revision: string } | { readonly count: number };\n\nconst printChoice = printFor(RecordSliceChoiceType);\n\n/** The start of the tile an index entry names: a series' or a summary's, its key's `tile`. */\nconst tileOf = (entry: RecordSliceEntry): number => (entry.ik.value as { readonly tile: Date }).tile.getTime();\n\n/** Whether a kind is read by its cells: placed on the paged kind, its source listing a series index of its record. */\nfunction readByCells(kind: ScheduleCellKind, paged: ScheduleCellPaged | undefined): boolean {\n    return paged !== undefined && kind.part !== undefined && kind.takes.some((slot) => stringEqual(slot, paged.kind))\n        && kind.part.config.indexes.some((index) => index.series.type === \"some\");\n}\n\n/**\n * The reader's state across reads: the cells it holds, each kind's codec and\n * the series keys it has asked its kinds for.\n */\nclass CellsReader {\n    /** The cells each kind's summary read holds, by the kind's slot and index: their entries by their searches' text, at a revision. */\n    private readonly kept = new Map<string, { revision: string; cells: Map<string, RecordSliceEntry[]> }>();\n    /** The tiles each kind's series read holds (#1433), by the kind's slot and index: each group's span a level, at a revision. */\n    private readonly spans = new Map<string, { revision: string; spans: ReadonlyMap<string, Span> }>();\n    private readonly codecs = new WeakMap<object, KindCodec>();\n    private readonly literals = new WeakMap<object, Map<string, string | undefined>>();\n    private readonly unassigned = new WeakMap<object, { literal: string | undefined }>();\n    /** Each kind's last encoded cells and rows held, by what they were made from: a read again that holds the same encodes nothing. */\n    private readonly encoded = new Map<string, { from: readonly unknown[]; bytes: Uint8Array; held: HeldRows }>();\n    /** The paged kind's resources whose blocks the latest read wants — landed or in flight — the same set while they hold. */\n    private wantedKeys: ReadonlySet<string> = NO_RESOURCES;\n    /** The revision each kind read by its cells reads at now, as the latest read found it, by its slot — the same map while it says the same. */\n    private nowAt: ReadonlyMap<string, string> = NO_REVISIONS;\n    /**\n     * The rows each kind's window read holds (see the module docs, \"A window's rows\"), by the kind's slot: kept while its\n     * record's revision, its narrowing and the range — what they are named by, `at` — hold.\n     */\n    private readonly windows = new Map<string, { readonly at: string; readonly bytes: Uint8Array; readonly held: StoredRows }>();\n    /** The view the latest read was asked for, in flight or not — the same object while it says the same. */\n    private askedView: ReadView = NO_VIEW;\n    /**\n     * Which drafts a kind given {@link ScheduleCellKind.isNew} draws, and those its last read drew: what stands through\n     * a carry-over (`drafted-rows.ts`).\n     */\n    private readonly standing = new DraftedStanding();\n\n    /** The paged kind's resources whose blocks the latest read wants (#1398): while it is in flight, the rows it reads again. */\n    wanted(): ReadonlySet<string> {\n        return this.wantedKeys;\n    }\n\n    /**\n     * The revision each kind read by its cells reads at now, by its slot, whatever of the latest read is in flight — none\n     * for a kind whose record names none yet: cells standing from a read at another revision are from before it.\n     */\n    current(): ReadonlyMap<string, string> {\n        return this.nowAt;\n    }\n\n    /** The view the latest read was asked for, whatever of it is in flight: its host's period, and each kind's source's choices. */\n    asked(): ReadView {\n        return this.askedView;\n    }\n\n    /** The revision a kind's record reads at now: its source's, else its host's say of it; `none` while it is not known. */\n    private revisionOf(kind: ScheduleCellKind): option<string> {\n        if (kind.part !== undefined) return recordSliceRevision(kind.part);\n        return kind.revision === undefined ? none : kind.revision();\n    }\n\n    /** A kind's source's choices, printed — but its window's range, which the range read holds; the empty text for a kind no source narrows. */\n    private choicesOf(kind: ScheduleCellKind): string {\n        if (kind.part === undefined) return \"\";\n        const where: Where = kind.part.read().where;\n        return printWhere(new SortedMap([...(kind.windowField === undefined ? where : withoutTiled(where, kind.windowField))], compareString));\n    }\n\n    /**\n     * A kind read a window at a time, within the cap (see the module docs, \"A window's rows\"): its window's own stored\n     * rows, kept at the revision they were read at while its record, its narrowing and the range hold.\n     *\n     * @returns Its rows as its cells; {@link READING} while its revision or its window's read is in flight\n     */\n    private windowKind(kind: ScheduleCellKind, range: { from: Date; to: Date }): KindRead | typeof READING {\n        const revision = this.revisionOf(kind);\n        if (revision.type !== \"some\") return READING;\n        const at = `${revision.value}\\u0000${this.choicesOf(kind)}\\u0000${range.from.getTime()}\\u0000${range.to.getTime()}`;\n        let kept = this.windows.get(kind.key);\n        if (kept === undefined || !stringEqual(kept.at, at)) {\n            const read = kind.stored!(range.from, range.to);\n            if (read.type !== \"some\") return READING;\n            kept = { at, bytes: read.value, held: new StoredRows(this.codecOf(kind), read.value) };\n            this.windows.set(kind.key, kept);\n        }\n        return { mode: \"cells\", cells: kept.bytes, held: kept.held, dropped: NO_IDS, revision: revision.value, paged: false };\n    }\n\n    /**\n     * A read of a kind's own window — its count over the range, its window's rows, what its narrowing holds of its\n     * drafts: one that throws is named the kind's window's ({@link ScheduleCellsFailure.window}).\n     */\n    private own<T>(kind: ScheduleCellKind, read: () => T): T {\n        try {\n            return read();\n        } catch (thrown) {\n            throw thrown instanceof KindReadFailure ? thrown : new KindReadFailure(thrown, kind.key, true);\n        }\n    }\n\n    /** A kind's codec, made once per kind's cells' type. */\n    codecOf(kind: ScheduleCellKind): KindCodec {\n        let codec = this.codecs.get(kind.cellsType);\n        if (codec === undefined) {\n            const cellsType = fromEastTypeValue(kind.cellsType) as ArrayType<StructType>;\n            const fields = cellsType.value.fields as Record<string, EastType>;\n            const keyType = fields[\"key\"]!;\n            const printKey = printFor(keyType);\n            const parseKey = parseFor(keyType);\n            const encodeCells = encodeBeast2For(cellsType) as (entries: { key: unknown; row: unknown }[]) => Uint8Array;\n            const string = keyType.type === \"String\";\n            codec = {\n                compareKey: compareFor(keyType) as (a: unknown, b: unknown) => number,\n                // An entry's id is its key's text: a String key as it is, any other key as East prints it.\n                idOf: (key) => (string ? key as string : printKey(key as never)),\n                keyOf: (id) => {\n                    if (string) return id;\n                    const read = parseKey(id);\n                    return read.success ? read.value : undefined;\n                },\n                encodeCells,\n                decodeCells: decodeBeast2For(cellsType) as (bytes: Uint8Array) => { key: unknown; row: unknown }[],\n                encodeRow: encodeBeast2For(fields[\"row\"]!) as (row: unknown) => Uint8Array,\n                empty: encodeCells([]),\n            };\n            this.codecs.set(kind.cellsType, codec);\n        }\n        return codec;\n    }\n\n    /** The `.east` text a kind's series and summary indexes file a resource's events under; `undefined` for one its field cannot name. */\n    private literal(kind: ScheduleCellKind, slot: string, key: string): string | undefined {\n        let held = this.literals.get(kind.seriesKey);\n        if (held === undefined) { held = new Map(); this.literals.set(kind.seriesKey, held); }\n        const at = `${slot}\\u0000${key}`;\n        if (!held.has(at)) {\n            const literal = kind.seriesKey(some({ kind: slot, key }));\n            held.set(at, literal.type === \"some\" ? literal.value : undefined);\n        }\n        return held.get(at);\n    }\n\n    /** The `.east` text a kind's indexes file its events on no resource under; `undefined` for a field that must name one. */\n    private noResource(kind: ScheduleCellKind): string | undefined {\n        let held = this.unassigned.get(kind.seriesKey);\n        if (held === undefined) {\n            const literal = kind.seriesKey(none);\n            held = { literal: literal.type === \"some\" ? literal.value : undefined };\n            this.unassigned.set(kind.seriesKey, held);\n        }\n        return held.literal;\n    }\n\n    /**\n     * A kind's cells, encoded, and the rows they hold by the event's key's\n     * text: made again only when what they are made from moved — the cells'\n     * entries, the rows read by key and what the narrowing answered of them.\n     */\n    private encode(slot: string, codec: KindCodec, from: readonly unknown[], rows: ReadonlyMap<unknown, unknown>): { bytes: Uint8Array; held: HeldRows } {\n        const last = this.encoded.get(slot);\n        if (last !== undefined && last.from.length === from.length && last.from.every((part, i) => Object.is(part, from[i]))) return last;\n        const entries: { key: unknown; row: unknown }[] = [];\n        const held = new Map<string, { readonly row: Uint8Array }>();\n        for (const [key, row] of rows) {\n            entries.push({ key, row });\n            held.set(codec.idOf(key), { row: codec.encodeRow(row) });\n        }\n        const made = { from, bytes: codec.encodeCells(entries), held };\n        this.encoded.set(slot, made);\n        return made;\n    }\n\n    /**\n     * The cells' entries a kind's read holds, at the record's revision now:\n     * those of the wanted cells it does not hold read in one request, and\n     * every cell no longer wanted let go.\n     *\n     * @returns Each wanted cell's entries, in order; none while the revision or the read is in flight\n     */\n    private entriesOf(at: string, part: ScheduleCellPart, index: string, cells: readonly RecordSliceCell[]): option<RecordSliceEntry[][]> {\n        const revision = recordSliceRevision(part);\n        if (revision.type !== \"some\") return none;\n        let kept = this.kept.get(at);\n        if (kept === undefined || !stringEqual(kept.revision, revision.value)) {\n            kept = { revision: revision.value, cells: new Map() };\n            this.kept.set(at, kept);\n        }\n        const texts = cells.map((cell) => cellText(index, cell));\n        const missing = cells.filter((_cell, i) => !kept.cells.has(texts[i]!));\n        if (missing.length > 0) {\n            const read = recordSliceCellEntries(part, index, missing);\n            if (read.type !== \"some\") return none;\n            for (const cell of missing) kept.cells.set(cellText(index, cell), read.value.get(cell.id) ?? []);\n        }\n        const wanted = new Set(texts);\n        for (const text of [...kept.cells.keys()]) if (!wanted.has(text)) kept.cells.delete(text);\n        return some(texts.map((text) => kept.cells.get(text)!));\n    }\n\n    /**\n     * A kind's series cells over the runs wanted, at the record's revision now\n     * (#1433): each group's run of each level, the entries of its tiles held\n     * and of the parts of it not held — one range a key over each part, their\n     * searches in one request that counts them first, then their entries in\n     * one more, each kept under the tile it names — and every span no longer\n     * wanted let go.\n     *\n     * @returns Each group's entries a level, in order; how many the runs hold, past {@link SCHEDULE_EVENT_CAP}, the parts\n     *   not held unread; {@link READING} while the revision, a count or a read is in flight\n     */\n    private seriesEntries(at: string, part: ScheduleCellPart, series: Index, where: Where, groups: readonly CellGroup[], runs: readonly TileRun[]):\n        SeriesEntries | typeof READING {\n        const revision = recordSliceRevision(part);\n        if (revision.type !== \"some\") return READING;\n        const last = this.spans.get(at);\n        const kept = last !== undefined && stringEqual(last.revision, revision.value) ? last.spans : new Map<string, Span>();\n        const leading = series.fields.map((field) => {\n            const choice = where.get(field);\n            return choice === undefined ? \"\" : printChoice(choice);\n        }).join(\"\\u0001\");\n        // Each group's run of each level: the span of it held, and a cell for each part of it not held.\n        const wanted: { key: string; identity: string; from: number; to: number; held: Span | undefined; cells: RecordSliceCell[] }[] = [];\n        const missing: RecordSliceCell[] = [];\n        for (const group of groups) {\n            const identity = `${group.literals.join(\"\\u0001\")}\\u0000${leading}`;\n            for (const run of runs) {\n                const key = `${group.id}\\u0000${run.level}`;\n                const from = run.from.getTime();\n                const to = run.to.getTime();\n                const span = kept.get(key);\n                const held = span !== undefined && stringEqual(span.identity, identity) && span.from < to && span.to > from ? span : undefined;\n                const parts: [number, number][] = held === undefined ? [[from, to]] : [];\n                if (held !== undefined && from < held.from) parts.push([from, held.from]);\n                if (held !== undefined && held.to < to) parts.push([held.to, to]);\n                const cells = parts.map(([a, b]) => ({\n                    id: `${group.id}@${run.level}@${a}`,\n                    queries: levelCellQueries(series, where, { level: run.level, from: new Date(a), to: new Date(b) }, group.literals).queries,\n                }));\n                missing.push(...cells);\n                wanted.push({ key, identity, from, to, held, cells });\n            }\n        }\n        // Counted first: the entries of the tiles held, and of the parts not held, before one of those is read.\n        let count = 0;\n        for (const { from, to, held } of wanted) {\n            if (held === undefined) continue;\n            for (const [tile, entries] of held.byTile) if (tile >= from && tile < to) count += entries.length;\n        }\n        if (missing.length > 0) {\n            const found = recordSliceCellRuns(part, series.name, missing);\n            if (found.type !== \"some\") return READING;\n            for (const cell of missing) count += Number(found.value.get(cell.id)?.total ?? 0n);\n        }\n        if (count > SCHEDULE_EVENT_CAP) return { count };\n        let read: ReadonlyMap<string, RecordSliceEntry[]> = new Map();\n        if (missing.length > 0) {\n            const got = recordSliceCellEntries(part, series.name, missing);\n            if (got.type !== \"some\") return READING;\n            read = got.value;\n        }\n        const spans = new Map<string, Span>();\n        const entries = wanted.map(({ key, identity, from, to, held, cells }) => {\n            let span = held !== undefined && held.from === from && held.to === to ? held : undefined;\n            if (span === undefined) {\n                const byTile = new Map<number, RecordSliceEntry[]>();\n                if (held !== undefined) for (const [tile, list] of held.byTile) if (tile >= from && tile < to) byTile.set(tile, [...list]);\n                for (const cell of cells) {\n                    for (const entry of read.get(cell.id) ?? []) {\n                        const tile = tileOf(entry);\n                        const list = byTile.get(tile);\n                        if (list === undefined) byTile.set(tile, [entry]);\n                        else list.push(entry);\n                    }\n                }\n                const ordered = [...byTile.keys()].sort((a, b) => a - b).flatMap((tile) => byTile.get(tile)!);\n                span = { identity, from, to, byTile, entries: ordered };\n            }\n            spans.set(key, span);\n            return span.entries;\n        });\n        // The spans this read wants, and no other.\n        this.spans.set(at, { revision: revision.value, spans });\n        return { entries, revision: revision.value };\n    }\n\n    /**\n     * A read of every kind (see the module docs).\n     *\n     * @param args - What it reads over\n     * @returns What it read; {@link READING} while a count, or a cell's count or entries, are in flight\n     */\n    read(args: Omit<ScheduleCellsArgs, \"host\">): Read | typeof READING {\n        const { kinds, resources, paged, range, period, buckets, resolution, drafts, span } = args;\n        // The revision each kind read by its cells, or its window's rows, reads at now, before anything of the read is in\n        // flight: what cells standing from an earlier read are told from, as from before a Save or holding it. And each\n        // narrowed kind's choices: what the read is asked under.\n        const now = new Map<string, string>();\n        const choices: string[] = [];\n        for (const kind of kinds) {\n            if (kind.hidden) continue;\n            if (kind.part !== undefined) choices.push(`${kind.key}\\u0000${this.choicesOf(kind)}`);\n            if (!readByCells(kind, paged) && kind.stored === undefined) continue;\n            const revision = this.revisionOf(kind);\n            if (revision.type === \"some\") now.set(kind.key, revision.value);\n        }\n        if (!sameRevisions(now, this.nowAt)) this.nowAt = now.size === 0 ? NO_REVISIONS : now;\n        // The view asked, whatever of the read is in flight: the host's period, and those choices.\n        const made: ReadView = { period: period ?? \"\", choices: choices.join(\"\\u0001\") };\n        if (!sameView(made, this.askedView)) this.askedView = made;\n        if (range === undefined || buckets === undefined) return READING;\n        const reads: [string, Uint8Array][] = [];\n        const held = new Map<string, HeldRows>();\n        const dropped = new Map<string, ReadonlySet<string>>();\n        const revisions = new Map<string, string>();\n        const notices: ScheduleCellNotice[] = [];\n        const capped = new Set<string>();\n        const windowed = new Set<string>();\n        const over: ScheduleCellRange = { from: range.from.getTime(), to: range.to.getTime() };\n        // The shading, by a row's key, then by the resource's key: each tile's totals, or the hatch.\n        const totals: Totals = new Map();\n        // The paged kind's blocks in view, read once for every kind placed on it — and its resources wanted, kept.\n        let pagedBlocks: Block[] | typeof READING | undefined;\n        const blocksOfPaged = (): Block[] | typeof READING => {\n            if (pagedBlocks !== undefined) return pagedBlocks;\n            pagedBlocks = paged === undefined || paged.hidden ? [] : this.pagedBlocks(paged, span);\n            if (pagedBlocks !== READING) {\n                const wanted = new Set(pagedBlocks.flatMap((block) => block.keys));\n                if (!sameKeys(wanted, this.wantedKeys)) this.wantedKeys = wanted;\n            }\n            return pagedBlocks;\n        };\n        // A kind's resources' blocks, a counted kind's past the cap: the paged kind's in view, and every resource read whole.\n        const blocksOf = (kind: ScheduleCellKind): Block[] | typeof READING => {\n            const out: Block[] = [];\n            for (const slot of kind.takes) {\n                if (paged !== undefined && stringEqual(slot, paged.kind)) {\n                    const blocks = blocksOfPaged();\n                    if (blocks === READING) return READING;\n                    out.push(...blocks);\n                    continue;\n                }\n                const keys = resources.find((r) => stringEqual(r.key, slot))?.keys ?? [];\n                for (let at = 0; at < keys.length; at += SCHEDULE_CELL_BLOCK) {\n                    out.push({ slot, index: at / SCHEDULE_CELL_BLOCK, keys: keys.slice(at, at + SCHEDULE_CELL_BLOCK) });\n                }\n            }\n            return out;\n        };\n        // Whether a kind drew its cells, or its shading, over the paged kind's blocks: then its rows draw what they hold.\n        let byCells = false;\n        for (const kind of kinds) {\n            let read: KindRead | typeof READING;\n            let outside: ReadonlySet<string> | typeof READING = NO_IDS;\n            // A kind whose own read throws is named by the failure: what its host says could not be read, and asks again.\n            try {\n                if (readByCells(kind, paged)) {\n                    if (kind.hidden) {\n                        // Hidden: it draws nothing, so no cell of it is read — and given none, nothing reads its range.\n                        read = { mode: \"shade\", cells: this.codecOf(kind).empty, notice: undefined, paged: false };\n                    } else {\n                        const blocks = blocksOfPaged();\n                        read = blocks === READING ? READING : this.cellsKind(kind, kind.part!, kind.part!.read().where, blocks, range, buckets, resolution, drafts, totals);\n                    }\n                } else {\n                    read = this.countedKind(kind, range, buckets, resolution, totals, blocksOf);\n                    // A narrowed kind every draft of which draws where it places its event — one given its window's rows,\n                    // or read by its host over them alone (#1424): the drafts of events its narrowing does not hold left\n                    // out, as a kind read by its cells leaves them.\n                    if (read !== READING && kind.windowField !== undefined && kind.part !== undefined && !kind.hidden) {\n                        const { part, windowField } = kind;\n                        const held = read.mode === \"cells\" ? read.held : undefined;\n                        outside = this.own(kind, () => this.draftsOutside(kind, part, windowField, drafts, held));\n                    } else if (read !== READING && read.mode === \"cells\" && kind.isNew !== undefined) {\n                        // A kind whose window draws a draft only of an event it holds, or of a new one (#1343): the\n                        // drafts of the other events left out, told by the rows held and where each draft began — but\n                        // one drawn last, while its session has yet to judge it where its record reads now (#1599).\n                        outside = draftsNotHeld(kind.key, drafts.get(kind.key), read.held, kind.isNew, kind.carrying?.() === true, this.standing);\n                    }\n                }\n            } catch (thrown) {\n                throw thrown instanceof KindReadFailure ? thrown : new KindReadFailure(thrown, kind.key, false);\n            }\n            if (read === READING || outside === READING) return READING;\n            if (outside.size > 0) dropped.set(kind.key, outside);\n            switch (read.mode) {\n                // Its host reads it over the range, as it reads a kind no reader names.\n                case \"window\": continue;\n                case \"cells\":\n                    reads.push([kind.key, read.cells]);\n                    held.set(kind.key, read.held);\n                    if (read.dropped.size > 0) dropped.set(kind.key, read.dropped);\n                    revisions.set(kind.key, read.revision);\n                    // A series index's cells draw over the paged kind's blocks; a window's rows are the range's alone.\n                    if (read.paged) byCells = true;\n                    else windowed.add(kind.key);\n                    break;\n                case \"shade\":\n                    reads.push([kind.key, read.cells]);\n                    held.set(kind.key, NO_ROWS);\n                    if (read.notice !== undefined) notices.push(read.notice);\n                    if (read.paged) byCells = true;\n                    // Past the cap: none of its events is read, so no host counts one of them on a row. A hidden kind is in\n                    // no host's figure at all, so it is named here by none.\n                    if (!kind.hidden) capped.add(kind.key);\n                    break;\n            }\n        }\n        return {\n            reads: new SortedMap(reads, compareString),\n            shading: shadingOf(totals, buckets),\n            drafts: narrowedDrafts(drafts, dropped),\n            held,\n            notices,\n            capped: capped.size === 0 ? NONE_CAPPED : capped,\n            dropped,\n            // The resources whose cells this read holds: its blocks', where a kind drew its cells or its shading on them.\n            covered: byCells ? this.wantedKeys : undefined,\n            range: over,\n            revisions: revisions.size === 0 ? NO_REVISIONS : revisions,\n            windowed: windowed.size === 0 ? NONE_WINDOWED : windowed,\n            made: this.askedView,\n        };\n    }\n\n    /**\n     * The paged kind's blocks in view, each its resources' keys; {@link READING} while a window of them is in flight,\n     * and while the rows in view are another narrowing's than the one the windows read now (#1344): a choice's rows\n     * still to land and be reported, whose places the last narrowing's windows do not hold.\n     */\n    private pagedBlocks(paged: ScheduleCellPaged, span: ScheduleCellSpan | undefined): Block[] | typeof READING {\n        const narrowing = paged.narrowing();\n        if (span !== undefined && !sameNarrowing(span.narrowing, narrowing)) return READING;\n        const size = paged.window;\n        // Where a row in view sits in the kind's order: its window's start, while its window's keys are read. A window\n        // whose read failed gives no block — its host says so where its rows would be, with its Retry, and no cell of it\n        // is read until a Retry lands it.\n        const place = (at: ScheduleCellSpan[\"first\"]): number => {\n            const keys = scheduleWindowKeys(paged, at.w);\n            const i = Array.isArray(keys) ? keys.findIndex((key) => stringEqual(key, at.key)) : -1;\n            return at.w * size + Math.max(0, i);\n        };\n        const view = span === undefined ? SCHEDULE_CELL_OPENING : { first: place(span.first), last: place(span.last) };\n        const total = paged.total();\n        const blocks: Block[] = [];\n        for (const b of wantedBlocks(view, total.type === \"some\" ? Number(total.value) : undefined)) {\n            const w = Math.floor((b * SCHEDULE_CELL_BLOCK) / size);\n            const keys = scheduleWindowKeys(paged, w);\n            if (keys === undefined) return READING;\n            if (keys === SCHEDULE_WINDOW_FAILED) continue;\n            const at = b * SCHEDULE_CELL_BLOCK - w * size;\n            const own = keys.slice(at, at + SCHEDULE_CELL_BLOCK);\n            if (own.length > 0) blocks.push({ slot: paged.kind, index: b, keys: own });\n        }\n        return blocks;\n    }\n\n    /**\n     * A kind counted before one of its events is read (see the module docs):\n     * within the cap, left to its host to read over the range; past it, its\n     * summary's shading, or the notice — or, hidden, nothing.\n     */\n    private countedKind(\n        kind: ScheduleCellKind, range: { from: Date; to: Date }, buckets: readonly ScheduleCellBucket[], resolution: TimeResolution | undefined,\n        totals: Totals, blocksOf: (kind: ScheduleCellKind) => Block[] | typeof READING,\n    ): KindRead | typeof READING {\n        const within = this.own(kind, () => scheduleWithinCap(kind.count, range.from, range.to));\n        if (within.type !== \"some\") return READING;\n        // Within the cap: a kind read a window at a time is given its window's rows; one read whole, or hidden, is left\n        // to its host.\n        if (within.value) return kind.stored === undefined || kind.hidden ? { mode: \"window\" } : this.own(kind, () => this.windowKind(kind, range));\n        // Past the cap: none of its events is read or drawn.\n        if (kind.hidden) return { mode: \"shade\", cells: this.codecOf(kind).empty, notice: undefined, paged: false };\n        const blocks = blocksOf(kind);\n        if (blocks === READING) return READING;\n        const where = kind.part === undefined ? new Map() : kind.part.read().where;\n        return this.overBudget(kind, where, blocks, range, buckets, resolution, totals, this.eventsOf(kind, range), false);\n    }\n\n    /**\n     * The drafted events of a kind its host reads over the window's rows alone\n     * (#1424) that its narrowing — but the window's range of `field` — does not\n     * hold: their stored rows read by their keys in one read, and asked of the\n     * narrowing in one more, as a kind read by its cells asks of the events its\n     * cells do not hold. A new event, which no stored row names, keeps its draft.\n     *\n     * @param held - The rows the kind's window holds, when the reader keeps them: an event among them is the narrowing's, and is asked of nothing\n     * @returns Their keys' texts; {@link READING} while a row or the narrowing's answer is in flight\n     */\n    private draftsOutside(kind: ScheduleCellKind, part: ScheduleCellPart, field: string, drafts: ScheduleEventDraftsValue,\n        held?: HeldRows | undefined): ReadonlySet<string> | typeof READING {\n        const kindDrafts = drafts.get(kind.key);\n        if (kindDrafts === undefined || kindDrafts.size === 0) return NO_IDS;\n        const narrowing = withoutTiled(part.read().where, field);\n        // No narrowing holds every event: each draft draws.\n        if (narrowing.size === 0) return NO_IDS;\n        const codec = this.codecOf(kind);\n        const asked: { id: string; key: unknown }[] = [];\n        for (const id of kindDrafts.keys()) {\n            if (held?.has(id) === true) continue;\n            const key = codec.keyOf(id);\n            if (key !== undefined) asked.push({ id, key });\n        }\n        if (asked.length === 0) return NO_IDS;\n        const stored = recordSliceRows(part, asked.map((a) => a.key));\n        if (stored.type !== \"some\") return READING;\n        const rows: { id: string; key: unknown; row: unknown }[] = [];\n        stored.value.forEach((row, i) => { if (row.type === \"some\") rows.push({ ...asked[i]!, row: row.value }); });\n        if (rows.length === 0) return NO_IDS;\n        const within = recordSliceWithin(part, narrowing, rows);\n        if (within.type !== \"some\") return READING;\n        const outside = new Set<string>();\n        rows.forEach(({ id }, i) => { if (within.value[i] !== true) outside.add(id); });\n        return outside.size === 0 ? NO_IDS : outside;\n    }\n\n    /**\n     * How many of a kind's events overlap a range, by its count: `undefined`\n     * where the count is no number of them — a day index's — or is in flight.\n     */\n    private eventsOf(kind: ScheduleCellKind, range: { from: Date; to: Date }): number | undefined {\n        if (!kind.exact) return undefined;\n        const count = kind.count(range.from, range.to);\n        return count.type === \"some\" ? Number(count.value) : undefined;\n    }\n\n    /**\n     * A kind placed on the paged kind, read by its series index's cells: its\n     * events while the cells hold at most the cap, its summary's shading past\n     * it (see the module docs).\n     */\n    private cellsKind(\n        kind: ScheduleCellKind, part: ScheduleCellPart, where: Where, blocks: readonly Block[], range: { from: Date; to: Date },\n        buckets: readonly ScheduleCellBucket[], resolution: TimeResolution | undefined, drafts: ScheduleEventDraftsValue, totals: Totals,\n    ): KindRead | typeof READING {\n        const codec = this.codecOf(kind);\n        const series = tileIndexFor(part.config.indexes, where, \"series\");\n        const tiling = series === undefined ? undefined : tilingOf(series);\n        // The groups read: each block of resources in view, and the events on none — each a run of each level (#1433).\n        const groups: CellGroup[] = [];\n        for (const block of blocks) {\n            const literals = block.keys.flatMap((key) => {\n                const literal = this.literal(kind, block.slot, key);\n                return literal === undefined ? [] : [literal];\n            });\n            if (literals.length > 0) groups.push({ id: String(block.index), literals });\n        }\n        const unassigned = this.noResource(kind);\n        if (unassigned !== undefined) groups.push({ id: \"none\", literals: [unassigned] });\n        const runs = tiling === undefined ? [] : levelRuns(tiling.tile.type, range.from, range.to);\n        // A range a key a level, under each combination of the leading values — as many as one key's searches of one\n        // run: more than one batch, as many events as the summary is for.\n        const perKey = series === undefined || runs.length === 0 || groups.length === 0 ? 0\n            : levelCellQueries(series, where, runs[0]!, [groups[0]!.literals[0]!]).queries.length;\n        const searches = groups.reduce((sum, group) => sum + group.literals.length, 0) * runs.length * perKey;\n        if (series === undefined || runs.length === 0 || searches > MAX_RECORD_SLICE_BATCH) {\n            return this.overBudget(kind, where, blocks, range, buckets, resolution, totals, undefined, true);\n        }\n        const read = this.seriesEntries(`${kind.key}\\u0000${series.name}`, part, series, where, groups, runs);\n        if (read === READING) return READING;\n        if (\"count\" in read) return this.overBudget(kind, where, blocks, range, buckets, resolution, totals, read.count, true);\n        // Each event once, by its key: one past a year is under every year it touches.\n        const rows = new SortedMap<unknown, unknown>([], codec.compareKey);\n        for (const entries of read.entries) {\n            for (const entry of entries) if (entry.row?.type === \"some\") rows.set(entry.key, entry.row.value);\n        }\n        // The events not read whose rows are wanted: those drafted, and those its host wants by key — a link's ends.\n        const kindDrafts = drafts.get(kind.key);\n        const extra: { id: string; key: unknown }[] = [];\n        const wanted = (id: string) => {\n            const key = codec.keyOf(id);\n            if (key !== undefined && !rows.has(key) && !extra.some((e) => stringEqual(e.id, id))) extra.push({ id, key });\n        };\n        const narrowing = withoutTiled(where, tiling!.from);\n        if (narrowing.size > 0) for (const id of kindDrafts?.keys() ?? []) wanted(id);\n        for (const id of kind.wanted) wanted(id);\n        let stored: option<option<unknown>[]> = some([]);\n        if (extra.length > 0) stored = recordSliceRows(part, extra.map((e) => e.key));\n        // The rows asked of the narrowing: the cells', for the fields their searches leave, and the stored rows read by key.\n        const asked: { key: unknown; row: unknown }[] = [];\n        const residual = residualOf(series, where).length > 0;\n        if (residual) for (const [key, row] of rows) asked.push({ key, row });\n        const storedRows: { id: string; key: unknown; row: unknown }[] = [];\n        if (stored.type === \"some\") {\n            stored.value.forEach((row, i) => { if (row.type === \"some\") storedRows.push({ ...extra[i]!, row: row.value }); });\n        }\n        if (narrowing.size > 0) for (const { key, row } of storedRows) asked.push({ key, row });\n        let within: boolean[] = [];\n        if (asked.length > 0) {\n            const answer = recordSliceWithin(part, narrowing, asked);\n            if (answer.type !== \"some\") return READING;\n            within = answer.value;\n        }\n        // What the narrowing does not hold draws nowhere, nor does a draft of it.\n        const dropped = new Set<string>();\n        let i = 0;\n        if (residual) {\n            for (const [key] of [...rows]) {\n                if (!within[i++]) {\n                    rows.delete(key);\n                    dropped.add(codec.idOf(key));\n                }\n            }\n        }\n        for (const { id, key, row } of storedRows) {\n            const holds = narrowing.size === 0 || within[i++] === true;\n            if (holds) rows.set(key, row);\n            else dropped.add(id);\n        }\n        // Drafts of events whose rows are still in flight show as drafted until they land.\n        const made = this.encode(kind.key, codec, [...read.entries, ...storedRows.map((s) => s.row), ...within], rows);\n        return { mode: \"cells\", cells: made.bytes, held: made.held, dropped, revision: read.revision, paged: true };\n    }\n\n    /**\n     * A kind past the cap: its summary's shading, at the largest of its tiles\n     * that divides the host's bucket and serves the narrowing whole; with none,\n     * a kind read by cells (`windowed`) is read over the range while its count\n     * there is within the cap — when it has not been counted past it — and\n     * every kind past it gives the notice, `counted` its events, `undefined`\n     * where its count is no number of them.\n     */\n    private overBudget(\n        kind: ScheduleCellKind, where: Where, blocks: readonly Block[], range: { from: Date; to: Date },\n        buckets: readonly ScheduleCellBucket[], resolution: TimeResolution | undefined, totals: Totals, counted: number | undefined, windowed: boolean,\n    ): KindRead | typeof READING {\n        const codec = this.codecOf(kind);\n        const part = kind.part;\n        const indexes = part?.config.indexes ?? [];\n        // Whether its shading or its hatch draws over the paged kind's rows: then those rows draw what they hold.\n        const paged = windowed;\n        if (part !== undefined) {\n            for (const tile of dividingTiles(resolution)) {\n                const summary = tileIndexFor(indexes, where, \"summary\", (t) => t === tile);\n                if (summary === undefined || residualOf(summary, where).length > 0) continue;\n                const shaded = this.summaryCells(kind, part, where, summary, blocks, range, totals);\n                if (shaded !== undefined) return shaded === READING ? READING : { mode: \"shade\", cells: codec.empty, notice: undefined, paged };\n            }\n        }\n        let events = counted;\n        if (windowed) {\n            // Its count over the range it reads: the count its window's read asks first.\n            const within = this.own(kind, () => scheduleWithinCap(kind.count, range.from, range.to));\n            if (within.type !== \"some\") return READING;\n            if (within.value) return kind.stored === undefined ? { mode: \"window\" } : this.own(kind, () => this.windowKind(kind, range));\n            events = this.eventsOf(kind, range);\n        }\n        // The notice: the rows hatched, and the resolution the smallest summary shades at.\n        for (const block of blocks) {\n            const series = kind.shadeKey(block.slot);\n            let held = totals.get(series);\n            if (held === undefined) { held = { booked: kind.booked, byKey: new Map() }; totals.set(series, held); }\n            for (const key of block.keys) held.byKey.set(key, \"hatch\");\n        }\n        const tiles = indexes.flatMap((index) => (index.summary.type === \"some\" ? [index.summary.value.tile.type] : []));\n        const smallest = ([\"day\", \"week\", \"month\", \"quarter\", \"year\"] as const).find((t) => tiles.includes(t));\n        return { mode: \"shade\", cells: codec.empty, notice: { kind: kind.key, name: kind.name, events, resolution: smallest }, paged };\n    }\n\n    /**\n     * A summary's cells over some blocks, folded into each resource's totals\n     * by tile; `undefined` when they take more than one batch of searches.\n     */\n    private summaryCells(\n        kind: ScheduleCellKind, part: ScheduleCellPart, where: Where, summary: Index, blocks: readonly Block[], range: { from: Date; to: Date },\n        totals: Totals,\n    ): true | typeof READING | undefined {\n        const tiling = tilingOf(summary)!;\n        // Its tiles over the range, one range a key (#1433): what a resource's totals are split by tile from.\n        const run = summaryRun(tiling.tile.type, range.from, range.to);\n        const cells: { cell: RecordSliceCell; block: Block; keys: string[] }[] = [];\n        let searches = 0;\n        for (const block of blocks) {\n            const keys: string[] = [];\n            const literals: string[] = [];\n            for (const key of block.keys) {\n                const literal = this.literal(kind, block.slot, key);\n                if (literal === undefined) continue;\n                keys.push(key);\n                literals.push(literal);\n            }\n            if (literals.length === 0) continue;\n            const queries = summaryCellQueries(summary, where, run, literals).queries;\n            cells.push({ cell: { id: `${block.slot}:${block.index}`, queries }, block, keys });\n            searches += queries.length;\n        }\n        if (searches > MAX_RECORD_SLICE_BATCH) return undefined;\n        const runs = recordSliceCellRuns(part, summary.name, cells.map((c) => c.cell));\n        if (runs.type !== \"some\") return READING;\n        const read = this.entriesOf(`${kind.key}\\u0000${summary.name}`, part, summary.name, cells.map((c) => c.cell));\n        if (read.type !== \"some\") return READING;\n        cells.forEach(({ cell, block, keys }, n) => {\n            const series = kind.shadeKey(block.slot);\n            let held = totals.get(series);\n            if (held === undefined) { held = { booked: kind.booked, byKey: new Map() }; totals.set(series, held); }\n            const found = runs.value.get(cell.id) as RecordSliceCellRuns;\n            const entries = read.value[n]!;\n            // A search a key under each combination of the leading fields' values, the keys inner: the entries of\n            // each search in order, those of an empty one none.\n            let at = 0;\n            found.ranges.forEach((range, q) => {\n                const count = Number(range.count);\n                const key = keys[q % keys.length]!;\n                for (const entry of entries.slice(at, at + count)) {\n                    if (entry.value?.type !== \"some\") continue;\n                    const t = entry.value.value as { count: bigint; ms: bigint };\n                    let byTile = held.byKey.get(key);\n                    if (byTile === \"hatch\") continue;\n                    if (byTile === undefined) { byTile = new Map(); held.byKey.set(key, byTile); }\n                    // The tile its total is of, as the summary keys it.\n                    const tile = tileOf(entry);\n                    const was = byTile.get(tile);\n                    byTile.set(tile, { count: (was?.count ?? 0) + Number(t.count), ms: (was?.ms ?? 0) + Number(t.ms) });\n                }\n                at += count;\n            });\n            // A resource with no event in a tile still shades, at nothing.\n            for (const key of keys) if (!held.byKey.has(key)) held.byKey.set(key, new Map());\n        });\n        return true;\n    }\n}\n\n/**\n * The drafted events of a kind that its window's rows do not hold and that are no new ones (see\n * {@link ScheduleCellKind.isNew}): what its window's own read never drew a draft of. Which drafts draw is the rule every\n * builder that draws its drafts over the rows it reads asks (`drafted-rows.ts`' `DraftedStanding`): one its window\n * holds, a new one, and — while its session has yet to judge its drafts where its record reads now — one the reader last\n * drew, its window read again without its event.\n *\n * @param kind - The kind's slot\n * @param drafts - The kind's drafts, by the event's key's text\n * @param held - The rows its window holds\n * @param isNew - Whether an event's session began from no stored row\n * @param carrying - Whether the kind's session has yet to judge its drafts where its record reads now\n * @param standing - The rule, and the drafts last drawn, which the kind's drawn here replace\n * @returns Their keys' texts\n */\nexport function draftsNotHeld(kind: string, drafts: ReadonlyMap<string, Uint8Array> | undefined, held: Pick<HeldRows, \"has\">, isNew: (id: string) => boolean,\n    carrying: boolean, standing: DraftedStanding): ReadonlySet<string> {\n    if (drafts === undefined || drafts.size === 0) { standing.drewKind(kind, NO_IDS); return NO_IDS; }\n    let out: Set<string> | undefined;\n    const drawn = new Set<string>();\n    for (const id of drafts.keys()) {\n        if (standing.stands(kind, id, { created: isNew(id), carrying }, held.has(id))) drawn.add(id);\n        else (out ??= new Set()).add(id);\n    }\n    standing.drewKind(kind, drawn);\n    return out ?? NO_IDS;\n}\n\n/** The shading the totals fold into, over the buckets: each row's key, then each resource's buckets. */\nfunction shadingOf(totals: Totals, buckets: readonly ScheduleCellBucket[]): ScheduleCellShading {\n    return new SortedMap([...totals].map(([series, { booked, byKey }]) => [series, new SortedMap([...byKey].map(([key, held]) =>\n        [key, held === \"hatch\" ? hatchOf(buckets) : shadesOf(held, buckets, booked)] as [string, ScheduleCellShade[]]), compareString)] as [string, SortedMap<string, ScheduleCellShade[]>]),\n    compareString);\n}\n\n/** Whether two reads' revisions are one: each kind read by its cells at the same revision. */\nfunction sameRevisions(a: ReadonlyMap<string, string>, b: ReadonlyMap<string, string>): boolean {\n    return a.size === b.size && [...a].every(([kind, revision]) => {\n        const other = b.get(kind);\n        return other !== undefined && stringEqual(other, revision);\n    });\n}\n\n/**\n * What Saves landed of the kinds whose cells stand from before them (see the module docs): those read at another\n * revision than the one the kind's record reads at now, as east-ui-components' `readBeforeSaves` tells it. A kind none\n * of whose cells is read is laid nothing.\n *\n * @param landed - What Saves landed of the kinds read by their cells\n * @param revisions - The revision each kind's standing cells were read at\n * @param now - The revision each kind's record reads at now\n * @returns Those kinds' landed events, by their slots; the one empty map while none stands from before\n */\nexport function landedBefore(\n    landed: ScheduleLanded | undefined, revisions: ReadonlyMap<string, string>, now: ReadonlyMap<string, string>,\n): ReadonlyMap<string, ScheduleLandedRows> {\n    if (landed === undefined || landed.size === 0) return NOTHING_LAID;\n    let out: Map<string, ScheduleLandedRows> | undefined;\n    for (const [kind, rows] of landed) {\n        const at = revisions.get(kind);\n        if (at !== undefined && readBeforeSaves(at, now.get(kind), rows.from)) (out ??= new Map()).set(kind, rows);\n    }\n    return out ?? NOTHING_LAID;\n}\n\n/** Whether two sets of kinds' landed events are one: the same kinds, each the same events. */\nfunction sameLanded(a: ReadonlyMap<string, ScheduleLandedRows>, b: ReadonlyMap<string, ScheduleLandedRows>): boolean {\n    return a.size === b.size && [...a].every(([kind, rows]) => Object.is(b.get(kind), rows));\n}\n\n/**\n * The drafts and the rows held, with what Saves landed of each kind whose cells stand from before them laid in (see the\n * module docs): each event under its kind's drafts as the Save left it — but one a draft made since holds, which draws\n * in its place, and one its narrowing did not hold, which drew nowhere before the Save — and each row held as the Save\n * left it, one it deleted gone, read by its key.\n *\n * @param drafts - Every kind's drafts as the seams take them\n * @param held - The rows each kind's cells hold\n * @param dropped - The drafted events each kind's narrowing does not hold, by its slot\n * @param laid - What Saves landed of the kinds whose cells stand from before them\n * @param own - Every kind's drafts as the host's sessions hold them\n * @returns The drafts and the rows held; themselves while nothing is laid\n */\nfunction laidLanded(\n    drafts: ScheduleEventDraftsValue, held: ReadonlyMap<string, HeldRows>, dropped: ReadonlyMap<string, ReadonlySet<string>>,\n    laid: ReadonlyMap<string, ScheduleLandedRows>, own: ScheduleEventDraftsValue,\n): { readonly drafts: ScheduleEventDraftsValue; readonly held: ReadonlyMap<string, HeldRows> } {\n    if (laid.size === 0) return { drafts, held };\n    let outDrafts: SortedMap<string, ValueTypeOf<typeof ScheduleDraftsType>> | undefined;\n    let outHeld: Map<string, HeldRows> | undefined;\n    for (const [kind, landed] of laid) {\n        const drafted = own.get(kind);\n        const gone = dropped.get(kind);\n        let kindDrafts: SortedMap<string, Uint8Array> | undefined;\n        for (const [id, row] of landed.rows) {\n            if (drafted?.has(id) === true || gone?.has(id) === true) continue;\n            kindDrafts ??= new SortedMap(drafts.get(kind) ?? [], compareString);\n            kindDrafts.set(id, row.draft);\n        }\n        // Each landed event's row as its Save left it, one it deleted gone: laid over the rows held, which are not copied.\n        (outHeld ??= new Map(held)).set(kind, new LaidRows(held.get(kind) ?? NO_ROWS, landed.rows));\n        if (kindDrafts !== undefined) (outDrafts ??= new SortedMap(drafts, compareString)).set(kind, kindDrafts);\n    }\n    return { drafts: outDrafts ?? drafts, held: outHeld ?? held };\n}\n\n/** Every kind's drafts, those a kind read by its cells leaves out dropped: the same object when it drops none. */\nfunction narrowedDrafts(drafts: ScheduleEventDraftsValue, dropped: ReadonlyMap<string, ReadonlySet<string>>): ScheduleEventDraftsValue {\n    if (dropped.size === 0) return drafts;\n    return new SortedMap([...drafts].map(([kind, byId]): [string, ValueTypeOf<typeof ScheduleDraftsType>] => {\n        const gone = dropped.get(kind);\n        return [kind, gone === undefined ? byId : new SortedMap([...byId].filter(([id]) => !gone.has(id)), compareString)];\n    }), compareString);\n}\n\n/**\n * Two reads alike: the same cells by their bytes — the rows they hold are\n * made from them — and the same shading, drafts, notices and kinds past the\n * cap; over a paged kind read by its cells, the same resources covered over\n * the same range, as its rows wait on them. A read over another range that\n * holds the same is the same, where nothing waits on its range: a pan within\n * the cap hands nothing on.\n */\nfunction sameRead(a: Read, b: Read): boolean {\n    const blobs = (x: ScheduleCellReads, y: ScheduleCellReads) => x.size === y.size && [...x].every(([slot, bytes]) => {\n        const other = y.get(slot);\n        return other !== undefined && blobEqual(other, bytes);\n    });\n    return blobs(a.reads, b.reads) && shadingEqual(a.shading, b.shading) && draftsEqual(a.drafts, b.drafts) && sameKeys(a.capped, b.capped)\n        && sameKeys(a.windowed, b.windowed)\n        && sameKeys(a.covered, b.covered) && (a.covered === undefined || sameRange(a.range, b.range))\n        && a.notices.length === b.notices.length && a.notices.every((n, i) => {\n            const m = b.notices[i]!;\n            return stringEqual(n.kind, m.kind) && n.events === m.events && n.resolution === m.resolution;\n        });\n}\n\n/**\n * The kinds read by their cells (see the module docs): placed on the paged\n * resource kind, their sources listing a series index of their records.\n *\n * @param kinds - The event kinds\n * @param paged - The paged resource kind, when one pages\n * @returns Their slots, in order\n */\nexport function scheduleCellKinds(kinds: readonly ScheduleCellKind[], paged: ScheduleCellPaged | undefined): string[] {\n    return kinds.filter((kind) => readByCells(kind, paged)).map((kind) => kind.key);\n}\n\n/**\n * The kinds' cells and counts (see the module docs), read in the component\n * that reads the event kinds' rows: what the host's seams draw the kinds from,\n * every kind's drafts as they take them, and what a gesture finds an event's\n * row in. Before the first read lands, every kind read by its cells draws\n * nothing yet, so no seam reads it over the range meanwhile; a read in flight\n * leaves the last standing, the drafts as they are now. Over a paged kind it\n * says which resources' rows draw what is known of them (`drawn`, #1398): every\n * other row's cells never landed, or are on their way over a range they were\n * not read over, and it draws the region wash — before the first read lands,\n * every row. A read again over the same range, a commit's or another\n * narrowing's, leaves the rows drawn as they were, their cells standing in.\n * It hands on the same object while what it hands on holds: where no kind is\n * read by its cells over a paged kind, a pan that leaves every kind within the\n * cap, or past it as it was, hands nothing on. Over a kind's cells read before\n * a Save of it, what the Save landed draws as the Save left it, and is let go\n * once they are read since (see the module docs).\n *\n * @param args - What it reads over\n * @returns What it read\n */\nexport function useScheduleCells(args: ScheduleCellsArgs): ScheduleCellsRead {\n    const [reader] = useState(() => new CellsReader());\n    const { host, kinds, resources, paged, range, period, buckets, resolution, drafts, span, landed, shown } = args;\n    const from = range?.from.getTime();\n    const to = range?.to.getTime();\n    const read = useCallback(() => reader.read({\n        kinds, resources, paged, buckets, resolution, drafts, span, period,\n        range: from === undefined || to === undefined ? undefined : { from: new Date(from), to: new Date(to) },\n    }), [reader, kinds, resources, paged, buckets, resolution, from, to, period, drafts, span]);\n    const { result } = useTrackedEvaluation(read);\n    const last = useRef<Read | undefined>(undefined);\n    // The revision each kind's record reads at now, as the read just made found it — in flight or not.\n    const now = reader.current();\n    // The view the read just made was asked for — in flight or not — and the view the read standing was made for.\n    const asked = reader.asked();\n    const made = useRef<ReadView | undefined>(undefined);\n    // The last failure, the same object while a read fails the same way: its host is handed nothing new for it.\n    const failed = useRef<ScheduleCellsFailure | undefined>(undefined);\n    // The revision each kind's standing cells were read at: the last read landed's — a read the same as the one standing\n    // stands for it, its cells holding the same rows at its revision.\n    const revisions = useRef<ReadonlyMap<string, string>>(NO_REVISIONS);\n    // Before the first read: every kind read by its cells draws nothing yet — and over a paged kind, no resource's row\n    // drawn.\n    const opening = useMemo((): Read => {\n        const slots = scheduleCellKinds(kinds, paged);\n        return {\n            reads: new SortedMap(slots.map((slot): [string, Uint8Array] =>\n                [slot, reader.codecOf(kinds.find((kind) => stringEqual(kind.key, slot))!).empty]), compareString),\n            shading: new SortedMap([], compareString),\n            drafts,\n            held: new Map(),\n            notices: [],\n            capped: NONE_CAPPED,\n            dropped: new Map(),\n            covered: paged !== undefined && slots.length > 0 ? NO_RESOURCES : undefined,\n            range: undefined,\n            revisions: NO_REVISIONS,\n            windowed: NONE_WINDOWED,\n            made: NO_VIEW,\n        };\n    }, [reader, kinds, drafts, paged]);\n    // What it hands on: the same object while the read, whether one its rows wait on is in flight, what it reads again\n    // and over which range, and what Saves landed over cells read before them hold.\n    const handed = useRef<{\n        standing: Read; drafts: ScheduleEventDraftsValue; reading: boolean; wanted: ReadonlySet<string>; moved: boolean;\n        laid: ReadonlyMap<string, ScheduleLandedRows>; view: ViewState; error: ScheduleCellsFailure | undefined; read: ScheduleCellsRead;\n    } | undefined>(undefined);\n    const handedOn = useMemo((): ScheduleCellsRead => {\n        // A read that threw: why, and the kind whose own read it was.\n        let error: ScheduleCellsFailure | undefined;\n        if (!result.ok) {\n            const failure = result.error instanceof KindReadFailure ? result.error : undefined;\n            const thrown = failure?.thrown ?? result.error;\n            console.error(`[${host}] the event kinds' cells could not be read:`, thrown);\n            const reason = thrown instanceof Error ? thrown.message : String(thrown);\n            const was = failed.current;\n            const window = failure?.window === true;\n            error = was !== undefined && stringEqual(was.reason, reason) && was.window === window\n                && (failure === undefined ? was.kinds.length === 0 : was.kinds.length === 1 && stringEqual(was.kinds[0]!, failure.kind))\n                ? was : { reason, kinds: failure === undefined ? [] : [failure.kind], window };\n            failed.current = error;\n        }\n        const inFlight = !result.ok || result.value === READING;\n        if (!inFlight) {\n            const next = result.value as Read;\n            if (last.current === undefined || !sameRead(last.current, next)) last.current = next;\n            if (!sameRevisions(revisions.current, next.revisions)) revisions.current = next.revisions;\n            made.current = next.made;\n        }\n        // How what stands is to what is asked now: the one rule every builder reads its rows by.\n        const view = viewState(made.current, asked, result.ok && result.value === READING);\n        // While a read is in flight, the last stands in — the drafts as they are now, less those it found the narrowing does not hold.\n        const standing = last.current ?? opening;\n        const wanted = reader.wanted();\n        // The resources whose cells it holds, over a paged kind read by its cells: only there does anything wait on a read —\n        // one in flight, never one that threw, which nothing waits on (retest C7: its host's main busy, and its line saying\n        // the events read, for as long as it stood).\n        const covered = standing.covered;\n        const reading = covered !== undefined && result.ok && result.value === READING;\n        // In flight, or thrown, over another range than the one standing was read over: its cells there never landed.\n        const moved = covered !== undefined && inFlight && standing.range !== undefined && from !== undefined && to !== undefined && !sameRange(standing.range, { from, to });\n        // What Saves landed of the kinds whose cells stand from before them: drawn as the Saves left it.\n        const laid = landedBefore(landed, revisions.current, now);\n        const was = handed.current;\n        if (was !== undefined && was.standing === standing && was.reading === reading && was.moved === moved && sameLanded(was.laid, laid)\n            && was.view === view && was.error === error\n            && (!inFlight || (Object.is(was.drafts, drafts) && was.wanted === wanted))) return was.read;\n        // The rows that draw what is known of them: the resources whose cells it holds — over another range, less those it\n        // reads again; over the same range, a commit's or another narrowing's read, every one, its cells standing in.\n        const drawn = covered === undefined || !moved ? covered : new Set([...covered].filter((key) => !wanted.has(key)));\n        const seams = laidLanded(inFlight ? narrowedDrafts(drafts, standing.dropped) : standing.drafts, standing.held, standing.dropped, laid, drafts);\n        const read: ScheduleCellsRead = {\n            reads: standing.reads,\n            shading: standing.shading,\n            drafts: seams.drafts,\n            held: seams.held,\n            notices: standing.notices,\n            capped: standing.capped,\n            reading,\n            drawn,\n            windowed: standing.windowed,\n            view,\n            error,\n        };\n        handed.current = { standing, drafts, reading, wanted, moved, laid, view, error, read };\n        return read;\n    }, [host, result, opening, drafts, reader, from, to, landed, now, asked]);\n    // What Saves landed of a kind whose cells are read at the revision its record reads at now — or none of whose cells is\n    // read: counted, past the cap or hidden — is let go, in the commit that draws its cells without it, so no frame draws both.\n    useLayoutEffect(() => {\n        if (landed === undefined || shown === undefined) return;\n        for (const [kind, rows] of landed) {\n            const at = revisions.current.get(kind);\n            if (at === undefined || !readBeforeSaves(at, now.get(kind), rows.from)) shown(kind, [...rows.rows.keys()]);\n        }\n    }, [landed, shown, handedOn, now]);\n    return handedOn;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The windowed rows the paged builders draw — the Sheet's and the Plan's\n * (#1398): the one driver logic both run on (`sheet/paging.ts`,\n * `plan/controller/paging.ts`), each keeping only what is its own — the\n * Sheet's React state and its family's stand-in, the Plan's blocks, their\n * skeletons and its committed-snapshot handshake.\n *\n * - **The stand-in** ({@link WindowStore}, {@link readWindows}): each window\n *   read once (#577) and kept for the source that read it; a read that throws\n *   is a failure recorded against its window (#811, #853), asked again only\n *   once its record goes — a Retry ({@link retryWindows}), or the window\n *   leaving the run; and across a new revision the previous one's windows\n *   stand in, each until its own lands (#821, #851). A window that carries the\n *   stored entries its rows were made from (east-ui's `CarriedWindowType`,\n *   #1599) is kept with them, so an edit of a row a driver shows begins from\n *   the entry that row's own window read ({@link WindowStore.entryOf}),\n *   whatever revision its source has moved to since.\n * - **The source** ({@link sourceChange}): whether the source a driver is\n *   handed is the one that filled its store, the same one read another way —\n *   whose rows stand in, retained, while they are read again — or another.\n * - **The run** ({@link runAround}): the stretch of the resident windows that\n *   are in — landed, or failed — around the one nearest the element the view\n *   is centred on (#876). A window still in flight ends it at either end, so a\n *   window loading beside the rows on screen never takes them off it.\n * - **The bands** ({@link bandsAround}): every element above the run and every\n *   element below it, each sized by the ledger, so eviction moves nothing and\n *   a window landing beside the run takes exactly its band's slot; a band\n *   report's pixels map back to the element under the view\n *   ({@link elementInBand}, #612), and a failed window is a band at its slot\n *   ({@link failedSpan}).\n * - **The demand** ({@link advanceAtRest}, {@link firstWindow}): the run\n *   follows the view a window at a time while it rests, reading ahead the way\n *   it travels (#1398, CL6) — window 0 first, before the source has counted\n *   itself.\n * - **The jump** ({@link pinTarget}): a sought element's window pinned, so no\n *   trim drops it before it lands (#812, #854).\n *\n * Pure but for the store, which a driver owns, and Retry's microtask: no\n * React, and no East value but the options a page answers with.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, none, type option } from \"@elaraai/east\";\nimport {\n    advance, documentHeight, elementAtOffset, entryLookup, isEmpty, offsetOfWindow, pin, slotHeight, travelOf, unpinAll,\n    type CarriedEntry, type EntryLookup, type Residency, type ResidencyOptions, type Travel, type WindowLedger,\n} from \"@elaraai/east-ui-components/internal\";\n\nconst stringEqual = equalFor(StringType);\n\n// ── The stand-in ──────────────────────────────────────────────────────────\n\n/**\n * How a driver reads one window of its source: the source's `page`, what a\n * landed window is to the driver, and the name its console says a failure\n * under.\n */\nexport interface WindowReader<T, R> {\n    /** The source's page read: `none` while the window is in flight, its tracked channel firing as it lands. */\n    readonly page: (offset: bigint, limit: bigint) => option<T>;\n    /** A landed window, as the driver keeps it — read once, when it lands. */\n    readonly decode: (value: T) => R;\n    /** The driver's name in the console (`[Sheet]`, `[Plan]`). */\n    readonly label: string;\n    /**\n     * The stored entries a landed window carries beside its rows (#1599, east-ui's `CarriedWindowType`), where the\n     * source's windows carry theirs: kept with the window for as long as it stands ({@link WindowStore.entryOf}).\n     */\n    readonly entries?: ((value: T) => readonly CarriedEntry[]) | undefined;\n    /**\n     * What stands in for a window in flight (#1599): the last read of it, as the driver draws it NOW — a driver that\n     * draws its unsaved changes into its windows lays them over the entries the window carried ({@link carriedOf}),\n     * reading nothing, so a change made while the window is read again is drawn at once. Left out, the last read\n     * stands in as it was read. The window kept is the last read's own either way: what is returned is only drawn.\n     */\n    readonly standIn?: ((previous: R) => R) | undefined;\n}\n\n/** The entries each landed window carried, by the window as its driver keeps it: the list, and its lookup by id. */\ninterface Carried {\n    readonly entries: readonly CarriedEntry[];\n    readonly lookup: EntryLookup;\n}\n\n/**\n * The entries each landed window carried, by the window as its driver keeps it — the entries of the very read that\n * made it, asked for as long as it stands: landed, or standing in from a revision before.\n */\nconst carried = new WeakMap<object, Carried>();\n\n/**\n * The stored entries a window carried beside its rows (#1599), by the window as its driver keeps it — a landed\n * window's `read`, or one standing in.\n *\n * @param read - The window, as the driver's reader decoded it\n * @returns Its entries, in the source's order; `undefined` for a window of a source whose windows carry none\n */\nexport function carriedOf(read: object): readonly CarriedEntry[] | undefined {\n    return carried.get(read)?.entries;\n}\n\n/** What one read of some windows found. */\nexport interface WindowReads<R> {\n    /** Every window asked that is resident — landed, or the previous revision's standing in — in the order asked. */\n    resident: { w: number; read: R }[];\n    /** Every window asked still in flight, in the order asked — one the previous revision stands in for as well. */\n    inFlight: number[];\n    /** Every window asked whose read failed, in the order asked. */\n    failed: { w: number; error: string }[];\n    /** Whether any resident window was served from `stale`: the previous revision, standing in until this one's rows land. */\n    stale: boolean;\n    /** Every window served from `stale`, in the order asked: its rows were read at the previous revision. */\n    standing: number[];\n}\n\n/** One line naming why a read failed. */\nfunction readFailure(err: unknown): string {\n    return err instanceof Error ? err.message : String(err);\n}\n\n/**\n * Read windows, serving the ones the cache holds and reading the rest (#577).\n *\n * @remarks\n * A landed window is immutable for the source that read it, so it is read\n * exactly once, into the caller's cache, and served from there. Serving it\n * skips the page read, and so its tracking: only a window still in flight is\n * read, and so tracked — which is right, since only it has more to say. The\n * read does not stop at a window in flight: residency is a run, and a landed\n * window draws whether or not its neighbour has. A window whose read throws is\n * recorded in `failures` and reported (#811), and not read again while its\n * record stands. A window in flight at a new revision is served from `stale`,\n * the rows it had (#821), and still counts as in flight.\n *\n * @param reader - The source's page read and what a landed window is\n * @param windows - The windows to read, ascending\n * @param cache - The caller's read-once cache (mutated: it is a cache)\n * @param pageSize - Elements per window\n * @param failures - The caller's failure record (mutated: a new failure is recorded)\n * @param stale - The previous revision's windows, served for a window still in flight at this one — each as the\n *   reader draws it now, where it says ({@link WindowReader.standIn})\n * @returns The windows resident, in flight and failed, and those served from `stale`\n */\nexport function readWindows<T, R>(\n    reader: WindowReader<T, R>,\n    windows: Iterable<number>,\n    cache: Map<number, R>,\n    pageSize: number,\n    failures: Map<number, string>,\n    stale?: ReadonlyMap<number, R>,\n): WindowReads<R> {\n    const resident: { w: number; read: R }[] = [];\n    const inFlight: number[] = [];\n    const failed: { w: number; error: string }[] = [];\n    const standing: number[] = [];\n    for (const w of windows) {\n        const known = cache.get(w);\n        if (known !== undefined) {\n            resident.push({ w, read: known });\n            continue;\n        }\n        // A failed window is not asked again by the reader — only once its record goes.\n        const recorded = failures.get(w);\n        if (recorded !== undefined) {\n            failed.push({ w, error: recorded });\n            continue;\n        }\n        let win: option<T>;\n        try {\n            win = reader.page(BigInt(w * pageSize), BigInt(pageSize));\n        } catch (err) {\n            console.error(`${reader.label} paged source page ${w} failed:`, err);\n            const error = readFailure(err);\n            failures.set(w, error);\n            failed.push({ w, error });\n            continue;\n        }\n        if (win.type !== \"some\") {\n            // In flight: its channel is tracked now, so its landing reads again. Until then the rows it had at the\n            // previous revision stand in.\n            inFlight.push(w);\n            const previous = stale?.get(w);\n            if (previous !== undefined) {\n                resident.push({ w, read: reader.standIn === undefined ? previous : reader.standIn(previous) });\n                standing.push(w);\n            }\n            continue;\n        }\n        const read = reader.decode(win.value);\n        // What the window carried beside its rows is kept with it: its own read's, whatever the source moves to (#1599).\n        if (reader.entries !== undefined) {\n            const entries = reader.entries(win.value);\n            carried.set(read as object, { entries, lookup: entryLookup(entries) });\n        }\n        cache.set(w, read);\n        resident.push({ w, read });\n    }\n    return { resident, inFlight, failed, stale: standing.length > 0, standing };\n}\n\n/**\n * Drop the entries of windows outside the resident set — the memory half of\n * eviction for a cache, and the reset of a failure record: a failed window\n * that leaves the run is asked afresh when it is demanded again.\n *\n * @param cache - A map by window\n * @param keep - The windows to keep\n * @returns How many entries went\n */\nexport function pruneWindows(cache: Map<number, unknown>, keep: ReadonlySet<number>): number {\n    let dropped = 0;\n    for (const w of [...cache.keys()]) {\n        if (keep.has(w)) continue;\n        cache.delete(w);\n        dropped += 1;\n    }\n    return dropped;\n}\n\n/**\n * What a driver keeps of its source's windows (#577, #811, #821): the windows\n * landed at its revision, the previous revision's standing in for them until\n * they land, and why each failed window's read threw. A driver holds one for\n * the source that filled it, and starts another when the next source is not\n * equivalent (#809): a source whose closures changed serves other rows under\n * the same id and revision.\n */\nexport class WindowStore<R> {\n    /** The windows landed at {@link revision}. */\n    windows = new Map<number, R>();\n    /** The previous revision's windows, each served until this revision's copy lands (#821, #851). */\n    stale: Map<number, R> | undefined = undefined;\n    /** Why each failed window's read threw, at {@link revision} — not asked again while recorded (#811, #853). */\n    failures = new Map<number, string>();\n    /** The revision the windows are read at; `undefined` before one is known, or for a source that names none. */\n    revision: string | undefined = undefined;\n\n    /**\n     * Read at a revision: a new one starts the windows again, the ones held standing in until each lands — or, while\n     * nothing is held (a revision the source was still finding), the last ones that had rows — and its failures start\n     * afresh. The windows a far key's stand-in drew (`keep`, #1398, CL10) stand in still for as long as it does: the\n     * view it left may be put back before they are read at this revision, and it never draws back as runs not read.\n     *\n     * @param revision - The revision the source serves now\n     * @param keep - The windows a far key's stand-in drew, while it stands in\n     */\n    at(revision: string | undefined, keep?: ReadonlySet<number>): void {\n        if (revision === this.revision) return;\n        // What stood in for the stand-in's windows and has not been read at the last revision: theirs still.\n        const kept = keep === undefined || this.stale === undefined ? [] : [...this.stale].filter(([w]) => keep.has(w) && !this.windows.has(w));\n        if (this.windows.size > 0) this.stale = this.windows;\n        if (kept.length > 0) {\n            const stale = this.stale ?? new Map<number, R>();\n            for (const [w, read] of kept) stale.set(w, read);\n            this.stale = stale;\n        }\n        this.windows = new Map();\n        this.failures = new Map();\n        this.revision = revision;\n    }\n\n    /**\n     * Read every window again for a source that reads the same windows another way — its id the same, its page no\n     * longer equivalent to the one that filled the store (#809): the windows held, landed or standing in from the\n     * revision before, stand in for each until its own lands (#1599), as across a revision, and its failures start\n     * afresh. Dropped instead, the rows went with them — every one, until the source's read landed — whenever its\n     * author's block was evaluated again while that read was on its way.\n     */\n    restart(): void {\n        if (this.windows.size > 0) {\n            const stale = this.stale ?? new Map<number, R>();\n            for (const [w, read] of this.windows) stale.set(w, read);\n            this.stale = stale;\n        }\n        this.windows = new Map();\n        this.failures = new Map();\n    }\n\n    /**\n     * The stored entry the window standing at a source position read with the row of an id (#1599), where the source's\n     * windows carry theirs ({@link WindowReader.entries}): the window landed there at this revision, else the one\n     * standing in for it from before — the window whose rows are the ones a driver draws at that position\n     * ({@link readWindows}). What a gesture on a row the driver shows begins from, with no read of its own: one made as\n     * the gesture runs is read at the revision the source has moved to — on its way, or landed and newer than the row\n     * its person is looking at.\n     *\n     * @param id - The entry's id\n     * @param at - The row's position in the source\n     * @param pageSize - Elements per window\n     * @returns The entry's bytes; `undefined` for a position no window stands at, and for an id its window carries no entry of\n     */\n    entryOf(id: string, at: number, pageSize: number): Uint8Array | undefined {\n        const w = Math.floor(at / pageSize);\n        const read = this.windows.get(w) ?? this.stale?.get(w);\n        return read === undefined ? undefined : carried.get(read as object)?.lookup(id);\n    }\n\n    /** Drop everything: the rows of a source, or of a narrowing, that the next one does not serve. */\n    drop(): void {\n        this.windows = new Map();\n        this.failures = new Map();\n        this.stale = undefined;\n        this.revision = undefined;\n    }\n\n    /**\n     * Read windows into the store ({@link readWindows}); once no window stood in, every one reads at this revision,\n     * and the previous one has nothing left to stand in for — but the windows a far key's stand-in drew (`keep`, #1398,\n     * CL10), which the jump's windows read now never are: theirs stay, to stand in for them should that view be put\n     * back before they are read at this revision.\n     *\n     * @param reader - The source's page read and what a landed window is\n     * @param windows - The windows to read, ascending\n     * @param pageSize - Elements per window\n     * @param keep - The windows a far key's stand-in drew, while it stands in\n     * @returns What the read found\n     */\n    read<T>(reader: WindowReader<T, R>, windows: Iterable<number>, pageSize: number, keep?: ReadonlySet<number>): WindowReads<R> {\n        const out = readWindows(reader, windows, this.windows, pageSize, this.failures, this.stale);\n        if (!out.stale && this.stale !== undefined) {\n            if (keep !== undefined) pruneWindows(this.stale, keep);\n            if (keep === undefined || this.stale.size === 0) this.stale = undefined;\n        }\n        return out;\n    }\n\n    /**\n     * Keep only the windows in `keep`: whatever left the run leaves the store with it, a stand-in too, and its failure\n     * record — demanded again later, it is asked afresh.\n     *\n     * @param keep - The windows to keep\n     */\n    prune(keep: ReadonlySet<number>): void {\n        pruneWindows(this.windows, keep);\n        if (this.stale !== undefined) pruneWindows(this.stale, keep);\n        pruneWindows(this.failures, keep);\n    }\n\n    /**\n     * Forget a failed window's record — or, with none named, every one — so the next read asks again (#811, #853).\n     *\n     * @param w - The window; `undefined` for every one\n     */\n    forget(w?: number): void {\n        if (w === undefined) this.failures.clear();\n        else this.failures.delete(w);\n    }\n}\n\n/**\n * Ask again (#811, #853) at once (#1398): a source that can refresh rearms what\n * failed for a reason a retry can fix first — a read alone waits out the\n * runtime's retry gap after the last failure — and the records go and the\n * windows are read again a microtask on, once it has: a read between the two\n * would only record the failure again. A source that cannot refresh is asked\n * again at once.\n *\n * @param source - The source, whose `refresh` rearms what failed\n * @param ask - Drops the records and reads again\n */\nexport function retryWindows(source: { readonly refresh?: ((target: option<string>) => unknown) | undefined } | undefined, ask: () => void): void {\n    if (source?.refresh === undefined) {\n        ask();\n        return;\n    }\n    source.refresh(none);\n    queueMicrotask(ask);\n}\n\n// ── The source ────────────────────────────────────────────────────────────\n\n/**\n * How a source a driver is handed stands to the one that filled what it holds (#809, #1599).\n *\n * - `same` — the source that read the rows: its id the same and its page equivalent. What is held is its own.\n * - `reread` — the same source, read another way: its id the same, its page no longer equivalent — a value its\n *   author's block read moved, so its rows are made another way, or the block was evaluated again over a handle\n *   bound as a variable. Every window is read again, and the rows held stand in for it meanwhile, RETAINED: they are\n *   the last reading's rows, and take no gesture until they are read again.\n * - `other` — another source: nothing held is its rows.\n */\nexport type SourceChange = \"same\" | \"reread\" | \"other\";\n\n/**\n * How a source a driver is handed stands to the one that filled what it holds (see {@link SourceChange}): the one\n * rule every driver that keeps rows by the page that read them asks, so none decides it for itself.\n *\n * @typeParam S - A windowed source: its id, and whatever reads it\n * @param held - The source that filled what the driver holds; `undefined` while nothing has\n * @param next - The source it is handed now\n * @param equivalent - Whether two sources read the same rows the same way: their ids and their functions, by what they capture\n * @returns The change\n */\nexport function sourceChange<S extends { readonly id: string }>(held: S | undefined, next: S, equivalent: (a: S, b: S) => boolean): SourceChange {\n    if (held === undefined) return \"other\";\n    if (equivalent(held, next)) return \"same\";\n    return stringEqual(held.id, next.id) ? \"reread\" : \"other\";\n}\n\n// ── The run and its bands ─────────────────────────────────────────────────\n\n/** The windows a driver draws (#876): `from` to `to`, inclusive; `to < from` when none of the resident ones is in. */\nexport interface WindowRun {\n    readonly from: number;\n    readonly to: number;\n}\n\n/**\n * The window a run is anchored on (#876): the resident window that is in —\n * landed, or failed (#811, #853) — nearest the element the view is centred on.\n * Its own window when that is in; else the nearer of the first in after it and\n * the last in before it, so a window loading next to the rows on screen never\n * takes them off it, whichever way the view came and whatever lands beyond it\n * first.\n *\n * @param residency - The resident windows\n * @param isIn - Whether a window is in\n * @param element - The element the view is centred on\n * @param pageSize - Elements per window\n * @returns The window; `undefined` while none of the resident ones is in\n */\nexport function anchorAround(residency: Residency, isIn: (w: number) => boolean, element: number, pageSize: number): number | undefined {\n    if (isEmpty(residency)) return undefined;\n    const { lo, hi } = residency;\n    const at = Math.min((hi + 1) * pageSize - 1, Math.max(lo * pageSize, element));\n    const own = Math.floor(at / pageSize);\n    if (isIn(own)) return own;\n    let after: number | undefined;\n    for (let w = own + 1; w <= hi && after === undefined; w++) if (isIn(w)) after = w;\n    let before: number | undefined;\n    for (let w = own - 1; w >= lo && before === undefined; w--) if (isIn(w)) before = w;\n    if (after === undefined || before === undefined) return after ?? before;\n    return after * pageSize - at <= at - ((before + 1) * pageSize - 1) ? after : before;\n}\n\n/**\n * The run a driver draws (#876): the stretch of its resident windows that are\n * in around the window it is anchored on ({@link anchorAround}). It crosses a\n * failed window, whose elements are known, so the rows after it keep their\n * positions (#811, #853); a window still in flight ends it at either end.\n *\n * @param residency - The resident windows\n * @param isIn - Whether a window is in\n * @param element - The element the view is centred on\n * @param pageSize - Elements per window\n * @returns The run — empty at the residency's first window while none of it is in: the bands meet where it will land\n */\nexport function runAround(residency: Residency, isIn: (w: number) => boolean, element: number, pageSize: number): WindowRun {\n    const anchor = anchorAround(residency, isIn, element, pageSize);\n    if (anchor === undefined) return { from: residency.lo, to: residency.lo - 1 };\n    let from = anchor;\n    while (from > residency.lo && isIn(from - 1)) from--;\n    let to = anchor;\n    while (to < residency.hi && isIn(to + 1)) to++;\n    return { from, to };\n}\n\n/** A stretch of a source's elements and the height it draws at: a band's, or a failed window's. */\nexport interface WindowSpan {\n    /** Its first element (inclusive). */\n    readonly from: number;\n    /** Its last element (inclusive). */\n    readonly to: number;\n    /** Its height in px, the ledger's geometry. */\n    readonly px: number;\n}\n\n/** No band either side. */\nconst NO_BANDS: { readonly head: WindowSpan | undefined; readonly tail: WindowSpan | undefined } = { head: undefined, tail: undefined };\n\n/**\n * The bands either side of a run (#876): every element above it — not\n * resident, still loading, or past a window still loading — and every element\n * below it, each as tall as the ledger makes its windows. The bands follow the\n * run, never the residency: the windows past a window still loading are\n * theirs until it lands. None while nothing is resident, or before the ledger\n * knows a window.\n *\n * @param ledger - The ledger\n * @param residency - The resident windows\n * @param run - The run ({@link runAround})\n * @param pageSize - Elements per window\n * @param known - The source's element count as the driver knows it: where the tail ends\n * @returns The head and the tail band, each `undefined` where the run reaches that end\n */\nexport function bandsAround(\n    ledger: WindowLedger, residency: Residency, run: WindowRun, pageSize: number, known: number,\n): { readonly head: WindowSpan | undefined; readonly tail: WindowSpan | undefined } {\n    if (isEmpty(residency) || ledger.windows === 0) return NO_BANDS;\n    const head = run.from > 0 ? { from: 0, to: run.from * pageSize - 1, px: offsetOfWindow(ledger, run.from) } : undefined;\n    const tail = run.to < ledger.windows - 1\n        ? { from: (run.to + 1) * pageSize, to: known - 1, px: documentHeight(ledger) - offsetOfWindow(ledger, run.to + 1) }\n        : undefined;\n    return { head, tail };\n}\n\n/**\n * The element a band report names (#612): `px` into the band — from its own\n * top, which the ledger places exactly, since the band was sized from it (a\n * head band starts the rows; a tail band starts where the run ends, never the\n * residency, whose last windows may still be loading inside it, #876) — so a\n * report over the scrollbar thumb's place resolves to the window under it and a\n * far drag rebases instead of walking. Without pixels, the element just\n * outside the run on that side.\n *\n * @param ledger - The ledger\n * @param run - The run the band stands beside\n * @param at - Which band\n * @param px - Pixels from the band's top to the view's centre, when the frame says them\n * @param pageSize - Elements per window\n * @returns The element\n */\nexport function elementInBand(ledger: WindowLedger, run: WindowRun, at: \"head\" | \"tail\", px: number | undefined, pageSize: number): number {\n    if (px !== undefined && ledger.windows > 0) {\n        const bandTop = at === \"head\" ? 0 : offsetOfWindow(ledger, run.to + 1);\n        return elementAtOffset(ledger, bandTop + Math.max(0, px));\n    }\n    return at === \"head\" ? Math.max(0, run.from * pageSize - 1) : (run.to + 1) * pageSize;\n}\n\n/**\n * A failed window's band (#811, #853): its elements and its ledger slot, so the\n * rows that replace it take the same space — floored, so its reason and its\n * Retry stay legible in a short last window, or before any landing taught the\n * ledger a geometry. Its span ends at the source's count once the ledger knows\n * its windows. (A failed window past the ledger's last, which only a sheet\n * whose count shrank under a run beyond it can draw, keeps the span the Sheet's\n * driver always gave it.)\n *\n * @param ledger - The ledger\n * @param w - The window\n * @param total - The source's element count, once known\n * @param pageSize - Elements per window\n * @param minPx - The least height it draws at\n * @returns Its span\n */\nexport function failedSpan(ledger: WindowLedger, w: number, total: number | undefined, pageSize: number, minPx: number): WindowSpan {\n    const known = total !== undefined && ledger.windows > 0;\n    const from = w * pageSize;\n    return {\n        from,\n        to: (known ? Math.min(total, from + pageSize) : from + pageSize) - 1,\n        px: Math.max(minPx, known && w < ledger.windows ? slotHeight(ledger, w) : 0),\n    };\n}\n\n// ── The demand and the jump ───────────────────────────────────────────────\n\n/** Which way the view travels through the windows, and the window it was in as the demand last moved (#1398, CL6). */\nexport interface WindowTravel {\n    readonly at: number;\n    readonly way: Travel;\n}\n\n/**\n * One step of the demand at rest (#1398, CL6): toward the window under the\n * view, reading ahead the way it travels — two windows ahead and one behind\n * with the shipped policy — a window at a time, or rebasing on a far move.\n *\n * @param residency - The resident windows\n * @param ledger - The ledger\n * @param viewportWindow - The window under the view\n * @param policy - The residency policy\n * @param travel - Which way it travelled, and from where\n * @returns The residency it leaves (the same object when nothing moved), and the travel\n */\nexport function advanceAtRest(\n    residency: Residency, ledger: WindowLedger, viewportWindow: number, policy: ResidencyOptions, travel: WindowTravel,\n): { residency: Residency; travel: WindowTravel } {\n    const way = travelOf(travel.at, viewportWindow, travel.way);\n    return { residency: advance(residency, ledger, viewportWindow, policy, way), travel: { at: viewportWindow, way } };\n}\n\n/**\n * The first read, before the ledger knows a window: window 0. The source's\n * count is taught by a landing, and the geometry needs the count, so waiting\n * for it before reading anything would deadlock on first paint; a source that\n * never counts itself still draws what it has.\n *\n * @param residency - The resident windows\n * @returns Window 0 resident when nothing is; else the residency as it is\n */\nexport function firstWindow(residency: Residency): Residency {\n    return isEmpty(residency) ? { ...residency, lo: 0, hi: 0 } : residency;\n}\n\n/**\n * A jump's target pinned (#812, #854): one jump at a time, so every other pin\n * goes, and its window is kept resident whatever the budget says until the\n * jump settles. `rebase` starts the run at it however near the resident one is\n * — a remounted canvas opening where it left off fetches nothing in between.\n *\n * @param residency - The resident windows\n * @param w - The target's window\n * @param rebase - Whether the run starts at it when it lies outside\n * @returns The residency\n */\nexport function pinTarget(residency: Residency, w: number, rebase = false): Residency {\n    let r = unpinAll(residency);\n    if (rebase && !isEmpty(r) && (w < r.lo || w > r.hi)) r = { ...r, lo: w, hi: w };\n    return pin(r, w);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Calendar's paged resource kind, a window at a time (#1424), as the\n * Plan's paged rows are read (#1199, #1344): the timeline's rows and the\n * Resources view's columns of the kind are the windows of its resources around\n * the view, {@link CALENDAR_PAGE_SIZE} to a window, read through the payload's\n * `paged` — the kind's own paged read, in its resources' key order, or its\n * source of the slice's narrowed rows, in the source's index's order. Its\n * resources are never read whole.\n *\n * The views say which of the kind's places they show, as their scroll rests\n * ({@link CalendarPagedDemand}); a reader of its own ({@link CalendarPagesReader})\n * reads the windows those places fall in and one either side, each once\n * (`shared/windowed.ts`' `WindowStore`), and hands the frame what it holds only\n * as that moves: a window landing renders the frame once, and a scroll renders\n * nothing of it. Across a new snapshot each window read stands in until its own\n * lands. Across a new narrowing — a choice of its source — the last view stands\n * in whole, retained, until the windows the view shows have landed under the new\n * one: the places then start again, the view at the top. A window whose read\n * failed is said once, where its rows would be, with Retry.\n *\n * A throwing count, revision or narrowing is the source's failure, as the\n * Plan's and the Sheet's drivers take one (#811, #853): caught inside the read,\n * never thrown out of it, it ends the cold load and is said on the footer's\n * loading line with Retry (`sourceError`); a source that cannot say which\n * snapshot it serves fails its windows too, each said where its places would\n * be.\n *\n * The views lay the kind's places out as stretches ({@link pagedSegments}):\n * each window held, its rows; each window whose read failed; and the places\n * between not read yet, one run each — never a line, a column or an object a\n * place, so a kind of a million resources costs a view what its windows held\n * do.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport { StringType, equalFor, some, type option } from \"@elaraai/east\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport type { PagedLoading } from \"../shared/loading.js\";\nimport { WindowStore, retryWindows, type WindowReader } from \"../shared/windowed.js\";\nimport { resourceKey, type CalendarRow, type CalendarValue } from \"./model.js\";\n\n/** The paged resource kind, as the payload carries it. */\nexport type CalendarPagedValue = Extract<CalendarValue[\"paged\"], { type: \"some\" }>[\"value\"];\n\n/** A window of the paged kind's resources, as the payload hands it. */\ntype PageRows = Extract<ReturnType<CalendarPagedValue[\"rows\"]>, { type: \"some\" }>[\"value\"];\n\n/** How many of the paged kind's resources a window holds, as the Plan's paged windows hold. */\nexport const CALENDAR_PAGE_SIZE = 200;\n\nconst stringEqual = equalFor(StringType);\n/** Whether two narrowings, or two revisions, as a source names them, are one — none being none. */\nconst sameNarrowing = (a: string | undefined, b: string | undefined): boolean => (a === undefined || b === undefined ? a === b : stringEqual(a, b));\n\n/** Why a read threw, in its own words: an Error's message, never its `Error: ` prefix. */\nfunction reasonOf(error: unknown): string {\n    return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * The paged kind's places a view shows, as it reports them: the first and the\n * last, in the kind's order, and the result they belong to — a new narrowing\n * is a new result, whose places start again.\n */\nexport interface CalendarPagedView {\n    /** The first place shown. */\n    readonly first: number;\n    /** The last place shown. */\n    readonly last: number;\n    /** The result the places are of ({@link CalendarPages.result}). */\n    readonly result: number;\n}\n\n/** Where the views report the paged kind's places they show, and the reader hears them: a store of one view. */\nexport interface CalendarPagedDemand {\n    /** The view last reported; `undefined` before one is. */\n    readonly get: () => CalendarPagedView | undefined;\n    /** Reports the places shown: a view the store holds already moves nothing. */\n    readonly set: (view: CalendarPagedView) => void;\n    /** Hears each move; returns the unsubscribe. */\n    readonly subscribe: (listener: () => void) => () => void;\n}\n\n/**\n * A store of the paged kind's places in view.\n *\n * @returns The store, holding none\n */\nexport function createPagedDemand(): CalendarPagedDemand {\n    let view: CalendarPagedView | undefined;\n    const listeners = new Set<() => void>();\n    return {\n        get: () => view,\n        set(next) {\n            if (view !== undefined && view.first === next.first && view.last === next.last && view.result === next.result) return;\n            view = next;\n            for (const listener of [...listeners]) listener();\n        },\n        subscribe(listener) {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n    };\n}\n\n/** What the frame shows of the paged kind: the windows it holds, by window, and what is known of the rest. */\nexport interface CalendarPages {\n    /** The kind's slot. */\n    readonly kind: string;\n    /** Its name: the group its rows draw under. */\n    readonly group: string;\n    /** How many resources it has — its narrowing holds, when its source narrows it — once known. */\n    readonly total: number | undefined;\n    /** Each window held, its resources' rows in the order they draw, by window. */\n    readonly windows: ReadonlyMap<number, readonly CalendarRow[]>;\n    /** Each window whose read failed, by window: why. */\n    readonly failed: ReadonlyMap<number, string>;\n    /**\n     * Why the kind's own reads — its count, its revision, its narrowing — threw: the source's failure, as the Plan's and\n     * the Sheet's drivers take one; `undefined` while none did. It ends the cold load and is said on the footer's line,\n     * with Retry; the windows a source that cannot say its snapshot fails are said where their places would be.\n     */\n    readonly sourceError: string | undefined;\n    /** Whether a window the view shows is read: the footer's line says so, and main is busy. */\n    readonly reading: boolean;\n    /** Whether what it holds stands in for a read again — a new snapshot's, a new narrowing's — retained until it lands. */\n    readonly stale: boolean;\n    /** The narrowing its windows serve, as the source names it; `undefined` where no source narrows the kind. */\n    readonly narrowing: string | undefined;\n    /** Which result its places are of: a new narrowing is a new one, whose places start again. */\n    readonly result: number;\n    /** Whether a window has landed, or a read of the kind failed: before then, the frame's cold load covers it. */\n    readonly ready: boolean;\n    /**\n     * What the footer's loading line says of it (#1398, CL3): a window the view shows that could not be read, the\n     * places it holds; else the kind's own reads that failed, with no places; a new narrowing's windows read while the\n     * last view stands in; a window the view shows in flight, the places it holds; `undefined` while none is.\n     */\n    readonly line: PagedLoading | undefined;\n    /** Asks every failed window again. */\n    readonly retry: () => void;\n}\n\n/**\n * The resource at a place, once its window is held.\n *\n * @param pages - What the frame holds of the paged kind\n * @param at - The place, in the kind's order\n * @returns Its row; `undefined` while its window is not held\n */\nexport function pagedRowAt(pages: CalendarPages, at: number): CalendarRow | undefined {\n    return pages.windows.get(Math.floor(at / CALENDAR_PAGE_SIZE))?.[at % CALENDAR_PAGE_SIZE];\n}\n\n/**\n * Why a place's window could not be read, while its read has failed.\n *\n * @param pages - What the frame holds of the paged kind\n * @param at - The place\n * @returns Why; `undefined` for a window not failed\n */\nexport function pagedFailureAt(pages: CalendarPages, at: number): string | undefined {\n    return pages.failed.get(Math.floor(at / CALENDAR_PAGE_SIZE));\n}\n\n/**\n * How many places the views lay the paged kind out in: its count, once known;\n * before then, the places of the windows in from the first on — each held\n * window's rows, and a window whose read failed a whole window, as the Plan's\n * failed window spans one before the count is known (`failedSpan`), so its\n * failure is said where its places would be.\n *\n * @param pages - What the frame holds of the paged kind\n * @returns The places\n */\nexport function pagedPlaces(pages: CalendarPages): number {\n    if (pages.total !== undefined) return pages.total;\n    let n = 0;\n    for (let w = 0; ; w++) {\n        const held = pages.windows.get(w);\n        if (held !== undefined) n += held.length;\n        else if (pages.failed.has(w)) n += CALENDAR_PAGE_SIZE;\n        else return n;\n    }\n}\n\n/**\n * A stretch of the paged kind's places, as the views lay them out (#1424): a\n * window held, its rows from its first place on; a window whose read failed,\n * its places; or places not read yet, one run however many.\n */\nexport type CalendarPagedSegment =\n    | { readonly kind: \"held\"; readonly from: number; readonly rows: readonly CalendarRow[] }\n    | { readonly kind: \"failed\"; readonly from: number; readonly to: number }\n    | { readonly kind: \"unread\"; readonly from: number; readonly to: number };\n\n/**\n * The paged kind's places in their order as stretches (see\n * {@link CalendarPagedSegment}): each window the frame holds or whose read\n * failed, and one run for each stretch of places between them not read yet —\n * as many stretches as the windows held, however many places the kind has,\n * never one a place.\n *\n * @param pages - The windows the frame holds of the paged kind, and those whose read failed\n * @param places - How many places it lays out ({@link pagedPlaces})\n * @returns The stretches, in the kind's order, covering every place once\n */\nexport function pagedSegments(pages: Pick<CalendarPages, \"windows\" | \"failed\">, places: number): CalendarPagedSegment[] {\n    const windows = [...new Set([...pages.windows.keys(), ...pages.failed.keys()])].sort((a, b) => a - b);\n    const out: CalendarPagedSegment[] = [];\n    let at = 0;\n    for (const w of windows) {\n        const from = w * CALENDAR_PAGE_SIZE;\n        if (from >= places) break;\n        if (from > at) out.push({ kind: \"unread\", from: at, to: from - 1 });\n        const held = pages.windows.get(w);\n        if (held !== undefined) {\n            // A window as held: its rows, as many as the places reach — a window the count has since cut, its first.\n            const rows = held.length > places - from ? held.slice(0, places - from) : held;\n            if (rows.length > 0) out.push({ kind: \"held\", from, rows });\n            at = from + rows.length;\n            continue;\n        }\n        const to = Math.min(places, from + CALENDAR_PAGE_SIZE) - 1;\n        out.push({ kind: \"failed\", from, to });\n        at = to + 1;\n    }\n    if (at < places) out.push({ kind: \"unread\", from: at, to: places - 1 });\n    return out;\n}\n\n/**\n * The windows a view shows: those its places fall in — of the result it reads\n * now; a view of another result's places, or none reported yet, shows the\n * first window.\n *\n * @param view - The view last reported\n * @param result - The result read now\n * @returns The windows, ascending\n */\nexport function shownWindows(view: CalendarPagedView | undefined, result: number): number[] {\n    if (view === undefined || view.result !== result) return [0];\n    const out: number[] = [];\n    for (let w = Math.floor(view.first / CALENDAR_PAGE_SIZE); w <= Math.floor(view.last / CALENDAR_PAGE_SIZE); w++) out.push(w);\n    return out;\n}\n\n/**\n * The windows the reader reads: those the view shows and one either side, so a\n * scroll on finds the next one read — within the kind's count, once known.\n *\n * @param view - The view last reported\n * @param result - The result read now\n * @param total - How many resources the kind has, once known\n * @returns The windows, ascending\n */\nexport function wantedWindows(view: CalendarPagedView | undefined, result: number, total: number | undefined): number[] {\n    const shown = shownWindows(view, result);\n    const last = total === undefined ? Infinity : Math.max(0, Math.ceil(total / CALENDAR_PAGE_SIZE) - 1);\n    const out: number[] = [];\n    for (let w = Math.max(0, shown[0]! - 1); w <= Math.min(last, shown[shown.length - 1]! + 1); w++) out.push(w);\n    return out.length > 0 ? out : [0];\n}\n\n/** Whether two maps of windows hold the same windows, each the same object. */\nfunction sameWindows<T>(a: ReadonlyMap<number, T>, b: ReadonlyMap<number, T>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [w, held] of a) if (!Object.is(b.get(w), held)) return false;\n    return true;\n}\n\n/**\n * What the footer's loading line says of the windows the view shows: the first that failed; else the kind's own reads\n * that failed — its count, its revision, its narrowing — with no places, as the Plan's line says its source's; else the\n * places of those in flight, first to last, within the kind's count.\n *\n * @param shown - The windows the view shows\n * @param failed - Each failed window, why\n * @param inFlight - The windows in flight\n * @param total - How many resources the kind has, once known\n * @param sourceError - Why the kind's own reads failed, while one did\n * @returns What the line says; `undefined` while no window the view shows is read or failed, and the kind's reads hold\n */\nfunction lineOf(shown: readonly number[], failed: ReadonlyMap<number, string>, inFlight: readonly number[], total: number | undefined,\n    sourceError: string | undefined): PagedLoading | undefined {\n    const span = (w: number) => ({ from: w * CALENDAR_PAGE_SIZE, to: Math.min(total ?? Infinity, (w + 1) * CALENDAR_PAGE_SIZE) - 1 });\n    const broke = shown.find((w) => failed.has(w));\n    if (broke !== undefined) return { kind: \"failed\", ...span(broke), reason: failed.get(broke)! };\n    if (sourceError !== undefined) return { kind: \"failed\", from: undefined, to: undefined, reason: sourceError };\n    const reading = shown.filter((w) => inFlight.includes(w));\n    if (reading.length === 0) return undefined;\n    return { kind: \"loading\", from: span(reading[0]!).from, to: span(reading[reading.length - 1]!).to };\n}\n\n/** Whether two lines say the same. */\nfunction sameLine(a: PagedLoading | undefined, b: PagedLoading | undefined): boolean {\n    if (a === undefined || b === undefined) return a === b;\n    switch (a.kind) {\n        case \"filtering\": return b.kind === \"filtering\";\n        case \"loading\": return b.kind === \"loading\" && a.from === b.from && a.to === b.to;\n        case \"failed\": return b.kind === \"failed\" && a.from === b.from && a.to === b.to && a.reason === b.reason;\n    }\n}\n\n/** One read of the windows: what the reader found, under which narrowing and result, and why the kind's own reads failed. */\ninterface PagesRead {\n    readonly narrowing: string | undefined;\n    readonly result: number;\n    readonly total: number | undefined;\n    readonly windows: ReadonlyMap<number, readonly CalendarRow[]>;\n    readonly failed: ReadonlyMap<number, string>;\n    readonly inFlight: readonly number[];\n    readonly stale: boolean;\n    readonly sourceError: string | undefined;\n}\n\n/** No window held, and none failed: before a read that threw has held any. */\nconst NO_WINDOWS: ReadonlyMap<number, readonly CalendarRow[]> = new Map();\nconst NO_FAILURES: ReadonlyMap<number, string> = new Map();\n/** No window in flight. */\nconst NONE_IN_FLIGHT: readonly number[] = [];\n\n/** What the reader keeps from read to read: the windows read under the narrowing it reads now, the result they are of, and the count last read. */\ninterface PagesKept {\n    readonly store: WindowStore<readonly CalendarRow[]>;\n    narrowing: string | undefined;\n    result: number;\n    /** The count the kind last gave, the result and the revision it was read at: it holds while a read of it fails at the same ones. */\n    counted: { readonly result: number; readonly revision: string | undefined; readonly total: number } | undefined;\n}\n\n/**\n * The paged kind's windows around the view, read in a component of its own\n * (see the module docs), handed to the frame only as what it holds moves.\n *\n * @param props - The paged kind, as the payload carries it; its name and icon, as its rows draw them; where the views\n *   report the places they show; and where the windows go\n * @returns Nothing: it reads\n */\nexport function CalendarPagesReader({ paged, name, icon, demand, onPages }: {\n    paged: CalendarPagedValue; name: string; icon: string; demand: CalendarPagedDemand;\n    onPages: (pages: CalendarPages) => void;\n}): null {\n    const view = useSyncExternalStore(demand.subscribe, demand.get, demand.get);\n    // What the reader keeps: the windows read under the narrowing it reads now, the result they are of, the count last read.\n    const [kept] = useState((): PagesKept => ({ store: new WindowStore<readonly CalendarRow[]>(), narrowing: undefined, result: 0, counted: undefined }));\n    const [asked, setAsked] = useState(0);\n    const reader = useMemo((): WindowReader<PageRows, readonly CalendarRow[]> => ({\n        page: (offset, limit) => paged.rows(offset, limit),\n        decode: (rows) => rows.map((row): CalendarRow => ({\n            key: resourceKey({ kind: paged.kind, key: row.key }), label: row.label, meta: row.meta.type === \"some\" ? row.meta.value : \"\",\n            group: name, icon, resource: some({ kind: paged.kind, key: row.key }),\n        })),\n        label: \"[Calendar]\",\n    }), [paged, name, icon]);\n    const read = useCallback((): PagesRead => {\n        // The kind's own reads first — its narrowing, its revision, its count — each caught: one that throws is the\n        // source's failure (#811, #853), said with Retry, as the Plan's and the Sheet's drivers say theirs, never thrown\n        // out of the read, which would leave the frame's cold load up with nothing said.\n        let sourceError: string | undefined;\n        // A choice of its source is a new result: its windows read again from none, its places starting again.\n        let narrowing = kept.narrowing;\n        let narrowed = true;\n        if (paged.query.type === \"some\") {\n            try {\n                narrowing = paged.query.value();\n            } catch (err) {\n                console.error(\"[Calendar] the paged resources' narrowing could not be read:\", err);\n                sourceError = reasonOf(err);\n                narrowed = false;\n            }\n        }\n        if (kept.result === 0 || (narrowed && !sameNarrowing(narrowing, kept.narrowing))) {\n            kept.store.drop();\n            kept.narrowing = narrowing;\n            kept.result += 1;\n        }\n        // A new snapshot reads every window again, each held one standing in until its own lands. A source that cannot\n        // say which snapshot it serves has failed as a whole: its windows then fail too, each said where its places are.\n        let revision = kept.store.revision;\n        try {\n            const served: option<string> = paged.revision();\n            revision = served.type === \"some\" ? served.value : undefined;\n        } catch (err) {\n            console.error(\"[Calendar] the paged resources' revision could not be read:\", err);\n            sourceError ??= reasonOf(err);\n        }\n        kept.store.at(revision);\n        let total: number | undefined;\n        try {\n            const counted: option<bigint> = paged.total();\n            if (counted.type === \"some\") total = Number(counted.value);\n        } catch (err) {\n            console.error(\"[Calendar] the paged resources could not be counted:\", err);\n            sourceError ??= reasonOf(err);\n            // The count this result last gave at this revision still holds — the same resources — so the places stand\n            // while the failure is said beside them.\n            const last = kept.counted;\n            if (last !== undefined && last.result === kept.result && sameNarrowing(last.revision, revision)) total = last.total;\n        }\n        if (total !== undefined) kept.counted = { result: kept.result, revision, total };\n        const wanted = wantedWindows(view, kept.result, total);\n        kept.store.prune(new Set(wanted));\n        const reads = kept.store.read(reader, wanted, CALENDAR_PAGE_SIZE);\n        return {\n            narrowing: kept.narrowing, result: kept.result, total,\n            windows: new Map(reads.resident.map(({ w, read: rows }) => [w, rows])),\n            failed: new Map(reads.failed.map(({ w, error }) => [w, error])),\n            inFlight: reads.inFlight, stale: reads.stale, sourceError,\n        };\n        // `asked` moves with a Retry: the failed windows' records went, and they are read again.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [paged, view, reader, kept, asked]);\n    const { result } = useTrackedEvaluation(read);\n    // A Retry asks again now (#1398, `retryWindows`): the source rearms what failed — its windows, and the revision it\n    // could not find — then the failed windows' records go and the windows are read again.\n    const retry = useCallback(() => retryWindows(paged, () => { kept.store.forget(); setAsked((n) => n + 1); }), [paged, kept]);\n    const held = useRef<CalendarPages | undefined>(undefined);\n    const was = held.current;\n    // The read catches the kind's own failures and every window's: a read that still threw is the source's failure too,\n    // as the Plan's driver takes one — said with Retry, the cold load over, what the frame holds standing beside it —\n    // never a frame covered for good.\n    if (!result.ok) console.error(\"[Calendar] the paged resources could not be read:\", result.error);\n    const r: PagesRead = result.ok ? result.value : {\n        narrowing: was?.narrowing ?? kept.narrowing, result: was?.result ?? kept.result, total: was?.total, windows: was?.windows ?? NO_WINDOWS,\n        failed: was?.failed ?? NO_FAILURES, inFlight: NONE_IN_FLIGHT, stale: false, sourceError: reasonOf(result.error),\n    };\n    const shown = shownWindows(view, r.result);\n    const landed = shown.every((w) => r.windows.has(w) || r.failed.has(w));\n    if (was !== undefined && was.result !== r.result && !landed && r.sourceError === undefined) {\n        // A new narrowing: the last view stands in, whole and retained, until the windows the view shows land under it —\n        // or a read of it fails, which is said.\n        if (!was.stale || !was.reading || was.line?.kind !== \"filtering\") held.current = { ...was, stale: true, reading: true, line: { kind: \"filtering\" } };\n    } else {\n        const reading = r.inFlight.some((w) => shown.includes(w));\n        const ready = was?.ready === true || r.windows.size > 0 || r.failed.size > 0 || r.sourceError !== undefined;\n        const line = lineOf(shown, r.failed, r.inFlight, r.total, r.sourceError);\n        if (was === undefined || was.result !== r.result || was.total !== r.total || !sameWindows(was.windows, r.windows) || !sameWindows(was.failed, r.failed)\n            || was.sourceError !== r.sourceError || was.reading !== reading || was.stale !== r.stale || !sameNarrowing(was.narrowing, r.narrowing)\n            || was.ready !== ready || was.retry !== retry || !sameLine(was.line, line)) {\n            held.current = {\n                kind: paged.kind, group: name, total: r.total, windows: r.windows, failed: r.failed, sourceError: r.sourceError, reading, stale: r.stale,\n                narrowing: r.narrowing, result: r.result, ready, line, retry,\n            };\n        }\n    }\n    const pages = held.current;\n    useLayoutEffect(() => { if (pages !== undefined) onPages(pages); }, [pages, onPages]);\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The Calendar's event kinds as the shared schedule reader reads them\n * (#1424): the Calendar's adapter to `shared/schedule/cells.ts`, as the Plan's\n * `plan/root/cells.ts` is. Every kind is counted before one of its events is\n * read — through its source's interval index, the count its window's read\n * asks first; through its day index, by the days its events run on, an upper\n * bound (`countExact` false); or in memory, its record read whole — and past\n * `SCHEDULE_EVENT_CAP` over the window the view reads none is read or drawn.\n * Where the view lays its resources out — the timeline's rows, the Resources\n * view's columns — each resource of a kind such a kind is placed on shades\n * from its source's summary, the share of each period booked, or is hatched\n * where it has none to shade at the view's period; and the frame's banner\n * says how many events there are and to zoom in or narrow. A view with no\n * resource axis — a time grid, the month, the agenda — has no row to shade:\n * the banner alone says so.\n *\n * The adapter gives the reader what is the Calendar's, in the reader's terms:\n * each event kind — its slot, its name, its resource kinds, its cells' type,\n * its series key and its count — whose rows book their buckets, an event\n * drawn over its time; its source of the slice; the resource kinds the view\n * lays out, each its rows the rail shows, shaded by the kind's slot; and the\n * window the view reads, cut into its periods — the timeline's days, weeks or\n * months by its period, the Resources view's day — each whole, as e3 tiles\n * them, so a summary's tiles fold into a period whole.\n *\n * A kind placed on the paged resource kind (`pages.ts`) is read a cell at a\n * time where the view lays that kind's resources out — the timeline's rows,\n * the Resources view's columns: the blocks of fifty of its resources around\n * those the view shows, by the tiles the window touches, every cell's\n * searches in one request and the missing cells' entries in one more — the\n * Plan's reading, through the payload's paged seam, its keys a window at a time\n * ({@link calendarCellsPaged}). The places the view shows come from where the\n * views report them, as their scroll rests: the first and the last held row\n * among them ({@link calendarCellSpan}), the span standing while the view shows\n * only places not read yet. A view that lays no resource out — a time grid, the\n * month, the agenda — reads such a kind as it reads any other: counted over the\n * window first. A Save's confirmation reads its events by their keys, never the\n * cells: what it landed of such a kind draws as the Save left it over cells read\n * before the commit, until they are read again — the editing keeps it for the\n * kinds {@link calendarCellKinds} names (the shared reader's \"What a Save\n * landed\").\n *\n * A kind read a window at a time — through its source's interval index, or a\n * day index, one event by its key — gives the reader its window's own stored\n * rows (`stored`, #1599), which the reader keeps as it keeps a kind's cells: the\n * window's read draws the kind from them, so they stand while they are read\n * again — after a Save, after another session's write — a draft made meanwhile\n * draws at once, and a gesture finds its event's row among them. Its range is a\n * period (`period`): a step draws none of the last period's rows.\n *\n * A kind with a backlog narrowed through its source reads its window's rows\n * alone (#1424): the Backlog tab pages its backlog through the source itself\n * (`backlog-pages.ts`), so nothing reads it whole, and every draft the kind's\n * seams are given draws where it places its event. The reader asks the\n * narrowing — but the window — of the stored rows of its drafted events its\n * window does not hold (`windowField`), and leaves out the drafts of those the\n * narrowing does not hold either, as it leaves out a cells kind's: a backlog\n * event a gesture scheduled draws where it is placed, and a draft of an event\n * another narrowing holds draws nowhere. A narrowed kind with no backlog draws a\n * draft only of an event its window holds, or of a new one (`isNew`, #1343), as\n * its window's own read drew them.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { tileNext, tileStart } from \"@elaraai/east-ui/internal\";\nimport {\n    useScheduleCells, type ScheduleCellBucket, type ScheduleCellKind, type ScheduleCellPaged, type ScheduleCellResources, type ScheduleCellSpan,\n    type ScheduleCellsRead,\n} from \"../shared/schedule/cells.js\";\nimport type { ScheduleEditing, ScheduleEventDraftsValue } from \"../shared/schedule/editing.js\";\nimport type { CalendarKind, CalendarRange } from \"./model.js\";\nimport { CALENDAR_PAGE_SIZE, pagedRowAt, type CalendarPagedValue, type CalendarPagedView, type CalendarPages } from \"./pages.js\";\nimport type { CalendarEventPart } from \"./window.js\";\n\n/** The periods a resource's shading is cut into: the timeline's day, week or month, the Resources view's day. */\nexport type CalendarBucket = \"day\" | \"week\" | \"month\";\n\nconst stringEqual = equalFor(StringType);\n/** No event a kind's host wants by its key beyond what the reader reads: the Calendar reads one event by key itself. */\nconst NO_WANTED: readonly string[] = [];\n\n/**\n * The periods a window is cut into, each whole as e3 tiles it — a day, an ISO\n * week from Monday, a calendar month, in UTC — from the one holding the\n * window's start to the one holding its last instant: what a summary's tiles\n * fold into whole.\n *\n * @param range - The window\n * @param bucket - The period\n * @returns The periods, in order; the first may start before the window, and the last end after it\n */\nexport function calendarBuckets(range: { readonly from: Date; readonly to: Date }, bucket: CalendarBucket): ScheduleCellBucket[] {\n    const out: ScheduleCellBucket[] = [];\n    for (let at = tileStart(bucket, range.from); at.getTime() < range.to.getTime();) {\n        const next = tileNext(bucket, at);\n        out.push({ start: at.getTime(), end: next.getTime() });\n        at = next;\n    }\n    return out;\n}\n\n/**\n * The paged resource kind as the shared reader reads it: its keys a window at a\n * time — {@link CALENDAR_PAGE_SIZE} to a window, as its rows are paged — its\n * count, and the narrowing its windows serve.\n *\n * @param paged - The paged kind, as the payload carries it\n * @returns The reader's seam\n */\nexport function calendarCellsPaged(paged: CalendarPagedValue): ScheduleCellPaged {\n    return {\n        kind: paged.kind,\n        window: CALENDAR_PAGE_SIZE,\n        hidden: false,\n        keys: (offset, limit) => paged.keys(offset, limit),\n        total: () => paged.total(),\n        narrowing: () => (paged.query.type === \"some\" ? paged.query.value() : undefined),\n    };\n}\n\n/**\n * The paged kind's rows the view shows, as the reader takes them: the first\n * and the last held row among the places the views last reported, each by its\n * window and its key, under the narrowing their windows serve. A view that\n * shows only places not read yet leaves the span standing — never the opening's\n * first block, a view away — and the rows there report their own once they are\n * held.\n *\n * @param view - The places the views last reported\n * @param pages - What the frame holds of the paged kind\n * @param standing - The span made last\n * @returns The span; `standing` while the view shows no held row, or the same rows under the same narrowing\n */\nexport function calendarCellSpan(view: CalendarPagedView | undefined, pages: CalendarPages | undefined, standing: ScheduleCellSpan | undefined): ScheduleCellSpan | undefined {\n    if (view === undefined || pages === undefined || view.result !== pages.result) return standing;\n    let first: ScheduleCellSpan[\"first\"] | undefined;\n    let last: ScheduleCellSpan[\"first\"] | undefined;\n    for (let at = view.first; at <= view.last; at++) {\n        const row = pagedRowAt(pages, at);\n        if (row === undefined || row.resource.type !== \"some\") continue;\n        const here = { w: Math.floor(at / CALENDAR_PAGE_SIZE), key: row.resource.value.key };\n        first ??= here;\n        last = here;\n    }\n    if (first === undefined || last === undefined) return standing;\n    const same = (a: ScheduleCellSpan[\"first\"], b: ScheduleCellSpan[\"first\"]) => a.w === b.w && stringEqual(a.key, b.key);\n    if (standing !== undefined && same(standing.first, first) && same(standing.last, last)\n        && (standing.narrowing === undefined || pages.narrowing === undefined ? standing.narrowing === pages.narrowing : stringEqual(standing.narrowing, pages.narrowing))) return standing;\n    return { first, last, narrowing: pages.narrowing };\n}\n\n/** What {@link useCalendarCells} reads over. */\nexport interface CalendarCellsArgs {\n    /** The event kinds, as the payload carries them. */\n    readonly kinds: readonly CalendarKind[];\n    /** Each event kind narrowed through its source of the slice: what it is counted and read through. */\n    readonly parts: readonly CalendarEventPart[];\n    /**\n     * The resource kinds the view lays out, each its resources the rail shows: what a kind past the cap shades, or\n     * hatches; none in a view with no resource axis.\n     */\n    readonly resources: readonly ScheduleCellResources[];\n    /** The window the view reads. */\n    readonly range: CalendarRange;\n    /** The periods a resource's shading is cut into; `undefined` in a view with no resource axis, which shades none. */\n    readonly bucket: CalendarBucket | undefined;\n    /** Every kind's drafts — the same object while they hold. */\n    readonly drafts: ScheduleEventDraftsValue;\n    /**\n     * The paged resource kind, where the view lays its resources out: a kind placed on it is read a cell at a time;\n     * `undefined` with none paged, or in a view that lays no resource out.\n     */\n    readonly paged: ScheduleCellPaged | undefined;\n    /** The paged kind's rows the view shows ({@link calendarCellSpan}); `undefined` before any is held in view. */\n    readonly span: ScheduleCellSpan | undefined;\n    /**\n     * The editing's say of what confirmed Saves landed of the kinds it names ({@link calendarCellKinds}), and how it is\n     * let go: drawn over a kind's cells read before the commit until they are read again — and the row each drafted\n     * event's session began from, which tells a new event from one the record holds; `undefined` for a Calendar read\n     * only.\n     */\n    readonly editing?: Pick<ScheduleEditing, \"landed\" | \"shown\" | \"held\" | \"carrying\"> | undefined;\n}\n\n/**\n * The kinds the reader may give cells (see the module docs): every kind read a window at a time, one event by its key —\n * by its series index's cells, or its window's own rows — whose cells stand at the revision they were read at, so the\n * editing keeps what each Save lands of them for the reader to draw until they are read again.\n *\n * @param kinds - The event kinds, as the payload carries them\n * @returns Their slots\n */\nexport function calendarCellKinds(kinds: readonly CalendarKind[]): ReadonlySet<string> {\n    return new Set(kinds.filter((kind) => kind.entries.type === \"some\").map((kind) => kind.key));\n}\n\n/**\n * The kinds' counts and, past the cap, their shading and their notices — and\n * a kind placed on the paged resource kind, its cells (see the module docs) —\n * read in the component that reads the window: what the window's read takes\n * each kind's decision from, and what the frame shades a resource's row or\n * column by and says in its banner.\n *\n * @param args - What it reads over\n * @returns What the shared reader read\n */\nexport function useCalendarCells(args: CalendarCellsArgs): ScheduleCellsRead {\n    const { kinds, parts, resources, range, bucket, drafts, paged, span, editing } = args;\n    const held = editing?.held;\n    const carrying = editing?.carrying;\n    const cellKinds = useMemo((): ScheduleCellKind[] => kinds.map((kind) => ({\n        key: kind.key,\n        name: kind.name,\n        takes: kind.takes,\n        // An event is a block over its time: a resource's shading is the share of each period its events book.\n        booked: true,\n        // A resource's row, or its column, is its own: the shading stands in for it by its kind's slot.\n        shadeKey: (slot: string) => slot,\n        cellsType: kind.cellsType,\n        seriesKey: kind.seriesKey,\n        count: kind.count,\n        exact: kind.countExact,\n        part: parts.find((p) => stringEqual(p.kind.key, kind.key))?.part,\n        hidden: false,\n        wanted: NO_WANTED,\n        // A kind with a backlog narrowed through its source reads its window's rows alone, its backlog paged by the Backlog\n        // tab (#1424): the reader asks the narrowing but the window of its drafted events its window does not hold, so a\n        // backlog event a gesture scheduled draws where it is placed, and a draft of an event the narrowing does not hold\n        // draws nowhere.\n        windowField: kind.backlog && parts.some((p) => stringEqual(p.kind.key, kind.key)) ? kind.schedule.start : undefined,\n        // A narrowed kind with no backlog draws a draft only of an event its window holds, or of a new one (#1343): one its\n        // session began from no stored row.\n        isNew: !kind.backlog && held !== undefined && parts.some((p) => stringEqual(p.kind.key, kind.key)) ? (id: string) => held(kind.key, id) === undefined : undefined,\n        // And of one it last drew, while the kind's session has yet to judge its drafts where its record reads now (#1599):\n        // another session's removal of an event drafted here never takes it off the board before the session has read it.\n        carrying: carrying === undefined ? undefined : () => carrying(kind.key),\n        // A kind read a window at a time gives the reader the rows its window's read holds to keep standing (#1599), and —\n        // no source narrowing it — the revision its record reads at.\n        stored: kind.entries.type === \"some\" ? kind.stored : undefined,\n        revision: kind.entries.type === \"some\" ? kind.entries.value.revision : undefined,\n    })), [kinds, parts, held, carrying]);\n    const from = range.from.getTime();\n    const to = range.to.getTime();\n    const over = useMemo(() => ({ from: new Date(from), to: new Date(to) }), [from, to]);\n    const buckets = useMemo(() => (bucket === undefined ? [] : calendarBuckets(over, bucket)), [over, bucket]);\n    // The window is a period: a read for another is a step, and none of a windowed kind's rows of the last draws under it.\n    const period = `${from}\\u0000${to}`;\n    return useScheduleCells({\n        host: \"Calendar\", kinds: cellKinds, resources, paged, range: over, period, buckets, resolution: bucket, drafts, span,\n        landed: editing?.landed, shown: editing?.shown,\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A period builder's neighbouring periods, read ahead (#1398, CL7): once the\n * period in view has landed — every read it needs — its reader reads the next\n * period's and the previous period's too, so a one-step move to either finds\n * its reads landed and shows it at once, with no placeholder. The Roster's\n * weeks, the Allocation's days and the Calendar's days, weeks and months read\n * so.\n *\n * They are read in a tracked read of their own beside the period's\n * (`useReadAhead`), which keeps them while they are neighbours: the paging\n * runtime aborts a read no reader waits on any longer\n * (`platform/paged-runtime.ts`), so a newer navigation drops the reads of the\n * periods it moved away from, a period passed through in rapid steps among\n * them; and a page of theirs landing re-runs that read alone, never the\n * period's. Nothing is read ahead until the period itself has landed, so its\n * own pages go first; each read's pages are asked concurrently once its count\n * is known (`PagedScan`, up to four in flight). A neighbour's read is never\n * its period's display: what it reads is kept by its tracked reads, and a\n * failure there is said once it is the period in view, by that period's own\n * read.\n *\n * @packageDocumentation\n */\n\n/**\n * Read a period's neighbours ahead, once the period itself has landed (see\n * the module docs). Called inside a tracked read: `useReadAhead`'s.\n *\n * @param landed - Whether every read the period in view needs has landed: until then nothing is read ahead\n * @param neighbours - The periods read ahead, nearest first: the next, then the previous\n * @param read - Reads one neighbour's reads, as the period's own read reads its period's; what it answers is not used\n * @typeParam P - What names a period: its first day, or its range\n */\nexport function readAhead<P>(landed: boolean, neighbours: readonly P[], read: (period: P) => void): void {\n    if (!landed) return;\n    for (const period of neighbours) {\n        try {\n            read(period);\n        } catch {\n            // A neighbour's failure is not the period in view's: its read says it once it is the period in view.\n        }\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A period builder's read ahead (#1398, CL7) as a tracked read of its own,\n * beside the period's: what `readAhead` reads (`read-ahead.ts`), read in an\n * evaluation that waits on the neighbours' reads alone. A page of a\n * neighbour's landing re-runs this read, never the period's — which would\n * build the period's read again and hand the frame a new read of a period\n * that has not moved, once a page.\n *\n * @packageDocumentation\n */\n\nimport { useCallback } from \"react\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { readAhead } from \"./read-ahead.js\";\n\n/**\n * Reads a period's neighbours ahead once the period itself has landed, as a\n * tracked read of its own. Call it in the component that reads the period,\n * after the period's own read, so a step moves both in one render: the\n * neighbour stepped to is the period's read from then on, and only the reads\n * of the periods no longer either side lose their reader.\n *\n * @param landed - Whether every read the period in view needs has landed: until then nothing is read ahead\n * @param neighbours - The periods read ahead, nearest first; memoised, so the read is not built again each render\n * @param read - Reads one neighbour's reads, as the period's own read reads its period's; memoised as well\n * @typeParam P - What names a period: its first day, or its range\n */\nexport function useReadAhead<P>(landed: boolean, neighbours: readonly P[], read: (period: P) => void): void {\n    const evaluate = useCallback(() => {\n        readAhead(landed, neighbours, read);\n        return null;\n    }, [landed, neighbours, read]);\n    useTrackedEvaluation(evaluate);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A period builder's view — the page's own (#1398): the Calendar's layout,\n * period and date, the Roster's week and the Allocation's day. It is kept\n * state (east-ui-components' `platform/kept.ts`): one view a key for the page's\n * life, every builder under the key reading it, so a step moves it and the\n * window the builder writes beside it together, and every render reads them\n * together. Storage keeps the view the viewer left for a reload: written as the\n * view moves, read before the page's first builder under its key draws — and\n * never followed while the page runs.\n *\n * Followed, storage moved a page's view from outside it: another page writing\n * it — a second tab on the same builder, the browser's own storage editor —\n * reached this page's view and never what the page holds beside it. The\n * Calendar's window then put its date back at the window's first day: the day\n * the viewer stood on, and every step from it, moved to the window's start.\n * The Roster's week and the Allocation's day moved under the viewer, with what\n * the toolbar's Publish and the history act on.\n *\n * @packageDocumentation\n */\n\nimport { NOT_KEPT, keptJson, useKept } from \"@elaraai/east-ui-components/internal\";\n\n/**\n * A builder's view, the page's own (see the module docs). Setting it keeps it for a reload; another page's keeping it\n * moves nothing here. Every builder under the key in the page shares it.\n *\n * @param key - The view's storage key\n * @param initial - The author's view: what a page with nothing held and nothing kept opens on\n * @param viewOf - The view storage keeps, read defensively — storage outlives versions, and anything may write it: the\n *   view, taken only in the shape this version writes; `undefined` for anything else. The same function for a key.\n * @returns The view, and what moves it\n */\nexport function usePageView<V>(key: string, initial: V, viewOf: (stored: unknown) => V | undefined): { view: V; setView: (next: V) => void } {\n    const [view, setView] = useKept(key, keptJson<V>((stored) => viewOf(stored) ?? NOT_KEPT), initial);\n    return { view, setView };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Calendar's view — its layout, its period and its date — the page's own\n * (#1398, `shared/schedule/page-view.ts`): held beside the date window its\n * event sources hold, for as long as the page's UI store holds that window, so\n * a step writes the two together and every render reads them together.\n * Storage keeps the view the viewer left for a reload: written as the view\n * moves, and read once, as the first Calendar under its key mounts in the\n * page — never followed while the page runs.\n *\n * Followed, storage moved the page's date alone: another page writing it — a\n * second tab on the same Calendar, the browser's own storage editor — reached\n * this page's view and never its window, which lives in the page's UI store.\n * The window then put the date back at its own first day (`useCalendarWindow`):\n * the day the viewer stood on, and every step from it, moved to the window's\n * start.\n *\n * @packageDocumentation\n */\nimport { CalendarLayoutType, CalendarPeriodType } from \"@elaraai/e3-ui/internal\";\nimport { usePageView } from \"../shared/schedule/page-view.js\";\nimport type { CalendarView } from \"./model.js\";\n\n/**\n * The view storage keeps, read defensively — storage outlives versions, and anything may write it: an object whose\n * layout and period are cases of the Calendar's own, and whose date is a finite epoch.\n *\n * @param stored - What storage keeps under the view's key\n * @returns The view; `undefined` for anything else\n */\nfunction calendarViewOf(stored: unknown): CalendarView | undefined {\n    if (typeof stored !== \"object\" || stored === null) return undefined;\n    const { layout, period, date } = stored as Partial<Record<keyof CalendarView, unknown>>;\n    if (typeof layout !== \"string\" || !Object.hasOwn(CalendarLayoutType.cases, layout)) return undefined;\n    if (typeof period !== \"string\" || !Object.hasOwn(CalendarPeriodType.cases, period)) return undefined;\n    if (typeof date !== \"number\" || !Number.isFinite(date)) return undefined;\n    return { layout: layout as CalendarView[\"layout\"], period: period as CalendarView[\"period\"], date };\n}\n\n/**\n * A Calendar's view, the page's own (see the module docs). Setting it keeps it for a reload; another page's keeping it\n * moves nothing here.\n *\n * @param key - The view's storage key\n * @param initial - The author's view: what a page with nothing held and nothing kept opens on\n * @returns The view, and what moves it\n */\nexport function useCalendarView(key: string, initial: CalendarView): { view: CalendarView; setView: (next: CalendarView) => void } {\n    return usePageView(key, initial, calendarViewOf);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Calendar's one date window (#1343): every event kind narrowed through\n * its source of the slice reads the window the Calendar shows, and each such\n * source's range holds it, so its counts, its Save notice and the window agree.\n * The first event source holding a range leads; navigation writes every one,\n * and a range written to one — the range editor's — is written to the others.\n * A source still holding its seed — the slice's `initial`, written over by\n * nothing — leads nothing: the view decides the window, the viewer's own when\n * a reload restores it, so a reload keeps the period and the date the viewer\n * left rather than the slice's start. With no slice, the view alone is the\n * window.\n *\n * The view is the page's own, held beside the window (`view.ts`, #1398): a\n * step writes its date and its window into what the page holds, so no render\n * reads one without the other, and storage keeps the view only for a reload —\n * another page writing it moves neither. The window puts the date at its first\n * day only for a window the viewer wrote, the Range panel's.\n */\nimport { useLayoutEffect, useMemo, useState } from \"react\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType, RecordSlicesChromeType } from \"@elaraai/east-ui/internal\";\nimport { useSlicesReactivity } from \"@elaraai/east-ui-components\";\nimport { recordSliceSeeded, recordSliceWindow, setRecordSliceWindow } from \"@elaraai/east-ui-components/internal\";\nimport { CalendarLayoutType, CalendarPeriodType } from \"@elaraai/e3-ui/internal\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { shownView, shownViews } from \"../shared/views.js\";\nimport { calendarRange, DAY, dayStart, type CalendarKind, type CalendarRange, type CalendarValue, type CalendarView } from \"./model.js\";\nimport { useCalendarView } from \"./view.js\";\n\n/** The layouts, in the switch's order. */\nconst LAYOUTS = Object.keys(CalendarLayoutType.cases) as readonly CalendarView[\"layout\"][];\n/** The periods, in the switch's order. */\nconst PERIODS = [\"day\", \"week\", \"month\"] as const satisfies readonly (keyof typeof CalendarPeriodType.cases)[];\n\n/** One record Slice's controls. */\ntype Bind = ValueTypeOf<RecordSliceBindType>;\n\n/** An event kind narrowed through its source of the slice: the kind, and its part. */\nexport interface CalendarEventPart {\n    /** The event kind. */\n    readonly kind: CalendarKind;\n    /** Its source's part of the slice: the Slice its reads, its counts and its Save notice go through. */\n    readonly part: Bind;\n}\n\n/** The window and the slice that every Calendar layout consumes. */\nexport interface CalendarWindow {\n    view: CalendarView; setView: (next: CalendarView) => void; range: CalendarRange;\n    /** The layouts this Calendar offers, in the switch's order: the `views` prop's. */\n    layouts: readonly CalendarView[\"layout\"][];\n    /** The periods this Calendar offers, in the switch's order: the `viewPeriods` prop's. */\n    periods: readonly CalendarView[\"period\"][];\n    /** The rail; `undefined` with no slice. */\n    chrome: ValueTypeOf<RecordSlicesChromeType> | undefined;\n    /** Each event kind narrowed through its source, in the kinds' order. */\n    eventParts: readonly CalendarEventPart[];\n    /** The event sources that hold the window: each with a range, in the kinds' order. */\n    windowParts: readonly CalendarEventPart[];\n    /** The rail's affordances. */\n    affordances: readonly string[];\n    /** Why the window could not be written to a source's range — its indexes answer none alone. */\n    error: string | undefined;\n}\n\n/**\n * Each event kind narrowed through its source of the slice: the source named\n * after its slot, as the tag hands it the kind (#1343).\n *\n * @param value - The payload\n * @returns Each such kind and its part, in the kinds' order\n */\nexport function calendarEventParts(value: CalendarValue): CalendarEventPart[] {\n    const chrome = value.slice.type === \"some\" ? value.slice.value : undefined;\n    return value.events.flatMap(kind => {\n        const part = sourcePart(chrome, kind.key);\n        return part === undefined ? [] : [{ kind, part }];\n    });\n}\n\n/** The window as one range's bounds: the part's half-open range, in epoch milliseconds. */\nfunction sameWindow(part: Bind, from: number, to: number): boolean {\n    const window = recordSliceWindow(part);\n    return window?.kind === \"datetime\" && window.min === from && window.max === to;\n}\n\n/** The slice is the window's owner when it narrows an event kind; layout and period remain viewer preferences. */\nexport function useCalendarWindow(value: CalendarValue, key: string, now: Date): CalendarWindow {\n    const chrome = value.slice.type === \"some\" ? value.slice.value : undefined;\n    const eventParts = useMemo(() => calendarEventParts(value), [value]);\n    const windowParts = useMemo(() => eventParts.filter(({ part }) => part.config.range.type === \"some\"), [eventParts]);\n    const version = useSlicesReactivity(eventParts.map(({ part }) => part.key));\n    const affordances = useMemo(() => chrome?.affordances.map(a => a.type) ?? [], [chrome]);\n    const [error, setError] = useState<string>();\n    // The page's own view, beside the window its sources hold (`view.ts`): storage keeps it only for a reload.\n    const { view: state, setView: setState } = useCalendarView(`${key}.view`, {\n        layout: value.settings.layout.type, period: value.settings.period.type,\n        date: dayStart(value.settings.date.type === \"some\" ? value.settings.date.value : now).getTime(),\n    });\n    // The first event source holding a range leads; the others follow it. One still holding its seed leads nothing:\n    // its window is the author's start, and the view — restored by a reload — writes its own over it.\n    const views = value.settings.views;\n    const layouts = useMemo(() => shownViews(LAYOUTS, views), [views]);\n    const viewPeriods = value.settings.viewPeriods;\n    const periods = useMemo(() => shownViews(PERIODS, viewPeriods), [viewPeriods]);\n    const lead = windowParts.filter(({ part }) => !recordSliceSeeded(part)).map(({ part }) => recordSliceWindow(part)).find(window => window?.kind === \"datetime\");\n    const from = lead?.min;\n    const to = lead?.max;\n    // A layout and a period this Calendar offers: what is kept stands, so each comes back should the Calendar offer it again.\n    const view = useMemo(() => {\n        const layout = shownView(state.layout, layouts), period = shownView(state.period, periods);\n        const offered = layout === state.layout && period === state.period ? state : { ...state, layout, period };\n        return from === undefined || (state.date >= from && state.date < (to ?? from)) ? offered : { ...offered, date: from };\n    }, [state, layouts, periods, from, to]);\n    const range = useMemo((): CalendarRange => {\n        if (from === undefined || to === undefined || to <= from) return calendarRange(view, value.settings);\n        const days: Date[] = [];\n        for (let at = dayStart(from).getTime(); at < to; at += DAY) {\n            const day = new Date(at);\n            if (value.settings.weekends || (day.getUTCDay() !== 0 && day.getUTCDay() !== 6)) days.push(day);\n        }\n        return { from: new Date(from), to: new Date(to), days };\n    }, [from, to, view, value.settings]);\n    // Every event source that does not hold the window yet takes it: a first mount, a range cleared, or another\n    // source's range written by the range editor.\n    const write = (min: number, max: number, only: (part: Bind) => boolean) => {\n        try {\n            for (const { part } of windowParts) if (only(part)) setRecordSliceWindow(part, min, max);\n            setError(undefined);\n        } catch (reason) {\n            setError(reason instanceof Error ? reason.message : \"The dates could not be applied\");\n        }\n    };\n    useLayoutEffect(() => {\n        const min = range.from.getTime(), max = range.to.getTime();\n        if (windowParts.some(({ part }) => !sameWindow(part, min, max))) write(min, max, part => !sameWindow(part, min, max));\n        // `version` moves with every source's state: a range cleared or written there is followed here.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [windowParts, range.from, range.to, version]);\n    const setView = (next: CalendarView) => {\n        setState(next);\n        const window = calendarRange(next, value.settings);\n        write(window.from.getTime(), window.to.getTime(), () => true);\n    };\n    return { view, setView, layouts, periods, range, chrome, eventParts, windowParts, affordances, error };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Tracked Schedule reads over the author-selected window, two of them, each a\n * read of its own (#1343, #1398):\n *\n * - **The window**: every event kind's events over it. Once the window has\n *   landed, what a step goes to is read ahead (`shared/schedule/read-ahead.ts`,\n *   CL7) in a read of its own, so a step to it shows it at once and a page of\n *   it landing hands the frame nothing: the periods either side, on every\n *   layout. A step further drops their reads. It reads what a step will find,\n *   and draws nothing it works out, so the drafts are no part of it: a drop\n *   works out neither period again (#1594).\n * - **The backlog apart**: each backlog kind's not narrowed through a source\n *   of the slice — read whole, or through its backlog index — which follows no\n *   window. Read once, no date change reads it again: it stands through every\n *   step. A kind narrowed through its source has its\n *   backlog read a page at a time by the Backlog tab itself (`backlog-pages.ts`,\n *   #1424), through the source with its start Unset, never with the window:\n *   its window's read reads the window's rows alone, and its drafts are the\n *   shared reader's — those of events its narrowing does not hold left out — so\n *   a backlog event a gesture scheduled draws where it is placed.\n *\n * The first read lands whole: the frame hears of neither until both have, so\n * it reveals what it read at once (CL5).\n *\n * Every kind is counted before one of its events is read (#1424), by the\n * shared schedule reader (`cells.ts`), which reads beside the window in the\n * same component. A kind read a window at a time — one event by its key — is\n * the reader's to read (#1599): within `SCHEDULE_EVENT_CAP` over the window it\n * gives the window's read the kind's cells, its window's own rows, which stand\n * while they are read again, so a draft made meanwhile draws at once; past the\n * cap, none of its events is read or drawn (`capped`), its drafts alone drawn\n * where they place their events, and its backlog read alone, beside them. A\n * kind read whole is counted in memory and read here, within the cap. Where the\n * view lays out the paged resource kind's resources (`pages.ts`), a kind placed\n * on it is read a cell at a time instead, around the rows the views say they\n * show. Either way the window's read takes a paged kind's events from the\n * reader's cells — never over the window.\n *\n * What the frame is told of a read on its way is the one rule every builder\n * reads its rows by (`../shared/view-read.ts`): a period stepped to holds none\n * of the last one's events; other choices of the same period leave the last\n * choices' standing in (`filtering`); and a read again of the view shown — a\n * Save, another session's write — leaves the frame live.\n *\n * @packageDocumentation\n */\nimport { useCallback, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from \"react\";\nimport { DateTimeType, SetType, SortedMap, SortedSet, StringType, compareFor, equalFor, none, some } from \"@elaraai/east\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { scheduleWithinCap, type ScheduleCellResources, type ScheduleCellSpan, type ScheduleCellsRead } from \"../shared/schedule/cells.js\";\nimport { viewOfPeriod } from \"../shared/view-read.js\";\nimport { EMPTY_SCHEDULE_DRAFTS, type ScheduleEditing, type ScheduleEventDraftsValue } from \"../shared/schedule/editing.js\";\nimport { useReadAhead } from \"../shared/schedule/use-read-ahead.js\";\nimport { calendarCellSpan, calendarCellsPaged, useCalendarCells, type CalendarBucket } from \"./cells.js\";\nimport { calendarAhead, chronological, resourceKey, type CalendarItem, type CalendarRange, type CalendarRow, type CalendarValue, type CalendarView } from \"./model.js\";\nimport type { CalendarPagedDemand, CalendarPagedView, CalendarPages } from \"./pages.js\";\nimport { calendarEventParts } from \"./window.js\";\n\n/** A window read: every kind's events over it. */\nexport interface CalendarData {\n    items: CalendarItem[]; loading: boolean; saved: Date | undefined;\n    /**\n     * The kinds past the cap over the window (#1424): none of their events is read or drawn but their drafts, so no\n     * figure the Calendar says counts them — it says they are not counted, never 0.\n     */\n    capped: ReadonlySet<string>;\n    /**\n     * What the shared reader read of the kinds as this read took it (#1424) — the resources' shading and the notices of\n     * the kinds past the cap — held with the events, so the frame hears of them as it hears of the window, whole;\n     * `undefined` before a read.\n     */\n    cells: ScheduleCellsRead | undefined;\n}\n/** No kind past the cap. */\nconst NONE_CAPPED: ReadonlySet<string> = new Set();\nconst EMPTY: CalendarData = { items: [], loading: true, saved: undefined, capped: NONE_CAPPED, cells: undefined };\nconst compareDate = compareFor(DateTimeType);\nconst compareString = compareFor(StringType);\n/** No drafts: a read-only Calendar's. */\nconst NO_DRAFTS: ScheduleEventDraftsValue = new SortedMap([], compareString);\n/** No kinds, by their slots: those a reader gives cells before it has read. */\nconst NO_SLOTS = new SortedSet<string>([], compareString);\n/** Whether two sets of kinds, by their slots, are the same kinds. */\nconst sameSlots = equalFor(SetType(StringType));\n\n/**\n * The backlog of every kind whose backlog follows no window, read apart from\n * the window: its last complete read, which stands while another is in flight.\n */\nexport interface CalendarApartBacklog {\n    /** Its rows, in the kinds' order: none before its first read lands. */\n    readonly items: readonly CalendarItem[];\n    /** Whether a read of it has completed. */\n    readonly ready: boolean;\n    /** Whether a read of it is in flight. */\n    readonly loading: boolean;\n    /** Why its latest read failed. */\n    readonly error: string | undefined;\n}\n\n/** What the frame shows of the window read: the last complete read, its range, and whether a newer one is in flight or failed. */\nexport interface CalendarDataState extends CalendarData {\n    /** The range the held read covers. */\n    range: CalendarRange;\n    /** Whether any read has completed. */\n    ready: boolean;\n    /**\n     * Whether what it holds stands in for other choices of the same period (`../shared/view-read.ts`): the last choices'\n     * events, retained until the new ones' land. A read again of the view shown is no filtering.\n     */\n    filtering: boolean;\n    /** Why the latest read failed. */\n    error: string | undefined;\n    /** The backlog of each kind that reads its backlog apart from the window. */\n    apart: CalendarApartBacklog;\n}\n\n/** The backlog apart, before its first read. */\nconst NO_APART: CalendarApartBacklog = { items: [], ready: false, loading: true, error: undefined };\n\n/**\n * The frame's data before its reader first reports: nothing held, a read in flight.\n *\n * @param range - The range the frame reads\n * @returns The state\n */\nexport function initialCalendarData(range: CalendarRange): CalendarDataState {\n    return { ...EMPTY, range, ready: false, filtering: false, error: undefined, apart: NO_APART };\n}\n\n/**\n * Test-only probe — lets \"a drop works out the periods either side no more\" be asserted as the reads ahead themselves\n * (#1594). `undefined` outside tests.\n */\nlet readAheadProbe: ((next: CalendarRange) => void) | undefined;\n/**\n * Install (or clear) the read-ahead probe. Test use only.\n *\n * @param fn - Called with a period each time it is read ahead; `undefined` clears it\n */\nexport function setCalendarReadAheadProbe(fn: ((next: CalendarRange) => void) | undefined): void {\n    readAheadProbe = fn;\n}\n\n/** The whole of time: what a kind whose backlog follows no window is asked its backlog over — it takes no notice of it. */\nconst EVER = { from: new Date(-8_640_000_000_000_000), to: new Date(8_640_000_000_000_000) };\n\n/** Why a read failed, in its own words: an Error's message, never its `Error: ` prefix. */\nfunction reasonOf(error: unknown): string {\n    return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * The kinds whose backlog is paged through their sources (#1424): each backlog kind narrowed through its source of the\n * slice (#1343) — read a page at a time by the Backlog tab, through the source with its start Unset (`backlog-pages.ts`).\n * Every other reads its backlog whole or through its backlog index, apart from the window.\n *\n * @param value - The payload\n * @returns Their slots\n */\nexport function windowedBacklogKinds(value: CalendarValue): ReadonlySet<string> {\n    return new Set(calendarEventParts(value).flatMap(({ kind }) => kind.backlog ? [kind.key] : []));\n}\n\n/**\n * The window's read and the backlog's apart from it (see the module docs), and once the window lands, what a step goes\n * to read ahead.\n *\n * @param value - The payload\n * @param range - The window shown\n * @param editing - The editing whose drafts the reads hold\n * @param view - The view: what a step from it goes to is read ahead\n * @param cells - What the shared reader read of the kinds (#1424, #1599): a kind it gives cells — its series index's, or\n *   its window's own rows; past the cap, none — is read from them; a kind read a window at a time it has given none yet\n *   waits on it; a kind read whole is counted over the window and read only within the cap\n * @returns What the frame shows\n */\nexport function useCalendarData(value: CalendarValue, range: CalendarRange, editing: ScheduleEditing | undefined, view: CalendarView,\n    cells: ScheduleCellsRead): CalendarDataState {\n    const drafts = editing?.drafts;\n    const windowed = useMemo(() => windowedBacklogKinds(value), [value]);\n    const read = useCallback((): CalendarData => {\n        const items: CalendarItem[] = [];\n        let loading = false;\n        let saved: Date | undefined;\n        const capped = new Set<string>();\n        for (const kind of value.events) {\n            // A kind the reader gives cells is read from them — past the cap, none: its drafts alone draw, where they place\n            // their events (#1424). Every kind's drafts are the reader's: a kind read by its cells, or over the window's\n            // rows alone, without those of events its narrowing does not hold.\n            const held = cells.reads.get(kind.key);\n            const changes = cells.drafts.get(kind.key) ?? EMPTY_SCHEDULE_DRAFTS;\n            const given = held === undefined ? none : some(held);\n            if (held === undefined) {\n                // A kind read a window at a time is the reader's to read (#1599): until it gives the kind cells, the\n                // window waits on it, and nothing reads the kind's window apart from it.\n                if (kind.entries.type === \"some\") { loading = true; continue; }\n                // A kind read whole is read here once its count over the window says it is within the cap: past it, the\n                // window waits on the reader, which gives it no cells.\n                const within = scheduleWithinCap(kind.count, range.from, range.to);\n                if (within.type !== \"some\" || !within.value) { loading = true; continue; }\n            } else if (cells.capped.has(kind.key)) {\n                capped.add(kind.key);\n            } else if (cells.windowed.has(kind.key) && !viewOfPeriod(cells.view)) {\n                // Its window's rows are another period's, the period's own on their way: none of them is this one's to draw.\n                loading = true;\n                continue;\n            }\n            const scheduled = kind.items(range.from, range.to, changes, given);\n            if (scheduled.type === \"some\") { for (const item of scheduled.value) items.push(item); } else loading = true;\n            const history = kind.history();\n            const latest = history.type === \"some\" ? history.value[0]?.at : undefined;\n            if (latest !== undefined && (saved === undefined || compareDate(latest, saved) > 0)) saved = latest;\n        }\n        return { items: chronological(items), loading, saved, capped: capped.size === 0 ? NONE_CAPPED : capped, cells };\n    }, [value.events, range.from, range.to, cells]);\n    const { result } = useTrackedEvaluation(read);\n    // The backlog apart from the window: asked over no window, so no date change asks it again.\n    const readApart = useCallback(() => {\n        const items: CalendarItem[] = [];\n        let loading = false;\n        for (const kind of value.events) {\n            if (!kind.backlog || windowed.has(kind.key)) continue;\n            const unscheduled = kind.unscheduled(EVER.from, EVER.to, drafts?.get(kind.key) ?? EMPTY_SCHEDULE_DRAFTS, none);\n            if (unscheduled.type === \"some\") { for (const item of unscheduled.value) items.push(item); } else loading = true;\n        }\n        return { items, loading };\n    }, [value.events, drafts, windowed]);\n    const { result: apartResult } = useTrackedEvaluation(readApart);\n    // Once the window has landed, what a step goes to is read ahead (CL7), each as it is read — in a read of its own, so a\n    // page of it landing runs the window's read no more.\n    const ahead = useMemo(() => calendarAhead(view, value.settings), [view, value.settings]);\n    // All a read ahead asks of the reader, which hands on a new read as a draft moves: the kinds it reads by their series\n    // index's cells — never over a window — the same object while they are the same kinds. A kind given its window's own\n    // rows is read ahead as any kind read over the window is: the same read, which a step to the period then finds held.\n    const givenCells = useRef(NO_SLOTS);\n    const nowGiven = new SortedSet([...cells.reads.keys()].filter(slot => !cells.windowed.has(slot)), compareString);\n    if (!sameSlots(givenCells.current, nowGiven)) givenCells.current = nowGiven;\n    const byCells = givenCells.current;\n    // Asked with no drafts: what it works out is never drawn, and they read nothing a step waits on (#1594).\n    const readNext = useCallback((next: CalendarRange) => {\n        readAheadProbe?.(next);\n        for (const kind of value.events) {\n            // A kind read by its series index's cells is never read over a window (#1424). Every other is counted there\n            // first, and read only within the cap.\n            if (byCells.has(kind.key)) continue;\n            kind.items(next.from, next.to, EMPTY_SCHEDULE_DRAFTS, none);\n        }\n    }, [value.events, byCells]);\n    useReadAhead(result.ok && !result.value.loading, ahead, readNext);\n    const held = useRef(EMPTY);\n    const heldRange = useRef(range);\n    // A pending or failed replacement is not a partial/empty result. Publish\n    // scheduled rows, backlog and their time geometry together when ready.\n    if (result.ok && !result.value.loading) { held.current = result.value; heldRange.current = range; }\n    const complete = held.current;\n    const completeRange = heldRange.current;\n    // A read on its way: the window's own, or the reader's of a windowed kind's rows, whatever stands in for them meanwhile.\n    const windowReading = cells.windowed.size > 0 && (cells.view === \"rereading\" || cells.view === \"filtering\");\n    const loading = result.ok && (result.value.loading || windowReading);\n    const filtering = cells.view === \"filtering\";\n    // Why the period could not be read: the window's own read, or the reader's of a kind's window. A read of the paged\n    // kind's blocks that failed is said where those rows are, never as the period's.\n    const error = result.ok ? (cells.error?.window === true ? cells.error.reason : undefined) : reasonOf(result.error);\n    const heldApart = useRef<readonly CalendarItem[] | undefined>(undefined);\n    if (apartResult.ok && !apartResult.value.loading) heldApart.current = apartResult.value.items;\n    const apartItems = heldApart.current;\n    const apartLoading = apartResult.ok && apartResult.value.loading;\n    const apartError = apartResult.ok ? undefined : reasonOf(apartResult.error);\n    const apart = useMemo((): CalendarApartBacklog => ({ items: apartItems ?? NO_APART.items, ready: apartItems !== undefined, loading: apartLoading, error: apartError }),\n        [apartItems, apartLoading, apartError]);\n    // The first read lands whole (CL5): until the window and the backlog apart have both landed — or one failed — the\n    // frame hears nothing of either.\n    const first = complete !== EMPTY && (apart.ready || apart.error !== undefined);\n    // Intermediate page arrivals advance the tracked read, but do not change\n    // the displayed window. Keep its identity until there is something to show.\n    return useMemo(() => first || error !== undefined\n        ? { ...complete, range: completeRange, ready: complete !== EMPTY, loading, filtering, error, apart }\n        : { ...EMPTY, range: completeRange, ready: false, loading: true, filtering: false, error: undefined, apart: NO_APART },\n    [first, complete, completeRange, loading, filtering, error, apart]);\n}\n\n/** Nothing to hear: no paged resource kind. */\nconst NOTHING = () => () => {};\n/** No places in view: no paged resource kind. */\nconst NO_VIEW = (): CalendarPagedView | undefined => undefined;\n\n/**\n * The window read, in a component of its own (#1343): each search that lands re-runs it alone, and it hands the frame\n * its data only when what the frame shows moves. A kind narrowed through an interval index lands some fifty-five\n * searches before its count is known, and each would otherwise re-render the whole frame. The kinds' counts, and past\n * the cap their shading and their notices, are read here too, by the shared reader (#1424) — and where the view lays out\n * the paged resource kind's resources, the cells of a kind placed on it, around the rows the views say they show, which\n * they report to a store this component alone hears: a scroll renders nothing of the frame.\n *\n * @param props - The payload, the range read, the editing whose drafts the read holds, the view (what a step from it goes\n *   to is read ahead once the window lands); the resource kinds the view lays out, each its rows the rail shows, and the\n *   periods a resource's shading is cut into — none in a view with no resource axis; what the frame holds of the paged\n *   resource kind and where the views report its places they show; and where the data goes\n * @returns Nothing: it reads\n */\nexport function CalendarDataReader({ value, range, editing, view, resources, bucket, pages, demand, onData }: {\n    value: CalendarValue; range: CalendarRange; editing: ScheduleEditing | undefined; view: CalendarView;\n    resources: readonly ScheduleCellResources[]; bucket: CalendarBucket | undefined;\n    pages: CalendarPages | undefined; demand: CalendarPagedDemand | undefined;\n    onData: (data: CalendarDataState) => void;\n}): null {\n    const parts = useMemo(() => calendarEventParts(value), [value]);\n    // The paged kind, where the view lays its resources out: a kind placed on it is read a cell at a time, around the\n    // rows the views say they show. A view that lays no resource out counts such a kind over the window, as any other.\n    const paged = useMemo(() => (value.paged.type === \"some\" && bucket !== undefined ? calendarCellsPaged(value.paged.value) : undefined), [value.paged, bucket]);\n    const places = useSyncExternalStore(demand?.subscribe ?? NOTHING, demand?.get ?? NO_VIEW, demand?.get ?? NO_VIEW);\n    const standing = useRef<ScheduleCellSpan | undefined>(undefined);\n    const span = calendarCellSpan(places, pages, standing.current);\n    standing.current = span;\n    // What a Save landed of a kind read by its cells draws as the Save left it until they are read again (the shared\n    // reader's `landed`): its confirmation reads the saved events by their keys, never the cells.\n    const cells = useCalendarCells({ kinds: value.events, parts, resources, range, bucket, drafts: editing?.drafts ?? NO_DRAFTS, paged, span: paged === undefined ? undefined : span,\n        editing });\n    const data = useCalendarData(value, range, editing, view, cells);\n    const reported = useRef<CalendarDataState | undefined>(undefined);\n    useLayoutEffect(() => {\n        const was = reported.current;\n        // The same held read over the same range, in the same state, and the same cells: nothing the frame shows has moved.\n        if (was !== undefined && Object.is(was.items, data.items) && Object.is(was.range, data.range)\n            && was.ready === data.ready && was.loading === data.loading && was.filtering === data.filtering && was.error === data.error && Object.is(was.apart, data.apart)\n            && Object.is(was.cells, data.cells)) return;\n        reported.current = data;\n        onData(data);\n    });\n    return null;\n}\n\n/** Named resource rows, preserving the author's declaration order. */\nexport function resourceRows(resources: CalendarValue[\"resources\"]): CalendarRow[] {\n    return resources.flatMap(kind => kind.rows.map(row => ({ key: resourceKey({ kind: kind.key, key: row.key }),\n        label: row.label, meta: row.meta.type === \"some\" ? row.meta.value : \"\", group: kind.name, icon: kind.icon,\n        resource: some({ kind: kind.key, key: row.key }),\n    })));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A Chooser of the paged resource kind's resources (#1424): the shared key\n * search over the kind's own resources, in their key order, through its own\n * paged read — its key search places a typed key, and its windows label the\n * matches the box lists — never every resource listed. The box names the\n * resource chosen; a pick sets it. Every resource Chooser of the Calendar's\n * that offers the paged kind draws it in a field's place (`FieldForm`'s\n * `renderControl`): the placement's resource, an event's reference field to\n * the kind, and the bulk edit's resource. The frame gives it the paged kind\n * through {@link CalendarChooserContext}, with the name of a resource a window\n * the frame holds has. The box names the resource the field holds by it, else\n * by the resource's own row, read by its key through the kind's own read\n * (`byKey`) — a narrowing of the kind's windows, which leaves out the\n * resources its choices hide, an event's own among them, never turns its name\n * into its key (retest C6) — and by its key only while that read is in flight.\n *\n * It leaves out what the kind's source of the slice hides, as the Calendar's\n * other Choosers leave out what the rail hides (ruled 27 Oct 2026): which of\n * each page it lists the source's choices hold is asked of e3 — one request a\n * page, the membership read the hidden pick reads (`recordSliceWithinAt`) —\n * and the rest are dropped, but the resource the field holds, an event's own,\n * which stays offered whatever the choices hide. A step onto a resource they\n * hide picks nothing. It searches the kind whole by key, as it always has, so\n * its count is the kind's.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useCallback, useContext, type ReactNode } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { StringType, equalFor, toEastTypeValue, type EastTypeValue, type ValueTypeOf } from \"@elaraai/east\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui\";\nimport type { DatasetKeyMatchRange, DatasetKeyQuery, RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { DatasetKeySearch, useSliceReactivity, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { awaitTracked, recordSliceWithinAt, toSeekQuery } from \"@elaraai/east-ui-components/internal\";\nimport type { CalendarPagedValue } from \"./pages.js\";\n\n/** A resource's key is a String: what the box parses a typed key as. */\nconst KEY_TYPE: EastTypeValue = toEastTypeValue(StringType);\n/** An empty box lists the first of the kind's resources. */\nconst BROWSE: DatasetKeyQuery = { prefix: \"\" };\nconst keyEqual = equalFor(StringType);\n\n/** The paged resource kind, as the Calendar's Choosers search it. */\nexport interface CalendarChooser {\n    /** The paged kind, as the payload carries it: its own key search and windows. */\n    readonly paged: CalendarPagedValue;\n    /** What the Calendar calls no resource (#1516). */\n    readonly unassigned: string;\n    /** Its name, as running text writes it: `presses`. */\n    readonly noun: string;\n    /** A resource's name by its key: its row's label once a window the frame holds has it; `undefined` while none does. */\n    readonly nameOf: (key: string) => string | undefined;\n    /**\n     * The kind's source of the slice, named after its slot: its Choosers leave out what its choices hide; `undefined`\n     * with none, every resource offered.\n     */\n    readonly part?: ValueTypeOf<RecordSliceBindType> | undefined;\n}\n\n/** The paged kind the Calendar's Choosers search; `undefined` with none paged. */\nexport const CalendarChooserContext = createContext<CalendarChooser | undefined>(undefined);\n\n/**\n * The Chooser of the paged kind's resources (see the module docs).\n *\n * @param props - The paged kind; the resource chosen, by its key — `undefined` for none; what a pick sets; and whether it takes none\n * @returns The key search, or the chosen resource's name, read only\n */\nexport function PagedChooser({ chooser, chosen, onPick, readOnly = false }: {\n    chooser: CalendarChooser; chosen: string | undefined; onPick: (key: string) => void; readOnly?: boolean;\n}): ReactNode {\n    const { paged, noun, nameOf, part } = chooser;\n    // The source's choices, followed as they move: the box lists its lines again by them.\n    const moved = useSliceReactivity(part?.key);\n    const find = useCallback(async (query: DatasetKeyQuery): Promise<DatasetKeyMatchRange> => {\n        if (paged.seek.type !== \"some\") return { found: false, row: 0, count: 0 };\n        const seek = paged.seek.value;\n        const at = await awaitTracked(() => seek(toSeekQuery(query)));\n        return { found: at.found, row: Number(at.row), count: Number(at.count) };\n    }, [paged]);\n    /**\n     * Which of the kind's own resources `[row, row + limit)`, in their key order — its source's record's own rows — the\n     * source's choices hold, asked of e3 over that page in one request; `undefined` while the source chooses nothing.\n     */\n    const heldAt = useCallback(async (row: number, limit: number): Promise<readonly boolean[] | undefined> => {\n        const where = part?.read().where;\n        if (part === undefined || where === undefined || where.size === 0) return undefined;\n        return awaitTracked(() => recordSliceWithinAt(part, where, BigInt(row), BigInt(limit)));\n    }, [part]);\n    /** Whether the Chooser offers a resource: one the source's choices hold, or the field's own. */\n    const offered = useCallback((key: string, held: boolean | undefined) => held !== false || (chosen !== undefined && keyEqual(key, chosen)), [chosen]);\n    const listRange = useCallback(async (row: number, limit: number) => {\n        const [rows, held] = await Promise.all([awaitTracked(() => paged.entries(BigInt(row), BigInt(limit))), heldAt(row, limit)]);\n        return rows.flatMap((r, i) => offered(r.key, held?.[i])\n            ? [{ row: row + i, label: r.meta.type === \"some\" ? `${r.label} · ${r.meta.value}` : r.label, text: r.label }] : []);\n    }, [paged, heldAt, offered]);\n    const jump = useCallback((row: number) => {\n        void Promise.all([awaitTracked(() => paged.entries(BigInt(row), 1n)), heldAt(row, 1)])\n            .then(([[picked], held]) => { if (picked !== undefined && offered(picked.key, held?.[0])) onPick(picked.key); })\n            .catch((error: unknown) => { console.error(\"[Calendar] the resource picked could not be read:\", error); });\n    }, [paged, heldAt, offered, onPick]);\n    // The resource the field holds, named by a window the frame holds, else by its own row read by its key (retest C6).\n    const held = chosen === undefined ? undefined : nameOf(chosen);\n    const readName = useCallback((): string | undefined => {\n        if (chosen === undefined || held !== undefined) return undefined;\n        const row = paged.byKey(chosen);\n        return row.type === \"some\" && row.value.type === \"some\" ? row.value.value.label : undefined;\n    }, [paged, chosen, held]);\n    const { result: read } = useTrackedEvaluation(readName);\n    const name = chosen === undefined ? chooser.unassigned : held ?? (read.ok ? read.value : undefined) ?? chosen;\n    if (readOnly) return <Box data-calendar-chooser=\"\" data-readonly=\"\">{name}</Box>;\n    return <Box data-calendar-chooser=\"\">\n        <DatasetKeySearch keyType={KEY_TYPE} label={name} onFind={find} onListRange={listRange} onJump={jump} browseQuery={BROWSE} relist={moved}\n            noMatchesText={`No ${noun} with that key. Search by a key's start.`} />\n    </Box>;\n}\n\n/**\n * The control a Calendar form draws for a field that chooses one of the paged\n * kind's resources: the Chooser over the kind's own resources.\n *\n * @param chooser - The paged kind, when one pages\n * @param spec - The field\n * @param chooses - Whether the field chooses one of the paged kind's resources\n * @param chosen - The resource it holds, by its key; `undefined` for none\n * @param onPick - What a pick sets, by the resource's key\n * @param readOnly - Whether the form takes no edit\n * @returns The Chooser; `undefined` for a field the form draws itself\n */\nexport function pagedControl(chooser: CalendarChooser | undefined, spec: FieldSpecValue, chooses: (spec: FieldSpecValue) => boolean,\n    chosen: string | undefined, onPick: (key: string) => void, readOnly: boolean): ReactNode | undefined {\n    if (chooser === undefined || !chooses(spec)) return undefined;\n    return <PagedChooser chooser={chooser} chosen={chosen} onPick={onPick} readOnly={readOnly} />;\n}\n\n/**\n * The Calendar's paged kind, for its Choosers.\n *\n * @returns The paged kind, when one pages\n */\nexport function useCalendarChooser(): CalendarChooser | undefined {\n    return useContext(CalendarChooserContext);\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n  function interval(date) {\n    return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n  }\n\n  interval.floor = (date) => {\n    return floori(date = new Date(+date)), date;\n  };\n\n  interval.ceil = (date) => {\n    return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n  };\n\n  interval.round = (date) => {\n    const d0 = interval(date), d1 = interval.ceil(date);\n    return date - d0 < d1 - date ? d0 : d1;\n  };\n\n  interval.offset = (date, step) => {\n    return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n  };\n\n  interval.range = (start, stop, step) => {\n    const range = [];\n    start = interval.ceil(start);\n    step = step == null ? 1 : Math.floor(step);\n    if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n    let previous;\n    do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n    while (previous < start && start < stop);\n    return range;\n  };\n\n  interval.filter = (test) => {\n    return timeInterval((date) => {\n      if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n    }, (date, step) => {\n      if (date >= date) {\n        if (step < 0) while (++step <= 0) {\n          while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n        } else while (--step >= 0) {\n          while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n        }\n      }\n    });\n  };\n\n  if (count) {\n    interval.count = (start, end) => {\n      t0.setTime(+start), t1.setTime(+end);\n      floori(t0), floori(t1);\n      return Math.floor(count(t0, t1));\n    };\n\n    interval.every = (step) => {\n      step = Math.floor(step);\n      return !isFinite(step) || !(step > 0) ? null\n          : !(step > 1) ? interval\n          : interval.filter(field\n              ? (d) => field(d) % step === 0\n              : (d) => interval.count(0, d) % step === 0);\n    };\n  }\n\n  return interval;\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n  date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n  date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n  return (end - start) / durationSecond;\n}, (date) => {\n  return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n  date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n  date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n  return (end - start) / durationMinute;\n}, (date) => {\n  return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n  date.setUTCSeconds(0, 0);\n}, (date, step) => {\n  date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n  return (end - start) / durationMinute;\n}, (date) => {\n  return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n  date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n  date.setTime(+date + step * durationHour);\n}, (start, end) => {\n  return (end - start) / durationHour;\n}, (date) => {\n  return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n  date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n  date.setTime(+date + step * durationHour);\n}, (start, end) => {\n  return (end - start) / durationHour;\n}, (date) => {\n  return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n  date => date.setHours(0, 0, 0, 0),\n  (date, step) => date.setDate(date.getDate() + step),\n  (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n  date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n  date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n  date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n  return (end - start) / durationDay;\n}, (date) => {\n  return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n  date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n  date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n  return (end - start) / durationDay;\n}, (date) => {\n  return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n  return timeInterval((date) => {\n    date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n    date.setHours(0, 0, 0, 0);\n  }, (date, step) => {\n    date.setDate(date.getDate() + step * 7);\n  }, (start, end) => {\n    return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n  });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n  return timeInterval((date) => {\n    date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n    date.setUTCHours(0, 0, 0, 0);\n  }, (date, step) => {\n    date.setUTCDate(date.getUTCDate() + step * 7);\n  }, (start, end) => {\n    return (end - start) / durationWeek;\n  });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n  date.setDate(1);\n  date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n  date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n  return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n  return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n  date.setUTCDate(1);\n  date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n  date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n  return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n  return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n  date.setMonth(0, 1);\n  date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n  date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n  return end.getFullYear() - start.getFullYear();\n}, (date) => {\n  return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n  return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n    date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n    date.setMonth(0, 1);\n    date.setHours(0, 0, 0, 0);\n  }, (date, step) => {\n    date.setFullYear(date.getFullYear() + step * k);\n  });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n  date.setUTCMonth(0, 1);\n  date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n  date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n  return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n  return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n  return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n    date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n    date.setUTCMonth(0, 1);\n    date.setUTCHours(0, 0, 0, 0);\n  }, (date, step) => {\n    date.setUTCFullYear(date.getUTCFullYear() + step * k);\n  });\n};\n\nexport const utcYears = utcYear.range;\n","export default function ascending(a, b) {\n  return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n  return a == null || b == null ? NaN\n    : b < a ? -1\n    : b > a ? 1\n    : b >= a ? 0\n    : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n  let compare1, compare2, delta;\n\n  // If an accessor is specified, promote it to a comparator. In this case we\n  // can test whether the search value is (self-) comparable. We can’t do this\n  // for a comparator (except for specific, known comparators) because we can’t\n  // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n  // used to test whether a single value is comparable.\n  if (f.length !== 2) {\n    compare1 = ascending;\n    compare2 = (d, x) => ascending(f(d), x);\n    delta = (d, x) => f(d) - x;\n  } else {\n    compare1 = f === ascending || f === descending ? f : zero;\n    compare2 = f;\n    delta = f;\n  }\n\n  function left(a, x, lo = 0, hi = a.length) {\n    if (lo < hi) {\n      if (compare1(x, x) !== 0) return hi;\n      do {\n        const mid = (lo + hi) >>> 1;\n        if (compare2(a[mid], x) < 0) lo = mid + 1;\n        else hi = mid;\n      } while (lo < hi);\n    }\n    return lo;\n  }\n\n  function right(a, x, lo = 0, hi = a.length) {\n    if (lo < hi) {\n      if (compare1(x, x) !== 0) return hi;\n      do {\n        const mid = (lo + hi) >>> 1;\n        if (compare2(a[mid], x) <= 0) lo = mid + 1;\n        else hi = mid;\n      } while (lo < hi);\n    }\n    return lo;\n  }\n\n  function center(a, x, lo = 0, hi = a.length) {\n    const i = left(a, x, lo, hi - 1);\n    return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n  }\n\n  return {left, center, right};\n}\n\nfunction zero() {\n  return 0;\n}\n","export default function number(x) {\n  return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n  if (valueof === undefined) {\n    for (let value of values) {\n      if (value != null && (value = +value) >= value) {\n        yield value;\n      }\n    }\n  } else {\n    let index = -1;\n    for (let value of values) {\n      if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n        yield value;\n      }\n    }\n  }\n}\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","const e10 = Math.sqrt(50),\n    e5 = Math.sqrt(10),\n    e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n  const step = (stop - start) / Math.max(0, count),\n      power = Math.floor(Math.log10(step)),\n      error = step / Math.pow(10, power),\n      factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n  let i1, i2, inc;\n  if (power < 0) {\n    inc = Math.pow(10, -power) / factor;\n    i1 = Math.round(start * inc);\n    i2 = Math.round(stop * inc);\n    if (i1 / inc < start) ++i1;\n    if (i2 / inc > stop) --i2;\n    inc = -inc;\n  } else {\n    inc = Math.pow(10, power) * factor;\n    i1 = Math.round(start / inc);\n    i2 = Math.round(stop / inc);\n    if (i1 * inc < start) ++i1;\n    if (i2 * inc > stop) --i2;\n  }\n  if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n  return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n  stop = +stop, start = +start, count = +count;\n  if (!(count > 0)) return [];\n  if (start === stop) return [start];\n  const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n  if (!(i2 >= i1)) return [];\n  const n = i2 - i1 + 1, ticks = new Array(n);\n  if (reverse) {\n    if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n    else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n  } else {\n    if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n    else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n  }\n  return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n  stop = +stop, start = +start, count = +count;\n  return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n  stop = +stop, start = +start, count = +count;\n  const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n  return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The scale a canvas positions by (#1148): Plan's canvas and the Calendar's\n * views share it. It is pure arithmetic, with no DOM: a window cut into whole\n * periods, its buckets and their ruler labels, an instant's place in it as a\n * window fraction, snapping, and the steps a move takes.\n *\n * A scale is built over a numeric DOMAIN ({@link ScaleDomain}): epoch ms for\n * time, a value, or a list's index. One engine ({@link bucketScale}) serves\n * every axis a canvas has. {@link timeScale} builds a time scale over `Date`s,\n * the Calendar's, and Plan builds its time, number and ordinal axes over its\n * own instant values, with {@link timeDomain} as its time arm.\n *\n * Every row positions against the one scale. Span bars position\n * **continuously** (`fracOf` on real instants), and what is quantised to a\n * bucket (heat, tables, cards, a calendar's columns) by the **bucket**\n * (`bucketOf`). Both truths coexist on the one scale, so a 12-week window at\n * WEEK resolution is exactly 12 columns, and sibling rows line up to the\n * pixel.\n *\n * An instant of another kind than the domain's positions nowhere (`NaN`,\n * `-1`, `undefined`). On a domain whose interval END names its last bucket\n * (`endInclusive`: Plan's ordinal axis) `endFracOf` is the far edge of the\n * named bucket; on the others intervals stay half-open and `endFracOf` is\n * `fracOf`.\n *\n * Time is **UTC** (#326): East DateTime values are UTC instants, so a window\n * derives the same columns under any viewer's timezone. Weeks are **ISO\n * weeks**, Monday-start (the `W27` ruler), so the week interval is\n * `utcMonday`, not d3's Sunday-based `utcWeek`.\n *\n * @packageDocumentation\n */\n\nimport { utcDay, utcHour, utcMonday, utcMonth, utcYear, type TimeInterval } from \"d3-time\";\nimport { formatters, type Formatters } from \"@elaraai/east-ui-components\";\nimport { dateTimeSlot, formatDatePattern } from \"@elaraai/east-ui-components/internal\";\n\nimport { shiftCalendar, type TimeResolution } from \"./calendar-math.js\";\nexport { addMonthsClamped, shiftCalendar, type TimeResolution } from \"./calendar-math.js\";\n\n/** A half-open time window `[min, max)`. */\nexport interface TimeWindow {\n    /** Inclusive start instant. */\n    min: Date;\n    /** Exclusive end instant. */\n    max: Date;\n}\n\nconst HOUR_MS = 3_600_000;\nconst DAY_MS = 86_400_000;\n\n/**\n * The most buckets a scale cuts. Every bucket is a ruler tick and a grid\n * column, so an absurd window at a fine resolution truncates rather than\n * locking the tab. The scale says so (`Scale.truncated`), and a canvas shows\n * it: a silently truncated axis reads as data that stops (#811).\n */\nexport const MAX_BUCKETS = 500;\n\n/**\n * Whole periods a scale lays out beyond each window edge (#619): the slide a\n * pan can travel before its revealed edge runs out of content. Marks there\n * are clipped at rest, so they cost DOM but no pixels. A list (Plan's ordinal\n * axis) has nothing beyond it, and lays out none.\n */\nexport const OVERSCAN_BUCKETS = 2;\n\n/**\n * The finer unit a move takes under Shift on a time scale, in ms, per\n * resolution (#825): fifteen minutes under an hour, an hour under a day, and a\n * day under a week, a month, a quarter or a year.\n */\nexport const FINE_MS: Readonly<Record<TimeResolution, number>> = {\n    hour: 15 * 60_000,\n    day: HOUR_MS,\n    week: DAY_MS,\n    month: DAY_MS,\n    quarter: DAY_MS,\n    year: DAY_MS,\n};\n\n/**\n * The d3-time UTC interval for a resolution: a quarter is three months, and a\n * week the ISO week, Monday-start.\n *\n * @param res - The resolution\n * @returns Its interval\n */\nexport function resolutionInterval(res: TimeResolution): TimeInterval {\n    switch (res) {\n        case \"hour\": return utcHour;\n        case \"day\": return utcDay;\n        case \"week\": return utcMonday;\n        case \"month\": return utcMonth;\n        case \"quarter\": return utcMonth.every(3) ?? utcMonth;\n        case \"year\": return utcYear;\n    }\n}\n\n/**\n * The ISO-8601 week number of a UTC instant.\n *\n * @param d - The instant\n * @returns Its week, 1–53\n */\nexport function isoWeekUTC(d: Date): number {\n    const t = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));\n    const day = t.getUTCDay() || 7;                    // Mon = 1 … Sun = 7\n    t.setUTCDate(t.getUTCDate() + 4 - day);            // shift to the ISO week's Thursday\n    const yearStart = Date.UTC(t.getUTCFullYear(), 0, 1);\n    return Math.ceil(((t.getTime() - yearStart) / DAY_MS + 1) / 7);\n}\n\n/** The quarter (1–4) a UTC instant falls in. */\nfunction quarterOf(d: Date): number {\n    return Math.floor(d.getUTCMonth() / 3) + 1;\n}\n\n/**\n * What a time scale says itself (#820): its ruler's week and quarter ticks,\n * and a week or a quarter read out. Each is a function of named parameters,\n * already formatted for the locale, so a translation puts them where its\n * grammar wants them. A canvas's own message table extends it.\n */\nexport interface TimeMessages {\n    /** A week tick: `W27`. */\n    rulerWeek: (p: { week: string }) => string;\n    /** A quarter tick: `Q3`. */\n    rulerQuarter: (p: { quarter: string }) => string;\n    /** A week as words: `Week of Jun 29, 2026`. */\n    periodWeek: (p: { date: string }) => string;\n    /** A quarter as words: `Q3 2026`. */\n    periodQuarter: (p: { quarter: string; year: string }) => string;\n}\n\n/** The time scale's English messages: the default table. */\nexport const timeMessages: TimeMessages = {\n    rulerWeek: ({ week }) => `W${week}`,\n    rulerQuarter: ({ quarter }) => `Q${quarter}`,\n    periodWeek: ({ date }) => `Week of ${date}`,\n    periodQuarter: ({ quarter, year }) => `Q${quarter} ${year}`,\n};\n\n/**\n * The words a time scale speaks: its messages, and its locale's formatters\n * (the shared format module's, #850), so a ruler prints dates exactly as\n * every other component in the app does. Dates are UTC: the words for a\n * bucket never depend on the viewer's timezone.\n */\nexport interface TimeWords extends Formatters {\n    /** The message table in effect. */\n    m: TimeMessages;\n}\n\n/**\n * Build a time scale's words for a locale and a message table.\n *\n * @param locale - The BCP 47 locale\n * @param m - The message table ({@link timeMessages} when omitted)\n * @returns The words\n */\nexport function timeWords(locale: string, m: TimeMessages = timeMessages): TimeWords {\n    return { ...formatters(locale), m };\n}\n\n/** The words a time scale speaks when it is given none: English, in `en-US`. */\nexport const TIME_WORDS: TimeWords = timeWords(\"en-US\");\n\n/**\n * The default ruler label of the period starting at a UTC instant, in the\n * scale's locale (#820): week ⇒ the ISO week (`W27`), day ⇒ the uppercase\n * short weekday (`MON`), hour ⇒ the 24-hour `HH:mm`, month ⇒ the uppercase\n * short month (`JUN`), quarter ⇒ `Q3`, year ⇒ the year. The week and quarter\n * prefixes are messages; the rest is the locale's own names and digits.\n *\n * @param start - The period's start (UTC)\n * @param res - The resolution\n * @param w - The scale's words\n * @returns The label\n */\nexport function defaultTickLabel(start: Date, res: TimeResolution, w: TimeWords = TIME_WORDS): string {\n    switch (res) {\n        case \"week\": return w.m.rulerWeek({ week: w.number(isoWeekUTC(start)) });\n        case \"day\": return w.weekday(start).toLocaleUpperCase(w.locale);\n        case \"hour\": return w.time(start);\n        case \"month\": return w.month(start).toLocaleUpperCase(w.locale);\n        case \"quarter\": return w.m.rulerQuarter({ quarter: w.number(quarterOf(start)) });\n        case \"year\": return w.year(start);\n    }\n}\n\n/** A UTC instant as words: the date, and the time when there is one. */\nfunction dateText(d: Date, withTime: boolean, w: TimeWords): string {\n    const time = withTime || d.getUTCHours() !== 0 || d.getUTCMinutes() !== 0;\n    return time ? w.dateTime(d) : w.date(d);\n}\n\n/**\n * The period starting at a UTC instant as words, at a resolution: what a\n * reader hears where the ruler only has a tick (#819), in the scale's locale\n * (#820).\n *\n * @param start - The period's start (UTC)\n * @param res - The resolution\n * @param w - The scale's words\n * @returns `Week of Jun 29, 2026`, `Mon, Jun 29, 2026`, `June 2026`, `Q3 2026`, …\n */\nexport function periodText(start: Date, res: TimeResolution, w: TimeWords = TIME_WORDS): string {\n    switch (res) {\n        case \"hour\": return w.dateTime(start);\n        case \"day\": return w.weekdayDate(start);\n        case \"week\": return w.m.periodWeek({ date: w.date(start) });\n        case \"month\": return w.monthYear(start);\n        case \"quarter\": return w.m.periodQuarter({ quarter: w.number(quarterOf(start)), year: w.year(start) });\n        case \"year\": return w.year(start);\n    }\n}\n\n/** One bucket of a scale. */\nexport interface ScaleBucket<I> {\n    /** Bucket index (0-based). */\n    index: number;\n    /** Bucket start instant (period-aligned: the window widens to whole periods, #949). */\n    start: I;\n    /** Bucket end instant (exclusive). On a domain whose end names its last\n     *  bucket (`endInclusive`) the bucket IS its value, so `end` names the same\n     *  value as `start`. */\n    end: I;\n    /** Left edge as a window fraction (0–1). */\n    x0: number;\n    /** Right edge as a window fraction (0–1). */\n    x1: number;\n    /** The ruler tick label. */\n    label: string;\n}\n\n/**\n * The period a scale cuts by, as a fold reads it (#824): ONE object per key,\n * shared by every scale with the same resolution or step, so what depends on\n * it re-derives when the resolution changes and not when the window pans.\n */\nexport interface ScalePeriod<I> {\n    /** Names the period: two periods with one key floor every instant alike. */\n    readonly key: string;\n    /** The start of the period holding an instant; the instant itself when it is of another kind than the domain's. */\n    floor(t: I): I;\n}\n\n/**\n * An axis's numeric domain: what {@link bucketScale} cuts into periods, and\n * how an instant of its kind reads as a number on it.\n *\n * @typeParam I - The instant the scale positions\n * @typeParam K - The axis's kind\n */\nexport interface ScaleDomain<I, K extends string> {\n    /** The axis's kind: every instant must be of it. */\n    kind: K;\n    /** Names the period: what `floor` depends on, and nothing else (never the window). */\n    periodKey: string;\n    /** The window's start, as a domain number, before it widens to whole periods. */\n    minN: number;\n    /** The window's exclusive end, as a domain number, before it widens to whole periods. */\n    maxN: number;\n    /** Period-align a domain number downward. */\n    floor(n: number): number;\n    /** Shift a domain number by `k` whole periods. */\n    offset(n: number, k: number): number;\n    /**\n     * A move's step (#825): a domain number `k` units on. A time domain steps\n     * by the calendar (a month on from the 31st is a shorter month's last\n     * day), or by its finer unit under Shift (`fine`); a domain whose bucket is\n     * its step steps as `offset` does.\n     */\n    shift(n: number, k: number, fine: boolean): number;\n    /** The finer unit a move takes under Shift, in domain numbers; `undefined` where a bucket is the step. */\n    fineUnit: number | undefined;\n    /** An instant as a domain number: `NaN` for one of another kind, or unknown. */\n    toN(t: I): number;\n    /** The instant at a domain number. */\n    fromN(n: number): I;\n    /** The drag grammar's slot key for an instant of this domain (`CellRefType.slot`), as its kind spells it. */\n    slot(t: I): string;\n    /** The ruler label of the period starting at a domain number. */\n    label(n: number): string;\n    /** A domain number as words: an accessible name's instant (#819). */\n    text(n: number): string;\n    /** The period starting at a domain number, as words (#819). */\n    periodText(n: number): string;\n    /** Whole periods laid out beyond each window edge. */\n    overscan: number;\n    /** Whether an interval END names its last bucket (inclusive), rather than an edge. */\n    endInclusive: boolean;\n    /** Whether there is nothing beyond the window: a list, where a move stops at its ends. */\n    bounded: boolean;\n    /** The period's floor where it is not the domain's own: a list's period is the identity, whatever the list. */\n    periodFloor?: ((t: I) => I) | undefined;\n    /** The concrete resolution: a time domain's only. */\n    resolution: TimeResolution | undefined;\n    /** The now instant, as a domain number. */\n    now: number | undefined;\n}\n\n/**\n * The one scale a canvas positions against: its window, its buckets, and the\n * continuous and quantised mappings. Every function takes an instant of the\n * domain's kind; one of another kind positions nowhere.\n *\n * @typeParam I - The instant it positions\n * @typeParam K - The axis's kind\n */\nexport interface Scale<I, K extends string> {\n    /** The axis's kind: every instant must be of it. */\n    kind: K;\n    /** The window `[min, max)` as instants, widened to whole periods (#949). On\n     *  a domain whose end names its last bucket, `max` names its last value. */\n    window: { min: I; max: I };\n    /** The concrete bucket resolution: a time scale's only. */\n    resolution: TimeResolution | undefined;\n    /** Bucket count (`n = window ÷ period`: whole periods, #949). */\n    n: number;\n    /**\n     * Set when the window holds more periods than {@link MAX_BUCKETS}: the grid\n     * covers only the first `shown` buckets of it. A canvas says so (\"showing\n     * the first 500 buckets — zoom in\", #811).\n     */\n    truncated: { shown: number } | undefined;\n    /** The buckets, in order. */\n    buckets: ReadonlyArray<ScaleBucket<I>>;\n    /** Continuous position: the window fraction of an instant, clamped to [0, 1]. */\n    xOf(t: I): number;\n    /** Continuous position, unclamped: negative before the window, over 1 past it (runoff detection). */\n    fracOf(t: I): number;\n    /**\n     * The fraction an interval END lands at: `fracOf(t)` on a half-open\n     * domain; on one whose end names its last bucket, that bucket's far edge.\n     */\n    endFracOf(t: I): number;\n    /** The bucket index containing an instant, or −1 outside the window. */\n    bucketOf(t: I): number;\n    /**\n     * The bucket index at a window FRACTION (pointer x ÷ plot width), or −1\n     * when the fraction lands in no bucket.\n     *\n     * The one fraction → bucket resolver: the cursor readout, the drop\n     * coordinate and the landing preview all read it (#617). Buckets are\n     * half-open, which would make the covered range's exact right edge\n     * unreachable, so a pointer there closes into the last bucket. On a\n     * truncated scale the uncovered remainder is NO bucket (#618): fractions\n     * past the last bucket's end answer −1, exactly as `bucketOf` does.\n     */\n    bucketAtFrac(frac: number): number;\n    /** Snap an instant to the nearest bucket edge. */\n    snap(t: I): I;\n    /** Period-align an instant downward: the period containing it. */\n    floor(t: I): I;\n    /** The period this scale buckets by, as a fold reads it (#824): see {@link ScalePeriod}. */\n    period: ScalePeriod<I>;\n    /** Shift an instant by `k` whole periods: pans, zooms, the one-period floor. */\n    offset(t: I, k: number): I;\n    /**\n     * Move an instant `k` units, as a move does (#825): by the calendar on a\n     * time scale, or by its finer unit under Shift (`fine`); by the step\n     * elsewhere. An instant of another kind stays where it is.\n     */\n    shift(t: I, k: number, fine: boolean): I;\n    /** The finer unit a move takes under Shift, in domain numbers; `undefined` where a bucket is the step. */\n    fineUnit: number | undefined;\n    /** Whether an interval END names its last bucket (inclusive), rather than an edge. */\n    endInclusive: boolean;\n    /** Whether there is nothing beyond the window: a list, where a move stops at its ends. */\n    bounded: boolean;\n    /** The drag grammar's slot key for an instant of the scale's kind (`CellRefType.slot`). */\n    slotOf(t: I): string;\n    /** An instant as a number on the scale's own domain (`NaN` for one of another kind). */\n    toNumber(t: I): number;\n    /** The inverse of {@link toNumber}: the instant at a domain number. */\n    fromNumber(n: number): I;\n    /** The now instant's window fraction, when inside the window. */\n    nowFrac: number | undefined;\n    /**\n     * The RENDER-cull bounds, in window fractions (#619): the window plus\n     * {@link OVERSCAN_BUCKETS} whole periods each side (the right side\n     * extends from the COVERED edge on a truncated scale). Marks anchored to\n     * the window cull against these instead of `[0, 1]`, so a pan reveals real\n     * content; the ruler, the grid, `bucketOf` and every drop coordinate stay\n     * on the window's buckets.\n     */\n    renderMin: number;\n    /** The far RENDER-cull bound: see {@link renderMin}. */\n    renderMax: number;\n    /**\n     * The bucket containing an instant across the window and its overscan:\n     * RENDER geometry only (interactions use {@link bucketOf}); `undefined`\n     * outside the render bounds. Overscan buckets carry indices outside the\n     * window's (negative on the left, `n` and up on the right) and fractions\n     * outside `[0, 1]`.\n     */\n    renderBucketOf(t: I): ScaleBucket<I> | undefined;\n    /**\n     * An instant as words, as an accessible name says it (#819): a full UTC\n     * date on a time scale, in its locale (`Jun 29, 2026` in `en-US`, with\n     * the time when the instant has one or the scale runs at hour\n     * resolution). `\"\"` for an instant of another kind.\n     */\n    instantText(t: I): string;\n    /**\n     * A bucket as words (#819): the period it covers, where the ruler label\n     * is only a tick (`W27`, `MON`): `Week of Jun 29, 2026`, `Mon, Jun 29,\n     * 2026`, `July 2026`, `Q3 2026` in `en-US`.\n     */\n    bucketText(b: ScaleBucket<I>): string;\n}\n\n/**\n * The bucket a window fraction falls in, clamped into the buckets the scale\n * covers: before the window, its first bucket; past its covered end, its last.\n * Where a drag that must land somewhere lands.\n *\n * @param scale - The scale\n * @param frac - The window fraction (one that is not finite reads as the window's start)\n * @returns The bucket's index\n */\nexport function clampedBucketAt<I, K extends string>(scale: Scale<I, K>, frac: number): number {\n    const last = scale.buckets.length - 1;\n    const covered = scale.buckets[last]!.x1;\n    const f = Math.max(0, Math.min(covered, Number.isFinite(frac) ? frac : 0));\n    const i = scale.bucketAtFrac(f);\n    return i >= 0 ? i : f <= 0 ? 0 : last;\n}\n\n/** The period named `key` in `periods`: the one already handed out, else `floor` under that name. */\nfunction periodOf<I>(periods: Map<string, ScalePeriod<I>>, key: string, floor: (t: I) => I): ScalePeriod<I> {\n    let period = periods.get(key);\n    if (period === undefined) {\n        period = { key, floor };\n        periods.set(key, period);\n    }\n    return period;\n}\n\n/**\n * Cut a domain's window into a scale.\n *\n * The window widens OUTWARD to whole periods (#949): its start floors to the\n * period containing it, and its end rises to the next period edge, so every\n * column is a whole period. A 12-week window at MONTH resolution draws whole\n * months (June to September), never a two-day June sliver beside two thirds\n * of September. An aligned window is unchanged: a 12-week window at WEEK\n * resolution is exactly 12 equal columns.\n *\n * @param dom - The domain, with its window\n * @param periods - The periods the caller has handed out, by key: one map per\n *   instant type, so every scale over that type with the same period shares\n *   its {@link ScalePeriod}\n * @returns The scale, or `undefined` for an empty or inverted window\n */\nexport function bucketScale<I, K extends string>(dom: ScaleDomain<I, K>, periods: Map<string, ScalePeriod<I>>): Scale<I, K> | undefined {\n    if (!Number.isFinite(dom.minN) || !Number.isFinite(dom.maxN) || dom.maxN <= dom.minN) return undefined;\n    // Whole periods: floor the start, and lift an end that falls inside a\n    // period to that period's end. \"Inside\" is judged with a hair of\n    // tolerance, so a float step's edge (0.30000000000000004 for 3 × 0.1) is\n    // an edge, not a period's first sliver; and an end within it IS that\n    // edge: a window closed one float short of 9 ends at 9, so a pan from it\n    // never carries the shortfall along.\n    const aligned = (a: number, b: number) => Math.abs(a - b) <= 1e-9 * Math.max(1, Math.abs(b));\n    const minN = dom.floor(dom.minN);\n    const maxFloor = dom.floor(dom.maxN);\n    const maxN = aligned(maxFloor, dom.maxN) ? maxFloor : dom.offset(maxFloor, 1);\n    const span = maxN - minN;\n\n    const toN = dom.toN;\n    const endN = (t: I): number => {\n        const n = toN(t);\n        return dom.endInclusive && Number.isFinite(n) ? dom.offset(n, 1) : n;\n    };\n    const fracOfN = (n: number): number => (n - minN) / span;\n    const fracOf = (t: I): number => fracOfN(toN(t));\n    const endFracOf = (t: I): number => fracOfN(endN(t));\n    const xOf = (t: I): number => {\n        const f = fracOf(t);\n        return Number.isNaN(f) ? NaN : Math.max(0, Math.min(1, f));\n    };\n\n    // Period starts intersecting [min, max): floor(min), then step while < max.\n    // Each start is `base + k periods` from the aligned base, never an\n    // accumulated sum, so a fractional step cannot drift.\n    const base = dom.floor(minN);\n    const buckets: ScaleBucket<I>[] = [];\n    const startsN: number[] = [];\n    let truncated = false;\n    for (let k = 0; ; k++) {\n        const start = dom.offset(base, k);\n        if (start >= maxN || aligned(start, maxN)) break;\n        if (buckets.length >= MAX_BUCKETS) { truncated = true; break; }\n        const end = dom.offset(base, k + 1);\n        const clippedStart = Math.max(start, minN);\n        const clippedEnd = Math.min(end, maxN);\n        startsN.push(clippedStart);\n        buckets.push({\n            index: buckets.length,\n            start: dom.fromN(clippedStart),\n            end: dom.endInclusive ? dom.fromN(clippedStart) : dom.fromN(clippedEnd),\n            x0: fracOfN(clippedStart),\n            x1: fracOfN(clippedEnd),\n            label: dom.label(start),\n        });\n    }\n    if (buckets.length === 0) return undefined;\n\n    // The number PAST which no bucket exists. Equal to `max` except on a\n    // truncated scale, where the buckets cover less than the window: an\n    // instant between the last bucket's end and `max` is in NO bucket, and\n    // answering the last index for it would quietly pile every cell beyond\n    // the truncation into the final grid column (#618). Continuous marks still\n    // span the whole window: truncation narrows the GRID, not the axis.\n    const coveredEndN = minN + buckets[buckets.length - 1]!.x1 * span;\n    const bucketOf = (t: I): number => {\n        const n = toN(t);\n        if (!Number.isFinite(n) || n < minN || n >= coveredEndN) return -1;\n        // Buckets are contiguous and ordered: binary search the start edges.\n        let lo = 0, hi = buckets.length - 1;\n        while (lo < hi) {\n            const mid = (lo + hi + 1) >> 1;\n            if (startsN[mid]! <= n) lo = mid;\n            else hi = mid - 1;\n        }\n        return lo;\n    };\n\n    // The covered range's right edge as a fraction: 1 except on a truncated\n    // scale, where the grid ends before the window does.\n    const coveredX1 = buckets[buckets.length - 1]!.x1;\n    const bucketAtFrac = (frac: number): number => {\n        if (!Number.isFinite(frac) || frac < 0 || frac > coveredX1) return -1;\n        if (frac >= buckets[buckets.length - 1]!.x0) return buckets.length - 1;\n        // Buckets are contiguous and ordered: binary search the left edges.\n        let lo = 0, hi = buckets.length - 1;\n        while (lo < hi) {\n            const mid = (lo + hi + 1) >> 1;\n            if (buckets[mid]!.x0 <= frac) lo = mid;\n            else hi = mid - 1;\n        }\n        return lo;\n    };\n\n    const snap = (t: I): I => {\n        const n = toN(t);\n        if (!Number.isFinite(n)) return t;\n        const below = dom.floor(n);\n        const above = dom.offset(below, 1);\n        return dom.fromN(n - below <= above - n ? below : above);\n    };\n    const floor = (t: I): I => {\n        const n = toN(t);\n        return Number.isFinite(n) ? dom.fromN(dom.floor(n)) : t;\n    };\n    // The fold's period (#824), keyed by what `floor` depends on, so the first\n    // scale at a resolution lends its `floor` to every later one.\n    const period = periodOf(periods, dom.periodKey, dom.periodFloor ?? floor);\n    const offset = (t: I, k: number): I => {\n        const n = toN(t);\n        return Number.isFinite(n) ? dom.fromN(dom.offset(n, k)) : t;\n    };\n    const shift = (t: I, k: number, fine: boolean): I => {\n        const n = toN(t);\n        return k !== 0 && Number.isFinite(n) ? dom.fromN(dom.shift(n, k, fine)) : t;\n    };\n\n    // ── Overscan (#619) ── whole periods beyond each edge, geometry only:\n    // indices outside the window's, fractions outside [0, 1], never in\n    // `buckets`, never consulted by the ruler, the grid, `bucketOf` or a drop\n    // coordinate. The right run starts at the COVERED edge (the last bucket's\n    // end, the truncation boundary on a truncated scale, #618) and re-aligns\n    // to period edges if that edge is mid-period (a clipped window max).\n    const overscan: { n0: number; n1: number; bucket: ScaleBucket<I> }[] = [];\n    for (let k = dom.overscan; k >= 1; k--) {\n        const start = dom.offset(base, -k);\n        const end = dom.offset(start, 1);\n        overscan.push({ n0: start, n1: end, bucket: {\n            index: -k, start: dom.fromN(start), end: dom.fromN(end),\n            x0: fracOfN(start), x1: fracOfN(end), label: dom.label(start),\n        } });\n    }\n    let overscanStart = coveredEndN;\n    for (let k = 0; k < dom.overscan; k++) {\n        const atEdge = dom.floor(overscanStart) === overscanStart;\n        const end = atEdge\n            ? dom.offset(overscanStart, 1)\n            : dom.offset(dom.floor(overscanStart), 1);\n        overscan.push({ n0: overscanStart, n1: end, bucket: {\n            index: buckets.length + k, start: dom.fromN(overscanStart), end: dom.fromN(end),\n            x0: fracOfN(overscanStart), x1: fracOfN(end), label: dom.label(overscanStart),\n        } });\n        overscanStart = end;\n    }\n    const renderMin = overscan.length > 0 ? overscan[0]!.bucket.x0 : 0;\n    const renderMax = overscan.length > 0 ? overscan[overscan.length - 1]!.bucket.x1 : coveredX1;\n    const renderBucketOf = (t: I): ScaleBucket<I> | undefined => {\n        const i = bucketOf(t);\n        if (i >= 0) return buckets[i];\n        const n = toN(t);\n        if (!Number.isFinite(n)) return undefined;\n        return overscan.find((o) => n >= o.n0 && n < o.n1)?.bucket;\n    };\n\n    const nowFrac = dom.now !== undefined && Number.isFinite(dom.now) && dom.now >= minN && dom.now < maxN\n        ? fracOfN(dom.now)\n        : undefined;\n\n    const instantText = (t: I): string => {\n        const n = toN(t);\n        return Number.isFinite(n) ? dom.text(n) : \"\";\n    };\n    const bucketText = (b: ScaleBucket<I>): string => {\n        const n = toN(b.start);\n        return Number.isFinite(n) ? dom.periodText(n) : b.label;\n    };\n\n    return {\n        kind: dom.kind,\n        window: { min: dom.fromN(minN), max: dom.fromN(maxN) },\n        resolution: dom.resolution,\n        n: buckets.length, buckets,\n        truncated: truncated ? { shown: buckets.length } : undefined,\n        xOf, fracOf, endFracOf, bucketOf, bucketAtFrac, snap, floor, period, offset, shift,\n        fineUnit: dom.fineUnit, endInclusive: dom.endInclusive, bounded: dom.bounded, slotOf: dom.slot,\n        toNumber: toN, fromNumber: dom.fromN,\n        nowFrac, renderMin, renderMax, renderBucketOf,\n        instantText, bucketText,\n    };\n}\n\n/** What a time scale is built from. */\nexport interface TimeScaleSpec {\n    /** The window the scale covers; it widens outward to whole periods. */\n    window: TimeWindow;\n    /** The period the window is cut into. */\n    resolution: TimeResolution;\n    /** The instant the now line marks, when inside the window. */\n    now?: Date | undefined;\n    /** A date-token pattern for the ruler's labels (East's date tokens), the author's own; the locale's ruler vocabulary otherwise. */\n    format?: string | undefined;\n    /** The words its ruler and its accessible names speak ({@link TIME_WORDS} when omitted). */\n    words?: TimeWords | undefined;\n}\n\n/**\n * A time window's domain: epoch ms, cut into the resolution's periods, over\n * any instant type. `wrap` makes an instant of a `Date`, and `toMs` reads one\n * back (`NaN` for an instant of another kind, which then positions nowhere).\n * Its slot key is the instant as East prints a DateTime, through the drag\n * layer's shared codec.\n *\n * @param spec - The window, the resolution and the words\n * @param wrap - An instant at a `Date`\n * @param toMs - An instant's epoch ms, or `NaN`\n * @returns The domain\n */\nexport function timeDomain<I>(spec: TimeScaleSpec, wrap: (d: Date) => I, toMs: (t: I) => number): ScaleDomain<I, \"time\"> {\n    const res = spec.resolution;\n    const interval = resolutionInterval(res);\n    const format = spec.format;\n    const w = spec.words ?? TIME_WORDS;\n    return {\n        kind: \"time\",\n        periodKey: `time:${res}`,\n        minN: spec.window.min.getTime(),\n        maxN: spec.window.max.getTime(),\n        floor: (n) => interval.floor(new Date(n)).getTime(),\n        offset: (n, k) => interval.offset(new Date(n), k).getTime(),\n        shift: (n, k, fine) => (fine ? n + k * FINE_MS[res] : shiftCalendar(new Date(n), res, k).getTime()),\n        fineUnit: FINE_MS[res],\n        toN: toMs,\n        fromN: (n) => wrap(new Date(n)),\n        slot: (t) => dateTimeSlot.encode(new Date(toMs(t))),\n        // An author's own pattern is the author's (East's date tokens); the\n        // default ruler speaks the scale's locale.\n        label: (n) => (format !== undefined\n            ? formatDatePattern(format, new Date(n))\n            : defaultTickLabel(new Date(n), res, w)),\n        text: (n) => dateText(new Date(n), res === \"hour\", w),\n        periodText: (n) => periodText(new Date(n), res, w),\n        overscan: OVERSCAN_BUCKETS,\n        endInclusive: false,\n        bounded: false,\n        resolution: res,\n        now: spec.now?.getTime(),\n    };\n}\n\n/** The periods time scales over `Date`s have handed out, by key. */\nconst DATE_PERIODS = new Map<string, ScalePeriod<Date>>();\n\n/**\n * A time scale over `Date`s: a window cut into a resolution's whole periods.\n *\n * @param spec - The window, the resolution and the words\n * @returns The scale, or `undefined` for an empty or inverted window\n */\nexport function timeScale(spec: TimeScaleSpec): Scale<Date, \"time\"> | undefined {\n    return bucketScale(timeDomain(spec, (d) => d, (d) => d.getTime()), DATE_PERIODS);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Where an element lands when it is moved, resized or drawn on a scale (#825,\n * #1148). This is pure arithmetic, shared by the pointer, the keyboard and the\n * tests of every canvas whose elements move along an axis: Plan's canvas, and\n * the Calendar's views.\n *\n * An element moves by whole UNITS: the buckets the pointer crossed since the\n * press (the bucket it is over, less the bucket it was grabbed in), or under\n * Shift one finer unit, the scale's `fineUnit` (a day under a week, month,\n * quarter or year; an hour under a day; fifteen minutes under an hour). A\n * scale whose bucket is its step has no finer unit, so Shift changes nothing\n * there. Both ends shift by the same amount, so an element keeps its place in\n * its bucket and its length: by the calendar on a time scale (a month on from\n * the 31st lands on a shorter month's last day), by the step on a number axis,\n * and by position on a list, where the whole element stays inside the list.\n *\n * A resize moves one end, never past the other: an element keeps at least one\n * unit (where an end names the last bucket it covers, one bucket). An element\n * drawn across empty time takes the units from the press to the pointer, at\n * least one.\n *\n * The rest of a drag is the drag layer's (east-ui-components, #608), which\n * every canvas rides: the 4px before it starts, Escape, the ghost and its\n * caption, and the target's refusal, asked where the drag rests and again of\n * the drop.\n *\n * @packageDocumentation\n */\n\nimport { clampedBucketAt, type Scale } from \"./scale.js\";\n\n/** An element's extent: a span's two ends, or a point element's instant twice. */\nexport interface Span<I> {\n    readonly start: I;\n    readonly end: I;\n}\n\n/** What a gesture moves: the whole element, or one of its ends. */\nexport type MoveMode = \"move\" | \"start\" | \"end\";\n\n/**\n * Whether the scale has a unit finer than its bucket: a time scale does, and a\n * scale whose bucket is its step does not.\n *\n * @param scale - The scale\n * @returns Whether Shift moves by a finer unit\n */\nexport function hasFineUnit<I, K extends string>(scale: Scale<I, K>): boolean {\n    return scale.fineUnit !== undefined;\n}\n\n/** A time scale's domain number (epoch ms) at a window fraction. */\nfunction domainAt<I, K extends string>(scale: Scale<I, K>, frac: number): number {\n    const min = scale.toNumber(scale.window.min);\n    const max = scale.toNumber(scale.window.max);\n    return min + frac * (max - min);\n}\n\n/**\n * How many units lie between the press and the pointer: whole buckets, or the\n * scale's finer units under Shift.\n *\n * @param scale - The scale\n * @param grabFrac - Where the element was pressed, as a window fraction\n * @param frac - Where the pointer is now\n * @param fine - Whether Shift is held\n * @returns The signed count of units\n */\nexport function unitsBetween<I, K extends string>(scale: Scale<I, K>, grabFrac: number, frac: number, fine: boolean): number {\n    const unit = scale.fineUnit;\n    if (fine && unit !== undefined) {\n        return Math.floor(domainAt(scale, frac) / unit) - Math.floor(domainAt(scale, grabFrac) / unit);\n    }\n    return clampedBucketAt(scale, frac) - clampedBucketAt(scale, grabFrac);\n}\n\n/**\n * An element moved `k` units, both ends shifted alike. On a list the move\n * stops where the element's first or last end meets the list's edge.\n *\n * @param scale - The scale\n * @param span - The element's extent\n * @param k - The signed number of units\n * @param fine - Whether the unit is Shift's finer one\n * @returns The extent it lands at\n */\nexport function moveSpan<I, K extends string>(scale: Scale<I, K>, span: Span<I>, k: number, fine: boolean): Span<I> {\n    let units = k;\n    if (scale.bounded) {\n        const s = scale.toNumber(span.start);\n        const e = scale.toNumber(span.end);\n        if (!Number.isFinite(s) || !Number.isFinite(e)) return span;\n        units = Math.max(-Math.min(s, e), Math.min(scale.buckets.length - 1 - Math.max(s, e), units));\n    }\n    return { start: scale.shift(span.start, units, fine), end: scale.shift(span.end, units, fine) };\n}\n\n/**\n * An element resized: one end moved `k` units, never past the other, so it\n * keeps at least one unit (where an end names its last bucket, one bucket) —\n * or, an element shorter than one, its own length: a resize never lengthens it\n * while it shrinks it, nor moves an end against its step.\n *\n * @param scale - The scale\n * @param span - The element's extent\n * @param edge - The end that moves\n * @param k - The signed number of units\n * @param fine - Whether the unit is Shift's finer one\n * @returns The extent it takes\n */\nexport function resizeSpan<I, K extends string>(scale: Scale<I, K>, span: Span<I>, edge: \"start\" | \"end\", k: number, fine: boolean): Span<I> {\n    const order = (t: I) => scale.toNumber(t);\n    // An end that names its last bucket makes one bucket start = end.\n    const unit = scale.endInclusive ? 0 : 1;\n    if (edge === \"end\") {\n        const moved = moveSpan(scale, { start: span.end, end: span.end }, k, fine).end;\n        const unitOn = scale.shift(span.start, unit, fine);\n        const least = order(span.end) < order(unitOn) ? span.end : unitOn;\n        return { start: span.start, end: order(moved) < order(least) ? least : moved };\n    }\n    const moved = moveSpan(scale, { start: span.start, end: span.start }, k, fine).start;\n    const unitBefore = scale.shift(span.end, -unit, fine);\n    const most = order(span.start) > order(unitBefore) ? span.start : unitBefore;\n    return { start: order(moved) > order(most) ? most : moved, end: span.end };\n}\n\n/**\n * Where a pointer gesture lands: the element moved, or one of its ends, by the\n * units between the press and the pointer.\n *\n * @param scale - The scale\n * @param span - The element's extent when it was pressed\n * @param mode - What the gesture moves\n * @param grabFrac - Where it was pressed, as a window fraction\n * @param frac - Where the pointer is now\n * @param fine - Whether Shift is held\n * @returns The proposed extent\n */\nexport function proposeAt<I, K extends string>(\n    scale: Scale<I, K>, span: Span<I>, mode: MoveMode, grabFrac: number, frac: number, fine: boolean,\n): Span<I> {\n    const k = unitsBetween(scale, grabFrac, frac, fine);\n    return mode === \"move\" ? moveSpan(scale, span, k, fine) : resizeSpan(scale, span, mode, k, fine);\n}\n\n/** A keyboard carry's steps since its element was picked up, a bucket each: of the whole element, and of each end. */\nexport interface CarrySteps {\n    /** The whole element's. */\n    readonly move: number;\n    /** Its start's. */\n    readonly start: number;\n    /** Its end's. */\n    readonly end: number;\n}\n\n/** No steps yet. */\nexport const NO_STEPS: CarrySteps = { move: 0, start: 0, end: 0 };\n\n/**\n * Where a keyboard carry's steps land, counted from the element as it was\n * picked up: moved by its whole steps, then each end by its own. Steps taken\n * back land it where it began.\n *\n * @param scale - The scale\n * @param span - The element's extent as it was picked up\n * @param steps - The steps since\n * @returns The proposed extent\n */\nexport function stepSpan<I, K extends string>(scale: Scale<I, K>, span: Span<I>, steps: CarrySteps): Span<I> {\n    const moved = moveSpan(scale, span, steps.move, false);\n    return resizeSpan(scale, resizeSpan(scale, moved, \"end\", steps.end, false), \"start\", steps.start, false);\n}\n\n/**\n * The extent a drag across empty time draws: from the unit under the press to\n * the unit under the pointer, both whole, whichever way the drag went, and at\n * least one unit. A unit is a bucket, or the scale's finer unit under Shift\n * (`fine`): a calendar's time grid, its buckets hours, draws in quarter hours.\n * Either end stays inside the units the scale covers.\n *\n * @param scale - The scale\n * @param pressFrac - Where the drag was pressed, as a window fraction\n * @param frac - Where the pointer is now\n * @param fine - Whether to draw in the finer unit\n * @returns The extent the drag draws\n */\nexport function drawSpan<I, K extends string>(scale: Scale<I, K>, pressFrac: number, frac: number, fine: boolean): Span<I> {\n    const unit = scale.fineUnit;\n    if (fine && unit !== undefined) {\n        // The units the scale covers: from its window's start to its last\n        // bucket's end, both on unit edges (a bucket edge always is one).\n        const first = Math.ceil(scale.toNumber(scale.window.min) / unit);\n        const last = Math.floor(scale.toNumber(scale.buckets[scale.buckets.length - 1]!.end) / unit) - 1;\n        const unitAt = (f: number) => Math.max(first, Math.min(last, Math.floor(domainAt(scale, f) / unit)));\n        const a = unitAt(pressFrac);\n        const b = unitAt(frac);\n        return { start: scale.fromNumber(Math.min(a, b) * unit), end: scale.fromNumber((Math.max(a, b) + 1) * unit) };\n    }\n    const a = clampedBucketAt(scale, pressFrac);\n    const b = clampedBucketAt(scale, frac);\n    return { start: scale.buckets[Math.min(a, b)]!.start, end: scale.buckets[Math.max(a, b)]!.end };\n}\n\n/**\n * An extent as window fractions, clamped to the window: where a landing band\n * or a ghost draws it.\n *\n * @param scale - The scale\n * @param span - The extent\n * @returns Its left and right edges, 0–1\n */\nexport function spanFracs<I, K extends string>(scale: Scale<I, K>, span: Span<I>): { left: number; right: number } {\n    const left = Math.max(0, Math.min(1, scale.fracOf(span.start)));\n    const right = Math.max(left, Math.min(1, scale.endFracOf(span.end)));\n    return { left, right };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** The shared Library payload used by Schedule builder panes. */\nimport { none, some } from \"@elaraai/east\";\nimport type { LibraryItemValue, LibraryValue } from \"@elaraai/east-ui-components\";\n\n/** A Schedule card with its standard face and no unrelated media/facets. */\nexport function scheduleLibraryCard(fields: Pick<LibraryItemValue, \"key\" | \"label\" | \"sublabel\" | \"icon\" | \"status\" | \"trailing\" | \"draggable\" | \"filtered\" | \"placed\" | \"search\" | \"groups\">): LibraryItemValue {\n    return { ...fields, media: none, avatar: none, byline: none, action: none, facets: new Map(), dims: new Map() };\n}\n/** A pane's Library: filling its pane with shared search, grouping and cards. */\nexport function scheduleLibrary(fields: Pick<LibraryValue, \"id\" | \"items\" | \"groupOptions\" | \"noun\" | \"onCardClick\">, virtualize = false): LibraryValue {\n    return {\n        ...fields, hint: none, groupSummaries: new Map(), dimOptions: [], defaultDimensions: [], filterOptions: [], searchable: true,\n        addLabel: none, onAdd: none, slice: none,\n        style: some({ height: some(\"fill\"), maxHeight: none, virtualization: some(virtualize), columns: none, mediaPlacement: none, mediaSize: none }),\n        variant: none, layout: none, toolbar: true,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Shared forms for the explicit actions and the inspector's schedule section. */\nimport { useCallback, useMemo, useState } from \"react\";\nimport { Box, Button } from \"@chakra-ui/react\";\nimport { DateTimeType, OptionType, StringType, StructType, none, some, type ValueTypeOf } from \"@elaraai/east\";\nimport { Fields, type FieldSpecValue } from \"@elaraai/east-ui\";\nimport { FieldForm, SliceEditPopover, fieldFormMessages, useFormatters, type FieldFormWords } from \"@elaraai/east-ui-components\";\nimport { initialPlacement, type CalendarCommands, type CalendarPlacement, type CalendarSource } from \"./actions.js\";\nimport { lowerWord } from \"../shared/schedule/words.js\";\nimport { pagedControl, useCalendarChooser } from \"./chooser.js\";\nimport { parseResourceKey, resourceChoices, resourceKey, type CalendarItem, type CalendarStyles, type CalendarValue } from \"./model.js\";\n\n/** Each resource kind's rows the rail shows (#1343): what a resource Chooser offers. */\nexport type CalendarShownResources = CalendarValue[\"resources\"];\n\nconst PlacementFormType = StructType({ start: DateTimeType, end: DateTimeType, resource: OptionType(StringType) });\ntype PlacementForm = ValueTypeOf<typeof PlacementFormType>;\nconst SPECS = Fields.specs(PlacementFormType, { resource: Fields.reference({ of: \"resources\" }) }).map(spec => ({ ...spec, label: spec.path[0] === \"start\" ? \"Start (UTC)\" : spec.path[0] === \"end\" ? \"End (UTC)\" : spec.label }));\n\nfunction formOf(at: CalendarPlacement): PlacementForm {\n    return { start: at.start, end: at.end, resource: at.resource.type === \"some\" ? some(resourceKey(at.resource.value)) : none };\n}\nfunction placementOf(form: PlacementForm): CalendarPlacement | undefined {\n    if (form.resource.type === \"none\") return { ...form, resource: none };\n    const parsed = parseResourceKey(form.resource.value);\n    return parsed.success ? { ...form, resource: some(parsed.value) } : undefined;\n}\n/**\n * The words a Calendar's forms say in the app's own (#1516): a reference field's choice of none in its word for no\n * resource — `Nobody` where the app says so — as its rows and its Choosers say it.\n *\n * @param value - The Calendar\n * @returns The forms' words\n */\nexport function useCalendarFieldWords(value: CalendarValue): FieldFormWords {\n    const format = useFormatters();\n    const unassigned = value.vocabulary.unassigned;\n    return useMemo(() => ({ ...format, m: { ...fieldFormMessages, unassigned: () => unassigned } }), [format, unassigned]);\n}\n/** Whether a placement form's field is its resource. */\nconst isResource = (spec: FieldSpecValue) => spec.path[0] === \"resource\";\n\n/**\n * The placement form is one shared FieldForm in both the inspector and popovers. Its resource Chooser offers the\n * rows the rail shows, and the placement's own resource whatever the rail hides (#1343) — or, for a kind placed on the\n * paged resource kind, searches that kind by key (#1424, `chooser.tsx`). A placement the event refuses (`onChange`\n * saying why) goes back to the one it holds, the reason under the field changed.\n */\nexport function PlacementFields({ source, value, shown, placement, onChange, readOnly = false }: {\n    source: CalendarSource; value: CalendarValue; shown: CalendarShownResources; placement: CalendarPlacement; onChange: (at: CalendarPlacement) => string | void; readOnly?: boolean;\n}) {\n    const form = formOf(placement);\n    const own = placement.resource;\n    // Its resource in the app's word for one (#1516; review of #1481, finding 5): `Station`, as the layout calls them `Stations`.\n    const resourceWord = value.vocabulary.resources.one;\n    const specs = useMemo(() => SPECS.map(spec => (isResource(spec) ? { ...spec, label: resourceWord } : spec)), [resourceWord]);\n    const words = useCalendarFieldWords(value);\n    const options = useMemo(() => ({ resources: resourceChoices(value.resources, shown, own.type === \"some\" ? [own.value] : [])\n        .filter(kind => source.kind.takes.includes(kind.key)).flatMap(kind => kind.rows.map(row => ({ key: resourceKey({ kind: kind.key, key: row.key }), label: `${row.label} · ${kind.name}` }))) }),\n    [value.resources, shown, own, source.kind.takes]);\n    // A kind placed on the paged resource kind chooses its resource by key, through the kind's own paged read (#1424).\n    const chooser = useCalendarChooser();\n    const paged = chooser !== undefined && source.kind.takes.includes(chooser.paged.kind) ? chooser : undefined;\n    const chosen = own.type === \"some\" && paged !== undefined && own.value.kind === paged.paged.kind ? own.value.key : undefined;\n    // A resource picked is the field's own edit, so one the event refuses is said under it.\n    const renderControl = useCallback((spec: FieldSpecValue, change: (next: unknown) => void) => pagedControl(paged, spec, isResource, chosen, key => {\n        if (paged !== undefined) change(resourceKey({ kind: paged.paged.kind, key }));\n    }, readOnly), [paged, chosen, readOnly]);\n    return <FieldForm specs={specs} words={words} readOnly={readOnly} value={form} options={options} renderControl={paged === undefined ? undefined : renderControl} onChange={(path, next) => {\n        let changed = { ...form, [path[0]!]: next };\n        if (path[0] === \"start\" && next instanceof Date) changed = { ...changed, end: new Date(next.getTime() + form.end.getTime() - form.start.getTime()) };\n        if (path[0] === \"end\" && next instanceof Date && next <= changed.start) changed = { ...changed, end: new Date(next.getTime() + 86_400_000) };\n        const at = placementOf(changed);\n        return at === undefined ? undefined : onChange(at);\n    }} />;\n}\n/** An anchored action uses the same Schedule command as a desktop drop. */\nexport function PlacementAction({ label, source, value, shown, day, commands, styles, held = false }: {\n    label: string; source: CalendarSource; value: CalendarValue; shown: CalendarShownResources; day: Date; commands: CalendarCommands; styles: CalendarStyles;\n    /** Its card is retained — its tab's source read again (#1398, CL8): off until it lands. */\n    held?: boolean;\n}) {\n    const [open, setOpen] = useState(false);\n    const [placement, setPlacement] = useState(() => initialPlacement(source, day));\n    const [error, setError] = useState<string>();\n    const changeOpen = (next: boolean) => {\n        if (next) { setPlacement(initialPlacement(source, day)); setError(undefined); }\n        setOpen(next);\n    };\n    return <SliceEditPopover open={open} onOpenChange={changeOpen} label={`${label} · ${\"template\" in source ? source.template.name : source.item.title}`}\n        trigger={<Button size=\"xs\" variant=\"outline\" data-calendar-action={label.toLowerCase()} disabled={held || !commands.editing.available(source.kind.key)}>{label}</Button>}\n        footActions={<><Button size=\"xs\" variant=\"outline\" onClick={() => changeOpen(false)}>Cancel</Button><Button size=\"xs\" variant=\"outline\" onClick={() => {\n            const refused = commands.place(source, placement, label === \"Resize\" ? \"resize\" : \"typed\");\n            setError(refused); if (refused === undefined) setOpen(false);\n        }}>{label}</Button></>}>\n        <PlacementFields source={source} value={value} shown={shown} placement={placement} onChange={setPlacement} />\n        {error !== undefined && <Box role=\"alert\" css={styles.error}>{error}</Box>}\n    </SliceEditPopover>;\n}\n/** Mutations are explicit and visible in cards and in the inspector. */\nexport function EventActions({ item, value, shown, commands, day, styles }: {\n    item: CalendarItem; value: CalendarValue; shown: CalendarShownResources; commands: CalendarCommands; day: Date; styles: CalendarStyles;\n}) {\n    const kind = value.events.find(kind => kind.key === item.kind)!;\n    const [error, setError] = useState<string>();\n    return <>\n        <Box css={styles.actions} data-calendar-event-actions=\"\">\n            <PlacementAction label={item.start.type === \"none\" ? \"Schedule\" : \"Move\"} source={{ kind, item }} value={value} shown={shown} day={day} commands={commands} styles={styles} />\n            {item.start.type === \"some\" && <PlacementAction label=\"Resize\" source={{ kind, item }} value={value} shown={shown} day={day} commands={commands} styles={styles} />}\n            <Button size=\"xs\" variant=\"outline\" data-calendar-action=\"duplicate\" disabled={!commands.editing.available(kind.key)} onClick={() => setError(commands.duplicate([item]))}>Duplicate</Button>\n            <Button size=\"xs\" variant=\"outline\" data-calendar-action=\"delete\" disabled={!commands.editing.available(kind.key)} onClick={() => commands.remove([item])}>Delete</Button>\n            {kind.backlog && item.start.type === \"some\" && <Button size=\"xs\" variant=\"outline\" data-calendar-action=\"unschedule\" disabled={!commands.editing.available(kind.key)} onClick={() => setError(commands.unschedule([item]))}>Return to {lowerWord(value.vocabulary.backlog)}</Button>}\n        </Box>\n        {error !== undefined && <Box role=\"alert\" css={styles.error}>{error}</Box>}\n    </>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Calendar's optional library uses the same Library cards as Plan. Each tab\n * follows its source of the slice (#1343): the Templates tab each templates\n * list's, by template key; the Backlog its kinds' own narrowing; an app's tab\n * the source it names, by its rows' keys — each counting what it shows and\n * saying so, with Clear filters, when the rail leaves it none.\n *\n * A Backlog with a kind narrowed through its source of the slice is a page at\n * a time (#1424, `backlog-pages.ts`): the shared paged Library over its events\n * in hand and each such kind's through its source with its start Unset — its\n * choices but its window, so no step of the dates reads it again, and it never\n * blinks — counted by the index, `N of M` while a choice narrows it, \"…\" until\n * its count is first read (CL13), never a count of what has landed. A new\n * narrowing keeps its cards and its count standing, retained, until its own\n * land, and swaps them together. It has no search of its own, as the\n * Schematic's paged Backlog has none: the rail's choices narrow it (ruled 27\n * Oct 2026). Every other\n * Backlog is its kinds' events in hand, read apart once (#1398): only before\n * its first read, under the cold load's cover, does it count \"…\" and draw the\n * Library's pending rows, never \"No backlog events\" before its read (CL13).\n *\n * A backlog card names its event's resource as the views do\n * (`resourceLabel`): its row's label — a paged resource kind's once a window\n * the frame holds has it (#1424) — else its key.\n */\nimport { useState } from \"react\";\nimport { Box, Button } from \"@chakra-ui/react\";\nimport { none, some } from \"@elaraai/east\";\nimport { EastChakraLibrary, useFormatters, type BuilderFrameDock, type LibraryEmpty, type LibraryItemValue, type LibraryNarrowing } from \"@elaraai/east-ui-components\";\nimport { PagedLibrary, narrowedCount, type CountWords } from \"@elaraai/east-ui-components/internal\";\nimport type { BacklogPageCount, CalendarBacklogPages } from \"./backlog-pages.js\";\nimport { scheduleLibrary, scheduleLibraryCard } from \"../shared/schedule/library.js\";\nimport { dueGroupOf, durationMinutes } from \"../shared/schedule/due.js\";\nimport type { FollowedSources } from \"../shared/schedule/follow-sources.js\";\nimport { sourceTab, sourcesTab, type SourceShown, type SourceTab } from \"../shared/schedule/source-tab.js\";\nimport { lowerWord } from \"../shared/schedule/words.js\";\nimport { PlacementAction, type CalendarShownResources } from \"./controls.js\";\nimport type { CalendarCommands, CalendarSource } from \"./actions.js\";\nimport type { BacklogNarrowing } from \"../shared/schedule/backlog.js\";\nimport type { CalendarEventPart } from \"./window.js\";\nimport { eventKey, resourceLabel, type CalendarItem, type CalendarKind, type CalendarRow, type CalendarStyles, type CalendarTemplate, type CalendarValue } from \"./model.js\";\n\n/** Library ids also name the shared drag grammar's sources. */\nexport function calendarLibraryId(key: string, tab: string): string { return `${key}.library.${tab}`; }\n/** The kind and source record key identify a template. */\nexport function templateSources(value: CalendarValue): Map<string, CalendarSource> {\n    return new Map(value.events.flatMap(kind => kind.templates.map(template => [eventKey({ kind: kind.key, key: template.key }), { kind, template }] as const)));\n}\n\n/** One template's card: its id, and the template it is. */\ninterface TemplateEntry { id: string; kind: CalendarKind; template: CalendarTemplate }\n\n/** The Templates tab, and the templates it shows by their card's id: what a drop or a drawn event is made from. */\nexport interface CalendarTemplatesTab extends SourceTab<TemplateEntry> {\n    shown: ReadonlyMap<string, CalendarSource>;\n}\n\n/**\n * The Templates tab (#1343): every kind's templates, each following the source\n * its templates list names by its record key.\n *\n * @param value - The payload\n * @param followed - The sources the Calendar follows\n * @param words - The app's number formatter\n * @returns The tab, and the templates it shows\n */\nexport function templatesTab(value: CalendarValue, followed: FollowedSources, words: CountWords): CalendarTemplatesTab {\n    const entries = value.events.flatMap(kind => kind.templates.map((template): TemplateEntry => ({ id: eventKey({ kind: kind.key, key: template.key }), kind, template })));\n    const sourceOf = (kind: CalendarKind): SourceShown | undefined => kind.templatesSource.type === \"some\" ? followed.get(kind.templatesSource.value)?.shown : undefined;\n    const sources = [...new Set(value.events.flatMap(kind => { const shown = sourceOf(kind); return shown === undefined ? [] : [shown]; }))];\n    const tab = sourcesTab({ cards: entries, keyOf: entry => entry.template.key, sources, sourceOf: entry => sourceOf(entry.kind), noun: lowerWord(value.vocabulary.templates), words });\n    return { ...tab, shown: new Map(tab.cards.map(entry => [entry.id, { kind: entry.kind, template: entry.template }] as const)) };\n}\n\ninterface LibraryArgs {\n    value: CalendarValue; selection: readonly CalendarItem[]; key: string;\n    /** The backlog events read for what is shown: every kind's, or — while the rest are read — the kinds' read already. */\n    backlog: readonly CalendarItem[];\n    /** Whether all of the backlog is read for what is shown: until it is, the tab counts \"…\" and draws pending rows after `backlog`'s cards. */\n    backlogRead: boolean;\n    /** Whether `backlog` stands in for a read in flight (#1398): its pane busy and its cards retained, aria-disabled (CL8). */\n    backlogRetained: boolean;\n    /**\n     * The Backlog a page at a time (#1424, `backlog-pages.ts`), when a backlog kind is narrowed through its source of the\n     * slice: `backlog` its events in hand, the kinds' a page at a time after them; `undefined`, every kind's in hand.\n     */\n    backlogPages?: CalendarBacklogPages | undefined;\n    /** What the paged Backlog counts, once read: until then its tab says \"…\" (CL13). */\n    backlogCount?: BacklogPageCount | undefined;\n    narrow: boolean; now: Date; day: Date; styles: CalendarStyles; commands: CalendarCommands | undefined;\n    activeTemplate: string | undefined; onTemplate: (key: string) => void;\n    /** The Templates tab, as the sources narrow it. */\n    templates: CalendarTemplatesTab;\n    /** What the rail hides of the backlog. */\n    backlogNarrowing: BacklogNarrowing<CalendarEventPart>;\n    /** The sources the Calendar follows: an app's tab reads the one it names. */\n    followed: FollowedSources;\n    /** Each resource kind's rows the rail shows: what a placement's Chooser offers. */\n    shown: CalendarShownResources;\n    /** Whether a run of the optimiser moved an event into or out of the backlog (#1409): the Backlog tab's count flashes as it lands. */\n    backlogFlash?: boolean | undefined;\n    /** Whether a run of the optimiser is out (#1409, R2): no card drags, and the pane's actions are held, while the pane stays live. */\n    locked?: boolean | undefined;\n    /**\n     * Every resource row the frame holds — each kind's, a paged kind's of the windows held (#1424), and the unassigned\n     * one: what a backlog card names its event's resource by, as the views do.\n     */\n    rows: readonly CalendarRow[];\n}\n/**\n * What a tab is, as its pane takes it: its cards, its count (none while it is read), what it says empty, and whether its\n * cards are read at all. A pane its source reads again is busy and its cards retained (#1398, CL8): aria-disabled, its\n * foot's actions off.\n */\ninterface TabFacts {\n    cards: readonly LibraryItemValue[]; count: string | number | undefined; empty: LibraryEmpty | undefined; narrowing: LibraryNarrowing | undefined;\n    pane: { \"aria-busy\"?: true; \"aria-disabled\"?: true }; pending?: boolean;\n}\n/** The author-listed tabs, populated from the current bound reads. */\nexport function useCalendarLibrary(args: LibraryArgs): BuilderFrameDock | undefined {\n    const { value, backlog, backlogRead, backlogRetained, backlogPages, backlogCount, key, narrow, day, now, styles, commands, selection, activeTemplate, onTemplate, templates,\n        backlogNarrowing, followed, shown, rows } = args;\n    const locked = args.locked === true;\n    const format = useFormatters();\n    const [chosen, setChosen] = useState<Record<string, string>>({});\n    if (value.library.length === 0) return undefined;\n    const { vocabulary } = value;\n    const backlogWord = lowerWord(vocabulary.backlog);\n    const draggable = commands !== undefined && !narrow && !locked;\n    const baseCard = (id: string, label: string, meta: string, icon: string | undefined, group: string, placed: boolean): LibraryItemValue => scheduleLibraryCard({\n        key: id, label, sublabel: some(meta), icon: icon === undefined ? none : some(icon), status: none, trailing: none,\n        draggable, filtered: false, placed, search: some(`${label} ${meta}`), groups: new Map([[\"group\", group]]),\n    });\n    // A backlog event's card: its kind, its hours, its resource and its due date, grouped by when it is due. Its resource\n    // is named as the views name it: its row's label — a paged kind's, a window the frame holds (#1424) — else its key.\n    const backlogCard = (item: CalendarItem, placed: boolean): LibraryItemValue => {\n        const kind = value.events.find(kind => kind.key === item.kind)!;\n        const id = eventKey({ kind: item.kind, key: item.key });\n        const resource = item.resource.type === \"some\" ? resourceLabel(item, rows) : undefined;\n        const group = dueGroupOf(item.due.type === \"some\" ? item.due.value : undefined, now);\n        const groups = { thisWeek: vocabulary.dueThisWeek, nextWeek: vocabulary.dueNextWeek, later: vocabulary.later, none: vocabulary.noDate };\n        return baseCard(id, item.title, `${kind.name} · ${Number(item.minutes) / 60} h${resource === undefined ? \"\" : ` · ${resource}`}${item.due.type === \"some\" ? ` · due ${format.weekdayDate(item.due.value)}` : \"\"}`,\n            kind.icon, groups[group], placed);\n    };\n    const tabs = value.library.map(tab => {\n        const tabKey = tab.type === \"tab\" ? `tab:${tab.value.name}` : tab.type;\n        const label = tab.type === \"tab\" ? tab.value.name : tab.type === \"templates\" ? vocabulary.templates : vocabulary.backlog;\n        let source: CalendarSource | undefined;\n        let facts: TabFacts;\n        if (tab.type === \"backlog\" && backlogPages !== undefined) {\n            // A page at a time (#1424): its events in hand, then each narrowed kind's through its source; its count the\n            // index's — \"…\" until first read (CL13), never a count of what has landed.\n            const chosenItem = chosen[tabKey] === undefined ? undefined : backlogPages.served(chosen[tabKey]);\n            if (chosenItem !== undefined) source = { item: chosenItem, kind: value.events.find(kind => kind.key === chosenItem.kind)! };\n            const { narrowing: narrowed, clear } = backlogNarrowing;\n            const count = backlogCount === undefined ? \"…\" : backlogCount.narrowing ? narrowedCount(format, backlogCount.shown, backlogCount.total, true) : backlogCount.shown;\n            return { key: tabKey, label, count, shownCount: backlogCount?.shown, body: <Box css={styles.pane}>\n                <PagedLibrary source={backlogPages} id={calendarLibraryId(key, tabKey)} item={row => ({ ...backlogCard(row.item, eventKey(row.item) === chosen[tabKey]), filtered: row.context, draggable: draggable && !row.context })}\n                    onOpen={id => setChosen(was => ({ ...was, [tabKey]: id }))} empty={{ title: `No ${backlogWord} events` }}\n                    noun={{ singular: `${backlogWord} event`, plural: `${backlogWord} events` }}\n                    narrowing={narrowed.length === 0 || clear === undefined ? undefined\n                        : { empty: { title: `No ${backlogWord} events match the filters`, description: `Change or clear the filters to see more ${backlogWord} events.` }, onClear: clear }} />\n                {commands !== undefined && source !== undefined && <Box css={styles.paneFoot}>\n                    <PlacementAction label=\"Schedule\" source={source} value={value} shown={shown} day={day} commands={commands} styles={styles} />\n                </Box>}\n            </Box> };\n        }\n        if (tab.type === \"templates\") {\n            source = activeTemplate === undefined ? undefined : templates.shown.get(activeTemplate);\n            facts = { ...templates, cards: templates.cards.map(({ id, kind, template }) => baseCard(id, template.name,\n                `${kind.name} · ${durationMinutes(template.duration) / 60} h · ${kind.takes.map(key => value.resources.find(resource => resource.key === key)?.name ?? key).join(\", \")}`, kind.icon,\n                template.group.type === \"some\" ? template.group.value : kind.name, id === activeTemplate)) };\n        } else if (tab.type === \"backlog\") {\n            const selected = backlog.find(item => eventKey({ kind: item.kind, key: item.key }) === chosen[tabKey]);\n            if (selected !== undefined) source = { item: selected, kind: value.events.find(kind => kind.key === selected.kind)! };\n            const cards = backlog.map(item => backlogCard(item, eventKey({ kind: item.kind, key: item.key }) === chosen[tabKey]));\n            // The backlog is each kind's own narrowing: it shows what its kinds read, and counts the stored events their choices hide.\n            const { narrowing, hidden, clear } = backlogNarrowing;\n            const narrows = narrowing.length > 0;\n            const held = backlog.filter(item => narrowing.some(({ kind }) => kind.key === item.kind)).length;\n            // Until what the narrowing hides is counted its count's slot says \"…\", never a bare \"Backlog\" (CL13).\n            facts = !backlogRead ? { cards, count: \"…\", empty: undefined, narrowing: undefined, pane: { \"aria-busy\": true }, pending: true }\n                : { cards, empty: { title: `No ${backlogWord} events` }, pane: backlogRetained ? { \"aria-busy\": true, \"aria-disabled\": true } : {},\n                    count: !narrows ? cards.length : hidden === undefined ? \"…\" : narrowedCount(format, cards.length, cards.length + hidden, true),\n                    narrowing: !narrows || clear === undefined ? undefined : { empty: { title: `No ${backlogWord} events match the filters`, description: `Change or clear the filters to see more ${backlogWord} events.` },\n                        onClear: clear, emptied: held === 0 } };\n        } else {\n            const cards = tab.value.cards.map(card => ({ ...baseCard(card.key, card.label, card.meta.type === \"some\" ? card.meta.value : \"\",\n                tab.value.icon.type === \"some\" ? tab.value.icon.value : undefined, card.group.type === \"some\" ? card.group.value : \"\", card.key === chosen[tabKey]), draggable: draggable && tab.value.drop.type === \"some\" }));\n            // An app's tab follows the source it names, by its rows' keys; naming none, it lists its rows whole.\n            const followedSource = tab.value.source.type === \"some\" ? followed.get(tab.value.source.value) : undefined;\n            const noun = tab.value.name.toLocaleLowerCase(format.locale);\n            facts = followedSource === undefined ? { cards, count: cards.length, empty: { title: `No ${noun}` }, narrowing: undefined, pane: {} }\n                : sourceTab({ cards, keyOf: card => card.key, shown: followedSource.shown, noun, words: format });\n        }\n        const library = scheduleLibrary({ id: calendarLibraryId(key, tabKey), items: [...facts.cards], groupOptions: [{ key: \"group\", label: \"Group\" }],\n            noun: some({ singular: tab.type === \"templates\" ? lowerWord(vocabulary.template) : \"item\", plural: tab.type === \"templates\" ? lowerWord(vocabulary.templates) : \"items\" }),\n            onCardClick: some((id: string) => { if (tab.type === \"templates\") onTemplate(id); else setChosen(was => ({ ...was, [tabKey]: id })); return null; }),\n        });\n        const author = tab.type === \"tab\" ? tab.value : undefined;\n        const patch = author?.cards.find(card => card.key === chosen[tabKey]);\n        const targetKind = author?.drop.type === \"some\" ? author.drop.value : undefined;\n        const targets = selection.filter(item => item.kind === targetKind);\n        const held = facts.pane[\"aria-disabled\"] === true || locked;\n        // One Library whatever is read (#1398): its pending rows follow the cards it holds while the rest are read, and\n        // it is never swapped out, so its search box keeps its query and its focus.\n        return { key: tabKey, label, ...(facts.count === undefined ? {} : { count: facts.count }), ...(tab.type === \"backlog\" && args.backlogFlash === true ? { flash: true } : {}),\n            shownCount: facts.cards.length, body: <Box css={styles.pane} {...facts.pane}>\n            <EastChakraLibrary value={library} storageKey={calendarLibraryId(key, tabKey)} empty={facts.empty} narrowing={facts.narrowing} pending={facts.pending === true} />\n            {commands !== undefined && (source !== undefined || patch !== undefined) && <Box css={styles.paneFoot}>\n                {source !== undefined && <PlacementAction label={\"template\" in source ? \"Create\" : \"Schedule\"} source={source} value={value} shown={shown} day={day} commands={commands} styles={styles} held={held} />}\n                {patch !== undefined && <Button size=\"xs\" variant=\"outline\" disabled={held || targets.length === 0 || targets.some(item => !commands.editing.available(item.kind))} onClick={() => commands.patch(targets, patch.sets)}>Apply to selected events</Button>}\n            </Box>}\n        </Box> };\n    });\n    // The collapsed pane's badge: what the backlog shows — \"…\" while it is read — else what the first tab shows.\n    const badge = !value.library.some(tab => tab.type === \"backlog\") ? tabs[0]?.shownCount ?? 0\n        : backlogPages !== undefined ? backlogCount?.shown ?? \"…\" : backlogRead ? backlog.length : \"…\";\n    return { label: \"Library\", icon: \"layer-group\", size: \"272px\", tabs: tabs.map(({ shownCount: _shown, ...tab }) => tab), persist: \"local\", badge: String(badge) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Calendar's adaptation of the shared drag grammar to Schedule commands. */\nimport { useCallback, useMemo, useRef, type MutableRefObject } from \"react\";\nimport { SortedMap, compareFor, none, some } from \"@elaraai/east\";\nimport { DragEventType } from \"@elaraai/east-ui/internal\";\nimport { dropEvent, useDragTarget, useFormatters, type CellCoord, type DragEventValue, type DragPayload, type Formatters } from \"@elaraai/east-ui-components\";\nimport { initialPlacement, type CalendarCommands, type CalendarPlacement, type CalendarSource } from \"./actions.js\";\nimport { moveSpan, resizeSpan } from \"../shared/time/drag.js\";\nimport { timeScale } from \"../shared/time/scale.js\";\nimport { lowerWord } from \"../shared/schedule/words.js\";\nimport { calendarLibraryId } from \"./library.js\";\nimport { DAY, QUARTER, dayStart, eventKey, parseEventKey, parseResourceKey, parseTimeKey, resourceKey, timeKey, type CalendarItem, type CalendarValue } from \"./model.js\";\n\n/** Two drops, as East orders them: a drag's verdicts are kept by the drop each was asked of. */\nconst compareDrop = compareFor(DragEventType);\n/** The most verdicts an adapter keeps — the places drags have rested on since what they were asked of last changed — before it starts again. */\nconst VERDICTS = 4096;\n\n/** The views hand drop coordinates to this single grammar adapter. */\nexport interface CalendarDrag {\n    surface: string;\n    grab: (item: CalendarItem, instant: Date) => void;\n    adjust: (instant: Date, payload: DragPayload | undefined) => Date;\n    wholeDay: (day: Date, payload?: DragPayload) => Date;\n    readTime: (slot: string) => Date | undefined;\n    enabled: boolean;\n    run: (event: DragEventValue, checkOnly: boolean) => string | undefined;\n    preview: (coord: CellCoord, payload: DragPayload) => CalendarPlacement | undefined;\n    /** A drag's words where it rests: why a drop there is refused, if it is, the event's name, and the instant it lands at in the locale's date and time. */\n    caption: (coord: CellCoord, payload: DragPayload, allowed: boolean) => string;\n    create: (start: Date, end: Date, resource: CalendarItem[\"resource\"]) => void;\n}\ninterface DragArgs {\n    value: CalendarValue; key: string; commands: CalendarCommands | undefined; narrow: boolean;\n    items: readonly CalendarItem[]; backlog: readonly CalendarItem[]; selection: readonly CalendarItem[];\n    /** The Backlog a page at a time (#1424): what a card it listed is, by its id — where a drag of it finds its event. */\n    served?: { served(id: string): CalendarItem | undefined } | undefined;\n    /** The templates the rail shows, by their card's id: what a drop or a drawn event is made from (#1343). */\n    templates: ReadonlyMap<string, CalendarSource>;\n    activeTemplate: string | undefined; onError: (message: string | undefined) => void;\n}\n/**\n * No layer is registered in narrow or read-only mode. The same object while its surface and whether it takes a drag hold\n * (#1398, CL9; #1594), each of its answers read from the verdicts as they stand: what the views draw with it — a row that\n * draws nothing again as a drop lands on another — asks the verdicts of now, and draws again for none of their moves.\n */\nexport function useCalendarDrag(args: DragArgs): CalendarDrag {\n    const { value, key, commands, narrow, items, backlog, served, selection, activeTemplate, onError } = args;\n    const enabled = commands !== undefined && !narrow;\n    const grabbed = useRef<{ id: string; offset: number } | undefined>(undefined);\n    const grab = useCallback((item: CalendarItem, instant: Date) => {\n        grabbed.current = { id: eventKey(item), offset: item.start.type === \"some\" ? instant.getTime() - item.start.value.getTime() : 0 };\n    }, []);\n    const sources = args.templates;\n    // The locale's date and time, which the caption says where a drag lands in, as the Calendar prints every date.\n    const format = useFormatters();\n    const drag = useMemo(() => calendarDrag({ value, key, commands, items, backlog, served, selection, sources, activeTemplate, onError, enabled, grabbed, grab, format }),\n        [value, key, commands, items, backlog, served, selection, sources, activeTemplate, onError, enabled, grab, format]);\n    const live = useRef(drag);\n    live.current = drag;\n    const { run } = drag;\n    const target = useMemo(() => {\n        if (!enabled) return null;\n        const libraries = value.library.map(tab => calendarLibraryId(key, tab.type === \"tab\" ? `tab:${tab.value.name}` : tab.type));\n        return { id: key, sources: libraries, kinds: { add: true, move: true, resize: true, remove: true, trash: false },\n            returns: { libraries: value.library.some(tab => tab.type === \"backlog\") ? [calendarLibraryId(key, \"backlog\")] : [],\n                canDrop: (event: DragEventValue) => run(event, true) === undefined },\n            onDrag: (event: DragEventValue) => { const refusal = run(event, false); onError(refusal); return refusal === undefined; },\n        };\n    }, [enabled, key, value.library, run, onError]);\n    useDragTarget(target);\n    return useMemo((): CalendarDrag => ({ surface: key, enabled, grab,\n        run: (event, checkOnly) => live.current.run(event, checkOnly),\n        adjust: (instant, payload) => live.current.adjust(instant, payload),\n        wholeDay: (day, payload) => live.current.wholeDay(day, payload),\n        readTime: slot => live.current.readTime(slot),\n        preview: (coord, payload) => live.current.preview(coord, payload),\n        caption: (coord, payload, allowed) => live.current.caption(coord, payload, allowed),\n        create: (start, end, resource) => live.current.create(start, end, resource),\n    }), [key, enabled, grab]);\n}\n/**\n * The drag's verdicts over the period as it stands: what a drop runs, what a hover previews and what a press grabs.\n * What they are asked of holds while the adapter does — the events and the Backlog read, the drafts, the selection, the\n * templates — so it finds an event by its key once, and asks each place a drag rests on once (#1594).\n */\nfunction calendarDrag({ value, key, commands, items, backlog, served, selection, sources, activeTemplate, onError, enabled, grabbed, grab, format }: {\n    value: CalendarValue; key: string; commands: CalendarCommands | undefined; items: readonly CalendarItem[]; backlog: readonly CalendarItem[];\n    served: DragArgs[\"served\"]; selection: readonly CalendarItem[]; sources: ReadonlyMap<string, CalendarSource>; activeTemplate: string | undefined;\n    onError: (message: string | undefined) => void; enabled: boolean; grabbed: MutableRefObject<{ id: string; offset: number } | undefined>;\n    grab: CalendarDrag[\"grab\"]; format: Formatters;\n}): CalendarDrag {\n    // The events and the Backlog read, each by its key, the first read of a key kept: what a drag finds the event it\n    // carries by, gathered at the first it asks for — never every event walked again at each place it rests on.\n    let read: Map<string, CalendarItem> | undefined;\n    const sourceItem = (encoded: string): CalendarItem | undefined => {\n        const parsed = parseEventKey(encoded);\n        if (!parsed.success) return undefined;\n        if (read === undefined) {\n            read = new Map();\n            for (const list of [items, backlog]) for (const item of list) { const id = eventKey(item); if (!read.has(id)) read.set(id, item); }\n        }\n        return read.get(eventKey(parsed.value)) ?? served?.served(encoded) ?? commands?.editing.read(parsed.value.kind, parsed.value.key)?.item;\n    };\n    const resource = (row: string): CalendarItem[\"resource\"] => {\n        const read = parseResourceKey(row); return read.success ? some(read.value) : none;\n    };\n    const at = (coord: { slot: string; row: string }) => {\n        const read = parseTimeKey(coord.slot); return read.success ? { start: read.value, resource: resource(coord.row) } : undefined;\n    };\n    // A drag's verdicts where it rests, by the drop it would deliver there, as the Roster keeps its previews: each asked\n    // once however often the pointer moves within a place, and the same verdict for the cell, the caption and what is said\n    // to a screen reader. New rows, drafts, a selection or a period make a new adapter, and with it new verdicts. A drop is\n    // never answered from them: it is made through the commands, which check it again.\n    const verdicts = new SortedMap<DragEventValue, { readonly refusal: string | undefined }>(undefined, compareDrop);\n    const run = (event: DragEventValue, checkOnly: boolean): string | undefined => {\n        if (!checkOnly) return decide(event, false);\n        const held = verdicts.get(event);\n        if (held !== undefined) return held.refusal;\n        if (verdicts.size >= VERDICTS) verdicts.clear();\n        const refusal = decide(event, true);\n        verdicts.set(event, { refusal });\n        return refusal;\n    };\n    const decide = (event: DragEventValue, checkOnly: boolean): string | undefined => {\n        if (!enabled || commands === undefined) return \"Editing is unavailable\";\n        if (event.type === \"add\") {\n            const drop = event.value; const target = at(drop.into);\n            if (target === undefined) return \"Choose a time\";\n            if (drop.from.library === calendarLibraryId(key, \"templates\")) {\n                const source = sources.get(drop.from.key); if (source === undefined) return `This ${lowerWord(value.vocabulary.template)} is no longer available`;\n                const initial = initialPlacement(source, target.start);\n                return commands.place(source, { ...target, end: new Date(target.start.getTime() + initial.end.getTime() - initial.start.getTime()) }, \"drop\", checkOnly);\n            }\n            if (drop.from.library === calendarLibraryId(key, \"backlog\")) {\n                const item = sourceItem(drop.from.key); const kind = value.events.find(kind => kind.key === item?.kind);\n                if (item === undefined || kind === undefined) return `This ${lowerWord(value.vocabulary.backlog)} event is no longer available`;\n                return commands.place({ kind, item }, { ...target, end: new Date(target.start.getTime() + Number(item.minutes) * 60_000) }, \"drop\", checkOnly);\n            }\n            const tab = value.library.find(tab => tab.type === \"tab\" && calendarLibraryId(key, `tab:${tab.value.name}`) === drop.from.library);\n            const item = drop.into.event.type === \"some\" ? sourceItem(drop.into.event.value) : undefined;\n            if (tab?.type !== \"tab\" || tab.value.drop.type !== \"some\" || item?.kind !== tab.value.drop.value) return \"Drop this card on a compatible event\";\n            const card = tab.value.cards.find(card => card.key === drop.from.key);\n            if (card === undefined) return \"This card is no longer available\";\n            if (!commands.editing.available(item.kind)) return \"This event is not ready to edit\";\n            if (!checkOnly) commands.patch([item], card.sets);\n            return undefined;\n        }\n        if (event.type === \"remove\") {\n            const item = event.value.from.event.type === \"some\" ? sourceItem(event.value.from.event.value) : undefined;\n            if (item === undefined) return \"This event is no longer available\";\n            return commands.unschedule([item], checkOnly);\n        }\n        const coord = event.type === \"move\" ? event.value.from : event.value.event;\n        const item = coord.event.type === \"some\" ? sourceItem(coord.event.value) : undefined;\n        if (item === undefined || item.start.type !== \"some\" || item.end.type !== \"some\") return \"This event is no longer available\";\n        const kind = value.events.find(kind => kind.key === item.kind)!;\n        const scale = timeScale({ window: { min: dayStart(item.start.value), max: new Date(dayStart(item.start.value).getTime() + DAY) }, resolution: \"hour\" })!;\n        const span = { start: item.start.value, end: item.end.value };\n        if (event.type === \"resize\") {\n            const target = at(event.value.event); if (target === undefined) return \"Choose a time\";\n            const edge = event.value.edge.type;\n            const next = resizeSpan(scale, span, edge, (target.start.getTime() - span[edge].getTime()) / QUARTER, true);\n            return commands.place({ kind, item }, { ...next, resource: item.resource }, \"resize\", checkOnly);\n        }\n        const target = at(event.value.to); if (target === undefined) return \"Choose a time\";\n        const moving = selection.some(selected => eventKey(selected) === eventKey(item)) ? selection : [item];\n        const next = moveSpan(scale, span, (target.start.getTime() - item.start.value.getTime()) / QUARTER, true);\n        return commands.move(moving, next.start.getTime() - span.start.getTime(), moving.length === 1 && event.value.to.row !== \"\" ? target.resource : undefined, checkOnly);\n    };\n    return { surface: key, enabled, run, grab,\n        adjust: (instant, payload) => payload?.kind === \"event\" && grabbed.current?.id === payload.from.event\n            ? new Date(instant.getTime() - grabbed.current.offset) : instant,\n        readTime: slot => { const parsed = parseTimeKey(slot); return parsed.success ? parsed.value : undefined; },\n        wholeDay: (day, payload) => {\n            const source = payload?.kind === \"item\" ? sources.get(payload.from.key) : undefined;\n            if (source !== undefined) return initialPlacement(source, day).start;\n            const item = payload !== undefined ? sourceItem(payload.kind === \"item\" ? payload.from.key : payload.from.event) : undefined;\n            const time = item?.start.type === \"some\" ? item.start.value : undefined;\n            const result = new Date(day); result.setUTCHours(time?.getUTCHours() ?? 9, time?.getUTCMinutes() ?? 0, 0, 0); return result;\n        },\n        preview: (coord, payload) => {\n            const target = at(coord); if (target === undefined) return undefined;\n            if (payload.kind === \"item\") {\n                const template = payload.from.library === calendarLibraryId(key, \"templates\") ? sources.get(payload.from.key) : undefined;\n                const item = payload.from.library === calendarLibraryId(key, \"backlog\") ? sourceItem(payload.from.key) : undefined;\n                const kind = value.events.find(kind => kind.key === item?.kind);\n                const source = template ?? (item !== undefined && kind !== undefined ? { item, kind } : undefined);\n                if (source === undefined) return undefined;\n                const initial = initialPlacement(source, target.start);\n                return { ...target, end: new Date(target.start.getTime() + initial.end.getTime() - initial.start.getTime()) };\n            }\n            const item = sourceItem(payload.from.event);\n            if (item?.start.type !== \"some\" || item.end.type !== \"some\") return undefined;\n            if (payload.kind === \"edge\") {\n                const scale = timeScale({ window: { min: dayStart(item.start.value), max: new Date(dayStart(item.start.value).getTime() + DAY) }, resolution: \"hour\" })!;\n                const span = { start: item.start.value, end: item.end.value };\n                return { ...resizeSpan(scale, span, payload.edge, (target.start.getTime() - span[payload.edge].getTime()) / QUARTER, true), resource: item.resource };\n            }\n            return { ...target, end: new Date(target.start.getTime() + item.end.value.getTime() - item.start.value.getTime()) };\n        },\n        caption: (coord, payload, allowed) => {\n            const at = parseTimeKey(coord.slot);\n            const name = payload.label ?? (payload.kind === \"item\" ? payload.from.key : payload.from.event);\n            const candidate = dropEvent(payload, coord, false);\n            const refusal = allowed || candidate === undefined ? undefined : run(candidate, true);\n            return `${refusal === undefined ? \"\" : `${refusal} · `}${name}${at.success ? ` · ${format.dateTime(at.value)}` : \"\"}`;\n        },\n        create(start, end, resource) {\n            if (!enabled || commands === undefined) return;\n            const active = activeTemplate === undefined ? undefined : sources.get(activeTemplate);\n            const fits = (source: CalendarSource) => resource.type === \"none\" || source.kind.takes.includes(resource.value.kind);\n            const source = active !== undefined && fits(active) ? active : [...sources.values()].find(fits);\n            if (source !== undefined) onError(commands.place(source, { start, end, resource }, \"insert\"));\n        },\n    };\n}\n/** One canonical continuous cell coordinate. */\nexport function calendarCoord(surface: string, start: Date, resource: CalendarItem[\"resource\"], event?: string): CellCoord {\n    return { surface, row: resource.type === \"some\" ? resourceKey(resource.value) : \"\", slot: timeKey(start), ...(event === undefined ? {} : { event }) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The event a pick in Search Records gives the keyboard to (#1398), as the\n * Allocation's bin is given it (`allocation/bin-focus.ts`). The Calendar\n * selects the event and brings it into view, and the element that stands for\n * it where its ring is drawn — a time grid's or a timeline's block, a month's\n * chip, an agenda card's head — takes the focus as it is drawn, so the\n * selection's ring and the focus are on the same event. An event drawn twice —\n * one that runs across midnight, in a day's column each — takes it in the\n * first of its elements drawn. The frame lets it go once taken, once the event\n * is no longer selected, or once the viewer does something else.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext, useLayoutEffect, type RefObject } from \"react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\n\nconst keyEqual = equalFor(StringType);\n\n/** The event given the keyboard, as the Calendar's views read it. */\nexport interface EventFocus {\n    /** The event's key, as `eventKey` prints it, while it waits for its element; `undefined` while no pick waits. */\n    readonly id: string | undefined;\n    /**\n     * Takes the keyboard for an element of the event: `true` for the first that asks, once — the frame lets the event\n     * go as it does.\n     */\n    readonly take: () => boolean;\n}\n\n/** No event waits for the keyboard. */\nconst NO_EVENT: EventFocus = { id: undefined, take: () => false };\n\n/** The event a pick gave the keyboard to, for the Calendar's views. */\nexport const EventFocusContext = createContext<EventFocus>(NO_EVENT);\n\n/**\n * An element that stands for an event where its ring is drawn: drawn while its event is the one a pick gave the keyboard\n * to, it takes the focus — the first such element drawn.\n *\n * @param id - The event it stands for, as `eventKey` prints it\n * @param element - The element\n */\nexport function useEventFocus(id: string, element: RefObject<HTMLElement | null>): void {\n    const focus = useContext(EventFocusContext);\n    const given = focus.id !== undefined && keyEqual(focus.id, id);\n    useLayoutEffect(() => {\n        if (!given || element.current === null || !focus.take()) return;\n        element.current.focus({ preventScroll: true });\n    }, [given, focus, element]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Search Records (#1398): the Calendar toolbar's key search over its event\n * kinds' records by primary key — never a field search, which is the rail's,\n * and never what the grid draws. It is the shared key search's item over each\n * kind's own record, as the Schematic's Find seeks its kinds'.\n *\n * - **A kind narrowed through its source of the slice** is sought through e3\n *   with no narrowing: `recordSliceSeek` places the query's run in the\n *   record's own order, and `recordSlicePage` reads the rows a list shows by\n *   position, each read as an event by its key (the kind's `event`, its drafts\n *   in place).\n * - **A kind read whole** is sought in its events — every one its record\n *   holds, scheduled or in its backlog — their keys in East's order, as the\n *   server finds a key (`findKeyInline`).\n *\n * The matches are one list, each kind's run in its keys' order, the kinds in\n * the Calendar's order. A line names an event by its key, its title, its\n * kind's name and when it starts; one the rail's narrowing hides says so, as\n * every builder's does (the shared hidden pick, `shared/schedule/hidden.ts`),\n * the Calendar saying which of its sources hide it: its kind's — its choices,\n * never its window, which hides no event: a pick steps to it — which of the\n * events a list shows the choices hide asked of e3 over the page the list\n * read them from (`recordSliceWithinAt`); and, where the layout lays resources\n * out — the timeline's rows, the Resources view's columns — its resource\n * kind's, that source's choices beside its kind's own (`· hidden by Hall:\n * Hall 2 — …`): the resources the source shows, where the Calendar follows it,\n * else which of them its narrowing holds, asked of e3 by their keys. A pick\n * hands the frame the event (`onPick`), which clears what hides it, steps to\n * its period, selects it and brings it into view, and the box shows its key.\n * The box asks its query again as a kind's record moves — its revision, or a\n * kind read whole's commits — and lists its lines again as e3 says what hides\n * an event, as a source's choices move, and as the layout comes to lay\n * resources out or leaves off.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { StringType, compareFor, equalFor, none, some, toEastTypeValue, type EastTypeValue, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { findKeyInline, type DatasetKeyMatchRange, type DatasetKeyQuery, type RecordSliceBindType, type RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { useTrackedEvaluation, type KeySearchSource } from \"@elaraai/east-ui-components\";\nimport {\n    awaitTracked, recordSlicePage, recordSliceRevision, recordSliceRows, recordSliceSeek, recordSliceWithin, recordSliceWithinAt, toSeekQuery,\n} from \"@elaraai/east-ui-components/internal\";\nimport { EMPTY_SCHEDULE_DRAFTS, heldRowOf, type ScheduleEditing, type ScheduleHeldRows } from \"../shared/schedule/editing.js\";\nimport { askHiding, hiddenLine, hiddenOf, useRelist, type RowHidden, type RowHiding, type SourceHidden } from \"../shared/schedule/hidden.js\";\nimport type { HiddenPicks } from \"../shared/schedule/hidden-pick.js\";\nimport type { CalendarWords } from \"./messages.js\";\nimport type { CalendarEventPart } from \"./window.js\";\nimport type { CalendarItem, CalendarKind, CalendarRange, CalendarResource } from \"./model.js\";\n\n/** An event's key is a String: the search's text parses against that. */\nconst KEY_TYPE: EastTypeValue = toEastTypeValue(StringType);\nconst keyEqual = equalFor(StringType);\n/** East's order of String keys. */\nconst compareKeys = compareFor(StringType);\n\n/** No narrowing: a record's own rows, in its order. */\nconst WHOLE: ValueTypeOf<typeof RecordSliceWhereType> = new Map();\n/** An empty box lists the first of the events every kind's record holds. */\nconst BROWSE_QUERY: DatasetKeyQuery = { prefix: \"\" };\n/** The whole of time, for a kind read whole: every event its record holds. */\nconst EVER = { from: new Date(-8_640_000_000_000_000), to: new Date(8_640_000_000_000_000) };\n\n/** A record Slice's part, as a kind's source of the slice. */\ntype RecordPart = ValueTypeOf<RecordSliceBindType>;\n/** An entry of a record's window, as every record Slice binding reads one: its key — a kind's are Strings — and its row. */\ninterface RecordEntry { readonly key: string }\n\n/** One kind's matches: a run of its record's rows, from `start`, or a kind read whole's events. */\ninterface FindRun {\n    readonly kind: CalendarKind;\n    /** Its source of the slice; `undefined` for a kind read whole. */\n    readonly part: RecordPart | undefined;\n    /** Where its matches start, in its record's own order: a kind read through its source. */\n    readonly start: number;\n    readonly count: number;\n    /** A kind read whole's matches, in its keys' order. */\n    readonly items: readonly CalendarItem[] | undefined;\n}\n\n/** An event Search Records found: the event, its kind's name, and what hides it. */\nexport interface FoundEvent {\n    readonly item: CalendarItem;\n    readonly kind: string;\n    /**\n     * What hides it, as far as e3 has said: its kind's source, its choices leaving it out — and, where the layout lays\n     * resources out, its resource kind's, hiding its resource; `undefined` for one nothing hides.\n     */\n    readonly hidden: readonly RowHidden[] | undefined;\n}\n\n/**\n * How a found event reads in the list: its key, its title, its kind's name and when it starts — or that it waits in the\n * backlog — and, one the rail's narrowing hides, what hides it, in the Calendar's words (the shared hidden pick).\n *\n * @param found - The event\n * @param words - The Calendar's words: the app's formatters, and its message table\n * @returns Its line\n */\nexport function foundEventLine(found: FoundEvent, words: CalendarWords): string {\n    const { item } = found;\n    const when = item.start.type === \"some\" ? `${words.weekdayDate(item.start.value)} ${words.time(item.start.value)}` : words.backlog ?? \"backlog\";\n    const hidden = found.hidden === undefined ? [] : [hiddenLine(found.hidden, words, words.m)];\n    return [item.key, ...(keyEqual(item.title, item.key) ? [] : [item.title]), found.kind, when, ...hidden].join(\" · \");\n}\n\n/** No source hides an event. */\nconst NO_HIDINGS: readonly RowHiding[] = [];\n\n/**\n * The resource an event is drawn on where the layout lays resources out: its own, while it is scheduled — one waiting in\n * the backlog is a card of the Backlog, which narrows no event by its resource.\n *\n * @param item - The event\n * @returns Its resource; `undefined` for one with none, or one waiting in the backlog\n */\nfunction laidOn(item: CalendarItem): CalendarResource | undefined {\n    return item.start.type === \"some\" && item.resource.type === \"some\" ? item.resource.value : undefined;\n}\n\n/**\n * Which of some resources of a kind its source of the slice hides: by the resources the source shows, where the Calendar\n * follows it; else — the paged kind's, whose windows are its narrowing's rows themselves — as e3 says its narrowing holds\n * them, their rows read by their keys in one request and which of them the narrowing holds in one more.\n *\n * @param pick - The resource kind's hidden pick\n * @param shown - The resources its source shows, where the Calendar follows it — `none` while it narrows none; `undefined`\n *   for the paged kind\n * @param keys - The resources' keys, each once\n * @returns The keys of those it hides\n */\nasync function hiddenResources(pick: SourceHidden, shown: option<ReadonlySet<string>> | undefined, keys: readonly string[]): Promise<readonly string[]> {\n    const { part, where } = pick;\n    if (shown !== undefined) return shown.type === \"some\" ? keys.filter(key => !shown.value.has(key)) : [];\n    if (part === undefined || where === undefined || where.size === 0) return [];\n    return awaitTracked(() => {\n        const rows = recordSliceRows(part, keys);\n        if (rows.type === \"none\") return none;\n        // A key the record holds no row by names no resource of it: nothing the source chooses hides it.\n        const stored = keys.flatMap((key, i) => {\n            const row = rows.value[i]!;\n            return row.type === \"some\" ? [{ key, row: row.value }] : [];\n        });\n        const held = stored.length === 0 ? some<boolean[]>([]) : recordSliceWithin(part, where, stored);\n        return held.type === \"none\" ? none : some(stored.flatMap(({ key }, i) => (held.value[i] ? [] : [key])));\n    });\n}\n\n/**\n * The events of a kind read whole that a query finds, in East's order of their keys: as the server finds a key in a\n * record's own order (`findKeyInline`) — a key's start, a quoted key, a range.\n *\n * @param items - The kind's events, in any order\n * @param query - The query the box parsed\n * @returns The events it finds, in key order\n */\nexport function wholeEventMatches(items: readonly CalendarItem[], query: DatasetKeyQuery): CalendarItem[] {\n    const byKey = new Map(items.map(item => [item.key, item] as const));\n    const keys = [...byKey.keys()].sort(compareKeys);\n    const range = findKeyInline(KEY_TYPE, keys, query);\n    return range.found ? keys.slice(range.row, range.row + range.count).map(key => byKey.get(key)!) : [];\n}\n\n/** The runs a list's rows `[row, row + limit)` fall in: each kind's matches after the one before. */\nfunction runsAt(runs: readonly FindRun[], row: number, limit: number): { run: FindRun; offset: number; n: number; at: number }[] {\n    const out: { run: FindRun; offset: number; n: number; at: number }[] = [];\n    let base = 0;\n    for (const run of runs) {\n        const from = Math.max(row, base), to = Math.min(row + limit, base + run.count);\n        if (from < to) out.push({ run, offset: from - base, n: to - from, at: from });\n        base += run.count;\n    }\n    return out;\n}\n\n/** Props of {@link useCalendarFind}. */\nexport interface CalendarFindProps {\n    /** The event kinds, in the Calendar's order. */\n    readonly kinds: readonly CalendarKind[];\n    /** Each kind narrowed through its source of the slice. */\n    readonly parts: readonly CalendarEventPart[];\n    /** The editing whose drafts an event is read with; `undefined` for a read-only Calendar. */\n    readonly editing: ScheduleEditing | undefined;\n    /** The window the Calendar shows: what an event is read over, by key past it. */\n    readonly range: CalendarRange;\n    /** The Calendar's words: the app's formatters, which word a choice as the rail does, and its message table — what the box says. */\n    readonly format: CalendarWords;\n    /** Told the event a pick lands on. */\n    readonly onPick: (found: FoundEvent) => void;\n    /** The rows a kind read by its cells holds (#1424): a found event of such a kind is read from them, else by its key — never over the window. */\n    readonly held?: ScheduleHeldRows | undefined;\n    /** Each event kind's hidden pick and each resource kind's, by its slot: what e3 has said hides an event. */\n    readonly picks: HiddenPicks;\n    /**\n     * The resources each resource kind's source shows, by the kind's slot, where the Calendar follows the source — `none`\n     * while it narrows none; the paged kind's absent, whose windows are its narrowing's rows themselves.\n     */\n    readonly resourcesShown: ReadonlyMap<string, option<ReadonlySet<string>>>;\n    /**\n     * Whether the layout lays resources out — the timeline's rows, the Resources view's columns: there an event its\n     * resource's source hides is hidden; the time grids, the month and the agenda narrow no event by its resource.\n     */\n    readonly laysResources: boolean;\n}\n\n/**\n * Search Records' source, for the shared key search's toolbar item (see the module docs).\n *\n * @param props - The kinds and their parts, the editing, the window, the words, the pick, the hidden picks, what each\n *   resource kind's source shows and the layout\n * @returns The source; `undefined` with no event kind to seek\n */\nexport function useCalendarFind({ kinds, parts, editing, range, format, onPick, held, picks, resourcesShown, laysResources }: CalendarFindProps): KeySearchSource | undefined {\n    const latest = useRef({ kinds, parts, editing, range, format, onPick, held, picks, resourcesShown, laysResources });\n    useLayoutEffect(() => { latest.current = { kinds, parts, editing, range, format, onPick, held, picks, resourcesShown, laysResources }; });\n    const partOf = useCallback((kind: CalendarKind) => latest.current.parts.find(p => keyEqual(p.kind.key, kind.key))?.part, []);\n    const draftsOf = useCallback((kind: CalendarKind) => latest.current.editing?.drafts.get(kind.key) ?? EMPTY_SCHEDULE_DRAFTS, []);\n    // What the last find found, each kind's run; a find answered after a newer one asked finds nothing here.\n    const found = useRef<readonly FindRun[]>([]);\n    const asked = useRef(0);\n    const find = useCallback(async (query: DatasetKeyQuery): Promise<DatasetKeyMatchRange> => {\n        const mine = ++asked.current;\n        const seek = toSeekQuery(query);\n        const runs = await Promise.all(latest.current.kinds.flatMap((kind): Promise<FindRun>[] => {\n            const part = partOf(kind);\n            if (part !== undefined) {\n                return [awaitTracked(() => recordSliceSeek(part, WHOLE, seek)).then((at): FindRun =>\n                    ({ kind, part, start: at.found ? Number(at.row) : 0, count: at.found ? Number(at.count) : 0, items: undefined }))];\n            }\n            // A kind read a window at a time with no source of the slice has no index to seek: it lists nothing.\n            if (kind.entries.type === \"some\") return [];\n            const drafts = draftsOf(kind);\n            return [Promise.all([awaitTracked(() => kind.items(EVER.from, EVER.to, drafts, none)),\n                kind.backlog ? awaitTracked(() => kind.unscheduled(EVER.from, EVER.to, drafts, none)) : Promise.resolve([] as CalendarItem[])])\n                .then(([scheduled, backlog]): FindRun => {\n                    const items = wholeEventMatches([...scheduled, ...backlog], query);\n                    return { kind, part: undefined, start: 0, count: items.length, items };\n                })];\n        }));\n        if (mine === asked.current) found.current = runs;\n        const count = runs.reduce((sum, run) => sum + run.count, 0);\n        return { found: count > 0, row: 0, count };\n    }, [partOf, draftsOf]);\n    /** The matches at the list's rows `[row, row + limit)`, each with the row it is at. */\n    const eventsAt = useCallback(async (row: number, limit: number): Promise<{ at: number; found: FoundEvent }[]> => {\n        const parts = await Promise.all(runsAt(found.current, row, limit).map(async ({ run, offset, n, at }) => {\n            if (run.items !== undefined) return run.items.slice(offset, offset + n).map((item, i) => ({ at: at + i, item, kind: run.kind.name, hidings: NO_HIDINGS }));\n            const part = run.part!;\n            const from = BigInt(run.start + offset);\n            const entries = await awaitTracked(() => recordSlicePage(part, { where: WHOLE, area: none }, from, BigInt(n))) as readonly RecordEntry[];\n            // Which of them the kind's choices hide, asked of e3 over the page just read — its narrowing but the window,\n            // which hides no event — and which choices hide those (the hidden pick): nothing is asked with no choice.\n            const pick = latest.current.picks.get(run.kind.key);\n            const where = pick?.where;\n            const shown = where === undefined || where.size === 0 ? undefined : await awaitTracked(() => recordSliceWithinAt(part, where, from, BigInt(n)));\n            if (pick !== undefined && shown !== undefined) pick.rows.askListed(Number(from), entries.map(entry => entry.key), shown);\n            const { range: window, held } = latest.current;\n            const drafts = draftsOf(run.kind);\n            const read = await Promise.all(entries.map(entry => awaitTracked(() => run.kind.event(entry.key, drafts, window.from, window.to, heldRowOf(held, run.kind.key, entry.key)))));\n            return read.map((event, i) => ({\n                at: at + i, item: event.item, kind: run.kind.name,\n                hidings: pick === undefined || shown === undefined || shown[i] !== false ? NO_HIDINGS : [{ pick, id: entries[i]!.key }],\n            }));\n        }));\n        const listed = parts.flat();\n        // Where the layout lays resources out, an event its resource's source hides is drawn nowhere: of the resources the\n        // listed events stand on, those a source hides (`hiddenResources`), and which of its choices hide those, asked of\n        // e3 a source at a time — the line saying so once e3 has said, as a kind's choices are named.\n        const { picks, resourcesShown, laysResources: lays } = latest.current;\n        // The resources each source narrows that the listed events are drawn on, each once.\n        const standing = new Map<string, string[]>();\n        if (lays) {\n            for (const { item } of listed) {\n                const resource = laidOn(item);\n                const where = resource === undefined ? undefined : picks.get(resource.kind)?.where;\n                if (resource === undefined || where === undefined || where.size === 0) continue;\n                const keys = standing.get(resource.kind) ?? [];\n                if (!keys.some(key => keyEqual(key, resource.key))) keys.push(resource.key);\n                standing.set(resource.kind, keys);\n            }\n        }\n        const hides = new Map(await Promise.all([...standing].map(async ([kind, keys]) => {\n            const pick = picks.get(kind)!;\n            return [kind, { pick, hidden: await hiddenResources(pick, resourcesShown.get(kind), keys) }] as const;\n        })));\n        askHiding([...hides.values()].flatMap(({ pick, hidden }) => hidden.map(id => ({ pick, id }))), true);\n        return listed.map(({ at, item, kind, hidings }) => {\n            const resource = laidOn(item);\n            const hiding = resource === undefined ? undefined : hides.get(resource.kind);\n            const byResource = resource === undefined || hiding === undefined || !hiding.hidden.some(key => keyEqual(key, resource.key)) ? NO_HIDINGS\n                : [{ pick: hiding.pick, id: resource.key }];\n            // What hides it, its kind's source first: e3's word that a source holds its row — the record holding no resource\n            // by its key among it — leaves no choice of that source to clear.\n            return { at, found: { item, kind, hidden: hiddenOf([...hidings, ...byResource]) } };\n        });\n    }, [draftsOf]);\n    const listRange = useCallback(async (row: number, limit: number) => {\n        const listed = await eventsAt(row, limit);\n        const { format: words } = latest.current;\n        // A pick shows the event's key in the box: what its query is typed against.\n        return listed.map(({ at, found: event }) => ({ row: at, label: foundEventLine(event, words), text: event.item.key }));\n    }, [eventsAt]);\n    const jump = useCallback((row: number) => {\n        void eventsAt(row, 1).then(([hit]) => { if (hit !== undefined) latest.current.onPick(hit.found); })\n            .catch((error: unknown) => { console.error(\"[Calendar] Search Records could not read the event it found:\", error); });\n    }, [eventsAt]);\n    const clear = useCallback(() => { asked.current++; found.current = []; }, []);\n    // The box asks its query again as what its lines are read from moves: each source's record's revision, each kind\n    // read whole's commits — tracked, so a window the grid reads moves none of it.\n    const readAnswers = useCallback(() => kinds.map((kind): string => {\n        const part = parts.find(p => keyEqual(p.kind.key, kind.key))?.part;\n        if (part !== undefined) return revisionOf(recordSliceRevision(part));\n        const history = kind.history();\n        return history.type === \"some\" ? `${history.value.length}:${history.value[0]?.at.getTime() ?? \"\"}` : \"-\";\n    }).join(\"\\n\"), [kinds, parts]);\n    const { result } = useTrackedEvaluation(readAnswers);\n    const answers = result.ok ? result.value : \"\";\n    const [requery, setRequery] = useState(0);\n    const seen = useRef(answers);\n    useEffect(() => {\n        if (keyEqual(seen.current, answers)) return;\n        seen.current = answers;\n        setRequery(n => n + 1);\n    }, [answers]);\n    const any = kinds.length > 0;\n    // And lists its lines again as e3 says what hides an event, as a source's choices move, as what a resource kind's\n    // source shows moves, and as the layout comes to lay resources out or leaves off.\n    const relist = useRelist([...picks.values()], [...resourcesShown.values(), laysResources]);\n    // Where no key matches, the box says it finds an event by its key — never by its title, which the views draw.\n    const noMatches = format.m.keySearchNoMatches();\n    return useMemo(() => (any ? { resetKey: \"calendar\", requery, relist, keyType: KEY_TYPE, find, listRange, jump, clear, browseQuery: BROWSE_QUERY,\n        noMatchesText: noMatches } : undefined), [any, requery, relist, find, listRange, jump, clear, noMatches]);\n}\n\n/** A record's revision, as a token: `-` while it is not yet known. */\nfunction revisionOf(revision: option<string>): string {\n    return revision.type === \"some\" ? revision.value : \"-\";\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\nimport { useRef } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { OptimiseLegendItem } from \"@elaraai/east-ui-components\";\nimport { FooterMore, LoadingLine, RecordSliceSaveNotice, footerCut, useFooterFit, useRevealed, useSlotClass, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport type { CalendarKind, CalendarStyles } from \"./model.js\";\nimport type { CalendarEventPart } from \"./window.js\";\n\n/**\n * The shared footer rail explains the Calendar's event kinds, each by its\n * icon, then each kind's Save notice of the events that left its source's\n * narrowing, and at its trailing end the shared loading line (#1398, CL3):\n * the period being read — `Loading November 2026` — or why it could not be,\n * with Retry. The rail never wraps and never cuts a word: the legend stays\n * whole and in place, ending at a whole kind, then \"…\", only where it cannot\n * fit. The line shows on the frame's one reveal clock (CL4, its\n * `LoadingReveal`), which the period's placeholders keep too — or says what a\n * run of the app's optimiser does (#1409), at once. During a run's highlight\n * the legend ends with `Elara change`. A kind's icon is the event blocks'\n * own, a plain element of its slot's class (`useSlotClass`), made once a\n * theme: the rail draws again with every step of the period, and Chakra's\n * styled element works its styles out again at every draw.\n */\nexport function CalendarFooter({ styles, kinds, parts, locale, line, elara = false }: {\n    styles: CalendarStyles;\n    /** The event kinds the legend explains. */\n    kinds: readonly CalendarKind[];\n    /** Each event kind's part of the slice, whose Save notice counts what leaves its narrowing. */\n    parts: readonly CalendarEventPart[];\n    /** The locale a kind's name is written in, lower-cased in its notice. */\n    locale: string;\n    /** What the period's read says: the period being read, or why it could not be; `undefined` while it has landed. Or what a run of the optimiser says (#1409). */\n    line: LoadingLineValue | undefined;\n    /** Whether a run's highlight is on (#1409): the legend ends with `Elara change`. */\n    elara?: boolean | undefined;\n}) {\n    const ref = useRef<HTMLDivElement>(null);\n    const fit = useFooterFit(ref);\n    const shown = useRevealed() === true;\n    const units = kinds.length + (elara ? 1 : 0);\n    const slot = useSlotClass();\n    return <Box ref={ref} css={styles.footer} data-calendar-footer=\"\">\n        {kinds.map((kind, i) => <Box as=\"span\" key={kind.key} css={styles.footerItem} data-calendar-legend={kind.key}\n            data-footer-unit=\"\" data-footer-cut={footerCut(i, fit)}>\n            <span className={slot(styles.eventIcon)}><FontAwesomeIcon icon={[\"fas\", kind.icon as IconName]} /></span> {kind.name}\n        </Box>)}\n        {elara && <OptimiseLegendItem css={styles.footerItem} cut={footerCut(kinds.length, fit)} />}\n        <FooterMore shown={fit.kept < units} />\n        {parts.map(({ kind, part }) => <RecordSliceSaveNotice key={kind.key} slice={part}\n            singular={`${kind.name.toLocaleLowerCase(locale)} event`} plural={`${kind.name.toLocaleLowerCase(locale)} events`} />)}\n        {/* A run's line shows at once, whatever the reveal says: a run is not a read. */}\n        <LoadingLine value={line} shown={shown || (line !== undefined && line.kind !== \"loading\")} form={fit.form} />\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Keeping the keyboard in a region as the control it is on goes (#1398): an\n * inspector's Delete, Unplace, Remove or Place takes away what its view shows,\n * and a link in it selects something else — the view the control was pressed\n * in is drawn no more, and the focus, on a control that went with it, would\n * fall to the page's body, where the next Tab starts again at the page's top.\n * The region keeps it: once what it shows has been drawn again, the focus\n * lands on its view's home ({@link FOCUS_HOME}) — its heading, focusable by\n * script and out of the tab order — which names what the region shows now, so\n * a screen reader says where the keyboard is and the next Tab goes on from\n * there. A focus that left the region — for another element, for the page with\n * the control it was on still there, or a press anywhere outside it — is let\n * be. So is one on its way to another of the region's controls, still there —\n * a click into it, a Tab to it — though what the region shows is drawn again\n * meanwhile, as a field commits its edit while the keyboard leaves it: it\n * lands where it was given (#1585).\n *\n * Every builder's Details is such a region: the Schematic's, the Flowchart's,\n * the Plan's, the Calendar's, the Roster's and the Allocation's. A view's home\n * is its head; a view with none — the Plan's Nothing selected, the Calendar's\n * empty state — is its own.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useRef, type FocusEvent, type RefObject } from \"react\";\n\n/** What marks a region's home: the element the keyboard lands on as the control it was on goes. */\nexport const FOCUS_HOME = \"data-focus-home\";\n\n/** A home's attributes, as a view's heading spreads them: out of the tab order, focusable by script. */\nexport const FOCUS_HOME_PROPS = { tabIndex: -1, [FOCUS_HOME]: \"\" } as const;\n\n/** What a region's element spreads: its ref, and its focus and blur listeners. */\nexport interface FocusHomeRegion<E extends HTMLElement> {\n    /** The region's element. */\n    readonly ref: RefObject<E | null>;\n    /** Hears the focus enter the region, or move within it. */\n    readonly onFocus: () => void;\n    /** Hears the focus leave an element of the region. */\n    readonly onBlur: (event: FocusEvent<E>) => void;\n}\n\n/**\n * Keeps the keyboard in a region (see the module docs).\n *\n * @returns What the region's element spreads\n */\nexport function useFocusHome<E extends HTMLElement = HTMLDivElement>(): FocusHomeRegion<E> {\n    const ref = useRef<E | null>(null);\n    // Whether the keyboard is the region's: set as the focus enters it; let go as the focus leaves for another element, or\n    // for the page with the control it was on still there, and at a press outside it.\n    const held = useRef(false);\n    // Where the focus is on its way to in the region: named by the blur it leaves a control with, until it lands. Between\n    // the two the page's body has it, while the field it left commits its edit and the region is drawn again.\n    const going = useRef<Node | null>(null);\n    useEffect(() => {\n        const region = ref.current;\n        if (region === null || typeof MutationObserver === \"undefined\") return undefined;\n        const doc = region.ownerDocument;\n        // What the region shows drawn again: a control it held the focus on gone, the focus lands on the home it shows\n        // now — or on the one a later drawing shows, while this one shows none — unless it is on its way to a control\n        // still there.\n        const observer = new MutationObserver(() => {\n            if (!held.current) return;\n            const active = doc.activeElement;\n            if (active !== null && active !== doc.body) {\n                if (!region.contains(active)) held.current = false;\n                return;\n            }\n            const to = going.current;\n            if (to !== null && to.isConnected && region.contains(to)) return;\n            region.querySelector<HTMLElement>(`[${FOCUS_HOME}]`)?.focus();\n        });\n        observer.observe(region, { childList: true, subtree: true });\n        // A press outside the region is the viewer's move elsewhere, whatever it focuses — the page's body among it.\n        const onDown = (event: PointerEvent) => {\n            if (!(event.target instanceof Node) || !region.contains(event.target)) held.current = false;\n        };\n        doc.addEventListener(\"pointerdown\", onDown, true);\n        return () => {\n            observer.disconnect();\n            doc.removeEventListener(\"pointerdown\", onDown, true);\n        };\n    }, []);\n    const onFocus = useCallback(() => { held.current = true; going.current = null; }, []);\n    const onBlur = useCallback((event: FocusEvent<E>) => {\n        const next = event.relatedTarget;\n        if (next instanceof Node && ref.current?.contains(next) === true) {\n            going.current = next;\n            return;\n        }\n        going.current = null;\n        if (next !== null) {\n            held.current = false;\n            return;\n        }\n        // To the page: let go where the control is still there — a click on nothing — and kept where it went with its view.\n        const left = event.target;\n        queueMicrotask(() => { if (left.isConnected) held.current = false; });\n    }, []);\n    return { ref, onFocus, onBlur };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport type { ReactNode } from \"react\";\nimport { Box, type BoxProps } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { FOCUS_HOME_PROPS } from \"../focus-home.js\";\n\n/**\n * The shared Plan/Calendar inspector heading, using the inspector's existing recipe slots; `children` sit under its row, in\n * its section (the Allocation's bin actions). Given `home`, it is its view's home: where the keyboard lands as the control it\n * was on goes with the view (`focus-home.ts`, #1398), as every builder's Details takes it. Given `writes` — its view takes\n * edits — its marks' row stands while it holds neither a status nor a chip, kept a chip tall by the recipe\n * (`data-writes`), so a draft's chip arriving with the view's first edit moves nothing under it (#1584).\n */\nexport function ScheduleInspectorHead({ styles, kind, title, when, status, pending, writes = false, home = false, children }: {\n    styles: Record<string, BoxProps[\"css\"]>;\n    kind: { name: string; icon: string }; title: string; when: ReactNode;\n    status?: { label: string; tone: { type: string }; ring: boolean } | undefined;\n    pending?: \"pending\" | \"new\" | undefined;\n    writes?: boolean;\n    home?: boolean;\n    children?: ReactNode;\n}) {\n    return <Box css={styles.head} {...(home ? FOCUS_HOME_PROPS : {})}>\n        <Box css={styles.headRow}>\n            <Box as=\"span\" css={styles.kindTile} aria-hidden=\"true\"><FontAwesomeIcon icon={[\"fas\", kind.icon as IconName]} /></Box>\n            <Box css={styles.headText}>\n                <Box css={styles.eyebrow} data-inspector-kind=\"\">{kind.name}</Box>\n                <Box css={styles.name} data-inspector-title=\"\">{title}</Box>\n                <Box css={styles.when} data-inspector-when=\"\">{when}</Box>\n                {(status !== undefined || pending !== undefined || writes) && <Box css={styles.marks} data-inspector-marks=\"\" data-writes={writes ? \"\" : undefined}>\n                    {pending !== undefined && <Box as=\"span\" css={styles.chip} data-state={pending}>{pending === \"new\" ? \"New\" : \"Pending\"}</Box>}\n                    {status !== undefined && <Box as=\"span\" css={styles.status} data-tone={status.tone.type} data-ring={status.ring ? \"\" : undefined} data-inspector-status=\"\">{status.label}</Box>}\n                </Box>}\n            </Box>\n        </Box>\n        {children}\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Optional Calendar inspector: shared fields over the same Schedule drafts. An event's overlaps are the ones the toolbar\n * counts. A placement the event refuses — its start, its end, its resource — and a bulk edit the selection refuses go\n * back to what the fields hold, the reason under the field changed.\n *\n * It keeps the keyboard (#1398): a control that goes with the view it was pressed in — Delete, Return to backlog,\n * Duplicate, an overlapping event's link, Remove from selection, Delete selected — leaves the focus on the heading of the\n * view drawn in its place, Nothing selected's included (`../shared/focus-home.ts`), never on the page's body. An issue or\n * a warning gone to from the toolbar gives the keyboard to the field it names, as the form draws it\n * (`../shared/schedule/field-ask.tsx`).\n *\n * A number an event's row holds outside its field's bounds (#1585) is said in the tone its Save stands in: a warning\n * while the event stands as stored, an error once its session refuses its change, holding Save.\n *\n * A field an issue of the event names is ringed in whichever of its forms draws it, the issue's words under it (ruled\n * 13 Nov 2026), as the Roster's, the Allocation's and the Plan's are: gone to, the reason is where the keyboard is,\n * whatever of the banner over the forms is in view.\n *\n * What is selected is drawn a moment after what selected it (#1594): a drop's event shows on the board and the page paints,\n * then its Details draw in a render of their own, which a pointer's next move can break into, so a form's many fields\n * never hold up the drop itself.\n */\nimport { memo, useCallback, useDeferredValue, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { Box, Button, useSlotRecipe } from \"@chakra-ui/react\";\nimport { BlobType, decodeBeast2For, equalFor, fromEastTypeValue, isValueOf, isVariant, none, some, OptionType, StringType, StructType, type ValueTypeOf } from \"@elaraai/east\";\nimport { Fields, type FieldSpecValue } from \"@elaraai/east-ui\";\nimport { Schedule } from \"@elaraai/e3-ui/internal\";\nimport { BannerView, EastChakraComponent, FieldForm, useFormatters, useTrackedEvaluation, type BuilderFrameDock, type TrackedResult } from \"@elaraai/east-ui-components\";\nimport { FOCUS_HOME_PROPS, useFocusHome } from \"../shared/focus-home.js\";\nimport { ScheduleInspectorHead } from \"../shared/schedule/inspector-head.js\";\nimport { EMPTY_SCHEDULE_DRAFTS, heldRowOf, type ScheduleHeldRows } from \"../shared/schedule/editing.js\";\nimport { useFieldAsk } from \"../shared/schedule/field-ask.js\";\nimport { refusalText, refusedFields } from \"../shared/schedule/refusals.js\";\nimport type { ScheduleOverlaps } from \"../shared/schedule/overlaps.js\";\nimport { PagedChooser, pagedControl, useCalendarChooser } from \"./chooser.js\";\nimport { EventActions, PlacementFields, useCalendarFieldWords, type CalendarShownResources } from \"./controls.js\";\nimport { type CalendarCommands } from \"./actions.js\";\nimport { eventKey, parseResourceKey, resourceChoices, resourceKey, type CalendarItem, type CalendarKind, type CalendarRange, type CalendarRef, type CalendarResource, type CalendarStyles, type CalendarValue } from \"./model.js\";\n\nexport type Inspected = { kind: CalendarKind; item: CalendarItem; row: Uint8Array };\ninterface InspectorArgs {\n    value: CalendarValue; refs: readonly CalendarRef[]; range: CalendarRange; commands: CalendarCommands | undefined;\n    styles: CalendarStyles; storageKey: string; overlaps: ScheduleOverlaps<CalendarItem>; select: (refs: CalendarRef[]) => void;\n    /** Each resource kind's rows the rail shows: what the inspector's Choosers offer, with the event's own (#1343). */\n    shown: CalendarShownResources;\n}\n\n/**\n * The resources an event's reference fields name (`technician`): what their Choosers keep whatever the rail hides. A\n * field under a variant's case is read through the case the variant holds (#1549).\n */\nfunction referenced(specs: readonly FieldSpecValue[], row: unknown): CalendarResource[] {\n    return specs.flatMap(spec => {\n        if (spec.editor.type !== \"reference\") return [];\n        const at = spec.path.reduce<unknown>((value, name) => (isVariant(value) ? (stringEqual(value.type, name) ? value.value : undefined)\n            : (value as Readonly<Record<string, unknown>> | undefined)?.[name]), row);\n        let key: string | undefined;\n        if (spec.optional && isValueOf(at, OptionType(StringType))) {\n            const option = at as ValueTypeOf<OptionType<StringType>>;\n            if (option.type === \"some\") key = option.value;\n        } else if (isValueOf(at, StringType)) key = at as string;\n        return key === undefined ? [] : [{ kind: spec.editor.value.of, key }];\n    });\n}\n/** The selection as the inspector shows it: each selected event read, or why the read failed. */\nexport type CalendarSelection = TrackedResult<Inspected[]>;\n/** No selection read yet. */\nexport const NO_SELECTION: CalendarSelection = { ok: true, value: [] };\nconst itemEqual = equalFor(Schedule.Types.Item);\nconst rowEqual = equalFor(BlobType);\nconst stringEqual = equalFor(StringType);\n\n/** Whether two selections show alike: the same events, each read to the same row. */\nfunction sameSelection(a: CalendarSelection, b: CalendarSelection): boolean {\n    if (!a.ok || !b.ok) return !a.ok && !b.ok && Object.is(a.error, b.error);\n    return a.value.length === b.value.length && a.value.every((event, i) => {\n        const other = b.value[i]!;\n        return Object.is(event.kind, other.kind) && itemEqual(event.item, other.item) && rowEqual(event.row, other.row);\n    });\n}\n\n/**\n * Selected rows are read through the shared by-key seam, including paged records: a kind read by its cells (#1424) from\n * the rows they hold, else by its key — never over the window.\n */\nexport function useCalendarSelection(args: Pick<InspectorArgs, \"value\" | \"refs\" | \"range\" | \"commands\"> & { held: ScheduleHeldRows | undefined }): CalendarSelection {\n    const { value, refs, range, commands, held } = args;\n    const read = useCallback((): Inspected[] => {\n        return refs.flatMap(ref => {\n            const kind = value.events.find(kind => kind.key === ref.kind); if (kind === undefined) return [];\n            const event = kind.event(ref.key, commands?.editing.draftsOf(kind.key) ?? EMPTY_SCHEDULE_DRAFTS, range.from, range.to, heldRowOf(held, kind.key, ref.key));\n            return event.type === \"some\" ? [{ kind, ...event.value }] : [];\n        });\n    }, [value.events, refs, commands, range.from, range.to, held]);\n    const { result } = useTrackedEvaluation(read);\n    return result;\n}\n\n/**\n * The selection's read, in a component of its own (#1343): a selected event is read over the window, so each search\n * of a window read through an interval index re-runs it, and it hands the frame the selection only when what the\n * inspector shows moves.\n *\n * @param props - What the selection reads, and where it goes\n * @returns Nothing: it reads\n */\nexport function CalendarSelectionReader(props: Pick<InspectorArgs, \"value\" | \"refs\" | \"range\" | \"commands\"> & {\n    held: ScheduleHeldRows | undefined; onSelection: (selection: CalendarSelection) => void;\n}): null {\n    const selection = useCalendarSelection(props);\n    const reported = useRef<CalendarSelection | undefined>(undefined);\n    const { onSelection } = props;\n    useLayoutEffect(() => {\n        const was = reported.current;\n        if (was !== undefined && sameSelection(was, selection)) return;\n        reported.current = selection;\n        onSelection(selection);\n    });\n    return null;\n}\n/** What the inspector shows: the selection read, and what its views edit it through. */\ntype InspectorShown = InspectorArgs & { selection: CalendarSelection };\n/** The optional end pane displays the same by-key selection that commands edit. */\nexport function useCalendarInspector(args: InspectorShown): BuilderFrameDock | undefined {\n    const { value, refs, range, commands, styles: frameStyles, storageKey, overlaps, select, selection, shown } = args;\n    const recipe = useSlotRecipe({ key: \"planInspector\" });\n    const styles = useMemo(() => ({ ...frameStyles, ...recipe({}) }) as unknown as CalendarStyles, [frameStyles, recipe]);\n    // One object while what the pane shows holds: its body draws it a moment later, and a new one would draw it again for nothing.\n    const drawn = useMemo((): InspectorShown => ({ value, refs, range, commands, styles: frameStyles, storageKey, overlaps, select, selection, shown }),\n        [value, refs, range, commands, frameStyles, storageKey, overlaps, select, selection, shown]);\n    if (!value.inspector) return undefined;\n    const events = selection.ok ? selection.value : [];\n    return { label: \"Inspector\", icon: \"sliders\", badge: String(refs.length), size: \"320px\", persist: \"local\", detail: events.length === 1 ? events[0]!.item.title : undefined, active: refs.length > 0,\n        body: <InspectorBody args={drawn} styles={styles} />,\n    };\n}\n/** The pane's body: a region that keeps the keyboard as a control goes with its view, and what is selected drawn a moment after what selected it — see the module docs. */\nfunction InspectorBody({ args, styles }: { args: InspectorShown; styles: CalendarStyles }) {\n    const shown = useDeferredValue(args);\n    const home = useFocusHome();\n    return <Box ref={home.ref} css={styles.root} onFocus={home.onFocus} onBlur={home.onBlur} data-calendar-inspector=\"\">\n        <InspectorViews args={shown} styles={styles} />\n    </Box>;\n}\n/** What is selected: none, one event's Details or several's. Drawn only as it moves, never in the pass that moved it. */\nconst InspectorViews = memo(function InspectorViews({ args, styles }: { args: InspectorShown; styles: CalendarStyles }) {\n    const { refs, selection: result } = args;\n    const events = result.ok ? result.value : [];\n    return <>\n        {!result.ok && <Box role=\"alert\" css={args.styles.error}>The selected event could not be read.</Box>}\n        {events.length === 0 && <Box css={styles.empty} {...FOCUS_HOME_PROPS}><Box css={styles.emptyTitle}>{refs.length > 0 ? \"Reading selection…\" : \"Nothing selected\"}</Box><Box css={styles.emptyHint}>Select an event to inspect its schedule and fields.</Box></Box>}\n        {events.length === 1 && <OneEvent key={eventKey(events[0]!.item)} {...args} styles={styles} event={events[0]!} />}\n        {events.length > 1 && <ManyEvents {...args} styles={styles} events={events} />}\n    </>;\n});\n/**\n * Test-only render probe — lets \"an event's Details draw once what the drop made it has been drawn\" be asserted as the\n * Details' own renders (#1594). `undefined` outside tests.\n */\nlet detailsRenderProbe: (() => void) | undefined;\n/**\n * Install (or clear) the Details render probe. Test use only.\n *\n * @param fn - Called each time one event's Details render; `undefined` clears it\n */\nexport function setCalendarDetailsRenderProbe(fn: (() => void) | undefined): void {\n    detailsRenderProbe = fn;\n}\nfunction OneEvent({ event, value, shown, styles, commands, storageKey, range, overlaps, select }: InspectorArgs & { event: Inspected }) {\n    detailsRenderProbe?.();\n    const { kind, item } = event;\n    const format = useFormatters();\n    const rowType = useMemo(() => fromEastTypeValue(kind.editing.entryType) as StructType, [kind.editing.entryType]);\n    const row = useMemo(() => decodeBeast2For(rowType)(event.row), [rowType, event.row]);\n    // Each reference field's Chooser offers the rows the rail shows, and the event's own whatever it hides.\n    const options = useMemo(() => Object.fromEntries(resourceChoices(value.resources, shown, referenced(kind.fields, row))\n        .map(kind => [kind.key, kind.rows.map(row => ({ key: row.key, label: row.label }))])), [value.resources, shown, kind.fields, row]);\n    const roleNames = useMemo(() => [kind.schedule.title, ...(kind.schedule.status.type === \"some\" ? [kind.schedule.status.value] : [])], [kind.schedule]);\n    const roleSpecs = useMemo(() => Fields.specs(rowType, {}, Object.keys(rowType.fields).filter(field => !roleNames.includes(field))), [rowType, roleNames]);\n    const drafted = commands?.editing.draftsOf(kind.key).has(item.key) === true;\n    const baseline = commands?.editing.held(kind.key, item.key) ?? (drafted ? {} : row);\n    const onField = useCallback((path: readonly string[], next: unknown) => commands?.field(item, path, next), [commands, item]);\n    const fieldWords = useCalendarFieldWords(value);\n    // A reference field to the paged resource kind chooses by key, through the kind's own paged read (#1424).\n    const chooser = useCalendarChooser();\n    const fieldsReadOnly = commands === undefined || !commands.editing.available(kind.key);\n    const renderReference = useCallback((spec: FieldSpecValue) => {\n        if (chooser === undefined || spec.editor.type !== \"reference\" || spec.editor.value.of !== chooser.paged.kind) return undefined;\n        const held = referenced([spec], row)[0];\n        return <PagedChooser chooser={chooser} chosen={held?.key} readOnly={fieldsReadOnly}\n            onPick={key => onField(spec.path, spec.optional ? some(key) : key)} />;\n    }, [chooser, row, fieldsReadOnly, onField]);\n    const update = useCallback((bytes: Uint8Array): null => { commands?.editing.record([{ kind: kind.key, id: item.key, row: bytes }], \"typed\", `Edit ${item.title}`); return null; }, [commands, kind.key, item]);\n    const own = useMemo(() => {\n        if (commands === undefined || kind.inspector.type === \"none\") return undefined;\n        try { return { value: kind.inspector.value(event.row, update) }; }\n        catch { return { error: \"The custom inspector could not be rendered.\" }; }\n    }, [commands, kind.inspector, event.row, update]);\n    const peers = overlaps.peers.get(eventKey(item)) ?? [];\n    const session = commands?.editing.sessions.find(held => held.kind === kind.key)?.session;\n    const readiness = session?.readiness;\n    const issues = (readiness !== undefined && readiness.type !== \"ready\" ? readiness.value : session?.issues ?? []).filter(issue => issue.entry === item.key);\n    // A bound its row breaks (#1585), said in the tone its Save stands in: as stored it warns; its change refused, holding\n    // Save, it is an error.\n    const breaches = readiness !== undefined && readiness.type !== \"ready\" && readiness.value.some(issue => stringEqual(issue.entry, item.key)) ? \"error\" : \"warn\";\n    // Each field an issue names, ringed in whichever of its forms draws it, the issue's words under it.\n    const refused = refusedFields(issues);\n    // The field an issue or a warning gone to names takes the keyboard, in whichever of its forms draws it.\n    const focus = useFieldAsk(kind.key, item.key);\n    return <>\n        <ScheduleInspectorHead styles={styles} kind={kind} title={item.title}\n            when={item.start.type === \"some\" ? `${format.weekdayDate(item.start.value)} · ${format.time(item.start.value)}–${item.end.type === \"some\" ? format.time(item.end.value) : \"\"}` : value.vocabulary.unscheduled}\n            status={item.status.type === \"some\" ? item.status.value : undefined} pending={drafted ? commands?.editing.held(kind.key, item.key) === undefined ? \"new\" : \"pending\" : undefined}\n            writes={commands !== undefined} home />\n        {peers.length > 0 && <Box css={styles.section} data-calendar-inspector-overlaps=\"\"><Box css={styles.detail}>Overlaps {peers.length} event{peers.length === 1 ? \"\" : \"s\"}</Box>\n            {peers.map(peer => <Button key={eventKey(peer)} size=\"xs\" variant=\"ghost\" onClick={() => select([{ kind: peer.kind, key: peer.key }])}>{peer.title}</Button>)}\n        </Box>}\n        {/* Each field it names by its form's label, as the Roster's, the Allocation's and the Plan's do. In its section, as\n            the Plan's: standing alone in the pane's column, the banner was squeezed to its least height, its lines run out under it. */}\n        {issues.length > 0 && <Box css={styles.refusals} data-calendar-inspector-refusals=\"\">\n            <BannerView status=\"warning\" title={item.title} description={issues.map(issue => refusalText(issue, kind.fields)).join(\"; \")} />\n        </Box>}\n        <Box css={styles.fields}><Box css={styles.sectionHead}>Schedule</Box>\n        <FieldForm specs={roleSpecs} words={fieldWords} value={row} baseline={baseline} options={options} onChange={onField} readOnly={fieldsReadOnly} renderControl={chooser === undefined ? undefined : renderReference}\n            issues={refused} focus={focus} breaches={breaches} />\n        {commands !== undefined && item.start.type === \"some\" && item.end.type === \"some\" && <PlacementFields source={{ kind, item }} value={value} shown={shown} readOnly={!commands.editing.available(kind.key)}\n            placement={{ start: item.start.value, end: item.end.value, resource: item.resource }} onChange={at => commands.place({ kind, item }, at)} />}\n        {commands === undefined && <Box css={styles.detail}>{item.start.type === \"some\" ? `${format.dateTime(item.start.value)} – ${item.end.type === \"some\" ? format.dateTime(item.end.value) : \"\"}` : value.vocabulary.unscheduled}</Box>}\n        </Box>\n        <Box css={styles.fields}><Box css={styles.sectionHead}>{kind.name} fields</Box>\n        {own?.value !== undefined ? <EastChakraComponent value={own.value} storageKey={`${storageKey}.inspector.${kind.key}`} />\n            : <FieldForm specs={kind.fields.filter(field => !roleNames.includes(field.path[0]!))} words={fieldWords} value={row} baseline={baseline} options={options} onChange={onField} readOnly={fieldsReadOnly}\n                renderControl={chooser === undefined ? undefined : renderReference} issues={refused} focus={focus} breaches={breaches} />}\n        </Box>\n        {own?.error !== undefined && <Box role=\"alert\" css={styles.error}>{own.error}</Box>}\n        {commands !== undefined && <EventActions item={item} value={value} shown={shown} commands={commands} day={range.from} styles={styles} />}\n    </>;\n}\nfunction ManyEvents({ events, commands, styles, select, value, shown }: InspectorArgs & { events: Inspected[] }) {\n    const [error, setError] = useState<string>();\n    const items = events.map(event => event.item);\n    return <>\n        <Box css={styles.head} {...FOCUS_HOME_PROPS}><Box css={styles.summary}>{events.length} events</Box></Box>\n        {events.map(event => <Button key={eventKey(event.item)} size=\"xs\" variant=\"ghost\" onClick={() => select(events.filter(other => other !== event).map(other => ({ kind: other.item.kind, key: other.item.key })))}>{event.item.title} · Remove from selection</Button>)}\n        {commands !== undefined && <Box css={styles.bulk}><Box css={styles.sectionHead}>Bulk edit</Box><BulkFields events={events} value={value} shown={shown} commands={commands} onEdit={() => setError(undefined)} /></Box>}\n        {commands !== undefined && <Box css={styles.actions}>\n            {[-24, -1, 1, 24].map(hours => <Button key={hours} size=\"xs\" variant=\"outline\" disabled={events.some(event => !commands.editing.available(event.kind.key))} onClick={() => setError(commands.move(items, hours * 3_600_000))}>{hours > 0 ? \"+\" : \"\"}{hours} h</Button>)}\n            <Button size=\"xs\" variant=\"outline\" disabled={events.some(event => !commands.editing.available(event.kind.key))} onClick={() => setError(commands.duplicate(items))}>Duplicate selected</Button>\n            <Button size=\"xs\" variant=\"outline\" disabled={events.some(event => !commands.editing.available(event.kind.key))} onClick={() => commands.remove(items)}>Delete selected</Button>\n        </Box>}\n        {error !== undefined && <Box role=\"alert\" css={styles.error}>{error}</Box>}\n    </>;\n}\n\nconst BulkType = StructType({ resource: OptionType(StringType), status: OptionType(StringType) });\nconst BULK_SPECS = Fields.specs(BulkType, { resource: Fields.reference({ of: \"resources\" }), status: Fields.reference({ of: \"statuses\" }) });\n/** Whether a bulk edit's field is its resource. */\nconst isBulkResource = (spec: FieldSpecValue) => spec.path[0] === \"resource\";\n/**\n * Bulk edits retain each event's type and pass through the same checked commands; their resource Chooser offers the\n * rows the rail shows — or, for events every one of which is placed on the paged resource kind, searches it by key (#1424).\n * One the selection refuses goes back, the reason under its field; each edit tells `onEdit`, which clears what the\n * selection's actions last said.\n */\nfunction BulkFields({ events, value, shown, commands, onEdit }: { events: Inspected[]; value: CalendarValue; shown: CalendarShownResources; commands: CalendarCommands; onEdit: () => void }) {\n    const items = events.map(event => event.item);\n    const statuses = events[0]!.kind.status.filter(status => events.every(event => event.kind.status.some(other => other.case === status.case)));\n    const resources = resourceChoices(value.resources, shown, []).filter(kind => events.every(event => event.kind.takes.includes(kind.key)));\n    const options = { statuses: statuses.map(status => ({ key: status.case, label: status.status.label })),\n        resources: resources.flatMap(kind => kind.rows.map(row => ({ key: resourceKey({ kind: kind.key, key: row.key }), label: row.label }))) };\n    const form: ValueTypeOf<typeof BulkType> = { resource: none, status: none };\n    const readOnly = events.some(event => !commands.editing.available(event.kind.key));\n    const chooser = useCalendarChooser();\n    const paged = chooser !== undefined && resources.some(kind => kind.key === chooser.paged.kind) ? chooser : undefined;\n    // Its resource in the app's word for one (#1516), as a single event's placement says it.\n    const resourceWord = value.vocabulary.resources.one;\n    const specs = useMemo(() => BULK_SPECS.map(spec => (isBulkResource(spec) ? { ...spec, label: resourceWord } : spec)), [resourceWord]);\n    const fieldWords = useCalendarFieldWords(value);\n    // A resource picked is the field's own edit, so one the selection refuses is said under it.\n    const renderControl = useCallback((spec: FieldSpecValue, change: (next: unknown) => void) => pagedControl(paged, spec, isBulkResource, undefined,\n        key => { if (paged !== undefined) change(resourceKey({ kind: paged.paged.kind, key })); }, readOnly),\n    [paged, readOnly]);\n    return <FieldForm specs={specs.filter(spec => spec.path[0] === \"status\" ? statuses.length > 0 : resources.length > 0)} value={form} options={options} words={fieldWords}\n        renderControl={paged === undefined ? undefined : renderControl} readOnly={readOnly} onChange={(path, next) => {\n            onEdit();\n            const picked = next as ValueTypeOf<OptionType<StringType>>;\n            if (path[0] === \"status\" && picked.type === \"some\") return commands.status(items, picked.value);\n            if (path[0] === \"resource\") {\n                const parsed = picked.type === \"some\" ? parseResourceKey(picked.value) : undefined;\n                if (parsed?.success) return commands.move(items, 0, some(parsed.value));\n                if (picked.type === \"none\") return commands.move(items, 0, none);\n            }\n            return undefined;\n        }} />;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Calendar's message table: the editing session's words — the history\n * item's and its banners', every editable collection's (`EditingMessages`) —\n * and the Calendar's own that are no noun of the app's: what Search Records\n * searches, the event kinds' keys (#1398) — its views name an event by its\n * title, which the box never finds it by — what it says where no key\n * matches, and what its line says of an event the rail's narrowing hides (the\n * shared hidden pick's words, `HiddenWords`). The app's nouns — a kind's\n * name, a resource kind's — are the payload's. English is the default; the\n * frame hands it to its parts as its words' `m`, as the Allocation's does.\n *\n * @packageDocumentation\n */\n\nimport { editingMessages, type EditingMessages, type Formatters } from \"@elaraai/east-ui-components\";\nimport { hiddenByText, type HiddenWords } from \"../shared/schedule/words.js\";\n\n/** The Calendar's message table. */\nexport interface CalendarMessages extends EditingMessages, HiddenWords {\n    /**\n     * Search Records' box's placeholder, its icon's accessible name and the head of the popover it opens: what it searches\n     * — `Search events by key`.\n     */\n    keySearch: () => string;\n    /** What the box says when no event's key matches what is typed: that it finds an event by its key. */\n    keySearchNoMatches: () => string;\n}\n\n/** The English table — the default. */\nexport const calendarMessages: CalendarMessages = {\n    ...editingMessages,\n    keySearch: () => \"Search events by key\",\n    keySearchNoMatches: () => \"No matching events. Search by an event's key.\",\n    hiddenByFilters: () => \"hidden by the filters\",\n    hiddenBy: ({ filters, also }) => hiddenByText(filters, also),\n};\n\n/** The words the Calendar speaks: its message table, and its locale's formatters. */\nexport interface CalendarWords extends Formatters {\n    /** The message table in effect. */\n    m: CalendarMessages;\n    /** What the Calendar calls its backlog in running text (#1516): `backlog` unless the app says otherwise. */\n    backlog?: string | undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The diff of a run's result against its request, by entry key (#1409,\n * #1415; `Optimise Spec.md` §6 \"The one step\", §9.2 R7): absent → present is\n * an add, a different row a change — a move, to another day, time, lane,\n * hour or resource, is a change of placement — and present → absent a\n * remove. Untouched entries are not in the edit; entries outside the scope\n * are never touched. The diff becomes the builder's changes — `{ kind, id,\n * row, created }`, `{ kind, id, row }`, `{ kind, id, remove }` — for one\n * `record` call, and the operations the landing draws and the provenance\n * says (`data-op`, `Was {previous} · Elara run #n`), kept until Apply.\n *\n * @packageDocumentation\n */\n\nimport { encodeBeast2For, equalFor, parseFor, printFor, type EastType } from \"@elaraai/east\";\nimport type { ScheduleChange } from \"../schedule/editing.js\";\nimport type { OptimiseCounts } from \"./use-optimise.js\";\n\n/**\n * One operation of a run on an entry (R7): what it did, and the row before\n * it, for the provenance.\n *\n * @typeParam R - The entry's row\n */\nexport type OptimiseOp<R = unknown> =\n    | { readonly kind: string; readonly op: \"add\"; readonly row: R }\n    | { readonly kind: string; readonly op: \"chg\"; readonly row: R; readonly previous: R }\n    | { readonly kind: string; readonly op: \"del\"; readonly previous: R };\n\n/**\n * A run's diff: its changes for one `record`, its operations by entry, and\n * what it counted.\n *\n * @typeParam R - The entries' row\n */\nexport interface OptimiseDiff<R = unknown> {\n    readonly changes: readonly ScheduleChange[];\n    /** Each operation, under {@link opKey}. */\n    readonly ops: ReadonlyMap<string, OptimiseOp<R>>;\n    readonly counts: OptimiseCounts;\n}\n\n/** No operations. */\nexport const NO_OPTIMISE_DIFF: OptimiseDiff<never> = { changes: [], ops: new Map(), counts: { added: 0, changed: 0, removed: 0 } };\n\n/**\n * The key an entry's operation is kept under: its kind and its id, so two\n * kinds' entries of one id never meet.\n *\n * @param kind - The kind's slot, or the record's key\n * @param id - The entry's key's text\n * @returns The key\n */\nexport function opKey(kind: string, id: string): string {\n    return `${kind}\\u0000${id}`;\n}\n\n/**\n * An entry's key as its session names it: a String key as it is, any other\n * as East prints it — what a Schedule session's ids are.\n *\n * @param keyType - The record's key type\n * @returns The key's text\n */\nexport function optimiseIdOf<K>(keyType: EastType): (key: K) => string {\n    if (keyType.type === \"String\") return (key) => key as unknown as string;\n    const print = printFor(keyType) as (key: K) => string;\n    return (key) => print(key);\n}\n\n/**\n * An entry's key from its id, as its session names it: a String key is its\n * own id, any other is read from East's text of it — {@link optimiseIdOf}'s\n * inverse, for the rows a request carries by key.\n *\n * @param keyType - The record's key type\n * @returns The key; `undefined` for an id that names no key of the type\n */\nexport function optimiseKeyOf<K>(keyType: EastType): (id: string) => K | undefined {\n    if (keyType.type === \"String\") return (id) => id as unknown as K;\n    const parse = parseFor(keyType) as (text: string) => { success: true; value: K } | { success: false };\n    return (id) => {\n        const read = parse(id);\n        return read.success ? read.value : undefined;\n    };\n}\n\n/**\n * The diff of one kind's rows, result against request (R7).\n *\n * @typeParam K - The key\n * @typeParam R - The row\n * @param kind - The kind's slot, or the record's key: what the changes name\n * @param rowType - The row's East type: how a row is compared and encoded\n * @param idOf - An entry's key as its session names it ({@link optimiseIdOf})\n * @param before - The rows asked, by key\n * @param after - The rows answered, by key\n * @returns The diff\n */\nexport function diffOptimiseRows<K, R>(kind: string, rowType: EastType, idOf: (key: K) => string, before: ReadonlyMap<K, R>, after: ReadonlyMap<K, R>): OptimiseDiff<R> {\n    const same = equalFor(rowType) as (a: R, b: R) => boolean;\n    const encode = encodeBeast2For(rowType) as (row: R) => Uint8Array;\n    const changes: ScheduleChange[] = [];\n    const ops = new Map<string, OptimiseOp<R>>();\n    let added = 0, changed = 0, removed = 0;\n    for (const [key, row] of after) {\n        const id = idOf(key);\n        const was = before.get(key);\n        if (was === undefined) {\n            changes.push({ kind, id, row: encode(row), created: true });\n            ops.set(opKey(kind, id), { kind, op: \"add\", row });\n            added++;\n        } else if (!same(was, row)) {\n            changes.push({ kind, id, row: encode(row) });\n            ops.set(opKey(kind, id), { kind, op: \"chg\", row, previous: was });\n            changed++;\n        }\n    }\n    for (const [key, was] of before) {\n        if (after.has(key)) continue;\n        const id = idOf(key);\n        changes.push({ kind, id, remove: true });\n        ops.set(opKey(kind, id), { kind, op: \"del\", previous: was });\n        removed++;\n    }\n    return { changes, ops, counts: { added, changed, removed } };\n}\n\n/**\n * A diff's operations told by the entries' places (§9.5): on a builder whose\n * entries have a place against a backlog — the Calendar's and the Plan's\n * canvas — an entry the run gave a place is an add on the canvas, whatever\n * its key did, and one the run took off its place is a remove, its ghost\n * where it stood; an entry moved, or changed in place, stays a change. The\n * session's changes are the diff's own: an entry the request held is\n * rewritten, never created.\n *\n * @typeParam R - The row\n * @param diff - The diff by key\n * @param placed - Whether a row has a place: a scheduled event, a placed job\n * @returns The diff, its operations and counts told by place\n */\nexport function optimisePlacementOps<R>(diff: OptimiseDiff<R>, placed: (row: R) => boolean): OptimiseDiff<R> {\n    const ops = new Map<string, OptimiseOp<R>>();\n    let added = 0, changed = 0, removed = 0;\n    for (const [key, op] of diff.ops) {\n        let told: OptimiseOp<R> = op;\n        if (op.op === \"chg\") {\n            const was = placed(op.previous), now = placed(op.row);\n            if (!was && now) told = { kind: op.kind, op: \"add\", row: op.row };\n            else if (was && !now) told = { kind: op.kind, op: \"del\", previous: op.previous };\n        }\n        ops.set(key, told);\n        if (told.op === \"add\") added++; else if (told.op === \"chg\") changed++; else removed++;\n    }\n    return { changes: diff.changes, ops, counts: { added, changed, removed } };\n}\n\n/**\n * Several kinds' diffs as one: one `record` call across every record the\n * builder writes (R8).\n *\n * @param diffs - Each kind's diff\n * @returns The one diff\n */\nexport function mergeOptimiseDiffs<R>(diffs: readonly OptimiseDiff<R>[]): OptimiseDiff<R> {\n    const changes: ScheduleChange[] = [];\n    const ops = new Map<string, OptimiseOp<R>>();\n    let added = 0, changed = 0, removed = 0;\n    for (const diff of diffs) {\n        changes.push(...diff.changes);\n        for (const [key, op] of diff.ops) ops.set(key, op);\n        added += diff.counts.added; changed += diff.counts.changed; removed += diff.counts.removed;\n    }\n    return { changes, ops, counts: { added, changed, removed } };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Optimise in the Calendar (#1409, #1417; `Optimise Spec.md` §5.1, §9.5, R24):\n * the window in view and its backlog as the run's request — every event kind's\n * rows in the window and its backlog by slot and by key, as the session holds\n * them, drafts in place, and every resource kind's rows as context — and the\n * result landed on the calendar's events as one edit: the diff by key, kind\n * by kind, recorded as one step (`ScheduleEditing.record`, origin\n * `optimise`), and the operations the landing draws — an add on the canvas,\n * a change with a ghost where the event was, a remove — kept until Apply.\n *\n * @packageDocumentation\n */\n\nimport { DictType, SortedMap, StringType, compareFor, decodeBeast2For, fromEastTypeValue, type EastType } from \"@elaraai/east\";\nimport { ScheduleOptimiseRequestTypeFor, ScheduleOptimiseResultTypeFor, scheduleOptimiseRows } from \"@elaraai/e3-ui/internal\";\nimport { diffOptimiseRows, mergeOptimiseDiffs, opKey, optimiseIdOf, optimiseKeyOf, optimisePlacementOps, type OptimiseOp } from \"../shared/func/optimise-diff.js\";\nimport type { OptimiseCounts } from \"../shared/func/use-optimise.js\";\nimport type { ScheduleEditing } from \"../shared/schedule/editing.js\";\nimport { rowCodec } from \"../shared/schedule/records.js\";\nimport type { CalendarCommands } from \"./actions.js\";\nimport type { CalendarItem, CalendarKind, CalendarRange, CalendarValue } from \"./model.js\";\n\n/** A kind's rows by key, as the request and the result carry them. */\ntype Rows = SortedMap<unknown, unknown>;\n\n/** The run's request: the window, the run's number, each event kind's rows by slot, and each resource kind's. */\nexport interface CalendarOptimiseRequest {\n    readonly from: Date;\n    readonly to: Date;\n    readonly run: bigint;\n    readonly events: Readonly<Record<string, Rows>>;\n    readonly resources: Readonly<Record<string, Rows>>;\n}\n\n/** The run's answer: each event kind's rows by slot, complete. */\nexport interface CalendarOptimiseResult {\n    readonly events: Readonly<Record<string, Rows>>;\n}\n\n/** One operation a run left on an event, and the run that made it — its provenance's `run #n`. */\nexport type CalendarOp = OptimiseOp & { readonly run: string };\n\n/**\n * What the runs left on the Calendar's events, until Apply (R17): each\n * operation by event (`opKey`), a later run's over an earlier's on the same\n * event, and where a removed or a moved event stood before its run — its\n * ghost's place.\n */\nexport interface CalendarOptimised {\n    /** Each operation, under `opKey(kind, id)`, with the run that made it. */\n    readonly ops: ReadonlyMap<string, CalendarOp>;\n    /** Each changed or removed event as it stood before its run, under `opKey(kind, id)`. */\n    readonly previous: ReadonlyMap<string, CalendarItem>;\n    /** Whether the latest run moved an event into or out of the backlog: the Backlog tab's count flashes. */\n    readonly backlogChanged: boolean;\n}\n\n/** A kind's key and row types, from the kind on the wire. */\nfunction typesOf(kind: { readonly editing: CalendarKind[\"editing\"] }): { keyType: EastType; rowType: EastType } {\n    return {\n        keyType: kind.editing.keyType.type === \"some\" ? fromEastTypeValue(kind.editing.keyType.value) as EastType : StringType,\n        rowType: fromEastTypeValue(kind.editing.entryType) as EastType,\n    };\n}\n\n/**\n * The request and result types over the Calendar's kinds: what the bound\n * optimiser is called with, as the tag held it to.\n *\n * @param value - The payload\n * @returns The request and result East types\n */\nexport function calendarOptimiseTypes(value: CalendarValue): { request: EastType; result: EastType } {\n    const events = scheduleOptimiseRows(value.events.map((kind) => [kind.key, typesOf(kind)] as const));\n    const resources = scheduleOptimiseRows(value.resources.map((kind) => [kind.key, { keyType: fromEastTypeValue(kind.keyType) as EastType, rowType: fromEastTypeValue(kind.rowType) as EastType }] as const));\n    return { request: ScheduleOptimiseRequestTypeFor(events, resources), result: ScheduleOptimiseResultTypeFor(events) };\n}\n\n/**\n * The run's request (R1, R24, O3, O5): the window, the run's number, every\n * event kind's rows in the window and its backlog by key, as the session\n * holds them — base plus every unapplied draft, every row whatever the rail\n * shows — and every resource kind's rows, read whole.\n *\n * @param value - The payload\n * @param editing - The editing: where each event's row is read, drafts in place\n * @param range - The window in view\n * @param items - The window's events, as read\n * @param backlog - The kinds' backlog, as read\n * @param run - The run's number\n * @returns The request\n */\nexport function calendarOptimiseRequest(value: CalendarValue, editing: ScheduleEditing, range: CalendarRange, items: readonly CalendarItem[],\n    backlog: readonly CalendarItem[], run: number): CalendarOptimiseRequest {\n    const events: Record<string, Rows> = {};\n    for (const kind of value.events) {\n        const { keyType } = typesOf(kind);\n        const key = optimiseKeyOf(keyType);\n        const decode = rowCodec(kind.editing.entryType);\n        const rows: Rows = new SortedMap([], compareFor(keyType) as (a: unknown, b: unknown) => number);\n        for (const item of [...items, ...backlog]) {\n            if (item.kind !== kind.key) continue;\n            const read = editing.read(kind.key, item.key);\n            const at = key(item.key);\n            if (read === undefined || at === undefined) continue;\n            rows.set(at, decode.decode(read.row));\n        }\n        events[kind.key] = rows;\n    }\n    const resources: Record<string, Rows> = {};\n    for (const kind of value.resources) {\n        const keyType = fromEastTypeValue(kind.keyType) as EastType;\n        const rowType = fromEastTypeValue(kind.rowType) as EastType;\n        const compare = compareFor(keyType) as (a: unknown, b: unknown) => number;\n        if (kind.records.type === \"none\") { resources[kind.key] = new SortedMap([], compare); continue; }\n        // The kind's records read whole, as the run starts: its rows by key, as the request carries them.\n        const decoded = decodeBeast2For(DictType(keyType, rowType))(kind.records.value()) as ReadonlyMap<unknown, unknown>;\n        resources[kind.key] = decoded instanceof SortedMap ? decoded : new SortedMap([...decoded], compare);\n    }\n    return { from: range.from, to: range.to, run: BigInt(run), events, resources };\n}\n\n/**\n * Where an event's day and place are told from, for a ghost: the event as it\n * stood before the run, among the window's events and the backlog.\n */\nfunction itemOf(kind: string, id: string, items: readonly CalendarItem[], backlog: readonly CalendarItem[]): CalendarItem | undefined {\n    return items.find((item) => item.kind === kind && item.key === id) ?? backlog.find((item) => item.kind === kind && item.key === id);\n}\n\n/**\n * The result landed (R7, R8, R10, §12): diffed against the request by key,\n * kind by kind, and recorded as one step of the history, origin `optimise`.\n * The operations the landing draws are told by place (§9.5): a backlog row\n * the result gives a time is an add on the canvas, a scheduled event it takes\n * back to the backlog a remove, a moved event a change with a ghost at its old\n * slot. A result that answers no rows for a kind the request asked is\n * invalid, and nothing is recorded. A result that changes nothing records\n * nothing and leaves what earlier runs left as it is (R10); one that does\n * lays its operations over theirs.\n *\n * @param value - The payload\n * @param editing - The editing the step is recorded in\n * @param request - The request the result answers\n * @param result - The result\n * @param label - The step's label — `Elara run #7`\n * @param items - The window's events as they stood before the run: where a ghost goes\n * @param backlog - The backlog as it stood before the run\n * @param runText - The run's number, formatted, for the provenance\n * @param before - What earlier runs left on the events, still the session's drafts\n * @returns What the run counted, and what the runs have left on the events — unchanged by a run that changed nothing; `undefined` for an invalid result, or one the session would not take\n */\nexport function landCalendarOptimise(value: CalendarValue, editing: ScheduleEditing, request: CalendarOptimiseRequest, result: CalendarOptimiseResult,\n    label: string, items: readonly CalendarItem[], backlog: readonly CalendarItem[], runText: string, before: CalendarOptimised | undefined,\n): { counts: OptimiseCounts; optimised: CalendarOptimised | undefined } | undefined {\n    const diffs = [];\n    let backlogChanged = false;\n    const previous = new Map<string, CalendarItem>();\n    for (const kind of value.events) {\n        const before = request.events[kind.key];\n        const after = result.events[kind.key];\n        if (before === undefined || after === undefined) return undefined;\n        const { keyType, rowType } = typesOf(kind);\n        const startField = kind.schedule.start;\n        const unscheduled = (row: unknown): boolean => {\n            const start = (row as Record<string, { type: string }>)[startField];\n            return start !== undefined && start.type === \"none\";\n        };\n        const diff = optimisePlacementOps(diffOptimiseRows(kind.key, rowType, optimiseIdOf(keyType), before as ReadonlyMap<unknown, unknown>, after as ReadonlyMap<unknown, unknown>),\n            (row) => !unscheduled(row));\n        diffs.push(diff);\n        for (const [key, op] of diff.ops) {\n            const id = key.slice(kind.key.length + 1);\n            const was = itemOf(kind.key, id, items, backlog);\n            if (was !== undefined && op.op !== \"add\") previous.set(key, was);\n            if ((was !== undefined && was.start.type === \"none\") || (\"row\" in op && unscheduled(op.row))) backlogChanged = true;\n        }\n    }\n    const merged = mergeOptimiseDiffs(diffs);\n    if (merged.changes.length === 0) return { counts: merged.counts, optimised: undefined };\n    if (!editing.record(merged.changes, \"optimise\", label)) return undefined;\n    // This run's operations over the earlier runs': an event it touched again is its, with where it stood before this run.\n    const ops = new Map<string, CalendarOp>(before?.ops ?? []);\n    for (const [key, op] of merged.ops) ops.set(key, { ...op, run: runText });\n    const kept = new Map<string, CalendarItem>(before?.previous ?? []);\n    for (const key of merged.ops.keys()) kept.delete(key);\n    for (const [key, was] of previous) kept.set(key, was);\n    return { counts: merged.counts, optimised: { ops, previous: kept, backlogChanged } };\n}\n\n/** The operation a run left on an event, if any, with the run that made it: what its block draws and its hover says. */\nexport function calendarOpOf(optimised: CalendarOptimised | undefined, item: Pick<CalendarItem, \"kind\" | \"key\">): CalendarOp | undefined {\n    return optimised?.ops.get(opKey(item.kind, item.key));\n}\n\n/**\n * The commands while a run is out (R2): every gesture refused with the one\n * reason, the session they read kept — so the views keep drawing their drafts,\n * and the inspector stays live, while nothing is written.\n *\n * @param commands - The commands\n * @param refusal - Why a gesture is refused — `Elara is optimising Oct 5 – 9`\n * @returns The commands, locked\n */\nexport function lockCalendarCommands(commands: CalendarCommands, refusal: string): CalendarCommands {\n    return {\n        editing: commands.editing,\n        place: () => refusal,\n        move: () => refusal,\n        remove: () => undefined,\n        unschedule: () => refusal,\n        duplicate: () => refusal,\n        status: () => refusal,\n        field: () => undefined,\n        patch: () => undefined,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The sources of the Calendar's slice, place by place (#1343). An event kind's\n * source narrows the kind's own reads, so its events in every layout and its\n * backlog follow it — what its choices hide of the backlog is the shared\n * `useBacklogNarrowing`'s (`shared/schedule/backlog.ts`, which the Plan reads\n * too); the Calendar follows the others itself — each resource kind's, whose\n * rows narrow the columns, the timeline's rows and the resource Choosers; each\n * templates list's, whose keys narrow the Templates tab; and each source an\n * app's tab names. Overlaps and checks read every event.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport type { KeyVisibilityWords } from \"../shared/schedule/visibility.js\";\nimport { lowerWord } from \"../shared/schedule/words.js\";\nimport type { CalendarValue } from \"./model.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * The sources the Calendar follows beside its event kinds': each resource\n * kind's the slice holds, each templates list's and each one an app's tab\n * names — each once, in that order. A paged resource kind's source is followed\n * by none (#1424): it narrows the kind's windows themselves (`pages.ts`), so no\n * key of it is scanned.\n *\n * @param value - The payload\n * @returns The sources' names\n */\nexport function followedSources(value: CalendarValue): string[] {\n    const parts = value.slice.type === \"some\" ? value.slice.value.slice.parts : [];\n    const held = (name: string) => parts.some(part => stringEqual(part.source, name));\n    const paged = (name: string) => value.paged.type === \"some\" && stringEqual(value.paged.value.kind, name);\n    const named = [\n        ...value.resources.map(kind => kind.key).filter(name => held(name) && !paged(name)),\n        ...value.events.flatMap(kind => kind.templatesSource.type === \"some\" ? [kind.templatesSource.value] : []),\n        ...value.library.flatMap(tab => tab.type === \"tab\" && tab.value.source.type === \"some\" ? [tab.value.source.value] : []),\n    ];\n    return named.filter((name, i) => named.findIndex(other => stringEqual(other, name)) === i);\n}\n\n/**\n * What the rail counts each source in, and heads it with folded, where the\n * source has no label of its own: an event kind's events (`production\n * events`), a kind's templates, a resource kind's name, a tab's — each as\n * running text writes it, the first that names a source keeping it.\n *\n * @param value - The payload\n * @param locale - The app's locale\n * @returns Each source's noun, by its name\n */\nexport function calendarNouns(value: CalendarValue, locale: string): Record<string, string> {\n    const lower = (text: string) => text.toLocaleLowerCase(locale);\n    const nouns: Record<string, string> = {};\n    for (const kind of value.events) nouns[kind.key] ??= `${lower(kind.name)} events`;\n    for (const kind of value.events) if (kind.templatesSource.type === \"some\") nouns[kind.templatesSource.value] ??= `${lower(kind.name)} ${lowerWord(value.vocabulary.templates)}`;\n    for (const kind of value.resources) nouns[kind.key] ??= lower(kind.name);\n    for (const tab of value.library) if (tab.type === \"tab\" && tab.value.source.type === \"some\") nouns[tab.value.source.value] ??= lower(tab.value.name);\n    return nouns;\n}\n\n/**\n * What a source's failed narrowing says, by its name.\n *\n * @param name - The source's name, as its banner says it\n * @returns Its results moved while read, or could not be read\n */\nexport function calendarSaid(name: string): KeyVisibilityWords {\n    return { changed: `${name.charAt(0).toLocaleUpperCase()}${name.slice(1)} results changed; retry the narrowing.`, failed: `Could not load ${name} results` };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Accessible segment controls shared by Plan and Calendar toolbars. */\nimport { useMemo, type KeyboardEvent } from \"react\";\nimport { Box, chakra, Menu as ChakraMenu, useRecipe, useSlotRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCaretDown, type IconDefinition } from \"@fortawesome/free-solid-svg-icons\";\nimport { coarseHitArea, FrameMenuLayer, radioGroupKey } from \"@elaraai/east-ui-components/internal\";\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** A segment strip's props — shared by the strip and its one-chip menu. */\ninterface SegProps<K extends string> {\n    /** What the strip picks — its radio group's (the menu's) accessible name. */\n    label: string;\n    /** Which strip it is, as `data-plan-seg` (`data-plan-segmenu`) says. */\n    name: string;\n    /** Host name for DOM measurements. */\n    scope?: string;\n    /** The segments, in order. */\n    items: ReadonlyArray<{ key: K; label: string; disabled?: boolean | undefined; hint?: string | undefined; icon?: IconDefinition | undefined }>;\n    /** The checked segment's key — any other string checks none. */\n    active: string;\n    /** Fills the available strip width with equal segments; folded menus keep their intrinsic size. */\n    fullWidth?: boolean;\n    /** Each segment that has an icon shows its icon alone, named by its label: a row short of room's narrower strip. */\n    iconsOnly?: boolean;\n    /** Picks a segment. */\n    onPick: (key: K) => void;\n}\n\n/**\n * The compact chrome segment strip (`seg` recipe) — a radio group (#632).\n * It is ONE tab stop, on the checked segment (the first while none is);\n * ← / → and Home / End move between the segments and pick the one they land\n * on, as the WAI-ARIA radio group pattern has it, and a click, Enter or Space\n * picks the one it is on.\n */\nexport function Seg<K extends string>({ label, name, scope = \"plan\", items, active, fullWidth = false, iconsOnly = false, onPick }: SegProps<K>) {\n    const seg = useSlotRecipe({ key: \"seg\" });\n    const ss = useMemo(() => seg({ fullWidth }) as unknown as Styles, [seg, fullWidth]);\n    const stop = items.some((it) => it.key === active && !it.disabled) ? active : items.find(it => !it.disabled)?.key;\n    // The radio group's keys (shared with the Sheet's context switch): handled, so the canvas's own keys skip them.\n    const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n        radioGroupKey(e, (j) => {\n            const it = items[j];\n            if (it !== undefined && !it.disabled && it.key !== active) onPick(it.key);\n        });\n    };\n    return (\n        <Box css={ss.root} data-slot=\"seg\" {...{ [`data-${scope}-seg`]: name }} role=\"radiogroup\" aria-label={label} onKeyDown={onKeyDown}>\n            {items.map((it) => {\n                // Its icon alone, named by its label, on a strip short of room.\n                const bare = iconsOnly && it.icon !== undefined;\n                return (\n                    <chakra.button key={it.key} type=\"button\" css={ss.item} role=\"radio\"\n                        disabled={it.disabled} title={bare ? (it.hint ?? it.label) : it.hint} aria-checked={it.key === active} tabIndex={it.key === stop ? 0 : -1}\n                        data-state={it.key === active ? \"on\" : undefined}\n                        {...(bare ? { \"aria-label\": it.label } : {})}\n                        onClick={() => onPick(it.key)}>\n                        {it.icon !== undefined && <FontAwesomeIcon icon={it.icon} aria-hidden=\"true\" {...(bare ? {} : { \"data-seg-icon\": \"\" })} />}\n                        {!bare && it.label}\n                    </chakra.button>\n                );\n            })}\n        </Box>\n    );\n}\n\n/**\n * A segment strip folded into one chip (#952) — the checked segment and a\n * caret, Font Awesome's (#1263), opening a menu of every segment; picking one\n * does what the strip's press does. The toolbar's segments take this form\n * once the row is short of room.\n */\nexport function SegMenu<K extends string>({ label, name, scope = \"plan\", items, active, onPick }: SegProps<K>) {\n    const chip = useRecipe({ key: \"chip\" });\n    const current = items.find((it) => it.key === active);\n    return (\n        <ChakraMenu.Root onSelect={(d) => {\n            const it = items.find((x) => x.key === d.value);\n            if (it !== undefined && !it.disabled) onPick(it.key);\n        }}>\n            <ChakraMenu.Trigger asChild>\n                {/* A 44px touch target on a coarse pointer, by its halo: the row keeps its height (#346, #1221). */}\n                <chakra.button type=\"button\" css={[chip({ tone: \"neutral\" }), coarseHitArea({ position: true })]} data-slot=\"segMenu\"\n                    {...{ [`data-${scope}-segmenu`]: name }} aria-label={label}>\n                    {current?.label ?? active}\n                    <FontAwesomeIcon icon={faCaretDown} data-chip-caret=\"\" />\n                </chakra.button>\n            </ChakraMenu.Trigger>\n            <FrameMenuLayer label={label}>\n                        {items.map((it) => (\n                            <ChakraMenu.Item key={it.key} value={it.key} disabled={it.disabled} title={it.hint}>{it.label}</ChakraMenu.Item>\n                        ))}\n                    </FrameMenuLayer>\n        </ChakraMenu.Root>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { Box, Button, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCalendarWeek, faCaretDown, faChevronLeft, faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { SliceEditPopover, useFormatters } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { Seg } from \"../schedule/segments.js\";\nimport { DAY, dayStart, weekStart } from \"../schedule/window.js\";\nimport { isoWeekUTC, shiftCalendar, type TimeResolution } from \"./scale.js\";\nimport { useNow } from \"./now-line.js\";\n\ntype Period = TimeResolution;\ntype Panel = \"day\" | \"week\" | \"month\" | \"year\" | \"range\";\nconst NO_DATES: readonly Date[] = [];\nconst DAY_WEEK = [{ key: \"day\", label: \"Days\" }, { key: \"week\", label: \"Weeks\" }] as const;\nconst DAY_WEEK_RANGE = [...DAY_WEEK, { key: \"range\", label: \"Range\" }] as const;\nconst firstPanel = (period: Period, initial?: \"day\" | \"week\"): Panel => period === \"year\" ? \"year\" : period === \"month\" || period === \"quarter\" ? \"month\" : initial ?? (period === \"week\" ? \"week\" : \"day\");\nconst monthStart = (date: number) => { const d = new Date(date); return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1); };\n\n/** Internal controlled time navigation. The host retains its Slice, records and view unit. */\nexport interface TimeNavigatorProps {\n    date: number;\n    period: Period;\n    sunday: boolean;\n    onChange: (date: number) => void;\n    now?: Date;\n    compact?: boolean;\n    /** A truthful visible/custom range may replace the anchor's label. */\n    rangeLabel?: string | undefined;\n    label?: string;\n    scope: string;\n    /** Weekly records open on their weeks, even while the main shows one day. */\n    initialPanel?: \"day\" | \"week\";\n    /** Read just the open month's week statuses. Closing/unmounting releases them. */\n    onWeeks?: (dates: readonly Date[]) => void;\n    weekMarker?: (date: Date) => ReactNode;\n    /** A mark in each day of the day panel — a day record's status (Published · Draft · Not started), read for the open month through `onWeeks`. */\n    dayMarker?: (date: Date) => ReactNode;\n    legend?: ReactNode;\n    /** Final toolbar fold: view controls share the same reachable popover. */\n    controls?: ReactNode;\n    /** The host's existing Slice editor; no second range state lives here. */\n    rangeEditor?: ReactNode;\n    /** Told when Today is pressed, after its date is chosen: a host that shows the time of day brings the now line into view (#1398). */\n    onToday?: (() => void) | undefined;\n}\n\n/**\n * Test-only probe — lets \"a navigator drawn again draws with the styles made once for the theme\" be asserted as the\n * styles each render draws with (#1398, CL9). `undefined` outside tests.\n */\nlet navigatorStylesProbe: ((styles: object) => void) | undefined;\n/**\n * Install (or clear) the navigator styles probe. Test use only.\n *\n * @param fn - Called with the styles a navigator draws with, each time it renders; `undefined` clears it\n */\nexport function setNavigatorStylesProbe(fn: ((styles: object) => void) | undefined): void {\n    navigatorStylesProbe = fn;\n}\n\n/** One date/range trigger between arrows, with the same Today action in every popup. */\nexport function TimeNavigator({ date, period, sunday, onChange, now: givenNow, compact = false, rangeLabel, label = \"Choose date\", scope, initialPanel, onWeeks, weekMarker, dayMarker, legend, controls, rangeEditor, onToday }: TimeNavigatorProps) {\n    const format = useFormatters();\n    const now = useNow(givenNow);\n    // Its styles made once for the theme (#1398, CL9): the navigator draws again with every step of its builder's dates.\n    const styles = useSlotStyles(\"timeNavigator\");\n    navigatorStylesProbe?.(styles);\n    const [open, setOpen] = useState(false);\n    const [month, setMonth] = useState(() => monthStart(date));\n    const [panel, setPanel] = useState<Panel>(firstPanel(period, initialPanel));\n    const [dayPanel, setDayPanel] = useState<\"day\" | \"week\">(initialPanel ?? (period === \"week\" ? \"week\" : \"day\"));\n    const current = dayStart(date);\n    const start = weekStart(current, sunday);\n    const today = dayStart(now).getTime();\n    const year = new Date(month).getUTCFullYear();\n    const yearBase = Math.floor(year / 12) * 12;\n    const weeks = useMemo(() => {\n        const first = weekStart(new Date(month), sunday).getTime();\n        const end = shiftCalendar(new Date(month), \"month\", 1).getTime();\n        return Array.from({ length: Math.ceil((end - first) / (7 * DAY)) }, (_, i) => new Date(first + i * 7 * DAY));\n    }, [month, sunday]);\n    useEffect(() => {\n        if (!open || (panel !== \"day\" && panel !== \"week\") || onWeeks === undefined) return;\n        onWeeks(weeks);\n        return () => onWeeks(NO_DATES);\n    }, [open, panel, weeks, onWeeks]);\n    const changeOpen = (next: boolean) => {\n        setOpen(next);\n        if (next) {\n            setMonth(monthStart(date));\n            const initial = initialPanel ?? (period === \"week\" ? \"week\" : \"day\");\n            setDayPanel(initial); setPanel(firstPanel(period, initial));\n        }\n    };\n    const commit = (next: number) => { onChange(next); setOpen(false); };\n    const choose = (next: number) => commit(dayStart(next).getTime() + date - current.getTime());\n    const move = (step: number) => commit(shiftCalendar(new Date(date), period, step).getTime());\n    const arrows = <>\n        <Button size=\"xs\" variant=\"ghost\" aria-label={`Previous ${period}`} onClick={() => move(-1)}><FontAwesomeIcon icon={faChevronLeft} /></Button>\n        <Button size=\"xs\" variant=\"ghost\" aria-label={`Next ${period}`} onClick={() => move(1)}><FontAwesomeIcon icon={faChevronRight} /></Button>\n    </>;\n    const weekLabel = (d: Date) => `W${format.number(isoWeekUTC(new Date(d.getTime() + 3 * DAY)))} · ${format.range(d, new Date(d.getTime() + 6 * DAY))}`;\n    const fullLabel = rangeLabel ?? (period === \"hour\" ? format.dateTime(new Date(date)) : period === \"day\" ? format.weekdayDate(current) : period === \"week\" ? weekLabel(start) : period === \"year\" ? format.year(current) : format.monthYear(current));\n    const shortLabel = period === \"hour\" || period === \"day\" ? format.monthDay(current) : period === \"week\" ? `W${format.number(isoWeekUTC(new Date(start.getTime() + 3 * DAY)))}` : period === \"year\" ? format.year(current) : `${format.month(current)} ${format.year(current)}`;\n    const browse = (step: number) => setMonth(shiftCalendar(new Date(month), panel === \"year\" || panel === \"month\" ? \"year\" : \"month\", step * (panel === \"year\" ? 12 : 1)).getTime());\n    const heading = panel === \"year\" ? `${format.year(new Date(Date.UTC(yearBase, 0, 1)))}–${format.year(new Date(Date.UTC(yearBase + 11, 0, 1)))}` : panel === \"month\" ? format.year(new Date(month)) : format.monthYear(new Date(month));\n    // In the toolbar's row, the trigger and the arrows beside it stand as tall as every control there (`sm`, 28px, ruled\n    // 23 Oct 2026); the popover's own buttons keep its density.\n    const picker = <SliceEditPopover open={open} onOpenChange={changeOpen} label={label}\n        trigger={<Button size=\"sm\" variant=\"ghost\" css={styles.trigger} aria-label={label} title={fullLabel} data-time-trigger=\"\">\n            {compact && controls !== undefined ? <FontAwesomeIcon icon={faCalendarWeek} /> : <><Box as=\"span\" css={styles.label} data-time-label=\"\">{compact ? shortLabel : fullLabel}</Box><FontAwesomeIcon icon={faCaretDown} /></>}\n        </Button>}\n        footLeft={<Box css={styles.footer}>{arrows}</Box>}\n        footActions={<Button size=\"xs\" variant=\"solid\" onClick={() => { choose(today); onToday?.(); }}>Today</Button>}>\n        <Box css={styles.body} data-time-picker={scope} data-time-panel={panel}>\n            {panel !== \"range\" && <Box css={styles.header}>\n                <Button size=\"xs\" variant=\"ghost\" aria-label={`Previous ${panel === \"year\" ? \"12 years\" : panel === \"month\" ? \"year\" : \"month\"}`} onClick={() => browse(-1)}><FontAwesomeIcon icon={faChevronLeft} /></Button>\n                <Button size=\"xs\" variant=\"ghost\" css={styles.heading} aria-label={panel === \"year\" ? \"Choose month\" : panel === \"month\" ? \"Choose year\" : \"Choose month\"} onClick={() => setPanel(panel === \"month\" ? \"year\" : \"month\")}>{heading}<FontAwesomeIcon icon={faCaretDown} /></Button>\n                <Button size=\"xs\" variant=\"ghost\" aria-label={`Next ${panel === \"year\" ? \"12 years\" : panel === \"month\" ? \"year\" : \"month\"}`} onClick={() => browse(1)}><FontAwesomeIcon icon={faChevronRight} /></Button>\n            </Box>}\n            {(panel === \"day\" || panel === \"week\" || rangeEditor !== undefined) && <Seg label=\"Choose by\" name=\"picker-unit\" scope={scope} fullWidth items={rangeEditor === undefined ? DAY_WEEK : DAY_WEEK_RANGE} active={panel} onPick={next => { if (next !== \"range\") setDayPanel(next); setPanel(next); }} />}\n            {panel === \"range\" && rangeEditor}\n            {panel === \"week\" && <Box css={styles.weeks}>{weeks.map(week => <chakra.button key={week.getTime()} type=\"button\" css={styles.week}\n                {...{ [`data-${scope}-picker-week`]: week.toISOString().slice(0, 10) }} data-time-week={week.getTime()}\n                data-selected={week.getTime() === start.getTime() ? \"\" : undefined} aria-pressed={week.getTime() === start.getTime()}\n                aria-current={week.getTime() === weekStart(now, sunday).getTime() ? \"date\" : undefined}\n                onClick={() => choose(week.getTime() + current.getTime() - start.getTime())}>\n                {weekMarker?.(week)}{weekLabel(week)}\n            </chakra.button>)}</Box>}\n            {panel === \"day\" && <Box css={styles.days}>\n                {Array.from({ length: 7 }, (_, i) => <Box key={i} css={styles.weekday}>{format.weekday(new Date(weeks[0]!.getTime() + i * DAY))}</Box>)}\n                {weeks.flatMap(week => Array.from({ length: 7 }, (_, i) => new Date(week.getTime() + i * DAY))).map(day => <chakra.button key={day.getTime()} type=\"button\" css={styles.day}\n                    aria-label={format.weekdayDate(day)} aria-pressed={day.getTime() === current.getTime()} aria-current={day.getTime() === today ? \"date\" : undefined}\n                    data-time-day={day.getTime()} data-selected={day.getTime() === current.getTime() ? \"\" : undefined} data-outside={day.getUTCMonth() !== new Date(month).getUTCMonth() ? \"\" : undefined}\n                    onClick={() => choose(day.getTime())}>{format.number(day.getUTCDate())}\n                    {dayMarker !== undefined && <Box as=\"span\" css={styles.dayMark} data-time-daymark=\"\">{dayMarker(day)}</Box>}</chakra.button>)}\n            </Box>}\n            {panel === \"month\" && <Box css={styles.choices}>{Array.from({ length: 12 }, (_, i) => <chakra.button key={i} type=\"button\" css={styles.choice}\n                aria-label={format.monthYear(new Date(Date.UTC(year, i, 1)))} data-time-month={i}\n                data-selected={current.getUTCFullYear() === year && current.getUTCMonth() === i ? \"\" : undefined}\n                onClick={() => {\n                    if (period === \"month\" || period === \"quarter\") choose(shiftCalendar(current, \"month\", (year - current.getUTCFullYear()) * 12 + i - current.getUTCMonth()).getTime());\n                    else { setMonth(Date.UTC(year, i, 1)); setPanel(dayPanel); }\n                }}>{format.month(new Date(Date.UTC(year, i, 1)))}</chakra.button>)}</Box>}\n            {panel === \"year\" && <Box css={styles.choices}>{Array.from({ length: 12 }, (_, i) => yearBase + i).map(y => <chakra.button key={y} type=\"button\" css={styles.choice}\n                data-selected={current.getUTCFullYear() === y ? \"\" : undefined} onClick={() => { if (period === \"year\") choose(shiftCalendar(current, \"year\", y - current.getUTCFullYear()).getTime()); else { setMonth(Date.UTC(y, new Date(month).getUTCMonth(), 1)); setPanel(\"month\"); } }}>{format.year(new Date(Date.UTC(y, 0, 1)))}</chakra.button>)}</Box>}\n            {(panel === \"week\" || (panel === \"day\" && dayMarker !== undefined)) && legend !== undefined && <Box css={styles.legend}>{legend}</Box>}\n            {controls !== undefined && <Box css={styles.controls}>{controls}</Box>}\n        </Box>\n    </SliceEditPopover>;\n    return <Box css={styles.root} data-time-navigation={scope} data-time-period={period} data-time-anchor={date}>\n        {!compact && <Button size=\"sm\" variant=\"ghost\" aria-label={`Previous ${period}`} onClick={() => move(-1)}><FontAwesomeIcon icon={faChevronLeft} /></Button>}\n        {picker}\n        {!compact && <Button size=\"sm\" variant=\"ghost\" aria-label={`Next ${period}`} onClick={() => move(1)}><FontAwesomeIcon icon={faChevronRight} /></Button>}\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * One folding Toolbar: the rail, Calendar navigation, overlaps, Search Records and shared history. The count counts the\n * events drawn, and names the kinds past the cap it counts none of (#1424): `13 events, print jobs not counted`, never a\n * count that leaves them out unsaid.\n */\nimport { some, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport type { RecordSlicesChromeType } from \"@elaraai/east-ui/internal\";\nimport { Box, Button, Menu as ChakraMenu, chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCalendarWeek, faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\nimport {\n    ChipMenu, historyToolbarItem, useKeySearchToolbarItem, type EditIssue, type EditingWords, type HistoryAction, type KeySearchSource, type ToolbarItem,\n} from \"@elaraai/east-ui-components\";\nimport { HOST_RANK, RecordSliceFieldEditor, coarseHitArea, useRecordSlicesToolbarItems } from \"@elaraai/east-ui-components/internal\";\nimport { TimeNavigator } from \"../shared/time/navigation.js\";\nimport { SEARCH_BOX_RANK } from \"../shared/schedule/search-rank.js\";\nimport { eventsNotCounted } from \"../shared/schedule/words.js\";\nimport { Seg } from \"../shared/schedule/segments.js\";\nimport type { ScheduleOverlaps } from \"../shared/schedule/overlaps.js\";\nimport { scheduleIssueName } from \"../shared/schedule/editing.js\";\nimport type { CalendarCommands } from \"./actions.js\";\nimport type { CalendarWords } from \"./messages.js\";\nimport type { CalendarEventPart } from \"./window.js\";\nimport { dayStart, navigate, type CalendarItem, type CalendarRef, type CalendarStyles, type CalendarUncounted, type CalendarView } from \"./model.js\";\n\nconst LAYOUTS: readonly { readonly key: CalendarView[\"layout\"]; readonly label: string }[] = [{ key: \"calendar\", label: \"Calendar\" }, { key: \"resources\", label: \"Resources\" }, { key: \"timeline\", label: \"Timeline\" }];\nconst PERIODS = [{ key: \"day\", label: \"Day\" }, { key: \"week\", label: \"Week\" }, { key: \"month\", label: \"Month\" }] as const;\n/** The kind of an issue's event: the kind whose session the history holds the issue in. */\nfunction kindOfIssue(commands: CalendarCommands, issue: EditIssue): string | undefined {\n    return commands.editing.sessions.find(held => held.key === commands.editing.history.sourceOf(issue))?.kind;\n}\n\n/** The instant an issue's event starts, as a gesture reads it; `undefined` for one unplaced, or not read. */\nfunction startOfIssue(commands: CalendarCommands, kind: string, entry: string): Date | undefined {\n    try {\n        const start = commands.editing.read(kind, entry)?.item.start;\n        return start?.type === \"some\" ? start.value : undefined;\n    } catch {\n        return undefined;\n    }\n}\n\ninterface ToolbarArgs {\n    view: CalendarView; setView: (view: CalendarView) => void; now: Date;\n    /** What this Calendar calls its Resources layout (#1516). */\n    resourcesWord: string;\n    /** The layouts this Calendar offers, in the switch's order: the `views` prop's. */\n    layouts: readonly CalendarView[\"layout\"][];\n    /** The periods this Calendar offers, in the switch's order: the `viewPeriods` prop's. */\n    periods: readonly CalendarView[\"period\"][];\n    /** The window's events; `undefined` while its period is read: \"…\", never a count of another period's (#1398, CL13). */\n    count: number | undefined;\n    /** The kinds past the cap (#1424): the count counts none of their events, and says so. */\n    uncounted: CalendarUncounted;\n    styles: CalendarStyles; commands: CalendarCommands | undefined;\n    /** The Calendar's words: its message table — the history's, and what Search Records searches — and the app's formatters. */\n    words: CalendarWords; overlaps: ScheduleOverlaps<CalendarItem>; select: (refs: CalendarRef[]) => void;\n    /** Whether an overlap shows among what is drawn. */\n    overlapsShown: boolean;\n    onAction: (action: HistoryAction) => void; paged: boolean;\n    /** The rail; `undefined` with no slice. */\n    chrome: ValueTypeOf<RecordSlicesChromeType> | undefined;\n    /** The rail's affordances. */\n    affordances: readonly string[];\n    /** What the rail counts each source in, and heads it with folded, where the source has no label of its own. */\n    nouns: Readonly<Record<string, string>>;\n    /** The event sources that hold the window: their ranges are the navigation's, never chips of the rail's. */\n    windowParts: readonly CalendarEventPart[];\n    sunday: boolean; navigationDate: number; rangeLabel: string | undefined; onNavigate: (date: number) => void;\n    /** Told when the date picker's Today is pressed: the time grid and the timeline bring the now line into view (#1398). */\n    onToday?: (() => void) | undefined;\n    /** Search Records over the event kinds' keys (#1398); `undefined` with no kind to seek. */\n    search?: KeySearchSource | undefined;\n    /** The Elara eye (#1409): the run's toolbar item, listed immediately before the history item; `undefined` with no optimiser. */\n    optimise?: ToolbarItem | undefined;\n    /** Whether a run of the optimiser is out (#1409, R2): the history item's actions locked. */\n    locked?: boolean | undefined;\n    /**\n     * The events drawn whose stored rows break their kind's bounds (#1585): each a warning beside the history's issues,\n     * holding no Save — its event, the field, by its form's key, and its words, `Mounting plates · Hours: at least 1`.\n     */\n    warnings?: readonly { readonly kind: string; readonly key: string; readonly field: string; readonly text: string }[] | undefined;\n    /**\n     * Asks an event's form for the field an issue or a warning gone to names, which takes the keyboard as the form draws\n     * it (`../shared/schedule/field-ask.tsx`); one naming no field asks for none.\n     */\n    askField?: ((kind: string, entry: string, field: option<string>) => void) | undefined;\n}\n\n/**\n * What the count says (#1424): the events counted, and the kinds past the cap it counts none of — `13 events, print jobs\n * not counted`, or with every kind past it `print jobs not counted`, no number; \"…\" while the period is read (CL13).\n *\n * @param count - The events drawn; `undefined` while the period is read\n * @param uncounted - The kinds past the cap\n * @param words - The app's formatters\n * @returns The count's words\n */\nfunction countWords(count: number | undefined, uncounted: CalendarUncounted, words: Pick<EditingWords, \"number\">): string {\n    if (count === undefined) return \"… events\";\n    if (uncounted.names.length === 0) return `${words.number(count)} events`;\n    return eventsNotCounted({ n: count, count: uncounted.all ? undefined : words.number(count), kinds: uncounted.names });\n}\n/** The control row uses shared folding ranks, popovers and coarse-pointer targets. */\nexport function useCalendarToolbar(args: ToolbarArgs): ReadonlyArray<ToolbarItem | false | undefined> {\n    const { view, setView, now, count, styles, words, commands, onAction, overlaps, overlapsShown, select, paged, chrome, windowParts } = args;\n    // One date window (#1343): each event source's range is the window the navigation writes, so it leaves the rail,\n    // and the leading source's range editor is the navigator's Range panel, as the Plan's is.\n    const rail = useRecordSlicesToolbarItems(chrome?.slice, {\n        nouns: args.nouns, affordances: args.affordances,\n        excludeFields: windowParts.flatMap(({ kind, part }) => part.config.range.type === \"some\" ? [`${kind.key}.${part.config.range.value}`] : []),\n        ...(chrome?.persist.type === \"some\" ? { persist: chrome.persist.value.type } : {}),\n    });\n    const lead = windowParts[0];\n    const leadField = lead === undefined || lead.part.config.range.type === \"none\" ? undefined\n        : lead.part.config.fields.find(field => lead.part.config.range.type === \"some\" && field.fieldId === lead.part.config.range.value);\n    const rangeEditor = lead !== undefined && leadField !== undefined ? <RecordSliceFieldEditor slice={lead.part} field={leadField} source={lead.kind.key} /> : undefined;\n    const chip = useRecipe({ key: \"chip\" });\n    // Search Records (#1398): primary-key navigation over every event kind's record, at the row's end, saying what it\n    // searches — `Search events by key` — as the views name an event by its title. Its box is the first thing the row\n    // folds, to its icon, before the rail and the period's steps (ruled 25 Oct 2026); at the row's last step it goes into\n    // the View, beside the date and the view controls.\n    const seek = useKeySearchToolbarItem(args.search, { side: \"end\", rank: SEARCH_BOX_RANK, label: words.m.keySearch() });\n    const period = view.layout === \"resources\" ? \"day\" : view.period;\n    // The layouts this Calendar offers: its switch, in every form, only where there is a choice to make.\n    const layouts = LAYOUTS.filter(layout => args.layouts.includes(layout.key)).map(layout => layout.key === \"resources\" ? { ...layout, label: args.resourcesWord } : layout);\n    const switches = layouts.length > 1;\n    // And the periods it offers, Resources being always a day.\n    const periods = PERIODS.filter(item => args.periods.includes(item.key));\n    const picksPeriod = view.layout !== \"resources\" && periods.length > 1;\n    // A step from the view's date, a period exactly.\n    const move = (step: number) => args.onNavigate(navigate({ ...view, date: args.navigationDate }, step).date);\n    // The overlaps shown: every one among what is drawn.\n    const overlapCount = overlaps.pairs.length;\n    const showOverlaps = () => {\n        const firstPair = overlaps.pairs[0];\n        if (firstPair === undefined) return;\n        select([firstPair.first, firstPair.second].map(item => ({ kind: item.kind, key: item.key })));\n        if (firstPair.first.start.type === \"some\") setView({ ...view, layout: args.layouts.includes(\"resources\") ? \"resources\" : view.layout, date: dayStart(firstPair.first.start.value).getTime() });\n    };\n    const overlapNoun = (n: number) => n === 1 ? \"overlap\" : \"overlaps\";\n    const warning = (short: boolean) => <chakra.button type=\"button\" css={[chip({ tone: \"warn\" }), coarseHitArea({ position: true })]}\n        aria-label={`${overlapCount} ${overlapNoun(overlapCount)}`} data-calendar-overlaps=\"\" onClick={showOverlaps}><span data-chip-icon=\"\"><FontAwesomeIcon icon={faTriangleExclamation} /></span><span data-chip-label=\"\">{overlapCount}{!short && ` ${overlapNoun(overlapCount)}`}</span></chakra.button>;\n    const overlapsWords = `${overlapCount} ${overlapNoun(overlapCount)}`;\n    const viewMenu = <ChipMenu label=\"View\" icon={faCalendarWeek} data=\"data-calendar-view-menu\" onSelect={key => {\n        const layout = LAYOUTS.find(layout => layout.key === key); const picked = PERIODS.find(period => period.key === key);\n        if (layout !== undefined) setView({ ...view, layout: layout.key });\n        else if (picked !== undefined && view.layout !== \"resources\") setView({ ...view, period: picked.key });\n        else if (key === \"overlaps\") showOverlaps();\n        else if (key === \"previous\" || key === \"next\") move(key === \"previous\" ? -1 : 1);\n    }}>\n        {switches && <>{layouts.map(layout => <ChakraMenu.Item value={layout.key} key={layout.key}>{layout.label}</ChakraMenu.Item>)}<ChakraMenu.Separator /></>}\n        {picksPeriod && <>{periods.map(p => <ChakraMenu.Item value={p.key} key={p.key}>{p.label}</ChakraMenu.Item>)}<ChakraMenu.Separator /></>}\n        <ChakraMenu.Item value=\"previous\">Previous {period}</ChakraMenu.Item><ChakraMenu.Item value=\"next\">Next {period}</ChakraMenu.Item>\n        {overlapsShown && <ChakraMenu.Item value=\"overlaps\">{overlapsWords}</ChakraMenu.Item>}\n    </ChipMenu>;\n    const controls = <>\n        {seek?.forms[0]}\n        {switches && <Seg label=\"Layout\" scope=\"calendar\" name=\"compact-layout\" items={layouts} active={view.layout} onPick={layout => setView({ ...view, layout })} />}\n        {picksPeriod && <Seg label=\"Period\" scope=\"calendar\" name=\"compact-period\" items={periods} active={period} onPick={period => setView({ ...view, period })} />}\n        {overlapsShown && <Button size=\"xs\" variant=\"ghost\" onClick={showOverlaps}>{overlapsWords}</Button>}\n    </>;\n    const navigator = (compact: boolean, combined: boolean) => (date: number, label: string | undefined) => <TimeNavigator scope=\"calendar\" date={date} period={period}\n        sunday={args.sunday} now={now} onChange={args.onNavigate} compact={compact} rangeLabel={label}\n        label={combined ? \"View\" : \"Choose date\"} controls={combined ? controls : undefined} rangeEditor={rangeEditor} onToday={args.onToday} />;\n    const navigation = (compact = false, combined = false) => navigator(compact, combined)(args.navigationDate, args.rangeLabel);\n    // An event's Go to — an issue's, a warning's — selects it and shows its day, as a pick of Search Records does, wherever\n    // the view stood, and asks its form for the field it names, which takes the keyboard: never the page's body, where the\n    // history's buttons, which keep no focus, leave it.\n    const goTo = (kind: string, key: string, field: option<string>) => {\n        args.askField?.(kind, key, field);\n        select([{ kind, key }]);\n        const start = commands === undefined ? undefined : startOfIssue(commands, kind, key);\n        if (start !== undefined) args.onNavigate(dayStart(start).getTime());\n    };\n    return [\n        ...rail,\n        switches && { key: \"calendar.layout\", side: \"start\", rank: HOST_RANK + 1, bundle: \"calendar.view\", forms: [<Seg label=\"Layout\" scope=\"calendar\" name=\"layout\" items={layouts} active={view.layout} onPick={layout => setView({ ...view, layout })} />, null] },\n        picksPeriod && { key: \"calendar.period\", side: \"start\", rank: HOST_RANK + 1, bundle: \"calendar.view\", forms: [<Seg label=\"Period\" scope=\"calendar\" name=\"period\" items={periods} active={period} onPick={period => setView({ ...view, period })} />, null] },\n        // What the row folds into the View: with neither the switch nor the periods, nothing, so no View to fold to.\n        (switches || picksPeriod) && { key: \"calendar.view\", side: \"start\", rank: [HOST_RANK + 1, HOST_RANK + 6], bundle: [\"calendar.view\", \"calendar.controls\"], forms: [null, viewMenu, null] },\n        { key: \"calendar.navigation\", side: \"start\", rank: [HOST_RANK + 4, HOST_RANK + 6], bundle: [undefined, \"calendar.controls\"], forms: [navigation(), navigation(true), navigation(true, true)] },\n        // With no slice, the window's own count; a slice's summary counts each source instead.\n        chrome === undefined && { key: \"calendar.count\", side: \"start\", rank: HOST_RANK,\n            forms: [<Box css={styles.toolbarText} data-calendar-count=\"\">{countWords(count, args.uncounted, words)}</Box>, null] },\n        paged && chrome === undefined && { key: \"calendar.scope\", side: \"start\", forms: [<Box css={styles.toolbarText}>Loaded window</Box>, null], rank: HOST_RANK + 4 },\n        overlapsShown && { key: \"calendar.overlaps\", side: \"end\", rank: [HOST_RANK, HOST_RANK + 6], forms: [warning(false), warning(true), null] },\n        seek !== undefined && { ...seek, forms: [...seek.forms, null], rank: [SEARCH_BOX_RANK, HOST_RANK + 6], bundle: [undefined, \"calendar.controls\"] },\n        // The eye, immediately before the history item (#1409, D4).\n        args.optimise,\n        commands !== undefined && historyToolbarItem({ session: commands.editing.history, words, editing: false, showError: false, onAction, locked: args.locked === true,\n            // A conflict's event, named as its kind's banners name it.\n            where: issue => { const kind = kindOfIssue(commands, issue); return kind === undefined ? issue.entry : scheduleIssueName(commands.editing, kind, issue.entry); },\n            onIssue: issue => { const kind = kindOfIssue(commands, issue); if (kind !== undefined) goTo(kind, issue.entry, issue.field); },\n            // A stored event's breach (#1585): a warning beside the issues, holding no Save, gone to as an issue is.\n            warnings: args.warnings?.map(warning => ({ text: warning.text, go: () => goTo(warning.kind, warning.key, some(warning.field)) })) }),\n    ];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Which of a ruler's labels it draws (#1269): where its columns are narrower\n * than their labels, every k-th — k the smallest step at which every label it\n * draws fits whole, with a gap between two — and each period's first column\n * (a week's Monday under days, a month's first week under weeks, a year's\n * January under months) always among them, as the user ruled. Where even the\n * periods' first columns crowd each other, each draws that clears the one\n * drawn before it, and no other label does. A preferred label — the narrow\n * ruler's now bucket, which wears the brand where a chip has no room — draws\n * wherever it clears every period's first column drawn, and the labels it\n * crowds give way to it.\n *\n * A label is centred on its column, and may run past it into the columns\n * either side, which draw none. One that would run past the track's start or\n * end sits against its own column's edge there instead; one that cannot lie\n * inside the track either way draws nowhere.\n *\n * Pure: decided from the labels' widths as the ruler measured them, each\n * drawn whole.\n *\n * @packageDocumentation\n */\n\n/** One column's label, as the ruler measured it. */\nexport interface RulerLabel {\n    /** The column's centre, in px. */\n    readonly centre: number;\n    /** The column's inside start edge, in px: where its label sits when, centred, it would run past the track's start. */\n    readonly start: number;\n    /** The column's inside end edge, in px: where its label sits when, centred, it would run past the track's end. */\n    readonly end: number;\n    /** The label's width, drawn whole, in px. */\n    readonly width: number;\n    /** Whether the column starts a period: its label draws unless it crowds the period's first column drawn before it. */\n    readonly anchor: boolean;\n    /** Whether the column's label draws wherever it clears every period's first column drawn. */\n    readonly prefer: boolean;\n}\n\n/** Where a label sits against its column: centred on it, or against its start or its end edge. */\nexport type RulerAlign = \"centre\" | \"start\" | \"end\";\n\n/** What the ruler draws: each column's label shown or not, and where it sits. */\nexport interface RulerFit {\n    /** Whether each column's label is drawn. */\n    readonly shown: readonly boolean[];\n    /** Where each column's label sits. */\n    readonly align: readonly RulerAlign[];\n}\n\n/** A width within a hundredth of a pixel fits: the widths are measured, and summed. */\nconst SLACK = 0.01;\n\n/**\n * A label's box on the track, and where it sits: centred on its column, or —\n * where centred it would run past the track's start or end — against its own\n * column's edge there. `undefined` where neither keeps it inside the track.\n */\nfunction place(label: RulerLabel, track: { left: number; right: number }): { left: number; right: number; align: RulerAlign } | undefined {\n    const left = label.centre - label.width / 2;\n    const right = left + label.width;\n    const inside = (l: number, r: number) => l >= track.left - SLACK && r <= track.right + SLACK;\n    if (left < track.left - SLACK) {\n        return inside(label.start, label.start + label.width)\n            ? { left: label.start, right: label.start + label.width, align: \"start\" } : undefined;\n    }\n    if (right > track.right + SLACK) {\n        return inside(label.end - label.width, label.end)\n            ? { left: label.end - label.width, right: label.end, align: \"end\" } : undefined;\n    }\n    return { left, right, align: \"centre\" };\n}\n\n/**\n * The labels a ruler draws — see the module docs.\n *\n * @param labels - Each column's label, in order\n * @param track - The track's ends, in px\n * @param gap - The room between two labels, in px\n * @returns Which labels draw, and where each sits\n */\nexport function thinTicks(labels: readonly RulerLabel[], track: { left: number; right: number }, gap: number): RulerFit {\n    const boxes = labels.map((label) => place(label, track));\n    const align = boxes.map((box) => box?.align ?? \"centre\");\n    /** Whether label `a`, placed before label `b`, keeps the gap from it. */\n    const apart = (a: number, b: number) => boxes[a]!.right + gap <= boxes[b]!.left + SLACK;\n    /** Whether a run of labels, by index in order, fits: each one placed, and each clear of the one before by the gap. */\n    const fits = (run: readonly number[]) => run.every((i, j) => boxes[i] !== undefined && (j === 0 || apart(run[j - 1]!, i)));\n    const shownOf = (run: readonly number[]): RulerFit => {\n        const on = new Set(run);\n        return { shown: labels.map((_, i) => on.has(i)), align };\n    };\n    // The periods' first columns: each that clears the one drawn before it.\n    const anchors = labels.flatMap((label, i) => (label.anchor && boxes[i] !== undefined ? [i] : []));\n    const held: number[] = [];\n    for (const i of anchors) if (held.length === 0 || apart(held[held.length - 1]!, i)) held.push(i);\n    const everyAnchor = held.length === anchors.length;\n    // And each preferred label clear of every label held before it.\n    labels.forEach((label, i) => {\n        if (!label.prefer || label.anchor || boxes[i] === undefined) return;\n        if (held.every((h) => (h < i ? apart(h, i) : apart(i, h)))) held.push(i);\n    });\n    held.sort((a, b) => a - b);\n    if (!everyAnchor) return shownOf(held);\n    // Every k-th column from each period's first, beside them: the smallest k that fits.\n    const isHeld = new Set(held);\n    for (let k = 1; k <= labels.length; k++) {\n        const run: number[] = [];\n        let base = 0;\n        labels.forEach((label, i) => {\n            if (label.anchor) base = i;\n            if (isHeld.has(i) || (!label.anchor && (i - base) % k === 0 && boxes[i] !== undefined)) run.push(i);\n        });\n        // A label that crowds one that always draws gives way to it.\n        const clear = run.filter((i, j) => {\n            if (isHeld.has(i)) return true;\n            const next = run[j + 1];\n            const prev = run[j - 1];\n            return !(next !== undefined && isHeld.has(next) && !apart(i, next))\n                && !(prev !== undefined && isHeld.has(prev) && !apart(prev, i));\n        });\n        if (fits(clear)) return shownOf(clear);\n    }\n    return shownOf(held);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Which of a ruler's labels draw, measured as the page lays them out (#1269) —\n * the desktop ruler's (`Ruler.tsx`) and the narrow layout's\n * (`narrow/chrome.tsx`). While it measures, every label draws whole, centred\n * on its column; `thinTicks` then decides from the labels as they drew which\n * draw and where. It measures before the browser paints — when the ruler\n * mounts, when its buckets change, when its track's width changes (in the\n * ResizeObserver's delivery) and when fonts arrive — so no frame shows a label\n * it does not rest on. A track with no width yet (a ruler not laid out) draws\n * every label.\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useLayoutEffect, useState, type RefObject } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport type { Scale, ScaleBucket } from \"./scale.js\";\n\n/** The geometry and vocabulary a ruler needs, independent of its host. */\nexport type RulerScale<I> = Pick<Scale<I, string>, \"kind\" | \"resolution\" | \"buckets\" | \"toNumber\">;\nimport { thinTicks, type RulerFit } from \"./ruler-thin.js\";\n\n/** The room between two drawn labels, in px: with a bucket line between them, two labels read apart (#1269). */\nexport const RULER_GAP = 4;\n\n/**\n * Whether a bucket starts a period one up from the scale's resolution (#1269):\n * a Monday under days, a month's first week under weeks, January under months\n * or quarters, midnight under hours. A number or ordinal axis, or years, has\n * none.\n *\n * @param scale - The scale\n * @param b - The bucket\n * @returns Whether its column's label always draws\n */\nexport function startsPeriod<I>(scale: RulerScale<I>, b: ScaleBucket<I>): boolean {\n    if (scale.kind !== \"time\") return false;\n    const d = new Date(scale.toNumber(b.start));\n    switch (scale.resolution) {\n        case \"hour\": return d.getUTCHours() === 0 && d.getUTCMinutes() === 0;\n        case \"day\": return d.getUTCDay() === 1;\n        case \"week\": return d.getUTCDate() <= 7;\n        case \"month\": case \"quarter\": return d.getUTCMonth() === 0;\n        default: return false;\n    }\n}\n\n/** A box's inside edges, in px: its border box less its borders and padding. */\nfunction insideOf(el: HTMLElement): { left: number; right: number } {\n    const r = el.getBoundingClientRect();\n    const cs = getComputedStyle(el);\n    const px = (v: string) => Number.parseFloat(v) || 0;\n    return {\n        left: r.left + px(cs.borderLeftWidth) + px(cs.paddingLeft),\n        right: r.right - px(cs.borderRightWidth) - px(cs.paddingRight),\n    };\n}\n\n/**\n * What a ruler draws of its labels — see the module docs.\n *\n * @param trackRef - The ruler's track: one tick per bucket, in order, each holding its label as a `[data-tick-label]`\n * @param scale - The scale the ticks are the buckets of\n * @param prefer - The bucket (its `index`) whose label draws wherever it clears every period's first column drawn: the\n *   narrow ruler's now bucket\n * @returns Which labels draw and where each sits; `undefined` while the ruler measures, or while its track has no\n *   width, when every label draws, centred\n */\nexport function useRulerFit<I>(trackRef: RefObject<HTMLElement | null>, scale: RulerScale<I>, prefer?: number, enabled = true): RulerFit | undefined {\n    // What the labels' places depend on: each one's words and its column, and the bucket preferred.\n    const signature = `${prefer ?? \"\"}\\u0002${scale.buckets.map((b) => `${b.label}\\u0000${b.x0}\\u0000${b.x1}`).join(\"\\u0001\")}`;\n    const [measuring, setMeasuring] = useState(true);\n    const [fit, setFit] = useState<RulerFit | undefined>(undefined);\n    useLayoutEffect(() => { setMeasuring(true); }, [signature]);\n    // The track's width changed: measured again in the observer's delivery, before the frame paints.\n    useLayoutEffect(() => {\n        const track = trackRef.current;\n        if (!enabled || track === null || typeof ResizeObserver === \"undefined\") return undefined;\n        let width = track.getBoundingClientRect().width;\n        const ro = new ResizeObserver(() => {\n            const now = track.getBoundingClientRect().width;\n            if (Math.abs(now - width) < 0.01) return;\n            width = now;\n            flushSync(() => setMeasuring(true));\n        });\n        ro.observe(track);\n        return () => ro.disconnect();\n    }, [trackRef, enabled]);\n    // Fonts arriving change the labels' widths, not the track's.\n    useEffect(() => {\n        const fonts = typeof document === \"undefined\" ? undefined : document.fonts;\n        if (fonts === undefined) return undefined;\n        const again = () => setMeasuring(true);\n        fonts.addEventListener(\"loadingdone\", again);\n        return () => fonts.removeEventListener(\"loadingdone\", again);\n    }, []);\n    useLayoutEffect(() => {\n        const track = trackRef.current;\n        if (!enabled || !measuring || track === null) return;\n        setMeasuring(false);\n        const spans = [...track.querySelectorAll<HTMLElement>(\"[data-tick-label]\")];\n        if (spans.length === 0 || spans.length !== scale.buckets.length) { setFit(undefined); return; }\n        // Each column's inside edges, where a label that would run past the track's start or end sits; the first's\n        // start and the last's end are the track's.\n        const columns = spans.map((span) => insideOf(span.parentElement!));\n        const ends = { left: columns[0]!.left, right: columns[columns.length - 1]!.right };\n        if (ends.right - ends.left <= 0) { setFit(undefined); return; }\n        // A label's text, as the page draws it: its box less its knockout's padding, the recipe's on every label.\n        const knockout = getComputedStyle(spans[0]!);\n        const pad = (Number.parseFloat(knockout.paddingLeft) || 0) + (Number.parseFloat(knockout.paddingRight) || 0);\n        setFit(thinTicks(spans.map((span, i) => {\n            const r = span.getBoundingClientRect();\n            const b = scale.buckets[i]!;\n            return {\n                centre: (r.left + r.right) / 2, start: columns[i]!.left, end: columns[i]!.right,\n                width: Math.max(0, r.width - pad), anchor: startsPeriod(scale, b), prefer: b.index === prefer,\n            };\n        // Two labels' papers apart too: the later's would cover the end of the words before it.\n        }), ends, Math.max(RULER_GAP, pad)));\n    }, [measuring, signature, scale, prefer, trackRef, enabled]);\n    // While it measures, every label draws whole: never painted, as the measure lands first.\n    return enabled && !measuring && fit !== undefined && fit.shown.length === scale.buckets.length ? fit : undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Shared period/tick bands for Plan, Calendar and the Allocation, on the body's exact scale. */\nimport { memo, useCallback, useRef, useSyncExternalStore } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { MAX_BUCKETS, TIME_WORDS, periodText, resolutionInterval, type Scale, type ScaleBucket, type TimeResolution, type TimeWords } from \"./scale.js\";\nimport { startsPeriod, useRulerFit, type RulerScale } from \"./use-ruler-fit.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\nconst PARENT: Record<TimeResolution, TimeResolution> = {\n    hour: \"day\", day: \"week\", week: \"month\", month: \"year\", quarter: \"year\", year: \"year\",\n};\n\n/** Group the visible scale into calendar periods without widening its domain.\n * Edge periods clip to the same window as the body; a truncated scale stops\n * at the last drawn bucket. Year ticks group into decades.\n */\nexport function timeRulerUnits<I>(scale: Scale<I, string>, words: TimeWords = TIME_WORDS, unit?: TimeResolution): RulerScale<Date> | undefined {\n    if (scale.kind !== \"time\" || scale.resolution === undefined) return undefined;\n    const resolution = unit ?? PARENT[scale.resolution];\n    const decade = unit === undefined && scale.resolution === \"year\";\n    const interval = resolutionInterval(resolution);\n    const min = scale.toNumber(scale.window.min), max = scale.toNumber(scale.window.max);\n    const span = max - min;\n    const covered = min + (scale.buckets.at(-1)?.x1 ?? 0) * span;\n    let start = interval.floor(new Date(min));\n    if (decade) start.setUTCFullYear(Math.floor(start.getUTCFullYear() / 10) * 10);\n    const buckets: ScaleBucket<Date>[] = [];\n    while (start.getTime() < covered && buckets.length < MAX_BUCKETS) {\n        const end = interval.offset(start, decade ? 10 : 1);\n        buckets.push({ index: buckets.length, start, end,\n            x0: (Math.max(min, start.getTime()) - min) / span,\n            x1: (Math.min(covered, end.getTime()) - min) / span,\n            label: decade ? `${words.year(start)}–${words.year(new Date(end.getTime() - 1))}` : periodText(start, resolution, words),\n        });\n        start = end;\n    }\n    return { kind: \"time\", resolution, buckets, toNumber: date => date.getTime() };\n}\n\n/**\n * Where a scrolling timeline's view starts, as a store its sticky bands read (#1398, CL9): the instant at the start of\n * what its view shows, as an epoch — `undefined` before the timeline has laid out — published as it scrolls.\n */\nexport interface ViewStart {\n    readonly get: () => number | undefined;\n    /** Hears each move. */\n    readonly subscribe: (cb: () => void) => () => void;\n}\n\n/** A {@link ViewStart} its timeline publishes to. */\nexport interface ViewStartStore extends ViewStart {\n    /** Publish where the view starts now: its readers hear only as that moves. */\n    readonly set: (at: number) => void;\n}\n\n/**\n * A store of where a timeline's view starts.\n *\n * @returns The store, before the timeline has laid out\n */\nexport function createViewStart(): ViewStartStore {\n    let start: number | undefined;\n    const listeners = new Set<() => void>();\n    return {\n        get: () => start,\n        set(at) {\n            if (at === start) return;\n            start = at;\n            for (const cb of [...listeners]) cb();\n        },\n        subscribe(cb) {\n            listeners.add(cb);\n            return () => { listeners.delete(cb); };\n        },\n    };\n}\n\n/**\n * How far either side of the period a view starts in its band's captions stick, in periods: the next one is sticky\n * before the view gets there, so a scroll the compositor draws ahead of the page never finds it standing still.\n */\nconst STICK_REACH = 1;\n\n/**\n * The period of a band an instant falls in: its bucket's place in the band.\n *\n * @param scale - The band's scale, its buckets in order along time\n * @param at - The instant, as an epoch; `undefined` before its timeline has laid out\n * @returns The bucket's place; -1 for an instant in none\n */\nfunction bucketAt<I>(scale: RulerScale<I>, at: number | undefined): number {\n    if (at === undefined) return -1;\n    const { buckets } = scale;\n    let low = 0, high = buckets.length;\n    while (low < high) {\n        const mid = (low + high) >> 1;\n        if (scale.toNumber(buckets[mid]!.end) <= at) low = mid + 1;\n        else high = mid;\n    }\n    return low < buckets.length && scale.toNumber(buckets[low]!.start) <= at ? low : -1;\n}\n\n/** Nothing to hear: a band that does not stick. */\nconst NOTHING = () => () => {};\n\n/** A ruler band's column and its caption: drawn again only as what it shows moves. */\nconst RulerTick = memo(function RulerTick({ styles, x0, x1, label, slot, now, marked, periodStart, thinned, align, calendar, sticks }: {\n    styles: Styles; x0: number; x1: number; label: string; slot: string | undefined; now: boolean; marked: boolean; periodStart: boolean;\n    thinned: boolean; align: string | undefined; calendar: boolean; sticks: boolean;\n}) {\n    return <Box css={styles.rulerTick} data-slot={slot} data-now={now ? \"\" : undefined} data-marked={marked ? \"\" : undefined}\n        data-period-start={periodStart ? \"\" : undefined} data-thinned={thinned ? \"\" : undefined} data-align={align}\n        style={{ left: `${x0 * 100}%`, width: `${(x1 - x0) * 100}%` }}>\n        <Box as=\"span\" css={styles.rulerLabel} data-tick-label=\"\" data-calendar-ruler-label={calendar ? \"\" : undefined} data-sticks={sticks ? \"\" : undefined}>{label}</Box>\n    </Box>;\n});\n\n/** A ruler band's props. */\ninterface TimeRulerRowProps<I> {\n    scale: RulerScale<I>; styles: Styles; band: \"units\" | \"ticks\"; owner: \"plan\" | \"plan-narrow\" | \"calendar\" | \"allocation\";\n    /**\n     * A scrolling timeline's band (#1398, CL9): where its view starts. The caption of the period it starts in sticks\n     * inside its column beside the timeline's sticky column — that caption and its neighbours alone (`data-sticks`), its\n     * host's recipe making them sticky; every other caption stands where its column starts, as one that cannot stick\n     * stands. A sticky caption is a layer of the compositor's own: a band of them, one a period, was most of what a frame\n     * of a timeline's scroll spent compositing.\n     */\n    sticky?: ViewStart | undefined;\n    highlight?: number | undefined;\n    /** Buckets the host marks (`data-marked`): the Allocation's focus's hold. */\n    marked?: ((bucket: ScaleBucket<I>) => boolean) | undefined;\n}\n\n/** A ruler band. Plan fits complete labels before paint; scrolling timelines\n * keep the caption of the period their view starts in sticky inside its own column instead.\n */\nfunction TimeRulerRowOf<I>({ scale, styles, band, owner, sticky, highlight, marked }: TimeRulerRowProps<I>) {\n    const trackRef = useRef<HTMLDivElement>(null);\n    const placed = useRulerFit(trackRef, scale, highlight, sticky === undefined);\n    // The period the view starts in: drawn again only as that moves, each column only as its own sticking does.\n    const startIn = useCallback(() => sticky === undefined ? -1 : bucketAt(scale, sticky.get()), [sticky, scale]);\n    const at = useSyncExternalStore(sticky?.subscribe ?? NOTHING, startIn, startIn);\n    const plan = owner === \"plan\" || owner === \"plan-narrow\";\n    const slot = !plan ? undefined : band === \"units\" ? \"rulerUnit\" : owner === \"plan\" ? \"rulerTick\" : \"narrowRulerTick\";\n    return <Box ref={trackRef} css={styles.rulerRow} data-time-ruler={band}\n        data-calendar-ruler={owner === \"calendar\" ? band : undefined}\n        data-allocation-ruler={owner === \"allocation\" ? band : undefined}\n        data-plan-ruler={plan ? band : undefined}>\n        {scale.buckets.map((bucket, i) => <RulerTick key={bucket.index} styles={styles} x0={bucket.x0} x1={bucket.x1} label={bucket.label} slot={slot}\n            now={bucket.index === highlight} marked={marked?.(bucket) === true} periodStart={startsPeriod(scale, bucket)}\n            thinned={placed !== undefined && !placed.shown[i]} align={placed?.align[i] !== \"centre\" ? placed?.align[i] : undefined}\n            calendar={owner === \"calendar\"} sticks={at >= 0 && Math.abs(i - at) <= STICK_REACH} />)}\n    </Box>;\n}\n\n/** A ruler band (see {@link TimeRulerRowProps}): drawn again only as its props, or the period its view starts in, move. */\nexport const TimeRulerRow = memo(TimeRulerRowOf) as typeof TimeRulerRowOf;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Lane packing (#1148, the Calendar's B9): how events that overlap share the\n * room one column (or one row) has for them.\n *\n * A CLUSTER is a run of events each overlapping another of the run, directly\n * or through others. A cluster takes as many lanes as it needs: each event, in\n * order of start (the longer first where two start together), takes the first\n * lane free at its start. Then each event stretches over every lane to its\n * right that is free for the whole of it, up to the first that is not, so an\n * event beside a short one widens once the short one ends. A lane's events are\n * in order of start, so whether a lane is free for an event is a search of\n * that lane's events, never a sweep of the cluster, which a cluster of\n * hundreds — a year-long reservation over a press's jobs — made a sweep of\n * hundreds for every lane each event stretched over.\n *\n * Spans are half-open, `[start, end)`: two events that only meet, one ending\n * as the other starts, do not overlap. The numbers are any domain's (epoch ms,\n * minutes of the day), so the packing knows nothing of time.\n *\n * @packageDocumentation\n */\n\n/** An event to pack: its start and its exclusive end, on any numeric domain. */\nexport interface LaneSpan {\n    readonly start: number;\n    readonly end: number;\n}\n\n/** Where a packed event sits. */\nexport interface LanePlace {\n    /** Its lane, from 0. */\n    readonly lane: number;\n    /** The lanes its cluster takes: the room is cut into this many. */\n    readonly lanes: number;\n    /** How many lanes it spans, its own and the free ones to its right: 1 at least. */\n    readonly span: number;\n}\n\n/**\n * Test-only probe — lets \"an event stretches by searching each lane's events, never sweeping its cluster a lane\" be\n * asserted as the events a stretch examines (#1398, CL9). `undefined` outside tests.\n */\nlet lanesProbe: (() => void) | undefined;\n/**\n * Install (or clear) the lanes probe. Test use only.\n *\n * @param fn - Called for each event a stretch examines; `undefined` clears it\n */\nexport function setLanesProbe(fn: (() => void) | undefined): void {\n    lanesProbe = fn;\n}\n\n/**\n * Whether a lane's events overlap a span. The lane's events are in order of start, so the ones starting before the\n * span ends are the first of them, found by a search of their starts; one of those overlaps the span exactly when the\n * latest end among them, `reach`, is past the span's start.\n *\n * @param spans - Every event\n * @param events - The lane's events, by index into `spans`, in order of start\n * @param reach - The latest end among the lane's events up to each of them\n * @param span - The span to test\n * @returns Whether an event of the lane overlaps `span`\n */\nfunction laneOverlaps(spans: readonly LaneSpan[], events: readonly number[], reach: readonly number[], span: LaneSpan): boolean {\n    let lo = 0;\n    let hi = events.length;\n    while (lo < hi) {\n        const mid = (lo + hi) >> 1;\n        lanesProbe?.();\n        if (spans[events[mid]!]!.start < span.end) lo = mid + 1;\n        else hi = mid;\n    }\n    lanesProbe?.();\n    return lo > 0 && reach[lo - 1]! > span.start;\n}\n\n/**\n * Pack events into lanes (see the module docs).\n *\n * @param spans - The events\n * @returns Each event's place, in the order the events were given\n */\nexport function packLanes(spans: readonly LaneSpan[]): LanePlace[] {\n    const order = spans.map((_, i) => i).sort((a, b) =>\n        spans[a]!.start - spans[b]!.start || spans[b]!.end - spans[a]!.end || a - b);\n    const places = new Array<LanePlace>(spans.length);\n    let at = 0;\n    while (at < order.length) {\n        // One cluster: every event that starts before the cluster's last end.\n        const cluster: number[] = [order[at]!];\n        let clusterEnd = spans[order[at]!]!.end;\n        for (at += 1; at < order.length && spans[order[at]!]!.start < clusterEnd; at += 1) {\n            cluster.push(order[at]!);\n            clusterEnd = Math.max(clusterEnd, spans[order[at]!]!.end);\n        }\n        // Each event takes the first lane free at its start, so each lane's\n        // events are in order of start, one after another.\n        const laneEnds: number[] = [];\n        const laneOf = new Map<number, number>();\n        const laneEvents: number[][] = [];\n        for (const i of cluster) {\n            const s = spans[i]!;\n            let lane = laneEnds.findIndex((end) => end <= s.start);\n            if (lane < 0) lane = laneEnds.length;\n            laneEnds[lane] = s.end;\n            laneOf.set(i, lane);\n            (laneEvents[lane] ??= []).push(i);\n        }\n        const lanes = laneEnds.length;\n        const reach = laneEvents.map((events) => {\n            let latest = -Infinity;\n            return events.map((j) => (latest = Math.max(latest, spans[j]!.end)));\n        });\n        // Each event stretches over the lanes to its right while none of their\n        // events overlaps it, each lane searched, never the cluster swept.\n        for (const i of cluster) {\n            const lane = laneOf.get(i)!;\n            let span = 1;\n            while (lane + span < lanes && !laneOverlaps(spans, laneEvents[lane + span]!, reach[lane + span]!, spans[i]!)) {\n                span += 1;\n            }\n            places[i] = { lane, lanes, span };\n        }\n    }\n    return places;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The bands a time view shades (#1148): weekends, and the hours outside the\n * working day, as data. Each band is a stretch of the window as window\n * fractions, and its kind; the host draws it down a timeline (along x) or\n * across a day column (along y), and the host's recipe gives it its look.\n *\n * Times are UTC, as everything on a time axis is (#326): a Saturday is a UTC\n * Saturday, and a working day's hours are UTC hours. A weekend day is shaded\n * whole, never also for its hours. Bands of one kind that meet are one band,\n * so a night runs from one day's close to the next day's open, and a weekend\n * from Saturday to Monday.\n *\n * @packageDocumentation\n */\n\nimport type { TimeWindow } from \"./scale.js\";\n\nconst HOUR_MS = 3_600_000;\nconst DAY_MS = 86_400_000;\n\n/** What a band shades. */\nexport type ShadeKind = \"weekend\" | \"offHours\";\n\n/** One shaded stretch of the window. */\nexport interface ShadeBand {\n    /** Where it starts, as a window fraction. */\n    readonly start: number;\n    /** How long it is, as a window fraction. */\n    readonly width: number;\n    /** What it shades. */\n    readonly kind: ShadeKind;\n}\n\n/** What a view shades. */\nexport interface ShadeOptions {\n    /** The working day, in whole UTC hours: the hours before `from` and from `to` on are shaded. Omitted, no hour is. */\n    readonly hours?: { readonly from: number; readonly to: number } | undefined;\n    /** Whether Saturdays and Sundays are shaded whole: true by default. */\n    readonly weekends?: boolean | undefined;\n}\n\n/**\n * The bands a window shades (see the module docs).\n *\n * @param window - The window, `[min, max)`\n * @param options - The working day, and whether weekends shade\n * @returns The bands, in order; none for an empty window\n */\nexport function shadeBands(window: TimeWindow, options: ShadeOptions): ShadeBand[] {\n    const min = window.min.getTime();\n    const max = window.max.getTime();\n    if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return [];\n    const weekends = options.weekends ?? true;\n    const hours = options.hours;\n    const spans: { from: number; to: number; kind: ShadeKind }[] = [];\n    const add = (from: number, to: number, kind: ShadeKind): void => {\n        const a = Math.max(from, min);\n        const b = Math.min(to, max);\n        if (b <= a) return;\n        const last = spans[spans.length - 1];\n        if (last !== undefined && last.kind === kind && last.to === a) last.to = b;\n        else spans.push({ from: a, to: b, kind });\n    };\n    for (let day = Math.floor(min / DAY_MS) * DAY_MS; day < max; day += DAY_MS) {\n        const weekday = new Date(day).getUTCDay();\n        if (weekends && (weekday === 0 || weekday === 6)) {\n            add(day, day + DAY_MS, \"weekend\");\n        } else if (hours !== undefined) {\n            add(day, day + Math.max(0, hours.from) * HOUR_MS, \"offHours\");\n            add(day + Math.min(24, hours.to) * HOUR_MS, day + DAY_MS, \"offHours\");\n        }\n    }\n    const span = max - min;\n    return spans.map((s) => ({ start: (s.from - min) / span, width: (s.to - s.from) / span, kind: s.kind }));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The timeline's geometry (ruled 9 Nov 2026): the timeline draws the period\n * its view shows — Day a day, Week a week, Month a month, as `calendarRange`\n * gives them — and scrolls only within it, as the Roster's grid does. A scroll\n * never moves the period: only Previous and Next, Today, the date picker and a\n * pick of Search Records do.\n *\n * A day is at least {@link timelinePixels} wide, and as wide as the view\n * leaves it beside the resource column where that is wider\n * ({@link timelineDayWidth}): a period narrower than the view is drawn across\n * the whole of it. The view opens on its period where\n * {@link timelineOpensAt} says — at Day the working hours, at Week and Month\n * the view's date — and keeps its place along the period across a step.\n *\n * A row's events stack in lanes, and its lanes' bars are a block in the\n * middle of its plot, as far from its top as from its bottom, however tall\n * its head makes the row ({@link timelineLanes}).\n *\n * @packageDocumentation\n */\nimport { DAY, dayStart, type CalendarRange, type CalendarView } from \"./model.js\";\n\n/** The width of the sticky resource column every row starts with, px. */\nexport const TIMELINE_GUTTER = 184;\n/** The room between a row's lanes, px: a lane's bars are its height less this. */\nconst LANE_GAP = 4;\n/** The room above a row's first lane's bars and below its last's, px, where its lanes decide the row's height. */\nconst LANE_INSET = 7;\n\n/** A row's lanes on the timeline: the least height its plot takes, and where each lane's bars stand in it. */\nexport interface TimelineLanes {\n    /** The plot's least height, px: its lanes' bars and the room above and below them. */\n    readonly height: number;\n    /** A lane's bars' height, px. */\n    readonly bar: number;\n    /** A lane's bars' top in the plot, as CSS: their block in the plot's middle, whatever its height. */\n    readonly top: (lane: number) => string;\n}\n\n/**\n * A row's lanes on the timeline: the least height its plot takes — the lanes' bars, the room between them, and as much\n * room above the first as below the last — and where each lane's bars stand, their block in the plot's middle however\n * tall the row's head makes it.\n *\n * @param count - How many lanes the row's events stack in; 1 with none\n * @param lane - A lane's height, px, by the Calendar's density\n * @returns The plot's least height, a lane's bars' height and each lane's bars' top\n */\nexport function timelineLanes(count: number, lane: number): TimelineLanes {\n    const block = count * lane - LANE_GAP;\n    return { height: block + 2 * LANE_INSET, bar: lane - LANE_GAP, top: at => `calc(50% - ${block / 2}px + ${at * lane}px)` };\n}\n/** An hour, ms. */\nconst HOUR = DAY / 24;\n/** A day's least width on the timeline, px, by its period. */\nexport const timelinePixels = (period: CalendarView[\"period\"]): number => period === \"day\" ? 1920 : period === \"week\" ? 216 : 40;\n\n/**\n * How many days a period holds, as the timeline draws them: its time whole, weekends included.\n *\n * @param range - The period\n * @returns Its days\n */\nexport function timelineDays(range: CalendarRange): number {\n    return (range.to.getTime() - range.from.getTime()) / DAY;\n}\n\n/**\n * A day's width on the timeline: the period's own least width a day, or as wide as the view leaves it beside the\n * resource column where that is wider, so a period narrower than the view is drawn across the whole of it.\n *\n * @param range - The period drawn\n * @param period - The view's period\n * @param width - The view's width, px; 0 before it is laid out\n * @returns The day's width, px\n */\nexport function timelineDayWidth(range: CalendarRange, period: CalendarView[\"period\"], width: number): number {\n    return Math.max(timelinePixels(period), (width - TIMELINE_GUTTER) / timelineDays(range));\n}\n\n/**\n * What the timeline's view shows of its period, beside the sticky resource column.\n *\n * @param range - The period drawn\n * @param left - The scroll's left offset, px\n * @param width - The view's width, px\n * @param dayWidth - A day's width, px ({@link timelineDayWidth})\n * @returns The span shown\n */\nexport function timelineVisible(range: CalendarRange, left: number, width: number, dayWidth: number): CalendarRange {\n    const msPerPixel = DAY / dayWidth;\n    const from = new Date(range.from.getTime() + left * msPerPixel);\n    const to = new Date(from.getTime() + Math.max(1, width - TIMELINE_GUTTER) * msPerPixel);\n    return { from, to, days: [] };\n}\n\n/**\n * The instant the view opens its period on: at Day the middle of the working hours, at Week and Month the middle of\n * the view's date.\n *\n * @param view - The view\n * @param range - The period drawn\n * @param hours - The working hours: their first hour and the hour they end at\n * @returns The instant, as an epoch\n */\nexport function timelineOpensAt(view: CalendarView, range: CalendarRange, hours: { readonly from: number; readonly to: number }): number {\n    return view.period === \"day\" ? range.from.getTime() + (hours.from + hours.to) / 2 * HOUR : dayStart(view.date).getTime() + DAY / 2;\n}\n\n/**\n * The scroll that puts an instant a share of the way across the view beside the resource column — its middle at ½,\n * the now line at ⅓ — as near as the period's ends allow.\n *\n * @param range - The period drawn\n * @param at - The instant, as an epoch\n * @param share - How far across the view it goes\n * @param dayWidth - A day's width, px ({@link timelineDayWidth})\n * @param width - The view's width, px\n * @returns The scroll's left offset, px\n */\nexport function timelineScrollTo(range: CalendarRange, at: number, share: number, dayWidth: number, width: number): number {\n    const plot = Math.max(0, width - TIMELINE_GUTTER);\n    const most = Math.max(0, timelineDays(range) * dayWidth + TIMELINE_GUTTER - width);\n    return Math.min(most, Math.max(0, (at - range.from.getTime()) / DAY * dayWidth - plot * share));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n/** The shared disclosure and persisted fold state for scheduling builders. */\nimport { useCallback, type ReactNode } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faChevronDown, faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { usePersistedState } from \"@elaraai/east-ui-components\";\nimport { keptRead } from \"@elaraai/east-ui-components/internal\";\n\n/**\n * A group's fold follows its surface through layouts, resizes and remounts. Its `toggle` is the same function while the\n * fold's store is, so a row that draws a band draws again only as its fold changes (#1398, CL9).\n */\nexport function useGroupCollapse(surface: string) {\n    const { state: collapsed, setState: setCollapsed } = usePersistedState<string[]>(`${surface}.collapsed-groups`, [], keptRead.array(keptRead.string));\n    const toggle = useCallback((group: string) => setCollapsed(current => current.includes(group) ? current.filter(key => key !== group) : [...current, group]), [setCollapsed]);\n    // A group opened to show a row of it, as a Go to shows one: an open group stays as it is.\n    const open = useCallback((group: string) => setCollapsed(current => current.includes(group) ? current.filter(key => key !== group) : current), [setCollapsed]);\n    return { collapsed, toggle, open };\n}\n\n/**\n * Native button semantics keep Enter/Space and focus identical in both builders. `measure` is handed the band's element\n * as it mounts: what a virtual list measures its bands' estimate from (#1398, CL8).\n */\nexport function GroupHeading({ scope, group, styles, collapsed, toggle, measure, children }: {\n    scope: \"calendar\" | \"roster\" | \"allocation\"; group: { key: string; label: string }; styles: Record<string, Record<string, unknown>>;\n    collapsed: boolean; toggle: (group: string) => void; measure?: ((el: HTMLElement | null) => void) | undefined; children?: ReactNode;\n}) {\n    return <chakra.button ref={measure} type=\"button\" css={styles.group} data-schedule-group={group.key}\n        data-roster-group={scope === \"roster\" ? group.key : undefined} data-calendar-group={scope === \"calendar\" ? group.key : undefined}\n        data-allocation-band={scope === \"allocation\" ? group.key : undefined}\n        aria-expanded={!collapsed} onClick={() => toggle(group.key)}>\n        <Box as=\"span\" css={styles.groupContent} data-schedule-group-content=\"\">\n            <FontAwesomeIcon icon={collapsed ? faChevronRight : faChevronDown} /><Box as=\"span\" css={styles.groupLabel} data-schedule-group-label=\"\">{group.label}</Box>{children}\n        </Box>\n    </chakra.button>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** The same pointer preview for Plan and Calendar; the label never inherits bar width. */\nimport { useSlotClass } from \"@elaraai/east-ui-components/internal\";\nimport type { ReactNode } from \"react\";\n\n/**\n * A compact label and optional span, styled by the shared move-ghost recipe part. Plain elements with the slots' classes,\n * which {@link useMoveGhostClasses} makes ahead of the drag that first draws one.\n */\nexport function MoveGhost({ label, detail, styles, planKind }: {\n    label: string; detail?: ReactNode; styles: Record<string, Record<string, unknown>>; planKind?: string;\n}) {\n    const slot = useSlotClass();\n    return <div className={slot(styles.moveGhost)} data-move-ghost=\"\" data-plan-ghost={planKind}>\n        <span className={slot(styles.moveGhostLabel)} data-move-ghost-label=\"\">{label}</span>\n        {detail !== undefined && <span className={slot(styles.moveGhostSpan)} data-plan-ghost-span={planKind === undefined ? undefined : \"\"}>{detail}</span>}\n    </div>;\n}\n\n/** The slots a move ghost is drawn with. */\nconst MOVE_GHOST_SLOTS = [\"moveGhost\", \"moveGhostLabel\", \"moveGhostSpan\"] as const;\n\n/**\n * Makes the classes of what a gesture draws while its views are drawn, ahead of the gesture that first draws them: a\n * rule first added as a drag starts has the browser work out the whole page's styles and lay it all out again\n * (`useSlotClass`). A class is made once for the theme, so a part drawn many times may ask for it each time.\n *\n * @param styles - A recipe's slots; `undefined` while there is nothing to draw with\n * @param slots - The slots whose classes to make: one the recipe does not have makes none\n */\nexport function useClassesAhead(styles: Record<string, Record<string, unknown>> | undefined, slots: readonly string[]): void {\n    const slot = useSlotClass();\n    if (styles !== undefined) for (const name of slots) slot(styles[name]);\n}\n\n/**\n * Makes a move ghost's classes ahead of the drag that first draws one ({@link useClassesAhead}).\n *\n * @param styles - The slots the ghost is drawn with; `undefined` while there is nothing to draw with\n */\nexport function useMoveGhostClasses(styles: Record<string, Record<string, unknown>> | undefined): void {\n    useClassesAhead(styles, MOVE_GHOST_SLOTS);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Where a builder's virtual rows rest (#1398): the row at the top of the view,\n * by its key, and the px scrolled into it — what the shared `VirtualRows`\n * reports as a scroll settles (`onAnchorChange`), saved by the builder under\n * its key, and brought back once the rows are laid out (`restoreAnchor`): the\n * row it left, wherever the rows above it moved. Never a pixel offset of the\n * whole, which the rows above it would move (the Table's #143 rule). The\n * Roster's People rows and cards, the Calendar's timeline and the\n * Allocation's Table keep their places so.\n *\n * A builder whose rows a narrowing chooses says which narrowing they are under\n * ({@link RowNarrowing}): a new one keeps the row the view rested on, by its\n * key and the px into it, where the narrowing holds it, and else starts the\n * view at the top — once the narrowing's rows are in, as the Sheet keeps its\n * own (the Allocation's Table).\n *\n * A builder that draws rows not read yet as one item, a run however many\n * (the Calendar's timeline over a paged resource kind, #1424), says where its\n * rows stand in its runs (`VirtualRows`' `RowRuns`, which the frame anchors its\n * scroll on too): a view resting in a run rests on the row there, by the key\n * that row takes once read, and comes back to it — in the run that still holds\n * it, or its own line once its window is read.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useRef, useState } from \"react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport type { RowRuns } from \"@elaraai/east-ui-components/internal\";\nimport { keptRead } from \"@elaraai/east-ui-components/internal\";\n\nconst sameText = equalFor(StringType);\n\n/** Where a virtual view rests: its top row, by key, and the px scrolled into it. */\nexport interface RowAnchor {\n    readonly key: string;\n    readonly offset: number;\n}\n\n/** A view's resting place, as storage keeps it. */\nexport const readRowAnchor = keptRead.record<RowAnchor>({ key: keptRead.string, offset: keptRead.number });\n\n/** The narrowing a builder's rows are under, and whether its rows are in. */\nexport interface RowNarrowing {\n    /** The narrowing, as text: a new one keeps the view's place. */\n    readonly query: string;\n    /** Whether its rows are in: its membership read, the last no longer standing in. */\n    readonly settled: boolean;\n}\n\n/**\n * A virtual view's place (see the module docs).\n *\n * @param rows - The view's rows, each by its key\n * @param saved - Where it last rested\n * @param save - Told where it rests as its scroll settles\n * @param ready - Whether the rows are placed as they will be — a builder whose rows' estimate is measured from its first\n *   rows waits for that measure, so the rows above the one brought back stand where they will\n * @param narrowing - The narrowing the rows are under, where one chooses them: across a new one the view keeps the row it\n *   rested on where the narrowing holds it, else starts at the top\n * @param runs - Where the rows it has not read stand, where it draws them as runs: a view resting in one rests on the row\n *   there, and comes back to it there while the run holds it\n * @returns What its frame restores, and what it reports a settle to\n */\nexport function useRowAnchor(rows: readonly { readonly key: string }[], saved: RowAnchor | undefined, save: ((at: RowAnchor) => void) | undefined, ready = true,\n    narrowing?: RowNarrowing, runs?: RowRuns): {\n    restore: { index: number; offset: number } | undefined;\n    onAnchorChange: (at: { index: number; offset: number }) => void;\n} {\n    const pending = useRef(saved);\n    // Where the view last rested, as its scroll settled — or where it was brought back to: what a new narrowing keeps.\n    const rested = useRef(saved);\n    // The narrowing the view's place was last kept across.\n    const kept = useRef(narrowing?.query);\n    const [restore, setRestore] = useState<{ index: number; offset: number }>();\n    const query = narrowing?.query;\n    const settled = narrowing?.settled ?? false;\n    useLayoutEffect(() => {\n        // A row by its key: its own line, or — not read yet — the run that holds it.\n        const placeOf = (at: RowAnchor): { index: number; offset: number } | undefined => {\n            const index = rows.findIndex(row => row.key === at.key);\n            return index >= 0 ? { index, offset: at.offset } : runs?.find(at);\n        };\n        if (query !== undefined && settled && (kept.current === undefined || !sameText(kept.current, query))) {\n            kept.current = query;\n            pending.current = undefined;\n            const at = rested.current;\n            setRestore((at === undefined ? undefined : placeOf(at)) ?? { index: 0, offset: 0 });\n            return;\n        }\n        const at = pending.current;\n        if (at === undefined || !ready) return;\n        const place = placeOf(at);\n        if (place === undefined) return;\n        pending.current = undefined;\n        setRestore(place);\n    }, [rows, ready, query, settled, runs]);\n    const onAnchorChange = useCallback((at: { index: number; offset: number }) => {\n        const row = rows[at.index];\n        if (row === undefined) return;\n        rested.current = runs?.rowAt(at.index, at.offset) ?? { key: row.key, offset: at.offset };\n        save?.(rested.current);\n    }, [rows, save, runs]);\n    return { restore, onAnchorChange };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The agenda keeps the keyboard as a card's own action takes its card away\n * (#1398). A narrow Calendar's cards carry their explicit actions outside\n * Details — Delete, Return to backlog, Move — and one that takes its card from\n * where it was drawn would leave the focus, on a control that went with the\n * card, on the page's body, where the next Tab starts again at the page's top.\n * The agenda keeps it, as Details keep theirs (`../shared/focus-home.ts`): once\n * the agenda is drawn again, the focus lands on the head of the card drawn in\n * its place — the same event's, a Move to another of the agenda's days — else\n * of the card that came after it, else of the one before it, else on the\n * Calendar's main. A focus that left the agenda — for another element, for the\n * page with the control it was on still there, or a press anywhere outside it —\n * is let be; one in a popover a card's control opened — Move's, Resize's — is\n * the agenda's still, so a Move that takes its card to another day lands on it\n * there.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useRef, type FocusEvent, type RefObject } from \"react\";\n\n/** What marks a card, its event as `eventKey` prints it. */\nconst CARD = \"data-calendar-card\";\n\n/** The card the keyboard was last in, and the cards either side of it then, by their events. */\ninterface LastCard {\n    readonly card: string;\n    readonly next: string | undefined;\n    readonly previous: string | undefined;\n}\n\n/** What the agenda's element spreads: its ref, and its focus and blur listeners. */\nexport interface AgendaLanding<E extends HTMLElement> {\n    /** The agenda's element. */\n    readonly ref: RefObject<E | null>;\n    /** Hears the focus enter the agenda, or move within it. */\n    readonly onFocus: (event: FocusEvent<E>) => void;\n    /** Hears the focus leave an element of the agenda. */\n    readonly onBlur: (event: FocusEvent<E>) => void;\n}\n\n/**\n * The card after a card, or before it, in the agenda's order — the document's.\n *\n * @param region - The agenda\n * @param card - The card\n * @param forward - After it, else before it\n * @returns Its event; `undefined` at the agenda's end\n */\nfunction adjacent(region: Element, card: Element, forward: boolean): string | undefined {\n    const walker = region.ownerDocument.createTreeWalker(region, NodeFilter.SHOW_ELEMENT, {\n        acceptNode: node => (node as Element).hasAttribute(CARD) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP,\n    });\n    walker.currentNode = card;\n    const found = (forward ? walker.nextNode() : walker.previousNode()) as Element | null;\n    return found?.getAttribute(CARD) ?? undefined;\n}\n\n/**\n * Whether an element is in a popover a control of the agenda opened — a card's Move or Resize — its trigger, open, in\n * the agenda.\n *\n * @param region - The agenda\n * @param element - The element\n * @returns Whether the popover's trigger is the agenda's\n */\nfunction inAgendaLayer(region: Element, element: Element): boolean {\n    const content = element.closest('[data-scope=\"popover\"][data-part=\"content\"]');\n    if (content === null || content.id === \"\") return false;\n    for (const trigger of region.querySelectorAll('[aria-expanded=\"true\"][aria-controls]')) {\n        if (trigger.getAttribute(\"aria-controls\") === content.id) return true;\n    }\n    return false;\n}\n\n/**\n * A card's head: the control its title is on, which selects its event.\n *\n * @param region - The agenda\n * @param event - The card's event, as `eventKey` prints it\n * @returns The head; `null` with no such card drawn\n */\nfunction headOf(region: Element, event: string | undefined): HTMLElement | null {\n    if (event === undefined) return null;\n    for (const card of region.querySelectorAll(`[${CARD}]`)) {\n        if (card.getAttribute(CARD) === event) return card.querySelector<HTMLElement>(\"button\");\n    }\n    return null;\n}\n\n/**\n * Keeps the keyboard in the agenda (see the module docs).\n *\n * @returns What the agenda's element spreads\n */\nexport function useAgendaLanding<E extends HTMLElement = HTMLDivElement>(): AgendaLanding<E> {\n    const ref = useRef<E | null>(null);\n    // Whether the keyboard is the agenda's: set as the focus enters it; let go as the focus leaves for another element,\n    // or for the page with the control it was on still there, and at a press outside it.\n    const held = useRef(false);\n    const last = useRef<LastCard | undefined>(undefined);\n    useEffect(() => {\n        const region = ref.current;\n        if (region === null || typeof MutationObserver === \"undefined\") return undefined;\n        const doc = region.ownerDocument;\n        // The agenda drawn again: a control it held the focus on gone, the focus lands on the card drawn in its place, or\n        // the one after it, or before it — else on the Calendar's main.\n        const observer = new MutationObserver(() => {\n            if (!held.current) return;\n            const active = doc.activeElement;\n            if (active !== null && active !== doc.body) {\n                if (!region.contains(active) && !inAgendaLayer(region, active)) held.current = false;\n                return;\n            }\n            const was = last.current;\n            const landing = headOf(region, was?.card) ?? headOf(region, was?.next) ?? headOf(region, was?.previous)\n                ?? region.querySelector<HTMLElement>(`[${CARD}] button`) ?? region.closest<HTMLElement>(\"[data-calendar-main]\");\n            landing?.focus();\n        });\n        observer.observe(region, { childList: true, subtree: true });\n        // A press outside the agenda and the popovers its cards opened is the viewer's move elsewhere, whatever it focuses.\n        const onDown = (event: PointerEvent) => {\n            const target = event.target;\n            if (!(target instanceof Element) || (!region.contains(target) && !inAgendaLayer(region, target))) held.current = false;\n        };\n        doc.addEventListener(\"pointerdown\", onDown, true);\n        return () => {\n            observer.disconnect();\n            doc.removeEventListener(\"pointerdown\", onDown, true);\n        };\n    }, []);\n    const onFocus = useCallback((event: FocusEvent<E>) => {\n        held.current = true;\n        const region = ref.current;\n        const card = event.target instanceof Element ? event.target.closest(`[${CARD}]`) : null;\n        if (region === null || card === null || !region.contains(card)) return;\n        const id = card.getAttribute(CARD);\n        if (id !== null) last.current = { card: id, next: adjacent(region, card, true), previous: adjacent(region, card, false) };\n    }, []);\n    const onBlur = useCallback((event: FocusEvent<E>) => {\n        const region = ref.current;\n        const next = event.relatedTarget;\n        if (next instanceof Element && region !== null && (region.contains(next) || inAgendaLayer(region, next))) return;\n        if (next !== null) {\n            held.current = false;\n            return;\n        }\n        // To the page: let go where the control is still there — a click on nothing — and kept where it went with its card.\n        const left = event.target;\n        queueMicrotask(() => { if (left.isConnected) held.current = false; });\n    }, []);\n    return { ref, onFocus, onBlur };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The mock's desktop views and the non-draggable narrow agenda. A period not\n * read yet draws its own grid at once — never the period before's events under\n * its labels — each region whose events have no known place yet washed, each\n * count a placeholder (#1398, CL2, CL5, CL13); a period whose read failed keeps\n * its grid, its cells blank, and says so once: the time and month grids in a\n * box at their top-left in view, the timeline and the agenda in a line in their\n * first row (CL11).\n *\n * The timeline shows the period chosen and scrolls only within it (ruled 9 Nov\n * 2026), as the Roster's grid does (`timeline.ts`): a scroll never moves the\n * period. It opens its period on the working hours at Day and on the view's\n * date at Week and Month, keeps its place along the period across a step, and\n * brings the now line into view as Today is pressed.\n *\n * A kind past the cap draws none of its events but its drafts (#1424): a\n * resource's row on the timeline, or its column in the Resources view, of a\n * kind it is placed on draws its shading in their place — over each of the\n * view's periods, a bar along the period as long as the share of it the\n * resource's events book, or the no-data hatch where no summary shades at that\n * period (`shading`) — and its booked hours, like a day's count, say they do\n * not count those events (`uncounted`), never 0.\n *\n * A paged resource kind (#1424) is laid out as the stretches of its places\n * (`pages.ts`' `pagedSegments`), never a line or a column a place, so a\n * million resources cost a view what the windows it holds do. On the timeline\n * each held window's resources are rows, and the places between are runs — the\n * shared unloaded run (`UnloadedRun`), as the Plan's and the Sheet's rows not\n * read are: one virtualizer item however long, at its first place's position,\n * its rows drawn at their pitch only where it meets the view, keyed by the\n * places it stands for and their pitch (`run:<result>:<from>-<to>@<pitch>`), so\n * a run a window lands inside is another item and never keeps the height\n * measured for the last; a\n * window whose read failed is a run that says so once, in its first row in\n * view. The view rests in a run on the place there (`useRowAnchor`'s runs). The\n * Resources view places each column it draws at its own offset in a content box\n * as wide as all of them (`--calendar-column-at`), drawing those around the\n * view alone: no grid holds a track a column.\n */\nimport {\n    Fragment, createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent,\n    type ReactNode, type RefObject,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { Box, Button, chakra, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { equalFor, none } from \"@elaraai/east\";\nimport { Schedule } from \"@elaraai/e3-ui/internal\";\nimport { tileNext } from \"@elaraai/east-ui/internal\";\nimport { optimiseMessages, takeKey, useDragEventChip, useDragEventEdge, useDragMessages, useDropCell, type CellCoord, type DragPayload, type Formatters } from \"@elaraai/east-ui-components\";\nimport {\n    LoadingFailedBox, LoadingFailedLine, LoadingWash, PlaceholderShape, UnloadedRun, VirtualRows, devicePixels, loadingLineText, useRowsTop, useSlotClass,\n    useSurfaceGestures, type RowRuns, type RunCell, type RunFailure, keptRead\n} from \"@elaraai/east-ui-components/internal\";\nimport { pagedLoadingMessages, type PeriodRead } from \"../shared/loading.js\";\nimport type { ScheduleCellShade, ScheduleCellShading } from \"../shared/schedule/cells.js\";\nimport { eventsNotCounted, lowerWord } from \"../shared/schedule/words.js\";\nimport type { CalendarBucket } from \"./cells.js\";\nimport { NowChip, NowLine } from \"../shared/time/now-line.js\";\nimport { drawSpan } from \"../shared/time/drag.js\";\nimport { timeScale, timeWords } from \"../shared/time/scale.js\";\nimport { TimeRulerRow, createViewStart, timeRulerUnits } from \"../shared/time/ruler.js\";\nimport { packLanes } from \"../shared/time/lanes.js\";\nimport { shadeBands } from \"../shared/time/shading.js\";\nimport type { ScheduleOverlaps } from \"../shared/schedule/overlaps.js\";\nimport type { ScheduleEditing } from \"../shared/schedule/editing.js\";\nimport { TIMELINE_GUTTER, timelineDayWidth, timelineDays, timelineLanes, timelineOpensAt, timelinePixels, timelineScrollTo, timelineVisible, type TimelineLanes } from \"./timeline.js\";\nimport { GroupHeading, useGroupCollapse } from \"../shared/schedule/group-heading.js\";\nimport { MoveGhost, useMoveGhostClasses } from \"../shared/schedule/move-ghost.js\";\nimport { readRowAnchor, useRowAnchor, type RowAnchor } from \"../shared/schedule/row-anchor.js\";\nimport { useAgendaLanding } from \"./agenda-focus.js\";\nimport { EventActions, type CalendarShownResources } from \"./controls.js\";\nimport { calendarCoord, type CalendarDrag } from \"./drag.js\";\nimport { useEventFocus } from \"./event-focus.js\";\nimport { calendarOpOf, type CalendarOptimised } from \"./optimise.js\";\nimport { opKey } from \"../shared/func/optimise-diff.js\";\nimport type { CalendarCommands, CalendarPlacement } from \"./actions.js\";\nimport { CALENDAR_PAGE_SIZE, pagedFailureAt, pagedPlaces, pagedRowAt, pagedSegments, type CalendarPagedDemand, type CalendarPages } from \"./pages.js\";\nimport { DAY, NOTHING_UNCOUNTED, QUARTER, chronological, dateText, dayStart, eventKey, inWindow, onResource, resourceKey, resourceLabel, sameResource,\n    type CalendarItem, type CalendarKind, type CalendarRange, type CalendarRow, type CalendarStyles, type CalendarUncounted, type CalendarValue,\n    type CalendarView } from \"./model.js\";\n\n/**\n * The views share selection, commands, drafts and overlap state. `rows` are every resource, what an event's label\n * names; `shownRows` are the ones the rail shows (#1343), each layout's columns and rows, and `shown` each kind's.\n */\nexport interface CalendarViewsProps {\n    value: CalendarValue; view: CalendarView; setView: (view: CalendarView) => void; range: CalendarRange; format: Formatters;\n    items: readonly CalendarItem[]; rows: readonly CalendarRow[]; shownRows: readonly CalendarRow[]; shown: CalendarShownResources;\n    now: Date; narrow: boolean; styles: CalendarStyles;\n    selected: ReadonlySet<string>; select: (item: CalendarItem, additive?: boolean) => void; clear: () => void;\n    overlaps: ScheduleOverlaps<CalendarItem>; commands: CalendarCommands | undefined; drag: CalendarDrag;\n    /**\n     * What the views draw of the period's read (#1398): the period as read; a period not read yet — `items` none, its\n     * regions washed and its counts placeholders, unseen until the frame's reveal says so; or one whose read failed — the\n     * failure said once, its cells blank.\n     */\n    read: PeriodRead;\n    /** Moves each time Today is pressed: the time grid and the timeline bring the now line into view (#1398). */\n    nowRevision?: number | undefined;\n    /** Where each layout's view last rested (#1398): what it comes back to as it mounts. */\n    anchor?: CalendarAnchor | undefined;\n    /** Told where a layout's view rests as it settles. */\n    onAnchor?: ((next: Partial<CalendarAnchor>) => void) | undefined;\n    /** The event a pick asks to be shown (#1398), by its printed key: the timeline brings its row and its time into view. */\n    reveal?: string | undefined;\n    /** Told once the event to show is drawn, with its element. */\n    onRevealed?: ((element: HTMLElement) => void) | undefined;\n    /** Opens the selection's Details — Enter on an event, as the Schematic's Enter does (retest C5); `undefined` with no inspector. */\n    onOpen?: (() => void) | undefined;\n    /** What the figures leave out (#1424): the kinds past the cap, which neither a day's count nor a resource's booked hours counts. */\n    uncounted?: CalendarUncounted | undefined;\n    /**\n     * The resources' shading (#1424): by a resource kind's slot, then its resource's key, the share of each of the view's\n     * periods the events of a kind past the cap book there — or none, the no-data hatch.\n     */\n    shading?: ScheduleCellShading | undefined;\n    /** The periods the shading is cut into: the timeline's by its period, the Resources view's day. */\n    bucket?: CalendarBucket | undefined;\n    /**\n     * The paged resource kind's windows the frame holds (#1424): its rows on the timeline and its columns in the\n     * Resources view, laid out at their places in its order — those not read yet as placeholders, read a window at a\n     * time around what the view shows.\n     */\n    pages?: CalendarPages | undefined;\n    /** Where the views report the paged kind's places they show, as their scroll rests: what its windows and cells are read around. */\n    demand?: CalendarPagedDemand | undefined;\n    /**\n     * The paged kind's resources whose cells the reader holds (#1424): any other's row or column draws the wash under\n     * what it holds, and its booked hours a placeholder, until they land; `undefined` where no kind is read by its cells.\n     */\n    drawnRows?: ReadonlySet<string> | undefined;\n    /**\n     * What a run of the app's optimiser left on the events (#1409, R7, R17): each event's operation, which its block\n     * carries (`data-op`) and its hover says, and where a removed or a moved event stood, where its ghost goes.\n     */\n    optimised?: CalendarOptimised | undefined;\n    /** Whether the run's highlight is on (R15, R16): the ghosts show for it alone. */\n    lit?: boolean | undefined;\n    /**\n     * The editing (#1398): what an event draws of it — its draft, and the optimiser's marks and ghosts — and whether its\n     * kind takes a gesture, whatever a read in flight holds back; `undefined` read only. What edits is `commands`'.\n     */\n    editing?: ScheduleEditing | undefined;\n    /**\n     * The events whose rows break their kind's bounds (#1585), by their element keys: each wears the warn ring, stored or\n     * changed, as one holding a conflict does.\n     */\n    bounded?: ReadonlySet<string> | undefined;\n    /**\n     * Whether the events carry their drag handles and edges (#1398, CL9): wherever the board takes edits — an editing, no\n     * run of the optimiser out, its read not failed — through a read in flight too. Retained content refuses the gesture\n     * itself — the shared drag sensors pick nothing up inside the `aria-disabled` main (CL8) — and its `commands` are\n     * withheld meanwhile, so an event draws the same through a read and as it lands.\n     */\n    grips?: boolean | undefined;\n}\n\n/** A ghost a run left (R15): an event removed, struck through where it stood, or moved, dashed where it was — and the run that did it. */\ninterface CalendarGhost {\n    readonly item: CalendarItem;\n    readonly op: \"del\" | \"from\";\n    readonly run: string;\n}\n\n/**\n * The ghosts a run's highlight shows (R15): where an event the run removed stood, struck through; where one it moved\n * stood, dashed — among the events as they stand now, while each is still the run's draft.\n *\n * @param props - The views' props: the run's operations, the events now, and the drafts\n * @returns The ghosts\n */\nfunction ghostsOf(props: Pick<CalendarViewsProps, \"optimised\" | \"lit\" | \"items\" | \"editing\">): CalendarGhost[] {\n    const { optimised, lit, items, editing } = props;\n    if (optimised === undefined || lit !== true) return [];\n    const ghosts: CalendarGhost[] = [];\n    for (const [key, was] of optimised.previous) {\n        const op = optimised.ops.get(key);\n        if (op === undefined || was.start.type !== \"some\" || !draftedIn(editing, was)) continue;\n        const now = items.find(item => item.kind === was.kind && item.key === was.key);\n        if (op.op === \"del\" || now === undefined) { ghosts.push({ item: was, op: \"del\", run: op.run }); continue; }\n        const moved = now.start.type !== \"some\" || now.start.value.getTime() !== was.start.value.getTime()\n            || (now.end.type === \"some\" && was.end.type === \"some\" && now.end.value.getTime() !== was.end.value.getTime()) || !sameResourceOf(now, was);\n        if (moved) ghosts.push({ item: was, op: \"from\", run: op.run });\n    }\n    return ghosts;\n}\n\n/** Whether two events are on one resource. */\nfunction sameResourceOf(a: CalendarItem, b: CalendarItem): boolean {\n    return a.resource.type === \"none\" ? b.resource.type === \"none\" : b.resource.type === \"some\" && a.resource.value.kind === b.resource.value.kind && a.resource.value.key === b.resource.value.key;\n}\n\n/**\n * Whether an event is drafted (#1398): its kind's drafts hold it — read from the editing's drafts, whatever a read in\n * flight holds back of the gestures, so a draft keeps its look while what it is drawn in is retained.\n *\n * @param editing - The editing; `undefined` read only\n * @param event - The event: its kind and its key\n * @returns Whether a draft of it is held\n */\nfunction draftedIn(editing: ScheduleEditing | undefined, event: { readonly kind: string; readonly key: string }): boolean {\n    return editing?.drafts.get(event.kind)?.has(event.key) === true;\n}\n\n/**\n * The days a run changed (§9.5): the day of every event it added or changed, now and before — whose heads' counts flash.\n *\n * @param props - The views' props\n * @returns Each day's date text\n */\nfunction changedDaysOf(props: Pick<CalendarViewsProps, \"optimised\" | \"items\">): ReadonlySet<string> {\n    const days = new Set<string>();\n    const { optimised, items } = props;\n    if (optimised === undefined) return days;\n    for (const [key] of optimised.ops) {\n        const was = optimised.previous.get(key);\n        if (was?.start.type === \"some\") days.add(dateText(was.start.value));\n        const now = items.find(item => opKey(item.kind, item.key) === key);\n        if (now?.start.type === \"some\") days.add(dateText(now.start.value));\n    }\n    return days;\n}\n\n/** How an event stood before a run, as its provenance says it: its day and time, and its resource, or the backlog. */\nfunction previousWords(was: CalendarItem, props: Pick<CalendarViewsProps, \"format\" | \"rows\" | \"value\">): string {\n    if (was.start.type !== \"some\") return lowerWord(props.value.vocabulary.backlog);\n    return `${props.format.weekdayDate(was.start.value)} ${props.format.time(was.start.value)}${was.end.type === \"some\" ? `–${props.format.time(was.end.value)}` : \"\"} · ${resourceLabel(was, props.rows)}`;\n}\n\n/** A ghost's block (R15, R17): decorative, named for what the run did to the event — drawn as an event's block is, of its slots' classes. */\nfunction GhostBlock({ ghost, props, geometry, along = \"y\", chip = false }: { ghost: CalendarGhost; props: EventView; geometry?: CSSProperties; along?: \"x\" | \"y\"; chip?: boolean }) {\n    const { styles, format } = props;\n    const slot = useSlotClass();\n    const { item, run } = ghost;\n    const start = item.start.type === \"some\" ? item.start.value : props.range.from;\n    const title = ghost.op === \"del\" ? optimiseMessages.ghostRemoved({ run }) : optimiseMessages.ghostMoved({ run });\n    return <div className={slot(styles.event)} style={geometry} data-along={along} data-chip={chip ? \"\" : undefined} data-compact={chip || along === \"x\" ? \"\" : undefined}\n        data-op={ghost.op} data-calendar-ghost={eventKey(item)} aria-hidden=\"true\" title={title}>\n        <div className={slot(styles.eventDetail)} data-calendar-event-detail=\"\">{format.time(start)}{item.end.type === \"some\" ? `–${format.time(item.end.value)}` : \"\"}</div>\n        <div className={slot(styles.eventTitle)} data-calendar-event-title=\"\">{item.title}</div>\n    </div>;\n}\n\n/**\n * Where each layout's view rests (#1398): the time grid's hour at its top, and the timeline's top line, by its key, with\n * the px scrolled into it — never a pixel offset of the whole, which the rows above it would move.\n */\nexport interface CalendarAnchor {\n    readonly gridHour?: number | undefined;\n    readonly timeline?: RowAnchor | undefined;\n}\n\n/** Where each layout's view rests, as storage keeps it. */\nexport const readCalendarAnchor = keptRead.record<CalendarAnchor>({ gridHour: keptRead.optional(keptRead.number), timeline: keptRead.optional(readRowAnchor) });\nconst HOURS = Array.from({ length: 24 }, (_, i) => i);\n/** The hour the time grid opens at, the first time: half past five, the working day just above the fold. */\nconst OPENING_HOUR = 5.5;\n/** How long a scroll of the time grid rests before where it rests is saved. */\nconst ANCHOR_REST_MS = 150;\n\n/**\n * An hour's height in the time grid, by the Calendar's density: the pitch its cold load's cover stands at too (#1398, CL1).\n *\n * @param density - The Calendar's density\n * @returns The hour's height, in px\n */\nexport function calendarHour(density: CalendarValue[\"settings\"][\"density\"]): number {\n    return density.type === \"compact\" ? 36 : density.type === \"spacious\" ? 64 : 48;\n}\n\n/**\n * Whether placeholders go where the period's content goes: a period not read yet. Each is unseen at its footprint until\n * the frame's one reveal clock says so (CL4), reading it itself.\n */\nfunction pendingOf(read: PeriodRead): boolean {\n    return read.state === \"pending\";\n}\n\n/** A count or a figure the period's read gives: the words once read, its placeholder while it is read, nothing where it failed. */\nfunction Counted({ props, index, children }: { props: CalendarViewsProps; index: number; children: ReactNode }) {\n    if (props.read.state === \"held\") return <>{children}</>;\n    return pendingOf(props.read) ? <PlaceholderShape kind=\"aggregate\" index={index} /> : null;\n}\n\n/**\n * Where a grid says its failure, read off its laid-out grid (#1398, CL11): just inside the corner its sticky head and\n * its sticky hour column leave of the scroll's view — in the scroll's own box, so it stays in view however the grid\n * scrolls — or, in a month, under the first week's dates.\n *\n * @param scroll - The grid's scroll box\n * @param failed - Whether the period's read failed\n * @returns Where the box sits, from the scroll box's top-left; `undefined` while nothing failed or before layout\n */\nfunction useFailureCorner(scroll: RefObject<HTMLElement | null>, failed: boolean): { top: number; left: number } | undefined {\n    const [at, setAt] = useState<{ top: number; left: number }>();\n    useLayoutEffect(() => {\n        const el = scroll.current;\n        if (!failed || el === null) { setAt(undefined); return; }\n        const box = el.getBoundingClientRect();\n        const below = el.querySelector(\"[data-calendar-day-number]\") ?? el.querySelector(\"[data-calendar-header]\");\n        const beside = el.querySelector(\"[data-calendar-gutter]\");\n        const next = {\n            top: Math.round((below === null ? 0 : below.getBoundingClientRect().bottom - box.top) + 8),\n            left: Math.round((beside === null ? 0 : beside.getBoundingClientRect().right - box.left) + 8),\n        };\n        setAt(before => before?.top === next.top && before.left === next.left ? before : next);\n    }, [failed, scroll]);\n    return at;\n}\n\n/** A failed period's box at its grid's top-left in view (#1398, CL11): its words and its Retry. */\nfunction FailureBox({ props, at }: { props: CalendarViewsProps; at: { top: number; left: number } | undefined }) {\n    if (props.read.state !== \"failed\" || at === undefined) return null;\n    return <LoadingFailedBox message={props.read.message} retry={{ onRetry: props.read.retry }} at={at} />;\n}\n/** Whether a resource's row or column draws what is known of its events (#1424): a paged kind's, once its cells land. */\nfunction rowDrawn(row: CalendarRow, pagedKind: string | undefined, drawnRows: ReadonlySet<string> | undefined): boolean {\n    return drawnRows === undefined || row.resource.type !== \"some\" || row.resource.value.kind !== pagedKind || drawnRows.has(row.resource.value.key);\n}\n\n/**\n * Test-only probe — lets \"a scroll of the timeline sums none of a row's events again\" be asserted as the sums of a row's\n * events run (#1398, CL9). `undefined` outside tests.\n */\nlet bookedProbe: (() => void) | undefined;\n/**\n * Install (or clear) the booked-hours probe. Test use only.\n *\n * @param fn - Called each time a resource's events are summed event by event; `undefined` clears it\n */\nexport function setBookedProbe(fn: (() => void) | undefined): void {\n    bookedProbe = fn;\n}\n\n/** Booked time is measured within the labelled view, including overnight events only once. */\nfunction booked(items: readonly CalendarItem[], row: CalendarRow, from: Date, to: Date): number {\n    bookedProbe?.();\n    return items.reduce((hours, item) => item.start.type === \"some\" && item.end.type === \"some\" && onResource(item, row)\n        ? hours + Math.max(0, Math.min(item.end.value.getTime(), to.getTime()) - Math.max(item.start.value.getTime(), from.getTime())) / 3_600_000 : hours, 0);\n}\n\n/**\n * A resource's line under its name: its meta and its booked hours over a span — or, where a kind past the cap is placed\n * on its kind, that its hours are not counted (#1424), never a sum that leaves those events out unsaid.\n *\n * @param props - The views' props: what is uncounted, and the app's formatters\n * @param row - The resource's row\n * @param hours - Its booked hours over the span, asked only where they are said\n * @returns The line\n */\nfunction bookedWords(props: Pick<CalendarViewsProps, \"uncounted\" | \"format\">, row: CalendarRow, hours: (row: CalendarRow) => number): string {\n    const uncounted = props.uncounted ?? NOTHING_UNCOUNTED;\n    if (row.resource.type === \"some\" && uncounted.resources.has(row.resource.value.kind)) return `${row.meta} · hours not counted`;\n    return `${row.meta} · ${props.format.number(hours(row))} h booked`;\n}\n\n/**\n * A day's count of events: the events drawn on it — or, with a kind past the cap, those and the kinds it counts none of\n * (#1424), never a count that leaves them out unsaid.\n *\n * @param props - The views' props: what is uncounted, and the app's formatters\n * @param n - The events drawn on the day\n * @returns The count's words\n */\nfunction dayCountWords(props: Pick<CalendarViewsProps, \"uncounted\" | \"format\">, n: number): string {\n    const uncounted = props.uncounted ?? NOTHING_UNCOUNTED;\n    if (uncounted.names.length === 0) return `${n} events`;\n    // Every kind past the cap: no event is counted, so no number is said.\n    return eventsNotCounted({ n, count: uncounted.all ? undefined : props.format.number(n), kinds: uncounted.names });\n}\n\n/**\n * A resource's shading in place of the events of a kind past the cap (#1424): over each of the view's periods, a bar\n * from the period's start along it, as long as the share of it the resource's events book — the Plan's booked-vs-free\n * bar — or the no-data hatch across a period no summary shades. Each drawn within the span shown, its geometry a share\n * of it; a period nothing books draws nothing.\n *\n * @param props - The resource's shades, the periods they are cut into, the span shown, which way it runs, the styles and the app's formatters\n * @returns The marks\n */\nfunction ShadeMarks({ shades, bucket, from, to, along, styles, format }: {\n    shades: readonly ScheduleCellShade[]; bucket: CalendarBucket; from: number; to: number; along: \"x\" | \"y\"; styles: CalendarStyles;\n    format: Pick<Formatters, \"percent\">;\n}) {\n    const span = to - from;\n    const place = (start: number, end: number): CSSProperties | undefined => {\n        const first = Math.max(start, from), last = Math.min(end, to);\n        if (last <= first) return undefined;\n        const offset = `${(first - from) / span * 100}%`, size = `${(last - first) / span * 100}%`;\n        return along === \"x\" ? { left: offset, width: size } : { top: offset, height: size };\n    };\n    return <>{shades.map(shade => {\n        const start = shade.at.getTime();\n        const end = tileNext(bucket, shade.at).getTime();\n        if (shade.value.type === \"none\") {\n            const at = place(start, end);\n            return at === undefined ? null : <Box key={start} css={styles.shadeHatch} data-calendar-shade=\"\" data-nodata=\"\" data-along={along} style={at} />;\n        }\n        const share = Math.max(0, Math.min(1, shade.value.value));\n        const at = place(start, start + share * (end - start));\n        const said = `${format.percent(share)} booked`;\n        return at === undefined ? null : <Box key={start} css={styles.shadeBar} data-calendar-shade=\"\" data-along={along} style={at} role=\"img\" aria-label={said} title={said} />;\n    })}</>;\n}\n\n/**\n * What an event and a cell read of the views' props: the same object, in the timeline, while what they draw holds (#1398,\n * CL9) — so a scroll draws none of them again.\n */\ntype EventView = Pick<CalendarViewsProps, \"styles\" | \"drag\" | \"selected\" | \"overlaps\" | \"commands\" | \"range\" | \"view\" | \"value\" | \"format\" | \"rows\" | \"select\" | \"clear\"\n    | \"reveal\" | \"onRevealed\" | \"onOpen\" | \"optimised\" | \"lit\" | \"editing\" | \"bounded\" | \"grips\">;\n\n/**\n * Test-only render probe — lets \"a scroll of the timeline draws no event again, and a step draws each event of the period\n * once\" be asserted as the events' blocks' own renders (#1398, CL9), as `setCalendarFrameRenderProbe` asserts the frame's.\n * `undefined` outside tests.\n */\nlet eventBlockRenderProbe: ((id: string) => void) | undefined;\n/**\n * Install (or clear) the event block render probe. Test use only.\n *\n * @param fn - Called with an event's key each time its block renders; `undefined` clears it\n */\nexport function setEventBlockRenderProbe(fn: ((id: string) => void) | undefined): void {\n    eventBlockRenderProbe = fn;\n}\n\n/**\n * Test-only render probe — lets \"a drag starting or ending draws no event's face again\" be asserted as the faces' own\n * renders (#1594), the block around each hearing the drag. `undefined` outside tests.\n */\nlet eventFaceRenderProbe: ((id: string) => void) | undefined;\n/**\n * Install (or clear) the event face render probe. Test use only.\n *\n * @param fn - Called with an event's key each time its face renders; `undefined` clears it\n */\nexport function setEventFaceRenderProbe(fn: ((id: string) => void) | undefined): void {\n    eventFaceRenderProbe = fn;\n}\n\n/**\n * Test-only render probe — lets \"a drop draws again the row it lands on and no other\" be asserted as the timeline's rows'\n * own renders (#1594). `undefined` outside tests.\n */\nlet timelineRowRenderProbe: ((row: string) => void) | undefined;\n/**\n * Install (or clear) the timeline row render probe. Test use only.\n *\n * @param fn - Called with a resource row's key each time its row renders; `undefined` clears it\n */\nexport function setTimelineRowRenderProbe(fn: ((row: string) => void) | undefined): void {\n    timelineRowRenderProbe = fn;\n}\n\n/**\n * Test-only probe — lets \"a block is measured as the browser hands its box over, never in the commit that mounts it\" be\n * asserted as the measures of the events' blocks' fits (#1398, CL9). `undefined` outside tests.\n */\nlet fitMeasureProbe: ((id: string) => void) | undefined;\n/**\n * Install (or clear) the fit measure probe. Test use only.\n *\n * @param fn - Called with an event's key each time its block's fit is measured; `undefined` clears it\n */\nexport function setFitMeasureProbe(fn: ((id: string) => void) | undefined): void {\n    fitMeasureProbe = fn;\n}\n\n/** Each event's element key, printed once an event (#1398, CL9): what its block, its row's plot and its facts name it by. */\nconst printedKeys = new WeakMap<CalendarItem, string>();\n/**\n * An event's element key: the text East prints of its `Schedule.Types.EventRef`, printed once for each event read.\n *\n * @param item - The event\n * @returns Its key\n */\nfunction keyOf(item: CalendarItem): string {\n    let key = printedKeys.get(item);\n    if (key === undefined) {\n        key = eventKey(item);\n        printedKeys.set(item, key);\n    }\n    return key;\n}\n\n/**\n * What an event's block draws (#1398, CL9), read of the views and of the window it is drawn in: every fact it shows and\n * the handlers it calls. A block draws again only as one of them, its event or where it stands moves: a scroll and a window\n * landing that leave them as they were draw no event again.\n */\ninterface EventFacts {\n    /** Its element's key: the text East prints of its `Schedule.Types.EventRef`. */\n    readonly id: string;\n    readonly styles: CalendarStyles;\n    readonly format: Formatters;\n    /** Its kind: its icon, and its name in the Resources view. */\n    readonly kind: CalendarKind | undefined;\n    /** The layout it is drawn in, and its period: the timeline's bars at Month carry no edges. */\n    readonly layout: CalendarView[\"layout\"];\n    readonly period: CalendarView[\"period\"];\n    /** The name of the resource it is on. */\n    readonly resource: string;\n    /** The drag's surface — where its handle's coordinate is — and whether it takes a drag: its handle, and its edges where it shows them. */\n    readonly surface: string;\n    readonly draggable: boolean;\n    /** Its selection ring, its overlap mark and its draft. */\n    readonly selected: boolean;\n    readonly overlap: boolean;\n    readonly drafted: boolean;\n    /** Whether it holds a conflict not yet chosen: the warn ring. */\n    readonly conflict: boolean;\n    /** Whether its row breaks its kind's bounds (#1585): the warn ring too. */\n    readonly bounds: boolean;\n    /** What a run of the optimiser did to it while it is the run's draft (#1409, R7, R17): its mark, and its provenance on hover. */\n    readonly op: \"add\" | \"chg\" | undefined;\n    readonly provenance: string | undefined;\n    /** Whether a pick asks it to be shown (#1398), and what is told once it is drawn. */\n    readonly revealing: boolean;\n    readonly onRevealed: ((element: HTMLElement) => void) | undefined;\n    /** Its start as it is drawn, as an epoch: its own, or the window's for one with none. */\n    readonly start: number;\n    /** Whether it starts before the window it is drawn in (`↳`), and which of its edges fall inside the window. */\n    readonly continued: boolean;\n    readonly startEdge: boolean;\n    readonly endEdge: boolean;\n    /** What a click or Enter selects it by, and what a press or Space grabs it by. */\n    readonly select: CalendarViewsProps[\"select\"];\n    readonly grab: CalendarDrag[\"grab\"];\n    /** What opens its Details as Enter selects it (retest C5); `undefined` with no inspector. */\n    readonly open: (() => void) | undefined;\n}\n\n/**\n * An event's facts in a view (see {@link EventFacts}).\n *\n * @param view - What it reads of the views\n * @param item - The event\n * @param window - The window its block is drawn in — a time grid's day, the timeline's window; none for a month's chip\n * @returns Its facts\n */\nfunction eventFacts(view: EventView, item: CalendarItem, window: { readonly from: Date; readonly to: Date } | undefined): EventFacts {\n    const id = keyOf(item);\n    const start = item.start.type === \"some\" ? item.start.value.getTime() : view.range.from.getTime();\n    const drafted = draftedIn(view.editing, item);\n    // What a run of the optimiser did to the event (#1409, R7, R17), while it is still the run's draft.\n    const op = drafted ? calendarOpOf(view.optimised, item) : undefined;\n    const marked = op?.op === \"add\" || op?.op === \"chg\" ? op.op : undefined;\n    const was = marked === \"chg\" ? view.optimised?.previous.get(opKey(item.kind, item.key)) : undefined;\n    const run = op?.run ?? \"\";\n    return {\n        id, styles: view.styles, format: view.format, kind: view.value.events.find(kind => kind.key === item.kind),\n        layout: view.view.layout, period: view.view.period, resource: resourceLabel(item, view.rows),\n        surface: view.drag.surface, draggable: view.grips === true && view.editing?.available(item.kind) === true,\n        selected: view.selected.has(id), overlap: view.overlaps.peers.has(id), drafted, op: marked,\n        conflict: view.editing?.conflicted(item.kind, item.key) === true, bounds: view.bounded?.has(id) === true,\n        provenance: marked === \"add\" ? optimiseMessages.entryAdded({ run })\n            : marked === \"chg\" && was !== undefined ? optimiseMessages.entryChanged({ previous: previousWords(was, view), run }) : undefined,\n        revealing: view.reveal !== undefined && view.reveal === id, onRevealed: view.onRevealed,\n        start, continued: window !== undefined && item.start.type === \"some\" && start < window.from.getTime(),\n        startEdge: window === undefined || start >= window.from.getTime(),\n        endEdge: window === undefined || (item.end.type === \"some\" && item.end.value.getTime() <= window.to.getTime()),\n        select: view.select, grab: view.drag.grab, open: view.onOpen,\n    };\n}\n\n/** An event's block: the event, its facts, and where it stands in its cell. */\ninterface EventBlockProps {\n    readonly item: CalendarItem;\n    readonly facts: EventFacts;\n    readonly geometry?: CSSProperties | undefined;\n    /**\n     * Its box, px, where its view places it before it is laid out — a timeline bar's (#1398, CL9): what it guesses its fit\n     * from as it mounts, less what a bar laid out showed its measure takes off its box (`chromeOf`), so a bar whose guess\n     * its measure keeps draws once. Measured, the fit is the measure's.\n     */\n    readonly size?: { readonly width: number; readonly height: number } | undefined;\n    readonly along?: \"x\" | \"y\" | undefined;\n    readonly chip?: boolean | undefined;\n}\n/** Which of an event block's parts fit its box: its title, its icon, its time and its resource lines, its title wrapping, one line. */\ninterface EventFits {\n    readonly title: boolean;\n    readonly time: boolean;\n    readonly resource: boolean;\n    readonly icon: boolean;\n    readonly wrap: boolean;\n    readonly compact: boolean;\n}\n/** The widths of an event block's lines, as measured: none measured yet, a time or a resource line fits nowhere. */\nconst UNMEASURED = { time: Infinity, title: 0, resource: Infinity } as const;\n/**\n * What an event block's measure takes off its box, px, by the views' styles, as a timeline bar the browser laid out shows\n * it (#1398, CL9): across, its rule and its padding; down, its rule. A bar's guess takes it off the box its plot gives it,\n * so the guess reads the recipe's rule and padding off a bar laid out, never repeats them.\n */\nconst chromeOf = new WeakMap<CalendarStyles, { readonly width: number; readonly height: number }>();\n/**\n * Which of an event block's parts fit its box (see {@link EventFits}): from its inner width — its padding box's less its\n * padding — its height, and its lines' widths.\n *\n * @param width - Its inner width, px\n * @param height - Its padding box's height, px\n * @param chip - Whether it is a month's chip\n * @param along - Which way its view runs\n * @param lines - Its time, title and resource lines' widths, px\n * @returns What fits\n */\nfunction fitsIn(width: number, height: number, chip: boolean, along: \"x\" | \"y\", lines: { readonly time: number; readonly title: number; readonly resource: number }): EventFits {\n    const inline = chip || along === \"x\" || height < 36;\n    return { title: width >= (inline ? 26 : 46) && height >= (chip ? 18 : 22),\n        icon: width >= (inline ? 46 : 16) && height >= 16, wrap: !inline && width >= 110 && height >= 84, compact: inline,\n        time: height >= (inline ? 18 : 38) && lines.time + (inline ? lines.title + 38 : 0) <= width - (inline ? 0 : 28),\n        resource: !inline && height >= 64 && width >= 80 && lines.resource <= width };\n}\n/**\n * What the views' event blocks measure their fits by (#1398, CL9): one ResizeObserver for every block they draw, each\n * block measured as the browser hands its box over — once it has laid the frame out, as the block mounts or as its words\n * move, then as it resizes — so the commit that mounts a block forces no style or layout of its own; and every fit one\n * delivery moves is applied in one render, before the frame paints.\n */\ninterface BlockBoxes {\n    /** Measures a block each time the browser hands its box over: from the next it hands over on. */\n    readonly observe: (element: Element, measure: () => void) => void;\n    /** Measures it no more. */\n    readonly unobserve: (element: Element) => void;\n}\n\n/**\n * The views' {@link BlockBoxes}: the one observer made as the first block is measured, and let go with the views.\n *\n * @returns The boxes, and what lets them go\n */\nfunction createBlockBoxes(): BlockBoxes & { readonly disconnect: () => void } {\n    const measures = new Map<Element, () => void>();\n    let observer: ResizeObserver | undefined;\n    return {\n        observe(element, measure) {\n            measures.set(element, measure);\n            observer ??= new ResizeObserver(entries => {\n                // Every fit this delivery moves, in one render before the frame paints.\n                flushSync(() => { for (const entry of entries) measures.get(entry.target)?.(); });\n            });\n            observer.observe(element);\n        },\n        unobserve(element) {\n            measures.delete(element);\n            observer?.unobserve(element);\n        },\n        disconnect() {\n            measures.clear();\n            observer?.disconnect();\n            observer = undefined;\n        },\n    };\n}\n\n/** The views' {@link BlockBoxes}, which their event blocks are measured by. */\nconst BlockBoxesContext = createContext<BlockBoxes | undefined>(undefined);\n\n/** Whether two fits are the same. */\nfunction sameFits(a: EventFits, b: EventFits): boolean {\n    return a.title === b.title && a.time === b.time && a.resource === b.resource && a.icon === b.icon && a.wrap === b.wrap && a.compact === b.compact;\n}\nconst itemEqual = equalFor(Schedule.Types.Item);\n/**\n * Whether two objects hold the same values, field by field — each by identity, as a memo keeps them.\n *\n * @param a - One\n * @param b - The other\n * @returns Whether they hold the same values\n */\nfunction sameFields<T extends object>(a: T | undefined, b: T | undefined): boolean {\n    if (a === b) return true;\n    if (a === undefined || b === undefined) return false;\n    const keys = Object.keys(a) as (keyof T)[];\n    return keys.length === Object.keys(b).length && keys.every(key => Object.is(a[key], b[key]));\n}\n/**\n * Whether an event's block draws as it did (#1398, CL9): its facts and where it stands, field by field, and its event as\n * East compares it — a window read again hands the views its events anew, and those it read as they were draw nothing.\n */\nfunction sameEventBlock(a: EventBlockProps, b: EventBlockProps): boolean {\n    return a.along === b.along && a.chip === b.chip && sameFields(a.facts, b.facts) && sameFields(a.geometry, b.geometry) && sameFields(a.size, b.size)\n        && (Object.is(a.item, b.item) || itemEqual(a.item, b.item));\n}\n/** What an event's face draws. */\ninterface EventFaceProps {\n    readonly item: EventBlockProps[\"item\"];\n    readonly facts: EventBlockProps[\"facts\"];\n    readonly fits: EventFits;\n    readonly timeText: string;\n    readonly resourceText: string;\n    readonly coord: Required<CellCoord>;\n    readonly along: \"x\" | \"y\";\n    readonly chip: boolean;\n    readonly enabled: boolean;\n    readonly time: RefObject<HTMLDivElement | null>;\n    readonly title: RefObject<HTMLDivElement | null>;\n    readonly resource: RefObject<HTMLDivElement | null>;\n}\n/** A face's props kept as they are, each the same value or object while it holds. */\nconst FACE_HELD = [\"fits\", \"timeText\", \"resourceText\", \"along\", \"chip\", \"enabled\", \"time\", \"title\", \"resource\"] as const;\n/**\n * Whether an event's face draws as it did (#1594), as {@link sameEventBlock} holds its block: its facts and its handle's\n * place field by field, and its event as East compares it. A block whose bar has moved draws again, a lane taken beside\n * it — a row of hundreds, as a drop lands among them — and its row hands it its event and its facts anew: what its face\n * shows has not moved.\n */\nfunction sameEventFace(a: EventFaceProps, b: EventFaceProps): boolean {\n    return FACE_HELD.every(prop => Object.is(a[prop], b[prop])) && sameFields(a.coord, b.coord) && sameFields(a.facts, b.facts)\n        && (Object.is(a.item, b.item) || itemEqual(a.item, b.item));\n}\n/**\n * What an event's block shows inside it, apart from the block itself, which is its drag handle. Every draggable draws\n * again as any drag starts or ends (dnd-kit's `useDraggable` reads the drag in flight), and a busy timeline has a\n * thousand of them: so the block alone does (#1594), nothing here hearing the drag and its props holding across those\n * draws.\n */\nconst EventBlockFace = memo(function EventBlockFace({ item, facts, fits, timeText, resourceText, coord, along, chip, enabled, time, title, resource }: EventFaceProps) {\n    const { styles, kind, id } = facts;\n    eventFaceRenderProbe?.(id);\n    const slot = useSlotClass();\n    return <>\n        <div className={slot(styles.eventTop)}>\n            {fits.icon && kind !== undefined && <span className={slot(styles.eventIcon)} data-calendar-event-icon=\"\"><FontAwesomeIcon icon={[\"fas\", kind.icon as IconName]} /></span>}\n            <div ref={time} className={slot(styles.eventDetail)} data-calendar-event-detail=\"\" data-calendar-event-time=\"\" data-measure={!fits.time ? \"\" : undefined}>{timeText}</div>\n            {fits.icon && facts.overlap && <div className={slot(styles.eventWarning)}><FontAwesomeIcon icon={faTriangleExclamation} /></div>}\n        </div>\n        <div ref={title} className={slot(styles.eventTitle)} data-calendar-event-title=\"\" data-wrap={fits.wrap ? \"\" : undefined} data-measure={!fits.title ? \"\" : undefined}>{item.title}</div>\n        <div ref={resource} className={slot(styles.eventResource)} data-calendar-event-detail=\"\" data-calendar-event-resource=\"\" data-measure={!fits.resource ? \"\" : undefined}>{resourceText}</div>\n        {enabled && !chip && !(along === \"x\" && facts.period === \"month\") && <>\n            {facts.startEdge && <EventEdge coord={coord} edge=\"start\" label={item.title} styles={styles} along={along} />}\n            {facts.endEdge && <EventEdge coord={coord} edge=\"end\" label={item.title} styles={styles} along={along} />}\n        </>}\n    </>;\n}, sameEventFace);\n/**\n * The same full event facts, in a card, a block, a month chip or a timeline bar — drawn again only as what it shows\n * moves (#1398, CL9: `sameEventBlock`), its handle, its edges, its fit measured again as it resizes, its ring, its marks,\n * its focus a pick hands it and its reveal.\n */\nconst EventBlock = memo(function EventBlock({ item, facts, geometry, size, along = \"y\", chip = false }: EventBlockProps) {\n    const { styles, format, id } = facts;\n    eventBlockRenderProbe?.(id);\n    const start = new Date(facts.start);\n    const coord = useMemo(() => ({ ...calendarCoord(facts.surface, new Date(facts.start), facts.layout === \"calendar\" ? none : item.resource), event: id }) as Required<CellCoord>,\n        [facts.surface, facts.start, facts.layout, item.resource, id]);\n    const enabled = facts.draggable;\n    const ghost = useMemo(() => <MoveGhost styles={styles} label={item.title} />, [styles, item.title]);\n    const handle = useDragEventChip(enabled ? coord : null, ghost, !enabled, item.title);\n    const block = useRef<HTMLDivElement>(null);\n    // It takes the keyboard a pick in Search Records gives its event (#1398): where its ring is drawn.\n    useEventFocus(id, block);\n    const dragRef = handle?.ref;\n    const attachEvent = useCallback((element: HTMLDivElement | null) => { block.current = element; dragRef?.(element); }, [dragRef]);\n    const title = useRef<HTMLDivElement>(null);\n    const time = useRef<HTMLDivElement>(null);\n    const resource = useRef<HTMLDivElement>(null);\n    // Guessed from its box where its view places it — a timeline bar's — less what a bar laid out showed its measure takes\n    // off its box; else, and before any bar is laid out, every line but the title's taken to fit nowhere until measured.\n    const bar = size !== undefined;\n    const [fits, setFits] = useState((): EventFits => {\n        const chrome = size === undefined ? undefined : chromeOf.get(styles);\n        return size === undefined || chrome === undefined\n            ? { title: true, time: false, resource: false, icon: true, wrap: false, compact: chip || along === \"x\" }\n            : fitsIn(Math.round(size.width) - chrome.width, size.height - chrome.height, chip, along, UNMEASURED);\n    });\n    const timeText = `${facts.continued ? \"↳ \" : \"\"}${format.time(start)}${item.end.type === \"some\" ? `–${format.time(item.end.value)}` : \"\"}`;\n    const resourceText = facts.layout === \"resources\" ? facts.kind?.name ?? item.kind : facts.resource;\n    // Measure whole secondary lines — again as they or the block's size move — as the browser hands its box over, once it\n    // has laid the frame out (CL9): never in the commit that mounts it. Hidden measurement spans never change the event's\n    // geometry.\n    const boxes = useContext(BlockBoxesContext);\n    useLayoutEffect(() => {\n        const element = block.current; if (element === null || boxes === undefined) return;\n        const measure = () => {\n            fitMeasureProbe?.(id);\n            const width = element.clientWidth - 12, height = element.clientHeight;\n            // A bar laid out says what the measure takes off its box, for the guesses of the bars after it.\n            if (bar && element.offsetWidth > 0) chromeOf.set(styles, { width: element.offsetWidth - width, height: element.offsetHeight - height });\n            const next = fitsIn(width, height, chip, along, {\n                time: time.current?.scrollWidth ?? Infinity, title: title.current?.scrollWidth ?? 0, resource: resource.current?.scrollWidth ?? Infinity,\n            });\n            setFits(before => sameFits(before, next) ? before : next);\n        };\n        boxes.observe(element, measure);\n        return () => boxes.unobserve(element);\n    }, [boxes, id, item.title, timeText, resourceText, along, chip, bar, styles]);\n    // The event a pick asks to be shown (#1398): drawn — as a timeline brings it into its view — it tells the frame.\n    const { revealing, onRevealed } = facts;\n    useLayoutEffect(() => { if (revealing && block.current !== null) onRevealed?.(block.current); }, [revealing, onRevealed]);\n    const label = `${item.title}, ${format.weekdayDate(start)} ${timeText}, ${facts.resource}${item.status.type === \"some\" ? `, ${item.status.value.label}` : \"\"}`;\n    const { selected, drafted, provenance, select, grab, open } = facts;\n    const choose = (event: MouseEvent) => { event.stopPropagation(); select(item, event.shiftKey || event.metaKey || event.ctrlKey); };\n    // Plain elements of its slots' classes, each made once a theme (#1398, CL9): a month of a busy timeline mounts a\n    // thousand blocks, and Chakra's styled element works its styles out again at each element it draws.\n    const slot = useSlotClass();\n    return <div {...handle} ref={attachEvent} className={slot(styles.event)} style={geometry} data-along={along} data-chip={chip ? \"\" : undefined} data-compact={fits.compact ? \"\" : undefined}\n        tabIndex={0} role=\"button\" aria-label={provenance === undefined ? label : `${label}. ${provenance}`} title={provenance === undefined ? label : `${provenance} · ${label}`} aria-pressed={selected}\n        data-calendar-event={id} data-selected={selected ? \"\" : undefined} data-overlap={facts.overlap ? \"\" : undefined} data-op={facts.op}\n        data-draft={drafted ? \"\" : undefined} data-drafted={drafted ? \"\" : undefined} data-conflict={facts.conflict ? \"\" : undefined} data-bounds={facts.bounds ? \"\" : undefined} data-draggable={enabled ? \"\" : undefined}\n        onPointerDown={event => {\n            const cell = event.currentTarget.closest<HTMLElement>(\"[data-calendar-cell]\");\n            if (cell !== null) {\n                const rect = cell.getBoundingClientRect();\n                const from = Number(cell.dataset.calendarFrom); const to = Number(cell.dataset.calendarTo);\n                const fraction = along === \"x\" ? (event.clientX - rect.left) / rect.width : (event.clientY - rect.top) / rect.height;\n                const snap = Number(cell.dataset.calendarSnap) || QUARTER;\n                const instant = chip ? start : new Date(from + Math.floor(fraction * (to - from) / snap) * snap);\n                grab(item, instant);\n            }\n            handle?.onPointerDown?.(event);\n        }} onClick={choose} onKeyDown={event => {\n            // Enter selects it and opens its Details, as the Schematic's Enter does (retest C5), the key going no further\n            // than the Calendar (#1398); Space picks it up, the drag's to take.\n            if (event.key === \"Enter\") { takeKey(event); select(item, event.shiftKey); open?.(); }\n            else {\n                if (event.key === \" \") {\n                    const cell = event.currentTarget.closest<HTMLElement>(\"[data-calendar-cell]\");\n                    const rect = cell?.getBoundingClientRect(); const mark = event.currentTarget.getBoundingClientRect();\n                    const from = Number(cell?.dataset.calendarFrom); const to = Number(cell?.dataset.calendarTo); const snap = Number(cell?.dataset.calendarSnap) || QUARTER;\n                    const fraction = rect === undefined ? 0 : along === \"x\" ? (mark.left + mark.width / 2 - rect.left) / rect.width : (mark.top + mark.height / 2 - rect.top) / rect.height;\n                    grab(item, chip || rect === undefined ? start : new Date(from + Math.floor(fraction * (to - from) / snap) * snap));\n                }\n                handle?.onKeyDown?.(event);\n            }\n        }}>\n        <EventBlockFace item={item} facts={facts} fits={fits} timeText={timeText} resourceText={resourceText} coord={coord} along={along} chip={chip} enabled={enabled} time={time} title={title} resource={resource} />\n    </div>;\n}, sameEventBlock);\nfunction EventEdge({ coord, edge, label, styles, along }: { coord: Required<CellCoord>; edge: \"start\" | \"end\"; label: string; styles: CalendarStyles; along: \"x\" | \"y\" }) {\n    const handle = useDragEventEdge(coord, edge, <MoveGhost styles={styles} label={label} />, false, `${edge === \"start\" ? \"Start\" : \"End\"} of ${label}`);\n    const slot = useSlotClass();\n    return <button {...handle} type=\"button\" className={slot(styles.resize)} data-edge={edge} data-along={along} aria-label={`Resize ${edge} of ${label}`}\n        onClick={event => event.stopPropagation()} onPointerDown={event => { event.stopPropagation(); handle?.onPointerDown?.(event); }} />;\n}\n\n/**\n * A continuous cell uses the shared drop grammar and the Calendar's quarter-hour snap. A column of a paged kind's\n * Resources view says its place among the columns (`column`), which places it (#1424).\n */\nfunction DropLane({ props, from, to, resource, along = \"y\", wholeDay = false, children, css, style, draw = true, elementRef, outside = false, unassigned = false, column }: {\n    props: EventView; from: Date; to: Date; resource: CalendarItem[\"resource\"]; along?: \"x\" | \"y\";\n    wholeDay?: boolean; children: ReactNode; css: CalendarStyles[string] | undefined; style?: CSSProperties; draw?: boolean; elementRef?: RefObject<HTMLDivElement | null>; outside?: boolean; unassigned?: boolean;\n    column?: number | undefined;\n}) {\n    const ref = useRef<HTMLDivElement>(null);\n    const resolution = along === \"y\" || props.view.period === \"day\" ? \"hour\" : props.view.period === \"week\" ? \"day\" : \"month\";\n    const scale = useMemo(() => timeScale({ window: { min: from, max: to }, resolution })!, [from, to, resolution]);\n    const snap = scale.fineUnit ?? QUARTER;\n    const [drawing, setDrawing] = useState<{ start: Date; end: Date }>();\n    const [landing, setLanding] = useState<CalendarPlacement>();\n    // Its preview's class, made as the lane is drawn, ahead of the drag that first shows it (see `useSlotClass`).\n    const ghostClass = useSlotClass()(props.styles.ghost);\n    const down = useRef<{ start: Date; x: number; y: number } | undefined>(undefined);\n    // The span a draw stands at: what its release creates, whether or not the render that shows it has committed.\n    const drawn = useRef<{ start: Date; end: Date } | undefined>(undefined);\n    /** Lets go of a press on the lane and of what it drew. */\n    const letGo = () => { down.current = undefined; drawn.current = undefined; setDrawing(undefined); };\n    const coordinate = (x: number, y: number, payload?: DragPayload) => {\n        const rect = ref.current?.getBoundingClientRect();\n        const fraction = rect === undefined ? 0 : along === \"x\" ? (x - rect.left) / rect.width : (y - rect.top) / rect.height;\n        const time = wholeDay ? props.drag.wholeDay(from, payload) : new Date(Math.max(from.getTime(), Math.min(to.getTime(), from.getTime() + Math.floor(fraction * (to.getTime() - from.getTime()) / snap) * snap)));\n        const element = typeof document.elementFromPoint === \"function\" ? document.elementFromPoint(x, y)?.closest(\"[data-calendar-event]\") : undefined;\n        const coord = calendarCoord(props.drag.surface, wholeDay ? time : props.drag.adjust(time, payload), resource, element?.getAttribute(\"data-calendar-event\") ?? undefined);\n        return unassigned ? { ...coord, row: \"unassigned\" } : coord;\n    };\n    // What the drag layer says of the lane to a screen reader, in its words for a cell: its resource by its name — the\n    // Unassigned row's, or none in a view of no resources — and the time the drag rests at, never their keys.\n    const words = useDragMessages();\n    const name = (coord: CellCoord): string => {\n        const at = props.drag.readTime(coord.slot);\n        const when = at === undefined ? \"\" : props.format.dateTime(at);\n        if (unassigned) return words.cell({ row: props.value.vocabulary.unassigned, slot: when });\n        if (resource.type === \"none\") return words.cell({ row: when, slot: \"\" });\n        const own = resource.value;\n        return words.cell({ row: props.rows.find(row => row.resource.type === \"some\" && sameResource(row.resource.value, own))?.label ?? own.key, slot: when });\n    };\n    const drop = useDropCell(props.drag.enabled ? calendarCoord(props.drag.surface, from, resource) : null, !props.drag.enabled,\n        event => props.drag.run(event, true) === undefined, (x, y, payload) => coordinate(x, y, payload), {\n            caption: props.drag.caption, name,\n            onHover: (x, y, payload) => {\n                const next = props.drag.preview(coordinate(x, y, payload), payload);\n                setLanding(before => before?.start.getTime() === next?.start.getTime() && before?.end.getTime() === next?.end.getTime() ? before : next);\n            },\n            // A drag resting elsewhere, or let go or cancelled, leaves no preview behind: a lane rested on again shows\n            // where the drop lands now, never first where it landed before (#1594).\n            onLeave: () => setLanding(undefined),\n            stopAxis: along,\n            stops: () => {\n                const rect = ref.current?.getBoundingClientRect();\n                const count = Math.ceil((to.getTime() - from.getTime()) / snap);\n                return rect === undefined ? [] : Array.from({ length: count }, (_, i) => (along === \"x\" ? rect.left : rect.top) + (i + 0.01) * (along === \"x\" ? rect.width : rect.height) / count);\n            },\n        });\n    const attach = useCallback((element: HTMLDivElement | null) => { ref.current = element; if (elementRef !== undefined) elementRef.current = element; drop(element); }, [drop, elementRef]);\n    const timeAt = (event: PointerEvent) => {\n        const coord = coordinate(event.clientX, event.clientY);\n        const offset = coord.slot;\n        // The slot is produced here from an instant; the shared reader uses the same codec.\n        const parsed = props.drag.readTime(offset); return parsed ?? from;\n    };\n    // A new event drawn on the lane, a surface of the shared pointer core (`useSurfaceGestures`): a press off an event\n    // begins it, the pressing pointer's drag past 4px draws its span, and that pointer's release creates it — a\n    // release with nothing drawn a click on the lane, which lets go of the selection. The draw is its pointer's: no\n    // other pointer's move draws it and no other's lift creates it, and a second finger, the browser taking the\n    // pointer back, the lane losing its capture and the window losing the page each let go of it, creating nothing.\n    const drawGestures = useSurfaceGestures({\n        press: event => { down.current = { start: timeAt(event), x: event.clientX, y: event.clientY }; },\n        drag: event => {\n            const pressed = down.current; if (pressed === undefined || Math.hypot(event.clientX - pressed.x, event.clientY - pressed.y) < 4) return;\n            const span = drawSpan(scale, scale.fracOf(pressed.start), scale.fracOf(timeAt(event)), true);\n            drawn.current = span; setDrawing(span);\n        },\n        release: () => {\n            const span = drawn.current;\n            if (span !== undefined) props.drag.create(span.start, span.end, resource); else if (down.current !== undefined) props.clear();\n            letGo();\n        },\n        drop: letGo,\n    }, { accepts: event => (event.target as Element).closest(\"[data-calendar-event]\") === null });\n    return <Box ref={attach} css={css} style={style} data-calendar-cell=\"\" data-calendar-column={column} data-outside={outside ? \"\" : undefined} data-calendar-from={from.getTime()} data-calendar-to={to.getTime()} data-calendar-snap={snap}\n        onClick={event => { if (!(event.target as Element).closest(\"[data-calendar-event], button\")) props.clear(); }}\n        // Esc lets a draw under way go, the key going no further (#1398); with none, it goes on to the frame.\n        onKeyDown={event => { if (event.key === \"Escape\" && (down.current !== undefined || drawing !== undefined)) { takeKey(event); letGo(); } }}\n        {...(props.drag.enabled && draw && !wholeDay ? drawGestures : {})}>\n        {children}\n        {[{ span: drawing, ghost: false }, { span: landing, ghost: true }].map(({ span, ghost }, i) => {\n            if (span === undefined) return null;\n            const first = Math.max(from.getTime(), span.start.getTime());\n            const last = Math.min(to.getTime(), span.end.getTime());\n            return <div key={i} className={ghostClass} data-calendar-landing={ghost ? \"\" : undefined} data-calendar-draw={!ghost ? \"\" : undefined} data-along={along} data-whole-day={wholeDay ? \"\" : undefined}\n                style={wholeDay ? undefined : along === \"x\"\n                    ? { left: `${(first - from.getTime()) / (to.getTime() - from.getTime()) * 100}%`, width: `${(last - first) / (to.getTime() - from.getTime()) * 100}%` }\n                    : { top: `${(first - from.getTime()) / (to.getTime() - from.getTime()) * 100}%`, height: `${(last - first) / (to.getTime() - from.getTime()) * 100}%` }}>\n                {props.format.time(span.start)}–{props.format.time(span.end)}\n            </div>;\n        })}\n    </Box>;\n}\n\n/**\n * A column of the time grid: a day's, a resource's, or a place of the paged resource kind (#1424) — its resource's\n * once its window is held, a placeholder until then — keyed by what it is.\n */\ninterface GridColumn {\n    readonly day: Date;\n    readonly row: CalendarRow | undefined;\n    /** Its place in the paged kind's order, for one of its places. */\n    readonly at: number | undefined;\n    readonly key: string;\n}\n\n/**\n * A grid's columns, by their place: how many there are, and each as it draws — made as it is drawn, never every one of\n * them a render (#1424), so a paged kind of a million resources costs the grid what the columns around its view do.\n */\ninterface GridColumns {\n    readonly count: number;\n    readonly at: (i: number) => GridColumn;\n}\n\n/**\n * The time grid's columns over days: each day of the period.\n *\n * @param days - The period's days\n * @returns The columns\n */\nfunction dayColumns(days: readonly Date[]): GridColumns {\n    return { count: days.length, at: i => ({ day: days[i]!, row: undefined, at: undefined, key: String(days[i]!.getTime()) }) };\n}\n\n/**\n * The Resources view's columns (#1424): each resource the rail shows, the paged kind's places among them in the\n * kinds' order — before the first column of a kind after it, or the unassigned one — each made by its place.\n *\n * @param shownRows - The resources the rail shows, in the kinds' order, the unassigned one last\n * @param kinds - The resource kinds, in order\n * @param pages - What the frame holds of the paged kind; `undefined` with none\n * @param day - The view's day\n * @returns The columns\n */\nfunction resourceColumns(shownRows: readonly CalendarRow[], kinds: CalendarValue[\"resources\"], pages: CalendarPages | undefined, day: Date): GridColumns {\n    const own = (row: CalendarRow): GridColumn => ({ day, row, at: undefined, key: `row:${row.key}` });\n    if (pages === undefined) return { count: shownRows.length, at: i => own(shownRows[i]!) };\n    const after = kinds.slice(kinds.findIndex(kind => kind.key === pages.kind) + 1).map(kind => kind.key);\n    const found = shownRows.findIndex(row => row.resource.type === \"none\" || after.includes(row.resource.value.kind));\n    const before = found < 0 ? shownRows.length : found;\n    const places = pagedPlaces(pages);\n    return {\n        count: shownRows.length + places,\n        at: i => i < before ? own(shownRows[i]!)\n            : i < before + places ? { day, row: pagedRowAt(pages, i - before), at: i - before, key: `paged:${pages.result}:${i - before}` }\n            : own(shownRows[i - places]!),\n    };\n}\n\n/** The columns drawn either side of those in view, when the Resources view lays a paged kind out (#1424). */\nconst COLUMN_OVERSCAN = 6;\n/** How long the Resources view's scroll rests before the paged places it shows are reported (#1398, CL6). */\nconst COLUMN_DWELL_MS = 100;\n\nfunction TimeGrid(props: CalendarViewsProps) {\n    const hour = calendarHour(props.value.settings.density);\n    const height = hour * 24;\n    const scroll = useRef<HTMLDivElement>(null);\n    // Where the grid's view rests (#1398): the hour at its top — half past five the first time, then wherever it was left,\n    // across a step, a layout or a remount, never back to half past five — saved as a scroll rests. Today brings the now\n    // line into view, a third of the way down.\n    const { onAnchor } = props;\n    const topHour = useRef(props.anchor?.gridHour ?? OPENING_HOUR);\n    const resting = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n    const save = useRef(onAnchor);\n    save.current = onAnchor;\n    useLayoutEffect(() => { if (scroll.current !== null) scroll.current.scrollTop = topHour.current * hour; }, [hour]);\n    // A scroll still resting as the grid goes — a layout switched, the Calendar unmounted — is saved then.\n    useEffect(() => () => {\n        if (resting.current === undefined) return;\n        clearTimeout(resting.current);\n        save.current?.({ gridHour: topHour.current });\n    }, []);\n    const keep = useCallback((el: HTMLElement) => {\n        topHour.current = el.scrollTop / hour;\n        if (resting.current !== undefined) clearTimeout(resting.current);\n        resting.current = setTimeout(() => { resting.current = undefined; save.current?.({ gridHour: topHour.current }); }, ANCHOR_REST_MS);\n    }, [hour]);\n    const seenNow = useRef(props.nowRevision);\n    useLayoutEffect(() => {\n        const el = scroll.current;\n        if (props.nowRevision === seenNow.current || el === null) return;\n        seenNow.current = props.nowRevision;\n        el.scrollTop = Math.max(0, (props.now.getUTCHours() + props.now.getUTCMinutes() / 60) * hour - el.clientHeight / 3);\n        keep(el);\n        // Today pressed is the trigger.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [props.nowRevision]);\n    const resources = props.view.layout === \"resources\";\n    // The columns: the days, or each resource the rail shows — a paged kind's places among them (#1424), drawn only around\n    // what the view shows, its windows and its cells read around the places it shows once its scroll rests. Each column is\n    // made as it is drawn, by its place: never every one a render.\n    const { pages, demand, drawnRows } = props;\n    const paged = resources ? pages : undefined;\n    const pagedResult = paged?.result;\n    const day = dayStart(props.view.date);\n    const columns: GridColumns = resources ? resourceColumns(props.shownRows, props.value.resources, paged, day) : dayColumns(props.range.days);\n    const gutter = useRef<HTMLDivElement>(null);\n    const [drawnColumns, setDrawnColumns] = useState({ from: 0, to: COLUMN_OVERSCAN * 4 });\n    const dwell = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n    useEffect(() => () => { if (dwell.current !== undefined) clearTimeout(dwell.current); }, []);\n    // The columns the view shows, from its scroll: every column as wide as the others, beside the hour column.\n    const shownColumns = (el: HTMLElement): { first: number; last: number } | undefined => {\n        const aside = gutter.current?.getBoundingClientRect().width ?? 0;\n        const track = (el.scrollWidth - aside) / Math.max(1, columns.count);\n        if (!(track > 0) || columns.count === 0) return undefined;\n        return { first: Math.max(0, Math.floor(el.scrollLeft / track)), last: Math.min(columns.count - 1, Math.floor((el.scrollLeft + el.clientWidth - aside - 1) / track)) };\n    };\n    // The paged places among the columns shown, reported once the scroll rests (CL6).\n    const report = (shown: { first: number; last: number }) => {\n        if (demand === undefined || pagedResult === undefined) return;\n        let first: number | undefined;\n        let last: number | undefined;\n        for (let i = shown.first; i <= shown.last; i++) {\n            const at = columns.at(i).at;\n            if (at === undefined) continue;\n            first ??= at;\n            last = at;\n        }\n        if (first !== undefined && last !== undefined) demand.set({ first, last, result: pagedResult });\n    };\n    const follow = (el: HTMLElement, rested: boolean) => {\n        if (paged === undefined) return;\n        const shown = shownColumns(el);\n        if (shown === undefined) return;\n        setDrawnColumns(was => shown.first >= was.from + 2 && shown.last <= was.to - 2 ? was\n            : { from: Math.max(0, shown.first - COLUMN_OVERSCAN), to: Math.min(columns.count - 1, shown.last + COLUMN_OVERSCAN) });\n        if (dwell.current !== undefined) clearTimeout(dwell.current);\n        if (rested) report(shown);\n        else dwell.current = setTimeout(() => { dwell.current = undefined; report(shown); }, COLUMN_DWELL_MS);\n    };\n    // A new narrowing starts its places again, at the grid's start; a mount or new columns place what is drawn at once.\n    useLayoutEffect(() => {\n        const el = scroll.current;\n        if (el === null || paged === undefined) return;\n        follow(el, true);\n        // The columns and their result are the trigger.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [paged === undefined, columns.count, pagedResult]);\n    const seenResult = useRef(pagedResult);\n    useLayoutEffect(() => {\n        if (pagedResult === undefined) return;\n        if (seenResult.current !== undefined && seenResult.current !== pagedResult && scroll.current !== null) scroll.current.scrollLeft = 0;\n        seenResult.current = pagedResult;\n    }, [pagedResult]);\n    const span = paged === undefined ? { from: 0, to: columns.count - 1 } : { from: drawnColumns.from, to: Math.min(drawnColumns.to, columns.count - 1) };\n    const drawn = Array.from({ length: Math.max(0, span.to - span.from + 1) }, (_, n) => ({ column: columns.at(span.from + n), i: span.from + n }));\n    // A paged kind's window the view shows that could not be read: said once, at the grid's top-left (#1398, CL11).\n    const failedAt = paged === undefined ? undefined : drawn.find(({ column }) => column.at !== undefined && pagedFailureAt(paged, column.at) !== undefined)?.column.at;\n    const pagedFailure = paged === undefined || failedAt === undefined ? undefined : (() => {\n        const w = Math.floor(failedAt / CALENDAR_PAGE_SIZE);\n        const to = Math.min(paged.total ?? Infinity, (w + 1) * CALENDAR_PAGE_SIZE);\n        return loadingLineText(pagedLoadingMessages.lineFailed({ noun: paged.group.toLocaleLowerCase(props.format.locale), from: props.format.number(w * CALENDAR_PAGE_SIZE + 1), to: props.format.number(to) }));\n    })();\n    const pagedCorner = useFailureCorner(scroll, pagedFailure !== undefined);\n    // A paged kind's columns are each placed at its own offset among them (the recipe's, by its place): no grid line a column.\n    const place = (i: number): CSSProperties | undefined => paged === undefined ? undefined : { \"--calendar-column-at\": i } as CSSProperties;\n    const placed = (i: number): number | undefined => paged === undefined ? undefined : i;\n    const failure = useFailureCorner(scroll, props.read.state === \"failed\");\n    // A run's ghosts and the days it changed (#1409): drawn in their columns, the changed days' counts flashing.\n    const ghosts = ghostsOf(props);\n    const changedDays = changedDaysOf(props);\n    // Whether the now line's chip shows in the hour column: today among the grid's days — the Resources view's one day.\n    const today = resources ? columns.count > 0 && dateText(day) === dateText(props.now) : props.range.days.some(column => dateText(column) === dateText(props.now));\n    return <><Box ref={scroll} css={props.styles.scroll} data-calendar-time-grid=\"\" data-calendar-unread={props.read.state === \"held\" ? undefined : props.read.state}\n        onScroll={event => { keep(event.currentTarget); follow(event.currentTarget, false); }}>\n        <Box css={props.styles.timeGridContent} data-resources={resources ? \"\" : undefined} data-single={!resources && columns.count === 1 ? \"\" : undefined} style={{ \"--calendar-columns\": columns.count } as CSSProperties}>\n            <Box css={props.styles.head} data-calendar-header=\"\" data-resources={resources ? \"\" : undefined} data-paged={paged === undefined ? undefined : \"\"}><Box css={props.styles.timeGutter} />{drawn.map(({ column, i }) => column.row === undefined && column.at !== undefined\n                // A paged kind's place whose window is not held (#1424): its name a placeholder — none where its read failed.\n                ? <Box key={column.key} css={props.styles.columnHead} style={place(i)} data-calendar-column={placed(i)} data-calendar-unread-column={column.at}>\n                    <Box css={props.styles.resourceHeading}>{pagedFailureAt(paged!, column.at) === undefined && <PlaceholderShape kind=\"label\" index={column.at} />}</Box>\n                </Box>\n                : <chakra.button type=\"button\" key={column.key} css={props.styles.columnHead} style={place(i)} data-calendar-column={placed(i)}\n                data-today={dateText(column.day) === dateText(props.now) ? \"\" : undefined} onClick={() => !resources && props.setView({ ...props.view, period: \"day\", date: column.day.getTime() })}>\n                {column.row === undefined ? <>\n                    <Box css={props.styles.dayHeading} data-calendar-day-heading=\"\"><Box as=\"span\" css={props.styles.weekday}>{props.format.weekday(column.day)}</Box><Box as=\"span\" css={props.styles.dayDate}>{column.day.getUTCDate()}</Box></Box>\n                    <Box css={props.styles.columnMeta} data-calendar-day-count=\"\" data-opn={changedDays.has(dateText(column.day)) ? \"\" : undefined}>\n                        <Counted props={props} index={i}>{dayCountWords(props, props.items.filter(item => inWindow(item, column.day, new Date(column.day.getTime() + DAY))).length)}</Counted>\n                    </Box>\n                </> : <>\n                    <Box css={props.styles.resourceHeading} data-calendar-resource-title=\"\">{column.row.icon !== undefined && <FontAwesomeIcon icon={[\"fas\", column.row.icon as IconName]} />} {column.row.label}</Box>\n                    <Box css={props.styles.columnMeta} data-calendar-booked=\"\">{props.read.state === \"held\" && rowDrawn(column.row, pages?.kind, drawnRows)\n                        ? bookedWords(props, column.row, row => booked(props.items, row, column.day, new Date(column.day.getTime() + DAY)))\n                        : <Box as=\"span\" css={props.styles.unreadMeta}>{column.row.meta}<Counted props={props} index={i}>{props.read.state === \"held\" ? <PlaceholderShape kind=\"aggregate\" index={i} /> : null}</Counted></Box>}</Box>\n                </>}\n            </chakra.button>)}</Box>\n            <Box css={props.styles.columns} style={{ height }} data-paged={paged === undefined ? undefined : \"\"}>\n                <Box ref={gutter} css={props.styles.timeGutter} data-calendar-gutter=\"\">{today && <NowChip styles={props.styles} at={(props.now.getUTCHours() + props.now.getUTCMinutes() / 60) / 24} along=\"y\">{props.format.time(props.now)}</NowChip>}{HOURS.slice(1).map(h => <Box key={h} css={props.styles.timeLabel} style={{ top: h * hour }}>{String(h).padStart(2, \"0\")}:00</Box>)}</Box>\n                {drawn.map(({ column, i }) => {\n                    const from = column.day; const to = new Date(from.getTime() + DAY);\n                    // A paged kind's place whose window is not held (#1424): its column washed until it lands — blank where its\n                    // window's read failed, which the box at the grid's top-left says.\n                    if (column.row === undefined && column.at !== undefined) {\n                        return <Box key={column.key} css={props.styles.column} style={{ height, ...place(i) }} data-calendar-column={placed(i)} data-calendar-unread-column={column.at}>\n                            {pagedFailureAt(paged!, column.at) === undefined && <LoadingWash />}\n                        </Box>;\n                    }\n                    const row = column.row;\n                    const items = props.items.filter(item => inWindow(item, from, to) && (row === undefined || onResource(item, row)));\n                    const spans = items.map(item => ({ start: Math.max(from.getTime(), item.start.type === \"some\" ? item.start.value.getTime() : 0), end: Math.min(to.getTime(), item.end.type === \"some\" ? item.end.value.getTime() : 0) }));\n                    const lanes = packLanes(spans);\n                    // A resource's column of a kind past the cap: its shading in place of those events (#1424).\n                    const ref = row?.resource;\n                    const shades = ref?.type === \"some\" ? props.shading?.get(ref.value.kind)?.get(ref.value.key) : undefined;\n                    return <DropLane key={column.key} props={props} from={from} to={to} resource={row?.resource ?? none} unassigned={row?.resource.type === \"none\"} css={props.styles.column} style={{ height, ...place(i) }}\n                        column={placed(i)}>\n                        {/* A period not read yet: the column washed, under its hour rules, shading and now line (#1398) — and a paged\n                            kind's resource whose cells have not landed (#1424). */}\n                        {(pendingOf(props.read) || (props.read.state === \"held\" && row !== undefined && !rowDrawn(row, pages?.kind, drawnRows))) && <LoadingWash />}\n                        {shades !== undefined && props.bucket !== undefined && props.read.state === \"held\"\n                            && <ShadeMarks shades={shades} bucket={props.bucket} from={from.getTime()} to={to.getTime()} along=\"y\" styles={props.styles} format={props.format} />}\n                        {shadeBands({ min: from, max: to }, { hours: { from: Number(props.value.settings.hours.from), to: Number(props.value.settings.hours.to) } }).map((band, i) => <Box key={i} css={props.styles.shade} data-along=\"y\" style={{ top: `${band.start * 100}%`, height: `${band.width * 100}%` }} />)}\n                        {HOURS.map(h => <Fragment key={h}><Box css={props.styles.hour} style={{ top: h * hour }} />{hour >= 48 && <Box css={props.styles.hour} data-half=\"\" style={{ top: (h + 0.5) * hour }} />}</Fragment>)}\n                        {items.map((item, i) => <EventBlock key={keyOf(item)} item={item} facts={eventFacts(props, item, { from, to })} geometry={{ top: (spans[i]!.start - from.getTime()) / DAY * height, height: (spans[i]!.end - spans[i]!.start) / DAY * height,\n                            left: `calc(${lanes[i]!.lane / lanes[i]!.lanes * 100}% + 2px)`, width: `calc(${lanes[i]!.span / lanes[i]!.lanes * 100}% - 4px)` }} />)}\n                        {ghosts.filter(ghost => inWindow(ghost.item, from, to) && (column.row === undefined || onResource(ghost.item, column.row))).map(ghost => {\n                            const gs = Math.max(from.getTime(), ghost.item.start.type === \"some\" ? ghost.item.start.value.getTime() : 0);\n                            const ge = Math.min(to.getTime(), ghost.item.end.type === \"some\" ? ghost.item.end.value.getTime() : gs);\n                            return <GhostBlock key={`ghost:${eventKey(ghost.item)}`} ghost={ghost} props={props} geometry={{ top: (gs - from.getTime()) / DAY * height, height: Math.max(16, (ge - gs) / DAY * height), left: \"2px\", width: \"calc(100% - 4px)\" }} />;\n                        })}\n                        {dateText(from) === dateText(props.now) && <NowLine styles={props.styles} at={(props.now.getTime() - from.getTime()) / DAY} along=\"y\" dot data-calendar-now=\"\" />}\n                    </DropLane>;\n                })}\n            </Box>\n        </Box>\n    </Box><FailureBox props={props} at={failure} />\n    {pagedFailure !== undefined && pagedCorner !== undefined && <LoadingFailedBox message={pagedFailure} retry={{ onRetry: paged!.retry }} at={pagedCorner} />}</>;\n}\n\nfunction MonthDay({ props, day }: { props: CalendarViewsProps; day: Date }) {\n    const ref = useRef<HTMLDivElement>(null);\n    const [limit, setLimit] = useState(3);\n    const next = new Date(day.getTime() + DAY);\n    const items = chronological(props.items.filter(item => item.start.type === \"some\" && item.start.value.getTime() >= day.getTime() && item.start.value.getTime() < next.getTime()));\n    const ghosts = ghostsOf(props).filter(ghost => ghost.item.start.type === \"some\" && ghost.item.start.value.getTime() >= day.getTime() && ghost.item.start.value.getTime() < next.getTime());\n    useLayoutEffect(() => {\n        const element = ref.current; if (element === null) return;\n        const measure = () => {\n            const available = element.clientHeight - 12 - 28;\n            const all = Math.max(0, Math.floor(available / 25));\n            setLimit(items.length <= all ? all : Math.max(0, Math.floor((available - 28) / 25)));\n        };\n        measure(); const observer = new ResizeObserver(measure); observer.observe(element); return () => observer.disconnect();\n    }, [items.length]);\n    return <DropLane props={props} from={day} to={next} resource={none} wholeDay css={props.styles.monthDay} elementRef={ref} outside={day.getUTCMonth() !== new Date(props.view.date).getUTCMonth()}>\n        <chakra.button type=\"button\" css={props.styles.dayNumber} data-calendar-day-number=\"\" data-today={dateText(day) === dateText(props.now) ? \"\" : undefined} onClick={() => props.setView({ ...props.view, period: \"day\", date: day.getTime() })}>{day.getUTCDate() === 1 ? props.format.monthDay(day) : day.getUTCDate()}{dateText(day) === dateText(props.now) && \" · TODAY\"}</chakra.button>\n        {/* A period not read yet: the cell washed below its date, and no \"+N more\" (#1398). */}\n        {pendingOf(props.read) && <Box css={props.styles.monthWash}><LoadingWash /></Box>}\n        {items.slice(0, limit).map(item => <EventBlock key={keyOf(item)} item={item} facts={eventFacts(props, item, undefined)} chip />)}\n        {ghosts.map(ghost => <GhostBlock key={`ghost:${eventKey(ghost.item)}`} ghost={ghost} props={props} chip />)}\n        {items.length > limit && <chakra.button type=\"button\" css={props.styles.more} onClick={() => props.setView({ ...props.view, period: \"day\", date: day.getTime() })}>+{items.length - limit} more</chakra.button>}\n    </DropLane>;\n}\nfunction MonthGrid(props: CalendarViewsProps) {\n    const columns = props.value.settings.weekends ? 7 : 5;\n    const scroll = useRef<HTMLDivElement>(null);\n    const failure = useFailureCorner(scroll, props.read.state === \"failed\");\n    return <><Box ref={scroll} css={props.styles.scroll} data-calendar-month-grid=\"\" data-calendar-unread={props.read.state === \"held\" ? undefined : props.read.state}\n        style={{ \"--calendar-month-columns\": columns, \"--calendar-month-rows\": props.range.days.length / columns } as CSSProperties}>\n        <Box css={props.styles.head} data-calendar-header=\"\" data-month=\"\">{props.range.days.slice(0, columns).map(day => <Box key={day.getTime()} css={props.styles.columnHead}><Box css={props.styles.weekday}>{props.format.weekday(day)}</Box></Box>)}</Box>\n        <Box css={props.styles.month}>\n            {props.range.days.map(day => <MonthDay key={day.getTime()} props={props} day={day} />)}\n        </Box>\n    </Box><FailureBox props={props} at={failure} /></>;\n}\n\n/**\n * A line of the timeline: a group's band, a resource's row, a resource of the paged resource kind whose window is held\n * (#1424) — keyed by its place, the key a run gives the place before its window lands — or a run of the kind's places\n * not read yet, or of a window whose read failed: one line however many places, keyed by the places it stands for.\n */\ntype TimelineLine = { kind: \"group\"; key: string; group: string; count: number } | { kind: \"row\"; key: string; row: CalendarRow; r: number }\n    | { kind: \"paged\"; key: string; at: number; r: number } | { kind: \"run\"; key: string; from: number; to: number; failed: boolean };\n\n/**\n * A place of the paged kind's key among the timeline's lines: its row's once its window is held, and what the view\n * resting in a run on it keeps (`useRowAnchor`'s runs).\n *\n * @param result - The result its places are of\n * @param at - The place\n * @returns Its key\n */\nfunction placeKey(result: number | undefined, at: number): string {\n    return `paged:${result}:${at}`;\n}\n\n/**\n * The place a key of {@link placeKey} names, under the result its places are of.\n *\n * @param key - The key\n * @param result - The result read now\n * @returns The place; `undefined` for a key that names none of this result's\n */\nfunction placeOfKey(key: string, result: number | undefined): number | undefined {\n    const prefix = `paged:${result}:`;\n    if (result === undefined || !key.startsWith(prefix)) return undefined;\n    const at = Number(key.slice(prefix.length));\n    return Number.isSafeInteger(at) && at >= 0 ? at : undefined;\n}\n/**\n * A resource row's events laid out once a read (#1398, CL9): the events, their spans, their lanes, the plot's least\n * height and where each lane's bars stand in it (`timelineLanes`), and its booked hours over the period, its events summed\n * once, as they are first said.\n */\ninterface TimelineLayout {\n    readonly items: readonly CalendarItem[];\n    readonly spans: readonly { readonly start: number; readonly end: number }[];\n    readonly lanes: ReturnType<typeof packLanes>;\n    /** The plot's least height, and each lane's bars' place in it: their block in its middle. */\n    readonly geometry: TimelineLanes;\n    readonly hours: () => number;\n}\n/** What a timeline row reads, the same object while what the rows draw holds (CL9). */\ninterface TimelineContext {\n    readonly view: EventView;\n    readonly read: PeriodRead;\n    readonly duration: number;\n    /** The plot's width, px: the period's days at the day's width (`timelineDayWidth`). */\n    readonly plotWidth: number;\n    readonly now: Date;\n    readonly shades: ReturnType<typeof shadeBands>;\n    readonly lines: readonly TimelineLine[];\n    /** What its figures leave out (#1424): the kinds past the cap, which a resource's booked hours do not count. */\n    readonly uncounted: CalendarUncounted;\n    /** The resources' shading in place of the events of a kind past the cap (#1424), by kind and resource. */\n    readonly shading: ScheduleCellShading | undefined;\n    /** The periods the shading is cut into: the timeline's by its period. */\n    readonly bucket: CalendarBucket | undefined;\n    /** The paged resource kind's slot (#1424), when one pages. */\n    readonly pagedKind: string | undefined;\n    /** Its resources whose cells the reader holds: any other's row draws the wash under what it holds. */\n    readonly drawnRows: ReadonlySet<string> | undefined;\n    /** Each event's facts, made once while what they read holds: a row drawn again makes none again. */\n    readonly facts: (item: CalendarItem) => EventFacts;\n}\n/**\n * The timeline's events' facts, each made once while what they read holds (#1398, CL9): a row drawn again — its group\n * folded and opened, a row of the paged kind mounted again — makes none of them again.\n *\n * @param view - What the events read of the views\n * @returns Each event's facts, in the timeline's period\n */\nfunction timelineFacts(view: EventView): (item: CalendarItem) => EventFacts {\n    const made = new WeakMap<CalendarItem, EventFacts>();\n    return item => {\n        let facts = made.get(item);\n        if (facts === undefined) {\n            facts = eventFacts(view, item, view.range);\n            made.set(item, facts);\n        }\n        return facts;\n    };\n}\n/** A resource row's key among the events: the resource's, or none's — the unassigned row. */\nfunction rowResource(row: CalendarRow): string { return row.resource.type === \"some\" ? resourceKey(row.resource.value) : \"\"; }\n/**\n * The resource row a failed period says so in (#1398, CL11): the first at or below the line at the top of the view,\n * else the last above it — a resource's row, never a group's band or a run of places not read, which hold no events.\n *\n * @param lines - The timeline's lines\n * @param top - The line at the top of the view; `undefined` before they are placed\n * @returns The line's index; `undefined` with no resource row\n */\nfunction firstRowInView(lines: readonly TimelineLine[], top: number | undefined): number | undefined {\n    const from = Math.max(0, top ?? 0);\n    const isRow = (line: TimelineLine) => line.kind === \"row\" || line.kind === \"paged\";\n    for (let i = from; i < lines.length; i++) if (isRow(lines[i]!)) return i;\n    for (let i = Math.min(from, lines.length) - 1; i >= 0; i--) if (isRow(lines[i]!)) return i;\n    return undefined;\n}\n/** What a resource row's plot is drawn from. */\ninterface TimelinePlotProps {\n    readonly ctx: TimelineContext;\n    readonly row: CalendarRow;\n    readonly layout: TimelineLayout;\n    readonly index: number;\n}\n/** What a resource's row is drawn from: its plot's, what measures it and its place among the resources. */\ninterface TimelineRowProps extends TimelinePlotProps {\n    readonly r: number;\n    readonly measure: (el: HTMLElement | null) => void;\n}\n/** A resource's shading in place of the events of a kind past the cap (#1424), if it has one. */\nfunction shadesOfRow(ctx: TimelineContext, row: CalendarRow): readonly ScheduleCellShade[] | undefined {\n    return row.resource.type === \"some\" ? ctx.shading?.get(row.resource.value.kind)?.get(row.resource.value.key) : undefined;\n}\n/** Whether a row's events are laid out alike: the same events, as East compares them, at the same places in its plot. */\nfunction sameLayout(a: TimelineLayout, b: TimelineLayout): boolean {\n    return a === b || (a.geometry.height === b.geometry.height && a.geometry.bar === b.geometry.bar && a.items.length === b.items.length && a.items.every((item, i) => {\n        const other = b.items[i]!, was = a.spans[i]!, now = b.spans[i]!;\n        return (Object.is(item, other) || itemEqual(item, other)) && was.start === now.start && was.end === now.end && a.lanes[i]!.lane === b.lanes[i]!.lane;\n    }));\n}\n/**\n * Whether a resource's plot draws as it did (#1594): what it reads of the views and the period, its own events laid out\n * alike and each drawn from the same facts — so a drop draws the row it lands on again, and no other, whatever else the\n * views' objects moved. The drag it hands its lane is the same object throughout, answering from the verdicts of now.\n */\nfunction sameTimelinePlot(a: TimelinePlotProps, b: TimelinePlotProps): boolean {\n    const before = a.ctx, after = b.ctx, drew = before.view, draws = after.view;\n    return Object.is(a.row, b.row) && sameLayout(a.layout, b.layout)\n        && before.read.state === after.read.state && (after.read.state !== \"failed\" || (Object.is(before.read, after.read) && a.index === b.index && Object.is(before.lines, after.lines)))\n        && before.duration === after.duration && before.plotWidth === after.plotWidth && Object.is(before.now, after.now) && Object.is(before.shades, after.shades)\n        && before.bucket === after.bucket && before.pagedKind === after.pagedKind\n        && rowDrawn(a.row, before.pagedKind, before.drawnRows) === rowDrawn(b.row, after.pagedKind, after.drawnRows)\n        && Object.is(shadesOfRow(before, a.row), shadesOfRow(after, b.row))\n        && Object.is(drew.styles, draws.styles) && Object.is(drew.range, draws.range) && drew.view.period === draws.view.period && Object.is(drew.format, draws.format)\n        && Object.is(drew.value, draws.value) && Object.is(drew.rows, draws.rows) && Object.is(drew.drag, draws.drag) && Object.is(drew.clear, draws.clear)\n        && Object.is(drew.optimised, draws.optimised) && drew.lit === draws.lit && (draws.optimised === undefined || draws.lit !== true || Object.is(drew.editing, draws.editing))\n        && a.layout.items.every((item, i) => sameFields(before.facts(item), after.facts(b.layout.items[i]!)));\n}\n/** Whether a resource's row draws as it did: its plot, and what its head says beside it. */\nfunction sameTimelineRow(a: TimelineRowProps, b: TimelineRowProps): boolean {\n    return a.r === b.r && Object.is(a.measure, b.measure) && Object.is(a.ctx.uncounted, b.ctx.uncounted) && sameTimelinePlot(a, b);\n}\n/**\n * A resource's booked hours over the period, its events summed once a read (CL9); while the period is read, or a paged\n * kind's resource whose cells have not landed (#1424), its meta and a placeholder, never 0.\n */\nfunction TimelineRowMeta({ ctx, row, layout, r }: { ctx: TimelineContext; row: CalendarRow; layout: TimelineLayout; r: number }) {\n    const { styles, format } = ctx.view;\n    if (ctx.read.state !== \"held\" || !rowDrawn(row, ctx.pagedKind, ctx.drawnRows)) {\n        return <Box css={styles.columnMeta} data-calendar-booked=\"\"><Box as=\"span\" css={styles.unreadMeta}>{row.meta}{ctx.read.state !== \"failed\" && <PlaceholderShape kind=\"aggregate\" index={r} />}</Box></Box>;\n    }\n    return <Box css={styles.columnMeta} data-calendar-booked=\"\">{bookedWords({ uncounted: ctx.uncounted, format }, row, layout.hours)}</Box>;\n}\n/**\n * A row's plot's shading — its weekends, or at Day its hours off — drawn once while its bands and the styles hold, plain\n * elements of the shade slot's class (#1398, CL9): a plot drawn again as its events move draws none of it again.\n */\nconst PlotShading = memo(function PlotShading({ shades, styles }: { shades: ReturnType<typeof shadeBands>; styles: CalendarStyles }) {\n    const shade = useSlotClass()(styles.shade);\n    return <>{shades.map((band, i) => <div key={i} className={shade} data-along=\"x\" style={{ left: `${band.start * 100}%`, width: `${band.width * 100}%` }} />)}</>;\n});\n/**\n * A resource row's plot: its events in the period — every one of them, as the Roster's week draws its duties (ruled 9 Nov\n * 2026) — its wash while the period is read, its shading and its now line; and, the first row in view of a failed period,\n * the failure, which it reads itself (#1398, CL9, CL11). Drawn again only as its events move, never by a scroll, and each\n * event only as what it shows moves (`sameTimelinePlot`). It fills its row, as tall as its lanes or its head makes it, and\n * its lanes' bars — and a shade bar, a lane's bars' height (`--calendar-bar`) — are a block in its middle (`timelineLanes`).\n */\nconst TimelinePlot = memo(function TimelinePlot({ ctx, row, layout, index }: TimelinePlotProps) {\n    const { view, read, duration, plotWidth, now, shades, lines, bucket, facts } = ctx;\n    const { styles, range } = view;\n    const { geometry } = layout;\n    const from = range.from.getTime(), to = range.to.getTime();\n    const says = useRowsTop(top => read.state === \"failed\" && index === firstRowInView(lines, top));\n    // A resource's row of a kind past the cap: its shading in place of those events (#1424).\n    const rowShades = shadesOfRow(ctx, row);\n    return <DropLane props={view} from={range.from} to={range.to} resource={row.resource} unassigned={row.resource.type === \"none\"} along=\"x\" css={styles.rowPlot}\n        style={{ minHeight: geometry.height, \"--calendar-bar\": `${geometry.bar}px` } as CSSProperties} draw={view.view.period !== \"month\"}>\n        {/* A period not read yet: the row's plot washed, under its shading and its now line (#1398). */}\n        {read.state === \"pending\" && <LoadingWash />}\n        {/* A paged kind's resource whose cells have not landed (#1424): washed under what it holds, until they do. */}\n        {read.state === \"held\" && !rowDrawn(row, ctx.pagedKind, ctx.drawnRows) && <LoadingWash />}\n        {read.state === \"held\" && rowShades !== undefined && bucket !== undefined\n            && <ShadeMarks shades={rowShades} bucket={bucket} from={range.from.getTime()} to={range.to.getTime()} along=\"x\" styles={styles} format={view.format} />}\n        {read.state === \"failed\" && says && <Box css={styles.readLine} data-calendar-read-line=\"\">\n            <LoadingFailedLine message={read.message} retry={{ onRetry: read.retry }} /></Box>}\n        <PlotShading shades={shades} styles={styles} />\n        {layout.items.map((item, i) => {\n            const at = layout.spans[i]!;\n            // Out of the period, by the period's own rule.\n            if (!(at.start < to && (at.end > from || at.start >= from))) return null;\n            // Clipped to the period.\n            const first = Math.max(from, at.start), last = Math.min(to, at.end);\n            return <EventBlock key={keyOf(item)} item={item} facts={facts(item)} along=\"x\" geometry={{ top: geometry.top(layout.lanes[i]!.lane), height: geometry.bar,\n                left: `${(first - from) / duration * 100}%`, width: `${(last - first) / duration * 100}%` }}\n                size={{ width: (last - first) / duration * plotWidth, height: geometry.bar }} />;\n        })}\n        {ghostsOf({ ...view, items: layout.items }).filter(ghost => onResource(ghost.item, row)).map(ghost => {\n            const gs = ghost.item.start.type === \"some\" ? ghost.item.start.value.getTime() : range.from.getTime();\n            const ge = ghost.item.end.type === \"some\" ? ghost.item.end.value.getTime() : gs;\n            return <GhostBlock key={`ghost:${eventKey(ghost.item)}`} ghost={ghost} props={view} along=\"x\" geometry={{ top: geometry.top(0), height: geometry.bar,\n                left: `${Math.max(0, gs - range.from.getTime()) / duration * 100}%`, width: `${Math.max(0, Math.min(range.to.getTime(), ge) - Math.max(range.from.getTime(), gs)) / duration * 100}%` }} />;\n        })}\n        {now >= range.from && now < range.to && <NowLine styles={styles} at={(now.getTime() - range.from.getTime()) / duration} data-calendar-now=\"\" />}\n    </DropLane>;\n}, sameTimelinePlot);\n/** A resource's row: its head, its booked hours and its plot — drawn again only as what it shows moves (CL9, `sameTimelineRow`). */\nconst TimelineRow = memo(function TimelineRow({ ctx, row, layout, index, r, measure }: TimelineRowProps) {\n    timelineRowRenderProbe?.(row.key);\n    const { styles } = ctx.view;\n    return <Box ref={measure} css={styles.timelineRow} data-calendar-resource-row={row.key} data-calendar-row-group={row.group}>\n        <Box css={styles.rowHead} data-calendar-row-head=\"\"><Box css={styles.rowTitle} data-calendar-resource-title=\"\">{row.label}</Box><TimelineRowMeta ctx={ctx} row={row} layout={layout} r={r} /></Box>\n        <TimelinePlot ctx={ctx} row={row} layout={layout} index={index} />\n    </Box>;\n}, sameTimelineRow);\n/** A recipe slot's styles, as the shared run merges them over its own. */\nconst slotOf = (styles: CalendarStyles, name: string): SystemStyleObject | undefined => styles[name] as SystemStyleObject | undefined;\n/** A run's rows' tracks: the resource column, as wide as its cell's recipe makes it, then the plot. */\nconst RUN_COLUMNS = \"auto minmax(0, 1fr)\";\n\n/**\n * A run of the paged resource kind's places not read yet (#1424), or of a window whose read failed: the shared unloaded\n * run (`UnloadedRun`), as the Plan's and the Sheet's rows not read are — one item of the timeline however many places, as\n * tall as their rows at their pitch, drawing a row only where it meets the view: its name a placeholder in the sticky\n * resource column and its plot washed. A failed window says so once, in its first row in view, with Retry (#1398, CL11).\n */\nconst TimelineRun = memo(function TimelineRun({ styles, from, to, pitch, failure, retryName, retry }: {\n    styles: CalendarStyles; from: number; to: number; pitch: number; failure: string | undefined; retryName: string | undefined; retry: (() => void) | undefined;\n}) {\n    const cells = useMemo((): RunCell[] => [{ kind: \"label\", css: slotOf(styles, \"runHead\") }, { kind: \"wash\", css: slotOf(styles, \"runPlot\") }], [styles]);\n    const failed = useMemo((): RunFailure | undefined => failure === undefined || retry === undefined ? undefined\n        : { message: failure, retry: { onRetry: retry, name: retryName }, from: 1 }, [failure, retry, retryName]);\n    return <Box data-calendar-run={`${from}-${to}`} data-calendar-run-failed={failed === undefined ? undefined : \"\"}>\n        <UnloadedRun height={(to - from + 1) * pitch} pitch={pitch} columns={RUN_COLUMNS} cells={cells} first={from} rowCss={slotOf(styles, \"runRow\")} failed={failed} />\n    </Box>;\n});\n/** The estimate of a group's band before one has mounted: the shared band's height. */\nconst BAND_FLOOR = 38;\n/**\n * Every timeline line may anchor the view: none is a placeholder whose edge moves as rows land beside it — a run a window\n * lands in is another line, keyed by the places it then stands for, and the view rests in a run on the place there.\n */\nconst ANCHOR_EVERY_LINE = () => true;\n\n/**\n * The timeline (#1398, CL9; ruled 9 Nov 2026): its resources' rows virtualised in their groups — only those in view\n * mounted, each drawn again only as what it shows moves — and on each its events in the period, every one, so a scroll\n * draws none of them again. It draws its period and scrolls only within it (`timeline.ts`), a day at least the period's\n * own width and wider where the view leaves room, so a period narrower than the view fills it. Its view opens the period\n * on the working hours at Day and on the view's date at Week and Month, as it mounts and as its period changes; keeps\n * where it is along the period across a step, a date picked and a resize; and brings the now line a third of the way\n * across as Today is pressed.\n */\nfunction Timeline(props: CalendarViewsProps) {\n    const { collapsed, toggle } = useGroupCollapse(props.drag.surface);\n    const { styles, range, view } = props;\n    const laneHeight = props.value.settings.density.type === \"compact\" ? 26 : props.value.settings.density.type === \"spacious\" ? 40 : 32;\n    const scroll = useRef<HTMLDivElement | null>(null);\n    // The view's width as the browser lays it out, heard as it changes: a day takes the view beside the resource column\n    // where that is wider than the period's own (`timelineDayWidth`).\n    const [viewWidth, setViewWidth] = useState(0);\n    const pixelsPerDay = timelineDayWidth(range, view.period, viewWidth);\n    const duration = range.to.getTime() - range.from.getTime();\n    const width = timelineDays(range) * pixelsPerDay;\n    // What the rows and the ruler take at least: the period's days at their own width, the view stretching them further\n    // where it is wider — one of a few widths, never one a resize makes (a style prop's class each).\n    const leastWidth = timelineDays(range) * timelinePixels(view.period);\n    // Each resource's events, the read's events indexed by resource once — never a search of every event a row.\n    const byResource = useMemo(() => {\n        const by = new Map<string, CalendarItem[]>();\n        for (const item of props.items) {\n            const key = item.resource.type === \"some\" ? resourceKey(item.resource.value) : \"\";\n            const theirs = by.get(key);\n            if (theirs === undefined) by.set(key, [item]);\n            else theirs.push(item);\n        }\n        return by;\n    }, [props.items]);\n    // The paged resource kind (#1424): its places, its rows a window at a time, and the result its places are of.\n    const { pages, demand } = props;\n    const places = pages === undefined ? 0 : pagedPlaces(pages);\n    const pagedKey = pages?.kind;\n    const pagedGroup = pages?.group;\n    const pagesResult = pages?.result;\n    const pagedWindows = pages?.windows;\n    const pagedFailed = pages?.failed;\n    const pagedRows = useMemo(() => pagedWindows === undefined ? [] : [...pagedWindows.values()].flat(), [pagedWindows]);\n    // Each kind of line's estimate, from the first of it to mount: a band's own height, a row's its plot's or its head's.\n    const [rowFloor, setRowFloor] = useState(0);\n    const [bandFloor, setBandFloor] = useState(BAND_FLOOR);\n    // A place not read yet's pitch: a row of one lane — or as tall as a row's head, if that is taller — and its rule. A run\n    // of places is as tall as its places at it.\n    const oneLane = timelineLanes(1, laneHeight).height;\n    const pitch = Math.max(oneLane, rowFloor) + 1;\n    // Each row's events laid out once a read: their spans, their lanes and the plot's height — however its events fall —\n    // and its booked hours over the period, summed as they are first said.\n    const periodFrom = range.from, periodTo = range.to;\n    const layouts = useMemo(() => new Map([...props.shownRows, ...pagedRows].map(row => {\n        const items = byResource.get(rowResource(row)) ?? [];\n        const spans = items.map(item => {\n            const start = item.start.type === \"some\" ? item.start.value.getTime() : 0;\n            const end = item.end.type === \"some\" ? item.end.value.getTime() : 0;\n            return view.period === \"month\" ? { start: Math.floor(start / DAY) * DAY, end: Math.ceil(end / DAY) * DAY } : { start, end };\n        });\n        // A period not read yet: one lane a row, which grows below the row in view as its events land.\n        const lanes = packLanes(spans);\n        let hours: number | undefined;\n        const layout: TimelineLayout = { items, spans, lanes, geometry: timelineLanes(lanes.reduce((n, lane) => Math.max(n, lane.lanes), 1), laneHeight),\n            hours: () => (hours ??= booked(items, row, periodFrom, periodTo)) };\n        return [row.key, layout] as const;\n    })), [props.shownRows, pagedRows, byResource, view.period, laneHeight, periodFrom, periodTo]);\n    // The lines: each group's band, and its rows unless it is folded — the paged kind's, among the groups in the kinds'\n    // order (#1424), the stretches of its places: a row each of the windows held, keyed by its place under the result its\n    // places are of, and a run each of the places between not read yet or of a window that failed, keyed by the places it\n    // stands for — never a line a place.\n    const { resources } = props.value;\n    const lines = useMemo((): TimelineLine[] => {\n        const groups = [...new Set(props.shownRows.map(row => row.group))];\n        if (pagedGroup !== undefined) {\n            const after = resources.slice(resources.findIndex(kind => kind.key === pagedKey) + 1).map(kind => kind.name);\n            const at = groups.findIndex(group => group === \"\" || after.includes(group));\n            groups.splice(at < 0 ? groups.length : at, 0, pagedGroup);\n        }\n        let r = 0;\n        return groups.flatMap((group): TimelineLine[] => {\n            if (group === pagedGroup) {\n                const band: TimelineLine = { kind: \"group\", key: `group:${group}`, group, count: places };\n                if (collapsed.includes(group) || pagedWindows === undefined || pagedFailed === undefined) return [band];\n                const base = r;\n                r += places;\n                return [band, ...pagedSegments({ windows: pagedWindows, failed: pagedFailed }, places).flatMap((segment): TimelineLine[] => segment.kind === \"held\"\n                    ? segment.rows.map((_, i): TimelineLine => ({ kind: \"paged\", key: placeKey(pagesResult, segment.from + i), at: segment.from + i, r: base + segment.from + i }))\n                    : [{ kind: \"run\", key: `${segment.kind === \"failed\" ? \"failed\" : \"run\"}:${pagesResult}:${segment.from}-${segment.to}@${pitch}`,\n                        from: segment.from, to: segment.to, failed: segment.kind === \"failed\" }])];\n            }\n            const rows = props.shownRows.filter(row => row.group === group);\n            return [{ kind: \"group\" as const, key: `group:${group}`, group, count: rows.length },\n                ...(collapsed.includes(group) ? [] : rows.map(row => ({ kind: \"row\" as const, key: `row:${row.key}`, row, r: r++ })))];\n        });\n    }, [props.shownRows, collapsed, resources, pagedKey, pagedGroup, places, pagesResult, pagedWindows, pagedFailed, pitch]);\n    const shades = useMemo(() => shadeBands({ min: range.from, max: range.to }, { hours: view.period === \"day\" ? { from: Number(props.value.settings.hours.from), to: Number(props.value.settings.hours.to) } : undefined }),\n        [range.from, range.to, view.period, props.value.settings.hours]);\n    // What an event and a cell read, held while it holds.\n    const { drag, selected, overlaps, commands, value, format, rows, select, clear, reveal, onRevealed, onOpen, optimised, lit, editing, bounded, grips } = props;\n    const eventView = useMemo((): EventView => ({ styles, drag, selected, overlaps, commands, range, view, value, format, rows, select, clear, reveal, onRevealed, onOpen,\n        optimised, lit, editing, bounded, grips }),\n    [styles, drag, selected, overlaps, commands, range, view, value, format, rows, select, clear, reveal, onRevealed, onOpen, optimised, lit, editing, bounded, grips]);\n    // Each event's facts, made once while what they read holds: a row drawn again makes none again (CL9).\n    const facts = useMemo(() => timelineFacts(eventView), [eventView]);\n    const uncounted = props.uncounted ?? NOTHING_UNCOUNTED;\n    const ctx = useMemo((): TimelineContext => ({ view: eventView, read: props.read, duration, plotWidth: width,\n        now: props.now, shades, lines, uncounted, shading: props.shading, bucket: props.bucket, pagedKind: pagedKey, drawnRows: props.drawnRows, facts }),\n    [eventView, props.read, duration, width, props.now, shades, lines, uncounted, props.shading, props.bucket, pagedKey, props.drawnRows, facts]);\n    // Where the view starts, published as it scrolls to the ruler's bands alone (CL9): the caption of the period it starts\n    // in sticks beside the resource column, and only that one and its neighbours are sticky. Nothing else hears a scroll.\n    const [viewStart] = useState(createViewStart);\n    const publish = () => {\n        const element = scroll.current;\n        if (element === null || element.clientWidth <= 0) return;\n        viewStart.set(timelineVisible(range, element.scrollLeft, element.clientWidth, timelineDayWidth(range, view.period, element.clientWidth)).from.getTime());\n    };\n    // Where the view opens its period (ruled 9 Nov 2026): as the timeline mounts — a layout switched to it, a remount — and\n    // as its period changes, on the working hours at Day and on the view's date at Week and Month (`timelineOpensAt`),\n    // once the view is laid out. A step, a date picked and a resize place nothing: the view keeps where it is along the\n    // period, as the Roster's does, the browser holding it within a shorter period.\n    const opened = useRef<CalendarView[\"period\"] | undefined>(undefined);\n    const hours = props.value.settings.hours;\n    const open = () => {\n        const element = scroll.current;\n        if (element === null || element.clientWidth <= 0 || opened.current === view.period) return;\n        opened.current = view.period;\n        const at = timelineOpensAt(view, range, { from: Number(hours.from), to: Number(hours.to) });\n        element.scrollLeft = timelineScrollTo(range, at, 1 / 2, timelineDayWidth(range, view.period, element.clientWidth), element.clientWidth);\n    };\n    useLayoutEffect(() => {\n        const element = scroll.current; if (element === null) return;\n        setViewWidth(element.clientWidth);\n        open(); publish();\n        // A period drawn, or another of them, is the trigger.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [range.from.getTime(), range.to.getTime(), view.period]);\n    useLayoutEffect(() => {\n        const element = scroll.current; if (element === null) return;\n        const observer = new ResizeObserver(() => { setViewWidth(element.clientWidth); open(); publish(); });\n        observer.observe(element); return () => observer.disconnect();\n        // Rebound as the period moves, so it publishes what the view shows of the period drawn.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [range.from.getTime(), range.to.getTime(), view.period]);\n    // Today pressed (#1398): the now line brought into view a third of the way across, as the time grid brings it a third\n    // of the way down — once the period drawn holds it.\n    const seenNow = useRef(props.nowRevision);\n    useLayoutEffect(() => {\n        const element = scroll.current;\n        const at = props.now.getTime();\n        if (props.nowRevision === seenNow.current || element === null || element.clientWidth <= 0 || at < range.from.getTime() || at >= range.to.getTime()) return;\n        seenNow.current = props.nowRevision;\n        element.scrollLeft = timelineScrollTo(range, at, 1 / 3, timelineDayWidth(range, view.period, element.clientWidth), element.clientWidth);\n        publish();\n        // Today pressed, or the period it went to drawn, is the trigger.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [props.nowRevision, range.from.getTime(), range.to.getTime()]);\n    const onScroll = () => publish();\n    const measured = useRef({ band: false, row: false });\n    const measureBand = useCallback((el: HTMLElement | null) => {\n        if (el === null || measured.current.band) return;\n        const px = devicePixels(el.getBoundingClientRect().height);\n        if (px <= 0) return;\n        measured.current.band = true;\n        setBandFloor(px);\n    }, []);\n    const measureRow = useCallback((el: HTMLElement | null) => {\n        if (el === null || measured.current.row) return;\n        const head = el.firstElementChild;\n        const px = head === null ? 0 : devicePixels(head.getBoundingClientRect().height);\n        if (px <= 0) return;\n        measured.current.row = true;\n        setRowFloor(px);\n    }, []);\n    const getItemKey = useCallback((i: number) => lines[i]!.key, [lines, rowFloor, bandFloor]); // eslint-disable-line react-hooks/exhaustive-deps -- a new floor re-keys the places\n    // A line's row: a resource's, or a paged kind's place whose window is held (#1424).\n    const rowOf = useCallback((line: TimelineLine): CalendarRow | undefined =>\n        line.kind === \"row\" ? line.row : line.kind === \"paged\" && pages !== undefined ? pagedRowAt(pages, line.at) : undefined, [pages]);\n    const estimateSize = useCallback((i: number) => {\n        const line = lines[i]!;\n        if (line.kind === \"group\") return bandFloor;\n        // A run of places not read, as many rows of one lane as it stands for (#1424).\n        if (line.kind === \"run\") return (line.to - line.from + 1) * pitch;\n        // A row as tall as its plot or its head, whichever is taller, and its rule.\n        const row = rowOf(line);\n        return Math.max((row === undefined ? undefined : layouts.get(row.key)?.geometry.height) ?? oneLane, rowFloor) + 1;\n    }, [lines, rowOf, layouts, oneLane, rowFloor, bandFloor, pitch]);\n    // A paged kind's window that could not be read, as its run's first row in view says it (#1398, CL11), its Retry named\n    // by what it asks again.\n    const noun = pagedGroup?.toLocaleLowerCase(format.locale);\n    const failedRange = useCallback((at: number) => {\n        const w = Math.floor(at / CALENDAR_PAGE_SIZE);\n        return { noun: noun ?? \"\", from: format.number(w * CALENDAR_PAGE_SIZE + 1), to: format.number(Math.min(pages?.total ?? Infinity, (w + 1) * CALENDAR_PAGE_SIZE)) };\n    }, [pages?.total, noun, format]);\n    const pagedRetry = pages?.retry;\n    const renderRow = useCallback((i: number) => {\n        const line = lines[i]!;\n        if (line.kind === \"group\") return <GroupHeading scope=\"calendar\" group={{ key: line.group, label: line.group || value.vocabulary.unassigned }} styles={styles} collapsed={collapsed.includes(line.group)} toggle={toggle} measure={measureBand}>\n            <Box as=\"span\" css={styles.groupMeta}>{format.number(line.count)} {lowerWord(line.count === 1 ? value.vocabulary.resources.one : value.vocabulary.resources.other)}</Box>\n        </GroupHeading>;\n        if (line.kind === \"run\") {\n            const failed = line.failed ? failedRange(line.from) : undefined;\n            return <TimelineRun styles={styles} from={line.from} to={line.to} pitch={pitch} retry={pagedRetry}\n                failure={failed === undefined ? undefined : loadingLineText(pagedLoadingMessages.lineFailed(failed))}\n                retryName={failed === undefined ? undefined : pagedLoadingMessages.retryRange(failed)} />;\n        }\n        const row = rowOf(line);\n        return row === undefined ? null : <TimelineRow ctx={ctx} row={row} layout={layouts.get(row.key)!} index={i} r={line.r} measure={measureRow} />;\n    }, [lines, styles, collapsed, toggle, measureBand, ctx, layouts, measureRow, rowOf, failedRange, pagedRetry, pitch, format, value.vocabulary]);\n    // The paged kind's places the view shows, reported as its scroll rests (#1424, CL6): what its windows and the cells of\n    // the events on it are read around — each row of it shown, and of a run under the view's centre the places from the\n    // view's top to its foot, read from the px of it the centre is at; of a run beside that one, the place it meets the\n    // view at. A view of no place of it leaves the last report standing.\n    const onRangeChange = useCallback((_range: { startIndex: number; endIndex: number }, isScrolling: boolean, center?: { index: number; withinPx: number },\n        shown?: { startIndex: number; endIndex: number }) => {\n        if (demand === undefined || pagesResult === undefined || isScrolling || shown === undefined) return;\n        // The view's height, and what of its top the pinned head covers: the frame's own measures of them.\n        const element = scroll.current;\n        const height = element?.clientHeight ?? 0;\n        const head = element?.querySelector<HTMLElement>(\"[data-calendar-header]\")?.offsetHeight ?? 0;\n        let first: number | undefined;\n        let last: number | undefined;\n        const take = (from: number, to: number) => {\n            first = first === undefined ? from : Math.min(first, from);\n            last = last === undefined ? to : Math.max(last, to);\n        };\n        for (let i = shown.startIndex; i <= shown.endIndex; i++) {\n            const line = lines[i];\n            if (line?.kind === \"paged\") take(line.at, line.at);\n            else if (line?.kind === \"run\") {\n                if (center !== undefined && center.index === i) {\n                    const place = (px: number) => line.from + Math.min(line.to - line.from, Math.max(0, Math.floor(px / pitch)));\n                    take(place(center.withinPx - height / 2 + head), place(center.withinPx + height / 2 - 1));\n                } else {\n                    // Above the item under the centre, a run meets the view at its last place; below it, at its first.\n                    const edge = center !== undefined && i < center.index ? line.to : line.from;\n                    take(edge, edge);\n                }\n            }\n        }\n        if (first !== undefined && last !== undefined) demand.set({ first, last, result: pagesResult });\n    }, [demand, pagesResult, lines, pitch]);\n    // A new narrowing of the paged kind is a new result (#1424): its places start again, and so does the view, at the top.\n    const seenResult = useRef(pagesResult);\n    useLayoutEffect(() => {\n        if (pagesResult === undefined) return;\n        if (seenResult.current !== undefined && seenResult.current !== pagesResult && scroll.current !== null) scroll.current.scrollTop = 0;\n        seenResult.current = pagesResult;\n    }, [pagesResult]);\n    // Where the timeline's view rests (#1398): its top line by key and the px into it, saved as a scroll settles, and\n    // brought back once its lines are laid out — the line it left, wherever the lines above it moved. Resting in a run of\n    // the paged kind's places (#1424), it rests on the place there, by the key its row takes once read, and comes back to\n    // that place: in the run that holds it while it is not read, on its row once it is. The frame anchors its scroll on\n    // that place too, so a window landing in the run, or above it, keeps it where it was on screen.\n    const { onAnchor } = props;\n    const save = useCallback((at: RowAnchor) => onAnchor?.({ timeline: at }), [onAnchor]);\n    const runs = useMemo((): RowRuns | undefined => pagesResult === undefined ? undefined : {\n        rowAt: (index, offset) => {\n            const line = lines[index];\n            if (line?.kind !== \"run\") return undefined;\n            const k = Math.min(line.to - line.from, Math.max(0, Math.floor(offset / pitch)));\n            return { key: placeKey(pagesResult, line.from + k), offset: offset - k * pitch };\n        },\n        find: (at) => {\n            const place = placeOfKey(at.key, pagesResult);\n            if (place === undefined) return undefined;\n            const index = lines.findIndex(line => line.kind === \"run\" && line.from <= place && place <= line.to);\n            const line = lines[index];\n            return line?.kind === \"run\" ? { index, offset: (place - line.from) * pitch + at.offset } : undefined;\n        },\n    }, [lines, pagesResult, pitch]);\n    const { restore, onAnchorChange } = useRowAnchor(lines, props.anchor?.timeline, save, true, undefined, runs);\n    // An event a pick asks to be shown (#1398): its row brought into the view's middle — its group opened, if folded —\n    // and its time to the view's centre, which mounts the events there; drawn, the event tells the frame.\n    const [scrollTo, setScrollTo] = useState<{ index: number; nonce: number }>();\n    useLayoutEffect(() => {\n        if (reveal === undefined) return;\n        const item = props.items.find(event => eventKey(event) === reveal);\n        if (item === undefined || item.start.type !== \"some\") return;\n        const at = lines.findIndex(line => { const row = rowOf(line); return row !== undefined && onResource(item, row); });\n        if (at < 0) {\n            const row = props.shownRows.find(shown => onResource(item, shown));\n            if (row !== undefined && collapsed.includes(row.group)) toggle(row.group);\n            return;\n        }\n        const element = scroll.current;\n        if (element !== null && element.clientWidth > 0) {\n            element.scrollLeft = timelineScrollTo(range, item.start.value.getTime(), 1 / 2, timelineDayWidth(range, view.period, element.clientWidth), element.clientWidth);\n            publish();\n        }\n        setScrollTo(was => ({ index: at, nonce: (was?.nonce ?? 0) + 1 }));\n        // A reveal asked, or the events and the lines it is found among landing, is the trigger.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [reveal, props.items, lines]);\n    const words = useMemo(() => timeWords(format.locale), [format.locale]);\n    const ticks = useMemo(() => timeScale({ window: { min: range.from, max: range.to }, resolution: view.period === \"day\" ? \"hour\" : \"day\", words })!, [range.from, range.to, view.period, words]);\n    const units = useMemo(() => timeRulerUnits(ticks, words, view.period === \"day\" ? \"day\" : view.period === \"week\" ? \"week\" : \"month\")!, [ticks, words, view.period]);\n    const header = <Box css={styles.head} data-calendar-header=\"\" data-timeline=\"\"><Box css={styles.headerCaption} data-calendar-header-caption=\"\">{value.vocabulary.resources.other}</Box><Box css={styles.ruler}>\n        <TimeRulerRow scale={units} styles={styles} band=\"units\" owner=\"calendar\" sticky={viewStart} />\n        <TimeRulerRow scale={ticks} styles={styles} band=\"ticks\" owner=\"calendar\" sticky={viewStart} />\n    </Box></Box>;\n    return <VirtualRows fillParent height={undefined} maxHeight={undefined} rootCss={styles.scroll} scrollElRef={scroll} onScroll={onScroll}\n        rootProps={{ \"data-calendar-timeline\": \"\", \"data-calendar-unread\": props.read.state === \"held\" ? undefined : props.read.state } as Record<string, string | undefined>}\n        minWidth={`${leastWidth + TIMELINE_GUTTER}px`} headerZIndex={5} header={header} count={lines.length} getItemKey={getItemKey} estimateSize={estimateSize}\n        anchorable={ANCHOR_EVERY_LINE} runs={runs} renderRow={renderRow} onAnchorChange={onAnchorChange} restoreAnchor={restore}\n        onRangeChange={demand === undefined || pages === undefined ? undefined : onRangeChange}\n        scrollToIndex={scrollTo?.index} scrollNonce={scrollTo?.nonce} scrollAlign=\"center\" />;\n}\n\n/**\n * The narrow layout mounts no drag sources, edges, cells or pointer gestures. A period not read yet: each day's group,\n * real, and one placeholder card in it; a period whose read failed says so once, in the first day's card (#1398). A\n * card's action that takes its card away — Delete, Return to backlog, a Move to another day — leaves the keyboard on\n * the card drawn in its place, else the next card, never on the page's body (`agenda-focus.ts`).\n */\nfunction Agenda(props: CalendarViewsProps) {\n    const { read } = props;\n    const landing = useAgendaLanding();\n    return <Box ref={landing.ref} css={props.styles.scroll} data-calendar-agenda=\"\" data-calendar-unread={read.state === \"held\" ? undefined : read.state}\n        onFocus={landing.onFocus} onBlur={landing.onBlur}><Box css={props.styles.agenda}>\n        {props.range.days.map((day, d) => {\n            const next = new Date(day.getTime() + DAY);\n            const items = chronological(props.items.filter(item => inWindow(item, day, next)));\n            if (read.state !== \"held\") return <Box key={day.getTime()} css={props.styles.agendaGroup} data-calendar-day={dateText(day)}>\n                <Box css={props.styles.agendaHead} data-calendar-agenda-heading=\"\">{props.format.weekdayDate(day)}</Box>\n                <Box css={props.styles.card} data-calendar-unread-card=\"\" data-blank={read.state === \"failed\" ? \"\" : undefined} aria-hidden={read.state === \"failed\" && d === 0 ? undefined : true}>\n                    {read.state === \"failed\" && d === 0 ? <LoadingFailedLine message={read.message} retry={{ onRetry: read.retry }} /> : <Box css={props.styles.cardHead}>\n                        <Box css={props.styles.cardTitle}><PlaceholderShape kind=\"label\" index={d} /></Box>\n                        <Box css={props.styles.detail}><PlaceholderShape kind=\"text\" index={d + 1} /></Box>\n                    </Box>}\n                </Box>\n            </Box>;\n            // The run's ghosts of the day (#1409, R15): each a card, decorative, named for what the run did.\n            const ghosts = ghostsOf(props).filter(ghost => inWindow(ghost.item, day, next));\n            return <Box key={day.getTime()} css={props.styles.agendaGroup} data-calendar-day={dateText(day)}>\n                <Box css={props.styles.agendaHead} data-calendar-agenda-heading=\"\">{props.format.weekdayDate(day)}</Box>\n                {items.length === 0 && ghosts.length === 0 && <Box css={props.styles.empty}>Nothing scheduled</Box>}\n                {items.map(item => <AgendaCard key={eventKey(item)} props={props} item={item} day={day} />)}\n                {ghosts.map(ghost => <Box key={`ghost:${eventKey(ghost.item)}`} css={props.styles.card} data-calendar-ghost={eventKey(ghost.item)} data-op={ghost.op} aria-hidden=\"true\"\n                    title={ghost.op === \"del\" ? optimiseMessages.ghostRemoved({ run: ghost.run }) : optimiseMessages.ghostMoved({ run: ghost.run })}>\n                    <Box css={props.styles.cardHead}>\n                        <Box css={props.styles.cardTitle}>{ghost.item.title}</Box>\n                        <Box css={props.styles.detail}>{ghost.item.start.type === \"some\" && props.format.time(ghost.item.start.value)}–{ghost.item.end.type === \"some\" && props.format.time(ghost.item.end.value)} · {resourceLabel(ghost.item, props.rows)}</Box>\n                    </Box>\n                </Box>)}\n            </Box>;\n        })}\n    </Box></Box>;\n}\n/**\n * An agenda card: its head selects the event — and takes the keyboard a pick in Search Records gives it (#1398), where\n * the card's ring is drawn — its explicit actions below.\n */\nfunction AgendaCard({ props, item, day }: { props: CalendarViewsProps; item: CalendarItem; day: Date }) {\n    const id = eventKey(item);\n    const head = useRef<HTMLButtonElement>(null);\n    useEventFocus(id, head);\n    const drafted = draftedIn(props.editing, item);\n    // What a run of the optimiser did to the event (#1409, R7, R17), while it is still the run's draft: its mark, and its provenance on hover.\n    const op = drafted ? calendarOpOf(props.optimised, item) : undefined;\n    const marked = op?.op === \"add\" || op?.op === \"chg\" ? op.op : undefined;\n    const was = marked === \"chg\" ? props.optimised?.previous.get(opKey(item.kind, item.key)) : undefined;\n    const run = op?.run ?? \"\";\n    const provenance = marked === \"add\" ? optimiseMessages.entryAdded({ run }) : marked === \"chg\" && was !== undefined ? optimiseMessages.entryChanged({ previous: previousWords(was, props), run }) : undefined;\n    return <Box css={props.styles.card} data-calendar-card={id} data-selected={props.selected.has(id) ? \"\" : undefined} data-op={marked} title={provenance}\n        data-draft={drafted ? \"\" : undefined} data-drafted={drafted ? \"\" : undefined} data-overlap={props.overlaps.peers.has(id) ? \"\" : undefined}\n        data-conflict={props.editing?.conflicted(item.kind, item.key) === true ? \"\" : undefined} data-bounds={props.bounded?.has(id) === true ? \"\" : undefined}>\n        <chakra.button ref={head} type=\"button\" css={props.styles.cardHead} onClick={event => props.select(item, event.shiftKey || event.metaKey || event.ctrlKey)} aria-pressed={props.selected.has(id)}>\n            <Box css={props.styles.cardTitle}>{item.title}</Box>\n            <Box css={props.styles.detail}>{item.start.type === \"some\" && props.format.time(item.start.value)}–{item.end.type === \"some\" && props.format.time(item.end.value)} · {resourceLabel(item, props.rows)}</Box>\n            <Box css={props.styles.detail}>{props.value.events.find(kind => kind.key === item.kind)?.name}{item.status.type === \"some\" && ` · ${item.status.value.label}`}{props.overlaps.peers.has(id) && \" · Overlap\"}</Box>\n        </chakra.button>\n        <Button size=\"xs\" variant=\"ghost\" aria-pressed={props.selected.has(id)} onClick={() => props.select(item, true)}>{props.selected.has(id) ? \"Remove from selection\" : \"Add to selection\"}</Button>\n        {props.commands !== undefined && <EventActions item={item} value={props.value} shown={props.shown} commands={props.commands} day={day} styles={props.styles} />}\n    </Box>;\n}\n/** Calendar's main view; the narrow branch contains no drag hooks. Its event blocks are measured by one observer of its own. */\nexport function CalendarViews(props: CalendarViewsProps) {\n    useMoveGhostClasses(props.styles);\n    const [boxes] = useState(createBlockBoxes);\n    useEffect(() => () => boxes.disconnect(), [boxes]);\n    return <BlockBoxesContext.Provider value={boxes}>{props.narrow ? <Agenda {...props} />\n        : props.view.layout === \"timeline\" ? <Timeline {...props} />\n        : props.view.layout === \"calendar\" && props.view.period === \"month\" ? <MonthGrid {...props} />\n        : <TimeGrid {...props} />}</BlockBoxesContext.Provider>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * e3-ui's Calendar renderer; BuilderFrame stays an internal React detail. Its\n * slice narrows through one `Slice.bindRecords` (#1343): each event kind\n * reads through its own source, the date window written to every one; each\n * resource kind's source narrows its columns, rows and Choosers; each\n * templates list's and each tab's narrows that tab. Overlaps, checks and\n * commands read everything. Its footer explains the event kinds, beside the\n * shared loading line (#1398): the period being read, or why it could not be.\n * Only its cold load is covered, at its time grid's hour (CL1, CL5): a grid's\n * step to a period not read yet draws that period's grid at once — never the\n * old period's events under its labels — its regions washed and its counts\n * placeholders; one whose read failed keeps its grid and says so once (CL11).\n * Its Search Records seeks each event kind's record by key (`find.ts`), and its\n * box says so — `Search events by key`, the Calendar's message table's\n * (`messages.ts`) — as the views name an event by its title: a pick\n * steps to its event's period, selects it and brings it into view, and hands it\n * the keyboard where its ring is drawn once the window it is drawn in has landed\n * (`event-focus.ts`); a step through the matches leaves the keyboard in the box.\n * An event its kind's choices hide is named by them — and, where the view lays\n * resources out, one whose resource its resource kind's source hides by that\n * source's choices too — and a pick of it clears just them first, its window\n * kept (the shared hidden pick, `shared/schedule/hidden-pick.tsx`, each kind's\n * read through its source in `HideSources`).\n * Each layout's view keeps its place across a step and a remount — the time\n * grid's hour, the timeline's line — and the timeline its place along the\n * period across a step; Today brings the time grid and the timeline to the now\n * line. Every key it acts on goes no further than the Calendar: `[` and `]`\n * step its period from anywhere in the frame.\n *\n * The timeline shows the period chosen and scrolls only within it (ruled 9 Nov\n * 2026), as the Roster's grid does: Day a day, Week a week, Month a month\n * (`timeline.ts`). Its period moves only by Previous and Next, Today, a date\n * picked or a pick of Search Records, never by its scroll, and the periods\n * either side are read ahead once the one shown lands, as every layout's are.\n * A step to a period not read yet — or a layout changed — draws none of the\n * old period's events, whose days are another period's.\n *\n * Its Backlog is each kind's, and never blinks (ruled 25 Oct 2026): no step\n * of the dates reads it again. A kind narrowed through its source has its\n * backlog read a page at a time (#1424, `backlog-pages.ts`), through the source\n * with its start Unset — its choices but its window — never every unscheduled\n * event of its narrowing, the tab counting it from the index (`N of M` while a\n * choice narrows it, \"…\" until first read, CL13), a new narrowing's cards and\n * count swapped in together once they land, the last standing, retained,\n * meanwhile. Every other kind's is read apart from the window, once, and is\n * never emptied or read again by a date change. The Library stays mounted\n * throughout: a resident one's search box keeps its query and its focus.\n *\n * Every kind is counted before one of its events is read (#1424): past\n * `SCHEDULE_EVENT_CAP` over the window, none is read or drawn but its drafts —\n * and the events selected there, read by their keys, so a pick of Search\n * Records goes to its event wherever it is and draws it there (#1398). A\n * resource's row on the timeline, or its column in the Resources view, of a\n * kind such a kind is placed on draws its shading in their place — the share\n * of each of the view's periods its events book, from its source's summary —\n * or is hatched where none shades at that period; the banner says how many\n * events there are and to narrow or to choose another period; and every\n * figure that would count them says they are not counted, never 0.\n *\n * A resource kind may be paged (#1424): its resources come a window at a time\n * (`pages.ts`), read in a component of their own around the places the views\n * show — the timeline's rows, the Resources view's columns — and an event kind\n * placed on it is read a cell at a time there, the events of the resources and\n * the dates on screen alone (`cells.ts`). Its source of the slice narrows its\n * windows themselves, so the frame follows no such source; a choice keeps the\n * last view standing, retained, until its windows land. Its Choosers search it\n * by key through its own paged read, and an event — drawn, or a Backlog card —\n * names its resource by the windows held, else by the resource's key. A new\n * event takes the resource it is dropped on or chosen; with none, it lands on\n * the first resource of the windows held that is free then, as on a kind read\n * whole — free only where that resource's events are read.\n */\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { Box, Button, useSlotRecipe } from \"@chakra-ui/react\";\nimport { SortedMap, StringType, compareFor, equalFor, fromEastTypeValue, none, some, type EastType } from \"@elaraai/east\";\nimport { CalendarComponent } from \"@elaraai/e3-ui/internal\";\nimport type { RecordTile } from \"@elaraai/east-ui/internal\";\nimport {\n    BannerView, BuilderFrame, SessionBanners, fieldBreachIssue, historyShortcut, implementUIComponent, optimiseMessages, takeKey, typedInto, useContainerBelow,\n    useFormatters, usePersistedState, useLanding, useLandingStyles, useTrackedEvaluation, type BuilderFramePanes, type Formatters,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingReveal, PAGED_LIBRARY_PAGE } from \"@elaraai/east-ui-components/internal\";\nimport { isBounded, rowBreaches } from \"../shared/bounds.js\";\nimport { useOptimise } from \"../shared/func/use-optimise.js\";\nimport { useOptimiseParts } from \"../shared/func/optimise-parts.js\";\nimport { pagedLoadingLine, pagedLoadingMessages, periodLoading, periodLoadingLine, periodRead, retryPeriod, type PagedLoading } from \"../shared/loading.js\";\nimport type { ScheduleCellNotice, ScheduleCellResources } from \"../shared/schedule/cells.js\";\nimport { scheduleIssueName, useScheduleEditing, type ScheduleEditing, type ScheduleEventDraftsValue, type ScheduleHeldRows, type ScheduleRowRead } from \"../shared/schedule/editing.js\";\nimport { FieldAskProvider, useFieldAsks } from \"../shared/schedule/field-ask.js\";\nimport { FollowSources, type FollowedSources } from \"../shared/schedule/follow-sources.js\";\nimport { HideSources, useHiddenPick, type HiddenPicks, type HiddenSource } from \"../shared/schedule/hidden-pick.js\";\nimport { scheduleOverlaps } from \"../shared/schedule/overlaps.js\";\nimport { refusalText, scheduleRefusals } from \"../shared/schedule/refusals.js\";\nimport { lowerWord } from \"../shared/schedule/words.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { useNow } from \"../shared/time/now-line.js\";\nimport { calendarCommands } from \"./actions.js\";\nimport { BacklogServed, CalendarBacklogPages, type BacklogPageCount } from \"./backlog-pages.js\";\nimport { calendarCellKinds, type CalendarBucket } from \"./cells.js\";\nimport { CalendarDataReader, initialCalendarData, resourceRows, windowedBacklogKinds, type CalendarDataState } from \"./data.js\";\nimport { CalendarChooserContext, type CalendarChooser } from \"./chooser.js\";\nimport { useCalendarDrag } from \"./drag.js\";\nimport { EventFocusContext, type EventFocus } from \"./event-focus.js\";\nimport { useCalendarFind, type FoundEvent } from \"./find.js\";\nimport { CalendarFooter } from \"./footer.js\";\nimport { CalendarPagesReader, createPagedDemand, type CalendarPages } from \"./pages.js\";\nimport { CalendarSelectionReader, NO_SELECTION, useCalendarInspector, type CalendarSelection } from \"./inspector.js\";\nimport { calendarLibraryId, templatesTab, useCalendarLibrary } from \"./library.js\";\nimport { calendarMessages, type CalendarWords } from \"./messages.js\";\nimport {\n    calendarOptimiseRequest, calendarOptimiseTypes, landCalendarOptimise, lockCalendarCommands,\n    type CalendarOptimiseRequest, type CalendarOptimiseResult, type CalendarOptimised,\n} from \"./optimise.js\";\nimport { useBacklogNarrowing } from \"../shared/schedule/backlog.js\";\nimport { calendarNouns, calendarSaid, followedSources } from \"./sources.js\";\nimport { useCalendarToolbar } from \"./toolbar.js\";\nimport { useCalendarWindow, type CalendarWindow } from \"./window.js\";\nimport { CalendarViews, calendarHour, readCalendarAnchor, type CalendarAnchor } from \"./views.js\";\nimport {\n    NOTHING_UNCOUNTED, calendarRange, chronological, dayStart, eventKey, inWindow, NARROW_WIDTH, navigate, periodWords,\n    type CalendarItem, type CalendarRange, type CalendarRef, type CalendarRow, type CalendarStyles, type CalendarUncounted, type CalendarValue,\n} from \"./model.js\";\n\nexport type { CalendarValue } from \"./model.js\";\n/** Props of the Calendar extension renderer. */\nexport interface EastChakraCalendarProps { value: CalendarValue; storageKey: string }\ninterface HostProps extends EastChakraCalendarProps {\n    /** The date window and the slice's event sources (`useCalendarWindow`). */\n    dates: CalendarWindow; now: Date;\n    /** The sources the Calendar follows beside its event kinds': what each shows. */\n    followed: FollowedSources;\n    /**\n     * Each event kind's hidden pick and each resource kind's, by its slot (the shared hidden pick): what hides an event\n     * Search Records finds that its kind's choices leave out — or, where the view lays resources out, its resource's source.\n     */\n    picks: HiddenPicks;\n    editing?: ScheduleEditing;\n    /**\n     * Told the rows the cells' reader holds of each kind it reads by its cells (#1424), as they move: where the editing\n     * finds one of their events — never by a read over the window.\n     */\n    onHeld?: ((held: ScheduleHeldRows | undefined) => void) | undefined;\n    /**\n     * Told the paged Backlog as it is made again (#1424): a backlog event its pages read, at the revision they read it at,\n     * is where the editing finds the original a gesture placing it rewrites.\n     */\n    onBacklog?: ((pages: CalendarBacklogPages | undefined) => void) | undefined;\n}\nconst NO_JOINED: Parameters<typeof useScheduleEditing>[0][\"joined\"] = [];\nconst NO_ITEMS: CalendarItem[] = [];\n/** No layout's view has rested anywhere yet. */\nconst NO_ANCHOR: CalendarAnchor = {};\n/** The row an event with no resource sits on, in the Calendar's word for it. */\nconst unassignedRow = (label: string): CalendarRow => ({ key: \"\", label, meta: \"\", group: \"\", resource: none });\n/** No resource kind laid out: a view with no resource axis shades no resource (#1424). */\nconst NO_CELL_RESOURCES: readonly ScheduleCellResources[] = [];\n/** A summary's tile the timeline shades a resource's row at, as the toolbar names the period (#1424). */\nconst PERIOD_NAMES: Partial<Record<RecordTile, string>> = { day: \"Day\", week: \"Week\", month: \"Month\" };\n/** No resource of a paged kind held. */\nconst NO_ROWS: readonly CalendarRow[] = [];\n/**\n * The frame's root takes the focus a click on a part of it holding nothing focusable gives — the Backlog's list clear of\n * its cards, a pane's empty foot (retest C4) — so the keyboard is in the Calendar, never the page's body: not a tab stop.\n */\nconst CLICK_FOCUS: Readonly<Record<string, string>> = { tabIndex: \"-1\" };\n/** The cells of the paged kind's resources in view, in flight: the line says the events they hold, with no places (retest C7). */\nconst CELLS_LOADING: PagedLoading = { kind: \"loading\", from: undefined, to: undefined };\n\n/**\n * The paged kind's resources the frame holds (#1424), every window's in order: what an event names its resource by.\n *\n * @param windows - The windows the frame holds of the paged kind, by window\n * @returns Their rows\n */\nfunction heldRows(windows: CalendarPages[\"windows\"] | undefined): readonly CalendarRow[] {\n    if (windows === undefined || windows.size === 0) return NO_ROWS;\n    return [...windows.entries()].sort((a, b) => a[0] - b[0]).flatMap(([, rows]) => rows);\n}\n\n/**\n * What the banner says of a kind past the cap (#1424): how many of its events the window holds — or, where its count is\n * no number of them (a day index's), that they are not counted — and where they show: the timeline at the period its\n * summary shades at, or a narrower view.\n *\n * @param notice - The kind's notice, as the shared reader gives it\n * @param format - The app's formatters\n * @returns The banner's title and its line\n */\nfunction noticeWords(notice: ScheduleCellNotice, format: Pick<Formatters, \"number\" | \"locale\">): { title: string; hint: string } {\n    const kind = notice.name.toLocaleLowerCase(format.locale);\n    const title = notice.events === undefined ? `${notice.name} events in view: not counted`\n        : `${format.number(notice.events)} ${kind} ${notice.events === 1 ? \"event\" : \"events\"} in view`;\n    const period = notice.resolution === undefined ? undefined : PERIOD_NAMES[notice.resolution];\n    const hint = period === undefined ? \"Too many to draw here: narrow the filters, or choose a shorter period.\"\n        : `Too many to draw here: narrow the filters, or open the timeline at ${period} to see where they fall.`;\n    return { title, hint };\n}\n\n/**\n * Brings a picked event out from under a pane the frame lays over main (the hand retest, 27 Oct 2026). The Inspector a\n * pick opens floats over main's edge for lack of room, as a start pane overlaid floats over its other; what main shows\n * between them, as the frame says it (`BuilderFramePanes.mainShown`), clear of the sticky column the view keeps at its\n * left too — the timeline's resources, the time grid's hours — is where the viewer sees the event. The view is scrolled\n * across by as much as the event stands outside that part: its middle to the part's middle, or, wider than the part,\n * its start to the part's start. A view that has no room left across it is left as it is.\n *\n * @param element - The event's element, drawn\n * @param shown - What of main the frame's panes leave in view; `undefined` with no frame drawn\n */\nfunction clearOfPanes(element: HTMLElement, shown: Pick<DOMRectReadOnly, \"left\" | \"right\"> | undefined): void {\n    const view = element.closest<HTMLElement>(\"[data-calendar-timeline], [data-calendar-time-grid], [data-calendar-month-grid]\");\n    if (!element.isConnected || shown === undefined || view === null) return;\n    const sticky = view.querySelector(\"[data-calendar-row-head], [data-calendar-gutter]\")?.getBoundingClientRect();\n    const left = Math.max(shown.left, sticky !== undefined && sticky.width > 0 ? sticky.right : shown.left);\n    const right = shown.right;\n    const box = element.getBoundingClientRect();\n    if (right <= left || (box.left >= left && box.right <= right)) return;\n    view.scrollLeft += box.width >= right - left ? box.left - left : (box.left + box.right - left - right) / 2;\n}\n\n/** Whether two ranges are one window: the same bounds. */\nfunction sameRange(a: CalendarRange, b: CalendarRange): boolean {\n    return a.from.getTime() === b.from.getTime() && a.to.getTime() === b.to.getTime();\n}\n\n/** No drafts: a read-only Calendar's. */\nconst NO_DRAFTS: ScheduleEventDraftsValue = new SortedMap([], compareFor(StringType));\n/** No session began from any row: a read-only Calendar's. */\nconst NO_ORIGINAL = (): undefined => undefined;\nconst stringEqual = equalFor(StringType);\n\n/** Whether two counts of the paged Backlog say the same. */\nfunction sameCount(a: BacklogPageCount | undefined, b: BacklogPageCount | undefined): boolean {\n    return a === undefined || b === undefined ? a === b : a.shown === b.shown && a.total === b.total && a.narrowing === b.narrowing;\n}\n\n/**\n * What the paged Backlog counts (#1424), read in a component of its own — its index counts land as their requests do,\n * and each would otherwise render the whole frame — handed to the frame only as it moves: the last count standing while\n * another narrowing's is read, so the tab says \"…\" only before its first (CL13). A count is handed on once the list's\n * first page has landed too, as the list swaps to its rows then (`PagedLibrary`): never a count against another\n * narrowing's cards (ruled 25 Oct 2026).\n *\n * @param props - The paged Backlog, and where its count goes\n * @returns Nothing: it reads\n */\nfunction CalendarBacklogCountReader({ pages, onCount }: { pages: CalendarBacklogPages; onCount: (count: BacklogPageCount) => void }): null {\n    const read = useCallback(() => {\n        const count = pages.count();\n        return count === undefined || pages.page(0n, BigInt(PAGED_LIBRARY_PAGE)).type !== \"some\" ? undefined : count;\n    }, [pages]);\n    const { result } = useTrackedEvaluation(read);\n    if (!result.ok) console.error(\"[Calendar] the backlog could not be counted:\", result.error);\n    const count = result.ok ? result.value : undefined;\n    const reported = useRef<BacklogPageCount | undefined>(undefined);\n    useLayoutEffect(() => {\n        if (count === undefined || sameCount(reported.current, count)) return;\n        reported.current = count;\n        onCount(count);\n    });\n    return null;\n}\n\n/**\n * An event drawn whose stored row breaks its kind's bounds (#1585): its kind and key, the field, by its form's key — what\n * its Go to asks the event's form for — and its words: its title, then its field's label and the bound.\n */\ninterface CalendarWarning { readonly kind: string; readonly key: string; readonly field: string; readonly text: string }\n\n/** The events drawn whose rows break their kind's bounds (#1585): those that wear the warn ring, and the stored ones' breaches. */\ninterface CalendarBreaches { readonly bounded: ReadonlySet<string>; readonly warnings: readonly CalendarWarning[] }\n\n/** No event whose row breaks its kind's bounds. */\nconst NO_BREACHES: CalendarBreaches = { bounded: new Set(), warnings: [] };\n\n/** Whether two readings of the events' bounds say the same. */\nfunction sameBreaches(a: CalendarBreaches, b: CalendarBreaches): boolean {\n    return a.bounded.size === b.bounded.size && [...b.bounded].every(key => a.bounded.has(key)) && a.warnings.length === b.warnings.length\n        && a.warnings.every((was, i) => {\n            const now = b.warnings[i]!;\n            return stringEqual(was.kind, now.kind) && stringEqual(was.key, now.key) && stringEqual(was.field, now.field) && stringEqual(was.text, now.text);\n        });\n}\n\n/**\n * The events drawn whose rows break their kind's bounds (#1585), read in a component of its own — each event read as the\n * inspector reads it, its drafts in place, each read landing re-running it alone — handed to the frame only as they move:\n * each wears the warn ring, stored or changed, and a stored one's breach is a warning beside the history's issues,\n * holding no Save — a changed one's is the refusal its session's readiness raises, which holds Save. A kind whose form\n * holds no number to bounds is read for nothing.\n *\n * @param props - The event kinds, the events drawn, the editing, and where what it reads goes\n * @returns Nothing: it reads\n */\nfunction CalendarBoundsReader({ kinds, items, editing, onBreaches }: {\n    kinds: CalendarValue[\"events\"]; items: readonly CalendarItem[]; editing: ScheduleEditing; onBreaches: (breaches: CalendarBreaches) => void;\n}): null {\n    const checks = useMemo(() => new Map(kinds.flatMap(kind => kind.fields.some(isBounded)\n        ? [[kind.key, { fields: kind.fields, breachesOf: rowBreaches(kind.fields, fromEastTypeValue(kind.editing.entryType) as EastType) }] as const] : [])), [kinds]);\n    const version = editing.version;\n    const read = useCallback((): CalendarBreaches => {\n        const bounded = new Set<string>();\n        const warnings: CalendarWarning[] = [];\n        const refused = scheduleRefusals(editing.sessions);\n        for (const item of items) {\n            const check = checks.get(item.kind);\n            if (check === undefined) continue;\n            const event = editing.read(item.kind, item.key);\n            const breaches = event === undefined ? [] : check.breachesOf(event.row);\n            if (breaches.length === 0) continue;\n            bounded.add(eventKey(item));\n            for (const breach of breaches) {\n                if (refused.some(({ kind, issue }) => stringEqual(kind, item.kind) && stringEqual(issue.entry, item.key)\n                    && issue.field.type === \"some\" && stringEqual(issue.field.value, breach.key))) continue;\n                warnings.push({ kind: item.kind, key: item.key, field: breach.key, text: `${item.title} · ${refusalText(fieldBreachIssue(breach, { entry: item.key }), check.fields)}` });\n            }\n        }\n        return { bounded, warnings };\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version says they moved\n    }, [checks, items, editing, version]);\n    const { result } = useTrackedEvaluation(read);\n    const now = result.ok ? result.value : undefined;\n    const reported = useRef(NO_BREACHES);\n    useLayoutEffect(() => {\n        if (now === undefined || sameBreaches(reported.current, now)) return;\n        reported.current = now;\n        onBreaches(now);\n    });\n    return null;\n}\n\n/** The sole editable wrapper: read-only Calendar never creates a record session. */\nfunction EditableCalendar(props: Omit<HostProps, \"editing\" | \"onHeld\" | \"onBacklog\">) {\n    const { value } = props;\n    // Each event kind's Save notice counts what leaves its own source's narrowing.\n    const recordSlices = useMemo(() => props.dates.eventParts.map(({ part }) => part), [props.dates.eventParts]);\n    // The rows a kind read by its cells holds (#1424): where a gesture finds one of its events, as the frame's reader hands\n    // them on — read as the gesture runs, so their moving draws nothing (#1594).\n    const held = useRef<ScheduleHeldRows | undefined>(undefined);\n    const onHeld = useCallback((rows: ScheduleHeldRows | undefined) => { held.current = rows; }, []);\n    // The paged Backlog as the frame last made it (#1424): a backlog event its pages read, while the record is at the\n    // revision they read it at, is the original a gesture placing it rewrites — as the Schematic's Backlog gives its rows\n    // (#1393); any other event is read as its kind reads it, its window's rows first.\n    const backlogNow = useRef<CalendarBacklogPages | undefined>(undefined);\n    const onBacklog = useCallback((pages: CalendarBacklogPages | undefined) => { backlogNow.current = pages; }, []);\n    const reads = useMemo((): Record<string, ScheduleRowRead> => {\n        const paged = windowedBacklogKinds(value);\n        const out: Record<string, ScheduleRowRead> = {};\n        for (const kind of value.events) {\n            if (!paged.has(kind.key) || kind.entries.type !== \"some\") continue;\n            const entries = kind.entries.value;\n            out[kind.key] = (id) => {\n                const at = entries.revision();\n                if (at.type !== \"some\") return undefined;\n                const page = backlogNow.current?.servedRow(kind.key, id);\n                return page === undefined || !stringEqual(page.revision, at.value) ? undefined : some(some(page.row));\n            };\n        }\n        return out;\n    }, [value]);\n    // The kinds the reader may give cells (#1424, #1599) — every kind read a window at a time: what each Save lands of\n    // them draws as the Save left it over cells read before the commit, until they are read again.\n    const drawsLanded = useMemo(() => calendarCellKinds(value.events), [value.events]);\n    // A new event whose made key another Save took goes on under the next its kind makes (#1583) — two people who each\n    // make an event from one template are given the same key. Nothing the Calendar drafts names an event by its key, so\n    // every kind's may.\n    const rekeys = useMemo(() => new Set(value.events.map(kind => kind.key)), [value.events]);\n    const editing = useScheduleEditing({ kinds: value.events, storageKey: props.storageKey, joined: NO_JOINED, range: props.dates.range,\n        recordSlices, held, reads, drawsLanded, rekeys, autosave: value.settings.autosave });\n    return <CalendarFrame {...props} editing={editing} onHeld={onHeld} onBacklog={onBacklog} />;\n}\n/**\n * Test-only render probe — lets \"a landing key search re-renders the window's reader, never the frame\" be asserted\n * deterministically (#1343). `undefined` outside tests.\n */\nlet calendarFrameRenderProbe: (() => void) | undefined;\n/**\n * Install (or clear) the test frame render probe. Test use only.\n *\n * @param fn - Called each time the frame renders; `undefined` clears it\n */\nexport function setCalendarFrameRenderProbe(fn: (() => void) | undefined): void {\n    calendarFrameRenderProbe = fn;\n}\nfunction CalendarFrame(props: HostProps) {\n    calendarFrameRenderProbe?.();\n    const { value, storageKey, editing, now, followed, dates, onHeld, onBacklog, picks } = props;\n    const { view, range, setView } = dates;\n    const onNavigate = (date: number) => setView({ ...view, date });\n    const recipe = useSlotRecipe({ key: \"calendar\" });\n    const styles = useMemo(() => recipe({}) as unknown as CalendarStyles, [recipe]);\n    // The Calendar's words: its message table — the editing session's, and what Search Records searches — and the app's formatters.\n    const format = useFormatters(); const words = useMemo((): CalendarWords => ({ ...format, m: calendarMessages, backlog: lowerWord(value.vocabulary.backlog) }), [format, value.vocabulary.backlog]);\n    const root = useRef<HTMLDivElement>(null);\n    const main = useRef<HTMLDivElement>(null);\n    // The frame's panes, as the Calendar's own code opens them: the Inspector an event shown as asked reveals, Enter's Details.\n    const panes = useRef<BuilderFramePanes>(null);\n    const narrow = useContainerBelow(main, NARROW_WIDTH);\n    // The period, as the footer's line, the eye and the banner name it (#1398, CL3; #1409).\n    const periodName = periodWords(view, range, value.settings, format);\n    const [refs, setRefs] = useState<CalendarRef[]>([]);\n    const [error, setError] = useState<string>();\n    const [reveal, setReveal] = useState<CalendarRef>();\n    const select = useCallback((next: CalendarRef[]) => {\n        setRefs(next); if (value.onSelect.type === \"some\") for (const ref of next) value.onSelect.value(ref);\n    }, [value.onSelect]);\n    const selected = useMemo(() => new Set(refs.map(ref => eventKey(ref))), [refs]);\n    // The window read reports from a component of its own, so a search landing re-renders it alone (#1343); once the\n    // window lands, it reads ahead what a step goes to (#1398, CL7): the periods either side.\n    const [data, setData] = useState<CalendarDataState>(() => initialCalendarData(range));\n    // The rows a kind read by its cells holds (#1424): the editing, the selection and Search Records find its events there.\n    const cellRows = data.cells?.held;\n    useLayoutEffect(() => { onHeld?.(cellRows); }, [cellRows, onHeld]);\n    // The paged resource kind (#1424): its windows around the places the views show, read in a component of their own;\n    // the views report those places to a store only that reader and the window's hear, so a scroll renders no frame.\n    const pagedValue = value.paged.type === \"some\" ? value.paged.value : undefined;\n    const pagedKind = pagedValue === undefined ? undefined : value.resources.find(kind => kind.key === pagedValue.kind);\n    const [demand] = useState(createPagedDemand);\n    const [pages, setPages] = useState<CalendarPages | undefined>(undefined);\n    // The period shown has landed when the held read is of the window read now (#1398): a step to a period not read yet\n    // holds none of the old period's events, which never show under its labels (CL5); a newer read of the same period\n    // keeps them meanwhile.\n    const current = data.ready && sameRange(data.range, range);\n    // An event shown as asked: brought into view, the inspector opened on it. One drawn already is shown at once; one the\n    // timeline has not drawn — a row out of its view, a time out of its span — tells the frame once it brings it in.\n    const revealed = useCallback((element: HTMLElement) => {\n        element.scrollIntoView?.({ block: \"nearest\", inline: \"nearest\" });\n        panes.current?.reveal(\"end\");\n        setReveal(undefined);\n        // The Inspector just opened may float over main, for lack of room: once it is laid out, the event is brought out from\n        // under it (the hand retest, 27 Oct 2026), by what of main the frame says it leaves in view.\n        requestAnimationFrame(() => clearOfPanes(element, panes.current?.mainShown()));\n    }, []);\n    // Enter on an event opens its Details, as the Schematic's Enter does (retest C5): the Inspector, folded, opened on it.\n    const openDetails = useCallback(() => { panes.current?.open(\"end\"); }, []);\n    useEffect(() => {\n        if (reveal === undefined || main.current === null) return;\n        const key = CSS.escape(eventKey(reveal));\n        const element = main.current.querySelector<HTMLElement>(`[data-calendar-event=\"${key}\"], [data-calendar-card=\"${key}\"]`);\n        if (element !== null) revealed(element);\n    }, [reveal, data.items, view, narrow, revealed]);\n    // Today pressed (#1398): the time grid and the timeline bring the now line into view.\n    const [nowAsked, setNowAsked] = useState(0);\n    const onToday = useCallback(() => setNowAsked(n => n + 1), []);\n    // Where each layout's view rests (#1398): saved under the Calendar's key, so a layout comes back to it as it mounts.\n    const { state: anchor, setState: setAnchor } = usePersistedState<CalendarAnchor>(`${storageKey}.anchor`, NO_ANCHOR, readCalendarAnchor);\n    const onAnchor = useCallback((next: Partial<CalendarAnchor>) => setAnchor(was => ({ ...was, ...next })), [setAnchor]);\n    // Each resource kind's rows its source shows: the columns, the timeline's rows and the Choosers (#1343).\n    const shown = useMemo(() => value.resources.map(kind => {\n        const keys = followed.get(kind.key)?.shown.keys;\n        return keys === undefined || keys.type === \"none\" ? kind : { ...kind, rows: kind.rows.filter(row => keys.value.has(row.key)) };\n    }), [value.resources, followed]);\n    const resourcesBusy = value.resources.some(kind => followed.get(kind.key)?.shown.busy === true);\n    // The periods a resource's shading is cut into (#1424): the timeline's by its period, the Resources view's day — none in\n    // a view with no resource axis, a time grid, the month or the agenda, which shades no resource.\n    const bucket: CalendarBucket | undefined = narrow ? undefined : view.layout === \"timeline\" ? view.period : view.layout === \"resources\" ? \"day\" : undefined;\n    // Whether the view lays resources out — the timeline's rows, the Resources view's columns: there an event whose\n    // resource its source of the slice hides is drawn nowhere, and Search Records names that source's choices too.\n    const laysResources = bucket !== undefined;\n    const cellResources = useMemo((): readonly ScheduleCellResources[] => bucket === undefined ? NO_CELL_RESOURCES\n        : shown.map(kind => ({ key: kind.key, keys: kind.rows.map(row => row.key) })), [bucket, shown]);\n    // The kinds past the cap (#1424): none of their events is drawn but their drafts, so every figure that would count\n    // them — the count, a day's, a resource's booked hours — says they are not counted, never 0.\n    const uncounted = useMemo((): CalendarUncounted => {\n        const kinds = value.events.filter(kind => data.capped.has(kind.key));\n        return kinds.length === 0 ? NOTHING_UNCOUNTED : {\n            names: kinds.map(kind => kind.name.toLocaleLowerCase(format.locale)), all: kinds.length === value.events.length,\n            resources: new Set(kinds.flatMap(kind => kind.takes)),\n        };\n    }, [value.events, data.capped, format.locale]);\n    // As the window read, the selection's read reports from a component of its own (#1343).\n    const [selection, setSelection] = useState<CalendarSelection>(NO_SELECTION);\n    const selectedItems = useMemo(() => selection.ok ? selection.value.map(event => event.item) : NO_ITEMS, [selection]);\n    // What the drawn events were read over (#1398): the window, once read.\n    const covered = current ? range : undefined;\n    // The events drawn: the window's read — and, of a kind past the cap, which draws none of its events but its drafts\n    // (#1424), the selected ones the window holds, read by their keys as the inspector reads them and drawn as its drafts\n    // are: a pick of Search Records among them shows it where it is, selected and given the keyboard there (#1398).\n    const items = useMemo(() => {\n        if (covered === undefined) return NO_ITEMS;\n        const picked = selectedItems.filter(item => data.capped.has(item.kind) && inWindow(item, covered.from, covered.to)\n            && !data.items.some(held => stringEqual(eventKey(held), eventKey(item))));\n        return picked.length === 0 ? data.items : chronological([...data.items, ...picked]);\n    }, [covered, selectedItems, data.capped, data.items]);\n    // The events drawn whose rows break their kind's bounds (#1585): each wears the warn ring, stored or changed, and a\n    // stored one's breach is a warning beside the history's issues.\n    const [breaches, setBreaches] = useState<CalendarBreaches>(NO_BREACHES);\n    // The Backlog (#1424): every kind narrowed through its source a page at a time (`backlog-pages.ts`), through the source\n    // with its start Unset — its choices but its window, so no step of the dates reads it again, and it never blinks — after\n    // the events in hand: every other kind's, read apart once, whatever the dates.\n    const windowedBacklog = useMemo(() => windowedBacklogKinds(value), [value]);\n    const backlogParts = useMemo(() => dates.eventParts.filter(({ kind }) => windowedBacklog.has(kind.key)), [dates.eventParts, windowedBacklog]);\n    const backlogNarrowing = useBacklogNarrowing(dates.eventParts);\n    const backlog = data.apart.items;\n    // The drafts as the shared reader gives them: those of events a kind's narrowing does not hold left out, so a draft\n    // never brings another narrowing's event into the list.\n    const drafts = data.cells?.drafts ?? editing?.drafts ?? NO_DRAFTS;\n    // A drafted event's row as its session began from it: what tells the list whether a page lists the event.\n    const original = editing?.held ?? NO_ORIGINAL;\n    // What the list's pages have listed, kept across the lists the drafts make: what a card is — its Schedule, a drag of it,\n    // the original a gesture placing it rewrites — never waits on a new list's pages being read.\n    const [backlogServed] = useState(() => new BacklogServed());\n    const backlogPages = useMemo(() => backlogParts.length === 0 || !data.apart.ready ? undefined\n        : new CalendarBacklogPages(calendarLibraryId(storageKey, \"backlog\"), backlog, backlogParts, drafts, original, backlogServed),\n    [backlogParts, data.apart.ready, storageKey, backlog, drafts, original, backlogServed]);\n    // Where a gesture placing one of its events finds the original it rewrites.\n    useLayoutEffect(() => { onBacklog?.(backlogPages); }, [backlogPages, onBacklog]);\n    // What the paged Backlog counts, read in a component of its own: \"…\" until it is first read (CL13), the last count\n    // standing while a narrowing's is read.\n    const [backlogCount, setBacklogCount] = useState<BacklogPageCount | undefined>(undefined);\n    const backlogRead = data.apart.ready;\n    // What it shows stands in for a read in flight: retained (CL8), aria-disabled in a busy pane, until it lands.\n    const backlogRetained = data.apart.loading;\n    const reading = data.loading || data.apart.loading;\n    // Every resource names an event's place — a paged kind's, those of its windows held (#1424), which a creation with no\n    // resource may land on too; the ones the rail shows lay out the columns and rows, a paged kind's a window at a time\n    // beside them (`pages`).\n    const pagedWindows = pages?.windows;\n    const pagedRows = useMemo(() => heldRows(pagedWindows), [pagedWindows]);\n    // The paged kind's resources whose events are read, which alone a creation can find free: the cells reader's, where\n    // it reads them; every one held, where the window's read reads the kind's events.\n    const cellsDrawn = data.cells?.drawn;\n    const commands = useMemo(() => editing === undefined ? undefined : calendarCommands(value, editing, select, items, shown, { rows: pagedRows, known: cellsDrawn }),\n        [value, editing, select, items, shown, pagedRows, cellsDrawn]);\n    // Held back only while what it shows is another view's (ruled 11 Nov 2026, `../shared/view-read.ts`): the last\n    // choices' events standing in for new ones', a resource kind's narrowing resolving, a paged kind's last view standing\n    // in for a new narrowing's (CL8) — no gesture until they land. A read again of the view shown — after a Save, or\n    // another session's write — leaves it live: a gesture begins from the row its event was drawn from, and a Save never\n    // stops the editing.\n    const available = current && !data.filtering && data.error === undefined && data.apart.error === undefined && !resourcesBusy && pages?.stale !== true;\n    // The app's optimiser (#1409, #1417): one run over the window in view, its result landed on the events as one\n    // edit, and what it left on them until Apply — the landing and the highlight over the whole frame.\n    const landing = useLanding(root);\n    const landingStyles = useLandingStyles();\n    const optimiseTypes = useMemo(() => calendarOptimiseTypes(value), [value]);\n    const [optimised, setOptimised] = useState<CalendarOptimised | undefined>(undefined);\n    const landAfter = useRef<(run: number) => void>(() => undefined);\n    const latest = useRef({ items, backlog, editing, optimised });\n    latest.current = { items, backlog, editing, optimised };\n    const run = useOptimise<CalendarOptimiseRequest, CalendarOptimiseResult>({\n        name: value.optimise.type === \"some\" ? value.optimise.value.name : null,\n        requestType: optimiseTypes.request, resultType: optimiseTypes.result,\n        scope: `${range.from.getTime()}:${range.to.getTime()}`, storageKey,\n        onLanded: (result, request, n) => {\n            const now = latest.current;\n            if (now.editing === undefined) return undefined;\n            const runText = format.number(n);\n            const landed = landCalendarOptimise(value, now.editing, request, result, optimiseMessages.step({ run: runText }), now.items, now.backlog, runText, now.optimised);\n            if (landed === undefined) return undefined;\n            // A run that changed nothing leaves what earlier runs left (R10).\n            if (landed.optimised !== undefined) { setOptimised(landed.optimised); landAfter.current(n); }\n            return landed.counts;\n        },\n    });\n    // The eye is listed only where the window can be optimised (ruled 25 Oct 2026): never read only; while its reads\n    // are in flight it waits, disabled, in its place.\n    const parts = useOptimiseParts<CalendarOptimiseRequest>({\n        run, landing, period: periodName, readOnly: value.settings.readOnly || editing === undefined, busy: !available || reading,\n        request: n => calendarOptimiseRequest(value, editing!, range, latest.current.items, latest.current.backlog, n), landKey: data.items,\n    });\n    landAfter.current = parts.landAfter;\n    const locked = parts.locked;\n    // What a run left on the events goes with the drafts (R17): once nothing is pending — Save, Discard — nothing is\n    // marked. An Undo leaves nothing pending too, but its Redo brings the run's step back (R9): what the run left is\n    // kept while that step is the next to redo.\n    const pending = editing?.history.pending ?? 0;\n    useEffect(() => {\n        if (pending === 0 && editing?.history.redoOrigin !== \"optimise\") setOptimised(undefined);\n    }, [pending, editing?.version, editing]);\n    // While a run is out (R2) every gesture is refused, the session the views read kept.\n    const gestures = !available ? undefined : locked && commands !== undefined ? lockCalendarCommands(commands, optimiseMessages.locked({ period: periodName })) : commands;\n    const unassigned = useMemo(() => unassignedRow(value.vocabulary.unassigned), [value.vocabulary.unassigned]);\n    const rows = useMemo(() => [...resourceRows(value.resources), ...pagedRows, unassigned], [value.resources, pagedRows, unassigned]);\n    // The paged kind's Choosers search it by key (#1424, `chooser.tsx`), each resource named by a window held, else by its\n    // own row read by its key (retest C6), and leave out what the kind's source of the slice hides, as the other Choosers\n    // leave out what the rail hides.\n    const chrome = dates.chrome;\n    const chooser = useMemo((): CalendarChooser | undefined => {\n        if (pagedValue === undefined || pagedKind === undefined) return undefined;\n        const names = new Map(pagedRows.flatMap(row => row.resource.type === \"some\" ? [[row.resource.value.key, row.label] as const] : []));\n        return { paged: pagedValue, unassigned: value.vocabulary.unassigned, noun: pagedKind.name.toLocaleLowerCase(format.locale), nameOf: key => names.get(key), part: sourcePart(chrome, pagedValue.kind) };\n    }, [pagedValue, pagedKind, pagedRows, format.locale, chrome, value.vocabulary.unassigned]);\n    const shownRows = useMemo(() => [...resourceRows(shown), unassigned], [shown, unassigned]);\n    const overlaps = useMemo(() => scheduleOverlaps([items.filter(item => value.events.find(kind => kind.key === item.kind)?.overlaps.type === \"warn\")]), [items, value.events]);\n    // Whether the overlaps chip shows (#1398): an overlap among what is drawn.\n    const overlapsShown = overlaps.pairs.length > 0;\n    // The templates the rail shows: the Templates tab's cards, and what a drop or a drawn event is made from.\n    const templates = useMemo(() => templatesTab(value, followed, format), [value, followed, format]);\n    const [pickedTemplate, setTemplate] = useState<string>();\n    const activeTemplate = pickedTemplate !== undefined && templates.shown.has(pickedTemplate) ? pickedTemplate : templates.shown.keys().next().value;\n    const start = useCalendarLibrary({ value, backlog, backlogRead, backlogRetained, backlogPages, backlogCount, selection: selectedItems, key: storageKey, narrow, now,\n        day: dayStart(view.date), styles, commands: gestures, activeTemplate, onTemplate: setTemplate, templates, backlogNarrowing, followed, shown, rows,\n        backlogFlash: optimised?.backlogChanged === true && landing.lit, locked });\n    const end = useCalendarInspector({ value, refs, range, commands: gestures, styles, storageKey, overlaps, select, selection, shown });\n    const { acted } = parts;\n    // The history's acts: a field typed into lets go first, committing what it holds — the history's buttons take no\n    // focus from it. Anything else keeps the focus, the board or an event on it, so the next key — a Redo after an\n    // Undo — reaches the frame too, never the page.\n    const onAction = useCallback((action: Parameters<ScheduleEditing[\"history\"][\"act\"]>[0]) => {\n        const active = document.activeElement; if (active instanceof HTMLElement && typedInto(active)) active.blur();\n        // A run's highlight ends with Undo, Apply and Discard; a Redo of its step replays its landing (R9, R16).\n        acted(action, editing?.history.redoOrigin);\n        editing?.history.act(action);\n    }, [editing, acted]);\n    const displayRange = narrow ? (dates.windowParts.length > 0 ? range : calendarRange(view, value.settings)) : range;\n    const standardRange = calendarRange(view, value.settings);\n    const rangeLabel = displayRange.from.getTime() !== standardRange.from.getTime() || displayRange.to.getTime() !== standardRange.to.getTime()\n        ? format.range(displayRange.from, new Date(displayRange.to.getTime() - 1)) : undefined;\n    const navigationDate = view.date;\n    // A step of the period, as Previous and Next take it (#1398): what `[` and `]` do from anywhere in the frame, as the\n    // Roster's and the Allocation's do.\n    const step = (by: -1 | 1) => onNavigate(navigate(view, by).date);\n    const nouns = useMemo(() => calendarNouns(value, format.locale), [value, format.locale]);\n    // Search Records (#1398): an event found by its key steps the view to its period, is selected and is brought into view;\n    // a pick gives it the keyboard there, once the box has let it go and the window it is drawn in has landed — after a\n    // step of the dates, that window: the element that stands for it where its ring is drawn takes the focus\n    // (`event-focus.ts`). An event the views draw nowhere — one of the backlog — leaves the keyboard where it is, as does a\n    // step through the matches. One its kind's choices hide, or — where the view lays resources out — whose resource its\n    // resource kind's source hides, is shown by clearing just the choices that hide it, its window kept, and given the\n    // keyboard once the narrowing they leave draws it (the shared hidden pick).\n    // The event a pick gave the keyboard to: the first element of it drawn takes the focus, once. It waits only while the\n    // event is the one selected, and until the viewer does something else (the root's captures below).\n    const [focusAsk, setFocusAsk] = useState<{ readonly id: string }>();\n    const focusTaken = useRef<object | undefined>(undefined);\n    const eventFocus = useMemo((): EventFocus => ({\n        id: focusAsk?.id,\n        take: () => {\n            if (focusAsk === undefined || focusTaken.current === focusAsk) return false;\n            focusTaken.current = focusAsk;\n            setFocusAsk(was => (was === focusAsk ? undefined : was));\n            return true;\n        },\n    }), [focusAsk]);\n    useEffect(() => {\n        if (focusAsk !== undefined && !refs.some(ref => stringEqual(eventKey(ref), focusAsk.id))) setFocusAsk(undefined);\n    }, [refs, focusAsk]);\n    const dropFocus = focusAsk === undefined ? undefined : () => setFocusAsk(undefined);\n    // The pick lands once the window its event is drawn in has landed, the event among what it draws.\n    const hiddenPick = useHiddenPick<string>({\n        onError: setError, uncleared: \"The filters hiding the event could not be cleared\",\n        landing: { drawn: (id) => current && items.some(item => stringEqual(eventKey(item), id)), focus: (id) => setFocusAsk({ id }) },\n    });\n    const found = (event: FoundEvent) => {\n        const ref = { kind: event.item.kind, key: event.item.key };\n        hiddenPick.pick(event.hidden, eventKey(ref), () => {\n            select([ref]);\n            if (event.item.start.type !== \"some\") return false;\n            onNavigate(dayStart(event.item.start.value).getTime());\n            setReveal(ref);\n            return true;\n        });\n    };\n    // What each resource kind's source shows, where the Calendar follows it: the paged kind's, followed by none, is asked of e3.\n    const resourcesShown = useMemo(() => new Map(value.resources.flatMap(kind => {\n        const keys = followed.get(kind.key)?.shown.keys;\n        return keys === undefined ? [] : [[kind.key, keys] as const];\n    })), [value.resources, followed]);\n    const finder = useCalendarFind({ kinds: value.events, parts: dates.eventParts, editing, range, format: words, onPick: found, held: cellRows, picks,\n        resourcesShown, laysResources });\n    const search = useMemo(() => (finder === undefined ? undefined : hiddenPick.search(finder)), [finder, hiddenPick]);\n    // The field an issue or a warning gone to names, asked of its event's form: it takes the keyboard as the form draws it,\n    // and so comes into view (`../shared/schedule/field-ask.tsx`).\n    const { asks: fieldAsks, request: askField } = useFieldAsks();\n    // The window's own count: \"…\" while the period is read, never a count of another period's (#1398, CL13).\n    const toolbar = useCalendarToolbar({ view, setView, resourcesWord: value.vocabulary.resources.other, layouts: dates.layouts, periods: dates.periods, onNavigate, navigationDate, rangeLabel, sunday: value.settings.weekStart.type === \"sunday\", now,\n        count: current ? items.filter(item => inWindow(item, displayRange.from, displayRange.to)).length : undefined, uncounted,\n        chrome: dates.chrome, affordances: dates.affordances, nouns, windowParts: dates.windowParts,\n        onToday, search, optimise: parts.toolbarItem, locked,\n        styles, words, commands, onAction, overlaps, overlapsShown, select: refs => { select(refs); setReveal(refs[0]); }, paged: value.events.some(kind => kind.entries.type === \"some\"),\n        warnings: breaches.warnings, askField });\n    // No drag source or target while a run is out (R2).\n    const drag = useCalendarDrag({ value, key: storageKey, commands: locked ? undefined : gestures, narrow, items, backlog, served: backlogPages, selection: selectedItems, templates: templates.shown,\n        activeTemplate, onError: setError });\n    const clear = useCallback(() => setRefs([]), []);\n    // The keyboard stays on the board as the events it was on go (retest C4): an event Delete takes away holding the focus,\n    // the board takes it, never the page's body — where the history's keys, the Undo that brings the event back, go unheard.\n    const keepOnBoard = (going: readonly CalendarItem[]) => {\n        const board = main.current;\n        const active = board?.ownerDocument.activeElement;\n        if (board === null || !(active instanceof HTMLElement) || !board.contains(active)) return;\n        const held = active.closest(\"[data-calendar-event], [data-calendar-card]\");\n        const id = held?.getAttribute(\"data-calendar-event\") ?? held?.getAttribute(\"data-calendar-card\") ?? undefined;\n        if (id !== undefined && going.some(item => stringEqual(eventKey(item), id))) board.focus({ preventScroll: true });\n    };\n    // The selection a pick adds to or takes from, as last drawn: read as the pick runs, so the pick is the same function\n    // while the selection moves, and an event, which calls it, draws again only as its own ring does (#1398, CL9).\n    const picked = useRef(refs);\n    picked.current = refs;\n    const pick = useCallback((item: CalendarItem, additive = false) => {\n        const ref = { kind: item.kind, key: item.key }; const id = eventKey(ref);\n        const now = picked.current;\n        select(additive ? now.some(was => eventKey(was) === id) ? now.filter(was => eventKey(was) !== id) : [...now, ref] : [ref]);\n    }, [select]);\n    // A new event whose made key another Save took goes on under the next its kind makes (#1583): what was selected of it\n    // stays selected, under its new key — the inspector open on it still, before the frame is drawn without it.\n    const renumbered = editing?.renumbered;\n    useLayoutEffect(() => {\n        if (renumbered === undefined || renumbered.size === 0) return;\n        const now = picked.current;\n        const next = now.map((ref): CalendarRef => {\n            const to = renumbered.get(ref.kind)?.get(ref.key);\n            return to === undefined ? ref : { kind: ref.kind, key: to };\n        });\n        // One moved is another object: the rest are the very refs held.\n        if (next.some((ref, i) => !Object.is(ref, now[i]))) select(next);\n    }, [renumbered, select]);\n    // A followed source not yet resolved holds the frame's cold load, as an event kind's window does — and a paged kind's\n    // first window.\n    const cold = [...followed.values()].some(source => !source.shown.ready && source.error === undefined)\n        || (pagedValue !== undefined && pages?.ready !== true);\n    // What the footer's loading line says (#1398, CL3): the period being read, a followed source's new narrowing, or\n    // why one could not be read, with Retry — the period's asking again each event kind's record, whether or not a\n    // source of the slice narrows it.\n    const retryWindow = useCallback(() => retryPeriod(value.events.map(kind => ({\n        entries: kind.entries, part: dates.eventParts.find(event => event.kind.key === kind.key)?.part,\n    }))), [value.events, dates.eventParts]);\n    const failure = data.error ?? data.apart.error;\n    // The cells of the paged kind's resources in view, read for the events placed on it where the view lays its resources\n    // out (#1424): the wait that follows their windows, its rows washed until they land (retest C7) — said in the events'\n    // noun, as the Plan's line says it (`Loading print job events…`), and main busy meanwhile.\n    const cellsReading = data.cells?.reading === true;\n    const cellsNoun = useMemo(() => {\n        const kind = pagedValue === undefined ? undefined : value.events.find(event => event.takes.includes(pagedValue.kind));\n        return kind === undefined ? undefined : `${kind.name.toLocaleLowerCase(format.locale)} events`;\n    }, [pagedValue, value.events, format.locale]);\n    // The period's reads first; else a paged kind's windows the view shows, in its own noun (`Loading presses 401–600`);\n    // else the cells of its resources in view.\n    const pagedNoun = pagedKind?.name.toLocaleLowerCase(format.locale);\n    const pagedLine = pages?.line;\n    const pagedRetry = pages?.retry;\n    const line = useMemo(() => periodLoadingLine(periodLoading({ loading: reading, error: failure, retry: retryWindow },\n        [...followed.values()].map(source => ({ noun: source.name, ready: source.shown.ready, loading: source.shown.busy && source.error === undefined,\n            error: source.error, retry: source.retry }))), periodName)\n        ?? (pagedNoun === undefined || pagedRetry === undefined ? undefined : pagedLoadingLine(pagedLine, pagedNoun, pagedLoadingMessages, format.number, pagedRetry))\n        ?? (cellsReading && cellsNoun !== undefined ? pagedLoadingLine(CELLS_LOADING, cellsNoun, pagedLoadingMessages, format.number, retryWindow) : undefined),\n    [reading, failure, retryWindow, followed, periodName, pagedNoun, pagedLine, pagedRetry, format.number, cellsReading, cellsNoun]);\n    // What the views draw of the period (#1398): the period as read; one not read yet, its grid at once and its\n    // placeholders, unseen until the frame's one reveal clock says so (CL4: `LoadingReveal` below, which the footer's line\n    // and each placeholder read where they show, so its flip renders them and never this frame); or one whose read failed,\n    // its grid and the failure said once (CL11) — never \"Calendar unavailable\" over the grid.\n    const read = useMemo(() => periodRead({ current, error: data.error, name: periodName, retry: retryWindow }),\n        [current, data.error, periodName, retryWindow]);\n    // What stands in for other choices — an event kind's, a followed source's, a paged kind's new narrowing — is stale\n    // (#1398, CL5): its words in the third ink, the grid's rules dashed, and nothing dragged or dropped until the new\n    // choices' land. A read again of the view shown — a new revision — draws as it did, live.\n    const stale = current && (data.filtering || [...followed.values()].some(source => source.shown.busy) || pages?.stale === true);\n    // Whether the events carry their drag handles and edges (#1398, CL9): wherever the board takes edits — through a read\n    // in flight too, whose retained content refuses the gesture itself (the shared drag sensors, inside the aria-disabled\n    // main, CL8) while `gestures` are withheld — so an event draws the same through a read;\n    // never while a run of the optimiser is out (R2), nor where the read failed and main takes the pointer for its Retry.\n    const grips = editing !== undefined && !locked && read.state !== \"failed\";\n    // The cold load's cover at the board's own pitch: an hour of its time grid (CL1).\n    const pitch = view.layout === \"timeline\" || (view.layout === \"calendar\" && view.period === \"month\") ? undefined : calendarHour(value.settings.density);\n    return <EventFocusContext.Provider value={eventFocus}><FieldAskProvider value={fieldAsks}>\n        <Box ref={root} css={[styles.root, landingStyles.main]} data-calendar-frame=\"\" data-calendar-readonly={value.settings.readOnly ? \"\" : undefined}\n        {...landing.attributes} onPointerDownCapture={dropFocus} onKeyDownCapture={dropFocus}>\n        {pagedValue !== undefined && pagedKind !== undefined\n            && <CalendarPagesReader paged={pagedValue} name={pagedKind.name} icon={pagedKind.icon} demand={demand} onPages={setPages} />}\n        {backlogPages !== undefined && <CalendarBacklogCountReader pages={backlogPages} onCount={setBacklogCount} />}\n        {editing !== undefined && <CalendarBoundsReader kinds={value.events} items={items} editing={editing} onBreaches={setBreaches} />}\n        <CalendarDataReader value={value} range={range} editing={editing} view={view}\n            resources={cellResources} bucket={bucket} pages={pages} demand={pagedValue === undefined ? undefined : demand} onData={setData} />\n        <CalendarSelectionReader value={value} refs={refs} range={range} commands={commands} held={cellRows} onSelection={setSelection} />\n        <LoadingReveal waiting={line?.kind === \"loading\"}>\n        <CalendarChooserContext.Provider value={chooser}>\n        <BuilderFrame storageKey={`${storageKey}.frame`} label=\"Calendar\" loading={(!data.ready && data.loading && data.error === undefined) || cold} loadingPitch={pitch}\n            busy={reading || resourcesBusy || pages?.reading === true || cellsReading} liveFooter phonePanel toolbar={toolbar} start={start} end={end} panesRef={panes}\n            onKeyDown={event => {\n                // The keys, never while typing; each the Calendar acts on goes no further than the Calendar (#1398), so a\n                // shortcut of the page around it on the same key — the showcase's `[`, which folds its sidebar — never hears\n                // it. An Esc with nothing to let go of goes on as it came.\n                if (event.defaultPrevented || typedInto(event.target)) return;\n                const action = historyShortcut(event);\n                if (action !== undefined && commands !== undefined && !locked) { takeKey(event); onAction(action); }\n                else if (event.key === \"[\" || event.key === \"]\") { takeKey(event); step(event.key === \"[\" ? -1 : 1); }\n                else if (event.key === \"Escape\" && (refs.length > 0 || error !== undefined)) { takeKey(event); setRefs([]); setError(undefined); }\n                else if ((event.key === \"Delete\" || event.key === \"Backspace\") && gestures !== undefined && selectedItems.length > 0) { takeKey(event); keepOnBoard(selectedItems); gestures.remove(selectedItems); }\n            }} rootProps={CLICK_FOCUS} banners={<>\n                {parts.banner}\n                {editing?.sessions.map(held => <SessionBanners key={held.key} session={held.session} words={words} name={value.events.find(kind => kind.key === held.kind)?.name}\n                    where={issue => scheduleIssueName(editing, held.kind, issue.entry)} onAction={action => editing.history.actOn(held.key, action)} />)}\n                {[...followed].flatMap(([source, followedSource]) => followedSource.error === undefined ? [] : [\n                    <BannerView key={source} status=\"error\" title={`${followedSource.name.charAt(0).toLocaleUpperCase(format.locale)}${followedSource.name.slice(1)} unavailable`} description={followedSource.error}\n                        actions={<Button size=\"xs\" variant=\"outline\" onClick={followedSource.retry}>Retry</Button>} />])}\n                {dates.error !== undefined && <BannerView status=\"error\" title=\"Dates unavailable\" description={dates.error} />}\n                {/* A kind past the cap (#1424): how many of its events the window holds, and where they show. */}\n                {(data.cells?.notices ?? []).map(notice => {\n                    const said = noticeWords(notice, format);\n                    return <Box key={`cells:${notice.kind}`} data-calendar-banner=\"cells\" data-calendar-kind={notice.kind}>\n                        <BannerView status=\"info\" title={said.title} description={said.hint} />\n                    </Box>;\n                })}\n                {/* A gesture's error; a read's is said once, in the grid and on the footer's line (#1398, CL11). */}\n                {error !== undefined && <Box role=\"alert\" css={styles.error}>{error}</Box>}\n            </>}\n            footer={<CalendarFooter styles={styles} kinds={value.events} parts={dates.eventParts} locale={format.locale} line={parts.line ?? line} elara={parts.legend} />}>\n            {/* The period read now's grid, whatever the read: what it holds of the period is `items` and `read` (#1398, CL5). While\n                it stands in for another view — other choices of the period, a period not read yet — what it shows is retained\n                (CL8): readable, focusable and selectable, aria-disabled, every editing gesture off (`gestures`); read again as it\n                stands, it is live. A failed period's main is not retained: its Retry is in it. */}\n            {/* The board: the keyboard's surface and its anchor, but not a tab stop (retest C4), as the Plan's body is — a click\n                on a part of it that holds nothing focusable puts the keyboard here, in the Calendar, where `[` and `]` step\n                its period, and an event Delete takes away leaves it here. */}\n            <Box ref={main} css={styles.main} data-calendar-main=\"\" tabIndex={-1} aria-disabled={!available && read.state !== \"failed\" ? true : undefined} data-calendar-stale={stale ? \"\" : undefined}\n                data-calendar-narrow={narrow ? \"\" : undefined}>\n                <CalendarViews format={format} value={value} view={view} setView={setView} range={narrow ? displayRange : range} items={items}\n                    rows={rows} shownRows={shownRows} shown={shown} now={now} narrow={narrow} styles={styles} read={read}\n                    uncounted={uncounted} shading={data.cells?.shading} bucket={bucket} pages={pages} demand={demand} drawnRows={data.cells?.drawn}\n                    selected={selected} select={pick} clear={clear} overlaps={overlaps} commands={gestures} drag={drag}\n                    nowRevision={nowAsked} anchor={anchor} onAnchor={onAnchor} reveal={reveal === undefined ? undefined : eventKey(reveal)} onRevealed={revealed}\n                    onOpen={value.inspector ? openDetails : undefined} optimised={optimised} lit={landing.lit} editing={editing} bounded={breaches.bounded} grips={grips} />\n            </Box>\n        </BuilderFrame>\n        </CalendarChooserContext.Provider>\n        </LoadingReveal>\n    </Box></FieldAskProvider></EventFocusContext.Provider>;\n}\n/** Calendar in its own shared frame, with the same renderer for read-only views. */\nexport function EastChakraCalendar({ value, storageKey }: EastChakraCalendarProps) {\n    const key = `${storageKey}.${value.id.type === \"some\" ? value.id.value : \"calendar\"}`;\n    const now = useNow(value.settings.now.type === \"some\" ? value.settings.now.value : undefined);\n    const dates = useCalendarWindow(value, key, now);\n    const { locale } = useFormatters();\n    // The sources the Calendar follows itself, each read once (one component each, so their hooks keep their order).\n    const sources = useMemo(() => followedSources(value), [value]);\n    const nouns = useMemo(() => new Map(Object.entries(calendarNouns(value, locale))), [value, locale]);\n    // The sources the hidden pick asks of, by the kind's slot: each event kind's — its choices but the range the Calendar's\n    // navigation writes, which hides no event — and each resource kind's narrowed through its source of the slice, the paged\n    // kind's among them.\n    const chrome = dates.chrome;\n    const hiddenSources = useMemo((): HiddenSource[] => [\n        ...dates.eventParts.map(({ kind, part }) => ({ key: kind.key, part, window: part.config.range.type === \"some\" ? part.config.range.value : undefined })),\n        ...value.resources.flatMap((kind): HiddenSource[] => {\n            const part = sourcePart(chrome, kind.key);\n            return part === undefined ? [] : [{ key: kind.key, part }];\n        }),\n    ], [dates.eventParts, value.resources, chrome]);\n    // And each one's hidden pick, read through its source (one component each, as the sources are).\n    return <FollowSources chrome={chrome} narrowed={value.narrowed} sources={sources} nouns={nouns} said={calendarSaid}>\n        {followed => <HideSources name=\"Calendar\" sources={hiddenSources}>\n            {picks => value.settings.readOnly ? <CalendarFrame value={value} storageKey={key} dates={dates} now={now} followed={followed} picks={picks} />\n                : <EditableCalendar value={value} storageKey={key} dates={dates} now={now} followed={followed} picks={picks} />}\n        </HideSources>}\n    </FollowSources>;\n}\nimplementUIComponent(CalendarComponent, EastChakraCalendar);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A builder's period, written into the source of its slice named after its\n * event kind (D9, `Builder Interfaces Spec.md` §7.5): the Roster's week and the\n * Allocation's day are each their own navigation, and the source holds the\n * window they read, so the rail's count and a Save's notice read the window the\n * builder reads. A range written there by anything else is written back. A\n * builder's reference record's source (#1551) holds the same window, its\n * check reading that window's rows.\n *\n * @packageDocumentation\n */\n\nimport { useLayoutEffect, useState } from \"react\";\nimport { useSlicesReactivity } from \"@elaraai/east-ui-components\";\nimport { recordSliceWindow, setRecordSliceWindow } from \"@elaraai/east-ui-components/internal\";\nimport { sourcePart, type SourcesChrome } from \"./visibility.js\";\n\n/**\n * Writes a builder's window into its event kind's source of the slice, and\n * back whenever the source's range moves elsewhere.\n *\n * @param chrome - The payload's slice chrome; `undefined` with no slice\n * @param source - The source's name: the event kind's slot, or `reference`, the record the check reads\n * @param from - The window's start\n * @param to - The window's end, half open\n * @param refused - What the builder says when the window cannot be written, and the source gives no reason\n * @returns Why the window could not be written, if it could not\n */\nexport function useSourceWindow(chrome: SourcesChrome | undefined, source: string, from: Date, to: Date, refused: string): string | undefined {\n    const part = sourcePart(chrome, source);\n    const version = useSlicesReactivity(part === undefined ? [] : [part.key]);\n    const [error, setError] = useState<string>();\n    const min = from.getTime(), max = to.getTime();\n    useLayoutEffect(() => {\n        if (part === undefined || part.config.range.type !== \"some\") return;\n        const held = recordSliceWindow(part);\n        if (held?.kind === \"datetime\" && held.min === min && held.max === max) return;\n        try { setRecordSliceWindow(part, min, max); setError(undefined); }\n        catch (reason) { setError(reason instanceof Error ? reason.message : refused); }\n        // `version` moves with the source's state: a range written there is written back.\n    }, [part, min, max, version, refused]);\n    return error;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's model over the app's own records (#1369, `Builder Interfaces\n * Spec.md` §5, §9): the payload as the renderer reads it; the Roster's pure\n * functions and codecs compiled once per duty row type, as the Allocation's\n * domain is — East decides which types are the same; the week assembled from\n * the duties' rows, the targets' and the week's own row, drafts in place; the\n * app's pay asked a person at a time; and the views' helpers. No UI, and no\n * record writes.\n *\n * @packageDocumentation\n */\n\nimport {\n    BlobType, DateTimeType, DictType, East, EastTypeType, IntegerType, OptionType, SortedMap, SortedSet, StringType, StructType, compareFor, decodeBeast2For,\n    encodeBeast2For, equalFor, fromEastTypeValue, none, parseFor, printFor, some, variant, type EastType, type EastTypeValue, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport type { ColorTokenType } from \"@elaraai/east-ui\";\nimport {\n    ROSTER_LAYOUT_PERIODS, RosterAssignmentTypeFor, RosterCheckContextTypeFor, RosterContextType, RosterCoverageType, RosterFitRequestTypeFor, RosterIssueType,\n    RosterPayRequestTypeFor, RosterPayType, RosterPayloadType, RosterPlaceType, RosterRequirementType, RosterShiftType, RosterSlotType, RosterStatusType,\n    RosterTargetRolesType,\n    RosterWeekTypeFor, RosterWhoType, ScheduleRosterRolesType, rosterCheck, rosterCoverage, rosterDayOf, rosterMove, rosterNewDuty, rosterPlacement,\n    rosterShiftStart, rosterWeekHours,\n} from \"@elaraai/e3-ui/internal\";\nimport type { Formatters } from \"@elaraai/east-ui-components\";\nimport { DAY, weekStart } from \"../shared/schedule/window.js\";\nimport { isoWeekUTC, shiftCalendar } from \"../shared/time/scale.js\";\nimport { shownViews } from \"../shared/views.js\";\nimport { plural } from \"../shared/schedule/words.js\";\nexport { DAY, NARROW_WIDTH, dayStart, weekStart } from \"../shared/schedule/window.js\";\n\n/** The decoded payload. */\nexport type RosterPayload = ValueTypeOf<typeof RosterPayloadType>;\n/**\n * The payload as the renderer reads it: with which people and activities the\n * slice shows (#1342) — `none` for every one — beside every person and\n * activity, which coverage, pay and checks read.\n */\nexport type RosterValue = RosterPayload & { visiblePeople: option<Set<string>>; visibleActivities: option<Set<string>> };\n/** A duty as the Roster reads it, its row the app's — opaque here, read through the app's own functions. */\nexport type Assignment = ValueTypeOf<RosterAssignmentTypeFor<EastType>>;\n/** A week as the Roster reads it. */\nexport type Week = ValueTypeOf<RosterWeekTypeFor<EastType>>;\nexport type Slot = ValueTypeOf<typeof RosterSlotType>;\n/** Where a duty stands: its day, its shift, and its group or none (#1548). */\nexport type Place = ValueTypeOf<typeof RosterPlaceType>;\nexport type Requirement = ValueTypeOf<typeof RosterRequirementType>;\nexport type Context = ValueTypeOf<typeof RosterContextType>;\nexport type Coverage = ValueTypeOf<typeof RosterCoverageType>;\nexport type Issue = ValueTypeOf<typeof RosterIssueType>;\nexport type Status = ValueTypeOf<typeof RosterStatusType>;\nexport type Who = ValueTypeOf<typeof RosterWhoType>;\n/** A duty's roles, as the duty kind reads them from its row. */\nexport type Roles = ValueTypeOf<typeof ScheduleRosterRolesType>;\n/** A target's roles, as the targets read them from their row. */\nexport type TargetRoles = ValueTypeOf<typeof RosterTargetRolesType>;\n/** Each duty's cost by the app's pay codes, by its key. */\nexport type Pay = ValueTypeOf<typeof RosterPayType>;\nexport type Person = RosterValue[\"people\"][number];\nexport type Activity = RosterValue[\"activities\"][number];\nexport type Shift = RosterValue[\"shifts\"][number];\nexport type Proposal = RosterValue[\"proposals\"][number];\n/** A week pattern, as the app declares it (#1406): seven days from the week's first day, each a shift's key or none. */\nexport type Pattern = RosterValue[\"patterns\"][number];\n/** A suggestion the week can take: in its slot of the week. */\nexport type PlacedProposal = Proposal & { readonly slot: Slot };\nexport type RosterStyles = Record<string, Record<string, unknown>>;\n/** The Roster's layouts. */\nexport type RosterLayout = RosterPayload[\"settings\"][\"layout\"][\"type\"];\n/** The Roster's periods: Shifts shows a day or a week, People a week or a month (#1406). */\nexport type RosterPeriod = RosterPayload[\"settings\"][\"period\"][\"type\"];\n/**\n * Persisted viewer preferences; dates are epochs for local storage. `period` is the period of the layout in view, and\n * `held` the period the other layout had, so each layout keeps its own (#1406, P1); a view kept before `held` reads as\n * the defaults.\n */\nexport interface RosterView { layout: RosterLayout; period: RosterPeriod; date: number; held?: Partial<Record<RosterLayout, RosterPeriod>> | undefined }\n/**\n * The inspector's selection is separate from edits and library filtering. A `personWeek` is a person's week (#1406,\n * D11): the inspector's person Details read that week, and a pattern applies to it. A `shiftDay` is a shift's day\n * across the groups (#1568): a day of a work requirement lane where the People layout draws no bands, whose Details\n * draw each group's slot and the skill lines summed over them. A work requirement's day names its week (`start`), as a\n * person-week does: a month's mark is a day of one of its weeks, which the inspector then reads.\n */\nexport type Selection = { type: \"assignment\" | \"proposal\" | \"person\"; key: string }\n    | { type: \"slot\" | \"requirement\"; slot: Slot; start?: number } | { type: \"group\"; key: string } | { type: \"shift\"; key: string }\n    | { type: \"personWeek\"; key: string; start: number } | { type: \"shiftDay\"; shift: string; day: number; start?: number };\n\n/**\n * The week a selection names (#1406, D11; #1568): a person-week's, or a work requirement's day's — the week the\n * inspector, the commands and the checks then work over where a month shows several.\n *\n * @param selection - The selection\n * @returns Its week's first day, as a time; `undefined` for a selection naming none\n */\nexport function selectionWeek(selection: Selection | undefined): number | undefined {\n    switch (selection?.type) {\n        case \"personWeek\": case \"slot\": case \"requirement\": case \"shiftDay\": return selection.start;\n        default: return undefined;\n    }\n}\n\n/**\n * A period a layout takes (#1406, D1): the one given where the layout takes it, else the layout's first — Shifts a\n * day, People a week.\n *\n * @param layout - The layout\n * @param period - The period asked for\n * @param offered - The periods this Roster offers (`viewPeriods`): a layout taking none of them keeps its own\n * @returns The period the layout shows\n */\nexport function periodOf(layout: RosterLayout, period: RosterPeriod | undefined, offered: readonly { readonly type: string }[] = []): RosterPeriod {\n    const takes = shownViews(ROSTER_LAYOUT_PERIODS[layout], offered);\n    return period !== undefined && takes.includes(period) ? period : takes[0]!;\n}\n\n/**\n * Where pressing an issue goes, as its title's click takes it. In Week and Day, its day, with what it names selected. In\n * Month, which draws no one duty, its week in Week (P24) — or, with Week not offered, the month stays and the person-week\n * of the duty's person is selected: moving the date to a day of a week that starts in the month before would move the month.\n *\n * @param issue - The issue\n * @param view - The view\n * @param start - The first day of the issue's week\n * @param week - The issue's week as drafted\n * @param opensWeek - Whether the layout in view offers Week\n * @returns The view to show and what to select; each `undefined` where it stays as it is\n */\nexport function issueGoesTo(issue: Issue, view: RosterView, start: Date, week: Week, opensWeek: boolean): { view: RosterView | undefined; select: Selection | undefined } {\n    const dated = issue.slot.type === \"some\" ? start.getTime() + Number(issue.slot.value.day) * DAY : undefined;\n    const named: Selection | undefined = issue.assignment.type === \"some\" ? { type: \"assignment\", key: issue.assignment.value }\n        : issue.fix.type === \"some\" && issue.fix.value.type === \"accept\" ? { type: \"proposal\", key: issue.fix.value.value }\n            : issue.slot.type === \"some\" ? { type: \"slot\", slot: issue.slot.value } : undefined;\n    if (view.period !== \"month\") return { view: dated === undefined ? undefined : { ...view, date: dated }, select: named };\n    if (opensWeek) return { view: { ...view, period: \"week\", date: dated ?? start.getTime() }, select: named };\n    const who = issue.assignment.type === \"some\" ? week.assignments.get(issue.assignment.value)?.who : undefined;\n    return { view: undefined, select: who?.type === \"person\" ? { type: \"personWeek\", key: who.value, start: start.getTime() } : undefined };\n}\n\n/**\n * The weeks in view, and the window the Roster reads them over (#1406, D2): one week — the Shifts layout's day is a\n * day of it — or a month's, the four to six weeks that touch the month from the configured week start.\n */\nexport interface RosterSpan {\n    /** The period in view. */\n    readonly period: RosterPeriod;\n    /** The first week's first day. */\n    readonly start: Date;\n    /** Each week's first day, in order: one, or a month's four to six. */\n    readonly weeks: readonly Date[];\n    /** The span's first instant: its first week's first day. */\n    readonly from: Date;\n    /** The span's end, exclusive: the day after its last week's last. */\n    readonly to: Date;\n    /** The month in view, its first day; `undefined` for a week. */\n    readonly month: Date | undefined;\n}\n\n/** The first day of a UTC date's month. */\nexport function monthStart(date: Date): Date { return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1)); }\n\n/**\n * The span a view shows (see {@link RosterSpan}).\n *\n * @param date - The view's date, an epoch\n * @param period - The period in view\n * @param sunday - Whether weeks start on Sunday\n * @returns The span\n */\nexport function rosterSpan(date: number, period: RosterPeriod, sunday: boolean): RosterSpan {\n    const at = new Date(date);\n    if (period !== \"month\") {\n        const start = weekStart(at, sunday);\n        return { period, start, weeks: [start], from: start, to: new Date(start.getTime() + 7 * DAY), month: undefined };\n    }\n    const month = monthStart(at);\n    const next = shiftCalendar(month, \"month\", 1);\n    const weeks: Date[] = [];\n    for (let week = weekStart(month, sunday); compareDate(week, next) < 0; week = new Date(week.getTime() + 7 * DAY)) weeks.push(week);\n    const start = weeks[0]!;\n    return { period, start, weeks, from: start, to: new Date(weeks[weeks.length - 1]!.getTime() + 7 * DAY), month };\n}\n\n/**\n * The ISO week number of a week, by its fourth day — the week's Thursday where weeks start on Monday, its Wednesday\n * where they start on Sunday: the number the shared navigator prints.\n *\n * @param week - The week's first day\n * @returns Its number\n */\nexport function weekNumber(week: Date): number { return isoWeekUTC(new Date(week.getTime() + 3 * DAY)); }\n\n/**\n * A span's words (#1406, P2, P28): a week's days — `12–18 Mar` — or a month's weeks — `W10–W14`.\n *\n * @param format - The app's formatters\n * @param span - The span\n * @returns Its words\n */\nexport function spanWords(format: Pick<Formatters, \"range\" | \"number\">, span: RosterSpan): string {\n    if (span.period !== \"month\") return format.range(span.from, new Date(span.to.getTime() - DAY));\n    return `W${format.number(weekNumber(span.weeks[0]!))}–W${format.number(weekNumber(span.weeks[span.weeks.length - 1]!))}`;\n}\n\n/**\n * A month's label (#1406, P2): `March 2028 · W10–W14 · Mar 5 – Apr 1`.\n *\n * @param format - The app's formatters\n * @param span - The month's span\n * @returns The label\n */\nexport function monthWords(format: Pick<Formatters, \"range\" | \"number\" | \"monthYear\">, span: RosterSpan): string {\n    const month = span.month ?? span.start;\n    return `${format.monthYear(month)} · ${spanWords(format, span)} · ${format.range(span.from, new Date(span.to.getTime() - DAY))}`;\n}\n\n/**\n * One week of a span, as the frame assembles it from the records' rows, drafts in place (#1406): what the month's\n * cells draw, and what a pattern dropped on it applies to.\n */\nexport interface WeekState {\n    /** Its first day. */\n    readonly start: Date;\n    /** The week as drafted, and as the records hold it. */\n    readonly week: Week;\n    readonly held: Week;\n    /** Its duties as drafted, and as stored: each placed duty's row. */\n    readonly duties: PlacedDuties;\n    readonly heldDuties: PlacedDuties;\n    /** Its targets as drafted. */\n    readonly targets: PlacedTargets;\n    /** Its periods (#1550): its own, or each of its seven days' where the Roster publishes by the day. */\n    readonly periods: readonly WeekPeriod[];\n}\n\nexport const sameSlot = equalFor(RosterSlotType);\nexport const slotKey = printFor(RosterSlotType);\nexport const parseSlot = parseFor(RosterSlotType);\nexport const weekKey = printFor(DateTimeType);\nexport const compareDate = compareFor(DateTimeType);\nexport const compareString = compareFor(StringType);\nexport const compareSlot = compareFor(RosterSlotType);\nexport const samePlace: (a: Place, b: Place) => boolean = equalFor(RosterPlaceType);\n/** Whether two groups are the same: one group's both, or both no group (#1548). */\nexport const sameGroup: (a: option<string>, b: option<string>) => boolean = equalFor(OptionType(StringType));\nexport const placeKey: (place: Place) => string = printFor(RosterPlaceType);\nconst readPlace = parseFor(RosterPlaceType);\n/** A place read back from its key (`placeKey`): what a drop's slot names; `undefined` for text naming none. */\nexport function parsePlace(text: string): Place | undefined {\n    const read = readPlace(text);\n    return read.success ? read.value : undefined;\n}\n/** A group's slot as a place: the place its duties stand in. */\nexport function placeOf(slot: Slot): Place { return { day: slot.day, group: some(slot.group), shift: slot.shift }; }\n/** The slot a place is, a group's; `undefined` for no group's (#1548). */\nexport function slotOfPlace(place: Place): Slot | undefined {\n    return place.group.type === \"some\" ? { day: place.day, group: place.group.value, shift: place.shift } : undefined;\n}\n/** Whether a duty stands in a slot: its group's shift on its day. */\nexport function inSlot(a: Pick<Assignment, \"place\">, slot: Slot): boolean { return samePlace(a.place, placeOf(slot)); }\n/** The group a duty stands in, by its key; `undefined` for a duty in no group yet (#1548). */\nexport function groupOf(a: Pick<Assignment, \"place\">): string | undefined { return a.place.group.type === \"some\" ? a.place.group.value : undefined; }\n/**\n * No group's band (#1548): the key the No group band of either layout is drawn and folded by — the empty key, as the\n * Calendar's Unassigned row is keyed. Where a duty may be in no group, no group of the Roster's takes it ({@link configError}).\n */\nexport const NO_GROUP = \"\";\n/**\n * A group's name where the Roster says where a duty stands: the group's label — its key, for a group no longer\n * configured — or the vocabulary's No group, for none (#1548).\n *\n * @param value - The payload: its groups and its words\n * @param group - The group, or none\n * @returns Its name\n */\nexport function groupName(value: Pick<RosterPayload, \"groups\" | \"vocabulary\">, group: option<string>): string {\n    if (group.type !== \"some\") return value.vocabulary.noGroup;\n    return value.groups.find(g => g.key === group.value)?.label ?? group.value;\n}\nexport const sameWho: (a: Who, b: Who) => boolean = equalFor(RosterWhoType);\nexport const whoKey: (who: Who) => string = printFor(RosterWhoType);\nconst sameRequirement = equalFor(RosterRequirementType);\nconst sameBytes = equalFor(BlobType);\n\n/** A window, half open. */\nconst SpanType = StructType({ from: DateTimeType, to: DateTimeType });\n/** The day arithmetic the Roster's views and gestures share, by East's own DateTime arithmetic, compiled once. */\nlet days: {\n    /** The window a week's duties are read over: the week, and the twelve hours either side a duty's start may stand from its shift's start on one of its days (§5.5, rule 1). */\n    window: (start: Date) => { from: Date; to: Date };\n    /** The week itself: from its first day for seven. */\n    week: (start: Date) => { from: Date; to: Date };\n    /** The week before's first day. */\n    before: (start: Date) => Date;\n    /** A span moved to start elsewhere, its length kept. */\n    moveTo: (from: Date, to: Date, at: Date) => { from: Date; to: Date };\n    /** The twelve hours either side of an instant. */\n    around: (at: Date) => { from: Date; to: Date };\n    /** A slot's day: the week's first day, and so many days on. */\n    dayAt: (start: Date, day: bigint) => Date;\n    /** Which day of the week a UTC midnight is, from the week's first day. */\n    dayIndex: (start: Date, day: Date) => bigint;\n    /** A shift's own times on a day: from its start, for its hours. */\n    shiftSpan: (day: Date, shift: Shift) => { from: Date; to: Date };\n    /** The window a span's duties are read over: the span, and the twelve hours either side its duties' starts may stand from their shifts'. */\n    spanWindow: (from: Date, to: Date) => { from: Date; to: Date };\n} | undefined;\nfunction rosterDays() {\n    days ??= {\n        window: East.compile(East.function([DateTimeType], SpanType, (_$, start) => ({ from: start.subtractHours(12n), to: start.addDays(7n).addHours(12n) })), []),\n        spanWindow: East.compile(East.function([DateTimeType, DateTimeType], SpanType, (_$, from, to) => ({ from: from.subtractHours(12n), to: to.addHours(12n) })), []),\n        week: East.compile(East.function([DateTimeType], SpanType, (_$, start) => ({ from: start, to: start.addDays(7n) })), []),\n        before: East.compile(East.function([DateTimeType], DateTimeType, (_$, start) => start.subtractDays(7n)), []),\n        moveTo: East.compile(East.function([DateTimeType, DateTimeType, DateTimeType], SpanType, (_$, from, to, at) => ({ from: at, to: at.addMilliseconds(from.durationMilliseconds(to)) })), []),\n        around: East.compile(East.function([DateTimeType], SpanType, (_$, at) => ({ from: at.subtractHours(12n), to: at.addHours(12n) })), []),\n        dayAt: East.compile(East.function([DateTimeType, IntegerType], DateTimeType, (_$, start, day) => start.addDays(day)), []),\n        dayIndex: East.compile(East.function([DateTimeType, DateTimeType], IntegerType, (_$, start, day) => East.Float.roundHalf(start.durationDays(day))), []),\n        shiftSpan: East.compile(East.function([DateTimeType, RosterShiftType], SpanType, ($, day, shift) => {\n            const startOf = $.const(rosterShiftStart);\n            const from = $.const(startOf(day, shift));\n            return { from, to: from.addHours(shift.hours) };\n        }), []),\n    };\n    return days;\n}\n\n/**\n * The window the Roster reads a week's duties over: the week, and the twelve\n * hours either side a duty's start may stand from its shift's start on one of\n * the week's days (§5.5, rule 1).\n *\n * @param start - The week's first day\n * @returns The window, half open\n */\nexport function weekWindow(start: Date): { from: Date; to: Date } { return rosterDays().window(start); }\n/**\n * The window the Roster reads a span's duties over (#1406, P26): the span's weeks, and the twelve hours either side a\n * duty's start may stand from its shift's start on one of their days.\n *\n * @param span - The span\n * @returns The window, half open\n */\nexport function spanWindow(span: Pick<RosterSpan, \"from\" | \"to\">): { from: Date; to: Date } { return rosterDays().spanWindow(span.from, span.to); }\n/**\n * The week itself: its seven days.\n *\n * @param start - The week's first day\n * @returns The week, half open\n */\nexport function weekSpan(start: Date): { from: Date; to: Date } { return rosterDays().week(start); }\n/**\n * The week before a week.\n *\n * @param start - The week's first day\n * @returns The week before's first day\n */\nexport function weekBefore(start: Date): Date { return rosterDays().before(start); }\n/**\n * A duty's times moved to start elsewhere, its length kept: what a later start's fix writes.\n *\n * @param a - The duty\n * @param at - Where it starts now\n * @returns Its start and end\n */\nexport function startingAt(a: Pick<Assignment, \"start\" | \"end\">, at: Date): { start: Date; end: Date } {\n    const span = rosterDays().moveTo(a.start, a.end, at);\n    return { start: span.from, end: span.to };\n}\n\n// ============================================================================\n// The domain: compiled once per duty row type\n// ============================================================================\n\n/** A duty kind's placement of one duty: placed in the week, another week's, or a duty the Roster cannot place. */\nexport type Placement = { type: \"placed\"; value: Assignment } | { type: \"elsewhere\"; value: null } | { type: \"unplaced\"; value: Issue };\n\n/** The Roster's codecs and pure functions at one duty row type, compiled once. */\nexport interface RosterDomain {\n    /** The app's duty row type. */\n    readonly rowType: EastType;\n    /** A row as bytes, and back. */\n    readonly encodeRow: (row: unknown) => Uint8Array;\n    readonly decodeRow: (bytes: Uint8Array) => unknown;\n    /** Whether two duties read alike: a duty unlike the record's is a draft. */\n    readonly sameAssignment: (a: Assignment, b: Assignment) => boolean;\n    /** Whether two weeks read alike: what the fit asks again over. */\n    readonly sameWeek: (a: Week, b: Week) => boolean;\n    /** A duty as the Roster reads it, in the week of `start`. */\n    readonly placement: (roles: Roles, row: unknown, key: string, start: Date, context: Context) => Placement;\n    /** Every configured slot's coverage, its cost the pay's. */\n    readonly coverage: (week: Week, context: Context, pay: Pay) => SortedMap<Slot, Coverage>;\n    /** The built-in checks. */\n    readonly check: (week: Week, context: Context) => Issue[];\n    /** Each person's hours for the week. */\n    readonly hours: (week: Week, context: Context) => SortedMap<string, number>;\n    /** The pay's question, as bytes. */\n    readonly encodePayRequest: (request: { who: Who; start: Date; duties: SortedMap<string, Assignment>; context: Context }) => Uint8Array;\n    /** One person's duties, as bytes: what a person's pay is kept by. */\n    readonly encodeDuties: (duties: SortedMap<string, Assignment>) => Uint8Array;\n    /** The app's check's question, as bytes. */\n    readonly encodeCheckContext: (context: { start: Date; week: Week; context: Context; coverage: SortedMap<Slot, Coverage>; pay: Pay }) => Uint8Array;\n    /** The fit's question type at the duty row type: what the app's function takes. */\n    readonly fitRequestType: EastType;\n}\n\nconst sameTypeValue = equalFor(EastTypeType);\nconst domains: { type: EastTypeValue; domain: RosterDomain }[] = [];\n\n/**\n * The domain for a duty kind's row type: built and compiled the first time a\n * type is seen, then shared — East decides which types are the same.\n *\n * @param rowType - The duty kind's `rowType`\n * @returns Its codecs and compiled pure functions\n */\nexport function rosterDomain(rowType: EastTypeValue): RosterDomain {\n    const known = domains.find(d => sameTypeValue(d.type, rowType));\n    if (known !== undefined) return known.domain;\n    const row = fromEastTypeValue(rowType) as EastType;\n    const assignmentType = RosterAssignmentTypeFor(row);\n    const weekType = RosterWeekTypeFor(row);\n    const domain: RosterDomain = {\n        rowType: row,\n        encodeRow: encodeBeast2For(row) as (value: unknown) => Uint8Array,\n        decodeRow: decodeBeast2For(row) as (bytes: Uint8Array) => unknown,\n        sameAssignment: equalFor(assignmentType) as unknown as RosterDomain[\"sameAssignment\"],\n        sameWeek: equalFor(weekType) as unknown as RosterDomain[\"sameWeek\"],\n        placement: East.compile(rosterPlacement(row), []) as unknown as RosterDomain[\"placement\"],\n        coverage: East.compile(rosterCoverage(row), []) as unknown as RosterDomain[\"coverage\"],\n        check: East.compile(rosterCheck(row), []) as unknown as RosterDomain[\"check\"],\n        hours: East.compile(rosterWeekHours(row), []) as unknown as RosterDomain[\"hours\"],\n        encodePayRequest: encodeBeast2For(RosterPayRequestTypeFor(row)) as unknown as RosterDomain[\"encodePayRequest\"],\n        encodeDuties: encodeBeast2For(DictType(StringType, assignmentType)) as unknown as RosterDomain[\"encodeDuties\"],\n        encodeCheckContext: encodeBeast2For(RosterCheckContextTypeFor(row)) as unknown as RosterDomain[\"encodeCheckContext\"],\n        fitRequestType: RosterFitRequestTypeFor(row),\n    };\n    domains.push({ type: rowType, domain });\n    return domain;\n}\n\n/** The app's check's question over a reference record (#1551): the week's, and the record's rows over it by key. */\nexport interface RosterReferenceCheckAsk {\n    start: Date; week: Week; context: Context; coverage: SortedMap<Slot, Coverage>; pay: Pay; reference: SortedMap<string, unknown>;\n}\n\nconst referenceCheckEncoders: { row: EastTypeValue; reference: EastTypeValue; encode: (ask: RosterReferenceCheckAsk) => Uint8Array }[] = [];\n\n/**\n * The app's check's question at the duty row type and a reference record's\n * row type (#1551), `CheckContext(R, P)`, as bytes: its encoder made the first\n * time the pair is seen, then shared — East decides which types are the same.\n *\n * @param rowType - The duty kind's `rowType`\n * @param referenceType - The reference record's row type\n * @returns The question's encoder\n */\nexport function rosterReferenceCheckEncoder(rowType: EastTypeValue, referenceType: EastTypeValue): (ask: RosterReferenceCheckAsk) => Uint8Array {\n    const known = referenceCheckEncoders.find(e => sameTypeValue(e.row, rowType) && sameTypeValue(e.reference, referenceType));\n    if (known !== undefined) return known.encode;\n    const type = RosterCheckContextTypeFor(fromEastTypeValue(rowType) as EastType, fromEastTypeValue(referenceType) as EastType);\n    const encode = encodeBeast2For(type) as unknown as (ask: RosterReferenceCheckAsk) => Uint8Array;\n    referenceCheckEncoders.push({ row: rowType, reference: referenceType, encode });\n    return encode;\n}\n\n/** The time arithmetic every row type shares (§5.5), compiled once. */\nlet times: {\n    dayOf: (start: Date, clock: Shift[\"start\"]) => Date;\n    shiftStart: (day: Date, shift: Shift) => Date;\n    move: (roles: Roles, start: Date, place: Place, context: Context) => option<Roles>;\n    newDuty: (who: Who, place: Place, start: Date, position: option<string>, activity: option<string>, context: Context) => option<Roles>;\n} | undefined;\nexport function rosterTimes() {\n    times ??= {\n        dayOf: East.compile(rosterDayOf, []) as (start: Date, clock: Shift[\"start\"]) => Date,\n        shiftStart: East.compile(rosterShiftStart, []) as (day: Date, shift: Shift) => Date,\n        move: East.compile(rosterMove, []) as unknown as NonNullable<typeof times>[\"move\"],\n        newDuty: East.compile(rosterNewDuty, []) as unknown as NonNullable<typeof times>[\"newDuty\"],\n    };\n    return times;\n}\n\n// ============================================================================\n// The week, assembled from the records' rows\n// ============================================================================\n\n/** One stored duty as the duty kind's `rows` gives it: its roles, its row's bytes, and its row, decoded once. */\nexport interface StoredDuty { readonly roles: Roles; readonly bytes: Uint8Array; readonly row: unknown }\n/** One stored target as the targets' `rows` give it: its roles and its row's bytes. */\nexport interface StoredTarget { readonly roles: TargetRoles; readonly bytes: Uint8Array }\n/** A duty's row as a draft holds it: its bytes and roles, or `undefined` for one the draft removes. */\nexport interface DraftedDuty { readonly bytes: Uint8Array; readonly roles: Roles; readonly row: unknown }\n\n/** The week's duties as one reading holds them: each placed duty, each one's row, and what the Roster cannot place. */\nexport interface PlacedDuties {\n    /** Each duty placed in the week, by key. */\n    readonly assignments: SortedMap<string, Assignment>;\n    /** Each placed duty's row's bytes and roles, by key: what a write starts from. */\n    readonly rows: ReadonlyMap<string, { readonly bytes: Uint8Array; readonly roles: Roles }>;\n    /** The issues listing the week's duties the Roster cannot place (§5.5, rule 8). */\n    readonly unplaced: readonly Issue[];\n}\n\n/**\n * The week's duties as the records hold them: each stored duty read in the\n * week of `start`, by key.\n *\n * @param domain - The duty row type's domain\n * @param stored - The duties the window read\n * @param start - The week's first day\n * @param context - The configuration\n * @returns The duties placed in the week, their rows, and what cannot be placed\n */\nexport function placeStored(domain: RosterDomain, stored: ReadonlyMap<string, StoredDuty>, start: Date, context: Context): PlacedDuties {\n    const assignments = new SortedMap<string, Assignment>([], compareString);\n    const rows = new Map<string, { bytes: Uint8Array; roles: Roles }>();\n    const unplaced: Issue[] = [];\n    for (const [key, duty] of stored) {\n        const placement = domain.placement(duty.roles, duty.row, key, start, context);\n        if (placement.type === \"placed\") { assignments.set(key, placement.value); rows.set(key, { bytes: duty.bytes, roles: duty.roles }); }\n        else if (placement.type === \"unplaced\") unplaced.push(placement.value);\n    }\n    return { assignments, rows, unplaced };\n}\n\n/**\n * The week's duties as drafted: the stored ones, each a draft holds in its\n * draft's place — a draft of any week, placed in this one where its day is —\n * and each one a draft removes gone.\n *\n * @param domain - The duty row type's domain\n * @param stored - The week's duties as the records hold them\n * @param drafts - Every drafted duty of the session, by key: its row, or `undefined` for one removed\n * @param start - The week's first day\n * @param context - The configuration\n * @returns The duties placed in the week as drafted, their rows, and what cannot be placed\n */\nexport function placeDrafted(domain: RosterDomain, stored: PlacedDuties, drafts: ReadonlyMap<string, DraftedDuty | undefined>, start: Date, context: Context): PlacedDuties {\n    if (drafts.size === 0) return stored;\n    const assignments = new SortedMap<string, Assignment>(stored.assignments, compareString);\n    const rows = new Map(stored.rows);\n    const unplaced = stored.unplaced.filter(issue => issue.assignment.type !== \"some\" || !drafts.has(issue.assignment.value));\n    for (const [key, draft] of drafts) {\n        assignments.delete(key);\n        rows.delete(key);\n        if (draft === undefined) continue;\n        const placement = domain.placement(draft.roles, draft.row, key, start, context);\n        if (placement.type === \"placed\") { assignments.set(key, placement.value); rows.set(key, { bytes: draft.bytes, roles: draft.roles }); }\n        else if (placement.type === \"unplaced\") unplaced.push(placement.value);\n    }\n    return { assignments, rows, unplaced };\n}\n\n/** The week's targets: each slot's requirement, and the key of the row that holds it. */\nexport interface PlacedTargets {\n    readonly requirements: SortedMap<Slot, Requirement>;\n    /** Each slot's target row: its key and its bytes, as drafted. */\n    readonly rows: SortedMap<Slot, { readonly key: string; readonly bytes: Uint8Array }>;\n}\n\n/**\n * The week's targets, a row per slot: the first row of a slot in key order\n * holds its target; a row of another day, group or shift than the Roster's is\n * no slot's.\n *\n * @param stored - The targets the week's read gave, by key\n * @param drafts - Every drafted target of the session, by key: its bytes and roles, or `undefined` for one removed\n * @param start - The week's first day\n * @param value - The payload: its groups and shifts\n * @returns The week's requirements, and each slot's row\n */\nexport function placeTargets(stored: ReadonlyMap<string, StoredTarget>, drafts: ReadonlyMap<string, StoredTarget | undefined>, start: Date,\n    value: Pick<RosterPayload, \"groups\" | \"shifts\">): PlacedTargets {\n    const merged = new SortedMap<string, StoredTarget>([...stored].filter(([key]) => !drafts.has(key)), compareString);\n    for (const [key, draft] of drafts) if (draft !== undefined) merged.set(key, draft);\n    const requirements = new SortedMap<Slot, Requirement>([], compareSlot);\n    const rows = new SortedMap<Slot, { key: string; bytes: Uint8Array }>([], compareSlot);\n    const end = weekSpan(start).to;\n    for (const [key, target] of merged) {\n        const { day, group, shift } = target.roles;\n        if (compareDate(day, start) < 0 || compareDate(day, end) >= 0) continue;\n        if (!value.groups.some(g => g.key === group) || !value.shifts.some(s => s.key === shift)) continue;\n        const slot: Slot = { day: rosterDays().dayIndex(start, day), group, shift };\n        if (rows.has(slot)) continue;\n        rows.set(slot, { key, bytes: target.bytes });\n        requirements.set(slot, { positions: target.roles.positions, hours: target.roles.hours });\n    }\n    return { requirements, rows };\n}\n\n/** A period's own row — a week's, or a day's where the Roster publishes by the day (#1550) — as drafted, and what it says. */\nexport interface PlacedPeriod {\n    /** Its row's bytes; `undefined` for a period with no row: Not started. */\n    readonly bytes: Uint8Array | undefined;\n    /** Its status. */\n    readonly status: Status;\n    /** The suggestions it dismissed. */\n    readonly dismissed: Set<string>;\n}\n\n/** A period with no row of its own: Not started — its status the draft's, nothing dismissed. */\nexport const NO_PERIOD: PlacedPeriod = { bytes: undefined, status: variant(\"draft\", null), dismissed: new SortedSet([], compareString) };\n\n/** Whether a period's row is its own: what a period with no row reads as Not started for. */\nexport function started(period: PlacedPeriod): boolean { return period.bytes !== undefined; }\n\n/**\n * One of a week's periods (#1550): the week itself, where the Roster publishes by the week, or one of its days, where\n * `Schedule.periods` declares `every: \"day\"` — what Publish writes, and what a gesture on one of its days asks first.\n */\nexport interface WeekPeriod {\n    /** Its first instant: its row's key, the week's first day or the day's. */\n    readonly start: Date;\n    /** The first of the week's days it holds, from zero. */\n    readonly from: number;\n    /** The day after its last, from zero: seven for the week. */\n    readonly to: number;\n    /** Its own row as drafted, and as stored. */\n    readonly period: PlacedPeriod;\n    readonly held: PlacedPeriod;\n}\n\n/** Whether the Roster publishes by the day: its periods declare `every: \"day\"` (#1550). */\nexport function byDay(value: Pick<RosterPayload, \"periods\">): boolean {\n    return value.periods.type === \"some\" && value.periods.value.every.type === \"day\";\n}\n\nconst WHOLE_WEEK: readonly { readonly from: number; readonly to: number }[] = [{ from: 0, to: 7 }];\nconst EACH_DAY: readonly { readonly from: number; readonly to: number }[] = Array.from({ length: 7 }, (_, day) => ({ from: day, to: day + 1 }));\n\n/**\n * A week's periods (#1550): the week, or each of its days.\n *\n * @param start - The week's first day\n * @param days - Whether the periods are days\n * @param row - A period's own row as drafted and as stored, by its first instant\n * @returns The periods, in the week's order\n */\nexport function weekPeriods(start: Date, days: boolean, row: (at: Date) => { readonly period: PlacedPeriod; readonly held: PlacedPeriod }): readonly WeekPeriod[] {\n    return (days ? EACH_DAY : WHOLE_WEEK).map(({ from, to }) => {\n        const at = new Date(start.getTime() + from * DAY);\n        return { start: at, from, to, ...row(at) };\n    });\n}\n\n/**\n * The period holding a day of its week (#1550).\n *\n * @param periods - The week's periods\n * @param day - The day, from zero\n * @returns The period; `undefined` for a day the week does not hold\n */\nexport function periodOn(periods: readonly WeekPeriod[], day: bigint | number): WeekPeriod | undefined {\n    const at = Number(day);\n    return periods.find(period => period.from <= at && at < period.to);\n}\n\n/** Whether a period takes edits (#1550): its row a draft's — Not started among them — as stored and as drafted. */\nexport function takesEdits(period: WeekPeriod): boolean { return editableStatus(period.held.status) && editableStatus(period.period.status); }\n\n/**\n * A week's status from its periods' (#1550), what the app's check and optimiser read: its own row's, or over its days\n * the draft's while any day is a draft, else — every day published — the published case at the latest time a day\n * was published, else the first of the app's own cases a day holds.\n *\n * @param periods - The week's periods' rows\n * @returns The status\n */\nexport function weekStatus(periods: readonly PlacedPeriod[]): Status {\n    if (periods.length === 1) return periods[0]!.status;\n    if (periods.length === 0 || periods.some(period => period.status.type === \"draft\")) return variant(\"draft\", null);\n    const other = periods.find(period => period.status.type === \"other\");\n    if (other !== undefined) return other.status;\n    let at: option<Date> = none;\n    for (const { status } of periods) {\n        if (status.type === \"published\" && status.value.at.type === \"some\" && (at.type === \"none\" || compareDate(status.value.at.value, at.value) > 0)) at = status.value.at;\n    }\n    return variant(\"published\", { at });\n}\n\n/**\n * A week as the Roster reads it: its duties, its targets and its periods' rows — its status theirs (`weekStatus`),\n * and its dismissals every period's.\n *\n * @param duties - Its duties\n * @param targets - Its targets\n * @param periods - Its periods' rows: its own, or its days'\n * @returns The week\n */\nexport function weekOf(duties: PlacedDuties, targets: PlacedTargets, periods: readonly PlacedPeriod[]): Week {\n    const dismissed = periods.length === 1 ? periods[0]!.dismissed : new SortedSet(periods.flatMap(period => [...period.dismissed]), compareString);\n    return { status: weekStatus(periods), assignments: duties.assignments, requirements: targets.requirements, dismissed };\n}\n\n/** A week with nothing in it yet: Not started. */\nexport function emptyWeek(): Week {\n    return weekOf({ assignments: new SortedMap([], compareString), rows: new Map(), unplaced: [] },\n        { requirements: new SortedMap([], compareSlot), rows: new SortedMap([], compareSlot) }, [NO_PERIOD]);\n}\n\n/** Whether a period is open to edits by its status: a draft — Not started among them — and never the published case or another. */\nexport function editableStatus(status: Status): boolean { return status.type === \"draft\"; }\n\n/**\n * A count of a roster's issues as it is said: `1 issue`, `3 issues`.\n *\n * @param n - How many issues\n * @returns The count in words\n */\nexport function issuesSaid(n: number): string {\n    return plural(n, \"issue\");\n}\n/** A period's status chip's words: Not started, Draft, Published, or the app's own case by its name. */\nexport function statusText(period: PlacedPeriod): string {\n    if (!started(period)) return \"Not started\";\n    return period.status.type === \"draft\" ? \"Draft\" : period.status.type === \"published\" ? \"Published\" : period.status.value;\n}\n\n/**\n * The status chip's words over a week's periods (#1550): its one period's (`statusText`), or over its days Published\n * once every day is, Not started while none is, the app's own case where every day holds it, else how many days are\n * published — `3 of 7 published` — or Draft while none is.\n *\n * @param periods - The week's periods' rows\n * @returns The words\n */\nexport function periodsText(periods: readonly PlacedPeriod[]): string {\n    if (periods.length === 1) return statusText(periods[0]!);\n    const published = periods.filter(period => period.status.type === \"published\").length;\n    if (published === periods.length) return \"Published\";\n    if (periods.every(period => !started(period))) return \"Not started\";\n    const first = periods[0]?.status;\n    if (first?.type === \"other\" && periods.every(period => started(period) && period.status.type === \"other\" && compareString(period.status.value, first.value) === 0)) return first.value;\n    return published === 0 ? \"Draft\" : `${published} of ${periods.length} published`;\n}\n\n// ============================================================================\n// Pay, a person at a time (§5.6)\n// ============================================================================\n\n/** Test-only probe: told of each question the pay is asked. `undefined` outside tests. */\nlet payProbe: ((who: Who) => void) | undefined;\n/**\n * Install (or clear) the probe the pay's questions are told to. Test use only.\n *\n * @param fn - Told of each question's person or agency; `undefined` clears it\n */\nexport function setRosterPayProbe(fn: ((who: Who) => void) | undefined): void { payProbe = fn; }\n\n/** One person's or agency's pay as last asked: the bytes of the duties it was asked of, and its answer — `undefined` for a call that threw. */\ninterface Asked { readonly duties: Uint8Array; readonly answer: Pay | undefined; readonly error: string | undefined }\n\n/** What the pay gives the week: each duty's cost by code, and whose pay could not be worked out. */\nexport interface WeekPay {\n    /** Each duty's cost by the app's codes, by its key: every person's answers merged. */\n    readonly pay: Pay;\n    /** Each person or agency whose pay threw, and why. */\n    readonly failed: readonly { readonly who: Who; readonly error: string }[];\n}\n\n/** No pay: no costs show. */\nexport const NO_PAY: WeekPay = { pay: new SortedMap([], compareString), failed: [] };\n\n/**\n * The app's pay, asked a person at a time (§5.6, B17): once for each person\n * with duties in the week and once for each agency with requests, each answer\n * kept by the bytes of that person's duties, so a change asks again only for\n * the people whose duties, or whose duties' rows, it changed. A new context or\n * week asks everyone again.\n */\nexport class RosterPayCache {\n    private kept = new Map<string, Asked>();\n    private context: Context | undefined;\n    private start: number | undefined;\n\n    /**\n     * The week's pay.\n     *\n     * @param domain - The duty row type's domain\n     * @param pay - The app's pay, over bytes\n     * @param week - The week as drafted\n     * @param start - Its first day\n     * @param context - The configuration, kept by identity: a new one asks everyone again\n     * @returns Each duty's cost, and whose pay threw\n     */\n    run(domain: RosterDomain, pay: (bytes: Uint8Array) => Pay, week: Week, start: Date, context: Context): WeekPay {\n        if (!Object.is(context, this.context) || this.start !== start.getTime()) { this.kept.clear(); this.context = context; this.start = start.getTime(); }\n        const byWho = new SortedMap<string, { who: Who; duties: SortedMap<string, Assignment> }>([], compareString);\n        for (const [key, duty] of week.assignments) {\n            const id = whoKey(duty.who);\n            let held = byWho.get(id);\n            if (held === undefined) { held = { who: duty.who, duties: new SortedMap([], compareString) }; byWho.set(id, held); }\n            held.duties.set(key, duty);\n        }\n        const merged: Pay = new SortedMap([], compareString);\n        const failed: { who: Who; error: string }[] = [];\n        const next = new Map<string, Asked>();\n        for (const [id, { who, duties }] of byWho) {\n            const bytes = domain.encodeDuties(duties);\n            const before = this.kept.get(id);\n            let asked = before;\n            if (asked === undefined || !sameBytes(asked.duties, bytes)) {\n                payProbe?.(who);\n                try {\n                    asked = { duties: bytes, answer: pay(domain.encodePayRequest({ who, start, duties, context })), error: undefined };\n                } catch (error) {\n                    asked = { duties: bytes, answer: undefined, error: error instanceof Error ? error.message : String(error) };\n                }\n            }\n            next.set(id, asked);\n            if (asked.answer === undefined) { failed.push({ who, error: asked.error ?? \"\" }); continue; }\n            // Only the person's own duties: an answer naming another's is no one's.\n            for (const [key, costs] of asked.answer) if (duties.has(key)) merged.set(key, costs);\n        }\n        this.kept = next;\n        return { pay: merged, failed };\n    }\n}\n\n/** A week's coverage as last worked out: the week it was worked out over, and the coverage. */\ninterface WorkedOut { readonly week: Week; readonly coverage: ReadonlyMap<Slot, Coverage> }\n\n/**\n * Each week of a month's coverage, as the People layout's work requirement\n * sums it (#1568): its hours alone, no pay asked, each week's kept by the week\n * as it was worked out over, so a change works out again only the weeks it\n * changed — an edit in one week leaves the others' standing. The week the\n * inspector reads is given its own coverage, whose hours its pay leaves as\n * they are. A new domain or context works out every week again.\n */\nexport class RosterSpanCoverage {\n    private kept = new Map<number, WorkedOut>();\n    private domain: RosterDomain | undefined;\n    private context: Context | undefined;\n\n    /**\n     * The span's coverage, a week at a time.\n     *\n     * @param domain - The duty row type's domain\n     * @param context - The configuration, kept by identity\n     * @param weeks - The span's weeks, each its first day and the week as drafted\n     * @param primary - The week the inspector reads, by its first day, and its coverage, the pay's costs in it\n     * @returns Each week's coverage, in the span's order\n     */\n    run(domain: RosterDomain, context: Context, weeks: readonly Pick<WeekState, \"start\" | \"week\">[],\n        primary: { readonly start: Date; readonly coverage: ReadonlyMap<Slot, Coverage> }): readonly ReadonlyMap<Slot, Coverage>[] {\n        if (!Object.is(domain, this.domain) || !Object.is(context, this.context)) { this.kept.clear(); this.domain = domain; this.context = context; }\n        const next = new Map<number, WorkedOut>();\n        const made = weeks.map(({ start, week }) => {\n            const before = this.kept.get(start.getTime());\n            const coverage = compareDate(start, primary.start) === 0 ? primary.coverage\n                : before !== undefined && domain.sameWeek(before.week, week) ? before.coverage\n                : domain.coverage(week, context, NO_PAY.pay);\n            next.set(start.getTime(), { week, coverage });\n            return coverage;\n        });\n        this.kept = next;\n        return made;\n    }\n}\n\n\n/** A pay's costs, totalled: in all, and by code. */\nexport interface Costs { readonly total: number; readonly byCode: SortedMap<string, number> }\n/** No costs. */\nexport const NO_COSTS: Costs = { total: 0, byCode: new SortedMap([], compareString) };\n\n/**\n * The duties' costs totalled, in all and by code (§5.6).\n *\n * @param pay - Each duty's costs by code\n * @param keys - The duties to total\n * @returns Their total, and by code\n */\nexport function costsOf(pay: Pay, keys: Iterable<string>): Costs {\n    const byCode = new SortedMap<string, number>([], compareString);\n    let total = 0;\n    for (const key of keys) {\n        for (const [code, amount] of pay.get(key) ?? []) {\n            byCode.set(code, (byCode.get(code) ?? 0) + amount);\n            total += amount;\n        }\n    }\n    return { total, byCode };\n}\n\n// ============================================================================\n// The views' helpers\n// ============================================================================\n\n/** Complete staff and activities remain available to domain checks when Slice hides a row. */\nexport function rosterContext(value: RosterPayload): Context {\n    return { people: new SortedMap(value.people.map(person => [person.key, person] as const), compareString), groups: value.groups,\n        activities: value.activities, shifts: value.shifts, positions: value.positions, agencies: value.agencies, rules: value.rules };\n}\n/** A group's skills: the activities of that group, in the activities' order. */\nexport function groupSkills(value: Pick<RosterPayload, \"activities\">, group: string): Activity[] {\n    return value.activities.filter(activity => activity.group.type === \"some\" && activity.group.value === group);\n}\n/** The duties: the activities of no group, which every group may assign. */\nexport function duties(value: Pick<RosterPayload, \"activities\">): Activity[] {\n    return value.activities.filter(activity => activity.group.type === \"none\");\n}\n/**\n * What a group's duty may hold: its skills, then the duties — those the\n * slice's `activities` source shows (#1342), and `keep` always: the duty's\n * own, as stored and as an edit has it. A duty in no group yet holds a duty\n * alone (#1548): a group's skill is its own duties'.\n */\nexport function activityChoices(value: Pick<RosterValue, \"activities\" | \"visibleActivities\">, group: string | undefined, keep: readonly string[] = []): Activity[] {\n    const shown = value.visibleActivities;\n    return [...(group === undefined ? [] : groupSkills(value, group)), ...duties(value)].filter(activity => shown.type === \"none\" || shown.value.has(activity.key) || keep.includes(activity.key));\n}\n/** An activity by its key. */\nexport function activityOf(value: Pick<RosterPayload, \"activities\">, key: string): Activity | undefined {\n    return value.activities.find(activity => activity.key === key);\n}\n/** A shift by its key. */\nexport function shiftOf(value: Pick<RosterPayload, \"shifts\">, key: string): Shift | undefined {\n    return value.shifts.find(shift => shift.key === key);\n}\n/** A pattern by its key (#1406). */\nexport function patternOf(value: Pick<RosterPayload, \"patterns\">, key: string): Pattern | undefined {\n    return value.patterns.find(pattern => pattern.key === key);\n}\n/**\n * Why a pattern cannot be applied (#1406, P23): other than seven days, or a day naming a shift the Roster has not\n * configured; `undefined` for one that can.\n *\n * @param value - The payload: its shifts\n * @param pattern - The pattern\n * @returns The reason, as its card says it: `8 days`, `shift \"twilight\" isn't configured`\n */\nexport function patternProblem(value: Pick<RosterPayload, \"shifts\">, pattern: Pattern): string | undefined {\n    if (pattern.days.length !== 7) return `${pattern.days.length} days`;\n    for (const day of pattern.days) {\n        if (day.type === \"some\" && shiftOf(value, day.value) === undefined) return `shift \"${day.value}\" isn't configured`;\n    }\n    return undefined;\n}\n/**\n * A pattern's meta (#1406, §8): how many days it works, and their hours — `5 shifts · 40 h`.\n *\n * @param value - The payload: its shifts\n * @param pattern - The pattern\n * @returns The days worked, and the hours they run\n */\nexport function patternSummary(value: Pick<RosterPayload, \"shifts\">, pattern: Pattern): { shifts: number; hours: number } {\n    let shifts = 0, hours = 0;\n    for (const day of pattern.days) {\n        if (day.type !== \"some\") continue;\n        shifts += 1;\n        hours += shiftOf(value, day.value)?.hours ?? 0;\n    }\n    return { shifts, hours };\n}\n/** A shift's colour, resolved (#1406, D6): the fill the theme's palette gives its token, and the ink the shade takes. */\nexport interface ShiftColor {\n    /** The theme's palette colour, as a CSS value. */\n    readonly fill: string;\n    /** The ink on it: the dark ink up to the 400 shade, the light ink from 500 — the same in both colour modes. */\n    readonly ink: string;\n}\n/**\n * A colour token as the theme draws it: `{colors.<hue>.<shade>}` through its CSS variable, the same in both colour\n * modes, and the ink the shade takes.\n *\n * @param token - The token\n * @returns Its fill and its ink\n */\nexport function colorTokenCss(token: ValueTypeOf<typeof ColorTokenType>): ShiftColor {\n    const hue = token.type, shade = token.value.type;\n    return { fill: `var(--chakra-colors-${hue}-${shade})`, ink: Number(shade) >= 500 ? \"var(--chakra-colors-white)\" : \"var(--chakra-colors-gray-900)\" };\n}\n/**\n * A shift's colour, where the app gives one (#1406, D6): the People tiles' and marks' fill.\n *\n * @param shift - The shift\n * @returns Its fill and ink; `undefined` for a neutral shift\n */\nexport function shiftColor(shift: Shift | undefined): ShiftColor | undefined {\n    return shift === undefined || shift.color.type !== \"some\" ? undefined : colorTokenCss(shift.color.value);\n}\n/** An instant's hour, as a tile prints it: `06`, or `06:30` where its minutes are not zero. */\nexport function hourText(date: Date): string {\n    const hour = String(date.getUTCHours()).padStart(2, \"0\"), minute = date.getUTCMinutes();\n    return minute === 0 ? hour : `${hour}:${String(minute).padStart(2, \"0\")}`;\n}\n/** A shift's hours, as a tile prints them: `06–14`, the end past midnight on the clock. */\nexport function shiftHoursText(shift: Shift): string {\n    const start = Number(shift.start.hour) * 60 + Number(shift.start.minute);\n    const end = (start + Math.round(shift.hours * 60)) % (24 * 60);\n    const text = (minutes: number) => { const h = String(Math.floor(minutes / 60)).padStart(2, \"0\"), m = minutes % 60; return m === 0 ? h : `${h}:${String(m).padStart(2, \"0\")}`; };\n    return `${text(start)}–${text(end)}`;\n}\n/** What a shift's code is cut between: its graphemes, where the page segments them. */\nconst GRAPHEMES = typeof Intl.Segmenter === \"function\" ? new Intl.Segmenter(undefined, { granularity: \"grapheme\" }) : undefined;\n/**\n * The letter a month's mark draws for a shift (#1569): its code's first grapheme — an accented letter whole — or its\n * first code point where the page has no segmenter. Everything else that draws a shift's code draws it whole.\n *\n * @param shift - The shift\n * @returns Its letter; `\"\"` for no shift, or a shift with no code\n */\nexport function shiftLetter(shift: Shift | undefined): string {\n    const code = shift?.code ?? \"\";\n    if (GRAPHEMES === undefined) return Array.from(code)[0] ?? \"\";\n    for (const part of GRAPHEMES.segment(code)) return part.segment;\n    return \"\";\n}\n/**\n * Checks bound configuration without rejecting ordinary staffing warnings.\n *\n * @param value - The payload: its lists, and whether a duty may be in no group yet\n * @returns Why the Roster can't be drawn; `undefined` for a configuration it draws\n */\nexport function configError(value: Pick<RosterPayload, \"groups\" | \"shifts\" | \"people\" | \"activities\" | \"positions\" | \"agencies\">\n    & { readonly duty: { readonly roles: Pick<RosterPayload[\"duty\"][\"roles\"], \"noGroup\"> } }): string | undefined {\n    if (value.groups.length === 0 || value.shifts.length === 0) return \"Roster needs at least one group and one shift.\";\n    // No group's band is keyed by the empty key, as the Calendar's Unassigned band is (#1548): where a duty may be in no\n    // group, no group of the Roster's takes it.\n    if (value.duty.roles.noGroup && value.groups.some(group => group.key === NO_GROUP)) return \"Roster groups need keys where a duty may be in no group.\";\n    const unique = (rows: readonly { key: string }[]) => new SortedSet(rows.map(row => row.key), compareString).size === rows.length;\n    for (const [name, rows] of [[\"people\", value.people], [\"groups\", value.groups], [\"activities\", value.activities], [\"shifts\", value.shifts], [\"positions\", value.positions], [\"agencies\", value.agencies]] as const) {\n        if (!unique(rows)) return `Roster ${name} must have unique keys.`;\n    }\n    if (value.shifts.some(shift => shift.hours <= 0 || !Number.isFinite(shift.hours) || shift.start.hour < 0n || shift.start.hour > 23n || shift.start.minute < 0n || shift.start.minute > 59n)) return \"Roster shifts need valid start times and positive durations.\";\n    return undefined;\n}\n/** A slot's day — or a place's — a UTC midnight. */\nexport function dayOfSlot(start: Date, slot: Pick<Slot, \"day\">): Date { return rosterDays().dayAt(start, slot.day); }\n/**\n * The suggestions the week can take, each in its slot: on one of its days\n * whose period the Roster may edit — the week's, or the day's (#1550) — a\n * configured group's and shift's, not dismissed, of a person on the staff who\n * is off that day.\n */\nexport function availableProposals(value: RosterValue, week: Week, start: Date, periods: readonly WeekPeriod[]): PlacedProposal[] {\n    if (!periods.some(takesEdits)) return [];\n    const end = weekSpan(start).to;\n    return value.proposals.flatMap(p => {\n        if (compareDate(p.day, start) < 0 || compareDate(p.day, end) >= 0 || week.dismissed.has(p.key)) return [];\n        if (!value.groups.some(g => g.key === p.group) || !value.shifts.some(s => s.key === p.shift) || !value.people.some(person => person.key === p.person)) return [];\n        const slot: Slot = { day: rosterDays().dayIndex(start, p.day), group: p.group, shift: p.shift };\n        const period = periodOn(periods, slot.day);\n        if (period === undefined || !takesEdits(period)) return [];\n        const rostered = [...week.assignments.values()].some(a => a.who.type === \"person\" && a.who.value === p.person && a.place.day === slot.day);\n        return rostered ? [] : [{ ...p, slot }];\n    });\n}\n/** A slot's target: what the targets hold of it, or nothing — never staffing the record does not hold. */\nexport function requirementOf(week: Week, slot: Slot): Requirement {\n    return week.requirements.get(slot) ?? { positions: 0n, hours: new SortedMap([], compareString) };\n}\n/** Whether two targets ask the same of a slot. */\nexport function sameTarget(a: Requirement, b: Requirement): boolean { return sameRequirement(a, b); }\n/** A shift's own times on a slot's day: from its start, for its hours — what a duty's own times are drawn against (§5.5, rule 2). */\nexport function shiftTimes(value: Pick<RosterPayload, \"shifts\">, slot: Pick<Slot, \"day\" | \"shift\">, start: Date): { from: Date; to: Date } | undefined {\n    const shift = shiftOf(value, slot.shift);\n    return shift === undefined ? undefined : rosterDays().shiftSpan(dayOfSlot(start, slot), shift);\n}\n/**\n * Where a duty may start (§5.5, rule 4): from twelve hours before its shift's start on its day to just short of twelve\n * hours after — the starts its day holds (`rosterDayOf`), so an edit of its times never moves it to another day.\n *\n * @param value - The payload: its shifts\n * @param slot - The duty's slot, or its place\n * @param start - The week's first day\n * @returns The span, half open: a start twelve hours after its shift's is the next day's; `undefined` for a shift not configured\n */\nexport function startReach(value: Pick<RosterPayload, \"shifts\">, slot: Pick<Slot, \"day\" | \"shift\">, start: Date): { from: Date; to: Date } | undefined {\n    const shift = shiftTimes(value, slot, start);\n    return shift === undefined ? undefined : rosterDays().around(shift.from);\n}\n/** Whether a duty's own times differ from its shift's: what draws them (§5.5, rule 2). */\nexport function ownTimes(value: Pick<RosterPayload, \"shifts\">, a: Assignment, start: Date): boolean {\n    const shift = shiftTimes(value, a.place, start);\n    return shift === undefined || compareDate(shift.from, a.start) !== 0 || compareDate(shift.to, a.end) !== 0;\n}\n/**\n * The position a new duty holds: the person's own where it is configured,\n * else the first position that leads no one, else the first; none for a kind\n * with no `position` role.\n */\nexport function positionFor(value: RosterPayload, who: Who): option<string> {\n    if (!value.duty.roles.position || value.positions.length === 0) return none;\n    const person = who.type === \"person\" ? value.people.find(p => p.key === who.value) : undefined;\n    if (person !== undefined && value.positions.some(p => p.key === person.position)) return some(person.position);\n    return some((value.positions.find(p => !p.lead) ?? value.positions[0]!).key);\n}\n\n/**\n * Totals for the displayed day or week, always over complete coverage: its slots', and the hours of the duties in no\n * group yet (#1548), which stand in no slot.\n *\n * @param coverage - Each slot's coverage\n * @param view - The view: its layout and period\n * @param day - The day in view\n * @param week - The week as drafted: its duties in no group\n * @returns The totals\n */\nexport function viewTotals(coverage: ReadonlyMap<Slot, Coverage>, view: RosterView, day: number, week: Week) {\n    const days = view.layout === \"shifts\" && view.period === \"day\" ? 1 : 7;\n    const rows = [...coverage].filter(([slot]) => days === 7 || Number(slot.day) === day).map(([, c]) => c);\n    const sum = (field: (c: Coverage) => number) => rows.reduce((total, c) => total + field(c), 0);\n    let loose = 0;\n    for (const a of week.assignments.values()) if (a.place.group.type === \"none\" && (days === 7 || Number(a.place.day) === day)) loose += a.hours;\n    return { days, cost: sum(c => c.cost), filled: sum(c => Number(c.filled)), positions: sum(c => Number(c.positions)), open: sum(c => Number(c.open)),\n        hours: sum(c => c.hours.rostered) + loose, needed: sum(c => c.hours.needed) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's editing (#1369, `Builder Interfaces Spec.md` §7): one history\n * over a session per record it writes — the duties (the duty kind's session,\n * read by key through its `entries` when it is given them), the weeks (the\n * periods') and the targets — through the shared Schedule editing, so a\n * gesture across them is one step and Save sends each record's changes as its\n * own request. Drafts of every week stay in their sessions, as the Calendar's\n * do: navigating, the rail and a remount keep them, and Save includes them.\n * The week's own reads of each record serve a gesture's original and a Save's\n * confirmation, at the revision the Save committed; a row they do not hold is\n * read by its key.\n *\n * @packageDocumentation\n */\n\nimport { useLayoutEffect, useMemo, useRef, type RefObject } from \"react\";\nimport { DateTimeType, parseFor, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport type { EditHistory, EditSession, EntryVersion } from \"@elaraai/east-ui-components\";\nimport {\n    useScheduleEditing, type ScheduleEditing, type ScheduleEditingRecord, type ScheduleEntryRef, type ScheduleRowRead, type ScheduleStandingRows,\n} from \"../shared/schedule/editing.js\";\nimport { draftedRow, heldInWindow, keptAtRevision, periodRowsRead, rowCodec } from \"../shared/schedule/records.js\";\nimport type { RosterData } from \"./data.js\";\nimport { rosterDomain, spanWindow, type DraftedDuty, type RosterSpan, type RosterValue, type StoredTarget } from \"./model.js\";\n\n/** What a change names the weeks' record by in the history: no duty kind's slot. */\nexport const PERIODS = \"roster.periods\";\n/** What a change names the targets' record by in the history. */\nexport const TARGETS = \"roster.targets\";\n\n/** The Roster's editing: its history, and every draft of each record, decoded once. */\nexport interface RosterEditing {\n    /** The shared Schedule editing over the three records: how a gesture is recorded, and what each record holds. */\n    readonly schedule: ScheduleEditing;\n    /** The one history over them. */\n    readonly history: EditHistory<ScheduleEntryRef>;\n    /** The duty kind's slot: what a change names the duties by. */\n    readonly duty: string;\n    /** Every drafted duty of every week, by key: its bytes, its roles and its row, or `undefined` for one removed. */\n    readonly duties: ReadonlyMap<string, DraftedDuty | undefined>;\n    /** Every drafted target, by key: its bytes and its roles, or `undefined` for one removed. */\n    readonly targets: ReadonlyMap<string, StoredTarget | undefined>;\n    /** Every drafted week's row, by its key's text: its bytes, or `undefined` for one removed. */\n    readonly periods: ReadonlyMap<string, Uint8Array | undefined>;\n    /**\n     * Where the board says what it draws of each record now: a gesture's original while the record's revision now is\n     * read — after a Save, or another session's — so a gesture on what the board shows is taken at once.\n     */\n    readonly standing: RefObject<ScheduleStandingRows | undefined>;\n}\n\nconst NO_JOINED: Parameters<typeof useScheduleEditing>[0][\"joined\"] = [];\nconst parseInstant = parseFor(DateTimeType);\n\n/**\n * Says what the board draws of each record now ({@link RosterEditing.standing}): the span's duties and the week\n * before's, its targets, and each period's own row by its start — as the frame holds them, at whatever revision they\n * were read. None while the board draws no read of the span in view. Said as the frame commits, so a gesture reads\n * what the page shows.\n *\n * @param editing - The Roster's editing; none for a Roster read only\n * @param drawn - The read the frame draws, while it is the span's own\n */\nexport function useRosterStanding(editing: RosterEditing | undefined, drawn: Pick<RosterData, \"duties\" | \"previous\" | \"targets\" | \"periods\"> | undefined): void {\n    const standing = editing?.standing;\n    const duty = editing?.duty;\n    useLayoutEffect(() => {\n        if (standing === undefined || duty === undefined) return undefined;\n        standing.current = drawn === undefined ? undefined : {\n            [duty]: id => (drawn.duties.get(id) ?? drawn.previous?.get(id))?.bytes,\n            [TARGETS]: id => drawn.targets.get(id)?.bytes,\n            [PERIODS]: (id) => {\n                const at = parseInstant(id);\n                return at.success ? drawn.periods.get(at.value) : undefined;\n            },\n        };\n        return () => { standing.current = undefined; };\n    }, [standing, duty, drawn]);\n}\n\n/**\n * The Roster's sessions over its records, and their drafts (see the module docs).\n *\n * @param value - The payload\n * @param storageKey - The Roster's key: its sessions and their history are kept under it\n * @param span - The span shown — a week, or a month's weeks (#1406): the windows the Roster reads its records over\n * @param recordSlices - The slice's parts over the records it writes: each Save notice counts what leaves its own\n * @returns The editing\n */\nexport function useRosterEditing(value: RosterValue, storageKey: string, span: RosterSpan, recordSlices: readonly ValueTypeOf<RecordSliceBindType>[]): RosterEditing {\n    const domain = rosterDomain(value.duty.rowType);\n    const kinds = useMemo(() => [value.duty.kind], [value.duty.kind]);\n    const records = useMemo((): ScheduleEditingRecord[] => [\n        ...(value.periods.type === \"some\" ? [{ key: PERIODS, name: value.periods.value.every.type === \"week\" ? \"Weeks\" : \"Days\",\n            editing: value.periods.value.editing, entries: value.periods.value.entries }] : []),\n        ...(value.targets.type === \"some\" ? [{ key: TARGETS, name: \"Targets\", editing: value.targets.value.editing, entries: value.targets.value.entries }] : []),\n    ], [value.periods, value.targets]);\n    const epoch = span.from.getTime(), until = span.to.getTime();\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    const range = useMemo(() => spanWindow(span), [epoch, until]);\n    // Each record's rows where the span's own reads hold them — the duties' window, each week's own row and the targets:\n    // a gesture's original, and what a Save confirms its entries by at the revision it committed.\n    const reads = useMemo((): Record<string, ScheduleRowRead> => {\n        const window = spanWindow(span);\n        const duties = keptAtRevision(value.duty.kind.entries, () => value.duty.rows(window.from, window.to));\n        const out: Record<string, ScheduleRowRead> = { [value.duty.kind.key]: key => heldInWindow(duties(), key) };\n        // Each week's own row, by its start: the span's read holds none of another week's.\n        if (value.periods.type === \"some\") out[PERIODS] = periodRowsRead(value.periods.value, span.from, span.to);\n        if (value.targets.type === \"some\") {\n            const targets = value.targets.value;\n            const read = keptAtRevision(targets.entries, () => targets.rows(span.from, span.to));\n            out[TARGETS] = key => heldInWindow(read(), key);\n        }\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [value.duty, value.periods, value.targets, epoch, until]);\n    const standing = useRef<ScheduleStandingRows | undefined>(undefined);\n    const schedule = useScheduleEditing({ kinds, records, reads, standing, storageKey, joined: NO_JOINED, range, recordSlices, autosave: value.settings.autosave });\n    const duty = value.duty.kind.key;\n    const sessionOf = (key: string): EditSession<ScheduleEntryRef> | undefined => schedule.sessions.find(held => held.kind === key)?.session;\n    // Each draft decoded once: a session keeps an entry's version the same object until a gesture replaces it.\n    const dutyCache = useRef(new WeakMap<EntryVersion<ScheduleEntryRef>, DraftedDuty>());\n    const targetCache = useRef(new WeakMap<EntryVersion<ScheduleEntryRef>, StoredTarget>());\n    const periodCache = useRef(new WeakMap<EntryVersion<ScheduleEntryRef>, Uint8Array>());\n    const drafts = schedule.drafts;\n    const duties = useMemo(() => {\n        const session = sessionOf(duty);\n        const out = new Map<string, DraftedDuty | undefined>();\n        for (const id of schedule.draftsOf(duty).keys()) {\n            const entry = session?.entries.get(id);\n            const drafted = draftedRow(entry);\n            if (entry === undefined || drafted === undefined) { out.set(id, undefined); continue; }\n            let held = dutyCache.current.get(entry);\n            if (held === undefined) {\n                const bytes = domain.encodeRow(drafted.row);\n                held = { bytes, roles: value.duty.read(bytes, id), row: drafted.row };\n                dutyCache.current.set(entry, held);\n            }\n            out.set(id, held);\n        }\n        return out;\n        // The drafts move with every gesture: their bytes say when.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [drafts, duty, domain, value.duty]);\n    const targets = useMemo(() => {\n        const out = new Map<string, StoredTarget | undefined>();\n        if (value.targets.type !== \"some\") return out;\n        const kind = value.targets.value;\n        const codec = rowCodec(kind.rowType);\n        const session = sessionOf(TARGETS);\n        for (const id of schedule.draftsOf(TARGETS).keys()) {\n            const entry = session?.entries.get(id);\n            const drafted = draftedRow(entry);\n            if (entry === undefined || drafted === undefined) { out.set(id, undefined); continue; }\n            let held = targetCache.current.get(entry);\n            if (held === undefined) {\n                const bytes = codec.encode(drafted.row);\n                held = { bytes, roles: kind.read(bytes) };\n                targetCache.current.set(entry, held);\n            }\n            out.set(id, held);\n        }\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [drafts, value.targets]);\n    const periods = useMemo(() => {\n        const out = new Map<string, Uint8Array | undefined>();\n        if (value.periods.type !== \"some\") return out;\n        const codec = rowCodec(value.periods.value.rowType);\n        const session = sessionOf(PERIODS);\n        for (const id of schedule.draftsOf(PERIODS).keys()) {\n            const entry = session?.entries.get(id);\n            const drafted = draftedRow(entry);\n            if (entry === undefined || drafted === undefined) { out.set(id, undefined); continue; }\n            let held = periodCache.current.get(entry);\n            if (held === undefined) { held = codec.encode(drafted.row); periodCache.current.set(entry, held); }\n            out.set(id, held);\n        }\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [drafts, value.periods]);\n    return useMemo(() => ({ schedule, history: schedule.history, duty, duties, targets, periods, standing }), [schedule, duty, duties, targets, periods]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's commands (#1369, `Builder Interfaces Spec.md` §5.5, §7): one\n * command path for the grid, the library, the inspector and the narrow cards.\n * Each reads the week as drafted, works out the rows it changes — a duty\n * through the duty kind's `write`, and `create` for a new one, its times by\n * §5.5; a period's own row — the week's, or by the day the day's (#1550) —\n * through the periods' `dismiss` and `publish`; a target through `write`, and\n * `create` for a new one — and records them across the records' sessions as\n * one step. A gesture on a day whose period takes no edits — a published week,\n * or by the day a published day — is refused, the week's other days taking\n * theirs. A new duty's or target's key is its record's session's to make\n * (#1583, east-ui-components' `keys.ts`, through `ScheduleEditing.mint`): made\n * up at random, past every key its drafts and its record are known to hold —\n * a key a record read a window at a time holds unread is its Save's own\n * conflict, never an overwrite. A duty's own form or a library card that\n * changes its shift or its team carries what it leaves as it was, as a move\n * does: its times move with the shift, so it stays on its day, and its\n * activity clears across teams. A find edits nothing: it asks the app's fit\n * (#1334). Publish runs Save, then writes the status of each period it\n * publishes once every record reads back as saved (`publishPeriod`). A pattern\n * dropped on a person's week (#1406, D4) replaces its seven days as one step,\n * `Apply pattern`: a day the pattern leaves as it is keeps its duty, a day it\n * changes runs the pattern's shift in the person's home group at the shift's\n * own times, an off day removes the person's duties that day, and a day whose\n * period takes no edits keeps its duties as they are.\n *\n * @packageDocumentation\n */\n\nimport { BlobType, OptionType, StringType, equalFor, none, some, variant, type option } from \"@elaraai/east\";\nimport { ScheduleResourceRefType } from \"@elaraai/e3-ui/internal\";\nimport type { Origin } from \"@elaraai/east-ui-components\";\nimport type { ScheduleChange } from \"../shared/schedule/editing.js\";\nimport { fieldChange, madeFromValues, periodPublishChange } from \"../shared/schedule/records.js\";\nimport { PERIODS, TARGETS, type RosterEditing } from \"./editing.js\";\nimport type { RosterFind } from \"./fit.js\";\nimport {\n    activityOf, availableProposals, compareDate, dayOfSlot, patternOf, patternProblem, periodOn, placeOf, positionFor, rosterDomain, rosterTimes, sameGroup,\n    samePlace, shiftTimes, slotOfPlace, startReach, startingAt, takesEdits, weekKey, type Assignment, type Context, type Issue, type Pattern, type Person, type Place,\n    type PlacedDuties, type PlacedTargets, type Requirement, type Roles, type RosterPayload, type RosterValue, type Selection, type Slot,\n    type Week, type WeekPeriod, type WeekState, type Who,\n} from \"./model.js\";\n\n/** Where a place command gets its person or request. */\nexport type RosterSource = { type: \"person\" | \"agency\" | \"assignment\" | \"proposal\"; key: string };\n/** What a form changes of a duty's roles: its times, its position, its activity. */\nexport type RolesChange = Partial<Pick<Roles, \"start\" | \"end\" | \"position\" | \"activity\">>;\n/** One field a library card's drop sets, as the kind writes it. */\nexport interface FieldWrite { readonly path: readonly string[]; readonly value: Uint8Array }\n\n/** What the commands read: the week as drafted and as stored, its rows, and the editing they record through. */\nexport interface RosterState {\n    readonly value: RosterValue;\n    /** The week's first day. */\n    readonly start: Date;\n    /** The configuration: every person and activity. */\n    readonly context: Context;\n    /** The week as drafted, and as the records hold it. */\n    readonly week: Week;\n    readonly held: Week;\n    /** Its duties as drafted, and as stored: each placed duty's row. */\n    readonly duties: PlacedDuties;\n    readonly heldDuties: PlacedDuties;\n    /** The week before's duties, while the week holds none: what Copy previous week copies. */\n    readonly previous: PlacedDuties | undefined;\n    /** Its targets as drafted: each slot's row. */\n    readonly targets: PlacedTargets;\n    /** Its periods (#1550): its own, or its seven days', each its row as drafted and as stored. */\n    readonly periods: readonly WeekPeriod[];\n    /**\n     * What Publish publishes now (#1550): the week's own period, or by the day the day in view's in the Shifts layout's\n     * Day, else every day of the week — each one that takes edits.\n     */\n    readonly publishes: readonly WeekPeriod[];\n    /** Every week of the span in view, drafts in place (#1406): what a pattern dropped on one of them applies to; the week above among them. */\n    readonly weeks?: readonly WeekState[] | undefined;\n    /** The editing; `undefined` for a read-only Roster. */\n    readonly editing: RosterEditing | undefined;\n    /** Whether the week's reads have landed and the rail is not mid-read: a gesture waits for them. */\n    readonly ready: boolean;\n    /**\n     * Whether what main shows is retained while a narrowing of it is read (#1398, CL8): readable, focusable and\n     * selectable, its controls in place, and every gesture refused until it lands.\n     */\n    readonly retained?: boolean | undefined;\n}\n\n/** All mutation paths use these guarded commands, each one step of the history. */\nexport interface RosterCommands {\n    /** Whether the week takes a gesture now: a period of it editable, its reads landed, its records' sessions writable. */\n    readonly available: boolean;\n    /**\n     * Whether a day of the week takes a gesture now (#1550): the week does, and the day's period — the week's, or the\n     * day's own where the Roster publishes by the day — is editable. Each day's controls ask it.\n     */\n    readonly availableOn: (day: bigint) => boolean;\n    /** Whether Publish can publish now: the week takes a gesture, and a period it publishes takes edits (#1550). */\n    readonly publishable: boolean;\n    /** Whether a week of the span takes a gesture (#1406): the month's cells each ask of their own week. */\n    readonly availableIn: (held: WeekState) => boolean;\n    /** Whether any week in view takes a gesture: the week, or one of the month's — what registers drag sources and targets (P32). */\n    readonly editable: boolean;\n    /**\n     * Why every gesture is refused while a run of the optimiser holds the week (#1409, R2) — `Elara is optimising W11`\n     * — and `undefined` while none does: the week's controls stay in place, inert, never swapped for a read-only\n     * week's `Off`.\n     */\n    readonly locked: string | undefined;\n    /**\n     * Places a person, a request, a duty or a proposal at a place: a group's shift on a day, or the shift in no group,\n     * where the duty kind's group takes none (#1548).\n     */\n    place(source: RosterSource, place: Place, checkOnly?: boolean): string | undefined;\n    update(id: string, change: RolesChange, origin?: Origin, checkOnly?: boolean): string | undefined;\n    activity(id: string, activity: option<string>, checkOnly?: boolean): string | undefined;\n    sets(id: string, writes: readonly FieldWrite[], checkOnly?: boolean): string | undefined;\n    field(id: string, path: readonly string[], next: unknown): string | undefined;\n    row(id: string, bytes: Uint8Array): string | undefined;\n    remove(id: string): void;\n    restore(id: string): void;\n    requirement(slot: Slot, target: Requirement): string | undefined;\n    targetRow(slot: Slot, bytes: Uint8Array): string | undefined;\n    accept(key: string): string | undefined;\n    reject(key: string): void;\n    fix(issue: Issue): string | undefined;\n    copy(): void;\n    publish(): void;\n    /**\n     * A pattern over a person's week (#1406, D4): what applying it changes — each day kept, set to a shift or taken off,\n     * and the person's week as it leaves it — or why it cannot be applied, in the caption's words (P19).\n     */\n    pattern(person: string, start: Date, key: string): PatternPlan | string;\n    /** Applies a pattern to a person's week as one step of the history, `Apply pattern` (P17); one that changes nothing applies nothing (P18). */\n    applyPattern(person: string, start: Date, key: string, checkOnly?: boolean): string | undefined;\n}\n\n/** One day of a pattern applied to a person's week: left as it is, set to a shift, or taken off. */\nexport interface PatternDay {\n    /** The day of the week, from zero. */\n    readonly day: number;\n    /** The shift the day runs after the pattern; `undefined` for a day off. */\n    readonly shift: string | undefined;\n    /** Whether the pattern leaves the day as it is, sets its shift, or takes it off. */\n    readonly kind: \"keep\" | \"set\" | \"off\";\n}\n\n/** A pattern applied to a person's week, planned (#1406): what the drop records, and what the preview draws and checks. */\nexport interface PatternPlan {\n    readonly pattern: Pattern;\n    readonly person: Person;\n    /** The week's first day. */\n    readonly start: Date;\n    /** Each of the seven days. */\n    readonly days: readonly PatternDay[];\n    /** The changes, as one step; none where the week already matches. */\n    readonly changes: readonly ScheduleChange[];\n    /** The person's week as the pattern leaves it, each duty by key — kept, moved, or new under a minted key: what a preview's check runs over. */\n    readonly candidates: ReadonlyMap<string, Assignment>;\n    /** The duties the pattern removes, by key. */\n    readonly removed: readonly string[];\n}\n\nconst sameBytes = equalFor(BlobType);\nconst sameResource: (a: Roles[\"resource\"], b: Roles[\"resource\"]) => boolean = equalFor(OptionType(ScheduleResourceRefType));\nconst sameActivity: (a: Roles[\"activity\"], b: Roles[\"activity\"]) => boolean = equalFor(OptionType(StringType));\n/** A new duty the app's `values` failed to make, which the console says why — or one its session can make no key for yet. */\nconst NO_DUTY = \"A new duty could not be made.\";\n/** New targets the targets' `values` failed to make, or their session can make no key for yet. */\nconst NO_TARGETS = \"These targets could not be made.\";\n/** A gesture that has made no key yet. */\nconst NONE_MADE: ReadonlySet<string> = new Set();\n\n/**\n * The Roster's commands over the week (see the module docs).\n *\n * @param state - The week, its rows and the editing\n * @param select - Selects what a command made, keeping the panes as they are\n * @param find - Asks the app's fit who fits a find's need\n * @param publish - Publishes what the state says Publish publishes: Save, then each period's status\n * @returns The commands\n */\nexport function rosterCommands(state: RosterState, select: (selection: Selection | undefined) => void, find: (asked: RosterFind) => void,\n    publish: () => void): RosterCommands {\n    const { value, start, context, week, editing } = state;\n    const times = rosterTimes();\n    const schedule = editing?.schedule;\n    const duty = value.duty.kind.key;\n    const available = editing !== undefined && schedule !== undefined && state.ready && !value.settings.readOnly && state.periods.some(takesEdits)\n        && schedule.available(duty);\n    /** Whether a day of the week's period takes edits (#1550): the week's, or the day's own. */\n    const open = (day: bigint) => { const period = periodOn(state.periods, day); return period !== undefined && takesEdits(period); };\n    /** Why a gesture on the week — on each day given — is refused now; `undefined` while it takes one. */\n    const blocked = (...days: readonly bigint[]) => !available ? \"This week is not available to edit.\" : state.retained === true ? \"This week is still being read.\"\n        : days.some(day => !open(day)) ? \"This day is not available to edit.\" : undefined;\n    const validSlot = (slot: Slot) => slot.day >= 0n && slot.day < 7n && value.groups.some(g => g.key === slot.group) && value.shifts.some(s => s.key === slot.shift);\n    /** A place of the week: a valid slot, or a configured shift on one of its days in no group, where the duty kind's group takes none (#1548). */\n    const validPlace = (place: Place) => {\n        const slot = slotOfPlace(place);\n        return slot !== undefined ? validSlot(slot) : value.duty.roles.noGroup && place.day >= 0n && place.day < 7n && value.shifts.some(s => s.key === place.shift);\n    };\n    // A new duty's key, and a new target's: their sessions' to make (#1583), past the keys this gesture has made already.\n    // None until the history holds the session.\n    const newDuty = (minted: ReadonlySet<string>): string | undefined => schedule?.mint(duty, \"\", minted);\n    const newTarget = (): string | undefined => schedule?.mint(TARGETS, \"\", NONE_MADE);\n    const record = (changes: readonly ScheduleChange[], origin: Origin, label: string) => schedule !== undefined && changes.length > 0 && schedule.record(changes, origin, label);\n    const rowOf = (id: string) => state.duties.rows.get(id);\n    const personDay = (person: string, day: bigint, except?: string) => [...week.assignments].find(([key, a]) =>\n        key !== except && a.who.type === \"person\" && a.who.value === person && a.place.day === day);\n    /**\n     * A duty's roles, held to its shift's times and to what its place takes: its start to its day by its shift, and its\n     * activity to its team, each as the write drafts it.\n     */\n    const validRoles = (a: Pick<Assignment, \"place\" | \"who\">, roles: Roles): string | undefined => {\n        const reach = startReach(value, { ...a.place, shift: roles.shift }, start);\n        if (reach === undefined) return \"Choose a configured shift.\";\n        // Its reach is half open, as its day is: a start twelve hours after its shift's is the next day's.\n        if (compareDate(roles.start, reach.from) < 0 || compareDate(roles.start, reach.to) >= 0) return \"A duty starts up to 12 hours before its shift's start, or less than 12 hours after it.\";\n        if (compareDate(roles.end, roles.start) <= 0) return \"A duty ends after it starts.\";\n        if (value.duty.roles.position && roles.position.type === \"some\" && !value.positions.some(p => p.key === roles.position.value)) return \"Choose a configured position.\";\n        if (a.who.type === \"request\" && roles.activity.type === \"some\") return \"Assign an activity to a named person.\";\n        if (roles.activity.type === \"some\") {\n            const activity = activityOf(value, roles.activity.value);\n            // A group's activity is its own duties': a duty in no group takes a shared one alone (#1548).\n            if (activity === undefined || (activity.group.type === \"some\" && !sameGroup(activity.group, roles.group))) return \"Choose an activity for this group, or a shared duty.\";\n        }\n        return undefined;\n    };\n    /** A duty moved to a place: its times kept against the shift's start, its activity cleared once it leaves its own group. */\n    const moved = (id: string, place: Place): { roles: Roles; bytes: Uint8Array } | string => {\n        const row = rowOf(id);\n        const a = week.assignments.get(id);\n        if (row === undefined || a === undefined) return \"This duty is no longer present.\";\n        const next = times.move(row.roles, start, place, context);\n        if (next.type !== \"some\") return \"Choose a configured shift.\";\n        const roles = sameGroup(a.place.group, place.group) ? next.value : { ...next.value, activity: none };\n        const written = value.duty.write(row.bytes, roles);\n        return written.type === \"some\" ? { roles, bytes: written.value } : \"This duty cannot be moved there.\";\n    };\n    /**\n     * A duty's row as a write of its own form or a library card's leaves it, what the write leaves as it was carried\n     * with the shift or the team it changes, as a move carries it: its times, kept where they stood against the\n     * shift's start, so it stays on its day; and its activity, cleared across teams, as a move clears it. Times and an\n     * activity the write gives are its own, and `validRoles` holds them to the day and the team.\n     */\n    const carried = (a: Pick<Assignment, \"place\">, row: { bytes: Uint8Array; roles: Roles }, roles: Roles, bytes: Uint8Array): { roles: Roles; bytes: Uint8Array } | string => {\n        let kept = roles;\n        if (roles.shift !== row.roles.shift && compareDate(roles.start, row.roles.start) === 0 && compareDate(roles.end, row.roles.end) === 0) {\n            const next = times.move({ ...roles, shift: row.roles.shift }, start, { ...a.place, shift: roles.shift }, context);\n            if (next.type !== \"some\") return \"Choose a configured shift.\";\n            kept = { ...kept, start: next.value.start, end: next.value.end };\n        }\n        if (!sameGroup(roles.group, row.roles.group) && roles.activity.type === \"some\" && sameActivity(roles.activity, row.roles.activity)) kept = { ...kept, activity: none };\n        if (Object.is(kept, roles)) return { roles, bytes };\n        const written = value.duty.write(bytes, kept);\n        return written.type === \"some\" ? { roles: kept, bytes: written.value } : \"This duty cannot take that.\";\n    };\n    /** A new duty at a place, its key minted: made by no pattern, its own fields the duty kind's `values` of it (#1526). */\n    const created = (who: Who, place: Place, minted: Set<string>): { id: string; bytes: Uint8Array } | string => {\n        const roles = times.newDuty(who, place, start, positionFor(value, who), none, context);\n        if (roles.type !== \"some\") return \"Choose a configured shift.\";\n        const bytes = madeFromValues(\"Roster\", \"a new duty\", () => value.duty.create({ ...roles.value, pattern: none }));\n        if (bytes === undefined) return NO_DUTY;\n        if (bytes.type !== \"some\") return who.type === \"request\" ? \"This roster takes no agency requests.\" : \"This roster takes no people.\";\n        const id = newDuty(minted);\n        if (id === undefined) return NO_DUTY;\n        minted.add(id);\n        return { id, bytes: bytes.value };\n    };\n    /**\n     * The own row of the period holding a day — the week's, or by the day the day's (#1550) — its dismissed suggestions\n     * those it holds and the one given: `undefined` without a record to keep them in, or for a new row the periods'\n     * `values` fail to make.\n     */\n    const dismissal = (day: bigint, key: string): ScheduleChange | undefined => {\n        const period = periodOn(state.periods, day);\n        if (value.periods.type !== \"some\" || !value.periods.value.dismissible || period === undefined) return undefined;\n        const periods = value.periods.value;\n        const held = period.period.bytes;\n        const row = madeFromValues(\"Roster\", \"the period's row\",\n            () => periods.dismiss(period.start, held === undefined ? none : some(held), new Set([...period.period.dismissed, key])));\n        return row === undefined ? undefined : { kind: PERIODS, id: weekKey(period.start), row };\n    };\n    /** Whether a week of the span takes a gesture now, as the week above is told: a period of it editable. */\n    const availableIn = (held: WeekState) => editing !== undefined && schedule !== undefined && state.ready && !value.settings.readOnly\n        && held.periods.some(takesEdits) && schedule.available(duty);\n    /** A week of the span by its first day: the week above, or one of the span's. */\n    const weekAt = (at: Date): WeekState | undefined => compareDate(at, start) === 0\n        ? { start, week, held: state.held, duties: state.duties, heldDuties: state.heldDuties, targets: state.targets, periods: state.periods }\n        : state.weeks?.find(held => compareDate(held.start, at) === 0);\n    const proposals = () => availableProposals(value, week, start, state.periods);\n    const publishable = available && state.publishes.some(takesEdits);\n    const api: RosterCommands = {\n        available,\n        availableOn: day => available && open(day),\n        publishable,\n        availableIn,\n        editable: available || (state.weeks ?? []).some(held => availableIn(held)),\n        locked: undefined,\n        place(source, place, checkOnly = false) {\n            const refused = blocked(); if (refused !== undefined) return refused;\n            if (!validPlace(place)) return \"Choose a configured shift in this week.\";\n            // A day whose period takes no edits takes no duty, the week's other days theirs (#1550).\n            const closed = blocked(place.day); if (closed !== undefined) return closed;\n            const changes: ScheduleChange[] = [];\n            const minted = new Set<string>();\n            let id: string | undefined;\n            let accepted: { readonly key: string; readonly day: bigint } | undefined;\n            if (source.type === \"assignment\") {\n                id = source.key;\n                const held = week.assignments.get(id);\n                if (held === undefined) return \"This duty is no longer present.\";\n                // Nor does a duty leave one.\n                const from = blocked(held.place.day); if (from !== undefined) return from;\n                if (samePlace(held.place, place)) return \"Already on this shift.\";\n                if (held.who.type === \"person\" && personDay(held.who.value, place.day, id) !== undefined) return \"This person is already rostered that day.\";\n                const next = moved(id, place);\n                if (typeof next === \"string\") return next;\n                changes.push({ kind: duty, id, row: next.bytes });\n            } else if (source.type === \"agency\") {\n                if (!value.agencies.some(a => a.key === source.key)) return \"This agency is no longer available.\";\n                const next = created(variant(\"request\", source.key), place, minted);\n                if (typeof next === \"string\") return next;\n                id = next.id;\n                changes.push({ kind: duty, id, row: next.bytes, created: true });\n            } else {\n                const proposal = source.type === \"proposal\" ? proposals().find(p => p.key === source.key) : undefined;\n                if (source.type === \"proposal\" && proposal === undefined) return \"This proposal is no longer available.\";\n                const person = proposal?.person ?? source.key;\n                if (!value.people.some(p => p.key === person)) return \"This person is no longer available.\";\n                const existing = personDay(person, place.day);\n                if (existing !== undefined) {\n                    if (samePlace(existing[1].place, place)) return \"Already on this shift.\";\n                    id = existing[0];\n                    const next = moved(id, place);\n                    if (typeof next === \"string\") return next;\n                    changes.push({ kind: duty, id, row: next.bytes });\n                } else {\n                    // A stored duty of theirs this draft removed from the place comes back as it was.\n                    const removed = [...state.held.assignments].find(([key, a]) => !week.assignments.has(key) && samePlace(a.place, place)\n                        && a.who.type === \"person\" && a.who.value === person);\n                    const original = removed === undefined ? undefined : state.heldDuties.rows.get(removed[0]);\n                    if (removed !== undefined && original !== undefined) {\n                        id = removed[0];\n                        changes.push({ kind: duty, id, row: original.bytes });\n                    } else {\n                        const next = created(variant(\"person\", person), place, minted);\n                        if (typeof next === \"string\") return next;\n                        id = next.id;\n                        changes.push({ kind: duty, id, row: next.bytes, created: true });\n                    }\n                }\n                const match = proposal ?? proposals().find(p => p.person === person && samePlace(placeOf(p.slot), place));\n                accepted = match === undefined ? undefined : { key: match.key, day: match.slot.day };\n            }\n            if (checkOnly) return undefined;\n            // An accepted proposal is dismissed on its own day's period — the week's, or the day's (#1550).\n            if (accepted !== undefined) {\n                const dismissed = dismissal(accepted.day, accepted.key);\n                if (dismissed !== undefined) changes.push(dismissed);\n            }\n            if (record(changes, \"drop\", source.type === \"assignment\" ? \"Move duty\" : accepted !== undefined ? \"Accept proposal\" : \"Assign to shift\") && id !== undefined) {\n                select({ type: \"assignment\", key: id });\n            }\n            return undefined;\n        },\n        update(id, change, origin = \"typed\", checkOnly = false) {\n            const refused = blocked(); if (refused !== undefined) return refused;\n            const a = week.assignments.get(id), row = rowOf(id);\n            if (a === undefined || row === undefined) return \"This duty is no longer present.\";\n            const closed = blocked(a.place.day); if (closed !== undefined) return closed;\n            const roles: Roles = { ...row.roles, ...change };\n            const invalid = validRoles(a, roles); if (invalid !== undefined) return invalid;\n            const written = value.duty.write(row.bytes, roles);\n            if (written.type !== \"some\") return \"This duty cannot take that.\";\n            if (!checkOnly) record([{ kind: duty, id, row: written.value }], origin, \"Edit duty\");\n            return undefined;\n        },\n        activity(id, activity, checkOnly = false) {\n            if (week.assignments.get(id) === undefined) return \"Choose a duty.\";\n            return api.update(id, { activity }, \"drop\", checkOnly);\n        },\n        sets(id, writes, checkOnly = false) {\n            const refused = blocked(); if (refused !== undefined) return refused;\n            const a = week.assignments.get(id), row = rowOf(id);\n            if (a === undefined || row === undefined || a.who.type !== \"person\") return \"Place this card on a named duty.\";\n            const closed = blocked(a.place.day); if (closed !== undefined) return closed;\n            // The fields the card sets, written as the kind writes them, and the duty they leave held to its roles.\n            let bytes = row.bytes;\n            for (const write of writes) {\n                const written = value.duty.kind.write([{ id, entry: bytes, gesture: variant(\"field\", { path: [...write.path], value: write.value }) }])[0];\n                if (written === undefined || written.type !== \"some\") return \"This card has no duty action.\";\n                bytes = written.value;\n            }\n            const read = value.duty.read(bytes, id);\n            if (!sameResource(read.resource, row.roles.resource)) return \"A card cannot replace the duty's person.\";\n            const next = carried(a, row, read, bytes); if (typeof next === \"string\") return next;\n            const invalid = validRoles(a, next.roles); if (invalid !== undefined) return invalid;\n            if (!checkOnly && !sameBytes(next.bytes, row.bytes)) record([{ kind: duty, id, row: next.bytes }], \"drop\", \"Update duty\");\n            return undefined;\n        },\n        field(id, path, next) {\n            const refused = blocked(); if (refused !== undefined) return refused;\n            const a = week.assignments.get(id), row = rowOf(id);\n            if (a === undefined || row === undefined) return \"This duty is no longer present.\";\n            const closed = blocked(a.place.day); if (closed !== undefined) return closed;\n            const change = fieldChange(value.duty.kind, id, path, next);\n            if (change === undefined) return \"This field cannot be edited.\";\n            record([change], \"typed\", \"Edit duty\");\n            return undefined;\n        },\n        row(id, bytes) {\n            const refused = blocked(); if (refused !== undefined) return refused;\n            const a = week.assignments.get(id), row = rowOf(id);\n            if (a === undefined || row === undefined) return \"This duty is no longer present.\";\n            const closed = blocked(a.place.day); if (closed !== undefined) return closed;\n            const read = value.duty.read(bytes, id);\n            if (!sameResource(read.resource, row.roles.resource)) return \"A duty's own form cannot replace its person.\";\n            const next = carried(a, row, read, bytes); if (typeof next === \"string\") return next;\n            const invalid = validRoles(a, next.roles); if (invalid !== undefined) return invalid;\n            record([{ kind: duty, id, row: next.bytes }], \"typed\", \"Edit duty\");\n            return undefined;\n        },\n        remove(id) {\n            const a = week.assignments.get(id);\n            if (a === undefined || blocked(a.place.day) !== undefined) return;\n            if (record([{ kind: duty, id, remove: true }], \"remove\", \"Remove duty\")) {\n                // A saved duty stays as a restorable tombstone until Save, keeping its identity so another layout reveals it.\n                select(state.held.assignments.has(id) ? { type: \"assignment\", key: id } : undefined);\n            }\n        },\n        restore(id) {\n            const original = state.held.assignments.get(id), row = state.heldDuties.rows.get(id);\n            if (original === undefined || row === undefined || week.assignments.has(id) || blocked(original.place.day) !== undefined) return;\n            if (original.who.type === \"person\" && personDay(original.who.value, original.place.day) !== undefined) return;\n            if (record([{ kind: duty, id, row: row.bytes }], \"insert\", \"Restore duty\")) select({ type: \"assignment\", key: id });\n        },\n        requirement(slot, target) {\n            const refused = blocked(); if (refused !== undefined) return refused;\n            if (value.targets.type !== \"some\") return \"This roster has no targets.\";\n            if (!validSlot(slot) || target.positions < 0n || [...target.hours].some(([, hours]) => !Number.isFinite(hours) || hours < 0)) return \"Targets are zero or more.\";\n            const closed = blocked(slot.day); if (closed !== undefined) return closed;\n            const targets = value.targets.value;\n            const hours = new Map([...target.hours].filter(([, h]) => h > 0));\n            const roles = { day: dayOfSlot(start, slot), group: slot.group, shift: slot.shift, positions: target.positions, hours };\n            const row = state.targets.rows.get(slot);\n            if (row !== undefined) {\n                record([{ kind: TARGETS, id: row.key, row: targets.write(row.bytes, roles) }], \"typed\", \"Edit shift targets\");\n                return undefined;\n            }\n            const made = madeFromValues(\"Roster\", \"a new shift's targets\", () => targets.create(roles));\n            const id = made === undefined ? undefined : newTarget();\n            if (made === undefined || id === undefined) return NO_TARGETS;\n            record([{ kind: TARGETS, id, row: made, created: true }], \"typed\", \"Edit shift targets\");\n            return undefined;\n        },\n        targetRow(slot, bytes) {\n            const refused = blocked(); if (refused !== undefined) return refused;\n            if (value.targets.type !== \"some\") return \"This roster has no targets.\";\n            const closed = blocked(slot.day); if (closed !== undefined) return closed;\n            const row = state.targets.rows.get(slot);\n            if (row !== undefined) {\n                record([{ kind: TARGETS, id: row.key, row: bytes }], \"typed\", \"Edit shift targets\");\n                return undefined;\n            }\n            const id = newTarget();\n            if (id === undefined) return NO_TARGETS;\n            record([{ kind: TARGETS, id, row: bytes, created: true }], \"typed\", \"Edit shift targets\");\n            return undefined;\n        },\n        accept(key) {\n            const proposal = proposals().find(p => p.key === key);\n            return proposal === undefined ? \"This proposal is no longer available.\" : api.place({ type: \"proposal\", key }, placeOf(proposal.slot));\n        },\n        reject(key) {\n            // Dismissed on its own day's period — the week's, or the day's (#1550).\n            const proposal = proposals().find(p => p.key === key);\n            if (proposal === undefined || blocked(proposal.slot.day) !== undefined) return;\n            const change = dismissal(proposal.slot.day, key);\n            if (change !== undefined && record([change], \"remove\", \"Reject proposal\")) select(undefined);\n        },\n        fix(issue) {\n            if (issue.fix.type === \"none\") return undefined;\n            const fix = issue.fix.value;\n            if (fix.type === \"find\") { if (issue.slot.type === \"some\") find({ need: fix.value, slot: issue.slot.value }); return undefined; }\n            if (fix.type === \"accept\") return api.accept(fix.value);\n            if (fix.type === \"request\") return issue.slot.type === \"some\" ? api.place({ type: \"agency\", key: fix.value }, placeOf(issue.slot.value)) : undefined;\n            if (issue.assignment.type !== \"some\") return undefined;\n            const id = issue.assignment.value, a = week.assignments.get(id);\n            if (a === undefined) return undefined;\n            if (fix.type === \"move\") return api.place({ type: \"assignment\", key: id }, { ...a.place, shift: fix.value });\n            const later = startingAt(a, fix.value);\n            return api.update(id, { start: later.start, end: later.end });\n        },\n        copy() {\n            if (blocked() !== undefined || state.previous === undefined || week.assignments.size !== 0) return;\n            const changes: ScheduleChange[] = [];\n            const minted = new Set<string>();\n            for (const [key, a] of state.previous.assignments) {\n                const row = state.previous.rows.get(key);\n                const own = shiftTimes(value, a.place, start);\n                // Into the days that take edits alone: a published day keeps its own (#1550).\n                if (row === undefined || own === undefined || !open(a.place.day)) continue;\n                // At its shift's own times, every other field as it was.\n                const written = value.duty.write(row.bytes, { ...row.roles, start: own.from, end: own.to });\n                if (written.type !== \"some\") continue;\n                const id = newDuty(minted);\n                if (id === undefined) continue;\n                minted.add(id);\n                changes.push({ kind: duty, id, row: written.value, created: true });\n            }\n            record(changes, \"insert\", \"Copy previous week's roster\");\n        },\n        publish() { if (publishable && value.periods.type === \"some\") publish(); },\n        pattern(person, at, key) {\n            const held = weekAt(at);\n            const who = value.people.find(p => p.key === person);\n            if (held === undefined || who === undefined) return \"Drop a pattern on a person's week.\";\n            if (!availableIn(held)) return \"This week is not available to edit.\";\n            if (state.retained === true) return \"This week is still being read.\";\n            const pattern = patternOf(value, key);\n            if (pattern === undefined || patternProblem(value, pattern) !== undefined) return \"Choose a configured shift.\";\n            const domain = rosterDomain(value.duty.rowType);\n            const changes: ScheduleChange[] = [];\n            const candidates = new Map<string, Assignment>();\n            const removed: string[] = [];\n            const days: PatternDay[] = [];\n            const minted = new Set<string>();\n            const whoRef: Who = variant(\"person\", person);\n            // The person's duties of the week, each day's in time order.\n            const theirs = [...held.week.assignments].filter(([, a]) => a.who.type === \"person\" && a.who.value === person)\n                .sort(([, a], [, b]) => compareDate(a.start, b.start));\n            for (let day = 0; day < 7; day++) {\n                const current = theirs.filter(([, a]) => Number(a.place.day) === day);\n                const target = pattern.days[day]!;\n                // A day whose period takes no edits — a published day of a week published by the day — keeps its duties as\n                // they are (#1550): the pattern leaves it.\n                const period = periodOn(held.periods, day);\n                if (period === undefined || !takesEdits(period)) {\n                    for (const [id, a] of current) candidates.set(id, a);\n                    days.push({ day, shift: current[0]?.[1].place.shift, kind: \"keep\" });\n                    continue;\n                }\n                if (target.type === \"none\") {\n                    // A day off: the person's duties that day go, restorable until Save (B56).\n                    for (const [id] of current) { changes.push({ kind: duty, id, remove: true }); removed.push(id); }\n                    days.push({ day, shift: undefined, kind: current.length === 0 ? \"keep\" : \"off\" });\n                    continue;\n                }\n                const place: Place = { day: BigInt(day), group: some(who.group), shift: target.value };\n                const own = shiftTimes(value, place, at);\n                if (own === undefined) return \"Choose a configured shift.\";\n                const first = current[0];\n                if (first !== undefined) {\n                    const [id, a] = first;\n                    // The day as the pattern has it already: the shift, in the home group, at the shift's own times.\n                    if (samePlace(a.place, place) && compareDate(a.start, own.from) === 0 && compareDate(a.end, own.to) === 0) {\n                        candidates.set(id, a);\n                        days.push({ day, shift: target.value, kind: \"keep\" });\n                    } else {\n                        // Moved to the pattern's shift at the shift's own times, its position kept, its activity kept within the group and cleared across one (B49).\n                        const row = held.duties.rows.get(id);\n                        if (row === undefined) return \"This duty is no longer present.\";\n                        const next = times.move(row.roles, at, place, context);\n                        if (next.type !== \"some\") return \"Choose a configured shift.\";\n                        const roles: Roles = { ...next.value, start: own.from, end: own.to, activity: sameGroup(a.place.group, place.group) ? next.value.activity : none };\n                        const written = value.duty.write(row.bytes, roles);\n                        if (written.type !== \"some\") return \"This duty cannot be moved there.\";\n                        changes.push({ kind: duty, id, row: written.value });\n                        candidates.set(id, { ...a, place, start: own.from, end: own.to, hours: value.duty.read(written.value, id).hours, activity: roles.activity });\n                        days.push({ day, shift: target.value, kind: \"set\" });\n                    }\n                    // A second duty that day goes: a pattern's day is one shift.\n                    for (const [extra] of current.slice(1)) { changes.push({ kind: duty, id: extra, remove: true }); removed.push(extra); }\n                    continue;\n                }\n                // A new duty on the pattern's shift, at the shift's start for its hours, in the home group, at the person's position, with no\n                // activity: the pattern's, its own fields the duty kind's `values` of it (#1526).\n                const roles = times.newDuty(whoRef, place, at, positionFor(value, whoRef), none, context);\n                if (roles.type !== \"some\") return \"Choose a configured shift.\";\n                const bytes = madeFromValues(\"Roster\", \"a new duty\", () => value.duty.create({ ...roles.value, pattern: some(pattern.key) }));\n                if (bytes === undefined) return NO_DUTY;\n                if (bytes.type !== \"some\") return \"This roster takes no people.\";\n                const id = newDuty(minted);\n                if (id === undefined) return NO_DUTY;\n                minted.add(id);\n                changes.push({ kind: duty, id, row: bytes.value, created: true });\n                candidates.set(id, { place, who: whoRef, position: roles.value.position.type === \"some\" ? roles.value.position.value : \"\", activity: none,\n                    start: roles.value.start, end: roles.value.end, hours: roles.value.hours, row: domain.decodeRow(bytes.value) });\n                days.push({ day, shift: target.value, kind: \"set\" });\n            }\n            return { pattern, person: who, start: at, days, changes, candidates, removed };\n        },\n        applyPattern(person, at, key, checkOnly = false) {\n            const plan = api.pattern(person, at, key);\n            if (typeof plan === \"string\") return plan;\n            if (checkOnly || plan.changes.length === 0) return undefined;\n            if (record(plan.changes, \"drop\", \"Apply pattern\")) select({ type: \"personWeek\", key: person, start: at.getTime() });\n            return undefined;\n        },\n    };\n    // A pattern over a person's week is planned once per week state (#1406, P19): the drag layer asks the cell's veto\n    // of every move the pointer makes over the row, the ghost's caption and the row's preview ask too, and the plan is\n    // pure over the state — so each reads the one plan, and a drop takes it with the keys it minted. A new state is a\n    // new `rosterCommands`, and so a new table.\n    const plans = new Map<string, PatternPlan | string>();\n    const planned = api.pattern;\n    api.pattern = (person, at, key) => {\n        const id = `${person}\\u0000${weekKey(at)}\\u0000${key}`;\n        let plan = plans.get(id);\n        if (plan === undefined) { plan = planned(person, at, key); plans.set(id, plan); }\n        return plan;\n    };\n    return api;\n}\n\n/**\n * The rows Publish writes (#1550): each period given that takes edits — the\n * week's, or by the day each day's — its status the published case, at the\n * time given, over its row as the Save left it (`periodPublishChange`). A\n * period with no row is given one made from the periods' `values` only then,\n * and one they fail to make records none of the changes, so Publish never\n * publishes a part of what it was pressed for.\n *\n * @param value - The payload: its periods\n * @param periods - The periods Publish publishes\n * @param at - When they are published\n * @returns The changes, one a period; none without periods\n */\nexport function publishChanges(value: RosterPayload, periods: readonly WeekPeriod[], at: Date): readonly ScheduleChange[] {\n    if (value.periods.type !== \"some\") return [];\n    const kind = value.periods.value;\n    return periods.filter(takesEdits).map(period => periodPublishChange(kind, PERIODS, weekKey(period.start), period.start, at, \"Roster\"));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A builder's reference record (#1551): a record of the app's its check reads\n * beside the builder's own rows — the Roster's rota, the Allocation's\n * delivery schedule — through the slice's source named `reference`. The\n * builder writes its period's window into that source as into its own kind's\n * (`useSourceWindow`), and the payload reads its rows over a window through\n * the source's interval index (`ScheduleReferenceType`'s `rows`), as bytes —\n * each week of a month its own; the builder's data reader\n * reads the period's windows with its other reads, decodes each row once\n * (`referenceDecoder`, `keptReference`) and hands the check its period's rows\n * by key. Nothing draws them and the rail leaves the source out (`useRailSources`):\n * it narrows nothing, so it offers no field and counts no row.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { BlobType, EastTypeType, SortedMap, StringType, compareFor, decodeBeast2For, equalFor, fromEastTypeValue, type EastType, type EastTypeValue, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSlicesBindType } from \"@elaraai/east-ui/internal\";\nimport { SCHEDULE_REFERENCE } from \"@elaraai/e3-ui/internal\";\n\nconst sameName = equalFor(StringType);\nconst sameType = equalFor(EastTypeType);\nconst sameBytes = equalFor(BlobType);\nconst byKey = compareFor(StringType);\n\n/** A Slice over several records, as the payload's chrome carries it. */\ntype Product = ValueTypeOf<RecordSlicesBindType>;\n\n/**\n * The slice the rail draws: the payload's, its `reference` source left out —\n * a record only the check reads, which narrows nothing, so the rail offers\n * none of its fields and counts none of its rows. The same object while the\n * payload's is, and the payload's itself where it has no such source.\n *\n * @param slices - The payload's slice; `undefined` with none\n * @returns What the rail is drawn from\n */\nexport function useRailSources(slices: Product | undefined): Product | undefined {\n    return useMemo(() => slices === undefined || !slices.parts.some(part => sameName(part.source, SCHEDULE_REFERENCE)) ? slices\n        : { ...slices, parts: slices.parts.filter(part => !sameName(part.source, SCHEDULE_REFERENCE)) }, [slices]);\n}\n\n/** A reference record's rows read over a window, each decoded once: what the check is given. */\nexport interface ReferenceRows {\n    /** Each row's bytes, by key: what a read again keeps a row by. */\n    readonly bytes: SortedMap<string, Uint8Array>;\n    /** Each row, decoded, by key in key order: the check's `reference`. */\n    readonly rows: SortedMap<string, unknown>;\n}\n\n/** No rows: a window the record holds none of. */\nexport const NO_REFERENCE_ROWS: ReferenceRows = { bytes: new SortedMap([], byKey), rows: new SortedMap([], byKey) };\n\nconst decoders: { type: EastTypeValue; decode: (bytes: Uint8Array) => unknown }[] = [];\n\n/**\n * The decoder of a reference record's rows, made the first time its row type\n * is seen, then shared — East decides which types are the same.\n *\n * @param rowType - The record's row type, as the payload carries it\n * @returns Its rows' decoder\n */\nexport function referenceDecoder(rowType: EastTypeValue): (bytes: Uint8Array) => unknown {\n    const known = decoders.find(d => sameType(d.type, rowType));\n    if (known !== undefined) return known.decode;\n    const decode = decodeBeast2For(fromEastTypeValue(rowType) as EastType) as (bytes: Uint8Array) => unknown;\n    decoders.push({ type: rowType, decode });\n    return decode;\n}\n\n/**\n * A window's rows read again, each kept as it was where its bytes are: its\n * row not decoded again, and the rows held the same object while every row\n * reads as it did.\n *\n * @param read - The window's rows, by key, as their bytes\n * @param held - What the window held last; `undefined` the first time\n * @param decode - The rows' decoder ({@link referenceDecoder})\n * @returns The window's rows\n */\nexport function keptReference(read: ReadonlyMap<string, Uint8Array>, held: ReferenceRows | undefined, decode: (bytes: Uint8Array) => unknown): ReferenceRows {\n    if (read.size === 0) return held !== undefined && held.bytes.size === 0 ? held : NO_REFERENCE_ROWS;\n    const bytes = new SortedMap<string, Uint8Array>([], byKey), rows = new SortedMap<string, unknown>([], byKey);\n    let same = held !== undefined && held.bytes.size === read.size;\n    for (const [key, entry] of read) {\n        const was = held?.bytes.get(key);\n        if (held !== undefined && was !== undefined && sameBytes(was, entry)) { bytes.set(key, was); rows.set(key, held.rows.get(key)); continue; }\n        same = false;\n        bytes.set(key, entry);\n        rows.set(key, decode(entry));\n    }\n    return same && held !== undefined ? held : { bytes, rows };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's reads of the app's records (#1369, `Builder Interfaces Spec.md`\n * §7.5, §9), in a component of its own, as the Calendar's window is (#1343):\n * the span's duties through the duty kind's `rows` — over the span's weeks and\n * the twelve hours either side a duty's start may stand from its shift's\n * (`spanWindow`), and the week before's while a week in view holds none, which\n * Copy previous week reads — each week's own row through the periods' `rows`\n * (each of its days' where the periods are days, #1550), the open picker's\n * weeks' through the same, the span's targets through theirs, and — beside a\n * reference record the app's check reads (#1551) — each week's rows of it, over\n * the week and the twelve hours either side, through its window, each decoded\n * once. A span is one week, or a month's four to six (#1406, P26), its reads\n * swapped at once. What it reads is kept by its bytes: a row read again as it\n * was keeps its decoded row, so a render never decodes it again, and the frame\n * is handed what it reads only when that moves. Once the span has landed, the\n * spans either side — the weeks, or the months — are read ahead\n * (`shared/schedule/read-ahead.ts`, #1398, CL7), in a read of their own, so a\n * step to one shows it at once and a page of theirs landing runs the span's\n * read no more; a step further drops their reads. For an optimiser that takes\n * the week's edges (#1553), the periods of the weeks either side are read at\n * once, in a read of their own on the read ahead's channels: which of the\n * duties at the week's edges are fixed. Its failure is its own, said on the\n * footer's line with Retry; the week's read stands.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { BlobType, DateTimeType, DictType, SortedMap, equalFor } from \"@elaraai/east\";\nimport { RosterStatusType } from \"@elaraai/e3-ui/internal\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { keptReference, referenceDecoder, type ReferenceRows } from \"../shared/schedule/reference.js\";\nimport { useReadAhead } from \"../shared/schedule/use-read-ahead.js\";\nimport { shiftCalendar } from \"../shared/time/scale.js\";\nimport {\n    DAY, byDay, compareDate, compareString, rosterDomain, rosterSpan, spanWindow, weekBefore, weekSpan, weekWindow,\n    type RosterPayload, type RosterSpan, type Status, type StoredDuty, type StoredTarget,\n} from \"./model.js\";\n\nconst sameBytes = equalFor(BlobType);\nconst samePicker = equalFor(DictType(DateTimeType, RosterStatusType));\n\n/**\n * The periods of the weeks either side of a week in view (#1553): what a run of an optimiser that takes the week's edges\n * tells which of the duties at the edges are fixed by.\n */\nexport interface RosterNeighbours {\n    /** The week they are either side of: its first day. */\n    readonly start: Date;\n    /** Each period's own row's bytes, by its first instant — the weeks', or their days' where the periods are days: a period with no row is not among them. */\n    readonly periods: SortedMap<Date, Uint8Array>;\n}\n\n/** What the Roster has read of its records for a span. */\nexport interface RosterData {\n    /** The span it is of: its first week's first day. */\n    readonly start: Date;\n    /** Its weeks' first days. */\n    readonly weeks: readonly Date[];\n    /** The span's stored duties, by key — what its window read, other weeks' among them. */\n    readonly duties: ReadonlyMap<string, StoredDuty>;\n    /** The week before's, read while a week in view holds none of its own: what Copy previous week copies; `undefined` otherwise, or while it is read. */\n    readonly previous: ReadonlyMap<string, StoredDuty> | undefined;\n    /**\n     * Each period's own row's bytes, by its first instant — each week's, or each day's where the periods are days\n     * (#1550): a period with no row is not among them, nor any of a Roster with no periods.\n     */\n    readonly periods: SortedMap<Date, Uint8Array>;\n    /** The open picker's periods' statuses, by their start — its weeks', or its days' (#1550): a period with no row is not among them. */\n    readonly picker: SortedMap<Date, Status>;\n    /** The span's targets, by key. */\n    readonly targets: ReadonlyMap<string, StoredTarget>;\n    /**\n     * The rows of the reference record the app's check reads (#1551): each week of the span's, by its first day — the\n     * record's rows overlapping the week and the twelve hours either side, every one whatever the slice holds; empty\n     * without one.\n     */\n    readonly references: SortedMap<Date, ReferenceRows>;\n    /**\n     * The periods of the weeks either side of a week in view, for an optimiser that takes the week's edges (#1553);\n     * `undefined` without one, in a month, and while they are read.\n     */\n    readonly neighbours: RosterNeighbours | undefined;\n    /** Why the read of the periods of the weeks either side failed (#1553): the eye waits on it, and the footer's line says it, with Retry. */\n    readonly neighboursError: string | undefined;\n    /** Whether a read the span needs — its duties, its weeks' rows, its targets or its reference rows — is in flight. */\n    readonly loading: boolean;\n    /** Whether a complete read of the span has landed. */\n    readonly ready: boolean;\n    /**\n     * Whether a complete read of any span has landed: the frame's cold load is\n     * over (#1398, CL5), and a span not read yet is read with the frame live,\n     * its geometry drawn and its placeholders where its content goes.\n     */\n    readonly landed: boolean;\n    /** Why the latest read failed. */\n    readonly error: string | undefined;\n}\n\nconst NO_DUTIES: ReadonlyMap<string, StoredDuty> = new Map();\nconst NO_TARGETS: ReadonlyMap<string, StoredTarget> = new Map();\nconst NO_STATUSES = new SortedMap<Date, Status>([], compareDate);\nconst NO_PERIODS = new SortedMap<Date, Uint8Array>([], compareDate);\nconst NO_REFERENCES = new SortedMap<Date, ReferenceRows>([], compareDate);\n\n/**\n * The frame's data before its reader first reports: nothing held, a read in flight.\n *\n * @param span - The span the frame shows\n * @returns The state\n */\nexport function initialRosterData(span: Pick<RosterSpan, \"start\" | \"weeks\">): RosterData {\n    return { start: span.start, weeks: span.weeks, duties: NO_DUTIES, previous: undefined, periods: NO_PERIODS, picker: NO_STATUSES, targets: NO_TARGETS,\n        references: NO_REFERENCES, neighbours: undefined, neighboursError: undefined, loading: true, ready: false, landed: false, error: undefined };\n}\n\n/** Rows read again, each kept as it was where its bytes are: the same object, its row not decoded again. */\nfunction keptDuties(read: ReadonlyMap<string, { roles: StoredDuty[\"roles\"]; row: Uint8Array }>, held: ReadonlyMap<string, StoredDuty> | undefined,\n    decode: (bytes: Uint8Array) => unknown): ReadonlyMap<string, StoredDuty> {\n    const out = new SortedMap<string, StoredDuty>([], compareString);\n    let same = held !== undefined && held.size === read.size;\n    for (const [key, entry] of read) {\n        const was = held?.get(key);\n        if (was !== undefined && sameBytes(was.bytes, entry.row)) { out.set(key, was); continue; }\n        same = false;\n        out.set(key, { roles: entry.roles, bytes: entry.row, row: decode(entry.row) });\n    }\n    return same && held !== undefined ? held : out;\n}\n/** Targets read again, each kept as it was where its bytes are. */\nfunction keptTargets(read: ReadonlyMap<string, { roles: StoredTarget[\"roles\"]; row: Uint8Array }>, held: ReadonlyMap<string, StoredTarget> | undefined): ReadonlyMap<string, StoredTarget> {\n    const out = new SortedMap<string, StoredTarget>([], compareString);\n    let same = held !== undefined && held.size === read.size;\n    for (const [key, entry] of read) {\n        const was = held?.get(key);\n        if (was !== undefined && sameBytes(was.bytes, entry.row)) { out.set(key, was); continue; }\n        same = false;\n        out.set(key, { roles: entry.roles, bytes: entry.row });\n    }\n    return same && held !== undefined ? held : out;\n}\n/** The periods' own rows read again, each by a period's first instant given, kept as they were where their bytes are. */\nfunction keptPeriods(read: ReadonlyMap<Date, Uint8Array>, starts: readonly Date[], held: SortedMap<Date, Uint8Array> | undefined): SortedMap<Date, Uint8Array> {\n    const out = new SortedMap<Date, Uint8Array>([], compareDate);\n    for (const start of starts) {\n        const row = read.get(start);\n        if (row !== undefined) out.set(start, row);\n    }\n    if (held !== undefined && held.size === out.size && [...out].every(([start, row]) => { const was = held.get(start); return was !== undefined && sameBytes(was, row); })) return held;\n    return out;\n}\n\n/**\n * Reads the span (see the module docs).\n *\n * @param value - The payload\n * @param span - The span in view\n * @param pickerDates - The open picker's weeks' first days\n * @param holds - Whether the span's stored duties hold one of its first week's: the week before is read only while a one-week span does not\n * @returns What the Roster has read of the span\n */\nexport function useRosterData(value: RosterPayload, span: RosterSpan, pickerDates: readonly Date[], holds: (duties: ReadonlyMap<string, StoredDuty>) => boolean): RosterData {\n    // What was read last, kept by its bytes across reads.\n    const held = useRef<{ duties?: ReadonlyMap<string, StoredDuty>; previous?: ReadonlyMap<string, StoredDuty>; targets?: ReadonlyMap<string, StoredTarget>;\n        periods?: SortedMap<Date, Uint8Array>; picker?: SortedMap<Date, Status>; references?: SortedMap<Date, ReferenceRows> }>({});\n    const { start, weeks } = span;\n    const read = useCallback(() => {\n        const domain = rosterDomain(value.duty.rowType);\n        let loading = false;\n        const window = spanWindow(span);\n        const rows = value.duty.rows(window.from, window.to);\n        let duties: ReadonlyMap<string, StoredDuty> | undefined;\n        if (rows.type === \"some\") duties = keptDuties(rows.value, held.current.duties, domain.decodeRow);\n        else loading = true;\n        // The week before, which Copy previous week reads: only while a one-week span holds none of its own.\n        let previous: ReadonlyMap<string, StoredDuty> | undefined;\n        if (duties !== undefined && weeks.length === 1 && !holds(duties)) {\n            const before = weekWindow(weekBefore(start));\n            const got = value.duty.rows(before.from, before.to);\n            if (got.type === \"some\") previous = keptDuties(got.value, held.current.previous, domain.decodeRow);\n        }\n        // Each period's own row, by its start: each week's, or each of its days' where the periods are days (#1550) — the\n        // span's seven a week in one read, as its weeks are.\n        let periods = NO_PERIODS;\n        let picker = NO_STATUSES;\n        if (value.periods.type === \"some\") {\n            const kind = value.periods.value;\n            const got = kind.rows(span.from, span.to);\n            const starts = byDay(value) ? weeks.flatMap(week => Array.from({ length: 7 }, (_, day) => new Date(week.getTime() + day * DAY))) : weeks;\n            if (got.type === \"some\") periods = keptPeriods(got.value, starts, held.current.periods);\n            else loading = true;\n            // The open picker's weeks: one span, from its first week to the end of its last — each week's status, or each\n            // day's.\n            if (pickerDates.length > 0) {\n                const first = pickerDates.reduce((a, b) => compareDate(a, b) <= 0 ? a : b);\n                const last = pickerDates.reduce((a, b) => compareDate(a, b) >= 0 ? a : b);\n                const statuses = kind.rows(first, weekSpan(last).to);\n                if (statuses.type === \"some\") {\n                    const next = new SortedMap([...statuses.value].map(([at, bytes]) => [at, kind.status(bytes)] as const), compareDate);\n                    const was = held.current.picker;\n                    picker = was !== undefined && samePicker(was, next) ? was : next;\n                }\n            }\n        }\n        // The span's targets, by their day.\n        let targets = NO_TARGETS;\n        if (value.targets.type === \"some\") {\n            const got = value.targets.value.rows(span.from, span.to);\n            if (got.type === \"some\") targets = keptTargets(got.value, held.current.targets);\n            else loading = true;\n        }\n        // The reference record the app's check reads (#1551): each week's rows over the week and the twelve hours either\n        // side, as the week before's duties are read — every one, whatever the slice holds — each decoded once.\n        let references = NO_REFERENCES;\n        if (value.reference.type === \"some\") {\n            const reference = value.reference.value;\n            const decode = referenceDecoder(reference.rowType);\n            const was = held.current.references;\n            const next = new SortedMap<Date, ReferenceRows>([], compareDate);\n            for (const week of weeks) {\n                const around = weekWindow(week);\n                const got = reference.rows(around.from, around.to);\n                if (got.type === \"some\") next.set(week, keptReference(got.value, was?.get(week), decode));\n                else loading = true;\n            }\n            references = was !== undefined && was.size === next.size && [...next].every(([week, rows]) => Object.is(was.get(week), rows)) ? was : next;\n        }\n        return { duties, previous, periods, picker, targets, references, loading };\n    }, [value, span, start, weeks, pickerDates, holds]);\n    const { result } = useTrackedEvaluation(read);\n    // Once the span has landed, the spans either side are read ahead (#1398, CL7) — in a read of their own, so a page of\n    // theirs landing runs the span's read no more: a step to one shows it at once.\n    const at = start.getTime(), period = span.period, sunday = (weeks[0]?.getUTCDay() ?? 1) === 0;\n    const neighbours = useMemo(() => period === \"month\"\n        ? [rosterSpan(shiftCalendar(span.month ?? new Date(at), \"month\", 1).getTime(), \"month\", sunday), rosterSpan(shiftCalendar(span.month ?? new Date(at), \"month\", -1).getTime(), \"month\", sunday)]\n        : [rosterSpan(at + 7 * DAY, period, sunday), rosterSpan(at - 7 * DAY, period, sunday)],\n        // The span's month is a function of its start and period: the three say when it moves.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [at, period, sunday]);\n    const readNext = useCallback((next: RosterSpan) => {\n        const around = spanWindow(next);\n        value.duty.rows(around.from, around.to);\n        if (value.periods.type === \"some\") value.periods.value.rows(next.from, next.to);\n        if (value.targets.type === \"some\") value.targets.value.rows(next.from, next.to);\n        if (value.reference.type === \"some\") {\n            for (const week of next.weeks) {\n                const around = weekWindow(week);\n                value.reference.value.rows(around.from, around.to);\n            }\n        }\n    }, [value]);\n    useReadAhead(result.ok && !result.value.loading && result.value.duties !== undefined, neighbours, readNext);\n    // The periods of the weeks either side, for an optimiser that takes the week's edges (#1553): read at once, beside the\n    // span's read, on the channels the read ahead reads them by, so asking them early asks nothing twice — kept by their\n    // bytes, so a read again hands the frame nothing new.\n    const edged = value.optimise.type === \"some\" && value.optimise.value.edges && period !== \"month\" && !value.settings.readOnly;\n    const heldNeighbours = useRef<RosterNeighbours | undefined>(undefined);\n    const readNeighbours = useCallback((): RosterNeighbours | undefined => {\n        if (!edged) return undefined;\n        const was = heldNeighbours.current;\n        if (value.periods.type !== \"some\") return was !== undefined && compareDate(was.start, start) === 0 ? was : { start, periods: NO_PERIODS };\n        const kind = value.periods.value;\n        const read = new SortedMap<Date, Uint8Array>([], compareDate);\n        let pending = false;\n        for (const next of neighbours) {\n            const got = kind.rows(next.from, next.to);\n            if (got.type !== \"some\") { pending = true; continue; }\n            for (const [at, bytes] of got.value) read.set(at, bytes);\n        }\n        if (pending) return undefined;\n        const same = was !== undefined && compareDate(was.start, start) === 0 && was.periods.size === read.size\n            && [...read].every(([at, row]) => { const held = was.periods.get(at); return held !== undefined && sameBytes(held, row); });\n        return same ? was : { start, periods: read };\n    }, [edged, value, start, neighbours]);\n    const edgeRead = useTrackedEvaluation(readNeighbours).result;\n    const neighbourPeriods = edgeRead.ok ? edgeRead.value : undefined;\n    const neighboursError = edgeRead.ok ? undefined : edgeRead.error instanceof Error ? edgeRead.error.message : String(edgeRead.error);\n    if (neighbourPeriods !== undefined) heldNeighbours.current = neighbourPeriods;\n    // The last complete read of a span: a newer one in flight keeps it, so a page landing redraws nothing until the read is whole.\n    const complete = useRef<RosterData | undefined>(undefined);\n    if (result.ok) {\n        const got = result.value;\n        held.current = { ...(got.duties === undefined ? {} : { duties: got.duties }), ...(got.previous === undefined ? {} : { previous: got.previous }),\n            ...(Object.is(got.targets, NO_TARGETS) ? {} : { targets: got.targets }), ...(Object.is(got.periods, NO_PERIODS) ? {} : { periods: got.periods }),\n            ...(Object.is(got.picker, NO_STATUSES) ? {} : { picker: got.picker }), ...(Object.is(got.references, NO_REFERENCES) ? {} : { references: got.references }) };\n        const was = complete.current;\n        if (!got.loading && got.duties !== undefined && (was === undefined || compareDate(was.start, start) !== 0 || was.weeks.length !== weeks.length\n            || !Object.is(was.duties, got.duties) || !Object.is(was.previous, got.previous) || !Object.is(was.targets, got.targets)\n            || !Object.is(was.picker, got.picker) || !Object.is(was.periods, got.periods) || !Object.is(was.references, got.references))) {\n            complete.current = { start, weeks, duties: got.duties, previous: got.previous, periods: got.periods, picker: got.picker, targets: got.targets,\n                references: got.references, neighbours: undefined, neighboursError: undefined, loading: false, ready: true, landed: true, error: undefined };\n        }\n    }\n    const last = complete.current;\n    // A span moved to holds nothing of the span before it: its read is in flight until it lands.\n    const current = last !== undefined && compareDate(last.start, start) === 0 && last.weeks.length === weeks.length ? last : undefined;\n    const landed = last !== undefined;\n    const loading = result.ok ? result.value.loading || current === undefined : false;\n    const error = result.ok ? undefined : result.error instanceof Error ? result.error.message : String(result.error);\n    return useMemo(() => current === undefined ? { ...initialRosterData(span), loading, landed, error }\n        : current.loading === loading && current.error === error && Object.is(current.neighbours, neighbourPeriods) && current.neighboursError === neighboursError ? current\n            : { ...current, loading, error, neighbours: neighbourPeriods, neighboursError }, [current, span, loading, landed, error, neighbourPeriods, neighboursError]);\n}\n\n/**\n * The span's reads, in a component of its own (#1343): each page and search\n * that lands re-runs it alone, and it hands the frame what it read only when\n * what the frame shows moves.\n *\n * @param props - The payload, the span, the open picker's weeks, which stored duties hold one of the first week's, and where the data goes\n * @returns Nothing: it reads\n */\nexport function RosterDataReader({ value, span, pickerDates, holds, onData }: {\n    value: RosterPayload; span: RosterSpan; pickerDates: readonly Date[]; holds: (duties: ReadonlyMap<string, StoredDuty>) => boolean; onData: (data: RosterData) => void;\n}): null {\n    const data = useRosterData(value, span, pickerDates, holds);\n    const reported = useRef<RosterData | undefined>(undefined);\n    useLayoutEffect(() => {\n        if (Object.is(reported.current, data)) return;\n        reported.current = data;\n        onData(data);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\nimport { StringType, VariantType, parseFor, printFor, variant, type ValueTypeOf } from \"@elaraai/east\";\n/** People and agencies may use the same string key without colliding in Library. */\nconst SourceType = VariantType({ person: StringType, agency: StringType });\nconst printSource = printFor(SourceType);\nexport const readRosterSource: (text: string) => { success: true; value: ValueTypeOf<typeof SourceType> } | { success: false } = parseFor(SourceType);\nexport const rosterSourceKey = (type: \"person\" | \"agency\", key: string) => printSource(variant(type, key));\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useEffect, useLayoutEffect, useMemo, useState } from \"react\";\nimport { Box, Button } from \"@chakra-ui/react\";\nimport { DateTimeType, FloatType, IntegerType, OptionType, SortedMap, StringType, StructType, none, parseFor, printFor, some, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { RosterRequirementType } from \"@elaraai/e3-ui/internal\";\nimport { Fields } from \"@elaraai/east-ui\";\nimport { FieldForm, SliceEditPopover, useFormatters } from \"@elaraai/east-ui-components\";\nimport { Chooser, type ChooserSection } from \"@elaraai/east-ui-components/internal\";\nimport {\n    activityChoices, compareString, DAY, duties, groupOf, groupSkills, patternProblem, patternSummary, requirementOf, type Assignment, type Person, type Place, type RosterStyles,\n    type RosterValue, type Slot, type Week,\n} from \"./model.js\";\nimport type { RolesChange, RosterCommands, RosterSource } from \"./actions.js\";\n\nconst parseDay = parseFor(IntegerType);\nconst printDay = printFor(IntegerType);\n/** A group as the place's form keys its choice (#1548): the `Option<String>` printed, so No group stands beside the groups. */\nconst printGroup = printFor(OptionType(StringType));\nconst parseGroup = parseFor(OptionType(StringType));\nconst PlaceForm = StructType({ day: StringType, group: StringType, shift: StringType });\nconst PLACE_FIELDS = Fields.specs(PlaceForm, { day: Fields.reference({ of: \"days\" }), group: Fields.reference({ of: \"groups\" }), shift: Fields.reference({ of: \"shifts\" }) });\nconst GroupForm = StructType({ group: StringType });\nconst GROUP_FIELDS = Fields.specs(GroupForm, { group: Fields.reference({ of: \"groups\" }) });\nconst PersonForm = StructType({ person: OptionType(StringType) });\nconst PERSON_FIELDS = Fields.specs(PersonForm, { person: Fields.reference({ of: \"people\" }) });\n/** What the Roster's own form edits of a duty beside its times: the position held and the activity. */\nconst DutyForm = StructType({ position: StringType, activity: OptionType(StringType) });\nconst DUTY_FIELDS = Fields.specs(DutyForm, { position: Fields.reference({ of: \"positions\" }), activity: Fields.reference({ of: \"activities\" }) });\n/** A duty's own times (§5.5, rule 4). */\nconst TimesForm = StructType({ start: DateTimeType, end: DateTimeType });\nconst TIME_FIELDS = Fields.specs(TimesForm, {});\nconst TARGET_FIELDS = Fields.specs(RosterRequirementType, { positions: Fields.number({ min: 0n, step: 1n }) }, [\"hours\"]);\nconst Hours = StructType({ hours: FloatType });\nconst HOUR_FIELDS = Fields.specs(Hours, { hours: Fields.number({ min: 0, step: 0.5, unit: \"h\" }) });\nconst AddLine = StructType({ activity: OptionType(StringType), hours: FloatType });\nconst ADD_FIELDS = Fields.specs(AddLine, { activity: Fields.reference({ of: \"activities\" }), hours: Fields.number({ min: 0, step: 0.5, unit: \"h\" }) });\n\n/**\n * The groups a duty can stand in, keyed as the place's form keys them: each group, then No group where the duty kind's\n * group takes none (#1548), in the vocabulary's word.\n */\nfunction groupOptions(value: RosterValue): { key: string; label: string }[] {\n    const groups = value.groups.map(g => ({ key: printGroup(some(g.key)), label: g.label }));\n    return value.duty.roles.noGroup ? [...groups, { key: printGroup(none), label: value.vocabulary.noGroup }] : groups;\n}\n/**\n * Shared typed destination form for desktop inspector and narrow actions: the day, the group — or No group, where the\n * duty kind's group takes none (#1548) — and the shift.\n */\nexport function PlaceFields({ value, start, place, onChange }: { value: RosterValue; start: Date; place: Place; onChange: (next: Place) => void }) {\n    const format = useFormatters();\n    const options = { days: Array.from({ length: 7 }, (_, day) => ({ key: printDay(BigInt(day)), label: format.weekdayDate(new Date(start.getTime() + day * DAY)) })),\n        groups: groupOptions(value), shifts: value.shifts.map(s => ({ key: s.key, label: s.label })) };\n    return <FieldForm specs={PLACE_FIELDS} value={{ day: printDay(place.day), group: printGroup(place.group), shift: place.shift }} options={options} onChange={(path, next) => {\n        const key = path[0];\n        if (key === \"day\" && typeof next === \"string\") {\n            const parsed = parseDay(next);\n            if (parsed.success && parsed.value >= 0n && parsed.value <= 6n) onChange({ day: parsed.value, group: place.group, shift: place.shift });\n        } else if (key === \"group\" && typeof next === \"string\") {\n            const parsed = parseGroup(next);\n            if (parsed.success) onChange({ day: place.day, group: parsed.value, shift: place.shift });\n        } else if (key === \"shift\" && typeof next === \"string\") onChange({ day: place.day, group: place.group, shift: next });\n    }} />;\n}\n/**\n * A duty's group in the inspector, where the duty kind's group takes none (#1548): the groups and No group, a choice\n * moving the duty there on its day and shift. `baseline` is the group as stored, marking a draft's change.\n */\nexport function GroupField({ value, group, baseline, onChange, readOnly = false }: {\n    value: RosterValue; group: option<string>; baseline?: option<string> | undefined; onChange: (next: option<string>) => void; readOnly?: boolean;\n}) {\n    return <FieldForm specs={GROUP_FIELDS} value={{ group: printGroup(group) }} baseline={baseline === undefined ? undefined : { group: printGroup(baseline) }} readOnly={readOnly}\n        options={{ groups: groupOptions(value) }} onChange={(_path, next) => {\n            if (typeof next !== \"string\") return;\n            const parsed = parseGroup(next);\n            if (parsed.success) onChange(parsed.value);\n        }} />;\n}\n/** What a place action places, and where; `onClose` is told as its popover closes, for a host that mounts it in place (#1406, D9: `Elsewhere…`). */\ninterface PlaceActionProps { label: string; source?: RosterSource; place: Place; value: RosterValue; start: Date; commands: RosterCommands; styles: RosterStyles; onClose?: (() => void) | undefined }\n/**\n * One anchored place action; absent source offers a staff picker. Until it is first pressed it is its trigger alone\n * (#1398, CL9): every day off in the People grid holds one, and a popover mounted for each made each row coming into\n * view slow to draw. Pressed, its popover mounts and opens. While a run of the optimiser holds the week (#1409, R2) the\n * trigger stays in place, inert and saying why; a popover the run finds open closes, and stays closed as the run ends.\n */\nexport function PlaceAction(props: PlaceActionProps) {\n    const [armed, setArmed] = useState(false);\n    const { locked } = props.commands;\n    // Its day's, which a published day takes away (#1550).\n    const available = props.commands.availableOn(props.place.day);\n    useEffect(() => { if (locked !== undefined) setArmed(false); }, [locked]);\n    if (!available && locked === undefined) return null;\n    if (!armed || locked !== undefined) {\n        return <Button size=\"xs\" variant=\"outline\" data-roster-action={props.label.toLowerCase()} disabled={locked !== undefined} title={locked} onClick={() => setArmed(true)}>{props.label}</Button>;\n    }\n    return <PlacePopover {...props} />;\n}\n/**\n * A place action's popover, mounted by its first press: it opens as it mounts, as a press of its own trigger opens it.\n * The off day's `Elsewhere…` mounts it in place (#1406, D9), and is told as it closes.\n */\nexport function PlacePopover({ label, source, place: initial, value, start, commands, styles, onClose }: PlaceActionProps) {\n    const [open, setOpen] = useState(false);\n    const [place, setPlace] = useState(initial);\n    const [person, setPerson] = useState<ValueTypeOf<typeof PersonForm>>({ person: none });\n    const [error, setError] = useState<string>();\n    // Opened once its trigger is in place, so the popover hangs from it and takes the focus as any opening does.\n    useLayoutEffect(() => { setOpen(true); }, []);\n    if (!commands.availableOn(initial.day)) return null;\n    return <SliceEditPopover open={open} onOpenChange={next => { setOpen(next); if (next) { setPlace(initial); setError(undefined); } else onClose?.(); }} label={label}\n        trigger={<Button size=\"xs\" variant=\"outline\" data-roster-action={label.toLowerCase()}>{label}</Button>}\n        footActions={<><Button size=\"xs\" variant=\"outline\" onClick={() => setOpen(false)}>Cancel</Button><Button size=\"xs\" variant=\"outline\" disabled={source === undefined && person.person.type === \"none\"} onClick={() => {\n            const from = source ?? (person.person.type === \"some\" ? { type: \"person\" as const, key: person.person.value } : undefined);\n            if (from === undefined) return;\n            const refusal = commands.place(from, place); setError(refusal); if (refusal === undefined) setOpen(false);\n        }}>{label}</Button></>}>\n        {source === undefined && <FieldForm specs={PERSON_FIELDS} value={person} options={{ people: value.people.filter(p => value.visiblePeople.type === \"none\" || value.visiblePeople.value.has(p.key)).map(p => ({ key: p.key, label: p.name })) }} onChange={(_path, next) => setPerson({ person: next as typeof person.person })} />}\n        <PlaceFields value={value} start={start} place={place} onChange={setPlace} />\n        {error !== undefined && <Box role=\"alert\" css={styles.error}>{error}</Box>}\n    </SliceEditPopover>;\n}\n/**\n * A phone's `Apply pattern…` (#1406, P22): a Chooser over the app's week patterns — each its name and `5 shifts · 40 h`,\n * one that cannot be applied refused with its reason — whose choice applies the pattern to the person's week as one\n * step, as a drop does on a wide main.\n */\nexport function ApplyPatternAction({ person, start, value, commands, onError }: {\n    person: Person; start: Date; value: RosterValue; commands: RosterCommands; onError: (error: string | undefined) => void;\n}) {\n    const [open, setOpen] = useState(false);\n    const format = useFormatters();\n    const sections = useMemo((): ChooserSection[] => [{ label: \"Patterns\", options: value.patterns.map(pattern => {\n        const problem = patternProblem(value, pattern), summary = patternSummary(value, pattern);\n        return { key: pattern.key, label: pattern.label, line: problem ?? `${format.number(summary.shifts)} shifts · ${format.number(summary.hours)} h`,\n            state: problem === undefined ? \"enabled\" as const : \"refused\" as const };\n    }) }], [value, format]);\n    // While a run of the optimiser holds the week (#1409, R2) the action stays in place, inert.\n    const locked = commands.locked !== undefined;\n    if ((!commands.available && !locked) || value.patterns.length === 0) return null;\n    return <SliceEditPopover open={open} onOpenChange={setOpen} label={`Apply pattern · ${person.name}`}\n        trigger={<Button size=\"xs\" variant=\"outline\" data-roster-action=\"apply pattern…\" disabled={locked} title={commands.locked}>Apply pattern…</Button>}\n        footActions={<Button size=\"xs\" variant=\"outline\" onClick={() => setOpen(false)}>Cancel</Button>}>\n        <Chooser sections={sections} placeholder=\"Find a pattern\" onChoose={key => { onError(commands.applyPattern(person.key, start, key)); setOpen(false); }} />\n    </SliceEditPopover>;\n}\n/** What a duty's form starts from: its position, its activity and its times, as the draft holds them. */\nexport interface DutyFormValue { position: option<string>; activity: option<string>; start: Date; end: Date }\n/** A duty's form, from the duty as the week holds it. */\nexport function dutyForm(a: Assignment): DutyFormValue { return { position: a.position === \"\" ? none : some(a.position), activity: a.activity, start: a.start, end: a.end }; }\n\n/**\n * The Roster's own form over a duty's roles: the position held — where the\n * kind maps one — and, for a named person, the activity; each choice one edit,\n * and one the duty refuses (`onChange` saying why) put back, the reason under\n * its field.\n */\nexport function AssignmentFields({ assignment, form, baseline, value, onChange, readOnly = false }: {\n    assignment: Assignment; form: DutyFormValue; baseline?: DutyFormValue | undefined; value: RosterValue; onChange: (change: RolesChange) => string | void; readOnly?: boolean;\n}) {\n    // The group's skills and the duties the slice shows, and the duty's own — as stored and as the edit has it — so a\n    // stored activity the rail hides can be picked again after choosing another (#1342).\n    const own = [form.activity, baseline?.activity].flatMap(activity => activity?.type === \"some\" ? [activity.value] : []);\n    const activities = activityChoices(value, groupOf(assignment), own);\n    const specs = DUTY_FIELDS.filter(field => field.path[0] === \"position\" ? value.duty.roles.position : value.duty.roles.activity && assignment.who.type === \"person\");\n    if (specs.length === 0) return null;\n    const shown = { position: form.position.type === \"some\" ? form.position.value : \"\", activity: form.activity };\n    const held = baseline === undefined ? undefined : { position: baseline.position.type === \"some\" ? baseline.position.value : \"\", activity: baseline.activity };\n    return <FieldForm specs={specs} value={shown} baseline={held} readOnly={readOnly}\n        options={{ positions: value.positions.map(p => ({ key: p.key, label: p.label })), activities: activities.map(a => ({ key: a.key, label: a.label })) }}\n        onChange={(path, next) => onChange(path[0] === \"position\" ? { position: some(next as string) } : { activity: next as option<string> })} />;\n}\n/**\n * A duty's own times: each one an edit, held to its day — its start from twelve hours before its shift's to less than\n * twelve after — its end after its start; a time the duty refuses (`onChange` saying why) put back, the reason under\n * its field.\n */\nexport function TimesFields({ form, baseline, onChange, readOnly = false }: {\n    form: DutyFormValue; baseline?: DutyFormValue | undefined; onChange: (change: RolesChange) => string | void; readOnly?: boolean;\n}) {\n    return <FieldForm specs={TIME_FIELDS} value={{ start: form.start, end: form.end }} baseline={baseline === undefined ? undefined : { start: baseline.start, end: baseline.end }}\n        readOnly={readOnly} onChange={(path, next) => onChange(path[0] === \"start\" ? { start: next as Date } : { end: next as Date })} />;\n}\n/** Every mobile duty exposes its operations without opening the inspector. */\nexport function AssignmentActions({ id, assignment, value, start, commands, styles, removed = false }: {\n    id: string; assignment: Assignment; value: RosterValue; start: Date; commands: RosterCommands; styles: RosterStyles; removed?: boolean;\n}) {\n    const [open, setOpen] = useState(false);\n    const [form, setForm] = useState<DutyFormValue>(() => dutyForm(assignment));\n    const [error, setError] = useState<string>();\n    // While a run of the optimiser holds the week (#1409, R2) the actions stay in place, inert.\n    const locked = commands.locked !== undefined;\n    if (!commands.availableOn(assignment.place.day) && !locked) return null;\n    if (removed) return <Button size=\"xs\" variant=\"outline\" disabled={locked} title={commands.locked} onClick={() => commands.restore(id)}>Restore</Button>;\n    const change = (next: RolesChange) => setForm(before => ({ ...before, ...next }));\n    return <><Box css={styles.actions} data-roster-assignment-actions=\"\">\n        <SliceEditPopover open={open} onOpenChange={next => { setOpen(next); if (next) { setForm(dutyForm(assignment)); setError(undefined); } }} label=\"Edit duty\"\n            trigger={<Button size=\"xs\" variant=\"outline\" disabled={locked} title={commands.locked}>Edit</Button>}\n            footActions={<><Button size=\"xs\" variant=\"outline\" onClick={() => setOpen(false)}>Cancel</Button><Button size=\"xs\" variant=\"outline\" onClick={() => {\n                const refused = commands.update(id, { start: form.start, end: form.end, ...(value.duty.roles.position ? { position: form.position } : {}),\n                    ...(value.duty.roles.activity ? { activity: form.activity } : {}) });\n                setError(refused); if (refused === undefined) setOpen(false);\n            }}>Update</Button></>}>\n            <AssignmentFields assignment={assignment} form={form} baseline={dutyForm(assignment)} value={value} onChange={change} />\n            <TimesFields form={form} baseline={dutyForm(assignment)} onChange={change} />\n            {error !== undefined && <Box role=\"alert\" css={styles.error}>{error}</Box>}\n        </SliceEditPopover>\n        <PlaceAction label=\"Move\" source={{ type: \"assignment\", key: id }} place={assignment.place} value={value} start={start} commands={commands} styles={styles} />\n        <Button size=\"xs\" variant=\"outline\" disabled={locked} title={commands.locked} onClick={() => commands.remove(id)}>Remove</Button>\n    </Box>{error !== undefined && !open && <Box role=\"alert\" css={styles.error}>{error}</Box>}</>;\n}\n/** Targets use FieldForm for the headcount, every activity line, and adding a line: a target the week refuses put back, the reason under its field. */\nexport function RequirementFields({ slot, week, held, value, commands, styles }: { slot: Slot; week: Week; held: Week; value: RosterValue; commands: RosterCommands; styles: RosterStyles }) {\n    const target = requirementOf(week, slot);\n    const baseline = held.requirements.get(slot);\n    // Every target line shows; a new one is one of the activities the slice shows (#1342).\n    const activities = [...groupSkills(value, slot.group), ...duties(value)];\n    const choices = activityChoices(value, slot.group).filter(a => !target.hours.has(a.key));\n    const [line, setLine] = useState<ValueTypeOf<typeof AddLine>>({ activity: none, hours: 8 });\n    const editable = commands.availableOn(slot.day) && value.targets.type === \"some\";\n    const changeHours = (key: string, hours: number) => {\n        const next = { ...target, hours: new SortedMap(target.hours, compareString) }; next.hours.set(key, hours); return commands.requirement(slot, next);\n    };\n    return <>\n        <FieldForm specs={TARGET_FIELDS} value={target} baseline={baseline} readOnly={!editable} onChange={(_path, next) => commands.requirement(slot, { ...target, positions: next as bigint })} />\n        {activities.filter(a => target.hours.has(a.key)).map(a => <Box key={a.key} css={styles.paneFoot}>\n            <Box css={styles.title}>{a.label}</Box>\n            <FieldForm specs={HOUR_FIELDS} value={{ hours: target.hours.get(a.key) }} baseline={baseline === undefined ? undefined : { hours: baseline.hours.get(a.key) }} readOnly={!editable}\n                onChange={(_path, next) => changeHours(a.key, next as number)} />\n            {editable && <Button size=\"xs\" variant=\"ghost\" onClick={() => changeHours(a.key, 0)}>Remove {a.code}</Button>}\n        </Box>)}\n        {editable && choices.length > 0 && <Box css={styles.paneFoot}>\n            <Box css={styles.eyebrow}>Add a target</Box>\n            <FieldForm specs={ADD_FIELDS} value={line} options={{ activities: choices.map(a => ({ key: a.key, label: a.label })) }}\n                onChange={(path, next) => setLine(previous => ({ ...previous, [path[0]!]: next }))} />\n            <Button size=\"xs\" variant=\"outline\" disabled={line.activity.type === \"none\" || line.hours <= 0} onClick={() => { if (line.activity.type === \"some\") { changeHours(line.activity.value, line.hours); setLine({ activity: none, hours: 8 }); } }}>Add target</Button>\n        </Box>}\n    </>;\n}\n/** Target editing stays reachable from a narrow card when the inspector is collapsed. */\nexport function RequirementAction(props: Parameters<typeof RequirementFields>[0]) {\n    const [open, setOpen] = useState(false);\n    const locked = props.commands.locked !== undefined;\n    if ((!props.commands.availableOn(props.slot.day) && !locked) || props.value.targets.type !== \"some\") return null;\n    return <SliceEditPopover open={open} onOpenChange={setOpen} label=\"Shift targets\" trigger={<Button size=\"xs\" variant=\"outline\" disabled={locked} title={props.commands.locked}>Edit targets</Button>}\n        footActions={<Button size=\"xs\" variant=\"outline\" onClick={() => setOpen(false)}>Done</Button>}><RequirementFields {...props} /></SliceEditPopover>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Roster facts on the shared Library. Each tab follows its source of the rail\n * (#1342): People the slice's `people`, Activities its `activities`, an app's\n * tab the source it names; each counts what it shows (`People 12 of 69`), says\n * so when its source leaves it none, with Clear filters for that source, and\n * has no filter of its own — its search and its groups only. A Find fix's\n * result is the app's fit's answer (#1334): the People tab shows the people it\n * says fit among what the rail shows, best first in its order, each card with\n * its reason, under a chip that clears it — the Roster decides no one itself.\n * The People tab's agency requests are actions, not people: they always show,\n * and what the tab says of its people shows above them. The Patterns tab\n * (#1406, P20) lists the app's week patterns under the name and icon\n * `Roster.patterns` gives, each card its name, `5 shifts · 40 h` and a strip of\n * seven marks in the shifts' colours; a card drags onto a person's week; one\n * that cannot be applied is greyed with its reason (P23); the tab follows the\n * slice's `patterns` source where there is one.\n */\nimport { useMemo, useState, type CSSProperties } from \"react\";\nimport { Box, Button } from \"@chakra-ui/react\";\nimport { FloatType, compareFor, none, some, variant } from \"@elaraai/east\";\nimport { EastChakraLibrary, useFormatters, type BuilderFrameDock, type LibraryCardExtras, type LibraryItemValue, type LibraryNarrowing } from \"@elaraai/east-ui-components\";\nimport { SliceFieldChip, narrowedCount } from \"@elaraai/east-ui-components/internal\";\nimport { scheduleLibrary, scheduleLibraryCard } from \"../shared/schedule/library.js\";\nimport { sourceTab, type SourceShown } from \"../shared/schedule/source-tab.js\";\nimport { readRosterSource, rosterSourceKey } from \"./identity.js\";\nimport { PlaceAction } from \"./controls.js\";\nimport type { RosterCommands, RosterSource } from \"./actions.js\";\nimport type { FitResult, Need } from \"./fit.js\";\nimport {\n    DAY, activityOf, patternProblem, patternSummary, placeOf, shiftColor, shiftOf, type Assignment, type Coverage, type Pattern, type Person, type Place, type RosterStyles,\n    type RosterValue, type Selection, type Slot, type Week,\n} from \"./model.js\";\n\n/**\n * A pattern's seven marks (#1406, §8): each day's shift in its colour token, its code on it; a day off faint.\n *\n * @param props - The payload's shifts, the pattern and the Roster's styles\n * @returns The strip\n */\nexport function PatternStrip({ value, pattern, styles }: { value: Pick<RosterValue, \"shifts\">; pattern: Pattern; styles: RosterStyles }) {\n    return <Box css={styles.patternStrip} data-roster-pattern-strip={pattern.key} aria-hidden=\"true\">\n        {Array.from({ length: 7 }, (_, i) => {\n            const day = pattern.days[i];\n            const shift = day?.type === \"some\" ? shiftOf(value, day.value) : undefined;\n            const color = shiftColor(shift);\n            return <Box key={i} as=\"span\" css={styles.patternMark} data-off={day === undefined || day.type === \"none\" ? \"\" : undefined} data-shift={day?.type === \"some\" ? day.value : undefined}\n                style={color === undefined ? undefined : { \"--roster-fill\": color.fill, \"--roster-ink\": color.ink } as CSSProperties}>{shift?.code ?? \"\"}</Box>;\n        })}\n    </Box>;\n}\n\nexport function rosterLibraryId(key: string, tab: string): string { return `${key}.library.${tab}`; }\n/** A Find fix's result in the People tab (#1334): what it looks for, the fit's answer, and whether that answer is still to land. */\nexport interface PeopleFind {\n    /** What the find looks for: the chip's words. */\n    need: Need;\n    /** The fit's answer for the drafts as they are, which the tab shows; `undefined` while it is on its way, or failed. */\n    shown: FitResult | undefined;\n    /** Whether the find is asked and its answer for the drafts as they are has not landed: the tab is busy, showing what the rail shows. */\n    busy: boolean;\n}\ninterface LibraryArgs {\n    value: RosterValue; week: Week; start: Date; day: number; storageKey: string; narrow: boolean; styles: RosterStyles;\n    commands: RosterCommands; selection: Selection | undefined; select: (next: Selection | undefined) => void;\n    hours: ReadonlyMap<string, number>; coverage: ReadonlyMap<Slot, Coverage>;\n    /** A Find fix's result, shown in the People tab until its chip clears it. */\n    find: PeopleFind | undefined; onClearFind: () => void;\n    tab: string | undefined; onTab: (tab: string) => void;\n    /** What the rail shows of each source a tab follows, and how that source alone clears. */\n    shown: { people: SourceShown; activities: SourceShown; patterns: SourceShown };\n}\n/** A tab that names no source lists its rows whole. */\nconst WHOLE: SourceShown = { keys: none, busy: false, ready: true, clear: undefined };\nconst NO_ASSIGNMENTS: readonly Assignment[] = [];\n/** Test-only probe: told each time the People tab's cards are made (#1398, CL9). `undefined` outside tests. */\nlet peopleCardsProbe: (() => void) | undefined;\n/**\n * Install (or clear) the People cards probe. Test use only.\n *\n * @param fn - Told each time the cards are made; `undefined` clears it\n */\nexport function setRosterPeopleCardsProbe(fn: (() => void) | undefined): void { peopleCardsProbe = fn; }\n/** A Library card of the Roster's: its words, its group and its icon, dragged where the Roster takes drags. */\nfunction libraryCard(key: string, label: string, meta: string, group: string, icon: string | undefined, draggable: boolean): LibraryItemValue {\n    return scheduleLibraryCard({\n        key, label, sublabel: some(meta), groups: new Map([[\"group\", group]]), icon: icon === undefined ? none : some(icon),\n        status: none, trailing: none, draggable, filtered: false, placed: false, search: some(`${label} ${meta} ${group}`),\n    });\n}\n/** The People tab's groups, in their order, by the kind each is. */\nconst GROUP_RANK = { available: 0, leads: 1, others: 2, agency: 3 } as const;\n/** What the People tab says while a Find finds no one; its chip clears it. */\nconst NO_ONE_FOUND = { title: \"No one found\", description: \"Clear the find to see the people the rail shows.\" };\nconst byScore = compareFor(FloatType);\n\n/** The people the fit's answer says fit, best first — its scores, ties kept in the tab's order: the fit ranks, never the Roster. */\nfunction fitsOf<E extends { person: Person }>(entries: readonly E[], answer: FitResult): E[] {\n    const scored = entries.flatMap(entry => {\n        const verdict = answer.people.get(entry.person.key);\n        return verdict?.type === \"fits\" ? [{ entry, score: verdict.value.score }] : [];\n    });\n    return scored.sort((a, b) => byScore(b.score, a.score)).map(fit => fit.entry);\n}\n\n/** A found card's line: the fit's reason, and its warning in the warning's tone; its tooltip the whole, which a narrow card cuts. */\nfunction reasonOf(answer: FitResult, item: LibraryItemValue): LibraryCardExtras | undefined {\n    const source = readRosterSource(item.key);\n    const verdict = source.success && source.value.type === \"person\" ? answer.people.get(source.value.value) : undefined;\n    if (verdict?.type !== \"fits\") return undefined;\n    const { why, warn } = verdict.value;\n    const text = warn.type === \"some\" ? `${why} · ${warn.value}` : why;\n    return { note: warn.type === \"some\" ? { text, tone: \"warning\" } : { text }, title: text };\n}\n\n/** Optional library pane; every dataset stays the author's original bound data. */\nexport function useRosterLibrary(args: LibraryArgs): BuilderFrameDock | undefined {\n    const { value, week, start, day, storageKey, narrow, styles, commands, selection, select, hours, coverage, find, shown } = args;\n    const format = useFormatters();\n    const [chosen, setChosen] = useState<Record<string, string>>({});\n    const [error, setError] = useState<string>();\n    // Each found card's reason, the same function while the answer stands: the Library's memo compares it.\n    const answer = find?.shown;\n    const reasons = useMemo(() => answer === undefined ? undefined : (item: LibraryItemValue) => reasonOf(answer, item), [answer]);\n    // A card drags while a week in view takes a gesture: the week, or any of the month's (#1406, P32).\n    const draggable = !narrow && commands.editable;\n    // The patterns, each with why it cannot be applied and what it works (#1406): the Patterns tab's cards, and each card's strip.\n    const patternEntries = useMemo(() => value.patterns.map(pattern => ({ pattern, problem: patternProblem(value, pattern), summary: patternSummary(value, pattern) })), [value]);\n    const patternExtras = useMemo(() => (item: LibraryItemValue): LibraryCardExtras | undefined => {\n        const entry = patternEntries.find(e => e.pattern.key === item.key);\n        if (entry === undefined) return undefined;\n        return { strip: <PatternStrip value={value} pattern={entry.pattern} styles={styles} />, title: entry.problem ?? `${entry.pattern.label} · drag onto a person's week`,\n            note: entry.problem === undefined ? undefined : { text: entry.problem, tone: \"warning\" } };\n    }, [patternEntries, value, styles]);\n    const words = value.vocabulary;\n    // Each person's duties on the day, the week's duties read once (#1398, CL9).\n    const today = useMemo(() => {\n        const by = new Map<string, Assignment[]>();\n        for (const a of week.assignments.values()) {\n            if (a.place.day !== BigInt(day) || a.who.type !== \"person\") continue;\n            const theirs = by.get(a.who.value);\n            if (theirs === undefined) by.set(a.who.value, [a]);\n            else theirs.push(a);\n        }\n        return by;\n    }, [week, day]);\n    // The People tab's cards, made again only as what they show changes — never at every render of the Roster (CL9).\n    const chosenPerson = chosen[\"people\"];\n    const peopleEntries = useMemo(() => { peopleCardsProbe?.(); return value.people.map(person => {\n        const assigned = today.get(person.key) ?? NO_ASSIGNMENTS;\n        const group = value.groups.find(g => g.key === person.group);\n        const position = value.positions.find(p => p.key === (assigned[0]?.position ?? person.position));\n        const skills = value.activities.filter(a => a.group.type === \"some\" && person.skills.has(a.key));\n        // The person's group that day: its words the app's, its place in the tab its kind's, whatever those words.\n        const kind: keyof typeof GROUP_RANK = assigned.length === 0 ? \"available\" : position?.lead ? \"leads\" : person.agency ? \"agency\" : \"others\";\n        const place = kind === \"available\" ? words.available(format.weekday(new Date(start.getTime() + day * DAY))) : words[kind];\n        const shift = assigned.map(a => value.shifts.find(s => s.key === a.place.shift)?.label ?? a.place.shift).join(\", \");\n        const card = libraryCard(rosterSourceKey(\"person\", person.key), person.name, `${group?.label ?? person.group} · ${shift || \"Off today\"}${position?.code ? ` · ${position.code}` : \"\"}${person.trainer ? \" · trainer\" : \"\"}${person.trainee ? \" · trainee\" : \"\"}`, place, undefined, draggable);\n        return { person, kind, card: { ...card, avatar: some(person.name), placed: chosenPerson === rosterSourceKey(\"person\", person.key),\n            status: some({ label: assigned.length === 0 ? \"OFF\" : assigned.map(a => value.shifts.find(s => s.key === a.place.shift)?.code ?? a.place.shift).join(\" · \"), tone: variant(assigned.length === 0 ? \"info\" : \"neutral\", null), ring: false }),\n            search: some(`${person.name} ${group?.label} ${position?.label} ${person.agency ? words.agency : \"\"} ${person.trainer ? \"trainer\" : \"\"} ${skills.map(s => s.label).join(\" \")}`),\n            dims: new Map([[\"hours\", variant(\"meter\", { value: hours.get(person.key) ?? 0, max: person.contract, text: some(`${format.number(hours.get(person.key) ?? 0)} / ${format.number(person.contract)} h`) })]]),\n        } };\n    }); }, [value.people, value.groups, value.positions, value.activities, value.shifts, words, today, format, start, day, draggable, chosenPerson, hours]);\n    if (value.library.length === 0) return undefined;\n    // Where the foot's action places by default: the selected slot, the selected duty's place — in no group, for a duty in\n    // none (#1548) — or a shift's day across the groups' day and shift (#1568), else the day's first shift, in the first group.\n    const selected: Place | undefined = selection?.type === \"slot\" || selection?.type === \"requirement\" ? placeOf(selection.slot)\n        : selection?.type === \"assignment\" ? week.assignments.get(selection.key)?.place\n            : selection?.type === \"shiftDay\" ? { day: BigInt(selection.day), group: some(value.groups[0]!.key), shift: selection.shift } : undefined;\n    const defaultPlace: Place = selected ?? { day: BigInt(day), group: some(value.groups[0]!.key), shift: value.shifts[0]!.key };\n    const make = (key: string, label: string, meta: string, group: string, icon: string | undefined): LibraryItemValue => libraryCard(key, label, meta, group, icon, draggable);\n    // What a Find fix looks for: a skill's holders, leads, or trainers.\n    const need = find?.need;\n    const findWhat = need === undefined ? undefined : need.type === \"skill\" ? activityOf(value, need.value)?.label ?? need.value\n        : need.type === \"leads\" ? words.leads : words.trainers;\n    // The people the rail shows, off that day: the collapsed rail's badge.\n    const shownPeople = shown.people.keys;\n    const off = value.people.filter(p => (shownPeople.type === \"none\" || shownPeople.value.has(p.key)) && !today.has(p.key)).length;\n    const tabs = value.library.map(tab => {\n        const name = tab.type === \"tab\" ? `tab:${tab.value.name}` : tab.type;\n        const label = tab.type === \"tab\" || tab.type === \"patterns\" ? tab.value.name : tab.type === \"people\" ? \"People\" : \"Activities\";\n        let cards: LibraryItemValue[];\n        let follows: ReturnType<typeof sourceTab<unknown>>;\n        let count: string | number;\n        let narrowing: LibraryNarrowing | undefined;\n        let pane: ReturnType<typeof sourceTab<unknown>>[\"pane\"];\n        if (tab.type === \"people\") {\n            const entries = peopleEntries;\n            follows = sourceTab({ cards: entries, keyOf: entry => entry.person.key, shown: shown.people, noun: \"people\", words: format });\n            // A Find fix's result: the people the fit's answer says fit, among what the rail shows, best first. Until its answer\n            // for the drafts as they are lands, the tab shows what the rail shows, busy, and no verdict (F2).\n            const found = answer === undefined ? follows.cards as typeof entries : fitsOf(follows.cards as typeof entries, answer);\n            count = answer === undefined ? follows.count : narrowedCount(format, found.length, entries.length, true);\n            // With no person to show, the tab says why above the agency requests, which stay: the rail's narrowing, with its\n            // Clear filters, when it hid everyone; else a Find that found no one, which its chip clears.\n            narrowing = answer === undefined || follows.narrowing?.emptied === true ? follows.narrowing : { empty: NO_ONE_FOUND, emptied: found.length === 0 };\n            pane = find?.busy === true ? { ...follows.pane, \"aria-busy\": true } : follows.pane;\n            // Agency requests are actions, not staff: every one shows, whatever the rail narrows.\n            const requests = value.agencies.map(agency => ({ ...make(rosterSourceKey(\"agency\", agency.key), agency.name, `Request · ${format.number(value.shifts.find(s => s.key === defaultPlace.shift)?.hours ?? 0)} h`, words.agency, \"building\"),\n                status: some({ label: \"REQ\", tone: variant(\"neutral\", null), ring: false }) }));\n            if (answer !== undefined) {\n                // Best first, in the fit's order: each group heads where its best card stands, and the requests come last.\n                cards = [...found.map(entry => entry.card), ...requests];\n            } else {\n                // The groups by their kind, never their words: those not rostered, leads, others, then agency and its requests.\n                const ranked = [...requests.map(card => ({ card, rank: GROUP_RANK.agency })), ...found.map(entry => ({ card: entry.card, rank: GROUP_RANK[entry.kind] }))];\n                cards = ranked.sort((a, b) => a.rank - b.rank).map(entry => entry.card);\n            }\n        } else if (tab.type === \"activities\") {\n            // Each group's skills in the groups' order, then the duties, each in the record's order.\n            const rank = (group: string | undefined) => { const at = value.groups.findIndex(g => g.key === group); return at < 0 ? value.groups.length : at; };\n            const activities = [...value.activities].sort((a, b) => rank(a.group.type === \"some\" ? a.group.value : undefined) - rank(b.group.type === \"some\" ? b.group.value : undefined));\n            follows = sourceTab({ cards: activities, keyOf: activity => activity.key, shown: shown.activities, noun: \"activities\", words: format });\n            count = follows.count;\n            narrowing = follows.narrowing;\n            pane = follows.pane;\n            cards = (follows.cards as typeof activities).map(skill => {\n                const group = skill.group.type === \"some\" ? value.groups.find(g => skill.group.type === \"some\" && g.key === skill.group.value)?.label ?? skill.group.value : \"Any group\";\n                const lines = [...coverage].filter(([slot]) => slot.day === BigInt(day)).flatMap(([, c]) => c.lines.filter(line => line.skill === skill.key));\n                const assigned = lines.reduce((n, line) => n + line.assigned, 0), needed = lines.reduce((n, line) => n + line.needed, 0);\n                return { ...make(skill.key, skill.label, `${skill.code} · ${format.number(assigned)} / ${format.number(needed)} h assigned`, group, \"list-check\"), placed: chosen[name] === skill.key,\n                    dims: new Map([[\"hours\", variant(\"meter\", { value: assigned, max: needed, text: none })]]) };\n            });\n        } else if (tab.type === \"patterns\") {\n            // The app's week patterns (#1406, P20), in their order, under the slice's `patterns` source where there is one; a\n            // pattern that cannot be applied listed greyed with its reason, dragged by no one (P23).\n            const entries = patternEntries;\n            follows = sourceTab({ cards: entries, keyOf: entry => entry.pattern.key, shown: shown.patterns, noun: tab.value.name.toLocaleLowerCase(format.locale), words: format });\n            count = follows.count;\n            narrowing = follows.narrowing;\n            pane = follows.pane;\n            cards = (follows.cards as typeof entries).map(({ pattern, problem, summary }) => ({\n                ...make(pattern.key, pattern.label, `${format.number(summary.shifts)} shifts · ${format.number(summary.hours)} h`, \"\", tab.value.icon),\n                draggable: draggable && problem === undefined, filtered: problem !== undefined, placed: chosen[name] === pattern.key,\n                search: some(`${pattern.label} ${format.number(summary.shifts)} shifts ${format.number(summary.hours)} h`),\n            }));\n        } else {\n            const source = tab.value.source;\n            const followed = source.type === \"none\" ? WHOLE : source.value === \"people\" ? shown.people : source.value === \"activities\" ? shown.activities : source.value === \"patterns\" ? shown.patterns : WHOLE;\n            follows = sourceTab({ cards: tab.value.cards, keyOf: card => card.key, shown: followed, noun: tab.value.name.toLowerCase(), words: format });\n            count = follows.count;\n            narrowing = follows.narrowing;\n            pane = follows.pane;\n            // A card drags where it sets a field of the duty it lands on.\n            const lands = tab.value.drop.type === \"some\";\n            cards = (follows.cards as typeof tab.value.cards).map(card => ({ ...make(card.key, card.label, card.meta.type === \"some\" ? card.meta.value : \"\", card.group.type === \"some\" ? card.group.value : \"\", tab.value.icon.type === \"some\" ? tab.value.icon.value : undefined), draggable: draggable && lands && card.sets.length > 0, placed: chosen[name] === card.key }));\n        }\n        const choose = (key: string): null => {\n            setChosen(before => ({ ...before, [name]: key })); setError(undefined);\n            if (tab.type === \"people\") {\n                const source = readRosterSource(key);\n                if (source.success && source.value.type === \"person\") {\n                    const person = source.value.value;\n                    const assignment = [...week.assignments].find(([, a]) => a.place.day === BigInt(day) && a.who.type === \"person\" && a.who.value === person);\n                    select(assignment === undefined ? { type: \"person\", key: person } : { type: \"assignment\", key: assignment[0] });\n                }\n            }\n            return null;\n        };\n        const noun = tab.type === \"people\" ? { singular: \"person\", plural: \"people\" } : tab.type === \"patterns\" ? { singular: \"pattern\", plural: \"patterns\" } : { singular: \"activity\", plural: \"activities\" };\n        const baseLibrary = scheduleLibrary({ id: rosterLibraryId(storageKey, name), items: cards, groupOptions: tab.type === \"patterns\" ? [] : [{ key: \"group\", label: \"Group\" }], noun: some(noun), onCardClick: some(choose) }, true);\n        const library = { ...baseLibrary, ...(tab.type === \"tab\" || tab.type === \"patterns\" ? {} : { dimOptions: [{ key: \"hours\", label: \"Hours\" }], defaultDimensions: [\"hours\"] }) };\n        const chosenKey = chosen[name];\n        const parsed = tab.type === \"people\" && chosenKey !== undefined ? readRosterSource(chosenKey) : undefined;\n        const source: RosterSource | undefined = parsed?.success ? { type: parsed.value.type, key: parsed.value.value } : undefined;\n        // The selected duty a card acts on: none on a day that takes no edits, a published one (#1550).\n        const targetDay = selection?.type === \"assignment\" ? week.assignments.get(selection.key)?.place.day : undefined;\n        const target = selection?.type === \"assignment\" && targetDay !== undefined && commands.availableOn(targetDay) ? selection.key : undefined;\n        const custom = tab.type === \"tab\" && tab.value.drop.type === \"some\" ? tab.value.cards.find(card => card.key === chosenKey) : undefined;\n        const finding = tab.type === \"people\" && findWhat !== undefined;\n        // A pane its source reads again holds its cards retained (#1398, CL8): what they place waits until it lands.\n        const held = pane[\"aria-disabled\"] === true;\n        // A chosen pattern applies to the selected person's week — the selected person-week's, else the week in view (#1406).\n        const patternTarget = tab.type === \"patterns\" && chosenKey !== undefined && (selection?.type === \"personWeek\" || selection?.type === \"person\")\n            ? { person: value.people.find(p => p.key === selection.key), start: selection.type === \"personWeek\" ? new Date(selection.start) : start } : undefined;\n        const hint = tab.type === \"patterns\" ? (narrow ? \"Select a pattern, then Apply pattern… on a person's card\" : \"Drag one onto a person's week. It replaces all seven days.\")\n            : narrow ? tab.type === \"people\" ? \"Select a person to assign\" : \"Select a card, then an assignment\"\n                : tab.type === \"people\" ? `Drag onto a shift · ${format.weekdayDate(new Date(start.getTime() + day * DAY))}` : \"Drag onto a person · one per shift\";\n        return { key: name, label, count, body: <Box css={styles.pane} data-roster-library={name} {...pane}>\n            {finding && <Box css={styles.paneFoot} data-roster-find=\"\">\n                {/* Pressed, the chip clears the find: its name says so, its face what the find looks for. */}\n                <SliceFieldChip label={`Find · ${findWhat}`} aria-label={`Clear find · ${findWhat}`} active removeLabel=\"Clear find\" onRemove={args.onClearFind} onClick={args.onClearFind} />\n            </Box>}\n            <EastChakraLibrary value={library} storageKey={rosterLibraryId(storageKey, name)} empty={follows.empty} narrowing={narrowing}\n                searchCount={tab.type === \"people\" ? cards.length - value.agencies.length : undefined}\n                extras={tab.type === \"people\" ? reasons : tab.type === \"patterns\" ? patternExtras : undefined} />\n            <Box css={[styles.paneFoot, styles.paneHint]}>{hint}</Box>\n            {/* The foot's actions stay in place, inert, while a run of the optimiser holds the week (#1409, R2). */}\n            {(commands.available || commands.locked !== undefined) && !held && chosenKey !== undefined && <Box css={styles.paneFoot}>\n                {source !== undefined && <PlaceAction label={source.type === \"agency\" ? \"Request staff\" : \"Assign person\"} source={source} place={defaultPlace} value={value} start={start} commands={commands} styles={styles} />}\n                {patternTarget?.person !== undefined && <Button size=\"xs\" variant=\"outline\" disabled={commands.locked !== undefined} title={commands.locked} onClick={() => setError(commands.applyPattern(patternTarget.person!.key, patternTarget.start, chosenKey))}>Apply to {patternTarget.person.name}</Button>}\n                {tab.type === \"activities\" && <Button size=\"xs\" variant=\"outline\" disabled={target === undefined || commands.locked !== undefined} title={commands.locked} onClick={() => { if (target !== undefined) setError(commands.activity(target, some(chosenKey))); }}>Set activity on selected duty</Button>}\n                {custom !== undefined && custom.sets.length > 0 && <Button size=\"xs\" variant=\"outline\" disabled={target === undefined || commands.locked !== undefined} title={commands.locked} onClick={() => { if (target !== undefined) setError(commands.sets(target, custom.sets)); }}>Apply to selected duty</Button>}\n                {error !== undefined && <Box role=\"alert\" css={styles.error}>{error}</Box>}\n            </Box>}\n        </Box> };\n    });\n    return { label: \"Library\", icon: \"layer-group\", size: \"272px\", tabs, tab: args.tab, onTabChange: args.onTab, persist: \"local\", badge: off };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's drags on the shared drag grammar (#608, #1369): a person or an\n * agency card onto a shift, a duty along its row or between shifts, an\n * activity or an app's card onto a named duty — and a week pattern onto a\n * person's week (#1406, §11): its row in Week, its cell in Month, a `CellRef`\n * whose `row` is the person's key and whose `slot` the East-printed `{ person,\n * start }`. Every drop runs the same commands as the explicit actions; a hover\n * previews what the drop would do, and the ghost's caption says it (B53) —\n * for a pattern, `Early · Mon–Fri → A. Alder · 6 h rest`, `Already matches\n * Early · Mon–Fri`, or why it is refused. What the drag layer says of a\n * destination to a screen reader names it as the grid shows it, never by its\n * keys (the hand retest, R2): a person's week by the person and the week's\n * number, a duty by whose it is, a shift by its group, each with its day and\n * shift.\n *\n * @packageDocumentation\n */\nimport { useMemo } from \"react\";\nimport { DateTimeType, OptionType, SortedMap, StringType, StructType, none, parseFor, printFor, some, variant } from \"@elaraai/east\";\nimport { dropEvent, useDragMessages, useDragTarget, type CellCoord, type DragEventValue, type DragMessages, type DragPayload, type Formatters } from \"@elaraai/east-ui-components\";\nimport { madeFromValues } from \"../shared/schedule/records.js\";\nimport { rosterLibraryId } from \"./library.js\";\nimport { readRosterSource } from \"./identity.js\";\nimport {\n    compareDate, compareString, dayOfSlot, groupName, parsePlace, placeKey, positionFor, rosterDomain, rosterTimes, sameGroup, samePlace, shiftOf, weekNumber, type Assignment,\n    type Context, type Place, type PlacedDuties, type RosterValue, type Week, type WeekState,\n} from \"./model.js\";\nimport type { RosterCommands, RosterSource } from \"./actions.js\";\n\n/** A person's week, as a drop names it (#1406, §11): the person's key and the week's first day. */\nexport const PersonWeekRefType = StructType({ person: StringType, start: DateTimeType });\nconst printPersonWeek = printFor(PersonWeekRefType);\nconst parsePersonWeek = parseFor(PersonWeekRefType);\n\n/** A group, as a drop's row names it: its key, or none's for a duty in no group yet (#1548). */\nconst printGroup = printFor(OptionType(StringType));\n/**\n * A place's drop coordinate (#1548): `row` its group, printed, and `slot` the place, printed — a group's shift on a\n * day, or the shift on the day in no group's band.\n *\n * @param surface - The Roster's surface\n * @param place - The place: its day, its group or none, and its shift\n * @param event - The duty the coordinate names, if any\n * @returns The coordinate\n */\nexport function rosterCoord(surface: string, place: Place, event?: string): CellCoord {\n    return { surface, row: printGroup(place.group), slot: placeKey(place), ...(event === undefined ? {} : { event }) };\n}\n/**\n * A person-week drop target's coordinate (#1406, §11): `row` the person's key, `slot` the East-printed `{ person, start }`.\n *\n * @param surface - The Roster's surface\n * @param person - The person's key\n * @param start - The week's first day\n * @returns The coordinate\n */\nexport function rosterPersonWeekCoord(surface: string, person: string, start: Date): CellCoord {\n    return { surface, row: person, slot: printPersonWeek({ person, start }) };\n}\n/**\n * A person's week, read from a drop's slot.\n *\n * @param slot - The slot's text\n * @returns The person and the week's first day; `undefined` for a slot naming a shift\n */\nexport function readPersonWeek(slot: string): { person: string; start: Date } | undefined {\n    const read = parsePersonWeek(slot);\n    return read.success ? read.value : undefined;\n}\n/** Whether a drag's payload is a card of the Patterns tab. */\nexport function isPatternCard(payload: DragPayload, storageKey: string): boolean {\n    return payload.kind === \"item\" && payload.from.library === rosterLibraryId(storageKey, \"patterns\");\n}\n/**\n * One adapter from the shared drag grammar to the same commands as explicit actions. It is the same object while the\n * week, its commands and the configuration hold (#1398, CL9): what the grid draws with it draws again only as they\n * change.\n */\nexport function useRosterDrag({ value, commands, week, duties, weeks, context, storageKey, narrow, start, format, onError }: {\n    value: RosterValue; commands: RosterCommands; week: Week; duties: PlacedDuties; weeks: readonly WeekState[]; context: Context; storageKey: string;\n    narrow: boolean; start: Date; format: Formatters; onError: (error: string | undefined) => void;\n}) {\n    // Drags register on a wide main while a week in view takes a gesture: the week, or any week of the month (#1406, P32).\n    const enabled = !narrow && commands.editable;\n    // The drag layer's own words, a host's translation among them: what a destination's name is said in.\n    const words = useDragMessages();\n    const drag = useMemo(() => rosterDrag({ value, commands, week, duties, weeks, context, storageKey, start, enabled, format, words }),\n        [value, commands, week, duties, weeks, context, storageKey, start, enabled, format, words]);\n    const { run } = drag;\n    const target = useMemo(() => enabled ? { id: storageKey, sources: value.library.map(tab => rosterLibraryId(storageKey, tab.type === \"tab\" ? `tab:${tab.value.name}` : tab.type)),\n        kinds: { add: true, move: true, resize: false, remove: false, trash: false },\n        onDrag: (event: DragEventValue) => { const error = run(event, false); onError(error); return error === undefined; },\n    } : null, [enabled, storageKey, value.library, run, onError]);\n    useDragTarget(target);\n    return drag;\n}\n/** The drag's verdicts over one week as it stands: what a drop runs, what a hover over a destination previews, and the destination's name. */\nfunction rosterDrag({ value, commands, week, duties, weeks, context, storageKey, start, enabled, format, words }: {\n    value: RosterValue; commands: RosterCommands; week: Week; duties: PlacedDuties; weeks: readonly WeekState[]; context: Context; storageKey: string; start: Date; enabled: boolean;\n    format: Formatters; words: DragMessages;\n}) {\n    const patterns = rosterLibraryId(storageKey, \"patterns\");\n    const run = (event: DragEventValue, checkOnly: boolean): string | undefined => {\n        if (!enabled) return \"This week is not available to edit.\";\n        if (event.type === \"resize\" || event.type === \"remove\") return \"Move a duty onto a shift.\";\n        const into = event.type === \"add\" ? event.value.into : event.value.to;\n        // A pattern lands on a person's week, and nothing else does (#1406, §11).\n        const personWeek = readPersonWeek(into.slot);\n        if (event.type === \"add\" && event.value.from.library === patterns) {\n            if (personWeek === undefined) return \"Drop a pattern on a person's week.\";\n            return commands.applyPattern(personWeek.person, personWeek.start, event.value.from.key, checkOnly);\n        }\n        if (personWeek !== undefined) return event.type === \"move\" ? \"A duty moves along its own row.\" : \"Drop this card onto a day.\";\n        const place = parsePlace(into.slot); if (place === undefined) return \"Choose a configured shift.\";\n        if (event.type === \"move\") return event.value.from.event.type === \"some\"\n            ? commands.place({ type: \"assignment\", key: event.value.from.event.value }, place, checkOnly) : \"Choose a duty.\";\n        const from = event.value.from;\n        if (from.library === rosterLibraryId(storageKey, \"people\")) {\n            const source = readRosterSource(from.key);\n            return source.success ? commands.place({ type: source.value.type, key: source.value.value }, place, checkOnly) : \"This person is no longer available.\";\n        }\n        if (into.event.type !== \"some\") return \"Drop this card onto a named duty.\";\n        if (from.library === rosterLibraryId(storageKey, \"activities\")) return commands.activity(into.event.value, some(from.key), checkOnly);\n        const tab = value.library.find(tab => tab.type === \"tab\" && rosterLibraryId(storageKey, `tab:${tab.value.name}`) === from.library);\n        const card = tab?.type === \"tab\" && tab.value.drop.type === \"some\" ? tab.value.cards.find(card => card.key === from.key) : undefined;\n        return card !== undefined && card.sets.length > 0 ? commands.sets(into.event.value, card.sets, checkOnly) : \"This card has no duty action.\";\n    };\n    type Preview = { label: string; tone: \"info\" | \"warning\" | \"danger\" };\n    // This week/configuration is immutable. Cache discrete destinations\n    // for this drag; caption and landing share the result, including its identity.\n    // New data or commands start a fresh cache. Ended payloads can be GC'd.\n    const previews = new WeakMap<DragPayload, Map<string, Map<string | undefined, { allowed: boolean; result: Preview }>>>();\n    const domain = rosterDomain(value.duty.rowType);\n    const times = rosterTimes();\n    /**\n     * A duty of the week moved to a place, as a move would leave it: its times kept against the shift's, its activity\n     * cleared once it leaves its own group (#1548: into no group's band too).\n     */\n    const movedTo = (id: string, place: Place): Assignment | undefined => {\n        const a = week.assignments.get(id), row = duties.rows.get(id);\n        if (a === undefined || row === undefined) return undefined;\n        const roles = times.move(row.roles, start, place, context);\n        if (roles.type !== \"some\") return undefined;\n        return { ...a, place, start: roles.value.start, end: roles.value.end, hours: roles.value.hours, activity: sameGroup(a.place.group, place.group) ? a.activity : none };\n    };\n    /** A new duty of a person on a place, as a placement would make it. */\n    const newFor = (person: string, place: Place): Assignment | undefined => {\n        const who = variant(\"person\", person);\n        const roles = times.newDuty(who, place, start, positionFor(value, who), none, context);\n        if (roles.type !== \"some\") return undefined;\n        const bytes = madeFromValues(\"Roster\", \"a new duty\", () => value.duty.create({ ...roles.value, pattern: none }));\n        if (bytes?.type !== \"some\") return undefined;\n        return { place, who, position: roles.value.position.type === \"some\" ? roles.value.position.value : \"\", activity: none,\n            start: roles.value.start, end: roles.value.end, hours: roles.value.hours, row: domain.decodeRow(bytes.value) };\n    };\n    /**\n     * A pattern's caption over a person's week (#1406, P18, P19): why it is refused, that the week already matches it,\n     * or the pattern, the person and the first warning the week as it leaves it raises.\n     */\n    const describePattern = (payload: Extract<DragPayload, { kind: \"item\" }>, coord: CellCoord): Preview => {\n        const personWeek = readPersonWeek(coord.slot);\n        if (personWeek === undefined) return { label: \"Drop a pattern on a person's week.\", tone: \"danger\" };\n        const plan = commands.pattern(personWeek.person, personWeek.start, payload.from.key);\n        if (typeof plan === \"string\") return { label: plan, tone: \"danger\" };\n        if (plan.changes.length === 0) return { label: `Already matches ${plan.pattern.label}`, tone: \"info\" };\n        // The person's week as the pattern leaves it, among what can change its duties' issues alone — as a duty's\n        // preview reads (`describe`): the person's own week, every day of it a candidate now, and the whole of each\n        // slot a candidate lands on; never the week entire, whose check over every duty made each row crossed a hitch.\n        const held = compareDate(personWeek.start, start) === 0 ? week : weeks.find(w => compareDate(w.start, personWeek.start) === 0)?.week;\n        let warning: string | undefined;\n        if (held !== undefined) {\n            const places = [...plan.candidates.values()].map(candidate => candidate.place);\n            const assignments = new SortedMap([...held.assignments].filter(([key, a]) => !(a.who.type === \"person\" && a.who.value === personWeek.person) && !plan.removed.includes(key)\n                && places.some(place => samePlace(a.place, place))), compareString);\n            for (const [key, a] of plan.candidates) assignments.set(key, a);\n            warning = domain.check({ ...held, assignments }, context).find(issue => issue.kind.type === \"breach\" && issue.assignment.type === \"some\" && plan.candidates.has(issue.assignment.value))?.title;\n        }\n        return { label: `${plan.pattern.label} → ${plan.person.name}${warning === undefined ? \"\" : ` · ${warning}`}`, tone: warning === undefined ? \"info\" : \"warning\" };\n    };\n    const describe = (coord: CellCoord, payload: DragPayload, allowed: boolean): Preview => {\n        if (payload.kind === \"item\" && isPatternCard(payload, storageKey)) return describePattern(payload, coord);\n        const event = dropEvent(payload, coord, false);\n        const refusal = event === undefined ? \"Choose a shift.\" : run(event, true);\n        if (!allowed || refusal !== undefined) return { label: refusal ?? \"This placement is unavailable.\", tone: \"danger\" };\n        const place = parsePlace(coord.slot); if (place === undefined) return { label: \"Choose a shift.\", tone: \"danger\" };\n        const label = payload.label ?? \"Duty\";\n        let source: RosterSource | undefined;\n        if (payload.kind === \"event\") source = { type: \"assignment\", key: payload.from.event };\n        else if (payload.kind === \"item\" && payload.from.library === rosterLibraryId(storageKey, \"people\")) {\n            const from = readRosterSource(payload.from.key); if (from.success) source = { type: from.value.type, key: from.value.value };\n        }\n        let id: string | undefined;\n        let candidate: Assignment | undefined;\n        if (source?.type === \"assignment\") {\n            id = source.key; candidate = movedTo(id, place);\n        } else if (source?.type === \"person\") {\n            const person = source.key;\n            const previous = [...week.assignments].find(([, a]) => a.who.type === \"person\" && a.who.value === person && a.place.day === place.day);\n            id = previous?.[0] ?? \"\"; while (previous === undefined && week.assignments.has(id)) id += \"_\";\n            candidate = previous === undefined ? newFor(person, place) : movedTo(previous[0], place);\n        } else if (payload.kind === \"item\" && coord.event !== undefined && payload.from.library === rosterLibraryId(storageKey, \"activities\")) {\n            id = coord.event; const a = week.assignments.get(id); if (a !== undefined) candidate = { ...a, activity: some(payload.from.key) };\n        }\n        // Reuse the same pure check with all data that can affect THIS duty:\n        // its person's whole week (rest/double booking) and the complete target\n        // shift (trainer/skills). Other slots cannot change its duty's issues.\n        // Share immutable rows/targets; never serialize an entire week on hover.\n        const assignment = candidate;\n        const assignments = assignment === undefined ? undefined : new SortedMap([...week.assignments].filter(([key, a]) => key !== id && (\n            samePlace(a.place, assignment.place) || a.who.type === \"person\" && assignment.who.type === \"person\" && a.who.value === assignment.who.value\n        )), compareString);\n        if (id !== undefined && assignment !== undefined) assignments!.set(id, assignment);\n        const warning = assignments === undefined ? undefined : domain.check({ ...week, assignments }, context).find(issue => issue.kind.type === \"breach\" && issue.assignment.type === \"some\" && issue.assignment.value === id);\n        const group = groupName(value, place.group);\n        const shift = value.shifts.find(s => s.key === place.shift)?.label;\n        return { label: `${label} · ${group} ${shift}${warning === undefined ? \"\" : ` · ${warning.title}`}`, tone: warning === undefined ? \"info\" : \"warning\" };\n    };\n    const preview = (coord: CellCoord, payload: DragPayload, allowed: boolean): Preview => {\n        let slots = previews.get(payload);\n        if (slots === undefined) { slots = new Map(); previews.set(payload, slots); }\n        let entries = slots.get(coord.slot);\n        if (entries === undefined) { entries = new Map(); slots.set(coord.slot, entries); }\n        // Moving/placing a person onto a nested chip has the same slot outcome.\n        // Activity/custom cards, however, depend on the named target duty.\n        const event = payload.kind === \"item\" && payload.from.library !== rosterLibraryId(storageKey, \"people\") && payload.from.library !== patterns ? coord.event : undefined;\n        const prior = entries.get(event);\n        if (prior !== undefined && prior.allowed === allowed) return prior.result;\n        const result = describe(coord, payload, allowed);\n        entries.set(event, { allowed, result });\n        return result;\n    };\n    const caption = (coord: CellCoord, payload: DragPayload, allowed: boolean) => preview(coord, payload, allowed).label;\n    /**\n     * A destination's name, for what the drag layer says to a screen reader as a drag rests on it and drops there (the\n     * hand retest, R2), in the layer's words for a cell: a person's week by the person's name and the week's number, as\n     * its Month cell names itself (`A. Alder · W10`); a duty by whose it is and a shift by its group, each with its day\n     * and its shift (`C. Clover · Thu Early`, `Inbound · Thu Early`) — never their keys.\n     */\n    const name = (coord: CellCoord): string => {\n        const personWeek = readPersonWeek(coord.slot);\n        if (personWeek !== undefined) {\n            return words.cell({ row: context.people.get(personWeek.person)?.name ?? value.vocabulary.requests, slot: `W${format.number(weekNumber(personWeek.start))}` });\n        }\n        const place = parsePlace(coord.slot);\n        if (place === undefined) return words.cell({ row: coord.row, slot: coord.slot });\n        const when = `${format.weekday(dayOfSlot(start, place))} ${shiftOf(value, place.shift)?.label ?? place.shift}`;\n        const duty = coord.event === undefined ? undefined : week.assignments.get(coord.event);\n        if (duty === undefined) return words.cell({ row: groupName(value, place.group), slot: when });\n        const whose = duty.who.type === \"person\" ? context.people.get(duty.who.value)?.name ?? duty.who.value\n            : `Requested · ${context.agencies.find(agency => agency.key === duty.who.value)?.name ?? duty.who.value}`;\n        return words.cell({ row: whose, slot: when });\n    };\n    return { enabled, surface: storageKey, run, caption, preview, name, start };\n}\nexport type RosterDrag = ReturnType<typeof useRosterDrag>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Search Records (#1398): the Roster toolbar's key search over its people by\n * their keys — primary-key navigation, never a field search, which is the\n * rail's. It is the shared key search's item over the complete staff the\n * Roster calculates over, read whole: their keys in East's order, as the\n * server finds a key (`findKeyInline`) — a key's start, a quoted key, a range.\n * A line names a person by their key, their name and their group; one the\n * rail's narrowing hides says so, as every builder's does (the shared hidden\n * pick, `shared/schedule/hidden.ts`) — `· hidden by Group: picking — picking\n * it clears that filter` once e3 has said, `· hidden by the filters` until\n * then — asked of e3 for the people the box lists that the people's source\n * hides, and listed again as the answers land. A pick selects the person — in\n * the People layout their row is brought into view, once the narrowing draws\n * it — and the box shows their key; the Roster clears what hides them first.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { StringType, compareFor, equalFor, toEastTypeValue, type EastTypeValue, type option } from \"@elaraai/east\";\nimport { findKeyInline, type DatasetKeyMatchRange, type DatasetKeyQuery } from \"@elaraai/east-ui/internal\";\nimport type { KeySearchSource } from \"@elaraai/east-ui-components\";\nimport { askHiding, hiddenLine, hiddenOf, useRelist, type RowHidden, type SourceHidden } from \"../shared/schedule/hidden.js\";\nimport type { RosterWords } from \"./messages.js\";\nimport type { Person, RosterValue } from \"./model.js\";\n\n/** A person's key is a String: the search's text parses against that. */\nconst KEY_TYPE: EastTypeValue = toEastTypeValue(StringType);\nconst compareKey = compareFor(StringType);\nconst keyEqual = equalFor(StringType);\n/** An empty box lists the first of the staff. */\nconst BROWSE_QUERY: DatasetKeyQuery = { prefix: \"\" };\n\n/** A person found, and what hides them. */\nexport interface FoundPerson {\n    readonly person: Person;\n    /** What hides them, as far as e3 has said — the people's source; `undefined` for one the rail's narrowing shows. */\n    readonly hidden: readonly RowHidden[] | undefined;\n}\n\n/**\n * The people a query finds, in East's order of their keys.\n *\n * @param people - The staff, in any order\n * @param query - The query the box parsed\n * @returns The people it finds, in key order\n */\nexport function findPeople(people: readonly Person[], query: DatasetKeyQuery): Person[] {\n    const sorted = [...people].sort((a, b) => compareKey(a.key, b.key));\n    const range = findKeyInline(KEY_TYPE, sorted.map(person => person.key), query);\n    return range.found ? sorted.slice(range.row, range.row + range.count) : [];\n}\n\n/**\n * How a found person reads in the list: their key, their name where it is not their key, their group, and — one the\n * rail hides — what hides them, in the Roster's words (the shared hidden pick).\n *\n * @param found - The person\n * @param groups - The Roster's groups: what names a person's\n * @param words - The Roster's words: the app's formatters, and its message table\n * @returns Their line\n */\nexport function foundPersonLine(found: FoundPerson, groups: RosterValue[\"groups\"], words: RosterWords): string {\n    const { person } = found;\n    const group = groups.find(g => keyEqual(g.key, person.group))?.label ?? person.group;\n    const hidden = found.hidden === undefined ? [] : [hiddenLine(found.hidden, words, words.m)];\n    return [person.key, ...(keyEqual(person.name, person.key) ? [] : [person.name]), group, ...hidden].join(\" · \");\n}\n\n/** Props of {@link useRosterFind}. */\nexport interface RosterFindProps {\n    /** Every person of the staff. */\n    readonly people: readonly Person[];\n    /** The people the rail shows; `none` while it narrows none. */\n    readonly visible: option<ReadonlySet<string>>;\n    /** Whether `visible` is the narrowing's own, read: not the last one standing in while a new one is read. */\n    readonly settled: boolean;\n    /** The Roster's groups. */\n    readonly groups: RosterValue[\"groups\"];\n    /** The hidden pick over the people's source: what e3 has said hides a person. */\n    readonly hidden: SourceHidden;\n    /** The Roster's words: the app's formatters, which word a choice as the rail does, and its message table. */\n    readonly words: RosterWords;\n    /** Told the person a pick lands on. */\n    readonly onPick: (found: FoundPerson) => void;\n}\n\n/**\n * Search Records' source, for the shared key search's toolbar item (see the module docs).\n *\n * @param props - The staff, who the rail shows, the groups, the hidden pick, the words and the pick\n * @returns The source; `undefined` with no one to seek\n */\nexport function useRosterFind({ people, visible, settled, groups, hidden, words, onPick }: RosterFindProps): KeySearchSource | undefined {\n    const latest = useRef({ people, visible, settled, groups, hidden, words, onPick });\n    useLayoutEffect(() => { latest.current = { people, visible, settled, groups, hidden, words, onPick }; });\n    // What the last find found; the box asks for its lines, and jumps to one, with what it captured before the find answered.\n    const found = useRef<readonly Person[]>([]);\n    const find = useCallback(async (query: DatasetKeyQuery): Promise<DatasetKeyMatchRange> => {\n        const matches = findPeople(latest.current.people, query);\n        found.current = matches;\n        return { found: matches.length > 0, row: 0, count: matches.length };\n    }, []);\n    const of = useCallback((person: Person): FoundPerson => {\n        const { visible: shows, hidden: pick } = latest.current;\n        // One the rail's shown people leave out: what hides them, but where e3 says the narrowing holds them, the rail's\n        // shown people catching up.\n        return { person, hidden: shows.type === \"none\" || shows.value.has(person.key) ? undefined : hiddenOf([{ pick, id: person.key }]) };\n    }, []);\n    // A pick shows the person's key in the box: what its query is typed against.\n    const listRange = useCallback(async (row: number, limit: number) => {\n        const listed = found.current.slice(row, row + limit);\n        const { visible: shows, settled: read, groups: named, hidden: pick, words } = latest.current;\n        // Which choices hide the people the narrowing hides, asked of e3 — whether it hides them too, while the people it\n        // shows are the last narrowing's: a line says the filters do until it has said which.\n        if (shows.type === \"some\") askHiding(listed.filter(person => !shows.value.has(person.key)).map(person => ({ pick, id: person.key })), read);\n        return listed.map((person, i) => ({ row: row + i, label: foundPersonLine(of(person), named, words), text: person.key }));\n    }, [of]);\n    const jump = useCallback((row: number) => {\n        const person = found.current[row];\n        if (person !== undefined) latest.current.onPick(of(person));\n    }, [of]);\n    const clear = useCallback(() => { found.current = []; }, []);\n    const any = people.length > 0;\n    // The box asks its query again as the staff or what the rail shows of them move: a line says who it hides.\n    const requery = useRequery(people, visible);\n    // And lists its lines again as e3 says what hides a person.\n    const relist = useRelist([hidden]);\n    return useMemo(() => (any ? { resetKey: \"roster\", requery, relist, keyType: KEY_TYPE, find, listRange, jump, clear, browseQuery: BROWSE_QUERY,\n        noMatchesText: \"No matching people. Search by a person's key.\" } : undefined), [any, requery, relist, find, listRange, jump, clear]);\n}\n\n/** A count that moves each time the staff or the rail's narrowing of them is another object. */\nfunction useRequery(people: readonly Person[], visible: option<ReadonlySet<string>>): number {\n    const seen = useRef({ people, visible, n: 0 });\n    if (!Object.is(seen.current.people, people) || !Object.is(seen.current.visible, visible)) {\n        seen.current = { people, visible, n: seen.current.n + 1 };\n    }\n    return seen.current.n;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * An app's fit, as a builder asks it (`Allocation Spec.md` §12.2, F1–F4, and\n * §13): the app's `e3.function`, called by name through the shared `Func`\n * runtime (`useFuncCall`). A builder asks questions about its drafts. Each\n * answer is kept by the context and the drafts it was asked of, then by\n * question — its key, which the answer echoes, so an answer lands only on the\n * question it answers. One question is in flight at a time; the others wait,\n * the latest asked first, and a question of drafts or a context the builder has\n * moved on from goes unasked. `ask` is the drafts' and the context's: an\n * effect that asks, listing it, asks again when either changes — a record\n * committed under the builder changes its context, its drafts kept. A failed\n * call keeps its question until it is asked again (`retry`). The builder\n * computes no fit of its own.\n *\n * The Roster's Find fixes (#1334) and the Allocation's board\n * (`allocation/fit.ts`) ask through this.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useReducer, useRef } from \"react\";\nimport type { EastType } from \"@elaraai/east\";\nimport { useFuncCall } from \"./use-func-call.js\";\n\n/** How many questions wait at most: one older than these is no one's any more. */\nconst WAITING = 8;\n\n/**\n * What a builder's fit asks, and how.\n *\n * @typeParam Q - A question\n * @typeParam P - The plan a question is asked of: the builder's drafts\n * @typeParam C - The context it is asked in\n * @typeParam R - An answer\n */\nexport interface FitQuestions<Q, P extends object, C extends object, R> {\n    /** The app's function's name; `null` with none, and nothing is asked. */\n    name: string | null;\n    /** What the function takes. */\n    requestType: EastType;\n    /** What it answers. */\n    resultType: EastType;\n    /** A question's key: its East text. */\n    key: (question: Q) => string;\n    /** The key of the question an answer answers, from what it echoes. */\n    answers: (result: R) => string;\n    /** The function's argument for a question about a plan, in a context. */\n    request: (question: Q, plan: P, context: C) => unknown;\n}\n\n/**\n * A builder's fit (see the module docs).\n *\n * @typeParam Q - A question\n * @typeParam P - A plan\n * @typeParam R - An answer\n */\nexport interface FitAnswers<Q, P, R> {\n    /** The answer to a question about the plan as it stands, or about one derived from it, once it has landed (F1). */\n    answer: (question: Q, of?: P) => R | undefined;\n    /**\n     * Asks a question of the plan as it stands, or of one derived from it: answered from what is kept, else sent once nothing is in\n     * flight. A new plan or context is a new `ask`, so an effect that asks, listing it, asks again then (F1).\n     */\n    ask: (question: Q, of?: P) => void;\n    /** Whether a question asked of the plan as it stands is unanswered (F2). */\n    pending: boolean;\n    /** Why the last call failed (F3). */\n    error: string | undefined;\n    /** Asks the failed question again (F3). */\n    retry: () => void;\n}\n\n/** A question waiting: what it asks, of which plan, and the plan and context it was asked over. */\ninterface Wanted<Q, P, C> { key: string; question: Q; of: P | undefined; base: P; context: C }\n\n/**\n * A builder's fit (see the module docs).\n *\n * @typeParam Q - A question\n * @typeParam P - The plan a question is asked of, kept by identity: a new plan, new answers\n * @typeParam C - The context it is asked in, kept by identity: a new context, new answers\n * @typeParam R - An answer\n * @param questions - The function, and how a question is keyed, answered and asked\n * @param plan - The builder's drafts as they stand\n * @param context - What every question is asked in\n * @returns The fit\n */\nexport function useFit<Q, P extends object, C extends object, R>(questions: FitQuestions<Q, P, C, R>, plan: P, context: C): FitAnswers<Q, P, R> {\n    const call = useFuncCall<R>(questions.name, questions.name === null ? null : [questions.requestType], questions.resultType);\n    // Answers, by the context and the plan they were asked of, then by question: new drafts ask again.\n    const kept = useRef(new WeakMap<C, WeakMap<P, Map<string, R>>>());\n    const [, changed] = useReducer((n: number) => n + 1, 0);\n    // The questions waiting, the latest asked first.\n    const waiting = useRef<Wanted<Q, P, C>[]>([]);\n    const flight = useRef<{ key: string; plan: P; context: C } | undefined>(undefined);\n    const live = useRef({ call, plan, context, questions });\n    live.current = { call, plan, context, questions };\n    const keptFor = useCallback((forContext: C, forPlan: P) => {\n        let byPlan = kept.current.get(forContext);\n        if (byPlan === undefined) { byPlan = new WeakMap(); kept.current.set(forContext, byPlan); }\n        let byQuestion = byPlan.get(forPlan);\n        if (byQuestion === undefined) { byQuestion = new Map(); byPlan.set(forPlan, byQuestion); }\n        return byQuestion;\n    }, []);\n    // An answer landing is kept for the plan it was asked of — if it answers the question in flight.\n    useEffect(() => {\n        const asked = flight.current, result = call.result;\n        if (asked === undefined || result === null || call.pending || call.status !== \"succeeded\" || live.current.questions.answers(result) !== asked.key) return;\n        keptFor(asked.context, asked.plan).set(asked.key, result);\n        flight.current = undefined;\n        changed();\n    }, [call.result, call.pending, call.status, keptFor]);\n    // The next question goes once nothing is in flight — after every effect of the commit has asked its own, so the commit's\n    // latest goes first.\n    const scheduled = useRef(false), alive = useRef(true);\n    useEffect(() => { alive.current = true; return () => { alive.current = false; }; }, []);\n    useEffect(() => {\n        if (scheduled.current) return;\n        scheduled.current = true;\n        queueMicrotask(() => {\n            scheduled.current = false;\n            const now = live.current;\n            if (!alive.current || now.call.pending) return;\n            // A question of drafts or a context the builder has moved on from is no one's any more; an answered one is done.\n            waiting.current = waiting.current.filter(w => Object.is(w.base, now.plan) && Object.is(w.context, now.context)\n                && !keptFor(now.context, w.of ?? now.plan).has(w.key));\n            const next = waiting.current[0];\n            if (next === undefined) return;\n            const of = next.of ?? now.plan, asked = flight.current;\n            // The same question of the same plan (the same objects) is in flight, or failed and waits for a retry.\n            if (asked !== undefined && asked.key === next.key && Object.is(asked.plan, of) && Object.is(asked.context, now.context)) return;\n            flight.current = { key: next.key, plan: of, context: now.context };\n            now.call.call(now.questions.request(next.question, of, now.context));\n        });\n    });\n    const answer = useCallback((question: Q, of?: P) => kept.current.get(context)?.get(of ?? plan)?.get(live.current.questions.key(question)), [context, plan]);\n    // A new plan or context, a new `ask`: an effect that asks, listing it, asks again (F1). It asks of them as they stand when it\n    // runs, so a caller holding an older one still asks of these.\n    const ask = useCallback((question: Q, of?: P) => {\n        const now = live.current, key = now.questions.key(question), first = waiting.current[0];\n        if (first !== undefined && first.key === key && Object.is(first.of, of) && Object.is(first.base, now.plan) && Object.is(first.context, now.context)) return;\n        waiting.current = [{ key, question, of, base: now.plan, context: now.context },\n            ...waiting.current.filter(w => !(w.key === key && Object.is(w.of, of)))].slice(0, WAITING);\n        changed();\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [plan, context]);\n    const retry = useCallback(() => { flight.current = undefined; changed(); }, []);\n    const error = call.status === \"failed\" ? call.error?.message ?? \"the fit could not run\" : undefined;\n    // A question asked of the drafts as they are, still unanswered.\n    const unanswered = waiting.current.some(w => Object.is(w.base, plan) && answer(w.question, w.of) === undefined);\n    return { answer, ask, pending: error === undefined && (call.pending || unanswered), error, retry };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's fit (#1334, `Allocation Spec.md` §13, R1–R4): the app's\n * `e3.function`, asked through the shared fit (`shared/func/use-fit.ts`) who\n * fits a Find fix's need on its issue's slot, over the drafted week and the\n * complete staff, whatever the rail shows — its question over the app's own\n * duty rows (`Roster.Types.FitRequest(R)`, #1369), each duty carrying its row.\n * The find asks again when the drafts change; one question is in flight at a\n * time, the latest asked first, and answers are kept by question and drafts\n * (F1). While a find's answer for the drafts as they are is on its way, it has\n * none to show (F2). The Roster decides no one itself: the People tab shows\n * the answer.\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useMemo } from \"react\";\nimport { StructType, equalFor, printFor, type SortedMap, type ValueTypeOf } from \"@elaraai/east\";\nimport { RosterContextType, RosterFitResultType, RosterNeedType, RosterSlotType } from \"@elaraai/e3-ui/internal\";\nimport { useDataStable } from \"@elaraai/east-ui-components\";\nimport { useFit } from \"../shared/func/use-fit.js\";\nimport { rosterDomain, type Context, type Coverage, type RosterValue, type Slot, type Week } from \"./model.js\";\n\n/** What a Find fix looks for: a lead, a trainer, or a holder of a skill. */\nexport type Need = ValueTypeOf<typeof RosterNeedType>;\n/** The fit's answer: a verdict for every person, by staff key. */\nexport type FitResult = ValueTypeOf<typeof RosterFitResultType>;\n/** A find: a need on an issue's slot — the question the fit is asked. */\nexport interface RosterFind { need: Need; slot: Slot }\n\n/** A find as East holds it: what its key prints, and what an answer echoes. */\nconst FindType = StructType({ need: RosterNeedType, slot: RosterSlotType });\nconst findText = printFor(FindType);\n/** Whether two finds ask the same question. */\nexport const sameFind: (a: RosterFind, b: RosterFind) => boolean = equalFor(FindType);\nconst sameContext = equalFor(RosterContextType);\n\n/** The Roster's fit, for its one find. */\nexport interface RosterFit {\n    /** Whether the app bound a fit: a Find fix is offered only then (R2). */\n    offered: boolean;\n    /** The find's answer for the drafts as they are, which the People tab shows; none while it is on its way (F2) or failed. */\n    shown: FitResult | undefined;\n    /** Whether the find is asked and its answer for the drafts as they are has not landed (R4: its fix reads `Finding…`). */\n    pending: boolean;\n    /** Why the fit's last call failed (R4: a warning banner with Retry). */\n    error: string | undefined;\n    /** Asks the failed question again. */\n    retry: () => void;\n}\n\n/** What every question is asked in: the complete context, the week's first day, and the drafted week's coverage. */\ninterface Facts { context: Context; start: Date; coverage: SortedMap<Slot, Coverage> }\n\n/**\n * The Roster's fit (see the module docs).\n *\n * @param value - The payload: the fit's name, `none` without one, and the duty kind's row type\n * @param start - The week's first day\n * @param week - The drafted week\n * @param context - The complete staff and configuration\n * @param coverage - The drafted week's coverage, its costs the pay's\n * @param find - The find the People tab shows, if any\n * @returns The fit, for that find\n */\nexport function useRosterFit(value: RosterValue, start: Date, week: Week, context: Context, coverage: SortedMap<Slot, Coverage>, find: RosterFind | undefined): RosterFit {\n    const domain = rosterDomain(value.duty.rowType);\n    // The drafts and the context by their data: a render that builds them again asks nothing again.\n    const plan = useDataStable(week, domain.sameWeek);\n    const complete = useDataStable(context, sameContext);\n    const epoch = start.getTime();\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    const facts = useMemo<Facts>(() => ({ context: complete, start: new Date(epoch), coverage }), [complete, epoch, plan]);\n    const name = value.fit.type === \"some\" ? value.fit.value.name : null;\n    const fit = useFit<RosterFind, Week, Facts, FitResult>({\n        name, requestType: domain.fitRequestType, resultType: RosterFitResultType,\n        key: findText, answers: result => findText({ need: result.need, slot: result.slot }),\n        request: (asked, drafted, at) => ({ need: asked.need, slot: asked.slot, start: at.start, week: drafted, context: at.context, coverage: at.coverage }),\n    }, plan, facts);\n    const { ask } = fit;\n    // The find asks of the drafts as they are, and again when they change (F1).\n    useEffect(() => { if (find !== undefined && name !== null) ask(find); }, [find, name, plan, facts, ask]);\n    // An answer asked of other drafts is no verdict on these: the tab shows none until theirs lands (F2).\n    const answer = find === undefined ? undefined : fit.answer(find);\n    return {\n        offered: name !== null, shown: answer,\n        pending: find !== undefined && name !== null && answer === undefined && fit.error === undefined,\n        error: fit.error, retry: fit.retry,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\nimport { useRef } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { OptimiseLegendItem } from \"@elaraai/east-ui-components\";\nimport { FooterMore, LoadingLine, RecordSliceSaveNotice, footerCut, useFooterFit, useRevealed, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport type { RosterStyles, RosterValue } from \"./model.js\";\n\n/** The coverage marks the legend explains: who fills a slot's hours, and what it needs. Overtime is the app's pay's to say (§5.6). */\nconst legendOf = (words: RosterValue[\"vocabulary\"]) => [\n    { key: \"permanent\", label: words.permanent }, { key: \"agency\", label: words.agency },\n    { key: \"requested\", label: \"Requested\" }, { key: \"open\", label: \"Open\" }, { key: \"needed\", label: \"Hours needed\" },\n] as const;\n/**\n * The shared footer rail explains the coverage marks, then a Save's notice of\n * the duties that left the week's window, and at its trailing end the shared\n * loading line (#1398, CL3): the week being read — `Loading 12–18 Mar` — or\n * why it could not be, with Retry. The rail never wraps and never cuts a word:\n * the legend stays whole and in place, ending at a whole mark, then \"…\", only\n * where it cannot fit. Details stay in the inspector. The line shows on the\n * frame's one reveal clock (CL4, its `LoadingReveal`), which the week's\n * placeholders keep too — or says what a run of the app's optimiser does\n * (#1409), at once. During a run's highlight the legend ends with `Elara\n * change`.\n */\nexport function RosterFooter({ styles, vocabulary, duties, noun, line, optimise }: {\n    styles: RosterStyles;\n    /** The app's words for who is on the Roster: the legend's. */\n    vocabulary: RosterValue[\"vocabulary\"];\n    /** The slice's part over the duties, whose Save notice counts what leaves the week's window. */\n    duties: ValueTypeOf<RecordSliceBindType> | undefined;\n    /** What a duty is called, singular and plural. */\n    noun: { singular: string; plural: string };\n    /** What the week's read says: the week being read, or why it could not be; `undefined` while it has landed. */\n    line: LoadingLineValue | undefined;\n    /** A run of the app's optimiser (#1409): what its line says while the call is out or just stopped, and whether its highlight is on. */\n    optimise?: { readonly line: LoadingLineValue | undefined; readonly legend: boolean } | undefined;\n}) {\n    const ref = useRef<HTMLDivElement>(null);\n    const fit = useFooterFit(ref);\n    const shown = useRevealed() === true;\n    const elara = optimise?.legend === true;\n    const runLine = optimise?.line;\n    const legend = legendOf(vocabulary);\n    const units = legend.length + (elara ? 1 : 0);\n    return <Box ref={ref} css={styles.footer} data-roster-footer=\"\">\n        {legend.map((item, i) => <Box as=\"span\" key={item.key} css={[styles.footerItem, styles.legendItem]} data-roster-legend={item.key}\n            data-footer-unit=\"\" data-footer-cut={footerCut(i, fit)}>\n            <Box as=\"span\" aria-hidden=\"true\" css={[item.key === \"needed\" ? styles.coverageTick : styles.coverageSegment, styles.legendSwatch]} data-kind={item.key} />{item.label}\n        </Box>)}\n        {elara && <OptimiseLegendItem css={[styles.footerItem ?? {}, styles.legendItem ?? {}]} cut={footerCut(legend.length, fit)} />}\n        <FooterMore shown={fit.kept < units} />\n        {duties !== undefined && <RecordSliceSaveNotice slice={duties} singular={noun.singular} plural={noun.plural} />}\n        {/* A run's line shows at once, whatever the reveal says: a run is not a read (#1409). */}\n        <LoadingLine value={runLine ?? line} shown={shown || runLine !== undefined} form={fit.form} />\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The People layout's work requirement (#1568): each shift's hours rostered against those needed — a day's, a week's\n * and a skill's — summed from the coverage the Shifts layout works out for each slot, so the two layouts never\n * disagree (K1), over the span in view: a week, or a month's weeks. A group's band sums its own slots; where the layout\n * draws no bands (#1567), one block sums every group's. Rostered is every duty's hours — the permanent staff's, agency\n * staff's and the agencies' requests' — as the Shifts layout counts them (ruled 8 Nov 2026). A duty in no group yet\n * (#1548) stands in no slot: no band counts it, and the one block counts it on its shift's day beside the slots, its\n * hours going to what they are short — it may yet be placed in any of them. A shortfall a figure states — a day's, a\n * lane's week's, a skill's, a mark's — is what its slots are short, each slot's own summed, never their net: one slot's\n * surplus fills no other's shortfall (K4, B3.2), so a day 8 hours short in one slot and 6 over in another states `−8`,\n * though its net is −2.\n *\n * @packageDocumentation\n */\nimport { none, some } from \"@elaraai/east\";\nimport type { Coverage, RosterValue, Shift, Slot, Week } from \"./model.js\";\n\n/** A week of the span, as the work requirement reads it: its targets, each slot's coverage over it, and its duties in no group. */\nexport interface DemandWeek {\n    /** The week's targets, by slot. */\n    readonly requirements: Week[\"requirements\"];\n    /** Each slot's coverage over the week. */\n    readonly coverage: ReadonlyMap<Slot, Coverage>;\n    /** Its duties in no group yet (#1548): each day's hours by shift's key, the week's first day first ({@link looseOf}). */\n    readonly loose?: readonly ReadonlyMap<string, LooseHours>[] | undefined;\n}\n\n/** A shift's day's duties in no group yet (#1548): their hours, split as a slot's coverage splits its own. */\nexport interface LooseHours {\n    /** The permanent staff's. */\n    readonly permanent: number;\n    /** Agency staff's. */\n    readonly agency: number;\n    /** The agencies' requests'. */\n    readonly requested: number;\n}\n\n/** Hours over a set of slots: those needed against those rostered, and what the slots are short, each its own. */\nexport interface DemandFigures {\n    /**\n     * Whether a slot of the set has a target with work to it: hours needed or rostered. A target needing no hours, none\n     * rostered, is no target, as the Shifts layout's `No work` reads it. Where none has, its cell says so and draws no bar\n     * (A3.6).\n     */\n    readonly target: boolean;\n    /** The hours the slots' targets need. */\n    readonly needed: number;\n    /** Every duty's hours on the slots: the permanent staff's, agency staff's and the agencies' requests'. */\n    readonly rostered: number;\n    /** The permanent staff's part of them. */\n    readonly permanent: number;\n    /** Agency staff's part of them. */\n    readonly agency: number;\n    /** The agencies' requests' part of them. */\n    readonly requested: number;\n    /** The hours short, each slot's own summed: no slot's surplus nets another's shortfall (K4). */\n    readonly short: number;\n    /** How many of the slots are short. */\n    readonly shortSlots: number;\n}\n\n/** A skill's hours over a set of slots: those its duties are assigned against those the slots' targets need, and what the slots are short of it. */\nexport interface SkillFigures {\n    /** The hours the targets need of the skill. */\n    readonly needed: number;\n    /** The hours of duties assigned the skill. */\n    readonly assigned: number;\n    /** The hours of it short, each slot's own summed: no slot's surplus nets another's shortfall (K4). */\n    readonly short: number;\n}\n\n/** A skill row under an open lane (A4): the skill's hours each day and over the span. */\nexport interface DemandSkill {\n    /** The skill's key. */\n    readonly skill: string;\n    /** Each day's, the span's first day first, seven a week: `undefined` where none of the day's slots needs hours of the skill or has any assigned. */\n    readonly days: readonly (SkillFigures | undefined)[];\n    /** The span's. */\n    readonly total: SkillFigures;\n}\n\n/** A lane (A3): a shift a target of the scope names in the span with hours needed or rostered on some day of it, its slots each day and over the span. */\nexport interface DemandLane {\n    /** The shift. */\n    readonly shift: Shift;\n    /** Each day's, the span's first day first, seven a week: the shift's slots of the scope's groups that day. */\n    readonly days: readonly DemandFigures[];\n    /** The span's. */\n    readonly total: DemandFigures;\n    /** Its skill rows: one a skill its slots' targets need hours of or have assigned, in the activities' order (A4.1). */\n    readonly skills: readonly DemandSkill[];\n}\n\n/** A scope's work requirement over the span: a group's, or every group's where the layout draws no bands. */\nexport interface Demand {\n    /** Its lanes: one a shift a target of the scope names in the span with hours needed or rostered on some day of it, in the shifts' order (A3.1); none without one. */\n    readonly lanes: readonly DemandLane[];\n    /** Each day's over every slot of the scope, the span's first day first (A2.2): a week's eyebrow's figures. */\n    readonly days: readonly DemandFigures[];\n    /** Each week's over every slot of the scope (A2.2): a month's eyebrow's figures. */\n    readonly weeks: readonly DemandFigures[];\n    /** The span's over every slot of the scope: the band's figures (A1.2). */\n    readonly total: DemandFigures;\n}\n\n/**\n * A day's mark in a month's lane or skill row (A3.5, A4.4): its state — off where it has no target (a skill's, where\n * none of the day's slots needs it), short where any of its slots is, requested where requests make up part of its\n * hours, else covered — and the difference its figure says.\n */\nexport interface DemandMark {\n    readonly state: \"off\" | \"short\" | \"requested\" | \"covered\";\n    /** The difference it states ({@link stated}): what its slots are short, below zero, where any is; else the hours over. */\n    readonly difference: number;\n}\n\n/** The hours under which a difference is none: a sum of fractional hours lands a hair either side of zero. */\nconst EPSILON = 1e-6;\n/** The days of a week. */\nconst WEEK_DAYS = 7;\n\n/**\n * Rostered less needed, a hair either side of zero none at all.\n *\n * @param rostered - The hours rostered\n * @param needed - The hours needed\n * @returns The difference: below zero where short, above where over, zero where exact\n */\nexport function difference(rostered: number, needed: number): number {\n    const d = rostered - needed;\n    return Math.abs(d) < EPSILON ? 0 : d;\n}\n\n/**\n * The difference a figure states (K4, B3.2): where any of its slots is short, what they are short, each slot's own\n * summed, below zero — never their net, which would let one slot's surplus fill another's shortfall — else the hours\n * over, or none.\n *\n * @param have - The hours rostered, or a skill's hours assigned\n * @param needed - The hours needed\n * @param short - What its slots are short, each slot's own summed\n * @returns The difference: below zero where short, above where over, zero where exact\n */\nexport function stated(have: number, needed: number, short: number): number {\n    return short > EPSILON ? -short : difference(have, needed);\n}\n\n/**\n * How a difference is toned (K3): the warning where short, muted where over, positive where exact.\n *\n * @param d - The difference, as {@link difference} gives it\n * @returns Its tone\n */\nexport function toneOf(d: number): \"short\" | \"over\" | \"exact\" {\n    return d < 0 ? \"short\" : d > 0 ? \"over\" : \"exact\";\n}\n\n/**\n * A difference as its figure reads (A3.3): `+4`, `−6` with a true minus, and nothing at zero — or `zero` where a figure\n * always shows, as the band's `+0`.\n *\n * @param number - The locale's number formatter\n * @param d - The difference\n * @param zero - What zero reads; nothing by default\n * @returns The figure\n */\nexport function signed(number: (n: number) => string, d: number, zero = \"\"): string {\n    const at = Math.abs(d) < EPSILON ? 0 : d;\n    return at === 0 ? zero : `${at > 0 ? \"+\" : \"−\"}${number(Math.abs(at))}`;\n}\n\n/**\n * A difference as a day's label says it to a screen reader, after its hours (K4): `, 2 short`, `, 13 over`, and\n * nothing at zero. The label stands in for the figures it holds, and its hours alone cannot say a stated shortfall: a\n * day 2 short in one group and 4 over in another has more hours rostered than needed.\n *\n * @param number - The locale's number formatter\n * @param d - The difference it states ({@link stated})\n * @returns What follows the hours in its label\n */\nexport function differenceSaid(number: (n: number) => string, d: number): string {\n    const at = Math.abs(d) < EPSILON ? 0 : d;\n    return at === 0 ? \"\" : `, ${number(Math.abs(at))} ${at < 0 ? \"short\" : \"over\"}`;\n}\n\n/**\n * A lane's day as a month's mark draws it (A3.5): off with no target; short where any of its slots is, by what they are\n * short (K4); requested where the agencies' requests make up part of its hours, which count as rostered, as the week's\n * bar draws them dashed; else covered, over by its difference or exact.\n *\n * @param f - The lane's day\n * @returns Its mark\n */\nexport function laneMark(f: DemandFigures): DemandMark {\n    const d = stated(f.rostered, f.needed, f.short);\n    return { state: !f.target ? \"off\" : d < 0 ? \"short\" : f.requested > EPSILON ? \"requested\" : \"covered\", difference: d };\n}\n\n/**\n * A skill row's day as a month's mark draws it (A4.4): off where none of the day's slots needs the skill; short where\n * any of its slots is short of it, by what they are short (K4); else covered.\n *\n * @param f - The skill's day, `undefined` where none of its slots needs it\n * @returns Its mark\n */\nexport function skillMark(f: SkillFigures | undefined): DemandMark {\n    if (f === undefined) return { state: \"off\", difference: 0 };\n    const d = stated(f.assigned, f.needed, f.short);\n    return { state: d < 0 ? \"short\" : \"covered\", difference: d };\n}\n\n/** A part of a day's bar (A3.3): the permanent staff's, agency staff's or the agencies' requests' hours, or what is open. */\nexport interface BarPart {\n    readonly kind: \"permanent\" | \"agency\" | \"requested\" | \"open\";\n    /** Where it starts, in hours from the bar's start. */\n    readonly left: number;\n    /** Its hours. */\n    readonly width: number;\n}\n\n/** A day's bar (A3.4): its parts, in hours, and the hours its whole length stands for. */\nexport interface DemandBar {\n    readonly parts: readonly BarPart[];\n    /** The hours of its whole length: the larger of those needed and those its parts reach, an hour at least. */\n    readonly scale: number;\n}\n\n/**\n * A day's bar (A3.3, A3.4) — a lane's day's, or a slot's coverage's: the permanent staff's, agency staff's and the\n * agencies' requests' parts from its start, each it has some of, then what its slots are short open after them, each\n * slot's own summed (K4) — so a day short in one slot and over in another draws its hours past the needed tick and its\n * shortfall open after them — scaled to the larger of the hours needed and those its parts reach. A slot's bar, its\n * shortfall its own, is open from its hours to the tick.\n *\n * @param hours - Its hours: the permanent staff's, agency staff's, the agencies' requests' and those needed\n * @param short - What its slots are short, each slot's own summed\n * @returns Its parts and its scale\n */\nexport function barOf(hours: Pick<Coverage[\"hours\"], \"permanent\" | \"agency\" | \"requested\" | \"needed\">, short: number): DemandBar {\n    const parts: BarPart[] = [];\n    let left = 0;\n    for (const kind of [\"permanent\", \"agency\", \"requested\"] as const) {\n        const width = hours[kind];\n        if (width > 0) parts.push({ kind, left, width });\n        left += width;\n    }\n    const open = short > EPSILON ? short : 0;\n    if (open > 0) parts.push({ kind: \"open\", left, width: open });\n    return { parts, scale: Math.max(hours.needed, left + open, 1) };\n}\n\n/**\n * How far a day's mark by month fills as a cup (ruled 8 Nov 2026), from the bottom, each level a share of its height:\n * the permanent staff's hours first, then agency staff's, the agencies' requests' on top — a skill's, its hours\n * assigned, all three levels its one — full where none of its slots is short.\n */\nexport interface DemandCup {\n    /** Where the permanent staff's part ends. */\n    readonly permanent: number;\n    /** Where agency staff's part ends. */\n    readonly agency: number;\n    /** Where the fill ends, the agencies' requests' part with it: the hours rostered of those needed, at most the whole. */\n    readonly fill: number;\n}\n\n/** A cup with nothing in it. */\nconst EMPTY_CUP: DemandCup = { permanent: 0, agency: 0, fill: 0 };\n\n/**\n * The share of a day's hours needed its slots meet (K4): those needed less what the slots are short, each slot's own,\n * so no slot's surplus fills another's shortfall; all of them where none is short, or where none are needed.\n *\n * @param needed - The hours needed\n * @param short - What the slots are short, each slot's own summed\n * @returns The share, from 0 to 1\n */\nfunction metOf(needed: number, short: number): number {\n    return needed < EPSILON ? 1 : Math.min(Math.max(needed - short, 0) / needed, 1);\n}\n\n/**\n * A lane's day as its cup fills by month (ruled 8 Nov 2026): to the share of its hours needed its slots meet — full\n * where none of them is short, and where any is, open above by what they are short, each slot's own (K4), whatever\n * another slot is over — its parts the permanent staff's, agency staff's and the agencies' requests' in proportion to\n * its hours rostered; empty with no target, or with no hours of either. A day of one slot fills as its bar by week\n * draws it, each level ending where the bar's part does: a short day to its hours rostered of needed, a day covered or\n * over full, its parts in proportion.\n *\n * @param f - The lane's day\n * @returns Its cup's levels\n */\nexport function laneCup(f: DemandFigures): DemandCup {\n    const rostered = f.permanent + f.agency + f.requested;\n    if (!f.target || Math.max(f.needed, rostered) < EPSILON) return EMPTY_CUP;\n    const met = metOf(f.needed, f.short);\n    const level = (hours: number) => rostered < EPSILON ? 0 : met * hours / rostered;\n    return { permanent: level(f.permanent), agency: level(f.permanent + f.agency), fill: level(rostered) };\n}\n\n/**\n * The share of a skill's hours needed its slots meet (K4): those needed less what each slot is short of it, so no\n * slot's surplus fills another's shortfall — a skill row's bar by week and its cup by month fill to it.\n *\n * @param f - The skill's day, or its week\n * @returns The share, from 0 to 1; all of it where its slots need none\n */\nexport function skillMet(f: SkillFigures): number {\n    return metOf(f.needed, f.short);\n}\n\n/**\n * A skill row's day as its cup fills by month (ruled 8 Nov 2026): to the share of its hours needed its slots meet\n * ({@link skillMet}), full where none is short of it, as the day's bar by week draws it; empty where none of the day's\n * slots needs the skill.\n *\n * @param f - The skill's day, `undefined` where none of its slots needs it\n * @returns Its cup's levels, each the one level\n */\nexport function skillCup(f: SkillFigures | undefined): DemandCup {\n    if (f === undefined) return EMPTY_CUP;\n    const fill = skillMet(f);\n    return { permanent: fill, agency: fill, fill };\n}\n\n/** A slot as the figures read it: its coverage, and whether it has a target. */\ninterface Entry {\n    readonly coverage: Coverage;\n    readonly target: boolean;\n}\n\n/**\n * The figures of a shift's day — some of its slots, and the duties in no group the scope counts there — summed: their\n * hours, and what each slot is short (K4), less the hours in no group, which may yet be placed in any of them (#1548).\n * A slot has a target only with work to it, hours needed or rostered, each slot answering for itself; a duty in no group\n * is work on the shift's day, so a target that stands there needing no hours keeps it.\n */\nfunction figuresOf(slots: readonly Entry[], loose: LooseHours | undefined): DemandFigures {\n    let named = false, target = false, needed = 0, rostered = 0, permanent = 0, agency = 0, requested = 0, short = 0, shortSlots = 0;\n    for (const slot of slots) {\n        const hours = slot.coverage.hours;\n        named ||= slot.target;\n        target ||= slot.target && (hours.needed > EPSILON || hours.rostered > EPSILON);\n        needed += hours.needed; rostered += hours.rostered;\n        permanent += hours.permanent; agency += hours.agency; requested += hours.requested;\n        const d = difference(hours.rostered, hours.needed);\n        if (d < 0) { short -= d; shortSlots += 1; }\n    }\n    if (loose !== undefined) {\n        const hours = loose.permanent + loose.agency + loose.requested;\n        target ||= named && hours > EPSILON;\n        permanent += loose.permanent; agency += loose.agency; requested += loose.requested; rostered += hours;\n        short = Math.max(0, short - hours);\n        if (short <= EPSILON) { short = 0; shortSlots = 0; }\n    }\n    return { target, needed, rostered, permanent, agency, requested, short, shortSlots };\n}\n/** Figures added: their hours, and what each is short, each its own (K4). */\nfunction addFigures(list: readonly DemandFigures[]): DemandFigures {\n    let target = false, needed = 0, rostered = 0, permanent = 0, agency = 0, requested = 0, short = 0, shortSlots = 0;\n    for (const f of list) {\n        target ||= f.target;\n        needed += f.needed; rostered += f.rostered;\n        permanent += f.permanent; agency += f.agency; requested += f.requested;\n        short += f.short; shortSlots += f.shortSlots;\n    }\n    return { target, needed, rostered, permanent, agency, requested, short, shortSlots };\n}\n/**\n * A week's duties in no group yet (#1548), as the one block over every group counts them: each day's hours by its\n * shift's key, the week's first day first, split as a slot's coverage splits its own — an agency person's as agency\n * staff's, a request's as the agencies'.\n *\n * @param value - The payload: its people, each marked agency staff or not\n * @param week - The week as drafted\n * @returns Each day's hours, by shift\n */\nexport function looseOf(value: Pick<RosterValue, \"people\">, week: Week): readonly ReadonlyMap<string, LooseHours>[] {\n    const days: Map<string, LooseHours>[] = Array.from({ length: WEEK_DAYS }, () => new Map());\n    const agencyStaff = new Set(value.people.filter(person => person.agency).map(person => person.key));\n    for (const a of week.assignments.values()) {\n        if (a.place.group.type !== \"none\") continue;\n        const day = days[Number(a.place.day)];\n        if (day === undefined) continue;\n        const at = day.get(a.place.shift) ?? { permanent: 0, agency: 0, requested: 0 };\n        const who = a.who;\n        day.set(a.place.shift, who.type === \"request\" ? { ...at, requested: at.requested + a.hours }\n            : agencyStaff.has(who.value) ? { ...at, agency: at.agency + a.hours } : { ...at, permanent: at.permanent + a.hours });\n    }\n    return days;\n}\n\n/**\n * A lane's skill rows: each skill its slots' lines need hours of or have assigned, summed each day, in the activities'\n * order as the lines are — what each slot is short of it summed on its own (K4), the week's its days'. A line with\n * neither is no line, as a target needing no hours is no target: its day is empty, and a skill with no other has no row.\n */\nfunction skillsOf(value: Pick<RosterValue, \"activities\">, days: readonly (readonly Entry[])[]): DemandSkill[] {\n    const by = new Map<string, (SkillFigures | undefined)[]>();\n    days.forEach((entries, day) => {\n        for (const { coverage } of entries) for (const line of coverage.lines) {\n            if (line.needed < EPSILON && line.assigned < EPSILON) continue;\n            let row = by.get(line.skill);\n            if (row === undefined) { row = Array.from({ length: days.length }, () => undefined); by.set(line.skill, row); }\n            const at = row[day];\n            row[day] = {\n                needed: (at?.needed ?? 0) + line.needed, assigned: (at?.assigned ?? 0) + line.assigned,\n                short: (at?.short ?? 0) + Math.max(0, -difference(line.assigned, line.needed)),\n            };\n        }\n    });\n    return value.activities.flatMap(activity => {\n        const row = by.get(activity.key);\n        if (row === undefined) return [];\n        const total = row.reduce<SkillFigures>((sum, day) => day === undefined ? sum\n            : { needed: sum.needed + day.needed, assigned: sum.assigned + day.assigned, short: sum.short + day.short }, { needed: 0, assigned: 0, short: 0 });\n        return [{ skill: activity.key, days: row, total }];\n    });\n}\n\n/**\n * A scope's work requirement over the span (#1568): a lane a shift a target of the scope names in any of the span's\n * weeks, with hours needed or rostered on some day of it — a target needing no hours, none rostered, is no target, as\n * the Shifts layout's `No work` reads it — its days' and its span's hours summed over the scope's groups' slots — each\n * slot's as the Shifts layout draws it — and its skill rows; and the scope's days', weeks' and span's over every one of\n * its slots, a shift with no target's included, as the Shifts layout's band sums them. With `loose`, each shift's day counts the week's duties in\n * no group there too (#1548): the one block over every group's.\n *\n * @param value - The payload: its shifts and activities, in their orders\n * @param weeks - The span's weeks, its first first: each one's targets, coverage and duties in no group\n * @param groups - The scope's groups: a band's own, or every group where the layout draws no bands\n * @param loose - Whether the scope counts the duties in no group: the one block's\n * @returns The scope's lanes and figures\n */\nexport function demandOf(value: Pick<RosterValue, \"shifts\" | \"activities\">, weeks: readonly DemandWeek[], groups: readonly string[], loose = false): Demand {\n    const days = weeks.length * WEEK_DAYS;\n    // Each day's figures a shift: what the scope's days, weeks and span add up.\n    const scopeDays: DemandFigures[][] = Array.from({ length: days }, () => []);\n    const lanes: DemandLane[] = [];\n    for (const shift of value.shifts) {\n        const laneDays: Entry[][] = Array.from({ length: days }, () => []);\n        const laneFigures: DemandFigures[] = [];\n        weeks.forEach(({ requirements, coverage, loose: looseDays }, w) => {\n            for (let day = 0; day < WEEK_DAYS; day++) {\n                const entries = laneDays[w * WEEK_DAYS + day]!;\n                for (const group of groups) {\n                    const slot = { day: BigInt(day), group, shift: shift.key };\n                    const slotCoverage = coverage.get(slot);\n                    if (slotCoverage === undefined) continue;\n                    entries.push({ coverage: slotCoverage, target: requirements.has(slot) });\n                }\n                const figures = figuresOf(entries, loose ? looseDays?.[day]?.get(shift.key) : undefined);\n                laneFigures.push(figures);\n                scopeDays[w * WEEK_DAYS + day]!.push(figures);\n            }\n        });\n        if (laneFigures.some(figures => figures.target)) lanes.push({ shift, days: laneFigures, total: addFigures(laneFigures), skills: skillsOf(value, laneDays) });\n    }\n    const dayFigures = scopeDays.map(addFigures);\n    return {\n        lanes, days: dayFigures,\n        weeks: weeks.map((_, w) => addFigures(dayFigures.slice(w * WEEK_DAYS, (w + 1) * WEEK_DAYS))),\n        total: addFigures(dayFigures),\n    };\n}\n\n/**\n * Coverage summed over slots (#1568): a shift's day across the groups, as the inspector draws it — positions, people,\n * hours and cost added, a lead or a trainer where any slot has one, and each skill's line summed over the slots whose\n * targets need it, in the activities' order, its holders and capacity where any slot counts them. With `loose`, the\n * hours of the duties in no group there count as rostered too, as the one block's lane counts them (#1548): they fill\n * no position.\n *\n * @param value - The payload: its activities, in their order\n * @param list - The slots' coverage\n * @param loose - The shift's day's duties in no group yet, where the sum counts them\n * @returns Their sum, a coverage the coverage detail draws as it draws a slot's\n */\nexport function summedCoverage(value: Pick<RosterValue, \"activities\">, list: readonly Coverage[], loose?: LooseHours): Coverage {\n    let positions = 0n, filled = 0n, open = 0n, people = 0n, cost = 0, lead = false, trainer = false;\n    let permanent = loose?.permanent ?? 0, agency = loose?.agency ?? 0, requested = loose?.requested ?? 0, needed = 0;\n    let rostered = permanent + agency + requested;\n    const lines = new Map<string, { needed: number; assigned: number; gap: number; holders: bigint | undefined; capacity: number | undefined }>();\n    for (const c of list) {\n        positions += c.positions; filled += c.filled; open += c.open; people += c.people; cost += c.cost;\n        lead ||= c.lead; trainer ||= c.trainer;\n        permanent += c.hours.permanent; agency += c.hours.agency; requested += c.hours.requested; needed += c.hours.needed; rostered += c.hours.rostered;\n        for (const line of c.lines) {\n            const at = lines.get(line.skill) ?? { needed: 0, assigned: 0, gap: 0, holders: undefined, capacity: undefined };\n            lines.set(line.skill, {\n                needed: at.needed + line.needed, assigned: at.assigned + line.assigned, gap: at.gap + line.gap,\n                holders: line.holders.type === \"some\" ? (at.holders ?? 0n) + line.holders.value : at.holders,\n                capacity: line.capacity.type === \"some\" ? (at.capacity ?? 0) + line.capacity.value : at.capacity,\n            });\n        }\n    }\n    return {\n        positions, filled, open, people, cost, lead, trainer,\n        hours: { permanent, agency, requested, needed, rostered },\n        lines: value.activities.flatMap(activity => {\n            const line = lines.get(activity.key);\n            return line === undefined ? [] : [{\n                skill: activity.key, needed: line.needed, assigned: line.assigned, gap: line.gap,\n                holders: line.holders === undefined ? none : some(line.holders), capacity: line.capacity === undefined ? none : some(line.capacity),\n            }];\n        }),\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's views: the Shifts grid, the People grids — by week, a tile a\n * duty in each day cell; by month, a column a week and a cell seven marks\n * (#1406) — and their phones' cards, over the week as drafted.\n *\n * The People grids draw a row a person, through the shared virtual rows\n * (#1398, CL9): the week's duties are indexed once by person and day\n * ({@link peopleIndex}), a duty's person is found by its key, and a row and\n * each of its days draw again only as what they show changes — a scroll draws\n * only the rows it brings into view. Each kind of row is estimated at its\n * floor, measured from the first rows of the kind to mount (problem 12, CL8):\n * every row of the kind is at least as tall, so a row measured as it comes\n * into view only grows, below the row in view, and the rows anchor. Where the\n * rows' view rests is saved by its top row's key, and brought back as they\n * mount; ↑ and ↓ on a person's name step to the next person, or the one\n * before, selecting them and bringing their row into view. A pick in Search\n * Records gives its person's name the keyboard the same way (#1398) — their\n * row's, or on a phone their card's — where the view shows them.\n *\n * The People grids draw the work requirement over the people (#1568): under\n * each band — or once, at the list's head, where they draw no bands — an\n * eyebrow of each day's hours, by month each week's, a lane a shift with a\n * target, each day's hours rostered against needed — by month a mark a day,\n * on the person marks' columns — opening to its skill rows, and an eyebrow\n * before the people; its figures are the Shifts layout's coverage summed over\n * the span in view ({@link demandOf}).\n *\n * @packageDocumentation\n */\nimport { Fragment, createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type KeyboardEvent, type ReactNode, type RefObject } from \"react\";\nimport { Box, Button, Menu as ChakraMenu, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faAngleRight, faCheck, faGripVertical, faRotateLeft, faTriangleExclamation, faUsersSlash, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport { ArrayType, SortedMap, StringType, none, printFor, some, variant } from \"@elaraai/east\";\nimport { FrameMenuLayer, LoadingFailedLine, PlaceholderShape, VirtualRows, devicePixels, useRevealed, useRowsTop, keptRead, type StickySection } from \"@elaraai/east-ui-components/internal\";\nimport { takeKey, tickFormatOf, useDragEventChip, useDropCell, usePersistedState, type CellCoord, type DragEventValue, type DragPayload, type Formatters } from \"@elaraai/east-ui-components\";\nimport type { PeriodRead } from \"../shared/loading.js\";\nimport { MoveGhost, useClassesAhead, useMoveGhostClasses } from \"../shared/schedule/move-ghost.js\";\nimport { GroupHeading, useGroupCollapse } from \"../shared/schedule/group-heading.js\";\nimport { readRowAnchor, useRowAnchor, type RowAnchor } from \"../shared/schedule/row-anchor.js\";\nimport { Seg } from \"../shared/schedule/segments.js\";\nimport { ApplyPatternAction, AssignmentActions, PlaceAction, PlacePopover, RequirementAction } from \"./controls.js\";\nimport { readRosterSource } from \"./identity.js\";\nimport { isPatternCard, rosterCoord, rosterPersonWeekCoord, type RosterDrag } from \"./drag.js\";\nimport type { PatternDay, RosterCommands } from \"./actions.js\";\nimport type { RosterDutyOp, RosterOptimised } from \"./optimise.js\";\nimport { barOf, demandOf, difference, differenceSaid, laneCup, laneMark, looseOf, signed, skillCup, skillMark, skillMet, stated, toneOf, type Demand, type DemandCup, type DemandFigures, type DemandLane, type DemandMark, type DemandSkill, type DemandWeek, type SkillFigures } from \"./demand.js\";\nimport {\n    DAY, NO_GROUP, activityOf, compareSlot, costsOf, groupName, groupOf, groupSkills, hourText, issuesSaid, ownTimes, placeKey, placeOf, samePlace, sameSlot, shiftColor, shiftHoursText,\n    shiftLetter, shiftOf, slotKey, slotOfPlace, weekKey, weekNumber,\n    type Assignment, type Coverage, type Issue, type Pay, type Person, type Place, type PlacedProposal, type RosterDomain, type RosterSpan, type RosterStyles,\n    type RosterValue, type RosterView, type Selection, type Shift, type Slot, type Week, type WeekState,\n} from \"./model.js\";\n\nexport interface RosterViewsProps {\n    value: RosterValue; week: Week; held: Week; start: Date; day: number; view: RosterView; setView: (view: RosterView) => void;\n    /** Whether a duty holds a conflict not yet chosen: its chip, tile and card wear the warn ring. None by default. */\n    conflicted?: ((id: string) => boolean) | undefined;\n    /** Whether a duty's row holds a number its field's bounds don't (#1585): its chip, tile and card wear the warn ring. None by default. */\n    bounded?: ((id: string) => boolean) | undefined;\n    /** The span in view (#1406, D2), and each of its weeks drafts in place: what the month draws, and what a pattern dropped on one applies to. */\n    span: RosterSpan; weeks: readonly WeekState[];\n    /** Opens a week in the Week period (P12, P24). */\n    openWeek: (week: Date) => void;\n    /** Whether the layout in view offers Day, and Week (`viewPeriods`): without it, a heading that would open it is a heading alone. */\n    opensDay: boolean; opensWeek: boolean;\n    styles: RosterStyles; format: Formatters; narrow: boolean; coverage: ReadonlyMap<Slot, Coverage>; hours: ReadonlyMap<string, number>;\n    /**\n     * Each week of the span's coverage, as `weeks` lists them (#1568): what the People layout's work requirement sums —\n     * a week's `coverage`, or each of a month's weeks', its hours alone; none in a month drawing no work requirement.\n     */\n    spanCoverage: readonly ReadonlyMap<Slot, Coverage>[];\n    /** Each duty's cost by the app's codes: none without `pay`. */\n    pay: Pay;\n    /** The duty row type's domain: what a duty unlike the record's is told by. */\n    domain: RosterDomain;\n    issues: readonly Issue[]; proposals: readonly PlacedProposal[]; selection: Selection | undefined; select: (next: Selection | undefined) => void;\n    /** What selects and opens the inspector's view, where a selection alone leaves main in view on a phone: a phone's lane line's press. */\n    inspect: (next: Selection) => void;\n    commands: RosterCommands; drag: RosterDrag; onError: (error: string | undefined) => void;\n    /**\n     * What the views draw of the week's read (#1398): the week as read; a week not read yet — its dates, people, groups\n     * and shifts at once, a placeholder where its content goes, unseen until the frame's reveal says so, never \"Off ·\n     * assign\" nor \"0 / 2 positions\" (CL2, CL13); or one whose read failed — its geometry, the failure said once in its\n     * first row in view (CL11).\n     */\n    read: PeriodRead;\n    /** Where the People rows' and cards' views last rested (#1398): what each comes back to as it mounts. */\n    anchor?: RosterAnchor | undefined;\n    /** Told where a People view rests as its scroll settles. */\n    onAnchor?: ((next: Partial<RosterAnchor>) => void) | undefined;\n    /**\n     * What the runs of the app's optimiser left on the week's duties (#1409, R23): each duty's operation, drawn on its\n     * tile and its chip alike with its provenance on hover, and the people whose hours the latest run changed.\n     */\n    optimised?: RosterOptimised | undefined;\n    /** Whether a run's highlight is on (#1409): a removed duty's tombstone is struck, and the changed people's hours flash. */\n    lit?: boolean | undefined;\n    /** The person the last pick in Search Records gives the keyboard to (#1398): their name in the People view, once. */\n    picked?: PeoplePick | undefined;\n}\n\n/** A pick in Search Records, handing its person the keyboard (#1398): their key, and which pick it is. */\nexport interface PeoplePick {\n    readonly key: string;\n    readonly seq: number;\n}\n\n/** Where the People views rest (#1398): the desktop rows', and the phone's cards', each by its top row's key — brought\n *  back once the rows' floors are measured, so the rows above the one brought back stand where they will. */\nexport interface RosterAnchor {\n    readonly people?: RowAnchor | undefined;\n    readonly cards?: RowAnchor | undefined;\n}\n\n/** Where the People views rest, as storage keeps it. */\nexport const readRosterAnchor = keptRead.record<RosterAnchor>({ people: keptRead.optional(readRowAnchor), cards: keptRead.optional(readRowAnchor) });\n\n/** The person whose name the keyboard last stepped to, or a pick gave it to (#1398): their row's or card's name takes the focus as it mounts. */\nconst PeopleFocusContext = createContext<{ readonly key: string | undefined; readonly done: () => void }>({ key: undefined, done: () => {} });\n\n/**\n * The person a People view gives the keyboard to: whom ↑ / ↓ step to, and whom a pick in Search Records gives it to —\n * each pick once, and only a person the view shows, never one narrowed out or in a folded group; a pick made before the\n * view mounted is not taken (#1398).\n *\n * @param rows - The view's rows\n * @param picked - The last pick\n * @returns The focus the view's names read, and the step the keys take\n */\nfunction usePeopleFocus(rows: readonly PeopleRow[], picked: PeoplePick | undefined): {\n    focus: { readonly key: string | undefined; readonly done: () => void }; stepTo: (key: string) => void;\n} {\n    const [key, setKey] = useState<string>();\n    const focus = useMemo(() => ({ key, done: () => setKey(undefined) }), [key]);\n    const taken = useRef(picked?.seq);\n    useEffect(() => {\n        if (picked === undefined || picked.seq === taken.current) return;\n        taken.current = picked.seq;\n        if (rows.some(row => row.kind === \"person\" && row.person?.key === picked.key)) setKey(picked.key);\n    }, [picked, rows]);\n    return { focus, stepTo: setKey };\n}\n\n/**\n * What a chip and a People row read of the views' props, kept while what they show holds (#1398, CL9): a row, a day\n * and a chip draw again only as theirs changes. The selection is read apart ({@link SelectionContext}), so a pick\n * draws again only the chips it marks.\n */\ninterface ViewContext {\n    readonly value: RosterValue; readonly week: Week; readonly held: Week; readonly start: Date; readonly day: number;\n    readonly styles: RosterStyles; readonly format: Formatters; readonly hours: ReadonlyMap<string, number>; readonly pay: Pay;\n    readonly domain: RosterDomain; readonly issues: readonly Issue[]; readonly commands: RosterCommands; readonly drag: RosterDrag;\n    readonly select: (next: Selection | undefined) => void; readonly inspect: (next: Selection) => void; readonly onError: (error: string | undefined) => void; readonly read: PeriodRead;\n    /** The month's weeks (#1406), and what opens one of them in Week. */\n    readonly weeks: readonly WeekState[]; readonly openWeek: (week: Date) => void; readonly opensWeek: boolean;\n    /** The People layout's display settings (D7): whether a tile shows the shift's hours always, and whether a month's marks carry letters. */\n    readonly tileTimes: \"always\" | \"different\"; readonly letters: boolean;\n    /** Whether a duty holds a conflict not yet chosen. */\n    readonly conflicted: (id: string) => boolean;\n    /** Whether a duty's row holds a number its field's bounds don't. */\n    readonly bounded: (id: string) => boolean;\n    /** What the runs of the optimiser left on the duties (#1409), and whether the highlight is on. */\n    readonly optimised: RosterOptimised | undefined; readonly lit: boolean;\n}\n/** The views' selection, read by what it marks. */\nconst SelectionContext = createContext<Selection | undefined>(undefined);\n\n/**\n * Test-only draw probe: told of each People row and each person's day drawn, by key (#1398, CL9) — what \"a row draws\n * again only as what it shows changes\" is held to. `undefined` outside tests.\n */\nlet peopleDrawProbe: ((part: \"row\" | \"day\", key: string) => void) | undefined;\n/**\n * Install (or clear) the People draw probe. Test use only.\n *\n * @param fn - Told of each row and day drawn; `undefined` clears it\n */\nexport function setPeopleDrawProbe(fn: ((part: \"row\" | \"day\", key: string) => void) | undefined): void { peopleDrawProbe = fn; }\n\n/** No duty holds a conflict. */\nconst NO_CONFLICT = (): boolean => false;\n/** No duty's row breaks its field's bounds. */\nconst NO_BREACH = (): boolean => false;\n\n/** The views' props a chip and a People row read, the same object while each of them holds. */\nfunction useViewContext(props: RosterViewsProps): ViewContext {\n    const { value, week, held, start, day, styles, format, hours, pay, domain, issues, commands, drag, select, inspect, onError, read, weeks, openWeek, opensWeek, optimised } = props;\n    const tileTimes = value.settings.tileTimes.type, letters = value.settings.letters, lit = props.lit === true;\n    const conflicted = props.conflicted ?? NO_CONFLICT, bounded = props.bounded ?? NO_BREACH;\n    return useMemo(() => ({ value, week, held, start, day, styles, format, hours, pay, domain, issues, commands, drag, select, inspect, onError, read, weeks, openWeek, opensWeek, tileTimes, letters, optimised, lit, conflicted, bounded }),\n        [value, week, held, start, day, styles, format, hours, pay, domain, issues, commands, drag, select, inspect, onError, read, weeks, openWeek, opensWeek, tileTimes, letters, optimised, lit, conflicted, bounded]);\n}\n\n/**\n * What a run of the optimiser did to a duty, as its tile or its chip draws it (#1409, R7, R17, §9.5): its add or its\n * change while it is still the run's draft, and its remove on its tombstone for the highlight alone — the tombstone\n * is the Roster's own, restorable after it.\n *\n * @param ctx - The views' context\n * @param id - The duty's key\n * @param removed - Whether the tile or chip is the duty's tombstone\n * @param drafted - Whether the duty is a draft still: an Undo that takes the run back leaves no mark (R17)\n * @returns Its mark and its provenance; `undefined` for a duty no run touched, or one no longer drafted\n */\nfunction dutyMark(ctx: ViewContext, id: string, removed: boolean, drafted: boolean): { op: RosterDutyOp[\"op\"]; provenance: string } | undefined {\n    const op = drafted ? ctx.optimised?.ops.get(id) : undefined;\n    if (op === undefined) return undefined;\n    if (op.op === \"del\") return removed && ctx.lit ? { op: \"del\", provenance: op.provenance } : undefined;\n    return removed ? undefined : { op: op.op, provenance: op.provenance };\n}\n\n/**\n * A placeholder in a slot of the week's content, while the week is not read yet (#1398) — unseen at its footprint until\n * the frame's one reveal clock says so, which it reads itself (CL4); nothing where the week's read failed.\n */\nfunction Unread({ read, kind, index }: { read: PeriodRead; kind: \"chip\" | \"aggregate\" | \"number\" | \"label\"; index: number }) {\n    return read.state === \"pending\" ? <PlaceholderShape kind={kind} index={index} /> : null;\n}\n\n/** The failure said once, in place: the week's words and its Retry (#1398, CL11). */\nfunction ReadFailure({ read }: { read: Extract<PeriodRead, { state: \"failed\" }> }) {\n    return <LoadingFailedLine message={read.message} retry={{ onRetry: read.retry }} />;\n}\n\n/** Each payload's people and agencies by key, made once a payload (#1398, CL9). */\nconst keyedRows = new WeakMap<readonly { readonly key: string }[], ReadonlyMap<string, { readonly key: string }>>();\nfunction keyed<T extends { readonly key: string }>(rows: readonly T[]): ReadonlyMap<string, T> {\n    let map = keyedRows.get(rows);\n    if (map === undefined) {\n        map = new Map(rows.map(row => [row.key, row] as const));\n        keyedRows.set(rows, map);\n    }\n    return map as ReadonlyMap<string, T>;\n}\n/**\n * A person of the payload, by key: found in the payload's people indexed once, never by a search of every person\n * (#1398, CL9).\n *\n * @param value - The payload\n * @param key - The person's key\n * @returns The person; `undefined` for a key the payload does not hold\n */\nexport function personOf(value: Pick<RosterValue, \"people\">, key: string): Person | undefined { return keyed(value.people).get(key); }\nfunction agencyOf(value: Pick<RosterValue, \"agencies\">, key: string): RosterValue[\"agencies\"][number] | undefined { return keyed(value.agencies).get(key); }\nexport function assignmentName(value: RosterValue, a: Assignment): string {\n    return a.who.type === \"person\" ? personOf(value, a.who.value)?.name ?? a.who.value\n        : `Requested · ${agencyOf(value, a.who.value)?.name ?? a.who.value}`;\n}\n/** A cost in the Roster's currency, through the shared money formatter: compact where it heads a column, exact where it stands alone. */\nexport function money(format: Formatters, value: RosterValue, amount: number, compact = true): string {\n    return value.currency.type === \"some\" ? format.value(amount, tickFormatOf(variant(\"currency\", { code: value.currency.value, compact }))) : format.number(amount);\n}\n/** Whether the Roster shows costs: only with the app's pay (§5.6). */\nexport function costed(value: RosterValue): boolean { return value.pay.type === \"some\"; }\n\nconst NO_ISSUES: readonly Issue[] = [];\n/** The week's issues by the duty each names, indexed once a week's issues (#1398, CL9). */\nconst issuesByDuty = new WeakMap<readonly Issue[], ReadonlyMap<string, readonly Issue[]>>();\n/**\n * The issues naming a duty.\n *\n * @param issues - The week's issues\n * @param id - The duty's key\n * @returns Its issues, in the week's order\n */\nfunction dutyIssues(issues: readonly Issue[], id: string): readonly Issue[] {\n    let by = issuesByDuty.get(issues);\n    if (by === undefined) {\n        const map = new Map<string, Issue[]>();\n        for (const issue of issues) {\n            if (issue.assignment.type !== \"some\") continue;\n            const list = map.get(issue.assignment.value);\n            if (list === undefined) map.set(issue.assignment.value, [issue]);\n            else list.push(issue);\n        }\n        by = map;\n        issuesByDuty.set(issues, by);\n    }\n    return by.get(id) ?? NO_ISSUES;\n}\n\nfunction visible(value: RosterValue, a: Assignment) { return a.who.type === \"request\" || value.visiblePeople.type === \"none\" || value.visiblePeople.value.has(a.who.value); }\nfunction selectedSlot(selection: Selection | undefined, slot: Slot) { return (selection?.type === \"slot\" || selection?.type === \"requirement\") && sameSlot(selection.slot, slot); }\nfunction matchingAssignments(props: RosterViewsProps, matches: (a: Assignment) => boolean) {\n    const rows = [...props.week.assignments].filter(([, a]) => matches(a)).map(([id, a]) => ({ id, a, removed: false }));\n    for (const [id, a] of props.held.assignments) if (!props.week.assignments.has(id) && matches(a)) rows.push({ id, a, removed: true });\n    return rows;\n}\n/** The duties standing in a place — a group's slot, or a shift's day in no group (#1548) — leads first, requests last. */\nfunction assignments(props: RosterViewsProps, place: Place) {\n    const rows = matchingAssignments(props, a => samePlace(a.place, place) && visible(props.value, a));\n    const rank = (a: Assignment) => a.who.type === \"request\" ? 1000 : personOf(props.value, a.who.value)?.agency ? 999 : props.value.positions.find(p => p.key === a.position)?.lead ? props.value.positions.findIndex(p => p.key === a.position) : props.value.positions.length;\n    return rows.sort((a, b) => rank(a.a) - rank(b.a));\n}\n\n/** A duty in a person's day, or a group's requests' day: the week's, or one the draft removed. */\ninterface DayDuty { readonly id: string; readonly a: Assignment; readonly removed: boolean }\n/** A person's week, or a group's requests': each day's duties, the week's first, then those the draft removed. */\ntype WeekDays = readonly (readonly DayDuty[])[];\nconst NO_DUTIES: readonly DayDuty[] = [];\nconst NO_DAYS: WeekDays = Array.from({ length: 7 }, () => NO_DUTIES);\n/** The week's duties as the People rows read them (#1398, CL9). */\ninterface PeopleIndex {\n    /** Each person's week, by their key. */\n    readonly person: ReadonlyMap<string, WeekDays>;\n    /** Each group's agency requests' week, by the group's key — those in no group yet under {@link NO_GROUP} (#1548). */\n    readonly requests: ReadonlyMap<string, WeekDays>;\n    /** Each group's agency requests in the week's order, then those the draft removed: what a phone's requests card lists. */\n    readonly requestList: ReadonlyMap<string, readonly DayDuty[]>;\n    /** Every group's agency requests' week: the one row of them where the layout draws no bands (#1567). */\n    readonly allRequests: WeekDays;\n    /** Every group's agency requests in the week's order, then those the draft removed: that row's phone card's. */\n    readonly allRequestList: readonly DayDuty[];\n    /** Each person's duties in the week as drafted, by their key: what their week's cost totals. */\n    readonly duties: ReadonlyMap<string, readonly string[]>;\n}\n/**\n * The week's duties indexed once, by person and by day — each group's requests by day, and every group's together —\n * never scanned a row at a time (#1398, CL9).\n *\n * @param week - The week as drafted\n * @param held - The week as the records hold it: what a draft removed shows from\n * @returns The index\n */\nfunction peopleIndex(week: Week, held: Week): PeopleIndex {\n    const person = new Map<string, DayDuty[][]>();\n    const requests = new Map<string, DayDuty[][]>();\n    const requestList = new Map<string, DayDuty[]>();\n    const allRequests: DayDuty[][] = Array.from({ length: 7 }, () => []);\n    const allRequestList: DayDuty[] = [];\n    const duties = new Map<string, string[]>();\n    const add = (id: string, a: Assignment, removed: boolean) => {\n        const day = Number(a.place.day);\n        if (day < 0 || day > 6) return;\n        const into = a.who.type === \"person\" ? person : requests;\n        const key = a.who.type === \"person\" ? a.who.value : groupOf(a) ?? NO_GROUP;\n        let days = into.get(key);\n        if (days === undefined) {\n            days = Array.from({ length: 7 }, () => []);\n            into.set(key, days);\n        }\n        const duty = { id, a, removed };\n        days[day]!.push(duty);\n        if (a.who.type === \"person\") return;\n        allRequests[day]!.push(duty);\n        allRequestList.push(duty);\n        const list = requestList.get(key);\n        if (list === undefined) requestList.set(key, [duty]);\n        else list.push(duty);\n    };\n    for (const [id, a] of week.assignments) {\n        add(id, a, false);\n        if (a.who.type !== \"person\") continue;\n        const keys = duties.get(a.who.value);\n        if (keys === undefined) duties.set(a.who.value, [id]);\n        else keys.push(id);\n    }\n    for (const [id, a] of held.assignments) if (!week.assignments.has(id)) add(id, a, true);\n    return { person, requests, requestList, allRequests, allRequestList, duties };\n}\n/** A row of agency requests' week: its group's, or every group's where the row stands for them all (#1567). */\nfunction requestDays(index: PeopleIndex, group: Group | undefined): WeekDays | undefined {\n    return group === undefined ? index.allRequests : index.requests.get(group.key);\n}\n\n/**\n * The same coverage bar and skill lines appear in a day cell and the inspector. A sum of several slots' coverage — a\n * shift's day across the groups — is given what its slots are short, each slot's own (K4): its difference and its bar's\n * open part say that, never their net; a slot's own is what it is short.\n */\nexport function CoverageView({ coverage: c, value, styles, format, compact = false, short: given }: {\n    coverage: Coverage; value: RosterValue; styles: RosterStyles; format: Formatters; compact?: boolean;\n    /** What the slots summed are short, each slot's own; by default, what the one slot is short. */\n    short?: number;\n}) {\n    const short = given ?? Math.max(0, -difference(c.hours.rostered, c.hours.needed));\n    const bar = barOf(c.hours, short), d = stated(c.hours.rostered, c.hours.needed, short);\n    if (c.hours.needed === 0 && c.hours.rostered === 0) return <Box css={styles.empty}>No work · no hours targeted</Box>;\n    return <>\n        <Box css={styles.coverageHead}><Box as=\"span\" css={styles.metric}>{format.number(c.hours.needed)} h</Box><Box as=\"span\" css={styles.detail}>needed</Box>\n            <Box as=\"span\" css={styles.metric}>{format.number(c.hours.rostered)} h</Box><Box as=\"span\" css={styles.detail}>rostered</Box>\n            <Box as=\"span\" css={styles.delta} data-roster-coverage-delta=\"\" data-tone={d < 0 ? \"warning\" : undefined}>{signed(format.number, d, \"+0\")} h</Box></Box>\n        <Box css={styles.coverageBar} role=\"img\" aria-label={`${format.number(c.hours.rostered)} hours rostered of ${format.number(c.hours.needed)} needed`}>\n            {bar.parts.map(part => <Box key={part.kind} css={styles.coverageSegment} data-kind={part.kind} style={{ left: `${part.left / bar.scale * 100}%`, width: `${part.width / bar.scale * 100}%` }} />)}\n            <Box css={styles.coverageTick} style={{ left: `${c.hours.needed / bar.scale * 100}%` }} />\n        </Box>\n        <Box css={styles.detail}>{bar.parts.filter(p => p.kind !== \"open\").map(p => `${format.number(p.width)} ${p.kind === \"permanent\" ? value.vocabulary.permanentShort : p.kind === \"agency\" ? value.vocabulary.agencyShort : p.kind}`).join(\" · \") || \"Nothing rostered\"} h{costed(value) && ` · ${money(format, value, c.cost)}`}</Box>\n        {!compact && c.lines.map(line => { const activity = activityOf(value, line.skill); return <Box key={line.skill} css={styles.coverageLine} data-roster-coverage-line=\"\" data-tone={line.gap > 0 ? \"warning\" : line.assigned >= line.needed ? \"success\" : undefined}\n            title={`${activity?.label ?? line.skill} · ${format.number(line.assigned)} h assigned of ${format.number(line.needed)} h needed${line.capacity.type === \"some\" ? ` · ${format.number(line.capacity.value)} h capacity` : \"\"}`}>\n            <Box as=\"span\" css={styles.coverageName} data-roster-coverage-name=\"\">{activity?.code && <Box as=\"span\" css={styles.skillCode}>{activity.code}</Box>}{activity?.label ?? line.skill}</Box>\n            <Box as=\"span\" css={styles.coverageFigures} data-roster-coverage-figures=\"\"><Box as=\"span\" css={styles.skillCode}>{line.holders.type === \"some\" ? `${line.holders.value}/${c.people}` : \"—\"}</Box><span>{format.number(line.assigned)} / {format.number(line.needed)}</span></Box>\n        </Box>; })}\n    </>;\n}\ninterface AssignmentChipProps { ctx: ViewContext; id: string; assignment: Assignment; removed: boolean; short?: boolean }\n/** Keep the shared drag hooks outside the chip body: pointer motion does not repaint its contents. */\nfunction AssignmentChip(args: AssignmentChipProps) {\n    const { ctx, id, assignment: a, removed } = args;\n    const { styles, value, drag } = ctx;\n    const selection = useContext(SelectionContext);\n    const selected = selection?.type === \"assignment\" && selection.key === id;\n    const name = assignmentName(value, a);\n    const coord = useMemo(() => ({ ...rosterCoord(drag.surface, a.place, id), event: id }), [drag.surface, a.place, id]);\n    const ghost = useMemo(() => <MoveGhost styles={styles} label={name} />, [styles, name]);\n    const enabled = drag.enabled && !removed && ctx.commands.availableOn(a.place.day);\n    const handle = useDragEventChip(enabled ? coord : null, ghost, !enabled, name);\n    const canDrop = useCallback((event: DragEventValue) => drag.run(event, true) === undefined, [drag]);\n    const drop = useDropCell(enabled ? coord : null, !enabled, canDrop, undefined, { caption: drag.caption, name: drag.name });\n    const dragRef = handle?.ref;\n    const attach = useCallback((element: HTMLDivElement | null) => { dragRef?.(element); drop(element); }, [dragRef, drop]);\n    return <AssignmentChipBody {...args} selected={selected} handle={handle} attach={attach} />;\n}\n/** Chip state comes from the held week and the domain issues, never from a second draft store. */\nconst AssignmentChipBody = memo(function AssignmentChipBody({ ctx, id, assignment: a, removed, short = false, selected, handle, attach }: AssignmentChipProps & {\n    selected: boolean; handle: ReturnType<typeof useDragEventChip>; attach: (element: HTMLDivElement | null) => void;\n}) {\n    const { styles, value, commands, drag } = ctx;\n    const name = assignmentName(value, a);\n    const enabled = drag.enabled && !removed && ctx.commands.availableOn(a.place.day);\n    const person = a.who.type === \"person\" ? personOf(value, a.who.value) : undefined;\n    // An agency person's duty, or a request: its badge the app's short word for agency staff (#1566).\n    const agency = a.who.type === \"request\" || person?.agency === true;\n    const position = value.positions.find(p => p.key === a.position);\n    const issues = removed ? NO_ISSUES : dutyIssues(ctx.issues, id);\n    const activity = a.activity.type === \"some\" ? activityOf(value, a.activity.value) : undefined;\n    const baseline = ctx.held.assignments.get(id);\n    const drafted = removed || baseline === undefined || !ctx.domain.sameAssignment(baseline, a);\n    const times = `${ctx.format.time(a.start)}–${ctx.format.time(a.end)}`;\n    // A duty in no group yet is held to its person's home group's skills (#1548): where the shift's day takes them.\n    const group = groupOf(a);\n    const skills = groupSkills(value, group ?? person?.group ?? NO_GROUP);\n    const label = `${name} · ${times}${removed ? \" · removed\" : \"\"}`;\n    // What a run of the optimiser did to the duty (#1409): its mark, and its provenance on hover.\n    const mark = dutyMark(ctx, id, removed, drafted);\n    return <Box {...handle} ref={attach} css={styles.assignment} tabIndex={0} role=\"button\" aria-label={label} title={mark === undefined ? label : `${mark.provenance} · ${label}`} aria-pressed={selected}\n        data-roster-assignment={id} data-layout={short ? \"people\" : \"shifts\"} data-added={baseline === undefined ? \"\" : undefined} data-moved={baseline !== undefined && !samePlace(baseline.place, a.place) ? \"\" : undefined} data-density={value.settings.density.type} data-selected={selected ? \"\" : undefined}\n        data-drafted={drafted ? \"\" : undefined} data-conflict={ctx.conflicted(id) ? \"\" : undefined} data-bounds={ctx.bounded(id) ? \"\" : undefined} data-removed={removed ? \"\" : undefined} data-request={a.who.type === \"request\" ? \"\" : undefined} data-agency={person?.agency ? \"\" : undefined}\n        data-op={mark?.op} data-fill={mark === undefined ? undefined : \"own\"}\n        data-tone={issues.some(i => i.tone.type === \"danger\") ? \"danger\" : issues.some(i => i.kind.type === \"breach\") ? \"warning\" : undefined} data-draggable={enabled ? \"\" : undefined}\n        onClick={event => { event.stopPropagation(); ctx.select({ type: \"assignment\", key: id }); }} onKeyDown={event => { if (event.key === \"Enter\") { takeKey(event); ctx.select({ type: \"assignment\", key: id }); } else handle?.onKeyDown?.(event); }}>\n        {enabled && <Box as=\"span\" css={styles.grip} data-roster-grip=\"\"><FontAwesomeIcon icon={faGripVertical} /></Box>}\n        <Box as=\"span\" css={styles.badge} data-lead={position?.lead ? \"\" : undefined} data-roster-agency-badge={agency ? \"\" : undefined}>{agency ? value.vocabulary.agencyShort : position?.code || (person?.trainer ? \"T\" : \"\")}</Box>\n        <Box css={styles.assignmentName} data-roster-assignment-name=\"\">{short ? `${value.shifts.find(s => s.key === a.place.shift)?.code ?? a.place.shift}${person?.group !== (group ?? NO_GROUP) ? ` · ${groupName(value, a.place.group)}` : \"\"}` : name}</Box>\n        {issues.filter(i => i.flag.type === \"some\").map((i, n) => <Box as=\"span\" key={n} css={styles.flag} data-tone={i.tone.type}>{i.flag.type === \"some\" && i.flag.value}</Box>)}\n        {/* A duty's own times, where they differ from its shift's (§5.5, rule 2): just times, no name and no worth. */}\n        {ownTimes(value, a, ctx.start) && <Box as=\"span\" css={styles.flag} data-roster-times=\"\">{times}</Box>}\n        {person !== undefined && !short && <><Box as=\"span\" css={styles.activity} data-empty={activity === undefined ? \"\" : undefined} title={activity?.label ?? \"No activity\"}>{activity?.code ?? \"·\"}</Box>{activity !== undefined && commands.availableOn(a.place.day) && !removed && <chakra.button type=\"button\" css={styles.chipAction} data-roster-chip-action=\"\" aria-label={`Clear activity for ${name}`} onPointerDown={e => e.stopPropagation()} onClick={e => { e.stopPropagation(); ctx.onError(commands.activity(id, none)); }}><FontAwesomeIcon icon={faXmark} /></chakra.button>}\n            <Box as=\"span\" css={styles.fit}>{value.settings.chipSkills ? `${skills.filter(s => person.skills.has(s.key)).length}/${skills.length}` : `${ctx.format.number(ctx.hours.get(person.key) ?? 0)}h`}</Box></>}\n        {(commands.availableOn(a.place.day) || commands.locked !== undefined) && <chakra.button type=\"button\" css={styles.chipAction} data-roster-chip-action=\"\" aria-label={removed ? `Restore ${name}` : `Remove ${name}`}\n            disabled={commands.locked !== undefined} title={commands.locked}\n            onPointerDown={event => event.stopPropagation()} onClick={event => { event.stopPropagation(); if (removed) commands.restore(id); else commands.remove(id); }}><FontAwesomeIcon icon={removed ? faRotateLeft : faXmark} /></chakra.button>}\n    </Box>;\n});\n/**\n * A cell's name for the place it stands for (#1548): a group's slot is its `data-roster-slot`, a shift's day in no group\n * its `data-roster-place` — each East's print of it.\n */\nfunction placeData(place: Place): { \"data-roster-slot\"?: string; \"data-roster-place\"?: string } {\n    const slot = slotOfPlace(place);\n    return slot === undefined ? { \"data-roster-place\": placeKey(place) } : { \"data-roster-slot\": slotKey(slot) };\n}\n/**\n * A cell a drop lands in: a group's slot, or a shift's day in No group's band (#1548). No hook in the mobile branch\n * registers a drag source or target.\n */\nfunction DropSlot({ props, place, children, compact = false }: { props: RosterViewsProps; place: Place; children: ReactNode; compact?: boolean }) {\n    const ref = useRef<HTMLDivElement>(null);\n    const [landing, setLanding] = useState<ReturnType<RosterDrag[\"preview\"]>>();\n    const drop = useDropCell(props.drag.enabled ? rosterCoord(props.drag.surface, place) : null, !props.drag.enabled,\n        event => props.drag.run(event, true) === undefined, undefined, { caption: props.drag.caption, name: props.drag.name,\n            onHover: (_x, _y, payload) => setLanding(props.drag.preview(rosterCoord(props.drag.surface, place), payload, true)) });\n    const attach = useCallback((element: HTMLDivElement | null) => { ref.current = element; drop(element); }, [drop]);\n    // A group's slot is selected as one; No group's cells select nothing.\n    const slot = useMemo(() => slotOfPlace(place), [place]);\n    // The shared target subscription can change on pointer motion; its body need not.\n    return useMemo(() => <Box ref={attach} css={compact ? props.styles.weekCell : props.styles.cell} {...placeData(place)} data-selected={slot !== undefined && selectedSlot(props.selection, slot) ? \"\" : undefined} data-roster-landing-tone={landing?.tone} title={compact ? landing?.label : undefined}>\n        {children}{!compact && landing !== undefined && <Box css={props.styles.landing} data-roster-landing=\"\" data-tone={landing.tone}>{landing.label}</Box>}\n    </Box>, [attach, compact, props, place, slot, landing, children]);\n}\n/** A desktop proposal is the mock's quiet inline chip; phones retain labelled actions. */\nexport function ProposalCard({ props, proposal }: { props: RosterViewsProps; proposal: PlacedProposal }) {\n    const name = personOf(props.value, proposal.person)?.name ?? proposal.person;\n    const { styles } = props;\n    const select = () => props.select({ type: \"proposal\", key: proposal.key });\n    const accept = () => props.onError(props.commands.accept(proposal.key));\n    const reject = () => props.commands.reject(proposal.key);\n    const mark = <Box as=\"span\" css={[styles.badge, styles.proposalMark]}>Model</Box>;\n    const title = <chakra.button type=\"button\" css={[styles.assignmentName, styles.proposalName]} onClick={select}>{name}</chakra.button>;\n    const selected = props.selection?.type === \"proposal\" && props.selection.key === proposal.key;\n    // While a run of the optimiser holds the week (#1409, R2) the actions stay in place, inert.\n    const locked = props.commands.locked !== undefined;\n    if (props.narrow) return <Box css={styles.card} data-roster-proposal={proposal.key} data-selected={selected ? \"\" : undefined}>\n        <Box css={styles.actions}>{mark}{title}</Box><Box css={styles.detail}>{proposal.reason}</Box>\n        {(props.commands.availableOn(proposal.slot.day) || locked) && <Box css={styles.actions}><Button size=\"xs\" variant=\"outline\" disabled={locked} title={props.commands.locked} onClick={accept}>Accept</Button>{dismissible(props.value) && <Button size=\"xs\" variant=\"ghost\" disabled={locked} title={props.commands.locked} onClick={reject}>Reject</Button>}</Box>}\n    </Box>;\n    const open = (props.coverage.get(proposal.slot)?.open ?? 0n) > 0n;\n    const shift = props.value.shifts.find(s => s.key === proposal.slot.shift);\n    return <Box css={[styles.assignment, styles.proposal]} data-roster-proposal={proposal.key} data-selected={selected ? \"\" : undefined} data-density={props.value.settings.density.type} title={`Model proposal · ${proposal.reason}`}>\n        {mark}{title}<Box as=\"span\" css={[styles.detail, styles.proposalReason]}>{open ? \"fills open\" : `+${props.format.number(shift?.hours ?? 0)} h`}</Box>\n        {(props.commands.availableOn(proposal.slot.day) || locked) && <>\n            <chakra.button type=\"button\" css={[styles.chipAction, styles.proposalAction]} data-accept=\"\" aria-label={`Accept proposal for ${name}`} title={props.commands.locked ?? \"Accept proposal\"} disabled={locked} onClick={accept}><FontAwesomeIcon icon={faCheck} /></chakra.button>\n            {dismissible(props.value) && <chakra.button type=\"button\" css={[styles.chipAction, styles.proposalAction]} aria-label={`Reject proposal for ${name}`} title={props.commands.locked ?? \"Reject proposal\"} disabled={locked} onClick={reject}><FontAwesomeIcon icon={faXmark} /></chakra.button>}\n        </>}\n    </Box>;\n}\n/** Whether the week keeps the suggestions it rejects: without a record to keep them, a suggestion is only accepted (§5.2). */\nexport function dismissible(value: RosterValue): boolean { return value.periods.type === \"some\" && value.periods.value.dismissible; }\nfunction SlotActions({ props, slot }: { props: RosterViewsProps; slot: Slot }) {\n    // While a run of the optimiser holds the week (#1409, R2) the actions stay in place, inert.\n    const locked = props.commands.locked !== undefined;\n    if (!props.commands.availableOn(slot.day) && !locked) return null;\n    const place = placeOf(slot);\n    return <Box css={props.styles.actions}><PlaceAction label=\"Assign person\" place={place} value={props.value} start={props.start} commands={props.commands} styles={props.styles} />\n        {props.value.agencies.map(agency => <Button key={agency.key} size=\"xs\" variant=\"outline\" disabled={locked} title={props.commands.locked} onClick={() => props.onError(props.commands.place({ type: \"agency\", key: agency.key }, place))}>Request {agency.name}</Button>)}\n    </Box>;\n}\nfunction DayAssignments({ props, ctx, slot }: { props: RosterViewsProps; ctx: ViewContext; slot: Slot }) {\n    const c = props.coverage.get(slot)!;\n    const issues = props.issues.filter(i => i.slot.type === \"some\" && sameSlot(i.slot.value, slot) && (i.kind.type === \"gap\" || i.kind.type === \"breach\"));\n    const place = placeOf(slot);\n    return <DropSlot props={props} place={place}>\n        <chakra.button type=\"button\" css={props.styles.cellHead} data-open={c.open > 0n ? \"\" : undefined} onClick={() => props.select({ type: \"slot\", slot })}>{String(c.filled)} / {String(c.positions)} positions{issues.length > 0 && ` · ${issuesSaid(issues.length)}`}</chakra.button>\n        <Box css={props.styles.chips}>{assignments(props, place).map(({ id, a, removed }) => <AssignmentChip key={id} id={id} assignment={a} removed={removed} ctx={ctx} />)}</Box>\n        {props.proposals.filter(p => sameSlot(p.slot, slot) && (props.value.visiblePeople.type === \"none\" || props.value.visiblePeople.value.has(p.person))).map(p => <ProposalCard key={p.key} props={props} proposal={p} />)}\n        {c.open > 0n && <Box css={props.styles.openPosition}>{String(c.open)} open position{c.open === 1n ? \"\" : \"s\"}</Box>}\n        <Box css={props.styles.dropStrip}><SlotActions props={props} slot={slot} />{!props.value.inspector && <RequirementAction slot={slot} week={props.week} held={props.held} value={props.value} commands={props.commands} styles={props.styles} />}</Box>\n    </DropSlot>;\n}\n/**\n * A shifts row of a week not read, or whose read failed (#1398): its head as drawn, and in each slot a placeholder where\n * its figures or its duties go, never a count it has not read — or, in the row the failure is said in, one line across\n * every slot.\n */\nfunction UnreadSlots({ props, head, columns, group, kind, failure, cell }: {\n    props: RosterViewsProps; head: ReactNode; columns: readonly { day: number; shift: RosterValue[\"shifts\"][number] }[];\n    /** The row's group: a group's, or none for No group's band (#1548). */\n    group: Place[\"group\"];\n    kind: \"chip\" | \"number\" | \"aggregate\"; failure: Extract<PeriodRead, { state: \"failed\" }> | undefined; cell: Record<string, unknown> | undefined;\n}) {\n    return <Box css={props.styles.row} data-roster-unread=\"\">{head}\n        {failure !== undefined ? <Box css={props.styles.readLine} data-roster-read-line=\"\"><ReadFailure read={failure} /></Box>\n            : columns.map(({ day, shift }, c) => {\n                const place: Place = { day: BigInt(day), group, shift: shift.key };\n                return <Box key={placeKey(place)} css={cell} {...placeData(place)}><Unread read={props.read} kind={kind} index={c} /></Box>;\n            })}\n    </Box>;\n}\n/** The columns of the Shifts layout: a shift a day in view. */\ntype ShiftColumns = readonly { day: number; shift: Shift }[];\n/**\n * The Shifts layout's No group band (#1548): the duties of a kind that takes no group standing in none yet, a cell a\n * shift's day, after the groups — drawn whenever the kind takes no group, so a duty dragged out of its group has a place\n * to go. It holds no target and no positions: its band says the hours rostered there, and its cells have no head and no\n * actions — by day each holds its duties' chips, by week their count. A duty dropped in one stands in no group, and one\n * dragged from it into a group's slot stands in that group.\n */\nfunction NoGroupBand({ props, ctx, days, columns, collapsed, toggle, failure }: {\n    props: RosterViewsProps; ctx: ViewContext; days: readonly number[]; columns: ShiftColumns; collapsed: boolean; toggle: (group: string) => void;\n    /** The failure, where the band's row is the one it is said in. */\n    failure: Extract<PeriodRead, { state: \"failed\" }> | undefined;\n}) {\n    const { value, styles, format, read } = props;\n    const band = useMemo(() => ({ key: NO_GROUP, label: value.vocabulary.noGroup }), [value.vocabulary.noGroup]);\n    const unread = read.state !== \"held\";\n    // The days in view's duties in no group, whoever the rail shows: what the band's hours and the week's counts count.\n    const duties = [...props.week.assignments.values()].filter(a => a.place.group.type === \"none\" && days.includes(Number(a.place.day)));\n    const rostered = duties.reduce((n, a) => n + a.hours, 0);\n    const people = duties.filter(a => a.who.type === \"person\").length;\n    const head = <Box css={[styles.gutter, styles.rowHead]} data-roster-no-group-head=\"\"><Box css={styles.eyebrow}>Assignment</Box><Box css={styles.title}>Roster</Box>\n        <Box css={styles.detail}>{unread ? <Unread read={read} kind=\"aggregate\" index={1} /> : peopleSaid(format.number, people)}</Box><Box css={styles.detail}>{unread ? null : `${format.number(rostered)} h`}</Box></Box>;\n    const week = days.length > 1;\n    if (unread) return <>\n        <GroupHeading scope=\"roster\" group={band} styles={styles} collapsed={collapsed} toggle={toggle}><Box as=\"span\" css={styles.groupMeta}><Unread read={read} kind=\"aggregate\" index={2} /></Box></GroupHeading>\n        {!collapsed && <UnreadSlots props={props} head={head} columns={columns} group={none} kind={week ? \"number\" : \"chip\"} failure={failure} cell={week ? styles.weekCell : styles.cell} />}\n    </>;\n    return <>\n        <GroupHeading scope=\"roster\" group={band} styles={styles} collapsed={collapsed} toggle={toggle}><Box as=\"span\" css={styles.groupMeta}>{format.number(rostered)} h rostered</Box></GroupHeading>\n        {!collapsed && <Box css={styles.row}>{head}\n            {columns.map(({ day, shift }) => {\n                const place: Place = { day: BigInt(day), group: none, shift: shift.key };\n                if (!week) return <DropSlot key={placeKey(place)} props={props} place={place}>\n                    <Box css={styles.chips}>{assignments(props, place).map(({ id, a, removed }) => <AssignmentChip key={id} id={id} assignment={a} removed={removed} ctx={ctx} />)}</Box>\n                </DropSlot>;\n                const count = duties.filter(a => Number(a.place.day) === day && a.place.shift === shift.key).length;\n                const date = new Date(props.start.getTime() + day * DAY);\n                const said = `${value.vocabulary.noGroup} ${format.weekday(date)} ${shift.label}, ${format.number(count)} ${count === 1 ? \"duty\" : \"duties\"}`;\n                // A press opens the day; with Day not offered the count is a figure alone.\n                return <DropSlot key={placeKey(place)} props={props} place={place} compact>{props.opensDay\n                    ? <chakra.button type=\"button\" css={styles.weekValue} aria-label={said} onClick={() => props.setView({ ...props.view, period: \"day\", date: date.getTime() })}>{format.number(count)}</chakra.button>\n                    : <Box css={styles.weekValue}>{format.number(count)}</Box>}</DropSlot>;\n            })}\n        </Box>}\n    </>;\n}\nfunction Shifts({ props, ctx }: { props: RosterViewsProps; ctx: ViewContext }) {\n    const { collapsed, toggle } = useGroupCollapse(props.drag.surface);\n    const days = props.view.period === \"week\" ? Array.from({ length: 7 }, (_, d) => d) : [props.day];\n    const columns = days.flatMap(day => props.value.shifts.map(shift => ({ day, shift })));\n    const style = { \"--roster-columns\": columns.length } as CSSProperties;\n    // A week not read, or whose read failed (#1398): the days, shifts and groups, known without it, at once, and a\n    // placeholder where each figure or duty goes; the failure said once, in the first open group's first row — No\n    // group's band's, where every group is folded (#1548).\n    const unread = props.read.state !== \"held\";\n    const noGroup = props.value.duty.roles.noGroup;\n    const failedIn = props.read.state === \"failed\" ? props.value.groups.find(group => !collapsed.includes(group.key))?.key\n        ?? (noGroup && !collapsed.includes(NO_GROUP) ? NO_GROUP : undefined) : undefined;\n    const failure = props.read.state === \"failed\" ? props.read : undefined;\n    return <Box css={props.styles.scroll} data-roster-grid=\"shifts\"><Box css={props.styles.grid} data-period={props.view.period} style={style}>\n        <Box css={props.styles.head}>\n            {props.view.period === \"week\" && <Box css={props.styles.row}><Box css={props.styles.gutter} />{days.map(day => {\n                const heading = { css: props.styles.shiftHead, \"data-roster-column-header\": \"\", style: { gridColumn: `span ${props.value.shifts.length}` }, \"data-week\": \"\", \"data-selected\": props.day === day ? \"\" : undefined };\n                const label = <Box css={props.styles.shiftLabel}>{props.format.weekday(new Date(props.start.getTime() + day * DAY))} {new Date(props.start.getTime() + day * DAY).getUTCDate()}</Box>;\n                // A press opens the day; with Day not offered it is a heading alone.\n                return props.opensDay ? <chakra.button type=\"button\" key={day} {...heading} onClick={() => props.setView({ ...props.view, period: \"day\", date: props.start.getTime() + day * DAY })}>{label}</chakra.button> : <Box key={day} {...heading}>{label}</Box>;\n            })}</Box>}\n            <Box css={props.styles.row}><Box css={[props.styles.gutter, props.styles.headerGutter]} data-week={days.length > 1 ? \"\" : undefined}><Box css={props.styles.shiftLabel}>Groups</Box><Box css={props.styles.detail}>{props.value.shifts.length} shifts</Box></Box>\n                {columns.map(({ day, shift }) => { const at = props.start.getTime() + day * DAY + (Number(shift.start.hour) * 60 + Number(shift.start.minute)) * 60_000; const rows = [...props.coverage].filter(([slot]) => Number(slot.day) === day && slot.shift === shift.key).map(([, c]) => c); return <chakra.button type=\"button\" key={`${day}.${shift.key}`} css={props.styles.shiftHead} data-roster-column-header=\"\" data-week={days.length > 1 ? \"\" : undefined} onClick={() => props.select({ type: \"shift\", key: shift.key })}>\n                    <Box css={props.styles.shiftHeading}><Box css={props.styles.shiftLabel}>{days.length > 1 ? shift.code : shift.label}</Box>{days.length === 1 && <Box css={props.styles.time}>{props.format.time(new Date(at))}–{props.format.time(new Date(at + shift.hours * 3_600_000))}</Box>}</Box>{days.length === 1 && <Box css={props.styles.shiftMeta}>{unread ? <Unread read={props.read} kind=\"aggregate\" index={0} /> : <>{props.format.number(rows.reduce((n, c) => n + c.filled, 0n))} / {props.format.number(rows.reduce((n, c) => n + c.positions, 0n))} positions · {props.format.number(rows.reduce((n, c) => n + c.hours.needed, 0))} h needed{costed(props.value) && ` · ${money(props.format, props.value, rows.reduce((n, c) => n + c.cost, 0))}`}</>}</Box>}\n                </chakra.button>; })}</Box>\n        </Box>\n        {props.value.groups.map(group => { const coverage = [...props.coverage].filter(([slot]) => slot.group === group.key && days.includes(Number(slot.day))).map(([, c]) => c);\n            const issues = props.issues.filter(i => i.slot.type === \"some\" && i.slot.value.group === group.key && days.includes(Number(i.slot.value.day)) && (i.kind.type === \"breach\" || i.kind.type === \"gap\"));\n            const needed = coverage.reduce((n, c) => n + c.hours.needed, 0), rostered = coverage.reduce((n, c) => n + c.hours.rostered, 0);\n            const requirementHead = <chakra.button type=\"button\" css={[props.styles.gutter, props.styles.rowHead]} onClick={() => props.select({ type: \"group\", key: group.key })}><Box css={props.styles.eyebrow}>Requirement</Box><Box css={props.styles.title}>Work</Box><Box css={props.styles.detail}>hours by skill</Box><Box css={props.styles.detail}>{unread ? <Unread read={props.read} kind=\"aggregate\" index={0} /> : `${props.format.number(needed)} h needed`}</Box></chakra.button>;\n            const assignmentHead = <chakra.button type=\"button\" css={[props.styles.gutter, props.styles.rowHead]} onClick={() => props.select({ type: \"group\", key: group.key })}><Box css={props.styles.eyebrow}>Assignment</Box><Box css={props.styles.title}>Roster</Box><Box css={props.styles.detail}>{unread ? <Unread read={props.read} kind=\"aggregate\" index={1} /> : peopleSaid(props.format.number, Number(coverage.reduce((n, c) => n + c.people, 0n)))}</Box><Box css={props.styles.detail}>{unread ? null : `${props.format.number(rostered)} h`}</Box></chakra.button>;\n            if (unread) {\n                // The group's band and its rows' heads as drawn; a placeholder where each figure goes, and in each slot.\n                const failing = failedIn === group.key ? failure : undefined;\n                return <Fragment key={group.key}><GroupHeading scope=\"roster\" group={group} styles={props.styles} collapsed={collapsed.includes(group.key)} toggle={toggle}><Box as=\"span\" css={props.styles.groupMeta}><Unread read={props.read} kind=\"aggregate\" index={2} /></Box></GroupHeading>\n                    {!collapsed.includes(group.key) && <>\n                        {props.value.settings.requirements && <UnreadSlots props={props} head={requirementHead} columns={columns} group={some(group.key)} kind={days.length > 1 ? \"number\" : \"aggregate\"} failure={failing}\n                            cell={days.length > 1 ? props.styles.weekCell : props.styles.requirement} />}\n                        <UnreadSlots props={props} head={assignmentHead} columns={columns} group={some(group.key)} kind={days.length > 1 ? \"number\" : \"chip\"}\n                            failure={props.value.settings.requirements ? undefined : failing} cell={days.length > 1 ? props.styles.weekCell : props.styles.cell} />\n                    </>}</Fragment>;\n            }\n            return <Fragment key={group.key}><GroupHeading scope=\"roster\" group={group} styles={props.styles} collapsed={collapsed.includes(group.key)} toggle={toggle}><Box as=\"span\" css={props.styles.groupMeta}>{props.format.number(needed)} h needed · {props.format.number(rostered)} h rostered · {signed(props.format.number, difference(rostered, needed), \"+0\")} h{costed(props.value) && ` · ${money(props.format, props.value, coverage.reduce((n, c) => n + c.cost, 0))}`}</Box>{issues.length > 0 && <Box as=\"span\" css={props.styles.flag} data-tone={issues.some(i => i.tone.type === \"danger\") ? \"danger\" : \"warning\"}>{issuesSaid(issues.length)}</Box>}\n            </GroupHeading>{!collapsed.includes(group.key) && <>\n                {props.value.settings.requirements && <Box css={props.styles.row}>{requirementHead}\n                    {columns.map(({ day, shift }) => { const slot = { day: BigInt(day), group: group.key, shift: shift.key }, c = props.coverage.get(slot)!; return <chakra.button type=\"button\" key={slotKey(slot)} css={days.length > 1 ? props.styles.weekCell : props.styles.requirement} data-roster-requirement={slotKey(slot)} onClick={() => { props.select({ type: \"requirement\", slot }); if (days.length > 1) props.setView({ ...props.view, period: \"day\", date: props.start.getTime() + day * DAY }); }}>\n                        {days.length > 1 ? <><Box css={props.styles.weekValue}>{props.format.number(c.hours.needed)}</Box><Box css={props.styles.weekFill}><Box css={props.styles.weekFillValue} style={{ width: `${Math.min(c.hours.rostered / Math.max(c.hours.needed, 1), 1) * 100}%` }} /></Box><Box css={props.styles.weekValue} data-tone={c.hours.rostered < c.hours.needed ? \"warning\" : undefined}>{props.format.number(c.hours.rostered - c.hours.needed)}</Box></> : <CoverageView coverage={c} value={props.value} styles={props.styles} format={props.format} compact={props.value.settings.density.type === \"compact\"} />}\n                    </chakra.button>; })}</Box>}\n                <Box css={props.styles.row}>{assignmentHead}\n                    {columns.map(({ day, shift }) => { const slot = { day: BigInt(day), group: group.key, shift: shift.key }, c = props.coverage.get(slot)!; return days.length === 1 ? <DayAssignments key={slotKey(slot)} props={props} ctx={ctx} slot={slot} />\n                        : <DropSlot key={slotKey(slot)} props={props} place={placeOf(slot)} compact><chakra.button type=\"button\" css={props.styles.weekValue} data-tone={c.open > 0n ? \"warning\" : undefined} aria-label={`${group.label} ${props.format.weekday(new Date(props.start.getTime() + day * DAY))} ${shift.label}, ${c.filled} of ${c.positions} positions`} onClick={() => { props.select({ type: \"slot\", slot }); props.setView({ ...props.view, period: \"day\", date: props.start.getTime() + day * DAY }); }}>{String(c.filled)}/{String(c.positions)}</chakra.button><Box css={props.styles.weekFill}><Box css={props.styles.weekFillValue} style={{ width: `${Math.min(Number(c.filled) / Math.max(Number(c.positions), 1), 1) * 100}%` }} /></Box>{props.issues.some(i => i.slot.type === \"some\" && sameSlot(i.slot.value, slot)) && <Box css={props.styles.issueDot} aria-label=\"Shift has issues\" />}</DropSlot>; })}\n                </Box>\n            </>}</Fragment>;\n        })}\n        {noGroup && <NoGroupBand props={props} ctx={ctx} days={days} columns={columns} collapsed={collapsed.includes(NO_GROUP)} toggle={toggle} failure={failedIn === NO_GROUP ? failure : undefined} />}\n    </Box></Box>;\n}\n/** One of the Roster's groups. */\ntype Group = RosterValue[\"groups\"][number];\n/**\n * The bands the layouts draw a group's under: a band a group, then — where the duty kind takes no group (#1548) — No\n * group's, keyed {@link NO_GROUP} and named in the vocabulary's words.\n */\nfunction bandsOf(groups: readonly Group[], noGroup: string | undefined): readonly Group[] {\n    return noGroup === undefined ? groups : [...groups, { key: NO_GROUP, label: noGroup }];\n}\n/** No group's band's name, where the duty kind takes no group (#1548); `undefined` where every duty stands in one. */\nfunction noGroupBand(value: RosterValue): string | undefined { return value.duty.roles.noGroup ? value.vocabulary.noGroup : undefined; }\n/**\n * A row of the People list: a group's band; a person's row, `group` their home group — the band they are listed under,\n * where the layout draws bands; or a row of agency requests — a group's, or, where the layout draws no bands\n * (`peopleBands`, #1567), every group's in one row at the list's foot, its `group` `undefined`.\n */\ntype ListRow = { kind: \"group\"; key: string; group: Group }\n    | { kind: \"person\"; key: string; group: Group; person: RosterValue[\"people\"][number] }\n    | { kind: \"person\"; key: string; group: Group | undefined; person: undefined };\n/**\n * A row of the work requirement (#1568): its eyebrow under a band (`demand`, A2), a lane a shift (A3), a skill\n * row under an open lane (A4), and the eyebrow before the band's people (`assign`, A5) — a band's, its `group`, or the\n * one block over every group's at the list's head where the layout draws no bands, its `group` `undefined`.\n */\ntype DemandRow = { kind: \"demand\"; key: string; group: Group | undefined; demand: Demand }\n    | { kind: \"lane\"; key: string; group: Group | undefined; lane: DemandLane; open: boolean }\n    | { kind: \"skill\"; key: string; group: Group | undefined; lane: DemandLane; skill: DemandSkill }\n    | { kind: \"assign\"; key: string; group: Group | undefined; people: number };\n/** A People row: the list's, or the work requirement's. */\ntype PeopleRow = ListRow | DemandRow;\n/**\n * A row of the work requirement on a phone (#1568): its eyebrow, which holds a card a day — the lanes have no row of\n * their own there — and the eyebrow before the people's cards.\n */\ntype AgendaDemandRow = Extract<DemandRow, { kind: \"demand\" | \"assign\" }>;\n/** A row of a phone's People cards: the list's, or the work requirement's. */\ntype AgendaRow = ListRow | AgendaDemandRow;\n/** A person's row, or a row of agency requests. */\ntype PersonRowValue = Extract<ListRow, { kind: \"person\" }>;\n/**\n * Shared stable rows for desktop People and its explicit-action phone cards: a band a group, its people — its leads,\n * then the rest, then agency staff — and its agency requests, then No group's band holding the requests in no group\n * yet, where the duty kind takes none (#1548): it is nobody's home, so it lists no person, a person's duty in no group\n * drawn on their own row; or, without bands (#1567), every person the narrowing shows in one list ranked so, each\n * keeping their home group, then every agency request in one row.\n */\nfunction usePeopleRows(value: RosterValue, collapsed: readonly string[]): ListRow[] {\n    const noGroup = noGroupBand(value);\n    return useMemo(() => {\n        const people = value.people.filter(p => value.visiblePeople.type === \"none\" || value.visiblePeople.value.has(p.key));\n        const rank = (p: typeof people[number]) => p.agency ? 2 : value.positions.find(pos => pos.key === p.position)?.lead ? 0 : 1;\n        if (!value.settings.peopleBands) {\n            // The people a band would list, in one list: each with a home group of the Roster's, which `+ Assign` reads.\n            const groups = new Map(value.groups.map(group => [group.key, group]));\n            const listed = people.flatMap(person => { const group = groups.get(person.group); return group === undefined ? [] : [{ kind: \"person\" as const, key: `person:${person.key}`, group, person }]; });\n            return [...listed.sort((a, b) => rank(a.person) - rank(b.person)), { kind: \"person\" as const, key: \"requests\", group: undefined, person: undefined }];\n        }\n        return bandsOf(value.groups, noGroup).flatMap(group => [\n            { kind: \"group\" as const, key: `group:${group.key}`, group },\n            ...(collapsed.includes(group.key) ? [] : [\n                ...(group.key === NO_GROUP ? [] : people.filter(p => p.group === group.key).sort((a, b) => rank(a) - rank(b)).map(person => ({ kind: \"person\" as const, key: `person:${person.key}`, group, person }))),\n                { kind: \"person\" as const, key: `requests:${group.key}`, group, person: undefined },\n            ]),\n        ]);\n    }, [value.people, value.visiblePeople, value.positions, value.groups, value.settings.peopleBands, noGroup, collapsed]);\n}\n/**\n * The row a failed week says so in (#1398, CL11): the first person's — or a group's Agency requests' — at or below the\n * row at the top of the view, else the last such above it.\n *\n * @param rows - The People rows\n * @param top - The row at the top of the view; `undefined` before the rows are placed\n * @returns The row's index; `undefined` with no person row at all\n */\nfunction firstPersonInView(rows: readonly PeopleRow[], top: number | undefined): number | undefined {\n    const from = Math.max(0, top ?? 0);\n    for (let i = from; i < rows.length; i++) if (rows[i]!.kind === \"person\") return i;\n    for (let i = Math.min(from, rows.length) - 1; i >= 0; i--) if (rows[i]!.kind === \"person\") return i;\n    return undefined;\n}\n/** Bring an explicitly selected person into either virtual People layout. */\nfunction selectedPeopleRow(props: RosterViewsProps, rows: readonly PeopleRow[]): number | undefined {\n    const selected = props.selection;\n    const assignment = selected?.type === \"assignment\" ? props.week.assignments.get(selected.key) ?? props.held.assignments.get(selected.key) : undefined;\n    const person = selected?.type === \"person\" || selected?.type === \"personWeek\" ? selected.key : assignment?.who.type === \"person\" ? assignment.who.value : undefined;\n    // A request is its group's row's — No group's band's, for one in no group yet (#1548) — or the one row of every group's (#1567).\n    const index = rows.findIndex(row => row.kind === \"person\" && (person !== undefined ? row.person?.key === person\n        : assignment?.who.type === \"request\" && row.person === undefined && (row.group === undefined || row.group.key === (groupOf(assignment) ?? NO_GROUP))));\n    return index < 0 ? undefined : index;\n}\n\n/**\n * A kind of People row, as its estimate is measured: a group's band, a person's row, or a group's agency requests' —\n * and the work requirement's eyebrows, lanes and skill rows (#1568).\n */\ntype RowKind = \"group\" | \"person\" | \"requests\" | DemandRow[\"kind\"];\n/** How many rows of a kind are measured for its floor: the first to mount. */\nconst FLOOR_SAMPLES = 8;\n/** Every People row may anchor the view: none is a placeholder whose edge moves as rows land beside it. */\nconst ANCHOR_EVERY_ROW = () => true;\n/**\n * Each kind of row's estimate, measured from the real rows (#1398, problem 12; CL8): the kind's floor — the least a\n * mounted row of it measures, on the device-pixel grid the rows are placed on — every row of the kind at least as tall.\n * A row measured as it comes into view then only grows, below the row in view, and a row the view has passed never\n * moves it. Taken from the first rows of each kind to mount, before they paint; `initial` until then.\n *\n * @param initial - Each kind's estimate before a row of it has mounted\n * @returns The floors, whether a person's row has been measured for them yet, and what a row reports its height to as it mounts\n */\nfunction useRowFloors(initial: Readonly<Record<RowKind, number>>): {\n    floors: Readonly<Record<RowKind, number>>; measured: boolean; measure: (kind: RowKind) => (el: HTMLElement | null) => void;\n} {\n    const [floors, setFloors] = useState(initial);\n    const [measured, setMeasured] = useState(false);\n    const samples = useRef<Record<RowKind, number>>({ group: 0, person: 0, requests: 0, demand: 0, lane: 0, skill: 0, assign: 0 });\n    const report = useCallback((kind: RowKind, px: number) => {\n        const taken = samples.current[kind];\n        if (taken >= FLOOR_SAMPLES || !(px > 0)) return;\n        samples.current[kind] = taken + 1;\n        // The first row of a kind measured stands for the kind; each after it lowers its floor.\n        setFloors(before => (taken === 0 ? Math.abs(px - before[kind]) >= 0.25 : px < before[kind] - 0.25) ? { ...before, [kind]: px } : before);\n        if (kind === \"person\" && taken === 0) setMeasured(true);\n    }, []);\n    const refs = useMemo(() => {\n        const of = (kind: RowKind) => (el: HTMLElement | null) => { if (el !== null && samples.current[kind] < FLOOR_SAMPLES) report(kind, devicePixels(el.getBoundingClientRect().height)); };\n        return { group: of(\"group\"), person: of(\"person\"), requests: of(\"requests\"), demand: of(\"demand\"), lane: of(\"lane\"), skill: of(\"skill\"), assign: of(\"assign\") };\n    }, [report]);\n    const measure = useCallback((kind: RowKind) => refs[kind], [refs]);\n    return { floors, measured, measure };\n}\n\n/**\n * The People grids' estimate of each kind before one has mounted: a row one line at the density's pitch (#1406, P30),\n * the theme's band, and the work requirement's 28px eyebrows (#1568).\n */\nconst PEOPLE_FLOORS: Readonly<Record<RowKind, number>> = { group: 38, person: 36, requests: 36, demand: 28, lane: 36, skill: 36, assign: 28 };\nconst SEVEN_DAYS: readonly number[] = Array.from({ length: 7 }, (_, d) => d);\n/** The selected person-week, read by the rows it marks (#1406, D11): its own context, so a duty picked draws no row again. */\nconst PersonWeekContext = createContext<{ readonly key: string; readonly start: number } | undefined>(undefined);\n\n/** A day's duties as a cell draws them (D5): the tombstones a draft removed, the first live duty, and how many more live ones there are. */\nfunction dayTiles(duties: readonly DayDuty[]): { tiles: readonly DayDuty[]; more: number } {\n    const live = duties.filter(duty => !duty.removed);\n    return { tiles: [...duties.filter(duty => duty.removed), ...live.slice(0, 1)], more: Math.max(0, live.length - 1) };\n}\n/** Whether a day's duties hold a draft against the week as held: one added, moved, edited or removed (P9). */\nfunction dayDrafted(domain: RosterDomain, held: Week, duties: readonly DayDuty[]): boolean {\n    return duties.some(({ id, a, removed }) => { if (removed) return true; const baseline = held.assignments.get(id); return baseline === undefined || !domain.sameAssignment(baseline, a); });\n}\n/** A shift's fill and ink, as a tile's or a mark's style (D6): the theme's palette through its CSS variables, the one data binding the theme leaves to the renderer. */\nfunction fillOf(shift: Shift | undefined): CSSProperties | undefined {\n    const color = shiftColor(shift);\n    return color === undefined ? undefined : { \"--roster-fill\": color.fill, \"--roster-ink\": color.ink } as CSSProperties;\n}\n\ninterface TileProps {\n    ctx: ViewContext; id: string; assignment: Assignment; removed: boolean; person: Person | undefined;\n    /**\n     * The group the tile's row stands for: the person's home group, or a group's requests' group; `undefined` in the one\n     * row of every group's requests (#1567). A duty in another group names it.\n     */\n    home: string | undefined;\n}\n/** Keep the shared drag hooks outside the tile body: pointer motion does not repaint its contents. */\nfunction Tile(args: TileProps) {\n    const { ctx, id, assignment: a, removed } = args;\n    const { styles, value, drag } = ctx;\n    const selection = useContext(SelectionContext);\n    const selected = selection?.type === \"assignment\" && selection.key === id;\n    const name = assignmentName(value, a);\n    const coord = useMemo(() => ({ ...rosterCoord(drag.surface, a.place, id), event: id }), [drag.surface, a.place, id]);\n    const ghost = useMemo(() => <MoveGhost styles={styles} label={name} />, [styles, name]);\n    const enabled = drag.enabled && !removed && ctx.commands.availableOn(a.place.day);\n    const handle = useDragEventChip(enabled ? coord : null, ghost, !enabled, name);\n    const canDrop = useCallback((event: DragEventValue) => drag.run(event, true) === undefined, [drag]);\n    const drop = useDropCell(enabled ? coord : null, !enabled, canDrop, undefined, { caption: drag.caption, name: drag.name });\n    const dragRef = handle?.ref;\n    const attach = useCallback((element: HTMLDivElement | null) => { dragRef?.(element); drop(element); }, [dragRef, drop]);\n    return <TileBody {...args} selected={selected} handle={handle} attach={attach} />;\n}\n/**\n * A duty in no group's badge as its tile is laid out (#1595): its words where they and the shift's whole name both fit\n * beside what else the tile holds, else its icon. Both forms are laid out always, so what it reads never moves with the\n * fit; where nothing is laid out, the words.\n *\n * @param tile - The tile\n * @returns The form that fits\n */\nfunction measureNoGroupBadge(tile: HTMLElement): \"words\" | \"icon\" {\n    const badge = tile.querySelector<HTMLElement>(\"[data-roster-tile-group]\"), name = tile.querySelector<HTMLElement>(\"[data-roster-assignment-name]\");\n    if (badge === null || name === null) return \"words\";\n    const others = [...tile.children].filter((child): child is HTMLElement => child instanceof HTMLElement && child !== badge && child !== name && getComputedStyle(child).display !== \"none\");\n    const css = getComputedStyle(tile);\n    const room = tile.clientWidth - px(css.paddingLeft) - px(css.paddingRight) + 0.5;\n    const used = natural(name) + natural(badge.querySelector('[data-form=\"words\"]')) + others.reduce((sum, child) => sum + child.offsetWidth, 0) + px(css.columnGap) * (others.length + 1);\n    return used <= room ? \"words\" : \"icon\";\n}\n/**\n * A duty in no group's badge on a person's row (#1548, #1595): the words `NO GROUP` where they and the shift's whole name\n * both fit, else a Font Awesome icon; the tile's tooltip and what a screen reader says keep the words, so the shift's name\n * is never cut for it.\n *\n * @param props - The Roster's styles, and the badge's words\n * @returns The badge\n */\nfunction NoGroupBadge({ styles, text }: { styles: RosterStyles; text: string }) {\n    const tile = useRef<HTMLElement | null>(null);\n    const attach = useCallback((el: HTMLElement | null) => { tile.current = el?.closest<HTMLElement>(\"[data-roster-tile]\") ?? null; }, []);\n    const form = useLayoutFit(tile, measureNoGroupBadge, Object.is, \"words\");\n    return <Box as=\"span\" ref={attach} css={styles.tileMeta} data-group=\"\" data-roster-tile-group={form}>\n        <span data-form=\"words\">{text}</span>\n        <span data-form=\"icon\"><FontAwesomeIcon icon={faUsersSlash} /></span>\n    </Box>;\n}\n/**\n * A tile a duty (#1406, D5, P7): the shift's label — a request's too, its row saying it is one (#1566) — then its own\n * times where they differ from the shift's, else the group where it is not the row's — the person's home group, a\n * group's requests' group, none in the one row of every group's requests (#1567) — else the shift's hours where\n * `tileTimes` is always; a warning mark where an issue names it; its fill the shift's colour token, its words in the ink\n * the shade takes. Tile state comes from the held week and the domain issues, never from a second draft store.\n */\nconst TileBody = memo(function TileBody({ ctx, id, assignment: a, removed, person, home, selected, handle, attach }: TileProps & {\n    selected: boolean; handle: ReturnType<typeof useDragEventChip>; attach: (element: HTMLDivElement | null) => void;\n}) {\n    const { styles, value, commands, drag, format } = ctx;\n    const name = assignmentName(value, a);\n    const enabled = drag.enabled && !removed && ctx.commands.availableOn(a.place.day);\n    const shift = shiftOf(value, a.place.shift);\n    const issues = removed ? NO_ISSUES : dutyIssues(ctx.issues, id);\n    const baseline = ctx.held.assignments.get(id);\n    const drafted = removed || baseline === undefined || !ctx.domain.sameAssignment(baseline, a);\n    // A duty in no group yet names it — No group — on a person's row (#1548), as a duty in another group names that.\n    const group = home !== (groupOf(a) ?? NO_GROUP) ? groupName(value, a.place.group) : undefined;\n    const meta = ownTimes(value, a, ctx.start) ? { kind: \"own\" as const, text: `${hourText(a.start)}–${hourText(a.end)}` }\n        : group !== undefined ? { kind: \"group\" as const, text: group.toLocaleUpperCase(format.locale) }\n            : ctx.tileTimes === \"always\" && shift !== undefined ? { kind: \"hours\" as const, text: shiftHoursText(shift) } : undefined;\n    const danger = issues.some(i => i.tone.type === \"danger\");\n    const label = `${name} · ${shift?.label ?? a.place.shift}${meta === undefined ? \"\" : ` · ${meta.text}`}${removed ? \" · removed\" : \"\"}`;\n    // What a run of the optimiser did to the duty (#1409, R23): its mark — the tile keeps its own fill, the ring and the glow alone — and its provenance on hover.\n    const mark = dutyMark(ctx, id, removed, drafted);\n    const words = issues.length > 0 ? `${label} · ${issues.map(i => i.title).join(\" · \")}` : label;\n    return <Box {...handle} ref={attach} css={styles.tile} style={removed ? undefined : fillOf(shift)} tabIndex={0} role=\"button\" aria-label={label} aria-pressed={selected}\n        title={mark === undefined ? words : `${mark.provenance} · ${words}`} data-op={mark?.op} data-fill={mark === undefined ? undefined : \"own\"}\n        data-roster-assignment={id} data-roster-tile=\"\" data-layout=\"people\" data-added={baseline === undefined ? \"\" : undefined} data-moved={baseline !== undefined && !samePlace(baseline.place, a.place) ? \"\" : undefined}\n        data-density={value.settings.density.type} data-selected={selected ? \"\" : undefined} data-drafted={drafted ? \"\" : undefined} data-removed={removed ? \"\" : undefined}\n        data-conflict={ctx.conflicted(id) ? \"\" : undefined} data-bounds={ctx.bounded(id) ? \"\" : undefined} data-request={a.who.type === \"request\" ? \"\" : undefined} data-agency={person?.agency ? \"\" : undefined}\n        data-tone={danger ? \"danger\" : issues.some(i => i.kind.type === \"breach\") ? \"warning\" : undefined} data-draggable={enabled ? \"\" : undefined}\n        onClick={event => { event.stopPropagation(); ctx.select({ type: \"assignment\", key: id }); }}\n        onKeyDown={event => { if (event.key === \"Enter\") { takeKey(event); ctx.select({ type: \"assignment\", key: id }); } else handle?.onKeyDown?.(event); }}>\n        <Box as=\"span\" css={styles.tileLabel} data-roster-assignment-name=\"\">{shift?.label ?? a.place.shift}</Box>\n        {meta !== undefined && (meta.kind === \"group\" && a.place.group.type === \"none\"\n            ? <NoGroupBadge styles={styles} text={meta.text} />\n            : <Box as=\"span\" css={styles.tileMeta} data-own={meta.kind === \"own\" ? \"\" : undefined} data-group={meta.kind === \"group\" ? \"\" : undefined} data-roster-times={meta.kind === \"own\" ? \"\" : undefined}>{meta.text}</Box>)}\n        {issues.length > 0 && <Box as=\"span\" css={styles.tileWarn} data-tone={danger ? \"danger\" : undefined} data-roster-tile-warn=\"\" role=\"img\" aria-label={issues[0]!.title}><FontAwesomeIcon icon={faTriangleExclamation} /></Box>}\n        {(commands.availableOn(a.place.day) || commands.locked !== undefined) && <chakra.button type=\"button\" css={styles.chipAction} data-roster-chip-action=\"\" aria-label={removed ? `Restore ${name}` : `Remove ${name}`}\n            disabled={commands.locked !== undefined} title={commands.locked}\n            onPointerDown={event => event.stopPropagation()} onClick={event => { event.stopPropagation(); if (removed) commands.restore(id); else commands.remove(id); }}><FontAwesomeIcon icon={removed ? faRotateLeft : faXmark} /></chakra.button>}\n    </Box>;\n});\n/** A day's tile as a pattern hovering the row would leave it (P19): the pattern's shift dashed in the brand tone, or the day off. */\nfunction PreviewTile({ ctx, day }: { ctx: ViewContext; day: PatternDay }) {\n    const shift = day.shift === undefined ? undefined : shiftOf(ctx.value, day.shift);\n    return <Box css={ctx.styles.tile} data-preview=\"\" data-off={day.kind === \"off\" ? \"\" : undefined} data-roster-preview={day.kind} aria-hidden=\"true\">\n        <Box as=\"span\" css={ctx.styles.tileLabel}>{day.kind === \"off\" ? \"Off\" : shift?.label ?? day.shift}</Box>\n        {shift !== undefined && <Box as=\"span\" css={ctx.styles.tileMeta}>{shiftHoursText(shift)}</Box>}\n    </Box>;\n}\n/**\n * An off day's `+ Assign` (#1406, D9, P8): a menu of the shifts, each its label, its swatch and its times, whose choice\n * places the person on it in their home group that day, one gesture; `Elsewhere…` opens the place form for another\n * group or day. While a run of the optimiser holds the week (#1409, R2) the trigger stays in place, inert and saying\n * why, with no menu; a place form the run finds open closes, and stays closed as the run ends.\n */\nfunction AssignMenu({ ctx, person, group, day }: { ctx: ViewContext; person: Person; group: string; day: number }) {\n    const { value, styles, commands, start, format } = ctx;\n    const [elsewhere, setElsewhere] = useState(false);\n    const { locked } = commands;\n    useEffect(() => { if (locked !== undefined) setElsewhere(false); }, [locked]);\n    const date = new Date(start.getTime() + day * DAY);\n    const placeFor = (shift: string): Place => ({ day: BigInt(day), group: some(group), shift });\n    const usual = person.usual.type === \"some\" ? person.usual.value : value.shifts[0]!.key;\n    const trigger = <chakra.button type=\"button\" css={styles.assign} data-roster-assign={`${person.key}.${day}`} data-roster-off=\"\" aria-label={`Assign ${person.name} · ${format.weekday(date)}`}\n        disabled={locked !== undefined} title={locked}>+ Assign</chakra.button>;\n    if (locked !== undefined) return trigger;\n    if (elsewhere) return <PlacePopover label=\"Elsewhere…\" source={{ type: \"person\", key: person.key }} place={placeFor(usual)} value={value} start={start} commands={commands} styles={styles} onClose={() => setElsewhere(false)} />;\n    return <ChakraMenu.Root positioning={{ placement: \"bottom-start\" }} onSelect={d => {\n        if (d.value === \"elsewhere\") { setElsewhere(true); return; }\n        ctx.onError(commands.place({ type: \"person\", key: person.key }, placeFor(d.value)));\n    }}>\n        <ChakraMenu.Trigger asChild>\n            {trigger}\n        </ChakraMenu.Trigger>\n        <FrameMenuLayer label={`Assign · ${format.weekday(date)} ${format.number(date.getUTCDate())}`} data-roster-assign-menu=\"\">\n                    <Box css={styles.assignMenuHead}>Assign · {format.weekday(date)} {format.number(date.getUTCDate())}</Box>\n                    {value.shifts.map(shift => <ChakraMenu.Item key={shift.key} value={shift.key} css={styles.assignItem} data-roster-assign-shift={shift.key}>\n                        <Box as=\"span\" css={styles.swatch} style={fillOf(shift)} aria-hidden=\"true\" /><span>{shift.label}</span><Box as=\"span\" data-roster-shift-times=\"\">{shiftHoursText(shift)}</Box>\n                    </ChakraMenu.Item>)}\n                    <ChakraMenu.Separator />\n                    <ChakraMenu.Item value=\"elsewhere\">Elsewhere…</ChakraMenu.Item>\n                </FrameMenuLayer>\n    </ChakraMenu.Root>;\n}\n/**\n * A person's day in the People grid (#1406, P6–P11): a tile per duty and `+1` for a second, or `+ Assign` on a day off\n * that draws no removed duty,\n * drawn again only as the day's duties, its person or what the views show changes (#1398, CL9). A drop on it resolves to\n * the dragged person's same or usual shift; a pattern dropped on it lands on the person's week (§11), and while one\n * hovers the row the day previews what the pattern leaves it (P19); another person's duty is refused (P11). The one\n * row of every group's requests (#1567) takes a request along it, in its own group, and refuses a card: it has no\n * group to place one in.\n *\n * The cell is its drop hooks and its attributes alone; what it shows is {@link PersonDayBody}, its own memo. The shared\n * drag hooks subscribe to the layer, which moves on every change of the cell a drag rests over, so a hundred cells draw\n * again each time one is crossed: a subscriber's draw must cost next to nothing, and the tiles, the `+ Assign` and the\n * preview draw again only as their own props change.\n */\nconst PersonDay = memo(function PersonDay({ ctx, person, rowKey, group, day, duties, current, weekSelected, preview, hovering, onPatternHover, onPatternLeave }: {\n    ctx: ViewContext; person: Person | undefined;\n    /** The row's key: the person's, or its requests' (`requests:<group>`, or `requests` for every group's). */\n    rowKey: string;\n    /** The group the row stands for: the person's home group, a group's requests' group; `undefined` for every group's requests. */\n    group: string | undefined;\n    day: number; duties: readonly DayDuty[];\n    /** Whether the day is the one the views show: the day a Shifts view steps to. */\n    current: boolean;\n    /** Whether the person-week is selected: the row's cells outlined (D11). */\n    weekSelected: boolean;\n    /** What a pattern hovering the row leaves the day, while one does. */\n    preview: PatternDay | undefined; hovering: boolean;\n    onPatternHover: (key: string) => void; onPatternLeave: () => void;\n}) {\n    const { drag, value, week, styles, start } = ctx;\n    const key = rowKey;\n    // Where a card lands: the row's group — no group in No group's band's requests' row (#1548) — the person's usual\n    // shift or the first; nowhere in every group's requests' row.\n    const initial = useMemo((): Place | undefined => group === undefined ? undefined\n        : { day: BigInt(day), group: group === NO_GROUP ? none : some(group), shift: person?.usual.type === \"some\" ? person.usual.value : value.shifts[0]!.key },\n    [day, group, person, value.shifts]);\n    // A pattern lands on the person's week, whatever day of it the drag rests over; the requests rows refuse it in its words.\n    const personWeek = useMemo(() => rosterPersonWeekCoord(drag.surface, key, start), [drag.surface, key, start]);\n    const resolve = useCallback((_x: number, _y: number, payload: DragPayload): CellCoord => {\n        if (isPatternCard(payload, drag.surface)) return personWeek;\n        const a = payload.kind === \"event\" ? week.assignments.get(payload.from.event) : undefined;\n        // A duty moved along its row keeps its group, or none, and its shift.\n        if (a !== undefined) return rosterCoord(drag.surface, { day: BigInt(day), group: a.place.group, shift: a.place.shift });\n        return initial === undefined ? personWeek : rosterCoord(drag.surface, initial);\n    }, [week, drag.surface, initial, day, personWeek]);\n    /** Whether a dragged duty is another row's: refused, `A duty moves along its own row.` (P11). */\n    const crossRow = useCallback((id: string) => {\n        const a = week.assignments.get(id);\n        return a !== undefined && (person === undefined ? a.who.type !== \"request\" : !(a.who.type === \"person\" && a.who.value === person.key));\n    }, [week, person]);\n    const accepts = useCallback((payload: DragPayload) => {\n        if (payload.kind === \"event\") return week.assignments.has(payload.from.event);\n        if (payload.kind !== \"item\") return false;\n        if (isPatternCard(payload, drag.surface)) return true;\n        const from = readRosterSource(payload.from.key);\n        return from.success && (person === undefined ? from.value.type === \"agency\" : from.value.type === \"person\" && from.value.value === person.key);\n    }, [week, person, drag.surface]);\n    const canDrop = useCallback((event: DragEventValue) => {\n        if (event.type === \"move\" && event.value.from.event.type === \"some\" && crossRow(event.value.from.event.value)) return false;\n        // Every group's requests' row places no card: no group is the row's (#1567).\n        if (event.type === \"add\" && initial === undefined) return false;\n        return drag.run(event, true) === undefined;\n    }, [drag, crossRow, initial]);\n    const caption = useCallback((coord: CellCoord, payload: DragPayload, allowed: boolean) => {\n        if (payload.kind === \"event\" && crossRow(payload.from.event)) return \"A duty moves along its own row.\";\n        if (payload.kind === \"item\" && initial === undefined && !isPatternCard(payload, drag.surface)) return \"Drop this card onto a group's shift.\";\n        return drag.caption(coord, payload, allowed);\n    }, [crossRow, drag, initial]);\n    const coord = useMemo(() => !drag.enabled ? null : initial === undefined ? personWeek : rosterCoord(drag.surface, initial), [drag.enabled, drag.surface, initial, personWeek]);\n    const onHover = useCallback((_x: number, _y: number, payload: DragPayload) => { if (payload.kind === \"item\" && isPatternCard(payload, drag.surface)) onPatternHover(payload.from.key); }, [drag.surface, onPatternHover]);\n    const ref = useDropCell(coord, !drag.enabled, canDrop, resolve, { accepts, caption, name: drag.name, onHover, onLeave: onPatternLeave });\n    const drafted = useMemo(() => dayDrafted(ctx.domain, ctx.held, duties), [ctx.domain, ctx.held, duties]);\n    // While a pattern hovers the row every day shows the pattern's day dashed, and the days it changes are tinted (P19).\n    const changes = preview !== undefined && preview.kind !== \"keep\";\n    return <Box ref={ref} css={styles.dayCell} data-roster-person-day={`${key}.${day}`} data-selected={current ? \"\" : undefined} data-week-selected={weekSelected ? \"\" : undefined}\n        data-drafted={drafted ? \"\" : undefined} data-pattern-hover={hovering ? \"\" : undefined} data-pattern-changes={changes ? \"\" : undefined} data-roster-previewing={preview !== undefined ? \"\" : undefined}>\n        <PersonDayBody ctx={ctx} person={person} rowKey={key} group={group} day={day} duties={duties} preview={preview} />\n    </Box>;\n});\n/**\n * What a person's day shows: its tiles, `+1`, `+ Assign` or `Off` — and, while a pattern hovers its row, the pattern's\n * day beside them, the day's own tiles kept mounted and hidden by the cell (`data-roster-previewing`): a tile's drag\n * hooks register with the layer and with dnd-kit, and mounting and unmounting the tiles as the hover moved had every\n * droppable measured again and every subscriber drawn again, row after row.\n */\nconst PersonDayBody = memo(function PersonDayBody({ ctx, person, rowKey, group, day, duties, preview }: {\n    ctx: ViewContext; person: Person | undefined; rowKey: string; group: string | undefined; day: number; duties: readonly DayDuty[]; preview: PatternDay | undefined;\n}) {\n    const { styles, commands } = ctx;\n    peopleDrawProbe?.(\"day\", `${rowKey}.${day}`);\n    const { tiles, more } = dayTiles(duties);\n    // `+ Assign`, or `Off`, stands in a day that draws no box. A removed duty's tile — crossed out until it is saved,\n    // restored or undone — is its day's one box, the cell's whole width as any duty's is, never half of it beside a wash\n    // (ruled 11 Nov 2026).\n    const off = person !== undefined && tiles.length === 0;\n    return <>\n        {preview !== undefined && <PreviewTile ctx={ctx} day={preview} />}\n        {tiles.map(({ id, a, removed }) => <Tile key={id} ctx={ctx} id={id} assignment={a} removed={removed} person={person} home={group} />)}\n        {more > 0 && <Box as=\"span\" css={styles.tileMore} data-roster-more={more} title={`${more} more`}>+{more}</Box>}\n        {/* `+ Assign` places the person in their home group, with or without its band (#1567). */}\n        {off && (commands.availableOn(BigInt(day)) || commands.locked !== undefined ? <AssignMenu ctx={ctx} person={person} group={person.group} day={day} /> : <Box css={styles.detail}>Off</Box>)}\n    </>;\n});\n/** A person's name cell (#1406, D8): the name — the requests row's, the vocabulary's `requests` — the agency badge in the vocabulary's `agencyShort` (#1566), and — by week — the week's hours against the contract over the meter. */\nfunction NameCell({ ctx, person, rowKey, weekSelected, hours, nameRef }: {\n    ctx: ViewContext; person: Person | undefined; rowKey: string; weekSelected: boolean;\n    /** The hours cell; nothing in the month (P16). */\n    hours: ReactNode; nameRef?: RefObject<HTMLButtonElement | null> | undefined;\n}) {\n    const { styles, start, value } = ctx;\n    return <Box css={styles.peopleName} data-selected={weekSelected ? \"\" : undefined} data-roster-person-name=\"\">\n        <Box css={styles.nameLine}>\n            <chakra.button ref={nameRef} type=\"button\" css={styles.personName} data-roster-person-head={person?.key} aria-pressed={weekSelected}\n                onClick={() => person !== undefined && ctx.select({ type: \"personWeek\", key: rowKey, start: start.getTime() })}><span>{person?.name ?? value.vocabulary.requests}</span></chakra.button>\n            {person?.agency && <Box as=\"span\" css={styles.agencyBadge} data-roster-agency-badge=\"\">{value.vocabulary.agencyShort}</Box>}\n        </Box>\n        {hours}\n    </Box>;\n}\n/** A person's week's hours against their contract, over the meter, with the cost where the app gives pay (D8, P5). */\nfunction WeekHours({ ctx, person, total, cost }: { ctx: ViewContext; person: Person; total: number; cost: number | undefined }) {\n    const { styles, format, value } = ctx;\n    const over = total > person.contract;\n    // A run of the optimiser that changed the person's week flashes their hours and their meter (#1409, §9.5).\n    return <Box css={styles.hoursCell} data-roster-week-hours=\"\" data-tone={over ? \"warning\" : undefined} data-opn={ctx.lit && ctx.optimised?.people.has(person.key) === true ? \"\" : undefined}>\n        <Box css={styles.hoursText}>{format.number(total)} / {format.number(person.contract)} h{cost !== undefined && ` · ${money(format, value, cost)}`}</Box>\n        <Box css={styles.meter} data-roster-meter=\"\" role=\"img\" aria-label={`${format.number(total)} of ${format.number(person.contract)} hours`}><Box css={styles.meterFill} style={{ width: `${Math.min(total / Math.max(person.contract, 1), 1) * 100}%` }} /></Box>\n    </Box>;\n}\n/** A person's week's hours while the week is not read: a placeholder where they go, beside the contract known without it. */\nfunction UnreadHours({ ctx, person, index }: { ctx: ViewContext; person: Person | undefined; index: number }) {\n    return person === undefined ? null : <Box css={ctx.styles.hoursCell}><Box css={ctx.styles.unreadValue} data-roster-week-hours=\"\">\n        <Unread read={ctx.read} kind=\"number\" index={index} />{`/ ${ctx.format.number(person.contract)} h`}</Box></Box>;\n}\n/** A person's row, or a group's requests', in the People grid: its name cell and its seven days, one line (#1406, §8). */\nconst PersonRow = memo(function PersonRow({ ctx, row, index, rows, days, duties, measure }: {\n    ctx: ViewContext; row: PersonRowValue; index: number; rows: readonly PeopleRow[]; days: WeekDays; duties: readonly string[] | undefined;\n    measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, value, start, commands } = ctx;\n    const person = row.person, key = person?.key ?? row.key;\n    peopleDrawProbe?.(\"row\", key);\n    // The name the keyboard stepped to takes the focus as its row mounts — at once, or once the frame brings it into view.\n    const focus = useContext(PeopleFocusContext);\n    const name = useRef<HTMLButtonElement>(null);\n    const stepped = person !== undefined && focus.key === person.key;\n    useLayoutEffect(() => { if (stepped && name.current !== null) { name.current.focus({ preventScroll: true }); focus.done(); } }, [stepped, focus]);\n    const picked = useContext(PersonWeekContext);\n    const weekSelected = person !== undefined && picked !== undefined && picked.key === person.key && picked.start === start.getTime();\n    // A pattern hovering the row: what it would leave each day (P19), from the same plan a drop applies.\n    const [previewKey, setPreviewKey] = useState<string>();\n    const onPatternHover = useCallback((next: string) => setPreviewKey(next), []);\n    const onPatternLeave = useCallback(() => setPreviewKey(undefined), []);\n    const plan = useMemo(() => previewKey === undefined || person === undefined ? undefined : commands.pattern(person.key, start, previewKey), [previewKey, person, commands, start]);\n    const previewDays = typeof plan === \"object\" ? plan.days : undefined;\n    const density = value.settings.density.type;\n    // A week not read, or whose read failed (#1398): the people and their contracts, known without it, at once; a\n    // placeholder where each day's duties go, never `+ Assign`; the failure said once, in the first person's row in\n    // view, across their days.\n    if (ctx.read.state === \"failed\") return <FailedPersonRow ctx={ctx} read={ctx.read} rowKey={key} person={person} index={index} rows={rows} measure={measure} />;\n    if (ctx.read.state !== \"held\") return <Box ref={measure} css={styles.peopleRow} data-roster-person-row={key} data-density={density} data-roster-unread=\"\">\n        <NameCell ctx={ctx} person={person} rowKey={key} weekSelected={false} hours={<UnreadHours ctx={ctx} person={person} index={index} />} />\n        {SEVEN_DAYS.map(day => <Box key={day} css={styles.dayCell} data-roster-person-day={`${key}.${day}`}><Unread read={ctx.read} kind=\"chip\" index={index + day} /></Box>)}\n    </Box>;\n    const total = ctx.hours.get(key) ?? 0;\n    // A person's week's cost, every code summed: theirs alone, from the app's pay.\n    const cost = person === undefined || !costed(value) ? undefined : costsOf(ctx.pay, duties ?? []).total;\n    return <Box ref={measure} css={styles.peopleRow} data-roster-person-row={key} data-density={density}>\n        <NameCell ctx={ctx} person={person} rowKey={key} weekSelected={weekSelected} nameRef={name} hours={person === undefined ? null : <WeekHours ctx={ctx} person={person} total={total} cost={cost} />} />\n        {SEVEN_DAYS.map(day => <PersonDay key={day} ctx={ctx} person={person} rowKey={key} group={row.group?.key} day={day} duties={days[day] ?? NO_DUTIES} current={ctx.day === day}\n            weekSelected={weekSelected} preview={previewDays?.[day]} hovering={previewKey !== undefined} onPatternHover={onPatternHover} onPatternLeave={onPatternLeave} />)}\n    </Box>;\n});\n/**\n * A person's row of a week whose read failed (#1398, CL11): blank, or — the first person's row in view — the failure said\n * across their days. It reads which row is at the top of the view itself, drawn again only as it becomes or stops being\n * that row (CL9).\n */\nfunction FailedPersonRow({ ctx, read, rowKey, person, index, rows, measure }: {\n    ctx: ViewContext; read: Extract<PeriodRead, { state: \"failed\" }>; rowKey: string; person: Person | undefined; index: number;\n    rows: readonly PeopleRow[]; measure: (el: HTMLElement | null) => void;\n}) {\n    const says = useRowsTop(top => firstPersonInView(rows, top) === index);\n    return <Box ref={measure} css={ctx.styles.peopleRow} data-roster-person-row={rowKey} data-density={ctx.value.settings.density.type} data-roster-unread=\"\">\n        <NameCell ctx={ctx} person={person} rowKey={rowKey} weekSelected={false} hours={<UnreadHours ctx={ctx} person={person} index={index} />} />\n        {says ? <Box css={ctx.styles.readLine} data-days=\"\" data-roster-read-line=\"\"><ReadFailure read={read} /></Box>\n            : SEVEN_DAYS.map(day => <Box key={day} css={ctx.styles.dayCell} data-roster-person-day={`${rowKey}.${day}`} />)}\n    </Box>;\n}\n/**\n * ↑ / ↓ on a person's name: the next person, or the one before — the groups' bands and their agency requests passed\n * over, a folded group's people not among them — selected for the week in view, their row brought into view and their\n * name focused (#1398), as a pick in Search Records focuses its person's ({@link usePeopleFocus}).\n */\nfunction usePeopleArrows(rows: readonly PeopleRow[], select: (next: Selection) => void, start: Date, picked: PeoplePick | undefined) {\n    const { focus, stepTo } = usePeopleFocus(rows, picked);\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n        if (event.key !== \"ArrowDown\" && event.key !== \"ArrowUp\") return;\n        const from = (event.target as Element).closest?.(\"[data-roster-person-head]\")?.getAttribute(\"data-roster-person-head\");\n        if (from === null || from === undefined) return;\n        // The arrow is the People grid's: it goes no further than the Roster (#1398).\n        takeKey(event);\n        const by = event.key === \"ArrowDown\" ? 1 : -1;\n        for (let i = rows.findIndex(row => row.kind === \"person\" && row.person?.key === from) + by; i >= 0 && i < rows.length; i += by) {\n            const row = rows[i]!;\n            if (row.kind !== \"person\" || row.person === undefined) continue;\n            stepTo(row.person.key);\n            select({ type: \"personWeek\", key: row.person.key, start: start.getTime() });\n            return;\n        }\n    }, [rows, select, stepTo, start]);\n    return { focus, onKeyDown };\n}\n// ── The work requirement (#1568, `People Work Requirements` 2a) ──────────────────────────────────────────────────────\n\n/** No work requirement: `requirements` off, or a Roster with no targets. */\nconst NO_DEMANDS: ReadonlyMap<string | undefined, Demand> = new Map();\n/** A week of the span with no coverage worked out: none of its slots. */\nconst NO_COVERAGE: ReadonlyMap<Slot, Coverage> = new SortedMap<Slot, Coverage>([], compareSlot);\n/**\n * The work requirement of each scope the People grids draw (#1568): each band's group's, by its key, or — where the\n * layout draws no bands — every group's as one, keyed `undefined`; none while `requirements` is off or the Roster has\n * no targets; over the span in view, a week or a month's weeks. A scope's eyebrows stand whatever the span's targets —\n * a span naming none has no lane — so the first row of the list is the same from the first render on: the lanes a read\n * brings land under it, and a view at the top stays there, never pushed down by rows landing above it. While the span\n * is not read, the last read's stand in, so no lane comes or goes as the span lands, and each figure is a placeholder\n * until it has (K5, K6).\n *\n * @param props - The views' props: the payload, the span's weeks and their coverage, and the span's read\n * @returns Each scope's work requirement\n */\nfunction useDemands(props: RosterViewsProps): ReadonlyMap<string | undefined, Demand> {\n    const { value, weeks, spanCoverage, read } = props;\n    const made = useMemo((): ReadonlyMap<string | undefined, Demand> => {\n        if (!value.settings.requirements || value.targets.type !== \"some\") return NO_DEMANDS;\n        // With no bands the one block counts the duties in no group yet too (#1548): rostered against each shift's day,\n        // filling what its groups' slots are short; a band's group's work counts its own slots alone.\n        const loose = !value.settings.peopleBands && value.duty.roles.noGroup;\n        const span = weeks.map((held, w): DemandWeek => ({ requirements: held.week.requirements, coverage: spanCoverage[w] ?? NO_COVERAGE,\n            loose: loose ? looseOf(value, held.week) : undefined }));\n        return value.settings.peopleBands ? new Map(value.groups.map(group => [group.key, demandOf(value, span, [group.key])] as const))\n            : new Map([[undefined, demandOf(value, span, value.groups.map(group => group.key), loose)]]);\n    }, [value, weeks, spanCoverage]);\n    const reads = read.state === \"held\";\n    const held = useRef(made);\n    useEffect(() => { if (reads) held.current = made; }, [reads, made]);\n    return reads || made === NO_DEMANDS ? made : held.current;\n}\n/**\n * Which of the People grid's lanes are open, by their rows' keys (#1568, A4.5): the viewer's, kept as the bands' folds\n * are. Its `toggle` is the same function while the store is.\n *\n * @param surface - The Roster's surface, which its folds are kept under\n * @returns The open lanes' keys, and what opens or closes one\n */\nfunction useOpenLanes(surface: string): { open: readonly string[]; toggle: (lane: string) => void } {\n    const { state: open, setState } = usePersistedState<string[]>(`${surface}.open-lanes`, [], keptRead.array(keptRead.string));\n    const toggle = useCallback((lane: string) => setState(current => current.includes(lane) ? current.filter(key => key !== lane) : [...current, lane]), [setState]);\n    return { open, toggle };\n}\n/** A work requirement row's parts — its band's group, its shift and its skill — printed by East, so no two rows' keys are alike. */\nconst printParts = printFor(ArrayType(StringType));\nfunction demandKey(kind: DemandRow[\"kind\"], group: Group | undefined, ...parts: string[]): string {\n    return `${kind}:${printParts(group === undefined ? parts : [group.key, ...parts])}`;\n}\n/** How many people each band lists (#1568, A1): those of its group the narrowing shows, by the group's key. */\nfunction bandPeople(value: RosterValue): ReadonlyMap<string, number> {\n    const counts = new Map<string, number>();\n    for (const person of value.people) {\n        if (value.visiblePeople.type === \"some\" && !value.visiblePeople.value.has(person.key)) continue;\n        counts.set(person.group, (counts.get(person.group) ?? 0) + 1);\n    }\n    return counts;\n}\n/**\n * A count of people as a band and its assignment's eyebrow say it (#1568, A1, A5): `1 person`, `12 people`.\n *\n * @param number - The locale's number formatter\n * @param n - How many people\n * @returns The count in words\n */\nfunction peopleSaid(number: (n: number) => string, n: number): string {\n    return `${number(n)} ${n === 1 ? \"person\" : \"people\"}`;\n}\n/**\n * A scope's work requirement as rows (#1568): its group's — `undefined` for the one block over every group's, where the\n * layout draws no bands — its work requirement, and how many people its band lists.\n */\ntype DemandBlock<R> = (group: Group | undefined, demand: Demand, people: number) => readonly R[];\n/**\n * The People rows with the work requirement's (#1568): under each open band its scope's block, or — where the layout\n * draws no bands — the one block at the list's head.\n *\n * @param list - The People list's rows\n * @param value - The payload\n * @param demands - Each scope's work requirement\n * @param people - How many people each band lists\n * @param block - A scope's rows: the grid's (`gridDemand`) or a phone's (`cardDemand`)\n * @returns The rows the layout draws\n */\nfunction withDemand<R>(list: readonly ListRow[], value: RosterValue, demands: ReadonlyMap<string | undefined, Demand>, people: ReadonlyMap<string, number>,\n    block: DemandBlock<R>): readonly (ListRow | R)[] {\n    if (demands.size === 0) return list;\n    const rows = (group: Group | undefined, count: number): readonly R[] => { const demand = demands.get(group?.key); return demand === undefined ? [] : block(group, demand, count); };\n    if (!value.settings.peopleBands) return [...rows(undefined, list.filter(row => row.kind === \"person\" && row.person !== undefined).length), ...list];\n    // An open band's rows follow it — its requests' row at least — and a folded band's do not.\n    return list.flatMap((row, i): (ListRow | R)[] => row.kind !== \"group\" || list[i + 1] === undefined || list[i + 1]!.kind === \"group\" ? [row]\n        : [row, ...rows(row.group, people.get(row.group.key) ?? 0)]);\n}\n/**\n * A scope's rows in the People grid, by week or by month (#1568): its eyebrow, its lanes — each open one's skill rows\n * under it — and the eyebrow before its people. A scope whose span names no target has its eyebrows and no lane.\n *\n * @param open - The open lanes' keys\n * @returns What makes a scope's rows\n */\nfunction gridDemand(open: readonly string[]): DemandBlock<DemandRow> {\n    return (group, demand, count) => [\n        { kind: \"demand\", key: demandKey(\"demand\", group), group, demand },\n        ...demand.lanes.flatMap((lane): DemandRow[] => {\n            const key = demandKey(\"lane\", group, lane.shift.key), opened = open.includes(key);\n            return [{ kind: \"lane\", key, group, lane, open: opened },\n                ...(opened ? lane.skills.map((skill): DemandRow => ({ kind: \"skill\", key: demandKey(\"skill\", group, lane.shift.key, skill.skill), group, lane, skill })) : [])];\n        }),\n        { kind: \"assign\", key: demandKey(\"assign\", group), group, people: count },\n    ];\n}\n/** A scope's rows on a phone (#1568): its eyebrow, which holds its day cards, and the eyebrow before its people's cards. */\nconst cardDemand: DemandBlock<AgendaDemandRow> = (group, demand, count) => [\n    { kind: \"demand\", key: demandKey(\"demand\", group), group, demand },\n    { kind: \"assign\", key: demandKey(\"assign\", group), group, people: count },\n];\n/**\n * The People grid's sections whose heads stick under its header (#1568, A6): a band's work requirement — the band, its\n * eyebrow, its lanes and their skill rows heading the band's rows to the next band — or, where the grid draws no bands,\n * the one block heading everyone's. The skill rows give way first: past half of main they scroll with the people.\n *\n * @param rows - The rows the grid draws\n * @returns Its sections, in order\n */\nfunction demandSections(rows: readonly PeopleRow[]): readonly StickySection[] {\n    const yields = (i: number) => rows[i]?.kind === \"skill\";\n    const heads = (i: number) => rows[i]?.kind === \"demand\" || rows[i]?.kind === \"lane\" || rows[i]?.kind === \"skill\";\n    const sections: StickySection[] = [];\n    for (let i = 0; i < rows.length; i++) {\n        const kind = rows[i]!.kind;\n        // A band its work requirement follows, or the block a grid of no bands opens with.\n        if (!(kind === \"group\" ? rows[i + 1]?.kind === \"demand\" : kind === \"demand\" && rows[i - 1]?.kind !== \"group\")) continue;\n        let head = kind === \"group\" ? i + 1 : i;\n        while (heads(head)) head++;\n        let end = head;\n        while (end < rows.length && rows[end]!.kind !== \"group\") end++;\n        sections.push({ start: i, end, head: head - i, yields });\n    }\n    return sections;\n}\n/**\n * A band's work requirement (#1568, A1): the people it lists, then the week's hours needed, rostered and their\n * difference in the Shifts band's words, and how many of its shifts are short.\n */\nfunction BandDemand({ ctx, demand, people }: { ctx: ViewContext; demand: Demand; people: number }) {\n    const { styles, format, read } = ctx;\n    const { needed, rostered, shortSlots } = demand.total;\n    return <>\n        <Box as=\"span\" css={styles.groupMeta} data-count=\"\">{peopleSaid(format.number, people)}</Box>\n        <Box as=\"span\" css={styles.groupMeta} data-roster-band-demand=\"\">{read.state !== \"held\" ? <Unread read={read} kind=\"aggregate\" index={2} />\n            : <>{format.number(needed)} h needed · {format.number(rostered)} h rostered · {signed(format.number, difference(rostered, needed), \"+0\")} h{shortSlots > 0\n                && <Box as=\"span\" data-tone=\"warning\"> · {format.number(shortSlots)} {shortSlots === 1 ? \"shift\" : \"shifts\"} short</Box>}</>}</Box>\n    </>;\n}\n/** The work requirement's eyebrow (#1568, A2): the vocabulary's heading, then each day's hours rostered against needed, no valence. */\nconst DemandHead = memo(function DemandHead({ ctx, row, measure }: {\n    ctx: ViewContext; row: Extract<DemandRow, { kind: \"demand\" }>; measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, format, read, value } = ctx;\n    return <Box ref={measure} css={styles.demandRow} data-roster-demand={row.key}>\n        <Box css={styles.demandName} data-roster-demand-heading=\"\">{value.vocabulary.demand}</Box>\n        {SEVEN_DAYS.map(day => { const figures = row.demand.days[day]!; return <Box key={day} css={styles.demandFigure} data-roster-demand-day={day}>\n            {read.state !== \"held\" ? <Unread read={read} kind=\"number\" index={day} /> : `${format.number(figures.rostered)} / ${format.number(figures.needed)} h`}</Box>; })}\n    </Box>;\n});\n/**\n * Hours rostered — or a skill's assigned — against those needed (A3.3, A4.3): `292 / 294`, the first in the ink, a\n * skill's in the second ink, and the warning's where a skill's day is short.\n */\nfunction Figure({ ctx, rostered, needed, skill = false, short = false }: { ctx: ViewContext; rostered: number; needed: number; skill?: boolean; short?: boolean }) {\n    return <Box as=\"span\" css={ctx.styles.laneFigure} data-skill={skill ? \"\" : undefined}>\n        <span data-rostered=\"\" data-tone={short ? \"warning\" : undefined}>{ctx.format.number(rostered)}</span><span data-needed=\"\">/ {ctx.format.number(needed)}</span>\n    </Box>;\n}\n/**\n * A lane's day's figures (A3.3): the hours rostered against needed and the difference they state, where there is one —\n * where any of its slots is short, what they are short, never their net (K4) — over the bar: the permanent staff's,\n * agency staff's and the requests' parts from its start, what its slots are short open dashed after them, and the\n * needed tick, scaled to the larger of the hours needed and those its parts reach (A3.4, {@link barOf}).\n */\nfunction LaneFigures({ ctx, figures: f }: { ctx: ViewContext; figures: DemandFigures }) {\n    const { styles, format } = ctx;\n    const d = stated(f.rostered, f.needed, f.short), bar = barOf(f, f.short);\n    return <>\n        <Box as=\"span\" css={styles.laneLine} data-roster-lane-figures=\"\"><Figure ctx={ctx} rostered={f.rostered} needed={f.needed} /><Box as=\"span\" css={styles.laneDiff} data-roster-lane-difference=\"\" data-tone={toneOf(d)}>{signed(format.number, d)}</Box></Box>\n        <Box as=\"span\" css={styles.laneBar} data-roster-lane-bar=\"\">\n            {bar.parts.map(part => <Box as=\"span\" key={part.kind} css={styles.coverageSegment} data-kind={part.kind} style={{ left: `${part.left / bar.scale * 100}%`, width: `${part.width / bar.scale * 100}%` }} />)}\n            <Box as=\"span\" css={styles.laneTick} style={{ left: `${f.needed / bar.scale * 100}%` }} />\n        </Box>\n    </>;\n}\n/**\n * A lane's day to a press (#1568, A3.8): it selects its slot, a band's group's, or the shift's day across the groups\n * where the layout draws no bands, which the inspector shows. Its label names the shift, the day and the group, then\n * the hours rostered of needed and the difference its figure states — `216 of 214 hours rostered, 2 short` where a\n * group is short as another is over (K4) — or `no target`.\n *\n * @param ctx - The views' context\n * @param group - The lane's band's group; `undefined` for the one block over every group's\n * @param lane - The lane\n * @param day - The day, from the week's start\n * @returns Whether the day is selected, what it says to a screen reader, what selects it, and what selects it and opens the inspector's view on it\n */\nfunction useLaneDay(ctx: ViewContext, group: Group | undefined, lane: DemandLane, day: number): { selected: boolean; label: string; select: () => void; inspect: () => void } {\n    const { format, read, start } = ctx;\n    const selection = useContext(SelectionContext);\n    const shift = lane.shift.key;\n    const slot = useMemo(() => group === undefined ? undefined : { day: BigInt(day), group: group.key, shift }, [group, day, shift]);\n    const selected = slot !== undefined ? selectedSlot(selection, slot) : selection?.type === \"shiftDay\" && selection.shift === shift && selection.day === day;\n    const f = lane.days[day]!;\n    const when = `${lane.shift.label} · ${format.weekday(new Date(start.getTime() + day * DAY))}${group === undefined ? \"\" : ` · ${group.label}`}`;\n    const label = read.state !== \"held\" ? when : !f.target ? `${when}: no target`\n        : `${when}: ${format.number(f.rostered)} of ${format.number(f.needed)} hours rostered${differenceSaid(format.number, stated(f.rostered, f.needed, f.short))}`;\n    const target = (): Selection => slot !== undefined ? { type: \"requirement\", slot, start: start.getTime() } : { type: \"shiftDay\", shift, day, start: start.getTime() };\n    return { selected, label, select: () => ctx.select(target()), inspect: () => ctx.inspect(target()) };\n}\n/**\n * What a lane's day shows (A3.3): its figures over its bar, or — none of the day's slots with a target — `no target`, no\n * bar (A3.6); a placeholder while the week is read.\n */\nfunction LaneDayFigures({ ctx, lane, day }: { ctx: ViewContext; lane: DemandLane; day: number }) {\n    const f = lane.days[day]!;\n    return ctx.read.state !== \"held\" ? <Unread read={ctx.read} kind=\"aggregate\" index={day} />\n        : f.target ? <LaneFigures ctx={ctx} figures={f} /> : <Box as=\"span\" css={ctx.styles.laneNoTarget} data-roster-lane-none=\"\">no target</Box>;\n}\n/** A lane's day (#1568, A3.3): its figures, a press selecting it (A3.8). */\nconst LaneDay = memo(function LaneDay({ ctx, rowKey, group, lane, day }: { ctx: ViewContext; rowKey: string; group: Group | undefined; lane: DemandLane; day: number }) {\n    const { selected, label, select } = useLaneDay(ctx, group, lane, day);\n    return <chakra.button type=\"button\" css={ctx.styles.laneCell} data-roster-lane-day={`${rowKey}.${day}`} data-selected={selected ? \"\" : undefined} aria-pressed={selected} aria-label={label}\n        onClick={select}>\n        <LaneDayFigures ctx={ctx} lane={lane} day={day} />\n    </chakra.button>;\n});\n/**\n * A lane (#1568, A3): a shift's row of the work requirement — its name cell the disclosure of its skill rows (A3.7),\n * holding the shift's swatch, label and hours and the week's hours rostered against needed over the difference they\n * state, what its days' slots are short where any is (K4: no day's surplus nets another's shortfall) — then a day a cell.\n */\nconst LaneRow = memo(function LaneRow({ ctx, row, toggle, measure }: {\n    ctx: ViewContext; row: Extract<DemandRow, { kind: \"lane\" }>; toggle: (lane: string) => void; measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, format, read, value } = ctx;\n    const { lane } = row;\n    const d = stated(lane.total.rostered, lane.total.needed, lane.total.short);\n    return <Box ref={measure} css={styles.peopleRow} data-roster-lane={row.key} data-roster-lane-group={row.group?.key} data-roster-lane-shift={lane.shift.key} data-density={value.settings.density.type}>\n        <chakra.button type=\"button\" css={[styles.laneName, styles.laneToggle]} aria-expanded={row.open} data-roster-lane-head=\"\" onClick={() => toggle(row.key)}>\n            <FontAwesomeIcon icon={faAngleRight} />\n            <Box as=\"span\" css={styles.laneSwatch} style={fillOf(lane.shift)} />\n            <Box as=\"span\" css={styles.laneLabel}>{lane.shift.label}</Box>\n            <Box as=\"span\" css={styles.laneHours}>{shiftHoursText(lane.shift)}</Box>\n            <Box as=\"span\" css={styles.laneWeek} data-roster-lane-week=\"\">{read.state !== \"held\" ? <Unread read={read} kind=\"number\" index={0} /> : <>\n                <Figure ctx={ctx} rostered={lane.total.rostered} needed={lane.total.needed} />\n                <Box as=\"span\" css={styles.laneDiff} data-roster-lane-difference=\"\" data-tone={toneOf(d)}>{signed(format.number, d)}</Box></>}</Box>\n        </chakra.button>\n        {SEVEN_DAYS.map(day => <LaneDay key={day} ctx={ctx} rowKey={row.key} group={row.group} lane={lane} day={day} />)}\n    </Box>;\n});\n/**\n * A skill row's day's figures (A4.3): the hours assigned against needed, the warning's where short, the difference they\n * state — what the day's slots are short of the skill where any is, never their net (K4) — and a 3px bar filled to the\n * share of the need its slots meet ({@link skillMet}).\n */\nfunction SkillFigures({ ctx, figures: f }: { ctx: ViewContext; figures: SkillFigures }) {\n    const { styles, format } = ctx;\n    const d = stated(f.assigned, f.needed, f.short);\n    return <>\n        <Box css={styles.laneLine}><Figure ctx={ctx} rostered={f.assigned} needed={f.needed} skill short={d < 0} /><Box as=\"span\" css={styles.laneDiff} data-roster-lane-difference=\"\" data-tone={toneOf(d)}>{signed(format.number, d)}</Box></Box>\n        <Box css={styles.skillBar} data-roster-skill-bar=\"\"><Box css={styles.weekFillValue} style={{ width: `${skillMet(f) * 100}%` }} /></Box>\n    </>;\n}\n/**\n * A skill row under an open lane (#1568, A4): its code tag and name, the week's hours assigned against needed, then a day\n * a cell — empty where none of the day's slots needs the skill.\n */\nconst SkillRow = memo(function SkillRow({ ctx, row, measure }: { ctx: ViewContext; row: Extract<DemandRow, { kind: \"skill\" }>; measure: (el: HTMLElement | null) => void }) {\n    const { styles, read, value } = ctx;\n    const activity = activityOf(value, row.skill.skill);\n    return <Box ref={measure} css={styles.peopleRow} data-roster-lane-skill={row.key} data-density={value.settings.density.type}>\n        <Box css={styles.laneName} data-skill=\"\">\n            {activity?.code && <Box as=\"span\" css={styles.skillTag}>{activity.code}</Box>}\n            <Box as=\"span\" css={styles.skillName}>{activity?.label ?? row.skill.skill}</Box>\n            <Box as=\"span\" css={styles.laneWeek}>{read.state !== \"held\" ? <Unread read={read} kind=\"number\" index={1} /> : <Figure ctx={ctx} rostered={row.skill.total.assigned} needed={row.skill.total.needed} skill />}</Box>\n        </Box>\n        {SEVEN_DAYS.map(day => { const figures = row.skill.days[day]; return <Box key={day} css={styles.laneCell} data-roster-lane-skill-day={`${row.key}.${day}`}>\n            {read.state !== \"held\" ? <Unread read={read} kind=\"number\" index={day} /> : figures === undefined ? null : <SkillFigures ctx={ctx} figures={figures} />}</Box>; })}\n    </Box>;\n});\n/** The eyebrow before a band's people (#1568, A5): `Assignment · 12 people`, the people the band lists — `1 person` for one. */\nconst AssignHead = memo(function AssignHead({ ctx, row, measure }: { ctx: ViewContext; row: Extract<DemandRow, { kind: \"assign\" }>; measure: (el: HTMLElement | null) => void }) {\n    return <Box ref={measure} css={ctx.styles.assignRow} data-roster-assign-head={row.key}>\n        <Box as=\"span\" css={ctx.styles.assignLabel}>Assignment · {peopleSaid(ctx.format.number, row.people)}</Box>\n    </Box>;\n});\n\n/**\n * The People grid by week (#1406, §8): a sticky header, a group band a group, a row a person — and with targets the\n * work requirement over each band's people, or over everyone where it draws no bands (#1568).\n */\nfunction People({ props, ctx }: { props: RosterViewsProps; ctx: ViewContext }) {\n    const { collapsed, toggle } = useGroupCollapse(props.drag.surface);\n    const list = usePeopleRows(props.value, collapsed);\n    // The work requirement's rows (#1568): each band's, or the one block over every group's, their lanes opened by the viewer.\n    const demands = useDemands(props);\n    const { open, toggle: toggleLane } = useOpenLanes(props.drag.surface);\n    const people = useMemo(() => bandPeople(props.value), [props.value]);\n    const rows = useMemo(() => withDemand(list, props.value, demands, people, gridDemand(open)), [list, props.value, demands, open, people]);\n    // Each band's work requirement sticks under the header while its people scroll (A6).\n    const sections = useMemo(() => demandSections(rows), [rows]);\n    const index = useMemo(() => peopleIndex(props.week, props.held), [props.week, props.held]);\n    const { floors, measured, measure } = useRowFloors(PEOPLE_FLOORS);\n    // A new floor places every row again at it, the rows measured kept: a new key function is what has the rows' places\n    // worked out again.\n    const getItemKey = useCallback((i: number) => rows[i]!.key, [rows, floors]); // eslint-disable-line react-hooks/exhaustive-deps -- the floors re-key the places\n    const estimateSize = useCallback((i: number) => { const row = rows[i]!; return row.kind !== \"person\" ? floors[row.kind] : row.person === undefined ? floors.requests : floors.person; }, [rows, floors]);\n    // A row drawn again only as what it shows changes: the same function while the rows, the week and the views hold (CL9).\n    const renderRow = useCallback((i: number) => {\n        const row = rows[i]!;\n        switch (row.kind) {\n            case \"group\": {\n                const demand = demands.get(row.group.key);\n                return <GroupHeading scope=\"roster\" group={row.group} styles={ctx.styles} collapsed={collapsed.includes(row.group.key)} toggle={toggle} measure={measure(\"group\")}>\n                    {demand !== undefined && <BandDemand ctx={ctx} demand={demand} people={people.get(row.group.key) ?? 0} />}\n                </GroupHeading>;\n            }\n            case \"demand\": return <DemandHead ctx={ctx} row={row} measure={measure(\"demand\")} />;\n            case \"lane\": return <LaneRow ctx={ctx} row={row} toggle={toggleLane} measure={measure(\"lane\")} />;\n            case \"skill\": return <SkillRow ctx={ctx} row={row} measure={measure(\"skill\")} />;\n            case \"assign\": return <AssignHead ctx={ctx} row={row} measure={measure(\"assign\")} />;\n            case \"person\": {\n                const days = row.person === undefined ? requestDays(index, row.group) : index.person.get(row.person.key);\n                return <PersonRow ctx={ctx} row={row} index={i} rows={rows} days={days ?? NO_DAYS} duties={row.person === undefined ? undefined : index.duties.get(row.person.key)}\n                    measure={measure(row.person === undefined ? \"requests\" : \"person\")} />;\n            }\n        }\n    }, [rows, ctx, collapsed, toggle, index, measure, demands, people, toggleLane]);\n    const density = props.value.settings.density.type;\n    const header = <Box css={props.styles.peopleRow} data-roster-people-head=\"\" data-density={density}>\n        <Box css={props.styles.peopleName} data-head=\"\"><Box css={props.styles.shiftLabel}>People · Week</Box><Box css={props.styles.shiftLabel}>Hours</Box></Box>\n        {SEVEN_DAYS.map(day => { const date = new Date(props.start.getTime() + day * DAY); return <Box key={day} css={props.styles.shiftHead} data-roster-column-header=\"\" data-week=\"\" data-people=\"\" data-selected={props.day === day ? \"\" : undefined}>\n            <Box css={props.styles.shiftLabel}>{props.format.weekday(date)} {date.getUTCDate() === 1 ? `${props.format.number(1)} ${props.format.month(date)}` : props.format.number(date.getUTCDate())}</Box></Box>; })}\n    </Box>;\n    // Where the rows' view rests, by its top row's key (#1398): saved as a scroll settles, brought back as they mount.\n    const { onAnchor } = props;\n    const save = useCallback((at: RowAnchor) => onAnchor?.({ people: at }), [onAnchor]);\n    const { restore, onAnchorChange } = useRowAnchor(rows, props.anchor?.people, save, measured);\n    // ↑ / ↓ on a person's name step to the next person, selected for the week in view; a pick in Search Records focuses its person's name (#1398).\n    const { focus, onKeyDown } = usePeopleArrows(rows, props.select, props.start, props.picked);\n    return <Box css={props.styles.main} data-roster-grid=\"people\" onKeyDown={onKeyDown}>\n        <PeopleFocusContext.Provider value={focus}>\n            <VirtualRows fillParent height={undefined} maxHeight={undefined} minWidth=\"var(--roster-people-width)\" rootCss={props.styles.scroll}\n                header={header} sections={sections} count={rows.length} getItemKey={getItemKey} estimateSize={estimateSize} anchorable={ANCHOR_EVERY_ROW}\n                scrollToIndex={selectedPeopleRow(props, rows)} scrollAlign=\"auto\" renderRow={renderRow}\n                onAnchorChange={onAnchorChange} restoreAnchor={restore} />\n        </PeopleFocusContext.Provider>\n    </Box>;\n}\n\n// ── The month (#1406, §8, P12–P16) ─────────────────────────────────────────────────────────────────────────────────\n\n/**\n * A week column's header: `W10` and its dates over its seven days' ticks; a press opens the week in Week (P12), and with\n * Week not offered it is a heading alone: nothing to press, no tab stop and nothing said of opening. Its\n * label holds both forms of its dates — as the shared range prints them, `Mar 5 – 11, 2028`, and their days alone, the\n * month name dropped, `5 – 11` — the one the header's fit chose in its place and the other laid out unseen beside it,\n * so the fit measures each whole ({@link useMonthHeadFit}).\n */\nfunction WeekColumnHead({ ctx, week, current }: { ctx: ViewContext; week: Date; current: boolean }) {\n    const { styles, format } = ctx;\n    const last = new Date(week.getTime() + 6 * DAY);\n    const number = weekNumber(week), range = format.range(week, last);\n    const days = `${format.number(week.getUTCDate())} – ${format.number(last.getUTCDate())}`;\n    const heading = { css: styles.weekHead, \"data-roster-week-column\": weekKey(week), \"data-roster-column-header\": \"\", \"data-selected\": current ? \"\" : undefined };\n    const body = <>\n        <Box css={styles.weekNumber} data-roster-week-label=\"\"><span data-roster-week-number=\"\">W{format.number(number)}</span>\n            <Box as=\"span\" css={styles.weekRange} data-roster-week-dates=\"full\">{range}</Box><Box as=\"span\" css={styles.weekRange} data-roster-week-dates=\"days\">{days}</Box></Box>\n        <Box css={styles.dayTicks}>{SEVEN_DAYS.map(day => { const date = new Date(week.getTime() + day * DAY); return <Box key={day} css={styles.dayTick} data-roster-day-tick=\"\">\n            <span data-roster-day-letter=\"\">{format.weekday(date).slice(0, 1).toLocaleUpperCase(format.locale)}</span><span data-roster-day-number=\"\">{format.number(date.getUTCDate())}</span></Box>; })}</Box>\n    </>;\n    return ctx.opensWeek ? <chakra.button type=\"button\" {...heading} aria-label={`Open W${format.number(number)} · ${range}`} onClick={() => ctx.openWeek(week)}>{body}</chakra.button> : <Box {...heading}>{body}</Box>;\n}\n/**\n * How the month's header fits its columns (the hand retest, R3, ruled 27 Oct 2026: \"Fit rule now\"): each week's label\n * in the richest form every column holds whole — its dates, then its dates with the month name dropped, then its number\n * alone — and the day ticks' letters, and their numbers, only where every day holds its own whole, the 2px between two\n * ticks keeping each clear of the next, as the marks are lettered only where a day is wide enough. Nothing is cut.\n */\ninterface MonthHeadFit {\n    /** The week labels' form: their dates, their dates' days alone, or their numbers alone. */\n    readonly label: \"full\" | \"days\" | \"number\";\n    /** Whether the ticks show their days' letters, and their numbers. */\n    readonly letters: boolean;\n    readonly numbers: boolean;\n}\n/** The header before it is measured, and where it cannot be (no layout): every word in its place. */\nconst MONTH_HEAD_WHOLE: MonthHeadFit = { label: \"full\", letters: true, numbers: true };\n/** A computed length in pixels; none, 0. */\nconst px = (value: string) => Number.parseFloat(value) || 0;\n/** An element's width with what its box cuts of its content: its words' natural width, whatever clips them; none, 0. */\nconst natural = (el: Element | null) => el === null ? 0 : el.getBoundingClientRect().width + Math.max(0, el.scrollWidth - el.clientWidth);\n/**\n * The month's header measured as it is laid out: each week label's room against its number and each form of its dates\n * at their natural widths — the one shown, whatever its box cut of it, and the other laid out unseen — and each tick's\n * room against its letter and its number, which keep their width unseen. What it reads never moves with the fit, so a\n * measure never loops.\n *\n * @param head - The header's row\n * @returns How it fits\n */\nfunction measureMonthHead(head: HTMLElement): MonthHeadFit {\n    let full = true, days = true, letters = true, numbers = true;\n    for (const label of head.querySelectorAll<HTMLElement>(\"[data-roster-week-label]\")) {\n        const css = getComputedStyle(label);\n        const room = label.getBoundingClientRect().width - px(css.paddingLeft) - px(css.paddingRight) + 0.5;\n        const own = natural(label.querySelector(\"[data-roster-week-number]\")) + px(css.columnGap);\n        if (own + natural(label.querySelector('[data-roster-week-dates=\"full\"]')) > room) full = false;\n        if (own + natural(label.querySelector('[data-roster-week-dates=\"days\"]')) > room) days = false;\n    }\n    for (const tick of head.querySelectorAll<HTMLElement>(\"[data-roster-day-tick]\")) {\n        const room = tick.getBoundingClientRect().width + 0.5;\n        if (natural(tick.querySelector(\"[data-roster-day-letter]\")) > room) letters = false;\n        if (natural(tick.querySelector(\"[data-roster-day-number]\")) > room) numbers = false;\n    }\n    return { label: full ? \"full\" : days ? \"days\" : \"number\", letters, numbers };\n}\n/**\n * A row's fit as it is laid out — the month's header's ({@link MonthHeadFit}) or a work requirement's eyebrow's by month\n * ({@link DemandWeekForm}): measured after each render, as the row resizes and as fonts arrive, before the browser\n * paints. What a measure reads never moves with the fit, so it never loops.\n *\n * @typeParam T - The fit\n * @param row - The row measured\n * @param measure - Its fit, as it is laid out; a module's own function, the same at every render\n * @param same - Whether two fits are the same, so an unmoved fit draws nothing again\n * @param initial - The fit before the row is measured, and where it cannot be (no layout)\n * @returns How it fits\n */\nfunction useLayoutFit<T>(row: RefObject<HTMLElement | null>, measure: (el: HTMLElement) => T, same: (a: T, b: T) => boolean, initial: T): T {\n    const [fit, setFit] = useState(initial);\n    const run = useCallback(() => {\n        const el = row.current;\n        if (el === null) return;\n        const next = measure(el);\n        setFit(was => same(was, next) ? was : next);\n    }, [row, measure, same]);\n    // After every render: the weeks, the figures, the locale or the density may have moved.\n    useLayoutEffect(() => { run(); });\n    useLayoutEffect(() => {\n        const el = row.current;\n        if (el === null) return undefined;\n        const observer = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(run);\n        observer?.observe(el);\n        const fonts = el.ownerDocument.fonts as FontFaceSet | undefined;\n        fonts?.addEventListener?.(\"loadingdone\", run);\n        void fonts?.ready?.then(run, () => undefined);\n        return () => {\n            observer?.disconnect();\n            fonts?.removeEventListener?.(\"loadingdone\", run);\n        };\n    }, [row, run]);\n    return fit;\n}\n/** Whether two of the month's header's fits are the same. */\nconst sameMonthHeadFit = (a: MonthHeadFit, b: MonthHeadFit) => a.label === b.label && a.letters === b.letters && a.numbers === b.numbers;\n/**\n * The month's header's fit ({@link MonthHeadFit}).\n *\n * @param head - The header's row\n * @returns How it fits\n */\nfunction useMonthHeadFit(head: RefObject<HTMLElement | null>): MonthHeadFit {\n    return useLayoutFit(head, measureMonthHead, sameMonthHeadFit, MONTH_HEAD_WHOLE);\n}\n/**\n * A day's mark in a week cell (P13): the shift's letter — its code's first, never the whole code, which the mark would\n * cut (#1569) — in its colour, an off day faint; dashed where a pattern previews it; drafted against its own week as held.\n */\nfunction Mark({ ctx, held, day, duties, preview, letters }: { ctx: ViewContext; held: Week; day: number; duties: readonly DayDuty[]; preview: PatternDay | undefined; letters: boolean }) {\n    const { value, styles } = ctx;\n    // While a pattern hovers the cell its seven marks are the pattern's days, dashed (P15).\n    if (preview !== undefined) {\n        const shift = preview.shift === undefined ? undefined : shiftOf(value, preview.shift);\n        return <Box as=\"span\" css={styles.mark} data-roster-mark={day} data-preview={preview.kind} data-off={shift === undefined ? \"\" : undefined} style={fillOf(shift)}>{letters ? shiftLetter(shift) : \"\"}</Box>;\n    }\n    const live = duties.filter(duty => !duty.removed);\n    const first = live[0] ?? duties[0];\n    if (first === undefined) return <Box as=\"span\" css={styles.mark} data-roster-mark={day} data-off=\"\" />;\n    const shift = shiftOf(value, first.a.place.shift);\n    const drafted = first.removed || (() => { const baseline = held.assignments.get(first.id); return baseline === undefined || !ctx.domain.sameAssignment(baseline, first.a); })();\n    return <Box as=\"span\" css={styles.mark} data-roster-mark={day} data-shift={first.a.place.shift} data-removed={live.length === 0 ? \"\" : undefined} data-drafted={drafted ? \"\" : undefined}\n        style={live.length === 0 ? undefined : fillOf(shift)} title={`${shift?.label ?? first.a.place.shift}${live.length > 1 ? ` +${live.length - 1}` : \"\"}`}>{letters ? shiftLetter(shift) : \"\"}</Box>;\n}\n/**\n * A person's week in the month (P13–P15): seven marks, a drop target for a pattern, a click selecting the person-week;\n * tinted while a day of it is drafted; a placeholder strip while the month is not read (P26).\n */\nconst MonthCell = memo(function MonthCell({ ctx, person, rowKey, held, days, letters, selected }: {\n    ctx: ViewContext; person: Person | undefined;\n    /** The row's key: the person's, or its requests' (`requests:<group>`, or `requests` for every group's, #1567). */\n    rowKey: string;\n    held: WeekState; days: WeekDays; letters: boolean; selected: boolean;\n}) {\n    const { drag, styles, commands, value } = ctx;\n    const key = rowKey;\n    const start = held.start;\n    const coord = useMemo(() => drag.enabled ? rosterPersonWeekCoord(drag.surface, key, start) : null, [drag.enabled, drag.surface, key, start]);\n    const accepts = useCallback((payload: DragPayload) => isPatternCard(payload, drag.surface), [drag.surface]);\n    const canDrop = useCallback((event: DragEventValue) => drag.run(event, true) === undefined, [drag]);\n    const [previewKey, setPreviewKey] = useState<string>();\n    const onHover = useCallback((_x: number, _y: number, payload: DragPayload) => { if (payload.kind === \"item\" && isPatternCard(payload, drag.surface)) setPreviewKey(payload.from.key); }, [drag.surface]);\n    const onLeave = useCallback(() => setPreviewKey(undefined), []);\n    const ref = useDropCell(coord, !drag.enabled, canDrop, undefined, { accepts, caption: drag.caption, name: drag.name, onHover, onLeave });\n    const plan = useMemo(() => previewKey === undefined || person === undefined ? undefined : commands.pattern(person.key, start, previewKey), [previewKey, person, commands, start]);\n    const previewDays = typeof plan === \"object\" ? plan.days : undefined;\n    const revealed = useRevealed() === true;\n    const unread = ctx.read.state !== \"held\";\n    const drafted = !unread && SEVEN_DAYS.some(day => dayDrafted(ctx.domain, held.held, days[day] ?? NO_DUTIES));\n    return <chakra.button ref={ref as (el: HTMLButtonElement | null) => void} type=\"button\" css={styles.monthCell} data-roster-person-week={`${key}.${weekKey(start)}`} data-selected={selected ? \"\" : undefined}\n        data-drafted={drafted ? \"\" : undefined} data-pattern-hover={previewKey !== undefined ? \"\" : undefined} data-density={value.settings.density.type}\n        aria-label={`${person?.name ?? value.vocabulary.requests} · W${ctx.format.number(weekNumber(start))}`} aria-pressed={selected}\n        onClick={() => person !== undefined && ctx.select({ type: \"personWeek\", key, start: start.getTime() })}>\n        {ctx.read.state === \"failed\" ? null : <Box css={styles.markStrip} data-roster-mark-strip=\"\">\n            {SEVEN_DAYS.map(day => unread ? (revealed ? <Box key={day} as=\"span\" css={styles.mark} data-roster-mark={day} data-pending=\"\" /> : null)\n                : <Mark key={day} ctx={ctx} held={held.held} day={day} duties={days[day] ?? NO_DUTIES} preview={previewDays?.[day]} letters={letters} />)}\n        </Box>}\n    </chakra.button>;\n});\n/** A person's row in the month: the name cell — the name and the badge alone (P16) — then a cell a week. */\nconst MonthRow = memo(function MonthRow({ ctx, row, index, rows, weeks, indexes, letters, measure }: {\n    ctx: ViewContext; row: PersonRowValue; index: number; rows: readonly PeopleRow[]; weeks: readonly WeekState[]; indexes: readonly PeopleIndex[]; letters: boolean;\n    measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, value } = ctx;\n    const person = row.person, key = person?.key ?? row.key;\n    peopleDrawProbe?.(\"row\", key);\n    const focus = useContext(PeopleFocusContext);\n    const name = useRef<HTMLButtonElement>(null);\n    const stepped = person !== undefined && focus.key === person.key;\n    useLayoutEffect(() => { if (stepped && name.current !== null) { name.current.focus({ preventScroll: true }); focus.done(); } }, [stepped, focus]);\n    const picked = useContext(PersonWeekContext);\n    const style = { \"--roster-weeks\": weeks.length } as CSSProperties;\n    const nameSelected = person !== undefined && picked !== undefined && picked.key === person.key && weeks.some(held => held.start.getTime() === picked.start);\n    // The failure said once, across the first person's cells in view (CL11).\n    const says = useRowsTop(top => ctx.read.state === \"failed\" && firstPersonInView(rows, top) === index);\n    return <Box ref={measure} css={styles.monthRow} style={style} data-roster-person-row={key} data-density={value.settings.density.type} data-roster-unread={ctx.read.state !== \"held\" ? \"\" : undefined}>\n        <NameCell ctx={ctx} person={person} rowKey={key} weekSelected={nameSelected} nameRef={name} hours={null} />\n        {says && ctx.read.state === \"failed\" ? <Box css={styles.readLine} data-roster-read-line=\"\"><ReadFailure read={ctx.read} /></Box>\n            : weeks.map((held, i) => <MonthCell key={held.start.getTime()} ctx={ctx} person={person} rowKey={key} held={held} letters={letters}\n                days={(person === undefined ? requestDays(indexes[i]!, row.group) : indexes[i]!.person.get(person.key)) ?? NO_DAYS}\n                selected={person !== undefined && picked !== undefined && picked.key === person.key && picked.start === held.start.getTime()} />)}\n    </Box>;\n});\n/**\n * How the work requirement's eyebrow by month says each week's hours (#1568), by the month's header's fit rule (R3):\n * in the richest form every week's column holds whole — `1,352 / 1,298 h`; then the unit dropped, `1,352 / 1,298`; then\n * the hours rostered over the hours needed, `/ 1,298` under `1,352` — and none where even that does not fit. Nothing is\n * cut.\n */\ntype DemandWeekForm = \"full\" | \"short\" | \"stacked\" | \"none\";\n/** The forms, richest first. */\nconst DEMAND_WEEK_FORMS = [\"full\", \"short\", \"stacked\"] as const;\n/**\n * The eyebrow by month measured as it is laid out: each week's room against each form of its hours at their natural\n * widths — the one shown, and the others laid out unseen beside it — the richest form every week holds. A week still\n * read holds none, and decides nothing.\n *\n * @param row - The eyebrow's row\n * @returns Its form\n */\nfunction measureDemandWeeks(row: HTMLElement): DemandWeekForm {\n    const fits = new Set<DemandWeekForm>(DEMAND_WEEK_FORMS);\n    for (const cell of row.querySelectorAll<HTMLElement>(\"[data-roster-demand-week]\")) {\n        if (cell.querySelector(\"[data-roster-demand-form]\") === null) continue;\n        const css = getComputedStyle(cell);\n        const room = cell.getBoundingClientRect().width - px(css.borderLeftWidth) - px(css.paddingLeft) - px(css.paddingRight) + 0.5;\n        for (const form of DEMAND_WEEK_FORMS) if (natural(cell.querySelector(`[data-roster-demand-form=\"${form}\"]`)) > room) fits.delete(form);\n    }\n    return DEMAND_WEEK_FORMS.find(form => fits.has(form)) ?? \"none\";\n}\n/**\n * The work requirement's eyebrow by month (#1568, A2.2): the vocabulary's heading, then each week's hours rostered\n * against needed, no valence, in the form every week's column holds whole ({@link DemandWeekForm}): each form of a\n * week's hours is laid out, the one shown in its place and the others unseen beside it, so the fit measures each whole.\n */\nconst MonthDemandHead = memo(function MonthDemandHead({ ctx, row, weeks, measure }: {\n    ctx: ViewContext; row: Extract<DemandRow, { kind: \"demand\" }>; weeks: readonly WeekState[]; measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, format, read, value } = ctx;\n    const own = useRef<HTMLDivElement>(null);\n    const form = useLayoutFit(own, measureDemandWeeks, Object.is, \"full\");\n    const ref = useCallback((el: HTMLDivElement | null) => { own.current = el; measure(el); }, [measure]);\n    return <Box ref={ref} css={styles.demandRow} data-period=\"month\" data-roster-demand={row.key} data-demand-form={form}>\n        <Box css={styles.demandName} data-roster-demand-heading=\"\">{value.vocabulary.demand}</Box>\n        {weeks.map((held, w) => {\n            const figures = row.demand.weeks[w];\n            const rostered = figures === undefined ? \"\" : format.number(figures.rostered), needed = figures === undefined ? \"\" : format.number(figures.needed);\n            return <Box key={held.start.getTime()} css={styles.demandFigure} data-roster-demand-week={weekKey(held.start)}>\n                {read.state !== \"held\" || figures === undefined ? <Unread read={read} kind=\"number\" index={w} /> : <>\n                    <span data-roster-demand-form=\"full\">{`${rostered} / ${needed} h`}</span>\n                    <span data-roster-demand-form=\"short\">{`${rostered} / ${needed}`}</span>\n                    <span data-roster-demand-form=\"stacked\"><span>{rostered}</span><span>{`/ ${needed}`}</span></span>\n                </>}\n            </Box>;\n        })}\n    </Box>;\n});\n/**\n * A cup's levels by month (ruled 8 Nov 2026), as its recipe places its parts: each a share of its height; none for an\n * empty cup, whose levels are the recipe's nothing.\n *\n * @param cup - The cup's levels\n * @returns Its style\n */\nfunction cupStyle(cup: DemandCup): CSSProperties | undefined {\n    return cup.fill === 0 ? undefined\n        : { \"--roster-cup-permanent\": `${cup.permanent * 100}%`, \"--roster-cup-agency\": `${cup.agency * 100}%`, \"--roster-cup-fill\": `${cup.fill * 100}%` } as CSSProperties;\n}\n/**\n * A cup's parts by month (ruled 8 Nov 2026): each part of the hours that fills it from the bottom — a lane's permanent\n * staff's, agency staff's and the agencies' requests', or a skill's hours assigned — then, on a short day, what it lacks:\n * where nothing fills the cup, the whole cup (`data-whole`), its edge closed along the bottom too (ruled 9 Nov 2026).\n *\n * @param cup - The cup's levels\n * @param state - Its mark's state\n * @param skill - Whether it is a skill row's, filled by its hours assigned alone\n * @returns Its parts, which its recipe places by its levels\n */\nfunction cupParts(cup: DemandCup, state: DemandMark[\"state\"], skill: boolean): ReactNode {\n    return <>\n        {skill ? cup.fill > 0 && <span data-roster-cup-part=\"assigned\" /> : <>\n            {cup.permanent > 0 && <span data-roster-cup-part=\"permanent\" />}\n            {cup.agency > cup.permanent && <span data-roster-cup-part=\"agency\" />}\n            {cup.fill > cup.agency && <span data-roster-cup-part=\"requested\" />}\n        </>}\n        {state === \"short\" && <span data-roster-cup-part=\"open\" data-whole={cup.fill === 0 ? \"\" : undefined} />}\n    </>;\n}\n/**\n * A lane's day by month (#1568, A3.5): its mark, a cup (ruled 8 Nov 2026) filled from the bottom to its hours rostered\n * of those needed, full at them, in its parts' colours as the day's bar by week draws them — the agencies' requests on\n * top, solid — what a short day lacks open above them, dashed in the warning's edge on its wash; an empty cup with no\n * target. It says its difference where a day is wide enough and the figure fits the mark whole, never cut, and its\n * label always, after its hours, as a lane's day's does. A press selects its slot in its week (A3.8): a band's group's,\n * or the shift's day across the groups where the layout draws no bands, which the inspector then reads.\n */\nconst LaneMark = memo(function LaneMark({ ctx, rowKey, group, lane, week, day, figures: f, said }: {\n    ctx: ViewContext; rowKey: string; group: Group | undefined; lane: DemandLane; week: Date; day: number; figures: DemandFigures;\n    /** Whether the mark says its difference: a day 22px wide or wider. */\n    said: boolean;\n}) {\n    const { styles, format } = ctx;\n    const selection = useContext(SelectionContext);\n    const shift = lane.shift.key, start = week.getTime();\n    const slot = useMemo(() => group === undefined ? undefined : { day: BigInt(day), group: group.key, shift }, [group, day, shift]);\n    // A selection names its week, the one the views then show (`start`): its day's mark in that week alone is selected.\n    const selected = ctx.start.getTime() === start\n        && (slot !== undefined ? selectedSlot(selection, slot) : selection?.type === \"shiftDay\" && selection.shift === shift && selection.day === day);\n    const mark = laneMark(f), cup = laneCup(f);\n    const when = `${lane.shift.label} · ${format.weekdayDate(new Date(start + day * DAY))}${group === undefined ? \"\" : ` · ${group.label}`}`;\n    const figure = said && mark.state !== \"off\" ? signed(format.number, mark.difference) : \"\";\n    return <chakra.button type=\"button\" css={[styles.mark, styles.laneMark]} data-roster-lane-mark={`${rowKey}.${weekKey(week)}.${day}`} data-state={mark.state}\n        data-selected={selected ? \"\" : undefined} aria-pressed={selected} style={cupStyle(cup)}\n        aria-label={f.target ? `${when}: ${format.number(f.rostered)} of ${format.number(f.needed)} hours rostered${differenceSaid(format.number, mark.difference)}` : `${when}: no target`}\n        onClick={() => ctx.select(slot !== undefined ? { type: \"requirement\", slot, start } : { type: \"shiftDay\", shift, day, start })}>\n        {cupParts(cup, mark.state, false)}\n        {figure !== \"\" && <span data-roster-mark-figure=\"\">{figure}</span>}\n    </chakra.button>;\n});\n/**\n * A lane's week by month (A3.5): its seven marks on the person marks' day columns — while the span is not read, a\n * placeholder each once the frame's reveal says so, and none where its read failed, as a person's week cell draws.\n */\nconst LaneWeek = memo(function LaneWeek({ ctx, row, week, w, said }: {\n    ctx: ViewContext; row: Extract<DemandRow, { kind: \"lane\" }>; week: Date; w: number; said: boolean;\n}) {\n    const { styles, read } = ctx;\n    const revealed = useRevealed() === true;\n    return <Box css={styles.monthCell} data-roster-lane-week={`${row.key}.${weekKey(week)}`}>\n        {read.state === \"failed\" ? null : <Box css={styles.markStrip}>\n            {SEVEN_DAYS.map(day => read.state !== \"held\" ? (revealed ? <Box key={day} as=\"span\" css={styles.mark} data-pending=\"\" /> : null)\n                : <LaneMark key={day} ctx={ctx} rowKey={row.key} group={row.group} lane={row.lane} week={week} day={day} figures={row.lane.days[w * 7 + day]!} said={said} />)}\n        </Box>}\n    </Box>;\n});\n/**\n * A lane by month (#1568, A3.2): its name cell — its chevron, the shift's swatch and its label, no figures (P16) — the\n * disclosure of its skill rows, then a cell a week.\n */\nconst MonthLaneRow = memo(function MonthLaneRow({ ctx, row, weeks, said, toggle, measure }: {\n    ctx: ViewContext; row: Extract<DemandRow, { kind: \"lane\" }>; weeks: readonly WeekState[]; said: boolean; toggle: (lane: string) => void;\n    measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, value } = ctx;\n    const { lane } = row;\n    return <Box ref={measure} css={styles.monthRow} data-roster-lane={row.key} data-roster-lane-group={row.group?.key} data-roster-lane-shift={lane.shift.key} data-density={value.settings.density.type}>\n        <chakra.button type=\"button\" css={[styles.laneName, styles.laneToggle]} aria-expanded={row.open} data-roster-lane-head=\"\" data-period=\"month\" onClick={() => toggle(row.key)}>\n            <FontAwesomeIcon icon={faAngleRight} />\n            <Box as=\"span\" css={styles.laneSwatch} style={fillOf(lane.shift)} />\n            <Box as=\"span\" css={styles.laneLabel}>{lane.shift.label}</Box>\n        </chakra.button>\n        {weeks.map((held, w) => <LaneWeek key={held.start.getTime()} ctx={ctx} row={row} week={held.start} w={w} said={said} />)}\n    </Box>;\n});\n/**\n * A skill row's week by month (A4.4): its seven marks as a lane's are, each a cup (ruled 8 Nov 2026) filled to the\n * hours assigned it of those needed, full at them, what a short day lacks open above them — an empty cup where none of\n * the day's slots needs the skill — none pressable, each its hours on hover, then the difference it states, as a\n * lane's day's label says it.\n */\nconst SkillWeek = memo(function SkillWeek({ ctx, row, week, w, said }: {\n    ctx: ViewContext; row: Extract<DemandRow, { kind: \"skill\" }>; week: Date; w: number; said: boolean;\n}) {\n    const { styles, read, format, value } = ctx;\n    const revealed = useRevealed() === true;\n    const label = activityOf(value, row.skill.skill)?.label ?? row.skill.skill;\n    return <Box css={styles.monthCell} data-roster-lane-skill-week={`${row.key}.${weekKey(week)}`}>\n        {read.state === \"failed\" ? null : <Box css={styles.markStrip}>\n            {SEVEN_DAYS.map(day => {\n                if (read.state !== \"held\") return revealed ? <Box key={day} as=\"span\" css={styles.mark} data-pending=\"\" /> : null;\n                const f = row.skill.days[w * 7 + day], mark = skillMark(f), cup = skillCup(f);\n                const figure = said && mark.state !== \"off\" ? signed(format.number, mark.difference) : \"\";\n                return <Box key={day} as=\"span\" css={[styles.mark, styles.laneMark]} data-roster-lane-skill-mark={`${row.key}.${weekKey(week)}.${day}`} data-state={mark.state}\n                    style={cupStyle(cup)}\n                    title={f === undefined ? undefined : `${label} · ${format.weekdayDate(new Date(week.getTime() + day * DAY))}: ${format.number(f.assigned)} of ${format.number(f.needed)} hours assigned${differenceSaid(format.number, mark.difference)}`}>\n                    {cupParts(cup, mark.state, true)}\n                    {figure !== \"\" && <span data-roster-mark-figure=\"\">{figure}</span>}\n                </Box>;\n            })}\n        </Box>}\n    </Box>;\n});\n/** A skill row by month (#1568, A4.2): its code tag and name, no figures (P16), then a cell a week. */\nconst MonthSkillRow = memo(function MonthSkillRow({ ctx, row, weeks, said, measure }: {\n    ctx: ViewContext; row: Extract<DemandRow, { kind: \"skill\" }>; weeks: readonly WeekState[]; said: boolean; measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, value } = ctx;\n    const activity = activityOf(value, row.skill.skill);\n    return <Box ref={measure} css={styles.monthRow} data-roster-lane-skill={row.key} data-density={value.settings.density.type}>\n        <Box css={styles.laneName} data-skill=\"\">\n            {activity?.code && <Box as=\"span\" css={styles.skillTag}>{activity.code}</Box>}\n            <Box as=\"span\" css={styles.skillName}>{activity?.label ?? row.skill.skill}</Box>\n        </Box>\n        {weeks.map((held, w) => <SkillWeek key={held.start.getTime()} ctx={ctx} row={row} week={held.start} w={w} said={said} />)}\n    </Box>;\n});\n/** An element's width, measured as it mounts and as it resizes: what the month's 13px letter rule reads (P13). */\nfunction useWidth(): [RefObject<HTMLDivElement | null>, number] {\n    const ref = useRef<HTMLDivElement>(null);\n    const [width, setWidth] = useState(0);\n    useLayoutEffect(() => {\n        const el = ref.current;\n        if (el === null) return;\n        const measure = () => setWidth(el.getBoundingClientRect().width);\n        measure();\n        if (typeof ResizeObserver === \"undefined\") return;\n        const observer = new ResizeObserver(measure);\n        observer.observe(el);\n        return () => observer.disconnect();\n    }, []);\n    return [ref, width];\n}\n/**\n * The People grid by month (#1406, §8): a column a week touching the month, a row a person, a cell seven marks — and\n * with targets the work requirement over each band's people, or over everyone where it draws no bands, a mark a day\n * (#1568).\n */\nfunction MonthGrid({ props, ctx }: { props: RosterViewsProps; ctx: ViewContext }) {\n    const { collapsed, toggle } = useGroupCollapse(props.drag.surface);\n    const list = usePeopleRows(props.value, collapsed);\n    // The work requirement's rows over the month's weeks (#1568): each band's, or the one block over every group's, their lanes opened by the viewer.\n    const demands = useDemands(props);\n    const { open, toggle: toggleLane } = useOpenLanes(props.drag.surface);\n    const people = useMemo(() => bandPeople(props.value), [props.value]);\n    const rows = useMemo(() => withDemand(list, props.value, demands, people, gridDemand(open)), [list, props.value, demands, open, people]);\n    // Each band's work requirement sticks under the header while its people scroll (A6).\n    const sections = useMemo(() => demandSections(rows), [rows]);\n    const weeks = props.weeks;\n    const indexes = useMemo(() => weeks.map(held => peopleIndex(held.week, held.held)), [weeks]);\n    const { floors, measured, measure } = useRowFloors(PEOPLE_FLOORS);\n    const getItemKey = useCallback((i: number) => rows[i]!.key, [rows, floors]); // eslint-disable-line react-hooks/exhaustive-deps -- the floors re-key the places\n    const estimateSize = useCallback((i: number) => { const row = rows[i]!; return row.kind !== \"person\" ? floors[row.kind] : row.person === undefined ? floors.requests : floors.person; }, [rows, floors]);\n    // The letters show where a day is 13px or wider (P13), and a lane's figures where it is 22px or wider (A3.5): the\n    // grid's width less the name column, over the weeks, over seven days.\n    const [root, width] = useWidth();\n    const dayWidth = width === 0 ? Infinity : ((width - 168) / Math.max(weeks.length, 1) - 4) / 7 - 2;\n    const letters = ctx.letters && dayWidth >= 13;\n    const said = dayWidth >= 22;\n    const renderRow = useCallback((i: number) => {\n        const row = rows[i]!;\n        switch (row.kind) {\n            case \"group\": {\n                const demand = demands.get(row.group.key);\n                return <GroupHeading scope=\"roster\" group={row.group} styles={ctx.styles} collapsed={collapsed.includes(row.group.key)} toggle={toggle} measure={measure(\"group\")}>\n                    {demand !== undefined && <BandDemand ctx={ctx} demand={demand} people={people.get(row.group.key) ?? 0} />}\n                </GroupHeading>;\n            }\n            case \"demand\": return <MonthDemandHead ctx={ctx} row={row} weeks={weeks} measure={measure(\"demand\")} />;\n            case \"lane\": return <MonthLaneRow ctx={ctx} row={row} weeks={weeks} said={said} toggle={toggleLane} measure={measure(\"lane\")} />;\n            case \"skill\": return <MonthSkillRow ctx={ctx} row={row} weeks={weeks} said={said} measure={measure(\"skill\")} />;\n            case \"assign\": return <AssignHead ctx={ctx} row={row} measure={measure(\"assign\")} />;\n            case \"person\": return <MonthRow ctx={ctx} row={row} index={i} rows={rows} weeks={weeks} indexes={indexes} letters={letters} measure={measure(row.person === undefined ? \"requests\" : \"person\")} />;\n        }\n    }, [rows, ctx, collapsed, toggle, weeks, indexes, letters, said, measure, demands, people, toggleLane]);\n    const style = { \"--roster-weeks\": weeks.length } as CSSProperties;\n    // The selected person-week's column is marked (D11); none without a selection.\n    const picked = props.selection?.type === \"personWeek\" ? props.selection.start : undefined;\n    // What the header shows of each week's label and of its days is what fits whole (R3): its recipe hides the rest.\n    const head = useRef<HTMLDivElement>(null);\n    const fit = useMonthHeadFit(head);\n    const header = <Box ref={head} css={props.styles.monthRow} style={style} data-roster-month-head=\"\" data-density={props.value.settings.density.type}\n        data-week-label={fit.label} data-day-letters={fit.letters ? undefined : \"off\"} data-day-numbers={fit.numbers ? undefined : \"off\"}>\n        <Box css={props.styles.monthGutter}>People · Month</Box>\n        {weeks.map(held => <WeekColumnHead key={held.start.getTime()} ctx={ctx} week={held.start} current={held.start.getTime() === picked} />)}\n    </Box>;\n    const { onAnchor } = props;\n    const save = useCallback((at: RowAnchor) => onAnchor?.({ people: at }), [onAnchor]);\n    const { restore, onAnchorChange } = useRowAnchor(rows, props.anchor?.people, save, measured);\n    const { focus, onKeyDown } = usePeopleArrows(rows, props.select, props.start, props.picked);\n    return <Box ref={root} css={props.styles.main} data-roster-grid=\"people-month\" style={style} onKeyDown={onKeyDown}>\n        <PeopleFocusContext.Provider value={focus}>\n            <VirtualRows fillParent height={undefined} maxHeight={undefined} minWidth=\"var(--roster-people-width)\" rootCss={props.styles.scroll}\n                header={header} sections={sections} count={rows.length} getItemKey={getItemKey} estimateSize={estimateSize} anchorable={ANCHOR_EVERY_ROW}\n                scrollToIndex={selectedPeopleRow(props, rows)} scrollAlign=\"auto\" renderRow={renderRow}\n                onAnchorChange={onAnchorChange} restoreAnchor={restore} />\n        </PeopleFocusContext.Provider>\n    </Box>;\n}\n/** A duty's card on a phone: its name, its times and activity, its issues and its actions. */\nfunction AssignmentCard({ ctx, id, assignment, removed }: { ctx: ViewContext; id: string; assignment: Assignment; removed: boolean }) {\n    const selection = useContext(SelectionContext);\n    const baseline = ctx.held.assignments.get(id);\n    const drafted = removed || baseline === undefined || !ctx.domain.sameAssignment(baseline, assignment);\n    // What a run of the optimiser did to the duty (#1409, R27): its mark on the card, and its provenance on hover.\n    const mark = dutyMark(ctx, id, removed, drafted);\n    return <Box css={ctx.styles.card} data-roster-card={id} data-selected={selection?.type === \"assignment\" && selection.key === id ? \"\" : undefined} data-drafted={drafted ? \"\" : undefined}\n        data-conflict={ctx.conflicted(id) ? \"\" : undefined} data-bounds={ctx.bounded(id) ? \"\" : undefined}\n        data-op={mark?.op} data-fill={mark === undefined ? undefined : \"own\"} title={mark?.provenance}>\n        <chakra.button type=\"button\" css={ctx.styles.cardHead} onClick={() => ctx.select({ type: \"assignment\", key: id })}><Box css={ctx.styles.cardTitle}>{assignmentName(ctx.value, assignment)}{removed && \" · removed\"}</Box></chakra.button>\n        <Box css={ctx.styles.detail}>{`${ctx.format.time(assignment.start)}–${ctx.format.time(assignment.end)}`}{assignment.activity.type === \"some\" && ` · ${activityOf(ctx.value, assignment.activity.value)?.label ?? assignment.activity.value}`}</Box>\n        {dutyIssues(ctx.issues, id).map((issue, i) => <Box key={i} css={ctx.styles.flag} data-tone={issue.tone.type} data-roster-card-flag=\"\">{issue.title}</Box>)}\n        <AssignmentActions id={id} assignment={assignment} removed={removed} value={ctx.value} start={ctx.start} commands={ctx.commands} styles={ctx.styles} />\n    </Box>;\n}\n/**\n * The phone's People cards' estimate of each kind before one has mounted: a person's card is its seven days, each a\n * place action; the work requirement's eyebrow its seven day cards (#1568), each its head alone at the least.\n */\nconst AGENDA_FLOORS: Readonly<Record<RowKind, number>> = { group: 38, person: 360, requests: 60, demand: 560, lane: 36, skill: 36, assign: 28 };\n/**\n * A person's card on a phone, or a group's requests' — or every group's, each group's under its name (#1567): drawn\n * again only as what it shows changes (#1398, CL9).\n */\nconst PersonCard = memo(function PersonCard({ ctx, row, index, rows, days, requests, measure }: {\n    ctx: ViewContext; row: PersonRowValue; index: number; rows: readonly PeopleRow[]; days: WeekDays;\n    /** The row's requests, in the week's order: what its card lists. */\n    requests: readonly DayDuty[];\n    measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, format, start, value, commands } = ctx;\n    const person = row.person;\n    // The name a pick in Search Records gave the keyboard to takes the focus as its card is drawn, as a row's name does (#1398).\n    const focus = useContext(PeopleFocusContext);\n    const head = useRef<HTMLButtonElement>(null);\n    const given = person !== undefined && focus.key === person.key && ctx.read.state === \"held\";\n    useLayoutEffect(() => { if (given && head.current !== null) { head.current.focus({ preventScroll: true }); focus.done(); } }, [given, focus]);\n    // A week not read, or whose read failed (#1398): each person's card, their name and contract known without it, a\n    // placeholder where each day's duties go, never \"Off · assign\"; the failure said once, in the first card in view.\n    if (ctx.read.state === \"failed\") return <FailedPersonCard ctx={ctx} read={ctx.read} row={row} index={index} rows={rows} measure={measure} />;\n    if (ctx.read.state !== \"held\") return <Box ref={measure} css={styles.card} data-roster-person-card={person?.key ?? row.key} data-roster-unread=\"\">\n        <UnreadCardHead ctx={ctx} person={person} index={index} />\n        {person === undefined ? <Unread read={ctx.read} kind=\"chip\" index={index} />\n            : SEVEN_DAYS.map(day => <Box key={day} css={styles.agendaGroup}>\n                <Box css={styles.detail}>{format.weekday(new Date(start.getTime() + day * DAY))}</Box>\n                <Unread read={ctx.read} kind=\"chip\" index={index + day} /></Box>)}\n    </Box>;\n    const card = ({ id, a, removed }: DayDuty) => <AssignmentCard key={id} ctx={ctx} id={id} assignment={a} removed={removed} />;\n    return <Box ref={measure} css={styles.card} data-roster-person-card={person?.key ?? row.key}>\n        {person === undefined ? <><Box css={styles.cardHead}><Box css={styles.cardTitle}>{value.vocabulary.requests}</Box></Box>\n            {row.group !== undefined ? requests.map(card) : bandsOf(value.groups, noGroupBand(value)).map(group => {\n                // Every group's requests in one card: each group's under its name, in the groups' order, then those in no group yet (#1548).\n                const theirs = requests.filter(duty => (groupOf(duty.a) ?? NO_GROUP) === group.key);\n                return theirs.length === 0 ? null : <Box key={group.key} css={styles.agendaGroup} data-roster-requests-group={group.key}><Box css={styles.detail}>{group.label}</Box>{theirs.map(card)}</Box>;\n            })}</> : <>\n            <chakra.button ref={head} type=\"button\" css={styles.cardHead} data-roster-person-head={person.key} onClick={() => ctx.select({ type: \"personWeek\", key: person.key, start: start.getTime() })}>\n                <Box css={styles.cardTitle} data-roster-card-hours=\"\" data-opn={ctx.lit && ctx.optimised?.people.has(person.key) === true ? \"\" : undefined}>{person.name} · {format.number(ctx.hours.get(person.key) ?? 0)} / {format.number(person.contract)} h</Box></chakra.button>\n            {/* A phone's `Apply pattern…` (#1406, P22): the Chooser over the patterns, its choice applied as a drop is. */}\n            {value.patterns.length > 0 && <Box css={styles.actions}><ApplyPatternAction person={person} start={start} value={value} commands={commands} onError={ctx.onError} /></Box>}\n            {SEVEN_DAYS.map(day => {\n                const duties = days[day] ?? NO_DUTIES;\n                return <Box key={day} css={styles.agendaGroup}><Box css={styles.detail}>{format.weekday(new Date(start.getTime() + day * DAY))}</Box>\n                    {duties.map(card)}\n                    {/* \"Off · assign\" places the person in their home group, with or without its band (#1567). */}\n                    {!duties.some(duty => !duty.removed) && (commands.availableOn(BigInt(day)) || commands.locked !== undefined ? <PlaceAction label=\"Off · assign\" source={{ type: \"person\", key: person.key }} place={{ day: BigInt(day), group: some(person.group), shift: person.usual.type === \"some\" ? person.usual.value : value.shifts[0]!.key }} value={value} start={start} commands={commands} styles={styles} /> : <Box css={styles.detail}>Off</Box>)}\n                </Box>;\n            })}\n        </>}\n    </Box>;\n});\n/** A card's head while the week is not read: the person's name, and a placeholder for their hours beside their contract. */\nfunction UnreadCardHead({ ctx, person, index }: { ctx: ViewContext; person: Person | undefined; index: number }) {\n    return <Box css={ctx.styles.cardHead}><Box css={ctx.styles.cardTitle}>{person?.name ?? ctx.value.vocabulary.requests}</Box>\n        {person !== undefined && <Box css={ctx.styles.unreadValue}><Unread read={ctx.read} kind=\"number\" index={index} />{`/ ${ctx.format.number(person.contract)} h`}</Box>}</Box>;\n}\n/** A person's card of a week whose read failed (#1398, CL11): the failure said in the first card in view, which it reads itself. */\nfunction FailedPersonCard({ ctx, read, row, index, rows, measure }: {\n    ctx: ViewContext; read: Extract<PeriodRead, { state: \"failed\" }>; row: PersonRowValue; index: number; rows: readonly PeopleRow[];\n    measure: (el: HTMLElement | null) => void;\n}) {\n    const says = useRowsTop(top => firstPersonInView(rows, top) === index);\n    return <Box ref={measure} css={ctx.styles.card} data-roster-person-card={row.person?.key ?? row.key} data-roster-unread=\"\">\n        <UnreadCardHead ctx={ctx} person={row.person} index={index} />\n        {says && <ReadFailure read={read} />}\n    </Box>;\n}\n/**\n * A lane's day on a phone's day card (#1568): the shift's swatch and label, then its figures over its bar — or `no\n * target` — one button that selects it as a lane's day in the grid does (A3.8) and, a line being there to look at its\n * slot, opens the inspector's view on it.\n */\nconst LaneDayLine = memo(function LaneDayLine({ ctx, laneKey, group, lane, day }: {\n    ctx: ViewContext; laneKey: string; group: Group | undefined; lane: DemandLane; day: number;\n}) {\n    const { selected, label, inspect } = useLaneDay(ctx, group, lane, day);\n    return <chakra.button type=\"button\" css={ctx.styles.demandShift} data-roster-lane-day={`${laneKey}.${day}`} data-roster-lane-shift={lane.shift.key}\n        data-selected={selected ? \"\" : undefined} aria-pressed={selected} aria-label={label} onClick={inspect}>\n        <Box as=\"span\" css={ctx.styles.laneSwatch} style={fillOf(lane.shift)} />\n        <Box as=\"span\" css={ctx.styles.laneLabel}>{lane.shift.label}</Box>\n        <LaneDayFigures ctx={ctx} lane={lane} day={day} />\n    </chakra.button>;\n});\n/**\n * A day's card of the work requirement on a phone (#1568): its date and the day's hours rostered of needed, as the\n * grid's eyebrow says them, then a line a lane — the shift's figures that day.\n */\nfunction DemandDayCard({ ctx, row, day }: { ctx: ViewContext; row: Extract<AgendaDemandRow, { kind: \"demand\" }>; day: number }) {\n    const { styles, format, read, start } = ctx;\n    const figures = row.demand.days[day]!;\n    return <Box css={styles.card} data-roster-demand-card={`${row.key}.${day}`}>\n        <Box css={styles.cardHead}>\n            <Box css={styles.cardTitle}>{format.weekdayDate(new Date(start.getTime() + day * DAY))}</Box>\n            <Box css={styles.detail} data-roster-demand-day={day}>\n                {read.state !== \"held\" ? <Unread read={read} kind=\"number\" index={day} /> : `${format.number(figures.rostered)} / ${format.number(figures.needed)} h`}</Box>\n        </Box>\n        {row.demand.lanes.map(lane => <LaneDayLine key={lane.shift.key} ctx={ctx} laneKey={demandKey(\"lane\", row.group, lane.shift.key)} group={row.group} lane={lane} day={day} />)}\n    </Box>;\n}\n/**\n * The work requirement on a phone (#1568), before a band's people's cards — or, where the layout draws no bands,\n * everyone's: its eyebrow, the vocabulary's heading and the week's hours rostered of needed, then a card a day holding\n * its shifts' figures.\n */\nconst DemandCards = memo(function DemandCards({ ctx, row, measure }: {\n    ctx: ViewContext; row: Extract<AgendaDemandRow, { kind: \"demand\" }>; measure: (el: HTMLElement | null) => void;\n}) {\n    const { styles, format, read, value } = ctx;\n    const { rostered, needed } = row.demand.total;\n    return <Box ref={measure} css={styles.demandCards} data-roster-demand-cards={row.key}>\n        <Box css={styles.demandCardsHead} data-roster-demand-head=\"\">\n            <Box as=\"span\" data-roster-demand-heading=\"\">{value.vocabulary.demand}</Box>\n            <Box as=\"span\" data-roster-demand-total=\"\">{read.state !== \"held\" ? <Unread read={read} kind=\"number\" index={0} /> : `${format.number(rostered)} / ${format.number(needed)} h`}</Box>\n        </Box>\n        {SEVEN_DAYS.map(day => <DemandDayCard key={day} ctx={ctx} row={row} day={day} />)}\n    </Box>;\n});\n/**\n * The People layout on a phone (#1406, P31): a band a group, a card a person — and with targets the work requirement's\n * day cards before each band's people's cards, or before everyone's where it draws no bands (#1568).\n */\nfunction PeopleAgenda({ props, ctx }: { props: RosterViewsProps; ctx: ViewContext }) {\n    const { collapsed, toggle } = useGroupCollapse(props.drag.surface);\n    const list = usePeopleRows(props.value, collapsed);\n    // The work requirement's rows (#1568): each band's, or the one block over every group's, the lanes in its day cards.\n    const demands = useDemands(props);\n    const people = useMemo(() => bandPeople(props.value), [props.value]);\n    const rows = useMemo((): readonly AgendaRow[] => withDemand(list, props.value, demands, people, cardDemand), [list, props.value, demands, people]);\n    const index = useMemo(() => peopleIndex(props.week, props.held), [props.week, props.held]);\n    const { floors, measured, measure } = useRowFloors(AGENDA_FLOORS);\n    const getItemKey = useCallback((i: number) => rows[i]!.key, [rows, floors]); // eslint-disable-line react-hooks/exhaustive-deps -- the floors re-key the places\n    const estimateSize = useCallback((i: number) => { const row = rows[i]!; return row.kind !== \"person\" ? floors[row.kind] : row.person === undefined ? floors.requests : floors.person; }, [rows, floors]);\n    // A card drawn again only as what it shows changes: the same function while the rows, the week and the views hold (CL9).\n    const renderRow = useCallback((i: number) => {\n        const row = rows[i]!;\n        switch (row.kind) {\n            case \"group\": return <GroupHeading scope=\"roster\" group={row.group} styles={ctx.styles} collapsed={collapsed.includes(row.group.key)} toggle={toggle} measure={measure(\"group\")} />;\n            case \"demand\": return <DemandCards ctx={ctx} row={row} measure={measure(\"demand\")} />;\n            case \"assign\": return <AssignHead ctx={ctx} row={row} measure={measure(\"assign\")} />;\n            case \"person\": {\n                const days = row.person === undefined ? requestDays(index, row.group) : index.person.get(row.person.key);\n                const requests = row.person !== undefined ? NO_DUTIES : row.group === undefined ? index.allRequestList : index.requestList.get(row.group.key) ?? NO_DUTIES;\n                return <PersonCard ctx={ctx} row={row} index={i} rows={rows} days={days ?? NO_DAYS} requests={requests}\n                    measure={measure(row.person === undefined ? \"requests\" : \"person\")} />;\n            }\n        }\n    }, [rows, ctx, collapsed, toggle, index, measure]);\n    // Where the cards' view rests, by its top card's key (#1398): saved as a scroll settles, brought back as they mount.\n    const { onAnchor } = props;\n    const save = useCallback((at: RowAnchor) => onAnchor?.({ cards: at }), [onAnchor]);\n    const { restore, onAnchorChange } = useRowAnchor(rows, props.anchor?.cards, save, measured);\n    // A pick in Search Records gives its person's card's name the keyboard (#1398).\n    const { focus } = usePeopleFocus(rows, props.picked);\n    return <Box css={props.styles.main} data-roster-agenda=\"people\">\n        <PeopleFocusContext.Provider value={focus}>\n            <VirtualRows fillParent height={undefined} maxHeight={undefined} rootCss={props.styles.agenda} count={rows.length}\n                getItemKey={getItemKey} estimateSize={estimateSize} anchorable={ANCHOR_EVERY_ROW} overscan={1}\n                scrollToIndex={selectedPeopleRow(props, rows)} scrollAlign=\"auto\" renderRow={renderRow}\n                onAnchorChange={onAnchorChange} restoreAnchor={restore} />\n        </PeopleFocusContext.Provider>\n    </Box>;\n}\n/** Narrow cards retain explicit operations even with both BuilderFrame panes collapsed. */\nfunction Agenda({ props, ctx }: { props: RosterViewsProps; ctx: ViewContext }) {\n    const days = props.view.layout === \"people\" || props.view.period === \"week\" ? Array.from({ length: 7 }, (_, d) => d) : [props.day];\n    return <Box css={props.styles.scroll} data-roster-agenda=\"\"><Box css={props.styles.agenda}>\n        {props.view.period === \"day\" && props.view.layout === \"shifts\" && <Seg fullWidth label=\"Day of week\" scope=\"roster\" name=\"agenda-days\" active={String(props.day)} items={Array.from({ length: 7 }, (_, day) => ({ key: String(day), label: props.format.weekday(new Date(props.start.getTime() + day * DAY)) }))} onPick={day => props.setView({ ...props.view, date: props.start.getTime() + Number(day) * DAY })} />}\n        {days.map(day => <Box key={day} css={props.styles.agendaGroup}><Box css={props.styles.agendaHead} data-roster-agenda-heading=\"\">{props.format.weekdayDate(new Date(props.start.getTime() + day * DAY))}</Box>\n            {props.value.groups.flatMap(group => props.value.shifts.map(shift => { const slot = { day: BigInt(day), group: group.key, shift: shift.key }; if (props.read.state !== \"held\") {\n                // A week not read, or whose read failed (#1398): each slot's card and title at once, a placeholder where its\n                // figures and duties go; the failure said once, in the first card.\n                const first = day === days[0] && group.key === props.value.groups[0]?.key && shift.key === props.value.shifts[0]?.key;\n                return <Box key={slotKey(slot)} css={props.styles.card} data-roster-agenda-slot={slotKey(slot)} data-roster-unread=\"\">\n                    <Box css={props.styles.cardHead}><Box css={props.styles.cardTitle}>{group.label} · {shift.label}</Box></Box>\n                    {props.read.state === \"failed\" ? first && <ReadFailure read={props.read} />\n                        : <><Box css={props.styles.detail}><Unread read={props.read} kind=\"aggregate\" index={day} /></Box><Unread read={props.read} kind=\"chip\" index={day + 1} /></>}\n                </Box>;\n            } const c = props.coverage.get(slot)!; return <Box key={slotKey(slot)} css={props.styles.card} data-roster-agenda-slot={slotKey(slot)}>\n                <chakra.button type=\"button\" css={props.styles.cardHead} onClick={() => props.select({ type: \"slot\", slot })}><Box css={props.styles.cardTitle}>{group.label} · {shift.label}</Box></chakra.button>\n                <Box css={props.styles.detail}>{String(c.filled)} / {String(c.positions)} positions · {String(c.open)} open</Box>\n                {props.value.settings.requirements && <CoverageView coverage={c} value={props.value} styles={props.styles} format={props.format} compact />}\n                {assignments(props, placeOf(slot)).map(({ id, a, removed }) => <AssignmentCard key={id} ctx={ctx} id={id} assignment={a} removed={removed} />)}\n                {props.proposals.filter(p => sameSlot(p.slot, slot) && (props.value.visiblePeople.type === \"none\" || props.value.visiblePeople.value.has(p.person))).map(p => <ProposalCard key={p.key} props={props} proposal={p} />)}\n                <SlotActions props={props} slot={slot} /><RequirementAction slot={slot} week={props.week} held={props.held} value={props.value} commands={props.commands} styles={props.styles} />\n            </Box>; }))}\n            {props.read.state === \"held\" && props.value.duty.roles.noGroup && props.value.shifts.map(shift => <NoGroupCard key={shift.key} props={props} ctx={ctx} day={day} shift={shift} />)}\n        </Box>)}\n    </Box></Box>;\n}\n/**\n * A shift's day's duties in no group yet, on a phone (#1548): a card after the groups' cards, drawn only where the day\n * holds some — No group has no action of its own; each duty's card moves it into a group. It says the hours rostered\n * there, whoever the rail shows.\n */\nfunction NoGroupCard({ props, ctx, day, shift }: { props: RosterViewsProps; ctx: ViewContext; day: number; shift: Shift }) {\n    const place: Place = { day: BigInt(day), group: none, shift: shift.key };\n    const shown = assignments(props, place);\n    const rostered = [...props.week.assignments.values()].filter(a => samePlace(a.place, place)).reduce((n, a) => n + a.hours, 0);\n    if (shown.length === 0 && rostered === 0) return null;\n    return <Box css={props.styles.card} data-roster-agenda-place={placeKey(place)}>\n        <Box css={props.styles.cardHead}><Box css={props.styles.cardTitle}>{props.value.vocabulary.noGroup} · {shift.label}</Box></Box>\n        <Box css={props.styles.detail}>{props.format.number(rostered)} h rostered</Box>\n        {shown.map(({ id, a, removed }) => <AssignmentCard key={id} ctx={ctx} id={id} assignment={a} removed={removed} />)}\n    </Box>;\n}\n/** What a drag draws of the Roster's own, apart from its ghost: where it would land. */\nconst DRAG_SLOTS = [\"landing\"] as const;\nexport function RosterViews(props: RosterViewsProps) {\n    // What a drag draws has its classes already, made as the views are drawn, ahead of the first drag (#1594).\n    useMoveGhostClasses(props.styles);\n    useClassesAhead(props.styles, DRAG_SLOTS);\n    const ctx = useViewContext(props);\n    // A phone keeps People to the week (#1406, P31): a persisted month shows its first week, as the frame hands it.\n    const view = props.narrow ? props.view.layout === \"people\" ? <PeopleAgenda props={props} ctx={ctx} /> : <Agenda props={props} ctx={ctx} />\n        : props.view.layout === \"people\" ? props.view.period === \"month\" ? <MonthGrid props={props} ctx={ctx} /> : <People props={props} ctx={ctx} /> : <Shifts props={props} ctx={ctx} />;\n    const picked = props.selection?.type === \"personWeek\" ? props.selection : undefined;\n    const personWeek = useMemo(() => picked === undefined ? undefined : { key: picked.key, start: picked.start }, [picked]);\n    return <SelectionContext.Provider value={props.selection}><PersonWeekContext.Provider value={personWeek}>{view}</PersonWeekContext.Provider></SelectionContext.Provider>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\nimport { useCallback, useMemo } from \"react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCheck, faMinus } from \"@fortawesome/free-solid-svg-icons\";\nimport { Box, Button, chakra, useSlotRecipe } from \"@chakra-ui/react\";\nimport { StringType, equalFor, some } from \"@elaraai/east\";\nimport { BannerView, EastChakraComponent, FieldForm, useTrackedEvaluation, type BuilderFrameDock, type EditIssue } from \"@elaraai/east-ui-components\";\nimport { PlaceholderShape } from \"@elaraai/east-ui-components/internal\";\nimport { FOCUS_HOME_PROPS, useFocusHome } from \"../shared/focus-home.js\";\nimport { useFieldAsk } from \"../shared/schedule/field-ask.js\";\nimport { ScheduleInspectorHead } from \"../shared/schedule/inspector-head.js\";\nimport { madeFromValues } from \"../shared/schedule/records.js\";\nimport { NO_REFUSED_FIELDS, refusedFields, type RefusedFields } from \"../shared/schedule/refusals.js\";\nimport { Seg } from \"../shared/schedule/segments.js\";\nimport { plural } from \"../shared/schedule/words.js\";\nimport { AssignmentActions, AssignmentFields, GroupField, PlaceAction, RequirementFields, TimesFields, dutyForm, type DutyFormValue } from \"./controls.js\";\nimport { CoverageView, ProposalCard, assignmentName, costed, dismissible, money, type RosterViewsProps } from \"./views.js\";\nimport { difference, looseOf, summedCoverage } from \"./demand.js\";\nimport type { RolesChange } from \"./actions.js\";\nimport type { RosterFind } from \"./fit.js\";\nimport {\n    DAY, NO_GROUP, costsOf, dayOfSlot, dayStart, groupName, groupSkills, issueGoesTo, placeOf, requirementOf, samePlace, sameSlot, slotOfPlace, viewTotals, weekNumber,\n    type Assignment, type Issue, type Person, type PlacedDuties, type PlacedTargets, type RosterStyles, type Slot,\n} from \"./model.js\";\n\n/** The Find fixes, as the inspector offers them (#1334): only with the app's fit, and reading `Finding…` while their find is asked. */\nexport interface FindFixes {\n    /** Whether the app bound a fit: without one no Find fix is offered, though `Roster.check` still reports its issue (R2). */\n    offered: boolean;\n    /** Whether this find is asked and its answer has not landed (R4). */\n    finding: (asked: RosterFind) => boolean;\n}\n/**\n * A refusal holding Save (#1525), as the Roster says it: the app's `ready` refusing a drafted duty, named by its\n * person, day and shift — or by its key, for a duty the Roster can't place — and its field by its form's label.\n */\nexport interface RosterRefusal {\n    /** The duty kind's slot, or the record's key, whose session refuses. */\n    readonly kind: string;\n    /** The refusal's issue: its entry's key's text, its field and the app's message. */\n    readonly issue: EditIssue;\n    /** Its duty in words: `A. Morgan · Thu 9 Mar · Early`. */\n    readonly title: string;\n    /** Its field and the app's message: `Cost centre: Choose the cost centre`. */\n    readonly text: string;\n}\ntype Args = RosterViewsProps & {\n    storageKey: string; tab: string; onTab: (tab: string) => void; find: FindFixes;\n    /** The week's duties as drafted, and as stored: each one's row. */\n    duties: PlacedDuties; heldDuties: PlacedDuties;\n    /** The week's targets as drafted: each slot's row. */\n    targets: PlacedTargets;\n    /** Every refusal holding Save, of every week's drafts (#1525): listed ahead of the rule issues, and over its duty's form. */\n    refusals: readonly RosterRefusal[];\n    /** A refusal pressed: its duty shown on its day and selected. */\n    onRefusal: (refusal: RosterRefusal) => void;\n};\nconst keyEqual = equalFor(StringType);\nfunction fixLabel(issue: Issue, props: Args) {\n    if (issue.fix.type === \"none\") return \"\";\n    const fix = issue.fix.value;\n    switch (fix.type) {\n        case \"accept\": return \"Accept\";\n        case \"request\": return `Request from ${props.value.agencies.find(agency => agency.key === fix.value)?.name ?? fix.value}`;\n        case \"move\": return `Move to ${props.value.shifts.find(s => s.key === fix.value)?.label ?? fix.value}`;\n        case \"start\": return `Start at ${props.format.time(fix.value)}`;\n        case \"find\": return issue.slot.type === \"some\" && props.find.finding({ need: fix.value, slot: issue.slot.value }) ? \"Finding…\"\n            : fix.value.type === \"skill\" ? \"Find skilled staff\" : fix.value.type === \"leads\" ? \"Find a lead\" : \"Find a trainer\";\n    }\n}\n/** Whether an issue's fix can be made now (#1550): on its slot's day, else its duty's, that day taking edits; the week's own, the week taking them. */\nfunction fixable(issue: Issue, props: Args): boolean {\n    const day = issue.slot.type === \"some\" ? issue.slot.value.day\n        : issue.assignment.type === \"some\" ? props.week.assignments.get(issue.assignment.value)?.place.day : undefined;\n    return day === undefined ? props.commands.available : props.commands.availableOn(day);\n}\nexport function RosterIssues({ props, issues }: { props: Args; issues: readonly Issue[] }) {\n    return <>{issues.map((issue, index) => { const goes = issueGoesTo(issue, props.view, props.start, props.week, props.opensWeek); return <Box key={index} css={props.styles.issue} data-tone={issue.tone.type} data-roster-issue={issue.kind.type}>\n        {/* A Month with no Week, and nothing of the issue's to select: its title alone, nothing to press. */}\n        {props.view.period === \"month\" && !props.opensWeek && goes.select === undefined ? <Box css={props.styles.issueTitle}>{issue.title}</Box>\n            : <chakra.button type=\"button\" css={props.styles.issueTitle} onClick={() => {\n                if (goes.view !== undefined) props.setView(goes.view);\n                if (goes.select !== undefined) props.select(goes.select);\n            }}>{issue.title}</chakra.button>}<Box css={props.styles.issueDetail}>{issue.detail}</Box>\n        {/* A find edits nothing, so it is offered on a week that can't be edited — but only with the app's fit, which decides who fits.\n            Any other fix only where its day takes edits (#1550). */}\n        {issue.fix.type === \"some\" && (issue.fix.value.type === \"find\" ? props.find.offered : fixable(issue, props) || props.commands.locked !== undefined) && <Box css={props.styles.issueActions}>\n            <Button size=\"xs\" variant=\"outline\" disabled={props.commands.locked !== undefined} title={props.commands.locked} onClick={() => props.onError(props.commands.fix(issue))}>{fixLabel(issue, props)}</Button></Box>}\n    </Box>; })}</>;\n}\n/** A person's facts: their skills in a slot's group — their home group's, for none or a duty in no group (#1548) — and their week. */\nfunction PersonFacts({ props, person, slot }: { props: Args; person: Person; slot?: Slot | undefined }) {\n    const group = props.value.groups.find(g => g.key === (slot?.group ?? person.group));\n    const skills = group === undefined ? undefined : groupSkills(props.value, group.key);\n    const coverage = slot === undefined ? undefined : props.coverage.get(slot);\n    const theirs = [...props.week.assignments].filter(([, a]) => a.who.type === \"person\" && a.who.value === person.key);\n    const cost = costed(props.value) ? costsOf(props.pay, theirs.map(([id]) => id)).total : undefined;\n    return <><Box css={props.styles.section}><Box css={props.styles.sectionHead}>Skills · {group?.label}</Box><Box css={props.styles.detail}>{skills?.filter(skill => person.skills.has(skill.key)).length} / {skills?.length} held</Box>\n        {person.agency && person.skills.size === 0 && <Box css={props.styles.detail}>No skills recorded for {props.value.vocabulary.agency.toLocaleLowerCase(props.format.locale)}.</Box>}\n        {skills?.map(skill => <Box key={skill.key} css={props.styles.skillLine}><Box as=\"span\" css={props.styles.flag} aria-label={person.skills.has(skill.key) ? \"Skill held\" : \"Skill not held\"}><FontAwesomeIcon icon={person.skills.has(skill.key) ? faCheck : faMinus} /></Box><span>{skill.label}</span><span /><span>{props.format.number(coverage?.lines.find(line => line.skill === skill.key)?.needed ?? 0)} h needed</span></Box>)}\n    </Box><Box css={props.styles.section}><Box css={props.styles.sectionHead}>Week</Box><Box css={props.styles.detail}>{props.format.number(props.hours.get(person.key) ?? 0)} h / {props.format.number(person.contract)} h{cost !== undefined && ` · ${money(props.format, props.value, cost, false)}`}</Box>\n        {/* A day pressed opens that week — in Week, from Month (#1406, P24) — with the duty selected, or the person where the day is off.\n            With Week not offered the month stays: it selects alone, as a day of another month would move the month — the duty, its\n            Details read in its own week, or the person's week where the day is off. */}\n        {Array.from({ length: 7 }, (_, day) => { const rows = theirs.filter(([, a]) => a.place.day === BigInt(day)); return <Button key={day} size=\"xs\" variant={props.day === day ? \"outline\" : \"ghost\"} onClick={() => {\n            const opens = props.view.period !== \"month\" || props.opensWeek;\n            if (opens) props.setView({ ...props.view, period: props.view.period === \"month\" ? \"week\" : props.view.period, date: props.start.getTime() + day * DAY });\n            props.select(rows.length > 0 ? { type: \"assignment\", key: rows[0]![0] } : opens ? { type: \"person\", key: person.key } : { type: \"personWeek\", key: person.key, start: props.start.getTime() });\n        }}>\n            {props.format.weekday(new Date(props.start.getTime() + day * DAY))} · {rows.map(([, a]) => `${props.value.shifts.find(s => s.key === a.place.shift)?.code} ${props.format.number(a.hours)} h`).join(\" · \") || \"Off\"}\n        </Button>; })}\n    </Box></>;\n}\n/** A duty's pay, by the app's own codes (§5.6): each code's cost, and in all. */\nfunction DutyPay({ props, id }: { props: Args; id: string }) {\n    if (!costed(props.value)) return null;\n    const costs = costsOf(props.pay, [id]);\n    return <Box css={props.styles.section} data-roster-pay=\"\"><Box css={props.styles.sectionHead}>Pay</Box>\n        {costs.byCode.size === 0 ? <Box css={props.styles.detail}>No cost worked out.</Box>\n            : <>{[...costs.byCode].map(([code, amount]) => <Box key={code} css={props.styles.detail}>{code} · {money(props.format, props.value, amount, false)}</Box>)}\n                <Box css={props.styles.detail}>{money(props.format, props.value, costs.total, false)} in all</Box></>}\n    </Box>;\n}\n/**\n * The duty's form: its roles the Roster edits — its times and, where its kind\n * maps them, its position and its activity — then the app's fields none of\n * them writes, in the kind's form (`fields`) or the kind's own inspector, each\n * field a refusal names (`refused`) ringed, the app's words for it under it —\n * the one a refusal gone to names taking the keyboard as the form draws it. A\n * field's edit the duty refuses\n * leaves the field showing what the duty holds, the reason under it as the\n * frame's line says it. A number outside its field's bounds is said in the tone\n * the duty's Save stands in (`breaches`, #1585).\n */\nfunction DutyForm({ props, assignment, id, refused, breaches }: {\n    props: Args; assignment: Assignment; id: string; refused: RefusedFields; breaches: \"warn\" | \"error\";\n}) {\n    const { onError, commands } = props;\n    const kind = props.value.duty.kind;\n    const focus = useFieldAsk(kind.key, id);\n    const row = props.duties.rows.get(id);\n    const held = props.heldDuties.rows.get(id);\n    const heldAssignment = props.held.assignments.get(id);\n    const change = useCallback((next: RolesChange) => { const why = commands.update(id, next); onError(why); return why; }, [commands, id, onError]);\n    const field = useCallback((path: readonly string[], next: unknown) => { const why = commands.field(id, path, next); onError(why); return why; }, [commands, id, onError]);\n    const form: DutyFormValue = dutyForm(assignment);\n    const baseline = heldAssignment === undefined ? undefined : dutyForm(heldAssignment);\n    // A duty of a day that takes no edits — a published one (#1550) — reads only.\n    const readOnly = !commands.availableOn(assignment.place.day);\n    // The app's own form for the duty: over its row, its writes guarded as every gesture is.\n    const update = useCallback((bytes: Uint8Array): null => { onError(commands.row(id, bytes)); return null; }, [commands, onError, id]);\n    const read = useCallback(() => kind.inspector.type === \"some\" && row !== undefined ? kind.inspector.value(row.bytes, update) : undefined, [kind.inspector, row, update]);\n    const { result } = useTrackedEvaluation(read);\n    const decoded = useMemo(() => row === undefined ? undefined : props.domain.decodeRow(row.bytes), [row, props.domain]);\n    const baselineRow = useMemo(() => held === undefined ? undefined : props.domain.decodeRow(held.bytes), [held, props.domain]);\n    return <>\n        <TimesFields form={form} baseline={baseline} readOnly={readOnly} onChange={change} />\n        <AssignmentFields assignment={assignment} form={form} baseline={baseline} value={props.value} readOnly={readOnly} onChange={change} />\n        {result.ok && result.value !== undefined ? <chakra.fieldset disabled={readOnly}><EastChakraComponent value={result.value} storageKey={`${props.storageKey}.duty.${id}`} /></chakra.fieldset>\n            : decoded !== undefined && kind.fields.length > 0 && <FieldForm specs={kind.fields} value={decoded} baseline={baselineRow ?? {}} readOnly={readOnly}\n                issues={refused} focus={focus} breaches={breaches} onChange={field} />}\n        {!result.ok && <Box css={props.styles.error} role=\"alert\">The duty's form could not be rendered.</Box>}\n    </>;\n}\nfunction OneAssignment({ props, id, assignment: a }: { props: Args; id: string; assignment: Assignment }) {\n    const removed = !props.week.assignments.has(id), baseline = props.held.assignments.get(id);\n    const changed = baseline === undefined || !props.domain.sameAssignment(baseline, a);\n    const person = a.who.type === \"person\" ? props.value.people.find(p => p.key === a.who.value) : undefined;\n    const state = removed ? \"Removed · unsaved\" : baseline === undefined ? \"Added · unsaved\" : !samePlace(baseline.place, a.place) ? \"Moved · unsaved\" : changed ? \"Edited · unsaved\" : a.who.type === \"request\" ? \"Requested · awaiting agency\" : \"Rostered\";\n    // A move to another group — or to none, or out of none (#1548) — keeping its day and its shift.\n    const toGroup = (group: Assignment[\"place\"][\"group\"]) => props.onError(props.commands.place({ type: \"assignment\", key: id }, { day: a.place.day, group, shift: a.place.shift }));\n    const position = props.value.positions.find(p => p.key === a.position);\n    // Its refusals holding Save (#1525): over its form, as the Calendar's banner shows an event's, each field named ringed\n    // and saying the app's words for it under it.\n    const refusals = props.refusals.filter(r => keyEqual(r.kind, props.value.duty.kind.key) && keyEqual(r.issue.entry, id));\n    const refused = refusals.length === 0 ? NO_REFUSED_FIELDS : refusedFields(refusals.map(r => r.issue));\n    // A bound its row breaks (#1585), said in the tone its Save stands in: as stored it warns; its change refused, holding\n    // Save, it is an error.\n    const breaches = refusals.length > 0 ? \"error\" : \"warn\";\n    return <><ScheduleInspectorHead styles={props.styles} kind={{ name: `Duty · ${groupName(props.value, a.place.group)} · ${props.value.shifts.find(s => s.key === a.place.shift)?.label}`, icon: a.who.type === \"request\" ? \"building\" : \"user\" }} title={assignmentName(props.value, a)}\n        when={`${position === undefined ? \"\" : `${position.label} · `}${props.format.weekdayDate(dayOfSlot(props.start, a.place))}${person?.trainer ? \" · trainer\" : person?.trainee ? \" · trainee\" : \"\"}`} status={{ label: state, tone: { type: removed ? \"warning\" : \"neutral\" }, ring: changed }} pending={changed ? baseline === undefined ? \"new\" : \"pending\" : undefined} home />\n        {!removed && refusals.length > 0 && <Box css={props.styles.section} data-roster-refusals=\"\"><BannerView status=\"warning\" title=\"Not saved yet\" description={refusals.map(r => r.text).join(\"; \")} /></Box>}\n        {!removed && <RosterIssues props={props} issues={props.issues.filter(issue => issue.assignment.type === \"some\" && issue.assignment.value === id)} />}\n        {!removed && <Box css={props.styles.fields}>\n            {/* Where the duty kind's group takes none (#1548): the groups and No group, a choice moving the duty there —\n                under the field's own label, no heading over it saying Group a second time. */}\n            {props.value.duty.roles.noGroup\n                && <GroupField value={props.value} group={a.place.group} baseline={baseline?.place.group} readOnly={!props.commands.availableOn(a.place.day)} onChange={toGroup} />}\n            <Box css={props.styles.sectionHead}>Shift</Box>\n            <Seg fullWidth label=\"Duty shift\" scope=\"roster\" name=\"assignment-shift\" active={a.place.shift} items={props.value.shifts.map(s => ({ key: s.key, label: s.label, disabled: !props.commands.availableOn(a.place.day) }))} onPick={shift => props.onError(props.commands.place({ type: \"assignment\", key: id }, { day: a.place.day, group: a.place.group, shift }))} />\n            <Box css={props.styles.detail}>{props.format.time(a.start)}–{props.format.time(a.end)} · {props.format.number(a.hours)} h{props.format.weekday(a.end) !== props.format.weekday(a.start) && \" · ends next day\"}</Box>\n            <DutyForm props={props} assignment={a} id={id} refused={refused} breaches={breaches} />\n        </Box>}\n        {!removed && <DutyPay props={props} id={id} />}\n        {person !== undefined && <PersonFacts props={props} person={person} slot={slotOfPlace(a.place)} />}\n        <Box css={props.styles.section}><AssignmentActions id={id} assignment={a} removed={removed} value={props.value} start={props.start} commands={props.commands} styles={props.styles} /></Box>\n    </>;\n}\n/** A slot's targets: the targets' own form where the app gives one, over the slot's row — or a new one — else the Roster's. */\nfunction Targets({ props, slot }: { props: Args; slot: Slot }) {\n    const kind = props.value.targets.type === \"some\" ? props.value.targets.value : undefined;\n    const form = kind?.inspector.type === \"some\" ? kind.inspector.value : undefined;\n    const target = requirementOf(props.week, slot);\n    const row = props.targets.rows.get(slot);\n    // A slot with no target row yet: a new one for the form to start from, written only once the form writes it — the\n    // Roster's own fields in its place where the app's `values` fail to make one.\n    const bytes = useMemo(() => row?.bytes ?? (kind === undefined || form === undefined ? undefined\n        : madeFromValues(\"Roster\", \"a new shift's targets\", () => kind.create({ day: dayOfSlot(props.start, slot), group: slot.group, shift: slot.shift,\n            positions: target.positions, hours: target.hours }))), [row, kind, form, props.start, slot, target]);\n    const update = useCallback((next: Uint8Array): null => { props.onError(props.commands.targetRow(slot, next)); return null; }, [props, slot]);\n    const read = useCallback(() => form !== undefined && bytes !== undefined ? form(bytes, update) : undefined, [form, bytes, update]);\n    const { result } = useTrackedEvaluation(read);\n    if (kind === undefined) return <Box css={props.styles.detail}>This roster has no targets.</Box>;\n    return <>{result.ok && result.value !== undefined ? <chakra.fieldset disabled={!props.commands.availableOn(slot.day)}><EastChakraComponent value={result.value} storageKey={`${props.storageKey}.requirement`} /></chakra.fieldset>\n        : <RequirementFields value={props.value} week={props.week} held={props.held} slot={slot} commands={props.commands} styles={props.styles} />}\n        {!result.ok && <Box role=\"alert\" css={props.styles.error}>The targets form could not be rendered.</Box>}</>;\n}\nfunction OneSlot({ props, slot }: { props: Args; slot: Slot }) {\n    const c = props.coverage.get(slot); if (c === undefined) return <Box css={props.styles.empty} {...FOCUS_HOME_PROPS}>This shift is no longer configured.</Box>;\n    const shift = props.value.shifts.find(s => s.key === slot.shift)!;\n    return <><ScheduleInspectorHead styles={props.styles} kind={{ name: `Shift · ${props.value.groups.find(g => g.key === slot.group)?.label} · ${props.format.weekday(dayOfSlot(props.start, slot))}`, icon: \"clock\" }} title={shift.label}\n        when={`${c.filled} / ${c.positions} positions · ${props.format.number(c.hours.rostered)} of ${props.format.number(c.hours.needed)} h`} status={{ label: c.hours.rostered < c.hours.needed ? `${props.format.number(c.hours.needed - c.hours.rostered)} h short` : \"Covered\", tone: { type: c.hours.rostered < c.hours.needed ? \"warning\" : \"success\" }, ring: false }} home />\n        <RosterIssues props={props} issues={props.issues.filter(i => i.slot.type === \"some\" && sameSlot(i.slot.value, slot))} />\n        <Box css={props.styles.section}><Box css={props.styles.sectionHead}>Coverage</Box><CoverageView coverage={c} value={props.value} styles={props.styles} format={props.format} />\n            <Box css={props.styles.detail}>{props.value.vocabulary.permanent} · {props.value.vocabulary.agency} · Requested · Open · Needed</Box></Box>\n        <Box css={props.styles.fields}><Box css={props.styles.sectionHead}>Targets</Box><Targets props={props} slot={slot} /></Box>\n        <Box css={props.styles.section}><Box css={props.styles.sectionHead}>Roster</Box><Box css={props.styles.detail}>{String(c.filled)} filled · {String(c.open)} open · {c.lead ? \"Lead assigned\" : \"No lead\"} · {c.trainer ? \"Trainer assigned\" : \"No trainer\"}</Box>\n            {costed(props.value) && <Box css={props.styles.detail}>{money(props.format, props.value, c.cost, false)}</Box>}<PlaceAction label=\"Assign person\" place={placeOf(slot)} value={props.value} start={props.start} commands={props.commands} styles={props.styles} /></Box>\n    </>;\n}\n/**\n * A shift's day across the groups (#1568): a day of the work requirement's lane where the People layout draws no bands.\n * Its head says the day's positions and hours over every group's slot of the shift, as the lane's cell sums them, and\n * the hours short, each slot's own summed (K4); then the coverage summed over the groups — the skill lines summed too,\n * its difference and its bar's open part that shortfall, never the net — and each group's slot as the coverage detail\n * draws one. The day's duties of the shift in no group yet (#1548) count\n * as the lane counts them: rostered, their hours taken off what the slots are short, under a section of their own.\n */\nfunction ShiftDay({ props, shift: key, day }: { props: Args; shift: string; day: number }) {\n    const shift = props.value.shifts.find(s => s.key === key);\n    const slots = useMemo(() => props.value.groups.flatMap(group => {\n        const coverage = props.coverage.get({ day: BigInt(day), group: group.key, shift: key });\n        return coverage === undefined ? [] : [{ group, coverage }];\n    }), [props.value.groups, props.coverage, day, key]);\n    const loose = useMemo(() => looseOf(props.value, props.week)[day]?.get(key), [props.value, props.week, day, key]);\n    const sum = useMemo(() => summedCoverage(props.value, slots.map(slot => slot.coverage), loose), [props.value, slots, loose]);\n    if (shift === undefined || slots.length === 0) return <Box css={props.styles.empty} {...FOCUS_HOME_PROPS}>This shift is no longer configured.</Box>;\n    const looseHours = loose === undefined ? 0 : loose.permanent + loose.agency + loose.requested;\n    const slotsShort = slots.reduce((total, { coverage: c }) => total + Math.max(0, -difference(c.hours.rostered, c.hours.needed)), 0);\n    const short = Math.max(0, -difference(looseHours, slotsShort));\n    const { format, value, styles } = props;\n    return <><ScheduleInspectorHead styles={styles} kind={{ name: `Shift · ${format.weekday(new Date(props.start.getTime() + day * DAY))}`, icon: \"clock\" }} title={shift.label}\n        when={`${format.number(sum.filled)} / ${format.number(sum.positions)} positions · ${format.number(sum.hours.rostered)} of ${format.number(sum.hours.needed)} h`}\n        status={{ label: short > 0 ? `${format.number(short)} h short` : \"Covered\", tone: { type: short > 0 ? \"warning\" : \"success\" }, ring: false }} home />\n        <RosterIssues props={props} issues={props.issues.filter(i => i.slot.type === \"some\" && i.slot.value.shift === key && Number(i.slot.value.day) === day)} />\n        <Box css={styles.section} data-roster-shift-day=\"across\"><Box css={styles.sectionHead}>Across groups</Box><CoverageView coverage={sum} short={short} value={value} styles={styles} format={format} />\n            <Box css={styles.detail}>{value.vocabulary.permanent} · {value.vocabulary.agency} · Requested · Open · Needed</Box></Box>\n        {slots.map(({ group, coverage: c }) => <Box key={group.key} css={styles.section} data-roster-shift-day={group.key}><Box css={styles.sectionHead}>{group.label}</Box>\n            <CoverageView coverage={c} value={value} styles={styles} format={format} compact />\n            <Box css={styles.detail}>{format.number(c.filled)} / {format.number(c.positions)} positions · {format.number(c.open)} open</Box></Box>)}\n        {loose !== undefined && <Box css={styles.section} data-roster-shift-day={NO_GROUP}><Box css={styles.sectionHead}>{value.vocabulary.noGroup}</Box>\n            <Box css={styles.detail}>{format.number(looseHours)} h rostered, in no group yet</Box></Box>}\n    </>;\n}\nfunction Summary({ props }: { props: Args }) {\n    const totals = viewTotals(props.coverage, props.view, props.day, props.week);\n    const { days } = totals;\n    const visible = props.value.visiblePeople;\n    const filtered = visible.type === \"some\" && props.value.people.some(person => !visible.value.has(person.key));\n    // The view's duties' costs, by the app's codes: the Summary's cost line under its total.\n    const shown = [...props.week.assignments].flatMap(([id, a]) => days === 7 || Number(a.place.day) === props.day ? [id] : []);\n    const costs = costsOf(props.pay, shown);\n    const breaches = props.issues.filter(i => i.kind.type === \"breach\").length, gaps = props.issues.filter(i => i.kind.type === \"gap\").length;\n    const stats = [\n        { label: \"Cost\", value: money(props.format, props.value, costs.total, false), sub: [...costs.byCode].map(([code, amount]) => `${code} ${money(props.format, props.value, amount)}`).join(\" · \") },\n        { label: \"Positions\", value: `${totals.filled} / ${totals.positions}`, sub: `${totals.open} open` },\n        { label: \"Hours\", value: `${props.format.number(totals.hours)} h`, sub: `of ${props.format.number(totals.needed)} h needed` },\n        { label: \"Issues\", value: String(breaches + gaps), sub: `${plural(breaches, \"breach\")} · ${plural(gaps, \"gap\")}` },\n    ];\n    const period = days === 1 ? `Day · ${props.format.weekdayDate(new Date(props.view.date))}`\n        : props.view.period === \"month\" ? `Month · ${props.format.monthYear(dayStart(props.view.date))}` : `Week · ${props.format.range(props.start, new Date(props.start.getTime() + 6 * DAY))}`;\n    return <><ScheduleInspectorHead styles={props.styles} kind={{ name: period, icon: \"calendar-week\" }} title=\"Roster\" when={`${props.value.groups.length} groups · ${props.value.shifts.length} shifts`} home />\n        <Box css={props.styles.summary}>{stats.filter(s => s.label !== \"Cost\" || costed(props.value)).map(stat => <Box key={stat.label} css={props.styles.stat}><Box css={props.styles.statLabel}>{stat.label}</Box><Box css={props.styles.statValue}>{stat.value}</Box><Box css={props.styles.detail}>{stat.sub}</Box></Box>)}</Box>\n        {filtered && visible.type === \"some\" && <Box css={props.styles.section}><Box css={props.styles.detail}>{props.format.number(visible.value.size)} of {props.format.number(props.value.people.length)} people visible · Coverage includes all staff</Box></Box>}\n        {props.proposals.length > 0 && <Box css={props.styles.section}><Box css={props.styles.sectionHead}>Proposals</Box>{props.proposals.map(proposal => <ProposalCard key={proposal.key} props={props} proposal={proposal} />)}</Box>}\n        <Box css={props.styles.section}><Box css={props.styles.detail}>Select a person or shift to inspect its details.</Box><Box css={props.styles.detail}>Use the Library to assign people and activities.</Box><Box css={props.styles.detail}>Warnings help plan the week and do not prevent saving.</Box><Box css={props.styles.detail}>Save as you work; publish the week when it is ready.</Box></Box>\n    </>;\n}\nfunction Details({ props }: { props: Args }) {\n    const selection = props.selection;\n    if (selection?.type === \"assignment\") { const a = props.week.assignments.get(selection.key) ?? props.held.assignments.get(selection.key); if (a !== undefined) return <OneAssignment key={selection.key} props={props} id={selection.key} assignment={a} />; }\n    if (selection?.type === \"slot\" || selection?.type === \"requirement\") return <OneSlot props={props} slot={selection.slot} />;\n    if (selection?.type === \"shiftDay\") return <ShiftDay props={props} shift={selection.shift} day={selection.day} />;\n    if (selection?.type === \"proposal\") {\n        const p = props.proposals.find(p => p.key === selection.key);\n        if (p !== undefined) return <><ScheduleInspectorHead styles={props.styles} kind={{ name: \"Model proposal\", icon: \"wand-magic-sparkles\" }} title={props.value.people.find(person => person.key === p.person)?.name ?? p.person}\n            when={`${props.value.groups.find(g => g.key === p.slot.group)?.label} · ${props.value.shifts.find(s => s.key === p.slot.shift)?.label} · ${props.format.weekdayDate(dayOfSlot(props.start, p.slot))}`} home />\n            <Box css={props.styles.section}><Box css={props.styles.title}>Why this duty</Box><Box css={props.styles.detail}>{p.reason}</Box>\n                {(props.commands.availableOn(p.slot.day) || props.commands.locked !== undefined) && <Box css={props.styles.actions}><Button size=\"xs\" variant=\"outline\" disabled={props.commands.locked !== undefined} title={props.commands.locked} onClick={() => props.onError(props.commands.accept(p.key))}>Accept proposal</Button>{dismissible(props.value) && <Button size=\"xs\" variant=\"ghost\" disabled={props.commands.locked !== undefined} title={props.commands.locked} onClick={() => props.commands.reject(p.key)}>Reject proposal</Button>}</Box>}\n            </Box></>;\n    }\n    if (selection?.type === \"person\" || selection?.type === \"personWeek\") {\n        const person = props.value.people.find(p => p.key === selection.key);\n        // A person-week (#1406, D11): the person's Details as they are, over the selected week — the week the frame shows the facts of.\n        const when = props.value.positions.find(p => p.key === person?.position)?.label;\n        const week = selection.type === \"personWeek\" ? `W${props.format.number(weekNumber(props.start))} · ${props.format.range(props.start, new Date(props.start.getTime() + 6 * DAY))}` : undefined;\n        if (person !== undefined) return <><ScheduleInspectorHead styles={props.styles} kind={{ name: `Person · ${props.value.groups.find(g => g.key === person.group)?.label}`, icon: \"user\" }} title={person.name}\n            when={[when, week].filter(part => part !== undefined).join(\" · \")} home />\n            <PersonFacts props={props} person={person} /><Box css={props.styles.section}><PlaceAction label=\"Assign person\" source={{ type: \"person\", key: person.key }} place={{ day: BigInt(props.day), group: some(person.group), shift: person.usual.type === \"some\" ? person.usual.value : props.value.shifts[0]!.key }} value={props.value} start={props.start} commands={props.commands} styles={props.styles} /></Box></>;\n    }\n    if (selection?.type === \"group\" || selection?.type === \"shift\") {\n        const group = props.value.groups.find(g => selection.type === \"group\" && g.key === selection.key), shift = props.value.shifts.find(s => selection.type === \"shift\" && s.key === selection.key);\n        return <><ScheduleInspectorHead styles={props.styles} kind={{ name: group === undefined ? \"Shift\" : \"Group\", icon: \"table-columns\" }} title={group?.label ?? shift?.label ?? \"Selection\"} when={shift === undefined ? \"Totals by shift\" : `${props.format.number(shift.hours)} h · totals by group`} home />\n            {[...props.coverage].filter(([slot]) => (props.view.layout === \"people\" || props.view.period === \"week\" || Number(slot.day) === props.day) && (group === undefined ? slot.shift === selection.key : slot.group === selection.key)).map(([slot, c], i) => <Box key={i} css={props.styles.section}><Box css={props.styles.title}>{props.format.weekday(dayOfSlot(props.start, slot))} · {props.value.groups.find(g => g.key === slot.group)?.label} · {props.value.shifts.find(s => s.key === slot.shift)?.label}</Box><Box css={props.styles.detail}>{String(c.filled)} / {String(c.positions)} positions · {props.format.number(c.hours.rostered)} of {props.format.number(c.hours.needed)} h</Box></Box>)}\n        </>;\n    }\n    return <Summary props={props} />;\n}\n/**\n * The Details tab, keeping the keyboard (#1398): a control that goes with the view it was pressed in — Remove, which turns\n * a duty's actions to Restore, Accept or Reject proposal, a day of a person's week — leaves the focus on the heading of the\n * view drawn in its place (`../shared/focus-home.ts`), never on the page's body.\n */\nfunction DetailsTab({ props }: { props: Args }) {\n    const home = useFocusHome();\n    return <Box ref={home.ref} css={props.styles.root} onFocus={home.onFocus} onBlur={home.onBlur} data-roster-inspector=\"details\"><Details props={props} /></Box>;\n}\n/** Inspector structure and headings reuse Plan's slots; no implementation paths appear in the UI. */\nexport function useRosterInspector(args: Args): BuilderFrameDock | undefined {\n    const recipe = useSlotRecipe({ key: \"planInspector\" });\n    const styles = { ...args.styles, ...recipe({}), summary: args.styles.summary, section: args.styles.section, detail: args.styles.detail } as unknown as RosterStyles;\n    if (!args.value.inspector) return undefined;\n    const props = { ...args, styles };\n    // The refusals holding Save come first, and count with the rule issues: never \"No issues\" while Save is held (#1525) —\n    // nor while the week's rows and the check's record are read (#1595): what the check finds is not known yet, so the list\n    // shows it is loading and its count is unsaid, as the toolbar's is. A read that failed is said on the board, once.\n    const read = args.read.state === \"held\";\n    const count = !read && args.refusals.length === 0 ? undefined : String(args.issues.length + args.refusals.length);\n    return { label: \"Inspector\", icon: \"sliders\", size: \"320px\", persist: \"local\", active: args.selection !== undefined,\n        badge: count, tab: args.tab, onTabChange: args.onTab,\n        tabs: [{ key: \"details\", label: \"Details\", body: <DetailsTab props={props} /> },\n            { key: \"issues\", label: \"Issues\", count, body: <Box css={styles.root} data-roster-inspector=\"issues\">\n                {args.read.state === \"pending\" && <Box css={styles.empty} data-roster-issues-loading=\"\"><PlaceholderShape kind=\"label\" index={0} /></Box>}\n                {read && args.issues.length === 0 && args.refusals.length === 0 && <Box css={styles.empty}>No issues in view.</Box>}\n                {args.refusals.length > 0 && <Refusals props={props} />}\n                {([\"breach\", \"gap\", \"proposal\"] as const).map(kind => { const issues = args.issues.filter(i => i.kind.type === kind); return issues.length === 0 ? null : <FragmentGroup key={kind} props={props} kind={kind} issues={issues} />; })}\n            </Box> }],\n    };\n}\n/** The refusals holding Save (#1525): each its duty, which a press shows on its day and selects, and its field and the app's message. */\nfunction Refusals({ props }: { props: Args }) {\n    return <><Box css={props.styles.section}><Box css={props.styles.sectionHead}>Not saved yet · {props.refusals.length}</Box></Box>\n        {props.refusals.map((refusal, index) => <Box key={index} css={props.styles.issue} data-tone=\"warning\" data-roster-issue=\"refusal\">\n            <chakra.button type=\"button\" css={props.styles.issueTitle} onClick={() => props.onRefusal(refusal)}>{refusal.title}</chakra.button>\n            <Box css={props.styles.issueDetail}>{refusal.text}</Box>\n        </Box>)}</>;\n}\nfunction FragmentGroup({ props, kind, issues }: { props: Args; kind: string; issues: readonly Issue[] }) {\n    return <><Box css={props.styles.section}><Box css={props.styles.sectionHead}>{kind === \"breach\" ? \"Breaches\" : kind === \"gap\" ? \"Gaps\" : \"Model proposals\"} · {issues.length}</Box></Box><RosterIssues props={props} issues={issues} /></>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's message table: the editing session's words — the history\n * item's and its banners', every editable collection's (`EditingMessages`) —\n * what Search Records' line says of a person the rail's narrowing hides\n * (the shared hidden pick's words, `HiddenWords`), and why it refuses an\n * optimiser's answer at the week's edges (#1553). The app's nouns — a\n * shift's, a group's, a person's — are the payload's. English is the default;\n * the frame hands it to its parts as its words' `m`, as the Calendar's does.\n *\n * @packageDocumentation\n */\n\nimport { editingMessages, type EditingMessages, type Formatters } from \"@elaraai/east-ui-components\";\nimport { hiddenByText, type HiddenWords } from \"../shared/schedule/words.js\";\n\n/**\n * Why the Roster refuses an answer of an optimiser that takes the week's edges (#1553): the banner's line, before its\n * `Nothing changed.` — each naming the duty as the landing does (`optimise.ts`' `rosterDutyName`), `unit` the period the\n * Roster publishes by.\n */\nexport interface RosterOptimiseWords {\n    /** It changes or removes a duty whose period takes no edit — `Elara's answer removes N. Ochre · Sat Mar 4 Night · Inbound, in a week not available to edit.` */\n    optimiseFixed: (p: { duty: string; removes: boolean; unit: \"week\" | \"day\" }) => string;\n    /** It puts a duty in a period that takes no edit — `Elara's answer puts N. Ochre · Sun Mar 12 Night · Inbound in a week not available to edit.` */\n    optimiseClosed: (p: { duty: string; unit: \"week\" | \"day\" }) => string;\n    /** It puts a duty beyond the week and the weeks either side, whose periods the Roster has not read — `Elara's answer puts a duty starting Mon, Mar 27, 2028 beyond the weeks either side.` */\n    optimiseBeyond: (p: { duty: string }) => string;\n    /** It gives one key among both the week's duties and its edges — `Elara's answer gives N. Ochre · Sat Mar 4 Night · Inbound twice, among the week's duties and its edges.` */\n    optimiseTwice: (p: { duty: string }) => string;\n}\n\n/** The Roster's message table. */\nexport interface RosterMessages extends EditingMessages, HiddenWords, RosterOptimiseWords {}\n\n/** Where a period that takes no edit stands, as a refusal says it. */\nconst closedPeriod = (unit: \"week\" | \"day\") => unit === \"day\" ? \"on a day not available to edit\" : \"in a week not available to edit\";\n\n/** The English table — the default. */\nexport const rosterMessages: RosterMessages = {\n    ...editingMessages,\n    hiddenByFilters: () => \"hidden by the filters\",\n    hiddenBy: ({ filters, also }) => hiddenByText(filters, also),\n    optimiseFixed: ({ duty, removes, unit }) => `Elara's answer ${removes ? \"removes\" : \"changes\"} ${duty}, ${closedPeriod(unit)}.`,\n    optimiseClosed: ({ duty, unit }) => `Elara's answer puts ${duty} ${closedPeriod(unit)}.`,\n    optimiseBeyond: ({ duty }) => `Elara's answer puts ${duty} beyond the weeks either side.`,\n    optimiseTwice: ({ duty }) => `Elara's answer gives ${duty} twice, among the week's duties and its edges.`,\n};\n\n/** The words the Roster speaks: its message table, and its locale's formatters. */\nexport interface RosterWords extends Formatters {\n    /** The message table in effect. */\n    m: RosterMessages;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Optimise in the Roster (#1409, #1421; `Optimise Spec.md` §5.1, §9.5, R23):\n * the week in view as the run's request — the week's duties by key, the\n * app's own rows as the session holds them, drafts in place; the week's\n * targets by slot; and the complete staff and configuration — and the result\n * landed on the week's duties as one edit: the diff by key, recorded as one\n * step (`ScheduleEditing.record`, origin `optimise`), and what the landing\n * draws kept until Apply — each duty's operation and its provenance, on the\n * People view's tiles and the Shifts view's chips alike, and the people whose\n * hours the latest run changed. While a run is out the commands are locked\n * (R2): every gesture refused in the one reason, the week's drafts kept.\n *\n * An optimiser that takes the week's edges (#1553) is also asked the duties\n * the window holds that the Roster places in another week, as the session\n * holds them, and which of them are fixed — their period takes no edit — and\n * its answer's edges are diffed with the week's duties as one. An answer that\n * would change what a gesture could not — a fixed duty changed or removed, a\n * duty put in a period that takes no edit or beyond the weeks either side, a\n * key given twice — is refused, naming the duty, and records nothing.\n *\n * @packageDocumentation\n */\n\nimport { SortedMap, SortedSet, StringType, type EastType } from \"@elaraai/east\";\nimport { RosterOptimiseRequestTypeFor, RosterOptimiseResultTypeFor } from \"@elaraai/e3-ui/internal\";\nimport { optimiseMessages, type Formatters } from \"@elaraai/east-ui-components\";\nimport { diffOptimiseRows, optimiseIdOf, type OptimiseDiff } from \"../shared/func/optimise-diff.js\";\nimport type { OptimiseCounts, OptimiseRefused } from \"../shared/func/use-optimise.js\";\nimport type { RosterCommands } from \"./actions.js\";\nimport type { RosterEditing } from \"./editing.js\";\nimport type { RosterOptimiseWords } from \"./messages.js\";\nimport {\n    compareDate, compareString, dayOfSlot, groupName, hourText, ownTimes, shiftOf, weekSpan, weekWindow, type Assignment, type Context, type DraftedDuty, type Requirement,\n    type Roles, type RosterDomain, type RosterValue, type Slot, type StoredDuty, type Week,\n} from \"./model.js\";\nimport { assignmentName } from \"./views.js\";\n\n/** The week's duties by key, as the request and the result carry them: the app's own rows. */\nexport type RosterOptimiseRows = SortedMap<string, unknown>;\n\n/**\n * The run's request: the week, the run's number, the week's duties by key, its targets by slot, and the complete\n * configuration — and for an optimiser that takes them (#1553), the duties at the week's edges and which are fixed.\n */\nexport interface RosterOptimiseRequest {\n    readonly from: Date;\n    readonly to: Date;\n    readonly run: bigint;\n    readonly duties: RosterOptimiseRows;\n    /** The window's duties the Roster places in another week, by key, as the session holds them. */\n    readonly edges?: RosterOptimiseRows;\n    /** The keys of those whose period takes no edit: the answer leaves them as they are. */\n    readonly fixed?: SortedSet<string>;\n    readonly requirements: ReadonlyMap<Slot, Requirement>;\n    readonly context: Context;\n}\n\n/** The run's answer: the week's duties by key, complete — and for an optimiser that takes them, the edges as it leaves them (#1553). */\nexport interface RosterOptimiseResult {\n    readonly duties: RosterOptimiseRows;\n    readonly edges?: RosterOptimiseRows;\n}\n\n/**\n * Where the Roster would place a duty's row among the weeks a run with the edges reaches (#1553) — the week and the weeks\n * either side, each with its periods as the session holds them: placed, in the week it falls in, at its place there, and\n * whether its period takes edits; a row it cannot place, in the week its day falls in, which takes it while every period\n * of that week does — it lands as that week's issue; or beyond them, `at` its start.\n */\nexport type RosterReached =\n    | { readonly type: \"placed\"; readonly start: Date; readonly assignment: Assignment; readonly open: boolean }\n    | { readonly type: \"unplaced\"; readonly start: Date; readonly at: Date; readonly open: boolean }\n    | { readonly type: \"beyond\"; readonly at: Date };\n\n/** Where the Roster would place a duty's row, by its key (see {@link RosterReached}). */\nexport type RosterReach = (row: unknown, key: string) => RosterReached;\n\n/** A duty at the week's edges as a run with the edges asked it (#1553): its row as the session held it, where it stood, and whether it is fixed. */\nexport interface RosterEdgeDuty {\n    readonly row: unknown;\n    readonly reached: RosterReached;\n    /** Whether its period takes no edit — or the Roster can place it in none it holds — so the answer leaves it as it is. */\n    readonly fixed: boolean;\n}\n\n/** The duties at the week's edges, by key (#1553). */\nexport type RosterEdges = SortedMap<string, RosterEdgeDuty>;\n\nconst NO_ROWS: RosterOptimiseRows = new SortedMap([], compareString);\n\n/** One operation a run left on a duty, until Apply (R17): what it did, the run that made it, and what its hover says. */\nexport interface RosterDutyOp {\n    readonly op: \"add\" | \"chg\" | \"del\";\n    /** The run's number, formatted. */\n    readonly run: string;\n    /** `Added by Elara · run #7`, `Was Mon Early · Inbound · Elara run #7`, or `Removed by Elara · run #7`. */\n    readonly provenance: string;\n}\n\n/**\n * What the runs left on the Roster's duties, until Apply (R17): each duty's\n * operation, a later run's over an earlier's on the same duty — a removed\n * duty's drawn on its tombstone, struck, for the highlight — and the people\n * whose week the latest run changed, whose hours and meter flash.\n */\nexport interface RosterOptimised {\n    readonly ops: ReadonlyMap<string, RosterDutyOp>;\n    readonly people: ReadonlySet<string>;\n}\n\n/**\n * The request and result types over the app's duty row type: what the bound\n * optimiser is called with, as the tag held it to — the form with the week's\n * edges where its function takes them (#1553).\n *\n * @param rowType - The duty kind's row type\n * @param edges - Whether the optimiser takes the duties at the week's edges\n * @returns The request and result East types\n */\nexport function rosterOptimiseTypes(rowType: EastType, edges: boolean): { request: EastType; result: EastType } {\n    return edges ? { request: RosterOptimiseRequestTypeFor(rowType, { edges: true }), result: RosterOptimiseResultTypeFor(rowType, { edges: true }) }\n        : { request: RosterOptimiseRequestTypeFor(rowType), result: RosterOptimiseResultTypeFor(rowType) };\n}\n\n/**\n * Whether a duty stands in the week's window as the window's read takes one (#1553): overlapping it, half open — its\n * start before the window's end and its end after the window's start — or an instant from its start.\n *\n * @param roles - The duty's roles\n * @param window - The window\n * @returns Whether the window holds it\n */\nfunction inWindow(roles: Pick<Roles, \"start\" | \"end\">, window: { from: Date; to: Date }): boolean {\n    return compareDate(roles.start, window.to) < 0 && (compareDate(roles.end, window.from) > 0 || compareDate(roles.start, window.from) >= 0);\n}\n\n/**\n * The duties at the week's edges (#1553): every duty the week's window holds — the week, and the twelve hours either\n * side — that the Roster places in another week, as the session holds it: a stored one a draft holds in its draft's\n * place, one a draft removes absent, and a drafted one where its draft puts it. Each is fixed where its period takes no\n * edit, or the Roster places it in no period it holds.\n *\n * @param args - The duty row type's domain, the window's stored duties, every draft of the session, the week's first day, the configuration, and where a row would stand\n * @returns The duties at the week's edges, by key\n */\nexport function rosterEdges(args: {\n    domain: RosterDomain; stored: ReadonlyMap<string, StoredDuty>; drafts: ReadonlyMap<string, DraftedDuty | undefined>; start: Date; context: Context; reach: RosterReach;\n}): RosterEdges {\n    const { domain, stored, drafts, start, context, reach } = args;\n    const window = weekWindow(start);\n    const edges: RosterEdges = new SortedMap([], compareString);\n    const consider = (key: string, roles: Roles, row: unknown) => {\n        if (!inWindow(roles, window) || domain.placement(roles, row, key, start, context).type !== \"elsewhere\") return;\n        const reached = reach(row, key);\n        edges.set(key, { row, reached, fixed: reached.type === \"beyond\" || !reached.open });\n    };\n    for (const [key, duty] of stored) if (!drafts.has(key)) consider(key, duty.roles, duty.row);\n    for (const [key, draft] of drafts) if (draft !== undefined) consider(key, draft.roles, draft.row);\n    return edges;\n}\n\n/**\n * The run's request (R1, R23, O3, O5): the week in view, the run's number,\n * the week's duties by key as the session holds them — the base with every\n * unapplied draft in place, every row whatever the rail shows — its targets\n * by slot, and the complete staff and configuration; for an optimiser that\n * takes them, the duties at the week's edges by key and the keys of those\n * fixed (#1553).\n *\n * @param start - The week's first day\n * @param week - The week as drafted: each duty's row is the app's own\n * @param context - Every person and the configuration\n * @param run - The run's number\n * @param edges - The duties at the week's edges ({@link rosterEdges}), for an optimiser that takes them\n * @returns The request\n */\nexport function rosterOptimiseRequest(start: Date, week: Week, context: Context, run: number, edges?: RosterEdges): RosterOptimiseRequest {\n    const duties: RosterOptimiseRows = new SortedMap([], compareString);\n    for (const [id, a] of week.assignments) duties.set(id, a.row);\n    const asked = { from: start, to: weekSpan(start).to, run: BigInt(run), duties, requirements: week.requirements, context };\n    if (edges === undefined) return asked;\n    const rows: RosterOptimiseRows = new SortedMap([], compareString);\n    const fixed = new SortedSet<string>([], compareString);\n    for (const [key, edge] of edges) {\n        rows.set(key, edge.row);\n        if (edge.fixed) fixed.add(key);\n    }\n    return { ...asked, edges: rows, fixed };\n}\n\n/**\n * Where a duty stands, as its provenance says it: its day and its shift, its\n * own times where they differ from the shift's, and its group — or No group,\n * for a duty in none (#1548), which a run placing it changes alone — `Mon\n * Early · Inbound`, `Mon Early 07–15 · No group`.\n *\n * @param value - The payload: the shifts, the groups and the words\n * @param format - The app's formatters\n * @param a - The duty\n * @param start - The week's first day\n * @returns The words\n */\nexport function rosterDutyWords(value: RosterValue, format: Pick<Formatters, \"weekday\">, a: Assignment, start: Date): string {\n    const shift = shiftOf(value, a.place.shift)?.label ?? a.place.shift;\n    return `${format.weekday(dayOfSlot(start, a.place))} ${shift}${ownTimes(value, a, start) ? ` ${hourText(a.start)}–${hourText(a.end)}` : \"\"} · ${groupName(value, a.place.group)}`;\n}\n\n/**\n * A duty as a refusal names it (#1553): whose it is, its day and date, its shift — its own times where they differ —\n * and its group; one the Roster cannot place, by its start — `N. Ochre · Sat Mar 4 Night · Inbound`, `a duty starting\n * Mon, Mar 20, 2028`.\n *\n * @param value - The payload: the people, the shifts, the groups and the words\n * @param format - The app's formatters\n * @param reached - Where the duty stands\n * @returns The words\n */\nexport function rosterDutyName(value: RosterValue, format: Pick<Formatters, \"weekday\" | \"monthDay\" | \"weekdayDate\">, reached: RosterReached): string {\n    if (reached.type !== \"placed\") return `a duty starting ${format.weekdayDate(reached.at)}`;\n    const a = reached.assignment, day = dayOfSlot(reached.start, a.place);\n    const shift = shiftOf(value, a.place.shift)?.label ?? a.place.shift;\n    return `${assignmentName(value, a)} · ${format.weekday(day)} ${format.monthDay(day)} ${shift}${ownTimes(value, a, reached.start) ? ` ${hourText(a.start)}–${hourText(a.end)}` : \"\"}`\n        + ` · ${groupName(value, a.place.group)}`;\n}\n\n/** A run with the edges' landing (#1553): what it asked of the edges, where a row would stand now, whether the periods are days, and a refusal's words. */\nexport interface RosterEdgesLanding {\n    /** The duties at the week's edges as the request asked them. */\n    readonly asked: RosterEdges;\n    /** Where a row would stand, as the periods stand as the result lands. */\n    readonly reach: RosterReach;\n    /** Whether the periods are days: what a refusal names a period. */\n    readonly days: boolean;\n    readonly m: RosterOptimiseWords;\n}\n\n/** What a landing is made over. */\nexport interface RosterLanding {\n    readonly value: RosterValue;\n    readonly domain: RosterDomain;\n    /** The editing the step is recorded in. */\n    readonly editing: RosterEditing;\n    readonly request: RosterOptimiseRequest;\n    readonly result: RosterOptimiseResult;\n    /** The step's label — `Elara run #7`. */\n    readonly label: string;\n    /** The run's number, formatted, for the provenance. */\n    readonly runText: string;\n    /** The week as drafted before the run: what the provenance says a duty was, and whose week it was. */\n    readonly week: Week;\n    /** The week's first day. */\n    readonly start: Date;\n    readonly context: Context;\n    /** The app's formatters, for the provenance's and a refusal's words. */\n    readonly format: Pick<Formatters, \"weekday\" | \"monthDay\" | \"weekdayDate\">;\n    /** What earlier runs left on the duties, still the session's drafts. */\n    readonly before: RosterOptimised | undefined;\n    /** A run with the week's edges (#1553); `undefined` for a run without, which lands as it always has. */\n    readonly edges: RosterEdgesLanding | undefined;\n}\n\n/** What a landing counted, and what the runs have left on the duties. */\nexport interface RosterLanded {\n    readonly counts: OptimiseCounts;\n    readonly optimised: RosterOptimised | undefined;\n}\n\n/**\n * Why a run with the edges' answer is refused (#1553), if it is: it changes or removes a duty it may not — a fixed one,\n * or one where it stands now in a period that takes no edit — or puts a duty in such a period or beyond the weeks either\n * side, as a gesture would be refused there. The first such operation names its duty.\n *\n * @param args - What the landing is made over\n * @param edges - The run's edges\n * @param diff - The answer's diff against the request\n * @returns The refusal's words; `undefined` for an answer the Roster takes\n */\nfunction edgesRefusal(args: RosterLanding, edges: RosterEdgesLanding, diff: OptimiseDiff): string | undefined {\n    const { value, format } = args;\n    const kind = value.duty.kind.key;\n    const unit = edges.days ? \"day\" : \"week\";\n    for (const [key, op] of diff.ops) {\n        const id = key.slice(kind.length + 1);\n        if (op.op !== \"add\") {\n            // What it changes or removes: one the request held fixed, or one whose period has closed since.\n            const asked = edges.asked.get(id);\n            const was = edges.reach(op.previous, id);\n            if (asked?.fixed === true || was.type === \"beyond\" || !was.open) {\n                return edges.m.optimiseFixed({ duty: rosterDutyName(value, format, asked?.reached ?? was), removes: op.op === \"del\", unit });\n            }\n        }\n        if (op.op === \"del\") continue;\n        // Where it puts a duty: the week, or a period of the weeks either side that takes edits.\n        const now = edges.reach(op.row, id);\n        if (now.type === \"beyond\") return edges.m.optimiseBeyond({ duty: rosterDutyName(value, format, now) });\n        if (!now.open) return edges.m.optimiseClosed({ duty: rosterDutyName(value, format, now), unit });\n    }\n    return undefined;\n}\n\n/**\n * The result landed (R7, R8, R10, §12): diffed against the request by key\n * and recorded as one step of the history, origin `optimise`. A duty the\n * result adds is an add — Off → shift; one it changes is a change — shift →\n * another, or its own times; one it drops is a remove — shift → Off, its\n * tombstone struck for the highlight (§9.5). A result that changes nothing\n * records nothing and leaves what earlier runs left as it is (R10); one that\n * does lays its operations over theirs.\n *\n * A run with the week's edges (#1553) diffs the week's duties and its edges\n * as one, each edge duty's provenance said where it stood in its own week —\n * and an answer giving a key twice, or changing what a gesture could not\n * ({@link edgesRefusal}), is refused, naming the duty, recording nothing.\n *\n * @param args - What the landing is made over\n * @returns What the run counted, and what the runs have left on the duties — unchanged by a run that changed nothing; a refusal's words for an answer the Roster refuses; `undefined` for a result the session would not take\n */\nexport function landRosterOptimise(args: RosterLanding): RosterLanded | OptimiseRefused | undefined {\n    const { value, domain, editing, request, result, label, runText, week, start, context, format, before, edges } = args;\n    const kind = value.duty.kind.key;\n    let asked = request.duties, answered = result.duties;\n    if (edges !== undefined) {\n        // The week's duties and its edges, as one: the request's are apart by construction, and the answer's must be.\n        asked = new SortedMap(request.duties, compareString);\n        for (const [key, row] of request.edges ?? NO_ROWS) asked.set(key, row);\n        answered = new SortedMap(result.duties, compareString);\n        for (const [key, row] of result.edges ?? NO_ROWS) {\n            if (answered.has(key)) return { refused: edges.m.optimiseTwice({ duty: rosterDutyName(value, format, edges.reach(row, key)) }) };\n            answered.set(key, row);\n        }\n    }\n    const diff = diffOptimiseRows(kind, domain.rowType, optimiseIdOf<string>(StringType), asked, answered);\n    const refused = edges === undefined ? undefined : edgesRefusal(args, edges, diff);\n    if (refused !== undefined) return { refused };\n    if (diff.changes.length === 0) return { counts: diff.counts, optimised: undefined };\n    if (!editing.schedule.record(diff.changes, \"optimise\", label)) return undefined;\n    // This run's operations over the earlier runs': a duty it touched again is its.\n    const ops = new Map<string, RosterDutyOp>(before?.ops ?? []);\n    const people = new Set<string>();\n    for (const [key, op] of diff.ops) {\n        const id = key.slice(kind.length + 1);\n        // What the duty was: the week's, or one at its edges where it stood in its own week (#1553).\n        const edge = edges?.asked.get(id)?.reached;\n        const was = week.assignments.get(id) ?? (edge?.type === \"placed\" ? edge.assignment : undefined);\n        const wasStart = edge?.type === \"placed\" && !week.assignments.has(id) ? edge.start : start;\n        if (was?.who.type === \"person\") people.add(was.who.value);\n        if (op.op === \"del\") {\n            ops.set(id, { op: \"del\", run: runText, provenance: optimiseMessages.ghostRemoved({ run: runText }) });\n            continue;\n        }\n        // The duty as the Roster reads the row now: whose week it is in — the week's, or with the edges any it reaches.\n        let now: Assignment | undefined;\n        if (edges === undefined) {\n            const placed = domain.placement(value.duty.read(domain.encodeRow(op.row), id), op.row, id, start, context);\n            now = placed.type === \"placed\" ? placed.value : undefined;\n        } else {\n            const reached = edges.reach(op.row, id);\n            now = reached.type === \"placed\" ? reached.assignment : undefined;\n        }\n        if (now?.who.type === \"person\") people.add(now.who.value);\n        if (op.op === \"add\" || was === undefined) {\n            ops.set(id, { op: \"add\", run: runText, provenance: optimiseMessages.entryAdded({ run: runText }) });\n            continue;\n        }\n        ops.set(id, { op: \"chg\", run: runText, provenance: optimiseMessages.entryChanged({ previous: rosterDutyWords(value, format, was, wasStart), run: runText }) });\n    }\n    return { counts: diff.counts, optimised: { ops, people } };\n}\n\n/**\n * The commands while a run is out (R2): every gesture refused with the one\n * reason — `Elara is optimising W11` — the week's drafts kept, so the views\n * keep drawing them while nothing is written; Publish off. The reason is\n * `locked`, so the week's controls stay in place, inert, rather than reading\n * as a week with no edit.\n *\n * @param commands - The commands\n * @param refusal - Why a gesture is refused\n * @returns The commands, locked\n */\nexport function lockRosterCommands(commands: RosterCommands, refusal: string): RosterCommands {\n    const refused = () => refusal;\n    const nothing = () => undefined;\n    return {\n        ...commands, available: false, availableOn: () => false, publishable: false, availableIn: () => false, editable: false, locked: refusal,\n        place: refused, update: refused, activity: refused, sets: refused, field: refused, row: refused, requirement: refused, targetRow: refused,\n        accept: refused, fix: refused, pattern: refused, applyPattern: refused,\n        remove: nothing, restore: nothing, reject: nothing, copy: nothing, publish: nothing,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a period builder's toolbar says of its period's status, the Roster's and the Allocation's alike (#1595): the date\n * picker's marks and their legend, and what the status may say, each laid out unseen in the status's slot so the slot is\n * the widest of them, a status changing neither moving the controls beside it nor folding the row.\n *\n * @packageDocumentation\n */\n\nimport { Box } from \"@chakra-ui/react\";\n\n/** A builder's recipe: the parts these draw with are its `pickerDot`, `pickerLegend`, `legendItem` and `status`. */\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** The picker's marks, each beside its word in its legend. */\nconst PICKER_MARKS = [{ mark: \"published\", word: \"Published\" }, { mark: \"draft\", word: \"Draft\" }, { mark: \"empty\", word: \"Not started\" }] as const;\n\n/**\n * A period's mark in the date picker.\n *\n * @param props - The builder's styles, and the mark: `published`, `draft` or `empty`\n * @returns The mark\n */\nexport function PickerDot({ styles, mark }: { styles: Styles; mark: string }) {\n    return <Box as=\"span\" css={styles.pickerDot} data-state={mark} />;\n}\n\n/**\n * The picker's legend: each mark beside its word.\n *\n * @param props - The builder's styles, and whose legend it is, which its items name\n * @returns The legend\n */\nexport function PickerLegend({ styles, scope }: { styles: Styles; scope: \"roster\" | \"allocation\" }) {\n    return <Box as=\"span\" css={styles.pickerLegend}>{PICKER_MARKS.map(({ mark, word }) =>\n        <Box as=\"span\" key={mark} css={styles.legendItem} {...{ [`data-${scope}-picker-legend`]: mark }}><PickerDot styles={styles} mark={mark} />{word}</Box>)}</Box>;\n}\n\n/**\n * What the status may say, each word laid out unseen in its slot. The app's own case, known by its name alone, stands\n * once it is said.\n *\n * @param props - The builder's styles, what the status says now, and anything more this builder's status may say\n * @returns The words, for the status's slot\n */\nexport function StatusWords({ styles, status, more }: { styles: Styles; status: string | undefined; more?: readonly string[] | undefined }) {\n    const words = [...new Set([\"Draft\", \"Published\", \"Not started\", \"Publishing\", ...(more ?? []), ...(status === undefined ? [] : [status])])];\n    return <>{words.map(word => <Box as=\"span\" key={word} css={styles.status} data-widest-word={word} aria-hidden=\"true\" />)}</>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useState, type ReactElement } from \"react\";\nimport { Box, Button, Menu as ChakraMenu, chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCalendarWeek, faTriangleExclamation, faSliders } from \"@fortawesome/free-solid-svg-icons\";\nimport type { SortedMap } from \"@elaraai/east\";\nimport {\n    ChipMenu, OPTIMISE_RANK, historyToolbarItem, useKeySearchToolbarItem, type EditIssue, type EditingWords, type HistoryAction, type KeySearchSource, type ToolbarItem,\n} from \"@elaraai/east-ui-components\";\nimport { HOST_RANK, PlaceholderShape, coarseHitArea, useRecordSlicesToolbarItems } from \"@elaraai/east-ui-components/internal\";\nimport { ROSTER_LAYOUT_PERIODS } from \"@elaraai/e3-ui/internal\";\nimport { useRailSources } from \"../shared/schedule/reference.js\";\nimport { SEARCH_BOX_RANK } from \"../shared/schedule/search-rank.js\";\nimport { shownViews } from \"../shared/views.js\";\nimport { PickerDot, PickerLegend, StatusWords } from \"../shared/schedule/period-status.js\";\nimport { Seg } from \"../shared/schedule/segments.js\";\nimport { shiftCalendar } from \"../shared/time/scale.js\";\nimport { TimeNavigator } from \"../shared/time/navigation.js\";\nimport type { RosterCommands } from \"./actions.js\";\nimport type { RosterEditing } from \"./editing.js\";\nimport { DAY, byDay, issuesSaid, monthWords, weekNumber, type Issue, type RosterPeriod, type RosterStyles, type RosterValue, type Status } from \"./model.js\";\nimport type { RosterWindow } from \"./window.js\";\n\nconst LAYOUTS = [{ key: \"shifts\", label: \"Shifts\" }, { key: \"people\", label: \"People\" }] as const;\n/** Each layout's periods, in the Period segment's order (#1406, P1): Shifts a day or a week, People a week or a month — a week alone on a phone (P31). */\nconst SHIFT_PERIODS = [{ key: \"day\", label: \"Day\" }, { key: \"week\", label: \"Week\" }] as const;\nconst PEOPLE_PERIODS = [{ key: \"week\", label: \"Week\" }, { key: \"month\", label: \"Month\" }] as const;\nconst PEOPLE_NARROW_PERIODS = [{ key: \"week\", label: \"Week\" }] as const;\n/** What a week over its days may say of them, beside what any status may (#1595). */\nconst WEEK_OVER_DAYS = [\"7 of 7 published\"] as const;\n/** The eye's step into the View and the View's step that draws its entry (ruled 27 Oct 2026, \"Into the View menu\"): one bundle, applied together. */\nconst EYE_INTO_VIEW = \"roster.optimise\";\ninterface ToolbarArgs extends RosterWindow {\n    value: RosterValue; styles: RosterStyles; commands: RosterCommands; editing: RosterEditing | undefined; words: EditingWords;\n    /** Whether main is narrower than a phone: People offers Week alone (#1406, P31). */\n    narrow: boolean;\n    /** The selected person-week's week, which Month → Week opens (#1406, P3). */\n    selectedWeek: Date | undefined;\n    /** The status chip's words — the week's, or by the day the day in view's or its week's days' (#1550); `undefined` without periods. */\n    status: string | undefined;\n    /** What Publish publishes, in its words (#1550): the week, or by the day in Shifts' Day the day in view. */\n    publishUnit: \"day\" | \"week\";\n    /**\n     * Whether the week is not read yet (#1398, CL1): its status, its issues and Publish keep their slots, the status a\n     * placeholder — never \"Not started\" before its row is read — and the issues one too, each unseen at its footprint\n     * until the frame's reveal says so.\n     */\n    unread: boolean;\n    /** Whether Publish is under way. */\n    publishing: boolean;\n    /** The open picker's periods' statuses, by their start: its weeks', or by the day its days' (#1550). */\n    picker: SortedMap<Date, Status>;\n    onDisplay: (value: Partial<{ density: \"compact\" | \"comfortable\"; chipSkills: boolean; requirements: boolean }>) => void;\n    issues: readonly Issue[]; onIssues: () => void; onAction: (action: HistoryAction) => void; onPickerDates: (dates: readonly Date[]) => void;\n    /** How many refusals hold Save (#1525): the issues chip counts them with the breaches and the gaps. */\n    refused: number;\n    /** The history's warning button pressed: its first issue's duty shown and selected (#1525). */\n    onIssue: (issue: EditIssue) => void;\n    /** Where an issue of the history's is, in the Roster's words — its banners' — what the history item's conflicts name their items by. */\n    where?: ((issue: EditIssue) => string) | undefined;\n    /** A conflict's Go to: its item shown and selected. */\n    onConflict?: ((issue: EditIssue) => void) | undefined;\n    /** Search Records over the people's keys (#1398); `undefined` with no one to seek. */\n    search?: KeySearchSource | undefined;\n    /** The Elara eye (#1409): the run's toolbar item, listed between the issues item and the history item; `undefined` with no optimiser. */\n    optimise?: ToolbarItem | undefined;\n    /**\n     * The eye's entry (ruled 27 Oct 2026, \"Into the View menu\"): what the View lists in the eye's place, beside the issues,\n     * where the row's floor folds the eye into it; `undefined` with no eye.\n     */\n    optimiseEntry?: ReactElement | undefined;\n    /** Whether a run of the optimiser is out (#1409, R2): the history item stays, its actions locked. */\n    locked?: boolean | undefined;\n    /** Whether the issues chip flashes (#1409): a run's result landed, and its highlight is on. */\n    issuesFlash?: boolean | undefined;\n}\n/** One shared Toolbar, including the narrowing's rail and the shared editing history. */\nexport function useRosterToolbar(args: ToolbarArgs): ReadonlyArray<ToolbarItem | false | undefined> {\n    const { value, view, setView, start, span, styles, commands, words, issues, editing } = args;\n    // The layouts this Roster offers: its switch, in every form, only where there is a choice to make.\n    const layouts = LAYOUTS.filter(item => args.layouts.includes(item.key));\n    const switches = layouts.length > 1;\n    // The narrowing: one rail over the week's duties, the people and the activities, each source counted in its own noun\n    // (#1342); the duties' range is the Roster's own navigation, never a chip of the rail (#1369), and the reference record\n    // the check reads narrows nothing, so the rail leaves its source out (#1551).\n    const chrome = value.slice.type === \"some\" ? value.slice.value : undefined;\n    const duty = value.duty.kind;\n    const dutyRange = chrome?.slice.parts.find(part => part.source === duty.key)?.slice.config.range;\n    const railSources = useRailSources(chrome?.slice);\n    const rail = useRecordSlicesToolbarItems(railSources, { nouns: { [duty.key]: `${duty.name.toLocaleLowerCase(words.locale)} events`, people: \"people\", activities: \"activities\", patterns: \"patterns\" },\n        ...(dutyRange?.type === \"some\" ? { excludeFields: [`${duty.key}.${dutyRange.value}`] } : {}),\n        ...(chrome === undefined ? {} : { affordances: chrome.affordances.map(a => a.type) }),\n        ...(chrome?.persist.type === \"some\" ? { persist: chrome.persist.value.type } : {}),\n    });\n    const chip = useRecipe({ key: \"chip\" });\n    // Search Records (#1398): primary-key navigation over the people, at the row's end. Its box is the first thing the row\n    // folds, to its icon, before the rail and the week's steps (ruled 25 Oct 2026); at the row's last step it goes into the\n    // View, beside the week and the view controls.\n    const search = useKeySearchToolbarItem(args.search, { side: \"end\", rank: SEARCH_BOX_RANK });\n    // The breaches and the gaps, and the refusals holding Save (#1525).\n    const count = issues.filter(issue => issue.kind.type === \"breach\" || issue.kind.type === \"gap\").length + args.refused;\n    // The layout's own periods (P1), each layout keeping its own as the window does; Month → Week opens the selected\n    // person-week's week (P3).\n    // Those this Roster offers: its switch, in every form, only where there is a choice to make.\n    const taken: readonly { readonly key: RosterPeriod; readonly label: string }[] = view.layout === \"people\" ? (args.narrow ? PEOPLE_NARROW_PERIODS : PEOPLE_PERIODS) : SHIFT_PERIODS;\n    const offeredPeriods = shownViews(ROSTER_LAYOUT_PERIODS[view.layout], value.settings.viewPeriods);\n    const periods = taken.filter(item => offeredPeriods.includes(item.key));\n    // A phone's People shows its one period as it always has (P31); the author's list leaving one takes the switch away.\n    const picksPeriod = offeredPeriods.length > 1;\n    const period = (key: RosterPeriod) => args.setPeriod(key, args.selectedWeek);\n    const unit = view.period;\n    const navigate = (step: number) => setView({ ...view, date: shiftCalendar(new Date(view.date), unit, step).getTime() });\n    const status = args.publishing ? \"Publishing\" : args.status;\n    const unread = args.unread;\n    // Publish: only over periods, while a period it publishes takes edits — the week, or by the day the day in view or a\n    // day of the week (#1550); its slot held wherever the Roster publishes and edits at all.\n    const publishable = value.periods.type === \"some\" && commands.publishable && !args.publishing;\n    const heldPublish = value.periods.type === \"some\" && !value.settings.readOnly;\n    const publishWords = `Publish ${args.publishUnit}`;\n    // The history: wherever the week takes edits, and wherever a draft of another week waits to be saved. A week not read\n    // yet keeps it as the last week read had it, so a read landing never shifts the toolbar nor folds it again (#1398, CL1).\n    const history = editing?.history;\n    const historyNow = history !== undefined && !value.settings.readOnly && (commands.available || args.locked === true || history.pending > 0 || history.status !== \"idle\");\n    const [historyHeld, setHistoryHeld] = useState(historyNow);\n    if (!unread && historyHeld !== historyNow) setHistoryHeld(historyNow);\n    const showHistory = history !== undefined && (historyNow || (unread && historyHeld));\n    const displayChoice = (key: string) => {\n        if (key === \"compact\" || key === \"comfortable\") args.onDisplay({ density: key });\n        else if (key === \"skills\") args.onDisplay({ chipSkills: !value.settings.chipSkills });\n        else if (key === \"targets\") args.onDisplay({ requirements: !value.settings.requirements });\n    };\n    const displayItems = <><ChakraMenu.Item value=\"compact\">Compact spacing</ChakraMenu.Item><ChakraMenu.Item value=\"comfortable\">Comfortable spacing</ChakraMenu.Item>\n        <ChakraMenu.Item value=\"skills\">{value.settings.chipSkills ? \"Hide\" : \"Show\"} chip skills</ChakraMenu.Item><ChakraMenu.Item value=\"targets\">{value.settings.requirements ? \"Hide\" : \"Show\"} requirements</ChakraMenu.Item></>;\n    const menu = <ChipMenu label=\"View\" icon={faCalendarWeek} onSelect={key => {\n        if (key === \"people\" || key === \"shifts\") args.setLayout(key);\n        else if (key === \"day\" || key === \"week\" || key === \"month\") period(key);\n        else if (key === \"publish\" && publishable) commands.publish();\n        else if (key === \"previous\") navigate(-1); else if (key === \"next\") navigate(1);\n        else if (key === \"issues\") args.onIssues(); else displayChoice(key);\n    }}>\n        {switches && <>{layouts.map(item => <ChakraMenu.Item key={item.key} value={item.key}>{item.label}</ChakraMenu.Item>)}<ChakraMenu.Separator /></>}\n        {picksPeriod && <>{periods.map(item => <ChakraMenu.Item key={item.key} value={item.key}>{item.label}</ChakraMenu.Item>)}<ChakraMenu.Separator /></>}\n        <ChakraMenu.Item value=\"previous\">Previous {unit}</ChakraMenu.Item><ChakraMenu.Item value=\"next\">Next {unit}</ChakraMenu.Item>{value.inspector && <ChakraMenu.Item value=\"issues\">{issuesSaid(count)}</ChakraMenu.Item>}<ChakraMenu.Separator />{displayItems}\n        {heldPublish && <><ChakraMenu.Separator /><ChakraMenu.Item value=\"publish\" disabled={!publishable}>{publishWords}</ChakraMenu.Item></>}\n    </ChipMenu>;\n    // The Elara eye (#1409) and its entry: at the row's floor the eye goes into the View, which lists it in its place\n    // (ruled 27 Oct 2026, \"Into the View menu\"); an eye with no entry keeps to the row.\n    const eye = args.optimise !== undefined && args.optimiseEntry !== undefined ? { item: args.optimise, entry: args.optimiseEntry } : undefined;\n    // When the frame itself is narrower than a phone viewport, one popover\n    // holds both week and view controls. It folds before the shared history —\n    // and, at the row's floor, holds the eye's entry beside the issues.\n    const controls = (withEye: boolean) => <Box css={styles.agendaGroup}>\n        {search?.forms[0]}\n        {switches && <Seg label=\"Layout\" scope=\"roster\" name=\"compact-layout\" items={layouts} active={view.layout} onPick={args.setLayout} />}\n        {picksPeriod && <Seg label=\"Period\" scope=\"roster\" name=\"compact-period\" items={periods} active={view.period} onPick={period} />}\n        <ChipMenu label=\"Display\" icon={faSliders} onSelect={displayChoice}>{displayItems}</ChipMenu>\n        {value.inspector && <Button size=\"xs\" variant=\"ghost\" onClick={args.onIssues}>{issuesSaid(count)}</Button>}\n        {withEye && eye?.entry}\n        {heldPublish && <Button size=\"xs\" variant=\"solid\" disabled={!publishable} loading={args.publishing} aria-label={publishWords} aria-busy={args.publishing ? true : undefined}\n            onClick={() => commands.publish()}>{publishWords}</Button>}\n    </Box>;\n    // The People layout's labels (#1406, P2): the week and its number — `Mar 12 – 18, 2028 · W11` — or the month, its weeks\n    // and its range — `March 2028 · W10–W14 · Mar 5 – Apr 1`. Shifts keeps the shared navigator's own words.\n    const rangeLabel = view.period === \"month\" ? monthWords(words, span)\n        : view.layout === \"people\" ? `${words.range(span.start, new Date(span.start.getTime() + 6 * DAY))} · W${words.number(weekNumber(span.start))}` : undefined;\n    // The picker's marks: each week's status — or where the periods are days (#1550) each day's, a week's then published\n    // once its seven days are and a draft once one is started — the app's own cases a draft's mark. Where the day in view\n    // is what publishes, in Shifts' Day, it opens on the days.\n    const days = byDay(value);\n    const dayPicked = days && view.layout === \"shifts\" && view.period === \"day\";\n    const markOf = (held: Status | undefined) => held === undefined ? \"empty\" : held.type === \"published\" ? \"published\" : \"draft\";\n    const weekMark = (date: Date) => {\n        if (!days) return markOf(args.picker.get(date));\n        const held = Array.from({ length: 7 }, (_, day) => args.picker.get(new Date(date.getTime() + day * DAY)));\n        return held.every(status => status?.type === \"published\") ? \"published\" : held.some(status => status !== undefined) ? \"draft\" : \"empty\";\n    };\n    const dot = (mark: string) => <PickerDot styles={styles} mark={mark} />;\n    const legend = <PickerLegend styles={styles} scope=\"roster\" />;\n    const navigation = (compact = false, combined = false, withEye = false) => <TimeNavigator scope=\"roster\" date={view.date} period={unit} rangeLabel={rangeLabel}\n        sunday={value.settings.weekStart.type === \"sunday\"} onChange={date => setView({ ...view, date })}\n        compact={compact} label={combined ? \"View\" : dayPicked ? \"Choose roster day\" : \"Choose roster week\"} initialPanel={dayPicked ? \"day\" : \"week\"} onWeeks={args.onPickerDates}\n        weekMarker={date => dot(weekMark(date))} {...(days ? { dayMarker: (date: Date) => dot(markOf(args.picker.get(date))) } : {})}\n        legend={legend} controls={combined ? controls(withEye) : undefined} />;\n    const daySelect = <Seg label=\"Day of week\" scope=\"roster\" name=\"days\" active={String(args.day)} onPick={day => setView({ ...view, date: start.getTime() + Number(day) * DAY })}\n        items={Array.from({ length: 7 }, (_, day) => ({ key: String(day), label: words.weekday(new Date(start.getTime() + day * DAY)) }))} />;\n    return [\n        ...rail,\n        switches && { key: \"roster.layout\", side: \"start\", rank: HOST_RANK + 1, bundle: \"roster.view\", forms: [<Seg label=\"Layout\" scope=\"roster\" name=\"layout\" items={layouts} active={view.layout} onPick={args.setLayout} />, null] },\n        // The layout's own periods, in every form of the row (#1406, P1).\n        picksPeriod && { key: \"roster.period\", side: \"start\", rank: HOST_RANK + 1, bundle: \"roster.view\", forms: [<Seg label=\"Period\" scope=\"roster\" name=\"period\" items={periods} active={view.period} onPick={period} />, null] },\n        { key: \"roster.display\", side: \"start\", rank: HOST_RANK + 1, bundle: \"roster.view\", forms: [<ChipMenu label=\"Display\" icon={faSliders} onSelect={displayChoice}>{displayItems}</ChipMenu>, null] },\n        { key: \"roster.view\", side: \"start\", rank: [HOST_RANK + 1, HOST_RANK + 6], bundle: [\"roster.view\", \"roster.controls\"], forms: [null, menu, null] },\n        // The week's navigation: compact, then the View holding the week and view controls; and, with an eye, at the\n        // row's floor the View holding its entry too, in the step that takes the eye from the row (a rung of the floor).\n        { key: \"roster.navigation\", side: \"start\", rank: [HOST_RANK + 4, HOST_RANK + 6, OPTIMISE_RANK], bundle: [undefined, \"roster.controls\", EYE_INTO_VIEW],\n            forms: [navigation(), navigation(true), navigation(true, true), ...(eye === undefined ? [] : [navigation(true, true, true)])] },\n        view.layout === \"shifts\" && view.period === \"day\" && { key: \"roster.days\", side: \"start\", rank: HOST_RANK + 2, forms: [daySelect, null] },\n        // The status, the issues and Publish keep their slots from cold load, whatever the week's read (#1398, CL1): a read\n        // landing never shifts the toolbar nor folds it again. Unread, the status and the issues are placeholders.\n        status !== undefined && { key: \"roster.status\", side: \"start\", rank: HOST_RANK, forms: [<Box css={styles.widestSlot}>\n            <StatusWords styles={styles} status={status} more={days && !dayPicked ? WEEK_OVER_DAYS : undefined} />\n            {unread\n                ? <Box css={[styles.status, styles.heldSlot]} data-roster-status=\"\" data-pending=\"\"><PlaceholderShape kind=\"enum\" index={0} /></Box>\n                : <Box css={styles.status} data-tone={status === \"Published\" ? \"success\" : \"neutral\"} data-roster-status=\"\">{status}</Box>}\n        </Box>, null] },\n        // The issues' slot is as wide as a count of two figures, at any count or none (#1595).\n        value.inspector && { key: \"roster.issues\", side: \"end\", rank: HOST_RANK + 3, forms: [<Box css={styles.widestSlot} data-end=\"\">\n            <chakra.span css={chip({ tone: \"warn\" })} data-widest-word={issuesSaid(99)} aria-hidden=\"true\"><FontAwesomeIcon icon={faTriangleExclamation} /></chakra.span>\n            {unread\n                ? <Box css={styles.heldSlot} data-roster-issues=\"\" data-pending=\"\"><PlaceholderShape kind=\"count\" index={0} /></Box>\n                : count > 0 ? <chakra.button type=\"button\" css={[chip({ tone: \"warn\" }), coarseHitArea({ position: true })]} data-roster-issues=\"\" data-opn={args.issuesFlash === true ? \"\" : undefined} onClick={args.onIssues} aria-label={`${count} roster ${count === 1 ? \"issue\" : \"issues\"}`}><FontAwesomeIcon icon={faTriangleExclamation} /><span data-chip-label=\"\">{issuesSaid(count)}</span></chakra.button>\n                    : <Box css={styles.heldSlot} data-roster-issues=\"\" aria-hidden=\"true\" />}\n        </Box>, null] },\n        search !== undefined && { ...search, forms: [...search.forms, null], rank: [SEARCH_BOX_RANK, HOST_RANK + 6], bundle: [undefined, \"roster.controls\"] },\n        // The Elara eye (#1409), between the issues item and the history item, whose actions a run out locks (R2): in the row\n        // at every width the ladder and the rail's caret leave it room, and else the View's entry, never out of the toolbar.\n        eye === undefined ? args.optimise : { ...eye.item, forms: [...eye.item.forms, null], rank: OPTIMISE_RANK, bundle: EYE_INTO_VIEW },\n        showHistory && historyToolbarItem({ session: history, words, editing: false, showError: false, onIssue: args.onIssue, onConflict: args.onConflict, where: args.where, onAction: args.onAction, locked: args.locked === true }),\n        // As tall as every control in the row (`sm`, 28px, ruled 23 Oct 2026), its slot held while the week can't publish, and\n        // its spinner while it publishes, until every record reads back as saved (#1573) — named as it is, `aria-busy`: the\n        // spinner hides its words.\n        heldPublish && { key: \"roster.publish\", side: \"end\", rank: HOST_RANK + 5, forms: [<Button size=\"sm\" variant=\"solid\" disabled={!publishable} loading={args.publishing}\n            aria-label={publishWords} aria-busy={args.publishing ? true : undefined} onClick={() => commands.publish()}>{publishWords}</Button>, null] },\n    ];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Roster's view (#1342, #1406): its layout, its period and its date, kept\n * per viewer. Each layout keeps its own period — Shifts a day or a week,\n * People a week or a month — so switching layouts restores the period that\n * layout had (P1); a view kept before the periods were per layout reads as\n * the defaults. The span in view follows the view: a week, or the four to six\n * weeks that touch a month (D2). The view is the page's own (#1398,\n * `shared/schedule/page-view.ts`), as the window it writes into its source\n * is: another page keeping a view moves neither, and a reload opens on the\n * view kept last.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { RosterLayoutType, RosterPeriodType } from \"@elaraai/e3-ui/internal\";\nimport { usePageView } from \"../shared/schedule/page-view.js\";\nimport { shiftCalendar } from \"../shared/time/scale.js\";\nimport { shownView, shownViews } from \"../shared/views.js\";\nimport {\n    DAY, compareDate, dayStart, periodOf, rosterSpan, weekStart, type RosterLayout, type RosterPeriod, type RosterSpan, type RosterValue, type RosterView,\n} from \"./model.js\";\n\nexport interface RosterWindow {\n    view: RosterView; setView: (next: RosterView) => void;\n    /** The layouts this Roster offers, in the switch's order: the `views` prop's. */\n    layouts: readonly RosterLayout[];\n    /** Whether the layout in view offers Day, and Week (`viewPeriods`): what a heading opening one of them is a control only for. */\n    opensDay: boolean; opensWeek: boolean;\n    /** The span in view: its weeks, and the window its reads cover. */\n    span: RosterSpan;\n    /** The span's first week's first day. */\n    start: Date;\n    /** The day of its week the view's date is, from zero: the day the Shifts layout's Day period shows. */\n    day: number;\n    /** Shows a layout, with the period it last had (P1). */\n    setLayout: (layout: RosterLayout) => void;\n    /**\n     * Shows a period of the layout in view (P3): Week → Month opens the month holding the week's fourth day; Month → Week\n     * the week given, else the week Month was opened from while the month in view still holds it, else the month's first\n     * whose fourth day falls in it.\n     */\n    setPeriod: (period: RosterPeriod, week?: Date) => void;\n    /** Steps the span by its unit — a week, or a month in Month (P2). */\n    step: (by: number) => void;\n    /** Opens a week in the Week period, of the layout given or the one in view (P12, P24). */\n    openWeek: (week: Date, layout?: RosterLayout) => void;\n}\n\n/** The layouts, in the switch's order. */\nconst LAYOUTS = Object.keys(RosterLayoutType.cases) as readonly RosterLayout[];\n\n/** A list offering every period. */\nconst EVERY_PERIOD: readonly { readonly type: string }[] = [];\n\n/** A view as it is kept: its period one its layout takes, and this Roster offers, whatever an older view held. */\nfunction normal(view: RosterView, offered: readonly { readonly type: string }[] = EVERY_PERIOD): RosterView {\n    const period = periodOf(view.layout, view.period, offered);\n    return period === view.period ? view : { ...view, period };\n}\n\n/** A view as it is drawn: a layout this Roster offers, with the period that layout last had (P1). What is kept stands, so the layout comes back should the Roster offer it again. */\nfunction offered(view: RosterView, layouts: readonly RosterLayout[], periods: readonly { readonly type: string }[]): RosterView {\n    const layout = shownView(view.layout, layouts);\n    return layout === view.layout ? view : normal({ ...view, layout, period: periodOf(layout, view.held?.[layout], periods) }, periods);\n}\n\n/**\n * The view storage keeps, read defensively — storage outlives versions, and anything may write it: an object whose\n * layout and period are cases of the Roster's own, whose date is a finite epoch, and whose periods per layout (#1406,\n * P1) are taken where each reads as one — anything else left out.\n *\n * @param stored - What storage keeps under the view's key\n * @returns The view; `undefined` for anything else\n */\nfunction rosterViewOf(stored: unknown): RosterView | undefined {\n    if (typeof stored !== \"object\" || stored === null) return undefined;\n    const { layout, period, date, held } = stored as Partial<Record<keyof RosterView, unknown>>;\n    if (typeof layout !== \"string\" || !Object.hasOwn(RosterLayoutType.cases, layout)) return undefined;\n    if (typeof period !== \"string\" || !Object.hasOwn(RosterPeriodType.cases, period)) return undefined;\n    if (typeof date !== \"number\" || !Number.isFinite(date)) return undefined;\n    const periods: Partial<Record<RosterLayout, RosterPeriod>> = {};\n    if (typeof held === \"object\" && held !== null) {\n        for (const [of, was] of Object.entries(held)) {\n            if (Object.hasOwn(RosterLayoutType.cases, of) && typeof was === \"string\" && Object.hasOwn(RosterPeriodType.cases, was)) periods[of as RosterLayout] = was as RosterPeriod;\n        }\n    }\n    return normal({ layout: layout as RosterView[\"layout\"], period: period as RosterView[\"period\"], date, held: periods });\n}\n\n/**\n * The week is the Roster's own: its navigation and its picker choose it, kept per viewer (#1342: no Slice picks it), the\n * page's own while the page runs (see the module docs).\n *\n * @param value - The payload: the author's view, and the week's start\n * @param key - The Roster's storage key\n * @param narrow - Whether main is narrower than a phone: People shows a week at a time there, whatever is kept or offered (P31), so every week can be reached\n * @returns The view, what moves it, the span in view, its first day and the view's day in its week\n */\nexport function useRosterWindow(value: RosterValue, key: string, narrow: boolean): RosterWindow {\n    const { view: kept, setView: setKept } = usePageView<RosterView>(`${key}.view`, {\n        layout: value.settings.layout.type, period: periodOf(value.settings.layout.type, value.settings.period.type, value.settings.viewPeriods),\n        date: dayStart(value.settings.date.type === \"some\" ? value.settings.date.value : new Date()).getTime(),\n    }, rosterViewOf);\n    const views = value.settings.views;\n    const layouts = useMemo(() => shownViews(LAYOUTS, views), [views]);\n    const periods = value.settings.viewPeriods;\n    const sunday = value.settings.weekStart.type === \"sunday\";\n    const view = useMemo(() => {\n        const shown = offered(normal(kept, periods), layouts, periods);\n        if (!narrow || shown.period !== \"month\") return shown;\n        // A kept month opens on its first week, and a step keeps the week from there on. With Month alone offered it stays\n        // what is kept, so the week is the date's, which each step moves.\n        const week = periodOf(shown.layout, \"week\", periods) === \"week\";\n        return { ...shown, period: \"week\" as const, date: week ? rosterSpan(shown.date, \"month\", sunday).start.getTime() : shown.date };\n    }, [kept, layouts, periods, narrow, sunday]);\n    const span = useMemo(() => rosterSpan(view.date, view.period, sunday), [view.date, view.period, sunday]);\n    const week = useMemo(() => weekStart(new Date(view.date), sunday), [view.date, sunday]);\n    const day = Math.floor((dayStart(view.date).getTime() - week.getTime()) / DAY);\n    const setView = useCallback((next: RosterView) => setKept(normal(next, periods)), [setKept, periods]);\n    const setLayout = useCallback((layout: RosterLayout) => {\n        if (layout === view.layout || !layouts.includes(layout)) return;\n        // The layout's own period, as it last had it; the period in view kept for the layout left.\n        setView({ ...view, layout, period: periodOf(layout, view.held?.[layout], periods), held: { ...view.held, [view.layout]: view.period } });\n    }, [view, layouts, periods, setView]);\n    // The week Month was opened from (P3, ruled 26 Oct 2026): what Month → Week returns to while the month in view still\n    // holds it — a viewer toggling the two keeps their place; a month stepped to opens on its own first week.\n    const left = useRef<Date | undefined>(undefined);\n    const setPeriod = useCallback((period: RosterPeriod, at?: Date) => {\n        const next = periodOf(view.layout, period, periods);\n        if (next === view.period) return;\n        let date = view.date;\n        // Week → Month: the month holding the week's fourth day. Month → Week: the week given, else the week left while\n        // the month holds it, else the first week of the month whose fourth day falls in it.\n        if (next === \"month\") { left.current = week; date = week.getTime() + 3 * DAY; }\n        else if (view.period === \"month\") {\n            const month = span.month ?? span.start;\n            const back = left.current;\n            const first = at ?? (back !== undefined && span.weeks.some(start => compareDate(start, back) === 0) ? back : undefined)\n                ?? span.weeks.find(start => compareDate(monthOf(new Date(start.getTime() + 3 * DAY)), month) === 0) ?? span.start;\n            date = first.getTime();\n        }\n        setView({ ...view, period: next, date });\n    }, [view, week, span, periods, setView]);\n    const step = useCallback((by: number) => {\n        const date = view.period === \"month\" ? shiftCalendar(new Date(view.date), \"month\", by).getTime() : view.date + by * 7 * DAY;\n        setView({ ...view, date });\n    }, [view, setView]);\n    const openWeek = useCallback((at: Date, asked: RosterLayout = view.layout) => {\n        const layout = shownView(asked, layouts);\n        // No Week offered: a month's column stays the month's, which a date of another month's would move.\n        if (periodOf(layout, \"week\", periods) !== \"week\") return;\n        const held = layout === view.layout ? view.held : { ...view.held, [view.layout]: view.period };\n        setView({ ...view, layout, period: \"week\", date: at.getTime(), held });\n    }, [view, layouts, periods, setView]);\n    const opensDay = periodOf(view.layout, \"day\", periods) === \"day\", opensWeek = periodOf(view.layout, \"week\", periods) === \"week\";\n    return { view, setView, layouts, opensDay, opensWeek, span, start: span.start, day, setLayout, setPeriod, step, openWeek };\n}\n\n/** The first day of a date's month. */\nfunction monthOf(date: Date): Date { return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1)); }\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n/**\n * Which people and activities show (#1342): the Roster reads each source of its\n * `Slice.bindRecords` itself through the shared source visibility, and a source\n * with nothing chosen reads no page and hides nothing. Coverage, costs, checks\n * and the editing session never see it.\n */\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { sourcePart, useSourceVisibility, type KeyVisibility } from \"../shared/schedule/visibility.js\";\nimport type { RosterPayload } from \"./model.js\";\n\n/** A narrowed source's name: what its rows are on the Roster — its people, its activities, or its week patterns (#1406). */\nexport type RosterNarrowed = \"people\" | \"activities\" | \"patterns\";\n\n/** What a failed narrowing of each source says. */\nconst WORDS = {\n    people: { changed: \"Staff results changed; retry the narrowing.\", failed: \"Could not load staff results\" },\n    activities: { changed: \"Activity results changed; retry the narrowing.\", failed: \"Could not load activity results\" },\n    patterns: { changed: \"Pattern results changed; retry the narrowing.\", failed: \"Could not load pattern results\" },\n} as const;\n\n/**\n * A source's part of the Roster's narrowing, if the slice has one.\n *\n * @param value - The payload\n * @param source - The source\n * @returns Its record Slice's controls\n */\nexport function rosterPart(value: RosterPayload, source: RosterNarrowed): ValueTypeOf<RecordSliceBindType> | undefined {\n    return sourcePart(value.slice.type === \"some\" ? value.slice.value : undefined, source);\n}\n\n/**\n * Which of a source's rows show: its narrowed keys while a choice narrows it,\n * every row while none does; the previous complete membership while a new one\n * resolves.\n *\n * @param value - The payload\n * @param source - The source\n * @returns The keys to show, and the narrowing's state\n */\nexport function useRosterVisibility(value: RosterPayload, source: RosterNarrowed): KeyVisibility {\n    return useSourceVisibility(value.slice.type === \"some\" ? value.slice.value : undefined, source, value.narrowed[source],\n        source === \"people\" ? value.people : source === \"activities\" ? value.activities : value.patterns, WORDS[source]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * e3-ui's Roster renderer (#1369, `Builder Interfaces Spec.md` §5, §7, §9):\n * the app's own records — its duties, its weeks and its targets, a session\n * each of one history — read a week at a time and assembled into the week the\n * grid, the cards, the library, the inspector and the toolbar draw, drafts in\n * place; the app's pay asked a person at a time; Publish saving the week, then\n * writing the status of each period it publishes — the week's, or where the\n * periods are days (#1550) the day in view's in Shifts' Day, else each day of\n * the week not yet published, a published day read-only in every layout while\n * the week's other days take edits. The duties' source of the slice holds the week's window,\n * which the Roster's own navigation writes. Search Records seeks the people by\n * their keys (`find.ts`, #1398): a pick selects the person, their People row\n * brought into view — one the rail's narrowing hides once the choices that hide\n * them are cleared — and the keyboard handed to their name; where the People\n * views rest is saved, and comes back as they mount. The span in view is a\n * week, or a month's four to six (#1406): each week assembled from the span's\n * rows, the week the inspector and the commands work over the selected\n * person-week's, or a work requirement's day's (#1568), or the selected\n * duty's, else the first; a month drawing the work requirement works out each\n * of its weeks' coverage, the hours alone. With an optimiser bound, the Elara eye\n * (#1409): one run over the week in view, its result landed on the week's\n * duties as one step of the history, and what it left on them marked until\n * Apply. BuilderFrame stays an internal React detail.\n *\n * @packageDocumentation\n */\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { Box, Button, useSlotRecipe } from \"@chakra-ui/react\";\nimport { ArrayType, StringType, equalFor, isVariant, none, some, variant, type option } from \"@elaraai/east\";\nimport { RosterComponent, RosterContextType, RosterIssueType, SCHEDULE_REFERENCE } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, BuilderFrame, SessionBanners, fieldBreachIssue, historyShortcut, implementUIComponent, optimiseMessages, takeKey, typedInto, useContainerBelow, useDataStable,\n    useFormatters, useLanding, useLandingStyles, usePersistedState, useTrackedEvaluation, type BuilderFramePanes, type EditIssue, type Formatters, type HistoryAction,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingReveal, keptRead } from \"@elaraai/east-ui-components/internal\";\nimport { rowBreaches } from \"../shared/bounds.js\";\nimport { useOptimise } from \"../shared/func/use-optimise.js\";\nimport { useOptimiseParts } from \"../shared/func/optimise-parts.js\";\nimport { periodLoading, periodLoadingLine, periodRead, retryPeriod } from \"../shared/loading.js\";\nimport { FieldAskProvider, useFieldAsks } from \"../shared/schedule/field-ask.js\";\nimport { useSourceHidden } from \"../shared/schedule/hidden.js\";\nimport { useHiddenPick } from \"../shared/schedule/hidden-pick.js\";\nimport { useGroupCollapse } from \"../shared/schedule/group-heading.js\";\nimport { publishPeriod } from \"../shared/schedule/records.js\";\nimport { refusalText, scheduleRefusals } from \"../shared/schedule/refusals.js\";\nimport { useSourceWindow } from \"../shared/schedule/source-window.js\";\nimport { publishChanges, rosterCommands } from \"./actions.js\";\nimport { RosterDataReader, initialRosterData, type RosterData } from \"./data.js\";\nimport { useRosterDrag } from \"./drag.js\";\nimport { PERIODS, TARGETS, useRosterEditing, useRosterStanding, type RosterEditing } from \"./editing.js\";\nimport { useRosterFind, type FoundPerson } from \"./find.js\";\nimport { sameFind, useRosterFit, type RosterFind } from \"./fit.js\";\nimport { RosterFooter } from \"./footer.js\";\nimport { useRosterInspector, type RosterRefusal } from \"./inspector.js\";\nimport { useRosterLibrary } from \"./library.js\";\nimport { rosterMessages, type RosterWords } from \"./messages.js\";\nimport {\n    DAY, NARROW_WIDTH, NO_PAY, NO_PERIOD, RosterPayCache, RosterSpanCoverage, availableProposals, byDay, compareDate, configError, dayOfSlot, editableStatus, groupOf, NO_GROUP, periodOn, periodsText,\n    placeDrafted, placeStored, placeTargets, rosterContext, rosterDomain, rosterReferenceCheckEncoder, selectionWeek, slotOfPlace, spanWindow, spanWords, started, takesEdits, weekBefore, weekKey, weekNumber, weekOf,\n    weekPeriods, weekSpan, weekStart, type Assignment, type Coverage, type DraftedDuty, type Issue, type PlacedDuties, type PlacedPeriod, type RosterPayload, type RosterStyles,\n    type RosterValue, type Selection, type Slot, type StoredDuty, type StoredTarget, type WeekPeriod, type WeekState,\n} from \"./model.js\";\nimport {\n    landRosterOptimise, lockRosterCommands, rosterEdges, rosterOptimiseRequest, rosterOptimiseTypes, type RosterEdges, type RosterOptimiseRequest, type RosterOptimiseResult,\n    type RosterOptimised, type RosterReach,\n} from \"./optimise.js\";\nimport { useRosterToolbar } from \"./toolbar.js\";\nimport { RosterViews, assignmentName, personOf, readRosterAnchor, type PeoplePick, type RosterAnchor } from \"./views.js\";\nimport { useRosterWindow, type RosterWindow } from \"./window.js\";\nimport { rosterPart, useRosterVisibility } from \"./visibility.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { useSourceShown, type SourceShown } from \"../shared/schedule/source-tab.js\";\nimport type { KeyVisibility } from \"../shared/schedule/visibility.js\";\nexport type { RosterValue } from \"./model.js\";\n\n/** Props of the record-backed Roster extension. */\nexport interface EastChakraRosterProps { value: RosterPayload; storageKey: string }\nconst NO_DATES: readonly Date[] = [];\nconst NO_DUTY_DRAFTS: ReadonlyMap<string, DraftedDuty | undefined> = new Map();\nconst NO_TARGET_DRAFTS: ReadonlyMap<string, StoredTarget | undefined> = new Map();\nconst NO_PERIOD_DRAFTS: ReadonlyMap<string, Uint8Array | undefined> = new Map();\nconst NO_STORED: ReadonlyMap<string, StoredDuty> = new Map();\nconst NO_STORED_TARGETS: ReadonlyMap<string, StoredTarget> = new Map();\nconst NO_ISSUES: readonly Issue[] = [];\n/** No week of the span's coverage: a month drawing no work requirement. */\nconst NO_SPAN_COVERAGE: readonly ReadonlyMap<Slot, Coverage>[] = [];\nconst sameContext = equalFor(RosterContextType);\nconst sameIssues = equalFor(ArrayType(RosterIssueType));\n/** No People view has rested anywhere yet. */\nconst NO_ANCHOR: RosterAnchor = {};\n/** The viewer's display settings, as storage keeps them. */\nconst readRosterDisplay = keptRead.record({ density: keptRead.oneOf(\"compact\", \"comfortable\"), chipSkills: keptRead.boolean, requirements: keptRead.boolean });\nconst keyEqual = equalFor(StringType);\n/**\n * The frame's root takes the focus a click on a part of it holding nothing focusable gives — a pane's empty foot, the\n * toolbar's gaps — so the keyboard is in the Roster, never the page's body, as the Calendar's is: not a tab stop.\n */\nconst CLICK_FOCUS: Readonly<Record<string, string>> = { tabIndex: \"-1\" };\n\n/** What the frame takes from the Roster around it: the payload as read, the week, the narrowing, and the editing. */\ninterface FrameProps {\n    source: RosterPayload; value: RosterValue; storageKey: string; window: RosterWindow;\n    visibility: KeyVisibility; activities: KeyVisibility; patterns: KeyVisibility; shown: { people: SourceShown; activities: SourceShown; patterns: SourceShown };\n    display: { density: \"compact\" | \"comfortable\"; chipSkills: boolean; requirements: boolean };\n    setDisplay: (next: { density: \"compact\" | \"comfortable\"; chipSkills: boolean; requirements: boolean }) => void;\n    /** Why the week's window could not be written to the duties' source. */\n    rangeError: string | undefined;\n    /** Told whether main is narrower than a phone: the window, which the frame's reads follow, holds People to a week there (P31). */\n    onNarrow: (narrow: boolean) => void;\n    editing: RosterEditing | undefined;\n}\n\n/** A period's own row, read — a week's, or a day's (#1550): its status and what it dismissed. */\nfunction periodOf(source: RosterPayload, bytes: Uint8Array | undefined): PlacedPeriod {\n    if (bytes === undefined || source.periods.type !== \"some\") return NO_PERIOD;\n    return { bytes, status: source.periods.value.status(bytes), dismissed: source.periods.value.dismissed(bytes) };\n}\n\n/**\n * The banner over the periods in view that take no edits (#1550): one period's — the week's, or the day's in view —\n * as the week's has always said it, its unit named; over a week's days, every one published as the week's, else how\n * many of them are closed, each named by its weekday — the week's days, so its weekday alone names one: `Sun, Mon\n * are read-only.`\n *\n * @param viewed - The periods in view\n * @param unit - What one of them is: a week, or a day\n * @param format - The app's formatters\n * @returns The banner's words; `undefined` while every period in view takes edits\n */\nfunction closedBanner(viewed: readonly WeekPeriod[], unit: \"day\" | \"week\", format: Pick<Formatters, \"number\" | \"weekday\">): { title: string; description: string } | undefined {\n    const closed = viewed.filter(p => !editableStatus(p.held.status));\n    if (closed.length === 0) return undefined;\n    const published = closed.every(p => p.held.status.type === \"published\");\n    if (viewed.length === 1) {\n        const status = closed[0]!.held.status;\n        return status.type === \"other\" ? { title: `${status.value} ${unit}`, description: `This ${unit} is read-only.` }\n            : { title: `Published ${unit}`, description: \"Read-only view of the published roster.\" };\n    }\n    if (published && closed.length === viewed.length) return { title: \"Published week\", description: \"Read-only view of the published roster.\" };\n    return { title: `${format.number(closed.length)} of ${format.number(viewed.length)} days ${published ? \"published\" : \"read-only\"}`,\n        description: `${closed.map(p => format.weekday(p.start)).join(\", \")} ${closed.length === 1 ? \"is\" : \"are\"} read-only.` };\n}\n\n/** The sole editable wrapper: a read-only Roster never creates a record session. */\nfunction EditableRoster(props: Omit<FrameProps, \"editing\">) {\n    const { source } = props;\n    // Each record's Save notice counts what leaves its own source's narrowing: the duties', and the targets' where the slice narrows them.\n    const recordSlices = useMemo(() => [source.duty.kind.key, \"targets\"].flatMap(name => {\n        const part = sourcePart(source.slice.type === \"some\" ? source.slice.value : undefined, name);\n        return part === undefined ? [] : [part];\n    }), [source]);\n    const editing = useRosterEditing(props.value, props.storageKey, props.window.span, recordSlices);\n    return <RosterFrame {...props} editing={editing} />;\n}\n\nfunction RosterFrame(props: FrameProps) {\n    const { source, value, storageKey: key, window, visibility, activities, editing } = props;\n    const { span } = window;\n    const [pickerDates, setPickerDates] = useState(NO_DATES);\n    const domain = rosterDomain(source.duty.rowType);\n    // Every person and activity, kept while its data holds: a payload built again asks the pay nothing again.\n    const context = useDataStable(useMemo(() => rosterContext(source), [source]), sameContext);\n    // Each read's duties placed once: the reader asks whether the week holds any, and the frame draws them.\n    const placed = useRef<{ context: unknown; by: Map<number, WeakMap<ReadonlyMap<string, StoredDuty>, PlacedDuties>> }>({ context: undefined, by: new Map() });\n    const place = useCallback((duties: ReadonlyMap<string, StoredDuty>, at: Date): PlacedDuties => {\n        if (!Object.is(placed.current.context, context)) placed.current = { context, by: new Map() };\n        let byDuties = placed.current.by.get(at.getTime());\n        if (byDuties === undefined) { byDuties = new WeakMap(); placed.current.by.set(at.getTime(), byDuties); }\n        let got = byDuties.get(duties);\n        if (got === undefined) { got = placeStored(domain, duties, at, context); byDuties.set(duties, got); }\n        return got;\n    }, [domain, context]);\n    const holds = useCallback((duties: ReadonlyMap<string, StoredDuty>) => place(duties, span.start).assignments.size > 0, [place, span.start]);\n    const [data, setData] = useState<RosterData>(() => initialRosterData(span));\n    const current = data.ready && compareDate(data.start, span.start) === 0 && data.weeks.length === span.weeks.length;\n    // What the board draws stands while its records are read again — after a Save, or another session's: a gesture finds\n    // the row it changes there, so it is taken at once (a Save never stops the editing).\n    useRosterStanding(editing, current ? data : undefined);\n    const periodDrafts = editing?.periods ?? NO_PERIOD_DRAFTS;\n    const dutyDrafts = editing?.duties ?? NO_DUTY_DRAFTS, targetDrafts = editing?.targets ?? NO_TARGET_DRAFTS;\n    // Each week of the span, assembled from the span's rows with its drafts in place (#1406): one for a week in view, a\n    // month's four to six — what the month's cells draw, and what a pattern dropped on one of them applies to. Its periods\n    // are the week, or its seven days where the periods are days (#1550), each its row as stored and as drafted.\n    const days = byDay(source);\n    const weekStates = useMemo((): WeekState[] => span.weeks.map(at => {\n        const stored = place(current ? data.duties : NO_STORED, at);\n        const drafted = placeDrafted(domain, stored, dutyDrafts, at, context);\n        const heldTargets = placeTargets(current ? data.targets : NO_STORED_TARGETS, NO_TARGET_DRAFTS, at, source);\n        const targets = placeTargets(current ? data.targets : NO_STORED_TARGETS, targetDrafts, at, source);\n        const periods = weekPeriods(at, days, from => {\n            const id = weekKey(from);\n            const held = periodOf(source, current ? data.periods.get(from) : undefined);\n            return { held, period: periodDrafts.has(id) ? periodOf(source, periodDrafts.get(id)) : held };\n        });\n        return { start: at, week: weekOf(drafted, targets, periods.map(p => p.period)), held: weekOf(stored, heldTargets, periods.map(p => p.held)),\n            duties: drafted, heldDuties: stored, targets, periods };\n    }), [span.weeks, current, data.duties, data.targets, data.periods, place, domain, dutyDrafts, targetDrafts, periodDrafts, context, source, days]);\n    const [selection, setSelection] = useState<Selection>();\n    // The week the inspector, the commands and the checks work over: the selected person-week's in a month (D11), or the\n    // week of the work requirement's day selected there (#1568), else the selected duty's — as drafted, else as stored: a\n    // day pressed in a person's Details, in a Month with no Week, selects a duty of any of its weeks — else the span's first.\n    const pickedStart = selectionWeek(selection);\n    const pickedDuty = selection?.type === \"assignment\" ? selection.key : undefined;\n    const primary = (pickedStart !== undefined ? weekStates.find(held => held.start.getTime() === pickedStart)\n        : pickedDuty === undefined ? undefined\n            : weekStates.find(held => held.week.assignments.has(pickedDuty)) ?? weekStates.find(held => held.held.assignments.has(pickedDuty))) ?? weekStates[0]!;\n    const { start, week, held, duties: draftedDuties, heldDuties: storedDuties, targets, periods } = primary;\n    // The day in view publishes alone where the periods are days, in Shifts' Day (#1550): the periods its status, its\n    // banner and Publish speak of — else every period of the week.\n    const dayInView = days && window.view.layout === \"shifts\" && window.view.period === \"day\";\n    const viewed = useMemo((): readonly WeekPeriod[] => {\n        const day = dayInView ? periodOn(periods, window.day) : undefined;\n        return day === undefined ? periods : [day];\n    }, [dayInView, periods, window.day]);\n    const previous = useMemo(() => current && data.previous !== undefined ? place(data.previous, weekBefore(start)) : undefined, [current, data.previous, place, start]);\n    const [tab, setTab] = useState(\"details\");\n    const [libraryTab, setLibraryTab] = useState<string>();\n    // A Find fix's question: its need on its issue's slot, which the People tab shows the app's fit's answer to (#1334).\n    const [find, setFind] = useState<RosterFind>();\n    const [error, setError] = useState<string>();\n    const root = useRef<HTMLDivElement>(null), main = useRef<HTMLDivElement>(null);\n    // The frame's panes, as the Roster's own controls open them: a selection's Details, the issues chip's Issues, a Find fix's People.\n    const panes = useRef<BuilderFramePanes>(null);\n    const narrow = useContainerBelow(main, NARROW_WIDTH);\n    const { onNarrow } = props;\n    useLayoutEffect(() => { onNarrow(narrow); }, [narrow, onNarrow]);\n    // The week a selection was made in (#1406, P12, P24): a span that still holds it — Week opened from the month's\n    // cell, column or Details — keeps the selection; another clears it, as another week does.\n    const startRef = useRef(start); startRef.current = start;\n    const selectedIn = useRef<Date>(start);\n    const choose = useCallback((next: Selection | undefined) => {\n        const named = selectionWeek(next);\n        selectedIn.current = named !== undefined ? new Date(named) : startRef.current;\n        setSelection(next); setTab(\"details\");\n    }, []);\n    const select = useCallback((next: Selection | undefined) => { choose(next); if (next !== undefined) panes.current?.reveal(\"end\"); }, [choose]);\n    // A press whose whole purpose is to look at what it selects — a phone's lane line — opens the inspector's view, where\n    // a tap that selects leaves main in view (the strip's tab saying what is selected).\n    const inspect = useCallback((next: Selection) => { choose(next); panes.current?.open(\"end\"); }, [choose]);\n    const spanKey = `${span.start.getTime()}:${span.weeks.length}`;\n    const lastSpan = useRef(spanKey);\n    // Another span: its own selection, and no find — a find is its issue's, in the week it was asked of.\n    useEffect(() => {\n        if (lastSpan.current === spanKey) return;\n        lastSpan.current = spanKey;\n        if (!span.weeks.some(week => compareDate(week, selectedIn.current) === 0)) { setSelection(undefined); setError(undefined); setFind(undefined); }\n    }, [spanKey, span]);\n    const recipe = useSlotRecipe({ key: \"rosterBuilder\" });\n    const styles = useMemo(() => recipe({}) as unknown as RosterStyles, [recipe]);\n    // The Roster's words: its message table — the editing session's, and what its line says of a person the rail hides.\n    const format = useFormatters(), words = useMemo((): RosterWords => ({ ...format, m: rosterMessages }), [format]);\n    // The app's pay, a person at a time (§5.6, B17): asked again only for the people a change touched.\n    const payCache = useRef(new RosterPayCache());\n    const weekPay = useMemo(() => source.pay.type === \"some\" ? payCache.current.run(domain, source.pay.value, week, start, context) : NO_PAY, [source.pay, domain, week, start, context]);\n    const coverage = useMemo(() => domain.coverage(week, context, weekPay.pay), [domain, week, context, weekPay]);\n    // What the People layout's work requirement sums (#1568): a week's coverage, or each of a month's weeks' — their hours\n    // alone, so no week but the one the inspector reads asks the app's pay — while the month draws it, each week's worked\n    // out again only as that week moves.\n    const demanded = value.settings.requirements && value.targets.type === \"some\";\n    const spanCache = useRef(new RosterSpanCoverage());\n    const spanCoverage = useMemo((): readonly ReadonlyMap<Slot, Coverage>[] => span.period !== \"month\" ? [coverage]\n        : demanded ? spanCache.current.run(domain, context, weekStates, { start, coverage }) : NO_SPAN_COVERAGE, [span.period, coverage, demanded, weekStates, domain, context, start]);\n    const hours = useMemo(() => domain.hours(week, context), [domain, week, context]);\n    const builtIn = useMemo(() => domain.check(week, context), [domain, week, context]);\n    // Each duty's row checked against its form's bounds (#1585), once a row's bytes: a duty breaking one wears the warn\n    // ring, stored or changed, and a stored duty's breach is a warning among the week's issues, holding no Save — a\n    // changed duty's is the refusal its session's readiness raises, which holds Save.\n    const dutyKind = source.duty.kind.key, dutyFields = source.duty.kind.fields;\n    const breachesOf = useMemo(() => rowBreaches(dutyFields, domain.rowType), [dutyFields, domain]);\n    const boundedDuties = useMemo(() => {\n        const out = new Set<string>();\n        for (const held of weekStates) for (const [id, row] of held.duties.rows) if (breachesOf(row.bytes).length > 0) out.add(id);\n        return out;\n    }, [weekStates, breachesOf]);\n    const bounded = useCallback((id: string) => boundedDuties.has(id), [boundedDuties]);\n    const refused = scheduleRefusals(editing?.schedule.sessions ?? []);\n    const storedBreaches = useDataStable([...draftedDuties.rows].flatMap(([id, row]): Issue[] => {\n        const a = week.assignments.get(id);\n        if (a === undefined) return [];\n        // A duty in no group yet stands in no slot, and names its shift alone (#1548).\n        const slot = slotOfPlace(a.place);\n        const shift = value.shifts.find(s => keyEqual(s.key, a.place.shift))?.label ?? a.place.shift;\n        return breachesOf(row.bytes).flatMap((breach): Issue[] => refused.some(({ kind, issue }) => keyEqual(kind, dutyKind) && keyEqual(issue.entry, id)\n            && issue.field.type === \"some\" && keyEqual(issue.field.value, breach.key)) ? [] : [{\n            kind: variant(\"breach\", null), tone: variant(\"warning\", null),\n            title: `${assignmentName(value, a)} · ${refusalText(fieldBreachIssue(breach, { entry: id }), dutyFields)}`,\n            detail: slot === undefined ? shift : `${value.groups.find(g => keyEqual(g.key, slot.group))?.label ?? slot.group} · ${shift}`,\n            slot: slot === undefined ? none : some(slot), assignment: some(id), flag: none, fix: none,\n        }]);\n    }), sameIssues);\n    const proposals = useMemo(() => availableProposals(value, week, start, periods), [value, week, start, periods]);\n    // The app's check over the complete draft, given the pay (§5.8) — and, over a reference record (#1551), the week's\n    // rows of it, read with the week: a week whose rows are not read yet is checked once they are.\n    const referenceType = source.reference.type === \"some\" ? source.reference.value.rowType : undefined;\n    const encodeReference = useMemo(() => referenceType === undefined ? undefined : rosterReferenceCheckEncoder(source.duty.rowType, referenceType),\n        [source.duty.rowType, referenceType]);\n    const referenceRows = current ? data.references.get(start) : undefined;\n    const readCheck = useCallback(() => {\n        if (source.check.type !== \"some\") return [];\n        if (encodeReference === undefined) return source.check.value(domain.encodeCheckContext({ start, week, context, coverage, pay: weekPay.pay }));\n        return referenceRows === undefined ? [] : source.check.value(encodeReference({ start, week, context, coverage, pay: weekPay.pay, reference: referenceRows.rows }));\n    }, [source.check, domain, encodeReference, referenceRows, start, week, context, coverage, weekPay]);\n    const custom = useTrackedEvaluation(readCheck);\n    // The week's issues, the same array while what they say holds: what the grid draws from them draws again only as\n    // they change (#1398, CL9).\n    const customIssues = custom.result.ok ? custom.result.value : NO_ISSUES;\n    const allIssues: readonly Issue[] = useMemo(() => [...builtIn, ...storedBreaches, ...draftedDuties.unplaced, ...customIssues, ...proposals.map(p => ({ kind: variant(\"proposal\", null), tone: variant(\"info\", null),\n        title: `${personOf(value, p.person)?.name ?? p.person} · proposed`, detail: p.reason, slot: some(p.slot), assignment: none, flag: none, fix: some(variant(\"accept\", p.key)) }))],\n        [builtIn, storedBreaches, draftedDuties.unplaced, customIssues, proposals, value]);\n    // A week not read gives no issue: a gap of a week whose duties are not read yet is no gap (#1398, CL13).\n    const { layout, period: viewPeriod } = window.view;\n    const issues = useMemo(() => current ? allIssues.filter(i => layout === \"people\" || viewPeriod === \"week\" || i.slot.type === \"none\" || Number(i.slot.value.day) === window.day) : NO_ISSUES,\n        [current, allIssues, layout, viewPeriod, window.day]);\n    // The app's fit (#1334): a Find fix asks it who fits over the complete staff, and the People tab shows its answer.\n    const fit = useRosterFit(value, start, week, context, coverage, find);\n    const { error: fitError, retry: retryFit, pending: finding } = fit;\n    const findFix = useCallback((next: RosterFind) => {\n        setFind(next); setLibraryTab(\"people\"); panes.current?.open(\"start\");\n        // Pressed again after the fit failed, a find is asked again.\n        if (fitError !== undefined) retryFit();\n    }, [fitError, retryFit]);\n    const isFinding = useCallback((asked: RosterFind) => finding && find !== undefined && sameFind(find, asked), [finding, find]);\n    // Publish (B7): Save, then once every record reads back as saved, each period's status — over its row as last saved:\n    // the week's, or by the day the day in view's in Shifts' Day, else each day of the week that takes edits, as one\n    // request (#1550). The periods are those shown as Publish is pressed: a day or a week stepped to while the Save\n    // settles is not the one published.\n    const unit = dayInView ? \"day\" : \"week\";\n    const [publishing, setPublishing] = useState(false);\n    const publishingNow = useRef(false);\n    const latest = useRef<readonly WeekPeriod[]>(viewed);\n    latest.current = viewed;\n    const publish = useCallback(() => {\n        if (editing === undefined || publishingNow.current) return;\n        publishingNow.current = true; setPublishing(true);\n        // The periods in view as Publish is pressed: a step to another day or week while its Save is out publishes no other.\n        // Each one's status is written over its row as the Save left it, whatever was read of it at the press.\n        const chosen = latest.current;\n        void publishPeriod(editing.history, () => publishChanges(source, chosen, new Date()), changes => editing.schedule.record(changes, \"typed\", `Publish ${unit}`))\n            .finally(() => { publishingNow.current = false; setPublishing(false); });\n    }, [editing, unit, source]);\n    // A narrowing read while the week it filters stands in keeps the week's rows, stale (#1398, CL5): their words in the\n    // third ink, their rules dashed. While the people's narrowing is read or failed, or the week stands in, its rows are\n    // retained (CL8): readable, focusable and selectable, aria-disabled, and every editing gesture — a drag, a drop, an\n    // action — off until it lands.\n    const stale = current && (visibility.loading || activities.loading);\n    const retained = stale || visibility.loading || visibility.error !== undefined;\n    // Commands update the selected item without changing the user's pane/tab.\n    // Only an explicit inspection click uses `select` to reveal Details. The same commands while the week, its reads and\n    // its editing hold (#1398, CL9); while main is retained they refuse every gesture, its controls kept in place.\n    const ready = current && !publishing && !visibility.loading && visibility.error === undefined;\n    const unlocked = useMemo(() => rosterCommands({\n        value, start, context, week, held, duties: draftedDuties, heldDuties: storedDuties, previous, targets, periods, publishes: viewed, weeks: weekStates,\n        editing, ready, retained,\n    }, setSelection, findFix, publish), [value, start, context, week, held, draftedDuties, storedDuties, previous, targets, periods, viewed, weekStates, editing, ready, retained,\n        findFix, publish]);\n    // The app's optimiser (#1409, #1421): one run over the week in view, its result landed on the week's duties as one\n    // edit, and what it left on them until Apply — the landing and the highlight over the whole frame.\n    const landing = useLanding(root);\n    const landingStyles = useLandingStyles();\n    // An optimiser that takes the week's edges (#1553): the payload says which form its function takes.\n    const edgesForm = source.optimise.type === \"some\" && source.optimise.value.edges;\n    const optimiseTypes = useMemo(() => rosterOptimiseTypes(domain.rowType, edgesForm), [domain, edgesForm]);\n    // Where a row would stand for a run with the week's edges (#1553): the week, its periods as the frame holds them, and\n    // the weeks either side, theirs as the reader read them — each with its drafts in place; none until they are read.\n    const neighbours = data.neighbours;\n    const reach = useMemo((): RosterReach | undefined => {\n        if (!edgesForm || !current || neighbours === undefined || compareDate(neighbours.start, start) !== 0) return undefined;\n        const periodsAt = (at: Date) => weekPeriods(at, days, from => {\n            const id = weekKey(from);\n            const held = periodOf(source, neighbours.periods.get(from));\n            return { held, period: periodDrafts.has(id) ? periodOf(source, periodDrafts.get(id)) : held };\n        });\n        const before = weekBefore(start), after = weekSpan(start).to;\n        const weeks = [{ at: start, held: periods }, { at: before, held: periodsAt(before) }, { at: after, held: periodsAt(after) }];\n        return (row, id) => {\n            const roles = source.duty.read(domain.encodeRow(row), id);\n            for (const { at, held } of weeks) {\n                const placed = domain.placement(roles, row, id, at, context);\n                if (placed.type === \"elsewhere\") continue;\n                // A row the Roster cannot place is its week's issue: taken while every period of the week takes edits.\n                if (placed.type === \"unplaced\") return { type: \"unplaced\", start: at, at: roles.start, open: held.every(takesEdits) };\n                const period = periodOn(held, placed.value.place.day);\n                return { type: \"placed\", start: at, assignment: placed.value, open: period !== undefined && takesEdits(period) };\n            }\n            return { type: \"beyond\", at: roles.start };\n        };\n    }, [edgesForm, current, neighbours, start, periods, days, source, periodDrafts, domain, context]);\n    const [optimised, setOptimised] = useState<RosterOptimised | undefined>(undefined);\n    const landAfter = useRef<(run: number) => void>(() => undefined);\n    const latestRun = useRef({ week, start, context, editing, optimised, reach, stored: current ? data.duties : NO_STORED, drafts: dutyDrafts });\n    latestRun.current = { week, start, context, editing, optimised, reach, stored: current ? data.duties : NO_STORED, drafts: dutyDrafts };\n    // The duties at the week's edges a run asked (#1553), by its number: what its landing diffs and refuses by.\n    const askedEdges = useRef<{ run: number; edges: RosterEdges } | undefined>(undefined);\n    // The week, as the eye, the footer line and the banner name it (#1409): `W11`.\n    const weekLabel = `W${format.number(weekNumber(start))}`;\n    const run = useOptimise<RosterOptimiseRequest, RosterOptimiseResult>({\n        name: source.optimise.type === \"some\" ? source.optimise.value.binding.name : null,\n        requestType: optimiseTypes.request, resultType: optimiseTypes.result, scope: weekKey(start), storageKey: key,\n        onLanded: (result, request, n) => {\n            const now = latestRun.current;\n            if (now.editing === undefined) return undefined;\n            const asked = askedEdges.current?.run === n ? askedEdges.current.edges : undefined;\n            // A run with the edges lands with them, as the periods stand now; one whose edges are not at hand is not used.\n            if (edgesForm && (asked === undefined || now.reach === undefined)) return undefined;\n            const runText = format.number(n);\n            const landed = landRosterOptimise({ value, domain, editing: now.editing, request, result, label: optimiseMessages.step({ run: runText }), runText,\n                week: now.week, start: now.start, context: now.context, format, before: now.optimised,\n                edges: asked === undefined || now.reach === undefined ? undefined : { asked, reach: now.reach, days, m: rosterMessages } });\n            if (landed === undefined || \"refused\" in landed) return landed;\n            // A run that changed nothing leaves what earlier runs left (R10).\n            if (landed.optimised !== undefined) { setOptimised(landed.optimised); landAfter.current(n); }\n            return landed.counts;\n        },\n    });\n    // While a run is out (R2) the week takes no gesture: every command refused with the one reason, the drags off, the history locked.\n    const locked = run.running;\n    const commands = useMemo(() => locked ? lockRosterCommands(unlocked, optimiseMessages.locked({ period: weekLabel })) : unlocked, [locked, unlocked, weekLabel]);\n    // The eye is listed only where the week can be optimised (ruled 25 Oct 2026): never read only, never in Month —\n    // a run is one week's — and never over a published week, nor over a week holding a published day where the periods\n    // are days (#1550): a run plans the whole week, and a published day takes no change; while the week's reads are in\n    // flight it waits, disabled — for an optimiser that takes the week's edges, the weeks either side's periods too (#1553).\n    const optimiseParts = useOptimiseParts<RosterOptimiseRequest>({\n        run, landing, period: weekLabel,\n        readOnly: value.settings.readOnly || editing === undefined || span.period === \"month\" || (current && !periods.every(takesEdits)),\n        busy: !unlocked.available || (edgesForm && reach === undefined),\n        request: n => {\n            const now = latestRun.current;\n            // The duties at the week's edges as the session holds them now, for an optimiser that takes them (#1553).\n            const edges = now.reach === undefined ? undefined\n                : rosterEdges({ domain, stored: now.stored, drafts: now.drafts, start: now.start, context: now.context, reach: now.reach });\n            askedEdges.current = edges === undefined ? undefined : { run: n, edges };\n            return rosterOptimiseRequest(now.start, now.week, now.context, n, edges);\n        }, landKey: week,\n    });\n    landAfter.current = optimiseParts.landAfter;\n    // What a run left on the duties goes with the drafts (R17): once nothing is pending — Save, Discard — nothing is\n    // marked. An Undo leaves nothing pending too, but its Redo brings the run's step back (R9): what the run left is\n    // kept while that step is the next to redo.\n    const pendingSteps = editing?.history.pending ?? 0;\n    useEffect(() => {\n        if (pendingSteps === 0 && editing?.history.redoOrigin !== \"optimise\") setOptimised(undefined);\n    }, [pendingSteps, editing?.schedule.version, editing]);\n    const drag = useRosterDrag({ value, commands, week, duties: draftedDuties, weeks: weekStates, context, storageKey: key, narrow, start, format, onError: setError });\n    // The groups' folds, the board's and the People layout's: what a conflict's Go to opens.\n    const groups = useGroupCollapse(drag.surface);\n    const dutyPart = sourcePart(source.slice.type === \"some\" ? source.slice.value : undefined, source.duty.kind.key);\n    // What the footer's loading line says (#1398, CL3): the week being read, the people's or the activities' new\n    // narrowing, or why one could not be read, with Retry — the week's asking again each record the week reads.\n    const retryWeek = useCallback(() => retryPeriod([{ entries: source.duty.kind.entries, part: dutyPart },\n        ...(source.periods.type === \"some\" ? [{ entries: source.periods.value.entries }] : []),\n        ...(source.targets.type === \"some\" ? [{ entries: source.targets.value.entries, part: sourcePart(source.slice.type === \"some\" ? source.slice.value : undefined, \"targets\") }] : []),\n        // The reference record the check reads (#1551), through its source of the slice.\n        ...(source.reference.type === \"some\" ? [{ entries: none, part: sourcePart(source.slice.type === \"some\" ? source.slice.value : undefined, SCHEDULE_REFERENCE) }] : [])]),\n        [source, dutyPart]);\n    // The span's words (#1406, P28): `12–18 Mar` for a week, `W10–W14` for a month.\n    const weekWords = spanWords(format, span);\n    // The periods of the weeks either side, read for an optimiser that takes the week's edges (#1553): a failure is said\n    // after the week's and the sources', its Retry asking the periods again; the eye waits on them meanwhile.\n    const neighboursError = data.neighboursError;\n    const retryNeighbours = useCallback(() => retryPeriod(source.periods.type === \"some\" ? [{ entries: source.periods.value.entries }] : []), [source]);\n    const line = useMemo(() => periodLoadingLine(periodLoading({ loading: data.loading, error: data.error, retry: retryWeek },\n        [{ noun: \"people\", ...visibility }, { noun: \"activities\", ...activities }, { noun: \"patterns\", ...props.patterns },\n            ...(neighboursError === undefined ? [] : [{ noun: \"the weeks either side\", ready: true, loading: false, error: neighboursError, retry: retryNeighbours }])]), weekWords),\n        [data.loading, data.error, retryWeek, visibility, activities, props.patterns, weekWords, neighboursError, retryNeighbours]);\n    // What the views draw of the week (#1398): the week as read; a week not read yet, its geometry at once and its\n    // placeholders, unseen until the frame's one reveal clock says so (CL5, CL2, CL4: `LoadingReveal` below, which the\n    // footer's line and each placeholder read where they show, so its flip renders them and never this frame); or one\n    // whose read failed, its geometry and the failure said once in its first row in view (CL11) — never \"Roster\n    // unavailable\" over the grid.\n    const read = useMemo(() => periodRead({ current, error: data.error, name: weekWords, retry: retryWeek }), [current, data.error, weekWords, retryWeek]);\n    // Where the People views rest (#1398): saved under the Roster's key, so each comes back to it as it mounts.\n    const { state: anchor, setState: setAnchor } = usePersistedState<RosterAnchor>(`${key}.anchor`, NO_ANCHOR, readRosterAnchor);\n    const onAnchor = useCallback((next: Partial<RosterAnchor>) => setAnchor(was => ({ ...was, ...next })), [setAnchor]);\n    // A duty holding a conflict not yet chosen wears the warn ring: asked again as the history moves, which every choice\n    // and every carry-over moves.\n    const schedule = editing?.schedule;\n    const scheduleVersion = schedule?.version;\n    const conflicted = useCallback((id: string) => schedule?.conflicted(dutyKind, id) === true,\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version says they moved\n        [schedule, scheduleVersion, dutyKind]);\n    const viewProps = { value, week, held, start, day: window.day, view: window.view, setView: window.setView, span, weeks: weekStates, openWeek: window.openWeek, opensDay: window.opensDay, opensWeek: window.opensWeek,\n        styles, format, narrow, coverage, spanCoverage, hours, pay: weekPay.pay, domain, issues, proposals, selection, select, inspect, commands, drag, onError: setError, read, optimised,\n        lit: landing.lit, conflicted, bounded };\n    // Search Records (#1398): a person found by their key is selected — in the People layout their row brought into view\n    // once the narrowing draws it, and a pick's person given the keyboard there, once the box has let it go: their name\n    // takes the focus as ↑ / ↓ give it. One the rail's narrowing hides is shown by clearing just the choices of the\n    // people's source that hide them, and given the keyboard once the narrowing they leave holds them (the shared hidden\n    // pick).\n    const [picked, setPicked] = useState<PeoplePick>();\n    const shownPeople = value.visiblePeople;\n    const pick = useHiddenPick<string>({\n        onError: setError, uncleared: \"The filters hiding the person could not be cleared\",\n        landing: {\n            drawn: (key) => !visibility.loading && (shownPeople.type === \"none\" || shownPeople.value.has(key)),\n            focus: (key) => setPicked(was => ({ key, seq: (was?.seq ?? 0) + 1 })),\n        },\n    });\n    const peopleHidden = useSourceHidden(\"Roster\", useMemo(() => rosterPart(source, \"people\"), [source]));\n    const found = useRosterFind({ people: value.people, visible: value.visiblePeople, settled: !visibility.loading, groups: value.groups,\n        hidden: peopleHidden, words, onPick: (person: FoundPerson) => {\n            pick.pick(person.hidden, person.person.key, () => { select({ type: \"person\", key: person.person.key }); });\n        } });\n    const search = useMemo(() => (found === undefined ? undefined : pick.search(found)), [found, pick]);\n    const library = useRosterLibrary({ ...viewProps, storageKey: key, tab: libraryTab, onTab: setLibraryTab,\n        find: find === undefined ? undefined : { need: find.need, shown: fit.shown, busy: finding }, onClearFind: () => setFind(undefined), shown: props.shown });\n    const onIssues = () => { setTab(\"issues\"); panes.current?.open(\"end\"); };\n    const history = editing?.history;\n    const { acted } = optimiseParts;\n    // The history's acts: a field typed into lets go first, committing what it holds — the history's buttons take no\n    // focus from it. Anything else keeps the focus, the board or a duty on it, so the next key — a Redo after an Undo —\n    // reaches the frame too, never the page.\n    const onAction = useCallback((action: HistoryAction) => {\n        if (locked) return;\n        const active = document.activeElement; if (active instanceof HTMLElement && typedInto(active)) active.blur();\n        // A run's highlight ends with Undo, Apply and Discard; a Redo of its step replays its landing (R9, R16).\n        acted(action, history?.redoOrigin);\n        history?.act(action);\n    }, [history, locked, acted]);\n    // The keyboard stays on the board as what it was on goes, as the Calendar's does: Delete on the duty or the proposal the\n    // focus is on — its chip, its tile, its card — and the board takes the focus, never the page's body, where the history's\n    // keys, the Undo that brings it back, go unheard. A saved duty stays, its tombstone, and the focus with it.\n    const keepOnBoard = (kind: \"assignment\" | \"proposal\", key: string) => {\n        if (kind === \"assignment\" && held.assignments.has(key)) return;\n        const board = main.current;\n        const active = board?.ownerDocument.activeElement;\n        if (board === null || !(active instanceof HTMLElement) || !board.contains(active)) return;\n        const attribute = kind === \"assignment\" ? \"data-roster-assignment\" : \"data-roster-proposal\";\n        const on = active.closest(`[${attribute}]`)?.getAttribute(attribute);\n        if (on !== null && on !== undefined && keyEqual(on, key)) board.focus({ preventScroll: true });\n    };\n    // A duty of a week not in view, as its draft holds it — its draft removing it, as their save left it — placed in its\n    // own week: what a conflict's card names it by, and where its Go to goes. Its start stands up to twelve hours from its\n    // shift's on a day of its week, so the week either side of it may hold it.\n    const sunday = value.settings.weekStart.type === \"sunday\";\n    const elsewhere = (key: string): { readonly start: Date; readonly a: Assignment } | undefined => {\n        let duty = dutyDrafts.get(key);\n        if (duty === undefined) {\n            const theirs = editing?.schedule.sessions.find((held) => held.kind === source.duty.kind.key)?.session.conflicts.get(key)?.source;\n            const row = theirs?.type === \"some\" && isVariant(theirs.value) && theirs.value.type === \"value\" ? theirs.value.value : undefined;\n            if (row === undefined) return undefined;\n            const bytes = domain.encodeRow(row);\n            duty = { bytes, roles: source.duty.read(bytes, key), row };\n        }\n        for (const at of [duty.roles.start.getTime() - DAY / 2, duty.roles.start.getTime() + DAY / 2]) {\n            const from = weekStart(new Date(at), sunday);\n            const placement = domain.placement(duty.roles, duty.row, key, from, context);\n            if (placement.type === \"placed\") return { start: from, a: placement.value };\n        }\n        return undefined;\n    };\n    /** A session's issue's place: a duty by whose it is, a week's or a target's row as it stands. */\n    const where = (kind: string) => (issue: { entry: string }) => {\n        const found = dutyOf(kind, issue.entry);\n        return found === undefined ? issue.entry : assignmentName(value, found.a);\n    };\n    // A conflict's item in the history bar's popover, named as its session's banners name its issues.\n    const historyWhere = (issue: EditIssue) => {\n        const key = history?.sourceOf(issue);\n        const part = key === undefined ? undefined : editing?.schedule.sessions.find((held) => keyEqual(held.key, key));\n        return part === undefined ? issue.entry : where(part.kind)(issue);\n    };\n    // A Go to into another week: its duty, selected once that week's duties are read — another week clears a selection.\n    // The reader moving to a span without its week drops it.\n    const [going, setGoing] = useState<{ readonly key: string; readonly week: Date }>();\n    useEffect(() => {\n        if (going === undefined) return;\n        if (!span.weeks.some((at) => compareDate(at, going.week) === 0)) { setGoing(undefined); return; }\n        if (!current) return;\n        setGoing(undefined);\n        select({ type: \"assignment\", key: going.key });\n    }, [going, span, current, select]);\n    /**\n     * A duty of a session's, where its draft places it: in the week in view, else in its own week (`there`) — a duty its\n     * draft moved out of the week is named, and gone to, where it now stands. One its draft removes, or holds where the\n     * Roster can't place it, is where the record holds it. `undefined` for none of these.\n     */\n    const dutyOf = (kind: string | undefined, entry: string): { readonly a: Assignment; readonly there: ReturnType<typeof elsewhere> } | undefined => {\n        if (kind === undefined || !keyEqual(kind, dutyKind)) return undefined;\n        const here = week.assignments.get(entry);\n        if (here !== undefined) return { a: here, there: undefined };\n        const moved = dutyDrafts.get(entry) === undefined ? undefined : elsewhere(entry);\n        if (moved !== undefined) return { a: moved.a, there: moved };\n        const stored = held.assignments.get(entry);\n        if (stored !== undefined) return { a: stored, there: undefined };\n        const there = elsewhere(entry);\n        return there === undefined ? undefined : { a: there.a, there };\n    };\n    // The field a refusal gone to names, asked of its duty's form: ringed there, it takes the keyboard as the form draws\n    // it, and so comes into view (`../shared/schedule/field-ask.tsx`).\n    const fieldAsks = useFieldAsks();\n    // A duty shown on its day and selected, as its issue's click in the Issues tab does — in its own week, where it is a\n    // duty of another: a conflict's Go to, a refusal pressed, and the warning button's first issue (#1525), whose field\n    // (`field`) its form gives the keyboard. In Month, which draws no one duty, its week in Week (P24), the duty selected\n    // once that week is read; with Week not offered the month holding its week stays, and its person's week is selected.\n    // A week's or a target's, a duty the Roster can't place, or a request's in a Month with no Week, opens the Issues tab.\n    const goTo = (kind: string | undefined, entry: string, field: option<string> = none) => {\n        const found = dutyOf(kind, entry);\n        if (found === undefined) { onIssues(); return; }\n        const { a, there } = found;\n        const at = there?.start ?? start;\n        const date = at.getTime() + Number(a.place.day) * DAY;\n        // Its group opened where it is folded: its shift's on the board — No group's band for a duty in none (#1548) — its\n        // person's in the People layout.\n        groups.open(groupOf(a) ?? NO_GROUP);\n        const person = a.who.type === \"person\" ? value.people.find((p) => keyEqual(p.key, a.who.value)) : undefined;\n        if (person !== undefined) groups.open(person.group);\n        const month = window.view.period === \"month\";\n        if (month && !window.opensWeek) {\n            if (person === undefined) { onIssues(); return; }\n            // Its day moves the month only to bring its week into view: a day of a week that starts in the month before would move it.\n            if (!span.weeks.some((week) => compareDate(week, at) === 0)) window.setView({ ...window.view, date });\n            select({ type: \"personWeek\", key: person.key, start: at.getTime() });\n            return;\n        }\n        window.setView({ ...window.view, period: month ? \"week\" : window.view.period, date });\n        fieldAsks.request(dutyKind, entry, field);\n        if (there === undefined && !month) select({ type: \"assignment\", key: entry });\n        else setGoing({ key: entry, week: at });\n    };\n    const onConflict = (issue: EditIssue) => {\n        const key = history?.sourceOf(issue);\n        goTo(key === undefined ? undefined : editing?.schedule.sessions.find((held) => keyEqual(held.key, key))?.kind, issue.entry);\n    };\n    const onIssue = (issue: EditIssue) => {\n        const key = history?.sourceOf(issue);\n        goTo(key === undefined ? undefined : editing?.schedule.sessions.find((held) => keyEqual(held.key, key))?.kind, issue.entry, issue.field);\n    };\n    // Each refusal holding Save, of every week's drafts, in the Roster's words (#1525): a duty by its person, day and shift,\n    // or by its key for one the Roster can't place, and its field by its form's label.\n    const refusals = refused.map(({ kind, issue }): RosterRefusal => {\n        const found = dutyOf(kind, issue.entry);\n        const shift = found === undefined ? undefined : value.shifts.find((s) => keyEqual(s.key, found.a.place.shift));\n        return { kind, issue,\n            title: found === undefined ? issue.entry\n                : `${assignmentName(value, found.a)} · ${format.weekdayDate(dayOfSlot(found.there?.start ?? start, found.a.place))} · ${shift?.label ?? found.a.place.shift}`,\n            text: refusalText(issue, keyEqual(kind, dutyKind) ? dutyFields : []) };\n    });\n    const inspector = useRosterInspector({ ...viewProps, storageKey: key, tab, onTab: setTab, find: { offered: fit.offered, finding: isFinding },\n        duties: draftedDuties, heldDuties: storedDuties, targets, refusals, onRefusal: refusal => goTo(refusal.kind, refusal.issue.entry, refusal.issue.field) });\n    const toolbar = useRosterToolbar({ ...window, value, styles, commands, editing, words, issues, refused: refusals.length, onIssues, onIssue, onConflict,\n        where: historyWhere, onAction, onPickerDates: setPickerDates, narrow,\n        optimise: optimiseParts.toolbarItem, optimiseEntry: optimiseParts.entry, locked, issuesFlash: landing.lit && optimised !== undefined,\n        selectedWeek: pickedStart === undefined ? undefined : new Date(pickedStart),\n        status: source.periods.type === \"some\" ? periodsText(viewed.map(p => p.held)) : undefined, unread: !current, publishing, publishUnit: unit, picker: data.picker,\n        onDisplay: next => props.setDisplay({ ...props.display, ...next }), search });\n    // Read only while no week in view can be edited: the week's status, or every week of the month's (#1406) — where the\n    // periods are days, every day's (#1550).\n    const readOnly = value.settings.readOnly || (current && weekStates.every(state => state.periods.every(p => !editableStatus(p.held.status))));\n    // A week not started, said of the week in view: a month shows its weeks as they are.\n    const notStarted = current && span.period !== \"month\" && week.assignments.size === 0 && (source.periods.type === \"none\" || periods.every(p => !started(p.period)));\n    // The periods in view that take no edits, under their banner (#1550).\n    const closed = current ? closedBanner(viewed, unit, format) : undefined;\n    const dutyName = source.duty.kind.name.toLocaleLowerCase(format.locale);\n    const sessionName = (kind: string) => kind === PERIODS ? (source.periods.type === \"some\" && source.periods.value.every.type === \"day\" ? \"Days\" : \"Weeks\")\n        : kind === TARGETS ? \"Targets\" : source.duty.kind.name;\n    // Cold load (#1398, CL5): no week read yet, nor the people's or the activities' first narrowing — the frame's\n    // skeleton covers it. After it nothing covers: a week step, a narrowing or a new revision leave the frame live.\n    const cold = (!data.landed && data.error === undefined) || (!visibility.ready && visibility.loading) || (!activities.ready && activities.loading) || (!props.patterns.ready && props.patterns.loading);\n    // After cold load a read in flight — the span, the people's, the activities' or the patterns' narrowing — leaves the frame live, main busy.\n    const busy = data.loading || visibility.loading || activities.loading || props.patterns.loading;\n    // The skeleton's rows at the layout's own pitch (#1398, CL5): the People rows' — 36px, 32px compact — in Week and Month\n    // alike; the Shifts grid's rows grow with their chips, and a phone's cards with their days, so those take the frame's own.\n    const loadingPitch = window.view.layout === \"people\" && !narrow ? (props.display.density === \"compact\" ? 32 : 36) : undefined;\n    return <FieldAskProvider value={fieldAsks.asks}><Box ref={root} css={[styles.root, landingStyles.main]} data-roster-frame=\"\" data-roster-readonly={readOnly ? \"\" : undefined} {...landing.attributes}>\n        <RosterDataReader value={source} span={span} pickerDates={pickerDates} holds={holds} onData={setData} />\n        <LoadingReveal waiting={line?.kind === \"loading\"}>\n        <BuilderFrame storageKey={`${key}.frame`} label=\"Roster\" loading={cold} loadingPitch={loadingPitch} busy={busy} liveFooter phonePanel start={library} end={inspector} toolbar={toolbar}\n            panesRef={panes} onKeyDown={event => {\n            // Each key the frame acts on goes no further than the Roster (#1398); Esc with nothing to let go of goes on.\n            if (event.defaultPrevented || typedInto(event.target)) return;\n            const action = historyShortcut(event);\n            if (action !== undefined && history !== undefined && !value.settings.readOnly && !locked && (commands.available || history.pending > 0)) { takeKey(event); onAction(action); }\n            // `[` and `]` step the span's unit: a week, or a month in Month (#1406, P2).\n            else if (event.key === \"[\" || event.key === \"]\") { takeKey(event); window.step(event.key === \"[\" ? -1 : 1); }\n            else if (event.key === \"Escape\" && (selection !== undefined || error !== undefined)) { takeKey(event); setSelection(undefined); setError(undefined); }\n            else if ((event.key === \"Delete\" || event.key === \"Backspace\") && (selection?.type === \"assignment\" || selection?.type === \"proposal\") && commands.available) {\n                takeKey(event);\n                keepOnBoard(selection.type === \"assignment\" ? \"assignment\" : \"proposal\", selection.key);\n                if (selection.type === \"assignment\") commands.remove(selection.key); else commands.reject(selection.key);\n            }\n        }} rootProps={CLICK_FOCUS} banners={<>\n            {optimiseParts.banner}\n            {editing?.schedule.sessions.map(held => <SessionBanners key={held.key} session={held.session} words={words} name={sessionName(held.kind)} where={where(held.kind)}\n                onAction={action => editing.history.actOn(held.key, action)} />)}\n            {closed !== undefined && <BannerView status=\"info\" title={closed.title} description={closed.description} />}\n            {notStarted && <BannerView status=\"info\" title=\"Week not started\" description={held.requirements.size > 0 ? \"Targets are ready. Assign staff to start this week's roster.\" : \"Assign staff to start this week's roster.\"}\n                actions={previous !== undefined && previous.assignments.size > 0 && (commands.available || commands.locked !== undefined) ? <Button size=\"xs\" variant=\"outline\" disabled={commands.locked !== undefined} title={commands.locked} onClick={() => commands.copy()}>Copy previous week</Button> : undefined} />}\n            {weekPay.failed.map(({ who, error: why }) => <BannerView key={`${who.type}:${who.value}`} status=\"warning\"\n                title={`Pay couldn't be worked out for ${who.type === \"person\" ? value.people.find(p => p.key === who.value)?.name ?? who.value : value.agencies.find(a => a.key === who.value)?.name ?? who.value}`}\n                description={why} />)}\n            {!custom.result.ok && <BannerView status=\"warning\" title=\"Additional checks unavailable\" description=\"The roster's additional checks could not run. Built-in checks are still shown.\" />}\n            {visibility.error !== undefined && <BannerView status=\"error\" title=\"Staff results unavailable\" description={visibility.error} actions={<Button size=\"xs\" variant=\"outline\" onClick={visibility.retry}>Retry</Button>} />}\n            {activities.error !== undefined && <BannerView status=\"error\" title=\"Activity results unavailable\" description={activities.error} actions={<Button size=\"xs\" variant=\"outline\" onClick={activities.retry}>Retry</Button>} />}\n            {props.patterns.error !== undefined && <BannerView status=\"error\" title=\"Pattern results unavailable\" description={props.patterns.error} actions={<Button size=\"xs\" variant=\"outline\" onClick={props.patterns.retry}>Retry</Button>} />}\n            {/* A find the app's fit failed to answer (R4): its message, and Retry, while the find stands. */}\n            {find !== undefined && fitError !== undefined && <BannerView status=\"warning\" title=\"Fits couldn't be checked\" description={fitError} actions={<Button size=\"xs\" variant=\"outline\" onClick={retryFit}>Retry</Button>} />}\n            {props.rangeError !== undefined && <BannerView status=\"error\" title=\"Week unavailable\" description={props.rangeError} />}\n            {/* A gesture's error; a read's is said once, in the grid and on the footer's line (#1398, CL11). */}\n            {error !== undefined && <Box css={styles.error} role=\"alert\">{error}</Box>}\n        </>} footer={<RosterFooter styles={styles} vocabulary={value.vocabulary} duties={dutyPart} noun={{ singular: `${dutyName} event`, plural: `${dutyName} events` }} line={line}\n            optimise={{ line: optimiseParts.line, legend: optimiseParts.legend }} />}>\n            {/* A failed week's main is not retained: its Retry is in it. The board is the keyboard's surface and its anchor,\n                never a tab stop, as the Calendar's is: a click on a part of it that holds nothing focusable puts the keyboard\n                here, where `[` and `]` step the week, and what Delete takes away leaves it here. */}\n            <Box ref={main} css={styles.main} data-roster-main=\"\" tabIndex={-1} aria-disabled={retained && read.state !== \"failed\" ? true : undefined}\n                data-roster-stale={stale ? \"\" : undefined} data-roster-narrow={narrow ? \"\" : undefined}>\n                <RosterViews {...viewProps} anchor={anchor} onAnchor={onAnchor} picked={picked} />\n            </Box>\n        </BuilderFrame>\n        </LoadingReveal>\n    </Box></FieldAskProvider>;\n}\n\n/** The Roster over the app's records: its narrowing, its week and its editing, around the frame. */\nfunction RosterRoot({ value: source, storageKey }: EastChakraRosterProps) {\n    const key = `${storageKey}.${source.id.type === \"some\" ? source.id.value : \"roster\"}`;\n    const { state: display, setState: setDisplay } = usePersistedState(`${key}.display`, { density: source.settings.density.type, chipSkills: source.settings.chipSkills, requirements: source.settings.requirements }, readRosterDisplay);\n    // The narrowing chooses which people, activities and patterns show, read from the slice itself (#1342); coverage, pay and checks read every one.\n    const visibility = useRosterVisibility(source, \"people\");\n    const activities = useRosterVisibility(source, \"activities\");\n    const patterns = useRosterVisibility(source, \"patterns\");\n    const value: RosterValue = useMemo(() => ({ ...source, visiblePeople: visibility.keys, visibleActivities: activities.keys, settings: { ...source.settings, ...display, density: variant(display.density, null) } }),\n        [source, display, visibility.keys, activities.keys]);\n    // What the rail shows of each Library tab's source, and how that source alone clears.\n    const peopleShown = useSourceShown(visibility, rosterPart(source, \"people\"));\n    const activitiesShown = useSourceShown(activities, rosterPart(source, \"activities\"));\n    const patternsShown = useSourceShown(patterns, rosterPart(source, \"patterns\"));\n    const shown = useMemo(() => ({ people: peopleShown, activities: activitiesShown, patterns: patternsShown }), [peopleShown, activitiesShown, patternsShown]);\n    const [narrow, setNarrow] = useState(false);\n    const window = useRosterWindow(value, key, narrow);\n    // The duties' source of the slice holds the span's window — its weeks and the twelve hours either side their duties may start from\n    // their shifts' — which the Roster's own navigation writes (D9), so the rail's count and a Save's notice read the window it reads.\n    const span = spanWindow(window.span);\n    const chrome = source.slice.type === \"some\" ? source.slice.value : undefined;\n    const dutyError = useSourceWindow(chrome, source.duty.kind.key, span.from, span.to, \"The week could not be applied\");\n    // The reference record's source (#1551) holds the same window, as the duties' does: the check reads each week's rows of it beside them.\n    const referenceError = useSourceWindow(chrome, SCHEDULE_REFERENCE, span.from, span.to, \"The week could not be applied to the reference record\");\n    const rangeError = dutyError ?? referenceError;\n    const frame = { source, value, storageKey: key, window, visibility, activities, patterns, shown, display, setDisplay, rangeError, onNarrow: setNarrow };\n    return source.settings.readOnly ? <RosterFrame {...frame} editing={undefined} /> : <EditableRoster {...frame} />;\n}\n/** The e3 renderer owns the frame; callers author only the Roster tag and bound data. */\nexport function EastChakraRoster(props: EastChakraRosterProps) {\n    const error = configError(props.value);\n    return error === undefined ? <RosterRoot {...props} /> : <BannerView status=\"error\" title=\"Roster configuration\" description={error} />;\n}\nimplementUIComponent(RosterComponent, EastChakraRoster);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Allocation's decoded payload and its model over the app's own records\n * (#1372, `Builder Interfaces Spec.md` §6, §9): the pure functions and codecs\n * compiled once per bin row type, as the Roster's domain is — East decides\n * which types are the same; the day assembled from the bins' rows and the\n * own row of the period holding it — the day's, or its week's (#1550) —\n * drafts in place. The renderer reads and writes the bins\n * through these, and draws every figure and word from e3-ui's own functions —\n * it reimplements none.\n *\n * @packageDocumentation\n */\n\nimport {\n    BlobType, DateTimeType, DictType, East, EastTypeType, FloatType, SortedMap, StringType, compareFor, decodeBeast2For, encodeBeast2For, equalFor,\n    fromEastTypeValue, parseFor, printFor, variant, type EastType, type EastTypeValue, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport {\n    AllocationArrivalType, AllocationBinTypeFor, AllocationCandidateType, AllocationCheckContextTypeFor, AllocationContextType, AllocationDayTypeFor,\n    AllocationFitAskType, AllocationFitRequestTypeFor, AllocationFitResultType, AllocationFitType, AllocationIssueType, AllocationLoadType,\n    AllocationPayloadType, AllocationResourceLineType, AllocationResourceType, AllocationSlotType, ScheduleAllocationRolesType, allocationBinOf,\n    allocationCandidates, allocationCheck, allocationLoadText, allocationLoads, allocationMilliseconds, allocationQuantityText, allocationResourceLine,\n    allocationSlots, type AllocationBinType, type AllocationDayType,\n} from \"@elaraai/e3-ui/internal\";\nimport { DAY, weekStart } from \"../shared/schedule/window.js\";\nexport { DAY, NARROW_WIDTH, dayStart } from \"../shared/schedule/window.js\";\n\n/** The decoded payload. */\nexport type AllocationValue = ValueTypeOf<typeof AllocationPayloadType>;\n/** A bin as the board reads it: its roles, and the app's row — opaque here, read through the app's columns, check and forms. */\nexport type Bin = ValueTypeOf<AllocationBinType<EastType>>;\n/** One day as the board reads it: its period's status, and its bins. */\nexport type Day = ValueTypeOf<AllocationDayType<EastType>>;\n/** A bin's roles, as the bin kind reads them from its row and writes them into one. */\nexport type Roles = ValueTypeOf<typeof ScheduleAllocationRolesType>;\nexport type Context = ValueTypeOf<typeof AllocationContextType>;\n/** What the board books from: an arrival, as the tag reads it from the app's rows. */\nexport type ArrivalRow = ValueTypeOf<typeof AllocationArrivalType>;\nexport type ResourceRow = ValueTypeOf<typeof AllocationResourceType>;\nexport type Load = ValueTypeOf<typeof AllocationLoadType>;\nexport type Issue = ValueTypeOf<typeof AllocationIssueType>;\nexport type Slot = ValueTypeOf<typeof AllocationSlotType>;\n/** A resource's line on the day, and its marks. */\nexport type ResourceLine = ValueTypeOf<typeof AllocationResourceLineType>;\n/** A fit's question, its answer, one verdict and one candidate. */\nexport type FitAsk = ValueTypeOf<typeof AllocationFitAskType>;\nexport type FitResult = ValueTypeOf<typeof AllocationFitResultType>;\nexport type Fit = ValueTypeOf<typeof AllocationFitType>;\nexport type Candidate = ValueTypeOf<typeof AllocationCandidateType>;\n/** A fit's request: the day as drafted and the question. */\nexport interface FitRequest { day: Date; plan: Day; ask: FitAsk; context: Context }\n/** A duration, as the payload holds it. */\nexport type TimeStep = AllocationValue[\"every\"];\nexport type AllocationStyles = Record<string, Record<string, unknown>>;\n/** The viewer's persisted view; the date is an epoch for local storage. */\nexport interface AllocationView { layout: \"timeline\" | \"table\"; date: number }\n/** What is selected (A8): a bin, a resource, or a lane slot by its lane and its time. */\nexport type Selection = { type: \"bin\"; id: string } | { type: \"resource\"; key: string } | { type: \"slot\"; lane: string; at: number };\n\nexport const dayKey = printFor(DateTimeType);\nexport const parseDay = parseFor(DateTimeType);\nexport const compareDate = compareFor(DateTimeType);\nexport const compareString = compareFor(StringType);\nexport const compareFloat = compareFor(FloatType);\nconst sameRolesValue = equalFor(ScheduleAllocationRolesType);\nconst sameBytes = equalFor(BlobType);\n\n/** The board's codecs and pure functions at one bin row type, compiled once. */\nexport interface AllocationDomain {\n    /** The app's bin row type. */\n    rowType: EastType;\n    /** A day's type at the row type. */\n    dayType: EastType;\n    /** A row as bytes, and back. */\n    encodeRow: (row: unknown) => Uint8Array;\n    decodeRow: (bytes: Uint8Array) => unknown;\n    /** A day, detached: a command changes its own copy, never what the board read. */\n    copyDay: (day: Day) => Day;\n    /** Whether two bins are the same: a bin unlike the stored day's is a draft. */\n    sameBin: (a: Bin, b: Bin) => boolean;\n    /** A bin as the board reads it on a day (B12): its roles beside its row; `none` for a bin of another day. */\n    binOf: (roles: Roles, row: unknown, day: Date) => option<Bin>;\n    /** The app's check's input, as bytes. */\n    encodeCheckContext: (context: { day: Date; plan: Day; context: Context; loads: SortedMap<string, Load> }) => Uint8Array;\n    /** Every resource's load. */\n    loads: (day: Date, plan: Day, context: Context) => SortedMap<string, Load>;\n    /** The built-in checks. */\n    check: (day: Date, plan: Day, context: Context) => Issue[];\n    /** The day's lane slots. */\n    slots: (day: Date, plan: Day, context: Context) => Slot[];\n    /** A question's candidates: what a placement would leave on each resource — a fit's preview, never its verdict. */\n    candidates: (request: FitRequest) => Candidate[];\n    /** The fit's request type at the row type: what the app's function takes. */\n    requestType: EastType;\n}\n\nconst sameTypeValue = equalFor(EastTypeType);\nconst domains: { type: EastTypeValue; domain: AllocationDomain }[] = [];\n\n/**\n * The domain for a bin kind's row type: built and compiled the first time a\n * type is seen, then shared — East decides which types are the same.\n *\n * @param rowType - The bin kind's `rowType`\n * @returns Its codecs and compiled pure functions\n */\nexport function allocationDomain(rowType: EastTypeValue): AllocationDomain {\n    const known = domains.find(d => sameTypeValue(d.type, rowType));\n    if (known !== undefined) return known.domain;\n    const row = fromEastTypeValue(rowType) as EastType;\n    const dayType = AllocationDayTypeFor(row);\n    const encodeDay = encodeBeast2For(dayType), decodeDay = decodeBeast2For(dayType);\n    const domain: AllocationDomain = {\n        rowType: row, dayType,\n        encodeRow: encodeBeast2For(row) as (value: unknown) => Uint8Array,\n        decodeRow: decodeBeast2For(row) as (bytes: Uint8Array) => unknown,\n        copyDay: day => decodeDay(encodeDay(day as never)) as unknown as Day,\n        sameBin: equalFor(AllocationBinTypeFor(row)) as unknown as AllocationDomain[\"sameBin\"],\n        binOf: East.compile(allocationBinOf(row), []) as unknown as AllocationDomain[\"binOf\"],\n        encodeCheckContext: encodeBeast2For(AllocationCheckContextTypeFor(row)) as unknown as AllocationDomain[\"encodeCheckContext\"],\n        loads: East.compile(allocationLoads(row), []) as unknown as AllocationDomain[\"loads\"],\n        check: East.compile(allocationCheck(row), []) as unknown as AllocationDomain[\"check\"],\n        slots: East.compile(allocationSlots(row), []) as unknown as AllocationDomain[\"slots\"],\n        candidates: East.compile(allocationCandidates(row), []) as unknown as AllocationDomain[\"candidates\"],\n        requestType: AllocationFitRequestTypeFor(row),\n    };\n    domains.push({ type: rowType, domain });\n    return domain;\n}\n\n/** The app's check's input over a reference record (#1551): the day's, and the record's rows over it by key. */\nexport interface AllocationReferenceCheckAsk {\n    day: Date; plan: Day; context: Context; loads: SortedMap<string, Load>; reference: SortedMap<string, unknown>;\n}\n\nconst referenceCheckEncoders: { row: EastTypeValue; reference: EastTypeValue; encode: (ask: AllocationReferenceCheckAsk) => Uint8Array }[] = [];\n\n/**\n * The app's check's input at the bin row type and a reference record's row\n * type (#1551), `CheckContext(R, P)`, as bytes: its encoder made the first\n * time the pair is seen, then shared — East decides which types are the same.\n *\n * @param rowType - The bin kind's `rowType`\n * @param referenceType - The reference record's row type\n * @returns The input's encoder\n */\nexport function allocationReferenceCheckEncoder(rowType: EastTypeValue, referenceType: EastTypeValue): (ask: AllocationReferenceCheckAsk) => Uint8Array {\n    const known = referenceCheckEncoders.find(e => sameTypeValue(e.row, rowType) && sameTypeValue(e.reference, referenceType));\n    if (known !== undefined) return known.encode;\n    const type = AllocationCheckContextTypeFor(fromEastTypeValue(rowType) as EastType, fromEastTypeValue(referenceType) as EastType);\n    const encode = encodeBeast2For(type) as unknown as (ask: AllocationReferenceCheckAsk) => Uint8Array;\n    referenceCheckEncoders.push({ row: rowType, reference: referenceType, encode });\n    return encode;\n}\n\n/** The words and figures the board shares with e3-ui's functions, compiled once. */\nlet words: {\n    quantity: (value: number, unit: string) => string;\n    load: (fill: number, resource: ResourceRow, unit: string) => string;\n    line: (day: Date, resource: ResourceRow, load: Load, unit: string, reserved: string) => ResourceLine;\n    ms: (step: TimeStep) => bigint;\n} | undefined;\nexport function allocationWords() {\n    words ??= {\n        quantity: East.compile(allocationQuantityText, []) as (value: number, unit: string) => string,\n        load: East.compile(allocationLoadText, []) as (fill: number, resource: ResourceRow, unit: string) => string,\n        line: East.compile(allocationResourceLine, []) as unknown as (day: Date, resource: ResourceRow, load: Load, unit: string, reserved: string) => ResourceLine,\n        ms: East.compile(allocationMilliseconds, []) as unknown as (step: TimeStep) => bigint,\n    };\n    return words;\n}\n\n/** Every arrival and resource, by key, and the board's configuration: what the fit, the checks and the loads read, whatever the narrowing hides. */\nexport function allocationContext(value: AllocationValue): Context {\n    return {\n        lanes: value.lanes, every: value.every,\n        arrivals: new SortedMap(value.arrivals.map(a => [a.key, a] as const), compareString),\n        resources: new SortedMap(value.resources.map(r => [r.key, r] as const), compareString),\n        rules: value.rules, unit: value.bin.unit.type === \"some\" ? value.bin.unit.value : \"\",\n    };\n}\n\n/** A bin's parts — or its roles' — the largest first (ties in key order): its first is the resource the bin is shown on. */\nexport function partsOf(bin: Pick<Bin, \"parts\">): { key: string; quantity: number }[] {\n    return [...bin.parts].map(([key, quantity]) => ({ key, quantity })).sort((a, b) => compareFloat(b.quantity, a.quantity) || compareString(a.key, b.key));\n}\n\n/** Whether two bins' parts are the same: a link a draft changed. */\nexport const sameParts = equalFor(DictType(StringType, FloatType));\n\n/** The focus (A13): the selected resource, or the selected bin's resource. */\nexport function focusOf(selection: Selection | undefined, plan: Day): string | undefined {\n    if (selection?.type === \"resource\") return selection.key;\n    const bin = selection?.type === \"bin\" ? plan.bins.get(selection.id) : undefined;\n    return bin === undefined ? undefined : partsOf(bin)[0]?.key;\n}\n\n/** A day with no row and no bins yet: Not started. */\nexport function emptyDay(): Day {\n    return { status: variant(\"draft\", null), bins: new SortedMap([], compareString) } as unknown as Day;\n}\n\n/** Checks the bound configuration, before anything draws. */\nexport function configError(value: AllocationValue): string | undefined {\n    if (value.lanes.length === 0) return `Allocation needs at least one ${value.labels.lane.one.toLocaleLowerCase()}.`;\n    const unique = (rows: readonly { key: string }[]) => new Set(rows.map(row => row.key)).size === rows.length;\n    for (const [name, rows] of [[\"lanes\", value.lanes], [\"arrivals\", value.arrivals], [\"resources\", value.resources]] as const) {\n        if (!unique(rows)) return `Allocation ${name} must have unique keys.`;\n    }\n    if (value.resources.some(r => !Number.isFinite(r.min) || !Number.isFinite(r.max) || r.min < 0 || r.max < r.min)) return \"Allocation resources need a minimum no larger than their maximum.\";\n    return undefined;\n}\n\n// ============================================================================\n// The day, assembled from the records' rows\n// ============================================================================\n\n/** One stored bin as the bin kind's `rows` gives it: its roles, its row's bytes, and its row, decoded once. */\nexport interface StoredBin { readonly roles: Roles; readonly bytes: Uint8Array; readonly row: unknown }\n/** A bin's row as a draft holds it: its bytes, its roles and its row. */\nexport interface DraftedBin { readonly bytes: Uint8Array; readonly roles: Roles; readonly row: unknown }\n\n/** A bin's roles, as the board reads them from it: what the kind writes into its row. */\nexport function rolesOf(bin: Bin): Roles {\n    return { at: bin.at, lane: bin.lane, arrival: bin.arrival, quantity: bin.quantity, parts: bin.parts, hold: bin.hold, kind: bin.kind };\n}\n/** Whether two bins' roles are the same: what a command changed of a bin, and what its row is written with. */\nexport const sameRoles = (a: Bin, b: Bin): boolean => sameRolesValue(rolesOf(a), rolesOf(b));\n/** Whether two rows' bytes are the same. */\nexport const sameRowBytes = (a: Uint8Array, b: Uint8Array): boolean => sameBytes(a, b);\n\n/**\n * The day's bins as the record holds them: each stored bin the day's window\n * read, as the board reads it on the day.\n *\n * @param domain - The bin row type's domain\n * @param stored - The bins the day's window read, by key\n * @param day - The plan day\n * @returns The day's bins, by key\n */\nexport function placeStored(domain: AllocationDomain, stored: ReadonlyMap<string, StoredBin>, day: Date): SortedMap<string, Bin> {\n    const bins = new SortedMap<string, Bin>([], compareString);\n    for (const [key, bin] of stored) {\n        const read = domain.binOf(bin.roles, bin.row, day);\n        if (read.type === \"some\") bins.set(key, read.value);\n    }\n    return bins;\n}\n\n/**\n * The day's bins as drafted: the stored ones, each a draft holds in its\n * draft's place — a draft of any day, placed in this one where its `at` is —\n * and each one a draft removes gone.\n *\n * @param domain - The bin row type's domain\n * @param stored - The day's bins as the record holds them\n * @param drafts - Every drafted bin of the session, by key: its row, or `undefined` for one removed\n * @param day - The plan day\n * @returns The day's bins as drafted, by key\n */\nexport function placeDrafted(domain: AllocationDomain, stored: SortedMap<string, Bin>, drafts: ReadonlyMap<string, DraftedBin | undefined>, day: Date): SortedMap<string, Bin> {\n    if (drafts.size === 0) return stored;\n    const bins = new SortedMap<string, Bin>(stored, compareString);\n    for (const [key, draft] of drafts) {\n        bins.delete(key);\n        if (draft === undefined) continue;\n        const read = domain.binOf(draft.roles, draft.row, day);\n        if (read.type === \"some\") bins.set(key, read.value);\n    }\n    return bins;\n}\n\n/** The own row of the period holding the day — the day's, or its week's (#1550) — and what it says. */\nexport interface PlacedPeriod {\n    /** Its row's bytes; `undefined` for a period with no row: Not started. */\n    readonly bytes: Uint8Array | undefined;\n    /** Its status. */\n    readonly status: Day[\"status\"];\n}\n\n/** A period with no row of its own: Not started, a draft. */\nexport const NO_PERIOD: PlacedPeriod = { bytes: undefined, status: variant(\"draft\", null) as Day[\"status\"] };\n\n/** Whether a period's row is its own: what a period with no row reads as Not started for. */\nexport function started(period: PlacedPeriod): boolean { return period.bytes !== undefined; }\n\n/** Whether a period is open to edits by its status: a draft — Not started among them — never the published case or another. */\nexport function editableStatus(status: Day[\"status\"]): boolean { return status.type === \"draft\"; }\n\n/** A period's status chip's words: Not started, Draft, Published, or the app's own case by its name. */\nexport function statusText(period: PlacedPeriod): string {\n    if (!started(period)) return \"Not started\";\n    return period.status.type === \"draft\" ? \"Draft\" : period.status.type === \"published\" ? \"Published\" : period.status.value;\n}\n\n/** Whether the board publishes a week at a time (#1550): its periods every `\"week\"`; else a day at a time. */\nexport function byWeek(value: AllocationValue): boolean {\n    return value.periods.type === \"some\" && value.periods.value.every.type === \"week\";\n}\n\n/**\n * The period the board publishes that holds a day (#1550): the day itself\n * where it publishes a day at a time — or has no periods — else the week\n * holding it, from the day its week starts on (`week.start`).\n *\n * @param value - The payload: its periods, and the day its week starts on\n * @param day - A day, at UTC midnight\n * @returns The period's first day — its row's key — and the day after its last\n */\nexport function periodSpan(value: AllocationValue, day: Date): { readonly from: Date; readonly to: Date } {\n    if (!byWeek(value)) return { from: day, to: new Date(day.getTime() + DAY) };\n    const from = weekStart(day, value.settings.weekStart.type === \"sunday\");\n    return { from, to: new Date(from.getTime() + 7 * DAY) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Allocation's editing (#1372, `Builder Interfaces Spec.md` §7): one\n * history over a session per record it writes — the bins (the bin kind's\n * session, read by key through its `entries` when it is given them) and the\n * periods, its days or its weeks (#1550) — through the shared Schedule\n * editing, as the Roster's is: a gesture is one step, and Save sends each\n * record's changes as its own request. Drafts of every day stay in their sessions: navigating, the rail and\n * a remount keep them, and Save includes them. The day's own reads of each\n * record serve a gesture's original and a Save's confirmation, at the revision\n * the Save committed; a row they do not hold is read by its key.\n *\n * @packageDocumentation\n */\n\nimport { useLayoutEffect, useMemo, useRef, type RefObject } from \"react\";\nimport { StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport type { FieldSpecValue, RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { getSomeorUndefined, type EditHistory, type EditSession, type EntryVersion } from \"@elaraai/east-ui-components\";\nimport { isBounded } from \"../shared/bounds.js\";\nimport {\n    useScheduleEditing, type ScheduleEditing, type ScheduleEditingRecord, type ScheduleEntryRef, type ScheduleRowRead, type ScheduleStandingRows,\n} from \"../shared/schedule/editing.js\";\nimport { draftedRow, heldInWindow, keptAtRevision, periodRowRead, rowCodec } from \"../shared/schedule/records.js\";\nimport { DAY, allocationDomain, dayKey, periodSpan, type AllocationValue, type DraftedBin, type StoredBin } from \"./model.js\";\n\n/** What a change names the periods' record by in the history — its days', or its weeks' (#1550): no bin kind's slot. */\nexport const PERIODS = \"allocation.periods\";\n\nconst keyEqual = equalFor(StringType);\n\n/**\n * The fields of the bin kind's form a bin's numbers are held to the bounds of (#1585), from its row: every bounded one,\n * but a reservation's quantity — it holds none until an arrival is booked into it, and is checked once that makes it a\n * bin. One rule for what holds Save, what wears the warn ring and what Issues lists out of range.\n *\n * @param bin - The bin kind\n * @returns A row's bounded fields\n */\nexport function binBounds(bin: AllocationValue[\"bin\"]): (row: unknown) => readonly FieldSpecValue[] {\n    const bounded = bin.kind.fields.filter(isBounded);\n    const quantity = getSomeorUndefined(bin.kind.schedule.quantity);\n    const reserved = quantity === undefined ? bounded : bounded.filter(spec => !(spec.path.length === 1 && keyEqual(spec.path[0]!, quantity)));\n    if (reserved.length === bounded.length) return () => bounded;\n    const { encodeRow } = allocationDomain(bin.rowType);\n    return row => bin.read(encodeRow(row)).arrival.type === \"none\" ? reserved : bounded;\n}\n\n/** The Allocation's editing: its history, and every draft of each record, decoded once. */\nexport interface AllocationEditing {\n    /** The shared Schedule editing over the two records: how a gesture is recorded, and what each record holds. */\n    readonly schedule: ScheduleEditing;\n    /** The one history over them. */\n    readonly history: EditHistory<ScheduleEntryRef>;\n    /** The bin kind's slot: what a change names the bins by. */\n    readonly bin: string;\n    /** Every drafted bin of every day, by key: its bytes, its roles and its row, or `undefined` for one removed. */\n    readonly bins: ReadonlyMap<string, DraftedBin | undefined>;\n    /** Every drafted period's row — a day's, or a week's (#1550) — by its key's text: its bytes, or `undefined` for one removed. */\n    readonly periods: ReadonlyMap<string, Uint8Array | undefined>;\n    /**\n     * Where the board says what it draws of each record now: a gesture's original while the record's revision now is\n     * read — after a Save, or another session's — so a gesture on what the board shows is taken at once.\n     */\n    readonly standing: RefObject<ScheduleStandingRows | undefined>;\n}\n\nconst NO_JOINED: Parameters<typeof useScheduleEditing>[0][\"joined\"] = [];\n\n/**\n * Says what the board draws of each record now ({@link AllocationEditing.standing}): the day's bins, and the own row\n * of the period holding the day — as the frame holds them, at whatever revision they were read. None while the board\n * draws no read of the day in view. Said as the frame commits, so a gesture reads what the page shows.\n *\n * @param editing - The board's editing; none for a board read only\n * @param bins - The bins the frame draws, while its read is the day's own\n * @param period - The period's own row as the frame holds it\n * @param periodId - The period's key's text\n */\nexport function useAllocationStanding(editing: AllocationEditing | undefined, bins: ReadonlyMap<string, StoredBin> | undefined, period: Uint8Array | undefined, periodId: string): void {\n    const standing = editing?.standing;\n    const bin = editing?.bin;\n    useLayoutEffect(() => {\n        if (standing === undefined || bin === undefined) return undefined;\n        standing.current = bins === undefined ? undefined : {\n            [bin]: id => bins.get(id)?.bytes,\n            [PERIODS]: id => (keyEqual(id, periodId) ? period : undefined),\n        };\n        return () => { standing.current = undefined; };\n    }, [standing, bin, bins, period, periodId]);\n}\n\n/**\n * The Allocation's sessions over its records, and their drafts (see the module docs).\n *\n * @param value - The payload\n * @param storageKey - The board's key: its sessions and their history are kept under it\n * @param day - The plan day: the window the board reads its records over\n * @param recordSlices - The slice's part over the bins: its Save notice counts what leaves it\n * @returns The editing\n */\nexport function useAllocationEditing(value: AllocationValue, storageKey: string, day: Date, recordSlices: readonly ValueTypeOf<RecordSliceBindType>[]): AllocationEditing {\n    const domain = allocationDomain(value.bin.rowType);\n    const kinds = useMemo(() => [value.bin.kind], [value.bin.kind]);\n    const records = useMemo((): ScheduleEditingRecord[] => value.periods.type === \"some\"\n        ? [{ key: PERIODS, name: value.periods.value.every.type === \"week\" ? \"Weeks\" : \"Days\", editing: value.periods.value.editing, entries: value.periods.value.entries }]\n        : [], [value.periods]);\n    const epoch = day.getTime();\n    const range = useMemo(() => ({ from: new Date(epoch), to: new Date(epoch + DAY) }), [epoch]);\n    // The period holding the day — the day, or its week (#1550): its own row is what the day's reads hold of the periods.\n    const own = periodSpan(value, day), ownFrom = own.from.getTime(), ownTo = own.to.getTime();\n    // Each record's rows where the day's own reads hold them — the bins' window and its period's own row: a gesture's original,\n    // and what a Save confirms its entries by at the revision it committed.\n    const reads = useMemo((): Record<string, ScheduleRowRead> => {\n        const from = new Date(epoch), to = new Date(epoch + DAY);\n        const bins = keptAtRevision(value.bin.kind.entries, () => value.bin.rows(from, to));\n        const out: Record<string, ScheduleRowRead> = { [value.bin.kind.key]: key => heldInWindow(bins(), key) };\n        // The period's own row, by its start: the day's read holds none of another period's.\n        if (value.periods.type === \"some\") out[PERIODS] = periodRowRead(value.periods.value, new Date(ownFrom), new Date(ownTo), dayKey(new Date(ownFrom)));\n        return out;\n    }, [value.bin, value.periods, epoch, ownFrom, ownTo]);\n    // A reservation holds no quantity yet: none of its quantity's bounds hold its Save (#1585).\n    const boundsOf = useMemo(() => ({ [value.bin.kind.key]: binBounds(value.bin) }), [value.bin]);\n    // A bin's quantity and its split across resources change together: one conflict, under the board's word for a quantity.\n    const standing = useRef<ScheduleStandingRows | undefined>(undefined);\n    const schedule = useScheduleEditing({\n        kinds, records, reads, standing, storageKey, joined: NO_JOINED, range, recordSlices, quantityLabel: value.labels.quantity, boundsOf, autosave: value.settings.autosave,\n    });\n    const bin = value.bin.kind.key;\n    const sessionOf = (key: string): EditSession<ScheduleEntryRef> | undefined => schedule.sessions.find(held => held.kind === key)?.session;\n    // Each draft decoded once: a session keeps an entry's version the same object until a gesture replaces it.\n    const binCache = useRef(new WeakMap<EntryVersion<ScheduleEntryRef>, DraftedBin>());\n    const periodCache = useRef(new WeakMap<EntryVersion<ScheduleEntryRef>, Uint8Array>());\n    const drafts = schedule.drafts;\n    const bins = useMemo(() => {\n        const session = sessionOf(bin);\n        const out = new Map<string, DraftedBin | undefined>();\n        for (const id of schedule.draftsOf(bin).keys()) {\n            const entry = session?.entries.get(id);\n            const drafted = draftedRow(entry);\n            if (entry === undefined || drafted === undefined) { out.set(id, undefined); continue; }\n            let held = binCache.current.get(entry);\n            if (held === undefined) {\n                const bytes = domain.encodeRow(drafted.row);\n                held = { bytes, roles: value.bin.read(bytes), row: drafted.row };\n                binCache.current.set(entry, held);\n            }\n            out.set(id, held);\n        }\n        return out;\n        // The drafts move with every gesture: their bytes say when.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [drafts, bin, domain, value.bin]);\n    const periods = useMemo(() => {\n        const out = new Map<string, Uint8Array | undefined>();\n        if (value.periods.type !== \"some\") return out;\n        const encode = rowCodec(value.periods.value.rowType).encode;\n        const session = sessionOf(PERIODS);\n        for (const id of schedule.draftsOf(PERIODS).keys()) {\n            const entry = session?.entries.get(id);\n            const drafted = draftedRow(entry);\n            if (entry === undefined || drafted === undefined) { out.set(id, undefined); continue; }\n            let held = periodCache.current.get(entry);\n            if (held === undefined) { held = encode(drafted.row); periodCache.current.set(entry, held); }\n            out.set(id, held);\n        }\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [drafts, value.periods]);\n    return useMemo(() => ({ schedule, history: schedule.history, bin, bins, periods, standing }), [schedule, bin, bins, periods]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The board's nouns (#1338, D12): the app's words for a lane, what it books (an\n * arrival), a resource and the quantity, resolved by the tag, and how running text writes them —\n * in lower case, unless written in capitals (`SKU` stays `SKU`).\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext } from \"react\";\nimport { lowerWord } from \"../shared/schedule/words.js\";\nimport type { AllocationValue } from \"./model.js\";\n\n/** The board's nouns, as the payload carries them. */\nexport type Nouns = AllocationValue[\"labels\"];\n/** One noun: its singular as a heading writes it, its plural and its article. */\nexport type Noun = Nouns[\"lane\"];\n\n/**\n * A word in running text: lower case, unless it is written in capitals.\n *\n * @param word - The word as a heading writes it\n * @returns The word as a sentence writes it\n */\nexport function lower(word: string): string {\n    return lowerWord(word);\n}\n\n/** The singular in running text: `kiln`. */\nexport const one = (noun: Noun): string => lower(noun.one);\n/** The plural in running text: `kilns`. */\nexport const other = (noun: Noun): string => lower(noun.other);\n/** The singular after its article: `a kiln`, `an arrival`. */\nexport const a = (noun: Noun): string => `${noun.article} ${lower(noun.one)}`;\n\n/** A count in a noun: `1 bin`, `3 bins`. */\nexport const counted = (n: number, noun: Noun): string => `${n} ${n === 1 ? one(noun) : other(noun)}`;\n\n/** The nouns with no labels given, as the tag resolves them. */\nexport const DEFAULT_NOUNS: Nouns = {\n    lane: { one: \"Lane\", other: \"Lanes\", article: \"a\" }, arrival: { one: \"Arrival\", other: \"Arrivals\", article: \"an\" },\n    resource: { one: \"Resource\", other: \"Resources\", article: \"a\" }, quantity: \"QTY\",\n    bin: { one: \"Bin\", other: \"Bins\", article: \"a\" }, reservation: { one: \"Reservation\", other: \"Reservations\", article: \"a\" }, reserved: \"Reserved\",\n    priorJob: \"Prior job\", nextJob: \"Next job\", hold: \"Hold\",\n    groups: { overdue: \"Overdue\", ready: \"Ready around now\", removed: \"Removed from plan\", allocated: \"Allocated\", free: \"Free today\", loading: \"Loading today\", busy: \"Busy today\" },\n};\n\n/** The board's nouns, for its parts. */\nexport const NounsContext = createContext<Nouns>(DEFAULT_NOUNS);\n\n/** The board's nouns. */\nexport const useNouns = (): Nouns => useContext(NounsContext);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * One command path for the Timeline, the Table, the Library, the Inspector and\n * the narrow cards (A75, #1372, `Builder Interfaces Spec.md` §6, §7): each\n * command works out the day as it leaves it, on a detached copy of the day as\n * drafted, then records the bins it changed as one step of the history — a\n * changed bin's row written through the bin kind's `write`, every field no\n * role maps as it was (B1); a bin gone removed; a new one's row the kind's\n * `create`, a booking's with its arrival's `values` or the fields' defaults, a\n * reservation's with the bin kind's `values` of it (#1526) or the defaults\n * (B13), under a key its record's session makes (B15, #1583: made up at\n * random, through `ScheduleEditing.mint`). The inspector's\n * form edits the row's own fields through the kind's `write` of a field, and\n * the kind's own form writes the row whole. Publish runs Save, then writes the\n * status of the period holding the day — the day's, or its week's (#1550) —\n * once every record reads back as saved (B7, `publishPeriod`).\n *\n * @packageDocumentation\n */\n\nimport { SortedMap, none, some, variant, type option } from \"@elaraai/east\";\nimport type { Origin } from \"@elaraai/east-ui-components\";\nimport type { ScheduleChange } from \"../shared/schedule/editing.js\";\nimport { fieldChange, madeFromValues, periodPublishChange } from \"../shared/schedule/records.js\";\nimport { PERIODS, type AllocationEditing } from \"./editing.js\";\nimport { one } from \"./nouns.js\";\nimport {\n    compareFloat, compareString, dayKey, editableStatus, partsOf, rolesOf, sameRowBytes, type AllocationDomain, type AllocationValue, type Bin, type Day,\n    type PlacedPeriod, type Roles, type Selection, type StoredBin,\n} from \"./model.js\";\n\n/**\n * What a bin's parts leave unallocated (A70): its quantity less what its parts\n * hold — all of it with no part; none for a reservation.\n *\n * @param bin - The bin\n * @returns The remainder, never below zero\n */\nexport function remainderOf(bin: Bin): number {\n    if (bin.arrival.type === \"none\") return 0;\n    const left = bin.quantity - [...bin.parts.values()].reduce((n, q) => n + q, 0);\n    return compareFloat(left, 0) > 0 ? left : 0;\n}\n\n/** What `Split…` takes of a bin (A71): from where, how much there is, and the quantity's bounds and default. */\nexport interface SplitTake {\n    /** The part it takes off, or `undefined` for what the parts leave unallocated. */\n    from: string | undefined;\n    /** What there is to take: the part, or the remainder. */\n    held: number;\n    /** The least and the most it takes, and what it takes unless told otherwise. */\n    least: number;\n    most: number;\n    initial: number;\n}\n\n/**\n * What `Split…` takes of a bin (A71, #1362): with some of it unallocated, that\n * — all of it by default and at most, at least 1 of it (all of it, under 1);\n * with none, a quantity off a part — its largest, or the one named — half of\n * it by default, at least 1 (half of it, for a part under 2) and at most the\n * part less that, so both keep some. A reservation, a bin with nothing on a\n * resource and nothing left, and a part it does not have split nothing.\n *\n * @param bin - The bin\n * @param from - The part to take off when nothing is left; its largest by default\n * @returns What it takes, or `undefined` for nothing to split\n */\nexport function splitOf(bin: Bin, from?: string): SplitTake | undefined {\n    if (bin.arrival.type === \"none\") return undefined;\n    const remainder = remainderOf(bin);\n    if (compareFloat(remainder, 0) > 0) return { from: undefined, held: remainder, least: compareFloat(remainder, 1) < 0 ? remainder : 1, most: remainder, initial: remainder };\n    const key = from ?? partsOf(bin)[0]?.key;\n    const part = key === undefined ? undefined : bin.parts.get(key);\n    if (key === undefined || part === undefined || compareFloat(part, 0) <= 0) return undefined;\n    const half = part / 2, least = compareFloat(half, 1) < 0 ? half : 1;\n    return { from: key, held: part, least, most: part - least, initial: half };\n}\n\n/**\n * What a drag onto a resource carries of a bin (A39, A73): a link's part, or\n * a connector's remainder — all of it with no part — or, with nothing left\n * over, its largest part.\n *\n * @param bin - The bin\n * @param from - The link's resource, for a link's drag\n * @returns The quantity and the part it leaves, or `undefined` for a part the bin no longer has\n */\nexport function linkedQuantity(bin: Bin, from: string | undefined): { quantity: number; from: string | undefined } | undefined {\n    if (from !== undefined) { const quantity = bin.parts.get(from); return quantity === undefined ? undefined : { quantity, from }; }\n    const allocated = [...bin.parts.values()].reduce((n, q) => n + q, 0);\n    if (bin.quantity - allocated > 0 || bin.parts.size === 0) return { quantity: bin.quantity - allocated, from: undefined };\n    const largest = partsOf(bin)[0]!;\n    return { quantity: largest.quantity, from: largest.key };\n}\n\n/** What the commands read: the day as drafted and as stored, its rows, and the editing they record through. */\nexport interface AllocationState {\n    readonly value: AllocationValue;\n    readonly domain: AllocationDomain;\n    /** The plan day. */\n    readonly day: Date;\n    /** The day as drafted, and as the records hold it. */\n    readonly plan: Day;\n    readonly held: Day;\n    /** The own row of the period holding the day — the day's, or its week's (#1550) — as drafted, and as stored. */\n    readonly period: PlacedPeriod;\n    readonly heldPeriod: PlacedPeriod;\n    /** The bins the day's window read, by key: each stored bin's bytes. */\n    readonly read: ReadonlyMap<string, StoredBin>;\n    /** The editing; `undefined` for a read-only board. */\n    readonly editing: AllocationEditing | undefined;\n    /** Whether the day's reads have landed and no Publish is under way: a gesture waits for them. */\n    readonly ready: boolean;\n    /**\n     * Whether what main shows is retained while a narrowing of it is read (#1398, CL8): readable, focusable and\n     * selectable, its controls in place, and every gesture refused until it lands.\n     */\n    readonly retained?: boolean | undefined;\n}\n\n/** The board's commands. */\nexport interface AllocationCommands {\n    /** Whether the day takes a gesture now: editable, its reads landed, its records' sessions writable. */\n    readonly available: boolean;\n    /** The same, as the board's parts ask it. */\n    canEdit: () => boolean;\n    /** Removes a bin (A76): a committed one stays under Removed from plan until Save; a new one is gone. */\n    remove(id: string): void;\n    /** Reverts a bin (A76): a committed one back as the day holds it, its row whole; a new one's arrival back to Arrivals. */\n    revert(id: string): void;\n    /** Unlinks one part of a bin (A68), or every part with no resource named (the inspector's Unlink, A56): what it held there is unallocated again. */\n    unlink(id: string, resource?: string): void;\n    /**\n     * Sets a bin's quantity (A57, A75: the inspector's quantity field): a bin\n     * wholly on one resource stays wholly there; a split or partly allocated\n     * bin keeps its parts, its remainder changing, and never holds less than\n     * they take.\n     */\n    setQuantity(id: string, quantity: number): boolean;\n    /** Takes a bin's row as the bin kind's own form wrote it: one transaction, as every gesture is (A75). */\n    row(id: string, bytes: Uint8Array): boolean;\n    /** Edits one of the bin row's own fields, as the inspector's form over the kind's `fields` does. */\n    field(id: string, path: readonly string[], next: unknown): boolean;\n    /**\n     * Splits a bin (A71, #1362): a new part on a resource it is not on, of\n     * what {@link splitOf} takes — of what its parts leave unallocated, more\n     * than nothing and no more than all of it; with nothing left, off a part\n     * (its largest, or `from`), more than nothing and less than all of it, so\n     * both keep some. One step.\n     */\n    split(id: string, resource: string, quantity: number, from?: string): boolean;\n    /**\n     * Sets one part's quantity (A71, the inspector's field in Assigned to): no\n     * more than the part and the remainder together; nothing unlinks it, what\n     * it held unallocated again. The bin's quantity never changes.\n     */\n    setPart(id: string, resource: string, quantity: number): boolean;\n    /** Moves a bin to a lane slot, after the slot's bins by a minute each (A37); its resource never changes. */\n    move(id: string, lane: string, at: Date): boolean;\n    /**\n     * Links a bin on a resource (A39): a link's part moves there (`from`), or a\n     * connector's quantity goes there — its remainder, or, with none, its\n     * largest part.\n     */\n    link(id: string, resource: string, from: string | undefined): boolean;\n    /** Fills a reservation with a bin (A38): the bin takes its lane, time and resource, and the reservation goes. */\n    fill(id: string, reservation: string): boolean;\n    /** Books an arrival into a lane slot (A49): a new bin of it, its row's other fields the arrival's `values`, on a resource or not linked yet. */\n    book(arrival: string, lane: string, at: Date, resource: string | undefined): boolean;\n    /** Replaces a bin's arrival (A49): a bin of the other arrival takes its lane, time and resource; the replaced one goes back to Arrivals. */\n    replace(id: string, arrival: string): boolean;\n    /** Books an arrival into a reservation (A38, A49): its bin takes the reservation's lane, time and resource, and the reservation goes. */\n    fillWith(reservation: string, arrival: string): boolean;\n    /** Reserves a lane slot on a resource (A49): a bin with no arrival, no quantity and no hold, its row's other fields the bin kind's `values` of it, or their defaults. */\n    reserve(lane: string, at: Date, resource: string): boolean;\n    /** Books a committed bin the drafts removed again (A51), as the day holds it, into a lane slot: on a resource, or not linked yet. */\n    restore(id: string, lane: string, at: Date, resource: string | undefined): boolean;\n    /** Books a committed bin the drafts removed again into a reservation (A38): it takes the reservation's lane, time and resource, and the reservation goes. */\n    restoreInto(id: string, reservation: string): boolean;\n    /** Returns a draft booking's arrival to Arrivals (A51): every bin of it the day does not hold yet goes. */\n    unbook(arrival: string): void;\n    /** Publishes the period holding the day, the day or its week (A4, B7, #1550): Save, then its status. */\n    publish(): void;\n}\n\n/**\n * The board's commands over the day (see the module docs).\n *\n * @param state - The day, its rows and the editing\n * @param select - Sets what is selected, keeping the panes as they are\n * @param publish - Publishes the period holding the day: Save, then its status\n * @returns The commands\n */\nexport function allocationCommands(state: AllocationState, select: (next: Selection | undefined, soft?: boolean) => void, publish: () => void): AllocationCommands {\n    const { value, domain, day, plan, held, editing } = state;\n    const schedule = editing?.schedule;\n    const bins = value.bin.kind.key;\n    const available = editing !== undefined && schedule !== undefined && state.ready && !value.settings.readOnly\n        && editableStatus(state.heldPeriod.status) && editableStatus(state.period.status) && schedule.available(bins);\n    // Retained, the board keeps its controls and takes no gesture (#1398, CL8).\n    const takes = available && state.retained !== true;\n    const record = (changes: readonly ScheduleChange[], origin: Origin, label: string) => schedule !== undefined && changes.length > 0 && schedule.record(changes, origin, label);\n    /**\n     * The rows a day as it leaves a gesture changes, from the day as drafted: each bin gone removed; each new or changed one's\n     * row written through the kind's `write` over its own row, every field no role maps as it was (B1) — a bin back as the day\n     * holds it its stored row whole — and one under a key the record has never held a new row.\n     */\n    const changesOf = (next: Day): ScheduleChange[] => {\n        const changes: ScheduleChange[] = [];\n        for (const id of plan.bins.keys()) if (!next.bins.has(id)) changes.push({ kind: bins, id, remove: true });\n        for (const [id, bin] of next.bins) {\n            const was = plan.bins.get(id);\n            if (was !== undefined && domain.sameBin(was, bin)) continue;\n            const stored = held.bins.get(id);\n            const row = stored !== undefined && domain.sameBin(stored, bin) ? state.read.get(id)?.bytes : undefined;\n            const bytes = row ?? value.bin.write(domain.encodeRow(bin.row), rolesOf(bin));\n            changes.push(was === undefined && stored === undefined ? { kind: bins, id, row: bytes, created: true } : { kind: bins, id, row: bytes });\n        }\n        return changes;\n    };\n    /** One gesture, one transaction (A75): on a copy of the day as drafted, never what the board read; its bins recorded as one step. */\n    const write = (label: string, origin: Origin, change: (next: Day) => void): boolean => {\n        if (!takes) return false;\n        const next = domain.copyDay(plan);\n        change(next);\n        return record(changesOf(next), origin, label);\n    };\n    /**\n     * A new bin of the day: its row the kind's `create` of its roles and the values given, its roles as the kind reads\n     * them back; its key its session's to make (#1583), past those this gesture has made. `undefined` where the app's\n     * `values` fail to make it, or the history holds no session to make its key yet.\n     */\n    const created = (roles: Roles, values: option<Uint8Array>, minted: Set<string>): { id: string; bin: Bin } | undefined => {\n        const bytes = madeFromValues(\"Allocation\", `a new ${one(value.labels.bin)}`, () => value.bin.create(roles, values));\n        if (bytes === undefined) return undefined;\n        const bin = domain.binOf(value.bin.read(bytes), domain.decodeRow(bytes), day);\n        if (bin.type !== \"some\") return undefined;\n        const id = schedule?.mint(bins, \"\", minted);\n        if (id === undefined) return undefined;\n        minted.add(id);\n        return { id, bin: bin.value };\n    };\n    /** A booking of an arrival (§6.4): its key, quantity, kind and hold, on a resource or not linked yet, its row's other fields its `values`. */\n    const booking = (arrival: string, lane: string, at: Date, resource: string | undefined) => {\n        const of = value.arrivals.find(a => a.key === arrival);\n        if (of === undefined) return undefined;\n        return created({ at, lane, arrival: some(arrival), quantity: of.quantity, kind: of.kind, hold: of.hold,\n            parts: new SortedMap<string, number>(resource === undefined ? [] : [[resource, of.quantity]], compareString) }, value.initial(arrival), new Set());\n    };\n    return {\n        available, canEdit: () => available,\n        remove(id) {\n            if (!plan.bins.has(id)) return;\n            const committed = held.bins.has(id);\n            if (write(`Back to ${value.labels.arrival.other}`, \"remove\", next => { next.bins.delete(id); })) select(committed ? { type: \"bin\", id } : undefined);\n        },\n        revert(id) {\n            if (!held.bins.has(id)) {\n                if (plan.bins.has(id) && write(`Return to ${value.labels.arrival.other}`, \"remove\", next => { next.bins.delete(id); })) select(undefined);\n                return;\n            }\n            if (write(\"Revert\", \"typed\", next => { next.bins.set(id, domain.copyDay(held).bins.get(id)!); })) select({ type: \"bin\", id });\n        },\n        move(id, lane, at) {\n            if (!plan.bins.has(id)) return false;\n            const done = write(\"Move\", \"move\", next => { const bin = next.bins.get(id)!; bin.lane = lane; bin.at = at; });\n            // A selection a command makes follows softly: the row stays where it is when it is in view (A12).\n            if (done) select({ type: \"bin\", id }, true);\n            return done;\n        },\n        link(id, resource, from) {\n            const bin = plan.bins.get(id);\n            if (bin === undefined) return false;\n            const moved = linkedQuantity(bin, from);\n            if (moved === undefined || moved.from === resource) return false;\n            const done = write(\"Link\", \"drop\", next => {\n                const parts = next.bins.get(id)!.parts;\n                if (moved.from !== undefined) parts.delete(moved.from);\n                parts.set(resource, (parts.get(resource) ?? 0) + moved.quantity);\n            });\n            if (done) select({ type: \"bin\", id }, true);\n            return done;\n        },\n        fill(id, reservation) {\n            const bin = plan.bins.get(id), into = plan.bins.get(reservation);\n            if (bin === undefined || into === undefined || into.arrival.type !== \"none\") return false;\n            const resource = [...into.parts.keys()][0];\n            const done = write(`Fill the ${one(value.labels.reservation)}`, \"drop\", next => {\n                const moved = next.bins.get(id)!;\n                moved.lane = into.lane; moved.at = into.at;\n                moved.parts.clear();\n                if (resource !== undefined) moved.parts.set(resource, moved.quantity);\n                next.bins.delete(reservation);\n            });\n            if (done) select({ type: \"bin\", id }, true);\n            return done;\n        },\n        book(arrival, lane, at, resource) {\n            const made = booking(arrival, lane, at, resource);\n            if (made === undefined) return false;\n            const done = write(\"Book\", \"drop\", next => { next.bins.set(made.id, made.bin); });\n            if (done) select({ type: \"bin\", id: made.id }, true);\n            return done;\n        },\n        replace(id, arrival) {\n            const was = plan.bins.get(id);\n            if (was === undefined || was.arrival.type === \"none\") return false;\n            const made = booking(arrival, was.lane, was.at, partsOf(was)[0]?.key);\n            if (made === undefined) return false;\n            const done = write(\"Replace\", \"typed\", next => { next.bins.delete(id); next.bins.set(made.id, made.bin); });\n            if (done) select({ type: \"bin\", id: made.id }, true);\n            return done;\n        },\n        fillWith(reservation, arrival) {\n            const into = plan.bins.get(reservation);\n            if (into === undefined || into.arrival.type !== \"none\") return false;\n            const made = booking(arrival, into.lane, into.at, [...into.parts.keys()][0]);\n            if (made === undefined) return false;\n            const done = write(`Book into the ${one(value.labels.reservation)}`, \"drop\", next => { next.bins.delete(reservation); next.bins.set(made.id, made.bin); });\n            if (done) select({ type: \"bin\", id: made.id }, true);\n            return done;\n        },\n        reserve(lane, at, resource) {\n            // A reservation's row: no arrival, no quantity, no hold, its other fields the bin kind's `values` of it, or their defaults (B13, #1526).\n            const made = created({ at, lane, arrival: none, quantity: 0, kind: none, hold: variant(\"days\", 0), parts: new SortedMap<string, number>([[resource, 0]], compareString) },\n                none, new Set());\n            if (made === undefined) return false;\n            const done = write(\"Reserve\", \"drop\", next => { next.bins.set(made.id, made.bin); });\n            if (done) select({ type: \"bin\", id: made.id }, true);\n            return done;\n        },\n        unlink(id, resource) {\n            const bin = plan.bins.get(id);\n            if (bin === undefined || (resource === undefined ? bin.parts.size === 0 : !bin.parts.has(resource))) return;\n            if (write(\"Unlink\", \"remove\", next => {\n                const parts = next.bins.get(id)!.parts;\n                if (resource === undefined) parts.clear(); else parts.delete(resource);\n            })) select({ type: \"bin\", id });\n        },\n        setQuantity(id, quantity) {\n            const bin = plan.bins.get(id);\n            if (bin === undefined || bin.arrival.type === \"none\" || !Number.isFinite(quantity) || compareFloat(quantity, 0) < 0 || compareFloat(quantity, bin.quantity) === 0) return false;\n            const parts = partsOf(bin);\n            const whole = parts.length === 1 && compareFloat(parts[0]!.quantity, bin.quantity) === 0;\n            if (!whole && compareFloat(quantity, parts.reduce((n, p) => n + p.quantity, 0)) < 0) return false;\n            return write(`Edit ${one(value.labels.bin)}`, \"typed\", next => {\n                const into = next.bins.get(id)!;\n                into.quantity = quantity;\n                if (whole) into.parts.set(parts[0]!.key, quantity);\n            });\n        },\n        row(id, bytes) {\n            const was = plan.bins.get(id);\n            if (!takes || was === undefined || sameRowBytes(bytes, domain.encodeRow(was.row))) return false;\n            return record([{ kind: bins, id, row: bytes }], \"typed\", `Edit ${one(value.labels.bin)}`);\n        },\n        field(id, path, next) {\n            if (!takes || !plan.bins.has(id)) return false;\n            const change = fieldChange(value.bin.kind, id, path, next);\n            return change !== undefined && record([change], \"typed\", `Edit ${one(value.labels.bin)}`);\n        },\n        split(id, resource, quantity, from) {\n            const bin = plan.bins.get(id);\n            const take = bin === undefined ? undefined : splitOf(bin, from);\n            if (bin === undefined || take === undefined || bin.parts.has(resource) || !Number.isFinite(quantity) || compareFloat(quantity, 0) <= 0\n                || (take.from === undefined ? compareFloat(quantity, take.held) > 0 : compareFloat(quantity, take.held) >= 0)) return false;\n            const done = write(\"Split\", \"typed\", next => {\n                const parts = next.bins.get(id)!.parts;\n                if (take.from !== undefined) parts.set(take.from, take.held - quantity);\n                parts.set(resource, quantity);\n            });\n            if (done) select({ type: \"bin\", id }, true);\n            return done;\n        },\n        setPart(id, resource, quantity) {\n            const bin = plan.bins.get(id);\n            const part = bin?.parts.get(resource);\n            if (bin === undefined || part === undefined || !Number.isFinite(quantity) || compareFloat(quantity, 0) < 0\n                || compareFloat(quantity, part) === 0 || compareFloat(quantity, part + remainderOf(bin)) > 0) return false;\n            // Nothing on it unlinks it (A71): what it held is unallocated again.\n            if (compareFloat(quantity, 0) === 0) return write(\"Unlink\", \"remove\", next => { next.bins.get(id)!.parts.delete(resource); });\n            return write(`Edit ${one(value.labels.bin)}`, \"typed\", next => { next.bins.get(id)!.parts.set(resource, quantity); });\n        },\n        restore(id, lane, at, resource) {\n            if (!held.bins.has(id) || plan.bins.has(id)) return false;\n            const done = write(\"Book\", \"drop\", next => {\n                const bin = domain.copyDay(held).bins.get(id)!;\n                bin.lane = lane; bin.at = at;\n                bin.parts.clear();\n                if (resource !== undefined) bin.parts.set(resource, bin.quantity);\n                next.bins.set(id, bin);\n            });\n            if (done) select({ type: \"bin\", id }, true);\n            return done;\n        },\n        restoreInto(id, reservation) {\n            const into = plan.bins.get(reservation);\n            if (!held.bins.has(id) || plan.bins.has(id) || into === undefined || into.arrival.type !== \"none\") return false;\n            const resource = [...into.parts.keys()][0];\n            const done = write(`Book into the ${one(value.labels.reservation)}`, \"drop\", next => {\n                const bin = domain.copyDay(held).bins.get(id)!;\n                bin.lane = into.lane; bin.at = into.at;\n                bin.parts.clear();\n                if (resource !== undefined) bin.parts.set(resource, bin.quantity);\n                next.bins.delete(reservation);\n                next.bins.set(id, bin);\n            });\n            if (done) select({ type: \"bin\", id }, true);\n            return done;\n        },\n        unbook(arrival) {\n            const ids = [...plan.bins].flatMap(([id, bin]) => bin.arrival.type === \"some\" && bin.arrival.value === arrival && !held.bins.has(id) ? [id] : []);\n            if (ids.length === 0) return;\n            if (write(`Return to ${value.labels.arrival.other}`, \"remove\", next => { for (const id of ids) next.bins.delete(id); })) select(undefined);\n        },\n        publish() { if (available && value.periods.type === \"some\") publish(); },\n    };\n}\n\n/**\n * The row of the period holding the day as Publish writes it — the day's, or\n * its week's (#1550): its status the published case, at the time given, over\n * its row as the Save left it (`periodPublishChange`).\n *\n * @param value - The payload: its periods\n * @param start - The period's first day: the plan day, or its week's first\n * @param at - When it is published\n * @returns The change; `undefined` without periods\n */\nexport function publishChange(value: AllocationValue, start: Date, at: Date): ScheduleChange | undefined {\n    if (value.periods.type !== \"some\") return undefined;\n    return periodPublishChange(value.periods.value, PERIODS, dayKey(start), start, at, \"Allocation\");\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The bin a pick in Search Records gives the keyboard to (#1398). The board\n * selects it and follows it into view, and the element that stands for it in\n * the layout shown — the Timeline's card, the Table's row, a narrow card's\n * bin — takes the focus as it is drawn, so the selection's ring and the focus\n * are on the same bin. The board drops it once taken, once the bin is no\n * longer the one selected, or once the viewer does something else.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext, useLayoutEffect, useRef, type RefObject } from \"react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\n\nconst keyEqual = equalFor(StringType);\n\n/** The bin given the keyboard, as the board's views read it. */\nexport interface BinFocus {\n    /** The bin's key while it waits for its element; `undefined` while no pick waits. */\n    readonly id: string | undefined;\n    /** Its element took the focus. */\n    readonly done: () => void;\n}\n\n/** No bin waits for the keyboard. */\nconst NO_BIN: BinFocus = { id: undefined, done: () => {} };\n\n/** The bin a pick gave the keyboard to, for the board's views. */\nexport const BinFocusContext = createContext<BinFocus>(NO_BIN);\n\n/**\n * An element that stands for a bin in a view: drawn while its bin is the one a pick gave the keyboard to, it takes the\n * focus.\n *\n * @param id - The bin it stands for; `undefined` for an element of no bin\n * @returns The ref for the element\n */\nexport function useBinFocusTarget<E extends HTMLElement>(id: string | undefined): RefObject<E | null> {\n    const focus = useContext(BinFocusContext);\n    const el = useRef<E | null>(null);\n    const given = id !== undefined && focus.id !== undefined && keyEqual(focus.id, id);\n    useLayoutEffect(() => {\n        if (!given || el.current === null) return;\n        el.current.focus({ preventScroll: true });\n        focus.done();\n    }, [given, focus]);\n    return el;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a Table cell's Chooser offers (`Allocation Spec.md` A48), pure: an\n * arrival cell's arrivals and a resource cell's resources, in sections, each\n * option's line and its state the fit's answer (F4). The board's own words say\n * only what the answer does not: the current choice, an arrival's meta, and\n * where an arrival already on the board is.\n *\n * @packageDocumentation\n */\n\nimport type { ChooserOption, ChooserSection } from \"@elaraai/east-ui-components/internal\";\nimport { formatDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport type { option } from \"@elaraai/east\";\nimport { compareDate, compareFloat, compareString, partsOf, type Context, type Day, type Fit, type FitResult } from \"./model.js\";\nimport { DEFAULT_NOUNS, lower, type Nouns } from \"./nouns.js\";\n\n/** The words a Chooser's lines are written with: a quantity with its unit and without, and a lane's name. */\nexport interface ChoiceWords {\n    quantity: (value: number) => string;\n    number: (value: number) => string;\n    lane: (key: string) => string;\n    /** The board's words for what it holds; the defaults' with none given. */\n    nouns?: Nouns | undefined;\n}\n\n/** A pending answer's line: the fit has not said yet (F2). */\nconst CHECKING = \"checking fits…\";\n\n/** An option from a verdict: its line the fit's reason, refused when the fit refuses it. */\nfunction judged(base: Omit<ChooserOption, \"state\" | \"line\">, verdict: Fit): ChooserOption {\n    return verdict.type === \"fits\" ? { ...base, line: verdict.value.why, state: \"enabled\" } : { ...base, line: verdict.value.reason, state: \"refused\" };\n}\n\n/**\n * An arrival cell's Chooser (A48): the row's own arrival (Current), the\n * arrivals the plan has not booked — fitting the row's resource, or all of\n * them where the row has none — those that don't fit, and the arrivals\n * already on the board, which cannot be chosen; of the arrivals the narrowing\n * shows (#1339), as the rest of the board shows them. The current one is\n * offered whatever it hides.\n *\n * @param args - The row and what the board knows\n * @returns The sections, in order\n */\nexport function arrivalChoices(args: {\n    plan: Day; context: Context; day: Date; words: ChoiceWords;\n    /** The row's bin, when it shows one (a bin or a reservation). */\n    bin: string | undefined;\n    /** The resource the row's bin is on, if any: what the arrivals are asked onto. */\n    resource: string | undefined;\n    /** The fit's answer to `take` the resource, asked of the day without the row's bin. */\n    answer: FitResult | undefined;\n    /** The arrivals the narrowing shows; `none`, every one. */\n    shown?: option<ReadonlySet<string>> | undefined;\n}): ChooserSection[] {\n    const { plan, context, day, words, bin, resource, answer } = args;\n    const shows = (key: string) => args.shown === undefined || args.shown.type === \"none\" || args.shown.value.has(key);\n    const own = bin === undefined ? undefined : plan.bins.get(bin);\n    const booked = new Set<string>();\n    for (const [, b] of plan.bins) if (b.arrival.type === \"some\") booked.add(b.arrival.value);\n    // The arrivals still to book, overdue first, each in the arrivals' key order.\n    const overdue = (key: string) => { const due = context.arrivals.get(key)?.due; return due?.type === \"some\" && compareDate(due.value, day) < 0; };\n    const free = [...context.arrivals.keys()].filter(key => !booked.has(key) && shows(key)).sort((a, b) => Number(overdue(b)) - Number(overdue(a)));\n    const name = resource === undefined ? undefined : context.resources.get(resource)?.label ?? resource;\n    const sections: ChooserSection[] = [];\n    if (own !== undefined && own.arrival.type === \"some\") {\n        const arrival = context.arrivals.get(own.arrival.value);\n        sections.push({ label: \"Current\", options: [{ key: own.arrival.value, label: arrival?.label ?? own.arrival.value, state: \"current\",\n            line: arrival?.meta.type === \"some\" ? arrival.meta.value : undefined, range: words.quantity(own.quantity) }] });\n    }\n    const options = free.map((key): ChooserOption => {\n        const arrival = context.arrivals.get(key)!;\n        const base = { key, label: arrival.label, range: words.quantity(arrival.quantity), warn: overdue(key) };\n        const meta = [arrival.meta.type === \"some\" ? arrival.meta.value : \"\", overdue(key) ? lower((words.nouns ?? DEFAULT_NOUNS).groups.overdue) : \"\"].filter(p => p !== \"\").join(\" · \") || undefined;\n        if (resource === undefined) return { ...base, line: meta, state: \"enabled\" };\n        const verdict = answer?.arrivals.get(key);\n        return verdict === undefined ? { ...base, line: CHECKING, state: \"disabled\" } : judged(base, verdict);\n    });\n    const fits = options.filter(o => o.state !== \"refused\"), refused = options.filter(o => o.state === \"refused\");\n    if (fits.length > 0) sections.push({ label: name !== undefined ? `Fits ${name}` : own !== undefined && own.arrival.type === \"some\" ? \"Replace with\" : \"Book here\", options: fits });\n    if (refused.length > 0) sections.push({ label: `Doesn’t fit ${name}`, options: refused });\n    // The arrivals already on the board, where they are: not to be chosen.\n    const where = new Map<string, { id: string; at: Date; lane: string; resource: string | undefined; quantity: number; more: number }>();\n    for (const [id, b] of plan.bins) {\n        if (b.arrival.type !== \"some\" || id === bin || !shows(b.arrival.value)) continue;\n        const was = where.get(b.arrival.value);\n        if (was === undefined) where.set(b.arrival.value, { id, at: b.at, lane: b.lane, resource: partsOf(b)[0]?.key, quantity: b.quantity, more: 0 });\n        else {\n            const first = compareDate(b.at, was.at) < 0;\n            where.set(b.arrival.value, { ...(first ? { id, at: b.at, lane: b.lane, resource: partsOf(b)[0]?.key } : was), quantity: was.quantity + b.quantity, more: was.more + 1 });\n        }\n    }\n    const labelOf = (key: string) => context.arrivals.get(key)?.label ?? key;\n    const allocated = [...where].sort(([a], [b]) => compareString(labelOf(a), labelOf(b))).map(([key, w]): ChooserOption => ({\n        key: `allocated:${key}`, label: context.arrivals.get(key)?.label ?? key, range: words.quantity(w.quantity), state: \"disabled\",\n        line: `in ${words.lane(w.lane)} ${formatDatePattern(\"HH:mm\", w.at)}${w.resource === undefined ? \" · not linked\" : ` on ${context.resources.get(w.resource)?.label ?? w.resource}`}${w.more > 0 ? ` · +${w.more} more` : \"\"}`,\n    }));\n    if (allocated.length > 0) sections.push({ label: (words.nouns ?? DEFAULT_NOUNS).groups.allocated, options: allocated });\n    return sections;\n}\n\n/**\n * A resource cell's Chooser (A48): the row's resource (Current), the\n * resources that fit — `Gaps that fit` a bin, `Can be reserved` for a free row\n * or a reservation — best first, and those that don't; of the resources the\n * narrowing shows, as a drop lands only on a shown row (#1336). A split's\n * (A71) leaves out the resources the bin is on already: each is a part of it.\n *\n * @param args - The row and what the board knows\n * @returns The sections, in order\n */\nexport function resourceChoices(args: {\n    context: Context; words: ChoiceWords;\n    /** Whether the row is a bin with an arrival: its fits are gaps, a free row's or a reservation's reservations. */\n    binRow: boolean;\n    /** The resource the row's bin is on, if any. */\n    current: string | undefined;\n    /** The fit's answer to placing the row's bin, or a reservation in its slot. */\n    answer: FitResult | undefined;\n    /** The resources the narrowing shows; `none`, every one. The current one is offered whatever it hides. */\n    shown: option<ReadonlySet<string>>;\n    /** Resources not to offer: a split's bin's own (A71). */\n    except?: ReadonlySet<string> | undefined;\n}): ChooserSection[] {\n    const { context, words, binRow, current, answer, shown, except } = args;\n    const range = (key: string) => { const r = context.resources.get(key)!; return `${words.number(r.min)}–${words.quantity(r.max)}`; };\n    const sections: ChooserSection[] = [];\n    if (current !== undefined && context.resources.has(current)) {\n        sections.push({ label: \"Current\", options: [{ key: current, label: context.resources.get(current)!.label, line: \"current\", range: range(current), state: \"current\" }] });\n    }\n    const others = [...context.resources.keys()].filter(key => key !== current && except?.has(key) !== true && (shown.type === \"none\" || shown.value.has(key)));\n    const heading = binRow ? \"Gaps that fit\" : `Can be ${lower((words.nouns ?? DEFAULT_NOUNS).reserved)}`;\n    if (answer === undefined) {\n        sections.push({ label: heading, options: others.map(key => ({ key, label: context.resources.get(key)!.label, line: CHECKING, range: range(key), state: \"disabled\" })) });\n        return sections;\n    }\n    const fits: { option: ChooserOption; score: number }[] = [];\n    const refused: ChooserOption[] = [];\n    for (const key of others) {\n        const verdict = answer.resources.get(key);\n        if (verdict === undefined) continue;\n        const option = judged({ key, label: context.resources.get(key)!.label, range: range(key) }, verdict);\n        if (verdict.type === \"fits\") fits.push({ option, score: verdict.value.score }); else refused.push(option);\n    }\n    fits.sort((a, b) => compareFloat(b.score, a.score));\n    if (fits.length > 0) sections.push({ label: heading, options: fits.map(f => f.option) });\n    if (refused.length > 0) sections.push({ label: \"Doesn’t fit\", options: refused });\n    return sections;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Table's rows (`Allocation Spec.md` §8, A41–A43), pure: one row per lane\n * slot of the day, and one more per extra bin of a batch, in e3-ui's slot\n * order — time, then lane — in the app's time bands (four by default). A row is its slot's or its\n * bin's, so an allocation never moves it. The narrowing (#1336) hides a row\n * whose lane it hides, whose every resource it hides, or whose bin's arrival\n * it hides (#1339, `rowHiding`); never reorders one.\n *\n * @packageDocumentation\n */\n\nimport { none, type option } from \"@elaraai/east\";\nimport { dayKey, parseDay, type Day, type Slot } from \"./model.js\";\nimport { DEFAULT_NOUNS, counted, lower, type Nouns } from \"./nouns.js\";\n\n/** What a row holds: nothing, a bin with an arrival, or a reservation. */\nexport type TableRowKind = \"free\" | \"bin\" | \"reserved\";\n\n/** One row of the Table. */\nexport interface TableRow {\n    /** Its identity: its bin's, or its free slot's. */\n    key: string;\n    /** Its lane's key. */\n    lane: string;\n    /** Its time: its bin's, or its slot's. */\n    at: Date;\n    /** Its slot's time: what a drop on its arrival cell names. */\n    slotAt: Date;\n    /** The bin it shows. */\n    bin: string | undefined;\n    kind: TableRowKind;\n}\n\n/** One of the time bands: its rows and what they hold. */\nexport interface TableBand {\n    /** Its identity, what its fold is kept by: its hours, `00:00–06:00`. */\n    key: string;\n    /** Its heading: the app's label, or its hours. */\n    label: string;\n    rows: TableRow[];\n    /** Its bins with an arrival, its reservations and its free slots. */\n    bins: number;\n    reserved: number;\n    free: number;\n    /** What its bins hold. */\n    quantity: number;\n}\n\n/** A band as the payload gives it: its first hour, and its label. */\nexport interface BandStart { from: number; label: option<string> }\n/** The bands with none given: 00–06 · 06–12 · 12–18 · 18–24. */\nexport const DEFAULT_BANDS: readonly BandStart[] = [0, 6, 12, 18].map(from => ({ from, label: none }));\nconst HOUR_MS = 3_600_000;\n/** An hour of the day as a band's heading writes it: `07:30`, and `24:00` for midnight at its end. */\nconst hour = (h: number) => { const minutes = Math.round(h * 60); return `${String(Math.floor(minutes / 60)).padStart(2, \"0\")}:${String(minutes % 60).padStart(2, \"0\")}`; };\n\n/**\n * The day's rows: a free slot's one, or one per bin it holds, by time.\n *\n * @param slots - The day's slots, in e3-ui's order\n * @param plan - The day as drafted\n * @returns The rows, in order\n */\nexport function tableRows(slots: readonly Slot[], plan: Day): TableRow[] {\n    return slots.flatMap((slot): TableRow[] => slot.bins.length === 0\n        ? [{ key: `slot:${slot.lane}|${dayKey(slot.at)}`, lane: slot.lane, at: slot.at, slotAt: slot.at, bin: undefined, kind: \"free\" as const }]\n        : slot.bins.flatMap((id): TableRow[] => {\n            const bin = plan.bins.get(id);\n            return bin === undefined ? [] : [{ key: `bin:${id}`, lane: slot.lane, at: bin.at, slotAt: slot.at, bin: id,\n                kind: bin.arrival.type === \"none\" ? \"reserved\" as const : \"bin\" as const }];\n        }));\n}\n\n/**\n * What a row's key names: its bin, or its free slot's lane and time.\n *\n * @param key - A row's key\n * @returns Its bin, or its slot; `undefined` for no row's key\n */\nexport function rowOfKey(key: string): { bin: string } | { lane: string; at: Date } | undefined {\n    if (key.startsWith(\"bin:\")) return { bin: key.slice(\"bin:\".length) };\n    if (!key.startsWith(\"slot:\")) return undefined;\n    const rest = key.slice(\"slot:\".length), bar = rest.lastIndexOf(\"|\");\n    const at = bar < 0 ? undefined : parseDay(rest.slice(bar + 1));\n    return at?.success === true ? { lane: rest.slice(0, bar), at: at.value } : undefined;\n}\n\n/**\n * The rows in their time bands, by their slot's time on the day: each band from\n * its hour to the next band's, the last to midnight.\n *\n * @param rows - The day's rows\n * @param plan - The day as drafted\n * @param day - The plan day\n * @param bands - The bands' first hours, from 0, rising; four by default\n * @returns The bands, each with its counts\n */\nexport function tableBands(rows: readonly TableRow[], plan: Day, day: Date, bands: readonly BandStart[] = DEFAULT_BANDS): TableBand[] {\n    return bands.map((band, i) => {\n        const to = bands[i + 1]?.from ?? 24;\n        const key = `${hour(band.from)}–${hour(to)}`;\n        return bandOf(key, band.label.type === \"some\" ? band.label.value : key,\n            rows.filter(r => { const h = (r.slotAt.getTime() - day.getTime()) / HOUR_MS; return h >= band.from && h < to; }), plan);\n    });\n}\n\n/** A band of rows, with what they hold. */\nfunction bandOf(key: string, label: string, rows: readonly TableRow[], plan: Day): TableBand {\n    const bins = rows.filter(r => r.kind === \"bin\");\n    return {\n        key, label, rows: [...rows],\n        bins: bins.length, reserved: rows.filter(r => r.kind === \"reserved\").length, free: rows.filter(r => r.kind === \"free\").length,\n        quantity: bins.reduce((sum, r) => sum + (plan.bins.get(r.bin!)?.quantity ?? 0), 0),\n    };\n}\n\n/** Which of the narrowing's sources hide a row: its lane's, its resources', its arrival's. */\nexport interface RowHiding {\n    readonly lanes: boolean;\n    readonly resources: boolean;\n    readonly arrivals: boolean;\n}\n\n/**\n * What hides a row under a narrowing (#1336, #1339): its lane, where the\n * narrowing hides it; its bin's arrival, where it hides that — a reservation,\n * which has no arrival, it never hides so; and its bin's resources, where the\n * bin has parts and it hides every one of them — a free row, or a bin not yet\n * allocated, it never hides so. What Search Records says hides a bin it finds\n * is this too (`hidden.ts`, #1398).\n *\n * @param lane - The row's lane\n * @param bin - Its bin's arrival and the resources it has parts on; `undefined` for a free row\n * @param lanes - The lanes the narrowing shows; `none`, every one\n * @param resources - The resources it shows; `none`, every one\n * @param arrivals - The arrivals it shows; `none`, every one\n * @returns Which sources hide it\n */\nexport function rowHiding(lane: string, bin: { readonly arrival: string | undefined; readonly parts: Iterable<string> } | undefined,\n    lanes: option<ReadonlySet<string>>, resources: option<ReadonlySet<string>>, arrivals: option<ReadonlySet<string>>): RowHiding {\n    let parts = 0, shown = false;\n    if (resources.type === \"some\" && bin !== undefined) for (const key of bin.parts) { parts++; shown ||= resources.value.has(key); }\n    return {\n        lanes: lanes.type === \"some\" && !lanes.value.has(lane),\n        resources: parts > 0 && !shown,\n        arrivals: arrivals.type === \"some\" && bin?.arrival !== undefined && !arrivals.value.has(bin.arrival),\n    };\n}\n\n/**\n * The rows a narrowing shows (#1336, #1339): those nothing of it hides\n * ({@link rowHiding}) — a row of a shown lane, of a shown arrival or none —\n * free, or a reservation — that holds no resource (free, or not yet\n * allocated) or has a part on a shown resource. Monotone in each set: showing\n * more never hides a row.\n *\n * @param rows - The rows, in order\n * @param plan - The day as drafted\n * @param lanes - The lanes the narrowing shows; `none`, every one\n * @param resources - The resources it shows; `none`, every one\n * @param arrivals - The arrivals it shows; `none`, every one\n * @returns The rows it shows, in their order\n */\nexport function narrowRows(rows: readonly TableRow[], plan: Day, lanes: option<ReadonlySet<string>>, resources: option<ReadonlySet<string>>,\n    arrivals: option<ReadonlySet<string>> = none): TableRow[] {\n    return rows.filter(row => {\n        const bin = row.bin === undefined ? undefined : plan.bins.get(row.bin);\n        const hides = rowHiding(row.lane, bin === undefined ? undefined : { arrival: bin.arrival.type === \"some\" ? bin.arrival.value : undefined, parts: bin.parts.keys() },\n            lanes, resources, arrivals);\n        return !hides.lanes && !hides.resources && !hides.arrivals;\n    });\n}\n\n/**\n * The bands as a narrowing shows them: each with its shown rows and what they\n * hold; a band the narrowing empties has no heading.\n *\n * @param bands - The day's bands\n * @param plan - The day as drafted\n * @param lanes - The lanes the narrowing shows; `none`, every one\n * @param resources - The resources it shows; `none`, every one\n * @param arrivals - The arrivals it shows; `none`, every one\n * @returns The bands, in order\n */\nexport function narrowBands(bands: readonly TableBand[], plan: Day, lanes: option<ReadonlySet<string>>, resources: option<ReadonlySet<string>>,\n    arrivals: option<ReadonlySet<string>> = none): TableBand[] {\n    if (lanes.type === \"none\" && resources.type === \"none\" && arrivals.type === \"none\") return [...bands];\n    return bands.flatMap(band => {\n        const rows = narrowRows(band.rows, plan, lanes, resources, arrivals);\n        return rows.length === 0 && band.rows.length > 0 ? [] : [bandOf(band.key, band.label, rows, plan)];\n    });\n}\n\n/** A row's status (A43), as its Status cell and its narrow card say it. */\nexport type RowStatus = \"Free\" | \"Not linked\" | \"Check\" | \"Unsaved\" | \"Reserved\" | \"Committed\";\n\n/**\n * A row's status (A43): what it holds, and whether a resource of it needs a\n * look — `Free`, `Not linked`, `Check` (a resource of it over max or held into\n * its next job), `Unsaved`, `Reserved` or `Committed`.\n *\n * @param kind - What the row holds\n * @param linked - Whether its bin has a part on a resource\n * @param check - Whether a resource of it is over max or held into its next job\n * @param draft - Whether its bin is a draft\n * @returns Its status\n */\nexport function rowStatus(kind: TableRowKind, linked: boolean, check: boolean, draft: boolean): RowStatus {\n    return kind === \"free\" ? \"Free\" : kind === \"bin\" && !linked ? \"Not linked\" : check ? \"Check\" : draft ? \"Unsaved\" : kind === \"reserved\" ? \"Reserved\" : \"Committed\";\n}\n\n/**\n * A band's line (A42): `7 bins · 1 reserved · 13 free · 208 m³`, no\n * reservations said when it has none, and `· collapsed` when folded.\n *\n * @param band - The band\n * @param quantity - Its quantity, as the board writes it (`208 m³`)\n * @param collapsed - Whether it is folded\n * @param nouns - The board's words\n * @returns Its line\n */\nexport function bandLine(band: TableBand, quantity: string, collapsed: boolean, nouns: Nouns = DEFAULT_NOUNS): string {\n    const parts = [counted(band.bins, nouns.bin), band.reserved > 0 ? `${band.reserved} ${lower(nouns.reserved)}` : \"\", `${band.free} free`, quantity];\n    return parts.filter(p => p !== \"\").join(\" · \") + (collapsed ? \" · collapsed\" : \"\");\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The board's drags on the shared drag grammar (`Allocation Spec.md` §9.4,\n * §9.5, §10; A22–A40): what is dragged — a bin's body, its connector or one of\n * its links, or a Library card: an arrival, a bin the drafts removed, a\n * resource (#1330) — and onto what — a lane hour, a card, a resource row, the\n * fits marker, a Table cell — each as a `CellCoord` of the board's one\n * surface, and the one verdict a drop gets: its caption, its refusal, and the\n * command it runs. A drop onto a resource, into a reservation, or of a\n * resource takes the app's fit's verdict; while that answer is on its way the\n * caption says so, and the drop waits for it (F2). A pick (A11) is asked and\n * answered as a drag of its card is, and its click runs the same verdict.\n * Where a drag rests is told to the board as it moves (`rest`): what its marks\n * and its links read, without a render of the board (A29, A35, A65).\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { none, some, variant, type option } from \"@elaraai/east\";\nimport {\n    useDragLayerOptional, useDragMessages, useDragTarget, type CellCoord, type DragEventValue, type DragPayload, type DragTargetConfig, type DropCellOptions,\n    type DropVeto,\n} from \"@elaraai/east-ui-components\";\nimport { formatDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport { linkedQuantity, type AllocationCommands } from \"./actions.js\";\nimport type { AllocationFit } from \"./fit.js\";\nimport { compareDate, compareFloat, dayKey, parseDay, partsOf, type Context, type Day, type Fit, type FitAsk, type FitResult, type Slot } from \"./model.js\";\nimport { a, lower, one, type Nouns } from \"./nouns.js\";\nimport { rowOfKey } from \"./table-rows.js\";\n\n/** What a drag of something on the board carries: a bin's body (A24), its connector, or one of its links. */\nexport type BoardGrip = { kind: \"body\"; bin: string } | { kind: \"port\"; bin: string } | { kind: \"link\"; bin: string; resource: string };\n/** What a Library card carries (#1330): an arrival to book, a committed bin the drafts removed, or a resource. */\nexport type LibraryGrip = { kind: \"arrival\"; arrival: string } | { kind: \"removed\"; bin: string } | { kind: \"resource\"; resource: string };\n/** What a drag carries. */\nexport type Grip = BoardGrip | LibraryGrip;\n\n/**\n * Where a drag rests (A26): a lane hour (a card in it names the card; a Table\n * row's arrival cell is its slot's, `table`), a resource — its row, the fits\n * marker over the rows (its #1's), or a fit in the inspector's drop list, each\n * dropping as the resource's row does, at `rowCoord` — or a Table row's\n * resource cell.\n */\nexport type Target =\n    | { kind: \"lane\"; lane: string; at: Date; card: string | undefined; table?: boolean }\n    | { kind: \"resource\"; resource: string }\n    | { kind: \"cell\"; row: string };\n\n/** A target's identity, as a cache and the drag's rest key it. */\nexport function targetKey(target: Target): string {\n    return target.kind === \"resource\" ? `r:${target.resource}` : target.kind === \"cell\" ? `c:${target.row}`\n        : `l:${target.lane}|${target.at.getTime()}|${target.card ?? \"\"}|${target.table === true ? \"t\" : \"\"}`;\n}\n\n/** Where a drag rests, as the board's drop targets report it: the target, and whether it takes the drop there. */\nexport interface DragRest { target: Target; allowed: boolean }\n\n/**\n * Where a drag rests, held outside React's state (A35): the drop targets set\n * it as the drag rests on them and clear it as it leaves them, and the parts\n * that mark or draw it — a row's bins and its run's label (A29), the links\n * (A65) — subscribe; nothing else renders as the pointer moves.\n */\nexport class DragRestStore {\n    private value: DragRest | undefined = undefined;\n    private readonly listeners = new Set<() => void>();\n\n    readonly subscribe = (listener: () => void): (() => void) => {\n        this.listeners.add(listener);\n        return () => { this.listeners.delete(listener); };\n    };\n\n    readonly get = (): DragRest | undefined => this.value;\n\n    /** The drag rests on a target, which takes the drop there or refuses it. */\n    rest(target: Target, allowed: boolean): void {\n        const was = this.value;\n        if (was !== undefined && was.allowed === allowed && targetKey(was.target) === targetKey(target)) return;\n        this.set({ target, allowed });\n    }\n\n    /** The drag left a target: it rests on nothing, unless another has taken it already. */\n    leave(target: Target): void {\n        if (this.value !== undefined && targetKey(this.value.target) === targetKey(target)) this.set(undefined);\n    }\n\n    /** The drag ended. */\n    clear(): void {\n        if (this.value !== undefined) this.set(undefined);\n    }\n\n    private set(next: DragRest | undefined): void {\n        this.value = next;\n        for (const listener of this.listeners) listener();\n    }\n}\n\n/** A grip on the board as the drag grammar's coordinate. */\nexport function gripCoord(surface: string, grip: BoardGrip): Required<CellCoord> {\n    return { surface, row: grip.kind, slot: grip.kind === \"link\" ? grip.resource : \"\", event: grip.bin };\n}\n\n/** A lane hour's coordinate, or a card's in it; a Table row's arrival cell names its slot's (`table`). */\nexport function laneCoord(surface: string, lane: string, at: Date, card?: string, table = false): CellCoord {\n    return { surface, row: `${table ? \"table-lane\" : \"lane\"}:${lane}`, slot: dayKey(at), ...(card === undefined ? {} : { event: card }) };\n}\n\n/** A Table row's resource cell's coordinate. */\nexport function resourceCellCoord(surface: string, row: string): CellCoord {\n    return { surface, row: \"table-resource\", slot: row };\n}\n\n/** A resource row's coordinate. */\nexport function rowCoord(surface: string, resource: string): CellCoord {\n    return { surface, row: \"resource\", slot: resource };\n}\n\n/** The Library's two lists, by the board's surface: the drag grammar's sources (#1330). */\nexport interface AllocationLibraries { arrivals: string; resources: string }\n\n/**\n * The Library's ids for a board.\n *\n * @param surface - The board's drag surface\n * @returns Its Arrivals and its Resources lists' ids\n */\nexport function libraryIds(surface: string): AllocationLibraries {\n    return { arrivals: `${surface}.library.arrivals`, resources: `${surface}.library.resources` };\n}\n\n/** An Arrivals card's key: an arrival's, or a removed bin's. */\nexport function arrivalCardKey(grip: Extract<LibraryGrip, { kind: \"arrival\" | \"removed\" }>): string {\n    return grip.kind === \"arrival\" ? `arrival:${grip.arrival}` : `removed:${grip.bin}`;\n}\n\n/**\n * The grip a Library card's reference names.\n *\n * @param libraries - The board's Library ids\n * @param ref - The card's library and key\n * @returns Its grip, or `undefined` for a card of no list of the board's\n */\nexport function libraryGripOf(libraries: AllocationLibraries, ref: { library: string; key: string }): LibraryGrip | undefined {\n    if (ref.library === libraries.resources) return { kind: \"resource\", resource: ref.key };\n    if (ref.library !== libraries.arrivals) return undefined;\n    if (ref.key.startsWith(\"arrival:\")) return { kind: \"arrival\", arrival: ref.key.slice(\"arrival:\".length) };\n    if (ref.key.startsWith(\"removed:\")) return { kind: \"removed\", bin: ref.key.slice(\"removed:\".length) };\n    return undefined;\n}\n\n/** The grip a drag grammar's reference on the board names. */\nexport function gripOf(ref: { row: string; slot: string; event: option<string> }): BoardGrip | undefined {\n    if (ref.event.type !== \"some\") return undefined;\n    const bin = ref.event.value;\n    if (ref.row === \"body\" || ref.row === \"port\") return { kind: ref.row, bin };\n    if (ref.row === \"link\") return { kind: \"link\", bin, resource: ref.slot };\n    return undefined;\n}\n\n/** The target a drag grammar's reference names. */\nexport function targetOf(ref: { row: string; slot: string; event: option<string> }): Target | undefined {\n    if (ref.row === \"resource\") return { kind: \"resource\", resource: ref.slot };\n    if (ref.row === \"table-resource\") return { kind: \"cell\", row: ref.slot };\n    const table = ref.row.startsWith(\"table-lane:\");\n    if (!table && !ref.row.startsWith(\"lane:\")) return undefined;\n    const at = parseDay(ref.slot);\n    return at.success ? { kind: \"lane\", lane: ref.row.slice(table ? \"table-lane:\".length : \"lane:\".length), at: at.value,\n        card: ref.event.type === \"some\" ? ref.event.value : undefined, ...(table ? { table: true } : {}) } : undefined;\n}\n\n/** A grip's identity, as a cache keys it. */\nexport function gripKey(grip: Grip): string {\n    switch (grip.kind) {\n        case \"link\": return `link|${grip.bin}|${grip.resource}`;\n        case \"arrival\": return `arrival|${grip.arrival}`;\n        case \"resource\": return `resource|${grip.resource}`;\n        default: return `${grip.kind}|${grip.bin}`;\n    }\n}\n\n/** A refusal, as the inspector's note says it (A40, A88): `Not allocated · LD-2232 can't go into K-103: gap too short · next job Tue 18.` */\nexport interface Refusal { word: string; text: string }\n\n/** A drop's verdict, where the drag rests. */\nexport interface Verdict {\n    /** Whether the drop is taken: a pending answer is (the drop waits for it). */\n    allowed: boolean;\n    /** The ghost's caption (A33), and whether it warns. */\n    caption: string;\n    warn: boolean;\n    /** Why it is refused. */\n    refusal: Refusal | undefined;\n    /** The fit's words for it, when the fit gave a verdict: its reason for a fit (`0 d spare to Wed 19 · …`), or for a refusal. */\n    reason?: string | undefined;\n    /** The fit's answer is still on its way. */\n    pending: boolean;\n    /** The drop's command. */\n    run: (() => boolean) | undefined;\n}\n\n/** A question the board asks the fit, of the drafts or of a day derived from them, and the quantity it places. */\nexport interface Asked { ask: FitAsk; of: Day | undefined; quantity: number }\n\n/** The question a grip on the board asks of the fit (A23, A73): a link's part, a connector's remainder, a body's whole bin. */\nexport function placeAsk(plan: Day, grip: BoardGrip): { ask: FitAsk; quantity: number } | undefined {\n    const bin = plan.bins.get(grip.bin);\n    if (bin === undefined) return undefined;\n    const quantity = grip.kind === \"body\" ? bin.quantity : linkedQuantity(bin, grip.kind === \"link\" ? grip.resource : undefined)?.quantity;\n    if (quantity === undefined) return undefined;\n    return { ask: variant(\"place\", { subject: variant(\"bin\", grip.bin), quantity }), quantity };\n}\n\n/** The resource a grip's link leaves: a link's own, or a connector's largest part (A28: its current resource is never ranked). */\nexport function currentOf(plan: Day, grip: Grip): string | undefined {\n    if (grip.kind === \"link\") return grip.resource;\n    if (grip.kind !== \"body\" && grip.kind !== \"port\") return undefined;\n    const bin = plan.bins.get(grip.bin);\n    return bin === undefined ? undefined : partsOf(bin)[0]?.key;\n}\n\n/**\n * The link a grip's drag moves (A69): a link's own; a connector's when it\n * carries its bin's largest part, its bin having nothing left to link (A21); a\n * body's or a Library card's, none.\n *\n * @param plan - The day as drafted\n * @param grip - What is dragged\n * @returns The bin's part it moves, or `undefined` for a drag that moves no link\n */\nexport function movedLinkOf(plan: Day, grip: Grip): { bin: string; resource: string } | undefined {\n    if (grip.kind === \"link\") return { bin: grip.bin, resource: grip.resource };\n    if (grip.kind !== \"port\") return undefined;\n    const bin = plan.bins.get(grip.bin);\n    const carried = bin === undefined ? undefined : linkedQuantity(bin, undefined);\n    return carried?.from === undefined ? undefined : { bin: grip.bin, resource: carried.from };\n}\n\n/** The three best fits of an answer, best first, the current resource excepted (A28). */\nexport function rankOf(answer: FitResult | undefined, current: string | undefined): string[] {\n    if (answer === undefined) return [];\n    return [...answer.resources].flatMap(([key, fit]) => fit.type === \"fits\" && key !== current ? [{ key, score: fit.value.score }] : [])\n        .sort((a, b) => compareFloat(b.score, a.score)).slice(0, 3).map(f => f.key);\n}\n\n/** What the board knows where a drag rests. */\nexport interface DropScene {\n    /** The plan day. */\n    day: Date;\n    plan: Day;\n    /** The day as the record holds it: the bins a Removed from plan card books again. */\n    held: Day | undefined;\n    context: Context;\n    slots: readonly Slot[];\n    fit: AllocationFit;\n    commands: AllocationCommands;\n    /** The day without a reservation: what a fill asks the fit of, as the mock asks it. */\n    without: (reservation: string) => Day;\n    /** The day with a committed bin the drafts removed back on it, unlinked — and without a reservation it fills: what booking it again asks the fit of. */\n    restoring: (bin: string, reservation?: string) => Day | undefined;\n    /** The day's first free slot, by time then lane, of the lanes that show (A36). */\n    firstFree: () => { lane: string; at: Date } | undefined;\n    /** A booking with no free slot left (A36): the banner's words. */\n    notice: (refusal: Refusal) => void;\n    /** A lane's label. */\n    laneLabel: (lane: string) => string;\n    /** The board's nouns, as its captions and refusals write them. */\n    nouns: Nouns;\n}\n\n/** A grip's question of the fit, of the drafts or of a day the board derives from them (`of`, a fill's or a restore's). */\nexport function askOf(scene: Pick<DropScene, \"plan\" | \"context\" | \"restoring\">, grip: Grip, of?: Day): Asked | undefined {\n    switch (grip.kind) {\n        case \"arrival\": {\n            const arrival = scene.context.arrivals.get(grip.arrival);\n            return arrival === undefined ? undefined : { ask: variant(\"place\", { subject: variant(\"arrival\", grip.arrival), quantity: arrival.quantity }), of, quantity: arrival.quantity };\n        }\n        case \"removed\": {\n            const day = of ?? scene.restoring(grip.bin);\n            const bin = day?.bins.get(grip.bin);\n            return bin === undefined ? undefined : { ask: variant(\"place\", { subject: variant(\"bin\", grip.bin), quantity: bin.quantity }), of: day, quantity: bin.quantity };\n        }\n        case \"resource\": return { ask: variant(\"take\", { resource: grip.resource }), of, quantity: 0 };\n        default: {\n            const asked = placeAsk(of ?? scene.plan, grip);\n            return asked === undefined ? undefined : { ...asked, of };\n        }\n    }\n}\n\n/** An arrival's code. */\nfunction arrivalLabel(scene: Pick<DropScene, \"context\">, arrival: string): string {\n    return scene.context.arrivals.get(arrival)?.label ?? arrival;\n}\n\n/** A bin's arrival's code: the drafts', or the record's for a bin the drafts removed. */\nfunction codeOfBin(scene: Pick<DropScene, \"context\" | \"plan\" | \"held\" | \"nouns\">, bin: string): string {\n    const arrival = (scene.plan.bins.get(bin) ?? scene.held?.bins.get(bin))?.arrival;\n    return arrival?.type === \"some\" ? arrivalLabel(scene, arrival.value) : `The ${one(scene.nouns.reservation)}`;\n}\n\n/** What a grip's caption and refusal call what it carries. */\nfunction codeOf(scene: Pick<DropScene, \"context\" | \"plan\" | \"held\" | \"nouns\">, grip: Grip): string {\n    switch (grip.kind) {\n        case \"arrival\": return arrivalLabel(scene, grip.arrival);\n        case \"resource\": return nameOf(scene, grip.resource);\n        default: return codeOfBin(scene, grip.bin);\n    }\n}\n\n/** A resource's name. */\nconst nameOf = (scene: Pick<DropScene, \"context\">, resource: string) => scene.context.resources.get(resource)?.label ?? resource;\n\n/** A lane slot's words: `B-1 06:15`. */\nconst slotText = (scene: Pick<DropScene, \"laneLabel\">, lane: string, at: Date) => `${scene.laneLabel(lane)} ${formatDatePattern(\"HH:mm\", at)}`;\n\n/** Where a bin lands in a lane slot (A37): the slot's time, or a minute after the last bin already in it. */\nexport function landing(slots: readonly Slot[], plan: Day, lane: string, at: Date, bin: string | undefined): Date {\n    const slot = slots.find(s => s.lane === lane && compareDate(s.at, at) === 0);\n    const others = (slot?.bins ?? []).filter(id => id !== bin).map(id => plan.bins.get(id)?.at).filter((when): when is Date => when !== undefined);\n    if (others.length === 0) return at;\n    const last = others.reduce((a, b) => compareDate(a, b) >= 0 ? a : b);\n    return new Date(last.getTime() + 60_000);\n}\n\nconst refused = (caption: string, refusal: Refusal, reason?: string): Verdict => ({ allowed: false, caption, warn: false, refusal, reason, pending: false, run: undefined });\nconst waiting: Verdict = { allowed: true, caption: \"checking fits…\", warn: false, refusal: undefined, pending: true, run: undefined };\nconst taken = (caption: string, run: () => boolean): Verdict => ({ allowed: true, caption, warn: false, refusal: undefined, pending: false, run });\n/** No drop here, and nothing to say: a resource's card over a resource row, or a Table arrival cell. */\nconst nowhere: Verdict = { allowed: false, caption: \"\", warn: false, refusal: undefined, pending: false, run: undefined };\n\n/**\n * The fit's answer to a question, as a verdict: refused when the fit gives\n * none (F3, F4), waiting while it is on its way — asked, when `asking`.\n */\nfunction answered(scene: DropScene, asked: Asked | undefined, word: string, asking: boolean, verdict: (answer: FitResult) => Verdict): Verdict {\n    if (asked === undefined) return refused(\"not on the board\", { word, text: `The ${one(scene.nouns.bin)} is no longer on the board.` });\n    if (scene.fit.error !== undefined) return refused(\"fits unavailable\", { word, text: `Fits couldn't be checked: ${scene.fit.error}.` });\n    const answer = scene.fit.answer(asked.ask, asked.of);\n    // Unanswered, it is asked: the fill's question is the reservation's own (A23).\n    if (answer === undefined) { if (asking) scene.fit.ask(asked.ask, asked.of); return waiting; }\n    return verdict(answer);\n}\n\n/** A fit's verdict for a placement on a resource, its caption and its refusal; `suffix` follows a fit's caption (the landing slot, A36). */\nfunction onResource(scene: DropScene, asked: Asked | undefined, code: string, resource: string, word: string, verb: string, run: () => boolean,\n    ranks: readonly string[], suffix: string, asking: boolean): Verdict {\n    return answered(scene, asked, word, asking, answer => {\n        const verdict: Fit | undefined = answer.resources.get(resource);\n        // A fit that gives a resource no verdict refuses it: the board decides none of its own (F4).\n        if (verdict === undefined) return refused(\"no verdict from the fit\", { word, text: `The fit gave no verdict for ${nameOf(scene, resource)}.` });\n        const name = nameOf(scene, resource);\n        if (verdict.type === \"refused\") return refused(verdict.value.reason, { word, text: `${code} can’t go into ${name}: ${verdict.value.reason}.` }, verdict.value.reason);\n        const rank = ranks.indexOf(resource);\n        const warn = verdict.value.warn.type === \"some\" ? verdict.value.warn.value : undefined;\n        return { allowed: true, caption: `${verb}${name}${rank >= 0 ? ` · #${rank + 1}` : \"\"}${warn === undefined ? \"\" : ` · ${warn}`}${suffix}`, warn: warn !== undefined,\n            refusal: undefined, reason: verdict.value.why, pending: false, run };\n    });\n}\n\n/**\n * A Library arrival's or a removed bin's verdict (§10): booked into a lane hour,\n * after any bins in it (A37); into a reservation, which the fit checks on its\n * resource (A38); onto a resource, at the day's first free slot (A36).\n */\nfunction bookVerdict(scene: DropScene, grip: Extract<LibraryGrip, { kind: \"arrival\" | \"removed\" }>, target: Exclude<Target, { kind: \"cell\" }>, ranks: readonly string[], asking: boolean): Verdict {\n    const code = codeOf(scene, grip);\n    const book = (lane: string, at: Date, resource: string | undefined) => grip.kind === \"arrival\"\n        ? scene.commands.book(grip.arrival, lane, at, resource) : scene.commands.restore(grip.bin, lane, at, resource);\n    if (target.kind === \"lane\") {\n        const card = target.card === undefined ? undefined : scene.plan.bins.get(target.card);\n        if (card !== undefined && card.arrival.type === \"none\") {\n            const reservation = target.card!;\n            const into = () => grip.kind === \"arrival\" ? scene.commands.fillWith(reservation, grip.arrival) : scene.commands.restoreInto(grip.bin, reservation);\n            const resource = [...card.parts.keys()][0];\n            if (resource === undefined) return taken(`to ${slotText(scene, card.lane, card.at)}`, into);\n            const of = grip.kind === \"arrival\" ? scene.without(reservation) : scene.restoring(grip.bin, reservation);\n            // The Table names the reserved row's slot, as its row reads (A33).\n            const verb = target.table === true ? `to ${slotText(scene, card.lane, card.at)} on ` : `into the ${one(scene.nouns.reservation)} on `;\n            return onResource(scene, askOf(scene, grip, of), code, resource, \"Not booked\", verb, into, [], \"\", asking);\n        }\n        const at = landing(scene.slots, scene.plan, target.lane, target.at, undefined);\n        return taken(`to ${slotText(scene, target.lane, at)}`, () => book(target.lane, at, undefined));\n    }\n    const land = scene.firstFree();\n    const resource = target.resource;\n    return onResource(scene, askOf(scene, grip), code, resource, \"Not booked\", \"to \", () => bookOnto(scene, grip, resource),\n        ranks, land === undefined ? \"\" : ` · ${slotText(scene, land.lane, land.at)}`, asking);\n}\n\n/**\n * Books a Library arrival, or a committed bin the drafts removed, onto a\n * resource at the day's first free slot of the lanes that show (A36): what a\n * drop on the resource runs, and a narrow card's `Book an arrival…` (A78).\n * With no slot left, nothing is booked and the banner says so.\n *\n * @param scene - What the board knows\n * @param grip - The arrival, or the removed bin\n * @param resource - The resource\n * @returns Whether it was booked\n */\nexport function bookOnto(scene: Pick<DropScene, \"context\" | \"plan\" | \"held\" | \"day\" | \"commands\" | \"firstFree\" | \"notice\" | \"nouns\">,\n    grip: Extract<LibraryGrip, { kind: \"arrival\" | \"removed\" }>, resource: string): boolean {\n    const land = scene.firstFree();\n    if (land !== undefined) {\n        return grip.kind === \"arrival\" ? scene.commands.book(grip.arrival, land.lane, land.at, resource) : scene.commands.restore(grip.bin, land.lane, land.at, resource);\n    }\n    scene.notice({ word: \"Not booked\", text: `No free ${one(scene.nouns.bin)} is left on ${formatDatePattern(\"ddd D\", scene.day)} for ${codeOf(scene, grip)}.` });\n    return false;\n}\n\n/**\n * A Library resource's verdict (§10, A32, A33): a bin it links, a reservation\n * it moves to it, a free lane hour or a free row it reserves — each as the\n * fit's take of it answers; a bin already on it, nothing.\n */\nfunction resourceVerdict(scene: DropScene, resource: string, target: Target, asking: boolean): Verdict {\n    const name = nameOf(scene, resource);\n    const asked = askOf(scene, { kind: \"resource\", resource });\n    const judged = (pick: (answer: FitResult) => Fit | undefined, word: string, text: (reason: string) => string, caption: string, run: () => boolean) =>\n        answered(scene, asked, word, asking, answer => {\n            const verdict = pick(answer);\n            if (verdict === undefined) return refused(\"no verdict from the fit\", { word, text: `The fit gave no verdict for ${name}.` });\n            if (verdict.type === \"refused\") return refused(verdict.value.reason, { word, text: text(verdict.value.reason) }, verdict.value.reason);\n            return { ...taken(caption, run), reason: verdict.value.why };\n        });\n    const onBin = (id: string): Verdict => {\n        const bin = scene.plan.bins.get(id);\n        if (bin === undefined) return refused(\"not on the board\", { word: \"Not allocated\", text: `The ${one(scene.nouns.bin)} is no longer on the board.` });\n        if (bin.parts.has(resource)) return taken(\"already on it\", () => false);\n        const reserved = bin.arrival.type === \"none\";\n        const code = codeOfBin(scene, id);\n        return judged(answer => answer.bins.get(id), \"Not allocated\", reason => `${reserved ? `The ${one(scene.nouns.reservation)}` : code} can’t go onto ${name}: ${reason}.`,\n            reserved ? `move the ${one(scene.nouns.reservation)} here` : `link ${code}`, () => scene.commands.link(id, resource, undefined));\n    };\n    const onSlot = (lane: string, at: Date): Verdict => judged(answer => answer.reserve.type === \"some\" ? answer.reserve.value : undefined, `Not ${lower(scene.nouns.reserved)}`,\n        reason => `${name} can’t take ${slotText(scene, lane, at)}: ${reason}.`, `reserve ${slotText(scene, lane, at)}`, () => scene.commands.reserve(lane, at, resource));\n    if (target.kind === \"resource\") return nowhere;\n    if (target.kind === \"cell\") {\n        const row = rowOfKey(target.row);\n        if (row === undefined) return nowhere;\n        return \"bin\" in row ? onBin(row.bin) : onSlot(row.lane, row.at);\n    }\n    // A Table row's arrival cell takes no resource (A32).\n    if (target.table === true) return nowhere;\n    if (target.card !== undefined) return onBin(target.card);\n    return onSlot(target.lane, landing(scene.slots, scene.plan, target.lane, target.at, undefined));\n}\n\n/**\n * A drop's verdict (see the module docs, §10).\n *\n * @param scene - What the board knows\n * @param grip - What is dragged\n * @param target - Where it rests\n * @param ranks - The three best fits, best first\n * @param asking - Whether an unanswered question is asked: never while the board renders\n * @returns The verdict\n */\nexport function verdictOf(scene: DropScene, grip: Grip, target: Target, ranks: readonly string[], asking = true): Verdict {\n    if (grip.kind === \"resource\") return resourceVerdict(scene, grip.resource, target, asking);\n    const code = codeOf(scene, grip);\n    const { lane, arrival, resource: noun } = scene.nouns;\n    // A Table row's resource cell takes a resource's drag only (A33).\n    if (target.kind === \"cell\") return refused(`drop on the ${one(arrival)} cell`, { word: \"Not booked\", text: `Drop ${code} on a row’s ${one(arrival)} cell to book it.` });\n    if (grip.kind === \"arrival\" || grip.kind === \"removed\") return bookVerdict(scene, grip, target, ranks, asking);\n    if (grip.kind === \"body\") {\n        if (target.kind === \"resource\") {\n            return refused(`${one(lane)} hours only · drag its connector to change the ${one(noun)}`,\n                { word: \"Not moved\", text: `${code} moves between ${one(lane)} hours only. To change its ${one(noun)}, drag its connector.` });\n        }\n        const card = target.card === undefined ? undefined : scene.plan.bins.get(target.card);\n        // A reservation: the bin fills it, if the fit takes the bin on the reservation's resource (A38).\n        if (card !== undefined && target.card !== grip.bin && card.arrival.type === \"none\") {\n            const resource = [...card.parts.keys()][0];\n            const reservation = target.card!;\n            if (resource === undefined) return taken(`to ${slotText(scene, card.lane, card.at)}`, () => scene.commands.fill(grip.bin, reservation));\n            // The Table names the reserved row's slot, as its row reads (A33).\n            const verb = target.table === true ? `to ${slotText(scene, card.lane, card.at)} on ` : `into the ${one(scene.nouns.reservation)} on `;\n            const of = scene.without(reservation);\n            return onResource(scene, askOf(scene, grip, of), code, resource, \"Not moved\", verb, () => scene.commands.fill(grip.bin, reservation), [], \"\", asking);\n        }\n        const bin = scene.plan.bins.get(grip.bin);\n        const at = landing(scene.slots, scene.plan, target.lane, target.at, grip.bin);\n        const home = bin !== undefined && bin.lane === target.lane && (scene.slots.find(s => s.lane === target.lane && compareDate(s.at, target.at) === 0)?.bins.includes(grip.bin) ?? false);\n        // Its own lane hour: nothing (A37).\n        return taken(`to ${slotText(scene, target.lane, home && bin !== undefined ? bin.at : at)}`, home ? () => false : () => scene.commands.move(grip.bin, target.lane, at));\n    }\n    if (target.kind === \"lane\") {\n        return refused(`drop on ${a(noun)}`, { word: \"Not allocated\", text: `To allocate ${code}, drop its link on ${a(noun)} row.` });\n    }\n    // A connector's or a link's drop on a resource links what it carries there; its current resource, nothing (A39).\n    const current = currentOf(scene.plan, grip);\n    if (grip.kind === \"link\" && current === target.resource) return taken(\"already on it\", () => false);\n    return onResource(scene, askOf(scene, grip), code, target.resource, \"Not allocated\", \"to \",\n        () => scene.commands.link(grip.bin, target.resource, grip.kind === \"link\" ? grip.resource : undefined), ranks, \"\", asking);\n}\n\n/** The target a cell's coordinate names. */\nexport function targetOfCoord(coord: CellCoord): Target | undefined {\n    return targetOf({ row: coord.row, slot: coord.slot, event: coord.event === undefined ? none : some(coord.event) });\n}\n\n/** The board's drags, as its parts read them. */\nexport interface AllocationDrag {\n    /** The board's one drag surface. */\n    surface: string;\n    /** The Library's lists: the sources of its drags. */\n    libraries: AllocationLibraries;\n    /** Whether the day takes drags: an editable day, and not the narrow layout. */\n    enabled: boolean;\n    /** What is being dragged, while a drag is under way. */\n    grip: Grip | undefined;\n    /** What the board shows the fit's verdicts for: the drag's grip, or, with none under way, the pick (A11). */\n    subject: Grip | undefined;\n    /** The subject's question of the fit: what the previews place, of which day (A28). */\n    asked: Asked | undefined;\n    /** The grip under a pointer-down: the fit is asked about it before the drag needs it (A23). */\n    arm: (grip: Grip) => void;\n    /** The fit's answer about the subject (A27–A29, A32). */\n    answer: FitResult | undefined;\n    /** Its three best fits, best first (A28). */\n    ranks: readonly string[];\n    /** A drop's verdict where a drag rests, kept for this drag, these drafts and this answer (A35); it asks the fit what it has not answered. */\n    verdict: (grip: Grip, target: Target) => Verdict;\n    /** The same verdict, asking nothing: what the board draws while it renders. */\n    peek: (grip: Grip, target: Target) => Verdict;\n    /** The grip a dragged payload carries, if it is the board's or a card of its Library's. */\n    gripOfPayload: (payload: DragPayload) => Grip | undefined;\n    /** The grip and the target a completed drag names. */\n    gripOfEvent: (event: DragEventValue) => Grip | undefined;\n    /** Where the drag rests, as its targets report it (`dropTarget`): what the board's marks and its links read. */\n    rest: DragRestStore;\n    /** A target's name, for what the drag layer says to a screen reader: as the board shows it, never its keys. */\n    name: (target: Target) => string;\n}\n\n/**\n * A drop target of the board's (A26) — a lane hour, a card, a resource row,\n * the fits marker, a Table cell, a fit in the inspector's drop list — as the\n * shared drag layer takes it: its veto and the ghost's caption, both the\n * board's one verdict for the target (§10), and where the drag rests told to\n * the board as it rests and as it leaves (`rest`). A fit in the drop list is\n * `{ kind: \"resource\", resource }` at `rowCoord(drag.surface, resource)`, as\n * its row is.\n *\n * @param drag - The board's drags\n * @param target - What the target is\n * @returns The veto and the options a `useDropCell` takes\n */\nexport function dropTarget(drag: AllocationDrag, target: Target): { veto: DropVeto; options: DropCellOptions } {\n    return {\n        veto: (candidate: DragEventValue) => { const grip = drag.gripOfEvent(candidate); return grip !== undefined && drag.verdict(grip, target).allowed; },\n        options: {\n            accepts: (payload: DragPayload) => drag.gripOfPayload(payload) !== undefined,\n            caption: (_coord: unknown, payload: DragPayload, allowed: boolean) => {\n                const grip = drag.gripOfPayload(payload);\n                if (grip === undefined) return undefined;\n                drag.rest.rest(target, allowed);\n                const verdict = drag.verdict(grip, target);\n                return { text: verdict.caption, warn: verdict.warn };\n            },\n            onLeave: () => drag.rest.leave(target),\n            name: () => drag.name(target),\n        },\n    };\n}\n\n/**\n * The board's drags (see the module docs): its one drag target, what is\n * dragged, and each drop's verdict.\n *\n * @param surface - The board's drag surface\n * @param enabled - Whether the day takes drags\n * @param scene - What the board knows\n * @param onRefuse - A refused drop's reason (A40), or `undefined` once a drop is taken\n * @param pick - The picked Library card, if any (A11): its fits show as a drag's do\n * @returns The drags\n */\nexport function useAllocationDrag(surface: string, enabled: boolean, scene: DropScene, onRefuse: (refusal: Refusal | undefined) => void, pick?: Grip): AllocationDrag {\n    const layer = useDragLayerOptional();\n    const libraries = useMemo(() => libraryIds(surface), [surface]);\n    const [armed, setArmed] = useState<Grip>();\n    const grip = layer?.active === true ? armed : undefined;\n    const subject = grip ?? (layer?.active === true ? undefined : pick);\n    // The questions the armed grip and the pick ask: asked as each is set, and again when the drafts change (A23, F1).\n    const { fit } = scene;\n    const armedAsk = armed === undefined || armed.kind === \"body\" ? undefined : askOf(scene, armed);\n    const pickAsk = pick === undefined ? undefined : askOf(scene, pick);\n    const armedKey = armed === undefined ? \"\" : gripKey(armed), pickKey = pick === undefined ? \"\" : gripKey(pick);\n    useEffect(() => { if (armedAsk !== undefined) fit.ask(armedAsk.ask, armedAsk.of); },\n        // The question stands for the armed grip and the drafts it reads.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [armedKey, scene.plan, fit.ask]);\n    useEffect(() => { if (pickAsk !== undefined) fit.ask(pickAsk.ask, pickAsk.of); },\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [pickKey, scene.plan, fit.ask]);\n    const asked = subject === undefined || subject.kind === \"body\" ? undefined : askOf(scene, subject);\n    const answer = asked === undefined ? undefined : fit.answer(asked.ask, asked.of);\n    const ranks = useMemo(() => subject === undefined ? [] : rankOf(answer, currentOf(scene.plan, subject)), [answer, subject, scene.plan]);\n    // Verdicts, kept for these drafts and this answer: pointer motion asks again, and nothing is recomputed (A35).\n    // What the verdicts read is the cache's key: a new key, a new cache.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    const kept = useMemo(() => new Map<string, Verdict>(), [scene.plan, scene.slots, answer, ranks, fit.error]);\n    const judge = (asking: boolean) => (g: Grip, target: Target): Verdict => {\n        const key = `${gripKey(g)}|${targetKey(target)}`;\n        const known = kept.get(key);\n        if (known !== undefined && !known.pending) return known;\n        const next = verdictOf(scene, g, target, ranks, asking);\n        kept.set(key, next);\n        return next;\n    };\n    const gripOfPayload = useMemo(() => (payload: DragPayload): Grip | undefined => {\n        if (payload.kind === \"item\") return libraryGripOf(libraries, payload.from);\n        if (payload.kind !== \"event\") return undefined;\n        return gripOf({ row: payload.from.row, slot: payload.from.slot, event: some(payload.from.event) });\n    }, [libraries]);\n    const gripOfEvent = useMemo(() => (event: DragEventValue): Grip | undefined => event.type === \"move\" ? gripOf(event.value.from)\n        : event.type === \"add\" ? libraryGripOf(libraries, event.value.from) : undefined, [libraries]);\n    // A drop that came before its answer waits for it, then runs or refuses (F2).\n    const deferred = useRef<{ grip: Grip; target: Target } | undefined>(undefined);\n    useEffect(() => {\n        const waiting = deferred.current;\n        if (waiting === undefined) return;\n        const settled = verdictOf(scene, waiting.grip, waiting.target, ranks);\n        if (settled.pending) return;\n        deferred.current = undefined;\n        if (!settled.allowed) onRefuse(settled.refusal);\n        else { onRefuse(undefined); settled.run?.(); }\n    });\n    // The drop, checked again through the command (A35).\n    const live = useRef({ scene, ranks, onRefuse });\n    live.current = { scene, ranks, onRefuse };\n    // What the drag layer says of a target to a screen reader, in its words for a cell, as the Roster and the Calendar say\n    // theirs: a lane hour — a free Table row's too — by its lane's name and its time, a resource's row and the fits marker by\n    // the resource's name, a bin's Table row by its arrival's code; never their keys.\n    const words = useDragMessages();\n    const name = useMemo(() => (target: Target): string => {\n        const now = live.current.scene;\n        const hour = (lane: string, at: Date) => words.cell({ row: now.laneLabel(lane), slot: formatDatePattern(\"HH:mm\", at) });\n        if (target.kind === \"lane\") return hour(target.lane, target.at);\n        if (target.kind === \"resource\") return words.cell({ row: nameOf(now, target.resource), slot: \"\" });\n        const row = rowOfKey(target.row);\n        if (row === undefined) return words.cell({ row: target.row, slot: \"\" });\n        return \"bin\" in row ? words.cell({ row: codeOfBin(now, row.bin), slot: \"\" }) : hour(row.lane, row.at);\n    }, [words]);\n    const config = useMemo((): DragTargetConfig => {\n        const targetOfEvent = (event: DragEventValue) => event.type === \"move\" ? targetOf(event.value.to) : event.type === \"add\" ? targetOf(event.value.into) : undefined;\n        return {\n            id: surface, sources: [libraries.arrivals, libraries.resources], kinds: { add: true, move: true, remove: false, resize: false, trash: false },\n            onDrag: (event: DragEventValue) => {\n                const g = gripOfEvent(event), target = targetOfEvent(event);\n                if (g === undefined || target === undefined) return false;\n                const now = live.current;\n                const drop = verdictOf(now.scene, g, target, now.ranks);\n                if (drop.pending) { deferred.current = { grip: g, target }; return true; }\n                if (!drop.allowed) { now.onRefuse(drop.refusal); return false; }\n                now.onRefuse(undefined);\n                return drop.run?.() ?? false;\n            },\n            // A drop a target's veto refused never reaches `onDrag`: its reason is the inspector's note all the same (A40).\n            onRefuse: (event: DragEventValue) => {\n                const g = gripOfEvent(event), target = targetOfEvent(event);\n                if (g === undefined || target === undefined) return;\n                const now = live.current;\n                const drop = verdictOf(now.scene, g, target, now.ranks);\n                if (!drop.allowed && !drop.pending && drop.refusal !== undefined) now.onRefuse(drop.refusal);\n            },\n        };\n    }, [surface, libraries, gripOfEvent]);\n    useDragTarget(enabled ? config : null);\n    // Where the drag rests: one store for the board's life, empty once no drag is under way.\n    const [rest] = useState(() => new DragRestStore());\n    useEffect(() => { if (grip === undefined) rest.clear(); }, [grip, rest]);\n    return { surface, libraries, enabled, grip, subject, asked, arm: setArmed, answer, ranks, verdict: judge(true), peek: judge(false), gripOfPayload, gripOfEvent, rest, name };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The board's one toolbar (§7, A1): the date, the layout, the day's status,\n * the narrowing's one rail over its bins, its lanes, its resources and its\n * arrivals, and each one's count, in both layouts (#1336, #1339) — the bins'\n * day the board's own navigation, never a chip of the rail (#1372) — the\n * issues chip, Search Records over the bins' keys (#1398), worded so — its box the first\n * thing the row folds, to its icon (ruled 25 Oct 2026) — the shared history\n * and Publish — each folding by its rank, the history last of the ladder, and\n * in the narrowest frame the date, the layout, Save and Publish reachable\n * through the combined View fold. Below the ladder the row's floor drops the\n * rail's caret, and then, with the app's optimiser, takes the Elara eye —\n * before the history item at every other width — into that View as its\n * entry, never out of the toolbar (ruled 27 Oct 2026, \"Into the View menu\").\n * The status, the issues and Publish keep their slots from cold load,\n * whatever the day's read (#1398, CL1): unread, the status and the issues are\n * placeholders, the issues slot empty at none, and Publish in its slot, off,\n * wherever it cannot publish.\n *\n * @packageDocumentation\n */\n\nimport { useState, type ReactElement } from \"react\";\nimport { Box, Button, Menu as ChakraMenu, chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCalendarDay, faChartGantt, faLink, faTable, faTriangleExclamation, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport type { SortedMap } from \"@elaraai/east\";\nimport {\n    ChipMenu, OPTIMISE_RANK, historyToolbarItem, useKeySearchToolbarItem, type EditIssue, type HistoryAction, type KeySearchSource, type ToolbarItem,\n} from \"@elaraai/east-ui-components\";\nimport { HOST_RANK, PlaceholderShape, coarseHitArea, useRecordSlicesToolbarItems } from \"@elaraai/east-ui-components/internal\";\nimport { useRailSources } from \"../shared/schedule/reference.js\";\nimport { SEARCH_BOX_RANK } from \"../shared/schedule/search-rank.js\";\nimport { Seg } from \"../shared/schedule/segments.js\";\nimport { TimeNavigator } from \"../shared/time/navigation.js\";\nimport type { AllocationCommands } from \"./actions.js\";\nimport type { AllocationEditing } from \"./editing.js\";\nimport type { AllocationWords } from \"./messages.js\";\nimport type { AllocationWindow } from \"./window.js\";\nimport { DAY, allocationWords, byWeek, type AllocationStyles, type AllocationValue, type Day, type Issue, type Load, type ResourceRow } from \"./model.js\";\nimport { counted, other, type Nouns } from \"./nouns.js\";\nimport { PickerDot, PickerLegend, StatusWords } from \"../shared/schedule/period-status.js\";\nimport { plural } from \"../shared/schedule/words.js\";\n\n/** Table, then Timeline, as the mock orders them. */\nconst LAYOUTS = [{ key: \"table\", label: \"Table\", icon: faTable }, { key: \"timeline\", label: \"Timeline\", icon: faChartGantt }] as const;\n\n/** The eye's step into the View and the View's step that draws its entry (ruled 27 Oct 2026, \"Into the View menu\"): one bundle, applied together. */\nconst EYE_INTO_VIEW = \"allocation.optimise\";\n\n/** The issues the chip, the Issues tab and the summary count: warning and danger, never neutral or info (A64). */\nexport function countedIssues(issues: readonly Issue[]): Issue[] {\n    return issues.filter(i => i.tone.type === \"warning\" || i.tone.type === \"danger\");\n}\n\n/**\n * What the counted issues are, each kind's count (A63, A81): the refusals holding Save first (#1525), `1 not saved\n * yet`, then `2 overlaps`, `1 over max`; the app's, `N more`.\n */\nexport function issueParts(issues: readonly Issue[], refused = 0): string[] {\n    const counted = countedIssues(issues);\n    const n = (kind: Issue[\"kind\"][\"type\"]) => counted.filter(i => i.kind.type === kind).length;\n    const custom = counted.filter(i => i.kind.type === \"custom\");\n    return [\n        refused > 0 ? `${refused} not saved yet` : \"\",\n        n(\"unlinked\") > 0 ? `${n(\"unlinked\")} not linked` : \"\",\n        n(\"unallocated\") > 0 ? `${n(\"unallocated\")} partly allocated` : \"\",\n        n(\"overlap\") > 0 ? plural(n(\"overlap\"), \"overlap\") : \"\",\n        n(\"over\") > 0 ? `${n(\"over\")} over max` : \"\",\n        n(\"under\") > 0 ? `${n(\"under\")} under min` : \"\",\n        custom.length > 0 ? `${custom.length} more` : \"\",\n    ].filter(p => p !== \"\");\n}\n\n/**\n * The issues the chip counts — warning and danger, never neutral or info\n * (A64), and the refusals holding Save (#1525) — and its words (A81): `2\n * overlaps · 1 over max · show them`, with `· warnings only, Save still works`\n * when every one is an under-min warning.\n */\nexport function issueSummary(issues: readonly Issue[], refused = 0): { count: number; label: string; tip: string; aria: string } {\n    const counted = countedIssues(issues);\n    const parts = issueParts(issues, refused);\n    const count = counted.length + refused;\n    const warningsOnly = refused === 0 && counted.length > 0 && counted.every(i => i.kind.type === \"under\");\n    return {\n        count, label: plural(count, \"issue\"),\n        tip: `${parts.join(\" · \")}${warningsOnly ? \" · warnings only, Save still works\" : \"\"} · show them`,\n        aria: `${plural(count, \"issue\")}, show them`,\n    };\n}\n\ninterface ToolbarArgs extends AllocationWindow {\n    value: AllocationValue;\n    styles: AllocationStyles;\n    commands: AllocationCommands;\n    /** The editing; `undefined` for a read-only board. */\n    editing: AllocationEditing | undefined;\n    /** The board's words: its message table, the editing session's among them, and the app's formatters. */\n    words: AllocationWords;\n    /** The day's status chip's words (A3) — its period's, the day's or its week's (#1550): Not started, Draft, Published, or the app's own case; `undefined` without periods. */\n    status: string | undefined;\n    /** Whether the day's period is published: its chip's tone, whatever its words. */\n    published: boolean;\n    /**\n     * Whether the day is not read yet (#1398, CL1): its status, its issues and Publish keep their slots, the status a\n     * placeholder — never \"Not started\" before its row is read — and the issues one too, each unseen at its footprint\n     * until the frame's reveal says so.\n     */\n    unread: boolean;\n    /** Whether Publish is under way. */\n    publishing: boolean;\n    /** The open picker's days' statuses, by day — each day of a week its week's (#1550): their marks, and each week's. */\n    picker: SortedMap<Date, Day[\"status\"]>;\n    issues: readonly Issue[];\n    onIssues: () => void;\n    /** How many refusals hold Save (#1525): the issues chip counts them with the counted issues. */\n    refused: number;\n    /** The history's warning button pressed: its first issue's bin shown and selected (#1525). */\n    onIssue: (issue: EditIssue) => void;\n    /** Where an issue of the history's is, in the board's words — its banners' — what the history item's conflicts name their items by. */\n    where?: ((issue: EditIssue) => string) | undefined;\n    /** A conflict's Go to: its item shown and selected. */\n    onConflict?: ((issue: EditIssue) => void) | undefined;\n    onAction: (action: HistoryAction) => void;\n    onPickerWeeks: (weeks: readonly Date[]) => void;\n    /** The focus (A13): its resource, its load, and whether the narrowing hides its row. */\n    focus: { resource: ResourceRow; load: Load; hidden: boolean } | undefined;\n    onClearFocus: () => void;\n    /** The board's nouns: what the narrowing's summary counts each source in, and what heads each source's fields, folded. */\n    nouns: Nouns;\n    /** Search Records over the bins' keys (#1398); `undefined` without a source of the bins to seek. */\n    search?: KeySearchSource | undefined;\n    /** The Elara eye (#1409): the run's toolbar item, listed immediately before the history item; `undefined` with no optimiser. */\n    optimise?: ToolbarItem | undefined;\n    /**\n     * The eye's entry (ruled 27 Oct 2026, \"Into the View menu\"): what the View lists in the eye's place, beside the issues,\n     * where the row's floor folds the eye into it; `undefined` with no eye.\n     */\n    optimiseEntry?: ReactElement | undefined;\n    /** Whether a run of the optimiser is out (#1409, R2): the history item stays, its actions locked. */\n    locked?: boolean | undefined;\n    /** Whether the issues chip flashes (#1409): a run's result landed, and its highlight is on. */\n    issuesFlash?: boolean | undefined;\n}\n\n/** The board's toolbar items: the shared Toolbar's, ranked around `HOST_RANK`. */\nexport function useAllocationToolbar(args: ToolbarArgs): ReadonlyArray<ToolbarItem | false | undefined> {\n    const { value, view, setView, styles, commands, words, issues, editing } = args;\n    const timeline = view.layout === \"timeline\";\n    // The layouts this board offers: its switch, in every form, only where there is a choice to make.\n    const layouts = LAYOUTS.filter(item => args.layouts.includes(item.key));\n    const switches = layouts.length > 1;\n    // The narrowing: one rail over the bins, the lanes, the resources and the arrivals, in both layouts, each source counted in the board's noun\n    // under the slot the app names it by (#1336, #1339); the bins' range is the board's own navigation, never a chip of the rail (#1372),\n    // and the reference record the check reads narrows nothing, so the rail leaves its source out (#1551).\n    const chrome = value.slice.type === \"some\" ? value.slice.value : undefined;\n    const bins = value.bin.kind;\n    const binRange = chrome?.slice.parts.find(part => part.source === bins.key)?.slice.config.range;\n    const railSources = useRailSources(chrome?.slice);\n    const rail = useRecordSlicesToolbarItems(railSources, {\n        nouns: { [bins.key]: `${bins.name.toLocaleLowerCase(words.locale)} events`, [value.bin.lanes]: other(args.nouns.lane),\n            [value.bin.parts]: other(args.nouns.resource), arrivals: other(args.nouns.arrival) },\n        ...(binRange?.type === \"some\" ? { excludeFields: [`${bins.key}.${binRange.value}`] } : {}),\n        ...(chrome === undefined ? {} : { affordances: chrome.affordances.map(a => a.type) }),\n        ...(chrome?.persist.type === \"some\" ? { persist: chrome.persist.value.type } : {}),\n    });\n    const chip = useRecipe({ key: \"chip\" });\n    // Search Records (#1398): primary-key navigation over the bins' record, at the row's end, its words saying so — `Search\n    // bins by key`. Its box is the first thing the row folds, to its icon, before the rail and the day's steps (ruled 25 Oct\n    // 2026); at the row's last step it goes into the View, beside the date and the controls.\n    const search = useKeySearchToolbarItem(args.search, { side: \"end\", rank: SEARCH_BOX_RANK, label: words.m.keySearch({ bins: other(value.labels.bin) }) });\n    const summary = issueSummary(issues, args.refused);\n    const status = args.publishing ? \"Publishing\" : args.status;\n    const unread = args.unread;\n    // Publish: only over periods, on a day that takes edits; its slot held wherever the board publishes and edits at all.\n    const canPublish = value.periods.type === \"some\" && commands.canEdit() && !args.publishing;\n    const heldPublish = value.periods.type === \"some\" && !value.settings.readOnly;\n    // The history: wherever the day takes edits, and wherever a draft of another day waits to be saved. A day not read yet\n    // keeps it as the last day read had it, so a read landing never shifts the toolbar nor folds it again (#1398, CL1).\n    const history = editing?.history;\n    const historyNow = history !== undefined && !value.settings.readOnly && (commands.canEdit() || args.locked === true || history.pending > 0 || history.status !== \"idle\");\n    const [historyHeld, setHistoryHeld] = useState(historyNow);\n    if (!unread && historyHeld !== historyNow) setHistoryHeld(historyNow);\n    const showHistory = history !== undefined && (historyNow || (unread && historyHeld));\n    const layout = (key: \"table\" | \"timeline\") => setView({ ...view, layout: key });\n    const layoutSeg = (name: string) => <Seg label=\"Layout\" scope=\"allocation\" name={name} items={layouts} active={view.layout} onPick={layout} />;\n    const focus = args.focus;\n    // The Elara eye (#1409) and its entry: at the row's floor the eye goes into the View, which lists it in its place\n    // (ruled 27 Oct 2026, \"Into the View menu\"); an eye with no entry keeps to the row.\n    const eye = args.optimise !== undefined && args.optimiseEntry !== undefined ? { item: args.optimise, entry: args.optimiseEntry } : undefined;\n    // The narrowest frame's one popover: the layout, the focus, the issues and Publish beside the date (A1) — and, at the row's\n    // floor, the eye's entry beside the issues. The focus's chip comes with them, so its Show all stays reachable on a phone,\n    // where no Esc is (A13, A78).\n    const controls = (withEye: boolean) => <Box css={styles.controls}>\n        {search?.forms[0]}\n        {switches && layoutSeg(\"compact-layout\")}\n        {timeline && focus !== undefined && focusChip(false)}\n        {value.inspector && summary.count > 0 && <Button size=\"xs\" variant=\"ghost\" onClick={args.onIssues}>{summary.label}</Button>}\n        {withEye && eye?.entry}\n        {heldPublish && <Button size=\"xs\" variant=\"solid\" disabled={!canPublish} loading={args.publishing} aria-label=\"Publish\" aria-busy={args.publishing ? true : undefined}\n            onClick={() => commands.publish()}>Publish</Button>}\n    </Box>;\n    const menu = <ChipMenu label=\"View\" icon={faCalendarDay} onSelect={key => {\n        if (key === \"table\" || key === \"timeline\") layout(key);\n        else if (key === \"previous\") args.step(-1); else if (key === \"next\") args.step(1);\n        else if (key === \"issues\") args.onIssues(); else if (key === \"publish\" && canPublish) commands.publish();\n    }}>\n        {layouts.map(item => <ChakraMenu.Item key={item.key} value={item.key}>{item.label}</ChakraMenu.Item>)}\n        <ChakraMenu.Separator /><ChakraMenu.Item value=\"previous\">Previous day</ChakraMenu.Item><ChakraMenu.Item value=\"next\">Next day</ChakraMenu.Item>\n        {value.inspector && summary.count > 0 && <ChakraMenu.Item value=\"issues\">{summary.label}</ChakraMenu.Item>}\n        {heldPublish && <><ChakraMenu.Separator /><ChakraMenu.Item value=\"publish\" disabled={!canPublish}>Publish</ChakraMenu.Item></>}\n    </ChipMenu>;\n    // The focus chip (A13, A81): `K-203 · 3 bins · 31 m³`, `· hidden by Filters` when its row is narrowed out; × or Esc clears it.\n    function focusChip(compact: boolean) {\n        if (focus === undefined) return null;\n        const unit = value.bin.unit.type === \"some\" ? value.bin.unit.value : \"\";\n        const meta = `${counted(Number(focus.load.bins), value.labels.bin)} · ${allocationWords().quantity(focus.load.fill, unit)}${focus.hidden ? \" · hidden by Filters\" : \"\"}`;\n        return <chakra.span css={chip({ tone: \"brand\" })} title=\"The focus: its links are drawn · Esc returns to all\" data-allocation-focus=\"\"\n            aria-label={`Focus ${focus.resource.label}, ${meta}`}>\n            <span data-chip-icon=\"\"><FontAwesomeIcon icon={faLink} /></span>\n            {!compact && <><span>{focus.resource.label}</span><span data-chip-meta=\"\">{meta}</span></>}\n            <chakra.button type=\"button\" css={styles.focusClear} aria-label=\"Show all\" title=\"Show all · Esc\" onClick={args.onClearFocus}><FontAwesomeIcon icon={faXmark} /></chakra.button>\n        </chakra.span>;\n    }\n    // The picker's marks: each day's status, its period's — and, publishing a week at a time (#1550), each week's too, the\n    // picker's weeks starting where the board's do.\n    const marker = (date: Date) => { const held = args.picker.get(date); return <PickerDot styles={styles} mark={held === undefined ? \"empty\" : held.type === \"other\" ? \"draft\" : held.type} />; };\n    const weekly = byWeek(value);\n    const legend = <PickerLegend styles={styles} scope=\"allocation\" />;\n    const navigation = (compact = false, combined = false, withEye = false) => <TimeNavigator scope=\"allocation\" date={view.date} period=\"day\"\n        sunday={value.settings.weekStart.type === \"sunday\"} onChange={date => setView({ ...view, date })} compact={compact} label={combined ? \"View\" : \"Choose plan day\"}\n        initialPanel=\"day\" onWeeks={args.onPickerWeeks} legend={legend} dayMarker={marker} {...(weekly ? { weekMarker: marker } : {})}\n        controls={combined ? controls(withEye) : undefined} />;\n    return [\n        ...rail,\n        // With no switch, nothing folds into the View, so no View to fold to.\n        switches && { key: \"allocation.layout\", side: \"start\", rank: HOST_RANK + 1, bundle: \"allocation.view\", forms: [layoutSeg(\"layout\"), null] },\n        switches && { key: \"allocation.view\", side: \"start\", rank: [HOST_RANK + 1, HOST_RANK + 6], bundle: [\"allocation.view\", \"allocation.controls\"], forms: [null, menu, null] },\n        // The day's navigation: compact, then the View holding the date and the controls; and, with an eye, at the row's\n        // floor the View holding its entry too, in the step that takes the eye from the row (a rung of the floor).\n        { key: \"allocation.navigation\", side: \"start\", rank: [HOST_RANK + 4, HOST_RANK + 6, OPTIMISE_RANK], bundle: [undefined, \"allocation.controls\", EYE_INTO_VIEW],\n            forms: [navigation(), navigation(true), navigation(true, true), ...(eye === undefined ? [] : [navigation(true, true, true)])] },\n        // Its icon, then — in the narrowest frame — into the View's popover with the controls (A1): a chip that cannot fold would run the row\n        // past its end at 294px.\n        timeline && focus !== undefined && { key: \"allocation.focus\", side: \"start\", rank: [HOST_RANK + 2, HOST_RANK + 6], bundle: [undefined, \"allocation.controls\"],\n            forms: [focusChip(false), focusChip(true), null] },\n        // The status, the issues and Publish keep their slots from cold load, whatever the day's read (#1398, CL1): a read\n        // landing never shifts the toolbar nor folds it again. Unread, the status and the issues are placeholders.\n        status !== undefined && { key: \"allocation.status\", side: \"start\", rank: HOST_RANK, forms: [<Box css={styles.widestSlot}>\n            <StatusWords styles={styles} status={status} />\n            {unread\n                ? <Box css={[styles.status, styles.heldSlot]} data-allocation-status=\"\" data-pending=\"\" title=\"Plan status\">\n                    <PlaceholderShape kind=\"enum\" index={0} /></Box>\n                : <Box css={styles.status} data-tone={args.published && !args.publishing ? \"success\" : \"neutral\"} data-allocation-status=\"\" title=\"Plan status\">{status}</Box>}\n        </Box>, null] },\n        // The issues' slot is as wide as a count of two figures, at any count or none (#1595).\n        value.inspector && { key: \"allocation.issues\", side: \"end\", rank: HOST_RANK + 3, forms: [<Box css={styles.widestSlot} data-end=\"\">\n            <chakra.span css={chip({ tone: \"warn\" })} data-widest-word={plural(99, \"issue\")} aria-hidden=\"true\"><FontAwesomeIcon icon={faTriangleExclamation} /></chakra.span>\n            {unread\n                ? <Box css={styles.heldSlot} data-allocation-issues=\"\" data-pending=\"\"><PlaceholderShape kind=\"count\" index={0} /></Box>\n                : summary.count > 0 ? <chakra.button type=\"button\" css={[chip({ tone: \"warn\" }), coarseHitArea({ position: true })]} onClick={args.onIssues}\n                    aria-label={summary.aria} title={summary.tip} data-allocation-issues=\"\" data-opn={args.issuesFlash === true ? \"\" : undefined}>\n                    <FontAwesomeIcon icon={faTriangleExclamation} /><span data-chip-label=\"\">{summary.label}</span>\n                </chakra.button>\n                    : <Box css={styles.heldSlot} data-allocation-issues=\"\" aria-hidden=\"true\" />}\n        </Box>, null] },\n        search !== undefined && { ...search, forms: [...search.forms, null], rank: [SEARCH_BOX_RANK, HOST_RANK + 6], bundle: [undefined, \"allocation.controls\"] },\n        // The Elara eye (#1409), immediately before the history item, whose actions a run out locks (R2): in the row at every\n        // width the ladder and the rail's caret leave it room, and else the View's entry, never out of the toolbar.\n        eye === undefined ? args.optimise : { ...eye.item, forms: [...eye.item.forms, null], rank: OPTIMISE_RANK, bundle: EYE_INTO_VIEW },\n        showHistory && historyToolbarItem({ session: history, words, editing: false, showError: false, onIssue: args.onIssue, onConflict: args.onConflict, where: args.where, onAction: args.onAction, locked: args.locked === true }),\n        // As tall as every control in the row (`sm`, 28px, ruled 23 Oct 2026), its slot held while the day can't publish, and\n        // its spinner while it publishes, until every record reads back as saved (#1573) — named as it is, `aria-busy`: the\n        // spinner hides its words.\n        heldPublish && { key: \"allocation.publish\", side: \"end\", rank: HOST_RANK + 5, forms: [<Button size=\"sm\" variant=\"solid\" disabled={!canPublish} loading={args.publishing}\n            aria-label=\"Publish\" aria-busy={args.publishing ? true : undefined} onClick={() => commands.publish()}>Publish</Button>, null] },\n    ];\n}\n\n/** The days of the picker's open month, from the weeks it shows. */\nexport function pickerDays(weeks: readonly Date[]): Date[] {\n    return weeks.flatMap(week => Array.from({ length: 7 }, (_, i) => new Date(week.getTime() + i * DAY)));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Inspector's words and figures (`Allocation Spec.md` §9.8, A55–A64, A85,\n * A86, A89), pure: a bin's, a reservation's, a slot's and a resource's status,\n * its banners and its facts, the summary's counts, the issues' groups and the\n * drop list's head — each from e3-ui's figures (the loads, the lines, the\n * checks) or the fit's answer, in the mock's words and the board's nouns. The\n * renderer computes no figure of its own.\n *\n * @packageDocumentation\n */\n\nimport type { SortedMap, option } from \"@elaraai/east\";\nimport { formatDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport { rankOf, type Grip, type LibraryGrip } from \"./drag.js\";\nimport { compareDate, compareFloat, compareString, partsOf, type Bin, type Context, type Day, type Fit, type FitResult, type Issue, type Load,\n    type ResourceLine, type ResourceRow, type Slot, type TimeStep } from \"./model.js\";\nimport { DEFAULT_NOUNS, a, counted, lower, one, other, type Noun, type Nouns } from \"./nouns.js\";\nimport { countedIssues, issueParts } from \"./toolbar.js\";\n\n/** A day, in milliseconds. */\nconst DAY_MS = 86_400_000;\n/** A pending answer's line: the fit has not said yet (F2). */\nexport const CHECKING = \"checking fits…\";\n\n/** The words the inspector is written with. */\nexport interface InspectorWords {\n    nouns: Nouns;\n    /** A quantity with the board's unit (`21 m³`), and a number without it. */\n    quantity: (value: number) => string;\n    number: (value: number) => string;\n    /** A lane's label. */\n    lane: (key: string) => string;\n    /** A resource's load, naming the limit it breaks (A19): e3-ui's. */\n    load: (fill: number, resource: ResourceRow) => string;\n}\n\n/** A head's status (A56, A60–A62): its word and tone, a draft's ring, and a draft's chip. */\nexport interface InspectorStatus {\n    word: string;\n    tone: \"neutral\" | \"success\" | \"warning\" | \"info\";\n    ring: boolean;\n    pending: \"new\" | \"pending\" | undefined;\n}\n\nconst dayText = (at: Date) => formatDatePattern(\"ddd D\", at);\nconst timeText = (at: Date) => formatDatePattern(\"HH:mm\", at);\n/** The last day a span holds, the day before its end: a job ending at Sat 8's start was released Fri 7. */\nconst lastDay = (to: Date) => dayText(new Date(to.getTime() - 1));\n/** A duration's unit, as a hold's length says it (`8-day hold`) and as a step says it (`± 1 h`). */\nconst HOLD_UNIT = { minutes: \"minute\", hours: \"hour\", days: \"day\", weeks: \"week\", months: \"month\" } as const;\nconst STEP_UNIT = { minutes: \"min\", hours: \"h\", days: \"d\", weeks: \"wk\", months: \"mo\" } as const;\n\n/** An arrival's code: its label, else its key. */\nexport function codeOf(context: Context, arrival: string): string {\n    return context.arrivals.get(arrival)?.label ?? arrival;\n}\n\n/** A bin's code: its arrival's, or the board's `Reserved` for a reservation (A16). */\nexport function binCode(context: Context, bin: Bin, nouns: Nouns): string {\n    return bin.arrival.type === \"some\" ? codeOf(context, bin.arrival.value) : nouns.reserved;\n}\n\n/** A resource's name. */\nconst nameOf = (context: Context, key: string) => context.resources.get(key)?.label ?? key;\n\n/** Whether two bins are on the same resources, whatever each holds there: a link the draft changed is a change of these. */\nfunction sameResources(a: Bin[\"parts\"], b: Bin[\"parts\"]): boolean {\n    const x = [...a.keys()], y = [...b.keys()];\n    return x.length === y.length && x.every((key, i) => key === y[i]);\n}\n\n/**\n * A bin's status (A56): what its draft changed — `Added`, `Moved`,\n * `Allocated` (its resources), `Edited · unsaved` (anything else: its\n * quantity, its row's own fields), and with no resource `Not linked · unsaved`, as the\n * mock's — else `Not linked`, `Check` (a resource of it over max or held into\n * its next job) or `Committed`.\n *\n * @param bin - The bin as drafted\n * @param committed - The bin as the day holds it; `undefined` for a new one\n * @param sameBin - Whether two bins are the same\n * @param lines - The lines of the resources it is on\n * @param nouns - The board's words\n * @returns Its status\n */\nexport function binStatus(bin: Bin, committed: Bin | undefined, sameBin: (a: Bin, b: Bin) => boolean, lines: readonly ResourceLine[], nouns: Nouns = DEFAULT_NOUNS): InspectorStatus {\n    const linked = bin.parts.size > 0;\n    if (committed === undefined || !sameBin(committed, bin)) {\n        const word = !linked ? \"Not linked · unsaved\" : committed === undefined ? \"Added · unsaved\"\n            : committed.lane !== bin.lane || compareDate(committed.at, bin.at) !== 0 ? \"Moved · unsaved\"\n                : !sameResources(committed.parts, bin.parts) ? `${nouns.groups.allocated} · unsaved` : \"Edited · unsaved\";\n        return { word, tone: \"neutral\", ring: true, pending: committed === undefined ? \"new\" : \"pending\" };\n    }\n    if (!linked) return { word: \"Not linked\", tone: \"warning\", ring: false, pending: undefined };\n    if (lines.some(line => line.over || line.overlap)) return { word: \"Check\", tone: \"warning\", ring: false, pending: undefined };\n    return { word: \"Committed\", tone: \"success\", ring: false, pending: undefined };\n}\n\n/** A reservation's status (A61): `Reserved`, or what its draft did, `Added · unsaved`, `Moved · unsaved`. */\nexport function reservationStatus(bin: Bin, committed: Bin | undefined, sameBin: (a: Bin, b: Bin) => boolean, nouns: Nouns = DEFAULT_NOUNS): InspectorStatus {\n    if (committed === undefined) return { word: \"Added · unsaved\", tone: \"neutral\", ring: true, pending: \"new\" };\n    if (!sameBin(committed, bin)) return { word: \"Moved · unsaved\", tone: \"neutral\", ring: true, pending: \"pending\" };\n    return { word: nouns.reserved, tone: \"info\", ring: false, pending: undefined };\n}\n\n/** A resource's status (A62): `Check` over max or held into its next job, else `Loading`, `Busy` or `Free`, as its load is. */\nexport function resourceStatus(load: Load, line: ResourceLine): InspectorStatus {\n    if (line.over || line.overlap) return { word: \"Check\", tone: \"warning\", ring: false, pending: undefined };\n    if (load.state.type === \"loading\") return { word: \"Loading\", tone: \"info\", ring: false, pending: undefined };\n    if (load.state.type === \"busy\") return { word: \"Busy\", tone: \"neutral\", ring: false, pending: undefined };\n    return { word: \"Free\", tone: \"success\", ring: false, pending: undefined };\n}\n\n/** One issue's banner (A56, A62): the shared banner's status, its word and its sentence. */\nexport interface InspectorBanner { status: \"warning\" | \"error\"; title: string; text: string }\n\n/** A resource as a bin's or its own inspector reads it: its row, its load and its line. */\nexport interface ResourceAt { row: ResourceRow; load: Load; line: ResourceLine }\n\n/**\n * The banners of what is inspected (A56, A62): a banner per counted issue —\n * warning or danger — about the bin (`Not linked`, `Partly allocated`, the\n * app's), then about each resource it is on, or the resource inspected (`Over\n * max`, `Under min`, `Overlaps the next job`, the app's); the built-in ones in\n * the mock's sentences, the app's its title's kind and its detail.\n *\n * @param args - The issues, the bin if one is inspected, its resources, the plan day and the words\n * @returns The banners, in order\n */\nexport function bannersOf(args: { issues: readonly Issue[]; bin?: { id: string; code: string } | undefined; resources: readonly ResourceAt[]; day: Date; words: InspectorWords }): InspectorBanner[] {\n    const { bin, resources, day, words } = args;\n    const { nouns } = words;\n    const issues = countedIssues(args.issues);\n    const status = (issue: Issue) => issue.tone.type === \"danger\" ? \"error\" as const : \"warning\" as const;\n    const taken = new Set<Issue>();\n    const out: InspectorBanner[] = [];\n    // Any other: its kind's name and its detail.\n    const plain = (issue: Issue) => out.push({ status: status(issue), title: kindLabel(issue), text: issue.detail });\n    if (bin !== undefined) {\n        const about = issues.filter(i => i.bin.type === \"some\" && i.bin.value === bin.id);\n        for (const issue of about) {\n            taken.add(issue);\n            if (issue.kind.type === \"unlinked\") {\n                out.push({ status: status(issue), title: \"Not linked\", text: `${bin.code} has no ${one(nouns.resource)}. Link it to a gap that fits, or it stays unplaced.` });\n            } else plain(issue);\n        }\n    }\n    for (const { row, load, line } of resources) {\n        const about = issues.filter(i => !taken.has(i) && i.resource.type === \"some\" && i.resource.value === row.key);\n        const fill = Math.round(load.fill);\n        const hold = load.hold.type === \"some\" ? load.hold.value : undefined;\n        for (const kind of [\"over\", \"under\", \"overlap\"] as const) {\n            for (const issue of about.filter(i => i.kind.type === kind)) {\n                if (kind === \"over\") {\n                    out.push({ status: status(issue), title: \"Over max\",\n                        text: `${row.label} holds ${words.quantity(fill)} against a ${words.quantity(row.max)} max · ${words.quantity(fill - row.max)} over.` });\n                } else if (kind === \"under\") {\n                    out.push({ status: status(issue), title: \"Under min\",\n                        text: `${row.label} holds ${words.quantity(fill)} against a ${words.quantity(row.min)} minimum · ${words.quantity(row.min - fill)} short. Another ${one(nouns.arrival)} can top it up; Save still works.` });\n                } else if (hold !== undefined && line.next.type === \"some\") {\n                    const next = line.next.value;\n                    const days = (hold.to.getTime() - day.getTime()) / DAY_MS, into = (hold.to.getTime() - next.start.getTime()) / DAY_MS;\n                    out.push({ status: status(issue), title: \"Overlaps the next job\",\n                        text: `The ${words.number(days)}-day ${lower(nouns.hold)} on ${row.label} runs to ${lastDay(hold.to)}, ${words.number(into)} d into the job planned ${dayText(next.start)}.` });\n                } else out.push({ status: status(issue), title: \"Overlaps the next job\", text: issue.detail });\n                taken.add(issue);\n            }\n        }\n        for (const issue of about.filter(i => !taken.has(i))) { taken.add(issue); plain(issue); }\n    }\n    return out;\n}\n\n/** A resource's facts on `88px 1fr` (A58, A62): what held it before, its hold, and its next fill. */\nexport interface ResourceFacts {\n    before: string;\n    /** Its hold today; `absent` when it holds nothing and is not busy (`not started`). */\n    hold: { text: string; absent: boolean };\n    /** Its next fill; `warn` when its hold runs into it. */\n    next: { text: string; warn: boolean };\n}\n\n/**\n * A resource's facts (A58, A62), which the inspector labels in the app's words — its prior job, its hold and its next\n * job: the job before (`job C-3142 · released Fri 7`, or `empty in the plan`), the hold (`Tue 11 to Tue 18 · 8 d`;\n * `busy until Fri 14`, or `not started`), the next job (`Mon 17 · hold overlaps it by 2 d`, `Wed 19 · 1 d spare`,\n * with the resource's note, or `none planned to Thu 20`).\n *\n * @param at - The resource, its load and its line\n * @param day - The plan day\n * @param horizonEnd - The end of the Timeline's resource axis: what `none planned to` names\n * @param words - The words\n * @returns Its facts\n */\nexport function factsOf({ row, load, line }: ResourceAt, day: Date, horizonEnd: Date, words: InspectorWords): ResourceFacts {\n    // What held it before: the job that started on or before the day and ended last.\n    let prior: ResourceRow[\"jobs\"][number] | undefined;\n    for (const job of row.jobs) {\n        if (compareDate(job.start, day) <= 0 && (prior === undefined || compareDate(job.end, prior.end) > 0)) prior = job;\n    }\n    const before = prior === undefined ? \"empty in the plan\" : `job ${prior.label} · released ${lastDay(prior.end)}`;\n    const span = load.hold.type === \"some\" ? load.hold.value : undefined;\n    const hold = span !== undefined\n        ? { text: `${dayText(day)} to ${lastDay(span.to)} · ${words.number((span.to.getTime() - day.getTime()) / DAY_MS)} d`, absent: false }\n        : load.state.type === \"busy\" ? { text: line.text, absent: false } : { text: \"not started\", absent: true };\n    let next: ResourceFacts[\"next\"];\n    if (line.next.type === \"some\") {\n        const job = line.next.value;\n        const after = span === undefined ? \"\"\n            : line.overlap ? ` · ${lower(words.nouns.hold)} overlaps it by ${words.number((span.to.getTime() - job.start.getTime()) / DAY_MS)} d`\n                : ` · ${words.number((job.start.getTime() - span.to.getTime()) / DAY_MS)} d spare`;\n        next = { text: `${dayText(job.start)}${after}${row.note.type === \"some\" ? ` · ${row.note.value}` : \"\"}`, warn: line.overlap };\n    } else next = { text: `none planned to ${lastDay(horizonEnd)}`, warn: false };\n    return { before, hold, next };\n}\n\n/** A resource's group line (A58, A62): `Hall B · min 20 m³ · max 40 m³`. */\nexport function groupLine(row: ResourceRow, words: InspectorWords): string {\n    return [row.group.type === \"some\" ? row.group.value : \"\", `min ${words.quantity(row.min)}`, `max ${words.quantity(row.max)}`].filter(p => p !== \"\").join(\" · \");\n}\n\n/** A resource's batch line (A58): `Batched · 3 bins · 31 m³`, or `One bin fills it.` */\nexport function batchLine(load: Load, words: InspectorWords): string {\n    const bins = Number(load.bins);\n    return bins > 1 ? `Batched · ${counted(bins, words.nouns.bin)} · ${words.quantity(Math.round(load.fill))}` : `One ${one(words.nouns.bin)} fills it.`;\n}\n\n/** A bin on a resource today (A58, A62): its time, lane, code and what it puts there, and its tooltip. */\nexport interface Mate { id: string; time: string; lane: string; code: string; quantity: string; tip: string }\n\n/**\n * A resource's bins today, by time (A58, A62): each its part there, a\n * reservation's `reserved`; its tooltip `Bin 3113 · …` (`Bin new` for a new one).\n *\n * @param plan - The day as drafted\n * @param held - The day as the record holds it\n * @param resource - The resource\n * @param context - Every arrival and resource\n * @param words - The words\n * @returns Its bins\n */\nexport function matesOf(plan: Day, held: Day | undefined, resource: string, context: Context, words: InspectorWords): Mate[] {\n    return [...plan.bins].filter(([, bin]) => bin.parts.has(resource))\n        .sort(([x, a], [y, b]) => compareDate(a.at, b.at) || compareString(x, y))\n        .map(([id, bin]) => {\n            const meta = bin.arrival.type === \"some\" ? context.arrivals.get(bin.arrival.value)?.meta : undefined;\n            return {\n                id, time: timeText(bin.at), lane: words.lane(bin.lane), code: binCode(context, bin, words.nouns),\n                quantity: bin.arrival.type === \"none\" ? lower(words.nouns.reserved) : words.quantity(bin.parts.get(resource)!),\n                tip: `${words.nouns.bin.one} ${held?.bins.has(id) === true ? id : \"new\"}${meta?.type === \"some\" ? ` · ${meta.value}` : \"\"}`,\n            };\n        });\n}\n\n/**\n * A draft's `was` line (A59, A61): `was K-108 · B-2 10:35`, `was not linked ·\n * B-2 10:35`, or `new booking · not in the plan yet`.\n *\n * @param committed - The bin as the day holds it; `undefined` for a new one\n * @param context - Every resource\n * @param words - The words\n * @returns The line\n */\nexport function wasLine(committed: Bin | undefined, context: Context, words: InspectorWords): string {\n    if (committed === undefined) return \"new booking · not in the plan yet\";\n    const first = partsOf(committed)[0];\n    return `was ${first === undefined ? \"not linked\" : nameOf(context, first.key)} · ${words.lane(committed.lane)} ${timeText(committed.at)}`;\n}\n\n/**\n * The Bin time stepper's help (A57): `B-1 bins at :15 · ± 1 h, 00–23 on Tue\n * 11` — the lane's offset, its step, its first and last slot's hours and the\n * plan day.\n *\n * @param slots - The lane's slots, in time order\n * @param lane - The lane's key\n * @param every - The slot spacing\n * @param day - The plan day\n * @param words - The words\n * @returns The help line\n */\nexport function stepHelp(slots: readonly Slot[], lane: string, every: TimeStep, day: Date, words: InspectorWords): string {\n    const first = slots[0]?.at, last = slots[slots.length - 1]?.at;\n    if (first === undefined || last === undefined) return \"\";\n    return `${words.lane(lane)} ${other(words.nouns.bin)} at :${formatDatePattern(\"mm\", first)} · ± ${words.number(every.value)} ${STEP_UNIT[every.type]}, `\n        + `${formatDatePattern(\"HH\", first)}–${formatDatePattern(\"HH\", last)} on ${dayText(day)}`;\n}\n\n/** One booking a free slot or a reservation offers (A60, A61): an arrival to book, or a committed bin the drafts removed. */\nexport interface BookOption {\n    key: string;\n    grip: Extract<LibraryGrip, { kind: \"arrival\" | \"removed\" }>;\n    code: string;\n    quantity: string;\n    /** Its line: its meta, and `overdue` (in warn) or `removed from plan`. */\n    line: string;\n    warn: boolean;\n}\n\n/**\n * What a free slot or a reservation can book (A60, A61), as the Library lists\n * them (A51): the arrivals still to book, overdue first, then the committed\n * bins the drafts removed — of the arrivals the narrowing shows (A99).\n *\n * @param args - The day as drafted and as the record holds it, every arrival, the plan day, the arrivals shown and the words\n * @returns The bookings, in order\n */\nexport function bookOptions(args: { plan: Day; held: Day | undefined; context: Context; day: Date; shown: option<ReadonlySet<string>>; words: InspectorWords }): BookOption[] {\n    const { plan, held, context, day, shown, words } = args;\n    const shows = (key: string) => shown.type === \"none\" || shown.value.has(key);\n    const booked = new Set<string>();\n    for (const [, bin] of plan.bins) if (bin.arrival.type === \"some\") booked.add(bin.arrival.value);\n    const removed = [...(held?.bins ?? [])].filter(([id, bin]) => bin.arrival.type === \"some\" && !plan.bins.has(id));\n    const removedArrivals = new Set(removed.map(([, bin]) => bin.arrival.type === \"some\" ? bin.arrival.value : \"\"));\n    const overdue = (key: string) => { const due = context.arrivals.get(key)?.due; return due?.type === \"some\" && compareDate(due.value, day) < 0; };\n    const toBook = [...context.arrivals.keys()].filter(key => !booked.has(key) && !removedArrivals.has(key) && shows(key));\n    const out: BookOption[] = [];\n    for (const late of [true, false]) {\n        for (const key of toBook.filter(k => overdue(k) === late)) {\n            const arrival = context.arrivals.get(key)!;\n            out.push({ key: `arrival:${key}`, grip: { kind: \"arrival\", arrival: key }, code: arrival.label, quantity: words.quantity(arrival.quantity),\n                line: [arrival.meta.type === \"some\" ? arrival.meta.value : \"\", late ? lower(words.nouns.groups.overdue) : \"\"].filter(p => p !== \"\").join(\" · \"), warn: late });\n        }\n    }\n    for (const [id, bin] of removed) {\n        const key = bin.arrival.type === \"some\" ? bin.arrival.value : \"\";\n        if (!shows(key)) continue;\n        const meta = context.arrivals.get(key)?.meta;\n        out.push({ key: `removed:${id}`, grip: { kind: \"removed\", bin: id }, code: codeOf(context, key), quantity: words.quantity(bin.quantity),\n            line: [meta?.type === \"some\" ? meta.value : \"\", lower(words.nouns.groups.removed)].filter(p => p !== \"\").join(\" · \"), warn: false });\n    }\n    return out;\n}\n\n/** A verdict as a booking's line says it (A61): the fit's reason; refused, `doesn’t fit · …` in warn and Book off; pending, `checking fits…`. */\nexport function verdictLine(verdict: Fit | undefined): { line: string; warn: boolean; enabled: boolean } {\n    if (verdict === undefined) return { line: CHECKING, warn: false, enabled: false };\n    return verdict.type === \"fits\" ? { line: verdict.value.why, warn: false, enabled: true } : { line: `doesn’t fit · ${verdict.value.reason}`, warn: true, enabled: false };\n}\n\n/** One fit a list ranks (A34, A59): its resource, its rank and the fit's reason. */\nexport interface RankedFit { key: string; rank: number; name: string; why: string }\n\n/**\n * The fits an answer ranks, in the order given, each its reason (A34, A59).\n *\n * @param answer - The fit's answer\n * @param keys - The resources, best first\n * @param context - Every resource\n * @returns The ranked fits\n */\nexport function rankedFits(answer: FitResult | undefined, keys: readonly string[], context: Context): RankedFit[] {\n    return keys.flatMap((key, i) => {\n        const fit = answer?.resources.get(key);\n        return fit?.type === \"fits\" ? [{ key, rank: i + 1, name: nameOf(context, key), why: fit.value.why }] : [];\n    });\n}\n\n/** The three best other fits of a bin's question, its current resource excepted (A59); `undefined` while the answer is on its way. */\nexport function alternativesOf(answer: FitResult | undefined, current: string | undefined, context: Context): RankedFit[] | undefined {\n    return answer === undefined ? undefined : rankedFits(answer, rankOf(answer, current), context);\n}\n\n/** One reservation a free slot offers (A60): its resource, what it takes, and the fit's reason after `free` or `loading`. */\nexport interface ReserveOption { key: string; name: string; range: string; line: string }\n\n/**\n * The five best resources to reserve a free slot on (A60): the fit's answer\n * to a reservation in the slot, the free ones first, each best first — of the\n * resources the narrowing shows (A94).\n *\n * @param answer - The fit's answer to placing a reservation in the slot; `undefined` while it is on its way\n * @param loads - Every resource's load\n * @param context - Every resource\n * @param shown - The resources the narrowing shows\n * @param words - The words\n * @returns The options, or `undefined` while the answer is on its way\n */\nexport function reserveOptions(answer: FitResult | undefined, loads: SortedMap<string, Load>, context: Context, shown: option<ReadonlySet<string>>,\n    words: InspectorWords): ReserveOption[] | undefined {\n    if (answer === undefined) return undefined;\n    const fits = [...answer.resources].flatMap(([key, fit]) => fit.type === \"fits\" && context.resources.has(key) && (shown.type === \"none\" || shown.value.has(key))\n        ? [{ key, fit: fit.value, loading: Number(loads.get(key)?.bins ?? 0n) > 0 }] : []);\n    fits.sort((x, y) => Number(x.loading) - Number(y.loading) || compareFloat(y.fit.score, x.fit.score) || compareString(x.key, y.key));\n    return fits.slice(0, 5).map(({ key, fit, loading }) => {\n        const row = context.resources.get(key)!;\n        return { key, name: row.label, range: `${words.number(row.min)}–${words.quantity(row.max)}`, line: `${loading ? \"loading\" : \"free\"} · ${fit.why}` };\n    });\n}\n\n/** One of the summary's counts (A63): its label, its value, its line, and the value's tone. */\nexport interface SummaryStat { key: string; label: string; value: string; sub: string; tone: \"warning\" | \"brand\" | undefined }\n\n/**\n * The summary's four counts (A63): Bins (`26`, `556 m³ · 0 reserved`), Loading\n * (`21 of 33`, `10 free · 2 busy`), Issues (`3`, `2 overlaps · 1 over max`, or\n * `none`), the refusals holding Save among them (#1525), and Changes (`0`,\n * `all saved`, or `N`, `unsaved · Save is in the toolbar`).\n *\n * @param args - The day as drafted and as the record holds it, every load, every issue, how many refusals hold Save, and the words\n * @returns The counts, in order\n */\nexport function summaryStats(args: { plan: Day; held: Day | undefined; sameBin: (a: Bin, b: Bin) => boolean; loads: SortedMap<string, Load>; issues: readonly Issue[]; refused?: number; words: InspectorWords }): SummaryStat[] {\n    const { plan, held, sameBin, loads, issues, refused = 0, words } = args;\n    const bins = [...plan.bins.values()];\n    const booked = bins.filter(bin => bin.arrival.type === \"some\");\n    const states = [...loads.values()].map(load => load.state.type);\n    const count = (state: Load[\"state\"][\"type\"]) => states.filter(s => s === state).length;\n    const issueCount = countedIssues(issues).length + refused;\n    let drafts = 0;\n    for (const [id, bin] of plan.bins) { const was = held?.bins.get(id); if (was === undefined || !sameBin(was, bin)) drafts++; }\n    for (const [id] of held?.bins ?? []) if (!plan.bins.has(id)) drafts++;\n    return [\n        { key: \"bins\", label: words.nouns.bin.other, value: `${booked.length}`, sub: `${words.quantity(Math.round(booked.reduce((n, bin) => n + bin.quantity, 0)))} · ${bins.length - booked.length} ${lower(words.nouns.reserved)}`, tone: undefined },\n        { key: \"loading\", label: \"Loading\", value: `${count(\"loading\")} of ${states.length}`, sub: `${count(\"free\")} free · ${count(\"busy\")} busy`, tone: undefined },\n        { key: \"issues\", label: \"Issues\", value: `${issueCount}`, sub: issueCount > 0 ? issueParts(issues, refused).join(\" · \") : \"none\", tone: issueCount > 0 ? \"warning\" : undefined },\n        { key: \"changes\", label: \"Changes\", value: `${drafts}`, sub: drafts > 0 ? \"unsaved · Save is in the toolbar\" : \"all saved\", tone: drafts > 0 ? \"brand\" : undefined },\n    ];\n}\n\n/** The summary's line under its title (A63): `3 lanes · 33 resources`. */\nexport function summaryLine(lanes: number, resources: number, nouns: Nouns): string {\n    return `${counted(lanes, nouns.lane)} · ${counted(resources, nouns.resource)}`;\n}\n\n/**\n * The narrowing's note (A63): `21 of 33 kilns visible · fits, checks and\n * totals include all`, each source the narrowing hides rows of; `undefined`\n * while none does.\n *\n * @param sources - Each narrowed source: how many it shows, of how many, in its noun\n * @returns The note\n */\nexport function narrowingNote(sources: readonly { shown: number; total: number; noun: Noun }[]): string | undefined {\n    const hiding = sources.filter(s => s.shown < s.total);\n    return hiding.length === 0 ? undefined\n        : `${hiding.map(s => `${s.shown} of ${s.total} ${other(s.noun)}`).join(\" · \")} visible · fits, checks and totals include all`;\n}\n\n/** The summary's three hints (A89). */\nexport function summaryHints(nouns: Nouns): string[] {\n    return [\n        `Select ${a(nouns.bin)} or ${a(nouns.resource)} to inspect it.`,\n        `Use the Library to book ${other(nouns.arrival)} and reserve ${other(nouns.resource)}.`,\n        \"Changes wait for Save. Undo and Redo are in the toolbar.\",\n    ];\n}\n\n/** One group of the Issues tab (A64): its kind's name, its tone's mark, and its issues. */\nexport interface IssueGroup { key: string; label: string; tone: \"warning\" | \"danger\" | undefined; issues: Issue[] }\n\n/** The built-in groups, in order (A64). */\nconst BUILT_IN = [\n    [\"unlinked\", \"Not linked\"], [\"unallocated\", \"Partly allocated\"], [\"overlap\", \"Overlaps the next job\"], [\"over\", \"Over max\"], [\"under\", \"Under minimum\"],\n] as const;\n\n/** An issue's kind as its group names it (A64): the built-in kinds' words, the app's own name. */\nexport function kindLabel(issue: Issue): string {\n    if (issue.kind.type === \"custom\") return issue.kind.value;\n    const kind = issue.kind.type;\n    return BUILT_IN.find(([key]) => key === kind)?.[1] ?? kind;\n}\n\n/**\n * The Issues tab's groups (A64): Not linked, Partly allocated, Overlaps the\n * next job, Over max and Under minimum, then the app's by their kind's name,\n * as they come — each with every issue of it, counted or not; marked danger,\n * warning, or not at all.\n *\n * @param issues - Every issue, the built-in ones first\n * @returns The groups that have issues, in order\n */\nexport function issueGroups(issues: readonly Issue[]): IssueGroup[] {\n    const toneOf = (list: readonly Issue[]) => list.some(i => i.tone.type === \"danger\") ? \"danger\" as const : list.some(i => i.tone.type === \"warning\") ? \"warning\" as const : undefined;\n    const out: IssueGroup[] = [];\n    for (const [kind, label] of BUILT_IN) {\n        const list = issues.filter(i => i.kind.type === kind);\n        if (list.length > 0) out.push({ key: kind, label, tone: toneOf(list), issues: list });\n    }\n    const custom = new Map<string, Issue[]>();\n    for (const issue of issues) {\n        if (issue.kind.type !== \"custom\") continue;\n        const list = custom.get(issue.kind.value) ?? [];\n        list.push(issue);\n        custom.set(issue.kind.value, list);\n    }\n    for (const [label, list] of custom) out.push({ key: `custom:${label}`, label, tone: toneOf(list), issues: list });\n    return out;\n}\n\n/** An issue's fix's words (A64): `Choose a resource`, `Find a fit`, `Move LD-2205…`. */\nexport function fixLabel(issue: Issue, codeOfBin: (bin: string) => string, nouns: Nouns): string | undefined {\n    if (issue.fix.type === \"none\") return undefined;\n    const fix = issue.fix.value;\n    return fix.type === \"choose\" ? `Choose ${a(nouns.resource)}` : fix.type === \"find\" ? \"Find a fit\" : `Move ${codeOfBin(fix.value)}…`;\n}\n\n/** The drop list's head (A34): what is dragged or picked, and what a drop does. */\nexport interface DropHead {\n    eyebrow: string;\n    title: string;\n    meta: string;\n    hint: string;\n    /** Whether it lists the fits: an arrival's, a removed bin's, a connector's or a link's drag, or a pick. */\n    fits: boolean;\n}\n\n/**\n * The drop list's head (A34, A86): for a resource card, `Resource · K-203 ·\n * Hall B · …`; for a card body, `Move bin · LD-2210 · 32 m³ · between lanes and\n * hours · its resource stays K-108`; for an arrival, a removed bin, a connector\n * or a link, `Gaps that fit · LD-2231 · 21 m³ · 8-day hold from Tue 11 · ` and\n * the answer's `basis` — and the layout's hint, a pick's naming the day's\n * first free slot.\n *\n * @param args - What is dragged or picked, whether a drag is under way, the layout, the day, the quantity placed, the answer's basis, the day's first free slot and the words\n * @returns The head\n */\nexport function dropHeadOf(args: {\n    subject: Grip; dragging: boolean; layout: \"timeline\" | \"table\"; day: Date; plan: Day; held: Day | undefined; context: Context;\n    loads: SortedMap<string, Load>; lines: ReadonlyMap<string, ResourceLine>; quantity: number | undefined; basis: string | undefined;\n    firstFree: { lane: string; at: Date } | undefined; words: InspectorWords;\n}): DropHead {\n    const { subject, dragging, layout, day, plan, held, context, words } = args;\n    const { lane, arrival, resource, bin: binNoun } = words.nouns;\n    const table = layout === \"table\";\n    if (subject.kind === \"resource\") {\n        const row = context.resources.get(subject.resource);\n        const load = args.loads.get(subject.resource), line = args.lines.get(subject.resource);\n        const today = row === undefined || load === undefined ? \"\" : Number(load.bins) > 0 ? `${words.load(load.fill, row)} today`\n            : load.state.type === \"busy\" ? line?.text ?? \"\" : \"free today\";\n        const where = row === undefined ? \"\" : row.group.type === \"some\" ? row.group.value : row.meta.type === \"some\" ? row.meta.value : \"\";\n        return {\n            eyebrow: resource.one, title: nameOf(context, subject.resource), meta: [where, today].filter(p => p !== \"\").join(\" · \"), fits: false,\n            hint: table ? `Drop on a row’s ${one(resource)} cell. ${a(binNoun).charAt(0).toUpperCase()}${a(binNoun).slice(1)} is linked to it; an empty slot is ${lower(words.nouns.reserved)} on it.`\n                : `Drop on ${a(binNoun)} to link it, or on an empty ${one(lane)} hour to reserve that slot.`,\n        };\n    }\n    if (subject.kind === \"body\") {\n        const bin = plan.bins.get(subject.bin);\n        const code = bin === undefined ? subject.bin : binCode(context, bin, words.nouns);\n        const current = bin === undefined ? undefined : partsOf(bin)[0]?.key;\n        return {\n            eyebrow: `Move ${one(binNoun)}`, title: bin === undefined || bin.arrival.type === \"none\" ? code : `${code} · ${words.quantity(bin.quantity)}`, fits: false,\n            meta: `${table ? \"To a free row\" : `Between ${other(lane)} and hours`} · its ${one(resource)} stays ${current === undefined ? \"none\" : nameOf(context, current)}`,\n            hint: table ? `Drop on a free row’s ${one(arrival)} cell. To change its ${one(resource)}, use the chevron on its row.`\n                : `Drop on ${a(lane)} hour. To change its ${one(resource)}, drag its connector instead.`,\n        };\n    }\n    // An arrival, a removed bin, a connector or a link: its fits.\n    const bin = subject.kind === \"arrival\" ? undefined : subject.kind === \"removed\" ? held?.bins.get(subject.bin) : plan.bins.get(subject.bin);\n    const code = subject.kind === \"arrival\" ? codeOf(context, subject.arrival) : bin === undefined ? subject.bin : binCode(context, bin, words.nouns);\n    const reserved = bin !== undefined && bin.arrival.type === \"none\";\n    const hold: TimeStep | undefined = subject.kind === \"arrival\" ? context.arrivals.get(subject.arrival)?.hold : reserved ? undefined : bin?.hold;\n    const from = hold === undefined ? \"\" : `${words.number(hold.value)}-${HOLD_UNIT[hold.type]} ${lower(words.nouns.hold)} from ${dayText(day)}`;\n    const landing = args.firstFree === undefined ? \"no free slot\" : `${words.lane(args.firstFree.lane)} ${timeText(args.firstFree.at)}`;\n    const linking = subject.kind === \"port\" || subject.kind === \"link\";\n    const hint = !dragging\n        ? `Book puts it in the day’s first free ${one(lane)} slot (${landing}). ${table ? `Or click a highlighted ${one(arrival)} cell, or drag it onto a free row.`\n            : `Or click a free ${one(lane)} hour or a ranked ${one(resource)}, or drag it there.`} Esc clears.`\n        : table ? `Drop on a free row’s ${one(arrival)} cell, or on ${a(resource)} here to book its next free ${one(binNoun)}.`\n            : linking ? `Drop on ${a(resource)} row, or on ${a(resource)} here.` : `Drop on ${a(resource)} row or ${a(lane)} hour, or on ${a(resource)} here.`;\n    return {\n        eyebrow: \"Gaps that fit\", title: reserved || args.quantity === undefined ? code : `${code} · ${words.quantity(args.quantity)}`, fits: true, hint,\n        meta: [from, args.basis ?? \"\"].filter(p => p !== \"\").join(\" · \"),\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the narrowing shows (#1336, #1339, #1372): the board reads each source\n * of its `Slice.bindRecords` itself — the lanes, the resources and the\n * arrivals, each under the slot the app names it by (the bin kind's\n * `resource.of`, its `parts.of`, and `arrivals`) — through the shared source\n * visibility, and a source with nothing chosen reads no page and hides\n * nothing. Fits, checks and totals never see it.\n *\n * @packageDocumentation\n */\n\nimport { Box, Button } from \"@chakra-ui/react\";\nimport { SortedMap, StringType, StructType, compareFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { RecordSliceWhereType, type RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { EmptyStateView } from \"@elaraai/east-ui-components\";\nimport { sourcePart, useSourceVisibility, type KeyVisibility } from \"../shared/schedule/visibility.js\";\nimport type { AllocationStyles, AllocationValue } from \"./model.js\";\nimport { one } from \"./nouns.js\";\n\n/** No choice of a source's: what a source the slice does not have narrows by. */\nconst NO_CHOICES: ValueTypeOf<typeof RecordSliceWhereType> = new SortedMap([], compareFor(StringType));\nconst printNarrowing = printFor(StructType({ bins: StringType, lanes: RecordSliceWhereType, resources: RecordSliceWhereType, arrivals: RecordSliceWhereType }));\n\n/** A narrowed source's role: what its rows are on the board. */\nexport type NarrowedSource = \"lanes\" | \"resources\" | \"arrivals\";\n\n/** The noun a source's rows are. */\nconst NOUN = { lanes: \"lane\", resources: \"resource\", arrivals: \"arrival\" } as const;\n\n/**\n * The slot the slice names a source by: the lanes' and the resources' the bin\n * kind's own (`resource.of`, `parts.of`), the arrivals' `arrivals`.\n *\n * @param value - The payload\n * @param source - The source's role\n * @returns Its name in the slice\n */\nexport function narrowingSlot(value: AllocationValue, source: NarrowedSource): string {\n    return source === \"lanes\" ? value.bin.lanes : source === \"resources\" ? value.bin.parts : \"arrivals\";\n}\n\n/**\n * A source's part of the board's narrowing, if the slice has one.\n *\n * @param value - The payload\n * @param source - The source's role\n * @returns Its record Slice's controls\n */\nexport function narrowingPart(value: AllocationValue, source: NarrowedSource): ValueTypeOf<RecordSliceBindType> | undefined {\n    return sourcePart(value.slice.type === \"some\" ? value.slice.value : undefined, narrowingSlot(value, source));\n}\n\n/**\n * The board's narrowing, as text (#1398): the bins' own choices, apart from\n * the day the board writes into their range, and the lanes', the resources'\n * and the arrivals' — what a view keeps its place across.\n *\n * @param value - The payload\n * @param binChoices - The bins' own source's choices, printed (`binChoicesOf`)\n * @returns The narrowing, printed\n */\nexport function narrowingText(value: AllocationValue, binChoices: string): string {\n    const where = (source: NarrowedSource) => narrowingPart(value, source)?.read().where ?? NO_CHOICES;\n    return printNarrowing({ bins: binChoices, lanes: where(\"lanes\"), resources: where(\"resources\"), arrivals: where(\"arrivals\") });\n}\n\n/**\n * Which of a source's rows show: its narrowed keys while a choice narrows it,\n * every row — and no read — while none does.\n *\n * @param value - The payload\n * @param source - The source's role\n * @param rows - Every row of it, in order\n * @returns The keys to show, and the narrowing's state\n */\nexport function useNarrowed(value: AllocationValue, source: NarrowedSource, rows: readonly { key: string }[]): KeyVisibility {\n    const noun = value.labels[NOUN[source]];\n    return useSourceVisibility(value.slice.type === \"some\" ? value.slice.value : undefined, narrowingSlot(value, source), value.narrowed[source], rows,\n        { changed: `${noun.one} results changed; retry the narrowing.`, failed: `Could not load ${one(noun)} results` });\n}\n\n/**\n * The narrowing left nothing to show: the shared empty state, and Clear filters.\n *\n * @param props - The recipe's styles, and the narrowing's Clear all, if there is one\n * @returns The empty state\n */\nexport function NarrowedEmpty({ styles, clear }: { styles: AllocationStyles; clear: (() => void) | undefined }) {\n    return <Box css={styles.narrowedEmpty} data-allocation-narrowed-empty=\"\">\n        <EmptyStateView size=\"sm\" icon={{ prefix: \"fas\", name: \"filter\" }} title=\"No rows match the filters\"\n            description=\"Change or clear the filters to see more rows.\"\n            actions={clear === undefined ? undefined : <Button size=\"xs\" variant=\"outline\" onClick={clear}>Clear filters</Button>} />\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `Split…` (`Allocation Spec.md` A71, #1332, #1362): an anchored popover over\n * the shared one, which the Inspector's Assigned to and the narrow cards (A78)\n * each open from a trigger of their own. It holds the quantity — with some of\n * the bin unallocated, what it places, that by default and at most; with all\n * of it on its resources, what it takes off a part, half of it by default; one\n * typed past what it takes refused, the field saying the bound —\n * and the resource it goes to, through the shared Chooser, every section of it\n * the fit's answer for that quantity (A73), the bin's own resources left out.\n * A choice is the board's `split`: one step that Undo takes back.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useState, type ReactElement } from \"react\";\nimport { Box, useSlotRecipe } from \"@chakra-ui/react\";\nimport { FloatType, StructType, variant, type option } from \"@elaraai/east\";\nimport { Fields } from \"@elaraai/east-ui\";\nimport { FieldForm, SliceEditPopover } from \"@elaraai/east-ui-components\";\nimport { Chooser } from \"@elaraai/east-ui-components/internal\";\nimport { splitOf, type AllocationCommands } from \"./actions.js\";\nimport { resourceChoices } from \"./choices.js\";\nimport type { AllocationFit } from \"./fit.js\";\nimport { binCode, type InspectorWords } from \"./inspector-model.js\";\nimport { compareFloat, type Bin, type Context, type Day } from \"./model.js\";\nimport { a } from \"./nouns.js\";\n\n/** What `Split…` takes: a quantity. */\nconst SPLIT_FIELDS = StructType({ quantity: FloatType });\n\n/** `Split…`'s props: the bin, what the board knows and can do, and its trigger. */\nexport interface SplitProps {\n    id: string;\n    bin: Bin;\n    /** The part it takes off when nothing is left: a resource card's own; the bin's largest when omitted. */\n    from?: string | undefined;\n    context: Context;\n    /** The day as drafted: a draft asks the fit again. */\n    plan: Day;\n    commands: AllocationCommands;\n    fit: AllocationFit;\n    words: InspectorWords;\n    /** The resources the narrowing shows; `none`, every one. */\n    shown: option<ReadonlySet<string>>;\n    /** Its trigger, one button, given the popover's label for its title. */\n    trigger: (label: string) => ReactElement;\n}\n\n/**\n * `Split…` (see the module docs).\n *\n * @param props - See {@link SplitProps}\n * @returns The popover on its trigger, or nothing for a bin there is nothing to split of\n */\nexport function SplitPopover({ id, bin, from, context, plan, commands, fit, words, shown, trigger }: SplitProps) {\n    const recipe = useSlotRecipe({ key: \"allocationInspector\" });\n    const styles = useMemo(() => recipe({}) as unknown as Record<string, Record<string, unknown>>, [recipe]);\n    const nouns = words.nouns;\n    const take = splitOf(bin, from);\n    const [open, setOpen] = useState(false);\n    const initial = take?.initial ?? 0;\n    const [quantity, setQuantity] = useState(initial);\n    // Opened again, or what it takes moved: it takes its default again.\n    useEffect(() => { if (!open) setQuantity(initial); }, [open, initial]);\n    const least = take?.least ?? 0, most = take?.most ?? 0;\n    const placed = compareFloat(quantity, most) > 0 ? most : compareFloat(quantity, least) < 0 ? least : quantity;\n    // The question is the quantity placed (A73), of the day as drafted.\n    const ask = useMemo(() => variant(\"place\", { subject: variant(\"bin\", id), quantity: placed }), [id, placed]);\n    const { ask: asking } = fit;\n    useEffect(() => { if (open) asking(ask); }, [open, ask, asking, plan]);\n    const except = useMemo(() => new Set(bin.parts.keys()), [bin.parts]);\n    const sections = open ? resourceChoices({ context, words, binRow: true, current: undefined, answer: fit.answer(ask), shown, except }) : [];\n    const specs = useMemo(() => Fields.specs(SPLIT_FIELDS, {\n        quantity: Fields.number({ label: nouns.quantity, min: least, max: most, step: 1, ...(context.unit === \"\" ? {} : { unit: context.unit }) }),\n    }), [nouns.quantity, least, most, context.unit]);\n    const shownValue = useMemo(() => ({ quantity: placed }), [placed]);\n    const onChange = useCallback((path: readonly string[], next: unknown) => { if (path[0] === \"quantity\") setQuantity(next as number); }, []);\n    if (take === undefined) return null;\n    const code = binCode(context, bin, nouns);\n    const label = take.from === undefined ? `Split ${code} · ${words.quantity(take.held)} unallocated`\n        : `Split ${code} · ${words.quantity(take.held)} on ${context.resources.get(take.from)?.label ?? take.from}`;\n    // It opens on the Chooser's search: the default is what a split most often takes.\n    return <SliceEditPopover open={open} onOpenChange={setOpen} label={label} trigger={trigger(label)}\n        initialFocusEl={() => document.querySelector<HTMLElement>(`[data-allocation-split=\"${id}\"] [data-chooser] input`)}>\n        <Box css={styles.split} data-allocation-split={id}>\n            <FieldForm specs={specs} value={shownValue} onChange={onChange} refusesBreaches />\n            {open && <Chooser sections={sections} placeholder={`Find ${a(nouns.resource)}`} surface=\"inline\"\n                onChoose={key => { setOpen(false); commands.split(id, key, placed, take.from); }} />}\n        </Box>\n    </SliceEditPopover>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Table (`Allocation Spec.md` §8, A41–A49, A84, #1329): one row per lane\n * slot of the day and one per extra bin of a batch, in foldable time bands\n * (the app's, four by default), narrowed by the lanes, the resources and the\n * arrivals the slice shows (#1336, #1339) and never reordered by an\n * allocation. Each row's arrival and resource are a chip or a dashed\n * placeholder; a chip's × removes or unlinks, and a cell's chevron opens the\n * shared Chooser, every section of it the app's fit's answer. A bin's chip\n * drags onto a free row's arrival cell (A47). A split or partly allocated bin lists its parts as resource chips\n * with their quantities across the Resource and Load columns, each its own\n * chevron and ×, and `+ resource` for its remainder (A71, #1332). Every\n * figure and word is e3-ui's; every size the `allocationBuilder` recipe's. A\n * day not read yet draws its column heads and its bands at once, each band's\n * count a placeholder and one placeholder row in it (#1398, CL2); a day whose\n * read failed says so once, in the first of those rows in view, with Retry\n * (CL11).\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactElement } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n    faArrowDown, faChevronDown, faChevronUp, faCircleExclamation, faGripVertical, faInbox, faLink, faLinkSlash, faPlus, faTriangleExclamation, faXmark,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { variant, type SortedMap, type option } from \"@elaraai/east\";\nimport { SliceEditPopover, useDragEventChip, useDropCell, useTrackedEvaluation, type Formatters } from \"@elaraai/east-ui-components\";\nimport {\n    Chooser, LoadingFailedLine, PlaceholderShape, VirtualRows, formatDatePattern, useRowsTop, type ChooserSection, type PlaceholderKind,\n} from \"@elaraai/east-ui-components/internal\";\nimport type { PeriodRead } from \"../shared/loading.js\";\nimport { GroupHeading, useGroupCollapse } from \"../shared/schedule/group-heading.js\";\nimport { MoveGhost } from \"../shared/schedule/move-ghost.js\";\nimport { useRowAnchor, type RowAnchor, type RowNarrowing } from \"../shared/schedule/row-anchor.js\";\nimport { linkedQuantity, remainderOf, type AllocationCommands } from \"./actions.js\";\nimport { useBinFocusTarget } from \"./bin-focus.js\";\nimport { arrivalChoices, resourceChoices, type ChoiceWords } from \"./choices.js\";\nimport { dropTarget, gripCoord, laneCoord, resourceCellCoord, type AllocationDrag, type Grip, type Target } from \"./drag.js\";\nimport type { AllocationFit } from \"./fit.js\";\nimport { bandLine, narrowBands, rowStatus, tableBands, tableRows, type TableBand, type TableRow } from \"./table-rows.js\";\nimport { NarrowedEmpty } from \"./narrowed.js\";\nimport { a, lower, one, useNouns } from \"./nouns.js\";\nimport type { AllocationBinOp, AllocationOptimised } from \"./optimise.js\";\nimport type { TimelineFollow } from \"./timeline.js\";\nimport {\n    allocationWords, compareFloat, partsOf, type AllocationDomain, type AllocationStyles, type AllocationValue, type Bin, type Context, type Day, type FitAsk,\n    type Load, type ResourceLine, type Selection, type Slot,\n} from \"./model.js\";\n\n/** A band's and a row's height, the recipe's: the rows are virtualised by them. */\nconst BAND_H = 38;\nconst ROW_H = 36;\n/** The probe reservation a free row's resource Chooser asks the fit about. */\nexport const RESERVE_PROBE = \"\\u0000reserve\";\n\n/** The Table's props. */\nexport interface TableProps {\n    value: AllocationValue;\n    domain: AllocationDomain;\n    context: Context;\n    styles: AllocationStyles;\n    format: Formatters;\n    day: Date;\n    plan: Day;\n    held: Day | undefined;\n    sameBin: (a: Bin, b: Bin) => boolean;\n    /** Whether a bin holds a conflict not yet chosen: it wears the warn ring. None by default. */\n    conflicted?: ((id: string) => boolean) | undefined;\n    /** Whether a bin's row breaks its form's bounds (#1585), stored or changed: it wears the warn ring too. None by default. */\n    bounded?: ((id: string) => boolean) | undefined;\n    loads: SortedMap<string, Load>;\n    slots: readonly Slot[];\n    selection: Selection | undefined;\n    editable: boolean;\n    select: (next: Selection | undefined, soft?: boolean) => void;\n    follow: TimelineFollow;\n    drag: AllocationDrag;\n    commands: AllocationCommands;\n    fit: AllocationFit;\n    /** The day without a bin, and with a probe reservation in a free slot: what a cell's Chooser asks the fit of. */\n    without: (bin: string) => Day;\n    reserving: (lane: string, at: Date) => Day;\n    /** The lanes, the resources and the arrivals the narrowing shows, by key; `none` for every one (#1336, #1339). */\n    visibleLanes: option<Set<string>>;\n    visibleResources: option<Set<string>>;\n    visibleArrivals: option<Set<string>>;\n    /** Clears the narrowing, where nothing shows; `undefined` with no narrowing. */\n    clearFilters: (() => void) | undefined;\n    /** The arrival whose every bin the Library's Allocated card highlights (A10). */\n    highlight: string | undefined;\n    /** Books the picked arrival where a click lands, as its drop would (A11). */\n    book: (target: Target) => void;\n    /**\n     * What it draws of the day's read (#1398): the day as read; a day not read yet — the day without its bins handed in\n     * as `plan`, its bands real, a placeholder row in each once the reveal says so; or one whose read failed — the failure\n     * said once, in the first of those rows in view.\n     */\n    read: PeriodRead;\n    /** Where the Table's view last rested (#1398): its top line, by key, which it comes back to as it mounts. */\n    anchor?: RowAnchor | undefined;\n    /** Told where the Table's view rests as its scroll settles. */\n    onAnchor?: ((at: RowAnchor) => void) | undefined;\n    /**\n     * The board's narrowing, as text, and whether its rows are in (#1398): across a new one the Table keeps the line at the\n     * top of its view where the narrowing holds it — by its key, and the px into it — and else starts at its top.\n     */\n    narrowing?: RowNarrowing | undefined;\n    /** What the runs of the app's optimiser left on the day's bins (#1409): each bin's operation, drawn on its row's chip, and its provenance on hover. */\n    optimised?: AllocationOptimised | undefined;\n    /** Whether a run's highlight is on (#1409): a band's count flashes where the run changed its rows. */\n    lit?: boolean | undefined;\n}\n\n/**\n * A row's cell a Chooser is open on: its arrival, or its resource — the\n * row's, one part of a split bin's (`part`, its resource), or the remainder's\n * (`part: null`, `+ resource`, A71). A narrow card's actions open the same\n * Choosers (A78).\n */\nexport interface Open { row: string; side: \"arrival\" | \"resource\"; part?: string | null | undefined }\n\n/** A Chooser's identity in its row, as a row's memo compares it: `arrival`, `resource`, `resource:K-203`, `resource:+`. */\nexport const openKey = (side: Open[\"side\"], part: Open[\"part\"]) => part === undefined ? side : `${side}:${part ?? \"+\"}`;\n\n/** One flattened line of the virtualised Table: a band's head, a row, or a band's placeholder row while the day is not read (#1398). */\ntype Line = { kind: \"band\"; band: TableBand } | { kind: \"row\"; band: TableBand; row: TableRow } | { kind: \"unread\"; band: TableBand };\n\n/** What a placeholder row draws in each of the Table's columns, in their order (#1398): Time, Lane, Arrival, Quantity, the app's, Resource, Load, Status. */\nfunction unreadColumns(shown: number): PlaceholderKind[] {\n    return [\"date\", \"label\", \"chip\", \"number\", ...Array.from({ length: shown }, (): PlaceholderKind => \"text\"), \"chip\", \"aggregate\", \"enum\"];\n}\n\n/**\n * The line a failed day says so in (#1398, CL11): the first placeholder row at or below the row at the top of the view,\n * else the last one above it.\n *\n * @param lines - The Table's lines\n * @param top - The line at the top of the view; `undefined` before the lines are placed\n * @returns The line's index; `undefined` with no placeholder row\n */\nfunction firstUnreadInView(lines: readonly Line[], top: number | undefined): number | undefined {\n    const from = Math.max(0, top ?? 0);\n    for (let i = from; i < lines.length; i++) if (lines[i]!.kind === \"unread\") return i;\n    for (let i = Math.min(from, lines.length) - 1; i >= 0; i--) if (lines[i]!.kind === \"unread\") return i;\n    return undefined;\n}\n\n/**\n * A band's placeholder row of a day not read, or whose read failed (#1398, CL2, CL11): a placeholder in each column — or,\n * the first of them in view of a failed day, the failure said across the row. It reads which line is at the top of the\n * view itself, drawn again only as it becomes or stops being the one that says it (CL9).\n */\nfunction UnreadRow({ styles, band, index, lines, read, shown }: {\n    styles: AllocationStyles; band: TableBand; index: number; lines: readonly Line[]; read: PeriodRead; shown: number;\n}) {\n    const says = useRowsTop(top => read.state === \"failed\" && index === firstUnreadInView(lines, top));\n    const failure = says && read.state === \"failed\" ? read : undefined;\n    return <Box css={styles.tableRow} data-allocation-unread-row={band.key} data-columns={shown === 0 ? \"none\" : undefined}\n        aria-hidden={failure === undefined ? true : undefined}>\n        {failure !== undefined\n            ? <Box css={styles.tableReadLine} data-allocation-read-line=\"failed\"><LoadingFailedLine message={failure.message} retry={{ onRetry: failure.retry }} /></Box>\n            : unreadColumns(shown).map((kind, i) => <Box key={i} as=\"span\" css={styles.tableUnreadCell} data-align={kind === \"number\" ? \"end\" : undefined}>\n                {read.state === \"pending\" && <PlaceholderShape kind={kind} index={index + i} />}\n            </Box>)}\n    </Box>;\n}\n\n/**\n * The Table (see the module docs).\n *\n * @param props - See {@link TableProps}\n * @returns Its bands and rows under their column heads\n */\nexport function AllocationTable(props: TableProps) {\n    const { value, domain, plan, slots, day, context, styles, drag } = props;\n    const words = allocationWords();\n    const nouns = useNouns();\n    const unit = context.unit;\n    // A row a hidden lane holds, whose every resource is hidden, or whose arrival is, goes; a band the narrowing empties goes with it.\n    const { visibleLanes, visibleResources, visibleArrivals } = props;\n    const bands = useMemo(() => narrowBands(tableBands(tableRows(slots, plan), plan, day, value.table.bands), plan, visibleLanes, visibleResources, visibleArrivals),\n        [slots, plan, day, value.table.bands, visibleLanes, visibleResources, visibleArrivals]);\n    const rows = useMemo(() => bands.flatMap(band => band.rows), [bands]);\n    const { collapsed, toggle } = useGroupCollapse(`${drag.surface}.table`);\n    // A day not read yet, or whose read failed (#1398): its bands, known from its slots, and one placeholder row in each\n    // that holds a slot — how many rows it has waits on its bins.\n    const { read } = props;\n    const unread = read.state !== \"held\";\n    // Not read yet, a placeholder where each figure goes, unseen until the frame's reveal says so, which each reads itself (CL4).\n    const pending = read.state === \"pending\";\n    const lines = useMemo((): Line[] => bands.flatMap(band => [{ kind: \"band\" as const, band },\n        ...(collapsed.includes(band.key) ? [] : unread ? band.rows.length === 0 ? [] : [{ kind: \"unread\" as const, band }]\n            : band.rows.map(row => ({ kind: \"row\" as const, band, row })))]), [bands, collapsed, unread]);\n    const sizes = useMemo(() => lines.map(l => l.kind === \"band\" ? BAND_H : ROW_H), [lines]);\n    const getItemKey = useCallback((index: number) => {\n        const l = lines[index]!;\n        return l.kind === \"band\" ? `band:${l.band.key}` : l.kind === \"unread\" ? `unread:${l.band.key}` : l.row.key;\n    }, [lines]);\n    // Where the Table's view rests (#1398): its top line by key and the px into it, saved as a scroll settles and brought\n    // back once its lines are laid out — the line it left, wherever the lines above it moved — and kept across a new\n    // narrowing where the narrowing holds it, else the Table starts at its top.\n    const keyed = useMemo(() => lines.map((_, i) => ({ key: getItemKey(i) })), [lines, getItemKey]);\n    const { restore, onAnchorChange } = useRowAnchor(keyed, props.anchor, props.onAnchor, true, props.narrowing);\n    // The app's columns shown in the Table, each bin's text and tone over its row, through its callbacks (§6).\n    const shown = useMemo(() => value.columns.filter(c => c.table), [value.columns]);\n    const readColumns = useCallback(() => {\n        const out = new Map<string, { text: string; warn: boolean }[]>();\n        for (const [id, bin] of plan.bins) {\n            if (bin.arrival.type !== \"some\") continue;\n            const bytes = domain.encodeRow(bin.row);\n            out.set(id, shown.map(c => {\n                const tone = c.tone.type === \"some\" ? c.tone.value(bytes) : undefined;\n                return { text: c.text(bytes), warn: tone?.type === \"some\" && (tone.value.type === \"warning\" || tone.value.type === \"danger\") };\n            }));\n        }\n        return out;\n    }, [plan, domain, shown]);\n    const columns = useTrackedEvaluation(readColumns);\n    const cells = columns.result.ok ? columns.result.value : undefined;\n    const resourceLines = useMemo(() => new Map(value.resources.map(r => [r.key, words.line(day, r, props.loads.get(r.key)!, unit, lower(nouns.reserved))] as const)), [value.resources, props.loads, day, unit, words, nouns.reserved]);\n    const [open, setOpen] = useState<Open>();\n    // Another day, or the drafts' row gone: its Chooser closes.\n    useEffect(() => { if (open !== undefined && !rows.some(r => r.key === open.row)) setOpen(undefined); }, [rows, open]);\n    const vars = { \"--allocation-columns\": shown.length, \"--allocation-arrival-span\": 2 + shown.length } as CSSProperties;\n\n    // Selecting follows the selection (A12): its row scrolls into view a third from the top.\n    const pane = useRef<HTMLDivElement | null>(null);\n    const selectionRef = useRef(props.selection);\n    selectionRef.current = props.selection;\n    useLayoutEffect(() => {\n        const el = pane.current, selection = selectionRef.current;\n        if (props.follow.nonce === 0 || el === null || selection === undefined) return;\n        const index = lines.findIndex(l => l.kind === \"row\" && selects(selection, l.row, plan, props.highlight) === \"row\");\n        if (index < 0) return;\n        const y = sizes.slice(0, index).reduce((a, b) => a + b, 0), view = el.clientHeight - ROW_H;\n        if (y < el.scrollTop || y + ROW_H > el.scrollTop + view) el.scrollTop = Math.max(0, Math.round((y - view / 3) / ROW_H) * ROW_H);\n        // The follow request is the trigger.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [props.follow.nonce]);\n\n    // A picked arrival's question of each reservation, asked once the Table has rendered: its arrival cell says whether it fits (A11, A45).\n    const pickKey = drag.grip === undefined && drag.subject !== undefined && (drag.subject.kind === \"arrival\" || drag.subject.kind === \"removed\") ? `${drag.subject.kind}|${drag.subject.kind === \"arrival\" ? drag.subject.arrival : drag.subject.bin}` : \"\";\n    const { verdict } = drag;\n    useEffect(() => {\n        const subject = drag.subject;\n        if (pickKey === \"\" || subject === undefined) return;\n        for (const row of rows) if (row.kind === \"reserved\") verdict(subject, arrivalTarget(row));\n        // The pick and the rows are the question.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [pickKey, rows]);\n\n    const choiceWords: ChoiceWords = useMemo(() => ({\n        quantity: v => words.quantity(v, unit), number: v => words.quantity(v, \"\"), lane: key => value.lanes.find(l => l.key === key)?.label ?? key, nouns,\n    }), [words, unit, value.lanes, nouns]);\n    const head = <Box css={styles.tableHead} data-columns={shown.length === 0 ? \"none\" : undefined} data-allocation-table-head=\"\">\n        <span>Time</span><span title={nouns.lane.one}>{nouns.lane.one}</span><span title={nouns.arrival.one}>{nouns.arrival.one}</span>\n        <Box as=\"span\" data-align=\"end\" title={nouns.quantity}>{nouns.quantity}</Box>\n        {shown.map(c => <span key={c.key} title={c.label}>{c.label}</span>)}<span title={nouns.resource.one}>{nouns.resource.one}</span><span>Load</span><span>Status</span>\n    </Box>;\n    // The narrowing's empty state only under a narrowing (#1398, CL13).\n    const narrowed = visibleLanes.type === \"some\" || visibleResources.type === \"some\" || visibleArrivals.type === \"some\";\n    return <Box css={styles.table} style={vars} data-allocation-table=\"\" data-allocation-drag={drag.grip?.kind} data-allocation-unread={unread ? read.state : undefined}>\n        {/* Its rows as wide as the recipe's least width for its tracks: no cell past a row's edge. */}\n        {lines.length === 0 ? <>{head}{narrowed && <NarrowedEmpty styles={styles} clear={props.clearFilters} />}</> : <VirtualRows fillParent height={undefined} maxHeight={undefined} rootCss={styles.tablePane} minWidth=\"var(--allocation-table-least)\" scrollElRef={pane}\n            headerZIndex={4} header={head} count={lines.length} getItemKey={getItemKey} sizes={sizes} measureRows={false}\n            onAnchorChange={onAnchorChange} restoreAnchor={restore}\n            renderRow={index => {\n                const line = lines[index]!;\n                if (line.kind === \"band\") {\n                    const folded = collapsed.includes(line.band.key);\n                    // A day not read yet: its band's count a placeholder, its line said once its rows land.\n                    return <GroupHeading scope=\"allocation\" group={{ key: line.band.key, label: line.band.label }} styles={styles} collapsed={folded} toggle={toggle}>\n                        {unread ? pending && <PlaceholderShape kind=\"count\" index={index} /> : <>\n                            <Box as=\"span\" css={styles.bandCount} data-allocation-band-count=\"\"\n                                data-opn={props.lit === true && line.band.rows.some(r => r.bin !== undefined && props.optimised?.ops.has(r.bin) === true) ? \"\" : undefined}>{line.band.rows.length}</Box>\n                            <Box as=\"span\" css={styles.groupMeta}>{bandLine(line.band, words.quantity(Math.round(line.band.quantity), unit), folded, nouns)}</Box>\n                        </>}\n                    </GroupHeading>;\n                }\n                if (line.kind === \"unread\") return <UnreadRow styles={styles} band={line.band} index={index} lines={lines} read={read} shown={shown.length} />;\n                return <Row props={props} row={line.row} columns={cells?.get(line.row.bin ?? \"\")} shown={shown.length} lines={resourceLines}\n                    open={open?.row === line.row.key ? openKey(open.side, open.part) : undefined} setOpen={setOpen} words={choiceWords} />;\n            }} />}\n    </Box>;\n}\n\n/** A row's arrival cell, as a drop or a pick names it: its slot, the reservation it holds, on the Table. */\nconst arrivalTarget = (row: TableRow): Target => ({ kind: \"lane\", lane: row.lane, at: row.slotAt, card: row.kind === \"reserved\" ? row.bin : undefined, table: true });\n\n/** How a selection marks a row (A44): as its own, as one of the selected resource's, or as one of the bins the Library highlights (A10). */\nfunction selects(selection: Selection | undefined, row: TableRow, plan: Day, highlight?: string): \"row\" | \"resource\" | undefined {\n    const shown = row.bin === undefined ? undefined : plan.bins.get(row.bin);\n    if (highlight !== undefined && shown?.arrival.type === \"some\" && shown.arrival.value === highlight) return \"row\";\n    if (selection === undefined) return undefined;\n    if (selection.type === \"bin\") return row.bin === selection.id ? \"row\" : undefined;\n    if (selection.type === \"slot\") return row.kind === \"free\" && row.lane === selection.lane && row.slotAt.getTime() === selection.at ? \"row\" : undefined;\n    const bin = row.bin === undefined ? undefined : plan.bins.get(row.bin);\n    return bin?.parts.has(selection.key) === true ? \"resource\" : undefined;\n}\n\ninterface RowProps {\n    props: TableProps; row: TableRow; columns: readonly { text: string; warn: boolean }[] | undefined; shown: number;\n    lines: ReadonlyMap<string, ResourceLine>;\n    /** The row's open Chooser, by its key (`openKey`). */\n    open: string | undefined;\n    setOpen: (open: Open | undefined) => void; words: ChoiceWords;\n}\n\n/**\n * What an empty cell says during a drag or a pick (A45): it takes the drop\n * (`fits`, its words under the pointer), it refuses it (`doesn't fit`, the\n * reason as its tooltip and, under the pointer, the reason itself), or — a\n * pick — a click books it there.\n */\ninterface Say { state: \"fits\" | \"refused\" | \"pick\"; drop: string; reason: string | undefined; pick: string | undefined }\n\n/** A verdict as a cell says it; nothing while the fit's answer is on its way, or where nothing drops. */\nfunction sayOf(verdict: { allowed: boolean; pending: boolean; caption: string; reason?: string | undefined }, drop: string, pick: string | undefined): Say | undefined {\n    if (verdict.pending || (!verdict.allowed && verdict.caption === \"\")) return undefined;\n    if (!verdict.allowed) return { state: \"refused\", drop, reason: verdict.reason ?? verdict.caption, pick: undefined };\n    return pick === undefined ? { state: \"fits\", drop, reason: undefined, pick: undefined } : { state: \"pick\", drop, reason: undefined, pick };\n}\n\n/**\n * A row (A43): the drag hooks here — its arrival chip's handle, its arrival\n * and resource cells' targets — outside its body, so pointer motion repaints\n * nothing in it (A35).\n */\nfunction Row(args: RowProps) {\n    const { props, row } = args;\n    const { drag, plan, context, styles } = props;\n    const bin = row.bin === undefined ? undefined : plan.bins.get(row.bin);\n    const words = allocationWords();\n    const code = bin?.arrival.type === \"some\" ? context.arrivals.get(bin.arrival.value)?.label ?? bin.arrival.value : undefined;\n    const label = useMemo(() => code === undefined || bin === undefined ? \"\" : `${code} · ${words.quantity(bin.quantity, context.unit)}`, [code, bin, words, context.unit]);\n    const ghost = useMemo(() => <MoveGhost styles={styles} label={label} />, [styles, label]);\n    const chipAt = useMemo(() => drag.enabled && row.kind === \"bin\" && row.bin !== undefined ? gripCoord(drag.surface, { kind: \"body\", bin: row.bin }) : null, [drag.enabled, drag.surface, row.kind, row.bin]);\n    const chip = useDragEventChip(chipAt, ghost, false, label);\n    // A free row's arrival cell takes a bin to its slot; a reserved row's, a bin into the reservation (A37, A38): each the board's one drop target (§10).\n    const takes = row.kind !== \"bin\";\n    const arrival = dropTarget(drag, { kind: \"lane\", lane: row.lane, at: row.slotAt, card: row.kind === \"reserved\" ? row.bin : undefined, table: true });\n    const arrivalDrop = useDropCell(drag.enabled && takes ? laneCoord(drag.surface, row.lane, row.slotAt, row.kind === \"reserved\" ? row.bin : undefined, true) : null, false, arrival.veto, undefined, arrival.options);\n    const resource = dropTarget(drag, { kind: \"cell\", row: row.key });\n    const resourceDrop = useDropCell(drag.enabled ? resourceCellCoord(drag.surface, row.key) : null, false, resource.veto, undefined, resource.options);\n    // What the cells say while something is dragged, or an arrival picked (A11, A32, A45): the board's one verdict, asked nothing here.\n    const subject = drag.subject, dragging = drag.grip !== undefined;\n    const pickedCode = !dragging && subject !== undefined && (subject.kind === \"arrival\" || subject.kind === \"removed\") ? libraryCode(props, subject) : undefined;\n    const arrivalVerdict = takes && subject !== undefined && subject.kind !== \"resource\" && (dragging ? subject.kind !== \"port\" && subject.kind !== \"link\" : pickedCode !== undefined)\n        ? drag.peek(subject, arrivalTarget(row)) : undefined;\n    const resourceVerdict = dragging && subject?.kind === \"resource\" ? drag.peek(subject, { kind: \"cell\", row: row.key }) : undefined;\n    const arrivalSay = arrivalVerdict === undefined ? undefined : sayOf(arrivalVerdict, subject?.kind === \"body\" ? \"drop to move here\" : \"drop to book here\",\n        pickedCode === undefined ? undefined : `click to book ${pickedCode} here`);\n    const resourceSay = resourceVerdict === undefined || resourceVerdict.caption === \"already on it\" ? undefined\n        : sayOf(resourceVerdict, row.kind === \"free\" ? \"drop to reserve\" : \"drop to link\", undefined);\n    // What a run of the optimiser did to the row's bin (#1409, R7, R17), while it is still the run's draft.\n    const op = row.bin === undefined ? undefined : props.optimised?.ops.get(row.bin);\n    return <RowBody {...args} bin={bin} code={code} chip={chip} arrivalDrop={arrivalDrop} resourceDrop={resourceDrop} op={op}\n        arrivalState={arrivalSay?.state} arrivalWords={arrivalSay?.drop} arrivalReason={arrivalSay?.reason} arrivalPick={arrivalSay?.pick}\n        resourceState={resourceSay?.state} resourceWords={resourceSay?.drop} resourceReason={resourceSay?.reason} />;\n}\n\n/** A Library card's code, as a cell's words name it. */\nfunction libraryCode(props: TableProps, grip: Extract<Grip, { kind: \"arrival\" | \"removed\" }>): string {\n    if (grip.kind === \"arrival\") return props.context.arrivals.get(grip.arrival)?.label ?? grip.arrival;\n    const arrival = props.held?.bins.get(grip.bin)?.arrival;\n    return arrival?.type === \"some\" ? props.context.arrivals.get(arrival.value)?.label ?? arrival.value : grip.bin;\n}\n\n/** A row's body: its cells, from the drafts, the loads and the app's columns. */\nconst RowBody = memo(function RowBody({ props, row, columns, shown, lines, open, setOpen, words, bin, code, chip, arrivalDrop, resourceDrop, op: marked,\n    arrivalState, arrivalWords, arrivalReason, arrivalPick, resourceState, resourceWords, resourceReason }: RowProps & {\n    bin: Bin | undefined; code: string | undefined; chip: ReturnType<typeof useDragEventChip>;\n    arrivalDrop: (el: HTMLElement | null) => void; resourceDrop: (el: HTMLElement | null) => void;\n    /** What a run of the optimiser did to the row's bin (#1409): its mark on the row's chip, and its provenance on hover. */\n    op: AllocationBinOp | undefined;\n    /** What the arrival and the resource cells say during a drag or a pick, as primitives, so pointer motion repaints nothing (A35). */\n    arrivalState: Say[\"state\"] | undefined; arrivalWords: string | undefined; arrivalReason: string | undefined; arrivalPick: string | undefined;\n    resourceState: Say[\"state\"] | undefined; resourceWords: string | undefined; resourceReason: string | undefined;\n}) {\n    const { styles, context, plan, held, commands, drag, editable } = props;\n    const board = allocationWords();\n    const nouns = useNouns();\n    const unit = context.unit;\n    const parts = bin === undefined ? [] : partsOf(bin);\n    const resource = parts[0] === undefined ? undefined : context.resources.get(parts[0].key);\n    const line = resource === undefined ? undefined : lines.get(resource.key);\n    const load = resource === undefined ? undefined : props.loads.get(resource.key);\n    const committed = row.bin === undefined ? undefined : held?.bins.get(row.bin);\n    const draft = bin !== undefined && (committed === undefined || !props.sameBin(committed, bin));\n    // A run's mark holds while the bin is still the run's draft (R17): an Undo that takes the run back leaves none.\n    const op = draft ? marked : undefined;\n    const selectedAs = selects(props.selection, row, plan, props.highlight);\n    const arrivalSay: Say | undefined = arrivalState === undefined ? undefined : { state: arrivalState, drop: arrivalWords ?? \"\", reason: arrivalReason, pick: arrivalPick };\n    const resourceSay: Say | undefined = resourceState === undefined ? undefined : { state: resourceState, drop: resourceWords ?? \"\", reason: resourceReason, pick: undefined };\n    const time = formatDatePattern(\"HH:mm\", row.at);\n    const lane = words.lane(row.lane);\n    const meta = bin?.arrival.type === \"some\" ? context.arrivals.get(bin.arrival.value)?.meta : undefined;\n    // A split or partly allocated bin (A71): its parts' chips, and `+ resource` for what they leave, across the Resource and Load columns.\n    const remainder = bin === undefined ? 0 : remainderOf(bin);\n    const split = row.kind === \"bin\" && parts.length > 0 && (parts.length > 1 || compareFloat(remainder, 0) > 0);\n    // Its status (A43): what it holds, and whether a resource of it needs a look.\n    const check = parts.some(part => { const l = lines.get(part.key); return l !== undefined && (l.over || l.overlap); });\n    const status = rowStatus(row.kind, parts.length > 0, check, draft);\n    const select = () => props.select(row.bin !== undefined ? { type: \"bin\", id: row.bin } : { type: \"slot\", lane: row.lane, at: row.slotAt.getTime() });\n    // A bin's row takes the keyboard a pick in Search Records gives its bin (#1398): focusable for that, no tab stop of its own.\n    const given = useBinFocusTarget<HTMLDivElement>(row.bin);\n    const loadText = resource !== undefined && load !== undefined ? board.load(load.fill, resource, unit) : undefined;\n    const into = line?.overlap === true && line.next.type === \"some\" && load?.hold.type === \"some\"\n        ? (load.hold.value.to.getTime() - line.next.value.start.getTime()) / 86_400_000 : undefined;\n    // A chip's chevron, and a placeholder whole, open its cell's Chooser.\n    const chevron = (label: string) => (isOpen: boolean) => <chakra.button type=\"button\" css={styles.tableChipButton} aria-label={label} title={label} aria-haspopup=\"listbox\"\n        onPointerDown={event => event.stopPropagation()}><FontAwesomeIcon icon={isOpen ? faChevronUp : faChevronDown} /></chakra.button>;\n    const placeholder = (side: \"arrival\" | \"resource\") => (isOpen: boolean) => <Placeholder props={props} side={side} reserved={row.kind === \"reserved\"} open={isOpen} button\n        say={side === \"arrival\" ? arrivalSay : resourceSay} />;\n    const chooser = (side: \"arrival\" | \"resource\", trigger: (isOpen: boolean) => ReactElement, part?: string | null) => editable\n        ? <ChoiceCell props={props} row={row} side={side} part={part} open={open === openKey(side, part)} setOpen={setOpen} words={words} trigger={trigger} /> : null;\n    const arrivalLabel = row.kind === \"bin\" ? `Replace ${code} with another ${one(nouns.arrival)}` : `Choose ${a(nouns.arrival)}`;\n    const resourceLabel = resource !== undefined ? `Change the ${one(nouns.resource)}` : row.kind === \"bin\" ? `Choose ${a(nouns.resource)}` : `Reserve ${a(nouns.resource)}`;\n    // A resource's marks (A43): ⚠ overlapping, ● over max, ↓ under min.\n    const marksOf = (of: ResourceLine | undefined) => <>\n        {of?.overlap === true && !of.over && <Box as=\"span\" css={styles.cardMark} data-mark=\"overlap\"><FontAwesomeIcon icon={faTriangleExclamation} aria-label=\"Overlaps the next job\" /></Box>}\n        {of?.over === true && <Box as=\"span\" css={styles.cardMark} data-mark=\"over\"><FontAwesomeIcon icon={faCircleExclamation} aria-label=\"Over max\" /></Box>}\n        {of?.under === true && !of.over && <Box as=\"span\" css={styles.cardMark} data-mark=\"under\"><FontAwesomeIcon icon={faArrowDown} aria-label=\"Under minimum\" /></Box>}\n    </>;\n    // A split bin's part (A71): its resource and what it holds there — one button, which opens the Chooser that moves it — and its ×.\n    // Two parts and `+ resource` share the Resource and Load columns, 176 + 144px at the Table's least width, so a part has no chevron\n    // of its own and no marks: its tooltip is its resource's load line, as the Load cell's is (A84), and the row's Status says Check\n    // for any resource of it over max or held into its next job (A43).\n    const partChip = (part: { key: string; quantity: number }) => {\n        const of = context.resources.get(part.key), at = props.loads.get(part.key);\n        const name = of?.label ?? part.key, figure = board.quantity(part.quantity, unit);\n        const loadLine = of === undefined || at === undefined ? undefined : board.load(at.fill, of, unit);\n        const was = committed?.parts.get(part.key);\n        const title = `${name} · ${figure}${loadLine === undefined ? \"\" : ` · ${loadLine}`}`;\n        const inside = <><Box as=\"span\" css={styles.tableChipCode}>{name}</Box><Box as=\"span\" css={styles.tableChipQty}>{figure}</Box></>;\n        const face = (isOpen: boolean) => <chakra.button type=\"button\" css={styles.tablePartFace} aria-haspopup=\"listbox\" data-open={isOpen ? \"\" : undefined}\n            aria-label={`Move the ${figure} on ${name} to another ${one(nouns.resource)}`} title={title} onPointerDown={event => event.stopPropagation()}>{inside}</chakra.button>;\n        return <Box key={part.key} css={[styles.tableChip, styles.tablePart]} data-allocation-chip=\"part\" data-allocation-part={part.key}\n            data-draft={was === undefined || compareFloat(was, part.quantity) !== 0 ? \"\" : undefined}>\n            {chooser(\"resource\", face, part.key) ?? <Box as=\"span\" css={styles.tablePartFace} title={title}>{inside}</Box>}\n            {editable && <chakra.button type=\"button\" css={styles.tableChipButton} data-allocation-chip-remove=\"\" aria-label={`Unlink ${code} from ${name}`} title={`Unlink ${code} from ${name}`}\n                onPointerDown={event => event.stopPropagation()} onClick={event => { event.stopPropagation(); if (row.bin !== undefined) commands.unlink(row.bin, part.key); }}>\n                <FontAwesomeIcon icon={faXmark} />\n            </chakra.button>}\n        </Box>;\n    };\n    // `+ resource` for what the parts leave (A71): its Chooser links the remainder.\n    const remainderWords = `Choose ${a(nouns.resource)} for the ${board.quantity(remainder, unit)} unallocated`;\n    const remainderInside = <>\n        <Box as=\"span\" css={styles.tableChipIcon} data-icon-role=\"idle\"><FontAwesomeIcon icon={faPlus} /></Box>\n        <Box as=\"span\" css={styles.tablePlaceholderText} data-say=\"idle\">{one(nouns.resource)}</Box>\n    </>;\n    const remainderTrigger = (isOpen: boolean) => <chakra.button type=\"button\" css={styles.tablePlaceholder} data-allocation-placeholder=\"remainder\" data-open={isOpen ? \"\" : undefined}\n        title={remainderWords} aria-label={remainderWords} aria-haspopup=\"listbox\" onPointerDown={event => event.stopPropagation()}>{remainderInside}</chakra.button>;\n    return <Box ref={given} css={styles.tableRow} role=\"row\" tabIndex={row.bin !== undefined ? -1 : undefined} data-allocation-row={row.key} data-kind={row.kind}\n        data-columns={shown === 0 ? \"none\" : undefined} data-selected={selectedAs !== undefined ? \"\" : undefined} data-draft={draft ? \"\" : undefined}\n        data-conflict={row.bin !== undefined && props.conflicted?.(row.bin) === true ? \"\" : undefined}\n        data-bounds={row.bin !== undefined && props.bounded?.(row.bin) === true ? \"\" : undefined} onClick={select}>\n        <Box as=\"span\" css={styles.tableTime} data-holds={bin !== undefined ? \"\" : undefined}>{time}</Box>\n        <Box as=\"span\" css={styles.tableLane}>{lane}</Box>\n        {row.kind === \"bin\" && bin !== undefined ? <>\n            <Box css={styles.tableCell} data-allocation-cell-side=\"arrival\">\n                <Box {...chip} css={styles.tableChip} data-scope=\"allocation\" data-allocation-chip=\"arrival\" data-draft={draft ? \"\" : undefined} data-draggable={chip !== undefined ? \"\" : undefined}\n                    data-op={op?.op} data-fill={op === undefined ? undefined : \"own\"}\n                    title={`${op === undefined ? \"\" : `${op.provenance} · `}${code}${meta?.type === \"some\" ? ` · ${meta.value}` : \"\"} · ${board.quantity(bin.quantity, unit)} · drag onto an empty row to move it`}\n                    onPointerDown={event => { if (row.bin !== undefined) drag.arm({ kind: \"body\", bin: row.bin }); chip?.onPointerDown?.(event); }}>\n                    {chip !== undefined && <Box as=\"span\" css={styles.tableChipIcon} data-icon-role=\"grip\"><FontAwesomeIcon icon={faGripVertical} /></Box>}\n                    <Box as=\"span\" css={styles.tableChipCode}>{code}</Box>\n                    {meta?.type === \"some\" && <Box as=\"span\" css={styles.tableChipMeta}>{meta.value}</Box>}\n                    {chooser(\"arrival\", chevron(arrivalLabel))}\n                    {editable && <chakra.button type=\"button\" css={styles.tableChipButton} data-allocation-chip-remove=\"\"\n                        aria-label={committed !== undefined ? `Remove ${code} from the plan · it moves to ${nouns.arrival.other}` : `Return ${code} to ${nouns.arrival.other}`}\n                        title={committed !== undefined ? `Remove ${code} from the plan · it moves to ${nouns.arrival.other}` : `Return ${code} to ${nouns.arrival.other}`}\n                        onPointerDown={event => event.stopPropagation()} onClick={event => { event.stopPropagation(); if (row.bin !== undefined) commands.remove(row.bin); }}>\n                        <FontAwesomeIcon icon={faXmark} />\n                    </chakra.button>}\n                </Box>\n            </Box>\n            <Box as=\"span\" css={styles.tableUnits}>{board.quantity(bin.quantity, unit)}</Box>\n            {Array.from({ length: shown }, (_, i) => { const cell = columns?.[i]; return <Box as=\"span\" key={i} css={styles.tableValue} data-tone={cell?.warn === true ? \"warning\" : undefined}>{cell?.text}</Box>; })}\n        </> : <Box ref={arrivalDrop} css={[styles.tableCell, styles.tableSpan]} data-allocation-cell-side=\"arrival\">\n            {/* With an arrival picked, a cell that takes it books it there on a click (A11); its Chooser waits. */}\n            {arrivalSay?.state === \"pick\" && editable\n                ? <Placeholder props={props} side=\"arrival\" reserved={row.kind === \"reserved\"} open={false} button say={arrivalSay} onBook={() => props.book(arrivalTarget(row))} />\n                : chooser(\"arrival\", placeholder(\"arrival\")) ?? <Placeholder props={props} side=\"arrival\" reserved={row.kind === \"reserved\"} open={false} button={false} say={arrivalSay} />}\n        </Box>}\n        {split && row.bin !== undefined ? <Box ref={resourceDrop} css={[styles.tableCell, styles.tableResourceSpan, styles.tableParts]} data-allocation-cell-side=\"resource\"\n            data-allocation-parts=\"\">\n            {parts.map(partChip)}\n            {compareFloat(remainder, 0) > 0 && (chooser(\"resource\", remainderTrigger, null)\n                ?? <Box css={styles.tablePlaceholder} data-allocation-placeholder=\"remainder\" title={`${board.quantity(remainder, unit)} unallocated`}>{remainderInside}</Box>)}\n        </Box> : resource !== undefined && row.bin !== undefined ? <>\n            <Box ref={resourceDrop} css={styles.tableCell} data-allocation-cell-side=\"resource\">\n                <Box css={styles.tableChip} data-allocation-chip=\"resource\" data-draft={draft ? \"\" : undefined} data-verdict={resourceSay?.state}\n                    data-op={row.kind === \"reserved\" ? op?.op : undefined} data-fill={row.kind === \"reserved\" && op !== undefined ? \"own\" : undefined}\n                    title={resourceSay?.state === \"refused\" && resourceSay.reason !== undefined ? resourceSay.reason\n                        : `${row.kind === \"reserved\" && op !== undefined ? `${op.provenance} · ` : \"\"}${resource.label}${resource.meta.type === \"some\" ? ` · ${resource.meta.value}` : \"\"}`}>\n                    <Box as=\"span\" css={styles.tableChipIcon}><FontAwesomeIcon icon={faLink} /></Box>\n                    <Box as=\"span\" css={styles.tableChipCode}>{resource.label}</Box>\n                    {chooser(\"resource\", chevron(resourceLabel))}\n                    {editable && <chakra.button type=\"button\" css={styles.tableChipButton} data-allocation-chip-remove=\"\"\n                        aria-label={row.kind === \"reserved\" ? `Remove the ${one(nouns.reservation)}` : `Unlink ${code} from ${resource.label}`}\n                        title={row.kind === \"reserved\" ? `Remove the ${one(nouns.reservation)}` : `Unlink ${code} from ${resource.label}`}\n                        onPointerDown={event => event.stopPropagation()}\n                        onClick={event => { event.stopPropagation(); if (row.kind === \"reserved\") commands.remove(row.bin!); else commands.unlink(row.bin!, resource.key); }}>\n                        <FontAwesomeIcon icon={faXmark} />\n                    </chakra.button>}\n                </Box>\n            </Box>\n            <Box as=\"span\" css={styles.tableLoad} data-tone={line?.over === true ? \"danger\" : line?.overlap === true || line?.under === true ? \"warning\" : undefined}\n                title={`${resource.label} · ${loadText}${into === undefined ? \"\" : ` · ${board.quantity(into, \"\")} d into the next job`}`}>\n                <span>{loadText}</span>\n                {marksOf(line)}\n            </Box>\n        </> : <Box ref={resourceDrop} css={[styles.tableCell, styles.tableResourceSpan]} data-allocation-cell-side=\"resource\">\n            {chooser(\"resource\", placeholder(\"resource\")) ?? <Placeholder props={props} side=\"resource\" reserved={false} open={false} button={false} say={resourceSay} />}\n        </Box>}\n        <Box as=\"span\" css={styles.tableStatus} data-status={status}><Box as=\"span\" css={styles.tableStatusDot} />{status === \"Reserved\" ? nouns.reserved : status}</Box>\n    </Box>;\n});\n\n/**\n * A dashed placeholder (A45): `no arrival` (`no arrival · reserved`) or `no\n * resource`, in the board's nouns; editable, it is its cell's Chooser's\n * button, the chevron at its end. During a drag it says what a drop does.\n */\nfunction Placeholder({ props, side, reserved, open, button, say, onBook, ...trigger }: {\n    props: TableProps; side: \"arrival\" | \"resource\"; reserved: boolean; open: boolean; button: boolean;\n    /** What it says during a drag or a pick (A45). */\n    say?: Say | undefined;\n    /** With an arrival picked, its click books it here (A11). */\n    onBook?: (() => void) | undefined;\n}) {\n    const { styles } = props;\n    const nouns = useNouns();\n    const idle = side === \"arrival\" ? `no ${one(nouns.arrival)}${reserved ? ` · ${lower(nouns.reserved)}` : \"\"}` : `no ${one(nouns.resource)}`;\n    const choose = side === \"arrival\" ? `Choose ${a(nouns.arrival)}, or drag one here from ${nouns.arrival.other}` : `Choose ${a(nouns.resource)}, or drag one here from ${nouns.resource.other}`;\n    // Refused, its reason is its tooltip (A45).\n    const title = say?.state === \"refused\" && say.reason !== undefined ? say.reason : say?.state === \"pick\" && say.pick !== undefined ? say.pick : choose;\n    const inside = <>\n        <Box as=\"span\" css={styles.tableChipIcon} data-icon-role=\"idle\"><FontAwesomeIcon icon={side === \"arrival\" ? faInbox : faLinkSlash} /></Box>\n        <Box as=\"span\" css={styles.tableChipIcon} data-icon-role=\"refused\"><FontAwesomeIcon icon={faXmark} /></Box>\n        <Box as=\"span\" css={styles.tablePlaceholderText} data-say=\"idle\">{idle}</Box>\n        <Box as=\"span\" css={styles.tablePlaceholderText} data-say=\"drop\">{say?.drop ?? \"drop to move here\"}</Box>\n        <Box as=\"span\" css={styles.tablePlaceholderText} data-say=\"refused\">doesn’t fit</Box>\n        {say?.reason !== undefined && <Box as=\"span\" css={styles.tablePlaceholderText} data-say=\"reason\">{say.reason}</Box>}\n        {say?.pick !== undefined && <Box as=\"span\" css={styles.tablePlaceholderText} data-say=\"pick\">{say.pick}</Box>}\n        {button && onBook === undefined && <Box as=\"span\" css={styles.tableChipIcon} data-icon-role=\"chevron\"><FontAwesomeIcon icon={open ? faChevronUp : faChevronDown} /></Box>}\n    </>;\n    if (onBook !== undefined) {\n        return <chakra.button type=\"button\" css={styles.tablePlaceholder} data-allocation-placeholder={side} data-verdict={say?.state} title={title} aria-label={title}\n            onClick={event => { event.stopPropagation(); onBook(); }}>{inside}</chakra.button>;\n    }\n    return button\n        ? <chakra.button type=\"button\" {...trigger} css={styles.tablePlaceholder} data-allocation-placeholder={side} data-verdict={say?.state} data-open={open ? \"\" : undefined} title={title} aria-label={title} aria-haspopup=\"listbox\">{inside}</chakra.button>\n        : <Box css={styles.tablePlaceholder} data-allocation-placeholder={side} data-verdict={say?.state} title={title}>{inside}</Box>;\n}\n\n/**\n * A Chooser in the shared anchored popover (A48): its trigger, the sections\n * its question was answered with, and what a choice does; its search takes the\n * focus as it opens.\n *\n * @param args - Its identity (`data-allocation-choices`), its label, its trigger, whether it is open, its sections, its search's words and what a choice does\n * @returns The popover\n */\nexport function ChooserPopover({ id, label, trigger, open, onOpenChange, sections, placeholder, onChoose }: {\n    id: string; label: string; trigger: ReactElement; open: boolean; onOpenChange: (open: boolean) => void;\n    sections: ChooserSection[]; placeholder: string; onChoose: (key: string) => void;\n}) {\n    return <SliceEditPopover trigger={trigger} open={open} onOpenChange={onOpenChange} flush label={label}\n        initialFocusEl={() => document.querySelector<HTMLElement>(`[data-allocation-choices=\"${id}\"] input`)}>\n        <Box data-allocation-choices={id}>\n            {open && <Chooser sections={sections} placeholder={placeholder} onChoose={onChoose} />}\n        </Box>\n    </SliceEditPopover>;\n}\n\n/** What a cell's Chooser reads of the board: the day, every arrival and resource, the fit, the commands, the days it asks of, and what the narrowing shows. */\nexport type ChoiceScene = Pick<TableProps, \"plan\" | \"context\" | \"day\" | \"fit\" | \"commands\" | \"without\" | \"reserving\" | \"visibleArrivals\" | \"visibleResources\">;\n\n/**\n * A cell's chevron and its Chooser (A48, A49): the question the cell asks the\n * fit, its answer's sections, and what a choice does. A split bin's part\n * chip moves that part, and `+ resource` links the remainder, each asked\n * for the quantity it places (A71, A73). A narrow card's `Book…`, `Reserve…`,\n * `Allocate…` and `Move` are these Choosers on its own trigger (A78).\n *\n * @param args - The board, the row, its side and part, whether it is open, the words and its trigger\n * @returns The Chooser's popover on its trigger\n */\nexport function ChoiceCell({ props, row, side, part, open, setOpen, words, trigger }: {\n    props: ChoiceScene; row: TableRow; side: \"arrival\" | \"resource\";\n    /** A resource Chooser's part: the row's (`undefined`, its bin's first), a part's resource, or the remainder (`null`). */\n    part?: string | null | undefined;\n    open: boolean; setOpen: (open: Open | undefined) => void; words: ChoiceWords;\n    trigger: (open: boolean) => ReactElement;\n}) {\n    const { plan, context, day, fit, commands } = props;\n    const nouns = useNouns();\n    const bin = row.bin === undefined ? undefined : plan.bins.get(row.bin);\n    const current = bin === undefined ? undefined : partsOf(bin)[0]?.key;\n    // The part a resource Chooser moves: the row's first, a chip's own, or none for the remainder, which it links.\n    const from = part === undefined ? current : part ?? undefined;\n    // The question (F1): an arrival cell takes its row's resource, of the day without its bin; a resource cell places what it moves of\n    // its bin — the part, or the remainder (A73) — or a reservation in its free slot.\n    const question = useMemo((): { ask: FitAsk; of: Day | undefined } | undefined => {\n        if (side === \"arrival\") {\n            if (current === undefined || row.bin === undefined) return undefined;\n            return { ask: variant(\"take\", { resource: current }), of: props.without(row.bin) };\n        }\n        if (row.bin === undefined) return { ask: variant(\"place\", { subject: variant(\"bin\", RESERVE_PROBE), quantity: 0 }), of: props.reserving(row.lane, row.slotAt) };\n        const quantity = bin === undefined ? 0 : bin.arrival.type === \"none\" ? 0 : linkedQuantity(bin, from)?.quantity ?? bin.quantity;\n        return { ask: variant(\"place\", { subject: variant(\"bin\", row.bin), quantity }), of: undefined };\n        // The question stands for the row's cell and the drafts.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [side, row.bin, row.lane, row.slotAt, current, from, plan]);\n    const { ask } = fit;\n    useEffect(() => { if (open && question !== undefined) ask(question.ask, question.of); }, [open, question, ask]);\n    const answer = question === undefined ? undefined : fit.answer(question.ask, question.of);\n    // `+ resource` offers the resources its bin is not on: each it is on is a part of its own (A71).\n    const except = part === null && bin !== undefined ? new Set(bin.parts.keys()) : undefined;\n    const sections: ChooserSection[] = !open ? [] : side === \"arrival\"\n        ? arrivalChoices({ plan, context, day, words, bin: row.bin, resource: current, answer, shown: props.visibleArrivals })\n        : resourceChoices({ context, words, binRow: row.kind === \"bin\", current: from, answer, shown: props.visibleResources, except });\n    const close = () => setOpen(undefined);\n    const choose = (key: string) => {\n        close();\n        if (side === \"arrival\") {\n            if (bin?.arrival.type === \"some\" && key === bin.arrival.value) return;\n            if (row.kind === \"bin\" && row.bin !== undefined) commands.replace(row.bin, key);\n            else if (row.kind === \"reserved\" && row.bin !== undefined) commands.fillWith(row.bin, key);\n            else commands.book(key, row.lane, row.slotAt, undefined);\n            return;\n        }\n        if (key === from) return;\n        if (row.bin !== undefined) commands.link(row.bin, key, from);\n        else commands.reserve(row.lane, row.slotAt, key);\n    };\n    return <ChooserPopover id={`${row.key}|${openKey(side, part)}`} trigger={trigger(open)} open={open} onOpenChange={next => setOpen(next ? { row: row.key, side, part } : undefined)}\n        label={`${side === \"arrival\" ? nouns.arrival.one : nouns.resource.one} · ${words.lane(row.lane)} ${formatDatePattern(\"HH:mm\", row.at)}`}\n        sections={sections} placeholder={`Find ${a(side === \"arrival\" ? nouns.arrival : nouns.resource)}`} onChoose={choose} />;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The narrow layout (`Allocation Spec.md` §9.12, A78, #1333): below 480px of\n * main, the Timeline is a card per resource the narrowing shows — its load\n * line, its bins today with Unlink, Move, `Split…` and Back to Arrivals, and\n * `Book an arrival…` — and the Table a card per row in its time bands, with\n * `Book…`, `Reserve…`, `Allocate…`, a whole bin's `Split…`, `Unlink` and `Back\n * to Arrivals`, in the board's nouns. A choice is the Table's Chooser in its\n * anchored popover, asking the fit what its cell asks; Unlink and Back to\n * Arrivals act at once, each a\n * draft the history undoes, and Move takes a bin's part to another resource\n * (ruled 19 Oct). `Split…` is the Inspector's popover (`split.tsx`, #1362).\n * Every action is one of the board's commands. Nothing here registers a drag source, a drop\n * target or a handle; the cards' looks are the shared agenda part's, as the\n * Roster's and the Calendar's are. A day not read yet draws each resource's\n * card — its name and what is known of it without the day's read — or each\n * band's head and one placeholder card in it, its contents placeholders once\n * the reveal says so (#1398, CL2); a day whose read failed says so once, in\n * the first card in view (CL11).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { Box, Button, chakra } from \"@chakra-ui/react\";\nimport { variant, type SortedMap, type option } from \"@elaraai/east\";\nimport { LoadingFailedLine, PlaceholderShape, VirtualRows, formatDatePattern, useRowsTop } from \"@elaraai/east-ui-components/internal\";\nimport type { PeriodRead } from \"../shared/loading.js\";\nimport { GroupHeading, useGroupCollapse } from \"../shared/schedule/group-heading.js\";\nimport { remainderOf, splitOf } from \"./actions.js\";\nimport { useBinFocusTarget } from \"./bin-focus.js\";\nimport { arrivalChoices, type ChoiceWords } from \"./choices.js\";\nimport { binCode, matesOf, type InspectorWords, type Mate } from \"./inspector-model.js\";\nimport { NarrowedEmpty } from \"./narrowed.js\";\nimport type { AllocationOptimised } from \"./optimise.js\";\nimport { SplitPopover } from \"./split.js\";\nimport { a, one, other, useNouns } from \"./nouns.js\";\nimport { ChoiceCell, ChooserPopover, openKey, type ChoiceScene, type Open } from \"./table.js\";\nimport { bandLine, narrowBands, rowStatus, tableBands, tableRows, type TableBand, type TableRow } from \"./table-rows.js\";\nimport type { TimelineFollow } from \"./timeline.js\";\nimport {\n    allocationWords, compareFloat, focusOf, partsOf, type AllocationStyles, type AllocationValue, type Bin, type Day, type FitAsk, type Load, type ResourceLine, type Selection, type Slot,\n} from \"./model.js\";\n\n/** The cards' props: what a cell's Chooser reads, and the board's drafts, figures, selection and commands. */\nexport interface CardsProps extends ChoiceScene {\n    value: AllocationValue;\n    styles: AllocationStyles;\n    /** The day as the record holds it: what a draft differs from. */\n    held: Day | undefined;\n    sameBin: (a: Bin, b: Bin) => boolean;\n    /** Whether a bin holds a conflict not yet chosen: it wears the warn ring. None by default. */\n    conflicted?: ((id: string) => boolean) | undefined;\n    /** Whether a bin's row breaks its form's bounds (#1585), stored or changed: it wears the warn ring too. None by default. */\n    bounded?: ((id: string) => boolean) | undefined;\n    loads: SortedMap<string, Load>;\n    /** Each resource's line on the day (A19). */\n    lines: ReadonlyMap<string, ResourceLine>;\n    slots: readonly Slot[];\n    /** Which layout the cards stand for. */\n    layout: \"timeline\" | \"table\";\n    /** The board's drag surface: the Table's bands keep their folds by it, the cards' with them. */\n    surface: string;\n    selection: Selection | undefined;\n    /** An explicit inspection: what a card's head selects. */\n    select: (next: Selection | undefined) => void;\n    /** Selecting follows the selection (A12): its card scrolls into view. */\n    follow: TimelineFollow;\n    /** Whether the day takes edits: with none, the cards have no actions. */\n    editable: boolean;\n    /** The lanes the narrowing shows, by key; `none` for every one. */\n    visibleLanes: option<Set<string>>;\n    /** Clears the narrowing, where nothing shows; `undefined` with no narrowing. */\n    clearFilters: (() => void) | undefined;\n    /** Books an arrival onto a resource at the day's first free slot (A36), as a drop on its row does. */\n    bookOnto: (arrival: string, resource: string) => void;\n    /**\n     * What the cards draw of the day's read (#1398): the day as read; a day not read yet — the day without its bins handed\n     * in as `plan`, each card's contents placeholders once the reveal says so; or one whose read failed — the failure said\n     * once, in the first card in view.\n     */\n    read: PeriodRead;\n    /** What the runs of the app's optimiser left on the day's bins (#1409): each bin's operation, drawn on its card, and its provenance on hover. */\n    optimised?: AllocationOptimised | undefined;\n    /** Whether a run's highlight is on (#1409): a band's count flashes where the run changed its rows. */\n    lit?: boolean | undefined;\n}\n\n/** The failure said once, in the first card in view (#1398, CL11): the day's words and its Retry. */\nfunction ReadFailure({ read }: { read: Extract<PeriodRead, { state: \"failed\" }> }) {\n    return <LoadingFailedLine message={read.message} retry={{ onRetry: read.retry }} />;\n}\n\n/**\n * The first card in view among a list's lines that `holds`, else the last one above it: where a failed day says so once\n * (#1398).\n *\n * @param count - The list's lines\n * @param holds - Whether a line is one that may say it\n * @param top - The line at the top of the view; `undefined` before the lines are placed\n * @returns The line's index; `undefined` with none that holds\n */\nfunction firstInView(count: number, holds: (index: number) => boolean, top: number | undefined): number | undefined {\n    const from = Math.max(0, top ?? 0);\n    for (let i = from; i < count; i++) if (holds(i)) return i;\n    for (let i = Math.min(from, count) - 1; i >= 0; i--) if (holds(i)) return i;\n    return undefined;\n}\n\n/** Every resource's card may say a failed day's failure. */\nconst ANY_CARD = () => true;\n\n/** What a card's Chooser has open: its row's cell (`Open`), or a resource card's `Book an arrival…`. */\ntype CardsOpen = Open | undefined;\n\n/** The cards' words: a Chooser's and the inspector's, from the board's figures. */\ninterface CardWords { choice: ChoiceWords; inspector: InspectorWords }\n\n/**\n * The narrow layout (see the module docs).\n *\n * @param props - See {@link CardsProps}\n * @returns A card per resource (the Timeline's), or per row (the Table's)\n */\nexport function AllocationCards(props: CardsProps) {\n    const { value, context } = props;\n    const nouns = useNouns();\n    const unit = context.unit;\n    const words = useMemo((): CardWords => {\n        const board = allocationWords();\n        const lane = (key: string) => value.lanes.find(l => l.key === key)?.label ?? key;\n        return {\n            choice: { quantity: v => board.quantity(v, unit), number: v => board.quantity(v, \"\"), lane, nouns },\n            inspector: { nouns, quantity: v => board.quantity(v, unit), number: v => board.quantity(v, \"\"), lane, load: (fill, row) => board.load(fill, row, unit) },\n        };\n    }, [value.lanes, unit, nouns]);\n    return props.layout === \"timeline\" ? <ResourceCards props={props} words={words} /> : <RowCards props={props} words={words} />;\n}\n\n/** The Timeline's cards (A78): a card per resource the narrowing shows, in the resources' key order, as its rows are (A18). */\nfunction ResourceCards({ props, words }: { props: CardsProps; words: CardWords }) {\n    const { context, visibleResources, plan, styles } = props;\n    const keys = useMemo(() => [...context.resources.keys()].filter(key => visibleResources.type === \"none\" || visibleResources.value.has(key)),\n        [context.resources, visibleResources]);\n    // Every bin's row, as the Table names it: what a bin's Move asks of.\n    const rows = useMemo(() => new Map(tableRows(props.slots, plan).map(row => [row.key, row] as const)), [props.slots, plan]);\n    const [open, setOpen] = useState<CardsOpen>();\n    const getItemKey = useCallback((index: number) => keys[index]!, [keys]);\n    // Selecting follows the selection (A12): the selected resource's card, or the card of the selected bin's resource.\n    const focus = focusOf(props.selection, plan);\n    const followed = focus === undefined ? -1 : keys.indexOf(focus);\n    // The narrowing's empty state only under a narrowing (#1398, CL13).\n    if (keys.length === 0) return <Box css={styles.cards} data-allocation-cards=\"timeline\">{visibleResources.type === \"some\" && <NarrowedEmpty styles={styles} clear={props.clearFilters} />}</Box>;\n    return <Box css={styles.cards} data-allocation-cards=\"timeline\">\n        <VirtualRows fillParent height={undefined} maxHeight={undefined} rootCss={styles.agenda} count={keys.length} getItemKey={getItemKey}\n            estimateSize={() => 152} overscan={2} scrollToIndex={followed < 0 ? undefined : followed} scrollNonce={props.follow.nonce} scrollAlign=\"auto\"\n            renderRow={index => <Box css={styles.agendaItem}><ResourceCard props={props} words={words} resource={keys[index]!} rows={rows} open={open} setOpen={setOpen}\n                index={index} count={keys.length} /></Box>} />\n    </Box>;\n}\n\n/**\n * A resource's card: its name and its load line, one button that selects it; its bins today; and `Book an arrival…`.\n * A day not read yet: its name and what its line knows without the day's read, a placeholder where its bins go; a day\n * whose read failed, the failure in the first card in view (#1398).\n */\nfunction ResourceCard({ props, words, resource, rows, open, setOpen, index, count }: {\n    props: CardsProps; words: CardWords; resource: string; rows: ReadonlyMap<string, TableRow>; open: CardsOpen; setOpen: (open: CardsOpen) => void;\n    /** Its place in the list: what keys its placeholder's width. */\n    index: number;\n    /** The cards in the list: the first in view of a failed day says so, which the card reads itself (CL9). */\n    count: number;\n}) {\n    const { context, styles, plan, held, selection, read } = props;\n    const failing = useRowsTop(top => read.state === \"failed\" && index === firstInView(count, ANY_CARD, top));\n    const row = context.resources.get(resource)!;\n    const line = props.lines.get(resource);\n    const mates = matesOf(plan, held, resource, context, words.inspector);\n    const selected = selection?.type === \"resource\" && selection.key === resource;\n    return <Box css={styles.agendaCard} data-allocation-resource-card={resource} data-selected={selected ? \"\" : undefined} data-allocation-unread={read.state === \"held\" ? undefined : \"\"}>\n        <chakra.button type=\"button\" css={styles.agendaCardHead} aria-pressed={selected} onClick={() => props.select({ type: \"resource\", key: resource })}>\n            <Box css={styles.agendaCardTitle}>{row.label}</Box>\n            {line !== undefined && <Box css={styles.agendaLine} data-allocation-card-line=\"\" data-tone={line.over ? \"danger\" : line.overlap || line.under ? \"warning\" : undefined}>{line.text}</Box>}\n        </chakra.button>\n        {/* A day not read yet: a placeholder where its bins go, unseen until the frame's reveal says so; failed, its place kept, blank. */}\n        {read.state !== \"held\" ? failing && read.state === \"failed\" ? <ReadFailure read={read} />\n            : <Box css={styles.agendaLine} data-blank={read.state === \"failed\" ? \"\" : undefined}><PlaceholderShape kind=\"text\" index={index} /></Box>\n            : mates.length === 0 ? <Box css={styles.agendaLine}>no {other(props.value.labels.bin)} today</Box>\n                : mates.map(mate => <ResourceBin key={mate.id} props={props} words={words} resource={resource} mate={mate} row={rows.get(`bin:${mate.id}`)} open={open} setOpen={setOpen} />)}\n        {props.editable && <Box css={styles.agendaActions}><BookOnto props={props} words={words} resource={resource} open={open} setOpen={setOpen} /></Box>}\n    </Box>;\n}\n\n/**\n * A bin on a resource's card: its time, lane, code and what it puts there, one\n * button that selects it; then Unlink (its part there), Move (that part, to\n * another resource), `Split…` (what is left unallocated, or with nothing left\n * some of its part there, onto another resource) and Back to Arrivals — a\n * reservation's Move and Remove.\n */\nfunction ResourceBin({ props, words, resource, mate, row, open, setOpen }: {\n    props: CardsProps; words: CardWords; resource: string; mate: Mate; row: TableRow | undefined; open: CardsOpen; setOpen: (open: CardsOpen) => void;\n}) {\n    const { plan, held, context, styles, commands } = props;\n    const nouns = useNouns();\n    const bin = plan.bins.get(mate.id)!;\n    const committed = held?.bins.get(mate.id);\n    const draft = committed === undefined || !props.sameBin(committed, bin);\n    const selected = props.selection?.type === \"bin\" && props.selection.id === mate.id;\n    const reserved = bin.arrival.type === \"none\";\n    const name = context.resources.get(resource)?.label ?? resource;\n    // Its head takes the keyboard a pick in Search Records gives the bin (#1398).\n    const given = useBinFocusTarget<HTMLButtonElement>(mate.id);\n    const move = row === undefined ? null : <ChoiceCell props={props} row={row} side=\"resource\" part={resource} words={words.choice}\n        open={open?.row === row.key && openKey(open.side, open.part) === openKey(\"resource\", resource)} setOpen={setOpen}\n        trigger={() => <Button size=\"xs\" variant=\"outline\" title={reserved ? `Move the ${one(nouns.reservation)} to another ${one(nouns.resource)}` : `Move the ${mate.quantity} on ${name} to another ${one(nouns.resource)}`}>Move</Button>} />;\n    const split = reserved || splitOf(bin, resource) === undefined ? null : <SplitPopover id={mate.id} bin={bin} from={resource} context={context} plan={plan} commands={commands}\n        fit={props.fit} words={words.inspector} shown={props.visibleResources} trigger={label => <Button size=\"xs\" variant=\"outline\" title={label} data-allocation-split-open=\"\">Split…</Button>} />;\n    // What a run of the optimiser did to the bin (#1409, R7, R17), while it is still the run's draft: its mark, and its provenance on hover.\n    const op = draft ? props.optimised?.ops.get(mate.id) : undefined;\n    return <Box css={styles.agendaBin} data-allocation-card-bin={mate.id} data-draft={draft ? \"\" : undefined} data-conflict={props.conflicted?.(mate.id) === true ? \"\" : undefined}\n        data-bounds={props.bounded?.(mate.id) === true ? \"\" : undefined} data-selected={selected ? \"\" : undefined} data-op={op?.op} data-fill={op === undefined ? undefined : \"own\"} title={op?.provenance}>\n        <chakra.button ref={given} type=\"button\" css={styles.agendaBinHead} title={mate.tip} aria-pressed={selected} onClick={() => props.select({ type: \"bin\", id: mate.id })}>\n            <span>{mate.time} · {mate.lane}</span><span>{mate.code}</span><span>{mate.quantity}</span>\n        </chakra.button>\n        {props.editable && <Box css={styles.agendaActions}>\n            {reserved ? <>\n                {move}\n                <Button size=\"xs\" variant=\"outline\" title={`Remove the ${one(nouns.reservation)} · the slot becomes free`} onClick={() => commands.remove(mate.id)}>Remove</Button>\n            </> : <>\n                <Button size=\"xs\" variant=\"outline\" title={`Unlink ${mate.code} from ${name}`} onClick={() => commands.unlink(mate.id, resource)}>Unlink</Button>\n                {move}\n                {split}\n                <Button size=\"xs\" variant=\"outline\" onClick={() => commands.remove(mate.id)}\n                    title={committed !== undefined ? `Remove ${mate.code} from the plan · it moves to ${nouns.arrival.other}` : `Return ${mate.code} to ${nouns.arrival.other}`}>\n                    Back to {nouns.arrival.other}\n                </Button>\n            </>}\n        </Box>}\n    </Box>;\n}\n\n/**\n * A resource card's `Book an arrival…` (A78): the arrivals the plan has not\n * booked, each as the fit takes it on the resource — its fits, then those\n * that don't fit, then the arrivals already on the board — and a choice books\n * it there at the day's first free slot, as a drop on its row does (A36).\n */\nfunction BookOnto({ props, words, resource, open, setOpen }: { props: CardsProps; words: CardWords; resource: string; open: CardsOpen; setOpen: (open: CardsOpen) => void }) {\n    const { fit, context } = props;\n    const nouns = useNouns();\n    const id = `resource:${resource}`;\n    const isOpen = open?.row === id;\n    // The question (F1): the resource taken, of the day as drafted — a verdict for each arrival not booked.\n    const ask = useMemo((): FitAsk => variant(\"take\", { resource }), [resource]);\n    const { ask: asking } = fit;\n    useEffect(() => { if (isOpen) asking(ask); }, [isOpen, ask, asking]);\n    const answer = fit.answer(ask);\n    const sections = !isOpen ? [] : arrivalChoices({ plan: props.plan, context, day: props.day, words: words.choice, bin: undefined, resource, answer, shown: props.visibleArrivals });\n    const name = context.resources.get(resource)?.label ?? resource;\n    return <ChooserPopover id={`${id}|book`} label={`Book ${a(nouns.arrival)} · ${name}`} open={isOpen} onOpenChange={next => setOpen(next ? { row: id, side: \"arrival\" } : undefined)}\n        trigger={<Button size=\"xs\" variant=\"outline\">Book {a(nouns.arrival)}…</Button>} sections={sections} placeholder={`Find ${a(nouns.arrival)}`}\n        onChoose={key => { setOpen(undefined); props.bookOnto(key, resource); }} />;\n}\n\n/** One line of the Table's cards: a band's head, a row's card, or a band's placeholder card while the day is not read (#1398). */\ntype Line = { kind: \"band\"; band: TableBand } | { kind: \"row\"; row: TableRow } | { kind: \"unread\"; band: TableBand };\n\n/**\n * The Table's cards (A78): a card per row the narrowing shows, in the Table's bands, folded as the Table's are. A day not\n * read yet: each band's head, and one placeholder card in each that holds a slot (#1398).\n */\nfunction RowCards({ props, words }: { props: CardsProps; words: CardWords }) {\n    const { value, plan, styles, context, read } = props;\n    const { visibleLanes, visibleResources, visibleArrivals } = props;\n    const bands = useMemo(() => narrowBands(tableBands(tableRows(props.slots, plan), plan, props.day, value.table.bands), plan, visibleLanes, visibleResources, visibleArrivals),\n        [props.slots, plan, props.day, value.table.bands, visibleLanes, visibleResources, visibleArrivals]);\n    const { collapsed, toggle } = useGroupCollapse(`${props.surface}.table`);\n    const unread = read.state !== \"held\";\n    const lines = useMemo((): Line[] => bands.flatMap(band => [{ kind: \"band\" as const, band },\n        ...(collapsed.includes(band.key) ? [] : unread ? band.rows.length === 0 ? [] : [{ kind: \"unread\" as const, band }]\n            : band.rows.map(row => ({ kind: \"row\" as const, row })))]), [bands, collapsed, unread]);\n    const [open, setOpen] = useState<CardsOpen>();\n    const getItemKey = useCallback((index: number) => {\n        const l = lines[index]!;\n        return l.kind === \"band\" ? `band:${l.band.key}` : l.kind === \"unread\" ? `unread:${l.band.key}` : l.row.key;\n    }, [lines]);\n    const board = allocationWords();\n    // Selecting follows the selection (A12): the selected bin's or slot's card.\n    const { selection } = props;\n    const followed = selection === undefined ? -1 : lines.findIndex(l => l.kind === \"row\" && ownRow(selection, l.row));\n    // The narrowing's empty state only under a narrowing (#1398, CL13).\n    const narrowed = visibleLanes.type === \"some\" || visibleResources.type === \"some\" || visibleArrivals.type === \"some\";\n    if (lines.length === 0) return <Box css={styles.cards} data-allocation-cards=\"table\">{narrowed && <NarrowedEmpty styles={styles} clear={props.clearFilters} />}</Box>;\n    return <Box css={styles.cards} data-allocation-cards=\"table\">\n        <VirtualRows fillParent height={undefined} maxHeight={undefined} rootCss={styles.agenda} count={lines.length} getItemKey={getItemKey}\n            estimateSize={index => lines[index]!.kind === \"band\" ? 46 : 132} overscan={2} scrollToIndex={followed < 0 ? undefined : followed}\n            scrollNonce={props.follow.nonce} scrollAlign=\"auto\" renderRow={index => {\n                const line = lines[index]!;\n                if (line.kind === \"band\") {\n                    const folded = collapsed.includes(line.band.key);\n                    // A day not read yet: its band's count a placeholder, its line said once its rows land.\n                    return <Box css={styles.agendaItem}><GroupHeading scope=\"allocation\" group={{ key: line.band.key, label: line.band.label }} styles={styles} collapsed={folded} toggle={toggle}>\n                        {unread ? read.state === \"pending\" && <PlaceholderShape kind=\"count\" index={index} /> : <>\n                            <Box as=\"span\" css={styles.bandCount} data-allocation-band-count=\"\"\n                                data-opn={props.lit === true && line.band.rows.some(r => r.bin !== undefined && props.optimised?.ops.has(r.bin) === true) ? \"\" : undefined}>{line.band.rows.length}</Box>\n                            <Box as=\"span\" css={styles.groupMeta}>{bandLine(line.band, board.quantity(Math.round(line.band.quantity), context.unit), folded, value.labels)}</Box>\n                        </>}\n                    </GroupHeading></Box>;\n                }\n                if (line.kind === \"unread\") return <Box css={styles.agendaItem}><UnreadRowCard styles={styles} band={line.band} index={index} lines={lines} read={read} /></Box>;\n                return <Box css={styles.agendaItem}><RowCard props={props} words={words} row={line.row} open={open} setOpen={setOpen} /></Box>;\n            }} />\n    </Box>;\n}\n\n/**\n * A band's placeholder card of a day not read, or whose read failed (#1398, CL2, CL11): its title, its line and its status\n * placeholders, unseen until the frame's reveal says so, or blank where the day failed — but in the first such card in\n * view, which says so once. It reads which line is at the top of the view itself (CL9).\n */\nfunction UnreadRowCard({ styles, band, index, lines, read }: { styles: AllocationStyles; band: TableBand; index: number; lines: readonly Line[]; read: PeriodRead }) {\n    const failing = useRowsTop(top => read.state === \"failed\" && index === firstInView(lines.length, i => lines[i]!.kind === \"unread\", top));\n    return <Box css={styles.agendaCard} data-allocation-row-card={`unread:${band.key}`} data-allocation-unread=\"\"\n        data-blank={read.state === \"failed\" ? \"\" : undefined} aria-hidden={failing ? undefined : true}>\n        {failing && read.state === \"failed\" ? <ReadFailure read={read} /> : <Box css={styles.agendaCardHead}>\n            <Box css={styles.agendaCardTitle}><PlaceholderShape kind=\"label\" index={index} /></Box>\n            <Box css={styles.agendaLine}><PlaceholderShape kind=\"text\" index={index + 1} /></Box>\n            <Box css={styles.agendaStatus}><PlaceholderShape kind=\"enum\" index={index} /></Box>\n        </Box>}\n    </Box>;\n}\n\n/** Whether a selection is a row's own (A44): its bin, or its free slot. */\nfunction ownRow(selection: Selection, row: TableRow): boolean {\n    if (selection.type === \"bin\") return row.bin === selection.id;\n    return selection.type === \"slot\" && row.kind === \"free\" && row.lane === selection.lane && row.slotAt.getTime() === selection.at;\n}\n\n/**\n * A row's card: its lane and time, what it holds and its status, one button\n * that selects it; and its actions — a free slot's `Book…` and `Reserve…`, a\n * bin's `Allocate…`, `Split…` while it is wholly on its resources (with some\n * of it unallocated, `Allocate…` places that), `Unlink` and `Back to Arrivals`,\n * a reservation's `Book…`, `Reserve…` and `Remove` — each its cell's command.\n */\nfunction RowCard({ props, words, row, open, setOpen }: { props: CardsProps; words: CardWords; row: TableRow; open: CardsOpen; setOpen: (open: CardsOpen) => void }) {\n    const { plan, held, context, styles, commands } = props;\n    const nouns = useNouns();\n    const board = allocationWords();\n    const unit = context.unit;\n    const bin = row.bin === undefined ? undefined : plan.bins.get(row.bin);\n    const committed = row.bin === undefined ? undefined : held?.bins.get(row.bin);\n    const draft = bin !== undefined && (committed === undefined || !props.sameBin(committed, bin));\n    const parts = bin === undefined ? [] : partsOf(bin);\n    const remainder = bin === undefined ? 0 : remainderOf(bin);\n    // A split or partly allocated bin: some of it is on a resource, and some is not (A70).\n    const unallocated = parts.length > 0 && compareFloat(remainder, 0) > 0;\n    const check = parts.some(part => { const l = props.lines.get(part.key); return l !== undefined && (l.over || l.overlap); });\n    const status = rowStatus(row.kind, parts.length > 0, check, draft);\n    const selected = props.selection !== undefined && ownRow(props.selection, row);\n    // A bin's card's head takes the keyboard a pick in Search Records gives the bin (#1398).\n    const given = useBinFocusTarget<HTMLButtonElement>(row.bin);\n    const lane = words.choice.lane(row.lane), time = formatDatePattern(\"HH:mm\", row.at);\n    const nameOf = (key: string) => context.resources.get(key)?.label ?? key;\n    const code = bin === undefined ? undefined : binCode(context, bin, nouns);\n    // What it holds: a bin's arrival and quantity, and where its parts are and what they leave (A70); a reservation's resource; nothing.\n    const holds = bin === undefined ? `no ${one(nouns.arrival)} · no ${one(nouns.resource)}`\n        : bin.arrival.type === \"none\" ? `${nouns.reserved} on ${parts[0] === undefined ? \"nothing\" : nameOf(parts[0].key)} · no ${one(nouns.arrival)} yet`\n            : `${code} · ${board.quantity(bin.quantity, unit)}`;\n    const where = bin === undefined || bin.arrival.type === \"none\" ? undefined\n        : parts.length === 0 ? \"not linked\" : parts.map(part => `${nameOf(part.key)} ${board.quantity(part.quantity, unit)}`).join(\" · \");\n    const chooser = (side: \"arrival\" | \"resource\", label: string, part?: string | null, title?: string) => <ChoiceCell props={props} row={row} side={side} part={part} words={words.choice}\n        open={open?.row === row.key && openKey(open.side, open.part) === openKey(side, part)} setOpen={setOpen}\n        trigger={() => <Button size=\"xs\" variant=\"outline\" title={title}>{label}</Button>} />;\n    // What a run of the optimiser did to the row's bin (#1409, R7, R17), while it is still the run's draft: its mark, and its provenance on hover.\n    const op = row.bin === undefined || !draft ? undefined : props.optimised?.ops.get(row.bin);\n    return <Box css={styles.agendaCard} data-allocation-row-card={row.key} data-kind={row.kind} data-draft={draft ? \"\" : undefined}\n        data-conflict={row.bin !== undefined && props.conflicted?.(row.bin) === true ? \"\" : undefined}\n        data-bounds={row.bin !== undefined && props.bounded?.(row.bin) === true ? \"\" : undefined} data-selected={selected ? \"\" : undefined}\n        data-op={op?.op} data-fill={op === undefined ? undefined : \"own\"} title={op?.provenance}>\n        <chakra.button ref={given} type=\"button\" css={styles.agendaCardHead} aria-pressed={selected}\n            onClick={() => props.select(row.bin !== undefined ? { type: \"bin\", id: row.bin } : { type: \"slot\", lane: row.lane, at: row.slotAt.getTime() })}>\n            <Box css={styles.agendaCardTitle}>{lane} · {time}</Box>\n            <Box css={styles.agendaLine}>{holds}</Box>\n            {where !== undefined && <Box css={styles.agendaLine} data-tone={parts.length === 0 ? \"warning\" : undefined}>{where}</Box>}\n            {unallocated && <Box css={styles.agendaLine} data-tone=\"warning\">{board.quantity(remainder, unit)} unallocated</Box>}\n            <Box as=\"span\" css={styles.agendaStatus} data-status={status}><Box as=\"span\" css={styles.tableStatusDot} />{status === \"Reserved\" ? nouns.reserved : status}</Box>\n        </chakra.button>\n        {props.editable && <Box css={styles.agendaActions}>\n            {row.kind !== \"bin\" && chooser(\"arrival\", \"Book…\", undefined, row.kind === \"reserved\" ? `Book ${a(nouns.arrival)} into the ${one(nouns.reservation)}` : `Book ${a(nouns.arrival)} into ${lane} ${time}`)}\n            {row.kind !== \"bin\" && chooser(\"resource\", \"Reserve…\", undefined, row.kind === \"reserved\" ? `Move the ${one(nouns.reservation)} to another ${one(nouns.resource)}` : `Reserve ${a(nouns.resource)}`)}\n            {row.kind === \"reserved\" && row.bin !== undefined\n                && <Button size=\"xs\" variant=\"outline\" title={`Remove the ${one(nouns.reservation)} · the slot becomes free`} onClick={() => commands.remove(row.bin!)}>Remove</Button>}\n            {row.kind === \"bin\" && row.bin !== undefined && <>\n                {/* What it links: the remainder of a split or partly allocated bin (A71), else its one part, as its row's chevron does. */}\n                {chooser(\"resource\", \"Allocate…\", unallocated ? null : undefined,\n                    parts.length === 0 ? `Choose ${a(nouns.resource)}` : unallocated ? `Choose ${a(nouns.resource)} for the ${board.quantity(remainder, unit)} unallocated` : `Change the ${one(nouns.resource)}`)}\n                {bin !== undefined && parts.length > 0 && !unallocated && <SplitPopover id={row.bin} bin={bin} context={context} plan={plan} commands={commands} fit={props.fit}\n                    words={words.inspector} shown={props.visibleResources} trigger={label => <Button size=\"xs\" variant=\"outline\" title={label} data-allocation-split-open=\"\">Split…</Button>} />}\n                {parts.length > 0 && <Button size=\"xs\" variant=\"outline\" title={`Unlink ${code} from ${parts.map(part => nameOf(part.key)).join(\" and \")}`}\n                    onClick={() => commands.unlink(row.bin!)}>Unlink</Button>}\n                <Button size=\"xs\" variant=\"outline\" onClick={() => commands.remove(row.bin!)}\n                    title={committed !== undefined ? `Remove ${code} from the plan · it moves to ${nouns.arrival.other}` : `Return ${code} to ${nouns.arrival.other}`}>\n                    Back to {nouns.arrival.other}\n                </Button>\n            </>}\n        </Box>}\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Allocation's reads of the app's records (#1372, `Builder Interfaces\n * Spec.md` §7.5, §9), in a component of its own, as the Roster's week is\n * (#1343): the day's bins through the bin kind's `rows` — over the day, the\n * range the board's navigation writes into the bins' source of the slice — the\n * own row of the period holding the day, the day's or its week's (#1550),\n * through the periods' `rows`, and the open picker's month's rows through the\n * same, as one span, a week's row marking each of its days; and, beside a\n * reference record the app's check reads (#1551), its rows overlapping the\n * day, through its window, each decoded once. What it reads is kept by its bytes: a\n * row read again as it was keeps its decoded row, so a render never decodes it\n * again, and the frame is handed what it reads only when that moves. While the\n * day's read is in flight the frame is covered (A80); a day it has not read is\n * never drawn as empty. Once the day has landed, the days either side are read\n * ahead (`shared/schedule/read-ahead.ts`, #1398, CL7), in a read of their own,\n * so a step to one shows it at once and a page of theirs landing runs the\n * day's read no more; a step further drops their reads. A read of the day the\n * board already holds, under a new narrowing of the bins' own source, is the\n * bins being filtered (`Filtering bins…`), never a day being loaded.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { BlobType, DateTimeType, DictType, SortedMap, StringType, equalFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { SchedulePeriodStatusType } from \"@elaraai/e3-ui/internal\";\nimport { RecordSliceWhereType, type RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { keptReference, referenceDecoder, type ReferenceRows } from \"../shared/schedule/reference.js\";\nimport { useReadAhead } from \"../shared/schedule/use-read-ahead.js\";\nimport { DAY, allocationDomain, byWeek, compareDate, compareString, periodSpan, type AllocationValue, type Day, type StoredBin } from \"./model.js\";\n\nconst sameBytes = equalFor(BlobType);\nconst samePicker = equalFor(DictType(DateTimeType, SchedulePeriodStatusType));\nconst printWhere = printFor(RecordSliceWhereType);\nconst sameText = equalFor(StringType);\n\n/**\n * The bins' own source's narrowing, apart from the day the board writes into\n * its range (#1398): what a read of the day is filtered by. The board's\n * navigation moves the range alone, so a day step leaves it as it is.\n *\n * @param part - The bins' source's part of the slice; `undefined` with none\n * @returns The narrowing's choices, printed; `\"\"` with no part\n */\nexport function binChoicesOf(part: ValueTypeOf<RecordSliceBindType> | undefined): string {\n    if (part === undefined) return \"\";\n    const range = part.config.range.type === \"some\" ? part.config.range.value : undefined;\n    const choices = new SortedMap([...part.read().where].filter(([field]) => field !== range), compareString);\n    return printWhere(choices);\n}\n\n/**\n * Whether the read in flight is the day's bins under a new narrowing of their\n * own source (#1398): the board holds a complete read of the day it shows,\n * made under other choices, which stands in — `Filtering bins…` — rather than\n * a day it has not read — `Loading Wed 12 May`.\n *\n * @param loading - Whether a read the day needs is in flight\n * @param landed - The day and the choices of the last complete read; `undefined` before one\n * @param day - The day the board shows\n * @param choices - The bins' source's choices now ({@link binChoicesOf})\n * @returns Whether the read in flight is a filtering of the day's bins\n */\nexport function filteringBins(loading: boolean, landed: { readonly day: Date; readonly choices: string } | undefined, day: Date, choices: string): boolean {\n    return loading && landed !== undefined && compareDate(landed.day, day) === 0 && !sameText(landed.choices, choices);\n}\n\n/** A day's status, as its period's row says it. */\ntype Status = Day[\"status\"];\n\n/** What the board has read of its records for a day. */\nexport interface AllocationData {\n    /** The day it is of. */\n    readonly day: Date;\n    /** The day's stored bins, by key: what its window read. */\n    readonly bins: ReadonlyMap<string, StoredBin>;\n    /** The own row's bytes of the period holding the day — the day's, or its week's (#1550); `undefined` for one with no row, or a board with no periods. */\n    readonly period: Uint8Array | undefined;\n    /** The open picker's days' statuses, by day — each day of a week its week's (#1550): a day whose period has no row is not among them. */\n    readonly picker: SortedMap<Date, Status>;\n    /**\n     * The rows of the reference record the app's check reads (#1551): those overlapping the day, every one whatever the\n     * slice holds; `undefined` without one.\n     */\n    readonly reference: ReferenceRows | undefined;\n    /** Whether a read the day needs — its bins, its row or its reference rows — is in flight. */\n    readonly loading: boolean;\n    /** Whether the read in flight is the day's bins under a new narrowing of their own source, the last narrowing's standing in ({@link filteringBins}). */\n    readonly filtering: boolean;\n    /** Whether a complete read of the day has landed. */\n    readonly ready: boolean;\n    /**\n     * Whether a complete read of any day has landed: the frame's cold load is\n     * over (#1398, CL5), and a day not read yet is read with the frame live,\n     * its geometry drawn and its placeholders where its content goes.\n     */\n    readonly landed: boolean;\n    /** Why the latest read failed. */\n    readonly error: string | undefined;\n}\n\nconst NO_BINS: ReadonlyMap<string, StoredBin> = new Map();\nconst NO_STATUSES = new SortedMap<Date, Status>([], compareDate);\n\n/**\n * The frame's data before its reader first reports: nothing held, a read in flight.\n *\n * @param day - The day the frame shows\n * @returns The state\n */\nexport function initialAllocationData(day: Date): AllocationData {\n    return { day, bins: NO_BINS, period: undefined, picker: NO_STATUSES, reference: undefined, loading: true, filtering: false, ready: false, landed: false, error: undefined };\n}\n\n/** Bins read again, each kept as it was where its bytes are: the same object, its row not decoded again. */\nfunction keptBins(read: ReadonlyMap<string, { roles: StoredBin[\"roles\"]; row: Uint8Array }>, held: ReadonlyMap<string, StoredBin> | undefined,\n    decode: (bytes: Uint8Array) => unknown): ReadonlyMap<string, StoredBin> {\n    const out = new SortedMap<string, StoredBin>([], compareString);\n    let same = held !== undefined && held.size === read.size;\n    for (const [key, entry] of read) {\n        const was = held?.get(key);\n        if (was !== undefined && sameBytes(was.bytes, entry.row)) { out.set(key, was); continue; }\n        same = false;\n        out.set(key, { roles: entry.roles, bytes: entry.row, row: decode(entry.row) });\n    }\n    return same && held !== undefined ? held : out;\n}\n\n/**\n * Reads the day (see the module docs).\n *\n * @param value - The payload\n * @param day - The plan day, at UTC midnight\n * @param pickerDays - The open picker's days, in order\n * @param choices - The bins' own source's narrowing, apart from the day ({@link binChoicesOf})\n * @returns What the board has read of the day\n */\nexport function useAllocationData(value: AllocationValue, day: Date, pickerDays: readonly Date[], choices: string): AllocationData {\n    // What was read last, kept by its bytes across reads.\n    const held = useRef<{ bins?: ReadonlyMap<string, StoredBin>; picker?: SortedMap<Date, Status>; reference?: ReferenceRows }>({});\n    // The day and the bins' choices the last complete read was made under.\n    const landed = useRef<{ day: Date; choices: string } | undefined>(undefined);\n    const read = useCallback(() => {\n        const domain = allocationDomain(value.bin.rowType);\n        let loading = false;\n        const next = new Date(day.getTime() + DAY);\n        const rows = value.bin.rows(day, next);\n        let bins: ReadonlyMap<string, StoredBin> | undefined;\n        if (rows.type === \"some\") bins = keptBins(rows.value, held.current.bins, domain.decodeRow);\n        else loading = true;\n        // The own row of the period holding the day, by its start — the day's, or its week's (#1550); and the open picker's\n        // days, one span from its first day to the day after its last.\n        let period: Uint8Array | undefined;\n        let picker = NO_STATUSES;\n        if (value.periods.type === \"some\") {\n            const periods = value.periods.value;\n            const own = periodSpan(value, day);\n            const got = periods.rows(own.from, own.to);\n            if (got.type === \"some\") period = got.value.get(own.from);\n            else loading = true;\n            const first = pickerDays[0], last = pickerDays[pickerDays.length - 1];\n            if (first !== undefined && last !== undefined) {\n                const span = periods.rows(first, new Date(last.getTime() + DAY));\n                if (span.type === \"some\") {\n                    // A week's row marks each of its days (#1550): the picker shows each day's week as published.\n                    const length = byWeek(value) ? 7 : 1;\n                    const statuses = new SortedMap<Date, Status>([], compareDate);\n                    for (const [at, bytes] of span.value) {\n                        const status = periods.status(bytes);\n                        for (let i = 0; i < length; i++) statuses.set(new Date(at.getTime() + i * DAY), status);\n                    }\n                    const was = held.current.picker;\n                    picker = was !== undefined && samePicker(was, statuses) ? was : statuses;\n                }\n            }\n        }\n        // The reference record the app's check reads (#1551): its rows overlapping the day — every one, whatever the slice\n        // holds — each decoded once.\n        let reference: ReferenceRows | undefined;\n        if (value.reference.type === \"some\") {\n            const got = value.reference.value.rows(day, next);\n            if (got.type === \"some\") reference = keptReference(got.value, held.current.reference, referenceDecoder(value.reference.value.rowType));\n            else loading = true;\n        }\n        return { bins, period, picker, reference, loading };\n    }, [value, day, pickerDays]);\n    const { result } = useTrackedEvaluation(read);\n    // Once the day has landed, the days either side are read ahead (#1398, CL7) — in a read of their own, so a page of\n    // theirs landing runs the day's read no more: a step to one shows it at once.\n    const at = day.getTime();\n    const neighbours = useMemo(() => [new Date(at + DAY), new Date(at - DAY)], [at]);\n    const readNext = useCallback((from: Date) => {\n        value.bin.rows(from, new Date(from.getTime() + DAY));\n        // Its period's row, the day's or its week's (#1550): a day of the same week reads the read in hand.\n        if (value.periods.type === \"some\") { const own = periodSpan(value, from); value.periods.value.rows(own.from, own.to); }\n        if (value.reference.type === \"some\") value.reference.value.rows(from, new Date(from.getTime() + DAY));\n    }, [value]);\n    useReadAhead(result.ok && !result.value.loading && result.value.bins !== undefined, neighbours, readNext);\n    // The last complete read of a day: a newer one in flight keeps it, so a page landing redraws nothing until the read is whole.\n    const complete = useRef<AllocationData | undefined>(undefined);\n    if (result.ok) {\n        const got = result.value;\n        held.current = { ...(got.bins === undefined ? {} : { bins: got.bins }), ...(Object.is(got.picker, NO_STATUSES) ? {} : { picker: got.picker }),\n            ...(got.reference === undefined ? {} : { reference: got.reference }) };\n        const was = complete.current;\n        if (!got.loading && got.bins !== undefined) {\n            landed.current = { day, choices };\n            if (was === undefined || compareDate(was.day, day) !== 0 || !Object.is(was.bins, got.bins) || !Object.is(was.reference, got.reference)\n                || !Object.is(was.picker, got.picker) || (was.period === undefined ? got.period !== undefined : got.period === undefined || !sameBytes(was.period, got.period))) {\n                complete.current = { day, bins: got.bins, period: got.period, picker: got.picker, reference: got.reference, loading: false, filtering: false, ready: true, landed: true,\n                    error: undefined };\n            }\n        }\n    }\n    const last = complete.current;\n    // A day moved to holds nothing of the day before it: its read is in flight until it lands.\n    const current = last !== undefined && compareDate(last.day, day) === 0 ? last : undefined;\n    const everLanded = last !== undefined;\n    const loading = result.ok ? result.value.loading || current === undefined : false;\n    const filtering = filteringBins(loading, landed.current, day, choices);\n    const error = result.ok ? undefined : result.error instanceof Error ? result.error.message : String(result.error);\n    return useMemo(() => current === undefined ? { ...initialAllocationData(day), loading, landed: everLanded, error }\n        : current.loading === loading && current.filtering === filtering && current.error === error ? current : { ...current, loading, filtering, error },\n    [current, day, loading, filtering, everLanded, error]);\n}\n\n/**\n * The day's reads, in a component of its own (#1343): each page and search\n * that lands re-runs it alone, and it hands the frame what it read only when\n * what the frame shows moves.\n *\n * @param props - The payload, the day, the open picker's days, the bins' source's choices, and where the data goes\n * @returns Nothing: it reads\n */\nexport function AllocationDataReader({ value, day, pickerDays, choices, onData }: {\n    value: AllocationValue; day: Date; pickerDays: readonly Date[]; choices: string; onData: (data: AllocationData) => void;\n}): null {\n    const data = useAllocationData(value, day, pickerDays, choices);\n    const reported = useRef<AllocationData | undefined>(undefined);\n    useLayoutEffect(() => {\n        if (Object.is(reported.current, data)) return;\n        reported.current = data;\n        onData(data);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Search Records (#1398): the board's toolbar's key search over its bins'\n * record by primary key — never a field search, which is the rail's, and never\n * what the day draws. The record is sought through e3 with no narrowing, as\n * the Schematic's Find seeks its kinds': `recordSliceSeek` places the query's\n * run in the record's own order through the bins' source of the slice, and\n * `recordSlicePage` reads the rows a list shows by position, each read for\n * its roles by the bin kind's `read`. A line names a bin by its key, its\n * arrival — or that it is a reservation — its lane and its time, and its day;\n * a pick hands the board the bin (`onPick`), which steps to its day and\n * selects it there, and the box shows its key. A bin the rail's narrowing\n * hides on the board says so, as every builder's line does (the shared hidden\n * pick) — `· hidden by Area: South — picking it clears that filter` once e3\n * has said, `· hidden by the filters` until then — asked of e3 for the bins the\n * box lists, through the board's sources that hide them (`hidden.ts`), and\n * listed again as the answers land. The box asks its query again as the record\n * moves to another revision. Its words are the board's message table's: a\n * query no bin's key matches says so, and that a bin's key is in its Details,\n * where the board has them (`messages.ts`).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { StringType, equalFor, none, toEastTypeValue, type EastTypeValue, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport type { DatasetKeyMatchRange, DatasetKeyQuery, RecordSliceBindType, RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { useTrackedEvaluation, type Formatters, type KeySearchSource } from \"@elaraai/east-ui-components\";\nimport { awaitTracked, formatDatePattern, recordSlicePage, recordSliceRevision, recordSliceSeek, toSeekQuery } from \"@elaraai/east-ui-components/internal\";\nimport { hiddenLine } from \"../shared/schedule/hidden.js\";\nimport type { HiddenBins } from \"./hidden.js\";\nimport type { AllocationWords } from \"./messages.js\";\nimport { partsOf, type AllocationDomain, type AllocationValue } from \"./model.js\";\nimport { one } from \"./nouns.js\";\n\n/** A bin's key is a String: the search's text parses against that. */\nconst KEY_TYPE: EastTypeValue = toEastTypeValue(StringType);\nconst keyEqual = equalFor(StringType);\n/** No narrowing: the record's own rows, in its order. */\nconst WHOLE: ValueTypeOf<typeof RecordSliceWhereType> = new Map();\n/** An empty box lists the first of the record's bins. */\nconst BROWSE_QUERY: DatasetKeyQuery = { prefix: \"\" };\n\n/** A record Slice's part: the bins' source of the slice. */\ntype RecordPart = ValueTypeOf<RecordSliceBindType>;\n/** An entry of a record's window, as every record Slice binding reads one: its key and its row, joined. */\ninterface RecordEntry { readonly key: string; readonly row: option<unknown> }\n\n/** A bin Search Records found: its key, and its place — its day and time, its lane — its arrival and its resources. */\nexport interface FoundBin {\n    readonly key: string;\n    readonly at: Date;\n    readonly lane: string;\n    /** Its arrival's key; `undefined` for a reservation. */\n    readonly arrival: string | undefined;\n    /** The resources it has parts on, the largest part first: the first, the one it is shown on. */\n    readonly parts: readonly string[];\n}\n\n/**\n * How a found bin reads in the list: its key, its arrival — or that it is a reservation — its lane and time, and its day.\n *\n * @param bin - The bin\n * @param value - The payload: the lanes and the arrivals that name a bin's\n * @param format - The app's formatters\n * @returns Its line\n */\nexport function foundBinLine(bin: FoundBin, value: Pick<AllocationValue, \"lanes\" | \"arrivals\" | \"labels\">, format: Pick<Formatters, \"weekdayDate\">): string {\n    const lane = value.lanes.find(l => keyEqual(l.key, bin.lane))?.label ?? bin.lane;\n    const arrival = bin.arrival === undefined ? \"reserved\" : value.arrivals.find(a => keyEqual(a.key, bin.arrival!))?.label ?? bin.arrival;\n    return [bin.key, arrival, `${lane} ${formatDatePattern(\"HH:mm\", bin.at)}`, format.weekdayDate(bin.at)].join(\" · \");\n}\n\n/** Props of {@link useAllocationFind}. */\nexport interface AllocationFindProps {\n    /** The payload: its bin kind's `read`, its lanes and its arrivals. */\n    readonly value: AllocationValue;\n    /** The bin row type's domain: what a row's bytes are written by. */\n    readonly domain: AllocationDomain;\n    /** The bins' source of the slice: the record sought; `undefined` with none, and no search. */\n    readonly part: RecordPart | undefined;\n    /** The board's words: the app's formatters, which word a choice as the rail does, and its message table. */\n    readonly words: AllocationWords;\n    /** What hides a bin the rail's narrowing hides on the board, and what e3 has said of it (the hidden pick). */\n    readonly hidden: HiddenBins;\n    /** Told the bin a pick lands on. */\n    readonly onPick: (bin: FoundBin) => void;\n}\n\n/**\n * Search Records' source, for the shared key search's toolbar item (see the module docs).\n *\n * @param props - The payload, the domain, the bins' source, the words, the hidden pick and the pick\n * @returns The source; `undefined` without a source of the bins to seek\n */\nexport function useAllocationFind({ value, domain, part, words, hidden, onPick }: AllocationFindProps): KeySearchSource | undefined {\n    const latest = useRef({ value, domain, part, words, hidden, onPick });\n    useLayoutEffect(() => { latest.current = { value, domain, part, words, hidden, onPick }; });\n    // What the last find found: the run of the record's rows it placed; a find answered after a newer one asked finds nothing here.\n    const found = useRef({ start: 0, count: 0 });\n    const asked = useRef(0);\n    const find = useCallback(async (query: DatasetKeyQuery): Promise<DatasetKeyMatchRange> => {\n        const mine = ++asked.current;\n        const source = latest.current.part;\n        if (source === undefined) return { found: false, row: 0, count: 0 };\n        const at = await awaitTracked(() => recordSliceSeek(source, WHOLE, toSeekQuery(query)));\n        const run = at.found ? { start: Number(at.row), count: Number(at.count) } : { start: 0, count: 0 };\n        if (mine === asked.current) found.current = run;\n        return { found: run.count > 0, row: 0, count: run.count };\n    }, []);\n    /** The bins at the list's rows `[row, row + limit)`. */\n    const binsAt = useCallback(async (row: number, limit: number): Promise<FoundBin[]> => {\n        const { part: source, value: board, domain: rows } = latest.current;\n        const run = found.current;\n        const n = Math.max(0, Math.min(limit, run.count - row));\n        if (source === undefined || n === 0) return [];\n        const entries = await awaitTracked(() => recordSlicePage(source, { where: WHOLE, area: none }, BigInt(run.start + row), BigInt(n))) as readonly RecordEntry[];\n        return entries.flatMap((entry): FoundBin[] => {\n            if (entry.row.type !== \"some\") return [];\n            const roles = board.bin.read(rows.encodeRow(entry.row.value));\n            return [{ key: entry.key, at: roles.at, lane: roles.lane, arrival: roles.arrival.type === \"some\" ? roles.arrival.value : undefined,\n                parts: partsOf(roles).map(p => p.key) }];\n        });\n    }, []);\n    const listRange = useCallback(async (row: number, limit: number) => {\n        const bins = await binsAt(row, limit);\n        const { value: board, words: format, hidden: hiding } = latest.current;\n        // Which choices hide the bins the narrowing hides, asked of e3: a line says the filters do until it has said which.\n        hiding.ask(bins);\n        return bins.map((bin, i) => {\n            const line = foundBinLine(bin, board, format);\n            const hidden = hiding.of(bin);\n            // A pick shows the bin's key in the box: what its query is typed against.\n            return { row: row + i, label: hidden === undefined ? line : `${line} · ${hiddenLine(hidden, format, format.m)}`, text: bin.key };\n        });\n    }, [binsAt]);\n    const jump = useCallback((row: number) => {\n        void binsAt(row, 1).then(([bin]) => { if (bin !== undefined) latest.current.onPick(bin); })\n            .catch((error: unknown) => { console.error(\"[Allocation] Search Records could not read the bin it found:\", error); });\n    }, [binsAt]);\n    const clear = useCallback(() => { asked.current++; found.current = { start: 0, count: 0 }; }, []);\n    // The box asks its query again as the record moves to another revision — tracked, so a day the board reads moves none of it.\n    const readRevision = useCallback(() => {\n        if (part === undefined) return \"\";\n        const revision = recordSliceRevision(part);\n        return revision.type === \"some\" ? revision.value : \"-\";\n    }, [part]);\n    const { result } = useTrackedEvaluation(readRevision);\n    const revision = result.ok ? result.value : \"\";\n    const [requery, setRequery] = useState(0);\n    const seen = useRef(revision);\n    useEffect(() => {\n        if (keyEqual(seen.current, revision)) return;\n        seen.current = revision;\n        setRequery(n => n + 1);\n    }, [revision]);\n    const any = part !== undefined;\n    // What it searches, where nothing matches: bins' keys, which a bin's Details show where the board has them.\n    const noMatches = words.m.keySearchNoMatches({ inspector: value.inspector, bin: one(value.labels.bin) });\n    // The lines are listed again as e3 says what hides a bin, and as what the narrowing shows moves.\n    const relist = hidden.relist;\n    return useMemo(() => (any ? { resetKey: \"allocation\", requery, relist, keyType: KEY_TYPE, find, listRange, jump, clear, browseQuery: BROWSE_QUERY,\n        noMatchesText: noMatches } : undefined), [any, requery, relist, find, listRange, jump, clear, noMatches]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The board's fit (`Allocation Spec.md` §12.2, F1–F4): the app's\n * `e3.function`, asked through the shared fit (`shared/func/use-fit.ts`), as\n * the Roster's Find fixes ask theirs. The board asks about its active\n * subjects — the selected bin, the grip under a pointer-down, an open\n * Chooser's cell — and asks again when the drafts change, or the arrivals,\n * lanes and resources it reads. Answers are kept by what they were asked of\n * and by question, matched to their question by the `ask` each echoes. One\n * question is in flight at a time; the others wait, the latest asked first,\n * and a question of drafts the board has moved on from goes unasked — a\n * drop's new drafts never re-ask the subject its command selected away from.\n * The renderer computes no fit of its own.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { printFor } from \"@elaraai/east\";\nimport { AllocationFitAskType, AllocationFitResultType } from \"@elaraai/e3-ui/internal\";\nimport { useFit, type FitAnswers, type FitQuestions } from \"../shared/func/use-fit.js\";\nimport type { AllocationDomain, AllocationValue, Context, Day, FitAsk, FitResult } from \"./model.js\";\n\n/** A question's key: its East text. */\nconst askKey = printFor(AllocationFitAskType);\n\n/**\n * The fit, as the board asks it: of the day as drafted now, or of a plan the\n * board derives from it (a fill asks of the day without the reservation it\n * fills).\n */\nexport type AllocationFit = FitAnswers<FitAsk, Day, FitResult>;\n\n/**\n * The board's fit (see the module docs).\n *\n * @param value - The payload: the fit's name\n * @param domain - The bin row type's domain: the request's type\n * @param day - The plan day\n * @param plan - The day as drafted\n * @param context - Every arrival and resource\n * @returns The fit\n */\nexport function useAllocationFit(value: AllocationValue, domain: AllocationDomain, day: Date, plan: Day, context: Context): AllocationFit {\n    const epoch = day.getTime();\n    const questions = useMemo((): FitQuestions<FitAsk, Day, Context, FitResult> => ({\n        name: value.fit.name, requestType: domain.requestType, resultType: AllocationFitResultType,\n        key: askKey, answers: result => askKey(result.ask),\n        request: (ask, of, within) => ({ day: new Date(epoch), plan: of, ask, context: within }),\n    }), [value.fit.name, domain.requestType, epoch]);\n    return useFit(questions, plan, context);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\nimport { useRef } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { OptimiseLegendItem } from \"@elaraai/east-ui-components\";\nimport { FooterMore, LoadingLine, footerCut, useFooterFit, useRevealed, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport type { AllocationStyles } from \"./model.js\";\nimport { one, useNouns, type Nouns } from \"./nouns.js\";\n\n/**\n * Each layout's legend, as the mock's footer lists it (§8): a link is `Link`, its width unexplained (ruled 17 Oct), and\n * the Table's chip the board's nouns' (#1338).\n *\n * @param nouns - The board's nouns\n * @returns Each layout's items\n */\nexport const legends = (nouns: Nouns) => ({\n    timeline: [\n        { kind: \"bin\", label: nouns.bin.one }, { kind: \"draft\", label: \"Unsaved\" }, { kind: \"load\", label: \"Today's load\" },\n        { kind: \"prior\", label: nouns.priorJob }, { kind: \"next\", label: nouns.nextJob }, { kind: \"overlap\", label: \"Overlap\" },\n        { kind: \"link\", label: \"Link\" }, { kind: \"draftLink\", label: \"Unsaved link\" },\n    ],\n    table: [\n        { kind: \"bin\", label: `${nouns.arrival.one} or ${one(nouns.resource)}` }, { kind: \"draft\", label: \"Unsaved\" }, { kind: \"empty\", label: \"Empty · drop here\" },\n        { kind: \"reserved\", label: nouns.reserved }, { kind: \"free\", label: \"Free\" },\n    ],\n});\n\n/**\n * The shared footer rail with the layout's legend (A79) — no counts, hints or\n * status — and at its trailing end the shared loading line (#1398, CL3): the\n * day being read — `Loading Tue, May 11, 2027` — or why it could not be, with\n * Retry. The rail never wraps and never cuts a word: the legend stays whole\n * and in place, ending at a whole item, then \"…\", only where it cannot fit.\n * The line shows on the frame's one reveal clock (CL4, its `LoadingReveal`),\n * which the day's placeholders keep too — or says what a run of the app's\n * optimiser does (#1409), at once. During a run's highlight the legend ends\n * with `Elara change`.\n */\nexport function AllocationFooter({ styles, layout, line, optimise }: {\n    styles: AllocationStyles; layout: \"timeline\" | \"table\";\n    /** What the day's read says: the day being read, or why it could not be; `undefined` while it has landed. */\n    line: LoadingLineValue | undefined;\n    /** A run of the app's optimiser (#1409): what its line says while the call is out or just stopped, and whether its highlight is on. */\n    optimise?: { readonly line: LoadingLineValue | undefined; readonly legend: boolean } | undefined;\n}) {\n    const ref = useRef<HTMLDivElement>(null);\n    const fit = useFooterFit(ref);\n    const shown = useRevealed() === true;\n    const items = legends(useNouns())[layout];\n    const elara = optimise?.legend === true;\n    const runLine = optimise?.line;\n    const units = items.length + (elara ? 1 : 0);\n    return <Box ref={ref} css={styles.footer} data-allocation-footer={layout}>\n        {items.map((item, i) => <Box as=\"span\" key={item.kind} css={[styles.footerItem, styles.legendItem]} data-allocation-legend={item.kind}\n            data-footer-unit=\"\" data-footer-cut={footerCut(i, fit)}>\n            <Box as=\"span\" aria-hidden=\"true\" css={styles.legendSwatch} data-kind={item.kind} />{item.label}\n        </Box>)}\n        {elara && <OptimiseLegendItem css={[styles.footerItem ?? {}, styles.legendItem ?? {}]} cut={footerCut(items.length, fit)} />}\n        <FooterMore shown={fit.kept < units} />\n        {/* A run's line shows at once, whatever the reveal says: a run is not a read (#1409). */}\n        <LoadingLine value={runLine ?? line} shown={shown || runLine !== undefined} form={fit.form} />\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Which of the Allocation's sources hide a bin Search Records finds (#1398) —\n * the shared hidden pick's (`shared/schedule/hidden.ts`) over the board's own\n * sources: a bin the rail's narrowing hides on the board — its lane, its\n * arrival or its resources narrowed out, as the layout shown draws a bin\n * (`table-rows.ts`' `rowHiding`) — is hidden by the source of each, in the\n * slice's order, standing on the row of it the bin stands on there: its lane\n * in the lanes' source, its arrival in the arrivals', and the resource it is\n * shown on — its largest part — in the resources'. One hidden pick a source,\n * asked of the source's own record through its part.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport type { option } from \"@elaraai/east\";\nimport { askHiding, hiddenOf, useRelist, useSourceHidden, type RowHidden, type RowHiding, type SourceHidden } from \"../shared/schedule/hidden.js\";\nimport type { FoundBin } from \"./find.js\";\nimport type { AllocationValue } from \"./model.js\";\nimport { narrowingPart, narrowingSlot, type NarrowedSource } from \"./narrowed.js\";\nimport { rowHiding } from \"./table-rows.js\";\n\n/**\n * What each source the rail narrows shows, as the board's layout draws a bin: `none` for a source that hides no bin\n * there — the resources' on the Timeline's lanes, the lanes' and the arrivals' on a phone's Timeline of resources.\n */\nexport interface BinShown {\n    readonly lanes: option<ReadonlySet<string>>;\n    readonly resources: option<ReadonlySet<string>>;\n    readonly arrivals: option<ReadonlySet<string>>;\n}\n\n/** The hidden pick over the bins Search Records finds. */\nexport interface HiddenBins {\n    /**\n     * What hides a bin on the board, as far as e3 has said: each source that does, in the slice's order.\n     *\n     * @param bin - The bin, as Search Records found it\n     * @returns What hides it; `undefined` for a bin the narrowing shows\n     */\n    of(bin: FoundBin): readonly RowHidden[] | undefined;\n    /**\n     * Asks e3 which choices hide the bins a listing holds that the narrowing hides: each source's question of the rows\n     * they stand on, one request a question.\n     *\n     * @param bins - The bins, as the box lists them\n     */\n    ask(bins: readonly FoundBin[]): void;\n    /** Moves as answers land and as what the narrowing shows moves: the box lists its lines again. */\n    readonly relist: number;\n}\n\n/** The sources the rail narrows a bin by, in the board's order. */\nconst SOURCES: readonly NarrowedSource[] = [\"lanes\", \"resources\", \"arrivals\"];\n\n/**\n * The row of a source a bin stands on: its lane, its arrival — a reservation has none — or the resource it is shown on,\n * its largest part.\n */\nfunction rowOf(source: NarrowedSource, bin: FoundBin): string | undefined {\n    return source === \"lanes\" ? bin.lane : source === \"arrivals\" ? bin.arrival : bin.parts[0];\n}\n\n/**\n * The hidden pick over the bins Search Records finds (see the module docs).\n *\n * @param value - The payload: its slice, and the slots its sources are named by\n * @param shown - What each source shows, as the board's layout draws a bin\n * @returns The pick\n */\nexport function useHiddenBins(value: AllocationValue, shown: BinShown): HiddenBins {\n    // One hidden pick a source, asked of the source's own record through its part: the same three every render.\n    const lanes = useSourceHidden(\"Allocation\", useMemo(() => narrowingPart(value, \"lanes\"), [value]));\n    const resources = useSourceHidden(\"Allocation\", useMemo(() => narrowingPart(value, \"resources\"), [value]));\n    const arrivals = useSourceHidden(\"Allocation\", useMemo(() => narrowingPart(value, \"arrivals\"), [value]));\n    // The sources in the slice's order: what the rail lists, and the order the line names their choices in.\n    const order = useMemo(() => {\n        const slots = value.slice.type === \"some\" ? value.slice.value.slice.parts.map(part => part.source) : [];\n        return [...SOURCES].sort((a, b) => slots.indexOf(narrowingSlot(value, a)) - slots.indexOf(narrowingSlot(value, b)));\n    }, [value]);\n    // The lines are listed again as e3 says what hides a bin, and as what the narrowing shows moves.\n    const relist = useRelist([lanes, resources, arrivals], [shown.lanes, shown.resources, shown.arrivals]);\n    return useMemo((): HiddenBins => {\n        const picks: Record<NarrowedSource, SourceHidden> = { lanes, resources, arrivals };\n        /** The sources that hide a bin as the board draws it, each with the row the bin stands on there. */\n        const hidingsOf = (bin: FoundBin): RowHiding[] => {\n            const hides = rowHiding(bin.lane, { arrival: bin.arrival, parts: bin.parts }, shown.lanes, shown.resources, shown.arrivals);\n            return order.flatMap(source => {\n                const pick = picks[source], row = rowOf(source, bin);\n                return hides[source] && pick.part !== undefined && row !== undefined ? [{ pick, id: row }] : [];\n            });\n        };\n        return {\n            of: (bin) => hiddenOf(hidingsOf(bin)),\n            ask: (bins) => askHiding(bins.flatMap(hidingsOf), true),\n            relist,\n        };\n    }, [lanes, resources, arrivals, order, shown, relist]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Timeline's layout (`Allocation Spec.md` §8, A14, A20), pure: the lane\n * grid's rows and cards from the day's slots, which e3-ui's `Allocation.slots`\n * draws up, and the resource axis's window and days. The renderer places each\n * part by these indices; its sizes are the `allocationBuilder` recipe's.\n *\n * @packageDocumentation\n */\n\nimport type { Bin, Day, Slot } from \"./model.js\";\nimport { DAY, compareDate } from \"./model.js\";\n\n/** A grid row's height, the recipe's: what the resource rows are virtualised and the panes scroll by. */\nexport const ROW_H = 36;\n/** The lane grid's hour column, a lane's width, a card's inset in its lane and grid row, and its size: the recipe's, which a link leaves a card by. */\nexport const HOUR_W = 48;\nexport const LANE_W = 96;\nexport const CARD_INSET = 4;\nexport const CARD_W = 88;\nexport const CARD_H = 28;\n/** The resource plot's narrowest day, in px; under {@link SHORT_DAY} a day's tick shows its number only. */\nexport const MIN_DAY = 24;\nexport const SHORT_DAY = 36;\n/** The resource label column's width, the recipe's: the plot starts after it. */\nexport const LABEL_W = 152;\n\n/** One bin's card in the lane grid. */\nexport interface LaneCard {\n    /** The bin's id. */\n    id: string;\n    bin: Bin;\n    /** Its lane's index. */\n    lane: number;\n    /** Its slot's index in the day. */\n    slot: number;\n    /** Its slot's time: the lane hour a drop on it names. */\n    slotAt: Date;\n    /** Its grid row: its slot's first row, and its place in the slot's batch. */\n    row: number;\n}\n\n/** One lane slot's cell: a drop target when it is free. */\nexport interface LaneCell {\n    lane: number;\n    slot: number;\n    /** The slot's time. */\n    at: Date;\n    free: boolean;\n}\n\n/** One slot index's band across every lane: as many rows as its largest batch, one at least. */\nexport interface LaneBand {\n    slot: number;\n    /** Its first grid row. */\n    row: number;\n    /** Its rows. */\n    span: number;\n    /** The first lane's slot time: what its label prints. */\n    at: Date;\n}\n\n/** A ghost's place in the lane grid (#1409): where a bin a run moved or removed stood, as a lane slot and a time. */\nexport interface LaneGhost {\n    lane: string;\n    at: Date;\n}\n\n/** A ghost placed in the lane grid (#1409): by its index among the ghosts given, its lane, its slot, and its row after the slot's cards. */\nexport interface LaneGhostPlace {\n    ghost: number;\n    lane: number;\n    slot: number;\n    row: number;\n}\n\n/** The lane grid. */\nexport interface LaneGrid {\n    bands: LaneBand[];\n    cells: LaneCell[];\n    cards: LaneCard[];\n    /** Every grid row. */\n    rows: number;\n    /** Each lane's bins with an arrival, and their quantity (A15). */\n    heads: { bins: number; quantity: number; first: Date | undefined }[];\n    /** Each ghost's place (#1409): a row of its slot's band after the slot's cards. */\n    ghosts: LaneGhostPlace[];\n}\n\n/**\n * The lane grid from the day's slots (A14): a band per slot index, its rows\n * its largest batch's; a cell per lane slot; a card per bin at its lane, its\n * slot's band, and its place in the batch. A bin the narrowing hides (#1339)\n * takes no card and no row of its batch, and its slot is still booked; each\n * lane's head counts every bin, hidden or not.\n *\n * A ghost of a bin a run of the optimiser moved or removed (#1409, R15)\n * takes a row of its slot's band after the slot's cards: the slot of its\n * lane whose time is the latest at or before where the bin stood.\n *\n * @param lanes - The lanes' keys, in order\n * @param slots - The day's slots (`Allocation.slots`), in time then lane order\n * @param plan - The day's plan\n * @param shows - Whether a bin shows; every one by default\n * @param ghosts - Where the bins the runs moved or removed stood, for the highlight; none by default\n * @returns The grid\n */\nexport function laneGrid(lanes: readonly string[], slots: readonly Slot[], plan: Day, shows: (bin: Bin) => boolean = () => true, ghosts: readonly LaneGhost[] = []): LaneGrid {\n    const index = new Map(lanes.map((key, i) => [key, i] as const));\n    const byLane = lanes.map(() => [] as Slot[]);\n    for (const slot of slots) { const i = index.get(slot.lane); if (i !== undefined) byLane[i]!.push(slot); }\n    const count = Math.max(0, ...byLane.map(list => list.length));\n    const bands: LaneBand[] = [];\n    let row = 0;\n    // The bins of a slot that show, in its batch's order.\n    const shown = (slot: Slot | undefined) => slot === undefined ? [] : slot.bins.filter(id => { const bin = plan.bins.get(id); return bin !== undefined && shows(bin); });\n    // Each ghost's lane and slot: the lane's slot whose time is the latest at or before where it stood, else its first; none of a lane the grid has not.\n    const ghostAt = ghosts.map(ghost => {\n        const lane = index.get(ghost.lane);\n        const list = lane === undefined ? undefined : byLane[lane]!;\n        if (lane === undefined || list === undefined || list.length === 0) return undefined;\n        let slot = 0;\n        list.forEach((held, k) => { if (compareDate(held.at, ghost.at) <= 0) slot = k; });\n        return { lane, slot };\n    });\n    const ghostsIn = (lane: number, k: number) => ghostAt.filter(at => at !== undefined && at.lane === lane && at.slot === k).length;\n    for (let k = 0; k < count; k++) {\n        const span = Math.max(1, ...byLane.map((list, lane) => shown(list[k]).length + ghostsIn(lane, k)));\n        const at = byLane.find(list => list[k] !== undefined)![k]!.at;\n        bands.push({ slot: k, row, span, at });\n        row += span;\n    }\n    const cells: LaneCell[] = [], cards: LaneCard[] = [];\n    const heads = lanes.map(() => ({ bins: 0, quantity: 0, first: undefined as Date | undefined }));\n    byLane.forEach((list, lane) => {\n        heads[lane]!.first = list[0]?.at;\n        list.forEach((slot, k) => {\n            cells.push({ lane, slot: k, at: slot.at, free: slot.bins.length === 0 });\n            shown(slot).forEach((id, place) => cards.push({ id, bin: plan.bins.get(id)!, lane, slot: k, slotAt: slot.at, row: bands[k]!.row + place }));\n            for (const id of slot.bins) {\n                const bin = plan.bins.get(id);\n                if (bin?.arrival.type === \"some\") { heads[lane]!.bins += 1; heads[lane]!.quantity += bin.quantity; }\n            }\n        });\n    });\n    // The ghosts, each a row of its slot's band after the slot's cards, in the order given.\n    const placed: LaneGhostPlace[] = [];\n    const taken = new Map<string, number>();\n    ghostAt.forEach((at, ghost) => {\n        if (at === undefined) return;\n        const key = `${at.lane}:${at.slot}`;\n        const place = taken.get(key) ?? 0;\n        taken.set(key, place + 1);\n        placed.push({ ghost, lane: at.lane, slot: at.slot, row: bands[at.slot]!.row + shown(byLane[at.lane]![at.slot]).length + place });\n    });\n    return { bands, cells, cards, rows: row, heads, ghosts: placed };\n}\n\n/** The resource axis: its window around the plan day, and its days. */\nexport interface ResourceAxis {\n    /** `[from, to)`: the horizon's days before and after the plan day. */\n    from: Date;\n    to: Date;\n    /** Its days, at UTC midnight. */\n    days: Date[];\n    /** The plan day's index among them. */\n    today: number;\n}\n\n/**\n * The resource axis around a plan day (A20): its horizon's whole days before\n * it, and after it from its start.\n *\n * @param day - The plan day, at UTC midnight\n * @param before - The horizon before it, in ms\n * @param after - The horizon after its start, in ms\n * @returns The axis\n */\nexport function resourceAxis(day: Date, before: number, after: number): ResourceAxis {\n    const lead = Math.max(0, Math.round(before / DAY)), trail = Math.max(1, Math.round(after / DAY));\n    const from = new Date(day.getTime() - lead * DAY), to = new Date(day.getTime() + trail * DAY);\n    const days = Array.from({ length: lead + trail }, (_, i) => new Date(from.getTime() + i * DAY));\n    return { from, to, days, today: lead };\n}\n\n/**\n * Where an instant falls along the axis, as a fraction of its window, clamped\n * to it.\n *\n * @param axis - The axis\n * @param at - The instant\n * @returns 0 at its start, 1 at its end\n */\nexport function axisFraction(axis: ResourceAxis, at: Date): number {\n    const span = axis.to.getTime() - axis.from.getTime();\n    return Math.max(0, Math.min(1, (at.getTime() - axis.from.getTime()) / span));\n}\n\n/** A span along the axis as a CSS left and width, or `undefined` when it falls outside it. */\nexport function axisSpan(axis: ResourceAxis, from: Date, to: Date): { left: string; width: string } | undefined {\n    const a = axisFraction(axis, from), b = axisFraction(axis, to);\n    if (b <= a) return undefined;\n    return { left: `${a * 100}%`, width: `${(b - a) * 100}%` };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Inspector (`Allocation Spec.md` §8, §9.8, A55–A64, #1331): the end\n * pane's two tabs. Details shows a refused drop's note (A40), the drop list\n * during a drag or a pick (A34), else the selection — a bin (A56–A59), a free\n * slot (A60), a reservation (A61), a resource (A62) — else the summary (A63);\n * Issues groups every issue with its fix (A64), the refusals holding Save\n * ahead of them, each over its bin's form too — a reservation's as well, its\n * own fields a bin's (#1525). A bin's Assigned to holds its\n * parts (A70–A74, #1332): each part's quantity a field, the remainder in\n * warn, `Split…` to put the remainder — or, with none, some of a part — on\n * another resource (`split.tsx`, #1362), and Find a fit. A field a refusal\n * names is ringed and says the app's words for it under it (ruled 13 Nov\n * 2026) — its quantity too, which the Bin section draws.\n * The bin's own fields — those no role maps — are the bin kind's: its form\n * over its `fields` (`FieldForm`), or its own `inspector` over the row, in\n * place of the quantity and the rows (#1372). The kind's form holds its\n * quantity too, which the Bin section draws: to the bounds a hint gives it,\n * a quantity they don't hold said once, in the field's help line (#1585). Each\n * of a bin's forms says a bound in the tone its Save stands in: a warning as\n * stored, an error once its change is refused. A bin's key is printed first\n * among its facts, and a reservation's in a section of its own: what Search\n * Records finds them by (#1398). Every edit is one of the\n * board's commands, a draft of the bins' session until Save; every fit is the\n * app's answer; every figure and word is e3-ui's or `inspector-model.ts`'s. The parts are the shared inspector's — its head,\n * its sections, its counts — with FieldForm, the Chooser, the anchored\n * popover, the banner, the segments, the stepper and the meter; the\n * `allocationInspector` recipe owns every style.\n *\n * While what main shows is retained — a narrowing of it being read, or one\n * that could not be read (#1398, CL8) — the board takes no edit until it\n * lands, and Details' fields are off, as every builder's are meanwhile: a\n * bin's lane, time and quantity, its own fields or its own form, its\n * resource, a part's quantity, and a reservation's fields. None takes a value\n * the board would drop. So are its buttons that edit, in their places:\n * Unlink, Revert, Back to Arrivals, a fit's Link or Move, `Split…`, a Book,\n * a Reserve and a reservation's Remove — none pressed to do nothing, unsaid.\n * Find a fit, `Open resource →` and a bin of a resource's day edit nothing,\n * and stay on.\n *\n * Details keeps the keyboard (#1398): a control that goes with the view it was\n * pressed in — Back to Arrivals, Unlink, Revert, Remove, a Book or a Reserve, a\n * bin of a resource's day, `Open resource →`, a fit's Link or Move, the\n * refusal's dismissal — leaves the focus on the heading of the view drawn in\n * its place (`../shared/focus-home.ts`), never on the page's body.\n *\n * @packageDocumentation\n */\n\nimport { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, type ReactNode } from \"react\";\nimport { Box, Button, chakra, useSlotRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n    faArrowRight, faArrowsSplitUpAndLeft, faChevronDown, faChevronUp, faCircleCheck, faCircleExclamation, faLinkSlash, faMagnifyingGlass, faMinus, faPlus,\n    faRotateLeft, faTriangleExclamation, faXmark,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { DateTimeType, FloatType, OptionType, StringType, StructType, equalFor, none, some, variant, type SortedMap, type option } from \"@elaraai/east\";\nimport { Fields, type FieldSpecValue } from \"@elaraai/east-ui\";\nimport {\n    BannerView, EastChakraComponent, FieldForm, fieldBreachText, fieldFormMessages, getSomeorUndefined, useDropCell, useFormatters, useTrackedEvaluation, type BuilderFrameDock,\n    type EditIssue, type FieldFormWords,\n} from \"@elaraai/east-ui-components\";\nimport { Chooser, PlaceholderShape, formatDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport { FOCUS_HOME_PROPS, useFocusHome } from \"../shared/focus-home.js\";\nimport type { PeriodRead } from \"../shared/loading.js\";\nimport { useFieldAsk } from \"../shared/schedule/field-ask.js\";\nimport { ScheduleInspectorHead } from \"../shared/schedule/inspector-head.js\";\nimport { NO_REFUSED_FIELDS, refusedFields, type RefusedFields } from \"../shared/schedule/refusals.js\";\nimport { Seg } from \"../shared/schedule/segments.js\";\nimport { linkedQuantity, remainderOf, splitOf, type AllocationCommands } from \"./actions.js\";\nimport { resourceChoices } from \"./choices.js\";\nimport { dropTarget, landing, placeAsk, rowCoord, type AllocationDrag, type Grip, type Refusal, type Target } from \"./drag.js\";\nimport type { AllocationFit } from \"./fit.js\";\nimport {\n    CHECKING, alternativesOf, bannersOf, batchLine, binCode, binStatus, bookOptions, dropHeadOf, factsOf, fixLabel, groupLine, issueGroups, matesOf,\n    narrowingNote, rankedFits, reservationStatus, reserveOptions, resourceStatus, stepHelp, summaryHints, summaryLine, summaryStats, verdictLine, wasLine,\n    type BookOption, type InspectorBanner, type InspectorStatus, type InspectorWords, type ResourceAt,\n} from \"./inspector-model.js\";\nimport type { AllocationMessages } from \"./messages.js\";\nimport {\n    allocationWords, compareFloat, partsOf, type AllocationDomain, type AllocationValue, type Bin, type Context, type Day, type Issue, type Load,\n    type ResourceLine, type Selection, type Slot,\n} from \"./model.js\";\nimport { a, one, other } from \"./nouns.js\";\nimport { SplitPopover } from \"./split.js\";\nimport { RESERVE_PROBE } from \"./table.js\";\nimport { resourceAxis } from \"./timeline-layout.js\";\nimport { countedIssues } from \"./toolbar.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/**\n * The Bin section's fields (A57): its key, printed — what Search Records finds it by (#1398) — its lane and its time, each\n * drawn by the board in the shared field, and its quantity.\n */\nconst BIN_FIELDS = StructType({ key: StringType, lane: StringType, at: DateTimeType, quantity: FloatType });\n/** A reservation's own field: its key, printed (#1398). */\nconst RESERVATION_FIELDS = StructType({ key: StringType });\n/** A printed field takes no edit. */\nconst NO_EDIT = () => {};\n/** A part's field (A71): its quantity, an Option so its Clear unlinks it. */\nconst PART = OptionType(FloatType);\n/**\n * A bin's parts as a struct: a field per part, named by its resource's key, as the bin's parts are keyed — the key the\n * shared field shows — in the parts' order, as a list: an object would list a key like an integer first (#1574).\n */\nconst partsType = (keys: readonly string[]) => StructType(keys.map(key => [key, PART] as const));\n\n/**\n * A refusal holding Save (#1525), as the board says it: the app's `ready` refusing a drafted bin, named by its code —\n * or by its key, for a bin the board can't read — and its field by its form's label.\n */\nexport interface AllocationRefusal {\n    /** The bin kind's slot, or the record's key, whose session refuses. */\n    readonly kind: string;\n    /** The refusal's issue: its entry's key's text, its field and the app's message. */\n    readonly issue: EditIssue;\n    /** Its bin in words: its code, `LD-2231`. */\n    readonly title: string;\n    /** Its field and the app's message: `Grade: Choose the grade`. */\n    readonly text: string;\n}\n\n/** The Inspector's args: what the board knows, and what it can do. */\nexport interface InspectorArgs {\n    value: AllocationValue;\n    domain: AllocationDomain;\n    context: Context;\n    /** The plan day. */\n    day: Date;\n    /** The day as drafted, and as the record holds it. */\n    plan: Day;\n    held: Day | undefined;\n    loads: SortedMap<string, Load>;\n    lines: ReadonlyMap<string, ResourceLine>;\n    slots: readonly Slot[];\n    /** Every issue: the built-in checks', then the app's. */\n    issues: readonly Issue[];\n    layout: \"timeline\" | \"table\";\n    selection: Selection | undefined;\n    /** An inspection: what a click in the inspector selects, showing it in Details (A8). */\n    inspect: (next: Selection) => void;\n    drag: AllocationDrag;\n    fit: AllocationFit;\n    commands: AllocationCommands;\n    /** Whether what main shows is retained while a narrowing of it is read, or one failed (#1398, CL8): Details' fields, and its buttons that edit, are off. */\n    retained: boolean;\n    /** The day without a bin, and with a probe reservation in a free slot: what a reservation's and a free slot's questions are asked of. */\n    without: (bin: string) => Day;\n    reserving: (lane: string, at: Date) => Day;\n    /** What the narrowing shows of each source; `none`, every row. */\n    shown: { lanes: option<Set<string>>; resources: option<Set<string>>; arrivals: option<Set<string>> };\n    /** A refused drop's reason (A40), and its dismissal. */\n    refusal: Refusal | undefined;\n    dismissRefusal: () => void;\n    /** The bin whose resource Chooser is open in the pane (A8, A21, A64), and opening or closing it. */\n    chooser: string | undefined;\n    setChooser: (bin: string | undefined) => void;\n    /** Books the picked arrival onto a resource, as a click on a ranked resource does (A11, A36). */\n    book: (target: Target) => void;\n    /** The day's first free slot, of the lanes that show (A36). */\n    firstFree: () => { lane: string; at: Date } | undefined;\n    /** The open tab, the board's. */\n    tab: string;\n    onTab: (tab: string) => void;\n    storageKey: string;\n    /** Finds a fit for a bin's unallocated quantity (A74, #1332): with none — no Library's Resources tab to show the fits in — nothing offers it. */\n    onFind?: ((bin: string) => void) | undefined;\n    /** Whether a bin's find is asked and its answer for the drafts as they are is on its way: its button reads `Finding…`. */\n    finding?: ((bin: string) => boolean) | undefined;\n    /** The board's message table: what a bin's Details call its key. */\n    m: AllocationMessages;\n    /** Every refusal holding Save, of every day's drafts (#1525): listed ahead of the issues, and over its bin's form. */\n    refusals: readonly AllocationRefusal[];\n    /** What the board's read says of the day in view (#1398): until its bins and the check's record land, the Issues list shows it is loading (#1595). */\n    read: PeriodRead;\n    /** A refusal's Show pressed: its bin shown on its day and selected. */\n    onRefusal: (refusal: AllocationRefusal) => void;\n}\n\n/** What every part reads. */\ninterface Part { args: InspectorArgs; styles: Styles; words: InspectorWords; horizonEnd: Date }\n\n/** `1 issue`, `3 issues`. */\nconst plural = (n: number, word: string) => `${n} ${word}${n === 1 ? \"\" : \"s\"}`;\nconst timeText = (at: Date) => formatDatePattern(\"HH:mm\", at);\nconst dayLong = (at: Date) => formatDatePattern(\"ddd D MMM\", at);\nconst keyEqual = equalFor(StringType);\n\n/** A bin's refusals holding Save, as its Details show them. */\ninterface BinRefusals {\n    /** Its Details' first banner, over its form. */\n    readonly banners: InspectorBanner[];\n    /** The fields they name, which its forms ring, each with the app's words for it, said under it. */\n    readonly fields: RefusedFields;\n    /**\n     * The tone its forms say a number outside its bounds in (#1585): as stored, refused nothing, it warns; its change\n     * refused, holding Save, it is an error.\n     */\n    readonly breaches: \"warn\" | \"error\";\n}\n\n/**\n * A bin's refusals holding Save (#1525), as its Details' first banner — over its form, as the Calendar's shows an\n * event's — the fields they name, which its form rings, and the tone its forms say a bound it breaks in.\n */\nfunction refusalsOf(args: InspectorArgs, id: string): BinRefusals {\n    const own = args.refusals.filter(r => keyEqual(r.kind, args.value.bin.kind.key) && keyEqual(r.issue.entry, id));\n    if (own.length === 0) return { banners: [], fields: NO_REFUSED_FIELDS, breaches: \"warn\" };\n    return {\n        banners: [{ status: \"warning\", title: \"Not saved yet\", text: own.map(r => r.text).join(\"; \") }],\n        fields: refusedFields(own.map(r => r.issue)),\n        breaches: \"error\",\n    };\n}\n\n/**\n * The end pane (see the module docs).\n *\n * @param args - See {@link InspectorArgs}\n * @returns The pane, or `undefined` when the board has no inspector\n */\nexport function useAllocationInspector(args: InspectorArgs): BuilderFrameDock | undefined {\n    const recipe = useSlotRecipe({ key: \"allocationInspector\" });\n    const styles = useMemo(() => recipe({}) as unknown as Styles, [recipe]);\n    const { value, context } = args;\n    const board = allocationWords();\n    const unit = context.unit;\n    const words = useMemo((): InspectorWords => ({\n        nouns: value.labels, quantity: v => board.quantity(v, unit), number: v => board.quantity(v, \"\"),\n        lane: key => value.lanes.find(l => l.key === key)?.label ?? key, load: (fill, row) => board.load(fill, row, unit),\n    }), [value.labels, value.lanes, board, unit]);\n    // The Timeline's resource axis's end: what `none planned to` names (A58, A85).\n    const horizon = value.settings.horizon;\n    const horizonEnd = useMemo(() => resourceAxis(args.day, Number(board.ms(horizon.before)), Number(board.ms(horizon.after))).to, [args.day, board, horizon]);\n    if (!value.inspector) return undefined;\n    // The counted issues and the refusals holding Save (#1525).\n    const count = countedIssues(args.issues).length + args.refusals.length;\n    // A drag shows Details, where its drop list is (A22, A34); the viewer's tab comes back as it ends.\n    const dragging = args.drag.grip !== undefined;\n    const part: Part = { args, styles, words, horizonEnd };\n    return {\n        label: \"Inspector\", icon: \"sliders\", size: \"320px\", persist: \"local\", active: args.selection !== undefined,\n        // The rail's badge is the issues' count (A55), and its mark says there are some.\n        ...(count > 0 ? { badge: count, mark: { icon: \"triangle-exclamation\", label: plural(count, \"issue\"), tone: \"warning\" as const } } : {}),\n        tab: dragging || args.tab !== \"issues\" ? \"details\" : \"issues\", onTabChange: args.onTab,\n        tabs: [\n            { key: \"details\", label: \"Details\", body: <DetailsTab {...part} /> },\n            { key: \"issues\", label: \"Issues\", count: args.read.state !== \"held\" && args.refusals.length === 0 ? undefined : count, body: <Box css={styles.root} data-allocation-inspector=\"issues\"><IssuesTab {...part} /></Box> },\n        ],\n    };\n}\n\n/** The Details tab, in a region that keeps the keyboard as a control goes with its view, on the heading of the view drawn in its place. */\nfunction DetailsTab(part: Part) {\n    const home = useFocusHome();\n    return <Box ref={home.ref} css={part.styles.root} onFocus={home.onFocus} onBlur={home.onBlur} data-allocation-inspector=\"details\"><Details {...part} /></Box>;\n}\n\n/** Details (A55): the refusal's note, the drop list during a drag or a pick, else what is selected, else the summary. */\nfunction Details(part: Part) {\n    const { args, styles } = part;\n    const dragging = args.drag.grip !== undefined;\n    const subject = args.drag.subject;\n    const inspected = dragging ? undefined : selected(part);\n    return <>\n        {args.refusal !== undefined && !dragging && <Box css={styles.refusal} data-allocation-refusal=\"\">\n            <BannerView status=\"warning\" icon={{ prefix: \"fas\", name: \"triangle-exclamation\" }} title={args.refusal.word} description={args.refusal.text}\n                dismissible onDismiss={args.dismissRefusal} />\n        </Box>}\n        {subject !== undefined && <DropList {...part} subject={subject} dragging={dragging} />}\n        {inspected ?? (subject === undefined && <Summary {...part} />)}\n    </>;\n}\n\n/** What the selection shows, or `undefined` for none — a bin the drafts removed included. */\nfunction selected(part: Part): ReactNode | undefined {\n    const { selection, plan } = part.args;\n    if (selection === undefined) return undefined;\n    if (selection.type === \"bin\") {\n        const bin = plan.bins.get(selection.id);\n        if (bin === undefined) return undefined;\n        return bin.arrival.type === \"none\" ? <ReservationDetails key={selection.id} {...part} id={selection.id} bin={bin} />\n            : <BinDetails key={selection.id} {...part} id={selection.id} bin={bin} />;\n    }\n    if (selection.type === \"slot\") return <SlotDetails key={`${selection.lane}|${selection.at}`} {...part} lane={selection.lane} at={new Date(selection.at)} />;\n    return part.args.context.resources.has(selection.key) ? <ResourceDetails key={selection.key} {...part} resource={selection.key} /> : undefined;\n}\n\n/** The resources a bin is on, or one inspected: their rows, loads and lines. */\nfunction resourcesAt(args: InspectorArgs, keys: readonly string[]): ResourceAt[] {\n    return keys.flatMap(key => {\n        const row = args.context.resources.get(key), load = args.loads.get(key), line = args.lines.get(key);\n        return row === undefined || load === undefined || line === undefined ? [] : [{ row, load, line }];\n    });\n}\n\n/** A head's status, as the shared head draws it. */\nconst statusOf = (status: InspectorStatus) => ({ label: status.word, tone: { type: status.tone }, ring: status.ring });\n\n/** The banners, each the shared banner in its section (A56, A62). */\nfunction Banners({ styles, banners }: { styles: Styles; banners: readonly InspectorBanner[] }) {\n    return <>{banners.map((banner, i) => <Box key={i} css={styles.banner} data-allocation-banner={banner.title}>\n        <BannerView status={banner.status} icon={{ prefix: \"fas\", name: banner.status === \"error\" ? \"circle-exclamation\" : \"triangle-exclamation\" }}\n            title={banner.title} description={banner.text} />\n    </Box>)}</>;\n}\n\n/**\n * The drop list (A34, A86): what is dragged or picked, the three best fits as\n * drop targets — each a Book while a pick waits for its click — and the\n * layout's hint.\n */\nfunction DropList({ subject, dragging, ...part }: Part & { subject: Grip; dragging: boolean }) {\n    const { args, styles, words } = part;\n    const { drag, context } = args;\n    const head = dropHeadOf({\n        subject, dragging, layout: args.layout, day: args.day, plan: args.plan, held: args.held, context, loads: args.loads, lines: args.lines,\n        quantity: drag.asked?.quantity, basis: drag.answer?.basis, firstFree: dragging ? undefined : args.firstFree(), words,\n    });\n    const fits = head.fits ? rankedFits(drag.answer, drag.ranks, context) : [];\n    return <>\n        <Box css={styles.head} data-allocation-drop-head=\"\" {...FOCUS_HOME_PROPS}>\n            <Box css={styles.eyebrow}>{head.eyebrow}</Box>\n            <Box css={styles.name}>{head.title}</Box>\n            {head.meta !== \"\" && <Box css={styles.when}>{head.meta}</Box>}\n        </Box>\n        <Box css={styles.section} data-allocation-drop-list=\"\">\n            {fits.map(fit => <DropRow key={fit.key} {...part} target={{ kind: \"resource\", resource: fit.key }} rank={fit.rank} name={fit.name} why={fit.why} book={!dragging} />)}\n            {head.fits && fits.length === 0 && <Box css={styles.absent} data-allocation-drop-none=\"\">\n                {args.fit.error !== undefined ? \"fits unavailable\" : drag.answer === undefined ? CHECKING : `no ${one(words.nouns.resource)} has a gap that fits`}\n            </Box>}\n            <Box css={styles.line} data-allocation-drop-hint=\"\">{head.hint}</Box>\n        </Box>\n    </>;\n}\n\n/**\n * A fit in the drop list: a drop target as its resource's row is (A26) — the\n * board's one drop target, so a drag resting on it draws the resource's links\n * and marks its bins as its row does (A29, A65) — and with a pick its Book (A34).\n */\nfunction DropRow({ args, styles, target, rank, name, why, book }: Part & { target: Extract<Target, { kind: \"resource\" }>; rank: number; name: string; why: string; book: boolean }) {\n    const { drag } = args;\n    const { veto, options } = dropTarget(drag, target);\n    const ref = useDropCell(drag.enabled ? rowCoord(drag.surface, target.resource) : null, false, veto, undefined, options);\n    return <Box ref={ref} css={styles.dropRow} data-allocation-drop-row={target.resource}>\n        <Box as=\"span\" css={styles.dropRank}>{rank}</Box>\n        <Box as=\"span\" data-drop-row=\"name\">{name}</Box>\n        <Box as=\"span\" data-drop-row=\"action\">{book && args.commands.canEdit() && <Button size=\"xs\" variant=\"outline\" disabled={args.retained} onClick={() => args.book(target)}>Book</Button>}</Box>\n        <Box as=\"span\" data-drop-row=\"why\">{why}</Box>\n    </Box>;\n}\n\n/** A bin (A56–A59): its head and actions, its banners, the Bin section, Assigned to, the other gaps that fit, its arrival's details and its `was` line. */\nfunction BinDetails({ id, bin, ...part }: Part & { id: string; bin: Bin }) {\n    const { args, styles, words } = part;\n    const { context, held, domain, commands, issues, day, plan, fit } = args;\n    const nouns = words.nouns;\n    const editable = commands.canEdit();\n    const committed = held?.bins.get(id);\n    const draft = committed === undefined || !domain.sameBin(committed, bin);\n    const parts = partsOf(bin);\n    const current = parts[0]?.key;\n    const at = resourcesAt(args, parts.map(p => p.key));\n    const status = binStatus(bin, committed, domain.sameBin, at.map(r => r.line), nouns);\n    const code = binCode(context, bin, nouns);\n    const arrival = bin.arrival.type === \"some\" ? context.arrivals.get(bin.arrival.value) : undefined;\n    const refused = refusalsOf(args, id);\n    const banners = [...refused.banners, ...bannersOf({ issues, bin: { id, code }, resources: at, day, words })];\n    // Its connector's question (A23, F1): asked as the bin was selected; its answer ranks the other gaps (A59).\n    const asked = placeAsk(plan, { kind: \"port\", bin: id });\n    const alternatives = alternativesOf(asked === undefined ? undefined : fit.answer(asked.ask), current, context);\n    const moves = linkedQuantity(bin, undefined)?.from !== undefined;\n    // Find a fit (A74): a bin's action while its parts leave some of it unallocated. It edits nothing, so a day that takes no edit offers it too.\n    const find = args.onFind !== undefined && compareFloat(remainderOf(bin), 0) > 0 ? args.onFind : undefined;\n    return <>\n        <ScheduleInspectorHead styles={styles} kind={{ name: committed === undefined ? `New ${one(nouns.bin)}` : `${nouns.bin.one} ${id}`, icon: \"box\" }} title={`${code} · ${words.quantity(bin.quantity)}`}\n            when={arrival?.meta.type === \"some\" ? arrival.meta.value : undefined} status={statusOf(status)} pending={status.pending} home>\n            {(editable || find !== undefined) && <Box css={styles.headActions} data-allocation-bin-actions=\"\">\n                {/* Each an edit: off while main is retained (CL8), as the fields are. */}\n                {editable && bin.parts.size > 0 && <Button size=\"xs\" variant=\"outline\" disabled={args.retained} onClick={() => commands.unlink(id)}><FontAwesomeIcon icon={faLinkSlash} />Unlink</Button>}\n                {editable && committed !== undefined && draft && <Button size=\"xs\" variant=\"outline\" disabled={args.retained} onClick={() => commands.revert(id)}><FontAwesomeIcon icon={faRotateLeft} />Revert</Button>}\n                {editable && <Button size=\"xs\" variant=\"outline\" disabled={args.retained} onClick={() => commands.remove(id)}><FontAwesomeIcon icon={faXmark} />Back to {nouns.arrival.other}</Button>}\n                {find !== undefined && <Button size=\"xs\" variant=\"outline\" data-allocation-find=\"\" onClick={() => find(id)}>\n                    <FontAwesomeIcon icon={faMagnifyingGlass} />{args.finding?.(id) === true ? \"Finding…\" : \"Find a fit\"}\n                </Button>}\n            </Box>}\n        </ScheduleInspectorHead>\n        <Banners styles={styles} banners={banners} />\n        <BinSection {...part} id={id} bin={bin} committed={committed} refused={refused.fields} breaches={refused.breaches} />\n        <AssignedTo {...part} id={id} bin={bin} current={current} at={at[0]} breaches={refused.breaches} />\n        <Box css={styles.section} data-allocation-alternatives=\"\">\n            <Box css={styles.sectionHead}>{bin.parts.size > 0 ? \"Other gaps that fit\" : \"Gaps that fit\"}</Box>\n            {alternatives === undefined ? <Box css={styles.absent}>{fit.error !== undefined ? \"fits unavailable\" : CHECKING}</Box>\n                : alternatives.length === 0 ? <Box css={styles.absent}>no other free gap is long enough</Box>\n                    : alternatives.map(o => <Box key={o.key} css={styles.option} data-ranked=\"\" data-allocation-alternative={o.key}>\n                        <Box as=\"span\" css={styles.rank}>{o.rank}</Box>\n                        <Box css={styles.optionText}><Box css={styles.optionName}>{o.name}</Box><Box css={styles.optionLine} title={o.why}>{o.why}</Box></Box>\n                        {editable ? <Button size=\"xs\" variant=\"outline\" disabled={args.retained} onClick={() => commands.link(id, o.key, undefined)}>{moves ? \"Move\" : \"Link\"}</Button> : <span />}\n                    </Box>)}\n        </Box>\n        {arrival !== undefined && arrival.details.length > 0 && <Box css={styles.section} data-allocation-details=\"\">\n            <Box as=\"dl\" css={styles.rows}>{arrival.details.map((detail, i) => <Fragment key={i}>\n                <Box as=\"dt\" css={styles.rowLabel}>{detail.label}</Box><Box as=\"dd\" css={styles.rowValue} data-text=\"\">{detail.value}</Box>\n            </Fragment>)}</Box>\n        </Box>}\n        {draft && <Box css={styles.was} data-allocation-was=\"\"><span>{wasLine(committed, context, words)}</span></Box>}\n    </>;\n}\n\n/**\n * The Bin section (A57): its key, printed — what Search Records finds it by\n * (#1398) — its lane — the shared segments, a change its lane's slot in the\n * same hour — its time — the shared stepper, a slot at a time — and its\n * quantity, each a field of the shared form; on a day that takes no edit its\n * lane, by its name, and its time are printed as the form prints every field,\n * with no segments or stepper (the hand retest); then the row's own\n * fields, the bin kind's form over its `fields` — each field a refusal names\n * (`refused`) ringed, the app's words for it under it, the quantity's among\n * them — and the app's columns as rows; or, with the bin kind's\n * own `inspector`, that form over the row in place of the quantity, the\n * fields and the rows. A number outside its field's bounds is said in the tone\n * the bin's Save stands in (`breaches`, #1585), and the quantity takes the\n * keyboard where an issue gone to names the kind's field it is.\n */\nfunction BinSection({ id, bin, committed, refused, breaches, ...part }: Part & {\n    id: string; bin: Bin; committed: Bin | undefined; refused: RefusedFields; breaches: \"warn\" | \"error\";\n}) {\n    const { args, styles, words } = part;\n    const { value, slots, plan, commands, day, context, shown } = args;\n    const nouns = words.nouns;\n    const editable = commands.canEdit();\n    const form = value.bin.kind.inspector.type === \"some\" ? value.bin.kind.inspector.value : undefined;\n    // Its lane's slots, in time order, and the one it is in.\n    const laneSlots = useCallback((lane: string) => slots.filter(s => s.lane === lane), [slots]);\n    const own = laneSlots(bin.lane);\n    const index = own.findIndex(s => s.bins.includes(id));\n    const { move } = commands;\n    const toSlot = useCallback((lane: string, k: number) => {\n        const slot = laneSlots(lane)[k];\n        if (slot !== undefined) move(id, lane, landing(slots, plan, lane, slot.at, id));\n    }, [laneSlots, move, id, slots, plan]);\n    // The lanes the narrowing shows, and its own (A92).\n    const lanes = value.lanes.filter(l => shown.lanes.type === \"none\" || shown.lanes.value.has(l.key) || l.key === bin.lane);\n    // The quantity a split or partly allocated bin keeps is what its parts take; a bin wholly on one resource takes its part with it.\n    const parts = partsOf(bin);\n    const whole = parts.length === 1 && compareFloat(parts[0]!.quantity, bin.quantity) === 0;\n    const min = whole ? 0 : parts.reduce((n, p) => n + p.quantity, 0);\n    // What the bin kind's form holds its quantity to (#1585): the least and the most a hint gives its field — the least the\n    // parts take where that is the higher, never past the most — so a quantity they don't hold is said under the field.\n    const bounds = useMemo(() => {\n        const field = getSomeorUndefined(value.bin.kind.schedule.quantity);\n        const spec = field === undefined ? undefined : value.bin.kind.fields.find(s => s.path.length === 1 && keyEqual(s.path[0]!, field));\n        return spec?.editor.type === \"number\" ? { least: getSomeorUndefined(spec.editor.value.min), most: getSomeorUndefined(spec.editor.value.max) } : {};\n    }, [value.bin.kind]);\n    const most = bounds.most;\n    const higher = bounds.least !== undefined && compareFloat(bounds.least, min) > 0 ? bounds.least : min;\n    const least = most !== undefined && compareFloat(higher, most) > 0 ? most : higher;\n    // The stepper's help says how it steps: a day that takes no edit has no stepper, and says nothing of it.\n    const help = editable ? stepHelp(own, bin.lane, value.every, day, words) : undefined;\n    // The field an issue gone to asks for (#1585): the kind's quantity is drawn here, its row's other fields by the form\n    // under it, which reads its own.\n    const asked = useFieldAsk(value.bin.kind.key, id);\n    const quantityField = getSomeorUndefined(value.bin.kind.schedule.quantity);\n    const focus = asked !== undefined && quantityField !== undefined && keyEqual(asked, quantityField) ? \"quantity\" : undefined;\n    // What a refusal says of the kind's quantity, which this form draws as its own: ringed here, the app's words under it.\n    const quantityRefused = quantityField === undefined ? undefined : refused.get(quantityField);\n    const quantityIssues = useMemo((): RefusedFields => (quantityRefused === undefined ? NO_REFUSED_FIELDS : new Map([[\"quantity\", quantityRefused]])), [quantityRefused]);\n    const quantityLabel = nouns.quantity;\n    const keyLabel = args.m.binKey();\n    const specs = useMemo(() => Fields.specs(BIN_FIELDS, {\n        key: Fields.readonly({ label: keyLabel }),\n        lane: Fields.reference({ label: nouns.lane.one, of: \"lanes\" }),\n        at: Fields.readonly({ label: `${nouns.bin.one} time`, ...(help === undefined ? {} : { help }) }),\n        quantity: Fields.number({ label: quantityLabel, min: least, ...(most === undefined ? {} : { max: most }), step: 1,\n            ...(context.unit === \"\" ? {} : { unit: context.unit }) }),\n    }, form !== undefined ? [\"quantity\"] : []), [keyLabel, nouns.lane.one, nouns.bin.one, help, quantityLabel, least, most, context.unit, form]);\n    // Every lane by its name: what a lane the form prints says.\n    const laneNames = useMemo(() => ({ lanes: value.lanes.map(l => ({ key: l.key, label: l.label })) }), [value.lanes]);\n    const stepper = useSlotRecipe({ key: \"stepper\" })({ tone: \"neutral\", size: \"md\" }) as unknown as Styles;\n    const hourly = value.every.type === \"hours\" && compareFloat(value.every.value, 1) === 0;\n    const earlier = hourly ? \"One hour earlier\" : \"One slot earlier\", later = hourly ? \"One hour later\" : \"One slot later\";\n    const renderControl = useCallback((spec: FieldSpecValue): ReactNode | undefined => {\n        // A day that takes no edit — a published one — prints its lane and its time as the rest of the form is printed: no\n        // segments or stepper, whose controls, though off, looked editable (the hand retest).\n        if (!editable) return undefined;\n        if (spec.path[0] === \"lane\") {\n            return <Seg fullWidth label={nouns.lane.one} scope=\"allocation\" name=\"inspector-lane\" items={lanes.map(l => ({ key: l.key, label: l.label, disabled: !editable }))}\n                active={bin.lane} onPick={lane => { if (lane !== bin.lane) toSlot(lane, Math.max(0, index)); }} />;\n        }\n        if (spec.path[0] === \"at\") {\n            // Its fieldset turns its buttons off while main is retained (CL8); marked, the strip looks off as the fields beside it do.\n            return <Box css={stepper.root} data-allocation-stepper=\"\" data-disabled={args.retained ? \"\" : undefined}>\n                <chakra.button type=\"button\" css={stepper.button} aria-label={earlier} title={earlier} disabled={!editable || index <= 0}\n                    onClick={() => toSlot(bin.lane, index - 1)}><FontAwesomeIcon icon={faMinus} /></chakra.button>\n                <Box as=\"span\" css={stepper.value} data-allocation-time=\"\">{timeText(bin.at)}</Box>\n                <chakra.button type=\"button\" css={stepper.button} aria-label={later} title={later} disabled={!editable || index < 0 || index >= own.length - 1}\n                    onClick={() => toSlot(bin.lane, index + 1)}><FontAwesomeIcon icon={faPlus} /></chakra.button>\n            </Box>;\n        }\n        return undefined;\n    }, [nouns.lane.one, lanes, editable, bin.lane, bin.at, toSlot, index, own.length, stepper, earlier, later, args.retained]);\n    const { setQuantity } = commands;\n    // A quantity under what its parts take, or under nothing, its command refuses: the field says what they take, and\n    // shows what the bin holds. One past a hint's bound is the draft's, flagged as it stands.\n    const format = useFormatters();\n    const fieldWords = useMemo((): FieldFormWords => ({ ...format, m: fieldFormMessages }), [format]);\n    const onChange = useCallback((path: readonly string[], next: unknown) => {\n        if (path[0] !== \"quantity\" || setQuantity(id, next as number)) return undefined;\n        return compareFloat(next as number, min) < 0 ? fieldBreachText({ side: \"min\", bound: min }, fieldWords) : undefined;\n    }, [setQuantity, id, min, fieldWords]);\n    const shownValue = useMemo(() => ({ key: id, lane: bin.lane, at: bin.at, quantity: bin.quantity }), [id, bin.lane, bin.at, bin.quantity]);\n    // What the drafts began from: the bin as the day holds it, or nothing for a new one, every field of which is a draft.\n    const baseline = useMemo(() => committed === undefined ? {} : { key: id, lane: committed.lane, at: committed.at, quantity: committed.quantity }, [committed, id]);\n    // Off while main is retained (CL8): the board takes no edit until it lands.\n    return <chakra.fieldset css={[styles.edits, styles.fields]} disabled={args.retained} data-allocation-bin-section=\"\">\n        <Box css={styles.sectionHead}>{nouns.bin.one}</Box>\n        <FieldForm specs={specs} value={shownValue} baseline={baseline} options={laneNames} onChange={onChange} readOnly={!editable} renderControl={renderControl}\n            issues={quantityIssues} focus={focus} breaches={breaches} />\n        {form !== undefined ? <CustomBin {...part} id={id} bin={bin} form={form} /> : <>\n            <RowFields {...part} id={id} bin={bin} committed={committed} refused={refused} breaches={breaches} />\n            <ValueRows {...part} bin={bin} />\n        </>}\n    </chakra.fieldset>;\n}\n\n/**\n * The row's own fields (`Builder Interfaces Spec.md` §1, rule 2): the bin kind's form over its `fields` but its quantity,\n * the Bin section's (#1585), each edit one command, a draft until Save, and each field a refusal names ringed (#1525),\n * the app's words for it under it — the one a refusal gone to names taking the keyboard as the form draws it — and a\n * number outside its bounds said in the\n * tone the bin's Save stands in (`breaches`).\n */\nfunction RowFields({ args, id, bin, committed, refused, breaches }: Part & {\n    id: string; bin: Bin; committed: Bin | undefined; refused: RefusedFields; breaches: \"warn\" | \"error\";\n}) {\n    const { value, commands } = args;\n    const { field } = commands;\n    const onChange = useCallback((path: readonly string[], next: unknown) => { field(id, path, next); }, [field, id]);\n    const focus = useFieldAsk(value.bin.kind.key, id);\n    const specs = useMemo(() => {\n        const quantity = getSomeorUndefined(value.bin.kind.schedule.quantity);\n        return value.bin.kind.fields.filter(spec => quantity === undefined || !keyEqual(spec.path[0]!, quantity));\n    }, [value.bin.kind]);\n    if (specs.length === 0) return null;\n    return <FieldForm specs={specs} value={bin.row} baseline={committed?.row ?? {}} onChange={onChange} readOnly={!commands.canEdit()} issues={refused} focus={focus}\n        breaches={breaches} />;\n}\n\n/** The app's columns as rows (A57): each column's text, in warn-text 600 when its tone warns; read through the app's callbacks over the bin's row. */\nfunction ValueRows({ args, styles, bin }: Part & { bin: Bin }) {\n    const { value, domain } = args;\n    const read = useCallback(() => {\n        const bytes = domain.encodeRow(bin.row);\n        return value.columns.map(column => {\n            const tone = column.tone.type === \"some\" ? column.tone.value(bytes) : undefined;\n            return { key: column.key, label: column.label, text: column.text(bytes), warn: tone?.type === \"some\" && (tone.value.type === \"warning\" || tone.value.type === \"danger\") };\n        });\n    }, [value.columns, domain, bin.row]);\n    const { result } = useTrackedEvaluation(read);\n    // A column that fails shows nothing, as the Table's does.\n    if (!result.ok || result.value.length === 0) return null;\n    return <Box as=\"dl\" css={styles.rows} data-allocation-values=\"\">{result.value.map(row => <Fragment key={row.key}>\n        <Box as=\"dt\" css={styles.rowLabel}>{row.label}</Box>\n        <Box as=\"dd\" css={styles.rowValue} data-tone={row.warn ? \"warning\" : undefined}>{row.text}</Box>\n    </Fragment>)}</Box>;\n}\n\n/** The bin kind's own form (`Schedule.events(record, { …, inspector })`): over the bin's row, its writer one command of the bins' session — a draft until Save, never a write of the record. */\nfunction CustomBin({ args, styles, id, bin, form, words }: Part & { id: string; bin: Bin; form: Extract<InspectorArgs[\"value\"][\"bin\"][\"kind\"][\"inspector\"], { type: \"some\" }>[\"value\"] }) {\n    const { domain, commands, storageKey } = args;\n    // The writer stays the same function while the bin does: the latest commands run it.\n    const live = useRef(commands);\n    live.current = commands;\n    const bytes = useMemo(() => domain.encodeRow(bin.row), [domain, bin.row]);\n    const write = useCallback((edited: Uint8Array): null => { live.current.row(id, edited); return null; }, [id]);\n    const read = useCallback(() => form(bytes, write), [form, bytes, write]);\n    const { result } = useTrackedEvaluation(read);\n    if (!result.ok) return <Box role=\"alert\" css={styles.error}>The {one(words.nouns.bin)} form could not be rendered.</Box>;\n    return <chakra.fieldset css={styles.edits} disabled={!commands.canEdit()} data-allocation-bin-form=\"\">\n        <Box css={styles.custom}><EastChakraComponent value={result.value} storageKey={`${storageKey}.inspector.bin.${id}`} /></Box>\n    </chakra.fieldset>;\n}\n\n/** The shared meter's track, its fill in the load's tone, and the min tick (A58). */\nfunction Meter({ styles, at, tone }: { styles: Styles; at: ResourceAt; tone: \"brand\" | \"warning\" | \"danger\" }) {\n    const meter = useSlotRecipe({ key: \"meter\" })({ thickness: \"md\", tone }) as unknown as Styles;\n    const { row, load } = at;\n    const fill = row.max > 0 ? Math.min(100, load.fill / row.max * 100) : 0, tick = row.max > 0 ? Math.min(100, row.min / row.max * 100) : 0;\n    return <Box css={styles.meter} data-allocation-meter=\"\" role=\"img\" aria-label={`${row.label}: ${Math.round(fill)}% of its max`}>\n        <Box css={meter.track}><Box css={meter.fill} style={{ width: `${fill}%` }} /></Box>\n        <Box css={styles.meterTick} style={{ left: `${tick}%` }} data-allocation-min=\"\" />\n    </Box>;\n}\n\n/**\n * The job before the day · Hold · the next job (A58, A62): each labelled in the app's words, as the Timeline's legend\n * names them — `Prior job` · `Hold` · `Next job` unless the app's `labels` say otherwise (review of #1481, finding 7).\n */\nfunction Facts({ styles, at, words, day, horizonEnd }: { styles: Styles; at: ResourceAt; words: InspectorWords; day: Date; horizonEnd: Date }) {\n    const facts = factsOf(at, day, horizonEnd, words);\n    return <Box as=\"dl\" css={styles.rows} data-allocation-facts=\"\">\n        <Box as=\"dt\" css={styles.rowLabel}>{words.nouns.priorJob}</Box><Box as=\"dd\" css={styles.rowValue}>{facts.before}</Box>\n        <Box as=\"dt\" css={styles.rowLabel}>{words.nouns.hold}</Box><Box as=\"dd\" css={styles.rowValue} data-absent={facts.hold.absent ? \"\" : undefined}>{facts.hold.text}</Box>\n        <Box as=\"dt\" css={styles.rowLabel}>{words.nouns.nextJob}</Box><Box as=\"dd\" css={styles.rowValue} data-tone={facts.next.warn ? \"warning\" : undefined}>{facts.next.text}</Box>\n    </Box>;\n}\n\n/** A resource's bins today (A58, A62): a click selects one; the inspected one bold. */\nfunction Mates({ args, styles, words, resource, current }: Part & { resource: string; current: string | undefined }) {\n    const mates = matesOf(args.plan, args.held, resource, args.context, words);\n    if (mates.length === 0) return <Box css={styles.absent}>no {other(words.nouns.bin)} today</Box>;\n    return <Box css={styles.mates} data-allocation-mates=\"\">{mates.map(mate => <chakra.button key={mate.id} type=\"button\" css={styles.mate} title={mate.tip}\n        data-current={mate.id === current ? \"\" : undefined} data-allocation-mate={mate.id} onClick={() => args.inspect({ type: \"bin\", id: mate.id })}>\n        <span data-mate=\"time\">{mate.time}</span><span data-mate=\"lane\">{mate.lane}</span><span data-mate=\"code\">{mate.code}</span><span data-mate=\"quantity\">{mate.quantity}</span>\n    </chakra.button>)}</Box>;\n}\n\n/**\n * Assigned to (A58): the resource field — its name, or `+ Choose a resource`\n * in warn — which opens the shared Chooser in the pane, every section of it\n * the fit's answer, as the Table's chevron does (A48); then the fill and its\n * meter, the group line, the jobs before and after the day and the hold between, the resource's bins today\n * and the batch line. Not linked: the field, and the layout's hint.\n */\nfunction AssignedTo({ id, bin, current, at, breaches, ...part }: Part & {\n    id: string; bin: Bin; current: string | undefined; at: ResourceAt | undefined; breaches: \"warn\" | \"error\";\n}) {\n    const { args, styles, words, horizonEnd } = part;\n    const { commands, context, fit, chooser, setChooser, day } = args;\n    const nouns = words.nouns;\n    const editable = commands.canEdit();\n    // Its resource field is off, its Chooser closed, while main is retained (CL8).\n    const open = chooser === id && editable && !args.retained;\n    // The question the Table's resource cell asks (A48): the bin placed with what its link carries.\n    const quantity = linkedQuantity(bin, current)?.quantity ?? bin.quantity;\n    const ask = useMemo(() => variant(\"place\", { subject: variant(\"bin\", id), quantity }), [id, quantity]);\n    const { ask: asking } = fit;\n    useEffect(() => { if (open) asking(ask); }, [open, ask, asking, args.plan]);\n    const sections = open ? resourceChoices({ context, words, binRow: true, current, answer: fit.answer(ask), shown: args.shown.resources }) : [];\n    // Closed from its keys or by a choice, the Chooser gives the focus back to the field, as a popover gives it to its trigger:\n    // the field drawn once it has closed, linked or not.\n    const fieldRef = useRef<HTMLButtonElement>(null);\n    const refocus = useRef(false);\n    useLayoutEffect(() => {\n        if (!refocus.current || open) return;\n        refocus.current = false;\n        fieldRef.current?.focus({ preventScroll: true });\n    });\n    const close = () => { refocus.current = true; setChooser(undefined); };\n    const name = current === undefined ? undefined : context.resources.get(current)?.label ?? current;\n    // Off on a published day too, where it prints the resource; switched off while main is retained, it is marked, so it\n    // looks off as the fields beside it do.\n    const field = <chakra.button ref={fieldRef} type=\"button\" css={styles.resourceField} data-unlinked={current === undefined ? \"\" : undefined} data-allocation-resource-field=\"\"\n        data-disabled={editable && args.retained ? \"\" : undefined} disabled={!editable || args.retained} aria-haspopup=\"listbox\" aria-expanded={open} title={`Choose the ${one(nouns.resource)} · the same list as the Table’s chevron`}\n        onClick={() => setChooser(open ? undefined : id)}>\n        <span>{name ?? `+ Choose ${a(nouns.resource)}`}</span>\n        {editable && <FontAwesomeIcon icon={open ? faChevronUp : faChevronDown} />}\n    </chakra.button>;\n    const choices = open && <Chooser sections={sections} placeholder={`Find ${a(nouns.resource)}`} surface=\"inline\" autoFocus\n        onChoose={key => { close(); if (key !== current) commands.link(id, key, current); }} onClose={close} />;\n    // `Split…` (A71, #1362) on every bin with something to split: the remainder, or with none some of its largest part, onto another resource —\n    // off while main is retained (CL8), as the fields are.\n    const remainder = remainderOf(bin);\n    const split = editable && splitOf(bin) !== undefined ? <SplitPopover id={id} bin={bin} context={context} plan={args.plan} commands={commands} fit={fit} words={words}\n        shown={args.shown.resources} trigger={label => <chakra.button type=\"button\" css={styles.link} disabled={args.retained} data-allocation-split-open=\"\" title={label}>\n            <FontAwesomeIcon icon={faArrowsSplitUpAndLeft} />Split…\n        </chakra.button>} /> : undefined;\n    const opener = current !== undefined && at !== undefined\n        ? <chakra.button type=\"button\" css={styles.link} onClick={() => args.inspect({ type: \"resource\", key: current })}>Open {one(nouns.resource)}<FontAwesomeIcon icon={faArrowRight} /></chakra.button>\n        : undefined;\n    const head = <Box css={styles.sectionRow}>\n        <Box css={styles.sectionHead}>Assigned to</Box>\n        {(split !== undefined || opener !== undefined) && <Box as=\"span\" css={styles.sectionActions}>{split}{opener}</Box>}\n    </Box>;\n    if (current === undefined || at === undefined) {\n        return <Box css={styles.section} data-allocation-assigned=\"\">\n            {head}\n            <Box css={styles.sectionRow}>{field}</Box>\n            {choices}\n            <Box css={styles.line}>{args.layout === \"table\" ? \"Or use the chevron on its row in the table.\" : `Or drag the ${one(nouns.bin)}’s connector onto ${a(nouns.resource)} row.`}</Box>\n        </Box>;\n    }\n    const tone = at.line.over ? \"danger\" : at.line.under ? \"warning\" : undefined;\n    return <Box css={styles.section} data-allocation-assigned=\"\">\n        {head}\n        <Box css={styles.sectionRow}>{field}<Box as=\"span\" css={styles.fill} data-tone={tone} data-allocation-fill=\"\">{words.load(at.load.fill, at.row)}</Box></Box>\n        {choices}\n        <Meter styles={styles} at={at} tone={tone === \"danger\" ? \"danger\" : tone === \"warning\" ? \"warning\" : \"brand\"} />\n        <Box css={styles.line}>{groupLine(at.row, words)}</Box>\n        <Facts styles={styles} at={at} words={words} day={day} horizonEnd={horizonEnd} />\n        <Box css={styles.sectionHead}>On this {one(nouns.resource)} today</Box>\n        <Mates {...part} resource={current} current={id} />\n        <Box css={styles.line} data-allocation-batch=\"\">{batchLine(at.load, words)}</Box>\n        <Parts {...part} id={id} bin={bin} remainder={remainder} breaches={breaches} />\n    </Box>;\n}\n\n/**\n * A bin's parts (A70, A71): each part's quantity a field of the shared form,\n * in its resources' order, labelled by its resource; its Clear unlinks the\n * part, as nothing on it does; each holds at most itself and the remainder —\n * one typed past it refused, the field saying so, and one stored past it said\n * in the tone the bin's Save stands in (`breaches`, #1585). Then what the\n * parts leave unallocated, in warn. Every edit is a command.\n */\nfunction Parts({ args, styles, words, id, bin, remainder, breaches }: Part & { id: string; bin: Bin; remainder: number; breaches: \"warn\" | \"error\" }) {\n    const { context, commands, held } = args;\n    const editable = commands.canEdit();\n    const code = binCode(context, bin, words.nouns);\n    const keys = useMemo(() => [...bin.parts.keys()], [bin.parts]);\n    // Each part's field: its resource's name, from none to what it holds and the remainder together.\n    const specs = useMemo(() => Fields.specs(partsType(keys), Object.fromEntries(keys.map(key => [key,\n        Fields.number({ label: context.resources.get(key)?.label ?? key, min: 0, max: (bin.parts.get(key) ?? 0) + remainder, step: 1,\n            ...(context.unit === \"\" ? {} : { unit: context.unit }) })]))), [keys, bin.parts, remainder, context]);\n    const value = useMemo(() => Object.fromEntries(keys.map(key => [key, some(bin.parts.get(key)!)])), [keys, bin.parts]);\n    // What the drafts began from: the parts as the day holds the bin, none where it held nothing.\n    const committed = held?.bins.get(id);\n    const baseline = useMemo(() => committed === undefined ? undefined : Object.fromEntries(keys.map(key => {\n        const was = committed.parts.get(key);\n        return [key, was === undefined ? none : some(was)];\n    })), [committed, keys]);\n    const { setPart, unlink } = commands;\n    const onChange = useCallback((path: readonly string[], next: unknown) => {\n        const key = path[0];\n        if (key === undefined || !bin.parts.has(key)) return;\n        const part = next as option<number>;\n        if (part.type === \"none\") unlink(id, key); else setPart(id, key, part.value);\n    }, [bin.parts, id, setPart, unlink]);\n    // The form's Clear is a part's Unlink, in the Table's words for it (A84).\n    const format = useFormatters();\n    const formWords = useMemo((): FieldFormWords => ({ ...format, m: { ...fieldFormMessages, clear: ({ label }) => `Unlink ${code} from ${label}` } }), [format, code]);\n    // Off while main is retained (CL8), as the bin's own fields are.\n    return <chakra.fieldset css={[styles.edits, styles.parts]} disabled={args.retained} data-allocation-parts=\"\">\n        <Box css={styles.sectionHead}>Parts</Box>\n        <FieldForm specs={specs} value={value} baseline={baseline} onChange={onChange} readOnly={!editable} words={formWords} breaches={breaches} refusesBreaches />\n        {compareFloat(remainder, 0) > 0 && <Box css={styles.remainder} data-allocation-remainder=\"\">{words.quantity(remainder)} unallocated</Box>}\n    </chakra.fieldset>;\n}\n\n/** One booking or reservation in a list (A60, A61): its name and figure, its line, and its button. */\nfunction ListOption({ styles, name, quantity, line, warn, children, testid }: { styles: Styles; name: string; quantity: string; line: string; warn: boolean; children: ReactNode; testid: string }) {\n    return <Box css={styles.option} data-allocation-option={testid}>\n        <Box css={styles.optionText}>\n            <Box css={styles.optionName}><span>{name}</span><span data-option=\"quantity\">{quantity}</span></Box>\n            <Box css={styles.optionLine} data-tone={warn ? \"warning\" : undefined} title={line}>{line}</Box>\n        </Box>\n        {children}\n    </Box>;\n}\n\n/** A free slot (A60): what it is, every arrival it can book, the five best resources to reserve it on, and the hint. */\nfunction SlotDetails({ lane, at, ...part }: Part & { lane: string; at: Date }) {\n    const { args, styles, words } = part;\n    const { commands, fit, plan, held, context, day, slots, loads, shown } = args;\n    const nouns = words.nouns;\n    const editable = commands.canEdit();\n    // The question a free row's resource cell asks (A48): a reservation in the slot.\n    const of = args.reserving(lane, at);\n    const ask = useMemo(() => variant(\"place\", { subject: variant(\"bin\", RESERVE_PROBE), quantity: 0 }), []);\n    const { ask: asking } = fit;\n    useEffect(() => { asking(ask, of); }, [ask, of, asking]);\n    const reserve = reserveOptions(fit.answer(ask, of), loads, context, shown.resources, words);\n    const books = bookOptions({ plan, held, context, day, shown: shown.arrivals, words });\n    const where = landing(slots, plan, lane, at, undefined);\n    const run = (option: BookOption) => option.grip.kind === \"arrival\" ? commands.book(option.grip.arrival, lane, where, undefined) : commands.restore(option.grip.bin, lane, where, undefined);\n    return <>\n        <ScheduleInspectorHead styles={styles} kind={{ name: \"Slot\", icon: \"clock\" }} title={`${words.lane(lane)} · ${timeText(at)}`}\n            when={`${dayLong(day)} · no ${one(nouns.arrival)} · no ${one(nouns.resource)}`} status={{ label: \"Free\", tone: { type: \"neutral\" }, ring: false }} home />\n        <Box css={styles.section} data-allocation-book=\"\">\n            <Box css={styles.sectionHead}>Book {a(nouns.arrival)}</Box>\n            {books.length === 0 ? <Box css={styles.absent}>no {other(nouns.arrival)} to book</Box>\n                : books.map(o => <ListOption key={o.key} styles={styles} name={o.code} quantity={o.quantity} line={o.line} warn={o.warn} testid={o.key}>\n                    {editable ? <Button size=\"xs\" variant=\"outline\" disabled={args.retained} onClick={() => run(o)}>Book</Button> : <span />}\n                </ListOption>)}\n        </Box>\n        <Box css={styles.section} data-allocation-reserve=\"\">\n            <Box css={styles.sectionHead}>Reserve {a(nouns.resource)}</Box>\n            {reserve === undefined ? <Box css={styles.absent}>{fit.error !== undefined ? \"fits unavailable\" : CHECKING}</Box>\n                : reserve.length === 0 ? <Box css={styles.absent}>no {one(nouns.resource)} has a gap that fits</Box>\n                    : reserve.map(o => <ListOption key={o.key} styles={styles} name={o.name} quantity={o.range} line={o.line} warn={false} testid={o.key}>\n                        {editable ? <Button size=\"xs\" variant=\"outline\" disabled={args.retained} onClick={() => commands.reserve(lane, where, o.key)}>Reserve</Button> : <span />}\n                    </ListOption>)}\n            <Box css={styles.line}>Or drag {a(nouns.arrival)} or {a(nouns.resource)} from the library onto this row.</Box>\n        </Box>\n    </>;\n}\n\n/**\n * A reservation (A61): what it is, its key and its own fields — the bin\n * kind's, as a bin's are, each a refusal holding Save names ringed (#1525) —\n * the resource it holds with Remove and `Open resource →`, its fill and\n * meter, every arrival checked against the resource — one take of it, asked\n * of the day without the reservation — its `was` line and Revert.\n */\nfunction ReservationDetails({ id, bin, ...part }: Part & { id: string; bin: Bin }) {\n    const { args, styles, words } = part;\n    const { commands, fit, plan, held, context, day, domain, shown, drag } = args;\n    const nouns = words.nouns;\n    const editable = commands.canEdit();\n    const committed = held?.bins.get(id);\n    const refused = refusalsOf(args, id);\n    const form = args.value.bin.kind.inspector.type === \"some\" ? args.value.bin.kind.inspector.value : undefined;\n    const status = reservationStatus(bin, committed, domain.sameBin, nouns);\n    const resource = partsOf(bin)[0]?.key;\n    const at = resource === undefined ? undefined : resourcesAt(args, [resource])[0];\n    const name = resource === undefined ? undefined : context.resources.get(resource)?.label ?? resource;\n    // What the resource takes (A61, ruled 17 Oct): one question, of the day without the reservation it would fill.\n    const of = args.without(id);\n    const ask = useMemo(() => resource === undefined ? undefined : variant(\"take\", { resource }), [resource]);\n    const { ask: asking } = fit;\n    useEffect(() => { if (ask !== undefined) asking(ask, of); }, [ask, of, asking]);\n    const answer = ask === undefined ? undefined : fit.answer(ask, of);\n    const books = bookOptions({ plan, held, context, day, shown: shown.arrivals, words });\n    // A committed bin the drafts removed is checked as its own drag into the reservation is: its own question, asked once the pane has rendered.\n    const target: Target = { kind: \"lane\", lane: bin.lane, at: bin.at, card: id };\n    const { verdict } = drag;\n    useEffect(() => { for (const o of books) if (o.grip.kind === \"removed\") verdict(o.grip, target); },\n        // The bookings and the drafts are the questions.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [plan, id]);\n    const lineOf = (o: BookOption) => {\n        if (resource === undefined) return { line: o.line, warn: o.warn, enabled: true };\n        if (o.grip.kind === \"arrival\") return verdictLine(answer?.arrivals.get(o.grip.arrival));\n        const v = drag.peek(o.grip, target);\n        return v.pending ? verdictLine(undefined) : v.allowed ? { line: v.reason ?? o.line, warn: false, enabled: true } : { line: `doesn’t fit · ${v.reason ?? v.caption}`, warn: true, enabled: false };\n    };\n    const run = (o: BookOption) => o.grip.kind === \"arrival\" ? commands.fillWith(id, o.grip.arrival) : commands.restoreInto(o.grip.bin, id);\n    const draft = committed !== undefined && !domain.sameBin(committed, bin);\n    // Its key, printed, as a bin's is among its facts: what Search Records finds it by (#1398) — a new one's a draft, as its every field is.\n    const keyLabel = args.m.binKey();\n    const keySpecs = useMemo(() => Fields.specs(RESERVATION_FIELDS, { key: Fields.readonly({ label: keyLabel }) }), [keyLabel]);\n    const keyValue = useMemo(() => ({ key: id }), [id]);\n    const keyBaseline = useMemo(() => committed === undefined ? {} : { key: id }, [committed, id]);\n    return <>\n        <ScheduleInspectorHead styles={styles} kind={{ name: committed === undefined ? `New ${one(nouns.reservation)}` : `${nouns.reserved} slot`, icon: \"bookmark\" }}\n            title={`${words.lane(bin.lane)} · ${timeText(bin.at)}`} when={name === undefined ? `${nouns.reserved} · no ${one(nouns.arrival)} yet` : `${nouns.reserved} on ${name} · no ${one(nouns.arrival)} yet`}\n            status={statusOf(status)} pending={status.pending} home />\n        {/* Its refusals holding Save (#1525), over what it holds. */}\n        <Banners styles={styles} banners={refused.banners} />\n        {/* Off while main is retained (CL8), as a bin's fields are. */}\n        <chakra.fieldset css={[styles.edits, styles.fields]} disabled={args.retained} data-allocation-reservation=\"\">\n            <Box css={styles.sectionHead}>{nouns.reservation.one}</Box>\n            <FieldForm specs={keySpecs} value={keyValue} baseline={keyBaseline} onChange={NO_EDIT} readOnly />\n            {/* Its own fields, as a bin's: a field a refusal names is set right here. */}\n            {form !== undefined ? <CustomBin {...part} id={id} bin={bin} form={form} />\n                : <RowFields {...part} id={id} bin={bin} committed={committed} refused={refused.fields} breaches={refused.breaches} />}\n        </chakra.fieldset>\n        <Box css={styles.section} data-allocation-assigned=\"\">\n            <Box css={styles.sectionRow}>\n                <Box css={styles.sectionHead}>Assigned to</Box>\n                <Box as=\"span\" css={styles.sectionRow}>\n                    {editable && <Button size=\"xs\" variant=\"outline\" disabled={args.retained} title={`Remove the ${one(nouns.reservation)} · the slot becomes free`} onClick={() => commands.remove(id)}><FontAwesomeIcon icon={faXmark} />Remove</Button>}\n                    {resource !== undefined && <chakra.button type=\"button\" css={styles.link} onClick={() => args.inspect({ type: \"resource\", key: resource })}>Open {one(nouns.resource)}<FontAwesomeIcon icon={faArrowRight} /></chakra.button>}\n                </Box>\n            </Box>\n            {at !== undefined && <>\n                <Box css={styles.sectionRow}>\n                    <Box as=\"span\" css={styles.resourceName}>{at.row.label}</Box>\n                    <Box as=\"span\" css={styles.fill} data-tone={at.line.over ? \"danger\" : undefined} data-allocation-fill=\"\">{words.load(at.load.fill, at.row)}</Box>\n                </Box>\n                <Meter styles={styles} at={at} tone={at.line.over ? \"danger\" : \"brand\"} />\n                <Box css={styles.line}>{groupLine(at.row, words)}</Box>\n            </>}\n        </Box>\n        <Box css={styles.section} data-allocation-book=\"\">\n            <Box css={styles.sectionHead}>Book {a(nouns.arrival)}</Box>\n            {books.length === 0 ? <Box css={styles.absent}>no {other(nouns.arrival)} to book</Box>\n                : books.map(o => { const said = lineOf(o); return <ListOption key={o.key} styles={styles} name={o.code} quantity={o.quantity} line={said.line} warn={said.warn} testid={o.key}>\n                    {editable ? <Button size=\"xs\" variant=\"outline\" disabled={!said.enabled || args.retained} onClick={() => run(o)}>Book</Button> : <span />}\n                </ListOption>; })}\n            {name !== undefined && <Box css={styles.line}>Each {one(nouns.arrival)} is checked against {name}. Book is off when it doesn’t fit.</Box>}\n        </Box>\n        {draft && <Box css={styles.was} data-allocation-was=\"\">\n            <span>{wasLine(committed, context, words)}</span>\n            {editable && <Button size=\"sm\" variant=\"outline\" disabled={args.retained} onClick={() => commands.revert(id)}><FontAwesomeIcon icon={faRotateLeft} />Revert</Button>}\n        </Box>}\n    </>;\n}\n\n/** A resource (A62): its status, its group and range, its banners, today's fill and meter, the jobs before and after the day and the hold, its bins today and the hint. */\nfunction ResourceDetails({ resource, ...part }: Part & { resource: string }) {\n    const { args, styles, words, horizonEnd } = part;\n    const nouns = words.nouns;\n    const at = resourcesAt(args, [resource])[0];\n    if (at === undefined) return null;\n    const status = resourceStatus(at.load, at.line);\n    const banners = bannersOf({ issues: args.issues, resources: [at], day: args.day, words });\n    const idle = Number(at.load.bins) === 0;\n    const hint = at.load.state.type === \"busy\" && idle ? `Busy ${other(nouns.resource)} take no load until their current job is released.`\n        : args.layout === \"table\" ? `Choose it with the ${one(nouns.resource)} chevron on a row, or drag it from the Library onto a row.`\n            : `Drag ${a(nouns.bin)}’s connector or ${a(nouns.arrival)} onto this row to load it.`;\n    return <>\n        <ScheduleInspectorHead styles={styles} kind={{ name: nouns.resource.one, icon: \"cube\" }} title={at.row.label} when={groupLine(at.row, words)} status={statusOf(status)} home />\n        <Banners styles={styles} banners={banners} />\n        <Box css={styles.section} data-allocation-fill-section=\"\">\n            <Box css={styles.sectionRow}>\n                <Box css={styles.sectionHead}>Today's fill</Box>\n                <Box as=\"span\" css={styles.fill} data-tone={at.line.over ? \"danger\" : undefined} data-allocation-fill=\"\">{words.load(at.load.fill, at.row)}</Box>\n            </Box>\n            <Meter styles={styles} at={at} tone={at.line.over ? \"danger\" : \"brand\"} />\n            <Facts styles={styles} at={at} words={words} day={args.day} horizonEnd={horizonEnd} />\n        </Box>\n        <Box css={styles.section} data-allocation-bins=\"\">\n            <Box css={styles.sectionHead}>{nouns.bin.other} on it today</Box>\n            <Mates {...part} resource={resource} current={undefined} />\n            <Box css={styles.line}>{hint}</Box>\n        </Box>\n    </>;\n}\n\n/** Nothing selected (A63): the day, the board's title and size, its four counts, the narrowing's note and three hints. */\nfunction Summary({ args, styles, words }: Part) {\n    const { value, plan, held, domain, loads, issues, shown } = args;\n    const nouns = words.nouns;\n    const stats = summaryStats({ plan, held, sameBin: domain.sameBin, loads, issues, refused: args.refusals.length, words });\n    const count = (keys: option<Set<string>>, total: number) => keys.type === \"none\" ? total : keys.value.size;\n    const note = narrowingNote([\n        { shown: count(shown.lanes, value.lanes.length), total: value.lanes.length, noun: nouns.lane },\n        { shown: count(shown.resources, value.resources.length), total: value.resources.length, noun: nouns.resource },\n        { shown: count(shown.arrivals, value.arrivals.length), total: value.arrivals.length, noun: nouns.arrival },\n    ]);\n    return <>\n        <ScheduleInspectorHead styles={styles} kind={{ name: `Plan · ${dayLong(args.day)}`, icon: \"calendar-day\" }} title={value.settings.title}\n            when={summaryLine(value.lanes.length, value.resources.length, nouns)} home />\n        <Box css={styles.stats} data-allocation-stats=\"\">{stats.map(stat => <Box key={stat.key} css={styles.stat} data-allocation-stat={stat.key === \"bins\" ? \"Bins\" : stat.label}>\n            <Box css={styles.statLabel}>{stat.label}</Box>\n            <Box css={styles.statValue} data-tone={stat.tone}>{stat.value}</Box>\n            <Box css={styles.statSub}>{stat.sub}</Box>\n        </Box>)}</Box>\n        {note !== undefined && <Box css={styles.note} data-allocation-scope=\"\">{note}</Box>}\n        <Box as=\"ul\" css={styles.hints} data-allocation-hints=\"\">{summaryHints(nouns).map(hint => <Box as=\"li\" key={hint} css={styles.hint}>{hint}</Box>)}</Box>\n    </>;\n}\n\n/**\n * Issues (A64): the refusals holding Save first (#1525), each its bin's code\n * and `Show →`, and its field and the app's message; then each group with its\n * mark and its count, each issue its title and `Show →`, its detail and its\n * fix — the resource Chooser of the bin it names, or Find a fit. With none of\n * either, `No issues`: never while Save is held.\n */\nfunction IssuesTab(part: Part) {\n    const { args, styles, words } = part;\n    const groups = issueGroups(args.issues);\n    const refusals = args.refusals;\n    if (groups.length === 0 && refusals.length === 0) {\n        // Until the day's bins and the check's record are read what the check finds is not known (#1595): the list shows it\n        // is loading, and a read that failed is said on the board, once.\n        if (args.read.state === \"pending\") return <Box css={styles.empty} data-allocation-issues-loading=\"\"><PlaceholderShape kind=\"label\" index={0} /></Box>;\n        if (args.read.state === \"failed\") return null;\n        return <Box css={styles.empty} data-allocation-issues-empty=\"\">\n            <Box as=\"span\" css={styles.emptyIcon} aria-hidden=\"true\"><FontAwesomeIcon icon={faCircleCheck} /></Box>\n            <Box css={styles.emptyTitle}>No issues</Box>\n            <Box css={styles.emptyHint}>Every {one(words.nouns.arrival)} sits within its gap and its max.</Box>\n        </Box>;\n    }\n    return <Box css={styles.issues} data-allocation-issues=\"\">\n        {refusals.length > 0 && <Box css={styles.issueGroup} data-allocation-issue-group=\"refusals\">\n            <Box css={styles.issueHead} data-tone=\"warning\">\n                <FontAwesomeIcon icon={faTriangleExclamation} aria-hidden=\"true\" /><span>Not saved yet</span><Box as=\"span\" css={styles.issueCount}>{refusals.length}</Box>\n            </Box>\n            {refusals.map((refusal, i) => <Box key={i} css={styles.issue} data-allocation-issue=\"refusal\">\n                <Box css={styles.issueTop}>\n                    <Box as=\"span\" css={styles.issueTitle} title={refusal.title}>{refusal.title}</Box>\n                    <chakra.button type=\"button\" css={styles.link} onClick={() => args.onRefusal(refusal)}>Show<FontAwesomeIcon icon={faArrowRight} /></chakra.button>\n                </Box>\n                <Box css={styles.issueDetail}>{refusal.text}</Box>\n            </Box>)}\n        </Box>}\n        {groups.map(group => <Box key={group.key} css={styles.issueGroup} data-allocation-issue-group={group.key}>\n            <Box css={styles.issueHead} data-tone={group.tone}>\n                {group.tone === \"danger\" ? <FontAwesomeIcon icon={faCircleExclamation} aria-hidden=\"true\" /> : group.tone === \"warning\" ? <FontAwesomeIcon icon={faTriangleExclamation} aria-hidden=\"true\" /> : null}\n                <span>{group.label}</span><Box as=\"span\" css={styles.issueCount}>{group.issues.length}</Box>\n            </Box>\n            {group.issues.map((issue, i) => <IssueItem key={i} {...part} issue={issue} />)}\n        </Box>)}\n    </Box>;\n}\n\n/** One issue (A64): its title and `Show →`, which selects its bin or resource; its detail; its fix. */\nfunction IssueItem({ args, styles, words, issue }: Part & { issue: Issue }) {\n    const { plan, held, context, commands } = args;\n    const codeOfBin = (bin: string) => { const b = plan.bins.get(bin) ?? held?.bins.get(bin); return b === undefined ? bin : binCode(context, b, words.nouns); };\n    const label = fixLabel(issue, codeOfBin, words.nouns);\n    const show = issue.bin.type === \"some\" ? { type: \"bin\" as const, id: issue.bin.value }\n        : issue.resource.type === \"some\" ? { type: \"resource\" as const, key: issue.resource.value } : undefined;\n    const fix = issue.fix.type === \"some\" ? issue.fix.value : undefined;\n    // The bin a fix opens the resource Chooser of: its own, or the one a resource's issue names to move.\n    const chosen = fix?.type === \"move\" ? fix.value : fix?.type === \"choose\" && issue.bin.type === \"some\" ? issue.bin.value : undefined;\n    const choose = chosen !== undefined && commands.canEdit() && plan.bins.has(chosen) ? () => { args.inspect({ type: \"bin\", id: chosen }); args.setChooser(chosen); } : undefined;\n    // Find a fit (A74): a Partly allocated issue's fix, and a Not linked one's beside its Choose, while the bin has some unallocated.\n    // It edits nothing, so a day that takes no edit offers it too.\n    const named = issue.bin.type === \"some\" ? plan.bins.get(issue.bin.value) : undefined;\n    const find = issue.bin.type === \"some\" && named !== undefined && args.onFind !== undefined && (fix?.type === \"find\" || issue.kind.type === \"unlinked\")\n        && compareFloat(remainderOf(named), 0) > 0 ? issue.bin.value : undefined;\n    return <Box css={styles.issue} data-allocation-issue={issue.kind.type}>\n        <Box css={styles.issueTop}>\n            <Box as=\"span\" css={styles.issueTitle} title={issue.title}>{issue.title}</Box>\n            {show !== undefined && <chakra.button type=\"button\" css={styles.link} onClick={() => args.inspect(show)}>Show<FontAwesomeIcon icon={faArrowRight} /></chakra.button>}\n        </Box>\n        <Box css={styles.issueDetail}>{issue.detail}</Box>\n        {((choose !== undefined && label !== undefined) || find !== undefined) && <Box css={styles.issueActions}>\n            {choose !== undefined && label !== undefined && <Button size=\"xs\" variant=\"outline\" onClick={choose}>{label}</Button>}\n            {find !== undefined && <Button size=\"xs\" variant=\"outline\" data-allocation-find=\"\" onClick={() => args.onFind!(find)}>\n                {args.finding?.(find) === true ? \"Finding…\" : \"Find a fit\"}\n            </Button>}\n        </Box>}\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Library (`Allocation Spec.md` §8, A50–A54, A83, A87, #1330, #1372): the\n * start pane's two shared Library tabs, Arrivals and Resources, each with its\n * count and its search. Arrivals are grouped Overdue · Ready around now ·\n * Removed from plan · Allocated; Resources by the day's states, Free · Loading · Busy today, the\n * shared Library's groups. Each tab follows the rail (A98, A99, #1339): its\n * source's narrowing shows its cards as it shows the board's rows, its count\n * `10 of 33`; every filter is the rail's, and a tab has none of its own. Each card is the shared compact card with the\n * board's figure, its ready line, its look and its tooltip; under the cards the\n * foot's hint, and the picked card's action. A card drags as a board's grip\n * does (§10), and a click picks it (A9, A10). Collapsed, the rail: the open\n * tab's count, the overdue mark, the label. A Find a fit's result (A74,\n * #1332) is the Resources tab's: the resources the app's fit says take the\n * bin's unallocated quantity, among what the rail shows, best first, each\n * card's line the fit's reason, under a chip that clears it — the tab's, not\n * a filter, so the rail and the board stay as they are (A98).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, type KeyboardEvent, type PointerEvent } from \"react\";\nimport { Box, Button } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faInbox } from \"@fortawesome/free-solid-svg-icons\";\nimport { none, some, type SortedMap } from \"@elaraai/east\";\nimport {\n    EastChakraLibrary, useFormatters, type BuilderFrameDock, type LibraryCardExtras, type LibraryGroupMark, type LibraryItemValue, type LibraryNarrowing,\n} from \"@elaraai/east-ui-components\";\nimport { SliceFieldChip, formatDatePattern, narrowedCount } from \"@elaraai/east-ui-components/internal\";\nimport { scheduleLibrary, scheduleLibraryCard } from \"../shared/schedule/library.js\";\nimport { sourceTab, type SourceShown } from \"../shared/schedule/source-tab.js\";\nimport type { AllocationCommands } from \"./actions.js\";\nimport { arrivalCardKey, libraryGripOf, type AllocationDrag, type LibraryGrip, type Target, type Verdict } from \"./drag.js\";\nimport {\n    allocationWords, compareDate, compareFloat, compareString, partsOf, type AllocationStyles, type AllocationValue, type Bin, type Context, type Day, type FitResult,\n    type Load, type ResourceLine, type Selection, type TimeStep,\n} from \"./model.js\";\nimport { a, counted, lower, one, other, type Nouns } from \"./nouns.js\";\n\n/** A day, in milliseconds. */\nconst DAY_MS = 86_400_000;\n\n/** What the viewer picked in the Library (A9, A10): a card to book or reserve, or an arrival whose bins it highlights. */\nexport type Pick = LibraryGrip | { kind: \"bins\"; arrival: string };\n\n/** The Arrivals groups' kinds (A51): what a card's look and the overdue mark go by, whatever the app calls them. */\ntype ArrivalKind = \"overdue\" | \"ready\" | \"removed\" | \"allocated\";\n\n/** A duration's unit as a card writes it: `8 d`. */\nconst UNIT = { minutes: \"min\", hours: \"h\", days: \"d\", weeks: \"wk\", months: \"mo\" } as const;\n\n/**\n * A hold as a card writes it.\n *\n * @param step - The hold\n * @returns `8 d`, `12 h`\n */\nexport function holdText(step: TimeStep): string {\n    return allocationWords().quantity(step.value, UNIT[step.type]);\n}\n\n/** One Arrivals card (A51): what it shows, and what a click or a drag does with it. */\nexport interface ArrivalCard {\n    /** Its key in the Arrivals list: `arrival:LD-2231`, or `removed:3113`. */\n    key: string;\n    /** Its group's words, the board's. */\n    group: string;\n    /** Its group's kind. */\n    kind: ArrivalKind;\n    /** The arrival's key. */\n    arrival: string;\n    /** A card that drags: an arrival to book, or a removed bin to book again. */\n    grip: Extract<LibraryGrip, { kind: \"arrival\" | \"removed\" }> | undefined;\n    /** An Allocated card's bins, in time order. */\n    bins: string[];\n    /** An Allocated card whose every bin is a draft: its × returns it (A51). */\n    draft: boolean;\n    label: string;\n    /** Its quantity: `21 m³`. */\n    figure: string;\n    /** Its meta and its hold: `BRK · R2 · spec MC12 · 8 d`. */\n    sub: string;\n    /** Its ready line, in warn when it is overdue or a bin of it is not linked. */\n    ready: { text: string; tone?: \"warning\" | undefined } | undefined;\n    /** Its tooltip (A83). */\n    tip: string;\n    /** What the search finds it by. */\n    search: string;\n}\n\n/** What the Library's cards are written from. */\nexport interface LibraryWords {\n    nouns: Nouns;\n    layout: \"timeline\" | \"table\";\n    /** A lane's label. */\n    lane: (key: string) => string;\n    /** A quantity with the board's unit, and without. */\n    quantity: (value: number) => string;\n    number: (value: number) => string;\n}\n\n/** A bin's place, as a card says it: `B-1 06:15 on K-203`, `K-203 + 1` for a split bin, `· not linked` with none. */\nfunction whereOf(context: Context, words: LibraryWords, bin: Bin): string {\n    const parts = partsOf(bin);\n    const first = parts[0] === undefined ? undefined : context.resources.get(parts[0].key)?.label ?? parts[0].key;\n    return `${words.lane(bin.lane)} ${formatDatePattern(\"HH:mm\", bin.at)}${first === undefined ? \" · not linked\" : ` on ${first}${parts.length > 1 ? ` + ${parts.length - 1}` : \"\"}`}`;\n}\n\n/** A card's second line: its meta, then its hold. */\nconst subOf = (meta: AllocationValue[\"arrivals\"][number][\"meta\"] | undefined, hold: TimeStep) =>\n    [meta?.type === \"some\" ? meta.value : \"\", holdText(hold)].filter(part => part !== \"\").join(\" · \");\n\n/**\n * The Arrivals cards (A51), in their groups' order: the arrivals still to\n * book — Overdue (due before the plan day), then Ready around now — each with\n * its ready line; the day's committed bins the drafts removed (Removed from\n * plan, `was B-1 06:15 on K-203`); and the arrivals the day books (Allocated,\n * `in B-1 06:15 on K-203` or `2 bins · …`), the draft bookings first, then by\n * their first bin's time.\n *\n * @param args - The day as drafted and as the record holds it, and the words\n * @returns The cards, in order\n */\nexport function arrivalCards(args: { context: Context; day: Date; plan: Day; held: Day | undefined; words: LibraryWords }): ArrivalCard[] {\n    const { context, day, plan, held, words } = args;\n    const { lane, resource } = words.nouns;\n    const onto = words.layout === \"table\" ? \"a free row\" : `${a(lane)} hour or ${a(resource)}`;\n    const booked = new Map<string, string[]>();\n    for (const [id, bin] of plan.bins) {\n        if (bin.arrival.type !== \"some\") continue;\n        booked.set(bin.arrival.value, [...(booked.get(bin.arrival.value) ?? []), id]);\n    }\n    // The day's committed bins with an arrival that the drafts removed.\n    const removed = [...(held?.bins ?? [])].filter(([id, bin]) => bin.arrival.type === \"some\" && !plan.bins.has(id));\n    const removedArrivals = new Set(removed.map(([, bin]) => bin.arrival.type === \"some\" ? bin.arrival.value : \"\"));\n    const overdue = (key: string) => { const due = context.arrivals.get(key)?.due; return due?.type === \"some\" && compareDate(due.value, day) < 0; };\n    const readyOf = (key: string): ArrivalCard[\"ready\"] => {\n        const arrival = context.arrivals.get(key)!;\n        const due = arrival.due.type === \"some\" ? arrival.due.value : undefined;\n        if (due !== undefined && compareDate(due, day) < 0) return { text: `was due ${formatDatePattern(\"ddd D\", due)} · ${lower(words.nouns.groups.overdue)}`, tone: \"warning\" };\n        const window = arrival.window.type === \"some\" ? arrival.window.value : undefined;\n        const parts = [due === undefined ? \"\" : `due ${formatDatePattern(\"ddd D\", due)}`,\n            window === undefined ? \"\" : `window ${formatDatePattern(\"ddd\", window.from)}–${formatDatePattern(\"ddd\", new Date(window.to.getTime() - 1))}`].filter(p => p !== \"\");\n        return parts.length === 0 ? undefined : { text: parts.join(\" · \") };\n    };\n    const toBook = [...context.arrivals.keys()].filter(key => !booked.has(key) && !removedArrivals.has(key));\n    const cards: ArrivalCard[] = [];\n    for (const late of [true, false]) {\n        for (const key of toBook.filter(k => overdue(k) === late)) {\n            const arrival = context.arrivals.get(key)!;\n            cards.push({ key: arrivalCardKey({ kind: \"arrival\", arrival: key }), group: late ? words.nouns.groups.overdue : words.nouns.groups.ready, kind: late ? \"overdue\" : \"ready\", arrival: key, grip: { kind: \"arrival\", arrival: key },\n                bins: [], draft: false, label: arrival.label, figure: words.quantity(arrival.quantity), sub: subOf(arrival.meta, arrival.hold), ready: readyOf(key),\n                tip: `Click to see where ${arrival.label} fits · drag it onto ${onto}`, search: `${arrival.label} ${arrival.meta.type === \"some\" ? arrival.meta.value : \"\"}` });\n        }\n    }\n    for (const [id, bin] of removed) {\n        const key = bin.arrival.type === \"some\" ? bin.arrival.value : \"\";\n        const arrival = context.arrivals.get(key);\n        const label = arrival?.label ?? key;\n        cards.push({ key: arrivalCardKey({ kind: \"removed\", bin: id }), group: words.nouns.groups.removed, kind: \"removed\", arrival: key, grip: { kind: \"removed\", bin: id }, bins: [id], draft: false,\n            label, figure: words.quantity(bin.quantity), sub: subOf(arrival?.meta, bin.hold), ready: { text: `was ${whereOf(context, words, bin)}` },\n            tip: `Click to see where it fits · drag ${label} back onto ${a(lane)} hour or ${a(resource)}`, search: `${label} ${arrival?.meta.type === \"some\" ? arrival.meta.value : \"\"}` });\n    }\n    const allocated = [...booked].map(([key, ids]) => {\n        const bins = ids.map(id => ({ id, bin: plan.bins.get(id)! })).sort((x, y) => compareDate(x.bin.at, y.bin.at) || compareString(x.id, y.id));\n        return { key, bins, draft: bins.every(b => held?.bins.has(b.id) !== true) };\n    }).sort((x, y) => Number(y.draft) - Number(x.draft) || (x.draft ? 0 : compareDate(x.bins[0]!.bin.at, y.bins[0]!.bin.at)) || compareString(x.key, y.key));\n    for (const { key, bins, draft } of allocated) {\n        const arrival = context.arrivals.get(key);\n        const label = arrival?.label ?? key;\n        const where = bins.map(b => whereOf(context, words, b.bin));\n        const unlinked = bins.some(b => b.bin.parts.size === 0);\n        cards.push({ key: arrivalCardKey({ kind: \"arrival\", arrival: key }), group: words.nouns.groups.allocated, kind: \"allocated\", arrival: key, grip: undefined, bins: bins.map(b => b.id), draft,\n            label, figure: words.quantity(bins.reduce((n, b) => n + b.bin.quantity, 0)), sub: subOf(arrival?.meta, bins[0]!.bin.hold),\n            ready: { text: bins.length > 1 ? `${counted(bins.length, words.nouns.bin)} · ${where.join(\" · \")}` : `in ${where[0]}`, ...(unlinked ? { tone: \"warning\" as const } : {}) },\n            tip: draft ? `${words.nouns.groups.allocated} · click to show its ${one(words.nouns.bin)}` : `In the plan · click to highlight its ${bins.length > 1 ? counted(bins.length, words.nouns.bin) : one(words.nouns.bin)}`,\n            search: `${label} ${arrival?.meta.type === \"some\" ? arrival.meta.value : \"\"}` });\n    }\n    return cards;\n}\n\n/** One Resources card (A52). */\nexport interface ResourceCard {\n    key: string;\n    group: string;\n    label: string;\n    /** What it takes: `20–40 m³`. */\n    figure: string;\n    /** Its meta, or its group. */\n    sub: string;\n    /** Its line today, over max in danger, held into its next job in warn. */\n    line: { text: string; tone?: \"warning\" | \"danger\" | undefined };\n    tip: string;\n    search: string;\n}\n\n/**\n * The Resources cards (A52), grouped by the day's states — free, then loading\n * (by their first bin's time), then busy — each its line: `31 m³ today · to Tue\n * 18` with `· 4 m³ over` or `· 1 d into next job`, `busy until Fri 14`, `free ·\n * next job Wed 19`, `free · no next job`.\n *\n * @param args - Every resource, its load and its line, the drafts, and the words\n * @returns The cards, in order\n */\nexport function resourceCards(args: {\n    resources: AllocationValue[\"resources\"]; plan: Day; loads: SortedMap<string, Load>; lines: ReadonlyMap<string, ResourceLine>; words: LibraryWords;\n}): ResourceCard[] {\n    const { resources, plan, loads, lines, words } = args;\n    const { lane, resource: noun, bin: binNoun, groups } = words.nouns;\n    const onto = words.layout === \"table\" ? `a row’s ${one(noun)} cell` : `${a(binNoun)} or an empty ${one(lane)} hour`;\n    // Each resource's first bin today: the loading ones' order.\n    const first = new Map<string, Date>();\n    for (const [, bin] of plan.bins) {\n        for (const key of bin.parts.keys()) { const was = first.get(key); if (was === undefined || compareDate(bin.at, was) < 0) first.set(key, bin.at); }\n    }\n    const cardOf = (resource: AllocationValue[\"resources\"][number]): ResourceCard => {\n        const load = loads.get(resource.key)!, line = lines.get(resource.key)!;\n        const hold = load.hold.type === \"some\" ? load.hold.value : undefined;\n        let text: string, tone: ResourceCard[\"line\"][\"tone\"];\n        if (load.state.type === \"loading\") {\n            const over = line.over ? ` · ${words.quantity(Math.round(load.fill - resource.max))} over` : \"\";\n            const into = !line.over && line.overlap && line.next.type === \"some\" && hold !== undefined\n                ? ` · ${words.number((hold.to.getTime() - line.next.value.start.getTime()) / DAY_MS)} d into next job` : \"\";\n            text = `${words.quantity(Math.round(load.fill))} today${hold === undefined ? \"\" : ` · to ${formatDatePattern(\"ddd D\", new Date(hold.to.getTime() - 1))}`}${over}${into}`;\n            tone = line.over ? \"danger\" : line.overlap ? \"warning\" : undefined;\n        } else if (load.state.type === \"busy\") text = line.text;\n        else text = line.next.type === \"some\" ? `free · next job ${formatDatePattern(\"ddd D\", line.next.value.start)}` : \"free · no next job\";\n        const meta = resource.meta.type === \"some\" ? resource.meta.value : resource.group.type === \"some\" ? resource.group.value : \"\";\n        return { key: resource.key, group: groups[load.state.type], label: resource.label, figure: `${words.number(resource.min)}–${words.quantity(resource.max)}`,\n            sub: meta, line: { text, ...(tone === undefined ? {} : { tone }) }, tip: `Click to highlight its ${other(binNoun)} · drag ${resource.label} onto ${onto}`,\n            search: `${resource.label} ${meta} ${resource.group.type === \"some\" ? resource.group.value : \"\"}` };\n    };\n    const state = (r: AllocationValue[\"resources\"][number]) => loads.get(r.key)!.state.type;\n    const loading = resources.filter(r => state(r) === \"loading\")\n        .map((r, i) => ({ r, i })).sort((x, y) => compareDate(first.get(x.r.key) ?? new Date(0), first.get(y.r.key) ?? new Date(0)) || x.i - y.i).map(x => x.r);\n    return [...resources.filter(r => state(r) === \"free\"), ...loading, ...resources.filter(r => state(r) === \"busy\")].map(cardOf);\n}\n\n/** A Find a fit's result in the Resources tab (A74): its bin, the chip's words, the fit's answer, and whether that answer is on its way. */\nexport interface ResourceFind {\n    /** The bin it finds a fit for. */\n    bin: string;\n    /** What it finds a fit for, as the chip says it: `LD-2210 · 4 m³`. */\n    label: string;\n    /** The fit's answer for the drafts as they are, which the tab shows; `undefined` while it is on its way, or failed. */\n    shown: FitResult | undefined;\n    /** Whether that answer is on its way: the tab is busy, showing what the rail shows, and no verdict (F2). */\n    busy: boolean;\n}\n\n/**\n * The resources a fit's answer says fit, best first — its scores, ties kept in\n * the tab's order: the fit ranks, never the board (F4).\n *\n * @param cards - The cards the rail shows, in the tab's order\n * @param answer - The fit's answer\n * @returns The cards that fit, best first\n */\nexport function foundCards<C extends { key: string }>(cards: readonly C[], answer: FitResult): C[] {\n    const scored = cards.flatMap(card => { const verdict = answer.resources.get(card.key); return verdict?.type === \"fits\" ? [{ card, score: verdict.value.score }] : []; });\n    return scored.sort((a, b) => compareFloat(b.score, a.score)).map(fit => fit.card);\n}\n\n/** A found card's line (A74): the fit's reason, its warning after it in the warning's tone; its tooltip the whole, which a narrow card cuts. */\nfunction reasonOf(answer: FitResult, card: ResourceCard): LibraryCardExtras | undefined {\n    const verdict = answer.resources.get(card.key);\n    if (verdict?.type !== \"fits\") return undefined;\n    const { why, warn } = verdict.value;\n    const text = warn.type === \"some\" ? `${why} · ${warn.value}` : why;\n    return { title: text, figure: card.figure, note: warn.type === \"some\" ? { text, tone: \"warning\" } : { text } };\n}\n\n/** The Library's args. */\nexport interface LibraryArgs {\n    value: AllocationValue;\n    context: Context;\n    day: Date;\n    plan: Day;\n    held: Day | undefined;\n    loads: SortedMap<string, Load>;\n    lines: ReadonlyMap<string, ResourceLine>;\n    styles: AllocationStyles;\n    layout: \"timeline\" | \"table\";\n    narrow: boolean;\n    drag: AllocationDrag;\n    commands: AllocationCommands;\n    selection: Selection | undefined;\n    pick: Pick | undefined;\n    /** A click on a card to book (A9): it picks it, or unpicks it. */\n    onArrival: (grip: Extract<LibraryGrip, { kind: \"arrival\" | \"removed\" }>) => void;\n    /** A click on a resource's card (A9): it picks it for the selected free slot, or selects it. */\n    onResource: (resource: string) => void;\n    /** A click on an Allocated card (A10): its first bin selected, every bin of it highlighted. */\n    onAllocated: (arrival: string, bins: readonly string[]) => void;\n    /** The picked card's action ran its verdict: what it refused, if anything. */\n    onVerdict: (verdict: Verdict) => void;\n    /** The open tab, the host's: Find a fit opens Resources (A74). */\n    tab: string;\n    onTab: (tab: string) => void;\n    /** What the rail shows of each tab's source: the arrivals' and the resources'. */\n    shown: { arrivals: SourceShown; resources: SourceShown };\n    /** A Find a fit's result, shown in the Resources tab until its chip clears it (A74). */\n    find?: ResourceFind | undefined;\n    onClearFind?: (() => void) | undefined;\n    /** Whether the Arrivals tab's count flashes (#1409): the latest run booked an arrival or returned one, and its highlight is on. */\n    arrivalsFlash?: boolean | undefined;\n}\n\n/** The picked card's action (A53, A87): its note, and its button. */\ninterface Action { note: string; tone?: \"warning\" | undefined; button?: { label: string; disabled: boolean; target: Target; grip: LibraryGrip } | undefined }\n\n/**\n * The start pane (see the module docs).\n *\n * @param args - See {@link LibraryArgs}\n * @returns The pane, or `undefined` when the board has no Library\n */\nexport function useAllocationLibrary(args: LibraryArgs): BuilderFrameDock | undefined {\n    const { value, context, day, plan, held, loads, lines, styles, layout, narrow, drag, commands, selection, pick, nouns } = { ...args, nouns: args.value.labels };\n    const board = allocationWords();\n    const unit = context.unit;\n    const words = useMemo((): LibraryWords => ({\n        nouns, layout, lane: key => value.lanes.find(l => l.key === key)?.label ?? key, quantity: v => board.quantity(v, unit), number: v => board.quantity(v, \"\"),\n    }), [nouns, layout, value.lanes, board, unit]);\n    const arrivals = useMemo(() => arrivalCards({ context, day, plan, held, words }), [context, day, plan, held, words]);\n    const resources = useMemo(() => resourceCards({ resources: value.resources, plan, loads, lines, words }), [value.resources, plan, loads, lines, words]);\n    // What each tab's source shows (A98, A99): an arrival's cards in every group while its source shows it, a resource's while its source does;\n    // each tab's count, what it says when its source empties it, with that source's Clear filters, and its busy pane.\n    const { shown } = args;\n    const format = useFormatters();\n    const arrivalTab = useMemo(() => sourceTab({ cards: arrivals, keyOf: card => card.arrival, shown: shown.arrivals, noun: other(nouns.arrival), words: format }),\n        [arrivals, shown.arrivals, nouns.arrival, format]);\n    const resourceTab = useMemo(() => sourceTab({ cards: resources, keyOf: card => card.key, shown: shown.resources, noun: other(nouns.resource), words: format }),\n        [resources, shown.resources, nouns.resource, format]);\n    const shownArrivals = arrivalTab.cards, shownResources = resourceTab.cards;\n    // A Find a fit's result (A74): the fits among what the rail shows, best first. Until its answer for the drafts as they are\n    // lands, the tab shows what the rail shows, busy, and no verdict (F2).\n    const find = args.find, answer = find?.shown;\n    const found = useMemo(() => answer === undefined ? undefined : foundCards(shownResources, answer), [answer, shownResources]);\n    const listedResources = found ?? shownResources;\n    const editable = commands.canEdit();\n    const draggable = drag.enabled && !narrow;\n    const selectedArrival = selection?.type === \"bin\" ? plan.bins.get(selection.id)?.arrival : undefined;\n\n    // The cards: the shared face, with the board's figure, ready line, look, tooltip and × beside it.\n    const arrivalItems = useMemo(() => shownArrivals.map((card): LibraryItemValue => {\n        const placed = card.grip !== undefined\n            ? pick !== undefined && pick.kind === card.grip.kind && arrivalCardKey(card.grip) === (pick.kind === \"arrival\" || pick.kind === \"removed\" ? arrivalCardKey(pick) : \"\")\n            : (pick?.kind === \"bins\" && pick.arrival === card.arrival) || (selectedArrival?.type === \"some\" && selectedArrival.value === card.arrival);\n        return scheduleLibraryCard({ key: card.key, label: card.label, sublabel: card.sub === \"\" ? none : some(card.sub), icon: none, status: none, trailing: none,\n            draggable: draggable && card.grip !== undefined, filtered: false, placed, search: some(card.search), groups: new Map([[\"group\", card.group]]) });\n    }), [shownArrivals, pick, selectedArrival, draggable]);\n    const resourceItems = useMemo(() => listedResources.map((card): LibraryItemValue => scheduleLibraryCard({\n        key: card.key, label: card.label, sublabel: card.sub === \"\" ? none : some(card.sub), icon: none, status: none, trailing: none, draggable, filtered: false,\n        placed: (selection?.type === \"resource\" && selection.key === card.key) || (pick?.kind === \"resource\" && pick.resource === card.key),\n        search: some(card.search), groups: new Map([[\"group\", card.group]]),\n    })), [listedResources, selection, pick, draggable]);\n    const unbook = commands.unbook;\n    const arrivalExtras = useMemo(() => {\n        const byKey = new Map(arrivals.map((card): [string, LibraryCardExtras] => [card.key, {\n            title: card.tip, figure: card.figure, ...(card.ready === undefined ? {} : { note: card.ready }),\n            ...(card.kind === \"removed\" ? { look: \"dashed\" as const } : card.kind === \"allocated\" ? { look: \"sunken\" as const } : {}),\n            ...(card.draft && editable ? { remove: { label: `Return ${card.label} to the list`, onRemove: () => unbook(card.arrival) } } : {}),\n        }]));\n        return (item: LibraryItemValue) => byKey.get(item.key);\n    }, [arrivals, editable, unbook]);\n    // A found card's line is the fit's reason (A74); every other card's, its line today.\n    const resourceExtras = useMemo(() => {\n        const byKey = new Map(resources.map((card): [string, LibraryCardExtras] => [card.key,\n            (answer === undefined ? undefined : reasonOf(answer, card)) ?? { title: card.tip, figure: card.figure, note: card.line }]));\n        return (item: LibraryItemValue) => byKey.get(item.key);\n    }, [resources, answer]);\n    const overdueMark = useCallback((label: string): LibraryGroupMark | undefined => label === nouns.groups.overdue ? { icon: \"triangle-exclamation\", label, tone: \"warning\" } : undefined, [nouns.groups.overdue]);\n\n    // A card's click (A9, A10).\n    const { onArrival, onResource, onAllocated } = args;\n    const arrivalClick = useCallback((key: string): null => {\n        const card = arrivals.find(c => c.key === key);\n        if (card === undefined) return null;\n        if (card.grip !== undefined) onArrival(card.grip); else onAllocated(card.arrival, card.bins);\n        return null;\n    }, [arrivals, onArrival, onAllocated]);\n    const resourceClick = useCallback((key: string): null => { onResource(key); return null; }, [onResource]);\n\n    // A card's pointer-down or its pick-up key arms its grip: the fit is asked before the drag needs it (A23).\n    const arm = (library: string) => (event: PointerEvent | KeyboardEvent) => {\n        if (!draggable || (\"key\" in event && event.key !== \" \" && event.key !== \"Enter\")) return;\n        const key = (event.target as Element).closest?.(\"[data-library-item]\")?.getAttribute(\"data-library-item\");\n        const grip = key === null || key === undefined ? undefined : libraryGripOf(drag.libraries, { library, key });\n        if (grip !== undefined) drag.arm(grip);\n    };\n\n    // The picked card's action (A53, A87): its question asked, its verdict peeked while the pane renders.\n    const action = useMemo((): Action | undefined => {\n        if (!editable) return undefined;\n        const slot = (laneKey: string, at: Date) => `${words.lane(laneKey)} ${formatDatePattern(\"HH:mm\", at)}`;\n        if (pick?.kind === \"arrival\" || pick?.kind === \"removed\") {\n            const card = arrivals.find(c => c.grip !== undefined && arrivalCardKey(c.grip) === arrivalCardKey(pick));\n            if (card === undefined) return undefined;\n            if (selection?.type === \"slot\") {\n                const at = new Date(selection.at);\n                return { note: `${card.label} · ${card.figure} · then choose its ${one(nouns.resource)}`,\n                    button: { label: `Book into ${slot(selection.lane, at)}`, disabled: false, grip: pick, target: { kind: \"lane\", lane: selection.lane, at, card: undefined } } };\n            }\n            const reservation = selection?.type === \"bin\" ? plan.bins.get(selection.id) : undefined;\n            if (selection?.type === \"bin\" && reservation !== undefined && reservation.arrival.type === \"none\") {\n                const target: Target = { kind: \"lane\", lane: reservation.lane, at: reservation.at, card: selection.id };\n                const resource = [...reservation.parts.keys()][0];\n                const name = resource === undefined ? \"\" : context.resources.get(resource)?.label ?? resource;\n                const verdict = drag.peek(pick, target);\n                const button = { label: `Book into ${slot(reservation.lane, reservation.at)}`, grip: pick, target };\n                if (verdict.pending) return { note: \"checking fits…\", button: { ...button, disabled: true } };\n                if (!verdict.allowed) return { note: `Doesn’t fit ${name}: ${verdict.reason ?? verdict.caption}`, tone: \"warning\", button: { ...button, disabled: true } };\n                return { note: resource === undefined ? `${card.label} · ${card.figure}` : `${nouns.reserved} on ${name}${verdict.reason === undefined ? \"\" : ` · ${verdict.reason}`}`, button: { ...button, disabled: false } };\n            }\n            return { note: layout === \"table\" ? `Click a highlighted ${one(nouns.arrival)} cell to book ${card.label} there, or select a free slot first.`\n                : `Click a free ${one(nouns.lane)} hour or a ranked ${one(nouns.resource)} to book ${card.label} there, or select a free slot first.` };\n        }\n        if (pick?.kind === \"resource\" && selection?.type === \"slot\") {\n            const at = new Date(selection.at);\n            const target: Target = { kind: \"lane\", lane: selection.lane, at, card: undefined };\n            const name = context.resources.get(pick.resource)?.label ?? pick.resource;\n            const verdict = drag.peek(pick, target);\n            const button = { label: `Reserve ${slot(selection.lane, at)} on ${name}`, grip: pick, target };\n            if (verdict.pending) return { note: \"checking fits…\", button: { ...button, disabled: true } };\n            if (!verdict.allowed) return { note: `Can’t: ${verdict.reason ?? verdict.caption}`, tone: \"warning\", button: { ...button, disabled: true } };\n            return { note: verdict.reason ?? \"\", button: { ...button, disabled: false } };\n        }\n        return undefined;\n        // The verdict stands for the pick, the selection, these drafts and the fit's answers.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [editable, pick, selection, arrivals, plan, layout, nouns, words, context, drag.peek]);\n    // Its question, asked once the pane has rendered, and again when the drafts change or the arrivals and resources it reads (F1).\n    const asking = action?.button;\n    const { verdict } = drag;\n    useEffect(() => { if (asking !== undefined) verdict(asking.grip, asking.target); },\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [asking?.label, asking?.grip, plan, context]);\n    const { onVerdict } = args;\n    const runAction = () => { if (asking === undefined || asking.disabled) return; onVerdict(drag.verdict(asking.grip, asking.target)); };\n\n    if (value.library.length === 0) return undefined;\n    // The foot's hint, the tab's and the layout's (A53).\n    const hint = (tab: \"arrivals\" | \"resources\") => narrow ? `Select ${a(nouns.arrival)}, then Book`\n        : tab === \"arrivals\" ? (layout === \"table\" ? `Drag onto a row’s ${one(nouns.arrival)} cell` : `Drag onto ${a(nouns.lane)} hour or ${a(nouns.resource)}`)\n            : (layout === \"table\" ? `Drag onto a row’s ${one(nouns.resource)} cell` : `Drag onto ${a(nouns.bin)} or an empty ${one(nouns.lane)} hour`);\n    // A tab its source reads again holds its cards retained (#1398, CL8): its action waits until it lands.\n    const feet = (tab: \"arrivals\" | \"resources\") => <>\n        <Box css={[styles.paneFoot, styles.paneHint]} data-allocation-library-hint=\"\">{hint(tab)}</Box>\n        {action !== undefined && <Box css={[styles.paneFoot, styles.paneAction]} data-allocation-library-action=\"\">\n            <Box as=\"span\" css={styles.paneHint} data-tone={action.tone}>{action.note}</Box>\n            {action.button !== undefined && <Button size=\"xs\" variant=\"outline\" onClick={runAction}\n                disabled={action.button.disabled || (tab === \"arrivals\" ? arrivalTab : resourceTab).pane[\"aria-disabled\"] === true}>\n                <FontAwesomeIcon icon={faInbox} />{action.button.label}\n            </Button>}\n        </Box>}\n    </>;\n    const tabs = value.library.map(tab => {\n        if (tab.type === \"arrivals\") {\n            const library = scheduleLibrary({ id: drag.libraries.arrivals, items: arrivalItems, groupOptions: [{ key: \"group\", label: \"Group\" }],\n                noun: some({ singular: one(nouns.arrival), plural: other(nouns.arrival) }), onCardClick: some(arrivalClick) }, true);\n            return { key: \"arrivals\", label: nouns.arrival.other, count: arrivalTab.count, flash: args.arrivalsFlash === true,\n                body: <Box css={styles.pane} data-allocation-library=\"arrivals\" {...arrivalTab.pane}\n                onPointerDownCapture={arm(drag.libraries.arrivals)} onKeyDownCapture={arm(drag.libraries.arrivals)}>\n                <EastChakraLibrary value={library} storageKey={drag.libraries.arrivals} extras={arrivalExtras} groupMark={overdueMark}\n                    search={`Find ${a(nouns.arrival)} or site`} empty={arrivalTab.empty} narrowing={arrivalTab.narrowing}\n                    noMatch={{ title: `No ${other(nouns.arrival)} match`, description: `Clear the search to see all ${shownArrivals.length} ${other(nouns.arrival)}.` }} />\n                {feet(\"arrivals\")}\n            </Box> };\n        }\n        const library = scheduleLibrary({ id: drag.libraries.resources, items: resourceItems, groupOptions: [{ key: \"group\", label: \"Group\" }],\n            noun: some({ singular: one(nouns.resource), plural: other(nouns.resource) }), onCardClick: some(resourceClick) }, true);\n        // A find counts its fits of every resource; with none that fit, it says so — its chip, not Clear filters, clears it — unless\n        // the rail left the tab nothing, which the rail's Clear filters clears.\n        const count = found === undefined ? resourceTab.count : narrowedCount(format, found.length, resources.length, true);\n        const narrowing: LibraryNarrowing | undefined = found === undefined || resourceTab.narrowing?.emptied === true ? resourceTab.narrowing\n            : { empty: { title: `No ${one(nouns.resource)} has a gap that fits`, description: `Clear the find to see the ${other(nouns.resource)} the rail shows.` }, emptied: found.length === 0 };\n        const pane = find?.busy === true ? { ...resourceTab.pane, \"aria-busy\": true as const } : resourceTab.pane;\n        return { key: \"resources\", label: nouns.resource.other, count,\n            body: <Box css={styles.pane} data-allocation-library=\"resources\" {...pane}\n            onPointerDownCapture={arm(drag.libraries.resources)} onKeyDownCapture={arm(drag.libraries.resources)}>\n            {/* Pressed, the chip clears the find: its name says so, its face what the find is for (A74). */}\n            {find !== undefined && args.onClearFind !== undefined && <Box css={styles.paneFoot} data-allocation-find=\"\">\n                <SliceFieldChip label={`Find · ${find.label}`} aria-label={`Clear find · ${find.label}`} active removeLabel=\"Clear find\" onRemove={args.onClearFind} onClick={args.onClearFind} />\n            </Box>}\n            {/* Grouped by the day's states; every filter is the rail's (ruled 18 Oct): the tab has its search, and no filter of its own. */}\n            <EastChakraLibrary value={library} storageKey={drag.libraries.resources} extras={resourceExtras} search={`Find ${a(nouns.resource)} or group`} empty={resourceTab.empty}\n                narrowing={narrowing}\n                noMatch={{ title: `No ${other(nouns.resource)} match`, description: `Clear the search to see all ${listedResources.length} ${other(nouns.resource)}.` }} />\n            {feet(\"resources\")}\n        </Box> };\n    });\n    const open = args.tab === \"resources\" && tabs.some(t => t.key === \"resources\") ? \"resources\" : tabs[0]!.key;\n    const late = shownArrivals.some(card => card.kind === \"overdue\");\n    return {\n        label: \"Library\", icon: \"layer-group\", size: \"264px\", tabs, tab: open, onTabChange: args.onTab, persist: \"local\",\n        badge: open === \"resources\" ? listedResources.length : shownArrivals.length,\n        ...(open === \"arrivals\" && late ? { mark: { icon: \"triangle-exclamation\", label: `${nouns.groups.overdue} ${one(nouns.arrival)}`, tone: \"warning\" as const } } : {}),\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Allocation's message table: the editing session's words — the history\n * item's and its banners', every editable collection's (`EditingMessages`) —\n * and the board's own that are no noun of the app's: what Search Records\n * searches, the bins' keys (#1398), what its line says of a bin the rail's\n * narrowing hides (the shared hidden pick's words, `HiddenWords`), and what a\n * bin's Details call its key. The app's nouns — a lane, an arrival, a\n * resource, the quantity — are the payload's (`nouns.ts`). English is the\n * default; the frame hands it to its parts as its words' `m`.\n *\n * @packageDocumentation\n */\n\nimport { editingMessages, type EditingMessages, type Formatters } from \"@elaraai/east-ui-components\";\nimport { hiddenByText, type HiddenWords } from \"../shared/schedule/words.js\";\n\n/** The Allocation's message table. */\nexport interface AllocationMessages extends EditingMessages, HiddenWords {\n    /** Search Records' box's placeholder, its icon's accessible name and the head of the popover it opens: what it searches — `Search bins by key`. */\n    keySearch: (p: { bins: string }) => string;\n    /**\n     * What the box says when no bin's key matches what is typed, and where a key is learnt: in a bin's Details, given an\n     * inspector; else that keys are case-sensitive.\n     */\n    keySearchNoMatches: (p: { inspector: boolean; bin: string }) => string;\n    /** The label of a bin's key among its facts in Details — `Key`: what Search Records finds it by. */\n    binKey: () => string;\n}\n\n/** The English table — the default. */\nexport const allocationMessages: AllocationMessages = {\n    ...editingMessages,\n    keySearch: ({ bins }) => `Search ${bins} by key`,\n    keySearchNoMatches: ({ inspector, bin }) => (inspector ? `No ${bin}'s key matches. Select a ${bin} to see its key in Details.` : `No ${bin}'s key matches. Keys are case-sensitive.`),\n    hiddenByFilters: () => \"hidden by the filters\",\n    hiddenBy: ({ filters, also }) => hiddenByText(filters, also),\n    binKey: () => \"Key\",\n};\n\n/** The words the board speaks: its message table, and its locale's formatters. */\nexport interface AllocationWords extends Formatters {\n    /** The message table in effect. */\n    m: AllocationMessages;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Optimise in the Allocation (#1409, #1420; `Optimise Spec.md` §5.1, §9.5,\n * R26): the day in view as the run's request — the day's bins by key, the\n * app's own rows as the session holds them, drafts in place; every arrival as\n * the board reads them; and the board's context — and the result landed on\n * the day's bins as one edit: the diff by key, recorded as one step\n * (`ScheduleEditing.record`, origin `optimise`), and what the landing draws\n * kept until Apply — each bin's operation and its provenance, the ghosts of\n * the bins a run moved or removed where they stood, which lanes the latest\n * run changed, whether an arrival left the Arrivals tab or came back to it,\n * and the links the runs added or changed with the kilns they land on, which\n * the Timeline draws outlined in the Elara tone and glows for the highlight.\n * While a run is out the commands are locked (R2): every gesture refused,\n * the day's drafts kept.\n *\n * @packageDocumentation\n */\n\nimport { SortedMap, StringType, type EastType } from \"@elaraai/east\";\nimport { AllocationOptimiseRequestTypeFor, AllocationOptimiseResultTypeFor } from \"@elaraai/e3-ui/internal\";\nimport { optimiseMessages } from \"@elaraai/east-ui-components\";\nimport { formatDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport { diffOptimiseRows, optimiseIdOf } from \"../shared/func/optimise-diff.js\";\nimport type { OptimiseCounts } from \"../shared/func/use-optimise.js\";\nimport type { AllocationCommands } from \"./actions.js\";\nimport type { AllocationEditing } from \"./editing.js\";\nimport { binCode } from \"./inspector-model.js\";\nimport { compareDate, compareFloat, compareString, partsOf, type AllocationDomain, type AllocationValue, type ArrivalRow, type Bin, type Context, type Day } from \"./model.js\";\n\n/** The day's bins by key, as the request and the result carry them: the app's own rows. */\nexport type AllocationOptimiseRows = SortedMap<string, unknown>;\n\n/** The run's request: the day, the run's number, the day's bins by key, every arrival, and the board's context. */\nexport interface AllocationOptimiseRequest {\n    readonly day: Date;\n    readonly run: bigint;\n    readonly bins: AllocationOptimiseRows;\n    readonly arrivals: readonly ArrivalRow[];\n    readonly context: Context;\n}\n\n/** The run's answer: the day's bins by key, complete. */\nexport interface AllocationOptimiseResult {\n    readonly bins: AllocationOptimiseRows;\n}\n\n/** One operation a run left on a bin, until Apply (R17): what it did, the run that made it, and what its hover says. */\nexport interface AllocationBinOp {\n    readonly op: \"add\" | \"chg\";\n    /** The run's number, formatted. */\n    readonly run: string;\n    /** `Added by Elara · run #7`, or `Was B-1 06:15 on K-203 · Elara run #7`. */\n    readonly provenance: string;\n}\n\n/** Where a bin stood before a run removed it (`del`) or moved it (`from`): its ghost, for the highlight (R15). */\nexport interface AllocationGhost {\n    readonly id: string;\n    readonly op: \"del\" | \"from\";\n    readonly run: string;\n    /** The lane slot it stood in. */\n    readonly lane: string;\n    readonly at: Date;\n    /** Its code — `LD-2231`, or `Reserved`. */\n    readonly label: string;\n    /** Where it stood, in words: `B-1 06:15 on K-203`. */\n    readonly where: string;\n    /** `Removed by Elara · run #7`, or `Moved by Elara · run #7`. */\n    readonly title: string;\n}\n\n/**\n * What the runs left on the Allocation's bins, until Apply (R17): each bin's\n * operation, a later run's over an earlier's on the same bin; the ghosts of\n * the bins the runs moved or removed, where they stood; the lanes the latest\n * run changed; and whether it booked an arrival or returned one.\n */\nexport interface AllocationOptimised {\n    readonly ops: ReadonlyMap<string, AllocationBinOp>;\n    readonly ghosts: readonly AllocationGhost[];\n    /** The lanes whose bins the latest run added, moved or removed: their heads' figures flash. */\n    readonly lanes: ReadonlySet<string>;\n    /** Whether the latest run booked an arrival or returned one to Arrivals: the Arrivals tab's count flashes. */\n    readonly arrivalsChanged: boolean;\n    /**\n     * The links the runs added or changed, by bin — each kiln whose part is new or differs from before the run, an\n     * earlier run's kept while the bin still has it — while still the runs' drafts: the Timeline draws them for the\n     * highlight, outlined in the Elara tone, never filled, so a result's many links stay readable.\n     */\n    readonly links: ReadonlyMap<string, ReadonlySet<string>>;\n    /** Their kilns: each one's load takes the landing and the highlight with the cards. */\n    readonly resources: ReadonlySet<string>;\n}\n\n/**\n * The request and result types over the app's bin row type: what the bound\n * optimiser is called with, as the tag held it to.\n *\n * @param rowType - The bin kind's row type\n * @returns The request and result East types\n */\nexport function allocationOptimiseTypes(rowType: EastType): { request: EastType; result: EastType } {\n    return { request: AllocationOptimiseRequestTypeFor(rowType), result: AllocationOptimiseResultTypeFor(rowType) };\n}\n\n/**\n * The run's request (R1, R26, O3, O5): the day in view, the run's number, the\n * day's bins by key as the session holds them — the base with every\n * unapplied draft in place, every row whatever the rail shows — every arrival\n * as the board reads them, and the board's context.\n *\n * @param day - The plan day\n * @param plan - The day as drafted: each bin's row is the app's own\n * @param arrivals - Every arrival\n * @param context - The board's configuration, every arrival and every resource\n * @param run - The run's number\n * @returns The request\n */\nexport function allocationOptimiseRequest(day: Date, plan: Day, arrivals: readonly ArrivalRow[], context: Context, run: number): AllocationOptimiseRequest {\n    const bins: AllocationOptimiseRows = new SortedMap([], compareString);\n    for (const [id, bin] of plan.bins) bins.set(id, bin.row);\n    return { day, run: BigInt(run), bins, arrivals, context };\n}\n\n/**\n * Where a bin stands, as its provenance and its ghost say it: `B-1 06:15 on\n * K-203`, `B-2 10:35 · not linked`.\n *\n * @param value - The payload: the lanes' labels\n * @param context - Every resource, by key\n * @param bin - The bin\n * @returns The words\n */\nexport function allocationPlaceWords(value: AllocationValue, context: Context, bin: Bin): string {\n    const lane = value.lanes.find(l => l.key === bin.lane)?.label ?? bin.lane;\n    const first = partsOf(bin)[0];\n    const on = first === undefined ? \" · not linked\" : ` on ${context.resources.get(first.key)?.label ?? first.key}`;\n    return `${lane} ${formatDatePattern(\"HH:mm\", bin.at)}${on}`;\n}\n\n/** What a landing is made over. */\nexport interface AllocationLanding {\n    readonly value: AllocationValue;\n    readonly domain: AllocationDomain;\n    /** The editing the step is recorded in. */\n    readonly editing: AllocationEditing;\n    readonly request: AllocationOptimiseRequest;\n    readonly result: AllocationOptimiseResult;\n    /** The step's label — `Elara run #7`. */\n    readonly label: string;\n    /** The run's number, formatted, for the provenance. */\n    readonly runText: string;\n    /** The day as drafted before the run: where a ghost goes, and what the provenance says a bin was. */\n    readonly plan: Day;\n    readonly context: Context;\n    /** What earlier runs left on the bins, still the session's drafts. */\n    readonly before: AllocationOptimised | undefined;\n}\n\n/**\n * The result landed (R7, R8, R10, §12): diffed against the request by key\n * and recorded as one step of the history, origin `optimise`. A bin the\n * result adds is an add — booked, its arrival leaves the Arrivals tab; one it\n * changes is a change, with a ghost at its old lane slot when it moved; one\n * it drops is a remove, its ghost where it stood, its arrival back in\n * Arrivals (§9.5). A result that changes nothing records nothing and leaves\n * what earlier runs left as it is (R10); one that does lays its operations,\n * its ghosts and its links over theirs.\n *\n * @param args - What the landing is made over\n * @returns What the run counted, and what the runs have left on the bins — unchanged by a run that changed nothing; `undefined` for a result the session would not take\n */\nexport function landAllocationOptimise(args: AllocationLanding): { counts: OptimiseCounts; optimised: AllocationOptimised | undefined } | undefined {\n    const { value, domain, editing, request, result, label, runText, plan, context, before } = args;\n    const kind = value.bin.kind.key;\n    const diff = diffOptimiseRows(kind, domain.rowType, optimiseIdOf<string>(StringType), request.bins, result.bins);\n    if (diff.changes.length === 0) return { counts: diff.counts, optimised: undefined };\n    if (!editing.schedule.record(diff.changes, \"optimise\", label)) return undefined;\n    // This run's operations over the earlier runs': a bin it touched again is its, and an earlier ghost of it gives way.\n    const touched = new Set([...diff.ops.keys()].map(key => key.slice(kind.length + 1)));\n    const ops = new Map<string, AllocationBinOp>(before?.ops ?? []);\n    const links = new Map<string, ReadonlySet<string>>(before?.links ?? []);\n    const ghosts = (before?.ghosts ?? []).filter(ghost => !touched.has(ghost.id));\n    const lanes = new Set<string>();\n    let arrivalsChanged = false;\n    for (const [key, op] of diff.ops) {\n        const id = key.slice(kind.length + 1);\n        const was = plan.bins.get(id);\n        if (op.op === \"del\") {\n            ops.delete(id);\n            links.delete(id);\n            if (was === undefined) continue;\n            lanes.add(was.lane);\n            if (was.arrival.type === \"some\") arrivalsChanged = true;\n            ghosts.push({ id, op: \"del\", run: runText, lane: was.lane, at: was.at, label: binCode(context, was, value.labels), where: allocationPlaceWords(value, context, was),\n                title: optimiseMessages.ghostRemoved({ run: runText }) });\n            continue;\n        }\n        // The row's roles, as the kind reads them: where the bin is now.\n        const roles = value.bin.read(domain.encodeRow(op.row));\n        lanes.add(roles.lane);\n        if (op.op === \"add\" || was === undefined) {\n            ops.set(id, { op: \"add\", run: runText, provenance: optimiseMessages.entryAdded({ run: runText }) });\n            if (roles.arrival.type === \"some\") arrivalsChanged = true;\n            if (roles.parts.size > 0) links.set(id, new Set(roles.parts.keys()));\n            continue;\n        }\n        ops.set(id, { op: \"chg\", run: runText, provenance: optimiseMessages.entryChanged({ previous: allocationPlaceWords(value, context, was), run: runText }) });\n        lanes.add(was.lane);\n        // The parts this run added or changed, with an earlier run's the bin still has: the links the highlight draws.\n        const parts = new Set([...(links.get(id) ?? [])].filter(kiln => roles.parts.has(kiln)));\n        for (const [kiln, quantity] of roles.parts) {\n            const had = was.parts.get(kiln);\n            if (had === undefined || compareFloat(had, quantity) !== 0) parts.add(kiln);\n        }\n        if (parts.size > 0) links.set(id, parts); else links.delete(id);\n        // Booked or unbooked: the arrival leaves or returns.\n        if (was.arrival.type !== roles.arrival.type || (was.arrival.type === \"some\" && roles.arrival.type === \"some\" && was.arrival.value !== roles.arrival.value)) arrivalsChanged = true;\n        // Moved to another lane slot: a ghost where it stood.\n        if (was.lane !== roles.lane || compareDate(was.at, roles.at) !== 0) {\n            ghosts.push({ id, op: \"from\", run: runText, lane: was.lane, at: was.at, label: binCode(context, was, value.labels), where: allocationPlaceWords(value, context, was),\n                title: optimiseMessages.ghostMoved({ run: runText }) });\n        }\n    }\n    const resources = new Set<string>();\n    for (const kilns of links.values()) for (const kiln of kilns) resources.add(kiln);\n    return { counts: diff.counts, optimised: { ops, ghosts, lanes, arrivalsChanged, links, resources } };\n}\n\n/**\n * The commands while a run is out (R2): the day takes no gesture — every\n * command refused, Publish off — the session the views read kept, so they\n * keep drawing their drafts while nothing is written.\n *\n * @param commands - The commands\n * @returns The commands, locked\n */\nexport function lockAllocationCommands(commands: AllocationCommands): AllocationCommands {\n    const refused = () => false;\n    const nothing = () => undefined;\n    return {\n        ...commands, available: false, canEdit: () => false,\n        remove: nothing, revert: nothing, unlink: nothing, unbook: nothing, publish: nothing,\n        setQuantity: refused, row: refused, field: refused, split: refused, setPart: refused, move: refused, link: refused, fill: refused,\n        book: refused, replace: refused, fillWith: refused, reserve: refused, restore: refused, restoreInto: refused,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The links' look's measures (`Plan links.html`, #1258), one set for both of\n * the surfaces that draw links: the SVG layer (`layer.tsx`) the Plan's and the\n * Allocation's links draw on, and the Canvas2D painter (`canvas.ts`) the\n * Schematic's links and nets draw through (#1403) — so the three builders'\n * links draw alike. The routing (`geometry.ts`) turns its corners and lays its\n * heads by them too. Their colours and their caption's font are the theme's\n * `linkRibbons` part's, never these. Pure: no React, no DOM.\n *\n * @packageDocumentation\n */\n\n/** The paper either side of a link's ink: its casing (px). */\nexport const LINK_CASING = 1;\n\n/** How far beyond a link's stroke its hit area reaches, each side (px). */\nexport const LINK_HIT_REACH = 5;\n\n/** A head's length along the flow (px). */\nexport const LINK_HEAD_LEN = 8;\n\n/**\n * How far a head reaches either side of the flow: it is max(8, 2 × weight)\n * wide.\n *\n * @param weight - The link's weight: its stroke's width\n * @returns Half the head's width, in px\n */\nexport function linkHeadHalf(weight: number): number {\n    return Math.max(LINK_HEAD_LEN, 2 * weight) / 2;\n}\n\n/** The radius every link turns its corners at, before its clamp to half of each run beside it (px). */\nexport const LINK_CORNER = 8;\n\n/** A caption's knockout: its height (px). */\nexport const LINK_KNOCKOUT_H = 12;\n\n/** The paper either side of a caption's text on its knockout (px). */\nexport const LINK_KNOCKOUT_PAD = 4;\n\n/** How far above a caption's baseline its knockout starts (px). */\nexport const LINK_KNOCKOUT_RISE = 9.5;\n\n/** How far below the point a caption is centred on its baseline sits: a 10px label's middle (px). */\nexport const LINK_CAPTION_DROP = 3;\n\n/** How far outside an end a lit link joins its ring is drawn: the middle of its 1px line (px). */\nexport const LINK_HALO_OUT = 4.5;\n\n/** A ring's corner round an end with corners: an end's own, four out (px). */\nexport const LINK_HALO_R = 7.5;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Pure links-ribbon routing (R1) — no DOM, no React, so every geometric\n * permutation is testable offline (`geometry.test.ts` holds the case table)\n * and the rendered cases can be reviewed as a contact sheet. Shared by Plan's\n * links and the Allocation's (#1321): each lays its ends out from its own\n * model and routes them here.\n *\n * The grammar is `Plan links.html`'s (#1258), its case table this module's\n * test table. The routing rule is SEMANTIC, not geometric: a link always\n * EXITS the source run's END (right edge, heading right) and ENTERS the\n * destination run's BEGINNING (left edge, heading right) — flow direction is\n * the same in every case, whatever the interval arrangement. Paths are built\n * from straight lines and circular arcs ONLY, stroked at the link's WEIGHT —\n * the quantity's, never the bar's, each end centred on its own bar — with a\n * plain triangle head 8 long and max(8, 2 × weight) wide:\n *\n * - Destination starts at least head + 2 run-outs + 4 (34px) after the\n *   source ends (causal, a real gap): the metro-S — straight, corner, riser,\n *   corner.\n * - Anything else (abutting, overlapping, containing, backward): the\n *   LOOPBACK — exit right, turn toward the destination row, travel back\n *   left along the lane halfway between the bars, turn into the\n *   destination's start.\n * - NOTHING of a link leaves the plot (ruled by the user over the spec's\n *   gutter turn): not into the gutter, the canvas's first column, nor past the\n *   plot's end. A destination too near the plot's start for a level approach\n *   is entered from above or below at its start — the head DROPS onto its\n *   edge — and a source too near the plot's end for a level exit LIFTS off its\n *   edge at its end; a lane between them runs between the facing edges.\n * - Same-row links never loop: a forward feed is a straight centered band;\n *   an overlapping/backward one renders as an exit stub out of A's end plus\n *   a separate arrival into B's start (the runoff grammar — the connection is\n *   implied, never drawn through the bars).\n * - A link may cross a bar on its way. It is drawn over it, cased in the\n *   paper (the renderer draws the casing).\n * - An endpoint OUT OF VIEW (#818) sits at the viewport edge its row lies\n *   beyond, and the ribbon meets that edge vertically with a STUB — an\n *   arrowhead pointing out of view, toward the row. A destination out of view\n *   turns off the source toward it where the riser would stand (the metro-S's\n *   riser for a forward link, the loopback's first turn otherwise), so the\n *   ribbon does not jump sideways as the row scrolls into view; a source out\n *   of view enters down (or up) the destination's riser. Both out of view, on\n *   opposite sides, is one vertical band across the view with a stub at each\n *   end. Both out of view on the SAME side draws nothing — the caller never\n *   routes it.\n *\n * Direction changes turn at a small FIXED corner radius (8, clamped to half\n * the drop); straight segments carry the remaining distance —\n * rounded-orthogonal routing, so far-apart rows get straight risers with\n * tight corners rather than giant sweeping lobes. Both ends keep a\n * HORIZONTAL RUN-OUT of 11, longer than the head: the link always leaves A\n * straight before its first turn, and every head arrives along a straight\n * approach — never directly off a corner.\n *\n * Its caption sits on the riser at mid-height (an S, an out-of-view stub, the\n * band across the view), on the lane (a loopback), or 6 above the source bar\n * (one row).\n */\n\nimport { LINK_CAPTION_DROP, LINK_CORNER, LINK_HEAD_LEN } from \"./look.js\";\n\n/** The viewport edge an out-of-view endpoint lies beyond. */\nexport type RibbonOff = \"above\" | \"below\";\n\n/** Width of the dashed slot an end past the window lands in (px). */\nexport const RIBBON_SLOT_W = 40;\n\n/** The dashed slot at a window edge an off-window end lands in — as tall as\n *  its element draws, {@link RIBBON_SLOT_W} wide, open toward the edge. */\nexport interface RibbonEdgeSlot {\n    /** The plot edge it opens onto. */\n    x: number;\n    y: number;\n    h: number;\n    side: \"left\" | \"right\";\n}\n\n/** One ribbon endpoint — the run bar's rect, in the rows' own px. */\nexport interface RibbonEnd {\n    leftX: number;\n    rightX: number;\n    top: number;\n    bottom: number;\n    /**\n     * Set when the endpoint's row is out of view: the rect sits at that\n     * viewport edge (its `top` ON the top edge, or its `bottom` ON the bottom\n     * edge) and the ribbon meets the edge with a stub pointing toward the row.\n     */\n    off?: RibbonOff | undefined;\n}\n\n/**\n * Which of the grammar's figures a link draws: the metro-`s`, the `loop`back,\n * a one-row `feed` or `runoff`, a `stub` toward an end out of view, or the\n * `band` across the view between two.\n */\nexport type RibbonRoute = \"s\" | \"loop\" | \"feed\" | \"runoff\" | \"stub\" | \"band\";\n\n/** A routed link: centerline `stroke` (stroked at `width`, its weight), the\n *  arrowheads, where its caption's text is centred, and the figure it draws. */\nexport interface RibbonPath {\n    route: RibbonRoute;\n    stroke: string;\n    /** The arrowhead at the ribbon's end: into the destination's start, or —\n     *  the destination out of view — the stub pointing toward it. */\n    head: string;\n    /** The stub where the ribbon enters the view — an arrowhead pointing\n     *  toward the out-of-view source; empty while the source is in view. */\n    tail: string;\n    width: number;\n    lx: number;\n    ly: number;\n    anchor: \"start\" | \"middle\" | \"end\";\n}\n\n/** A head's length along the flow (px): the links' look's (`look.ts`). */\nconst HEAD_LEN = LINK_HEAD_LEN;\n/** The straight every link keeps out of its source's end and into its\n *  destination's start (px). */\nconst RUN_OUT = 11;\n/** Corner radius at every direction change (clamped to the available drop): the links' look's. */\nconst CORNER_R = LINK_CORNER;\n/** The corner every link turns at, before its clamp (px): what a line a host draws beside the links turns at too. */\nexport const RIBBON_CORNER = CORNER_R;\n/**\n * How far before its destination's start a forward link's riser stands with a\n * full corner: the head, the run-out into it and the corner (27px, `Allocation\n * Spec.md` §11) — where a line a host draws toward the same rows rises too.\n */\nexport const RIBBON_RISER = HEAD_LEN + RUN_OUT + CORNER_R;\n/** Below this gap past the head and two run-outs the metro-S degenerates —\n *  route the loopback. */\nconst MIN_S_GAP = 4;\n/** A caption's text sits this far below the point it is centred on (px) — a\n *  10px label's middle, the links' look's. */\nconst CAPTION_DROP = LINK_CAPTION_DROP;\n/** The paper a link's casing lays either side of its ink, and the half px a\n *  stroke is drawn on — what keeps a line or a head at the plot's edge inside\n *  it (px). */\nconst EDGE_CLEAR = 1.5;\n\n/** The plot's two edges, which nothing of a link crosses — not into the\n *  gutter, the canvas's first column, nor past the plot's end. */\nexport interface RibbonBounds {\n    left: number;\n    right: number;\n}\n\n/** No edges: a route as the grammar draws it, wherever that reaches. */\nconst UNBOUNDED: RibbonBounds = { left: -Infinity, right: Infinity };\n\nconst f = (n: number) => n.toFixed(1);\n\n/**\n * A rounded orthogonal polyline as path data: straight runs between the\n * points, each corner turned at radius `r`, clamped to half of either run\n * beside it. Consecutive points share an x or a y; a point that turns\n * nothing is passed straight through.\n *\n * @param points - The polyline's points, in order\n * @param r - The corner radius, before its clamp\n * @returns The path data\n */\nexport function rounded(points: readonly (readonly [number, number])[], r: number): string {\n    const [x0, y0] = points[0]!;\n    let d = `M ${f(x0)} ${f(y0)}`;\n    for (let i = 1; i < points.length - 1; i++) {\n        const [px, py] = points[i - 1]!;\n        const [x, y] = points[i]!;\n        const [nx, ny] = points[i + 1]!;\n        const [ix, iy] = [Math.sign(x - px), Math.sign(y - py)];\n        const [ox, oy] = [Math.sign(nx - x), Math.sign(ny - y)];\n        const turn = ix * oy - iy * ox;\n        if (turn === 0) {\n            d += ` L ${f(x)} ${f(y)}`;\n            continue;\n        }\n        const rad = Math.min(r, (Math.abs(x - px) + Math.abs(y - py)) / 2, (Math.abs(nx - x) + Math.abs(ny - y)) / 2);\n        // A turn clockwise on the page sweeps positive.\n        d += ` L ${f(x - ix * rad)} ${f(y - iy * rad)} A ${f(rad)} ${f(rad)} 0 0 ${turn > 0 ? 1 : 0} ${f(x + ox * rad)} ${f(y + oy * rad)}`;\n    }\n    const [lx, ly] = points[points.length - 1]!;\n    return `${d} L ${f(lx)} ${f(ly)}`;\n}\n\n/** A triangle arrowhead: its base centred on `(bx, by)` across the flow, its\n *  tip at `(tx, ty)`, `half` px either side of the flow line. */\nfunction arrow(bx: number, by: number, tx: number, ty: number, half: number): string {\n    // The base runs perpendicular to the flow — vertical flow, a horizontal base.\n    return bx === tx\n        ? `M ${f(bx - half)} ${f(by)} L ${f(tx)} ${f(ty)} L ${f(bx + half)} ${f(by)} Z`\n        : `M ${f(bx)} ${f(by - half)} L ${f(tx)} ${f(ty)} L ${f(bx)} ${f(by + half)} Z`;\n}\n\n/**\n * Route one link from the source run's END to the destination run's\n * BEGINNING — see the module doc for the case grammar.\n *\n * @param from - The source run's rect (out of view: at the edge it lies beyond)\n * @param to - The destination run's rect (the same)\n * @param weight - The link's weight: its stroke's width (`ribbonWeight`)\n * @param bounds - The plot's edges, which nothing of the link crosses; left out, none\n * @returns The link's paths and caption anchor\n */\nexport function routeRibbon(from: RibbonEnd, to: RibbonEnd, weight: number, bounds: RibbonBounds = UNBOUNDED): RibbonPath {\n    // The weight is the quantity's, never the bar's: the same link draws as\n    // wide out of a 20px bar, a compact 16px one and a 12px rollup.\n    const width = weight;\n    // The head is 8 long and max(8, 2 × weight) wide.\n    const halfH = Math.max(HEAD_LEN, 2 * weight) / 2;\n    const headLen = HEAD_LEN;\n    // Both ends keep a horizontal run-out LONGER than the head: the exit\n    // straight out of A, and the approach straight into the head.\n    const runOut = RUN_OUT;\n    const ySrc = (from.top + from.bottom) / 2;\n    const y2 = (to.top + to.bottom) / 2;\n    const x1 = from.rightX;\n    const x2 = to.leftX;\n    const neckX = x2 - headLen;\n    // Corners must complete left of the approach — the head never sits\n    // directly on a turn.\n    const approachX = neckX - runOut;\n    const forward = approachX - x1 >= runOut + MIN_S_GAP;\n    const arrival = arrow(neckX, y2, x2, y2, halfH);\n    // ── The plot's edges ──\n    // A drop lands in from the destination's start by the head's half width\n    // and the casing, never past the element's middle; a lift leaves in from\n    // the source's end by the line's.\n    const startX = Math.max(to.leftX, bounds.left);\n    const dropX = Math.min(startX + halfH + EDGE_CLEAR, Math.max(startX, (startX + Math.min(to.rightX, bounds.right)) / 2));\n    const endX = Math.min(from.rightX, bounds.right);\n    const liftX = Math.max(endX - width / 2 - EDGE_CLEAR, Math.min(endX, (Math.max(from.leftX, bounds.left) + endX) / 2));\n    const edges = { bounds, dropX, liftX };\n\n    if (from.off !== undefined || to.off !== undefined) {\n        return routeOutOfView(from, to, { width, halfH, headLen, runOut, ySrc, y2, x1, neckX, approachX, forward, arrival, edges });\n    }\n\n    const sameRowLink = Math.abs(ySrc - y2) < 0.5;\n    const dy = y2 - ySrc;\n    const head = arrival;\n\n    if (sameRowLink) {\n        // ── Same-row: never a loop ──\n        if (x2 - x1 >= headLen + 2) {\n            // A straight centered feed — the run's output flows directly\n            // into the next run.\n            return {\n                route: \"feed\",\n                stroke: `M ${f(x1)} ${f(ySrc)} L ${f(neckX)} ${f(y2)}`,\n                head, tail: \"\", width,\n                lx: (x1 + neckX) / 2, ly: from.top - 6, anchor: \"middle\",\n            };\n        }\n        // Overlapping/backward on one row: the runoff grammar — a squared\n        // stub exits A's end; the arrival (approach + head) marks B's start.\n        // The connection is implied, never drawn through the bars; the stubs\n        // are cased where they sit on one. At the plot's end the exit stub\n        // lifts off A's top at its end; at its start the arrival drops onto\n        // B's top at its start.\n        const lift = x1 + runOut > bounds.right;\n        const drop = x2 - headLen - runOut < bounds.left;\n        return {\n            route: \"runoff\",\n            stroke: (lift\n                ? `M ${f(liftX)} ${f(from.top)} L ${f(liftX)} ${f(from.top - runOut)}`\n                : `M ${f(x1)} ${f(ySrc)} L ${f(x1 + runOut)} ${f(ySrc)}`)\n                + (drop\n                    ? ` M ${f(dropX)} ${f(to.top - headLen - runOut)} L ${f(dropX)} ${f(to.top - headLen)}`\n                    : ` M ${f(x2 - headLen - runOut)} ${f(y2)} L ${f(neckX)} ${f(y2)}`),\n            head: drop ? arrow(dropX, to.top - headLen, dropX, to.top, halfH) : head,\n            tail: \"\", width,\n            lx: (x1 + x2) / 2, ly: from.top - 6, anchor: \"middle\",\n        };\n    }\n\n    if (forward) {\n        // ── The metro-S (causal, destination starts after the source ends) ──\n        const rad = Math.min(CORNER_R, (approachX - x1 - runOut) / 2, Math.abs(dy) / 2);\n        const sgn = dy > 0 ? 1 : -1;\n        const xs = approachX - 2 * rad;\n        const sweep1 = sgn === 1 ? 1 : 0;\n        return {\n            route: \"s\",\n            stroke: `M ${f(x1)} ${f(ySrc)}`\n                + ` L ${f(xs)} ${f(ySrc)}`\n                + ` A ${f(rad)} ${f(rad)} 0 0 ${sweep1} ${f(xs + rad)} ${f(ySrc + sgn * rad)}`\n                + (Math.abs(dy) - 2 * rad > 0.5 ? ` L ${f(xs + rad)} ${f(y2 - sgn * rad)}` : \"\")\n                + ` A ${f(rad)} ${f(rad)} 0 0 ${1 - sweep1} ${f(approachX)} ${f(y2)}`\n                + ` L ${f(neckX)} ${f(y2)}`,\n            head, tail: \"\", width,\n            // The caption on the riser, at mid-height.\n            lx: xs + rad, ly: (ySrc + y2) / 2 + CAPTION_DROP, anchor: \"middle\",\n        };\n    }\n\n    // ── The loopback (abutting / overlapping / containing / backward) ──\n    // Exit right, turn toward the destination row, travel LEFT along the\n    // midpoint lane, turn into the destination's start. Each U-turn is\n    // corner → vertical straight → corner at CORNER_R, degenerating to a\n    // semicircle when the rows are adjacent.\n    const yLane = (ySrc + y2) / 2;\n    // The exit-side turn (toward the lane) and the entry-side turn (lane\n    // into B) — each clamps its corner to half its own drop.\n    const sgnA = yLane > ySrc ? 1 : -1;\n    const sgnB = y2 >= yLane ? 1 : -1;\n    const dropA = Math.abs(yLane - ySrc);\n    const dropB = Math.abs(y2 - yLane);\n    const rA = Math.min(CORNER_R, dropA / 2);\n    const rB = Math.min(CORNER_R, dropB / 2);\n    const xC = approachX;\n    const xR = exitTurnX(x1, runOut, approachX);\n    // At the plot's edges: an exit with no room to turn before the plot's end\n    // lifts off the source's edge at its end; an entry with no room to turn\n    // after the plot's start drops onto the destination's edge at its start.\n    // The lane then runs between the two facing edges — the head's base where\n    // it drops.\n    const lift = xR + CORNER_R + width / 2 + EDGE_CLEAR > bounds.right;\n    const drop = xC - CORNER_R - width / 2 - EDGE_CLEAR < bounds.left;\n    if (lift || drop) {\n        const sgn = y2 > ySrc ? 1 : -1;\n        const srcFacing = sgn > 0 ? from.bottom : from.top;\n        const dstFacing = sgn > 0 ? to.top : to.bottom;\n        const headBase = dstFacing - sgn * headLen;\n        const lane = (srcFacing + (drop ? headBase : dstFacing)) / 2;\n        const exitR = Math.min(CORNER_R, Math.abs(lane - ySrc) / 2);\n        const entryR = Math.min(CORNER_R, Math.abs(y2 - lane) / 2);\n        const laneFrom = lift ? liftX : xR + exitR;\n        const laneTo = drop ? dropX : xC - entryR;\n        const points: (readonly [number, number])[] = [\n            ...(lift ? [[liftX, srcFacing], [liftX, lane]] as const : [[x1, ySrc], [xR + exitR, ySrc], [xR + exitR, lane]] as const),\n            ...(drop ? [[dropX, lane], [dropX, headBase]] as const : [[xC - entryR, lane], [xC - entryR, y2], [neckX, y2]] as const),\n        ];\n        return {\n            route: \"loop\",\n            stroke: rounded(points, CORNER_R),\n            head: drop ? arrow(dropX, headBase, dropX, dstFacing, halfH) : head,\n            tail: \"\", width,\n            // The caption on the lane, at its middle.\n            lx: (laneFrom + laneTo) / 2, ly: lane + CAPTION_DROP, anchor: \"middle\",\n        };\n    }\n    const s1 = sgnA > 0 ? 1 : 0;\n    const s2 = sgnB > 0 ? 0 : 1;\n    return {\n        route: \"loop\",\n        stroke: `M ${f(x1)} ${f(ySrc)}`\n            + ` L ${f(xR)} ${f(ySrc)}`\n            + ` A ${f(rA)} ${f(rA)} 0 0 ${s1} ${f(xR + rA)} ${f(ySrc + sgnA * rA)}`\n            + (dropA - 2 * rA > 0.5 ? ` L ${f(xR + rA)} ${f(yLane - sgnA * rA)}` : \"\")\n            + ` A ${f(rA)} ${f(rA)} 0 0 ${s1} ${f(xR)} ${f(yLane)}`\n            + ` L ${f(xC)} ${f(yLane)}`\n            + ` A ${f(rB)} ${f(rB)} 0 0 ${s2} ${f(xC - rB)} ${f(yLane + sgnB * rB)}`\n            + (dropB - 2 * rB > 0.5 ? ` L ${f(xC - rB)} ${f(y2 - sgnB * rB)}` : \"\")\n            + ` A ${f(rB)} ${f(rB)} 0 0 ${s2} ${f(xC)} ${f(y2)}`\n            + ` L ${f(neckX)} ${f(y2)}`,\n        head, tail: \"\", width,\n        // The caption on the lane, at its middle — on its paper knockout.\n        lx: (xR + xC) / 2,\n        ly: yLane + CAPTION_DROP,\n        anchor: \"middle\",\n    };\n}\n\n/** Where the loopback's exit-side turn begins — past the run-out, and clear\n *  of the approach it runs back to. */\nfunction exitTurnX(x1: number, runOut: number, approachX: number): number {\n    return Math.max(x1 + runOut, approachX + 2);\n}\n\n/** The shared measures {@link routeRibbon} hands its out-of-view cases. */\ninterface RouteMeasures {\n    width: number;\n    halfH: number;\n    headLen: number;\n    runOut: number;\n    ySrc: number;\n    y2: number;\n    x1: number;\n    neckX: number;\n    approachX: number;\n    forward: boolean;\n    arrival: string;\n    /** The plot's edges, and where a drop lands and a lift leaves. */\n    edges: { bounds: RibbonBounds; dropX: number; liftX: number };\n}\n\n/** The out-of-view cases — see the module doc. */\nfunction routeOutOfView(from: RibbonEnd, to: RibbonEnd, m: RouteMeasures): RibbonPath {\n    const { width, halfH, headLen, runOut, ySrc, y2, x1, neckX, approachX, forward, arrival, edges } = m;\n    const { bounds, dropX, liftX } = edges;\n    // A vertical with a head on it keeps the head inside the plot.\n    const inside = (x: number) => Math.max(bounds.left + halfH + EDGE_CLEAR, Math.min(bounds.right - halfH - EDGE_CLEAR, x));\n    // The edge an out-of-view end sits on, and which way is \"toward its row\".\n    const edgeOf = (end: RibbonEnd): number => (end.off === \"above\" ? end.top : end.bottom);\n    const outward = (end: RibbonEnd): number => (end.off === \"above\" ? -1 : 1);\n\n    if (from.off !== undefined && to.off !== undefined) {\n        // ── Both out of view, on opposite sides: ONE vertical band across the\n        // view, a stub at each edge. It stands where the destination's riser\n        // would (forward) or the loopback's first turn would (otherwise),\n        // inside the plot.\n        const xV = inside(forward ? approachX - CORNER_R : exitTurnX(x1, runOut, approachX) + CORNER_R);\n        const yA = edgeOf(from);\n        const yB = edgeOf(to);\n        const sgn = yB > yA ? 1 : -1;\n        const yStart = yA + sgn * headLen;\n        const yEnd = yB - sgn * headLen;\n        return {\n            route: \"band\",\n            stroke: `M ${f(xV)} ${f(yStart)} L ${f(xV)} ${f(yEnd)}`,\n            head: arrow(xV, yEnd, xV, yB, halfH),\n            tail: arrow(xV, yStart, xV, yA, halfH),\n            width,\n            // The caption on the band, at mid-height.\n            lx: xV, ly: (yStart + yEnd) / 2 + CAPTION_DROP, anchor: \"middle\",\n        };\n    }\n\n    if (to.off !== undefined) {\n        // ── The destination out of view: exit the source's end, turn toward\n        // the edge where the riser would stand, and run out of view.\n        const sgn = outward(to);\n        const edge = edgeOf(to);\n        const drop = Math.abs(edge - ySrc);\n        // A forward turn must still leave the source its full run-out (the\n        // metro-S's own clamp); every turn fits the drop before the stub.\n        const room = forward ? (approachX - x1 - runOut) / 2 : CORNER_R;\n        const rad = Math.min(CORNER_R, room, Math.max(0, (drop - headLen) / 2));\n        const xV = forward ? approachX - rad : exitTurnX(x1, runOut, approachX) + rad;\n        if (xV + halfH + EDGE_CLEAR > bounds.right) {\n            // No room to turn before the plot's end: lift straight off the\n            // source's edge at its end, out of view.\n            const lifted = Math.min(liftX, bounds.right - halfH - EDGE_CLEAR);\n            const facing = sgn > 0 ? from.bottom : from.top;\n            const neck = sgn * (edge - sgn * headLen - facing) > 0 ? edge - sgn * headLen : facing;\n            return {\n                route: \"stub\",\n                stroke: `M ${f(lifted)} ${f(facing)} L ${f(lifted)} ${f(neck)}`,\n                head: arrow(lifted, neck, lifted, edge, halfH),\n                tail: \"\",\n                width,\n                lx: lifted, ly: (facing + neck) / 2 + CAPTION_DROP, anchor: \"middle\",\n            };\n        }\n        // The vertical run stops where the stub's base begins — never past\n        // the source's own centerline, however close the row is to the edge.\n        const yNeck = sgn * (edge - sgn * headLen - ySrc) > rad ? edge - sgn * headLen : ySrc + sgn * rad;\n        return {\n            route: \"stub\",\n            stroke: `M ${f(x1)} ${f(ySrc)}`\n                + ` L ${f(xV - rad)} ${f(ySrc)}`\n                + ` A ${f(rad)} ${f(rad)} 0 0 ${sgn === 1 ? 1 : 0} ${f(xV)} ${f(ySrc + sgn * rad)}`\n                + ` L ${f(xV)} ${f(yNeck)}`,\n            head: arrow(xV, yNeck, xV, edge, halfH),\n            tail: \"\",\n            width,\n            // The caption on the stub's riser, at mid-height.\n            lx: xV, ly: (ySrc + sgn * rad + yNeck) / 2 + CAPTION_DROP, anchor: \"middle\",\n        };\n    }\n\n    // ── The source out of view: enter from its edge down (or up) the\n    // destination's riser, turn into the approach, and arrive as usual.\n    const sgnIn = -outward(from);\n    const edge = edgeOf(from);\n    const drop = Math.abs(y2 - edge);\n    const rad = Math.min(CORNER_R, Math.max(0, (drop - headLen) / 2));\n    const xV = approachX - rad;\n    if (xV - halfH - EDGE_CLEAR < bounds.left) {\n        // No room to turn after the plot's start: come straight down (or up)\n        // onto the destination's edge at its start.\n        const dropped = Math.max(dropX, bounds.left + halfH + EDGE_CLEAR);\n        const facing = sgnIn > 0 ? to.top : to.bottom;\n        const base = facing - sgnIn * headLen;\n        const start = sgnIn * (base - (edge + sgnIn * headLen)) >= 0 ? edge + sgnIn * headLen : base;\n        return {\n            route: \"stub\",\n            stroke: `M ${f(dropped)} ${f(start)} L ${f(dropped)} ${f(base)}`,\n            head: arrow(dropped, base, dropped, facing, halfH),\n            tail: arrow(dropped, start, dropped, edge, halfH),\n            width,\n            lx: dropped, ly: (start + base) / 2 + CAPTION_DROP, anchor: \"middle\",\n        };\n    }\n    const yStart = sgnIn * (y2 - sgnIn * rad - (edge + sgnIn * headLen)) >= 0 ? edge + sgnIn * headLen : y2 - sgnIn * rad;\n    return {\n        route: \"stub\",\n        stroke: `M ${f(xV)} ${f(yStart)}`\n            + ` L ${f(xV)} ${f(y2 - sgnIn * rad)}`\n            + ` A ${f(rad)} ${f(rad)} 0 0 ${sgnIn === 1 ? 0 : 1} ${f(xV + rad)} ${f(y2)}`\n            + ` L ${f(neckX)} ${f(y2)}`,\n        head: arrival,\n        tail: arrow(xV, yStart, xV, edge, halfH),\n        width,\n        // The caption on the riser it enters down, at mid-height.\n        lx: xV, ly: (yStart + y2 - sgnIn * rad) / 2 + CAPTION_DROP, anchor: \"middle\",\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The links layer's drawing (`Plan links.html`, #1258), shared by Plan's\n * links and the Allocation's (#1321): each host lays its links out from its\n * own model (`routeRibbon`, `ribbonWeight`, `placeCaptions`) and hands them\n * here, in the coordinates of the box the layer fills.\n *\n * Every link is stroked at its weight in the muted ink over a paper CASING\n * one px either side, so it reads over anything it crosses; every link's\n * casing lies under every link's ink, and the lit link — the one under the\n * pointer — is drawn last, over the others, its two ends haloed 1px four\n * outside them. A caption sits on a paper knockout 12 tall, 4 either side of\n * its text, fitted once the text is drawn and again once the fonts come in.\n * A link's hit area is its stroke and 5 either side; the host names what a hit\n * on it is (`hit`). The clip keeps a halo or a casing inside the bounds the\n * routes keep to. An end past a window edge lands in a dashed slot.\n *\n * What a host may add, unused unless it opts in: a SELECTED link, its caption\n * outlined, carrying a × in its own 16px target whose pointer-down is stopped\n * (never a drag) and whose click unlinks (A68); a link DRAG's preview — the\n * moved link faded to its `was` line, and the new line to the pointer (A69);\n * a GRIP on a link's line and its caption, the host's component drawn in their\n * place to spread its drag handle on them (`grip`, A69); thin GUIDES from the\n * pointer into rows (`guides`, A30); captions that take the pointer as the line\n * does, lighting it (`caption`); a link's tone (`data-tone`: a draft's, a\n * drag's verdict) on its group, its casing and its caption alike, so a host\n * may draw a tone outlined; links that light nothing while a drag is under way\n * (`lights={false}`); and the lit link reported (`onLit`), for a host that\n * rings the ends itself (`halo={false}`), as the Allocation rings its bin card\n * and its resource's load bar (A67). The preview and the guides follow the\n * pointer wherever it is, so the bounds' clip does not cut them: the host's box\n * does, and they draw over the captions.\n *\n * Its measures are the links' look's (`look.ts`), which the Schematic's\n * Canvas2D painter (`canvas.ts`, #1403) draws with too.\n *\n * The DOM's vocabulary is Plan's, where these parts began (`data-plan-link`,\n * `data-plan-ribbon-band`, `data-plan-casing`, …), so Plan's tests and its\n * responsive invariants read it unchanged; the theme's shared `linkRibbons`\n * part styles it in every host.\n *\n * @packageDocumentation\n */\n\nimport {\n    useEffect, useId, useLayoutEffect, useRef, useState, type ComponentType, type KeyboardEvent, type PointerEvent, type ReactNode, type SVGProps,\n} from \"react\";\nimport { chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport { RIBBON_SLOT_W, type RibbonEdgeSlot, type RibbonEnd, type RibbonPath } from \"./geometry.js\";\nimport {\n    LINK_CASING as CASING, LINK_HALO_OUT as HALO_OUT, LINK_HALO_R as HALO_R, LINK_HIT_REACH as HIT_REACH, LINK_KNOCKOUT_H as KNOCKOUT_H,\n    LINK_KNOCKOUT_PAD as KNOCKOUT_PAD, LINK_KNOCKOUT_RISE as KNOCKOUT_RISE,\n} from \"./look.js\";\n\n/** A selected caption's ×: its square target, and the gap from the knockout (px). */\nconst UNLINK_SIZE = 16;\nconst UNLINK_GAP = 2;\n\n/** One link the layer draws: its route, its ends and its caption. */\nexport interface LinkRibbon extends RibbonPath {\n    /** Its identity in the layer. */\n    id: number;\n    /** Its source's rect, as the route met it. */\n    from: RibbonEnd;\n    /** Its destination's rect. */\n    to: RibbonEnd;\n    /** Its caption — also its hit area's label; `undefined` for none. */\n    label: string | undefined;\n    /** Its tone, which the host's recipe draws (`data-tone`): a draft's. */\n    tone?: string | undefined;\n}\n\n/** A line the layer draws beside the links: its path, and its head. */\nexport interface LinkLine {\n    stroke: string;\n    head: string;\n}\n\n/** A link drag's preview (A69). */\nexport interface LinkPreview {\n    /** The link being moved, drawn as its faded `was` line; `undefined` for a new link. */\n    was: number | undefined;\n    /** The new line, from its source to the pointer; `undefined` while it has nowhere to go. */\n    line: LinkLine | undefined;\n}\n\n/** What a grip spreads on the part it holds: its ref, the handlers that pick a drag up, its role and its marks. */\nexport interface LinkGripHandle {\n    ref?: ((el: SVGElement | null) => void) | undefined;\n    onPointerDown?: ((event: PointerEvent<SVGElement>) => void) | undefined;\n    onKeyDown?: ((event: KeyboardEvent<SVGElement>) => void) | undefined;\n    role?: string | undefined;\n    tabIndex?: number | undefined;\n    \"aria-roledescription\"?: string | undefined;\n    \"aria-describedby\"?: string | undefined;\n    \"aria-disabled\"?: boolean | undefined;\n    \"aria-pressed\"?: boolean | undefined;\n    [mark: `data-${string}`]: string | undefined;\n}\n\n/** What a host's grip is handed (A69): the link, the part it holds, and the part to draw with the grip's handle on it. */\nexport interface LinkGripProps {\n    ribbon: LinkRibbon;\n    /** Its line's hit area, or its caption. */\n    part: \"line\" | \"caption\";\n    /** Draws the part, the handle spread on it. */\n    render: (handle: LinkGripHandle) => ReactNode;\n}\n\n/** What the layer draws. */\nexport interface LinksLayerProps {\n    /** The routed links, in drawing order. */\n    ribbons: readonly LinkRibbon[];\n    /** The slots ends past a window edge land in. */\n    edgeSlots?: readonly RibbonEdgeSlot[] | undefined;\n    /** The layer's width and height, in its box's px. */\n    width: number | undefined;\n    height: number;\n    /** The bounds nothing of a link crosses: the clip. */\n    clip: { left: number; width: number };\n    /** What the hit area of a link carries beyond its geometry: its attributes and its click. */\n    hit: (ribbon: LinkRibbon) => SVGProps<SVGPathElement>;\n    /** The selected link (A68): its caption outlined, with a × that unlinks. */\n    selected?: number | undefined;\n    /** Unlinks a link: the selected caption's ×. */\n    onUnlink?: ((id: number) => void) | undefined;\n    /** The ×'s words for a link (`Unlink LD-2210 · Delete`). */\n    unlinkLabel?: ((ribbon: LinkRibbon) => string) | undefined;\n    /** A link drag's preview (A69). */\n    preview?: LinkPreview | undefined;\n    /** Thin lines from the pointer into rows, drawn as the preview is (A30). */\n    guides?: readonly LinkLine[] | undefined;\n    /** What a caption carries when it takes the pointer as its line does: its attributes, its handlers and its tooltip. Omitted, captions only label. */\n    caption?: ((ribbon: LinkRibbon) => SVGProps<SVGGElement> & { title?: string | undefined }) | undefined;\n    /**\n     * A host's grip on each link's line and on each caption that takes the pointer (A69): a component the layer draws in their\n     * place, which spreads its drag handle on them. It keeps one identity — the layer remounts nothing for it — so a drag it\n     * starts outlives the render that started it.\n     */\n    grip?: ComponentType<LinkGripProps> | undefined;\n    /** Whether a link under the pointer lights (true by default); a host passes false while a drag is under way, and the lit link goes out. */\n    lights?: boolean | undefined;\n    /** Hears which link is lit, as it changes; `null` for none. */\n    onLit?: ((id: number | null) => void) | undefined;\n    /** Whether the layer rings a lit link's ends itself (true by default); a host that rings them passes false. */\n    halo?: boolean | undefined;\n}\n\n/** The halo round an end a lit link joins — 1px, four outside it as it draws; in view only. */\nfunction EndHalo({ end, side }: { end: RibbonEnd; side: \"from\" | \"to\" }) {\n    if (end.off !== undefined) return null;\n    return (\n        <rect data-plan-linkend={side} x={end.leftX - HALO_OUT} y={end.top - HALO_OUT}\n            width={Math.max(2, end.rightX - end.leftX) + 2 * HALO_OUT} height={end.bottom - end.top + 2 * HALO_OUT}\n            rx={HALO_R} />\n    );\n}\n\n/** A link's casing — the paper either side of its band and round its heads; it carries the link's tone, for a host that outlines one. */\nfunction Casing({ r }: { r: LinkRibbon }) {\n    return (\n        <g data-plan-ribbon-casing={r.id} data-tone={r.tone}>\n            <path data-plan-casing=\"band\" d={r.stroke} strokeWidth={r.width + 2 * CASING} />\n            <path data-plan-casing=\"head\" d={r.head} />\n            {r.tail !== \"\" && <path data-plan-casing=\"head\" d={r.tail} />}\n        </g>\n    );\n}\n\n/**\n * Size each caption's knockout to its text, 4 either side of it, and keep the\n * two inside the bounds: a caption the layout centred near an edge moves in\n * (`data-x` holds where the layout centred it). A selected caption's × sits\n * just past its knockout, outside the clip.\n */\nfunction fitKnockouts(svg: SVGSVGElement | null, left: number, right: number): void {\n    if (svg === null) return;\n    for (const text of svg.querySelectorAll<SVGTextElement>(\"[data-plan-ribbon-caption]\")) {\n        const knockout = text.previousElementSibling;\n        if (knockout === null || knockout.tagName.toLowerCase() !== \"rect\") continue;\n        const width = typeof text.getComputedTextLength === \"function\" ? text.getComputedTextLength() : 0;\n        const half = width / 2 + KNOCKOUT_PAD;\n        const x = Math.max(left + half, Math.min(right - half, Number(text.getAttribute(\"data-x\"))));\n        text.setAttribute(\"x\", String(x));\n        knockout.setAttribute(\"x\", String(x - half));\n        knockout.setAttribute(\"width\", String(2 * half));\n        const id = text.parentElement?.getAttribute(\"data-plan-ribbon-label\");\n        const unlink = id === null || id === undefined ? null : svg.querySelector(`[data-plan-ribbon-unlink=\"${id}\"]`);\n        if (unlink !== null) unlink.setAttribute(\"x\", String(x + half + UNLINK_GAP));\n    }\n}\n\n/**\n * The links layer's SVG — inside the host's box, in its coordinates.\n *\n * @param props - The routed links and what the host adds\n * @returns The SVG, or nothing when there is nothing to draw\n */\nexport function LinksLayer({\n    ribbons, edgeSlots = [], width, height, clip, hit, selected, onUnlink, unlinkLabel, preview, guides = [], caption, grip: Grip, lights = true, onLit, halo = true,\n}: LinksLayerProps): ReactNode {\n    // The link under the pointer — lit, drawn over the others, its ends haloed.\n    const [lit, setLit] = useState<number | null>(null);\n    // A lit link that is gone (the focus moved on) lights nothing, nor one while the layer lights nothing.\n    useLayoutEffect(() => {\n        if (lit !== null && (!lights || !ribbons.some((r) => r.id === lit))) setLit(null);\n    }, [lit, ribbons, lights]);\n    const light = (id: number) => { if (lights) setLit(id); };\n    const unlight = (id: number) => setLit((now) => (now === id ? null : now));\n    // The host hears the lit link as it changes.\n    const heard = useRef<number | null>(null);\n    useLayoutEffect(() => {\n        if (heard.current === lit) return;\n        heard.current = lit;\n        onLit?.(lit);\n    }, [lit, onLit]);\n    // Each caption's knockout is as wide as its text, the two inside the\n    // bounds: measured after every render, and again once the fonts have come in.\n    const svgRef = useRef<SVGSVGElement | null>(null);\n    const edges = useRef({ left: 0, right: 0 });\n    useLayoutEffect(() => {\n        edges.current = { left: clip.left, right: clip.left + clip.width };\n        fitKnockouts(svgRef.current, clip.left, clip.left + clip.width);\n    });\n    useEffect(() => {\n        const fonts = typeof document !== \"undefined\" ? document.fonts : undefined;\n        if (fonts === undefined) return undefined;\n        const refit = () => fitKnockouts(svgRef.current, edges.current.left, edges.current.right);\n        fonts.addEventListener(\"loadingdone\", refit);\n        return () => fonts.removeEventListener(\"loadingdone\", refit);\n    }, []);\n    // Nothing of the layer leaves the bounds: the routes keep inside them, and\n    // the clip takes what a halo or a casing would carry over their edge.\n    const clipId = `plan-links-${useId().replace(/[^\\w-]/g, \"\")}`;\n    if (ribbons.length === 0 && edgeSlots.length === 0 && preview?.line === undefined && guides.length === 0) return null;\n    // The lit link last: its casing and ink over every other link's.\n    const ordered = lit === null ? ribbons\n        : [...ribbons.filter((r) => r.id !== lit), ...ribbons.filter((r) => r.id === lit)];\n    /** A link's hit area — the stroke and 5 either side — a grip's handle on it. */\n    const hitArea = (r: LinkRibbon, handle: LinkGripHandle) => (\n        <path data-link={r.id} aria-label={r.label} {...hit(r)} {...handle}\n            d={r.stroke} strokeWidth={r.width + 2 * HIT_REACH}\n            onPointerEnter={() => light(r.id)} onPointerLeave={() => unlight(r.id)} />\n    );\n    /** A link's caption on its knockout; when it takes the pointer, a grip's handle on it. */\n    const captionOf = (r: LinkRibbon, handle: LinkGripHandle) => {\n        const { title, ...takes } = caption?.(r) ?? {};\n        return (\n            <g key={`label-${r.id}`} data-plan-ribbon-label={r.id} data-tone={r.tone} data-selected={selected === r.id ? \"\" : undefined}\n                data-lit={caption !== undefined && lit === r.id ? \"\" : undefined}\n                {...(caption === undefined ? {} : {\n                    ...takes, ...handle,\n                    onPointerEnter: () => light(r.id),\n                    onPointerLeave: () => unlight(r.id),\n                })}>\n                {title !== undefined && <title>{title}</title>}\n                <rect data-plan-ribbon-knockout x={r.lx} y={r.ly - KNOCKOUT_RISE} width={0} height={KNOCKOUT_H} />\n                <text data-plan-ribbon-caption data-x={r.lx} x={r.lx} y={r.ly} textAnchor={r.anchor}>{r.label}</text>\n            </g>\n        );\n    };\n    return (\n        <svg ref={svgRef} width={width} height={height}>\n            <defs>\n                <clipPath id={clipId}>\n                    <rect x={clip.left} y={0} width={Math.max(0, clip.width)} height={height} />\n                </clipPath>\n            </defs>\n            <g data-plan-clip clipPath={`url(#${clipId})`}>\n                {/* An end past the window lands in a dashed slot as tall as its\n                    element, open toward the edge. */}\n                {edgeSlots.map((s, i) => {\n                    const inner = s.side === \"right\" ? s.x - RIBBON_SLOT_W : s.x + RIBBON_SLOT_W;\n                    return (\n                        <path key={`slot-${i}`} data-plan-linkslot={s.side}\n                            d={`M ${s.x} ${s.y} H ${inner} V ${s.y + s.h} H ${s.x}`} />\n                    );\n                })}\n                {/* Every link's casing, under every link's ink — the lit link's\n                    comes with it, over the rest. */}\n                {ordered.map((r) => (r.id === lit ? null : <Casing key={`casing-${r.id}`} r={r} />))}\n                {ordered.map((r) => {\n                    const isLit = lit === r.id;\n                    return (\n                        <g key={r.id} data-plan-link={r.id} data-plan-route={r.route} data-lit={isLit ? \"\" : undefined} data-tone={r.tone}\n                            data-selected={selected === r.id ? \"\" : undefined} data-was={preview?.was === r.id ? \"\" : undefined}>\n                            {isLit && <Casing r={r} />}\n                            <path data-plan-ribbon-band d={r.stroke} strokeWidth={r.width} />\n                            <path data-plan-ribbon-head d={r.head} data-plan-stub={r.to.off} />\n                            {r.tail !== \"\" && <path data-plan-ribbon-head d={r.tail} data-plan-stub={r.from.off} />}\n                            {isLit && halo && (\n                                <>\n                                    <EndHalo end={r.from} side=\"from\" />\n                                    <EndHalo end={r.to} side=\"to\" />\n                                </>\n                            )}\n                            {/* The hit area — the stroke and 5 either side of it.\n                                Its caption is its label; the host names its ref, and its grip holds it. */}\n                            {Grip === undefined ? hitArea(r, {}) : <Grip ribbon={r} part=\"line\" render={(handle) => hitArea(r, handle)} />}\n                        </g>\n                    );\n                })}\n                {/* The captions, over every link: each on its paper knockout,\n                    sized to its text once drawn; the selected one carries its ×. */}\n                {ribbons.map((r) => {\n                    if (r.label === undefined) return null;\n                    // A caption that takes the pointer is a grip too, when the host has one.\n                    return Grip === undefined || caption === undefined ? captionOf(r, {})\n                        : <Grip key={`label-${r.id}`} ribbon={r} part=\"caption\" render={(handle) => captionOf(r, handle)} />;\n                })}\n            </g>\n            {/* What follows the pointer — the guides into rows (A30) and a link drag's new line (A69) — over the captions, and\n                cut by the host's box, not the bounds': a line to the pointer runs past them. */}\n            {guides.map((g, i) => (\n                <g key={`guide-${i}`} data-plan-link-guide=\"\">\n                    <path data-plan-ribbon-band d={g.stroke} />\n                    <path data-plan-ribbon-head d={g.head} />\n                </g>\n            ))}\n            {preview?.line !== undefined && (\n                <g data-plan-link-preview=\"\">\n                    <path data-plan-ribbon-band d={preview.line.stroke} />\n                    <path data-plan-ribbon-head d={preview.line.head} />\n                </g>\n            )}\n            {/* The selected caption's × in its own target, just past its knockout: a control, not a link, so the\n                bounds' clip does not cut it where its caption sits by an edge. */}\n            {ribbons.map((r) => (selected === r.id && r.label !== undefined && onUnlink !== undefined ? (\n                <foreignObject key={`unlink-${r.id}`} data-plan-ribbon-unlink={r.id} x={r.lx} y={r.ly - KNOCKOUT_RISE - (UNLINK_SIZE - KNOCKOUT_H) / 2}\n                    width={UNLINK_SIZE} height={UNLINK_SIZE}>\n                    <chakra.button type=\"button\" aria-label={unlinkLabel?.(r) ?? \"Unlink\"} title={unlinkLabel?.(r) ?? \"Unlink\"}\n                        onPointerDown={(event) => event.stopPropagation()}\n                        onClick={(event) => { event.stopPropagation(); onUnlink(r.id); }}>\n                        <FontAwesomeIcon icon={faXmark} />\n                    </chakra.button>\n                </foreignObject>\n            ) : null))}\n        </svg>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * How far a scroll element has scrolled, followed through its scroll events:\n * what a links layer routes its ends by when the rows it joins scroll inside\n * their pane (Plan's bounded frame, the Allocation's lane grid and resource\n * rows), and what a failure said once in a grid's view sits by (#1398: the\n * Allocation's first row in view, the Calendar's grids' top-left).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useSyncExternalStore, type RefObject } from \"react\";\n\n/**\n * How far an element has scrolled (see the module docs).\n *\n * @param ref - The scroll element\n * @param active - Whether to follow it at all\n * @returns Its `scrollTop` (0 while inactive)\n */\nexport function useScrollTop(ref: RefObject<HTMLElement | null>, active: boolean): number {\n    return useScrolled(ref, active, \"scrollTop\");\n}\n\n/**\n * How far an element has scrolled sideways: what a failure said at a grid's\n * top-left in view sits by as the grid scrolls (#1398, CL11).\n *\n * @param ref - The scroll element\n * @param active - Whether to follow it at all\n * @returns Its `scrollLeft` (0 while inactive)\n */\nexport function useScrollLeft(ref: RefObject<HTMLElement | null>, active: boolean): number {\n    return useScrolled(ref, active, \"scrollLeft\");\n}\n\n/** One of an element's scroll offsets, followed through its scroll events while active. */\nfunction useScrolled(ref: RefObject<HTMLElement | null>, active: boolean, offset: \"scrollTop\" | \"scrollLeft\"): number {\n    const subscribe = useCallback((notify: () => void) => {\n        const el = ref.current;\n        if (!active || el === null) return () => undefined;\n        el.addEventListener(\"scroll\", notify, { passive: true });\n        return () => el.removeEventListener(\"scroll\", notify);\n    }, [ref, active]);\n    return useSyncExternalStore(subscribe, () => (active ? ref.current?.[offset] ?? 0 : 0), () => 0);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A link's weight and where its caption goes (`Plan links.html` §15), shared\n * by Plan's links and the Allocation's: the weight by a third of the family's\n * largest quantity, each caption kept inside the bounds nothing of a link\n * crosses, and a caption within 60 × 12 of an earlier one stepped down until\n * clear. Pure: no React, no DOM.\n *\n * @packageDocumentation\n */\n\nimport { LINK_KNOCKOUT_PAD } from \"./look.js\";\n\n/** A caption's knockout: the paper either side of its text (px) — the links' look's (`look.ts`). */\nexport const RIBBON_CAPTION_PAD = LINK_KNOCKOUT_PAD;\n\n/** The widest a caption's letter draws — mono 10px, its advance 0.6em and a\n *  margin over it (px): what keeps a caption inside the bounds before its text\n *  is measured. */\nexport const RIBBON_CAPTION_CHAR = 6.5;\n\n/**\n * A link's weight — its stroke's width (`Plan links.html` §15): its\n * quantity's third of the family's largest — above two thirds 8, above one\n * third 4, else 2 — and 1.5 for a link with no quantity.\n *\n * @param quantity - The link's quantity's size, or `undefined` when it has none\n * @param largest - The largest quantity among the family's links\n * @returns The weight, in px\n */\nexport function ribbonWeight(quantity: number | undefined, largest: number): number {\n    if (quantity === undefined) return 1.5;\n    const share = largest > 0 ? quantity / largest : 0;\n    return share > 2 / 3 ? 8 : share > 1 / 3 ? 4 : 2;\n}\n\n/** A routed link's caption: its text, and where the route centred it. */\nexport interface RibbonCaption {\n    /** Its text; `undefined` for a link with no caption, which takes no line. */\n    label: string | undefined;\n    /** Where its text is centred across. */\n    lx: number;\n    /** Where its text's baseline sits. */\n    ly: number;\n}\n\n/**\n * Places each caption, in place: one the route centred near an edge moves in,\n * by its text's width at the widest a mono label's letter draws, so the\n * renderer, which fits the knockout to the text, finds it inside already; then\n * a caption within 60 × 12 of an earlier one steps down 12 until clear — links\n * sharing a source edge can land their captions on one another.\n *\n * @param ribbons - The routed links, in drawing order\n * @param left - The left edge nothing of a link crosses\n * @param right - The right edge\n */\nexport function placeCaptions(ribbons: readonly RibbonCaption[], left: number, right: number): void {\n    for (const r of ribbons) {\n        if (r.label === undefined) continue;\n        const half = (r.label.length * RIBBON_CAPTION_CHAR) / 2 + RIBBON_CAPTION_PAD;\n        r.lx = Math.max(left + half, Math.min(right - half, r.lx));\n    }\n    const placed: { x: number; y: number }[] = [];\n    for (const r of ribbons) {\n        if (r.label === undefined) continue;\n        while (placed.some((p) => Math.abs(p.x - r.lx) < 60 && Math.abs(p.y - r.ly) < 12)) r.ly += 12;\n        placed.push({ x: r.lx, y: r.ly });\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Timeline's links (`Allocation Spec.md` §11, A65–A69, A30), pure: which\n * links the focus draws — its family, each part of each bin on it — and which a\n * drag draws instead — the dragged bin's resource's family and the target's —\n * and where each runs, routed by Plan's grammar (`shared/links/`) from the bin\n * card's right edge to its resource row's leading edge, through the link\n * channel. Nothing of a link leaves the lane grid's card columns or crosses\n * into the resource pane; an end out of its pane's view meets the view's edge\n * in Plan's stub. A link drag's new line runs from its card to the pointer, and\n * an arrival's drag over the lane grid draws thin lines from the pointer into\n * its three best fits' rows. For a run of the optimiser's highlight (#1409)\n * the links the runs added or changed draw over the focus's family in the\n * Elara look.\n *\n * @packageDocumentation\n */\n\nimport { placeCaptions, ribbonWeight } from \"../shared/links/captions.js\";\nimport { RIBBON_CORNER, RIBBON_RISER, rounded, routeRibbon, type RibbonEnd } from \"../shared/links/geometry.js\";\nimport type { LinkLine, LinkRibbon } from \"../shared/links/layer.js\";\nimport { CARD_H, CARD_INSET, CARD_W, HOUR_W, LANE_W, ROW_H, type LaneCard } from \"./timeline-layout.js\";\nimport { compareDate, compareFloat, compareString, partsOf, type Day } from \"./model.js\";\n\n/**\n * How a drag draws a link of its families (A65, A69): the link it moves, faded to its `was` line, or the target's verdict\n * on it; or how the highlight draws a link a run of the optimiser added or changed (#1409): outlined in the Elara tone.\n */\nexport type LinkLook = \"was\" | \"fits\" | \"refused\" | \"elara\";\n\n/** One link of the family: a bin's part on a resource. */\nexport interface FamilyLink {\n    /** Its identity in the layer: the same for the same link in a focus's family and a drag's (`linkIds`). */\n    id: number;\n    bin: string;\n    resource: string;\n    /** Its quantity; `undefined` for a reservation's, which draws thin and has no caption. */\n    quantity: number | undefined;\n    /** Whether the drafts changed it: its bin new, or this part not as the day holds it. */\n    draft: boolean;\n    /** How a drag draws it; at rest, plain. */\n    look?: LinkLook | undefined;\n    /** The family it is drawn in, by its resource: what its weight is a share of (A66). */\n    family: string;\n}\n\n/** Every link of the day, by its bin and then its resource: its identity in the layer. */\nexport type LinkIds = ReadonlyMap<string, ReadonlyMap<string, number>>;\n\n/**\n * Every link of the day, numbered once — its bins by time, each bin's parts\n * largest first — so a link keeps its identity in the layer, and the grip the\n * layer draws for it, whichever family it is drawn in: a drag that starts on a\n * focus's link goes on drawing it as the drag's (A69).\n *\n * @param plan - The day as drafted\n * @returns Each link's id, by its bin and its resource\n */\nexport function linkIds(plan: Day): LinkIds {\n    const ids = new Map<string, Map<string, number>>();\n    let next = 0;\n    for (const [id, bin] of [...plan.bins].sort(([a, x], [b, y]) => compareDate(x.at, y.at) || compareString(a, b))) {\n        ids.set(id, new Map(partsOf(bin).map(part => [part.key, next++] as const)));\n    }\n    return ids;\n}\n\n/**\n * The focus's family (A65, A72): every bin with a part on the focus, by time,\n * and each of its parts — a split bin shows a link to each of its resources.\n *\n * @param plan - The day as drafted\n * @param held - The day as the record holds it\n * @param focus - The focus's resource\n * @param ids - Every link's identity: the day's own by default\n * @returns The links, in drawing order\n */\nexport function familyOf(plan: Day, held: Day | undefined, focus: string, ids: LinkIds = linkIds(plan)): FamilyLink[] {\n    const bins = [...plan.bins].filter(([, bin]) => bin.parts.has(focus))\n        .sort(([a, x], [b, y]) => compareDate(x.at, y.at) || compareString(a, b));\n    const links: FamilyLink[] = [];\n    for (const [id, bin] of bins) {\n        const committed = held?.bins.get(id);\n        for (const part of partsOf(bin)) {\n            const was = committed?.parts.get(part.key);\n            links.push({\n                id: ids.get(id)?.get(part.key) ?? -1, bin: id, resource: part.key,\n                quantity: bin.arrival.type === \"none\" ? undefined : part.quantity,\n                draft: was === undefined || compareFloat(was, part.quantity) !== 0, family: focus,\n            });\n        }\n    }\n    return links;\n}\n\n/**\n * The links the runs of the optimiser added or changed (#1409), for the\n * highlight: each bin's touched parts, the bins by time and each bin's parts\n * largest first, every one a draft in the Elara look, weighed in its\n * resource's family.\n *\n * @param plan - The day as drafted\n * @param touched - The parts the runs added or changed, by bin: the kilns\n * @param ids - Every link's identity\n * @returns The links, in drawing order; none of a bin the day no longer holds\n */\nexport function runLinks(plan: Day, touched: ReadonlyMap<string, ReadonlySet<string>>, ids: LinkIds): FamilyLink[] {\n    const bins = [...plan.bins].filter(([id]) => touched.has(id)).sort(([a, x], [b, y]) => compareDate(x.at, y.at) || compareString(a, b));\n    const links: FamilyLink[] = [];\n    for (const [id, bin] of bins) {\n        const kilns = touched.get(id)!;\n        for (const part of partsOf(bin)) {\n            if (!kilns.has(part.key)) continue;\n            links.push({\n                id: ids.get(id)?.get(part.key) ?? -1, bin: id, resource: part.key,\n                quantity: bin.arrival.type === \"none\" ? undefined : part.quantity, draft: true, look: \"elara\", family: part.key,\n            });\n        }\n    }\n    return links;\n}\n\n/** A link a drag moves: its bin's part on a resource. */\nexport interface MovedLink { bin: string; resource: string }\n\n/** Where a drag rests, for its links: a resource other than the dragged bin's, and the drop's verdict there — `undefined` while the fit's answer is on its way. */\nexport interface DragTarget { resource: string; verdict: \"fits\" | \"refused\" | undefined }\n\n/**\n * The links a drag draws in the focus's place (A65): the dragged bin's\n * resource's family, the link it moves faded to its `was` line (A69), and the\n * family of the resource the drag rests on, its links there in the drop's\n * verdict — ink-2 where it fits, warn where it refuses; a draft link keeps its\n * brand — as the mock draws them: the plain ones first, then the target's, the\n * `was` line over them all. A link in both families is drawn once.\n *\n * @param plan - The day as drafted\n * @param held - The day as the record holds it\n * @param ids - Every link's identity\n * @param current - The dragged bin's resource; `undefined` for a drag of no bin's (a Library card)\n * @param moved - The link the drag moves, if it moves one\n * @param target - The resource the drag rests on, if it is not `current`, and the verdict there\n * @returns The links, in drawing order\n */\nexport function dragFamilies(plan: Day, held: Day | undefined, ids: LinkIds, current: string | undefined, moved: MovedLink | undefined,\n    target: DragTarget | undefined): FamilyLink[] {\n    const links = new Map<number, FamilyLink>();\n    for (const resource of [current, target?.resource]) {\n        if (resource !== undefined) for (const link of familyOf(plan, held, resource, ids)) if (!links.has(link.id)) links.set(link.id, link);\n    }\n    const looked = [...links.values()].map((link): FamilyLink => {\n        // A link into either resource is weighed in that resource's family, whichever family found it first.\n        const own = link.resource === current || link.resource === target?.resource ? { ...link, family: link.resource } : link;\n        if (moved !== undefined && link.bin === moved.bin && link.resource === moved.resource) return { ...own, look: \"was\" };\n        return target !== undefined && target.verdict !== undefined && link.resource === target.resource ? { ...own, look: target.verdict } : own;\n    });\n    const layer = (link: FamilyLink) => link.look === \"was\" ? 2 : link.look === undefined ? 0 : 1;\n    return looked.sort((a, b) => layer(a) - layer(b));\n}\n\n/** Where the links run: the layer's px, as the panes stand. */\nexport interface LinkView {\n    /** The lane grid's left edge: where its hour column starts. */\n    gridLeft: number;\n    /** The link channel's right edge: every resource row's leading edge. */\n    channelRight: number;\n    /** The panes' view under their heads, its height. */\n    height: number;\n    /** How far the lane grid and the resource rows have scrolled. */\n    laneTop: number;\n    rowsTop: number;\n}\n\n/** An end out of its pane's view sits on the edge it lies beyond. */\nfunction inView(end: RibbonEnd, height: number): RibbonEnd {\n    if (end.bottom <= 0) return { ...end, top: 0, bottom: 0, off: \"above\" };\n    if (end.top >= height) return { ...end, top: height, bottom: height, off: \"below\" };\n    return end;\n}\n\n/** A bin's card, in the layer's px, as its lane grid has scrolled. */\nexport function cardEnd(card: LaneCard, view: LinkView): RibbonEnd {\n    const leftX = view.gridLeft + HOUR_W + card.lane * LANE_W + CARD_INSET, top = card.row * ROW_H + CARD_INSET - view.laneTop;\n    return { leftX, rightX: leftX + CARD_W, top, bottom: top + CARD_H };\n}\n\n/** A resource row's leading edge, in the layer's px, as the rows have scrolled: where every link into it arrives. */\nfunction rowEnd(row: number, view: LinkView): RibbonEnd {\n    const at = row * ROW_H - view.rowsTop;\n    return { leftX: view.channelRight, rightX: view.channelRight, top: at, bottom: at + ROW_H };\n}\n\n/**\n * Routes the links (A66): each from its card to its row, weighted by its\n * share of its family's largest quantity, its caption its quantity; in a\n * drag's families (A65) the link it moves carries no tone of its own, a draft\n * keeps the brand's, and a link into the target takes the verdict's; a run's\n * link takes the Elara tone over its draft's (#1409).\n *\n * @param family - The links\n * @param cards - Each bin's card, by bin\n * @param rows - Each shown resource row's index, by key: a link to a row the narrowing hides is not drawn\n * @param view - Where the links run\n * @param label - A link's caption\n * @param selected - The selected link: drawn a px heavier, in the ink\n * @returns The routed links\n */\nexport function layoutLinks(\n    family: readonly FamilyLink[], cards: ReadonlyMap<string, LaneCard>, rows: ReadonlyMap<string, number>, view: LinkView,\n    label: (link: FamilyLink) => string | undefined, selected?: number | undefined,\n): (LinkRibbon & { link: FamilyLink })[] {\n    // Each family's largest quantity: what its links' weights are a share of.\n    const largest = new Map<string, number>();\n    for (const l of family) largest.set(l.family, Math.max(largest.get(l.family) ?? 0, l.quantity ?? 0));\n    const bounds = { left: view.gridLeft + HOUR_W, right: view.channelRight };\n    const out: (LinkRibbon & { link: FamilyLink })[] = [];\n    for (const link of family) {\n        const card = cards.get(link.bin), row = rows.get(link.resource);\n        if (card === undefined || row === undefined) continue;\n        const from = inView(cardEnd(card, view), view.height);\n        const to = inView(rowEnd(row, view), view.height);\n        // Both ends past the same edge: nothing in view to draw.\n        if (from.off !== undefined && from.off === to.off) continue;\n        const width = ribbonWeight(link.quantity, largest.get(link.family) ?? 0) + (link.id === selected ? 1 : 0);\n        out.push({ ...routeRibbon(from, to, width, bounds), id: link.id, from, to, label: link.quantity === undefined ? undefined : label(link), link,\n            tone: link.look === \"was\" ? undefined : link.look === \"elara\" ? \"elara\" : link.draft ? \"draft\" : link.look });\n    }\n    placeCaptions(out, bounds.left, bounds.right);\n    return out;\n}\n\n/** How far past its card the pointer must be before a link drag's new line shows (px). */\nconst LINE_CLEAR = 16;\n/** The least a new line runs out of its card before it turns (px). */\nconst LINE_OUT = 12;\n/** How far short of the riser an arrival's drag still draws its guides (px). */\nconst GUIDE_CLEAR = 12;\nconst f = (n: number) => n.toFixed(1);\n\n/**\n * A link drag's new line (A69), as the mock draws it: out of its card's right\n * edge level with the card's middle, to the riser — the links' own,\n * `RIBBON_RISER` before the rows' edge, once the pointer is past it, else\n * halfway to the pointer — up or down to the pointer, and on into a head 9\n * long and 12 across at the pointer. Nothing while the pointer is within 16px\n * of the card, or outside the panes under their head.\n *\n * @param from - The dragged bin's card, in the layer's px (`cardEnd`)\n * @param x - The pointer, across the layer\n * @param y - The pointer, down the layer\n * @param view - Where the links run\n * @returns The line, or `undefined` while it has nowhere to go\n */\nexport function dragLine(from: RibbonEnd, x: number, y: number, view: Pick<LinkView, \"channelRight\" | \"height\">): LinkLine | undefined {\n    const x1 = from.rightX, y1 = (from.top + from.bottom) / 2;\n    if (x <= x1 + LINE_CLEAR || y <= 0 || y >= view.height) return undefined;\n    const riser = view.channelRight - RIBBON_RISER;\n    const turn = x > riser ? riser : Math.max(x1 + LINE_OUT, (x1 + x) / 2);\n    // A point within half a px of the one before it is the same corner: a pointer level with the card runs straight.\n    const points = ([[x1, y1], [turn, y1], [turn, y], [x - 8, y]] as const)\n        .filter((p, i, all) => i === 0 || Math.abs(p[0] - all[i - 1]![0]) + Math.abs(p[1] - all[i - 1]![1]) > 0.5);\n    return {\n        stroke: rounded(points, RIBBON_CORNER),\n        head: `M ${f(x - 9)} ${f(y - 6)} L ${f(x)} ${f(y)} L ${f(x - 9)} ${f(y + 6)} Z`,\n    };\n}\n\n/**\n * The thin lines from the pointer into the three best fits' rows while an\n * arrival is dragged over the lane grid (A30): each Plan's metro-S out of the\n * pointer to its row's leading edge, 1.5 wide, or its stub toward a row out of\n * the rows' view; none once the pointer is within 12px of the riser or outside\n * the panes under their head, and none into a row the narrowing hides.\n *\n * @param x - The pointer, across the layer\n * @param y - The pointer, down the layer\n * @param ranks - The three best fits, best first\n * @param rows - Each shown resource row's index, by key\n * @param view - Where the links run\n * @returns The lines, best first\n */\nexport function guideLines(x: number, y: number, ranks: readonly string[], rows: ReadonlyMap<string, number>, view: LinkView): LinkLine[] {\n    if (x >= view.channelRight - RIBBON_RISER - GUIDE_CLEAR || y <= 0 || y >= view.height) return [];\n    const from: RibbonEnd = { leftX: x, rightX: x, top: y, bottom: y };\n    return ranks.flatMap(key => {\n        const row = rows.get(key);\n        if (row === undefined) return [];\n        const route = routeRibbon(from, inView(rowEnd(row, view), view.height), 1.5);\n        return [{ stroke: route.stroke, head: route.head }];\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Timeline (`Allocation Spec.md` §8, §9.2–§9.3, #1326): one head row over\n * three panes — the lane grid with a card per bin, the link channel, and the\n * resources in their fixed order, each row's plot on the resource axis — and\n * the focus; during a drag, the drag's links in the focus's place — its\n * families, a link drag's new line to the pointer, an arrival's lines into\n * its best rows (A65, A69, A30). Every figure and word is e3-ui's (the slots, the\n * loads, each resource's line); the layout's indices are `timeline-layout.ts`'s,\n * and every size is the `allocationBuilder` recipe's. A day not read yet\n * draws its lanes, slot times, hours, the link channel and its resources at\n * once — each lane-hour cell washed, each lane head's figures and today's load\n * placeholders (#1398, CL2) — a day whose read failed says so once, across the\n * lane cells of the first row in view (CL11), and a started day with no bins\n * says so there too (CL13). The hour in view holds as the day's bands grow or\n * the day changes (CL8).\n *\n * @packageDocumentation\n */\n\nimport {\n    createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore,\n    type CSSProperties, type KeyboardEvent, type PointerEvent as ReactPointerEvent, type ReactNode, type RefObject,\n} from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n    faArrowDown, faArrowRight, faArrowUp, faCircleExclamation, faFilter, faInbox, faLink, faLinkSlash, faTriangleExclamation, faXmark,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport type { SortedMap, option } from \"@elaraai/east\";\nimport { takeKey, useContainerBelow, useDragEventChip, useDropCell, type Formatters } from \"@elaraai/east-ui-components\";\nimport { LoadingEmptyLine, LoadingFailedLine, LoadingWash, PlaceholderShape, VirtualRows, formatDatePattern, useRevealed } from \"@elaraai/east-ui-components/internal\";\nimport type { PeriodRead } from \"../shared/loading.js\";\nimport { LinksLayer, type LinkGripProps, type LinkLine, type LinkRibbon } from \"../shared/links/layer.js\";\nimport { useScrollTop } from \"../shared/links/scroll.js\";\nimport { NowLine } from \"../shared/time/now-line.js\";\nimport { TimeRulerRow, timeRulerUnits } from \"../shared/time/ruler.js\";\nimport { isoWeekUTC, timeScale, timeWords } from \"../shared/time/scale.js\";\nimport { shadeBands } from \"../shared/time/shading.js\";\nimport { MoveGhost } from \"../shared/schedule/move-ghost.js\";\nimport { remainderOf } from \"./actions.js\";\nimport { useBinFocusTarget } from \"./bin-focus.js\";\nimport { currentOf, dropTarget, gripCoord, laneCoord, movedLinkOf, rowCoord, type AllocationDrag, type BoardGrip, type Target } from \"./drag.js\";\nimport { cardEnd, dragFamilies, dragLine, familyOf, guideLines, layoutLinks, linkIds, runLinks, type DragTarget, type FamilyLink, type LinkIds, type LinkView } from \"./links.js\";\nimport { NarrowedEmpty } from \"./narrowed.js\";\nimport { a, counted, lower, one, useNouns, type Nouns } from \"./nouns.js\";\nimport type { AllocationBinOp, AllocationGhost, AllocationOptimised } from \"./optimise.js\";\nimport {\n    CARD_H, HOUR_W, LABEL_W, MIN_DAY, ROW_H, SHORT_DAY, axisFraction, axisSpan, laneGrid, resourceAxis, type LaneBand, type LaneCard, type ResourceAxis,\n} from \"./timeline-layout.js\";\nimport {\n    DAY, allocationWords, compareDate, compareFloat, partsOf, sameParts, type AllocationDomain, type AllocationStyles, type AllocationValue, type Bin, type Context,\n    type Day, type Fit, type Issue, type Load, type ResourceLine, type ResourceRow, type Selection, type Slot,\n} from \"./model.js\";\n\n/** The panes' head, the recipe's: the rows sit under it. */\nconst HEAD = 48;\nconst NO_ISSUES: readonly Issue[] = [];\nconst NO_GHOSTS: readonly AllocationGhost[] = [];\nconst NO_LINKS: readonly FamilyLink[] = [];\n\n/** How a selection asks to be followed (A12): `soft` leaves the resource pane where it is when the row is in view. */\nexport interface TimelineFollow { nonce: number; soft: boolean }\n\n/** A selected link (A68): its bin's part on a resource. */\nexport interface SelectedLink { bin: string; resource: string }\n\n/** The Timeline's props. */\nexport interface TimelineProps {\n    value: AllocationValue;\n    context: Context;\n    styles: AllocationStyles;\n    format: Formatters;\n    /** The plan day. */\n    day: Date;\n    /** The day as drafted, and as the record holds it. */\n    plan: Day;\n    held: Day | undefined;\n    /** Whether two bins are the same: one unlike the record's is a draft. */\n    sameBin: (a: Bin, b: Bin) => boolean;\n    /** Whether a bin holds a conflict not yet chosen: it wears the warn ring. None by default. */\n    conflicted?: ((id: string) => boolean) | undefined;\n    /** Whether a bin's row breaks its form's bounds (#1585), stored or changed: it wears the warn ring too. None by default. */\n    bounded?: ((id: string) => boolean) | undefined;\n    /** Every resource's load. */\n    loads: SortedMap<string, Load>;\n    /** The day's slots. */\n    slots: readonly Slot[];\n    /** Every issue: the app's flags on its bins. */\n    issues: readonly Issue[];\n    /** The resources the narrowing shows, by key; `none` for every one. */\n    visible: option<Set<string>>;\n    /** The lanes the narrowing shows, by key; `none` for every one (#1336). */\n    visibleLanes: option<Set<string>>;\n    /** The arrivals the narrowing shows, by key; `none` for every one: a bin of a hidden arrival has no card (#1339). */\n    visibleArrivals: option<Set<string>>;\n    /** Clears the narrowing, where nothing shows; `undefined` with no narrowing. */\n    clearFilters: (() => void) | undefined;\n    selection: Selection | undefined;\n    /** The focus (A13). */\n    focus: string | undefined;\n    /** The arrival whose every bin the Library's Allocated card highlights (A10). */\n    highlight: string | undefined;\n    /** Whether a Library arrival is picked (A11): its free lane hours show, and a click there or on a ranked resource books it. */\n    picked: boolean;\n    /** Books the picked arrival where a click lands, as its drop would (A11). */\n    book: (target: Target) => void;\n    /** Whether the day takes edits. */\n    editable: boolean;\n    select: (next: Selection | undefined) => void;\n    /** A connector clicked: its bin's resource Chooser, in the inspector (A21). */\n    choose: (bin: string) => void;\n    follow: TimelineFollow;\n    /** The selected link (A68), and selecting one: its bin and the link. */\n    link: SelectedLink | undefined;\n    selectLink: (link: SelectedLink) => void;\n    /** Unlinks a bin's part on a resource: the selected link's ×. */\n    unlink: (bin: string, resource: string) => void;\n    /** The board's drags (#1328). */\n    drag: AllocationDrag;\n    /** A question's candidates: what a ranked fit's preview bar shows (A28), e3-ui's own arithmetic. */\n    candidates: AllocationDomain[\"candidates\"];\n    /**\n     * What it draws of the day's read (#1398): the day as read; a day not read yet — the day without its bins handed in\n     * as `plan`, its lane-hour cells washed and its figures placeholders once the reveal says so; or one whose read\n     * failed — its geometry, the failure said once across the lane cells of the first row in view.\n     */\n    read: PeriodRead;\n    /** A started day with no bins, once read (CL13): what the first row in view says — `No bins on Wed 12 May` — and how to book one. */\n    empty: { message: string; hint: string | undefined } | undefined;\n    /**\n     * What the runs of the app's optimiser left on the day's bins (#1409): each bin's operation, drawn on its card with\n     * its provenance on hover; the ghosts where the bins a run moved or removed stood; the lanes the latest run changed;\n     * and the links the runs added or changed, with the kilns they land on.\n     */\n    optimised?: AllocationOptimised | undefined;\n    /**\n     * Whether a run's highlight is on (#1409): the ghosts show, the lane heads the run changed flash, the runs' links\n     * draw outlined in the Elara tone over the focus's family, and the loads they land on glow with the cards.\n     */\n    lit?: boolean | undefined;\n}\n\n/** A refusing run's label (A27): `✕ Over max · 3 resources · by 4–13 m³`, over the rows it gathers. */\ninterface RefusalRun { from: number; to: number; label: string; meta: string; tip: string }\n\n/** A fit's refusal. */\ntype Refused = Extract<Fit, { type: \"refused\" }>[\"value\"];\n\n/**\n * The runs of contiguous rows refusing for one reason (A27), each labelled by\n * its group, how many it gathers, and the range of its measures: `by 4–13 m³`,\n * `next job Wed 19 – Thu 20`, `until Fri 14 – Sat 15`; its tooltip every row's reason.\n */\nfunction refusalRuns(verdicts: readonly (Fit | undefined)[], words: ReturnType<typeof allocationWords>, unit: string): RefusalRun[] {\n    const out: RefusalRun[] = [];\n    let run: { from: number; to: number; refusals: Refused[] } | undefined;\n    const close = () => {\n        if (run === undefined) return;\n        const n = run.to - run.from + 1, refusals = run.refusals;\n        const lead = refusals.map(r => r.measure.type === \"none\" ? undefined : r.measure.value.lead).find(l => l !== undefined);\n        const amounts = refusals.flatMap(r => r.measure.type === \"amount\" ? [r.measure.value.value] : []);\n        const days = [...new Set(refusals.flatMap(r => r.measure.type === \"day\" ? [r.measure.value.at] : []).sort(compareDate).map(at => formatDatePattern(\"ddd D\", at)))];\n        let detail = \"\";\n        if (amounts.length > 0) {\n            const lo = Math.min(...amounts), hi = Math.max(...amounts);\n            detail = `${lead} ${lo === hi ? words.quantity(lo, unit) : `${words.quantity(lo, \"\")}–${words.quantity(hi, unit)}`}`;\n        } else if (days.length > 0) detail = `${lead} ${days.length > 1 ? `${days[0]} – ${days.at(-1)}` : days[0]}`;\n        out.push({ from: run.from, to: run.to, label: refusals[0]!.group, meta: [n > 1 ? `${n} resources` : \"\", detail].filter(part => part !== \"\").join(\" · \"),\n            tip: refusals.map(r => r.reason).join(\" · \") });\n        run = undefined;\n    };\n    verdicts.forEach((verdict, i) => {\n        const refusal = verdict?.type === \"refused\" ? verdict.value : undefined;\n        if (refusal !== undefined && run !== undefined && run.refusals[0]!.group === refusal.group) { run.to = i; run.refusals.push(refusal); return; }\n        close();\n        if (refusal !== undefined) run = { from: i, to: i, refusals: [refusal] };\n    });\n    close();\n    return out;\n}\n\n/** The fits marker (A31): where the #1 fit lies out of view, and what it says. */\ninterface Marker { side: \"above\" | \"below\" | \"hidden\"; label: string; resource: string }\n\n/**\n * The fits marker, when the #1 fit's row is out of the resource pane's view\n * (A31): `2 fits below · #1 K-103 · drop here`, or `#1 K-601 is hidden by\n * Filters · drop here` when the narrowing hides it.\n */\nfunction fitsMarker(ranks: readonly string[], rowIndex: ReadonlyMap<string, number>, top: number, view: number, nameOf: (key: string) => string): Marker | undefined {\n    const best = ranks[0];\n    if (best === undefined || view <= 0) return undefined;\n    const at = rowIndex.get(best), name = nameOf(best);\n    if (at === undefined) return { side: \"hidden\", label: `#1 ${name} is hidden by Filters · drop here`, resource: best };\n    const inView = (i: number) => i * ROW_H >= top && i * ROW_H + ROW_H <= top + view;\n    if (inView(at)) return undefined;\n    const below = at * ROW_H > top;\n    const n = ranks.filter(key => { const i = rowIndex.get(key); return i !== undefined && !inView(i) && i * ROW_H > top === below; }).length;\n    return { side: below ? \"below\" : \"above\", label: `${plural(n, \"fit\")} ${below ? \"below\" : \"above\"} · #1 ${name} · drop here`, resource: best };\n}\n\n/**\n * A lane hour: a drop target for a bin's body (A14, A37). A day not read yet washes it (#1398): where its bins go is\n * not known, so no shape of one implies a time or a place.\n */\nfunction LaneCellView({ props, lane, at, free, wash, style }: { props: TimelineProps; lane: string; at: Date; free: boolean; wash: boolean; style: CSSProperties }) {\n    const { drag, styles } = props;\n    const { veto, options } = dropTarget(drag, { kind: \"lane\", lane, at, card: undefined });\n    const ref = useDropCell(drag.enabled ? laneCoord(drag.surface, lane, at) : null, false, veto, undefined, options);\n    return <Box ref={ref} css={styles.laneCell} data-allocation-cell={`${lane}|${at.getTime()}`} data-free={free ? \"\" : undefined} style={style}\n        onClick={() => { if (props.picked && free && props.editable) props.book({ kind: \"lane\", lane, at, card: undefined }); else props.select(undefined); }}>\n        {wash && <LoadingWash />}\n        {free && <Box as=\"span\" css={styles.lanePlaceholder} data-allocation-placeholder=\"\" />}\n    </Box>;\n}\n\n/**\n * The band at the top of the lane pane's view: under its sticky head, the first band whose rows reach below the scroll\n * — the row a failure or an empty day is said in (#1398, CL11, CL13), and the one that holds as the bands change (CL8).\n *\n * @param bands - The lane grid's bands\n * @param top - The lane pane's scroll\n * @returns The band; `undefined` with none\n */\nfunction bandAt(bands: readonly LaneBand[], top: number): LaneBand | undefined {\n    return bands.find(band => (band.row + band.span) * ROW_H > top) ?? bands[bands.length - 1];\n}\n\n/** The fits marker over the rows (A31): a drop on it goes to the #1. */\nfunction FitsMarker({ props, marker, top }: { props: TimelineProps; marker: Marker; top: number }) {\n    const { drag, styles } = props;\n    const { veto, options } = dropTarget(drag, { kind: \"resource\", resource: marker.resource });\n    const ref = useDropCell(drag.enabled ? rowCoord(drag.surface, marker.resource) : null, false, veto, undefined, options);\n    return <Box ref={ref} css={styles.fitsMarker} data-allocation-marker={marker.side} style={{ top: `${top}px` }}>\n        <FontAwesomeIcon icon={marker.side === \"hidden\" ? faFilter : marker.side === \"below\" ? faArrowDown : faArrowUp} aria-hidden=\"true\" />{marker.label}\n    </Box>;\n}\n\n/** `1 bin`, `9 bins`. */\nconst plural = (n: number, word: string) => `${n} ${word}${n === 1 ? \"\" : \"s\"}`;\n/**\n * Scrolls a virtualised pane to a row's offset, already on the rows' grid. Its\n * snap waits for the rows there to mount: snapping now would land on the\n * nearest row mounted before the scroll.\n */\nfunction scrollRowsTo(pane: HTMLElement, top: number) {\n    if (pane.scrollTop === top) return;\n    pane.setAttribute(\"data-snap-suspended\", \"\");\n    pane.scrollTop = top;\n    requestAnimationFrame(() => requestAnimationFrame(() => pane.removeAttribute(\"data-snap-suspended\")));\n}\n\n/** Enter or Space acts as a click, the key going no further than the board (#1398). */\nconst onActivate = (act: () => void) => (event: KeyboardEvent) => {\n    if (event.key === \"Enter\" || event.key === \" \") { takeKey(event); act(); }\n};\n\n/**\n * The Timeline (see the module docs).\n *\n * @param props - See {@link TimelineProps}\n * @returns The three panes under their head\n */\nexport function AllocationTimeline(props: TimelineProps) {\n    const { value, context, styles, plan, day, loads, slots } = props;\n    // A day not read yet, or whose read failed (#1398): `plan` is the day without its bins, so its grid has a band one\n    // row each and no card; not read yet, its lane-hour cells are washed and its figures placeholders, each unseen until\n    // the frame's reveal says so, which each reads itself (CL2, CL4).\n    const { read, empty } = props;\n    const unread = read.state !== \"held\";\n    const pending = read.state === \"pending\";\n    // What the first row in view says, once: why the day could not be read (CL11), or that a started day has no bins (CL13).\n    const saying = read.state === \"failed\" || empty !== undefined;\n    const words = allocationWords();\n    const nouns = useNouns();\n    const unit = context.unit;\n    // The lanes the narrowing shows, in their order: a hidden lane's column goes, with its cards and its slots (#1336).\n    const lanes = useMemo(() => value.lanes.filter(lane => props.visibleLanes.type === \"none\" || props.visibleLanes.value.has(lane.key)), [value.lanes, props.visibleLanes]);\n    // A bin of an arrival the narrowing hides has no card; a reservation, which has no arrival, stays (#1339).\n    const { visibleArrivals } = props;\n    // The ghosts of the bins the runs of the optimiser moved or removed, where they stood, for the highlight (#1409, R15):\n    // each a row of its slot's band after the slot's cards, and none once the highlight ends.\n    const optimised = props.optimised, lit = props.lit === true;\n    const ghosts = lit && optimised !== undefined ? optimised.ghosts : NO_GHOSTS;\n    const grid = useMemo(() => laneGrid(lanes.map(lane => lane.key), slots, plan,\n        bin => visibleArrivals.type === \"none\" || bin.arrival.type === \"none\" || visibleArrivals.value.has(bin.arrival.value), ghosts), [lanes, slots, plan, visibleArrivals, ghosts]);\n    const axis = useMemo(() => resourceAxis(day, Number(words.ms(value.settings.horizon.before)), Number(words.ms(value.settings.horizon.after))),\n        [day, value.settings.horizon, words]);\n    const lines = useMemo(() => new Map(value.resources.map(r => [r.key, words.line(day, r, loads.get(r.key)!, unit, lower(nouns.reserved))] as const)), [value.resources, loads, day, unit, words, nouns.reserved]);\n    // The rows: the resources in key order; the narrowing hides rows, never reorders them (A18).\n    const rows = useMemo(() => value.resources.filter(r => props.visible.type === \"none\" || props.visible.value.has(r.key)), [value.resources, props.visible]);\n    const rowIndex = useMemo(() => new Map(rows.map((r, i) => [r.key, i] as const)), [rows]);\n    // A resource holding a draft bin draws its load as a draft.\n    const { held, sameBin } = props;\n    const drafted = useMemo(() => {\n        const keys = new Set<string>();\n        for (const [id, bin] of plan.bins) {\n            const committed = held?.bins.get(id);\n            if (committed === undefined || !sameBin(committed, bin)) for (const key of bin.parts.keys()) keys.add(key);\n        }\n        return keys;\n    }, [plan, held, sameBin]);\n    const sizes = useMemo(() => rows.map(() => ROW_H), [rows]);\n    const getItemKey = useCallback((index: number) => rows[index]!.key, [rows]);\n    // The focus's hold, banded across the plot, its days in ink (A13).\n    const span = props.focus === undefined ? undefined : loads.get(props.focus)?.hold;\n    const focusHold = span?.type === \"some\" ? span.value : undefined;\n\n    const lanePane = useRef<HTMLDivElement | null>(null);\n    const rscPane = useRef<HTMLDivElement | null>(null);\n    const ruler = useRef<HTMLDivElement | null>(null);\n    const root = useRef<HTMLDivElement | null>(null), gridBox = useRef<HTMLDivElement | null>(null), channel = useRef<HTMLDivElement | null>(null);\n    // A drag near a pane's top or bottom scrolls it a row at a time, on the rows' grid (A25): the shared edge scroller's row step.\n    useLayoutEffect(() => { rscPane.current?.setAttribute(\"data-edge-scroll-row\", String(ROW_H)); });\n\n    // A drag (#1328, #1330): what is dragged; for a connector's, a link's, a Library arrival's or a removed bin's — or the pick's,\n    // with no drag under way (A11) — every resource's verdict, the fit's (A27–A29).\n    const { drag } = props;\n    const grip = drag.grip, subject = drag.subject;\n    const ranking = subject !== undefined && subject.kind !== \"body\" && subject.kind !== \"resource\";\n    const marking = ranking && grip !== undefined;\n    const verdicts = ranking ? drag.answer?.resources : undefined;\n    const dragged = ranking ? drag.asked : undefined;\n    // A resource card's drag (A32): the bins that refuse it, and whether a free lane hour would take a reservation of it.\n    const taking = grip?.kind === \"resource\" ? grip.resource : undefined;\n    const takes = taking === undefined ? undefined : drag.answer;\n    const reserveRefused = takes?.reserve.type === \"some\" && takes.reserve.value.type === \"refused\";\n    // A ranked fit's preview: the load it leaves, for the hold (A28) — e3-ui's candidates, never the renderer's arithmetic.\n    const answer = drag.answer;\n    const previews = useMemo(() => {\n        const out = new Map<string, { after: number; to: Date }>();\n        if (!ranking || dragged === undefined || answer === undefined) return out;\n        for (const c of props.candidates({ day, plan: dragged.of ?? plan, ask: dragged.ask, context })) out.set(c.resource.key, { after: c.after, to: c.hold.to });\n        return out;\n        // The answer stands for its question: a new question is a new answer.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [ranking, answer, plan, day, context]);\n    // Each run of contiguous rows refusing for one reason gathers under one label (A27).\n    const runs = useMemo((): RefusalRun[] => verdicts === undefined ? [] : refusalRuns(rows.map(r => verdicts.get(r.key)), words, unit), [verdicts, rows, words, unit]);\n\n    // The links (A65–A69): the focus's family, through the channel, none at rest and none on hover; during a drag, the drag's\n    // families in its place. Every link of the day is numbered once, so a drag that starts on a focus's link draws it still.\n    const ids = useMemo(() => linkIds(plan), [plan]);\n    const family = useMemo(() => props.focus === undefined ? [] : familyOf(plan, held, props.focus, ids), [plan, held, props.focus, ids]);\n    // The links the runs of the optimiser added or changed, for the highlight (#1409): outlined in the Elara tone, over the\n    // focus's family, which keeps its other links; none once the highlight ends.\n    const touched = lit && optimised !== undefined && optimised.links.size > 0 ? optimised.links : undefined;\n    const marked = useMemo(() => touched === undefined ? NO_LINKS : runLinks(plan, touched, ids), [touched, plan, ids]);\n    const shown = useMemo(() => {\n        if (marked.length === 0) return family;\n        const run = new Set(marked.map(link => link.id));\n        return [...marked, ...family.filter(link => !run.has(link.id))];\n    }, [marked, family]);\n    const linking = shown.length > 0 || grip !== undefined;\n    const laneTop = useScrollTop(lanePane, linking || saying), rowsTop = useScrollTop(rscPane, linking || marking);\n    // The fits out of view, marked at the pane's edge over the rows; a drop on it goes to the #1 (A31).\n    const [rowsView, setRowsView] = useState(0);\n    useLayoutEffect(() => { if (marking && rscPane.current !== null) setRowsView(rscPane.current.clientHeight - HEAD); }, [marking]);\n    const marker = marking ? fitsMarker(drag.ranks, rowIndex, rowsTop, rowsView, key => context.resources.get(key)?.label ?? key) : undefined;\n    // While a drag rests on a resource — its row, the fits marker, a fit in the inspector's list — its bins outline for the\n    // verdict and its run's label steps aside (A27, A29); they let go as the drag leaves it, for the channel, the head or\n    // nothing. Marked on the elements as the drag's rest moves, so pointer motion repaints no card (A35).\n    const rowIndexNow = useRef(rowIndex);\n    rowIndexNow.current = rowIndex;\n    const { rest } = drag;\n    const markRest = useCallback(() => {\n        const box = root.current;\n        if (box === null) return;\n        for (const el of box.querySelectorAll(\"[data-drop-target]\")) el.removeAttribute(\"data-drop-target\");\n        for (const el of box.querySelectorAll(\"[data-run][data-pointer]\")) el.removeAttribute(\"data-pointer\");\n        const at = rest.get();\n        if (at === undefined || at.target.kind !== \"resource\") return;\n        const resource = at.target.resource, index = rowIndexNow.current.get(resource);\n        for (const el of box.querySelectorAll(`[data-allocation-card]`)) {\n            if ((el.getAttribute(\"data-resources\") ?? \"\").split(\" \").includes(resource)) el.setAttribute(\"data-drop-target\", at.allowed ? \"fits\" : \"refused\");\n        }\n        if (index === undefined) return;\n        for (const el of box.querySelectorAll<HTMLElement>(\"[data-run]\")) {\n            if (Number(el.dataset.from) <= index && index <= Number(el.dataset.to)) el.setAttribute(\"data-pointer\", \"\");\n        }\n    }, [rest]);\n    useEffect(() => { markRest(); return rest.subscribe(markRest); }, [rest, markRest]);\n    // What mounts while the drag rests — a run's label as the fit's answer lands — is marked as it mounts.\n    useLayoutEffect(() => { if (grip !== undefined) markRest(); });\n    // Where they run: the lane grid's left edge and the channel's right edge, in the board's px, and the panes' view.\n    const [view, setView] = useState<{ gridLeft: number; channelRight: number; height: number }>();\n    useLayoutEffect(() => {\n        const box = root.current;\n        if (!linking || box === null) return undefined;\n        const measure = () => {\n            const at = box.getBoundingClientRect(), from = gridBox.current?.getBoundingClientRect(), to = channel.current?.getBoundingClientRect();\n            if (from === undefined || to === undefined) return;\n            const next = { gridLeft: from.left - at.left, channelRight: to.right - at.left, height: Math.max(0, at.height - HEAD) };\n            setView(before => before !== undefined && before.gridLeft === next.gridLeft && before.channelRight === next.channelRight && before.height === next.height ? before : next);\n        };\n        measure();\n        const observer = new ResizeObserver(measure);\n        observer.observe(box);\n        return () => observer.disconnect();\n    }, [linking]);\n    const cardOf = useMemo(() => new Map(grid.cards.map(card => [card.id, card] as const)), [grid]);\n    // Each link's words, once for the day as drafted: a drag's pointer motion says no quantity again (A35).\n    const linkWords = useMemo(() => {\n        const out = new Map<string, Map<string, LinkWords>>();\n        for (const [id, bin] of plan.bins) {\n            const code = bin.arrival.type === \"some\" ? context.arrivals.get(bin.arrival.value)?.label ?? bin.arrival.value : \"\";\n            out.set(id, new Map(partsOf(bin).map(part => [part.key, linkWordsOf(code, bin.arrival.type === \"none\" ? undefined : words.quantity(part.quantity, unit), nouns)] as const)));\n        }\n        return out;\n    }, [plan, context.arrivals, words, unit, nouns]);\n    const wordsOf = useCallback((link: FamilyLink): LinkWords => linkWords.get(link.bin)?.get(link.resource) ?? linkWordsOf(\"\", undefined, nouns), [linkWords, nouns]);\n    // The link under the pointer (A67): its bin's card and its resource's load bar ring.\n    const [linkLit, setLinkLit] = useState<FamilyLink>();\n    // Under 36px a day, its tick shows its number only.\n    const short = useContainerBelow(ruler, axis.days.length * SHORT_DAY);\n    const time = useMemo(() => timeWords(props.format.locale), [props.format.locale]);\n    const ticks = useMemo(() => timeScale({ window: { min: axis.from, max: axis.to }, resolution: \"day\", format: short ? \"DD\" : \"dd DD\", words: time })!, [axis, short, time]);\n    const weeks = useMemo(() => {\n        const units = timeRulerUnits(ticks, time, \"week\")!;\n        // `W19 · May 10` for a week that starts in view, `W18` for one cut at the axis's start.\n        return { ...units, buckets: units.buckets.map(b => ({ ...b, label: `${time.m.rulerWeek({ week: time.number(isoWeekUTC(b.start)) })}${b.start.getTime() >= axis.from.getTime() ? ` · ${props.format.monthDay(b.start)}` : \"\"}` })) };\n    }, [ticks, time, axis, props.format]);\n\n    // The hour at the top of the lane pane's view holds as the bands change (#1398, CL8): a day's bins landing grow its\n    // bands below the row in view, and a step to another day keeps the hour in view. A selection's follow, after it, wins.\n    const bandsWere = useRef<readonly LaneBand[] | undefined>(undefined);\n    useLayoutEffect(() => {\n        const pane = lanePane.current, was = bandsWere.current;\n        bandsWere.current = grid.bands;\n        if (pane === null || was === undefined) return;\n        const top = pane.scrollTop;\n        const anchor = bandAt(was, top), now = anchor === undefined ? undefined : grid.bands[anchor.slot];\n        if (anchor === undefined || now === undefined || now.row === anchor.row) return;\n        pane.scrollTop = now.row * ROW_H + Math.min(Math.max(0, top - anchor.row * ROW_H), (now.span - 1) * ROW_H);\n    }, [grid.bands]);\n\n    // Selecting follows the selection (A12): a bin scrolls the lane grid to it, a third from the top, and the resource\n    // pane so its row sits level with it, snapped to rows; a resource scrolls its row into view.\n    const selectionRef = useRef(props.selection);\n    selectionRef.current = props.selection;\n    useLayoutEffect(() => {\n        const lane = lanePane.current, rsc = rscPane.current, selection = selectionRef.current;\n        if (props.follow.nonce === 0 || lane === null || rsc === null || selection === undefined) return;\n        const rowsView = rsc.clientHeight - HEAD;\n        if (selection.type === \"resource\") {\n            const at = rowIndex.get(selection.key);\n            if (at === undefined) return;\n            const y = at * ROW_H, top = rsc.scrollTop;\n            if (y < top || y + ROW_H > top + rowsView) scrollRowsTo(rsc, Math.max(0, Math.round((y - rowsView / 3) / ROW_H) * ROW_H));\n            return;\n        }\n        if (selection.type !== \"bin\") return;\n        const card = grid.cards.find(c => c.id === selection.id);\n        if (card === undefined) return;\n        const y = card.row * ROW_H + 4, laneView = lane.clientHeight - HEAD;\n        if (y < lane.scrollTop || y + CARD_H > lane.scrollTop + laneView) lane.scrollTop = Math.max(0, Math.round((y - 4 - laneView / 3) / ROW_H) * ROW_H);\n        const resource = partsOf(card.bin)[0]?.key, at = resource === undefined ? undefined : rowIndex.get(resource);\n        if (at === undefined) return;\n        if (props.follow.soft && at * ROW_H >= rsc.scrollTop && at * ROW_H + ROW_H <= rsc.scrollTop + rowsView) return;\n        const level = y + CARD_H / 2 - lane.scrollTop;\n        const max = rsc.scrollHeight - rsc.clientHeight;\n        scrollRowsTo(rsc, Math.max(0, Math.min(Math.floor(max / ROW_H) * ROW_H, Math.round((at * ROW_H + ROW_H / 2 - level) / ROW_H) * ROW_H)));\n        // The follow request is the trigger.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [props.follow.nonce]);\n\n    // A narrowing that leaves no lane or no resource leaves nothing to plan on; a board with no resources and no narrowing\n    // is no narrowing's empty state (#1398, CL13): it draws its lanes, and no resource row.\n    if ((lanes.length === 0 && props.visibleLanes.type === \"some\") || (rows.length === 0 && props.visible.type === \"some\")) {\n        return <NarrowedEmpty styles={styles} clear={props.clearFilters} />;\n    }\n    const vars = { \"--allocation-lanes\": lanes.length, \"--allocation-rows\": grid.rows, \"--allocation-days\": axis.days.length } as CSSProperties;\n    const flags = props.issues.length === 0 ? NO_ISSUES : props.issues;\n    // The first row in view, where the day's failure or its emptiness is said once.\n    const lineBand = saying ? bandAt(grid.bands, laneTop) : undefined;\n    return <Box ref={root} css={styles.timeline} style={vars} data-allocation-timeline=\"\" data-allocation-drag={grip?.kind}\n        data-allocation-pick={props.picked && grip === undefined ? \"\" : undefined} data-reserve={reserveRefused ? \"refused\" : undefined}>\n        <Box ref={lanePane} css={styles.lanePane} data-allocation-lanes=\"\" data-edge-scroll-row={ROW_H}>\n            <Box css={styles.laneContent}>\n                <Box css={[styles.head, styles.laneHead]}>\n                    <Box data-head-caption=\"\" css={styles.headCaption}><span>{nouns.lane.one}</span><span>Hour</span></Box>\n                    {lanes.map((lane, i) => {\n                        const head = grid.heads[i]!;\n                        const minute = head.first === undefined ? \"\" : formatDatePattern(\"mm\", head.first);\n                        return <Box key={lane.key} css={styles.laneHeadCell} data-allocation-lane={lane.key}>\n                            <Box as=\"span\" css={styles.laneName} title={`${lane.label} takes one ${one(nouns.bin)} at :${minute} past each ${value.every.type === \"hours\" ? \"hour\" : \"slot\"}`}>\n                                {lane.label}<Box as=\"span\" css={styles.laneOffset}>at :{minute}</Box>\n                            </Box>\n                            {/* A day not read yet: its figures a placeholder; failed, blank (#1398). A run of the optimiser that changed the lane's bins flashes them (#1409). */}\n                            <Box as=\"span\" css={styles.laneMeta} title={`${nouns.bin.other} booked in this ${one(nouns.lane)} today${unit === \"\" ? \"\" : ` · ${unit}`}`}\n                                data-pending={unread ? \"\" : undefined} data-opn={lit && optimised?.lanes.has(lane.key) === true ? \"\" : undefined}>\n                                {unread ? pending && <PlaceholderShape kind=\"aggregate\" index={i} /> : <>{counted(head.bins, nouns.bin)} · {words.quantity(head.quantity, unit)}</>}\n                            </Box>\n                        </Box>;\n                    })}\n                </Box>\n                <Box ref={gridBox} css={styles.laneGrid} data-allocation-grid=\"\" data-allocation-unread={unread ? read.state : undefined}>\n                    {/* The cells first, so the bands' rules draw over a cell's wash. */}\n                    {grid.cells.map(cell => <LaneCellView key={`${cell.lane}:${cell.slot}`} props={props} lane={lanes[cell.lane]!.key} at={cell.at} free={cell.free && !unread}\n                        wash={pending} style={{ \"--cell-lane\": cell.lane, \"--cell-row\": grid.bands[cell.slot]!.row, \"--cell-span\": grid.bands[cell.slot]!.span } as CSSProperties} />)}\n                    {grid.bands.map(band => <Box key={band.slot} css={styles.laneBand} style={{ \"--band-row\": band.row, \"--band-span\": band.span } as CSSProperties} data-allocation-band={band.slot}>\n                        <Box as=\"span\" css={styles.laneHour}>{formatDatePattern(value.every.type === \"hours\" ? \"HH\" : \"HH:mm\", band.at)}</Box>\n                    </Box>)}\n                    {grid.cards.map(card => <Card key={card.id} card={card} props={props} lines={lines} flags={flags} lit={linkLit?.bin === card.id}\n                        refuses={taking !== undefined && !card.bin.parts.has(taking) && takes?.bins.get(card.id)?.type === \"refused\"} op={optimised?.ops.get(card.id)} />)}\n                    {/* The ghosts (#1409, R15): where a bin a run moved or removed stood, a dashed card of its words for the highlight, which nothing drags or selects. */}\n                    {grid.ghosts.map(place => {\n                        const ghost = ghosts[place.ghost]!;\n                        return <Box key={`ghost:${ghost.id}`} css={styles.card} data-allocation-ghost={ghost.id} data-op={ghost.op} aria-hidden=\"true\" title={`${ghost.title} · ${ghost.where}`}\n                            style={{ \"--card-lane\": place.lane, \"--card-row\": place.row } as CSSProperties}>\n                            <Box as=\"span\" css={styles.cardTop}><Box as=\"span\" css={styles.cardCode}>{ghost.label}</Box></Box>\n                            <Box as=\"span\" css={styles.cardLine}><Box as=\"span\" css={styles.cardTo}>{ghost.where}</Box></Box>\n                        </Box>;\n                    })}\n                    {/* Said once, across the lane cells of the first row in view (#1398): why the day could not be read, with\n                        Retry (CL11), or that a started day has no bins, and how to book one (CL13). */}\n                    {lineBand !== undefined && <Box css={styles.readLine} style={{ \"--band-row\": lineBand.row } as CSSProperties} data-allocation-read-line={read.state === \"failed\" ? \"failed\" : \"empty\"}>\n                        {read.state === \"failed\" ? <LoadingFailedLine message={read.message} retry={{ onRetry: read.retry }} />\n                            : empty !== undefined && <LoadingEmptyLine icon={faInbox} message={empty.message} hint={empty.hint} />}\n                    </Box>}\n                </Box>\n            </Box>\n        </Box>\n        <Box ref={channel} css={styles.channel} data-allocation-channel=\"\">\n            <Box css={styles.channelHead} title=\"Links run through this channel\"><span /><span><FontAwesomeIcon icon={faLink} /></span></Box>\n        </Box>\n        <VirtualRows fillParent height={undefined} maxHeight={undefined} rootCss={styles.resourcePane} minWidth={`calc(${LABEL_W}px + ${axis.days.length * MIN_DAY}px)`}\n            scrollElRef={rscPane} headerZIndex={6} count={rows.length} getItemKey={getItemKey} sizes={sizes} measureRows={false}\n            // An element even with nothing in it: the overlay's box is drawn with the rows, so its class is there before the drag that first fills it (#1594).\n            overlay={<>\n                {runs.map(run => <Box key={run.from} css={styles.runLabel} title={run.tip} data-run=\"\" data-from={run.from} data-to={run.to}\n                    style={{ top: `${(run.from + run.to + 1) * ROW_H / 2 - 10}px` }}>\n                    <FontAwesomeIcon icon={faXmark} aria-hidden=\"true\" />{run.label}<Box as=\"span\" css={styles.runMeta}>{run.meta}</Box>\n                </Box>)}\n                {marker !== undefined && <FitsMarker props={props} marker={marker} top={marker.side === \"above\" ? rowsTop + 12 : rowsTop + Math.max(0, rowsView - 40)} />}\n            </>}\n            header={<Box css={[styles.head, styles.resourceHead]} data-allocation-resource-head=\"\">\n                <Box data-head-caption=\"\" css={styles.headCaption}><span>Week</span><span>{nouns.resource.one}</span></Box>\n                <Box ref={ruler} css={styles.ruler}>\n                    <TimeRulerRow scale={weeks} styles={styles} band=\"units\" owner=\"allocation\" />\n                    <TimeRulerRow scale={ticks} styles={styles} band=\"ticks\" owner=\"allocation\" highlight={axis.today}\n                        marked={bucket => focusHold !== undefined && bucket.start.getTime() >= day.getTime() && bucket.start.getTime() < focusHold.to.getTime()} />\n                </Box>\n            </Box>}\n            renderRow={index => {\n                const resource = rows[index]!;\n                const rank = drag.ranks.indexOf(resource.key);\n                return <ResourceRowView resource={resource} line={lines.get(resource.key)!} load={loads.get(resource.key)!} axis={axis} props={props}\n                    focusHold={focusHold} draft={drafted.has(resource.key)} lit={linkLit?.resource === resource.key} op={lit && optimised?.resources.has(resource.key) === true}\n                    verdict={verdicts?.get(resource.key)} rank={ranking && rank >= 0 ? rank + 1 : undefined} preview={previews.get(resource.key)}\n                    quantity={dragged?.quantity} today={pending} />;\n            }} />\n        {view !== undefined && linking && <TimelineLinks props={props} family={shown} ids={ids} cards={cardOf} rows={rowIndex} under={marked.length > 0 && grip === undefined}\n            view={{ ...view, laneTop, rowsTop }} words={wordsOf} onLit={setLinkLit} />}\n        {view !== undefined && grip !== undefined && <PointerLines props={props} root={root} cards={cardOf} rows={rowIndex} view={{ ...view, laneTop, rowsTop }} />}\n    </Box>;\n}\n\n/** A link's words (A67, A68): its bin's code, its quantity, its name (`LD-2232, 4 m³`) and its ghost's (`LD-2232 · 4 m³`). */\ninterface LinkWords { code: string; quantity: string | undefined; name: string; ghost: string }\n\n/** A link's words from its bin's code and its quantity; a reservation's has none: `the reservation`, `Reserved`. */\nfunction linkWordsOf(code: string, quantity: string | undefined, nouns: Nouns): LinkWords {\n    return quantity === undefined ? { code, quantity, name: `the ${one(nouns.reservation)}`, ghost: nouns.reserved } : { code, quantity, name: `${code}, ${quantity}`, ghost: `${code} · ${quantity}` };\n}\n\n/** A routed link of the Timeline's: the ribbon and its link. */\ntype TimelineRibbon = ReturnType<typeof layoutLinks>[number];\nconst linkOf = (ribbon: LinkRibbon): FamilyLink => (ribbon as TimelineRibbon).link;\n\n/** What the links read of the Timeline (A65–A69). */\ninterface TimelineLinksProps {\n    props: TimelineProps;\n    /** What draws with no drag under way: the focus's family, and the runs' links for the highlight (#1409). */\n    family: readonly FamilyLink[];\n    /** Whether the layer runs behind the cards (#1409): while a run's links show, so its many links pass under the cards they cross, never over their words. */\n    under: boolean;\n    ids: LinkIds;\n    cards: ReadonlyMap<string, LaneCard>;\n    rows: ReadonlyMap<string, number>;\n    view: LinkView;\n    words: (link: FamilyLink) => LinkWords;\n    /** Hears the link under the pointer (A67), `undefined` for none. */\n    onLit: (link: FamilyLink | undefined) => void;\n}\n\n/**\n * The links over the panes (A65–A69): the focus's family at rest — lit,\n * selected, unlinked by its ×; during a drag, the drag's families in its\n * place: the dragged bin's resource's, the link it moves faded to its `was`\n * line, and the family of the resource the drag rests on, in the drop's\n * verdict. It reads where the drag rests itself, so nothing else of the board\n * renders as the drag moves (A35). Each link's line and caption is a grip.\n */\nfunction TimelineLinks({ props, family, ids, cards, rows, view, words, onLit, under }: TimelineLinksProps) {\n    const { drag, styles, plan, held } = props;\n    const { grip } = drag;\n    const nouns = useNouns();\n    const rest = useSyncExternalStore(drag.rest.subscribe, drag.rest.get, drag.rest.get);\n    const current = grip === undefined ? undefined : currentOf(plan, grip);\n    const moved = grip === undefined ? undefined : movedLinkOf(plan, grip);\n    // The resource the drag rests on, unless it is the dragged bin's own, and the drop's verdict there; a body's drag draws its own family alone.\n    let target: DragTarget | undefined;\n    if (grip !== undefined && grip.kind !== \"body\" && rest !== undefined && rest.target.kind === \"resource\" && rest.target.resource !== current) {\n        const verdict = drag.peek(grip, rest.target);\n        target = { resource: rest.target.resource, verdict: verdict.pending ? undefined : verdict.allowed ? \"fits\" : \"refused\" };\n    }\n    const atRest = grip === undefined;\n    const links = atRest ? family : dragFamilies(plan, held, ids, current, moved, target);\n    const selected = props.link === undefined ? undefined : ids.get(props.link.bin)?.get(props.link.resource);\n    const was = moved === undefined ? undefined : ids.get(moved.bin)?.get(moved.resource);\n    // The selected link is drawn a px heavier, in the ink, at rest only: during a drag its caption keeps its outline alone.\n    const ribbons = layoutLinks(links, cards, rows, view, link => words(link).quantity, atRest ? selected : undefined);\n    const scope: GripScope = { drag, styles, words, select: link => props.selectLink({ bin: link.bin, resource: link.resource }) };\n    if (ribbons.length === 0) return null;\n    const isSelected = (ribbon: LinkRibbon) => selected === ribbon.id;\n    return <GripContext.Provider value={scope}>\n        <Box css={styles.links} data-allocation-links=\"\" data-under={under ? \"\" : undefined} style={{ height: view.height }}>\n            <LinksLayer ribbons={ribbons} width={view.channelRight} height={view.height} halo={false} lights={atRest}\n                onLit={id => onLit(id === null ? undefined : links.find(link => link.id === id))}\n                clip={{ left: view.gridLeft + HOUR_W, width: Math.max(0, view.channelRight - view.gridLeft - HOUR_W) }}\n                selected={selected} preview={was === undefined ? undefined : { was, line: undefined }}\n                onUnlink={atRest && props.editable ? id => { const link = links.find(l => l.id === id); if (link !== undefined) props.unlink(link.bin, link.resource); } : undefined}\n                unlinkLabel={ribbon => `Unlink ${words(linkOf(ribbon)).code} · Delete`}\n                grip={drag.enabled ? LinkGrip : undefined}\n                hit={ribbon => {\n                    const link = linkOf(ribbon), name = words(link).name;\n                    return { \"data-allocation-link\": `${link.bin}|${link.resource}`, \"aria-label\": `${isSelected(ribbon) ? \"Selected link\" : \"Link\"} of ${name}`,\n                        children: <title>{`Link of ${name} · click to select`}</title>, onClick: () => props.selectLink({ bin: link.bin, resource: link.resource }) };\n                }}\n                caption={ribbon => {\n                    const link = linkOf(ribbon), name = words(link).name, chosen = isSelected(ribbon);\n                    return { role: \"button\", \"aria-label\": `${chosen ? \"Selected link\" : \"Link\"} of ${name}`, \"data-allocation-caption\": `${link.bin}|${link.resource}`,\n                        title: !props.editable ? `Link of ${name}` : chosen ? \"Selected · × or Delete removes the link\" : `Click to select the link, then Delete · drag onto ${a(nouns.resource)} row to move it`,\n                        onClick: () => props.selectLink({ bin: link.bin, resource: link.resource }) };\n                }} />\n        </Box>\n    </GripContext.Provider>;\n}\n\n/** What a link's grip reads of the board: its drags, its look, each link's words, and selecting a link. */\ninterface GripScope {\n    drag: AllocationDrag;\n    styles: AllocationStyles;\n    words: (link: FamilyLink) => LinkWords;\n    select: (link: FamilyLink) => void;\n}\nconst GripContext = createContext<GripScope | null>(null);\n\n/**\n * A link's grip (A69): its line, or its caption, picks the link's part up as\n * the board's drag of it — the shared drag's handle spread on it, its ghost\n * the part's words, `LD-2232 · 4 m³` — as a card's body or its connector does.\n * One component the layer keeps, so a drag it starts outlives the families the\n * drag draws in the focus's place. A link with a caption is one control, its\n * caption — its line holds the drag for the pointer alone — and a reservation's\n * link, which has none, its line: Enter selects the link (A68), Space picks it up.\n */\nfunction LinkGrip({ ribbon, part, render }: LinkGripProps) {\n    const scope = useContext(GripContext);\n    const link = linkOf(ribbon);\n    const { bin, resource } = link;\n    const enabled = scope?.drag.enabled === true, surface = scope?.drag.surface ?? \"\";\n    const at = useMemo(() => enabled ? gripCoord(surface, { kind: \"link\", bin, resource }) : null, [enabled, surface, bin, resource]);\n    const label = scope === null ? \"\" : scope.words(link).ghost;\n    const styles = scope?.styles;\n    const ghost = useMemo(() => styles === undefined ? null : <MoveGhost styles={styles} label={label} />, [styles, label]);\n    const handle = useDragEventChip(at, ghost, false, label);\n    if (scope === null || handle === undefined) return <>{render({})}</>;\n    const { ref, onPointerDown, onKeyDown, ...control } = handle;\n    const grip: BoardGrip = { kind: \"link\", bin, resource };\n    const pointer = { ref, \"data-scope\": \"allocation\", \"data-allocation-grip\": \"\", onPointerDown: (event: ReactPointerEvent<SVGElement>) => { scope.drag.arm(grip); onPointerDown?.(event); } };\n    if (part === \"line\" && ribbon.label !== undefined) return <>{render(pointer)}</>;\n    return <>{render({\n        ...pointer, ...control,\n        onKeyDown: event => {\n            if (event.key === \"Enter\") { takeKey(event); scope.select(link); return; }\n            if (event.key === \" \") scope.drag.arm(grip);\n            onKeyDown?.(event);\n        },\n    })}</>;\n}\n\n/** No links of its own: the layer over the panes that draws what follows the pointer. */\nconst NO_RIBBONS: readonly LinkRibbon[] = [];\nconst NO_LINES: readonly LinkLine[] = [];\nconst NO_CLIP = { left: 0, width: 0 };\nconst NO_HIT = () => ({});\n\n/**\n * What follows the pointer through a drag (A69, A30): a link's or a\n * connector's new line from its card to the pointer, or an arrival's lines\n * from the pointer into its three best fits' rows — the only part of the board\n * drawn again as the pointer moves (A35). A keyboard's drag has no pointer to\n * follow, and draws neither.\n */\nfunction PointerLines({ props, root, cards, rows, view }: {\n    props: TimelineProps; root: RefObject<HTMLDivElement | null>; cards: ReadonlyMap<string, LaneCard>; rows: ReadonlyMap<string, number>; view: LinkView;\n}) {\n    const { drag, styles } = props;\n    const { grip } = drag;\n    const card = grip !== undefined && (grip.kind === \"link\" || grip.kind === \"port\") ? cards.get(grip.bin) : undefined;\n    const ranking = grip !== undefined && (grip.kind === \"arrival\" || grip.kind === \"removed\");\n    const at = useDragPointer(root, card !== undefined || ranking);\n    if (at === undefined) return null;\n    const line = card === undefined ? undefined : dragLine(cardEnd(card, view), at.x, at.y, view);\n    const guides = ranking ? guideLines(at.x, at.y, drag.ranks, rows, view) : NO_LINES;\n    if (line === undefined && guides.length === 0) return null;\n    return <Box css={styles.linkLines} data-allocation-link-lines=\"\" style={{ height: view.height }}>\n        <LinksLayer ribbons={NO_RIBBONS} width={view.channelRight} height={view.height} clip={NO_CLIP} hit={NO_HIT} preview={{ was: undefined, line }} guides={guides} />\n    </Box>;\n}\n\n/**\n * Where the pointer carrying a drag is, in the links' layer's px — the board's\n * box under its head — as it moves; `undefined` until it moves, or while `on`\n * is off. A pointer whose buttons are up carries no drag: a mouse moved during\n * a keyboard's drag draws nothing.\n */\nfunction useDragPointer(root: RefObject<HTMLDivElement | null>, on: boolean): { x: number; y: number } | undefined {\n    const [at, setAt] = useState<{ x: number; y: number }>();\n    useEffect(() => {\n        if (!on) return undefined;\n        const move = (event: PointerEvent) => {\n            const box = root.current;\n            if (box === null || event.buttons === 0) return;\n            const r = box.getBoundingClientRect();\n            setAt({ x: event.clientX - r.left, y: event.clientY - r.top - HEAD });\n        };\n        document.addEventListener(\"pointermove\", move, { passive: true });\n        return () => { document.removeEventListener(\"pointermove\", move); setAt(undefined); };\n    }, [on, root]);\n    return on ? at : undefined;\n}\n\ninterface CardProps {\n    card: LaneCard; props: TimelineProps; lines: ReadonlyMap<string, ResourceLine>; flags: readonly Issue[]; lit: boolean;\n    /** During a resource card's drag, whether the fit refuses this bin on it (A32). */\n    refuses: boolean;\n    /** What a run of the optimiser did to the bin (#1409, R7, R17), while it is still the run's draft: its mark, and its provenance on hover. */\n    op: AllocationBinOp | undefined;\n}\ntype DragHandle = ReturnType<typeof useDragEventChip>;\n\n/**\n * A bin's card (A16, A21): the shared drag hooks here, outside the card's\n * body, so pointer motion repaints nothing in it (A35, the Roster's chips).\n */\nfunction Card(args: CardProps) {\n    const { card, props } = args;\n    const { styles, context, drag } = props;\n    const { id, bin } = card;\n    const words = allocationWords();\n    const arrival = bin.arrival.type === \"some\" ? context.arrivals.get(bin.arrival.value) : undefined;\n    const code = bin.arrival.type === \"none\" ? undefined : arrival?.label ?? bin.arrival.value;\n    const nouns = useNouns();\n    const label = useMemo(() => code === undefined ? nouns.reserved : `${code} · ${words.quantity(bin.quantity, context.unit)}`, [code, nouns.reserved, words, bin.quantity, context.unit]);\n    // The card body drags the bin between lane hours (A24); its connector drags what it carries onto a resource (A21).\n    const ghost = useMemo(() => <MoveGhost styles={styles} label={label} />, [styles, label]);\n    const bodyAt = useMemo(() => drag.enabled ? gripCoord(drag.surface, { kind: \"body\", bin: id }) : null, [drag.enabled, drag.surface, id]);\n    const portAt = useMemo(() => drag.enabled ? gripCoord(drag.surface, { kind: \"port\", bin: id }) : null, [drag.enabled, drag.surface, id]);\n    const body = useDragEventChip(bodyAt, ghost, false, label);\n    const port = useDragEventChip(portAt, ghost, false, label);\n    // A card is its lane hour's drop target too, and a reservation's a bin fills (A38).\n    const { veto, options } = dropTarget(drag, { kind: \"lane\", lane: bin.lane, at: card.slotAt, card: id });\n    const drop = useDropCell(drag.enabled ? laneCoord(drag.surface, bin.lane, card.slotAt, id) : null, false, veto, undefined, options);\n    // The card takes the keyboard a pick in Search Records gives its bin (#1398).\n    const given = useBinFocusTarget<HTMLElement>(id);\n    const bodyRef = body?.ref;\n    const attach = useCallback((el: HTMLElement | null) => { bodyRef?.(el); drop(el); given.current = el; }, [bodyRef, drop, given]);\n    return <CardBody {...args} body={body} port={port} attach={attach} />;\n}\n\n/** A card's body: what it says, from the drafts and the issues. */\nconst CardBody = memo(function CardBody({ card, props, lines, flags, lit, refuses, op: marked, body, port, attach }: CardProps & { body: DragHandle; port: DragHandle; attach: (el: HTMLElement | null) => void }) {\n    const { styles, context, value, drag } = props;\n    const { id, bin } = card;\n    const words = allocationWords();\n    const nouns = useNouns();\n    const reserved = bin.arrival.type === \"none\";\n    const arrival = bin.arrival.type === \"some\" ? context.arrivals.get(bin.arrival.value) : undefined;\n    const code = reserved ? nouns.reserved : arrival?.label ?? (bin.arrival.type === \"some\" ? bin.arrival.value : \"\");\n    const parts = partsOf(bin);\n    const resource = parts[0] === undefined ? undefined : context.resources.get(parts[0].key);\n    const line = resource === undefined ? undefined : lines.get(resource.key);\n    const committed = props.held?.bins.get(id);\n    const draft = committed === undefined || !props.sameBin(committed, bin);\n    const linkDraft = draft && (committed === undefined || !sameParts(committed.parts, bin.parts));\n    // A run's mark holds while the bin is still the run's draft (R17): an Undo that takes the run back leaves none.\n    const op = draft ? marked : undefined;\n    // Selected, or one of the bins the Library's Allocated card highlights (A10).\n    const selected = (props.selection?.type === \"bin\" && props.selection.id === id) || (props.highlight !== undefined && bin.arrival.type === \"some\" && bin.arrival.value === props.highlight);\n    // Outside the focus, a card dims (A13): any but the selected one and the focus's own.\n    const dimming = props.selection?.type === \"bin\" || props.selection?.type === \"resource\";\n    const dim = dimming && !selected && (props.focus === undefined || !bin.parts.has(props.focus));\n    const lane = value.lanes.find(l => l.key === bin.lane)?.label ?? bin.lane;\n    const at = `${lane} ${formatDatePattern(\"HH:mm\", bin.at)}`;\n    const qty = words.quantity(bin.quantity, context.unit);\n    const to = resource === undefined ? \"\" : `${resource.label}${parts.length > 1 ? ` + ${parts.length - 1}` : \"\"}`;\n    // What its parts leave unallocated (A70): after where it is, in warn-text, cut with the line where the card cuts it; the tooltip says it whole.\n    const remainder = reserved ? 0 : remainderOf(bin);\n    const left = resource !== undefined && compareFloat(remainder, 0) > 0 ? `${words.quantity(remainder, context.unit)} unallocated` : undefined;\n    const moves = props.editable ? ` · drag to another ${one(nouns.lane)} hour to move it` : \"\";\n    const tip = reserved\n        ? `${nouns.reserved} · ${at}${resource === undefined ? \"\" : ` on ${resource.label}`} · no ${one(nouns.arrival)} yet${moves}`\n        : `${code}${arrival?.meta.type === \"some\" ? ` · ${arrival.meta.value}` : \"\"} · ${qty} · ${at}${resource === undefined ? \" · not linked\" : ` on ${to}`}${left === undefined ? \"\" : ` · ${left}`}${moves}`;\n    const marks: ReactNode[] = [];\n    for (const issue of flags) {\n        if (issue.bin.type === \"some\" && issue.bin.value === id && issue.flag.type === \"some\") {\n            marks.push(<Box key={`flag:${marks.length}`} as=\"span\" css={styles.cardMark} data-mark=\"flag\" title={issue.title}>{issue.flag.value}</Box>);\n        }\n    }\n    if (line?.overlap === true && !line.over) marks.push(<Box key=\"overlap\" as=\"span\" css={styles.cardMark} data-mark=\"overlap\" title=\"Overlaps the next job\"><FontAwesomeIcon icon={faTriangleExclamation} aria-label=\"Overlaps the next job\" /></Box>);\n    if (line?.over === true) marks.push(<Box key=\"over\" as=\"span\" css={styles.cardMark} data-mark=\"over\" title=\"Over max\"><FontAwesomeIcon icon={faCircleExclamation} aria-label=\"Over max\" /></Box>);\n    if (line?.under === true && !line.over && resource !== undefined) {\n        const load = props.loads.get(resource.key)!;\n        const why = `${resource.label} is under its minimum: ${words.load(load.fill, resource, context.unit)}`;\n        marks.push(<Box key=\"under\" as=\"span\" css={styles.cardMark} data-mark=\"under\" title={why}><FontAwesomeIcon icon={faArrowDown} aria-label=\"Under minimum\" /></Box>);\n    }\n    const connector = resource === undefined\n        ? `Drag the connector onto ${a(nouns.resource)} to allocate ${reserved ? `this ${one(nouns.reservation)}` : code} · click to choose one`\n        : `${nouns.groups.allocated} to ${to} · drag the connector onto ${a(nouns.resource)} to move it · click to choose another`;\n    return <Box {...body} ref={attach} css={styles.card} role=\"button\" tabIndex={0} title={op === undefined ? tip : `${op.provenance} · ${tip}`} aria-label={tip} aria-pressed={selected}\n        data-scope=\"allocation\" data-allocation-card={id} data-resources={parts.map(p => p.key).join(\" \")} data-reserved={reserved ? \"\" : undefined}\n        data-draft={draft ? \"\" : undefined} data-conflict={props.conflicted?.(id) === true ? \"\" : undefined} data-bounds={props.bounded?.(id) === true ? \"\" : undefined}\n        data-selected={selected ? \"\" : undefined} data-dim={dim ? \"\" : undefined} data-link-lit={lit ? \"\" : undefined}\n        data-refuses={refuses ? \"\" : undefined} data-op={op?.op} data-fill={op === undefined ? undefined : \"own\"}\n        data-draggable={body !== undefined ? \"\" : undefined} style={{ \"--card-lane\": card.lane, \"--card-row\": card.row } as CSSProperties}\n        onPointerDown={event => { drag.arm({ kind: \"body\", bin: id }); body?.onPointerDown?.(event); }}\n        onClick={() => props.select({ type: \"bin\", id })}\n        onKeyDown={event => { if (event.key === \"Enter\") { takeKey(event); props.select({ type: \"bin\", id }); } else { if (event.key === \" \") drag.arm({ kind: \"body\", bin: id }); body?.onKeyDown?.(event); } }}>\n        <Box as=\"span\" css={styles.cardTop}>\n            <Box as=\"span\" css={styles.cardCode} data-allocation-code=\"\">{code}</Box>\n            {!reserved && <Box as=\"span\" css={styles.cardQty}>{qty}</Box>}\n        </Box>\n        <Box as=\"span\" css={styles.cardLine}>\n            <Box as=\"span\" css={styles.cardTo} data-allocation-to=\"\">\n                {resource === undefined\n                    ? <><FontAwesomeIcon icon={faLinkSlash} /><span data-unlinked=\"\">not linked</span></>\n                    : <><FontAwesomeIcon icon={faArrowRight} />{to}{left !== undefined && <> · <Box as=\"span\" css={styles.cardLeft} data-allocation-left=\"\">{left}</Box></>}</>}\n            </Box>\n            {marks}\n        </Box>\n        {props.editable && <chakra.button type=\"button\" {...port} css={styles.connector} aria-label={connector} title={connector} data-allocation-connector={id}\n            onPointerDown={event => { event.stopPropagation(); drag.arm({ kind: \"port\", bin: id }); port?.onPointerDown?.(event); }}\n            onKeyDown={event => { event.stopPropagation(); if (event.key === \" \") { drag.arm({ kind: \"port\", bin: id }); port?.onKeyDown?.(event); } }}\n            onClick={event => { event.stopPropagation(); props.choose(id); }}>\n            <Box as=\"span\" css={styles.connectorMark} data-state={resource === undefined ? \"unlinked\" : linkDraft ? \"draft\" : undefined} />\n        </chakra.button>}\n    </Box>;\n});\n\ninterface ResourceRowProps {\n    resource: ResourceRow; line: ResourceLine; load: Load; axis: ResourceAxis; props: TimelineProps; focusHold: { from: Date; to: Date } | undefined; draft: boolean; lit: boolean;\n    /** Whether a run of the optimiser added or changed a link into it, for the highlight (#1409): its load takes the landing and the glow with the cards. */\n    op: boolean;\n    /** During a connector's or a link's drag: the fit's verdict here, its rank among the three best, the load it would leave for the hold, and the quantity it carries. */\n    verdict: Fit | undefined; rank: number | undefined; preview: { after: number; to: Date } | undefined; quantity: number | undefined;\n    /**\n     * Whether today's load is a placeholder (#1398): a day not read yet — a rect where the load starts, the plan day's,\n     * unseen until the frame's reveal says so; its line meanwhile says what is known without the day's read, its min and\n     * its max.\n     */\n    today: boolean;\n}\n\n/**\n * Today's load on a day not read yet (#1398): a placeholder rect where the load starts, the plan day's — unseen at its\n * footprint until the frame's one reveal clock says so, which it reads itself, so the clock's flip renders it alone (CL4).\n */\nfunction PendingLoad({ styles, at }: { styles: AllocationStyles; at: CSSProperties }) {\n    const hidden = useRevealed() === false ? \"\" : undefined;\n    return <Box css={styles.bar} style={at} data-kind=\"pending\" data-allocation-load-pending=\"\" data-unrevealed={hidden} aria-hidden=\"true\" />;\n}\n\n/** A resource's row (A18–A20): a drop target for a connector or a link (A39), and a body's refusal (§10) — its hook outside the row's body (A35). */\nfunction ResourceRowView(args: ResourceRowProps) {\n    const { drag } = args.props;\n    const { veto, options } = dropTarget(drag, { kind: \"resource\", resource: args.resource.key });\n    const drop = useDropCell(drag.enabled ? rowCoord(drag.surface, args.resource.key) : null, false, veto, undefined, options);\n    return <ResourceRowBody {...args} drop={drop} />;\n}\n\n/** A resource's row: its label cell and its plot. */\nconst ResourceRowBody = memo(function ResourceRowBody({ resource, line, load, axis, props, focusHold, draft, lit, op, verdict, rank, preview, quantity, today, drop }: ResourceRowProps & { drop: (el: HTMLElement | null) => void }) {\n    const { styles, context, day } = props;\n    const words = allocationWords();\n    const reservedWord = useNouns().reserved;\n    const focus = props.focus === resource.key;\n    // With an arrival picked, a click on a ranked resource books it onto it (A11, A36).\n    const select = () => { if (props.picked && rank !== undefined && props.editable) props.book({ kind: \"resource\", resource: resource.key }); else props.select({ type: \"resource\", key: resource.key }); };\n    const shades = useMemo(() => shadeBands({ min: axis.from, max: axis.to }, {}), [axis]);\n    const mondays = useMemo(() => axis.days.filter((d, i) => i > 0 && d.getUTCDay() === 1), [axis]);\n    const hold = load.hold.type === \"some\" ? load.hold.value : undefined;\n    const bar = (key: string, from: Date, to: Date, attrs: Record<string, string | undefined>, label: string) => {\n        const at = axisSpan(axis, from, to);\n        return at === undefined ? null : <Box key={key} css={styles.bar} style={at} {...attrs}><Box as=\"span\" css={styles.barLabel}>{label}</Box></Box>;\n    };\n    // What a refusal is about, outlined (A27): the load for an amount (`over max by 4 m³`), the job a day names (`busy until`, `next job`).\n    const measure = verdict?.type === \"refused\" ? verdict.value.measure : undefined;\n    const about = (job: { start: Date; end: Date }) => measure?.type === \"day\" && (compareDate(job.start, measure.value.at) === 0 || compareDate(job.end, measure.value.at) === 0);\n    const loadSpan = hold === undefined ? undefined : axisSpan(axis, day, hold.to);\n    const overlap = line.overlap && line.next.type === \"some\" && hold !== undefined ? axisSpan(axis, line.next.value.start, hold.to) : undefined;\n    const focusSpan = focusHold === undefined ? undefined : axisSpan(axis, day, focusHold.to);\n    const previewSpan = rank === undefined || preview === undefined ? undefined : axisSpan(axis, day, preview.to);\n    const todaySpan = today ? axisSpan(axis, day, new Date(day.getTime() + DAY)) : undefined;\n    return <Box ref={drop} css={styles.resourceRow} role=\"button\" tabIndex={0} aria-label={`${resource.label}, ${line.text}`} aria-pressed={focus}\n        data-allocation-resource={resource.key} data-selected={focus ? \"\" : undefined} data-refused={verdict?.type === \"refused\" ? \"\" : undefined}\n        data-ranked={rank !== undefined ? \"\" : undefined} onClick={select} onKeyDown={onActivate(select)}>\n        <Box css={styles.resourceLabel}>\n            {rank !== undefined && <Box as=\"span\" css={styles.rank} data-allocation-rank=\"\">{rank}</Box>}\n            <Box css={styles.resourceText}>\n                <Box as=\"span\" css={styles.resourceName}>{resource.label}</Box>\n                <Box as=\"span\" css={styles.resourceLine} data-tone={line.tone.type === \"neutral\" ? undefined : line.tone.type} data-allocation-line=\"\">{line.text}</Box>\n            </Box>\n        </Box>\n        <Box css={styles.plot} data-allocation-plot=\"\">\n            {focusSpan !== undefined && <Box css={styles.span} style={focusSpan} data-allocation-span=\"\" />}\n            {shades.map((band, i) => <Box key={i} css={styles.shade} style={{ left: `${band.start * 100}%`, width: `${band.width * 100}%` }} />)}\n            {mondays.map(monday => <Box key={monday.getTime()} css={styles.weekRule} style={{ left: `${axisFraction(axis, monday) * 100}%` }} />)}\n            {resource.jobs.map((job, i) => bar(`job:${i}`, job.start, job.end,\n                { \"data-kind\": job.start.getTime() <= day.getTime() ? \"prior\" : \"next\", \"data-refusal\": about(job) ? \"\" : undefined }, job.label))}\n            {/* A run's link into it, for the highlight (#1409): its load takes the landing's flare and the steady glow, its own fill kept. */}\n            {loadSpan !== undefined && hold !== undefined && <Box css={styles.bar} style={loadSpan} data-kind=\"load\" data-allocation-load=\"\"\n                data-draft={draft ? \"\" : undefined} data-over={line.over ? \"\" : undefined} data-focus={focus ? \"\" : undefined} data-link-lit={lit ? \"\" : undefined}\n                data-refusal={measure?.type === \"amount\" ? \"\" : undefined} data-op={op ? \"chg\" : undefined} data-fill={op ? \"own\" : undefined}>\n                <Box as=\"span\" css={styles.barLabel}>{load.fill > 0 ? words.quantity(load.fill, context.unit) : lower(reservedWord)}</Box>\n            </Box>}\n            {/* Today's load, a day not read yet: a placeholder rect where it starts (#1398). */}\n            {todaySpan !== undefined && <PendingLoad styles={styles} at={todaySpan} />}\n            {overlap !== undefined && <Box css={styles.overlap} style={overlap} data-allocation-overlap=\"\" />}\n            {/* A ranked fit's preview: what it would hold, for the hold (A28). */}\n            {previewSpan !== undefined && quantity !== undefined && <Box css={styles.bar} style={previewSpan} data-kind=\"preview\" data-allocation-preview=\"\">\n                <Box as=\"span\" css={styles.barLabel}>+{words.quantity(quantity, context.unit)} · {words.quantity(preview!.after, context.unit)}</Box>\n            </Box>}\n            <NowLine styles={styles} at={axisFraction(axis, day)} data-allocation-now=\"\" />\n            {/* Its reason, ranked or under the pointer (A29). */}\n            {verdict !== undefined && <Box as=\"span\" css={styles.reason} data-allocation-reason=\"\" data-refused={verdict.type === \"refused\" ? \"\" : undefined}>\n                {verdict.type === \"refused\" ? <><FontAwesomeIcon icon={faXmark} aria-label=\"Doesn't fit\" /> {verdict.value.reason}</> : verdict.value.why}\n            </Box>}\n        </Box>\n    </Box>;\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useMemo } from \"react\";\nimport { AllocationLayoutType } from \"@elaraai/e3-ui/internal\";\nimport { usePageView } from \"../shared/schedule/page-view.js\";\nimport { shownView, shownViews } from \"../shared/views.js\";\nimport { DAY, dayStart, type AllocationValue, type AllocationView } from \"./model.js\";\n\n/**\n * The board's view: its layout and its day, the first the payload's, today by default — the page's own (#1398,\n * `shared/schedule/page-view.ts`), as the window it writes into its source is: another page keeping a view moves\n * neither, and a reload opens on the view kept last under the board's key.\n */\nexport interface AllocationWindow {\n    view: AllocationView;\n    /** The layouts this board offers, in the switch's order: the `views` prop's. */\n    layouts: readonly AllocationView[\"layout\"][];\n    setView: (next: AllocationView) => void;\n    /** The plan day: the view's UTC midnight. */\n    day: Date;\n    /** Steps the day by whole days. */\n    step: (days: number) => void;\n}\n\n/** The layouts, in the switch's order. */\nconst LAYOUTS = Object.keys(AllocationLayoutType.cases) as readonly AllocationView[\"layout\"][];\n\n/**\n * The view storage keeps, read defensively — storage outlives versions, and anything may write it: an object whose\n * layout is a case of the board's own, and whose date is a finite epoch.\n *\n * @param stored - What storage keeps under the view's key\n * @returns The view; `undefined` for anything else\n */\nfunction allocationViewOf(stored: unknown): AllocationView | undefined {\n    if (typeof stored !== \"object\" || stored === null) return undefined;\n    const { layout, date } = stored as Partial<Record<keyof AllocationView, unknown>>;\n    if (typeof layout !== \"string\" || !Object.hasOwn(AllocationLayoutType.cases, layout)) return undefined;\n    if (typeof date !== \"number\" || !Number.isFinite(date)) return undefined;\n    return { layout: layout as AllocationView[\"layout\"], date };\n}\n\n/**\n * The board's view and its day (see {@link AllocationWindow}).\n *\n * @param value - The payload: the author's view\n * @param key - The board's storage key\n * @returns The view, what moves it, its day and what steps it\n */\nexport function useAllocationWindow(value: AllocationValue, key: string): AllocationWindow {\n    const { view: state, setView: setState } = usePageView<AllocationView>(`${key}.view`, {\n        layout: value.settings.layout.type,\n        date: dayStart(value.settings.date.type === \"some\" ? value.settings.date.value : new Date()).getTime(),\n    }, allocationViewOf);\n    const day = useMemo(() => dayStart(state.date), [state.date]);\n    const views = value.settings.views;\n    const layouts = useMemo(() => shownViews(LAYOUTS, views), [views]);\n    // A layout this board offers: what is kept stands, so the layout comes back should the board offer it again.\n    const layout = shownView(state.layout, layouts);\n    const view = useMemo(() => layout === state.layout ? state : { ...state, layout }, [state, layout]);\n    return { view, layouts, setView: setState, day, step: days => setState({ ...view, date: day.getTime() + days * DAY }) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Allocation's renderer (`Allocation Spec.md`, #1372, `Builder Interfaces\n * Spec.md` §6, §7, §9): the board in its BuilderFrame — one toolbar, the\n * banners, the panes, the footer's legend and its loading line (#1398), and\n * the cold load's cover at the board's own row pitch, the footer live under\n * it — over the\n * app's own records: its bins and its days, a session each of one history,\n * read a day at a time and assembled into the day the Timeline, the Table, the\n * cards, the Library and the Inspector draw, drafts in place; Publish saving\n * the day, then writing its status. The bins' source of the slice holds the\n * day, which the board's own navigation writes. Below 480px of main, the\n * Timeline and the Table are cards with explicit actions, and nothing takes a\n * drag (#1333). After its cold load nothing covers the board (#1398, CL5): a\n * day not read yet draws its lanes, slots and resources at once and a\n * placeholder where its bins and figures go, and one whose read failed says so\n * once, in its first row in view, with Retry (CL11). With an optimiser bound,\n * the Elara eye (#1409): one run over the day in view, its result landed on\n * the day's bins as one step of the history, and what it left on them marked\n * until Apply. A bin whose row holds a number outside its form's bounds\n * (#1585) wears the warn ring, stored or changed; a stored one's breach is a\n * warning in Issues, holding no Save, and a changed one's the refusal its\n * session raises, which holds it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { ArrayType, SortedMap, StringType, equalFor, isVariant, none, some, variant, type option } from \"@elaraai/east\";\nimport { Box, Button, useSlotRecipe } from \"@chakra-ui/react\";\nimport { AllocationComponent, AllocationIssueType, SCHEDULE_REFERENCE } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, BuilderFrame, SessionBanners, fieldBreachIssue, historyShortcut, implementUIComponent, optimiseMessages, takeKey, typedInto, useContainerBelow,\n    useDataStable, useFormatters, useLanding, useLandingStyles, usePersistedState, useSliceReactivity, useTrackedEvaluation, type BuilderFramePanes, type EditIssue,\n    type FieldBreach, type HistoryAction,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingReveal, formatDatePattern, keptRead, useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { rowBreaches } from \"../shared/bounds.js\";\nimport { useOptimise } from \"../shared/func/use-optimise.js\";\nimport { useOptimiseParts } from \"../shared/func/optimise-parts.js\";\nimport { periodLoading, periodLoadingLine, periodRead, retryPeriod } from \"../shared/loading.js\";\nimport { FieldAskProvider, useFieldAsks } from \"../shared/schedule/field-ask.js\";\nimport { useHiddenPick } from \"../shared/schedule/hidden-pick.js\";\nimport { useClassesAhead, useMoveGhostClasses } from \"../shared/schedule/move-ghost.js\";\nimport { madeFromValues, publishPeriod } from \"../shared/schedule/records.js\";\nimport { refusalText, scheduleRefusals } from \"../shared/schedule/refusals.js\";\nimport { readRowAnchor, type RowAnchor } from \"../shared/schedule/row-anchor.js\";\nimport { useSourceShown } from \"../shared/schedule/source-tab.js\";\nimport { useSourceWindow } from \"../shared/schedule/source-window.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { allocationCommands, publishChange, remainderOf } from \"./actions.js\";\nimport { BinFocusContext, type BinFocus } from \"./bin-focus.js\";\nimport { AllocationCards } from \"./cards.js\";\nimport { AllocationDataReader, binChoicesOf, initialAllocationData, type AllocationData } from \"./data.js\";\nimport { bookOnto, placeAsk, useAllocationDrag, type DropScene, type LibraryGrip, type Refusal, type Target, type Verdict } from \"./drag.js\";\nimport { PERIODS, binBounds, useAllocationEditing, useAllocationStanding, type AllocationEditing } from \"./editing.js\";\nimport { useAllocationFind, type FoundBin } from \"./find.js\";\nimport { useAllocationFit } from \"./fit.js\";\nimport { AllocationFooter } from \"./footer.js\";\nimport { useHiddenBins, type BinShown } from \"./hidden.js\";\nimport { useAllocationInspector, type AllocationRefusal } from \"./inspector.js\";\nimport { binCode } from \"./inspector-model.js\";\nimport { useAllocationLibrary, type Pick, type ResourceFind } from \"./library.js\";\nimport { allocationMessages, type AllocationWords } from \"./messages.js\";\nimport {\n    DAY, NARROW_WIDTH, NO_PERIOD, allocationContext, allocationDomain, allocationReferenceCheckEncoder, allocationWords, byWeek, compareDate, compareFloat, compareString, configError, dayKey, dayStart,\n    editableStatus, focusOf, periodSpan, placeDrafted, placeStored, started, statusText, type AllocationStyles, type AllocationValue, type Bin, type Day, type DraftedBin,\n    type Issue, type PlacedPeriod, type Selection, type StoredBin,\n} from \"./model.js\";\nimport { narrowingPart, narrowingText, useNarrowed } from \"./narrowed.js\";\nimport { NounsContext, a, lower, one, other } from \"./nouns.js\";\nimport {\n    allocationOptimiseRequest, allocationOptimiseTypes, landAllocationOptimise, lockAllocationCommands,\n    type AllocationOptimiseRequest, type AllocationOptimiseResult, type AllocationOptimised,\n} from \"./optimise.js\";\nimport { AllocationTable, RESERVE_PROBE } from \"./table.js\";\nimport { rowHiding } from \"./table-rows.js\";\nimport { AllocationTimeline, type SelectedLink, type TimelineFollow } from \"./timeline.js\";\nimport { ROW_H } from \"./timeline-layout.js\";\nimport { pickerDays, useAllocationToolbar } from \"./toolbar.js\";\nimport { useAllocationWindow, type AllocationWindow } from \"./window.js\";\n\n/** A pane's open tab, as storage keeps it. */\nconst readTab = keptRead.record<{ tab: string }>({ tab: keptRead.string });\n/** Where the table rests, as storage keeps it. */\nconst readAnchor = keptRead.record<{ table?: RowAnchor | undefined }>({ table: keptRead.optional(readRowAnchor) });\n/** What a drag draws of the board's own, apart from its ghost: the links as they follow it, what a drop would do, and where it would land. */\nconst BOARD_DRAG_SLOTS = [\"links\", \"linkLines\", \"rank\", \"reason\", \"runLabel\", \"runMeta\", \"fitsMarker\"] as const;\n/** What a drag draws in the inspector: the drop list and its fits. */\nconst INSPECTOR_DRAG_SLOTS = [\"section\", \"line\", \"absent\", \"dropRow\", \"dropRank\"] as const;\nexport type { AllocationValue } from \"./model.js\";\n\n/** Props of the record-backed Allocation extension. */\nexport interface EastChakraAllocationProps { value: AllocationValue; storageKey: string }\nconst NO_DATES: readonly Date[] = [];\nconst NO_STORED: ReadonlyMap<string, StoredBin> = new Map();\nconst NO_BIN_DRAFTS: ReadonlyMap<string, DraftedBin | undefined> = new Map();\nconst NO_PERIOD_DRAFTS: ReadonlyMap<string, Uint8Array | undefined> = new Map();\nconst NO_ISSUES: Issue[] = [];\nconst keyEqual = equalFor(StringType);\nconst sameIssues = equalFor(ArrayType(AllocationIssueType));\n/** The Table's view has rested nowhere yet. */\nconst NO_ANCHOR: { table?: RowAnchor | undefined } = {};\n/**\n * The frame's root takes the focus a click on a part of it holding nothing focusable gives — a pane's empty foot, the\n * toolbar's gaps — so the keyboard is in the Allocation, never the page's body, as the Calendar's is: not a tab stop.\n */\nconst CLICK_FOCUS: Readonly<Record<string, string>> = { tabIndex: \"-1\" };\n\n/** What the frame takes from the board around it: the payload, its key, the day, and the editing. */\ninterface FrameProps {\n    value: AllocationValue; storageKey: string; window: AllocationWindow;\n    /** Why the day could not be written to the bins' source. */\n    rangeError: string | undefined;\n    editing: AllocationEditing | undefined;\n}\n\n/** The own row of the period holding the day — the day's, or its week's (#1550) — read: its status. */\nfunction periodOf(value: AllocationValue, bytes: Uint8Array | undefined): PlacedPeriod {\n    if (bytes === undefined || value.periods.type !== \"some\") return NO_PERIOD;\n    return { bytes, status: value.periods.value.status(bytes) };\n}\n\n/** The sole editable wrapper: a read-only board never creates a record session. */\nfunction EditableAllocation(props: Omit<FrameProps, \"editing\">) {\n    const { value } = props;\n    // The bins' Save notice counts what leaves their own source's narrowing.\n    const recordSlices = useMemo(() => {\n        const part = sourcePart(value.slice.type === \"some\" ? value.slice.value : undefined, value.bin.kind.key);\n        return part === undefined ? [] : [part];\n    }, [value]);\n    const editing = useAllocationEditing(value, props.storageKey, props.window.day, recordSlices);\n    return <AllocationFrame {...props} editing={editing} />;\n}\n\nfunction AllocationFrame({ value, storageKey: key, window, rangeError, editing }: FrameProps) {\n    const domain = allocationDomain(value.bin.rowType);\n    const { day } = window;\n    const [pickerWeeks, setPickerWeeks] = useState(NO_DATES);\n    const picker = useMemo(() => pickerDays(pickerWeeks), [pickerWeeks]);\n    const [data, setData] = useState<AllocationData>(() => initialAllocationData(day));\n    const current = data.ready && compareDate(data.day, day) === 0;\n    // The bins' own source of the slice: its narrowing, apart from the day the board writes into it, is what a read of\n    // the day it holds is filtered by (#1398).\n    const binsPart = sourcePart(value.slice.type === \"some\" ? value.slice.value : undefined, value.bin.kind.key);\n    useSliceReactivity(binsPart?.key);\n    const binChoices = binChoicesOf(binsPart);\n    // The day assembled from the records' rows (§9): the bins its window read, every day's drafts in place, and its own row.\n    const stored = current ? data.bins : NO_STORED;\n    const heldBins = useMemo(() => placeStored(domain, stored, day), [domain, stored, day]);\n    // A day not read yet draws none of its bins, its drafts included: they wait in their session, and draw beside its\n    // stored bins once those land — never a day of drafts alone (#1398, CL13).\n    const planBins = useMemo(() => current ? placeDrafted(domain, heldBins, editing?.bins ?? NO_BIN_DRAFTS, day) : heldBins,\n        [current, domain, heldBins, editing?.bins, day]);\n    const dayId = dayKey(day);\n    // The period the board publishes that holds the day — the day, or its week (#1550): its row's drafts are its start's,\n    // its status the day's, and Publish writes it.\n    const weekly = byWeek(value), unit = weekly ? \"week\" : \"day\";\n    const periodFrom = periodSpan(value, day).from;\n    const periodId = dayKey(periodFrom);\n    // What the board draws stands while its records are read again — after a Save, or another session's: a gesture finds\n    // the row it changes there, so it is taken at once (a Save never stops the editing).\n    useAllocationStanding(editing, current ? data.bins : undefined, current ? data.period : undefined, periodId);\n    const periodDrafts = editing?.periods ?? NO_PERIOD_DRAFTS;\n    const heldPeriod = useMemo(() => periodOf(value, current ? data.period : undefined), [value, current, data.period]);\n    const period = useMemo(() => periodDrafts.has(periodId) ? periodOf(value, periodDrafts.get(periodId)) : heldPeriod, [periodDrafts, periodId, value, heldPeriod]);\n    const plan = useMemo((): Day => ({ status: period.status, bins: planBins }), [period.status, planBins]);\n    const held = useMemo((): Day => ({ status: heldPeriod.status, bins: heldBins }), [heldPeriod.status, heldBins]);\n    const [selection, setSelection] = useState<Selection>();\n    // A selected link (A68) is its bin's part on a resource; any other selection lets it go.\n    const [link, setLink] = useState<SelectedLink>();\n    // What the viewer picked in the Library (A9, A10): a selection, or a command, lets it go, as the mock's does.\n    const [pick, setPick] = useState<Pick>();\n    // A booking with no free slot left (A36): its banner, until the next gesture.\n    const [notice, setNotice] = useState<Refusal>();\n    // A refused drop's reason (A40): it adds no banner; the inspector shows it at its top until the next action.\n    const [refusal, setRefusal] = useState<Refusal>();\n    // The bin whose resource Chooser is open in the inspector (A8, A21, A64).\n    const [chooser, setChooser] = useState<string>();\n    // Find a fit (A74): the bin whose unallocated quantity the Library's Resources tab shows the fits for, until its chip clears it —\n    // the tab's, not a filter, so neither a selection nor the rail lets it go.\n    const [find, setFind] = useState<string>();\n    // Selecting follows the selection (A12); a selection a command makes after a drop follows it softly.\n    const [follow, setFollow] = useState<TimelineFollow>({ nonce: 0, soft: false });\n    const select = useCallback((next: Selection | undefined, soft = false) => {\n        setSelection(next);\n        setLink(undefined);\n        setPick(undefined);\n        setNotice(undefined);\n        setRefusal(undefined);\n        setChooser(undefined);\n        if (next !== undefined) setFollow(before => ({ nonce: before.nonce + 1, soft }));\n    }, []);\n    // The inspector's open tab (A55): an explicit inspection opens Details; a selection a command makes keeps it (A8).\n    const { state: inspectorTab, setState: setInspectorTab } = usePersistedState<{ tab: string }>(`${key}.inspector.tab`, { tab: \"details\" }, readTab);\n    const inspect = useCallback((next: Selection | undefined, soft = false) => {\n        select(next, soft);\n        if (next !== undefined) setInspectorTab({ tab: \"details\" });\n    }, [select, setInspectorTab]);\n    const selectLink = useCallback((next: SelectedLink) => { inspect({ type: \"bin\", id: next.bin }); setLink(next); }, [inspect]);\n    const [error, setError] = useState<string>();\n    // The narrowing chooses which lanes, resources and arrivals show, read from the slice itself (#1336, #1339); fits, checks and totals read every one.\n    const lanesShown = useNarrowed(value, \"lanes\", value.lanes);\n    const resourcesShown = useNarrowed(value, \"resources\", value.resources);\n    const arrivalsShown = useNarrowed(value, \"arrivals\", value.arrivals);\n    const narrowing = [lanesShown, resourcesShown, arrivalsShown];\n    // What the rail shows of each Library tab's source, and how that source alone clears (A98).\n    const arrivalsSource = useSourceShown(arrivalsShown, narrowingPart(value, \"arrivals\"));\n    const resourcesSource = useSourceShown(resourcesShown, narrowingPart(value, \"resources\"));\n    const narrowingLoading = narrowing.some(n => n.loading), narrowingFailed = narrowing.some(n => n.error !== undefined);\n    const clearFilters = value.slice.type === \"some\" ? value.slice.value.slice.clearAll : undefined;\n    const root = useRef<HTMLDivElement>(null), main = useRef<HTMLDivElement>(null);\n    // The frame's panes, as the board's own controls open them: a bin's Chooser, the issues chip's Issues, Find a fit's Resources.\n    const panes = useRef<BuilderFramePanes>(null);\n    const narrow = useContainerBelow(main, NARROW_WIDTH);\n    // Another day: its own selection, pick and refusal, and no find — a find is its bin's, on the day it was asked of.\n    const dayEpoch = day.getTime();\n    useEffect(() => {\n        setSelection(undefined); setLink(undefined); setPick(undefined); setNotice(undefined); setError(undefined); setRefusal(undefined); setChooser(undefined); setFind(undefined);\n    }, [dayEpoch]);\n    // Another layout closes the selected link (A7), and shows the selection there.\n    useEffect(() => { setLink(undefined); setFollow(before => before.nonce === 0 ? before : { nonce: before.nonce + 1, soft: false }); }, [window.view.layout]);\n    const recipe = useSlotRecipe({ key: \"allocationBuilder\" });\n    const styles = useMemo(() => recipe({}) as unknown as AllocationStyles, [recipe]);\n    // What a drag draws has its classes already, made as the board is drawn, ahead of the first drag (#1594).\n    useMoveGhostClasses(styles);\n    useClassesAhead(styles, BOARD_DRAG_SLOTS);\n    useClassesAhead(useSlotStyles(\"allocationInspector\") as unknown as AllocationStyles, INSPECTOR_DRAG_SLOTS);\n    // The board's words: its message table — the editing session's, and its own — in the app's locale.\n    const format = useFormatters(), words = useMemo((): AllocationWords => ({ ...format, m: allocationMessages }), [format]);\n    // The day, as the footer's line, the eye and the banner name it (#1398, CL3; #1409).\n    const dayWords = format.weekdayDate(day);\n    // What each source the rail narrows shows, as the layout shown draws a bin (#1398): the Table — on a phone its cards too —\n    // hides a bin by its lane, its arrival and every one of its resources; the Timeline's lanes by its lane and its arrival;\n    // a phone's Timeline, a card per resource, by its resources.\n    const table = window.view.layout === \"table\";\n    const shownKeys = useMemo((): BinShown => ({\n        lanes: table || !narrow ? lanesShown.keys : none,\n        resources: table || narrow ? resourcesShown.keys : none,\n        arrivals: table || !narrow ? arrivalsShown.keys : none,\n    }), [table, narrow, lanesShown.keys, resourcesShown.keys, arrivalsShown.keys]);\n    const hiddenBins = useHiddenBins(value, shownKeys);\n    // Search Records (#1398): a bin found by its key steps the board to its day, where — once the day is read, after the\n    // step's own clearing above, and once the narrowing draws it — it is selected, and the board follows it into view, at\n    // its time; a pick gives it the keyboard there, once the box has let it go: the element that stands for it in the\n    // layout shown takes the focus (`bin-focus.ts`). A bin the rail's narrowing hides is drawn by clearing just the\n    // choices that hide it, each source's (the shared hidden pick).\n    const [binFocus, setBinFocus] = useState<string>();\n    const hiddenPick = useHiddenPick<string>({\n        onError: setError, uncleared: `The filters hiding the ${one(value.labels.bin)} could not be cleared`,\n        landing: {\n            drawn: (key) => {\n                const bin = current ? plan.bins.get(key) : undefined;\n                if (bin === undefined || narrowingLoading) return false;\n                const hides = rowHiding(bin.lane, { arrival: bin.arrival.type === \"some\" ? bin.arrival.value : undefined, parts: bin.parts.keys() },\n                    shownKeys.lanes, shownKeys.resources, shownKeys.arrivals);\n                return !hides.lanes && !hides.resources && !hides.arrivals;\n            },\n            selects: (key) => inspect({ type: \"bin\", id: key }),\n            focus: setBinFocus,\n        },\n    });\n    const finder = useAllocationFind({ value, domain, part: binsPart, words, hidden: hiddenBins, onPick: (bin: FoundBin) => {\n        hiddenPick.pick(hiddenBins.of(bin), bin.key, () => { window.setView({ ...window.view, date: dayStart(bin.at).getTime() }); });\n    } });\n    const search = useMemo(() => (finder === undefined ? undefined : hiddenPick.search(finder)), [finder, hiddenPick]);\n    // The bin given the keyboard waits for its element only while it is the one selected (`useBinFocusTarget`), and until\n    // the viewer does something else (the root's captures below).\n    useEffect(() => {\n        if (binFocus !== undefined && !(selection?.type === \"bin\" && keyEqual(selection.id, binFocus))) setBinFocus(undefined);\n    }, [selection, binFocus]);\n    const binFocused = useMemo<BinFocus>(() => ({ id: binFocus, done: () => setBinFocus(undefined) }), [binFocus]);\n    const dropBinFocus = binFocus === undefined ? undefined : () => setBinFocus(undefined);\n    // Where the Table's view rests (#1398): saved under the board's key, so the Table comes back to it as it mounts.\n    const { state: anchor, setState: setAnchor } = usePersistedState<{ table?: RowAnchor | undefined }>(`${key}.anchor`, NO_ANCHOR, readAnchor);\n    const onTableAnchor = useCallback((at: RowAnchor) => setAnchor(was => ({ ...was, table: at })), [setAnchor]);\n    const context = useMemo(() => allocationContext(value), [value]);\n    const loads = useMemo(() => domain.loads(day, plan, context), [domain, day, plan, context]);\n    const builtIn = useMemo(() => domain.check(day, plan, context), [domain, day, plan, context]);\n    const slots = useMemo(() => domain.slots(day, plan, context), [domain, day, plan, context]);\n    const focus = focusOf(selection, plan);\n    // Each bin's row checked against its form's bounds (#1585) — those its Save holds it to, a reservation's quantity none\n    // of them (`binBounds`) — once a row's bytes, a draft's as it holds it, else the stored row: a bin breaking one wears the\n    // warn ring, stored or changed, and a stored bin's breach is a warning among the day's issues, holding no Save — a\n    // changed bin's is the refusal its session's readiness raises, which holds Save.\n    const binKind = value.bin.kind.key, binFields = value.bin.kind.fields;\n    const breachesOf = useMemo(() => rowBreaches(binFields, domain.rowType, binBounds(value.bin)), [binFields, domain, value.bin]);\n    const draftedBins = editing?.bins;\n    const binBreaches = useMemo(() => {\n        const out = new Map<string, readonly FieldBreach[]>();\n        for (const id of plan.bins.keys()) {\n            const bytes = draftedBins?.get(id)?.bytes ?? stored.get(id)?.bytes;\n            const found = bytes === undefined ? [] : breachesOf(bytes);\n            if (found.length > 0) out.set(id, found);\n        }\n        return out;\n    }, [plan.bins, draftedBins, stored, breachesOf]);\n    const bounded = useCallback((id: string) => binBreaches.has(id), [binBreaches]);\n    const refused = scheduleRefusals(editing?.schedule.sessions ?? []);\n    const storedBreaches = useDataStable([...binBreaches].flatMap(([id, breaches]): Issue[] => {\n        const bin = plan.bins.get(id)!;\n        return breaches.flatMap((breach): Issue[] => refused.some(({ kind, issue }) => keyEqual(kind, binKind) && keyEqual(issue.entry, id)\n            && issue.field.type === \"some\" && keyEqual(issue.field.value, breach.key)) ? [] : [{\n            kind: variant(\"custom\", \"Out of range\"), tone: variant(\"warning\", null), title: binCode(context, bin, value.labels),\n            detail: refusalText(fieldBreachIssue(breach, { entry: id }), binFields), bin: some(id), resource: none, flag: none, fix: none,\n        }]);\n    }), sameIssues);\n    // The app's check, after the built-in ones and the stored bins' breaches wherever issues show; a check that fails leaves\n    // them shown. A day not read yet has no issue: what its bins break is not known until they land (#1398, CL13). Over a\n    // reference record (#1551), it is given the record's rows overlapping the day, read with the day.\n    const referenceType = value.reference.type === \"some\" ? value.reference.value.rowType : undefined;\n    const encodeReference = useMemo(() => referenceType === undefined ? undefined : allocationReferenceCheckEncoder(value.bin.rowType, referenceType),\n        [value.bin.rowType, referenceType]);\n    const referenceRows = current ? data.reference : undefined;\n    const readCheck = useCallback((): Issue[] => {\n        if (!current || value.check.type !== \"some\") return NO_ISSUES;\n        if (encodeReference === undefined) return value.check.value(domain.encodeCheckContext({ day, plan, context, loads }));\n        return referenceRows === undefined ? NO_ISSUES : value.check.value(encodeReference({ day, plan, context, loads, reference: referenceRows.rows }));\n    }, [current, value.check, domain, encodeReference, referenceRows, day, plan, context, loads]);\n    const custom = useTrackedEvaluation(readCheck);\n    const issues = useMemo(() => current ? [...builtIn, ...storedBreaches, ...(custom.result.ok ? custom.result.value : [])] : NO_ISSUES,\n        [current, builtIn, storedBreaches, custom.result]);\n    // Publish (B7): Save, then once every record reads back as saved, the status of the period holding the day — the day's,\n    // or its week's (#1550) — over its row as last saved. The period is the one shown as Publish is pressed: a day stepped\n    // to while the Save settles is not the one published.\n    const [publishing, setPublishing] = useState(false);\n    const publishingNow = useRef(false);\n    const latest = useRef({ change: () => undefined as ReturnType<typeof publishChange> });\n    latest.current = { change: () => publishChange(value, periodFrom, new Date()) };\n    const publish = useCallback(() => {\n        if (editing === undefined || publishingNow.current) return;\n        publishingNow.current = true; setPublishing(true);\n        const { change } = latest.current;\n        void publishPeriod(editing.history, () => { const published = change(); return published === undefined ? [] : [published]; },\n            changes => editing.schedule.record(changes, \"typed\", `Publish ${unit}`))\n            .finally(() => { publishingNow.current = false; setPublishing(false); });\n    }, [editing, unit]);\n    // A narrowing read while the day it filters stands in — the bins' own, the lanes', the resources' or the arrivals' —\n    // keeps the day's bins in their cells, stale (#1398, CL5): their words in the third ink, the cells' rules dashed. While a\n    // narrowing is read or failed, what main shows is retained (CL8): readable, focusable and selectable, aria-disabled,\n    // its controls in place and every gesture refused until it lands.\n    const stale = current && (data.filtering || narrowingLoading);\n    const retained = stale || narrowingLoading || narrowingFailed;\n    // Commands update what is selected without changing the panes or their tabs.\n    const unlocked = allocationCommands({ value, domain, day, plan, held, period, heldPeriod, read: stored, editing, ready: current && !publishing, retained }, select, publish);\n    // The app's optimiser (#1409, #1420): one run over the day in view, its result landed on the day's bins as one edit,\n    // and what it left on them until Apply — the landing and the highlight over the whole frame.\n    const landing = useLanding(root);\n    const landingStyles = useLandingStyles();\n    const optimiseTypes = useMemo(() => allocationOptimiseTypes(domain.rowType), [domain]);\n    const [optimised, setOptimised] = useState<AllocationOptimised | undefined>(undefined);\n    const landAfter = useRef<(run: number) => void>(() => undefined);\n    const latestRun = useRef({ plan, context, editing, optimised });\n    latestRun.current = { plan, context, editing, optimised };\n    const run = useOptimise<AllocationOptimiseRequest, AllocationOptimiseResult>({\n        name: value.optimise.type === \"some\" ? value.optimise.value.name : null,\n        requestType: optimiseTypes.request, resultType: optimiseTypes.result, scope: dayId, storageKey: key,\n        onLanded: (result, request, n) => {\n            const now = latestRun.current;\n            if (now.editing === undefined) return undefined;\n            const runText = format.number(n);\n            const landed = landAllocationOptimise({ value, domain, editing: now.editing, request, result, label: optimiseMessages.step({ run: runText }), runText,\n                plan: now.plan, context: now.context, before: now.optimised });\n            if (landed === undefined) return undefined;\n            // A run that changed nothing leaves what earlier runs left (R10).\n            if (landed.optimised !== undefined) { setOptimised(landed.optimised); landAfter.current(n); }\n            return landed.counts;\n        },\n    });\n    // While a run is out (R2) the day takes no gesture: every command refused, the drags off, the history locked.\n    const locked = run.running;\n    const commands = locked ? lockAllocationCommands(unlocked) : unlocked;\n    // The eye is listed only where the day can be optimised (ruled 25 Oct 2026): never read only, never over a published\n    // day; while the day's reads are in flight it waits, disabled, in its place.\n    const optimiseParts = useOptimiseParts<AllocationOptimiseRequest>({\n        run, landing, period: dayWords,\n        readOnly: value.settings.readOnly || editing === undefined || (current && (!editableStatus(heldPeriod.status) || !editableStatus(period.status))), busy: !unlocked.available,\n        request: n => allocationOptimiseRequest(day, latestRun.current.plan, value.arrivals, latestRun.current.context, n), landKey: plan,\n    });\n    landAfter.current = optimiseParts.landAfter;\n    // What a run left on the bins goes with the drafts (R17): once nothing is pending — Save, Discard — nothing is\n    // marked. An Undo leaves nothing pending too, but its Redo brings the run's step back (R9): what the run left is\n    // kept while that step is the next to redo.\n    const pendingSteps = editing?.history.pending ?? 0;\n    useEffect(() => {\n        if (pendingSteps === 0 && editing?.history.redoOrigin !== \"optimise\") setOptimised(undefined);\n    }, [pendingSteps, editing?.schedule.version, editing]);\n    // The app's fit (§12): every verdict a drag or a pick shows is its answer.\n    const fit = useAllocationFit(value, domain, day, plan, context);\n    const { ask: askFit } = fit;\n    // The day without a reservation, one per reservation for these drafts: what a fill asks the fit of (A38).\n    // The drafts are the cache's key: new drafts, a new cache.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    const withouts = useMemo(() => new Map<string, Day>(), [plan]);\n    const without = (bin: string) => {\n        let derived = withouts.get(bin);\n        if (derived === undefined) { derived = domain.copyDay(plan); derived.bins.delete(bin); withouts.set(bin, derived); }\n        return derived;\n    };\n    // The day with a probe reservation in a free slot, its row made as a reservation's is (B13): what a free Table row's resource\n    // Chooser asks the fit of (A48). The drafts are the cache's key: new drafts, a new cache.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    const reservings = useMemo(() => new Map<string, Day>(), [plan]);\n    const reserving = (lane: string, at: Date) => {\n        const id = `${lane}|${dayKey(at)}`;\n        let derived = reservings.get(id);\n        if (derived === undefined) {\n            derived = domain.copyDay(plan);\n            // A probe the app's `values` fail to make draws none, as the Reserve it stands for makes none.\n            const bytes = madeFromValues(\"Allocation\", `a probe ${one(value.labels.reservation)}`, () => value.bin.create({ at, lane, arrival: none, quantity: 0, kind: none,\n                hold: variant(\"days\", 0), parts: new SortedMap<string, number>([], compareString) }, none));\n            const probe = bytes === undefined ? none : domain.binOf(value.bin.read(bytes), domain.decodeRow(bytes), day);\n            if (probe.type === \"some\") derived.bins.set(RESERVE_PROBE, probe.value);\n            reservings.set(id, derived);\n        }\n        return derived;\n    };\n    // The day with a committed bin the drafts removed back on it, unlinked (and without a reservation it fills): what booking it\n    // again asks the fit of (A51). The drafts are the cache's key: new drafts, a new cache.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    const restorings = useMemo(() => new Map<string, Day | undefined>(), [plan, held]);\n    const restoring = (bin: string, reservation?: string) => {\n        const at = `${bin}|${reservation ?? \"\"}`;\n        if (restorings.has(at)) return restorings.get(at);\n        let derived: Day | undefined;\n        if (held.bins.has(bin) && !plan.bins.has(bin)) {\n            derived = domain.copyDay(reservation === undefined ? plan : without(reservation));\n            const back = domain.copyDay(held).bins.get(bin)!;\n            back.parts.clear();\n            derived.bins.set(bin, back);\n        }\n        restorings.set(at, derived);\n        return derived;\n    };\n    // The day's first free slot, by time then lane, of the lanes that show: where booking onto a resource lands (A36).\n    const firstFree = () => {\n        const free = slots.find(s => s.status.type === \"free\" && (lanesShown.keys.type === \"none\" || lanesShown.keys.value.has(s.lane)));\n        return free === undefined ? undefined : { lane: free.lane, at: free.at };\n    };\n    const nouns = value.labels;\n    const scene: DropScene = { day, plan, held, context, slots, fit, commands, without, restoring, firstFree, notice: setNotice,\n        laneLabel: lane => value.lanes.find(l => l.key === lane)?.label ?? lane, nouns };\n    // The picked card's grip: its fits show as a drag's do, and its click books as its drop would (A11).\n    const pickGrip: LibraryGrip | undefined = pick?.kind === \"arrival\" || pick?.kind === \"removed\" ? pick : undefined;\n    const drag = useAllocationDrag(key, commands.canEdit() && !narrow, scene, setRefusal, pickGrip);\n    // A verdict a click ran (A11, A53): its refusal shown as a drop's is, else its command.\n    const runVerdict = useCallback((verdict: Verdict) => {\n        if (verdict.pending) return;\n        if (!verdict.allowed) { setRefusal(verdict.refusal); return; }\n        setRefusal(undefined);\n        verdict.run?.();\n    }, []);\n    const bookPicked = (target: Target) => { if (pickGrip !== undefined && commands.canEdit()) runVerdict(drag.verdict(pickGrip, target)); };\n    const highlight = pick?.kind === \"bins\" ? pick.arrival : undefined;\n    // The Library (A50–A54): its open tab kept, as the pane keeps its own.\n    const { state: libraryTab, setState: setLibraryTab } = usePersistedState<{ tab: string }>(`${key}.library.tab`, { tab: \"arrivals\" }, readTab);\n    const lines = useMemo(() => new Map(value.resources.map(r => [r.key, allocationWords().line(day, r, loads.get(r.key)!, context.unit, lower(nouns.reserved))] as const)),\n        [value.resources, loads, day, context.unit, nouns.reserved]);\n    // A find's question (A73, A74): the bin's unallocated quantity placed, asked of the drafts as they are and again as they change (F1).\n    // A find whose bin is gone, or wholly allocated, is done.\n    const findBin = find === undefined ? undefined : plan.bins.get(find);\n    const findAsk = find === undefined || findBin === undefined || compareFloat(remainderOf(findBin), 0) <= 0 ? undefined : placeAsk(plan, { kind: \"port\", bin: find });\n    const findKey = findAsk === undefined ? \"\" : `${find}|${findAsk.quantity}`;\n    useEffect(() => { if (findAsk !== undefined) askFit(findAsk.ask); },\n        // The question stands for its bin, its quantity and the drafts.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [findKey, plan, askFit]);\n    useEffect(() => { if (find !== undefined && findKey === \"\") setFind(undefined); }, [find, findKey]);\n    const findAnswer = findAsk === undefined ? undefined : fit.answer(findAsk.ask);\n    // While its answer for the drafts as they are is on its way, the find's buttons read `Finding…` and its tab is busy (F2).\n    const finding = useCallback((bin: string) => bin === find && findKey !== \"\" && findAnswer === undefined && fit.error === undefined,\n        [find, findKey, findAnswer, fit.error]);\n    const libraryFind: ResourceFind | undefined = find === undefined || findAsk === undefined || findBin === undefined ? undefined\n        : { bin: find, label: `${binCode(context, findBin, nouns)} · ${allocationWords().quantity(findAsk.quantity, context.unit)}`, shown: findAnswer, busy: finding(find) };\n    // Find a fit opens the Library's Resources tab, where its result is: with no such tab, nothing offers it.\n    const findable = value.library.some(tab => tab.type === \"resources\");\n    const onFind = (bin: string) => {\n        setFind(bin); setLibraryTab({ tab: \"resources\" }); panes.current?.open(\"start\");\n        // Pressed again after the fit failed, a find is asked again.\n        if (fit.error !== undefined) fit.retry();\n    };\n    const start = useAllocationLibrary({\n        value, context, day, plan, held, loads, lines, styles, layout: window.view.layout, narrow, drag, commands, selection, pick,\n        tab: libraryTab.tab, onTab: tab => setLibraryTab({ tab }), onVerdict: runVerdict,\n        shown: { arrivals: arrivalsSource, resources: resourcesSource }, find: libraryFind, onClearFind: () => setFind(undefined),\n        arrivalsFlash: landing.lit && optimised?.arrivalsChanged === true,\n        // A9: an arrival's card picks it, again unpicks it; a selected free slot or reservation stays selected. A pick's fits are Details' (A34).\n        onArrival: grip => {\n            const same = pick !== undefined && pick.kind === grip.kind && (grip.kind === \"arrival\" ? pick.kind === \"arrival\" && pick.arrival === grip.arrival : pick.kind === \"removed\" && pick.bin === grip.bin);\n            const keep = selection?.type === \"slot\" || (selection?.type === \"bin\" && plan.bins.get(selection.id)?.arrival.type === \"none\") ? selection : undefined;\n            setSelection(keep); setLink(undefined); setNotice(undefined); setRefusal(undefined); setChooser(undefined);\n            setPick(same ? undefined : grip);\n            if (!same) setInspectorTab({ tab: \"details\" });\n        },\n        // A9: a resource card picks it for the selected free slot; otherwise it selects the resource, or unselects it.\n        onResource: resource => {\n            if (selection?.type === \"slot\") { setPick(pick?.kind === \"resource\" && pick.resource === resource ? undefined : { kind: \"resource\", resource }); return; }\n            inspect(selection?.type === \"resource\" && selection.key === resource ? undefined : { type: \"resource\", key: resource });\n        },\n        // A10: an Allocated card selects the arrival's first bin, and highlights every bin of it; again, it clears.\n        onAllocated: (arrival, bins) => {\n            if (pick?.kind === \"bins\" && pick.arrival === arrival) { select(undefined); return; }\n            inspect({ type: \"bin\", id: bins[0]! });\n            if (bins.length > 1) setPick({ kind: \"bins\", arrival });\n        },\n    });\n    // Nothing above the board comes or goes during a drag (A22): a failed fit's banner waits for the drop.\n    const [fitError, setFitError] = useState<string>();\n    useEffect(() => { if (drag.grip === undefined) setFitError(fit.error); }, [drag.grip, fit.error]);\n    // The selected bin is the board's subject at rest: its connector's question is asked before a drag needs it (A23, F1).\n    const selectedBin = selection?.type === \"bin\" ? selection.id : undefined;\n    useEffect(() => {\n        const asked = selectedBin === undefined ? undefined : placeAsk(plan, { kind: \"port\", bin: selectedBin });\n        if (asked !== undefined) askFit(asked.ask);\n    }, [selectedBin, plan, askFit]);\n    // The issues chip opens Inspector › Issues (A64).\n    const onIssues = () => { setInspectorTab({ tab: \"issues\" }); panes.current?.open(\"end\"); };\n    const history = editing?.history;\n    const { acted } = optimiseParts;\n    // The history's acts: a field typed into lets go first, committing what it holds — the history's buttons take no\n    // focus from it. Anything else keeps the focus, the board or a bin on it, so the next key — a Redo after an Undo —\n    // reaches the frame too, never the page.\n    const onAction = useCallback((action: HistoryAction) => {\n        if (locked) return;\n        const active = document.activeElement; if (active instanceof HTMLElement && typedInto(active)) active.blur();\n        // A run's highlight ends with Undo, Apply and Discard; a Redo of its step replays its landing (R9, R16).\n        acted(action, history?.redoOrigin);\n        history?.act(action);\n    }, [history, locked, acted]);\n    // The keyboard stays on the board as the bin it was on goes, as the Calendar's does: Delete takes away the bin the focus\n    // is on — its card, its Table row or its narrow card — and the board takes the focus, never the page's body, where the\n    // history's keys, the Undo that brings the bin back, go unheard.\n    const keepOnBoard = (bin: string) => {\n        const board = main.current;\n        const active = board?.ownerDocument.activeElement;\n        if (board === null || !(active instanceof HTMLElement) || !board.contains(active)) return;\n        const card = active.closest(\"[data-allocation-card]\")?.getAttribute(\"data-allocation-card\");\n        const row = active.closest(\"[data-allocation-row], [data-allocation-row-card]\");\n        const rowKey = row?.getAttribute(\"data-allocation-row\") ?? row?.getAttribute(\"data-allocation-row-card\");\n        if ((card !== null && card !== undefined && keyEqual(card, bin)) || (rowKey !== null && rowKey !== undefined && keyEqual(rowKey, `bin:${bin}`))) {\n            board.focus({ preventScroll: true });\n        }\n    };\n    // What the footer's loading line says (#1398, CL3): the day being read; a new narrowing — the bins' own, the lanes',\n    // the resources' or the arrivals' — which is the board waiting for which of its bins show, so `Filtering bins…`\n    // whichever it is, the coordinator's word for them (23 Oct 2026); or why one could not be read, by its source, with\n    // Retry — the day's asking again each record the day reads.\n    const retryDay = useCallback(() => retryPeriod([\n        { entries: value.bin.kind.entries, part: binsPart },\n        ...(value.periods.type === \"some\" ? [{ entries: value.periods.value.entries }] : []),\n        // The reference record the check reads (#1551), through its source of the slice.\n        ...(value.reference.type === \"some\" ? [{ entries: none, part: sourcePart(value.slice.type === \"some\" ? value.slice.value : undefined, SCHEDULE_REFERENCE) }] : [])]),\n        [value, binsPart]);\n    const line = useMemo(() => {\n        const state = periodLoading({ loading: data.loading && !data.filtering, error: data.error, retry: retryDay }, [\n            { noun: other(nouns.bin), ready: true, loading: data.filtering, error: undefined, retry: retryDay },\n            { noun: other(nouns.lane), ...lanesShown }, { noun: other(nouns.resource), ...resourcesShown }, { noun: other(nouns.arrival), ...arrivalsShown },\n        ]);\n        return periodLoadingLine(state?.kind === \"filtering\" ? { kind: \"filtering\", noun: other(nouns.bin) } : state, dayWords);\n    }, [data.loading, data.filtering, data.error, retryDay, nouns, lanesShown, resourcesShown, arrivalsShown, dayWords]);\n    // What the views draw of the day (#1398): the day as read; a day not read yet, its lanes, slots and resources at once\n    // and its placeholders, unseen until the frame's one reveal clock says so (CL5, CL2, CL4: `LoadingReveal` below, which\n    // the footer's line and each placeholder read where they show, so its flip renders them and never this frame); or one\n    // whose read failed, its geometry and the failure said once in its first row in view (CL11) — never \"Allocation\n    // unavailable\" over the board.\n    const read = useMemo(() => periodRead({ current, error: data.error, name: dayWords, retry: retryDay }), [current, data.error, dayWords, retryDay]);\n    // A bin of a day not in view, as its draft holds it — its draft removing it, as their save left it — read on its own\n    // day: what a conflict's card names it by, and where its Go to goes.\n    const elsewhere = (id: string): Bin | undefined => {\n        let bin = editing?.bins.get(id);\n        if (bin === undefined) {\n            const theirs = editing?.schedule.sessions.find((held) => held.kind === value.bin.kind.key)?.session.conflicts.get(id)?.source;\n            const row = theirs?.type === \"some\" && isVariant(theirs.value) && theirs.value.type === \"value\" ? theirs.value.value : undefined;\n            if (row === undefined) return undefined;\n            const bytes = domain.encodeRow(row);\n            bin = { bytes, roles: value.bin.read(bytes), row };\n        }\n        const read = domain.binOf(bin.roles, bin.row, dayStart(bin.roles.at));\n        return read.type === \"some\" ? read.value : undefined;\n    };\n    /** A session's issue's place: a bin by its arrival and its slot, a day's row by its key. */\n    const where = (kind: string) => (issue: { entry: string }) => {\n        const bin = binOf(kind, issue.entry)?.bin;\n        return bin === undefined ? issue.entry : `${binCode(context, bin, nouns)} · ${value.lanes.find(l => l.key === bin.lane)?.label ?? bin.lane} ${formatDatePattern(\"HH:mm\", bin.at)}`;\n    };\n    // A conflict's item in the history bar's popover, named as its session's banners name its issues.\n    const historyWhere = (issue: EditIssue) => {\n        const key = history?.sourceOf(issue);\n        const part = key === undefined ? undefined : editing?.schedule.sessions.find((held) => keyEqual(held.key, key));\n        return part === undefined ? issue.entry : where(part.kind)(issue);\n    };\n    // A bin holding a conflict not yet chosen wears the warn ring: asked again as the history moves, which every choice and\n    // every carry-over moves.\n    const scheduleSessions = editing?.schedule.sessions;\n    const scheduleVersion = editing?.schedule.version;\n    const conflicted = useCallback((id: string) => scheduleSessions?.some((held) => held.kind !== PERIODS && held.session.conflicts.has(id)) === true,\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version says they moved\n        [scheduleSessions, scheduleVersion]);\n    // A Go to onto another day: its bin, inspected once that day's bins are read — another day clears a selection. The\n    // reader moving to another day drops it.\n    const [going, setGoing] = useState<{ readonly id: string; readonly day: number }>();\n    useEffect(() => {\n        if (going === undefined) return;\n        if (going.day !== dayEpoch) { setGoing(undefined); return; }\n        if (!current) return;\n        setGoing(undefined);\n        inspect({ type: \"bin\", id: going.id });\n    }, [going, dayEpoch, current, inspect]);\n    /**\n     * A bin of a session's, where its draft places it: on the day in view (`here`), else on its own day — a bin its draft\n     * moved off the day is named, and gone to, where it now stands. One its draft removes, or holds where the board can't\n     * read it, is where the record holds it. `undefined` for none of these.\n     */\n    const binOf = (kind: string | undefined, entry: string): { readonly bin: Bin; readonly here: boolean } | undefined => {\n        if (kind === undefined || keyEqual(kind, PERIODS)) return undefined;\n        const here = plan.bins.get(entry);\n        if (here !== undefined) return { bin: here, here: true };\n        const moved = editing?.bins.get(entry) === undefined ? undefined : elsewhere(entry);\n        if (moved !== undefined) return { bin: moved, here: false };\n        const stored = held.bins.get(entry);\n        if (stored !== undefined) return { bin: stored, here: true };\n        const there = elsewhere(entry);\n        return there === undefined ? undefined : { bin: there, here: false };\n    };\n    // The field a refusal gone to names, asked of its bin's form: ringed there, it takes the keyboard as the form draws\n    // it, and so comes into view (`../shared/schedule/field-ask.tsx`).\n    const fieldAsks = useFieldAsks();\n    // A bin shown on its day and selected, as its issue's Show does — on its own day, where it is a bin of another: a\n    // conflict's Go to, a refusal's Show, and the warning button's first issue (#1525), whose field (`field`) its form\n    // gives the keyboard. A day's, or a bin the board can't read, opens the Issues tab.\n    const goTo = (kind: string | undefined, entry: string, field: option<string> = none) => {\n        const found = binOf(kind, entry);\n        if (found === undefined) { onIssues(); return; }\n        const on = dayStart(found.bin.at).getTime();\n        window.setView({ ...window.view, date: on });\n        fieldAsks.request(value.bin.kind.key, entry, field);\n        if (found.here) inspect({ type: \"bin\", id: entry });\n        else setGoing({ id: entry, day: on });\n    };\n    const onConflict = (issue: EditIssue) => {\n        const key = history?.sourceOf(issue);\n        goTo(key === undefined ? undefined : editing?.schedule.sessions.find((held) => keyEqual(held.key, key))?.kind, issue.entry);\n    };\n    const onIssue = (issue: EditIssue) => {\n        const key = history?.sourceOf(issue);\n        goTo(key === undefined ? undefined : editing?.schedule.sessions.find((held) => keyEqual(held.key, key))?.kind, issue.entry, issue.field);\n    };\n    // Each refusal holding Save, of every day's drafts, in the board's words (#1525): a bin by its code, or by its key for\n    // one the board can't read, and its field by its form's label.\n    const refusals = refused.map(({ kind, issue }): AllocationRefusal => {\n        const found = binOf(kind, issue.entry);\n        return { kind, issue, title: found === undefined ? issue.entry : binCode(context, found.bin, nouns),\n            text: refusalText(issue, keyEqual(kind, value.bin.kind.key) ? value.bin.kind.fields : []) };\n    });\n    // The Inspector (A55–A64): the end pane, its edits the same commands, its fits the same answers.\n    const end = useAllocationInspector({\n        value, domain, context, day, plan, held, loads, lines, slots, issues, layout: window.view.layout, selection, inspect, drag, fit, commands, retained,\n        without, reserving, shown: { lanes: lanesShown.keys, resources: resourcesShown.keys, arrivals: arrivalsShown.keys },\n        refusal, dismissRefusal: () => setRefusal(undefined), chooser, setChooser, book: bookPicked, firstFree,\n        tab: inspectorTab.tab, onTab: tab => setInspectorTab({ tab }), storageKey: key, onFind: findable ? onFind : undefined, finding, m: words.m,\n        refusals, onRefusal: refusal => goTo(refusal.kind, refusal.issue.entry, refusal.issue.field), read,\n    });\n    const toolbar = useAllocationToolbar({ ...window, value, styles, commands, editing, words, issues, refused: refusals.length, onIssues, onIssue, onConflict,\n        where: historyWhere, onAction, onPickerWeeks: setPickerWeeks,\n        status: value.periods.type === \"some\" ? statusText(heldPeriod) : undefined, published: heldPeriod.status.type === \"published\", unread: !current, publishing, picker: data.picker,\n        optimise: optimiseParts.toolbarItem, optimiseEntry: optimiseParts.entry, locked, issuesFlash: landing.lit && optimised !== undefined,\n        focus: focus === undefined ? undefined : { resource: context.resources.get(focus)!, load: loads.get(focus)!, hidden: resourcesShown.keys.type === \"some\" && !resourcesShown.keys.value.has(focus) },\n        onClearFocus: () => { setSelection(undefined); setLink(undefined); setChooser(undefined); }, nouns, search });\n    const readOnly = value.settings.readOnly || (current && !editableStatus(heldPeriod.status));\n    const notStarted = current && plan.bins.size === 0 && (value.periods.type === \"none\" || !started(period));\n    // A started day with no bins, once read (#1398, CL13): said once, in the Timeline's first row in view — with how to\n    // book one where the day takes edits — never before its read lands, and never as the narrowing's empty state.\n    const empty = current && plan.bins.size === 0 && !notStarted\n        ? { message: `No ${other(nouns.bin)} on ${dayWords}`, hint: commands.canEdit() ? `Drag ${a(nouns.arrival)} onto ${a(nouns.lane)} hour` : undefined } : undefined;\n    const sessionName = (kind: string) => kind === PERIODS ? (weekly ? \"Weeks\" : \"Days\") : value.bin.kind.name;\n    // Cold load (#1398, CL5): no day read yet, nor a narrowing's first membership — the frame's skeleton covers it, at the\n    // board's own row pitch. After it nothing covers: a day step, a narrowing or a new revision leave the frame live.\n    const cold = (!data.landed && data.error === undefined) || narrowing.some(n => !n.ready && n.loading);\n    // After cold load a read in flight — the day, a narrowing — leaves the frame live, main busy.\n    const busy = data.loading || narrowingLoading;\n    // The board's narrowing, and whether its rows are in (#1398): across a new one the Table keeps the line at the top of\n    // its view where the narrowing holds it — by its key, and the px into it — and else starts at its top, as the Sheet\n    // keeps its own.\n    const narrowingQuery = narrowingText(value, binChoices);\n    const narrowingSettled = !data.filtering && !narrowingLoading && !narrowingFailed;\n    const tableNarrowing = useMemo(() => ({ query: narrowingQuery, settled: narrowingSettled }), [narrowingQuery, narrowingSettled]);\n    return <NounsContext.Provider value={nouns}><BinFocusContext.Provider value={binFocused}><FieldAskProvider value={fieldAsks.asks}><Box ref={root} css={[styles.root, landingStyles.main]} data-allocation-frame=\"\"\n        data-allocation-readonly={readOnly ? \"\" : undefined} onPointerDownCapture={dropBinFocus} onKeyDownCapture={dropBinFocus} {...landing.attributes}>\n        <AllocationDataReader value={value} day={day} pickerDays={picker} choices={binChoices} onData={setData} />\n        <LoadingReveal waiting={line?.kind === \"loading\"}>\n        <BuilderFrame storageKey={`${key}.frame`} label={value.settings.title} loading={cold} loadingPitch={ROW_H} busy={busy} liveFooter phonePanel toolbar={toolbar}\n            start={start} end={end} panesRef={panes} onKeyDown={event => {\n            // The keys, never while typing (A6); each it acts on goes no further than the board (#1398).\n            if (event.defaultPrevented || typedInto(event.target)) return;\n            const action = historyShortcut(event);\n            if (action !== undefined && history !== undefined && !value.settings.readOnly && !locked && (commands.canEdit() || history.pending > 0)) { takeKey(event); onAction(action); }\n            else if (event.key === \"[\" || event.key === \"]\") { takeKey(event); window.step(event.key === \"[\" ? -1 : 1); }\n            // Esc closes the inspector's Chooser, else clears the pick, else the selection (A6) — none to let go of, it goes on.\n            else if (event.key === \"Escape\" && chooser !== undefined) { takeKey(event); setChooser(undefined); }\n            else if (event.key === \"Escape\" && pick !== undefined) { takeKey(event); setPick(undefined); }\n            else if (event.key === \"Escape\" && (selection !== undefined || link !== undefined || notice !== undefined || error !== undefined || refusal !== undefined)) {\n                takeKey(event);\n                setSelection(undefined); setLink(undefined); setNotice(undefined); setError(undefined); setRefusal(undefined);\n            }\n            // Delete unlinks the selected link, else removes the selected bin (A6, A68).\n            else if ((event.key === \"Delete\" || event.key === \"Backspace\") && link !== undefined && commands.canEdit()) { takeKey(event); commands.unlink(link.bin, link.resource); }\n            else if ((event.key === \"Delete\" || event.key === \"Backspace\") && selection?.type === \"bin\" && commands.canEdit()) { takeKey(event); keepOnBoard(selection.id); commands.remove(selection.id); }\n        }} rootProps={CLICK_FOCUS} banners={<>\n            {optimiseParts.banner}\n            {editing?.schedule.sessions.map(part => <SessionBanners key={part.key} session={part.session} words={words} name={sessionName(part.kind)} where={where(part.kind)}\n                onAction={action => editing.history.actOn(part.key, action)} />)}\n            {/* A published period — the day, or its week (#1550): every day of a published week is read-only. */}\n            {current && heldPeriod.status.type === \"published\" && <BannerView status=\"info\" title={`Published ${unit}`} description=\"Read-only view of the published plan.\" />}\n            {current && heldPeriod.status.type === \"other\" && <BannerView status=\"info\" title={`${heldPeriod.status.value} ${unit}`} description={`This ${unit} is read-only.`} />}\n            {notStarted && <BannerView status=\"info\" title=\"Day not started\" description={`Book ${a(nouns.arrival)} or reserve a slot to start this day's plan.`} />}\n            {/* A booking onto a resource with no free slot left (A36). */}\n            {notice !== undefined && <BannerView status=\"warning\" title={notice.word} description={notice.text} dismissible onDismiss={() => setNotice(undefined)} />}\n            {!custom.result.ok && <BannerView status=\"warning\" title=\"Additional checks unavailable\" description=\"The plan's additional checks could not run. Built-in checks are still shown.\" />}\n            {lanesShown.error !== undefined && <BannerView status=\"error\" title={`${nouns.lane.one} results unavailable`} description={lanesShown.error} actions={<Button size=\"xs\" variant=\"outline\" onClick={lanesShown.retry}>Retry</Button>} />}\n            {resourcesShown.error !== undefined && <BannerView status=\"error\" title={`${nouns.resource.one} results unavailable`} description={resourcesShown.error} actions={<Button size=\"xs\" variant=\"outline\" onClick={resourcesShown.retry}>Retry</Button>} />}\n            {arrivalsShown.error !== undefined && <BannerView status=\"error\" title={`${nouns.arrival.one} results unavailable`} description={arrivalsShown.error} actions={<Button size=\"xs\" variant=\"outline\" onClick={arrivalsShown.retry}>Retry</Button>} />}\n            {/* A fit that failed (F3): its message, and Retry; a drop meanwhile is refused with `fits unavailable`. */}\n            {fitError !== undefined && <BannerView status=\"error\" title=\"Fits couldn't be checked\" description={fitError} actions={<Button size=\"xs\" variant=\"outline\" onClick={fit.retry}>Retry</Button>} />}\n            {rangeError !== undefined && <BannerView status=\"error\" title=\"Day unavailable\" description={rangeError} />}\n            {/* A gesture's error; a read's is said once, in the board and on the footer's line (#1398, CL11). */}\n            {error !== undefined && <Box css={styles.error} role=\"alert\">{error}</Box>}\n        </>} footer={<AllocationFooter styles={styles} layout={window.view.layout} line={line} optimise={{ line: optimiseParts.line, legend: optimiseParts.legend }} />}>\n            {/* The board: the keyboard's surface and its anchor, never a tab stop, as the Calendar's is — a click on a part of\n                it that holds nothing focusable puts the keyboard here, where `[` and `]` step the day, and a bin Delete takes\n                away leaves it here. */}\n            <Box ref={main} css={styles.main} data-allocation-main=\"\" tabIndex={-1} data-allocation-layout={window.view.layout} data-allocation-day={dayEpoch}\n                aria-disabled={retained && read.state !== \"failed\" ? true : undefined} data-allocation-stale={stale ? \"\" : undefined}\n                data-allocation-narrow={narrow ? \"\" : undefined}>\n                {/* Below 480px of main, cards with explicit actions, each one of the board's commands (A78); resizing keeps the layout, the\n                    selection and the drafts, which are the frame's. */}\n                {narrow ? <AllocationCards value={value} context={context} styles={styles} day={day} plan={plan} held={held}\n                        sameBin={domain.sameBin} conflicted={conflicted} bounded={bounded} loads={loads} lines={lines} slots={slots} layout={window.view.layout} surface={drag.surface}\n                        selection={selection} select={inspect} follow={follow} editable={commands.canEdit()} commands={commands} fit={fit}\n                        without={without} reserving={reserving} visibleLanes={lanesShown.keys} visibleResources={resourcesShown.keys}\n                        visibleArrivals={arrivalsShown.keys} clearFilters={clearFilters} read={read} optimised={optimised} lit={landing.lit}\n                        bookOnto={(arrival, resource) => { setRefusal(undefined); bookOnto(scene, { kind: \"arrival\", arrival }, resource); }} />\n                    : window.view.layout === \"timeline\" ? <AllocationTimeline value={value} context={context} styles={styles} format={format} day={day} plan={plan}\n                        held={held} sameBin={domain.sameBin} conflicted={conflicted} bounded={bounded} loads={loads} slots={slots} issues={issues} visible={resourcesShown.keys} visibleLanes={lanesShown.keys}\n                        visibleArrivals={arrivalsShown.keys} read={read} empty={empty} optimised={optimised} lit={landing.lit}\n                        clearFilters={clearFilters} selection={selection} focus={focus} highlight={highlight} picked={pickGrip !== undefined} book={bookPicked}\n                        editable={commands.canEdit()} select={inspect} choose={id => { inspect({ type: \"bin\", id }); setChooser(id); panes.current?.reveal(\"end\"); }} follow={follow}\n                        link={link} selectLink={selectLink} unlink={(bin, resource) => commands.unlink(bin, resource)} drag={drag} candidates={domain.candidates} />\n                    : <AllocationTable value={value} domain={domain} context={context} styles={styles} format={format} day={day} plan={plan} held={held}\n                        sameBin={domain.sameBin} conflicted={conflicted} bounded={bounded} loads={loads} slots={slots} selection={selection} editable={commands.canEdit()} select={inspect} follow={follow}\n                        drag={drag} commands={commands} fit={fit} without={without} reserving={reserving} highlight={highlight} book={bookPicked} read={read}\n                        visibleLanes={lanesShown.keys} visibleResources={resourcesShown.keys} visibleArrivals={arrivalsShown.keys} clearFilters={clearFilters}\n                        anchor={anchor.table} onAnchor={onTableAnchor} narrowing={tableNarrowing} optimised={optimised} lit={landing.lit} />}\n            </Box>\n        </BuilderFrame>\n        </LoadingReveal>\n    </Box></FieldAskProvider></BinFocusContext.Provider></NounsContext.Provider>;\n}\n\n/** The board over the app's records: its key, its day — written into the bins' source — and its editing, around the frame. */\nfunction AllocationRoot({ value, storageKey }: EastChakraAllocationProps) {\n    const key = `${storageKey}.${value.id.type === \"some\" ? value.id.value : \"allocation\"}`;\n    const window = useAllocationWindow(value, key);\n    // The bins' source of the slice holds the day, which the board's own navigation writes (D9), so the rail's count and a Save's notice\n    // read the window it reads.\n    const chrome = value.slice.type === \"some\" ? value.slice.value : undefined;\n    const next = new Date(window.day.getTime() + DAY);\n    const binError = useSourceWindow(chrome, value.bin.kind.key, window.day, next, \"The day could not be applied\");\n    // The reference record's source (#1551) holds the day too, as the bins' does: the check reads the day's rows of it beside them.\n    const referenceError = useSourceWindow(chrome, SCHEDULE_REFERENCE, window.day, next, \"The day could not be applied to the reference record\");\n    const rangeError = binError ?? referenceError;\n    const frame = { value, storageKey: key, window, rangeError };\n    return value.settings.readOnly ? <AllocationFrame {...frame} editing={undefined} /> : <EditableAllocation {...frame} />;\n}\n\n/** The e3 renderer owns the frame; callers author only the Allocation tag and its bound data. */\nexport function EastChakraAllocation(props: EastChakraAllocationProps) {\n    const error = configError(props.value);\n    return error === undefined ? <AllocationRoot {...props} /> : <BannerView status=\"error\" title=\"Allocation configuration\" description={error} />;\n}\nimplementUIComponent(AllocationComponent, EastChakraAllocation);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's geometry — every row and slot height, and the widths its\n * elements draw at, per density, in ONE table (#817).\n *\n * The model computes row heights from it (`rowHeight`, the virtualizer's sizes\n * and the paging ledger's window heights), and the canvas writes it once, on\n * its body, as CSS variables (`--plan-row-h`, `--plan-rail-h`, …) that the\n * recipe reads wherever it draws one of these heights. The ledger's \"band px\n * == rendered px\" invariant rests on the two agreeing; before this they were\n * three hand-kept copies (model constants, recipe pixels, inline heights).\n *\n * The widths are the narrowest a bar, a chip and a bucket cell draw, and each\n * mark's glyph across (`--plan-bar-min-w`, …): a link's end meets an element\n * where it draws (#1258), so the ribbons lay out from the same numbers the\n * recipe draws the elements at.\n *\n * @packageDocumentation\n */\n\n/**\n * How far a bucket cell sits in from its bucket's edges and its lane's, and a\n * cards chip from its own ends, each side (px). The renderers place both by it,\n * and a link meets either where it draws (#1258).\n */\nexport const PLAN_CELL_INSET = 2;\n\n/** Every row and slot height the canvas lays out from, and the widths its elements draw at, in px. */\nexport interface PlanGeometry {\n    /** Span / buckets / cards / table rows — the shared default row. */\n    row: number;\n    /** The rule under a row, INSIDE its height: its plot cell is the row less\n     *  this, and a bar centres in the plot cell (the link ribbons register to\n     *  it, #818). */\n    rule: number;\n    /** The floor of a row with a two-line gutter (a sub line, or `stacked`). */\n    rowStacked: number;\n    /** A group band. */\n    group: number;\n    /** A collapsed group's summary heat strip. */\n    groupStrip: number;\n    /** A chart row at rest (spark). */\n    chartSpark: number;\n    /** A chart row expanded (the default when no `expandedHeight` is declared). */\n    chartExpanded: number;\n    /** A heat row — its cells plus {@link PlanGeometry.heatInset} above and below. */\n    heatRow: number;\n    /** The inset above and below a heat cell. */\n    heatInset: number;\n    /** A heat cell's minimum height. */\n    heatCellMin: number;\n    /** A links-focus rail — a lone unrelated row, collapsed (R1). */\n    rail: number;\n    /** A links-focus gap band — a run of unrelated rows (R1). */\n    gap: number;\n    /** An expand-focus context strip — an unfocused row, compressed (R2). */\n    strip: number;\n    /** A mark inside a context strip. */\n    stripMark: number;\n    /** A vertical multi-series table row: {@link PlanGeometry.tablePad} + one line per series. */\n    tableLine: number;\n    tablePad: number;\n    /** A laned bucket row: 2 × `lanePad` + one `laneCell` per lane + a `laneGap` between. */\n    laneCell: number;\n    laneGap: number;\n    lanePad: number;\n    /** A span run bar. */\n    bar: number;\n    /** A collapsed parent's rollup band. */\n    rollBar: number;\n    /** A bucket tile. */\n    tile: number;\n    /** A cards chip. */\n    chip: number;\n    /** A weight bar. */\n    weight: number;\n    /** A segment track. */\n    segment: number;\n    /** The chrome bands: horizon brush (its strip and its lens), ruler,\n     *  footer. The toolbar band is the frame's (#1193). */\n    brush: number;\n    ruler: number;\n    footer: number;\n    /** The horizon's lens under its strip (#949) — the connectors from the\n     *  window it selected down to the plot's edges. The strip is the band\n     *  less this. */\n    lens: number;\n    /** The horizon brush's tallest histogram bar: the strip less the 4px over it (#1438). */\n    brushBar: number;\n    /** A narrow group card's strip body. */\n    narrowStrip: number;\n    /** The shortest a failed window's band renders (#811) — its reason and its\n     *  Retry stay legible even in a short last window. */\n    failedBandMin: number;\n    /** An exception mark's triangle, its point to its base. */\n    markTriangle: number;\n    // ── Widths (#1258) — a key ending `Width` is written `--plan-…-w` ──\n    /** The narrowest a span bar draws, its padding and its look's ring\n     *  inside it: a run shorter than this draws this wide from its start. */\n    barMinWidth: number;\n    /** The narrowest a cards chip draws, its padding and ring inside it. */\n    chipMinWidth: number;\n    /** The narrowest a bucket cell draws, its padding inside it. */\n    cellMinWidth: number;\n    /** A tile's floor (#1266): the narrowest it draws where its cell has the\n     *  room, and what a folding cell keeps beside its `+n` chip (#1267). */\n    tileMinWidth: number;\n    /** The narrowest a tile draws at all, its padding given way: a proposal's\n     *  two 1.5px rings (#1276). A cell that leaves its tiles less room draws\n     *  none of them, and shows its `+n` chip alone. */\n    tileLeastWidth: number;\n    /** A milestone's dot, across and down. */\n    markDotWidth: number;\n    /** A decision's diamond, each side before it turns 45° — its corners then\n     *  reach √2 times this across and down. */\n    markDiamondWidth: number;\n    /** An exception's triangle, across its base. */\n    markTriangleWidth: number;\n    /** The box an event mark's icon fits in, across and down. */\n    markIconWidth: number;\n}\n\nconst DEFAULT: PlanGeometry = {\n    row: 32, rule: 1, rowStacked: 42,\n    group: 26, groupStrip: 28,\n    chartSpark: 32, chartExpanded: 88,\n    // A heat row is a single-line row like any other (#949).\n    heatRow: 32, heatInset: 3, heatCellMin: 16,\n    rail: 11, gap: 22, strip: 16, stripMark: 7,\n    tableLine: 11, tablePad: 6,\n    laneCell: 22, laneGap: 2, lanePad: 3,\n    bar: 20, rollBar: 12,\n    tile: 16, chip: 18, weight: 20, segment: 20,\n    brush: 38, ruler: 28, footer: 28, lens: 6, brushBar: 28,\n    narrowStrip: 24,\n    failedBandMin: 64,\n    markTriangle: 9,\n    // A bar's padding is 7 each side and its look's dashed ring 1.5 (17); a\n    // chip's 9 and 1.5 (21); a cell's 6 each side (12). A tile's padding gives\n    // way to its room, down to its two 1.5px rings (3).\n    barMinWidth: 18, chipMinWidth: 22, cellMinWidth: 12, tileMinWidth: 20, tileLeastWidth: 3,\n    markDotWidth: 10, markDiamondWidth: 11, markTriangleWidth: 10, markIconWidth: 12,\n};\n\n/** The two densities' tables. Dense tightens the shared row — the heat row\n *  with it — and the bars that sit in it; everything else keeps its size. */\nexport const PLAN_GEOMETRY: Readonly<Record<\"default\" | \"dense\", Readonly<PlanGeometry>>> = {\n    default: DEFAULT,\n    dense: { ...DEFAULT, row: 24, heatRow: 24, bar: 16 },\n};\n\n/** A coarse pointer's horizon band (#1438): a 44px strip under its lens, its bars up to 40. */\nconst COARSE_BRUSH: Pick<PlanGeometry, \"brush\" | \"brushBar\"> = { brush: 50, brushBar: 40 };\n\n/** Each density's table on a coarse pointer, made once. */\nconst COARSE_GEOMETRY: Readonly<Record<\"default\" | \"dense\", Readonly<PlanGeometry>>> = {\n    default: { ...PLAN_GEOMETRY.default, ...COARSE_BRUSH },\n    dense: { ...PLAN_GEOMETRY.dense, ...COARSE_BRUSH },\n};\n\n/**\n * A density's geometry, on the pointer the canvas has.\n *\n * @param dense - Whether the canvas is dense (`density: compact`)\n * @param coarse - Whether the pointer is coarse: the horizon band is taller (#1438)\n * @returns The table\n */\nexport function planGeometry(dense: boolean, coarse = false): Readonly<PlanGeometry> {\n    const tables = coarse ? COARSE_GEOMETRY : PLAN_GEOMETRY;\n    return dense ? tables.dense : tables.default;\n}\n\n/**\n * The CSS variable a geometry entry is written as — a height `row` →\n * `--plan-row-h`, `heatInset` → `--plan-heat-inset-h`; a width, its key ending\n * `Width`, `barMinWidth` → `--plan-bar-min-w`.\n *\n * @param key - The entry\n * @returns The variable's name\n */\nexport function planGeometryVar(key: keyof PlanGeometry): `--plan-${string}-${\"h\" | \"w\"}` {\n    const width = key.endsWith(\"Width\");\n    const name = (width ? key.slice(0, -\"Width\".length) : key).replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);\n    return `--plan-${name}-${width ? \"w\" : \"h\"}`;\n}\n\n/**\n * The geometry as the CSS variables the recipe reads — written once, on the\n * canvas body.\n *\n * @param geometry - The canvas's table\n * @returns Variable name → px value\n */\nexport function planGeometryStyle(geometry: Readonly<PlanGeometry>): Record<string, string> {\n    const out: Record<string, string> = {};\n    for (const key of Object.keys(geometry) as (keyof PlanGeometry)[]) {\n        out[planGeometryVar(key)] = `${geometry[key]}px`;\n    }\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's row-facing contexts (`Plan Spec.md` §3): the one shared scale\n * every row positions against, and the dispatch channel row components report\n * interactions through. **No `PlotGutterProvider`** — nothing inside a Plan\n * negotiates chrome; rows are pure functions of the scale they receive.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext } from \"react\";\nimport { type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport type { PlanScale } from \"./scale.js\";\nimport type { PlanEvent } from \"./plan-state.js\";\nimport { PLAN_GEOMETRY, type PlanGeometry } from \"./geometry.js\";\n\n/** One decoded element ref — the generalized resolvers' subject. */\nexport type PlanElementRefValue = ValueTypeOf<typeof Plan.Types.ElementRef>;\n\n/** A decoded element resolver (the root's `popover` / `hover` some-value). */\nexport type PlanElementResolver =\n    Extract<ValueTypeOf<typeof Plan.Types.Root>[\"popover\"], { type: \"some\" }>[\"value\"];\n\n/**\n * What an element reports its clicks to. Popovers and hover cards are not an\n * element's business: the canvas's one overlay layer opens them from the\n * element's DOM identity (#816), running the LATEST root's resolvers with the\n * element's ref — a `none` result opens no surface (`Plan Data Interface.md`\n * §3.3).\n */\nexport interface PlanResolvers {\n    /**\n     * The element-click funnel — the root's ONE `onElementClick` (#824), called\n     * with the clicked element's ref: a run, a tile, a mark, a chip, a cell or\n     * a link ribbon. `undefined` when the root declares none.\n     */\n    onElementClick?: ((ref: PlanElementRefValue) => void) | undefined;\n}\n\n/** The shared scale, provided once by the canvas. */\nexport const PlanScaleContext = createContext<PlanScale | null>(null);\n\n/** The interaction dispatch channel (the canvas controller's `dispatch`). */\nexport const PlanDispatchContext = createContext<(e: PlanEvent) => void>(() => undefined);\n\n/**\n * The hover-cursor controller (#609) — display-only chrome, written straight\n * to the DOM: `move` sets ONE CSS variable on the canvas body (every row's\n * hairline positions from it) and writes the ruler chip's label/position;\n * `leave` hides both. Never React state: routing a pointermove through the\n * reducer re-rendered every mounted row once per event.\n */\nexport interface PlanCursor {\n    /** The pointer is at a window fraction over a row plot. */\n    move(frac: number): void;\n    /** The pointer left a row plot. */\n    leave(): void;\n    /**\n     * Follow the hovered BUCKET (#743) — the listener hears the bucket index\n     * each time the pointer crosses into another one (`-1` once it is over no\n     * bucket, or gone), and at once with the current one. A chart row's\n     * crosshair readout writes the DOM from it, so a hover still renders\n     * nothing.\n     *\n     * @param listener - Called with the hovered bucket index\n     * @returns Stop listening\n     */\n    subscribe(listener: (bucket: number) => void): () => void;\n}\n\n/** The cursor channel (inert by default — chrome simply never shows). */\nexport const PlanCursorContext = createContext<PlanCursor>({\n    move: () => undefined,\n    leave: () => undefined,\n    subscribe: () => () => undefined,\n});\n\n/** The element-click channel (no funnel when the root declares no `onElementClick`). */\nexport const PlanResolversContext = createContext<PlanResolvers>({});\n\n/** The canvas's geometry — the one height table for its density (#817). */\nexport const PlanGeometryContext = createContext<Readonly<PlanGeometry>>(PLAN_GEOMETRY.default);\n\n/**\n * The canvas's geometry — every row and slot height, for its density.\n *\n * @returns The table (the default density outside a Plan)\n */\nexport function usePlanGeometry(): Readonly<PlanGeometry> {\n    return useContext(PlanGeometryContext);\n}\n\n/**\n * The shared scale — throws when mounted outside a Plan (row components are\n * canvas-internal; there is no standalone mounting).\n *\n * @returns The canvas's scale\n */\nexport function usePlanScale(): PlanScale {\n    const scale = useContext(PlanScaleContext);\n    if (scale === null) throw new Error(\"[Plan] row rendered outside PlanScaleContext\");\n    return scale;\n}\n\n/**\n * The interaction dispatch channel.\n *\n * @returns The canvas's `dispatch`\n */\nexport function usePlanDispatch(): (e: PlanEvent) => void {\n    return useContext(PlanDispatchContext);\n}\n\n/**\n * The hover-cursor controller.\n *\n * @returns The canvas's cursor channel (a no-op outside a Plan)\n */\nexport function usePlanCursor(): PlanCursor {\n    return useContext(PlanCursorContext);\n}\n\n/**\n * What an element reports its clicks to.\n *\n * @returns The click funnel, when the root declares `onElementClick`\n */\nexport function usePlanResolvers(): PlanResolvers {\n    return useContext(PlanResolversContext);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The paged canvas's vocabulary (#577) — the page size, the failed-band floor,\n * the decoded source type and the viewport report — shared by the paging\n * driver, the window reader and the chrome.\n *\n * The driver itself is framework-free since #815: `controller/paging.ts` holds\n * the ledger and the residency as plain state, and the canvas controller owns\n * it. (This module held the React hook that sequenced them through four\n * effects that set each other's state.)\n *\n * @packageDocumentation\n */\n\nimport type { option } from \"@elaraai/east\";\nimport type { PlanBand, PlanRootValue, PlanWireBlock } from \"./model.js\";\nimport { elementsIn, type CarriedEntry, type WindowedSourceValue } from \"@elaraai/east-ui-components/internal\";\nimport { PLAN_GEOMETRY } from \"./geometry.js\";\n\n/**\n * The decoded windowed arm — `paged`; `pinned` with its revision and refresh;\n * or `live` with its narrowing too, the rail's `rows` source (#1354) — the\n * derived source at the canvas's blocks (#823). A source the canvas composes\n * over another — a paged `data` or a paged resource kind with the event kinds'\n * rows in every window (#1192, #1199) — names the snapshot of the data its\n * windows read apart from its revision, which moves too when its windows are\n * read again over the same data: new events placed on them, new drafts. A key\n * search's answer indexes the snapshot alone.\n */\nexport type PlanPagedSourceValue = WindowedSourceValue<PlanRootValue[\"rows\"]> & {\n    /** The snapshot of the data its windows read, `none` while it resolves; omitted, its revision is that snapshot. */\n    readonly snapshot?: (() => option<string>) | undefined;\n    /**\n     * A window's blocks as the source draws them NOW, from the entries the window carried (#1599), reading nothing:\n     * the canvas's unsaved changes, and what a Save landed, in their entries' place, with whatever the source composes\n     * over them. What a window standing in while it is read again is drawn as, so a change made meanwhile is drawn at\n     * once. `undefined` where it cannot — and for a source that draws its windows as they were read, which has none.\n     */\n    readonly redraft?: ((entries: readonly CarriedEntry[]) => readonly PlanWireBlock[] | undefined) | undefined;\n    /** What a redraft draws from, as text that moves when it does: a window standing in is drawn again only then. */\n    readonly redrafted?: (() => string) | undefined;\n};\n\n/**\n * The windowed arm a source the canvas composes over another rides: that\n * source's own — a pinned source stays pinned, and a live one, the rail's\n * `rows` source, stays live (#1354), so the driver follows its narrowing.\n *\n * @param rows - The root's rows, a windowed arm\n * @returns The arm's name\n */\nexport function windowedArm(rows: PlanRootValue[\"rows\"]): \"paged\" | \"pinned\" | \"live\" {\n    return rows.type === \"pinned\" || rows.type === \"live\" ? rows.type : \"paged\";\n}\n\n/** Source elements per window — the IR's, since its editing session reads an\n *  entry back from the very window the canvas paged it in (#880). */\nexport { PLAN_PAGE_SIZE } from \"@elaraai/e3-ui/internal\";\n\n/** The shortest a failed window's band renders (#811) — its reason and its\n *  Retry must stay legible even in a short last window, or before any window\n *  has taught the ledger its geometry. The geometry table's entry (#817); the\n *  same at every density. */\nexport const FAILED_BAND_MIN_PX = PLAN_GEOMETRY.default.failedBandMin;\n\nexport type { PlanBand, PlanWindowFailure } from \"./model.js\";\n\n/**\n * Where the viewport is, in the caller's own terms.\n *\n * @remarks\n * `VirtualRows` reports a mounted range in BODY-ITEM indices, and the body is\n * the canvas's business — it interleaves gap bands under a links focus, hides\n * collapsed subtrees, pins rows above the scroll. So the canvas says which ROW\n * (or which band) the viewport is over, and the driver maps that back to a\n * block and a window through the origin map (#823: each paged block pages on\n * its own, so demand follows the block the viewport is in). No layout\n * knowledge crosses the boundary. With it, where the caller can say, the\n * windows the view shows (`shows`): what the footer's loading line and the\n * frame's busy follow (#1398), never a window read ahead of the view.\n */\nexport type PlanViewport = (\n    | { kind: \"row\"; key: string }\n    | {\n        kind: \"band\";\n        /** The block whose band it is (#823). */\n        block: number;\n        at: \"head\" | \"tail\";\n        /** Pixels from the band's own top to the viewport center, when the\n         *  caller knows them (`VirtualRows`' center report). Without them the\n         *  driver can only name the window adjacent to the run — a far\n         *  scrollbar drag then walks the gap instead of rebasing (#612). */\n        px?: number | undefined;\n    }\n    /** A failed window's band — it names its own block and window (#811). */\n    | { kind: \"window\"; block: number; w: number }\n) & {\n    /** The windows the view shows — each row's, a run's nearest its rows; absent, the driver takes any window in flight as the view's. */\n    shows?: readonly number[] | undefined;\n};\n\n/** Elements the band covers, for its caption. */\nexport function bandElements(band: PlanBand): number {\n    return Math.max(0, band.to - band.from + 1);\n}\n\n/** Re-exported so the renderer can size a band's own slot. */\nexport { elementsIn };\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Every word the Plan says itself (#820) — ONE typed message table. The\n * canvas's own chrome (the toolbar, the footer, the diagnostics, a failed\n * run's line, the narrow layout's tabs and cards), the words it gives a reader for what\n * it shows only by shape or colour, and what its live region announces all\n * come from here. What the AUTHOR wrote — a row's label,\n * a footer item, a series title — is data, and never passes through it.\n *\n * Each message is a function of named parameters, so a translation can put\n * them where its grammar wants them and choose its own plural forms. Numbers\n * and dates arrive already formatted for the canvas's locale (`words.ts`);\n * `n` is the raw count beside a formatted `count`, for plural rules.\n *\n * English is the default. A host overrides any subset for a subtree with\n * {@link PlanMessagesProvider}; the locale numbers and dates format in comes\n * from react-aria's `I18nProvider` above the app (the browser's otherwise).\n *\n * @packageDocumentation\n */\n\nimport { createContext, createElement, useContext, useMemo, type ReactNode } from \"react\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { PlanPayloadType } from \"@elaraai/e3-ui/internal\";\nimport { editingMessages, getSomeorUndefined, type EditingMessages } from \"@elaraai/east-ui-components\";\nimport { withArticle } from \"../shared/article.js\";\nimport { pagedLoadingMessages, type PagedLoadingMessages } from \"../shared/loading.js\";\nimport { eventsNotCounted, hiddenByText, joinedWords as joined, kindPlural as pluralName, lowerWord, type HiddenWords } from \"../shared/schedule/words.js\";\nimport { timeMessages, type TimeMessages } from \"../shared/time/scale.js\";\n\n/** A lifecycle state as the words name it — `EventStateType`, with the\n *  proposal arms spelled out. */\nexport type PlanStateWord =\n    \"estimated\" | \"added\" | \"recommended\" | \"removed\" | \"confirmed\" | \"in-progress\" | \"actual\" | \"rejected\";\n\n/** The grains, as a message receives them. */\nexport type PlanGrainWord = \"group\" | \"resource\";\n\n/** An axis kind, as a message receives it (#631). */\nexport type PlanAxisWord = \"time\" | \"number\" | \"ordinal\";\n\n/** A part of the canvas that can fail to render on its own (#811). A row is\n *  named to a reader by its label, and in `data-plan-error` by its key. */\nexport type PlanPart =\n    | { kind: \"row\"; key: string; label: string }\n    | { kind: \"group\"; label: string }\n    | { kind: \"expandRender\" }\n    | { kind: \"expandGutter\" }\n    | { kind: \"linksLayer\" }\n    | { kind: \"popover\" }\n    | { kind: \"hoverCard\" };\n\n/** The unit a horizon caption counts in — a time resolution, or a number axis's step. */\nexport type PlanHorizonUnit = \"hour\" | \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\" | \"step\";\n\n/** The period a horizon's bars count by (#1438). */\nexport type PlanHorizonBucket = \"month\" | \"quarter\" | \"year\";\n\n/** A chart layer kind, as the chart's summary names it. */\nexport type PlanChartLayerWord = \"line\" | \"area\" | \"column\" | \"scatter\" | \"band\";\n\n/** An event mark's kind, as its name says it. */\nexport type PlanMarkWord = \"milestone\" | \"decision\" | \"exception\";\n\n/** A links-focus family tag (R1). */\nexport type PlanFocusTagWord = \"UPSTREAM\" | \"DOWNSTREAM\" | \"LINKED\";\n\n/** A tab of the library pane (#1195): the templates, the backlog, the series, or one of the author's own. */\nexport type PlanLibraryTabWord = \"events\" | \"backlog\" | \"series\" | \"tab\";\n\n/** When a backlog event is due, as the Backlog tab groups it (PB28). */\nexport type PlanDueWord = \"thisWeek\" | \"nextWeek\" | \"later\" | \"none\";\n\n/** A section of the inspector pane (#1197). */\nexport type PlanInspectorSection = \"fields\" | \"bulk\" | \"window\" | \"measures\";\n\n/** A fact the inspector pane shows of an event or a row (#1197). */\nexport type PlanInspectorFact = \"resource\" | \"start\" | \"end\" | \"at\" | \"lane\" | \"state\" | \"quantity\" | \"group\" | \"events\" | \"hours\" | \"quantities\";\n\n/**\n * What the inspector pane counts when nothing is selected (#1197, PB41): the\n * hours over the rows drawn (#1039), where a kind read by its cells counts\n * its events exactly and its hours over the rows on screen. The hours are those\n * of the kinds read — none where no kind's are, a kind past the cap named\n * among those not counted.\n */\nexport type PlanInspectorStat = \"events\" | \"hours\" | \"hoursInView\" | \"backlog\";\n\n/**\n * The Plan's message table.\n *\n * @remarks\n * Parameters named `count`, `from`, `to`, `total`, `index` and `percent` are\n * numbers already formatted for the locale (a `percent` with its sign); `n`\n * is the raw number beside them, for plural rules. Dates (`date`, `at`,\n * `bucket`, `span`) are words the locale formatted.\n *\n * It carries the editing session's messages too ({@link EditingMessages},\n * #880: the history bar and the draft issues), so a host translates the\n * canvas's history bar where it translates the canvas; the time scale's\n * ({@link TimeMessages}, #1148: its ruler's week and quarter ticks and their\n * words), which the scale the Plan shares with the Calendar speaks; and the\n * footer's loading line over a paged source ({@link PagedLoadingMessages},\n * #1398: `lineLoading`, `lineFiltering`, `lineFailed`, `lineShort`), in what\n * the rail counts the rows in.\n */\nexport interface PlanMessages extends EditingMessages, TimeMessages, PagedLoadingMessages, HiddenWords {\n    // ── The frame ──────────────────────────────────────────────────────────\n    /** The treegrid's accessible name. */\n    gridLabel: () => string;\n    /** No window: a time or number axis that states none, with no bound slice\n     *  range to supply one (#822 — the rows never do). */\n    noWindow: () => string;\n    /** No window: an ordinal axis with no values. */\n    noWindowOrdinal: () => string;\n    /** A part of the canvas, named — what its render-failure line says failed. */\n    partName: (p: { part: PlanPart }) => string;\n    /** A part's render-failure line. */\n    partFailed: (p: { part: string; message: string }) => string;\n    /** A row whose instants ride another arm than the axis (#811). */\n    axisMismatch: (p: { found: PlanAxisWord; expected: PlanAxisWord }) => string;\n    /** A row repeating the id of an earlier row on the canvas (#822) — `id` is\n     *  the id's canonical text. */\n    duplicateRow: (p: { id: string }) => string;\n\n    // ── The toolbar ────────────────────────────────────────────────────────\n    /** The grain segment's accessible name. */\n    grainLabel: () => string;\n    /** A grain's name — the grain segment and the ruler caption. */\n    grainName: (p: { grain: PlanGrainWord }) => string;\n    /** Expand every parent row, including nested groups. */\n    expandAll: () => string;\n    /** Collapse every parent row, including nested groups. */\n    collapseAll: () => string;\n    /** The resolution segment's (and its one-chip menu's) accessible name. */\n    resolutionLabel: () => string;\n    /** A time resolution's name — its segment and its one-chip menu. */\n    resolutionName: (p: { resolution: string }) => string;\n    /** The key search's icon — what a toolbar short of room folds its box\n     *  to — and the head of the popover it opens the box in (#1193). */\n    keySearch: () => string;\n    /** What the key search says where no record matches: it finds a record, and the rail narrows by its fields (#1513). */\n    keySearchNoMatches: () => string;\n    /** Why a pick could not go to its row, where the read threw no words of its own (#1513). */\n    keySearchUnplaced: () => string;\n    /** Why the choices hiding a row could not be cleared, where the clear threw no words of its own (#1513). */\n    keySearchUncleared: () => string;\n    /** The overlaps chip (#1198, PB52) — `3 overlaps`: the pairs of events\n     *  that overlap in the window. */\n    overlaps: (p: { n: number; count: string }) => string;\n    /** The chip shortened to its count — `3` — what a toolbar short of room keeps of it. */\n    overlapsShort: (p: { n: number; count: string }) => string;\n    /** The chip's accessible name: its count, and what a click on it does. */\n    overlapsLabel: (p: { n: number; count: string }) => string;\n\n    // ── Diagnostics (#811) ─────────────────────────────────────────────────\n    /** Rows drawn as diagnostic rows. */\n    rowsSkipped: (p: { n: number; count: string }) => string;\n    /** The same chip's accessible name, where it seeks to the first. */\n    rowsSkippedSeek: (p: { n: number; count: string }) => string;\n    /** A source that could not report its size. */\n    sourceUnavailable: (p: { reason: string }) => string;\n    /** A key search that failed. */\n    searchFailed: (p: { reason: string }) => string;\n    /** An axis the grid had to truncate. */\n    truncated: (p: { n: number; count: string }) => string;\n\n    // ── The footer's counts (#1193) ────────────────────────────────────────\n    /** The event kinds' events in the window — `64 events`. */\n    footerEvents: (p: { n: number; count: string }) => string;\n    /**\n     * The event kinds' events in the window when a kind's are not counted (#1039): its count is no number of them, the\n     * days they run on — `13 events, print jobs not counted`; `count` `undefined` when no kind's are counted, `print\n     * jobs not counted`. `kinds` are their names as running text writes them.\n     */\n    footerEventsNotCounted: (p: { n: number; count: string | undefined; kinds: readonly string[] }) => string;\n    /** The event kinds' unscheduled events — `9 in backlog`. */\n    footerBacklog: (p: { n: number; count: string }) => string;\n    /** The changes waiting on Save — `4 pending`. */\n    footerPending: (p: { n: number; count: string }) => string;\n    /** When an event kind's record was last saved — `saved 14:02`: `when` is its time today, else its date and time. */\n    footerSaved: (p: { when: string }) => string;\n    /** What a source's Save notice counts (#1344) — the `rows` source's `row`, `rows`; an event kind's `print job event`: `kind` its name as running text writes it. */\n    saveNoticeNoun: (p: { kind: string | undefined; n: number }) => string;\n    /**\n     * What the footer's loading line names a failed read of the event kinds' rows by (#1398, CL3): the kinds whose own\n     * events it could not read, as the rail counts them — `print job events`, `print job events and stop events`\n     * (`kinds` each kind's noun) — else, none of theirs failing, the rows.\n     */\n    eventsFailedNoun: (p: { kinds: readonly string[] }) => string;\n\n    // ── The narrowing (#1344) ──────────────────────────────────────────────\n    /** A source of the slice whose narrowing could not be read: its banner's title — `Customers results unavailable`; `name` its label, or the noun the rail counts it in. */\n    narrowingUnavailable: (p: { name: string }) => string;\n    /** Its results moved while they were read. */\n    narrowingChanged: (p: { name: string }) => string;\n    /** Its results could not be read. */\n    narrowingFailed: (p: { name: string }) => string;\n    /** The window could not be written into a source of the slice: its banner's title — on a time axis, its dates. */\n    windowUnavailable: (p: { axis: PlanAxisWord }) => string;\n    /** A library tab the rail leaves no card — `No templates match the filters`; `name` an author's tab's name as running text writes it. */\n    libraryNarrowed: (p: { tab: PlanLibraryTabWord; name: string }) => string;\n    /** The line under it. */\n    libraryNarrowedHint: (p: { tab: PlanLibraryTabWord; name: string }) => string;\n\n    // ── Too many events to draw (#1039) ────────────────────────────────────\n    /** The notice's title: a kind with more events in view than it draws, and no summary to shade them at this\n     *  resolution — `12,480 print job events in view`; `kind` its name as running text writes it. */\n    tooManyEvents: (p: { kind: string; n: number; count: string }) => string;\n    /** The notice's title for a kind whose count is no number of its events, a day index's (#1039) — `Print job events in\n     *  view: not counted`; `kind` its name as running text writes it. */\n    tooManyEventsNotCounted: (p: { kind: string }) => string;\n    /** The line under it: the resolution its summary shades at — `Too many to draw at this resolution: switch to month to\n     *  see where they fall`; `undefined`, it has none. */\n    tooManyEventsHint: (p: { resolution: string | undefined }) => string;\n\n    // ── The library pane (#1195) ───────────────────────────────────────────\n    /** The library pane's name. */\n    libraryPane: () => string;\n    /** A library tab — the author names their own tabs. */\n    libraryTab: (p: { tab: Exclude<PlanLibraryTabWord, \"tab\"> }) => string;\n    /** A library tab's empty state: its title — `No templates`, `Backlog clear`, `Nothing in Customers` (PB30); `name` is an author's tab's. */\n    libraryEmpty: (p: { tab: PlanLibraryTabWord; name: string }) => string;\n    /** The line under it. */\n    libraryEmptyHint: (p: { tab: PlanLibraryTabWord; name: string }) => string;\n    /** What a library tab's search box counts its cards as — `template`, `templates`. */\n    libraryNoun: (p: { tab: PlanLibraryTabWord; n: number }) => string;\n    /** What a library tab's cards are grouped by: its grouping control's words. */\n    libraryGroupBy: (p: { tab: PlanLibraryTabWord }) => string;\n    /** A template card's head: its kind's name, then the template's `group` (PB27) — `Print job · Jobs`. */\n    templateGroup: (p: { kind: string; group: string | undefined }) => string;\n    /** A template card's line — `Print job · 6 h · presses`: its kind's name, how long it runs (an instant kind's runs none), and the resource kinds it is placed on. */\n    templateLine: (p: { kind: string; duration: string | undefined; resources: readonly string[] }) => string;\n    /** A backlog card's line — `6 h · Press A · due Fri 16`: how long it takes, the resource it is on (`undefined`, on none), and when it is due. */\n    backlogLine: (p: { duration: string; resource: string | undefined; due: string | undefined }) => string;\n    /** When a backlog event is due — `due Fri 16`: `weekday` and `day` are its day's, formatted. */\n    backlogDue: (p: { weekday: string; day: string }) => string;\n    /** A backlog group, by when its events are due (PB28) — `Due this week`. */\n    dueGroup: (p: { due: PlanDueWord }) => string;\n    /** How long something takes — `6 h`, `2 h 15 m`, `45 m`: `hours` and `minutes` formatted, each `undefined` when it is none. */\n    duration: (p: { hours: string | undefined; minutes: string | undefined }) => string;\n\n    // ── The inspector pane (#1197) ─────────────────────────────────────────\n    /** The inspector pane's name. */\n    inspectorPane: () => string;\n    /** Several events selected — `3 events`: the head of their list, and the collapsed pane's line. */\n    inspectorEvents: (p: { n: number; count: string }) => string;\n    /** How many of the events selected are of one kind — `Print job ×2`: `kind` is its name. */\n    inspectorKindCount: (p: { kind: string; n: number; count: string }) => string;\n    /** When an event runs — `Mon, Oct 5 · 06:00–14:00`; across days, `Mon, Oct 5, 22:00 – Tue, Oct 6, 06:00`\n     *  (`endDay` its last day); an instant's, `Wed, Oct 7 · 12:00` (`to` undefined). Days and times are formatted. */\n    inspectorWhen: (p: { day: string; from: string; endDay: string | undefined; to: string | undefined }) => string;\n    /** An event with no time: in its kind's backlog. */\n    inspectorUnscheduled: () => string;\n    /** A section's head. */\n    inspectorSection: (p: { section: PlanInspectorSection }) => string;\n    /** A fact's label. */\n    inspectorFact: (p: { fact: PlanInspectorFact }) => string;\n    /** An event on no resource — and an event kind's row of them. */\n    inspectorUnassigned: () => string;\n    /** A row that is no resource's: the eyebrow over its name. */\n    inspectorRow: () => string;\n    /** One of the gestures on what is selected. */\n    inspectorAction: (p: { action: \"duplicate\" | \"delete\" }) => string;\n    /** A step of the bulk edit's shift in time — `−1 d`, `+1 h`. */\n    inspectorShift: (p: { by: -1 | 1; unit: \"day\" | \"hour\" }) => string;\n    /** The bulk edit's shift in time: its steps' group's name. */\n    inspectorShiftLabel: () => string;\n    /** A row's measures at the bucket a click on its plot named — `At Tue, Oct 20`: `bucket` in the axis's words. */\n    inspectorAt: (p: { bucket: string }) => string;\n    /** A row's measures before a click on its plot has named a bucket. */\n    inspectorNoBucket: () => string;\n    /** A measure with no value at the bucket. */\n    inspectorNoValue: () => string;\n    /** What a count says it counts when nothing is selected. */\n    inspectorStat: (p: { stat: PlanInspectorStat; n: number }) => string;\n    /**\n     * What a row's facts, or the window's, leave out (#1039), as one line: the kinds they count none of, too many of\n     * their events in view, none of them read — `Print jobs not counted: too many to draw at this resolution` — and the\n     * kinds whose events they count but whose hours they do not, none of them read — `Print job hours not counted: too\n     * many to draw at this resolution`; both, `Print jobs and Press check hours not counted: …`. `kinds` and `hours` are\n     * the kinds' names.\n     */\n    inspectorNotCounted: (p: { kinds: readonly string[]; hours: readonly string[] }) => string;\n    /** A hint when nothing is selected — three of them. */\n    inspectorHint: (p: { n: 1 | 2 | 3 }) => string;\n    /** The hint in a phone's pane, nothing selected (ruled 3 Nov 2026): its cards take a tap, and it has no Esc or modifier keys. */\n    inspectorHintTouch: () => string;\n    /** One event's overlaps banner (#1198, PB53) — `Overlaps 2 events on Press B2`: `on` is its resource's name. */\n    inspectorOverlaps: (p: { n: number; count: string; on: string }) => string;\n    /** A row's overlaps banner (PB40) — `2 overlaps`: the pairs on the row's resource in the window. */\n    inspectorRowOverlaps: (p: { n: number; count: string }) => string;\n    /** One pair in a row's banner — `Market posters · Loyalty cards`: its events' titles. */\n    inspectorOverlapPair: (p: { first: string; second: string }) => string;\n    /** The banner over one event's form while the app's `ready` refuses it, which holds Save (#1525). */\n    inspectorRefusals: () => string;\n\n    // ── The horizon, the ruler, the axis in words ──────────────────────────\n    /** The horizon strip's caption — `HORIZON · 26 WK`. */\n    horizon: (p: { n: number; count: string; unit: PlanHorizonUnit }) => string;\n    /** The horizon strip's meta line (#1438) — `max 1,559 items / mo`: its largest bucket's count, and the period its buckets are. */\n    horizonMax: (p: { n: number; count: string; unit: PlanHorizonBucket }) => string;\n    /** The horizon strip's meta line where nothing is in the horizon (#1438). */\n    horizonNoData: () => string;\n    /** A horizon bucket's count, after its period in its tooltip (#1438) — `1,284 items`. */\n    horizonCount: (p: { n: number; count: string }) => string;\n    /** The horizon brush's start handle, as a reader hears it (#1438). */\n    horizonStart: () => string;\n    /** The horizon brush's window, between its handles (#1438). */\n    horizonWindow: () => string;\n    /** The horizon brush's end handle (#1438). */\n    horizonEnd: () => string;\n    /** The ruler's now chip. */\n    now: () => string;\n\n    // ── Row focus (R1 / R2) ────────────────────────────────────────────────\n    /** The focus band's way back. */\n    allRows: () => string;\n    /** The links focus caption — `Links · H1-P03 · 4 upstream · 6 downstream`\n     *  (the band sets it in capitals); `label` is the focused row's gutter label. */\n    focusLinks: (p: { label: string; upstream: string | undefined; downstream: string | undefined }) => string;\n    /** The expand focus caption — `label` is the focused row's gutter label. */\n    focusExpanded: (p: { label: string }) => string;\n    /** A row's family Tag under a links focus — `Upstream`, `Downstream`, `Linked`. */\n    focusTag: (p: { tag: PlanFocusTagWord }) => string;\n    /** The links-focus control's accessible name. */\n    linksControl: () => string;\n    /** The expand control's accessible name. */\n    expandControl: () => string;\n\n    // ── Rows and bands ─────────────────────────────────────────────────────\n    /** A group's derived member count — `8 rows`. While it covers only the\n     *  loaded windows (a top-level section on a paged canvas still loading —\n     *  the one parent whose members span windows, #822) it is a short bar,\n     *  never a count (#1398, CL13). */\n    groupMeta: (p: { n: number; count: string }) => string;\n    /** What a links focus's gap band stands for — `12 hidden rows`. */\n    hiddenRows: (p: { n: number; count: string; what: \"row\" | \"group\" }) => string;\n    // A run of rows not drawn yet says nothing (#1398, CL3); a failed one says so once, in the footer line's words\n    // (`lineFailed`, `retryRange`, `PagedLoadingMessages`).\n    /** A failed window's retry button. */\n    retry: () => string;\n    /** A run bar's churn counter — `moved ×3`. */\n    moved: (p: { n: number; count: string }) => string;\n    /** A rollup band's caption — `×2 · 208 k sheets`. Always exact: a span parent\n     *  rolls up one entry's subtree, which a window holds whole (#822). */\n    rollupCaption: (p: { count: string | undefined; quantity: string | undefined }) => string;\n    /** A quantity's caption — `96 k sheets` (#824): `value` is already formatted,\n     *  through the quantity's own format; `unit` is the author's, when declared. */\n    quantity: (p: { value: string; unit: string | undefined }) => string;\n    /** Totals in several units, read together — a rollup band's `208 k sheets · 12 h`. */\n    quantities: (p: { parts: readonly string[] }) => string;\n    /** The resting chip of a proposed bucket tile. */\n    planChip: () => string;\n    /** A bucket cell's `+n` chip (#1267) — `+2`: the cell's tiles it has no room for. */\n    tileMore: (p: { n: number; count: string }) => string;\n    /** The chip's accessible name — `2 more events, Week of Jul 13, 2026, AM`: its cell's bucket and lane in words. */\n    tileMoreLabel: (p: { n: number; count: string; bucket: string; lane: string | undefined }) => string;\n\n    // ── Moves (#825) ───────────────────────────────────────────────────────\n    /** How a keyboard reader moves an element — the description of every one that moves. */\n    moveHelp: () => string;\n    /** An element picked up with the keyboard — `target` its row's name, `span` where it is, in words. */\n    movePickedUp: (p: { item: string; target: string; span: string }) => string;\n    /** Where a carried element would land now. */\n    moveOver: (p: { item: string; target: string; span: string }) => string;\n    /** Where the canvas's `canDrop` refuses a carried element — and why, when the event kinds' drag says (#1196). */\n    moveRefused: (p: { item: string; target: string; span: string; reason?: string | undefined }) => string;\n    /** A carried element dropped. */\n    moveDropped: (p: { item: string; target: string; span: string }) => string;\n    /** A carried element whose move could not be written — nothing changed. */\n    moveFailed: (p: { item: string }) => string;\n    /** A carry cancelled — the element stays where it was. */\n    moveCancelled: (p: { item: string }) => string;\n\n    // ── The event kinds' drag and drop (#1196) ─────────────────────────────\n    /**\n     * What the ghost says a drop does — `Brochure run · Press A1 · Mon, Oct 12,\n     * 2026`: what lands (a template's name, an event's title, or `3 events`),\n     * where (a resource's name, or `Unassigned`), and the day it starts, its\n     * time after it when it has one (`· 06:00`).\n     */\n    dropCaption: (p: { what: string; where: string; day: string; time: string | undefined }) => string;\n    /** Why an event can't land on a row: its kind is placed on other resource kinds — `Needs presses`, their names lowercased; none, on no resource. */\n    dropNeeds: (p: { resources: readonly string[] }) => string;\n    /** The resource matches, but this sub-row displays a different event kind. */\n    dropNeedsRow: (p: { kind: string }) => string;\n    /** Why an event can't change now: its kind's record is not read yet, or a Save of it is under way — `kind` its name. */\n    dropBusy: (p: { kind: string }) => string;\n    /** Why a drop the kind's own write refuses can't land. */\n    dropRefused: () => string;\n    /** An author's card over an event of its patch's kind — `Harbour Arts Society → Spring catalogue`. */\n    dropCardOnEvent: (p: { card: string; event: string }) => string;\n    /** An author's card anywhere but an event — `Drop a customer onto an event`: `fields` the fields its patch sets. */\n    dropCardNeedsEvent: (p: { fields: readonly string[] }) => string;\n    /** An author's card over an event of another kind — `Stops take no customer`: `kind` that kind's name, `fields` the fields the patch sets. */\n    dropKindTakesNo: (p: { kind: string; fields: readonly string[] }) => string;\n    /** An event over the Backlog tab, which unschedules it — `Spring catalogue → Backlog`. */\n    dropUnschedule: (p: { what: string }) => string;\n    /** An event over the Backlog tab whose kind has no backlog — its times are no Options: `Stops have no backlog`. */\n    dropNoBacklog: (p: { kind: string }) => string;\n\n    // ── The narrow layout (§10) ────────────────────────────────────────────\n    /** The Groups tab. */\n    tabGroups: () => string;\n    /** The Rows tab. */\n    tabRows: () => string;\n    /** The Measures tab. */\n    tabMeasures: () => string;\n    /** A tab's count — \"…\" in its place over a partial prefix, until the source's read completes (#1398, CL13). */\n    tabCount: (p: { n: number; count: string }) => string;\n    /** A tab's count where a paged source's entries make no fixed number of what it lists — the Measures tab's, where\n     *  some entries make more chart rows than others (#1398): `not counted`, as the Plan's event counts say theirs. */\n    tabNotCounted: () => string;\n    /** The card and section for rows in no group. */\n    otherRows: () => string;\n    /** Back to the group list. */\n    backToGroups: () => string;\n    /** Back to every row. */\n    backToAllRows: () => string;\n    /** An empty row list. */\n    noRows: () => string;\n    /** More groups to show — `3 more groups · 24 rows`. */\n    moreGroups: (p: { n: number; count: string; members: string | undefined }) => string;\n    /** More rows to show. */\n    moreRows: (p: { n: number; count: string }) => string;\n    /** More measures to show. */\n    moreMeasures: (p: { n: number; count: string }) => string;\n\n    // ── Words for what the canvas shows by look (#819) ─────────────────────\n    /** A lifecycle state. */\n    state: (p: { state: PlanStateWord }) => string;\n    /** A status tone — `warning`. */\n    tone: (p: { tone: string }) => string;\n    /** A status dot's accessible name — `Status: warning`. */\n    status: (p: { tone: string }) => string;\n    /** A span in words — `Jun 29, 2026 – Jul 27, 2026`. */\n    span: (p: { from: string; to: string }) => string;\n    /** A run bar's churn, in words. */\n    movedTimes: (p: { n: number; count: string }) => string;\n    /** A run bar's accessible name. */\n    runName: (p: { label: string; span: string; state: string; quantity: string | undefined; moved: string | undefined; status: string | undefined }) => string;\n    /** A span row's decision diamond's accessible name. */\n    decisionName: (p: { at: string; applied: boolean }) => string;\n    /** A bucket tile's accessible name. */\n    tileName: (p: { label: string | undefined; bucket: string; lane: string | undefined; state: string; tone: string | undefined }) => string;\n    /** A cards chip's accessible name. */\n    chipName: (p: { label: string; span: string; state: string }) => string;\n    /** An event mark's accessible name. */\n    markName: (p: { label: string | undefined; kind: PlanMarkWord; applied: boolean; at: string }) => string;\n    /** A heat cell's value — `91, at or above the warning threshold`. */\n    heatValue: (p: { value: string; warn: boolean }) => string;\n    /** A cell or bucket with no value. */\n    noData: () => string;\n    /** A weight bar's value — `60% booked, planned`. */\n    weightValue: (p: { percent: string; planned: boolean }) => string;\n    /** One segment of a composition — `booked 60%`: its fill tag, and its\n     *  share (the author's in-bar label, else the share as a percent). */\n    segmentPart: (p: { fill: string; share: string }) => string;\n    /** Parts read out together — a composition's segments, a table cell's\n     *  parts: `booked 60%, slack 25%`. */\n    list: (p: { parts: readonly string[] }) => string;\n    /** A table part with no value (the muted em-dash). */\n    noValue: () => string;\n    /** A range of two values — a band's `lo–hi`. */\n    valueRange: (p: { from: string; to: string }) => string;\n    /** A bucket-quantised element's accessible name — `Week of Jun 29, 2026: 72`. */\n    cellName: (p: { bucket: string; value: string }) => string;\n    /** A table cell's input's accessible name — `Week of Jun 29, 2026: type a number` (#1438). */\n    typedName: (p: { bucket: string }) => string;\n    /** The history's step for a number typed into a table cell — `Set Orders, Week of Jun 29, 2026 to 15` (#1438). */\n    typedStep: (p: { row: string; bucket: string; value: string }) => string;\n    /** The history's step for a table cell cleared — `Clear Orders, Week of Jun 29, 2026` (#1438). */\n    clearedStep: (p: { row: string; bucket: string }) => string;\n    /** A table cell's typed text that reads as no number (#1438). */\n    typedNotNumber: () => string;\n    /** A fraction typed into a table cell whose values are whole numbers (#1438). */\n    typedNotWhole: () => string;\n    /** What a table cell folding several values of a position that takes typing says: the resolution they are at, and the\n     *  Plan's zoom showing them apart — `Holds several values, one each week: zoom to week to type one` — or that it has\n     *  none (#1438). */\n    typedFolded: (p: { resolution: string | undefined; zoom: string | undefined }) => string;\n    /** What a table cell of a position taking typing says at a zoom coarser than the Plan's finest, where it is a summary\n     *  and takes none — `Zoom to week to edit`; a double click on it does (#1438). */\n    typedZoomTo: (p: { zoom: string }) => string;\n    /** A tone-strip block's value — `101, beyond threshold`. */\n    toneValue: (p: { value: string; warn: boolean }) => string;\n    /** A chart layer's name in the chart's summary — `line`, or `columns 2`\n     *  when the chart has more than one of its kind. */\n    chartLayer: (p: { kind: PlanChartLayerWord; index: string | undefined }) => string;\n    /** A chart layer's values. */\n    chartLayerValues: (p: { layer: string; min: string; max: string; last: string; n: number; breaches: string }) => string;\n    /** A chart layer with no value in the window. */\n    chartLayerEmpty: (p: { layer: string }) => string;\n    /** A chart row's accessible name. */\n    chartSummary: (p: { parts: readonly string[] }) => string;\n    /** A chart row with no data layers. */\n    chartNoData: () => string;\n\n    // ── The live region (#819) ─────────────────────────────────────────────\n    /** A row was selected. */\n    announceSelected: (p: { label: string }) => string;\n    /** The events selected on the canvas changed (#1197) — `3 events selected`; `n` 0 when the last left. */\n    announceEvents: (p: { n: number; count: string }) => string;\n    /** A section closed. */\n    announceCollapsed: (p: { label: string }) => string;\n    /** A section opened. */\n    announceExpanded: (p: { label: string }) => string;\n    /** A chart row changed height. */\n    announceChart: (p: { label: string; expanded: boolean }) => string;\n    /** A links focus opened. */\n    announceLinked: (p: { label: string }) => string;\n    /** An expand focus opened. */\n    announceOpened: (p: { label: string }) => string;\n    /** A row focus closed. */\n    announceAllRows: () => string;\n    /** The selection was cleared. */\n    announceCleared: () => string;\n    /** The grain changed. */\n    announceGrain: (p: { grain: PlanGrainWord }) => string;\n    /** The resolution changed. */\n    announceResolution: (p: { resolution: string }) => string;\n}\n\nconst plural = (n: number, one: string, many: string): string => (n === 1 ? one : many);\n\nconst HORIZON_UNIT: Record<PlanHorizonUnit, string> = {\n    hour: \"HR\", day: \"D\", week: \"WK\", month: \"MO\", quarter: \"Q\", year: \"YR\", step: \"STEPS\",\n};\n\nconst HORIZON_PER: Record<PlanHorizonBucket, string> = { month: \"mo\", quarter: \"q\", year: \"yr\" };\n\nconst STATE_WORD: Record<PlanStateWord, string> = {\n    estimated: \"estimated\",\n    added: \"proposed\",\n    recommended: \"recommended\",\n    removed: \"proposed removal\",\n    confirmed: \"confirmed\",\n    \"in-progress\": \"in progress\",\n    actual: \"actual\",\n    rejected: \"rejected\",\n};\n\n/** A segment fill as the category its colour encodes. */\nconst FILL_WORD: Record<string, string> = {\n    brand: \"booked\",\n    success: \"positive\",\n    warning: \"caution\",\n    danger: \"at risk\",\n    info: \"info\",\n    neutral: \"neutral\",\n    slack: \"slack\",\n    free: \"free\",\n};\n\nconst LAYER_WORD: Record<PlanChartLayerWord, string> = {\n    line: \"line\", area: \"area\", column: \"columns\", scatter: \"points\", band: \"range\",\n};\n\n/** A family row's Tag (`Plan links.html`, #1258). */\nconst FOCUS_TAG: Record<PlanFocusTagWord, string> = {\n    UPSTREAM: \"Upstream\", DOWNSTREAM: \"Downstream\", LINKED: \"Linked\",\n};\n\n/** The parts of a list that are there, comma-joined. */\nconst listed = (parts: ReadonlyArray<string | undefined>): string =>\n    parts.filter((p): p is string => p !== undefined && p !== \"\").join(\", \");\n\n/** The fields a card's patch sets, as a noun — `customer`, `customer and stock` (an underscore a space); a patch that sets none, `card`. */\nconst fieldNoun = (fields: readonly string[]): string =>\n    fields.length === 0 ? \"card\" : joined(fields.map((f) => f.replace(/_/g, \" \")), \"and\");\n\n/** What a library tab the rail narrows lists, as its narrowed words say it — `templates`, `backlog events`, an author's tab's name. */\nconst narrowedNoun = (tab: PlanLibraryTabWord, name: string): string =>\n    (tab === \"events\" ? \"templates\" : tab === \"backlog\" ? \"backlog events\" : tab === \"series\" ? \"series\" : name);\n\n/**\n * The Plan's English messages — the default table.\n */\nexport const planMessages: PlanMessages = {\n    ...editingMessages,\n    ...timeMessages,\n    ...pagedLoadingMessages,\n    gridLabel: () => \"Plan\",\n    noWindow: () => \"NO WINDOW — declare an axis window, or bind a slice whose range supplies it\",\n    noWindowOrdinal: () => \"NO WINDOW — an ordinal axis needs at least one declared value\",\n    partName: ({ part }) => {\n        switch (part.kind) {\n            case \"row\": return `row ${part.label}`;\n            case \"group\": return `group ${part.label}`;\n            case \"expandRender\": return \"expand render\";\n            case \"expandGutter\": return \"expand gutter\";\n            case \"linksLayer\": return \"links layer\";\n            case \"popover\": return \"popover\";\n            case \"hoverCard\": return \"hover card\";\n        }\n    },\n    partFailed: ({ part, message }) => `${part} could not render — ${message}`,\n    axisMismatch: ({ found, expected }) => `AXIS MISMATCH — this row carries ${found} instants; the axis is ${expected}`,\n    duplicateRow: ({ id }) => `DUPLICATE ID — an earlier row already has ${id}`,\n\n    grainLabel: () => \"Grain\",\n    grainName: ({ grain }) => grain.toUpperCase(),\n    expandAll: () => \"Expand all\",\n    collapseAll: () => \"Collapse all\",\n    resolutionLabel: () => \"Resolution\",\n    resolutionName: ({ resolution }) => resolution.toUpperCase(),\n    keySearch: () => \"Search Records\",\n    keySearchNoMatches: () => \"No record matches. The filters narrow by a record's other fields.\",\n    keySearchUnplaced: () => \"The record could not be found among the rows\",\n    keySearchUncleared: () => \"The filters hiding the record could not be cleared\",\n    hiddenByFilters: () => \"hidden by the filters\",\n    hiddenBy: ({ filters, also }) => hiddenByText(filters, also),\n    overlaps: ({ n, count }) => `${count} ${plural(n, \"overlap\", \"overlaps\")}`,\n    overlapsShort: ({ count }) => count,\n    overlapsLabel: ({ n, count }) => `${count} ${plural(n, \"overlap\", \"overlaps\")} — select the first pair`,\n\n    rowsSkipped: ({ n, count }) => `${count} ${plural(n, \"row\", \"rows\")} skipped`,\n    rowsSkippedSeek: ({ n, count }) => `${count} ${plural(n, \"row\", \"rows\")} skipped — show the first`,\n    sourceUnavailable: ({ reason }) => `source unavailable — ${reason}`,\n    searchFailed: ({ reason }) => `search failed — ${reason}`,\n    truncated: ({ count }) => `showing the first ${count} buckets — zoom in`,\n\n    footerEvents: ({ n, count }) => `${count} ${plural(n, \"event\", \"events\")}`,\n    footerEventsNotCounted: ({ n, count, kinds }) => eventsNotCounted({ n, count, kinds }),\n    footerBacklog: ({ count }) => `${count} in backlog`,\n    footerPending: ({ count }) => `${count} pending`,\n    footerSaved: ({ when }) => `saved ${when}`,\n    saveNoticeNoun: ({ kind, n }) => (kind === undefined ? plural(n, \"row\", \"rows\") : `${kind} ${plural(n, \"event\", \"events\")}`),\n    eventsFailedNoun: ({ kinds }) => (kinds.length === 0 ? \"rows\" : joined(kinds, \"and\")),\n\n    narrowingUnavailable: ({ name }) => `${name.charAt(0).toUpperCase()}${name.slice(1)} results unavailable`,\n    narrowingChanged: ({ name }) => `${name.charAt(0).toUpperCase()}${name.slice(1)} results changed; retry the narrowing.`,\n    narrowingFailed: ({ name }) => `Could not load ${name} results`,\n    windowUnavailable: ({ axis }) => (axis === \"time\" ? \"Dates unavailable\" : \"Window unavailable\"),\n    libraryNarrowed: ({ tab, name }) => `No ${narrowedNoun(tab, name)} match the filters`,\n    libraryNarrowedHint: ({ tab, name }) => `Change or clear the filters to see more ${narrowedNoun(tab, name)}.`,\n\n    tooManyEvents: ({ kind, n, count }) => `${count} ${kind} ${plural(n, \"event\", \"events\")} in view`,\n    tooManyEventsNotCounted: ({ kind }) => `${kind.charAt(0).toUpperCase()}${kind.slice(1)} events in view: not counted`,\n    tooManyEventsHint: ({ resolution }) => (resolution === undefined\n        ? \"Too many to draw at this resolution: narrow the filters, or zoom in.\"\n        : `Too many to draw at this resolution: switch to ${resolution} to see where they fall.`),\n\n    libraryPane: () => \"Library\",\n    libraryTab: ({ tab }) => (tab === \"events\" ? \"Events\" : tab === \"backlog\" ? \"Backlog\" : \"Series\"),\n    libraryEmpty: ({ tab, name }) => (tab === \"events\" ? \"No templates\" : tab === \"backlog\" ? \"Backlog clear\"\n        : tab === \"series\" ? \"No series\" : `Nothing in ${name}`),\n    libraryEmptyHint: ({ tab, name }) => (tab === \"events\" ? \"No event kind declares a template to drag in.\"\n        : tab === \"backlog\" ? \"Every event is scheduled.\"\n            : tab === \"series\" ? \"This plan shows nothing to hide.\"\n                : `${name} lists nothing yet.`),\n    libraryNoun: ({ tab, n }) => (tab === \"events\" ? plural(n, \"template\", \"templates\")\n        : tab === \"backlog\" ? plural(n, \"event\", \"events\")\n            : tab === \"series\" ? plural(n, \"series\", \"series\") : plural(n, \"card\", \"cards\")),\n    libraryGroupBy: ({ tab }) => (tab === \"events\" ? \"Kind\" : tab === \"backlog\" ? \"Due\" : \"Group\"),\n    templateGroup: ({ kind, group }) => (group !== undefined && group !== \"\" ? `${kind} · ${group}` : kind),\n    templateLine: ({ kind, duration, resources }) =>\n        [kind, duration, resources.length > 0 ? resources.join(\"/\") : undefined]\n            .filter((p): p is string => p !== undefined && p !== \"\").join(\" · \"),\n    backlogLine: ({ duration, resource, due }) => [duration, resource ?? \"Unassigned\", due]\n        .filter((p): p is string => p !== undefined && p !== \"\").join(\" · \"),\n    backlogDue: ({ weekday, day }) => `due ${weekday} ${day}`,\n    dueGroup: ({ due }) => (due === \"thisWeek\" ? \"Due this week\" : due === \"nextWeek\" ? \"Due next week\" : due === \"later\" ? \"Later\" : \"No date\"),\n    duration: ({ hours, minutes }) => (hours === undefined ? `${minutes ?? \"0\"} m` : minutes === undefined ? `${hours} h` : `${hours} h ${minutes} m`),\n\n    inspectorPane: () => \"Inspector\",\n    inspectorEvents: ({ n, count }) => `${count} ${plural(n, \"event\", \"events\")}`,\n    inspectorKindCount: ({ kind, count }) => `${kind} ×${count}`,\n    inspectorWhen: ({ day, from, endDay, to }) => (to === undefined ? `${day} · ${from}`\n        : endDay === undefined ? `${day} · ${from}–${to}` : `${day}, ${from} – ${endDay}, ${to}`),\n    inspectorUnscheduled: () => \"Not scheduled — in the backlog\",\n    inspectorSection: ({ section }) => ({\n        fields: \"Fields\", bulk: \"Edit all\", window: \"In the window\", measures: \"Measures\",\n    })[section],\n    inspectorFact: ({ fact }) => ({\n        resource: \"Resource\", start: \"Start\", end: \"End\", at: \"At\", lane: \"Lane\", state: \"State\", quantity: \"Quantity\",\n        group: \"Group\", events: \"Events\", hours: \"Hours\", quantities: \"Quantity\",\n    })[fact],\n    inspectorUnassigned: () => \"Unassigned\",\n    inspectorRow: () => \"Row\",\n    inspectorAction: ({ action }) => (action === \"duplicate\" ? \"Duplicate\" : \"Delete\"),\n    inspectorShift: ({ by, unit }) => `${by < 0 ? \"−\" : \"+\"}1 ${unit === \"day\" ? \"d\" : \"h\"}`,\n    inspectorShiftLabel: () => \"Shift\",\n    inspectorAt: ({ bucket }) => `At ${bucket}`,\n    inspectorNoBucket: () => \"Click the row's plot to read its measures at that bucket.\",\n    inspectorNoValue: () => \"—\",\n    inspectorStat: ({ stat, n }) => ({\n        events: plural(n, \"Event\", \"Events\"), hours: \"Hours\", hoursInView: \"Hours in view\", backlog: \"In backlog\",\n    })[stat],\n    inspectorNotCounted: ({ kinds, hours }) =>\n        `${joined([...kinds.map(pluralName), ...hours.map((kind) => `${kind} hours`)], \"and\")} not counted: too many to draw at this resolution`,\n    inspectorHint: ({ n }) => (n === 1 ? \"Click an event to see it here — Shift, ⌘ or Ctrl adds another.\"\n        : n === 2 ? \"Click a row's plot to see the row and its measures at that bucket.\"\n            : \"Esc clears what is selected.\"),\n    inspectorHintTouch: () => \"Tap a card to see its row and its measures here.\",\n    inspectorOverlaps: ({ n, count, on }) => `Overlaps ${count} ${plural(n, \"event\", \"events\")} on ${on}`,\n    inspectorRowOverlaps: ({ n, count }) => `${count} ${plural(n, \"overlap\", \"overlaps\")}`,\n    inspectorOverlapPair: ({ first, second }) => `${first} · ${second}`,\n    inspectorRefusals: () => \"Not saved yet\",\n\n    horizon: ({ count, unit }) => `HORIZON · ${count} ${HORIZON_UNIT[unit]}`,\n    horizonMax: ({ n, count, unit }) => `max ${count} ${plural(n, \"item\", \"items\")} / ${HORIZON_PER[unit]}`,\n    horizonNoData: () => \"no data\",\n    horizonCount: ({ n, count }) => `${count} ${plural(n, \"item\", \"items\")}`,\n    horizonStart: () => \"Window start\",\n    horizonWindow: () => \"Window\",\n    horizonEnd: () => \"Window end\",\n    now: () => \"NOW\",\n\n    allRows: () => \"← All rows\",\n    focusLinks: ({ label, upstream, downstream }) =>\n        `Links · ${label}${upstream !== undefined && downstream !== undefined ? ` · ${upstream} upstream · ${downstream} downstream` : \"\"}`,\n    focusExpanded: ({ label }) => `EXPANDED · ${label}`,\n    focusTag: ({ tag }) => FOCUS_TAG[tag],\n    linksControl: () => \"Focus linked rows\",\n    expandControl: () => \"Expand row\",\n\n    groupMeta: ({ n, count }) => `${count} ${plural(n, \"row\", \"rows\")}`,\n    hiddenRows: ({ n, count, what }) => `${count} hidden ${what}${n === 1 ? \"\" : \"s\"}`,\n    retry: () => \"Retry\",\n    moved: ({ count }) => `moved ×${count}`,\n    rollupCaption: ({ count, quantity }) =>\n        [count !== undefined ? `×${count}` : undefined, quantity]\n            .filter((p): p is string => p !== undefined && p !== \"\").join(\" · \"),\n    quantity: ({ value, unit }) => (unit !== undefined && unit !== \"\" ? `${value} ${unit}` : value),\n    quantities: ({ parts }) => parts.join(\" · \"),\n    planChip: () => \"plan\",\n    tileMore: ({ count }) => `+${count}`,\n    tileMoreLabel: ({ n, count, bucket, lane }) => listed([`${count} more ${plural(n, \"event\", \"events\")}`, bucket, lane]),\n\n    moveHelp: () =>\n        \"Press Space to pick it up. The arrow keys then move it — Shift with left or right moves its end, Alt its start — \" +\n        \"Space drops it, and Escape cancels.\",\n    movePickedUp: ({ item, target, span }) => `Picked up ${item}: ${target}, ${span}`,\n    moveOver: ({ item, target, span }) => `${item}: ${target}, ${span}`,\n    moveRefused: ({ item, target, span, reason }) => `${item} cannot be dropped on ${target}, ${span}${reason !== undefined && reason !== \"\" ? ` — ${reason}` : \"\"}`,\n    moveDropped: ({ item, target, span }) => `Dropped ${item} on ${target}, ${span}`,\n    moveFailed: ({ item }) => `${item} could not be moved`,\n    moveCancelled: ({ item }) => `${item} was not moved`,\n\n    dropCaption: ({ what, where, day, time }) => `${what} · ${where} · ${time === undefined ? day : `${day} · ${time}`}`,\n    dropNeeds: ({ resources }) => (resources.length === 0 ? \"Goes on no resource\" : `Needs ${joined(resources, \"or\")}`),\n    dropNeedsRow: ({ kind }) => `Drop on ${withArticle(kind)} row`,\n    dropBusy: ({ kind }) => `${kind} can't change now`,\n    dropRefused: () => \"Can't go here\",\n    dropCardOnEvent: ({ card, event }) => `${card} → ${event}`,\n    dropCardNeedsEvent: ({ fields }) => `Drop ${withArticle(fieldNoun(fields))} onto an event`,\n    dropKindTakesNo: ({ kind, fields }) => `${pluralName(kind)} take no ${fieldNoun(fields)}`,\n    dropUnschedule: ({ what }) => `${what} → Backlog`,\n    dropNoBacklog: ({ kind }) => `${pluralName(kind)} have no backlog`,\n\n    tabGroups: () => \"Groups\",\n    tabRows: () => \"Rows\",\n    tabMeasures: () => \"Measures\",\n    tabCount: ({ count }) => count,\n    tabNotCounted: () => \"not counted\",\n    otherRows: () => \"Other rows\",\n    backToGroups: () => \"← Groups\",\n    backToAllRows: () => \"← All rows\",\n    noRows: () => \"No rows\",\n    moreGroups: ({ n, count, members }) =>\n        `${count} more ${plural(n, \"group\", \"groups\")}${members !== undefined ? ` · ${members}` : \"\"}`,\n    moreRows: ({ n, count }) => `${count} more ${plural(n, \"row\", \"rows\")}`,\n    moreMeasures: ({ n, count }) => `${count} more ${plural(n, \"measure\", \"measures\")}`,\n\n    state: ({ state }) => STATE_WORD[state],\n    tone: ({ tone }) => tone,\n    status: ({ tone }) => `Status: ${tone}`,\n    span: ({ from, to }) => `${from} – ${to}`,\n    movedTimes: ({ n, count }) => `moved ${count} ${plural(n, \"time\", \"times\")}`,\n    runName: ({ label, span, state, quantity, moved, status }) => listed([label, span, state, quantity, moved, status]),\n    decisionName: ({ at, applied }) => `Decision, ${at}, ${applied ? \"applied\" : \"pending\"}`,\n    tileName: ({ label, bucket, lane, state, tone }) => listed([label ?? \"Event\", bucket, lane, state, tone]),\n    chipName: ({ label, span, state }) => listed([label, span, state]),\n    markName: ({ label, kind, applied, at }) => {\n        const what = kind === \"decision\" ? `decision, ${applied ? \"applied\" : \"pending\"}` : kind;\n        return label !== undefined\n            ? listed([label, what, at])\n            : listed([what.charAt(0).toUpperCase() + what.slice(1), at]);\n    },\n    heatValue: ({ value, warn }) => (warn ? `${value}, at or above the warning threshold` : value),\n    noData: () => \"no data\",\n    weightValue: ({ percent, planned }) => `${percent} booked${planned ? \", planned\" : \"\"}`,\n    segmentPart: ({ fill, share }) => `${FILL_WORD[fill] ?? fill} ${share}`,\n    list: ({ parts }) => parts.join(\", \"),\n    noValue: () => \"no value\",\n    valueRange: ({ from, to }) => `${from}–${to}`,\n    cellName: ({ bucket, value }) => `${bucket}: ${value}`,\n    typedName: ({ bucket }) => `${bucket}: type a number`,\n    typedStep: ({ row, bucket, value }) => `Set ${row}, ${bucket} to ${value}`,\n    clearedStep: ({ row, bucket }) => `Clear ${row}, ${bucket}`,\n    typedNotNumber: () => \"Type a number\",\n    typedNotWhole: () => \"Type a whole number\",\n    typedFolded: ({ resolution, zoom }) => {\n        const several = resolution === undefined ? \"Holds several values\" : `Holds several values, one each ${resolution}`;\n        return zoom === undefined ? `${several}, and no zoom shows them apart` : `${several}: zoom to ${zoom} to type one`;\n    },\n    typedZoomTo: ({ zoom }) => `Zoom to ${zoom} to edit`,\n    toneValue: ({ value, warn }) => (warn ? `${value}, beyond threshold` : value),\n    chartLayer: ({ kind, index }) => (index !== undefined ? `${LAYER_WORD[kind]} ${index}` : LAYER_WORD[kind]),\n    chartLayerValues: ({ layer, min, max, last, n, breaches }) =>\n        `${layer} min ${min}, max ${max}, last ${last}${n > 0 ? `, ${breaches} beyond threshold` : \"\"}`,\n    chartLayerEmpty: ({ layer }) => `${layer} no data in the window`,\n    chartSummary: ({ parts }) => `Chart: ${parts.join(\"; \")}`,\n    chartNoData: () => \"Chart: no data\",\n\n    announceSelected: ({ label }) => `Selected ${label}`,\n    announceEvents: ({ n, count }) => (n === 0 ? \"No event selected\" : `${count} ${plural(n, \"event\", \"events\")} selected`),\n    announceCollapsed: ({ label }) => `${label} collapsed`,\n    announceExpanded: ({ label }) => `${label} expanded`,\n    announceChart: ({ label, expanded }) => `${label} chart ${expanded ? \"expanded\" : \"collapsed\"}`,\n    announceLinked: ({ label }) => `Showing rows linked to ${label}`,\n    announceOpened: ({ label }) => `${label} opened in place`,\n    announceAllRows: () => \"Showing all rows\",\n    announceCleared: () => \"Selection cleared\",\n    announceGrain: ({ grain }) => `Grain: ${grain}`,\n    announceResolution: ({ resolution }) => `Resolution: ${resolution}`,\n};\n\n/** The app's words for what the Plan draws of its own, as the payload carries them (#1516). */\nexport type PlanVocabulary = ValueTypeOf<typeof PlanPayloadType>[\"vocabulary\"];\n\n/**\n * A table in the app's own words (#1516): each word the app gave over the table above it, wherever the table says it, and\n * the rest as they stood, so a host's translation stands where the app gave none.\n *\n * @param parent - The table above\n * @param v - The app's words\n * @returns The table\n */\nexport function planMessagesIn(parent: PlanMessages, v: PlanVocabulary): PlanMessages {\n    const unassigned = getSomeorUndefined(v.unassigned);\n    const events = getSomeorUndefined(v.events);\n    const backlog = getSomeorUndefined(v.backlog);\n    const series = getSomeorUndefined(v.series);\n    const groups = getSomeorUndefined(v.groups);\n    const rows = getSomeorUndefined(v.rows);\n    const measures = getSomeorUndefined(v.measures);\n    const inText = backlog === undefined ? undefined : lowerWord(backlog);\n    const seriesText = series === undefined ? undefined : lowerWord(series);\n    const rowsText = rows === undefined ? undefined : lowerWord(rows.other);\n    const due: Readonly<Record<PlanDueWord, string | undefined>> = {\n        thisWeek: getSomeorUndefined(v.dueThisWeek), nextWeek: getSomeorUndefined(v.dueNextWeek), later: getSomeorUndefined(v.later), none: getSomeorUndefined(v.noDate),\n    };\n    const states: Readonly<Record<PlanStateWord, string | undefined>> = {\n        estimated: getSomeorUndefined(v.estimated), added: getSomeorUndefined(v.proposed), recommended: getSomeorUndefined(v.recommended),\n        removed: getSomeorUndefined(v.removal), confirmed: getSomeorUndefined(v.confirmed), \"in-progress\": getSomeorUndefined(v.inProgress),\n        actual: getSomeorUndefined(v.actual), rejected: getSomeorUndefined(v.rejected),\n    };\n    /** What a narrowed tab says lists, in the app's word, the table's own sentence around it. */\n    const narrowedName = (tab: PlanLibraryTabWord, name: string): { tab: PlanLibraryTabWord; name: string } =>\n        (tab === \"backlog\" && inText !== undefined ? { tab: \"tab\", name: `${inText} events` } : tab === \"series\" && seriesText !== undefined ? { tab: \"tab\", name: seriesText } : { tab, name });\n    return {\n        ...parent,\n        inspectorUnassigned: () => unassigned ?? parent.inspectorUnassigned(),\n        backlogLine: (p) => parent.backlogLine({ ...p, resource: p.resource ?? unassigned }),\n        libraryTab: ({ tab }) => ({ events, backlog, series })[tab] ?? parent.libraryTab({ tab }),\n        libraryEmpty: (p) => (p.tab === \"backlog\" && backlog !== undefined ? `${backlog} clear` : p.tab === \"series\" && seriesText !== undefined ? `No ${seriesText}` : parent.libraryEmpty(p)),\n        libraryNoun: (p) => (p.tab === \"series\" && seriesText !== undefined ? seriesText : parent.libraryNoun(p)),\n        libraryNarrowed: ({ tab, name }) => parent.libraryNarrowed(narrowedName(tab, name)),\n        libraryNarrowedHint: ({ tab, name }) => parent.libraryNarrowedHint(narrowedName(tab, name)),\n        inspectorUnscheduled: () => (inText === undefined ? parent.inspectorUnscheduled() : `Not scheduled — in the ${inText}`),\n        footerBacklog: (p) => (inText === undefined ? parent.footerBacklog(p) : `${p.count} in ${inText}`),\n        inspectorStat: (p) => (p.stat === \"backlog\" && inText !== undefined ? `In ${inText}` : parent.inspectorStat(p)),\n        dropUnschedule: (p) => (backlog === undefined ? parent.dropUnschedule(p) : `${p.what} → ${backlog}`),\n        dropNoBacklog: (p) => (inText === undefined ? parent.dropNoBacklog(p) : `${pluralName(p.kind)} have no ${inText}`),\n        dueGroup: ({ due: at }) => due[at] ?? parent.dueGroup({ due: at }),\n        state: ({ state }) => states[state] ?? parent.state({ state }),\n        tabGroups: () => groups?.other ?? parent.tabGroups(),\n        backToGroups: () => (groups === undefined ? parent.backToGroups() : `← ${groups.other}`),\n        moreGroups: (p) => (groups === undefined ? parent.moreGroups(p)\n            : `${p.count} more ${lowerWord(plural(p.n, groups.one, groups.other))}${p.members !== undefined ? ` · ${p.members}` : \"\"}`),\n        // An event's resource is one of the rows: `Press`, as a group is a `Hall` (review of #1481, finding 5).\n        inspectorFact: ({ fact }) => (fact === \"group\" && groups !== undefined ? groups.one\n            : fact === \"resource\" && rows !== undefined ? rows.one : parent.inspectorFact({ fact })),\n        hiddenRows: (p) => {\n            const noun = p.what === \"group\" ? groups : rows;\n            return noun === undefined ? parent.hiddenRows(p) : `${p.count} hidden ${lowerWord(plural(p.n, noun.one, noun.other))}`;\n        },\n        tabRows: () => rows?.other ?? parent.tabRows(),\n        allRows: () => (rowsText === undefined ? parent.allRows() : `← All ${rowsText}`),\n        backToAllRows: () => (rowsText === undefined ? parent.backToAllRows() : `← All ${rowsText}`),\n        noRows: () => (rowsText === undefined ? parent.noRows() : `No ${rowsText}`),\n        otherRows: () => (rowsText === undefined ? parent.otherRows() : `Other ${rowsText}`),\n        moreRows: (p) => (rows === undefined ? parent.moreRows(p) : `${p.count} more ${lowerWord(plural(p.n, rows.one, rows.other))}`),\n        groupMeta: (p) => (rows === undefined ? parent.groupMeta(p) : `${p.count} ${lowerWord(plural(p.n, rows.one, rows.other))}`),\n        inspectorRow: () => rows?.one ?? parent.inspectorRow(),\n        saveNoticeNoun: (p) => (p.kind === undefined && rows !== undefined ? lowerWord(plural(p.n, rows.one, rows.other)) : parent.saveNoticeNoun(p)),\n        eventsFailedNoun: (p) => (p.kinds.length === 0 && rowsText !== undefined ? rowsText : parent.eventsFailedNoun(p)),\n        announceAllRows: () => (rowsText === undefined ? parent.announceAllRows() : `Showing all ${rowsText}`),\n        tabMeasures: () => measures?.other ?? parent.tabMeasures(),\n        moreMeasures: (p) => (measures === undefined ? parent.moreMeasures(p) : `${p.count} more ${lowerWord(plural(p.n, measures.one, measures.other))}`),\n        inspectorSection: ({ section }) => (section === \"measures\" && measures !== undefined ? measures.other : parent.inspectorSection({ section })),\n    };\n}\n\nconst PlanMessagesContext = createContext<PlanMessages>(planMessages);\n\n/**\n * The message table in effect — {@link planMessages} with every\n * {@link PlanMessagesProvider} above overriding it.\n *\n * @returns The table\n */\nexport function usePlanMessages(): PlanMessages {\n    return useContext(PlanMessagesContext);\n}\n\n/** Props of {@link PlanVocabularyProvider}. */\nexport interface PlanVocabularyProviderProps {\n    /** The app's words, the same object while they hold. */\n    vocabulary: PlanVocabulary;\n    /** The subtree they apply to. */\n    children?: ReactNode;\n}\n\n/**\n * The app's own words for a Plan (#1516), over whatever table a host gives it.\n *\n * @param props - The words and the subtree\n * @returns The provider\n */\nexport function PlanVocabularyProvider({ vocabulary, children }: PlanVocabularyProviderProps) {\n    const parent = usePlanMessages();\n    const value = useMemo(() => planMessagesIn(parent, vocabulary), [parent, vocabulary]);\n    return createElement(PlanMessagesContext.Provider, { value }, children);\n}\n\n/** Props of {@link PlanMessagesProvider}. */\nexport interface PlanMessagesProviderProps {\n    /** The messages to override — any subset; the rest come from the table above. */\n    messages: Partial<PlanMessages>;\n    /** The subtree the overrides apply to. */\n    children?: ReactNode;\n}\n\n/**\n * Override the Plan's words for a subtree — a translation, or a house style.\n * Providers nest: each overrides the table the one above it resolved.\n *\n * @remarks\n * The overrides are read by identity: define them once (module scope, or a\n * memo), as below. A new object on every render hands every canvas beneath\n * a new table, and each re-derives all of its words.\n *\n * @param props - The overrides and the subtree\n * @returns The provider\n *\n * @example\n * ```tsx\n * const GERMAN: Partial<PlanMessages> = {\n *     allRows: () => \"← Alle Zeilen\",\n *     tabRows: () => \"Zeilen\",\n *     groupMeta: ({ count }) => `${count} Zeilen`,\n * };\n *\n * <I18nProvider locale=\"de-DE\">\n *     <PlanMessagesProvider messages={GERMAN}>\n *         <EastChakraComponent value={plan} />\n *     </PlanMessagesProvider>\n * </I18nProvider>\n * ```\n */\nexport function PlanMessagesProvider({ messages, children }: PlanMessagesProviderProps) {\n    const parent = usePlanMessages();\n    const value = useMemo(() => ({ ...parent, ...messages }), [parent, messages]);\n    return createElement(PlanMessagesContext.Provider, { value }, children);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The canvas's words in its locale (#820) — the message table in effect\n * (`messages.ts`), and the number and date formatters its parameters are\n * filled from: the shared format module's (#850), so a Plan prints numbers\n * and dates exactly as every other component in the app does.\n *\n * The locale is react-aria's (`useLocale`): an `I18nProvider` above the app\n * sets it, and the browser's language stands in otherwise. The formatters\n * are one object per locale, because most of what speaks is not React: the\n * scale's ruler labels, the derivations' numbers, the controller's\n * announcements. The canvas root resolves them ({@link useResolvedPlanWords})\n * and hands them to everything beneath it ({@link usePlanWords}) and to the\n * controller.\n *\n * Dates are UTC, like every instant on the axis (#326): the words for a\n * bucket never depend on the viewer's timezone.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext, useMemo } from \"react\";\nimport { useLocale } from \"@react-aria/i18n\";\nimport { formatters, type Formatters } from \"@elaraai/east-ui-components\";\nimport { planMessages, usePlanMessages, type PlanMessages } from \"./messages.js\";\n\n/**\n * The canvas's words: its message table, and its locale's formatters.\n *\n * `number` is what the canvas prints a number it derived or counts with — a\n * rollup's total, an aggregated heat cell, a member count (#810): the shared\n * default arm, the one a Table's undeclared cell uses, so a derived total of\n * 1234.5 prints `1,234.5` beside the author's own formatted numbers rather\n * than a hand-rolled `1235`, and the mean of 0.82, 0.64 and 0.90 prints\n * `0.787` rather than `1`. `value` is a number through an author's declared\n * format.\n */\nexport interface PlanWords extends Formatters {\n    /** The message table in effect. */\n    m: PlanMessages;\n}\n\n/**\n * Build the words for a locale and a message table.\n *\n * @param locale - The BCP 47 locale\n * @param m - The message table\n * @returns The words\n */\nexport function planWords(locale: string, m: PlanMessages): PlanWords {\n    return { ...formatters(locale), m };\n}\n\n/** The words a canvas speaks with no provider above it: English, in `en-US`. */\nexport const PLAN_WORDS: PlanWords = planWords(\"en-US\", planMessages);\n\n/** The canvas's words, provided once by the canvas root. */\nexport const PlanWordsContext = createContext<PlanWords>(PLAN_WORDS);\n\n/**\n * The canvas root's words — its locale (react-aria's `useLocale`) and the\n * message table in effect (`PlanMessagesProvider`), resolved once per change.\n *\n * @returns The words\n */\nexport function useResolvedPlanWords(): PlanWords {\n    const { locale } = useLocale();\n    const m = usePlanMessages();\n    return useMemo(() => planWords(locale, m), [locale, m]);\n}\n\n/**\n * The canvas's words, for its parts.\n *\n * @returns The words the canvas root resolved ({@link PLAN_WORDS} outside a canvas)\n */\nexport function usePlanWords(): PlanWords {\n    return useContext(PlanWordsContext);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Walks over the row tree the flat, `parent`-keyed rows encode — shared by the\n * visible-row derivation and the body items (split out of `model.ts`, #815).\n *\n * @packageDocumentation\n */\n\nimport type { PlanRowIndex } from \"./model.js\";\nimport type { RowKey } from \"./plan-state.js\";\n\n/** The strict ancestors of every key in `keys` — \"which subtrees contain one\"\n *  as a set, via upward `parent` walks (each ancestor visited once). */\nexport function ancestorsOf(index: PlanRowIndex, keys: ReadonlySet<RowKey> | undefined): ReadonlySet<RowKey> {\n    const out = new Set<RowKey>();\n    if (keys === undefined) return out;\n    for (const key of keys) {\n        let parent = index.byKey.get(key)?.parent;\n        while (parent !== undefined && parent.type === \"some\" && !out.has(parent.value)) {\n            out.add(parent.value);\n            parent = index.byKey.get(parent.value)?.parent;\n        }\n    }\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A row's key — the canonical text of its typed id (#822). Every map, DOM\n * attribute and piece of view state on the canvas keys by it, and a drag names\n * its row with it; a callback always receives the typed id itself.\n *\n * Split out of `model.ts` so the modules `model.ts` re-exports (the body items,\n * the link graph) can key by it without a circular import.\n *\n * @packageDocumentation\n */\n\nimport { parseFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport type { RowKey } from \"./plan-state.js\";\n\n/** A row's typed identity — its series and the path of entry keys to it (#822). */\nexport type PlanRowId = ValueTypeOf<typeof Plan.Types.RowId>;\n\nconst printRowId = printFor(Plan.Types.RowId);\nconst parseRowId = parseFor(Plan.Types.RowId);\n\n/**\n * The canonical text of a row id — the canvas row's key, East's own `.east`\n * printing of the id (`printFor`), so it is the same text a host builds with\n * `East.print(Plan.ref(…))` and parses back with `row.parse(Plan.Types.RowId)`.\n *\n * @remarks\n * A function of exactly ONE argument, so it maps point-free\n * (`ids.map(rowKeyOf)`): East's printer takes further parameters of its own,\n * and handed `map`'s index and array as those it threw on the first list that\n * held an id — a bound `ui` state's expanded charts (#824).\n *\n * @param id - The row's id\n * @returns The row's key\n */\nexport function rowKeyOf(id: PlanRowId): RowKey {\n    return printRowId(id);\n}\n\n/**\n * The typed id a row's key is the text of — the inverse of {@link rowKeyOf},\n * for the places that hold only the key: a DOM element's row attribute, the\n * UI state's selected row.\n *\n * @remarks\n * A row repeating an earlier row's id keys as that text with `#n` appended\n * (`toCanvasRows`) and names the same id, so the suffix is dropped before the\n * text is parsed. No printed id ends in `#` and digits: it ends with the\n * variant payload's closing parenthesis.\n *\n * @param key - A canvas row key\n * @returns The id, or `undefined` when the text is not one\n */\nexport function rowIdOfKey(key: RowKey): PlanRowId | undefined {\n    const parsed = parseRowId(key.replace(/#\\d+$/, \"\"));\n    return parsed.success ? (parsed.value as PlanRowId) : undefined;\n}\n\n/**\n * A row's key in words, for when the row itself is not at hand to name it by\n * its label (a paged row that has not landed): the last segment of its id's\n * path — the entry's own key — or, for a section header, its series.\n *\n * @param key - A canvas row key\n * @returns Words a reader can follow; the key itself when it names no id\n */\nexport function rowKeyWords(key: RowKey): string {\n    const id = rowIdOfKey(key);\n    if (id === undefined) return key;\n    const path = id.value.path;\n    return path.length > 0 ? path[path.length - 1]! : id.value.series;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's instant vocabulary, decoded (#631) — the one place the three\n * axis arms (`time` / `number` / `ordinal`) are read as NUMBERS for ordering\n * and grouping, or built as real East values. Everything geometric goes\n * through the scale (`scale.ts`); these helpers are what the scale, the\n * renderer-side derivations (`model.ts`) and the DnD slot encoding share.\n *\n * @packageDocumentation\n */\n\nimport { DateTimeType, FloatType, equalFor, parseFor, printFor, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\n\n/** One decoded instant — `{ time | number | ordinal }` (derived from the East type, never mirrored). */\nexport type PlanInstantValue = ValueTypeOf<typeof Plan.Types.Instant>;\n\n/** Whether two instants are alike — the same arm and the same East value. */\nexport const equalInstants: (a: PlanInstantValue, b: PlanInstantValue) => boolean = equalFor(Plan.Types.Instant);\n\nconst printTime = printFor(DateTimeType);\nconst printNumber = printFor(FloatType);\nconst readTime = parseFor(DateTimeType);\nconst readNumber = parseFor(FloatType);\n\n/** The axis kinds — the arms of {@link PlanInstantValue}. */\nexport type PlanAxisKind = PlanInstantValue[\"type\"];\n\n/** A `time` instant — a REAL East variant value (`variant`, never a `{ type, value }` literal). */\nexport function timeInstant(d: Date): PlanInstantValue {\n    return variant(\"time\", d) as PlanInstantValue;\n}\n\n/** A `number` instant. */\nexport function numberInstant(n: number): PlanInstantValue {\n    return variant(\"number\", n) as PlanInstantValue;\n}\n\n/** An `ordinal` instant. */\nexport function ordinalInstant(s: string): PlanInstantValue {\n    return variant(\"ordinal\", s) as PlanInstantValue;\n}\n\n/**\n * The instant as a comparable number ON ITS OWN ARM — epoch ms for `time`,\n * the value for `number`, the declared INDEX for `ordinal` (`NaN` when the\n * value is not in the declared list, or no list is given). Comparing two\n * instants of different arms is meaningless; callers hold the arm against\n * the axis first.\n *\n * @param t - The instant\n * @param ordinal - The ordinal axis's value → index map, when known\n * @returns The comparable number, or `NaN`\n */\nexport function instantOrder(t: PlanInstantValue, ordinal?: ReadonlyMap<string, number>): number {\n    switch (t.type) {\n        case \"time\": return t.value.getTime();\n        case \"number\": return t.value;\n        case \"ordinal\": return ordinal?.get(t.value) ?? NaN;\n    }\n}\n\n/**\n * A stable identity for grouping cells by instant — its arm and its value as\n * East prints it (`time:2026-01-05T00:00:00.000`, `number:3.0`,\n * `ordinal:P1`): two instants that name the same bucket share a key.\n *\n * @param t - The instant\n * @returns The grouping key\n */\nexport function instantKey(t: PlanInstantValue): string {\n    switch (t.type) {\n        case \"time\": return `time:${printTime(t.value)}`;\n        case \"number\": return `number:${printNumber(t.value)}`;\n        case \"ordinal\": return `ordinal:${t.value}`;\n    }\n}\n\n/**\n * The instant a {@link instantKey} names — its inverse, read with East's\n * parsers, so an element can carry its instant in a DOM attribute and the\n * canvas read it back (#816: a cell's `data-cell`).\n *\n * @param key - A key `instantKey` produced\n * @returns The instant, or `undefined` for a string no instant produces\n */\nexport function instantOfKey(key: string): PlanInstantValue | undefined {\n    const colon = key.indexOf(\":\");\n    if (colon < 0) return undefined;\n    const arm = key.slice(0, colon);\n    const rest = key.slice(colon + 1);\n    switch (arm) {\n        case \"time\": {\n            const read = readTime(rest);\n            return read.success ? timeInstant(read.value) : undefined;\n        }\n        case \"number\": {\n            const read = readNumber(rest);\n            return read.success ? numberInstant(read.value) : undefined;\n        }\n        case \"ordinal\":\n            return ordinalInstant(rest);\n        default:\n            return undefined;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Reductions that hold at production row counts (#810).\n *\n * A spread into a call — `Math.max(...xs)`, `out.push(...xs)` — passes every\n * element as an ARGUMENT, and the engine caps the arguments one call can take:\n * past roughly 125,000 on Node 22 it throws `RangeError: Maximum call stack\n * size exceeded`. A canvas deriving over a band that size crashed, so every\n * reduction under `src/plan/` is one of these loops, and `make lint` refuses\n * a spread into a call anywhere in the directory.\n *\n * @packageDocumentation\n */\n\n/**\n * The greatest of `values` — `Math.max(...values)` without the argument\n * limit, and with its answers: `-Infinity` for no values, `NaN` when any\n * value is `NaN`.\n *\n * @param values - The numbers\n * @returns Their maximum\n */\nexport function maxOf(values: Iterable<number>): number {\n    let out = -Infinity;\n    for (const v of values) out = Math.max(out, v);\n    return out;\n}\n\n/**\n * The least of `values` — `Math.min(...values)` without the argument limit,\n * and with its answers: `Infinity` for no values, `NaN` when any value is\n * `NaN`.\n *\n * @param values - The numbers\n * @returns Their minimum\n */\nexport function minOf(values: Iterable<number>): number {\n    let out = Infinity;\n    for (const v of values) out = Math.min(out, v);\n    return out;\n}\n\n/**\n * Append every element of `source` to `target`, in order —\n * `target.push(...source)` without the argument limit.\n *\n * @typeParam T - The element type\n * @param target - The array appended to (mutated)\n * @param source - The elements to append\n * @returns `target`\n */\nexport function appendAll<T>(target: T[], source: Iterable<T>): T[] {\n    for (const x of source) target.push(x);\n    return target;\n}\n\n/** A half-open interval `[start, end)` on an axis's order. */\nexport interface OrderInterval {\n    /** The first instant covered. */\n    start: number;\n    /** The first instant NOT covered. */\n    end: number;\n}\n\n/**\n * The most intervals covering any one instant — a rollup band's peak\n * concurrency.\n *\n * @remarks\n * A sweep line: the starts and the ends, each sorted, walked once —\n * O(k log k). Intervals are HALF-OPEN, so where one ends at the instant\n * another starts, the ending one closes first: two runs that touch are\n * sequential, never concurrent. An empty interval (`end <= start`, or a `NaN`\n * bound) covers no instant and counts nowhere.\n *\n * It replaced a count that filtered every member for every member — O(k²),\n * 208 ms per derive at 4,000 runs, on every data commit.\n *\n * @param intervals - The intervals, in any order\n * @returns The peak; `0` when no interval covers an instant\n */\nexport function peakConcurrency(intervals: Iterable<OrderInterval>): number {\n    const starts: number[] = [];\n    const ends: number[] = [];\n    for (const { start, end } of intervals) {\n        if (!(end > start)) continue;\n        starts.push(start);\n        ends.push(end);\n    }\n    // A typed array sorts numerically, with no comparator call per pair.\n    const s = Float64Array.from(starts).sort();\n    const e = Float64Array.from(ends).sort();\n    let peak = 0;\n    let active = 0;\n    let closed = 0;\n    for (const at of s) {\n        // Everything ending AT this instant closed before it opens.\n        while (closed < e.length && e[closed]! <= at) {\n            active -= 1;\n            closed += 1;\n        }\n        active += 1;\n        if (active > peak) peak = active;\n    }\n    return peak;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Temporal fold (#824) — what a row shows in a bucket that holds more than\n * one of its cells or points: ONE, their declared `fold`.\n *\n * Cells and chart points sit at their own instants; the scale's resolution\n * decides the buckets. Where a bucket is coarser than the data — weekly cells\n * on a MONTH axis — it shows one element whose value is its members' fold\n * (`sum` / `mean` / `min` / `max` / `last` / `count`), never the members piled\n * into one column. Every kind that places values by bucket folds alike: heat,\n * weight and segment cells, table numerals, and a chart's line, area and\n * column layers (scatter and band layers draw every point).\n *\n * A fold keeps what it does not change. A bucket with ONE member keeps that\n * member as it is — its own instant, label and text — unless the fold is\n * `count`, which always counts; so at the data's own resolution nothing moves,\n * and a list whose buckets each hold one member comes back as the very same\n * array (a row memo keyed on it skips). A bucket with several members sits at\n * the period's start, or at their shared instant when they share one.\n *\n * @packageDocumentation\n */\n\nimport { none, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { instantKey, instantOrder, type PlanInstantValue } from \"./instant.js\";\nimport { maxOf, minOf } from \"./reductions.js\";\nimport type { PlanWords } from \"./words.js\";\n\n/** A fold, as its tag — `PlanFoldType` (derived from the East type, never mirrored). */\nexport type PlanFold = ValueTypeOf<typeof Plan.Types.Fold>[\"type\"];\n\ntype HeatCellsValue = ValueTypeOf<typeof Plan.Types.HeatCells>;\ntype HeatCellValue = ValueTypeOf<typeof Plan.Types.HeatCell>;\ntype WeightCellValue = ValueTypeOf<typeof Plan.Types.WeightCell>;\ntype SegmentCellValue = ValueTypeOf<typeof Plan.Types.SegmentCell>;\ntype SegmentValue = ValueTypeOf<typeof Plan.Types.Segment>;\ntype TableCellValue = ValueTypeOf<typeof Plan.Types.TableCell>;\ntype TableSeriesValue = ValueTypeOf<typeof Plan.Types.TableSeries>;\ntype ChartLayerValue = ValueTypeOf<typeof Plan.Types.ChartLayer>;\ntype ChartPointValue = ValueTypeOf<typeof Plan.Types.ChartPoint>;\n\n/**\n * The period a canvas buckets by — what a fold groups instants by. The scale\n * owns it (`PlanScale.period`): one object per key, so a memo can depend on\n * it and re-fold only when the resolution changes, not on every pan.\n */\nexport interface PlanPeriod {\n    /** Names the period: two periods with one key floor every instant alike. */\n    readonly key: string;\n    /** The start of the period holding an instant — the instant itself when\n     *  it rides another arm than the axis's. */\n    floor(t: PlanInstantValue): PlanInstantValue;\n}\n\n/**\n * Fold a bucket's numbers.\n *\n * @param values - The members' values, in axis order (`last` reads the final one)\n * @param fold - The fold\n * @returns The folded value — `count` counts (0 for none); every other fold is\n *   `undefined` for no values\n */\nexport function foldNumbers(values: readonly number[], fold: PlanFold): number | undefined {\n    if (fold === \"count\") return values.length;\n    if (values.length === 0) return undefined;\n    switch (fold) {\n        case \"sum\":\n        case \"mean\": {\n            let total = 0;\n            for (const v of values) total += v;\n            return fold === \"sum\" ? total : total / values.length;\n        }\n        case \"min\": return minOf(values);\n        case \"max\": return maxOf(values);\n        case \"last\": return values[values.length - 1];\n    }\n}\n\n/** One bucket's members. */\nexport interface BucketGroup<C> {\n    /** Where the bucket's folded element sits — the members' own instant when\n     *  they share one, else the period's start. */\n    at: PlanInstantValue;\n    /** The members, in axis order (members at one instant keep their order). */\n    members: C[];\n}\n\n/**\n * Group elements by the period that holds each — by the instant itself\n * without a period — buckets and members in axis order.\n *\n * @remarks\n * Instants with a comparable order sort; an ordinal set without its index map\n * (the ledger's height measure) keeps insertion order, which is all a height\n * needs.\n *\n * @param items - The elements\n * @param atOf - An element's instant\n * @param period - The canvas's period, when a scale is known\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @returns One group per bucket\n */\nexport function bucketGroups<C>(\n    items: readonly C[],\n    atOf: (c: C) => PlanInstantValue,\n    period: PlanPeriod | undefined,\n    ordinal?: ReadonlyMap<string, number>,\n): BucketGroup<C>[] {\n    const groups = new Map<string, { start: PlanInstantValue; members: C[]; shared: boolean }>();\n    for (const c of items) {\n        const at = atOf(c);\n        const start = period !== undefined ? period.floor(at) : at;\n        const key = instantKey(start);\n        const g = groups.get(key);\n        if (g === undefined) {\n            groups.set(key, { start, members: [c], shared: true });\n        } else {\n            if (g.shared && instantKey(atOf(g.members[0]!)) !== instantKey(at)) g.shared = false;\n            g.members.push(c);\n        }\n    }\n    const out = [...groups.values()];\n    const orders = out.map((g) => instantOrder(g.start, ordinal));\n    if (orders.every((n) => Number.isFinite(n))) {\n        const rank = new Map(out.map((g, i) => [g, orders[i]!]));\n        out.sort((a, b) => rank.get(a)! - rank.get(b)!);\n    }\n    return out.map((g) => ({\n        at: g.shared ? atOf(g.members[0]!) : g.start,\n        members: inAxisOrder(g.members, atOf, ordinal),\n    }));\n}\n\n/** Members in axis order — stable, and left as given when their instants do not order. */\nfunction inAxisOrder<C>(members: C[], atOf: (c: C) => PlanInstantValue, ordinal: ReadonlyMap<string, number> | undefined): C[] {\n    if (members.length < 2) return members;\n    const orders = members.map((m) => instantOrder(atOf(m), ordinal));\n    if (!orders.every((n) => Number.isFinite(n))) return members;\n    const idx = members.map((_, i) => i).sort((a, b) => orders[a]! - orders[b]! || a - b);\n    return idx.map((i) => members[i]!);\n}\n\n/** Whether a fold leaves the elements as they are — every bucket holds one, and the fold keeps it. */\nfunction keepsAll<C>(groups: readonly BucketGroup<C>[], fold: PlanFold): boolean {\n    return fold !== \"count\" && groups.every((g) => g.members.length === 1);\n}\n\n/**\n * Fold a heat arm's cells.\n *\n * @remarks\n * A folded cell prints a label only where its members did — a row painted by\n * depth alone stays that way — and then its value through the arm's `format`\n * (a `count`, as a plain number). A cell with no value in any member is no\n * data, except under `count`, which counts 0.\n *\n * @param cells - The cells\n * @param fold - The arm's fold\n * @param period - The canvas's period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @param print - How a folded value prints\n * @returns The folded cells — `cells` itself when nothing folds\n */\nexport function foldHeatCells(\n    cells: HeatCellValue[],\n    fold: PlanFold,\n    period: PlanPeriod | undefined,\n    ordinal: ReadonlyMap<string, number> | undefined,\n    print: (v: number) => string,\n): HeatCellValue[] {\n    const groups = bucketGroups(cells, (c) => c.at, period, ordinal);\n    if (keepsAll(groups, fold)) return cells;\n    return groups.map((g): HeatCellValue => {\n        if (g.members.length === 1 && fold !== \"count\") return g.members[0]!;\n        const values = g.members.flatMap((c) => (c.value.type === \"some\" ? [c.value.value] : []));\n        const v = foldNumbers(values, fold);\n        const labelled = g.members.some((c) => c.label.type === \"some\");\n        return {\n            at: g.at,\n            value: v !== undefined ? some(v) : none,\n            label: v !== undefined && labelled ? some(print(v)) : none,\n        };\n    });\n}\n\n/**\n * Fold a weight arm's cells — each bucket's booked fraction folded, and pale\n * (planned) only when every member is.\n *\n * @param cells - The cells\n * @param fold - The arm's fold\n * @param period - The canvas's period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @returns The folded cells — `cells` itself when nothing folds\n */\nexport function foldWeightCells(\n    cells: WeightCellValue[],\n    fold: PlanFold,\n    period: PlanPeriod | undefined,\n    ordinal: ReadonlyMap<string, number> | undefined,\n): WeightCellValue[] {\n    const groups = bucketGroups(cells, (c) => c.at, period, ordinal);\n    if (keepsAll(groups, fold)) return cells;\n    return groups.map((g): WeightCellValue => {\n        if (g.members.length === 1 && fold !== \"count\") return g.members[0]!;\n        return {\n            at: g.at,\n            fraction: foldNumbers(g.members.map((c) => c.fraction), fold) ?? 0,\n            planned: g.members.every((c) => c.planned),\n        };\n    });\n}\n\n/**\n * Fold a segment arm's cells — each fill's weights folded across the members\n * (a member without the fill weighs 0 there; `count` counts the members that\n * carry it), the fills in the order they first appear. A folded segment\n * carries no in-bar label: a label described one cell.\n *\n * @param cells - The cells\n * @param fold - The arm's fold\n * @param period - The canvas's period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @returns The folded cells — `cells` itself when nothing folds\n */\nexport function foldSegmentCells(\n    cells: SegmentCellValue[],\n    fold: PlanFold,\n    period: PlanPeriod | undefined,\n    ordinal: ReadonlyMap<string, number> | undefined,\n): SegmentCellValue[] {\n    const groups = bucketGroups(cells, (c) => c.at, period, ordinal);\n    if (keepsAll(groups, fold)) return cells;\n    return groups.map((g): SegmentCellValue => {\n        if (g.members.length === 1 && fold !== \"count\") return g.members[0]!;\n        const fills: SegmentValue[\"fill\"][] = [];\n        const byFill = new Map<string, (number | undefined)[]>();\n        g.members.forEach((c, i) => {\n            for (const s of c.segments) {\n                let weights = byFill.get(s.fill.type);\n                if (weights === undefined) {\n                    weights = new Array<number | undefined>(g.members.length).fill(undefined);\n                    byFill.set(s.fill.type, weights);\n                    fills.push(s.fill);\n                }\n                weights[i] = (weights[i] ?? 0) + s.weight;\n            }\n        });\n        return {\n            at: g.at,\n            segments: fills.map((fill): SegmentValue => {\n                const weights = byFill.get(fill.type)!;\n                const weight = fold === \"count\"\n                    ? weights.filter((w) => w !== undefined).length\n                    : foldNumbers(weights.map((w) => w ?? 0), fold) ?? 0;\n                return { fill, weight, label: none };\n            }),\n        };\n    });\n}\n\n/**\n * Fold any heat-kind arm — heat, weight or segments — by its own fold.\n *\n * @param arm - The arm\n * @param period - The canvas's period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @param w - The canvas's words — a folded heat label prints through the arm's `format`\n * @returns The folded arm — `arm` itself when nothing folds\n */\nexport function foldHeatArm(\n    arm: HeatCellsValue,\n    period: PlanPeriod | undefined,\n    ordinal: ReadonlyMap<string, number> | undefined,\n    w: PlanWords,\n): HeatCellsValue {\n    switch (arm.type) {\n        case \"heat\": {\n            const fold = arm.value.fold.type;\n            const format = getSomeorUndefined(arm.value.format);\n            const cells = foldHeatCells(arm.value.cells, fold, period, ordinal,\n                (v) => (fold === \"count\" ? w.number(v) : w.value(v, format)));\n            return Object.is(cells, arm.value.cells) ? arm : variant(\"heat\", { ...arm.value, cells });\n        }\n        case \"weight\": {\n            const cells = foldWeightCells(arm.value.cells, arm.value.fold.type, period, ordinal);\n            return Object.is(cells, arm.value.cells) ? arm : variant(\"weight\", { ...arm.value, cells });\n        }\n        case \"segments\": {\n            const cells = foldSegmentCells(arm.value.cells, arm.value.fold.type, period, ordinal);\n            return Object.is(cells, arm.value.cells) ? arm : variant(\"segments\", { ...arm.value, cells });\n        }\n    }\n}\n\n/**\n * Fold table cells — a bucket's values folded; a folded cell carries no text\n * or tone override (the renderer prints and tones its value, as it does any\n * cell's).\n *\n * @param cells - The cells\n * @param fold - The series' fold\n * @param period - The canvas's period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @returns The folded cells — `cells` itself when nothing folds\n */\nexport function foldTableCells(\n    cells: TableCellValue[],\n    fold: PlanFold,\n    period: PlanPeriod | undefined,\n    ordinal: ReadonlyMap<string, number> | undefined,\n): TableCellValue[] {\n    const groups = bucketGroups(cells, (c) => c.at, period, ordinal);\n    if (keepsAll(groups, fold)) return cells;\n    return groups.map((g): TableCellValue => {\n        if (g.members.length === 1 && fold !== \"count\") return g.members[0]!;\n        const values = g.members.flatMap((c) => (c.value.type === \"some\" ? [c.value.value] : []));\n        const v = foldNumbers(values, fold);\n        return { at: g.at, value: v !== undefined ? some(v) : none, text: none, tone: none };\n    });\n}\n\n/**\n * Fold a table row's value series, each by its own fold.\n *\n * @param series - The series\n * @param period - The canvas's period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @returns The folded series — `series` itself when nothing folds\n */\nexport function foldTableSeries(\n    series: TableSeriesValue[],\n    period: PlanPeriod | undefined,\n    ordinal: ReadonlyMap<string, number> | undefined,\n): TableSeriesValue[] {\n    let changed = false;\n    const out = series.map((s): TableSeriesValue => {\n        const cells = foldTableCells(s.cells, s.fold.type, period, ordinal);\n        if (Object.is(cells, s.cells)) return s;\n        changed = true;\n        return { ...s, cells };\n    });\n    return changed ? out : series;\n}\n\n/**\n * Fold a chart layer's points — a bucket's finite values folded (a gap, a\n * non-finite `y`, is no value; a bucket of gaps stays one).\n *\n * @param points - The points\n * @param fold - The layer's fold\n * @param period - The canvas's period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @returns The folded points — `points` itself when nothing folds\n */\nexport function foldChartPoints(\n    points: ChartPointValue[],\n    fold: PlanFold,\n    period: PlanPeriod | undefined,\n    ordinal: ReadonlyMap<string, number> | undefined,\n): ChartPointValue[] {\n    const groups = bucketGroups(points, (p) => p.t, period, ordinal);\n    if (keepsAll(groups, fold)) return points;\n    return groups.map((g): ChartPointValue => {\n        if (g.members.length === 1 && fold !== \"count\") return g.members[0]!;\n        const values = g.members.flatMap((p) => (Number.isFinite(p.y) ? [p.y] : []));\n        return { t: g.at, y: foldNumbers(values, fold) ?? NaN };\n    });\n}\n\n/**\n * Fold a chart row's layers — its line, area and column layers each by its\n * own fold; scatter, band and reference layers as they are.\n *\n * @param layers - The layers\n * @param period - The canvas's period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @returns The folded layers — `layers` itself when nothing folds\n */\nexport function foldChartLayers(\n    layers: ChartLayerValue[],\n    period: PlanPeriod | undefined,\n    ordinal: ReadonlyMap<string, number> | undefined,\n): ChartLayerValue[] {\n    let changed = false;\n    const out = layers.map((layer): ChartLayerValue => {\n        switch (layer.type) {\n            case \"line\": {\n                const points = foldChartPoints(layer.value.points, layer.value.fold.type, period, ordinal);\n                if (Object.is(points, layer.value.points)) return layer;\n                changed = true;\n                return variant(\"line\", { ...layer.value, points });\n            }\n            case \"area\": {\n                const points = foldChartPoints(layer.value.points, layer.value.fold.type, period, ordinal);\n                if (Object.is(points, layer.value.points)) return layer;\n                changed = true;\n                return variant(\"area\", { ...layer.value, points });\n            }\n            case \"column\": {\n                const points = foldChartPoints(layer.value.points, layer.value.fold.type, period, ordinal);\n                if (Object.is(points, layer.value.points)) return layer;\n                changed = true;\n                return variant(\"column\", { ...layer.value, points });\n            }\n            case \"scatter\": case \"band\": case \"refLine\": case \"refBand\": case \"refDot\":\n                return layer;\n        }\n    });\n    return changed ? out : layers;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Quantities as words (#824) — a run's or a link's `quantity` is ONE value\n * with its unit and how it prints, so the caption a bar or a ribbon shows and\n * the total a rollup band sums can never disagree.\n *\n * A caption is the quantity's `text` when the author wrote one; otherwise its\n * value through its `format` (the canvas's plain number without one), in the\n * canvas's locale, then its unit. Totals sum unit by unit — sheets never add\n * to hours — each unit printing through the format its first member declares.\n *\n * @packageDocumentation\n */\n\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, type TickFormatOpt } from \"@elaraai/east-ui-components\";\nimport type { PlanWords } from \"./words.js\";\n\n/** A decoded quantity (derived from the East type, never mirrored). */\nexport type PlanQuantityValue = ValueTypeOf<typeof Plan.Types.Quantity>;\n\n/**\n * A quantity's caption — `96 k sheets`.\n *\n * @param q - The quantity\n * @param w - The canvas's words\n * @returns Its `text`, else its value through its format, then its unit\n */\nexport function quantityText(q: PlanQuantityValue, w: PlanWords): string {\n    if (q.text.type === \"some\") return q.text.value;\n    return w.m.quantity({ value: w.value(q.value, getSomeorUndefined(q.format)), unit: getSomeorUndefined(q.unit) });\n}\n\n/** One unit's total. */\nexport interface PlanQuantityTotal {\n    /** The unit — `undefined` for quantities that declare none. */\n    unit: string | undefined;\n    /** The sum of the unit's values. */\n    value: number;\n    /** How the total prints — the format the unit's first member declares. */\n    format: TickFormatOpt;\n}\n\n/**\n * Sum quantities unit by unit.\n *\n * @param quantities - The quantities\n * @returns One total per unit, in the order the units first appear\n */\nexport function totalsByUnit(quantities: readonly PlanQuantityValue[]): PlanQuantityTotal[] {\n    const out: PlanQuantityTotal[] = [];\n    const byUnit = new Map<string | undefined, PlanQuantityTotal>();\n    for (const q of quantities) {\n        const unit = getSomeorUndefined(q.unit);\n        const total = byUnit.get(unit);\n        if (total !== undefined) {\n            total.value += q.value;\n        } else {\n            const first: PlanQuantityTotal = { unit, value: q.value, format: getSomeorUndefined(q.format) };\n            byUnit.set(unit, first);\n            out.push(first);\n        }\n    }\n    return out;\n}\n\n/**\n * Totals as one caption — `208 k sheets · 12 h`.\n *\n * @param totals - The totals ({@link totalsByUnit})\n * @param w - The canvas's words\n * @returns The caption\n */\nexport function totalsText(totals: readonly PlanQuantityTotal[], w: PlanWords): string {\n    return w.m.quantities({\n        parts: totals.map((t) => w.m.quantity({ value: w.value(t.value, t.format), unit: t.unit })),\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The instants a row carries (#631) — one walk over every arm's instant\n * fields, and what the axis reads off it: the rows whose instants ride another\n * arm (split out of `model.ts`, #815). The axis never fits its window to them\n * (#822): the window is stated, or a bound slice's range.\n *\n * @packageDocumentation\n */\n\nimport type { PlanAxisKind, PlanInstantValue } from \"./instant.js\";\nimport type { PlanRowIndex, PlanRowValue } from \"./model.js\";\nimport type { RowKey } from \"./plan-state.js\";\n\n// ── Instants (#631) ────────────────────────────────────────────────────────\n\n/**\n * Visit every instant a row carries — each arm's instant fields, whatever\n * the kind — so every walk over a row's instants reads one list rather than\n * keeping its own copy of the row vocabulary.\n *\n * @param row - The decoded row\n * @param visit - Called once per instant (interval ENDS flagged, so an\n *   ordinal end can be read inclusively)\n */\nexport function forEachInstant(row: PlanRowValue, visit: (t: PlanInstantValue, end: boolean) => void): void {\n    const kind = row.kind;\n    switch (kind.type) {\n        case \"span\":\n            for (const r of kind.value.runs) { visit(r.start, false); visit(r.end, true); }\n            for (const d of kind.value.decisions) visit(d.at, false);\n            for (const p of kind.value.ports) visit(p.at, false);\n            break;\n        case \"buckets\":\n            for (const e of kind.value.events) visit(e.at, false);\n            for (const m of kind.value.markers) visit(m.at, false);\n            break;\n        case \"chart\":\n            for (const layer of kind.value.layers) {\n                switch (layer.type) {\n                    case \"line\": case \"area\": case \"column\": case \"scatter\": case \"band\":\n                        for (const p of layer.value.points) visit(p.t, false);\n                        break;\n                    case \"refBand\": visit(layer.value.from, false); visit(layer.value.to, true); break;\n                    case \"refDot\": visit(layer.value.t, false); break;\n                    case \"refLine\": break;\n                }\n            }\n            break;\n        case \"heat\":\n            // Every arm is `{ cells, … }` (#824), so one walk reads them all.\n            for (const c of kind.value.cells.value.cells) visit(c.at, false);\n            break;\n        case \"table\":\n            for (const s of kind.value.series) for (const c of s.cells) visit(c.at, false);\n            break;\n        case \"cards\":\n            for (const c of kind.value.chips) { visit(c.from, false); visit(c.to, true); }\n            break;\n        case \"events\":\n            for (const m of kind.value.marks) visit(m.at, false);\n            break;\n        case \"group\": {\n            // Only declared strip cells carry instants — an aggregate's are\n            // derived from members that are rows of their own.\n            const summary = kind.value.summary;\n            if (summary.type === \"cells\") for (const c of summary.value.value.cells) visit(c.at, false);\n            break;\n        }\n    }\n}\n\n/** One row whose instants ride another arm than the axis — the diagnostic's subject. */\nexport interface PlanAxisMismatch {\n    /** The offending row's key. */\n    row: RowKey;\n    /** The arm its instants ride (the first one found). */\n    found: PlanAxisKind;\n}\n\n/**\n * The rows whose instants do NOT ride the axis's arm — the Planner's\n * single-axis-kind rule, enforced at render time (#631). A mixed arm is a\n * diagnostic naming the row and the arm it carries, never a silent\n * misplacement — and it belongs to THAT row (#811): the row renders in place\n * as a diagnostic row and derives nothing, while the rest of the canvas keeps\n * drawing. (It used to replace the whole canvas, so one bad row arriving in a\n * paged window mid-scroll made everything vanish.)\n *\n * @param index - The row-tree index\n * @param kind - The axis kind\n * @returns One entry per offending row, in collection order\n */\nexport function axisKindMismatches(index: PlanRowIndex, kind: PlanAxisKind): PlanAxisMismatch[] {\n    const out: PlanAxisMismatch[] = [];\n    for (const row of index.rows) {\n        let found: PlanAxisKind | undefined;\n        forEachInstant(row, (t) => { if (found === undefined && t.type !== kind) found = t.type; });\n        if (found !== undefined) out.push({ row: row.key, found });\n    }\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's renderer-side derivations (§4.2 — the Table idiom): the IR\n * DECLARES rollups, aggregates, subtotals, summaries and folds, and the numbers\n * are computed here over the decoded rows (split out of `model.ts`, #815).\n *\n * @packageDocumentation\n */\n\nimport { ArrayType, equalFor, none, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, type TickFormatOpt } from \"@elaraai/east-ui-components\";\nimport { instantOrder, type PlanAxisKind, type PlanInstantValue } from \"./instant.js\";\nimport { appendAll, maxOf, minOf, peakConcurrency } from \"./reductions.js\";\nimport { PLAN_WORDS, type PlanWords } from \"./words.js\";\nimport { bucketGroups, foldChartLayers, foldHeatArm, foldTableSeries, type PlanPeriod } from \"./fold.js\";\nimport { totalsByUnit, totalsText, type PlanQuantityValue } from \"./quantity.js\";\nimport type { PlanRowIndex, PlanRowValue } from \"./model.js\";\nimport type { RowKey } from \"./plan-state.js\";\nimport type { ChartKindValue } from \"./rows/chart-geometry.js\";\nimport { axisKindMismatches } from \"./row-instants.js\";\n\n// ── Renderer-side derivations (§4.2 — the Table idiom) ─────────────────────\n//\n// The IR carries DECLARATIONS (`rollup`, `aggregate` + scale, the group's\n// `summary`, `format`, `fold`); the numbers — rollup bands, per-bucket\n// aggregates, subtotal cells, strip summaries, folded cells — are derived here\n// over the decoded values, exactly as Table's renderer computes its group\n// subtotals.\n//\n// FOLD FIRST (#824): every row's values are folded to the canvas's period\n// before anything aggregates them, so a parent summarises what its children\n// SHOW — a month's mean of four weekly heat cells, not four overlapping cells.\n// Without a period (the ledger's height measure) nothing folds.\n//\n// Instants are ordered on their own arm (`instantOrder`): epoch ms, the\n// value, or — for an ordinal axis — the declared index, which the caller\n// passes in as `ordinal`. Without it ordinal cells keep their insertion\n// order, which is what the ledger's height measure needs and all it needs.\n\ntype RunValue = ValueTypeOf<typeof Plan.Types.Run>;\ntype HeatCellsValue = ValueTypeOf<typeof Plan.Types.HeatCells>;\ntype HeatCellValue = ValueTypeOf<typeof Plan.Types.HeatCell>;\ntype HeatScaleValue = ValueTypeOf<typeof Plan.Types.HeatScale>;\ntype TableCellValue = ValueTypeOf<typeof Plan.Types.TableCell>;\ntype TableSeriesValue = ValueTypeOf<typeof Plan.Types.TableSeries>;\n\n/**\n * A table row's AGGREGABLE positions — the ones a parent subtotals.\n *\n * `rollup: true` NARROWS: flag a position and only the flagged ones roll up,\n * which is how a row says \"the actual is the number, the Δ beside it is\n * commentary\". Flag nothing and EVERY position rolls up, so a subtotal mirrors\n * the shape of the rows it totals — a parent over `act`/`Δ` children shows an\n * act subtotal beside a Δ subtotal rather than silently dropping one.\n *\n * (It used to return one position's cells unconditionally — the unflagged case\n * fell back to `series[0]`, so a multi-value row's second position vanished\n * into a parent that looked complete.)\n */\nexport function tableRollupSeries(series: readonly TableSeriesValue[]): readonly TableSeriesValue[] {\n    const flagged = series.filter((x) => x.rollup);\n    return flagged.length > 0 ? flagged : series;\n}\n\n/** One derived rollup band (`×k · qty`, pessimistic state). */\nexport interface DerivedBand {\n    from: PlanInstantValue;\n    /** The band's end — on an ordinal axis the LAST bucket covered (inclusive). */\n    to: PlanInstantValue;\n    /** Peak concurrency inside the band. */\n    count: number;\n    /** The members' quantities summed unit by unit, as a caption (`\"208 k sheets · 12 h\"`, in the\n     *  canvas's locale — #820, #824) — absent unless every member carries a quantity. */\n    quantity: string | undefined;\n    /** The least-certain member's lifecycle state. */\n    state: RunValue[\"state\"];\n}\n\n/** Certainty rank — lower is less certain; bands wear the minimum. */\nconst STATE_RANK: Record<string, number> = {\n    estimated: 0, proposed: 1, confirmed: 2, \"in-progress\": 3, actual: 3, rejected: 4,\n};\n\n/** An interval END on its arm — an ordinal end names its last bucket, so it\n *  closes one bucket LATER than its own index (the scale's `endFracOf` rule). */\nfunction endOrder(t: PlanInstantValue, ordinal: ReadonlyMap<string, number> | undefined): number {\n    const n = instantOrder(t, ordinal);\n    return t.type === \"ordinal\" ? n + 1 : n;\n}\n\n/** Union-merge one run set into bands (rejected runs excluded). */\nfunction mergeBands(\n    runs: readonly RunValue[],\n    ordinal: ReadonlyMap<string, number> | undefined,\n    w: PlanWords,\n): DerivedBand[] {\n    const startOf = (r: RunValue) => instantOrder(r.start, ordinal);\n    const endOf = (r: RunValue) => endOrder(r.end, ordinal);\n    const active = runs\n        .filter((r) => r.state.type !== \"rejected\" && Number.isFinite(startOf(r)) && Number.isFinite(endOf(r)))\n        .slice()\n        .sort((a, b) => startOf(a) - startOf(b));\n    if (active.length === 0) return [];\n    const groups: { members: RunValue[]; from: PlanInstantValue; to: PlanInstantValue; toN: number }[] = [];\n    for (const r of active) {\n        const last = groups[groups.length - 1];\n        if (last !== undefined && startOf(r) < last.toN) {\n            last.members.push(r);\n            if (endOf(r) > last.toN) { last.to = r.end; last.toN = endOf(r); }\n        } else {\n            groups.push({ members: [r], from: r.start, to: r.end, toN: endOf(r) });\n        }\n    }\n    return groups.map((g) => {\n        // A sweep line, not a per-member filter over every member (O(k²) —\n        // #810). Never below 1: a band holds at least its own member, even\n        // one whose interval covers no instant.\n        const count = Math.max(1, peakConcurrency(g.members.map((m) => ({ start: startOf(m), end: endOf(m) }))));\n        // Each member's quantity carries its own unit (#824): sheets sum with\n        // sheets and hours with hours, and a band says each total. A member\n        // without one would make any total a silent undercount — so none.\n        const quantities = g.members.flatMap((m): PlanQuantityValue[] => (m.quantity.type === \"some\" ? [m.quantity.value] : []));\n        const quantity = quantities.length === g.members.length ? totalsText(totalsByUnit(quantities), w) : undefined;\n        let state = g.members[0]!.state;\n        for (const m of g.members) {\n            if ((STATE_RANK[m.state.type] ?? 3) < (STATE_RANK[state.type] ?? 3)) state = m.state;\n        }\n        return { from: g.from, to: g.to, count, quantity, state };\n    });\n}\n\n/**\n * Derive a rollup parent's bands from its subtree's runs.\n *\n * @param runs - The subtree's runs\n * @param rollup - The declared mode\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @param w - The canvas's words — how a total prints (#820); English in `en-US` by default\n * @returns The bands, in start order\n */\nexport function deriveBands(\n    runs: readonly RunValue[],\n    rollup: \"union\" | \"byStatus\" | \"sum\",\n    ordinal?: ReadonlyMap<string, number>,\n    w: PlanWords = PLAN_WORDS,\n): DerivedBand[] {\n    if (rollup === \"byStatus\") {\n        const order: string[] = [];\n        const byTag = new Map<string, RunValue[]>();\n        for (const r of runs) {\n            if (r.state.type === \"rejected\") continue;\n            const tag = r.state.type;\n            const list = byTag.get(tag);\n            if (list !== undefined) list.push(r);\n            else { byTag.set(tag, [r]); order.push(tag); }\n        }\n        return order.flatMap((tag) => mergeBands(byTag.get(tag)!, ordinal, w));\n    }\n    return mergeBands(runs, ordinal, w);\n}\n\n/**\n * Derive per-bucket aggregated heat cells (mean / max / sum; no-data skipped),\n * each labelled with its value — through `format` when one is given, else the\n * canvas's plain number.\n *\n * @param cells - The children's cells — already folded to the period, so each\n *   child contributes at most one value per bucket\n * @param mode - The declared aggregate\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @param w - The canvas's words (#820); English in `en-US` by default\n * @param period - The canvas's period — cells group by the bucket that holds\n *   them; without one, by instant\n * @param format - How a derived value prints\n * @returns One cell per bucket, in axis order\n */\nexport function deriveHeatCells(\n    cells: readonly HeatCellValue[],\n    mode: \"mean\" | \"max\" | \"sum\",\n    ordinal?: ReadonlyMap<string, number>,\n    w: PlanWords = PLAN_WORDS,\n    period?: PlanPeriod,\n    format?: TickFormatOpt,\n): HeatCellValue[] {\n    // Derived cells are REAL East option values (`some`/`none` — never a\n    // hand-rolled `{ type, value }` literal, which lacks East's brand: East\n    // rejects it wherever it checks for a variant, and a test comparing whole\n    // values fails on it; #617).\n    return bucketGroups(cells, (c) => c.at, period, ordinal).map((g): HeatCellValue => {\n        const vals = g.members.flatMap((c) => (c.value.type === \"some\" ? [c.value.value] : []));\n        let v: number | undefined;\n        if (vals.length > 0) {\n            const total = vals.reduce((a, b) => a + b, 0);\n            v = mode === \"sum\" ? total : mode === \"max\" ? maxOf(vals) : total / vals.length;\n        }\n        return {\n            at: g.at,\n            value: v !== undefined ? some(v) : none,\n            label: v !== undefined ? some(w.value(v, format)) : none,\n        };\n    });\n}\n\n/**\n * Derive per-bucket table subtotal cells (the Table #317 vocabulary) — raw\n * values only; text and tone are renderer-derived through the row's shared\n * `TickFormatType` format.\n *\n * @remarks\n * A bucket none of the cells holds a value in has no subtotal, whatever the\n * mode (#1436): a `count` there is no value, never 0, as e3 keeps none.\n *\n * @param cells - The children's cells, already folded to the period\n * @param mode - The declared aggregate; `count` counts the values here, each a leaf's (a parent's `count` over rows of\n *   its own counts their leaves: {@link deriveTableSeries})\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @param period - The canvas's period — cells group by the bucket that holds them\n * @returns One cell per bucket, in axis order\n */\nexport function deriveTableCells(\n    cells: readonly TableCellValue[],\n    mode: \"sum\" | \"mean\" | \"min\" | \"max\" | \"count\",\n    ordinal?: ReadonlyMap<string, number>,\n    period?: PlanPeriod,\n): TableCellValue[] {\n    return bucketGroups(cells, (c) => c.at, period, ordinal).map((g): TableCellValue => {\n        const vals = g.members.flatMap((c) => (c.value.type === \"some\" ? [c.value.value] : []));\n        let v: number | undefined;\n        if (vals.length > 0) {\n            const total = vals.reduce((a, b) => a + b, 0);\n            v = mode === \"count\" ? vals.length\n                : mode === \"sum\" ? total\n                : mode === \"mean\" ? total / vals.length\n                : mode === \"min\" ? minOf(vals)\n                : maxOf(vals);\n        }\n        return {\n            at: g.at,\n            value: v !== undefined ? some(v) : none,\n            text: none,\n            tone: none,\n        };\n    });\n}\n\n/** A count in one bucket, at the instant the bucket's cell sits at (#1436). */\ninterface Tally {\n    readonly at: PlanInstantValue;\n    readonly n: number;\n}\n\n/**\n * One position of a table row as a parent above it reads it (#1436): what it\n * draws, and how many leaf rows beneath it draw a value in each bucket.\n *\n * @remarks\n * A `count` subtotal counts the leaf rows beneath that draw a value — a row\n * drawing its own values counts one, a parent its own count — whatever the\n * subtotals between them count by, as e3 keeps its `count` rollup (#1434):\n * `TableAggregateType`'s leaf rows beneath. So each position carries its\n * leaves beside its numbers.\n */\nexport interface TablePosition {\n    /** What the position draws: its own cells folded to the period, or its children's subtotal. */\n    readonly series: TableSeriesValue;\n    /** How many leaf rows beneath draw a value, bucket by bucket — one in each bucket a position of its own draws a value in. */\n    readonly leaves: readonly Tally[];\n}\n\n/** Each bucket's tallies added up. */\nfunction sumTallies(tallies: readonly Tally[], ordinal: ReadonlyMap<string, number> | undefined, period: PlanPeriod | undefined): Tally[] {\n    return bucketGroups(tallies, (l) => l.at, period, ordinal).map((g): Tally => {\n        let n = 0;\n        for (const m of g.members) n += m.n;\n        return { at: g.at, n };\n    });\n}\n\n/**\n * A position a row draws its own values in: one leaf in each bucket it draws\n * a value in.\n *\n * @param series - The position's own series, folded to the period\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @param period - The canvas's period\n * @returns The position\n */\nfunction ownPosition(series: TableSeriesValue, ordinal: ReadonlyMap<string, number> | undefined, period: PlanPeriod | undefined): TablePosition {\n    const leaves = bucketGroups(series.cells, (c) => c.at, period, ordinal)\n        .filter((g) => g.members.some((c) => c.value.type === \"some\"))\n        .map((g): Tally => ({ at: g.at, n: 1 }));\n    return { series, leaves };\n}\n\n/**\n * A `count` subtotal's cells (#1436): in each bucket its children draw a cell\n * in, the leaf rows beneath them that draw a value there; no value where none\n * does.\n *\n * @param positions - The children's positions at one place\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @param period - The canvas's period\n * @returns One cell per bucket, in axis order\n */\nfunction countCells(\n    positions: readonly TablePosition[],\n    ordinal: ReadonlyMap<string, number> | undefined,\n    period: PlanPeriod | undefined,\n): TableCellValue[] {\n    const marks: Tally[] = [];\n    for (const p of positions) {\n        for (const c of p.series.cells) marks.push({ at: c.at, n: 0 });\n        appendAll(marks, p.leaves);\n    }\n    return bucketGroups(marks, (m) => m.at, period, ordinal).map((g): TableCellValue => {\n        let n = 0;\n        for (const m of g.members) n += m.n;\n        return { at: g.at, value: n > 0 ? some(n) : none, text: none, tone: none };\n    });\n}\n\n/**\n * Derive a parent's subtotal SERIES — position by position.\n *\n * Position `i` of the parent aggregates position `i` of every child that has\n * one, and inherits that position's declarations (format / tone / strong /\n * rollup / fold) from the first child carrying it, so the subtotal is styled\n * like the numbers it totals rather than as anonymous plain text.\n *\n * @remarks\n * `sum`, `mean` (a mean of its children's, a child parent's own a mean),\n * `min` and `max` aggregate what each child draws. `count` is the leaf rows\n * beneath that draw a value in the bucket, at any depth: a child drawing its\n * own values counts one, a parent child its own leaves (#1436).\n *\n * @param positions - Each child's aggregable positions (see {@link tableRollupSeries}), folded\n * @param mode - The declared aggregate\n * @param ordinal - The ordinal axis's value → index map, when the axis is ordinal\n * @param period - The canvas's period\n * @returns One derived position per position, with the leaves beneath it\n */\nexport function deriveTableSeries(\n    positions: ReadonlyArray<readonly TablePosition[]>,\n    mode: \"sum\" | \"mean\" | \"min\" | \"max\" | \"count\",\n    ordinal?: ReadonlyMap<string, number>,\n    period?: PlanPeriod,\n): TablePosition[] {\n    const width = positions.reduce((m, p) => Math.max(m, p.length), 0);\n    const out: TablePosition[] = [];\n    for (let i = 0; i < width; i++) {\n        const at = positions.flatMap((p) => (p[i] !== undefined ? [p[i]!] : []));\n        if (at.length === 0) continue;\n        const style = at[0]!.series;\n        const cells = mode === \"count\"\n            ? countCells(at, ordinal, period)\n            : deriveTableCells(at.flatMap((p) => p.series.cells), mode, ordinal, period);\n        out.push({\n            series: { cells, format: style.format, tone: style.tone, strong: style.strong, rollup: style.rollup, fold: style.fold },\n            leaves: sumTallies(at.flatMap((p) => p.leaves), ordinal, period),\n        });\n    }\n    return out;\n}\n\n/** A heat scale as plain numbers — `undefined` where nothing is declared. */\nexport interface HeatScale {\n    min: number | undefined;\n    max: number | undefined;\n    warnAt: number | undefined;\n}\n\n/** A heat scale value as plain numbers. */\nfunction scaleNumbers(s: HeatScaleValue): HeatScale {\n    return { min: getSomeorUndefined(s.min), max: getSomeorUndefined(s.max), warnAt: getSomeorUndefined(s.warnAt) };\n}\n\n/** Plain numbers as a heat scale value — built with `some`/`none`, a real East value (#617). */\nfunction scaleValue(s: HeatScale | undefined): HeatScaleValue {\n    return {\n        min: s?.min !== undefined ? some(s.min) : none,\n        max: s?.max !== undefined ? some(s.max) : none,\n        warnAt: s?.warnAt !== undefined ? some(s.warnAt) : none,\n    };\n}\n\n/**\n * The scale derived cells INHERIT from the heat rows they summarise.\n *\n * A strip painted on its own extent puts the coolest bucket at zero depth —\n * a blank tile with a number floating in it — which reads as no data, not as\n * the minimum. A `mean` or `max` of rows declared on 0–100 is itself on\n * 0–100, so the derived cells take the members' scale: the widest declared\n * span (every member must declare the bound for it to hold), and the tightest\n * warn threshold. A `sum` outgrows its members' scale and keeps the extent.\n */\nfunction inheritedScale(arms: readonly HeatCellsValue[], mode: string): HeatScale | undefined {\n    if (mode === \"sum\") return undefined;\n    const scales = arms.flatMap((a) => (a.type === \"heat\" ? [scaleNumbers(a.value.scale)] : []));\n    if (scales.length === 0) return undefined;\n    const mins = scales.map((s) => s.min);\n    const maxs = scales.map((s) => s.max);\n    const warns = scales.map((s) => s.warnAt).filter((w): w is number => w !== undefined);\n    const min = mins.every((m): m is number => m !== undefined) ? minOf(mins) : undefined;\n    const max = maxs.every((m): m is number => m !== undefined) ? maxOf(maxs) : undefined;\n    const warnAt = warns.length > 0 ? minOf(warns) : undefined;\n    if (min === undefined && max === undefined && warnAt === undefined) return undefined;\n    return { min, max, warnAt };\n}\n\n/** The first format a heat arm among `arms` declares — what cells derived from them print through. */\nfunction inheritedFormat(arms: readonly HeatCellsValue[]): HeatCellsValue[\"value\"][\"format\"] {\n    for (const a of arms) if (a.value.format.type === \"some\") return a.value.format;\n    return none;\n}\n\n/** Every span run across a subtree (any depth), skipping the runs of\n *  diagnostic rows — a row that cannot be placed rolls up nothing (#811). */\nfunction subtreeRuns(index: PlanRowIndex, key: RowKey, diagnosed: ReadonlyMap<RowKey, PlanRowDiagnostic>): RunValue[] {\n    const out: RunValue[] = [];\n    const walk = (k: RowKey) => {\n        for (const child of index.children.get(k) ?? []) {\n            if (child.kind.type === \"span\" && !diagnosed.has(child.key)) appendAll(out, child.kind.value.runs);\n            walk(child.key);\n        }\n    };\n    walk(key);\n    return out;\n}\n\n/**\n * Why a row cannot be drawn where it is (#811) — it renders in place as a\n * diagnostic row carrying this, and derives nothing.\n *\n * - `axis` — the row's instants ride another arm than the axis speaks:\n *   `found` is the arm they ride (the first one found), `expected` the axis's.\n * - `duplicate` — the row repeats an id an earlier row carries (#822): `of` is\n *   that row's key. Ids are unique by construction except where hand-built rows\n *   repeat a key, and a repeat is shown, never dropped.\n */\nexport type PlanRowDiagnostic =\n    | { kind: \"axis\"; found: PlanAxisKind; expected: PlanAxisKind }\n    | { kind: \"duplicate\"; of: RowKey };\n\n/** The positions a parent subtotals of a list — {@link tableRollupSeries}' rule, over a row's drawn positions. */\nfunction rollupPositions(positions: readonly TablePosition[]): readonly TablePosition[] {\n    const flagged = positions.filter((p) => p.series.rollup);\n    return flagged.length > 0 ? flagged : positions;\n}\n\n/**\n * One bucket's subtotal of a parent, as e3 keeps it (#1438): the instant its\n * bucket starts at, and the value.\n */\nexport interface PlanParentSubtotal {\n    readonly at: PlanInstantValue;\n    readonly value: number;\n}\n\n/**\n * Each parent's subtotals as e3 keeps them, by the row's key (#1438): what a\n * Plan over paged rows read beside their nested series index reads for a\n * parent, at the period's buckets — one series a collection its children\n * read, in the order they read them: a heat parent's and a group's strip\n * aggregated as declared, a table parent's one a position. A parent given\n * them draws them in place of deriving them from its children, which a window\n * holds folded, off screen or not at all — and never folds them again, each\n * being one bucket's already.\n */\nexport type PlanParentSubtotals = ReadonlyMap<RowKey, readonly (readonly PlanParentSubtotal[])[]>;\n\n/** A parent's subtotals as cells its heat derivation takes, one a bucket a collection (#1438). */\nfunction givenHeatCells(given: readonly (readonly PlanParentSubtotal[])[]): HeatCellValue[] {\n    return given.flatMap((subtotals) => subtotals.map((s): HeatCellValue => ({ at: s.at, value: some(s.value), label: none })));\n}\n\n/**\n * A table parent's positions with its subtotals in place (#1438): each\n * position given one draws it, styled as its children's subtotal would be —\n * or, where nothing beneath it was read, as the parent declares the position\n * — and carries the leaves its children's do.\n */\nfunction withGivenPositions(positions: readonly TablePosition[], given: readonly (readonly PlanParentSubtotal[])[] | undefined,\n    declared: readonly TableSeriesValue[], children: readonly PlanRowValue[]): TablePosition[] {\n    if (given === undefined) return [...positions];\n    const out: TablePosition[] = [];\n    for (let i = 0; i < Math.max(positions.length, given.length); i++) {\n        const p = positions[i];\n        const subtotals = given[i];\n        // Styled as its children's position is: derived from them, declared by the parent, or — the children holding no\n        // value in the window, a lean row's empty — as the first table child declares it.\n        const style = p?.series ?? declared[i] ?? childPositionStyle(children, i);\n        if (subtotals === undefined || style === undefined) {\n            if (p !== undefined) out.push(p);\n            continue;\n        }\n        out.push({ series: { ...style, cells: subtotals.map((s): TableCellValue => ({ at: s.at, value: some(s.value), text: none, tone: none })) }, leaves: p?.leaves ?? [] });\n    }\n    return out;\n}\n\n/** A position's style as the first table child of a parent declares it, its cells none (#1438). */\nfunction childPositionStyle(children: readonly PlanRowValue[], i: number): TableSeriesValue | undefined {\n    for (const child of children) {\n        if (child.kind.type !== \"table\") continue;\n        const style = child.kind.value.series[i];\n        if (style !== undefined) return { ...style, cells: [] };\n    }\n    return undefined;\n}\n\n/**\n * The per-value derived numbers, computed once per decoded root and period.\n *\n * Each `…` map says what a row DRAWS where that is not its own declaration —\n * a parent's derived values, or its own folded to the period (#824). A row\n * absent from a map draws what it declares, as it is.\n */\nexport interface PlanDerived {\n    /** Rollup bands by span-parent row key. */\n    bands: ReadonlyMap<RowKey, DerivedBand[]>;\n    /** The heat arm each heat row draws: a declared-aggregate parent's derived\n     *  cells — on its declared scale, else the one its members share — or a\n     *  row's own cells folded to the period. */\n    heatArms: ReadonlyMap<RowKey, HeatCellsValue>;\n    /** The value series each table row draws: a parent's subtotal positions —\n     *  the same shape its members have — or a row's own series folded. */\n    tableSeries: ReadonlyMap<RowKey, TableSeriesValue[]>;\n    /** The chart each chart row draws — its line, area and column layers folded. */\n    charts: ReadonlyMap<RowKey, ChartKindValue>;\n    /** The strip each group band draws collapsed: its declared aggregate over\n     *  its members' drawn heat cells (on the scale they share), or its declared\n     *  cells folded. Absent for a plain band, or declared cells as they are. */\n    groupStrips: ReadonlyMap<RowKey, HeatCellsValue>;\n    /** Direct-member count by group row key — the `\"8 rows\"` gutter meta.\n     *  Derived here like every other aggregate: the IR declares no count, so\n     *  the meta is always the members the group has (#568). */\n    groupMembers: ReadonlyMap<RowKey, number>;\n    /** The rows that render as diagnostic rows, by key (#811) — excluded\n     *  from every band, aggregate, subtotal and strip above. */\n    diagnostics: ReadonlyMap<RowKey, PlanRowDiagnostic>;\n}\n\n/**\n * Derive every declared rollup / aggregate / summary / fold over the decoded\n * rows.\n *\n * @remarks\n * The walk is an explicit POST-ORDER traversal from the roots: a declared\n * parent whose children are themselves declared parents aggregates their\n * DERIVED cells, so nesting composes to arbitrary depth — and it is correct\n * for ANY container order. The stream puts a parent before its subtree, but\n * not always right before it (#822: an entry's children follow all of its\n * `views` rows), so nothing here reads position. (It once walked the flat\n * array in reverse, which was only right while that array happened to be\n * depth-first; feeding a bottom-up aggregation the wrong order yields wrong\n * numbers, not an error — #568.)\n *\n * Each row's values fold to the period FIRST (#824), so a parent aggregates\n * what its children draw.\n *\n * Rows outside the tree — a `parent` naming a key that does not exist — are\n * unreachable from the roots and derive nothing, exactly as they render\n * nothing (`visibleRows` walks the same tree).\n *\n * With the axis kind given, a row whose instants ride another arm is a\n * DIAGNOSTIC row (#811): it is recorded in `diagnostics`, derives nothing of\n * its own, and contributes nothing to any parent's band, aggregate, subtotal\n * or strip — it still counts as a member, since it still renders.\n *\n * @param index - The row-tree index\n * @param ordinal - The ordinal axis's value → index map (orders ordinal cells; omit on other axes)\n * @param axisKind - The axis kind; omit to diagnose nothing\n * @param w - The canvas's words — how a derived number prints (#820); English in\n *   `en-US` by default (a height measure prints nothing it reads)\n * @param period - The canvas's period (`PlanScale.period`); omit to fold nothing\n * @param parents - Each parent's subtotals as e3 keeps them, by its key (#1438): a parent given them — a heat parent, a\n *   group's strip, a table parent's positions — draws them in place of its children's; omit to derive every parent\n *   from its children\n * @returns Every derived number, keyed by row\n */\nexport function derivePlan(\n    index: PlanRowIndex,\n    ordinal?: ReadonlyMap<string, number>,\n    axisKind?: PlanAxisKind,\n    w: PlanWords = PLAN_WORDS,\n    period?: PlanPeriod,\n    parents?: PlanParentSubtotals,\n): PlanDerived {\n    const bands = new Map<RowKey, DerivedBand[]>();\n    const heatArms = new Map<RowKey, HeatCellsValue>();\n    const tableSeries = new Map<RowKey, TableSeriesValue[]>();\n    const charts = new Map<RowKey, ChartKindValue>();\n    const groupStrips = new Map<RowKey, HeatCellsValue>();\n    const groupMembers = new Map<RowKey, number>();\n    const diagnostics = new Map<RowKey, PlanRowDiagnostic>();\n    if (axisKind !== undefined) {\n        for (const m of axisKindMismatches(index, axisKind)) {\n            diagnostics.set(m.row, { kind: \"axis\", found: m.found, expected: axisKind });\n        }\n    }\n    // A repeated id (#822) — the row keeps a key of its own and says so.\n    for (const row of index.rows) {\n        if (row.duplicateOf !== undefined) diagnostics.set(row.key, { kind: \"duplicate\", of: row.duplicateOf });\n    }\n    const placeable = (row: PlanRowValue): boolean => !diagnostics.has(row.key);\n    // What a heat row draws — its derived or folded arm, else its own. The\n    // walk is bottom-up, so a child's entry is in the map before its parent\n    // reads it. A diagnostic row draws none.\n    const drawnHeatArm = (row: PlanRowValue): HeatCellsValue | undefined => {\n        if (row.kind.type !== \"heat\" || !placeable(row)) return undefined;\n        return heatArms.get(row.key) ?? row.kind.value.cells;\n    };\n    const drawnHeatCells = (row: PlanRowValue): readonly HeatCellValue[] => {\n        const arm = drawnHeatArm(row);\n        return arm !== undefined && arm.type === \"heat\" ? arm.value.cells : [];\n    };\n    const drawnHeatArms = (rows: readonly PlanRowValue[]): HeatCellsValue[] =>\n        rows.flatMap((r) => {\n            const arm = drawnHeatArm(r);\n            return arm !== undefined ? [arm] : [];\n        });\n    // A table row's aggregable positions as it draws them, each with the\n    // leaves beneath it (#1436). The walk is bottom-up, so a child's are in\n    // the map before its parent reads them.\n    const tablePositions = new Map<RowKey, readonly TablePosition[]>();\n    const aggregableOf = (row: PlanRowValue): readonly TablePosition[] =>\n        row.kind.type === \"table\" && placeable(row) ? tablePositions.get(row.key) ?? [] : [];\n    const visit = (row: PlanRowValue): void => {\n        const children = index.children.get(row.key) ?? [];\n        // Descendants first — a declared parent reads its children's DERIVED\n        // cells, which must already be in the maps.\n        for (const child of children) visit(child);\n        const kind = row.kind;\n        if (kind.type === \"group\") groupMembers.set(row.key, children.length);\n        // A diagnostic row draws its message, not its marks — nothing of its\n        // own to derive.\n        if (!placeable(row)) return;\n        switch (kind.type) {\n            case \"span\":\n                if (kind.value.rollup.type === \"some\") {\n                    const runs = [...kind.value.runs, ...subtreeRuns(index, row.key, diagnostics)];\n                    bands.set(row.key, deriveBands(runs, kind.value.rollup.value.type, ordinal, w));\n                }\n                return;\n            case \"heat\": {\n                const own = kind.value.cells;\n                const ownCells = own.type === \"heat\" ? own.value.cells : [];\n                if (kind.value.aggregate.type === \"some\" && ownCells.length === 0 && children.length > 0) {\n                    const mode = kind.value.aggregate.value.type;\n                    const arms = drawnHeatArms(children);\n                    const format = own.type === \"heat\" && own.value.format.type === \"some\" ? own.value.format : inheritedFormat(arms);\n                    // Its subtotals as e3 keeps them where it is given them (#1438), never its children's cells.\n                    const given = parents?.get(row.key);\n                    const from = given !== undefined ? givenHeatCells(given) : children.flatMap(drawnHeatCells);\n                    const cells = deriveHeatCells(from, mode, ordinal, w, period, getSomeorUndefined(format));\n                    // The parent's declared scale, else the one its members share (#824).\n                    const scale = kind.value.scale.type === \"some\" ? kind.value.scale.value : scaleValue(inheritedScale(arms, mode));\n                    heatArms.set(row.key, variant(\"heat\", {\n                        cells, scale, fold: own.type === \"heat\" ? own.value.fold : variant(\"mean\", null), format,\n                    }));\n                    return;\n                }\n                const folded = foldHeatArm(own, period, ordinal, w);\n                if (!Object.is(folded, own)) heatArms.set(row.key, folded);\n                return;\n            }\n            case \"table\": {\n                const declared = kind.value.series;\n                const folded = foldTableSeries(declared, period, ordinal);\n                // Each position's subtotals as e3 keeps them where it is given them (#1438), styled as its children's.\n                const given = parents?.get(row.key);\n                const derived = kind.value.aggregate.type === \"some\" && (children.length > 0 || given !== undefined)\n                    ? withGivenPositions(deriveTableSeries(\n                        children.map(aggregableOf).filter((p) => p.length > 0), kind.value.aggregate.value.type, ordinal, period),\n                    given, declared, children)\n                    : [];\n                const own = folded.map((s) => ownPosition(s, ordinal, period));\n                if (!declared.some((s) => s.cells.length > 0)) {\n                    // A parent with no values of its own — a series parent\n                    // declares its positions with empty cells — shows its\n                    // children's subtotals.\n                    if (derived.length > 0) {\n                        tableSeries.set(row.key, derived.map((p) => p.series));\n                        tablePositions.set(row.key, derived);\n                    } else {\n                        if (!Object.is(folded, declared)) tableSeries.set(row.key, folded);\n                    }\n                    return;\n                }\n                // Each position draws its own values where it holds any, and\n                // its children's subtotal where it holds none — decided per\n                // position, each one collection, never by the row's other\n                // positions (#1436). A position the parent subtotals takes its\n                // place among them, as its children's are subtotalled.\n                const flagged = declared.some((s) => s.rollup);\n                let k = 0;\n                let moved = !Object.is(folded, declared);\n                const drawn = own.map((p, i): TablePosition => {\n                    if (flagged && !declared[i]!.rollup) return p;\n                    const sub = derived[k++];\n                    if (declared[i]!.cells.length > 0 || sub === undefined) return p;\n                    moved = true;\n                    return { series: { ...p.series, cells: sub.series.cells }, leaves: sub.leaves };\n                });\n                if (moved) tableSeries.set(row.key, drawn.map((p) => p.series));\n                tablePositions.set(row.key, rollupPositions(drawn));\n                return;\n            }\n            case \"chart\": {\n                const layers = foldChartLayers(kind.value.layers, period, ordinal);\n                if (!Object.is(layers, kind.value.layers)) charts.set(row.key, { ...kind.value, layers });\n                return;\n            }\n            case \"group\": {\n                const summary = kind.value.summary;\n                if (summary.type === \"aggregate\") {\n                    const mode = summary.value.type;\n                    const members = children.filter(placeable);\n                    const arms = drawnHeatArms(members);\n                    const format = inheritedFormat(arms);\n                    // Its subtotals as e3 keeps them where it is given them (#1438), never its members' cells.\n                    const given = parents?.get(row.key);\n                    groupStrips.set(row.key, variant(\"heat\", {\n                        cells: deriveHeatCells(given !== undefined ? givenHeatCells(given) : children.flatMap(drawnHeatCells),\n                            mode, ordinal, w, period, getSomeorUndefined(format)),\n                        scale: scaleValue(inheritedScale(arms, mode)),\n                        fold: variant(\"mean\", null),\n                        format,\n                    }));\n                } else if (summary.type === \"cells\") {\n                    const folded = foldHeatArm(summary.value, period, ordinal, w);\n                    if (!Object.is(folded, summary.value)) groupStrips.set(row.key, folded);\n                }\n                return;\n            }\n            case \"buckets\": case \"cards\": case \"events\":\n                return;\n        }\n    };\n    for (const root of index.roots) visit(root);\n    return { bands, heatArms, tableSeries, charts, groupStrips, groupMembers, diagnostics };\n}\n\n// ── Keeping identities across re-derivations (#815) ────────────────────────\n\nconst instantEqual = equalFor(Plan.Types.Instant);\nconst runStateEqual = equalFor(Plan.Types.Run.fields.state);\nconst heatArmEqual = equalFor(Plan.Types.HeatCells);\nconst tableSeriesEqual = equalFor(ArrayType(Plan.Types.TableSeries));\nconst chartKindEqual = equalFor(Plan.Types.RowKind.cases.chart);\n\nfunction sameBands(a: readonly DerivedBand[], b: readonly DerivedBand[]): boolean {\n    return a.length === b.length && a.every((x, i) => {\n        const y = b[i]!;\n        return x.count === y.count && x.quantity === y.quantity && instantEqual(x.from, y.from)\n            && instantEqual(x.to, y.to) && runStateEqual(x.state, y.state);\n    });\n}\n\nfunction sameDiagnostic(a: PlanRowDiagnostic, b: PlanRowDiagnostic): boolean {\n    if (a.kind === \"axis\" && b.kind === \"axis\") return a.found === b.found && a.expected === b.expected;\n    if (a.kind === \"duplicate\" && b.kind === \"duplicate\") return a.of === b.of;\n    return false;\n}\n\n/** `next`, with each entry `prev` already held for the same key reused when equal. */\nfunction keptEntries<V>(\n    prev: ReadonlyMap<RowKey, V>,\n    next: ReadonlyMap<RowKey, V>,\n    same: (a: V, b: V) => boolean,\n): ReadonlyMap<RowKey, V> {\n    if (prev === next) return next;\n    let kept = 0;\n    const out = new Map<RowKey, V>();\n    for (const [key, value] of next) {\n        const old = prev.get(key);\n        if (old !== undefined && (old === value || same(old, value))) {\n            out.set(key, old);\n            kept += 1;\n        } else {\n            out.set(key, value);\n        }\n    }\n    // Every entry carried over and nothing added or dropped: the old map\n    // itself says the same thing.\n    return kept === next.size && prev.size === next.size ? prev : out;\n}\n\n/**\n * A re-derivation with each row's entries kept by IDENTITY where their\n * content did not move.\n *\n * @remarks\n * {@link derivePlan} rebuilds every map from scratch — on a data change, on\n * every paged window landing, since a landing re-indexes the resident rows,\n * and on a resolution change, which re-folds. A row reads only its own\n * entries, so a row memo can skip exactly when those entries are the objects\n * it rendered with. This hands back the old object wherever the new one says\n * the same thing, which is what lets a landing render the rows whose numbers\n * it moved and none of the others.\n *\n * @param prev - The previous derivation, if any\n * @param next - The new derivation\n * @returns `next`, its unchanged entries replaced by `prev`'s\n */\nexport function stableDerived(prev: PlanDerived | undefined, next: PlanDerived): PlanDerived {\n    if (prev === undefined || prev === next) return next;\n    return {\n        bands: keptEntries(prev.bands, next.bands, sameBands),\n        heatArms: keptEntries(prev.heatArms, next.heatArms, heatArmEqual),\n        tableSeries: keptEntries(prev.tableSeries, next.tableSeries, tableSeriesEqual),\n        charts: keptEntries(prev.charts, next.charts, chartKindEqual),\n        groupStrips: keptEntries(prev.groupStrips, next.groupStrips, heatArmEqual),\n        groupMembers: next.groupMembers,\n        diagnostics: keptEntries(prev.diagnostics, next.diagnostics, sameDiagnostic),\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The canvas body's items and the link graph they are gathered by (split out\n * of `model.ts`, #815): the R1 family closure and the gap bands that elide a\n * links focus, the unloaded bands of a paged source (#577), the error bands of\n * failed windows (#811), and each item's identity (#812).\n *\n * @packageDocumentation\n */\n\nimport type { PlanFocusCtx, PlanLinkValue, PlanRowIndex, VisibleRow } from \"./model.js\";\nimport type { RowKey } from \"./plan-state.js\";\nimport type { PlanRowDiagnostic } from \"./derive.js\";\nimport { ancestorsOf } from \"./row-tree.js\";\nimport { rowKeyOf } from \"./row-key.js\";\n\n// ── The R1 link graph (renderer-derived over the decoded `links` edges) ─────\n\n/** Every row key any link edge touches — the rows that grow the `links` control.\n *  A link names its ends by run ref (#824), each carrying its row's id (#822);\n *  the graph keys by the ids' text. */\nexport function linkedRowKeys(links: readonly PlanLinkValue[]): ReadonlySet<RowKey> {\n    const out = new Set<RowKey>();\n    for (const l of links) { out.add(rowKeyOf(l.from.row)); out.add(rowKeyOf(l.to.row)); }\n    return out;\n}\n\n/** One elided run in a links focus — replaces N consecutive unrelated rows. */\nexport interface FocusGap {\n    /** Stable key (the first elided row's key). */\n    key: string;\n    /** The first elided row — where keyboard focus lands when the gap is\n     *  opened and its rows come back (#819). */\n    first: RowKey;\n    /** Data rows hidden inside the run (collapsed subtrees counted through). */\n    rows: number;\n    /** Group bands hidden inside the run. */\n    groups: number;\n    /** Pessimistic status tone across the hidden rows (undefined ⇒ quiet). */\n    tone: string | undefined;\n}\n\n/**\n * A run of source elements that is NOT resident (#577), rendered as one band.\n *\n * Its height comes from the window ledger, so the band and the rows that\n * replace it occupy exactly the same space — scrolling in loads content without\n * moving anything below it, and eviction puts the band back with nothing\n * shifting either. Each paged block has its own (#823): its rows' share of the\n * elements the band covers.\n */\nexport interface PlanBand {\n    /** The block the band belongs to (#823). */\n    block: number;\n    at: \"head\" | \"tail\";\n    /** First source element the band covers. */\n    from: number;\n    /** Last source element the band covers (inclusive). */\n    to: number;\n    /** The band's pixel height. */\n    px: number;\n    /** Which of its elements are loading (#1082): from the first element of\n     *  the first window it covers that is in flight to the last element of\n     *  the last (inclusive), when any is. A band far from every window in\n     *  flight is loading nothing — it says how many elements it holds. */\n    loading?: { from: number; to: number } | undefined;\n}\n\n/**\n * A resident window whose read FAILED (#811) — one error band where the\n * window's rows would be, carrying the reason and a Retry.\n *\n * The failure belongs to its window: every other window keeps landing and\n * rendering around it. One read serves every block (#823), so a failed window\n * is a band in each block that holds it.\n */\nexport interface PlanWindowFailure {\n    /** The block the band stands in (#823). */\n    block: number;\n    /** The window index. */\n    w: number;\n    /** First source element the window covers. */\n    from: number;\n    /** Last source element the window covers (inclusive). */\n    to: number;\n    /** The band's pixel height — the window's ledger slot, floored so the\n     *  reason and the Retry stay legible in a short last window. */\n    px: number;\n    /** Why the read failed. */\n    error: string;\n}\n\n/** One line of the canvas body: a row, the R2 developer render, an elided run\n *  (R1), an unloaded run of the source (#577, one per paged block's end —\n *  #823), or a window whose read failed (#811).\n *\n *  The R2 developer render is NOT an item here — it renders inside the\n *  focused row, which grows to hold it (see {@link PlanFocusCtx.renderPx}).\n *  Expand focus still stays inside the virtualizer either way; putting the\n *  render in the row is what lets the GUTTER grow with it. */\nexport type PlanBodyItem =\n    | { kind: \"row\"; row: VisibleRow }\n    | { kind: \"gap\"; gap: FocusGap }\n    | { kind: \"band\"; band: PlanBand }\n    | { kind: \"failed\"; failure: PlanWindowFailure };\n\n/**\n * A body item's identity (#812) — its row's key, its gap's first row, its\n * band's block and end, its failed window's block and window — prefixed by\n * kind, so no two items of a body share one. The virtualizer keys rows by it,\n * so a row keeps its component instance when a collapse, a focus or a landing\n * window moves it; keyed by index, the instance at a moved row's old index was\n * handed whichever row now sat there.\n *\n * @param item - The body item\n * @returns Its key, unique within one body\n */\nexport function bodyItemKey(item: PlanBodyItem): string {\n    switch (item.kind) {\n        case \"row\": return rowItemKey(item.row.row.key);\n        case \"gap\": return `g:${item.gap.key}`;\n        case \"band\": return `b:${item.band.block}:${item.band.at}`;\n        case \"failed\": return `f:${item.failure.block}:${item.failure.w}`;\n    }\n}\n\n/**\n * A ROW's item key — what {@link bodyItemKey} gives its body item, and a\n * pinned row (which the body does not hold) goes by too (#819).\n *\n * @param key - The row key\n * @returns Its item key\n */\nexport function rowItemKey(key: RowKey): string {\n    return `r:${key}`;\n}\n\n/**\n * Place each failed window's band where its rows would be (#811): after the\n * last row that came from an EARLIER window, or first when none did.\n *\n * @remarks\n * A block's windows serve its entries in key order and its rows concatenate\n * them in window order (#823), so a window's rows sit between its neighbours'\n * — its band goes in the seam. Called once per block, over that block's items.\n *\n * @param items - One block's body items, rows in visible order\n * @param failures - That block's failed windows\n * @param windowOf - Which window a resident row came from\n * @returns The items with a `failed` band placed per failure (the same array\n *   when there are none)\n */\nexport function placeFailures(\n    items: readonly PlanBodyItem[],\n    failures: readonly PlanWindowFailure[],\n    windowOf: (key: RowKey) => number | undefined,\n): readonly PlanBodyItem[] {\n    if (failures.length === 0) return items;\n    // Item index a failure's band goes AFTER (−1: before every item).\n    const after = new Map<number, PlanWindowFailure[]>();\n    for (const f of [...failures].sort((a, b) => a.w - b.w)) {\n        let at = -1;\n        items.forEach((it, i) => {\n            if (it.kind !== \"row\") return;\n            const w = windowOf(it.row.row.key);\n            if (w !== undefined && w < f.w) at = i;\n        });\n        const list = after.get(at);\n        if (list !== undefined) list.push(f);\n        else after.set(at, [f]);\n    }\n    const out: PlanBodyItem[] = [];\n    for (const f of after.get(-1) ?? []) out.push({ kind: \"failed\", failure: f });\n    items.forEach((it, i) => {\n        out.push(it);\n        for (const f of after.get(i) ?? []) out.push({ kind: \"failed\", failure: f });\n    });\n    return out;\n}\n\n/**\n * The body item the diagnostics chip seeks to (#811): the first diagnostic\n * row in body order — or, when a collapsed group hides it, that group's band.\n *\n * @param items - The body items, in order\n * @param index - The row-tree index\n * @param diagnostics - The diagnostic rows (`PlanDerived.diagnostics`)\n * @returns The item index, or `undefined` when no diagnostic row is reachable\n */\nexport function firstDiagnosticItem(\n    items: readonly PlanBodyItem[],\n    index: PlanRowIndex,\n    diagnostics: ReadonlyMap<RowKey, PlanRowDiagnostic>,\n): number | undefined {\n    if (diagnostics.size === 0) return undefined;\n    const holders = ancestorsOf(index, new Set(diagnostics.keys()));\n    for (let i = 0; i < items.length; i++) {\n        const it = items[i]!;\n        if (it.kind !== \"row\") continue;\n        const key = it.row.row.key;\n        if (diagnostics.has(key) || (it.row.collapsed && holders.has(key))) return i;\n    }\n    return undefined;\n}\n\n/** Status severity rank — higher is worse; gaps wear the worst hidden tone. */\nconst TONE_RANK: Record<string, number> = { info: 1, neutral: 1, success: 0, warning: 2, danger: 3 };\n\n/**\n * Elide a links-focus row list for scale (R1): family rows and the focus keep\n * full height; a group keeps its wayfinding band ONLY while its subtree holds\n * family; every other row is elidable. A lone elidable data row stays an 11px\n * rail (today's rhythm); any longer run — including family-less group bands\n * and their subtrees — coalesces into ONE double-height gap band, so a\n * thousand-tank canvas gathers to family + a handful of bands.\n */\nexport function elideForFocus(\n    vis: ReadonlyArray<VisibleRow>,\n    index: PlanRowIndex,\n    focus: PlanFocusCtx,\n): PlanBodyItem[] {\n    const kept = (key: RowKey): boolean => key === focus.key || (focus.family?.has(key) ?? false);\n    // \"Does this group's subtree hold family?\" precomputed as the kept keys'\n    // ancestor set — O(family × depth), not a per-row downward recursion\n    // (#616; the same fix as `visibleRows`' reveal test).\n    const keptAncestors = ancestorsOf(index, new Set([focus.key, ...(focus.family ?? [])]));\n    const subtreeHasFamily = (key: RowKey): boolean => keptAncestors.has(key);\n    const subtreeDataRows = (key: RowKey): number =>\n        (index.children.get(key) ?? []).reduce(\n            (n, c) => n + (c.kind.type === \"group\" ? 0 : 1) + subtreeDataRows(c.key), 0);\n    const worse = (a: string | undefined, b: string | undefined): string | undefined =>\n        b === undefined ? a : a === undefined || (TONE_RANK[b] ?? 0) > (TONE_RANK[a] ?? 0) ? b : a;\n\n    const out: PlanBodyItem[] = [];\n    let run: VisibleRow[] = [];\n    const flush = () => {\n        if (run.length === 0) return;\n        if (run.length === 1 && run[0]!.row.kind.type !== \"group\") {\n            out.push({ kind: \"row\", row: run[0]! });\n        } else {\n            const gap: FocusGap = { key: `gap-${run[0]!.row.key}`, first: run[0]!.row.key, rows: 0, groups: 0, tone: undefined };\n            for (const v of run) {\n                if (v.row.kind.type === \"group\") {\n                    gap.groups += 1;\n                    // A collapsed elided group hides its whole subtree —\n                    // count those rows through, they're part of the gap.\n                    if (v.collapsed) gap.rows += subtreeDataRows(v.row.key);\n                } else {\n                    gap.rows += 1;\n                }\n                gap.tone = worse(gap.tone, v.row.status.type === \"some\" ? v.row.status.value.type : undefined);\n            }\n            out.push({ kind: \"gap\", gap });\n        }\n        run = [];\n    };\n    for (const v of vis) {\n        const isGroup = v.row.kind.type === \"group\";\n        const keep = kept(v.row.key) || (isGroup && subtreeHasFamily(v.row.key));\n        if (keep) {\n            flush();\n            out.push({ kind: \"row\", row: v });\n        } else {\n            run.push(v);\n        }\n    }\n    flush();\n    return out;\n}\n\n/** A focused row's transitive family over the link graph. */\nexport interface LinkFamily {\n    /** Rows reaching the focus via edges (any depth). */\n    upstream: ReadonlySet<RowKey>;\n    /** Rows reachable from the focus via edges (any depth). */\n    downstream: ReadonlySet<RowKey>;\n    /** Union of both (the full-height set, focus excluded). */\n    all: ReadonlySet<RowKey>;\n}\n\n/**\n * Derive the focused row's transitive upstream + downstream family — the\n * links-focus gather set (R1). Any depth, wherever the rows live; a row\n * reachable both ways lands in both sets (rendered as the `LINKED` tag).\n */\nexport function deriveLinkFamily(links: readonly PlanLinkValue[], key: RowKey): LinkFamily {\n    const fwd = new Map<RowKey, RowKey[]>();\n    const rev = new Map<RowKey, RowKey[]>();\n    for (const l of links) {\n        const from = rowKeyOf(l.from.row);\n        const to = rowKeyOf(l.to.row);\n        (fwd.get(from) ?? fwd.set(from, []).get(from)!).push(to);\n        (rev.get(to) ?? rev.set(to, []).get(to)!).push(from);\n    }\n    const walk = (edges: ReadonlyMap<RowKey, RowKey[]>): Set<RowKey> => {\n        const seen = new Set<RowKey>();\n        const queue = [key];\n        while (queue.length > 0) {\n            const k = queue.pop()!;\n            for (const next of edges.get(k) ?? []) {\n                if (next === key || seen.has(next)) continue;\n                seen.add(next);\n                queue.push(next);\n            }\n        }\n        return seen;\n    };\n    const downstream = walk(fwd);\n    const upstream = walk(rev);\n    return { upstream, downstream, all: new Set([...upstream, ...downstream]) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's decoded-value view model (`Plan Spec.md` §6.2) — pure selectors\n * over the canvas rows: the row-tree index, the visible-row derivation (grain\n * × collapsed subtrees), and per-row height estimation for the virtualizer. No\n * React, no DOM.\n *\n * Rows arrive as BLOCKS (#823) — the series list's blocks in layout order, each\n * an ordered stream (#822) whose order IS the render order, each parent before\n * its descendants — and the canvas draws the blocks one after another. A row\n * carries a typed id and the block it came from; {@link toCanvasRows} keys\n * every row by its id's canonical text, which is what every map, DOM attribute\n * and piece of view state here keys by. The visible walk follows the STREAM and\n * hides by the explicit `parent` keys — never a tree walk, because a parent's\n * descendants need not follow it directly (an entry's children under `views`\n * come after all of its view rows). The derivations still walk the tree, since\n * a bottom-up aggregate is the same in any order.\n *\n * A row's height is a function of facts read off the row once\n * ({@link heightFactsOf}) and of the UI state ({@link factsHeight}); a paged\n * window keeps those facts, and nothing else, after its rows are evicted\n * ({@link windowSkeleton}), so the bands that stand for evicted windows follow\n * a collapse, a chart toggle or the grain exactly (#823).\n *\n * The derivations (`derive.ts`), the body items and link graph\n * (`body-items.ts`), the instant walks (`row-instants.ts`) and the tree walks\n * (`row-tree.ts`) live beside it and are re-exported here (#815).\n *\n * @packageDocumentation\n */\n\nimport { none, some, type OptionType, type StringType, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport type { PlanGrain, PlanUiState, RowKey } from \"./plan-state.js\";\nimport type { PlanAxisKind } from \"./instant.js\";\nimport { ancestorsOf } from \"./row-tree.js\";\nimport { rowKeyOf } from \"./row-key.js\";\nimport { derivePlan, type PlanDerived } from \"./derive.js\";\nimport { PLAN_GEOMETRY, planGeometry } from \"./geometry.js\";\nimport { appendAll } from \"./reductions.js\";\n\n// The model's other halves, one import path for all of it (#815).\nexport { forEachInstant, axisKindMismatches, type PlanAxisMismatch } from \"./row-instants.js\";\nexport {\n    tableRollupSeries, deriveBands, deriveHeatCells, deriveTableCells, deriveTableSeries, derivePlan, stableDerived,\n    type DerivedBand, type HeatScale, type PlanRowDiagnostic, type PlanDerived, type PlanParentSubtotal, type PlanParentSubtotals,\n} from \"./derive.js\";\nexport {\n    linkedRowKeys, bodyItemKey, rowItemKey, placeFailures, firstDiagnosticItem, elideForFocus, deriveLinkFamily,\n    type FocusGap, type PlanBand, type PlanWindowFailure, type PlanBodyItem, type LinkFamily,\n} from \"./body-items.js\";\n\n/** The decoded Plan root value. */\nexport type PlanRootValue = ValueTypeOf<typeof Plan.Types.Root>;\n/** One decoded WIRE row — the IR's `PlanRowType` value, as the source serves it. */\nexport type PlanWireRow = ValueTypeOf<typeof Plan.Types.Row>;\n/** One decoded WIRE block — the IR's `PlanBlockType` value (#823): a data\n *  series' rows, which a paged canvas pages on its own, or fixed rows no entry\n *  produces (a section's header, hand-built rows). */\nexport type PlanWireBlock = ValueTypeOf<typeof Plan.Types.Block>;\nexport { rowKeyOf, rowIdOfKey, rowKeyWords, type PlanRowId } from \"./row-key.js\";\n/** One decoded link edge (the R1 graph / K8 ribbon shape). */\nexport type PlanLinkValue = ValueTypeOf<typeof Plan.Types.Link>;\n\n/**\n * One CANVAS row — a wire row keyed for the canvas (#822).\n *\n * @remarks\n * `key` is the canonical `.east` text of the row's typed `id`\n * ({@link rowKeyOf}): the index every map, DOM attribute and piece of view\n * state keys by, and what a drag names the row with. `parent` is the parent's\n * key. The typed `id` rides along for every payload that names the row — a\n * callback never sees the text.\n */\nexport type PlanRowValue = Omit<PlanWireRow, \"parent\"> & {\n    /** The row's key — the canonical text of its id; unique on the canvas. */\n    readonly key: RowKey;\n    /** The key of the row it nests under (`none` at the top of the stream). */\n    readonly parent: ValueTypeOf<OptionType<StringType>>;\n    /** When this row repeats the id an earlier row in its stream carries: that\n     *  row's key. The row keeps a unique key and renders as a diagnostic\n     *  (#811) — never a silent drop. */\n    readonly duplicateOf: RowKey | undefined;\n    /** The block the row came from — its place in the canvas's layout (#823). */\n    readonly block: number;\n};\n\n/**\n * Key a stream of wire rows for the canvas — each row's `key` its id's\n * canonical text and its `parent` the parent's.\n *\n * @remarks\n * Ids are unique by construction (series keys are unique across the series\n * tree and a path is unique within a collection) except where hand-built rows\n * repeat a key. A repeat keeps a distinct key — its text with `#n` appended,\n * which no printed id can end with — and names the row it repeats in\n * `duplicateOf`, so it renders as a diagnostic in place.\n *\n * @param wire - The rows in stream order\n * @param block - The block they came from (#823)\n * @param seen - The ids keyed so far on the canvas, and how often — shared\n *   across a canvas's blocks so a repeat in a later block is caught too\n * @returns The canvas rows, in the same order\n */\nexport function toCanvasRows(\n    wire: ReadonlyArray<PlanWireRow>,\n    block: number = 0,\n    seen: Map<RowKey, number> = new Map(),\n): PlanRowValue[] {\n    return wire.map((row): PlanRowValue => {\n        const text = rowKeyOf(row.id);\n        const repeats = seen.get(text) ?? 0;\n        seen.set(text, repeats + 1);\n        return {\n            ...row,\n            key: repeats === 0 ? text : `${text}#${repeats}`,\n            parent: row.parent.type === \"some\" ? some(rowKeyOf(row.parent.value)) : none,\n            duplicateOf: repeats === 0 ? undefined : text,\n            block,\n        };\n    });\n}\n\n/** Each decoded inline canvas's rows — keyed once per decoded block list. */\nconst canvasRowsCache = new WeakMap<ReadonlyArray<PlanWireBlock>, readonly PlanRowValue[]>();\n\n/**\n * The canvas rows of an inline canvas — every block's rows in layout order,\n * keyed across the whole canvas ({@link toCanvasRows}), once per decoded\n * block list.\n *\n * @remarks\n * The controller and the canvas both read a root's inline rows. A decoded\n * value is never mutated, so its array's identity names its rows, and the two\n * share one keying — and one set of row objects.\n *\n * @param blocks - A decoded inline canvas's blocks\n * @returns Its canvas rows\n */\nexport function canvasRowsOf(blocks: ReadonlyArray<PlanWireBlock>): readonly PlanRowValue[] {\n    const cached = canvasRowsCache.get(blocks);\n    if (cached !== undefined) return cached;\n    const seen = new Map<RowKey, number>();\n    const rows: PlanRowValue[] = [];\n    blocks.forEach((b, i) => appendAll(rows, toCanvasRows(b.rows, i, seen)));\n    canvasRowsCache.set(blocks, rows);\n    return rows;\n}\n\n/**\n * Key a paged canvas's resident rows across its blocks — each block's windows\n * were keyed on their own when they were read, so a later block repeating an\n * id an earlier block carries (a bound series list naming one series twice)\n * is re-keyed here, exactly as {@link canvasRowsOf} keys the same rows inline.\n *\n * @param rows - The resident rows, block by block\n * @returns The same rows — the same array when nothing repeats\n */\nexport function keyAcrossBlocks(rows: readonly PlanRowValue[]): readonly PlanRowValue[] {\n    const counts = new Map<RowKey, number>();\n    let out: PlanRowValue[] | undefined;\n    rows.forEach((row, i) => {\n        const text = row.duplicateOf ?? row.key;\n        const n = counts.get(text) ?? 0;\n        counts.set(text, n + 1);\n        const key = n === 0 ? text : `${text}#${n}`;\n        if (key === row.key) {\n            out?.push(row);\n            return;\n        }\n        out ??= rows.slice(0, i);\n        out.push({ ...row, key, duplicateOf: n === 0 ? undefined : text });\n    });\n    return out ?? rows;\n}\n\n/**\n * Whether a row's derived numbers — its member count and its strip — can\n * cover rows from more than one paged window (#822).\n *\n * @remarks\n * Only a TOP-LEVEL section header's can: its members are its series' entries,\n * which the source's windows share out. Every other parent derives from one\n * entry's subtree, which the entry carries whole and a window holds whole, or\n * from hand-built rows every window serves complete — so its numbers are\n * exact whether the canvas is inline or paged, loaded or not. A section adds\n * no path segment, so one at the top (or inside another at the top) sits at\n * the empty path; one inside an entry sits at that entry's path, and its\n * members are that entry's.\n *\n * @param row - A canvas row\n * @returns Whether its derived numbers depend on which windows have landed\n */\nexport function spansWindows(row: PlanRowValue): boolean {\n    return row.id.type === \"section\" && row.id.value.path.length === 0;\n}\n\n/** The canvas rows indexed for traversal. */\nexport interface PlanRowIndex {\n    /** Rows in STREAM order — the render order. */\n    rows: ReadonlyArray<PlanRowValue>;\n    /** Row lookup by key. */\n    byKey: ReadonlyMap<RowKey, PlanRowValue>;\n    /** Direct children (stream order) by parent key. */\n    children: ReadonlyMap<RowKey, PlanRowValue[]>;\n    /** Top rows (`parent: none`), stream order. */\n    roots: ReadonlyArray<PlanRowValue>;\n    /** Nesting depth by key (top rows = 0). */\n    depth: ReadonlyMap<RowKey, number>;\n    /** The keys of rows the IR declares initially collapsed — any row with\n     *  children may be (#822). */\n    initiallyCollapsed: ReadonlySet<RowKey>;\n}\n\n/**\n * Build the row index once per decoded value.\n *\n * @param rows - The canvas rows in stream order ({@link toCanvasRows})\n * @returns The index every other selector walks\n */\nexport function indexRows(rows: ReadonlyArray<PlanRowValue>): PlanRowIndex {\n    const byKey = new Map<RowKey, PlanRowValue>();\n    const children = new Map<RowKey, PlanRowValue[]>();\n    const roots: PlanRowValue[] = [];\n    for (const row of rows) {\n        byKey.set(row.key, row);\n        if (row.parent.type === \"some\") {\n            const list = children.get(row.parent.value);\n            if (list !== undefined) list.push(row);\n            else children.set(row.parent.value, [row]);\n        } else {\n            roots.push(row);\n        }\n    }\n    const depth = new Map<RowKey, number>();\n    const walk = (row: PlanRowValue, d: number) => {\n        depth.set(row.key, d);\n        for (const child of children.get(row.key) ?? []) walk(child, d + 1);\n    };\n    for (const root of roots) walk(root, 0);\n    const initiallyCollapsed = new Set<RowKey>();\n    for (const row of rows) {\n        if (row.collapsed) initiallyCollapsed.add(row.key);\n    }\n    return { rows, byKey, children, roots, depth, initiallyCollapsed };\n}\n\n/** One visible line of the canvas body. */\nexport interface VisibleRow {\n    row: PlanRowValue;\n    /** Nesting depth (drives the 30px/level gutter indent). */\n    depth: number;\n    /** For group strips / nesting parents: whether the subtree is collapsed. */\n    collapsed: boolean;\n}\n\n/**\n * The visible rows for the current UI state — the §5/§6 derivation:\n *\n * - `resource` grain (default): the stream, in order; a collapsed row keeps\n *   its own line and hides exactly its descendants.\n * - `group` grain: every top-level group strip collapses to its summary\n *   strip; other top rows stay.\n *\n * The walk follows the STREAM and hides a row whose parent is hidden or\n * collapsed — by the explicit `parent` keys, never a tree walk, since a\n * parent's descendants need not follow it directly (#822: an entry's children\n * under `views` follow all of its view rows while nesting under the first).\n * A parent precedes its descendants, so one pass suffices. A row whose parent\n * is nowhere in the stream is not drawn — it derives nothing either\n * (`derivePlan` walks the same tree).\n *\n * Pinned rows are excluded here — they render above the virtualised body,\n * under the ruler (`pinnedRows`) — and so are their descendants.\n */\nexport function visibleRows(\n    index: PlanRowIndex,\n    /** The UI facts the rows follow — the grain and the collapsed set. */\n    ui: Pick<PlanUiState, \"grain\" | \"collapsed\">,\n    /** Keys a links focus must reveal — a collapsed subtree CONTAINING one\n     *  auto-expands for the focus and restores on return (R1). */\n    reveal?: ReadonlySet<RowKey>,\n): VisibleRow[] {\n    const out: VisibleRow[] = [];\n    const grain: PlanGrain = ui.grain;\n    const isPinned = (row: PlanRowValue) => row.pinned;\n    // \"Must this subtree stay open for the focus?\" answered ONCE: the set of\n    // strict ANCESTORS of every revealed key, built by walking `parent`\n    // pointers upward — O(reveal × depth) (#616).\n    const revealAncestors = ancestorsOf(index, reveal);\n    // The rows whose descendants are out of view: collapsed, pinned, or\n    // themselves hidden.\n    const closed = new Set<RowKey>();\n    for (const row of index.rows) {\n        if (row.parent.type === \"some\" && closed.has(row.parent.value)) {\n            closed.add(row.key);\n            continue;\n        }\n        if (isPinned(row)) {\n            closed.add(row.key);\n            continue;\n        }\n        const depth = index.depth.get(row.key);\n        if (depth === undefined) continue;\n        const isGroup = row.kind.type === \"group\";\n        const collapsed = (ui.collapsed.has(row.key) || (grain === \"group\" && isGroup && depth === 0))\n            && !revealAncestors.has(row.key);\n        out.push({ row, depth, collapsed });\n        if (collapsed) closed.add(row.key);\n    }\n    return out;\n}\n\n/** The pinned rows (IR order) — rendered above the virtualised body. */\nexport function pinnedRows(index: PlanRowIndex): PlanRowValue[] {\n    return index.rows.filter((row) => row.pinned);\n}\n\n// ── Row heights (the §8 sheet; px) ─────────────────────────────────────────\n// Every height below is an entry of the ONE geometry table (`geometry.ts`,\n// #817) — the table the recipe reads too, as CSS variables. These names are\n// its default-density entries, kept for the code and tests that name them.\n\n/** Default span/bucket/cards/table row height. Tables share it: numerals need\n *  no less room than a bar does, and a table row at the dense height beside\n *  default rows read as a mistake. */\nexport const ROW_H = PLAN_GEOMETRY.default.row;\n/** Dense row height (`density: compact`). */\nexport const ROW_H_DENSE = PLAN_GEOMETRY.dense.row;\n/** Group band height. */\nexport const GROUP_H = PLAN_GEOMETRY.default.group;\n/** Group summary heat-strip height (collapsed group with cells). */\nexport const GROUP_STRIP_H = PLAN_GEOMETRY.default.groupStrip;\n/** Chart spark / expanded heights. */\nexport const CHART_SPARK_H = PLAN_GEOMETRY.default.chartSpark;\nexport const CHART_EXPANDED_H = PLAN_GEOMETRY.default.chartExpanded;\n/** Heat ROW height — 22px cells (§8) + the 3px insets above and below. */\nexport const HEAT_ROW_H = PLAN_GEOMETRY.default.heatRow;\n/** Two-line-gutter row minimum (the §8 sheet: row min-height 42px). */\nexport const ROW_H_STACKED = PLAN_GEOMETRY.default.rowStacked;\n/** Links-focus rail height — a LONE unrelated row collapses, never removed (R1). */\nexport const RAIL_H = PLAN_GEOMETRY.default.rail;\n/** Expand-focus CONTEXT STRIP height (R2) — an unfocused row compresses to\n *  this, keeping its marks on the shared axis at {@link STRIP_MARK_H}. Taller\n *  than the links rail on purpose: a rail only has to carry a status dot,\n *  a strip has to carry the row's actual marks. */\nexport const STRIP_H = PLAN_GEOMETRY.default.strip;\n/** The mark height inside a context strip — v2's \"bars reduced to 7px marks\". */\nexport const STRIP_MARK_H = PLAN_GEOMETRY.default.stripMark;\n/** Links-focus gap-band height — a RUN of unrelated rows elides to one\n *  double-height band wearing the ⋯ icon (R1 at scale). */\nexport const GAP_H = PLAN_GEOMETRY.default.gap;\n\n/** The row-focus height context (R1 rails / R2 strips) threaded to {@link rowHeight}. */\nexport interface PlanFocusCtx {\n    kind: \"links\" | \"expand\";\n    /** The focused row. */\n    key: RowKey;\n    /** Full-height family keys (links focus; the focused row is implied). */\n    family?: ReadonlySet<RowKey> | undefined;\n    /** R2 — the clamped developer-render height, in px.\n     *\n     *  The render lives INSIDE the focused row rather than beside it, because\n     *  the gutter has to grow with it: v2 gives the expanded row ONE tall\n     *  gutter cell, top-aligned, whose new space is the author's\n     *  (`expandGutter`). A render mounted as a sibling row would leave that\n     *  cell 32px tall with a blank column beside the render — which is\n     *  precisely the tell that the row did not really expand. */\n    renderPx?: number | undefined;\n}\n\n/** Parse a CSS px size (`\"120px\"` / `\"120\"`) to a number; `undefined` for\n *  anything a virtualized row can't be (`\"fill\"`, percentages).\n *\n *  The unit test is the doc: `parseFloat(\"50%\")` is `50`, so bare\n *  `parseFloat` silently turned a percentage height into 50px (#615) —\n *  only a `px` suffix or a bare number qualifies. */\nexport function pxOf(size: string): number | undefined {\n    if (!/^\\s*-?(\\d+\\.?\\d*|\\.\\d+)(px)?\\s*$/.test(size)) return undefined;\n    const n = parseFloat(size);\n    return Number.isFinite(n) ? n : undefined;\n}\n\n/**\n * What a row's kind contributes to its height — the part of the kind a height\n * reads, and nothing else (#823).\n *\n * - `group` — whether a collapsed band shows a summary strip.\n * - `chart` — its declared fixed px, whether it is declared expanded, and the\n *   px its expanded state opens to.\n * - `table` — how many lines a vertical multi-position stack prints (0 when it\n *   does not stack).\n * - `buckets` — how many lanes its cells hold.\n * - `heat`, `row` — every other kind: one height each.\n */\nexport type RowKindHeight =\n    | { t: \"group\"; strip: boolean }\n    | { t: \"chart\"; fixed: number | undefined; expanded: boolean; expandedPx: number | undefined }\n    | { t: \"heat\" }\n    | { t: \"table\"; lines: number }\n    | { t: \"buckets\"; lanes: number }\n    | { t: \"row\" };\n\n/**\n * Everything a row's height depends on besides the UI state, read once from\n * the row and its derived numbers (#823). With the UI state it gives the\n * height ({@link factsHeight}), and it is what an evicted paged window keeps of\n * each of its rows ({@link WindowSkeleton}): no content, only these.\n */\nexport interface RowHeightFacts {\n    /** The row's own declared px (`height`), when it is a px size. */\n    explicit: number | undefined;\n    /** It renders as a diagnostic row (#811) — its message, never its marks. */\n    diagnostic: boolean;\n    /** A two-line gutter (a sub line, or the stacked flag) — floors the row. */\n    twoLine: boolean;\n    /** What its kind contributes. */\n    kind: RowKindHeight;\n}\n\n/**\n * A row's height facts.\n *\n * @param row - The canvas row\n * @param derived - The derived numbers, when available. A subtotal parent\n *   carries NO series of its own — its positions are derived — so without\n *   this a vertical multi-position subtotal would measure as a single line and\n *   render taller than the virtualizer was told.\n * @returns Its facts\n */\nexport function heightFactsOf(row: PlanRowValue, derived?: PlanDerived): RowHeightFacts {\n    const explicit = row.height.type === \"some\" ? pxOf(row.height.value) : undefined;\n    const twoLine = row.gutter.stacked || row.gutter.sub.type === \"some\";\n    const diagnostic = derived?.diagnostics.has(row.key) === true;\n    const k = row.kind;\n    let kind: RowKindHeight;\n    switch (k.type) {\n        case \"group\":\n            kind = { t: \"group\", strip: k.value.summary.type !== \"none\" };\n            break;\n        case \"chart\": {\n            const h = k.value.height;\n            kind = {\n                t: \"chart\",\n                fixed: h.type === \"fixed\" ? pxOf(h.value) : undefined,\n                expanded: h.type === \"expanded\",\n                expandedPx: k.value.expandedHeight.type === \"some\" ? pxOf(k.value.expandedHeight.value) : undefined,\n            };\n            break;\n        }\n        case \"heat\": kind = { t: \"heat\" }; break;\n        case \"table\": {\n            // A vertical multi-series stack grows the row, one line per series.\n            const n = derived?.tableSeries.get(row.key)?.length ?? k.value.series.length;\n            kind = { t: \"table\", lines: k.value.split.type === \"vertical\" && n > 1 ? n : 0 };\n            break;\n        }\n        case \"buckets\": kind = { t: \"buckets\", lanes: k.value.lanes.length }; break;\n        default: kind = { t: \"row\" };\n    }\n    return { explicit, diagnostic, twoLine, kind };\n}\n\n/**\n * A row's pixel height from its facts and the UI state — the ONE height\n * arithmetic: the rendered rows ({@link rowHeight}) and the paged ledger's\n * windows ({@link skeletonHeight}) both come through here, so a band that\n * stands for evicted rows is exactly as tall as those rows draw (#823).\n *\n * @param f - The row's facts\n * @param key - The row's key\n * @param collapsed - Whether its subtree is collapsed\n * @param dense - Whether the canvas is dense\n * @param chartsExpanded - The chart rows the user expanded\n * @param focus - The row focus, when one is active (R1 rails / R2 strips)\n * @returns The height, px\n */\nexport function factsHeight(\n    f: RowHeightFacts,\n    key: RowKey,\n    collapsed: boolean,\n    dense: boolean,\n    chartsExpanded: ReadonlySet<RowKey>,\n    focus?: PlanFocusCtx,\n): number {\n    // Row focus compresses the DATA rows it is not about; group bands always\n    // fall through to their wayfinding height, because a wall of strips is\n    // unreadable without the structure that says which rows they are\n    // (\"collapse, never remove\" — the rows stay mounted, in order, either way).\n    //\n    // A links focus rails unrelated rows to 11px (a status dot); an expand\n    // focus strips every other row to 16px, where its marks survive at 7px on\n    // the same axis. The FOCUSED row falls through to its normal kind height\n    // in both cases — R2 grows the canvas under the row, not the row itself.\n    const g = planGeometry(dense);\n    if (focus !== undefined && f.kind.t !== \"group\") {\n        if (focus.kind === \"links\") {\n            const inFamily = key === focus.key || (focus.family?.has(key) ?? false);\n            if (!inFamily) return g.rail;\n        } else if (key !== focus.key) {\n            return g.strip;\n        } else if (focus.renderPx !== undefined && focus.renderPx > 0) {\n            // The FOCUSED row grows by its render — the row's own marks keep\n            // their band at the top, the render fills the rest, and the gutter\n            // spans both. Recursing with the focus dropped gets the row's\n            // natural kind height without duplicating the switch below.\n            return factsHeight(f, key, collapsed, dense, chartsExpanded, undefined) + focus.renderPx;\n        }\n    }\n    if (f.explicit !== undefined) return f.explicit;\n    // Any two-line gutter floors the row at 42px on every data kind — a\n    // one-line height would clip the sub text.\n    const floor = (h: number) => (f.twoLine ? Math.max(h, g.rowStacked) : h);\n    // A diagnostic row (#811) draws its message, never its marks — one line\n    // at the shared default; a diagnosed group keeps its band and drops the\n    // strip it cannot place.\n    if (f.diagnostic) return f.kind.t === \"group\" ? g.group : floor(g.row);\n    switch (f.kind.t) {\n        case \"group\": return collapsed && f.kind.strip ? g.groupStrip : g.group;\n        case \"chart\": {\n            if (f.kind.fixed !== undefined) return f.kind.fixed;\n            // The two-line floor applies to a chart's DEFAULT heights like\n            // every other kind: a spark row is 32px, and a 42px sub-line does\n            // not fit in it — it clipped, which is what the floor exists to\n            // prevent. A DECLARED px (`fixed`, `expandedHeight`) is the\n            // author's word and stays unfloored, the same rule the row-level\n            // `height` override above follows.\n            if (!f.kind.expanded && !chartsExpanded.has(key)) return floor(g.chartSpark);\n            // A declared expandedHeight overrides the 88px expanded default —\n            // an expandable spark can open to a full composition height.\n            return f.kind.expandedPx ?? floor(g.chartExpanded);\n        }\n        case \"heat\": return floor(g.heatRow);\n        case \"table\":\n            return f.kind.lines > 1 ? floor(Math.max(g.row, g.tablePad + f.kind.lines * g.tableLine)) : floor(g.row);\n        case \"buckets\": {\n            // Laned rows grow — the Planner cell grid: a cell per lane, a gap\n            // between, lane padding above and below (§4·K2).\n            const n = f.kind.lanes;\n            return n > 1 ? floor(2 * g.lanePad + n * g.laneCell + (n - 1) * g.laneGap) : floor(g.row);\n        }\n        case \"row\": return floor(g.row);\n    }\n}\n\n/**\n * A visible row's pixel height — the virtualizer's size for it AND the height\n * it renders at (rows are fixed-height by kind), from the density's geometry\n * table ({@link planGeometry}).\n *\n * @param v - The visible row\n * @param dense - Whether the canvas is dense\n * @param chartsExpanded - The chart rows the user expanded\n * @param focus - The row focus, when one is active (R1 rails / R2 strips)\n * @param derived - The derived numbers, when available ({@link heightFactsOf})\n * @returns The height, px\n */\nexport function rowHeight(\n    v: VisibleRow,\n    dense: boolean,\n    chartsExpanded: ReadonlySet<RowKey>,\n    focus?: PlanFocusCtx,\n    derived?: PlanDerived,\n): number {\n    return factsHeight(heightFactsOf(v.row, derived), v.row.key, v.collapsed, dense, chartsExpanded, focus);\n}\n\n// ── Window skeletons — the heights of evicted rows (#823) ──────────────────\n\n/**\n * What a paged window keeps of one block's rows once they are evicted (#823):\n * per row, in stream order, its key, where its parent sits, whether it is\n * pinned, its declared collapse and its height facts. No content — enough to\n * say exactly how tall the rows would draw under any UI state, so a band that\n * stands for them follows a collapse, a chart toggle or the grain without the\n * window being read again.\n */\nexport interface WindowSkeleton {\n    /** Each row's key. */\n    readonly keys: readonly RowKey[];\n    /** Each row's parent's index here — −1 when it nests under a row outside\n     *  the window (the section header its block sits under) or none. */\n    readonly parents: readonly number[];\n    /** Whether the row is at the top of the canvas (no parent at all) — the\n     *  group grain folds a group row there. */\n    readonly top: readonly boolean[];\n    /** Whether the row is pinned — pinned rows draw above the body. */\n    readonly pinned: readonly boolean[];\n    /** Whether the row declares itself collapsed. */\n    readonly declared: readonly boolean[];\n    /** Each row's height facts. */\n    readonly facts: readonly RowHeightFacts[];\n}\n\n/**\n * One window's skeleton — computed ONCE, when the window lands.\n *\n * @remarks\n * A window holds its entries whole (#823), so its own rows derive everything\n * a height reads — a subtotal parent's derived positions, which rows are\n * diagnostic rows. A block's top rows may nest under a row no window holds\n * (a section's header, a fixed block): for the derivation they are the\n * window's roots, and they stay open whatever that header does — when the\n * header folds, the canvas hides the whole block, bands and all.\n *\n * @param rows - One block's rows from one window, in stream order\n * @param axisKind - The axis kind — a row on another arm measures as the\n *   diagnostic row it renders as\n * @returns The skeleton\n */\nexport function windowSkeleton(rows: readonly PlanRowValue[], axisKind?: PlanAxisKind): WindowSkeleton {\n    const at = new Map<RowKey, number>();\n    rows.forEach((r, i) => at.set(r.key, i));\n    // Rows whose parent is outside the window root the derivation.\n    const rooted = rows.map((r) => (r.parent.type === \"some\" && !at.has(r.parent.value) ? { ...r, parent: none } : r));\n    const derived = derivePlan(indexRows(rooted), undefined, axisKind);\n    return {\n        keys: rows.map((r) => r.key),\n        parents: rows.map((r) => (r.parent.type === \"some\" ? at.get(r.parent.value) ?? -1 : -1)),\n        top: rows.map((r) => r.parent.type === \"none\"),\n        pinned: rows.map((r) => r.pinned),\n        declared: rows.map((r) => r.collapsed),\n        facts: rows.map((r) => heightFactsOf(r, derived)),\n    };\n}\n\n/** The UI state a skeleton's height reads. */\nexport interface SkeletonUi {\n    /** The active grain. */\n    grain: PlanGrain;\n    /** Whether a row's subtree is collapsed — given its key and whether it\n     *  declares itself collapsed (a paged row may not have been seeded yet). */\n    collapsed: (key: RowKey, declared: boolean) => boolean;\n    /** The chart rows the user expanded. */\n    chartsExpanded: ReadonlySet<RowKey>;\n}\n\n/** No chart expanded. */\nconst NO_CHARTS: ReadonlySet<RowKey> = new Set();\n\n/**\n * The UI state a window rests at — its declared collapse, no chart expanded,\n * no focus — under a grain.\n *\n * @param grain - The DECLARED grain\n * @returns The state\n */\nexport function restUi(grain: PlanGrain): SkeletonUi {\n    return { grain, collapsed: (_key, declared) => declared, chartsExpanded: NO_CHARTS };\n}\n\n/**\n * How tall a window's rows draw under a UI state — the visible-row walk\n * ({@link visibleRows}) and the height arithmetic ({@link factsHeight}) over\n * the skeleton, so the number is the one the body would draw the same rows at.\n *\n * @param sk - The window's skeleton\n * @param ui - The UI state\n * @param dense - Whether the canvas is dense\n * @param focus - An expand focus, when one is active — its context strips\n *   (a links focus elides runs of rows across windows, which no window's\n *   height can say; its windows measure as though unfocused)\n * @returns The height, px\n */\nexport function skeletonHeight(sk: WindowSkeleton, ui: SkeletonUi, dense: boolean, focus?: PlanFocusCtx): number {\n    const closed = new Array<boolean>(sk.keys.length).fill(false);\n    let sum = 0;\n    for (let i = 0; i < sk.keys.length; i++) {\n        const p = sk.parents[i]!;\n        if ((p >= 0 && closed[p]) || sk.pinned[i]) {\n            closed[i] = true;\n            continue;\n        }\n        const key = sk.keys[i]!;\n        const f = sk.facts[i]!;\n        const collapsed = ui.collapsed(key, sk.declared[i]!) || (ui.grain === \"group\" && f.kind.t === \"group\" && sk.top[i]!);\n        sum += factsHeight(f, key, collapsed, dense, ui.chartsExpanded, focus?.kind === \"expand\" ? focus : undefined);\n        if (collapsed) closed[i] = true;\n    }\n    return sum;\n}\n\n/**\n * The pixel height a window's rows render AT REST (#613) — declared collapse\n * applied, chart expansion at its declared state, no focus context, pinned\n * rows excluded (they render in the header, not the body). What the window\n * ledger seeds its slot rate from: a rate taken from whatever the UI state\n * happened to be when the first window landed (mid-focus, say) would describe\n * every unvisited window wrongly for the life of the source.\n *\n * @param windowRows - One window's rows, as the source served them\n * @param grain - The DECLARED grain (`value.grain`; user grain is transient)\n * @param dense - The declared density\n * @param axisKind - The axis kind — a row on another arm measures as the\n *   diagnostic row it renders as\n * @returns The at-rest pixel height of the window's body rows\n */\nexport function windowRestHeight(\n    windowRows: ReadonlyArray<PlanRowValue>,\n    grain: PlanGrain,\n    dense: boolean,\n    axisKind?: PlanAxisKind,\n): number {\n    return skeletonHeight(windowSkeleton(windowRows, axisKind), restUi(grain), dense);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas controller's React face (#815): the context every part of the\n * canvas reaches it through, and the selectors that subscribe a component to\n * exactly the slice of state it reads — so a row re-renders when ITS state\n * moves, and a selection click renders two rows, not the canvas.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useCallback, useContext, useRef, useSyncExternalStore } from \"react\";\nimport type { RowKey } from \"../plan-state.js\";\nimport { rowItemKey } from \"../body-items.js\";\nimport type { PlanController, PlanSnapshot } from \"./index.js\";\n\n/** The canvas's controller, provided once by the canvas root. */\nexport const PlanControllerContext = createContext<PlanController | null>(null);\n\n/**\n * The canvas's controller — throws outside a Plan (its parts are\n * canvas-internal; there is no standalone mounting).\n *\n * @returns The controller\n */\nexport function usePlanController(): PlanController {\n    const controller = useContext(PlanControllerContext);\n    if (controller === null) throw new Error(\"[Plan] rendered outside its controller\");\n    return controller;\n}\n\n/**\n * Subscribe to one slice of a controller's state.\n *\n * @remarks\n * The selection is cached per snapshot, and kept by IDENTITY while `isEqual`\n * says it did not change — so a component re-renders only when its own slice\n * moved, whatever else the notification carried. `select` may be a fresh\n * closure each render; it is re-applied, and an equal result keeps the old\n * identity.\n *\n * The canvas root, which provides the controller, selects through this;\n * everything beneath it uses {@link usePlanSelector}.\n *\n * @typeParam T - The selected slice\n * @param controller - The controller\n * @param select - Reads the slice from a snapshot\n * @param isEqual - Whether two selections are the same (default `Object.is`)\n * @returns The selected slice\n */\nexport function useControllerSelector<T>(\n    controller: PlanController,\n    select: (s: PlanSnapshot) => T,\n    isEqual: (a: T, b: T) => boolean = Object.is,\n): T {\n    const cache = useRef<{ snap: PlanSnapshot; select: (s: PlanSnapshot) => T; value: T } | null>(null);\n    const getSelection = (): T => {\n        const snap = controller.getSnapshot();\n        const prev = cache.current;\n        if (prev !== null && prev.snap === snap && prev.select === select) return prev.value;\n        const next = select(snap);\n        const value = prev !== null && isEqual(prev.value, next) ? prev.value : next;\n        cache.current = { snap, select, value };\n        return value;\n    };\n    return useSyncExternalStore(controller.subscribe, getSelection, getSelection);\n}\n\n/**\n * Subscribe to one slice of the canvas controller's state — see\n * {@link useControllerSelector}.\n *\n * @typeParam T - The selected slice\n * @param select - Reads the slice from a snapshot\n * @param isEqual - Whether two selections are the same (default `Object.is`)\n * @returns The selected slice\n */\nexport function usePlanSelector<T>(select: (s: PlanSnapshot) => T, isEqual: (a: T, b: T) => boolean = Object.is): T {\n    return useControllerSelector(usePlanController(), select, isEqual);\n}\n\n/** One grid item's keyboard facts (#819). */\nexport interface PlanItemNav {\n    /** The item holds the canvas's one tab stop. */\n    active: boolean;\n    /** A pending keyboard move onto the item (its request's number), or 0. */\n    focusSeq: number;\n}\n\nconst sameItemNav = (a: PlanItemNav, b: PlanItemNav): boolean =>\n    a.active === b.active && a.focusSeq === b.focusSeq;\n\n/** An item's keyboard facts in a snapshot. */\nfunction itemNavOf(s: PlanSnapshot, itemKey: string): PlanItemNav {\n    return {\n        active: s.nav.active === itemKey,\n        focusSeq: s.nav.request !== null && s.nav.request.key === itemKey ? s.nav.request.seq : 0,\n    };\n}\n\n/** One body row's own slice of the UI state. */\nexport interface PlanRowState extends PlanItemNav {\n    /** The row is the selection. */\n    selected: boolean;\n    /** The user toggled this chart row to expanded. */\n    chartExpanded: boolean;\n    /** Which of the row's focus controls is the active focus, if any. */\n    activeControl: \"links\" | \"expand\" | undefined;\n}\n\nconst sameRowState = (a: PlanRowState, b: PlanRowState): boolean =>\n    a.selected === b.selected && a.chartExpanded === b.chartExpanded && a.activeControl === b.activeControl\n    && sameItemNav(a, b);\n\n/**\n * A body row's own UI facts — the row re-renders when THESE change, never on\n * another row's selection, toggle or tab stop.\n *\n * @param key - The row key\n * @returns The row's state\n */\nexport function usePlanRowState(key: RowKey): PlanRowState {\n    const select = useCallback((s: PlanSnapshot): PlanRowState => {\n        const ui = s.store.ui;\n        return {\n            selected: ui.selected === key,\n            chartExpanded: ui.chartsExpanded.has(key),\n            activeControl: ui.focus !== null && ui.focus.key === key ? ui.focus.kind : undefined,\n            ...itemNavOf(s, rowItemKey(key)),\n        };\n    }, [key]);\n    return usePlanSelector(select, sameRowState);\n}\n\n/**\n * A non-row grid item's keyboard facts (#819) — a gap band, a window band, a\n * failed window: whether it holds the tab stop, and a keyboard move onto it.\n *\n * @param itemKey - The item's `bodyItemKey`\n * @returns Its keyboard facts\n */\nexport function usePlanItemNav(itemKey: string): PlanItemNav {\n    const select = useCallback((s: PlanSnapshot): PlanItemNav => itemNavOf(s, itemKey), [itemKey]);\n    return usePlanSelector(select, sameItemNav);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas as a treegrid (#819) — the plumbing every grid row shares: where\n * the row sits in the grid (`aria-rowindex`), the canvas's ONE tab stop, and\n * the keyboard's moves of DOM focus.\n *\n * # A row's position is written, not rendered\n *\n * `aria-rowindex` is a row's place among ALL the grid's rows — the ones the\n * virtualizer has not mounted, and the rows of a paged source not read yet,\n * included (#1398, CL12): a run not read, or a window whose read failed, is one\n * row of the grid at its first row's place, and takes as many places as the\n * rows it stands for, so `aria-rowcount` is the total, never the rows read\n * ({@link gridPlaces}). Rendered as a prop, every row below a collapse or\n * a window landing at the head would re-render only to renumber itself, which\n * is exactly the store-change tax the row memo removed (#616, #815). So the\n * canvas publishes every item's position to a small store, and each row\n * writes its own attribute straight to the DOM when its number moves — the\n * `#609` cursor's discipline: direct DOM writes, zero renders.\n *\n * # One tab stop\n *\n * The row holding the tab stop (`nav.active`) is `tabIndex=0`, every other row\n * `-1`. A row that holds it takes the grid element OUT of the tab order while\n * it is mounted, and puts it back when it unmounts — so when the active row is\n * scrolled out of the virtualizer's window, or has not been chosen yet, the\n * grid itself is the stop, and focusing it hands focus on to a row. A row that\n * leaves holding the DOM focus hands it to the canvas as it goes, before its\n * element leaves the page (`leave`, #1398, CL10): the focus never falls to the\n * page's body.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useCallback, useContext, useEffect, useLayoutEffect, useRef, type RefObject } from \"react\";\nimport { PlanControllerContext } from \"../controller/react.js\";\nimport { bodyItemKey, type PlanBodyItem } from \"../model.js\";\n\n/**\n * How many of the grid's rows a body item stands for: a row, a group's band or\n * a links focus's gap is one; a run not read, and a window whose read failed,\n * one for each element it covers — the row an element's entry draws, until its\n * window lands and says what it draws.\n *\n * @param item - The body item\n * @returns Its rows\n */\nfunction rowsOf(item: PlanBodyItem): number {\n    switch (item.kind) {\n        case \"row\":\n        case \"gap\":\n            return 1;\n        case \"band\":\n            return item.band.to - item.band.from + 1;\n        case \"failed\":\n            return item.failure.to - item.failure.from + 1;\n    }\n}\n\n/** Where every item sits in the grid, and how many rows the grid has. */\nexport interface PlanGridPlaces {\n    /** Each item's 1-based `aria-rowindex`, by item key: a pinned row's (`rowItemKey`) and a body item's (`bodyItemKey`). */\n    places: ReadonlyMap<string, number>;\n    /** The grid's `aria-rowcount`: every row, read or not; `-1`, ARIA's unknown, while a paged source has not counted itself. */\n    count: number;\n}\n\n/**\n * Every item's place in the grid, and its row count (#819; #1398, CL12): the\n * pinned rows first, then the body's items in order, each taking as many places\n * as the rows it stands for. A run not read is one row of the grid at its first\n * row's place, so the rows after it say their places among all the source's,\n * and the count is the total, never the rows read — as the Sheet's flat rows\n * say their positions. A paged source that has not counted itself has no\n * total yet: its rows still say their places, and the count is `-1`, as the\n * Sheet's is.\n *\n * @param pinned - The pinned rows' item keys, in order\n * @param items - The body's items, in order\n * @param counted - Whether the grid knows its total: an inline canvas, or a paged source that has counted itself\n * @returns Each item's place, and the count\n */\nexport function gridPlaces(pinned: readonly string[], items: readonly PlanBodyItem[], counted: boolean): PlanGridPlaces {\n    const places = new Map<string, number>();\n    let next = 1;\n    for (const key of pinned) places.set(key, next++);\n    for (const item of items) {\n        places.set(bodyItemKey(item), next);\n        next += rowsOf(item);\n    }\n    return { places, count: counted ? next - 1 : -1 };\n}\n\n/** Every grid item's 1-based `aria-rowindex`, by item key — read by the rows. */\nexport interface PlanRowPositions {\n    /** The position of an item (`bodyItemKey`), when it is in the grid. */\n    of(key: string): number | undefined;\n    /** Listen for the positions moving. */\n    subscribe(listener: () => void): () => void;\n}\n\n/** The canvas's side of {@link PlanRowPositions} — it publishes them. */\nexport interface PlanRowPositionStore extends PlanRowPositions {\n    /** Publish the positions — every mounted row rewrites its own. */\n    set(next: ReadonlyMap<string, number>): void;\n}\n\n/**\n * A position store — created once per canvas.\n *\n * @returns An empty store\n */\nexport function createRowPositions(): PlanRowPositionStore {\n    let map: ReadonlyMap<string, number> = new Map();\n    const listeners = new Set<() => void>();\n    return {\n        of: (key) => map.get(key),\n        subscribe(listener) {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n        set(next) {\n            if (next === map) return;\n            map = next;\n            for (const listener of [...listeners]) listener();\n        },\n    };\n}\n\n/** What every grid row of a canvas shares. */\nexport interface PlanGridContextValue {\n    /** Where each item sits in the grid. */\n    positions: PlanRowPositions;\n    /** The treegrid element — the tab stop while no mounted row holds it. */\n    gridRef: RefObject<HTMLElement | null>;\n    /**\n     * A row leaving the grid with the focus in it — a run its rows replace, a row a landing or the virtualizer takes off\n     * — hands it over as it goes, while its element is still on the page (#1398, CL10): the canvas keeps it, never the\n     * page's body.\n     */\n    leave: (key: string) => void;\n}\n\n/** The canvas's grid, provided once by the canvas root. */\nexport const PlanGridContext = createContext<PlanGridContextValue | null>(null);\n\n/** What a grid row puts on its element. */\nexport interface PlanGridRow {\n    /** The row element's ref — its position is written onto it. */\n    ref: (el: HTMLElement | null) => void;\n    /** Focus inside the row: it holds the tab stop now. */\n    onFocus: () => void;\n    /** `0` on the row holding the tab stop, `-1` on every other. */\n    tabIndex: 0 | -1;\n}\n\n/**\n * A grid row's plumbing — its written `aria-rowindex`, its share of the tab\n * stop, and its answer to a keyboard move onto it.\n *\n * @param itemKey - The row's `bodyItemKey`\n * @param active - Whether it holds the tab stop\n * @param focusSeq - A pending keyboard move onto it (its request's number), or 0\n * @returns What to put on the row element\n */\nexport function usePlanGridRow(itemKey: string, active: boolean, focusSeq: number): PlanGridRow {\n    const grid = useContext(PlanGridContext);\n    const controller = useContext(PlanControllerContext);\n    const elRef = useRef<HTMLElement | null>(null);\n    const activeRef = useRef(active);\n    // The row's position onto its element, and — while it holds the tab stop\n    // — the grid out of the tab order. Both are re-applied whenever the canvas\n    // publishes, which is after every change to the body: the frame may have\n    // swapped its rows' container for a new element (crossing its\n    // virtualization threshold), and a new container starts as a tab stop.\n    const sync = useCallback(() => {\n        const el = elRef.current;\n        if (el === null || grid === null) return;\n        const at = grid.positions.of(itemKey);\n        const want = at !== undefined ? String(at) : null;\n        if (el.getAttribute(\"aria-rowindex\") !== want) {\n            if (want === null) el.removeAttribute(\"aria-rowindex\");\n            else el.setAttribute(\"aria-rowindex\", want);\n        }\n        const gridEl = grid.gridRef.current;\n        if (activeRef.current && gridEl !== null && gridEl.tabIndex !== -1) gridEl.tabIndex = -1;\n    }, [grid, itemKey]);\n    const ref = useCallback((el: HTMLElement | null) => {\n        elRef.current = el;\n        if (el !== null) sync();\n    }, [sync]);\n    // Before paint — and again whenever the canvas publishes.\n    useLayoutEffect(() => {\n        sync();\n        return grid?.positions.subscribe(sync);\n    }, [grid, sync]);\n    // Leaving the grid with the focus in it, the row hands it to the canvas\n    // first (#1398, CL10): a component's layout cleanup runs before its\n    // element leaves the page, so the focus never falls to the page's body.\n    const keyRef = useRef(itemKey);\n    keyRef.current = itemKey;\n    useLayoutEffect(() => {\n        const el = elRef.current;\n        return () => {\n            if (el !== null && el.contains(document.activeElement)) grid?.leave(keyRef.current);\n        };\n    }, [grid]);\n    // Taking the tab stop, and handing it back to the grid when this row\n    // gives it up — or unmounts, scrolled out of the virtualizer's window.\n    useLayoutEffect(() => {\n        activeRef.current = active;\n        if (!active) return undefined;\n        sync();\n        return () => {\n            const gridEl = grid?.gridRef.current;\n            if (gridEl !== null && gridEl !== undefined) gridEl.tabIndex = 0;\n        };\n    }, [active, grid, sync]);\n    // A keyboard move onto this row: take focus once mounted, and say so —\n    // so a later remount does not take it again.\n    useEffect(() => {\n        if (focusSeq === 0) return;\n        elRef.current?.focus({ preventScroll: true });\n        controller?.focusDone(focusSeq);\n    }, [focusSeq, controller]);\n    const onFocus = useCallback(() => controller?.itemFocused(itemKey), [controller, itemKey]);\n    return { ref, onFocus, tabIndex: active ? 0 : -1 };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The drag grammar's slots on a scale (#631, #1148): what a\n * `CellRefType.slot` names on an axis, the start of the bucket an instant falls\n * in, spelled as the scale's kind spells it (`Scale.slotOf`). On a time scale\n * that is the instant as East prints a DateTime, the Z-less UTC ISO form a host\n * reads back with `slot.parse(DateTimeType)`, through the drag layer's shared\n * codec (`dateTimeSlot`), so every target that drops on time spells its slots\n * alike.\n *\n * @packageDocumentation\n */\n\nimport { clampedBucketAt, type Scale } from \"./scale.js\";\n\n/**\n * The slot the drag grammar names for an instant: the start of the bucket it\n * falls in, or of the window's first or last bucket when it lies beyond.\n *\n * @param scale - The scale\n * @param t - The instant\n * @returns The slot key\n */\nexport function slotOfInstant<I, K extends string>(scale: Scale<I, K>, t: I): string {\n    const i = scale.bucketOf(t);\n    const first = scale.buckets[0]!;\n    const bucket = i >= 0 ? scale.buckets[i]!\n        : scale.toNumber(t) < scale.toNumber(first.start) ? first : scale.buckets[scale.buckets.length - 1]!;\n    return scale.slotOf(bucket.start);\n}\n\n/**\n * The slot an element's END lands in: the bucket of its last instant. On a\n * half-open scale that is the bucket the end closes (an end on a bucket edge\n * is the bucket before it); where an end names its last bucket, the bucket it\n * names.\n *\n * @param scale - The scale\n * @param t - The end\n * @returns The slot key\n */\nexport function slotOfEnd<I, K extends string>(scale: Scale<I, K>, t: I): string {\n    if (scale.endInclusive) return slotOfInstant(scale, t);\n    const i = clampedBucketAt(scale, scale.endFracOf(t) - 1e-9);\n    return scale.slotOf(scale.buckets[i]!.start);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's drag-grammar slot keys (#631) — a bucket's start instant as a\n * `CellRefType.slot`, per the axis arm, and read back: `time` ⇒ the instant\n * as East prints it, the Z-less UTC ISO form (`slot.parse(DateTimeType)`),\n * `number` ⇒ the Float as East prints it (`slot.parse(FloatType)`),\n * `ordinal` ⇒ the value itself. Composed from the\n * drag layer's shared codecs, so the Plan spells its slots as every\n * axis-bearing target does (#608 moved it here: the layer knows no Plan type).\n *\n * @packageDocumentation\n */\n\nimport { dateTimeSlot, numberSlot, stringSlot } from \"@elaraai/east-ui-components/internal\";\nimport { numberInstant, ordinalInstant, timeInstant, type PlanAxisKind, type PlanInstantValue } from \"./instant.js\";\n\n/**\n * A Plan instant as a slot key, per its axis arm.\n *\n * @param t - The already-snapped instant (a bucket start)\n * @returns The slot key\n */\nexport function toPlanSlot(t: PlanInstantValue): string {\n    switch (t.type) {\n        case \"time\": return dateTimeSlot.encode(t.value);\n        case \"number\": return numberSlot.encode(t.value);\n        case \"ordinal\": return stringSlot.encode(t.value);\n    }\n}\n\n/**\n * The Plan instant a slot key names, per the axis arm — the inverse of\n * {@link toPlanSlot}. What a dropped card's draft is made at (#880).\n *\n * @param kind - The axis kind the slot was spelled for\n * @param slot - The slot key\n * @returns The instant, or `undefined` when the text is not one of that kind\n */\nexport function fromPlanSlot(kind: PlanAxisKind, slot: string): PlanInstantValue | undefined {\n    switch (kind) {\n        case \"time\": {\n            const d = dateTimeSlot.decode(slot);\n            return d !== undefined ? timeInstant(d) : undefined;\n        }\n        case \"number\": {\n            const n = numberSlot.decode(slot);\n            return n !== undefined ? numberInstant(n) : undefined;\n        }\n        case \"ordinal\": {\n            const s = stringSlot.decode(slot);\n            return s !== undefined ? ordinalInstant(s) : undefined;\n        }\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The canvas's moves in flight (#825) — ONE small store per canvas, outside\n * React, that the rows, the elements, the ghost and the live region read:\n *\n * - a pointer drag of an element, from its press ({@link PlanGrab}) — the\n *   element, what it moves (the whole element or one end) and where it was\n *   grabbed — and where it would land now ({@link PlanProposal}), with the\n *   units it moved by, which an event kind's element moves its event's own\n *   times by (#1196). The drag layer carries the drag; the rows read the grab\n *   to say where it lands.\n * - a keyboard carry ({@link PlanCarry}): Space on an element picks it up, and\n *   the canvas moves it by keys until it drops or cancels.\n *\n * A proposal moves on every pointer step, so it never passes through React\n * state: the ghost and the landing band read it here, and only they render.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext } from \"react\";\nimport type { CarrySteps, MoveMode, Span } from \"../../shared/time/drag.js\";\nimport { equalInstants, type PlanInstantValue } from \"../instant.js\";\nimport type { PlanRowValue } from \"../model.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport type { PlanRowMove } from \"../rows/SpanRow.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanWords } from \"../words.js\";\nimport type { PlanTyping } from \"./typing.js\";\n\n/** An element's extent: a run's or a chip's two ends; a tile's or a mark's instant, twice. Moved by the time parts' arithmetic (`shared/time/drag.ts`, #1148). */\nexport type PlanSpan = Span<PlanInstantValue>;\n\n/** What a gesture moves: the whole element, or one of its ends. */\nexport type PlanMoveMode = MoveMode;\n\n/** What an element is, for its look in the ghost. */\nexport type PlanMovableKind = \"run\" | \"chip\" | \"tile\" | \"mark\";\n\n/** An element that moves — what the canvas knows of it when it is picked up. */\nexport interface PlanMovable {\n    /** Its row's key. */\n    readonly rowKey: RowKey;\n    /** Its key — its item's id in the collection its series reads (#1436). */\n    readonly key: string;\n    /** Its name, for the ghost and the announcements. */\n    readonly label: string;\n    /** What it is. */\n    readonly kind: PlanMovableKind;\n    /** Its extent — a point element's instant twice. */\n    readonly span: PlanSpan;\n    /** Its row's item type, as the IR prints it — the rows it may move to share it. */\n    readonly items: string;\n    /** Whether it has two ends to resize. */\n    readonly resize: boolean;\n}\n\n/** A pointer drag of an element, from its press. */\nexport interface PlanGrab {\n    /** The element. */\n    readonly movable: PlanMovable;\n    /** What the drag moves — the element, or one end. */\n    readonly mode: PlanMoveMode;\n    /** Where it was pressed, as a window fraction. */\n    readonly grabFrac: number;\n}\n\n/** Where a gesture would land now — the row, and the extent there. */\nexport interface PlanProposal {\n    readonly rowKey: RowKey;\n    readonly span: PlanSpan;\n    /**\n     * The units it moved by since it was picked up — the buckets the pointer\n     * crossed, or the keyboard's steps — in Shift's finer unit when `fine`\n     * (#1196): what an event kind's element moves its event's own times by,\n     * and the other events selected with it.\n     */\n    readonly units?: number | undefined;\n    /** Whether `units` are Shift's finer ones. */\n    readonly fine?: boolean | undefined;\n    /** A keyboard carry's steps since it was picked up — the whole element's and each end's — its extent counted from them. */\n    readonly steps?: CarrySteps | undefined;\n}\n\n/** A keyboard carry — the element, and where it would land now. */\nexport interface PlanCarry {\n    readonly movable: PlanMovable;\n    readonly to: PlanProposal;\n    /** Whether the canvas's `canDrop` refuses it there. */\n    readonly refused: boolean;\n}\n\n/** Words for the live region, numbered so the same words said twice are said again. */\nexport interface PlanSaid {\n    readonly text: string;\n    readonly seq: number;\n}\n\n/** Two proposals alike — the same row, extents East calls equal, and the same units. */\nfunction sameProposal(a: PlanProposal | null, b: PlanProposal): boolean {\n    return a !== null && a.rowKey === b.rowKey && equalInstants(a.span.start, b.span.start) && equalInstants(a.span.end, b.span.end)\n        && a.units === b.units && a.fine === b.fine;\n}\n\n/**\n * The canvas's moves in flight — see the module docs.\n */\nexport class PlanEditStore {\n    /** The element a pointer press picked, while its drag may be in flight. */\n    grab: PlanGrab | null = null;\n    /** Whether Shift is held during a pointer drag — the finer unit. */\n    shift = false;\n    /** Where the pointer drag would land now. */\n    proposal: PlanProposal | null = null;\n    /** The keyboard carry, while one lasts. */\n    carry: PlanCarry | null = null;\n    /** The live region's last words. */\n    said: PlanSaid | null = null;\n    /** Each element's movable, by its node — how a key finds what Space picks up. */\n    private readonly nodes = new WeakMap<Element, PlanMovable>();\n    /** The element to focus once the canvas has drawn a keyboard drop. */\n    private focusAfter: { rowKey: RowKey; key: string } | null = null;\n    private readonly listeners = new Set<() => void>();\n    private release: (() => void) | undefined;\n\n    /** Listen to every change. */\n    readonly subscribe = (listener: () => void): (() => void) => {\n        this.listeners.add(listener);\n        return () => { this.listeners.delete(listener); };\n    };\n\n    private emit(): void {\n        for (const l of [...this.listeners]) l();\n    }\n\n    /**\n     * A pointer pressed an element — arm its drag. Shift is followed from here\n     * until the press ends.\n     *\n     * @param grab - The element, what it moves and where it was pressed\n     * @param doc - The document the press is in\n     */\n    arm(grab: PlanGrab, doc: Document): void {\n        this.release?.();\n        this.grab = grab;\n        this.proposal = null;\n        this.shift = false;\n        const follow = (e: KeyboardEvent | PointerEvent) => { this.shift = e.shiftKey; };\n        const end = () => { this.release?.(); };\n        doc.addEventListener(\"keydown\", follow, true);\n        doc.addEventListener(\"keyup\", follow, true);\n        doc.addEventListener(\"pointermove\", follow, true);\n        this.release = () => {\n            doc.removeEventListener(\"keydown\", follow, true);\n            doc.removeEventListener(\"keyup\", follow, true);\n            doc.removeEventListener(\"pointermove\", follow, true);\n            doc.removeEventListener(\"pointerup\", end, true);\n            doc.removeEventListener(\"pointercancel\", end, true);\n            this.release = undefined;\n        };\n        doc.addEventListener(\"pointerup\", end, true);\n        doc.addEventListener(\"pointercancel\", end, true);\n    }\n\n    /** The drag ended — its grab and proposal go. */\n    disarm(): void {\n        this.release?.();\n        if (this.grab === null && this.proposal === null) return;\n        this.grab = null;\n        this.proposal = null;\n        this.emit();\n    }\n\n    /**\n     * Where the pointer drag would land now — told only when it moved.\n     *\n     * @param p - The row and the extent\n     */\n    propose(p: PlanProposal): void {\n        if (sameProposal(this.proposal, p)) return;\n        this.proposal = p;\n        this.emit();\n    }\n\n    /**\n     * Start, move or end the keyboard carry.\n     *\n     * @param carry - The carry, or `null` when it ends\n     */\n    setCarry(carry: PlanCarry | null): void {\n        this.carry = carry;\n        this.emit();\n    }\n\n    /**\n     * The carry, when it lands on this row — the row draws its landing band.\n     *\n     * @param rowKey - The row\n     * @returns The carry, or `null`\n     */\n    carryOn(rowKey: RowKey): PlanCarry | null {\n        return this.carry !== null && this.carry.to.rowKey === rowKey ? this.carry : null;\n    }\n\n    /**\n     * Whether the keyboard carries this element now.\n     *\n     * @param rowKey - Its row\n     * @param key - Its key\n     * @returns Whether it is carried\n     */\n    carries(rowKey: RowKey, key: string): boolean {\n        return this.carry !== null && this.carry.movable.rowKey === rowKey && this.carry.movable.key === key;\n    }\n\n    /**\n     * Put words in the live region.\n     *\n     * @param text - The words\n     */\n    say(text: string): void {\n        this.said = { text, seq: (this.said?.seq ?? 0) + 1 };\n        this.emit();\n    }\n\n    /**\n     * Record an element's node, so a key pressed on it finds what it moves.\n     *\n     * @param node - The element's node\n     * @param movable - What it moves\n     */\n    register(node: Element, movable: PlanMovable): void {\n        this.nodes.set(node, movable);\n    }\n\n    /**\n     * What a node moves — `undefined` for a node that moves nothing.\n     *\n     * @param node - The focused node\n     * @returns Its movable\n     */\n    movableOf(node: Element): PlanMovable | undefined {\n        return this.nodes.get(node);\n    }\n\n    /**\n     * Ask for an element to be focused once the canvas has drawn — where a\n     * keyboard drop leaves it.\n     *\n     * @param rowKey - Its row\n     * @param key - Its key\n     */\n    focusAfterDraw(rowKey: RowKey, key: string): void {\n        this.focusAfter = { rowKey, key };\n    }\n\n    /**\n     * The element to focus now the canvas has drawn, once.\n     *\n     * @returns The element, or `null`\n     */\n    takeFocus(): { rowKey: RowKey; key: string } | null {\n        const f = this.focusAfter;\n        this.focusAfter = null;\n        return f;\n    }\n}\n\n/** What the canvas's rows and elements need to move one (#825). */\nexport interface PlanEditContextValue {\n    /** The moves in flight. */\n    store: PlanEditStore;\n    /** The canvas's drag surface — `undefined` while nothing can move (no session, no id, the narrow layout). */\n    surface: string | undefined;\n    /** Whether `data`'s rows take a move now: the root edits them, and its session takes a gesture (#880). */\n    dataMoves: boolean;\n    /**\n     * Typing a number into a table cell (#1436, #1438) — `undefined` while\n     * `data`'s rows take no gesture: no session, or one that takes none now.\n     */\n    typing: PlanTyping | undefined;\n    /**\n     * How an event kind's row's elements move (#1196) — `undefined` for a row\n     * that is no event kind's, and while the canvas takes no event's drag.\n     */\n    eventMove: ((row: PlanRowValue) => PlanRowMove | undefined) | undefined;\n    /** The id of the words that tell a keyboard reader how to move an element. */\n    helpId: string;\n    /** The Plan recipe's styles — the ghost's look. */\n    styles: Record<string, Record<string, unknown>>;\n    /** The canvas's words. */\n    words: PlanWords;\n    /** The shared scale. */\n    scale: PlanScale;\n}\n\n/** The canvas's moves (#825) — `null` outside a canvas that takes them. */\nexport const PlanEditContext = createContext<PlanEditContextValue | null>(null);\n\n/**\n * The canvas's moves.\n *\n * @returns What its rows and elements move with, or `null`\n */\nexport function usePlanEdit(): PlanEditContextValue | null {\n    return useContext(PlanEditContext);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * An element that moves (#825) — what a run bar, a chip, a tile or a mark\n * spreads to be picked up: its drag handle on the drag layer (#608), its two\n * end handles when it has two ends, and the ghost that follows the pointer.\n *\n * The pointer picks it up through the drag layer, which carries the drag —\n * the edge scroller, the veto on the event the drop would deliver, the\n * announcements. The press is recorded first (`PlanEditStore.arm`): what the\n * drag moves and where it was grabbed, which is how a row says where it lands.\n * The keyboard is the canvas's own (`use-carry.ts`): an element takes no key\n * from the layer, since its moves need keys the layer's arrows cannot carry —\n * an end moved with Shift or Alt, a row found by its item type.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore, type PointerEvent as ReactPointerEvent } from \"react\";\nimport { MoveGhost, useMoveGhostClasses } from \"../../shared/schedule/move-ghost.js\";\nimport { useDragEventChip, useDragEventEdge, type CellCoord, type DragHandle } from \"@elaraai/east-ui-components\";\nimport { slotOfInstant } from \"../../shared/time/slot.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanWords } from \"../words.js\";\nimport { usePlanEdit, type PlanEditContextValue, type PlanMovable, type PlanMoveMode, type PlanSpan } from \"./store.js\";\n\n/** What an element spreads to be picked up by the pointer, and described to the keyboard. */\nexport interface PlanElementHandle {\n    ref: (el: HTMLElement | null) => void;\n    onPointerDown: (e: ReactPointerEvent) => void;\n    \"data-draggable\": \"\";\n    \"aria-describedby\": string;\n}\n\n/** What an end handle spreads. */\nexport interface PlanEdgeHandle {\n    ref: (el: HTMLElement | null) => void;\n    onPointerDown: (e: ReactPointerEvent) => void;\n    \"data-plan-edge\": \"start\" | \"end\";\n}\n\n/** What {@link usePlanMovable} gives an element. */\nexport interface PlanMovableProps {\n    /** Spread onto the element — `undefined` when it does not move. */\n    handle: PlanElementHandle | undefined;\n    /** Its end handles, when it has two ends — spread each onto its handle. */\n    edges: { start: PlanEdgeHandle; end: PlanEdgeHandle } | undefined;\n    /** Whether the keyboard carries it now. */\n    carried: boolean;\n}\n\nconst NOTHING: PlanMovableProps = { handle: undefined, edges: undefined, carried: false };\nconst noSubscribe = () => () => undefined;\n\n/**\n * Where an element is, in words — a run's or a chip's span, a tile's or a\n * mark's instant.\n *\n * @param scale - The shared scale\n * @param movable - The element\n * @param span - Its extent\n * @param w - The canvas's words\n * @returns `Jul 13, 2026 – Aug 3, 2026`, or `Jul 13, 2026`\n */\nexport function spanWords(scale: PlanScale, movable: Pick<PlanMovable, \"resize\">, span: PlanSpan, w: PlanWords): string {\n    return movable.resize\n        ? w.m.span({ from: scale.instantText(span.start), to: scale.instantText(span.end) })\n        : scale.instantText(span.start);\n}\n\n/**\n * The ghost — the element's look beside the pointer, labelled with where it\n * would land. Drawn by the drag layer's overlay, outside the canvas, so it\n * takes what it shows as props.\n */\nfunction PlanMoveGhost({ edit, movable }: { edit: PlanEditContextValue; movable: PlanMovable }) {\n    const proposal = useSyncExternalStore(edit.store.subscribe, () => edit.store.proposal);\n    const span = proposal?.span ?? movable.span;\n    const styles = edit.styles;\n    return <MoveGhost styles={styles} label={movable.label} detail={spanWords(edit.scale, movable, span, edit.words)} planKind={movable.kind} />;\n}\n\n/**\n * An element's moves — its drag handle, its end handles and whether the\n * keyboard carries it (see the module docs).\n *\n * @param movable - The element, or `undefined` when its row takes no move\n * @returns What it spreads\n */\nexport function usePlanMovable(movable: PlanMovable | undefined): PlanMovableProps {\n    const edit = usePlanEdit();\n    // Its ghost's classes, made as the element is drawn, ahead of the drag that first draws one (#1594).\n    useMoveGhostClasses(edit?.styles);\n    const surface = edit?.surface;\n    const scale = edit?.scale;\n    const on = edit !== null && surface !== undefined && movable !== undefined;\n    // The drag grammar's `from`: the element's row, the bucket its start is\n    // in, and its key.\n    const startSlot = on && scale !== undefined ? slotOfInstant(scale, movable.span.start) : undefined;\n    const from = useMemo<Required<CellCoord> | null>(\n        () => (surface !== undefined && movable !== undefined && startSlot !== undefined\n            ? { surface, row: movable.rowKey, slot: startSlot, event: movable.key }\n            : null),\n        [surface, movable, startSlot]);\n    const ghost = useMemo(\n        () => (edit !== null && movable !== undefined ? <PlanMoveGhost edit={edit} movable={movable} /> : null),\n        [edit, movable]);\n    const label = movable?.label;\n    const moveHandle = useDragEventChip(on ? from : null, ghost, false, label);\n    const edgeFrom = on && movable.resize ? from : null;\n    const startHandle = useDragEventEdge(edgeFrom, \"start\", ghost, false, label);\n    const endHandle = useDragEventEdge(edgeFrom, \"end\", ghost, false, label);\n\n    /** Record the press — what the drag moves and where it was grabbed. */\n    const arm = useCallback((e: ReactPointerEvent, mode: PlanMoveMode) => {\n        if (edit === null || movable === undefined) return;\n        const plot = (e.currentTarget as HTMLElement).closest(\"[data-plan-plot]\");\n        const rect = plot?.getBoundingClientRect();\n        const grabFrac = rect !== undefined && rect.width > 0 ? (e.clientX - rect.left) / rect.width : 0;\n        edit.store.arm({ movable, mode, grabFrac }, (e.currentTarget as HTMLElement).ownerDocument);\n    }, [edit, movable]);\n\n    const handle = useMemo<PlanElementHandle | undefined>(() => {\n        if (edit === null || movable === undefined || moveHandle === undefined) return undefined;\n        const node = moveHandle.ref;\n        return {\n            ref: (el) => {\n                node(el);\n                if (el !== null) edit.store.register(el, movable);\n            },\n            onPointerDown: (e) => {\n                arm(e, \"move\");\n                moveHandle.onPointerDown?.(e);\n            },\n            \"data-draggable\": \"\",\n            \"aria-describedby\": edit.helpId,\n        };\n    }, [edit, movable, moveHandle, arm]);\n\n    const edgeOf = useCallback((h: DragHandle | undefined, which: \"start\" | \"end\"): PlanEdgeHandle | undefined => (h === undefined\n        ? undefined\n        : {\n            ref: h.ref,\n            onPointerDown: (e) => {\n                arm(e, which);\n                h.onPointerDown?.(e);\n                // The element's own press is a move: an end's press is not.\n                e.stopPropagation();\n            },\n            \"data-plan-edge\": which,\n        }), [arm]);\n    const edges = useMemo(() => {\n        const start = edgeOf(startHandle, \"start\");\n        const end = edgeOf(endHandle, \"end\");\n        return start !== undefined && end !== undefined ? { start, end } : undefined;\n    }, [edgeOf, startHandle, endHandle]);\n\n    const carried = useSyncExternalStore(\n        edit !== null ? edit.store.subscribe : noSubscribe,\n        () => (edit !== null && movable !== undefined ? edit.store.carries(movable.rowKey, movable.key) : false));\n    if (!on) return carried ? { ...NOTHING, carried } : NOTHING;\n    return { handle, edges, carried };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The keyboard's move (#825) — Space on an element picks it up, and the canvas\n * carries it by keys:\n *\n * | Key | While carrying |\n * |---|---|\n * | ← / → | move it one bucket |\n * | Shift + ← / → | move its end one bucket (a run, a chip) |\n * | Alt + ← / → | move its start one bucket |\n * | ↑ / ↓ | to the nearest row above / below that takes its item type |\n * | Space / Enter | drop it — a refused place is said, and the carry goes on |\n * | Escape / Tab | cancel — it stays where it was |\n *\n * Where it would land draws as the target row's landing band, the element\n * itself dims, and each step is said in the carry's live region: the row and\n * the span, or that the canvas's `canDrop` refuses it there — asked of the\n * very event the drop would deliver, as the pointer's drag is. An event kind's\n * element (#1196) is judged by the event kinds' drag instead, which says why\n * it refuses, as its ghost does; the steps it is carried are the units its\n * event's times move by, and a selection's with it.\n *\n * The carry is the canvas's, not the drag layer's keyboard sensor's (#608):\n * the layer's arrows move a resting point between cells, which cannot say\n * \"move only the end\" or \"the next row of this item type\".\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { none, some, variant } from \"@elaraai/east\";\nimport type { DragEventValue, DropVeto } from \"@elaraai/east-ui-components\";\nimport { NO_STEPS, stepSpan } from \"../../shared/time/drag.js\";\nimport { slotOfEnd, slotOfInstant } from \"../../shared/time/slot.js\";\nimport { equalInstants } from \"../instant.js\";\nimport type { PlanRowValue, VisibleRow } from \"../model.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanWords } from \"../words.js\";\nimport { spanWords } from \"./movable.js\";\nimport type { PlanCarry, PlanEditStore, PlanMovable, PlanProposal, PlanSpan } from \"./store.js\";\n\n/** One move, as the editing session writes it. */\nexport interface PlanMoveRequest {\n    /** The element's key — its item's. */\n    key: string;\n    /** The row it leaves. */\n    from: RowKey;\n    /** The row it lands on (`from` for a move along its row, or a resize). */\n    to: RowKey;\n    /** Its extent there. */\n    span: PlanSpan;\n    /** Whether it moved, or only an end did. */\n    origin: \"move\" | \"resize\";\n    /** Its name, for the transaction's label. */\n    label: string;\n    /** The element as it was picked up (#1196): an event kind's moves its event, and a selection with it. */\n    element?: PlanMovable | undefined;\n    /** The units it moved by — the buckets crossed, or the keyboard's steps (#1196). */\n    units?: number | undefined;\n    /** Whether `units` are Shift's finer ones. */\n    fine?: boolean | undefined;\n}\n\n/** A landing judged by the event kinds' drag (#1196): whether it is taken, and why not. */\nexport interface PlanCarryVerdict {\n    /** Whether it lands. */\n    readonly allowed: boolean;\n    /** Why it does not — what its ghost says, in red. */\n    readonly reason: string | undefined;\n}\n\n/** What a gesture did — moved the element, or only one of its ends. */\nexport type PlanMoveOrigin = { kind: \"move\" } | { kind: \"resize\"; edge: \"start\" | \"end\" };\n\n/**\n * Whether a landing is where the element already is — nothing to write.\n *\n * @param movable - The element\n * @param to - Where it lands\n * @returns Whether nothing moved\n */\nexport function unmoved(movable: PlanMovable, to: PlanProposal): boolean {\n    return to.rowKey === movable.rowKey && equalInstants(to.span.start, movable.span.start) && equalInstants(to.span.end, movable.span.end);\n}\n\n/**\n * What a landing does: a resize when the element stays on its row and only\n * one end moved, else a move.\n *\n * @param movable - The element\n * @param to - Where it lands\n * @returns The gesture's kind\n */\nexport function originOf(movable: PlanMovable, to: PlanProposal): PlanMoveOrigin {\n    if (!movable.resize || to.rowKey !== movable.rowKey) return { kind: \"move\" };\n    const startMoved = !equalInstants(to.span.start, movable.span.start);\n    const endMoved = !equalInstants(to.span.end, movable.span.end);\n    if (startMoved && !endMoved) return { kind: \"resize\", edge: \"start\" };\n    if (endMoved && !startMoved) return { kind: \"resize\", edge: \"end\" };\n    return { kind: \"move\" };\n}\n\n/**\n * Whether a row draws an element keyed `key` — a run, chip, tile or mark. A\n * row's items keep their keys unique (a move finds its item by key), so a\n * moved element lands on ANOTHER row only where none of its elements has the\n * key: the write would refuse it, and the drag says so before the drop.\n *\n * @param row - The row, as the canvas draws it (its drafts included)\n * @param key - The moved element's key\n * @returns Whether one of the row's elements has the key\n */\nexport function holdsKey(row: PlanRowValue, key: string): boolean {\n    const kind = row.kind;\n    switch (kind.type) {\n        case \"span\": return kind.value.runs.some((r) => r.key === key);\n        case \"cards\": return kind.value.chips.some((c) => c.key === key);\n        case \"buckets\": return kind.value.events.some((e) => e.key === key);\n        case \"events\": return kind.value.marks.some((m) => m.key === key);\n        default: return false;\n    }\n}\n\n/**\n * The drag event a landing would deliver — what the canvas's `canDrop` is\n * asked: a `move` from the element's start bucket to its new start's, or a\n * `resize` naming the moved end's bucket.\n *\n * @param surface - The canvas's drag surface\n * @param scale - The shared scale\n * @param movable - The element\n * @param to - Where it lands\n * @returns The candidate event\n */\nexport function candidateOf(surface: string, scale: PlanScale, movable: PlanMovable, to: PlanProposal): DragEventValue {\n    const from = { surface, row: movable.rowKey, slot: slotOfInstant(scale, movable.span.start), event: some(movable.key) };\n    const origin = originOf(movable, to);\n    if (origin.kind === \"resize\") {\n        const slot = origin.edge === \"end\" ? slotOfEnd(scale, to.span.end) : slotOfInstant(scale, to.span.start);\n        return variant(\"resize\", { event: { ...from, slot }, edge: variant(origin.edge, null) }) as DragEventValue;\n    }\n    return variant(\"move\", {\n        from,\n        to: { surface, row: to.rowKey, slot: slotOfInstant(scale, to.span.start), event: none },\n    }) as DragEventValue;\n}\n\n/** What the carry reads of the canvas. */\nexport interface PlanCarryDeps {\n    /** The moves in flight. */\n    store: PlanEditStore;\n    /** The shared scale. */\n    scale: PlanScale | undefined;\n    /** The canvas's words. */\n    words: PlanWords;\n    /** The canvas's drag surface — `undefined` while nothing can move. */\n    surface: string | undefined;\n    /** The canvas's veto over a drop (`canDrop`). */\n    veto: DropVeto | undefined;\n    /** The rows as the canvas draws them — ↑ / ↓ walk them. */\n    rows: readonly VisibleRow[];\n    /** Whether a row takes the moved element: one of its item type, or an event kind's on a resource its kind takes (#1196). */\n    takes: (row: PlanRowValue, movable: PlanMovable) => boolean;\n    /**\n     * The event kinds' verdict over an event kind's element landing (#1196);\n     * `undefined` for an element of `data`'s, which `veto` vets.\n     */\n    judge?: ((movable: PlanMovable, to: PlanProposal) => PlanCarryVerdict | undefined) | undefined;\n    /** A row's name. */\n    labelOf: (rowKey: RowKey) => string;\n    /** Write a move as one gesture — whether it was drafted. */\n    move: (m: PlanMoveRequest) => boolean;\n    /** Bring a row into view. */\n    reveal: (rowKey: RowKey) => void;\n    /** Focus an element where it is now. */\n    focus: (rowKey: RowKey, key: string) => void;\n}\n\n/** What {@link usePlanCarry} gives the canvas. */\nexport interface PlanCarryKeys {\n    /** Pick up the element a node is — whether it moves. */\n    start(node: Element): boolean;\n    /** A key while carrying — whether the carry took it. */\n    keys(e: { key: string; shiftKey: boolean; altKey: boolean; ctrlKey: boolean; metaKey: boolean; preventDefault(): void }): boolean;\n    /** End a carry without a drop, leaving focus where it went — the reader left the canvas. */\n    cancel(): void;\n}\n\n/**\n * The keyboard's move — see the module docs.\n *\n * @param deps - What the carry reads of the canvas (the latest render's)\n * @returns Its start and its keys, stable\n */\nexport function usePlanCarry(deps: PlanCarryDeps): PlanCarryKeys {\n    const latest = useRef(deps);\n    latest.current = deps;\n\n    /** Where the carried element lands now — said, and asked of the veto. */\n    const rest = useCallback((carry: PlanCarry, to: PlanProposal, picked: boolean) => {\n        const { store, scale, surface, veto, judge, words, labelOf, rows } = latest.current;\n        if (scale === undefined || surface === undefined) return;\n        // Another row already drawing the element's key cannot take it (#825).\n        const target = to.rowKey === carry.movable.rowKey ? undefined : rows.find((v) => v.row.key === to.rowKey)?.row;\n        // An event kind's element is the event kinds' to judge (#1196), and they say why not.\n        const judged = unmoved(carry.movable, to) ? undefined : judge?.(carry.movable, to);\n        const refused = (target !== undefined && holdsKey(target, carry.movable.key))\n            || (judged !== undefined ? !judged.allowed\n                : veto !== undefined && !unmoved(carry.movable, to) && !veto(candidateOf(surface, scale, carry.movable, to)));\n        store.setCarry({ movable: carry.movable, to, refused });\n        const p = { item: carry.movable.label, target: labelOf(to.rowKey), span: spanWords(scale, carry.movable, to.span, words) };\n        store.say(picked ? words.m.movePickedUp(p) : refused ? words.m.moveRefused({ ...p, reason: judged?.reason }) : words.m.moveOver(p));\n    }, []);\n\n    const end = useCallback((carry: PlanCarry, dropped: boolean, refocus = true) => {\n        const { store, scale, words, labelOf, move, focus } = latest.current;\n        const { movable, to } = carry;\n        store.setCarry(null);\n        if (!dropped || scale === undefined || unmoved(movable, to)) {\n            store.say(words.m.moveCancelled({ item: movable.label }));\n            if (refocus) focus(movable.rowKey, movable.key);\n            return;\n        }\n        const written = move({\n            key: movable.key, from: movable.rowKey, to: to.rowKey, span: to.span,\n            origin: originOf(movable, to).kind, label: movable.label,\n            element: movable, units: to.units, fine: to.fine,\n        });\n        if (!written) {\n            store.say(words.m.moveFailed({ item: movable.label }));\n            focus(movable.rowKey, movable.key);\n            return;\n        }\n        store.say(words.m.moveDropped({ item: movable.label, target: labelOf(to.rowKey), span: spanWords(scale, movable, to.span, words) }));\n        // The element is drawn anew with the draft — focus it there.\n        store.focusAfterDraw(to.rowKey, movable.key);\n    }, []);\n\n    const start = useCallback((node: Element): boolean => {\n        const { store, scale, surface } = latest.current;\n        const movable = store.movableOf(node);\n        if (movable === undefined || scale === undefined || surface === undefined) return false;\n        const carry: PlanCarry = { movable, to: { rowKey: movable.rowKey, span: movable.span }, refused: false };\n        rest(carry, carry.to, true);\n        return true;\n    }, [rest]);\n\n    const keys = useCallback((e: Parameters<PlanCarryKeys[\"keys\"]>[0]): boolean => {\n        const { store, scale, rows, takes, reveal } = latest.current;\n        const carry = store.carry;\n        if (carry === null || scale === undefined) return false;\n        // A shortcut (undo, a copy) ends the carry and goes on to do its work.\n        if (e.ctrlKey || e.metaKey) {\n            end(carry, false);\n            return false;\n        }\n        switch (e.key) {\n            case \"ArrowLeft\": case \"ArrowRight\": {\n                e.preventDefault();\n                const mode = e.shiftKey ? \"end\" : e.altKey ? \"start\" : \"move\";\n                // A tile or a mark has one instant: no end to move.\n                if (mode !== \"move\" && !carry.movable.resize) return true;\n                const step = e.key === \"ArrowRight\" ? 1 : -1;\n                // A step of the whole element is a unit its event's times move by (#1196); an end's is not.\n                const units = mode === \"move\" ? (carry.to.units ?? 0) + step : carry.to.units;\n                // Each step counted from the element as it was picked up, so steps taken back land it where it began.\n                const was = carry.to.steps ?? NO_STEPS;\n                const steps = { move: was.move + (mode === \"move\" ? step : 0), start: was.start + (mode === \"start\" ? step : 0), end: was.end + (mode === \"end\" ? step : 0) };\n                rest(carry, { rowKey: carry.to.rowKey, span: stepSpan(scale, carry.movable.span, steps), units, steps, fine: false }, false);\n                return true;\n            }\n            case \"ArrowUp\": case \"ArrowDown\": {\n                e.preventDefault();\n                const dir = e.key === \"ArrowDown\" ? 1 : -1;\n                const at = rows.findIndex((v) => v.row.key === carry.to.rowKey);\n                for (let i = at + dir; at >= 0 && i >= 0 && i < rows.length; i += dir) {\n                    const row = rows[i]!.row;\n                    if (!takes(row, carry.movable)) continue;\n                    rest(carry, { rowKey: row.key, span: carry.to.span, units: carry.to.units, steps: carry.to.steps, fine: carry.to.fine }, false);\n                    reveal(row.key);\n                    break;\n                }\n                return true;\n            }\n            case \" \": case \"Enter\": {\n                e.preventDefault();\n                if (carry.refused) {\n                    // Refused here: said again, and the carry goes on.\n                    rest(carry, carry.to, false);\n                    return true;\n                }\n                end(carry, true);\n                return true;\n            }\n            case \"Escape\": case \"Tab\":\n                e.preventDefault();\n                end(carry, false);\n                return true;\n            default:\n                // Nothing else acts on the canvas while it carries an element.\n                e.preventDefault();\n                return true;\n        }\n    }, [rest, end]);\n\n    const cancel = useCallback(() => {\n        const carry = latest.current.store.carry;\n        if (carry !== null) end(carry, false, false);\n    }, [end]);\n\n    return useMemo(() => ({ start, keys, cancel }), [start, keys, cancel]);\n}\n","export function initRange(domain, range) {\n  switch (arguments.length) {\n    case 0: break;\n    case 1: this.range(domain); break;\n    default: this.range(range).domain(domain); break;\n  }\n  return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n  switch (arguments.length) {\n    case 0: break;\n    case 1: {\n      if (typeof domain === \"function\") this.interpolator(domain);\n      else this.range(domain);\n      break;\n    }\n    default: {\n      this.domain(domain);\n      if (typeof interpolator === \"function\") this.interpolator(interpolator);\n      else this.range(interpolator);\n      break;\n    }\n  }\n  return this;\n}\n","export default function constants(x) {\n  return function() {\n    return x;\n  };\n}\n","export default function number(x) {\n  return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n  return x;\n}\n\nfunction normalize(a, b) {\n  return (b -= (a = +a))\n      ? function(x) { return (x - a) / b; }\n      : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n  var t;\n  if (a > b) t = a, a = b, b = t;\n  return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n  var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n  if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n  else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n  return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n  var j = Math.min(domain.length, range.length) - 1,\n      d = new Array(j),\n      r = new Array(j),\n      i = -1;\n\n  // Reverse descending domains.\n  if (domain[j] < domain[0]) {\n    domain = domain.slice().reverse();\n    range = range.slice().reverse();\n  }\n\n  while (++i < j) {\n    d[i] = normalize(domain[i], domain[i + 1]);\n    r[i] = interpolate(range[i], range[i + 1]);\n  }\n\n  return function(x) {\n    var i = bisect(domain, x, 1, j) - 1;\n    return r[i](d[i](x));\n  };\n}\n\nexport function copy(source, target) {\n  return target\n      .domain(source.domain())\n      .range(source.range())\n      .interpolate(source.interpolate())\n      .clamp(source.clamp())\n      .unknown(source.unknown());\n}\n\nexport function transformer() {\n  var domain = unit,\n      range = unit,\n      interpolate = interpolateValue,\n      transform,\n      untransform,\n      unknown,\n      clamp = identity,\n      piecewise,\n      output,\n      input;\n\n  function rescale() {\n    var n = Math.min(domain.length, range.length);\n    if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n    piecewise = n > 2 ? polymap : bimap;\n    output = input = null;\n    return scale;\n  }\n\n  function scale(x) {\n    return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n  }\n\n  scale.invert = function(y) {\n    return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n  };\n\n  scale.domain = function(_) {\n    return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n  };\n\n  scale.range = function(_) {\n    return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n  };\n\n  scale.rangeRound = function(_) {\n    return range = Array.from(_), interpolate = interpolateRound, rescale();\n  };\n\n  scale.clamp = function(_) {\n    return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n  };\n\n  scale.interpolate = function(_) {\n    return arguments.length ? (interpolate = _, rescale()) : interpolate;\n  };\n\n  scale.unknown = function(_) {\n    return arguments.length ? (unknown = _, scale) : unknown;\n  };\n\n  return function(t, u) {\n    transform = t, untransform = u;\n    return rescale();\n  };\n}\n\nexport default function continuous() {\n  return transformer()(identity, identity);\n}\n","export default function(x) {\n  return Math.abs(x = Math.round(x)) >= 1e21\n      ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n      : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n  if (!isFinite(x) || x === 0) return null; // NaN, ±Infinity, ±0\n  var i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\"), coefficient = x.slice(0, i);\n\n  // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n  // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n  return [\n    coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n    +x.slice(i + 1)\n  ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n  return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","export default function(grouping, thousands) {\n  return function(value, width) {\n    var i = value.length,\n        t = [],\n        j = 0,\n        g = grouping[0],\n        length = 0;\n\n    while (i > 0 && g > 0) {\n      if (length + g + 1 > width) g = Math.max(1, width - length);\n      t.push(value.substring(i -= g, i + g));\n      if ((length += g + 1) > width) break;\n      g = grouping[j = (j + 1) % grouping.length];\n    }\n\n    return t.reverse().join(thousands);\n  };\n}\n","export default function(numerals) {\n  return function(value) {\n    return value.replace(/[0-9]/g, function(i) {\n      return numerals[+i];\n    });\n  };\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n  if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n  var match;\n  return new FormatSpecifier({\n    fill: match[1],\n    align: match[2],\n    sign: match[3],\n    symbol: match[4],\n    zero: match[5],\n    width: match[6],\n    comma: match[7],\n    precision: match[8] && match[8].slice(1),\n    trim: match[9],\n    type: match[10]\n  });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n  this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n  this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n  this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n  this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n  this.zero = !!specifier.zero;\n  this.width = specifier.width === undefined ? undefined : +specifier.width;\n  this.comma = !!specifier.comma;\n  this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n  this.trim = !!specifier.trim;\n  this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n  return this.fill\n      + this.align\n      + this.sign\n      + this.symbol\n      + (this.zero ? \"0\" : \"\")\n      + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n      + (this.comma ? \",\" : \"\")\n      + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n      + (this.trim ? \"~\" : \"\")\n      + this.type;\n};\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n  out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n    switch (s[i]) {\n      case \".\": i0 = i1 = i; break;\n      case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n      default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n    }\n  }\n  return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n  var d = formatDecimalParts(x, p);\n  if (!d) return prefixExponent = undefined, x.toPrecision(p);\n  var coefficient = d[0],\n      exponent = d[1],\n      i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n      n = coefficient.length;\n  return i === n ? coefficient\n      : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n      : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n      : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n  var d = formatDecimalParts(x, p);\n  if (!d) return x + \"\";\n  var coefficient = d[0],\n      exponent = d[1];\n  return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n      : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n      : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n  \"%\": (x, p) => (x * 100).toFixed(p),\n  \"b\": (x) => Math.round(x).toString(2),\n  \"c\": (x) => x + \"\",\n  \"d\": formatDecimal,\n  \"e\": (x, p) => x.toExponential(p),\n  \"f\": (x, p) => x.toFixed(p),\n  \"g\": (x, p) => x.toPrecision(p),\n  \"o\": (x) => Math.round(x).toString(8),\n  \"p\": (x, p) => formatRounded(x * 100, p),\n  \"r\": formatRounded,\n  \"s\": formatPrefixAuto,\n  \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n  \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n  return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n    prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n  var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n      currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n      currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n      decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n      numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n      percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n      minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n      nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n  function newFormat(specifier, options) {\n    specifier = formatSpecifier(specifier);\n\n    var fill = specifier.fill,\n        align = specifier.align,\n        sign = specifier.sign,\n        symbol = specifier.symbol,\n        zero = specifier.zero,\n        width = specifier.width,\n        comma = specifier.comma,\n        precision = specifier.precision,\n        trim = specifier.trim,\n        type = specifier.type;\n\n    // The \"n\" type is an alias for \",g\".\n    if (type === \"n\") comma = true, type = \"g\";\n\n    // The \"\" type, and any invalid type, is an alias for \".12~g\".\n    else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n    // If zero fill is specified, padding goes after sign and before digits.\n    if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n    // Compute the prefix and suffix.\n    // For SI-prefix, the suffix is lazily computed.\n    var prefix = (options && options.prefix !== undefined ? options.prefix : \"\") + (symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\"),\n        suffix = (symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\") + (options && options.suffix !== undefined ? options.suffix : \"\");\n\n    // What format function should we use?\n    // Is this an integer type?\n    // Can this type generate exponential notation?\n    var formatType = formatTypes[type],\n        maybeSuffix = /[defgprs%]/.test(type);\n\n    // Set the default precision if not specified,\n    // or clamp the specified precision to the supported range.\n    // For significant precision, it must be in [1, 21].\n    // For fixed precision, it must be in [0, 20].\n    precision = precision === undefined ? 6\n        : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n        : Math.max(0, Math.min(20, precision));\n\n    function format(value) {\n      var valuePrefix = prefix,\n          valueSuffix = suffix,\n          i, n, c;\n\n      if (type === \"c\") {\n        valueSuffix = formatType(value) + valueSuffix;\n        value = \"\";\n      } else {\n        value = +value;\n\n        // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n        var valueNegative = value < 0 || 1 / value < 0;\n\n        // Perform the initial formatting.\n        value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n        // Trim insignificant zeros.\n        if (trim) value = formatTrim(value);\n\n        // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n        if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n        // Compute the prefix and suffix.\n        valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n        valueSuffix = (type === \"s\" && !isNaN(value) && prefixExponent !== undefined ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n        // Break the formatted value into the integer “value” part that can be\n        // grouped, and fractional or exponential “suffix” part that is not.\n        if (maybeSuffix) {\n          i = -1, n = value.length;\n          while (++i < n) {\n            if (c = value.charCodeAt(i), 48 > c || c > 57) {\n              valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n              value = value.slice(0, i);\n              break;\n            }\n          }\n        }\n      }\n\n      // If the fill character is not \"0\", grouping is applied before padding.\n      if (comma && !zero) value = group(value, Infinity);\n\n      // Compute the padding.\n      var length = valuePrefix.length + value.length + valueSuffix.length,\n          padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n      // If the fill character is \"0\", grouping is applied after padding.\n      if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n      // Reconstruct the final output based on the desired alignment.\n      switch (align) {\n        case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n        case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n        case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n        default: value = padding + valuePrefix + value + valueSuffix; break;\n      }\n\n      return numerals(value);\n    }\n\n    format.toString = function() {\n      return specifier + \"\";\n    };\n\n    return format;\n  }\n\n  function formatPrefix(specifier, value) {\n    var e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n        k = Math.pow(10, -e),\n        f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier), {suffix: prefixes[8 + e / 3]});\n    return function(value) {\n      return f(k * value);\n    };\n  }\n\n  return {\n    format: newFormat,\n    formatPrefix: formatPrefix\n  };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n  thousands: \",\",\n  grouping: [3],\n  currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n  locale = formatLocale(definition);\n  format = locale.format;\n  formatPrefix = locale.formatPrefix;\n  return locale;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n  return Math.max(0, -exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n  step = Math.abs(step), max = Math.abs(max) - step;\n  return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n  var step = tickStep(start, stop, count),\n      precision;\n  specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n  switch (specifier.type) {\n    case \"s\": {\n      var value = Math.max(Math.abs(start), Math.abs(stop));\n      if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n      return formatPrefix(specifier, value);\n    }\n    case \"\":\n    case \"e\":\n    case \"g\":\n    case \"p\":\n    case \"r\": {\n      if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n      break;\n    }\n    case \"f\":\n    case \"%\": {\n      if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n      break;\n    }\n  }\n  return format(specifier);\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n  var domain = scale.domain;\n\n  scale.ticks = function(count) {\n    var d = domain();\n    return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n  };\n\n  scale.tickFormat = function(count, specifier) {\n    var d = domain();\n    return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n  };\n\n  scale.nice = function(count) {\n    if (count == null) count = 10;\n\n    var d = domain();\n    var i0 = 0;\n    var i1 = d.length - 1;\n    var start = d[i0];\n    var stop = d[i1];\n    var prestep;\n    var step;\n    var maxIter = 10;\n\n    if (stop < start) {\n      step = start, start = stop, stop = step;\n      step = i0, i0 = i1, i1 = step;\n    }\n    \n    while (maxIter-- > 0) {\n      step = tickIncrement(start, stop, count);\n      if (step === prestep) {\n        d[i0] = start\n        d[i1] = stop\n        return domain(d);\n      } else if (step > 0) {\n        start = Math.floor(start / step) * step;\n        stop = Math.ceil(stop / step) * step;\n      } else if (step < 0) {\n        start = Math.ceil(start * step) / step;\n        stop = Math.floor(stop * step) / step;\n      } else {\n        break;\n      }\n      prestep = step;\n    }\n\n    return scale;\n  };\n\n  return scale;\n}\n\nexport default function linear() {\n  var scale = continuous();\n\n  scale.copy = function() {\n    return copy(scale, linear());\n  };\n\n  initRange.apply(scale, arguments);\n\n  return linearish(scale);\n}\n","export default function applyDomain(scale, config) {\n  if (config.domain) {\n    if ('nice' in scale || 'quantiles' in scale) {\n      // continuous input scales\n      scale.domain(config.domain);\n    } else if ('padding' in scale) {\n      // point and band scales\n      scale.domain(config.domain);\n    } else {\n      // ordinal and threshold scale\n      scale.domain(config.domain);\n    }\n  }\n}","export default function applyRange(scale, config) {\n  if (config.range) {\n    if ('padding' in scale) {\n      // point and band scales\n      scale.range(config.range);\n    } else {\n      // the rest\n      scale.range(config.range);\n    }\n  }\n}","export default function applyAlign(scale, config) {\n  if ('align' in scale && 'align' in config && typeof config.align !== 'undefined') {\n    scale.align(config.align);\n  }\n}","export default function applyBase(scale, config) {\n  if ('base' in scale && 'base' in config && typeof config.base !== 'undefined') {\n    scale.base(config.base);\n  }\n}","export default function applyClamp(scale, config) {\n  if ('clamp' in scale && 'clamp' in config && typeof config.clamp !== 'undefined') {\n    scale.clamp(config.clamp);\n  }\n}","export default function applyConstant(scale, config) {\n  if ('constant' in scale && 'constant' in config && typeof config.constant !== 'undefined') {\n    scale.constant(config.constant);\n  }\n}","export default function applyExponent(scale, config) {\n  if ('exponent' in scale && 'exponent' in config && typeof config.exponent !== 'undefined') {\n    scale.exponent(config.exponent);\n  }\n}","import { interpolateRgb, interpolateLab, interpolateHcl, interpolateHclLong, interpolateHsl, interpolateHslLong, interpolateCubehelix, interpolateCubehelixLong } from '@visx/vendor/d3-interpolate';\nvar interpolatorMap = {\n  lab: interpolateLab,\n  hcl: interpolateHcl,\n  'hcl-long': interpolateHclLong,\n  hsl: interpolateHsl,\n  'hsl-long': interpolateHslLong,\n  cubehelix: interpolateCubehelix,\n  'cubehelix-long': interpolateCubehelixLong,\n  rgb: interpolateRgb\n};\nexport default function createColorInterpolator(interpolate) {\n  switch (interpolate) {\n    case 'lab':\n    case 'hcl':\n    case 'hcl-long':\n    case 'hsl':\n    case 'hsl-long':\n    case 'cubehelix':\n    case 'cubehelix-long':\n    case 'rgb':\n      return interpolatorMap[interpolate];\n    default:\n  }\n  var type = interpolate.type,\n    gamma = interpolate.gamma;\n  var interpolator = interpolatorMap[type];\n  return typeof gamma === 'undefined' ? interpolator : interpolator.gamma(gamma);\n}","import createColorInterpolator from '../utils/createColorInterpolator';\nexport default function applyInterpolate(scale, config) {\n  if ('interpolate' in config && 'interpolate' in scale && typeof config.interpolate !== 'undefined') {\n    var interpolator = createColorInterpolator(config.interpolate);\n    scale.interpolate(interpolator);\n  }\n}","var TEST_TIME = new Date(Date.UTC(2020, 1, 2, 3, 4, 5));\nvar TEST_FORMAT = '%Y-%m-%d %H:%M';\n\n/**\n * Check if the scale is UTC or Time scale\n * When local time is equal to UTC, always return true\n * @param scale time or utc scale\n */\nexport default function isUtcScale(scale) {\n  // The only difference between time and utc scale is\n  // whether the tick format function is utcFormat or timeFormat\n  var output = scale.tickFormat(1, TEST_FORMAT)(TEST_TIME);\n  return output === '2020-02-02 03:04';\n}","import { timeSecond, timeMinute, timeHour, timeDay, timeYear, timeMonth, timeWeek, utcSecond, utcMinute, utcHour, utcDay, utcWeek, utcMonth, utcYear } from '@visx/vendor/d3-time';\nimport isUtcScale from '../utils/isUtcScale';\nvar localTimeIntervals = {\n  day: timeDay,\n  hour: timeHour,\n  minute: timeMinute,\n  month: timeMonth,\n  second: timeSecond,\n  week: timeWeek,\n  year: timeYear\n};\nvar utcIntervals = {\n  day: utcDay,\n  hour: utcHour,\n  minute: utcMinute,\n  month: utcMonth,\n  second: utcSecond,\n  week: utcWeek,\n  year: utcYear\n};\nexport default function applyNice(scale, config) {\n  if ('nice' in config && typeof config.nice !== 'undefined' && 'nice' in scale) {\n    var nice = config.nice;\n    if (typeof nice === 'boolean') {\n      if (nice) {\n        scale.nice();\n      }\n    } else if (typeof nice === 'number') {\n      scale.nice(nice);\n    } else {\n      var timeScale = scale;\n      var isUtc = isUtcScale(timeScale);\n      if (typeof nice === 'string') {\n        timeScale.nice(isUtc ? utcIntervals[nice] : localTimeIntervals[nice]);\n      } else {\n        var interval = nice.interval,\n          step = nice.step;\n        var parsedInterval = (isUtc ? utcIntervals[interval] : localTimeIntervals[interval]).every(step);\n        if (parsedInterval != null) {\n          timeScale.nice(parsedInterval);\n        }\n      }\n    }\n  }\n}","export default function applyPadding(scale, config) {\n  if ('padding' in scale && 'padding' in config && typeof config.padding !== 'undefined') {\n    scale.padding(config.padding);\n  }\n  if ('paddingInner' in scale && 'paddingInner' in config && typeof config.paddingInner !== 'undefined') {\n    scale.paddingInner(config.paddingInner);\n  }\n  if ('paddingOuter' in scale && 'paddingOuter' in config && typeof config.paddingOuter !== 'undefined') {\n    scale.paddingOuter(config.paddingOuter);\n  }\n}","export default function applyReverse(scale, config) {\n  if (config.reverse) {\n    var reversedRange = scale.range().slice().reverse();\n    if ('padding' in scale) {\n      // point and band scales\n      scale.range(reversedRange);\n    } else {\n      // the rest\n      scale.range(reversedRange);\n    }\n  }\n}","import { interpolateRound } from '@visx/vendor/d3-interpolate';\nexport default function applyRound(scale, config) {\n  if ('round' in config && typeof config.round !== 'undefined') {\n    if (config.round && 'interpolate' in config && typeof config.interpolate !== 'undefined') {\n      console.warn(\"[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:\", config);\n    } else if ('round' in scale) {\n      // for point and band scales\n      scale.round(config.round);\n    } else if ('interpolate' in scale && config.round) {\n      // for continuous output scales\n      // setting config.round = true\n      // is actually setting interpolator to interpolateRound\n      // as these scales do not have scale.round() function\n      scale.interpolate(interpolateRound);\n    }\n  }\n}","export default function applyUnknown(scale, config) {\n  if ('unknown' in scale && 'unknown' in config && typeof config.unknown !== 'undefined') {\n    scale.unknown(config.unknown);\n  }\n}","export default function applyZero(scale, config) {\n  if ('zero' in config && config.zero === true) {\n    var domain = scale.domain();\n    var a = domain[0],\n      b = domain[1];\n    var isDescending = b < a;\n    var _ref = isDescending ? [b, a] : [a, b],\n      min = _ref[0],\n      max = _ref[1];\n    var domainWithZero = [Math.min(0, min), Math.max(0, max)];\n    scale.domain(isDescending ? domainWithZero.reverse() : domainWithZero);\n  }\n}","import domain from './domain';\nimport range from './range';\nimport align from './align';\nimport base from './base';\nimport clamp from './clamp';\nimport constant from './constant';\nimport exponent from './exponent';\nimport interpolate from './interpolate';\nimport nice from './nice';\nimport padding from './padding';\nimport reverse from './reverse';\nimport round from './round';\nimport unknown from './unknown';\nimport zero from './zero';\n\n/**\n * List of all operators, in order of execution\n */\nexport var ALL_OPERATORS = [\n// domain => nice => zero\n'domain', 'nice', 'zero',\n// interpolate before round\n'interpolate', 'round',\n// set range then reverse\n'range', 'reverse',\n// Order does not matter for these operators\n'align', 'base', 'clamp', 'constant', 'exponent', 'padding', 'unknown'];\n// Use Record to enforce that all keys in OperatorType must exist.\nvar operators = {\n  domain: domain,\n  nice: nice,\n  zero: zero,\n  interpolate: interpolate,\n  round: round,\n  align: align,\n  base: base,\n  clamp: clamp,\n  constant: constant,\n  exponent: exponent,\n  padding: padding,\n  range: range,\n  reverse: reverse,\n  unknown: unknown\n};\nexport default function scaleOperator() {\n  for (var _len = arguments.length, ops = new Array(_len), _key = 0; _key < _len; _key++) {\n    ops[_key] = arguments[_key];\n  }\n  var selection = new Set(ops);\n  var selectedOps = ALL_OPERATORS.filter(function (o) {\n    return selection.has(o);\n  });\n  return function applyOperators(scale, config) {\n    if (typeof config !== 'undefined') {\n      selectedOps.forEach(function (op) {\n        operators[op](scale, config);\n      });\n    }\n    return scale;\n  };\n}","import { scaleLinear } from '@visx/vendor/d3-scale';\nimport scaleOperator from '../operators/scaleOperator';\nexport var updateLinearScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round', 'zero');\nexport default function createLinearScale(config) {\n  return updateLinearScale(scaleLinear(), config);\n}","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A chart row's geometry as numbers (#743) — the columns' stacked extents,\n * the value domain each axis side spans, the points a continuous series\n * draws, and each layer's value per bucket. The marks, the gutter ticks and\n * the crosshair readout all read it, so an axis can never label a scale the\n * marks do not use.\n *\n * Everything here is in DATA units and window FRACTIONS — the row maps them\n * into its viewBox. Positions are the scale's UNCLAMPED `fracOf`: clamping a\n * vertex to the window edge moves the data (a line then meets the edge at the\n * wrong value), where clipping the drawn segment does not.\n *\n * A point whose `y` is not finite (`NaN`) is a GAP: lines and areas break\n * there instead of interpolating across it, and it counts toward no domain.\n *\n * @packageDocumentation\n */\n\nimport { scaleLinear } from \"@visx/scale\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { tickFormatter } from \"@elaraai/east-ui-components/internal\";\nimport { formatters } from \"@elaraai/east-ui-components\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanWords } from \"../words.js\";\n\n/** A decoded chart row kind. */\nexport type ChartKindValue = Extract<ValueTypeOf<typeof Plan.Types.Row>[\"kind\"], { type: \"chart\" }>[\"value\"];\n/** A decoded chart layer. */\nexport type ChartLayerValue = ValueTypeOf<typeof Plan.Types.ChartLayer>;\n/** A decoded `{t, y}` chart point. */\nexport type ChartPointValue = ValueTypeOf<typeof Plan.Types.ChartPoint>;\n/** A decoded `{t, lo, hi}` band point — the band arm's own point type. */\nexport type ChartBandPointValue = Extract<ChartLayerValue, { type: \"band\" }>[\"value\"][\"points\"][number];\n/** A decoded value-axis declaration. */\nexport type ChartAxisValue = ValueTypeOf<typeof Plan.Types.ChartAxis>;\n/** A decoded breach threshold. */\nexport type PlanBreachValue = ValueTypeOf<typeof Plan.Types.Breach>;\n/** Which value axis a layer scales against. */\nexport type ChartSide = ValueTypeOf<typeof Plan.Types.AxisSide>[\"type\"];\n\n/** A value axis's scale — data value → plot px. */\nexport type ValueScale = ReturnType<typeof scaleLinear<number>>;\n\n/** Px of air above and below the marks. */\nexport const PAD_Y = 4;\n/** A column's inset within its bucket, as a share of the bucket's width. */\nconst COLUMN_INSET = 0.18;\n\n/**\n * Whether a value breaches a layer's threshold. The layer's own decoded\n * variant is read as it is — never rebuilt (#743 item 6).\n *\n * @param v - The value\n * @param breach - The layer's threshold, when it declares one\n * @returns `true` beyond the threshold; `false` for a gap\n */\nexport function breached(v: number, breach: PlanBreachValue | undefined): boolean {\n    if (breach === undefined || !Number.isFinite(v)) return false;\n    switch (breach.type) {\n        case \"above\": return v > breach.value;\n        case \"below\": return v < breach.value;\n    }\n}\n\n/** One drawn column, in data units and window fractions. */\nexport interface ColumnGeometry {\n    /** Left / right edges as window fractions (inset within the bucket). */\n    x0: number;\n    x1: number;\n    /** The span it covers on its axis — `lo` ≤ `hi`; a stack's part sits on the parts before it. */\n    lo: number;\n    hi: number;\n    /** The column's own value. */\n    value: number;\n    side: ChartSide;\n    /** Beyond its layer's breach threshold. */\n    warn: boolean;\n    /** At or after the now instant — a column that starts at now is the\n     *  period in progress, drawn to the right of the now line (#949). */\n    planned: boolean;\n    /** Its stack series' first-appearance index (0 for an unstacked column). */\n    seriesIndex: number;\n}\n\n/** A stack's running ends at one bucket: positive parts climb from 0, negative parts descend. */\ninterface StackEnds {\n    up: number;\n    down: number;\n}\n\n/** One side's stacks — the drawn ones by render bucket, the undrawn by period. */\ninterface SideStacks {\n    drawn: Map<number, StackEnds>;\n    undrawn: Map<number, StackEnds>;\n}\n\n/** The chart's column geometry: what is drawn, and every column's extent. */\nexport interface ColumnLayout {\n    /** The columns inside the render bounds, in layer then point order. */\n    drawn: ColumnGeometry[];\n    /** Every column's span per side — drawn or not — for the value domain. */\n    extents: { left: number[]; right: number[] };\n}\n\n/**\n * Lay out a chart's columns.\n *\n * @remarks\n * A column with a `series` stacks on its SIDE's stack at its bucket; one\n * without starts at the baseline. Stacks are kept per value-axis side, so a\n * left-axis column never becomes the base of a right-axis one (#743 item 4),\n * and per sign, so positive parts climb from 0 and negative parts descend from\n * it. A column outside the render bounds is not drawn, but it still stacks —\n * by its period — so the domain it contributes is the same wherever the\n * window sits. A gap draws nothing.\n *\n * @param layers - The chart's layers\n * @param scale - The shared scale\n * @returns The drawn columns and every column's extent\n */\nexport function layoutColumns(layers: readonly ChartLayerValue[], scale: PlanScale): ColumnLayout {\n    const stacks: Record<ChartSide, SideStacks> = {\n        left: { drawn: new Map(), undrawn: new Map() },\n        right: { drawn: new Map(), undrawn: new Map() },\n    };\n    const drawn: ColumnGeometry[] = [];\n    const extents: ColumnLayout[\"extents\"] = { left: [], right: [] };\n    const seriesIds: string[] = [];\n    for (const layer of layers) {\n        if (layer.type !== \"column\") continue;\n        const { points, axis, series, breach } = layer.value;\n        const side = axis.type;\n        const stackId = series.type === \"some\" ? series.value : undefined;\n        let seriesIndex = 0;\n        if (stackId !== undefined) {\n            const at = seriesIds.indexOf(stackId);\n            seriesIndex = at >= 0 ? at : seriesIds.push(stackId) - 1;\n        }\n        const threshold = breach.type === \"some\" ? breach.value : undefined;\n        for (const p of points) {\n            const v = p.y;\n            if (!Number.isFinite(v)) continue;\n            // RENDER bucketing (#619): a column in the overscan is drawn,\n            // clipped at rest.\n            const bucket = scale.renderBucketOf(p.t);\n            let lo = Math.min(0, v);\n            let hi = Math.max(0, v);\n            if (stackId !== undefined) {\n                const key = bucket !== undefined ? bucket.index : scale.toNumber(scale.floor(p.t));\n                if (!Number.isFinite(key)) continue;\n                const byKey = bucket !== undefined ? stacks[side].drawn : stacks[side].undrawn;\n                let ends = byKey.get(key);\n                if (ends === undefined) {\n                    ends = { up: 0, down: 0 };\n                    byKey.set(key, ends);\n                }\n                if (v >= 0) {\n                    lo = ends.up;\n                    hi = ends.up + v;\n                    ends.up = hi;\n                } else {\n                    hi = ends.down;\n                    lo = ends.down + v;\n                    ends.down = lo;\n                }\n            }\n            extents[side].push(lo, hi);\n            if (bucket === undefined) continue;\n            const inset = COLUMN_INSET * (bucket.x1 - bucket.x0);\n            drawn.push({\n                x0: bucket.x0 + inset,\n                x1: bucket.x1 - inset,\n                lo, hi, value: v, side,\n                warn: breached(v, threshold),\n                planned: scale.nowFrac !== undefined && scale.fracOf(p.t) >= scale.nowFrac,\n                seriesIndex,\n            });\n        }\n    }\n    return { drawn, extents };\n}\n\n/** A value axis's extent. */\nexport interface ValueDomain {\n    min: number;\n    max: number;\n}\n\n/** The number-arm bounds of an axis's `ChartDomainType` declaration (a Plan\n *  value axis never carries the time arm — the factory guards it). */\nfunction declaredDomain(axis: ChartAxisValue | undefined): { min: number | undefined; max: number | undefined } {\n    const d = axis !== undefined && axis.domain.type === \"some\" && axis.domain.value.type === \"number\"\n        ? axis.domain.value.value\n        : undefined;\n    return { min: d?.min, max: d?.max };\n}\n\n/**\n * The explicit tick positions of an axis (its `ChartTickValuesType` number arm).\n *\n * @param axis - The axis declaration\n * @returns The positions; empty when none are declared\n */\nexport function axisTicks(axis: ChartAxisValue | undefined): readonly number[] {\n    return axis !== undefined && axis.tickValues.type === \"some\" && axis.tickValues.value.type === \"number\"\n        ? axis.tickValues.value.value\n        : [];\n}\n\n/**\n * The domain each value axis spans.\n *\n * @remarks\n * Derived from the geometry the row draws: line and scatter values; an area's\n * values AND its baseline (0); a band's bounds; reference lines and dots; and\n * each column's span — its baseline and, stacked, its stack's ends (#743 item\n * 2). Explicit tick positions are inside it too. A declared domain wins over\n * the derived one. No data spans `[0, 1]`, and an empty span opens to one\n * unit.\n *\n * @param kind - The chart row\n * @param columns - Its column layout ({@link layoutColumns})\n * @returns The left and right domains\n */\nexport function chartDomains(kind: ChartKindValue, columns: ColumnLayout): { left: ValueDomain; right: ValueDomain } {\n    const values: Record<ChartSide, number[]> = { left: [], right: [] };\n    for (const layer of kind.layers) {\n        switch (layer.type) {\n            case \"line\": case \"scatter\":\n                for (const p of layer.value.points) values[layer.value.axis.type].push(p.y);\n                break;\n            case \"area\":\n                values[layer.value.axis.type].push(0);\n                for (const p of layer.value.points) values[layer.value.axis.type].push(p.y);\n                break;\n            case \"band\":\n                for (const p of layer.value.points) values[layer.value.axis.type].push(p.lo, p.hi);\n                break;\n            case \"refLine\": case \"refDot\":\n                values[layer.value.axis.type].push(layer.value.y);\n                break;\n            case \"column\": case \"refBand\":\n                break;\n        }\n    }\n    const left = kind.left.type === \"some\" ? kind.left.value : undefined;\n    const right = kind.right.type === \"some\" ? kind.right.value : undefined;\n    return {\n        left: domainOf(left, values.left, columns.extents.left),\n        right: domainOf(right, values.right, columns.extents.right),\n    };\n}\n\nfunction domainOf(axis: ChartAxisValue | undefined, values: readonly number[], spans: readonly number[]): ValueDomain {\n    let lo = Infinity;\n    let hi = -Infinity;\n    const take = (v: number) => {\n        if (!Number.isFinite(v)) return;\n        if (v < lo) lo = v;\n        if (v > hi) hi = v;\n    };\n    for (const v of values) take(v);\n    for (const v of spans) take(v);\n    for (const v of axisTicks(axis)) take(v);\n    const declared = declaredDomain(axis);\n    let min = declared.min ?? (lo === Infinity ? 0 : lo);\n    let max = declared.max ?? (hi === -Infinity ? 1 : hi);\n    if (!(max > min)) max = min + 1;\n    return { min, max };\n}\n\n/**\n * A value axis's scale over a plot `height` px tall — `min` at the bottom and\n * `max` at the top, inside {@link PAD_Y} of air.\n *\n * @param domain - The axis's domain\n * @param height - The plot's height (px)\n * @returns The scale\n */\nexport function valueScale(domain: ValueDomain, height: number): ValueScale {\n    return scaleLinear<number>({ domain: [domain.min, domain.max], range: [height - PAD_Y, PAD_Y] });\n}\n\n/** A point of a continuous series, at its unclamped window fraction. */\nexport interface Placed<P> {\n    p: P;\n    /** The point's window fraction — below 0 before the window, above 1 past it. */\n    f: number;\n}\n\n/**\n * The points of a continuous series (line / area / band) the row draws, at\n * their TRUE fractions (#743 item 3).\n *\n * @remarks\n * A point is kept when it lies inside the render bounds or when its segment to\n * either neighbour reaches them — the segment that crosses a window edge then\n * keeps its real slope, and the plot clips it. A point is dropped only when\n * both its segments lie wholly to one side, which puts its neighbours on that\n * side too, so the segment now joining them is never drawn in view either. A\n * point the axis cannot place (`NaN` fraction) is kept as a gap.\n *\n * @param points - The series' points, in draw order\n * @param scale - The shared scale\n * @returns The points worth drawing, placed\n */\nexport function drawnPoints<P extends { t: PlanInstantValue }>(points: readonly P[], scale: PlanScale): Placed<P>[] {\n    const lo = scale.renderMin;\n    const hi = scale.renderMax;\n    const f = points.map((p) => scale.fracOf(p.t));\n    const reaches = (a: number | undefined, b: number | undefined) => a !== undefined && b !== undefined\n        && Number.isFinite(a) && Number.isFinite(b) && Math.max(a, b) >= lo && Math.min(a, b) <= hi;\n    const out: Placed<P>[] = [];\n    for (let i = 0; i < points.length; i++) {\n        const fi = f[i]!;\n        const keep = !Number.isFinite(fi) || (fi >= lo && fi <= hi) || reaches(f[i - 1], fi) || reaches(fi, f[i + 1]);\n        if (keep) out.push({ p: points[i]!, f: fi });\n    }\n    return out;\n}\n\n/**\n * Split a line's placed points at the now instant — solid up to it, dashed\n * after, the dashed run starting from the last observed point so the two\n * meet.\n *\n * @param placed - The line's drawn points\n * @param nowFrac - The now instant's fraction, when it is in the window\n * @returns The observed and planned runs\n */\nexport function splitAtNow<P>(placed: readonly Placed<P>[], nowFrac: number | undefined): { before: Placed<P>[]; after: Placed<P>[] } {\n    if (nowFrac === undefined) return { before: [...placed], after: [] };\n    const before: Placed<P>[] = [];\n    const after: Placed<P>[] = [];\n    for (const q of placed) (q.f <= nowFrac ? before : after).push(q);\n    if (after.length > 0 && before.length > 0) after.unshift(before[before.length - 1]!);\n    return { before, after };\n}\n\n/**\n * A value axis's tick formatter — the declared `Chart.format.*` spec through\n * the shared chart-axis `tickFormatter` (#190); an undeclared axis keeps the\n * terse bare-number default of the spec ruler (the shared module's `tick`\n * arm, #850): a whole number, else one decimal, never grouped. Both speak the\n * canvas's locale (#820) — `2.5` is `2,5` in `de-DE`.\n *\n * @param axis - The axis declaration\n * @param locale - The BCP 47 locale the numbers format in\n * @returns The formatter\n */\nexport function axisFormatter(axis: ChartAxisValue | undefined, locale: string): (v: number) => string {\n    const fmt = axis !== undefined && axis.format.type === \"some\" ? axis.format.value : undefined;\n    if (fmt === undefined) return formatters(locale).tick;\n    const f = tickFormatter(fmt, \"linear\", locale);\n    return (v) => f(v);\n}\n\n/** A layer the crosshair reads a value from. */\nexport interface ReadoutLayer {\n    /** Its index in `kind.layers`. */\n    index: number;\n    kind: \"line\" | \"area\" | \"column\" | \"scatter\" | \"band\";\n}\n\n/**\n * The layers with a value to read at a bucket — every data layer; reference\n * marks are not measures.\n *\n * @param kind - The chart row\n * @returns The layers, in layer order\n */\nexport function readoutLayers(kind: ChartKindValue): ReadoutLayer[] {\n    const out: ReadoutLayer[] = [];\n    kind.layers.forEach((layer, index) => {\n        switch (layer.type) {\n            case \"line\": case \"area\": case \"column\": case \"scatter\": case \"band\":\n                out.push({ index, kind: layer.type });\n                break;\n            case \"refLine\": case \"refBand\": case \"refDot\":\n                break;\n        }\n    });\n    return out;\n}\n\n/**\n * Each readout layer's value at each bucket, formatted by its axis — the\n * crosshair's text (#743). A layer's value at a bucket is its LAST value in\n * the bucket (a band's `lo–hi`) — a gap is no value; a layer with none there\n * reads `—`. Buckets where no layer has a value are absent.\n *\n * @param kind - The chart row\n * @param scale - The shared scale\n * @param w - The canvas's words — the locale values format in, and a band's range (#820)\n * @returns Bucket index → one text per {@link readoutLayers} entry\n */\nexport function readoutTable(kind: ChartKindValue, scale: PlanScale, w: PlanWords): Map<number, string[]> {\n    const layers = readoutLayers(kind);\n    const format: Record<ChartSide, (v: number) => string> = {\n        left: axisFormatter(kind.left.type === \"some\" ? kind.left.value : undefined, w.locale),\n        right: axisFormatter(kind.right.type === \"some\" ? kind.right.value : undefined, w.locale),\n    };\n    const table = new Map<number, string[]>();\n    const cell = (bucket: number, slot: number, text: string) => {\n        let row = table.get(bucket);\n        if (row === undefined) {\n            row = layers.map(() => \"—\");\n            table.set(bucket, row);\n        }\n        row[slot] = text;\n    };\n    layers.forEach(({ index }, slot) => {\n        const layer = kind.layers[index]!;\n        switch (layer.type) {\n            case \"line\": case \"area\": case \"column\": case \"scatter\": {\n                const fmt = format[layer.value.axis.type];\n                for (const p of layer.value.points) {\n                    const bi = scale.bucketOf(p.t);\n                    if (bi >= 0 && Number.isFinite(p.y)) cell(bi, slot, fmt(p.y));\n                }\n                break;\n            }\n            case \"band\": {\n                const fmt = format[layer.value.axis.type];\n                for (const p of layer.value.points) {\n                    const bi = scale.bucketOf(p.t);\n                    if (bi >= 0 && Number.isFinite(p.lo) && Number.isFinite(p.hi)) {\n                        cell(bi, slot, w.m.valueRange({ from: fmt(p.lo), to: fmt(p.hi) }));\n                    }\n                }\n                break;\n            }\n            case \"refLine\": case \"refBand\": case \"refDot\":\n                break;\n        }\n    });\n    return table;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the canvas SAYS (#819) — the text alternative of every element and\n * colour-only cell, and the live region's announcements. Pure: the renderers\n * put these strings on `aria-label`s and visually hidden text, and the\n * canvas's live region reads them out.\n *\n * Every mark on a Plan encodes something by shape, position or colour: a run\n * bar's state is its fill, a heat cell's value its depth, a segment's category\n * its colour, a chart's shape its values. A screen reader gets none of that,\n * so each gets words — the element's own label, where it sits on the axis in\n * words (`scale.instantText` / `scale.bucketText`, never the ruler tick), and\n * the fact its look encodes.\n *\n * The words are the canvas's (#820): every phrase comes from its message\n * table, and every number and date is in its locale.\n *\n * What a paged source reads is the footer's loading line's to say, a polite\n * live region of its own that speaks once a load (#1398, CL12): the canvas's\n * live region says no window's landing.\n *\n * @packageDocumentation\n */\n\nimport { type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport type { PlanScale, PlanBucket } from \"./scale.js\";\nimport type { PlanEvent, PlanUiState, RowKey } from \"./plan-state.js\";\nimport type { PlanWords } from \"./words.js\";\nimport type { TickFormatOpt } from \"@elaraai/east-ui-components\";\nimport { quantityText } from \"./quantity.js\";\nimport { axisFormatter, breached, readoutLayers, type ChartKindValue } from \"./rows/chart-geometry.js\";\n\ntype RunValue = ValueTypeOf<typeof Plan.Types.Run>;\ntype ChipValue = ValueTypeOf<typeof Plan.Types.Chip>;\ntype EventMarkValue = ValueTypeOf<typeof Plan.Types.EventMark>;\ntype DecisionValue = ValueTypeOf<typeof Plan.Types.DecisionMark>;\ntype BucketEventValue = ValueTypeOf<typeof Plan.Types.BucketEvent>;\ntype SegmentValue = ValueTypeOf<typeof Plan.Types.Segment>;\n\n/** An element's lifecycle state (`EventStateType`). */\nexport type PlanStateValue = RunValue[\"state\"];\n\n/**\n * A lifecycle state in words — what a bar's fill, a tile's chip or a card's\n * outline says by look.\n *\n * @param state - The element's state\n * @param w - The canvas's words\n * @returns The words — `proposed removal`\n */\nexport function stateText(state: PlanStateValue, w: PlanWords): string {\n    return w.m.state({ state: state.type === \"proposed\" ? state.value.type : state.type });\n}\n\n/**\n * A status tone as the accessible name of the dot or icon that shows it.\n *\n * @param tone - The status tag (`warning`, `danger`, …)\n * @param w - The canvas's words\n * @returns `Status: warning`\n */\nexport function statusText(tone: string, w: PlanWords): string {\n    return w.m.status({ tone: w.m.tone({ tone }) });\n}\n\n/** `from – to`, in the axis's words. */\nfunction spanText(scale: PlanScale, from: RunValue[\"start\"], to: RunValue[\"end\"], w: PlanWords): string {\n    return w.m.span({ from: scale.instantText(from), to: scale.instantText(to) });\n}\n\n/**\n * A run bar's accessible name — its label, its span, its state, and what its\n * look adds: the quantity caption (#824), the `moved ×k` counter, the stuck\n * ring's status.\n *\n * @param run - The run\n * @param scale - The shared scale\n * @param w - The canvas's words\n * @returns `J-4642, Jun 29, 2026 – Jul 27, 2026, actual, 96 k sheets`\n */\nexport function runName(run: RunValue, scale: PlanScale, w: PlanWords): string {\n    const moved = run.moved.type === \"some\" ? Number(run.moved.value) : 0;\n    return w.m.runName({\n        label: run.label,\n        span: spanText(scale, run.start, run.end, w),\n        state: stateText(run.state, w),\n        quantity: run.quantity.type === \"some\" ? quantityText(run.quantity.value, w) : undefined,\n        moved: moved > 0 ? w.m.movedTimes({ n: moved, count: w.number(moved) }) : undefined,\n        status: run.status.type === \"some\" ? w.m.tone({ tone: run.status.value.type }) : undefined,\n    });\n}\n\n/**\n * A span row's decision diamond — where it sits, and whether it is applied\n * (◆) or pending (◇).\n *\n * @param dec - The decision mark\n * @param scale - The shared scale\n * @param w - The canvas's words\n * @returns `Decision, Jul 13, 2026, applied`\n */\nexport function decisionName(dec: DecisionValue, scale: PlanScale, w: PlanWords): string {\n    return w.m.decisionName({ at: scale.instantText(dec.at), applied: dec.applied });\n}\n\n/**\n * A bucket tile's accessible name — its label (or `Event` for the resting\n * ✓ / `plan` chip), its bucket, its lane caption, its state and tone.\n *\n * @param ev - The bucket event\n * @param bucket - The bucket it renders in\n * @param lane - Its lane's caption, when the lane has one\n * @param scale - The shared scale\n * @param w - The canvas's words\n * @returns `Proof, Week of Jul 6, 2026, AM, proposed`\n */\nexport function tileName(ev: BucketEventValue, bucket: PlanBucket, lane: string | undefined, scale: PlanScale, w: PlanWords): string {\n    return w.m.tileName({\n        label: ev.label.type === \"some\" ? ev.label.value : undefined,\n        bucket: scale.bucketText(bucket),\n        lane,\n        state: stateText(ev.state, w),\n        tone: ev.tone.type === \"some\" ? w.m.tone({ tone: ev.tone.value.type }) : undefined,\n    });\n}\n\n/**\n * A cards chip's accessible name — its label, the buckets it spans, its state.\n *\n * @param chip - The chip\n * @param scale - The shared scale\n * @param w - The canvas's words\n * @returns `CREW A, Jun 29, 2026 – Jul 13, 2026, confirmed`\n */\nexport function chipName(chip: ChipValue, scale: PlanScale, w: PlanWords): string {\n    return w.m.chipName({ label: chip.label, span: spanText(scale, chip.from, chip.to, w), state: stateText(chip.state, w) });\n}\n\n/**\n * An event mark's accessible name — its label, its kind (the glyph's\n * meaning: ● milestone, ◇/◆ decision, ▲ exception) and its instant.\n *\n * @param mark - The event mark\n * @param scale - The shared scale\n * @param w - The canvas's words\n * @returns `KICKOFF, milestone, Jun 29, 2026`\n */\nexport function markName(mark: EventMarkValue, scale: PlanScale, w: PlanWords): string {\n    return w.m.markName({\n        label: mark.label.type === \"some\" ? mark.label.value : undefined,\n        kind: mark.kind.type,\n        applied: mark.kind.type === \"decision\" && mark.kind.value.applied,\n        at: scale.instantText(mark.at),\n    });\n}\n\n/**\n * A heat cell's value in words — the depth its colour encodes. The author's\n * printed label wins, then the value; a cell with none is `no data` (the 45°\n * hatch).\n *\n * @param value - The cell's value\n * @param label - The author's printed label\n * @param warn - Whether the value is at or above the row's warning threshold (the ring)\n * @param w - The canvas's words\n * @returns `72` / `no data` / `91, at or above the warning threshold`\n */\nexport function heatValueText(value: number | undefined, label: string | undefined, warn: boolean, w: PlanWords): string {\n    if (value === undefined) return w.m.noData();\n    return w.m.heatValue({ value: label ?? w.number(value), warn });\n}\n\n/**\n * A weight bar's value in words — the booked fraction its width encodes, and\n * the pale planned treatment.\n *\n * @param fraction - The booked fraction (0–1)\n * @param planned - Whether the bucket is planned\n * @param w - The canvas's words\n * @param format - How the fraction prints — the arm's declared `format` (#824); a percent without one\n * @returns `60% booked, planned`\n */\nexport function weightValueText(fraction: number, planned: boolean, w: PlanWords, format?: TickFormatOpt): string {\n    const clamped = Math.max(0, Math.min(1, fraction));\n    return w.m.weightValue({ percent: format !== undefined ? w.value(clamped, format) : w.percent(clamped), planned });\n}\n\n/**\n * A segment composition in words — each segment's category (its fill) and\n * its share, the author's in-bar label standing for the share where given.\n *\n * @param segments - The cell's segments, in order\n * @param w - The canvas's words\n * @param format - How a share prints — the arm's declared `format` (#824); a percent without one\n * @returns `booked 60%, slack 25%, free 15%`\n */\nexport function segmentsText(segments: readonly SegmentValue[], w: PlanWords, format?: TickFormatOpt): string {\n    const total = segments.reduce((acc, s) => acc + Math.max(0, s.weight), 0);\n    if (segments.length === 0 || total <= 0) return w.m.noData();\n    return w.m.list({\n        parts: segments.map((s) => {\n            const share = Math.max(0, s.weight) / total;\n            return w.m.segmentPart({\n                fill: s.fill.type,\n                share: s.label.type === \"some\" ? s.label.value\n                    : format !== undefined ? w.value(share, format) : w.percent(share),\n            });\n        }),\n    });\n}\n\n/**\n * A table cell's parts in words — the numerals it prints, with the muted\n * em-dash of a missing value said as `no value`.\n *\n * @param texts - Each part's printed text, in series order\n * @param w - The canvas's words\n * @returns `1,204, 96%`\n */\nexport function tablePartsText(texts: readonly string[], w: PlanWords): string {\n    return w.m.list({ parts: texts.map((t) => (t === \"—\" ? w.m.noValue() : t)) });\n}\n\n/**\n * A bucket-quantised element's accessible name — the bucket in words, then\n * what the element says about it.\n *\n * @param scale - The shared scale\n * @param bucket - The element's bucket\n * @param value - The element's value in words\n * @param w - The canvas's words\n * @returns `Week of Jul 6, 2026: 72`\n */\nexport function cellName(scale: PlanScale, bucket: PlanBucket, value: string, w: PlanWords): string {\n    return w.m.cellName({ bucket: scale.bucketText(bucket), value });\n}\n\n/**\n * A chart row's text alternative — its summary as a `role=\"img\"` label: each\n * data layer's minimum, maximum and last value inside the window, by its\n * axis's format, and how many of its points breach a declared threshold (the\n * warn marks say that by colour alone).\n *\n * @param kind - The chart row\n * @param scale - The shared scale\n * @param w - The canvas's words\n * @returns `Chart: line min 1.2, max 4.5, last 3.1; columns min 0, max 12, last 7, 2 beyond threshold`\n */\nexport function chartSummary(kind: ChartKindValue, scale: PlanScale, w: PlanWords): string {\n    const layers = readoutLayers(kind);\n    if (layers.length === 0) return w.m.chartNoData();\n    const counts = new Map<string, number>();\n    for (const l of layers) counts.set(l.kind, (counts.get(l.kind) ?? 0) + 1);\n    const seen = new Map<string, number>();\n    const format = {\n        left: axisFormatter(kind.left.type === \"some\" ? kind.left.value : undefined, w.locale),\n        right: axisFormatter(kind.right.type === \"some\" ? kind.right.value : undefined, w.locale),\n    };\n    const parts = layers.map(({ index, kind: k }) => {\n        const n = (seen.get(k) ?? 0) + 1;\n        seen.set(k, n);\n        const name = w.m.chartLayer({ kind: k, index: (counts.get(k) ?? 0) > 1 ? w.number(n) : undefined });\n        const layer = kind.layers[index]!;\n        if (layer.type === \"band\") {\n            const fmt = format[layer.value.axis.type];\n            let lo = Infinity;\n            let hi = -Infinity;\n            let last: { t: number; text: string } | undefined;\n            for (const p of layer.value.points) {\n                if (scale.bucketOf(p.t) < 0 || !Number.isFinite(p.lo) || !Number.isFinite(p.hi)) continue;\n                if (p.lo < lo) lo = p.lo;\n                if (p.hi > hi) hi = p.hi;\n                const at = scale.toNumber(p.t);\n                if (last === undefined || at >= last.t) last = { t: at, text: w.m.valueRange({ from: fmt(p.lo), to: fmt(p.hi) }) };\n            }\n            return last === undefined\n                ? w.m.chartLayerEmpty({ layer: name })\n                : w.m.chartLayerValues({ layer: name, min: fmt(lo), max: fmt(hi), last: last.text, n: 0, breaches: w.number(0) });\n        }\n        if (layer.type === \"refLine\" || layer.type === \"refBand\" || layer.type === \"refDot\") return name;\n        const fmt = format[layer.value.axis.type];\n        const threshold = (layer.type === \"line\" || layer.type === \"column\") && layer.value.breach.type === \"some\"\n            ? layer.value.breach.value : undefined;\n        let lo = Infinity;\n        let hi = -Infinity;\n        let breaches = 0;\n        let last: { t: number; y: number } | undefined;\n        for (const p of layer.value.points) {\n            if (scale.bucketOf(p.t) < 0 || !Number.isFinite(p.y)) continue;\n            if (p.y < lo) lo = p.y;\n            if (p.y > hi) hi = p.y;\n            if (breached(p.y, threshold)) breaches += 1;\n            const at = scale.toNumber(p.t);\n            if (last === undefined || at >= last.t) last = { t: at, y: p.y };\n        }\n        if (last === undefined) return w.m.chartLayerEmpty({ layer: name });\n        return w.m.chartLayerValues({\n            layer: name, min: fmt(lo), max: fmt(hi), last: fmt(last.y), n: breaches, breaches: w.number(breaches),\n        });\n    });\n    return w.m.chartSummary({ parts });\n}\n\n/**\n * What an interaction changed, as the live region says it (#819) — a\n * selection, a section or chart opening or closing, a row focus coming or\n * going, a grain change. Judged from the UI state before and after the\n * interaction, so an event that moved nothing (re-selecting the selected\n * row, an esc with nothing to clear) says nothing.\n *\n * @param e - The interaction\n * @param before - The UI state before it\n * @param after - The UI state after it\n * @param label - A row's name (its gutter label)\n * @param w - The canvas's words\n * @returns The announcement, or `undefined`\n */\nexport function announcementOf(\n    e: PlanEvent,\n    before: PlanUiState,\n    after: PlanUiState,\n    label: (key: RowKey) => string,\n    w: PlanWords,\n): string | undefined {\n    const focusGone = before.focus !== null && after.focus === null;\n    switch (e.t) {\n        case \"row.select\":\n            // Another row, or this row in place of the events selected on it (#1197).\n            return after.selected !== null && (after.selected !== before.selected || before.elements.length > 0)\n                ? w.m.announceSelected({ label: label(after.selected) })\n                : undefined;\n        case \"element.select\":\n        case \"elements.select\":\n            // The element's own name says what it is; the live region, how\n            // many are selected (#1197) — the overlaps chip's pair, a banner's\n            // peer, alike (#1198).\n            return after.elements === before.elements\n                ? undefined\n                : w.m.announceEvents({ n: after.elements.length, count: w.number(after.elements.length) });\n        case \"group.toggle\":\n            if (after.collapsed === before.collapsed) return undefined;\n            return after.collapsed.has(e.key)\n                ? w.m.announceCollapsed({ label: label(e.key) })\n                : w.m.announceExpanded({ label: label(e.key) });\n        case \"chart.toggle\":\n            return w.m.announceChart({ label: label(e.key), expanded: after.chartsExpanded.has(e.key) });\n        case \"focus.links\":\n            if (after.focus?.kind === \"links\" && after.focus.key === e.key) return w.m.announceLinked({ label: label(e.key) });\n            return focusGone ? w.m.announceAllRows() : undefined;\n        case \"focus.expand\":\n            if (after.focus?.kind === \"expand\" && after.focus.key === e.key) return w.m.announceOpened({ label: label(e.key) });\n            return focusGone ? w.m.announceAllRows() : undefined;\n        case \"focus.clear\":\n            return focusGone ? w.m.announceAllRows() : undefined;\n        case \"grain.set\":\n            return after.grain !== before.grain ? w.m.announceGrain({ grain: after.grain }) : undefined;\n        case \"key\":\n            switch (e.key) {\n                case \"esc\":\n                    if (focusGone) return w.m.announceAllRows();\n                    return (before.selected !== null || before.elements.length > 0) && after.selected === null && after.elements.length === 0\n                        ? w.m.announceCleared() : undefined;\n                case \"g\":\n                    return after.grain !== before.grain ? w.m.announceGrain({ grain: after.grain }) : undefined;\n                case \"n\": case \"[\": case \"]\":\n                    return undefined;\n            }\n            return undefined;\n        case \"brush.down\": case \"brush.commit\": case \"brush.clear\": case \"brush.up\":\n        case \"resolution.set\": case \"pan\":\n            // The window and the resolution are the slice's: the controller\n            // says a resolution change from the scale after the write, since\n            // the event alone cannot know whether the write took.\n            return undefined;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Selecting events on the canvas (#1197, the Calendar's B15): what a run bar,\n * a tile, a chip or a mark of an event kind's rows does with its click. It\n * selects its event and its row, Shift, ⌘ or Ctrl adding the event to the\n * selection or taking it out, and it draws selected while it is — the\n * inspector shows what is selected. An element of anything else — a series\n * over `data`, a row of the Plan's own — selects its row, as it always has.\n *\n * An event's element is keyed by its event as East prints a\n * `Schedule.Types.EventRef` (#1192): a key that reads back as one, of a kind\n * the Plan has, is an event's.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useCallback, useContext, useSyncExternalStore, type MouseEvent } from \"react\";\nimport { parseFor } from \"@elaraai/east\";\nimport { ScheduleEventRefType } from \"@elaraai/e3-ui/internal\";\nimport { usePlanDispatch, usePlanResolvers, type PlanElementRefValue } from \"../context.js\";\nimport { PlanControllerContext } from \"../controller/react.js\";\nimport type { PlanRowValue } from \"../model.js\";\n\n/** The elements that may be an event's: a bar, a tile, a chip, a mark — never a cell, which is a bucket's. */\nexport const PLAN_EVENT_ELEMENT_SELECTOR = \"[data-run],[data-event],[data-chip],[data-mark]\";\n\n/**\n * Whether a row draws the element of a key — a run, a chip, a tile or a mark:\n * the row an event selected from outside the canvas is shown on (#1198).\n *\n * @param row - The row\n * @param key - The element's key\n * @returns Whether one of its elements has that key\n */\nexport function holdsElement(row: PlanRowValue, key: string): boolean {\n    const kind = row.kind;\n    switch (kind.type) {\n        case \"span\": return kind.value.runs.some((run) => run.key === key);\n        case \"cards\": return kind.value.chips.some((chip) => chip.key === key);\n        case \"buckets\": return kind.value.events.some((tile) => tile.key === key);\n        case \"events\": return kind.value.marks.some((mark) => mark.key === key);\n        default: return false;\n    }\n}\n\n/**\n * An element ref's own key — what its element is keyed by on its row.\n *\n * @param ref - The element's ref\n * @returns Its key; `undefined` for a cell or a link, which no event is\n */\nexport function elementKeyOf(ref: PlanElementRefValue): string | undefined {\n    switch (ref.type) {\n        case \"run\": return ref.value.run;\n        case \"event\": return ref.value.event;\n        case \"chip\": return ref.value.chip;\n        case \"mark\": return ref.value.mark;\n        case \"cell\": case \"link\": return undefined;\n    }\n}\n\n/** Whether an element's key names an event the canvas selects. */\nexport type PlanSelectable = (key: string) => boolean;\n\n/** Nothing selects: a Plan with no event kinds. */\nconst NOTHING: PlanSelectable = () => false;\n\nconst parseRef = parseFor(ScheduleEventRefType);\n\n/**\n * What the canvas's elements select by: an element's key that reads back as a\n * `Schedule.Types.EventRef` of one of `kinds`.\n *\n * @param kinds - The Plan's event kinds, by slot\n * @returns Whether a key is an event's — each key read once\n */\nexport function selectableOf(kinds: readonly string[] | undefined): PlanSelectable {\n    if (kinds === undefined || kinds.length === 0) return NOTHING;\n    const slots = new Set(kinds);\n    const read = new Map<string, boolean>();\n    return (key) => {\n        let held = read.get(key);\n        if (held === undefined) {\n            const parsed = parseRef(key);\n            held = parsed.success && slots.has(parsed.value.kind);\n            read.set(key, held);\n        }\n        return held;\n    };\n}\n\n/** What the canvas's elements select by — none outside a Plan of event kinds. */\nexport const PlanSelectableContext = createContext<PlanSelectable>(NOTHING);\n\n/** An element's selection: whether its event selects, whether it is selected, and its click. */\nexport interface PlanElementSelect {\n    /** Its event can be selected: an event kind's element. */\n    selectable: boolean;\n    /** It is selected. */\n    selected: boolean;\n    /** Its click — its event selected, or its row; and the author's `onElementClick`. */\n    onClick: (e: MouseEvent) => void;\n}\n\nconst noSubscribe = () => () => undefined;\n\n/**\n * An element's selection — see the module docs.\n *\n * @param rowKey - Its row's key\n * @param key - Its own key\n * @param ref - Its element ref, for the author's `onElementClick`\n * @returns Whether it selects and is selected, and its click\n */\nexport function usePlanElementSelect(rowKey: string, key: string, ref: PlanElementRefValue): PlanElementSelect {\n    const dispatch = usePlanDispatch();\n    const { onElementClick } = usePlanResolvers();\n    const selectable = useContext(PlanSelectableContext)(key);\n    // Only this element's own fact: a selection elsewhere renders nothing here.\n    const controller = useContext(PlanControllerContext);\n    const selected = useSyncExternalStore(\n        controller?.subscribe ?? noSubscribe,\n        () => selectable && controller !== null && controller.getSnapshot().store.ui.elements.includes(key),\n    );\n    const onClick = useCallback((e: MouseEvent) => {\n        e.stopPropagation();\n        if (selectable) dispatch({ t: \"element.select\", key, row: rowKey, additive: e.shiftKey || e.metaKey || e.ctrlKey });\n        else dispatch({ t: \"row.select\", key: rowKey });\n        onElementClick?.(ref);\n    }, [selectable, dispatch, key, rowKey, onElementClick, ref]);\n    return { selectable, selected, onClick };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The alignment contract, mechanically (`Plan Spec.md` §3): every body row is\n * one two-column grid — the fixed gutter cell and a plot of `n` buckets — so\n * every kind aligns by construction. The shell renders the gutter identity\n * vocabulary (name / id / sub / value / meta / swatches / status dot / caret,\n * 30px-per-level indent), the plot's bucket grid lines, and the shared\n * now / cursor hairlines; the kind renderer supplies the plot content.\n *\n * It is also a treegrid ROW (#819): `role=\"row\"` at its level, selected and\n * expanded as it is, its gutter the `rowheader` and its plot a `gridcell`,\n * with its share of the canvas's one tab stop (`root/grid.ts`).\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef, useSyncExternalStore, type ReactNode } from \"react\";\nimport { Box, useChakraContext } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCaretDown, faLink, faUpRightAndDownLeftFromCenter } from \"@fortawesome/free-solid-svg-icons\";\nimport {\n    getSomeorUndefined, useDropCell, useDragLayerOptional, type CellCoord, type DragEventValue, type DragPayload, type DropCellOptions,\n    type DropVeto,\n} from \"@elaraai/east-ui-components\";\nimport { proposeAt, spanFracs, unitsBetween } from \"../../shared/time/drag.js\";\nimport { NowLine } from \"../../shared/time/now-line.js\";\nimport { slotOfEnd, slotOfInstant } from \"../../shared/time/slot.js\";\nimport { toPlanSlot } from \"../slot.js\";\nimport { spanWords } from \"../edit/movable.js\";\nimport { usePlanEdit, type PlanProposal } from \"../edit/store.js\";\nimport { holdsKey } from \"../edit/use-carry.js\";\nimport type { PlanEventDrop } from \"../edit/event-drag.js\";\nimport { LoadingWash, resolveColor } from \"@elaraai/east-ui-components/internal\";\nimport { usePlanCursor, usePlanDispatch, usePlanGeometry, usePlanScale } from \"../context.js\";\nimport { rowItemKey, type PlanRowValue } from \"../model.js\";\nimport { statusText } from \"../a11y.js\";\nimport { usePlanWords } from \"../words.js\";\nimport type { PlanFocusTagWord } from \"../messages.js\";\nimport type { PlanGridRow } from \"../root/grid.js\";\nimport type { PlanDraftMark } from \"../use-plan-editing.js\";\nimport { PLAN_EVENT_ELEMENT_SELECTOR } from \"./element-select.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** Indent per nesting level (px) — a caret (14px) and its gap (6px), so a\n *  member's name starts exactly where its group's label text does (#949). */\nexport const INDENT_PX = 20;\n\n/**\n * The plot's bucket-column separators, O(1) DOM per row (#616).\n *\n * Equal-width buckets (hour / day / week — every high-count resolution) paint\n * ALL interior separators as one repeating gradient on a single element: it\n * starts at the FIRST interior edge and tiles at one bucket width, so no line\n * lands on the plot's own boundaries. A 100-row × 500-bucket canvas used to\n * mount ~50k separator divs; this is 100. Unequal buckets (month / quarter —\n * clipped edge buckets, low counts by construction) keep the per-edge divs.\n */\nexport function GridSeparators({ styles }: { styles: Styles }) {\n    const scale = usePlanScale();\n    const n = scale.buckets.length;\n    if (n < 2) return null;\n    const w0 = scale.buckets[0]!.x1 - scale.buckets[0]!.x0;\n    const uniform = scale.buckets.every((b) => Math.abs((b.x1 - b.x0) - w0) < 1e-9);\n    if (uniform) {\n        return (\n            <Box css={styles.gridSep} data-plan-axisline data-plan-gridsep\n                style={{\n                    left: `${scale.buckets[0]!.x1 * 100}%`,\n                    // One bucket width, in THIS element's own space: it spans\n                    // n−1 buckets, so a tile is 1/(n−1) of it.\n                    backgroundImage: `repeating-linear-gradient(to right, var(--chakra-colors-border-subtle) 0 1px, transparent 1px calc(100% / ${n - 1}))`,\n                }} />\n        );\n    }\n    return (\n        <>\n            {scale.buckets.slice(0, -1).map((b, i) => (\n                <Box key={i} css={styles.gridCol} data-plan-axisline style={{ left: `${b.x1 * 100}%` }} />\n            ))}\n        </>\n    );\n}\n\n/**\n * A row's DnD drop registration — present only when the canvas is a drag\n * target AND this row's KIND accepts drops (see `DROPPABLE_KINDS`): a library\n * card, where the row's series declares `edit.create`, and a moved run, chip,\n * tile or mark of the row's item type, where it declares a move's fields\n * (#825); and, on an event kind's row, the event kinds' drags (#1196).\n */\nexport interface PlanRowDrop {\n    /** The canvas's DnD surface — its declared id, or one of its own when it declares none (#825). */\n    surface: string;\n    /** Whether a card reaches `data`'s rows — from the canvas's own library panel's tabs (#1259), or from a Library\n     *  beside it that its `sources` lists under its declared `id`; with neither, a row of `data`'s that only takes\n     *  cards registers no cell. */\n    cards: boolean;\n    /** The libraries whose cards land on `data`'s rows: the panel's author tabs', and the `sources` its `id` names. */\n    libraries: ReadonlySet<string>;\n    /** Whether `data`'s session takes a gesture now (#880): its rows take moves, and cards. */\n    data: boolean;\n    /** The canvas's veto over its IR `canDrop` (`useIRCanDrop`), asked of the\n     *  candidate event the drag's CURRENT bucket would produce — its duplicate\n     *  flag included. */\n    canDrop?: DropVeto | undefined;\n    /** The event kinds' drag and drop (#1196): what lands on their rows, its verdict and the ghost's words. */\n    events?: PlanEventDrop | undefined;\n}\n\nexport interface RowShellProps {\n    row: PlanRowValue;\n    styles: Styles;\n    /** Grid template (`\"168px 1fr\"`) — one source for every band. */\n    gridTemplate: string;\n    /** Row height (px) — fixed per kind (`model.rowHeight`). */\n    height: number;\n    /** Nesting depth (gutter indent). */\n    depth: number;\n    selected: boolean;\n    /** The caret state for nesting parents (undefined ⇒ no caret). */\n    caret?: { collapsed: boolean } | undefined;\n    /** Caret click (subtree collapse / chart spark↔expanded toggle). The\n     *  WHOLE gutter cell is the click target (the group-strip convention —\n     *  a 14px caret is not a tree affordance); the plot keeps selection. */\n    onCaretClick?: (() => void) | undefined;\n    /** Table-row emphasis (K5: header wash / footer 2px top rule). */\n    emphasis?: \"header\" | \"footer\" | undefined;\n    /** Extra content overlaid on the gutter cell (chart left-axis ticks). */\n    gutterOverlay?: ReactNode;\n    /** Suppress the bucket grid lines (rows drawing their own canvas). */\n    noGrid?: boolean;\n    /** Row-scoped focus controls (R1 links / R2 expand) — 24px ghost buttons\n     *  at the end of the gutter line, after its value and status, always\n     *  shown, a pressed one in the brand tint (`Plan links.html`, #1258). */\n    controls?: ReadonlyArray<{ kind: \"links\" | \"expand\"; active: boolean; onClick: () => void }> | undefined;\n    /** The links-focus family tag (R1) — shown in the canvas's words. */\n    focusTag?: PlanFocusTagWord | undefined;\n    /** The expand render's axis treatment inside this row (R2; default keep). */\n    axisMode?: \"dim\" | \"off\" | undefined;\n    /** R2 (#591) — the focused row's developer render, mounted INSIDE this\n     *  row's plot cell beneath the row's own marks. Its presence is what makes\n     *  the row (and so its gutter) tall. */\n    expandBody?: ReactNode;\n    /** R2 — content for the space the grown gutter cell opens up. */\n    expandGutter?: ReactNode;\n    /** R2 — the row's NATURAL kind height: the band its own marks keep at the\n     *  top while the render fills the remainder. */\n    bandHeight?: number | undefined;\n    /** R2 context strip (#591) — this row is not the focus, so it compresses\n     *  to 16px and its marks to 7px on the same axis. Never removed: order,\n     *  scroll position and the status dot survive, and the strip itself is\n     *  the return click target. */\n    ctx?: boolean | undefined;\n    /** DnD drop registration for this row's plot. Absent ⇒ the row registers\n     *  no cell, so it is never a destination and never lights up. */\n    drop?: PlanRowDrop | undefined;\n    /** The row's draft mark (#880) — a draft of its entry changed it: the\n     *  Sheet's pending wash, and incomplete or invalid while a check refuses\n     *  the entry. */\n    draft?: PlanDraftMark | undefined;\n    /** The row's grid plumbing (#819) — its written position, its share of\n     *  the tab stop, and its focus handler (`usePlanGridRow`). */\n    grid: PlanGridRow;\n    /** `aria-expanded` (#819): whether its section, chart or expand render is\n     *  open — absent for a row with nothing to open. */\n    expandedState?: boolean | undefined;\n    /** The row is the last visible member of an open group — it carries the\n     *  group's closing rule (#949). */\n    groupEnd?: boolean | undefined;\n    /** Its events are unread (#1398, CL2): the region wash lies under what its plot holds, on the canvas's reveal clock,\n     *  and the plot is busy — never an empty row while its cells are on their way. */\n    unread?: boolean | undefined;\n    children: ReactNode;\n}\n\n/** One canvas body row — gutter + plot on the shared template. */\nexport function RowShell({\n    row, styles, gridTemplate, height, depth, selected,\n    caret, onCaretClick, emphasis, gutterOverlay, noGrid,\n    controls, focusTag, axisMode, ctx, drop, draft, children,\n    expandBody, expandGutter, bandHeight, grid, expandedState, groupEnd, unread,\n}: RowShellProps) {\n    const scale = usePlanScale();\n    const dispatch = usePlanDispatch();\n    const cursor = usePlanCursor();\n    const system = useChakraContext();\n    const geometry = usePlanGeometry();\n    const words = usePlanWords();\n    const gutter = row.gutter;\n    // One flag, spread onto every slot that has a collapsed state. The slots\n    // own the styling (`&[data-ctx]` in the recipe) — this only says which\n    // elements are in a strip.\n    const ctxAttr = ctx === true ? \"\" : undefined;\n    // The row is EXPANDED when it carries a render. Everything the expanded\n    // state changes — the tint, the top-aligned tall gutter, the banded plot —\n    // keys off this one flag.\n    const expanded = expandBody !== undefined;\n    const expandedAttr = expanded ? \"\" : undefined;\n    const sub = gutter.sub.type === \"some\" ? gutter.sub.value : undefined;\n    const meta = gutter.meta.type === \"some\" ? gutter.meta.value : undefined;\n    const value = gutter.value.type === \"some\" ? gutter.value.value : undefined;\n    const isId = gutter.id;\n    const statusTone = row.status.type === \"some\" ? row.status.value.type : undefined;\n    // The band an expanded row's own marks keep at the top — its natural kind\n    // height, which the focused row is always handed.\n    const band = bandHeight ?? geometry.row;\n\n    // ── DnD drop cell ─────────────────────────────────────────────────────\n    // The PLOT is the drop target, and its coordinate resolves from the\n    // pointer at drop time (the Gantt's continuous-surface pattern). Two\n    // things differ from the Gantt, both because of what a Plan row is:\n    //\n    //  - the ROW needs no virtualizer band math — a Plan row key IS its data\n    //    key, and this component already is that row;\n    //  - registration is PER ROW rather than one cell over the whole body,\n    //    because a Plan's rows are heterogeneous. Which kinds accept a drop\n    //    is a per-row question (`DROPPABLE_KINDS`), and the valid / active /\n    //    ⊘ treatment has to land on the row the pointer is over rather than\n    //    washing the entire canvas.\n    //\n    // The SLOT is the bucket under the drag, named by its start instant — the\n    // canvas's own vocabulary for \"where on the axis\" (a `cell` element ref\n    // reports the same bucket instant, not an index), spelled per the axis\n    // arm by the shared encoding (`toPlanSlot`, #631): a Z-less ISO instant,\n    // a decimal, or the ordinal value.\n    //\n    // A MOVED element (#825) lands by where it was grabbed: its drag moves it\n    // by the buckets the pointer crossed since the press (the canvas's edit\n    // store holds the press), so the slot is the bucket of its NEW start — or,\n    // for an end dragged, of that end — and the landing band spans the extent\n    // it would take. A row takes one only when its items are the element's\n    // item type (`accepts`); any other row is no destination at all.\n    //\n    // An event kind's row (#1196) takes the event kinds' drags instead: a\n    // template or a backlog card at the bucket under the pointer, an author's\n    // card on the event under it, and an event's element by its kind — and the\n    // event kinds judge each, say what lands where on the ghost, and size the\n    // band (`edit/event-drag.ts`).\n    const edit = usePlanEdit();\n    const store = edit?.store;\n    const moves = row.edits.move.type === \"some\" ? row.edits.move.value : undefined;\n    // An event kind's row (#1196): the resource it stands for, which the event\n    // kinds' drags land on — their verdict, the ghost's words and the band.\n    const events = drop?.events;\n    const eventTarget = useMemo(() => events?.target(row), [events, row]);\n    const plotElRef = useRef<HTMLElement | null>(null);\n    /** The pointer as a window fraction of this row's plot. */\n    const fracAt = useCallback((clientX: number): number => {\n        const rect = plotElRef.current?.getBoundingClientRect();\n        return rect !== undefined && rect.width > 0 ? Math.max(0, Math.min(1, (clientX - rect.left) / rect.width)) : 0;\n    }, []);\n    /** Where a moved element lands on this row, with the pointer at `clientX` — told to the store, with the units it moved by. */\n    const landing = useCallback((clientX: number) => {\n        const grab = store?.grab;\n        if (store === undefined || grab === null || grab === undefined) return undefined;\n        const frac = fracAt(clientX);\n        const span = proposeAt(scale, grab.movable.span, grab.mode, grab.grabFrac, frac, store.shift);\n        store.propose({ rowKey: row.key, span, units: unitsBetween(scale, grab.grabFrac, frac, store.shift), fine: store.shift });\n        return { grab, span };\n    }, [store, scale, fracAt, row.key]);\n    /** The event element under a point in this row's plot, by its key — where an author's card lands (#1196, PB63). */\n    const eventAt = useCallback((clientX: number, clientY: number): string | undefined => {\n        const hit = document.elementFromPoint(clientX, clientY)?.closest(PLAN_EVENT_ELEMENT_SELECTOR);\n        if (hit === null || hit === undefined || plotElRef.current?.contains(hit) !== true) return undefined;\n        return hit.getAttribute(\"data-run\") ?? hit.getAttribute(\"data-event\") ?? hit.getAttribute(\"data-chip\") ?? hit.getAttribute(\"data-mark\") ?? undefined;\n    }, []);\n    const resolveCoord = useCallback((clientX: number, clientY: number, payload: DragPayload): CellCoord => {\n        const surface = drop?.surface ?? \"\";\n        if (payload.kind !== \"item\") {\n            const at = landing(clientX);\n            if (at === undefined) return { surface, row: row.key, slot: \"\" };\n            const slot = at.grab.mode === \"end\" ? slotOfEnd(scale, at.span.end) : slotOfInstant(scale, at.span.start);\n            return { surface, row: row.key, slot };\n        }\n        // The shared frac→bucket resolver (#617): the exact right edge closes\n        // into the last bucket; a truncated axis's uncovered remainder is NO\n        // bucket (#618) — the slot stays empty and `dropVeto` refuses it, so a\n        // drop past the truncation point can never land at a wrong instant.\n        const bi = scale.bucketAtFrac(fracAt(clientX));\n        const bucket = bi >= 0 ? scale.buckets[bi] : undefined;\n        const slot = bucket !== undefined ? toPlanSlot(bucket.start) : \"\";\n        // An author's card lands on the event under the pointer (#1196): the coordinate names it.\n        const event = eventTarget !== undefined && events?.landsOnEvent(payload.from.library) === true ? eventAt(clientX, clientY) : undefined;\n        return event !== undefined ? { surface, row: row.key, slot, event } : { surface, row: row.key, slot };\n    }, [scale, drop?.surface, row.key, landing, fracAt, eventTarget, events, eventAt]);\n    /** The landing the store holds for this row, when the drag rests on it — what the event kinds judge an element by. */\n    const landingHere = useCallback((): PlanProposal | undefined => {\n        const proposal = store?.proposal;\n        return proposal !== null && proposal !== undefined && proposal.rowKey === row.key ? proposal : undefined;\n    }, [store, row.key]);\n    /**\n     * Whether this row takes what is dragged at all — a card where its series\n     * makes one, an element of its item type; on an event kind's row, the\n     * event kinds' cards and elements (#1196).\n     */\n    const accepts = useCallback((payload: DragPayload): boolean => {\n        if (payload.kind === \"item\") {\n            return (eventTarget !== undefined && events?.takesCard(payload.from.library) === true)\n                || (row.edits.drop && drop?.cards === true && drop.libraries.has(payload.from.library));\n        }\n        const grab = store?.grab;\n        if (grab === null || grab === undefined) return false;\n        // The press armed what is dragged: the same element, from its row.\n        if (payload.from.event !== grab.movable.key || payload.from.row !== grab.movable.rowKey) return false;\n        // An event kind's element lands on the event kinds' rows, by its kind (#1196).\n        if (events?.isEvent(grab.movable) === true) {\n            return eventTarget !== undefined && (payload.kind !== \"edge\" || row.key === grab.movable.rowKey);\n        }\n        if (moves === undefined || drop?.data !== true) return false;\n        // An end moves along its own row only (the layer holds an edge there too).\n        return payload.kind === \"edge\" ? row.key === grab.movable.rowKey : moves.items === grab.movable.items;\n    }, [store, moves, row.edits.drop, row.key, drop, eventTarget, events]);\n    // The registered coord is the row at its FIRST bucket: it is what the\n    // drag-start sweep asks about, before the drag rests anywhere. A row the\n    // predicate can only ever refuse never lights up as a candidate, instead of\n    // promising a drop and taking it back on hover. It is only the opening\n    // AFFORDANCE — the layer asks again at every point the drag rests, and once\n    // more of the event it delivers, so a predicate that discriminates on the\n    // slot resolves per bucket.\n    const firstSlot = scale.buckets[0] !== undefined ? toPlanSlot(scale.buckets[0].start) : \"\";\n    const dropCoord = useMemo<CellCoord | null>(\n        () => (drop !== undefined ? { surface: drop.surface, row: row.key, slot: firstSlot } : null),\n        [drop, row.key, firstSlot],\n    );\n    const dropVeto = useCallback((candidate: DragEventValue): boolean => {\n        if (drop === undefined) return true;\n        // No bucket under the drag (past a truncated axis's coverage), or a\n        // moved element with no press to land by — structurally not a\n        // destination, before any predicate is asked.\n        const slot = candidate.type === \"add\" ? candidate.value.into.slot\n            : candidate.type === \"move\" ? candidate.value.to.slot\n                : candidate.type === \"resize\" ? candidate.value.event.slot : \"-\";\n        if (slot === \"\") return false;\n        // A row's items keep their keys unique (#825): an element from another\n        // row lands here only when none of this row's elements has its key.\n        if (candidate.type === \"move\" && candidate.value.from.row !== row.key\n            && candidate.value.from.event.type === \"some\" && holdsKey(row, candidate.value.from.event.value)) return false;\n        // An event kind's row is the event kinds' to judge (#1196): a card at the\n        // bucket — or on the event — under the pointer, an element where the\n        // landing put it (before it rests here, by the kinds alone).\n        if (eventTarget !== undefined && events !== undefined) {\n            if (candidate.type === \"add\") {\n                const into = candidate.value.into;\n                return events.card(row, candidate.value.from, into.slot, getSomeorUndefined(into.event)).allowed;\n            }\n            const grab = store?.grab;\n            if (grab === null || grab === undefined || !events.isEvent(grab.movable)) return false;\n            return events.element(row, grab.movable, landingHere()).allowed;\n        }\n        return drop.canDrop?.(candidate) ?? true;\n    }, [drop, row, eventTarget, events, store, landingHere]);\n    /** What the ghost says while the drag rests here (#1187): on an event kind's row, what lands where, or why not (#1196). */\n    const caption = useCallback((coord: CellCoord, payload: DragPayload): string | undefined => {\n        if (eventTarget === undefined || events === undefined) return undefined;\n        if (payload.kind === \"item\") return events.card(row, payload.from, coord.slot, coord.event).caption;\n        const grab = store?.grab;\n        if (grab === null || grab === undefined || !events.isEvent(grab.movable)) return undefined;\n        return events.element(row, grab.movable, landingHere()).caption;\n    }, [eventTarget, events, row, store, landingHere]);\n\n    // ── The landing band ──────────────────────────────────────────────────\n    // While a card is over this row, show WHERE it would come to rest. The\n    // band spans the bucket `resolveCoord` names, so the preview and the drop\n    // cannot disagree — they read the same geometry from the same rect.\n    //\n    // Positioned by writing the style DIRECTLY, never through React state: the\n    // layer tells the row each time the drag rests over it (a pointer move, a\n    // keyboard step), and routing that through state would re-render this row\n    // (and, through the shared reducer, the whole canvas) on every one.\n    // Whether the band is VISIBLE is not decided here at all — the recipe\n    // shows it only inside `[data-drop-active]`, which the drag layer sets on\n    // exactly the destination cell and never sets on a refused one, so a\n    // vetoed row shows no landing band for free.\n    const dragActive = useDragLayerOptional()?.active === true;\n    const previewRef = useRef<HTMLDivElement | null>(null);\n    const previewTextRef = useRef<HTMLSpanElement | null>(null);\n    const positionPreview = useCallback((clientX: number, clientY: number, payload: DragPayload) => {\n        const el = previewRef.current;\n        if (el === null) return;\n        if (payload.kind !== \"item\") {\n            // A moved element: the extent it would take, labelled with it.\n            const at = landing(clientX);\n            if (at === undefined || edit === null) return;\n            const { left, right } = spanFracs(scale, at.span);\n            el.style.left = `${left * 100}%`;\n            el.style.width = `${(right - left) * 100}%`;\n            if (previewTextRef.current !== null) previewTextRef.current.textContent = spanWords(scale, at.grab.movable, at.span, words);\n            return;\n        }\n        if (previewTextRef.current !== null) previewTextRef.current.textContent = \"\";\n        // The same resolver the drop coordinate reads (#617) — the preview and\n        // the drop cannot disagree. No bucket ⇒ the band stays where it was\n        // (the cell is not active there anyway — `dropVeto` refused it).\n        const bi = scale.bucketAtFrac(fracAt(clientX));\n        const bucket = bi >= 0 ? scale.buckets[bi] : undefined;\n        if (bucket === undefined) return;\n        // On an event kind's row (#1196) the band spans what the drop makes —\n        // a template's event for its duration, a backlog event for its own — or\n        // the event an author's card lands on.\n        const event = eventTarget !== undefined && events?.landsOnEvent(payload.from.library) === true ? eventAt(clientX, clientY) : undefined;\n        const span = eventTarget !== undefined ? events?.card(row, payload.from, toPlanSlot(bucket.start), event).span : undefined;\n        if (span !== undefined) {\n            const { left, right } = spanFracs(scale, span);\n            el.style.left = `${left * 100}%`;\n            el.style.width = `${(right - left) * 100}%`;\n            return;\n        }\n        el.style.left = `${bucket.x0 * 100}%`;\n        el.style.width = `${(bucket.x1 - bucket.x0) * 100}%`;\n    }, [scale, landing, fracAt, edit, words, eventTarget, events, eventAt, row]);\n\n    // A keyboard drag rests at bucket centres, the announcements name the row\n    // and its bucket — or, for a moved element, the span it would take — in\n    // the canvas's words, and wherever the drag rests over the row, its\n    // landing band follows.\n    const dropOptions = useMemo<DropCellOptions>(() => ({\n        stops: () => {\n            const rect = plotElRef.current?.getBoundingClientRect();\n            if (rect === undefined || rect.width <= 0) return [];\n            return scale.buckets.map((b) => rect.left + ((b.x0 + b.x1) / 2) * rect.width);\n        },\n        name: (coord, payload) => {\n            // An event kind's row is named by the resource it stands for (#1196) — a way\n            // of drawing after a resource's first is labelled with its kinds' names.\n            const label = (eventTarget !== undefined ? events?.where(row) : undefined) ?? gutter.label;\n            const proposal = store?.proposal;\n            if (payload.kind !== \"item\" && store?.grab != null && proposal != null && proposal.rowKey === row.key) {\n                return words.m.list({ parts: [label, spanWords(scale, store.grab.movable, proposal.span, words)] });\n            }\n            const bucket = scale.buckets.find((b) => toPlanSlot(b.start) === coord.slot);\n            return bucket !== undefined\n                ? words.m.list({ parts: [label, scale.bucketText(bucket)] })\n                : label;\n        },\n        onHover: positionPreview,\n        accepts,\n        caption,\n    }), [scale, words, gutter.label, positionPreview, accepts, caption, store, row, eventTarget, events]);\n    // The keyboard carry (#825) lands here: the landing band at the extent it\n    // would take, lit — or refused — as a drag's destination is.\n    const noSubscribe = useCallback(() => () => undefined, []);\n    const carry = useSyncExternalStore(store?.subscribe ?? noSubscribe, () => store?.carryOn(row.key) ?? null);\n    // Placed the way a pointer drag places it — written, not rendered — so the\n    // two never fight over the band.\n    useLayoutEffect(() => {\n        const el = previewRef.current;\n        if (carry === null || el === null) return;\n        const { left, right } = spanFracs(scale, carry.to.span);\n        el.style.left = `${left * 100}%`;\n        el.style.width = `${(right - left) * 100}%`;\n        if (previewTextRef.current !== null) previewTextRef.current.textContent = spanWords(scale, carry.movable, carry.to.span, words);\n    }, [carry, scale, words]);\n    const dropRef = useDropCell(dropCoord, false, dropVeto, resolveCoord, dropOptions);\n    // One ref doing two jobs: the layer's registration, and the rect\n    // `resolveCoord` measures the pointer against.\n    const plotRef = useCallback((el: HTMLDivElement | null) => {\n        plotElRef.current = el;\n        dropRef(el);\n    }, [dropRef]);\n\n    return (\n        <Box\n            ref={grid.ref}\n            css={styles.row}\n            style={{ gridTemplateColumns: gridTemplate, height: `${height}px` }}\n            role=\"row\"\n            aria-level={depth + 1}\n            aria-selected={selected}\n            aria-expanded={expandedState}\n            tabIndex={grid.tabIndex}\n            onFocus={grid.onFocus}\n            data-plan-item={rowItemKey(row.key)}\n            data-plan-row={row.key}\n            data-plan-kind={row.kind.type}\n            data-collapsible={caret !== undefined && ctx !== true ? \"\" : undefined}\n            // The height the model laid the row out at — a layout spec holds\n            // the rendered height to it, kind by kind (#817).\n            data-plan-h={height}\n            data-selected={selected ? \"\" : undefined}\n            data-group-end={groupEnd === true ? \"\" : undefined}\n            data-emphasis={emphasis}\n            data-ctx={ctxAttr}\n            data-expanded={expandedAttr}\n            // A drafted row (#880) — the Sheet's marks.\n            data-draft={draft !== undefined ? \"\" : undefined}\n            data-incomplete={draft === \"incomplete\" ? \"\" : undefined}\n            data-invalid={draft === \"invalid\" ? \"\" : undefined}\n            // A strip's whole job is to be the way back — clicking one returns\n            // to all rows rather than selecting the row underneath.\n            onClick={() => dispatch(ctx === true\n                ? { t: \"focus.clear\" }\n                : { t: \"row.select\", key: row.key })}\n            cursor=\"pointer\"\n        >\n            <Box\n                css={styles.gutterCell}\n                role=\"rowheader\"\n                data-expanded={expandedAttr}\n                // How many controls its line ends in — a chart's ticks step\n                // left of them (#1258).\n                data-plan-controls={controls !== undefined && controls.length > 0 ? String(controls.length) : undefined}\n                style={{ paddingLeft: `${12 + depth * INDENT_PX}px` }}\n                onClick={onCaretClick !== undefined && ctx !== true\n                    ? (e: React.MouseEvent) => { e.stopPropagation(); onCaretClick(); }\n                    : undefined}\n            >\n                <Box css={styles.gutterName} data-id={isId ? \"\" : undefined} data-ctx={ctxAttr} data-plan-gutter=\"name\"\n                    data-collapsible={caret !== undefined && ctx !== true ? \"\" : undefined}>\n                    {caret !== undefined && (\n                        <Box as=\"span\" css={styles.caret} data-collapsed={caret.collapsed ? \"\" : undefined}>\n                            <FontAwesomeIcon icon={faCaretDown} />\n                        </Box>\n                    )}\n                    {/* The links-focus family tag (R1) — settles in after the\n                        gather choreography — on its own line with the label,\n                        where it gives its room up first (#1277). */}\n                    {focusTag !== undefined ? (\n                        <Box css={styles.gutterNamed} data-plan-gutter=\"named\">\n                            <Box as=\"span\" css={styles.gutterLabel} data-plan-gutter=\"label\">{gutter.label}</Box>\n                            <Box as=\"span\" css={styles.focusTag} data-plan-focustag={focusTag}>{words.m.focusTag({ tag: focusTag })}</Box>\n                        </Box>\n                    ) : <Box as=\"span\" css={styles.gutterLabel} data-plan-gutter=\"label\">{gutter.label}</Box>}\n                    {/* §3 gutter anatomy: meta (an `.of` parent's aggregate\n                        tag), then value right-aligned, status dot rightmost —\n                        inline after the flex spacer so the label truncates. */}\n                    {(meta !== undefined || value !== undefined || statusTone !== undefined) && (\n                        <Box css={styles.gutterRight} data-plan-gutter=\"right\">\n                            {meta !== undefined && <Box as=\"span\" css={styles.gutterMeta} data-ctx={ctxAttr} data-plan-gutter=\"meta\">{meta}</Box>}\n                            {value !== undefined && <Box as=\"span\" css={styles.gutterValue} data-ctx={ctxAttr} data-plan-gutter=\"value\">{value}</Box>}\n                            {/* The dot's colour IS the status — its name says it (#819). */}\n                            {statusTone !== undefined && <Box as=\"span\" css={styles.statusDot} data-tone={statusTone}\n                                data-ctx={ctxAttr} role=\"img\" aria-label={statusText(statusTone, words)} />}\n                        </Box>\n                    )}\n                    {/* A compact chart's maximum is a normal trailing value; taller charts keep positioned axis ticks. */}\n                    {gutterOverlay}\n                    {/* Row controls (R1/R2) — at the line's end, always shown\n                        (#1258), each named by the canvas's tooltip\n                        (`root/overlays.tsx`); a control click never selects or\n                        toggles the row. Out of the tab order: the row's Tab\n                        walk reaches them (#819). */}\n                    {controls !== undefined && controls.length > 0 && (\n                        <Box css={styles.rowControls} data-ctx={ctxAttr}>\n                            {controls.map((c) => (\n                                <Box\n                                    key={c.kind}\n                                    as=\"button\"\n                                    css={styles.rowControl}\n                                    tabIndex={-1}\n                                    data-plan-control={c.kind}\n                                    data-active={c.active ? \"\" : undefined}\n                                    aria-label={c.kind === \"links\" ? words.m.linksControl() : words.m.expandControl()}\n                                    aria-pressed={c.active}\n                                    onClick={(e: React.MouseEvent) => { e.stopPropagation(); c.onClick(); }}\n                                >\n                                    <FontAwesomeIcon icon={c.kind === \"links\" ? faLink : faUpRightAndDownLeftFromCenter} />\n                                </Box>\n                            ))}\n                        </Box>\n                    )}\n                </Box>\n                {sub !== undefined && <Box css={styles.gutterSub} data-ctx={ctxAttr} data-plan-gutter=\"sub\">{sub}</Box>}\n                {gutter.swatches.length > 0 && (\n                    <Box display=\"flex\" gap=\"7px\" marginTop=\"1px\">\n                        {gutter.swatches.map((s, i) => (\n                            <Box key={i} as=\"span\" css={styles.gutterSwatch} data-ctx={ctxAttr}>\n                                <Box as=\"i\" background={resolveColor(system, s.color)} />\n                                {s.label}\n                            </Box>\n                        ))}\n                    </Box>\n                )}\n                {/* R2 — the space the grown gutter opens up is the author's\n                    (`expandGutter`), below the row's own identity lines. */}\n                {expandGutter !== undefined && (\n                    <Box css={styles.expandGutterBody} data-plan-expandgutter>{expandGutter}</Box>\n                )}\n            </Box>\n            <Box\n                ref={plotRef}\n                css={styles.plot}\n                role=\"gridcell\"\n                // What a pressed element measures its grab against (#825).\n                data-plan-plot\n                data-axis={axisMode}\n                // The keyboard carry's destination (#825), staged as a drag's is.\n                data-drop-active={carry !== null && !carry.refused ? \"\" : undefined}\n                data-drop-invalid={carry !== null && carry.refused ? \"\" : undefined}\n                // Its events still to land (#1398, CL2): busy, washed under what it holds.\n                aria-busy={unread === true ? true : undefined}\n                data-plan-unread={unread === true ? \"\" : undefined}\n                onPointerMove={(e) => {\n                    // While a drag is in flight the landing band IS the readout\n                    // (the layer positions it), so the hairline would only add a\n                    // second, competing mark.\n                    if (dragActive) return;\n                    const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n                    if (rect.width <= 0) return;\n                    // Display-only chrome — a direct DOM write through the\n                    // cursor channel, never the reducer: dispatching here\n                    // committed the whole canvas once per pointer event (#609).\n                    cursor.move((e.clientX - rect.left) / rect.width);\n                }}\n                onPointerLeave={() => { if (!dragActive) cursor.leave(); }}\n                // A click on the plot names the bucket it fell in (#1197) — first,\n                // so what was clicked in it selects the row after, the bucket kept.\n                // An event's element selects its event instead; a strip is the way back.\n                onClickCapture={(e: React.MouseEvent) => {\n                    if (ctx === true || (e.target as Element).closest(PLAN_EVENT_ELEMENT_SELECTOR) !== null) return;\n                    const bi = scale.bucketAtFrac(fracAt(e.clientX));\n                    const bucket = bi >= 0 ? scale.buckets[bi] : undefined;\n                    if (bucket !== undefined) dispatch({ t: \"row.select\", key: row.key, at: bucket.start });\n                }}\n            >\n                {/* Under everything the plot draws after it — the rules, the marks, the now line (#1398, CL2). */}\n                {unread === true && <LoadingWash />}\n                {noGrid !== true && <GridSeparators styles={styles} />}\n                {drop !== undefined && (\n                    <Box ref={previewRef} css={styles.dropPreview} data-plan-drop-preview>\n                        {/* A moved element's span, where the band draws it (#825). */}\n                        <Box as=\"span\" ref={previewTextRef} css={styles.dropPreviewText} data-plan-drop-preview-text />\n                    </Box>\n                )}\n                {/* Expanded: the row's own marks hold a band at the top (they\n                    position against it, so a 20px bar in a 200px row does not\n                    drift to the middle), and the render takes the rest. */}\n                {expanded ? (\n                    <>\n                        <Box css={styles.expandRowBand} style={{ height: `${band}px` }}>{children}</Box>\n                        <Box css={styles.expandRenderBody} data-plan-expandrender\n                            style={{ top: `${band + 2}px` }}>\n                            {expandBody}\n                        </Box>\n                    </>\n                ) : children}\n                {/* The shared hairline — positioned by the body's ONE\n                    `--plan-cursor-x` variable and shown only under\n                    `[data-plan-cursor]` (#609): a pointermove writes a style,\n                    renders nothing. Strips carry no hairline. */}\n                {ctx !== true && <Box css={styles.cursorLine} data-plan-cursorline />}\n                {scale.nowFrac !== undefined && <NowLine styles={styles} at={scale.nowFrac} data-plan-axisline data-plan-now />}\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A run of the Plan's rows not drawn yet (#1398, CL2) — an unloaded run of a\n * paged block (#577, #823), or a window whose read failed (#811) — as the\n * shared `UnloadedRun`: rows at the rows' pitch where the run meets the view,\n * each on the canvas's own two columns with the gutter's rule, the bucket grid\n * and the now line; its label a bar, and its sub line one on two-line rows;\n * its plot the region wash — no bar, card or event shape, so nothing implies\n * a time (CL2). The canvas cannot know how many rows an unvisited window\n * produces (a series emits several per source element, or none), so the\n * placeholder rows say nothing of a count: they are the rows' look at the\n * rows' pitch, and nothing else.\n *\n * Its height comes from the ledger, so the run and the rows that replace it\n * occupy exactly the same space: scrolling in loads content without moving\n * anything below, and eviction puts the run back with nothing shifting either.\n *\n * In the treegrid (#819) each run is ONE row, and its one cell — the grid's\n * row count says only what is known. A keyboard move past the rows read asks\n * the source for the window beside it and never lands on it (#1398, CL10); a\n * click into it gives it the focus, which it hands to its rows as they land.\n * Its placeholders are `aria-hidden` (CL12), and it is busy while its own\n * windows are in flight. A failed window says so once, in its first\n * row in view: the reason and Retry across its plot, its gutter kept; its\n * other rows keep the gutter column, the grid and the rules, their plots bare\n * (CL11). Its Retry is out of the tab order — the row's Tab walk reaches it.\n */\n\nimport { useMemo } from \"react\";\nimport { Box, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { UnloadedRun, loadingLineText, type RunCell, type RunFailure } from \"@elaraai/east-ui-components/internal\";\nimport { NowLine } from \"../../shared/time/now-line.js\";\nimport { bandElements, type PlanBand, type PlanWindowFailure } from \"../use-plan-paging.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { bodyItemKey } from \"../model.js\";\nimport { usePlanGeometry, usePlanScale } from \"../context.js\";\nimport { usePlanItemNav } from \"../controller/react.js\";\nimport { usePlanGridRow } from \"../root/grid.js\";\nimport { GridSeparators } from \"./RowShell.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** A recipe slot's styles, as the shared run merges them over its own. */\nconst slot = (styles: Styles, name: string): SystemStyleObject | undefined => styles[name] as SystemStyleObject | undefined;\n\n/** To the treegrid the run is one row, and its one cell (#819): the grid numbers no columns. */\nconst RUN_CELL = {};\n\n/** Props of {@link PlanRunRow}: an unloaded run, or a failed window. */\nexport interface PlanRunRowProps {\n    /** The unloaded run above or below a block's resident rows. */\n    band?: PlanBand | undefined;\n    /** A window whose read failed. */\n    failure?: PlanWindowFailure | undefined;\n    styles: Styles;\n    /** The rows' grid tracks: the gutter, then the plot. */\n    gridTemplate: string;\n    /** The rows' pitch, px: what the run's placeholder rows draw at. */\n    pitch: number;\n    /** What the rail counts the rows in — `work orders`: what a failed window's line names them by. */\n    noun: string;\n    /** Ask a failed window again. */\n    onRetry: (w: number) => void;\n}\n\n/** A run of rows not drawn yet — see the module docs. */\nexport function PlanRunRow({ band, failure, styles, gridTemplate, pitch, noun, onRetry }: PlanRunRowProps) {\n    const words = usePlanWords();\n    const { m } = words;\n    const scale = usePlanScale();\n    const geometry = usePlanGeometry();\n    const itemKey = band !== undefined ? bodyItemKey({ kind: \"band\", band }) : bodyItemKey({ kind: \"failed\", failure: failure! });\n    const { active, focusSeq } = usePlanItemNav(itemKey);\n    const grid = usePlanGridRow(itemKey, active, focusSeq);\n    const px = Math.max(0, band?.px ?? failure?.px ?? 0);\n    const from = band?.from ?? failure?.from ?? 0;\n    const to = band?.to ?? failure?.to ?? -1;\n    // The gutter's label — and its sub line on two-line rows — then the plot: the wash under the grid and the now line.\n    const nowFrac = scale.nowFrac;\n    const cells = useMemo((): RunCell[] => [\n        { kind: pitch >= geometry.rowStacked ? \"label2\" : \"label\", css: slot(styles, \"runGutter\") },\n        {\n            kind: \"wash\", css: slot(styles, \"runPlot\"),\n            overlay: <>\n                <GridSeparators styles={styles} />\n                {nowFrac !== undefined && <NowLine styles={styles} at={nowFrac} data-plan-axisline data-plan-now />}\n            </>,\n        },\n    ], [pitch, geometry.rowStacked, styles, nowFrac]);\n    // Said once, in its first row in view, across its plot: in the rail's noun, its elements 1-based as the footer's are.\n    const w = failure?.w;\n    const range = { from: words.number(from + 1), to: words.number(to + 1) };\n    const failed = useMemo((): RunFailure | undefined => (w === undefined ? undefined : {\n        message: loadingLineText(m.lineFailed({ noun, ...range })),\n        retry: { onRetry: () => onRetry(w), label: m.retry(), name: m.retryRange({ noun, ...range }), tabStop: false },\n        from: 1,\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- the range is its two formatted ends\n    }), [w, m, noun, range.from, range.to, onRetry]);\n    return (\n        <Box\n            ref={grid.ref}\n            css={styles.runBand}\n            role=\"row\"\n            aria-level={1}\n            tabIndex={grid.tabIndex}\n            onFocus={grid.onFocus}\n            data-plan-item={itemKey}\n            data-plan-window-band={band?.at}\n            data-plan-failed={w}\n            data-plan-elements={band !== undefined ? bandElements(band) : to - from + 1}\n            // The ledger-derived height, as data: the height itself is the run's, which a DOM test (jsdom resolves\n            // no Chakra classes) holds the geometry contract against (#613).\n            data-plan-px={Math.round(px)}\n            aria-busy={band?.loading !== undefined ? \"true\" : undefined}\n        >\n            <UnloadedRun height={px} pitch={pitch} columns={gridTemplate} cells={cells} first={from} rowCss={slot(styles, \"runRow\")} failed={failed} cell={RUN_CELL} />\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A render failure stays where it happened (#811).\n *\n * One boundary per PART of the canvas — a row's plot, an overlay body, the\n * expand render, the links layer. A throw while rendering one of them shows a\n * one-line fallback naming the part, and every other row, overlay and control\n * keeps working. (The only boundary used to be the Reactive's, around the\n * whole canvas: one author body that threw at render took everything with it.)\n *\n * The fallback carries `data-plan-error` naming the part — a stable id, the\n * same in every locale — and says so in the canvas's words (#820). It resets\n * when the part's input changes, so corrected data renders again without a\n * remount.\n */\n\nimport type { ReactNode } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { EastErrorBoundary } from \"@elaraai/east-ui-components/internal\";\nimport type { PlanPart } from \"../messages.js\";\nimport { usePlanWords } from \"../words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/**\n * A part's stable id — the fallback's `data-plan-error`: `popover`, or `row`\n * and the row's key (its id's canonical text, #822), which a label is not.\n *\n * @param part - The part\n * @returns Its id\n */\nexport function planPartId(part: PlanPart): string {\n    switch (part.kind) {\n        case \"row\": return `row ${part.key}`;\n        case \"group\": return `group ${part.label}`;\n        case \"expandRender\": return \"expand render\";\n        case \"expandGutter\": return \"expand gutter\";\n        case \"linksLayer\": return \"links layer\";\n        case \"popover\": return \"popover\";\n        case \"hoverCard\": return \"hover card\";\n    }\n}\n\nexport interface PlanPartBoundaryProps {\n    /** The part — a row, a group's strip, an overlay body, the expand render, the links layer. */\n    part: PlanPart;\n    /** The part's input — when it changes, the boundary tries again. */\n    resetKey: unknown;\n    /** The resolved `plan` recipe styles (the `partError` slot). */\n    styles: Styles;\n    children: ReactNode;\n}\n\n/**\n * Contain a render failure to one part of the canvas.\n *\n * @param props - The part's name, its reset input, the recipe styles and the part\n * @returns The part, or its one-line failure\n */\nexport function PlanPartBoundary({ part, resetKey, styles, children }: PlanPartBoundaryProps) {\n    const words = usePlanWords();\n    const id = planPartId(part);\n    return (\n        <EastErrorBoundary\n            title={`Plan ${id}`}\n            resetKey={resetKey}\n            fallback={({ message }) => (\n                <Box css={styles.partError} data-plan-error={id} role=\"alert\">\n                    {words.m.partFailed({ part: words.m.partName({ part }), message })}\n                </Box>\n            )}\n        >\n            {children}\n        </EastErrorBoundary>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's one shared scale (`Plan Spec.md` §3): pure arithmetic over the\n * axis's own numeric domain, with no DOM, testable in isolation.\n *\n * A scale is built from ONE of the three axis kinds (#631):\n *\n * - `time`: a half-open UTC window `[min, max)` divided by a calendar\n *   resolution (d3-time intervals; ISO weeks, Monday-start);\n * - `number`: a half-open numeric window `[min, max)` divided by a `step`,\n *   bucket edges on whole multiples of the step;\n * - `ordinal`: the declared values, one bucket each, in order.\n *\n * The engine that cuts a domain into buckets, and the time arm, are the time\n * parts the Plan shares with the Calendar (`../shared/time/scale.ts`, #1148);\n * this module adds the number and ordinal arms and the Plan's instants. Every\n * kind is the same thing to the engine, a numeric domain (epoch ms, the value,\n * the ordinal INDEX) with a period function over it, which is what keeps the\n * eight row renderers kind-agnostic: they consume fractions and bucket\n * indices, and only ever hand the scale an instant.\n *\n * Every row receives it through `PlanScaleContext` and positions against it.\n * An instant of ANOTHER arm than the scale's positions nowhere (`NaN` / `-1`\n * / `undefined`); the canvas diagnoses the mismatch by row\n * (`model.axisKindMismatches`) instead of misplacing anything.\n *\n * On an ordinal scale an interval's END names its LAST bucket (inclusive):\n * values are buckets, not edges, so `[PLATES, FINISH]` covers PLATES, PRINT\n * and FINISH, and `endFracOf` is the far edge of the named bucket. On the\n * other two kinds intervals stay half-open, and `endFracOf` is `fracOf`.\n *\n * @packageDocumentation\n */\n\nimport { tickFormatter, type TickFormat } from \"@elaraai/east-ui-components/internal\";\nimport {\n    OVERSCAN_BUCKETS, bucketScale, timeDomain,\n    type Scale, type ScaleBucket, type ScaleDomain, type ScalePeriod, type TimeResolution, type TimeWindow,\n} from \"../shared/time/scale.js\";\nimport { numberInstant, ordinalInstant, timeInstant, type PlanAxisKind, type PlanInstantValue } from \"./instant.js\";\nimport { toPlanSlot } from \"./slot.js\";\nimport { PLAN_WORDS, type PlanWords } from \"./words.js\";\n\n/** A concrete bucket resolution: the IR `TimeResolutionType` with `auto` resolved away. */\nexport type PlanResolution = TimeResolution;\n\n/** A half-open time window `[min, max)`. */\nexport type PlanWindow = TimeWindow;\n\nconst DAY_MS = 86_400_000;\n\n/**\n * Resolve the declared resolution (`auto` → window-derived): ≤ 14 days ⇒\n * `day`, ≤ ~40 weeks ⇒ `week` (the Plan's home unit), else `month`.\n *\n * @param declared - The IR resolution tag (may be `\"auto\"` or undefined)\n * @param window - The resolved window the buckets span\n * @returns The concrete resolution\n */\nexport function effectiveResolution(declared: string | undefined, window: PlanWindow): PlanResolution {\n    if (declared !== undefined && declared !== \"auto\") return declared as PlanResolution;\n    const span = window.max.getTime() - window.min.getTime();\n    if (span <= 14 * DAY_MS) return \"day\";\n    if (span <= 280 * DAY_MS) return \"week\";\n    return \"month\";\n}\n\n/** One bucket of the scale. */\nexport type PlanBucket = ScaleBucket<PlanInstantValue>;\n\n/**\n * What a scale is built from: the decoded axis arm plus the resolved window\n * (slice range ▸ declared), as plain values.\n *\n * Every arm takes the canvas's `words` (#820): the locale its ruler labels and\n * its words for a reader format in ({@link PLAN_WORDS} when omitted).\n *\n * @property time - A UTC window divided by a calendar resolution; `format` a date-token pattern\n * @property number - A numeric window divided by `step`; `format` the shared value format (`Chart.format.*`)\n * @property ordinal - The declared values, one bucket each\n */\nexport type PlanScaleSpec =\n    | { kind: \"time\"; window: PlanWindow; resolution: PlanResolution; now?: Date | undefined; format?: string | undefined; words?: PlanWords | undefined }\n    | { kind: \"number\"; window: { min: number; max: number }; step: number; now?: number | undefined; format?: TickFormat | undefined; words?: PlanWords | undefined }\n    | { kind: \"ordinal\"; values: readonly string[]; now?: string | undefined; words?: PlanWords | undefined };\n\n/**\n * The one shared scale every row positions against: the window, the buckets,\n * and the continuous and quantised mappings, over the Plan's instants\n * (`{ time | number | ordinal }`). One of another arm positions nowhere.\n */\nexport type PlanScale = Scale<PlanInstantValue, PlanAxisKind>;\n\n/** The periods handed out so far, by key: one object per period (see `Scale.period`). */\nconst PERIODS = new Map<string, ScalePeriod<PlanInstantValue>>();\n\n/** A `time` instant's epoch ms; `NaN` for an instant of another arm. */\nconst timeMs = (t: PlanInstantValue): number => (t.type === \"time\" ? t.value.getTime() : NaN);\n\nfunction numberDomain(spec: Extract<PlanScaleSpec, { kind: \"number\" }>): ScaleDomain<PlanInstantValue, PlanAxisKind> | undefined {\n    const step = spec.step;\n    if (!Number.isFinite(step) || !(step > 0)) return undefined;\n    // A hair of tolerance so `floor(3 × 0.1)` is 0.3, not 0.2.\n    const eps = step * 1e-9;\n    const fmt = tickFormatter(spec.format, \"linear\", (spec.words ?? PLAN_WORDS).locale);\n    const offset = (n: number, k: number): number => n + k * step;\n    return {\n        kind: \"number\",\n        periodKey: `number:${step}`,\n        minN: spec.window.min,\n        maxN: spec.window.max,\n        floor: (n) => Math.floor((n + eps) / step) * step,\n        offset,\n        // A number axis's bucket is its step: a move takes whole steps.\n        shift: offset,\n        fineUnit: undefined,\n        toN: (t) => (t.type === \"number\" ? t.value : NaN),\n        fromN: (n) => numberInstant(n),\n        slot: toPlanSlot,\n        label: (n) => fmt(n),\n        text: (n) => fmt(n),\n        periodText: (n) => fmt(n),\n        overscan: OVERSCAN_BUCKETS,\n        endInclusive: false,\n        bounded: false,\n        resolution: undefined,\n        now: spec.now,\n    };\n}\n\nfunction ordinalDomain(spec: Extract<PlanScaleSpec, { kind: \"ordinal\" }>): ScaleDomain<PlanInstantValue, PlanAxisKind> | undefined {\n    // A repeated value is ONE bucket (its first occurrence), like a repeated\n    // row key is one row.\n    const values = Array.from(new Set(spec.values));\n    if (values.length === 0) return undefined;\n    const index = new Map<string, number>(values.map((v, i) => [v, i]));\n    const last = values.length - 1;\n    const at = (n: number): string => values[Math.max(0, Math.min(last, Math.floor(n + 1e-9)))]!;\n    const offset = (n: number, k: number): number => n + k;\n    return {\n        kind: \"ordinal\",\n        // Every value is its own bucket: an ordinal period is the identity,\n        // whatever the list (`periodFloor` below maps a value to itself).\n        periodKey: \"ordinal\",\n        minN: 0,\n        maxN: values.length,\n        floor: (n) => Math.floor(n + 1e-9),\n        offset,\n        // A move walks the list, a value at a time.\n        shift: offset,\n        fineUnit: undefined,\n        toN: (t) => (t.type === \"ordinal\" ? (index.get(t.value) ?? NaN) : NaN),\n        fromN: (n) => ordinalInstant(at(n)),\n        slot: toPlanSlot,\n        label: (n) => at(n),\n        text: (n) => at(n),\n        periodText: (n) => at(n),\n        overscan: 0,\n        endInclusive: true,\n        bounded: true,\n        // A value outside the list stays itself, as it does under `floor`.\n        periodFloor: (t) => t,\n        resolution: undefined,\n        now: spec.now !== undefined ? index.get(spec.now) : undefined,\n    };\n}\n\n/**\n * Build the shared scale for an axis spec.\n *\n * The window widens OUTWARD to whole periods (#949): a 12-week window at MONTH\n * resolution draws whole months (June to September); an aligned window is\n * unchanged, so a 12-week window at WEEK resolution is exactly 12 equal\n * columns, and a `[1, 9)` number window at step 1 eight columns labelled `1` …\n * `8`. An ordinal scale is its list: one bucket per value, labelled by it.\n *\n * @param spec - The axis kind with its resolved window / period / values\n * @returns The scale, or `undefined` for an empty or inverted window, a\n *   non-positive step or an empty list\n */\nexport function planScale(spec: PlanScaleSpec): PlanScale | undefined {\n    const dom: ScaleDomain<PlanInstantValue, PlanAxisKind> | undefined = spec.kind === \"time\"\n        ? timeDomain({ ...spec, words: spec.words ?? PLAN_WORDS }, timeInstant, timeMs)\n        : spec.kind === \"number\" ? numberDomain(spec)\n            : ordinalDomain(spec);\n    return dom !== undefined ? bucketScale(dom, PERIODS) : undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The canvas axis, resolved (#631) — from the decoded root `axis` (one of\n * the three arms) and the window and resolution the sources of the Plan's\n * slice hold (#1344, `root/window.ts`) to the one `PlanScale` every row\n * positions against. A source's range speaks the axis's arm — `datetime` on a\n * time axis, `float` / `integer` on a number axis, none on an ordinal one (its\n * list is its window) — and a window written to it is the record slice's own\n * (`setRecordSliceWindow`), half-open on the axis's domain.\n *\n * The window is never fitted to the rows (#822): it is the sources' range or\n * the axis's stated window, so the canvas reads the same inline and paged,\n * and rows landing or changing never move it.\n *\n * @packageDocumentation\n */\n\nimport { variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { effectiveResolution, planScale, type PlanScale } from \"./scale.js\";\nimport type { PlanInstantValue } from \"./instant.js\";\nimport type { PlanWords } from \"./words.js\";\n\n/** The decoded axis declaration — `{ time | number | ordinal }`. */\nexport type PlanAxisValue = ValueTypeOf<typeof Plan.Types.Axis>;\n\n/** The declared `now`, as an instant on the axis's arm. */\nexport function axisNow(axis: PlanAxisValue): PlanInstantValue | undefined {\n    switch (axis.type) {\n        case \"time\": {\n            const d = getSomeorUndefined(axis.value.now);\n            return d !== undefined ? (variant(\"time\", d) as PlanInstantValue) : undefined;\n        }\n        case \"number\": {\n            const n = getSomeorUndefined(axis.value.now);\n            return n !== undefined ? (variant(\"number\", n) as PlanInstantValue) : undefined;\n        }\n        case \"ordinal\": {\n            const s = getSomeorUndefined(axis.value.now);\n            return s !== undefined ? (variant(\"ordinal\", s) as PlanInstantValue) : undefined;\n        }\n    }\n}\n\n/** The resolution segment options — a `time` axis only (`step` is fixed on\n *  a number axis; an ordinal list has no unit). */\nexport function axisResolutions(axis: PlanAxisValue): string[] {\n    return axis.type === \"time\" ? axis.value.resolutions.map((r) => r.type) : [];\n}\n\n/**\n * Whether the axis states its own window — a time or number axis's `window`;\n * an ordinal axis's list is its window. An axis that states none takes its\n * window from the sources' range (#822, #1344).\n *\n * @param axis - The decoded root axis\n * @returns `true` when the axis supplies a window without the slice\n */\nexport function axisStatesWindow(axis: PlanAxisValue): boolean {\n    return axis.type === \"ordinal\" || axis.value.window.type === \"some\";\n}\n\n/** An ordinal axis's value → index map (what orders its instants); `undefined` otherwise. */\nexport function ordinalIndexOf(axis: PlanAxisValue): ReadonlyMap<string, number> | undefined {\n    if (axis.type !== \"ordinal\") return undefined;\n    const index = new Map<string, number>();\n    axis.value.values.forEach((v, i) => { if (!index.has(v)) index.set(v, i); });\n    return index;\n}\n\n/** What {@link resolveScale} needs — the declaration and the slice's say. */\nexport interface ResolveScaleArgs {\n    /** The decoded root axis. */\n    axis: PlanAxisValue;\n    /** The sources' window on this axis's domain, `[from, to)` (`root/window.ts`); `undefined` while none holds one. */\n    sliceWindow: readonly [number, number] | undefined;\n    /** The resolution the slice holds, when it holds one (a time axis only). */\n    sliceResolution: string | undefined;\n    /** The canvas's words — the locale its ruler labels format in (#820); the default English `en-US` words when omitted. */\n    words?: PlanWords | undefined;\n}\n\n/**\n * Resolve the scale: the sources' range ▸ the axis's stated window (§3/§8).\n *\n * @remarks\n * Never the rows (#822): a window fitted to the data would be fitted to\n * whatever has loaded, so the axis would widen and every bar re-flow as a\n * paged canvas's windows land, and an inline canvas would read differently\n * from the same data paged. The rows are no input, so a canvas keeps ONE scale\n * while rows change under it (#812). An ordinal axis needs nothing resolved —\n * its list is its window.\n *\n * @param args - See {@link ResolveScaleArgs}\n * @returns The scale, or `undefined` when neither states a window\n */\nexport function resolveScale({ axis, sliceWindow, sliceResolution, words }: ResolveScaleArgs): PlanScale | undefined {\n    switch (axis.type) {\n        case \"time\": {\n            const a = axis.value;\n            const declared = getSomeorUndefined(a.window);\n            const window = sliceWindow !== undefined\n                ? { min: new Date(sliceWindow[0]), max: new Date(sliceWindow[1]) }\n                : (declared !== undefined ? { min: declared.min, max: declared.max } : undefined);\n            if (window === undefined) return undefined;\n            const res = effectiveResolution(sliceResolution ?? a.resolution.type, window);\n            return planScale({\n                kind: \"time\", window, resolution: res,\n                now: getSomeorUndefined(a.now), format: getSomeorUndefined(a.format), words,\n            });\n        }\n        case \"number\": {\n            const a = axis.value;\n            const step = a.step;\n            if (!Number.isFinite(step) || !(step > 0)) return undefined;\n            const declared = getSomeorUndefined(a.window);\n            const window = sliceWindow !== undefined\n                ? { min: sliceWindow[0], max: sliceWindow[1] }\n                : (declared !== undefined ? { min: declared.min, max: declared.max } : undefined);\n            if (window === undefined) return undefined;\n            return planScale({\n                kind: \"number\", window, step,\n                now: getSomeorUndefined(a.now), format: getSomeorUndefined(a.format), words,\n            });\n        }\n        case \"ordinal\":\n            return planScale({ kind: \"ordinal\", values: axis.value.values, now: getSomeorUndefined(axis.value.now), words });\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The sources of a Plan's one `Slice.bindRecords` (#1344), place by place:\n * the `rows` source gives the canvas its rows, paged from it; a source named\n * after an event kind narrows that kind's events and its backlog, its reads\n * the kind's own; a resource kind's narrows that kind's rows and Choosers — a\n * paged kind's gives it its windows, its narrowing's rows; and a templates\n * list's and an author's tab's narrow those cards. Every source holding a\n * `range` of the axis's arm holds the window with the others, but the\n * canvas's rows' — the `rows` source and each resource kind's — which the\n * dates on screen never narrow.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport type { PlanPayloadType } from \"@elaraai/e3-ui/internal\";\nimport type { RecordSliceBindType, RecordSlicesChromeType } from \"@elaraai/east-ui/internal\";\nimport type { PlanAxisKind } from \"../instant.js\";\nimport type { PlanRootValue } from \"../model.js\";\n\n/** One record Slice's controls: a source's part of the slice. */\nexport type PlanSourcePart = ValueTypeOf<RecordSliceBindType>;\n\n/** The rail's chrome, as the canvas's root carries it. */\nexport type PlanSlicesChrome = ValueTypeOf<RecordSlicesChromeType>;\n\n/** One event kind, as the Plan's payload carries it. */\ntype PlanEventKindValue = ValueTypeOf<typeof PlanPayloadType>[\"events\"][number];\n\n/** An event kind narrowed through its source of the slice: the kind, and its part. */\nexport interface PlanEventPart {\n    /** The event kind. */\n    readonly kind: PlanEventKindValue;\n    /** Its source's part of the slice: the Slice its reads, its counts and its Save notice go through. */\n    readonly part: PlanSourcePart;\n}\n\n/** The source of a Plan's slice that gives the canvas its rows. */\nexport const ROWS_SOURCE = \"rows\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * The rail's chrome, when the Plan has a slice.\n *\n * @param value - The canvas's root\n * @returns Its chrome; `undefined` with no slice\n */\nexport function planSlices(value: PlanRootValue): PlanSlicesChrome | undefined {\n    return value.slice.type === \"some\" ? value.slice.value : undefined;\n}\n\n/**\n * One source's part of the slice, by its name.\n *\n * @param chrome - The rail's chrome; `undefined` with no slice\n * @param source - The source's name (`rows`, an event kind's slot)\n * @returns Its part; `undefined` when the slice has no source of that name\n */\nexport function planPart(chrome: PlanSlicesChrome | undefined, source: string): PlanSourcePart | undefined {\n    return chrome?.slice.parts.find((part) => stringEqual(part.source, source))?.slice;\n}\n\n/**\n * The event kinds narrowed through their sources: each kind the slice names a\n * source after, in the kinds' order.\n *\n * @param chrome - The rail's chrome; `undefined` with no slice\n * @param kinds - The Plan's event kinds\n * @returns Each such kind and its part\n */\nexport function planEventParts(chrome: PlanSlicesChrome | undefined, kinds: readonly PlanEventKindValue[]): PlanEventPart[] {\n    return kinds.flatMap((kind) => {\n        const part = planPart(chrome, kind.key);\n        return part === undefined ? [] : [{ kind, part }];\n    });\n}\n\n/** The range field's kind the axis reads a window in: `datetime` on a time axis, a number on a number axis, none on an ordinal one. */\nfunction fitsAxis(fieldKind: string, axis: PlanAxisKind): boolean {\n    return axis === \"time\" ? stringEqual(fieldKind, \"datetime\") : axis === \"number\" && (stringEqual(fieldKind, \"integer\") || stringEqual(fieldKind, \"float\"));\n}\n\n/** The sources whose ranges never hold the window while a canvas names no others: its `rows` source. */\nexport const PLAN_ROW_SOURCES: readonly string[] = [ROWS_SOURCE];\n\n/**\n * The sources whose ranges never hold the window (#1344): the canvas's rows —\n * the `rows` source's, and each resource kind's — which the dates on screen\n * never narrow, so a pan, a step, the brush or a key reads no row again. A\n * date field there is a field of the rail the viewer sets.\n *\n * @param resources - The Plan's resource kinds\n * @returns Their sources' names, the `rows` source's first\n */\nexport function planRowSources(resources: readonly PlanResourceKindValue[]): readonly string[] {\n    return resources.length === 0 ? PLAN_ROW_SOURCES : [ROWS_SOURCE, ...resources.map((kind) => kind.key)];\n}\n\n/**\n * The sources holding the window: each part whose range field speaks the\n * axis's arm, in the slice's order — the first leads — but the canvas's\n * rows', whose ranges never hold it.\n *\n * @param chrome - The rail's chrome; `undefined` with no slice\n * @param axis - The axis kind\n * @param rows - The sources whose ranges never hold the window ({@link planRowSources}); the `rows` source alone when omitted\n * @returns Each such source's name and part\n */\nexport function planWindowParts(\n    chrome: PlanSlicesChrome | undefined, axis: PlanAxisKind, rows: readonly string[] = PLAN_ROW_SOURCES,\n): { readonly source: string; readonly part: PlanSourcePart }[] {\n    if (chrome === undefined || axis === \"ordinal\") return [];\n    return chrome.slice.parts.flatMap(({ source, slice }) => {\n        if (rows.some((name) => stringEqual(name, source))) return [];\n        const range = slice.config.range;\n        if (range.type === \"none\") return [];\n        const field = slice.config.fields.find((f) => stringEqual(f.fieldId, range.value));\n        return field !== undefined && !field.set && fitsAxis(field.kind, axis) ? [{ source, part: slice }] : [];\n    });\n}\n\n/** One resource kind, as the Plan's payload carries it. */\ntype PlanResourceKindValue = ValueTypeOf<typeof PlanPayloadType>[\"resources\"][number];\n\n/** One of the library's tabs, as the Plan's payload carries it. */\ntype PlanLibraryTabValue = ValueTypeOf<typeof PlanPayloadType>[\"library\"][number];\n\n/**\n * The sources the Plan's frame follows itself, beside the `rows` source and\n * the event kinds', which the canvas reads through their parts: each resource\n * kind's the slice holds, whose shown keys narrow its rows and its Choosers —\n * but a paged kind's, whose windows are its narrowing's rows themselves\n * (#1344), so the frame reads none of its keys; each templates list's, whose\n * keys narrow the Events tab; and each an author's tab names — each once, in\n * that order.\n *\n * @param value - The Plan's payload\n * @returns The sources' names\n */\nexport function planFollowedSources(value: ValueTypeOf<typeof PlanPayloadType>): string[] {\n    const parts = planSlices(value.plan)?.slice.parts ?? [];\n    const held = (name: string) => parts.some((part) => stringEqual(part.source, name));\n    // A paged kind's source is read where its windows are (#1344): following it would read every key it shows.\n    const paged = value.paged.type === \"some\" ? value.paged.value.kind : undefined;\n    const follows = (name: string) => held(name) && (paged === undefined || !stringEqual(name, paged));\n    const named = [\n        ...value.resources.map((kind) => kind.key).filter(follows),\n        ...value.events.flatMap((kind) => (kind.templatesSource.type === \"some\" ? [kind.templatesSource.value] : [])),\n        ...value.library.flatMap((tab) => (tab.type === \"tab\" && tab.value.source.type === \"some\" ? [tab.value.source.value] : [])),\n    ];\n    return named.filter((name, i) => named.findIndex((other) => stringEqual(other, name)) === i);\n}\n\n/**\n * What the rail counts each source in, and heads it with folded, where the\n * source has no label of its own: the canvas's rows, an event kind's events\n * (`print job events`), a kind's templates, a resource kind's name, a tab's —\n * each as running text writes it, the first that names a source keeping it.\n *\n * @param kinds - The Plan's event kinds\n * @param resources - Its resource kinds\n * @param tabs - Its library's tabs\n * @param locale - The app's locale\n * @returns Each source's noun, by its name\n */\nexport function planNouns(kinds: readonly PlanEventKindValue[], resources: readonly PlanResourceKindValue[], tabs: readonly PlanLibraryTabValue[], locale: string): Record<string, string> {\n    const lower = (text: string) => text.toLocaleLowerCase(locale);\n    const nouns: Record<string, string> = { [ROWS_SOURCE]: \"rows\" };\n    for (const kind of kinds) nouns[kind.key] ??= `${lower(kind.name)} events`;\n    for (const kind of kinds) if (kind.templatesSource.type === \"some\") nouns[kind.templatesSource.value] ??= `${lower(kind.name)} templates`;\n    for (const kind of resources) nouns[kind.key] ??= lower(kind.name);\n    for (const tab of tabs) if (tab.type === \"tab\" && tab.value.source.type === \"some\") nouns[tab.value.source.value] ??= lower(tab.value.name);\n    return nouns;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's editing session (#880) — the session every editable collection\n * shares (`useEditSession`, #879), over the canvas's top-level ENTRIES.\n *\n * A gesture on a row — a card dropped on it, an element moved or resized on\n * it (#825) — drafts the entry the row came from, whole: the canvas hands the\n * entry and the gesture to the series that made the row (`editing.write`),\n * which writes the fields it declares, and the session records the entry\n * before and after as one undoable transaction.\n *\n * The canvas draws the drafted entries by deriving their rows again, so a\n * draft looks exactly as the saved batch will: inline, the whole canvas with\n * the drafts in their entries' place (`editing.derive`); paged, a source whose\n * windows are derived with the drafts in them — ONE wrapper per source (a host\n * function is equivalent only to itself, so a new wrapper would drop the\n * driver's windows) that reads the latest drafts through a ref and names a new\n * revision per drafts version, which the paging driver reads as its snapshot\n * moving: it keeps the rows it has as stand-ins until the drafted windows land\n * (#821). A drafted row that differs from its entry's rows as the source holds\n * them carries the Sheet's marks — pending, and incomplete or invalid while a\n * check refuses its entry.\n *\n * Beside a Plan's event kinds (#1194), the session joins the Plan's one\n * history (`edit/events.ts`): its gestures are steps of it, in the order they\n * were made among the kinds', and Undo, Redo, Discard and Save are the\n * history's.\n *\n * When the rows are the `rows` source of the Plan's slice (#1344), the session\n * is the record's — its editing identity the source's record, whatever its\n * narrowing — an entry is read back by its key outside every narrowing, and a\n * Save that moves entries out of it says so (`prepareRecordSliceSave`).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport {\n    DateTimeType, NullType, StringType, decodeBeast2For, encodeBeast2For, equalFor, equivalentFor, fromEastTypeValue, none, parseFor, printFor, some,\n    toEastTypeValue, variant, type PatchPath, type ValueTypeOf,\n} from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport {\n    EntryRefType, historyKeyOf, useEditSession, useTrackedEvaluation, type EditHistory, type EditingValue, type EditSession, type EditSessionBinding, type EntryUpdate, type EntryVersion,\n    type Origin, type HistoryAction, type DragEventValue,\n} from \"@elaraai/east-ui-components\";\nimport { type EditSource, kindOfIssue, standingBeforeSave, wholeEntryReadiness, windowedSourceOf, prepareRecordSliceSave, recordSliceReadEntries } from \"@elaraai/east-ui-components/internal\";\nimport { fromPlanSlot } from \"./slot.js\";\nimport type { PlanMoveRequest } from \"./edit/use-carry.js\";\nimport { PLAN_PAGE_SIZE, windowedArm, type PlanPagedSourceValue } from \"./use-plan-paging.js\";\nimport { rowIdOfKey, rowKeyOf, type PlanRootValue, type PlanRowId, type PlanRowValue, type PlanWireBlock } from \"./model.js\";\nimport type { RowKey } from \"./plan-state.js\";\nimport { planPart, planSlices, ROWS_SOURCE } from \"./root/sources.js\";\nimport { mintKey } from \"../shared/schedule/records.js\";\nimport { entriesByKeyOf, readSinceAnswerOf } from \"../platform/paged-runtime.js\";\nimport type { PlanWholeRows } from \"./root/nested.js\";\nimport type { PlanTypedValue } from \"./edit/typing.js\";\n\n/** The decoded Plan editing declaration (the root's `editing` some-value). */\nexport type PlanEditingValue = ValueTypeOf<typeof Plan.Types.Editing>;\n/** A gesture — what a draft is made by. */\ntype PlanGesture = ValueTypeOf<typeof Plan.Types.Gesture>;\n\n/** One entry as the session holds it — its id. What it draws is derived when a mark needs it. */\nexport interface PlanEntryRef {\n    /** The entry's id — its key's text, the first segment of its rows' paths. */\n    readonly id: string;\n}\n\n/** A drafted row's mark — the Sheet's (#879). */\nexport type PlanDraftMark = \"pending\" | \"incomplete\" | \"invalid\";\n\n/** What {@link usePlanEditing} hands the canvas. */\nexport interface PlanEditing {\n    /** Whether the root declares editing at all. */\n    enabled: boolean;\n    /** The session — the history bar reads it. */\n    session: EditSession<PlanEntryRef>;\n    /** The session's key in the Plan's one history, beside its event kinds' (#1194). */\n    historyKey: string;\n    /** Whether a gesture can be drafted now: a base observed, the session writable. */\n    available: boolean;\n    /** The session's version — moves with every change to it. */\n    version: number;\n    /** The root with the drafted entries in place — what the canvas draws. */\n    value: PlanRootValue;\n    /** Its data-stable twin: a new identity only when the data or the drafts moved. */\n    data: PlanRootValue;\n    /** Moves when the drafted entries do — a paged canvas reads its windows again then. */\n    draftsVersion: number;\n    /** The drafted entries, each whole, by id, and their version: what a window over rows read lean draws in their place (#1438). */\n    drafted: { readonly drafts: ReadonlyMap<string, Uint8Array>; readonly version: number };\n    /** Each drafted row's mark, by row key. */\n    marks: ReadonlyMap<RowKey, PlanDraftMark>;\n    /**\n     * A card dropped on a row — drafted into its entry. Stable.\n     *\n     * @returns Whether it was drafted — `false` when the session cannot take\n     *   it or the row's series refused it (a job the row's list already\n     *   holds, #825)\n     */\n    drop(event: DragEventValue): boolean;\n    /**\n     * A run, chip, tile or mark moved or resized (#825) — drafted into the\n     * entry its row came from, and, when it lands on a row of another entry,\n     * that entry too, as ONE gesture. Stable.\n     *\n     * @returns Whether it was drafted — `false` when the session cannot take\n     *   it or no series wrote it (the item is never taken without being put)\n     */\n    move(request: PlanMoveRequest): boolean;\n    /**\n     * A number typed into a table cell, or the cell cleared (#1436, #1438) —\n     * drafted into the entry its row came from as one step, labelled as the\n     * history names it. Stable.\n     *\n     * @returns Whether it was drafted — `false` when the session cannot take\n     *   it or the row's series wrote nothing (a fraction where its values are\n     *   whole, a cleared cell holding none)\n     */\n    typeValue(typed: PlanTypedValue, label: string): boolean;\n    /**\n     * The rows a gesture waits on, being read whole (#1438): the canvas draws\n     * them, and the rows above them, as in flight until they land and the\n     * gesture is drafted.\n     */\n    inFlight: ReadonlySet<RowKey>;\n    /** A history bar action. Stable. */\n    action(action: HistoryAction): void;\n}\n\n/** What {@link usePlanEditing} reads. */\nexport interface PlanEditingArgs {\n    /** The latest root, as the host gave it. */\n    value: PlanRootValue;\n    /** Its data-stable twin. */\n    data: PlanRootValue;\n    /**\n     * Over rows read lean beside their nested series index (#1438), the rows\n     * read whole by key: a gesture drafts each row it touches read whole, and\n     * a Save is confirmed by them.\n     */\n    whole?: PlanWholeRows | undefined;\n    /** The canvas rows the source holds — inline, every row; paged, the resident windows'. */\n    rows: readonly PlanRowValue[];\n    /** Which window each paged row came from. */\n    origin: ReadonlyMap<RowKey, { w: number }>;\n    /** The view's key. */\n    storageKey: string;\n    /** A row's name, for a transaction's label — its gutter label. */\n    labelOf: (key: RowKey) => string;\n    /**\n     * The Plan's one history (#1194), once it holds this session beside its\n     * event kinds': a gesture is one step of it, and the history actions are\n     * its. Without it — or before it holds the session — the session's own.\n     */\n    history?: { readonly current: EditHistory<PlanEntryRef> | undefined } | undefined;\n    /**\n     * The stored entry the window the canvas draws at a source position read with the entry of an id (#1599, the\n     * paging driver's): what a gesture on a row the canvas shows begins from while its window is read again — after a\n     * Save, or another session's write — never a read at the revision the source reads at now, which is on its way.\n     */\n    entryOf?: ((id: string, at: number) => Uint8Array | undefined) | undefined;\n    /**\n     * Whether the window the canvas draws at a source position has landed at the revision it reads at (#1599, the\n     * paging driver's): what a Save landed of an entry there is drawn over its window until then, and is the window's\n     * own to draw from then on.\n     */\n    landedAt?: ((at: number) => boolean) | undefined;\n}\n\n/**\n * Every element key the rows hold (#1436) — a run's, a decision's, a tile's, a\n * chip's or a mark's, each its item's id: what a dropped card's new item is\n * minted apart from.\n *\n * @param rows - The canvas rows the source holds\n * @returns Their elements' keys\n */\nfunction elementKeysOf(rows: readonly PlanRowValue[]): Set<string> {\n    const keys = new Set<string>();\n    for (const row of rows) {\n        const kind = row.kind;\n        if (kind.type === \"span\") {\n            for (const run of kind.value.runs) keys.add(run.key);\n            for (const decision of kind.value.decisions) keys.add(decision.key);\n        } else if (kind.type === \"buckets\") {\n            for (const tile of kind.value.events) keys.add(tile.key);\n        } else if (kind.type === \"cards\") {\n            for (const chip of kind.value.chips) keys.add(chip.key);\n        } else if (kind.type === \"events\") {\n            for (const mark of kind.value.marks) keys.add(mark.key);\n        }\n    }\n    return keys;\n}\n\n/** A canvas without editing still runs the hook — against a session nothing ever reaches. */\nconst INERT: EditingValue = {\n    sourceId: \"plan:no-editing\", entryType: toEastTypeValue(NullType), idField: none,\n    draftType: toEastTypeValue(NullType), children: none, keyType: none, snapshot: none,\n    readEntry: () => none, onPatch: none, onApply: none,\n};\n\n/** Whether two paged sources derive the same rows — the paging driver's test (#809). */\nconst pagedSourceEquivalent = equivalentFor(Plan.Types.Root.fields.rows.cases.paged);\nconst rowEqual = equalFor(Plan.Types.Row);\nconst NO_MARKS: ReadonlyMap<RowKey, PlanDraftMark> = new Map();\nconst NO_ROWS: ReadonlySet<RowKey> = new Set();\nconst NO_IDS: readonly string[] = [];\nconst NO_DRAFTS: ReadonlyMap<string, Uint8Array> = new Map();\n\n/** The entry a row came from — the first segment of its id's path; none for a top-level section's header. */\nexport function entryOf(id: PlanRowId): string | undefined {\n    return id.value.path[0];\n}\n\nconst textEqual = equalFor(StringType);\nconst printText = printFor(StringType);\nconst readInstant = parseFor(DateTimeType);\n\n/** Where a conflict is among the Plan's rows ({@link conflictPlaceOf}). */\nexport interface PlanConflictPlace {\n    /** The rows down to it, its entry's first: a works' row, then a crew's below it. */\n    readonly rows: readonly PlanRowValue[];\n    /** How many of its path's keys and places those rows name, below its entry. */\n    readonly keys: number;\n    /** The instant a key past them names — the cell of a table row that holds it (#1438); `undefined` for none. */\n    readonly at: Date | undefined;\n}\n\n/**\n * Where a conflict is among the Plan's rows: the deepest row its path's keys\n * lead to from its entry — a crew's below its works', a measure's below its\n * ledger's — with every row above it, and the instant a key past it names.\n * A row's id names each step below its entry by the key itself (a String) or\n * its text; a path names it by its text, a String's quoted.\n *\n * @param rows - The rows the session's entries placed\n * @param entry - The conflict's entry\n * @param path - Its path in the entry's draft\n * @returns Its place; `undefined` where no row is the entry's\n */\nexport function conflictPlaceOf(rows: readonly PlanRowValue[], entry: string, path: PatchPath): PlanConflictPlace | undefined {\n    const keys = path.flatMap((step) => (step.kind === \"key\" ? [step.key] : step.kind === \"index\" ? [String(step.index)] : []));\n    const names = (segment: string, key: string) => textEqual(segment, key) || textEqual(printText(segment), key);\n    const byKey = new Map(rows.map((row) => [row.key, row] as const));\n    for (let depth = keys.length; depth >= 0; depth--) {\n        const deepest = rows.find((row) => {\n            if (row.id.type !== \"entry\") return false;\n            const segments = row.id.value.path;\n            return segments.length === depth + 1 && textEqual(segments[0]!, entry) && keys.slice(0, depth).every((key, i) => names(segments[i + 1]!, key));\n        });\n        if (deepest === undefined) continue;\n        const chain = [deepest];\n        for (let up = deepest.parent; up.type === \"some\";) {\n            const row = byKey.get(up.value);\n            if (row === undefined) break;\n            chain.unshift(row);\n            up = row.parent;\n        }\n        const instant = keys.slice(depth).map((key) => readInstant(key)).find((read) => read.success);\n        return { rows: chain, keys: depth, at: instant?.success === true ? instant.value : undefined };\n    }\n    return undefined;\n}\n\nconst idOfRef = (ref: PlanEntryRef): string => ref.id;\n\n/** Two drafted-entry maps hold the same bytes. */\nfunction sameDrafts(a: ReadonlyMap<string, Uint8Array>, b: ReadonlyMap<string, Uint8Array>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [id, bytes] of b) {\n        const held = a.get(id);\n        if (held === undefined || held.length !== bytes.length) return false;\n        for (let i = 0; i < bytes.length; i++) if (held[i] !== bytes[i]) return false;\n    }\n    return true;\n}\n\n/** An entry version's value — a Plan draft is always a whole entry. */\nfunction entryValueOf(version: EntryVersion<PlanEntryRef> | undefined): { value: unknown } | undefined {\n    const draft = version?.draft as { type: string; value: unknown } | undefined;\n    return draft?.type === \"value\" ? { value: draft.value } : undefined;\n}\n\n/**\n * The Plan's editing session and gestures, and the canvas with its drafts.\n *\n * @param args - The root, its rows as the source holds them, and the view\n * @returns The session, the drafted canvas, its marks and the gestures\n */\nexport function usePlanEditing(args: PlanEditingArgs): PlanEditing {\n    const { value, data, rows, origin, storageKey, whole } = args;\n    // Over rows read lean (#1438) a window holds no whole entry: a gesture reads its row whole, by key.\n    const shownEntry = whole === undefined ? args.entryOf : undefined;\n    const landedAt = args.landedAt;\n    const declared = value.editing.type === \"some\" ? value.editing.value : undefined;\n    // The `rows` source's part, when the slice gives the canvas its rows (#1344).\n    const recordSlice = useMemo(() => planPart(planSlices(value), ROWS_SOURCE), [value]);\n    const editing = useMemo(() => {\n        if (declared === undefined) return undefined;\n        const sourced = recordSlice === undefined ? declared : { ...declared, sourceId: recordSlice.sourceId };\n        // Over rows read lean (#1438), an entry is its row read whole by key: a window's holds none of its collections.\n        return whole === undefined ? sourced : {\n            ...sourced,\n            readEntry: (id: string): ReturnType<PlanEditingValue[\"readEntry\"]> => {\n                const row = whole.read(id);\n                return row.type === \"some\" && row.value.type === \"some\" ? some(row.value.value) : none;\n            },\n        };\n    }, [declared, recordSlice, whole]);\n    const paged = windowedSourceOf(value.rows);\n    const entryTypeValue = editing?.entryType;\n    const codec = useMemo(() => (entryTypeValue === undefined ? undefined : {\n        encode: encodeBeast2For(entryTypeValue),\n        decode: decodeBeast2For(entryTypeValue),\n        equal: equalFor(entryTypeValue),\n    }), [entryTypeValue]);\n\n    // ── The resident entries ─────────────────────────────────────────────\n    // Every entry a canvas row came from, in order. A paged entry's position\n    // is its element index — its window's start and its place among the\n    // window's ids — which is where a reconcile reads it after a Save; the\n    // entry itself is read back from the very window the canvas paged it in.\n    const resident = useMemo(() => {\n        const ids: string[] = [];\n        const windowOf = new Map<string, number>();\n        for (const row of rows) {\n            const id = entryOf(row.id);\n            if (id === undefined || windowOf.has(id)) continue;\n            windowOf.set(id, origin.get(row.key)?.w ?? 0);\n            ids.push(id);\n        }\n        if (editing === undefined || paged === undefined) {\n            return { refs: ids.map((id): PlanEntryRef => ({ id })), positions: ids.map(() => 0) };\n        }\n        const placeIn = new Map<number, ReadonlyMap<string, number>>();\n        const positionOf = (id: string): number => {\n            const w = windowOf.get(id) ?? 0;\n            let at = placeIn.get(w);\n            if (at === undefined) {\n                let read: ReturnType<PlanEditingValue[\"entryIds\"]> = none;\n                try { read = editing.entryIds(BigInt(w * PLAN_PAGE_SIZE), BigInt(PLAN_PAGE_SIZE)); }\n                catch (err) { console.error(\"[Plan] a window's entries could not be read:\", err); }\n                at = new Map(read.type === \"some\" ? read.value.map((x, i) => [x, i] as const) : []);\n                placeIn.set(w, at);\n            }\n            return w * PLAN_PAGE_SIZE + (at.get(id) ?? 0);\n        };\n        return { refs: ids.map((id): PlanEntryRef => ({ id })), positions: ids.map(positionOf) };\n    }, [rows, origin, editing, paged]);\n\n    // ── The author's check, over the entries a draft changed ─────────────\n    const sessionRef = useRef<EditSession<PlanEntryRef> | undefined>(undefined);\n    const ready = useMemo<EditSessionBinding<PlanEntryRef>[\"ready\"]>(() => {\n        const check = editing?.ready.type === \"some\" ? editing.ready.value : undefined;\n        if (check === undefined || codec === undefined) return undefined;\n        return wholeEntryReadiness(check, () => sessionRef.current?.originals, codec);\n    }, [editing, codec]);\n\n    // ── The paged source a reconcile reads ───────────────────────────────\n    // Where no slice gives the rows, a Save's entries are read by key from the source's own rows (#1596).\n    const pagedId = paged?.id;\n    const entriesKeyType = editing?.keyType;\n    const entriesByKey = useMemo(() => pagedId === undefined || entriesKeyType?.type !== \"some\" || entryTypeValue === undefined ? undefined\n        : entriesByKeyOf(pagedId, fromEastTypeValue(entriesKeyType.value), fromEastTypeValue(entryTypeValue)), [pagedId, entriesKeyType, entryTypeValue]);\n    // Only a PINNED source names the revision a session's base is (#880): an\n    // unpinned one leaves the session without a base, so no gesture drafts —\n    // and the factory refuses editing over such a source.\n    const source = useMemo<EditSource<PlanEntryRef> | undefined>(() => {\n        if (editing === undefined || paged === undefined || codec === undefined) return undefined;\n        const { revision, refresh } = paged;\n        if (revision === undefined || refresh === undefined) return undefined;\n        return {\n            page: (offset, count) => {\n                const ids = editing.entryIds(offset, count);\n                return ids.type === \"some\" ? some({ rows: ids.value.map((id): PlanEntryRef => ({ id })) }) : none;\n            },\n            revision: () => revision(),\n            refresh: (target) => refresh(target),\n            // Whether the workspace has read the rows' record since its last write from here was answered: a Save's\n            // answer that comes after its pages have moved on never puts them back at the revision it names (#1599).\n            followed: readSinceAnswerOf(paged.id),\n            seek: paged.seek,\n            // A Save's entries read back by key outside every narrowing: over rows read lean, whole (#1438) — a lean binding\n            // pages no row whole, so its slice's read of one would be refused — else through the slice, when it gives the rows.\n            readCurrent: whole !== undefined ? (id: string) => whole.read(id) : recordSlice?.readEntry,\n            // Every entry a Save wrote, in one read (#1596), each decoded: over rows read lean, the rows read whole are held as bytes.\n            readCurrentAll: whole !== undefined ? (ids: readonly string[]) => {\n                const read = whole.readAll(ids);\n                return read.type !== \"some\" ? none\n                    : some(new Map([...read.value].map(([id, row]) => [id, row.type === \"some\" ? some(codec.decode(row.value)) : none] as const)));\n            } : recordSlice === undefined ? entriesByKey : (ids: readonly string[]) => recordSliceReadEntries(recordSlice, ids),\n        };\n    }, [editing, paged, recordSlice, whole, entriesByKey, codec]);\n\n    const prepare = useMemo(() => prepareRecordSliceSave(recordSlice, source?.revision), [recordSlice, source]);\n    // The canvas's windows are read apart from a Save's confirmation, which reads its entries by key: what a Save landed\n    // is drawn over the windows read before it until they are read again (`EditSession.landed`), and a gesture on an\n    // entry a Save has just written begins from what the Save left.\n    const carries = paged !== undefined && whole === undefined;\n    const { session, observed, original, available, version, rowIndex } = useEditSession<PlanEntryRef>(\n        editing ?? INERT, source, resident.refs, resident.positions, storageKey,\n        { idOf: idOfRef, ready, prepare, wireType: EntryRefType, entryOf: shownEntry, drawsLanded: carries });\n    sessionRef.current = session;\n    // The session's key in the Plan's one history (#1194): its source, the view and its schema.\n    const historyKey = useMemo(() => historyKeyOf(storageKey, editing ?? INERT), [storageKey, editing]);\n    /** The Plan's one history, while it holds this session. */\n    const joinedHistory = (): EditHistory<PlanEntryRef> | undefined => {\n        const history = args.history?.current;\n        return history !== undefined && Object.is(history.session(historyKey), session) ? history : undefined;\n    };\n\n    // ── The drafted entries ──────────────────────────────────────────────\n    // Only the entries a draft changed: an entry undone to the source's own\n    // is the source's again, and draws from it.\n    const fresh = useMemo(() => {\n        if (editing === undefined || codec === undefined) return NO_DRAFTS;\n        const out = new Map<string, Uint8Array>();\n        for (const [id, entry] of session.entries) {\n            const now = entryValueOf(entry);\n            if (now === undefined) continue;\n            const was = entryValueOf(session.originals.get(id));\n            if (was !== undefined && codec.equal(was.value, now.value)) continue;\n            out.set(id, codec.encode(now.value));\n        }\n        return out;\n        // The session's maps are mutable; its version records each change.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [editing, codec, session, version]);\n    // Held while the bytes hold: a status change moves the version, not the drafts.\n    const held = useRef<{ drafts: ReadonlyMap<string, Uint8Array>; version: number }>({ drafts: NO_DRAFTS, version: 0 });\n    const drafts = useMemo(() => {\n        const previous = held.current;\n        if (sameDrafts(previous.drafts, fresh)) return previous;\n        const next = { drafts: fresh, version: previous.version + 1 };\n        held.current = next;\n        return next;\n    }, [fresh]);\n    // What the canvas's windows are drawn with (#1599): the drafts, and — under them — each entry a Save landed that its\n    // window has still to read, as the Save left it. A window read before the Save holds the entry as it stood before.\n    const landedDrafts = useMemo(() => {\n        if (!carries || codec === undefined || session.landed.size === 0) return NO_DRAFTS;\n        const out = new Map<string, Uint8Array>();\n        for (const [id, saved] of session.landed) {\n            const left = entryValueOf(saved.after);\n            if (left !== undefined) out.set(id, codec.encode(left.value));\n        }\n        return out;\n        // The session's maps are mutable; its version records each change.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [carries, codec, session, version]);\n    const heldDrawn = useRef<{ drafts: ReadonlyMap<string, Uint8Array>; version: number }>({ drafts: NO_DRAFTS, version: 0 });\n    const drawn = useMemo(() => {\n        const next = landedDrafts.size === 0 ? fresh : new Map([...landedDrafts, ...fresh]);\n        const previous = heldDrawn.current;\n        if (sameDrafts(previous.drafts, next)) return previous;\n        const out = { drafts: next, version: previous.version + 1 };\n        heldDrawn.current = out;\n        return out;\n    }, [fresh, landedDrafts]);\n    // A landed entry its window has read again is the source's to draw: the session lets it go — in the commit that\n    // draws the window, so no frame draws the entry as it stood before its Save. One the canvas holds no row of any\n    // longer is read afresh when it does.\n    useLayoutEffect(() => {\n        if (!carries || session.landed.size === 0) return;\n        const now = observed?.base.type === \"revision\" ? observed.base.value : undefined;\n        const read: string[] = [];\n        for (const [id, saved] of session.landed) {\n            const index = rowIndex.get(id);\n            const at = index === undefined ? undefined : resident.positions[index];\n            const landedNow = at === undefined || landedAt?.(at) === true;\n            if (!standingBeforeSave(!landedNow, now, saved.from)) read.push(id);\n        }\n        if (read.length > 0) session.shown(read);\n    });\n\n    // ── The canvas with the drafts in place ──────────────────────────────\n    // Inline: the whole canvas derived with the drafts in their entries' place.\n    const inlineBlocks = useMemo((): readonly PlanWireBlock[] | undefined => {\n        if (editing === undefined || data.rows.type !== \"inline\" || drafts.drafts.size === 0) return undefined;\n        try {\n            const out = editing.derive(0n, 0n, new Map(drafts.drafts));\n            return out.type === \"some\" ? out.value.rows : undefined;\n        } catch (err) {\n            console.error(\"[Plan] the drafted canvas could not be derived:\", err);\n            return undefined;\n        }\n    }, [editing, data.rows, drafts]);\n    // Paged: one wrapper per source, reading the latest source and what its windows are drawn with.\n    const latest = useRef({ src: paged, editing, drafts: drawn });\n    latest.current = { src: paged, editing, drafts: drawn };\n    const wrapperOf = useRef<{ src: PlanPagedSourceValue; wrapped: PlanPagedSourceValue } | undefined>(undefined);\n    const wrapped = useMemo((): PlanPagedSourceValue | undefined => {\n        if (paged === undefined || editing === undefined) return undefined;\n        const prior = wrapperOf.current;\n        if (prior !== undefined && pagedSourceEquivalent(prior.src, paged)) return prior.wrapped;\n        const next: PlanPagedSourceValue = {\n            id: paged.id,\n            page: (offset, limit) => {\n                const l = latest.current;\n                if (l.src === undefined) return none;\n                return l.editing === undefined || l.drafts.drafts.size === 0\n                    ? l.src.page(offset, limit)\n                    : l.editing.derive(offset, limit, new Map(l.drafts.drafts));\n            },\n            total: () => latest.current.src?.total() ?? none,\n            // A new drafts version is a new revision: the driver reads its\n            // windows again, the rows it has standing in until they land.\n            revision: () => {\n                const l = latest.current;\n                const r = l.src?.revision?.() ?? none;\n                if (l.drafts.drafts.size === 0) return r;\n                return some(`${r.type === \"some\" ? r.value : \"\"}#drafts-${l.drafts.version}`);\n            },\n            refresh: (revision) => latest.current.src?.refresh?.(revision) ?? null,\n            seek: paged.seek.type === \"some\"\n                ? some((query) => {\n                    const s = latest.current.src?.seek;\n                    return s !== undefined && s.type === \"some\" ? s.value(query) : none;\n                })\n                : none,\n            // A live source's narrowing, as it stands: the driver reads its windows again when it moves (#1354).\n            ...(paged.query !== undefined ? { query: () => latest.current.src?.query?.() ?? \"\" } : {}),\n            // A window standing in while it is read again is drawn from the entries it carried, the drafts and what a Save\n            // landed in their place (#1599), reading nothing: a change made meanwhile is drawn at once.\n            redraft: (entries) => {\n                const l = latest.current;\n                return l.editing === undefined ? undefined : l.editing.deriveWindow([...entries], new Map(l.drafts.drafts));\n            },\n            redrafted: () => String(latest.current.drafts.version),\n        };\n        wrapperOf.current = { src: paged, wrapped: next };\n        return next;\n    }, [paged, editing]);\n    // The wrapper rides the source's own arm: a pinned source stays pinned, a live one live.\n    const shownData = useMemo((): PlanRootValue => {\n        if (inlineBlocks !== undefined) return { ...data, rows: variant(\"inline\", inlineBlocks) as PlanRootValue[\"rows\"] };\n        if (wrapped !== undefined) return { ...data, rows: variant(windowedArm(data.rows), wrapped) as PlanRootValue[\"rows\"] };\n        return data;\n    }, [data, inlineBlocks, wrapped]);\n    const shownValue = useMemo((): PlanRootValue => {\n        if (inlineBlocks !== undefined) return { ...value, rows: variant(\"inline\", inlineBlocks) as PlanRootValue[\"rows\"] };\n        if (wrapped !== undefined) return { ...value, rows: variant(windowedArm(value.rows), wrapped) as PlanRootValue[\"rows\"] };\n        return value;\n    }, [value, inlineBlocks, wrapped]);\n\n    // ── The marks ────────────────────────────────────────────────────────\n    // A row of a drafted entry that the draft added or changed: its entry's\n    // rows derived from the draft, against the same from the source's entry.\n    const marks = useMemo((): ReadonlyMap<RowKey, PlanDraftMark> => {\n        if (editing === undefined || codec === undefined || drafts.drafts.size === 0) return NO_MARKS;\n        const readiness = session.readiness;\n        const out = new Map<RowKey, PlanDraftMark>();\n        const rowsOf = (id: string, bytes: Uint8Array): Map<RowKey, ValueTypeOf<typeof Plan.Types.Row>> => {\n            const by = new Map<RowKey, ValueTypeOf<typeof Plan.Types.Row>>();\n            try {\n                for (const block of editing.deriveEntry(id, bytes)) for (const row of block.rows) by.set(rowKeyOf(row.id), row);\n            } catch (err) {\n                console.error(\"[Plan] a drafted entry's rows could not be derived:\", err);\n            }\n            return by;\n        };\n        for (const [id, bytes] of drafts.drafts) {\n            const was = entryValueOf(session.originals.get(id));\n            const before = was !== undefined ? rowsOf(id, codec.encode(was.value)) : new Map<RowKey, ValueTypeOf<typeof Plan.Types.Row>>();\n            // The entry's OWN issues decide its mark — never another entry's.\n            const own = readiness.type !== \"ready\" ? readiness.value.filter((issue) => issue.entry === id) : [];\n            const mark: PlanDraftMark = readiness.type === \"ready\" || own.length === 0 ? \"pending\"\n                : own.some((issue) => kindOfIssue(issue, readiness) === \"invalid\") ? \"invalid\" : \"incomplete\";\n            for (const [key, row] of rowsOf(id, bytes)) {\n                const prior = before.get(key);\n                if (prior !== undefined && rowEqual(prior, row)) continue;\n                out.set(key, mark);\n            }\n        }\n        return out;\n        // The session's readiness moves under its version.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [editing, codec, drafts, session, version]);\n\n    // ── A source moving under the drafts (#1438) ─────────────────────────\n    // Over rows read whole by key beside their nested series index, another planner's change of what no draft changed\n    // stands beside the drafts: each drafted row is read whole at the source's new revision — every one in one request —\n    // and the drafts are carried over to it (`EditSession.merge`): what combines at once, and a part another planner\n    // changed differently a conflict, the draft's value standing until it is settled.\n    const staleIds = useMemo(() => (whole !== undefined && session.carrying ? [...session.entries.keys()] : NO_IDS),\n        // The session is mutable; its version says when it moved.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [whole, session, version]);\n    const staleRead = useCallback(() => (whole === undefined || staleIds.length === 0 ? undefined : whole.readAll(staleIds)), [whole, staleIds]);\n    const { result: staleRows } = useTrackedEvaluation(staleRead);\n    useEffect(() => {\n        if (staleIds.length === 0 || observed === undefined || codec === undefined || !staleRows.ok) return;\n        const read = staleRows.value;\n        if (read === undefined || read.type !== \"some\") return;\n        session.merge(observed.base, (id) => {\n            const row = read.value.get(id);\n            return row === undefined ? undefined : row.type === \"some\" ? some(codec.decode(row.value)) : none;\n        });\n    }, [staleIds, staleRows, observed, codec, session]);\n\n    // ── The gestures ─────────────────────────────────────────────────────\n    // Over rows read lean (#1438), a gesture on a row the session does not hold waits for the row read whole — every row\n    // it touches asked in one request — and is drafted once they land.\n    const waiting = useRef<{ requests: readonly { id: string; rows: PlanRowId[] }[]; gesture: PlanGesture; origin: Origin; label: string }[]>([]);\n    const [waits, setWaits] = useState(0);\n    const waitingIds = useMemo(() => [...new Set(waiting.current.flatMap((w) => w.requests.map((r) => r.id)))],\n        // The queue is a ref; its count says when it moved.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [waits]);\n    const landedRead = useCallback(() => whole === undefined || waitingIds.length === 0 || whole.readAll(waitingIds).type === \"some\", [whole, waitingIds]);\n    // The rows the queue waits on.\n    const inFlight = useMemo((): ReadonlySet<RowKey> => (waiting.current.length === 0 ? NO_ROWS\n        : new Set(waiting.current.flatMap((w) => w.requests.flatMap((r) => r.rows.map(rowKeyOf))))),\n    // The queue is a ref; its count says when it moved.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [waits]);\n    const { result: landed } = useTrackedEvaluation(landedRead);\n    /** Write one gesture into the entries it touches, and record it as one transaction. */\n    const record = (requests: readonly { id: string; rows: PlanRowId[] }[], gesture: PlanGesture, origin: Origin, label: string): boolean => {\n        if (editing === undefined || codec === undefined || observed === undefined || !session.writable) return false;\n        // Every row it touches not drafted yet is read whole, all of them in one request.\n        const unheld = requests.filter((r) => !session.entries.has(r.id)).map((r) => r.id);\n        if (whole !== undefined && unheld.length > 0 && whole.readAll(unheld).type !== \"some\") {\n            waiting.current.push({ requests, gesture, origin, label });\n            setWaits((n) => n + 1);\n            return true;\n        }\n        session.observeBase(observed.base);\n        const befores: EntryVersion<PlanEntryRef>[] = [];\n        const wire: { id: string; entry: Uint8Array; rows: PlanRowId[]; gesture: PlanGesture }[] = [];\n        for (const request of requests) {\n            let before: EntryVersion<PlanEntryRef>;\n            try { before = original(request.id); }\n            catch (err) {\n                console.error(\"[Plan] a gesture's entry could not be read:\", err);\n                continue;\n            }\n            const now = entryValueOf(before);\n            if (now === undefined) continue;\n            befores.push(before);\n            wire.push({ id: request.id, entry: codec.encode(now.value), rows: request.rows, gesture });\n        }\n        if (wire.length === 0) return false;\n        let written: ReturnType<PlanEditingValue[\"write\"]>;\n        try { written = editing.write(wire); }\n        catch (err) {\n            console.error(\"[Plan] a gesture could not be written:\", err);\n            return false;\n        }\n        const updates: EntryUpdate<PlanEntryRef>[] = [];\n        written.forEach((out, i) => {\n            if (out.type !== \"some\") return;\n            const before = befores[i]!;\n            updates.push({\n                id: wire[i]!.id, before,\n                after: { draft: variant(\"value\", codec.decode(out.value)), wire: before.wire, place: before.place },\n            });\n        });\n        if (updates.length === 0) return false;\n        // One step of the Plan's one history, once it holds this session (#1194).\n        const history = joinedHistory();\n        return history !== undefined ? history.record([{ key: historyKey, updates }], origin, label) : session.record(updates, origin, label);\n    };\n    const gestures = {\n        drop(event: DragEventValue): boolean {\n            if (event.type !== \"add\") return false;\n            const { from, into, duplicate } = event.value;\n            const id = rowIdOfKey(into.row);\n            const entry = id !== undefined ? entryOf(id) : undefined;\n            const at = fromPlanSlot(value.axis.type, into.slot);\n            if (id === undefined || entry === undefined || at === undefined) return false;\n            // The new item's id, minted here and unique among every id the canvas holds (#1436).\n            const held = elementKeysOf(args.rows);\n            const item = mintKey((key) => held.has(key));\n            return record([{ id: entry, rows: [id] }], variant(\"drop\", { from, row: id, at, duplicate, id: item }), \"drop\",\n                `Drop ${from.key} on ${args.labelOf(into.row)}`);\n        },\n        move(request: PlanMoveRequest): boolean {\n            const from = rowIdOfKey(request.from);\n            const to = rowIdOfKey(request.to);\n            const source = from !== undefined ? entryOf(from) : undefined;\n            const target = to !== undefined ? entryOf(to) : undefined;\n            if (from === undefined || to === undefined || source === undefined || target === undefined) return false;\n            // The row it leaves is written first: its write takes the item,\n            // the target's puts it (#825). One entry holding both rows is one\n            // request over both, in that order.\n            const requests = source === target\n                ? [{ id: source, rows: request.from === request.to ? [from] : [from, to] }]\n                : [{ id: source, rows: [from] }, { id: target, rows: [to] }];\n            const gesture = variant(\"move\", { key: request.key, from, to, start: request.span.start, end: request.span.end });\n            const label = request.origin === \"resize\"\n                ? `Resize ${request.label}`\n                : request.from === request.to ? `Move ${request.label}` : `Move ${request.label} to ${args.labelOf(request.to)}`;\n            return record(requests, gesture, request.origin, label);\n        },\n        typeValue(typed: PlanTypedValue, label: string): boolean {\n            const id = rowIdOfKey(typed.rowKey);\n            const entry = id !== undefined ? entryOf(id) : undefined;\n            if (id === undefined || entry === undefined) return false;\n            const gesture = variant(\"value\", {\n                row: id, position: BigInt(typed.position), at: typed.at, value: typed.value === undefined ? none : some(typed.value),\n            });\n            return record([{ id: entry, rows: [id] }], gesture, \"typed\", label);\n        },\n        action(action: HistoryAction): void {\n            // The history's, across every source, once it holds this session (#1194).\n            const history = joinedHistory();\n            if (history !== undefined) history.act(action);\n            else if (action === \"apply\") void session.apply();\n            else if (action === \"refresh\") session.refresh();\n            else session[action]();\n        },\n    };\n    // Stable to the rows and the drag layer: each runs the latest render's.\n    const current = useRef(gestures);\n    current.current = gestures;\n    const recordNow = useRef(record);\n    recordNow.current = record;\n    // The gestures waiting on rows read whole, drafted once they land, in the order they were made.\n    useLayoutEffect(() => {\n        if (!landed.ok || landed.value !== true || waiting.current.length === 0) return;\n        const queued = waiting.current;\n        waiting.current = [];\n        for (const w of queued) recordNow.current(w.requests, w.gesture, w.origin, w.label);\n        // Nothing in flight now.\n        setWaits((n) => n + 1);\n    }, [landed]);\n    const drop = useCallback((event: DragEventValue) => current.current.drop(event), []);\n    const move = useCallback((request: PlanMoveRequest) => current.current.move(request), []);\n    const typeValue = useCallback((typed: PlanTypedValue, label: string) => current.current.typeValue(typed, label), []);\n    const action = useCallback((a: HistoryAction) => current.current.action(a), []);\n\n    return {\n        enabled: editing !== undefined,\n        session,\n        historyKey,\n        available: editing !== undefined && available,\n        version,\n        value: shownValue,\n        data: shownData,\n        draftsVersion: drafts.version,\n        drafted: drafts,\n        marks,\n        drop,\n        move,\n        typeValue,\n        inFlight,\n        action,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\nimport { useMemo } from \"react\";\nimport { parseFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { ScheduleEventRefType, type PlanPayloadType } from \"@elaraai/e3-ui/internal\";\nimport { useScheduleEditing, type ScheduleChange, type ScheduleEditing, type ScheduleEditingArgs, type ScheduleRead } from \"../../shared/schedule/editing.js\";\nexport type {\n    ScheduleChange as PlanEventChange, ScheduleKindSession as PlanKindSession,\n    ScheduleEventDraftsValue as PlanEventDraftsValue, ScheduleKindDraftsValue as PlanKindDraftsValue,\n    ScheduleGestureValue as PlanEventGestureValue,\n} from \"../../shared/schedule/editing.js\";\ntype Kind = ValueTypeOf<typeof PlanPayloadType>[\"events\"][number];\ntype Item = Extract<ReturnType<Kind[\"planEvent\"]>, { type: \"some\" }>[\"value\"][\"item\"];\n/** The Plan's projected event and its full record row. */\nexport type PlanEventReadValue = ScheduleRead<Item>;\n/** Shared editing, with the Plan's richer event projection. */\nexport type PlanEventEditing = ScheduleEditing<Item>;\n/** The Plan's event editing inputs: the shared ones, the rows each kind's cells hold among them (`held`, #1039). */\nexport interface PlanEventEditingArgs extends Omit<ScheduleEditingArgs<Item>, \"kinds\"> {\n    /** The Plan's event kinds. */\n    kinds: readonly Kind[];\n}\n\n/** Adapts the Plan's event projection to the shared record editing history: each kind's events as Plan draws them. */\nexport function usePlanEventEditing(args: PlanEventEditingArgs): PlanEventEditing {\n    const kinds = useMemo(() => args.kinds.map(kind => ({ ...kind, event: kind.planEvent })), [args.kinds]);\n    return useScheduleEditing({ ...args, kinds });\n}\n\nconst parseEventRef = parseFor(ScheduleEventRefType);\n\n/**\n * Removes selected events through their record sessions as one undoable gesture.\n * Both the inspector and keyboard use the event's original record key.\n *\n * @param keys - The selected elements' printed event references\n * @param editing - The shared event sessions, when the canvas is ready\n * @param label - A specific history label, when the caller has the event titles\n * @returns Whether the removal was recorded\n */\nexport function removePlanEvents(keys: readonly string[], editing: PlanEventEditing | undefined, label?: string): boolean {\n    if (editing === undefined || keys.length === 0) return false;\n    const changes: ScheduleChange[] = [];\n    for (const key of keys) {\n        const ref = parseEventRef(key);\n        if (!ref.success) return false;\n        changes.push({ kind: ref.value.kind, id: ref.value.key, remove: true });\n    }\n    return editing.record(changes, \"remove\", label ?? `Delete ${changes.length} ${changes.length === 1 ? \"event\" : \"events\"}`);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The resources the Plan's panes name (#1199): a resource by its kind and its\n * key. A kind given its resources whole lists them, and names each at once. A\n * paged kind lists none — its resources come a window at a time as the canvas\n * scrolls — so each of its resources a pane names is read by its key through\n * the kind's `byKey` (its window's key search, then a one-row page), tracked,\n * and named once the read lands; until then, and for a key the kind does not\n * have, the key stands in.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { ScheduleResourceRefType } from \"@elaraai/e3-ui/internal\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport type { PlanValue } from \"./index.js\";\n\n/** One resource kind, as the payload carries it. */\ntype PlanResourceKindValue = PlanValue[\"resources\"][number];\n\n/** One resource, resolved: its name, its lines and its group. */\nexport type PlanResourceRowValue = PlanResourceKindValue[\"rows\"][number];\n\n/** A resource: its kind's slot, and its key's text. */\nexport type PlanResourceRefValue = ValueTypeOf<typeof ScheduleResourceRefType>;\n\n/** A resource's row, by its kind and key: `undefined` while a paged kind's read of it is in flight, and for a key its kind does not have. */\nexport type PlanResourceLookup = (ref: PlanResourceRefValue) => PlanResourceRowValue | undefined;\n\n/** A resource's key among those read: its ref, as East prints it. */\nconst printRef = printFor(ScheduleResourceRefType);\n/** Nothing read by key: no paged resource named. */\nconst NOTHING_READ: ReadonlyMap<string, PlanResourceRowValue> = new Map();\n\n/**\n * The resources a pane names, by their kind and key — see the module docs.\n *\n * @param resources - The resource kinds\n * @param wanted - The resources the pane names — the same array while they hold, so their reads are not asked again\n * @returns A resource's row by its kind and key: a listed kind's at once, a paged kind's once its read lands\n */\nexport function usePlanResourceRows(resources: PlanValue[\"resources\"], wanted: readonly PlanResourceRefValue[]): PlanResourceLookup {\n    // A listed kind's resources by their key's text, and a paged kind's read by key.\n    const listed = useMemo(\n        () => new Map(resources.map((kind) => [kind.key, new Map(kind.rows.map((row) => [row.key, row] as const))] as const)),\n        [resources]);\n    const paged = useMemo(\n        () => new Map(resources.flatMap((kind) => (kind.byKey.type === \"some\" ? [[kind.key, kind.byKey.value] as const] : []))),\n        [resources]);\n    // Each paged resource named, read by its key — tracked, so a read in flight lands here.\n    const read = useCallback((): ReadonlyMap<string, PlanResourceRowValue> => {\n        const out = new Map<string, PlanResourceRowValue>();\n        for (const ref of wanted) {\n            const byKey = paged.get(ref.kind);\n            if (byKey === undefined) continue;\n            const got = byKey(ref.key);\n            if (got.type === \"some\" && got.value.type === \"some\") out.set(printRef(ref), got.value.value);\n        }\n        return out;\n    }, [paged, wanted]);\n    const { result } = useTrackedEvaluation(read);\n    // The last reads stand while a read fails.\n    const held = useRef(NOTHING_READ);\n    const named = useMemo(() => {\n        if (!result.ok) {\n            console.error(\"[Plan] a resource could not be read by its key:\", result.error);\n            return held.current;\n        }\n        held.current = result.value;\n        return result.value;\n    }, [result]);\n    return useCallback((ref: PlanResourceRefValue) => listed.get(ref.kind)?.get(ref.key) ?? named.get(printRef(ref)), [listed, named]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The library pane (`Plan Builder Spec.md` §8, §9.6, PB26–PB30, PB61, PB62):\n * the Plan's start pane (#1195), its tabs the ones the author's `library`\n * lists, in that order, each with its count after its name and a search. A\n * Plan whose `library` lists no tab has no pane.\n *\n * - **Events** (`Plan.library.events()`) — every event kind's templates, in\n *   the kinds' order, under the kind's name and then the template's `group`:\n *   each card its kind's icon, its name, and `Print job · 6 h · presses`, its\n *   kind, how long it runs and the resource kinds it is placed on (PB27).\n * - **Backlog** (`Plan.library.backlog()`) — every event kind's unscheduled\n *   events (a kind whose times are Options), read through the kind's own seam\n *   with its drafts in place (#1196) and read again when its record commits —\n *   the footer's counts' read (`counts.ts`), which hands the pane them —\n *   so a card scheduled leaves it and an event unscheduled joins it at once:\n *   each card its kind's icon, its\n *   title and `6 h · Press A · due Fri 16`, grouped by when it is due — Due\n *   this week, Due next week, Later, No date — counted from the week the\n *   axis's now is in, or today's (PB28). A card's resource on a paged resource\n *   kind is named once it is read by its key (#1199, `resources.ts`), its key\n *   standing in meanwhile.\n * - **Series** (`Plan.library.series()`) — `Pick.Panel`'s list, frameless in\n *   the pane: each resource kind and its measures, the event kinds, `data`'s\n *   picked series and the Plan's `rows`, each with its kind's icon, its title\n *   and an eye, in the order the canvas draws them (PB29). The kinds and the\n *   rows hide in the viewer's own set, kept under the Plan's `id`; `data`'s\n *   series in their pick, kept under its key.\n * - **An author's tab** (`Plan.library.tab(…)`) — its cards, as the Sheet's\n *   (SB60): each its label and its meta under it, with the tab's icon,\n *   grouped by its `group` and searched by key, label and meta. A click\n *   selects a card, and a click on the selected card lets it go (PB62).\n * - An empty tab says so (PB30), in the shared empty state; collapsed, the\n *   pane is a rail with the backlog's count, or the first tab's when the\n *   library lists no Backlog tab (PB26). Until its kinds' first read lands the\n *   Backlog tab — and the rail — counts \"…\", over placeholder cards: never\n *   \"Backlog clear\", never 0 (#1398, CL13); and while what a narrowing hides of\n *   it is counted — a cold load with a narrowing restored — its count's slot\n *   says \"…\" still, never a bare \"Backlog\" (#1424). After it, the Backlog never\n *   blinks (ruled 25 Oct 2026): its cards and its count are the last complete\n *   read's, held as one (`counts.ts`' `PlanKindsReader`), and while a\n *   narrowing's, a window's or a revision's read of either is in flight they\n *   stand in, retained — its pane busy and `aria-disabled` (CL8) — until both\n *   have landed and are swapped whole.\n *\n * Each tab follows its source of the Plan's slice (#1344), as the Calendar's\n * do: the Events tab each templates list's, by template key; the Backlog its\n * kinds' own narrowing, counting `N of M` — what shows beside the stored\n * events their choices hide — with a Clear filters that keeps each window; an\n * author's tab the source it names, by its rows' keys. Each counts what it\n * shows, says so when the rail leaves it none, with Clear filters, and takes\n * no gesture while its source resolves. The Series tab stays as it is: show\n * and hide switches.\n *\n * Templates, backlog events, and the cards of an author's tab are drag\n * sources from the libraries `${planKeys(id).library}:events`, `…:backlog` and\n * `…:tab:<its name>`: a template's or an event's card keyed by its kind and key\n * as East prints a `Schedule.Types.EventRef`, an author's by its row's key as\n * text. A template or a backlog event drags while the canvas draws an event\n * kind's row to drop it on (#1196). An author's card lands on a row whose\n * series makes an item of a card (#1259), as a Library's card beside the Plan\n * does, by the pointer or the keyboard, and — with a `drop` — on an event of\n * its patch's kind (#1196): it drags while one of them is on the canvas.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useState, type ReactNode } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { DateTimeType, StringType, compareFor, equalFor, none, printFor, some, type ValueTypeOf } from \"@elaraai/east\";\nimport type { PickBindType } from \"@elaraai/east-ui\";\nimport { ScheduleEventRefType, ScheduleResourceRefType, type planKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    EastChakraLibrary, EastChakraPickPanel, EmptyStateView, getSomeorUndefined,\n    type BuilderFrameDock, type LibraryEmpty, type LibraryNarrowing, type LibraryValue,\n} from \"@elaraai/east-ui-components\";\nimport { PlaceholderCard, SliceDensityContext, narrowedCount, useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { scheduleLibraryCard as card, scheduleLibrary as libraryOf } from \"../../shared/schedule/library.js\";\nimport { DUE_GROUPS, dueGroupOf, durationMinutes, type DueGroup } from \"../../shared/schedule/due.js\";\nimport type { BacklogNarrowing } from \"../../shared/schedule/backlog.js\";\nimport type { FollowedSources } from \"../../shared/schedule/follow-sources.js\";\nimport { sourceTab, sourcesTab, type SourceShown, type SourceTab } from \"../../shared/schedule/source-tab.js\";\nimport type { PlanLibraryTabWord } from \"../messages.js\";\nimport type { PlanEventPart } from \"../root/sources.js\";\nimport type { PlanWords } from \"../words.js\";\nimport type { PlanBacklogEntry } from \"./counts.js\";\nimport type { PlanValue } from \"./index.js\";\nimport { usePlanResourceRows, type PlanResourceRefValue } from \"./resources.js\";\n\n/** The names a Plan keeps its viewer's state under. */\ntype PlanKeys = ReturnType<typeof planKeys>;\n/** One event kind, as the payload carries it. */\ntype PlanEventKindValue = PlanValue[\"events\"][number];\n/** One event as a kind's seams read it. */\ntype PlanEventItemValue = Extract<ReturnType<PlanEventKindValue[\"planUnscheduled\"]>, { type: \"some\" }>[\"value\"][number];\n/** A resource an event is on, if it is. */\ntype PlanResourceOptionValue = PlanEventItemValue[\"resource\"];\n/** An author's tab, decoded. */\ntype PlanAuthorTabValue = Extract<PlanValue[\"library\"][number], { type: \"tab\" }>[\"value\"];\n/** A pick, decoded: the canvas's own over `data`'s series, and the Series tab's. */\nexport type PlanPickValue = ValueTypeOf<typeof PickBindType>;\n\n/** One template of a kind: its card in the Events tab. */\ninterface TemplateEntry {\n    readonly kind: PlanEventKindValue;\n    readonly template: PlanEventKindValue[\"templates\"][number];\n}\n\n/** One card of an author's tab, as the payload carries it. */\ntype PlanAuthorCardValue = PlanAuthorTabValue[\"cards\"][number];\n\nconst stringEqual = equalFor(StringType);\nconst compareDateTime = compareFor(DateTimeType);\n/** A card's key: its kind and its key, as East prints a `Schedule.Types.EventRef`. */\nconst printRef = printFor(ScheduleEventRefType);\n/** A resource among those the backlog's cards name, by its ref as East prints it. */\nconst printResource = printFor(ScheduleResourceRefType);\n\n/** The library open: the Calendar's 272px (§8). */\nconst LIBRARY_SIZE = \"272px\";\n\n/** No unscheduled event. */\nconst NO_BACKLOG: readonly PlanBacklogEntry[] = [];\n\n/** The placeholder cards the Backlog tab holds until its kinds' first read lands (#1398, CL13), at a backlog card's height. */\nconst PENDING_CARDS = [0, 1, 2] as const;\nconst PENDING_CARD_PX = 64;\n\n/** The rail hides nothing of the backlog. */\nconst NO_BACKLOG_NARROWING: BacklogNarrowing<PlanEventPart> = { narrowing: [], hidden: undefined, counting: false, clear: undefined };\n\n/** No source of the slice the tabs follow. */\nconst NONE_FOLLOWED: FollowedSources = new Map();\n\n/** What a tab that follows no source shows: its cards whole. */\nconst WHOLE: SourceShown = { keys: none, busy: false, ready: true, clear: undefined };\n\n/** The shared empty state's icon: an empty box, as a Library's — Font Awesome's open box (#1263). */\nconst EMPTY_ICON = { prefix: \"fas\", name: \"box-open\" } as const;\n\n/** Props of {@link usePlanLibrary}. */\nexport interface PlanLibraryProps {\n    /** The library's tabs, as the payload lists them. */\n    library: PlanValue[\"library\"];\n    /** The event kinds: their templates and their backlogs. */\n    kinds: PlanValue[\"events\"];\n    /** The resource kinds: what a card names a resource kind and a resource by. */\n    resources: PlanValue[\"resources\"];\n    /** The canvas's own pick over `data`'s series, when they are picked. */\n    pick: PlanPickValue | undefined;\n    /** The names the Plan keeps its viewer's state under. */\n    keys: PlanKeys;\n    /** The ids this viewer hides. */\n    hidden: readonly string[];\n    /** Replaces the ids this viewer hides. */\n    onHidden: (next: readonly string[]) => void;\n    /** The moment the backlog's weeks are counted from: the axis's now, or the clock's. */\n    now: Date;\n    /** The Plan's words. */\n    words: PlanWords;\n    /** Whether a row of the canvas takes a card from an author's tab (#1259): its cards drag then. */\n    takesCards: boolean;\n    /** Every kind's unscheduled events, in the kinds' order, read with the drafts in place (#1196): the counts' read's (`counts.ts`). */\n    unscheduled?: readonly PlanBacklogEntry[] | undefined;\n    /** Whether the canvas draws an event kind's row to drop a template or a backlog event on (#1196): their cards drag then. */\n    takesEvents?: boolean | undefined;\n    /** The event kinds with an event on the canvas (#1196): an author's tab whose patch lands on one lets its cards drag. */\n    patchKinds?: ReadonlySet<string> | undefined;\n    /** The sources of the slice the tabs follow (#1344): each templates list's, and each an author's tab names. */\n    followed?: FollowedSources | undefined;\n    /** What the rail hides of the backlog (#1344): the Backlog tab's `N of M`, and its Clear filters. */\n    backlogNarrowing?: BacklogNarrowing<PlanEventPart> | undefined;\n    /** Whether the backlog's cards and count stand in for a read in flight (#1398, CL8): its pane busy, and retained. */\n    backlogRetained?: boolean | undefined;\n    /** Whether a run of the optimiser moved an event into or out of the backlog (#1409): the Backlog tab's count flashes as it lands. */\n    backlogFlash?: boolean | undefined;\n}\n\n/** A pane whose cards stand in for a read in flight (#1398, CL8): busy, and retained. */\nconst RETAINED_PANE = { \"aria-busy\": true, \"aria-disabled\": true } as const;\n\n/** A pane whose cards are as read. */\nconst READ_PANE = {} as const;\n\n/** No event kind has an event on the canvas. */\nconst NO_PATCH_KINDS: ReadonlySet<string> = new Set();\n\n/**\n * How long something takes, in the Plan's words — `6 h`, `2 h 15 m`, `45 m`.\n *\n * @param minutes - Its length in whole minutes\n * @param words - The Plan's words\n * @returns The words\n */\nfunction durationWords(minutes: number, words: PlanWords): string {\n    const hours = Math.floor(minutes / 60);\n    const rest = minutes % 60;\n    return words.m.duration({\n        hours: hours > 0 ? words.number(hours) : undefined,\n        minutes: rest > 0 || hours === 0 ? words.number(rest) : undefined,\n    });\n}\n\n/**\n * The library a Plan's templates drag from — the Events tab's (#1196).\n *\n * @param keys - The Plan's keys\n * @returns The library's id\n */\nexport function eventsLibrary(keys: PlanKeys): string {\n    return `${keys.library}:events`;\n}\n\n/**\n * The library a Plan's backlog drags from — the Backlog tab's (#1196).\n *\n * @param keys - The Plan's keys\n * @returns The library's id\n */\nexport function backlogLibrary(keys: PlanKeys): string {\n    return `${keys.library}:backlog`;\n}\n\n/**\n * The library an author's tab's cards drag from (#1196).\n *\n * @param keys - The Plan's keys\n * @param tab - The author's tab\n * @returns The library's id\n */\nexport function tabLibrary(keys: PlanKeys, tab: PlanAuthorTabValue): string {\n    return `${keys.library}:tab:${tab.name}`;\n}\n\n/**\n * The Series tab's pick: the viewer's set and the canvas's own, as one list\n * for `Pick.Panel` — the resource kinds and their measures and the event\n * kinds, `data`'s picked series, then the Plan's rows, in the order the canvas\n * draws them. A toggle writes the canvas's pick for its series, and the\n * viewer's set for the rest; the set is read live, so two toggles in one\n * frame compose.\n *\n * @param lines - The tab's own lines: the kinds, and the Plan's rows\n * @param pick - The canvas's own pick, when `data`'s series are picked\n * @param fallback - The store key the panel listens on when there is no pick\n * @param hidden - The viewer's set\n * @param onHidden - Replaces the viewer's set\n * @returns The pick\n */\nfunction seriesPickOf(\n    lines: { kinds: PlanPickValue[\"items\"]; rows: PlanPickValue[\"items\"] },\n    pick: PlanPickValue | undefined,\n    fallback: string,\n    hidden: readonly string[],\n    onHidden: (next: readonly string[]) => void,\n): PlanPickValue {\n    const picked = new Set((pick?.items ?? []).map((item) => item.id));\n    // The viewer's set as this pick last wrote it, until the next render brings it back.\n    let own = hidden;\n    return {\n        key: pick?.key ?? fallback,\n        state: {\n            read: () => [...own, ...(pick?.state.read() ?? [])],\n            write: (next) => {\n                own = next.filter((id) => !picked.has(id));\n                onHidden(own);\n                if (pick !== undefined) pick.state.write(next.filter((id) => picked.has(id)));\n                return null;\n            },\n            has: () => true,\n        },\n        items: [...lines.kinds, ...(pick?.items ?? []), ...lines.rows],\n    };\n}\n\n/**\n * The Events tab's templates (#1344): every kind's, in the kinds' order, each\n * following the source its templates list names, by its key in that list's\n * record — the shared {@link sourcesTab}, as the Calendar's Templates tab.\n *\n * @param kinds - The event kinds\n * @param followed - What each source the tabs follow shows\n * @param words - The Plan's words\n * @returns The tab's templates, its count, its narrowed and its own empty states, and its pane's attributes\n */\nfunction templatesTab(kinds: PlanValue[\"events\"], followed: FollowedSources, words: PlanWords): SourceTab<TemplateEntry> {\n    const entries = kinds.flatMap((kind) => kind.templates.map((template): TemplateEntry => ({ kind, template })));\n    const sourceOf = (kind: PlanEventKindValue): SourceShown | undefined =>\n        (kind.templatesSource.type === \"some\" ? followed.get(kind.templatesSource.value)?.shown : undefined);\n    const sources = kinds.flatMap((kind) => { const shown = sourceOf(kind); return shown === undefined ? [] : [shown]; })\n        .filter((shown, i, all) => all.indexOf(shown) === i);\n    return sourcesTab({ cards: entries, keyOf: (entry) => entry.template.key, sources, sourceOf: (entry) => sourceOf(entry.kind), noun: words.m.libraryNoun({ tab: \"events\", n: 2 }), words });\n}\n\n/**\n * A tab's narrowing in the Plan's words (#1344): the shared narrowing, its\n * empty state said by the Plan's message table.\n *\n * @param narrowing - The tab's narrowing, as its source tab reads it\n * @param tab - The tab\n * @param name - An author's tab's name, as running text writes it\n * @param words - The Plan's words\n * @returns It, in the Plan's words; `undefined` while its sources narrow nothing\n */\nfunction narrowingOf(narrowing: LibraryNarrowing | undefined, tab: PlanLibraryTabWord, name: string, words: PlanWords): LibraryNarrowing | undefined {\n    return narrowing === undefined ? undefined\n        : { ...narrowing, empty: { title: words.m.libraryNarrowed({ tab, name }), description: words.m.libraryNarrowedHint({ tab, name }) } };\n}\n\n/** A tab's body: its Library in the pane's body, busy and taking no gesture while its sources resolve. */\nfunction tabBody(styles: Record<string, Record<string, unknown>>, tab: string, pane: SourceTab<unknown>[\"pane\"], library: ReactNode): ReactNode {\n    return <Box css={styles.libraryPane} data-plan-library={tab} {...pane}>{library}</Box>;\n}\n\n/**\n * The library pane, as `BuilderFrame` draws it — see the module docs.\n *\n * @param props - The library's tabs, the event and resource kinds, the canvas's pick, the Plan's keys, the viewer's hidden set and its setter, the backlog's now, the words, whether a row takes an author's card, the kinds' unscheduled events, whether the canvas takes the event kinds' cards, the kinds with an event on it, what each source the tabs follow shows, what the rail hides of the backlog, and whether the backlog stands in for a read in flight\n * @returns The pane — its tabs the ones `library` lists, each with its count; 272px wide; its collapsed state kept per viewer — or `undefined`, no pane, when `library` lists none\n */\nexport function usePlanLibrary({\n    library, kinds, resources, pick, keys, hidden, onHidden, now, words, takesCards,\n    unscheduled: read, takesEvents = false, patchKinds = NO_PATCH_KINDS, followed = NONE_FOLLOWED, backlogNarrowing = NO_BACKLOG_NARROWING,\n    backlogRetained = false, backlogFlash = false,\n}: PlanLibraryProps): BuilderFrameDock | undefined {\n    const { m } = words;\n    // The kinds' unscheduled events once their first read lands (#1398, CL13): until then the tab knows nothing.\n    const backlogRead = read !== undefined;\n    const unscheduled = read ?? NO_BACKLOG;\n    const styles = useSlotStyles(\"plan\") as Record<string, Record<string, unknown>>;\n    const noun = useCallback((tab: PlanLibraryTabWord) => some({ singular: m.libraryNoun({ tab, n: 1 }), plural: m.libraryNoun({ tab, n: 2 }) }), [m]);\n    const empty = useCallback((tab: PlanLibraryTabWord, name: string): LibraryEmpty => ({ title: m.libraryEmpty({ tab, name }), description: m.libraryEmptyHint({ tab, name }) }), [m]);\n    const listsBacklog = library.some((tab) => tab.type === \"backlog\");\n\n    // Each resource kind's name, by slot.\n    const resourceKinds = useMemo(() => new Map(resources.map((kind) => [kind.key, { name: kind.name }] as const)), [resources]);\n\n    // ── Events: every kind's templates, under its name, then their group (PB27) ──\n    // Each kind's list following its source of the rail (#1344).\n    const templatesFollow = useMemo(() => templatesTab(kinds, followed, words), [kinds, followed, words]);\n    const templates = useMemo(() => libraryOf({\n        id: eventsLibrary(keys),\n        items: templatesFollow.cards.map(({ kind, template }) => {\n            const group = getSomeorUndefined(template.group);\n            const takes = kind.takes.map((slot) => (resourceKinds.get(slot)?.name ?? slot).toLocaleLowerCase(words.locale));\n            const line = m.templateLine({\n                kind: kind.name,\n                duration: kind.instant ? undefined : durationWords(durationMinutes(template.duration), words),\n                resources: takes,\n            });\n            return card({\n                key: printRef({ kind: kind.key, key: template.key }),\n                label: template.name,\n                sublabel: some(line),\n                icon: some(kind.icon),\n                status: none,\n                trailing: none,\n                // A template drags while the canvas has an event kind's row to drop it on (#1196).\n                draggable: takesEvents,\n                filtered: false,\n                placed: false,\n                search: some([template.name, group ?? \"\", line].join(\" · \")),\n                groups: new Map([[\"kind\", m.templateGroup({ kind: kind.name, group })]]),\n            });\n        }),\n        groupOptions: [{ key: \"kind\", label: m.libraryGroupBy({ tab: \"events\" }) }],\n        noun: noun(\"events\"),\n        onCardClick: none,\n    }), [keys, templatesFollow, resourceKinds, words, m, noun, takesEvents]);\n\n    // ── Backlog: every kind's unscheduled events, by when they are due (PB28) ──\n    // Read through each kind's seam with its drafts in place, with the footer's\n    // counts (#1196, `counts.ts`): a card scheduled leaves, an event unscheduled\n    // joins. Tracked there, so a commit to a kind's record reads it again; the\n    // last read stands while one is in flight or has failed.\n    // What the tab lists: the kinds' unscheduled events, while the library lists the tab.\n    const listed = listsBacklog ? unscheduled : NO_BACKLOG;\n    // The resources its cards are on, by name: a listed kind's at once, a paged kind's read by its key (#1199).\n    const named = useMemo(() => {\n        const out = new Map<string, PlanResourceRefValue>();\n        for (const { item } of listed) {\n            const at = getSomeorUndefined(item.resource);\n            if (at !== undefined) out.set(printResource(at), at);\n        }\n        return [...out.values()];\n    }, [listed]);\n    const resourceRows = usePlanResourceRows(resources, named);\n    const resourceName = useCallback((ref: PlanResourceOptionValue): string | undefined => {\n        const at = getSomeorUndefined(ref);\n        return at === undefined ? undefined : resourceRows(at)?.label ?? at.key;\n    }, [resourceRows]);\n    const backlog = useMemo(() => {\n        const rank = (group: DueGroup): number => DUE_GROUPS.indexOf(group);\n        const dated = listed.map((entry) => {\n            const due = getSomeorUndefined(entry.item.due);\n            return { ...entry, due, group: dueGroupOf(due, now) };\n        });\n        // The groups in their order, each soonest due first; the rest as the kinds read them.\n        const ordered = [...dated].sort((a, b) => {\n            if (rank(a.group) !== rank(b.group)) return rank(a.group) < rank(b.group) ? -1 : 1;\n            return a.due !== undefined && b.due !== undefined ? compareDateTime(a.due, b.due) : 0;\n        });\n        return libraryOf({\n            id: backlogLibrary(keys),\n            items: ordered.map(({ kind, item, due, group }) => {\n                const line = m.backlogLine({\n                    duration: durationWords(Number(item.minutes), words),\n                    resource: resourceName(item.resource),\n                    due: due !== undefined ? m.backlogDue({ weekday: words.weekday(due), day: words.number(due.getUTCDate()) }) : undefined,\n                });\n                return card({\n                    key: printRef({ kind: kind.key, key: item.key }),\n                    label: item.title,\n                    sublabel: some(line),\n                    icon: some(kind.icon),\n                    status: none,\n                    trailing: none,\n                    // An unscheduled event drags while the canvas has an event kind's row to drop it on (#1196).\n                    draggable: takesEvents,\n                    filtered: false,\n                    placed: false,\n                    search: some([item.title, kind.name, line].join(\" · \")),\n                    groups: new Map([[\"due\", m.dueGroup({ due: group })]]),\n                });\n            }),\n            groupOptions: [{ key: \"due\", label: m.libraryGroupBy({ tab: \"backlog\" }) }],\n            noun: noun(\"backlog\"),\n            onCardClick: none,\n        });\n    }, [listed, now, keys, words, m, resourceName, noun, takesEvents]);\n    // The backlog is each kind's own narrowing (#1344): it shows what its kinds read, and counts beside it the\n    // stored events their choices hide — `3 of 5` — its Clear filters keeping each window. Until what they hide is\n    // counted — a cold load with a narrowing restored — its count's slot says \"…\", never a bare \"Backlog\" (CL13).\n    const backlogFollow = useMemo((): { count: string | number; narrowing: LibraryNarrowing | undefined } => {\n        const { narrowing, hidden: hiddenByRail, clear } = backlogNarrowing;\n        const shown = backlog.items.length;\n        if (narrowing.length === 0 || clear === undefined) return { count: shown, narrowing: undefined };\n        const held = listed.filter(({ kind }) => narrowing.some((part) => stringEqual(part.kind.key, kind.key))).length;\n        const said: LibraryEmpty = { title: m.libraryNarrowed({ tab: \"backlog\", name: \"\" }), description: m.libraryNarrowedHint({ tab: \"backlog\", name: \"\" }) };\n        return {\n            count: hiddenByRail === undefined ? \"…\" : narrowedCount(words, shown, shown + hiddenByRail, true),\n            narrowing: { empty: said, onClear: clear, emptied: held === 0 },\n        };\n    }, [backlogNarrowing, backlog, listed, words, m]);\n\n    // ── Series: what the canvas shows that the viewer can hide (PB29) ──\n    // A new set is a new pick, so the panel draws its eyes again.\n    const seriesLines = useMemo(() => {\n        const tab = library.find((t) => t.type === \"series\");\n        return tab === undefined ? undefined : { kinds: tab.value.kinds, rows: tab.value.rows.map((line) => line.item) };\n    }, [library]);\n    const seriesPick = useMemo(\n        () => (seriesLines === undefined ? undefined : seriesPickOf(seriesLines, pick, keys.series, hidden, onHidden)),\n        [seriesLines, pick, keys.series, hidden, onHidden]);\n\n    // ── An author's tabs: their cards, a click selecting one (PB62) ──────\n    // A tab's cards drag while a row of the canvas takes a card (#1259), or —\n    // with a `drop` — while an event of its patch's kind is on the canvas (#1196).\n    // The card each tab's click selected, by the tab's key.\n    const [picked, setPicked] = useState<ReadonlyMap<string, string>>(() => new Map());\n    const onAuthorCard = useCallback((tabKey: string, key: string) => {\n        setPicked((was) => {\n            const next = new Map(was);\n            const chosen = was.get(tabKey);\n            if (chosen !== undefined && stringEqual(chosen, key)) next.delete(tabKey);\n            else next.set(tabKey, key);\n            return next;\n        });\n    }, []);\n    const authorTabs = useMemo(() => library.flatMap((tab) => (tab.type === \"tab\" ? [tab.value] : [])), [library]);\n    // Each follows the source it names, by its rows' keys (#1344); one that names none lists its cards whole.\n    const authorFollows = useMemo(() => new Map(authorTabs.map((tab): [string, SourceTab<PlanAuthorCardValue>] => {\n        const source = getSomeorUndefined(tab.source);\n        const shown = source === undefined ? WHOLE : followed.get(source)?.shown ?? WHOLE;\n        const follows = sourceTab<PlanAuthorCardValue>({ cards: tab.cards, keyOf: (c) => c.key, shown, noun: tab.name.toLocaleLowerCase(words.locale), words });\n        return [`tab:${tab.name}`, follows];\n    })), [authorTabs, followed, words]);\n    const authorLibraries = useMemo(() => new Map(authorTabs.map((tab): [string, LibraryValue] => {\n        const tabKey = `tab:${tab.name}`;\n        const chosen = picked.get(tabKey);\n        const icon = getSomeorUndefined(tab.icon);\n        return [tabKey, libraryOf({\n            id: tabLibrary(keys, tab),\n            items: (authorFollows.get(tabKey)?.cards ?? tab.cards).map((c) => {\n                const meta = getSomeorUndefined(c.meta);\n                const group = getSomeorUndefined(c.group);\n                return card({\n                    key: c.key,\n                    label: c.label,\n                    sublabel: meta === undefined ? none : some(meta),\n                    icon: icon === undefined ? none : some(icon),\n                    status: none,\n                    trailing: none,\n                    draggable: takesCards || (tab.drop.type === \"some\" && patchKinds.has(tab.drop.value)),\n                    filtered: false,\n                    placed: chosen !== undefined && stringEqual(chosen, c.key),\n                    search: some([c.key, c.label, meta ?? \"\"].join(\" · \")),\n                    groups: group === undefined ? new Map() : new Map([[\"group\", group]]),\n                });\n            }),\n            groupOptions: tab.cards.some((c) => c.group.type === \"some\") ? [{ key: \"group\", label: m.libraryGroupBy({ tab: \"tab\" }) }] : [],\n            noun: noun(\"tab\"),\n            onCardClick: some((key: string) => { onAuthorCard(tabKey, key); return null; }),\n        })];\n    })), [authorTabs, authorFollows, picked, keys, m, noun, onAuthorCard, takesCards, patchKinds]);\n\n    return useMemo((): BuilderFrameDock | undefined => {\n        // No tab listed: no pane (PB61).\n        if (library.length === 0) return undefined;\n        const tabs = library.map((tab) => {\n            switch (tab.type) {\n                case \"events\":\n                    // Its templates the rail shows, counted, and what it says when the rail leaves it none (#1344).\n                    return { key: \"events\", label: m.libraryTab({ tab: \"events\" }), count: templatesFollow.count, shown: templates.items.length,\n                        body: tabBody(styles, \"events\", templatesFollow.pane, (\n                            <EastChakraLibrary value={templates} storageKey={`${keys.library}.events`}\n                                empty={templatesFollow.empty === undefined ? undefined : empty(\"events\", \"\")}\n                                narrowing={narrowingOf(templatesFollow.narrowing, \"events\", \"\", words)} />\n                        )) };\n                case \"backlog\":\n                    // Before its kinds' first read lands: \"…\" over placeholder cards — never \"Backlog clear\" or 0 (#1398, CL13).\n                    if (!backlogRead) {\n                        return { key: \"backlog\", label: m.libraryTab({ tab: \"backlog\" }), count: \"…\", shown: undefined,\n                            body: tabBody(styles, \"backlog\", { \"aria-busy\": true }, (\n                                <Box css={styles.libraryPending} data-plan-backlog=\"pending\" aria-hidden=\"true\">\n                                    {PENDING_CARDS.map((i) => <PlaceholderCard key={i} height={PENDING_CARD_PX} index={i} />)}\n                                </Box>\n                            )) };\n                    }\n                    // The last complete read's cards and count, held as one; retained while either is read again (#1398, CL8).\n                    return { key: \"backlog\", label: m.libraryTab({ tab: \"backlog\" }), count: backlogFollow.count, shown: backlog.items.length,\n                        ...(backlogFlash ? { flash: true } : {}),\n                        body: tabBody(styles, \"backlog\", backlogRetained ? RETAINED_PANE : READ_PANE, (\n                            <EastChakraLibrary value={backlog} storageKey={`${keys.library}.backlog`} empty={empty(\"backlog\", \"\")} narrowing={backlogFollow.narrowing} />\n                        )) };\n                case \"series\": {\n                    const lines = seriesPick?.items.length ?? 0;\n                    const nothing = empty(\"series\", \"\");\n                    return { key: \"series\", label: m.libraryTab({ tab: \"series\" }), count: lines, shown: lines,\n                        body: seriesPick === undefined || lines === 0\n                            ? <EmptyStateView icon={EMPTY_ICON} title={nothing.title} description={nothing.description} />\n                            : (\n                                <SliceDensityContext.Provider value=\"editor\">\n                                    <EastChakraPickPanel value={{ pick: seriesPick, title: m.libraryTab({ tab: \"series\" }) }} />\n                                </SliceDensityContext.Provider>\n                            ) };\n                }\n                case \"tab\": {\n                    const tabKey = `tab:${tab.value.name}`;\n                    const cards = authorLibraries.get(tabKey)!;\n                    const follows = authorFollows.get(tabKey)!;\n                    const name = tab.value.name.toLocaleLowerCase(words.locale);\n                    return { key: tabKey, label: tab.value.name, count: follows.count, shown: cards.items.length,\n                        body: tabBody(styles, tabKey, follows.pane, (\n                            <EastChakraLibrary value={cards} storageKey={`${keys.library}.${tabKey}`}\n                                empty={follows.empty === undefined ? undefined : empty(\"tab\", tab.value.name)}\n                                narrowing={narrowingOf(follows.narrowing, \"tab\", name, words)} />\n                        )) };\n                }\n            }\n        });\n        // Collapsed, the rail counts the backlog — or, with no Backlog tab, the first tab's cards (PB26): what each shows;\n        // \"…\" until the backlog's first read lands.\n        return {\n            label: m.libraryPane(),\n            icon: \"layer-group\",\n            badge: listsBacklog ? (backlogRead ? backlog.items.length : \"…\") : tabs[0]!.shown,\n            size: LIBRARY_SIZE,\n            persist: \"local\",\n            tabs: tabs.map(({ shown: _shown, ...pane }) => pane),\n        };\n    }, [library, m, words, templates, templatesFollow, backlog, backlogFollow, backlogRead, backlogRetained, seriesPick, authorLibraries, authorFollows, keys, empty, listsBacklog, styles, backlogFlash]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The event kinds' drag and drop (#1196, `Plan Builder Spec.md` §9.7, §10,\n * PB31–PB37, PB63): where a drag of the event kinds' — a template, a backlog\n * event, an element on the canvas, an author's card — lands, what its ghost\n * says there, and the one step of the Plan's history its drop records.\n *\n * - **Where.** An event kind's row stands for a resource — a resource kind's\n *   row of a way its kinds draw (`<slot>.<draw>`), at the resource's path — or\n *   for a kind's events on none, its Unassigned row (`<kind>.unassigned`). A\n *   template or a backlog card lands at the bucket under the pointer, an\n *   element where its row's landing put it (`store.ts`), and an author's card\n *   on the event under the pointer.\n * - **The verdict**, asked where the drag rests and again of the drop: the\n *   kind takes a gesture now; it is placed on the row's resource kind (or, on\n *   its own Unassigned row, takes none); the row draws that kind; its own `write` takes the gesture;\n *   and the Plan's `canDrop` over `Schedule.Types.Candidate` lets it land. The\n *   first refusal is what the ghost says, in red: `Needs presses`, or\n *   `canDrop`'s message. Allowed, the ghost says what lands where:\n *   `Brochure run · Press A1 · Mon, Oct 12, 2026`.\n * - **The gestures**, each one step of the Plan's one history through the\n *   recorder (`events.ts`): a template's drop `create`s an event of its kind\n *   under a new key (`mint`) — from the template's `at` on a day or longer —\n *   for the template's duration, and selects it; a backlog card's drop\n *   `place`s its event there for its own duration; an element's move or\n *   resize `place`s its event, writing the resource field across rows — a\n *   selected element moving the selection with it, by the same units, the\n *   events on its resource onto the row's; an element dropped on the Backlog\n *   tab is `unplace`d, where its kind's times are Options; and an author's\n *   card dropped on an event of its patch's kind sets each field the patch\n *   sets (`field`), in one step.\n *\n * Its answers read the latest kinds, drafts and selection, and are kept per\n * question until any of them moves: a drag resting over a bucket asks the\n * kind's `write` and `canDrop` once. An event is read as the kinds' editing\n * reads it ({@link PlanEventEditing.read}) — for a kind read a window at a\n * time (#1199), among the rows the canvas holds, where the event dragged is\n * drawn — and a paged resource kind's resource is named by its row on the\n * canvas, which the window the drag rests on holds.\n *\n * @packageDocumentation\n */\n\nimport { useMemo, useRef } from \"react\";\nimport { DateTimeType, OptionType, StringType, equalFor, none, parseFor, printFor, some, variant, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { ScheduleEventRefType, ScheduleResourceRefType, type PlanPayloadType, type planKeys } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, type DragEventValue, type Origin } from \"@elaraai/east-ui-components\";\nimport { durationMinutes } from \"../../shared/schedule/due.js\";\nimport { moveSpan } from \"../../shared/time/drag.js\";\nimport { backlogLibrary, eventsLibrary, tabLibrary } from \"../frame/library.js\";\nimport { instantKey, timeInstant } from \"../instant.js\";\nimport { rowKeyOf, type PlanRowId, type PlanRowValue } from \"../model.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport type { PlanRowMove } from \"../rows/SpanRow.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport { fromPlanSlot } from \"../slot.js\";\nimport type { PlanWords } from \"../words.js\";\nimport type { PlanEventChange, PlanEventEditing, PlanEventGestureValue, PlanEventReadValue } from \"./events.js\";\nimport type { PlanEditStore, PlanMovable, PlanProposal, PlanSpan } from \"./store.js\";\nimport { originOf, unmoved, type PlanMoveRequest } from \"./use-carry.js\";\n\ntype PlanPayloadValue = ValueTypeOf<typeof PlanPayloadType>;\n/** One event kind, as the payload carries it. */\ntype PlanEventKindValue = PlanPayloadValue[\"events\"][number];\n/** One resource kind, as the payload carries it. */\ntype PlanResourceKindValue = PlanPayloadValue[\"resources\"][number];\n/** One of the library's tabs, as the payload carries it. */\ntype PlanLibraryTabValue = PlanPayloadValue[\"library\"][number];\n/** An author's tab. */\ntype PlanAuthorTabValue = Extract<PlanLibraryTabValue, { type: \"tab\" }>[\"value\"];\n/** The resource an event is on, if it is. */\ntype PlanResourceOption = option<ValueTypeOf<typeof ScheduleResourceRefType>>;\n/** The names a Plan keeps its viewer's state under. */\ntype PlanKeys = ReturnType<typeof planKeys>;\n\n/** The Plan's drop veto over an event kind's drop (`Schedule.Types.Candidate` → `Option<String>`), decoded. */\nexport type PlanEventCanDropFn = Extract<PlanPayloadValue[\"canDrop\"], { type: \"some\" }>[\"value\"];\n\n/** What the veto is asked. */\ntype PlanCandidateValue = Parameters<PlanEventCanDropFn>[0];\n\n/** The item type an event kind's element carries: a row takes it by the event's kind, never by an item type, and no printed type reads so. */\nexport const PLAN_EVENT_ITEMS = \"#event\";\n\n/** What a row of the event kinds' stands for. */\nexport type PlanEventTarget =\n    /** A resource: its kind's slot, its key's text, the row's path to it, and the way the row draws. */\n    | { readonly kind: \"resource\"; readonly slot: string; readonly key: string; readonly path: readonly string[]; readonly draw: string }\n    /** An event kind's events on no resource: its slot, and the way the row draws. */\n    | { readonly kind: \"unassigned\"; readonly event: string; readonly draw: string };\n\n/** The event kinds' verdict over a drop where a drag rests. */\nexport interface PlanEventVerdict {\n    /** Whether it lands. */\n    readonly allowed: boolean;\n    /** What the ghost says: what lands where, or — refused — why not; `undefined`, nothing. */\n    readonly caption: string | undefined;\n    /** The extent it lands at, or lands on — what the row's landing band spans. */\n    readonly span: PlanSpan | undefined;\n}\n\n/** The event kinds' drag and drop, as the canvas's rows, its drop target and its carry ask it — see the module docs. */\nexport interface PlanEventDrop {\n    /** The libraries whose cards the event kinds take: the Events tab's, the Backlog tab's, and each author's tab's with a `drop`. */\n    readonly libraries: readonly string[];\n    /** The Backlog tab's library: where an element returns to be unscheduled. */\n    readonly backlog: string;\n    /**\n     * What a row stands for.\n     *\n     * @param row - The row\n     * @returns Its resource, or its kind's events on none; `undefined` for a row no event kind draws on\n     */\n    target(row: PlanRowValue): PlanEventTarget | undefined;\n    /**\n     * How a row's elements move: an event kind's row's, by their events.\n     *\n     * @param row - The row\n     * @returns Its elements' moves — a bar's and a chip's with their ends; `undefined` for no event kind's row\n     */\n    rowMove(row: PlanRowValue): PlanRowMove | undefined;\n    /**\n     * Whether an element is an event kind's.\n     *\n     * @param movable - The element\n     */\n    isEvent(movable: PlanMovable): boolean;\n    /**\n     * Whether a row draws an element's kind — its resource's row of the way the\n     * kind draws, or the kind's own Unassigned row: where the keyboard carries it.\n     *\n     * @param row - The row\n     * @param movable - The element\n     */\n    drawsKind(row: PlanRowValue, movable: PlanMovable): boolean;\n    /**\n     * Whether a row of the event kinds' takes a card of a library at all.\n     *\n     * @param library - The card's library\n     */\n    takesCard(library: string): boolean;\n    /**\n     * Whether a card of a library lands on the event under the pointer, rather than at a bucket: an author's card with a `drop`.\n     *\n     * @param library - The card's library\n     */\n    landsOnEvent(library: string): boolean;\n    /**\n     * A row's resource by name, as the ghost and the announcements say it.\n     *\n     * @param row - The row\n     * @returns Its resource's name, or `Unassigned`; `undefined` for no event kind's row\n     */\n    where(row: PlanRowValue): string | undefined;\n    /**\n     * The verdict over a card where the drag rests on a row.\n     *\n     * @param row - The row\n     * @param from - The card: its library and its key\n     * @param slot - The bucket under the pointer, as the drag grammar spells it (`\"\"`, none)\n     * @param event - The element under the pointer, by its key, when there is one\n     * @returns The verdict\n     */\n    card(row: PlanRowValue, from: { readonly library: string; readonly key: string }, slot: string, event: string | undefined): PlanEventVerdict;\n    /**\n     * The verdict over an element landing on a row.\n     *\n     * @param row - The row\n     * @param movable - The element\n     * @param to - Where its row's landing put it; `undefined` before it has rested on the row, which then answers by the kinds alone\n     * @returns The verdict\n     */\n    element(row: PlanRowValue, movable: PlanMovable, to: PlanProposal | undefined): PlanEventVerdict;\n    /**\n     * The verdict over an element returned to a library: unscheduled, on the Backlog tab.\n     *\n     * @param event - The return, a `remove` to its `source`\n     * @param library - The library it is dropped on\n     * @returns The verdict\n     */\n    returning(event: DragEventValue, library: string): PlanEventVerdict;\n    /**\n     * A card dropped on a row — a template's `create`, a backlog event's `place`, or an author's card's fields.\n     *\n     * @param event - The drop, an `add`\n     * @returns Whether it was recorded\n     */\n    dropCard(event: DragEventValue): boolean;\n    /**\n     * An element moved or resized: its event placed, and a selection with it.\n     *\n     * @param request - The move\n     * @returns Whether it was recorded\n     */\n    moveElement(request: PlanMoveRequest): boolean;\n    /**\n     * An element dropped on a library: unscheduled, on the Backlog tab.\n     *\n     * @param event - The return, a `remove` to its `source`\n     * @param library - The library it was dropped on\n     * @returns Whether it was recorded\n     */\n    returnElement(event: DragEventValue, library: string): boolean;\n}\n\n/** What {@link usePlanEventDrag} reads — the latest render's. */\nexport interface PlanEventDragArgs {\n    /** The event kinds; none, no drag of theirs. */\n    kinds: readonly PlanEventKindValue[];\n    /** The resource kinds: a row's resource by name, and a kind's by its slot. */\n    resources: readonly PlanResourceKindValue[];\n    /** The library's tabs: the author's tabs' cards and the kinds their patches land on. */\n    tabs: readonly PlanLibraryTabValue[];\n    /** The names the Plan keeps its viewer's state under: the libraries the cards drag from. */\n    keys: PlanKeys;\n    /** The event kinds' editing: their drafts, the new keys, and the recorder. */\n    editing: PlanEventEditing;\n    /** The Plan's drop veto over an event kind's drop, when it has one. */\n    canDrop: PlanEventCanDropFn | undefined;\n    /** The shared scale: a time scale beside event kinds. */\n    scale: PlanScale | undefined;\n    /** The canvas's words. */\n    words: PlanWords;\n    /** The moves in flight. */\n    store: PlanEditStore;\n    /** A row on the canvas, by its key. */\n    rowOf: (key: RowKey) => PlanRowValue | undefined;\n    /** The events selected on the canvas, by their elements' keys. */\n    selected: () => readonly string[];\n    /** Selects events, on the row given — a template's new event. */\n    select: (keys: readonly string[], row: RowKey | undefined) => void;\n}\n\n/** How a gesture is recorded, once its verdict lets it land. */\ninterface PlanEventGesture {\n    readonly verdict: PlanEventVerdict;\n    /** Each event it changes. */\n    readonly changes: readonly PlanEventChange[];\n    /** Its origin in the history. */\n    readonly origin: Origin;\n    /** Its label in the history — canonical English, as every history's labels are. */\n    readonly label: string;\n    /** The events it selects once recorded, and the row they are on. */\n    readonly selects: { readonly keys: readonly string[]; readonly row: RowKey | undefined } | undefined;\n}\n\n/** The ways an event kind draws, each a row of its resources'. */\nconst DRAWS: readonly string[] = [\"span\", \"buckets\", \"cards\", \"marks\"];\n/** The resolutions a template's `at` applies at: a whole day, or longer. */\nconst WHOLE_DAYS: readonly string[] = [\"day\", \"week\", \"month\", \"quarter\", \"year\"];\n/** A bar's and a chip's moves: their ends resize. */\nconst SPAN_MOVE: PlanRowMove = { items: PLAN_EVENT_ITEMS, resize: true };\n/** A tile's and a mark's moves: one instant, no end. */\nconst POINT_MOVE: PlanRowMove = { items: PLAN_EVENT_ITEMS, resize: false };\n/** No key a gesture has made yet. */\nconst NONE_MINTED: ReadonlySet<string> = new Set();\n/** A `create` writes no existing entry. */\nconst NO_ENTRY = new Uint8Array(0);\n/** No verdict at all: the drag is not the event kinds'. */\nconst NOT_OURS: PlanEventVerdict = { allowed: false, caption: undefined, span: undefined };\n/** A landing the kinds take before the drag has rested on its row. */\nconst TAKEN_QUIETLY: PlanEventVerdict = { allowed: true, caption: undefined, span: undefined };\nconst MINUTE_MS = 60_000;\n\nconst stringEqual = equalFor(StringType);\nconst dateEqual = equalFor(DateTimeType);\nconst resourceEqual = equalFor(OptionType(ScheduleResourceRefType));\nconst parseRef = parseFor(ScheduleEventRefType);\nconst printRef = printFor(ScheduleEventRefType);\n\n/** A gesture the event kinds refuse, saying why. */\nfunction refused(caption: string | undefined, span?: PlanSpan): PlanEventGesture {\n    return { verdict: { allowed: false, caption, span }, changes: [], origin: \"drop\", label: \"\", selects: undefined };\n}\n\n/** An element's key as the event it is: its kind's slot and its key's text. */\nfunction refOf(key: string): { readonly kind: string; readonly key: string } | undefined {\n    const read = parseRef(key);\n    return read.success ? read.value : undefined;\n}\n\n/** A time instant's Date; `undefined` for an instant of another arm. */\nfunction dateOf(t: PlanSpan[\"start\"]): Date | undefined {\n    return t.type === \"time\" ? t.value : undefined;\n}\n\n/**\n * The event kinds with an element drawn on rows of theirs: where an author's\n * card whose patch lands on one of them has an event to land on (#1196, PB63).\n *\n * @param rows - The rows on the canvas\n * @param drop - The event kinds' drag and drop: which rows are theirs\n * @returns The kinds' slots\n */\nexport function drawnKinds(rows: readonly PlanRowValue[], drop: PlanEventDrop): ReadonlySet<string> {\n    const out = new Set<string>();\n    for (const row of rows) {\n        if (drop.target(row) === undefined) continue;\n        const kind = row.kind;\n        const keys = kind.type === \"span\" ? kind.value.runs.map((run) => run.key)\n            : kind.type === \"cards\" ? kind.value.chips.map((chip) => chip.key)\n                : kind.type === \"buckets\" ? kind.value.events.map((tile) => tile.key)\n                    : kind.type === \"events\" ? kind.value.marks.map((mark) => mark.key) : [];\n        for (const key of keys) {\n            const ref = refOf(key);\n            if (ref !== undefined) out.add(ref.kind);\n        }\n    }\n    return out;\n}\n\n/**\n * The event kinds' drag and drop over the latest kinds, drafts and selection —\n * see the module docs.\n *\n * @param args - What it reads, the latest render's\n * @returns Its answers and its gestures, the same object while the libraries hold; `undefined` for a Plan without event kinds\n */\nexport function usePlanEventDrag(args: PlanEventDragArgs): PlanEventDrop | undefined {\n    const latest = useRef(args);\n    latest.current = args;\n    const { keys, tabs } = args;\n    const active = args.kinds.length > 0;\n    // The libraries the kinds take cards from: the Events and Backlog tabs', and each author's tab whose cards land on an event.\n    const libraries = useMemo(() => [\n        eventsLibrary(keys), backlogLibrary(keys),\n        ...tabs.flatMap((tab) => (tab.type === \"tab\" && tab.value.drop.type === \"some\" ? [tabLibrary(keys, tab.value)] : [])),\n    ], [keys, tabs]);\n    // Each answer, kept until what it read moves.\n    const held = useRef<{ read: readonly unknown[]; gestures: Map<string, PlanEventGesture> }>({ read: [], gestures: new Map() });\n    // What a row stands for, kept by the row's own object.\n    const targets = useRef(new WeakMap<PlanRowValue, PlanEventTarget | null>());\n\n    return useMemo((): PlanEventDrop | undefined => {\n        if (!active) return undefined;\n        const events = libraries[0]!;\n        const backlog = libraries[1]!;\n\n        /** The answers kept for what the latest render reads — none, once any of it moved. */\n        const kept = (): Map<string, PlanEventGesture> => {\n            const a = latest.current;\n            const read = [a.kinds, a.resources, a.tabs, a.editing.drafts, a.editing.version, a.canDrop, a.scale, a.words, a.selected()];\n            const was = held.current;\n            if (was.read.length !== read.length || read.some((r, i) => !Object.is(r, was.read[i]))) {\n                held.current = { read, gestures: new Map() };\n            }\n            return held.current.gestures;\n        };\n        const ask = (key: string, plan: () => PlanEventGesture): PlanEventGesture => {\n            const gestures = kept();\n            let gesture = gestures.get(key);\n            if (gesture === undefined) {\n                gesture = plan();\n                gestures.set(key, gesture);\n            }\n            return gesture;\n        };\n\n        const kindOf = (slot: string): PlanEventKindValue | undefined => latest.current.kinds.find((k) => stringEqual(k.key, slot));\n        /** An author's tab whose cards land on an event, by its library. */\n        const authorTab = (library: string): PlanAuthorTabValue | undefined => {\n            const a = latest.current;\n            for (const tab of a.tabs) {\n                if (tab.type === \"tab\" && tab.value.drop.type === \"some\" && stringEqual(tabLibrary(a.keys, tab.value), library)) return tab.value;\n            }\n            return undefined;\n        };\n        /** An event as Plan draws it, and its row, its kind's drafts in place — as the kinds' editing reads it. */\n        const readEvent = (kind: PlanEventKindValue, id: string): PlanEventReadValue | undefined => {\n            try {\n                return latest.current.editing.read(kind.key, id);\n            } catch (err) {\n                console.error(`[Plan] ${kind.name}'s event ${id} could not be read:`, err);\n                return undefined;\n            }\n        };\n\n        const targetOf = (row: PlanRowValue): PlanEventTarget | undefined => {\n            const cached = targets.current.get(row);\n            if (cached !== undefined) return cached ?? undefined;\n            const a = latest.current;\n            let found: PlanEventTarget | undefined;\n            if (row.id.type === \"entry\") {\n                const { series, path } = row.id.value;\n                const leaf = path[path.length - 1];\n                for (const r of a.resources) {\n                    const draw = DRAWS.find((d) => stringEqual(series, `${r.key}.${d}`));\n                    if (draw !== undefined && leaf !== undefined) {\n                        found = { kind: \"resource\", slot: r.key, key: leaf, path, draw };\n                        break;\n                    }\n                }\n                const lost = found === undefined ? a.kinds.find((k) => stringEqual(series, `${k.key}.unassigned`)) : undefined;\n                if (lost !== undefined) found = { kind: \"unassigned\", event: lost.key, draw: path[0] ?? lost.draw.type };\n            }\n            targets.current.set(row, found ?? null);\n            return found;\n        };\n\n        /** The resource a row stands for, as an event names it. */\n        const resourceOf = (target: PlanEventTarget): PlanResourceOption =>\n            (target.kind === \"resource\" ? some({ kind: target.slot, key: target.key }) : none);\n        /**\n         * A row's resource by name: its row's label, else its key; an Unassigned row's, `Unassigned`. A paged kind\n         * lists no resources (#1199): its resource's first row on the canvas — the one its gutter names it on, in\n         * the window that holds the row the drag rests on — says its name.\n         */\n        const whereName = (target: PlanEventTarget): string => {\n            const a = latest.current;\n            if (target.kind === \"unassigned\") return a.words.m.inspectorUnassigned();\n            const kind = a.resources.find((r) => stringEqual(r.key, target.slot));\n            if (kind?.byKey.type === \"some\") {\n                for (const draw of DRAWS) {\n                    const row = a.rowOf(rowKeyOf(variant(\"entry\", { series: `${target.slot}.${draw}`, path: [...target.path] }) as PlanRowId));\n                    if (row !== undefined) return row.gutter.label;\n                }\n                return target.key;\n            }\n            return kind?.rows.find((r) => stringEqual(r.key, target.key))?.label ?? target.key;\n        };\n        /** Whether a kind is placed on what a row stands for. */\n        const onResource = (kind: PlanEventKindValue, target: PlanEventTarget): boolean => (target.kind === \"resource\"\n            ? kind.takes.some((slot) => stringEqual(slot, target.slot))\n            : stringEqual(kind.key, target.event));\n        /** A drop must stay on the sub-row that actually draws its kind. */\n        const takes = (kind: PlanEventKindValue, target: PlanEventTarget): boolean =>\n            onResource(kind, target) && stringEqual(target.draw, kind.draw.type);\n        /** Explain the missing resource or the compatible sub-row, before anything is drafted. */\n        const needs = (kind: PlanEventKindValue, target?: PlanEventTarget): string => {\n            const a = latest.current;\n            if (target !== undefined && onResource(kind, target)) return a.words.m.dropNeedsRow({ kind: kind.name });\n            const names = kind.takes.map((slot) => (a.resources.find((r) => stringEqual(r.key, slot))?.name ?? slot).toLocaleLowerCase(a.words.locale));\n            return a.words.m.dropNeeds({ resources: names });\n        };\n        /** The day an event starts, and its time when it has one — or the canvas reads hours. */\n        const whenOf = (start: Date): { day: string; time: string | undefined } => {\n            const a = latest.current;\n            const timed = a.scale?.resolution === \"hour\" || start.getUTCHours() !== 0 || start.getUTCMinutes() !== 0;\n            return { day: a.words.weekdayDate(start), time: timed ? a.words.time(start) : undefined };\n        };\n        /** The row a kind's event on what a row stands for draws on, when the canvas has it. */\n        const rowFor = (kind: PlanEventKindValue, target: PlanEventTarget): RowKey | undefined => {\n            const id = target.kind === \"resource\"\n                ? variant(\"entry\", { series: `${target.slot}.${kind.draw.type}`, path: [...target.path] })\n                : variant(\"entry\", { series: `${kind.key}.unassigned`, path: [kind.draw.type] });\n            const key = rowKeyOf(id as PlanRowId);\n            return latest.current.rowOf(key) !== undefined ? key : undefined;\n        };\n\n        /**\n         * Whether one event of a kind lands as a gesture writes it: the kind\n         * takes a gesture now, its own `write` takes this one, and the Plan's\n         * `canDrop` lets it land.\n         *\n         * @returns `undefined` when it lands; else why not\n         */\n        const judge = (kind: PlanEventKindValue, change: { id: string; entry: Uint8Array; gesture: PlanEventGestureValue },\n            candidate: PlanCandidateValue | undefined): string | undefined => {\n            const a = latest.current;\n            const m = a.words.m;\n            if (!a.editing.available(kind.key)) return m.dropBusy({ kind: kind.name });\n            let written: ReturnType<PlanEventKindValue[\"write\"]>[number] | undefined;\n            try {\n                written = kind.write([change])[0];\n            } catch (err) {\n                console.error(`[Plan] ${kind.name}'s write of a drop failed:`, err);\n                return m.dropRefused();\n            }\n            if (written === undefined || written.type !== \"some\") {\n                // Its write refuses the resource: on none, a kind whose field holds one.\n                const onNone = candidate !== undefined && candidate.resource.type === \"none\";\n                return onNone ? needs(kind) : m.dropRefused();\n            }\n            if (candidate !== undefined && a.canDrop !== undefined) {\n                try {\n                    const said = a.canDrop(candidate);\n                    if (said.type === \"some\") return said.value;\n                } catch (err) {\n                    // A broken validator must not brick the surface: it lets the drop land.\n                    console.error(\"[Plan] canDrop failed (allowing):\", err);\n                }\n            }\n            return undefined;\n        };\n\n        /** The bucket a slot names, its start a Date. */\n        const bucketStart = (slot: string): Date | undefined => {\n            const at = slot === \"\" ? undefined : fromPlanSlot(\"time\", slot);\n            return at !== undefined ? dateOf(at) : undefined;\n        };\n\n        // ── A card where the drag rests ───────────────────────────────────────\n        const planCard = (row: PlanRowValue, from: { readonly library: string; readonly key: string }, slot: string, event: string | undefined): PlanEventGesture => {\n            const a = latest.current;\n            const m = a.words.m;\n            const target = targetOf(row);\n            if (target === undefined) return refused(undefined);\n            // An author's card: the event under the pointer, of its patch's kind (PB63).\n            const tab = authorTab(from.library);\n            if (tab !== undefined) {\n                const card = tab.cards.find((c) => stringEqual(c.key, from.key));\n                if (card === undefined || tab.drop.type !== \"some\") return refused(undefined);\n                const fields = card.sets.map((set) => set.path[set.path.length - 1] ?? \"\");\n                const ref = event !== undefined ? refOf(event) : undefined;\n                const kind = ref !== undefined ? kindOf(ref.kind) : undefined;\n                if (ref === undefined || kind === undefined) return refused(m.dropCardNeedsEvent({ fields }));\n                if (!stringEqual(kind.key, tab.drop.value)) return refused(m.dropKindTakesNo({ kind: kind.name, fields }));\n                const read = readEvent(kind, ref.key);\n                if (read === undefined) return refused(m.dropCardNeedsEvent({ fields }));\n                const start = getSomeorUndefined(read.item.start);\n                const end = getSomeorUndefined(read.item.end);\n                const span = start !== undefined && end !== undefined ? { start: timeInstant(start), end: timeInstant(end) } : undefined;\n                if (!a.editing.available(kind.key)) return refused(m.dropBusy({ kind: kind.name }), span);\n                return {\n                    verdict: { allowed: true, caption: m.dropCardOnEvent({ card: card.label, event: read.item.title }), span },\n                    changes: card.sets.map((set): PlanEventChange => ({ kind: kind.key, id: ref.key, gesture: variant(\"field\", { path: [...set.path], value: set.value }) })),\n                    origin: \"drop\",\n                    label: `Set ${card.label} on ${read.item.title}`,\n                    selects: undefined,\n                };\n            }\n            const isTemplate = stringEqual(from.library, events);\n            if (!isTemplate && !stringEqual(from.library, backlog)) return refused(undefined);\n            const ref = refOf(from.key);\n            const kind = ref !== undefined ? kindOf(ref.kind) : undefined;\n            if (ref === undefined || kind === undefined) return refused(undefined);\n            const at = bucketStart(slot);\n            if (at === undefined) return refused(undefined);\n            const where = whereName(target);\n            const resource = resourceOf(target);\n            if (!takes(kind, target)) return refused(needs(kind, target));\n            if (isTemplate) {\n                // A template (PB32): a new event at the bucket — from its `at` on a whole day — for its duration.\n                const template = kind.templates.find((t) => stringEqual(t.key, ref.key));\n                if (template === undefined) return refused(undefined);\n                const clock = getSomeorUndefined(template.at);\n                const start = clock !== undefined && WHOLE_DAYS.includes(a.scale?.resolution ?? \"\")\n                    ? new Date(at.getTime() + (Number(clock.hour) * 60 + Number(clock.minute)) * MINUTE_MS)\n                    : at;\n                const end = kind.instant ? start : new Date(start.getTime() + durationMinutes(template.duration) * MINUTE_MS);\n                const span = { start: timeInstant(start), end: timeInstant(end) };\n                const id = a.editing.mint(kind.key, template.key, NONE_MINTED);\n                if (id === undefined) return refused(m.dropRefused(), span);\n                const gesture = variant(\"create\", { template: template.key, start, end, resource }) as PlanEventGestureValue;\n                const why = judge(kind, { id, entry: NO_ENTRY, gesture }, { kind: kind.key, from: variant(\"template\", template.key), start, end, resource });\n                if (why !== undefined) return refused(why, span);\n                return {\n                    verdict: { allowed: true, caption: m.dropCaption({ what: template.name, where, ...whenOf(start) }), span },\n                    changes: [{ kind: kind.key, id, gesture }],\n                    origin: \"drop\",\n                    label: `Drop ${template.name} on ${where}`,\n                    selects: { keys: [printRef({ kind: kind.key, key: id })], row: rowFor(kind, target) },\n                };\n            }\n            // A backlog event (PB33): scheduled at the bucket, for its own duration.\n            const read = readEvent(kind, ref.key);\n            if (read === undefined) return refused(undefined);\n            const start = at;\n            const end = kind.instant ? start : new Date(start.getTime() + Number(read.item.minutes) * MINUTE_MS);\n            const span = { start: timeInstant(start), end: timeInstant(end) };\n            const gesture = variant(\"place\", { start, end, resource }) as PlanEventGestureValue;\n            const why = judge(kind, { id: ref.key, entry: read.row, gesture }, { kind: kind.key, from: variant(\"backlog\", ref.key), start, end, resource });\n            if (why !== undefined) return refused(why, span);\n            return {\n                verdict: { allowed: true, caption: m.dropCaption({ what: read.item.title, where, ...whenOf(start) }), span },\n                changes: [{ kind: kind.key, id: ref.key, gesture }],\n                origin: \"drop\",\n                label: `Schedule ${read.item.title} on ${where}`,\n                selects: { keys: [printRef({ kind: kind.key, key: ref.key })], row: rowFor(kind, target) },\n            };\n        };\n\n        // ── An element where its row's landing put it ─────────────────────────\n        const planElement = (row: PlanRowValue, movable: PlanMovable, to: PlanProposal): PlanEventGesture => {\n            const a = latest.current;\n            const m = a.words.m;\n            const scale = a.scale;\n            const target = targetOf(row);\n            const ref = refOf(movable.key);\n            const kind = ref !== undefined ? kindOf(ref.kind) : undefined;\n            if (target === undefined || ref === undefined || kind === undefined || scale === undefined) return refused(undefined);\n            if (!takes(kind, target)) return refused(needs(kind, target), to.span);\n            const origin = originOf(movable, to);\n            const units = to.units ?? 0;\n            const fine = to.fine ?? false;\n            const across = to.rowKey !== movable.rowKey;\n            /**\n             * One event placed by the gesture: its times moved, and its resource the row's when it moves across onto\n             * it — and whether that moves it at all.\n             */\n            const placeOf = (k: PlanEventKindValue, id: string, read: PlanEventReadValue, exact: PlanSpan | undefined, follows: boolean) => {\n                const start0 = getSomeorUndefined(read.item.start);\n                const end0 = getSomeorUndefined(read.item.end);\n                if (start0 === undefined || end0 === undefined) return undefined;\n                const span = exact ?? moveSpan(scale, { start: timeInstant(start0), end: timeInstant(end0) }, units, fine);\n                const start = dateOf(span.start);\n                const end = dateOf(span.end);\n                if (start === undefined || end === undefined) return undefined;\n                const resource = follows ? resourceOf(target) : read.item.resource;\n                const gesture = variant(\"place\", { start, end, resource }) as PlanEventGestureValue;\n                const moved = !dateEqual(start, start0) || !dateEqual(end, end0) || !resourceEqual(resource, read.item.resource);\n                return { kind: k, id, read, start, end, resource, gesture, moved };\n            };\n            const read = readEvent(kind, ref.key);\n            if (read === undefined) return refused(undefined, to.span);\n            // The element is its event's extent — a bar, a chip, an instant kind's tile or mark — and lands as the row\n            // put it; any other's tile or mark moves its event's own times by the units the element moved.\n            const exact = movable.kind === \"run\" || movable.kind === \"chip\" || kind.instant;\n            const own = placeOf(kind, ref.key, read, exact ? to.span : undefined, across);\n            if (own === undefined) return refused(undefined, to.span);\n            const placed = [own];\n            // A selected element moves the selection (PB34): the others by the same units, those on its resource onto the row's.\n            const selected = a.selected();\n            if (origin.kind === \"move\" && (units !== 0 || across) && selected.length > 1 && selected.includes(movable.key)) {\n                for (const key of selected) {\n                    if (stringEqual(key, movable.key)) continue;\n                    const other = refOf(key);\n                    const otherKind = other !== undefined ? kindOf(other.kind) : undefined;\n                    const otherRead = other !== undefined && otherKind !== undefined ? readEvent(otherKind, other.key) : undefined;\n                    if (other === undefined || otherKind === undefined || otherRead === undefined) continue;\n                    const follows = across && resourceEqual(otherRead.item.resource, read.item.resource);\n                    const one = placeOf(otherKind, other.key, otherRead, undefined, follows);\n                    if (one !== undefined) placed.push(one);\n                }\n            }\n            // What the gesture changes: an event it leaves where it was — another selected one on a resource of its own,\n            // carried across, or the grabbed one let go where it stands — is none of it. Nothing changed, it lands as\n            // nothing: the ghost says where the element stands, and the drop records no step.\n            const changed = placed.filter((one) => one.moved);\n            // One part refused refuses the whole: a selection moves together, or not at all.\n            for (const one of changed) {\n                const why = judge(one.kind, { id: one.id, entry: one.read.row, gesture: one.gesture },\n                    { kind: one.kind.key, from: variant(\"event\", one.id), start: one.start, end: one.end, resource: one.resource });\n                if (why !== undefined) return refused(why, to.span);\n            }\n            const what = changed.length > 1 ? m.inspectorEvents({ n: changed.length, count: a.words.number(changed.length) }) : movable.label;\n            const where = whereName(target);\n            const label = changed.length > 1 ? `Move ${changed.length} events`\n                : origin.kind === \"resize\" ? `Resize ${movable.label}`\n                    : across ? `Move ${movable.label} to ${where}` : `Move ${movable.label}`;\n            return {\n                verdict: { allowed: true, caption: m.dropCaption({ what, where, ...whenOf(own.start) }), span: to.span },\n                changes: changed.map((one): PlanEventChange => ({ kind: one.kind.key, id: one.id, gesture: one.gesture })),\n                origin: origin.kind,\n                label,\n                selects: undefined,\n            };\n        };\n\n        // ── An element returned to a library ──────────────────────────────────\n        const planReturn = (event: DragEventValue, library: string): PlanEventGesture => {\n            const a = latest.current;\n            const m = a.words.m;\n            if (event.type !== \"remove\" || !stringEqual(library, backlog)) return refused(undefined);\n            const key = getSomeorUndefined(event.value.from.event);\n            const ref = key !== undefined ? refOf(key) : undefined;\n            const kind = ref !== undefined ? kindOf(ref.kind) : undefined;\n            if (ref === undefined || kind === undefined) return refused(undefined);\n            // Its times go to none (PB36): a kind whose times are Options alone has a backlog.\n            if (!kind.backlog) return refused(m.dropNoBacklog({ kind: kind.name }));\n            const read = readEvent(kind, ref.key);\n            if (read === undefined) return refused(undefined);\n            const gesture = variant(\"unplace\", null) as PlanEventGestureValue;\n            const why = judge(kind, { id: ref.key, entry: read.row, gesture }, undefined);\n            if (why !== undefined) return refused(why);\n            return {\n                verdict: { allowed: true, caption: m.dropUnschedule({ what: read.item.title }), span: undefined },\n                changes: [{ kind: kind.key, id: ref.key, gesture }],\n                origin: \"move\",\n                label: `Unschedule ${read.item.title}`,\n                selects: undefined,\n            };\n        };\n\n        const cardGesture = (row: PlanRowValue, from: { readonly library: string; readonly key: string }, slot: string, event: string | undefined) =>\n            ask(`card|${row.key}|${from.library}|${from.key}|${slot}|${event ?? \"\"}`, () => planCard(row, from, slot, event));\n        const elementGesture = (row: PlanRowValue, movable: PlanMovable, to: PlanProposal) =>\n            ask(`element|${row.key}|${movable.rowKey}|${movable.key}|${to.rowKey}|${instantKey(to.span.start)}|${instantKey(to.span.end)}|${to.units ?? \"\"}|${to.fine === true}`,\n                () => planElement(row, movable, to));\n        const returnGesture = (event: DragEventValue, library: string) => {\n            const key = event.type === \"remove\" ? getSomeorUndefined(event.value.from.event) ?? \"\" : \"\";\n            return ask(`return|${library}|${key}`, () => planReturn(event, library));\n        };\n        /** Record a gesture the kinds let land as one step, and select what it selects. */\n        const record = (gesture: PlanEventGesture): boolean => {\n            const a = latest.current;\n            if (!gesture.verdict.allowed || gesture.changes.length === 0) return false;\n            if (!a.editing.record(gesture.changes, gesture.origin, gesture.label)) return false;\n            if (gesture.selects !== undefined) a.select(gesture.selects.keys, gesture.selects.row);\n            return true;\n        };\n\n        return {\n            libraries,\n            backlog,\n            target: targetOf,\n            rowMove: (row) => {\n                const target = targetOf(row);\n                if (target === undefined) return undefined;\n                return stringEqual(target.draw, \"span\") || stringEqual(target.draw, \"cards\") ? SPAN_MOVE : POINT_MOVE;\n            },\n            isEvent: (movable) => stringEqual(movable.items, PLAN_EVENT_ITEMS),\n            drawsKind: (row, movable) => {\n                const target = targetOf(row);\n                const ref = refOf(movable.key);\n                const kind = ref !== undefined ? kindOf(ref.kind) : undefined;\n                return target !== undefined && kind !== undefined && takes(kind, target);\n            },\n            takesCard: (library) => libraries.some((l) => stringEqual(l, library)),\n            landsOnEvent: (library) => authorTab(library) !== undefined,\n            where: (row) => {\n                const target = targetOf(row);\n                return target !== undefined ? whereName(target) : undefined;\n            },\n            card: (row, from, slot, event) => cardGesture(row, from, slot, event).verdict,\n            element: (row, movable, to) => {\n                if (to === undefined) {\n                    // Before the drag rests on the row, the kinds alone answer: a destination it may take.\n                    const target = targetOf(row);\n                    const ref = refOf(movable.key);\n                    const kind = ref !== undefined ? kindOf(ref.kind) : undefined;\n                    return target !== undefined && kind !== undefined && takes(kind, target) ? TAKEN_QUIETLY : NOT_OURS;\n                }\n                return elementGesture(row, movable, to).verdict;\n            },\n            returning: (event, library) => returnGesture(event, library).verdict,\n            dropCard: (event) => {\n                if (event.type !== \"add\") return false;\n                const { from, into } = event.value;\n                const row = latest.current.rowOf(into.row);\n                return row !== undefined && record(cardGesture(row, from, into.slot, getSomeorUndefined(into.event)));\n            },\n            moveElement: (request) => {\n                const movable = request.element;\n                const row = latest.current.rowOf(request.to);\n                if (movable === undefined || !stringEqual(movable.items, PLAN_EVENT_ITEMS) || row === undefined) return false;\n                const to: PlanProposal = { rowKey: request.to, span: request.span, units: request.units, fine: request.fine };\n                return !unmoved(movable, to) && record(elementGesture(row, movable, to));\n            },\n            returnElement: (event, library) => record(returnGesture(event, library)),\n        };\n    }, [active, libraries]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Heat rows (`Plan Spec.md` §4·K4) — the Matrix cell recipes quantised onto\n * the shared scale: heat cells on the design system's heat ramp, five steps\n * (`heat.1` … `heat.5`; #949 — the cell's value prints in the ink its step\n * pairs with, at least 4.5:1 in both themes), 45° no-data hatch, ≥ warn\n * threshold ring,\n * booked-vs-free weight bars (planned ⇒ pale), and weighted segment\n * compositions. The renderer names each cell's STEP and each segment's FILL\n * as data attributes; every colour lives on the `plan` recipe slots.\n *\n * Group summary strips (§5) are exactly the `heat` arm rendered by\n * {@link HeatCells} — GroupRow delegates here.\n *\n * A data row's cell names itself — `data-cell`, its own declared instant —\n * so the canvas's one overlay layer opens the root's popover and hover card\n * for it (#816, #743 item 5). A group strip's cells are the band's toggle\n * instead, and name nothing.\n *\n * Every cell says the value its colour or width encodes (#819): a data row's\n * cell is a button named by its bucket and value, a strip's cell carries the\n * same words as visually hidden text.\n */\n\nimport { variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Box, VisuallyHidden } from \"@chakra-ui/react\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { usePlanDispatch, usePlanResolvers, usePlanScale, type PlanElementRefValue } from \"../context.js\";\nimport { instantKey, type PlanInstantValue } from \"../instant.js\";\nimport type { PlanBucket } from \"../scale.js\";\nimport { maxOf, minOf } from \"../reductions.js\";\nimport { cellName, heatValueText, segmentsText, weightValueText } from \"../a11y.js\";\nimport type { PlanRowId } from \"../model.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype HeatCellsValue = ValueTypeOf<typeof Plan.Types.HeatCells>;\n\n/** The heat-ramp level a depth in `[0, 1]` falls on — five, 0 to 4 (the\n *  ramp's steps 1 to 5). */\nexport function heatLevel(depth: number): number {\n    return Math.max(0, Math.min(4, Math.round(depth * 4)));\n}\n\nexport type HeatCellsProps = {\n    /** R2 context strip (#591) — render this row's marks at strip size. */\n    ctx?: boolean | undefined;\n\n    rowKey: string;\n    cells: HeatCellsValue;\n    styles: Styles;\n} & (\n    | {\n        /** A data row's cells are elements: a click selects the row and names\n         *  it by its id (#822). */\n        rowId: PlanRowId;\n        onCellClick?: undefined;\n    }\n    | {\n        /** What a strip's cell click DOES instead. A collapsed group's summary\n         *  strip passes its toggle — selecting the GROUP key is a click that\n         *  visibly does nothing, and it swallows the band's own toggle (#615). */\n        onCellClick: () => void;\n        rowId?: undefined;\n    }\n);\n\n/**\n * The heat-arm plot content — one cell / bar / composition per bucket,\n * positioned by `bucketOf` with the §8 3px insets.\n */\nexport function HeatCells({ rowKey, rowId, cells, styles, ctx, onCellClick }: HeatCellsProps) {\n    const ctxAttr = ctx === true ? \"\" : undefined;\n    const scale = usePlanScale();\n    const dispatch = usePlanDispatch();\n    // The canvas's words (#820) — every cell's text alternative speaks them.\n    const w = usePlanWords();\n    const { onElementClick } = usePlanResolvers();\n    // RENDER bucketing (#619): overscan cells mount clipped at rest so a\n    // brush-slide pan reveals them; interactions still speak `bucketOf`.\n    const cellBox = (at: PlanInstantValue): { left: string; width: string; bucket: PlanBucket } | undefined => {\n        const b = scale.renderBucketOf(at);\n        if (b === undefined) return undefined;\n        return { left: `calc(${b.x0 * 100}% + 1.5px)`, width: `calc(${(b.x1 - b.x0) * 100}% - 3px)`, bucket: b };\n    };\n    // A data row's cell is an element — it names its instant, takes focus for\n    // the keyboard path to its popover, and is a button named by its bucket\n    // and value (#819). A strip's cell is part of its band: its words are\n    // visually hidden text (`cellWords`), and its printed label is then their\n    // echo.\n    const element = onCellClick === undefined;\n    const cellAttrs = (at: PlanInstantValue, bucket: PlanBucket, value: string) => (element\n        ? {\n            \"data-cell\": instantKey(at), \"data-plan-frac\": bucket.x0.toFixed(4), tabIndex: -1,\n            role: \"button\", \"aria-label\": cellName(scale, bucket, value, w),\n        }\n        : {});\n    const cellWords = (bucket: PlanBucket, value: string) => (element\n        ? null\n        : <VisuallyHidden>{cellName(scale, bucket, value, w)}</VisuallyHidden>);\n    const clickCell = (at: PlanInstantValue) => (e: React.MouseEvent) => {\n        e.stopPropagation();\n        if (onCellClick !== undefined) {\n            onCellClick();\n            return;\n        }\n        dispatch({ t: \"row.select\", key: rowKey });\n        // The cell's own declared instant — what the author addressed it by.\n        if (rowId !== undefined) onElementClick?.(variant(\"cell\", { row: rowId, at }) as PlanElementRefValue);\n    };\n\n    if (cells.type === \"heat\") {\n        const { cells: hc, scale: { min, max, warnAt } } = cells.value;\n        const format = getSomeorUndefined(cells.value.format);\n        const values = hc.map((c) => (c.value.type === \"some\" ? c.value.value : undefined));\n        const present = values.filter((v): v is number => v !== undefined);\n        const lo = min.type === \"some\" ? min.value : (present.length > 0 ? minOf(present) : 0);\n        const hi = max.type === \"some\" ? max.value : (present.length > 0 ? maxOf(present) : 1);\n        const warn = warnAt.type === \"some\" ? warnAt.value : undefined;\n        const span = hi - lo;\n        return (\n            <>\n                {hc.map((c, i) => {\n                    const box = cellBox(c.at);\n                    if (box === undefined) return null;\n                    const v = values[i];\n                    const depth = v === undefined || span <= 0 ? 0 : Math.max(0, Math.min(1, (v - lo) / span));\n                    // A cell prints its label; one without prints its value\n                    // only through a declared format (#824) — a row painted by\n                    // depth alone stays unprinted.\n                    const label = c.label.type === \"some\" ? c.label.value\n                        : v !== undefined && format !== undefined ? w.value(v, format) : undefined;\n                    const warned = v !== undefined && warn !== undefined && v >= warn;\n                    const words = heatValueText(v, label, warned, w);\n                    // Its level on the heat ramp — the recipe paints it, and\n                    // inks its value to match.\n                    const level = v === undefined ? undefined : heatLevel(depth);\n                    return (\n                        <Box key={i} css={styles.heatCell} data-ctx={ctxAttr}\n                            data-plan-bucket={box.bucket.index}\n                            {...cellAttrs(c.at, box.bucket, words)}\n                            data-nodata={v === undefined ? \"\" : undefined}\n                            data-warn={warned ? \"\" : undefined}\n                            data-level={level}\n                            style={{ left: box.left, width: box.width }}\n                            onClick={clickCell(c.at)}\n                        >\n                            {/* Its number: drawn whole, or — wider than the cell — off its line, out of sight, and said\n                                by the cell's hover (#1269). */}\n                            <Box as=\"span\" css={styles.heatLabel} data-level={level} data-ctx={ctxAttr} data-plan-heat-label\n                                data-plan-label=\"\" aria-hidden={element ? undefined : \"true\"}>\n                                {v === undefined ? \"–\" : label}\n                            </Box>\n                            {cellWords(box.bucket, words)}\n                        </Box>\n                    );\n                })}\n            </>\n        );\n    }\n\n    if (cells.type === \"weight\") {\n        // The Matrix `.wbar`: a single left-anchored bar, its width the\n        // booked fraction of the cell — no background track.\n        const format = getSomeorUndefined(cells.value.format);\n        return (\n            <>\n                {cells.value.cells.map((c, i) => {\n                    const b = scale.renderBucketOf(c.at);\n                    if (b === undefined) return null;\n                    const frac = Math.max(0, Math.min(1, c.fraction));\n                    const words = weightValueText(c.fraction, c.planned, w, format);\n                    return (\n                        <Box key={i} css={styles.weightBar}\n                            data-plan-bucket={b.index}\n                            {...cellAttrs(c.at, b, words)}\n                            data-planned={c.planned ? \"\" : undefined}\n                            style={{ left: `calc(${b.x0 * 100}% + 4px)`, width: `calc((${(b.x1 - b.x0) * 100}% - 8px) * ${frac})` }}\n                            onClick={clickCell(c.at)}>\n                            {cellWords(b, words)}\n                        </Box>\n                    );\n                })}\n            </>\n        );\n    }\n\n    const segmentFormat = getSomeorUndefined(cells.value.format);\n    return (\n        <>\n            {cells.value.cells.map((c, i) => {\n                const b = scale.renderBucketOf(c.at);\n                if (b === undefined) return null;\n                const total = c.segments.reduce((acc, s) => acc + Math.max(0, s.weight), 0);\n                const words = segmentsText(c.segments, w, segmentFormat);\n                return (\n                    <Box key={i} css={styles.segmentTrack}\n                        data-plan-bucket={b.index}\n                        {...cellAttrs(c.at, b, words)}\n                        style={{ left: `calc(${b.x0 * 100}% + 4px)`, width: `calc(${(b.x1 - b.x0) * 100}% - 8px)` }}\n                        onClick={clickCell(c.at)}>\n                        {c.segments.map((s, j) => {\n                            const share = total > 0 ? Math.max(0, s.weight) / total : 0;\n                            const label = s.label.type === \"some\" ? s.label.value : undefined;\n                            const fillTag = s.fill.type;\n                            return (\n                                <Box key={j} css={styles.segmentPart}\n                                    style={{ width: `${share * 100}%` }}\n                                    // The fill names its meaning; the recipe paints it.\n                                    data-fill={fillTag}\n                                    aria-hidden={element ? undefined : \"true\"}\n                                >\n                                    {share > 0.14 ? label : undefined}\n                                </Box>\n                            );\n                        })}\n                        {cellWords(b, words)}\n                    </Box>\n                );\n            })}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A diagnostic row's plot (#811) — the row keeps its gutter and its place,\n * and its plot says why it draws nothing.\n *\n * Every instant on a canvas must ride its axis's arm (#631). A row that does\n * not cannot be placed truthfully, so it is not placed at all — and not\n * rolled up either (`derivePlan`) — while the rest of the canvas draws. A row\n * repeating the id of an earlier row (#822) is drawn the same way: never a\n * silent drop, and never a second row answering to one id.\n */\n\nimport { Box } from \"@chakra-ui/react\";\nimport type { PlanRowDiagnostic } from \"../model.js\";\nimport { usePlanWords, type PlanWords } from \"../words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/**\n * The one-line reason a diagnostic row draws nothing.\n *\n * @param diagnostic - The row's diagnostic (`PlanDerived.diagnostics`)\n * @param w - The canvas's words (#820)\n * @returns The message\n */\nexport function diagnosticText(diagnostic: PlanRowDiagnostic, w: PlanWords): string {\n    switch (diagnostic.kind) {\n        case \"axis\": return w.m.axisMismatch({ found: diagnostic.found, expected: diagnostic.expected });\n        case \"duplicate\": return w.m.duplicateRow({ id: diagnostic.of });\n    }\n}\n\nexport interface RowDiagnosticProps {\n    diagnostic: PlanRowDiagnostic;\n    styles: Styles;\n    /** R2 context strip — the hatch stays, the words do not fit. */\n    ctx?: boolean | undefined;\n}\n\n/**\n * Fill a row's plot with its diagnostic.\n *\n * @param props - The diagnostic, the recipe styles and the strip flag\n * @returns The plot content\n */\nexport function RowDiagnostic({ diagnostic, styles, ctx }: RowDiagnosticProps) {\n    const words = usePlanWords();\n    return (\n        <Box css={styles.rowDiagnostic}\n            // The axis kind the row's instants ride, or `duplicate`.\n            data-plan-diagnostic={diagnostic.kind === \"axis\" ? diagnostic.found : \"duplicate\"}\n            data-ctx={ctx === true ? \"\" : undefined}>\n            {diagnosticText(diagnostic, words)}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The narrow layout's two-finger horizontal pan (§10): \"horizontal pan is\n * two-finger so page scroll stays vertical\". One finger scrolls the page;\n * two fingers moving together drag the WINDOW, one whole period per period\n * width crossed — the same `pan` the `[` / `]` keys emit, so the write goes\n * through the slice like every other window change.\n *\n * Which fingers the list holds, and when two of them pan, are the shared\n * pointer core's (east-ui-components' `src/pointer/`): the list is a surface\n * of it, and its two fingers' pinch is the pan. A finger is held only while it\n * is down — one whose lift is never heard is let go of as the page's next first\n * finger lands, or the window loses the page — so none is counted into a pan\n * that never ends, nor against the two that pan. What is here is what the\n * list's gestures do ({@link twoFingerPan}), and the arithmetic under it\n * ({@link panPeriods}): pure, no React.\n */\n\nimport type { GestureHost } from \"@elaraai/east-ui-components/internal\";\n\n/** A pan's running state — one a list. */\nexport interface TwoFingerPan {\n    /** Horizontal travel of the point midway between the two fingers since the last period edge crossed, in px. */\n    travel: number;\n}\n\n/** A pan at rest. */\nexport function newTwoFingerPan(): TwoFingerPan {\n    return { travel: 0 };\n}\n\n/**\n * Adds a move to a pan's travel, and takes out of it the whole periods it has\n * crossed.\n *\n * @param travel - The travel since the last period edge crossed, in px\n * @param moved - How far the point midway between the two fingers moved, in px: negative, to the left\n * @param periodPx - One period's width in px (≤ 0 crosses none)\n * @returns The travel left, and the whole periods crossed: positive, later in time — the content was dragged LEFT\n */\nexport function panPeriods(travel: number, moved: number, periodPx: number): { travel: number; periods: number } {\n    let left = travel + moved;\n    if (periodPx <= 0) return { travel: left, periods: 0 };\n    // Dragging the content left (negative travel) reveals later time.\n    let periods = 0;\n    while (Math.abs(left) >= periodPx) {\n        const step = left < 0 ? 1 : -1;\n        periods += step;\n        left += step * periodPx;\n    }\n    return { travel: left, periods };\n}\n\n/**\n * What the list's gestures do: one finger nothing — the page's scroll is its —\n * and two a pan, the point midway between them carrying the window a whole\n * period per period width it crosses. A pan begins afresh as a second finger\n * lands, and what it had travelled short of a period is forgotten as it ends.\n *\n * @param pan - The pan's running state (mutated)\n * @param periodPx - One period's width in px, as the list stands\n * @param onPan - Told the whole periods to pan by: positive, later in time\n * @returns The gestures' host, for the list's surface\n */\nexport function twoFingerPan(pan: TwoFingerPan, periodPx: () => number, onPan: (periods: number) => void): GestureHost<unknown> {\n    const nothing = (): void => undefined;\n    return {\n        press: nothing,\n        drag: nothing,\n        release: nothing,\n        drop: nothing,\n        pinchStart: () => { pan.travel = 0; },\n        pinch: (step) => {\n            const moved = panPeriods(pan.travel, step.to.x - step.from.x, periodPx());\n            pan.travel = moved.travel;\n            if (moved.periods !== 0) onPan(moved.periods);\n        },\n        pinchEnd: () => { pan.travel = 0; },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The warn ring of an event in an overlap pair (#1198, `Plan Builder Spec.md`\n * §8, PB51): the frame reads the pairs from its event kinds and hands the\n * canvas the keys of the events in one, and each element of an event — a\n * bar, a tile, a chip, a mark — asks whether its event is among them. The\n * recipe draws the ring (`data-overlap`).\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext } from \"react\";\n\n/** No event in a pair: a Plan without event kinds, or none of whose events overlap. */\nconst NONE: ReadonlySet<string> = new Set();\n\n/** The events in an overlap pair, by their elements' keys — none outside a Plan of event kinds. */\nexport const PlanOverlapsContext = createContext<ReadonlySet<string>>(NONE);\n\n/**\n * Whether an element's event is in an overlap pair: the element wears the warn ring.\n *\n * @param key - The element's key\n * @returns Whether its event overlaps another\n */\nexport function usePlanElementOverlap(key: string): boolean {\n    return useContext(PlanOverlapsContext).has(key);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The look of an event its drafts changed (#1196, `Plan Builder Spec.md` §8):\n * the canvas hands its elements the keys of every event a kind's drafts hold\n * otherwise than its record does, and each element of an event — a bar, a\n * chip, a mark — asks whether its event is among them. The recipe draws the\n * brand tint in a brand border (`data-draft`, `planElementDrafted`), in both\n * themes.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext } from \"react\";\n\n/** No event drafted: a Plan without event kinds, or none of whose events a draft changed. */\nconst NONE: ReadonlySet<string> = new Set();\n\n/** The events a draft changed, by their elements' keys — none outside a Plan of event kinds. */\nexport const PlanDraftedContext = createContext<ReadonlySet<string>>(NONE);\n\n/** The events holding a conflict not yet chosen, by their elements' keys — the warn ring's; none outside a Plan of event kinds. */\nexport const PlanConflictedContext = createContext<ReadonlySet<string>>(NONE);\n\n/**\n * The events whose rows break their kind's bounds (#1585), stored or changed, by their elements' keys — the warn ring's,\n * as a conflict's; none outside a Plan of event kinds.\n */\nexport const PlanBoundedContext = createContext<ReadonlySet<string>>(NONE);\n\n/** No table cell holding a conflict. */\nconst NO_CELLS: ReadonlyMap<string, readonly Date[]> = new Map();\n/** None of a row's cells holding a conflict. */\nconst NO_INSTANTS: readonly Date[] = [];\n\n/**\n * The table cells holding a conflict not yet chosen (#1438), by their rows' keys: the instants each row's conflicts are\n * at — a crew's week — whose cells wear the warn ring; none outside a Plan whose rows a session drafts.\n */\nexport const PlanConflictCellsContext = createContext<ReadonlyMap<string, readonly Date[]>>(NO_CELLS);\n\n/**\n * The instants a row's cells hold a conflict at, not yet chosen.\n *\n * @param rowKey - The row's key\n * @returns Its conflicts' instants; none for a row with none\n */\nexport function usePlanRowConflicts(rowKey: string): readonly Date[] {\n    return useContext(PlanConflictCellsContext).get(rowKey) ?? NO_INSTANTS;\n}\n\n/**\n * Whether an element's event holds a conflict not yet chosen: the element\n * wears the warn ring (the conflicts design's canvas marks).\n *\n * @param key - The element's key\n * @returns Whether its event holds one\n */\nexport function usePlanElementConflicted(key: string): boolean {\n    return useContext(PlanConflictedContext).has(key);\n}\n\n/**\n * Whether an element's event's row breaks its kind's bounds: the element wears the warn ring, as a conflict's does.\n *\n * @param key - The element's key\n * @returns Whether its row breaks one\n */\nexport function usePlanElementBounded(key: string): boolean {\n    return useContext(PlanBoundedContext).has(key);\n}\n\n/**\n * Whether an element's event is drafted: the element wears the drafted look.\n *\n * @param key - The element's key\n * @returns Whether a draft changed its event\n */\nexport function usePlanElementDrafted(key: string): boolean {\n    return useContext(PlanDraftedContext).has(key);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a run of the app's optimiser left on the canvas's elements (#1409,\n * #1419; `Optimise Spec.md` §8, §9.5, R15–R17): the canvas hands its elements\n * the operation on each event the runs changed, by the element's key — a bar\n * added, a bar changed — and each row the ghosts of what stood on it before a\n * run: an event the run removed, struck through where it stood, or moved,\n * dashed where it was. An element asks for its own, as it asks whether its\n * event is drafted (`element-draft.ts`); a row asks for its ghosts, drawn\n * while the highlight is on. The `optimise` recipe draws both from the\n * attributes they set (`data-op`, `data-fill`).\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext } from \"react\";\nimport type { PlanInstantValue } from \"../instant.js\";\n\n/** One operation a run left on an event, as its element draws and says it. */\nexport interface PlanElementOp {\n    /** The event was added to the canvas, or changed on it. */\n    readonly op: \"add\" | \"chg\";\n    /** The run's number, formatted. */\n    readonly run: string;\n    /** What the element says on hover: `Added by Elara · run #7`, `Was Mon 09:00–17:00 · Press A1 · Elara run #7`. */\n    readonly provenance: string;\n}\n\n/** A ghost a run left on a row (R15): where an event it removed or moved stood before it. */\nexport interface PlanGhost {\n    /** The element's key: its event's ref, as East prints it. */\n    readonly key: string;\n    /** Removed, struck through; or moved, dashed where it was. */\n    readonly op: \"del\" | \"from\";\n    /** The run's number, formatted. */\n    readonly run: string;\n    /** Where it stood: its extent on the axis — one instant twice for a tile or a mark. */\n    readonly start: PlanInstantValue;\n    readonly end: PlanInstantValue;\n    /** What it said. */\n    readonly label: string;\n    /** How the row drew it: a bar or a chip spans; a tile or a mark is an instant. */\n    readonly shape: \"span\" | \"instant\";\n}\n\n/** What the runs left, as the canvas hands it to its rows and elements. */\nexport interface PlanOptimisedMarks {\n    /** Each operation, by the element's key. */\n    readonly ops: ReadonlyMap<string, PlanElementOp>;\n    /** Each row's ghosts, by the row's key. */\n    readonly ghosts: ReadonlyMap<string, readonly PlanGhost[]>;\n    /** Whether the highlight is on (R16): the ghosts show for it alone. */\n    readonly lit: boolean;\n}\n\n/** No run has left anything. */\nconst NONE: PlanOptimisedMarks = { ops: new Map(), ghosts: new Map(), lit: false };\nconst NO_GHOSTS: readonly PlanGhost[] = [];\n\n/** What the runs left on the canvas — nothing outside a Plan whose optimiser has run. */\nexport const PlanOptimisedContext = createContext<PlanOptimisedMarks>(NONE);\n\n/**\n * The operation a run left on an element's event, if any: what its element\n * draws (`data-op`) and says on hover.\n *\n * @param key - The element's key\n * @returns The operation; `undefined` for an event no run changed\n */\nexport function usePlanElementOp(key: string): PlanElementOp | undefined {\n    return useContext(PlanOptimisedContext).ops.get(key);\n}\n\n/**\n * The ghosts a row draws while a run's highlight is on (R15): where the events\n * a run removed or moved stood on it.\n *\n * @param rowKey - The row's key\n * @returns Its ghosts; none outside the highlight\n */\nexport function usePlanRowGhosts(rowKey: string): readonly PlanGhost[] {\n    const marks = useContext(PlanOptimisedContext);\n    return marks.lit ? marks.ghosts.get(rowKey) ?? NO_GHOSTS : NO_GHOSTS;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Span rows (`Plan Spec.md` §4·K1) — continuous `[start, end)` state-run bars\n * on the shared scale, plus factory-computed rollup bands, decision diamonds\n * and quantity ports. The §4.3 run-state truth table maps `EventStateType` to\n * the recipe `bar` slot's `data-state` axis; `status: warning` adds the\n * `.stuck` warn ring; a run ending past the window keeps its true geometry and\n * mask-fades (`data-runoff`) — never a fabricated end. Popovers and hover cards\n * resolve through the root's generalized resolvers: the canvas's one overlay\n * layer opens them from a bar's `data-run` or a diamond's `data-mark` (#816),\n * and a labelled port's tooltip is its `aria-label`. Decision diamonds ride\n * the `mark` arm of the element ref.\n *\n * Every bar and diamond is a button whose name says what its look encodes —\n * label, span and state (`a11y.ts`, #819); a labelled port is an image named\n * by its label.\n *\n * On a row whose series declares a move's fields (#825) a bar moves: the\n * pointer drags it, or one of its two end handles, and Space picks it up for\n * the keyboard (`edit/`). An event kind's bar moves and resizes its event\n * (#1196), and wears the brand tint in a brand border while its drafts change\n * it (`data-draft`).\n */\n\nimport { useMemo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { usePlanDispatch, usePlanResolvers, usePlanScale, type PlanElementRefValue } from \"../context.js\";\nimport { decisionName, runName } from \"../a11y.js\";\nimport { quantityText } from \"../quantity.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { usePlanMovable } from \"../edit/movable.js\";\nimport type { PlanMovable } from \"../edit/store.js\";\nimport type { DerivedBand, PlanRowId } from \"../model.js\";\nimport { usePlanElementSelect } from \"./element-select.js\";\nimport { usePlanElementOverlap } from \"./element-overlap.js\";\nimport { usePlanElementBounded, usePlanElementConflicted, usePlanElementDrafted } from \"./element-draft.js\";\nimport { usePlanElementOp } from \"./element-optimise.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype SpanKindValue = Extract<ValueTypeOf<typeof Plan.Types.Row>[\"kind\"], { type: \"span\" }>[\"value\"];\ntype RunValue = ValueTypeOf<typeof Plan.Types.Run>;\n/** How a row's elements move (#825) — its `edits.move`. */\nexport type PlanRowMove = { items: string; resize: boolean };\n\n/** EventState → the recipe `data-state` key (the §4.3 truth table). */\nexport function runStateKey(state: RunValue[\"state\"]): \"obs\" | \"appr\" | \"prop\" | \"propRemoved\" | \"estimated\" | \"rejected\" {\n    switch (state.type) {\n        case \"actual\":\n        case \"in-progress\": return \"obs\";\n        case \"confirmed\": return \"appr\";\n        case \"proposed\": return state.value.type === \"removed\" ? \"propRemoved\" : \"prop\";\n        case \"estimated\": return \"estimated\";\n        case \"rejected\": return \"rejected\";\n    }\n}\n\n\n\nexport interface SpanRowProps {\n    /** R2 context strip (#591) — render this row's marks at strip size. */\n    ctx?: boolean | undefined;\n\n    rowKey: string;\n    /** The row's id — what an element click names the row by (#822). */\n    rowId: PlanRowId;\n    kind: SpanKindValue;\n    /** Renderer-derived rollup bands (the IR carries only the declaration). */\n    bands: readonly DerivedBand[];\n    styles: Styles;\n    /** How its runs move (#825) — `undefined` when they do not. */\n    move?: PlanRowMove | undefined;\n}\n\n/** One run bar — a button that moves, with its end handles, where its row takes moves (#825). */\nfunction RunBar({ run, left, width, runoff, rowKey, rowId, styles, ctx, move }: {\n    run: RunValue; left: number; width: number; runoff: boolean;\n    rowKey: string; rowId: PlanRowId; styles: Styles; ctx: boolean | undefined;\n    move: PlanRowMove | undefined;\n}) {\n    const scale = usePlanScale();\n    const words = usePlanWords();\n    const movable = useMemo<PlanMovable | undefined>(() => (move !== undefined\n        ? { rowKey, key: run.key, label: run.label, kind: \"run\", span: { start: run.start, end: run.end }, items: move.items, resize: move.resize }\n        : undefined), [move, rowKey, run]);\n    const { handle, edges, carried } = usePlanMovable(movable);\n    const stateKey = runStateKey(run.state);\n    const stuck = run.status.type === \"some\" && run.status.value.type === \"warning\";\n    // ONE quantity (#824): its caption is its text, else its value\n    // through its format, then its unit.\n    const qty = run.quantity.type === \"some\" ? quantityText(run.quantity.value, words) : undefined;\n    const moved = run.moved.type === \"some\" ? Number(run.moved.value) : undefined;\n    const ref = variant(\"run\", { row: rowId, run: run.key }) as PlanElementRefValue;\n    // An event's bar selects its event (#1197); any other bar, its row.\n    const select = usePlanElementSelect(rowKey, run.key, ref);\n    // An event in an overlap pair wears the warn ring (#1198).\n    const overlap = usePlanElementOverlap(run.key);\n    // An event its drafts changed wears the brand tint in a brand border (#1196).\n    const drafted = usePlanElementDrafted(run.key);\n    const conflict = usePlanElementConflicted(run.key);\n    // An event whose row breaks its kind's bounds wears the warn ring too, stored or changed (#1585).\n    const bounds = usePlanElementBounded(run.key);\n    // What a run of the optimiser did to its event (#1409, R17), while it is still the run's draft: the bar keeps\n    // its own fill and takes the ring and glow, and says so on hover.\n    const op = usePlanElementOp(run.key);\n    const optimised = drafted ? op : undefined;\n    return (\n        <Box\n            css={styles.bar}\n            data-ctx={ctx === true ? \"\" : undefined}\n            data-state={stateKey}\n            data-stuck={stuck ? \"\" : undefined}\n            data-overlap={overlap ? \"\" : undefined}\n            data-draft={drafted ? \"\" : undefined}\n            data-conflict={conflict ? \"\" : undefined}\n            data-bounds={bounds ? \"\" : undefined}\n            data-op={optimised?.op}\n            data-fill={optimised !== undefined ? \"own\" : undefined}\n            title={optimised?.provenance}\n            data-runoff={runoff ? \"\" : undefined}\n            data-run={run.key}\n            data-plan-frac={left.toFixed(4)}\n            // Focusable: Enter opens its popover (#816), and the\n            // row's Tab walk reaches it (#819).\n            tabIndex={-1}\n            role=\"button\"\n            aria-label={runName(run, scale, words)}\n            style={{ left: `${left * 100}%`, width: `${width * 100}%` }}\n            {...handle}\n            // Carried by the keyboard (#825) — dimmed as a dragged origin is.\n            data-dragging={carried ? \"\" : undefined}\n            data-selected={select.selected ? \"\" : undefined}\n            aria-pressed={select.selectable ? select.selected : undefined}\n            onClick={select.onClick}\n        >\n            {/* Its label (`data-plan-label`): hidden below a letter and the ellipsis, its hover saying it (#1264). */}\n            <Box as=\"span\" css={styles.barLabel} data-plan-label=\"\">{run.label}</Box>\n            {qty !== undefined && <Box as=\"span\" css={styles.barQty}>{qty}</Box>}\n            {moved !== undefined && moved > 0 && (\n                <Box as=\"span\" css={styles.barQty}>{words.m.moved({ n: moved, count: words.number(moved) })}</Box>\n            )}\n            {edges !== undefined && (\n                <>\n                    <Box css={styles.moveEdge} {...edges.start} />\n                    <Box css={styles.moveEdge} {...edges.end} />\n                </>\n            )}\n        </Box>\n    );\n}\n\n/** The span-row plot content — bars, rollup bands, diamonds, ports. */\nexport function SpanRow({ rowKey, rowId, kind, bands: rollBands, styles, ctx, move }: SpanRowProps) {\n    const ctxAttr = ctx === true ? \"\" : undefined;\n    const scale = usePlanScale();\n    const dispatch = usePlanDispatch();\n    const words = usePlanWords();\n    const { onElementClick } = usePlanResolvers();\n\n    const bars = useMemo(() => kind.runs.map((run) => {\n        const f0 = scale.fracOf(run.start);\n        // An interval END: half-open on a time / number axis, the far edge\n        // of the named bucket on an ordinal one (#631).\n        const f1 = scale.endFracOf(run.end);\n        // Cull against the RENDER bounds (#619 — the schematic's\n        // viewport-cull discipline, one axis): a run WHOLLY outside the\n        // window but inside the overscan mounts at its true geometry,\n        // clipped at rest, so a brush-slide pan reveals it. A run TOUCHING\n        // the window keeps its window-clamped form — its label pins to the\n        // window edge and the runoff mask's proportions ride the clamp, so\n        // the at-rest render is bit-identical to before.\n        if (f1 <= scale.renderMin || f0 >= scale.renderMax) return null;\n        const outside = f1 <= 0 || f0 >= 1;\n        const left = outside ? f0 : Math.max(0, f0);\n        const right = outside ? f1 : Math.min(1, f1);\n        if (!Number.isFinite(f0) || !Number.isFinite(f1)) return null;\n        return { run, left, width: Math.max(0, right - left), runoff: !outside && f1 > 1 };\n    }).filter((b): b is NonNullable<typeof b> => b !== null), [kind.runs, scale]);\n\n    return (\n        <>\n            {bars.map(({ run, left, width, runoff }) => (\n                <RunBar key={run.key} run={run} left={left} width={width} runoff={runoff}\n                    rowKey={rowKey} rowId={rowId} styles={styles} ctx={ctx} move={move} />\n            ))}\n            {rollBands.map((band, i) => {\n                const f0 = scale.fracOf(band.from);\n                const f1 = scale.endFracOf(band.to);\n                if (f1 <= 0 || f0 >= 1) return null;\n                const left = Math.max(0, f0);\n                const width = Math.max(0, Math.min(1, f1) - left);\n                // The band rolls up this row's own subtree, which rides whole\n                // in one entry — exact on a paged canvas too (#822).\n                const caption = words.m.rollupCaption({\n                    count: band.count > 1 ? words.number(band.count) : undefined,\n                    quantity: band.quantity,\n                });\n                return (\n                    <Box key={`band-${i}`} css={styles.rollBand} data-state={runStateKey(band.state)} data-ctx={ctxAttr}\n                        data-plan-band=\"\" style={{ left: `${left * 100}%`, width: `${width * 100}%` }}>\n                        {/* Ellipsized, or hidden below a letter and the ellipsis, its hover saying it (#1264). */}\n                        <Box as=\"span\" css={styles.rollBandLabel} data-plan-label=\"\">{caption}</Box>\n                    </Box>\n                );\n            })}\n            {kind.ports.map((port, i) => {\n                const x = scale.fracOf(port.at);\n                // Point marks cull to the render bounds (#619) — overscan\n                // ports sit clipped at rest and slide in on a brush pan.\n                if (x <= scale.renderMin || x >= scale.renderMax) return null;\n                const label = port.label.type === \"some\" ? port.label.value : undefined;\n                if (label === undefined) return <Box key={`port-${i}`} css={styles.port} style={{ left: `${x * 100}%` }} />;\n                // The label is the port's accessible name, and the canvas's\n                // one tooltip shows it on hover (#816) — the design-system\n                // tooltip, never the native `title=` (#617).\n                return <Box key={`port-${i}`} css={styles.port} style={{ left: `${x * 100}%` }} data-port={i}\n                    role=\"img\" aria-label={label} />;\n            })}\n            {kind.decisions.map((dec) => {\n                const x = scale.fracOf(dec.at);\n                if (x <= scale.renderMin || x >= scale.renderMax) return null;\n                const ref = variant(\"mark\", { row: rowId, mark: dec.key }) as PlanElementRefValue;\n                return (\n                    <Box key={dec.key} css={styles.diamond} data-applied={dec.applied ? \"\" : undefined} data-ctx={ctxAttr}\n                        data-mark={dec.key} data-plan-frac={x.toFixed(4)} style={{ left: `${x * 100}%` }} tabIndex={-1}\n                        role=\"button\" aria-label={decisionName(dec, scale, words)}\n                        // Selects its row like every other element — Enter on\n                        // it does the same (#819).\n                        onClick={(e) => {\n                            e.stopPropagation();\n                            dispatch({ t: \"row.select\", key: rowKey });\n                            onElementClick?.(ref);\n                        }} cursor=\"pointer\" />\n                );\n            })}\n        </>\n    );\n}\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","var pi = Math.PI,\n    tau = 2 * pi,\n    epsilon = 1e-6,\n    tauEpsilon = tau - epsilon;\n\nfunction Path() {\n  this._x0 = this._y0 = // start of current subpath\n  this._x1 = this._y1 = null; // end of current subpath\n  this._ = \"\";\n}\n\nfunction path() {\n  return new Path;\n}\n\nPath.prototype = path.prototype = {\n  constructor: Path,\n  moveTo: function(x, y) {\n    this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n  },\n  closePath: function() {\n    if (this._x1 !== null) {\n      this._x1 = this._x0, this._y1 = this._y0;\n      this._ += \"Z\";\n    }\n  },\n  lineTo: function(x, y) {\n    this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n  },\n  quadraticCurveTo: function(x1, y1, x, y) {\n    this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n  },\n  bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n    this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n  },\n  arcTo: function(x1, y1, x2, y2, r) {\n    x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n    var x0 = this._x1,\n        y0 = this._y1,\n        x21 = x2 - x1,\n        y21 = y2 - y1,\n        x01 = x0 - x1,\n        y01 = y0 - y1,\n        l01_2 = x01 * x01 + y01 * y01;\n\n    // Is the radius negative? Error.\n    if (r < 0) throw new Error(\"negative radius: \" + r);\n\n    // Is this path empty? Move to (x1,y1).\n    if (this._x1 === null) {\n      this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n    }\n\n    // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n    else if (!(l01_2 > epsilon));\n\n    // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n    // Equivalently, is (x1,y1) coincident with (x2,y2)?\n    // Or, is the radius zero? Line to (x1,y1).\n    else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n      this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n    }\n\n    // Otherwise, draw an arc!\n    else {\n      var x20 = x2 - x0,\n          y20 = y2 - y0,\n          l21_2 = x21 * x21 + y21 * y21,\n          l20_2 = x20 * x20 + y20 * y20,\n          l21 = Math.sqrt(l21_2),\n          l01 = Math.sqrt(l01_2),\n          l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n          t01 = l / l01,\n          t21 = l / l21;\n\n      // If the start tangent is not coincident with (x0,y0), line to.\n      if (Math.abs(t01 - 1) > epsilon) {\n        this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n      }\n\n      this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n    }\n  },\n  arc: function(x, y, r, a0, a1, ccw) {\n    x = +x, y = +y, r = +r, ccw = !!ccw;\n    var dx = r * Math.cos(a0),\n        dy = r * Math.sin(a0),\n        x0 = x + dx,\n        y0 = y + dy,\n        cw = 1 ^ ccw,\n        da = ccw ? a0 - a1 : a1 - a0;\n\n    // Is the radius negative? Error.\n    if (r < 0) throw new Error(\"negative radius: \" + r);\n\n    // Is this path empty? Move to (x0,y0).\n    if (this._x1 === null) {\n      this._ += \"M\" + x0 + \",\" + y0;\n    }\n\n    // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n    else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n      this._ += \"L\" + x0 + \",\" + y0;\n    }\n\n    // Is this arc empty? We’re done.\n    if (!r) return;\n\n    // Does the angle go the wrong way? Flip the direction.\n    if (da < 0) da = da % tau + tau;\n\n    // Is this a complete circle? Draw two arcs to complete the circle.\n    if (da > tauEpsilon) {\n      this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n    }\n\n    // Is this arc non-empty? Draw an arc!\n    else if (da > epsilon) {\n      this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n    }\n  },\n  rect: function(x, y, w, h) {\n    this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n  },\n  toString: function() {\n    return this._;\n  }\n};\n\nexport default path;\n","export default function(x) {\n  return function constant() {\n    return x;\n  };\n}\n","function Linear(context) {\n  this._context = context;\n}\n\nLinear.prototype = {\n  areaStart: function() {\n    this._line = 0;\n  },\n  areaEnd: function() {\n    this._line = NaN;\n  },\n  lineStart: function() {\n    this._point = 0;\n  },\n  lineEnd: function() {\n    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n    this._line = 1 - this._line;\n  },\n  point: function(x, y) {\n    x = +x, y = +y;\n    switch (this._point) {\n      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n      case 1: this._point = 2; // proceed\n      default: this._context.lineTo(x, y); break;\n    }\n  }\n};\n\nexport default function(context) {\n  return new Linear(context);\n}\n","export function x(p) {\n  return p[0];\n}\n\nexport function y(p) {\n  return p[1];\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n  var x = pointX,\n      y = pointY,\n      defined = constant(true),\n      context = null,\n      curve = curveLinear,\n      output = null;\n\n  function line(data) {\n    var i,\n        n = data.length,\n        d,\n        defined0 = false,\n        buffer;\n\n    if (context == null) output = curve(buffer = path());\n\n    for (i = 0; i <= n; ++i) {\n      if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n        if (defined0 = !defined0) output.lineStart();\n        else output.lineEnd();\n      }\n      if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n    }\n\n    if (buffer) return output = null, buffer + \"\" || null;\n  }\n\n  line.x = function(_) {\n    return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n  };\n\n  line.y = function(_) {\n    return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n  };\n\n  line.defined = function(_) {\n    return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n  };\n\n  line.curve = function(_) {\n    return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n  };\n\n  line.context = function(_) {\n    return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n  };\n\n  return line;\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n  var x0 = pointX,\n      x1 = null,\n      y0 = constant(0),\n      y1 = pointY,\n      defined = constant(true),\n      context = null,\n      curve = curveLinear,\n      output = null;\n\n  function area(data) {\n    var i,\n        j,\n        k,\n        n = data.length,\n        d,\n        defined0 = false,\n        buffer,\n        x0z = new Array(n),\n        y0z = new Array(n);\n\n    if (context == null) output = curve(buffer = path());\n\n    for (i = 0; i <= n; ++i) {\n      if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n        if (defined0 = !defined0) {\n          j = i;\n          output.areaStart();\n          output.lineStart();\n        } else {\n          output.lineEnd();\n          output.lineStart();\n          for (k = i - 1; k >= j; --k) {\n            output.point(x0z[k], y0z[k]);\n          }\n          output.lineEnd();\n          output.areaEnd();\n        }\n      }\n      if (defined0) {\n        x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n        output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n      }\n    }\n\n    if (buffer) return output = null, buffer + \"\" || null;\n  }\n\n  function arealine() {\n    return line().defined(defined).curve(curve).context(context);\n  }\n\n  area.x = function(_) {\n    return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n  };\n\n  area.x0 = function(_) {\n    return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n  };\n\n  area.x1 = function(_) {\n    return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n  };\n\n  area.y = function(_) {\n    return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n  };\n\n  area.y0 = function(_) {\n    return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n  };\n\n  area.y1 = function(_) {\n    return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n  };\n\n  area.lineX0 =\n  area.lineY0 = function() {\n    return arealine().x(x0).y(y0);\n  };\n\n  area.lineY1 = function() {\n    return arealine().x(x0).y(y1);\n  };\n\n  area.lineX1 = function() {\n    return arealine().x(x1).y(y0);\n  };\n\n  area.defined = function(_) {\n    return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n  };\n\n  area.curve = function(_) {\n    return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n  };\n\n  area.context = function(_) {\n    return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n  };\n\n  return area;\n}\n","/**\n * This is a workaround for TypeScript not inferring the correct\n * method overload/signature for some d3 shape methods.\n */\nexport default function setNumberOrNumberAccessor(func, value) {\n  if (typeof value === 'number') func(value);else func(value);\n}","import { arc as d3Arc, area as d3Area, line as d3Line, pie as d3Pie, radialLine as d3RadialLine, stack as d3Stack } from 'd3-shape';\nimport setNumberOrNumberAccessor from './setNumberOrNumberAccessor';\nimport stackOrder from './stackOrder';\nimport stackOffset from './stackOffset';\nexport function arc(_temp) {\n  var _ref = _temp === void 0 ? {} : _temp,\n    innerRadius = _ref.innerRadius,\n    outerRadius = _ref.outerRadius,\n    cornerRadius = _ref.cornerRadius,\n    startAngle = _ref.startAngle,\n    endAngle = _ref.endAngle,\n    padAngle = _ref.padAngle,\n    padRadius = _ref.padRadius;\n  var path = d3Arc();\n  if (innerRadius != null) setNumberOrNumberAccessor(path.innerRadius, innerRadius);\n  if (outerRadius != null) setNumberOrNumberAccessor(path.outerRadius, outerRadius);\n  if (cornerRadius != null) setNumberOrNumberAccessor(path.cornerRadius, cornerRadius);\n  if (startAngle != null) setNumberOrNumberAccessor(path.startAngle, startAngle);\n  if (endAngle != null) setNumberOrNumberAccessor(path.endAngle, endAngle);\n  if (padAngle != null) setNumberOrNumberAccessor(path.padAngle, padAngle);\n  if (padRadius != null) setNumberOrNumberAccessor(path.padRadius, padRadius);\n  return path;\n}\nexport function area(_temp2) {\n  var _ref2 = _temp2 === void 0 ? {} : _temp2,\n    x = _ref2.x,\n    x0 = _ref2.x0,\n    x1 = _ref2.x1,\n    y = _ref2.y,\n    y0 = _ref2.y0,\n    y1 = _ref2.y1,\n    defined = _ref2.defined,\n    curve = _ref2.curve;\n  var path = d3Area();\n  if (x) setNumberOrNumberAccessor(path.x, x);\n  if (x0) setNumberOrNumberAccessor(path.x0, x0);\n  if (x1) setNumberOrNumberAccessor(path.x1, x1);\n  if (y) setNumberOrNumberAccessor(path.y, y);\n  if (y0) setNumberOrNumberAccessor(path.y0, y0);\n  if (y1) setNumberOrNumberAccessor(path.y1, y1);\n  if (defined) path.defined(defined);\n  if (curve) path.curve(curve);\n  return path;\n}\nexport function line(_temp3) {\n  var _ref3 = _temp3 === void 0 ? {} : _temp3,\n    x = _ref3.x,\n    y = _ref3.y,\n    defined = _ref3.defined,\n    curve = _ref3.curve;\n  var path = d3Line();\n  if (x) setNumberOrNumberAccessor(path.x, x);\n  if (y) setNumberOrNumberAccessor(path.y, y);\n  if (defined) path.defined(defined);\n  if (curve) path.curve(curve);\n  return path;\n}\nexport function pie(_temp4) {\n  var _ref4 = _temp4 === void 0 ? {} : _temp4,\n    startAngle = _ref4.startAngle,\n    endAngle = _ref4.endAngle,\n    padAngle = _ref4.padAngle,\n    value = _ref4.value,\n    sort = _ref4.sort,\n    sortValues = _ref4.sortValues;\n  var path = d3Pie();\n\n  // ts can't distinguish between these method overloads\n  if (sort === null) path.sort(sort);else if (sort != null) path.sort(sort);\n  if (sortValues === null) path.sortValues(sortValues);else if (sortValues != null) path.sortValues(sortValues);\n  if (value != null) path.value(value);\n  if (padAngle != null) setNumberOrNumberAccessor(path.padAngle, padAngle);\n  if (startAngle != null) setNumberOrNumberAccessor(path.startAngle, startAngle);\n  if (endAngle != null) setNumberOrNumberAccessor(path.endAngle, endAngle);\n  return path;\n}\nexport function radialLine(_temp5) {\n  var _ref5 = _temp5 === void 0 ? {} : _temp5,\n    angle = _ref5.angle,\n    radius = _ref5.radius,\n    defined = _ref5.defined,\n    curve = _ref5.curve;\n  var path = d3RadialLine();\n  if (angle) setNumberOrNumberAccessor(path.angle, angle);\n  if (radius) setNumberOrNumberAccessor(path.radius, radius);\n  if (defined) path.defined(defined);\n  if (curve) path.curve(curve);\n  return path;\n}\nexport function stack(_ref6) {\n  var keys = _ref6.keys,\n    value = _ref6.value,\n    order = _ref6.order,\n    offset = _ref6.offset;\n  var path = d3Stack();\n  if (keys) path.keys(keys);\n  if (value) setNumberOrNumberAccessor(path.value, value);\n  if (order) path.order(stackOrder(order));\n  if (offset) path.offset(stackOffset(offset));\n  return path;\n}","var _excluded = [\"children\", \"data\", \"x\", \"y\", \"fill\", \"className\", \"curve\", \"innerRef\", \"defined\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport React from 'react';\nimport cx from 'classnames';\nimport { line } from '../util/D3ShapeFactories';\nexport default function LinePath(_ref) {\n  var children = _ref.children,\n    _ref$data = _ref.data,\n    data = _ref$data === void 0 ? [] : _ref$data,\n    x = _ref.x,\n    y = _ref.y,\n    _ref$fill = _ref.fill,\n    fill = _ref$fill === void 0 ? 'transparent' : _ref$fill,\n    className = _ref.className,\n    curve = _ref.curve,\n    innerRef = _ref.innerRef,\n    _ref$defined = _ref.defined,\n    defined = _ref$defined === void 0 ? function () {\n      return true;\n    } : _ref$defined,\n    restProps = _objectWithoutPropertiesLoose(_ref, _excluded);\n  var path = line({\n    x: x,\n    y: y,\n    defined: defined,\n    curve: curve\n  });\n  if (children) return /*#__PURE__*/React.createElement(React.Fragment, null, children({\n    path: path\n  }));\n  return /*#__PURE__*/React.createElement(\"path\", _extends({\n    ref: innerRef,\n    className: cx('visx-linepath', className),\n    d: path(data) || '',\n    fill: fill\n    // without this a datum surrounded by nulls will not be visible\n    // https://github.com/d3/d3-shape#line_defined\n    ,\n    strokeLinecap: \"round\"\n  }, restProps));\n}","var _excluded = [\"children\", \"x\", \"x0\", \"x1\", \"y\", \"y0\", \"y1\", \"data\", \"defined\", \"className\", \"curve\", \"innerRef\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport React from 'react';\nimport cx from 'classnames';\nimport { area } from '../util/D3ShapeFactories';\nexport default function Area(_ref) {\n  var children = _ref.children,\n    x = _ref.x,\n    x0 = _ref.x0,\n    x1 = _ref.x1,\n    y = _ref.y,\n    y0 = _ref.y0,\n    y1 = _ref.y1,\n    _ref$data = _ref.data,\n    data = _ref$data === void 0 ? [] : _ref$data,\n    _ref$defined = _ref.defined,\n    defined = _ref$defined === void 0 ? function () {\n      return true;\n    } : _ref$defined,\n    className = _ref.className,\n    curve = _ref.curve,\n    innerRef = _ref.innerRef,\n    restProps = _objectWithoutPropertiesLoose(_ref, _excluded);\n  var path = area({\n    x: x,\n    x0: x0,\n    x1: x1,\n    y: y,\n    y0: y0,\n    y1: y1,\n    defined: defined,\n    curve: curve\n  });\n  if (children) return /*#__PURE__*/React.createElement(React.Fragment, null, children({\n    path: path\n  }));\n  return /*#__PURE__*/React.createElement(\"path\", _extends({\n    ref: innerRef,\n    className: cx('visx-area', className),\n    d: path(data) || ''\n  }, restProps));\n}","var _excluded = [\"className\", \"innerRef\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport React from 'react';\nimport cx from 'classnames';\nexport default function Bar(_ref) {\n  var className = _ref.className,\n    innerRef = _ref.innerRef,\n    restProps = _objectWithoutPropertiesLoose(_ref, _excluded);\n  return /*#__PURE__*/React.createElement(\"rect\", _extends({\n    ref: innerRef,\n    className: cx('visx-bar', className)\n  }, restProps));\n}","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The R2 tone strip (#591) — what a **value-bearing** row collapses to.\n *\n * A row focus compresses its neighbours to 16px context strips. Rows whose\n * marks are *geometry* (span bars, cards chips, bucket tiles) simply shrink to\n * 7px and keep their positions. Rows whose marks are *values* cannot: a\n * numeral has no small form, and a 2px chart stroke is invisible at 7px. An\n * area silhouette does not rescue it either — squashed into 7px it fills solid\n * and carries no shape at all.\n *\n * Luminance is the only channel with resolution left at that height. So a\n * chart or table row re-encodes rather than resizes: one block per bucket,\n * depth tracking the value, negatives in the negative ink, no-data keeping the\n * 45° hatch, breaches in warn. That is precisely what a heat row already is —\n * which is the point. Three kinds collapse into one vocabulary the canvas\n * already speaks, instead of three new ones.\n *\n * Luminance is colour alone, so every block also carries its value as\n * visually hidden text (#819).\n *\n * @packageDocumentation\n */\n\nimport { Box, VisuallyHidden } from \"@chakra-ui/react\";\nimport { usePlanScale } from \"../context.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport { maxOf, minOf } from \"../reductions.js\";\nimport { cellName } from \"../a11y.js\";\nimport { usePlanWords, type PlanWords } from \"../words.js\";\nimport { heatLevel } from \"./HeatRow.js\";\n\n/** A tone block's value in words — the number, what its tone adds, or no data. */\nfunction toneWords(d: ToneDatum, w: PlanWords): string {\n    if (d.value === undefined) return w.m.noData();\n    return w.m.toneValue({ value: w.number(d.value), warn: d.tone === \"warn\" });\n}\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** One bucket's contribution to a tone strip. */\nexport interface ToneDatum {\n    /** The bucket instant. */\n    at: PlanInstantValue;\n    /** The raw value — `undefined` renders the no-data hatch. */\n    value: number | undefined;\n    /** An explicit semantic tone, overriding the derived depth. */\n    tone?: \"neg\" | \"warn\" | undefined;\n}\n\nexport interface ToneStripProps {\n    /** Per-bucket data, in any order (positioned by instant). */\n    data: readonly ToneDatum[];\n    styles: Styles;\n}\n\n/**\n * Render a per-bucket tone strip across the shared axis.\n *\n * @remarks\n * The depth ramp is normalised across THIS row's own values, like a heat row\n * with no declared scale — a strip says \"where in this row's range each bucket\n * sits\", not \"how this row compares to the one above\". Comparing rows is what\n * the full-height view is for.\n *\n * A row whose values are all equal (or has one bucket) has no range to\n * normalise against; every block takes the mid depth rather than collapsing to\n * invisible, so a flat row still reads as present rather than empty.\n *\n * @param props - The per-bucket data and the resolved recipe slots\n * @returns The positioned blocks\n */\nexport function ToneStrip({ data, styles }: ToneStripProps) {\n    const scale = usePlanScale();\n    const words = usePlanWords();\n    const nums = data.filter((d) => d.value !== undefined).map((d) => d.value as number);\n    const min = nums.length > 0 ? minOf(nums) : 0;\n    const max = nums.length > 0 ? maxOf(nums) : 0;\n    const span = max - min;\n    return (\n        <>\n            {data.map((d, i) => {\n                const bi = scale.bucketOf(d.at);\n                if (bi < 0) return null;\n                const b = scale.buckets[bi];\n                if (b === undefined) return null;\n                const nodata = d.value === undefined;\n                // 0.18 floor: a bucket at the bottom of the range is still a\n                // measured bucket, and washing it to nothing would read as\n                // no-data — which is a different fact with its own hatch.\n                const depth = nodata || span <= 0 ? 0.5 : 0.18 + 0.82 * ((d.value as number) - min) / span;\n                return (\n                    <Box\n                        key={i}\n                        css={styles.toneCell}\n                        data-tone={d.tone}\n                        data-nodata={nodata ? \"\" : undefined}\n                        // The heat row's own steps (#949) — the recipe paints them.\n                        data-level={d.tone === undefined && !nodata ? heatLevel(depth) : undefined}\n                        style={{ left: `calc(${b.x0 * 100}% + 1px)`, width: `calc(${(b.x1 - b.x0) * 100}% - 2px)` }}\n                    >\n                        <VisuallyHidden>{cellName(scale, b, toneWords(d, words), words)}</VisuallyHidden>\n                    </Box>\n                );\n            })}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Chart rows (`Plan Spec.md` §4·K3) — the Plan-native mark renderer. Layers\n * are FIRST-CLASS data (`{t, y}` points, consumed from the Chart builders by\n * the factory); the canvas draws every mark itself against the shared scale —\n * no embedded Chart component, no gutter negotiation:\n *\n * - lines draw solid ≤ now and dashed after (the now-split), and break at a\n *   gap (a non-finite `y`) instead of bridging it;\n * - columns render observed ink, planned brand at half strength, breach warn;\n *   stacked columns pair by `series` (s1 brand / s2 ink, planned half), each\n *   value axis stacking on its own, positive parts up and negative parts down;\n * - contiguous breach buckets derive the outlined warn rectangle at\n *   expanded density;\n * - refLines are dotted gridlines with a mono label; refBands paper washes;\n *   refDots ringed markers;\n * - left-axis ticks print inside the gutter cell's right edge (the shell's\n *   `gutterOverlay`), right-axis ticks at the plot's right edge — on the very\n *   scales the marks use;\n * - hovering a bucket reads out each data layer's value there.\n *\n * The marks are `@visx/shape` paths over `@visx/scale` value scales (#743),\n * from the numbers `chart-geometry.ts` derives. They render in a\n * `0..1000 × 0..H` viewBox stretched to the plot (`preserveAspectRatio=\"none\"`),\n * with `vector-effect: non-scaling-stroke` keeping stroke widths true. Every\n * mark sits at its TRUE position: a vertex beyond the window keeps its x and\n * the plot clips the segment — clamping it moved the data.\n *\n * A chart is a shape, so to a reader it is an image named by its summary —\n * each data layer's min, max and last value, and its breaches (#819).\n */\n\nimport { useCallback, useEffect, useMemo, useRef, type ReactNode } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { Area, Bar, LinePath } from \"@visx/shape\";\nimport { curveLinear } from \"@visx/curve\";\nimport { usePlanCursor, usePlanDispatch, usePlanScale } from \"../context.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport { chartSummary } from \"../a11y.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { ToneStrip, type ToneDatum } from \"./ToneStrip.js\";\nimport {\n    axisFormatter, axisTicks, breached, chartDomains, drawnPoints, layoutColumns, readoutLayers, readoutTable,\n    splitAtNow, valueScale,\n    type ChartBandPointValue, type ChartKindValue, type ChartPointValue, type ChartSide, type ColumnLayout,\n    type Placed, type ValueDomain, type ValueScale,\n} from \"./chart-geometry.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nconst VW = 1000;                       // viewBox width units\n\n/**\n * A stacked series' place in the chart palette (#949): series 1 is the brand\n * (`--brand-d`), and every comparison series takes the chart accents in their\n * fixed order — teal, purple, blue, orange — cycling past the fourth. The\n * `chartMarks` recipe slot paints each by this number; a mark carries no\n * colour of its own.\n */\nfunction paletteOf(seriesIndex: number): number {\n    return seriesIndex === 0 ? 0 : ((seriesIndex - 1) % 4) + 1;\n}\n\n/** A chart's layout on one scale — its columns and its value domains. */\ninterface ChartGeometry {\n    scale: PlanScale;\n    columns: ColumnLayout;\n    domains: { left: ValueDomain; right: ValueDomain };\n}\n\n/** One layout per chart row and scale, shared by its plot and its gutter\n *  ticks — so an axis can never label a scale the marks do not use. */\nconst geometryCache = new WeakMap<ChartKindValue, ChartGeometry>();\n\nfunction chartGeometry(kind: ChartKindValue, scale: PlanScale): ChartGeometry {\n    const hit = geometryCache.get(kind);\n    if (hit !== undefined && hit.scale === scale) return hit;\n    const columns = layoutColumns(kind.layers, scale);\n    const geometry = { scale, columns, domains: chartDomains(kind, columns) };\n    geometryCache.set(kind, geometry);\n    return geometry;\n}\n\n/** The chart's layout and its two value scales at a plot height. */\nfunction useChartScales(kind: ChartKindValue, height: number) {\n    const scale = usePlanScale();\n    const geometry = useMemo(() => chartGeometry(kind, scale), [kind, scale]);\n    const left = useMemo(() => valueScale(geometry.domains.left, height), [geometry, height]);\n    const right = useMemo(() => valueScale(geometry.domains.right, height), [geometry, height]);\n    return { scale, columns: geometry.columns, left, right };\n}\n\nconst x = (q: Placed<unknown>) => q.f * VW;\nconst hasY = (q: Placed<ChartPointValue>) => Number.isFinite(q.f) && Number.isFinite(q.p.y);\nconst hasBounds = (q: Placed<ChartBandPointValue>) => Number.isFinite(q.f) && Number.isFinite(q.p.lo) && Number.isFinite(q.p.hi);\n\nexport interface ChartRowPlotProps {\n    kind: ChartKindValue;\n    styles: Styles;\n    /** The rendered plot height (spark 32 / expanded 88 / fixed px). */\n    height: number;\n    /** Expanded density (breach rectangles render only here). */\n    expanded: boolean;\n    /** R2 context strip (#591) — re-encode as a tone strip; see {@link ToneStrip}. */\n    ctx?: boolean | undefined;\n    rowKey: string;\n}\n\n/** The chart-row plot content (SVG marks + HTML tick/ref labels + the readout). */\nexport function ChartRowPlot({ kind, styles, height, expanded, rowKey, ctx }: ChartRowPlotProps) {\n    const dispatch = usePlanDispatch();\n    const words = usePlanWords();\n    const { scale, columns, left: leftScale, right: rightScale } = useChartScales(kind, height);\n    const ys = (side: ChartSide): ValueScale => (side === \"right\" ? rightScale : leftScale);\n\n    // ── R2 (#591): a chart mark is a VALUE, not a geometry ──\n    // A 2px stroke is invisible at 7px, and an area silhouette squashed into\n    // 7px fills solid and carries no shape at all. Luminance is the only\n    // channel left with resolution, so the row re-encodes into the tone strip\n    // a heat row already is. The FIRST point-bearing layer is the subject: it\n    // is the row's primary measure by construction (annotations — refLine /\n    // refBand / refDot — carry no series and are skipped). A gap is no data.\n    const stripData = useMemo<ToneDatum[] | undefined>(() => {\n        if (ctx !== true) return undefined;\n        for (const layer of kind.layers) {\n            if (layer.type === \"refLine\" || layer.type === \"refBand\" || layer.type === \"refDot\") continue;\n            if (layer.type === \"band\") {\n                return layer.value.points.map((p) => ({\n                    at: p.t,\n                    value: Number.isFinite(p.lo) && Number.isFinite(p.hi) ? (p.lo + p.hi) / 2 : undefined,\n                }));\n            }\n            const breach = layer.type === \"line\" || layer.type === \"column\"\n                ? (layer.value.breach.type === \"some\" ? layer.value.breach.value : undefined)\n                : undefined;\n            return layer.value.points.map((p) => ({\n                at: p.t,\n                value: Number.isFinite(p.y) ? p.y : undefined,\n                // A breached bucket is the one fact worth keeping legible when\n                // the numbers are gone — it survives as a warn block.\n                tone: breached(p.y, breach) ? \"warn\" as const : undefined,\n            }));\n        }\n        return [];\n    }, [ctx, kind.layers]);\n\n    // Contiguous breach buckets → the outlined warn rectangle (expanded only).\n    const breachRects = useMemo(() => {\n        if (!expanded) return [];\n        const buckets = new Map<number, { x0: number; x1: number }>();\n        for (const layer of kind.layers) {\n            if (layer.type !== \"line\" && layer.type !== \"column\") continue;\n            const b = layer.value.breach;\n            if (b.type !== \"some\") continue;\n            for (const p of layer.value.points) {\n                if (!breached(p.y, b.value)) continue;\n                const bucket = scale.renderBucketOf(p.t);\n                if (bucket !== undefined) buckets.set(bucket.index, { x0: bucket.x0, x1: bucket.x1 });\n            }\n        }\n        const rects: { x0: number; x1: number }[] = [];\n        for (const [, b] of [...buckets.entries()].sort((a, c) => a[0] - c[0])) {\n            const last = rects[rects.length - 1];\n            if (last !== undefined && Math.abs(last.x1 - b.x0) < 1e-9) last.x1 = b.x1;\n            else rects.push({ x0: b.x0, x1: b.x1 });\n        }\n        return rects;\n    }, [kind.layers, scale, expanded]);\n\n    // ── The crosshair readout (#743) ──\n    // Each data layer's value at the hovered bucket, written straight into\n    // the DOM from the cursor channel — a hover renders nothing (#609).\n    const readLayers = useMemo(() => readoutLayers(kind), [kind]);\n    const readings = useMemo(() => readoutTable(kind, scale, words), [kind, scale, words]);\n    const readoutRef = useRef<HTMLDivElement | null>(null);\n    const cursor = usePlanCursor();\n    const showReading = useCallback((bucket: number) => {\n        const el = readoutRef.current;\n        if (el === null) return;\n        const values = readings.get(bucket);\n        const b = scale.buckets[bucket];\n        if (values === undefined || b === undefined) {\n            el.removeAttribute(\"data-open\");\n            return;\n        }\n        el.querySelectorAll<HTMLElement>(\"[data-plan-readout-value]\").forEach((span, i) => {\n            span.textContent = values[i] ?? \"—\";\n        });\n        // Beside the bucket, on the side with room.\n        const onRight = b.x0 + b.x1 > 1;\n        el.style.left = `${(onRight ? b.x0 : b.x1) * 100}%`;\n        el.style.transform = onRight ? \"translateX(calc(-100% - 4px))\" : \"translateX(4px)\";\n        el.setAttribute(\"data-open\", \"\");\n    }, [readings, scale]);\n    useEffect(() => cursor.subscribe(showReading), [cursor, showReading]);\n\n    // The chart's words (#819) — a strip says its values block by block instead.\n    const summary = useMemo(() => (ctx === true ? \"\" : chartSummary(kind, scale, words)), [ctx, kind, scale, words]);\n    // The right axis's ticks, by its format in the canvas's locale (#820).\n    const right = kind.right.type === \"some\" ? kind.right.value : undefined;\n    const rightFormat = useMemo(() => axisFormatter(right, words.locale), [right, words]);\n\n    // Branch HERE, after every hook: the hooks above must run on every\n    // render, or React sees a different hook order for a focused canvas than\n    // an unfocused one.\n    if (stripData !== undefined) return <ToneStrip data={stripData} styles={styles} />;\n\n    const svgMarks: ReactNode[] = [];\n    kind.layers.forEach((layer, li) => {\n        switch (layer.type) {\n            case \"band\": {\n                const s = ys(layer.value.axis.type);\n                const placed = drawnPoints(layer.value.points, scale);\n                if (placed.length === 0) return;\n                svgMarks.push(\n                    <Area<Placed<ChartBandPointValue>> key={`band-${li}`} data={placed} x={x}\n                        y0={(q) => s(q.p.lo)} y1={(q) => s(q.p.hi)} defined={hasBounds} curve={curveLinear}\n                        data-plan-mark=\"band\" />,\n                );\n                return;\n            }\n            case \"area\": {\n                const s = ys(layer.value.axis.type);\n                const placed = drawnPoints(layer.value.points, scale);\n                if (placed.length === 0) return;\n                // The fill runs to 0 — or to the domain's nearer edge when a\n                // declared domain leaves 0 outside it.\n                const [min, max] = s.domain() as [number, number];\n                const base = s(Math.min(Math.max(0, min), max));\n                const y = (q: Placed<ChartPointValue>) => s(q.p.y);\n                svgMarks.push(\n                    <Area<Placed<ChartPointValue>> key={`area-${li}`} data={placed} x={x} y0={base} y1={y}\n                        defined={hasY} curve={curveLinear} data-plan-mark=\"area\" />,\n                    <LinePath<Placed<ChartPointValue>> key={`arealine-${li}`} data={placed} x={x} y={y}\n                        defined={hasY} curve={curveLinear}\n                        vectorEffect=\"non-scaling-stroke\" data-plan-mark=\"area-line\" />,\n                );\n                return;\n            }\n            case \"line\": {\n                const s = ys(layer.value.axis.type);\n                const placed = drawnPoints(layer.value.points, scale);\n                const { before, after } = splitAtNow(placed, scale.nowFrac);\n                const y = (q: Placed<ChartPointValue>) => s(q.p.y);\n                if (before.length > 0) {\n                    svgMarks.push(\n                        <LinePath<Placed<ChartPointValue>> key={`line-${li}-obs`} data={before} x={x} y={y}\n                            defined={hasY} curve={curveLinear}\n                            vectorEffect=\"non-scaling-stroke\" data-plan-mark=\"line\" />,\n                    );\n                }\n                if (after.length > 0) {\n                    svgMarks.push(\n                        <LinePath<Placed<ChartPointValue>> key={`line-${li}-plan`} data={after} x={x} y={y}\n                            defined={hasY} curve={curveLinear}\n                            vectorEffect=\"non-scaling-stroke\" data-plan-mark=\"line-planned\" />,\n                    );\n                }\n                const breach = layer.value.breach.type === \"some\" ? layer.value.breach.value : undefined;\n                if (breach !== undefined) {\n                    placed.forEach((q, pi) => {\n                        if (!breached(q.p.y, breach) || q.f <= scale.renderMin || q.f >= scale.renderMax) return;\n                        svgMarks.push(<circle key={`line-${li}-warn-${pi}`} cx={q.f * VW} cy={s(q.p.y)}\n                            r={2.5} data-plan-mark=\"breach\" />);\n                    });\n                }\n                return;\n            }\n            case \"scatter\": {\n                const s = ys(layer.value.axis.type);\n                layer.value.points.forEach((p, pi) => {\n                    // Unclamped + render-bounds culled (#619): an out-of-window\n                    // dot sits at its true instant in the overscan, clipped at\n                    // rest — never piled on the window edge.\n                    const f = scale.fracOf(p.t);\n                    if (!Number.isFinite(p.y) || f <= scale.renderMin || f >= scale.renderMax) return;\n                    svgMarks.push(<circle key={`sc-${li}-${pi}`} cx={f * VW} cy={s(p.y)}\n                        r={2.5} data-plan-mark=\"scatter\" />);\n                });\n                return;\n            }\n            case \"column\": case \"refLine\": case \"refBand\": case \"refDot\":\n                return;\n        }\n    });\n\n    return (\n        <Box position=\"absolute\" inset={0} role=\"img\" aria-label={summary} data-plan-chart\n            onClick={() => dispatch({ t: \"row.select\", key: rowKey })}>\n            {/* refBand paper washes under everything — across the render\n                bounds, so a pan reveals the rest of the band */}\n            {kind.layers.map((layer, li) => {\n                if (layer.type !== \"refBand\") return null;\n                const f0 = Math.max(scale.renderMin, scale.fracOf(layer.value.from));\n                const f1 = Math.min(scale.renderMax, scale.endFracOf(layer.value.to));\n                if (!(f1 > f0)) return null;\n                const label = layer.value.label.type === \"some\" ? layer.value.label.value : undefined;\n                // The caption stays in view while the band does.\n                const labelF = f0 < 0 && f1 > 0 ? 0 : f0;\n                return (\n                    <Box key={`refband-${li}`}>\n                        <Box css={styles.chartRefBand} style={{ left: `${f0 * 100}%`, width: `${(f1 - f0) * 100}%` }}\n                            data-plan-mark=\"refband\"\n                            data-plan-frac={f0.toFixed(4)} data-plan-frac-end={f1.toFixed(4)} />\n                        {label !== undefined && <Box css={styles.refLabel} top=\"1px\" style={{ left: `${labelF * 100}%` }}>{label}</Box>}\n                    </Box>\n                );\n            })}\n            {/* Every mark's colour, stroke and dash is the `chartMarks`\n                recipe's, selected by the mark's own attributes (#949). */}\n            <chakra.svg css={styles.chartMarks} width=\"100%\" height=\"100%\" viewBox={`0 0 ${VW} ${height}`} preserveAspectRatio=\"none\">\n                <title>{summary}</title>\n                {columns.drawn.map((c, i) => {\n                    const s = ys(c.side);\n                    const yTop = s(c.hi);\n                    const yBase = s(c.lo);\n                    return <Bar key={`col-${i}`} x={c.x0 * VW} y={Math.min(yTop, yBase)}\n                        width={Math.max(1, (c.x1 - c.x0) * VW)} height={Math.max(0.5, Math.abs(yBase - yTop))}\n                        rx={1} data-plan-mark=\"column\" data-planned={c.planned ? \"\" : undefined}\n                        data-series={paletteOf(c.seriesIndex)} data-warn={c.warn ? \"\" : undefined} />;\n                })}\n                {kind.layers.map((layer, li) => layer.type === \"refLine\" ? (\n                    <line key={`ref-${li}`} x1={scale.renderMin * VW} x2={scale.renderMax * VW}\n                        y1={ys(layer.value.axis.type)(layer.value.y)} y2={ys(layer.value.axis.type)(layer.value.y)}\n                        vectorEffect=\"non-scaling-stroke\" data-plan-mark=\"refline\" />\n                ) : null)}\n                {svgMarks}\n                {kind.layers.map((layer, li) => {\n                    if (layer.type !== \"refDot\") return null;\n                    const f = scale.fracOf(layer.value.t);\n                    if (!(f > scale.renderMin && f < scale.renderMax)) return null;\n                    return <circle key={`refdot-${li}`} cx={f * VW} cy={ys(layer.value.axis.type)(layer.value.y)}\n                        r={3} vectorEffect=\"non-scaling-stroke\" data-plan-mark=\"refdot\" />;\n                })}\n                {breachRects.map((r, i) => (\n                    <rect key={`breach-${i}`} x={r.x0 * VW} y={1} width={(r.x1 - r.x0) * VW} height={height - 2}\n                        vectorEffect=\"non-scaling-stroke\" rx={2} data-plan-mark=\"breach-rect\" />\n                ))}\n            </chakra.svg>\n            {/* refLine / refDot mono labels (HTML, unstretched) — spark rows\n                are too shallow for them (the §1 mock shows bare ref rules);\n                taller charts clamp the label inside the plot box. */}\n            {height >= 48 && kind.layers.map((layer, li) => {\n                if (layer.type === \"refLine\" && layer.value.label.type === \"some\") {\n                    const top = Math.max(1, Math.min(height - 12, ys(layer.value.axis.type)(layer.value.y) - 11));\n                    return <Box key={`reflabel-${li}`} css={styles.refLabel} right=\"4px\"\n                        style={{ top: `${top}px` }}>{layer.value.label.value}</Box>;\n                }\n                if (layer.type === \"refDot\" && layer.value.label.type === \"some\") {\n                    const f = scale.fracOf(layer.value.t);\n                    if (!(f > scale.renderMin && f < scale.renderMax)) return null;\n                    const top = Math.max(1, Math.min(height - 12, ys(layer.value.axis.type)(layer.value.y) - 6));\n                    return <Box key={`refdotlabel-${li}`} css={styles.refLabel}\n                        style={{ left: `calc(${f * 100}% + 5px)`, top: `${top}px` }}>{layer.value.label.value}</Box>;\n                }\n                return null;\n            })}\n            {/* right-axis ticks at the plot's right edge */}\n            {right !== undefined && axisTicks(right).map((v, i) => (\n                <Box key={`rt-${i}`} css={styles.chartTickRight} style={{ top: `${(rightScale(v) / height) * 100}%` }}>\n                    {rightFormat(v)}\n                </Box>\n            ))}\n            {readLayers.length > 0 && (\n                <Box ref={readoutRef} css={styles.chartReadout} data-plan-readout>\n                    {readLayers.map((l, i) => (\n                        <Box key={i} as=\"span\" css={styles.chartReadoutValue} data-kind={l.kind} data-plan-readout-value={i} />\n                    ))}\n                </Box>\n            )}\n        </Box>\n    );\n}\n\n/** The gutter-edge left-axis ticks (mounted via the shell's `gutterOverlay`).\n *\n *  `height` is the PLOT's height — the band the marks scale against — and the\n *  ticks position in px against it. Not a percentage: they mount in the gutter\n *  CELL, which is the row's height, and a focus-expanded row's cell is taller\n *  than its band (#591) — a percentage of the cell landed the ticks in the\n *  render. At rest cell and band coincide, so nothing moves. The scale is the\n *  plot's own (#743): columns, stacks and baselines included.\n *\n *  An axis that declares no ticks still labels its top when the row draws\n *  columns on it (#949): a bar's height reads against its scale's max, and\n *  without one it cannot be read at all. This single automatic maximum stays\n *  beside the title at every row height. Only explicitly declared ticks\n *  position against the plot. */\nexport function ChartLeftTicks({ kind, styles, height }: { kind: ChartKindValue; styles: Styles; height: number }) {\n    const { left: s } = useChartScales(kind, height);\n    const words = usePlanWords();\n    const left = kind.left.type === \"some\" ? kind.left.value : undefined;\n    const fmt = useMemo(() => axisFormatter(left, words.locale), [left, words]);\n    const declared = axisTicks(left);\n    const columns = kind.layers.some((l) => l.type === \"column\" && l.value.axis.type === \"left\");\n    const ticks = declared.length > 0 ? declared : columns ? [(s.domain() as [number, number])[1]] : [];\n    if (ticks.length === 0) return null;\n    const compact = declared.length === 0;\n    // The axis labels the plot's scale for the eye; the plot's own name says\n    // its values (#819), so a reader skips these — they sit in the rowheader.\n    return (\n        <>\n            {ticks.map((v, i) => (\n                <Box key={i} css={styles.chartTickLeft} style={compact ? undefined : { top: `${s(v)}px` }}\n                    data-plan-tickpx={s(v)} data-compact={compact ? \"\" : undefined} aria-hidden=\"true\">\n                    {compact && left?.format.type !== \"some\" ? words.number(v) : fmt(v)}\n                </Box>\n            ))}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * How a bucket cell's tiles fit its room (#1267), as a docked pane's tab row\n * fits its tabs (`fitTabs`, #1210): decided from the tiles' widths as the cell\n * measured them, each drawn whole.\n *\n * Every tile that fits shows. A cell with more than one tile and too little\n * room shows the longest run of its tiles, in their order, that fits beside a\n * `+n` chip counting the rest; when none fits beside it, the chip alone counts\n * them all. A lone tile fits its cell as #1266 draws it, shrunk to the room.\n *\n * A cell with no room for one tile — less than the least a tile draws, its\n * padding given way — draws none of them: its chip alone counts them all,\n * across the cell, and lists every one (#1276). Nothing a cell holds goes\n * unseen.\n *\n * The tile the cell keeps — the selected one, the one whose popover is open,\n * or the one just picked from the chip's menu — never folds: it takes its\n * place first, shrunk to the room beside the chip when its whole width has\n * none there, as the Dock squeezes its open tab. A cell with no room beside\n * the chip even for a tile's floor shows the kept tile alone, and its chip\n * waits until the cell keeps none, so the tile is there to act on.\n *\n * @packageDocumentation\n */\n\n/** What a cell measured, with every tile drawn whole, in CSS px. */\nexport interface TileCellMeasure {\n    /** The room the tiles and the chip have: the width of the tiles' box. */\n    readonly room: number;\n    /** Each tile's width, drawn whole, in the cell's order. */\n    readonly tiles: readonly number[];\n    /** The gap between two tiles. */\n    readonly gap: number;\n    /** What the `+n` chip takes: its width and the gap before it. */\n    readonly more: number;\n    /** The narrowest a tile draws: its floor (#1266). */\n    readonly floor: number;\n    /** The narrowest a tile draws at all, its padding given way (#1276): less room than this holds no tile. */\n    readonly least: number;\n}\n\n/** Which of a cell's tiles show, by index in order; the rest fold into its chip. */\nexport interface TileCellFit {\n    /** The tiles that show, by index, in order. */\n    readonly shown: readonly number[];\n    /** How many fold — into the chip, or out of sight while a kept tile shows alone. */\n    readonly folded: number;\n    /** Whether the chip shows: tiles fold, and a kept tile left it the room. */\n    readonly chip: boolean;\n    /** Whether the cell has no room for one tile (#1276): every tile folds, and the chip is the cell's one part. */\n    readonly noRoom: boolean;\n}\n\n/** A width within a hundredth of a pixel of the room fits it: the measures are fractional, and summed. */\nconst SLACK = 0.01;\n\n/**\n * The tiles a bucket cell shows, and how many fold into its chip.\n *\n * @param measure - What the cell measured\n * @param kept - The index of the tile the cell keeps, see the module docs; it always shows\n * @returns The tiles that show, how many fold, and whether the chip shows\n */\nexport function fitTiles(measure: TileCellMeasure, kept: number | undefined): TileCellFit {\n    const count = measure.tiles.length;\n    const all = Array.from({ length: count }, (_, i) => i);\n    // No room for one tile, at the least it draws — or its whole width, were that less: the chip alone, kept tile or\n    // not, for a tile that cannot draw is no tile to act on.\n    if (count > 0 && measure.tiles.every((w) => Math.min(w, measure.least) > measure.room + SLACK)) {\n        return { shown: [], folded: count, chip: true, noRoom: true };\n    }\n    const across = measure.tiles.reduce((sum, w) => sum + w, 0) + measure.gap * Math.max(0, count - 1);\n    if (count <= 1 || across <= measure.room + SLACK) return { shown: all, folded: 0, chip: false, noRoom: false };\n    const keep = kept !== undefined && kept >= 0 && kept < count ? kept : undefined;\n    // The room beside the chip.\n    const room = measure.room - measure.more;\n    // No room there even for the kept tile's floor: it shows alone, and the chip waits.\n    if (keep !== undefined && Math.min(measure.tiles[keep]!, measure.floor) > room + SLACK) {\n        return { shown: [keep], folded: count - 1, chip: false, noRoom: false };\n    }\n    // The tiles beside the chip: the kept one first, then the run from the\n    // first while they fit — the first that doesn't fit folds, and every tile\n    // after it.\n    const shown: number[] = [];\n    let used = 0;\n    const take = (i: number) => {\n        used += (shown.length > 0 ? measure.gap : 0) + measure.tiles[i]!;\n        shown.push(i);\n    };\n    if (keep !== undefined) take(keep);\n    for (const i of all) {\n        if (i === keep) continue;\n        if (used + (shown.length > 0 ? measure.gap : 0) + measure.tiles[i]! > room + SLACK) break;\n        take(i);\n    }\n    return { shown: shown.sort((a, b) => a - b), folded: count - shown.length, chip: true, noRoom: false };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A bucket cell (#1267): its lane caption, its tiles and its marker — the\n * tiles folded to the room the caption leaves them, their own box's (#1266).\n * A cell with more than one tile shows the tiles that fit, in their order and\n * each drawn whole, then a `+n` chip that counts the rest: a button whose\n * anchored menu lists them by name. A pick selects the tile, as its click does\n * (#1197), and opens its popover where the root declares one (#816).\n *\n * The cell keeps a tile on its run — the selected one, the one whose popover\n * is open, or the one just picked — so the tile is there to act on, its ring\n * drawn and its popover anchored to it ({@link fitTiles}): shrunk to its floor\n * beside the chip if need be, or alone while the chip waits. A focused tile\n * that folds hands the focus to the chip.\n *\n * The fold is chosen before the browser paints, from widths the cell measured\n * with every tile drawn whole beside a stand-in chip, as a docked pane's tab\n * row folds its tabs (#1210): when the cell mounts, when its tiles change,\n * when fonts arrive, and when its room changes — taken in the ResizeObserver's\n * delivery, as the shared toolbar takes one, so no frame paints a fold the\n * cell does not rest on. While it measures again the chip keeps the last fold,\n * so an open menu stays open (#1235). A context strip's cell (R2) never folds.\n *\n * A cell with no room for one tile, its padding given way (#1276), draws none\n * of them: its chip alone, across the whole cell (`data-no-room`), lists every\n * tile, and a pick does what the tile's click does — its popover, the tile\n * having no box, hangs from the chip.\n *\n * The renderer sets data attributes and nothing else: `data-tile-measure` on\n * the tiles' box while it measures, `data-folded` on a folded tile,\n * `data-tile-more` on the chip, `data-tile-more-count` on its count,\n * `data-cramped` on a chip wider than the room, which shrinks to it and draws\n * no count, and `data-no-room` on a chip a cell with no room for a tile draws\n * across itself. Its styles are the Plan recipe's.\n *\n * @packageDocumentation\n */\n\nimport {\n    useCallback, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore, type CSSProperties, type MouseEvent, type ReactNode,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { Box, Menu as ChakraMenu, chakra } from \"@chakra-ui/react\";\nimport { FrameMenuLayer } from \"@elaraai/east-ui-components/internal\";\nimport { usePlanGeometry } from \"../context.js\";\nimport { PlanControllerContext } from \"../controller/react.js\";\nimport { rowKeyOf } from \"../row-key.js\";\nimport type { PlanWords } from \"../words.js\";\nimport { fitTiles, type TileCellMeasure } from \"./tile-fold.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** One tile of a cell: its key, its accessible name, and the tile itself, drawn folded or not. */\nexport interface BucketCellTile {\n    /** Its event's key — the tile's `data-event`. */\n    readonly key: string;\n    /** Its accessible name — what the chip's menu lists it by (#819). */\n    readonly name: string;\n    /** The tile, folded or not. */\n    readonly draw: (folded: boolean) => ReactNode;\n}\n\n/** Props of {@link BucketCell}. */\nexport interface BucketCellProps {\n    /** The Plan recipe's styles. */\n    readonly styles: Styles;\n    /** The row the cell is in, by its key — where an open popover's tile is looked for. */\n    readonly rowKey: string;\n    /** The cell's key — its `data-plan-cell`. */\n    readonly cellKey: string;\n    /** Where the cell sits: its left, width, top and height — inline, as a gesture moves them. */\n    readonly place: Readonly<CSSProperties>;\n    /** Its marker's status — the ring — when it has one. */\n    readonly over: string | undefined;\n    /** Its lane caption, drawn first. */\n    readonly caption: ReactNode;\n    /** Its tiles, in order. */\n    readonly tiles: readonly BucketCellTile[];\n    /** Its marker's corner icon, drawn last. */\n    readonly marker: ReactNode;\n    /** Whether the cell folds: it holds a tile, and is not a context strip's. */\n    readonly folds: boolean;\n    /** The bucket's left edge, as a fraction of the window — the chip's place in the row's walk. */\n    readonly frac: number;\n    /** The bucket, in words — the chip's name says where it is. */\n    readonly bucket: string;\n    /** The cell's lane, in words, when it has one. */\n    readonly lane: string | undefined;\n    /** The canvas's words. */\n    readonly words: PlanWords;\n    /** A click on the cell itself: its row selected. */\n    readonly onClick: () => void;\n    /** A signature of what sizes the tiles — each one's key and what it draws; the cell measures again when it changes. */\n    readonly signature: string;\n}\n\nconst noSubscribe = () => () => undefined;\n\n/**\n * A bucket cell — see the module docs.\n *\n * @param props - The cell's place, its caption, tiles and marker, whether it folds, and its words\n * @returns The cell\n */\nexport function BucketCell(props: BucketCellProps) {\n    const { styles, rowKey, cellKey, place, over, caption, tiles, marker, folds, frac, bucket, lane, words, onClick, signature } = props;\n    const geometry = usePlanGeometry();\n    const boxRef = useRef<HTMLDivElement | null>(null);\n    const chipRef = useRef<HTMLButtonElement | null>(null);\n\n    // ── The tile the cell keeps (see the module docs) ──\n    // Only this cell's own fact: a selection or a popover elsewhere renders nothing here.\n    const controller = useContext(PlanControllerContext);\n    const held = useSyncExternalStore(controller?.subscribe ?? noSubscribe, () => {\n        if (controller === null) return undefined;\n        const snap = controller.getSnapshot();\n        const selected = tiles.find((tile) => snap.store.ui.elements.includes(tile.key));\n        if (selected !== undefined) return selected.key;\n        const open = snap.overlay.popover?.ref;\n        return open !== undefined && open.type === \"event\" && rowKeyOf(open.value.row) === rowKey\n            ? tiles.find((tile) => tile.key === open.value.event)?.key\n            : undefined;\n    });\n    const [picked, setPicked] = useState<string | undefined>(undefined);\n    const keptKey = held ?? picked;\n    const keptIndex = keptKey === undefined ? -1 : tiles.findIndex((tile) => tile.key === keptKey);\n\n    // ── The fold, measured before paint ──\n    const [measuring, setMeasuring] = useState(folds);\n    // What the cell measured, and its own width: a chip it draws across itself has that room (#1276).\n    const [measure, setMeasure] = useState<(TileCellMeasure & { readonly cell: number }) | undefined>(undefined);\n    // Other tiles, or a cell that folds again, measure again.\n    useLayoutEffect(() => { if (folds) setMeasuring(true); }, [signature, folds]);\n    // So does a change of the room, before the cell paints at it. The box is\n    // as wide as the cell leaves it, whatever it holds, so folding never\n    // changes what it observes.\n    useLayoutEffect(() => {\n        const box = boxRef.current;\n        if (!folds || box === null || typeof ResizeObserver === \"undefined\") return undefined;\n        let room = box.getBoundingClientRect().width;\n        const ro = new ResizeObserver(() => {\n            const now = box.getBoundingClientRect().width;\n            if (Math.abs(now - room) < 0.01) return;\n            room = now;\n            flushSync(() => setMeasuring(true));\n        });\n        ro.observe(box);\n        return () => ro.disconnect();\n    }, [folds]);\n    // Fonts arriving change the tiles' widths, not the room.\n    useEffect(() => {\n        const fonts = typeof document === \"undefined\" ? undefined : document.fonts;\n        if (!folds || fonts === undefined) return undefined;\n        const again = () => setMeasuring(true);\n        fonts.addEventListener(\"loadingdone\", again);\n        return () => fonts.removeEventListener(\"loadingdone\", again);\n    }, [folds]);\n    useLayoutEffect(() => {\n        const box = boxRef.current;\n        if (!folds || !measuring || box === null) return;\n        const width = (el: Element | null) => (el === null ? 0 : el.getBoundingClientRect().width);\n        const gap = Number.parseFloat(getComputedStyle(box).columnGap) || 0;\n        // The room is the box's own width, measured, never rounded: a tile a\n        // fraction too wide for it would ellipsize its label.\n        const room = width(box);\n        setMeasure({\n            room,\n            tiles: [...box.querySelectorAll(\":scope > [data-event]\")].map(width),\n            gap,\n            more: width(box.querySelector(\":scope > [data-tile-more-measure]\")) + gap,\n            floor: Math.min(geometry.tileMinWidth, room),\n            least: geometry.tileLeastWidth,\n            cell: width(box.parentElement),\n        });\n        setMeasuring(false);\n    }, [measuring, folds, signature, geometry.tileMinWidth, geometry.tileLeastWidth]);\n    // The fold the last measure gave; the cell draws every tile whole while it\n    // measures again, and the chip keeps that fold meanwhile, so an open menu\n    // stays open (#1235).\n    const measured = !folds || measure === undefined || measure.tiles.length !== tiles.length\n        ? undefined\n        : fitTiles(measure, keptIndex >= 0 ? keptIndex : undefined);\n    const shown = measuring || measured === undefined ? undefined : new Set(measured.shown);\n    const folded = measured === undefined || !measured.chip ? [] : tiles.filter((_, i) => !measured.shown.includes(i));\n    // A room narrower than the chip itself cramps it: it shrinks to the room, its count off its line, its name\n    // still saying what it holds — as a tile's parts go (#1266). Drawn across a cell with no room for a tile, its\n    // room is the cell's (#1276).\n    const noRoom = measured?.noRoom === true;\n    const cramped = measure !== undefined && measure.more - measure.gap > (noRoom ? measure.cell : measure.room) + 0.01;\n\n    // A focused tile that folds hands the focus to the chip, which holds it now.\n    useLayoutEffect(() => {\n        const box = boxRef.current;\n        const at = typeof document === \"undefined\" ? null : document.activeElement;\n        if (box === null || !(at instanceof HTMLElement) || at.parentElement !== box || !at.hasAttribute(\"data-folded\")) return;\n        chipRef.current?.focus({ preventScroll: true });\n    });\n\n    // ── A pick: the tile kept on the run, then focused and clicked as a viewer would ──\n    // The menu hands focus back to its chip in a microtask after the pick; the\n    // tile's focus and click come a frame later, so the popover it opens\n    // anchors to it and keeps the focus there. The selection or the open\n    // popover keeps it from then on — each in the store by the time the click\n    // returns — and the cell answers before that frame paints: a tile nothing\n    // keeps, a series' whose click selects its row, folds again at once, so it\n    // never shows alone for a frame.\n    const pick = useCallback((key: string) => {\n        setPicked(key);\n        requestAnimationFrame(() => {\n            const tile = [...(boxRef.current?.querySelectorAll<HTMLElement>(\":scope > [data-event]\") ?? [])]\n                .find((el) => el.getAttribute(\"data-event\") === key);\n            tile?.focus({ preventScroll: true });\n            tile?.click();\n            flushSync(() => setPicked(undefined));\n        });\n    }, []);\n    // A click on the chip opens its menu; the cell's own click — its row selected — is not its.\n    const stop = useCallback((e: MouseEvent) => e.stopPropagation(), []);\n\n    return (\n        <Box css={styles.cell}\n            data-plan-cell={cellKey}\n            data-over={over}\n            style={place}\n            onClick={onClick}\n        >\n            {caption}\n            {/* The tiles, in the room the caption leaves them: a tile's floor is that room's (#1266). */}\n            <Box ref={boxRef} css={styles.cellTiles} data-plan-cell-tiles=\"\"\n                data-tile-measure={folds && measuring ? \"\" : undefined}>\n                {tiles.map((tile, i) => tile.draw(shown !== undefined && !shown.has(i)))}\n                {folds && measuring && (\n                    // The chip's stand-in, measured beside the tiles drawn whole: beside the\n                    // chip, never in its place, so an open menu stays open (#1235).\n                    <Box as=\"span\" css={styles.tileMore} data-tile-more-measure=\"\" aria-hidden>\n                        <span data-tile-more-count=\"\">{words.m.tileMore({ n: tiles.length, count: words.number(tiles.length) })}</span>\n                    </Box>\n                )}\n                {folded.length > 0 && (\n                    <ChakraMenu.Root positioning={{ placement: \"bottom-start\" }} onSelect={(detail) => pick(detail.value)}>\n                        <ChakraMenu.Trigger asChild>\n                            <chakra.button ref={chipRef} type=\"button\" css={styles.tileMore} data-tile-more=\"\"\n                                data-cramped={cramped ? \"\" : undefined}\n                                data-no-room={noRoom ? \"\" : undefined}\n                                // In the row's walk where the tiles it folds would be (#819).\n                                data-plan-frac={frac.toFixed(4)} tabIndex={-1}\n                                aria-label={words.m.tileMoreLabel({ n: folded.length, count: words.number(folded.length), bucket, lane })}\n                                onClick={stop}>\n                                <span data-tile-more-count=\"\">{words.m.tileMore({ n: folded.length, count: words.number(folded.length) })}</span>\n                            </chakra.button>\n                        </ChakraMenu.Trigger>\n                        <FrameMenuLayer label={bucket} data-tile-more-menu=\"\">\n                                    {folded.map((tile) => <ChakraMenu.Item key={tile.key} value={tile.key}>{tile.name}</ChakraMenu.Item>)}\n                                </FrameMenuLayer>\n                    </ChakraMenu.Root>\n                )}\n            </Box>\n            {marker}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Bucket rows (`Plan Spec.md` §4·K2) — the Planner `.pcell` grid, verbatim:\n * one washed sub-cell per bucket × lane (lanes stack; `lane: none` in a laned\n * row takes the full cell — the mixed grammar), content flowing inline from\n * the left: the per-cell lane caption, then the event chips. The resting\n * looks are the Planner's — a solid ink ✓ chip for confirmed/actual, the\n * grip-prefixed dashed `plan` chip for proposals; labelled tiles keep the\n * lifecycle axis. A marker rings its CELL (`data-over`) and pins the corner\n * status icon, whose message is its accessible name and the canvas's one\n * tooltip (#816).\n *\n * A tile is a button named by its label, bucket, lane and state (#819) — the\n * ✓ and dashed `plan` chips say their state only by look.\n *\n * A tile is never wider than the room its cell leaves it — the cell's, less\n * its lane caption: the tiles sit in a box of their own beside it — and draws\n * its icon and its label — a labelled tile's, or a resting proposal's `plan` —\n * each whole or not at all (#1266): the recipe lays them on one line and moves\n * off it what has no room there. A hidden or ellipsized label is said by its\n * hover, in the canvas's tooltip.\n *\n * A cell with more tiles than it has room for shows the tiles that fit, each\n * drawn whole, and a `+n` chip whose menu lists the rest (#1267,\n * `BucketCell.tsx`): a folded tile is out of the row's walk, which reaches the\n * chip in its place. A cell with no room for one tile shows its chip alone,\n * listing every tile (#1276).\n *\n * On a row whose series declares a move's fields (#825) a tile moves to\n * another bucket, or another row of its item type; it has one instant, so no\n * end to drag. An event kind's tile moves its event (#1196), and wears the\n * brand tint in a brand border while its drafts change it (`data-draft`).\n */\n\nimport { useContext, useMemo, type ReactNode } from \"react\";\nimport { Box, useChakraContext } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n    faCheck, faCircle, faCircleCheck, faCircleInfo, faCircleXmark, faGripVertical, faTriangleExclamation,\n    type IconDefinition,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport type { IconName, IconPrefix } from \"@fortawesome/fontawesome-svg-core\";\nimport { variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { resolveColor } from \"@elaraai/east-ui-components/internal\";\nimport { usePlanDispatch, usePlanScale, type PlanElementRefValue } from \"../context.js\";\nimport { runStateKey, type PlanRowMove } from \"./SpanRow.js\";\nimport { usePlanElementSelect } from \"./element-select.js\";\nimport { usePlanElementOverlap } from \"./element-overlap.js\";\nimport { PlanDraftedContext, usePlanElementBounded, usePlanElementConflicted, usePlanElementDrafted } from \"./element-draft.js\";\nimport { usePlanElementOp } from \"./element-optimise.js\";\nimport { BucketCell, type BucketCellTile } from \"./BucketCell.js\";\nimport { usePlanMovable } from \"../edit/movable.js\";\nimport type { PlanMovable } from \"../edit/store.js\";\nimport type { PlanBucket } from \"../scale.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport { appendAll } from \"../reductions.js\";\nimport { tileName } from \"../a11y.js\";\nimport type { PlanRowId } from \"../model.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { PLAN_CELL_INSET } from \"../geometry.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype BucketsKindValue = Extract<ValueTypeOf<typeof Plan.Types.Row>[\"kind\"], { type: \"buckets\" }>[\"value\"];\ntype BucketEventValue = BucketsKindValue[\"events\"][number];\ntype MarkerValue = BucketsKindValue[\"markers\"][number];\ntype LaneRef = BucketEventValue[\"lane\"];\n\n/** Status tag → paired FA icon — mirrors the Planner marker so a Plan cell\n *  marker reads the same as a Planner one. */\nconst STATUS_ICON: Record<string, IconDefinition> = {\n    success: faCircleCheck,\n    warning: faTriangleExclamation,\n    danger:  faCircleXmark,\n    info:    faCircleInfo,\n    neutral: faCircle,\n};\n\nexport interface BucketsRowProps {\n    /** R2 context strip (#591) — render this row's marks at strip size. */\n    ctx?: boolean | undefined;\n\n    rowKey: string;\n    /** The row's id — what an element click names the row by (#822). */\n    rowId: PlanRowId;\n    kind: BucketsKindValue;\n    styles: Styles;\n    /** How its tiles move (#825) — `undefined` when they do not. */\n    move?: PlanRowMove | undefined;\n}\n\n/** One event chip — the `.chk` / `.pchip` resting looks + labelled tiles. */\nfunction EventChip({ ev, styles, rowKey, rowId, ctx, bucket, lane, move, folded }: {\n    ev: BucketEventValue; styles: Styles; rowKey: string; rowId: PlanRowId; ctx?: boolean | undefined;\n    /** The bucket the tile renders in — its place in the row's time order (#819). */\n    bucket: PlanBucket;\n    /** Its lane's caption, when the lane has one. */\n    lane: string | undefined;\n    /** How it moves (#825). */\n    move: PlanRowMove | undefined;\n    /** Folded into its cell's `+n` (#1267): out of sight, and out of the row's walk. */\n    folded: boolean;\n}) {\n    const system = useChakraContext();\n    const scale = usePlanScale();\n    const words = usePlanWords();\n    const ref = variant(\"event\", { row: rowId, event: ev.key }) as PlanElementRefValue;\n    // An event's tile selects its event (#1197); any other tile, its row.\n    const select = usePlanElementSelect(rowKey, ev.key, ref);\n    // An event in an overlap pair wears the warn ring (#1198).\n    const overlap = usePlanElementOverlap(ev.key);\n    // An event its drafts changed wears the brand tint in a brand border (#1196).\n    const drafted = usePlanElementDrafted(ev.key);\n    const conflict = usePlanElementConflicted(ev.key);\n    // An event whose row breaks its kind's bounds wears the warn ring too, stored or changed (#1585).\n    const bounds = usePlanElementBounded(ev.key);\n    // What a run of the optimiser did to its event (#1409, R17), while it is still the run's draft.\n    const op = usePlanElementOp(ev.key);\n    const optimised = drafted ? op : undefined;\n    const label = ev.label.type === \"some\" ? ev.label.value : undefined;\n    // A tile has one instant — its extent is that instant twice.\n    const movable = useMemo<PlanMovable | undefined>(() => (move !== undefined\n        ? { rowKey, key: ev.key, label: label ?? ev.key, kind: \"tile\", span: { start: ev.at, end: ev.at }, items: move.items, resize: false }\n        : undefined), [move, rowKey, ev, label]);\n    const { handle, carried } = usePlanMovable(movable);\n    const icon = ev.icon.type === \"some\" ? ev.icon.value : undefined;\n    const stateKey = runStateKey(ev.state);\n    const stretch = ev.stretch.type === \"some\" ? ev.stretch.value.type : undefined;\n    const hFill = stretch === \"horizontal\" || stretch === \"both\";\n    const vFill = stretch === \"vertical\" || stretch === \"both\";\n    const justify = ev.content.type === \"some\" && ev.content.value.horizontal.type === \"some\"\n        ? ev.content.value.horizontal.value.type : undefined;\n    const color = ev.color.type === \"some\" ? ev.color.value : undefined;\n    return (\n        <Box css={styles.tile}\n            data-event={ev.key}\n            data-plan-frac={bucket.x0.toFixed(4)}\n            // Focusable: Enter opens its popover (#816), and the row's Tab\n            // walk reaches it (#819).\n            tabIndex={-1}\n            role=\"button\"\n            aria-label={tileName(ev, bucket, lane, scale, words)}\n            data-ctx={ctx === true ? \"\" : undefined}\n            data-state={stateKey}\n            data-tone={ev.tone.type === \"some\" ? ev.tone.value.type : undefined}\n            data-overlap={overlap ? \"\" : undefined}\n            data-draft={drafted ? \"\" : undefined}\n            data-conflict={conflict ? \"\" : undefined}\n            data-bounds={bounds ? \"\" : undefined}\n            data-op={optimised?.op}\n            data-fill={optimised !== undefined ? \"own\" : undefined}\n            title={optimised?.provenance}\n            data-folded={folded ? \"\" : undefined}\n            data-pulse={ev.animation.type === \"some\" && ev.animation.value.type === \"pulse\" ? \"\" : undefined}\n            flex={hFill ? \"1\" : undefined}\n            // Stretch is a style PROP and outranks the recipe: in a strip\n            // neither is set, or a `vertical` tile fills the lane instead of\n            // dropping to the `tile[data-ctx]` 7px mark (#591).\n            alignSelf={vFill && ctx !== true ? \"stretch\" : undefined}\n            height={vFill && ctx !== true ? \"auto\" : undefined}\n            justifyContent={justify}\n            // A theme token or raw CSS — the system says which (#817).\n            background={color !== undefined ? resolveColor(system, color) : undefined}\n            {...handle}\n            // Carried by the keyboard (#825) — dimmed as a dragged origin is.\n            data-dragging={carried ? \"\" : undefined}\n            data-selected={select.selected ? \"\" : undefined}\n            aria-pressed={select.selectable ? select.selected : undefined}\n            onClick={select.onClick}\n        >\n            {icon !== undefined && <FontAwesomeIcon icon={[icon.prefix as IconPrefix, icon.name as IconName]} data-plan-icon=\"\" />}\n            {label !== undefined ? <Box as=\"span\" css={styles.tileLabel} data-plan-label=\"\">{label}</Box>\n                : icon !== undefined ? null\n                : stateKey === \"prop\" ? (\n                    <>\n                        <FontAwesomeIcon icon={faGripVertical} data-plan-icon=\"\" />\n                        <Box as=\"span\" css={styles.tileLabel} data-plan-label=\"\">{words.m.planChip()}</Box>\n                    </>\n                )\n                : <FontAwesomeIcon icon={faCheck} data-plan-icon=\"\" />}\n        </Box>\n    );\n}\n\n/** The bucket-row plot content — the washed bucket × lane cell grid. */\nexport function BucketsRow({ rowKey, rowId, kind, styles, ctx, move }: BucketsRowProps) {\n    const scale = usePlanScale();\n    const dispatch = usePlanDispatch();\n    const words = usePlanWords();\n    // The events a draft changed: a drafted tile's border sizes it, so its cell measures again (#1267).\n    const drafted = useContext(PlanDraftedContext);\n    const lanes = kind.lanes;\n    const laneCount = Math.max(1, lanes.length);\n    // Lane key → index; absent/unknown lane ⇒ the full-cell mixed grammar.\n    const laneIndex = (lane: LaneRef): number | undefined => {\n        if (lanes.length === 0 || lane.type === \"none\") return undefined;\n        const i = lanes.findIndex((l) => l.key === lane.value);\n        return i >= 0 ? i : undefined;\n    };\n    // A tile's own lane caption — what its accessible name says (#819), even\n    // in a spanned bucket where its lane has no row of its own.\n    const laneCaption = (lane: LaneRef): string | undefined => {\n        const li = laneIndex(lane);\n        const l = li !== undefined ? lanes[li] : undefined;\n        return l !== undefined && l.label.type === \"some\" ? l.label.value : undefined;\n    };\n\n    // Group events + markers by (bucket, lane); lane: none ⇒ the full cell\n    // (rendered as a spanning cell across all lanes). RENDER bucketing\n    // (#619): overscan events land in overscan cells (out-of-range indices),\n    // clipped at rest and revealed by a brush pan; interactions still speak\n    // the window's `bucketOf`.\n    const bucketByIndex = new Map<number, PlanBucket>();\n    const renderIndexOf = (at: PlanInstantValue): number | undefined => {\n        const b = scale.renderBucketOf(at);\n        if (b === undefined) return undefined;\n        bucketByIndex.set(b.index, b);\n        return b.index;\n    };\n    const cellEvents = new Map<string, BucketEventValue[]>();\n    const fullCellEvents = new Map<number, BucketEventValue[]>();\n    for (const ev of kind.events) {\n        const bi = renderIndexOf(ev.at);\n        if (bi === undefined) continue;\n        const li = laneIndex(ev.lane);\n        if (li === undefined && lanes.length > 0) {\n            const list = fullCellEvents.get(bi);\n            if (list !== undefined) list.push(ev);\n            else fullCellEvents.set(bi, [ev]);\n        } else {\n            const key = `${bi}:${li ?? 0}`;\n            const list = cellEvents.get(key);\n            if (list !== undefined) list.push(ev);\n            else cellEvents.set(key, [ev]);\n        }\n    }\n    const cellMarkers = new Map<string, MarkerValue[]>();\n    for (const m of kind.markers) {\n        const bi = renderIndexOf(m.at);\n        if (bi === undefined) continue;\n        const li = laneIndex(m.lane) ?? 0;\n        const list = cellMarkers.get(`${bi}:${li}`);\n        if (list !== undefined) list.push(m);\n        else cellMarkers.set(`${bi}:${li}`, [m]);\n    }\n    // Two markers on one cell: the WORST status wins the ring and the corner\n    // icon — a cell has exactly one of each, and hiding a danger under an\n    // info would be the wrong resolution in every canvas (#615).\n    const MARKER_RANK: Record<string, number> = { neutral: 0, info: 1, success: 2, warning: 3, danger: 4 };\n    const worstMarker = (ms: readonly MarkerValue[]): MarkerValue | undefined =>\n        ms.length === 0 ? undefined : ms.reduce((a, b) =>\n            ((MARKER_RANK[b.status.type] ?? 0) > (MARKER_RANK[a.status.type] ?? 0) ? b : a));\n    // The spanning full-cell shows the whole BUCKET's markers — a lane-less\n    // event taking the cell must not hide a lane's marker with it (#615).\n    const bucketMarkers = (bi: number): MarkerValue[] => {\n        const out: MarkerValue[] = [];\n        for (let li = 0; li < laneCount; li++) appendAll(out, cellMarkers.get(`${bi}:${li}`) ?? []);\n        return out;\n    };\n\n    // Cell geometry — the cell inset each side, horizontally and per lane,\n    // approximating the Planner's 1px 2px cell margins + 3px lane padding; a\n    // link meets the cell by the same inset (#1258).\n    const cellX = (b: PlanBucket) => (\n        { left: `calc(${b.x0 * 100}% + ${PLAN_CELL_INSET}px)`, width: `calc(${(b.x1 - b.x0) * 100}% - ${2 * PLAN_CELL_INSET}px)` }\n    );\n    const laneY = (li: number, span: number = 1) => ({\n        top: `calc(${(li / laneCount) * 100}% + ${PLAN_CELL_INSET}px)`,\n        height: `calc(${(span / laneCount) * 100}% - ${2 * PLAN_CELL_INSET}px)`,\n    });\n\n    const renderCell = (b: PlanBucket, li: number | undefined, events: BucketEventValue[], span: number = 1) => {\n        const bi = b.index;\n        const cellKey = `${bi}:${li ?? \"full\"}`;\n        const marker = worstMarker(li !== undefined ? cellMarkers.get(`${bi}:${li}`) ?? [] : bucketMarkers(bi));\n        const lane = li !== undefined ? lanes[li] : undefined;\n        const caption = lane !== undefined && lane.label.type === \"some\" ? lane.label.value : undefined;\n        // Each tile drawn folded or not, and named for the chip's menu as a reader hears it (#819).\n        const tiles = events.map((ev): BucketCellTile => {\n            const tileLane = laneCaption(ev.lane);\n            return {\n                key: ev.key,\n                name: tileName(ev, b, tileLane, scale, words),\n                draw: (folded) => (\n                    <EventChip key={ev.key} ev={ev} styles={styles} rowKey={rowKey} rowId={rowId} ctx={ctx}\n                        bucket={b} lane={tileLane} move={move} folded={folded} />\n                ),\n            };\n        });\n        // What sizes the tiles: each one's key, label, icon and state, and whether a draft changed it.\n        const signature = events.map((ev) => [\n            ev.key, ev.label.type === \"some\" ? ev.label.value : \"\", ev.icon.type === \"some\" ? ev.icon.value.name : \"\",\n            runStateKey(ev.state), drafted.has(ev.key) ? \"draft\" : \"\",\n        ].join(\"\\u0000\")).join(\"\\u0001\");\n        return (\n            <Box as=\"span\" key={`c${cellKey}`} display=\"contents\">\n                <BucketCell styles={styles} rowKey={rowKey} cellKey={cellKey}\n                    place={{ ...cellX(b), ...laneY(li ?? 0, li === undefined ? laneCount : span) }}\n                    over={marker !== undefined ? marker.status.type : undefined}\n                    caption={caption !== undefined && ctx !== true ? <Box css={styles.laneLabel}>{caption}</Box> : null}\n                    tiles={tiles}\n                    marker={marker !== undefined ? (\n                        <Box css={styles.markerIcon} data-status={marker.status.type}\n                            data-marker={cellKey} role=\"img\" aria-label={marker.message}>\n                            <FontAwesomeIcon icon={STATUS_ICON[marker.status.type] ?? faCircleInfo} />\n                        </Box>\n                    ) : null}\n                    // A context strip's tiles are marks with no text: they never fold. Any other cell's tiles\n                    // fold where they have no room — a lone tile too, where its cell has none for it (#1276).\n                    folds={events.length > 0 && ctx !== true}\n                    frac={b.x0} bucket={scale.bucketText(b)} lane={caption} words={words}\n                    onClick={() => dispatch({ t: \"row.select\", key: rowKey })}\n                    signature={signature} />\n            </Box>\n        );\n    };\n\n    // ── Occupied-only mounting (#616) ─────────────────────────────────────\n    // A cell per bucket × lane is O(buckets × lanes) DOM whether or not\n    // anything is in it — 500 hour buckets used to mount 500+ divs per row.\n    // For an EQUAL-bucKET lane with no caption, the empty-cell wash paints as\n    // ONE gradient band (`cellWash`) and real cells mount only where content,\n    // a caption or a marker exists. A captioned lane prints its caption in\n    // every cell (the Planner `.bl`), and unequal buckets (month / quarter,\n    // low counts) keep the full grid — both fall back to mounting all.\n    const n = scale.buckets.length;\n    const w0 = n > 0 ? scale.buckets[0]!.x1 - scale.buckets[0]!.x0 : 0;\n    const uniform = n > 1 && scale.buckets.every((b) => Math.abs((b.x1 - b.x0) - w0) < 1e-9);\n    const laneCaptioned = (li: number): boolean => {\n        const lane = lanes[li];\n        return lane !== undefined && lane.label.type === \"some\";\n    };\n    const cells: ReactNode[] = [];\n    for (let li = 0; li < laneCount; li++) {\n        if (uniform && !laneCaptioned(li)) {\n            cells.push(\n                <Box key={`wash-${li}`} css={styles.cellWash} data-plan-cellwash={li}\n                    style={{\n                        ...laneY(li),\n                        backgroundImage: `repeating-linear-gradient(to right, transparent 0 2px, var(--chakra-colors-bg-panel) 2px calc(100% / ${n} - 2px), transparent calc(100% / ${n} - 2px) calc(100% / ${n}))`,\n                    }} />,\n            );\n        }\n    }\n    const mountBucket = (b: PlanBucket, occupiedOnly: boolean) => {\n        const bi = b.index;\n        const full = fullCellEvents.get(bi);\n        if (full !== undefined) {\n            // The mixed grammar: a lane-less event in a laned row takes the\n            // whole cell across lanes. Lane-assigned chips in the SAME bucket\n            // still render — they flow after the spanning chips, in lane\n            // order. Their lane position is not representable inside a\n            // spanned bucket, but a dropped event is worse than a\n            // repositioned one (#615).\n            const laned: BucketEventValue[] = [];\n            for (let li = 0; li < laneCount; li++) appendAll(laned, cellEvents.get(`${bi}:${li}`) ?? []);\n            cells.push(renderCell(b, undefined, [...full, ...laned]));\n            return;\n        }\n        for (let li = 0; li < laneCount; li++) {\n            const events = cellEvents.get(`${bi}:${li}`) ?? [];\n            const occupied = events.length > 0 || (cellMarkers.get(`${bi}:${li}`)?.length ?? 0) > 0;\n            if (!occupied && (occupiedOnly || (uniform && !laneCaptioned(li)))) continue;\n            cells.push(renderCell(b, li, events));\n        }\n    };\n    for (const b of scale.buckets) mountBucket(b, false);\n    // Overscan cells (#619) — occupied ONLY, always: the wash and the caption\n    // grid belong to the window; an overscan cell exists to slide real\n    // content in under a brush pan.\n    for (const [bi, b] of bucketByIndex) {\n        if (bi < 0 || bi >= scale.buckets.length) mountBucket(b, true);\n    }\n    return <>{cells}</>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Cards rows (`Plan Spec.md` §4·K6) — the Roster surface on the shared scale:\n * shift chips spanning whole buckets, wearing the lifecycle looks on the\n * recipe `cardChip` slot's `data-state` axis (confirmed brand tint · proposed\n * dashed · `proposed(removed)` warn strikethrough · estimated ghost). A chip's\n * popover and hover card come from the canvas's one overlay layer (#816).\n * Each chip is a button named by its label, span and state (#819).\n *\n * On a row whose series declares a move's fields (#825) a chip moves — by\n * itself or by an end — as a run bar does; an event kind's chip moves its\n * event (#1196), and wears the drafted look while its drafts change it.\n */\n\nimport { useMemo } from \"react\";\nimport { variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Box } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName, IconPrefix } from \"@fortawesome/fontawesome-svg-core\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { usePlanScale, type PlanElementRefValue } from \"../context.js\";\nimport { runStateKey, type PlanRowMove } from \"./SpanRow.js\";\nimport { usePlanElementSelect } from \"./element-select.js\";\nimport { usePlanElementOverlap } from \"./element-overlap.js\";\nimport { usePlanElementBounded, usePlanElementConflicted, usePlanElementDrafted } from \"./element-draft.js\";\nimport { usePlanElementOp } from \"./element-optimise.js\";\nimport { chipName } from \"../a11y.js\";\nimport type { PlanRowId } from \"../model.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { usePlanMovable } from \"../edit/movable.js\";\nimport type { PlanMovable } from \"../edit/store.js\";\nimport { PLAN_CELL_INSET } from \"../geometry.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype CardsKindValue = Extract<ValueTypeOf<typeof Plan.Types.Row>[\"kind\"], { type: \"cards\" }>[\"value\"];\ntype ChipValue = CardsKindValue[\"chips\"][number];\n\nexport interface CardsRowProps {\n    /** R2 context strip (#591) — render this row's marks at strip size. */\n    ctx?: boolean | undefined;\n\n    rowKey: string;\n    /** The row's id — what an element click names the row by (#822). */\n    rowId: PlanRowId;\n    kind: CardsKindValue;\n    styles: Styles;\n    /** How its chips move (#825) — `undefined` when they do not. */\n    move?: PlanRowMove | undefined;\n}\n\n/** One chip — a button that moves, with its end handles, where its row takes moves (#825). */\nfunction CardChip({ chip, left, width, rowKey, rowId, styles, ctx, move }: {\n    chip: ChipValue; left: number; width: number;\n    rowKey: string; rowId: PlanRowId; styles: Styles; ctx: boolean | undefined; move: PlanRowMove | undefined;\n}) {\n    const scale = usePlanScale();\n    const words = usePlanWords();\n    const movable = useMemo<PlanMovable | undefined>(() => (move !== undefined\n        ? { rowKey, key: chip.key, label: chip.label, kind: \"chip\", span: { start: chip.from, end: chip.to }, items: move.items, resize: move.resize }\n        : undefined), [move, rowKey, chip]);\n    const { handle, edges, carried } = usePlanMovable(movable);\n    const icon = chip.icon.type === \"some\" ? chip.icon.value : undefined;\n    const ref = variant(\"chip\", { row: rowId, chip: chip.key }) as PlanElementRefValue;\n    // An event's chip selects its event (#1197); any other chip, its row.\n    const select = usePlanElementSelect(rowKey, chip.key, ref);\n    // An event in an overlap pair wears the warn ring (#1198).\n    const overlap = usePlanElementOverlap(chip.key);\n    // An event its drafts changed wears the brand tint in a brand border (#1196).\n    const drafted = usePlanElementDrafted(chip.key);\n    const conflict = usePlanElementConflicted(chip.key);\n    // An event whose row breaks its kind's bounds wears the warn ring too, stored or changed (#1585).\n    const bounds = usePlanElementBounded(chip.key);\n    // What a run of the optimiser did to its event (#1409, R17), while it is still the run's draft.\n    const op = usePlanElementOp(chip.key);\n    const optimised = drafted ? op : undefined;\n    return (\n        <Box css={styles.cardChip}\n            data-ctx={ctx === true ? \"\" : undefined}\n            data-chip={chip.key}\n            // Its label hides sooner beside an icon (#1264).\n            data-icon={icon !== undefined ? \"\" : undefined}\n            data-overlap={overlap ? \"\" : undefined}\n            data-draft={drafted ? \"\" : undefined}\n            data-conflict={conflict ? \"\" : undefined}\n            data-bounds={bounds ? \"\" : undefined}\n            data-op={optimised?.op}\n            data-fill={optimised !== undefined ? \"own\" : undefined}\n            title={optimised?.provenance}\n            // Focusable: Enter opens its popover (#816), and the\n            // row's Tab walk reaches it (#819).\n            tabIndex={-1}\n            role=\"button\"\n            aria-label={chipName(chip, scale, words)}\n            data-plan-frac={left.toFixed(4)}\n            data-state={runStateKey(chip.state)}\n            // In from its ends — the inset a link meets it by (#1258).\n            style={{ left: `calc(${left * 100}% + ${PLAN_CELL_INSET}px)`, width: `calc(${width * 100}% - ${2 * PLAN_CELL_INSET}px)` }}\n            {...handle}\n            // Carried by the keyboard (#825) — dimmed as a dragged origin is.\n            data-dragging={carried ? \"\" : undefined}\n            data-selected={select.selected ? \"\" : undefined}\n            aria-pressed={select.selectable ? select.selected : undefined}\n            onClick={select.onClick}\n        >\n            {/* Its icon and its label, each drawn whole or not at all; a hidden or\n                ellipsized label is said by its hover (#1264). */}\n            {icon !== undefined && (\n                <Box as=\"span\" css={styles.cardChipIcon} data-plan-icon=\"\">\n                    <FontAwesomeIcon icon={[icon.prefix as IconPrefix, icon.name as IconName]} />\n                </Box>\n            )}\n            <Box as=\"span\" css={styles.cardChipLabel} data-plan-label=\"\">{chip.label}</Box>\n            {edges !== undefined && (\n                <>\n                    <Box css={styles.moveEdge} {...edges.start} />\n                    <Box css={styles.moveEdge} {...edges.end} />\n                </>\n            )}\n        </Box>\n    );\n}\n\n/** The cards-row plot content — whole-bucket shift chips. */\nexport function CardsRow({ rowKey, rowId, kind, styles, ctx, move }: CardsRowProps) {\n    const scale = usePlanScale();\n    return (\n        <>\n            {kind.chips.map((chip) => {\n                const f0 = scale.fracOf(chip.from);\n                // The chip's END — half-open on time / number, the far edge\n                // of the named bucket on an ordinal axis (#631).\n                const f1 = scale.endFracOf(chip.to);\n                if (!Number.isFinite(f0) || !Number.isFinite(f1)) return null;\n                // Render-bounds cull (#619): a chip wholly in the overscan\n                // mounts at its true geometry (clipped at rest, revealed by a\n                // brush pan); one touching the window keeps its clamped form\n                // so the at-rest render is unchanged.\n                if (f1 <= scale.renderMin || f0 >= scale.renderMax) return null;\n                const outside = f1 <= 0 || f0 >= 1;\n                const left = outside ? f0 : Math.max(0, f0);\n                const width = Math.max(0, (outside ? f1 : Math.min(1, f1)) - left);\n                return (\n                    <CardChip key={chip.key} chip={chip} left={left} width={width}\n                        rowKey={rowKey} rowId={rowId} styles={styles} ctx={ctx} move={move} />\n                );\n            })}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Event rows (`Plan Spec.md` §4·K7) — instant marks on the shared scale:\n * ● milestone dots, ◇/◆ decision diamonds (the span `diamond` slot,\n * verbatim), ▲ warn exception triangles. `icon` swaps the kind's default\n * glyph for an FA icon on the `markIcon` slot (12px, still kind-coloured);\n * labels print beside their mark on the `markLabel` slot. A mark and its label\n * both name the mark (`data-mark`), so either opens its popover from the\n * canvas's one overlay layer (#816).\n *\n * The glyph is a button named by its label, its kind (the glyph's meaning) and\n * its instant (#819); the printed label is then that name's echo, hidden from\n * a reader.\n *\n * On a row whose series declares a move's fields (#825) a mark moves to\n * another instant, or another row of its item type, by its glyph; an event\n * kind's mark moves its event (#1196), and wears the brand tint's ring while\n * its drafts change it.\n */\n\nimport { useMemo } from \"react\";\nimport { variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Box } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName, IconPrefix } from \"@fortawesome/fontawesome-svg-core\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { usePlanScale, type PlanElementRefValue } from \"../context.js\";\nimport { usePlanElementSelect } from \"./element-select.js\";\nimport { usePlanElementOverlap } from \"./element-overlap.js\";\nimport { usePlanElementBounded, usePlanElementConflicted, usePlanElementDrafted } from \"./element-draft.js\";\nimport { usePlanElementOp } from \"./element-optimise.js\";\nimport { markName } from \"../a11y.js\";\nimport type { PlanRowId } from \"../model.js\";\nimport { usePlanWords } from \"../words.js\";\nimport type { PlanRowMove } from \"./SpanRow.js\";\nimport { usePlanMovable } from \"../edit/movable.js\";\nimport type { PlanMovable } from \"../edit/store.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype EventsKindValue = Extract<ValueTypeOf<typeof Plan.Types.Row>[\"kind\"], { type: \"events\" }>[\"value\"];\ntype MarkValue = EventsKindValue[\"marks\"][number];\n\nexport interface EventsRowProps {\n    /** R2 context strip (#591) — marks keep their silhouette, shrink, and a\n     *  K7 icon override falls back to the kind's default geometry. */\n    ctx?: boolean | undefined;\n    rowKey: string;\n    /** The row's id — what an element click names the row by (#822). */\n    rowId: PlanRowId;\n    kind: EventsKindValue;\n    styles: Styles;\n    /** How its marks move (#825) — `undefined` when they do not. */\n    move?: PlanRowMove | undefined;\n}\n\n/** One mark's glyph — a button that moves, where its row takes moves (#825). */\nfunction MarkGlyph({ mark, x, rowKey, rowId, styles, ctx, move }: {\n    mark: MarkValue; x: number; rowKey: string; rowId: PlanRowId; styles: Styles; ctx: boolean | undefined;\n    move: PlanRowMove | undefined;\n}) {\n    const scale = usePlanScale();\n    const words = usePlanWords();\n    const ctxAttr = ctx === true ? \"\" : undefined;\n    const frac = x.toFixed(4);\n    const label = mark.label.type === \"some\" ? mark.label.value : undefined;\n    const icon = mark.icon.type === \"some\" ? mark.icon.value : undefined;\n    // A mark has one instant — its extent is that instant twice.\n    const movable = useMemo<PlanMovable | undefined>(() => (move !== undefined\n        ? { rowKey, key: mark.key, label: label ?? mark.key, kind: \"mark\", span: { start: mark.at, end: mark.at }, items: move.items, resize: false }\n        : undefined), [move, rowKey, mark, label]);\n    const { handle, carried } = usePlanMovable(movable);\n    const ref = variant(\"mark\", { row: rowId, mark: mark.key }) as PlanElementRefValue;\n    // An event's mark selects its event (#1197); any other mark, its row.\n    const select = usePlanElementSelect(rowKey, mark.key, ref);\n    // An event in an overlap pair wears the warn ring (#1198).\n    const overlap = usePlanElementOverlap(mark.key);\n    // An event its drafts changed wears the brand tint's ring (#1196).\n    const drafted = usePlanElementDrafted(mark.key);\n    // An event holding a conflict not yet chosen wears the warn ring.\n    const conflict = usePlanElementConflicted(mark.key);\n    // An event whose row breaks its kind's bounds wears the warn ring too, stored or changed (#1585).\n    const bounds = usePlanElementBounded(mark.key);\n    // What a run of the optimiser did to its event (#1409, R17), while it is still the run's draft.\n    const op = usePlanElementOp(mark.key);\n    const optimised = drafted ? op : undefined;\n    // Every glyph is the same button to a reader (#819) — and, where it\n    // moves, the same draggable (#825).\n    const common = {\n        role: \"button\", \"aria-label\": markName(mark, scale, words),\n        \"data-mark\": mark.key, \"data-plan-frac\": frac, style: { left: `${x * 100}%` }, tabIndex: -1, onClick: select.onClick,\n        // A mark that moves takes the recipe's grab cursor.\n        cursor: handle !== undefined ? undefined : \"pointer\",\n        ...handle,\n        \"data-dragging\": carried ? \"\" : undefined,\n        \"data-selected\": select.selected ? \"\" : undefined,\n        \"data-overlap\": overlap ? \"\" : undefined,\n        \"data-draft\": drafted ? \"\" : undefined,\n        \"data-conflict\": conflict ? \"\" : undefined,\n        \"data-bounds\": bounds ? \"\" : undefined,\n        \"data-op\": optimised?.op,\n        \"data-fill\": optimised !== undefined ? \"own\" : undefined,\n        title: optimised?.provenance,\n        \"aria-pressed\": select.selectable ? select.selected : undefined,\n    } as const;\n    // ── R4 (#591) ──\n    // A K7 override swaps the kind's geometry for the host's own\n    // 12px FA icon. At strip size that has nowhere to go — a\n    // detailed glyph at 6px is a blob — so a collapsed mark falls\n    // back to its KIND's default silhouette. The kind is still\n    // known, an outline survives smallness where an icon does not,\n    // and the host's icon returns on expand.\n    if (icon !== undefined && ctx !== true) {\n        return (\n            <Box css={styles.markIcon} data-kind={mark.kind.type} {...common}>\n                <FontAwesomeIcon icon={[icon.prefix as IconPrefix, icon.name as IconName]} />\n            </Box>\n        );\n    }\n    if (mark.kind.type === \"decision\") {\n        return <Box css={styles.diamond} data-ctx={ctxAttr} data-applied={mark.kind.value.applied ? \"\" : undefined} {...common} />;\n    }\n    if (mark.kind.type === \"exception\") return <Box css={styles.exceptionTri} data-ctx={ctxAttr} {...common} />;\n    return <Box css={styles.milestoneDot} data-ctx={ctxAttr} {...common} />;\n}\n\n/** The event-row plot content — kind-glyph marks + labels. */\nexport function EventsRow({ rowKey, rowId, kind, styles, ctx, move }: EventsRowProps) {\n    const ctxAttr = ctx === true ? \"\" : undefined;\n    const scale = usePlanScale();\n    return (\n        <>\n            {kind.marks.map((mark) => {\n                const x = scale.fracOf(mark.at);\n                // Render-bounds cull (#619): overscan marks sit clipped at\n                // rest and slide in on a brush pan.\n                if (!Number.isFinite(x) || x <= scale.renderMin || x >= scale.renderMax) return null;\n                const label = mark.label.type === \"some\" ? mark.label.value : undefined;\n                return (\n                    <Box as=\"span\" key={mark.key} display=\"contents\">\n                        <MarkGlyph mark={mark} x={x} rowKey={rowKey} rowId={rowId} styles={styles} ctx={ctx} move={move} />\n                        {label !== undefined && (\n                            <Box css={styles.markLabel} data-ctx={ctxAttr} data-mark={mark.key} aria-hidden=\"true\"\n                                style={{ left: `calc(${x * 100}% + 9px)` }}>{label}</Box>\n                        )}\n                    </Box>\n                );\n            })}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The B§3 quantity grammar: digits, an optional decimal, an optional\n * magnitude suffix `k` (×10³) or `m` (×10⁶); the digit-group separator and\n * any space ignored; the result the number as written — `7.5` is 7.5, as a\n * quantity's Float field holds it and its cell prints it. A suffix moves the\n * decimal point in the text, so `1.005k` is 1005 exactly, where multiplying\n * would leave 1004.9999999999999. It reads the separators of the viewer's\n * language (#852) — `1,234.5` in English, `1.234,5` in German, `1 234,5` in\n * French — with ASCII digits. The unit is the column's, never typed — an\n * integer column uses the same grammar, and refuses a fraction. A number\n * field takes, key by key, what the grammar reads ({@link typedQuantity}).\n *\n * @packageDocumentation\n */\n\nimport type { Formatters } from \"@elaraai/east-ui-components\";\n\n/** How a language writes a number: its digit-group and decimal separators. */\nexport type NumberSeparators = Formatters[\"separators\"];\n\n/** The text as the grammar reads it: every space and group separator gone, the decimal a `.`, the suffix lower case. */\nfunction normalised(text: string, separators: NumberSeparators): string {\n    // `\\s` covers the no-break and narrow no-break spaces French groups with.\n    const t = text.replace(/\\s/g, \"\").split(separators.group).join(\"\").toLowerCase();\n    return separators.decimal !== \".\" ? t.replace(separators.decimal, \".\") : t;\n}\n\n/**\n * Parse typed text to a number.\n *\n * @param text - The typed or pasted text\n * @param separators - The viewer's language's separators (`Formatters.separators`)\n * @returns the parsed value; `undefined` for an empty buffer; `null` when unrecognised\n */\nexport function parseQuantity(text: string, separators: NumberSeparators): number | null | undefined {\n    const t = normalised(text, separators);\n    if (t === \"\") return undefined;\n    const m = /^(-?\\d+)(?:\\.(\\d+))?(k|m)?$/.exec(t);\n    if (m === null) return null;\n    // The suffix's digits move from the fraction to the whole part, padded with zeros, so the number is read once.\n    const shift = m[3] === \"k\" ? 3 : m[3] === \"m\" ? 6 : 0;\n    const fraction = (m[2] ?? \"\").padEnd(shift, \"0\");\n    const n = Number(`${m[1]}${fraction.slice(0, shift)}.${fraction.slice(shift)}`);\n    return Number.isFinite(n) ? n : null;\n}\n\n/** What a number field does with a key, by the text it would hold once the key lands. */\nexport type QuantityKey =\n    /** The text is a number, or on its way to one — a lone minus, a trailing decimal separator: the key lands. */\n    | { kind: \"take\" }\n    /** A magnitude suffix completes a number: the field holds the number it reads, so it steps from there (`1.005k` → 1005). */\n    | { kind: \"read\"; n: number }\n    /** The grammar never reads it. */\n    | { kind: \"refuse\" };\n\n/**\n * What a number field does with a typed key (B§3) — the grammar decides, not\n * the field's own format, so a `k`, an `m` and a decimal separator are never\n * dropped without a word. A fraction in an integer column is taken: the\n * strip calls it unrecognised and the commit refuses it, where dropping its\n * point turned `2.5` into 25.\n *\n * @param text - The field's text once the key lands at the caret\n * @param separators - The viewer's language's separators (`Formatters.separators`)\n * @returns whether the key lands, completes a number the field then holds, or is refused\n */\nexport function typedQuantity(text: string, separators: NumberSeparators): QuantityKey {\n    const t = normalised(text, separators);\n    if (/^-?\\d*(?:\\.\\d*)?$/.test(t)) return { kind: \"take\" };\n    const n = /[km]$/.test(t) ? parseQuantity(text, separators) : null;\n    return n === null || n === undefined ? { kind: \"refuse\" } : { kind: \"read\", n };\n}\n\n/** The bare clipboard / edit form of a number — no grouping, no unit, the\n *  viewer's decimal separator: `1234.5`, `1234,5` in German (#852). */\nexport function formatNumberBare(n: number, words: Formatters): string {\n    return Number.isFinite(n) ? words.bare(n) : \"\";\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Typing a number into a table cell (#1436, #1438) — the canvas's one input,\n * open on one cell at a time, kept in a small store outside React that the\n * table rows read: a row draws the input only while it holds it, so opening\n * and moving it renders the rows it leaves and joins, never the canvas.\n *\n * - **Which cells.** At the Plan's finest zoom, a position its row says takes\n *   a typed number (`edits.values`), in a bucket holding one of its own values\n *   — written at that value's date, so it replaces it — or none, written at the\n *   bucket's start. A coarser cell is a summary of the values beneath it, and\n *   takes none: its tooltip says to zoom to the finest, and a double click or\n *   Enter on it zooms there, about its period. A parent's position drawing its\n *   children's subtotals takes none, and nor does a bucket folding several\n *   values: its tooltip names the resolution they are at, and the Plan's zoom\n *   showing them apart, where it has one.\n * - **The text.** The value as its position's format reads it: a percent's\n *   `0.82` opens as `82`, and `82` or `82%` writes `0.82`; digit groups, the\n *   viewer's decimal separator and a `k` or `m` read as the Sheet's grammar\n *   reads them (#852). A position over Integers takes whole numbers only.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useSyncExternalStore } from \"react\";\nimport type { Formatters, TickFormatOpt } from \"@elaraai/east-ui-components\";\nimport { parseQuantity } from \"../../sheet/parse/quantity.js\";\nimport type { TimeResolution } from \"../../shared/time/calendar-math.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport type { RowKey } from \"../plan-state.js\";\n\n/** A cell a typed number goes into: its row, its position among the row's table series, and its bucket as `data-cell` names it. */\nexport interface PlanTypingCell {\n    readonly rowKey: RowKey;\n    readonly position: number;\n    readonly cell: string;\n}\n\n/** The input open on a cell, and the key that opened it, typed in as it opens. */\nexport interface PlanTypingOpen extends PlanTypingCell {\n    readonly seed: string | undefined;\n}\n\n/** A number typed into a cell, or the cell cleared — what the canvas's session drafts as one gesture. */\nexport interface PlanTypedValue {\n    readonly rowKey: RowKey;\n    readonly position: number;\n    /** The date the value is written under: the one value the bucket held, so it replaces it; else the bucket's start. */\n    readonly at: PlanInstantValue;\n    /** The bucket as words, as the history's step names it. */\n    readonly bucket: string;\n    /** The number, or `undefined` to clear the cell. */\n    readonly value: number | undefined;\n    /** The number as the cell prints it. */\n    readonly text: string;\n}\n\n/** The canvas's typing, as its table rows reach it (`PlanEditContextValue.typing`). */\nexport interface PlanTyping {\n    /** The one input. */\n    readonly store: PlanTypingStore;\n    /**\n     * Draft a typed number, or a cleared cell, as one step of the session's history.\n     *\n     * @returns Whether the session took it\n     */\n    readonly type: (typed: PlanTypedValue) => boolean;\n    /** Whether a tap on a cell opens the input in a popover anchored to it: below 480px of main. */\n    readonly popover: boolean;\n    /** The resolutions the Plan zooms to, finest first ({@link planZooms}): none, where its axis states none. */\n    readonly zooms: readonly TimeResolution[];\n}\n\n/** A cell focus goes to once a zoom lands: a row's, at the instant its bucket holds, at a resolution. */\nexport interface PlanTypingFocus {\n    readonly rowKey: RowKey;\n    /** The instant, in the axis's numbers. */\n    readonly at: number;\n    readonly resolution: TimeResolution;\n}\n\n/** The canvas's one input: the cell it is open on, if any. */\nexport class PlanTypingStore {\n    #open: PlanTypingOpen | null = null;\n    #focusing: PlanTypingFocus | null = null;\n    readonly #listeners = new Set<() => void>();\n\n    /**\n     * Focus a row's cell as it draws at a resolution: the cell that holds the\n     * instant — once a zoom lands, where a double click or Enter on a coarser\n     * cell zooms to edit it (#1438), or once the window holds it, where a\n     * conflict's Go to moves the window over it. The row hears it, and draws\n     * again to take it.\n     *\n     * @param focus - The row, the instant and the resolution\n     */\n    focusOnZoom(focus: PlanTypingFocus): void {\n        this.#focusing = focus;\n        this.#emit();\n    }\n\n    /** The focus a row's cells wait to take, if any ({@link takeFocus}). */\n    get focusing(): PlanTypingFocus | null {\n        return this.#focusing;\n    }\n\n    /**\n     * The focus a row's cells take as they draw at a resolution, taken once:\n     * the instant its cell holds, where the zoom landed on that row — once\n     * its window holds the instant, where a Go to moved the window over it.\n     *\n     * @param rowKey - The row drawing\n     * @param resolution - The resolution it draws at\n     * @param holds - Whether the row's window holds an instant: until it does, the focus waits\n     * @returns The instant, or `undefined` where no focus waits for it\n     */\n    takeFocus(rowKey: RowKey, resolution: TimeResolution | undefined, holds?: (at: number) => boolean): number | undefined {\n        const focusing = this.#focusing;\n        if (focusing === null || focusing.rowKey !== rowKey || focusing.resolution !== resolution) return undefined;\n        if (holds !== undefined && !holds(focusing.at)) return undefined;\n        this.#focusing = null;\n        return focusing.at;\n    }\n\n    /** The cell the input is open on. */\n    get open(): PlanTypingOpen | null {\n        return this.#open;\n    }\n\n    /**\n     * Hear the input open, move or close.\n     *\n     * @param listener - Called on each change\n     * @returns The unsubscribe\n     */\n    readonly subscribe = (listener: () => void): (() => void) => {\n        this.#listeners.add(listener);\n        return () => { this.#listeners.delete(listener); };\n    };\n\n    /**\n     * Open the input on a cell.\n     *\n     * @param cell - The cell\n     * @param seed - The key that opened it, typed in as it opens\n     */\n    openAt(cell: PlanTypingCell, seed?: string): void {\n        this.#open = { ...cell, seed };\n        this.#emit();\n    }\n\n    /** Close the input. */\n    close(): void {\n        if (this.#open === null) return;\n        this.#open = null;\n        this.#emit();\n    }\n\n    #emit(): void {\n        for (const listener of this.#listeners) listener();\n    }\n}\n\nconst NO_SUBSCRIPTION = () => () => {};\n\n/**\n * The input, while a row holds it.\n *\n * @param store - The canvas's input, or `undefined` while it takes no typing\n * @param rowKey - The row\n * @returns The open input, or `null` for every row but the one it is open on\n */\nexport function usePlanTypingOpen(store: PlanTypingStore | undefined, rowKey: RowKey): PlanTypingOpen | null {\n    const subscribe = useCallback((listener: () => void) => store?.subscribe(listener) ?? (() => {}), [store]);\n    return useSyncExternalStore(store !== undefined ? subscribe : NO_SUBSCRIPTION, () => (store?.open?.rowKey === rowKey ? store.open : null));\n}\n\n/**\n * The focus a row's cells wait to take: what draws the row again as a focus\n * is asked of it, so it takes it as it draws ({@link PlanTypingStore.takeFocus}).\n *\n * @param store - The canvas's input, or `undefined` while it takes no typing\n * @param rowKey - The row\n * @returns The focus asked of the row, or `null`\n */\nexport function usePlanTypingFocus(store: PlanTypingStore | undefined, rowKey: RowKey): PlanTypingFocus | null {\n    const subscribe = useCallback((listener: () => void) => store?.subscribe(listener) ?? (() => {}), [store]);\n    return useSyncExternalStore(store !== undefined ? subscribe : NO_SUBSCRIPTION, () => (store?.focusing?.rowKey === rowKey ? store.focusing : null));\n}\n\n/** A percent prints its value a hundred times over, so its text reads back divided. */\nconst isPercent = (format: TickFormatOpt): boolean => format?.type === \"percent\";\n\n/** A number to fifteen significant digits: a percent's `0.07` is `7`, never `7.000000000000001`. */\nconst significant = (n: number): number => Number(n.toPrecision(15));\n\n/**\n * The text a cell's input opens on: its value as its format reads it — a\n * percent's `0.82` as `82` — bare, in the viewer's language, never grouped.\n *\n * @param value - The cell's value, or `undefined` for an empty cell\n * @param format - Its position's format\n * @param words - The canvas's formatters\n * @returns The text\n */\nexport function typedText(value: number | undefined, format: TickFormatOpt, words: Formatters): string {\n    if (value === undefined) return \"\";\n    return words.bare(isPercent(format) ? significant(value * 100) : value);\n}\n\n/**\n * What a cell's typed text writes: the number its format reads it as — a\n * percent's `82` or `82%` as `0.82` — through the Sheet's grammar in the\n * viewer's language (#852).\n *\n * @param text - The typed text\n * @param format - Its position's format\n * @param words - The canvas's formatters\n * @returns The number, `undefined` for no text (the cell cleared), or `null` for text that is no number\n */\nexport function readTyped(text: string, format: TickFormatOpt, words: Formatters): number | null | undefined {\n    const percent = isPercent(format);\n    const n = parseQuantity(percent ? text.replace(/%/g, \"\") : text, words.separators);\n    if (n === null || n === undefined) return n;\n    return percent ? significant(n / 100) : n;\n}\n\nconst DAY_MS = 86_400_000;\n\n/**\n * The resolution a position's values are at, from the least gap between two\n * of them — what a bucket folding several of them names, so its tooltip says\n * where they take typing.\n *\n * @param instants - The values' instants, in epoch milliseconds, in their keys' order\n * @returns The resolution, or `undefined` with fewer than two of them\n */\nexport function resolutionOfValues(instants: readonly number[]): TimeResolution | undefined {\n    // A collection's values come in its keys' order, so the least gap is between neighbours.\n    let least = Infinity;\n    for (let i = 1; i < instants.length; i++) {\n        const gap = Math.abs(instants[i]! - instants[i - 1]!);\n        if (gap > 0 && gap < least) least = gap;\n    }\n    if (least === Infinity) return undefined;\n    return least < DAY_MS ? \"hour\" : least < 7 * DAY_MS ? \"day\" : least < 28 * DAY_MS ? \"week\"\n        : least < 89 * DAY_MS ? \"month\" : least < 365 * DAY_MS ? \"quarter\" : \"year\";\n}\n\n/** The time resolutions, from the finest. */\nconst RESOLUTIONS: readonly TimeResolution[] = [\"hour\", \"day\", \"week\", \"month\", \"quarter\", \"year\"];\n\n/** A resolution's place among them, the finest first. */\nconst rankOf = (resolution: TimeResolution): number => RESOLUTIONS.indexOf(resolution);\n\n/**\n * The resolutions a Plan zooms to (#1438): its resolution segment's, and the\n * one its axis opens at — but `auto`, which is none of them.\n *\n * @param segment - The resolution segment's resolutions\n * @param opened - The resolution the axis opens at\n * @returns Them, the finest first\n */\nexport function planZooms(segment: readonly string[], opened: string | undefined): readonly TimeResolution[] {\n    const named = new Set<string>(opened === undefined ? segment : [...segment, opened]);\n    return RESOLUTIONS.filter((resolution) => named.has(resolution));\n}\n\n/**\n * Whether a table cell takes a typed number at a zoom (#1438): at the Plan's\n * finest zoom alone, where a cell holds at most the values of its own bucket.\n * A coarser cell is a summary of the values beneath it — a number typed there\n * would stand for none of them — so it takes none. On an axis of no\n * resolution, every cell takes one.\n *\n * @param zoom - The resolution the Plan shows\n * @param zooms - The resolutions it zooms to, the finest first\n * @returns Whether its cells take one\n */\nexport function typesAt(zoom: TimeResolution | undefined, zooms: readonly TimeResolution[]): boolean {\n    const finest = zooms[0];\n    return zoom === undefined || finest === undefined || rankOf(zoom) <= rankOf(finest);\n}\n\n/**\n * The zoom a bucket folding values one each `each` shows them apart at, of\n * the Plan's (#1438): the coarsest no coarser than they are. None where none\n * is, so a bucket never names a zoom the Plan lacks.\n *\n * @param each - The resolution the values are at\n * @param zooms - The resolutions the Plan zooms to, the finest first\n * @returns The zoom, or `undefined` where no zoom of the Plan's shows them apart\n */\nexport function zoomApart(each: TimeResolution | undefined, zooms: readonly TimeResolution[]): TimeResolution | undefined {\n    if (each === undefined) return undefined;\n    return [...zooms].reverse().find((zoom) => rankOf(zoom) <= rankOf(each));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The canvas's one input over a table cell (#1436, #1438): the common number\n * field, as the Sheet's cells use it, at the cell's column and the row's\n * height, the brand ring its chrome, its text in the table's numerals. It\n * draws no stepper: a column holds the number and little more.\n *\n * - Enter writes it; Esc leaves the cell as it was; a blur writes it, and so\n *   does its unmounting with a number unwritten — its series hidden, its row\n *   gone — where a browser sends no blur (#1440).\n * - ↑ and ↓ step the number, as the Sheet's field steps one; Tab and\n *   Shift+Tab write it and move along the row's cells that take a number.\n * - Text that reads as no number, or a fraction where the values are whole, is\n *   refused, in words under the field and the ring in the neg tone; a field\n *   over whole numbers takes digits and a leading minus alone, as the common\n *   integer input does.\n * - Below 480px of main it is drawn in a popover anchored to its cell, a\n *   field of its own at a row's height, its keys as above.\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent, type SyntheticEvent } from \"react\";\nimport { Box, NumberInput as ChakraNumberInput } from \"@chakra-ui/react\";\nimport { usePlanWords } from \"../words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** Where the input goes once it writes: back to its cell (Enter), nowhere (a blur), or along the row. */\nexport type PlanCellInputMove = \"stay\" | \"leave\" | \"next\" | \"previous\";\n\n/**\n * The field's own format, in the viewer's language (#852): the bare edit\n * form, never grouped, to fifteen significant digits — as the Sheet's.\n */\nconst NUMBER_FORMAT: Intl.NumberFormatOptions = { useGrouping: false, maximumSignificantDigits: 15 };\n/** A field over whole numbers: every digit, none after the point. */\nconst INTEGER_FORMAT: Intl.NumberFormatOptions = { useGrouping: false, maximumFractionDigits: 0 };\n\n/** The keys that write the field, and where each moves it; ↑ and ↓ are the field's own, which step it. */\nfunction moveOf(e: KeyboardEvent<HTMLInputElement>): PlanCellInputMove | undefined {\n    switch (e.key) {\n        case \"Enter\": return \"stay\";\n        case \"Tab\": return e.shiftKey ? \"previous\" : \"next\";\n        default: return undefined;\n    }\n}\n\n/** Props of {@link PlanCellInput}. */\nexport interface PlanCellInputProps {\n    /** The Plan recipe's styles. */\n    styles: Styles;\n    /** Its column's left edge, as a window fraction — none inside a popover, which places it. */\n    x0?: number | undefined;\n    /** Its column's right edge, as a window fraction. */\n    x1?: number | undefined;\n    /** The text it opens on: the cell's value as its format reads it. */\n    text: string;\n    /** A key that opened it, typed in place of the text. */\n    seed: string | undefined;\n    /** The values are whole numbers: a fraction is refused. */\n    whole: boolean;\n    /** Its accessible name. */\n    name: string;\n    /** What a text reads as: a number, `undefined` for none (the cell cleared), `null` for no number. */\n    read: (text: string) => number | null | undefined;\n    /** It wrote a number, or cleared the cell, and moves on. */\n    onWrite: (value: number | undefined, move: PlanCellInputMove, input: HTMLElement) => void;\n    /** It closed with the cell as it was: Esc. */\n    onCancel: (input: HTMLElement) => void;\n    /** It is drawn in a popover anchored to its cell, which places it. */\n    popover?: boolean | undefined;\n}\n\n/** Stop an event at the input: its cell's click selects the row and opens the root's popover, and the field takes none. */\nconst stop = (e: SyntheticEvent) => e.stopPropagation();\n\n/** Renders the canvas's input over a table cell. */\nexport function PlanCellInput({ styles, x0, x1, text, seed, whole, name, read, onWrite, onCancel, popover }: PlanCellInputProps) {\n    const words = usePlanWords();\n    const [value, setValue] = useState(seed ?? text);\n    const [refusal, setRefusal] = useState<string | undefined>(undefined);\n    const inputRef = useRef<HTMLInputElement | null>(null);\n    // Written or cancelled: the blur its unmounting sends is not the planner leaving.\n    const done = useRef(false);\n    // A passive effect, after the field's own: its machine has started. A digit that opened it stays, the caret after\n    // it; else its text is selected, to type over.\n    useEffect(() => {\n        const el = inputRef.current;\n        if (el === null) return;\n        el.focus({ preventScroll: true });\n        if (seed === undefined) el.select();\n        else el.setSelectionRange(el.value.length, el.value.length);\n    }, [seed]);\n    const write = (move: PlanCellInputMove): boolean => {\n        const n = read(value);\n        if (n === null) { setRefusal(words.m.typedNotNumber()); return false; }\n        if (n !== undefined && whole && !Number.isInteger(n)) { setRefusal(words.m.typedNotWhole()); return false; }\n        done.current = true;\n        onWrite(n, move, inputRef.current!);\n        return true;\n    };\n    const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n        // The canvas takes no key typed here.\n        e.stopPropagation();\n        if (e.key === \"Escape\") {\n            e.preventDefault();\n            done.current = true;\n            onCancel(e.currentTarget);\n            return;\n        }\n        const move = moveOf(e);\n        if (move !== undefined) {\n            e.preventDefault();\n            write(move);\n            return;\n        }\n        // Over whole numbers, digits and a leading minus, as the common integer input takes them.\n        if (whole) {\n            const control = e.key.length > 1 || e.metaKey || e.ctrlKey || e.altKey;\n            const minus = e.key === \"-\" && e.currentTarget.selectionStart === 0 && !e.currentTarget.value.includes(\"-\");\n            if (!control && !minus && !/^\\d$/.test(e.key)) e.preventDefault();\n        }\n    };\n    const onBlur = () => {\n        if (done.current) return;\n        // Leaving with text that reads as no number leaves the cell as it was.\n        if (!write(\"leave\") && inputRef.current !== null) {\n            done.current = true;\n            onCancel(inputRef.current);\n        }\n    };\n    // What a blur would write, as the field stands now: what its unmounting writes, below.\n    const leave = useRef<(el: HTMLElement) => void>(() => undefined);\n    useLayoutEffect(() => {\n        leave.current = (el) => {\n            if (done.current) return;\n            const n = read(value);\n            // Text that reads as no number leaves the cell as it was, as a blur does.\n            if (n === null || (n !== undefined && whole && !Number.isInteger(n))) return;\n            done.current = true;\n            onWrite(n, \"leave\", el);\n        };\n    });\n    // Unmounted holding a number it has not written — its series hidden, its row gone with it — it writes the number as\n    // a blur would: a browser sends no blur to a field it removes, and the number was lost (#1440). A microtask later,\n    // and only if it has not mounted again: StrictMode unmounts every effect once as it mounts, which is no leaving.\n    const mounted = useRef(false);\n    useEffect(() => {\n        const el = inputRef.current;\n        mounted.current = true;\n        return () => {\n            mounted.current = false;\n            queueMicrotask(() => { if (!mounted.current && el !== null) leave.current(el); });\n        };\n    }, []);\n    return (\n        <Box css={styles.tableCellInput} data-plan-typing=\"\" data-invalid={refusal !== undefined ? \"\" : undefined}\n            data-popover={popover === true ? \"\" : undefined}\n            style={{ left: x0 !== undefined ? `${x0 * 100}%` : undefined, width: x0 !== undefined && x1 !== undefined ? `${(x1 - x0) * 100}%` : undefined }}\n            onMouseDown={stop} onClick={stop} onDoubleClick={stop}>\n            <ChakraNumberInput.Root css={styles.tableCellField} value={value} locale={words.locale}\n                formatOptions={whole ? INTEGER_FORMAT : NUMBER_FORMAT}\n                inputMode={whole ? \"numeric\" : \"decimal\"}\n                onValueChange={(d) => { setValue(d.value); setRefusal(undefined); }}>\n                <ChakraNumberInput.Input ref={inputRef} css={styles.tableCellFieldInput} aria-label={name}\n                    aria-invalid={refusal !== undefined} onKeyDown={onKeyDown} onBlur={onBlur} />\n            </ChakraNumberInput.Root>\n            {refusal !== undefined && <Box css={styles.tableCellRefusal} role=\"alert\">{refusal}</Box>}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The measured client size of an element, tracked through resizes.\n *\n * The HEIGHT exists for the R2 height clamp (#591). v2 sizes the\n * expand-in-place render as `min(renderHeight, canvas − strips − ruler)` — the\n * render takes what the row's declaration asks for, but never so much that the\n * context strips it exists to preserve are pushed out of view. That\n * subtraction needs a real pixel canvas, and the Plan's own `height` /\n * `maxHeight` cannot supply one: they are CSS strings (`\"fill\"` → `\"100%\"`,\n * `calc(...)`, a token) resolved by layout, not by us. So the viewport is\n * measured rather than parsed — the scroll element `VirtualRows` hands back\n * through `scrollElRef`. The links layer reads the same view to clamp its\n * ribbons (#818).\n *\n * The WIDTH is the links layer's (#818): a ribbon's x is a run's window\n * fraction across the plot, and the plot's px are the layer's width less the\n * grid's fixed tracks.\n *\n * `undefined` until first measure, and while the element is absent (an\n * unbounded frame has no scroll element — the body grows to content, and\n * nothing needs clamping).\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useState, type RefObject } from \"react\";\n\nconst heightOf = (el: HTMLElement): number => el.clientHeight;\nconst widthOf = (el: HTMLElement): number => el.clientWidth;\n\n/**\n * Track one client dimension of an element.\n *\n * @param ref - The element to measure\n * @param active - Skip observing entirely when false\n * @param read - The dimension\n * @returns The measured px, or `undefined` when there is nothing to measure\n */\nfunction useClientSize(\n    ref: RefObject<HTMLElement | null>,\n    active: boolean,\n    read: (el: HTMLElement) => number,\n): number | undefined {\n    const [px, setPx] = useState<number | undefined>(undefined);\n    // A PASSIVE effect, deliberately: a layout effect's `setPx` schedules a\n    // nested commit even when the value is unchanged (the #815 lesson), and\n    // the reading's consumers — a focus, the links layer — open on a click,\n    // whose effects React flushes before the frame paints anyway.\n    useEffect(() => {\n        if (!active) {\n            // Drop the stale reading rather than keep it: a clamp computed\n            // against the height the canvas had during the LAST focus would\n            // silently mis-size the next one after a resize in between.\n            setPx(undefined);\n            return;\n        }\n        const el = ref.current;\n        if (el === null) {\n            setPx(undefined);\n            return;\n        }\n        // Seed synchronously — the observer's first callback is async.\n        setPx(read(el));\n        if (typeof ResizeObserver === \"undefined\") return;\n        const ro = new ResizeObserver(() => setPx(read(el)));\n        ro.observe(el);\n        return () => ro.disconnect();\n        // `ref` is stable and `read` a module constant; `active` gates the whole effect.\n    }, [ref, active, read]);\n    return px;\n}\n\n/**\n * Track an element's `clientHeight`.\n *\n * @param ref - The element to measure (`null` while unmounted / unbounded)\n * @param active - Skip observing entirely when false (no focus, nothing to clamp)\n * @returns The measured height in px, or `undefined` when there is nothing to measure\n */\nexport function useElementHeight(ref: RefObject<HTMLElement | null>, active: boolean): number | undefined {\n    return useClientSize(ref, active, heightOf);\n}\n\n/**\n * Track an element's `clientWidth`.\n *\n * @param ref - The element to measure\n * @param active - Skip observing entirely when false\n * @returns The measured width in px, or `undefined` when there is nothing to measure\n */\nexport function useElementWidth(ref: RefObject<HTMLElement | null>, active: boolean): number | undefined {\n    return useClientSize(ref, active, widthOf);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Table rows (`Plan Spec.md` §4·K5) — bucketed numerals on the shared scale,\n * MULTI-SERIES per cell: each series carries its own raw cells plus the\n * position's style declarations (format / tone / strong — declared once per\n * series, never per cell). The renderer joins series by bucket and lays the\n * parts out per the row's `split` (side by side, or stacked lines on a grown\n * row). Per part: explicit `text`/`tone` overrides win; else the value prints\n * through `series.format ?? row.format`, negatives tone `neg`, missing values\n * the muted em-dash, and the series' declared tone covers the rest. Subtotal\n * parents render their renderer-DERIVED cells as one plain series; row\n * emphasis (header / footer) rides the shell's `data-emphasis`. A bucket's\n * cell names its bucket instant (`data-cell`), so the canvas's one overlay\n * layer opens the root's popover and hover card for it (#816). It is a button\n * named by its bucket and the numerals it prints (#819) — the em-dash of a\n * missing value said as words. Its numerals are drawn together, whole, or not\n * at all where the cell is narrower than they are, its hover then saying them\n * (#1269) — and, where it holds a value, a dot in their place, so no value\n * leaves its cell looking empty (#1438): the row measures its plot's width\n * beside its cells, and a cell knows its numerals' width from their length,\n * the table's numerals being of one width.\n *\n * A position its row says takes a typed number (#1436, #1438) takes one, at\n * the Plan's finest zoom, in each bucket holding one of its own values —\n * written at that value's date, so it replaces it — or none, written at its\n * start, while the canvas takes typing: every bucket in the window then draws\n * a cell. Enter, F2, a double click or a digit opens the canvas's one input\n * over the cell ({@link PlanCellInput}); below 480px of main a tap opens it, in\n * a popover anchored to the cell. At a coarser zoom each cell is a summary of\n * the values beneath it and takes none: its tooltip says to zoom to the\n * finest, and a double click, Enter or a tap on it zooms there, about its\n * period, focus landing on the row's cell at its middle. A parent's position\n * drawing its children's subtotals takes none, and a bucket folding several\n * values says, as its tooltip, the resolution they are at and the Plan's zoom\n * showing them apart, where it has one.\n */\n\nimport { useLayoutEffect, useMemo, useRef, type KeyboardEvent } from \"react\";\nimport { FloatType, equalFor, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Box, Popover, Portal } from \"@chakra-ui/react\";\nimport { frameBounds } from \"@elaraai/east-ui-components/internal\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { usePlanDispatch, usePlanResolvers, usePlanScale, type PlanElementRefValue } from \"../context.js\";\nimport type { TickFormatOpt } from \"@elaraai/east-ui-components\";\nimport { ToneStrip, type ToneDatum } from \"./ToneStrip.js\";\nimport type { PlanBucket, PlanScale } from \"../scale.js\";\nimport { instantKey, timeInstant } from \"../instant.js\";\nimport { usePlanRowConflicts } from \"./element-draft.js\";\nimport { usePlanEdit } from \"../edit/store.js\";\nimport { readTyped, resolutionOfValues, typedText, typesAt, usePlanTypingFocus, usePlanTypingOpen, zoomApart } from \"../edit/typing.js\";\nimport type { TimeResolution } from \"../../shared/time/calendar-math.js\";\nimport { PlanCellInput, type PlanCellInputMove } from \"./CellInput.js\";\nimport { cellName, tablePartsText } from \"../a11y.js\";\nimport type { PlanRowId } from \"../model.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { useElementWidth } from \"../use-element-height.js\";\nimport { maxOf } from \"../reductions.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype TableCellValue = ValueTypeOf<typeof Plan.Types.TableCell>;\ntype TableSeriesValue = ValueTypeOf<typeof Plan.Types.TableSeries>;\ntype TypedPositionValue = ValueTypeOf<typeof Plan.Types.TypedPosition>;\n\nexport interface TableRowCellsProps {\n    rowKey: string;\n    /** The row's id — what an element click names the row by (#822). */\n    rowId: PlanRowId;\n    /** The rendered series — the row's own, or its derived subtotal positions. */\n    series: readonly TableSeriesValue[];\n    /** The part layout (visible only with more than one series). */\n    split: \"horizontal\" | \"vertical\";\n    /** The ROW's shared format (a series' own format overrides per position). */\n    format: TickFormatOpt;\n    /** R2 context strip (#591) — re-encode as a tone strip; see {@link ToneStrip}. */\n    ctx?: boolean | undefined;\n    styles: Styles;\n    /** The positions that take a typed number (#1436, #1438): the row's `edits.values`. */\n    typed?: readonly TypedPositionValue[] | undefined;\n    /** The row's own series as declared — before its children's subtotals or a fold stand in for them: which buckets take typing. */\n    own?: readonly TableSeriesValue[] | undefined;\n    /** Whether the row has children: a position drawing their subtotals takes no typing. */\n    parent?: boolean | undefined;\n}\n\n/** A position that takes typing on a row: whether its values are whole, how many of its own each bucket holds, and the resolution they are at. */\ninterface Typeable {\n    readonly position: number;\n    readonly whole: boolean;\n    readonly held: ReadonlyMap<number, number>;\n    readonly resolution: TimeResolution | undefined;\n}\n\nconst NO_TYPEABLES: readonly Typeable[] = [];\nconst sameNumber = equalFor(FloatType);\n\n/** The positions of a row that take typing (#1438), each with how many of its own values each bucket holds. */\nfunction typeablesOf(scale: PlanScale, typed: readonly TypedPositionValue[], own: readonly TableSeriesValue[], parent: boolean): readonly Typeable[] {\n    return typed.flatMap((t) => {\n        const position = Number(t.position);\n        const declared = own[position];\n        // A parent's position with no values of its own draws its children's subtotals: those take none.\n        if (declared === undefined || (parent && declared.cells.length === 0)) return [];\n        const held = new Map<number, number>();\n        const times: number[] = [];\n        for (const c of declared.cells) {\n            if (c.at.type === \"time\") times.push(c.at.value.getTime());\n            const b = scale.renderBucketOf(c.at);\n            if (b !== undefined) held.set(b.index, (held.get(b.index) ?? 0) + 1);\n        }\n        return [{ position, whole: t.whole, held, resolution: resolutionOfValues(times) }];\n    });\n}\n\n/** The position a double click or a tap lands on: the part under it where that one takes typing, else the cell's first. */\nfunction positionAt(target: EventTarget, here: readonly Typeable[]): number {\n    const part = target instanceof Element ? target.closest(\"[data-part]\")?.getAttribute(\"data-part\") : undefined;\n    const hit = part !== undefined && part !== null ? here.find((t) => t.position === Number(part)) : undefined;\n    return (hit ?? here[0]!).position;\n}\n\n/** The table-row plot content — per-bucket cells of series-joined parts. */\n/** A numeral's width in the table's numerals, in px: 10.5px type, of one width, about 0.62em a character. */\nconst NUMERAL_PX = 6.5;\n/** A cell's inset either side of its numerals, in px. */\nconst CELL_INSET_PX = 4;\n/** The gap between two parts drawn side by side, in px. */\nconst PART_GAP_PX = 6;\n\n/**\n * How wide a cell's numerals draw, in px: its parts side by side, or the\n * widest of them where they stack.\n *\n * @param texts - Each part's text\n * @param split - How the parts lay out\n * @returns The width\n */\nfunction numeralsPx(texts: readonly string[], split: \"horizontal\" | \"vertical\"): number {\n    const widths = texts.map((text) => text.length * NUMERAL_PX);\n    const inner = split === \"vertical\" ? Math.max(0, maxOf(widths)) : widths.reduce((a, w) => a + w, 0) + PART_GAP_PX * Math.max(0, texts.length - 1);\n    return inner + 2 * CELL_INSET_PX;\n}\n\nexport function TableRowCells({ rowKey, rowId, series, split, format, styles, ctx, typed, own, parent }: TableRowCellsProps) {\n    const scale = usePlanScale();\n    const dispatch = usePlanDispatch();\n    const words = usePlanWords();\n    const { onElementClick } = usePlanResolvers();\n    // Typing (#1436, #1438): never inside a context strip, and only while the canvas takes it.\n    const edit = usePlanEdit();\n    const typing = ctx === true ? undefined : edit?.typing;\n    const open = usePlanTypingOpen(typing?.store, rowKey);\n    // A focus asked of the row draws it again, to take it as it draws.\n    usePlanTypingFocus(typing?.store, rowKey);\n    // The instants its conflicts are at, not yet chosen: the cells holding them wear the warn ring.\n    const conflictsAt = usePlanRowConflicts(rowKey);\n    // The cells by their bucket, which a popover of the input anchors to below 480px of main; and the popover, whose width\n    // says whether it keeps to the frame's sides.\n    const cellEls = useRef(new Map<string, HTMLElement>());\n    const popoverRef = useRef<HTMLDivElement | null>(null);\n    // The plot's width, which each cell's share of it says whether its numerals fit: unknown before it is laid out.\n    const measureRef = useRef<HTMLDivElement | null>(null);\n    const plotPx = useElementWidth(measureRef, true);\n    const typeables = useMemo(\n        () => (typing !== undefined && typed !== undefined && typed.length > 0 ? typeablesOf(scale, typed, own ?? series, parent === true) : NO_TYPEABLES),\n        [typing, typed, own, series, parent, scale]);\n    // The Plan's zooms, the finest first: its axis's, or, where it states none, the one it shows.\n    const zooms = typing === undefined ? [] : typing.zooms.length > 0 ? typing.zooms : scale.resolution !== undefined ? [scale.resolution] : [];\n    // At the Plan's finest zoom a bucket takes a typed number holding one value of the position's own, or none; coarser,\n    // each cell is a summary, which takes none.\n    const types = typesAt(scale.resolution, zooms);\n    const takesAt = (t: Typeable, bucket: number): boolean => types && (t.held.get(bucket) ?? 0) <= 1;\n    // A zoom from a coarser cell of this row lands on its cell holding the period's middle, once it draws; a conflict's\n    // Go to on its cell holding the conflict's instant, once the window it moved holds it.\n    useLayoutEffect(() => {\n        const at = typing?.store.takeFocus(rowKey, scale.resolution, (n) => scale.bucketOf(scale.fromNumber(n)) >= 0);\n        if (at === undefined) return;\n        const b = scale.renderBucketOf(scale.fromNumber(at));\n        if (b !== undefined) cellEls.current.get(instantKey(b.start))?.focus({ preventScroll: true });\n    });\n    /** Zoom to the Plan's finest zoom about a coarser cell's period, to edit it there. */\n    const zoomInto = (b: PlanBucket, finest: TimeResolution) => {\n        const about = (scale.toNumber(b.start) + scale.toNumber(b.end)) / 2;\n        typing?.store.focusOnZoom({ rowKey, at: about, resolution: finest });\n        dispatch({ t: \"resolution.set\", resolution: finest, about });\n    };\n    // ── R2 (#591): numerals have no small form ──\n    // The ROLLUP position is the one that carries the row's headline number\n    // (`tableRollupSeries`' contract), so it is the one the strip encodes —\n    // a multi-value row shows the shape of its primary series, not an\n    // arbitrary overlay of all of them.\n    if (ctx === true) {\n        const primary = series.find((x) => x.rollup) ?? series[0];\n        const data: ToneDatum[] = (primary?.cells ?? []).map((c) => ({\n            at: c.at,\n            value: c.value.type === \"some\" ? c.value.value : undefined,\n            tone: c.tone.type === \"some\" && c.tone.value.type === \"neg\" ? \"neg\"\n                : c.value.type === \"some\" && c.value.value < 0 ? \"neg\"\n                : undefined,\n        }));\n        return <ToneStrip data={data} styles={styles} />;\n    }\n    // Join the series by bucket — parts arrive in series order; a series\n    // without a cell in a bucket simply contributes nothing there. RENDER\n    // bucketing (#619): overscan cells join and mount too, clipped at rest.\n    const bucketByIndex = new Map<number, PlanBucket>();\n    const buckets = new Map<number, { si: number; cell: TableCellValue }[]>();\n    series.forEach((s, si) => {\n        for (const c of s.cells) {\n            const b = scale.renderBucketOf(c.at);\n            if (b === undefined) continue;\n            bucketByIndex.set(b.index, b);\n            const list = buckets.get(b.index);\n            if (list !== undefined) list.push({ si, cell: c });\n            else buckets.set(b.index, [{ si, cell: c }]);\n        }\n    });\n    // Over a row taking typing, every bucket in the window draws a cell, so an empty one takes a first value.\n    if (typeables.length > 0) {\n        for (const b of scale.buckets) {\n            if (buckets.has(b.index)) continue;\n            bucketByIndex.set(b.index, b);\n            buckets.set(b.index, []);\n        }\n    }\n    const multi = series.length > 1;\n    /** Whether a bucket holds a conflict not yet chosen: its period holds an instant one names. */\n    const holdsConflict = (b: PlanBucket): boolean => {\n        const from = scale.toNumber(b.start), to = scale.toNumber(b.end);\n        return conflictsAt.some((at) => { const n = scale.toNumber(timeInstant(at)); return n >= from && n < to; });\n    };\n    /** The cells along the row that take typing, in order: each bucket's positions, left to right. */\n    const along = (): { cell: string; position: number }[] => [...bucketByIndex.values()]\n        .sort((a, b) => a.index - b.index)\n        .flatMap((b) => typeables.filter((t) => takesAt(t, b.index)).map((t) => ({ cell: instantKey(b.start), position: t.position })));\n    // The input, where it is open on this row: its bucket and its position, while both still take typing.\n    const openBucket = open !== null ? [...bucketByIndex.values()].find((b) => instantKey(b.start) === open.cell) : undefined;\n    const openTypeable = open !== null && openBucket !== undefined\n        ? typeables.find((t) => t.position === open.position && takesAt(t, openBucket.index)) : undefined;\n    const input = (() => {\n        if (typing === undefined || open === null || openBucket === undefined || openTypeable === undefined) return null;\n        const b = openBucket;\n        const position = openTypeable.position;\n        const s = series[position];\n        const partFormat = s !== undefined && s.format.type === \"some\" ? s.format.value : format;\n        const held = (own ?? series)[position]?.cells.find((c) => scale.renderBucketOf(c.at)?.index === b.index);\n        const current = held !== undefined && held.value.type === \"some\" ? held.value.value : undefined;\n        // The cell it is open on: where focus goes back to, and where a move across the rows starts — the input itself\n        // may be in a popover, outside the rows.\n        const cellOf = () => cellEls.current.get(open.cell);\n        const onWrite = (value: number | undefined, move: PlanCellInputMove) => {\n            const unchanged = value === undefined ? current === undefined : current !== undefined && sameNumber(value, current);\n            if (!unchanged) {\n                // Over the one value the bucket held, at its date, so the number replaces it.\n                typing.type({\n                    rowKey, position, at: held?.at ?? b.start, bucket: scale.bucketText(b), value,\n                    text: value !== undefined ? words.value(value, partFormat) : \"\",\n                });\n            }\n            if (move === \"next\" || move === \"previous\") {\n                const cells = along();\n                const at = cells.findIndex((c) => c.cell === open.cell && c.position === position);\n                const next = cells[at + (move === \"next\" ? 1 : -1)];\n                if (next !== undefined) {\n                    typing.store.openAt({ rowKey, ...next });\n                    return;\n                }\n            }\n            const back = move !== \"leave\" ? cellOf() : undefined;\n            typing.store.close();\n            back?.focus({ preventScroll: true });\n        };\n        const onCancel = () => {\n            const back = cellOf();\n            typing.store.close();\n            back?.focus({ preventScroll: true });\n        };\n        const field = (\n            <PlanCellInput key={`${open.cell}|${position}`} styles={styles}\n                x0={typing.popover ? undefined : b.x0} x1={typing.popover ? undefined : b.x1} popover={typing.popover}\n                text={typedText(current, partFormat, words)} seed={open.seed} whole={openTypeable.whole}\n                name={words.m.typedName({ bucket: scale.bucketText(b) })}\n                read={(text) => readTyped(text, partFormat, words)} onWrite={onWrite} onCancel={onCancel} />\n        );\n        if (!typing.popover) return field;\n        // Below 480px of main, in a popover anchored to its cell, kept inside the builder's frame as every popover opened in\n        // one is (#1393): a press outside it closes it, the field's blur having written what it holds. Its bounds are made\n        // as it is placed, its content laid out: Zag copies the positioning it is given as it renders, which would keep\n        // what the bounds read before the popover was there — the page's.\n        const cell = open.cell;\n        const anchor = () => cellEls.current.get(cell) ?? null;\n        return (\n            <Popover.Root key={`${cell}|${position}`} open modal={false}\n                positioning={{ placement: \"bottom\", getAnchorElement: anchor, boundary: () => frameBounds(anchor, () => popoverRef.current) }}\n                onOpenChange={(d) => { if (!d.open) typing.store.close(); }}>\n                <Portal>\n                    <Popover.Positioner>\n                        <Popover.Content ref={popoverRef} css={styles.tableCellPopover} data-plan-typing-popover=\"\">{field}</Popover.Content>\n                    </Popover.Positioner>\n                </Portal>\n            </Popover.Root>\n        );\n    })();\n    return (\n        <>\n            <Box ref={measureRef} css={styles.tableCellMeasure} data-plan-measure=\"\" aria-hidden=\"true\" />\n            {[...buckets.entries()].map(([bi, parts]) => {\n                const b = bucketByIndex.get(bi)!;\n                // The positions taking a number here, at the finest zoom: one value of their own in the bucket, or none.\n                const typedHere = typeables.filter((t) => takesAt(t, bi));\n                const folded = types && typedHere.length === 0 ? typeables.find((t) => (t.held.get(bi) ?? 0) > 1) : undefined;\n                // Coarser, a summary: its tooltip says to zoom to the finest, which a double click, Enter or a tap does.\n                const coarse = !types && typeables.length > 0 ? zooms[0] : undefined;\n                const cell = instantKey(b.start);\n                const openHere = (position: number, seed?: string) => typing?.store.openAt({ rowKey, position, cell }, seed);\n                const takes = typing !== undefined && typedHere.length > 0;\n                const printed = parts.map(({ si, cell }) => {\n                    const s = series[si]!;\n                    const value = cell.value.type === \"some\" ? cell.value.value : undefined;\n                    const partFormat = s.format.type === \"some\" ? s.format.value : format;\n                    const text = cell.text.type === \"some\" ? cell.text.value\n                        // The declared format, in the canvas's locale (#820),\n                        // through the shared interpreter (#850).\n                        : value !== undefined ? words.value(value, partFormat)\n                        : \"—\";\n                    const tone = cell.tone.type === \"some\" ? cell.tone.value.type\n                        : value === undefined ? \"muted\"\n                        : value < 0 ? \"neg\"\n                        : s.tone.type === \"some\" ? s.tone.value.type\n                        : undefined;\n                    return { text, tone, strong: s.strong, si, held: value !== undefined || cell.text.type === \"some\" };\n                });\n                // Numerals wider than their column draw a dot in their place where the cell holds a value (#1438).\n                const dot = plotPx !== undefined && plotPx > 0 && (b.x1 - b.x0) * plotPx < numeralsPx(printed.map((p) => p.text), split)\n                    ? printed.find((p) => p.held) : undefined;\n                const conflict = holdsConflict(b);\n                return (\n                    <Box key={bi} css={styles.tableCellText}\n                        data-conflict={conflict ? \"\" : undefined}\n                        ref={(el: HTMLElement | null) => { if (el !== null) cellEls.current.set(cell, el); else cellEls.current.delete(cell); }}\n                        data-plan-bucket={bi}\n                        // The BUCKET instant — the same subject its click\n                        // reports — and focusable for the keyboard path (#816).\n                        data-cell={cell}\n                        // The positions typing takes here (#1438); a bucket folding several values says where they take one.\n                        data-typed={takes ? typedHere.map((t) => t.position).join(\" \") : undefined}\n                        data-plan-note={folded !== undefined ? words.m.typedFolded({ resolution: folded.resolution, zoom: zoomApart(folded.resolution, zooms) })\n                            : coarse !== undefined ? words.m.typedZoomTo({ zoom: coarse }) : undefined}\n                        data-plan-frac={b.x0.toFixed(4)}\n                        tabIndex={-1}\n                        role=\"button\"\n                        aria-label={cellName(scale, b, printed.length > 0 ? tablePartsText(printed.map((p) => p.text), words) : words.m.noValue(), words)}\n                        data-split={multi ? split : undefined}\n                        data-plan-dotted={dot !== undefined ? \"\" : undefined}\n                        style={{ left: `${b.x0 * 100}%`, width: `${(b.x1 - b.x0) * 100}%` }}\n                        onClick={(e) => {\n                            e.stopPropagation();\n                            dispatch({ t: \"row.select\", key: rowKey });\n                            // Parts join BY bucket (their own `at`s may differ\n                            // inside it) — the BUCKET instant is the honest\n                            // subject, exactly as the payload documents.\n                            onElementClick?.(variant(\"cell\", { row: rowId, at: b.start }) as PlanElementRefValue);\n                            // Below 480px of main, a tap opens the input (#1438), or on a summary zooms in to edit it.\n                            if (takes && typing.popover) openHere(positionAt(e.target, typedHere));\n                            else if (coarse !== undefined && typing?.popover === true) zoomInto(b, coarse);\n                        }}\n                        onDoubleClick={takes ? (e) => { e.stopPropagation(); openHere(positionAt(e.target, typedHere)); }\n                            : coarse !== undefined ? (e) => { e.stopPropagation(); zoomInto(b, coarse); } : undefined}\n                        onKeyDown={takes ? (e: KeyboardEvent<HTMLElement>) => {\n                            if (e.altKey || e.ctrlKey || e.metaKey) return;\n                            // A digit, a minus or the decimal separator opens it typed in.\n                            const seed = /^\\d$/.test(e.key) || e.key === \"-\" || e.key === words.separators.decimal ? e.key : undefined;\n                            if (e.key !== \"Enter\" && e.key !== \"F2\" && seed === undefined) return;\n                            e.preventDefault();\n                            e.stopPropagation();\n                            openHere(typedHere[0]!.position, seed);\n                        } : coarse !== undefined ? (e: KeyboardEvent<HTMLElement>) => {\n                            if (e.key !== \"Enter\" || e.altKey || e.ctrlKey || e.metaKey) return;\n                            e.preventDefault();\n                            e.stopPropagation();\n                            zoomInto(b, coarse);\n                        } : undefined}\n                    >\n                        {/* Its numerals, together: drawn whole, or — wider than the cell — off its line, out of\n                            sight, and said by the cell's hover (#1269); never some of them. A cell holding a value its\n                            column cannot draw draws a dot in their place, its numerals kept, hidden, for the hover\n                            to say (#1438). */}\n                        <Box as=\"span\" css={styles.tableCellGroup} data-table-parts=\"\" data-plan-label=\"\">\n                            {printed.map(({ text, tone, strong, si }, i) => (\n                                <Box key={i} as=\"span\" css={styles.tableCellPart} data-part={si}\n                                    data-tone={tone} data-strong={strong ? \"\" : undefined}>\n                                    {text}\n                                </Box>\n                            ))}\n                        </Box>\n                        {dot !== undefined && <Box as=\"span\" css={styles.tableCellDot} data-plan-cell-dot=\"\"\n                            data-tone={dot.tone} data-strong={dot.strong ? \"\" : undefined} />}\n                    </Box>\n                );\n            })}\n            {input}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The plot CONTENT of one data row — the kind switch, and nothing else.\n *\n * Every row kind draws its marks the same way whatever shell they sit in:\n * the desktop canvas mounts this inside a `RowShell` plot cell beside the\n * gutter, and the narrow layout (§10, #570) mounts it as a card body under\n * the card head. Keeping the switch here is what makes \"every row's content\n * is its source renderer, unchanged — only the shell is new\" literally true\n * rather than a second copy of eight renderers.\n *\n * Group bands are not a plot: they have their own band component.\n */\n\nimport { Box } from \"@chakra-ui/react\";\nimport { optimiseMessages } from \"@elaraai/east-ui-components\";\nimport { SpanRow } from \"./SpanRow.js\";\nimport { ChartRowPlot } from \"./ChartRow.js\";\nimport { HeatCells } from \"./HeatRow.js\";\nimport { BucketsRow } from \"./BucketsRow.js\";\nimport { CardsRow } from \"./CardsRow.js\";\nimport { EventsRow } from \"./EventsRow.js\";\nimport { TableRowCells } from \"./TableRow.js\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { usePlanEdit } from \"../edit/store.js\";\nimport { usePlanScale } from \"../context.js\";\nimport { usePlanRowGhosts } from \"./element-optimise.js\";\nimport { PLAN_CELL_INSET } from \"../geometry.js\";\nimport type { PlanDerived, VisibleRow } from \"../model.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nexport interface KindPlotProps {\n    v: VisibleRow;\n    styles: Styles;\n    /** The renderer-side derivations (rollup bands, derived cells / series). */\n    derived: PlanDerived;\n    /** Whether this row nests children (a collapsed parent draws rollup-height bars). */\n    hasChildren: boolean;\n    /** R2 context strip — marks at strip size. */\n    ctx: boolean;\n    /** The plot's height — what a chart row's y-scale spans. */\n    plotHeight: number;\n    /** Chart rows: render at expanded density (breach rectangles, ref labels). */\n    chartExpanded: boolean;\n}\n\n/**\n * The ghosts a run of the optimiser left on a row (#1409, R15), while its\n * highlight is on: where an event it removed stood, struck through, and\n * where one it moved stood, dashed — each at its extent on the shared scale,\n * decorative, named for what the run did. Drawn in the row's own bar or tile\n * style, which the `optimise` recipe dashes and tints from `data-op`.\n */\nfunction PlanGhosts({ rowKey, styles, ctx }: { rowKey: string; styles: Styles; ctx: boolean }) {\n    const ghosts = usePlanRowGhosts(rowKey);\n    const scale = usePlanScale();\n    if (ghosts.length === 0 || ctx) return null;\n    return (\n        <>\n            {ghosts.map((ghost) => {\n                const f0 = scale.fracOf(ghost.start);\n                const f1 = ghost.shape === \"span\" ? scale.endFracOf(ghost.end) : f0;\n                if (!Number.isFinite(f0) || !Number.isFinite(f1) || f1 < scale.renderMin || f0 > scale.renderMax) return null;\n                const title = ghost.op === \"del\" ? optimiseMessages.ghostRemoved({ run: ghost.run }) : optimiseMessages.ghostMoved({ run: ghost.run });\n                return ghost.shape === \"span\" ? (\n                    <Box key={`ghost:${ghost.key}`} css={styles.bar} data-plan-ghost={ghost.key} data-op={ghost.op} aria-hidden=\"true\" title={title}\n                        style={{ left: `calc(${Math.max(0, f0) * 100}% + ${PLAN_CELL_INSET}px)`, width: `calc(${Math.max(0, Math.min(1, f1) - Math.max(0, f0)) * 100}% - ${2 * PLAN_CELL_INSET}px)` }}>\n                        {ghost.label}\n                    </Box>\n                ) : (\n                    <Box key={`ghost:${ghost.key}`} css={styles.tile} data-plan-ghost={ghost.key} data-op={ghost.op} aria-hidden=\"true\" title={title}\n                        position=\"absolute\" style={{ left: `${f0 * 100}%` }}>\n                        {ghost.label}\n                    </Box>\n                );\n            })}\n        </>\n    );\n}\n\n/** The plot content for a data row kind (`null` for a group band). */\nexport function KindPlot(props: KindPlotProps) {\n    const { v, ctx, styles } = props;\n    if (v.row.kind.type === \"group\") return null;\n    return (\n        <>\n            <KindPlotContent {...props} />\n            <PlanGhosts rowKey={v.row.key} styles={styles} ctx={ctx} />\n        </>\n    );\n}\n\n/** The kind switch: one row kind's own plot content. */\nfunction KindPlotContent({ v, styles, derived, hasChildren, ctx, plotHeight, chartExpanded }: KindPlotProps) {\n    const kind = v.row.kind;\n    const rowKey = v.row.key;\n    const rowId = v.row.id;\n    // How the row's elements move (#825) — never inside a context strip,\n    // whose one action is the way back: a row of `data`'s while its session\n    // takes a move, an event kind's by its events (#1196).\n    const edit = usePlanEdit();\n    const move = ctx ? undefined\n        : v.row.edits.move.type === \"some\" ? (edit?.dataMoves === true ? v.row.edits.move.value : undefined)\n            : edit?.eventMove?.(v.row);\n    switch (kind.type) {\n        case \"span\":\n            return (\n                // Bar heights are the canvas's geometry (#817), drawn by the\n                // recipe: the density's bar, a parent's folded or open — what\n                // it rolls up is its bands.\n                <SpanRow rowKey={rowKey} rowId={rowId} kind={kind.value} styles={styles} ctx={ctx} move={move}\n                    bands={derived.bands.get(rowKey) ?? []} />\n            );\n        case \"chart\":\n            // What the row DRAWS (#824) — its layers folded to the period\n            // where a bucket holds several of their points.\n            return (\n                <ChartRowPlot kind={derived.charts.get(rowKey) ?? kind.value} styles={styles} height={plotHeight}\n                    expanded={chartExpanded} rowKey={rowKey} ctx={ctx} />\n            );\n        case \"heat\":\n            // A declared-aggregate parent draws its derived cells, and any row\n            // its cells folded to the period (#824); else its own arm.\n            return (\n                <HeatCells rowKey={rowKey} rowId={rowId} cells={derived.heatArms.get(rowKey) ?? kind.value.cells}\n                    styles={styles} ctx={ctx} />\n            );\n        case \"buckets\":\n            return (\n                <BucketsRow rowKey={rowKey} rowId={rowId} kind={kind.value} styles={styles} ctx={ctx} move={move} />\n            );\n        case \"table\":\n            // A declared-aggregate parent draws its derived subtotal\n            // positions, and any row its series folded to the period (#824);\n            // else its declared series (per-position style, raw cells).\n            return (\n                <TableRowCells rowKey={rowKey} rowId={rowId}\n                    series={derived.tableSeries.get(rowKey) ?? kind.value.series}\n                    split={kind.value.split.type} ctx={ctx}\n                    format={getSomeorUndefined(kind.value.format)} styles={styles}\n                    // The positions taking a typed number (#1436, #1438), its own values deciding which buckets.\n                    typed={v.row.edits.values} own={kind.value.series} parent={hasChildren} />\n            );\n        case \"cards\":\n            return (\n                <CardsRow rowKey={rowKey} rowId={rowId} kind={kind.value} styles={styles} ctx={ctx} move={move} />\n            );\n        case \"events\":\n            return (\n                <EventsRow rowKey={rowKey} rowId={rowId} kind={kind.value} styles={styles} ctx={ctx} move={move} />\n            );\n        case \"group\":\n            return null;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * One data row as a narrow card — the gutter identity as its head, the kind\n * plot as its body (split out of `narrow/index.tsx`, #815).\n *\n * @packageDocumentation\n */\n\nimport { memo, useMemo, type ComponentProps } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { EastChakraComponent } from \"@elaraai/east-ui-components\";\nimport { LoadingWash } from \"@elaraai/east-ui-components/internal\";\nimport { NowLine } from \"../../shared/time/now-line.js\";\nimport { usePlanDispatch, usePlanScale } from \"../context.js\";\nimport { GridSeparators } from \"../rows/RowShell.js\";\nimport { KindPlot } from \"../rows/KindPlot.js\";\nimport { ChartLeftTicks } from \"../rows/ChartRow.js\";\nimport { PlanPartBoundary } from \"../rows/PartBoundary.js\";\nimport { RowDiagnostic } from \"../rows/RowDiagnostic.js\";\nimport { statusText } from \"../a11y.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { pxOf, type PlanDerived, type PlanRowValue } from \"../model.js\";\nimport type { PlanDraftMark } from \"../use-plan-editing.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype UIValue = ComponentProps<typeof EastChakraComponent>[\"value\"];\n\n/** §10: a drilled row expands to ~148pt in place, unless it declares a height. */\nconst NARROW_RENDER_PX = 148;\n\nexport interface NarrowRowCardProps {\n    row: PlanRowValue;\n    /** The card body's height — the row's kind height (Measures force a\n     *  chart's expanded branch). */\n    h: number;\n    /** A chart row draws at expanded density. */\n    chartExpanded: boolean;\n    selected: boolean;\n    /** Whether a second tap drills the row (it declares `expand` and the root\n     *  can render it). */\n    canDrill: boolean;\n    /** The drilled row's developer render and gutter body — on the drilled\n     *  card only. */\n    drill: { body: UIValue; gutter: UIValue | null } | undefined;\n    /** Whether the row nests children: a table parent's positions drawing their subtotals take no typed number. */\n    hasChildren: boolean;\n    styles: Styles;\n    derived: PlanDerived;\n    storageKey: string;\n    /** Enrols the card in the list's viewport observer (a paged canvas, #812). */\n    watch: ((el: HTMLElement | null) => (() => void) | undefined) | undefined;\n    /** The row's draft mark (#880) — the canvas row's, where the draft was made. */\n    draft: PlanDraftMark | undefined;\n    /** Its cells are unread (#1398, #1438): the body washes under what it holds, as the canvas's row's plot does. */\n    unread: boolean;\n}\n\n/**\n * Whether a card's facts are unchanged. The derivations are rebuilt whole on\n * every data change and every paged window landing, but a card reads only\n * its own row's entries from them — the ones `KindPlot` draws (bands, the\n * heat arm, table series and chart it draws, #824) and the diagnostic that\n * replaces it. So a\n * reveal that adds cards below, or a window landing elsewhere, re-renders none\n * of the cards already shown (#812): a tap costs the cards it adds.\n */\nfunction sameCard(a: NarrowRowCardProps, b: NarrowRowCardProps): boolean {\n    const keys = Object.keys(a) as (keyof NarrowRowCardProps)[];\n    if (keys.length !== Object.keys(b).length) return false;\n    for (const key of keys) {\n        if (key !== \"derived\" && a[key] !== b[key]) return false;\n    }\n    // By identity: the canvas keeps an entry's object while its content holds.\n    const k = a.row.key;\n    return Object.is(a.derived.bands.get(k), b.derived.bands.get(k))\n        && Object.is(a.derived.heatArms.get(k), b.derived.heatArms.get(k))\n        && Object.is(a.derived.tableSeries.get(k), b.derived.tableSeries.get(k))\n        && Object.is(a.derived.charts.get(k), b.derived.charts.get(k))\n        && Object.is(a.derived.diagnostics.get(k), b.derived.diagnostics.get(k));\n}\n\n/** One data row as a card: head = the gutter identity, body = the plot. */\nexport const NarrowRowCard = memo(function NarrowRowCard({\n    row, h, chartExpanded, selected, canDrill, drill, hasChildren,\n    styles, derived, storageKey, watch, draft, unread,\n}: NarrowRowCardProps) {\n    const scale = usePlanScale();\n    const dispatch = usePlanDispatch();\n    const words = usePlanWords();\n    const v = useMemo(() => ({ row, depth: 0, collapsed: false }), [row]);\n    const isChart = row.kind.type === \"chart\";\n    const declaredPx = row.expand.type === \"some\" && row.expand.value.height.type === \"some\"\n        ? pxOf(row.expand.value.height.value)\n        : undefined;\n    const renderPx = declaredPx ?? NARROW_RENDER_PX;\n    const gutter = row.gutter;\n    const isId = gutter.id;\n    const sub = gutter.sub.type === \"some\" ? gutter.sub.value : undefined;\n    const value = gutter.value.type === \"some\" ? gutter.value.value : undefined;\n    const meta = gutter.meta.type === \"some\" ? gutter.meta.value : undefined;\n    const statusTone = row.status.type === \"some\" ? row.status.value.type : undefined;\n    // A row that cannot be placed shows its diagnostic in the card body\n    // (#811) — no marks, and no value ticks for marks that are not there.\n    const diagnostic = derived.diagnostics.get(row.key);\n    return (\n        <Box ref={watch} css={styles.narrowCard} data-plan-card={row.key}\n            data-selected={selected ? \"\" : undefined}\n            data-expanded={drill !== undefined ? \"\" : undefined}\n            // A drafted row (#880) — the canvas row's marks.\n            data-draft={draft !== undefined ? \"\" : undefined}\n            data-incomplete={draft === \"incomplete\" ? \"\" : undefined}\n            data-invalid={draft === \"invalid\" ? \"\" : undefined}\n            // Tap selects; a second tap on a selected row that declares\n            // `expand` drills it in place (and again returns) — §10.\n            onClick={() => dispatch(selected && canDrill\n                ? { t: \"focus.expand\", key: row.key }\n                : { t: \"row.select\", key: row.key })}\n        >\n            <Box css={styles.narrowCardHead}>\n                <Box css={styles.narrowCardTitle} data-id={isId ? \"\" : undefined}>{gutter.label}</Box>\n                {meta !== undefined && <Box as=\"span\" css={styles.gutterMeta}>{meta}</Box>}\n                <Box display=\"flex\" alignItems=\"center\" gap=\"6px\" marginLeft=\"auto\" flexShrink={0}>\n                    {value !== undefined && <Box as=\"span\" css={styles.gutterValue}>{value}</Box>}\n                    {/* The dot's colour IS the status — its name says it, as the canvas row's does (#819). */}\n                    {statusTone !== undefined && <Box as=\"span\" css={styles.statusDot} data-tone={statusTone}\n                        role=\"img\" aria-label={statusText(statusTone, words)} />}\n                </Box>\n            </Box>\n            {sub !== undefined && <Box css={styles.narrowCardSub}>{sub}</Box>}\n            {drill !== undefined && drill.gutter !== null && (\n                <Box css={styles.expandGutterBody} data-plan-expandgutter marginX=\"12px\" marginBottom=\"8px\">\n                    <PlanPartBoundary part={{ kind: \"expandGutter\" }} resetKey={drill.gutter} styles={styles}>\n                        <EastChakraComponent value={drill.gutter} storageKey={`${storageKey}.${row.key}.expandgutter`} />\n                    </PlanPartBoundary>\n                </Box>\n            )}\n            <Box css={styles.narrowCardBody} style={{ height: `${h}px` }} data-plan-cardbody={row.kind.type}\n                aria-busy={unread ? true : undefined} data-plan-unread={unread ? \"\" : undefined}>\n                {/* Under everything the body draws after it, as the canvas's row's plot washes (#1398, CL2). */}\n                {unread && <LoadingWash />}\n                {!isChart && <GridSeparators styles={styles} />}\n                {diagnostic !== undefined ? (\n                    <RowDiagnostic diagnostic={diagnostic} styles={styles} />\n                ) : (\n                    <PlanPartBoundary part={{ kind: \"row\", key: row.key, label: row.gutter.label }} resetKey={row} styles={styles}>\n                        <KindPlot v={v} styles={styles} derived={derived}\n                            hasChildren={hasChildren}\n                            ctx={false} plotHeight={h} chartExpanded={chartExpanded} />\n                        {row.kind.type === \"chart\" && (\n                            <Box css={styles.narrowTicks}>\n                                <ChartLeftTicks kind={derived.charts.get(row.key) ?? row.kind.value} styles={styles} height={h} />\n                            </Box>\n                        )}\n                    </PlanPartBoundary>\n                )}\n                {scale.nowFrac !== undefined && <NowLine styles={styles} at={scale.nowFrac} data-plan-axisline />}\n            </Box>\n            {drill !== undefined && (\n                <Box css={styles.narrowRender} data-plan-expandrender style={{ height: `${renderPx}px` }}>\n                    <PlanPartBoundary part={{ kind: \"expandRender\" }} resetKey={drill.body} styles={styles}>\n                        <EastChakraComponent value={drill.body} storageKey={`${storageKey}.${row.key}.expand`} />\n                    </PlanPartBoundary>\n                </Box>\n            )}\n        </Box>\n    );\n}, sameCard);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The narrow layout's shared ruler (split out of `narrow/index.tsx`, #815).\n * Its resolution is the frame's toolbar's segment (#1193), folded to a\n * one-chip menu where the row is short of room (#952).\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { NowLine } from \"../../shared/time/now-line.js\";\nimport { usePlanScale } from \"../context.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { TimeRulerRow, timeRulerUnits } from \"../../shared/time/ruler.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/**\n * The shared ruler — the LIST's sticky first row, not a row of the header.\n * It wears the desktop ruler's vocabulary (the panel surface, a separator\n * per bucket so its rhythm IS the card grids', a strong bottom rule) and\n * sits 10px under the tab baseline on the page, so it reads as the axis\n * over the cards rather than as a strip welded under the tab underline\n * (which is what a filled band directly beneath the tabs looked like). The\n * tick TRACK is inset to the card bodies' inset (25px) so the columns line\n * up down the page.\n *\n * Its labels are the desktop ruler's (#1269, `useRulerFit`): measured as\n * they draw, every k-th where the columns are narrower than they are, each\n * whole on the ruler's paper, each period's first column among them, and the\n * first and the last against the track's ends. The now bucket's label wears\n * the brand — a 28px band has no lane for the NOW chip, and a chip laid over\n * the labels hid the two it straddled — and draws wherever it clears the\n * periods' first columns, the labels it crowds giving way to it.\n */\nexport function NarrowRuler({ styles }: { styles: Styles }) {\n    const scale = usePlanScale();\n    const words = usePlanWords();\n    const units = useMemo(() => timeRulerUnits(scale, words), [scale, words]);\n    const nowIndex = scale.nowFrac === undefined ? undefined\n        : scale.buckets.find((b) => scale.nowFrac! >= b.x0 && scale.nowFrac! < b.x1)?.index;\n    const rulerStyles = { ...styles, rulerTick: styles.narrowRulerTick ?? {} };\n    return (\n        <Box css={styles.narrowRuler} data-slot=\"narrowRuler\" data-time={units !== undefined ? \"\" : undefined}>\n            <Box css={styles.narrowRulerTrack}>\n                {units !== undefined && <TimeRulerRow scale={units} styles={rulerStyles} band=\"units\" owner=\"plan-narrow\" />}\n                <TimeRulerRow scale={scale} styles={rulerStyles} band=\"ticks\" owner=\"plan-narrow\" highlight={nowIndex} />\n                {scale.nowFrac !== undefined && <NowLine styles={styles} at={scale.nowFrac} data-ruler-now=\"\" />}\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The narrow list's side of paged demand (#812) — the list has no virtualizer\n * to report a mounted range, so its cards report themselves (split out of\n * `narrow/index.tsx`, #815).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type { PlanBand } from \"../model.js\";\nimport type { RowKey } from \"../plan-state.js\";\n\n/** How the narrow list drives a paged source (#812). */\nexport interface PlanNarrowPaging {\n    /** The unloaded run after the resident rows, when there is one — and\n     *  which of its elements are loading (#1082). */\n    tail: PlanBand | undefined;\n    /**\n     * How many of the source's elements lie past the resident rows, not read — its blocks' unloaded runs after their\n     * rows (#1398): beside the rows read and not shown yet, what the list's `N more rows` counts. `undefined` while the\n     * source has not counted itself, or a new narrowing's rows are read.\n     */\n    beyond: number | undefined;\n    /** Where the list is — the last row card on screen. */\n    onViewport: (key: RowKey) => void;\n    /** Demand the window after the resident run. */\n    onLoadMore: () => void;\n}\n\n/** The latest of a set of elements in document order. */\nfunction lastInOrder(elements: ReadonlySet<Element>): Element | undefined {\n    let last: Element | undefined;\n    for (const el of elements) {\n        if (last === undefined || (last.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0) last = el;\n    }\n    return last;\n}\n\n/**\n * The list's side of paged demand (#812): one `IntersectionObserver` for the\n * whole list, which every row card and the load-more card enrol in through\n * the returned ref. Whenever what is on screen changes, the LAST row card\n * visible is reported as the viewport; the load-more card coming into view\n * demands the next window. (A report that names the window the driver is\n * already on changes no state, so scrolling within a window re-renders\n * nothing.)\n *\n * @param paging - The paged demand, or `undefined` on an inline canvas\n * @returns The ref an observed element takes — `undefined` when there is\n *   nothing to demand, or no `IntersectionObserver` to demand it with\n */\nexport function useListDemand(paging: PlanNarrowPaging | undefined): ((el: HTMLElement | null) => (() => void) | undefined) | undefined {\n    const latest = useRef(paging);\n    latest.current = paging;\n    const observer = useRef<{ io: IntersectionObserver; visible: Set<Element> } | null>(null);\n    useEffect(() => () => {\n        observer.current?.io.disconnect();\n        observer.current = null;\n    }, []);\n    const watch = useCallback((el: HTMLElement | null): (() => void) | undefined => {\n        if (el === null) return undefined;\n        let o = observer.current;\n        if (o === null) {\n            const visible = new Set<Element>();\n            const io = new IntersectionObserver((entries) => {\n                let reachedEnd = false;\n                for (const entry of entries) {\n                    if (entry.target.hasAttribute(\"data-plan-more\")) {\n                        reachedEnd ||= entry.isIntersecting;\n                        continue;\n                    }\n                    if (entry.isIntersecting) visible.add(entry.target);\n                    else visible.delete(entry.target);\n                }\n                const demand = latest.current;\n                if (demand === undefined) return;\n                const key = lastInOrder(visible)?.getAttribute(\"data-plan-card\");\n                if (key !== null && key !== undefined) demand.onViewport(key);\n                if (reachedEnd) demand.onLoadMore();\n            });\n            o = { io, visible };\n            observer.current = o;\n        }\n        const { io, visible } = o;\n        io.observe(el);\n        return () => {\n            io.unobserve(el);\n            visible.delete(el);\n        };\n    }, []);\n    return paging !== undefined && typeof IntersectionObserver !== \"undefined\" ? watch : undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Group strips (`Plan Spec.md` §5) — the canvas-level heterogeneous\n * container's band: caret + mono uppercase name + meta counts in the gutter;\n * collapsed with a `summary`, the plot renders the factory-computed heat\n * strip (delegating the cell painting to {@link HeatCells}); expanded (or\n * summary-less) the plot stays a plain band.\n *\n * A treegrid row (#819) at its level, expanded or not, its name the\n * `rowheader`.\n */\n\nimport { Box } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCaretDown } from \"@fortawesome/free-solid-svg-icons\";\nimport { type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { PlaceholderShape } from \"@elaraai/east-ui-components/internal\";\nimport { NowLine } from \"../../shared/time/now-line.js\";\nimport { usePlanDispatch, usePlanScale } from \"../context.js\";\nimport { HeatCells } from \"./HeatRow.js\";\nimport { GridSeparators, INDENT_PX } from \"./RowShell.js\";\nimport { PlanPartBoundary } from \"./PartBoundary.js\";\nimport { RowDiagnostic } from \"./RowDiagnostic.js\";\nimport { statusText } from \"../a11y.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { rowItemKey, type PlanRowDiagnostic, type PlanRowValue } from \"../model.js\";\nimport type { PlanGridRow } from \"../root/grid.js\";\n\ntype HeatCellsValue = ValueTypeOf<typeof Plan.Types.HeatCells>;\ntype Styles = Record<string, Record<string, unknown>>;\ntype GroupKindValue = Extract<ValueTypeOf<typeof Plan.Types.Row>[\"kind\"], { type: \"group\" }>[\"value\"];\n\n/**\n * The strip a group band draws collapsed (#824) — its derived strip (the\n * declared aggregate over its members' drawn heat cells, on the scale they\n * share, or its declared cells folded to the period), else its declared cells\n * as they are. `undefined` for a plain band, and for an aggregate with no\n * member cells to show. Shared with the narrow layout's group cards, so both\n * strips read the same way.\n *\n * @param kind - The group's kind\n * @param derived - Its derived strip (`PlanDerived.groupStrips`), if any\n * @returns The heat arm to draw, if any\n */\nexport function groupStrip(kind: GroupKindValue, derived: HeatCellsValue | undefined): HeatCellsValue | undefined {\n    const arm = derived ?? (kind.summary.type === \"cells\" ? kind.summary.value : undefined);\n    if (arm === undefined) return undefined;\n    if (kind.summary.type === \"aggregate\" && arm.type === \"heat\" && arm.value.cells.length === 0) return undefined;\n    return arm;\n}\n\nexport interface GroupRowProps {\n    row: PlanRowValue;\n    kind: GroupKindValue;\n    styles: Styles;\n    gridTemplate: string;\n    height: number;\n    depth: number;\n    collapsed: boolean;\n    /** The renderer-derived strip (`PlanDerived.groupStrips`) — see {@link groupStrip}. */\n    strip?: HeatCellsValue | undefined;\n    /** Renderer-derived direct-member count — printed as the `\"8 rows\"` meta\n     *  (the `groupMeta` message, #820) when the IR declares none (#568: the\n     *  count is an aggregate like any other, so it is derived here rather than\n     *  baked into the row). */\n    memberCount?: number | undefined;\n    /** Whether the derived numbers cover only the windows that have landed —\n     *  a top-level section band on a paged canvas still loading, the one\n     *  parent whose members span windows (`spansWindows`, #822). The count is\n     *  a short bar until its members land (#1398, CL13) and the band carries\n     *  `data-plan-partial` (#567 D9). The author's own `meta` is never\n     *  rewritten: it is their text, not a derivation. */\n    partial?: boolean | undefined;\n    /** Set when the band's own declared strip rides another arm than the axis\n     *  (#811): the band keeps its toggle and its members, and its plot says\n     *  why it shows no strip. */\n    diagnostic?: PlanRowDiagnostic | undefined;\n    /** The band's grid plumbing (#819) — `usePlanGridRow`. */\n    grid: PlanGridRow;\n    /** The band is the last visible member of the open group around it — it\n     *  carries that group's closing rule (#949). */\n    groupEnd?: boolean | undefined;\n}\n\n/** One group band — full-width strip on the shared template. */\nexport function GroupRow({ row, kind, styles, gridTemplate, height, depth, collapsed, strip, memberCount, partial, diagnostic, grid, groupEnd }: GroupRowProps) {\n    const scale = usePlanScale();\n    const dispatch = usePlanDispatch();\n    const words = usePlanWords();\n    // A declared meta line wins; otherwise the derived member count stands in — a short bar while it covers only the\n    // windows that have landed, never a count the read has not finished (#1398, CL13).\n    const meta = row.gutter.meta.type === \"some\"\n        ? row.gutter.meta.value\n        : (memberCount !== undefined && memberCount > 0\n            ? (partial === true\n                ? <PlaceholderShape kind=\"aggregate\" index={memberCount} />\n                : words.m.groupMeta({ n: memberCount, count: words.number(memberCount) }))\n            : undefined);\n    const value = row.gutter.value.type === \"some\" ? row.gutter.value.value : undefined;\n    const statusTone = row.status.type === \"some\" ? row.status.value.type : undefined;\n    const summary = collapsed && diagnostic === undefined ? groupStrip(kind, strip) : undefined;\n\n    return (\n        <Box\n            ref={grid.ref}\n            css={styles.groupBand}\n            style={{ gridTemplateColumns: gridTemplate, height: `${height}px` }}\n            role=\"row\"\n            aria-level={depth + 1}\n            aria-expanded={!collapsed}\n            tabIndex={grid.tabIndex}\n            onFocus={grid.onFocus}\n            data-plan-item={rowItemKey(row.key)}\n            data-plan-group={row.key}\n            // The height the model laid the band out at (#817).\n            data-plan-h={height}\n            data-collapsed={collapsed ? \"\" : undefined}\n            data-group-end={groupEnd === true ? \"\" : undefined}\n            data-plan-partial={partial === true ? \"\" : undefined}\n            onClick={() => dispatch({ t: \"group.toggle\", key: row.key })}\n        >\n            <Box css={styles.groupName} role=\"rowheader\" style={{ paddingLeft: `${12 + depth * INDENT_PX}px` }}>\n                <Box as=\"span\" css={styles.caret} data-collapsed={collapsed ? \"\" : undefined}>\n                    <FontAwesomeIcon icon={faCaretDown} />\n                </Box>\n                <Box as=\"span\" css={styles.gutterLabel} data-plan-gutter=\"label\">{row.gutter.label}</Box>\n                {/* The mock's `.grow` anatomy: meta / dot / value cluster\n                    pushed to the gutter's RIGHT edge by the flex spacer —\n                    never inline beside the name. */}\n                {(meta !== undefined || value !== undefined || statusTone !== undefined) && (\n                    <Box css={styles.gutterRight}>\n                        {meta !== undefined && <Box as=\"span\" css={styles.groupMeta} data-plan-gutter=\"meta\">{meta}</Box>}\n                        {statusTone !== undefined && <Box as=\"span\" css={styles.statusDot} data-tone={statusTone}\n                            role=\"img\" aria-label={statusText(statusTone, words)} />}\n                        {value !== undefined && <Box as=\"span\" css={styles.gutterValue} data-plan-gutter=\"value\">{value}</Box>}\n                    </Box>\n                )}\n            </Box>\n            <Box css={styles.plot} role=\"gridcell\">\n                {diagnostic !== undefined && <RowDiagnostic diagnostic={diagnostic} styles={styles} />}\n                {summary !== undefined && (\n                    <PlanPartBoundary part={{ kind: \"group\", label: row.gutter.label }} resetKey={summary} styles={styles}>\n                        <GridSeparators styles={styles} />\n                        {/* The strip's cells are part of the BAND: clicking\n                            them toggles the group like the rest of it, rather\n                            than selecting a group key nothing displays (#615). */}\n                        <HeatCells rowKey={row.key} cells={summary} styles={styles}\n                            onCellClick={() => dispatch({ t: \"group.toggle\", key: row.key })} />\n                    </PlanPartBoundary>\n                )}\n                {scale.nowFrac !== undefined && <NowLine styles={styles} at={scale.nowFrac} data-plan-now />}\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The narrow layout's row walks and strip readings — which data rows a group\n * holds, and how hot its strip runs (split out of `narrow/index.tsx`, #815).\n *\n * @packageDocumentation\n */\n\nimport { type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { groupStrip } from \"../rows/GroupRow.js\";\nimport type { PlanDerived, PlanRowIndex, PlanRowValue } from \"../model.js\";\nimport { appendAll } from \"../reductions.js\";\nimport type { RowKey } from \"../plan-state.js\";\n\ntype HeatCellsValue = ValueTypeOf<typeof Plan.Types.HeatCells>;\n\n/** The DATA rows beneath a key, tree order, any depth (group bands skipped). */\nexport function dataRowsUnder(index: PlanRowIndex, key: RowKey): PlanRowValue[] {\n    const out: PlanRowValue[] = [];\n    const walk = (k: RowKey) => {\n        for (const child of index.children.get(k) ?? []) {\n            if (child.kind.type !== \"group\") out.push(child);\n            walk(child.key);\n        }\n    };\n    walk(key);\n    return out;\n}\n\n/** Every data row of the canvas, tree order. */\nexport function allDataRows(index: PlanRowIndex): PlanRowValue[] {\n    const out: PlanRowValue[] = [];\n    for (const root of index.roots) {\n        if (root.kind.type !== \"group\") out.push(root);\n        appendAll(out, dataRowsUnder(index, root.key));\n    }\n    return out;\n}\n\n/** A group's strip as the band draws it collapsed — its derived strip, else\n *  its declared cells (`groupStrip`, the desktop band's own reading, so both\n *  strips show the same folded cells, #824). */\nexport function summaryArm(row: PlanRowValue, derived: PlanDerived): HeatCellsValue | undefined {\n    if (row.kind.type !== \"group\") return undefined;\n    return groupStrip(row.kind.value, derived.groupStrips.get(row.key));\n}\n\n/** The hottest value on a strip — what \"hottest first\" sorts by. */\nexport function peakOf(arm: HeatCellsValue | undefined): number {\n    if (arm === undefined) return -Infinity;\n    let peak = -Infinity;\n    if (arm.type === \"heat\") {\n        for (const c of arm.value.cells) if (c.value.type === \"some\" && c.value.value > peak) peak = c.value.value;\n    } else if (arm.type === \"weight\") {\n        for (const c of arm.value.cells) if (c.fraction > peak) peak = c.fraction;\n    }\n    return peak;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The narrow layout (`Plan Spec v2.html` §10, #570) — below 480px of\n * CONTAINER width the Plan is a review tool, not a canvas. Two jobs survive\n * the trip: *where is it hot* (the GROUP grain as a strip list) and *what is\n * this thing doing* (one group's rows). Three tabs over ONE slice — Groups ·\n * Rows · Measures — share the cohort chips, window and resolution; filter\n * once, every tab narrows.\n *\n * The gutter decision, written into the spec: there is no gutter column to\n * negotiate on a phone. A row's gutter identity (label / id / sub / value /\n * status dot / meta) becomes the CARD HEAD and its plot — the same kind\n * renderer, unchanged (`KindPlot`) — the CARD BODY on the shared window. The\n * list has no gutter, so every card body and the slim shared ruler share one\n * inset and the bucket columns line up down the page.\n *\n * What does not change: the bar vocabulary, the slice semantics, the\n * now-line. The input model does: tap selects, a second\n * tap on a row that declares `expand` drills it in place (~148pt; its\n * neighbours keep their size — a vertical list needs no strip compression),\n * horizontal pan is two-finger so page scroll stays vertical. The horizon\n * brush does not mount: the window rides the slice's range in the frame's\n * toolbar and the pan, the resolution the toolbar's segment. A paged source\n * shows its resident prefix, and the frame's footer says so.\n *\n * The layout is the frame's main below 480px of it (#1193): its controls are\n * the frame's toolbar's — the slice's chips, the resolution, the diagnostics\n * and the history item, folded to the room a phone leaves — and its counts\n * the frame's footer's, so the list draws no chip row or footer of its own.\n *\n * Failures stay local here too (#811): a card whose row cannot be placed\n * shows its diagnostic, a card whose plot throws shows its own fallback, and\n * a window whose read failed is a card with the reason and a Retry at the top\n * of the list; the frame's toolbar carries the diagnostics chips.\n *\n * A paged source pages around the LIST (#812). There is no virtualizer here\n * to report a mounted range, so the cards report themselves: an\n * `IntersectionObserver` watches every row card, and the last one on screen\n * is the viewport the driver pages around — prefetching past it, keeping what\n * is on screen resident. Once a list shows every resident row, the canvas's\n * tail band stands after them in list form: scrolling it into view loads the\n * next window. Its `N more rows` counts the source, never what has loaded —\n * the rows read and not shown yet, and every one the source holds past them\n * (`…` while that is not known) — and a tap past the rows read asks for the\n * next window at once, its cards coming as it lands (#1398, ruled 27 Oct\n * 2026).\n *\n * The cards (`cards.tsx`), the ruler (`chrome.tsx`), the list demand\n * (`demand.ts`) and the row walks (`lists.ts`) live beside this shell (#815).\n *\n * The tabs are Chakra's `Tabs` (Zag, #819): a tablist with a roving tab stop,\n * the arrow keys between tabs, and a tabpanel per tab — the list is the\n * selected tab's panel.\n *\n * Events selected from outside the canvas — the overlaps chip's pair, a peer\n * the inspector's banner names (#1198) — ask for their row: the list opens\n * the row's group on the Rows tab, pages to it, and scrolls its card into\n * view, as the desktop canvas scrolls to the row. A row a search found is\n * selected too and stands in the list's middle.\n */\n\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState, type ComponentProps, type PointerEvent, type ReactNode } from \"react\";\nimport { Box, Tabs } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { type EastChakraComponent } from \"@elaraai/east-ui-components\";\nimport { NowLine } from \"../../shared/time/now-line.js\";\nimport { usePlanDispatch, usePlanGeometry, usePlanScale } from \"../context.js\";\nimport { usePlanSelector } from \"../controller/react.js\";\nimport type { PlanSnapshot } from \"../controller/index.js\";\nimport { GridSeparators } from \"../rows/RowShell.js\";\nimport { HeatCells } from \"../rows/HeatRow.js\";\nimport { PlanPartBoundary } from \"../rows/PartBoundary.js\";\nimport { RowDiagnostic } from \"../rows/RowDiagnostic.js\";\nimport { LoadingFailedLine, PlaceholderCard, PlaceholderShape, loadingLineText, useSurfaceGestures } from \"@elaraai/east-ui-components/internal\";\nimport { bandElements } from \"../use-plan-paging.js\";\nimport {\n    rowHeight, spansWindows,\n    type PlanBand, type PlanDerived, type PlanRowIndex, type PlanRowValue, type PlanWindowFailure,\n} from \"../model.js\";\nimport { appendAll } from \"../reductions.js\";\nimport { statusText } from \"../a11y.js\";\nimport { usePlanWords } from \"../words.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport type { PlanUiView } from \"../root/view.js\";\nimport type { PlanDraftMark } from \"../use-plan-editing.js\";\nimport { newTwoFingerPan, twoFingerPan } from \"./pan.js\";\nimport { NarrowRowCard } from \"./cards.js\";\nimport { NarrowRuler } from \"./chrome.js\";\nimport { useListDemand, type PlanNarrowPaging } from \"./demand.js\";\nimport { allDataRows, dataRowsUnder, peakOf, summaryArm } from \"./lists.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype UIValue = ComponentProps<typeof EastChakraComponent>[\"value\"];\n\nexport type { PlanNarrowPaging } from \"./demand.js\";\n\n/** The narrow breakpoint — the adaptive contract's compact class (#346). */\nexport const PLAN_NARROW_BELOW = 480;\n/** Cards shown before the `N more …` load-more, per list. */\nconst PAGE_GROUPS = 6;\nconst PAGE_ROWS = 8;\n/** A row card's height, px: what a paged source's tail draws its placeholder cards at (#1398) — a head line over a span plot. */\nconst PENDING_CARD_PX = 72;\n/** A card body's inset from the list edge: 12px list padding + 1px card\n *  border + 12px body margin — the recipe's `narrowRuler` margin matches. */\nconst BODY_INSET_PX = 25;\n/** The Rows-tab scope for root data rows that belong to no group. */\nconst OTHER_SCOPE = \" other\";\n/** The list's pointers are fingers: a mouse over it is none, and pans nothing. */\nconst fingersOnly = (e: PointerEvent): boolean => e.pointerType === \"touch\";\n\ntype NarrowTab = \"groups\" | \"rows\" | \"measures\";\n\n/** What a tab counts: a number; `pending` while it would count only what has landed (`…`, #1398, CL13); `notCounted`\n *  where the source's entries make no fixed number of what it lists. */\ntype TabCount = number | \"pending\" | \"notCounted\";\n\n/** One run of row cards on the Rows tab — under a group header when the\n *  list is unscoped, bare when it is one group's rows. */\ninterface RowSection {\n    key: string;\n    header?: { scope: RowKey; label: string; meta: ReactNode | undefined; value: string | undefined; tone: string | undefined };\n    rows: PlanRowValue[];\n}\n\nexport interface PlanNarrowProps {\n    styles: Styles;\n    index: PlanRowIndex;\n    derived: PlanDerived;\n    /** The UI facts the cards read — the selection each list reads itself. */\n    view: PlanUiView;\n    dense: boolean;\n    storageKey: string;\n    /** The focused row's developer render / gutter body (the root resolvers\n     *  called with the focus), or `null`. */\n    expandBody: UIValue | null;\n    expandGutterBody: UIValue | null;\n    /** Whether the root declares `expandRender` at all. */\n    canExpand: boolean;\n    /** Whether the source is not yet exhausted (`PlanTransport.partial`) — a\n     *  tab count of what has loaded is then `…`, and a top-level section's\n     *  member count a placeholder (`spansWindows`, #822, #1398 CL13). */\n    partial: boolean | undefined;\n    /**\n     * A paged source's own count, once a completed read says it (#1398, CL13):\n     * what the Rows tab counts, as the rail counts the source — never the rows\n     * read so far. `undefined` on an inline canvas, and while the count is not\n     * known — or is a new narrowing's, the last narrowing's rows standing in.\n     */\n    pagedCount?: number | undefined;\n    /**\n     * What the Measures tab counts over a paged source (#1398, ruled 27 Oct 2026, \"Exact where it can be\"): the chart\n     * rows the source makes — its count times what each of its entries makes across the paged blocks, where every entry\n     * makes as many, beside the blocks no entry makes — or `\"notCounted\"`, where some block's entries make no fixed\n     * number of them, which the tab says. Never what has loaded: `undefined` while the source has not counted itself, or\n     * a new narrowing's rows are read, and on an inline canvas.\n     */\n    pagedMeasures?: number | \"notCounted\" | undefined;\n    /** A bounded frame — the list scrolls inside it. */\n    fill: boolean;\n    /** Windows whose read failed (#811) — a card each, with a Retry. */\n    failures?: readonly PlanWindowFailure[] | undefined;\n    /** Ask a failed window again. */\n    onRetry?: ((w: number) => void) | undefined;\n    /** A paged source's demand (#812) — absent on an inline canvas, which\n     *  has nothing to demand. */\n    paging?: PlanNarrowPaging | undefined;\n    /** What the rail counts the rows in — `work orders`: what a failed window's line names them by (#1398). */\n    noun: string;\n    /** Each drafted row's mark, by row key (#880) — a card wears its row's. */\n    marks: ReadonlyMap<RowKey, PlanDraftMark>;\n    /** Whether a row's cells are unread (#1398, #1438) — its card washes under what it holds, as the canvas's row does. */\n    unread?: ((row: PlanRowValue) => boolean) | undefined;\n    /** Where the rows the cards draw go, in order, as they change (#1438): the canvas reads the rows' nested series for\n     *  them while the list shows, where the desktop's rows read theirs for the rows laid out. */\n    onShown?: ((rows: readonly PlanRowValue[]) => void) | undefined;\n}\n\nconst selectSelected = (s: PlanSnapshot) => s.store.ui.selected;\nconst selectScroll = (s: PlanSnapshot) => s.scroll;\n\n/**\n * A paged source's tail in list form (#812, #1398): placeholder cards at a row\n * card's height, saying nothing. The list's observer demands the next window\n * as they come into view; with no observer to say so, their showing does — the\n * reader has revealed every row there is.\n */\nfunction PendingTail({ tail, watch, onLoadMore, styles }: {\n    tail: PlanBand;\n    watch: ((el: HTMLElement | null) => (() => void) | undefined) | undefined;\n    onLoadMore: () => void;\n    styles: Styles;\n}) {\n    useEffect(() => {\n        if (watch === undefined) onLoadMore();\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- shown once at each place the run ends (its key)\n    }, []);\n    return (\n        <Box ref={watch} css={styles.narrowPending} data-plan-more=\"source\" data-plan-elements={bandElements(tail)}\n            aria-busy={tail.loading !== undefined ? \"true\" : undefined}>\n            <PlaceholderCard height={PENDING_CARD_PX} index={tail.from} />\n            <PlaceholderCard height={PENDING_CARD_PX} index={tail.from + 1} />\n        </Box>\n    );\n}\n\n/** The narrow shell: tabs · ruler · card list. */\nexport function PlanNarrow({\n    styles, index, derived, view, dense, storageKey,\n    expandBody, expandGutterBody, canExpand, partial, pagedCount, pagedMeasures, fill,\n    failures, onRetry, paging, marks, noun, unread, onShown,\n}: PlanNarrowProps) {\n    const scale = usePlanScale();\n    const dispatch = usePlanDispatch();\n    const geometry = usePlanGeometry();\n    const words = usePlanWords();\n    // A member count as a group's meta (#820) — a short bar while it covers only the loaded windows: never a count\n    // the read has not finished (#1398, CL13).\n    const membersText = (count: number): string => words.m.groupMeta({ n: count, count: words.number(count) });\n    const membersMeta = (count: number, over: boolean): ReactNode =>\n        (over ? <PlaceholderShape kind=\"aggregate\" index={count} /> : membersText(count));\n    // Whether a group's derived count covers only the loaded windows: a\n    // top-level section's, on a source not yet exhausted — every other\n    // group's members ride in its own entry (#822).\n    const countPartial = (row: PlanRowValue) => partial === true && spansWindows(row);\n    // The selection is read HERE, not passed down: a tap re-renders the list,\n    // and each card's memo lets through only the two whose selection moved.\n    const selected = usePlanSelector(selectSelected);\n    // Paged demand (#812): row cards and the load-more card enrol here.\n    const watch = useListDemand(paging);\n\n    const rootGroups = useMemo(() => index.roots.filter((r) => r.kind.type === \"group\"), [index]);\n    const ungrouped = useMemo(() => index.roots.filter((r) => r.kind.type !== \"group\"), [index]);\n    const chartRows = useMemo(() => allDataRows(index).filter((r) => r.kind.type === \"chart\"), [index]);\n    const hasGroups = rootGroups.length > 0;\n    const hasMeasures = chartRows.length > 0;\n\n    // ── Groups: root group strips, hottest first ─────────────────────────\n    const groupCards = useMemo(() => {\n        const cards = rootGroups.map((row, i) => {\n            const arm = summaryArm(row, derived);\n            return { row, arm, peak: peakOf(arm), i };\n        });\n        cards.sort((a, b) => (b.peak - a.peak) || (a.i - b.i));\n        return cards;\n    }, [rootGroups, derived]);\n    // Groups is the LANDING only when it is an index worth landing on — a\n    // few strips that say where it is hot, or enough groups that a list of\n    // them is the map. One or two strip-less groups are a detour: the reader\n    // taps through a card that shows nothing to reach the rows.\n    const groupsIndex = rootGroups.length >= 3 || groupCards.some((c) => c.arm !== undefined);\n\n    const [tab, setTab] = useState<NarrowTab>(hasGroups && groupsIndex ? \"groups\" : \"rows\");\n    const [scope, setScope] = useState<RowKey | null>(null);\n    const [reveal, setReveal] = useState({ groups: PAGE_GROUPS, rows: PAGE_ROWS, measures: PAGE_ROWS });\n    // A tab whose content vanished (a data change) falls back to Rows.\n    const activeTab: NarrowTab = tab === \"groups\" && !hasGroups ? \"rows\"\n        : tab === \"measures\" && !hasMeasures ? \"rows\"\n            : tab;\n    const openGroup = (key: RowKey) => { setScope(key); setTab(\"rows\"); };\n\n    // ── Rows: one group at a time, or the whole plan SECTIONED by group ──\n    const scopeGroup = scope !== null && scope !== OTHER_SCOPE ? index.byKey.get(scope) : undefined;\n    const sections = useMemo<RowSection[]>(() => {\n        if (scope === OTHER_SCOPE) return [{ key: \"other\", rows: ungrouped.flatMap((r) => [r, ...dataRowsUnder(index, r.key)]) }];\n        if (scope !== null && index.byKey.has(scope)) return [{ key: scope, rows: dataRowsUnder(index, scope) }];\n        if (!hasGroups) return [{ key: \"all\", rows: allDataRows(index) }];\n        // Unscoped: every root group is a section under its own header (a tap\n        // scopes to it), so the grouping the desktop canvas shows as bands\n        // survives the trip instead of flattening into one anonymous list.\n        const out: RowSection[] = [];\n        const other: PlanRowValue[] = [];\n        for (const root of index.roots) {\n            if (root.kind.type !== \"group\") {\n                other.push(root);\n                appendAll(other, dataRowsUnder(index, root.key));\n                continue;\n            }\n            const members = derived.groupMembers.get(root.key);\n            out.push({\n                key: root.key,\n                header: {\n                    scope: root.key,\n                    label: root.gutter.label,\n                    meta: root.gutter.meta.type === \"some\" ? root.gutter.meta.value\n                        : (members !== undefined && members > 0 ? membersMeta(members, countPartial(root)) : undefined),\n                    value: root.gutter.value.type === \"some\" ? root.gutter.value.value : undefined,\n                    tone: root.status.type === \"some\" ? root.status.value.type : undefined,\n                },\n                rows: dataRowsUnder(index, root.key),\n            });\n        }\n        if (other.length > 0) {\n            out.push({\n                key: \"other\",\n                header: { scope: OTHER_SCOPE, label: words.m.otherRows(), meta: membersMeta(other.length, false), value: undefined, tone: undefined },\n                rows: other,\n            });\n        }\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- `membersMeta` reads only `words`, which is a dependency\n    }, [scope, index, ungrouped, hasGroups, derived, partial, words]);\n\n    // Keep the last revealed row by key. Prefetch may prepend an earlier\n    // window: a fixed count would then remove the card the reader jumped to,\n    // defeating native scroll anchoring and paging back towards the start.\n    const sectionRows = useMemo(() => sections.flatMap((section) => section.rows), [sections]);\n    const pageEnd = useRef<{ scope: RowKey | null; key: RowKey | undefined; requested: number } | undefined>(undefined);\n    const previous = pageEnd.current;\n    const end = previous?.scope === scope ? sectionRows.findIndex((row) => row.key === previous.key) : -1;\n    const rowLimit = Math.max(reveal.rows, end >= 0 ? end + 1 + Math.max(0, reveal.rows - previous!.requested) : 0);\n    useLayoutEffect(() => {\n        if (activeTab === \"rows\") pageEnd.current = {\n            scope, key: sectionRows[Math.min(rowLimit, sectionRows.length) - 1]?.key, requested: reveal.rows,\n        };\n    }, [activeTab, scope, sectionRows, rowLimit, reveal.rows]);\n\n    // The rows the cards draw (#1438): the group cards shown, one page of the Rows tab across its sections, or the\n    // measures shown — whatever the desktop's folds, which a card does not follow.\n    const groupsShown = useMemo(() => groupCards.slice(0, reveal.groups).map((card) => card.row), [groupCards, reveal.groups]);\n    const rowsShown = useMemo(() => sectionRows.slice(0, rowLimit), [sectionRows, rowLimit]);\n    const measuresShown = useMemo(() => chartRows.slice(0, reveal.measures), [chartRows, reveal.measures]);\n    const shownRows = activeTab === \"groups\" ? groupsShown : activeTab === \"rows\" ? rowsShown : measuresShown;\n    useEffect(() => { onShown?.(shownRows); }, [onShown, shownRows]);\n\n    // ── A row asked for from outside the canvas (#1198) ───────────────────\n    // Its group opened on the Rows tab, the list paged to it, and its card\n    // scrolled into view once drawn. A request made before the list mounted\n    // is the desktop canvas's, already served.\n    const scroll = usePlanSelector(selectScroll);\n    const requested = scroll.owner === \"search\" ? scroll.targetKey : scroll.owner === \"nav\" ? scroll.nav?.row : undefined;\n    const request = requested === undefined ? undefined\n        : `${scroll.owner}:${scroll.owner === \"search\" ? scroll.searchSeq : scroll.nav?.seq}`;\n    const served = useRef(request);\n    const scrollOwner = useRef(scroll.owner);\n    scrollOwner.current = scroll.owner;\n    const [revealing, setRevealing] = useState<RowKey | undefined>(undefined);\n    // Reveal before the parent releases the paging jump after commit. Otherwise\n    // the old cards report their viewport and pull residency back to that window.\n    useLayoutEffect(() => {\n        if (request === undefined || request === served.current || requested === undefined) return;\n        const row = index.byKey.get(requested);\n        if (row === undefined) return;\n        served.current = request;\n        let root = row;\n        for (let up = row.parent; up.type === \"some\";) {\n            const parent = index.byKey.get(up.value);\n            if (parent === undefined) break;\n            root = parent;\n            up = parent.parent;\n        }\n        const scoped = row.kind.type === \"group\" ? row.key\n            : root.key !== row.key && root.kind.type === \"group\" ? root.key : hasGroups ? OTHER_SCOPE : null;\n        const list = scoped === null ? allDataRows(index)\n            : scoped === OTHER_SCOPE ? ungrouped.flatMap((r) => [r, ...dataRowsUnder(index, r.key)])\n                : dataRowsUnder(index, scoped);\n        const at = row.kind.type === \"group\" ? 0 : list.findIndex((r) => r.key === row.key);\n        if (at < 0) return;\n        setTab(\"rows\");\n        setScope(scoped);\n        setReveal((r) => ({ ...r, rows: Math.max(r.rows, (Math.floor(at / PAGE_ROWS) + 1) * PAGE_ROWS) }));\n        setRevealing(row.key);\n        // A search's row is what the viewer asked for: selected, so it is told from the cards around it, as the Sheet selects a row it finds.\n        if (scroll.owner === \"search\" && row.kind.type !== \"group\") dispatch({ t: \"row.select\", key: row.key });\n    }, [request, requested, index, ungrouped, hasGroups, scroll.owner, dispatch]);\n\n    // ── Two-finger pan (§10) — one whole period per period width crossed ──\n    const listRef = useRef<HTMLDivElement | null>(null);\n    useLayoutEffect(() => {\n        if (revealing === undefined) return;\n        const card = [...(listRef.current?.querySelectorAll<HTMLElement>(\"[data-plan-card], [data-plan-scope]\") ?? [])]\n            .find((el) => (el.getAttribute(\"data-plan-card\") ?? el.getAttribute(\"data-plan-scope\")) === revealing);\n        // A search's row in the list's middle, never left at an edge among cards like it; an event's row only as far as it takes.\n        card?.scrollIntoView({ block: scrollOwner.current === \"search\" ? \"center\" : \"nearest\" });\n        setRevealing(undefined);\n    }, [revealing]);\n    // The list is a surface of the shared pointer core (`useSurfaceGestures`, east-ui-components' `src/pointer/`): which\n    // fingers it holds, and when two of them pan, are that rule's — a finger whose lift is never heard is let go of as\n    // the page's next first finger lands, so none is counted into a pan that never ends, nor against the two that pan.\n    // It takes fingers alone, and captures none: a card's tap stays the card's, and one finger's scroll the page's.\n    const [panning] = useState(newTwoFingerPan);\n    const periodPx = () => {\n        const w = listRef.current?.clientWidth ?? 0;\n        return w > 0 ? (w - 2 * BODY_INSET_PX) / scale.n : 0;\n    };\n    const listGestures = useSurfaceGestures(\n        twoFingerPan(panning, periodPx, (periods) => dispatch({ t: \"pan\", buckets: periods })),\n        { accepts: fingersOnly, capture: false });\n\n    const nowLine = scale.nowFrac !== undefined ? <NowLine styles={styles} at={scale.nowFrac} data-plan-axisline /> : null;\n\n    // One data row as a card — its facts computed here, its render memoized\n    // (`NarrowRowCard`), so a list that grows re-renders only what it adds.\n    const renderRowCard = (row: PlanRowValue, measures: boolean) => {\n        const isChart = row.kind.type === \"chart\";\n        // Measures stack at EXPANDED density (§10): force the chart's expanded\n        // branch (it still honours a declared fixed / expandedHeight).\n        const h = rowHeight({ row, depth: 0, collapsed: false }, dense,\n            measures && isChart ? new Set([row.key]) : view.chartsExpanded, undefined, derived);\n        const chartExpanded = row.kind.type === \"chart\" && (measures\n            || row.kind.value.height.type === \"expanded\" || view.chartsExpanded.has(row.key));\n        const drilled = view.focus !== null && view.focus.kind === \"expand\" && view.focus.key === row.key;\n        return (\n            <NarrowRowCard key={row.key} row={row} h={h} chartExpanded={chartExpanded}\n                selected={selected === row.key}\n                canDrill={canExpand && row.expand.type === \"some\"}\n                drill={drilled && expandBody !== null ? { body: expandBody, gutter: expandGutterBody } : undefined}\n                hasChildren={(index.children.get(row.key)?.length ?? 0) > 0}\n                styles={styles} derived={derived} storageKey={storageKey}\n                watch={watch} draft={marks.get(row.key)} unread={unread?.(row) === true} />\n        );\n    };\n\n    const revealMore = (key: NarrowTab) =>\n        setReveal((r) => ({ ...r, [key]: r[key] + (key === \"groups\" ? PAGE_GROUPS : PAGE_ROWS) }));\n    const more = (key: NarrowTab, label: string, then?: () => void) => (\n        <Box as=\"button\" css={styles.narrowMore} data-plan-more={key} onClick={() => { revealMore(key); then?.(); }}>\n            {label}\n        </Box>\n    );\n    // A list that shows every resident row while the source holds more\n    // (#812): the canvas's tail band in list form — placeholder cards at a\n    // row card's height, their title and meta bars, saying nothing (#1398,\n    // CL2, CL3). Scrolling them into view (the list's observer) demands the\n    // next window; once it lands, the list's own next page offers its rows.\n    // Keyed by where the unloaded run starts, so a landing that leaves them on\n    // screen re-arms the observer instead of stranding the list.\n    const loadMore = () => {\n        const tail = paging?.tail;\n        if (paging === undefined || tail === undefined) return null;\n        return <PendingTail key={`source-${tail.from}`} tail={tail} watch={watch} onLoadMore={paging.onLoadMore} styles={styles} />;\n    };\n\n    let list: ReactNode;\n    if (activeTab === \"groups\") {\n        const shown = groupCards.slice(0, reveal.groups);\n        const hidden = groupCards.slice(reveal.groups);\n        const hiddenRs = hidden.reduce((n, c) => n + (derived.groupMembers.get(c.row.key) ?? 0), 0);\n        list = (\n            <>\n                {shown.map(({ row, arm }) => {\n                    const members = derived.groupMembers.get(row.key);\n                    const meta = row.gutter.meta.type === \"some\"\n                        ? row.gutter.meta.value\n                        : (members !== undefined && members > 0 ? membersMeta(members, countPartial(row)) : undefined);\n                    const value = row.gutter.value.type === \"some\" ? row.gutter.value.value : undefined;\n                    const statusTone = row.status.type === \"some\" ? row.status.value.type : undefined;\n                    return (\n                        <Box key={row.key} css={styles.narrowCard} data-plan-groupcard={row.key}\n                            onClick={() => openGroup(row.key)}>\n                            <Box css={styles.narrowCardHead}>\n                                <Box css={styles.narrowCardTitle} data-group=\"\">{row.gutter.label}</Box>\n                                {meta !== undefined && <Box as=\"span\" css={styles.gutterMeta}>{meta}</Box>}\n                                <Box display=\"flex\" alignItems=\"center\" gap=\"6px\" marginLeft=\"auto\" flexShrink={0}>\n                                    {statusTone !== undefined && <Box as=\"span\" css={styles.statusDot} data-tone={statusTone}\n                                        role=\"img\" aria-label={statusText(statusTone, words)} />}\n                                    {value !== undefined && <Box as=\"span\" css={styles.gutterValue}>{value}</Box>}\n                                </Box>\n                            </Box>\n                            {arm !== undefined && (\n                                <Box css={styles.narrowCardBody} style={{ height: `${geometry.narrowStrip}px` }} data-plan-cardbody=\"group\">\n                                    <GridSeparators styles={styles} />\n                                    {derived.diagnostics.has(row.key) ? (\n                                        <RowDiagnostic diagnostic={derived.diagnostics.get(row.key)!} styles={styles} />\n                                    ) : (\n                                        <PlanPartBoundary part={{ kind: \"group\", label: row.gutter.label }} resetKey={arm} styles={styles}>\n                                            <HeatCells rowKey={row.key} cells={arm} styles={styles} onCellClick={() => openGroup(row.key)} />\n                                        </PlanPartBoundary>\n                                    )}\n                                    {nowLine}\n                                </Box>\n                            )}\n                        </Box>\n                    );\n                })}\n                {hidden.length > 0 ? more(\"groups\", words.m.moreGroups({\n                    n: hidden.length,\n                    count: words.number(hidden.length),\n                    members: hiddenRs > 0 ? membersText(hiddenRs) : undefined,\n                })) : loadMore()}\n                {ungrouped.length > 0 && (\n                    <Box css={styles.narrowCard} data-plan-groupcard=\"other\" onClick={() => openGroup(OTHER_SCOPE)}>\n                        <Box css={styles.narrowCardHead}>\n                            <Box css={styles.narrowCardTitle} data-group=\"\">{words.m.otherRows()}</Box>\n                            <Box as=\"span\" css={styles.gutterMeta}>{membersMeta(ungrouped.length, false)}</Box>\n                        </Box>\n                    </Box>\n                )}\n            </>\n        );\n    } else if (activeTab === \"rows\") {\n        const total = sections.reduce((n, s) => n + s.rows.length, 0);\n        const members = scopeGroup !== undefined ? derived.groupMembers.get(scopeGroup.key) : undefined;\n        const scopeValue = scopeGroup !== undefined && scopeGroup.gutter.value.type === \"some\" ? scopeGroup.gutter.value.value : undefined;\n        // ONE page across every section: a section prints its header once it\n        // has a card to show, and the load-more counts what is left overall.\n        let budget = rowLimit;\n        const body: ReactNode[] = [];\n        for (const s of sections) {\n            if (budget <= 0) break;\n            const shown = s.rows.slice(0, budget);\n            budget -= shown.length;\n            if (s.header !== undefined && shown.length > 0) {\n                const h = s.header;\n                body.push(\n                    <Box key={`section-${s.key}`} css={styles.narrowSection} data-plan-section={s.key}\n                        onClick={() => openGroup(h.scope)}>\n                        <Box css={styles.narrowSectionTitle}>{h.label}</Box>\n                        {h.meta !== undefined && <Box as=\"span\" css={styles.gutterMeta}>{h.meta}</Box>}\n                        <Box display=\"flex\" alignItems=\"center\" gap=\"6px\" marginLeft=\"auto\" flexShrink={0}>\n                            {h.tone !== undefined && <Box as=\"span\" css={styles.statusDot} data-tone={h.tone}\n                                role=\"img\" aria-label={statusText(h.tone, words)} />}\n                            {h.value !== undefined && <Box as=\"span\" css={styles.gutterValue}>{h.value}</Box>}\n                            <Box as=\"span\" css={styles.narrowSectionGo} aria-hidden><FontAwesomeIcon icon={faChevronRight} /></Box>\n                        </Box>\n                    </Box>,\n                );\n            }\n            for (const row of shown) body.push(renderRowCard(row, false));\n        }\n        const shownRows = rowLimit - Math.max(0, budget);\n        // What is left to show (#1398, ruled 27 Oct 2026, \"Exact where it can be\"). Over a paged source not read whole it\n        // is never what has loaded: the rows read and not shown yet, and every one the source holds past them, its run not\n        // read after the rows (`beyond`) — where the list is the source's rows one after another, as the Rows tab counts\n        // them; `…` while the source has not counted itself, and where the rows listed are a group's or the groups' that\n        // run on past the windows read. Else the rows not shown yet, which are all there are.\n        const unreadLeft = paging !== undefined && partial === true\n            && (scope === null || (scopeGroup !== undefined && countPartial(scopeGroup)));\n        const beyond = paging?.beyond;\n        const rest: number | \"pending\" = !unreadLeft ? total - shownRows\n            : scope === null && !hasGroups && beyond !== undefined ? Math.max(0, total - shownRows) + beyond : \"pending\";\n        // Past the rows read, the source's tail stands where the next of them go — its placeholder cards, asking for the\n        // window past the run as they come into view — and a tap past them asks for it at once.\n        const pastRead = unreadLeft && shownRows >= total;\n        const moreRows = rest === \"pending\" || rest > 0\n            ? more(\"rows\", words.m.moreRows(rest === \"pending\" ? { n: 2, count: \"…\" } : { n: rest, count: words.number(rest) }),\n                () => { if (unreadLeft && shownRows + PAGE_ROWS > total) paging?.onLoadMore(); })\n            : null;\n        list = (\n            <>\n                {(scopeGroup !== undefined || scope === OTHER_SCOPE) && (\n                    <Box css={styles.narrowScope} data-slot=\"narrowScope\" data-plan-scope={scopeGroup?.key}>\n                        {hasGroups && (\n                            <Box as=\"button\" css={styles.narrowBack} data-plan-back=\"\"\n                                onClick={() => { setScope(null); setTab(groupsIndex ? \"groups\" : \"rows\"); }}>\n                                {groupsIndex ? words.m.backToGroups() : words.m.backToAllRows()}\n                            </Box>\n                        )}\n                        <Box css={styles.narrowScopeTitle}>{scopeGroup !== undefined ? scopeGroup.gutter.label : words.m.otherRows()}</Box>\n                        <Box css={styles.narrowScopeMeta}>\n                            {[members !== undefined && members > 0 ? membersText(members) : undefined, scopeValue].filter(Boolean).join(\" · \")}\n                        </Box>\n                    </Box>\n                )}\n                {/* \"No rows\" only once a completed read says so (#1398, CL13): never while the source holds more. */}\n                {total === 0 && paging?.tail === undefined && <Box css={styles.narrowEmpty}>{words.m.noRows()}</Box>}\n                {body}\n                {unreadLeft ? <>{pastRead && loadMore()}{moreRows}</> : moreRows ?? loadMore()}\n            </>\n        );\n    } else {\n        const rest = chartRows.length - measuresShown.length;\n        list = (\n            <>\n                {measuresShown.map((row) => renderRowCard(row, true))}\n                {rest > 0 ? more(\"measures\", words.m.moreMeasures({ n: rest, count: words.number(rest) })) : loadMore()}\n            </>\n        );\n    }\n\n    // The tab strip is `<Tabs>` itself, in its line variant — underline only,\n    // no fill, the mono eyebrow grammar, the hairline baseline the active\n    // underline overlaps — so the strip cannot drift from the spec by\n    // re-declaring it, and brings Zag's keyboard and tabpanels (#819).\n    // Counts ride each label as plain numerals (never a tinted pill). Over a paged source the Rows tab counts what the\n    // source does, once its count is read — the rail's count, never the rows read so far — and a count that covers only\n    // what has landed is `…` (#1398, CL13). Its Measures tab counts the chart rows the source makes where each of its\n    // entries makes as many, and says they are not counted where that varies, as the Plan's event counts say theirs\n    // (ruled 27 Oct 2026) — never what has loaded either.\n    const rowCount = allDataRows(index).length;\n    const loaded = (n: number): TabCount => (partial !== true ? n : \"pending\");\n    const tabs: Array<{ key: NarrowTab; label: string; count: TabCount }> = [\n        ...(hasGroups ? [{ key: \"groups\" as const, label: words.m.tabGroups(), count: rootGroups.length }] : []),\n        { key: \"rows\" as const, label: words.m.tabRows(), count: pagedCount ?? loaded(rowCount) },\n        ...(hasMeasures ? [{\n            key: \"measures\" as const, label: words.m.tabMeasures(),\n            count: paging === undefined ? loaded(chartRows.length) : pagedMeasures ?? \"pending\",\n        }] : []),\n    ];\n\n    return (\n        <Tabs.Root asChild value={activeTab} onValueChange={(d) => setTab(d.value as NarrowTab)}\n            variant=\"line\" size=\"md\">\n            <Box css={styles.narrowRoot} data-plan-narrow data-plan-fill={fill ? \"\" : undefined}>\n                <Tabs.List data-slot=\"narrowTabs\" flexShrink={0}>\n                    {tabs.map((t) => (\n                        <Tabs.Trigger key={t.key} value={t.key} data-plan-tab={t.key}>\n                            {t.label}\n                            {/* \"…\" while it counts only what has landed: never a count the read has not finished (#1398, CL13);\n                                words where the source's entries make no fixed number of what it counts. */}\n                            <Box as=\"span\" css={styles.narrowTabCount} data-plan-tabcount={t.count}>\n                                {typeof t.count === \"number\" ? words.m.tabCount({ n: t.count, count: words.number(t.count) })\n                                    : t.count === \"notCounted\" ? words.m.tabNotCounted() : \"…\"}\n                            </Box>\n                        </Tabs.Trigger>\n                    ))}\n                </Tabs.List>\n                {/* One tabpanel per tab; the selected one IS the list. Only it\n                    wears the list's styles: a recipe `display` outranks the\n                    `hidden` Zag puts on the others. */}\n                {tabs.map((t) => (t.key !== activeTab ? <Tabs.Content key={t.key} value={t.key} /> : (\n                    <Tabs.Content key={t.key} value={t.key} ref={listRef} css={styles.narrowList} data-slot=\"narrowList\" {...listGestures}>\n                        <NarrowRuler styles={styles} />\n                        {/* A window whose read failed (#811) — said once, as the canvas's run says it (#1398, CL11):\n                            the reason and Retry, above whatever did land. */}\n                        {(failures ?? []).map((f) => {\n                            const range = { from: words.number(f.from + 1), to: words.number(f.to + 1) };\n                            return (\n                                <Box key={`failed-${f.w}`} css={styles.narrowCard} data-plan-failed={f.w}>\n                                    <Box css={styles.narrowCardHead}>\n                                        <LoadingFailedLine message={loadingLineText(words.m.lineFailed({ noun, ...range }))}\n                                            retry={{ onRetry: () => onRetry?.(f.w), label: words.m.retry(), name: words.m.retryRange({ noun, ...range }) }} />\n                                    </Box>\n                                </Box>\n                            );\n                        })}\n                        {list}\n                    </Tabs.Content>\n                )))}\n            </Box>\n        </Tabs.Root>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Where the links-focus ribbons go (R1, #818) — computed from the MODEL, never\n * measured from the DOM.\n *\n * A row's place is the body's own arithmetic: its top is the sum of the exact\n * heights of the body items above it (`usePlanBody`'s `heights`, the same\n * numbers the frame lays the rows out at), and its bar sits centred in its\n * plot cell — the row less the rule under it — at the geometry table's bar\n * height. A run's x is its window fraction across the plot. So the ribbons\n * follow the rows in the same render — a collapse, a chart toggle or a landing\n * window moves both at once — and they reach rows the virtualizer has not\n * mounted.\n *\n * A link's end meets its element where the element DRAWS (#1258): a run's bar\n * from its start, never narrower than the canvas's narrowest bar; a chip in\n * from its ends by the cell inset, never narrower than the narrowest chip; a\n * tile's cell in from its bucket's edges and its lane's; a mark across its\n * glyph, centred on its instant — each clipped to the plot as the plot clips\n * it. The widths are the geometry table's, the numbers the recipe draws them\n * at, so a tiny run's link leaves the end its bar shows, not the end its time\n * says.\n *\n * A bounded frame shows only part of its rows. An endpoint beyond that view\n * clamps to the edge it lies past and ends in a stub pointing toward its row\n * (`routeRibbon`); a ribbon with both ends past the same edge is not drawn. An\n * unbounded frame shows every row, so nothing clamps there. A row the body\n * does not hold is placed by the caller (`beyond`): a pinned row sits past the\n * rows' top, and a row in an evicted paged window sits at that window's offset\n * in its block's band (#823) — then clamps and stubs like any row out of view.\n *\n * Pure: no React, no DOM.\n *\n * @packageDocumentation\n */\n\nimport { rowKeyOf, type PlanBodyItem, type PlanLinkValue, type PlanRowValue } from \"../model.js\";\nimport type { PlanBucket, PlanScale } from \"../scale.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport { PLAN_CELL_INSET, type PlanGeometry } from \"../geometry.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport { quantityText } from \"../quantity.js\";\nimport type { PlanWords } from \"../words.js\";\nimport { routeRibbon, type RibbonEdgeSlot, type RibbonEnd, type RibbonOff, type RibbonPath } from \"../../shared/links/geometry.js\";\nimport { placeCaptions, ribbonWeight } from \"../../shared/links/captions.js\";\n\n// The weight, the caption measures and the off-window slot are the shared\n// link parts' (#1321).\nexport { RIBBON_CAPTION_CHAR, RIBBON_CAPTION_PAD, ribbonWeight } from \"../../shared/links/captions.js\";\nexport { RIBBON_SLOT_W, type RibbonEdgeSlot } from \"../../shared/links/geometry.js\";\n\n/** Where one body row sits, in the rows' own px. */\nexport interface RibbonSlot {\n    /** The row's top — the heights of every body item above it. */\n    top: number;\n    /** The row's height. */\n    height: number;\n    /** The height of the bar its runs draw (a collapsed parent's are slimmer). */\n    bar: number;\n}\n\n/** The canvas body as the ribbons see it. */\nexport interface RibbonBody {\n    /** Each body row's slot, by key. */\n    slots: ReadonlyMap<RowKey, RibbonSlot>;\n    /** Each unloaded band's top, by `block:at` (`\"0:tail\"`) — where a row in\n     *  an evicted window is placed from (#823). */\n    bands: ReadonlyMap<string, number>;\n    /** The canvas's geometry: the rule under every row, inside its height — a\n     *  row's plot cell, where its elements centre, is the row less it — the\n     *  bar a row outside the body is drawn at, and every width an element\n     *  draws at (#1258). */\n    geometry: Readonly<PlanGeometry>;\n    /** The body's full height — the sum of every item's. */\n    height: number;\n}\n\n/** Where a row the body does not hold is drawn: past an edge of the rows (a\n *  pinned row is above them), or AT a place in them — a row in an evicted\n *  paged window, at its window's offset in its block's band (#823). */\nexport type RibbonBeyond = { off: RibbonOff } | { y: number };\n\ntype BucketsKind = Extract<PlanRowValue[\"kind\"], { type: \"buckets\" }>[\"value\"];\ntype TileValue = BucketsKind[\"events\"][number];\ntype MarkValue = Extract<PlanRowValue[\"kind\"], { type: \"events\" }>[\"value\"][\"marks\"][number];\n\n/** A mark's glyph: its kind's shape, or the box its icon fits in. */\nexport type LinkedGlyph = \"dot\" | \"diamond\" | \"triangle\" | \"icon\";\n\n/** How the element a link's end names draws — what the end meets (#1258). */\nexport type LinkedDraw =\n    /** A run's bar: from its start, at least the canvas's narrowest bar wide, at its row's bar height. */\n    | { kind: \"bar\" }\n    /** A chip: in by the cell inset from its ends, at least the narrowest chip wide, at the chip height. */\n    | { kind: \"chip\" }\n    /** The cell a tile sits in: its bucket in by the cell inset, at least the narrowest cell wide; down,\n     *  `span` of the row's `lanes` from lane `lane`, in by the inset from them. */\n    | { kind: \"cell\"; lane: number; span: number; lanes: number }\n    /** A mark: its glyph, centred on its instant. */\n    | { kind: \"mark\"; glyph: LinkedGlyph };\n\n/** The element a link's end names: its instants, and how it draws. */\nexport interface LinkedElement {\n    start: PlanInstantValue;\n    end: PlanInstantValue;\n    draw: LinkedDraw;\n}\n\n/**\n * Where a tile's cell draws in its row, as `BucketsRow` places it: a row with\n * no lanes, a tile in no lane the row names, and every tile in a bucket such a\n * tile takes, fill the whole cell; any other tile's cell is its lane's.\n */\nfunction cellOf(kind: BucketsKind, tile: TileValue, bucket: PlanBucket | undefined, scale: PlanScale): LinkedDraw {\n    const lanes = kind.lanes.length;\n    if (lanes === 0) return { kind: \"cell\", lane: 0, span: 1, lanes: 1 };\n    const laneOf = (lane: TileValue[\"lane\"]): number | undefined => {\n        if (lane.type === \"none\") return undefined;\n        const i = kind.lanes.findIndex((l) => l.key === lane.value);\n        return i >= 0 ? i : undefined;\n    };\n    const lane = laneOf(tile.lane);\n    const whole: LinkedDraw = { kind: \"cell\", lane: 0, span: lanes, lanes };\n    if (lane === undefined) return whole;\n    // A lane-less tile in its bucket takes the whole cell, and this tile with it.\n    const shared = bucket !== undefined && kind.events.some((e) =>\n        laneOf(e.lane) === undefined && scale.renderBucketOf(e.at)?.index === bucket.index);\n    return shared ? whole : { kind: \"cell\", lane, span: 1, lanes };\n}\n\n/** A mark's glyph as `EventsRow` draws it outside a strip: its icon's box, else its kind's shape. */\nfunction glyphOf(mark: MarkValue): LinkedGlyph {\n    if (mark.icon.type === \"some\") return \"icon\";\n    return mark.kind.type === \"decision\" ? \"diamond\" : mark.kind.type === \"exception\" ? \"triangle\" : \"dot\";\n}\n\n/** A mark's glyph across and down, as the recipe draws it — a diamond turned 45° reaches √2 times its side. */\nfunction glyphSize(glyph: LinkedGlyph, g: Readonly<PlanGeometry>): { w: number; h: number } {\n    switch (glyph) {\n        case \"dot\": return { w: g.markDotWidth, h: g.markDotWidth };\n        case \"diamond\": return { w: g.markDiamondWidth * Math.SQRT2, h: g.markDiamondWidth * Math.SQRT2 };\n        case \"triangle\": return { w: g.markTriangleWidth, h: g.markTriangle };\n        case \"icon\": return { w: g.markIconWidth, h: g.markIconWidth };\n    }\n}\n\n/**\n * The element a link's end meets on its row: the one its run key names — a\n * run, a chip, a tile (met at the cell it sits in) or a mark — and how it\n * draws. A link's end that names an event meets it however the event draws\n * (#1192).\n *\n * @param row - The end's row\n * @param key - The element's key\n * @param scale - The shared scale (a tile's bucket)\n * @returns The element, or `undefined` when the row has no element of that key\n */\nexport function linkedElement(row: PlanRowValue, key: string, scale: PlanScale): LinkedElement | undefined {\n    const k = row.kind;\n    switch (k.type) {\n        case \"span\": {\n            const run = k.value.runs.find((r) => r.key === key);\n            return run !== undefined ? { start: run.start, end: run.end, draw: { kind: \"bar\" } } : undefined;\n        }\n        case \"cards\": {\n            const chip = k.value.chips.find((c) => c.key === key);\n            return chip !== undefined ? { start: chip.from, end: chip.to, draw: { kind: \"chip\" } } : undefined;\n        }\n        case \"buckets\": {\n            const tile = k.value.events.find((e) => e.key === key);\n            if (tile === undefined) return undefined;\n            const bucket = scale.renderBucketOf(tile.at);\n            const draw = cellOf(k.value, tile, bucket, scale);\n            return bucket !== undefined ? { start: bucket.start, end: bucket.end, draw } : { start: tile.at, end: tile.at, draw };\n        }\n        case \"events\": {\n            const mark = k.value.marks.find((m) => m.key === key);\n            return mark !== undefined ? { start: mark.at, end: mark.at, draw: { kind: \"mark\", glyph: glyphOf(mark) } } : undefined;\n        }\n        default:\n            return undefined;\n    }\n}\n\n/**\n * The body's rows as slots.\n *\n * @param items - The body items, in order\n * @param heights - Each item's exact height (`usePlanBody`)\n * @param geometry - The canvas's geometry table\n * @returns The slots and the body's height\n */\nexport function ribbonBody(\n    items: readonly PlanBodyItem[],\n    heights: readonly number[],\n    geometry: Readonly<PlanGeometry>,\n): RibbonBody {\n    const slots = new Map<RowKey, RibbonSlot>();\n    const bands = new Map<string, number>();\n    let y = 0;\n    items.forEach((item, i) => {\n        const h = heights[i] ?? 0;\n        if (item.kind === \"row\") {\n            // A row's runs ride the bar, a parent's folded or open — the rule `KindPlot` renders by.\n            slots.set(item.row.row.key, { top: y, height: h, bar: geometry.bar });\n        } else if (item.kind === \"band\") {\n            bands.set(`${item.band.block}:${item.band.at}`, y);\n        }\n        y += h;\n    });\n    return { slots, bands, geometry, height: y };\n}\n\n/** The part of the rows a bounded frame shows, in the rows' own px. */\nexport interface RibbonViewport {\n    top: number;\n    bottom: number;\n}\n\n/** One laid-out ribbon. */\nexport interface LaidRibbon extends RibbonPath {\n    /** The link's index in the root's `links` — its identity on the canvas. */\n    link: number;\n    from: RibbonEnd;\n    to: RibbonEnd;\n    /** Its stroke's width, by its quantity ({@link ribbonWeight}). */\n    weight: number;\n    /** The link's quantity caption (#824) — `undefined` for a link with no\n     *  quantity, which then shows no caption and no tooltip. */\n    label: string | undefined;\n}\n\n/** What {@link layoutRibbons} lays out from. */\nexport interface RibbonLayoutInput {\n    /** The root's link graph. */\n    links: readonly PlanLinkValue[];\n    /** The rows a links focus keeps at full height (the focus and its family) —\n     *  an edge with an end outside it is not drawn. */\n    visibleKeys: ReadonlySet<RowKey>;\n    body: RibbonBody;\n    /** Where a row the body does not hold is drawn ({@link RibbonBeyond});\n     *  `undefined` when it has no place — its edges are not drawn. */\n    beyond: (key: RowKey) => RibbonBeyond | undefined;\n    /** The element a link's end names, by row and run key ({@link linkedElement}). */\n    element: (rowKey: string, runKey: string) => LinkedElement | undefined;\n    scale: PlanScale;\n    /** The plot column, in the rows' own px. */\n    plot: { left: number; width: number };\n    /** What a bounded frame shows; `undefined` — the frame shows every row. */\n    viewport: RibbonViewport | undefined;\n    /** The canvas's words — a caption prints the link's quantity in them (#824). */\n    words: PlanWords;\n}\n\n/** One endpoint, and the slot its off-window run lands in. */\ninterface Endpoint {\n    end: RibbonEnd;\n    edgeSlot: RibbonEdgeSlot | undefined;\n}\n\n/**\n * An element's extent across the plot as it draws (#1258), from its extent on\n * the window, `x0` to `x1` px.\n */\nfunction drawnX(draw: LinkedDraw, x0: number, x1: number, g: Readonly<PlanGeometry>): [number, number] {\n    switch (draw.kind) {\n        case \"bar\":\n            return [x0, Math.max(x1, x0 + g.barMinWidth)];\n        case \"chip\":\n        case \"cell\": {\n            const left = x0 + PLAN_CELL_INSET;\n            const least = draw.kind === \"chip\" ? g.chipMinWidth : g.cellMinWidth;\n            return [left, left + Math.max(x1 - x0 - 2 * PLAN_CELL_INSET, least)];\n        }\n        case \"mark\": {\n            const half = glyphSize(draw.glyph, g).w / 2;\n            return [x0 - half, x0 + half];\n        }\n    }\n}\n\n/**\n * An element's extent down its row as it draws (#1258) — centred in the row's\n * plot cell (the row less its rule), or a tile's cell in its lane. A row with\n * no such element is met at its bar.\n */\nfunction drawnY(draw: LinkedDraw | undefined, slot: RibbonSlot, g: Readonly<PlanGeometry>): [number, number] {\n    const plotH = slot.height - g.rule;\n    const mid = slot.top + plotH / 2;\n    const around = (h: number): [number, number] => [mid - h / 2, mid + h / 2];\n    switch (draw?.kind) {\n        case undefined:\n        case \"bar\":\n            return around(slot.bar);\n        case \"chip\":\n            return around(g.chip);\n        case \"cell\": {\n            const top = slot.top + (draw.lane / draw.lanes) * plotH + PLAN_CELL_INSET;\n            return [top, top + Math.max(0, (draw.span / draw.lanes) * plotH - 2 * PLAN_CELL_INSET)];\n        }\n        case \"mark\":\n            return around(glyphSize(draw.glyph, g).h);\n    }\n}\n\n/**\n * One endpoint from the model: the element across the plot and down its row,\n * as it draws, clamped to the view.\n */\nfunction endpointOf(input: RibbonLayoutInput, rowKey: RowKey, runKey: string): Endpoint | undefined {\n    const { body, plot, scale, viewport } = input;\n    const g = body.geometry;\n    const plotRight = plot.left + plot.width;\n    // ── x: the element across the plot, as it draws ──\n    // An element touching the window keeps its window-clamped extent, drawn\n    // at least as wide as the canvas draws it and clipped where the plot\n    // clips it; one wholly outside the window lands at the plot edge it lies\n    // past, in a dashed slot. A row with no such element is met across its\n    // whole plot.\n    let leftX = plot.left;\n    let rightX = plotRight;\n    let offWindow: \"left\" | \"right\" | undefined;\n    const el = input.element(rowKey, runKey);\n    if (el !== undefined) {\n        const mark = el.draw.kind === \"mark\";\n        const f0 = scale.fracOf(el.start);\n        // A mark has one instant; anything else ends at its end's far edge.\n        const f1 = mark ? f0 : scale.endFracOf(el.end);\n        if (Number.isFinite(f0) && Number.isFinite(f1)) {\n            if (mark ? f0 < 0 : f1 <= 0) {\n                offWindow = \"left\";\n                rightX = leftX;\n            } else if (mark ? f0 > 1 : f0 >= 1) {\n                offWindow = \"right\";\n                leftX = rightX;\n            } else {\n                const [x0, x1] = drawnX(el.draw,\n                    plot.left + Math.max(0, f0) * plot.width, plot.left + Math.min(1, f1) * plot.width, g);\n                leftX = Math.min(plotRight, Math.max(plot.left, x0));\n                rightX = Math.min(plotRight, Math.max(plot.left, x1));\n            }\n        }\n    }\n    // ── y: the element down its row's plot cell, as it draws ──\n    let top: number;\n    let bottom: number;\n    let off: RibbonOff | undefined;\n    const slot = body.slots.get(rowKey);\n    if (slot !== undefined) {\n        [top, bottom] = drawnY(el?.draw, slot, g);\n    } else {\n        const place = input.beyond(rowKey);\n        if (place === undefined) return undefined;\n        if (\"off\" in place) {\n            // Past the rows' top (or end), meeting them there.\n            off = place.off;\n            top = off === \"above\" ? 0 : body.height - g.bar;\n        } else {\n            // In an evicted window (#823): at its window's offset in its\n            // block's band — the view clamps it below like any row.\n            top = Math.max(0, Math.min(body.height - g.bar, place.y));\n        }\n        bottom = top + g.bar;\n    }\n    // ── The view: an endpoint past one of its edges sits ON that edge ──\n    if (viewport !== undefined) {\n        const bar = bottom - top;\n        const mid = (top + bottom) / 2;\n        if (mid < viewport.top) {\n            off = \"above\";\n            top = viewport.top;\n            bottom = top + bar;\n        } else if (mid > viewport.bottom) {\n            off = \"below\";\n            bottom = viewport.bottom;\n            top = bottom - bar;\n        }\n    }\n    const end: RibbonEnd = off !== undefined ? { leftX, rightX, top, bottom, off } : { leftX, rightX, top, bottom };\n    // The slot draws only while its row is in view.\n    const edgeSlot = offWindow !== undefined && off === undefined\n        ? { x: leftX, y: top, h: bottom - top, side: offWindow }\n        : undefined;\n    return { end, edgeSlot };\n}\n\n/**\n * Lay out every drawable edge of the family.\n *\n * @param input - The model the ribbons follow\n * @returns The routed ribbons (in `links` order) and the off-window slots\n */\nexport function layoutRibbons(input: RibbonLayoutInput): { ribbons: LaidRibbon[]; edgeSlots: RibbonEdgeSlot[] } {\n    const { links, visibleKeys, words } = input;\n    // A link names its ends by run ref — a row id (#822) and a run key (#824);\n    // the body keys its rows by the ids' text.\n    const edges: { link: number; l: PlanLinkValue; fromKey: RowKey; toKey: RowKey }[] = [];\n    links.forEach((l, link) => {\n        const fromKey = rowKeyOf(l.from.row);\n        const toKey = rowKeyOf(l.to.row);\n        if (visibleKeys.has(fromKey) && visibleKeys.has(toKey)) edges.push({ link, l, fromKey, toKey });\n    });\n    // The weight is a third of the FAMILY's largest quantity — over every\n    // edge the focus gathers, so a link holds its weight as others scroll\n    // away. A link's size is its quantity's value (#824).\n    const size = (l: PlanLinkValue): number | undefined => (l.quantity.type === \"some\" ? Math.abs(l.quantity.value.value) : undefined);\n    const largest = edges.reduce((m, { l }) => Math.max(m, size(l) ?? 0), 0);\n    const ribbons: LaidRibbon[] = [];\n    const edgeSlots: RibbonEdgeSlot[] = [];\n    for (const { link, l, fromKey, toKey } of edges) {\n        const from = endpointOf(input, fromKey, l.from.run);\n        const to = endpointOf(input, toKey, l.to.run);\n        if (from === undefined || to === undefined) continue;\n        // Both ends past the same edge: nothing of it is in view.\n        if (from.end.off !== undefined && from.end.off === to.end.off) continue;\n        if (from.edgeSlot !== undefined) edgeSlots.push(from.edgeSlot);\n        if (to.edgeSlot !== undefined) edgeSlots.push(to.edgeSlot);\n        const weight = ribbonWeight(size(l), largest);\n        const label = l.quantity.type === \"some\" ? quantityText(l.quantity.value, words) : undefined;\n        // Semantic routing (`routeRibbon`): the link exits the source run's\n        // END and enters the destination's BEGINNING in every arrangement,\n        // nothing of it leaving the plot.\n        const bounds = { left: input.plot.left, right: input.plot.left + input.plot.width };\n        ribbons.push({ ...routeRibbon(from.end, to.end, weight, bounds), link, from: from.end, to: to.end, weight, label });\n    }\n    // Each caption kept inside the plot with its knockout, then stepped clear\n    // of any earlier one within 60 × 12 (the shared link parts' rule).\n    placeCaptions(ribbons, input.plot.left, input.plot.left + input.plot.width);\n    return { ribbons, edgeSlots };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The links-focus layer (R1) — `Plan links.html` (#1258): one ARROW per family\n * edge, out of its source run's end and into its destination run's start\n * (`shared/links/geometry.ts`), stroked at its WEIGHT — its quantity's third of the\n * family's largest, 2, 4 or 8, and 1.5 with none — in the muted ink over a\n * paper CASING one px either side, so it reads over any bar it crosses. Every\n * link's casing lies under every link's ink; the lit link is drawn last, over\n * the others. A caption sits on a paper knockout 12 tall, 4 either side of its\n * text: on an S's riser, a loopback's lane, or above a one-row link's source.\n * Nothing of the layer leaves the plot (ruled by the user): no route crosses\n * into the gutter, the canvas's first column, or past the plot's end\n * (`routeRibbon`'s drop and lift), a caption near an edge moves in, and the\n * plot clips what a halo or a casing would carry over its edge.\n *\n * Every endpoint comes from the MODEL (#818, `ribbon-layout.ts`): a row's\n * place is the body's own height arithmetic — or, for a row in an evicted\n * paged window, that window's offset in its block's band (#823) — and an\n * element's extent its window fraction across the plot, drawn as the geometry\n * table draws it (a bar at least its narrowest, a chip and a cell in by their\n * inset, a mark across its glyph, #1258). The layer is drawn inside the\n * frame's rows (`VirtualRows`' `overlay`), in their coordinates and their\n * stacking context, so it scrolls with them natively, re-lays out in the same\n * render as they do — a collapse, a chart toggle, a window landing — and lies\n * under the row controls and the now line. Nothing is measured but the\n * layer's own width (the plot's px) and, in a bounded frame, the view: how far\n * it has scrolled and how tall it is, which is what clamps an endpoint past an\n * edge to it, with a stub pointing toward its row.\n *\n * A linked element OUTSIDE the time window lands on its row's plot edge in a\n * dashed slot as tall as it draws, open toward the edge. Edges whose rows the\n * focus rails are not drawn. Each link names the figure it draws\n * (`data-plan-route`: `s`, `loop`, `feed`, `runoff`, `stub` or `band`).\n *\n * Each link is hit-testable along its centerline (its stroke and 5 either\n * side): hovering one lights it — the strong ink, drawn over the others — and\n * haloes the two elements it joins, 1px four outside them, and the canvas's one\n * tooltip shows its quantity caption (`root/overlays.tsx`, the labelled-mark\n * path) — a link with no quantity has no caption and no tooltip.\n * A click reports the link's element ref (`{ key, from, to }`, #824) to the\n * root's `onElementClick`, and the one overlay layer opens the root's popover\n * for it, reading the ref back from the hit path's attributes like any\n * element's.\n *\n * The drawing is the shared links layer's (`shared/links/layer.tsx`, #1321),\n * which the Allocation's links draw through too; this overlay lays Plan's\n * links out from its rows and names what a hit on each is.\n */\n\nimport { useCallback, useMemo, useRef, type RefObject } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { variant } from \"@elaraai/east\";\nimport { layoutRibbons, type LinkedElement, type RibbonBeyond, type RibbonBody } from \"./ribbon-layout.js\";\nimport { LinksLayer, type LinkRibbon } from \"../../shared/links/layer.js\";\nimport { useScrollTop } from \"../../shared/links/scroll.js\";\nimport { rowKeyOf, type PlanLinkValue } from \"../model.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport { usePlanResolvers, type PlanElementRefValue } from \"../context.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { useElementHeight, useElementWidth } from \"../use-element-height.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nconst NO_REF: RefObject<HTMLElement | null> = { current: null };\nconst NO_LAYOUT: ReturnType<typeof layoutRibbons> = { ribbons: [], edgeSlots: [] };\n\nexport interface LinksOverlayProps {\n    /** The resolved `plan` recipe styles (the `ribbons` slot). */\n    styles: Styles;\n    /** The decoded link graph. */\n    links: readonly PlanLinkValue[];\n    /** The full-height row set (focused row + family) — edges outside it skip. */\n    visibleKeys: ReadonlySet<string>;\n    /** The canvas body as the ribbons see it (`ribbonBody`). */\n    body: RibbonBody;\n    /** Where a row the body does not hold is drawn — past the rows' top (a\n     *  pinned row), or at its evicted window's place in its block's band (#823). */\n    beyond: (key: string) => RibbonBeyond | undefined;\n    /** The shared scale. */\n    scale: PlanScale;\n    /** The element a link's end names, by `(rowKey, runKey)` (`linkedElement`). */\n    element: (rowKey: string, runKey: string) => LinkedElement | undefined;\n    /** The grid's fixed track before the plot: the gutter (px). */\n    gutterPx: number;\n    /** A bounded frame's scroll element and the sticky chrome above its rows —\n     *  what the view is read from. Absent for an unbounded frame, which shows\n     *  every row. */\n    frame?: { scrollElRef: RefObject<HTMLElement | null>; headerRef: RefObject<HTMLElement | null> } | undefined;\n}\n\n/** The links-focus ribbon layer — `VirtualRows`' overlay, in the rows' coordinates. */\nexport function LinksOverlay({\n    styles, links, visibleKeys, body, beyond, scale, element, gutterPx, frame,\n}: LinksOverlayProps) {\n    const words = usePlanWords();\n    const { onElementClick } = usePlanResolvers();\n    const layerRef = useRef<HTMLDivElement | null>(null);\n    // The plot's px are the layer's width less the gutter's.\n    const width = useElementWidth(layerRef, true);\n    const plotWidth = width !== undefined ? width - gutterPx : 0;\n    // ── The view (a bounded frame only) — what clamps an endpoint ──\n    // The rows sit under the sticky chrome, so the view in the rows' own\n    // coordinates starts at the scroll offset and is the viewport less that\n    // chrome tall.\n    const bounded = frame !== undefined;\n    const viewportPx = useElementHeight(frame?.scrollElRef ?? NO_REF, bounded);\n    const headerPx = useElementHeight(frame?.headerRef ?? NO_REF, bounded);\n    const scrollTop = useScrollTop(frame?.scrollElRef ?? NO_REF, bounded);\n    const viewTop = bounded && viewportPx !== undefined ? scrollTop : undefined;\n    const viewBottom = bounded && viewportPx !== undefined\n        ? scrollTop + Math.max(0, viewportPx - (headerPx ?? 0))\n        : undefined;\n    const layout = useMemo(() => (plotWidth > 0\n        ? layoutRibbons({\n            links, visibleKeys, body, beyond, element, scale,\n            plot: { left: gutterPx, width: plotWidth },\n            viewport: viewTop !== undefined && viewBottom !== undefined ? { top: viewTop, bottom: viewBottom } : undefined,\n            words,\n        })\n        : NO_LAYOUT), [links, visibleKeys, body, beyond, element, scale, gutterPx, plotWidth, viewTop, viewBottom, words]);\n    const ribbons = useMemo((): LinkRibbon[] => layout.ribbons.map((r) => ({ ...r, id: r.link })), [layout]);\n    // A hit on a link names its ref — the canvas's tooltip reads its caption,\n    // and a click opens the root's popover for it (`refOfElement`) and reports it.\n    const hit = useCallback((r: LinkRibbon) => {\n        const l = links[r.id]!;\n        return {\n            \"data-link-key\": l.key,\n            \"data-link-from\": rowKeyOf(l.from.row), \"data-link-from-run\": l.from.run,\n            \"data-link-to\": rowKeyOf(l.to.row), \"data-link-to-run\": l.to.run,\n            onClick: () => onElementClick?.(variant(\"link\", { key: l.key, from: l.from, to: l.to }) as PlanElementRefValue),\n        };\n    }, [links, onElementClick]);\n    // Drawn inside the treegrid, over its rows, and pointer-only: a reader\n    // hears the family from the rows' own Upstream / Downstream / Linked Tags\n    // and the focus announcement instead (#819). A ribbon's `aria-label`\n    // stays — it is the tooltip's text.\n    return (\n        <Box ref={layerRef} css={styles.ribbons} data-plan-ribbons aria-hidden=\"true\">\n            <LinksLayer ribbons={ribbons} edgeSlots={layout.edgeSlots} width={width} height={body.height}\n                clip={{ left: gutterPx, width: plotWidth }} hit={hit} />\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * THE Plan state machine (`Plan Spec.md` §6.1) — every piece of interaction\n * state in one pure reducer: no React, no DOM, no East values.\n * {@link planReducer} answers one event, and the store around it carries the\n * declared-collapse bookkeeping that lets a host data commit RECONCILE the UI\n * state instead of resetting it (#610). Side effects are returned as data\n * (`PlanEffect[]`) and run by the canvas controller INSIDE the action that\n * produced them, right after the transition (#815) — no reducer ever performs\n * them, and no batch waits for a later drain.\n *\n * The slice is the single source of truth for window / resolution / filters —\n * the machine holds only ephemeral UI state and emits `slice.*` effects for\n * the component to write through the bind handle. Brush pixel geometry lives\n * in the shared `slice/brush-strip.tsx` gesture machine; the reducer tracks\n * only whether a brush drag is in flight (the esc-ladder rung) and receives\n * the committed window as instants.\n *\n * Non-negotiable transition rules (unit-tested as a table in\n * `plan-state.test.ts`):\n *\n * - **Esc ladder**, strict precedence, exactly one rung per press:\n *   brush-cancel → focus-return (links / expand) → deselect. (Drag-cancel\n *   belongs to the shared drag layer, which owns the drag lifecycle — the\n *   machine's own drag staging was deleted as dead code, #569.)\n * - **Windows are instants** (#631): a committed brush window and the\n *   `slice.setRange` effect carry `PlanInstantValue`s on the axis's arm;\n *   the component writes them as the slice arm the axis speaks.\n * - **One row focus per canvas** (R1 links / R2 expand): invoking a second\n *   focus control returns the first; invoking the active row's own control\n *   returns it.\n * - **Grain changes rows, never the axis**: `grain.set` clears `selected`,\n *   keeps `expanded` / the window.\n * - **One selection** (#1197, the Calendar's B15): a row — at the bucket a\n *   click on its plot named — or events on the canvas. An event's click\n *   selects it and its row, Shift / ⌘ / Ctrl adding or removing it; selecting\n *   a row takes the events away; the esc ladder's deselect rung clears all of\n *   it at once. Events selected from outside the canvas — the overlaps chip's\n *   pair, a peer the inspector's banner names (#1198) — replace the selection\n *   whole, on their row.\n *\n * The hover CURSOR (hairline + ruler chip) is NOT machine state: it is\n * display-only chrome written straight to the DOM by the canvas's cursor\n * controller (#609) — routing a pointermove through a reducer re-rendered\n * every mounted row once per event.\n *\n * @packageDocumentation\n */\n\nimport { instantKey, type PlanInstantValue } from \"./instant.js\";\n\n/** A row's stable key (never an index — the flat row array reorders). */\nexport type RowKey = string;\n\n/** The §5 grains. */\nexport type PlanGrain = \"group\" | \"resource\";\n\n/** All ephemeral UI state — one object, one reducer. */\nexport interface PlanUiState {\n    /** The active grain (initial from the IR; explicit fold-all actions use resource). */\n    grain: PlanGrain;\n    /** Collapsed rows — any row with children (#822; keys present = COLLAPSED —\n     *  rows carry the initial set). */\n    collapsed: ReadonlySet<RowKey>;\n    /** The selected row, if any (`--brand-tint`, the one selection colour). */\n    selected: RowKey | null;\n    /** The bucket a click on the selected row's plot named — its start instant — or `null`: what an inspector reads the row's measures at (#1197). */\n    selectedAt: PlanInstantValue | null;\n    /** The selected events, by their elements' keys (#1197, the Calendar's B15): a click selects one, Shift, ⌘ or Ctrl adds or removes one. */\n    elements: readonly string[];\n    /** Chart rows toggled from spark to expanded. */\n    chartsExpanded: ReadonlySet<RowKey>;\n    /** Whether a horizon-brush drag is in flight (esc-ladder rung). */\n    brush: { active: true } | null;\n    /** The row-scoped focus (R1 links / R2 expand) — at most one per canvas. */\n    focus: { kind: \"links\" | \"expand\"; key: RowKey } | null;\n}\n\n/** Every interaction the surface can report. */\nexport type PlanEvent =\n    | { t: \"grain.set\"; grain: PlanGrain }\n    | { t: \"group.toggle\"; key: RowKey }\n    /** One atomic fold of every parent, including nested parents. */\n    | { t: \"groups.set\"; keys: readonly RowKey[]; collapsed: boolean }\n    /** A row selected — `at`, the bucket a click on its plot named (#1197). */\n    | { t: \"row.select\"; key: RowKey; at?: PlanInstantValue | undefined }\n    /** An event's element selected on its row (#1197) — `additive` adds or removes it (Shift, ⌘ or Ctrl). */\n    | { t: \"element.select\"; key: string; row: RowKey; additive: boolean }\n    /**\n     * Events selected from outside the canvas (#1198) — the overlaps chip's\n     * pair, a peer the inspector's banner names — by their elements' keys: the\n     * selection replaced by them, on the row that draws them, or on none when\n     * none does (the viewer hid the series).\n     */\n    | { t: \"elements.select\"; keys: readonly string[]; row: RowKey | null }\n    | { t: \"chart.toggle\"; key: RowKey }\n    | { t: \"brush.down\" }\n    | { t: \"brush.commit\"; min: PlanInstantValue; max: PlanInstantValue }\n    | { t: \"brush.clear\" }\n    | { t: \"brush.up\" }\n    | { t: \"focus.links\"; key: RowKey }\n    | { t: \"focus.expand\"; key: RowKey }\n    | { t: \"focus.clear\" }\n    /** A zoom to a resolution — about the middle given, in the axis's numbers: a coarser table cell's period, where a\n     *  double click on it zooms to edit it (#1438) — else about the window's own middle. */\n    | { t: \"resolution.set\"; resolution: string; about?: number | undefined }\n    /** A window pan of N whole periods — the narrow layout's two-finger\n     *  horizontal drag (§10); the `[` / `]` keys are the one-period case. */\n    | { t: \"pan\"; buckets: number }\n    | { t: \"key\"; key: \"esc\" | \"n\" | \"[\" | \"]\" | \"g\" };\n\n/** Side effects, returned as data — never performed in the reducer. */\nexport type PlanEffect =\n    | { t: \"slice.setRange\"; min: PlanInstantValue; max: PlanInstantValue }\n    | { t: \"slice.clearRange\" }\n    | { t: \"slice.setResolution\"; resolution: string; about?: number | undefined }\n    | { t: \"emit.select\"; key: RowKey }\n    | { t: \"emit.groupToggle\"; key: RowKey; expanded: boolean }\n    | { t: \"emit.grainChange\"; grain: PlanGrain }\n    | { t: \"scroll.toNow\" }\n    | { t: \"pan\"; buckets: number };\n\n/** The §5 grains, in the order the `g` key cycles them and the toolbar's\n *  grain segment lists them (#632) — one list, so the two cannot drift. */\nexport const PLAN_GRAINS: readonly PlanGrain[] = [\"group\", \"resource\"];\n\n/** The initial UI state for a decoded root. */\nexport function initialPlanState(\n    grain: PlanGrain,\n    collapsedKeys: Iterable<RowKey>,\n): PlanUiState {\n    return {\n        grain,\n        collapsed: new Set(collapsedKeys),\n        selected: null,\n        selectedAt: null,\n        elements: NO_ELEMENTS,\n        chartsExpanded: new Set(),\n        brush: null,\n        focus: null,\n    };\n}\n\nfunction toggled(set: ReadonlySet<RowKey>, key: RowKey): ReadonlySet<RowKey> {\n    const next = new Set(set);\n    if (next.has(key)) next.delete(key);\n    else next.add(key);\n    return next;\n}\n\n/** No event selected — one shared list. */\nconst NO_ELEMENTS: readonly string[] = [];\n\n/** Whether two bucket instants are the same — `null` for none. */\nfunction sameAt(a: PlanInstantValue | null, b: PlanInstantValue | null): boolean {\n    return a === null || b === null ? a === b : instantKey(a) === instantKey(b);\n}\n\n/** Nothing selected: no row, no bucket, no event. */\nfunction deselected(s: PlanUiState): PlanUiState {\n    return { ...s, selected: null, selectedAt: null, elements: NO_ELEMENTS };\n}\n\n/**\n * The pure transition function: `(state, event, ctx) → { state, effects }`.\n *\n * @param s - The current UI state\n * @param e - The interaction event\n * @returns The next state plus the effects the component must run\n */\nexport function planReducer(\n    s: PlanUiState,\n    e: PlanEvent,\n): { state: PlanUiState; effects: PlanEffect[] } {\n    switch (e.t) {\n        case \"grain.set\": {\n            if (e.grain === s.grain) return { state: s, effects: [] };\n            // Grain changes rows, never the axis: selection resets,\n            // collapsed / window survive.\n            return {\n                state: { ...deselected(s), grain: e.grain, focus: null },\n                effects: [{ t: \"emit.grainChange\", grain: e.grain }],\n            };\n        }\n        case \"group.toggle\": {\n            const collapsed = toggled(s.collapsed, e.key);\n            return {\n                state: { ...s, collapsed },\n                effects: [{ t: \"emit.groupToggle\", key: e.key, expanded: !collapsed.has(e.key) }],\n            };\n        }\n        case \"groups.set\": {\n            const collapsed = new Set(s.collapsed);\n            const effects: PlanEffect[] = [];\n            for (const key of e.keys) {\n                if (collapsed.has(key) !== e.collapsed) effects.push({ t: \"emit.groupToggle\", key, expanded: !e.collapsed });\n                if (e.collapsed) collapsed.add(key); else collapsed.delete(key);\n            }\n            // The old grain can hide an otherwise opened parent. Bulk folding\n            // uses the real row folds, preserving selection, drafts and charts.\n            if (s.grain !== \"resource\") effects.push({ t: \"emit.grainChange\", grain: \"resource\" });\n            return { state: { ...s, grain: \"resource\", collapsed, focus: null }, effects };\n        }\n        case \"row.select\": {\n            // Selection is idempotent — re-clicking the selected row holds. A\n            // row selected is the selection: the events selected on it go. A\n            // click that names no bucket keeps the one its row has: the plot\n            // names it first, and what was clicked in it selects the row after.\n            const at = e.at ?? (s.selected === e.key ? s.selectedAt : null);\n            if (s.selected === e.key && s.elements.length === 0 && sameAt(s.selectedAt, at)) return { state: s, effects: [] };\n            return {\n                state: { ...s, selected: e.key, selectedAt: at, elements: NO_ELEMENTS },\n                effects: s.selected === e.key ? [] : [{ t: \"emit.select\", key: e.key }],\n            };\n        }\n        case \"element.select\": {\n            // The Calendar's B15 (#1197): a click selects the one event, and\n            // Shift, ⌘ or Ctrl adds it to the selection or takes it out. Its\n            // row is the selected row, as an element's click always made it.\n            const has = s.elements.includes(e.key);\n            const elements = e.additive\n                ? (has ? s.elements.filter((k) => k !== e.key) : [...s.elements, e.key])\n                : (has && s.elements.length === 1 ? s.elements : [e.key]);\n            if (s.selected === e.row && s.selectedAt === null && elements === s.elements) return { state: s, effects: [] };\n            return {\n                state: { ...s, selected: e.row, selectedAt: null, elements },\n                effects: s.selected === e.row ? [] : [{ t: \"emit.select\", key: e.row }],\n            };\n        }\n        case \"elements.select\": {\n            // The overlaps chip's pair, a banner's peer (#1198): the selection\n            // replaced whole, the same list kept when it already is the one.\n            const same = e.keys.length === s.elements.length && e.keys.every((k, i) => k === s.elements[i]);\n            const elements = same ? s.elements : e.keys.length === 0 ? NO_ELEMENTS : [...e.keys];\n            if (s.selected === e.row && s.selectedAt === null && elements === s.elements) return { state: s, effects: [] };\n            return {\n                state: { ...s, selected: e.row, selectedAt: null, elements },\n                effects: e.row === null || s.selected === e.row ? [] : [{ t: \"emit.select\", key: e.row }],\n            };\n        }\n        case \"chart.toggle\":\n            return { state: { ...s, chartsExpanded: toggled(s.chartsExpanded, e.key) }, effects: [] };\n        case \"brush.down\":\n            return { state: { ...s, brush: { active: true } }, effects: [] };\n        // NO brush.preview event: a mid-drag preview changes no machine state,\n        // and routing it through the store cost a full canvas render per\n        // pointer step with the OLD window, before the write rendered it again\n        // with the new one (#609). The HorizonBrush\n        // applies previews directly to the slice, coalesced per animation\n        // frame; only the state-bearing gesture events (down / commit /\n        // clear / up — the esc rung) belong to the machine.\n        case \"brush.commit\":\n            // The machine never stores a window — the slice is the single\n            // source of truth; the committed range goes straight through.\n            return { state: { ...s, brush: null }, effects: [{ t: \"slice.setRange\", min: e.min, max: e.max }] };\n        case \"brush.clear\":\n            return { state: { ...s, brush: null }, effects: [{ t: \"slice.clearRange\" }] };\n        case \"brush.up\":\n            // The gesture ended, however it ended — INCLUDING the\n            // sub-threshold release that emits neither a commit nor a clear.\n            // Disarm the esc rung; never a slice write (#615). The rung\n            // exists only while a pointer is actually down on the strip.\n            if (s.brush === null) return { state: s, effects: [] };\n            return { state: { ...s, brush: null }, effects: [] };\n        case \"focus.links\":\n            // Toggle on the focused row; switching rows (or from expand)\n            // returns the first and focuses the new one — one per canvas.\n            if (s.focus !== null && s.focus.kind === \"links\" && s.focus.key === e.key) {\n                return { state: { ...s, focus: null }, effects: [] };\n            }\n            return { state: { ...s, focus: { kind: \"links\", key: e.key } }, effects: [] };\n        case \"focus.expand\":\n            if (s.focus !== null && s.focus.kind === \"expand\" && s.focus.key === e.key) {\n                return { state: { ...s, focus: null }, effects: [] };\n            }\n            return { state: { ...s, focus: { kind: \"expand\", key: e.key } }, effects: [] };\n        case \"focus.clear\":\n            if (s.focus === null) return { state: s, effects: [] };\n            return { state: { ...s, focus: null }, effects: [] };\n        case \"resolution.set\":\n            return { state: s, effects: [{ t: \"slice.setResolution\", resolution: e.resolution, about: e.about }] };\n        case \"pan\":\n            // A pure slice write, like the keys — a zero pan is identity so a\n            // gesture that never crossed a period edge commits nothing.\n            if (e.buckets === 0) return { state: s, effects: [] };\n            return { state: s, effects: [{ t: \"pan\", buckets: e.buckets }] };\n        case \"key\":\n            return keyEvent(s, e.key);\n    }\n}\n\n/** The keyboard map (§11) — esc runs the strict one-rung ladder. */\nfunction keyEvent(s: PlanUiState, key: \"esc\" | \"n\" | \"[\" | \"]\" | \"g\"): { state: PlanUiState; effects: PlanEffect[] } {\n    switch (key) {\n        case \"esc\": {\n            // Exactly one rung per press, strict precedence. (A drag in\n            // flight is the shared drag LAYER's escape, not the machine's.)\n            if (s.brush !== null) return { state: { ...s, brush: null }, effects: [] };\n            if (s.focus !== null) return { state: { ...s, focus: null }, effects: [] };\n            // One rung clears the selection whole: the row, its bucket and the events.\n            if (s.selected !== null || s.elements.length > 0) return { state: deselected(s), effects: [] };\n            return { state: s, effects: [] };\n        }\n        case \"n\":\n            return { state: s, effects: [{ t: \"scroll.toNow\" }] };\n        case \"[\":\n            return { state: s, effects: [{ t: \"pan\", buckets: -1 }] };\n        case \"]\":\n            return { state: s, effects: [{ t: \"pan\", buckets: 1 }] };\n        case \"g\": {\n            const next = PLAN_GRAINS[(PLAN_GRAINS.indexOf(s.grain) + 1) % PLAN_GRAINS.length]!;\n            return {\n                state: { ...deselected(s), grain: next, focus: null },\n                effects: [{ t: \"emit.grainChange\", grain: next }],\n            };\n        }\n    }\n}\n\n// ── The controller-facing store (#610) ─────────────────────────────────────\n//\n// `planReducer` answers one event. The STORE reducer is what the canvas\n// controller runs (#815): it adds the bookkeeping that lets a host data commit\n// RECONCILE the ephemeral UI state instead of resetting it, and hands each\n// transition's effects back to the controller, which runs them in the same\n// action. A Save, or any other Reactive write the series read, is \"the data\n// changed\"; open groups, expanded charts, selection\n// and focus must all survive it, dropping only the entries whose rows are\n// actually gone. The user's own collapse toggles and expanded charts also\n// outlive the component: the canvas persists them under its `storageKey`, and\n// a remount restores them over the declaration (#813).\n\n/** The UI store: UI state + collapse seeding + the user's toggles. */\nexport interface PlanStore {\n    /** The ephemeral UI state. */\n    ui: PlanUiState;\n    /**\n     * Declared-collapse keys already applied once. A declared key seeds\n     * `collapsed` the FIRST time its row appears and never again, so a group\n     * the user has since opened stays open across value changes and paged\n     * window landings alike. A key that vanishes is pruned; if it later\n     * returns it is a NEW row and re-seeds.\n     */\n    seeded: ReadonlySet<RowKey>;\n    /**\n     * The collapse of every row the USER toggled (`true` = collapsed) — what\n     * a remount restores (#813), and what a bound `ui` state's `collapsed` and\n     * `expanded` lists hold (#824). The declaration only seeds rows the user\n     * never touched; a toggle outranks it from then on, for rows resident or\n     * not. Kept apart from `collapsed` because a restored toggle must outlive\n     * the rows being absent (a paged window not yet landed).\n     */\n    overrides: ReadonlyMap<RowKey, boolean>;\n    /** The declared initial grain, as of the last reconcile — a CHANGED\n     *  declaration is adopted (it re-derives the rows, like `grain.set`);\n     *  an unchanged one leaves the user's grain alone. */\n    declaredGrain: PlanGrain;\n}\n\n/** One store transition: the next store, and the effects its action must run. */\nexport interface PlanStoreStep {\n    /** The next store — the same object when nothing changed. */\n    store: PlanStore;\n    /** The effects to run, in order, after the transition. */\n    effects: readonly PlanEffect[];\n}\n\n/** No effects — one shared list. */\nconst NO_EFFECTS: readonly PlanEffect[] = [];\n\n/** Everything the store reducer handles. */\nexport type PlanAction =\n    /** An interaction event — the machine transition plus its effects. */\n    | { t: \"event\"; e: PlanEvent }\n    /**\n     * The host's data changed (a new decoded value): drop per-row state whose\n     * rows vanished, seed never-seen declared collapse, keep everything else.\n     */\n    | {\n        t: \"reconcile\";\n        /** Every row key the new value holds. */\n        alive: ReadonlySet<RowKey>;\n        /**\n         * Whether `alive` is EVERY row the canvas has (#813). An inline\n         * collection's keys are all here; a paged source's resident rows are\n         * not all its rows — a key missing from them may simply not have\n         * landed — so an incomplete set prunes nothing.\n         */\n        complete: boolean;\n        /** The new value's declared-collapsed row keys. */\n        declaredCollapsed: ReadonlySet<RowKey>;\n        /** The new value's declared initial grain. */\n        declaredGrain: PlanGrain;\n    }\n    /**\n     * Rows arrived WITHOUT a data change (a paged window landed): seed\n     * never-seen declared collapse and drop nothing — eviction must not\n     * erase state the user still owns.\n     */\n    | { t: \"seed\"; declaredCollapsed: ReadonlySet<RowKey> }\n    /**\n     * The host wrote the canvas's bound `ui` state (#824): its selection, the\n     * rows it folds or opens against their declaration, and its expanded\n     * charts replace the canvas's own. A row in neither fold list follows its\n     * declaration again. No callback fires — the host made the change, and\n     * echoing it back to the host would loop.\n     */\n    | {\n        t: \"external\";\n        /** The selected row, if any. */\n        selected: RowKey | null;\n        /** Each overridden row's collapse (`true` = folded, `false` = opened). */\n        collapse: ReadonlyMap<RowKey, boolean>;\n        /** The expanded chart rows. */\n        charts: ReadonlySet<RowKey>;\n    };\n\n/** What a remount restores (#813) — the user's own toggles, nothing else. */\nexport interface PlanRestored {\n    /** The collapse of each row the user toggled (`true` = collapsed). */\n    collapse: Iterable<readonly [RowKey, boolean]>;\n    /** The chart rows the user expanded. */\n    charts: Iterable<RowKey>;\n}\n\n/** Whether a row starts collapsed: the user's toggle if there is one, else\n *  the declaration. */\nfunction collapsedBy(overrides: ReadonlyMap<RowKey, boolean>, key: RowKey, declared: boolean): boolean {\n    return overrides.get(key) ?? declared;\n}\n\n/**\n * The initial store for a decoded root (declared collapse counts as seeded).\n *\n * @param grain - The declared grain\n * @param collapsedKeys - The declared-collapsed row keys\n * @param restored - The user's persisted toggles, when a remount restores them\n *   (#813): a toggled row keeps its toggle, and only the rows the user never\n *   touched take the declaration\n * @returns The store\n */\nexport function initialPlanStore(grain: PlanGrain, collapsedKeys: Iterable<RowKey>, restored?: PlanRestored): PlanStore {\n    const seeded = new Set(collapsedKeys);\n    const overrides = new Map<RowKey, boolean>(restored?.collapse ?? []);\n    const collapsed = new Set<RowKey>();\n    for (const key of seeded) if (collapsedBy(overrides, key, true)) collapsed.add(key);\n    for (const [key, isCollapsed] of overrides) if (isCollapsed) collapsed.add(key);\n    return {\n        ui: { ...initialPlanState(grain, collapsed), chartsExpanded: new Set(restored?.charts ?? []) },\n        seeded,\n        overrides,\n        declaredGrain: grain,\n    };\n}\n\n/** `map` minus the keys `alive` lacks — the same identity when nothing drops. */\nfunction prunedMap<V>(map: ReadonlyMap<RowKey, V>, alive: ReadonlySet<RowKey>): ReadonlyMap<RowKey, V> {\n    let changed = false;\n    const next = new Map<RowKey, V>();\n    for (const [key, value] of map) {\n        if (alive.has(key)) next.set(key, value);\n        else changed = true;\n    }\n    return changed ? next : map;\n}\n\n/** `set` minus the keys `alive` lacks — the same identity when nothing drops. */\nfunction pruned(set: ReadonlySet<RowKey>, alive: ReadonlySet<RowKey>): ReadonlySet<RowKey> {\n    let changed = false;\n    const next = new Set<RowKey>();\n    for (const key of set) {\n        if (alive.has(key)) next.add(key);\n        else changed = true;\n    }\n    return changed ? next : set;\n}\n\n/** `set` plus `keys` — the same identity when every key is already present. */\nfunction grown(set: ReadonlySet<RowKey>, keys: readonly RowKey[]): ReadonlySet<RowKey> {\n    const missing = keys.filter((key) => !set.has(key));\n    if (missing.length === 0) return set;\n    const next = new Set(set);\n    for (const key of missing) next.add(key);\n    return next;\n}\n\n/**\n * The store transition — pure, like everything here. The effects come back\n * with the next store and the caller runs them; nothing waits in the store.\n *\n * @param store - The current store\n * @param a - The action\n * @returns The next store — `store` itself when nothing changed — and the\n *   effects the action must run\n */\nexport function planStoreReducer(store: PlanStore, a: PlanAction): PlanStoreStep {\n    switch (a.t) {\n        case \"event\": {\n            const { state, effects } = planReducer(store.ui, a.e);\n            if (state === store.ui && effects.length === 0) return { store, effects: NO_EFFECTS };\n            // A toggle is the user's word on that row from now on (#813).\n            let overrides = store.overrides;\n            if (a.e.t === \"group.toggle\") overrides = new Map(overrides).set(a.e.key, state.collapsed.has(a.e.key));\n            else if (a.e.t === \"groups.set\") {\n                const next = new Map(overrides);\n                for (const key of a.e.keys) next.set(key, a.e.collapsed);\n                overrides = next;\n            }\n            const next = state === store.ui && overrides === store.overrides\n                ? store\n                : { ...store, ui: state, overrides };\n            return { store: next, effects };\n        }\n        case \"reconcile\": {\n            // Only a COMPLETE key set says a row is gone. A paged source's\n            // resident rows are not all its rows, so it prunes nothing: a toggle\n            // on a row in an unlanded window is kept for when it lands (#813).\n            const alive = a.alive;\n            const fresh = [...a.declaredCollapsed].filter((key) => !store.seeded.has(key));\n            const seedCollapsed = fresh.filter((key) => collapsedBy(store.overrides, key, true));\n            const collapsed = grown(a.complete ? pruned(store.ui.collapsed, alive) : store.ui.collapsed, seedCollapsed);\n            const chartsExpanded = a.complete ? pruned(store.ui.chartsExpanded, alive) : store.ui.chartsExpanded;\n            const overrides = a.complete ? prunedMap(store.overrides, alive) : store.overrides;\n            const grainChanged = a.declaredGrain !== store.declaredGrain;\n            // Selection / focus follow their row out; a changed declared grain\n            // clears both (grain changes rows — the `grain.set` rule), with no\n            // `emit.grainChange`: the HOST changed it, echoing it back loops.\n            const lives = (key: RowKey) => !a.complete || alive.has(key);\n            const selected = !grainChanged && store.ui.selected !== null && lives(store.ui.selected)\n                ? store.ui.selected : null;\n            const focus = !grainChanged && store.ui.focus !== null && lives(store.ui.focus.key)\n                ? store.ui.focus : null;\n            const grain = grainChanged ? a.declaredGrain : store.ui.grain;\n            // The bucket a click named goes with its row; a changed grain takes\n            // the selected events too. Otherwise they stay: an event's element\n            // may sit on a row not resident yet, and what is gone is the\n            // inspector's to leave out (#1197).\n            const selectedAt = selected === null ? null : store.ui.selectedAt;\n            const elements = grainChanged ? NO_ELEMENTS : store.ui.elements;\n            const seeded = grown(a.complete ? pruned(store.seeded, alive) : store.seeded, fresh);\n            const uiSame = collapsed === store.ui.collapsed && chartsExpanded === store.ui.chartsExpanded\n                && selected === store.ui.selected && selectedAt === store.ui.selectedAt && elements === store.ui.elements\n                && focus === store.ui.focus && grain === store.ui.grain;\n            if (uiSame && seeded === store.seeded && overrides === store.overrides && !grainChanged) {\n                return { store, effects: NO_EFFECTS };\n            }\n            return {\n                store: {\n                    ...store,\n                    seeded,\n                    overrides,\n                    declaredGrain: a.declaredGrain,\n                    ui: uiSame ? store.ui : { ...store.ui, collapsed, chartsExpanded, selected, selectedAt, elements, focus, grain },\n                },\n                effects: NO_EFFECTS,\n            };\n        }\n        case \"seed\": {\n            const fresh = [...a.declaredCollapsed].filter((key) => !store.seeded.has(key));\n            if (fresh.length === 0) return { store, effects: NO_EFFECTS };\n            // A landed row the user already toggled keeps the toggle (#813).\n            const seedCollapsed = fresh.filter((key) => collapsedBy(store.overrides, key, true));\n            const collapsed = grown(store.ui.collapsed, seedCollapsed);\n            return {\n                store: {\n                    ...store,\n                    seeded: grown(store.seeded, fresh),\n                    ui: collapsed === store.ui.collapsed ? store.ui : { ...store.ui, collapsed },\n                },\n                effects: NO_EFFECTS,\n            };\n        }\n        case \"external\": {\n            const overrides = sameToggles(store.overrides, a.collapse) ? store.overrides : a.collapse;\n            // Every row whose collapse could have moved: the ones overridden\n            // before or now, and the declared ones (a row no longer overridden\n            // falls back to its declaration — `seeded` holds the declared\n            // collapse already applied).\n            const candidates = new Set<RowKey>([...store.ui.collapsed, ...store.seeded, ...overrides.keys()]);\n            const nextCollapsed = new Set<RowKey>();\n            for (const key of candidates) if (collapsedBy(overrides, key, store.seeded.has(key))) nextCollapsed.add(key);\n            const collapsed = sameKeys(store.ui.collapsed, nextCollapsed) ? store.ui.collapsed : nextCollapsed;\n            const chartsExpanded = sameKeys(store.ui.chartsExpanded, a.charts) ? store.ui.chartsExpanded : a.charts;\n            const selected = a.selected;\n            if (overrides === store.overrides && collapsed === store.ui.collapsed\n                && chartsExpanded === store.ui.chartsExpanded && selected === store.ui.selected) {\n                return { store, effects: NO_EFFECTS };\n            }\n            // The host selecting another row selects the row: no bucket, no events (#1197).\n            const moved = selected !== store.ui.selected;\n            const ui = moved\n                ? { ...store.ui, collapsed, chartsExpanded, selected, selectedAt: null, elements: NO_ELEMENTS }\n                : { ...store.ui, collapsed, chartsExpanded };\n            return {\n                store: { ...store, overrides, ui },\n                effects: NO_EFFECTS,\n            };\n        }\n    }\n}\n\n/** Whether two sets hold the same keys. */\nfunction sameKeys(a: ReadonlySet<RowKey>, b: ReadonlySet<RowKey>): boolean {\n    if (a.size !== b.size) return false;\n    for (const key of a) if (!b.has(key)) return false;\n    return true;\n}\n\n/** Whether two toggle maps say the same of the same rows (in any order). */\nfunction sameToggles(a: ReadonlyMap<RowKey, boolean>, b: ReadonlyMap<RowKey, boolean>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [key, v] of a) if (b.get(key) !== v) return false;\n    return true;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * What a canvas persists under its `storageKey` (#813) — the user's own\n * toggles and place, never the selection — and how it is read back. Its place\n * is where its scroll rests, and, while no source of its slice holds the\n * window, the canvas's own window (#1344): a reload opens on the dates the\n * viewer left, as it does on a window a source holds, which that source's\n * state keeps.\n *\n * @packageDocumentation\n */\n\n/** Where a bounded canvas's scroll rests (#813) — a row, never pixels. */\nexport interface PlanAnchor {\n    /** The first body item showing under the header (its `bodyItemKey`). */\n    key: string;\n    /** How many px of it are scrolled past — over rows not read (`element`), how many px into the window it is in. */\n    offset: number;\n    /** Its body index — the clamped fallback when the key is gone. */\n    index: number;\n    /** The source window its row came from, on a paged canvas — where a\n     *  remount that has not loaded the row yet looks for it. */\n    window: number | null;\n    /** The block its row came from (#823) — which block the remount opens at\n     *  that window; `null` for a row of no paged block, or an anchor saved\n     *  before blocks paged apart (every block then opens there). */\n    block: number | null;\n    /**\n     * Where the view rested over rows not read — a run, or a window whose read failed (#1398): the source element under\n     * its top, in `window`. A remount opens that window where it is and puts the view back `offset` px into it once it\n     * is in; the run's own key, its side alone, stands for other rows by then. Absent over a row.\n     */\n    element?: number | undefined;\n}\n\n/**\n * The canvas's own window (#1344) — what a canvas whose slice has no source\n * holding the window shows, as a gesture last moved it: `[min, max)` on the\n * axis's domain, on the arm it was written on.\n */\nexport interface PlanOwnWindow {\n    /** The axis's arm it was written on: a time axis's, its bounds epoch ms, or a number axis's. */\n    kind: \"time\" | \"number\";\n    /** Its start, on the axis's domain. */\n    min: number;\n    /** Its end, exclusive. */\n    max: number;\n    /**\n     * A time axis's zoom it was shown at (#1438): the slice holds the zoom, but\n     * a page's store may not outlive the page, so the window keeps its own —\n     * a decade kept without the year it was shown in would open a week at a\n     * time.\n     */\n    resolution?: string;\n}\n\n/** What the canvas persists under its `storageKey` (#813). */\nexport interface PlanPersisted {\n    /** The collapse of each row the user toggled (`true` = collapsed). */\n    collapse: Array<[string, boolean]>;\n    /** The chart rows the user expanded. */\n    charts: string[];\n    /** Where the scroll rests, once the user has scrolled a bounded frame. */\n    anchor: PlanAnchor | null;\n    /**\n     * The canvas's own window, once a gesture has moved it (#1344): never a\n     * window a source of the slice holds, which that source's state keeps.\n     * Absent until there is one.\n     */\n    window?: PlanOwnWindow;\n}\n\n/** Nothing persisted yet. */\nexport const NOT_PERSISTED: PlanPersisted = { collapse: [], charts: [], anchor: null };\n\n/**\n * The canvas's own window as storage holds it, taken only in the shape this\n * version writes: an arm it names, and finite bounds, the end past the start,\n * with the zoom it was shown at where it names one.\n *\n * @param stored - What storage holds under the persisted state's `window`\n * @returns The window; `undefined` for anything else\n */\nfunction ownWindowOf(stored: unknown): PlanOwnWindow | undefined {\n    if (typeof stored !== \"object\" || stored === null) return undefined;\n    const { kind, min, max, resolution } = stored as Partial<Record<keyof PlanOwnWindow, unknown>>;\n    if ((kind !== \"time\" && kind !== \"number\") || typeof min !== \"number\" || typeof max !== \"number\") return undefined;\n    if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return undefined;\n    return typeof resolution === \"string\" ? { kind, min, max, resolution } : { kind, min, max };\n}\n\n/**\n * The persisted state, read defensively: storage outlives versions and anyone\n * can write it, so each part is taken only in the shape this version writes\n * and dropped otherwise — never trusted into the store.\n *\n * @param stored - Whatever the storage holds under the canvas's key\n * @returns The parts this version can use\n */\nexport function persistedOf(stored: unknown): PlanPersisted {\n    if (typeof stored !== \"object\" || stored === null) return NOT_PERSISTED;\n    const { collapse, charts, anchor, window } = stored as Partial<Record<keyof PlanPersisted, unknown>>;\n    const okCollapse = Array.isArray(collapse) && collapse.every((e) =>\n        Array.isArray(e) && e.length === 2 && typeof e[0] === \"string\" && typeof e[1] === \"boolean\");\n    const okCharts = Array.isArray(charts) && charts.every((k) => typeof k === \"string\");\n    const a = anchor as Partial<PlanAnchor> | null | undefined;\n    const okAnchor = typeof a === \"object\" && a !== null && typeof a.key === \"string\"\n        && Number.isFinite(a.offset) && Number.isInteger(a.index)\n        && (a.window === null || Number.isInteger(a.window))\n        // Written before blocks paged apart, an anchor names none.\n        && (a.block === undefined || a.block === null || Number.isInteger(a.block))\n        // Over rows not read, the element under the view's top (#1398); over a row, none.\n        && (a.element === undefined || (Number.isInteger(a.element) && a.element >= 0));\n    const own = ownWindowOf(window);\n    return {\n        collapse: okCollapse ? collapse as Array<[string, boolean]> : [],\n        charts: okCharts ? charts as string[] : [],\n        anchor: okAnchor ? { ...(a as PlanAnchor), block: a.block ?? null } : null,\n        ...(own === undefined ? {} : { window: own }),\n    };\n}\n\n/** Whether two lists hold the same entries in the same order. */\nexport function sameList<T>(a: readonly T[], b: readonly T[], same: (x: T, y: T) => boolean): boolean {\n    return a.length === b.length && a.every((x, i) => same(x, b[i]!));\n}\n\n/** Two persisted collapse toggles are the same. */\nexport const sameToggle = (x: readonly [string, boolean], y: readonly [string, boolean]): boolean =>\n    x[0] === y[0] && x[1] === y[1];\n\n/** Two row keys are the same. */\nexport const sameKey = (x: string, y: string): boolean => x === y;\n\n/** Two anchors are the same — `x` may be absent. */\nexport const sameAnchor = (x: PlanAnchor | null, y: PlanAnchor): boolean => x !== null\n    && x.key === y.key && x.offset === y.offset && x.index === y.index && x.window === y.window && x.block === y.block\n    && x.element === y.element;\n\n/** Two of the canvas's own windows are the same — `x` may be absent. */\nexport const sameOwnWindow = (x: PlanOwnWindow | undefined, y: PlanOwnWindow): boolean => x !== undefined\n    && x.kind === y.kind && x.min === y.min && x.max === y.max && x.resolution === y.resolution;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * Reading a paged source's windows — ONCE each (#577) — as the canvas's\n * blocks: the Plan's part of the windowed read the Sheet's driver shares\n * (`shared/windowed.ts`' `readWindows`, #1398), which reads each window once,\n * records a failure against its window and lets the previous revision stand in.\n *\n * # Why once matters\n *\n * The previous loader re-read the whole loaded prefix on every evaluation. That\n * is wasteful (each `page()` re-runs the window's East mapping) and it was the\n * pressure behind #581: every read touched the runtime's decoded-window cache,\n * so a prefix longer than the cache evicted its own head.\n *\n * A landed window is immutable for the source that read it — the driver owns\n * the cache per source and drops it when the next source is not EQUIVALENT (the\n * same id and the same series closures, `equivalentFor` — #809), since the rows\n * here are DERIVED and a changed series derives different ones — so re-reading\n * it can only return what we already have. It is therefore read exactly once,\n * into a caller-owned cache, and afterwards served from there.\n *\n * # What the caching does to dependency tracking, and why that is correct\n *\n * `page()` is a tracked read: calling it registers that window's channel so the\n * evaluation re-fires when it lands. Serving a cached window skips the call and\n * therefore does NOT re-register it — which is exactly right. Tracking exists to\n * learn about a window that has not arrived yet; an arrived window has nothing\n * further to say. Only windows still in flight are read, so only they are\n * tracked, and #580's fix means each newly-discovered one actually gets a\n * subscription.\n *\n * # A window is the canvas's blocks (#823)\n *\n * The derived source serves every block's share of a window from one read:\n * each data series' rows for the window's entries, and the fixed blocks (a\n * section's header, hand-built rows) as ever. A read keeps them apart, keyed\n * block by block — the driver pages each data series' block on its own.\n *\n * @packageDocumentation\n */\n\nimport { carriedOf, type WindowReader } from \"../shared/windowed.js\";\nimport { toCanvasRows, type PlanRowValue, type PlanWireBlock } from \"./model.js\";\nimport { rowKeyOf } from \"./row-key.js\";\nimport type { RowKey } from \"./plan-state.js\";\nimport type { PlanPagedSourceValue } from \"./use-plan-paging.js\";\n\n/** One block's canvas rows from one window, in stream order — keyed for the\n *  canvas once, when the window is read ({@link toCanvasRows}). */\nexport type WindowRows = readonly PlanRowValue[];\n\n/** A block's shape — the same in every window of a source (#823). */\nexport interface BlockShape {\n    /** Whether no entry produces its rows (a section's header, hand-built rows):\n     *  every window serves them alike, and the canvas draws them once. */\n    readonly fixed: boolean;\n    /** The key of the row its top rows nest under — the header of the section\n     *  it sits in — or `undefined` at the top of the canvas. */\n    readonly parent: RowKey | undefined;\n    /** How many chart rows each of its entries makes, when every entry makes as many (#1398, the block's `charts`):\n     *  what the narrow layout's Measures tab counts a paged source by; `undefined` where that varies by entry, and for a\n     *  fixed block, which no entry makes. */\n    readonly charts: number | undefined;\n}\n\n/** One window, read: each block's rows and shape, in layout order. */\nexport interface WindowRead {\n    /** Each block's rows from this window. */\n    readonly blocks: readonly WindowRows[];\n    /** Each block's shape. */\n    readonly shape: readonly BlockShape[];\n}\n\n/** The caller-owned read-once cache, keyed by window index. */\nexport type WindowCache = Map<number, WindowRead>;\n\n/** The caller-owned failure record — why each failed window's read threw,\n *  keyed by window index (#811). */\nexport type WindowFailures = Map<number, string>;\n\n/**\n * A landed window's blocks, keyed for the canvas — each block on its own\n * (a repeat across blocks is the driver's to key, `keyAcrossBlocks`).\n *\n * @param blocks - The window's decoded blocks\n * @returns The read\n */\nexport function readWindow(blocks: readonly PlanWireBlock[]): WindowRead {\n    return {\n        blocks: blocks.map((b, i) => toCanvasRows(b.rows, i)),\n        shape: blocks.map((b) => ({\n            fixed: b.fixed,\n            parent: b.parent.type === \"some\" ? rowKeyOf(b.parent.value) : undefined,\n            charts: b.charts.type === \"some\" ? Number(b.charts.value) : undefined,\n        })),\n    };\n}\n\n/** One window of a paged source, as it serves it: its blocks, and the stored entries they were made from (#1599, east-ui's `CarriedWindowType`). */\nexport type PlanWindowValue = Extract<ReturnType<PlanPagedSourceValue[\"page\"]>, { type: \"some\" }>[\"value\"];\n\n/**\n * How the canvas's driver reads a window of a paged source: the derived\n * source's page, each landed window its blocks ({@link readWindow}) — kept\n * with the entries it carried beside them (#1599), which an edit of one of its\n * rows begins from.\n *\n * @param source - The decoded `paged` arm, at the canvas's blocks\n * @returns Its window reader, for the shared windowed read (`readWindows`, `WindowStore`)\n */\nexport function planWindowReader(source: PlanPagedSourceValue): WindowReader<PlanWindowValue, WindowRead> {\n    const { redraft, redrafted } = source;\n    return {\n        page: (offset, limit) => source.page(offset, limit),\n        decode: (window) => readWindow(window.rows),\n        entries: (window) => window.entries,\n        label: \"[Plan]\",\n        // A window standing in while it is read again is drawn as the source draws it now (#1599): its unsaved changes,\n        // and what a Save landed, laid over the entries it carried — once for each state of them, not once a settle.\n        standIn: redraft === undefined || redrafted === undefined ? undefined : (previous) => {\n            const entries = carriedOf(previous);\n            if (entries === undefined || entries.length === 0) return previous;\n            const state = redrafted();\n            const known = redrawn.get(previous);\n            if (known !== undefined && known.state === state) return known.read;\n            let read = previous;\n            try {\n                const blocks = redraft(entries);\n                if (blocks !== undefined) read = readWindow(blocks);\n            } catch (err) {\n                console.error(\"[Plan] a window standing in could not be drawn with the changes in place:\", err);\n            }\n            redrawn.set(previous, { state, read });\n            return read;\n        },\n    };\n}\n\n/** Each window standing in as it was last drawn again, by the window read: drawn again once what a redraft draws from moves. */\nconst redrawn = new WeakMap<WindowRead, { readonly state: string; readonly read: WindowRead }>();\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The paged canvas's driver (#577), framework-free (#815) — the loop between\n * where the viewport is and which windows are resident, as plain state. The\n * run, its bands, the stand-in, the demand and the jump's pin are the windowed\n * logic it shares with the Sheet's driver (`shared/windowed.ts`, #1398); what\n * is the Plan's own is its blocks, their skeletons, the rows it has seen and\n * the committed-snapshot handshake its jumps settle on.\n *\n * # Blocks page on their own (#823)\n *\n * A canvas is its series list's blocks, one after another. Each data series is\n * a PAGED block — its entries' rows, each entry whole — and a section's header\n * or a list of hand-built rows is a FIXED block, the same in every window and\n * drawn once. One read of a window serves every block (the derived source\n * applies the whole series list to it), so windows are fetched and cached\n * ONCE, for all of them. What each paged block owns is its geometry:\n *\n * - a {@link WindowLedger}, the scroll geometry of its rows in source\n *   ELEMENTS, which remembers every window it has ever measured;\n * - a {@link Residency}, one contiguous run of whole windows, which follows\n *   the viewport a window at a time and rebases on a far jump;\n * - the SKELETON of every window it has seen ({@link WindowSkeleton}) — what\n *   its rows' heights depend on, and nothing else — so the ledger is measured\n *   under the CURRENT collapse, grain and charts, and an evicted window's band\n *   follows them exactly ({@link PagingDriver.remeasure}).\n *\n * The viewport is in one block at a time: a report names a row, a band or a\n * failed window, which name their block, and only that block's demand moves.\n * A jump moves every block — the first one that shows the sought entry is\n * where the canvas scrolls.\n *\n * ```\n * viewport ──▶ block's residency.advance ──▶ readWindows ──▶ each block's ledger\n *     ▲                                                              │\n *     └──────────────────── the renderer's range signal ◀────────────┘\n * ```\n *\n * # A window loading beside the run never moves it (#876)\n *\n * What a block draws is its RUN: the stretch of its resident windows that are\n * in — landed, or failed (#811) — around the one nearest the element the\n * viewport is centred on. A window still in flight ends the stretch, since its\n * rows are not there to hold its slot: it, and every window past it, stay the\n * band's until it lands, and landing it takes exactly the band's slot. So a\n * window loading above or below the rows on screen never takes them off it,\n * even when a window beyond it lands first, and a rebased run whose windows\n * are all on the wire is still the whole of its block — its bands meet where\n * it will land. The bands follow the run, not the residency, and so does\n * where a band report measures from. The Sheet's driver does the same.\n *\n * # One settle, one notification\n *\n * Every input — a source, a viewport report, a jump, a Retry, a window landing\n * (its tracked channel firing) — runs ONE settle: read the demanded windows,\n * teach the ledgers what landed, advance the demand, and read again while the\n * demand moved, until it holds still. Only then is the snapshot published, and\n * only when it differs (#815).\n *\n * # A band report carries pixels\n *\n * A head/tail band is a single body item spanning every unloaded window on that\n * side, so \"over the band\" alone can only name the window adjacent to the run\n * — which walks the gap one fetch per landing. The report therefore carries how\n * many PIXELS into the band the viewport center sits (#612), measured from the\n * band's own top, which the block's ledger places exactly (the band was sized\n * FROM the ledger): the window under the scrollbar thumb resolves through\n * {@link elementAtOffset}, and a far drag rebases instead of walking.\n *\n * # Demand follows intent\n *\n * Nothing is fetched or evicted while the view flies past: the frame reports\n * a scroll at rest once it shows intent — held still 100 ms, a scrollbar\n * drag's pause among them, or slowed below a viewport per 200 ms (#1398, CL6)\n * — so a fling asks for the window it slows over before the gesture ends. Each\n * block reads ahead the way its viewport travels, two windows ahead and one\n * behind (`travelOf`).\n *\n * # What the view waits for\n *\n * The footer's loading line and the frame's busy follow the windows the view\n * shows — each row's in the reported range, a run's nearest its rows, the\n * window under the view and a jump's target (`viewLoading`) — never a window\n * read ahead of it, which nothing on screen waits for (#1398). Settled with\n * the rest, so a landing says it in the commit that draws it. They follow them\n * from the moment the view shows them: the window under the view that is\n * neither in nor asked yet — the view on its way over rows not read, or\n * resting there before it has shown the intent its read waits for (CL6) — is\n * waited for already, so the line's reveal clock runs from the view's arrival,\n * never from the read's.\n *\n * # A jump owns the viewport (#812)\n *\n * A key search REBASES every block on its target window, but the canvas can\n * only scroll to the target once its row is on screen. Until then every\n * viewport report is taken from where the canvas still is, and honouring one\n * would rebase a run back and undo the jump. So while the target window is\n * pinned, reports move nothing. The pin drops once the window SETTLES (it\n * lands, or its read fails) AND the canvas has committed a snapshot that holds\n * it ({@link PagingDriver.committed}).\n *\n * # A far key keeps the view it left standing (#1398, CL10)\n *\n * Home and End past a run go to the source's first or last window as a jump\n * does, but fetch, then move: where the jump takes the rows drawn off the run\n * — its demand rebases there — the view the key left stands in until that\n * window is in — the snapshot drawn as the key came, whole, its rows where\n * they were (`standing`) — and the windows it drew stay in the cache, never\n * pruned for the jump's run. The far window landing (or failing) publishes the\n * jump's own view in the same settle. A clear before then (`clearJump`) — the\n * keyboard moving on among the rows that stand in — puts every block back as\n * it was, the windows it drew still read, so nothing is read again for it.\n *\n * # A failure belongs to its window (#811)\n *\n * A window whose read throws is one error band at its ledger slot in each\n * block that holds it, with a Retry, while every other window keeps landing.\n * A `total()` that throws is the SOURCE's failure and surfaces as\n * `sourceError`; neither ever replaces the canvas.\n *\n * # A revision change keeps the rows (#821)\n *\n * The rows cached for a PINNED source belong to its `revision()`. When the\n * revision moves, the resident windows are read again at the new one, and\n * until each lands the rows it had stand in: the canvas never empties between\n * two snapshots of its data. The geometry stays too — the ledgers' measured\n * heights and their total, until the new snapshot's total says otherwise. A\n * fixed block's rows are the revision's as well: the first window read at a\n * new revision brings them, and the old ones stand in until it lands (#1192 —\n * a Plan's event rows ride its source's windows as fixed blocks, and move with\n * every revision). A `paged` source names no snapshot: its rows are its id's\n * for as long as the canvas holds it. A source the canvas composes over another\n * names the snapshot of its data apart from its revision (#1199), and the\n * snapshot is published beside the revision: a new revision over the same\n * data reads the windows again and is no new snapshot, which is what a key\n * search's answer indexes.\n *\n * # A new narrowing is a new result (#1344, #1354)\n *\n * A `live` source — the rail's `rows` source, or a paged resource kind's\n * source over its windows (#1344) — keeps its id under every narrowing, and\n * names the narrowing its windows belong to (`query`), read before the windows\n * as the revision is. A new narrowing holds other rows at other positions, so\n * it is a new result, as a new source of the same record is: the view the last\n * one drew stands in, whole, until the new one's first window lands — whatever\n * window read ahead beside it lands before it — and its geometry and its\n * windows start again from its first. The snapshot names the narrowing its\n * rows belong to (`narrowing`), the stand-in's the last one's.\n *\n * # A source that derives its rows another way keeps the view (#1599)\n *\n * The derived `page` wraps the series pipeline and the Plan's own rows, so a\n * source whose `page` is not EQUIVALENT to the one that filled the cache\n * derives other rows from the same windows under the same id and revision\n * (#809): its windows are read again. At rest the runtime still holds their\n * raw pages, and they are read in the same settle. While a read of the source\n * is on its way — after a Save, another session's write, a task run again —\n * it holds none: the view the last source drew stands in, whole and retained\n * (`standing`), until the window under the view is in, as a far key's view\n * does. Dropped with nothing to stand in, every row left the canvas until that\n * read landed, whenever the author's block was evaluated again meanwhile — a\n * record it reads whole having moved, the Plan's own rows' among them.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, equivalentFor } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport {\n    createTrackedRead, createLedger, observeWindow, offsetOfWindow, elementAtOffset, elementsIn,\n    type WindowLedger, NO_RESIDENCY, DEFAULT_RESIDENCY, isEmpty, residentWindows, unpinAll,\n    snapshotOf, type Residency, type ResidencyOptions,\n} from \"@elaraai/east-ui-components/internal\";\nimport {\n    WindowStore, advanceAtRest, bandsAround, elementInBand, failedSpan, firstWindow, pinTarget, retryWindows, runAround, sourceChange,\n    type WindowRun, type WindowTravel,\n} from \"../../shared/windowed.js\";\nimport { keyAcrossBlocks, type PlanBand, type PlanRowValue, type PlanWindowFailure, type WindowSkeleton } from \"../model.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport { planWindowReader, type BlockShape, type WindowRead, type WindowRows } from \"../window-reader.js\";\nimport { appendAll, maxOf, minOf } from \"../reductions.js\";\nimport {\n    PLAN_PAGE_SIZE, FAILED_BAND_MIN_PX,\n    type PlanPagedSourceValue, type PlanViewport,\n} from \"../use-plan-paging.js\";\n\n/** Whether two paged sources derive the same rows: the same id AND equivalent\n *  functions — `page` wraps the series pipeline, so its captures are what the\n *  rows are derived WITH (#809). */\nconst pagedSourceEquivalent = equivalentFor(Plan.Types.Root.fields.rows.cases.paged);\n/** Whether two narrowings, as a live source prints them, are the same one (#1354). */\nconst sameNarrowing = equalFor(StringType);\n/** Whether two sources' ids are the same one. */\nconst sameSourceId = equalFor(StringType);\n\n/** Settle steps before giving up — each block's demand moves one window per\n *  step, so a healthy settle takes a handful per block; only a source whose\n *  `total()` keeps moving under one id could spin, and it is stopped and\n *  reported. */\nconst MAX_SETTLE_STEPS = 256;\n\n/** Where a resident row came from — its block and its window (#823). */\nexport interface PlanRowOrigin {\n    block: number;\n    w: number;\n}\n\n/** A landed element span — where it starts and ends, and how many elements it holds. */\nexport interface PlanResidentSpan {\n    /** The first landed element. */\n    from: number;\n    /** The element after the last landed one (exclusive). */\n    to: number;\n    /** How many elements have landed — fewer than the span when a window\n     *  inside it failed (#811). (A window still in flight is never inside\n     *  it: it ends the run, #876.) */\n    elements: number;\n}\n\n/** One block of a paged canvas — what it holds and what stands for the rest (#823). */\nexport interface PlanPagedBlock {\n    /** Its place in the canvas's layout. */\n    index: number;\n    /** Whether no entry produces its rows (a section's header, hand-built\n     *  rows): drawn once, never paged. */\n    fixed: boolean;\n    /** The key of the row its top rows nest under — the header of the section\n     *  it sits in — if any. Its bands hide with that row's subtree. */\n    parent: RowKey | undefined;\n    /** How many chart rows each of the source's entries makes in it, when every entry makes as many — its shape's\n     *  (#1398): what the narrow layout's Measures tab counts the source by; `undefined` where that varies by entry, and\n     *  for a fixed block. */\n    charts: number | undefined;\n    /** Every element above its run (#876) — not resident, still loading, or\n     *  past a window still loading — if any. */\n    head: PlanBand | undefined;\n    /** Every element below its run, likewise, if any. */\n    tail: PlanBand | undefined;\n    /** Its run's windows whose read failed, ascending (#811). */\n    failures: readonly PlanWindowFailure[];\n    /** What has LANDED of its run. */\n    resident: PlanResidentSpan | undefined;\n}\n\n/** What the canvas renders from the driver — replaced whole, and only when\n *  something in it changed. */\nexport interface PlanPagingSnapshot {\n    /** Which publish this is — they count up, so the canvas can say which one\n     *  it committed. */\n    seq: number;\n    /** The resident rows — block after block, each paged block's windows\n     *  concatenated in window order (#823). */\n    rows: readonly PlanRowValue[];\n    /** Which block and window each paged row came from. */\n    origin: ReadonlyMap<string, PlanRowOrigin>;\n    /** The canvas's blocks, in layout order — empty on an inline canvas. */\n    blocks: readonly PlanPagedBlock[];\n    /** The source's element count, once known. */\n    total: number | undefined;\n    /** What has landed of the block the viewport is in — of its run (#876),\n     *  never the demanded interval, which would claim elements are loaded\n     *  that are still on the wire. The span and the count differ when a\n     *  window inside the run failed (#811). */\n    resident: PlanResidentSpan | undefined;\n    /** Whether every paged block holds every element — the source's rows are\n     *  all on the canvas, so no count on it is partial. */\n    complete: boolean;\n    /** Whether a requested window is still in flight — one the view shows, or one read ahead of it. */\n    loading: boolean;\n    /**\n     * Whether the view waits for a window it shows (#1398): one in flight, or the window under it not read and not asked\n     * yet — the view on its way over rows not read, or resting there before its read is asked (CL6). What the footer's\n     * loading line and the frame's busy follow — never a window read ahead of the view, which nothing on screen waits for.\n     */\n    viewLoading: boolean;\n    /** The elements being read (#1398, CL3): of the bands of the block the\n     *  viewport is in, the loading span nearest it — what the footer's loading\n     *  line names; `undefined` while none is, or before the source's count. */\n    reading: { from: number; to: number } | undefined;\n    /** Whether the view the last narrowing drew stands in while a new one's\n     *  first window is read (#1354): the footer's line says it is filtering. */\n    replacing: boolean;\n    /**\n     * Whether the view a far key left stands in while the window it goes to is read (#1398, CL10) — Home or End past\n     * a run: its rows where they were, retained, and the line saying that window is read (`reading`). So does the view\n     * a source drew before it derived its rows another way, while the window under it is read again (#1599).\n     */\n    standing: boolean;\n    /** The narrowing the rows belong to, as a live source names it (`query()`,\n     *  #1354) — the stand-in's the last narrowing's until the new one's rows\n     *  land (#1344): what the rows in view are reported under, so a reader of\n     *  their cells reads none of another narrowing's. `undefined` for a source\n     *  that names none. */\n    narrowing: string | undefined;\n    /** The resident windows whose read failed, ascending — one each, whatever\n     *  blocks hold it (#811). */\n    failures: readonly PlanWindowFailure[];\n    /** Why the SOURCE could not be read — its `total()` threw. Chrome, never a\n     *  canvas replacement (#811). */\n    sourceError: string | undefined;\n    /** The source's revision — the snapshot of its data these rows are read\n     *  from — once it names one (#821). */\n    revision: string | undefined;\n    /** The snapshot of the data itself (#1199): the source's own `snapshot()`,\n     *  or its revision when it names none. A revision that moved over the same\n     *  data — windows read again, new rows composed into them — leaves it. */\n    dataSnapshot: string | undefined;\n}\n\n/** No failed windows — one shared list, so an unfailed canvas's memos hold. */\nconst NO_FAILURES: readonly PlanWindowFailure[] = [];\n/** A block that draws no window (#876). */\nconst NO_RUN: WindowRun = { from: 0, to: -1 };\nconst NO_ROWS: readonly PlanRowValue[] = [];\nconst NO_ORIGIN: ReadonlyMap<string, PlanRowOrigin> = new Map();\nconst NO_BLOCKS: readonly PlanPagedBlock[] = [];\n\n/** The snapshot of a driver with no source (an inline canvas). */\nexport const IDLE_PAGING: PlanPagingSnapshot = {\n    seq: 0, rows: NO_ROWS, origin: NO_ORIGIN, blocks: NO_BLOCKS,\n    total: undefined, resident: undefined, complete: true, loading: false, viewLoading: false, reading: undefined, replacing: false,\n    standing: false, narrowing: undefined, failures: NO_FAILURES, sourceError: undefined, revision: undefined, dataSnapshot: undefined,\n};\n\n/** Where a row the body does not hold sits (#823): in one of its block's\n *  bands, this many px below the band's top — the ledger offset of the window\n *  it was last seen in. */\nexport interface PlanRowPlace {\n    block: number;\n    at: \"head\" | \"tail\";\n    px: number;\n}\n\n/**\n * Where a view resting over rows not read rests (#1398) — over one of a\n * block's bands, or a failed window's: the source element under its top, and\n * how many px into that element's window it is, by the ledger's geometry. What\n * a remount opens at, and puts the view back on.\n */\nexport interface PlanUnreadPlace {\n    /** The element under the view's top. */\n    element: number;\n    /** Px from the top of the element's window to the view's top. */\n    px: number;\n}\n\n/** Options for {@link createPagingDriver}. */\nexport interface PagingDriverOptions {\n    /** One block's rows from one landed window, as the heights need them — its\n     *  skeleton, taken once per landing (#823). */\n    skeletonOf: (rows: readonly PlanRowValue[]) => WindowSkeleton;\n    /** A skeleton's height under the CURRENT UI state — the body's own height\n     *  arithmetic, so a band is exactly as tall as the rows it stands for. */\n    heightOf: (sk: WindowSkeleton) => number;\n    /** A skeleton's height AT REST — declared collapse, no charts expanded, no\n     *  focus: what the ledger seeds its slot rate from. */\n    restHeightOf: (sk: WindowSkeleton) => number;\n    /** Residency policy (defaults to {@link DEFAULT_RESIDENCY}). */\n    policy?: ResidencyOptions | undefined;\n    /** Called once per settle that changed the snapshot. */\n    onChange: () => void;\n}\n\n/** The driver's handle. */\nexport interface PagingDriver {\n    /** The current snapshot — the same object until something changes. */\n    getSnapshot(): PlanPagingSnapshot;\n    /** Drive a (new) source; `undefined` idles the driver (an inline canvas). */\n    setSource(source: PlanPagedSourceValue | undefined, retainPrevious?: boolean): void;\n    /** Where the viewport is. Ignored while a jump is pending — the jump owns\n     *  the viewport until its window settles (#812). */\n    reportViewport(at: PlanViewport, scrolling: boolean): void;\n    /** Jump to a source element (a seek result): pin its window in every\n     *  block and move the demand there — a run extends to a near target and\n     *  rebases on a far one (the step policy's `rebaseGap`), so the windows in\n     *  between a far jump are never fetched. */\n    jumpToElement(element: number): void;\n    /**\n     * Go to a source element the keyboard goes to — Home or End past a run (#1398, CL10): a jump, but while its window\n     * is not in, the view drawn as the key came stands in (`standing`), its windows kept, until it lands; a clear\n     * ({@link clearJump}) before then puts that view back.\n     */\n    standTo(element: number): void;\n    /** Whether a far key's view stands in now ({@link standTo}). */\n    standing(): boolean;\n    /** Open at a source element — where a remounted canvas left off (#813).\n     *  Like a jump, but the run STARTS there however near the resident one\n     *  is: nothing between is fetched for a place the user is not going to\n     *  scroll through. With a block, only that block opens there. */\n    openAt(element: number, block?: number): void;\n    /** Drop any pending jump pin — a cleared search has no target (#614) — or, while a far key's view stands in, put\n     *  that view back as it was: every block where it was, nothing read again for it (#1398). */\n    clearJump(): void;\n    /**\n     * The canvas committed `rendered`: it is on screen, and the canvas has\n     * scrolled to a jump's target if it could. A jump whose window settled in\n     * or before that snapshot hands the viewport back (#812).\n     */\n    committed(rendered: PlanPagingSnapshot): void;\n    /**\n     * Ask a failed window again — or, with none named, every failed window and\n     * the source's own reads: has the source rearm what failed (its `refresh`),\n     * then drops the failure records and reads again, a microtask on, once it\n     * has (#811, #1398). A source with no `refresh` is read again at once.\n     */\n    retry(w?: number): void;\n    /**\n     * The stored entry the window standing at a source position read with the entry of an id (#1599) — the window\n     * whose rows the canvas draws there, landed or standing in from before: what a gesture on a row the canvas shows\n     * begins from, whatever revision its source has moved to since. `undefined` where the source's windows carry none.\n     */\n    entryOf(id: string, at: number): Uint8Array | undefined;\n    /**\n     * Whether the window at a source position has landed at the revision the driver reads at — its rows the source's\n     * own now, never ones standing in from before (#1599): what a Save landed of an entry there is the window's to\n     * draw from then on.\n     */\n    landedAt(at: number): boolean;\n    /** Settle again with the current inputs. */\n    refresh(): void;\n    /** What the rows draw at changed (a collapse, the grain, a chart toggle,\n     *  an expand focus, the density): measure every window each block has\n     *  seen again, from its skeleton, and settle (#823). */\n    remeasure(): void;\n    /** What a skeleton is taken with changed (the axis kind, which decides\n     *  which rows are diagnostics): resident windows take theirs again. */\n    reskeleton(): void;\n    /** Where a visited row the body does not hold sits — in which block's\n     *  band, and how far down it (#823: a link into an evicted window, or\n     *  into a landed one past a window still in flight, #876). `undefined`\n     *  for a row never seen, or one whose window is in its block's run. */\n    placeOf(key: RowKey): PlanRowPlace | undefined;\n    /**\n     * Where a view whose top is `px` into a band of rows not read rests (#1398): one of a block's bands, or a failed\n     * window's, as drawn — by the elements it stands for, never the run the driver has moved on to since. `undefined`\n     * for a block the driver does not page, or before its ledger knows a window.\n     */\n    unreadPlace(band: Pick<PlanBand, \"block\" | \"from\" | \"to\">, px: number): PlanUnreadPlace | undefined;\n    /** Which block and window a row was last seen in, resident or evicted —\n     *  what a request to bring it into view opens (#824). `undefined` for a\n     *  row no window has shown. */\n    seenAt(key: RowKey): PlanRowOrigin | undefined;\n    /** Whether a jump is pending (its window pinned). */\n    jumping(): boolean;\n    /** Stop listening to the source's channels until the next settle — a\n     *  `refresh` subscribes afresh. State is kept. */\n    disconnect(): void;\n}\n\n/** One line naming why a source read failed. */\nfunction readFailure(err: unknown): string {\n    return err instanceof Error ? err.message : String(err);\n}\n\n/** What one read of the demanded windows returned. */\ninterface ReadOutcome {\n    /** The source's own `total()` — never the ledgers' stand-in. */\n    total: number | undefined;\n    resident: { w: number; read: WindowRead }[];\n    /** The demanded windows still on the wire. */\n    inFlight: readonly number[];\n    failed: { w: number; error: string }[];\n    sourceError: string | undefined;\n    /** The revision the windows were read at. */\n    revision: string | undefined;\n    /** The snapshot of the data they were read from (#1199). */\n    dataSnapshot: string | undefined;\n}\n\nconst NOTHING_READ: ReadOutcome = {\n    total: undefined, resident: [], inFlight: [], failed: [], sourceError: undefined, revision: undefined, dataSnapshot: undefined,\n};\n\n/** One paged block's geometry (#823). */\ninterface Lane {\n    ledger: WindowLedger;\n    residency: Residency;\n    /** The window the viewport was last in, within this block. */\n    viewportWindow: number;\n    /** The element the viewport was last centred on, within this block — what\n     *  its run is anchored nearest (#876). */\n    viewportAt: number;\n    /** Which way the viewport travels through this block's windows, and the window it was in when the demand last\n     *  moved (#1398, CL6): the demand reads ahead that way. */\n    travel: WindowTravel;\n    /** The run the last settle drew (#876) — where its bands start and end. */\n    run: WindowRun;\n    /** Every window this block has seen: which read its skeleton was taken\n     *  from (a re-read at a new revision takes it again), the skeleton, its\n     *  height at rest and how many rows it holds. Never the rows themselves —\n     *  an evicted window's rows must be free to go. */\n    skeletons: Map<number, { read: number; sk: WindowSkeleton; restPx: number; rows: number }>;\n}\n\n/** Which read a window's rows came from — a number per rows array, held\n *  weakly, so a skeleton can tell a re-read without keeping the rows alive. */\nconst readIds = new WeakMap<WindowRows, number>();\nlet nextReadId = 0;\n\nfunction readIdOf(rows: WindowRows): number {\n    let id = readIds.get(rows);\n    if (id === undefined) {\n        nextReadId += 1;\n        id = nextReadId;\n        readIds.set(rows, id);\n    }\n    return id;\n}\n\n/** Where one paged block stood: what a far key's clear puts back (#1398). */\ntype LaneAt = Pick<Lane, \"residency\" | \"viewportWindow\" | \"viewportAt\" | \"travel\" | \"run\">;\n\n/**\n * A far key's jump while its window is not in (#1398, CL10): the window it goes\n * to, the view drawn as the key came, where each block stood then and the block\n * the view was in, and the windows that view drew — kept in the cache while it\n * stands, so a clear draws it again at once.\n */\ninterface Standing {\n    readonly w: number;\n    readonly view: PlanPagingSnapshot;\n    readonly lanes: ReadonlyMap<number, LaneAt>;\n    readonly focusBlock: number;\n    readonly keep: ReadonlySet<number>;\n}\n\n/** One part of the assembled rows — a fixed block's rows, or one window of a paged block's. */\ninterface Piece {\n    b: number;\n    w: number | undefined;\n    rows: WindowRows;\n}\n\nfunction samePieces(a: readonly Piece[], b: readonly Piece[]): boolean {\n    return a.length === b.length && a.every((x, i) => x.b === b[i]!.b && x.w === b[i]!.w && x.rows === b[i]!.rows);\n}\n\nfunction sameShape(a: readonly BlockShape[], b: readonly BlockShape[]): boolean {\n    return a.length === b.length && a.every((x, i) => x.fixed === b[i]!.fixed && x.parent === b[i]!.parent && x.charts === b[i]!.charts);\n}\n\nfunction sameLoading(a: PlanBand[\"loading\"], b: PlanBand[\"loading\"]): boolean {\n    if (a === undefined || b === undefined) return a === b;\n    return a.from === b.from && a.to === b.to;\n}\n\n/**\n * Of a block's bands, the loading span nearest the element the viewport is\n * centred on (#1398): what the footer's loading line names.\n *\n * @param block - The block the viewport is in\n * @param at - The element it is centred on\n * @returns The span; `undefined` when neither band is loading\n */\nfunction readingOf(block: PlanPagedBlock | undefined, at: number): PlanBand[\"loading\"] {\n    const head = block?.head?.loading;\n    const tail = block?.tail?.loading;\n    if (head === undefined || tail === undefined) return head ?? tail;\n    const distance = (span: { from: number; to: number }) => (at < span.from ? span.from - at : at > span.to ? at - span.to : 0);\n    return distance(tail) <= distance(head) ? tail : head;\n}\n\nfunction sameBand(a: PlanBand | undefined, b: PlanBand | undefined): boolean {\n    if (a === undefined || b === undefined) return a === b;\n    return a.block === b.block && a.at === b.at && a.from === b.from && a.to === b.to && a.px === b.px\n        && sameLoading(a.loading, b.loading);\n}\n\nfunction sameFailures(a: readonly PlanWindowFailure[], b: readonly PlanWindowFailure[]): boolean {\n    return a.length === b.length && a.every((f, i) => {\n        const g = b[i]!;\n        return f.block === g.block && f.w === g.w && f.from === g.from && f.to === g.to && f.px === g.px && f.error === g.error;\n    });\n}\n\nfunction sameResident(a: PlanResidentSpan | undefined, b: PlanResidentSpan | undefined): boolean {\n    if (a === undefined || b === undefined) return a === b;\n    return a.from === b.from && a.to === b.to && a.elements === b.elements;\n}\n\nfunction sameBlock(a: PlanPagedBlock, b: PlanPagedBlock): boolean {\n    return a.index === b.index && a.fixed === b.fixed && a.parent === b.parent && a.charts === b.charts && a.head === b.head\n        && a.tail === b.tail && a.failures === b.failures && a.resident === b.resident;\n}\n\n/**\n * Create a paging driver.\n *\n * @param options - See {@link PagingDriverOptions}\n * @returns The driver\n */\nexport function createPagingDriver(options: PagingDriverOptions): PagingDriver {\n    const policy = options.policy ?? DEFAULT_RESIDENCY;\n\n    let source: PlanPagedSourceValue | undefined;\n    // Read-once cache of DERIVED rows, keyed by the source that derived them.\n    // The id alone cannot key it: the derived `page` wraps the series\n    // pipeline, and a series whose closures changed derives different rows\n    // from the same windows under the same id (#809). So the cache belongs to\n    // the source that filled it and is dropped when the next one is not\n    // equivalent — the resident windows re-read (the runtime still holds their\n    // raw pages), while the ledgers keep their measured heights, so nothing\n    // jumps. The failure record (#811) belongs to the same source, and so do\n    // the revision its windows were read at and the previous revision's\n    // windows, each standing in until this revision's copy lands (#821).\n    let filledBy: PlanPagedSourceValue | undefined;\n    const store = new WindowStore<WindowRead>();\n    // The snapshot of the data the last read was of (#1199), kept through a read that failed.\n    let dataSnapshot: string | undefined;\n    // The narrowing a live source's windows belong to (#1354): a new one is a new result.\n    let narrowing: string | undefined;\n    // The source's element count as the ledgers know it, and the revision it\n    // was learned (or last confirmed) under.\n    let total = 0;\n    let totalRevision: string | undefined;\n    // The blocks' shape — from the first window to land (#823). Until then the\n    // canvas is one paged block, whose demand reads that first window.\n    let shape: readonly BlockShape[] | undefined;\n    // Each fixed block's rows — every window of a revision serves them alike,\n    // so the first that did is theirs — and the revision they were read at.\n    let fixedRows = new Map<number, WindowRows>();\n    let fixedAt: string | undefined;\n    // Each paged block's geometry, by its place in the layout.\n    let lanes = new Map<number, Lane>([[0, newLane()]]);\n    /** The lane kept while a window draws no paged block: no block's index. */\n    const STANDBY_LANE = -1;\n    // Where every row a block has seen sits: its block and window (#823).\n    const located = new Map<RowKey, PlanRowOrigin>();\n    // The block the viewport was last reported in — what the transport counts.\n    let focusBlock = 0;\n    let isScrolling = false;\n    // The windows the view last said it shows (#1398): what `viewLoading` follows; none said, any window in flight.\n    let viewShows: readonly number[] | undefined;\n    let last: ReadOutcome = NOTHING_READ;\n    let snapshot: PlanPagingSnapshot = IDLE_PAGING;\n    // A different narrowing has different positions. Keep the previous view as\n    // one bounded stand-in until the replacement's first window or error lands.\n    let transition: PlanPagingSnapshot | undefined;\n    // A far key's jump whose window is not in: the view it left stands in until it is (#1398, CL10).\n    let standing: Standing | undefined;\n    // The view the last source drew, standing in while the same source — its id the same, its page deriving the rows\n    // another way (#809) — reads the window under the view again (#1599).\n    let rederiving: PlanPagingSnapshot | undefined;\n    let assembled: { pieces: readonly Piece[]; rows: readonly PlanRowValue[]; origin: ReadonlyMap<string, PlanRowOrigin> } =\n        { pieces: [], rows: NO_ROWS, origin: NO_ORIGIN };\n    let settling = false;\n    let pending = false;\n    let spinWarned = false;\n    // The last publish's number, and the jump's progress: its pinned window\n    // has settled, in the publish numbered `settledSeq` (the canvas has not\n    // necessarily shown it yet).\n    let published = 0;\n    let pinsSettled = false;\n    let settledSeq: number | undefined;\n\n    // A landing fires the channel the in-flight window's read registered.\n    const tracked = createTrackedRead(() => settle());\n\n    function newLane(from?: Lane): Lane {\n        return {\n            ledger: createLedger(total, PLAN_PAGE_SIZE),\n            residency: from?.residency ?? NO_RESIDENCY,\n            viewportWindow: from?.viewportWindow ?? 0,\n            viewportAt: from?.viewportAt ?? 0,\n            travel: from?.travel ?? { at: 0, way: 1 },\n            run: from?.run ?? NO_RUN,\n            skeletons: new Map(),\n        };\n    }\n\n    /** Every window that is IN after the last read — landed (or standing in\n     *  from the previous revision, #821), or failed (#811). */\n    function windowsIn(): Set<number> {\n        const out = new Set<number>();\n        for (const r of last.resident) out.add(r.w);\n        for (const f of last.failed) out.add(f.w);\n        return out;\n    }\n\n    /** Every window some block demands, ascending. */\n    function wantedWindows(): number[] {\n        const wanted = new Set<number>();\n        for (const lane of lanes.values()) for (const w of residentWindows(lane.residency)) wanted.add(w);\n        return [...wanted].sort((a, b) => a - b);\n    }\n\n    /** Every pinned window. */\n    function pinnedWindows(): number[] {\n        const out = new Set<number>();\n        for (const lane of lanes.values()) for (const w of lane.residency.pins) out.add(w);\n        return [...out];\n    }\n\n    /** What the cache keeps when the demand moves: every window some block demands, and, while a far key's view\n     *  stands in, the windows it drew (#1398). */\n    function keptWindows(): Set<number> {\n        const keep = new Set(wantedWindows());\n        if (standing !== undefined) for (const w of standing.keep) keep.add(w);\n        return keep;\n    }\n\n    /** Whether a window is in for the view: landed at this revision or standing in from the last, or failed. */\n    function windowIn(w: number): boolean {\n        return store.windows.has(w) || store.stale?.has(w) === true || store.failures.has(w);\n    }\n\n    /** A far key's view put back as it was (#1398): every block where it stood, the jump's pin gone, and read again —\n     *  from the cache, which kept what it drew. */\n    function standDown(): void {\n        const s = standing;\n        if (s === undefined) return;\n        standing = undefined;\n        for (const [b, lane] of lanes) {\n            const was = s.lanes.get(b);\n            if (was === undefined) continue;\n            lane.residency = unpinAll(was.residency);\n            lane.viewportWindow = was.viewportWindow;\n            lane.viewportAt = was.viewportAt;\n            lane.travel = was.travel;\n            lane.run = was.run;\n        }\n        focusBlock = s.focusBlock;\n        pinsSettled = false;\n        settledSeq = undefined;\n        settle();\n    }\n\n    /** Drop every window the cache holds, and what came with them: a source's\n     *  rows that another source, or another narrowing, does not serve. */\n    function dropWindows(): void {\n        store.drop();\n        // Its series may lay the blocks out otherwise, and its fixed rows\n        // may differ: both come with its first window again.\n        fixedRows = new Map();\n        fixedAt = undefined;\n    }\n\n    /** A new result of the same record (#1344, #1354): the view the last one drew\n     *  stands in, whole, until the new one's first window lands; its geometry\n     *  starts at zero, so no offset of the old result drives its requests. */\n    function startResult(): void {\n        // What stands in is the view drawn last, whoever drew it: a far key's stand-in gives way to the new result's.\n        transition = standing !== undefined ? standing.view : rederiving !== undefined ? rederiving : snapshot.rows.length > 0 ? snapshot : transition;\n        standing = undefined;\n        rederiving = undefined;\n        total = 0;\n        totalRevision = undefined;\n        shape = undefined;\n        lanes = new Map([[0, newLane()]]);\n        located.clear();\n        focusBlock = 0;\n        isScrolling = false;\n        viewShows = undefined;\n        unpinEvery();\n    }\n\n    function readOnce(src: PlanPagedSourceValue): ReadOutcome {\n        // How the source handed stands to the one that filled the windows held: the one rule every driver asks (#1599).\n        const change = sourceChange(filledBy, src, pagedSourceEquivalent);\n        if (change !== \"same\") {\n            // The same source, deriving its rows another way (#809): the view it drew stands in until the window under\n            // the view is read again (#1599) — at rest, in this settle; else for as long as that read is on its way.\n            if (change === \"reread\" && rederiving === undefined && transition === undefined && standing === undefined && snapshot.rows.length > 0) rederiving = snapshot;\n            filledBy = src;\n            dropWindows();\n            narrowing = undefined;\n        }\n        const out = tracked.run((): ReadOutcome => {\n            let sourceError: string | undefined;\n            // A live source's narrowing first (#1354): its channel re-fires this\n            // read when a choice moves it, and a new one is a new result.\n            if (src.query !== undefined) {\n                try {\n                    const q = src.query();\n                    if (narrowing !== undefined && !sameNarrowing(q, narrowing)) {\n                        startResult();\n                        dropWindows();\n                    }\n                    narrowing = q;\n                } catch (err) {\n                    console.error(\"[Plan] paged source narrowing failed:\", err);\n                    sourceError = readFailure(err);\n                }\n            }\n            const wanted = wantedWindows();\n            // The snapshot next: every window below is read at it, and its\n            // channel re-fires this read when it moves. A source that cannot\n            // say which snapshot it serves has failed as a whole (#811) — its\n            // windows then say so each, where their rows would be. A `paged`\n            // source names none.\n            let current = store.revision;\n            try {\n                const r = src.revision?.();\n                current = r?.type === \"some\" ? r.value : undefined;\n            } catch (err) {\n                console.error(\"[Plan] paged source revision failed:\", err);\n                sourceError ??= readFailure(err);\n            }\n            // A new revision is read afresh, the windows held standing in until each lands (#821) — and those a far key's\n            // standing view drew for as long as it stands, so a clear draws it back from them (#1398, CL10).\n            store.at(current, standing?.keep);\n            // The snapshot of the data: the source's own when it names it apart from its revision (#1199), else its\n            // revision — with a live source's narrowing, whose rows a key search's answer names (#1354).\n            let data = current;\n            if (sourceError === undefined) {\n                try {\n                    const own = src.snapshot !== undefined ? src.snapshot() : snapshotOf(src);\n                    data = own !== undefined && own.type === \"some\" ? own.value : undefined;\n                } catch (err) {\n                    console.error(\"[Plan] paged source snapshot failed:\", err);\n                    sourceError = readFailure(err);\n                }\n            }\n            if (sourceError === undefined) dataSnapshot = data;\n            let t: number | undefined;\n            try {\n                const read = src.total();\n                if (read.type === \"some\") t = Number(read.value);\n            } catch (err) {\n                console.error(\"[Plan] paged source total failed:\", err);\n                sourceError ??= readFailure(err);\n            }\n            // Once every demanded window reads at the new revision, the old snapshot has nothing left to stand in for — but\n            // the windows a far key's standing view drew, while it stands (#1398, CL10).\n            const result = store.read(planWindowReader(src), wanted, PLAN_PAGE_SIZE, standing?.keep);\n            return {\n                total: t, resident: result.resident, inFlight: result.inFlight, failed: result.failed, sourceError,\n                revision: current, dataSnapshot,\n            };\n        });\n        // The read catches every window's own failure, so a run that still\n        // threw is the source's failure too — chrome, like a throwing `total()`.\n        return out.ok ? out.value : { ...NOTHING_READ, sourceError: readFailure(out.error), revision: store.revision, dataSnapshot };\n    }\n\n    /** Lay the canvas out by the blocks a window says it has (#823): each\n     *  paged block keeps its geometry where it still is one, and a new one\n     *  starts where the demand already is. */\n    function adopt(next: readonly BlockShape[]): void {\n        const template = lanes.values().next().value;\n        const nextLanes = new Map<number, Lane>();\n        next.forEach((s, b) => {\n            if (s.fixed) return;\n            nextLanes.set(b, lanes.get(b) ?? newLane(template));\n        });\n        // A window drawing no paged block — every series a pick shows switched off — keeps one lane apart, reading the\n        // windows the blocks read: a revision that brings blocks back is read, its shape adopted, its lanes from these.\n        if (nextLanes.size === 0) nextLanes.set(STANDBY_LANE, template ?? newLane());\n        lanes = nextLanes;\n        shape = next;\n        fixedRows = new Map();\n        fixedAt = undefined;\n        if (!lanes.has(focusBlock)) focusBlock = lanes.keys().next().value ?? 0;\n    }\n\n    /** Teach one block what one landed window of it draws at now. */\n    function observe(b: number, lane: Lane, w: number, rows: WindowRows): void {\n        const read = readIdOf(rows);\n        let held = lane.skeletons.get(w);\n        if (held === undefined || held.read !== read) {\n            const sk = options.skeletonOf(rows);\n            held = { read, sk, restPx: options.restHeightOf(sk), rows: rows.length };\n            lane.skeletons.set(w, held);\n            for (const key of sk.keys) located.set(key, { block: b, w });\n        }\n        lane.ledger = observeWindow(lane.ledger, w, { px: options.heightOf(held.sk), rows: held.rows, restPx: held.restPx });\n    }\n\n    /** Apply one read: returns whether the DEMAND moved (another read is due). */\n    function apply(out: ReadOutcome): boolean {\n        let moved = false;\n        // ── The source's size defines the geometry ────────────────────────\n        if (out.total !== undefined && out.total !== total) {\n            // Same id and revision ⇒ same rows is the source contract, so a\n            // total that MOVES under one revision has violated it. The geometry\n            // rebuilds either way — and the read-once cache must go with it, or\n            // the canvas silently serves the OLD rows against the new geometry\n            // (#614). A total that moved WITH the revision is the content\n            // changing (#821): the new snapshot's rows are what the cache\n            // holds, and the viewport keeps its window.\n            if (total > 0 && totalRevision === out.revision) {\n                console.warn(`[Plan] paged source ${source !== undefined ? `\"${source.id}\" ` : \"\"}changed total() ${total} → ${out.total} under one id and revision — same id and revision must serve same rows; dropping cached windows.`);\n                store.windows = new Map();\n                store.stale = undefined;\n                store.failures = new Map();\n            }\n            total = out.total;\n            totalRevision = out.revision;\n            for (const lane of lanes.values()) {\n                lane.ledger = createLedger(total, PLAN_PAGE_SIZE);\n                lane.residency = NO_RESIDENCY;\n                lane.skeletons.clear();\n            }\n            located.clear();\n            // The geometry a far key's view was drawn in is gone with it: the source's own view is drawn from here.\n            standing = undefined;\n            rederiving = undefined;\n            return true;\n        }\n        // The same total at this revision: the geometry holds for it.\n        if (out.total !== undefined) totalRevision = out.revision;\n        // ── The blocks come with the first window to land (#823) ──────────\n        const first = out.resident[0];\n        if (first !== undefined && (shape === undefined || !sameShape(shape, first.read.shape))) {\n            adopt(first.read.shape);\n            moved = true;\n        }\n        // ── A fixed block's rows are its revision's (#821, #1192) ─────────\n        // A window read at this revision (the cache holds only this one's)\n        // brings them; until one lands, the previous revision's stand in.\n        const fresh = out.resident.find((r) => store.windows.get(r.w) === r.read);\n        if (fresh !== undefined && fixedAt !== out.revision) {\n            fixedRows = new Map();\n            fixedAt = out.revision;\n            fresh.read.shape.forEach((s, b) => {\n                if (s.fixed) fixedRows.set(b, fresh.read.blocks[b] ?? NO_ROWS);\n            });\n        }\n        // ── Landed windows teach each paged block's ledger ────────────────\n        for (const { w, read } of out.resident) {\n            read.shape.forEach((s, b) => {\n                if (s.fixed && !fixedRows.has(b)) fixedRows.set(b, read.blocks[b] ?? NO_ROWS);\n            });\n            for (const [b, lane] of lanes) observe(b, lane, w, read.blocks[b] ?? NO_ROWS);\n        }\n        // ── A pin protects the jump target until it SETTLES ───────────────\n        // It lands, or its read fails (#811) — and the canvas commits that\n        // (`committed`), when the pin drops. Left in place it would keep one\n        // window trim-exempt for the session (#614) and, since a pending jump\n        // owns the viewport (#812), a target that failed would freeze the\n        // demand where it was.\n        const pins = pinnedWindows();\n        if (pins.length > 0 && !pinsSettled) {\n            const settled = new Set(out.resident.map((r) => r.w));\n            for (const f of out.failed) settled.add(f.w);\n            if (pins.every((w) => settled.has(w))) pinsSettled = true;\n        }\n        // ── Demand follows the viewport, block by block, at idle only ─────\n        let demanded = false;\n        for (const lane of lanes.values()) {\n            // Bootstrap (`firstWindow`): window 0 is demanded before the ledger knows a window, and the total arrives with\n            // it; a source that never reports a total simply has no bands and no extent beyond what is resident. Else\n            // read ahead the way the viewport travels, at rest (#1398, CL6).\n            let next = lane.residency;\n            if (lane.ledger.windows === 0) next = firstWindow(lane.residency);\n            else if (!isScrolling) {\n                const step = advanceAtRest(lane.residency, lane.ledger, lane.viewportWindow, policy, lane.travel);\n                lane.travel = step.travel;\n                next = step.residency;\n            }\n            if (next !== lane.residency) {\n                lane.residency = next;\n                demanded = true;\n            }\n        }\n        if (demanded) {\n            // Whatever left every block's residency leaves the cache with it —\n            // the half of eviction that actually frees memory. A failure\n            // record leaves too: a window demanded again later is asked afresh.\n            // What a far key's standing view drew stays while it stands (#1398).\n            store.prune(keptWindows());\n        }\n        return moved || demanded;\n    }\n\n    /** The rows, block after block, and where each paged one came from —\n     *  each paged block's run's landed windows (#876) — rebuilt only when what\n     *  they are made of moved. */\n    function assemble(landed: ReadonlyMap<number, WindowRead>): void {\n        const pieces: Piece[] = [];\n        const count = shape?.length ?? 1;\n        for (let b = 0; b < count; b++) {\n            if (shape?.[b]?.fixed === true) {\n                const rows = fixedRows.get(b);\n                if (rows !== undefined) pieces.push({ b, w: undefined, rows });\n                continue;\n            }\n            const lane = lanes.get(b);\n            if (lane === undefined) continue;\n            for (let w = lane.run.from; w <= lane.run.to; w++) {\n                const read = landed.get(w);\n                if (read !== undefined) pieces.push({ b, w, rows: read.blocks[b] ?? NO_ROWS });\n            }\n        }\n        if (samePieces(assembled.pieces, pieces)) return;\n        const all: PlanRowValue[] = [];\n        for (const p of pieces) appendAll(all, p.rows);\n        // Each window was keyed on its own; a later block repeating an\n        // earlier one's id is keyed here, as it would be inline.\n        const rows = keyAcrossBlocks(all);\n        const origin = new Map<string, PlanRowOrigin>();\n        let i = 0;\n        for (const p of pieces) {\n            for (let k = 0; k < p.rows.length; k++, i++) {\n                if (p.w !== undefined) origin.set(rows[i]!.key, { block: p.b, w: p.w });\n            }\n        }\n        assembled = { pieces, rows, origin };\n    }\n\n    /** Which elements of a block's windows `fromW` to `toW` are loading\n     *  (#1082) — those of the windows its residency demands that are still\n     *  on the wire — as one span, from the first such window's first\n     *  element to the last one's last; `undefined` when none is. */\n    function loadingIn(lane: Lane, inFlight: ReadonlySet<number>, fromW: number, toW: number, known: number): PlanBand[\"loading\"] {\n        let lo: number | undefined;\n        let hi: number | undefined;\n        for (let w = Math.max(fromW, lane.residency.lo); w <= Math.min(toW, lane.residency.hi); w++) {\n            if (!inFlight.has(w)) continue;\n            lo ??= w;\n            hi = w;\n        }\n        if (lo === undefined || hi === undefined) return undefined;\n        return { from: lo * PLAN_PAGE_SIZE, to: Math.min(known, (hi + 1) * PLAN_PAGE_SIZE) - 1 };\n    }\n\n    /** One paged block as the canvas draws it — its run between its bands\n     *  (#876) — reusing the previous object's parts that did not move. */\n    function blockOf(\n        b: number, lane: Lane, known: number | undefined, landedWindows: ReadonlySet<number>, inFlight: ReadonlySet<number>,\n        prev: PlanPagedBlock | undefined,\n    ): PlanPagedBlock {\n        const { ledger, residency, run } = lane;\n        let head: PlanBand | undefined;\n        let tail: PlanBand | undefined;\n        if (known !== undefined) {\n            // The bands follow the run, not the residency (`bandsAround`): a window still in flight, and every window\n            // past it, are theirs until it lands. Each says which of its windows are loading — only those (#1082).\n            const spans = bandsAround(ledger, residency, run, PLAN_PAGE_SIZE, known);\n            head = spans.head === undefined ? undefined\n                : { block: b, at: \"head\", ...spans.head, loading: loadingIn(lane, inFlight, 0, run.from - 1, known) };\n            tail = spans.tail === undefined ? undefined\n                : { block: b, at: \"tail\", ...spans.tail, loading: loadingIn(lane, inFlight, run.to + 1, ledger.windows - 1, known) };\n        }\n        // Each failed window in the run as its band (#811, `failedSpan`): at its ledger slot, floored so the reason and the\n        // Retry stay legible — a short last window, or a window 0 that failed before any landing taught the ledger a\n        // geometry.\n        const inRun = last.failed.filter((f) => f.w >= run.from && f.w <= run.to);\n        const failed: PlanWindowFailure[] = inRun.map(({ w, error }) => (\n            { block: b, w, ...failedSpan(ledger, w, known, PLAN_PAGE_SIZE, FAILED_BAND_MIN_PX), error }\n        ));\n        let resident: PlanResidentSpan | undefined;\n        const mine: number[] = [];\n        for (let w = run.from; w <= run.to; w++) if (landedWindows.has(w)) mine.push(w);\n        if (mine.length > 0 && known !== undefined) {\n            // The SPAN of what landed — not of what was demanded.\n            const lo = minOf(mine);\n            const hi = maxOf(mine);\n            let elements = 0;\n            for (const w of mine) elements += elementsIn({ pageSize: PLAN_PAGE_SIZE, total: known }, w);\n            resident = { from: lo * PLAN_PAGE_SIZE, to: Math.min(known, (hi + 1) * PLAN_PAGE_SIZE), elements };\n        }\n        const next: PlanPagedBlock = {\n            index: b,\n            fixed: false,\n            parent: shape?.[b]?.parent,\n            charts: shape?.[b]?.charts,\n            head: prev !== undefined && sameBand(prev.head, head) ? prev.head : head,\n            tail: prev !== undefined && sameBand(prev.tail, tail) ? prev.tail : tail,\n            failures: failed.length === 0 ? NO_FAILURES\n                : prev !== undefined && sameFailures(prev.failures, failed) ? prev.failures : failed,\n            resident: prev !== undefined && sameResident(prev.resident, resident) ? prev.resident : resident,\n        };\n        return prev !== undefined && sameBlock(prev, next) ? prev : next;\n    }\n\n    /** The snapshot for the last read — reusing every part that did not move. */\n    function publish(): void {\n        if (transition !== undefined) {\n            // The new result's view opens on its first window, or on a jump's target: until that lands — whatever\n            // windows read ahead beside it land first (#1344) — the last view stands in, unless the result is empty or a\n            // read failed.\n            const opensAt = pinnedWindows();\n            const opened = opensAt.length > 0 ? opensAt.some((w) => store.windows.has(w)) : store.windows.has(0);\n            if (!opened && last.total !== 0 && last.failed.length === 0 && last.sourceError === undefined) {\n                if (!snapshot.loading || snapshot.rows !== transition.rows) {\n                    snapshot = { ...transition, seq: ++published, loading: true, viewLoading: true, complete: false, reading: undefined, replacing: true };\n                    options.onChange();\n                }\n                return;\n            }\n            transition = undefined;\n        }\n        if (rederiving !== undefined) {\n            // Read again, then draw (#1599): until the window under the view — a jump's target, where one is pinned — is\n            // in for the source as it derives its rows now, or the source has said it cannot be read, the view the last\n            // one drew stands in, whole and retained, the line saying that window is read.\n            const w = pinnedWindows()[0] ?? lanes.get(focusBlock)?.viewportWindow ?? 0;\n            if (!windowIn(w) && last.sourceError === undefined && last.total !== 0) {\n                const known = last.total ?? (total > 0 ? total : undefined);\n                const end = (w + 1) * PLAN_PAGE_SIZE;\n                const reading = { from: w * PLAN_PAGE_SIZE, to: (known === undefined ? end : Math.min(known, end)) - 1 };\n                if (!snapshot.standing || snapshot.rows !== rederiving.rows || !sameLoading(snapshot.reading, reading)) {\n                    snapshot = { ...rederiving, seq: ++published, loading: true, viewLoading: true, reading, replacing: false, standing: true };\n                    options.onChange();\n                }\n                return;\n            }\n            rederiving = undefined;\n        }\n        if (standing !== undefined) {\n            // Fetch, then move (#1398, CL10): until the far key's window is in — landed, standing in from the last\n            // revision, or failed — or the source has said it cannot be read, the view the key left stands in, whole,\n            // the line saying the window it goes to is read.\n            const s = standing;\n            if (!windowIn(s.w) && last.sourceError === undefined && last.total !== 0) {\n                const known = last.total ?? (total > 0 ? total : undefined);\n                const end = (s.w + 1) * PLAN_PAGE_SIZE;\n                const reading = { from: s.w * PLAN_PAGE_SIZE, to: (known === undefined ? end : Math.min(known, end)) - 1 };\n                if (!snapshot.standing || snapshot.rows !== s.view.rows || !sameLoading(snapshot.reading, reading)) {\n                    snapshot = { ...s.view, seq: ++published, loading: true, viewLoading: true, reading, replacing: false, standing: true };\n                    options.onChange();\n                }\n                return;\n            }\n            // In: the jump's own view is drawn now, and what the stand-in drew leaves the cache with it.\n            standing = undefined;\n            store.prune(keptWindows());\n        }\n        const prev = snapshot;\n        const landed = new Map(last.resident.map((r) => [r.w, r.read]));\n        // What each paged block draws, from what is in now (#876, `runAround`): the stretch of its resident windows that\n        // are in around the one nearest the element its viewport is centred on.\n        const isIn = windowsIn();\n        const inNow = (w: number) => isIn.has(w);\n        for (const lane of lanes.values()) lane.run = runAround(lane.residency, inNow, lane.viewportAt, PLAN_PAGE_SIZE);\n        assemble(landed);\n        // Between two revisions the source knows no total until the new one's\n        // first window lands; the geometry stands meanwhile, so the bands and\n        // the scroll extent do not collapse under the reader (#821).\n        const known = last.total ?? (store.stale !== undefined && total > 0 ? total : undefined);\n        const landedWindows = new Set(landed.keys());\n        const inFlight = new Set(last.inFlight);\n        const count = shape?.length ?? 1;\n        const blocks: PlanPagedBlock[] = [];\n        for (let b = 0; b < count; b++) {\n            const before = prev.blocks[b];\n            const lane = lanes.get(b);\n            if (shape?.[b]?.fixed === true || lane === undefined) {\n                const fixed: PlanPagedBlock = {\n                    index: b, fixed: true, parent: shape?.[b]?.parent, charts: undefined,\n                    head: undefined, tail: undefined, failures: NO_FAILURES, resident: undefined,\n                };\n                blocks.push(before !== undefined && sameBlock(before, fixed) ? before : fixed);\n                continue;\n            }\n            blocks.push(blockOf(b, lane, known, landedWindows, inFlight, before));\n        }\n        const sameBlocks = blocks.length === prev.blocks.length && blocks.every((x, i) => x === prev.blocks[i]);\n        const paged = blocks.filter((x) => !x.fixed);\n        const focus = blocks[focusBlock]?.fixed === false ? blocks[focusBlock] : paged[0];\n        const complete = known !== undefined && paged.every((x) =>\n            x.head === undefined && x.tail === undefined && x.failures.length === 0\n            && x.resident !== undefined && x.resident.elements >= known);\n        // Every failed window once, whichever blocks hold it.\n        const failures: PlanWindowFailure[] = [];\n        const seen = new Set<number>();\n        for (const x of paged) {\n            for (const f of x.failures) {\n                if (seen.has(f.w)) continue;\n                seen.add(f.w);\n                failures.push(f);\n            }\n        }\n        failures.sort((a, b) => a.w - b.w);\n        const reading = readingOf(focus, (focus === undefined ? undefined : lanes.get(focus.index)?.viewportAt) ?? 0);\n        // What the view waits for (#1398): a window in flight it shows — one the range showed, the window under the\n        // view, a jump's target — never one read ahead of it; with nothing said of what it shows, any. And the window\n        // under the view that is neither in nor asked yet: the view on its way over rows not read, or resting there\n        // before it has shown the intent their read waits for (CL6), waits for them from the moment it shows them — the\n        // line's reveal clock runs from then, never from their read.\n        const focusLane = focus === undefined ? undefined : lanes.get(focus.index);\n        const under = focusLane?.viewportWindow;\n        const pins = pinnedWindows();\n        const awaiting = viewShows !== undefined && focusLane !== undefined && under !== undefined && under < focusLane.ledger.windows\n            && last.sourceError === undefined && !windowIn(under) && !last.inFlight.includes(under);\n        const viewLoading = viewShows === undefined ? last.inFlight.length > 0\n            : awaiting || last.inFlight.some((w) => viewShows!.includes(w) || w === under || pins.includes(w));\n        const next: PlanPagingSnapshot = {\n            seq: prev.seq,\n            rows: assembled.rows,\n            origin: assembled.origin,\n            blocks: sameBlocks ? prev.blocks : blocks,\n            total: known,\n            resident: sameResident(prev.resident, focus?.resident) ? prev.resident : focus?.resident,\n            complete,\n            loading: last.inFlight.length > 0,\n            viewLoading,\n            reading: sameLoading(prev.reading, reading) ? prev.reading : reading,\n            replacing: false,\n            standing: false,\n            narrowing,\n            failures: failures.length === 0 ? NO_FAILURES\n                : sameFailures(prev.failures, failures) ? prev.failures : failures,\n            sourceError: last.sourceError,\n            revision: last.revision,\n            dataSnapshot: last.dataSnapshot,\n        };\n        const changed = next.rows !== prev.rows || next.origin !== prev.origin || next.blocks !== prev.blocks\n            || next.total !== prev.total || next.resident !== prev.resident || next.complete !== prev.complete\n            || next.loading !== prev.loading || next.viewLoading !== prev.viewLoading || next.reading !== prev.reading\n            || next.replacing !== prev.replacing || next.standing !== prev.standing || next.narrowing !== prev.narrowing\n            || next.failures !== prev.failures || next.sourceError !== prev.sourceError\n            || next.revision !== prev.revision || next.dataSnapshot !== prev.dataSnapshot;\n        if (!changed) return;\n        published += 1;\n        snapshot = { ...next, seq: published };\n        options.onChange();\n    }\n\n    /** The window an element sits in. A target past the end (an anchor saved\n     *  against a longer source) is the last window — pinned beyond it, a jump\n     *  would never settle. */\n    function windowOf(element: number): number {\n        const w = Math.floor(Math.max(0, element) / PLAN_PAGE_SIZE);\n        const windows = Math.ceil(total / PLAN_PAGE_SIZE);\n        return windows > 0 ? Math.min(w, windows - 1) : w;\n    }\n\n    /** Move the demand to window `w` and pin it until it lands and is shown;\n     *  `rebase` starts the run there however near the old one was. Every\n     *  block moves, or only `block`. A far key's jump (`stand`) that takes the\n     *  rows drawn off a block's run — its demand rebases there — leaves the\n     *  view drawn now standing in until its window is in (#1398): the first\n     *  such view, however often the keys go again meanwhile. Any other jump\n     *  takes its place. */\n    function jump(w: number, rebase: boolean, only?: number, stand = false): void {\n        const leaves = (): boolean => [...lanes].some(([b, lane]) => {\n            if ((only !== undefined && b !== only) || lane.run.to < lane.run.from) return false;\n            const next = advanceAtRest(pinTarget(lane.residency, w, rebase), lane.ledger, w, policy, lane.travel).residency;\n            return next.hi < lane.run.from || next.lo > lane.run.to;\n        });\n        if (stand && standing !== undefined) standing = { ...standing, w };\n        else if (stand && transition === undefined && snapshot.rows.length > 0 && leaves()) {\n            const at = new Map<number, LaneAt>();\n            for (const [b, lane] of lanes) {\n                at.set(b, { residency: lane.residency, viewportWindow: lane.viewportWindow, viewportAt: lane.viewportAt, travel: lane.travel, run: lane.run });\n            }\n            standing = { w, view: snapshot, lanes: at, focusBlock, keep: new Set(wantedWindows()) };\n        } else {\n            standing = undefined;\n        }\n        isScrolling = false;\n        // A block the canvas does not page (yet) — its shape still to land —\n        // moves them all.\n        const block = only !== undefined && lanes.has(only) ? only : undefined;\n        for (const [b, lane] of lanes) {\n            // One jump at a time: every other pin goes.\n            if (block !== undefined && b !== block) {\n                lane.residency = unpinAll(lane.residency);\n                continue;\n            }\n            lane.viewportWindow = w;\n            lane.viewportAt = w * PLAN_PAGE_SIZE;\n            // Pin it so no trim can drop the destination before it lands (`pinTarget`).\n            lane.residency = pinTarget(lane.residency, w, rebase);\n        }\n        if (block !== undefined) focusBlock = block;\n        pinsSettled = false;\n        settledSeq = undefined;\n        settle();\n    }\n\n    /** Drop every pin — the jump has landed, or the search was cleared. */\n    function unpinEvery(): void {\n        for (const lane of lanes.values()) lane.residency = unpinAll(lane.residency);\n        pinsSettled = false;\n        settledSeq = undefined;\n    }\n\n    /** Read, apply, and read again while the demand moves — then publish once. */\n    function settle(): void {\n        // A landing can fire while a settle is reading (a synchronous source,\n        // or a notification during `total()`): note it and loop once more\n        // rather than re-entering.\n        if (settling) { pending = true; return; }\n        const src = source;\n        if (src === undefined) return;\n        settling = true;\n        try {\n            let steps = 0;\n            do {\n                pending = false;\n                last = readOnce(src);\n                const moved = apply(last);\n                if (!moved && !pending) break;\n                steps += 1;\n            } while (steps < MAX_SETTLE_STEPS);\n            if (steps >= MAX_SETTLE_STEPS && !spinWarned) {\n                spinWarned = true;\n                console.warn(`[Plan] paged source \"${src.id}\" did not settle — its total() keeps moving under one id`);\n            }\n        } finally {\n            settling = false;\n        }\n        publish();\n        // The snapshot a settled jump target is first on screen in.\n        if (pinsSettled && settledSeq === undefined) settledSeq = snapshot.seq;\n    }\n\n    return {\n        getSnapshot: () => snapshot,\n        setSource(next, retainPrevious = false) {\n            if (next === source) return;\n            // The new result starts at zero; offsets from the old result\n            // must never drive its requests while those rows stand in.\n            if (retainPrevious && next !== undefined && source !== undefined && next.id !== source.id) startResult();\n            else if (!retainPrevious) {\n                transition = undefined;\n                standing = undefined;\n            }\n            // Another source's rows are no stand-in for this one's.\n            if (next === undefined || source === undefined || !sameSourceId(next.id, source.id)) rederiving = undefined;\n            source = next;\n            if (next === undefined) {\n                transition = undefined;\n                // Idle: the channels go quiet and the canvas renders inline rows.\n                tracked.release();\n                last = NOTHING_READ;\n                if (snapshot !== IDLE_PAGING) {\n                    snapshot = IDLE_PAGING;\n                    assembled = { pieces: [], rows: NO_ROWS, origin: NO_ORIGIN };\n                    options.onChange();\n                }\n                return;\n            }\n            settle();\n        },\n        reportViewport(at, scrolling) {\n            if (transition !== undefined || rederiving !== undefined) return;\n            isScrolling = scrolling;\n            // What the view shows is the view's, a jump pending or not: the line follows it (#1398).\n            viewShows = at.shows;\n            // A jump owns the viewport until its window settles (#812). The\n            // canvas cannot scroll to a row that has not landed, so every report\n            // until then is taken from where the canvas still IS — and demanding\n            // that window would rebase a run back and undo the jump.\n            if (pinnedWindows().length > 0) return;\n            if (at.kind === \"row\") {\n                // A fixed block's row names no window: the demand stays.\n                const o = snapshot.origin.get(at.key);\n                const lane = o !== undefined ? lanes.get(o.block) : undefined;\n                if (o !== undefined && lane !== undefined) {\n                    lane.viewportWindow = o.w;\n                    lane.viewportAt = o.w * PLAN_PAGE_SIZE;\n                    focusBlock = o.block;\n                }\n            } else {\n                const lane = lanes.get(at.block);\n                if (lane !== undefined) {\n                    focusBlock = at.block;\n                    // A band's pixels map through the ledger the band was sized from (`elementInBand`, #612): whatever\n                    // the resident rows in between rendered at, a far drag rebases. Without them, the element just\n                    // outside the run on that side.\n                    const element = at.kind === \"window\"\n                        ? at.w * PLAN_PAGE_SIZE\n                        : elementInBand(lane.ledger, lane.run, at.at, at.px, PLAN_PAGE_SIZE);\n                    lane.viewportAt = element;\n                    lane.viewportWindow = Math.floor(element / PLAN_PAGE_SIZE);\n                }\n            }\n            settle();\n        },\n        jumpToElement(element) {\n            jump(windowOf(element), false);\n        },\n        standTo(element) {\n            jump(windowOf(element), false, undefined, true);\n        },\n        standing: () => standing !== undefined,\n        openAt(element, block) {\n            jump(windowOf(element), true, block);\n        },\n        clearJump() {\n            if (standing !== undefined) {\n                standDown();\n                return;\n            }\n            if (pinnedWindows().length === 0) return;\n            unpinEvery();\n            settle();\n        },\n        committed(rendered) {\n            // Before the canvas has put the landed target on screen, what it\n            // reports is where it WAS — the jump keeps the viewport.\n            if (settledSeq === undefined || rendered.seq < settledSeq) return;\n            unpinEvery();\n            settle();\n        },\n        entryOf: (id, at) => store.entryOf(id, at, PLAN_PAGE_SIZE),\n        landedAt: (at) => store.windows.has(Math.floor(at / PLAN_PAGE_SIZE)),\n        retry(w) {\n            // A Retry asks again now (#1398, `retryWindows`): the source rearms what failed for a reason a retry can\n            // fix — a read alone waits out the runtime's retry gap after the last failure, so a Retry pressed within it\n            // asked nothing — then the failure records go and the windows are read again.\n            retryWindows(source, () => {\n                store.forget(w);\n                settle();\n            });\n        },\n        refresh() {\n            settle();\n        },\n        remeasure() {\n            for (const lane of lanes.values()) {\n                for (const [w, held] of lane.skeletons) {\n                    lane.ledger = observeWindow(lane.ledger, w, {\n                        px: options.heightOf(held.sk), rows: held.rows, restPx: held.restPx,\n                    });\n                }\n            }\n            settle();\n        },\n        reskeleton() {\n            // A resident window takes its skeleton again on the next settle;\n            // an evicted one keeps what it had until it is read again.\n            for (const lane of lanes.values()) {\n                for (const held of lane.skeletons.values()) held.read = -1;\n            }\n            settle();\n        },\n        placeOf(key) {\n            const o = located.get(key);\n            const lane = o !== undefined ? lanes.get(o.block) : undefined;\n            // While a far key's view stands in, its bands are the ones drawn (#1398).\n            const drawn = o !== undefined ? standing?.lanes.get(o.block) : undefined;\n            if (o === undefined || lane === undefined || isEmpty(drawn?.residency ?? lane.residency)) return undefined;\n            // The bands are the run's (#876).\n            const { from, to } = drawn?.run ?? lane.run;\n            if (o.w < from) return { block: o.block, at: \"head\", px: offsetOfWindow(lane.ledger, o.w) };\n            if (o.w > to) {\n                return { block: o.block, at: \"tail\", px: offsetOfWindow(lane.ledger, o.w) - offsetOfWindow(lane.ledger, to + 1) };\n            }\n            return undefined;\n        },\n        unreadPlace(band, px) {\n            const ledger = lanes.get(band.block)?.ledger;\n            if (ledger === undefined || ledger.windows === 0) return undefined;\n            // A band's top is where its first element's window starts — the head band's the rows' own top, the tail's\n            // where the run it was drawn beside ends, a failed window's its slot (`bandsAround`, `failedSpan`) — and the\n            // element `px` below it one of its own, however far a failed band's floored height reaches past its slot.\n            const at = offsetOfWindow(ledger, Math.floor(band.from / PLAN_PAGE_SIZE)) + Math.max(0, px);\n            const element = Math.min(band.to, Math.max(band.from, elementAtOffset(ledger, at)));\n            return { element, px: at - offsetOfWindow(ledger, Math.floor(element / PLAN_PAGE_SIZE)) };\n        },\n        seenAt: (key) => located.get(key),\n        jumping: () => pinnedWindows().length > 0,\n        disconnect() {\n            tracked.release();\n        },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The paged canvas's KEY SEARCH vocabulary — `search` stops being a row filter\n * and becomes a seek (#567 D9, the affordance table). The search itself is\n * framework-free since #815 (`controller/seek.ts`); a query's East value is the\n * key search's (`toSeekQuery`, east-ui-components), shared with the Sheet.\n *\n * # Why a key search can address canvas rows at all\n *\n * `seek` answers in SOURCE ELEMENT indices, and a Plan synthesizes its rows per\n * element (a series can emit several rows for one element, or none), so an\n * element index is not a canvas row index and never will be. What makes the\n * jump well-defined is #822: a row's id starts with the key of the element it\n * came from, the source's windows land in its key order, and each series\n * places its rows in element order. So a query's matches — one CONTIGUOUS run\n * in the source's key order — begin at the first canvas row whose element\n * sorts at-or-after the sought key, and THAT row is addressable in key space\n * alone.\n *\n * The k-th match is NOT the k-th row of that run: a series emits any number of\n * canvas rows per source element, so the element delta the control steps by is\n * not a row delta (#582). A jump reads the target element's key, loads its\n * window and reveals the first canvas row belonging to that exact match.\n *\n * @packageDocumentation\n */\n\nimport { StringType, parseFor, type EastTypeValue } from \"@elaraai/east\";\nimport type { DatasetKeyMatchRange, DatasetKeyQuery, DatasetKeySearchProps } from \"@elaraai/east-ui-components\";\n\n/** What the toolbar needs to mount `<DatasetKeySearch>`. */\nexport interface PlanSearch {\n    /** Keys the control: it changes with the source itself — another\n     *  collection, which a query typed for this one was never asked of. */\n    resetKey: string;\n    /** Moves when the source's data moved to another snapshot while a query\n     *  stands (#821, #1199): the control asks the query it holds again there,\n     *  its text kept. Windows read again over the same data move nothing. */\n    requery: number;\n    /** The key type the control parses typed input against. */\n    keyType: EastTypeValue;\n    /** Locate a query — resolves when the tracked search lands. `again`, the\n     *  query the control holds asked again at a new snapshot: the view stays\n     *  where it is. */\n    find: (query: DatasetKeyQuery, again?: boolean) => Promise<DatasetKeyMatchRange>;\n    /** Read the bounded head of the match run from the source, preserving each entry's position. */\n    listRange: DatasetKeySearchProps[\"onListRange\"];\n    /** Jump to match at global element `row`. */\n    jump: (row: number) => void;\n    /** Drop the query and its jump target. */\n    clear: () => void;\n}\n\n/** The key a query's run starts at, which the canvas anchors on. The `.east`\n *  literal of a String key is its quoted text; a prefix is carried plainly; a\n *  range starts at its lower bound, or at the first row when it is open\n *  below. `undefined` ⇒ nothing to position on. */\nexport function soughtKeyOf(query: DatasetKeyQuery): string | undefined {\n    if (\"prefix\" in query) return query.prefix;\n    if (\"key\" in query) {\n        const parsed = parseFor(StringType)(query.key);\n        return parsed.success ? (parsed.value as string) : query.key;\n    }\n    if (\"from\" in query || \"to\" in query) {\n        const from = query.from?.[0];\n        if (from === undefined) return \"\";\n        const parsed = parseFor(StringType)(from);\n        return parsed.success ? (parsed.value as string) : from;\n    }\n    return query.prefix;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The paged canvas's key search (#574), framework-free (#815).\n *\n * # Bridging a tracked read to a promise\n *\n * `<DatasetKeySearch>` is promise-based (`onFind` returns a `Promise`), while\n * `seek` is a tracked platform read: `none` means \"still searching\" and the\n * channel re-fires when it lands. The two meet here — the query is held, the\n * read runs as a tracked read so its channel is registered, and the pending\n * promise settles on the read that lands the answer.\n *\n * @packageDocumentation\n */\n\nimport { StringType, compareFor, toEastTypeValue, type EastTypeValue } from \"@elaraai/east\";\nimport type { DatasetKeyMatchRange, DatasetKeyQuery, DatasetKeySearchProps } from \"@elaraai/east-ui-components\";\nimport { createTrackedRead, toSeekQuery, type SeekQueryValue } from \"@elaraai/east-ui-components/internal\";\nimport type { PlanRowValue } from \"../model.js\";\nimport type { PlanPagedSourceValue } from \"../use-plan-paging.js\";\nimport { soughtKeyOf } from \"../use-seek.js\";\n\n/** A row names the element it came from by a String — the first segment of\n *  its id's path (#822: a String key as is, any other printed) — so a Plan's\n *  search input is typed against that, whatever the underlying dataset keys\n *  its elements by. */\nexport const CANVAS_KEY_TYPE: EastTypeValue = toEastTypeValue(StringType);\n\n/** East's own total order on Strings — the order a String-keyed source serves\n *  its elements in, and so the order its rows' element keys run in. */\nconst KEY_ORDER = compareFor(StringType);\n\n/**\n * The key of the element a row came from — its id's first path segment — or\n * `undefined` for a row no element placed (a section header).\n *\n * @param row - A canvas row\n * @returns The element key\n */\nexport function elementKeyOf(row: PlanRowValue): string | undefined {\n    return row.id.type === \"entry\" ? row.id.value.path[0] : undefined;\n}\n\n/** The decoded `seek` capability of a paged source. */\nexport type PlanSeekFn = Extract<PlanPagedSourceValue[\"seek\"], { type: \"some\" }>[\"value\"];\n\n/** What the canvas renders from the search. */\nexport interface PlanSeekSnapshot {\n    /** The key the last query sought, and where its run started in the source\n     *  — `null` between searches. */\n    sought: { key: string; row: number } | null;\n    /** Why the last search failed — its `seek` threw — until the next search\n     *  or a clear (#811: the toolbar states it; the canvas carries on). */\n    searchError: string | undefined;\n    /** Counts the snapshots of the source's data a standing query was asked\n     *  again in (#821, #1199): the search control asks the query it holds again\n     *  as it moves, its text kept, so its matches index the new snapshot. */\n    again: number;\n}\n\nexport const NO_SEEK: PlanSeekSnapshot = { sought: null, searchError: undefined, again: 0 };\n\n/** Options for {@link createSeekDriver}. */\nexport interface SeekDriverOptions {\n    /** Drop the paging driver's pending jump pin — a cleared search has no target (#614). */\n    clearJump: () => void;\n    /** Called once per change to the snapshot. */\n    onChange: () => void;\n}\n\n/** The search's handle. */\nexport interface SeekDriver {\n    getSnapshot(): PlanSeekSnapshot;\n    /** The source whose seek and bounded pages answer the search. */\n    setSource(source: PlanPagedSourceValue | undefined): void;\n    /** Locate a query — resolves when the tracked search lands. */\n    find(query: DatasetKeyQuery): Promise<DatasetKeyMatchRange>;\n    /** Read the bounded head of the match run, whether or not its canvas window is resident. */\n    listRange: DatasetKeySearchProps[\"onListRange\"];\n    /** A previously labelled source position's key, for an exact jump. */\n    keyAt(row: number): string | undefined;\n    /** Drop the query and its jump target. */\n    clear(): void;\n    /**\n     * The source's data moved to another snapshot (#821, #1199): a standing\n     * query's match positions index the previous snapshot's rows, so it is\n     * asked again — `again` moves, and the control asks the query it holds\n     * once more, its text kept. Nothing without a query. A pending jump keeps\n     * its pin: its window lands at the new snapshot like any other.\n     */\n    askAgain(): void;\n    /** Ask again — a pending search re-subscribes to its answer (after a\n     *  {@link SeekDriver.disconnect}), and settles if it has landed. */\n    refresh(): void;\n    /** Stop listening for the pending answer until the next `refresh`. The\n     *  query and its promise are kept. */\n    disconnect(): void;\n}\n\n/**\n * Where a search positions the canvas, and where its labels start: the first\n * loaded row that SHOWS the sought element — its key, else the first whose\n * key the sought text begins — and, when no block shows one, the first row\n * whose element sorts at-or-after it.\n *\n * @remarks\n * Each block's windows land in the source's key order, and each series places\n * its rows in element order, so within a block the rows at-or-after the key\n * start the match run (#822). A jump moves every block to the target window\n * (#823), and a block whose series skips the element shows its neighbours\n * there: the first block that shows the element itself wins, not the first\n * block. A parent precedes its subtree, so the row found is the element's own,\n * never a child's (for `views`, its first view row).\n *\n * @param rows - The loaded canvas rows, stream order\n * @param key - The sought key\n * @returns The index, or `-1` when no loaded row's element sorts at or after it\n */\nexport function firstAtOrAfter(rows: readonly PlanRowValue[], key: string): number {\n    let exact = -1;\n    let prefixed = -1;\n    let after = -1;\n    rows.forEach((r, i) => {\n        const element = elementKeyOf(r);\n        if (element === undefined) return;\n        if (exact < 0 && element === key) exact = i;\n        if (prefixed < 0 && element.startsWith(key)) prefixed = i;\n        if (after < 0 && KEY_ORDER(element, key) >= 0) after = i;\n    });\n    return exact >= 0 ? exact : prefixed >= 0 ? prefixed : after;\n}\n\n/**\n * Create the key search.\n *\n * @param options - See {@link SeekDriverOptions}\n * @returns The driver\n */\nexport function createSeekDriver(options: SeekDriverOptions): SeekDriver {\n    let source: PlanPagedSourceValue | undefined;\n    let seekFn: PlanSeekFn | undefined;\n    const labels = new Map<number, string | undefined>();\n    type Labels = { row: number; label: string }[];\n    const labelRequests = new Set<{\n        row: number; limit: number; resolve: (labels: Labels) => void; reject: (error: unknown) => void;\n    }>();\n    const labelRead = createTrackedRead(() => readLabels());\n\n    function dropLabels(error: unknown): void {\n        labelRead.release();\n        for (const request of labelRequests) request.reject(error);\n        labelRequests.clear();\n        labels.clear();\n    }\n\n    function readLabels(): void {\n        const current = source;\n        if (current === undefined || labelRequests.size === 0) return;\n        const out = labelRead.run(() => {\n            const needed = new Set<number>();\n            for (const request of labelRequests) {\n                for (let i = request.row; i < request.row + request.limit; i++) if (!labels.has(i)) needed.add(i);\n            }\n            for (const row of needed) {\n                // One source element can emit many canvas rows, or none. Read\n                // each requested element at its real position, never infer it\n                // by counting rendered rows. The platform shares page caches;\n                // only the popup's bounded head is requested, not a prefix.\n                const page = current.page(BigInt(row), 1n);\n                if (page.type !== \"some\") continue;\n                let key: string | undefined;\n                for (const block of page.value.rows) {\n                    if (block.fixed) continue;\n                    for (const item of block.rows) {\n                        if (item.id.type === \"entry\") key = item.id.value.path[0];\n                        if (key !== undefined) break;\n                    }\n                    if (key !== undefined) break;\n                }\n                labels.set(row, key);\n            }\n        });\n        if (!out.ok) {\n            dropLabels(out.error);\n            publish({ ...snapshot, searchError: out.error instanceof Error ? out.error.message : String(out.error) });\n            return;\n        }\n        for (const request of labelRequests) {\n            const result: Labels = [];\n            let complete = true;\n            for (let i = request.row; i < request.row + request.limit; i++) {\n                if (!labels.has(i)) { complete = false; break; }\n                const label = labels.get(i);\n                if (label !== undefined) result.push({ row: i, label });\n            }\n            if (complete) {\n                labelRequests.delete(request);\n                request.resolve(result);\n            }\n        }\n        if (labelRequests.size === 0) labelRead.release();\n    }\n    let query: SeekQueryValue | null = null;\n    // The sought key is written SYNCHRONOUSLY in `find()`: the control awaits\n    // `onFind` and then calls `onListRange`, and the labels must answer for\n    // THIS search, not the previous one (#614).\n    let soughtKey = \"\";\n    let pending: { resolve: (r: DatasetKeyMatchRange) => void; reject: (e: unknown) => void } | null = null;\n    let snapshot: PlanSeekSnapshot = NO_SEEK;\n\n    const publish = (next: PlanSeekSnapshot) => {\n        if (next.sought === snapshot.sought && next.searchError === snapshot.searchError && next.again === snapshot.again) return;\n        snapshot = next;\n        options.onChange();\n    };\n\n    /** Forget the query and its answer — the control's promise rejects. */\n    function drop(why: string): void {\n        pending?.reject(new Error(why));\n        pending = null;\n        soughtKey = \"\";\n        query = null;\n        tracked.release();\n        dropLabels(new Error(why));\n    }\n\n    const tracked = createTrackedRead(() => read());\n\n    /** Ask `seek` (tracked); settle the pending promise when the answer lands. */\n    function read(): void {\n        if (seekFn === undefined || query === null) return;\n        const fn = seekFn;\n        const q = query;\n        const out = tracked.run(() => fn(q));\n        const waiting = pending;\n        if (waiting === null) return;\n        if (!out.ok) {\n            pending = null;\n            // The search's own failure — stated in the toolbar, never the\n            // canvas's (#811). The control's promise rejects as before.\n            publish({ ...snapshot, searchError: out.error instanceof Error ? out.error.message : String(out.error) });\n            waiting.reject(out.error);\n            return;\n        }\n        const answer = out.value;\n        // `none` = still searching: the channel is tracked, and its landing\n        // runs this read again.\n        if (answer.type !== \"some\") return;\n        const range = answer.value;\n        pending = null;\n        if (snapshot.sought !== null) publish({ ...snapshot, sought: { key: snapshot.sought.key, row: Number(range.row) } });\n        waiting.resolve({ found: range.found, row: Number(range.row), count: Number(range.count) });\n    }\n\n    return {\n        getSnapshot: () => snapshot,\n        setSource(next) {\n            if (source?.id !== next?.id) drop(\"search source changed\");\n            source = next;\n            seekFn = next?.seek.type === \"some\" ? next.seek.value : undefined;\n        },\n        find(q) {\n            return new Promise<DatasetKeyMatchRange>((resolve, reject) => {\n                // A superseded search is dropped, not left dangling — the\n                // control's own sequence guard ignores a late answer anyway.\n                pending?.reject(new Error(\"superseded by a newer query\"));\n                dropLabels(new Error(\"superseded by a newer query\"));\n                pending = { resolve, reject };\n                soughtKey = soughtKeyOf(q) ?? \"\";\n                query = toSeekQuery(q);\n                publish({ sought: { key: soughtKey, row: 0 }, searchError: undefined, again: snapshot.again });\n                read();\n            });\n        },\n        listRange(row, limit) {\n            return new Promise<Labels>((resolve, reject) => {\n                if (source === undefined) { resolve([]); return; }\n                labelRequests.add({ row, limit: Math.min(20, Math.max(0, limit)), resolve, reject });\n                readLabels();\n            });\n        },\n        keyAt: (row) => labels.get(row),\n        clear() {\n            drop(\"search cleared\");\n            publish({ ...NO_SEEK, again: snapshot.again });\n            // The driver's pin protects the jump target until it lands; a\n            // cleared search has no target, so its pin goes with it (#614).\n            options.clearJump();\n        },\n        askAgain() {\n            if (query === null) return;\n            dropLabels(new Error(\"search snapshot changed\"));\n            publish({ ...snapshot, again: snapshot.again + 1 });\n        },\n        refresh() {\n            read();\n            readLabels();\n        },\n        disconnect() {\n            tracked.release();\n            labelRead.release();\n        },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The narrowing's chrome and the one shared scale (§3/§8, #1344).\n *\n * A Plan's narrowing is one `Slice.bindRecords` (`root/sources.ts`): its\n * `rows` source gives the canvas its rows, and each event kind narrowed\n * through a source of its own reads its events through it. The window is the\n * sources' shared `range`: every source whose range field speaks the axis's\n * arm holds it — an event kind's, a tab's that lists what is in the dates on\n * screen — the first leading. The canvas's rows never follow the dates: the\n * `rows` source and a resource kind's never hold the window, so a pan, a\n * step, the brush or a key never narrows them again, and a date field there\n * is a field of the rail the viewer sets. The leading source's window is the\n * canvas's; with none — a choice that replaced it, a preset, Clear all — the\n * window last shown stands, and before any, the axis's stated window. A source\n * that does not hold the window takes it, unless writing it would replace a\n * choice of the source's own, which the reader made knowingly: the range\n * editor said so. The rows never set the window (#822).\n *\n * A canvas whose slice has no source holding the window holds its own\n * ({@link PlanWindowHold}): the pan, the keys, the now rung, the brush and the\n * date navigator move it, and the render follows. Each move is kept under the\n * canvas's storage key, as its toggles are (#813, `persisted.ts`), and a\n * remount opens on it from its first paint ({@link restoredWindow}) while the\n * axis still allows it — else on the axis's stated window. A canvas with no\n * slice keeps the axis's stated window.\n *\n * The resolution is the leading source's, written to each source holding the\n * window, else to every source (`controller/effects.ts`); a record's\n * resolution only re-buckets the canvas, and is no part of a source's\n * narrowing, so zooming fetches nothing.\n *\n * @packageDocumentation\n */\n\nimport { useLayoutEffect, useMemo, useState, useSyncExternalStore } from \"react\";\nimport { getSomeorUndefined, useSlicesReactivity } from \"@elaraai/east-ui-components\";\nimport { recordSliceWindow, recordSliceWindowFits, setRecordSliceWindow } from \"@elaraai/east-ui-components/internal\";\nimport { tileNext, tileStart, type RecordTile } from \"@elaraai/east-ui/internal\";\nimport { resolveScale, type PlanAxisValue } from \"../axis.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanAxisKind } from \"../instant.js\";\nimport type { PlanRootValue } from \"../model.js\";\nimport type { PlanOwnWindow } from \"../persisted.js\";\nimport type { PlanWords } from \"../words.js\";\nimport { PLAN_ROW_SOURCES, planSlices, planWindowParts, type PlanSlicesChrome, type PlanSourcePart } from \"./sources.js\";\n\n/** A source holding the window: its name, and its part of the slice. */\nexport interface PlanWindowPart {\n    readonly source: string;\n    readonly part: PlanSourcePart;\n}\n\n/**\n * The canvas's window beside what its sources hold (#1344) — one per canvas,\n * shared by its render, its controller's effects and its date navigator, so a\n * gesture moves the window the reader sees.\n *\n * It holds the window last shown: the leading source's while one holds it, so\n * a choice that replaced that source's range leaves it standing — and, while\n * no source of the slice holds one, the canvas's own, which a gesture moves\n * ({@link PlanWindowHold.move}) and the render follows\n * ({@link PlanWindowHold.subscribe}). It names the sources whose ranges never\n * hold the window, as the canvas renders, so its effects read the same\n * sources holding it as its render does.\n */\nexport interface PlanWindowHold {\n    /** The window last shown, `[from, to)` on the axis's domain; `undefined` before any. */\n    last: readonly [number, number] | undefined;\n    /** The sources whose ranges never hold the window, by name: the `rows` source and each resource kind's (`planRowSources`). */\n    rows: readonly string[];\n    /** How many times a gesture has moved the canvas's own window: what its render reads the hold by. */\n    readonly moves: number;\n    /** The span of what the canvas's series shown read through its rows' nested series index (#1438), `[from, to)`: what a zoom\n     *  keeps the canvas's own window inside; `undefined` where none is known. */\n    span: readonly [number, number] | undefined;\n    /** The zoom the canvas's own window was last kept at (#1438): the scale's while the slice holds none — a page's store\n     *  may not outlive the page, where the canvas's storage keeps the window and its zoom; `undefined` before any. */\n    resolution: string | undefined;\n    /**\n     * Moves the canvas's own window — no source of its slice holds one — and\n     * tells its render. The window it shows already moves nothing.\n     *\n     * @param min - The window's start, on the axis's domain\n     * @param max - Its end, exclusive\n     */\n    move(min: number, max: number): void;\n    /**\n     * Listens for a move of the canvas's own window.\n     *\n     * @param listener - Called after each move\n     * @returns Stop listening\n     */\n    subscribe(listener: () => void): () => void;\n}\n\n/**\n * A window hold for a canvas.\n *\n * @param initial - The canvas's own window to open on: what a last session kept, as {@link restoredWindow} takes it\n *   back (#813); left out, no window shown yet\n * @returns The hold, showing `initial`, the `rows` source the one whose range never holds the window\n */\nexport function createPlanWindowHold(initial?: readonly [number, number], resolution?: string): PlanWindowHold {\n    const listeners = new Set<() => void>();\n    let moves = 0;\n    const hold: PlanWindowHold = {\n        last: initial,\n        rows: PLAN_ROW_SOURCES,\n        span: undefined,\n        resolution,\n        get moves() { return moves; },\n        move(min, max) {\n            if (hold.last !== undefined && hold.last[0] === min && hold.last[1] === max) return;\n            hold.last = [min, max];\n            moves += 1;\n            for (const listener of [...listeners]) listener();\n        },\n        subscribe(listener) {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n    };\n    return hold;\n}\n\n/** The resolutions a zoom counts in buckets of the calendar. */\nconst ZOOM_TILES: ReadonlySet<string> = new Set<RecordTile>([\"day\", \"week\", \"month\", \"quarter\", \"year\"]);\n\n/** A bucket's mean length, in ms: how far a run of them around an instant reaches, before the calendar cuts them. */\nconst BUCKET_MS: Readonly<Record<RecordTile, number>> = { day: 864e5, week: 6048e5, month: 2629746e3, quarter: 7889238e3, year: 31556952e3 };\n\n/** Each bucket of a resolution from one instant to another, by its start, in ms: at most ten thousand. */\nfunction bucketsOver(tile: RecordTile, from: number, to: number): number[] {\n    const out: number[] = [];\n    for (let at = tileStart(tile, new Date(from)); at.getTime() < to && out.length < 10_000; at = tileNext(tile, at)) out.push(at.getTime());\n    return out;\n}\n\n/**\n * The window a zoom shows on a canvas holding its own (#1438): as many\n * buckets of the new resolution as the window shown held of the old, about\n * the same middle, or the one given — inside the span of what its series read where it is\n * known, the whole span where they do not fit, and over the window shown too\n * where it lies outside the span. Where a source holds the window it is that\n * source's narrowing, and a zoom only re-buckets.\n *\n * @param shown - The window shown, `[from, to)` in ms\n * @param from - The resolution it shows at\n * @param to - The resolution zoomed to\n * @param span - The span of what the series read, `[from, to)` in ms; `undefined` where none is known\n * @param about - The middle it zooms about, in ms: the window shown's own unless given — a table cell's period, where a\n *   double click on it zooms to edit it (#1438)\n * @returns The window, `[from, to)` in ms, each end a bucket's edge; `undefined` for a resolution no calendar bucket names\n */\nexport function zoomedWindow(shown: readonly [number, number], from: string, to: string,\n    span: readonly [number, number] | undefined, about?: number): readonly [number, number] | undefined {\n    if (!ZOOM_TILES.has(from) || !ZOOM_TILES.has(to)) return undefined;\n    const tile = to as RecordTile;\n    const n = Math.max(1, bucketsOver(from as RecordTile, shown[0], shown[1]).length);\n    const middle = about ?? (shown[0] + shown[1]) / 2;\n    const reach = (n + 1) * BUCKET_MS[tile];\n    const buckets = span === undefined\n        ? bucketsOver(tile, middle - reach, middle + reach)\n        : bucketsOver(tile, Math.min(span[0], shown[0]), Math.max(span[1], shown[1]));\n    if (buckets.length === 0) return undefined;\n    let at = 0;\n    while (at + 1 < buckets.length && buckets[at + 1]! <= middle) at++;\n    const first = Math.max(0, Math.min(at - Math.floor(n / 2), buckets.length - n));\n    const last = Math.min(buckets.length, first + n);\n    const end = last < buckets.length ? buckets[last]! : tileNext(tile, new Date(buckets[last - 1]!)).getTime();\n    return [buckets[first]!, end];\n}\n\n/** The canvas's narrowing chrome and scale. */\nexport interface PlanWindow {\n    /** The rail's chrome; `undefined` with no slice. */\n    chrome: PlanSlicesChrome | undefined;\n    /** The sources holding the window, in the slice's order. */\n    windowParts: readonly PlanWindowPart[];\n    /** The leading one: its range editor is the time navigator's Range panel. */\n    lead: PlanWindowPart | undefined;\n    /** The rail's affordance kinds. */\n    affordances: readonly string[];\n    /** The shared scale, or `undefined` when no window resolves. */\n    scale: PlanScale | undefined;\n    /** Why the window could not be written to a source: its indexes answer none beside its choices. */\n    error: string | undefined;\n}\n\n/** Whether a source's window speaks the axis's arm. */\nfunction fits(kind: \"datetime\" | \"integer\" | \"float\", axis: PlanAxisKind): boolean {\n    return axis === \"time\" ? kind === \"datetime\" : axis === \"number\" && kind !== \"datetime\";\n}\n\n/**\n * The leading window among the sources holding one: the first that holds a\n * window of the axis's arm, `[from, to)` on the axis's domain.\n *\n * @param parts - The sources holding the window\n * @param axis - The axis kind\n * @returns Its window; `undefined` while none holds one\n */\nexport function leadingWindow(parts: readonly PlanWindowPart[], axis: PlanAxisKind): readonly [number, number] | undefined {\n    for (const { part } of parts) {\n        const window = recordSliceWindow(part);\n        if (window !== undefined && fits(window.kind, axis) && window.max > window.min) return [window.min, window.max];\n    }\n    return undefined;\n}\n\n/**\n * The axis's stated window on its own domain: what a canvas shows before any\n * source holds one.\n *\n * @param axis - The decoded root axis\n * @returns `[from, to)`; `undefined` for an ordinal axis, or one that states none\n */\nexport function statedWindow(axis: PlanAxisValue): readonly [number, number] | undefined {\n    switch (axis.type) {\n        case \"time\": {\n            const w = getSomeorUndefined(axis.value.window);\n            return w !== undefined ? [w.min.getTime(), w.max.getTime()] : undefined;\n        }\n        case \"number\": {\n            const w = getSomeorUndefined(axis.value.window);\n            return w !== undefined ? [w.min, w.max] : undefined;\n        }\n        case \"ordinal\":\n            return undefined;\n    }\n}\n\n/**\n * The canvas's own window a last session kept under its storage key (#813), as\n * the canvas takes it back before its first paint: only while it holds its own\n * — its slice has no source holding the window, whose state keeps it — and only\n * a window the axis still allows, on the arm it was written on and one the axis\n * lays out at the zoom it was kept at — or, kept with none, the slice's —\n * in no more buckets than the canvas draws. Anything else leaves the axis's\n * stated window.\n *\n * @param kept - What the canvas's storage keeps of its own window\n * @param value - The root the canvas mounts with: its axis and its slice\n * @param rows - The sources whose ranges never hold the window (`planRowSources`)\n * @returns The window to open on, `[from, to)` on the axis's domain; `undefined` to open on the stated one\n */\nexport function restoredWindow(kept: PlanOwnWindow | undefined, value: PlanRootValue, rows: readonly string[]): readonly [number, number] | undefined {\n    if (kept === undefined || value.axis.type !== kept.kind) return undefined;\n    const chrome = planSlices(value);\n    // A canvas with no slice keeps the axis's stated window, and one whose sources hold the window shows theirs.\n    if (chrome === undefined || planWindowParts(chrome, value.axis.type, rows).length > 0) return undefined;\n    const window = [kept.min, kept.max] as const;\n    const scale = resolveScale({ axis: value.axis, sliceWindow: window, sliceResolution: kept.resolution ?? slicedResolution(chrome, []) });\n    return scale === undefined || scale.truncated !== undefined ? undefined : window;\n}\n\n/**\n * The resolution the slice holds: the leading source's, else the first\n * source's — a slice with no window holds it there.\n *\n * @param chrome - The rail's chrome\n * @param parts - The sources holding the window\n * @returns Its tag; `undefined` while it holds none\n */\nexport function slicedResolution(chrome: PlanSlicesChrome | undefined, parts: readonly PlanWindowPart[]): string | undefined {\n    const part = parts[0]?.part ?? chrome?.slice.parts[0]?.slice;\n    return part === undefined ? undefined : getSomeorUndefined(part.read().resolution)?.type;\n}\n\n/**\n * The narrowing's chrome and the scale every row positions against.\n *\n * @param value - The latest root (its slice's chrome)\n * @param data - The root's data-stable twin (its axis)\n * @param words - The canvas's words — the locale the ruler labels format in (#820)\n * @param hold - The canvas's window hold (see {@link PlanWindowHold})\n * @param rows - The sources whose ranges never hold the window: the `rows` source and each resource kind's (`planRowSources`)\n * @returns The chrome, the sources holding the window, and the scale\n */\nexport function usePlanWindow(value: PlanRootValue, data: PlanRootValue, words: PlanWords, hold: PlanWindowHold, rows: readonly string[]): PlanWindow {\n    const chrome = useMemo(() => planSlices(value), [value]);\n    const axis = data.axis.type;\n    const windowParts = useMemo(() => planWindowParts(chrome, axis, rows), [chrome, axis, rows]);\n    // The controller's effects read the sources holding the window as the render does: they name the same row sources.\n    useLayoutEffect(() => { hold.rows = rows; }, [hold, rows]);\n    // Re-render on every write to a source: the window and the resolution are their state, whoever wrote them. And on\n    // every move of the canvas's own window, while no source holds one: the hold's state.\n    const version = useSlicesReactivity(chrome?.slice.parts.map((p) => p.slice.key) ?? []);\n    useSyncExternalStore(hold.subscribe, () => hold.moves, () => hold.moves);\n    const affordances = useMemo(() => chrome?.affordances.map((a) => a.type) ?? [], [chrome]);\n    // Read as numbers, never as the decoded state's objects, which are new every read: a memo keyed on them would\n    // rebuild the scale — and hand every mounted row a new one — on every render (#812).\n    const lead = leadingWindow(windowParts, axis);\n    if (lead !== undefined) hold.last = lead;\n    const from = (lead ?? hold.last)?.[0];\n    const to = (lead ?? hold.last)?.[1];\n    // The slice's zoom, else — the canvas holding its own window — the zoom that window was kept at (#1438).\n    const resolution = slicedResolution(chrome, windowParts) ?? (lead === undefined ? hold.resolution : undefined);\n    // `resolveScale` owns the ladder: the sources' window — or the canvas's own — ▸ the stated window, per axis kind. The\n    // rows are no input (#822), so windows landing keep one scale rather than handing every mounted row a new one (#812).\n    const scale = useMemo(() => resolveScale({\n        axis: data.axis,\n        sliceWindow: from === undefined || to === undefined ? undefined : [from, to],\n        sliceResolution: resolution,\n        words,\n    }), [data.axis, from, to, resolution, words]);\n    // Every source that does not hold the window yet takes it — a first mount, a range a choice replaced, or another\n    // source's range written by the range editor — unless it would replace a choice of the source's own.\n    const [error, setError] = useState<string>();\n    const stated = statedWindow(data.axis);\n    const targetFrom = from ?? stated?.[0];\n    const targetTo = to ?? stated?.[1];\n    useLayoutEffect(() => {\n        if (targetFrom === undefined || targetTo === undefined || windowParts.length === 0) return;\n        try {\n            for (const { part } of windowParts) {\n                const held = recordSliceWindow(part);\n                if (held !== undefined && held.min === targetFrom && held.max === targetTo) continue;\n                if (!recordSliceWindowFits(part)) continue;\n                setRecordSliceWindow(part, targetFrom, targetTo);\n            }\n            setError(undefined);\n        } catch (reason) {\n            setError(reason instanceof Error ? reason.message : \"The window could not be applied\");\n        }\n        // `version` moves with every source's state: a range cleared or written there is followed here.\n    }, [windowParts, targetFrom, targetTo, version]);\n    const leadPart = windowParts[0];\n    return useMemo(() => ({ chrome, windowParts, lead: leadPart, affordances, scale, error }),\n        [chrome, windowParts, leadPart, affordances, scale, error]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The Plan's effects (#815) — what a state transition asks of the world: the\n * window and the resolution written into the sources of its slice (#1344),\n * and the author's callbacks. The controller runs them INSIDE the action that\n * produced them, right after the transition.\n *\n * # One window across the sources\n *\n * Every source of the Plan's `Slice.bindRecords` whose range field speaks the\n * axis's arm holds the window (`root/window.ts`) — but the canvas's rows', the\n * `rows` source's and each resource kind's, which the dates on screen never\n * narrow. A pan, the now rung, the brush and the time navigator write the\n * window into each of them at once — the reader's own gesture, so a choice of\n * a source's that no index takes beside a window gives way, as the range\n * editor says it would. A canvas whose slice has no source holding the window\n * holds its own (`PlanWindowHold`), and the same gestures move it; a canvas\n * with no slice keeps the axis's stated window, and an ordinal axis's list is\n * its window.\n *\n * # Every window write reads the CURRENT window\n *\n * A pan, the now rung and the resolution zoom are all arithmetic on the window\n * shown — the one the sources hold, or the canvas's own. They resolve the\n * scale from a fresh read rather than from the one the last render drew with,\n * so two effectful actions in one handler compose: two `]` presses pan two\n * periods, where the second one used to be computed from the window the first\n * had already moved.\n *\n * # A resolution only re-buckets\n *\n * A record's resolution is presentation: switching WEEK → DAY re-buckets the\n * window shown, and fetches nothing — it is no part of a source's narrowing.\n * It is written to each source holding the window, else to every source — a\n * slice with no window holds it there.\n *\n * @packageDocumentation\n */\n\nimport { some, variant } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { setRecordSliceWindow } from \"@elaraai/east-ui-components/internal\";\nimport { axisNow, resolveScale } from \"../axis.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport { instantOrder, type PlanInstantValue } from \"../instant.js\";\nimport { rowIdOfKey, type PlanRootValue } from \"../model.js\";\nimport type { PlanEffect } from \"../plan-state.js\";\nimport { planSlices, planWindowParts } from \"../root/sources.js\";\nimport { leadingWindow, slicedResolution, statedWindow, zoomedWindow, type PlanWindowHold, type PlanWindowPart } from \"../root/window.js\";\n\n/**\n * The scale as the window is held NOW — the same resolution the canvas\n * renders with (`resolveScale` over the leading source's window and the\n * resolution, else the window last shown — the canvas's own, while no source\n * holds one — and the axis's stated window).\n *\n * @param value - The latest root\n * @param hold - The canvas's window hold: the window last shown, and the sources whose ranges never hold it\n * @returns The scale, or `undefined` when no window resolves\n */\nexport function currentScale(value: PlanRootValue, hold?: PlanWindowHold): PlanScale | undefined {\n    const chrome = planSlices(value);\n    const parts = planWindowParts(chrome, value.axis.type, hold?.rows);\n    const lead = leadingWindow(parts, value.axis.type);\n    // The slice's zoom, else — the canvas holding its own window — the zoom that window was kept at (#1438).\n    const resolution = slicedResolution(chrome, parts) ?? (lead === undefined ? hold?.resolution : undefined);\n    return resolveScale({ axis: value.axis, sliceWindow: lead ?? hold?.last, sliceResolution: resolution });\n}\n\n/**\n * Write a window `[min, max)` — the reader's own gesture, a pan, the brush,\n * the time navigator: into every source holding the window, else into the\n * canvas's own (#1344), which its render follows.\n *\n * @param parts - The sources holding the window\n * @param min - The window's start, on the axis's domain\n * @param max - Its end, exclusive\n * @param hold - The canvas's window hold: what holds the window while no source does\n */\nexport function writePlanWindow(parts: readonly PlanWindowPart[], min: number, max: number, hold: PlanWindowHold | undefined): void {\n    if (parts.length === 0) {\n        hold?.move(min, max);\n        return;\n    }\n    for (const { part } of parts) setRecordSliceWindow(part, min, max);\n}\n\n/**\n * Run one transition's effects, in order.\n *\n * @param effects - The effects the transition returned\n * @param value - The latest root (its slice and callbacks)\n * @param hold - The canvas's window hold: the window last shown, the canvas's own while no source holds one, and the\n *   sources whose ranges never hold it\n */\nexport function runPlanEffects(effects: readonly PlanEffect[], value: PlanRootValue, hold?: PlanWindowHold): void {\n    for (const eff of effects) {\n        const chrome = planSlices(value);\n        const parts = planWindowParts(chrome, value.axis.type, hold?.rows);\n        const bound = parts.length > 0;\n        // The window a gesture moves: the sources holding it, else — a canvas whose slice has none holding it — the\n        // canvas's own. A canvas with no slice keeps the axis's stated window, and an ordinal axis's list is its window.\n        const writable = bound || (chrome !== undefined && hold !== undefined && value.axis.type !== \"ordinal\");\n        const write = (min: PlanInstantValue, max: PlanInstantValue) => writePlanWindow(parts, instantOrder(min), instantOrder(max), hold);\n        switch (eff.t) {\n            case \"slice.setRange\": {\n                if (writable) write(eff.min, eff.max);\n                break;\n            }\n            case \"slice.clearRange\": {\n                // A cleared range falls back to the axis's stated window, written as every window is. An axis that\n                // states none takes its window FROM the sources (#822), so clearing would leave the canvas nothing to\n                // draw on: the brush moves that window, and never removes it.\n                const stated = statedWindow(value.axis);\n                if (writable && stated !== undefined) writePlanWindow(parts, stated[0], stated[1], hold);\n                break;\n            }\n            case \"slice.setResolution\": {\n                // A resolution is a TIME-axis fact — the segment only mounts there (a number axis has `step`; an\n                // ordinal list no unit). Where a source holds the window it is the source's narrowing, and a zoom only\n                // re-buckets; a canvas holding its own zooms with it (#1438): as many buckets of the new resolution as\n                // it showed of the old, about the same middle — or the middle the zoom names — inside the span of what\n                // its series read.\n                if (chrome === undefined || value.axis.type !== \"time\") break;\n                const holders = bound ? parts.map(({ part }) => part) : chrome.slice.parts.map(({ slice }) => slice);\n                const shown = !bound && hold !== undefined ? currentScale(value, hold) : undefined;\n                const resolution = some(variant(eff.resolution, null)) as Parameters<(typeof holders)[number][\"setResolution\"]>[0];\n                for (const part of holders) part.setResolution(resolution);\n                if (shown?.resolution !== undefined && hold !== undefined) {\n                    const zoomed = zoomedWindow([shown.toNumber(shown.window.min), shown.toNumber(shown.window.max)], shown.resolution, eff.resolution, hold.span, eff.about);\n                    if (zoomed !== undefined) hold.move(zoomed[0], zoomed[1]);\n                }\n                break;\n            }\n            case \"emit.select\": {\n                // A callback names the row by its typed id, never its key (#822).\n                const fn = getSomeorUndefined(value.onSelect);\n                const id = fn !== undefined ? rowIdOfKey(eff.key) : undefined;\n                if (fn !== undefined && id !== undefined) queueMicrotask(() => fn(id));\n                break;\n            }\n            case \"emit.groupToggle\": {\n                const fn = getSomeorUndefined(value.onGroupToggle);\n                const id = fn !== undefined ? rowIdOfKey(eff.key) : undefined;\n                if (fn !== undefined && id !== undefined) queueMicrotask(() => fn({ row: id, expanded: eff.expanded }));\n                break;\n            }\n            case \"emit.grainChange\": {\n                const fn = getSomeorUndefined(value.onGrainChange);\n                if (fn !== undefined) queueMicrotask(() => fn(variant(eff.grain, null)));\n                break;\n            }\n            case \"scroll.toNow\": {\n                // The now instant is an AXIS fact, so reaching it means moving the WINDOW — the sources', or the\n                // canvas's own. A canvas with no slice has no writable one, so the rung idles there, like the\n                // resolution segment.\n                if (!writable) break;\n                const scale = currentScale(value, hold);\n                const nowInstant = axisNow(value.axis);\n                if (scale === undefined || nowInstant === undefined) break;\n                // Re-derive the window on period edges with the SAME column count, now a third of the way in (ahead\n                // is where the plan lives) — snap + `n` periods on the scale's own domain.\n                const from = scale.offset(scale.floor(nowInstant), -Math.floor(scale.n / 3));\n                write(from, scale.offset(from, scale.n));\n                break;\n            }\n            case \"pan\": {\n                if (!writable) break;\n                const scale = currentScale(value, hold);\n                if (scale === undefined) break;\n                write(scale.offset(scale.window.min, eff.buckets), scale.offset(scale.window.max, eff.buckets));\n                break;\n            }\n        }\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas controller (#815) — ONE framework-free store for everything a\n * Plan canvas remembers between renders: the UI state machine, the paged\n * source's residency, the key search, the open element overlay, the scroll\n * anchor and the scroll target.\n *\n * # Actions run their own effects\n *\n * Every action is a synchronous method: it makes the state transition, then\n * runs the effects that transition returned (slice writes, the author's\n * callbacks, page requests) before it returns. There is no effect batch held\n * in state for a later drain, so two effectful actions in one handler both\n * run — the drain this replaces saw only the last batch.\n *\n * # One notification per action\n *\n * An action — or a window landing, which arrives as a channel firing — changes\n * any number of parts and notifies ONCE, at its end, and only when the\n * snapshot changed. Subscribers select the part they read (`usePlanSelector`),\n * so a row re-renders only when its own slice of the state moves.\n *\n * # Reconcile\n *\n * A host data commit reconciles the UI state against the new rows (#610). The\n * canvas's first render with a new value already draws the reconciled VIEW\n * ({@link reconciledUi}, the same pure transition) — no flash of a vanished\n * row's focus — and `setValue`, the layout-effect sync, commits it so the\n * pruning is real (a row that comes back does not bring its old selection).\n * That commit notifies nobody: it moves nothing a reader shows — the view was\n * drawn from it, and what it prunes belongs to rows that are gone — so the\n * value renders once. The one exception is a changed DECLARED grain, which\n * clears the selection and focus of rows that are still there.\n *\n * # A bound `ui` state (#824)\n *\n * A root may bind the canvas's interaction state to the host (`ui`, a\n * `State.bind` handle). The controller reads it before the first render, then\n * again whenever the state store says something was written and on every\n * `setValue`: a state it has not seen is the host's write, and replaces the\n * selection, the rows folded or opened against their declaration, and the\n * expanded charts. The user's own actions are written back, once per action\n * and only when they moved it. Bound, the canvas persists no toggles of its\n * own under its storage key — the host holds them — though its scroll anchor\n * still is.\n *\n * `focus` in the state is a REQUEST — bring this row into view — which the\n * canvas spends at once (it writes `focus: none` back) and then serves: a row\n * on the canvas has its folded ancestors opened and is scrolled to the top\n * and made the tab stop; a paged row seen before has its window opened\n * first; one never seen is sought by its element's key, when the source can\n * seek. A request that cannot be served is dropped.\n *\n * # A new result keeps the row at the top (#1344, #1354)\n *\n * A new narrowing of the paged rows — the `rows` source's, or a paged\n * resource kind's source's — is a new result: the view the last one drew\n * stands in until its first window lands (the paging driver's `replacing`).\n * Once it has, a bounded frame puts the row at the top of its view back where\n * it was, by its key and the px into it, where the new rows draw it, and else\n * starts at the top — as the Sheet does over a narrowed source's own rows —\n * never seeking the row at the window it was in, which another narrowing's\n * positions do not hold. Where the view rests until the row is placed is the\n * last result's place: the driver is told of it only where nothing scrolls the\n * view, so no window of the new result is read for it.\n *\n * # A place over rows not read is kept by its element (#1398)\n *\n * A view that rests over rows not read — a run, or a window whose read failed\n * — is saved by the source element under its top and the px into that\n * element's window (the paging driver's `unreadPlace`), never by the run's key,\n * which names only its side: the run a remount draws on that side stands for\n * other rows. A remount opens that window where it is (`openAt`), as it opens\n * the window of a row it has not read, and puts the view back as many px into\n * the window once it is in — its rows, or its failure's band.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, none, printFor, some, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { PlanElementRefValue, PlanElementResolver } from \"../context.js\";\nimport {\n    bodyItemKey, canvasRowsOf, restUi, rowIdOfKey, rowItemKey, rowKeyOf, rowKeyWords, skeletonHeight, windowSkeleton,\n    type PlanBodyItem, type PlanFocusCtx, type PlanRootValue, type PlanRowId, type PlanRowValue, type SkeletonUi,\n} from \"../model.js\";\nimport {\n    initialPlanStore, planStoreReducer,\n    type PlanEvent, type PlanGrain, type PlanStore, type PlanUiState, type RowKey,\n} from \"../plan-state.js\";\nimport { type ResidencyOptions, windowedSourceOf } from \"@elaraai/east-ui-components/internal\";\nimport { PLAN_PAGE_SIZE, type PlanViewport } from \"../use-plan-paging.js\";\nimport type { PlanSearch } from \"../use-seek.js\";\nimport {\n    NOT_PERSISTED, sameAnchor, sameKey, sameList, sameOwnWindow, sameToggle,\n    type PlanAnchor, type PlanOwnWindow, type PlanPersisted,\n} from \"../persisted.js\";\nimport { createPagingDriver, type PlanPagingSnapshot, type PlanRowPlace } from \"./paging.js\";\nimport { CANVAS_KEY_TYPE, createSeekDriver, firstAtOrAfter, type PlanSeekSnapshot } from \"./seek.js\";\nimport { currentScale, runPlanEffects } from \"./effects.js\";\nimport { planPart, planSlices, planWindowParts, ROWS_SOURCE } from \"../root/sources.js\";\nimport type { PlanWindowHold } from \"../root/window.js\";\nimport { announcementOf } from \"../a11y.js\";\nimport { PLAN_WORDS, type PlanWords } from \"../words.js\";\n\n/** A resolved overlay body (a resolver's some-value). */\nexport type PlanOverlayBody = Extract<ReturnType<PlanElementResolver>, { type: \"some\" }>[\"value\"];\n\n/** A decoded bound `ui` handle — the root's `ui` some-value (#824). */\nexport type PlanUiBindValue = ValueTypeOf<typeof Plan.Types.UiBind>;\n/** A decoded bound `ui` state. */\nexport type PlanUiStateValue = ValueTypeOf<typeof Plan.Types.UiState>;\n\n/** One open element overlay — the element it belongs to, and its body. */\nexport interface PlanOverlay {\n    ref: PlanElementRefValue;\n    body: PlanOverlayBody;\n}\n\n/** An open tooltip — a labelled mark's own text (a port, a cell marker). */\nexport interface PlanTooltip {\n    /** Which mark it belongs to — its row and the mark's own attribute. */\n    key: string;\n    text: string;\n}\n\n/** The canvas's open surfaces — at most one of each kind (#816: one overlay\n *  layer serves every element). */\nexport interface PlanOverlays {\n    popover: PlanOverlay | null;\n    hover: PlanOverlay | null;\n    tooltip: PlanTooltip | null;\n}\n\n/** Where the persisted scroll anchor is in its restore (#813). */\nexport interface PlanAnchorState {\n    /** The anchor the last session left, if any — or, while it is `keeping`, the row at the top of the view. */\n    saved: PlanAnchor | null;\n    /** `pending` until the body can place it, `seeking` while a paged canvas\n     *  loads its window, `settled` once restored (or found gone). */\n    phase: \"pending\" | \"seeking\" | \"settled\";\n    /**\n     * Whether it is the row at the top of the view a new result of the paged\n     * rows keeps (#1344, #1354) — a new narrowing's, once its rows land: put\n     * back by its key and the px into it where they draw it, and else the view\n     * starts at the top; never sought at the window it was in, which another\n     * narrowing's positions do not hold.\n     */\n    keeping: boolean;\n    /** Where the frame scrolls to restore it — set once, when it settles. */\n    restore: { index: number; offset: number } | undefined;\n}\n\n/** How a keyboard move brings its item into view (#819) — the least scroll\n *  that shows it, or one of its edges at the viewport's. */\nexport type PlanNavAlign = \"auto\" | \"start\" | \"end\";\n\n/** Who owns the scroll position the frame is asked for (#811). */\nexport interface PlanScrollTarget {\n    /** A key search's target, the first skipped row the chip seeks, or the\n     *  item keyboard navigation moved to (#819). */\n    owner: \"search\" | \"skipped\" | \"nav\";\n    /** Bumped per chip click, so the chip scrolls there again after the user moved. */\n    skippedSeq: number;\n    /** Bumped each time a key search's request is served — its target row\n     *  resolved — so the frame brings it in once per search (#574). */\n    searchSeq: number;\n    /** The key search's target row — the first LOADED row at-or-after the\n     *  sought key, resolved ONCE per search, when the window holding the\n     *  matched element has landed. */\n    targetKey: string | undefined;\n    /** The keyboard's target item (`bodyItemKey`), how to bring it into view,\n     *  and a nonce per move — so moving back onto a row the user has since\n     *  scrolled away from scrolls to it again. `row` names the row itself\n     *  when a selection made outside the canvas asks for it (#1198): the\n     *  narrow layout, which has no grid to scroll, brings its card into view. */\n    nav: { key: string; align: PlanNavAlign; seq: number; row?: RowKey | undefined } | undefined;\n}\n\n/**\n * Where keyboard focus rests in the canvas (#819) — the roving tab stop, and a\n * move of DOM focus the keyboard asked for.\n */\nexport interface PlanNav {\n    /** The body item (`bodyItemKey`) holding the canvas's ONE tab stop — the\n     *  last one focused. `null` until something in the grid takes focus: the\n     *  grid itself is the tab stop until then, and whenever the active item\n     *  is not mounted. */\n    active: string | null;\n    /** A requested move of DOM focus: the item focuses itself once it is\n     *  mounted (it may first have to scroll into view), then reports\n     *  {@link PlanController.focusDone} — so a later remount never takes\n     *  focus back. */\n    request: { key: string; seq: number } | null;\n}\n\n/** The live region's latest message (#819). `seq` counts up, so the same\n *  words said twice are two messages. */\nexport interface PlanAnnouncement {\n    text: string;\n    seq: number;\n}\n\n/** Everything the canvas renders from — replaced whole, parts kept by identity. */\nexport interface PlanSnapshot {\n    store: PlanStore;\n    /** Parent rows available to the fold control, including the first inline render. */\n    groups: readonly RowKey[];\n    paging: PlanPagingSnapshot;\n    seek: PlanSeekSnapshot;\n    overlay: PlanOverlays;\n    anchor: PlanAnchorState;\n    scroll: PlanScrollTarget;\n    nav: PlanNav;\n    announce: PlanAnnouncement | null;\n}\n\n/** Options for {@link createPlanController}. */\nexport interface PlanControllerOptions {\n    /** The declared grain at mount. */\n    grain: PlanGrain;\n    /** The declared-collapsed row keys at mount. */\n    collapsed: Iterable<RowKey>;\n    /** What the last session persisted under the canvas's `storageKey` (#813). */\n    restored?: PlanPersisted | undefined;\n    /** Write the persisted state — the canvas passes its storage setter. */\n    persist?: ((next: PlanPersisted) => void) | undefined;\n    /** Residency policy for a paged source (tests tune it). */\n    policy?: ResidencyOptions | undefined;\n    /** The root's bound `ui` handle at mount (#824) — read before the first\n     *  render, so a bound canvas draws the host's state from its first frame. */\n    ui?: PlanUiBindValue | undefined;\n    /** Listen for writes to the state a bound `ui` handle reads. The canvas\n     *  passes the state store's own subscribe: a handle names no key to\n     *  listen to, so every write is looked at, and one that did not move the\n     *  canvas's state does nothing. */\n    subscribeUi?: ((listener: () => void) => () => void) | undefined;\n    /** The canvas's window hold (#1344): the window last shown while no source of its slice holds one — what a\n     *  pan or the now rung moves, as the reader sees it, and what the controller keeps under the canvas's\n     *  storage key as each gesture moves it (#813). */\n    windowHold?: PlanWindowHold | undefined;\n}\n\n/** The canvas controller's handle. */\nexport interface PlanController {\n    getSnapshot(): PlanSnapshot;\n    subscribe(listener: () => void): () => void;\n    /** Props sync — the latest root, and its data-stable twin (a new `data`\n     *  identity is a data change: the UI state reconciles). */\n    setValue(value: PlanRootValue, data: PlanRootValue): void;\n    /** The canvas's words (#820) — the message table and locale its live\n     *  region speaks in. The canvas root hands them over whenever either\n     *  changes; English in `en-US` until then. */\n    setWords(words: PlanWords): void;\n    /** An interaction — the transition, then its effects. */\n    dispatch(e: PlanEvent): void;\n    /** Parent rows in the current canvas, including nested parents. */\n    groupKeys(): readonly RowKey[];\n    /** Fold all parents in one action, retaining offscreen overrides. */\n    setGroupsCollapsed(collapsed: boolean): void;\n    /**\n     * Select events from outside the canvas (#1198) — the overlaps chip's\n     * first pair, a peer the inspector's banner names: the selection replaced\n     * by them, on `row`, the row that draws them, which is brought into view\n     * as a host's `focus` request brings one — its folded ancestors and the\n     * group grain opened, scrolled to and made the tab stop, DOM focus left\n     * where it is. With no row (the viewer hid the series that draws them),\n     * the events are selected and nothing scrolls.\n     */\n    selectEvents(keys: readonly string[], row: RowKey | null): void;\n    /**\n     * Open a row's folded ancestors — and the group grain, where it folds the\n     * top group the row sits under — as the user would to see it: a\n     * conflict's Go to does, before it selects the row and shows it.\n     *\n     * @param key - The row\n     */\n    revealRow(key: RowKey): void;\n    /** An element click — reported to the root's `onElementClick` (#824). */\n    elementClick(ref: PlanElementRefValue): void;\n    /** An element's popover / hover card wants to open or close. Opening runs\n     *  the root's resolver first, and only a `some` body opens; an element whose\n     *  surface is already open is not resolved again. A popover takes the\n     *  surface from a hover card. */\n    overlayIntent(kind: \"popover\" | \"hover\", ref: PlanElementRefValue, open: boolean): void;\n    /** A labelled mark's tooltip opens, or closes (`null`). */\n    tooltipIntent(tip: PlanTooltip | null): void;\n    /** The paged source's content moved under the same source — a drafted\n     *  canvas's windows, derived with new drafts (#880): read its windows\n     *  again at the revision it names now, the rows it has standing in until\n     *  they land (#821). */\n    refreshSource(): void;\n    /** Where the viewport is — the paged source's demand (#577). */\n    reportViewport(at: PlanViewport, scrolling: boolean): void;\n    /**\n     * Home or End past a run not read (#1398, CL10): the source's first or last window read where it is — pinned as a\n     * key search's jump is, so the view's reports leave it be — and the view the key left standing in, retained, until\n     * it lands (the paging snapshot's `standing`); the keyboard's intent lands on its row. The focus moving to any item\n     * but `from` meanwhile puts that view back and reads nothing for the jump. A source that has not counted itself has\n     * no last window to ask for.\n     */\n    jumpToEdge(edge: \"first\" | \"last\", from: string): void;\n    /** The canvas committed a render of `paging` (the paging driver's\n     *  `committed`). Call it after every commit: a jump hands the viewport back\n     *  only once the canvas has shown — and scrolled to — its target (#812). */\n    committed(paging: PlanPagingSnapshot): void;\n    /** Ask a failed window again (#811) — or, with none named, every failed\n     *  window and the source's own failed reads, at once (#1398: the footer\n     *  line's Retry). */\n    retry(w?: number): void;\n    /**\n     * The stored entry the window the canvas draws at a source position read with the entry of an id (#1599, the paging\n     * driver's `entryOf`): what a gesture on a row the canvas shows begins from while its window is read again.\n     */\n    entryOf(id: string, at: number): Uint8Array | undefined;\n    /** Whether the window the canvas draws at a source position has landed at the revision it reads at, never standing in from before (#1599, the paging driver's `landedAt`). */\n    landedAt(at: number): boolean;\n    /** Where a paged row the body does not hold sits — its block's band, and\n     *  how far down it (#823: a link into an evicted window). */\n    placeOf(key: RowKey): PlanRowPlace | undefined;\n    /** The key search, for the toolbar (its `find` / `jump` / `clear` are this\n     *  controller's). Mount it only where the source declares `seek`; its\n     *  `requery` is the seek snapshot's `again` (#821, #1199), and its\n     *  `resetKey` the source's id. */\n    readonly search: Omit<PlanSearch, \"resetKey\" | \"requery\">;\n    /**\n     * Go to a row of the `rows` source Search Records found (#1513): its window opened as a key search's jump opens it,\n     * once the source reads the narrowing the row was placed in, and the view brought to the row as it lands.\n     *\n     * @param key - The row's element key\n     * @param row - Its place among the narrowing's rows\n     * @param narrowing - The narrowing, as the source names it\n     */\n    goToRow(key: string, row: number, narrowing: string): void;\n    /** Drop what {@link PlanController.goToRow} asked: the box cleared. */\n    leaveRow(): void;\n    /** The diagnostics chip asked for the first skipped row (#811). */\n    seekSkipped(): void;\n    /**\n     * Keyboard navigation (#819): make `key` (a `bodyItemKey`) the canvas's\n     * tab stop and move DOM focus onto it — scrolled into view first when an\n     * `align` is given (a move onto an item already beside the focused one\n     * needs none).\n     */\n    focusItem(key: string, align?: PlanNavAlign): void;\n    /**\n     * Scroll an item into view, the focus left where it is: for a cell of the\n     * item to take the focus as it draws, as a conflict's Go to focuses a\n     * table row's cell.\n     *\n     * @param key - The item's key\n     * @param align - Where the view puts it\n     */\n    showItem(key: string, align: PlanNavAlign): void;\n    /** DOM focus landed in an item (a click, a Tab) — it holds the tab stop. */\n    itemFocused(key: string): void;\n    /** The item a focus request named has taken focus. */\n    focusDone(seq: number): void;\n    /** Place the persisted anchor against the body the canvas rendered (#813).\n     *  A no-op once it has settled. */\n    placeAnchor(items: readonly PlanBodyItem[], bounded: boolean): void;\n    /** The frame's scroll settled here — persisted once the anchor has settled. */\n    anchorChanged(at: { index: number; offset: number }, items: readonly PlanBodyItem[]): void;\n    /**\n     * Listen to the source's channels while the canvas is mounted — call it\n     * from an effect and return what it returns. The controller listens from\n     * its first read, so the first `connect` only hands back the\n     * disconnect; a `connect` after a disconnect (StrictMode rehearsing an\n     * unmount, a canvas remounting the same controller) re-reads the source\n     * and any pending search, which subscribes their channels afresh. State\n     * outlives a disconnect.\n     *\n     * @returns Stop listening\n     */\n    connect(): () => void;\n}\n\nconst NO_OVERLAYS: PlanOverlays = { popover: null, hover: null, tooltip: null };\nconst NO_NAV: PlanNav = { active: null, request: null };\nconst NO_ROWS: readonly PlanRowValue[] = [];\nconst groupKeysCache = new WeakMap<readonly PlanRowValue[], readonly RowKey[]>();\nfunction groupKeysOf(rows: readonly PlanRowValue[]): readonly RowKey[] {\n    let keys = groupKeysCache.get(rows);\n    if (keys === undefined) {\n        keys = [...new Set(rows.flatMap(row => row.parent.type === \"some\" ? [row.parent.value] : []))];\n        groupKeysCache.set(rows, keys);\n    }\n    return keys;\n}\nconst refEqual = equalFor(Plan.Types.ElementRef);\n/** Whether two record Slices narrow one record: its editing identity. */\nconst sameSource = equalFor(StringType);\n/** Whether two narrowings, as a live source prints them, are the same one (#1354). */\nconst sameNarrowing = equalFor(StringType);\nconst uiStateEqual = equalFor(Plan.Types.UiState);\n/** A String key's `.east` literal — how an exact key search names it. */\nconst printString = printFor(StringType);\n\n/**\n * The declared-collapsed row keys among `rows`.\n *\n * @param rows - Canvas rows\n * @returns The keys of the rows that declare `collapsed: true` — any row with\n *   children may (#822)\n */\nexport function declaredCollapsedOf(rows: readonly PlanRowValue[]): ReadonlySet<RowKey> {\n    const out = new Set<RowKey>();\n    for (const row of rows) {\n        if (row.collapsed) out.add(row.key);\n    }\n    return out;\n}\n\n/** The declared grain of a root. */\nexport function declaredGrainOf(value: PlanRootValue): PlanGrain {\n    return getSomeorUndefined(value.grain)?.type ?? \"resource\";\n}\n\n/** Whether a root declares the compact density. */\nexport function denseOf(value: PlanRootValue): boolean {\n    return getSomeorUndefined(getSomeorUndefined(value.style)?.density)?.type === \"compact\";\n}\n\n/** What a reconcile is judged against — the rows the canvas renders now. */\nexport interface PlanReconcileModel {\n    /** Every row key the canvas holds. */\n    alive: ReadonlySet<RowKey>;\n    /** Whether `alive` is every row the canvas has (inline), or only the resident ones (paged). */\n    complete: boolean;\n    /** The declared-collapsed row keys among them. */\n    declaredCollapsed: ReadonlySet<RowKey>;\n    /** The declared grain. */\n    declaredGrain: PlanGrain;\n}\n\n/** Each snapshot's element rows, once. */\nconst elementRowsCache = new WeakMap<PlanPagingSnapshot, readonly PlanRowValue[]>();\n\n/**\n * A paged canvas's rows that its source's elements placed — its paged blocks'\n * — which are what a key search looks among. A fixed block's rows are no\n * element's (a section's header, `rows`, the event kinds' rows, #1192), though\n * their ids may read like one.\n *\n * @param p - The paging snapshot\n * @returns Its paged blocks' rows, in order — the same array when no block is fixed\n */\nexport function elementRowsOf(p: PlanPagingSnapshot): readonly PlanRowValue[] {\n    if (!p.blocks.some((b) => b.fixed)) return p.rows;\n    let rows = elementRowsCache.get(p);\n    if (rows === undefined) {\n        rows = p.rows.filter((r) => p.blocks[r.block]?.fixed === false);\n        elementRowsCache.set(p, rows);\n    }\n    return rows;\n}\n\n/**\n * The window the paging driver opens for a saved place's window `w` (#1398):\n * `w` itself, or — `w` past the end of a source that has shrunk since the\n * place was saved — the source's last window, as `openAt` reads it.\n *\n * @param p - The paging snapshot\n * @param w - The window a saved place names\n * @returns The window opened for it\n */\nfunction openedWindow(p: PlanPagingSnapshot, w: number): number {\n    const windows = p.total !== undefined ? Math.ceil(p.total / PLAN_PAGE_SIZE) : 0;\n    return windows > 0 ? Math.min(w, windows - 1) : w;\n}\n\n/**\n * The UI state as a reconcile against `model` would leave it — what the canvas\n * renders its first frame of a new value with, before `setValue` commits the\n * same transition.\n *\n * @param store - The current store\n * @param model - The rows the canvas renders now\n * @returns The reconciled UI state\n */\nexport function reconciledUi(store: PlanStore, model: PlanReconcileModel): PlanUiState {\n    return planStoreReducer(store, { t: \"reconcile\", ...model }).store.ui;\n}\n\n/**\n * Create a canvas controller.\n *\n * @param options - See {@link PlanControllerOptions}\n * @returns The controller\n */\nexport function createPlanController(options: PlanControllerOptions): PlanController {\n    const restored = options.restored ?? NOT_PERSISTED;\n    let value: PlanRootValue | undefined;\n    let data: PlanRootValue | undefined;\n    // The host's interaction state, when the root binds one (#824). Bound, the\n    // host holds the toggles: none are restored from storage, or persisted.\n    let bound = options.ui;\n    // What the canvas last read from, or wrote to, the bound handle — an\n    // outside write is a state it has not seen.\n    let boundSeen: PlanUiStateValue | undefined;\n    // A write-back queued for the end of the turn.\n    let writing = false;\n    // A `focus` request — bring the row into view — until it is served or\n    // given up: `resolve` looks for it, `seeking` waits for the key search,\n    // `opening` for its window.\n    let focusRequest: { key: RowKey; id: PlanRowId; phase: \"resolve\" | \"seeking\" | \"opening\" } | undefined;\n    let store = initialPlanStore(options.grain, options.collapsed,\n        bound !== undefined ? { collapse: [], charts: [] } : restored);\n    let overlay = NO_OVERLAYS;\n    // Nothing saved is nothing to restore: settled from the start, so a canvas\n    // with no anchor never re-renders to say so.\n    let anchor: PlanAnchorState = {\n        saved: restored.anchor,\n        phase: restored.anchor === null ? \"settled\" : \"pending\",\n        keeping: false,\n        restore: undefined,\n    };\n    // Whether the view the last result drew stands in for a new one (#1344, #1354) — and, while the row at the top of\n    // the view is put back once the new one's rows land, where the view last said it rests: the last result's place,\n    // which the new rows do not hold, given the driver only where nothing scrolls the view.\n    let replacing = false;\n    let heldReport: { at: PlanViewport; scrolling: boolean } | undefined;\n    // The narrowing the rows the canvas last drew belong to (#1344, #1354): another's rows landing are a new result's,\n    // whether the last view stood in for them or not — a view that showed only rows not read yet had nothing to stand in.\n    let narrowingDrawn: string | undefined;\n    let scroll: PlanScrollTarget = { owner: \"search\", skippedSeq: 0, searchSeq: 0, targetKey: undefined, nav: undefined };\n    // A key search waiting to be served (#574): the key it sought and the\n    // source element its answer (or its jump) named. Served once, when the\n    // window holding that element has landed — like the Sheet's — and never\n    // again for that search: a window landing above the row, or the row's\n    // window leaving as the reader scrolls on, retargets nothing.\n    let searchRequest: { key: string; row: number } | undefined;\n    let searchJump = 0;\n    // A row Search Records over the `rows` source goes to (#1513): the key and its place among the narrowing's rows, as e3\n    // placed them. It waits for the source to read that narrowing, a pick's clear having just written it, as a jump made\n    // under the last one would be dropped with its rows. `goingToRow` holds its target: no query of the seek driver's does.\n    let rowGoal: { key: string; row: number; narrowing: string } | undefined;\n    let goingToRow = false;\n    let nav = NO_NAV;\n    let navSeq = 0;\n    // The item a far key set out from while the view it left stands in (#1398, CL10): the focus moving anywhere else\n    // puts that view back.\n    let edgeFrom: string | undefined;\n    let announce: PlanAnnouncement | null = null;\n    let words: PlanWords = PLAN_WORDS;\n    // The snapshot of the paged source's data the canvas last showed (#821, #1199).\n    let pagingSnapshot: string | undefined;\n    // What storage holds — compared before every write, so nothing is written\n    // that is already there.\n    let persisted = restored;\n\n    const listeners = new Set<() => void>();\n    let depth = 0;\n    let dirty = false;\n    let connected = true;\n    // A store the canvas has already drawn — committed without a notification.\n    let quietStore: PlanStore | undefined;\n\n    /** The UI state a paged window's height reads (#823) — the store's grain\n     *  and charts, and each row's collapse as the canvas draws it: a declared\n     *  collapse not seeded yet is the collapse its landing will seed, so a\n     *  window measures the same before and after its rows seed. */\n    const skeletonUi: SkeletonUi = {\n        get grain() { return store.ui.grain; },\n        collapsed: (key, declared) => (declared && !store.seeded.has(key)\n            ? store.overrides.get(key) ?? true\n            : store.ui.collapsed.has(key)),\n        get chartsExpanded() { return store.ui.chartsExpanded; },\n    };\n    /** The expand focus's context strips — what a window's rows draw at under\n     *  it (a links focus elides runs across windows, and measures unfocused). */\n    const expandFocus = (): PlanFocusCtx | undefined =>\n        (store.ui.focus?.kind === \"expand\" ? { kind: \"expand\", key: store.ui.focus.key } : undefined);\n\n    const paging = createPagingDriver({\n        // Each landed window's height facts, once (#823) — the axis kind says\n        // which rows draw as diagnostics.\n        skeletonOf: (rows) => windowSkeleton(rows, value?.axis.type),\n        // What the window's rows draw at NOW — the ledger follows the canvas's\n        // collapse, grain, charts and expand focus, so a band that stands for\n        // evicted rows is exactly as tall as they would draw.\n        heightOf: (sk) => (value === undefined ? 0 : skeletonHeight(sk, skeletonUi, denseOf(value), expandFocus())),\n        // At rest (#613): declared collapse, no charts, no focus — what the\n        // slot rate is seeded from, so a first window that landed mid-collapse\n        // does not describe every unvisited one by it.\n        restHeightOf: (sk) => (value === undefined ? 0 : skeletonHeight(sk, restUi(declaredGrainOf(value)), denseOf(value))),\n        policy: options.policy,\n        onChange: () => batch(() => {\n            const landed = paging.getSnapshot();\n            // A new result's rows have landed — a new narrowing's (#1344, #1354), or a new source's of the same record:\n            // the row at the top of the view keeps its place where they draw it, and else the view starts at the top —\n            // in this notification, so the canvas places it as it first draws them. A session's anchor still being\n            // restored goes on. A new narrowing's rows are a new result's whether or not the last view stood in for\n            // them: one that showed only rows not read yet stood in for nothing, and kept its offset into the new rows.\n            const rowsIn = !landed.replacing && landed.rows.length > 0;\n            const anew = rowsIn && narrowingDrawn !== undefined && landed.narrowing !== undefined && !sameNarrowing(landed.narrowing, narrowingDrawn);\n            // A row a pick goes to (#1513) takes the view: no top row is kept for it to fight.\n            const goesToRow = rowGoal !== undefined || searchRequest !== undefined;\n            if (((replacing && !landed.replacing) || anew) && anchor.phase === \"settled\" && !goesToRow) {\n                anchor = { saved: persisted.anchor, phase: \"pending\", keeping: true, restore: anchor.restore };\n            }\n            if (rowsIn) narrowingDrawn = landed.narrowing;\n            replacing = landed.replacing;\n            // Rows that arrive WITHOUT a data change carry their own declared\n            // collapse: seed each declared key ONCE, the first time its row\n            // appears — in the same notification as the rows themselves.\n            store = planStoreReducer(store, { t: \"seed\", declaredCollapsed: declaredCollapsedOf(landed.rows) }).store;\n            // A window landing says nothing in the canvas's live region: what the source reads is the footer's\n            // loading line's to say, once a load (#1398, CL12).\n            // The source's data moved off the snapshot a search was answered\n            // in: its match positions index rows that may have moved (#821), so\n            // the query standing is asked again there (#1199). A new revision\n            // over the same data — its windows read again, new events placed on\n            // them, new drafts — is no new snapshot, and leaves the search\n            // standing. The first snapshot a source names is not a move — a\n            // search asked before it waited for it.\n            if (landed.dataSnapshot !== pagingSnapshot) {\n                if (pagingSnapshot !== undefined) seek.askAgain();\n                pagingSnapshot = landed.dataSnapshot;\n            }\n            // A row a `focus` request waits for may have landed (#824).\n            serveFocus();\n            // The narrowing a pick left may be what the source reads now (#1513).\n            serveRowGoal();\n        }),\n    });\n    const seek = createSeekDriver({\n        clearJump: () => paging.clearJump(),\n        onChange: () => batch(() => undefined),\n    });\n\n    // A bound state is the host's from the first frame (#824) — read before\n    // the first snapshot, so the canvas never draws its own first.\n    if (bound !== undefined) {\n        const read = readBound(bound);\n        if (read !== undefined) {\n            boundSeen = read;\n            adopt(read);\n        }\n    }\n\n    let snapshot: PlanSnapshot = {\n        store, groups: groupKeysOf(NO_ROWS), paging: paging.getSnapshot(), seek: seek.getSnapshot(), overlay, anchor, scroll, nav, announce,\n    };\n\n    // What the paged windows' heights were last measured under (#823).\n    let measuredUnder: {\n        grain: PlanGrain; overrides: PlanStore[\"overrides\"]; charts: ReadonlySet<RowKey>;\n        expand: RowKey | undefined; dense: boolean;\n    } | undefined;\n\n    /** Measure every window the paged blocks have seen again when what their\n     *  rows draw at moved — a collapse toggle, the grain, a chart toggle, an\n     *  expand focus, the density — so the bands that stand for evicted rows\n     *  follow, exactly as the rows would move inline (#823). A seed moves\n     *  nothing here: a window measures an unseeded declared collapse as the\n     *  collapse its seed will be. */\n    function syncHeights(): void {\n        if (value === undefined || value.rows.type === \"inline\") return;\n        const expand = store.ui.focus?.kind === \"expand\" ? store.ui.focus.key : undefined;\n        const dense = denseOf(value);\n        const m = measuredUnder;\n        if (m !== undefined && m.grain === store.ui.grain && m.overrides === store.overrides\n            && m.charts === store.ui.chartsExpanded && m.expand === expand && m.dense === dense) return;\n        measuredUnder = { grain: store.ui.grain, overrides: store.overrides, charts: store.ui.chartsExpanded, expand, dense };\n        if (m !== undefined) paging.remeasure();\n    }\n\n    /** Whether the window holding source element `row` has landed in a block. */\n    function landedAt(p: PlanPagingSnapshot, row: number): boolean {\n        const windows = p.total !== undefined ? Math.max(1, Math.ceil(p.total / PLAN_PAGE_SIZE)) : undefined;\n        const w = Math.floor(Math.max(0, row) / PLAN_PAGE_SIZE);\n        // An answer past the end (a key after every element) is the last window.\n        const at = windows !== undefined ? Math.min(w, windows - 1) : w;\n        for (const o of p.origin.values()) if (o.w === at) return true;\n        return false;\n    }\n\n    /** Rebuild the snapshot from the parts — the same object when none moved. */\n    function refresh(): void {\n        const p = paging.getSnapshot();\n        const s = seek.getSnapshot();\n        const currentGroups = groupKeysOf(rows());\n        // A data commit with the same parents needs no extra render.\n        const groups = sameList(snapshot.groups, currentGroups, sameKey) ? snapshot.groups : currentGroups;\n        // The key search's target: the first loaded row whose element sorts\n        // at-or-after the sought key (a row's id starts with the key of the\n        // element it came from, and the source serves its elements in key\n        // order — #822), resolved once the matched element's window has\n        // landed. A search SERVED takes the viewport back from the\n        // skipped-row chip — the latest request wins — and is not served\n        // again: the rows around it may land and leave as the reader scrolls.\n        if (s.sought === null && !goingToRow) {\n            searchRequest = undefined;\n            if (scroll.targetKey !== undefined) scroll = { ...scroll, targetKey: undefined };\n        } else if (searchRequest !== undefined && !p.replacing && landedAt(p, searchRequest.row)) {\n            const loaded = elementRowsOf(p);\n            const targetKey = loaded[firstAtOrAfter(loaded, searchRequest.key)]?.key;\n            searchRequest = undefined;\n            if (targetKey !== undefined) {\n                const target = loaded.find((row) => row.key === targetKey)!;\n                reveal(target, new Map(p.rows.map((row) => [row.key, row])));\n                persistToggles();\n                writeBound();\n                scroll = { ...scroll, owner: \"search\", targetKey, searchSeq: scroll.searchSeq + 1 };\n            }\n        }\n        const quiet = store === quietStore;\n        quietStore = undefined;\n        const othersSame = snapshot.groups === groups && snapshot.paging === p && snapshot.seek === s && snapshot.overlay === overlay\n            && snapshot.anchor === anchor && snapshot.scroll === scroll && snapshot.nav === nav\n            && snapshot.announce === announce;\n        if (snapshot.store === store && othersSame) return;\n        // Only the store moved, and to what every reader already shows: no one\n        // needs telling (see `setValue`).\n        const drawn = quiet && othersSame;\n        snapshot = { store, groups, paging: p, seek: s, overlay, anchor, scroll, nav, announce };\n        if (!drawn) dirty = true;\n    }\n\n    /** A row's name as the live region says it — its gutter label, or its\n     *  key's words when the row is not at hand (#822). */\n    function labelOf(key: RowKey): string {\n        return rows().find((r) => r.key === key)?.gutter.label ?? rowKeyWords(key);\n    }\n\n    /** Put words in the live region (#819) — nothing when there are none. */\n    function say(text: string | undefined): void {\n        if (text !== undefined) announce = { text, seq: (announce?.seq ?? 0) + 1 };\n    }\n\n    /** The focus is on `key` now (#1398, CL10): an item but the one a far key set out from puts the view that key left\n     *  back, while it stands in — the viewer moved on among its rows, and nothing is read for the jump. */\n    function focusMoved(key: string): void {\n        if (edgeFrom === undefined || key === edgeFrom) return;\n        edgeFrom = undefined;\n        if (paging.standing()) paging.clearJump();\n    }\n\n    /** Run `fn` as one action: whatever it changes notifies once, at the end. */\n    function batch<T>(fn: () => T): T {\n        depth += 1;\n        try {\n            return fn();\n        } finally {\n            depth -= 1;\n            if (depth === 0) {\n                refresh();\n                if (dirty) {\n                    dirty = false;\n                    for (const listener of [...listeners]) listener();\n                }\n            }\n        }\n    }\n\n    /** The canvas's rows — inline, or the resident paged ones. Read through\n     *  the data-stable root, so the inline rows are the canvas's own objects. */\n    function rows(): readonly PlanRowValue[] {\n        if (data === undefined) return NO_ROWS;\n        return data.rows.type === \"inline\" ? canvasRowsOf(data.rows.value) : paging.getSnapshot().rows;\n    }\n\n    /** Write the user's toggles when they differ from what storage holds (#813)\n     *  — unless the root binds a `ui` state, which holds them instead (#824). */\n    function persistToggles(): void {\n        if (bound !== undefined) return;\n        const collapse = [...store.overrides];\n        const charts = [...store.ui.chartsExpanded];\n        if (sameList(persisted.collapse, collapse, sameToggle) && sameList(persisted.charts, charts, sameKey)) return;\n        persisted = { ...persisted, collapse, charts };\n        options.persist?.(persisted);\n    }\n\n    /** Keep the canvas's own window under its storage key as a gesture moves it (#813, #1344): what a remount opens\n     *  on. The hold moves only while no source of the slice holds the window — a source's window is its own state —\n     *  and nothing is written that storage already holds. Bound or not: the window is the reader's place, as the\n     *  scroll anchor is, never a toggle the host holds. */\n    function persistWindow(): void {\n        const hold = options.windowHold;\n        const shown = hold?.last;\n        const kind = value?.axis.type;\n        if (hold === undefined || shown === undefined || (kind !== \"time\" && kind !== \"number\")) return;\n        // A source holding the window keeps it, and its zoom, in its own state.\n        if (planWindowParts(planSlices(value!), kind, hold.rows).length > 0) return;\n        // A time axis's zoom is kept with the window it shows (#1438), and is the one the hold falls back to.\n        const resolution = kind === \"time\" && value !== undefined ? currentScale(value, hold)?.resolution : undefined;\n        hold.resolution = resolution;\n        const next: PlanOwnWindow = { kind, min: shown[0], max: shown[1], ...(resolution !== undefined && { resolution }) };\n        if (sameOwnWindow(persisted.window, next)) return;\n        persisted = { ...persisted, window: next };\n        options.persist?.(persisted);\n    }\n\n    /** Reconcile the UI state against the rows the value holds (#610). */\n    function reconcile(v: PlanRootValue): void {\n        const inline = v.rows.type === \"inline\";\n        const current = rows();\n        store = planStoreReducer(store, {\n            t: \"reconcile\",\n            alive: new Set(current.map((r) => r.key)),\n            // A paged source's resident rows are not all its rows: a key\n            // missing from them may simply not have landed (#813).\n            complete: inline,\n            declaredCollapsed: declaredCollapsedOf(current),\n            declaredGrain: declaredGrainOf(v),\n        }).store;\n        persistToggles();\n    }\n\n    /** One interaction's transition and its effects — the core of `dispatch`,\n     *  for the canvas's own moves too (a focus request opening a section).\n     *\n     *  Bound, the write-back is queued BEFORE the effects queue the author's\n     *  callbacks (#824): a callback that reads the bound state reads the\n     *  interaction in it, and what it writes lands after the canvas's own\n     *  write — the host's word, taken — rather than under it. */\n    function step(e: PlanEvent): void {\n        const next = planStoreReducer(store, { t: \"event\", e });\n        store = next.store;\n        writeBound();\n        if (value !== undefined && next.effects.length > 0) runPlanEffects(next.effects, value, options.windowHold);\n    }\n\n    // ── The bound `ui` state (#824) ────────────────────────────────────────\n\n    /** The bound handle's state — `undefined` when reading it throws. */\n    function readBound(handle: PlanUiBindValue): PlanUiStateValue | undefined {\n        try {\n            return handle.read();\n        } catch (err) {\n            console.error(\"[Plan] ui state read failed:\", err);\n            return undefined;\n        }\n    }\n\n    /** The ids of `keys`, in the order `before` lists them, the rest after —\n     *  so a write-back moves no id the host placed. */\n    function idsOf(keys: Iterable<RowKey>, before: readonly PlanRowId[]): PlanRowId[] {\n        const wanted = new Map<RowKey, PlanRowId>();\n        for (const key of keys) {\n            // A repeated row names its original's id (`rowIdOfKey`) — once.\n            const id = rowIdOfKey(key);\n            if (id !== undefined && !wanted.has(rowKeyOf(id))) wanted.set(rowKeyOf(id), id);\n        }\n        const out: PlanRowId[] = [];\n        for (const id of before) {\n            const text = rowKeyOf(id);\n            if (wanted.has(text)) {\n                out.push(id);\n                wanted.delete(text);\n            }\n        }\n        for (const id of wanted.values()) out.push(id);\n        return out;\n    }\n\n    /** The canvas's interaction state as a bound state — a request spent. */\n    function boundStateOf(): PlanUiStateValue {\n        const folded: RowKey[] = [];\n        const opened: RowKey[] = [];\n        for (const [key, collapsed] of store.overrides) (collapsed ? folded : opened).push(key);\n        const selected = store.ui.selected !== null ? rowIdOfKey(store.ui.selected) : undefined;\n        return {\n            selected: selected !== undefined ? some(selected) : none,\n            collapsed: idsOf(folded, boundSeen?.collapsed ?? []),\n            expanded: idsOf(opened, boundSeen?.expanded ?? []),\n            charts: idsOf(store.ui.chartsExpanded, boundSeen?.charts ?? []),\n            focus: none,\n        };\n    }\n\n    /** Write the canvas's state back to the host, when it moved — at the end\n     *  of the turn, the latest state once. */\n    function writeBound(): void {\n        if (bound === undefined) return;\n        const next = boundStateOf();\n        if (boundSeen !== undefined && uiStateEqual(next, boundSeen)) return;\n        boundSeen = next;\n        if (writing) return;\n        writing = true;\n        queueMicrotask(() => {\n            writing = false;\n            const handle = bound;\n            const state = boundSeen;\n            if (handle === undefined || state === undefined) return;\n            try {\n                handle.write(state);\n            } catch (err) {\n                console.error(\"[Plan] ui state write failed:\", err);\n            }\n        });\n    }\n\n    /** Take the host's state: its selection, folds and charts replace the\n     *  canvas's, and a `focus` request is spent and queued. */\n    function adopt(s: PlanUiStateValue): void {\n        const collapse = new Map<RowKey, boolean>();\n        for (const id of s.expanded) collapse.set(rowKeyOf(id), false);\n        // A row both folded and opened is folded.\n        for (const id of s.collapsed) collapse.set(rowKeyOf(id), true);\n        store = planStoreReducer(store, {\n            t: \"external\",\n            selected: s.selected.type === \"some\" ? rowKeyOf(s.selected.value) : null,\n            collapse,\n            charts: new Set(s.charts.map(rowKeyOf)),\n        }).store;\n        if (s.focus.type === \"some\") {\n            focusRequest = { key: rowKeyOf(s.focus.value), id: s.focus.value, phase: \"resolve\" };\n            // Spent at once: the state says so whatever serving it takes.\n            writeBound();\n        }\n    }\n\n    /** Look at the bound state — a state the canvas has not seen is the\n     *  host's write, and is taken. */\n    function syncBound(): void {\n        // Bound no more: the next binding is read afresh.\n        if (bound === undefined) {\n            boundSeen = undefined;\n            return;\n        }\n        // The canvas's own write is on its way: what the handle holds is older.\n        if (writing) return;\n        const read = readBound(bound);\n        if (read === undefined || (boundSeen !== undefined && uiStateEqual(read, boundSeen))) return;\n        boundSeen = read;\n        adopt(read);\n        serveFocus();\n        syncHeights();\n    }\n\n    /** Open a row's folded ancestors — and the group grain, when it folds the\n     *  top group the row sits under — as the user would to see it. */\n    function reveal(row: PlanRowValue, byKey: ReadonlyMap<RowKey, PlanRowValue>): void {\n        let top = row;\n        for (let up = row.parent; up.type === \"some\";) {\n            const parent = byKey.get(up.value);\n            if (parent === undefined) break;\n            if (store.ui.collapsed.has(parent.key)) step({ t: \"group.toggle\", key: parent.key });\n            top = parent;\n            up = parent.parent;\n        }\n        if (top !== row && top.kind.type === \"group\" && store.ui.grain === \"group\") {\n            // A grain change clears the selection — the user's rule when they\n            // switch; the host's request keeps what the host selected.\n            const selected = store.ui.selected;\n            step({ t: \"grain.set\", grain: \"resource\" });\n            if (selected !== null && store.ui.selected !== selected) store = { ...store, ui: { ...store.ui, selected } };\n        }\n    }\n\n    /** Serve a `focus` request as far as it can go now. */\n    function serveFocus(): void {\n        const req = focusRequest;\n        if (req === undefined || value === undefined) return;\n        const current = rows();\n        const row = current.find((r) => r.key === req.key);\n        if (row !== undefined) {\n            focusRequest = undefined;\n            reveal(row, new Map(current.map((r) => [r.key, r])));\n            // To the top of the view, and the tab stop — DOM focus stays where\n            // it is: the host asked for the row to be shown, not the keyboard.\n            const item = rowItemKey(row.key);\n            navSeq += 1;\n            nav = { ...nav, active: item };\n            scroll = { ...scroll, owner: \"nav\", nav: { key: item, align: \"start\", seq: navSeq } };\n            persistToggles();\n            syncHeights();\n            writeBound();\n            return;\n        }\n        // Not on the canvas: a paged row may yet land; an inline one will not.\n        if (value.rows.type === \"inline\") {\n            focusRequest = undefined;\n            return;\n        }\n        switch (req.phase) {\n            case \"resolve\": {\n                // Seen before — its window, opened.\n                const seen = paging.seenAt(req.key);\n                if (seen !== undefined) {\n                    focusRequest = { ...req, phase: \"opening\" };\n                    paging.openAt(seen.w * PLAN_PAGE_SIZE, seen.block);\n                    return;\n                }\n                // Never seen — sought by the key of the element it comes from.\n                const element = req.id.type === \"entry\" ? req.id.value.path[0] : undefined;\n                if (element === undefined || value.rows.value.seek.type !== \"some\") {\n                    focusRequest = undefined;\n                    return;\n                }\n                const waiting = { ...req, phase: \"seeking\" as const };\n                focusRequest = waiting;\n                seek.find({ key: printString(element) }).then(\n                    (range) => batch(() => {\n                        if (focusRequest !== waiting) return;\n                        // The request's search, not the toolbar's: it leaves\n                        // no query behind to take the scroll back.\n                        seek.clear();\n                        if (!range.found) {\n                            focusRequest = undefined;\n                            return;\n                        }\n                        focusRequest = { ...req, phase: \"opening\" };\n                        paging.jumpToElement(range.row);\n                        serveFocus();\n                    }),\n                    () => batch(() => { if (focusRequest === waiting) focusRequest = undefined; }),\n                );\n                return;\n            }\n            case \"seeking\":\n                return;\n            case \"opening\":\n                // Its window settled without the row: nowhere left to look.\n                if (!paging.jumping()) focusRequest = undefined;\n                return;\n        }\n    }\n\n    /** Go to the row a pick placed, once the source reads the narrowing it was placed in (#1513). */\n    function serveRowGoal(): void {\n        const goal = rowGoal;\n        const reading = paging.getSnapshot().narrowing;\n        if (goal === undefined || reading === undefined || !sameNarrowing(reading, goal.narrowing)) return;\n        rowGoal = undefined;\n        searchRequest = { key: goal.key, row: goal.row };\n        paging.jumpToElement(goal.row);\n    }\n\n    /** Ask for the row of the element `row` under the standing search. */\n    function requestSearch(row: number): void {\n        const sought = seek.getSnapshot().sought;\n        if (sought !== null) searchRequest = { key: seek.keyAt(row) ?? sought.key, row };\n    }\n\n    const search: Omit<PlanSearch, \"resetKey\" | \"requery\"> = {\n        keyType: CANVAS_KEY_TYPE,\n        find: (q, again) => {\n            searchJump++;\n            // The query standing, asked again at a new snapshot (#1199): its\n            // answer indexes that snapshot's rows, and the view stays put.\n            if (again === true) return seek.find(q);\n            // A new search takes the viewport back from the skipped-row chip,\n            // and the previous one's row, still waiting, is not served.\n            batch(() => {\n                searchRequest = undefined;\n                if (scroll.owner !== \"search\") scroll = { ...scroll, owner: \"search\" };\n            });\n            const found = seek.find(q);\n            // Its answer names the element the match run starts at (or would\n            // sit at): the canvas goes there once that element's window is on\n            // it — typed ahead over loaded rows, at once. A superseded search\n            // rejects, and asks for nothing.\n            found.then((range) => batch(() => requestSearch(range.row)), () => undefined);\n            return found;\n        },\n        listRange: (row, limit) => seek.listRange(row, limit),\n        // Hand the driver the matched ELEMENT: residency rebases there and the\n        // windows in between are never fetched (#577) — and the canvas goes to\n        // the search's row once that window lands.\n        jump: (row) => batch(() => {\n            const seq = ++searchJump;\n            paging.jumpToElement(row);\n            if (seek.keyAt(row) !== undefined) requestSearch(row);\n            else void seek.listRange(row, 1).then(() => batch(() => {\n                if (seq === searchJump) requestSearch(row);\n            }), () => undefined);\n        }),\n        clear: () => batch(() => { searchJump++; seek.clear(); }),\n    };\n\n    return {\n        getSnapshot: () => snapshot,\n        subscribe(listener) {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n        setValue(next, nextData) {\n            batch(() => {\n                const prev = value;\n                const dataChanged = !Object.is(nextData, data);\n                value = next;\n                data = nextData;\n                bound = getSomeorUndefined(next.ui);\n                const src = windowedSourceOf(next.rows);\n                seek.setSource(src);\n                // The rows of one record narrowed anew (#1344): the same record, so the rows standing are kept until\n                // the new narrowing's windows land.\n                const before = prev === undefined ? undefined : planPart(planSlices(prev), ROWS_SOURCE);\n                const after = planPart(planSlices(next), ROWS_SOURCE);\n                const keep = before !== undefined && after !== undefined && sameSource(before.sourceId, after.sourceId);\n                paging.setSource(src, keep);\n                // Which rows draw as diagnostics is the axis kind's to say:\n                // the windows take their skeletons again.\n                if (prev !== undefined && src !== undefined && prev.axis.type !== next.axis.type) paging.reskeleton();\n                if (dataChanged) {\n                    const grain = store.declaredGrain;\n                    reconcile(next);\n                    const reconciled = store;\n                    // Bound, the host's word outranks what the reconcile\n                    // pruned: a row it names that only now arrives follows it.\n                    if (bound !== undefined && boundSeen !== undefined) adopt(boundSeen);\n                    // The canvas drew this value's reconciled view, so the\n                    // commit moves nothing a reader shows — unless the declared\n                    // grain changed, which clears the selection and focus of\n                    // rows that are still there (and read the store itself),\n                    // or the host's state put back what the reconcile pruned.\n                    if (store.declaredGrain === grain && store === reconciled) quietStore = store;\n                }\n                // The host's write — its Reactive rendered this value (#824).\n                syncBound();\n                // A row a `focus` request waits for may have arrived.\n                serveFocus();\n                // A new density, or a grain the declaration changed, redraws\n                // the paged windows' rows at other heights.\n                syncHeights();\n            });\n        },\n        setWords(next) {\n            // Nothing on screen reads them from here — only what is said next.\n            words = next;\n        },\n        dispatch(e) {\n            batch(() => {\n                const before = store.ui;\n                // A resolution lives in the slice: what it was, to say what it became.\n                const resolutionBefore = e.t === \"resolution.set\" && value !== undefined\n                    ? currentScale(value, options.windowHold)?.resolution : undefined;\n                // Bound, what the user did is the host's to hold (#824) —\n                // written back by the step, ahead of the callbacks it fires.\n                step(e);\n                persistToggles();\n                // A collapse, the grain, a chart or an expand focus redraws the\n                // paged windows' rows at other heights (#823).\n                syncHeights();\n                // What the interaction changed, for the live region (#819) —\n                // said by the action that did it, so a reconcile or a landing\n                // that moves the same state says nothing.\n                say(announcementOf(e, before, store.ui, labelOf, words));\n                if (e.t === \"resolution.set\" && value !== undefined) {\n                    const after = currentScale(value, options.windowHold)?.resolution;\n                    if (after !== undefined && after !== resolutionBefore) say(words.m.announceResolution({ resolution: after }));\n                    // A zoom that left the canvas's own window where it was is kept with it all the same (#1438).\n                    persistWindow();\n                }\n            });\n        },\n        groupKeys: () => groupKeysOf(rows()),\n        setGroupsCollapsed(collapsed) {\n            batch(() => {\n                // Include previously visited parents whose pages are evicted.\n                // Changing a fold never reads the rest of the record.\n                const keys = [...new Set([...groupKeysOf(rows()), ...store.overrides.keys(), ...store.seeded])];\n                if (keys.length === 0) return;\n                step({ t: \"groups.set\", keys, collapsed });\n                persistToggles();\n                syncHeights();\n            });\n        },\n        selectEvents(keys, row) {\n            batch(() => {\n                const before = store.ui;\n                const current = rows();\n                const at = row !== null ? current.find((r) => r.key === row) : undefined;\n                // Opened first: a grain change clears the selection.\n                if (at !== undefined) reveal(at, new Map(current.map((r) => [r.key, r])));\n                const e: PlanEvent = { t: \"elements.select\", keys, row };\n                step(e);\n                if (at !== undefined) {\n                    // Into view, and the tab stop — DOM focus stays on the\n                    // control that asked, as a host's focus request leaves it.\n                    const item = rowItemKey(at.key);\n                    navSeq += 1;\n                    nav = { ...nav, active: item };\n                    scroll = { ...scroll, owner: \"nav\", nav: { key: item, align: \"auto\", seq: navSeq, row: at.key } };\n                }\n                persistToggles();\n                syncHeights();\n                // The selection is what the reader asked for: the folds and the\n                // grain it took are said by the canvas as it draws them.\n                say(announcementOf(e, before, store.ui, labelOf, words));\n            });\n        },\n        revealRow(key) {\n            batch(() => {\n                const current = rows();\n                const row = current.find((r) => r.key === key);\n                if (row === undefined) return;\n                reveal(row, new Map(current.map((r) => [r.key, r])));\n                persistToggles();\n                syncHeights();\n            });\n        },\n        focusItem(key, align) {\n            batch(() => {\n                focusMoved(key);\n                navSeq += 1;\n                nav = { active: key, request: { key, seq: navSeq } };\n                if (align !== undefined) scroll = { ...scroll, owner: \"nav\", nav: { key, align, seq: navSeq } };\n            });\n        },\n        showItem(key, align) {\n            batch(() => {\n                navSeq += 1;\n                scroll = { ...scroll, owner: \"nav\", nav: { key, align, seq: navSeq } };\n            });\n        },\n        itemFocused(key) {\n            if (nav.active === key) return;\n            batch(() => {\n                focusMoved(key);\n                nav = { ...nav, active: key };\n            });\n        },\n        focusDone(seq) {\n            if (nav.request === null || nav.request.seq !== seq) return;\n            batch(() => { nav = { ...nav, request: null }; });\n        },\n        elementClick(ref) {\n            // ONE callback over the element ref (#824) — the LATEST root's.\n            const fn = value !== undefined ? getSomeorUndefined(value.onElementClick) : undefined;\n            if (fn !== undefined) queueMicrotask(() => fn(ref));\n        },\n        overlayIntent(kind, ref, open) {\n            batch(() => {\n                const current = overlay[kind];\n                if (!open) {\n                    // Close unmounts the body — never a stale hidden surface.\n                    if (current !== null && refEqual(current.ref, ref)) overlay = { ...overlay, [kind]: null };\n                    return;\n                }\n                // Already open for this element: resolved once per open, never\n                // again while it stays open.\n                if (current !== null && refEqual(current.ref, ref)) return;\n                const resolver = value !== undefined\n                    ? getSomeorUndefined(kind === \"popover\" ? value.popover : value.hover)\n                    : undefined;\n                if (resolver === undefined) return;\n                // The resolver runs FIRST and only a `some` body opens — an\n                // empty surface never flashes. One that throws opens nothing.\n                let body: PlanOverlayBody | undefined;\n                try {\n                    const res = resolver(ref);\n                    body = res.type === \"some\" ? res.value : undefined;\n                } catch (err) {\n                    console.error(`[Plan] ${kind} resolver failed:`, err);\n                }\n                if (body === undefined) return;\n                overlay = kind === \"popover\"\n                    // A click takes the surface: the hover card over the same\n                    // spot would sit on top of what was asked for.\n                    ? { ...overlay, popover: { ref, body }, hover: null }\n                    : { ...overlay, hover: { ref, body } };\n            });\n        },\n        tooltipIntent(tip) {\n            batch(() => {\n                if (tip === null) {\n                    if (overlay.tooltip !== null) overlay = { ...overlay, tooltip: null };\n                    return;\n                }\n                if (overlay.tooltip?.key === tip.key && overlay.tooltip.text === tip.text) return;\n                overlay = { ...overlay, tooltip: tip };\n            });\n        },\n        refreshSource() {\n            batch(() => paging.refresh());\n        },\n        reportViewport(at, scrolling) {\n            // The new result's top row still to be put back (#1344): where the view rests is the last result's place,\n            // held until the canvas places the row — honoured then only where nothing scrolls the view.\n            if (anchor.keeping && anchor.phase !== \"settled\") {\n                heldReport = { at, scrolling };\n                return;\n            }\n            batch(() => paging.reportViewport(at, scrolling));\n        },\n        jumpToEdge(edge, from) {\n            batch(() => {\n                const total = paging.getSnapshot().total;\n                const element = edge === \"first\" ? 0 : total === undefined ? undefined : Math.max(0, total - 1);\n                if (element === undefined) return;\n                edgeFrom = from;\n                paging.standTo(element);\n            });\n        },\n        committed(rendered) {\n            batch(() => {\n                paging.committed(rendered);\n                // A `focus` request's window settled — with its row, or not.\n                serveFocus();\n            });\n        },\n        retry(w) {\n            batch(() => paging.retry(w));\n        },\n        entryOf: (id, at) => paging.entryOf(id, at),\n        landedAt: (at) => paging.landedAt(at),\n        placeOf: (key) => paging.placeOf(key),\n        search,\n        goToRow(key, row, narrowing) {\n            batch(() => {\n                goingToRow = true;\n                searchRequest = undefined;\n                rowGoal = { key, row, narrowing };\n                if (scroll.owner !== \"search\") scroll = { ...scroll, owner: \"search\" };\n                serveRowGoal();\n            });\n        },\n        leaveRow() {\n            batch(() => {\n                goingToRow = false;\n                rowGoal = undefined;\n                searchRequest = undefined;\n                paging.clearJump();\n            });\n        },\n        seekSkipped() {\n            batch(() => { scroll = { ...scroll, owner: \"skipped\", skippedSeq: scroll.skippedSeq + 1 }; });\n        },\n        placeAnchor(items, bounded) {\n            if (anchor.phase === \"settled\") return;\n            batch(() => {\n                const saved = anchor.saved;\n                if (anchor.keeping) {\n                    // A new result's rows (#1344, #1354): the row at the top of the view put back by its key and the px\n                    // into it where they draw it, and else the view at the top — a bounded frame's, which scrolls\n                    // itself; an unbounded canvas's place is its page's, and the narrow list keeps none.\n                    const held = heldReport;\n                    if (bounded && saved !== null) {\n                        if (items.length === 0) return;\n                        // Only a row is kept: a run of rows not read is keyed by its side alone, and the new result's run\n                        // on that side stands for other rows — a view that rested over one starts at the top.\n                        const at = items.findIndex((it) => it.kind === \"row\" && bodyItemKey(it) === saved.key);\n                        // The frame's scroll to the row reports where it lands.\n                        heldReport = undefined;\n                        anchor = { saved, phase: \"settled\", keeping: false, restore: at >= 0 ? { index: at, offset: saved.offset } : { index: 0, offset: 0 } };\n                        return;\n                    }\n                    // Nothing scrolls the view: where it rested while it was being placed is its place again.\n                    heldReport = undefined;\n                    anchor = { ...anchor, phase: \"settled\", keeping: false };\n                    if (held !== undefined) paging.reportViewport(held.at, held.scrolling);\n                    return;\n                }\n                // Only a bounded frame scrolls itself: an unbounded canvas's\n                // place is its page's, and the narrow list keeps none.\n                if (saved === null || !bounded) {\n                    anchor = { ...anchor, phase: \"settled\" };\n                    return;\n                }\n                if (items.length === 0) {\n                    // Nothing drawn yet: what the place is put back against is still to land — unless nothing ever will,\n                    // the rows inline and none of them, or the paged source counted empty under its narrowing (#1398).\n                    // Then there is nothing to seek, and the place settles where the view is.\n                    const snap = paging.getSnapshot();\n                    const empty = value !== undefined && (value.rows.type === \"inline\" || (snap.total === 0 && !snap.replacing));\n                    if (empty) anchor = { ...anchor, phase: \"settled\" };\n                    return;\n                }\n                if (saved.element !== undefined && value !== undefined && value.rows.type !== \"inline\") {\n                    // The view rested over rows not read (#1398): its element's window opened where it is — a rebase,\n                    // not a walk — and the view put back as many px into that window once it is in, as its rows or as\n                    // its failure's band. Never the saved key: the run on that side stands for other rows now.\n                    const block = saved.block ?? undefined;\n                    if (anchor.phase === \"pending\") {\n                        anchor = { ...anchor, phase: \"seeking\" };\n                        paging.openAt(saved.element, block);\n                        return;\n                    }\n                    const snap = paging.getSnapshot();\n                    // An element past the end — saved against a longer source — is in the last window, as `openAt` reads it.\n                    const savedW = Math.floor(saved.element / PLAN_PAGE_SIZE);\n                    const w = openedWindow(snap, savedW);\n                    const ours = (b: number) => block === undefined || b === block;\n                    const first = items.findIndex((it) => {\n                        if (it.kind === \"failed\") return it.failure.w === w && ours(it.failure.block);\n                        if (it.kind !== \"row\") return false;\n                        const o = snap.origin.get(it.row.row.key);\n                        return o !== undefined && o.w === w && ours(o.block);\n                    });\n                    // On its way still; once the jump has settled without an item of the window — its rows all folded\n                    // away — the clamped index, as for a row gone.\n                    if (first < 0 && paging.jumping()) return;\n                    anchor = {\n                        ...anchor,\n                        phase: \"settled\",\n                        restore: first >= 0\n                            ? { index: first, offset: w === savedW ? saved.offset : 0 }\n                            : { index: Math.min(saved.index, items.length - 1), offset: 0 },\n                    };\n                    return;\n                }\n                const at = items.findIndex((it) => bodyItemKey(it) === saved.key);\n                if (at < 0 && value !== undefined && value.rows.type !== \"inline\" && saved.window !== null) {\n                    // A paged canvas may simply not have loaded the row yet:\n                    // open its block at the window it came from before calling\n                    // it gone — a rebase, not a walk.\n                    const block = saved.block ?? undefined;\n                    if (anchor.phase === \"pending\") {\n                        anchor = { ...anchor, phase: \"seeking\" };\n                        paging.openAt(saved.window * PLAN_PAGE_SIZE, block);\n                        return;\n                    }\n                    // On its way still. Once the jump has settled — the window opened for it in and drawn: its last, past\n                    // the end of a source that has shrunk since (#1398), its rows or its failure's band — a row it did not\n                    // bring settles the place on the clamped index, as for a row gone: whatever drew none of it, a source\n                    // with no row left or blocks laid out anew, as the element path settles.\n                    if (paging.jumping()) return;\n                }\n                anchor = {\n                    ...anchor,\n                    phase: \"settled\",\n                    restore: at >= 0\n                        ? { index: at, offset: saved.offset }\n                        : { index: Math.min(saved.index, items.length - 1), offset: 0 },\n                };\n            });\n        },\n        anchorChanged(at, items) {\n            // Nothing is persisted until the saved anchor is restored: the\n            // restore's own scroll must not overwrite what it is restoring.\n            if (anchor.phase !== \"settled\") return;\n            const item = items[at.index];\n            if (item === undefined) return;\n            // Over rows not read — a run, or a failed window's band (#1398) — the element under the view's top, and the\n            // px into its window: a run's key names only its side, which stands for other rows by the time a remount\n            // draws it, and a failed band's names a window that may read by then. The band as these items drew it: the\n            // view's own report at the same rest may have moved the driver's run on already.\n            const band = item.kind === \"band\" ? item.band : item.kind === \"failed\" ? item.failure : undefined;\n            const unread = band === undefined ? undefined : paging.unreadPlace(band, at.offset);\n            const origin = item.kind === \"row\" ? paging.getSnapshot().origin.get(item.row.row.key) : undefined;\n            const next: PlanAnchor = band !== undefined && unread !== undefined\n                ? {\n                    key: bodyItemKey(item),\n                    offset: unread.px,\n                    index: at.index,\n                    window: Math.floor(unread.element / PLAN_PAGE_SIZE),\n                    block: band.block,\n                    element: unread.element,\n                }\n                : {\n                    key: bodyItemKey(item),\n                    offset: at.offset,\n                    index: at.index,\n                    window: origin?.w ?? null,\n                    block: origin?.block ?? null,\n                };\n            if (sameAnchor(persisted.anchor, next)) return;\n            persisted = { ...persisted, anchor: next };\n            options.persist?.(persisted);\n        },\n        connect() {\n            if (!connected) {\n                connected = true;\n                batch(() => {\n                    paging.refresh();\n                    seek.refresh();\n                });\n            }\n            // A bound state is written from outside while the canvas listens\n            // (#824) — and may have been while it did not.\n            const stopUi = options.subscribeUi?.(() => batch(() => syncBound()));\n            // Each move of the canvas's own window — a key, the brush, the date navigator — kept as it lands (#813).\n            const stopWindow = options.windowHold?.subscribe(persistWindow);\n            batch(() => syncBound());\n            return () => {\n                connected = false;\n                stopUi?.();\n                stopWindow?.();\n                paging.disconnect();\n                seek.disconnect();\n            };\n        },\n    };\n}\n\nexport type { PlanPagingSnapshot } from \"./paging.js\";\nexport type { PlanSeekSnapshot } from \"./seek.js\";\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas root's view of the controller's state (#815) — the UI facts it\n * lays the body out from, reconciled against the rows it renders NOW — and\n * the visible rows and derived numbers kept by identity, so a row whose facts\n * did not move keeps its memo.\n *\n * @packageDocumentation\n */\n\nimport { useRef } from \"react\";\nimport { reconciledUi, type PlanReconcileModel, type PlanSnapshot } from \"../controller/index.js\";\nimport type { PlanGrain, RowKey } from \"../plan-state.js\";\nimport { stableDerived, type PlanDerived, type VisibleRow } from \"../model.js\";\n\n/** The UI facts the canvas root lays the body out from. Selection is not one:\n *  each row reads its own (`usePlanRowState`), so a click renders two rows. */\nexport interface PlanUiView {\n    grain: PlanGrain;\n    collapsed: ReadonlySet<RowKey>;\n    chartsExpanded: ReadonlySet<RowKey>;\n    focus: { kind: \"links\" | \"expand\"; key: RowKey } | null;\n}\n\n/**\n * The root's UI view of a snapshot — the store as a reconcile against the\n * rendered rows leaves it. A new value's FIRST render therefore draws with\n * its vanished rows' focus / collapse already gone and its fresh declared\n * collapse already applied, and the controller's `setValue` commits the same\n * transition afterwards without changing what was drawn.\n *\n * @param snap - The controller's snapshot\n * @param model - The rows the canvas renders now\n * @returns The view\n */\nexport function uiViewOf(snap: PlanSnapshot, model: PlanReconcileModel): PlanUiView {\n    const ui = reconciledUi(snap.store, model);\n    return { grain: ui.grain, collapsed: ui.collapsed, chartsExpanded: ui.chartsExpanded, focus: ui.focus };\n}\n\nfunction sameSet(a: ReadonlySet<RowKey>, b: ReadonlySet<RowKey>): boolean {\n    if (a === b) return true;\n    if (a.size !== b.size) return false;\n    for (const k of a) if (!b.has(k)) return false;\n    return true;\n}\n\n/** Two views say the same thing — compared by CONTENT, so a store that moved\n *  to what the view already showed renders nothing. */\nexport function sameUiView(a: PlanUiView, b: PlanUiView): boolean {\n    return a.grain === b.grain\n        && (a.focus === b.focus || (a.focus !== null && b.focus !== null\n            && a.focus.kind === b.focus.kind && a.focus.key === b.focus.key))\n        && sameSet(a.collapsed, b.collapsed)\n        && sameSet(a.chartsExpanded, b.chartsExpanded);\n}\n\n/**\n * The visible rows, each kept by IDENTITY while its row value, depth and\n * collapse are unchanged — so a paged window landing (which re-derives the\n * list) hands every row already on screen the object it had, and its memo\n * holds (#815).\n *\n * @param visible - This render's visible rows\n * @returns The same rows, previous objects reused where nothing moved\n */\nexport function useStableVisible(visible: readonly VisibleRow[]): readonly VisibleRow[] {\n    const prev = useRef<{ from: readonly VisibleRow[]; out: readonly VisibleRow[]; byKey: Map<RowKey, VisibleRow> } | null>(null);\n    const last = prev.current;\n    if (last !== null && last.from === visible) return last.out;\n    const byKey = new Map<RowKey, VisibleRow>();\n    const out = visible.map((v) => {\n        const old = last?.byKey.get(v.row.key);\n        const kept = old !== undefined && old.row === v.row && old.depth === v.depth && old.collapsed === v.collapsed ? old : v;\n        byKey.set(v.row.key, kept);\n        return kept;\n    });\n    prev.current = { from: visible, out, byKey };\n    return out;\n}\n\n/**\n * The derived numbers, each row's entries kept by IDENTITY while their\n * content holds ({@link stableDerived}) — so a re-derivation that moved one\n * row's numbers renders that row, not every row with a derived entry.\n *\n * @param derived - This render's derivation\n * @returns The same numbers, previous entries reused where nothing moved\n */\nexport function useStableDerived(derived: PlanDerived): PlanDerived {\n    const prev = useRef<{ from: PlanDerived; out: PlanDerived } | null>(null);\n    const last = prev.current;\n    if (last !== null && last.from === derived) return last.out;\n    const out = stableDerived(last?.out, derived);\n    prev.current = { from: derived, out };\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * What a viewer hides in the library's Series tab (#1195, `Plan Builder\n * Spec.md` PB29), as the canvas reads it. The ids are the tab's\n * (`planHideId`): the event kinds, the resource kinds and their measures leave\n * the event kinds' rows through the `blocks` seam, and the Plan's own `rows`\n * leave the canvas here — a hand-built row and the rows under it by its key,\n * the one step of its id's path, and a `Plan.over` series' rows, its nested\n * series' with them, by the keys they carry. `data`'s series hide through\n * their pick, in the Reactive that lays them out, the frame keeping what the\n * tab switches of them under the pick's key. An event kind hidden there\n * is no part of what the canvas shows, so it is in none of its figures — the\n * footer's counts, the inspector's — and nothing says so (#1039): hiding it is\n * the viewer's own choice.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport type { PlanLibrarySeriesType } from \"@elaraai/e3-ui/internal\";\nimport type { PlanRowId } from \"../model.js\";\n\n/** The Series tab on the wire, decoded. */\nexport type PlanSeriesTabValue = ValueTypeOf<typeof PlanLibrarySeriesType>;\n\n/** What hiding the Plan's own rows hides on its canvas. */\nexport interface PlanRowsHidden {\n    /** The hand-built rows hidden, by key: each with the rows under it. */\n    readonly rows: ReadonlySet<string>;\n    /** The series whose rows are hidden, by key. */\n    readonly series: ReadonlySet<string>;\n}\n\n/** No id hidden. */\nexport const NONE_HIDDEN: readonly string[] = [];\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * Whether a viewer hides an id of the Series tab: an event kind's, a resource\n * kind's or a measure's (`planHideId`), or one of the Plan's own rows.\n *\n * @param hidden - The ids the viewer hides\n * @param id - The id\n * @returns Whether it is hidden\n */\nexport function hides(hidden: readonly string[], id: string): boolean {\n    return hidden.some((hiddenId) => stringEqual(hiddenId, id));\n}\n\n/**\n * The ids a viewer hides, as storage holds them: a list of ids, or anything\n * else a store held by mistake, which hides none.\n *\n * @param stored - What storage holds\n * @returns The ids hidden\n */\nexport function hiddenOf(stored: unknown): readonly string[] {\n    return Array.isArray(stored) ? stored.filter((id): id is string => typeof id === \"string\") : NONE_HIDDEN;\n}\n\n/**\n * What a viewer's hidden ids hide of the Plan's own rows.\n *\n * @param tab - The Series tab, which says what hiding each of the rows hides\n * @param hidden - The ids the viewer hides\n * @returns The rows hidden; `undefined` when the ids hide none of them\n */\nexport function rowsHiddenOf(tab: PlanSeriesTabValue, hidden: readonly string[]): PlanRowsHidden | undefined {\n    const off = new Set(hidden);\n    const rows = new Set<string>();\n    const series = new Set<string>();\n    for (const line of tab.rows) {\n        if (!off.has(line.item.id)) continue;\n        if (line.hides.type === \"rows\") rows.add(line.hides.value);\n        else for (const key of line.hides.value) series.add(key);\n    }\n    return rows.size === 0 && series.size === 0 ? undefined : { rows, series };\n}\n\n/**\n * Whether a viewer hides a row of the canvas: a hand-built row's — its id's\n * series empty — by its key, else by its series' key.\n *\n * @param hidden - What the viewer hides of the Plan's own rows\n * @param id - The row's id\n * @returns Whether it is hidden\n */\nexport function hidesRow(hidden: PlanRowsHidden, id: PlanRowId): boolean {\n    const at = id.value;\n    if (at.series.length === 0) return at.path.length > 0 && hidden.rows.has(at.path[0]!);\n    return hidden.series.has(at.series);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The Plan's events read by cells, and every other kind counted first (#1039):\n * the Plan's adapter to the shared reader (`shared/schedule/cells.ts`), which\n * reads each event kind placed on a paged resource kind a cell at a time — the\n * events of the resources in view, a level at a time (#1433) — and counts every other kind\n * before one of its events is read, past `SCHEDULE_EVENT_CAP` of them drawing\n * none: its rows shade from its source's summary, or are hatched, the frame's\n * banner saying how many there are. A kind on a paged resource kind is read so\n * or refused (the Plan's tag, `checkedTilings`).\n *\n * The adapter gives the reader what is the Plan's, in the reader's terms: each\n * event kind as the payload carries it — its slot, its name, the rows its\n * shading stands in for (`<slot>.<draw>`, a resource's rows' key), whether its\n * rows book their buckets, its cells' type, its series key and its count — with\n * its source of the slice and what the viewer hides of it, and the event ends\n * the canvas's links name ({@link PlanCellsArgs.links}), which the reader reads\n * by key so a link finds its row; the resource kinds read whole, their rows'\n * keys; the payload's paged seam — its keys a window at a time, its size and the\n * narrowing its windows belong to, 200 resources to a window; the range the\n * canvas reads and its scale's buckets. And it keeps the span store the canvas\n * writes the paged kind's rows in view to as its scroll rests\n * ({@link createCellSpanStore}, {@link cellSpanOf}): the rows its view shows,\n * never the overscan, the span standing while it shows only rows not read\n * ({@link shownCellSpan}); the rows' ids name a resource by the last step of\n * their path.\n *\n * A kind read a window at a time — through its source's interval index, or a\n * day index, one event by its key — gives the reader the stored rows its\n * window's read holds (`stored`, #1599), which the reader keeps as it keeps a\n * kind's cells: the rows' read draws the kind from them, so they stand while\n * they are read again — after a Save, after another session's write — a draft\n * made meanwhile draws at once, and a gesture finds its event's row among them.\n * A kind narrowed through its source draws a draft only of an event those rows\n * hold, or of a new one (`isNew`, #1343), as its window's own read drew them.\n * The canvas's range is a window panned over its rows, no period: what the last\n * range held stands while the next is read.\n *\n * A Save's confirmation reads its events by their keys, never the cells: what\n * it landed of a kind the reader gives cells draws as the Save left it over\n * cells read before the commit, until they are read again — the editing keeps\n * it for the kinds {@link cellKinds} names ({@link PlanCellsArgs.editing}, the\n * shared reader's \"What a Save landed\").\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { PLAN_PAGE_SIZE, planHideId, type PlanPayloadType } from \"@elaraai/e3-ui/internal\";\nimport {\n    useScheduleCells, type ScheduleCellBucket, type ScheduleCellKind, type ScheduleCellPaged, type ScheduleCellResources, type ScheduleCellSpan,\n    type ScheduleCellsRead,\n} from \"../../shared/schedule/cells.js\";\nimport type { ScheduleEditing, ScheduleEventDraftsValue } from \"../../shared/schedule/editing.js\";\nimport { hides } from \"../frame/hidden.js\";\nimport { timeInstant } from \"../instant.js\";\nimport type { PlanRootValue } from \"../model.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanEventPart } from \"./sources.js\";\n\ntype PlanPayloadValue = ValueTypeOf<typeof PlanPayloadType>;\n/** One event kind, as the payload carries it. */\ntype EventKind = PlanPayloadValue[\"events\"][number];\n/** One resource kind, as the payload carries it. */\ntype ResourceKind = PlanPayloadValue[\"resources\"][number];\n/** A paged resource kind's rows, as the payload carries them. */\ntype Paged = Extract<PlanPayloadValue[\"paged\"], { type: \"some\" }>[\"value\"];\n/** The canvas's links. */\ntype Links = PlanRootValue[\"links\"];\n\nconst stringEqual = equalFor(StringType);\n/** Whether two narrowings, as a source names them, are one — none being none (#1344). */\nconst sameNarrowing = (a: string | undefined, b: string | undefined): boolean => (a === undefined || b === undefined ? a === b : stringEqual(a, b));\n\n/**\n * The buckets a range is cut into at a scale's resolution: the range the\n * canvas reads starts and ends on whole periods, the window's and those laid\n * out beyond it.\n *\n * @param scale - The canvas's scale\n * @param from - The range's start\n * @param to - Its end, exclusive\n * @returns The buckets, in order\n */\nexport function bucketsOver(scale: PlanScale, from: Date, to: Date): ScheduleCellBucket[] {\n    const out: ScheduleCellBucket[] = [];\n    for (let at = from.getTime(); at < to.getTime();) {\n        const next = scale.offset(timeInstant(new Date(at)), 1);\n        const end = next.type === \"time\" ? next.value.getTime() : NaN;\n        if (!(end > at)) break;\n        out.push({ start: at, end });\n        at = end;\n    }\n    return out;\n}\n\n/** What {@link usePlanCells} reads over. */\nexport interface PlanCellsArgs {\n    /** The event kinds, as the payload carries them. */\n    readonly kinds: readonly EventKind[];\n    /** The resource kinds, as the payload carries them: a counted kind past the cap shades, or is hatched, over their rows. */\n    readonly resources: readonly ResourceKind[];\n    /** The event kinds narrowed through their sources of the slice, and the parts they read through. */\n    readonly parts: readonly PlanEventPart[];\n    /** The paged resource kind's rows, when a kind pages. */\n    readonly paged: Paged | undefined;\n    /** The canvas's scale: its resolution and its buckets. */\n    readonly scale: PlanScale | undefined;\n    /** The range the canvas reads its events over. */\n    readonly range: { readonly from: Date; readonly to: Date } | undefined;\n    /** Every kind's drafts — the same object while they hold. */\n    readonly drafts: ScheduleEventDraftsValue;\n    /** The ids the viewer hides in the library's Series tab. */\n    readonly hidden: readonly string[];\n    /** The paged kind's rows in view, as the canvas last reported them; `undefined` before it has. */\n    readonly span: ScheduleCellSpan | undefined;\n    /** The canvas's links: an event end the cells do not hold is read by its key. */\n    readonly links: Links;\n    /**\n     * The editing's say of what confirmed Saves landed of the kinds read by their cells ({@link cellKinds}), and how it is\n     * let go: drawn over a kind's cells read before the commit until they are read again — and the row each drafted\n     * event's session began from, which tells a new event from one the record holds; `undefined` for none.\n     */\n    readonly editing?: Pick<ScheduleEditing, \"landed\" | \"shown\" | \"held\" | \"carrying\"> | undefined;\n}\n\n/** Whether a kind's rows draw bars or chips, which shade as the share of each bucket booked. */\nfunction booked(kind: EventKind): boolean {\n    return kind.draw.type === \"span\" || kind.draw.type === \"cards\";\n}\n\n/** The keys' texts of a kind's events the canvas's links name at their ends: an end at no path, its run the event's key. */\nfunction linkEnds(links: Links, slot: string): string[] {\n    const out: string[] = [];\n    for (const link of links) {\n        for (const end of [link.from, link.to]) {\n            if (end.row.type === \"entry\" && end.row.value.path.length === 0 && stringEqual(end.row.value.series, slot)) out.push(end.run);\n        }\n    }\n    return out;\n}\n\n/**\n * The kinds' cells and counts (see the module docs), read in the component\n * that reads the event kinds' rows: what the seams draw the kinds from, every\n * kind's drafts as they take them, what a gesture finds an event's row in, and\n * which counted kinds the canvas reads over the range itself.\n *\n * @param args - What it reads over\n * @returns What the shared reader read\n */\nexport function usePlanCells(args: PlanCellsArgs): ScheduleCellsRead {\n    const { kinds, resources, parts, paged, scale, range, drafts, hidden, span, links, editing } = args;\n    const held = editing?.held;\n    const carrying = editing?.carrying;\n    const cellKindsOf = useMemo((): ScheduleCellKind[] => kinds.map((kind) => ({\n        key: kind.key,\n        name: kind.name,\n        takes: kind.takes,\n        booked: booked(kind),\n        // A resource's rows are keyed `<slot>.<draw>`: the shading stands in for those its kind draws.\n        shadeKey: (slot: string) => `${slot}.${kind.draw.type}`,\n        cellsType: kind.cellsType,\n        seriesKey: kind.seriesKey,\n        // Every kind is counted: a day index's count is an upper bound on its events, never their number.\n        count: kind.count,\n        exact: kind.countExact,\n        part: parts.find((p) => stringEqual(p.kind.key, kind.key))?.part,\n        hidden: hides(hidden, planHideId.events(kind.key)),\n        wanted: linkEnds(links, kind.key),\n        // A kind narrowed through its source draws a draft only of an event its window's read holds — its backlog's among\n        // them — or of a new one (#1343): one its session began from no stored row.\n        isNew: held !== undefined && parts.some((p) => stringEqual(p.kind.key, kind.key)) ? (id: string) => held(kind.key, id) === undefined : undefined,\n        // And of one it last drew, while the kind's session has yet to judge its drafts where its record reads now (#1599):\n        // another planner's removal of a job drafted here never takes it off the canvas before the session has read it.\n        carrying: carrying === undefined ? undefined : () => carrying(kind.key),\n        // A kind read a window at a time gives the reader the rows its window's read holds to keep standing (#1599), and —\n        // no source narrowing it — the revision its record reads at.\n        stored: kind.entries.type === \"some\" ? kind.stored : undefined,\n        revision: kind.entries.type === \"some\" ? kind.entries.value.revision : undefined,\n    })), [kinds, parts, hidden, links, held, carrying]);\n    const whole = useMemo((): ScheduleCellResources[] => resources.map((kind) => ({ key: kind.key, keys: kind.rows.map((row) => row.key) })), [resources]);\n    const pagedKind = useMemo((): ScheduleCellPaged | undefined => (paged === undefined ? undefined : {\n        kind: paged.kind,\n        window: PLAN_PAGE_SIZE,\n        hidden: hides(hidden, planHideId.resources(paged.kind)),\n        keys: (offset, limit) => paged.keys(offset, limit),\n        total: () => paged.total(),\n        narrowing: () => (paged.query.type === \"some\" ? paged.query.value() : undefined),\n    }), [paged, hidden]);\n    const from = range?.from.getTime();\n    const to = range?.to.getTime();\n    const over = useMemo(() => (from === undefined || to === undefined ? undefined : { from: new Date(from), to: new Date(to) }), [from, to]);\n    const buckets = useMemo(() => (scale === undefined || over === undefined ? undefined : bucketsOver(scale, over.from, over.to)), [scale, over]);\n    return useScheduleCells({\n        host: \"Plan\", kinds: cellKindsOf, resources: whole, paged: pagedKind, range: over, buckets, resolution: scale?.resolution, drafts, span,\n        landed: editing?.landed, shown: editing?.shown,\n    });\n}\n\n/**\n * The kinds the reader may give cells: every kind read a window at a time, one\n * event by its key — by its series index's cells, placed on the paged resource\n * kind, or its window's own rows (#1599).\n *\n * @param kinds - The event kinds, as the payload carries them\n * @returns The slots of such kinds\n */\nexport function cellKinds(kinds: readonly EventKind[]): string[] {\n    return kinds.filter((kind) => kind.entries.type === \"some\").map((kind) => kind.key);\n}\n\n/**\n * The kinds a Plan reads by their series index's cells: those whose sources\n * list a series index of their records — each placed on the paged resource\n * kind alone, as the Plan holds a series index to.\n *\n * @param parts - The event kinds narrowed through their sources\n * @returns The slots of such kinds\n */\nexport function seriesKinds(parts: readonly PlanEventPart[]): string[] {\n    return parts.filter(({ part }) => part.config.indexes.some((index) => index.series.type === \"some\")).map(({ kind }) => kind.key);\n}\n\n/** Where the paged kind's rows in view are, as the canvas reports them to its cells' reader: a store of one span. */\nexport interface PlanCellSpanStore {\n    /** The span last reported; `undefined` before any is. */\n    get(): ScheduleCellSpan | undefined;\n    /** Reports the rows in view: a span the store holds already moves nothing. */\n    set(span: ScheduleCellSpan | undefined): void;\n    /** Listens for a span that moves; returns the unsubscribe. */\n    subscribe(listener: () => void): () => void;\n}\n\n/**\n * A store of the paged kind's rows in view (#1039): the canvas writes it as\n * its scroll comes to rest, and the cells' reader, a component of its own,\n * reads it — the canvas renders nothing for it.\n *\n * @returns The store\n */\nexport function createCellSpanStore(): PlanCellSpanStore {\n    let span: ScheduleCellSpan | undefined;\n    const listeners = new Set<() => void>();\n    const same = (a: ScheduleCellSpan[\"first\"], b: ScheduleCellSpan[\"first\"]) => a.w === b.w && stringEqual(a.key, b.key);\n    return {\n        get: () => span,\n        set(next) {\n            if (next === span || (next !== undefined && span !== undefined && same(next.first, span.first) && same(next.last, span.last)\n                && sameNarrowing(next.narrowing, span.narrowing))) return;\n            span = next;\n            for (const listener of [...listeners]) listener();\n        },\n        subscribe(listener) {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n    };\n}\n\n/**\n * The paged kind's rows in view among the canvas's items: the first and the\n * last row a paged window placed, each by its window and its resource's key\n * — the last step of its path — under the narrowing their windows are.\n *\n * @param items - The rows in view, in order: each its key and its id\n * @param origin - Which window each paged row came from\n * @param narrowing - The narrowing the windows belong to, as the source names it (#1344); `undefined` for one it names none of\n * @returns The span; `undefined` when no paged row is in view\n */\nexport function cellSpanOf(\n    items: readonly { readonly key: string; readonly path: readonly string[] }[], origin: ReadonlyMap<string, { readonly w: number }>,\n    narrowing: string | undefined,\n): ScheduleCellSpan | undefined {\n    let first: ScheduleCellSpan[\"first\"] | undefined;\n    let last: ScheduleCellSpan[\"first\"] | undefined;\n    for (const { key, path } of items) {\n        const at = origin.get(key);\n        const resource = path[path.length - 1];\n        if (at === undefined || resource === undefined) continue;\n        const here = { w: at.w, key: resource };\n        first ??= here;\n        last = here;\n    }\n    return first === undefined || last === undefined ? undefined : { first, last, narrowing };\n}\n\n/**\n * What the canvas reports to its cells' reader as its scroll rests (#1039):\n * the span of the paged rows the view shows — never the overscan mounted\n * beside them, which beside a run not read yet that the view rests in is the\n * last rows read, however far off. A view that shows such a run and no paged\n * row says nothing of where the rows in view are: the span standing stays —\n * never the opening's first block, a view away — and the run's rows report\n * their own once they are drawn.\n *\n * @param rows - The rows the view shows, in order: each its key and its id's path\n * @param unread - Whether the view shows a run of rows not read yet, or a window whose read failed\n * @param standing - The span reported last\n * @param origin - Which window each paged row came from\n * @param narrowing - The narrowing the windows belong to, as the source names it (#1344)\n * @returns The span to report; `standing` while the view shows rows not read alone\n */\nexport function shownCellSpan(\n    rows: readonly { readonly key: string; readonly path: readonly string[] }[], unread: boolean, standing: ScheduleCellSpan | undefined,\n    origin: ReadonlyMap<string, { readonly w: number }>, narrowing: string | undefined,\n): ScheduleCellSpan | undefined {\n    const span = cellSpanOf(rows, origin, narrowing);\n    return span === undefined && unread ? standing : span;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The event kinds' rows on the canvas (#1192): a Plan of event kinds draws its\n * resources' rows — read through the payload's `blocks` over the range the\n * canvas draws — ahead of every other row, as fixed blocks.\n *\n * # Read where the canvas draws\n *\n * The rows are read over the scale's window and the periods it lays out\n * beyond each edge (#619), so a pan reveals the events there, with every\n * kind's drafts in place (#1194), so a draft draws as Save would leave it. The\n * read is a tracked evaluation: the records it reads are listened to, and a\n * commit to one reads the rows again, as a new draft does. A read whose kinds are still in flight leaves the\n * last rows standing; one that throws leaves them too, and says why — and\n * which kinds' own events it could not read, each kind read alone in the read\n * that failed (#1398): what the footer's line names the failure by, and what\n * its Retry asks again. A kind read a window at a time is read by the shared\n * reader (#1599), which keeps its window's rows standing while they are read\n * again and names the kind whose window it could not read: said the same way.\n * The rows\n * move only when they differ, so a write that changes none of them redraws\n * nothing. A resource kind the rail narrows draws the resources its source\n * shows (#1344).\n *\n * The read runs in a component of its own, {@link PlanEventsReader}, which\n * hands the canvas its rows only when they move: a kind narrowed through an\n * interval index lands some fifty-five key searches a window, and each would\n * otherwise render the whole canvas (#1343, #1344).\n *\n * # Ahead of every other row\n *\n * Inline, the rows lead the canvas's blocks. Paged, they ride the source's\n * windows: ONE wrapper per source (a host function is equivalent only to\n * itself, so a new wrapper would drop the driver's windows) serves them ahead\n * of every window's blocks, and names a new revision when they move, so the\n * driver reads its windows again and keeps the rows it has standing in until\n * they land (#821). Until the first read answers, as many empty fixed blocks\n * stand in for them, so the canvas's blocks are laid out alike from the\n * first window. The wrapper names the snapshot of the source's own data apart\n * from that revision (`snapshot`, #1199): new rows over the same data read the\n * windows again and are no new snapshot of it, so a key search standing stays\n * where it is.\n *\n * # A paged resource kind (#1199)\n *\n * A resource kind with a `window` pages the canvas over its resources, as a\n * paged `data` does (PB55): the canvas's source is ONE wrapper over the\n * payload's `paged`, its size and key search the kind's window's, and each of\n * its windows the event kinds' blocks with the kind's place — the one block\n * that is not fixed — filled by that window of its resources, the events\n * placed on them, and the root's own rows after, fixed. The events placed on\n * the kind's resources are read with the rest of the rows, so they move the\n * same version, and a new version, a new set of what the viewer hides or new\n * rows of the root's are a new revision: the driver reads its windows again,\n * the rows it has standing in until they land — over the same snapshot of the\n * kind's resources, which only their window's own revision moves. Until the\n * events are placed, a window is in flight. A canvas pages one source, so\n * `data` beside a paged kind is inline (the Plan refuses it paged).\n *\n * A paged kind its source of the slice narrows (#1344) is paged from the\n * narrowing's rows themselves: the wrapper is a live source, as the rail's\n * `rows` source is, naming the narrowing its windows belong to (`query`), so a\n * choice is a new result — the view the last narrowing drew stands in until\n * the new one's first window lands — and the snapshot of its resources is\n * their revision and the narrowing together. It has no key search.\n *\n * # A link's event end\n *\n * A link may name an event (`Plan.eventRef(kind, key)`): a run ref at the\n * kind's slot with no path, whose run is the event's key. The canvas finds the\n * event's element where it draws — its key is the event's ref as East prints\n * it — and names that row and element instead, so the links focus gathers the\n * row and a ribbon meets the element. An event on a paged kind's resource is\n * named by its resource's row id, `entry { series: \"<slot>.<draw>\", path:\n * [key] }`, from the events placed on the kind's resources — never looked for\n * in a window (#1199): the row is the one the window holding that resource\n * draws, whether or not it has landed. An event the rows do not draw keeps its\n * end, which no row has, and its ribbon is not drawn.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from \"react\";\nimport {\n    SortedMap, StringType, compareFor, equalFor, equivalentFor, none, printFor, some, variant, type ValueTypeOf,\n} from \"@elaraai/east\";\nimport {\n    Plan, PlanEventBlocksType, PlanEventDraftsType, PlanEventPagedType, PlanEventPlacedType, PlanEventReadsType, PlanEventShadingType,\n    PlanEventShownType, ScheduleEventRefType, planHideId,\n} from \"@elaraai/e3-ui/internal\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { snapshotOf, windowedSourceOf, type WindowedSourceValue } from \"@elaraai/east-ui-components/internal\";\nimport { OVERSCAN_BUCKETS } from \"../../shared/time/scale.js\";\nimport { hides } from \"../frame/hidden.js\";\nimport type { PlanLinkValue, PlanRootValue, PlanRowId, PlanWireBlock, PlanWireRow } from \"../model.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport { windowedArm, type PlanPagedSourceValue } from \"../use-plan-paging.js\";\nimport type { ScheduleCellsRead } from \"../../shared/schedule/cells.js\";\nimport { usePlanCells, type PlanCellSpanStore, type PlanCellsArgs } from \"./cells.js\";\n\n/** The payload's `blocks` seam, decoded: the resources' rows over a window, every kind's drafts in place. */\nexport type PlanEventBlocksValue = ValueTypeOf<typeof PlanEventBlocksType>;\n\n/** The payload's `paged` seam, decoded: a paged resource kind's rows, a window of its resources at a time (#1199). */\nexport type PlanEventPagedValue = ValueTypeOf<typeof PlanEventPagedType>;\n\n/** The events placed on a paged resource kind's resources, by way of drawing and by the resource's key (#1199). */\nexport type PlanEventPlacedValue = ValueTypeOf<typeof PlanEventPlacedType>;\n\n/** The resources the rail shows (#1344): by a resource kind's slot, the keys of those its source shows. */\nexport type PlanEventShownValue = ValueTypeOf<typeof PlanEventShownType>;\n\n/** What a Plan of event kinds hands its canvas (#1192). */\nexport interface PlanEventRows {\n    /** The resources' rows over a window — the payload's `blocks`. */\n    blocks: PlanEventBlocksValue;\n    /** How many blocks it answers: one per resource kind, then the Unassigned rows'. */\n    count: number;\n    /** A paged resource kind's rows, a window of its resources at a time — the payload's `paged` (#1199); none when no kind pages. */\n    paged?: PlanEventPagedValue | undefined;\n}\n\n/** The event kinds' rows as the canvas draws them now. */\nexport interface PlanEventLead {\n    /** The blocks, laid out first — empty fixed blocks until the first read answers. */\n    blocks: readonly PlanWireBlock[];\n    /** The events placed on a paged kind's resources (#1199): what each of its windows draws — `undefined` until the\n     *  first read answers, and for a Plan whose kinds page none. */\n    placed: PlanEventPlacedValue | undefined;\n    /** The resources' shading (#1039): what a paged kind's windows draw in place of its events past the budget. */\n    shading: PlanEventShadingValue;\n    /** The kinds' cells and counts (#1039): what a kind read by them draws from, every kind's drafts as the seams take\n     *  them, the rows each kind's cells hold, and the counted kinds read over the range; `undefined` before the reader\n     *  hands them on — every kind is counted, so a Plan of event kinds has them once it has read. */\n    cells: ScheduleCellsRead | undefined;\n    /** Moves each time the blocks do, or the events placed on a paged kind's resources, or its shading, or what the\n     *  viewer hides of a paged kind — from 0 before the first read answers — a paged canvas reads its windows again then. */\n    version: number;\n    /** The last read's failure, when it failed: why, and the kinds whose own events it could not read (#1398). */\n    error: PlanEventFailure | undefined;\n}\n\n/**\n * A read of the event kinds' rows that failed (#1398): why, and the kinds whose\n * own events over the range it could not read — what the footer's loading line\n * names the failure by, and what its Retry asks again; none where the failure\n * was no kind's own events' — a resource's row's, a measure's.\n */\nexport interface PlanEventFailure {\n    /** Why it failed, in the read's own words. */\n    readonly reason: string;\n    /** The slots of the kinds whose own events could not be read, in the kinds' order. */\n    readonly kinds: readonly string[];\n}\n\n/** One read of the event kinds' rows: their blocks, and the events placed on a paged kind's resources. */\ninterface LeadRead {\n    blocks: ValueTypeOf<typeof Plan.Types.Blocks>;\n    placed: PlanEventPlacedValue | undefined;\n}\n\n/** The resources' shading (#1039), decoded. */\nexport type PlanEventShadingValue = ValueTypeOf<typeof PlanEventShadingType>;\n\n/** No drafts: a Plan whose event kinds hold none. */\nconst NO_DRAFTS: ValueTypeOf<typeof PlanEventDraftsType> = new SortedMap([], compareFor(StringType));\n/** No kind read by its cells (#1039): each is read over the window. */\nconst NO_READS: ValueTypeOf<typeof PlanEventReadsType> = new SortedMap([], compareFor(StringType));\n/** No shading (#1039): each resource's rows draw their events. */\nconst NO_SHADING: ValueTypeOf<typeof PlanEventShadingType> = new SortedMap([], compareFor(StringType));\n/** The rail narrows no resource kind: each draws every resource. */\nexport const ALL_SHOWN: PlanEventShownValue = new SortedMap([], compareFor(StringType));\n/** Nothing hidden: every kind, resource kind and measure draws. */\nconst NONE_HIDDEN: readonly string[] = [];\nconst blocksEqual = equalFor(Plan.Types.Blocks);\nconst placedEqual = equalFor(PlanEventPlacedType);\nconst shadingEqual = equalFor(PlanEventShadingType);\n/** A windowed source as the canvas composes over it: one that may say how it draws a window standing in (#1599). */\nconst under = (source: WindowedSourceValue<PlanRootValue[\"rows\"]> | undefined): PlanPagedSourceValue | undefined => source;\n\n/** Whether two paged sources derive the same rows — the paging driver's test (#809). */\nconst pagedSourceEquivalent = equivalentFor(Plan.Types.Root.fields.rows.cases.paged);\n/** Whether two paged kinds' seams read the same rows: their functions by their IR and what they capture (#809). */\nconst pagedSeamEquivalent = equivalentFor(PlanEventPagedType);\n/** An element's key: its event, as East prints a `Schedule.Types.EventRef`. */\nconst printEventRef = printFor(ScheduleEventRefType);\n\n/** A `time` instant's epoch ms; `undefined` for an instant of another arm. */\nfunction timeMs(t: PlanInstantValue): number | undefined {\n    return t.type === \"time\" ? t.value.getTime() : undefined;\n}\n\n/** `count` empty fixed blocks — what stands in for the rows until they are read. */\nfunction emptyBlocks(count: number): readonly PlanWireBlock[] {\n    return Array.from({ length: count }, (): PlanWireBlock => ({ fixed: true, parent: none, charts: none, rows: [] }));\n}\n\n/** The event kinds, as the payload carries them. */\ntype PlanEventKinds = PlanCellsArgs[\"kinds\"];\n/** One kind's drafts, by entry id, as its seams take them. */\ntype KindDrafts = Parameters<PlanEventKinds[number][\"planItems\"]>[2];\n/** No drafts of a kind. */\nconst NO_KIND_DRAFTS: KindDrafts = new SortedMap([], compareFor(StringType));\n/** No kind's own events failed: the failure was a resource's row's, or a measure's. */\nconst NO_KINDS_FAILED: readonly string[] = [];\n/** No event kinds: a reader given none names no kind a failure is of. */\nconst NO_EVENT_KINDS: PlanEventKinds = [];\nconst slotEqual = equalFor(StringType);\n\n/**\n * What a read of the event kinds' rows throws when it fails (#1398): what it\n * threw, and the kinds whose own events over the range could not be read.\n */\nclass EventRowsFailure extends Error {\n    /**\n     * @param thrown - What the read threw\n     * @param kinds - The slots of the kinds whose own events could not be read\n     */\n    constructor(readonly thrown: unknown, readonly kinds: readonly string[]) {\n        super(thrown instanceof Error ? thrown.message : String(thrown));\n        this.name = \"EventRowsFailure\";\n    }\n}\n\n/**\n * The kinds whose own events over a range could not be read (#1398): each the\n * rows' read reads — every kind the viewer shows — read alone, as that read\n * reads it, its drafts in place and its cells given. Called in the read that\n * failed, it reads what that read holds: a kind's events it read answer from\n * what it holds, a window that failed throws as it did, and a kind it did not\n * reach, past the one that threw, asks e3 what that read would have asked.\n *\n * @param kinds - The event kinds\n * @param from - The range's start\n * @param to - Its end, exclusive\n * @param drafts - Every kind's drafts, as the seams take them\n * @param hidden - The ids the viewer hides in the Series tab: a kind hidden there is not read\n * @param reads - Each kind read by its cells, what they hold\n * @returns The slots of the kinds whose own read throws, in the kinds' order\n */\nfunction failedKinds(kinds: PlanEventKinds, from: Date, to: Date, drafts: ValueTypeOf<typeof PlanEventDraftsType>,\n    hidden: readonly string[], reads: ValueTypeOf<typeof PlanEventReadsType>): string[] {\n    const out: string[] = [];\n    for (const kind of kinds) {\n        if (hides(hidden, planHideId.events(kind.key))) continue;\n        const held = reads.get(kind.key);\n        try {\n            kind.planItems(from, to, drafts.get(kind.key) ?? NO_KIND_DRAFTS, held === undefined ? none : some(held));\n        } catch {\n            out.push(kind.key);\n        }\n    }\n    return out;\n}\n\n/** Whether two failures name the same kinds, in the same order. */\nfunction sameKinds(a: readonly string[], b: readonly string[]): boolean {\n    return a.length === b.length && a.every((slot, i) => slotEqual(slot, b[i]!));\n}\n\n/** The range the canvas reads its event kinds' rows over. */\nexport interface PlanEventRange {\n    /** Its start: the scale's window less the periods laid out before it. */\n    readonly from: Date;\n    /** Its end, exclusive: the window and the periods laid out after it. */\n    readonly to: Date;\n}\n\n/**\n * The range the canvas reads its event kinds' rows over (#619): the scale's\n * window and the periods it lays out beyond each edge. A kind read a window\n * at a time (#1199) holds there every event the canvas draws, so a gesture on\n * one reads it from what the windows hold, with no read of its own.\n *\n * @param scale - The shared scale\n * @returns The range; `undefined` with no scale, or one whose instants are not times\n */\nexport function eventReadRange(scale: PlanScale | undefined): PlanEventRange | undefined {\n    if (scale === undefined) return undefined;\n    const from = timeMs(scale.offset(scale.window.min, -OVERSCAN_BUCKETS));\n    const to = timeMs(scale.offset(scale.window.max, OVERSCAN_BUCKETS));\n    return from === undefined || to === undefined ? undefined : { from: new Date(from), to: new Date(to) };\n}\n\n/**\n * The event kinds' rows over the range the canvas draws: the scale's window\n * and the periods laid out beyond each edge, what the viewer hides left out,\n * every kind's drafts in place (#1194, PB17) — and, beside a paged resource\n * kind, the events placed on its resources, read with them (#1199); a kind\n * read by its cells drawn from what they hold, a kind counted past the cap\n * drawn from none, and the resources' shading in their place (#1039).\n *\n * @param events - The Plan's event rows, when it has event kinds\n * @param scale - The shared scale — a time scale, beside event kinds\n * @param hidden - The ids the viewer hides in the library's Series tab (#1195)\n * @param drafts - Every kind's drafts, by kind then by entry id — the same object while they hold\n * @param shown - The resources the rail shows, by resource kind (#1344) — the same object while they hold\n * @param cells - The kinds' cells and counts, when the reader decides a kind (#1039): each kind's cells it gives — none past the cap — every kind's drafts as the seams take them, the shading\n * @param kinds - The event kinds, as the payload carries them: a read that fails names those whose own events it could not read (#1398)\n * @returns The rows as the canvas draws them now\n */\nexport function usePlanEventBlocks(\n    events: PlanEventRows | undefined, scale: PlanScale | undefined, hidden: readonly string[] = NONE_HIDDEN,\n    drafts: ValueTypeOf<typeof PlanEventDraftsType> = NO_DRAFTS, shown: PlanEventShownValue = ALL_SHOWN, cells?: ScheduleCellsRead | undefined,\n    kinds: PlanEventKinds = NO_EVENT_KINDS,\n): PlanEventLead {\n    const blocks = events?.blocks;\n    const paged = events?.paged;\n    const count = events?.count ?? 0;\n    const range = eventReadRange(scale);\n    const from = range?.from.getTime();\n    const to = range?.to.getTime();\n    const reads = cells?.reads ?? NO_READS;\n    const shading = cells?.shading ?? NO_SHADING;\n    const seamDrafts = cells?.drafts ?? drafts;\n    // One read: the rows, and a paged kind's events with them — `undefined` while either is in flight. One that fails\n    // names the kinds whose own events it could not read, each read alone in it (#1398).\n    const read = useCallback((): LeadRead | undefined => {\n        if (blocks === undefined || from === undefined || to === undefined) return undefined;\n        try {\n            const rows = blocks(new Date(from), new Date(to), seamDrafts, [...hidden], shown, reads, shading);\n            if (rows.type !== \"some\") return undefined;\n            if (paged === undefined) return { blocks: rows.value, placed: undefined };\n            const placed = paged.placed(new Date(from), new Date(to), seamDrafts, [...hidden], reads);\n            return placed.type === \"some\" ? { blocks: rows.value, placed: placed.value } : undefined;\n        } catch (thrown) {\n            throw new EventRowsFailure(thrown, failedKinds(kinds, new Date(from), new Date(to), seamDrafts, hidden, reads));\n        }\n    }, [blocks, paged, from, to, hidden, seamDrafts, shown, reads, shading, kinds]);\n    const { result } = useTrackedEvaluation(read);\n    const empty = useMemo(() => emptyBlocks(count), [count]);\n    // The last rows read, held while a read is in flight or failed: kept by\n    // identity while a new read holds the same rows.\n    const held = useRef<{\n        blocks: LeadRead[\"blocks\"] | undefined; placed: PlanEventPlacedValue | undefined; shading: PlanEventShadingValue; hidden: readonly string[];\n        version: number;\n    }>({ blocks: undefined, placed: undefined, shading: NO_SHADING, hidden: NONE_HIDDEN, version: 0 });\n    // The last failure, kept by identity while a read fails the same way — its words and its kinds — so the reader hands\n    // the canvas nothing new for it.\n    const failed = useRef<PlanEventFailure | undefined>(undefined);\n    // A kind's window the reader could not read (#1599): the reader reads each kind read a window at a time, and names\n    // the kind whose window's read threw — said as the rows' own failure is, on the footer's line, with its Retry.\n    const cellsFailure = cells?.error?.window === true ? cells.error : undefined;\n    const error = useMemo((): PlanEventFailure | undefined => {\n        if (result.ok && cellsFailure === undefined) return undefined;\n        let next: PlanEventFailure;\n        if (result.ok) {\n            next = { reason: cellsFailure!.reason, kinds: cellsFailure!.kinds };\n        } else {\n            const failure = result.error instanceof EventRowsFailure ? result.error : undefined;\n            const thrown = failure?.thrown ?? result.error;\n            console.error(\"[Plan] the event kinds' rows could not be read:\", thrown);\n            next = {\n                reason: thrown instanceof Error ? thrown.message : String(thrown),\n                kinds: failure?.kinds ?? NO_KINDS_FAILED,\n            };\n        }\n        const was = failed.current;\n        if (was !== undefined && was.reason === next.reason && sameKinds(was.kinds, next.kinds)) return was;\n        failed.current = next;\n        return next;\n    }, [result, cellsFailure]);\n    const now = useMemo(() => {\n        const previous = held.current;\n        if (!result.ok || result.value === undefined) return previous;\n        const next = result.value;\n        const same = previous.blocks !== undefined && blocksEqual(previous.blocks, next.blocks)\n            && (previous.placed === undefined || next.placed === undefined ? previous.placed === next.placed : placedEqual(previous.placed, next.placed))\n            // A paged kind's shading draws in its windows (#1039), and so does what the viewer hides of it: a new one reads them again.\n            && (paged === undefined || (shadingEqual(previous.shading, shading) && previous.hidden === hidden));\n        if (same) return previous;\n        held.current = { blocks: next.blocks, placed: next.placed, shading, hidden, version: previous.version + 1 };\n        return held.current;\n    }, [result, paged, hidden, shading]);\n    return useMemo(() => ({ blocks: now.blocks ?? empty, placed: now.placed, shading: now.shading, cells, version: now.version, error }),\n        [now, empty, cells, error]);\n}\n\n/**\n * The event kinds' rows before their first read: as many empty fixed blocks as\n * the read answers, so the canvas's blocks are laid out alike from the first\n * window.\n *\n * @param events - The Plan's event rows, when it has event kinds\n * @returns The rows to stand in\n */\nexport function initialEventLead(events: PlanEventRows | undefined): PlanEventLead {\n    return { blocks: emptyBlocks(events?.count ?? 0), placed: undefined, shading: NO_SHADING, cells: undefined, version: 0, error: undefined };\n}\n\n/** Props of {@link PlanEventsReader}. */\nexport interface PlanEventsReaderProps {\n    /** The Plan's event rows, when it has event kinds. */\n    events: PlanEventRows | undefined;\n    /** The shared scale. */\n    scale: PlanScale | undefined;\n    /** The ids the viewer hides in the library's Series tab. */\n    hidden: readonly string[] | undefined;\n    /** Every kind's drafts. */\n    drafts: ValueTypeOf<typeof PlanEventDraftsType>;\n    /** The resources the rail shows, by resource kind. */\n    shown: PlanEventShownValue;\n    /** The event kinds, as the payload carries them (#1039): a kind read by its cells is read through its part. */\n    kinds: PlanCellsArgs[\"kinds\"];\n    /** The resource kinds, as the payload carries them: a kind read whole shades over their rows. */\n    resources: PlanCellsArgs[\"resources\"];\n    /** The event kinds narrowed through their sources of the slice, and their parts. */\n    parts: PlanCellsArgs[\"parts\"];\n    /** The canvas's links: an event end its kind's cells do not hold is read by its key. */\n    links: PlanCellsArgs[\"links\"];\n    /** The paged kind's rows in view, as the canvas reports them. */\n    spans: PlanCellSpanStore;\n    /** What confirmed Saves landed of the kinds read by their cells, and how it is let go: drawn until the cells are read again. */\n    editing: PlanCellsArgs[\"editing\"];\n    /** Where the rows go: called only when they move. */\n    onLead: (lead: PlanEventLead) => void;\n}\n\n/**\n * The event kinds' rows, read in a component of its own (#1343, #1344): each\n * search that lands re-runs it alone, and it hands the canvas its rows only\n * when they move — a kind narrowed through an interval index lands some\n * fifty-five searches before its window is read, and each would otherwise\n * render the whole canvas. A kind read by its cells (#1039) is read here too,\n * every cell it wants in one request a read, and every other kind counted\n * before one of its events is read; the rows the canvas reports in view are\n * read here alone. What a Save landed of a kind read by its cells draws as the\n * Save left it until they are read again: its confirmation reads its events by\n * their keys, never the cells.\n *\n * @param props - What the rows are read over, and where they go\n * @returns Nothing: it reads\n */\nexport function PlanEventsReader({ events, scale, hidden, drafts, shown, kinds, resources, parts, links, spans, editing, onLead }: PlanEventsReaderProps): null {\n    const span = useSyncExternalStore(spans.subscribe, spans.get);\n    const range = eventReadRange(scale);\n    // The reader decides every kind (#1039): one it reads by its cells, and every other, counted before one of its events is read.\n    const cells = usePlanCells({\n        kinds, resources, parts, paged: events?.paged, scale, range, drafts, hidden: hidden ?? NONE_HIDDEN, span, links, editing,\n    });\n    const lead = usePlanEventBlocks(events, scale, hidden, drafts, shown, cells, kinds);\n    // What the canvas holds: its stand-in rows until the first read lands.\n    const reported = useRef<{ version: number; error: PlanEventFailure | undefined; cells: ScheduleCellsRead | undefined }>({ version: 0, error: undefined, cells: undefined });\n    useLayoutEffect(() => {\n        // The same rows, in the same state — each move of them moves the version, and a failure is the same object while it\n        // fails the same way — and the same cells: nothing the canvas draws has moved.\n        const was = reported.current;\n        if (was.version === lead.version && was.error === lead.error && was.cells === lead.cells) return;\n        reported.current = { version: lead.version, error: lead.error, cells: lead.cells };\n        onLead(lead);\n    });\n    return null;\n}\n\n/** A block that every window serves alike, drawn once — no entry of the paged kind's makes it, so it says nothing of\n *  what one makes (#1398). */\nfunction fixedBlock(block: PlanWireBlock): PlanWireBlock {\n    return block.fixed ? block : { ...block, fixed: true, charts: none };\n}\n\n/**\n * A paged kind's narrowing as its source names it now (#1344): what its\n * windows are read under; the empty text for a kind no source narrows.\n *\n * @param pages - The paged kind's rows, when a kind pages\n * @returns The narrowing, as text\n */\nfunction narrowingOf(pages: PlanEventPagedValue | undefined): string {\n    return pages !== undefined && pages.query.type === \"some\" ? pages.query.value() : \"\";\n}\n\n/**\n * The root with the event kinds' rows ahead of its own, and its links' event\n * ends named where the events draw — over a paged resource kind's windows\n * when a kind pages (#1199, see the module docs).\n *\n * @param value - The latest root\n * @param data - Its data-stable twin\n * @param lead - The event kinds' rows; `undefined` for a Plan with none\n * @param pagedKind - A paged resource kind's rows, when a kind pages\n * @param hidden - The ids the viewer hides in the library's Series tab: what a paged kind's windows leave out\n * @returns The two roots the canvas draws, and the version of a paged kind's windows — it moves when they are\n *   to be read again (0 when no kind pages)\n */\nexport function usePlanEventRoot(\n    value: PlanRootValue, data: PlanRootValue, lead: PlanEventLead | undefined,\n    pagedKind?: PlanEventPagedValue | undefined, hidden: readonly string[] = NONE_HIDDEN,\n): { value: PlanRootValue; data: PlanRootValue; version: number } {\n    const blocks = lead?.blocks;\n    const pages = lead !== undefined ? pagedKind : undefined;\n    // Inline: the rows lead the blocks — one array for both roots, whose rows\n    // hold the same data.\n    const inline = useMemo(\n        () => (pages === undefined && blocks !== undefined && data.rows.type === \"inline\" ? [...blocks, ...data.rows.value] : undefined),\n        [pages, blocks, data.rows]);\n    // Paged: one wrapper per source, reading the latest source and rows.\n    const paged = lead !== undefined ? windowedSourceOf(value.rows) : undefined;\n    const latest = useRef({ src: paged, lead });\n    latest.current = { src: paged, lead };\n    const wrapperOf = useRef<{ src: PlanPagedSourceValue; wrapped: PlanPagedSourceValue } | undefined>(undefined);\n    const wrapped = useMemo((): PlanPagedSourceValue | undefined => {\n        if (paged === undefined) return undefined;\n        const prior = wrapperOf.current;\n        if (prior !== undefined && pagedSourceEquivalent(prior.src, paged)) return prior.wrapped;\n        const next: PlanPagedSourceValue = {\n            id: paged.id,\n            page: (offset, limit) => {\n                const l = latest.current;\n                if (l.src === undefined || l.lead === undefined) return none;\n                const read = l.src.page(offset, limit);\n                // The window's own entries stay beside its blocks: the event kinds' rows are none of its source's.\n                return read.type === \"some\" ? some({ rows: [...l.lead.blocks, ...read.value.rows], entries: read.value.entries }) : read;\n            },\n            total: () => latest.current.src?.total() ?? none,\n            // New rows are a new revision: the driver reads its windows again,\n            // the rows it has standing in until they land.\n            revision: () => {\n                const l = latest.current;\n                const r = l.src?.revision?.() ?? none;\n                return some(`${r.type === \"some\" ? r.value : \"\"}#events-${l.lead?.version ?? 0}`);\n            },\n            // A window standing in is drawn as it is composed now: the event kinds' rows over the data's own (#1599) —\n            // where the source under this one, the canvas's editing's, says how it draws one.\n            ...(under(paged)?.redraft === undefined || under(paged)?.redrafted === undefined ? {} : {\n                redraft: (entries: Parameters<NonNullable<PlanPagedSourceValue[\"redraft\"]>>[0]) => {\n                    const l = latest.current;\n                    const own = under(l.src)?.redraft?.(entries);\n                    return own === undefined || l.lead === undefined ? undefined : [...l.lead.blocks, ...own];\n                },\n                redrafted: () => `${under(latest.current.src)?.redrafted?.() ?? \"\"}#events-${latest.current.lead?.version ?? 0}`,\n            }),\n            refresh: (revision) => latest.current.src?.refresh?.(revision) ?? null,\n            seek: paged.seek.type === \"some\"\n                ? some((query) => {\n                    const s = latest.current.src?.seek;\n                    return s !== undefined && s.type === \"some\" ? s.value(query) : none;\n                })\n                : none,\n            // The snapshot of `data` itself (#1199): its own revision — and a live source's narrowing with it, whose\n            // rows a key search's answer names (#1354) — which new rows over it leave.\n            snapshot: () => {\n                const src = latest.current.src;\n                return src === undefined ? none : snapshotOf(src) ?? none;\n            },\n            // A live source's narrowing, as it stands: the driver reads its windows again when it moves (#1354).\n            ...(paged.query !== undefined ? { query: () => latest.current.src?.query?.() ?? \"\" } : {}),\n        };\n        wrapperOf.current = { src: paged, wrapped: next };\n        return next;\n    }, [paged]);\n\n    // A paged resource kind (#1199): the canvas pages its resources, each window the event kinds' blocks with\n    // the kind's place filled, and the root's own rows after it, fixed. Its version moves when the events placed\n    // on its resources do (the lead's version) or the root's own rows do — a new revision of its windows.\n    const counted = useRef<{ lead: number | undefined; rows: PlanRootValue[\"rows\"] | undefined; version: number }>(\n        { lead: undefined, rows: undefined, version: 0 });\n    const version = useMemo(() => {\n        const c = counted.current;\n        // The root's rows are the data-stable twin's: the same object while they hold the same rows.\n        if (c.lead === lead?.version && Object.is(c.rows, data.rows)) return c.version;\n        counted.current = { lead: lead?.version, rows: data.rows, version: c.version + 1 };\n        return counted.current.version;\n    }, [lead?.version, data.rows]);\n    const current = useRef({ pages, lead, data, hidden, version });\n    current.current = { pages, lead, data, hidden, version };\n    const composedOf = useRef<{ seam: PlanEventPagedValue; composed: PlanPagedSourceValue } | undefined>(undefined);\n    const composed = useMemo((): PlanPagedSourceValue | undefined => {\n        if (pages === undefined) return undefined;\n        const prior = composedOf.current;\n        if (prior !== undefined && pagedSeamEquivalent(prior.seam, pages)) return prior.composed;\n        const next: PlanPagedSourceValue = {\n            id: `${pages.id}#events`,\n            page: (offset, limit) => {\n                const c = current.current;\n                // The events not yet placed: the window waits for them.\n                if (c.pages === undefined || c.lead?.placed === undefined) return none;\n                const read = c.pages.rows(offset, limit, c.lead.placed, c.lead.shading, [...c.hidden]);\n                if (read.type !== \"some\") return read;\n                const lead = c.lead.blocks;\n                const at = lead.findIndex((block) => !block.fixed);\n                const own = c.data.rows.type === \"inline\" ? c.data.rows.value.map(fixedBlock) : [];\n                // A paged resource kind's rows: no entry of the canvas's own data stands behind them.\n                return some({\n                    rows: at < 0\n                        ? [...read.value, ...lead, ...own]\n                        : [...lead.slice(0, at), ...read.value, ...lead.slice(at + 1), ...own],\n                    entries: [],\n                });\n            },\n            total: () => current.current.pages?.total() ?? none,\n            // New rows are a new revision: the driver reads its windows again,\n            // the rows it has standing in until they land.\n            revision: () => {\n                const c = current.current;\n                const r = c.pages?.revision() ?? none;\n                return some(`${r.type === \"some\" ? r.value : \"\"}#events-${c.version}`);\n            },\n            refresh: (revision) => current.current.pages?.refresh(revision) ?? null,\n            seek: pages.seek.type === \"some\"\n                ? some((query) => {\n                    const s = current.current.pages?.seek;\n                    return s !== undefined && s.type === \"some\" ? s.value(query) : none;\n                })\n                : none,\n            // The snapshot of the kind's resources (#1199): their window's own revision — and, its source narrowing\n            // them, the narrowing with it (#1344) — which the events placed on them, the drafts and the root's rows leave.\n            snapshot: () => {\n                const p = current.current.pages;\n                if (p === undefined) return none;\n                return (p.query.type === \"some\" ? snapshotOf({ revision: p.revision, query: p.query.value }) : p.revision()) ?? none;\n            },\n            // Its source's narrowing, as it stands (#1344): the driver reads its windows again when it moves — the\n            // view the last one drew standing in until the new one's first lands.\n            ...(pages.query.type === \"some\" ? { query: () => narrowingOf(current.current.pages) } : {}),\n        };\n        composedOf.current = { seam: pages, composed: next };\n        return next;\n    }, [pages]);\n    // A kind its source narrows pages a live source (#1344), as the rail's `rows` source is.\n    const composedArm = pages?.query.type === \"some\" ? \"live\" : \"pinned\";\n\n    const placed = lead?.placed;\n    const pagedSlot = pages?.kind;\n    const links = useMemo(\n        () => (blocks !== undefined ? resolveEventLinks(data.links, blocks, placed, pagedSlot) : data.links),\n        [blocks, data.links, placed, pagedSlot]);\n    const rowsOf = useCallback((root: PlanRootValue): PlanRootValue[\"rows\"] => {\n        if (composed !== undefined) return variant(composedArm, composed) as PlanRootValue[\"rows\"];\n        if (inline !== undefined) return variant(\"inline\", inline) as PlanRootValue[\"rows\"];\n        if (wrapped !== undefined) return variant(windowedArm(root.rows), wrapped) as PlanRootValue[\"rows\"];\n        return root.rows;\n    }, [composed, composedArm, inline, wrapped]);\n    const active = lead !== undefined;\n    const shownData = useMemo(\n        () => (active ? { ...data, rows: rowsOf(data), links } : data),\n        [active, data, rowsOf, links]);\n    const shownValue = useMemo(\n        () => (active ? { ...value, rows: rowsOf(value), links } : value),\n        [active, value, rowsOf, links]);\n    return { value: shownValue, data: shownData, version: composed !== undefined ? version : 0 };\n}\n\n/** The keys of a row's elements, whatever way it draws. */\nfunction elementKeysOf(row: PlanWireRow): readonly string[] {\n    const k = row.kind;\n    switch (k.type) {\n        case \"span\": return k.value.runs.map((r) => r.key);\n        case \"buckets\": return k.value.events.map((e) => e.key);\n        case \"cards\": return k.value.chips.map((c) => c.key);\n        case \"events\": return k.value.marks.map((m) => m.key);\n        default: return [];\n    }\n}\n\n/** A link's end. */\ntype PlanLinkEnd = PlanLinkValue[\"from\"];\n\n/** Whether a link's end names an event: an `entry` at no path, which no row's id is. */\nfunction isEventEnd(end: PlanLinkEnd): boolean {\n    return end.row.type === \"entry\" && end.row.value.path.length === 0;\n}\n\n/**\n * A root's links with each event end named where its event draws: the row\n * holding the element whose key is the event's ref as East prints it, and\n * that key — on a paged kind's resource, that resource's row by its id\n * (#1199), wherever the window that draws it is.\n *\n * @param links - The root's links\n * @param blocks - The event kinds' rows\n * @param placed - The events placed on a paged kind's resources, by way of drawing and by resource, when a kind pages\n * @param pagedSlot - The paged kind's slot, beside `placed`\n * @returns The links — the same array when none names an event\n */\nexport function resolveEventLinks(\n    links: PlanRootValue[\"links\"], blocks: readonly PlanWireBlock[], placed?: PlanEventPlacedValue, pagedSlot?: string,\n): PlanRootValue[\"links\"] {\n    if (!links.some((l) => isEventEnd(l.from) || isEventEnd(l.to))) return links;\n    // Where each element is, by its key — an event draws once.\n    const where = new Map<string, PlanRowId>();\n    for (const block of blocks) {\n        for (const row of block.rows) for (const key of elementKeysOf(row)) where.set(key, row.id);\n    }\n    // A paged kind's events (#1199): on the row its way of drawing gives its resource — the row's id, a\n    // series key and the resource's key, is known from the event alone, never looked for in a window.\n    if (placed !== undefined && pagedSlot !== undefined) {\n        for (const [draw, byResource] of placed) {\n            for (const [resource, list] of byResource) {\n                const row: PlanRowId = variant(\"entry\", { series: `${pagedSlot}.${draw}`, path: [resource] });\n                for (const one of list) where.set(printEventRef({ kind: one.item.kind, key: one.item.key }), row);\n            }\n        }\n    }\n    const resolve = (end: PlanLinkEnd): PlanLinkEnd => {\n        if (!isEventEnd(end) || end.row.type !== \"entry\") return end;\n        const key = printEventRef({ kind: end.row.value.series, key: end.run });\n        const row = where.get(key);\n        return row !== undefined ? { row, run: key } : end;\n    };\n    return links.map((l) => ({ ...l, from: resolve(l.from), to: resolve(l.to) }));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The events whose rows break their kind's bounds (#1585): each element of one\n * wears the warn ring, stored or changed, as an event holding a conflict does,\n * and a stored one's breach is a warning beside the history's issues, holding\n * no Save — a changed one's is the refusal its session's readiness raises,\n * which holds Save. A warning names its event by its title, as the banners\n * read it, then the field by its label and the bound in its hint's own words,\n * as a refusal does. A kind whose form holds no number to a least or a most is\n * read for nothing.\n * Every event's row of a kind is read at once (`planRows`), drafts in place,\n * from the rows the canvas reads over its range — the reads its blocks make, so\n * no request of their own, and no event read by its key; a kind read by its\n * cells is read from the rows they hold, an event a draft changed read with\n * its draft in place. A kind past the cap draws none of its events, and nor\n * does a kind the viewer hides: neither is read.\n *\n * The read runs in a component of its own, {@link PlanBoundsReader}, which\n * hands the canvas the events only as they move: what it reads lands in as\n * many settles as the searches it touches, and each would otherwise render\n * the whole canvas (#1343).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { DictType, OptionType, StringType, decodeBeast2For, equalFor, fromEastTypeValue, printFor, type EastType, type ValueTypeOf } from \"@elaraai/east\";\nimport { ScheduleEventRefType, planHideId, type PlanPayloadType } from \"@elaraai/e3-ui/internal\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { fieldBreachIssue, fieldBreaches, useTrackedEvaluation, type EditIssue, type FieldBreach } from \"@elaraai/east-ui-components\";\nimport { isBounded, rowBreaches } from \"../../shared/bounds.js\";\nimport { optimiseIdOf } from \"../../shared/func/optimise-diff.js\";\nimport { scheduleWithinCap, type ScheduleCellsRead } from \"../../shared/schedule/cells.js\";\nimport { scheduleIssueName } from \"../../shared/schedule/editing.js\";\nimport { refusalText, scheduleRefusals } from \"../../shared/schedule/refusals.js\";\nimport type { PlanEventEditing } from \"../edit/events.js\";\nimport { hides } from \"../frame/hidden.js\";\nimport type { PlanEventRange } from \"./events.js\";\n\n/** One event kind, as the Plan's payload carries it. */\ntype PlanEventKindValue = ValueTypeOf<typeof PlanPayloadType>[\"events\"][number];\n\n/** An element's key: its event, as East prints a `Schedule.Types.EventRef`. */\nconst printEventRef = printFor(ScheduleEventRefType);\nconst stringEqual = equalFor(StringType);\nconst fieldEqual = equalFor(OptionType(StringType));\n\n/** A stored event's breach: a warning beside the history's issues, which holds no Save. */\nexport interface PlanBoundsWarning {\n    /** The event's kind's slot. */\n    readonly kind: string;\n    /** The breach, as an issue of the event naming its field: what its Go to asks the event's form for. */\n    readonly issue: EditIssue;\n    /** Its words: the event's title, then the field's label and the bound. */\n    readonly text: string;\n}\n\n/** The events whose rows break their kind's bounds: those that wear the warn ring, and the stored ones' breaches. */\nexport interface PlanBreaches {\n    /** Every such event, stored or changed, by its elements' key. */\n    readonly bounded: ReadonlySet<string>;\n    /** The stored ones' breaches, in the kinds' order. */\n    readonly warnings: readonly PlanBoundsWarning[];\n}\n\n/** No event whose row breaks its kind's bounds. */\nexport const NO_BREACHES: PlanBreaches = { bounded: new Set(), warnings: [] };\n\n/** No rows held: a kind its cells hold none of. */\nconst NO_ROWS: ReadonlyMap<string, { readonly row: Uint8Array }> = new Map();\n\n/** A kind whose form holds a number to bounds, and how its rows are read against them. */\ninterface BoundedKind {\n    readonly kind: PlanEventKindValue;\n    /** Its form's fields held to bounds. */\n    readonly bounded: readonly FieldSpecValue[];\n    /** Its rows by key, from the bytes of its record's own Dict. */\n    readonly rowsOf: (bytes: Uint8Array) => ReadonlyMap<unknown, unknown>;\n    /** An event's key's text, as its session and its elements name it. */\n    readonly idOf: (key: unknown) => string;\n    /** One row's breaches, by its bytes. */\n    readonly breachesOf: (bytes: Uint8Array) => readonly FieldBreach[];\n}\n\n/** Whether two readings' warnings say the same, of the same fields of the same events. */\nfunction sameWarnings(a: readonly PlanBoundsWarning[], b: readonly PlanBoundsWarning[]): boolean {\n    return a.length === b.length && a.every((was, i) => {\n        const now = b[i]!;\n        return stringEqual(was.kind, now.kind) && stringEqual(was.issue.entry, now.issue.entry) && fieldEqual(was.issue.field, now.issue.field)\n            && stringEqual(was.text, now.text);\n    });\n}\n\n/**\n * The events whose rows break their kind's bounds, and the stored ones' breaches (see the module docs).\n *\n * @param kinds - The kinds whose forms hold a number to bounds\n * @param editing - The kinds' editing: each kind's drafts, which every read puts in place, and its session's refusals\n * @param range - The range the canvas reads its event kinds' rows over\n * @param cells - The kinds' cells and counts\n * @param hidden - The ids the viewer hides in the library's Series tab\n * @returns The events and the warnings; `undefined` while a kind's count or rows are in flight\n */\nfunction boundedEvents(kinds: readonly BoundedKind[], editing: PlanEventEditing, range: PlanEventRange, cells: ScheduleCellsRead,\n    hidden: readonly string[]): PlanBreaches | undefined {\n    const bounded = new Set<string>();\n    const warnings: PlanBoundsWarning[] = [];\n    // A changed event's breaches are its session's refusals, which hold Save: never warnings as well.\n    const refused = scheduleRefusals(editing.sessions);\n    let reading = false;\n    for (const { kind, bounded: fields, rowsOf, idOf, breachesOf } of kinds) {\n        if (hides(hidden, planHideId.events(kind.key))) continue;\n        const drafts = editing.draftsOf(kind.key);\n        const breaking: { readonly id: string; readonly breaches: readonly FieldBreach[] }[] = [];\n        if (cells.reads.has(kind.key)) {\n            // Read by its cells — past the cap, they hold none of its events.\n            for (const [id, { row }] of cells.held.get(kind.key) ?? NO_ROWS) {\n                if (drafts.has(id)) continue;\n                const breaches = breachesOf(row);\n                if (breaches.length > 0) breaking.push({ id, breaches });\n            }\n            for (const id of drafts.keys()) {\n                const read = editing.read(kind.key, id);\n                if (read === undefined) continue;\n                const breaches = breachesOf(read.row);\n                if (breaches.length > 0) breaking.push({ id, breaches });\n            }\n        } else {\n            const within = scheduleWithinCap(kind.count, range.from, range.to);\n            if (within.type !== \"some\") { reading = true; continue; }\n            if (!within.value) continue;\n            const held = kind.planRows(range.from, range.to, drafts);\n            if (held.type !== \"some\") { reading = true; continue; }\n            for (const [key, row] of rowsOf(held.value)) {\n                const breaches = fieldBreaches(fields, row);\n                if (breaches.length > 0) breaking.push({ id: idOf(key), breaches });\n            }\n        }\n        for (const { id, breaches } of breaking) {\n            bounded.add(printEventRef({ kind: kind.key, key: id }));\n            for (const breach of breaches) {\n                const issue = fieldBreachIssue(breach, { entry: id });\n                if (refused.some((refusal) => stringEqual(refusal.kind, kind.key) && stringEqual(refusal.issue.entry, id)\n                    && fieldEqual(refusal.issue.field, issue.field))) continue;\n                warnings.push({ kind: kind.key, issue, text: `${scheduleIssueName(editing, kind.key, id)} · ${refusalText(issue, kind.fields)}` });\n            }\n        }\n    }\n    return reading ? undefined : { bounded, warnings };\n}\n\n/** Props of {@link PlanBoundsReader}. */\nexport interface PlanBoundsReaderProps {\n    /** The event kinds, as the payload carries them. */\n    kinds: readonly PlanEventKindValue[];\n    /** The kinds' editing: each kind's drafts, which every read puts in place, and its session's refusals. */\n    editing: PlanEventEditing;\n    /** The range the canvas reads its event kinds' rows over. */\n    range: PlanEventRange;\n    /** The kinds' cells and counts; `undefined` until the reader of the kinds' rows hands them on. */\n    cells: ScheduleCellsRead | undefined;\n    /** The ids the viewer hides in the library's Series tab. */\n    hidden: readonly string[];\n    /** Where the events and the warnings go: called only when they move, each kept while it says the same. */\n    onBreaches: (breaches: PlanBreaches) => void;\n}\n\n/**\n * The events whose rows break their kind's bounds, and the stored ones'\n * breaches, read in a component of its own (see the module docs). Until the\n * kinds' cells are read, which kinds they hold is not known, and nothing is\n * read: a kind read by its cells is never read over the range. A read in\n * flight, or one that failed, hands nothing on.\n *\n * @param props - What is read, over what, and where it goes\n * @returns Nothing: it reads\n */\nexport function PlanBoundsReader({ kinds, editing, range, cells, hidden, onBreaches }: PlanBoundsReaderProps): null {\n    const checked = useMemo(() => kinds.flatMap((kind): BoundedKind[] => {\n        const bounded = kind.fields.filter(isBounded);\n        if (bounded.length === 0) return [];\n        const keyType = kind.editing.keyType.type === \"some\" ? fromEastTypeValue(kind.editing.keyType.value) as EastType : StringType;\n        const rowType = fromEastTypeValue(kind.editing.entryType) as EastType;\n        return [{\n            kind, bounded, rowsOf: decodeBeast2For(DictType(keyType, rowType)) as (bytes: Uint8Array) => ReadonlyMap<unknown, unknown>,\n            idOf: optimiseIdOf(keyType), breachesOf: rowBreaches(bounded, rowType),\n        }];\n    }), [kinds]);\n    const read = useCallback(() => (cells === undefined ? undefined : boundedEvents(checked, editing, range, cells, hidden)),\n        [checked, editing, range, cells, hidden]);\n    const { result } = useTrackedEvaluation(read);\n    const now = result.ok ? result.value : undefined;\n    const reported = useRef(NO_BREACHES);\n    useLayoutEffect(() => {\n        if (now === undefined) return;\n        // Each kept while it says the same: the elements wearing the ring draw nothing again as a warning's words move.\n        const was = reported.current;\n        const bounded = was.bounded.size === now.bounded.size && [...now.bounded].every((key) => was.bounded.has(key)) ? was.bounded : now.bounded;\n        const warnings = sameWarnings(was.warnings, now.warnings) ? was.warnings : now.warnings;\n        if (bounded === was.bounded && warnings === was.warnings) return;\n        reported.current = { bounded, warnings };\n        onBreaches(reported.current);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A record's drafts in what e3 keeps (#1437): for each row a builder's\n * editing session holds a draft of, that row's Save previewed in the page.\n *\n * - **The row as e3 holds it.** At the revision the session's drafts began\n *   from, it is the session's own original. At any later revision it is read\n *   by key at that revision, every drafted row in one request\n *   (`rowsAll`).\n * - **The row as the Save would leave it.** The draft's change is the patch\n *   the Save sends, the original against the draft. Applied to the row as e3\n *   holds it, it is what e3 holds once the Save commits. A change that does\n *   not apply — another session changed the same value — is `stale`: nothing\n *   is previewed, and the session's banner says the source changed.\n * - **What it changes.** The maintenance of each index the binding carries it\n *   for (each nested series and summary index it lists), run on the two rows\n *   and the row's patch: the function e3's commit runs (`indexMaintenance`),\n *   so what comes out is what e3 will change in each index if the Save\n *   commits now.\n *\n * A reader of the record's entries puts each previewed row's changes into\n * what it holds: an entry's `insert` or `update` replaces it, its `delete`\n * drops it, a summary's `add` moves its total. The part changes no read\n * itself, so which rows show, in what order, and a rail's counts keep to what\n * is saved. It runs only on the rows the session holds drafts of — never over\n * the record (never evaluate index functions over every record in the\n * browser) — and runs a row again only when its draft moves, a row lands, or\n * the revision moves. Nothing of it is stored: once a Save commits and reads\n * back, the session's drafts retire, and what e3 keeps is what was previewed.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport { ConflictError, OptionType, StringType, applyFor, diffFor, equalFor, none, some, type EastType, type option } from \"@elaraai/east\";\nimport { useTrackedEvaluation, type DraftedEntry, type EditSession, type SessionDrafts } from \"@elaraai/east-ui-components\";\nimport { recordSliceBatchesOf, type IndexMaintenance, type IndexMaintenances } from \"../../platform/indexed-paged.js\";\n\n/**\n * What a drafted row's Save would change in one index, by entry: each an op\n * of the index's own East patch (`insert`, `update`, `delete`) or a summary\n * index's `add`, as e3's maintenance gives them, in the index's entry order.\n */\nexport type IndexChanges = ReadonlyMap<unknown, unknown>;\n\n/**\n * One drafted row's Save, previewed: what it changes in each index.\n *\n * @property key - The row's key\n * @property state - `previewed`: the changes are e3's for this Save. `reading`: the row is being read at the revision\n *   the builder reads. `stale`: the draft's change does not apply to the row as e3 now holds it — another session\n *   changed the same value — so nothing is previewed.\n * @property changes - By index, what the Save would change; empty unless `previewed`\n */\nexport interface PreviewedRow {\n    readonly key: unknown;\n    readonly state: \"previewed\" | \"reading\" | \"stale\";\n    readonly changes: ReadonlyMap<string, IndexChanges>;\n}\n\n/**\n * What the part reads of a record's indexed binding (`Data.bindPaged(record,\n * { indexes })`, as a page holds it): the maintenance it carries, its\n * revision, and — through the runtime that built it — its rows by key.\n */\nexport interface RecordDraftsBinding {\n    /** Each listed nested series and summary index's maintenance for one row, by its name; none where it lists neither. */\n    readonly maintenance: IndexMaintenances;\n    /** The record's revision the binding reads; none while it resolves. */\n    revision(): option<string>;\n}\n\n/**\n * The session the part reads: the record's, its entries the record's rows\n * whole, keyed by the record's key. A builder that pages a record's rows\n * without their collections — beside a nested series index — reads a row\n * whole as its first change is drafted, so the session's original is the row\n * as e3 holds it.\n */\nexport type RecordDraftsSession = Pick<EditSession<unknown>, \"drafts\" | \"entryType\" | \"keyType\">;\n\n/**\n * What a spec watches the part by: each run of a row's maintenance. Test use\n * only.\n */\nexport interface RecordDraftsProbe {\n    /** Called for each drafted row whose maintenance runs, with its key. */\n    readonly ran?: (key: unknown) => void;\n}\n\n/** The probe a spec installed; `undefined` outside tests. */\nlet recordDraftsProbe: RecordDraftsProbe | undefined;\n\n/**\n * Install (or clear) the probe the part's runs are watched by. Test use only.\n *\n * @param probe - What watches it; `undefined` clears it\n */\nexport function setRecordDraftsProbe(probe: RecordDraftsProbe | undefined): void {\n    recordDraftsProbe = probe;\n}\n\n/** No index changes: a row not previewed. */\nconst NOTHING: ReadonlyMap<string, IndexChanges> = new Map();\n/** No drafted rows. */\nconst NO_ROWS: ReadonlyMap<string, PreviewedRow> = new Map();\nconst stringEqual = equalFor(StringType);\n\n/** A row's last preview: the revision and the row as e3 held it that it was previewed over. */\ninterface Previewed {\n    readonly revision: string;\n    readonly held: option<unknown>;\n    readonly row: PreviewedRow;\n}\n\n/** Whether two answers hold the same rows: each id's preview the same object. */\nfunction sameRows(a: ReadonlyMap<string, PreviewedRow>, b: ReadonlyMap<string, PreviewedRow>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [id, row] of b) if (a.get(id) !== row) return false;\n    return true;\n}\n\n/**\n * A record's drafts in what e3 keeps (see the module docs): each drafted\n * row's Save previewed through a binding's maintenance. Its reads are tracked\n * where it runs — {@link useRecordDrafts} runs it in a tracked evaluation — so\n * a row read at a later revision previews once it lands.\n */\nexport class RecordDrafts {\n    /** Each drafted row's last preview, by the session's view of it. */\n    private previews = new WeakMap<DraftedEntry<unknown>, Previewed>();\n    /** Each drafted row while it is read, by the session's view of it. */\n    private reads = new WeakMap<DraftedEntry<unknown>, PreviewedRow>();\n    /** The last answer: the same object while each row's preview is. */\n    private last: ReadonlyMap<string, PreviewedRow> = NO_ROWS;\n    /** A row's change applied to it, as the Save's patch is: the row, or a `ConflictError` thrown where it does not apply. */\n    private readonly apply: (held: option<unknown>, patch: unknown) => option<unknown>;\n    /** A row's change, as the Save sends it: its patch, as an entry present or absent. */\n    private readonly change: (before: option<unknown>, after: option<unknown>) => unknown;\n    /** A row's patch, where it is present before and after: what the maintenance follows. */\n    private readonly rowPatch: (before: unknown, after: unknown) => unknown;\n\n    /**\n     * @param binding - The record's indexed binding\n     * @param session - The record's editing session\n     * @throws {Error} When the session is no keyed source's\n     */\n    constructor(private readonly binding: RecordDraftsBinding, private readonly session: RecordDraftsSession) {\n        if (session.keyType === undefined) throw new Error(\"A record's drafts are a keyed source's: its session names no key\");\n        const row: EastType = session.entryType;\n        this.apply = applyFor(OptionType(row)) as (held: option<unknown>, patch: unknown) => option<unknown>;\n        this.change = diffFor(OptionType(row)) as (before: option<unknown>, after: option<unknown>) => unknown;\n        this.rowPatch = diffFor(row) as (before: unknown, after: unknown) => unknown;\n    }\n\n    /**\n     * Each drafted row's Save, previewed, by its id: the same object while the\n     * session's drafts, the binding's revision and the rows read at it stand.\n     *\n     * @returns The previewed rows; none where the binding carries no maintenance\n     * @throws {Error} When a drafted row is to be read at a later revision and the binding's runtime reads no rows by key\n     */\n    preview(): ReadonlyMap<string, PreviewedRow> {\n        const maintenance = this.binding.maintenance;\n        const drafts = this.session.drafts;\n        if (maintenance.type === \"none\") return NO_ROWS;\n        return this.kept(this.answer(drafts, maintenance.value));\n    }\n\n    /** Each drafted row's preview, by its id, as {@link RecordDrafts.preview} gives it. */\n    private answer(drafts: SessionDrafts<unknown>, maintain: Readonly<Record<string, IndexMaintenance>>): Map<string, PreviewedRow> {\n        const answer = new Map<string, PreviewedRow>();\n        if (drafts.entries.size === 0) return answer;\n        const revision = this.binding.revision();\n        if (revision.type === \"none\") return this.reading(drafts);\n        // At the revision the drafts began from, each row is the session's own original; at a later one, read by key.\n        let rows: readonly option<unknown>[] | undefined;\n        if (drafts.revision === undefined || !stringEqual(drafts.revision, revision.value)) {\n            const batches = recordSliceBatchesOf(this.binding);\n            if (batches === undefined) {\n                throw new Error(\"A record's drafts read each drafted row at the record's revision, and this binding's runtime reads no rows by key\");\n            }\n            const read = batches.rowsAll([...drafts.entries.values()].map((entry) => entry.key));\n            if (read.type === \"none\") return this.reading(drafts);\n            rows = read.value;\n        }\n        [...drafts.entries].forEach(([id, entry], i) => {\n            answer.set(id, this.previewed(entry, revision.value, rows === undefined ? entry.before : rows[i]!, maintain));\n        });\n        return answer;\n    }\n\n    /** The answer, as the last one where it holds the same rows: the same object while each row's preview is. */\n    private kept(answer: ReadonlyMap<string, PreviewedRow>): ReadonlyMap<string, PreviewedRow> {\n        if (sameRows(this.last, answer)) return this.last;\n        this.last = answer;\n        return answer;\n    }\n\n    /** Every drafted row reading: the revision, or the rows at it, still in flight. */\n    private reading(drafts: SessionDrafts<unknown>): Map<string, PreviewedRow> {\n        return new Map([...drafts.entries].map(([id, entry]) => {\n            let row = this.reads.get(entry);\n            if (row === undefined) {\n                row = { key: entry.key, state: \"reading\", changes: NOTHING };\n                this.reads.set(entry, row);\n            }\n            return [id, row] as const;\n        }));\n    }\n\n    /**\n     * One drafted row's Save, previewed over the row as e3 holds it: kept\n     * while its draft, the revision and the row stand.\n     *\n     * @param entry - The session's view of the drafted row\n     * @param revision - The revision e3's row is held at\n     * @param held - The row as e3 holds it there\n     * @param maintain - Each index's maintenance, by its name\n     * @returns The previewed row\n     */\n    private previewed(entry: DraftedEntry<unknown>, revision: string, held: option<unknown>, maintain: Readonly<Record<string, IndexMaintenance>>): PreviewedRow {\n        const kept = this.previews.get(entry);\n        // The same row read, or the session's own original: what it was previewed over.\n        if (kept !== undefined && stringEqual(kept.revision, revision) && Object.is(kept.held, held)) return kept.row;\n        let next: option<unknown>;\n        try {\n            next = this.apply(held, this.change(entry.before, entry.after));\n        } catch (error) {\n            if (!(error instanceof ConflictError)) throw error;\n            const row: PreviewedRow = { key: entry.key, state: \"stale\", changes: NOTHING };\n            this.previews.set(entry, { revision, held, row });\n            return row;\n        }\n        // The row's patch, where it is updated: what a nested series index follows to the entries it touched (#1434).\n        const patch = entry.before.type === \"some\" && entry.after.type === \"some\" && held.type === \"some\" && next.type === \"some\"\n            ? some(this.rowPatch(entry.before.value, entry.after.value)) : none;\n        recordDraftsProbe?.ran?.(entry.key);\n        const changes = new Map<string, IndexChanges>();\n        for (const [index, fn] of Object.entries(maintain)) changes.set(index, fn(entry.key, held, next, patch));\n        const row: PreviewedRow = { key: entry.key, state: \"previewed\", changes };\n        this.previews.set(entry, { revision, held, row });\n        return row;\n    }\n}\n\n/** No session's changes to follow. */\nconst unsubscribed = () => () => {};\nconst unversioned = () => 0;\n\n/**\n * A record's drafts in what e3 keeps (see the module docs), tracked: it reads\n * again as a draft moves, a row lands or the revision moves.\n *\n * @param binding - The record's indexed binding, as the page holds it: its maintenance and its revision, its rows read\n *   by key through the runtime that built it\n * @param session - The record's editing session: each drafted row, as it began and as drafted\n * @returns Each drafted row's preview, by its id; none without a binding or a session\n * @throws {Error} As {@link RecordDrafts} does, through the evaluation's error\n */\nexport function useRecordDrafts(binding: RecordDraftsBinding | undefined, session: (RecordDraftsSession & Pick<EditSession<unknown>, \"subscribe\" | \"getSnapshot\">) | undefined): ReadonlyMap<string, PreviewedRow> {\n    const version = useSyncExternalStore(session?.subscribe ?? unsubscribed, session?.getSnapshot ?? unversioned);\n    const drafts = useMemo(() => (binding === undefined || session === undefined ? undefined : new RecordDrafts(binding, session)), [binding, session]);\n    // The session's version keys the evaluation: a gesture, an Undo or a Save runs it again.\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- the drafts are the session's, read inside: its version says when they moved\n    const evaluate = useCallback(() => drafts?.preview() ?? NO_ROWS, [drafts, version]);\n    const { result } = useTrackedEvaluation(evaluate);\n    if (!result.ok) throw result.error;\n    return result.value;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * A Plan's paged rows' collections, read a cell at a time through their\n * nested series index (#1438): the reader beside the canvas's paging, in a\n * component of its own as the event kinds' is (`events.ts`), and the wrapper\n * that draws each window of lean rows with what it read.\n *\n * # What it reads\n *\n * The canvas's rows in view and 25 either side (`SCHEDULE_CELL_MARGIN`), in\n * blocks of {@link SCHEDULE_CELL_BLOCK} of its rows — top rows and child rows\n * alike, in the canvas's order. A folded row's children are no rows of it, and\n * their items are not read. For each row, each collection its series reads\n * (the seam's `uses`) and each level the collection's items are filed at, one\n * range over that level's run of tiles (#1433): `[place, row, path, .items,\n * level, from]` to `[…, to]`, every literal as the index's key prints it. A row\n * with children whose series subtotals them reads its subtotals too, one range\n * at the resolution's level, and never its descendants' cells for them; one\n * whose children's span series rolls them up into bands reads its subtree's\n * items, one range a level — which e3's fill puts back in the descendants that\n * hold them, so the bands roll up from them as over rows read whole.\n *\n * Every search it does not hold goes in one request, which counts each one's\n * entries first; the entries it does not hold go in one more. What it holds is\n * kept at the record's revision: a pan or a scroll within what it holds reads\n * nothing, and a commit reads what is wanted again, the last standing in until\n * it lands.\n *\n * # The cap\n *\n * While a collection's items in the cells wanted are at most\n * {@link SCHEDULE_EVENT_CAP}, they draw. Past it, no item of it is read, and the\n * rows of the series reading it shade from their totals — a parent rolling it\n * up into bands from its subtree's — at the summary tile, where that divides the\n * canvas's bucket: the share of each bucket booked, how many items touch it, or\n * its values folded as the series folds them. Where no summary divides it, the\n * rows are hatched, and the reader names the collection among its notices, with\n * how many items there are.\n *\n * # What it hands on\n *\n * The cells, encoded as the binding's fill takes them; the shading; each\n * parent's subtotals by its row's key, which the derivation draws in place of\n * its children's (`derivePlan`); and a version that moves when any of them\n * does, so the canvas's paged source, which draws each window through the\n * seam's `rows`, is read again. Beside them, while a read is in flight, the\n * rows waiting on it — each row with a run of tiles not held, as a pan, a\n * zoom, a scroll or a commit asks — which wash as a paged kind's unread rows\n * do (#1398, CL2) until their cells land.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport {\n    ArrayType, BlobType, SortedMap, StringType, applyFor, compareFor, encodeBeast2For, equalFor, equivalentFor, none, parseFor, printFor, some, variant,\n    type EastType, type StructType, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport type { SeekQueryType } from \"@elaraai/east-ui\";\nimport { levelRuns, summaryRun, tileNext, type RecordTile } from \"@elaraai/east-ui/internal\";\nimport { nestedSpanName } from \"@elaraai/e3-types\";\nimport { Plan, PlanNestedShadingType, SCHEDULE_EVENT_CAP, type PlanNestedType } from \"@elaraai/e3-ui/internal\";\nimport { useSliceReactivity, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { snapshotOf, windowedSourceOf } from \"@elaraai/east-ui-components/internal\";\nimport { indexedBindingOf, type IndexedBindingRead } from \"../../platform/indexed-paged.js\";\nimport { useRecordDrafts, type PreviewedRow, type RecordDraftsSession } from \"../../shared/records/drafts.js\";\nimport type { EditSession } from \"@elaraai/east-ui-components\";\nimport { SCHEDULE_CELL_BLOCK, dividingTiles, wantedBlocks, type ScheduleCellBucket } from \"../../shared/schedule/cells.js\";\nimport type { PlanParentSubtotal, PlanParentSubtotals, PlanRootValue, PlanRowIndex, PlanRowValue } from \"../model.js\";\nimport type { PlanResolution, PlanScale } from \"../scale.js\";\nimport { windowedArm, type PlanPagedSourceValue } from \"../use-plan-paging.js\";\nimport { bucketsOver } from \"./cells.js\";\nimport { eventReadRange } from \"./events.js\";\n\n/** The seam a Plan's root carries over paged rows beside their nested series index, decoded. */\nexport type PlanNestedValue = ValueTypeOf<typeof PlanNestedType>;\n/** One series' read of one collection, as the seam carries it. */\ntype Use = PlanNestedValue[\"uses\"][number];\n/** The rows' shading past the cap, as the seam's window takes it. */\nexport type PlanNestedShadingValue = ValueTypeOf<typeof PlanNestedShadingType>;\ntype SeekQuery = ValueTypeOf<SeekQueryType>;\n/** One search's bounds in the index, as a batch of searches answers them. */\ntype Range = { readonly found: boolean; readonly row: bigint; readonly count: bigint };\n/** An entry of the index, as the binding's fill takes it. */\ntype Entry = { readonly ik: unknown; readonly value: unknown };\n/** One shade of a row's bucket. */\ntype Shade = { readonly at: Date; readonly value: option<number> };\n\n/** A collection past the cap that no totals shade at this resolution. */\nexport interface PlanNestedNotice {\n    /** Its place: its field names from the row down. */\n    readonly place: readonly string[];\n    /** How many of its items the cells wanted hold. */\n    readonly items: number;\n}\n\n/** What the reader hands the canvas (see the module docs). */\nexport interface PlanNestedLead {\n    /** The items read, encoded as the binding's fill takes them: a beast2 Array of the index's `{ ik, value }` entries. */\n    readonly cells: Uint8Array;\n    /** The rows' shading past the cap: by series, then by the row's path as East prints it, its buckets. */\n    readonly shading: PlanNestedShadingValue;\n    /** Each parent's subtotals as e3 keeps them, by its row's key. */\n    readonly parents: PlanParentSubtotals;\n    /** The collections past the cap that no totals shade at this resolution. */\n    readonly notices: readonly PlanNestedNotice[];\n    /** Moves each time the cells, the shading or the subtotals do: the canvas reads its windows again then. */\n    readonly version: number;\n    /** Whether a read is in flight: what stands was read before it. */\n    readonly reading: boolean;\n}\n\n// ============================================================================\n// The rows in view\n// ============================================================================\n\n/** The rows the view shows as its scroll rests: the first and the last, by their keys. */\nexport interface PlanNestedView {\n    readonly first: string;\n    readonly last: string;\n}\n\n/** Where the canvas's rows in view are, as it reports them to the reader: a store of one view. */\nexport interface PlanNestedViewStore {\n    /** The view last reported; `undefined` before any is. */\n    get(): PlanNestedView | undefined;\n    /** Reports the rows in view: a view the store holds already moves nothing. */\n    set(view: PlanNestedView | undefined): void;\n    /** Listens for a view that moves; returns the unsubscribe. */\n    subscribe(listener: () => void): () => void;\n}\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * A store of the canvas's rows in view: the canvas writes it as its scroll\n * comes to rest, and the reader, a component of its own, reads it.\n *\n * @returns The store\n */\nexport function createNestedViewStore(): PlanNestedViewStore {\n    let view: PlanNestedView | undefined;\n    const listeners = new Set<() => void>();\n    return {\n        get: () => view,\n        set(next) {\n            if (next === view || (next !== undefined && view !== undefined && stringEqual(next.first, view.first) && stringEqual(next.last, view.last))) return;\n            view = next;\n            for (const listener of [...listeners]) listener();\n        },\n        subscribe(listener) {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n    };\n}\n\n// ============================================================================\n// The literals an index's key prints\n// ============================================================================\n\n/** The `.east` literals a search of the nested series index names its bounds in, made once for a binding. */\ninterface Literals {\n    /** A place's or a node's path: its names, as the key's paths print. */\n    path(names: readonly string[]): string;\n    /** A row's key's leaves, from its id's text; `undefined` for text the key's type cannot read. */\n    row(id: string): readonly string[] | undefined;\n    /** A run of a node's entries. */\n    run(run: unknown): string;\n    /** A level. */\n    level(level: RecordTile): string;\n    /** A tile's start. */\n    tile(at: Date): string;\n    /** Entries, encoded as the binding's fill takes them. */\n    encode(entries: readonly Entry[]): Uint8Array;\n    /** An entry's key, as text: what names it among its run's entries. */\n    key(ik: unknown): string;\n    /** The prefix of the run an entry's key falls in: its place, its row, its path, its run and its level. */\n    prefixOf(ik: unknown): string;\n    /** An entry's value with its update applied, as e3 applies an index's patch. */\n    update(value: unknown, patch: unknown): unknown;\n}\n\n/** A path in the index's key, `end` or a `step` and the rest, from its names. */\nfunction pathValue(names: readonly string[]): unknown {\n    return names.reduceRight<unknown>((rest, key) => variant(\"step\", { key, rest }), variant(\"end\", null));\n}\n\n/** A value's leaves as a search's bounds flatten them: a struct's fields in order, recursed; any other value printed. */\nfunction leavesOf(type: EastType): (value: unknown) => string[] {\n    if (type.type === \"Struct\") {\n        const fields = Object.entries(type.fields as Record<string, EastType>).map(([name, field]) => [name, leavesOf(field)] as const);\n        return (value) => fields.flatMap(([name, leaves]) => leaves((value as Record<string, unknown>)[name]));\n    }\n    const print = printFor(type);\n    return (value) => [print(value as never)];\n}\n\nconst literalsOf = new WeakMap<object, Literals>();\n\n/** The literals of a binding's nested series index, made once for its entry type. */\nfunction literals(binding: IndexedBindingRead): Literals {\n    const nested = binding.nested!;\n    let made = literalsOf.get(nested.entry);\n    if (made !== undefined) return made;\n    const fields = (nested.entry.fields.ik as StructType).fields as Record<string, EastType>;\n    const printPath = printFor(fields[\"path\"]!);\n    const printRun = printFor(fields[\"run\"]!);\n    const printLevel = printFor(fields[\"level\"]!);\n    const printTile = printFor(fields[\"tile\"]!);\n    const keyLeaves = leavesOf(binding.key);\n    const parseKey = binding.key.type === \"String\" ? undefined : parseFor(binding.key);\n    const encode = encodeBeast2For(ArrayType(nested.entry)) as (entries: readonly Entry[]) => Uint8Array;\n    const printKey = printFor(nested.entry.fields.ik);\n    const apply = applyFor(nested.entry.fields.value) as (value: unknown, patch: unknown) => unknown;\n    made = {\n        path: (names) => printPath(pathValue(names) as never),\n        row: (id) => {\n            if (parseKey === undefined) return keyLeaves(id);\n            const read = parseKey(id);\n            return read.success ? keyLeaves(read.value) : undefined;\n        },\n        run: (run) => printRun(run as never),\n        level: (level) => printLevel(variant(level, null) as never),\n        tile: (at) => printTile(at as never),\n        encode,\n        key: (ik) => printKey(ik as never),\n        prefixOf: (ik) => {\n            const k = ik as { readonly collection: unknown; readonly row: unknown; readonly path: unknown; readonly run: unknown; readonly level: unknown };\n            return [printPath(k.collection as never), ...keyLeaves(k.row), printPath(k.path as never), printRun(k.run as never), printLevel(k.level as never)].join(\"\\u0001\");\n        },\n        update: apply,\n    };\n    literalsOf.set(nested.entry, made);\n    return made;\n}\n\n// ============================================================================\n// What a view wants\n// ============================================================================\n\n/** One run of a node's entries at one level, over a run of its tiles, and what it is read for. */\ninterface Cell {\n    /** The run's literals but its tiles': what names the tiles held of it. */\n    readonly prefix: string;\n    /** The same, as a search's bounds lead with them. */\n    readonly leading: readonly string[];\n    /** Its first tile's start. */\n    readonly from: Date;\n    /** The start of the tile after its last. */\n    readonly to: Date;\n    /** What it reads: a node's own items, a parent's subtree's, a parent's subtotals, or a node's or a subtree's totals. */\n    readonly kind: \"items\" | \"subtree\" | \"subtotals\" | \"totals\";\n    /** The collection's place, as its key prints it: what the cap counts by. */\n    readonly place: string;\n    /** The canvas's row it is read for. */\n    readonly row: PlanRowValue;\n    /** Which of the seam's uses it serves, by its place among them. */\n    readonly use: number;\n}\n\n/** What the reader reads over, as the canvas gives it. */\nexport interface PlanNestedArgs {\n    /** The seam. */\n    readonly seam: PlanNestedValue;\n    /** The canvas's rows the body lays out, in order: a folded row's children are none of them. */\n    readonly visible: readonly PlanRowValue[];\n    /** Every row the canvas holds, by key, with each one's children. */\n    readonly index: PlanRowIndex;\n    /** The rows in view, as the canvas reports them at rest; `undefined` before it does, for the first block. */\n    readonly view: PlanNestedView | undefined;\n    /** The range the canvas reads: its window and the periods laid out beyond it. */\n    readonly range: { readonly from: Date; readonly to: Date } | undefined;\n    /** The canvas's buckets over the range. */\n    readonly buckets: readonly ScheduleCellBucket[] | undefined;\n    /** The canvas's resolution. */\n    readonly resolution: PlanResolution | undefined;\n    /** Each drafted row's Save, previewed (#1437): what it changes in the index, put into what is held. */\n    readonly previews?: ReadonlyMap<string, PreviewedRow> | undefined;\n}\n\n/** The levels a subtotal is kept at: a tile's, from the index's tile up. */\nconst TILES: readonly RecordTile[] = [\"day\", \"week\", \"month\", \"quarter\", \"year\"];\n\n/** The level a parent's subtotals are read at: the resolution's, where the index keeps them there. */\nfunction subtotalLevel(resolution: PlanResolution | undefined, tile: RecordTile): RecordTile | undefined {\n    const level = TILES.find((candidate) => candidate === resolution);\n    return level === undefined || TILES.indexOf(level) < TILES.indexOf(tile) ? undefined : level;\n}\n\n/** Whether a row draws its children's subtotals: a heat or a table parent declaring an aggregate, or a group's strip. */\nfunction subtotals(row: PlanRowValue): boolean {\n    const kind = row.kind;\n    return (kind.type === \"heat\" && kind.value.aggregate.type === \"some\") || (kind.type === \"table\" && kind.value.aggregate.type === \"some\")\n        || (kind.type === \"group\" && kind.value.summary.type === \"aggregate\");\n}\n\n/** Whether a row rolls its children's runs up into bands: a span declaring a rollup. */\nconst rollsUp = (row: PlanRowValue): boolean => row.kind.type === \"span\" && row.kind.value.rollup.type === \"some\";\n\n/** How a parent row derives its numbers from its children's: its subtotals, or its subtree's runs rolled up into bands. */\ninterface Derives {\n    readonly subtotals: boolean;\n    readonly rollsUp: boolean;\n}\nconst DERIVES_NOTHING: Derives = { subtotals: false, rollsUp: false };\n\n/** The rows in view, as places among the rows laid out; the first block's before the canvas reports any. */\nfunction viewOf(view: PlanNestedView | undefined, visible: readonly PlanRowValue[]): { first: number; last: number } {\n    if (view === undefined) return { first: 0, last: 0 };\n    const first = visible.findIndex((row) => stringEqual(row.key, view.first));\n    const last = visible.findIndex((row) => stringEqual(row.key, view.last));\n    return first < 0 || last < first ? { first: 0, last: 0 } : { first, last };\n}\n\n/**\n * Every search a view wants (see the module docs): each row of the blocks\n * meeting it, each collection its series reads at each level it is filed at;\n * each parent's subtotals or subtree; and, past the cap, each row's totals.\n *\n * @param args - What the reader reads over\n * @param lit - The index's literals\n * @param capped - The places past the cap, as their key prints them: their rows read totals in place of items\n * @param derives - How a row derives its numbers from its children's: as it was drawn before the reader shaded it\n * @param summary - The summary tile, where it divides the canvas's bucket; `undefined` where none does\n * @returns The runs, each node's at a level once\n */\nfunction wantedCells(args: PlanNestedArgs, lit: Literals, capped: ReadonlySet<string>, summary: RecordTile | undefined,\n    derives: (row: PlanRowValue) => Derives): Cell[] {\n    const { seam, visible, index, range, resolution } = args;\n    if (range === undefined) return [];\n    const tile = seam.tile.type as RecordTile;\n    const runs = new Map(levelRuns(tile, range.from, range.to).map((run) => [run.level, run] as const));\n    const level = subtotalLevel(resolution, tile);\n    const subtotalRun = level === undefined ? undefined : summaryRun(level, range.from, range.to);\n    const totalsRun = summary === undefined ? undefined : summaryRun(summary, range.from, range.to);\n    const places = seam.uses.map((use) => lit.path(use.place));\n    const out = new Map<string, Cell>();\n    const add = (kind: Cell[\"kind\"], use: number, row: PlanRowValue, leaves: readonly string[], keys: readonly string[], run: unknown, at: RecordTile,\n        from: Date, to: Date) => {\n        const leading = [places[use]!, ...leaves, lit.path(keys), lit.run(run), lit.level(at)];\n        const prefix = leading.join(\"\\u0001\");\n        if (!out.has(prefix)) out.set(prefix, { prefix, leading, from, to, kind, place: places[use]!, row, use });\n    };\n    const view = viewOf(args.view, visible);\n    for (const block of wantedBlocks(view, visible.length)) {\n        for (let i = block * SCHEDULE_CELL_BLOCK; i < Math.min((block + 1) * SCHEDULE_CELL_BLOCK, visible.length); i++) {\n            const row = visible[i]!;\n            if (row.id.type !== \"entry\") continue;\n            const [id, ...keys] = row.id.value.path;\n            const leaves = id === undefined ? undefined : lit.row(id);\n            if (leaves === undefined) continue;\n            const series = row.id.value.series;\n            // Its own items, a level at a time — past the cap its totals.\n            seam.uses.forEach((use, u) => {\n                if (!stringEqual(use.series, series)) return;\n                if (capped.has(places[u]!)) {\n                    if (totalsRun !== undefined) add(\"totals\", u, row, leaves, keys, variant(\"totals\", null), summary!, totalsRun.from, totalsRun.to);\n                    return;\n                }\n                for (const at of use.levels) {\n                    const run = runs.get(at.type as RecordTile);\n                    if (run !== undefined) add(\"items\", u, row, leaves, keys, variant(\"items\", null), run.level, run.from, run.to);\n                }\n            });\n            // As a parent whose row derives its numbers from its children's: its subtotals, or its subtree's items — past the\n            // cap its subtree's totals.\n            const children = index.children.get(row.key) ?? [];\n            const beneath = new Set(children.flatMap((child) => (child.id.type === \"entry\" ? [child.id.value.series] : [])));\n            seam.uses.forEach((use, u) => {\n                if (use.parents.type !== \"some\" || ![...beneath].some((s) => stringEqual(s, use.series))) return;\n                const parents = use.parents.value;\n                const how = derives(row);\n                if (!(parents.type === \"subtotals\" ? how.subtotals : how.rollsUp)) return;\n                if (parents.type === \"subtotals\") {\n                    if (level !== undefined && subtotalRun !== undefined) {\n                        add(\"subtotals\", u, row, leaves, keys, variant(\"subtotals\", parents.value), level, subtotalRun.from, subtotalRun.to);\n                    }\n                    return;\n                }\n                if (capped.has(places[u]!)) {\n                    if (totalsRun !== undefined) add(\"totals\", u, row, leaves, keys, variant(\"subtreeTotals\", null), summary!, totalsRun.from, totalsRun.to);\n                    return;\n                }\n                for (const at of use.levels) {\n                    const run = runs.get(at.type as RecordTile);\n                    if (run !== undefined) add(\"subtree\", u, row, leaves, keys, variant(\"subtree\", null), run.level, run.from, run.to);\n                }\n            });\n        }\n    }\n    return [...out.values()];\n}\n\n// ============================================================================\n// The reader\n// ============================================================================\n\n/** A read whose counts or entries are still in flight: the rows waiting on it, by their keys. */\ninterface Waiting {\n    readonly waiting: ReadonlySet<string>;\n}\n\n/** No row waiting on a read. */\nconst NOTHING_WAITING: ReadonlySet<string> = new Set();\n\n/** The rows of some runs not held, waiting on their read. */\nconst waitingOn = (cells: readonly Cell[]): Waiting => ({ waiting: new Set(cells.map((cell) => cell.row.key)) });\n\n/** Whether a read is in flight. */\nconst isWaiting = (read: Read | Waiting): read is Waiting => \"waiting\" in read;\n\n/** What a read lands: what the canvas draws. */\ninterface Read {\n    readonly cells: Uint8Array;\n    readonly shading: PlanNestedShadingValue;\n    readonly parents: PlanParentSubtotals;\n    readonly notices: readonly PlanNestedNotice[];\n}\n\n/** The tiles held of a run: their span, and their entries. */\ninterface Span {\n    /** Its first tile's start, in ms. */\n    readonly from: number;\n    /** The start of the tile after its last, in ms. */\n    readonly to: number;\n    /** The entries of its tiles. */\n    readonly entries: readonly Entry[];\n}\n\n/** A part of a run whose tiles are not held: what it searches, and its bounds in the index once counted. */\ninterface Part {\n    /** Its text: the run's prefix and its tiles' bounds. */\n    readonly text: string;\n    /** The run it is part of. */\n    readonly cell: Cell;\n    /** The search. */\n    readonly query: SeekQuery;\n}\n\nconst compareString = compareFor(StringType);\nconst printPathText = printFor(ArrayType(StringType));\nconst shadingEqual = equalFor(PlanNestedShadingType);\nconst blobEqual = equalFor(BlobType);\nconst instantEqual = equalFor(Plan.Types.Instant);\n\n/** Whether two answers' subtotals are the same: each parent's, each collection's, each bucket's. */\nfunction sameParents(a: PlanParentSubtotals, b: PlanParentSubtotals): boolean {\n    if (a.size !== b.size) return false;\n    for (const [key, series] of a) {\n        const other = b.get(key);\n        if (other === undefined || other.length !== series.length) return false;\n        for (let i = 0; i < series.length; i++) {\n            const x = series[i]!;\n            const y = other[i]!;\n            if (x.length !== y.length || x.some((s, j) => !instantEqual(s.at, y[j]!.at) || !Object.is(s.value, y[j]!.value))) return false;\n        }\n    }\n    return true;\n}\n\n/** Whether two places are one: the same names, in order. */\nconst samePlace = (a: readonly string[], b: readonly string[]): boolean => a.length === b.length && a.every((name, i) => stringEqual(name, b[i]!));\n\n/** Whether two reads draw the same. */\nfunction sameRead(a: Read, b: Read): boolean {\n    return blobEqual(a.cells, b.cells) && shadingEqual(a.shading, b.shading) && sameParents(a.parents, b.parents)\n        && a.notices.length === b.notices.length && a.notices.every((n, i) => n.items === b.notices[i]!.items && samePlace(n.place, b.notices[i]!.place));\n}\n\n/** A tile's totals, as numbers: how many items touch it, the ms of it they cover, and their values' sum, least, greatest and last. */\ninterface Totals {\n    readonly count: number;\n    readonly ms: number;\n    readonly values: { readonly sum: number; readonly min: number; readonly max: number; readonly last: number } | undefined;\n}\n\n/**\n * One row's shading over the buckets: the totals of the summary tiles inside\n * each bucket — a tile that divides the bucket lies wholly inside it — as the\n * share booked, how many items touch it, or their values folded.\n */\nfunction shadesOf(tiles: ReadonlyMap<number, Totals>, buckets: readonly ScheduleCellBucket[], shade: Use[\"shade\"]): Shade[] {\n    return buckets.map(({ start, end }): Shade => {\n        let count = 0;\n        let ms = 0;\n        let sum = 0;\n        let min = Infinity;\n        let max = -Infinity;\n        let last: number | undefined;\n        let lastAt = -Infinity;\n        for (const [at, t] of tiles) {\n            if (at < start || at >= end) continue;\n            count += t.count;\n            ms += t.ms;\n            if (t.values !== undefined) {\n                sum += t.values.sum;\n                min = Math.min(min, t.values.min);\n                max = Math.max(max, t.values.max);\n                if (at > lastAt) { lastAt = at; last = t.values.last; }\n            }\n        }\n        if (shade.type === \"booked\") return { at: new Date(start), value: some(Math.min(1, ms / (end - start))) };\n        if (shade.type === \"count\") return { at: new Date(start), value: some(count) };\n        if (count === 0) return { at: new Date(start), value: none };\n        const fold = shade.value.type;\n        const value = fold === \"count\" ? count : fold === \"sum\" ? sum : fold === \"mean\" ? sum / count : fold === \"min\" ? min : fold === \"max\" ? max : last;\n        return { at: new Date(start), value: value === undefined || !Number.isFinite(value) ? none : some(value) };\n    });\n}\n\n/** The no-data hatch over the buckets: a row past the cap that no totals shade at this resolution. */\nfunction hatchOf(buckets: readonly ScheduleCellBucket[]): Shade[] {\n    return buckets.map(({ start }) => ({ at: new Date(start), value: none }));\n}\n\n/** A tile's start out of an entry's key. */\nconst tileOf = (entry: Entry): Date => (entry.ik as { readonly tile: Date }).tile;\n\n/** One previewed change of an entry: its key, and its op — an `insert` of its value, a `delete`, an `update` by its value's patch. */\ninterface Change {\n    readonly ik: unknown;\n    readonly op: { readonly type: string; readonly value: unknown };\n}\n\n/**\n * Every previewed drafted row's changes to the nested series index, by the\n * run each falls in and the entry's key; none for a row still read, or one\n * whose change does not apply.\n */\nfunction previewedChanges(previews: ReadonlyMap<string, PreviewedRow> | undefined, index: string, lit: Literals): ReadonlyMap<string, ReadonlyMap<string, Change>> {\n    const out = new Map<string, Map<string, Change>>();\n    for (const row of previews?.values() ?? []) {\n        if (row.state !== \"previewed\") continue;\n        // Each change is keyed as the index keys its entries: the nested key, beside the row's own key.\n        for (const [key, op] of row.changes.get(index) ?? []) {\n            const ik = (key as { readonly ik: unknown }).ik;\n            const prefix = lit.prefixOf(ik);\n            let ops = out.get(prefix);\n            if (ops === undefined) { ops = new Map(); out.set(prefix, ops); }\n            ops.set(lit.key(ik), { ik, op: op as Change[\"op\"] });\n        }\n    }\n    return out;\n}\n\n/** A run's entries with its previewed changes in place, over the tiles it holds. */\nfunction withChanges(entries: readonly Entry[], ops: ReadonlyMap<string, Change>, cell: Cell, lit: Literals): Entry[] {\n    const from = cell.from.getTime();\n    const to = cell.to.getTime();\n    const byKey = new Map(entries.map((entry) => [lit.key(entry.ik), entry] as const));\n    for (const [key, { ik, op }] of ops) {\n        const at = tileOf({ ik, value: null }).getTime();\n        if (op.type === \"delete\") byKey.delete(key);\n        else if (op.type === \"insert\") { if (at >= from && at < to) byKey.set(key, { ik, value: op.value }); }\n        else if (op.type === \"update\") {\n            const was = byKey.get(key);\n            if (was !== undefined) byKey.set(key, { ik, value: lit.update(was.value, op.value) });\n        }\n    }\n    return [...byKey.values()];\n}\n\n/**\n * The reader's state across reads: the tiles it holds of each run at a\n * revision, the bounds of the parts it has counted and not yet read, and the\n * last cells it encoded.\n */\nclass NestedCellsReader {\n    /**\n     * The tiles held of each run, by its prefix, at a revision; each part's\n     * bounds counted and its entries once read; and the batches of searches and\n     * of reads in flight, each asked again until it lands, so a part is asked\n     * in one batch however the wanted runs move meanwhile.\n     */\n    private held: {\n        revision: string; spans: Map<string, Span>; found: Map<string, Range>; read: Map<string, readonly Entry[]>;\n        counting: Part[][]; reading: Part[][];\n    } | undefined;\n    /** The last cells encoded, and the entries and previews they were made from. */\n    private encoded: { from: readonly (readonly Entry[])[]; previews: PlanNestedArgs[\"previews\"]; bytes: Uint8Array } | undefined;\n    /**\n     * How each row derives its numbers from its children's, as it was last\n     * drawn unshaded, by its key; and the rows the last read shaded. A row the\n     * reader shades is drawn as heat, so what it reads for the row as a parent\n     * — its subtree past the cap, its subtotals — is decided by what the row\n     * was before it shaded: else it would read less, fall under the cap, and\n     * shade no longer, over and over.\n     */\n    private derived = new Map<string, Derives>();\n    private shadedRows: ReadonlySet<string> = new Set();\n\n    /** How a row derives its numbers from its children's: as drawn, or, while this reader shades it, as it was. */\n    private derivesOf = (row: PlanRowValue): Derives => {\n        if (this.shadedRows.has(row.key)) return this.derived.get(row.key) ?? DERIVES_NOTHING;\n        const how = { subtotals: subtotals(row), rollsUp: rollsUp(row) };\n        this.derived.set(row.key, how);\n        return how;\n    };\n\n    /**\n     * What the view wants, read: every part of a run whose tiles are not\n     * held, counted in one request and read in one more, then — the places\n     * past the cap found — their rows' totals, the same way.\n     *\n     * @param args - What the reader reads over\n     * @returns What the canvas draws; while a revision, a count or a read is in flight, the rows waiting on it\n     * @throws {Error} When no runtime here built the binding the seam names, or it lists no nested series index\n     */\n    read(args: PlanNestedArgs): Read | Waiting {\n        const binding = indexedBindingOf(args.seam.source);\n        if (binding?.nested === undefined) {\n            throw new Error(`The Plan's rows are read through '${args.seam.source}', which no indexed runtime here built with a nested series index`);\n        }\n        const lit = literals(binding);\n        const revision = binding.handle.revision();\n        if (revision.type !== \"some\") return waitingOn(wantedCells(args, lit, new Set(), undefined, this.derivesOf));\n        if (this.held === undefined || !stringEqual(this.held.revision, revision.value)) {\n            this.held = { revision: revision.value, spans: new Map(), found: new Map(), read: new Map(), counting: [], reading: [] };\n        }\n        const index = binding.nested.index;\n        const summaryTile = args.seam.summary.type === \"some\" ? args.seam.summary.value.type as RecordTile : undefined;\n        const summary = summaryTile !== undefined && dividingTiles(args.resolution).includes(summaryTile) ? summaryTile : undefined;\n        // The runs wanted, their parts not held counted; then the places past the cap, whose rows read their totals instead.\n        const first = wantedCells(args, lit, new Set(), undefined, this.derivesOf);\n        const firstParts = this.partsOf(first, lit);\n        if (!this.counted(binding, index, firstParts)) return waitingOn(firstParts.map((part) => part.cell));\n        const items = new Map<string, number>();\n        for (const cell of first) {\n            if (cell.kind !== \"items\" && cell.kind !== \"subtree\") continue;\n            items.set(cell.place, (items.get(cell.place) ?? 0) + this.countOf(cell, firstParts));\n        }\n        const capped = new Set([...items].filter(([, n]) => n > SCHEDULE_EVENT_CAP).map(([place]) => place));\n        const wanted = capped.size === 0 ? first : wantedCells(args, lit, capped, summary, this.derivesOf);\n        const parts = capped.size === 0 ? firstParts : this.partsOf(wanted, lit);\n        if (!this.counted(binding, index, parts)) return waitingOn(parts.map((part) => part.cell));\n        // Every part's entries not held, in one request: their runs in the index's order, which a read of runs asks.\n        const read = this.held.read;\n        if (!this.entries(binding, index, parts)) return waitingOn(parts.filter((part) => !read.has(part.text)).map((part) => part.cell));\n        // Each run's tiles held now: those it held in its span, and its parts' — and nothing else.\n        const spans = this.held.spans;\n        const byCell = new Map<string, Part[]>();\n        for (const part of parts) {\n            const list = byCell.get(part.cell.prefix);\n            if (list === undefined) byCell.set(part.cell.prefix, [part]); else list.push(part);\n        }\n        for (const cell of wanted) {\n            const from = cell.from.getTime();\n            const to = cell.to.getTime();\n            const span = spans.get(cell.prefix);\n            const kept = span === undefined ? [] : span.entries.filter((entry) => { const t = tileOf(entry).getTime(); return t >= from && t < to; });\n            const added = (byCell.get(cell.prefix) ?? []).flatMap((part) => read.get(part.text) ?? []);\n            spans.set(cell.prefix, { from, to, entries: added.length === 0 && span !== undefined && span.from === from && span.to === to ? span.entries : [...kept, ...added] });\n        }\n        // Every run no longer wanted let go, and every part counted and read, held now.\n        const prefixes = new Set(wanted.map((cell) => cell.prefix));\n        for (const prefix of [...spans.keys()]) if (!prefixes.has(prefix)) spans.delete(prefix);\n        for (const part of parts) {\n            this.held.found.delete(part.text);\n            read.delete(part.text);\n        }\n        return this.drawn(args, wanted, spans, capped, items, summary);\n    }\n\n    /**\n     * The parts of each run whose tiles are not held: before its span held,\n     * and after it — the whole run where none of it is.\n     */\n    private partsOf(cells: readonly Cell[], lit: Literals): Part[] {\n        const spans = this.held!.spans;\n        const parts: Part[] = [];\n        for (const cell of cells) {\n            const from = cell.from.getTime();\n            const to = cell.to.getTime();\n            const span = spans.get(cell.prefix);\n            const pieces: [number, number][] = span === undefined || span.to <= from || span.from >= to ? [[from, to]]\n                : [...(from < span.from ? [[from, span.from] as [number, number]] : []), ...(to > span.to ? [[span.to, to] as [number, number]] : [])];\n            for (const [low, high] of pieces) {\n                const a = lit.tile(new Date(low));\n                const b = lit.tile(new Date(high));\n                parts.push({ text: `${cell.prefix}\\u0002${a}\\u0002${b}`, cell, query: variant(\"range\", { from: [...cell.leading, a], to: [...cell.leading, b] }) });\n            }\n        }\n        return parts;\n    }\n\n    /**\n     * Every part counted: each batch in flight holding one asked again, and\n     * the parts in none counted in one more request.\n     *\n     * @returns Whether every part is counted; `false` while a count is in flight\n     */\n    private counted(binding: IndexedBindingRead, index: string, parts: readonly Part[]): boolean {\n        const held = this.held!;\n        const found = held.found;\n        return this.asked(parts, (part) => found.has(part.text), held.counting, (batch) => {\n            const answer = binding.batches.seekAll(index, batch.map((part) => part.query));\n            if (answer.type !== \"some\") return false;\n            batch.forEach((part, i) => found.set(part.text, answer.value[i]!));\n            return true;\n        });\n    }\n\n    /**\n     * Every counted part's entries read: each batch in flight holding one\n     * asked again, and the parts in none read in one more request, their runs\n     * in the index's order.\n     *\n     * @returns Whether every part's entries are read; `false` while a read is in flight\n     */\n    private entries(binding: IndexedBindingRead, index: string, parts: readonly Part[]): boolean {\n        const held = this.held!;\n        const { found, read } = held;\n        const counted = parts.filter((part) => {\n            if (found.get(part.text)!.count > 0n) return true;\n            read.set(part.text, []);\n            return false;\n        }).sort((a, b) => Number(found.get(a.text)!.row - found.get(b.text)!.row));\n        return this.asked(counted, (part) => read.has(part.text), held.reading, (batch) => {\n            const runs = binding.batches.runsAll(index, batch.map((part) => found.get(part.text)!));\n            if (runs.type !== \"some\") return false;\n            let at = 0;\n            for (const part of batch) {\n                const n = Number(found.get(part.text)!.count);\n                read.set(part.text, (runs.value.slice(at, at + n) as { ik: { value: unknown }; value: option<unknown> }[])\n                    .map((entry): Entry => ({ ik: entry.ik.value, value: entry.value.type === \"some\" ? entry.value.value : null })));\n                at += n;\n            }\n            return true;\n        });\n    }\n\n    /**\n     * Some parts asked of e3 in batches: each batch in flight holding a part\n     * not yet answered asked again, the parts in none asked in a batch of their\n     * own, and the batches that land let go.\n     *\n     * @param parts - The parts wanted\n     * @param answered - Whether a part is answered\n     * @param inFlight - The batches in flight, which this keeps\n     * @param ask - Asks a batch: whether it landed, its answers kept\n     * @returns Whether every part is answered\n     */\n    private asked(parts: readonly Part[], answered: (part: Part) => boolean, inFlight: Part[][], ask: (batch: readonly Part[]) => boolean): boolean {\n        const missing = new Set(parts.filter((part) => !answered(part)).map((part) => part.text));\n        if (missing.size === 0) return true;\n        let complete = true;\n        const asking = new Set<string>();\n        for (const batch of [...inFlight]) {\n            if (!batch.some((part) => missing.has(part.text))) continue;\n            if (ask(batch)) inFlight.splice(inFlight.indexOf(batch), 1);\n            else { complete = false; for (const part of batch) asking.add(part.text); }\n        }\n        const fresh = parts.filter((part) => missing.has(part.text) && !answered(part) && !asking.has(part.text));\n        if (fresh.length > 0 && !ask(fresh)) {\n            inFlight.push(fresh);\n            complete = false;\n        }\n        return complete;\n    }\n\n    /** How many entries a run holds over its tiles: those held of them, and its parts' counted. */\n    private countOf(cell: Cell, parts: readonly Part[]): number {\n        const from = cell.from.getTime();\n        const to = cell.to.getTime();\n        const span = this.held!.spans.get(cell.prefix);\n        let n = span === undefined ? 0 : span.entries.filter((entry) => { const t = tileOf(entry).getTime(); return t >= from && t < to; }).length;\n        for (const part of parts) if (part.cell === cell) n += Number(this.held!.found.get(part.text)!.count);\n        return n;\n    }\n\n    /** What the cells held draw: the items encoded, the parents' subtotals, and the rows past the cap shaded or hatched. */\n    private drawn(args: PlanNestedArgs, cells: readonly Cell[], held: ReadonlyMap<string, Span>, capped: ReadonlySet<string>,\n        items: ReadonlyMap<string, number>, summary: RecordTile | undefined): Read {\n        const binding = indexedBindingOf(args.seam.source)!;\n        const lit = literals(binding);\n        // Each drafted row's Save, previewed (#1437), put into what is held: an entry's insert or update where a held run's\n        // tiles hold it, its delete dropping it — so every number e3 keeps draws with the drafts in place.\n        const changes = previewedChanges(args.previews, binding.nested!.index, lit);\n        const entriesOf = (cell: Cell): readonly Entry[] => {\n            const entries = held.get(cell.prefix)!.entries;\n            const ops = changes.get(cell.prefix);\n            return ops === undefined ? entries : withChanges(entries, ops, cell, lit);\n        };\n        // The items, each cell's entries in the order wanted; the fill keeps an item filed in several tiles once.\n        const itemCells = cells.filter((cell) => cell.kind === \"items\" || cell.kind === \"subtree\");\n        const from = itemCells.map((cell) => held.get(cell.prefix)!.entries);\n        const last = this.encoded;\n        const bytes = last !== undefined && Object.is(last.previews, args.previews) && last.from.length === from.length\n            && last.from.every((part, i) => Object.is(part, from[i])) ? last.bytes : lit.encode(itemCells.flatMap(entriesOf));\n        this.encoded = { from, previews: args.previews, bytes };\n        // Each parent's subtotals: a series a use, in the uses' order.\n        const byRow = new Map<string, Map<number, PlanParentSubtotal[]>>();\n        for (const cell of cells) {\n            if (cell.kind !== \"subtotals\") continue;\n            let uses = byRow.get(cell.row.key);\n            if (uses === undefined) { uses = new Map(); byRow.set(cell.row.key, uses); }\n            uses.set(cell.use, entriesOf(cell).map((entry): PlanParentSubtotal => ({\n                at: variant(\"time\", tileOf(entry)) as PlanParentSubtotal[\"at\"],\n                value: (entry.value as { readonly value: number }).value,\n            })));\n        }\n        const parents: PlanParentSubtotals = new Map([...byRow].map(([key, uses]) => [key, [...uses].sort(([a], [b]) => a - b).map(([, series]) => series)] as const));\n        // The rows past the cap: their totals at the summary tile, or the hatch where none divides the bucket.\n        const shades = new Map<string, Map<string, Map<number, Totals>>>();\n        const series = new Map<string, Use>();\n        for (const cell of cells) {\n            if (cell.kind !== \"totals\" || cell.row.id.type !== \"entry\") continue;\n            const use = args.seam.uses[cell.use]!;\n            const key = cell.row.id.value.series;\n            series.set(key, use);\n            let rows = shades.get(key);\n            if (rows === undefined) { rows = new Map(); shades.set(key, rows); }\n            const path = printPathText(cell.row.id.value.path);\n            let tiles = rows.get(path);\n            if (tiles === undefined) { tiles = new Map(); rows.set(path, tiles); }\n            for (const entry of entriesOf(cell)) {\n                const totals = (entry.value as { readonly value: { count: bigint; ms: bigint; values: option<Totals[\"values\"] & object> } }).value;\n                const at = tileOf(entry).getTime();\n                const was = tiles.get(at);\n                const values = totals.values.type === \"some\" ? totals.values.value : undefined;\n                tiles.set(at, {\n                    count: (was?.count ?? 0) + Number(totals.count), ms: (was?.ms ?? 0) + Number(totals.ms),\n                    values: values === undefined ? was?.values : was?.values === undefined ? values\n                        : { sum: was.values.sum + values.sum, min: Math.min(was.values.min, values.min), max: Math.max(was.values.max, values.max), last: values.last },\n                });\n            }\n        }\n        const buckets = args.buckets ?? [];\n        const shading = new SortedMap<string, SortedMap<string, Shade[]>>([], compareString);\n        for (const [key, rows] of shades) {\n            const use = series.get(key)!;\n            shading.set(key, new SortedMap([...rows].map(([path, tiles]) => [path, shadesOf(tiles, buckets, use.shade)] as const), compareString));\n        }\n        // A place past the cap no summary shades: its rows hatched, and the notice.\n        const notices: PlanNestedNotice[] = [];\n        if (summary === undefined && capped.size > 0) {\n            for (const use of args.seam.uses) {\n                const place = lit.path(use.place);\n                if (!capped.has(place) || notices.some((n) => samePlace(n.place, use.place))) continue;\n                notices.push({ place: use.place, items: items.get(place) ?? 0 });\n                const rows = shading.get(use.series) ?? new SortedMap<string, Shade[]>([], compareString);\n                for (const row of args.visible) {\n                    if (row.id.type === \"entry\" && stringEqual(row.id.value.series, use.series)) rows.set(printPathText(row.id.value.path), hatchOf(buckets));\n                }\n                shading.set(use.series, rows);\n            }\n        }\n        // The rows shaded now: their totals read, or hatched.\n        const shadedRows = new Set(cells.flatMap((cell) => (cell.kind === \"totals\" ? [cell.row.key] : [])));\n        for (const notice of notices) {\n            for (const row of args.visible) {\n                if (row.id.type === \"entry\" && args.seam.uses.some((use) => samePlace(use.place, notice.place) && stringEqual(use.series, row.id.value.series))) shadedRows.add(row.key);\n            }\n        }\n        this.shadedRows = shadedRows;\n        return { cells: bytes, shading: shading as unknown as PlanNestedShadingValue, parents, notices };\n    }\n}\n\n/** What the reader hands on: what it read, and the rows waiting on a read in flight. */\nexport interface PlanNestedCells {\n    /** What it read; `undefined` before the first read lands. */\n    readonly lead: PlanNestedLead | undefined;\n    /** The rows waiting on a read in flight, by their keys: the same set while they are the same rows. */\n    readonly waiting: ReadonlySet<string>;\n}\n\n/**\n * The rows' collections, read a cell at a time (see the module docs), in a\n * tracked evaluation: a search that lands reads again. A read in flight\n * leaves the last standing, and says which rows wait on it; one that throws\n * leaves it too, and says why.\n *\n * @param args - What it reads over\n * @returns What it read, and the rows waiting on a read in flight\n */\nexport function usePlanNestedCells(args: PlanNestedArgs): PlanNestedCells {\n    const [reader] = useState(() => new NestedCellsReader());\n    const { seam, visible, index, view, range, buckets, resolution, previews } = args;\n    const from = range?.from.getTime();\n    const to = range?.to.getTime();\n    const read = useCallback(() => reader.read({\n        seam, visible, index, view, buckets, resolution, previews,\n        range: from === undefined || to === undefined ? undefined : { from: new Date(from), to: new Date(to) },\n    }), [reader, seam, visible, index, view, buckets, resolution, previews, from, to]);\n    const { result } = useTrackedEvaluation(read);\n    const last = useRef<{ read: Read; lead: PlanNestedLead } | undefined>(undefined);\n    const waited = useRef(NOTHING_WAITING);\n    return useMemo((): PlanNestedCells => {\n        if (!result.ok) console.error(\"[Plan] the rows' nested series could not be read:\", result.error);\n        const pending = result.ok && isWaiting(result.value) ? result.value.waiting : NOTHING_WAITING;\n        // The rows waiting kept as they were while they are the same rows, so the canvas washes them once.\n        const waiting = pending.size === waited.current.size && [...pending].every((key) => waited.current.has(key)) ? waited.current : pending;\n        waited.current = waiting;\n        const was = last.current;\n        if (!result.ok || isWaiting(result.value)) {\n            return { lead: was === undefined ? undefined : was.lead.reading ? was.lead : { ...was.lead, reading: true }, waiting };\n        }\n        const next = result.value;\n        if (was !== undefined && sameRead(was.read, next)) {\n            if (!was.lead.reading) return { lead: was.lead, waiting };\n            const lead = { ...was.lead, reading: false };\n            last.current = { read: was.read, lead };\n            return { lead, waiting };\n        }\n        const lead: PlanNestedLead = { ...next, version: (was?.lead.version ?? 0) + 1, reading: false };\n        last.current = { read: next, lead };\n        return { lead, waiting };\n    }, [result]);\n}\n\n/** Props of {@link PlanNestedReader}. */\nexport interface PlanNestedReaderProps {\n    /** The seam. */\n    seam: PlanNestedValue;\n    /** The canvas's rows the body lays out, in order. */\n    visible: readonly PlanRowValue[];\n    /** Every row the canvas holds. */\n    index: PlanRowIndex;\n    /** The shared scale. */\n    scale: PlanScale | undefined;\n    /** The rows in view, as the canvas reports them at rest. */\n    views: PlanNestedViewStore;\n    /** The canvas's editing session, when it edits: each drafted row's Save previewed in what is read (#1437). */\n    session?: (RecordDraftsSession & Pick<EditSession<unknown>, \"subscribe\" | \"getSnapshot\">) | undefined;\n    /** Where what it read goes: called only when it moves. */\n    onLead: (lead: PlanNestedLead | undefined) => void;\n    /** Where the rows waiting on a read in flight go, by their keys: called only when they move, and with none as it unmounts. */\n    onWaiting: (rows: ReadonlySet<string>) => void;\n    /** Where the span of the collections the series shown read, and their months' counts, go (#1438): called only when they move. */\n    onSpan: (span: PlanNestedSpanRead | typeof SPAN_READING | undefined) => void;\n}\n\n/**\n * The rows' collections, read in a component of its own: each search that\n * lands re-runs it alone, and it hands the canvas what it read, and the rows\n * waiting on a read in flight, only when they move.\n *\n * @param props - What it reads over, and where it goes\n * @returns Nothing: it reads\n */\nexport function PlanNestedReader({ seam, visible, index, scale, views, session, onLead, onWaiting, onSpan }: PlanNestedReaderProps): null {\n    const view = useSyncExternalStore(views.subscribe, views.get);\n    const range = useMemo(() => eventReadRange(scale), [scale]);\n    const buckets = useMemo(() => (scale === undefined || range === undefined ? undefined : bucketsOver(scale, range.from, range.to)), [scale, range]);\n    const handle = indexedBindingOf(seam.source)?.handle;\n    const previews = useRecordDrafts(session === undefined ? undefined : handle, session);\n    const { lead, waiting } = usePlanNestedCells({ seam, visible, index, view, range, buckets, resolution: scale?.resolution, previews });\n    const reported = useRef<PlanNestedCells>({ lead: undefined, waiting: NOTHING_WAITING });\n    useLayoutEffect(() => {\n        const was = reported.current;\n        if (was.lead === lead && was.waiting === waiting) return;\n        reported.current = { lead, waiting };\n        if (was.lead !== lead) onLead(lead);\n        if (was.waiting !== waiting) onWaiting(waiting);\n    });\n    // Gone, no row waits on it.\n    useLayoutEffect(() => () => onWaiting(NOTHING_WAITING), [onWaiting]);\n    // The span of what the series shown read, apart: it moves with the series and a commit, never with the view.\n    const span = usePlanNestedSpan(seam, index);\n    useLayoutEffect(() => { onSpan(span); }, [span, onSpan]);\n    return null;\n}\n\n// ============================================================================\n// The span of what the series read\n// ============================================================================\n\n/** The span of the collections a Plan's series read (#1438): `[from, to)`, in ms. */\nexport type PlanNestedSpan = readonly [number, number];\n\n/**\n * How much the collections a Plan's series read hold in each month (#1438),\n * as e3 keeps it in the index's span: each month's start, in ms, and the items\n * and values touching it across the rows, in order — what the horizon's bars\n * count.\n */\nexport type PlanNestedMonths = readonly (readonly [number, number])[];\n\n/**\n * The span's read (#1438): the span of what every series reads — the horizon,\n * whichever are shown (#1440) — and the months' counts of what the series\n * shown read.\n */\nexport interface PlanNestedSpanRead {\n    /** `[from, to)`, in ms: from the first month any collection of any series touches to the end of the last. */\n    readonly span: PlanNestedSpan;\n    /** Each month's count across the series shown, in order: none while none is shown. */\n    readonly months: PlanNestedMonths;\n}\n\n/** A span whose read is in flight. */\nexport const SPAN_READING = \"reading\";\n\n/** An entry of a nested series index's span, as a read of its runs gives it: its month, and its totals. */\ntype SpanEntry = { readonly ik: { readonly value: { readonly tile: Date } }; readonly value: option<{ readonly count: bigint }> };\n\n/** A collection's place, printed as its key. */\nconst placeKey = (place: readonly string[]): string => place.join(\"\\u0001\");\n\n/**\n * Each collection's months, as the index's span keeps them (#1438): its\n * months across the record's rows — one batch of searches, each an exact\n * match on a collection's place, and one read of their entries, each\n * collection's the next of them in the window that read answers.\n *\n * @param binding - The binding the rows are read through\n * @param places - The collections' places, each by its field names from the row down\n * @returns Each collection holding an item's months, by its place's key; {@link SPAN_READING} while a read is in flight; undefined where none holds one\n */\nfunction spanOf(binding: IndexedBindingRead, places: readonly (readonly string[])[]): ReadonlyMap<string, PlanNestedMonths> | typeof SPAN_READING | undefined {\n    if (places.length === 0) return undefined;\n    const name = nestedSpanName(binding.nested!.index);\n    const lit = literals(binding);\n    const found = binding.batches.seekAll(name, places.map((place) => variant(\"fields\", { values: [lit.path(place)], prefix: none })));\n    if (found.type !== \"some\") return SPAN_READING;\n    // Each collection's months, in the index's order, as a read of runs asks: ascending and disjoint.\n    const held = found.value.map((range, i) => ({ range, key: placeKey(places[i]!) }))\n        .filter(({ range }) => range.count > 0n)\n        .sort((a, b) => (a.range.row < b.range.row ? -1 : a.range.row > b.range.row ? 1 : 0));\n    if (held.length === 0) return undefined;\n    const read = binding.batches.runsAll(name, held.map(({ range }) => ({ found: true, row: range.row, count: range.count })));\n    if (read.type !== \"some\") return SPAN_READING;\n    const entries = read.value as readonly SpanEntry[];\n    const byPlace = new Map<string, PlanNestedMonths>();\n    let at = 0;\n    for (const { range, key } of held) {\n        const n = Number(range.count);\n        byPlace.set(key, entries.slice(at, at + n).map((entry) => [entry.ik.value.tile.getTime(), entry.value.type === \"some\" ? Number(entry.value.value.count) : 0] as const));\n        at += n;\n    }\n    return byPlace;\n}\n\n/**\n * The span of every collection, and the months' counts of those shown (#1438,\n * #1440): from the first month any touches to the end of the last, and each\n * month's count summed across the shown ones' places.\n *\n * @param byPlace - Each collection's months, by its place's key\n * @param shown - The keys of the places the series shown read\n * @returns The span's read; undefined where no collection holds an item\n */\nfunction spanRead(byPlace: ReadonlyMap<string, PlanNestedMonths>, shown: ReadonlySet<string>): PlanNestedSpanRead | undefined {\n    let first = Infinity;\n    let last = -Infinity;\n    const counts = new Map<number, number>();\n    for (const [key, months] of byPlace) {\n        for (const [at, n] of months) {\n            first = Math.min(first, at);\n            last = Math.max(last, at);\n            if (shown.has(key)) counts.set(at, (counts.get(at) ?? 0) + n);\n        }\n    }\n    if (!Number.isFinite(first)) return undefined;\n    return { span: [first, tileNext(\"month\", new Date(last)).getTime()], months: [...counts].sort((a, b) => a[0] - b[0]) };\n}\n\n/** Whether two reads of a span say the same: its ends, and each month's count. */\nfunction sameSpanRead(a: PlanNestedSpanRead, b: PlanNestedSpanRead): boolean {\n    return a.span[0] === b.span[0] && a.span[1] === b.span[1] && a.months.length === b.months.length\n        && a.months.every(([at, n], i) => at === b.months[i]![0] && n === b.months[i]![1]);\n}\n\n/**\n * The span of what every series the canvas lays out reads — the horizon,\n * whichever are shown — and the months' counts of what the series shown read\n * (#1438, #1440), read again at each revision. Every series' collections are\n * read once, so switching a series asks nothing: its collections leave the\n * bars, and with none shown the strip still spans what they hold, its bars\n * empty, where it once fell back to the window alone and moved with every\n * drag. While a read again is in flight it is the last read, so the horizon\n * and its bars hold still until the new counts land.\n *\n * @param seam - The root's seam\n * @param index - Every row the canvas holds: its rows' series are the ones shown\n * @returns The span and its months; {@link SPAN_READING} while the first read is in flight; undefined where no collection holds an item\n */\nexport function usePlanNestedSpan(seam: PlanNestedValue, index: PlanRowIndex): PlanNestedSpanRead | typeof SPAN_READING | undefined {\n    // Every place a series reads: one read for them all, whichever series are shown.\n    const places = useMemo(() => {\n        const out = new Map<string, readonly string[]>();\n        for (const use of seam.uses) out.set(placeKey(use.place), use.place);\n        return [...out.values()];\n    }, [seam]);\n    // The places the shown series read, printed as their key: what the bars count.\n    const shownKey = useMemo(() => {\n        const series = new Set<string>();\n        for (const row of index.byKey.values()) if (row.id.type === \"entry\") series.add(row.id.value.series);\n        // In the uses' own order, which a seam keeps: the same places print the same key.\n        const keys: string[] = [];\n        for (const use of seam.uses) {\n            const key = placeKey(use.place);\n            if (series.has(use.series) && !keys.includes(key)) keys.push(key);\n        }\n        return keys.join(\"\\u0002\");\n    }, [seam, index]);\n    const read = useCallback(() => {\n        const binding = indexedBindingOf(seam.source);\n        return binding?.nested === undefined ? undefined : spanOf(binding, places);\n    }, [seam.source, places]);\n    const { result } = useTrackedEvaluation(read);\n    const last = useRef<PlanNestedSpanRead | typeof SPAN_READING | undefined>(SPAN_READING);\n    return useMemo(() => {\n        if (!result.ok) {\n            console.error(\"[Plan] the span of the rows' nested series could not be read:\", result.error);\n            return undefined;\n        }\n        const byPlace = result.value;\n        const next = byPlace === SPAN_READING || byPlace === undefined ? byPlace\n            : spanRead(byPlace, new Set(shownKey === \"\" ? [] : shownKey.split(\"\\u0002\")));\n        const was = last.current;\n        // Read again, the last read holds until the new one lands; the same read as the last is the last, so a reader of\n        // it draws once.\n        if (next === SPAN_READING && was !== SPAN_READING && was !== undefined) return was;\n        if (next !== SPAN_READING && next !== undefined && was !== SPAN_READING && was !== undefined && sameSpanRead(was, next)) return was;\n        last.current = next;\n        return next;\n    }, [result, shownKey]);\n}\n\n// ============================================================================\n// Rows read whole\n// ============================================================================\n\n/**\n * Rows read whole by their keys (#1438): what a gesture drafts — a row read\n * whole once, on its first change — and what a Save is confirmed by.\n */\nexport interface PlanWholeRows {\n    /**\n     * A row whole, encoded as the record holds it, by its id, at the record's\n     * revision: `some(some(bytes))`, `some(none)` for a key the record holds no\n     * row under, `none` while it is read — asked with every row asked and not\n     * yet read, in one request. A tracked read: an evaluation that reads it\n     * runs again when it lands.\n     */\n    read(id: string): option<option<Uint8Array>>;\n    /**\n     * Several rows whole, each as {@link PlanWholeRows.read} answers it, every\n     * one not yet read asked in one request: `none` while any of them is read.\n     * A tracked read.\n     */\n    readAll(ids: readonly string[]): option<ReadonlyMap<string, option<Uint8Array>>>;\n}\n\nconst encodersOf = new WeakMap<object, (row: unknown) => Uint8Array>();\nconst keyParsers = new WeakMap<object, (id: string) => { success: boolean; value?: unknown }>();\n\n/** The rows a binding reads whole by key, kept at the record's revision. */\nclass WholeRows implements PlanWholeRows {\n    private held: { revision: string; rows: Map<string, option<Uint8Array>>; asking: Set<string> } | undefined;\n\n    constructor(private readonly source: string) {}\n\n    read(id: string): option<option<Uint8Array>> {\n        const all = this.readAll([id]);\n        return all.type === \"some\" ? some(all.value.get(id)!) : none;\n    }\n\n    readAll(ids: readonly string[]): option<ReadonlyMap<string, option<Uint8Array>>> {\n        const binding = indexedBindingOf(this.source);\n        if (binding === undefined) return none;\n        const revision = binding.handle.revision();\n        if (revision.type !== \"some\") return none;\n        if (this.held === undefined || !stringEqual(this.held.revision, revision.value)) {\n            this.held = { revision: revision.value, rows: new Map(), asking: new Set() };\n        }\n        const held = this.held;\n        // Every row asked and not yet read is asked again with these, in one request.\n        for (const id of ids) if (!held.rows.has(id)) held.asking.add(id);\n        if (held.asking.size > 0) {\n            const asking = [...held.asking];\n            const read = binding.batches.rowsAll(asking.map((asked) => keyOf(binding, asked)));\n            if (read.type !== \"some\") return none;\n            let encode = encodersOf.get(binding.row);\n            if (encode === undefined) { encode = encodeBeast2For(binding.row) as (row: unknown) => Uint8Array; encodersOf.set(binding.row, encode); }\n            asking.forEach((asked, i) => {\n                const row = read.value[i]!;\n                held.rows.set(asked, row.type === \"some\" ? some(encode(row.value)) : none);\n                held.asking.delete(asked);\n            });\n        }\n        return some(new Map(ids.map((id) => [id, held.rows.get(id)!])));\n    }\n}\n\n/** A row's key from its id: a String key as it is, any other read back from its `.east` text. */\nfunction keyOf(binding: IndexedBindingRead, id: string): unknown {\n    if (binding.key.type === \"String\") return id;\n    let parse = keyParsers.get(binding.key);\n    if (parse === undefined) { parse = parseFor(binding.key) as (id: string) => { success: boolean; value?: unknown }; keyParsers.set(binding.key, parse); }\n    const read = parse(id);\n    if (!read.success) throw new Error(`The row id '${id}' is no key of the record's`);\n    return read.value;\n}\n\n/**\n * The rows a Plan over paged rows beside their nested series index reads\n * whole (#1438): what its editing session drafts from.\n *\n * @param seam - The root's seam; `undefined` for a root reading no nested series index\n * @returns The rows read whole; `undefined` without a seam\n */\nexport function usePlanWholeRows(seam: PlanNestedValue | undefined): PlanWholeRows | undefined {\n    const source = seam?.source;\n    return useMemo(() => (source === undefined ? undefined : new WholeRows(source)), [source]);\n}\n\n// ============================================================================\n// The windows drawn with what was read\n// ============================================================================\n\n/** No drafted rows. */\nconst NOTHING_DRAFTED = { drafts: new Map<string, Uint8Array>(), version: 0 };\n/** No rows read whole for their links. */\nconst NO_ROWS_WHOLE: ReadonlyMap<string, Uint8Array> = new Map();\nconst pagedSourceEquivalent = equivalentFor(Plan.Types.Root.fields.rows.cases.paged);\n\n/**\n * The root with its paged rows drawn through the seam (#1438): ONE wrapper per\n * source, as the event kinds' is, each window its lean rows filled with the\n * cells read and the series run over them, the shading in place — its\n * revision naming the reader's version beside the source's own, so the driver\n * reads its windows again when what was read moves, the rows it holds\n * standing in. A window carries no entries (`CarriedWindowType`): its rows are\n * lean, and a gesture drafts from the row read whole by its key\n * ({@link usePlanWholeRows}).\n *\n * @param value - The latest root\n * @param data - Its data-stable twin\n * @param lead - What the reader read; `undefined` before it first lands, or for a root reading no nested series index\n * @param drafted - The session's drafted rows, whole, by id, and their version: each draws in its lean row's place\n * @param readWhole - Rows read whole for the link ends the cells do not hold, by id: each draws whole in its lean\n *   row's place, its runs where their times put them — a drafted row before it\n * @returns The two roots the canvas draws\n */\nexport function usePlanNestedRoot(value: PlanRootValue, data: PlanRootValue, lead: PlanNestedLead | undefined,\n    drafted: { readonly drafts: ReadonlyMap<string, Uint8Array>; readonly version: number } = NOTHING_DRAFTED,\n    readWhole: ReadonlyMap<string, Uint8Array> = NO_ROWS_WHOLE): { value: PlanRootValue; data: PlanRootValue } {\n    const seam = data.nested.type === \"some\" ? data.nested.value : undefined;\n    const paged = seam !== undefined && lead !== undefined ? windowedSourceOf(value.rows) : undefined;\n    const rows = useMemo(() => new SortedMap([...readWhole, ...drafted.drafts], compareString), [readWhole, drafted.drafts]);\n    // Which rows are read whole for their links names the revision too, so the windows are read again as they land.\n    const whole = useMemo(() => [...readWhole.keys()].join(\"|\"), [readWhole]);\n    // A pick's series switched on or off names it too: the window function reads which are on as it draws a window.\n    const picked = useSliceReactivity(data.pick.type === \"some\" ? data.pick.value.key : undefined);\n    const latest = useRef({ src: paged, lead, seam, rows, version: drafted.version, whole, picked });\n    latest.current = { src: paged, lead, seam, rows, version: drafted.version, whole, picked };\n    const wrapperOf = useRef<{ src: PlanPagedSourceValue; wrapped: PlanPagedSourceValue } | undefined>(undefined);\n    const wrapped = useMemo((): PlanPagedSourceValue | undefined => {\n        if (paged === undefined) return undefined;\n        const prior = wrapperOf.current;\n        if (prior !== undefined && pagedSourceEquivalent(prior.src, paged)) return prior.wrapped;\n        const next: PlanPagedSourceValue = {\n            id: paged.id,\n            page: (offset, limit) => {\n                const l = latest.current;\n                if (l.seam === undefined || l.lead === undefined) return none;\n                const read = l.seam.rows(offset, limit, l.lead.cells, l.rows, l.lead.shading);\n                // A window of lean rows carries no entry: none of them is a row whole, and an edit reads its row whole by key.\n                return read.type === \"some\" ? some({ rows: read.value, entries: [] }) : none;\n            },\n            total: () => latest.current.src?.total() ?? none,\n            // What was read moving is a new revision: the driver reads its windows again, the rows it holds standing in.\n            revision: () => {\n                const l = latest.current;\n                const r = l.src?.revision?.() ?? none;\n                return some(`${r.type === \"some\" ? r.value : \"\"}#nested-${l.lead?.version ?? 0}-${l.version}-${l.whole}-${l.picked}`);\n            },\n            refresh: (revision) => latest.current.src?.refresh?.(revision) ?? null,\n            seek: paged.seek.type === \"some\"\n                ? some((query) => {\n                    const s = latest.current.src?.seek;\n                    return s !== undefined && s.type === \"some\" ? s.value(query) : none;\n                })\n                : none,\n            // The snapshot of the rows themselves, which what is read of them leaves.\n            snapshot: () => {\n                const src = latest.current.src;\n                return src === undefined ? none : snapshotOf(src) ?? none;\n            },\n            ...(paged.query !== undefined ? { query: () => latest.current.src?.query?.() ?? \"\" } : {}),\n        };\n        wrapperOf.current = { src: paged, wrapped: next };\n        return next;\n    }, [paged]);\n    const shownData = useMemo(() => (wrapped === undefined ? data : { ...data, rows: variant(windowedArm(data.rows), wrapped) as PlanRootValue[\"rows\"] }), [wrapped, data]);\n    const shownValue = useMemo(() => (wrapped === undefined ? value : { ...value, rows: variant(windowedArm(value.rows), wrapped) as PlanRootValue[\"rows\"] }), [wrapped, value]);\n    return { value: shownValue, data: shownData };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * Whether the host the Plan renders in bounds it (#1193). A Plan fills its\n * parent, as every builder's frame does: given a height by its host, the\n * frame takes it, and the canvas fills main and scrolls its own rows. In a\n * host that gives it none — a page that grows with what it holds — the frame\n * grows with its canvas, which keeps growing with its rows and mounts what\n * the page shows of them (#812).\n *\n * @packageDocumentation\n */\n\nimport { useLayoutEffect, useState, type RefObject } from \"react\";\n\n/**\n * Whether the host bounds the canvas: read from the canvas as laid out,\n * before it paints, and again whenever it or the main it sits in changes\n * size. A canvas growing with its rows that is taller than its main is cut\n * off by a host that bounds the frame. Once bounded, it stays bounded: a\n * canvas that fills main is never taller than it, so nothing could say\n * otherwise. A declared bound (`style.height` / `maxHeight`) is the Plan's\n * own, and asks nothing of the host.\n *\n * @param bodyRef - The canvas's body, the child of the frame's main\n * @param declared - Whether the Plan declares a bound\n * @returns `true` once the host is seen to bound the canvas\n */\nexport function useHostBound(bodyRef: RefObject<HTMLElement | null>, declared: boolean): boolean {\n    const [bounded, setBounded] = useState(false);\n    useLayoutEffect(() => {\n        if (declared || bounded) return undefined;\n        const body = bodyRef.current;\n        const main = body?.parentElement ?? null;\n        if (body === null || main === null) return undefined;\n        // Whole pixels both: a canvas a pixel taller than its main is a rounding, not a host's bound.\n        const check = () => { if (body.offsetHeight > main.clientHeight + 1) setBounded(true); };\n        check();\n        if (typeof ResizeObserver === \"undefined\") return undefined;\n        const ro = new ResizeObserver(check);\n        ro.observe(body);\n        ro.observe(main);\n        return () => ro.disconnect();\n    }, [bodyRef, declared, bounded]);\n    return bounded;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * Row focus (R1 links / R2 expand): the links family and the rows it reveals,\n * and the focused row's developer render with its height clamp.\n *\n * @packageDocumentation\n */\n\nimport { useMemo, type ComponentProps, type RefObject } from \"react\";\nimport { getSomeorUndefined, type EastChakraComponent } from \"@elaraai/east-ui-components\";\nimport { useElementHeight } from \"../use-element-height.js\";\nimport {\n    deriveLinkFamily, pxOf, rowHeight, rowIdOfKey,\n    type LinkFamily, type PlanDerived, type PlanFocusCtx, type PlanLinkValue, type PlanRootValue,\n    type PlanRowIndex, type VisibleRow,\n} from \"../model.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport type { PlanUiView } from \"./view.js\";\n\ntype UIValue = ComponentProps<typeof EastChakraComponent>[\"value\"];\n\n/** Default height of the R2 developer-render region when a row declares none. */\nconst EXPAND_DEFAULT_PX = 240;\n/** The render never clamps below this — a region too short to hold anything\n *  is worse than one that scrolls. */\nconst EXPAND_FLOOR_PX = 88;\n\n/** The focus's reach over the rows. */\nexport interface PlanFocus {\n    /** The links focus's transitive family. */\n    linkFamily: LinkFamily | undefined;\n    /** The rows a links focus keeps at full height (focus + family). */\n    focusVisibleKeys: ReadonlySet<RowKey> | undefined;\n    /** Which row is focused, and how — what the row roles need. */\n    focusCtx: PlanFocusCtx | undefined;\n}\n\n/**\n * The focus's family closure and height context.\n *\n * @param focus - The active row focus\n * @param links - The decoded link graph\n * @returns The family, the rows it keeps, and the focus context\n */\nexport function usePlanFocus(focus: PlanUiView[\"focus\"], links: readonly PlanLinkValue[]): PlanFocus {\n    const linkFamily = useMemo(\n        () => (focus?.kind === \"links\" ? deriveLinkFamily(links, focus.key) : undefined),\n        [focus, links],\n    );\n    const focusVisibleKeys = useMemo(\n        () => (focus !== null && linkFamily !== undefined ? new Set([...linkFamily.all, focus.key]) : undefined),\n        [focus, linkFamily],\n    );\n    const focusCtx = useMemo<PlanFocusCtx | undefined>(() => {\n        if (focus === null) return undefined;\n        return focus.kind === \"links\"\n            ? { kind: \"links\", key: focus.key, family: linkFamily?.all }\n            : { kind: \"expand\", key: focus.key };\n    }, [focus, linkFamily]);\n    return { linkFamily, focusVisibleKeys, focusCtx };\n}\n\n/** Where the focused row's developer render is measured against. */\nexport interface PlanExpandFrame {\n    /** The virtualizer's scroll viewport — how much canvas there is. */\n    scrollElRef: RefObject<HTMLElement | null>;\n    /** The sticky chrome above the rows, inside that viewport. */\n    headerRef: RefObject<HTMLElement | null>;\n}\n\n/** The R2 render and the height context the rows are measured with. */\nexport interface PlanExpand {\n    /** Whether the root declares `expandRender` (rows grow the expand control). */\n    canExpand: boolean;\n    /** The focused row's developer render / gutter body, or `null`. */\n    expandBody: UIValue | null;\n    expandGutterBody: UIValue | null;\n    /** The focus context with the render's clamped height — every `rowHeight` call's. */\n    heightCtx: PlanFocusCtx | undefined;\n}\n\n/**\n * The focused row's developer render — the ROOT's `expandRender` resolver\n * called with the row's id (#822; rows only DECLARE `{ height, axis }`),\n * evaluated once per focus — and the v2 clamp on its height.\n *\n * @param value - The latest root (its resolvers)\n * @param focus - The active row focus\n * @param focusCtx - Which row is focused\n * @param rows - The row index, the visible rows and the derivations the clamp sums\n * @param dense - The declared density\n * @param chartsExpanded - The user's expanded chart rows\n * @param frame - The elements the clamp measures\n * @param live - Whether the canvas layout is showing (the narrow cards size their own render)\n * @returns The render and the height context\n */\nexport function usePlanExpand(\n    value: PlanRootValue,\n    focus: PlanUiView[\"focus\"],\n    focusCtx: PlanFocusCtx | undefined,\n    rows: { index: PlanRowIndex; visible: readonly VisibleRow[]; derived: PlanDerived },\n    dense: boolean,\n    chartsExpanded: ReadonlySet<RowKey>,\n    frame: PlanExpandFrame,\n    live: boolean,\n): PlanExpand {\n    const expandRenderFn = useMemo(() => getSomeorUndefined(value.expandRender), [value.expandRender]);\n    const expandGutterFn = useMemo(() => getSomeorUndefined(value.expandGutter), [value.expandGutter]);\n    const expandKey = focus?.kind === \"expand\" ? focus.key : undefined;\n    // Keyed on the focused row's KEY, so a landing or a data commit that keeps\n    // the focus does not run the resolvers again.\n    const expandBody = useMemo((): UIValue | null => {\n        const id = expandKey !== undefined ? rowIdOfKey(expandKey) : undefined;\n        if (id === undefined || expandRenderFn === undefined) return null;\n        try {\n            return expandRenderFn(id);\n        } catch (err) {\n            console.error(\"[Plan] expandRender resolver failed:\", err);\n            return null;\n        }\n    }, [expandKey, expandRenderFn]);\n    const expandGutterBody = useMemo((): UIValue | null => {\n        const id = expandKey !== undefined ? rowIdOfKey(expandKey) : undefined;\n        if (id === undefined || expandGutterFn === undefined) return null;\n        try {\n            return expandGutterFn(id);\n        } catch (err) {\n            console.error(\"[Plan] expandGutter resolver failed:\", err);\n            return null;\n        }\n    }, [expandKey, expandGutterFn]);\n\n    // R2 — the focused row's own declaration. The row keeps its NORMAL\n    // anatomy and height; what grows is the render region inside it.\n    const expandDecl = focusCtx?.kind === \"expand\"\n        ? getSomeorUndefined(rows.index.byKey.get(focusCtx.key)?.expand)\n        : undefined;\n    // The v2 clamp — `min(renderHeight, canvas − strips − chrome)`. The canvas\n    // is MEASURED, not parsed: `height: \"fill\"` is `\"100%\"`, which has no pixel\n    // value until layout runs. Unbounded frames have no scroll element and\n    // grow to content, so there is nothing to clamp against and the declared\n    // height stands. Both readings are live while an expand focus is open on\n    // the canvas layout.\n    const expandActive = focus?.kind === \"expand\" && live;\n    const viewportPx = useElementHeight(frame.scrollElRef, expandActive);\n    const headerPx = useElementHeight(frame.headerRef, expandActive);\n    // The clamp feeds `focusCtx.renderPx`, which `rowHeight` adds to the focal\n    // row — so it is computed WITHOUT it (which would be circular). Strip\n    // heights are constant per row, so summing them needs no focus context.\n    const { visible, derived } = rows;\n    const expandRenderPx = useMemo(() => {\n        if (expandDecl === undefined || expandKey === undefined) return 0;\n        // `pxOf`, not `parseFloat` — a percentage must fall back to the\n        // default, never silently become that many pixels (the #615 rule).\n        const declared = expandDecl.height.type === \"some\" ? pxOf(expandDecl.height.value) : undefined;\n        const want = declared ?? EXPAND_DEFAULT_PX;\n        if (viewportPx === undefined) return want;\n        // Everything the render must NOT push out: the strips, the focal row's\n        // own band, and the chrome pinned above them.\n        const bare = { kind: \"expand\" as const, key: expandKey };\n        const rowsPx = visible.reduce((sum, v) => sum + rowHeight(v, dense, chartsExpanded, bare, derived), 0);\n        return Math.max(EXPAND_FLOOR_PX, Math.min(want, viewportPx - rowsPx - (headerPx ?? 0)));\n    }, [expandDecl, expandKey, viewportPx, headerPx, visible, dense, chartsExpanded, derived]);\n    // `focusCtx` says WHICH row is focused (all the row roles need); this adds\n    // how tall its render is, which only the measurements need — keeping them\n    // apart is what lets the clamp be computed after `focusCtx`.\n    const heightCtx = useMemo<PlanFocusCtx | undefined>(\n        () => (focusCtx?.kind === \"expand\" ? { ...focusCtx, renderPx: expandRenderPx } : focusCtx),\n        [focusCtx, expandRenderPx]);\n    return { canExpand: expandRenderFn !== undefined, expandBody, expandGutterBody, heightCtx };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas body as the virtualizer sees it: the items (rows, gap bands, the\n * unloaded runs of a paged source, failed windows), their exact heights and\n * identities, where a search or the diagnostics chip asks it to scroll, and\n * the viewport reported back to the paging driver.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport {\n    bodyItemKey, elideForFocus, firstDiagnosticItem, placeFailures, rowHeight,\n    type PlanBodyItem, type PlanDerived, type PlanFocusCtx, type PlanRowIndex, type VisibleRow,\n} from \"../model.js\";\nimport { planGeometry } from \"../geometry.js\";\nimport { appendAll } from \"../reductions.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport type { PlanController, PlanNavAlign, PlanPagingSnapshot, PlanScrollTarget } from \"../controller/index.js\";\nimport type { PlanPagedBlock, PlanRowOrigin } from \"../controller/paging.js\";\nimport { PLAN_PAGE_SIZE } from \"../use-plan-paging.js\";\n\n/** The body items, and what the frame measures and keys them by. */\nexport interface PlanBody {\n    items: readonly PlanBodyItem[];\n    /** The exact height of every item — the frame's sizes AND what each item\n     *  renders at (#812). */\n    heights: readonly number[];\n    /** Each item's identity, so a row keeps its instance wherever it moves. */\n    itemKey: (i: number) => string;\n}\n\n/**\n * The body's items — BLOCK AFTER BLOCK (#823), each block's rows in stream\n * order: a paged block's resident windows as one slab between its bands, with\n * each failed window's band in its seam, and a fixed block's rows once.\n *\n * @remarks\n * A paged block's bands stand for its unloaded windows, sized by its own\n * ledger, so the rows that replace one occupy the same space and nothing below\n * it moves (#577). A block nested under a section's header draws nothing —\n * no rows, no bands — while that header is collapsed or hidden, as its rows\n * would not. Under a links focus each block's run of unrelated rows elides on\n * its own (R1): a gap never spans two blocks, inline or paged.\n *\n * @param visible - The visible rows\n * @param index - The row index\n * @param blocks - A paged canvas's blocks (`[]` inline — nothing unloaded)\n * @param origin - Which block and window each paged row came from\n * @param focusCtx - Which row is focused\n * @returns The items\n */\nexport function planBodyItems(\n    visible: readonly VisibleRow[],\n    index: PlanRowIndex,\n    blocks: readonly PlanPagedBlock[],\n    origin: ReadonlyMap<string, PlanRowOrigin>,\n    focusCtx: PlanFocusCtx | undefined,\n): PlanBodyItem[] {\n    // A block's rows are contiguous in the stream, so its visible rows are too.\n    const perBlock = new Map<number, VisibleRow[]>();\n    for (const v of visible) {\n        const list = perBlock.get(v.row.block);\n        if (list !== undefined) list.push(v);\n        else perBlock.set(v.row.block, [v]);\n    }\n    // R1 at scale — the links-focus body elides runs of unrelated rows into\n    // gap bands (a lone straggler keeps its rail; see `elideForFocus`).\n    const itemsOf = (rows: readonly VisibleRow[]): PlanBodyItem[] => (focusCtx?.kind === \"links\"\n        ? elideForFocus(rows, index, focusCtx)\n        : rows.map((row) => ({ kind: \"row\", row })));\n    const out: PlanBodyItem[] = [];\n    if (blocks.length === 0) {\n        // Inline: the blocks one after another, nothing unloaded.\n        for (const rows of perBlock.values()) appendAll(out, itemsOf(rows));\n        return out;\n    }\n    const visibleByKey = new Map(visible.map((v) => [v.row.key, v]));\n    const windowOf = (key: RowKey): number | undefined => origin.get(key)?.w;\n    for (const b of blocks) {\n        // Under a header that is folded or hidden, the block draws nothing.\n        if (b.parent !== undefined) {\n            const header = visibleByKey.get(b.parent);\n            if (header === undefined || header.collapsed) continue;\n        }\n        // A window whose read failed is ONE band where its rows would be\n        // (#811) — every other window keeps landing around it.\n        const core = placeFailures(itemsOf(perBlock.get(b.index) ?? []), b.failures, windowOf);\n        if (b.head !== undefined) out.push({ kind: \"band\", band: b.head });\n        appendAll(out, core);\n        if (b.tail !== undefined) out.push({ kind: \"band\", band: b.tail });\n    }\n    return out;\n}\n\n/**\n * The rows that close an open group — each the last visible member of a\n * parent drawn open (#949): it carries the group's closing rule, so the rows\n * after it read as outside it.\n *\n * @remarks\n * Walks the body in order with the depths of the parents still open. A row at\n * or above an open parent's depth ends that parent at the row before it —\n * when that row is one of its members (a parent with nothing visible under it\n * closes nothing). Anything but a row (an unloaded band, a failed window, a\n * links-focus gap) breaks the walk: a group whose members run into a band\n * has no end on the canvas yet. The last row closes every parent still open.\n *\n * @param items - The body items, in order\n * @returns The keys of the rows that end a group\n */\nexport function groupEndsOf(items: readonly PlanBodyItem[]): ReadonlySet<RowKey> {\n    const ends = new Set<RowKey>();\n    const open: number[] = [];\n    let last: VisibleRow | undefined;\n    const close = (depth: number) => {\n        while (open.length > 0 && open[open.length - 1]! >= depth) {\n            const parent = open.pop()!;\n            if (last !== undefined && last.depth > parent) ends.add(last.row.key);\n        }\n    };\n    for (const item of items) {\n        if (item.kind !== \"row\") {\n            open.length = 0;\n            last = undefined;\n            continue;\n        }\n        const v = item.row;\n        close(v.depth);\n        if (!v.collapsed) open.push(v.depth);\n        last = v;\n    }\n    close(-1);\n    return ends;\n}\n\n/**\n * The body items and their geometry.\n *\n * @param visible - The visible rows\n * @param index - The row index\n * @param derived - The derivations (heights read them)\n * @param paging - The paged source's blocks and where each row came from (inline: idle)\n * @param focusCtx - Which row is focused\n * @param heightCtx - The same, with the expand clamp\n * @param dense - The declared density\n * @param chartsExpanded - The user's expanded chart rows\n * @returns The body\n */\nexport function usePlanBody(\n    visible: readonly VisibleRow[],\n    index: PlanRowIndex,\n    derived: PlanDerived,\n    paging: PlanPagingSnapshot,\n    focusCtx: PlanFocusCtx | undefined,\n    heightCtx: PlanFocusCtx | undefined,\n    dense: boolean,\n    chartsExpanded: ReadonlySet<RowKey>,\n): PlanBody {\n    const { blocks, origin } = paging;\n    const items = useMemo<readonly PlanBodyItem[]>(\n        () => planBodyItems(visible, index, blocks, origin, focusCtx),\n        [focusCtx, visible, index, blocks, origin]);\n    // The height SIGNATURE (#812): a row's kind, the density, a chart's toggle,\n    // a focus and the expand clamp all reach it, so any of them changing a\n    // height re-measures the frame — and a selection, which reaches none of\n    // its inputs, re-measures nothing.\n    const heights = useMemo(() => items.map((item) => {\n        if (item.kind === \"gap\") return planGeometry(dense).gap;\n        if (item.kind === \"band\") return Math.max(1, item.band.px);\n        if (item.kind === \"failed\") return item.failure.px;\n        return rowHeight(item.row, dense, chartsExpanded, heightCtx, derived);\n    }), [items, dense, chartsExpanded, heightCtx, derived]);\n    const itemKey = useCallback((i: number): string => {\n        const item = items[i];\n        return item !== undefined ? bodyItemKey(item) : `i:${i}`;\n    }, [items]);\n    return { items, heights, itemKey };\n}\n\n/**\n * Where the frame is asked to scroll: a key search's target row — resolved\n * against the VISIBLE body (a match inside a collapsed group has no row to\n * scroll to), and only once it has loaded — the first skipped row the\n * diagnostics chip seeks (#811), or the item a keyboard move went to (#819).\n * The latest request wins: a new search takes the viewport back, and each\n * search, chip click or keyboard move carries a nonce, so it scrolls there\n * again after the user has moved away.\n *\n * Every request names its ROW, which the frame serves once per nonce — a row\n * whose index moves as windows land above it is not a new request. So the\n * chip's row is the first skipped row AT the click: a window that lands later\n * with an earlier skipped row does not take the view there.\n *\n * @param items - The body items\n * @param index - The row index\n * @param derived - The derivations (their diagnostic rows)\n * @param scroll - Who owns the request, and its target\n * @returns The item to scroll to, how to align it, the re-request nonce, and the first skipped item\n */\nexport function usePlanScrollTarget(\n    items: readonly PlanBodyItem[],\n    index: PlanRowIndex,\n    derived: PlanDerived,\n    scroll: PlanScrollTarget,\n): { toIndex: number | undefined; align: PlanNavAlign | \"center\"; nonce: number | undefined; firstSkipped: number | undefined } {\n    const { targetKey } = scroll;\n    const searchIndex = useMemo(() => {\n        if (targetKey === undefined) return undefined;\n        const i = items.findIndex((it) => it.kind === \"row\" && it.row.row.key === targetKey);\n        return i >= 0 ? i : undefined;\n    }, [items, targetKey]);\n    const navKey = scroll.nav?.key;\n    const navIndex = useMemo(() => {\n        if (navKey === undefined) return undefined;\n        const i = items.findIndex((it) => bodyItemKey(it) === navKey);\n        return i >= 0 ? i : undefined;\n    }, [items, navKey]);\n    const firstSkipped = useMemo(\n        () => firstDiagnosticItem(items, index, derived.diagnostics),\n        [items, index, derived.diagnostics]);\n    // The chip's row, taken at the click (its nonce), and found by key after.\n    const skippedAt = useRef<{ seq: number; key: string | undefined }>({ seq: -1, key: undefined });\n    if (skippedAt.current.seq !== scroll.skippedSeq) {\n        const item = firstSkipped !== undefined ? items[firstSkipped] : undefined;\n        skippedAt.current = { seq: scroll.skippedSeq, key: item !== undefined ? bodyItemKey(item) : undefined };\n    }\n    const skippedKey = skippedAt.current.key;\n    const skippedIndex = useMemo(() => {\n        if (skippedKey === undefined) return undefined;\n        const i = items.findIndex((it) => bodyItemKey(it) === skippedKey);\n        return i >= 0 ? i : undefined;\n    }, [items, skippedKey]);\n    switch (scroll.owner) {\n        case \"skipped\":\n            return { toIndex: skippedIndex, align: \"center\", nonce: scroll.skippedSeq, firstSkipped };\n        case \"nav\":\n            // A pinned row is not in the body: it never scrolls away.\n            return { toIndex: navIndex, align: scroll.nav?.align ?? \"auto\", nonce: scroll.nav?.seq, firstSkipped };\n        case \"search\":\n            return { toIndex: searchIndex, align: \"center\", nonce: scroll.searchSeq, firstSkipped };\n    }\n}\n\n/**\n * The frame's range signal, in the paging driver's terms: which ROW (or which\n * band) the viewport sits on. The item under the viewport CENTER when the\n * frame can resolve one (the live scroll offset — inside one huge band item\n * only the center pixel can say where the thumb is, #612), else the middle of\n * the mounted range — with the windows the mounted range shows (#1398): each\n * row's, a run's nearest its rows and a failed window's, which the footer's\n * loading line and the frame's busy follow. No body-layout knowledge crosses\n * into the driver.\n *\n * @param items - The body items\n * @param controller - Where the viewport is reported\n * @param origin - Which block and window each paged row came from\n * @returns The frame's `onRangeChange`\n */\nexport function usePlanRangeReport(items: readonly PlanBodyItem[], controller: PlanController, origin: ReadonlyMap<string, PlanRowOrigin>) {\n    return useCallback((\n        range: { startIndex: number; endIndex: number },\n        isScrolling: boolean,\n        center?: { index: number; withinPx: number },\n    ) => {\n        const mid = Math.floor((range.startIndex + range.endIndex) / 2);\n        const item = items[center?.index ?? mid] ?? items[range.startIndex];\n        if (item === undefined) return;\n        const shows: number[] = [];\n        for (let i = range.startIndex; i <= range.endIndex; i++) {\n            const it = items[i];\n            const w = it?.kind === \"row\" ? origin.get(it.row.row.key)?.w\n                : it?.kind === \"band\" ? Math.floor((it.band.at === \"head\" ? it.band.to : it.band.from) / PLAN_PAGE_SIZE)\n                    : it?.kind === \"failed\" ? it.failure.w : undefined;\n            if (w !== undefined && !shows.includes(w)) shows.push(w);\n        }\n        if (item.kind === \"band\") {\n            // `withinPx` is measured from the band's own top — the one origin\n            // its block's ledger can place exactly, whatever the resident rows\n            // above it rendered at.\n            controller.reportViewport({ kind: \"band\", block: item.band.block, at: item.band.at, px: center?.withinPx, shows }, isScrolling);\n        } else if (item.kind === \"row\") {\n            controller.reportViewport({ kind: \"row\", key: item.row.row.key, shows }, isScrolling);\n        } else if (item.kind === \"failed\") {\n            // A failed window's band names its own block and window (#811).\n            controller.reportViewport({ kind: \"window\", block: item.failure.block, w: item.failure.w, shows }, isScrolling);\n        }\n        // A links-focus gap band names no window — the demand stays where it is.\n    }, [items, controller, origin]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a row IS under the canvas's state — its role under a row focus, and\n * what its caret toggles. The renderer (`root/rows.tsx`, `rows/BodyRow.tsx`)\n * and the keyboard map (`root/keyboard.ts`, #819) read the same answers, so a\n * key can never do something a click would not.\n *\n * @packageDocumentation\n */\n\nimport type { PlanFocusCtx, VisibleRow } from \"../model.js\";\nimport type { PlanEvent } from \"../plan-state.js\";\n\n/**\n * A row's presentation under the canvas's row focus: `rail` (R1 — a row the\n * links focus does not gather, 11px), `ctx` (R2 — a context strip beside the\n * expanded row, 16px), `focal` (the R2 expanded row, when it has a render), or\n * `none`. Group bands are wayfinding and never compress.\n *\n * @param v - The visible row\n * @param focusCtx - The canvas's row focus, if any\n * @param hasRender - Whether the expand render resolved to a body\n * @returns The row's role\n */\nexport function planRowRole(v: VisibleRow, focusCtx: PlanFocusCtx | undefined, hasRender: boolean): \"rail\" | \"ctx\" | \"focal\" | \"none\" {\n    if (focusCtx === undefined || v.row.kind.type === \"group\") return \"none\";\n    const key = v.row.key;\n    if (focusCtx.kind === \"links\") {\n        return key !== focusCtx.key && !(focusCtx.family?.has(key) ?? false) ? \"rail\" : \"none\";\n    }\n    if (key !== focusCtx.key) return \"ctx\";\n    return hasRender ? \"focal\" : \"none\";\n}\n\n/** What a row's caret toggles, and whether that is open now. */\nexport interface PlanRowToggle {\n    /** The interaction a caret click — Space, ← / → — dispatches. */\n    event: PlanEvent;\n    /** Whether the section (or chart) is open. */\n    open: boolean;\n}\n\n/**\n * A row's caret — a group band's section, a nesting parent's subtree (span,\n * heat, buckets and table parents), an expandable chart's spark ↔ expanded.\n * Cards and events rows, and charts that do not declare `expandable`, have\n * none.\n *\n * @param v - The visible row\n * @param hasChildren - Whether the row nests rows\n * @param chartExpanded - Whether the user expanded this chart row\n * @returns The toggle, or `undefined` for a row with no caret\n */\nexport function rowToggle(v: VisibleRow, hasChildren: boolean, chartExpanded: boolean): PlanRowToggle | undefined {\n    const kind = v.row.kind;\n    const section: PlanRowToggle = { event: { t: \"group.toggle\", key: v.row.key }, open: !v.collapsed };\n    switch (kind.type) {\n        case \"group\":\n            return section;\n        case \"span\": case \"heat\": case \"buckets\": case \"table\":\n            return hasChildren ? section : undefined;\n        case \"chart\": {\n            if (!kind.value.expandable) return undefined;\n            return {\n                event: { t: \"chart.toggle\", key: v.row.key },\n                open: kind.value.height.type === \"expanded\" || chartExpanded,\n            };\n        }\n        case \"cards\": case \"events\":\n            return undefined;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * One canvas body row, memoized (#616) — the row-kind switch extracted from\n * the canvas's render callback so a store change re-renders O(changed rows)\n * instead of O(mounted rows).\n *\n * The contract that makes the memo real: every prop is a PRIMITIVE or an\n * identity-stable object, and the row reads its OWN slice of the UI state —\n * selection, chart toggle, active focus control — from the canvas controller\n * (`usePlanRowState`, #815). A selection click therefore renders exactly the\n * two rows it moved and never the canvas; a chart toggle, the one row whose\n * height it changes.\n *\n * The derivations are rebuilt whole on every data change and every paged\n * window landing, but a row reads only its own entries from them, and the\n * canvas keeps an entry's identity while its content holds\n * (`stableDerived`). So the memo compares those entries, not the maps: a\n * window landing renders the rows it added and the rows whose numbers it\n * moved, and none of the rows already on screen (#815).\n *\n * Scale changes still repaint every row — correctly: the row CONTENT consumes\n * `PlanScaleContext`, and context pierces the memo by design. What the memo\n * removes is the store-change tax, not the geometry-change work.\n */\n\nimport { memo, useEffect, type ReactNode } from \"react\";\nimport { Box, VisuallyHidden } from \"@chakra-ui/react\";\nimport { RowShell, type PlanRowDrop } from \"./RowShell.js\";\nimport { GroupRow } from \"./GroupRow.js\";\nimport { ChartLeftTicks } from \"./ChartRow.js\";\nimport { KindPlot } from \"./KindPlot.js\";\nimport { PlanPartBoundary } from \"./PartBoundary.js\";\nimport { RowDiagnostic } from \"./RowDiagnostic.js\";\nimport { rowToggle } from \"./row-facts.js\";\nimport type { PlanDraftMark } from \"../use-plan-editing.js\";\nimport { usePlanRowState } from \"../controller/react.js\";\nimport { usePlanGridRow } from \"../root/grid.js\";\nimport { statusText } from \"../a11y.js\";\nimport { usePlanWords } from \"../words.js\";\nimport type { PlanFocusTagWord } from \"../messages.js\";\nimport { rowItemKey, spansWindows, type PlanDerived, type VisibleRow } from \"../model.js\";\nimport type { PlanEvent } from \"../plan-state.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/**\n * The row kinds that accept a drop.\n *\n * @remarks\n * A Plan's rows are heterogeneous, so \"can you drop here\" is a per-KIND\n * question before it is a per-row one — and the line is not arbitrary. These\n * four render a **collection of discrete scheduled objects** (runs, bucket\n * events, marks, chips): things a library card can BECOME, at an instant the\n * pointer names.\n *\n * The rest are excluded on the same principle:\n *\n * - `chart` / `heat` / `table` render DERIVED values — a plotted series, an\n *   intensity field, computed cells. There is nothing for a card to become,\n *   and a number is not a destination.\n * - `group` is wayfinding chrome; its MEMBERS are the droppable things, and\n *   accepting on the strip would make a collapsed group swallow drops meant\n *   for a row inside it.\n *\n * A canvas narrows further with `canDrop` — this set is what is structurally\n * possible, the predicate is what this particular canvas permits. And a row\n * takes a card only where its series declares where one lands (`edit`,\n * #880): its row arrives flagged `edits.drop`, and the drop drafts its entry.\n * An event kind's row of these kinds takes the event kinds' drags (#1196).\n */\nexport const DROPPABLE_KINDS: ReadonlySet<string> = new Set([\"span\", \"buckets\", \"events\", \"cards\"]);\n\nexport interface PlanBodyRowProps {\n    v: VisibleRow;\n    /** The row's height (parent-computed via `rowHeight`, focus context applied). */\n    h: number;\n    styles: Styles;\n    gridTemplate: string;\n    /** Whether the row nests children (its caret, and a collapsed parent's\n     *  slimmer bars). */\n    hasChildren: boolean;\n    /** The renderer-side derivations — compared by THIS row's entries. */\n    derived: PlanDerived;\n    dispatch: (e: PlanEvent) => void;\n    /**\n     * This row's presentation under the canvas's row focus:\n     * `none` (no focus, or full-height family), `rail` (R1 unrelated — 11px),\n     * `ctx` (R2 context strip — 16px), `focal` (the R2 focused row).\n     */\n    focusRole: \"none\" | \"rail\" | \"ctx\" | \"focal\";\n    /** The links-focus family tag (R1). */\n    focusTag: PlanFocusTagWord | undefined;\n    /** The expand render's axis treatment (R2, focal row only). */\n    axisMode: \"dim\" | \"off\" | undefined;\n    /** Whether the row grows the links / expand focus controls. */\n    showLinksControl: boolean;\n    showExpandControl: boolean;\n    /** Whether the canvas's source is not yet exhausted — a paged canvas still\n     *  loading (#567 D9). A top-level section band's count then covers only\n     *  the loaded windows; every other row's numbers are exact\n     *  (`spansWindows`, #822). */\n    partial: boolean | undefined;\n    /** The shared drop registration, when the canvas is a drag target. */\n    rowDrop: PlanRowDrop | undefined;\n    /** The row's draft mark, when a draft of its entry changed it (#880). */\n    draft: PlanDraftMark | undefined;\n    /** The row is the last visible member of an open group (#949). */\n    groupEnd: boolean;\n    /** Its events are unread (#1398, CL2): its cells have not landed, or are read again — its plot washed under what it holds. */\n    unread: boolean;\n    /** Focal-row extras (only ever passed to the focal row). */\n    expandBody?: ReactNode;\n    expandGutter?: ReactNode;\n    /** The focal row's natural kind height (its marks' band). */\n    bandHeight?: number | undefined;\n}\n\n/**\n * Test-only render probe — lets the memo property be asserted as WHICH rows\n * rendered, deterministically, rather than inferred from profiler timings.\n * `undefined` outside tests; the call is a single optional invocation.\n */\nlet bodyRowRenderProbe: ((key: string) => void) | undefined;\n/** Install (or clear) the test render probe. Test use only. */\nexport function setBodyRowRenderProbe(fn: ((key: string) => void) | undefined): void {\n    bodyRowRenderProbe = fn;\n}\n\n/**\n * Test-only mount probe — lets \"a row keeps its component instance\" be\n * asserted as mounts and unmounts per row (#812). An index-keyed body hands an\n * instance whichever row now sits at its index, which shows up here as a row\n * that is still on screen UNMOUNTING (the instance it mounted as went away)\n * — deterministic, where a render count cannot tell the two apart.\n * `undefined` outside tests.\n */\nlet bodyRowMountProbe: ((key: string, phase: \"mount\" | \"unmount\") => void) | undefined;\n/** Install (or clear) the test mount probe. Test use only. */\nexport function setBodyRowMountProbe(fn: ((key: string, phase: \"mount\" | \"unmount\") => void) | undefined): void {\n    bodyRowMountProbe = fn;\n}\n\n/**\n * Whether a row's facts are unchanged — every prop by identity, the\n * derivations by this row's own entries.\n */\nfunction sameBodyRow(a: PlanBodyRowProps, b: PlanBodyRowProps): boolean {\n    const keys = Object.keys(a) as (keyof PlanBodyRowProps)[];\n    if (keys.length !== Object.keys(b).length) return false;\n    for (const key of keys) {\n        if (key !== \"derived\" && a[key] !== b[key]) return false;\n    }\n    // By identity: the canvas keeps an entry's object while its content holds.\n    const k = a.v.row.key;\n    const da = a.derived;\n    const db = b.derived;\n    return da === db || (Object.is(da.bands.get(k), db.bands.get(k))\n        && Object.is(da.heatArms.get(k), db.heatArms.get(k))\n        && Object.is(da.tableSeries.get(k), db.tableSeries.get(k))\n        && Object.is(da.charts.get(k), db.charts.get(k))\n        && Object.is(da.groupStrips.get(k), db.groupStrips.get(k))\n        && Object.is(da.groupMembers.get(k), db.groupMembers.get(k))\n        && Object.is(da.diagnostics.get(k), db.diagnostics.get(k)));\n}\n\n/** One body row — a group band, an R1 rail, or a kind row in its shell. */\nexport const PlanBodyRow = memo(function PlanBodyRow({\n    v, h, styles, gridTemplate, hasChildren, derived,\n    dispatch, focusRole, focusTag, axisMode,\n    showLinksControl, showExpandControl, partial, rowDrop, draft, groupEnd, unread,\n    expandBody, expandGutter, bandHeight,\n}: PlanBodyRowProps) {\n    bodyRowRenderProbe?.(v.row.key);\n    // The row's own slice of the UI state — it re-renders when THIS moves.\n    const { selected, chartExpanded, activeControl, active, focusSeq } = usePlanRowState(v.row.key);\n    // Its place in the treegrid and its share of the tab stop (#819).\n    const grid = usePlanGridRow(rowItemKey(v.row.key), active, focusSeq);\n    const words = usePlanWords();\n    const mountedAs = v.row.key;\n    useEffect(() => {\n        bodyRowMountProbe?.(mountedAs, \"mount\");\n        return () => bodyRowMountProbe?.(mountedAs, \"unmount\");\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- once per INSTANCE, under the row it mounted as\n    }, []);\n    const kind = v.row.kind;\n    // A row that cannot be placed on the axis renders in place as its\n    // diagnostic (#811) — gutter kept, marks replaced by the reason.\n    const diagnostic = derived.diagnostics.get(v.row.key);\n\n    // R1 rails — unrelated rows collapse to 11px, never removed: order,\n    // scroll and the status dot survive, and the rail itself returns.\n    if (focusRole === \"rail\") {\n        const railTone = v.row.status.type === \"some\" ? v.row.status.value.type : undefined;\n        return (\n            <Box ref={grid.ref} css={styles.rail} style={{ gridTemplateColumns: gridTemplate }} data-plan-rail={v.row.key}\n                role=\"row\" aria-level={v.depth + 1} aria-selected={selected}\n                tabIndex={grid.tabIndex} onFocus={grid.onFocus} data-plan-item={rowItemKey(v.row.key)}\n                // The recipe sizes the rail from the geometry variable; this\n                // is the height the model laid it out at (#817).\n                data-plan-h={h}\n                onClick={() => dispatch({ t: \"focus.clear\" })}>\n                {/* 11px carries no name — a reader still hears which row it is. */}\n                <Box position=\"relative\" role=\"rowheader\">\n                    <VisuallyHidden>{v.row.gutter.label}</VisuallyHidden>\n                    {railTone !== undefined && (\n                        <Box as=\"span\" css={styles.statusDot} data-tone={railTone}\n                            role=\"img\" aria-label={statusText(railTone, words)}\n                            position=\"absolute\" right=\"12px\" top=\"2px\" />\n                    )}\n                </Box>\n            </Box>\n        );\n    }\n\n    if (kind.type === \"group\") {\n        return (\n            <GroupRow row={v.row} kind={kind.value} styles={styles} gridTemplate={gridTemplate}\n                height={h} depth={v.depth} collapsed={v.collapsed}\n                strip={derived.groupStrips.get(v.row.key)}\n                memberCount={derived.groupMembers.get(v.row.key)}\n                partial={partial === true && spansWindows(v.row)} diagnostic={diagnostic} grid={grid}\n                groupEnd={groupEnd} />\n        );\n    }\n\n    const isCtx = focusRole === \"ctx\";\n    const isFocal = focusRole === \"focal\" && expandBody !== undefined;\n    // The row-scoped focus controls + family tags.\n    const rowControls: ReadonlyArray<{ kind: \"links\" | \"expand\"; active: boolean; onClick: () => void }> = [\n        ...(showLinksControl ? [{\n            kind: \"links\" as const,\n            active: activeControl === \"links\",\n            onClick: () => dispatch({ t: \"focus.links\", key: v.row.key }),\n        }] : []),\n        ...(showExpandControl ? [{\n            kind: \"expand\" as const,\n            active: activeControl === \"expand\",\n            onClick: () => dispatch({ t: \"focus.expand\", key: v.row.key }),\n        }] : []),\n    ];\n    const shellBase = {\n        row: v.row, styles, gridTemplate, depth: v.depth,\n        selected,\n        controls: isCtx ? undefined : rowControls, focusTag, axisMode, ctx: isCtx,\n        ...(isFocal ? {\n            expandBody,\n            bandHeight,\n            ...(expandGutter !== undefined ? { expandGutter } : {}),\n        } : {}),\n        // Only the kinds that hold droppable objects register a cell —\n        // a chart / heat / table row is inert to a drag by construction,\n        // not by predicate (see `DROPPABLE_KINDS`) — and of those, only a\n        // row whose series declares where a card lands (#880), on a canvas a\n        // card can reach, or what a moved element writes (#825), while its\n        // session takes a gesture; or an event kind's row, which the event\n        // kinds' drags land on (#1196). A diagnostic row places nothing, so\n        // nothing can land on it either.\n        drop: DROPPABLE_KINDS.has(kind.type) && diagnostic === undefined\n            && ((v.row.edits.drop && rowDrop?.cards === true) || (v.row.edits.move.type === \"some\" && rowDrop?.data === true)\n                || rowDrop?.events?.target(v.row) !== undefined)\n            ? rowDrop : undefined,\n        draft,\n        grid,\n        groupEnd,\n        unread,\n    } as const;\n    // The per-kind SHELL differences — caret, toggle, emphasis, the chart's\n    // gutter ticks. The plot content itself is one switch shared with the\n    // narrow layout's cards (`KindPlot`). What the caret toggles is the one\n    // answer the keyboard reads too (`rowToggle`, #819).\n    const toggle = rowToggle(v, hasChildren, chartExpanded);\n    const caret = toggle !== undefined ? { collapsed: !toggle.open } : undefined;\n    const onCaretClick = toggle !== undefined ? () => dispatch(toggle.event) : undefined;\n    // `aria-expanded`: its section or chart — or, for a row with neither, its\n    // expand render. A strip opens nothing: its one action is the way back.\n    const expandedState = isCtx ? undefined\n        : toggle !== undefined ? toggle.open\n            : showExpandControl ? isFocal : undefined;\n    let shellExtras: {\n        caret?: { collapsed: boolean } | undefined;\n        onCaretClick?: (() => void) | undefined;\n        emphasis?: \"header\" | \"footer\" | undefined;\n        noGrid?: boolean;\n        gutterOverlay?: ReactNode;\n    } = {};\n    // The plot height a chart row scales against (see the chart case).\n    let plotH = h;\n    let chartExpanded_ = false;\n    switch (kind.type) {\n        case \"span\":\n        case \"heat\":\n        case \"buckets\":\n            shellExtras = { caret, onCaretClick };\n            break;\n        case \"chart\": {\n            const declaredExpanded = kind.value.height.type === \"expanded\";\n            chartExpanded_ = declaredExpanded || chartExpanded;\n            // The FOCAL row is tall (natural + render), but its marks live in\n            // the band at the top — `RowShell` mounts `children` inside\n            // `expandRowBand` at `bandHeight` — so the plot's y-scale, its\n            // ref-label gate and the gutter ticks take the BAND height, never\n            // the grown row's. Passing the grown `h` built a ~272px y-scale\n            // that squashed into a ~32px band, opened the ≥48px ref-label\n            // gate on a spark row, and pushed labels + ticks past the band\n            // into the render (#591).\n            plotH = isFocal ? (bandHeight ?? h) : h;\n            shellExtras = {\n                noGrid: false,\n                caret,\n                onCaretClick,\n                // A STRIP carries no value axis — its plot re-encodes as a\n                // tone strip (`ToneStrip`), so the gutter ticks would label a\n                // scale that is not there, stacked in 16px. A diagnostic row\n                // draws no marks, so it has no value axis either.\n                gutterOverlay: isCtx || diagnostic !== undefined\n                    ? undefined\n                    // The chart the plot DRAWS (#824) — the ticks label its scale.\n                    : <ChartLeftTicks kind={derived.charts.get(v.row.key) ?? kind.value} styles={styles} height={plotH} />,\n            };\n            break;\n        }\n        case \"table\":\n            shellExtras = {\n                caret, onCaretClick,\n                emphasis: kind.value.emphasis.type === \"body\" ? undefined : kind.value.emphasis.type,\n            };\n            break;\n        case \"cards\":\n        case \"events\":\n            break;\n    }\n    return (\n        <RowShell {...shellBase} height={h} expandedState={expandedState} {...shellExtras}>\n            {diagnostic !== undefined ? (\n                <RowDiagnostic diagnostic={diagnostic} styles={styles} ctx={isCtx} />\n            ) : (\n                // One row's render failure stays in that row (#811).\n                <PlanPartBoundary part={{ kind: \"row\", key: v.row.key, label: v.row.gutter.label }} resetKey={v.row} styles={styles}>\n                    <KindPlot v={v} styles={styles} derived={derived}\n                        hasChildren={hasChildren} ctx={isCtx}\n                        plotHeight={plotH} chartExpanded={chartExpanded_} />\n                </PlanPartBoundary>\n            )}\n        </RowShell>\n    );\n}, sameBodyRow);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The thin per-row adapter (#616): compute one row's PRIMITIVE facts under\n * the canvas's focus and hand them to the memoized `PlanBodyRow` — plus the\n * R1 gap band that stands in for a run of unrelated rows.\n *\n * The row reads its own selection, chart toggle and active control from the\n * controller (#815), so none of those pass through here: a selection click\n * renders the two rows it moved, and the canvas not at all.\n *\n * @packageDocumentation\n */\n\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { Box, VisuallyHidden } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faEllipsis } from \"@fortawesome/free-solid-svg-icons\";\nimport { EastChakraComponent } from \"@elaraai/east-ui-components\";\nimport { PlanBodyRow } from \"../rows/BodyRow.js\";\nimport { PlanPartBoundary } from \"../rows/PartBoundary.js\";\nimport { planRowRole } from \"../rows/row-facts.js\";\nimport type { PlanRowDrop } from \"../rows/RowShell.js\";\nimport type { PlanDraftMark } from \"../use-plan-editing.js\";\nimport { usePlanItemNav } from \"../controller/react.js\";\nimport { statusText } from \"../a11y.js\";\nimport { usePlanWords, type PlanWords } from \"../words.js\";\nimport { usePlanGridRow } from \"./grid.js\";\nimport {\n    bodyItemKey, rowHeight,\n    type FocusGap, type LinkFamily, type PlanDerived, type PlanFocusCtx, type PlanRowIndex, type PlanRowValue, type VisibleRow,\n} from \"../model.js\";\nimport type { PlanEvent, RowKey } from \"../plan-state.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype UIValue = ComponentProps<typeof EastChakraComponent>[\"value\"];\n\n/** What every body row of one render shares. */\nexport interface PlanRowContext {\n    styles: Styles;\n    gridTemplate: string;\n    dense: boolean;\n    storageKey: string;\n    index: PlanRowIndex;\n    derived: PlanDerived;\n    dispatch: (e: PlanEvent) => void;\n    /** The chart rows the user expanded (heights read it). */\n    chartsExpanded: ReadonlySet<RowKey>;\n    /** Which row is focused — all the row roles need. */\n    focusCtx: PlanFocusCtx | undefined;\n    /** The same, with the expand clamp — what the heights need. */\n    heightCtx: PlanFocusCtx | undefined;\n    /** The links focus's family. */\n    linkFamily: LinkFamily | undefined;\n    /** The rows any link edge touches — they grow the links control. */\n    linkedKeys: ReadonlySet<RowKey>;\n    /** Whether the root declares `expandRender`. */\n    canExpand: boolean;\n    /** The focused row's developer render / gutter body, or `null`. */\n    expandBody: UIValue | null;\n    expandGutterBody: UIValue | null;\n    /** Whether the source is not yet exhausted — a paged canvas still loading\n     *  (a top-level section's count then covers only the loaded windows). */\n    partial: boolean | undefined;\n    rowDrop: PlanRowDrop | undefined;\n    /** Each drafted row's mark, by key (#880) — a row reads its own. */\n    marks: ReadonlyMap<RowKey, PlanDraftMark>;\n    /** The rows that close an open group — each the last visible member of\n     *  one (#949, `groupEndsOf`). */\n    groupEnds: ReadonlySet<RowKey>;\n    /** Whether a row's events are unread (#1398, CL2): a paged kind's resource whose cells have not landed, or are read\n     *  again — its plot washed under what it holds. Absent, every row's are read. */\n    unread?: ((row: PlanRowValue) => boolean) | undefined;\n}\n\n/**\n * One visible row, as the memoized body row.\n *\n * @param v - The visible row\n * @param ctx - What the render's rows share\n * @returns The row element\n */\nexport function renderPlanRow(v: VisibleRow, ctx: PlanRowContext): ReactNode {\n    const { focusCtx, linkFamily, expandBody, expandGutterBody, styles, storageKey } = ctx;\n    const h = rowHeight(v, ctx.dense, ctx.chartsExpanded, ctx.heightCtx, ctx.derived);\n    // R1 rails (unrelated data rows under a links focus, 11px), R2 context\n    // strips (every data row but the focused one under an expand focus,\n    // 16px) and the FOCUSED row, which carries the render inside itself —\n    // what makes it (and its gutter) tall, see `PlanFocusCtx.renderPx`. Group\n    // bands are exempt: they are wayfinding, and a wall of strips with no\n    // structure between them is unreadable (`planRowRole`).\n    const role = planRowRole(v, focusCtx, expandBody !== null);\n    const isFocal = role === \"focal\";\n    const up = linkFamily?.upstream.has(v.row.key) ?? false;\n    const down = linkFamily?.downstream.has(v.row.key) ?? false;\n    const focusTag = up && down ? \"LINKED\" as const : up ? \"UPSTREAM\" as const : down ? \"DOWNSTREAM\" as const : undefined;\n    // R2 — the focused row keeps its NORMAL anatomy; `axis` washes /\n    // suppresses the shared lines inside its plot.\n    const rowExpand = v.row.expand.type === \"some\" ? v.row.expand.value : undefined;\n    const axisMode = isFocal && rowExpand !== undefined && rowExpand.axis.type !== \"keep\"\n        ? rowExpand.axis.type\n        : undefined;\n    return (\n        <PlanBodyRow\n            v={v}\n            h={h}\n            styles={styles}\n            gridTemplate={ctx.gridTemplate}\n            hasChildren={(ctx.index.children.get(v.row.key)?.length ?? 0) > 0}\n            derived={ctx.derived}\n            dispatch={ctx.dispatch}\n            focusRole={role}\n            focusTag={focusTag}\n            axisMode={axisMode}\n            showLinksControl={ctx.linkedKeys.has(v.row.key)}\n            showExpandControl={v.row.expand.type === \"some\" && ctx.canExpand}\n            partial={ctx.partial}\n            rowDrop={ctx.rowDrop}\n            draft={ctx.marks.get(v.row.key)}\n            groupEnd={ctx.groupEnds.has(v.row.key)}\n            unread={ctx.unread?.(v.row) === true}\n            {...(isFocal && expandBody !== null ? {\n                // The author's render is its own part (#811): a throw while\n                // rendering it stays inside the focused row.\n                expandBody: (\n                    <PlanPartBoundary part={{ kind: \"expandRender\" }} resetKey={expandBody} styles={styles}>\n                        <EastChakraComponent value={expandBody} storageKey={`${storageKey}.${v.row.key}.expand`} />\n                    </PlanPartBoundary>\n                ),\n                bandHeight: rowHeight(v, ctx.dense, ctx.chartsExpanded, undefined, ctx.derived),\n                ...(expandGutterBody !== null ? {\n                    expandGutter: (\n                        <PlanPartBoundary part={{ kind: \"expandGutter\" }} resetKey={expandGutterBody} styles={styles}>\n                            <EastChakraComponent value={expandGutterBody}\n                                storageKey={`${storageKey}.${v.row.key}.expandgutter`} />\n                        </PlanPartBoundary>\n                    ),\n                } : {}),\n            } : {})}\n        />\n    );\n}\n\n/**\n * The words a gap band stands for (#819) — how many rows (or group bands) the\n * links focus folded into it.\n *\n * @param gap - The gap\n * @param w - The canvas's words (#820)\n * @returns `12 hidden rows`\n */\nexport function gapText(gap: FocusGap, w: PlanWords): string {\n    const n = gap.rows > 0 ? gap.rows : gap.groups;\n    return w.m.hiddenRows({ n, count: w.number(n), what: gap.rows > 0 ? \"row\" : \"group\" });\n}\n\n/**\n * The sticky parent (#823) — pinned under a bounded frame's header while the\n * rows in view belong to a parent whose own row has scrolled off: the\n * parent's name — for a deep tree, the path of its ancestors down to it — in\n * the group band's look. A click takes the reader to the parent's row. Not a\n * row of the grid: a reader already hears each row's level, and ← walks to\n * the parent.\n */\nexport function PlanStickyParent({ parent, path, styles, gridTemplate, onGo }: {\n    parent: PlanRowValue;\n    /** The parent's ancestors, outermost first. */\n    path: readonly PlanRowValue[];\n    styles: Styles;\n    gridTemplate: string;\n    /** Go to the parent's row. */\n    onGo: () => void;\n}) {\n    return (\n        <Box css={styles.stickyParent} style={{ gridTemplateColumns: gridTemplate }}\n            data-plan-sticky={parent.key} aria-hidden=\"true\" onClick={onGo}>\n            <Box css={styles.groupName}>\n                {path.map((a) => <Box as=\"span\" key={a.key} css={styles.stickyPath}>{a.gutter.label}</Box>)}\n                <Box as=\"span\">{parent.gutter.label}</Box>\n            </Box>\n            <Box />\n        </Box>\n    );\n}\n\n/**\n * The R1 gap band — ONE double-height ⋯ band replacing a run of unrelated\n * rows (their count rides beside the icon, the worst hidden tone at right);\n * a click returns to all rows, like a rail. A grid row of its own (#819):\n * Enter returns, as the click does.\n */\nexport function PlanGapBand({ gap, h, styles, gridTemplate, dispatch }: {\n    gap: FocusGap;\n    /** The height the model laid the band out at — the recipe sizes it from\n     *  the same geometry variable (#817). */\n    h: number;\n    styles: Styles;\n    gridTemplate: string;\n    dispatch: (e: PlanEvent) => void;\n}) {\n    const words = usePlanWords();\n    const itemKey = bodyItemKey({ kind: \"gap\", gap });\n    const { active, focusSeq } = usePlanItemNav(itemKey);\n    const grid = usePlanGridRow(itemKey, active, focusSeq);\n    return (\n        <Box ref={grid.ref} css={styles.focusGap} style={{ gridTemplateColumns: gridTemplate }}\n            role=\"row\" aria-level={1} tabIndex={grid.tabIndex} onFocus={grid.onFocus}\n            data-plan-item={itemKey}\n            data-plan-gap={gap.rows + gap.groups}\n            data-plan-h={h}\n            onClick={() => dispatch({ t: \"focus.clear\" })}>\n            <Box css={styles.focusGapInner} role=\"gridcell\">\n                <FontAwesomeIcon icon={faEllipsis} />\n                <Box as=\"span\" aria-hidden=\"true\">{words.number(gap.rows > 0 ? gap.rows : gap.groups)}</Box>\n                <VisuallyHidden>{gapText(gap, words)}</VisuallyHidden>\n            </Box>\n            <Box position=\"relative\" role=\"gridcell\">\n                {gap.tone !== undefined && (\n                    <Box as=\"span\" css={styles.statusDot} data-tone={gap.tone}\n                        role=\"img\" aria-label={statusText(gap.tone, words)}\n                        position=\"absolute\" right=\"12px\" top=\"50%\" transform=\"translateY(-50%)\" />\n                )}\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The horizon's density (#1438): the buckets its bars count by, and what each\n * counts, from the months' counts e3 keeps beside a nested series index.\n *\n * @packageDocumentation\n */\n\nimport { resolutionInterval } from \"../../shared/time/scale.js\";\nimport type { PlanNestedMonths } from \"../root/nested.js\";\n\n/** The periods the horizon's bars count by, finest first: a month's counts make none finer. */\nexport const HORIZON_BUCKET_UNITS = [\"month\", \"quarter\", \"year\"] as const;\n\n/** A period the horizon's bars count by. */\nexport type HorizonBucketUnit = (typeof HORIZON_BUCKET_UNITS)[number];\n\n/** The least a bucket's slot may be on the track, px: what decides the period. */\nexport const HORIZON_BUCKET_MIN_PX = 4;\n\nconst DAY_MS = 86_400_000;\n\n/** A period's usual length, ms: a Gregorian year's twelfth, fourth and whole. */\nconst USUAL_MS: Readonly<Record<HorizonBucketUnit, number>> = {\n    month: (365.2425 / 12) * DAY_MS,\n    quarter: (365.2425 / 4) * DAY_MS,\n    year: 365.2425 * DAY_MS,\n};\n\n/** A bucket of the horizon: its slot as fractions of the horizon, the period it starts, and what it counts. */\nexport interface HorizonDensityBucket {\n    /** Its start on the horizon, a fraction: the period's start, or the horizon's where the horizon clips it. */\n    from: number;\n    /** Its end. */\n    to: number;\n    /** The period's start (UTC). */\n    start: Date;\n    /** The items and values of every month starting in it. */\n    count: number;\n}\n\n/** The horizon's buckets and the period they count by, with the largest count. */\nexport interface HorizonDensity {\n    /** The period each bucket is. */\n    unit: HorizonBucketUnit;\n    /** The buckets, in order across the horizon. */\n    buckets: readonly HorizonDensityBucket[];\n    /** The largest bucket's count. */\n    max: number;\n}\n\n/**\n * The horizon's buckets (#1438): the finest of month, quarter and year whose\n * buckets keep 4px each on the track — a year where none does — from the\n * period the horizon begins in to the one it ends in, each clipped to the\n * horizon, as fractions of it. A bucket counts the items and values of every\n * month starting in it: a month the horizon clips counts whole, as e3 keeps\n * no finer count. Counts ignore the window, so the shape stays put as the\n * window moves.\n *\n * @param lo - The horizon's start, ms\n * @param hi - Its end\n * @param months - Each month's start and count, in order\n * @param trackPx - The track's width, px\n * @returns The buckets; `undefined` with no horizon or no track\n */\nexport function horizonDensity(lo: number, hi: number, months: PlanNestedMonths, trackPx: number): HorizonDensity | undefined {\n    if (!(hi > lo) || !(trackPx > 0)) return undefined;\n    const span = hi - lo;\n    const unit = HORIZON_BUCKET_UNITS.find((u) => (USUAL_MS[u] / span) * trackPx >= HORIZON_BUCKET_MIN_PX) ?? \"year\";\n    const interval = resolutionInterval(unit);\n    const starts: number[] = [];\n    const buckets: HorizonDensityBucket[] = [];\n    for (let start = interval.floor(new Date(lo)); start.getTime() < hi; start = interval.offset(start, 1)) {\n        const end = interval.offset(start, 1).getTime();\n        starts.push(start.getTime());\n        buckets.push({ from: (Math.max(start.getTime(), lo) - lo) / span, to: (Math.min(end, hi) - lo) / span, start, count: 0 });\n    }\n    // Each month in the bucket it starts in, the months in order; one outside the horizon in none.\n    let at = 0;\n    for (const [month, count] of months) {\n        if (month < lo || month >= hi) continue;\n        while (at + 1 < starts.length && starts[at + 1]! <= month) at += 1;\n        if (starts[at]! <= month) buckets[at]!.count += count;\n    }\n    const max = buckets.reduce((m, b) => Math.max(m, b.count), 0);\n    return { unit, buckets, max };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The horizon strip (`Plan Spec.md` §7) — the shared brush strip at horizon\n * density over the FULL range domain of the sources holding the window\n * (#1344), in whole periods around their data: gutter caption (`HORIZON · 26\n * WK`), the applied window as a full brush selection, and the now tick.\n * Editing the window here is editing every such source's range — a commit\n * routes through the machine (`brush.commit` → `slice.setRange`), which never\n * stores a window itself, and writes it into each source at once.\n *\n * The strip is an OVERVIEW on its own scale, so it never reads as the grid's\n * (#949): a lens under it joins the window it selected to the plot's edges —\n * the grid below is that window, magnified.\n *\n * Its bars (#1438): over rows read through a nested series index, how much\n * the collections the series shown read hold in each month, as e3 keeps it in\n * the index's span — a bar each month, quarter or year, the finest that keeps\n * 4px a bar (`horizonDensity`) — with the largest under the caption, `max\n * 1,559 items / mo`, or `no data`. A horizon over record sources has no\n * counts yet: its strip draws the baseline alone.\n *\n * Renders only over a horizon of the AXIS's arm (#631): a `datetime` domain on\n * a time axis, a `float` / `integer` domain on a number axis. The horizon\n * spans every source's domain holding the window: the jobs' and the shifts'\n * together. A slice with no source holding the window leaves the canvas its\n * own (#1344), and the horizon then spans the axis's stated window and the\n * window shown, with the window shown's length again either side — so the lens\n * never fills the strip and slides either way — and the strip moves the\n * canvas's window as it moves a source's. An ordinal axis has no range arm (its list is its window), so the\n * strip never mounts there; a Plan with no slice has no wider horizon to\n * brush. A record's query moves once per gesture: the strip previews its\n * selection, and commits on release. While the sources' span is read its row\n * is held at its height, a placeholder track in the strip's place (#1398,\n * CL1), so nothing below it moves as the span lands.\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { BrushStrip, PlaceholderShape, recordSliceDomain, type BrushBucket } from \"@elaraai/east-ui-components/internal\";\nimport { useContainerWidth, useSlicesReactivity, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { periodText } from \"../../shared/time/scale.js\";\nimport { usePlanDispatch, usePlanGeometry, usePlanScale } from \"../context.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport type { PlanHorizonUnit } from \"../messages.js\";\nimport type { PlanWindowPart } from \"../root/window.js\";\nimport type { PlanNestedSpan, PlanNestedSpanRead, SPAN_READING } from \"../root/nested.js\";\nimport { usePlanWords, type PlanWords } from \"../words.js\";\nimport { horizonDensity, type HorizonDensity } from \"./horizon-density.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** The lens's viewBox width — its lines' x in these units, stretched to the plot. */\nconst LENS_W = 1000;\n\n/** How many periods the horizon counts at most — a guard on the walk that\n *  counts them; the histogram caps its bars far below this. */\nconst MAX_PERIODS = 100_000;\n\n/** A source's range domain, on the axis's arm: its kind, and its bounds as numbers. */\ntype RecordSliceRange = NonNullable<ReturnType<typeof recordSliceDomain>>;\n\nexport interface HorizonBrushProps {\n    styles: Styles;\n    gridTemplate: string;\n    /** The sources holding the window: the horizon spans their domains. None, the canvas holds its own window (#1344). */\n    parts: readonly PlanWindowPart[];\n    /** The axis's stated window, `[from, to)` on its domain: beside the window shown, the horizon of a canvas holding its own. */\n    stated: readonly [number, number] | undefined;\n    /** The span of what every series reads through the rows' nested series index (#1438, #1440), whichever are shown, or its read in\n     *  flight: beside the window shown, the horizon of a canvas holding its own, in place of the stated window's; its months' counts —\n     *  the series shown's — its bars. */\n    span?: PlanNestedSpanRead | typeof SPAN_READING | undefined;\n    /** The now instant, if any (domain tick) — on the axis's arm. */\n    now: PlanInstantValue | undefined;\n}\n\n/**\n * The horizon over several sources' domains: from the earliest to the latest\n * of them, each of the axis's arm.\n *\n * @param parts - The sources holding the window\n * @returns Their horizon; `undefined` while no source has a domain\n */\nfunction horizonOf(parts: readonly PlanWindowPart[]): RecordSliceRange | undefined {\n    let out: RecordSliceRange | undefined;\n    for (const { part } of parts) {\n        const domain = recordSliceDomain(part);\n        if (domain === undefined) continue;\n        out = out === undefined ? domain : { kind: out.kind, min: Math.min(out.min, domain.min), max: Math.max(out.max, domain.max) };\n    }\n    return out;\n}\n\n/**\n * The horizon of a canvas holding its own window (#1344): the axis's stated\n * window and the window shown, together, with the window shown's length again\n * either side, half-open on the axis's domain — what the strip spans while no\n * source's domain says where the data is. Without the margin the lens would\n * fill the strip whenever the window shown is the stated one, and its body\n * could slide nowhere.\n *\n * @param kind - The axis's arm, as a source's domain names it\n * @param stated - The axis's stated window, if it states one\n * @param shown - The window shown\n * @returns The horizon\n */\nfunction ownHorizon(kind: RecordSliceRange[\"kind\"], stated: readonly [number, number] | undefined, shown: readonly [number, number]): RecordSliceRange {\n    const margin = shown[1] - shown[0];\n    const min = stated === undefined ? shown[0] : Math.min(stated[0], shown[0]);\n    const max = stated === undefined ? shown[1] : Math.max(stated[1], shown[1]);\n    return { kind, min: min - margin, max: max + margin };\n}\n\n/** The span of a read in flight, as the span's reader names it. */\nconst READING: typeof SPAN_READING = \"reading\";\n\n/**\n * The horizon of a canvas holding its own window over rows whose collections\n * it reads through their nested series index (#1438): the span of what its\n * series read, shown or not (#1440), and the window shown — the time it can be\n * brushed to, as a source's domain is.\n *\n * @param span - The span, `[from, to)` in ms\n * @param shown - The window shown\n * @returns The horizon\n */\nfunction spanHorizon(span: PlanNestedSpan, shown: readonly [number, number]): RecordSliceRange {\n    return { kind: \"datetime\", min: Math.min(span[0], shown[0]), max: Math.max(span[1], shown[1]) };\n}\n\n/**\n * The horizon's bars as the strip draws them (#1438): each bucket's slot and\n * count, and its hover's words — its period, then its count.\n *\n * @param density - The horizon's buckets\n * @param words - The canvas's words\n * @returns The strip's buckets\n */\nfunction densityBuckets(density: HorizonDensity, words: PlanWords): BrushBucket[] {\n    return density.buckets.map((b) => ({\n        from: b.from, to: b.to, count: b.count,\n        label: `${periodText(b.start, density.unit, words)} · ${words.m.horizonCount({ n: b.count, count: words.number(b.count) })}`,\n    }));\n}\n\n/** The horizon band — caption gutter cell + the shared brush strip + its lens. */\nexport function HorizonBrush({ styles, gridTemplate, parts, stated, span: dataSpan, now }: HorizonBrushProps) {\n    const dispatch = usePlanDispatch();\n    const geometry = usePlanGeometry();\n    const words = usePlanWords();\n    // The strip's width, which decides the period its bars count by (#1438).\n    const trackRef = useRef<HTMLDivElement | null>(null);\n    const trackPx = useContainerWidth(trackRef);\n    // The scale IS the applied window (slice range ▸ axis ▸ fit), on its\n    // own numeric domain — epoch ms, or the value on a number axis.\n    const scale = usePlanScale();\n    // Self-subscribe (#611): each source's domain is a STORE read through its choices, and a re-render does not\n    // bust a memo whose deps did not move.\n    useSlicesReactivity(parts.map(({ part }) => part.key));\n    const readDomain = useCallback(() => horizonOf(parts), [parts]);\n    const { result: recordDomain } = useTrackedEvaluation(readDomain);\n    // No source holding the window, the canvas holds its own (#1344): the horizon is the axis's stated window and the\n    // window shown, as long again either side, which nothing reads — half-open, as a window is, where a source's domain\n    // holds its last value.\n    const own = parts.length === 0;\n    const shownFrom = scale.toNumber(scale.window.min);\n    const shownTo = scale.toNumber(scale.window.max);\n    // Over the rows' nested series (#1438), the span of what every series reads (#1440), held while it is read.\n    const reading = dataSpan === READING;\n    const read = dataSpan === READING ? undefined : dataSpan;\n    const domain = own\n        ? (scale.kind === \"ordinal\" ? undefined\n            : scale.kind === \"time\" && reading ? undefined\n                : scale.kind === \"time\" && read !== undefined ? spanHorizon(read.span, [shownFrom, shownTo])\n                    : ownHorizon(scale.kind === \"time\" ? \"datetime\" : \"float\", stated, [shownFrom, shownTo]))\n        : recordDomain.ok ? recordDomain.value : undefined;\n    // The domain must speak the axis's arm — a datetime field on a time\n    // axis, a numeric field on a number axis. An ordinal axis never fits.\n    const fits = domain !== undefined && domain.max >= domain.min && (\n        scale.kind === \"time\" ? domain.kind === \"datetime\"\n            : scale.kind === \"number\" ? domain.kind !== \"datetime\"\n                : false);\n    // The horizon in WHOLE periods around the data (#949): from the start of\n    // the period the first value falls in to the end of the period the last\n    // one falls in. Every period then counts once — the last value never\n    // piles into the final bar beside the one before it — and the caption\n    // counts periods, not the gaps between them. The canvas's own horizon is\n    // half-open: it ends at its end where that is a period's edge.\n    const extent = useMemo(() => {\n        if (!fits || domain === undefined) return undefined;\n        const first = scale.floor(scale.fromNumber(domain.min));\n        const last = scale.floor(scale.fromNumber(domain.max));\n        const end = own && scale.toNumber(last) >= domain.max ? last : scale.offset(last, 1);\n        const lo = scale.toNumber(first);\n        const hi = scale.toNumber(end);\n        if (!(hi > lo)) return undefined;\n        let periods = 0;\n        for (let t = first; scale.toNumber(t) < hi && periods <= MAX_PERIODS; t = scale.offset(t, 1)) periods += 1;\n        return { lo, hi, periods };\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the domain's bounds are primitives; the object is new per read\n    }, [fits, domain?.min, domain?.max, own, scale]);\n    if (!own && !recordDomain.ok) return <Box css={styles.partError} role=\"alert\">\n        Could not load date span <chakra.button type=\"button\" css={styles.windowRetry} onClick={() => { for (const { part } of parts) part.retry(); }}>Retry</chakra.button>\n    </Box>;\n    // Its row is held while its span is read (#1398, CL1): the band at its height, a placeholder track in the\n    // strip's place and the caption's in its own, so the rows below never move as the span lands.\n    if (domain === undefined && (scale.kind === \"time\" || scale.kind === \"number\")) {\n        return (\n            <Box css={styles.brushRow} style={{ gridTemplateColumns: gridTemplate }} data-slot=\"horizon\" data-plan-horizon=\"pending\" aria-hidden=\"true\">\n                <Box css={styles.brushCaption}><PlaceholderShape kind=\"label\" index={0} /></Box>\n                <Box css={styles.brushPending} />\n            </Box>\n        );\n    }\n    if (extent === undefined || domain === undefined) return null;\n\n    const span = extent.hi - extent.lo;\n    const clamp = (f: number) => Math.max(0, Math.min(1, f));\n    const winFrom = clamp((scale.toNumber(scale.window.min) - extent.lo) / span);\n    const winTo = clamp((scale.toNumber(scale.window.max) - extent.lo) / span);\n    const nowN = now !== undefined ? scale.toNumber(now) : NaN;\n    const nowFrac = Number.isFinite(nowN) ? (nowN - extent.lo) / span : undefined;\n    const fromFraction = (f: number): PlanInstantValue => scale.fromNumber(extent.lo + clamp(f) * span);\n    const toFrac = (t: PlanInstantValue): number => clamp((scale.toNumber(t) - extent.lo) / span);\n    // Resolution-edge snapping: the draft and the committed window land on\n    // period boundaries of the ACTIVE resolution (a whole step on a number\n    // axis), at least one period wide. The scale's OWN `snap` / `offset` —\n    // this band used to carry a hand-copy of the same floor/offset/midpoint\n    // over the same interval (#617).\n    const snapPair = (f0: number, f1: number): [PlanInstantValue, PlanInstantValue] => {\n        const a = scale.snap(fromFraction(f0));\n        let b = scale.snap(fromFraction(f1));\n        if (scale.toNumber(b) <= scale.toNumber(a)) b = scale.offset(a, 1);\n        return [a, b];\n    };\n    const snapWindow = (f0: number, f1: number): { from: number; to: number } => {\n        const [a, b] = snapPair(f0, f1);\n        return { from: toFrac(a), to: toFrac(b) };\n    };\n    // The caption spans the whole brushable horizon, not the applied window\n    // — `HORIZON · 26 WK` over a 12-week window; on a number axis the count\n    // is in steps — and counts its PERIODS.\n    const unit: PlanHorizonUnit = scale.kind === \"time\" ? (scale.resolution ?? \"week\") : \"step\";\n    const periods = extent.periods;\n    const caption = words.m.horizon({ n: periods, count: words.number(periods), unit });\n    // Its bars (#1438): over the rows' nested series, each month's items as e3 keeps them in the index's span, in the\n    // finest period that keeps 4px a bar; a source's horizon has no counts yet, and draws the baseline alone.\n    const density = own && scale.kind === \"time\" && read !== undefined ? horizonDensity(extent.lo, extent.hi, read.months, trackPx) : undefined;\n    const buckets = density === undefined ? undefined : densityBuckets(density, words);\n    // A key moves the window a period of the resolution; a handle says its instant.\n    const step = (f: number, n: number): number => toFrac(scale.offset(fromFraction(f), n));\n    const valueText = (f: number): string => scale.instantText(fromFraction(f));\n    return (\n        <Box css={styles.brushRow} style={{ gridTemplateColumns: gridTemplate }} data-slot=\"horizon\">\n            <Box css={styles.brushCaption}>\n                <Box as=\"span\" data-plan-horizon-caption=\"\">{caption}</Box>\n                {/* The meta line (#1438): the largest bucket and its period, or that nothing is in the horizon. */}\n                {density !== undefined && (density.max > 0\n                    ? <Box as=\"span\" css={styles.brushMeta} data-plan-horizon-meta=\"\">\n                        {words.m.horizonMax({ n: density.max, count: words.number(density.max), unit: density.unit })}\n                    </Box>\n                    : <Box as=\"span\" css={styles.brushMeta} data-plan-horizon-meta=\"\" data-empty=\"\">{words.m.horizonNoData()}</Box>)}\n            </Box>\n            {/* Only the STRIP arms the rung — a caption click is not a brush\n                gesture, and only strip gestures can ever settle one. */}\n            <Box ref={trackRef} css={styles.brushTrack} data-plan-horizon-track=\"\" onPointerDownCapture={() => dispatch({ t: \"brush.down\" })}>\n                <BrushStrip\n                    buckets={buckets === undefined ? undefined : () => buckets}\n                    step={step}\n                    valueText={valueText}\n                    words={{ start: words.m.horizonStart(), end: words.m.horizonEnd(), window: words.m.horizonWindow() }}\n                    window={winTo > winFrom ? { from: winFrom, to: winTo } : undefined}\n                    nowFrac={nowFrac !== undefined && nowFrac >= 0 && nowFrac <= 1 ? nowFrac : undefined}\n                    // The strip and its tallest bar are the canvas geometry\n                    // (#817) — the band less its lens, bars inset within it.\n                    height={geometry.brush - geometry.lens}\n                    barHeight={geometry.brushBar}\n                    snapWindow={snapWindow}\n                    // Snap AGAIN on the instants themselves so float round-trips\n                    // can never land the committed window off an edge. A\n                    // record's query moves once per gesture: the strip owns the\n                    // live selection preview, and the release commits it, so\n                    // dragging never floods the server with a new window for\n                    // each pointer frame.\n                    onCommit={(f0, f1) => {\n                        const [a, b] = snapPair(f0, f1);\n                        dispatch({ t: \"brush.commit\", min: a, max: b });\n                    }}\n                    onClear={() => { dispatch({ t: \"brush.clear\" }); }}\n                    // The esc rung DISARMS when the gesture ends, however it ends — the sub-threshold click where the\n                    // strip emits neither a commit nor a clear (`brushRelease` is a noop there), which used to leave\n                    // `ui.brush` armed and silently eat the next Escape (#615), and a release off the strip, which no\n                    // listener around it hears (#1440).\n                    onEnd={() => { dispatch({ t: \"brush.up\" }); }}\n                />\n                {/* The lens (#949): from the window's edges on the strip's own\n                    scale down to the plot's edges — the grid below is this\n                    window, magnified. Geometry only; the recipe draws it. */}\n                <chakra.svg css={styles.horizonLens} viewBox={`0 0 ${LENS_W} ${geometry.lens}`}\n                    preserveAspectRatio=\"none\" aria-hidden=\"true\" data-plan-lens=\"\">\n                    {winTo > winFrom && (\n                        <>\n                            <line x1={winFrom * LENS_W} y1={0} x2={0} y2={geometry.lens} vectorEffect=\"non-scaling-stroke\" />\n                            <line x1={winTo * LENS_W} y1={0} x2={LENS_W} y2={geometry.lens} vectorEffect=\"non-scaling-stroke\" />\n                        </>\n                    )}\n                </chakra.svg>\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The row-focus header band (R1 links / R2 expand) — the `← All rows` link on\n * the left, the focus caption on the right, set in capitals (`Links · H1-P03 ·\n * 4 upstream · 6 downstream` / `EXPANDED · H4-P13`); it names the row by its\n * gutter label (`Plan links.html`, #1258). Returning: the link, esc, any rail\n * or gap band (R1), or the row's own control.\n */\n\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { usePlanDispatch } from \"../context.js\";\nimport { usePlanWords } from \"../words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nexport interface FocusBarProps {\n    styles: Styles;\n    /** The active focus. */\n    focus: { kind: \"links\" | \"expand\"; key: string };\n    /** The focused row's name — its gutter label, never its key (#822). */\n    label: string;\n    /** Family sizes (links focus). */\n    counts?: { upstream: number; downstream: number } | undefined;\n}\n\n/** The focus header band — the return chip + the caption. */\nexport function FocusBar({ styles, focus, label, counts }: FocusBarProps) {\n    const dispatch = usePlanDispatch();\n    const words = usePlanWords();\n    const caption = focus.kind === \"links\"\n        ? words.m.focusLinks({\n            label,\n            upstream: counts !== undefined ? words.number(counts.upstream) : undefined,\n            downstream: counts !== undefined ? words.number(counts.downstream) : undefined,\n        })\n        : words.m.focusExpanded({ label });\n    return (\n        <Box css={styles.focusBar} data-plan-focusbar={focus.kind}>\n            <chakra.button\n                type=\"button\"\n                css={styles.focusBack}\n                data-plan-focusback\n                onClick={() => dispatch({ t: \"focus.clear\" })}\n            >\n                {words.m.allRows()}\n            </chakra.button>\n            <Box css={styles.focusCaption}>{caption}</Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The ruler — two time bands, or one numeric/ordinal band, on the shared\n * template, sticky with the header chrome: one mono tick per bucket (grid\n * columns sized by the buckets' window fractions, so clipped edge buckets\n * stay true), the NOW chip on the brand rule, and the cursor readout chip.\n *\n * Where its columns are narrower than their labels it labels every k-th, each\n * whole, k the smallest step at which they fit with a gap between two, a\n * period's first column always among them (#1269, the user's ruling): a\n * week's Monday under days, a month's first week under weeks, a year's January\n * under months or quarters, a day's midnight under hours. A label may run past\n * its column into the blank columns beside it, above their bucket lines; the\n * first and the last sit against the track's ends. The labels are measured\n * before the browser paints (`useRulerFit`, the narrow layout's ruler's too),\n * so no frame shows a label it does not rest on. The renderer sets data\n * attributes: `data-period-start`, `data-thinned` and `data-align` on a tick,\n * `data-tick-label` on its label.\n */\n\nimport { useMemo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { NowChip, NowLine } from \"../../shared/time/now-line.js\";\nimport { usePlanScale } from \"../context.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { TimeRulerRow, timeRulerUnits } from \"../../shared/time/ruler.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/**\n * Where a chip sits relative to the instant it marks.\n *\n * Centred through the middle of the track, and anchored INSIDE at either end.\n * The ruler clips (so a chip can never inflate the canvas's scroll width), and\n * this is what keeps the clip from ever having to cut the label: at the last\n * column the readout you are hovering to read is exactly the one that would\n * lose half its text.\n */\nexport function chipAnchor(frac: number): string {\n    if (frac > 0.92) return \"-100%\";\n    if (frac < 0.08) return \"0%\";\n    return \"-50%\";\n}\n\nexport interface PlanRulerProps {\n    styles: Styles;\n    gridTemplate: string;\n    /** The gutter caption — the active grain's name (`RESOURCE`, the §1 mock). */\n    caption: string;\n    /** The cursor readout chip's element — always mounted (hidden), written\n     *  DIRECTLY by the canvas's cursor controller (#609): label, position and\n     *  visibility are DOM writes, so a pointermove renders nothing. */\n    cursorChipRef?: React.Ref<HTMLDivElement>;\n}\n\n/** The ruler shares its adaptive time bands with Calendar. */\nexport function PlanRuler({ styles, gridTemplate, caption, cursorChipRef }: PlanRulerProps) {\n    const scale = usePlanScale();\n    const words = usePlanWords();\n    const units = useMemo(() => timeRulerUnits(scale, words), [scale, words]);\n\n    return (\n        <Box css={styles.ruler} style={{ gridTemplateColumns: gridTemplate }} data-slot=\"ruler\" data-time={units !== undefined ? \"\" : undefined}>\n            <Box css={styles.brushCaption}>{caption}</Box>\n            <Box css={styles.rulerTrack}>\n                {units !== undefined && <TimeRulerRow scale={units} styles={styles} band=\"units\" owner=\"plan\" />}\n                <TimeRulerRow scale={scale} styles={styles} band=\"ticks\" owner=\"plan\" />\n                {scale.nowFrac !== undefined && (\n                    <>\n                        <NowLine styles={styles} at={scale.nowFrac} data-plan-now />\n                        <NowChip styles={styles} at={scale.nowFrac} anchor={chipAnchor(scale.nowFrac)} data-plan-nowchip>{words.m.now()}</NowChip>\n                    </>\n                )}\n                {cursorChipRef !== undefined && (\n                    <Box ref={cursorChipRef} css={styles.cursorChip}\n                        data-plan-cursorchip style={{ display: \"none\" }} />\n                )}\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas's sticky chrome — horizon brush, ruler, pinned rows and the\n * focus bar — pinned inside the scroll viewport above the body. The toolbar\n * is the frame's (#1193): the canvas draws no row of controls of its own.\n *\n * @packageDocumentation\n */\n\nimport type { ReactNode, Ref, RefObject } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { HorizonBrush } from \"../shell/HorizonBrush.js\";\nimport { FocusBar } from \"../shell/FocusBar.js\";\nimport { PlanRuler } from \"../shell/Ruler.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport type { PlanUiView } from \"./view.js\";\nimport type { PlanWindowPart } from \"./window.js\";\nimport type { PlanNestedSpanRead, SPAN_READING } from \"./nested.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nexport interface PlanHeaderProps {\n    styles: Styles;\n    gridTemplate: string;\n    /** The header element — its live height feeds the expand clamp. */\n    headerRef: Ref<HTMLDivElement>;\n    /** The sources of the Plan's slice holding the window (#1344): the brush spans their domains. */\n    windowParts: readonly PlanWindowPart[];\n    /** The axis's stated window, `[from, to)` on its domain: with no source holding the window, the brush spans it and the window shown, as long again either side. */\n    stated: readonly [number, number] | undefined;\n    /** The span of the collections the series shown read through the rows' nested series index (#1438), or its read in flight: with no\n     *  source holding the window, the brush spans it and the window shown. */\n    span: PlanNestedSpanRead | typeof SPAN_READING | undefined;\n    affordances: ReadonlyArray<string>;\n    now: PlanInstantValue | undefined;\n    /** The ruler's gutter caption — the active grain's name. */\n    rulerCaption: string;\n    cursorChipRef: RefObject<HTMLDivElement | null>;\n    /** The pinned rows, already rendered. */\n    pinned: ReactNode;\n    /** The id of the pinned rows' group — the treegrid owns it (`aria-owns`,\n     *  #819), so the pinned rows are its first rows though they render here.\n     *  Absent when there are none. */\n    pinnedId: string | undefined;\n    /** The active row focus. */\n    focus: PlanUiView[\"focus\"];\n    /** The focused row's name, while a focus is active. */\n    focusLabel: string | undefined;\n    /** Family sizes under a links focus. */\n    linkCounts: { upstream: number; downstream: number } | undefined;\n}\n\n/** The sticky header band. */\nexport function PlanHeader({\n    styles, gridTemplate, headerRef, windowParts, stated, span, affordances, now, rulerCaption, cursorChipRef,\n    pinned, pinnedId, focus, focusLabel, linkCounts,\n}: PlanHeaderProps) {\n    return (\n        <Box css={styles.header} ref={headerRef} data-plan-header>\n            {/* The brush mounts where the slice offers it: over the sources'\n                range domains, or — none holding the window — the canvas's\n                own (#1344); only on the axis's arm, which the band decides\n                itself (#631). */}\n            {affordances.includes(\"brush\") && (\n                <HorizonBrush styles={styles} gridTemplate={gridTemplate} parts={windowParts} stated={stated} span={span} now={now} />\n            )}\n            <PlanRuler styles={styles} gridTemplate={gridTemplate} caption={rulerCaption}\n                cursorChipRef={cursorChipRef} />\n            {/* Pinned rows collapse like every other row under a focus — they\n                are not exempt from \"collapse, never remove\". */}\n            {pinnedId !== undefined && <Box role=\"rowgroup\" id={pinnedId}>{pinned}</Box>}\n            {/* The R1/R2 focus band — a SECTION row between the header and the\n                body (`← All rows` + caption); the ruler never moves. */}\n            {focus !== null && (\n                <FocusBar styles={styles} focus={focus} label={focusLabel ?? \"\"} counts={linkCounts} />\n            )}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The hover cursor (#609) — DIRECT DOM writes, zero renders.\n *\n * The hairline + ruler chip are display-only chrome, driven the way the landing\n * band is driven: `move` sets ONE CSS variable on the body — every row's\n * hairline positions from `--plan-cursor-x` and shows only under\n * `[data-plan-cursor]` — and writes the chip's label and position directly.\n * Routing this through state committed the ENTIRE canvas once per pointermove;\n * now a pointermove renders nothing at all.\n *\n * The hovered BUCKET is published to subscribers (#743) — each chart row's\n * crosshair readout — only when it changes, so a pointer gliding across one\n * bucket costs them nothing, and they too write the DOM directly.\n *\n * @packageDocumentation\n */\n\nimport { useMemo, type RefObject } from \"react\";\nimport type { PlanCursor } from \"../context.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport { chipAnchor } from \"../shell/Ruler.js\";\n\n/**\n * The canvas's cursor controller.\n *\n * @param bodyRef - The canvas body (carries the CSS variable)\n * @param chipRef - The ruler's cursor chip\n * @param scale - The shared scale (the chip names the hovered bucket)\n * @returns The controller rows report pointer moves to\n */\nexport function usePlanCursorController(\n    bodyRef: RefObject<HTMLDivElement | null>,\n    chipRef: RefObject<HTMLDivElement | null>,\n    scale: PlanScale | undefined,\n): PlanCursor {\n    return useMemo<PlanCursor>(() => {\n        const listeners = new Set<(bucket: number) => void>();\n        let hovered = -1;\n        const hover = (bucket: number) => {\n            if (bucket === hovered) return;\n            hovered = bucket;\n            for (const listener of listeners) listener(bucket);\n        };\n        return {\n            move: (frac: number) => {\n                const body = bodyRef.current;\n                if (body === null || scale === undefined) return;\n                body.style.setProperty(\"--plan-cursor-x\", String(frac));\n                body.setAttribute(\"data-plan-cursor\", \"\");\n                const bi = scale.bucketAtFrac(frac);\n                const chip = chipRef.current;\n                if (chip !== null) {\n                    if (bi >= 0) {\n                        chip.textContent = scale.buckets[bi]!.label;\n                        chip.style.left = `${frac * 100}%`;\n                        chip.style.transform = `translate(${chipAnchor(frac)}, -50%)`;\n                        chip.style.display = \"\";\n                    } else {\n                        // A truncated axis's uncovered remainder has no bucket\n                        // to name — the hairline still tracks, the readout hides.\n                        chip.style.display = \"none\";\n                    }\n                }\n                hover(bi);\n            },\n            leave: () => {\n                bodyRef.current?.removeAttribute(\"data-plan-cursor\");\n                const chip = chipRef.current;\n                if (chip !== null) chip.style.display = \"none\";\n                hover(-1);\n            },\n            subscribe: (listener) => {\n                listeners.add(listener);\n                if (hovered >= 0) listener(hovered);\n                return () => { listeners.delete(listener); };\n            },\n        };\n    }, [bodyRef, chipRef, scale]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas as a drag TARGET: library cards land on a row at an instant, and\n * the canvas's own runs, chips, tiles and marks move and resize on it (#825).\n * Rows register their own cells (`RowShell`); this registers the surface\n * those cells name and hands every completed drag to the editing session,\n * which drafts it into the entry its row came from (#880).\n *\n * A target is a named surface (cells are addressed `surface × row × slot`).\n * The cards of the Plan's own library panel — its author's tabs — reach the\n * canvas whether or not it declares an `id` (#1259): the Plan takes its own\n * panel's cards without `sources`. A Library beside the Plan reaches it by the\n * root's `id`, so its cards land only on a canvas that declares one and lists\n * the Library in `sources` (the root's `id` is `none` otherwise, #824). The\n * canvas's own runs, chips, tiles and marks move with or without it (#825):\n * with no `id` the canvas names a surface of its own, which only its panel's\n * cards reach. Either way the editing session must be able to take the\n * gesture — a drop with nowhere to go is a gesture that silently loses work —\n * or nothing registers, so no row lights up and no drag can complete against\n * a canvas that cannot act on it. `canDrop` still vets every drop — at the\n * pointer, and once more before it is delivered — before it becomes a draft.\n *\n * Beside a Plan's event kinds (#1196) the canvas takes their drags too: the\n * Events and Backlog tabs' cards and an author's tab's cards with a `drop`, a\n * card dropped on an event kind's row; the kinds' elements moved and resized\n * on their rows; and an element returned to the Backlog tab, which the\n * surface names as the one library its elements return to — with no trash\n * zone, since nothing of the canvas's is thrown away by a drag. The event\n * kinds judge each and say why not on the ghost (`edit/event-drag.ts`).\n *\n * @packageDocumentation\n */\n\nimport { useId, useMemo } from \"react\";\nimport { getSomeorUndefined, useDragTarget, type DragEventValue, type DragMeta, type DragTargetConfig } from \"@elaraai/east-ui-components\";\nimport { useIRCanDrop, type CanDropFn } from \"@elaraai/east-ui-components/internal\";\nimport type { PlanEventDrop } from \"../edit/event-drag.js\";\nimport type { PlanRootValue } from \"../model.js\";\nimport type { PlanRowDrop } from \"../rows/RowShell.js\";\n\n/** No library: `data`'s rows take no card. */\nconst NO_LIBRARIES: readonly string[] = [];\n\n/**\n * Register the canvas as a drop target while `data`'s editing session or its\n * event kinds take a gesture — named by its `id`, or by a surface of its own\n * when it declares none.\n *\n * @param value - The latest root (its `id`, `canDrop`)\n * @param sources - The library ids beside the Plan accepted for `add` drags (data-stable)\n * @param panel - The library ids of the Plan's own panel tabs whose cards land on its rows (data-stable)\n * @param onDrop - Where a completed drag goes — a card's drop, an element's move or resize, an element's return — answering whether it was taken (stable)\n * @param data - Whether `data`'s editing session takes a gesture now\n * @param events - The event kinds' drag and drop (#1196), for a Plan of event kinds\n * @returns The per-row drop registration every droppable row shares, or\n *   `undefined` when the canvas is not a target\n */\nexport function usePlanDropTarget(\n    value: PlanRootValue,\n    sources: readonly string[],\n    panel: readonly string[],\n    onDrop: (event: DragEventValue, meta?: DragMeta) => boolean,\n    data: boolean,\n    events?: PlanEventDrop,\n): PlanRowDrop | undefined {\n    const own = useId();\n    const enabled = data || events !== undefined;\n    const declared = enabled ? getSomeorUndefined(value.id) : undefined;\n    const id = enabled ? declared ?? `plan-canvas${own}` : undefined;\n    // The libraries whose cards land on `data`'s rows, while its session takes\n    // them: the panel's own tabs, always (#1259); a Library beside the Plan, by\n    // the canvas's declared id alone.\n    const dataLibraries = useMemo(\n        () => (!data ? NO_LIBRARIES : declared !== undefined ? [...panel, ...sources] : [...panel]),\n        [data, declared, panel, sources]);\n    // Every library whose cards the canvas takes: `data`'s, and the event kinds' (#1196).\n    const accepted = useMemo(\n        () => [...new Set([...dataLibraries, ...(events?.libraries ?? NO_LIBRARIES)])],\n        [dataLibraries, events]);\n    const cards = dataLibraries.length > 0;\n    const libraries = useMemo(() => new Set(dataLibraries), [dataLibraries]);\n    const canDropFn = useMemo(\n        () => getSomeorUndefined(value.canDrop) as CanDropFn | undefined,\n        [value.canDrop],\n    );\n    // The canvas's veto — the verdict-caching bridge every target shares, so\n    // a drag resting over a bucket asks the predicate once, not per move.\n    const veto = useIRCanDrop(canDropFn);\n    const targetConfig = useMemo((): DragTargetConfig | null => (id !== undefined ? {\n        id,\n        sources: accepted,\n        // A card lands (`add`); the canvas's own elements move and resize on\n        // it (#825) — each row says which it takes (`RowShell`'s `accepts`).\n        // An event kind's element returns to the Backlog tab (#1196), and to\n        // nowhere else: no trash zone shows.\n        kinds: { add: accepted.length > 0, move: true, resize: true, remove: events !== undefined, trash: false },\n        ...(events !== undefined ? {\n            returns: {\n                libraries: [events.backlog],\n                canDrop: (event: DragEventValue, library: string) => events.returning(event, library).allowed,\n                caption: (event: DragEventValue, library: string) => events.returning(event, library).caption,\n            },\n        } : {}),\n        onDrag: onDrop,\n    } : null), [id, accepted, events, onDrop]);\n    useDragTarget(targetConfig);\n    // One registration shared by every droppable row — the per-row part of\n    // the coordinate is the row itself, which `RowShell` already knows.\n    return useMemo<PlanRowDrop | undefined>(\n        () => (id !== undefined ? { surface: id, cards, libraries, data, canDrop: veto, events } : undefined),\n        [id, cards, libraries, data, veto, events],\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * ONE overlay layer for the whole canvas (#816) — a popover, a hover card and a\n * tooltip, each a single Zag machine that exists only while it is open, however\n * many elements the canvas mounts.\n *\n * Elements are plain DOM. Every element kind already names itself —\n * `data-run`, `data-event`, `data-chip`, `data-mark`, `data-cell` (the cell's\n * instant, `instantKey`-encoded) — and its row names it (`data-plan-row`, or a\n * narrow card's `data-plan-card`: the row's key, its id's canonical text), so\n * the element ref a resolver is called with is read back from the DOM, its row\n * parsed back to the typed id (#822). The canvas body listens once:\n *\n * - a click opens the popover (and a second click on the same element closes\n *   it) — in the CAPTURE phase, because the elements stop their clicks from\n *   reaching the row, and selection and `onElementClick` keep working as\n *   before. A link ribbon (#824) names its ref in its hit path's attributes\n *   (`data-link-key` and its two run refs) — a ribbon belongs to no row — and\n *   opens the popover the same way;\n * - Enter on a focused element opens the popover, and Esc closes it and hands\n *   focus back to the element — that Esc is the popover's, never also a rung\n *   of the canvas's esc ladder (the popover's layer takes it first and\n *   prevents it, and the canvas skips a prevented key);\n * - hovering an element opens the hover card after a short delay, on devices\n *   that can hover; leaving it closes the card unless the pointer moved into\n *   the card;\n * - hovering a labelled port, cell marker, link ribbon (#818) or row control\n *   (#1258) shows its `aria-label` as a tooltip — a ribbon opens no hover\n *   card: its caption is what hovering it says;\n * - hovering a bar, a chip, a tile or a rollup band whose label is hidden (too\n *   narrow for a letter and the ellipsis) or ellipsized, or a heat or table\n *   cell whose number its column has no room for, shows the whole label as a\n *   tooltip (#1264, #1266, #1269) — read from what the page draws as the hover\n *   lands — and a hover card open on the element says more, so the tooltip\n *   gives way to it;\n * - hovering a family row's label and links-focus tag, whose line draws the\n *   tag ellipsized or out of sight, shows the tag's whole word (#1277).\n *\n * The open element and its resolved body live in the controller; the DOM node\n * a surface anchors to lives here, out of the store. A surface anchors with\n * `positioning.getAnchorElement`, so it follows the element while the canvas\n * scrolls — and closes once the element leaves the viewport, or the canvas. A\n * tile its cell folds has no box to anchor to: its popover — a pick from the\n * cell's `+n` menu opens it — hangs from that chip (#1276).\n *\n * The tooltip's styles are made as the layer mounts, ahead of the hover that\n * first opens one (#1594): a tooltip opens a moment into a pointer's rest on a\n * bar — in the middle of its pick-up, where the pointer rests that long — and a\n * rule first added to the page's styles then has them worked out again in that\n * frame.\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useLayoutEffect, useMemo, useRef, type KeyboardEvent, type MouseEvent, type PointerEvent, type RefObject } from \"react\";\nimport { HoverCard, Popover, Portal, Tooltip } from \"@chakra-ui/react\";\nimport { equalFor, variant } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { EastChakraComponent, useHoverCapable } from \"@elaraai/east-ui-components\";\nimport { useSlotClass, useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport type { PlanElementRefValue } from \"../context.js\";\nimport { instantKey, instantOfKey } from \"../instant.js\";\nimport { rowIdOfKey, rowKeyOf } from \"../row-key.js\";\nimport { usePlanController, usePlanSelector } from \"../controller/react.js\";\nimport type { PlanController, PlanSnapshot } from \"../controller/index.js\";\nimport { PlanPartBoundary } from \"../rows/PartBoundary.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** The elements a popover or hover card opens from — every element kind's own attribute. */\nexport const PLAN_ELEMENT_SELECTOR = \"[data-run],[data-event],[data-chip],[data-mark],[data-cell]\";\n/** A link ribbon's hit path (#824) — a click opens its popover; hovering it\n *  shows its caption as a tooltip, never a hover card. */\nexport const PLAN_LINK_SELECTOR = \"[data-link-key]\";\n/** The labelled marks a tooltip reads — their `aria-label` is its text: ports,\n *  cell markers, link ribbons (#818) and a row's focus controls (#1258). */\nexport const PLAN_TIP_SELECTOR =\n    \"[data-port][aria-label],[data-marker][aria-label],[data-link][aria-label],[data-plan-control][aria-label]\";\n/** The elements whose label (`data-plan-label`) a tooltip says while it is\n *  hidden or ellipsized: a bar, a chip and a rollup band (#1264), a tile\n *  (#1266), and a heat or table cell's number (#1269). */\nexport const PLAN_LABELLED_SELECTOR = \"[data-run],[data-chip],[data-event],[data-plan-band],[data-cell]\";\n\n/** A family row's label and its links-focus tag, on their own line (#1277): a hover over them says the tag's word\n *  while the line draws it ellipsized or out of sight. */\nexport const PLAN_TAGGED_SELECTOR = \"[data-plan-gutter='named']\";\n\n/** Hover intent before a card or tooltip opens — long enough to skip pass-through. */\nconst OPEN_DELAY_MS = 150;\n/** Grace before a card closes, so the pointer can travel into it. */\nconst CLOSE_DELAY_MS = 120;\n\nconst refEqual = equalFor(Plan.Types.ElementRef);\n\n/** Where the open surfaces anchor, and the hover timers — DOM facts, kept out of the store. */\nexport interface PlanOverlayAnchors {\n    popover: HTMLElement | null;\n    hover: HTMLElement | null;\n    tooltip: HTMLElement | null;\n    hoverOpen: ReturnType<typeof setTimeout> | undefined;\n    hoverClose: ReturnType<typeof setTimeout> | undefined;\n    tipOpen: ReturnType<typeof setTimeout> | undefined;\n    /** Set by Esc: the closing popover hands focus back to its element. */\n    returnFocus: boolean;\n}\n\n/**\n * A canvas's anchor record — created once per mount.\n *\n * @returns An empty record\n */\nexport function createOverlayAnchors(): PlanOverlayAnchors {\n    return {\n        popover: null, hover: null, tooltip: null,\n        hoverOpen: undefined, hoverClose: undefined, tipOpen: undefined,\n        returnFocus: false,\n    };\n}\n\n/** The element `target` sits in, when it belongs to THIS canvas — a canvas\n *  nested in an expand render or a popover body answers for its own. */\nfunction elementIn(body: HTMLElement | null, target: EventTarget | null, selector: string): HTMLElement | null {\n    if (body === null || !(target instanceof Element)) return null;\n    const el = target.closest<HTMLElement>(selector);\n    if (el === null || !body.contains(el)) return null;\n    return el.closest(\"[data-plan-body]\") === body ? el : null;\n}\n\n/**\n * The element ref a DOM element names — its kind attribute and its row, or a\n * link ribbon's key and its two run refs.\n *\n * @param el - An element matching {@link PLAN_ELEMENT_SELECTOR} or {@link PLAN_LINK_SELECTOR}\n * @returns The ref, or `undefined` when the element names none\n */\nexport function refOfElement(el: Element): PlanElementRefValue | undefined {\n    const linkKey = el.getAttribute(\"data-link-key\");\n    if (linkKey !== null) {\n        const from = rowIdOfKey(el.getAttribute(\"data-link-from\") ?? \"\");\n        const to = rowIdOfKey(el.getAttribute(\"data-link-to\") ?? \"\");\n        const fromRun = el.getAttribute(\"data-link-from-run\");\n        const toRun = el.getAttribute(\"data-link-to-run\");\n        if (from === undefined || to === undefined || fromRun === null || toRun === null) return undefined;\n        return variant(\"link\", { key: linkKey, from: { row: from, run: fromRun }, to: { row: to, run: toRun } }) as PlanElementRefValue;\n    }\n    const holder = el.closest(\"[data-plan-row],[data-plan-card]\");\n    const key = holder?.getAttribute(\"data-plan-row\") ?? holder?.getAttribute(\"data-plan-card\");\n    const row = key !== null && key !== undefined ? rowIdOfKey(key) : undefined;\n    if (row === undefined) return undefined;\n    const run = el.getAttribute(\"data-run\");\n    if (run !== null) return variant(\"run\", { row, run }) as PlanElementRefValue;\n    const event = el.getAttribute(\"data-event\");\n    if (event !== null) return variant(\"event\", { row, event }) as PlanElementRefValue;\n    const chip = el.getAttribute(\"data-chip\");\n    if (chip !== null) return variant(\"chip\", { row, chip }) as PlanElementRefValue;\n    const mark = el.getAttribute(\"data-mark\");\n    if (mark !== null) return variant(\"mark\", { row, mark }) as PlanElementRefValue;\n    const cell = el.getAttribute(\"data-cell\");\n    const at = cell !== null ? instantOfKey(cell) : undefined;\n    return at !== undefined ? variant(\"cell\", { row, at }) as PlanElementRefValue : undefined;\n}\n\n/**\n * What a surface opened on an element anchors to: the element — or, for a tile\n * its cell folds, which draws no box, the cell's `+n` chip that lists it\n * (#1276).\n *\n * @param el - The element the surface opened on\n * @returns The element to anchor to\n */\nfunction anchorOf(el: HTMLElement): HTMLElement {\n    if (!el.hasAttribute(\"data-folded\")) return el;\n    return el.closest(\"[data-plan-cell]\")?.querySelector<HTMLElement>(\":scope > [data-plan-cell-tiles] > [data-tile-more]\") ?? el;\n}\n\n/** A labelled mark's identity — its row and the mark's own attribute; a link\n *  ribbon's, its index in the root's links. */\nfunction tipOf(el: Element): { key: string; text: string } | undefined {\n    const text = el.getAttribute(\"aria-label\");\n    if (text === null) return undefined;\n    // A ribbon spans rows, so it belongs to none — the link is its identity.\n    const link = el.getAttribute(\"data-link\");\n    if (link !== null) return { key: `link|${link}`, text };\n    const holder = el.closest(\"[data-plan-row],[data-plan-card]\");\n    const row = holder?.getAttribute(\"data-plan-row\") ?? holder?.getAttribute(\"data-plan-card\");\n    if (row === null || row === undefined) return undefined;\n    const control = el.getAttribute(\"data-plan-control\");\n    if (control !== null) return { key: `${row}|control|${control}`, text };\n    const port = el.getAttribute(\"data-port\");\n    return { key: port !== null ? `${row}|port|${port}` : `${row}|marker|${el.getAttribute(\"data-marker\") ?? \"\"}`, text };\n}\n\n/**\n * The tooltip an element's label makes (#1264, #1266, #1269): its whole text,\n * while the page draws it hidden — too narrow for a letter and the ellipsis:\n * not displayed, or, in a tile or a cell, moved off its line below it — or\n * ellipsized; read as the hover lands. A table cell's numerals are its label\n * together, said one after another. A table cell with a note — one folding\n * several values of a position that takes typing (#1438) — says it always,\n * after its numerals where it draws them cut.\n *\n * @param el - A bar, a chip, a tile, a rollup band or a cell ({@link PLAN_LABELLED_SELECTOR})\n * @returns Its identity and its label's text, or `undefined` while the label shows whole and the element has no note\n */\nfunction labelTipOf(el: Element): { key: string; text: string } | undefined {\n    const label = el.querySelector<HTMLElement>(\":scope > [data-plan-label]\");\n    const parts = label === null ? [] : [...label.children].map((part) => (part.textContent ?? \"\").trim()).filter((t) => t !== \"\");\n    const text = parts.length > 0 ? parts.join(\" · \") : label?.textContent?.trim() ?? \"\";\n    // A table cell folding several values of a position that takes typing says where they take one (#1438), its\n    // numerals before it where it draws them cut.\n    const note = el.getAttribute(\"data-plan-note\");\n    if (note === null && (label === null || text === \"\")) return undefined;\n    const cut = label !== null && text !== \"\" && labelCut(el, label);\n    if (note === null && !cut) return undefined;\n    const holder = el.closest(\"[data-plan-row],[data-plan-card]\");\n    const row = holder?.getAttribute(\"data-plan-row\") ?? holder?.getAttribute(\"data-plan-card\");\n    if (row === null || row === undefined) return undefined;\n    // A band has no key of its own: its place among its row's bands names it. A cell, its instant.\n    const cell = el.getAttribute(\"data-cell\");\n    const id = el.getAttribute(\"data-run\") ?? el.getAttribute(\"data-chip\") ?? el.getAttribute(\"data-event\")\n        ?? (cell !== null ? `cell${cell}` : `band${[...(el.parentElement?.querySelectorAll(\":scope > [data-plan-band]\") ?? [])].indexOf(el)}`);\n    return { key: `${row}|label|${id}`, text: note === null ? text : cut ? `${text} — ${note}` : note };\n}\n\n/**\n * Whether an element draws its label cut: hidden — too narrow for a letter\n * and the ellipsis: not displayed, or, in a tile or a cell, moved off its line\n * below it — or ellipsized.\n */\nfunction labelCut(el: Element, label: HTMLElement): boolean {\n    // A label moved off its element's line lies wholly below it — below the\n    // inside of its border, where the element clips.\n    const drawn = label.getBoundingClientRect();\n    const inside = el.getBoundingClientRect().bottom - (Number.parseFloat(getComputedStyle(el).borderBottomWidth) || 0);\n    const offLine = drawn.height > 0 && drawn.top >= inside - 0.5;\n    return getComputedStyle(label).display === \"none\" || offLine || label.scrollWidth > label.clientWidth;\n}\n\n/**\n * The tooltip a family row's links-focus tag makes (#1277): its word, while its\n * line draws it ellipsized or wrapped off the line, out of sight; read as the\n * hover lands.\n *\n * @param el - A row's label and tag line ({@link PLAN_TAGGED_SELECTOR})\n * @returns Its identity and the tag's word, or `undefined` while the tag shows whole\n */\nfunction tagTipOf(el: Element): { key: string; text: string } | undefined {\n    const tag = el.querySelector<HTMLElement>(\":scope > [data-plan-focustag]\");\n    const text = tag?.textContent?.trim() ?? \"\";\n    if (tag === null || text === \"\") return undefined;\n    const offLine = tag.getBoundingClientRect().top >= el.getBoundingClientRect().bottom - 0.5;\n    if (!offLine && tag.scrollWidth <= tag.clientWidth) return undefined;\n    const row = el.closest(\"[data-plan-row]\")?.getAttribute(\"data-plan-row\");\n    return row === null || row === undefined ? undefined : { key: `${row}|tag`, text };\n}\n\n/** A stable identity for an open surface — its element's kind, row and key\n *  (a link's, its own key: it belongs to no row). */\nfunction refKey(ref: PlanElementRefValue): string {\n    switch (ref.type) {\n        case \"run\": return `run|${rowKeyOf(ref.value.row)}|${ref.value.run}`;\n        case \"event\": return `event|${rowKeyOf(ref.value.row)}|${ref.value.event}`;\n        case \"chip\": return `chip|${rowKeyOf(ref.value.row)}|${ref.value.chip}`;\n        case \"mark\": return `mark|${rowKeyOf(ref.value.row)}|${ref.value.mark}`;\n        case \"cell\": return `cell|${rowKeyOf(ref.value.row)}|${instantKey(ref.value.at)}`;\n        case \"link\": return `link|${ref.value.key}`;\n    }\n}\n\n/** What the root's element interactions can open. */\nexport interface PlanOverlayPresence {\n    /** The root declares a popover resolver. */\n    popover: boolean;\n    /** The root declares a hover resolver. */\n    hover: boolean;\n}\n\n/** The body's delegated listeners. */\nexport interface PlanOverlayHandlers {\n    onClickCapture: (e: MouseEvent<HTMLElement>) => void;\n    onPointerOver: (e: PointerEvent<HTMLElement>) => void;\n    onPointerOut: (e: PointerEvent<HTMLElement>) => void;\n    /** Enter on a focused element opens its popover, and Esc closes an open\n     *  one; `true` when the key was the layer's (the canvas then ignores it). */\n    onKeyDown: (e: KeyboardEvent<HTMLElement>) => boolean;\n    /** Open an element's popover as Enter does — never a toggle, so a second\n     *  press keeps it open. The keyboard's activation of an element (#819);\n     *  `true` when the root declares a popover and the element names a ref. */\n    openAt: (el: HTMLElement) => boolean;\n}\n\n/**\n * The canvas body's delegated overlay listeners.\n *\n * @param bodyRef - The canvas body (the one element listening)\n * @param controller - The canvas controller (the open surfaces' state)\n * @param anchors - This canvas's anchor record\n * @param presence - Which resolvers the root declares\n * @returns The listeners to spread on the body\n */\nexport function usePlanOverlayHandlers(\n    bodyRef: RefObject<HTMLElement | null>,\n    controller: PlanController,\n    anchors: PlanOverlayAnchors,\n    presence: PlanOverlayPresence,\n): PlanOverlayHandlers {\n    const hoverCapable = useHoverCapable();\n    const { popover: hasPopover, hover: hasHover } = presence;\n    useEffect(() => () => {\n        clearTimeout(anchors.hoverOpen);\n        clearTimeout(anchors.hoverClose);\n        clearTimeout(anchors.tipOpen);\n    }, [anchors]);\n    return useMemo<PlanOverlayHandlers>(() => {\n        const openPopover = (el: HTMLElement, toggle: boolean): boolean => {\n            const ref = refOfElement(el);\n            if (ref === undefined) return false;\n            const open = controller.getSnapshot().overlay.popover;\n            if (toggle && open !== null && refEqual(open.ref, ref)) {\n                controller.overlayIntent(\"popover\", open.ref, false);\n                return true;\n            }\n            anchors.popover = anchorOf(el);\n            clearTimeout(anchors.hoverOpen);\n            controller.overlayIntent(\"popover\", ref, true);\n            return true;\n        };\n        return {\n            onClickCapture: (e) => {\n                if (!hasPopover) return;\n                const el = elementIn(bodyRef.current, e.target, PLAN_ELEMENT_SELECTOR)\n                    ?? elementIn(bodyRef.current, e.target, PLAN_LINK_SELECTOR);\n                if (el !== null) openPopover(el, true);\n            },\n            onKeyDown: (e) => {\n                if (e.key === \"Escape\") {\n                    // An open popover is the ladder's top rung. Its own layer\n                    // listens on the document, so it takes the Escape first and\n                    // prevents it, and the canvas skips a prevented key — except\n                    // in the popover's first frame, before the layer listens.\n                    // This closes that one.\n                    const open = controller.getSnapshot().overlay.popover;\n                    if (open === null) return false;\n                    e.preventDefault();\n                    controller.overlayIntent(\"popover\", open.ref, false);\n                    anchors.popover?.focus({ preventScroll: true });\n                    return true;\n                }\n                if (e.key !== \"Enter\" || !hasPopover) return false;\n                const el = elementIn(bodyRef.current, e.target, PLAN_ELEMENT_SELECTOR);\n                if (el === null || !openPopover(el, false)) return false;\n                e.preventDefault();\n                return true;\n            },\n            openAt: (el) => hasPopover && openPopover(el, false),\n            onPointerOver: (e) => {\n                const body = bodyRef.current;\n                // A labelled mark says its `aria-label`; a family row's line the\n                // tag it draws cut (#1277); else a bar, a chip or a band says a\n                // label it draws cut (#1264).\n                const mark = elementIn(body, e.target, PLAN_TIP_SELECTOR);\n                const tagged = mark === null ? elementIn(body, e.target, PLAN_TAGGED_SELECTOR) : null;\n                const tip = mark ?? tagged ?? elementIn(body, e.target, PLAN_LABELLED_SELECTOR);\n                if (tip !== null && anchors.tooltip !== tip) {\n                    clearTimeout(anchors.tipOpen);\n                    anchors.tipOpen = setTimeout(() => {\n                        const open = mark !== null ? tipOf(mark) : tagged !== null ? tagTipOf(tagged) : labelTipOf(tip);\n                        if (open === undefined || !tip.isConnected) return;\n                        anchors.tooltip = tip;\n                        controller.tooltipIntent(open);\n                    }, OPEN_DELAY_MS);\n                }\n                if (!hasHover || !hoverCapable) return;\n                const el = elementIn(body, e.target, PLAN_ELEMENT_SELECTOR);\n                if (el === null) return;\n                clearTimeout(anchors.hoverClose);\n                if (anchors.hover === el && controller.getSnapshot().overlay.hover !== null) return;\n                clearTimeout(anchors.hoverOpen);\n                anchors.hoverOpen = setTimeout(() => {\n                    const ref = refOfElement(el);\n                    if (ref === undefined || !el.isConnected) return;\n                    // A popover open on this element already says more.\n                    const pop = controller.getSnapshot().overlay.popover;\n                    if (pop !== null && refEqual(pop.ref, ref)) return;\n                    anchors.hover = el;\n                    controller.overlayIntent(\"hover\", ref, true);\n                }, OPEN_DELAY_MS);\n            },\n            onPointerOut: (e) => {\n                const body = bodyRef.current;\n                const to = e.relatedTarget instanceof Node ? e.relatedTarget : null;\n                const tip = elementIn(body, e.target, PLAN_TIP_SELECTOR) ?? elementIn(body, e.target, PLAN_TAGGED_SELECTOR)\n                    ?? elementIn(body, e.target, PLAN_LABELLED_SELECTOR);\n                if (tip !== null && (to === null || !tip.contains(to))) {\n                    clearTimeout(anchors.tipOpen);\n                    if (anchors.tooltip === tip) {\n                        anchors.tooltip = null;\n                        controller.tooltipIntent(null);\n                    }\n                }\n                const el = elementIn(body, e.target, PLAN_ELEMENT_SELECTOR);\n                if (el === null || (to !== null && el.contains(to))) return;\n                clearTimeout(anchors.hoverOpen);\n                const open = controller.getSnapshot().overlay.hover;\n                if (open === null || anchors.hover !== el) return;\n                // The pointer may be on its way into the card: give it a moment,\n                // which the card's own pointer-enter cancels.\n                clearTimeout(anchors.hoverClose);\n                anchors.hoverClose = setTimeout(() => controller.overlayIntent(\"hover\", open.ref, false), CLOSE_DELAY_MS);\n            },\n        };\n    }, [bodyRef, controller, anchors, hasPopover, hasHover, hoverCapable]);\n}\n\nconst selectOverlay = (s: PlanSnapshot) => s.overlay;\n\n/** Close a surface whose anchor left the viewport (or the canvas). */\nfunction useAnchorWatch(anchor: HTMLElement | null, open: boolean, close: () => void): void {\n    const closeRef = useRef(close);\n    useLayoutEffect(() => { closeRef.current = close; });\n    // An element that is gone takes its surface with it — checked after every\n    // render of the layer, which follows every change to what is open.\n    useLayoutEffect(() => {\n        if (open && anchor !== null && !anchor.isConnected) closeRef.current();\n    });\n    useEffect(() => {\n        if (!open || anchor === null || typeof IntersectionObserver === \"undefined\") return undefined;\n        const io = new IntersectionObserver((entries) => {\n            if (entries.some((entry) => entry.target === anchor && !entry.isIntersecting)) closeRef.current();\n        });\n        io.observe(anchor);\n        return () => io.disconnect();\n    }, [anchor, open]);\n}\n\n/**\n * The layer's surfaces — mount once, inside the canvas's controller.\n *\n * @param props - The anchor record, the `plan` recipe styles and the storage prefix\n * @returns The open surfaces (nothing when none is open)\n */\nexport function PlanOverlays({ anchors, styles, storageKey }: {\n    anchors: PlanOverlayAnchors;\n    styles: Styles;\n    storageKey: string;\n}) {\n    const controller = usePlanController();\n    const { popover, hover, tooltip } = usePlanSelector(selectOverlay);\n    // The tooltip's styles, each part's, made now: none is first made as a hover opens one (see the module docs).\n    const tip = useSlotStyles(\"tooltip\");\n    const made = useSlotClass();\n    useMemo(() => { for (const part of Object.values(tip)) made(part); }, [tip, made]);\n    const closePopover = () => { if (popover !== null) controller.overlayIntent(\"popover\", popover.ref, false); };\n    const closeHover = () => { if (hover !== null) controller.overlayIntent(\"hover\", hover.ref, false); };\n    useAnchorWatch(popover !== null ? anchors.popover : null, popover !== null, closePopover);\n    useAnchorWatch(hover !== null ? anchors.hover : null, hover !== null, closeHover);\n    useAnchorWatch(tooltip !== null ? anchors.tooltip : null, tooltip !== null, () => controller.tooltipIntent(null));\n    return (\n        <>\n            {popover !== null && (\n                <Popover.Root\n                    key={refKey(popover.ref)}\n                    open\n                    modal={false}\n                    positioning={{ placement: \"top\", getAnchorElement: () => anchors.popover }}\n                    // A click on its own element toggles it (the body's click\n                    // handler) — that is not a click OUTSIDE.\n                    persistentElements={[() => anchors.popover]}\n                    onEscapeKeyDown={() => { anchors.returnFocus = true; }}\n                    onOpenChange={(d) => {\n                        if (d.open) return;\n                        closePopover();\n                        if (anchors.returnFocus) anchors.popover?.focus({ preventScroll: true });\n                        anchors.returnFocus = false;\n                    }}\n                >\n                    <Portal>\n                        <Popover.Positioner>\n                            <Popover.Content css={styles.elementOverlay} data-plan-overlay=\"popover\">\n                                <Popover.Body padding={0}>\n                                    <PlanPartBoundary part={{ kind: \"popover\" }} resetKey={popover.body} styles={styles}>\n                                        <EastChakraComponent value={popover.body} storageKey={`${storageKey}.popover`} />\n                                    </PlanPartBoundary>\n                                </Popover.Body>\n                            </Popover.Content>\n                        </Popover.Positioner>\n                    </Portal>\n                </Popover.Root>\n            )}\n            {hover !== null && (\n                <HoverCard.Root\n                    key={refKey(hover.ref)}\n                    open\n                    closeDelay={CLOSE_DELAY_MS}\n                    positioning={{ placement: \"top\", getAnchorElement: () => anchors.hover }}\n                    onOpenChange={(d) => { if (!d.open) closeHover(); }}\n                >\n                    <Portal>\n                        <HoverCard.Positioner>\n                            <HoverCard.Content css={styles.elementOverlay} data-plan-overlay=\"hover\"\n                                // The pointer made it into the card: keep it.\n                                onPointerEnter={() => clearTimeout(anchors.hoverClose)}>\n                                <PlanPartBoundary part={{ kind: \"hoverCard\" }} resetKey={hover.body} styles={styles}>\n                                    <EastChakraComponent value={hover.body} storageKey={`${storageKey}.hover`} />\n                                </PlanPartBoundary>\n                            </HoverCard.Content>\n                        </HoverCard.Positioner>\n                    </Portal>\n                </HoverCard.Root>\n            )}\n            {/* A hover card open on the tooltip's element says more: the tooltip gives way (#1264). */}\n            {tooltip !== null && !(hover !== null && anchors.hover !== null && anchors.hover === anchors.tooltip) && (\n                <Tooltip.Root\n                    key={tooltip.key}\n                    open\n                    positioning={{ placement: \"top\", getAnchorElement: () => anchors.tooltip }}\n                    onOpenChange={(d) => { if (!d.open) controller.tooltipIntent(null); }}\n                >\n                    <Portal>\n                        <Tooltip.Positioner>\n                            <Tooltip.Content data-plan-overlay=\"tooltip\">{tooltip.text}</Tooltip.Content>\n                        </Tooltip.Positioner>\n                    </Portal>\n                </Tooltip.Root>\n            )}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas's keyboard map (#819), as a model: the grid's items in order\n * (pinned rows, then the body — rows, gap bands, the bands standing for a\n * paged source's unloaded runs, failed windows), and what a key does from one\n * of them. Pure, so the whole map is testable without a DOM; the canvas root\n * runs the moves it returns (`index.tsx`).\n *\n * # Rows\n *\n * ↑ / ↓ step between items, Home / End go to the first / last, PgUp / PgDn\n * move a viewport's worth. → opens a closed section (or chart) and, on an open\n * section, steps to its first child; ← closes an open one, or steps to its\n * parent. Enter does what a click on the row does — select it, or return from\n * a row focus on a rail or strip — and Space toggles its section or chart.\n *\n * # Bands\n *\n * An unloaded run is ONE grid item (its row count is unknowable — see\n * `window-ledger.ts`), so a key cannot land on a row that is not there yet.\n * Fetch, then move (#1398, CL10): a step or a page past the rows read asks\n * the source for the window beside the run, and leaves an INTENT — the focus\n * waits on the item it set out from, never on the run, and once the rows land\n * it moves on to the row the key was headed for: the next row, or the row a\n * page on, never the last row before the run. Home and End past a run read\n * the source's first or last window where it is, the rows shown standing in\n * where they are, retained, the focus on the item it set out from, and the\n * focus lands on its first or last row as that window's rows replace them. A\n * source that reports no total has no bands: there the move waits on the item\n * it started from while a window loads.\n *\n * A run takes the focus only from a click into it (or as the grid's stop): it\n * stands for the rows the view shows there, and a key that moves through them\n * — ↑ ↓ PgUp PgDn — waits for them (`wait`): once they land the focus goes to\n * the first of them in view, and a page goes on from there. Such a key pressed\n * while a move waits — on the run, or on the row a step or a page set out\n * from — waits with it, and the canvas plays them in turn once the rows are in\n * (`goOn`): none is lost.\n *\n * # Widgets\n *\n * Tab from a row walks its widgets in reading order — its controls, its\n * elements in time order, the author's render — and past the last, out of\n * the canvas. ← / → step between the elements in time order\n * (Home / End to the first / last), and Esc returns to the row. A bucket\n * cell's `+n` chip stands in the walk where the tiles it folds would be, and a\n * folded tile is out of it (#1267).\n *\n * @packageDocumentation\n */\n\nimport type { PlanEvent, RowKey } from \"../plan-state.js\";\nimport type { PlanViewport } from \"../use-plan-paging.js\";\nimport type { PlanNavAlign } from \"../controller/index.js\";\nimport { bodyItemKey, rowItemKey, type PlanBodyItem, type PlanFocusCtx, type PlanRowIndex, type VisibleRow } from \"../model.js\";\nimport { appendAll } from \"../reductions.js\";\nimport { planRowRole, rowToggle } from \"../rows/row-facts.js\";\nimport { PLAN_ELEMENT_SELECTOR } from \"./overlays.js\";\n\n/** One item of the grid, as the keyboard sees it. */\nexport interface PlanNavItem {\n    /** Its `bodyItemKey`. */\n    key: string;\n    /** What it is. */\n    kind: \"row\" | \"group\" | \"gap\" | \"band\" | \"failed\";\n    /** A band's block and side, and its pixel height (End reaches its far\n     *  edge) — a move onto it asks that block for the window beside its run\n     *  (#823). */\n    band?: { block: number; at: \"head\" | \"tail\"; px: number } | undefined;\n    /** The parent row's item key, when the row nests — ← steps there. */\n    parent?: string | undefined;\n    /** Its section / chart toggle — what Space and ← / → dispatch — and\n     *  whether it is open now. */\n    toggle?: { event: PlanEvent; open: boolean } | undefined;\n    /** Whether it nests rows — → steps into an open one. */\n    nests: boolean;\n    /** What Enter does — the row's click. */\n    activate?: PlanEvent | undefined;\n    /** Where focus goes once Enter has done it, when not here — a gap band\n     *  goes away as its rows come back, and focus lands on the first. */\n    activateLands?: string | undefined;\n    /** Its height (px) — how far PgUp / PgDn travel. */\n    h: number;\n}\n\n/** What the grid's items are built from. */\nexport interface PlanNavSource {\n    /** The pinned rows (the grid's first rows) and their heights. */\n    pinned: readonly VisibleRow[];\n    pinnedHeights: readonly number[];\n    /** The body items and their heights. */\n    items: readonly PlanBodyItem[];\n    heights: readonly number[];\n    /** The row index — who nests. */\n    index: PlanRowIndex;\n    /** The chart rows the user expanded. */\n    chartsExpanded: ReadonlySet<RowKey>;\n    /** The row focus, if any — its rails and strips return on Enter. */\n    focusCtx: PlanFocusCtx | undefined;\n}\n\n/**\n * The grid's items as the keyboard sees them — pinned rows first, then the\n * body in order.\n *\n * @param src - The rows, bands and state they are built from\n * @returns The items\n */\nexport function planNavItems(src: PlanNavSource): PlanNavItem[] {\n    const row = (v: VisibleRow, h: number): PlanNavItem => {\n        const parent = v.row.parent.type === \"some\" ? rowItemKey(v.row.parent.value) : undefined;\n        const nests = (src.index.children.get(v.row.key)?.length ?? 0) > 0;\n        const role = planRowRole(v, src.focusCtx, false);\n        // A rail or a strip is the way back from a row focus — its click\n        // returns, and it has no caret.\n        if (role === \"rail\" || role === \"ctx\") {\n            return { key: rowItemKey(v.row.key), kind: \"row\", parent, nests, activate: { t: \"focus.clear\" }, h };\n        }\n        const toggle = rowToggle(v, nests, src.chartsExpanded.has(v.row.key));\n        const isGroup = v.row.kind.type === \"group\";\n        return {\n            key: rowItemKey(v.row.key), kind: isGroup ? \"group\" : \"row\", parent, toggle, nests,\n            // A group band's click is its toggle; a row's, its selection.\n            activate: isGroup ? toggle?.event : { t: \"row.select\", key: v.row.key },\n            h,\n        };\n    };\n    const out: PlanNavItem[] = src.pinned.map((v, i) => row(v, src.pinnedHeights[i] ?? 0));\n    src.items.forEach((item, i) => {\n        const h = src.heights[i] ?? 0;\n        switch (item.kind) {\n            case \"row\": out.push(row(item.row, h)); break;\n            case \"gap\": out.push({\n                key: bodyItemKey(item), kind: \"gap\", nests: false,\n                activate: { t: \"focus.clear\" }, activateLands: rowItemKey(item.gap.first), h,\n            }); break;\n            case \"band\": out.push({\n                key: bodyItemKey(item), kind: \"band\",\n                band: { block: item.band.block, at: item.band.at, px: item.band.px }, nests: false, h,\n            }); break;\n            case \"failed\": out.push({ key: bodyItemKey(item), kind: \"failed\", nests: false, h }); break;\n        }\n    });\n    return out;\n}\n\n/** A pending move across a band — resolved once the band's rows land. */\nexport type PlanNavIntent =\n    /** Headed one step `dir` from the item `from`. */\n    | { t: \"step\"; from: string; dir: 1 | -1 }\n    /**\n     * Headed a page `dir` from the item `from` (#1398, CL10): `rest` of the page still to go once the rows past the band\n     * land — px of the viewport's height, or rows where the viewport could not be measured (`by`).\n     */\n    | { t: \"page\"; from: string; dir: 1 | -1; rest: number; by: \"px\" | \"items\" }\n    /** Headed for the source's first / last row, from the item `from`. */\n    | { t: \"first\"; from: string }\n    | { t: \"last\"; from: string };\n\n/** A key that moves through the rows a run stands for, pressed while the run holds the focus. */\nexport type PlanWaitKey = \"ArrowDown\" | \"ArrowUp\" | \"PageDown\" | \"PageUp\";\n\n/** What a key does. */\nexport type PlanNavMove =\n    /** Move focus onto an item — scrolled into view as `align` says, or not at all. */\n    | { t: \"focus\"; key: string; align: PlanNavAlign | undefined }\n    /**\n     * Fetch, then move (#1398, CL10): ask the source for the window beside a run, and leave an intent — the focus\n     * waiting on the item it set out from, never on the run, and the view where it is, until the rows land.\n     */\n    | { t: \"fetch\"; demand: PlanViewport; intent: PlanNavIntent }\n    /** Home / End past a run: read the source's first or last window where it is, the rows shown standing in, and land on its first or last row once it is in. */\n    | { t: \"edge\"; edge: \"first\" | \"last\" }\n    /** A key on a run holding the focus: it waits for the run's rows in view, and goes on from the first of them. */\n    | { t: \"wait\"; key: PlanWaitKey }\n    /** An interaction on the item — focus stays on (or lands on) `focus`,\n     *  since the interaction may re-render the item as another element (a\n     *  rail becoming a row) or take it away (a gap band). */\n    | { t: \"event\"; event: PlanEvent; focus: string }\n    /** A key the map owns that does nothing here (the edge of the grid). */\n    | { t: \"none\" };\n\n/** Rows a page moves when the viewport cannot be measured. */\nconst FALLBACK_PAGE_ITEMS = 10;\n\n/**\n * What a key does from an item.\n *\n * @param items - The grid's items, in order\n * @param from - The focused item's key\n * @param key - The `KeyboardEvent.key`\n * @param pageHeight - The viewport's height (px) — how far a page moves; 0 when unknown\n * @returns The move, or `undefined` for a key the row map does not own\n */\nexport function planNavKey(items: readonly PlanNavItem[], from: string, key: string, pageHeight: number): PlanNavMove | undefined {\n    const i = items.findIndex((it) => it.key === from);\n    if (i < 0) return undefined;\n    const cur = items[i]!;\n    // A run holding the focus stands for the rows the view shows there, still on their way: a key that moves through\n    // them waits for them, and goes on from the first of them in view once they land.\n    if (cur.band !== undefined && (key === \"ArrowDown\" || key === \"ArrowUp\" || key === \"PageDown\" || key === \"PageUp\")) return { t: \"wait\", key };\n    const focus = (it: PlanNavItem): PlanNavMove => ({ t: \"focus\", key: it.key, align: \"auto\" });\n    const step = (dir: 1 | -1): PlanNavMove => {\n        const next = items[i + dir];\n        if (next === undefined) return { t: \"none\" };\n        if (next.band === undefined) return focus(next);\n        // Past the rows read: the window beside the run asked for, the focus waiting where it is.\n        return { t: \"fetch\", demand: { kind: \"band\", block: next.band.block, at: next.band.at }, intent: { t: \"step\", from: cur.key, dir } };\n    };\n    const edge = (first: boolean): PlanNavMove => {\n        const target = first ? items[0] : items[items.length - 1];\n        if (target === undefined) return { t: \"none\" };\n        if (target.band === undefined) return target === cur ? { t: \"none\" } : focus(target);\n        // The source's far end, not read: its window read where it is, then the focus lands on its first or last row.\n        return { t: \"edge\", edge: first ? \"first\" : \"last\" };\n    };\n    const page = (dir: 1 | -1): PlanNavMove => {\n        let j = i;\n        let travelled = 0;\n        for (;;) {\n            const k = j + dir;\n            const next = items[k];\n            if (next === undefined) break;\n            // A page onto a band asks for the window past it and goes on the rest of its way once its rows land\n            // (#1398, CL10): fetch, then move.\n            if (next.band !== undefined) {\n                const rest = pageHeight > 0 ? pageHeight - travelled : FALLBACK_PAGE_ITEMS - Math.abs(j - i);\n                return { t: \"fetch\", demand: { kind: \"band\", block: next.band.block, at: next.band.at },\n                    intent: { t: \"page\", from: items[j]!.key, dir, rest, by: pageHeight > 0 ? \"px\" : \"items\" } };\n            }\n            j = k;\n            travelled += next.h;\n            if (pageHeight > 0 ? travelled >= pageHeight : Math.abs(j - i) >= FALLBACK_PAGE_ITEMS) break;\n        }\n        return j === i ? { t: \"none\" } : focus(items[j]!);\n    };\n    const toggleIt = (): PlanNavMove => (cur.toggle !== undefined\n        ? { t: \"event\", event: cur.toggle.event, focus: cur.key }\n        : { t: \"none\" });\n    switch (key) {\n        case \"ArrowDown\": return step(1);\n        case \"ArrowUp\": return step(-1);\n        case \"Home\": return edge(true);\n        case \"End\": return edge(false);\n        case \"PageDown\": return page(1);\n        case \"PageUp\": return page(-1);\n        case \"ArrowRight\": {\n            if (cur.toggle !== undefined && !cur.toggle.open) return toggleIt();\n            const next = items[i + 1];\n            if (cur.nests && cur.toggle?.open === true && next !== undefined && next.parent === cur.key) return focus(next);\n            return { t: \"none\" };\n        }\n        case \"ArrowLeft\": {\n            if (cur.toggle?.open === true) return toggleIt();\n            const parent = cur.parent !== undefined ? items.find((it) => it.key === cur.parent) : undefined;\n            return parent !== undefined ? focus(parent) : { t: \"none\" };\n        }\n        case \"Enter\":\n            return cur.activate !== undefined\n                ? { t: \"event\", event: cur.activate, focus: cur.activateLands ?? cur.key }\n                : { t: \"none\" };\n        case \" \":\n            return toggleIt();\n        default:\n            return undefined;\n    }\n}\n\n/** Where a pending band move stands after the grid changed. */\nexport type PlanNavResolution =\n    | { t: \"resolved\"; key: string }\n    /** Still waiting — and, where the rows landed so far stop short of where it is headed, the run past them to ask for. */\n    | { t: \"pending\"; ask?: PlanViewport | undefined }\n    | { t: \"cancel\" };\n\n/**\n * What the grid knows of its source's ends — an inline canvas holds both, and\n * never loads.\n */\nexport interface PlanNavEdges {\n    /** A window is still in flight: rows may yet arrive. */\n    loading: boolean;\n    /** The source's first element is resident. */\n    atStart: boolean;\n    /** The source's last element is resident. */\n    atEnd: boolean;\n}\n\n/**\n * Where a pending band move stands against the grid now. A demanded window\n * can be IN FLIGHT without a band standing for it — a source that reports no\n * total has no bands — so an item missing past the move's start is not the\n * end of the source: the move waits while a window loads, and for Home / End\n * until the source's own first / last element is resident. It resolves on a\n * row — or a failed window, which has its own Retry — and is cancelled once\n * the item it started from is gone, or nothing more can arrive: Home and End's\n * too, which wait among the rows they set out from (#1398, CL10) — gone while\n * the far end is not in, those rows are another's now, a new narrowing's or a\n * new count's, and the move goes with them.\n *\n * @param items - The grid's items now\n * @param intent - The pending move\n * @param edges - What the grid knows of its source's ends\n * @returns Its resolution\n */\nexport function resolveNavIntent(items: readonly PlanNavItem[], intent: PlanNavIntent, edges: PlanNavEdges): PlanNavResolution {\n    const land = (target: PlanNavItem | undefined, reached: boolean): PlanNavResolution => {\n        if (target !== undefined && target.band === undefined && reached) return { t: \"resolved\", key: target.key };\n        return target !== undefined || edges.loading || !reached ? { t: \"pending\" } : { t: \"cancel\" };\n    };\n    switch (intent.t) {\n        case \"step\": {\n            const i = items.findIndex((it) => it.key === intent.from);\n            if (i < 0) return { t: \"cancel\" };\n            const target = items[i + intent.dir];\n            // Nothing past the start yet: more may be on the way.\n            if (target === undefined) return edges.loading ? { t: \"pending\" } : { t: \"cancel\" };\n            return land(target, true);\n        }\n        case \"page\": {\n            // Its first step waits as a step's does; landed, the page goes on the rest of its way, to the row a page\n            // on — or the source's last row on the way. Rows that stop short of it at a band still unread are never\n            // where it lands: the window past them is asked for, and the page waits for it — never at the loaded edge.\n            const i = items.findIndex((it) => it.key === intent.from);\n            if (i < 0) return { t: \"cancel\" };\n            const first = items[i + intent.dir];\n            if (first === undefined) return edges.loading ? { t: \"pending\" } : { t: \"cancel\" };\n            if (first.band !== undefined) return land(first, true);\n            let j = i;\n            let travelled = 0;\n            for (;;) {\n                const next = items[j + intent.dir];\n                if (next === undefined) break;\n                if (next.band !== undefined) return { t: \"pending\", ask: { kind: \"band\", block: next.band.block, at: next.band.at } };\n                j += intent.dir;\n                travelled += intent.by === \"px\" ? next.h : 1;\n                if (travelled >= intent.rest) break;\n            }\n            return { t: \"resolved\", key: items[j]!.key };\n        }\n        case \"first\":\n        case \"last\": {\n            const first = intent.t === \"first\";\n            const r = land(first ? items[0] : items[items.length - 1], first ? edges.atStart : edges.atEnd);\n            return r.t === \"pending\" && !items.some((it) => it.key === intent.from) ? { t: \"cancel\" } : r;\n        }\n    }\n}\n\n// ── The DOM side: which item a node is in, and a row's widgets ─────────────\n\n/** What a row's walk steps through in time order: its elements, and a bucket\n *  cell's `+n` chip where the tiles it folds would be (#1267). */\nexport const PLAN_WALK_SELECTOR = `${PLAN_ELEMENT_SELECTOR},[data-tile-more]`;\n\n/** Native widgets a row can hold — its controls, Retry, and whatever the\n *  author's render mounts. */\nconst WIDGET_SELECTOR = \"button, a[href], input, select, textarea, [tabindex]\";\n/** The canvas's own row widgets — out of the tab order (`tabIndex=-1`), reached\n *  through the row's Tab walk instead: a row's controls, and a failed run's\n *  Retry (#1398, the shared loading parts'). */\nconst OWN_WIDGET_SELECTOR = \"[data-plan-control], [data-loading-retry]\";\n\n/**\n * The grid item (row, band) a node belongs to in THIS canvas — a canvas nested\n * in an expand render answers for its own.\n *\n * @param node - A DOM node (an event target)\n * @param body - The canvas body\n * @returns The item element, or `null`\n */\nexport function gridItemOf(node: EventTarget | null, body: HTMLElement): HTMLElement | null {\n    if (!(node instanceof Element)) return null;\n    const item = node.closest<HTMLElement>(\"[data-plan-item]\");\n    if (item === null || !body.contains(item)) return null;\n    return item.closest(\"[data-plan-body]\") === body ? item : null;\n}\n\n/** An element's window fraction — its time position (`data-plan-frac`). */\nfunction fracOf(el: Element): number {\n    const f = Number(el.getAttribute(\"data-plan-frac\"));\n    return Number.isFinite(f) ? f : 0;\n}\n\n/**\n * A row's elements in time order — the runs, tiles, chips, marks and cells it\n * draws inside the window (overscan marks, clipped out of view, are not\n * reachable), and a bucket cell's `+n` chip in place of the tiles it folds\n * (#1267).\n *\n * @param row - The row element\n * @param body - The canvas body\n * @returns Its focusable elements, earliest first\n */\nexport function plotElements(row: HTMLElement, body: HTMLElement): HTMLElement[] {\n    const out: HTMLElement[] = [];\n    row.querySelectorAll<HTMLElement>(PLAN_WALK_SELECTOR).forEach((el) => {\n        // An element takes focus (`tabIndex=-1`); a label naming the same mark\n        // does not, and nor does a tile folded out of sight.\n        if (!el.hasAttribute(\"tabindex\") || el.hasAttribute(\"data-folded\") || gridItemOf(el, body) !== row) return;\n        const f = fracOf(el);\n        if (f < 0 || f >= 1) return;\n        out.push(el);\n    });\n    // Stable: equal instants keep their DOM order (lanes top to bottom).\n    return out.map((el, i) => ({ el, i, f: fracOf(el) }))\n        .sort((a, b) => (a.f - b.f) || (a.i - b.i))\n        .map((x) => x.el);\n}\n\n/**\n * A row's widgets in reading order, cell by cell — the gutter's controls, the\n * plot's elements in time order then anything the author's render mounts. The\n * Tab walk through a row.\n *\n * @param row - The row element\n * @param body - The canvas body\n * @returns Its widgets, in walk order\n */\nexport function rowWidgets(row: HTMLElement, body: HTMLElement): HTMLElement[] {\n    const elements = new Set(plotElements(row, body));\n    const out: HTMLElement[] = [];\n    for (const cell of Array.from(row.children)) {\n        const inCell = [...elements].filter((el) => cell.contains(el));\n        const others: HTMLElement[] = [];\n        cell.querySelectorAll<HTMLElement>(WIDGET_SELECTOR).forEach((el) => {\n            if (elements.has(el) || el.matches(PLAN_WALK_SELECTOR) || gridItemOf(el, body) !== row) return;\n            if ((el as HTMLButtonElement).disabled === true) return;\n            // The canvas's own widgets are out of the tab order on purpose;\n            // an author's are reachable only when they are tabbable at all.\n            if (!el.matches(OWN_WIDGET_SELECTOR) && el.tabIndex < 0) return;\n            others.push(el);\n        });\n        appendAll(out, inCell);\n        appendAll(out, others);\n    }\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * The canvas's live region (#819) — one polite status line that says what\n * changed where a sighted reader would SEE it change: a selection, a section\n * or chart opening or closing, a row focus coming or going, a grain or\n * resolution change, a paged window landing.\n *\n * The words are the controller's (`PlanSnapshot.announce`), made by the\n * action that changed the state — so a landing announces in the same\n * notification, and the same commit, as its rows. This leaf only shows them:\n * it is subscribed to nothing else, so an announcement renders nothing else.\n *\n * @packageDocumentation\n */\n\nimport { VisuallyHidden } from \"@chakra-ui/react\";\nimport { usePlanSelector } from \"../controller/react.js\";\nimport type { PlanSnapshot } from \"../controller/index.js\";\n\nconst selectAnnounce = (s: PlanSnapshot) => s.announce;\n\n/**\n * The live region — mount once, inside the canvas's controller.\n *\n * @returns The visually hidden status line\n */\nexport function PlanAnnouncer() {\n    const announce = usePlanSelector(selectAnnounce);\n    return (\n        <VisuallyHidden role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-plan-announce>\n            {/* Keyed by the message's number: the same words said twice are a\n                new node, and a new announcement. */}\n            {announce !== null && <span key={announce.seq}>{announce.text}</span>}\n        </VisuallyHidden>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Search Records over the source of the rows a Plan pages (#1513) — its `rows`\n * source, or a paged resource kind's, whose windows are its narrowing's rows just\n * as theirs are: navigation over the whole\n * record, never a field search, which is the rail's. The box seeks and lists the\n * rows as the binding reads them with no narrowing — by primary key where it\n * joins its rows, else by its default index, a lean binding reading no rows by\n * their keys — so it finds a row the rail hides, and a line says what hides it (the shared hidden pick,\n * `shared/schedule/hidden.ts`). The canvas pages the narrowing's rows in its\n * index's order, so a row's place in the record says nothing of its place on\n * the canvas: a pick asks e3 where the row stands among the rows the narrowing\n * holds (`recordSlicePosition`); where it holds none of it, clears what hides\n * the row and asks again under the narrowing that leaves; and hands the place\n * to the controller, which opens its window once the source reads that\n * narrowing.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { StringType, isValueOf, none, printFor, some, type ValueTypeOf } from \"@elaraai/east\";\nimport { RecordSliceWhereType, type RecordSliceEntry } from \"@elaraai/east-ui/internal\";\nimport type { DatasetKeyMatchRange, DatasetKeyQuery, KeySearchSource } from \"@elaraai/east-ui-components\";\nimport { awaitTracked, recordSlicePage, recordSlicePosition, recordSliceRows, recordSliceSeek, toSeekQuery } from \"@elaraai/east-ui-components/internal\";\nimport { CANVAS_KEY_TYPE } from \"./controller/seek.js\";\nimport type { PlanController } from \"./controller/index.js\";\nimport { hiddenLine, usePartRevision, useMoves, useRelist, type SourceHidden, type SourceHiding } from \"../shared/schedule/hidden.js\";\nimport type { PlanSourcePart } from \"./root/sources.js\";\nimport type { PlanWords } from \"./words.js\";\n\ntype Where = ValueTypeOf<typeof RecordSliceWhereType>;\n\nconst printWhere = printFor(RecordSliceWhereType);\n/** The box's `resetKey`: what tells this search from a paged source's own. */\nconst PLAN_ROWS_FIND = \"plan-rows\";\n\n/**\n * Whether a search is this one, over the source the canvas pages: where the toolbar folds it first (`shell/Toolbar.tsx`).\n *\n * @param search - The Plan's search; `undefined` with none\n * @returns Whether it is {@link usePlanRowsFind}'s\n */\nexport function isPlanRowsFind(search: KeySearchSource | undefined): boolean {\n    return search?.resetKey === PLAN_ROWS_FIND;\n}\n\n/** No narrowing: the record's rows, as the binding reads them by default. */\nconst WHOLE_RECORD: Where = new Map();\n\n/**\n * What hides a row as far as e3 has said: nothing while it has not been asked of, or the narrowing holds it.\n *\n * @param pick - The source's hidden pick\n * @param id - The row's key\n * @returns What hides it, for its line and a pick's clear; `undefined` where nothing is known to\n */\nfunction knownHiding(pick: SourceHidden, id: string): readonly SourceHiding[] | undefined {\n    const state = pick.rows.stateOf(id);\n    return state?.hidden === true ? [{ pick, answer: state.answer }] : undefined;\n}\n\n/** What {@link usePlanRowsFind} reads. */\nexport interface PlanRowsFindProps {\n    /** The part of the source the canvas pages its rows from; `undefined` with none, or over inline rows: no box. */\n    readonly part: PlanSourcePart | undefined;\n    /** The hidden pick over it. */\n    readonly pick: SourceHidden;\n    /** Clears what hides a row, saying so where the Plan says a gesture's error; `false` where it could not. */\n    readonly clear: (hidden: readonly SourceHiding[] | undefined) => boolean;\n    /** The canvas's controller: what goes to the row. */\n    readonly controller: PlanController;\n    /** The canvas's words. */\n    readonly words: PlanWords;\n    /** Says why a pick could not go to its row; `undefined` as the next begins. */\n    readonly onError: (words: string | undefined) => void;\n}\n\n/**\n * Search Records' source over the source the canvas pages — see the module docs.\n *\n * @param props - The source's part, its hidden pick, the clear, the controller, the words and where an error is said\n * @returns The source; `undefined` with no part\n */\nexport function usePlanRowsFind({ part, pick, clear, controller, words, onError }: PlanRowsFindProps): KeySearchSource | undefined {\n    const latest = useRef({ part, pick, clear, controller, words, onError });\n    latest.current = { part, pick, clear, controller, words, onError };\n    // The keys the box's lines name, by their place in the record: a pick goes to the row its line named.\n    const [listed] = useState(() => new Map<number, string>());\n    // The latest pick: a clear of the box, or another pick, leaves one on its way behind.\n    const going = useRef(0);\n    const find = useCallback(async (query: DatasetKeyQuery): Promise<DatasetKeyMatchRange> => {\n        const source = latest.current.part;\n        if (source === undefined) return { found: false, row: 0, count: 0 };\n        const seekQuery = toSeekQuery(query);\n        const range = await awaitTracked(() => recordSliceSeek(source, WHOLE_RECORD, seekQuery));\n        return { found: range.found, row: Number(range.row), count: Number(range.count) };\n    }, []);\n    const listRange = useCallback(async (row: number, limit: number) => {\n        const source = latest.current.part;\n        if (source === undefined) return [];\n        const page = await awaitTracked(() => recordSlicePage(source, { where: WHOLE_RECORD, area: none }, BigInt(row), BigInt(limit)));\n        const entries = page as readonly RecordSliceEntry[];\n        const ids = entries.map((entry) => entry.key as string);\n        ids.forEach((id, i) => listed.set(row + i, id));\n        // Which of them the narrowing hides and what hides those, asked of e3: a line says so as the answers land.\n        const { pick: rowsPick, words: said } = latest.current;\n        rowsPick.rows.askIds(ids);\n        return ids.map((id, i) => {\n            const hidden = knownHiding(rowsPick, id);\n            // A line names a row by what the query was asked of: the index the record's rows are read through — its name,\n            // where it reads them by name — else its key.\n            const sought = entries[i]!.ik.value;\n            const name = isValueOf(sought, StringType) ? sought as string : id;\n            return { row: row + i, text: name, label: hidden === undefined ? name : `${name} · ${hiddenLine(hidden, said, said.m)}` };\n        });\n    }, [listed]);\n    const jump = useCallback((row: number) => {\n        const { part: source, onError: say } = latest.current;\n        const key = listed.get(row);\n        if (source === undefined || key === undefined) return;\n        const seq = ++going.current;\n        say(undefined);\n        /** Its place among the rows of the narrowing the source holds now, the narrowing beside it. */\n        const placed = () => awaitTracked(() => {\n            const rows = recordSliceRows(source, [key]);\n            if (rows.type === \"none\") return none;\n            const stored = rows.value[0]!;\n            if (stored.type === \"none\") return some({ at: null, where: source.read().where });\n            const where = source.read().where;\n            const at = recordSlicePosition(source, where, key, stored.value);\n            return at.type === \"none\" ? none : some({ at: at.value, where });\n        });\n        void (async () => {\n            let place = await placed();\n            if (seq !== going.current) return;\n            if (place.at === null) {\n                // The narrowing hides it: what e3 has said hides it, else every choice of the source.\n                const { pick: now, clear: clearing } = latest.current;\n                if (!clearing(knownHiding(now, key) ?? [{ pick: now, answer: undefined }])) return;\n                place = await placed();\n                if (seq !== going.current) return;\n            }\n            if (place.at !== null) latest.current.controller.goToRow(key, Number(place.at), printWhere(place.where));\n        })().catch((error: unknown) => {\n            if (seq === going.current) latest.current.onError(error instanceof Error ? error.message : latest.current.words.m.keySearchUnplaced());\n        });\n    }, [listed]);\n    const clearBox = useCallback(() => {\n        going.current += 1;\n        listed.clear();\n        latest.current.controller.leaveRow();\n    }, [listed]);\n    // The box asks its query again as the record moves, and lists its lines again as e3 says what hides a row.\n    const requery = useMoves([usePartRevision(part)]);\n    const relist = useRelist([pick]);\n    const noMatchesText = words.m.keySearchNoMatches();\n    const present = part !== undefined;\n    return useMemo(() => (present ? {\n        resetKey: PLAN_ROWS_FIND, requery, relist, keyType: CANVAS_KEY_TYPE, find, listRange, jump, clear: clearBox, noMatchesText,\n    } : undefined), [present, requery, relist, find, listRange, jump, clearBox, noMatchesText]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The keyboard carry's live region (#825) — what a carried element does, said\n * as it happens: picked up, where it would land, refused there, dropped or\n * cancelled. Its own region, as a pointer drag speaks through the drag\n * layer's: a carry's steps are its own, not the canvas's state changes.\n *\n * @packageDocumentation\n */\n\nimport { useSyncExternalStore } from \"react\";\nimport { VisuallyHidden } from \"@chakra-ui/react\";\nimport type { PlanEditStore } from \"./store.js\";\n\n/**\n * The carry's live region — mount once per canvas.\n *\n * @param props - The canvas's moves\n * @returns The visually hidden status line\n */\nexport function PlanCarryAnnouncer({ store }: { store: PlanEditStore }) {\n    const said = useSyncExternalStore(store.subscribe, () => store.said);\n    return (\n        <VisuallyHidden role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-plan-carry-announce>\n            {/* Keyed by the message's number: the same words said twice are a\n                new node, and a new announcement. */}\n            {said !== null && <span key={said.seq}>{said.text}</span>}\n        </VisuallyHidden>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * What the inspector reads of the canvas's rows (#1197, `Plan Builder\n * Spec.md` PB40): what a heat, table or chart row draws in one bucket, in\n * words — the values the canvas draws there, folded to the period as the row\n * draws them (#824), each said as its own cell says it to a reader (#819).\n *\n * @packageDocumentation\n */\n\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { heatValueText, segmentsText, tablePartsText, weightValueText } from \"../a11y.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport type { PlanDerived, PlanRowValue } from \"../model.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport { readoutTable } from \"../rows/chart-geometry.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanWords } from \"../words.js\";\n\n/** What the inspector reads of the canvas's rows (#1197). */\nexport interface PlanCanvasInspect {\n    /**\n     * A row the canvas holds, by its key.\n     *\n     * @param key - The row's key\n     * @returns The row, or `undefined` for one the canvas does not hold\n     */\n    row(key: RowKey): PlanRowValue | undefined;\n    /**\n     * What a heat, table or chart row draws in the bucket an instant falls in.\n     *\n     * @param key - The row's key\n     * @param at - The instant\n     * @returns Its value there, in words; `undefined` where it draws nothing there, or for a row of another kind\n     */\n    valueAt(key: RowKey, at: PlanInstantValue): string | undefined;\n}\n\n/**\n * What a row draws in the bucket an instant falls in, in words: a heat cell's\n * label or value, a weight bar's booked share, a composition's segments, a\n * table cell's parts, or each of a chart's data layers' last value in it.\n *\n * @param row - The row\n * @param derived - The canvas's derivations: what each row draws, folded to the period\n * @param scale - The shared scale\n * @param w - The canvas's words\n * @param at - The instant\n * @returns Its value there; `undefined` where it draws nothing there, or for a row of another kind\n */\nexport function rowValueAt(row: PlanRowValue, derived: PlanDerived, scale: PlanScale, w: PlanWords, at: PlanInstantValue): string | undefined {\n    const bi = scale.bucketOf(at);\n    if (bi < 0) return undefined;\n    const kind = row.kind;\n    switch (kind.type) {\n        case \"heat\": {\n            const arm = derived.heatArms.get(row.key) ?? kind.value.cells;\n            switch (arm.type) {\n                case \"heat\": {\n                    const cell = arm.value.cells.find((c) => scale.bucketOf(c.at) === bi);\n                    if (cell === undefined) return undefined;\n                    const value = getSomeorUndefined(cell.value);\n                    const format = getSomeorUndefined(arm.value.format);\n                    // A cell prints its label, else its value through the row's format — as the canvas prints it.\n                    const label = getSomeorUndefined(cell.label) ?? (value !== undefined && format !== undefined ? w.value(value, format) : undefined);\n                    const warn = getSomeorUndefined(arm.value.scale.warnAt);\n                    return heatValueText(value, label, value !== undefined && warn !== undefined && value >= warn, w);\n                }\n                case \"weight\": {\n                    const cell = arm.value.cells.find((c) => scale.bucketOf(c.at) === bi);\n                    return cell === undefined ? undefined : weightValueText(cell.fraction, cell.planned, w, getSomeorUndefined(arm.value.format));\n                }\n                case \"segments\": {\n                    const cell = arm.value.cells.find((c) => scale.bucketOf(c.at) === bi);\n                    return cell === undefined ? undefined : segmentsText(cell.segments, w, getSomeorUndefined(arm.value.format));\n                }\n            }\n            return undefined;\n        }\n        case \"table\": {\n            // Each series' parts in the bucket, in series order, each printed as the row prints it.\n            const rowFormat = getSomeorUndefined(kind.value.format);\n            const texts: string[] = [];\n            for (const series of derived.tableSeries.get(row.key) ?? kind.value.series) {\n                const format = getSomeorUndefined(series.format) ?? rowFormat;\n                for (const cell of series.cells) {\n                    if (scale.bucketOf(cell.at) !== bi) continue;\n                    const value = getSomeorUndefined(cell.value);\n                    texts.push(getSomeorUndefined(cell.text) ?? (value !== undefined ? w.value(value, format) : \"—\"));\n                }\n            }\n            return texts.length === 0 ? undefined : tablePartsText(texts, w);\n        }\n        case \"chart\": {\n            const texts = readoutTable(derived.charts.get(row.key) ?? kind.value, scale, w).get(bi);\n            return texts === undefined ? undefined : w.m.list({ parts: texts });\n        }\n        default:\n            return undefined;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Optimise in the Plan (#1409, #1419; `Optimise Spec.md` §5.1, §9.5, R24):\n * the plan window in view and the kinds' backlog as the run's request — every\n * event kind's rows in the window and its backlog by slot and by key, as the\n * session holds them, drafts in place, and every resource kind's rows as\n * context — and the result landed on the canvas's events as one edit: the\n * diff by key, kind by kind, recorded as one step (`ScheduleEditing.record`,\n * origin `optimise`), its operations told by place — backlog → placed is an\n * add on the canvas, placed → backlog a remove, a moved or re-assigned bar a\n * change — and what the landing draws kept until Apply: each element's\n * operation and provenance, and the ghosts of what stood on each row before.\n * Each kind's rows are read once for the request (`planRows`), and each\n * kind's events once for its landing — what each changed event was before the\n * run, among the events the request was built from — so neither's work grows\n * with the events times the rows.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useRef } from \"react\";\nimport { DictType, SortedMap, StringType, compareFor, decodeBeast2For, fromEastTypeValue, none, printFor, type EastType, type ValueTypeOf } from \"@elaraai/east\";\nimport { ScheduleEventRefType, ScheduleOptimiseRequestTypeFor, ScheduleOptimiseResultTypeFor, scheduleOptimiseRows, type PlanPayloadType } from \"@elaraai/e3-ui/internal\";\nimport { optimiseMessages, useTrackedEvaluation, type Formatters } from \"@elaraai/east-ui-components\";\nimport { diffOptimiseRows, mergeOptimiseDiffs, optimiseIdOf, optimiseKeyOf, optimisePlacementOps } from \"../shared/func/optimise-diff.js\";\nimport type { OptimiseCounts } from \"../shared/func/use-optimise.js\";\nimport { scheduleWithinCap, type ScheduleCellsRead } from \"../shared/schedule/cells.js\";\nimport type { PlanEventEditing, PlanEventReadValue, PlanKindDraftsValue } from \"./edit/events.js\";\nimport type { PlanInstantValue } from \"./instant.js\";\nimport { rowKeyOf, type PlanWireBlock } from \"./model.js\";\nimport type { PlanEventRange } from \"./root/events.js\";\nimport type { PlanElementOp, PlanGhost } from \"./rows/element-optimise.js\";\n\n/** One event kind, as the Plan's payload carries it. */\ntype PlanEventKindValue = ValueTypeOf<typeof PlanPayloadType>[\"events\"][number];\n/** One resource kind, as the Plan's payload carries it. */\ntype PlanResourceKindValue = ValueTypeOf<typeof PlanPayloadType>[\"resources\"][number];\n/** One event as a kind's seams read it. */\ntype PlanEventItemValue = PlanEventReadValue[\"item\"];\n/** A kind's rows by key, as the request and the result carry them. */\ntype Rows = SortedMap<unknown, unknown>;\n/** A kind's events by key, each as a kind's seams read it: what a landing finds a changed event among. */\ntype EventsByKey = SortedMap<unknown, PlanEventItemValue>;\n\n/** The run's request: the window, the run's number, each event kind's rows by slot, and each resource kind's. */\nexport interface PlanOptimiseRequest {\n    readonly from: Date;\n    readonly to: Date;\n    readonly run: bigint;\n    readonly events: Readonly<Record<string, Rows>>;\n    readonly resources: Readonly<Record<string, Rows>>;\n}\n\n/** The run's answer: each event kind's rows by slot, complete. */\nexport interface PlanOptimiseResult {\n    readonly events: Readonly<Record<string, Rows>>;\n}\n\n/**\n * What the runs left on the Plan's events, until Apply (R17): each\n * element's operation, by the element's key, a later run's over an\n * earlier's; the ghosts of what stood on each row before a run, by the row's\n * key; and whether the latest run moved an event into or out of the backlog.\n */\nexport interface PlanOptimised {\n    readonly ops: ReadonlyMap<string, PlanElementOp>;\n    readonly ghosts: ReadonlyMap<string, readonly PlanGhost[]>;\n    readonly backlogChanged: boolean;\n}\n\n/** An element's key: its event's ref, as East prints it — what the canvas names its elements by. */\nconst printEventRef = printFor(ScheduleEventRefType);\n\n/**\n * What a spec watches a run's request and its landing by (test use only), as\n * the canvas's render probe watches the canvas: each read of an event kind's\n * rows the request makes as a click builds it, and each read of a kind's\n * events its landing makes for what a changed event was before the run.\n */\nexport interface PlanOptimiseProbe {\n    /** Called for each read of a kind's rows, with the kind's slot. */\n    readonly readRows?: (kind: string) => void;\n    /** Called for each read of a kind's events as they stood before the run, as its result lands, with the kind's slot. */\n    readonly readEvents?: (kind: string) => void;\n}\n\n/** The probe a spec installed; `undefined` outside tests. */\nlet planOptimiseProbe: PlanOptimiseProbe | undefined;\n\n/**\n * Install (or clear) the probe a run's request and its landing are watched by. Test use only.\n *\n * @param probe - What watches it; `undefined` clears it\n */\nexport function setPlanOptimiseProbe(probe: PlanOptimiseProbe | undefined): void {\n    planOptimiseProbe = probe;\n}\n\n/** A kind's key and row types, from the kind on the wire. */\nfunction typesOf(kind: Pick<PlanEventKindValue, \"editing\">): { keyType: EastType; rowType: EastType } {\n    return {\n        keyType: kind.editing.keyType.type === \"some\" ? fromEastTypeValue(kind.editing.keyType.value) as EastType : StringType,\n        rowType: fromEastTypeValue(kind.editing.entryType) as EastType,\n    };\n}\n\n/**\n * The request and result types over the Plan's kinds: what the bound\n * optimiser is called with, as the tag held it to.\n *\n * @param kinds - The event kinds\n * @param resources - The resource kinds\n * @returns The request and result East types\n */\nexport function planOptimiseTypes(kinds: readonly PlanEventKindValue[], resources: readonly PlanResourceKindValue[]): { request: EastType; result: EastType } {\n    const events = scheduleOptimiseRows(kinds.map((kind) => [kind.key, typesOf(kind)] as const));\n    const context = scheduleOptimiseRows(resources.map((kind) => [kind.key, { keyType: fromEastTypeValue(kind.keyType) as EastType, rowType: fromEastTypeValue(kind.rowType) as EastType }] as const));\n    return { request: ScheduleOptimiseRequestTypeFor(events, context), result: ScheduleOptimiseResultTypeFor(events) };\n}\n\n/** The plan window in view, as the request carries it. */\nexport interface PlanOptimiseWindow { readonly from: Date; readonly to: Date }\n\n/** Whether a run's request can carry the window whole now: `ready`, `reading` or `unread` ({@link planOptimiseReady}). */\nexport type PlanOptimiseReadiness = \"ready\" | \"reading\" | \"unread\";\n\n/**\n * Whether a run's request can carry the window whole now (#1409, R24): every\n * kind's events in the window and its backlog, and each event's row held where\n * {@link planOptimiseRequest} reads it — called in a tracked read of a\n * component of its own ({@link PlanOptimiseReader}), which hears each land, so\n * the eye waits for them and the request a click makes finds them held.\n *\n * The request reads every event's row of a kind at once (`planRows`), from\n * the rows the canvas reads over its range — the plan window and the periods\n * laid out beyond it — and the backlog's beside them, drafts in place. So the\n * eye waits for those reads, read as the canvas reads them, and no row is read\n * by its key: whatever the number of events in the window, the eye asks e3 for\n * the windows alone. Read by its key, each row would be a key search and a\n * one-row page an event, for rows the canvas's windows hold already. Every\n * kind is read in one pass, so the kinds' windows are asked together.\n *\n * `reading` while one is on its way; `unread` for a window no request carries\n * whole: a kind past the cap of events over it (#1039), none of whose events\n * is read, or one read by its cells, never read over the window — a run would\n * place the backlog over events it was never shown.\n *\n * @param kinds - The event kinds\n * @param editing - The kinds' editing: each kind's drafts, which every read puts in place\n * @param window - The plan window in view\n * @param range - The range the canvas reads its event kinds' rows over (`eventReadRange`): the window, and the periods laid out beyond each edge — where the request reads each event's row\n * @param cells - The kinds' cells and counts, when the reader gives a kind cells\n * @returns Whether the request can be made: `ready`, `reading` or `unread`\n */\nexport function planOptimiseReady(kinds: readonly PlanEventKindValue[], editing: PlanEventEditing, window: PlanOptimiseWindow,\n    range: PlanEventRange, cells: ScheduleCellsRead | undefined): PlanOptimiseReadiness {\n    let reading = false;\n    for (const kind of kinds) {\n        // Read by its series index's cells, or past the cap: no window of it is read. A kind given its window's own rows\n        // (#1599) is read over the window, and carries its request.\n        if (cells?.reads.has(kind.key) === true && !cells.windowed.has(kind.key)) return \"unread\";\n        const within = scheduleWithinCap(kind.count, window.from, window.to);\n        if (within.type === \"some\" && !within.value) return \"unread\";\n        const drafts = editing.draftsOf(kind.key);\n        // Where the request reads every event's row, at once: the kind's rows over the range the canvas reads, which\n        // covers the window, and its backlog's — the reads the canvas makes, so no request of their own.\n        const held = kind.planRows(range.from, range.to, drafts);\n        // What the request carries: the window's events, and the backlog.\n        const placed = kind.planItems(window.from, window.to, drafts, none);\n        const waiting = kind.backlog ? kind.planUnscheduled(window.from, window.to, drafts, none) : undefined;\n        if (within.type !== \"some\" || held.type !== \"some\" || placed.type !== \"some\" || waiting?.type === \"none\") reading = true;\n    }\n    return reading ? \"reading\" : \"ready\";\n}\n\n/** Props of {@link PlanOptimiseReader}. */\nexport interface PlanOptimiseReaderProps {\n    /** The event kinds. */\n    kinds: readonly PlanEventKindValue[];\n    /** The kinds' editing: each kind's drafts, which every read puts in place. */\n    editing: PlanEventEditing;\n    /** The plan window in view. */\n    window: PlanOptimiseWindow;\n    /** The range the canvas reads its event kinds' rows over: where each event's row is held. */\n    range: PlanEventRange;\n    /** The kinds' cells and counts, when the reader gives a kind cells. */\n    cells: ScheduleCellsRead | undefined;\n    /** Where whether the request can be made goes: called only when that moves. */\n    onReady: (ready: PlanOptimiseReadiness) => void;\n}\n\n/**\n * Whether a run's request can carry the window whole (#1409, R24), read in a\n * component of its own (#1343): what {@link planOptimiseReady} reads lands in\n * as many settles as the searches it touches — every kind's rows over the\n * range the canvas reads, its events in the window, and its backlog — and each re-runs\n * this alone. It hands the canvas whether the request can be made only when\n * that moves, so the canvas renders as the eye's state changes, never at every\n * settle of what it reads. A read that fails is `unread`: no request carries a\n * window it could not read.\n *\n * @param props - What is read, over what, and where it goes\n * @returns Nothing: it reads\n */\nexport function PlanOptimiseReader({ kinds, editing, window, range, cells, onReady }: PlanOptimiseReaderProps): null {\n    const read = useCallback(() => planOptimiseReady(kinds, editing, window, range, cells), [kinds, editing, window, range, cells]);\n    const { result } = useTrackedEvaluation(read);\n    const ready: PlanOptimiseReadiness = result.ok ? result.value : \"unread\";\n    // What the canvas holds: its own until the first read is reported.\n    const reported = useRef<PlanOptimiseReadiness | undefined>(undefined);\n    useLayoutEffect(() => {\n        if (reported.current === ready) return;\n        reported.current = ready;\n        onReady(ready);\n    });\n    return null;\n}\n\n/**\n * A kind's rows by key, from the bytes of its record's own Dict: East's own\n * collection, the key type's order deciding which key is which.\n *\n * @param bytes - beast2 of `DictType(keyType, rowType)`\n * @param keyType - The record's key type\n * @param rowType - Its row type\n * @returns The rows, by key\n */\nfunction rowsByKey(bytes: Uint8Array, keyType: EastType, rowType: EastType): Rows {\n    const decoded = decodeBeast2For(DictType(keyType, rowType))(bytes) as ReadonlyMap<unknown, unknown>;\n    return decoded instanceof SortedMap ? decoded : new SortedMap([...decoded], compareFor(keyType) as (a: unknown, b: unknown) => number);\n}\n\n/**\n * A kind's events a run's request carries (R1, R24): those overlapping the plan\n * window and its backlog, the drafts in place, as Plan draws them — none of a\n * read still in flight. The request finds each one's row among the kind's rows\n * ({@link planOptimiseRequest}), and its landing what each was before the run\n * ({@link landPlanOptimise}).\n *\n * @param kind - The event kind\n * @param drafts - Its drafts, which every read puts in place\n * @param window - The plan window\n * @returns Its events in the window, then its backlog's\n */\nfunction windowEvents(kind: PlanEventKindValue, drafts: PlanKindDraftsValue, window: PlanOptimiseWindow): PlanEventItemValue[] {\n    const placed = kind.planItems(window.from, window.to, drafts, none);\n    const waiting = kind.backlog ? kind.planUnscheduled(window.from, window.to, drafts, none) : none;\n    return [...(placed.type === \"some\" ? placed.value : []), ...(waiting.type === \"some\" ? waiting.value : [])];\n}\n\n/**\n * The run's request (R1, R24, O3, O5): the window, the run's number, every\n * event kind's rows in the window and its backlog by key, as the session\n * holds them — base plus every unapplied draft, every row whatever the rail\n * shows — and every resource kind's rows, read whole. A kind's rows are read\n * once (`planRows`): its rows over the range the canvas reads and its\n * backlog's, drafts in place, which the eye waits for — none is read by its\n * key — indexed by key, and each event's row found there, so the click's cost\n * grows with the events plus the rows, never their product. A kind whose\n * window is still being read carries no rows: the eye is disabled until every\n * kind has read, and for a window no request carries whole ({@link planOptimiseReady}).\n *\n * @param kinds - The event kinds\n * @param resources - The resource kinds\n * @param editing - The kinds' editing: each kind's drafts, which every read puts in place\n * @param window - The plan window in view\n * @param range - The range the canvas reads its event kinds' rows over (`eventReadRange`): where each event's row is read\n * @param run - The run's number\n * @returns The request\n */\nexport function planOptimiseRequest(kinds: readonly PlanEventKindValue[], resources: readonly PlanResourceKindValue[], editing: PlanEventEditing,\n    window: PlanOptimiseWindow, range: PlanEventRange, run: number): PlanOptimiseRequest {\n    const events: Record<string, Rows> = {};\n    for (const kind of kinds) {\n        const { keyType, rowType } = typesOf(kind);\n        const keyOf = optimiseKeyOf(keyType);\n        const rows: Rows = new SortedMap([], compareFor(keyType) as (a: unknown, b: unknown) => number);\n        const drafts = editing.draftsOf(kind.key);\n        const carried = windowEvents(kind, drafts, window);\n        // Every event's row, read once: the kind's rows over the range and its backlog's, drafts in place, by key.\n        planOptimiseProbe?.readRows?.(kind.key);\n        const held = kind.planRows(range.from, range.to, drafts);\n        if (held.type === \"some\") {\n            const byKey = rowsByKey(held.value, keyType, rowType);\n            for (const item of carried) {\n                const key = keyOf(item.key);\n                const row = key === undefined ? undefined : byKey.get(key);\n                if (row !== undefined) rows.set(key, row);\n            }\n        }\n        events[kind.key] = rows;\n    }\n    const context: Record<string, Rows> = {};\n    for (const kind of resources) {\n        const keyType = fromEastTypeValue(kind.keyType) as EastType;\n        const rowType = fromEastTypeValue(kind.rowType) as EastType;\n        const compare = compareFor(keyType) as (a: unknown, b: unknown) => number;\n        if (kind.records.type === \"none\") { context[kind.key] = new SortedMap([], compare); continue; }\n        // The kind's records read whole, as the run starts: its rows by key, as the request carries them.\n        const decoded = decodeBeast2For(DictType(keyType, rowType))(kind.records.value()) as ReadonlyMap<unknown, unknown>;\n        context[kind.key] = decoded instanceof SortedMap ? decoded : new SortedMap([...decoded], compare);\n    }\n    return { from: window.from, to: window.to, run: BigInt(run), events, resources: context };\n}\n\n/** Where an element stood on the canvas before a run: its row, its extent, its shape and its words. */\ninterface PlacedElement {\n    readonly rowKey: string;\n    readonly start: PlanInstantValue;\n    readonly end: PlanInstantValue;\n    readonly shape: PlanGhost[\"shape\"];\n    readonly label: string;\n}\n\n/**\n * Where each element stands on the canvas, by its key: what a ghost is drawn\n * from — the row that holds the element, and its extent on it.\n *\n * @param blocks - The event kinds' rows as the canvas draws them\n * @returns Each element's place\n */\nfunction placedOf(blocks: readonly PlanWireBlock[]): Map<string, PlacedElement> {\n    const out = new Map<string, PlacedElement>();\n    for (const block of blocks) {\n        for (const row of block.rows) {\n            const rowKey = rowKeyOf(row.id);\n            const kind = row.kind;\n            switch (kind.type) {\n                case \"span\": for (const run of kind.value.runs) out.set(run.key, { rowKey, start: run.start, end: run.end, shape: \"span\", label: run.label }); break;\n                case \"cards\": for (const chip of kind.value.chips) out.set(chip.key, { rowKey, start: chip.from, end: chip.to, shape: \"span\", label: chip.label }); break;\n                case \"buckets\": for (const tile of kind.value.events) out.set(tile.key, { rowKey, start: tile.at, end: tile.at, shape: \"instant\", label: tile.label.type === \"some\" ? tile.label.value : \"\" }); break;\n                case \"events\": for (const mark of kind.value.marks) out.set(mark.key, { rowKey, start: mark.at, end: mark.at, shape: \"instant\", label: mark.label.type === \"some\" ? mark.label.value : \"\" }); break;\n                default: break;\n            }\n        }\n    }\n    return out;\n}\n\n/**\n * How an event stood before a run, as its provenance says it (R17): its day\n * and time and its resource, or the backlog.\n *\n * @param item - The event as its kind read it before the run\n * @param resources - The resource kinds: its resource by name\n * @param format - The app's formatters\n * @returns The words\n */\nfunction previousWords(item: PlanEventItemValue, resources: readonly PlanResourceKindValue[], format: Formatters): string {\n    if (item.start.type !== \"some\") return \"backlog\";\n    const at = item.resource.type === \"some\" ? item.resource.value : undefined;\n    const where = at === undefined ? \"Unassigned\" : resources.find((kind) => kind.key === at.kind)?.rows.find((row) => row.key === at.key)?.label ?? at.key;\n    return `${format.weekdayDate(item.start.value)} ${format.time(item.start.value)}${item.end.type === \"some\" ? `–${format.time(item.end.value)}` : \"\"} · ${where}`;\n}\n\n/**\n * A kind's events as they stood before the run, by key (R24): the events the\n * request was built from — those in its window and the kind's backlog, the\n * drafts in place ({@link windowEvents}) — read once, and indexed in East's own\n * collection, the key type's order deciding which key is which, so a landing\n * finds each changed event there rather than reading the kind's rows again for\n * each. A read that throws is said, and holds no event: a changed event it does\n * not hold lands as one the kind did not hold before.\n *\n * @param kind - The event kind\n * @param drafts - Its drafts: the request's, as nothing writes while the run is out\n * @param window - The plan window the request was built over\n * @param keyType - Its record's key type\n * @returns Its events before the run, by key\n */\nfunction eventsBefore(kind: PlanEventKindValue, drafts: PlanKindDraftsValue, window: PlanOptimiseWindow, keyType: EastType): EventsByKey {\n    planOptimiseProbe?.readEvents?.(kind.key);\n    const keyOf = optimiseKeyOf(keyType);\n    const byKey: EventsByKey = new SortedMap([], compareFor(keyType) as (a: unknown, b: unknown) => number);\n    let events: readonly PlanEventItemValue[] = [];\n    try {\n        events = windowEvents(kind, drafts, window);\n    } catch (err) {\n        console.error(`[Plan] ${kind.name}'s events could not be read as they stood before the run:`, err);\n    }\n    for (const item of events) {\n        const key = keyOf(item.key);\n        if (key !== undefined) byKey.set(key, item);\n    }\n    return byKey;\n}\n\n/** What a landing is made over. */\nexport interface PlanLanding {\n    readonly kinds: readonly PlanEventKindValue[];\n    readonly resources: readonly PlanResourceKindValue[];\n    /** The kinds' editing: each kind's drafts, which its events before the run are read with, and where the step is recorded. */\n    readonly editing: PlanEventEditing;\n    readonly request: PlanOptimiseRequest;\n    readonly result: PlanOptimiseResult;\n    /** The step's label — `Elara run #7`. */\n    readonly label: string;\n    /** The run's number, formatted, for the provenance. */\n    readonly runText: string;\n    /** The event kinds' rows as the canvas drew them before the run: where a ghost goes. */\n    readonly blocks: readonly PlanWireBlock[];\n    /** The app's formatters, for the provenance's words. */\n    readonly format: Formatters;\n    /** What earlier runs left on the events, still the session's drafts. */\n    readonly before: PlanOptimised | undefined;\n}\n\n/**\n * The result landed (R7, R8, R10, R24, §12): diffed against the request by\n * key, kind by kind, its operations told by place, and recorded as one step\n * of the history, origin `optimise`. What each changed event was before the\n * run — its provenance's `Was …`, and whether the backlog moved — is found\n * among its kind's events as the request was built from them, read once a\n * kind that changed ({@link eventsBefore}), so a landing's work grows with the\n * changes plus the events, never their product. A result that answers no rows\n * for a kind the request asked is invalid, and nothing is recorded; one that\n * changes nothing records nothing and leaves what earlier runs left as it is\n * (R10); one that does lays its operations and ghosts over theirs.\n *\n * @param args - What the landing is made over\n * @returns What the run counted, and what the runs have left on the events — unchanged by a run that changed nothing; `undefined` for an invalid result, or one the session would not take\n */\nexport function landPlanOptimise(args: PlanLanding): { counts: OptimiseCounts; optimised: PlanOptimised | undefined } | undefined {\n    const { kinds, resources, editing, request, result, label, runText, blocks, format, before } = args;\n    const diffs = [];\n    const ops = new Map<string, PlanElementOp>(before?.ops ?? []);\n    const ghosts = new Map<string, PlanGhost[]>([...(before?.ghosts ?? [])].map(([row, list]) => [row, [...list]]));\n    const placed = placedOf(blocks);\n    // The plan window the request was built over: where each kind's events before the run are read.\n    const requested: PlanOptimiseWindow = { from: request.from, to: request.to };\n    let backlogChanged = false;\n    for (const kind of kinds) {\n        const asked = request.events[kind.key];\n        const answered = result.events[kind.key];\n        if (asked === undefined || answered === undefined) return undefined;\n        const { keyType, rowType } = typesOf(kind);\n        const keyOf = optimiseKeyOf(keyType);\n        const startField = kind.schedule.start;\n        const unscheduled = (row: unknown): boolean => {\n            const start = (row as Record<string, { type: string }>)[startField];\n            return start !== undefined && start.type === \"none\";\n        };\n        const diff = optimisePlacementOps(diffOptimiseRows(kind.key, rowType, optimiseIdOf(keyType), asked as ReadonlyMap<unknown, unknown>, answered as ReadonlyMap<unknown, unknown>),\n            (row) => !unscheduled(row));\n        diffs.push(diff);\n        // The kind's events as they stood before the run, read once for all its changes — never once an event (R24).\n        let eventsWere: EventsByKey | undefined;\n        for (const [key, op] of diff.ops) {\n            const id = key.slice(kind.key.length + 1);\n            const element = printEventRef({ kind: kind.key, key: id });\n            // The event as its kind read it before the run: the provenance's `Was …`, and whether the backlog moves.\n            eventsWere ??= eventsBefore(kind, editing.draftsOf(kind.key), requested, keyType);\n            const at = keyOf(id);\n            const was = at === undefined ? undefined : eventsWere.get(at);\n            if ((was !== undefined && was.start.type !== \"some\") || (\"row\" in op && unscheduled(op.row))) backlogChanged = true;\n            // Where the element stood: an earlier run's ghost of it gives way to this run's.\n            for (const list of ghosts.values()) {\n                const at = list.findIndex((ghost) => ghost.key === element);\n                if (at >= 0) list.splice(at, 1);\n            }\n            const stood = placed.get(element);\n            if (op.op === \"del\") {\n                ops.delete(element);\n                if (stood !== undefined) (ghosts.get(stood.rowKey) ?? ghosts.set(stood.rowKey, []).get(stood.rowKey)!).push({ key: element, op: \"del\", run: runText, start: stood.start, end: stood.end, label: stood.label, shape: stood.shape });\n                continue;\n            }\n            const provenance = op.op === \"add\" ? optimiseMessages.entryAdded({ run: runText })\n                : optimiseMessages.entryChanged({ previous: was === undefined ? \"backlog\" : previousWords(was, resources, format), run: runText });\n            ops.set(element, { op: op.op, run: runText, provenance });\n            if (op.op === \"chg\" && stood !== undefined) {\n                (ghosts.get(stood.rowKey) ?? ghosts.set(stood.rowKey, []).get(stood.rowKey)!).push({ key: element, op: \"from\", run: runText, start: stood.start, end: stood.end, label: stood.label, shape: stood.shape });\n            }\n        }\n    }\n    const merged = mergeOptimiseDiffs(diffs);\n    if (merged.changes.length === 0) return { counts: merged.counts, optimised: undefined };\n    if (!editing.record(merged.changes, \"optimise\", label)) return undefined;\n    return { counts: merged.counts, optimised: { ops, ghosts, backlogChanged } };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's canvas — the temporally-aligned composite canvas (`Plan Spec.md`\n * §6): decode, the one shared scale, the one controller, and the canvas's\n * composition (horizon brush / ruler / pinned rows / rows).\n *\n * It is the canvas of the `Plan` extension `@elaraai/e3-ui` declares (#1177,\n * #1191), and the main of the frame the Plan renders in (#1193,\n * `frame/index.tsx`): `<Plan>` returns its payload through that carrier, and\n * the Plan's renderer lays it out in its `BuilderFrame`. The canvas is a hook,\n * {@link usePlanCanvas}: it hands the frame main, and the facts the frame's\n * toolbar, banners and footer are drawn from (`root/chrome.ts`), so the canvas\n * draws no toolbar and no foot of its own. The event kinds' rows lead the\n * canvas's own, read over the range it draws (#1192, `root/events.ts`), with\n * every kind's drafts in place: each kind is a session over its record, under\n * one history with `data`'s session (#1194, `edit/events.ts`), which the\n * frame's history item and banners follow. The event kinds' cards and elements\n * drag onto their rows, and an element back to the Backlog tab (#1196,\n * `edit/event-drag.ts`); an element its drafts changed wears the drafted look.\n *\n * Everything the canvas remembers between renders lives in ONE framework-free\n * controller (#815, `controller/`): the UI state machine, the paged source's\n * residency, the key search, the open element overlay, the scroll anchor. It\n * is created once per mount, the latest value reaches it through `setValue`\n * in a layout effect, and every part of the canvas subscribes to the slice of\n * its state it reads. Interactions are the controller's actions, and an action\n * runs its own effects — slice writes, the author's callbacks, page requests —\n * before it returns. What is left here is composition.\n *\n * The narrowing is one `Slice.bindRecords` (#1344, `root/sources.ts`): its\n * `rows` source gives the canvas its rows, paged from it; each event kind\n * narrowed through a source of its own reads its events through it, and the\n * frame narrows a resource kind's rows by its source's shown resources\n * (`shown`). The rail is the frame's toolbar items\n * (`useRecordSlicesToolbarItems`); `brush` mounts as the 32px horizon band, in\n * main, the resolution as the WEEK/DAY segment, `summary` as the rail's\n * counts. The window is the sources' shared `range` (`root/window.ts`): every\n * source holding one holds it with the others — the axis seeds a canvas with\n * none — and the brush, the time navigator and the keys write each of them.\n * The canvas's rows never follow the dates: the `rows` source and a resource\n * kind's hold no window, so the dates on screen never decide which rows are\n * listed, and a slice with no source holding the window leaves the canvas its\n * own, which the same gestures move.\n *\n * The axis is one of three kinds (#631) — `time`, `number`, `ordinal` — and\n * every window read / write speaks the slice arm that kind maps to\n * (`axis.ts`): `datetime`, `float` / `integer`, or none (an ordinal list is\n * its own window). Every row's instants must ride the axis's arm; a row that\n * does not is a diagnostic ROW, never a misplacement.\n *\n * A failure stays where it happened (#811): a row that cannot be placed\n * renders in place as its diagnostic, a window whose read failed is a run of\n * its rows' placeholders that says so once, with Retry (#1398, CL11), and a\n * part that throws while rendering (a row's\n * plot, an overlay body, the expand render, the links layer) shows its own\n * one-line fallback. The frame's toolbar counts what it can — skipped rows, a\n * source or search failure, a truncated axis. Nothing a row or a source does\n * replaces the canvas.\n *\n * All eight row kinds render (`rows/*`); the drag-target role, element\n * clicks and the keyboard rungs are wired — the reducer's events and the\n * component's dispatches are a closed loop (#569). Every\n * element's popover, hover card and tooltip come from ONE overlay layer the\n * body delegates to (#816, `root/overlays.tsx`).\n *\n * The body is a TREEGRID (#819): every row, group band, gap band and window\n * band is a `row` at its `aria-rowindex` (`root/grid.ts`), with ONE tab stop\n * roving between them, a keyboard map over rows and their elements\n * (`root/keyboard.ts`), a polite live region (`root/announce.tsx`), and words\n * for everything the canvas says only by shape or colour (`a11y.ts`).\n *\n * Every word the canvas says itself comes from ONE message table, and every\n * number and date it prints is in the locale (#820, `messages.ts` /\n * `words.ts`): react-aria's `I18nProvider` above the app sets the locale, and\n * `PlanMessagesProvider` overrides the words for a subtree.\n */\n\nimport { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type FocusEvent, type KeyboardEvent, type ReactNode } from \"react\";\nimport { Box, VisuallyHidden, useSlotRecipe } from \"@chakra-ui/react\";\nimport { StringType, equalFor, none, printFor, type PatchPath, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan, ScheduleEventRefType, planKeys, type PlanPayloadType } from \"@elaraai/e3-ui/internal\";\nimport {\n    getSomeorUndefined, optimiseMessages, useCoarsePointer, useContainerBelow, useDataStable, useFormatters, useLanding, useLandingStyles, usePersistedState,\n    historyShortcut, takeKey, useSliceReactivity, useTrackedEvaluation,\n    type EditHistory, type EditHistoryJoined, type EditIssue, type DragEventValue, type DragMeta, type HistoryAction,\n} from \"@elaraai/east-ui-components\";\nimport {\n    parseCssSize, DensityProvider, VirtualRows, VIRTUALIZE_UNBOUNDED_AT, getStore, recordSliceNoun,\n} from \"@elaraai/east-ui-components/internal\";\nimport {\n    PlanScaleContext, PlanDispatchContext, PlanCursorContext, PlanResolversContext, PlanGeometryContext,\n    type PlanResolvers,\n} from \"./context.js\";\nimport { planGeometry, planGeometryStyle } from \"./geometry.js\";\nimport { PlanRunRow } from \"./rows/RunRow.js\";\nimport { PlanPartBoundary } from \"./rows/PartBoundary.js\";\nimport { axisNow, axisResolutions, ordinalIndexOf } from \"./axis.js\";\nimport type { PlanEvent } from \"./plan-state.js\";\nimport type { PlanPart } from \"./messages.js\";\nimport {\n    bodyItemKey, canvasRowsOf, derivePlan, indexRows, linkedRowKeys, pinnedRows, pxOf, rowHeight, rowItemKey, rowKeyOf,\n    rowKeyWords, visibleRows,\n    type PlanBand, type PlanBodyItem, type PlanRootValue, type PlanRowIndex, type PlanRowValue, type VisibleRow,\n} from \"./model.js\";\nimport { PLAN_PAGE_SIZE, bandElements } from \"./use-plan-paging.js\";\nimport type { RowKey } from \"./plan-state.js\";\nimport { conflictPlaceOf, entryOf, usePlanEditing, type PlanEntryRef } from \"./use-plan-editing.js\";\nimport { timeInstant } from \"./instant.js\";\nimport { usePlanEventEditing } from \"./edit/events.js\";\nimport { scheduleIssueName } from \"../shared/schedule/editing.js\";\nimport { drawnKinds, usePlanEventDrag, type PlanEventCanDropFn } from \"./edit/event-drag.js\";\nimport { PlanNarrow, PLAN_NARROW_BELOW } from \"./narrow/index.js\";\nimport type { PlanNarrowPaging } from \"./narrow/demand.js\";\nimport { LinksOverlay } from \"./shell/LinksOverlay.js\";\nimport { linkedElement, ribbonBody, type LinkedElement, type RibbonBeyond } from \"./shell/ribbon-layout.js\";\nimport type { PlanDiagnostics } from \"./shell/Diagnostics.js\";\nimport type { PlanTransport } from \"./shell/transport.js\";\nimport { retryPeriod, type PagedLoading } from \"../shared/loading.js\";\nimport {\n    createPlanController, declaredCollapsedOf, declaredGrainOf, denseOf, elementRowsOf,\n    type PlanReconcileModel, type PlanSnapshot,\n} from \"./controller/index.js\";\nimport { PlanControllerContext, useControllerSelector } from \"./controller/react.js\";\nimport { NOT_PERSISTED, persistedOf, type PlanPersisted } from \"./persisted.js\";\nimport { sameUiView, uiViewOf, useStableDerived, useStableVisible } from \"./root/view.js\";\nimport { createPlanWindowHold, restoredWindow, statedWindow, usePlanWindow } from \"./root/window.js\";\nimport { writePlanWindow } from \"./controller/effects.js\";\nimport { planEventParts, planNouns, planPart, planRowSources, ROWS_SOURCE } from \"./root/sources.js\";\nimport {\n    ALL_SHOWN, PlanEventsReader, eventReadRange, initialEventLead, usePlanEventRoot,\n    type PlanEventLead, type PlanEventRows, type PlanEventShownValue,\n} from \"./root/events.js\";\nimport { cellKinds, createCellSpanStore, seriesKinds, shownCellSpan } from \"./root/cells.js\";\nimport { NO_BREACHES, PlanBoundsReader, type PlanBreaches } from \"./root/bounds.js\";\nimport { PlanNestedReader, createNestedViewStore, usePlanNestedRoot, usePlanWholeRows, type PlanNestedLead, type PlanNestedSpanRead, type SPAN_READING } from \"./root/nested.js\";\nimport { NONE_HIDDEN, hidesRow, type PlanRowsHidden } from \"./frame/hidden.js\";\nimport type { PlanCanvasParts, PlanSessionBanner } from \"./root/chrome.js\";\nimport { useHostBound } from \"./root/host-bound.js\";\nimport { usePlanExpand, usePlanFocus } from \"./root/focus.js\";\nimport { groupEndsOf, usePlanBody, usePlanRangeReport, usePlanScrollTarget } from \"./root/body.js\";\nimport { PlanGapBand, PlanStickyParent, renderPlanRow, type PlanRowContext } from \"./root/rows.js\";\nimport { PlanHeader } from \"./root/Header.js\";\nimport { usePlanCursorController } from \"./root/cursor.js\";\nimport { usePlanDropTarget } from \"./root/drop.js\";\nimport { PLAN_ELEMENT_SELECTOR, PlanOverlays, createOverlayAnchors, refOfElement, usePlanOverlayHandlers } from \"./root/overlays.js\";\nimport { PlanGridContext, createRowPositions, gridPlaces, type PlanGridContextValue } from \"./root/grid.js\";\nimport {\n    PLAN_WALK_SELECTOR, gridItemOf, planNavItems, planNavKey, plotElements, resolveNavIntent, rowWidgets,\n    type PlanNavEdges, type PlanNavIntent, type PlanNavItem, type PlanNavMove, type PlanWaitKey,\n} from \"./root/keyboard.js\";\nimport { PlanAnnouncer } from \"./root/announce.js\";\nimport { PlanWordsContext, useResolvedPlanWords } from \"./words.js\";\nimport type { PlanSearch } from \"./use-seek.js\";\nimport { usePlanRowsFind } from \"./find.js\";\nimport { FieldAskProvider, useFieldAsks } from \"../shared/schedule/field-ask.js\";\nimport { useSourceHidden } from \"../shared/schedule/hidden.js\";\nimport { useHiddenPick } from \"../shared/schedule/hidden-pick.js\";\nimport { DROPPABLE_KINDS } from \"./rows/BodyRow.js\";\nimport { PlanEditContext, PlanEditStore, type PlanEditContextValue } from \"./edit/store.js\";\nimport { PlanTypingStore, planZooms, type PlanTyping } from \"./edit/typing.js\";\nimport { originOf, unmoved, usePlanCarry, type PlanMoveRequest } from \"./edit/use-carry.js\";\nimport { PlanCarryAnnouncer } from \"./edit/announce.js\";\nimport { PlanSelectableContext, elementKeyOf, holdsElement, selectableOf } from \"./rows/element-select.js\";\nimport { PlanBoundedContext, PlanConflictCellsContext, PlanConflictedContext, PlanDraftedContext } from \"./rows/element-draft.js\";\nimport { PlanOptimisedContext, type PlanOptimisedMarks } from \"./rows/element-optimise.js\";\nimport { rowValueAt, type PlanCanvasInspect } from \"./root/inspect.js\";\nimport { useOptimise } from \"../shared/func/use-optimise.js\";\nimport { useOptimiseParts } from \"../shared/func/optimise-parts.js\";\nimport {\n    PlanOptimiseReader, landPlanOptimise, planOptimiseRequest, planOptimiseTypes,\n    type PlanOptimiseReadiness, type PlanOptimiseRequest, type PlanOptimiseResult, type PlanOptimiseWindow, type PlanOptimised,\n} from \"./optimise.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nexport { type PlanRootValue, type PlanRowValue } from \"./model.js\";\nexport type { PlanCanvasParts, PlanChrome } from \"./root/chrome.js\";\n\n// The Plan's memo compares CLOSURES too (#809, `frame/index.tsx`), while the\n// pure-data derivations key on the value's DATA identity, so the root a\n// closure-only change lets through swaps the callbacks without rebuilding the\n// row model, the scale or the link graph.\nconst planRootDataEqual = equalFor(Plan.Types.Root);\nconst stringEqual = equalFor(StringType);\n/** An event's element's key: its event, as East prints a `Schedule.Types.EventRef`. */\nconst printEventRef = printFor(ScheduleEventRefType);\n\n/** One event kind, as the Plan's payload carries it (#1190). */\ntype PlanEventKindValue = ValueTypeOf<typeof PlanPayloadType>[\"events\"][number];\n\n/** One resource kind, as the Plan's payload carries it (#1190). */\ntype PlanResourceKindValue = ValueTypeOf<typeof PlanPayloadType>[\"resources\"][number];\n\n/** One of the library's tabs, as the Plan's payload carries it (#1195). */\ntype PlanLibraryTabValue = ValueTypeOf<typeof PlanPayloadType>[\"library\"][number];\n\n/** No event kinds: a Plan of `data` and `rows` alone. */\nconst NO_KINDS: readonly PlanEventKindValue[] = [];\n/** No session joins the history beside the event kinds': a Plan whose `data` does not edit. */\nconst NO_JOINED: readonly EditHistoryJoined<PlanEntryRef>[] = [];\n/** No resource kinds: a Plan of `data` and `rows` alone. */\nconst NO_RESOURCES: readonly PlanResourceKindValue[] = [];\n/** No library tabs. */\nconst NO_TABS: readonly PlanLibraryTabValue[] = [];\n/** No event kind has an event on the canvas. */\nconst NO_KINDS_DRAWN: ReadonlySet<string> = new Set();\n/** The view waits for nothing: no run on its way, no row whose cells have not landed. */\nconst NOTHING_AWAITED: { readonly run: boolean; readonly cells: boolean } = { run: false, cells: false };\n/** No row in view yet. */\nconst NO_ROWS_IN_VIEW: readonly PlanRowValue[] = [];\n/** No row waiting on a read. */\nconst NO_ROWS_WAITING: ReadonlySet<RowKey> = new Set();\n/** No link ends read through their rows (#1438). */\nconst NO_LINK_ENDS: { readonly focus: string; readonly ids: readonly string[] } = { focus: \"\", ids: [] };\nconst NO_LINK_ROWS: ReadonlyMap<string, Uint8Array> = new Map();\n/** No run of the optimiser has left anything on the canvas. */\nconst NO_OPTIMISED_MARKS: PlanOptimisedMarks = { ops: new Map(), ghosts: new Map(), lit: false };\n\n/** Default gutter width (px, desktop — the §8 sheet). */\nconst GUTTER_W = 168;\n\n/**\n * Whether the canvas draws an item now: its element mounted in the body.\n *\n * @param body - The canvas body\n * @param key - The item's key\n * @returns Whether its element is mounted\n */\nfunction drawsItem(body: HTMLElement | null, key: string): boolean {\n    return body !== null && Array.from(body.querySelectorAll(\"[data-plan-item]\")).some((el) => el.getAttribute(\"data-plan-item\") === key);\n}\n\n/** The key search's box, in the row or in its popover, and the icon it folds to: where a pick leaves the focus. */\nconst KEY_SEARCH_BOX = '[data-part=\"dataset-key-search\"], [data-key-search=\"icon\"]';\n\n/** How many frames a pick's row is waited for before the hand-off gives up on it: about a second. */\nconst LAND_FRAMES = 60;\n\n/** The canvas-wide keys (§11) — esc runs the one-rung ladder, `n` / `[` / `]`\n *  move the window, `g` cycles the grain. They work from anywhere in the\n *  canvas; the grid's own keys (`root/keyboard.ts`) come first. Every key the\n *  canvas acts on goes no further than the Plan (`takeKey`, #1398). */\nconst KEYS: Readonly<Record<string, PlanEvent>> = {\n    Escape: { t: \"key\", key: \"esc\" },\n    n: { t: \"key\", key: \"n\" },\n    \"[\": { t: \"key\", key: \"[\" },\n    \"]\": { t: \"key\", key: \"]\" },\n    g: { t: \"key\", key: \"g\" },\n};\n\n/** The links layer, as its render-failure line names it (#811). */\nconst LINKS_LAYER: PlanPart = { kind: \"linksLayer\" };\n\nconst selectPaging = (s: PlanSnapshot) => s.paging;\nconst selectSeek = (s: PlanSnapshot) => s.seek;\nconst selectAnchor = (s: PlanSnapshot) => s.anchor;\nconst selectScroll = (s: PlanSnapshot) => s.scroll;\n\n/**\n * Test-only render probe — lets \"the canvas root did not render\" be asserted\n * deterministically (#815): a selection renders the rows it moved and never\n * the root. `undefined` outside tests.\n */\nlet planRootRenderProbe: (() => void) | undefined;\n/** Install (or clear) the test root render probe. Test use only. */\nexport function setPlanRootRenderProbe(fn: (() => void) | undefined): void {\n    planRootRenderProbe = fn;\n}\n\n/** What {@link usePlanCanvas} reads. */\nexport interface PlanCanvasArgs {\n    /** The Plan root value. */\n    value: PlanRootValue;\n    /** Storage key prefix for persisting component state. */\n    storageKey: string;\n    /** The event kinds' rows (#1192), drawn ahead of the root's own — a Plan of event kinds' payload carries them. */\n    events?: PlanEventRows | undefined;\n    /** The ids the viewer hides in the library's Series tab (#1195): the event kinds' rows leave out what they name. */\n    hidden?: readonly string[] | undefined;\n    /** What those ids hide of the Plan's own `rows`, which the canvas leaves out; `undefined` when they hide none. */\n    rowsHidden?: PlanRowsHidden | undefined;\n    /** The event kinds' slots (#1197): an element of theirs selects its event, as the Calendar's do (B15). */\n    eventKinds?: readonly string[] | undefined;\n    /** The library ids of the Plan's own panel tabs whose cards land on its rows (#1259) — its author's tabs'. */\n    panel?: readonly string[] | undefined;\n    /** The event kinds themselves (#1194): each edited in a session over its record, under one history with `data`'s. */\n    kinds?: readonly PlanEventKindValue[] | undefined;\n    /** The resource kinds (#1196): what the event kinds' rows stand for, by name. */\n    resources?: readonly PlanResourceKindValue[] | undefined;\n    /** The library's tabs (#1196): the author's tabs' cards, which land on an event of their patch's kind. */\n    tabs?: readonly PlanLibraryTabValue[] | undefined;\n    /** The Plan's drop veto over an event kind's drop (#1196): `Schedule.Types.Candidate` to its refusal's message. */\n    canDrop?: PlanEventCanDropFn | undefined;\n    /** The resources the rail shows (#1344): by a resource kind's slot, the keys its source shows — what its rows draw. */\n    shown?: PlanEventShownValue | undefined;\n    /**\n     * Whether a resource kind's source is resolving a new narrowing, or its last read failed (#1344): main keeps the\n     * rows it shows, busy, and takes no gesture until the narrowing lands.\n     */\n    busy?: boolean | undefined;\n    /** The app's optimiser (#1409): its binding, which the Elara eye calls by name; none, no eye. */\n    optimise?: { readonly name: string } | undefined;\n    /** Whether the Plan's Autosave begins on, as its author says: its one history's choice begins there. */\n    autosave?: boolean | undefined;\n}\n\n/** No panel tab whose cards land on the rows. */\nconst NO_PANEL: readonly string[] = [];\n\n/**\n * The Plan's canvas, for the frame it renders in (#1193): everything the\n * canvas keeps and derives, composed into main, and the facts the frame's\n * toolbar, banners and footer are drawn from — see the module docs. The\n * frame calls it once per render and places what it hands back.\n *\n * @param args - The root, its storage key, the event kinds' rows, what the viewer hides, the panel's tabs whose cards land, the event kinds, the resource kinds, the library's tabs, the event kinds' drop veto, the resources the rail shows, whether their narrowing is resolving, and whether its Autosave begins on\n * @returns The canvas's parts: its contexts, main, its declared bound, and its chrome's facts\n */\nexport function usePlanCanvas({\n    value: hostValue, storageKey, events, hidden, rowsHidden, eventKinds, panel, kinds = NO_KINDS,\n    resources = NO_RESOURCES, tabs = NO_TABS, canDrop, shown: shownResources = ALL_SHOWN, busy = false, optimise, autosave = false,\n}: PlanCanvasArgs): PlanCanvasParts {\n    planRootRenderProbe?.();\n    // Changes identity on a DATA change only — read data fields through it,\n    // callbacks through `value` (#809).\n    const hostData = useDataStable(hostValue, planRootDataEqual);\n    // The canvas's words (#820) — its locale and message table, resolved once\n    // per change and handed to every part beneath it.\n    const words = useResolvedPlanWords();\n\n    // ── What survives a remount (#813) ────────────────────────────────────\n    // Under the canvas's `storageKey`: the user's collapse toggles, the charts\n    // they expanded, where a bounded frame's scroll rests, and the canvas's own\n    // window while no source of its slice holds one (#1344), with the zoom it\n    // was shown at (#1438): the slice holds the zoom, but a page's store may\n    // not outlive the page. Never the selection — a transient act, and\n    // restoring it would re-fire `onSelect`. The controller restores from it\n    // once and writes through the latest setter.\n    const { state: stored, setState: setStored } = usePersistedState<PlanPersisted>(storageKey, NOT_PERSISTED, persistedOf);\n    const [restored] = useState(() => persistedOf(stored));\n    const persistTo = useRef(setStored);\n    useLayoutEffect(() => { persistTo.current = setStored; });\n    // The window last shown while no source of the slice holds one (#1344): the render's and the effects'. It opens on\n    // the canvas's own window the last session kept while the axis allows it, so the first paint draws it there.\n    const [windowHold] = useState(() => {\n        const window = restoredWindow(restored.window, hostValue, planRowSources(resources));\n        // The zoom it was kept at with it (#1438): the scale's until the slice holds one.\n        return createPlanWindowHold(window, window !== undefined ? restored.window?.resolution : undefined);\n    });\n\n    // ── The controller — once per mount (#815) ────────────────────────────\n    const [controller] = useState(() => createPlanController({\n        grain: declaredGrainOf(hostValue),\n        collapsed: hostValue.rows.type === \"inline\" ? declaredCollapsedOf(canvasRowsOf(hostValue.rows.value)) : [],\n        restored,\n        persist: (next) => persistTo.current(next),\n        // A bound interaction state (#824) — the host's from the first frame,\n        // and written from outside through the state store.\n        ui: getSomeorUndefined(hostValue.ui),\n        subscribeUi: (listener) => getStore().subscribe(listener),\n        windowHold,\n    }));\n    // What the live region speaks in (#820) — handed over before anything can\n    // be said.\n    useLayoutEffect(() => { controller.setWords(words); }, [controller, words]);\n    const paging = useControllerSelector(controller, selectPaging);\n\n    // ── The narrowing and the scale ───────────────────────────────────────\n    // The slice and the scale every row positions against — read from the\n    // host's root, which the drafted and composed roots below share them\n    // with (#1344): the sources holding the window, the `rows` source, and\n    // each event kind narrowed through its own. The canvas's rows' sources —\n    // the `rows` source and each resource kind's — never hold the window.\n    const rowSources = useMemo(() => planRowSources(resources), [resources]);\n    const { chrome: slices, windowParts, lead: windowLead, affordances, scale, error: windowError } = usePlanWindow(hostValue, hostData, words, windowHold, rowSources);\n    // A date the time navigator picks moves the window as the brush and the keys do: the sources', else the canvas's own.\n    const moveWindow = useCallback((min: number, max: number) => writePlanWindow(windowParts, min, max, windowHold), [windowParts, windowHold]);\n    const rowsPart = useMemo(() => planPart(slices, ROWS_SOURCE), [slices]);\n    const eventParts = useMemo(() => planEventParts(slices, kinds), [slices, kinds]);\n    // Each event kind's Save notice counts what leaves its own source's narrowing.\n    const eventSlices = useMemo(() => eventParts.map(({ part }) => part), [eventParts]);\n\n    // ── The editing session (#880) ────────────────────────────────────────\n    // Every dropped card, move and resize is a DRAFT of the entry its row\n    // came from, and the canvas draws the ROOT WITH THE DRAFTS IN PLACE —\n    // derived again, so a draft looks exactly as Save will leave it.\n    // Everything below reads that root: `value` and `data` are the drafted\n    // pair.\n    // A row's name, for a transaction's label — read off the canvas below.\n    const indexRef = useRef<PlanRowIndex | undefined>(undefined);\n    const labelOf = useCallback(\n        (key: RowKey) => indexRef.current?.byKey.get(key)?.gutter.label ?? rowKeyWords(key), []);\n    // The session's entries are `data`'s. Inline, the root's own rows: the\n    // event kinds' lead them on the canvas alone, below. Paged, the rows the\n    // source's elements placed — never a fixed block's, as the event kinds'\n    // rows, which lead every window, are (#1192).\n    const sourceRows = useMemo(\n        () => (hostData.rows.type === \"inline\" ? canvasRowsOf(hostData.rows.value) : elementRowsOf(paging)),\n        [hostData.rows, paging]);\n    // Its gestures are steps of the Plan's one history once it holds the\n    // session beside the event kinds' (#1194): the history is this render's,\n    // read when a gesture lands.\n    const historyRef = useRef<EditHistory<PlanEntryRef> | undefined>(undefined);\n    // Over rows read lean beside their nested series index (#1438), a gesture drafts each row it touches read whole.\n    const whole = usePlanWholeRows(hostData.nested.type === \"some\" ? hostData.nested.value : undefined);\n    const editing = usePlanEditing({\n        value: hostValue, data: hostData, rows: sourceRows, origin: paging.origin, storageKey, labelOf, history: historyRef, whole,\n        entryOf: controller.entryOf, landedAt: controller.landedAt,\n    });\n\n    // ── The event kinds' editing (#1194) ──────────────────────────────────\n    // A session per event kind over its record, under one history with\n    // `data`'s session: Undo and Redo in gesture order whatever the source,\n    // Discard of every one, Save per source. A kind read a window at a time\n    // reads a gesture's event where the canvas reads its rows (#1199).\n    const joined = useMemo(\n        () => (editing.enabled ? [{ key: editing.historyKey, session: editing.session }] : NO_JOINED),\n        [editing.enabled, editing.historyKey, editing.session]);\n    const eventRange = useMemo(() => eventReadRange(scale), [scale]);\n    // The event kinds' rows as last read (#1192): read by a component of their own below, which hands them over as they move.\n    const standIn = useMemo(() => initialEventLead(events), [events]);\n    const [readLead, setLead] = useState<PlanEventLead | undefined>(undefined);\n    const lead = readLead ?? standIn;\n    // A kind read by its cells (#1039) finds a gesture's event in the rows its cells hold, as the gesture runs.\n    const heldCells = useRef(lead.cells?.held);\n    heldCells.current = lead.cells?.held;\n    // The cells the reader gives a kind read a window at a time — its series index's, or its window's own rows — stand at\n    // the revision they were read at (#1039, #1599): what each Save lands of such a kind draws as the Save left it, over\n    // cells read before the commit, until they are read again.\n    const drawsLanded = useMemo(() => new Set(cellKinds(kinds)), [kinds]);\n    // A new event whose made key another Save took goes on under the next its session makes (#1583) — two planners who\n    // each duplicate one event, or drop one template, are given the same key. Nothing the Plan drafts names an event by\n    // its key — its links are the app's own, of events the record holds — so every kind's may.\n    const rekeys = useMemo(() => new Set(kinds.map((kind) => kind.key)), [kinds]);\n    const eventEditing = usePlanEventEditing({\n        kinds, storageKey, joined, range: eventRange, recordSlices: eventSlices, held: heldCells, drawsLanded, rekeys, autosave,\n    });\n    const history = eventEditing.history;\n    historyRef.current = history;\n    // What was selected of an event given another key stays selected under it — the inspector open on it still, before\n    // the frame is drawn without it: left on the old key, it would open the other session's event.\n    const renumbered = eventEditing.renumbered;\n    useLayoutEffect(() => {\n        if (renumbered.size === 0) return;\n        const moved = new Map<string, string>();\n        for (const [kind, ids] of renumbered) for (const [from, to] of ids) moved.set(printEventRef({ kind, key: from }), printEventRef({ kind, key: to }));\n        const ui = controller.getSnapshot().store.ui;\n        if (ui.elements.some((key) => moved.has(key))) controller.selectEvents(ui.elements.map((key) => moved.get(key) ?? key), ui.selected);\n    }, [renumbered, controller]);\n\n    // ── The app's optimiser (#1409, #1419) ────────────────────────────────\n    // One run over the plan window in view, its result landed on the event kinds' events as one step of the history,\n    // and what the runs left on them until Apply: each element's operation, and the ghosts of where events stood.\n    // While the call is out the canvas holds its lock: no drag, no drop, no carry, no history action.\n    const landingRoot = useRef<HTMLDivElement | null>(null);\n    const landing = useLanding(landingRoot);\n    const landingStyles = useLandingStyles();\n    const format = useFormatters();\n    const optimiseTypes = useMemo(() => planOptimiseTypes(kinds, resources), [kinds, resources]);\n    const [optimised, setOptimised] = useState<PlanOptimised | undefined>(undefined);\n    const planWindow = useMemo((): PlanOptimiseWindow | undefined => {\n        if (scale === undefined || scale.window.min.type !== \"time\" || scale.window.max.type !== \"time\") return undefined;\n        return { from: scale.window.min.value, to: scale.window.max.value };\n    }, [scale]);\n    const latestOptimise = useRef({ lead, optimised, eventEditing, kinds, resources, format });\n    latestOptimise.current = { lead, optimised, eventEditing, kinds, resources, format };\n    const landAfter = useRef<(run: number) => void>(() => undefined);\n    const run = useOptimise<PlanOptimiseRequest, PlanOptimiseResult>({\n        name: optimise?.name ?? null, requestType: optimiseTypes.request, resultType: optimiseTypes.result,\n        scope: planWindow === undefined ? \"\" : `${planWindow.from.getTime()}:${planWindow.to.getTime()}`, storageKey,\n        onLanded: (result, request, n) => {\n            const now = latestOptimise.current;\n            const runText = words.number(n);\n            const landed = landPlanOptimise({\n                kinds: now.kinds, resources: now.resources, editing: now.eventEditing, request, result, label: optimiseMessages.step({ run: runText }), runText,\n                blocks: now.lead.blocks, format: now.format, before: now.optimised,\n            });\n            if (landed === undefined) return undefined;\n            // A run that changed nothing leaves what earlier runs left (R10).\n            if (landed.optimised !== undefined) { setOptimised(landed.optimised); landAfter.current(n); }\n            return landed.counts;\n        },\n    });\n    // The lock (R2): while a call is out, nothing is dragged, dropped, carried or undone.\n    const locked = run.running;\n\n    // ── The event kinds' rows (#1192) ─────────────────────────────────────\n    // Read over the range the scale draws, what the viewer hides left out\n    // (#1195), every kind's drafts in place (#1194), of a resource kind the\n    // rail narrows the resources it shows (#1344): they lead every other row\n    // as fixed blocks. Read by a component of their own (`PlanEventsReader`,\n    // in `provide`), which hands them over only when they move.\n    // The paged kind's rows in view, as the body reports them at rest (#1039): what the reader of its kinds' cells reads.\n    const [cellSpans] = useState(createCellSpanStore);\n    // A paged source's rows beside their nested series index (#1438): their collections read a cell at a time by a\n    // component of its own (`PlanNestedReader`, in `provide`), each window drawn through the root's seam with what it read.\n    const [nestedViews] = useState(createNestedViewStore);\n    const [nestedLead, setNestedLead] = useState<PlanNestedLead | undefined>(undefined);\n    // The rows waiting on the nested series' read in flight (#1438): they wash as a paged kind's unread rows do.\n    const [nestedWaiting, setNestedWaiting] = useState<ReadonlySet<RowKey>>(NO_ROWS_WAITING);\n    // The span of what every series reads (#1438), shown or not (#1440): the horizon a canvas holding its own window spans,\n    // and what a zoom keeps that window inside — even with every series switched off.\n    const [nestedSpan, setNestedSpan] = useState<PlanNestedSpanRead | typeof SPAN_READING | undefined>(undefined);\n    useEffect(() => { windowHold.span = nestedSpan === \"reading\" ? windowHold.span : nestedSpan?.span; }, [windowHold, nestedSpan]);\n    // A link end the cells do not hold (#1438): a run the links focus names on a row read lean, outside the cells read,\n    // has its row read whole by its key — every such row in one request — and drawn whole in its lean row's place, the run\n    // where its times put it. The rows asked stay whole while the focus lasts (`linkEnds`, set below once the rows draw).\n    const [linkEnds, setLinkEnds] = useState<{ readonly focus: string; readonly ids: readonly string[] }>(NO_LINK_ENDS);\n    const linkRowsRead = useCallback((): ReadonlyMap<string, Uint8Array> => {\n        if (whole === undefined || linkEnds.ids.length === 0) return NO_LINK_ROWS;\n        const read = whole.readAll(linkEnds.ids);\n        if (read.type !== \"some\") return NO_LINK_ROWS;\n        const out = new Map<string, Uint8Array>();\n        for (const [id, row] of read.value) if (row.type === \"some\") out.set(id, row.value);\n        return out;\n    }, [whole, linkEnds]);\n    const { result: linkRowsResult } = useTrackedEvaluation(linkRowsRead);\n    const linkRows = linkRowsResult.ok ? linkRowsResult.value : NO_LINK_ROWS;\n    const nested = usePlanNestedRoot(editing.value, editing.data, editing.data.nested.type === \"some\" ? nestedLead : undefined, editing.drafted,\n        linkRows);\n    // The event kinds' rows ahead of the drafted root's own, and its links'\n    // event ends named where the events draw — over a paged resource kind's\n    // windows when a kind pages (#1199).\n    const shown = usePlanEventRoot(nested.value, nested.data, events !== undefined ? lead : undefined, events?.paged, hidden);\n    const value = shown.value;\n    const data = shown.data;\n    // Props sync. A new DATA identity reconciles the UI state (#610); the\n    // render below already drew the reconciled view, so this commits what is\n    // on screen and renders nothing more.\n    useLayoutEffect(() => { controller.setValue(value, data); }, [controller, value, data]);\n    // A paged canvas's drafts moved under the same source: its windows are\n    // read again, the rows it has standing in until they land (#821).\n    const draftsVersion = editing.draftsVersion;\n    useLayoutEffect(() => { if (draftsVersion > 0) controller.refreshSource(); }, [controller, draftsVersion]);\n    // So did its event kinds' rows, which lead every window.\n    const leadVersion = lead.version;\n    useLayoutEffect(() => { if (leadVersion > 0) controller.refreshSource(); }, [controller, leadVersion]);\n    // So did a paged resource kind's windows (#1199): the events placed on its\n    // resources, or the root's own rows each window serves after them.\n    const pagedVersion = shown.version;\n    useLayoutEffect(() => { if (pagedVersion > 0) controller.refreshSource(); }, [controller, pagedVersion]);\n    // So did what was read of the rows' nested series index (#1438), which every window is drawn with.\n    const nestedVersion = nestedLead?.version ?? 0;\n    useLayoutEffect(() => { if (nestedVersion > 0) controller.refreshSource(); }, [controller, nestedVersion]);\n    // So did which of `data`'s series its pick shows (#590): a window of the rows read beside their nested series index\n    // draws with them, and names them in its revision.\n    const pickVersion = useSliceReactivity(data.pick.type === \"some\" ? data.pick.value.key : undefined);\n    useLayoutEffect(() => { if (pickVersion > 0) controller.refreshSource(); }, [controller, pickVersion]);\n    // The source's channels are listened to while the canvas is mounted.\n    useEffect(() => controller.connect(), [controller]);\n\n    // ── The rows: inline, or the paged source's resident ones (§3.8) ──────\n    // Either windowed arm — `paged`, or `pinned` naming its snapshot.\n    const paged = data.rows.type !== \"inline\";\n    // The inline arm is the canvas's BLOCKS (#823), one after another — the\n    // stream's order is the render order (#822) — keyed for the canvas once\n    // per decoded array. The Plan's own `rows` the viewer hides in the Series\n    // tab are left out, each with the rows under it (#1195): they ride fixed\n    // blocks, whole in every window, so inline or paged they leave alike.\n    const rows = useMemo(() => {\n        const all = data.rows.type === \"inline\" ? canvasRowsOf(data.rows.value) : paging.rows;\n        return rowsHidden === undefined ? all : all.filter((row) => !hidesRow(rowsHidden, row.id));\n    }, [data.rows, paging.rows, rowsHidden]);\n    const index = useMemo(() => indexRows(rows), [rows]);\n    indexRef.current = index;\n\n    // ── The UI state the body lays out from ───────────────────────────────\n    // Reconciled against the rows rendered NOW: a new value's first render\n    // already has its vanished rows' focus / collapse gone and its fresh\n    // declared collapse applied — no flash frame — and `setValue` commits the\n    // same transition (#815). A paged source's resident rows are not all its\n    // rows, so its key set says nothing is gone (#813). Selection is not in\n    // the view: each row reads its own, so a click renders two rows and never\n    // this.\n    const reconcileModel = useMemo<PlanReconcileModel>(() => ({\n        alive: new Set(index.byKey.keys()),\n        complete: !paged,\n        declaredCollapsed: index.initiallyCollapsed,\n        declaredGrain: declaredGrainOf(data),\n    }), [index, paged, data]);\n    const selectView = useCallback((s: PlanSnapshot) => uiViewOf(s, reconcileModel), [reconcileModel]);\n    const view = useControllerSelector(controller, selectView, sameUiView);\n    const seek = useControllerSelector(controller, selectSeek);\n    const anchor = useControllerSelector(controller, selectAnchor);\n    const scroll = useControllerSelector(controller, selectScroll);\n\n    // ── The model ─────────────────────────────────────────────────────────\n    const dense = denseOf(data);\n    // The axis KIND (#631) — every window read speaks its slice arm, and a\n    // row whose instants ride another arm is a diagnostic row (#811).\n    const axisKind = data.axis.type;\n    // An ordinal axis orders its instants by the declared list.\n    const ordinalIndex = useMemo(() => ordinalIndexOf(data.axis), [data.axis]);\n    // The scale's period is what the derivations fold to.\n    const period = scale?.period;\n    // Renderer-side derivations (§4.2 — the Table idiom): the IR declares\n    // rollups / aggregates / summaries / folds; the numbers are computed here,\n    // each row's entries kept by identity while they hold (#815). Every row's\n    // values fold to the scale's period first (#824) — a resolution change\n    // re-derives, a pan does not. A row whose instants ride another arm\n    // renders in place as a DIAGNOSTIC row and derives nothing (#811). A\n    // derived number prints in the locale (#820).\n    // Over paged rows beside their nested series index, a parent's subtotals are e3's, as the reader read them (#1438).\n    const parentSubtotals = nestedLead?.parents;\n    const fresh = useMemo(\n        () => derivePlan(index, ordinalIndex, axisKind, words, period, parentSubtotals),\n        [index, ordinalIndex, axisKind, words, period, parentSubtotals]);\n    const derived = useStableDerived(fresh);\n    // The R1 link graph — rows an edge touches grow the `links` control.\n    const linkedKeys = useMemo(() => linkedRowKeys(data.links), [data.links]);\n    // The element a link's end names, by (row, element) — where its ribbon\n    // meets the row, as the element draws (#1258), and the ribbons'\n    // off-window resolution: a run, or an event's element however it draws\n    // (#1192).\n    const linkedElementOf = useCallback((rowKey: string, runKey: string): LinkedElement | undefined => {\n        const row = index.byKey.get(rowKey);\n        return row !== undefined && scale !== undefined ? linkedElement(row, runKey, scale) : undefined;\n    }, [index, scale]);\n\n    // ── Chrome: transport, search ─────────────────────────────────────────\n    // The series library (#590) is the library pane's Series tab (#1195): the\n    // Plan feeds ITSELF the picked series, and the frame has no Series button.\n    // What the chrome tells the truth with (#567 D9). `partial` says some\n    // block does not hold every element: counts across the canvas cover the\n    // loaded windows, and so does a top-level section's member count and\n    // strip. Every other parent derives from one entry's subtree, which a\n    // window holds whole, so its numbers are exact (`spansWindows`, #822).\n    // The footer's loading line (#1398, CL3) says, in ELEMENTS, which of the\n    // source's are read — the span nearest the viewport — that a new\n    // narrowing's rows are, or which read failed; never how many have landed.\n    const failures = paging.failures;\n    const pagingError = paging.sourceError;\n    // Its Retry asks every failed window and the source's own failed reads again, at once — never after the\n    // runtime's retry gap, which a read alone waits out.\n    const retryFailed = useCallback(() => controller.retry(), [controller]);\n    // Whether the view waits for a read (#1398): a window it shows in flight — never one read ahead of it, which nothing on\n    // screen waits for — or the window under it not asked yet, from the moment the view shows its rows not read, so the\n    // reveal clock runs from the view's arrival. The driver settles it with the rest, from the windows the frame's range\n    // shows, so a landing says it in the commit that draws it; the narrow layout, which reports no range, any in flight.\n    const waits = paged && paging.viewLoading;\n    // The event kinds read by their cells over a paged kind (#1039): while their cells are read, the rows the canvas holds\n    // whose cells have not landed wait for them, as a window's rows do (#1398, CL2) — the line says so, in their events'\n    // noun, and main is busy.\n    const cellsRead = lead.cells;\n    const cellsReading = cellsRead?.drawn !== undefined && cellsRead.reading;\n    const cellsNoun = useMemo(() => {\n        const slot = seriesKinds(eventParts)[0];\n        const kind = slot === undefined ? undefined : kinds.find((k) => stringEqual(k.key, slot));\n        return kind === undefined ? undefined : words.m.saveNoticeNoun({ kind: kind.name.toLocaleLowerCase(words.locale), n: 2 });\n    }, [eventParts, kinds, words]);\n    // A paged kind's resource whose cells have not landed, or are read again (#1398, CL2): its rows are unread, and draw\n    // the region wash under what they hold — never an empty row.\n    const drawnResources = cellsRead?.drawn;\n    const pagedSlot = events?.paged?.kind;\n    const cellsUnread = useMemo(() => (drawnResources === undefined || pagedSlot === undefined ? undefined : (row: PlanRowValue): boolean => {\n        if (row.id.type !== \"entry\" || row.id.value.path.length !== 1) return false;\n        const resource = row.id.value.path[0]!;\n        return row.id.value.series.startsWith(`${pagedSlot}.`) && !drawnResources.has(resource);\n    }), [drawnResources, pagedSlot]);\n    // A row whose nested series' cells are read (#1438) — a pan, a zoom or a scroll to tiles not held, or a commit —\n    // is unread the same way until they land: washed under what it holds, never an empty plot.\n    const unread = useMemo(() => (nestedWaiting.size === 0 ? cellsUnread\n        : (row: PlanRowValue) => nestedWaiting.has(row.key) || cellsUnread?.(row) === true), [cellsUnread, nestedWaiting]);\n    // The canvas body: the ribbons' positioning parent, the keyboard surface,\n    // and what the narrow layout measures (§10, #570 — below the adaptive\n    // contract's compact width the Plan is a review tool, cards and tabs; the\n    // signal is the CONTAINER the body renders in, never the viewport).\n    const focusBodyRef = useRef<HTMLDivElement | null>(null);\n    const narrow = useContainerBelow(focusBodyRef, PLAN_NARROW_BELOW);\n    // The rows the narrow layout's cards draw, in order (#1438): kept while they are the same rows, so a list drawn again\n    // over them asks for nothing again.\n    const [narrowShown, setNarrowShown] = useState<readonly PlanRowValue[]>(NO_ROWS_IN_VIEW);\n    const onNarrowShown = useCallback((rows: readonly PlanRowValue[]) => setNarrowShown((was) =>\n        (was.length === rows.length && was.every((row, i) => row === rows[i]) ? was : rows)), []);\n    // What the view shows at rest that is not read yet, as its last report at rest said it (#1398, CL3): a run whose\n    // windows are on their way, or rows whose cells have not landed — what it still waits for once a window has landed and\n    // before the cells its rows are drawn from are asked, which they are only once the view has said which rows it shows.\n    // The line and the busy follow it, so a window and its rows' cells read one after the other are one wait on the\n    // builder's reveal clock, never two each too short to say. A Plan with no cells to read waits on its windows alone,\n    // as its driver says them.\n    const [viewAwaits, setViewAwaits] = useState(NOTHING_AWAITED);\n    // What it is now, so a report that moves nothing sets nothing: a state set again as it was can still draw once more.\n    const awaited = useRef(NOTHING_AWAITED);\n    const awaitInView = useCallback((run: boolean, cells: boolean) => {\n        const was = awaited.current;\n        if (was.run === run && was.cells === cells) return;\n        awaited.current = { run, cells };\n        setViewAwaits(awaited.current);\n    }, []);\n    const rowsInView = useRef<readonly PlanRowValue[]>(NO_ROWS_IN_VIEW);\n    useEffect(() => {\n        // Cells landing draw the rows in view: what they were waited for.\n        awaitInView(awaited.current.run, unread !== undefined && rowsInView.current.some(unread));\n    }, [unread, awaitInView]);\n    // The canvas's view's alone: the narrow list reports no range, and waits on what it reads as the driver and the cells'\n    // reader say it (`waits`, `cellsReading`). What the canvas's view waited for at its last report goes as the Plan\n    // narrows — kept, nothing would ever report it over again, and the line would say a read none is making — and the\n    // canvas, drawn again, reports afresh what its view shows.\n    useEffect(() => {\n        if (!narrow) return;\n        rowsInView.current = NO_ROWS_IN_VIEW;\n        awaitInView(false, false);\n    }, [narrow, awaitInView]);\n    // The narrow list's own (#1438): a card it shows whose nested series' cells are in flight is what it waits on, as a row\n    // in view is on the desktop — so the line says so and the cards' wash shows on the reveal clock, never a card with\n    // nothing drawn and nothing said.\n    const narrowAwaits = narrow && nestedWaiting.size > 0 && narrowShown.some((row) => nestedWaiting.has(row.key));\n    const awaits = narrow ? narrowAwaits : viewAwaits.run || viewAwaits.cells;\n    // What the rail counts each source in (#1344): an event kind's events, `print job events`.\n    const nouns = useMemo(() => planNouns(kinds, resources, tabs, words.locale), [kinds, resources, tabs, words.locale]);\n    // A failed read of the event kinds' rows (#1398, CL3) is said on the same line, after the rows' own failures, paged\n    // or not: in the noun the rail counts each kind in whose own events it could not read — else, none of theirs failing,\n    // the rows' — with Retry, which asks those kinds' records again at once (`retryPeriod`: a record read a window at a\n    // time refreshed, which rearms what failed, else the kind's source of the slice asked again) — every kind's, where\n    // none of theirs failed. Said there alone, never in the toolbar's chip too: a read's failure is said once.\n    const eventsFailure = lead.error;\n    const eventsNoun = useMemo(\n        () => (eventsFailure === undefined ? undefined : words.m.eventsFailedNoun({ kinds: eventsFailure.kinds.map((slot) => nouns[slot] ?? slot) })),\n        [eventsFailure, nouns, words]);\n    const retryEvents = useCallback(() => {\n        const failed = eventsFailure?.kinds ?? [];\n        const asked = failed.length === 0 ? kinds : kinds.filter((kind) => failed.some((slot) => stringEqual(slot, kind.key)));\n        retryPeriod(asked.map((kind) => ({ entries: kind.entries, part: eventParts.find((p) => stringEqual(p.kind.key, kind.key))?.part })));\n    }, [eventsFailure, kinds, eventParts]);\n    const transport = useMemo<PlanTransport | undefined>(() => {\n        // A canvas that reads neither a paged source nor event kinds has nothing to say on the line.\n        if (!paged && events === undefined) return undefined;\n        const failed = failures[0];\n        const rowsFailed = failed !== undefined || pagingError !== undefined;\n        const loading: PagedLoading | undefined = failed !== undefined ? { kind: \"failed\", from: failed.from, to: failed.to, reason: failed.error }\n            : pagingError !== undefined ? { kind: \"failed\", from: undefined, to: undefined, reason: pagingError }\n                : eventsFailure !== undefined ? { kind: \"failed\", from: undefined, to: undefined, reason: eventsFailure.reason }\n                    : paging.replacing ? { kind: \"filtering\" }\n                        : waits ? { kind: \"loading\", from: paging.reading?.from, to: paging.reading?.to }\n                            : cellsReading || awaits ? { kind: \"loading\", from: undefined, to: undefined }\n                                : undefined;\n        // The event kinds' read that failed, in its own noun, its Retry its own.\n        const eventsFailed = !rowsFailed && eventsFailure !== undefined;\n        // The events' noun while their cells are what the view waits for; the rows' while a run is.\n        const cellsWaited = cellsReading || (!viewAwaits.run && viewAwaits.cells);\n        const noun = eventsFailed ? eventsNoun : loading?.kind === \"loading\" && !waits && cellsWaited ? cellsNoun : undefined;\n        return { partial: paged && !paging.complete, loading, retry: eventsFailed ? retryEvents : retryFailed, ...(noun === undefined ? {} : { noun }) };\n    }, [paged, events, failures, pagingError, eventsFailure, eventsNoun, retryEvents, paging.replacing, waits, paging.reading, paging.complete, retryFailed,\n        cellsReading, awaits, viewAwaits, cellsNoun]);\n    const partial = transport?.partial;\n    // Cold load (#1398, CL5): nothing of a paged source landed yet, and no failure to say — the frame's skeleton\n    // covers the Plan. After it, a read the view waits for — a window, a resource kind's narrowing — leaves it live\n    // and busy.\n    const cold = paged ? paging.rows.length === 0 && paging.total === undefined && failures.length === 0 && pagingError === undefined : undefined;\n    const frameBusy = cold !== true && (busy || waits || cellsReading || awaits);\n    // What stands in while a narrowing is read is retained (#1398, CL8): a resource kind's narrowing resolving, the\n    // view the last narrowing of the paged rows drew while the new one's first window is read (#1344, #1354), or the\n    // view Home or End left while the window it goes to is read (CL10).\n    const retained = busy || paging.replacing || paging.standing;\n    // The eye and its parts (#1409): the window's label is the period. The eye is listed only where the window can be\n    // optimised (ruled 25 Oct 2026) — event kinds on a time axis; it waits, disabled, while the kinds' rows are read.\n    const periodName = planWindow === undefined ? \"\" : format.range(planWindow.from, new Date(planWindow.to.getTime() - 1));\n    // What a run's request reads (R24, #1039): every kind's events in the window, its backlog and each event's row — the\n    // kind's rows over the range the canvas reads, read once a kind and found there by key, which the eye waits for, so no\n    // row is read by its key and the eye asks e3 for windows alone, whatever the number of events, and the click's work\n    // grows with the events plus the rows. The eye waits while one is on its way, and stays disabled\n    // for a window no request carries whole — a kind past the cap over it, or read by its cells — never sending a run the\n    // events it was not shown. Read only while an optimiser is bound, in a component of its own (`PlanOptimiseReader`, in\n    // `provide`), which hands the canvas whether the request can be made only as that moves: the read lands in as many\n    // settles as the searches it touches, and each would otherwise render the whole canvas (#1343).\n    const [optimiseReady, setOptimiseReady] = useState<PlanOptimiseReadiness>(\"reading\");\n    const requestHeld = optimise === undefined || planWindow === undefined || optimiseReady === \"ready\";\n    const optimiseParts = useOptimiseParts<PlanOptimiseRequest>({\n        run, landing, period: periodName,\n        readOnly: kinds.length === 0 || planWindow === undefined,\n        busy: readLead === undefined || lead.error !== undefined || frameBusy || !requestHeld,\n        request: (n) => planOptimiseRequest(latestOptimise.current.kinds, latestOptimise.current.resources, latestOptimise.current.eventEditing, planWindow!, eventRange!, n),\n        landKey: lead,\n    });\n    landAfter.current = optimiseParts.landAfter;\n    const { acted } = optimiseParts;\n    // What the runs left on the events goes with the drafts (R17): once nothing is pending — Save, Discard — nothing\n    // is marked. An Undo leaves nothing pending too, but its Redo brings the run's step back (R9): what the runs left\n    // is kept while that step is the next to redo.\n    const historyVersion = eventEditing.version;\n    useEffect(() => {\n        if (history.pending === 0 && history.redoOrigin !== \"optimise\") setOptimised(undefined);\n    }, [history, historyVersion]);\n    const optimisedMarks = useMemo((): PlanOptimisedMarks => (optimised === undefined ? NO_OPTIMISED_MARKS\n        : { ops: optimised.ops, ghosts: optimised.ghosts, lit: landing.lit }), [optimised, landing.lit]);\n    // Key search is a capability of the SOURCE (`search` becomes seek — #567\n    // D9): a jump rebases residency on the matched ELEMENT, and the canvas\n    // positions on the first row that element placed, since a row's id starts\n    // with its element's key (#822). The control is keyed on the source\n    // itself — another collection, which its query was never asked of — and\n    // asks the query it holds again as the search's `again` moves: a new\n    // snapshot of the source's data, whose rows the matches it holds no longer\n    // index (#821, #1199). New rows over the same data — a pan reading the\n    // event kinds' rows again, a draft — move neither, so the search stands.\n    // The source of the rows the canvas pages — its `rows` source, or a paged resource kind's — keeps its own Search\n    // Records, navigation over its whole record (#1513, `find.ts`): the rail narrows, never the key search, and a pick\n    // clears what hides its row.\n    const seekable = rowsPart === undefined && data.rows.type !== \"inline\" && data.rows.value.seek.type === \"some\";\n    const sourceId = data.rows.type !== \"inline\" ? data.rows.value.id : \"\";\n    // A pick in it hands the keyboard to the canvas (#1398): the row it brings in takes the focus — the grid's one stop,\n    // its ring — once the box has let the keyboard go (below); a step leaves it in the box.\n    const [findError, setFindError] = useState<string | undefined>(undefined);\n    const hiddenPick = useHiddenPick({ onError: setFindError, uncleared: words.m.keySearchUncleared() });\n    const handOff = hiddenPick.handOff;\n    const picking = useMemo(() => handOff.search(controller.search), [handOff, controller]);\n    const seekSearch = useMemo<PlanSearch | undefined>(\n        () => (seekable ? { ...picking, resetKey: sourceId, requery: seek.again } : undefined),\n        [seekable, picking, sourceId, seek.again]);\n    const findsRows = useMemo(\n        () => (data.rows.type !== \"inline\" ? planPart(slices, pagedSlot ?? ROWS_SOURCE) : undefined),\n        [data.rows.type, slices, pagedSlot]);\n    const rowsHiding = useSourceHidden(\"Plan\", findsRows);\n    const rowsFind = usePlanRowsFind({ part: findsRows, pick: rowsHiding, clear: hiddenPick.clear, controller, words, onError: setFindError });\n    const search = useMemo(\n        () => (rowsFind !== undefined ? hiddenPick.search(rowsFind) : seekSearch),\n        [rowsFind, hiddenPick, seekSearch]);\n\n    // ── Row focus and the visible rows ────────────────────────────────────\n    const { linkFamily, focusVisibleKeys, focusCtx } = usePlanFocus(view.focus, data.links);\n    // The links focus's ends whose runs a row read lean does not hold, once its rows draw (#1438): their rows are read\n    // whole (above), and stay so while the focus lasts. A row the canvas has not placed has no end to draw.\n    const linksFocusKey = view.focus?.kind === \"links\" ? view.focus.key : undefined;\n    const readsWhole = whole !== undefined;\n    // Set only when they move: an update that leaves them as they are is still a render, and a window landing — which\n    // moves the index — would commit twice (#815).\n    useEffect(() => {\n        if (linksFocusKey === undefined || !readsWhole || focusVisibleKeys === undefined) {\n            if (linkEnds.ids.length > 0) setLinkEnds(NO_LINK_ENDS);\n            return;\n        }\n        const kept = linkEnds.focus === linksFocusKey ? linkEnds.ids : [];\n        const ids = new Set(kept);\n        for (const link of data.links) {\n            for (const end of [link.from, link.to]) {\n                const rowKey = rowKeyOf(end.row);\n                if (!focusVisibleKeys.has(rowKey) || !index.byKey.has(rowKey) || linkedElementOf(rowKey, end.run) !== undefined) continue;\n                const id = entryOf(end.row);\n                if (id !== undefined) ids.add(id);\n            }\n        }\n        if (linkEnds.focus !== linksFocusKey || ids.size !== kept.length) setLinkEnds({ focus: linksFocusKey, ids: [...ids] });\n    }, [linksFocusKey, readsWhole, focusVisibleKeys, data.links, index, linkedElementOf, linkEnds]);\n    // Keyed on the view FIELDS the walk reads (`grain`, `collapsed`), and each\n    // row object kept while it holds, so a row's memo survives both a store\n    // change that did not move it and a window landing (#616, #815).\n    const { grain, collapsed, chartsExpanded } = view;\n    const walked = useMemo(\n        () => visibleRows(index, { grain, collapsed }, focusVisibleKeys),\n        [index, grain, collapsed, focusVisibleKeys]);\n    const visible = useStableVisible(walked);\n    const pinned = useMemo(\n        () => pinnedRows(index).map((row): VisibleRow => ({ row, depth: 0, collapsed: false })),\n        [index]);\n    // The grain folds ROOT groups to their strips (`visibleRows`), so the\n    // toolbar's GROUP · RESOURCE segment mounts only where it folds one (#632).\n    const hasRootGroup = useMemo(() => index.roots.some((r) => r.kind.type === \"group\"), [index]);\n\n    // ── The frame ─────────────────────────────────────────────────────────\n    // The virtualizer's scroll viewport and the sticky chrome inside it —\n    // what the R2 clamp measures, watched rather than measured once (#812).\n    const scrollElRef = useRef<HTMLDivElement | null>(null);\n    const headerRef = useRef<HTMLDivElement | null>(null);\n    const { canExpand, expandBody, expandGutterBody, heightCtx } = usePlanExpand(\n        value, view.focus, focusCtx, { index, visible, derived }, dense, chartsExpanded,\n        { scrollElRef, headerRef }, !narrow);\n    // Entering a row focus can swap the body tree (R2 unmounts the clicked\n    // control), dropping browser focus to <body> and killing the esc rung —\n    // re-anchor keyboard focus on the focused ROW (#819: it holds the tab\n    // stop from then on), or on the canvas surface in the narrow layout,\n    // which has no grid. Focus that stayed in the canvas is left where it\n    // is; on the canvas's surface it is a dropped focus kept there until a\n    // row takes it (#1398, below), and the focused row takes it here.\n    useEffect(() => {\n        if (view.focus === null) return;\n        const bodyEl = focusBodyRef.current;\n        const at = document.activeElement;\n        if (bodyEl === null || (at !== null && at !== document.body && at !== bodyEl && bodyEl.contains(at))) return;\n        if (narrow) bodyEl.focus();\n        else controller.focusItem(rowItemKey(view.focus.key));\n    }, [view.focus, narrow, controller]);\n    // A search served — its row resolved, the canvas brought to it: a pick's row takes the keyboard (#1398), while the\n    // canvas draws it as the keyboard is handed over — never a row the viewer has scrolled away from, whose request the\n    // grid would serve by scrolling back. Each search once: a later render never hands it a row an earlier search found.\n    const searchSeq = scroll.searchSeq;\n    const searchTarget = scroll.targetKey;\n    const servedSearch = useRef(searchSeq);\n    useEffect(() => {\n        if (servedSearch.current === searchSeq) return;\n        servedSearch.current = searchSeq;\n        if (searchTarget === undefined || narrow) {\n            handOff.drop();\n            return;\n        }\n        const key = rowItemKey(searchTarget);\n        const served = searchSeq;\n        handOff.land(() => {\n            // The row the search was served on may draw a frame or two after: the view scrolls to it, and the virtual rows\n            // mount it as they follow — a pick whose clear leaves another narrowing standing lands so (review of #1481,\n            // finding 3). It takes the keyboard once drawn, while no later search has been served and the focus is still\n            // the box's or nowhere; a row never drawn in that time takes nothing.\n            let frames = 0;\n            const take = (): void => {\n                if (servedSearch.current !== served) return;\n                const at = document.activeElement;\n                if (at !== null && at !== document.body && at.closest(KEY_SEARCH_BOX) === null) return;\n                if (drawsItem(focusBodyRef.current, key)) { controller.focusItem(key); return; }\n                if (++frames < LAND_FRAMES) requestAnimationFrame(take);\n            };\n            take();\n        });\n    }, [searchSeq, searchTarget, narrow, handOff, controller]);\n    // The hover cursor: direct DOM writes, zero renders (#609).\n    const cursorChipRef = useRef<HTMLDivElement | null>(null);\n    const cursor = usePlanCursorController(focusBodyRef, cursorChipRef, scale);\n    // The overlay layer (#816): the body listens for every element, and one\n    // popover / hover card / tooltip opens where it is asked.\n    const [anchors] = useState(createOverlayAnchors);\n    const hasPopover = data.popover.type === \"some\";\n    const hasHover = data.hover.type === \"some\";\n    const overlayHandlers = usePlanOverlayHandlers(focusBodyRef, controller, anchors,\n        useMemo(() => ({ popover: hasPopover, hover: hasHover }), [hasPopover, hasHover]));\n\n    // ── Recipe + layout ───────────────────────────────────────────────────\n    // Density is GEOMETRY, not a recipe variant (#817): one table of every\n    // row and slot height, written below as the CSS variables the recipe\n    // reads — the same numbers `rowHeight` lays the body out from.\n    const recipe = useSlotRecipe({ key: \"plan\" });\n    const styles = useMemo(() => recipe() as unknown as Styles, [recipe]);\n    // A coarse pointer's horizon band is taller, its handles' zones wider (#1438).\n    const coarse = useCoarsePointer();\n    const geometry = planGeometry(dense, coarse);\n    const geometryStyle = useMemo(() => planGeometryStyle(geometry), [geometry]);\n    const style = useMemo(() => getSomeorUndefined(data.style), [data.style]);\n    // gutterWidth is a CSS px size string. `pxOf`, not `parseFloat`: a\n    // percentage must fall back to the default, never silently become that\n    // many pixels (#615).\n    const gutterW = (style !== undefined && style.gutterWidth.type === \"some\" ? pxOf(style.gutterWidth.value) : undefined) ?? GUTTER_W;\n    const gridTemplate = `${gutterW}px 1fr`;\n    const height = parseCssSize(style !== undefined ? getSomeorUndefined(style.height) : undefined);\n    const maxHeight = parseCssSize(style !== undefined ? getSomeorUndefined(style.maxHeight) : undefined);\n    // A declared bound is the whole Plan's: it goes on the WRAPPER around its\n    // frame (#1193), and the canvas fills main (`fillParent`) — the Board /\n    // Roster / Planner / ValueTree discipline. Passing it inward leaves a\n    // percentage (`\"fill\"` → `\"100%\"`) resolving against the auto-height\n    // wrapper, which computes to `auto`: the frame reports bounded, renders\n    // the spacer, and never scrolls. With none, a host that gives the frame a\n    // height bounds the canvas the same way (`root/host-bound.ts`); one that\n    // gives none lets it grow with its rows, and main with it.\n    const declaredBound = height !== undefined || maxHeight !== undefined;\n    const hostBound = useHostBound(focusBodyRef, declaredBound);\n    const frameFills = declaredBound || hostBound;\n\n    // ── The drag-target role ──────────────────────────────────────────────\n    // A drop is a draft of the editing session (#880): the canvas is a target\n    // only while the session can take one. A card lands — from the Plan's own\n    // library panel (#1259), or a Library its `sources` lists; the canvas's own\n    // runs, chips, tiles and marks move and resize (#825) — where one lands is\n    // what its rows proposed at the drop point, from the press it began with\n    // (`edit/store.ts`). The drag layer is told whether the gesture was\n    // drafted: a drop the row's write refused, or a move back to where it\n    // began, is announced as not dropped.\n    //\n    // Beside event kinds (#1196) the canvas takes their drags too, each one\n    // step of the Plan's one history through their recorder: a card on an\n    // event kind's row — a template, a backlog event, an author's card on an\n    // event — an event's element moved or resized, and an element returned to\n    // the Backlog tab (`edit/event-drag.ts`).\n    const [editStore] = useState(() => new PlanEditStore());\n    const { drop: draftDrop, move: draftMove } = editing;\n    const keys = useMemo(() => planKeys(getSomeorUndefined(hostData.id)), [hostData.id]);\n    const eventDrag = usePlanEventDrag({\n        kinds, resources, tabs, keys, editing: eventEditing, canDrop, scale, words, store: editStore,\n        rowOf: (key) => indexRef.current?.byKey.get(key),\n        selected: () => controller.getSnapshot().store.ui.elements,\n        select: (selected, row) => {\n            controller.selectEvents(selected, row ?? null);\n            // A scheduled backlog card unmounts at its origin. Hand focus to\n            // the dropped event through the same path as a keyboard drop.\n            const first = selected[0];\n            if (row !== undefined && first !== undefined) editStore.focusAfterDraw(row, first);\n        },\n    });\n    const onDrag = useCallback((event: DragEventValue, meta?: DragMeta): boolean => {\n        // Nothing lands while a run of the optimiser is out (R2).\n        if (locked) return false;\n        if (event.type === \"add\") {\n            // A card on an event kind's row is the event kinds'; on `data`'s, its session's.\n            const row = indexRef.current?.byKey.get(event.value.into.row);\n            if (eventDrag !== undefined && row !== undefined && eventDrag.target(row) !== undefined) return eventDrag.dropCard(event);\n            return draftDrop(event);\n        }\n        // An element returned to the Backlog tab: unscheduled (#1196).\n        if (event.type === \"remove\") return eventDrag !== undefined && meta?.library !== undefined && eventDrag.returnElement(event, meta.library);\n        if (event.type !== \"move\" && event.type !== \"resize\") return false;\n        const { grab, proposal } = editStore;\n        editStore.disarm();\n        const row = event.type === \"move\" ? event.value.to.row : event.value.event.row;\n        if (grab === null || proposal === null || proposal.rowKey !== row || unmoved(grab.movable, proposal)) return false;\n        const request: PlanMoveRequest = {\n            key: grab.movable.key, from: grab.movable.rowKey, to: proposal.rowKey, span: proposal.span,\n            origin: event.type === \"resize\" ? \"resize\" : originOf(grab.movable, proposal).kind,\n            label: grab.movable.label, element: grab.movable, units: proposal.units, fine: proposal.fine,\n        };\n        return eventDrag !== undefined && eventDrag.isEvent(grab.movable) ? eventDrag.moveElement(request) : draftMove(request);\n    }, [draftDrop, draftMove, editStore, eventDrag, locked]);\n    // No drop target, no grip and no event drag while a run's call is out (R2).\n    const rowDrop = usePlanDropTarget(value, data.sources, panel ?? NO_PANEL, onDrag, editing.available && !locked, locked ? undefined : eventDrag);\n\n    // ── The body ──────────────────────────────────────────────────────────\n    const body = usePlanBody(visible, index, derived, paging, focusCtx, heightCtx, dense, chartsExpanded);\n    const target = usePlanScrollTarget(body.items, index, derived, scroll);\n    // The rows' pitch where a run stands for rows not read yet (#1398, CL2): the height most resident rows draw at —\n    // a two-line row's 42, a span row's 32 — else the default row's.\n    const runPitch = useMemo(() => {\n        const seen = new Map<number, number>();\n        let pitch = geometry.row;\n        let most = 0;\n        body.items.forEach((item, i) => {\n            const h = body.heights[i];\n            if (item.kind !== \"row\" || h === undefined) return;\n            const n = (seen.get(h) ?? 0) + 1;\n            seen.set(h, n);\n            if (n > most) { most = n; pitch = h; }\n        });\n        return pitch;\n    }, [body.items, body.heights, geometry.row]);\n    // ── The links layer (R1, #818) ────────────────────────────────────────\n    // Its ribbons are laid out from THIS body — the heights the frame lays the\n    // rows out at — and drawn in the rows' own coordinates, so they follow a\n    // collapse or a landing window in the same render as the rows do.\n    const linksFocus = view.focus?.kind === \"links\";\n    const ribbonRows = useMemo(\n        () => (linksFocus ? ribbonBody(body.items, body.heights, geometry) : undefined),\n        [linksFocus, body.items, body.heights, geometry]);\n    // A pinned row renders in the header, above every body row; a row of an\n    // evicted paged window sits where its window does in its block's band\n    // (#823) — a row never seen has no place, and its edges are not drawn.\n    const pinnedKeys = useMemo(() => new Set(pinned.map((v) => v.row.key)), [pinned]);\n    // (A band moves only with the body, so the ribbons' body is what renews it.)\n    const beyond = useCallback((key: string): RibbonBeyond | undefined => {\n        if (pinnedKeys.has(key)) return { off: \"above\" };\n        const place = paged ? controller.placeOf(key) : undefined;\n        const top = place !== undefined ? ribbonRows?.bands.get(`${place.block}:${place.at}`) : undefined;\n        return place !== undefined && top !== undefined ? { y: top + place.px } : undefined;\n    }, [pinnedKeys, paged, controller, ribbonRows]);\n    // What a bounded frame's view is read from — its scroll element and the\n    // sticky chrome above its rows.\n    const frameRefs = useMemo(() => ({ scrollElRef, headerRef }), [scrollElRef, headerRef]);\n    // ── The focus across a landing (#1398, CL10) ──────────────────────────\n    // Fetch, then move: a keyboard move past the rows read waits on the item it set out from, never on the run — its\n    // intent, served once the rows land (`navIntent`, below). A run holding the focus — a click into it — owes it to the\n    // first of its rows the view shows once they land, and a key pressed on it waits for them (`owedFocus`'s `waits`).\n    // Every key that moves through the rows pressed while a move waits — on the run, or on the row the move set out\n    // from — waits with it, in the order pressed, and goes on once the rows are in: none is lost (#1398, CL10).\n    // A focused item a landing takes off the canvas leaves the focus on the canvas's surface, never the page's body: an\n    // intent waiting takes it on from there, a run owed it does as above, and a row taken off owes it to the first row\n    // the view shows. What the view shows takes what is owed as it is reported at rest (`takeOwed`). A key that moves\n    // through the rows, pressed on the surface while it holds what is owed, waits as one pressed on the run does — a\n    // run the click focused can leave the frame before its rows come, when windows the page still holds land at once\n    // beside it as the view comes to rest (`surfaceKey`).\n    const navIntent = useRef<{ holder: string; intent: PlanNavIntent; then: readonly PlanWaitKey[] } | null>(null);\n    const owedFocus = useRef<{ band: PlanBand | undefined; waits: readonly PlanWaitKey[] } | null>(null);\n    const takeOwed = useRef<(shown: readonly PlanBodyItem[]) => void>(() => undefined);\n    // The paged kind's rows in view, once the scroll rests (#1039): the reader of its kinds' cells reads the blocks around them\n    // — under the narrowing their windows are (#1344), so a choice's reads none for the last one's rows standing in. They are\n    // the rows the view shows, never the overscan mounted beside them, and a view showing a run not read yet and no row read\n    // leaves the span standing (`shownCellSpan`).\n    const pagingOrigin = paging.origin;\n    const pagingNarrowing = paging.narrowing;\n    const reportRange = usePlanRangeReport(body.items, controller, pagingOrigin);\n    const onRangeChange = useCallback((\n        range: { startIndex: number; endIndex: number }, isScrolling: boolean, center?: { index: number; withinPx: number },\n        shown?: { startIndex: number; endIndex: number },\n    ) => {\n        reportRange(range, isScrolling, center);\n        if (isScrolling) return;\n        const inView: { key: string; path: readonly string[] }[] = [];\n        const rows: PlanRowValue[] = [];\n        let notRead = false;\n        let run = false;\n        for (let i = shown?.startIndex ?? 0; shown !== undefined && i <= shown.endIndex; i++) {\n            const item = body.items[i];\n            if (item?.kind === \"row\") rows.push(item.row.row);\n            if (item?.kind === \"row\" && item.row.row.id.type === \"entry\") inView.push({ key: item.row.row.key, path: item.row.row.id.value.path });\n            else if (item?.kind === \"band\" || item?.kind === \"failed\") notRead = true;\n            // A run whose windows are on their way: the view waits for them.\n            if (item?.kind === \"band\" && item.band.loading !== undefined) run = true;\n        }\n        cellSpans.set(shownCellSpan(inView, notRead, cellSpans.get(), pagingOrigin, pagingNarrowing));\n        // And the rows whose nested series the reader reads around them (#1438): a view showing none stays as it was.\n        if (rows.length > 0) nestedViews.set({ first: rows[0]!.key, last: rows[rows.length - 1]!.key });\n        // What the view waits for now, as it rests (#1398, CL3): a run on its way, or rows whose cells have not landed. A\n        // run is held here only where its rows' cells are read after it; elsewhere the driver's own `viewLoading` says it,\n        // in the commit that lands it, so a window landing stays one commit.\n        rowsInView.current = rows;\n        awaitInView(unread !== undefined && run, unread !== undefined && rows.some(unread));\n        // What the view shows takes a focus a landing owes it.\n        takeOwed.current(shown === undefined ? [] : body.items.slice(shown.startIndex, shown.endIndex + 1));\n    }, [reportRange, body.items, pagingOrigin, pagingNarrowing, cellSpans, nestedViews, unread, awaitInView]);\n    // Scroll anchoring (#878): the row at the top of the view keeps its place\n    // when rows above it change height or count — a window landing above at a\n    // height its estimate missed. An unloaded band never anchors: rows landing\n    // below it move its top, and after a rebase the same band stands for other\n    // elements.\n    const anchorable = useCallback((i: number) => body.items[i]?.kind !== \"band\", [body.items]);\n    // The sticky parent (#823): while the row at the top of the view nests\n    // under a parent whose own row has scrolled off, that parent — and, on a\n    // deep tree, the path to it — is pinned under the header. The same inline\n    // and paged: a paged window holds its entries whole, and a section's\n    // header is a fixed block, so a row's parent is always on the canvas.\n    const itemIndex = useMemo(() => {\n        const m = new Map<string, number>();\n        body.items.forEach((it, i) => m.set(bodyItemKey(it), i));\n        return m;\n    }, [body.items]);\n    const stickyParent = useCallback((top: number): ReactNode => {\n        const item = body.items[top];\n        if (item?.kind !== \"row\" || item.row.row.parent.type !== \"some\") return null;\n        const parent = index.byKey.get(item.row.row.parent.value);\n        // Its own row still in view (or below): nothing to pin.\n        const at = parent !== undefined ? itemIndex.get(rowItemKey(parent.key)) : undefined;\n        if (parent === undefined || (at !== undefined && at >= top)) return null;\n        const path: PlanRowValue[] = [];\n        for (let up = parent.parent; up.type === \"some\";) {\n            const row = index.byKey.get(up.value);\n            if (row === undefined) break;\n            path.unshift(row);\n            up = row.parent;\n        }\n        return (\n            <PlanStickyParent parent={parent} path={path} styles={styles} gridTemplate={gridTemplate}\n                onGo={() => controller.focusItem(rowItemKey(parent.key), \"start\")} />\n        );\n    }, [body.items, index, itemIndex, styles, gridTemplate, controller]);\n    // After EVERY commit: what the canvas now shows. A jump keeps the viewport\n    // until its landed target has been on screen for a commit — the one in\n    // which the frame scrolled to it — so the reports that commit's render made\n    // from the OLD position cannot rebase the run back (#812).\n    useEffect(() => { controller.committed(paging); });\n    // The scroll anchor (#813): placed against the body once it can be — a\n    // paged canvas may first jump to the window its row came from — or, the\n    // source counted empty, settled with nothing to place (#1398).\n    useEffect(() => {\n        if (anchor.phase !== \"settled\") controller.placeAnchor(body.items, frameFills && !narrow);\n    }, [controller, anchor.phase, body.items, frameFills, narrow, paging.total, paging.replacing]);\n    const onAnchorChange = useCallback(\n        (at: { index: number; offset: number }) => controller.anchorChanged(at, body.items),\n        [controller, body.items]);\n    // The narrow list's side of the paging loop (#812): it has no virtualizer,\n    // so it reports the last row card on screen, and its load-more asks every\n    // block with more for the window past its resident run (#823) — the list\n    // ends with the last block's unloaded run.\n    const narrowPaging = useMemo<PlanNarrowPaging | undefined>(() => {\n        if (!paged) return undefined;\n        const more = paging.blocks.filter((b) => b.tail !== undefined);\n        return {\n            tail: more[more.length - 1]?.tail,\n            // What the list's `N more rows` counts past its rows read: the source's, never what has loaded (#1398).\n            beyond: paging.total === undefined || paging.replacing ? undefined : more.reduce((n, b) => n + bandElements(b.tail!), 0),\n            onViewport: (key: string) => controller.reportViewport({ kind: \"row\", key }, false),\n            onLoadMore: () => {\n                for (const b of more) controller.reportViewport({ kind: \"band\", block: b.index, at: \"tail\" }, false);\n            },\n        };\n    }, [paged, paging.blocks, paging.total, paging.replacing, controller]);\n    // What the narrow list's Measures tab counts over a paged source (#1398, ruled 27 Oct 2026, \"Exact where it can be\"):\n    // the source's count times the chart rows each of its entries makes across the paged blocks, beside the chart rows\n    // of the blocks no entry makes — where every entry makes as many (`PlanPagedBlock.charts`); not counted where some\n    // block's entries make no fixed number of them; nothing yet while the source has not counted itself, or a new\n    // narrowing's rows are read. Never what has loaded.\n    const pagedMeasures = useMemo((): number | \"notCounted\" | undefined => {\n        if (!paged || paging.replacing || paging.total === undefined) return undefined;\n        let each = 0;\n        for (const block of paging.blocks) {\n            if (block.fixed) continue;\n            if (block.charts === undefined) return \"notCounted\";\n            each += block.charts;\n        }\n        const fixed = rows.filter((row) => paging.blocks[row.block]?.fixed === true && row.kind.type === \"chart\").length;\n        return paging.total * each + fixed;\n    }, [paged, paging.replacing, paging.total, paging.blocks, rows]);\n    // What the toolbar reports (#811) — everything the canvas carried on past.\n    // The event kinds' rows that could not be read are said on the footer's\n    // line, with Retry, and only there (#1398): a read's failure is said once,\n    // never as a \"… unavailable\" status. The narrow list has no scroll target,\n    // so there the rows chip states the count without offering to seek.\n    const sourceError = paging.sourceError;\n    const diagnostics = useMemo<PlanDiagnostics>(() => ({\n        skipped: derived.diagnostics.size,\n        onSeekSkipped: target.firstSkipped !== undefined && !narrow ? controller.seekSkipped : undefined,\n        sourceError,\n        searchError: seek.searchError ?? findError,\n        truncatedAt: scale?.truncated?.shown,\n    }), [derived.diagnostics, target.firstSkipped, narrow, controller, sourceError, seek.searchError, findError, scale]);\n\n    // The element-click funnel, when the root declares `onElementClick` (#824)\n    // — the controller reports a click to the LATEST root's.\n    const clickable = data.onElementClick.type === \"some\";\n    const resolvers = useMemo<PlanResolvers>(\n        () => ({ onElementClick: clickable ? controller.elementClick : undefined }),\n        [clickable, controller]);\n    // What the elements select by (#1197): an event kind's element, its event.\n    const selectable = useMemo(() => selectableOf(eventKinds), [eventKinds]);\n    // What the inspector reads of the rows (#1197): a row, and what it draws at a bucket — as the canvas draws it.\n    const inspect = useMemo<PlanCanvasInspect>(() => ({\n        row: (key) => index.byKey.get(key),\n        valueAt: (key, at) => {\n            const row = index.byKey.get(key);\n            return row === undefined || scale === undefined ? undefined : rowValueAt(row, derived, scale, words, at);\n        },\n    }), [index, derived, scale, words]);\n    // Events selected from the frame (#1198) — the overlaps chip's pair, the\n    // inspector's banner, a duplicate the inspector made (#1194): on the row\n    // given, else the row that draws the first, which the controller brings\n    // into view; none when no row on the canvas draws it. The rows are this\n    // render's, read as the frame selects: the same function as windows land,\n    // so the frame's toolbar items it reaches are made again only as what\n    // they show moves (#1398, CL9).\n    const selectEvents = useCallback((keys: readonly string[], row?: RowKey) => {\n        const first = keys[0];\n        if (first === undefined) {\n            const selectedRow = controller.getSnapshot().store.ui.selected;\n            controller.selectEvents([], null);\n            // Delete can unmount either the focused event or its inspector\n            // button. Keep Undo and the grid's keyboard navigation reachable.\n            if (selectedRow !== null) controller.focusItem(rowItemKey(selectedRow));\n            return;\n        }\n        controller.selectEvents(keys, row ?? indexRef.current?.rows.find((r) => holdsElement(r, first))?.key ?? null);\n    }, [controller]);\n    // What every row of this render shares (#616: per-row facts are computed\n    // from it, and each row's memo skips unless ITS facts moved).\n    const marks = editing.marks;\n    // Where each open group ends (#949) — its last visible member's rule.\n    const groupEnds = useMemo(() => groupEndsOf(body.items), [body.items]);\n    // A row a gesture waits on, read whole, and every row above it (#1438): their numbers move once it lands and the\n    // gesture drafts, so they draw as in flight meanwhile — an unread row's wash, its plot busy.\n    const { inFlight } = editing;\n    const rowsInFlight = useMemo((): ReadonlySet<RowKey> => {\n        const out = new Set<RowKey>();\n        for (const key of inFlight) {\n            for (let at: RowKey | undefined = key; at !== undefined && !out.has(at);) {\n                out.add(at);\n                const parent: PlanRowValue[\"parent\"] | undefined = index.byKey.get(at)?.parent;\n                at = parent !== undefined && parent.type === \"some\" ? parent.value : undefined;\n            }\n        }\n        return out;\n    }, [inFlight, index]);\n    const unreadOrInFlight = useMemo(() => (rowsInFlight.size === 0 ? unread\n        : (row: PlanRowValue) => rowsInFlight.has(row.key) || unread?.(row) === true), [unread, rowsInFlight]);\n    const rowCtx = useMemo<PlanRowContext>(() => ({\n        styles, gridTemplate, dense, storageKey, index, derived,\n        dispatch: controller.dispatch, chartsExpanded, focusCtx, heightCtx, linkFamily, linkedKeys,\n        canExpand, expandBody, expandGutterBody, partial, rowDrop, marks, groupEnds, unread: unreadOrInFlight,\n    }), [styles, gridTemplate, dense, storageKey, index, derived, controller, chartsExpanded,\n        focusCtx, heightCtx, linkFamily, linkedKeys, canExpand, expandBody, expandGutterBody, partial, rowDrop, marks,\n        groupEnds, unreadOrInFlight]);\n\n    // The resolution segment is a TIME-axis affordance; the now instant rides\n    // whichever arm the axis declares.\n    const resolutions = useMemo(() => axisResolutions(data.axis), [data.axis]);\n    // The resolutions the Plan zooms to, the finest first: its segment's and the one its axis opens at — what a table\n    // cell's typing reads (#1438). The resolution is the slice's: without one the Plan shows the one it opens at alone.\n    const zoomable = slices !== undefined;\n    const zooms = useMemo(() => (zoomable ? planZooms(resolutions, data.axis.type === \"time\" ? data.axis.value.resolution.type : undefined) : []),\n        [zoomable, resolutions, data.axis]);\n    const now = useMemo(() => axisNow(data.axis), [data.axis]);\n    // What the brush spans beside the window shown while no source holds the window (#1344).\n    const stated = useMemo(() => statedWindow(data.axis), [data.axis]);\n    // The history (#880, #1194): the frame's history item (#988) over the\n    // Plan's one history — `data`'s session and each event kind's — and each\n    // session's banners. An issue of `data`'s takes the reader to its entry's\n    // first row on the canvas — one its entry placed — and a banner names it\n    // by that row; an event kind's selects its event, and its banner names it\n    // by its title.\n    const rowOfIssue = useCallback(\n        (issue: EditIssue) => sourceRows.find((r) => entryOf(r.id) === issue.entry), [sourceRows]);\n    const where = useCallback((issue: EditIssue) => rowOfIssue(issue)?.gutter.label ?? issue.entry, [rowOfIssue]);\n    // The rows an issue's click looks for its entry among: this render's, read as it is clicked.\n    const rowOfIssueNow = useRef(rowOfIssue);\n    rowOfIssueNow.current = rowOfIssue;\n    const kindSessions = eventEditing.sessions;\n    // The canvas's one table input (#1436, #1438) — and the cell focus a zoom, or a conflict's Go to, lands on.\n    const typingStore = useMemo(() => new PlanTypingStore(), []);\n    const scaleNow = useRef(scale);\n    scaleNow.current = scale;\n    const moveWindowNow = useRef(moveWindow);\n    moveWindowNow.current = moveWindow;\n    // The field a refusal gone to names, asked of its event's form: ringed there, it takes the keyboard as the form draws\n    // it, and so comes into view (`../shared/schedule/field-ask.tsx`).\n    const { asks: fieldAsks, request: askField } = useFieldAsks();\n    const onIssue = useCallback((issue: EditIssue, path?: PatchPath) => {\n        const source = history.sourceOf(issue);\n        const kind = source === undefined ? undefined : kindSessions.find((s) => stringEqual(s.key, source));\n        if (kind !== undefined) {\n            if (issue.entry === \"\") return;\n            // The warning button's issue asks for the field it names; a conflict's Go to, which names its path, for none.\n            askField(kind.kind, issue.entry, path === undefined ? issue.field : none);\n            selectEvents([printEventRef({ kind: kind.kind, key: issue.entry })]);\n            return;\n        }\n        // A conflict's Go to: the row its path leads to among the canvas's rows (#1438) opened under its folded rows and\n        // selected — a crew's, below its works' — the window moved over the instant its path names where it shows\n        // another, as many buckets as it shows with the instant's in their middle, and the cell holding the instant\n        // focused as the row draws in it, as a zoom's landing focuses it.\n        const place = path === undefined ? undefined : conflictPlaceOf(indexRef.current?.rows ?? [], issue.entry, path);\n        const row = place?.rows[place.rows.length - 1] ?? rowOfIssueNow.current(issue);\n        if (row === undefined) return;\n        controller.revealRow(row.key);\n        const shown = scaleNow.current;\n        if (place !== undefined && place.at !== undefined && shown !== undefined && shown.kind === \"time\" && shown.resolution !== undefined) {\n            const at = timeInstant(place.at);\n            if (shown.bucketOf(at) < 0) {\n                const min = shown.offset(shown.floor(at), -Math.floor(shown.n / 2));\n                moveWindowNow.current(shown.toNumber(min), shown.toNumber(shown.offset(min, shown.n)));\n            }\n            typingStore.focusOnZoom({ rowKey: row.key, at: shown.toNumber(at), resolution: shown.resolution });\n            controller.dispatch({ t: \"row.select\", key: row.key });\n            controller.showItem(rowItemKey(row.key), \"auto\");\n            return;\n        }\n        controller.focusItem(rowItemKey(row.key), \"auto\");\n    }, [history, kindSessions, askField, selectEvents, controller, typingStore]);\n    // A conflict below its entry's row named by the rows down to it — `Works 10001 / Crew 1`, never the crew's key —\n    // then any steps below them, in words; an event kind's as its banners name it.\n    const conflictItem = useCallback((issue: EditIssue, path: PatchPath, steps: readonly string[]) => {\n        const source = history.sourceOf(issue);\n        if (source === undefined || kindSessions.some((s) => stringEqual(s.key, source))) return undefined;\n        const place = conflictPlaceOf(indexRef.current?.rows ?? [], issue.entry, path);\n        if (place === undefined || place.keys === 0) return undefined;\n        return [...place.rows.map((row) => row.gutter.label), ...steps.slice(place.keys)].join(\" / \");\n    }, [history, kindSessions]);\n    // A run's highlight ends with Undo, Apply and Discard; a Redo of its step replays its landing (R9, R16) — and no\n    // history action runs while a run's call is out (R2).\n    const onHistory = useCallback((action: HistoryAction) => {\n        if (locked) return;\n        acted(action, history.redoOrigin);\n        history.act(action);\n    }, [history, locked, acted]);\n    const edits = editing.enabled || kinds.length > 0;\n    // Each session's banners: `data`'s naming no source, each kind's naming its kind, its issues by its events' titles —\n    // each event read as a gesture reads it, where the canvas reads its rows; one its drafts removed, as its record held\n    // it; else by its key (#1199, `scheduleIssueName`). The two reads are the same functions while the editing stands, so\n    // a window landing makes the banners no new props.\n    const readEvent = eventEditing.read;\n    const heldEvent = eventEditing.heldEvent;\n    const naming = useMemo(() => ({ read: readEvent, heldEvent }), [readEvent, heldEvent]);\n    const sessions = useMemo((): readonly PlanSessionBanner[] => {\n        const actOn = (key: string) => (action: HistoryAction) => history.actOn(key, action);\n        const out: PlanSessionBanner[] = editing.enabled\n            ? [{ key: editing.historyKey, session: editing.session, name: undefined, where, onAction: actOn(editing.historyKey) }]\n            : [];\n        for (const held of kindSessions) {\n            const kind = kinds.find((k) => stringEqual(k.key, held.kind));\n            // Two kinds over one record share its session, and its banners.\n            if (kind === undefined || out.some((s) => stringEqual(s.key, held.key))) continue;\n            out.push({\n                key: held.key, session: held.session, name: kind.name, onAction: actOn(held.key),\n                where: (issue) => scheduleIssueName(naming, kind.key, issue.entry),\n            });\n        }\n        return out;\n    }, [editing.enabled, editing.historyKey, editing.session, where, kindSessions, kinds, naming, history]);\n    // A conflict's item in the history bar's popover, named as its session's banners name its issues — by this\n    // render's rows, read as the popover draws, so a window landing makes the history item no new props (CL9).\n    const namingNow = useRef({ sessions, where });\n    namingNow.current = { sessions, where };\n    const historyWhere = useCallback((issue: EditIssue) => {\n        const key = history.sourceOf(issue);\n        const naming = namingNow.current;\n        const held = key === undefined ? undefined : naming.sessions.find((s) => stringEqual(s.key, key));\n        return (held?.where ?? naming.where)(issue);\n    }, [history]);\n    // The events whose rows break their kind's bounds (#1585), by their elements' keys: each element of one wears the warn\n    // ring, stored or changed, and a stored one's breach is a warning beside the history's issues, holding no Save, gone\n    // to as an issue of its session is. Read by a component of its own (`PlanBoundsReader`, in `provide`), which hands\n    // them over only as they move.\n    const [breaches, setBreaches] = useState<PlanBreaches>(NO_BREACHES);\n    const boundsWarnings = breaches.warnings;\n    const warnings = useMemo(() => boundsWarnings.map(({ kind, issue, text }) => ({\n        text,\n        go: () => {\n            askField(kind, issue.entry, issue.field);\n            selectEvents([printEventRef({ kind, key: issue.entry })]);\n        },\n    })), [boundsWarnings, askField, selectEvents]);\n    // The history item's props, made again only as the history moves — its version moves with every change of it or\n    // of its sessions — or as its words, actions and warnings do, never as a window lands: the frame's toolbar is handed\n    // the same history item, and draws and measures nothing again for it (#1398, CL9).\n    const historyProps = useMemo(\n        () => (edits ? { session: history, words, editing: false, onAction: onHistory, onIssue, conflictItem, where: historyWhere, locked, warnings } : undefined),\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the history is mutable: its version says it moved\n        [edits, history, historyVersion, words, onHistory, onIssue, conflictItem, historyWhere, locked, warnings]);\n\n    // ── The treegrid (#819) ───────────────────────────────────────────────\n    // Every item's place in the grid — the pinned rows first, a run not read\n    // taking a place for each of its rows (#1398, CL12) — published to the\n    // rows, which write it onto themselves: a collapse or a landing at the\n    // head renumbers every row below it without rendering one\n    // (`root/grid.ts`). The count is the total once a paged source has\n    // counted itself.\n    const gridRef = useRef<HTMLElement | null>(null);\n    const [positions] = useState(createRowPositions);\n    // A row leaving the grid with the focus in it hands it over as it goes, its element still on the page (`leave`,\n    // `root/grid.ts`, #1398, CL10): the canvas's surface keeps it — never the page's body, not for a moment — and a row a\n    // landing took off owes it to the first row the view shows, as a dropped focus does (`keepFocus`, below). The grid's\n    // items are this render's (`navItemsNow`), the commit that takes the row off having drawn them.\n    const navItemsNow = useRef<readonly PlanNavItem[]>([]);\n    const leave = useCallback((key: string) => {\n        const bodyEl = focusBodyRef.current;\n        if (bodyEl === null || !bodyEl.isConnected) return;\n        bodyEl.focus({ preventScroll: true });\n        if (owedFocus.current !== null || navIntent.current !== null) return;\n        if (!navItemsNow.current.some((it) => it.key === key)) owedFocus.current = { band: undefined, waits: [] };\n    }, []);\n    const gridCtx = useMemo<PlanGridContextValue>(() => ({ positions, gridRef, leave }), [positions, leave]);\n    const counted = !paged || paging.total !== undefined;\n    const places = useMemo(\n        () => gridPlaces(pinned.map((v) => rowItemKey(v.row.key)), body.items, counted),\n        [pinned, body.items, counted]);\n    useLayoutEffect(() => { positions.set(places.places); }, [positions, places]);\n    const uid = useId();\n    const pinnedId = `${uid}-pinned`;\n    // The grid's items as the keyboard walks them.\n    const pinnedHeights = useMemo(\n        () => pinned.map((v) => rowHeight(v, dense, chartsExpanded, heightCtx, derived)),\n        [pinned, dense, chartsExpanded, heightCtx, derived]);\n    const navItems = useMemo(() => planNavItems({\n        pinned, pinnedHeights, items: body.items, heights: body.heights, index, chartsExpanded, focusCtx,\n    }), [pinned, pinnedHeights, body.items, body.heights, index, chartsExpanded, focusCtx]);\n    navItemsNow.current = navItems;\n    // What the grid knows of its source's ends — a pending band move waits\n    // while a window is in flight, and Home / End until the first block's\n    // first element / the last block's last element is resident (#823).\n    const navEdges = useMemo<PlanNavEdges>(() => {\n        const pagedBlocks = paging.blocks.filter((b) => !b.fixed);\n        const first = pagedBlocks[0];\n        const last = pagedBlocks[pagedBlocks.length - 1];\n        return {\n            loading: paging.loading,\n            atStart: !paged || first === undefined || (first.head === undefined && first.resident?.from === 0),\n            atEnd: !paged || last === undefined || (last.tail === undefined && last.resident !== undefined\n                && paging.total !== undefined && last.resident.to >= paging.total),\n        };\n    }, [paged, paging.loading, paging.blocks, paging.total]);\n    // A keyboard move past the rows read waits on the item it set out from — never on the run (#1398, CL10) — for the\n    // rows, then goes on to the row it was headed for (`resolveNavIntent`); rows landed short of a page on ask for the\n    // window past them, and the page waits for it. A new result (#1344, #1354) takes a move set out among the rows it\n    // replaces with them — a step's or a page's, Home's or End's — and a focus owed to them: left, they would land in its\n    // rows as they draw. It goes as the last result's rows stand in for the new one, and at the latest as the new one's\n    // rows are drawn — the narrowing or the source the rows belong to moved on — for its first window can land before\n    // the stand-in is ever drawn. So does a far key's standing view that ends without its window — a new count.\n    const pagingReplacing = paging.replacing;\n    const pagingStanding = paging.standing;\n    const stoodIn = useRef(false);\n    const resultDrawn = useRef<{ source: string; narrowing: string | undefined } | undefined>(undefined);\n    // The keys pressed while a move waited go on from where it lands (`goOn`, below): this render's.\n    const goOnRef = useRef<(from: string, keys: readonly PlanWaitKey[]) => void>(() => undefined);\n    useEffect(() => {\n        const standingEnded = stoodIn.current && !pagingStanding;\n        stoodIn.current = pagingStanding;\n        // The result the rows drawn belong to: their source, and the narrowing a live source names — the first it names\n        // is no new one.\n        const was = resultDrawn.current;\n        resultDrawn.current = { source: sourceId, narrowing: pagingNarrowing };\n        const anew = was !== undefined && (!stringEqual(was.source, sourceId)\n            || (was.narrowing !== undefined && (pagingNarrowing === undefined || !stringEqual(was.narrowing, pagingNarrowing))));\n        if (pagingReplacing || anew) {\n            navIntent.current = null;\n            owedFocus.current = null;\n        }\n        const pending = navIntent.current;\n        if (pending !== null) {\n            // Moved on meanwhile: the move is theirs now.\n            if (controller.getSnapshot().nav.active !== pending.holder) {\n                navIntent.current = null;\n            } else {\n                const r = resolveNavIntent(navItems, pending.intent, navEdges);\n                if (r.t !== \"pending\") {\n                    navIntent.current = null;\n                    if (r.t === \"resolved\") {\n                        controller.focusItem(r.key, \"auto\");\n                        // The keys pressed while it waited go on from there, in turn.\n                        goOnRef.current(r.key, pending.then);\n                    }\n                    return;\n                }\n                if (standingEnded && (pending.intent.t === \"first\" || pending.intent.t === \"last\")) navIntent.current = null;\n                else if (r.ask !== undefined) controller.reportViewport(r.ask, false);\n            }\n        }\n        const snap = controller.getSnapshot();\n        // A keyboard move whose item the grid no longer holds — a grain change\n        // folded the row away — is dropped (left standing, it would take\n        // focus if the item ever came back), and the grid takes focus\n        // instead, handing it on to a row. A host data change that takes a\n        // row away asks for no move, and moves nothing.\n        const req = snap.nav.request;\n        if (req !== null && !navItems.some((it) => it.key === req.key)) {\n            controller.focusDone(req.seq);\n            if (!narrow) gridRef.current?.focus();\n        }\n    }, [navItems, navEdges, controller, narrow, pagingReplacing, pagingStanding, pagingNarrowing, sourceId]);\n\n    // ── The grid's keys (#819, `root/keyboard.ts`) ────────────────────────\n    // How far a page moves: the frame's viewport less its pinned header, or\n    // the window's on an unbounded canvas.\n    const pageHeight = (): number => {\n        const el = scrollElRef.current;\n        if (frameFills && el !== null) return Math.max(0, el.clientHeight - (headerRef.current?.offsetHeight ?? 0));\n        return typeof window !== \"undefined\" ? window.innerHeight : 0;\n    };\n    const runMove = (move: PlanNavMove, from: string) => {\n        switch (move.t) {\n            case \"focus\":\n                controller.focusItem(move.key, move.align);\n                break;\n            case \"fetch\":\n                // Fetch, then move (#1398, CL10): the window beside the run asked for now — whatever the scroll reports\n                // after — the focus waiting on the item it set out from, and the view where it is, until the intent finds\n                // the row it was headed for.\n                owedFocus.current = null;\n                navIntent.current = { holder: from, intent: move.intent, then: [] };\n                controller.reportViewport(move.demand, false);\n                break;\n            case \"edge\":\n                // Home / End past a run: the source's first or last window read where it is — the rows shown standing\n                // in where they are, retained, the focus on the item it set out from — then the focus lands on its first\n                // or last row as that window's rows replace them. The focus moving on meanwhile puts the rows back.\n                owedFocus.current = null;\n                navIntent.current = { holder: from, intent: { t: move.edge, from }, then: [] };\n                controller.jumpToEdge(move.edge, from);\n                break;\n            case \"wait\": {\n                // A key on a run holding the focus waits for the run's rows in view, after any pressed before it, and goes\n                // on from the first of them.\n                const run = body.items.find((it) => it.kind === \"band\" && bodyItemKey(it) === from);\n                if (run?.kind === \"band\") owedFocus.current = { band: owedFocus.current?.band ?? run.band, waits: [...(owedFocus.current?.waits ?? []), move.key] };\n                break;\n            }\n            case \"event\":\n                controller.dispatch(move.event);\n                // Focus stays on (or lands on) its item: the event may have\n                // re-rendered it as another element — a rail becoming a row.\n                controller.focusItem(move.focus);\n                break;\n            case \"none\":\n                break;\n        }\n    };\n    /**\n     * The keys pressed while a move waited, each in turn from the item it landed on (#1398, CL10): over rows read each\n     * moves as it would have, and the first that goes past them fetches — the rest waiting on it as it waits, on the item\n     * the keys had reached. The focus ends where they leave it.\n     */\n    const goOn = (from: string, keys: readonly PlanWaitKey[]): void => {\n        let at = from;\n        for (let i = 0; i < keys.length; i++) {\n            const move = planNavKey(navItems, at, keys[i]!, pageHeight());\n            if (move?.t === \"focus\") {\n                at = move.key;\n                continue;\n            }\n            if (move?.t !== \"fetch\") continue;\n            if (at !== from) controller.focusItem(at, \"auto\");\n            owedFocus.current = null;\n            navIntent.current = { holder: at, intent: move.intent, then: keys.slice(i + 1) };\n            controller.reportViewport(move.demand, false);\n            return;\n        }\n        if (at !== from) controller.focusItem(at, \"auto\");\n    };\n    goOnRef.current = goOn;\n    // What the view shows takes a focus a landing owes it (`owedFocus`), reported at rest — never while a keyboard move\n    // waits, whose intent takes the focus on. A run owed it keeps it while its rows in view are on their way; once they\n    // land — or the view leaves it — the first of them in view takes it, else the first row in view, and the keys pressed\n    // on the run go on from there in turn. A focus the viewer moved on meanwhile is owed nothing.\n    useLayoutEffect(() => {\n        takeOwed.current = (shown) => {\n            const owed = owedFocus.current;\n            const bodyEl = focusBodyRef.current;\n            if (owed === null || bodyEl === null || narrow || navIntent.current !== null) return;\n            const at = document.activeElement;\n            const runKey = owed.band === undefined ? undefined : bodyItemKey({ kind: \"band\", band: owed.band });\n            const holding = at === bodyEl\n                || (runKey !== undefined && at instanceof HTMLElement && bodyEl.contains(at) && at.getAttribute(\"data-plan-item\") === runKey);\n            if (!holding) {\n                owedFocus.current = null;\n                return;\n            }\n            const band = owed.band;\n            if (band !== undefined) {\n                const same = (it: PlanBodyItem) => it.kind === \"band\" && it.band.block === band.block && it.band.at === band.at;\n                const now = body.items.find(same);\n                if (now?.kind === \"band\" && now.band.from === band.from && now.band.to === band.to && shown.some(same)) return;\n            }\n            const rows = shown.filter((it) => it.kind === \"row\");\n            // The run's own rows: rows of its block, from a window its elements covered.\n            const ofRun = band === undefined ? [] : rows.filter((it) => {\n                const o = it.kind === \"row\" ? paging.origin.get(it.row.row.key) : undefined;\n                return o !== undefined && o.block === band.block && o.w * PLAN_PAGE_SIZE <= band.to && (o.w + 1) * PLAN_PAGE_SIZE - 1 >= band.from;\n            });\n            const candidates = ofRun.length > 0 ? ofRun : rows;\n            // Nothing read in view yet: still owed.\n            if (candidates.length === 0) return;\n            const elementOf = (key: string) => Array.from(bodyEl.querySelectorAll<HTMLElement>(\"[data-plan-item]\")).find((e) => e.getAttribute(\"data-plan-item\") === key);\n            // The first of them the view shows whole, below the pinned header — the first in view a scroll left part-hidden\n            // is no row to put the ring on — else the first.\n            const viewTop = Math.max(scrollElRef.current?.getBoundingClientRect().top ?? 0, headerRef.current?.getBoundingClientRect().bottom ?? 0, 0);\n            const target = candidates.find((it) => (elementOf(bodyItemKey(it))?.getBoundingClientRect().top ?? -Infinity) >= viewTop - 1) ?? candidates[0]!;\n            owedFocus.current = null;\n            const key = bodyItemKey(target);\n            const el = elementOf(key);\n            if (el !== undefined) el.focus({ preventScroll: true });\n            else controller.focusItem(key);\n            // The keys pressed on the run go on from its row in turn: the first a page's from there, or a step's the\n            // hand-off itself.\n            const [first, ...after] = owed.waits;\n            goOn(key, first === \"PageDown\" || first === \"PageUp\" ? owed.waits : after);\n        };\n    });\n    // A focused item a render takes off the canvas — a run its rows replace, a row a run evicts — would drop the focus to\n    // the page's body: once the render is done, the canvas's surface keeps it (no ring: it is the keyboard's surface, not\n    // a stop), and a row a landing took off owes it to the first row the view shows. A focus the viewer moved elsewhere\n    // — another element, or nowhere, its element still on the page — is theirs. Whether the focus is in the canvas is\n    // what the canvas last heard (`focusIn`): a page that says a removed element lost it says so as it goes, before the\n    // render is done; one that says nothing leaves the render to find the focus gone.\n    const focusIn = useRef(false);\n    const keepFocus = useRef<(dropped: string | undefined) => void>(() => undefined);\n    useLayoutEffect(() => {\n        const keep = (dropped: string | undefined) => {\n            const bodyEl = focusBodyRef.current;\n            const at = document.activeElement;\n            if (bodyEl === null || !bodyEl.isConnected || (at !== null && at !== document.body)) return;\n            bodyEl.focus({ preventScroll: true });\n            if (owedFocus.current !== null || navIntent.current !== null) return;\n            if (dropped !== undefined && !navItems.some((it) => it.key === dropped)) owedFocus.current = { band: undefined, waits: [] };\n        };\n        keepFocus.current = keep;\n        const at = document.activeElement;\n        if (focusIn.current && (at === null || at === document.body)) keep(controller.getSnapshot().nav.active ?? undefined);\n    });\n    const hasBody = scale !== undefined;\n    useEffect(() => {\n        const bodyEl = focusBodyRef.current;\n        if (bodyEl === null) return undefined;\n        const lost = () => document.activeElement === null || document.activeElement === document.body;\n        const onOut = (event: globalThis.FocusEvent): void => {\n            const from = event.target;\n            const next = event.relatedTarget;\n            if (next instanceof Node && bodyEl.contains(next)) return;\n            if (next !== null) {\n                focusIn.current = false;\n                return;\n            }\n            const dropped = from instanceof HTMLElement && from !== bodyEl ? gridItemOf(from, bodyEl)?.getAttribute(\"data-plan-item\") ?? undefined : undefined;\n            queueMicrotask(() => {\n                if (from instanceof HTMLElement && from !== bodyEl && !from.isConnected) keepFocus.current(dropped);\n                else if (lost()) focusIn.current = false;\n            });\n        };\n        bodyEl.addEventListener(\"focusout\", onOut);\n        return () => bodyEl.removeEventListener(\"focusout\", onOut);\n    }, [hasBody]);\n\n    // ── Moves (#825) ──────────────────────────────────────────────────────\n    // What the rows and elements move with: the store, the drag surface — none\n    // in the narrow layout, a review tool — and the words a keyboard reader is\n    // told how to move one with.\n    const helpId = `${uid}-move-help`;\n    const moveSurface = !narrow ? rowDrop?.surface : undefined;\n    // Whether a card from the library panel's own tabs has a row to land on\n    // (#1259): the canvas takes cards, and a row on it makes an item of one,\n    // as `BodyRow` registers its cell. The panel's cards drag only then — never\n    // in the narrow layout, which draws no row to drop on.\n    const takesCards = useMemo(\n        () => !narrow && rowDrop?.cards === true && index.rows.some((row) => row.edits.drop\n            && DROPPABLE_KINDS.has(row.kind.type) && !derived.diagnostics.has(row.key)),\n        [narrow, rowDrop, index, derived]);\n    // Whether the event kinds' cards have a row to land on (#1196): an event\n    // kind's row the canvas draws, outside the narrow layout. The Events and\n    // Backlog tabs' cards drag only then.\n    const takesEvents = useMemo(\n        () => !narrow && rowDrop?.events !== undefined && index.rows.some((row) => DROPPABLE_KINDS.has(row.kind.type)\n            && !derived.diagnostics.has(row.key) && rowDrop.events!.target(row) !== undefined),\n        [narrow, rowDrop, index, derived]);\n    // The event kinds with an event drawn on the canvas (#1196): an author's\n    // card whose patch lands on one of them drags while one is there.\n    const patchKinds = useMemo(\n        () => (narrow || rowDrop?.events === undefined ? NO_KINDS_DRAWN : drawnKinds(index.rows, rowDrop.events)),\n        [narrow, rowDrop, index]);\n    // Typing a number into a table cell (#1436, #1438): the canvas's one input, while `data`'s rows take a gesture — in\n    // a popover anchored to its cell below 480px of main — each typed number one step of the session's history.\n    const { typeValue: draftValue } = editing;\n    const typing = useMemo<PlanTyping | undefined>(() => (rowDrop?.data === true\n        ? {\n            store: typingStore,\n            popover: narrow,\n            zooms,\n            type: (typed) => draftValue(typed, typed.value === undefined\n                ? words.m.clearedStep({ row: labelOf(typed.rowKey), bucket: typed.bucket })\n                : words.m.typedStep({ row: labelOf(typed.rowKey), bucket: typed.bucket, value: typed.text })),\n        }\n        : undefined), [rowDrop, typingStore, narrow, zooms, draftValue, words, labelOf]);\n    // The input closes once the rows take no typing: a Save under way, a run of the optimiser out.\n    useEffect(() => { if (typing === undefined) typingStore.close(); }, [typing, typingStore]);\n    const editCtx = useMemo<PlanEditContextValue | null>(() => (scale !== undefined\n        ? {\n            store: editStore, surface: moveSurface, helpId, styles, words, scale,\n            dataMoves: rowDrop?.data === true, eventMove: rowDrop?.events?.rowMove, typing,\n        }\n        : null), [editStore, moveSurface, helpId, styles, words, scale, rowDrop, typing]);\n    /** Focus an element where it is now — else its row. */\n    const focusElement = useCallback((rowKey: string, key: string) => {\n        const bodyEl = focusBodyRef.current;\n        if (bodyEl === null) return;\n        const rowEl = Array.from(bodyEl.querySelectorAll<HTMLElement>(\"[data-plan-row]\"))\n            .find((el) => el.getAttribute(\"data-plan-row\") === rowKey);\n        const el = rowEl === undefined ? undefined : Array.from(rowEl.querySelectorAll<HTMLElement>(PLAN_ELEMENT_SELECTOR))\n            .find((e) => e.hasAttribute(\"tabindex\")\n                && [\"data-run\", \"data-chip\", \"data-event\", \"data-mark\"].some((a) => e.getAttribute(a) === key));\n        if (el !== undefined) el.focus({ preventScroll: true });\n        else controller.focusItem(rowItemKey(rowKey), \"auto\");\n    }, [controller]);\n    // The keyboard's move: Space on an element picks it up (`edit/use-carry.ts`).\n    // An event kind's element is carried onto the rows of the resource kinds\n    // its kind is placed on, and judged by the event kinds (#1196).\n    const carry = usePlanCarry({\n        store: editStore, scale, words, surface: moveSurface, veto: rowDrop?.canDrop, rows: visible,\n        takes: (row, movable) => DROPPABLE_KINDS.has(row.kind.type) && !derived.diagnostics.has(row.key) && (eventDrag?.isEvent(movable) === true\n            ? eventDrag.drawsKind(row, movable)\n            : row.edits.move.type === \"some\" && row.edits.move.value.items === movable.items),\n        judge: (movable, to) => {\n            if (eventDrag === undefined || !eventDrag.isEvent(movable)) return undefined;\n            const row = index.byKey.get(to.rowKey);\n            const verdict = row !== undefined ? eventDrag.element(row, movable, to) : undefined;\n            return { allowed: verdict?.allowed === true, reason: verdict?.allowed === false ? verdict.caption : undefined };\n        },\n        // An event kind's row by the resource it stands for: a way of drawing after its first is labelled with its kinds.\n        labelOf: (key) => {\n            const row = index.byKey.get(key);\n            return (row !== undefined ? eventDrag?.where(row) : undefined) ?? labelOf(key);\n        },\n        move: (request) => (eventDrag !== undefined && request.element !== undefined && eventDrag.isEvent(request.element)\n            ? eventDrag.moveElement(request)\n            : draftMove(request)),\n        reveal: (key) => controller.focusItem(rowItemKey(key), \"auto\"),\n        focus: focusElement,\n    });\n    // A keyboard drop is drawn with its draft — focus the element there.\n    useLayoutEffect(() => {\n        const at = editStore.takeFocus();\n        if (at !== null) focusElement(at.rowKey, at.key);\n    });\n\n    // ── What the frame's parts read ──────────────────────────────────────\n    // The events a kind's drafts changed (#1196), by their elements' keys: each\n    // element of one wears the drafted look. The same set while the drafts hold.\n    const eventDrafts = eventEditing.drafts;\n    const drafted = useMemo(() => {\n        const out = new Set<string>();\n        for (const [kind, byId] of eventDrafts) for (const id of byId.keys()) out.add(printEventRef({ kind, key: id }));\n        return out;\n    }, [eventDrafts]);\n    // The events holding a conflict not yet chosen, by their elements' keys: each element of one wears the warn ring.\n    // Read again as the history moves (its version), which every choice and every carry-over moves.\n    const eventSessions = eventEditing.sessions;\n    const conflicted = useMemo(() => {\n        const out = new Set<string>();\n        for (const held of eventSessions) for (const id of held.session.conflicts.keys()) out.add(printEventRef({ kind: held.kind, key: id }));\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version says they moved\n    }, [eventSessions, historyVersion]);\n    // The table cells holding a conflict of `data`'s not yet chosen (#1438): each conflict at an instant of the row its path\n    // leads to — a crew's week — by the row's key; the cell holding the instant wears the warn ring.\n    const dataSession = editing.session;\n    const conflictCells = useMemo(() => {\n        const out = new Map<string, Date[]>();\n        for (const [id, entry] of dataSession.conflicts) {\n            for (const point of entry.points) {\n                const place = conflictPlaceOf(index.rows, id, point.at);\n                const row = place?.rows[place.rows.length - 1];\n                if (row === undefined || place?.at === undefined) continue;\n                const held = out.get(row.key);\n                if (held === undefined) out.set(row.key, [place.at]);\n                else held.push(place.at);\n            }\n        }\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the session is mutable: the history's version says it moved\n    }, [dataSession, index, historyVersion]);\n    // The canvas's contexts and its declared density wrap everything the\n    // frame draws — main, and the toolbar's items, the banners and the\n    // footer — so each speaks as the canvas does.\n    const densityTag = style !== undefined ? getSomeorUndefined(style.density)?.type : undefined;\n    // The reader takes the root's own links, their event ends as the author named them: the canvas's are named where\n    // the events draw, which is what the reader's cells decide (#1039).\n    const eventsReader = events !== undefined\n        ? (\n            <PlanEventsReader events={events} scale={scale} hidden={hidden} drafts={eventEditing.drafts} shown={shownResources}\n                kinds={kinds} resources={resources} parts={eventParts} links={editing.data.links} spans={cellSpans} editing={eventEditing}\n                onLead={setLead} />\n        )\n        : null;\n    // The rows' nested series (#1438), read by a component of its own around the rows laid out — or, while the Plan is\n    // narrow, the rows its cards draw, which follow none of the desktop's folds, all of them in view.\n    const nestedSeam = data.nested.type === \"some\" ? data.nested.value : undefined;\n    const laidOut = useMemo(() => visible.map((v) => v.row), [visible]);\n    useEffect(() => {\n        if (narrow && narrowShown.length > 0) nestedViews.set({ first: narrowShown[0]!.key, last: narrowShown[narrowShown.length - 1]!.key });\n    }, [narrow, narrowShown, nestedViews]);\n    const nestedReader = nestedSeam !== undefined\n        ? <PlanNestedReader seam={nestedSeam} visible={narrow ? narrowShown : laidOut} index={index} scale={scale} views={nestedViews}\n            session={editing.enabled ? editing.session as never : undefined} onLead={setNestedLead} onWaiting={setNestedWaiting}\n            onSpan={setNestedSpan} />\n        : null;\n    // Whether a run's request can carry the window whole (R24): read by a component of its own, beside the event kinds'\n    // rows, while an optimiser is bound — over the range the canvas reads them, where each event's row is held.\n    const optimiseReader = optimise !== undefined && planWindow !== undefined && eventRange !== undefined\n        ? <PlanOptimiseReader kinds={kinds} editing={eventEditing} window={planWindow} range={eventRange} cells={cellsRead} onReady={setOptimiseReady} />\n        : null;\n    const boundsReader = kinds.length > 0 && eventRange !== undefined\n        ? <PlanBoundsReader kinds={kinds} editing={eventEditing} range={eventRange} cells={cellsRead} hidden={hidden ?? NONE_HIDDEN} onBreaches={setBreaches} />\n        : null;\n    const provide = (children: ReactNode): ReactNode => {\n        const provided = (\n            <PlanWordsContext.Provider value={words}>\n            <PlanControllerContext.Provider value={controller}>\n            <PlanGeometryContext.Provider value={geometry}>\n            <PlanScaleContext.Provider value={scale ?? null}>\n            <PlanDispatchContext.Provider value={controller.dispatch}>\n            <PlanCursorContext.Provider value={cursor}>\n            <PlanResolversContext.Provider value={resolvers}>\n            <PlanSelectableContext.Provider value={selectable}>\n            <PlanDraftedContext.Provider value={drafted}><PlanConflictedContext.Provider value={conflicted}><PlanBoundedContext.Provider value={breaches.bounded}><PlanConflictCellsContext.Provider value={conflictCells}>\n            <PlanOptimisedContext.Provider value={optimisedMarks}>\n            <PlanGridContext.Provider value={gridCtx}>\n            <PlanEditContext.Provider value={editCtx}>\n            <FieldAskProvider value={fieldAsks}>\n                {children}\n            </FieldAskProvider>\n            </PlanEditContext.Provider>\n            </PlanGridContext.Provider>\n            </PlanOptimisedContext.Provider>\n            </PlanConflictCellsContext.Provider></PlanBoundedContext.Provider></PlanConflictedContext.Provider></PlanDraftedContext.Provider>\n            </PlanSelectableContext.Provider>\n            </PlanResolversContext.Provider>\n            </PlanCursorContext.Provider>\n            </PlanDispatchContext.Provider>\n            </PlanScaleContext.Provider>\n            </PlanGeometryContext.Provider>\n            </PlanControllerContext.Provider>\n            </PlanWordsContext.Provider>\n        );\n        return (\n            <>\n                {eventsReader}\n                {nestedReader}\n                {optimiseReader}\n                {boundsReader}\n                {densityTag !== undefined ? <DensityProvider value={densityTag}>{provided}</DensityProvider> : provided}\n            </>\n        );\n    };\n    // What the loading line and a failed run name the rows by: what the rail counts them in (#1398) — a paged resource\n    // kind's source's where the canvas pages one (its rows are that source's), else the `rows` source's.\n    const rowsSource = slices?.slice.parts.find((part) => stringEqual(part.source, pagedSlot ?? ROWS_SOURCE));\n    const rowsNoun = rowsSource !== undefined ? recordSliceNoun(rowsSource, nouns, words.locale) : words.m.saveNoticeNoun({ kind: undefined, n: 2 });\n    const bound = declaredBound ? { height, maxHeight } : undefined;\n\n    // A source that cannot be READ no longer replaces the canvas (#811): its\n    // windows fail one by one, each as its own band with the reason and a\n    // Retry. A missing WINDOW is the one thing no row can be placed without —\n    // and it is never the rows' to supply (#822), inline or paged. Without\n    // one, main says so, alone in the frame.\n    if (scale === undefined) {\n        return {\n            provide,\n            vars: geometryStyle,\n            bound,\n            main: (\n                <Box css={styles.diagnostic} data-plan-empty>\n                    {axisKind === \"ordinal\" ? words.m.noWindowOrdinal() : words.m.noWindow()}\n                </Box>\n            ),\n            chrome: undefined,\n        };\n    }\n\n    const header = (\n        <PlanHeader styles={styles} gridTemplate={gridTemplate} headerRef={headerRef}\n            windowParts={windowParts} stated={stated} span={nestedSeam !== undefined ? nestedSpan : undefined} affordances={affordances} now={now}\n            // The ruler's gutter caption is the active grain's name (the §1 mock).\n            rulerCaption={words.m.grainName({ grain })} cursorChipRef={cursorChipRef}\n            pinned={pinned.map((v) => (\n                <Box key={v.row.key} css={styles.header}>{renderPlanRow(v, rowCtx)}</Box>\n            ))}\n            pinnedId={pinned.length > 0 ? pinnedId : undefined}\n            focus={view.focus}\n            // The focused row by name — its label, or its key's words while a\n            // paged row is not resident (#822: a key is an id's text).\n            focusLabel={view.focus !== null\n                ? index.byKey.get(view.focus.key)?.gutter.label ?? rowKeyWords(view.focus.key)\n                : undefined}\n            linkCounts={linkFamily !== undefined\n                ? { upstream: linkFamily.upstream.size, downstream: linkFamily.downstream.size }\n                : undefined} />\n    );\n\n    // An element's activation from the keyboard does what its click does:\n    // the popover, the selection, the author's element callback.\n    const activateElement = (el: HTMLElement, additive: boolean) => {\n        const ref = refOfElement(el);\n        if (ref === undefined) return;\n        overlayHandlers.openAt(el);\n        // A link belongs to no one row — it selects none. An event's element\n        // selects its event, Shift adding it (#1197); any other, its row.\n        if (ref.type !== \"link\") {\n            const key = elementKeyOf(ref);\n            const row = rowKeyOf(ref.value.row);\n            controller.dispatch(key !== undefined && selectable(key)\n                ? { t: \"element.select\", key, row, additive }\n                : { t: \"row.select\", key: row });\n        }\n        controller.elementClick(ref);\n    };\n    /**\n     * A key that moves through the rows, pressed on the item a step or a page waits on (#1398, CL10) — `true` when it\n     * took it: it waits with the move, after the keys pressed before it, and goes on once the move has landed. None is\n     * lost.\n     */\n    const waitsWith = (e: KeyboardEvent<HTMLDivElement>, itemKey: string): boolean => {\n        const waiting = navIntent.current;\n        if (waiting === null || waiting.holder !== itemKey || (waiting.intent.t !== \"step\" && waiting.intent.t !== \"page\")) return false;\n        if (e.key !== \"ArrowDown\" && e.key !== \"ArrowUp\" && e.key !== \"PageDown\" && e.key !== \"PageUp\") return false;\n        e.preventDefault();\n        navIntent.current = { ...waiting, then: [...waiting.then, e.key] };\n        return true;\n    };\n    /** A key in the grid — `true` when it was the grid's. */\n    const gridKeys = (e: KeyboardEvent<HTMLDivElement>, bodyEl: HTMLElement): boolean => {\n        const item = gridItemOf(e.target, bodyEl);\n        if (item === null || e.altKey || e.ctrlKey || e.metaKey) return false;\n        const itemKey = item.getAttribute(\"data-plan-item\") ?? \"\";\n        if (waitsWith(e, itemKey)) return true;\n        if (e.target === item) {\n            // The row itself: Tab walks into its widgets; the rest is the map.\n            if (e.key === \"Tab\") {\n                if (e.shiftKey) return false;\n                const ring = rowWidgets(item, bodyEl);\n                if (ring.length === 0) return false;\n                e.preventDefault();\n                ring[0]!.focus();\n                return true;\n            }\n            const move = planNavKey(navItems, itemKey, e.key, pageHeight());\n            if (move === undefined) return false;\n            e.preventDefault();\n            runMove(move, itemKey);\n            return true;\n        }\n        // A widget of the row: an element or a control.\n        const widget = e.target as HTMLElement;\n        const isElement = widget.matches(PLAN_ELEMENT_SELECTOR);\n        switch (e.key) {\n            case \"Escape\":\n                // Back to the row — one rung; the next Escape is the ladder's.\n                e.preventDefault();\n                item.focus({ preventScroll: true });\n                return true;\n            case \"Tab\": {\n                const ring = rowWidgets(item, bodyEl);\n                const i = ring.indexOf(widget);\n                if (e.shiftKey) {\n                    e.preventDefault();\n                    (i > 0 ? ring[i - 1]! : item).focus();\n                    return true;\n                }\n                // Past the last widget, Tab leaves the canvas as it would.\n                if (i < 0 || i >= ring.length - 1) return false;\n                e.preventDefault();\n                ring[i + 1]!.focus();\n                return true;\n            }\n            case \"ArrowLeft\": case \"ArrowRight\": case \"Home\": case \"End\": {\n                // The row's walk: its elements, and a cell's `+n` chip among them (#1267).\n                if (!widget.matches(PLAN_WALK_SELECTOR)) return false;\n                const els = plotElements(item, bodyEl);\n                const i = els.indexOf(widget);\n                if (i < 0) return false;\n                const j = e.key === \"Home\" ? 0 : e.key === \"End\" ? els.length - 1\n                    : Math.max(0, Math.min(els.length - 1, i + (e.key === \"ArrowRight\" ? 1 : -1)));\n                e.preventDefault();\n                els[j]!.focus();\n                return true;\n            }\n            case \"ArrowUp\": case \"ArrowDown\": {\n                // Up and down leave the row's widgets for the next row.\n                const move = planNavKey(navItems, itemKey, e.key, pageHeight());\n                if (move === undefined) return false;\n                e.preventDefault();\n                runMove(move, itemKey);\n                return true;\n            }\n            case \"Enter\": case \" \":\n                // A button's own key activates it; an element is the canvas's to.\n                if (!isElement) return false;\n                e.preventDefault();\n                // Space picks up an element that moves (#825) — never while the rows are retained (#1398, CL8), nor\n                // while a run of the optimiser is out (R2); Enter keeps doing what its click does — Shift adding an\n                // event to the selection.\n                if (e.key === \" \" && !retained && !locked && carry.start(widget)) return true;\n                activateElement(widget, e.shiftKey);\n                return true;\n            default:\n                return false;\n        }\n    };\n\n    /**\n     * A key on the canvas's surface while it holds a focus a landing owes (`owedFocus`, #1398, CL10) — a run the focus\n     * was on taken off before its rows came, or a row a landing took off — `true` when it took it: one that moves through\n     * the rows (↑ ↓ PgUp PgDn) waits as one pressed on the run does, for the row the focus is owed to, and goes on from it.\n     */\n    const surfaceKey = (e: KeyboardEvent<HTMLDivElement>, bodyEl: HTMLElement): boolean => {\n        const owed = owedFocus.current;\n        if (e.target !== bodyEl || owed === null || narrow || e.altKey || e.ctrlKey || e.metaKey) return false;\n        const wait: PlanWaitKey | undefined = e.key === \"ArrowDown\" || e.key === \"ArrowUp\" || e.key === \"PageDown\" || e.key === \"PageUp\"\n            ? e.key : undefined;\n        if (wait === undefined) return false;\n        e.preventDefault();\n        owedFocus.current = { band: owed.band, waits: [...owed.waits, wait] };\n        return true;\n    };\n\n    /** A key the canvas acts on, in the order its rungs take one — `true` when it took it. */\n    const canvasKey = (e: KeyboardEvent<HTMLDivElement>, bodyEl: HTMLElement, t: HTMLElement): boolean => {\n        // An element carried by the keyboard takes the keys while it lasts (#825).\n        if (editStore.carry !== null && carry.keys(e)) return true;\n        // The history keys every collection shares (#988): the Plan's one history's (#1194) — none while a run of the\n        // optimiser is out (R2), and a run's highlight ends or replays with the action (`onHistory`).\n        const historyKey = edits ? historyShortcut(e) : undefined;\n        if (historyKey !== undefined) {\n            e.preventDefault();\n            onHistory(historyKey);\n            return true;\n        }\n        // An open popover is the ladder's top rung.\n        if (e.key === \"Escape\" && overlayHandlers.onKeyDown(e)) return true;\n        if (surfaceKey(e, bodyEl)) return true;\n        if (gridKeys(e, bodyEl)) return true;\n        // Enter on an element outside the grid — a narrow card's.\n        if (overlayHandlers.onKeyDown(e)) return true;\n        const ev = KEYS[e.key];\n        if (ev === undefined) return false;\n        e.preventDefault();\n        controller.dispatch(ev);\n        // A key pressed on a row keeps focus on it: the ladder may re-render\n        // it as another element (a rail returning to a row).\n        const item = gridItemOf(t, bodyEl);\n        if (item !== null && item === t) controller.focusItem(item.getAttribute(\"data-plan-item\") ?? \"\");\n        return true;\n    };\n    const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n        const bodyEl = focusBodyRef.current;\n        const t = e.target as HTMLElement;\n        // Keys typed in portalled content — an open popover's body, a toolbar\n        // menu — bubble here through the React tree; they are not the canvas's.\n        if (bodyEl === null || !(t instanceof Node) || !bodyEl.contains(t)) return;\n        if (t.tagName === \"INPUT\" || t.tagName === \"TEXTAREA\" || t.isContentEditable) return;\n        // Nor is a key something nearer already handled — an open overlay's\n        // Escape (its layer listens on the document, ahead of the canvas), a\n        // widget in an expand render, a nested canvas's own ladder.\n        if (e.defaultPrevented) return;\n        // A key the canvas acts on goes no further than the Plan (#1398): the page's own `[`, `]` or Esc never hears\n        // what pans, steps or climbs the ladder here.\n        if (canvasKey(e, bodyEl, t)) takeKey(e);\n    };\n\n    // Focus landing on the grid itself (it is the tab stop while no mounted\n    // row holds it) goes on to a row: the one that held it, else the\n    // selection, else the first — scrolled into view first if it must be.\n    const onGridFocus = (e: FocusEvent<HTMLDivElement>) => {\n        if (e.target !== e.currentTarget) return;\n        const snap = controller.getSnapshot();\n        const keys = new Set(navItems.map((it) => it.key));\n        const selected = snap.store.ui.selected !== null ? rowItemKey(snap.store.ui.selected) : undefined;\n        const target = snap.nav.active !== null && keys.has(snap.nav.active) ? snap.nav.active\n            : selected !== undefined && keys.has(selected) ? selected\n                : navItems[0]?.key;\n        if (target !== undefined) controller.focusItem(target, \"auto\");\n    };\n\n    // Where the focus is in the canvas now (#1398): a run taking it — a click into it — is owed its rows as they land; any\n    // other item it lands in owes nothing. The canvas's own surface, holding it while something is owed, changes nothing.\n    const onBodyFocus = (e: FocusEvent<HTMLDivElement>) => {\n        focusIn.current = true;\n        const bodyEl = focusBodyRef.current;\n        if (bodyEl === null || e.target === bodyEl) return;\n        const key = gridItemOf(e.target, bodyEl)?.getAttribute(\"data-plan-item\");\n        const run = key === null || key === undefined ? undefined : body.items.find((it) => it.kind === \"band\" && bodyItemKey(it) === key);\n        owedFocus.current = run?.kind === \"band\" ? { band: run.band, waits: [] } : null;\n    };\n\n    // A carry whose reader left the canvas ends where it began (#825).\n    const onBodyBlur = (e: FocusEvent<HTMLDivElement>) => {\n        if (editStore.carry === null) return;\n        const next = e.relatedTarget;\n        if (next instanceof Node && e.currentTarget.contains(next)) return;\n        carry.cancel();\n    };\n\n    const main = (\n        <Box\n            ref={focusBodyRef}\n            // The keyboard surface and the focus anchor, but not a tab\n            // stop: the grid's one stop is its active row (#819).\n            tabIndex={-1}\n            css={styles.body}\n            data-plan-body\n            onFocus={onBodyFocus}\n            onBlur={onBodyBlur}\n            // The bound lives HERE, not on the frame — the attribute is\n            // the contract (jsdom resolves no Chakra classes).\n            data-plan-bounded={frameFills ? \"\" : undefined}\n            // The narrow layout is in charge (its recipe rules key on it).\n            data-plan-narrow={narrow ? \"\" : undefined}\n            // The source is not exhausted: the counts across this body\n            // cover the loaded windows (`PlanTransport.partial`).\n            data-plan-partial={partial === true ? \"\" : undefined}\n            // A narrowing resolving (#1344) — a resource kind's, or the\n            // paged rows' own — or Home or End's window read: the rows it\n            // showed stay, retained (#1398, CL8, CL10) — readable,\n            // focusable and selectable, aria-disabled, taking no drag, no\n            // drop and no carry until it lands — busy, as the frame's main\n            // says.\n            aria-disabled={retained ? true : undefined}\n            // Bounded, the canvas fills the frame's main and scrolls its\n            // own rows. Grown with its rows, it keeps its own height —\n            // never shrunk to main's — so a host that bounds the frame is\n            // seen to cut it off (`useHostBound`).\n            onKeyDown={onKeyDown}\n            onClickCapture={overlayHandlers.onClickCapture}\n            onPointerOver={overlayHandlers.onPointerOver}\n            onPointerOut={overlayHandlers.onPointerOut}\n        >\n            {narrow ? (\n                <PlanNarrow\n                    styles={styles} index={index} derived={derived} view={view}\n                    dense={dense} storageKey={storageKey}\n                    expandBody={expandBody} expandGutterBody={expandGutterBody}\n                    canExpand={canExpand} partial={partial} fill={frameFills}\n                    // The Rows tab counts what a paged source does once it has counted itself — the rail's count — and\n                    // waits while a new narrowing's rows are read, the last one's standing in (#1398, CL13).\n                    pagedCount={paged && !paging.replacing ? paging.total : undefined}\n                    // The Measures tab counts the chart rows the source makes — exact where each entry makes as many, not\n                    // counted where that varies — never what has loaded (#1398).\n                    pagedMeasures={pagedMeasures}\n                    failures={paging.failures} onRetry={controller.retry}\n                    paging={narrowPaging} marks={marks} noun={rowsNoun}\n                    // Its cards wash as the rows do while their cells are read, and say which rows they draw, for the\n                    // rows' nested series to be read for them (#1438).\n                    unread={unreadOrInFlight} onShown={onNarrowShown}\n                />\n            ) : (\n                <VirtualRows\n                    height={frameFills ? undefined : height}\n                    maxHeight={frameFills ? undefined : maxHeight}\n                    fillParent={frameFills}\n                    // Every body item pins the exact height it gives the\n                    // frame in `sizes` — `RowShell` sets `height: {h}px`\n                    // from the same `rowHeight()`, the rail / gap bands\n                    // read the same geometry table's variables in the\n                    // recipe (#817), and the R2 render pins its clamped\n                    // `px`. Measuring fixed-height rows drifts under\n                    // fractional zoom and paints hairline seams (#533).\n                    measureRows={false}\n                    scrollToIndex={target.toIndex}\n                    scrollNonce={target.nonce}\n                    scrollAlign={target.align}\n                    // The rows' container IS the treegrid (#819): every\n                    // body item is a row of it, the pinned rows join by\n                    // `aria-owns`, and its count is the total (#1398,\n                    // CL12) — a run not read is one row of it that counts\n                    // as the rows it stands for.\n                    rowsRef={gridRef}\n                    rowsProps={{\n                        role: \"treegrid\",\n                        \"aria-label\": words.m.gridLabel(),\n                        \"aria-rowcount\": places.count,\n                        ...(pinned.length > 0 ? { \"aria-owns\": pinnedId } : {}),\n                        // The tab stop while no mounted row holds it.\n                        tabIndex: 0,\n                        onFocus: onGridFocus,\n                    }}\n                    onRangeChange={paged ? onRangeChange : undefined}\n                    // Unbounded, a large canvas mounts only what its\n                    // scrolling ancestor shows (#812) — the same threshold\n                    // whatever the source. A smaller paged canvas mounts\n                    // every row and still reports which are on screen.\n                    virtualizeUnboundedAt={VIRTUALIZE_UNBOUNDED_AT}\n                    scrollElRef={scrollElRef}\n                    header={header}\n                    sticky={stickyParent}\n                    // R1 ribbons — the K8 vocabulary over the gathered\n                    // family (ribbons need width — never on the narrow\n                    // layout). They are their own part (#811): a throw\n                    // while laying them out loses the ribbons, not the\n                    // canvas. `null` without a links focus, never\n                    // omitted: the rows' box stays put, so no row\n                    // remounts as the ribbons come and go.\n                    overlay={ribbonRows !== undefined && focusVisibleKeys !== undefined ? (\n                        <PlanPartBoundary part={LINKS_LAYER} resetKey={focusVisibleKeys} styles={styles}>\n                            <LinksOverlay styles={styles} links={data.links} visibleKeys={focusVisibleKeys}\n                                body={ribbonRows} beyond={beyond} scale={scale} element={linkedElementOf}\n                                gutterPx={gutterW}\n                                frame={frameFills ? frameRefs : undefined} />\n                        </PlanPartBoundary>\n                    ) : null}\n                    count={body.items.length}\n                    // Heights move at a constant count — a chart toggle, a\n                    // focus stripping every other row, a band landing as\n                    // rows — and the frame re-measures from these alone.\n                    sizes={body.heights}\n                    getItemKey={body.itemKey}\n                    anchorable={anchorable}\n                    // Where the scroll rests, persisted and restored as a\n                    // row (#813).\n                    onAnchorChange={onAnchorChange}\n                    restoreAnchor={anchor.restore}\n                    renderRow={(i) => {\n                        const item = body.items[i];\n                        switch (item?.kind) {\n                            case undefined: return null;\n                            case \"gap\":\n                                return <PlanGapBand gap={item.gap} h={body.heights[i] ?? 0} styles={styles}\n                                    gridTemplate={gridTemplate} dispatch={controller.dispatch} />;\n                            // A run of rows not drawn yet (#1398, CL2): an unloaded run, or a failed window.\n                            case \"band\":\n                            case \"failed\":\n                                return <PlanRunRow band={item.kind === \"band\" ? item.band : undefined} failure={item.kind === \"failed\" ? item.failure : undefined}\n                                    styles={styles} gridTemplate={gridTemplate} pitch={runPitch} noun={rowsNoun} onRetry={controller.retry} />;\n                            case \"row\":\n                                return renderPlanRow(item.row, rowCtx);\n                        }\n                    }}\n                    headerZIndex={5}\n                    rootCss={styles.root}\n                />\n            )}\n            <PlanOverlays anchors={anchors} styles={styles} storageKey={storageKey} />\n            <PlanAnnouncer />\n            {/* The keyboard's move (#825): what a carry does, said as it\n                happens, and how to begin one — every element that moves\n                is described by it. */}\n            <PlanCarryAnnouncer store={editStore} />\n            {moveSurface !== undefined && <VisuallyHidden id={helpId}>{words.m.moveHelp()}</VisuallyHidden>}\n        </Box>\n    );\n\n    return {\n        provide,\n        // The geometry as CSS variables — every height the recipe draws that\n        // the model also computes reads one of these, from the frame's\n        // wrapper down.\n        vars: geometryStyle,\n        bound,\n        main,\n        chrome: {\n            words, styles, storageKey, scale, slices, windowParts, lead: windowLead, moveWindow, rowsPart, eventParts, nouns, rowsNoun, windowError,\n            affordances, resolutions,\n            // The grain folds the canvas's root groups (#632); below 480px the\n            // narrow layout's Groups · Rows tabs own them, so nothing is left\n            // for the segment to do there.\n            grain: hasRootGroup && !narrow ? grain : undefined,\n            transport, search, diagnostics,\n            cold, busy: frameBusy, pitch: geometry.row,\n            history: historyProps, sessions, where,\n            events: kinds.length > 0 ? eventEditing : undefined,\n            // No command writes while a run is out (R2), nor while what the canvas shows stands in, retained (CL8).\n            writable: !locked && !retained,\n            optimise: kinds.length > 0 ? {\n                toolbarItem: optimiseParts.toolbarItem, banner: optimiseParts.banner, line: optimiseParts.line, legend: optimiseParts.legend,\n                flash: landing.lit && optimised !== undefined, backlogFlash: landing.lit && optimised?.backlogChanged === true,\n                landing: { ref: landingRoot, attributes: landing.attributes, css: landingStyles.main },\n            } : undefined,\n            cells: lead.cells,\n            footer: data.footer,\n            id: getSomeorUndefined(data.id),\n            narrow,\n            inspect,\n            selectEvents,\n            takesCards,\n            takesEvents,\n            patchKinds,\n        },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The canvas's local failures, stated in the chrome (#811).\n *\n * Nothing a row or a source gets wrong replaces the canvas any more — each\n * failure stays where it happened. What the chrome adds is the COUNT and the\n * way there: rows that could not be placed (the chip seeks to the first), a\n * source that could not report its size, a key search that failed, and an\n * axis the grid had to truncate. The desktop toolbar and the narrow layout's\n * chip row mount the same chips.\n */\n\nimport { Box, chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCircleXmark, faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\nimport { usePlanWords } from \"../words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** What the diagnostics chips report. */\nexport interface PlanDiagnostics {\n    /** Rows that render as diagnostic rows (their instants ride another arm). */\n    skipped: number;\n    /** Seek to the first of them — `undefined` when none is reachable. */\n    onSeekSkipped?: (() => void) | undefined;\n    /** Why the source could not report its size, when its `total()` threw. */\n    sourceError?: string | undefined;\n    /** Why the last key search failed, when it did. */\n    searchError?: string | undefined;\n    /** How many buckets the grid shows, when the axis had to truncate. */\n    truncatedAt?: number | undefined;\n}\n\n/**\n * Whether there is anything to report.\n *\n * @param d - The diagnostics, when the canvas has computed them\n * @returns `true` when at least one chip would mount\n */\nexport function hasDiagnostics(d: PlanDiagnostics | undefined): d is PlanDiagnostics {\n    return d !== undefined && (d.skipped > 0 || d.sourceError !== undefined\n        || d.searchError !== undefined || d.truncatedAt !== undefined);\n}\n\n/**\n * The diagnostics chips — the shared `chip` recipe, status on the glyph.\n *\n * @param props - The diagnostics and the resolved `plan` recipe styles\n * @returns The chip cluster\n */\nexport function PlanDiagnosticChips({ diagnostics, styles }: { diagnostics: PlanDiagnostics; styles: Styles }) {\n    const chip = useRecipe({ key: \"chip\" });\n    const words = usePlanWords();\n    const base = chip({ size: \"sm\" });\n    const { skipped, onSeekSkipped, sourceError, searchError, truncatedAt } = diagnostics;\n    const glyph = (tone: \"warning\" | \"danger\") => (\n        <Box as=\"span\" css={styles.chipIcon} data-tone={tone}>\n            <FontAwesomeIcon icon={tone === \"danger\" ? faCircleXmark : faTriangleExclamation} />\n        </Box>\n    );\n    const skippedCount = { n: skipped, count: words.number(skipped) };\n    const skippedText = words.m.rowsSkipped(skippedCount);\n    return (\n        <Box css={styles.diagnostics} data-slot=\"planDiagnostics\">\n            {/* The rows chip is a button only when it can take you there. */}\n            {skipped > 0 && onSeekSkipped !== undefined && (\n                <chakra.button type=\"button\" css={[base, styles.diagnosticChip]}\n                    data-plan-diagnostics=\"rows\" data-count={skipped}\n                    aria-label={words.m.rowsSkippedSeek(skippedCount)}\n                    onClick={onSeekSkipped}>\n                    {glyph(\"warning\")}\n                    <Box as=\"span\">{skippedText}</Box>\n                </chakra.button>\n            )}\n            {skipped > 0 && onSeekSkipped === undefined && (\n                <Box as=\"span\" css={[base, styles.diagnosticChip]} data-plan-diagnostics=\"rows\" data-count={skipped} role=\"status\">\n                    {glyph(\"warning\")}\n                    <Box as=\"span\">{skippedText}</Box>\n                </Box>\n            )}\n            {sourceError !== undefined && (\n                <Box as=\"span\" css={[base, styles.diagnosticChip]} data-plan-diagnostics=\"source\" role=\"status\">\n                    {glyph(\"danger\")}\n                    <Box as=\"span\">{words.m.sourceUnavailable({ reason: sourceError })}</Box>\n                </Box>\n            )}\n            {searchError !== undefined && (\n                <Box as=\"span\" css={[base, styles.diagnosticChip]} data-plan-diagnostics=\"search\" role=\"status\">\n                    {glyph(\"danger\")}\n                    <Box as=\"span\">{words.m.searchFailed({ reason: searchError })}</Box>\n                </Box>\n            )}\n            {truncatedAt !== undefined && (\n                <Box as=\"span\" css={[base, styles.diagnosticChip]} data-plan-diagnostics=\"truncated\" role=\"status\">\n                    {glyph(\"warning\")}\n                    <Box as=\"span\">{words.m.truncated({ n: truncatedAt, count: words.number(truncatedAt) })}</Box>\n                </Box>\n            )}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\nimport type { ReactNode } from \"react\";\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { useFormatters, useSlicesReactivity } from \"@elaraai/east-ui-components\";\nimport { RecordSliceFieldEditor } from \"@elaraai/east-ui-components/internal\";\nimport { TimeNavigator } from \"../../shared/time/navigation.js\";\nimport type { PlanChrome } from \"../root/chrome.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** What {@link PlanTimeNavigator} is drawn from: the window's facts of the canvas's chrome, which hold while a window lands. */\nexport type PlanTimeNavigatorWindow = Pick<PlanChrome, \"scale\" | \"windowParts\" | \"lead\" | \"moveWindow\">;\n\n/**\n * Calendar/Roster navigation over the Plan's one window (#1344): a date\n * picked writes the window, keeping its visible bucket count, into every\n * source of the slice that holds it, as the brush does — else the canvas's\n * own, which a slice with no source holding the window leaves it; its Range\n * panel edits the leading source's range, which the others follow, and with\n * no source holding the window it has none.\n */\nexport function PlanTimeNavigator({ scale, windowParts, lead, moveWindow, compact = false, controls }: PlanTimeNavigatorWindow & { compact?: boolean; controls?: ReactNode }) {\n    useSlicesReactivity(windowParts.map(({ part }) => part.key));\n    const words = useFormatters();\n    if (scale.window.min.type !== \"time\" || scale.window.max.type !== \"time\") return null;\n    const from = scale.window.min.value;\n    const to = new Date(scale.window.max.value.getTime() - 1);\n    const range = lead?.part.config.range;\n    const field = lead !== undefined && range?.type === \"some\"\n        ? lead.part.config.fields.find((f) => stringEqual(f.fieldId, range.value)) : undefined;\n    const navigate = (date: number) => {\n        // Preserve the number of visible buckets. Month/year windows use the\n        // scale's calendar arithmetic, never a fixed number of milliseconds.\n        const min = scale.floor(scale.fromNumber(date));\n        const max = scale.offset(min, scale.n);\n        moveWindow(scale.toNumber(min), scale.toNumber(max));\n    };\n    const rangeEditor = lead !== undefined && field !== undefined\n        ? <RecordSliceFieldEditor slice={lead.part} field={field} source={lead.source} />\n        : undefined;\n    return <TimeNavigator scope=\"plan\" label={controls === undefined ? \"Choose plan dates\" : \"View\"} date={from.getTime()} period={scale.resolution ?? \"day\"}\n        sunday={false} compact={compact} onChange={navigate}\n        rangeLabel={scale.resolution === \"hour\" ? `${words.dateTime(from)} – ${words.dateTime(to)}` : words.range(from, to)}\n        rangeEditor={rangeEditor} controls={controls} />;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Plan's toolbar items (#1193, `Plan Builder Spec.md` §7.1) — every\n * control the Plan draws outside its canvas, as items of its frame's one\n * toolbar (`BuilderFrame`'s), in this order: the rail of its one\n * `Slice.bindRecords` (#1344) — each source's field chips, the presets over\n * them — the key search, Expand/Collapse all, the shared date navigator or a\n * number axis's range, the resolution, the diagnostics; then, at the row's\n * end, the rail's summary, counting each source, the overlaps chip and the\n * history item. The fold toggle acts on every parent, including nested rows,\n * and keeps the same per-row state as the disclosure buttons. There is no\n * Series button: the library's Series tab holds the series (#1195). The\n * overlaps chip (#1198, PB52) counts the pairs of events that overlap in the\n * window; a click selects the first pair, earliest first, and brings it into\n * view.\n *\n * The window is the sources' one range: every source holding it is out of the\n * rail on a time axis, its range the date navigator's — the leading source's\n * range editor its Range panel; on a number axis the leading source's range\n * stays a chip, and the others follow it. The canvas's rows' sources hold no\n * window (#1344): a date field there stays a chip of the rail, and a slice\n * with no source holding the window keeps the navigator, which steps the\n * canvas's own.\n *\n * They fold on one ladder (#952): the rail first, its summary folding after\n * every step of it — then the Plan's own items (the user's decision,\n * 2026-09-27): the overlaps chip to its glyph and its count — words give way\n * before a control does — then the resolution segment folds into a one-chip\n * menu, then the fold toggle keeps only its icon. On a row narrower still the\n * key search folds into its icon, which opens the box in a popover (#1193):\n * with that, a phone's row holds every item. The history item folds last, to\n * its buttons. Before that last step, a time-axis Plan folds its group and\n * resolution controls into the shared date navigator's View, and its overlaps\n * chip with them, one move, as Calendar and Roster fold theirs (#1344: a\n * phone's row has room for the rail's icon, the View and the history item,\n * and no more). Nothing wraps or goes to a second row.\n */\n\nimport { useCallback, useMemo } from \"react\";\nimport { Box, Button, chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faAnglesDown, faAnglesUp, faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\nimport { HOST_RANK, coarseHitArea, useRecordSlicesToolbarItems } from \"@elaraai/east-ui-components/internal\";\nimport { type ToolbarItem, historyToolbarItem, useKeySearchToolbarItem } from \"@elaraai/east-ui-components\";\nimport { usePlanDispatch } from \"../context.js\";\nimport { usePlanController, usePlanSelector } from \"../controller/react.js\";\nimport { usePlanWords } from \"../words.js\";\nimport { PlanDiagnosticChips, hasDiagnostics } from \"./Diagnostics.js\";\nimport type { PlanChrome } from \"../root/chrome.js\";\nimport type { PlanOverlaps } from \"../frame/counts.js\";\nimport { Seg, SegMenu } from \"../../shared/schedule/segments.js\";\nexport { Seg, SegMenu } from \"../../shared/schedule/segments.js\";\nimport { PlanTimeNavigator } from \"./TimeNavigator.js\";\nimport { scheduleEventKey } from \"../../shared/schedule/overlaps.js\";\nimport { SEARCH_BOX_RANK } from \"../../shared/schedule/search-rank.js\";\nimport { isPlanRowsFind } from \"../find.js\";\n\n/** The Plan's own fold ranks, after every step of the rail's (#952): the\n *  overlaps chip keeps its glyph and its count, the resolution then the fold\n *  toggle shorten, and the key search folds into its icon. The history item's\n *  step (`DEFAULT_RANK`) comes after all of them. */\nconst PLAN_RANK = {\n    overlapsShort: HOST_RANK,\n    resolution: HOST_RANK + 1,\n    grain: HOST_RANK + 2,\n    seek: HOST_RANK + 4,\n    time: HOST_RANK,\n    controls: HOST_RANK + 6,\n} as const;\n\n/** No items: a Plan with no window draws none. */\nconst NO_ITEMS: ReadonlyArray<ToolbarItem | false | undefined> = [];\n\n\n/** Props of {@link OverlapsChip}. */\ninterface OverlapsChipProps {\n    /** How many pairs overlap. */\n    readonly n: number;\n    /** Only its glyph and its count: the form a row short of room keeps. */\n    readonly short: boolean;\n    /** Selects the first pair and brings it into view. */\n    readonly onSelect: () => void;\n}\n\n/**\n * The overlaps chip (#1198, PB52): the warn chip with its glyph and the pairs\n * it counts — `3 overlaps`, or `3` on a row short of room — whose click\n * selects the first pair. A 44px target on a coarse pointer, by its halo (#346).\n */\nfunction OverlapsChip({ n, short, onSelect }: OverlapsChipProps) {\n    const chip = useRecipe({ key: \"chip\" });\n    const words = usePlanWords();\n    const count = words.number(n);\n    return (\n        <chakra.button type=\"button\" css={[chip({ tone: \"warn\" }), coarseHitArea({ position: true })]}\n            data-plan-overlaps={short ? \"short\" : \"\"} aria-label={words.m.overlapsLabel({ n, count })} onClick={onSelect}>\n            <Box as=\"span\" data-chip-icon=\"\" aria-hidden=\"true\"><FontAwesomeIcon icon={faTriangleExclamation} /></Box>\n            {short ? words.m.overlapsShort({ n, count }) : words.m.overlaps({ n, count })}\n        </chakra.button>\n    );\n}\n\n/**\n * The Plan's toolbar items, in §7.1's order and on its fold ladder (see the\n * module docs) — for its frame's one toolbar. Read inside the canvas's\n * contexts (`PlanCanvasParts.provide`): the segments dispatch to the canvas's\n * controller. Each item is made again only as what it shows moves, and the\n * list with them (#1398, CL9): the frame is drawn again as each window lands,\n * and a toolbar handed the same items draws and measures nothing again.\n *\n * @param chrome - What the canvas's chrome is drawn from; `undefined` with no window\n * @param overlaps - The overlaps among the window's events (#1198): the chip shows while there is a pair; `undefined` for a Plan without event kinds\n * @returns The items, a falsy entry for each the Plan has no use for — none with no window\n */\nexport function usePlanToolbarItems(chrome: PlanChrome | undefined, overlaps?: PlanOverlaps | undefined): ReadonlyArray<ToolbarItem | false | undefined> {\n    const dispatch = usePlanDispatch();\n    const controller = usePlanController();\n    const folded = usePlanSelector(snapshot => {\n        const keys = controller.groupKeys();\n        return keys.length === 0 ? undefined : snapshot.store.ui.grain === \"group\" || keys.some(key => snapshot.store.ui.collapsed.has(key));\n    });\n    const words = usePlanWords();\n    const slices = chrome?.slices;\n    const affordances = chrome?.affordances;\n    const search = chrome?.search;\n    const resolutions = chrome?.resolutions;\n    const windowParts = chrome?.windowParts;\n    // The configured resolutions, in the app's words.\n    const resolutionItems = useMemo(\n        () => (resolutions ?? []).map((r) => ({ key: r, label: words.m.resolutionName({ resolution: r }) })),\n        [resolutions, words]);\n    // The window is the date navigator's on a time axis (#1344): every source's range leaves the rail, and the\n    // leading source's range editor is the navigator's Range panel. On a number axis the leading source's range\n    // stays a chip, and the others follow it. With no source holding the window, the navigator steps the canvas's own.\n    const timeNavigation = chrome?.scale.kind === \"time\"\n        && (affordances?.includes(\"range\") === true || affordances?.includes(\"fields\") === true);\n    const excludeFields = useMemo(() => (windowParts ?? []).flatMap(({ source, part }, i) =>\n        (i > 0 || timeNavigation) && part.config.range.type === \"some\" ? [`${source}.${part.config.range.value}`] : []),\n    [windowParts, timeNavigation]);\n    const rail = useRecordSlicesToolbarItems(slices?.slice, {\n        excludeFields,\n        ...(chrome === undefined ? {} : { nouns: chrome.nouns }),\n        ...(affordances === undefined ? {} : { affordances: affordances.filter((kind) => kind !== \"resolution\") }),\n        ...(slices?.persist.type === \"some\" ? { persist: slices.persist.value.type } : {}),\n    });\n    // The key search over a seekable source: its box, or its icon on a row short of room.\n    // Over the record of the source the canvas pages (#1513) it is the first thing the row folds, as a period builder's is:\n    // the box came to a row its rail, its dates and its zoom already fill, and they stay live.\n    const findsRows = isPlanRowsFind(search);\n    const seekRank = findsRows ? SEARCH_BOX_RANK : PLAN_RANK.seek;\n    const seek = useKeySearchToolbarItem(search, { rank: seekRank, label: words.m.keySearch() });\n    // Over a paged resource kind's source, whose rows are read by the dates' window beside them, the search's icon leaves\n    // the row less room: the resolution folds to its menu before the dates lose their steps.\n    const timeRank = findsRows && chrome?.rowsPart === undefined ? PLAN_RANK.grain : PLAN_RANK.time;\n\n    // What the Plan's own items are drawn from: the chrome's facts each reads, never the chrome, which is new each render.\n    const drawn = chrome !== undefined;\n    const scale = chrome?.scale;\n    const lead = chrome?.lead;\n    const moveWindow = chrome?.moveWindow;\n    const styles = chrome?.styles;\n    const diagnostics = chrome?.diagnostics;\n    const history = chrome?.history;\n    const selectEvents = chrome?.selectEvents;\n    const optimiseItem = chrome?.optimise?.toolbarItem;\n    const resolution = scale?.resolution ?? \"\";\n    // The resolution is the slice's: without one the segment would offer a control that does nothing.\n    const showResolution = slices !== undefined && resolutionItems.length > 0;\n    const pickResolution = useCallback((r: string) => dispatch({ t: \"resolution.set\", resolution: r }), [dispatch]);\n    // The overlapping pairs, which the toolbar's chip counts (#1198), and the first, earliest first — what its click\n    // selects (PB52), by its events' keys.\n    const pairs = overlaps?.pairs.length ?? 0;\n    const first = overlaps?.pairs[0];\n    const firstKey = first === undefined ? undefined : scheduleEventKey(first.first);\n    const secondKey = first === undefined ? undefined : scheduleEventKey(first.second);\n    const selectFirst = useCallback(() => {\n        if (firstKey !== undefined && secondKey !== undefined) selectEvents?.([firstKey, secondKey]);\n    }, [firstKey, secondKey, selectEvents]);\n    const foldToggle = useCallback((compact = false) => <Button size=\"xs\" variant=\"ghost\" data-plan-fold-all=\"\"\n        aria-label={folded ? words.m.expandAll() : words.m.collapseAll()} title={folded ? words.m.expandAll() : words.m.collapseAll()}\n        onClick={() => controller.setGroupsCollapsed(!folded)}>\n        <FontAwesomeIcon icon={folded ? faAnglesDown : faAnglesUp} />\n        {!compact && (folded ? words.m.expandAll() : words.m.collapseAll())}\n    </Button>, [folded, words, controller]);\n    const groupsItem = useMemo((): ToolbarItem | undefined => (drawn && folded !== undefined ? {\n        key: \"groups\", rank: [PLAN_RANK.grain, PLAN_RANK.controls],\n        bundle: [undefined, \"plan.controls\"],\n        forms: [foldToggle(), foldToggle(true), ...(timeNavigation ? [null] : [])],\n    } : undefined), [drawn, folded, foldToggle, timeNavigation]);\n    const timeItem = useMemo((): ToolbarItem | undefined => {\n        if (!timeNavigation || scale === undefined || windowParts === undefined || moveWindow === undefined) return undefined;\n        const window = { scale, windowParts, lead, moveWindow };\n        const compactControls = <>\n            {folded !== undefined && foldToggle()}\n            {showResolution && <Seg label={words.m.resolutionLabel()} name=\"compact-resolution\" items={resolutionItems}\n                active={resolution} onPick={pickResolution} fullWidth />}\n            {pairs > 0 && <OverlapsChip n={pairs} short={false} onSelect={selectFirst} />}\n        </>;\n        return {\n            key: \"time-navigation\", rank: [timeRank, PLAN_RANK.controls],\n            bundle: [undefined, \"plan.controls\"],\n            forms: [<PlanTimeNavigator {...window} />, <PlanTimeNavigator {...window} compact />,\n                <PlanTimeNavigator {...window} compact controls={compactControls} />],\n        };\n    }, [timeNavigation, scale, windowParts, lead, moveWindow, folded, foldToggle, showResolution, words, resolutionItems, resolution,\n        pickResolution, pairs, selectFirst, timeRank]);\n    // The segment writes the slice's resolution (`slice.setResolution`) — without a slice the effect runner drops it, so\n    // mounting it would offer a control that does nothing. The unbound-canvas fallback story is #572's (resolution\n    // persist fallback); until then, no slice ⇒ no segment.\n    const resolutionItem = useMemo((): ToolbarItem | undefined => (drawn && showResolution ? {\n        key: \"resolution\",\n        rank: [PLAN_RANK.resolution, PLAN_RANK.controls],\n        bundle: [undefined, \"plan.controls\"],\n        forms: [\n            <Seg label={words.m.resolutionLabel()} name=\"resolution\" items={resolutionItems} active={resolution}\n                onPick={pickResolution} />,\n            <SegMenu label={words.m.resolutionLabel()} name=\"resolution\" items={resolutionItems} active={resolution}\n                onPick={pickResolution} />,\n            ...(timeNavigation ? [null] : []),\n        ],\n    } : undefined), [drawn, showResolution, words, resolutionItems, resolution, pickResolution, timeNavigation]);\n    const diagnosticsItem = useMemo((): ToolbarItem | undefined => (diagnostics !== undefined && styles !== undefined && hasDiagnostics(diagnostics)\n        ? { key: \"diagnostics\", forms: [<PlanDiagnosticChips diagnostics={diagnostics} styles={styles} />] }\n        : undefined), [diagnostics, styles]);\n    // The row's end — the rail's summary rides with the rail, above — the overlaps, the history. The pairs of events\n    // that overlap in the window (#1198, PB52): shown while there is one — short of room, its glyph and its count; on a\n    // time axis with nothing left to fold, in the date navigator's View with the fold toggle and the resolution, one\n    // move (#1344).\n    const overlapsItem = useMemo((): ToolbarItem | undefined => (drawn && pairs > 0 ? {\n        key: \"overlaps\",\n        side: \"end\",\n        rank: timeNavigation ? [PLAN_RANK.overlapsShort, PLAN_RANK.controls] : PLAN_RANK.overlapsShort,\n        ...(timeNavigation ? { bundle: [undefined, \"plan.controls\"] } : {}),\n        forms: [\n            <OverlapsChip n={pairs} short={false} onSelect={selectFirst} />,\n            <OverlapsChip n={pairs} short onSelect={selectFirst} />,\n            ...(timeNavigation ? [null] : []),\n        ],\n    } : undefined), [drawn, pairs, selectFirst, timeNavigation]);\n    // The banners say the session's error, so the toolbar keeps one row.\n    const historyItem = useMemo(() => (history === undefined ? undefined : historyToolbarItem({ ...history, showError: false })), [history]);\n    return useMemo(() => (drawn ? [\n        ...rail,\n        seek,\n        groupsItem,\n        timeItem,\n        resolutionItem,\n        diagnosticsItem,\n        overlapsItem,\n        // The Elara eye (#1409): the app's optimiser's item, immediately before the history item.\n        optimiseItem,\n        historyItem,\n    ] : NO_ITEMS), [drawn, rail, seek, groupsItem, timeItem, resolutionItem, diagnosticsItem, overlapsItem, optimiseItem, historyItem]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The status footer (28px, `Plan Spec.html` §1) — the Plan's frame's footer\n * (#1193): mono 10px status items; `tone` tints (`warning` for the exceptions\n * count), `end: true` right-aligns.\n *\n * It leads with the Plan's own counts (PB23): its event kinds' events in the\n * window, their backlog, the changes waiting on Save, and when a kind's record\n * was last saved — `64 events · 9 in backlog · 4 pending · saved 14:02` — then\n * the author's items. A kind whose events are not counted (#1039), past the\n * cap through its day index, is named so: `13 events, print jobs not counted`.\n * A kind hidden in the Series tab is in no count, and nothing says so.\n *\n * On a PAGED canvas the footer also carries the shared loading line at its\n * trailing end (#1398, CL3): which of the source's elements are read, in what\n * the rail counts the rows in — `Loading rows 1,001–1,200`, `Filtering rows…`,\n * `Couldn't read rows 1,001–1,200 · Retry` — never how many have landed. Paged\n * or not, a failed read of the event kinds' rows is said there too, in the\n * noun the rail counts the kinds whose own events it could not read in —\n * `Couldn't read print job events · Retry` — and nowhere else. The\n * rail never wraps and never cuts a word: the counts and the author's items\n * stay whole, ending at a whole item, then \"…\", only where they cannot fit,\n * and the line shows its full text, its short form or its dot alone.\n *\n * After a Save, each source of the Plan's slice that a Save moved records out\n * of says so, in its own words (#1344) — the `rows` source's rows, an event\n * kind's events: `1 print job event left this view`, the shared\n * `RecordSliceSaveNotice`.\n */\n\nimport { useMemo, useRef } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan } from \"@elaraai/e3-ui/internal\";\nimport { OptimiseLegendItem } from \"@elaraai/east-ui-components\";\nimport { FooterMore, LoadingLine, RecordSliceSaveNotice, footerCut, useFooterFit, useLoadingReveal, useRevealed, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { pagedLoadingLine } from \"../../shared/loading.js\";\nimport type { PlanTransport } from \"./transport.js\";\nimport { usePlanWords } from \"../words.js\";\nimport type { PlanEventCounts } from \"../frame/counts.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\ntype FooterItemValue = ValueTypeOf<typeof Plan.Types.FooterItem>;\n\n/** A source whose Save notice the footer shows: its part, and the words it counts in. */\nexport interface PlanSaveNotice {\n    /** The source's name: the notice's key. */\n    readonly key: string;\n    /** Its part of the slice. */\n    readonly slice: ValueTypeOf<RecordSliceBindType>;\n    /** One of what it counts (`row`, `print job event`). */\n    readonly singular: string;\n    /** More than one (`rows`, `print job events`). */\n    readonly plural: string;\n}\n\nconst stringEqual = equalFor(StringType);\n\n/** Nothing to ask again: an inline canvas reads nothing. */\nconst NO_RETRY = () => undefined;\n\nexport interface PlanFooterProps {\n    styles: Styles;\n    /** The author's footer items, in order. */\n    items: ReadonlyArray<FooterItemValue>;\n    /** What the canvas says of its reads — a paged source's, or its event kinds' rows' — omitted on a canvas that reads neither. */\n    transport?: PlanTransport | undefined;\n    /** What the rail counts the rows in — `rows`, `print jobs` — what the loading line names them by (#1398). */\n    noun: string;\n    /** The event kinds' counts (#1193, PB23) — omitted for a Plan without event kinds. */\n    counts?: PlanEventCounts | undefined;\n    /** The event kinds' first read has not landed (#1398, CL13): their count holds its place, \"…\", never 0. */\n    unread?: boolean | undefined;\n    /** The changes waiting on Save — omitted for a Plan that does not edit. */\n    pending?: number | undefined;\n    /** Exact, confirmed feedback when saved records leave a source's narrowing — one per source (#1344). */\n    notices?: readonly PlanSaveNotice[] | undefined;\n    /**\n     * A run of the app's optimiser (#1409): what its line says while the call is out or just stopped, whether the\n     * legend's `Elara change` shows, and whether a run has just landed — the backlog's count flashes once.\n     */\n    optimise?: { readonly line: LoadingLineValue | undefined; readonly legend: boolean; readonly flash: boolean } | undefined;\n}\n\n/** The 28px footer band (renders nothing with nothing to say). */\nexport function PlanFooter({ styles, items, transport, noun, counts, unread, pending, notices, optimise }: PlanFooterProps) {\n    const words = usePlanWords();\n    const { m } = words;\n    // The loading line, in the Plan's words (#1398, CL3), on the Plan's one reveal clock (CL4): its frame's\n    // `LoadingReveal`, which the runs' placeholders read too — else, alone, a clock of its own.\n    const loading = transport?.loading;\n    const retry = transport?.retry ?? NO_RETRY;\n    // In the rows' noun — or, while the cells of the rows in view are read, their events' (#1398).\n    const reads = transport?.noun ?? noun;\n    const line = useMemo(() => pagedLoadingLine(loading, reads, m, words.number, retry), [loading, reads, m, words, retry]);\n    const revealed = useRevealed();\n    const alone = useLoadingReveal(revealed === undefined && loading !== undefined && loading.kind !== \"failed\");\n    const shown = revealed ?? alone;\n    const rail = useRef<HTMLDivElement>(null);\n    const fit = useFooterFit(rail);\n    // The Plan's own counts, in the order the footer reads them — the events' \"…\" until their first read lands. A kind\n    // whose events are not counted (#1039) is named so, never counted as none; a kind hidden in the Series tab is in no\n    // count, so with every kind hidden there is none.\n    const own: { key: string; text: string }[] = [];\n    if (counts !== undefined) {\n        const n = counts.events;\n        const uncounted = counts.uncounted.map((kind) => kind.name.toLocaleLowerCase(words.locale));\n        if (uncounted.length === 0 && n !== undefined) own.push({ key: \"events\", text: m.footerEvents({ n, count: words.number(n) }) });\n        else if (uncounted.length > 0) {\n            own.push({ key: \"events\", text: m.footerEventsNotCounted({ n: n ?? 0, count: n === undefined ? undefined : words.number(n), kinds: uncounted }) });\n        }\n    } else if (unread === true) own.push({ key: \"events\", text: m.footerEvents({ n: 2, count: \"…\" }) });\n    if (counts?.backlog !== undefined) own.push({ key: \"backlog\", text: m.footerBacklog({ n: counts.backlog, count: words.number(counts.backlog) }) });\n    if (pending !== undefined) own.push({ key: \"pending\", text: m.footerPending({ n: pending, count: words.number(pending) }) });\n    const saved = counts?.saved;\n    if (saved !== undefined) {\n        // Its time when it was today, its date and time otherwise.\n        const today = stringEqual(words.date(saved), words.date(new Date()));\n        own.push({ key: \"saved\", text: m.footerSaved({ when: today ? words.time(saved) : words.dateTime(saved) }) });\n    }\n    // A run's line shows at once, whatever the reveal says: a run is not a read (#1409).\n    const runLine = optimise?.line;\n    const legend = optimise?.legend === true;\n    if (own.length === 0 && items.length === 0 && transport === undefined && (notices?.length ?? 0) === 0 && runLine === undefined && !legend) return null;\n    // The counts and the author's items: each whole, the legend the rail fits — and, during a run's highlight, `Elara change`.\n    const units = own.length + items.length + (legend ? 1 : 0);\n    return (\n        <Box ref={rail} css={styles.footer} data-slot=\"footer\">\n            {own.map((count, i) => (\n                <Box key={count.key} css={styles.footerItem} data-plan-count={count.key} data-footer-unit=\"\" data-footer-cut={footerCut(i, fit)}\n                    data-opn={count.key === \"backlog\" && optimise?.flash === true ? \"\" : undefined}>{count.text}</Box>\n            ))}\n            {items.map((item, i) => {\n                const tone = item.tone.type === \"some\" ? item.tone.value.type : undefined;\n                return (\n                    <Box key={i} css={styles.footerItem} data-tone={tone} data-end={item.end ? \"\" : undefined}\n                        data-footer-unit=\"\" data-footer-cut={footerCut(own.length + i, fit)}>\n                        {item.text}\n                    </Box>\n                );\n            })}\n            {legend && <OptimiseLegendItem css={styles.footerItem} cut={footerCut(own.length + items.length, fit)} />}\n            <FooterMore shown={fit.kept < units} />\n            {notices?.map((notice) => <RecordSliceSaveNotice key={notice.key} slice={notice.slice} singular={notice.singular} plural={notice.plural} />)}\n            {/* The line's slot: a paged canvas's reads and the event kinds' rows', and — with event kinds — a run of the optimiser, the slot kept while they are not out. */}\n            {(transport !== undefined || optimise !== undefined) && <LoadingLine value={runLine ?? line} shown={shown || runLine !== undefined} form={fit.form} />}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * What the Plan's footer counts of its event kinds (#1193, PB23): the events\n * in the window, the backlog, and when a kind's record was last saved — read\n * from the kinds' own seams, every kind's drafts in\n * place, and read again when a record they read commits. The inspector shows\n * them too when nothing is selected, with how long the events run (#1197,\n * PB41).\n *\n * The same read finds the overlaps among the window's events (#1198, PB51):\n * two events of a kind that warns of them, on one resource at once — what the\n * toolbar's chip counts, the inspector's banner lists, and each event in a\n * pair wears a warn ring for. A kind whose overlaps are allowed is never in a\n * pair. It reads the backlog the library's Backlog tab lists, too (#1196).\n *\n * The read runs in a component of its own, {@link PlanKindsReader}, beside\n * what the rail hides of the backlog (#1344): a kind narrowed through an\n * interval index lands some fifty-five key searches a window, and each would\n * otherwise render the whole frame. It hands the frame what it read only when\n * that moves.\n *\n * The backlog never blinks (#1398, ruled 25 Oct 2026): its last complete read\n * and what the rail hides of it, counted with it, are held as one, as the\n * Calendar's are. While a narrowing's, a window's or a revision's read of\n * either is in flight they stand in, retained (CL8), and once both have landed\n * they are swapped whole — never a count dropped, never a count shown over\n * another read's cards. Every figure of the backlog is the held read's: the\n * Backlog tab's cards and count, the rail's badge, the footer's and the\n * inspector's.\n *\n * A kind the viewer hides in the Series tab is no part of what the canvas\n * shows: it is in none of the window's figures — its events, their hours,\n * their overlaps — and nothing says so; its backlog is the Backlog tab's\n * still, which lists it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { DateTimeType, SortedMap, StringType, compareFor, equalFor, none, some, type ValueTypeOf } from \"@elaraai/east\";\nimport { planHideId, type PlanEventDraftsType, type PlanPayloadType } from \"@elaraai/e3-ui/internal\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { useBacklogNarrowing, type BacklogNarrowing } from \"../../shared/schedule/backlog.js\";\nimport { scheduleWithinCap, type ScheduleCellsRead } from \"../../shared/schedule/cells.js\";\nimport { scheduleOverlaps, type ScheduleOverlaps } from \"../../shared/schedule/overlaps.js\";\nimport { eventReadRange } from \"../root/events.js\";\nimport type { PlanEventPart } from \"../root/sources.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport { NONE_HIDDEN, hides } from \"./hidden.js\";\n\n/** One event kind, as the Plan's payload carries it (#1190). */\nexport type PlanEventKindValue = ValueTypeOf<typeof PlanPayloadType>[\"events\"][number];\n\n/** One event as Plan draws it, as a kind's `planItems` reads it. */\nexport type PlanEventItemValue = Extract<ReturnType<PlanEventKindValue[\"planItems\"]>, { type: \"some\" }>[\"value\"][number];\n\n/** The overlaps among the window's events (#1198). */\nexport type PlanOverlaps = ScheduleOverlaps<PlanEventItemValue>;\n\n/** One unscheduled event, with the kind it is of: a card of the Backlog tab. */\nexport interface PlanBacklogEntry {\n    readonly kind: PlanEventKindValue;\n    readonly item: PlanEventItemValue;\n}\n\n/** What the footer counts of the event kinds. */\nexport interface PlanEventCounts {\n    /**\n     * The events in the window of every kind the viewer shows but those not counted (`uncounted`) — a kind given cells\n     * counted exactly, from its source, as the rail counts it, or in memory, its record read whole (#1039); `undefined`\n     * where no kind's are counted: every kind shown among `uncounted`, or none shown.\n     */\n    readonly events: number | undefined;\n    /**\n     * The kinds shown whose events in the window are not counted (#1039): past the cap, and counted only by the days\n     * its events run on — a day index's — which is no number of them. None of their events is read, and none is in\n     * `events` or `minutes`.\n     */\n    readonly uncounted: readonly PlanEventKindValue[];\n    /**\n     * The kinds shown whose events in the window are counted, but not their hours (#1039): past the cap, counted\n     * exactly — through their source, or in memory — and none of their events read, so none of their hours is in\n     * `minutes`.\n     */\n    readonly hoursNotCounted: readonly PlanEventKindValue[];\n    /**\n     * How long the events read run, in minutes — a month counting 30 days, as a kind counts it; `undefined` where no\n     * kind's hours are read, every kind shown past the cap or none shown.\n     */\n    readonly minutes: number | undefined;\n    /**\n     * Whether a kind read by its cells counts its hours and its overlaps over the rows drawn (#1039): it reads only the\n     * events of the resources around the rows in view, so the inspector says its hours are those in view.\n     */\n    readonly drawn: boolean;\n    /** The unscheduled events — every backlog kind's; `undefined` when no kind has a backlog. */\n    readonly backlog: number | undefined;\n    /** The newest commit to any kind's record; `undefined` while there is none. */\n    readonly saved: Date | undefined;\n    /** The overlaps among the events in the window: two events of a kind that warns of them, on one resource at once (#1198, PB51). */\n    readonly overlaps: PlanOverlaps;\n    /** The unscheduled events, every backlog kind's, in the kinds' order: the Backlog tab's cards (#1196). */\n    readonly unscheduled: readonly PlanBacklogEntry[];\n}\n\n/** The event kinds' counts as {@link usePlanEventCounts} reads them, and whether a read of them is in flight. */\nexport interface PlanEventCountsRead {\n    /** The counts — the last read's while a read is in flight or failed; `undefined` for a Plan without event kinds, or before the first read answers. */\n    readonly counts: PlanEventCounts | undefined;\n    /** Whether a read is in flight: `counts` stands in for it meanwhile. */\n    readonly reading: boolean;\n}\n\n/** One kind's drafts, by entry id, as its seams take them. */\ntype KindDrafts = Parameters<PlanEventKindValue[\"planItems\"]>[2];\n\n/** Every kind's drafts, by kind then by entry id. */\ntype EventDrafts = ValueTypeOf<typeof PlanEventDraftsType>;\n\n/** No drafts: what a kind holds none of. */\nconst NO_DRAFTS: KindDrafts = new SortedMap([], compareFor(StringType));\nconst NONE_DRAFTED: EventDrafts = new SortedMap([], compareFor(StringType));\nconst compareDateTime = compareFor(DateTimeType);\nconst stringEqual = equalFor(StringType);\n/** No event kind narrowed through a source of the slice. */\nconst NO_PARTS: readonly PlanEventPart[] = [];\n\n/** A read whose kinds are still in flight: the counts stand as they were. */\nconst READING = \"reading\";\n\n/** A `time` instant's epoch ms; `undefined` for an instant of another arm. */\nfunction timeMs(t: PlanScale[\"window\"][\"min\"]): number | undefined {\n    return t.type === \"time\" ? t.value.getTime() : undefined;\n}\n\n/**\n * The event kinds' counts over the window the canvas shows, every kind's\n * drafts in place (#1194). A kind read by its cells (#1039) never reads the\n * window: its events are counted exactly from its source, as the rail counts\n * them, its hours and its overlaps over the events its cells hold, and its\n * backlog read alone. A kind past the cap draws none, and none of its events\n * is read: it is counted exactly — through its source, or in memory, its record\n * read whole — but not its hours (`hoursNotCounted`), and one counted through\n * its day index, whose count is the days its events run on, no number of them,\n * is not counted at all (`uncounted`). Every other kind — each is counted\n * before it is read — is read over the window only once its count over the\n * range the canvas reads — the count the cells' reader decides by — is within\n * the cap; past it the last counts stand until the reader gives it no cells,\n * so no event of a range past the cap is read. A kind the viewer hides is in\n * no figure of the window, and its window is not read for them; its backlog\n * and its last save are counted still.\n *\n * @param kinds - The Plan's event kinds; `undefined` or none for a Plan without them\n * @param scale - The shared scale: the window the events are counted over\n * @param drafts - Every kind's drafts, by kind then by entry id — the same object while they hold; none for a Plan whose kinds hold none\n * @param cells - The kinds' cells and counts, when the reader decides a kind: what it draws from, its drafts as the seams take them, which counted kinds are read over the window, and which are past the cap\n * @param parts - Each event kind narrowed through its source of the slice: what a kind given cells is counted through\n * @param hidden - The ids the viewer hides in the Series tab: a kind hidden there is in no figure of the window\n * @returns The counts — the last read's while a read is in flight or fails; `undefined` for a Plan without event kinds, or before the first read answers — and whether a read is in flight\n */\nexport function usePlanEventCounts(\n    kinds: readonly PlanEventKindValue[] | undefined, scale: PlanScale | undefined, drafts: EventDrafts = NONE_DRAFTED,\n    cells?: ScheduleCellsRead | undefined, parts: readonly PlanEventPart[] = NO_PARTS, hidden: readonly string[] = NONE_HIDDEN,\n): PlanEventCountsRead {\n    const from = scale !== undefined ? timeMs(scale.window.min) : undefined;\n    const to = scale !== undefined ? timeMs(scale.window.max) : undefined;\n    // The range the canvas reads, the window's and the periods it lays out beyond each edge: what a kind is capped over.\n    const range = eventReadRange(scale);\n    const readFrom = range?.from.getTime();\n    const readTo = range?.to.getTime();\n    const active = kinds !== undefined && kinds.length > 0;\n    const read = useCallback((): PlanEventCounts | typeof READING | undefined => {\n        if (kinds === undefined || kinds.length === 0 || from === undefined || to === undefined || readFrom === undefined || readTo === undefined) return undefined;\n        let events = 0;\n        let counted = false;\n        let minutes = 0;\n        let hoursCounted = false;\n        let backlog: number | undefined;\n        let saved: Date | undefined;\n        let drawn = false;\n        const unscheduled: PlanBacklogEntry[] = [];\n        const uncounted: PlanEventKindValue[] = [];\n        const hoursNotCounted: PlanEventKindValue[] = [];\n        // Each kind that warns of its overlaps: two of its events are a pair (PB51).\n        const warned: (readonly PlanEventItemValue[])[] = [];\n        for (const kind of kinds) {\n            // Hidden in the Series tab: no part of what the canvas shows, so in no figure of the window.\n            const shown = !hides(hidden, planHideId.events(kind.key));\n            // A kind given cells: from what they hold, its drafts as the seams take them (#1039).\n            const held = cells?.reads.get(kind.key);\n            // Every kind is counted before it is read: given no cells, it is read over the window once its count over the\n            // range the canvas reads is within the cap — past it, or in flight, the last counts stand.\n            if (shown && held === undefined) {\n                const within = scheduleWithinCap(kind.count, new Date(readFrom), new Date(readTo));\n                if (within.type !== \"some\" || !within.value) return READING;\n            }\n            const read = held === undefined ? none : some(held);\n            const drafted = (held === undefined ? drafts : cells!.drafts).get(kind.key) ?? NO_DRAFTS;\n            if (shown) {\n                const items = kind.planItems(new Date(from), new Date(to), drafted, read);\n                if (items.type === \"none\") return READING;\n                if (kind.overlaps.type === \"warn\") warned.push(items.value);\n                // Read over the window — by its host, or, a kind read a window at a time, from its window's own rows as\n                // the reader holds them (#1599): every event of the window, its drafts in place.\n                if (held === undefined || cells!.windowed.has(kind.key)) {\n                    events += items.value.length;\n                    counted = true;\n                    for (const item of items.value) minutes += Number(item.minutes);\n                    hoursCounted = true;\n                } else {\n                    const part = parts.find((p) => stringEqual(p.kind.key, kind.key))?.part;\n                    // Past the cap (#1039): none of its events is read, so none of its hours — said so, never counted as none.\n                    const capped = cells!.capped.has(kind.key);\n                    // Read by its cells, before they have landed once: its hours are not known yet, never 0 (#1398, CL13).\n                    if (!capped && !cells!.held.has(kind.key)) return READING;\n                    if (capped && part === undefined && !kind.countExact) {\n                        // Counted through its day index: the days its events run on are no number of them — not counted.\n                        uncounted.push(kind);\n                    } else {\n                        // Its events in the window, exactly: its source's count, as the rail counts it — its record read\n                        // whole, counted in memory.\n                        const inWindow = part !== undefined ? part.count() : kind.count(new Date(from), new Date(to));\n                        if (inWindow.type !== \"some\") return READING;\n                        events += Number(inWindow.value);\n                        counted = true;\n                        if (capped) {\n                            hoursNotCounted.push(kind);\n                        } else {\n                            // Read by its cells: its hours over the rows drawn.\n                            for (const item of items.value) minutes += Number(item.minutes);\n                            hoursCounted = true;\n                            drawn = true;\n                        }\n                    }\n                }\n            }\n            if (kind.backlog) {\n                const waiting = kind.planUnscheduled(new Date(from), new Date(to), drafted, read);\n                if (waiting.type === \"none\") return READING;\n                backlog = (backlog ?? 0) + waiting.value.length;\n                for (const item of waiting.value) unscheduled.push({ kind, item });\n            }\n            const commits = kind.history();\n            const newest = commits.type === \"some\" ? commits.value[0]?.at : undefined;\n            if (newest !== undefined && (saved === undefined || compareDateTime(newest, saved) > 0)) saved = newest;\n        }\n        return {\n            events: counted ? events : undefined, uncounted, hoursNotCounted, minutes: hoursCounted ? minutes : undefined, drawn, backlog, saved,\n            overlaps: scheduleOverlaps(warned), unscheduled,\n        };\n    }, [kinds, from, to, readFrom, readTo, drafts, cells, parts, hidden]);\n    const { result } = useTrackedEvaluation(read);\n    // The last counts read, held while a read is in flight or failed.\n    const held = useRef<PlanEventCounts | undefined>(undefined);\n    const counts = useMemo(() => {\n        if (!active) {\n            held.current = undefined;\n            return undefined;\n        }\n        if (!result.ok) {\n            console.error(\"[Plan] the event kinds could not be counted:\", result.error);\n            return held.current;\n        }\n        if (result.value === READING || result.value === undefined) return held.current;\n        held.current = result.value;\n        return result.value;\n    }, [active, result]);\n    const reading = active && result.ok && result.value === READING;\n    return useMemo(() => ({ counts, reading }), [counts, reading]);\n}\n\n/** What {@link PlanKindsReader} reads: the counts, and what the rail hides of the backlog — the backlog's held as one. */\nexport interface PlanKindsRead {\n    /**\n     * The event kinds' counts over the window; `undefined` before the first read answers. Their backlog — its cards\n     * and how many there are — is the held read's, swapped together with what the rail hides of it (`backlog`).\n     */\n    readonly counts: PlanEventCounts | undefined;\n    /** What the rail hides of the backlog (#1344): the held read's, counted with its cards. */\n    readonly backlog: BacklogNarrowing<PlanEventPart>;\n    /** Whether the backlog stands in for a read in flight (#1398, CL8) — its cards' or its count's: retained. */\n    readonly retained: boolean;\n}\n\n/**\n * The backlog's last complete read (#1398): its cards, how many there are, and what the rail hides of them, counted\n * then — held as one, so the cards and the count are swapped together.\n */\ninterface HeldBacklog {\n    readonly unscheduled: readonly PlanBacklogEntry[];\n    readonly backlog: number | undefined;\n    readonly narrowing: BacklogNarrowing<PlanEventPart>;\n}\n\n/** Props of {@link PlanKindsReader}. */\nexport interface PlanKindsReaderProps {\n    /** The Plan's event kinds. */\n    kinds: readonly PlanEventKindValue[];\n    /** The shared scale: the window the events are counted over. */\n    scale: PlanScale | undefined;\n    /** Every kind's drafts. */\n    drafts: EventDrafts | undefined;\n    /** Each event kind narrowed through its source of the slice. */\n    parts: readonly PlanEventPart[];\n    /** The kinds' cells and counts (#1039), when the reader decides a kind. */\n    cells: ScheduleCellsRead | undefined;\n    /** The ids the viewer hides in the Series tab: a kind hidden there is in no figure of the window. */\n    hidden: readonly string[];\n    /** Where what it read goes: called only when that moves. */\n    onRead: (read: PlanKindsRead) => void;\n}\n\n/**\n * The event kinds' counts, and what the rail hides of the backlog, read in a\n * component of its own (see the module docs).\n *\n * @param props - What is read, over what, and where it goes\n * @returns Nothing: it reads\n */\nexport function PlanKindsReader({ kinds, scale, drafts, parts, cells, hidden, onRead }: PlanKindsReaderProps): null {\n    const { counts: read, reading } = usePlanEventCounts(kinds, scale, drafts, cells, parts, hidden);\n    const narrowing = useBacklogNarrowing(parts);\n    // The backlog never blinks (#1398, ruled 25 Oct 2026): its cards, read with the counts, and what the rail hides of\n    // them, held as one — taken as both land: the first read's at once, its count to follow, as the Calendar's are.\n    const held = useRef<HeldBacklog | undefined>(undefined);\n    const last = held.current;\n    if (read !== undefined && !reading && (!narrowing.counting || last === undefined)\n        && (last === undefined || last.unscheduled !== read.unscheduled || last.narrowing !== narrowing)) {\n        held.current = { unscheduled: read.unscheduled, backlog: read.backlog, narrowing };\n    }\n    const shown = held.current;\n    // A backlog kind read through its source reads its backlog again with its window and its choices: what stands in\n    // meanwhile is retained (CL8).\n    const rereads = useMemo(() => parts.some(({ kind }) => kind.backlog), [parts]);\n    const retained = shown !== undefined && rereads && (reading || narrowing.counting);\n    // Every figure of the backlog is the held read's: the tab's, the rail's badge, the footer's and the inspector's.\n    const counts = useMemo(() => (read === undefined || shown === undefined || read.unscheduled === shown.unscheduled ? read\n        : { ...read, unscheduled: shown.unscheduled, backlog: shown.backlog }), [read, shown]);\n    const backlog = shown?.narrowing ?? narrowing;\n    const reported = useRef<PlanKindsRead | undefined>(undefined);\n    useLayoutEffect(() => {\n        const was = reported.current;\n        // The same counts, the same narrowing and the same standing, by identity — each holds while what it read holds.\n        if (was !== undefined && Object.is(was.counts, counts) && Object.is(was.backlog, backlog) && was.retained === retained) return;\n        const next = { counts, backlog, retained };\n        reported.current = next;\n        onRead(next);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The inspector pane (#1197, `Plan Builder Spec.md` §8, §9.8, PB38–PB41,\n * PB60): the Plan's end pane, when it is given one (`inspector`), showing\n * what is selected on the canvas — and, collapsed, a rail with its icon and\n * what is selected.\n *\n * - **one event** (PB38): its kind's icon and name, its title, when it runs\n *   and its status; the overlaps banner when it overlaps another (#1198,\n *   PB53), a line per event it overlaps whose click selects that event; the\n *   banner of its refusals holding Save while the app's `ready` refuses it\n *   (#1525), as the Calendar's inspector has it, each field one names ringed\n *   in its form, the app's words for it under it (ruled 13 Nov 2026) — a field\n *   a role reads saying them under its fact — the one the warning button's\n *   issue or warning names taking the keyboard as the form draws it, or, a\n *   field a role reads, its fact taking it; its resource, its start and end or\n *   its instant, its lane, its\n *   state and its quantity — the bound a hint gives its field that it breaks\n *   said on a line of its own under it, in the form's help line's style and in\n *   the tone the form says one in: a row as stored warns, a changed one's,\n *   holding Save, is an error (#1585); its kind's fields through `FieldForm`, the fields its roles\n *   read left to their own lines — or, when the kind has its own inspector,\n *   what that returns for the event in place of the form (PB60); then\n *   Duplicate and Delete;\n * - **several events** (PB39): how many, each kind's count, the list, and the\n *   bulk edit — the state, the resource and a shift in time;\n * - **a row** (PB40): a resource's name and lines, its group, its overlaps —\n *   the pairs on the resource in the window, each line selecting its pair\n *   (#1198) — its events in the window — how many, how long, how much of each\n *   unit — and its measures at the bucket a click on its plot named; an event\n *   kind's Unassigned row, the kind's events on no resource; any other row,\n *   what it draws at that bucket. A kind past the cap is counted on no row,\n *   and the row says so, never 0; a kind hidden in the Series tab is in no\n *   figure, and nothing says so (#1039). While the cells a paged resource's\n *   kinds are read by have not landed for it — scrolled out of the blocks\n *   read, or before the first read — its figures are placeholders, never 0,\n *   until they land (#1398, CL13);\n * - **nothing** (PB41): the window's counts — the hours those of the kinds\n *   read, the kinds whose events or hours are not counted named in one line\n *   (#1039) — and three hints.\n *\n * Each event is read as the kinds' editing reads it (`read`, its kind's own\n * `planEvent`), its kind's drafts in place, tracked, so a commit to its record\n * reads it again, and an event no longer there is left out — a kind read a\n * window at a time (#1199) looking for it among the rows the canvas holds,\n * then reading it by its key, and a kind read by its cells (#1039) among the\n * rows they hold, read again as they move. The read runs in a component of its own\n * ({@link PlanSelectionReader}), which hands the frame the events only when\n * they move: a kind narrowed through its source of the slice lands its key\n * searches one by one, and each would otherwise render the whole frame\n * (#1344). A paged resource kind's resource is named once it is read by its\n * key (`resources.ts`); its key stands in meanwhile, and the bulk edit offers\n * none of a paged kind's resources, which it does not list. Of a resource\n * kind the rail narrows, the bulk edit offers the resources its source shows,\n * and those the selected events are on (#1344).\n *\n * Its edits (#1194, PB42, PB60) are steps of the Plan's one history, each one\n * transaction: a field of the kind's form, written through the kind's own\n * `write`, tinted while the drafts hold it otherwise than the record does; the\n * kind's own inspector's `update`, the edited event whole; Duplicate, a copy\n * of each event under a new key, the copies then selected; Delete; and the\n * bulk edit — the state, the resource, a shift of a day or an hour — over every\n * event selected that takes it, across kinds. They sit in one fieldset, off\n * while the canvas takes no write — a run of the app's optimiser out (#1409,\n * R2), or what it shows standing in, retained (#1398, CL8) — or a selected\n * kind takes no gesture — a write of its with no answer, its drafts out of\n * date — and each gesture asks the same again as it lands, so a control of a\n * kind's own inspector the fieldset does not reach writes nothing meanwhile.\n * A field's edit, or a bulk choice, that records nothing — off meanwhile, its\n * kind's own `write` turning it down, or nothing changed — draws its form\n * again, showing what the event holds, or what the events share, with no\n * words, as the Schematic's and the Flowchart's do for a refusal they have no\n * words for (#1585): a box never keeps a value its event does not hold.\n *\n * It keeps the keyboard (#1398): a control that goes with the view it was\n * pressed in — Duplicate, which selects the copies, an overlap's line, which\n * selects what it names — leaves the focus on the heading of the view drawn in\n * its place (`../../shared/focus-home.ts`), never on the page's body; Nothing\n * selected, which has no heading, is its own home. Delete hands the keyboard\n * to the canvas's row instead, as its selection's command does.\n *\n * Styles are the `planInspector` recipe's, the form's `fieldForm`'s and the\n * buttons the shared `button`'s; the pane — its collapse control and its rail\n * — is the Dock's.\n *\n * @packageDocumentation\n */\n\nimport { ScheduleInspectorHead } from \"../../shared/schedule/inspector-head.js\";\nimport { FOCUS_HOME_PROPS, useFocusHome } from \"../../shared/focus-home.js\";\nimport { memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { Box, chakra, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport {\n    BlobType, NullType, OptionType, SortedMap, StringType, VariantType, compareFor, decodeBeast2For, encodeBeast2For, equalFor, fromEastTypeValue,\n    none, parseFor, printFor, some, toEastTypeValue, variant, type StructType, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport { EventStateType } from \"@elaraai/east-ui\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { PlanEventItemType, ScheduleEventRefType, ScheduleResourceRefType, planHideId, type PlanEventDraftsType, type planKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, EastChakraComponent, FieldForm, fieldBreachIssue, fieldBreachText, fieldBreaches, fieldFormMessages, getSomeorUndefined, useDataStable, useTrackedEvaluation,\n    type BuilderFrameDock, type FieldOption,\n} from \"@elaraai/east-ui-components\";\nimport { FrameDrawer, PlaceholderShape } from \"@elaraai/east-ui-components/internal\";\nimport { heldRowOf } from \"../../shared/schedule/editing.js\";\nimport { useFieldAsk } from \"../../shared/schedule/field-ask.js\";\nimport { removePlanEvents, type PlanEventChange, type PlanEventEditing } from \"../edit/events.js\";\nimport { usePlanResourceRows, type PlanResourceLookup, type PlanResourceRefValue } from \"./resources.js\";\nimport { scheduleEventKey } from \"../../shared/schedule/overlaps.js\";\nimport { NO_REFUSED_FIELDS, refusalText, refusedFields, scheduleRefusals } from \"../../shared/schedule/refusals.js\";\nimport { stateText } from \"../a11y.js\";\nimport type { PlanSnapshot } from \"../controller/index.js\";\nimport { usePlanSelector } from \"../controller/react.js\";\nimport type { PlanInstantValue } from \"../instant.js\";\nimport type { PlanStateWord } from \"../messages.js\";\nimport { rowKeyOf } from \"../model.js\";\nimport type { RowKey } from \"../plan-state.js\";\nimport { quantityText, totalsByUnit, totalsText, type PlanQuantityValue } from \"../quantity.js\";\nimport { scheduleWithinCap, type ScheduleCellsRead } from \"../../shared/schedule/cells.js\";\nimport type { PlanChrome } from \"../root/chrome.js\";\nimport { eventReadRange, type PlanEventShownValue } from \"../root/events.js\";\nimport type { PlanScale } from \"../scale.js\";\nimport type { PlanWords } from \"../words.js\";\nimport type { PlanEventCounts } from \"./counts.js\";\nimport { hides } from \"./hidden.js\";\nimport type { PlanValue } from \"./index.js\";\n\n/** The names a Plan keeps its viewer's state under. */\ntype PlanKeys = ReturnType<typeof planKeys>;\n/** One event kind, as the payload carries it. */\ntype PlanEventKindValue = PlanValue[\"events\"][number];\n/** One resource kind, as the payload carries it. */\ntype PlanResourceKindValue = PlanValue[\"resources\"][number];\n/** One event read by its key: as Plan draws it, and its row. */\ntype PlanEventReadValue = Extract<ReturnType<PlanEventKindValue[\"planEvent\"]>, { type: \"some\" }>[\"value\"];\n/** One event as Plan draws it. */\ntype PlanEventItemValue = PlanEventReadValue[\"item\"];\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The inspector open: the Calendar's 320px (§8), as the Sheet's is. */\nconst INSPECTOR_SIZE = \"320px\";\n\n/** Every kind's drafts, by kind then by entry id (#1194). */\ntype EventDrafts = ValueTypeOf<typeof PlanEventDraftsType>;\n\n/** No drafts: what a kind holds none of. */\nconst NO_DRAFTS: Parameters<PlanEventKindValue[\"planEvent\"]>[1] = new SortedMap([], compareFor(StringType));\n/** No kind holds a draft. */\nconst NONE_DRAFTED: EventDrafts = new SortedMap([], compareFor(StringType));\n/** No range: a canvas with no time window, beside which a windowed kind reads an event by its key alone. */\nconst NO_RANGE = new Date(0);\n/** No resource named. */\nconst NO_RESOURCES_NAMED: readonly PlanResourceRefValue[] = [];\n\n/** A Plan whose kinds take no edit — none here, as every kind is a record with its patch door — writes nothing. */\nconst NO_EDIT = (): void => {};\n\n/** A read whose kinds are still in flight: what the pane shows stands as it was. */\nconst READING = \"reading\";\n\n/** No event selected. */\nconst NO_EVENTS: readonly InspectedEvent[] = [];\n\n/** The lifecycle states a bulk edit sets, in the order the axis reads them. */\nconst STATES: readonly PlanStateWord[] = [\"estimated\", \"added\", \"recommended\", \"removed\", \"confirmed\", \"in-progress\", \"actual\", \"rejected\"];\n\n/** The bulk edit's choice of a state: a case per state. */\nconst STATE_CHOICE = VariantType(Object.fromEntries(STATES.map((state) => [state, NullType])));\n\nconst stringEqual = equalFor(StringType);\nconst blobEqual = equalFor(BlobType);\nconst itemEqual = equalFor(PlanEventItemType);\nconst resourceEqual = equalFor(OptionType(ScheduleResourceRefType));\nconst parseRef = parseFor(ScheduleEventRefType);\nconst printRef = printFor(ScheduleEventRefType);\nconst printResource = printFor(ScheduleResourceRefType);\nconst parseResource = parseFor(ScheduleResourceRefType);\nconst encodeState = encodeBeast2For(EventStateType);\n\n/** A lifecycle state's word, its proposal's flavour spelled out — what the bulk edit chooses among. */\nfunction stateWordOf(state: ValueTypeOf<typeof EventStateType>): PlanStateWord {\n    return (state.type === \"proposed\" ? state.value.type : state.type) as PlanStateWord;\n}\n\n/** A lifecycle state by its word: a proposal's flavour inside `proposed`. */\nfunction stateOfWord(word: PlanStateWord): ValueTypeOf<typeof EventStateType> {\n    return word === \"added\" || word === \"recommended\" || word === \"removed\"\n        ? variant(\"proposed\", variant(word, null))\n        : variant(word, null) as ValueTypeOf<typeof EventStateType>;\n}\n\n/**\n * Whether the selected events take a gesture now: what the edits' fieldset is on for, and what each of its gestures\n * asks again as it lands.\n *\n * @param events - The selected events\n * @param editing - The event kinds' editing\n * @param canvas - Whether the canvas takes a write now (`PlanChrome.writable`): no run of the optimiser out, nothing standing in\n * @returns Whether the canvas takes a write, and every selected event's kind takes a gesture\n */\nfunction writableFor(events: readonly InspectedEvent[], editing: PlanEventEditing | undefined, canvas: boolean): boolean {\n    return canvas && editing !== undefined && events.length > 0 && events.every((event) => editing.available(event.kind.key));\n}\n\n/** One selected event, read: its element's key, its kind, and the event as Plan draws it, with its row. */\nexport interface PlanInspectedEvent {\n    /** Its element's key: its event, as East prints a `Schedule.Types.EventRef`. */\n    readonly key: string;\n    /** Its kind. */\n    readonly kind: PlanEventKindValue;\n    /** The event as Plan draws it. */\n    readonly item: PlanEventItemValue;\n    /** Its row, as bytes at its record's entry type. */\n    readonly row: Uint8Array;\n}\n\n/** One selected event, read. */\ntype InspectedEvent = PlanInspectedEvent;\n\n/** No event selected: what the pane holds before the selection's first read. */\nexport const NO_INSPECTED: readonly PlanInspectedEvent[] = NO_EVENTS;\n\n/** What is selected on the canvas: the row, the bucket a click on it named, and the events. */\nexport interface PlanInspectorSelection {\n    readonly row: RowKey | null;\n    readonly at: PlanInstantValue | null;\n    readonly elements: readonly string[];\n}\n\n/** What is selected on the canvas. */\ntype PlanSelection = PlanInspectorSelection;\n\n/** Nothing selected — the pane's selection while it shows none. */\nconst NOTHING: PlanSelection = { row: null, at: null, elements: [] };\n\nconst selectSelection = (s: PlanSnapshot): PlanSelection => ({ row: s.store.ui.selected, at: s.store.ui.selectedAt, elements: s.store.ui.elements });\nconst selectNothing = (): PlanSelection => NOTHING;\n// The store keeps each part's identity while it holds.\nconst sameSelection = (a: PlanSelection, b: PlanSelection): boolean =>\n    Object.is(a.row, b.row) && Object.is(a.at, b.at) && Object.is(a.elements, b.elements);\n\n/**\n * What is selected on the canvas, as the inspector shows it: the controller's\n * selection while the Plan has its pane, nothing otherwise.\n *\n * @param shown - Whether the Plan is given its inspector pane\n * @returns The selection — the same object while it holds\n */\nexport function usePlanInspectorSelection(shown: boolean): PlanInspectorSelection {\n    return usePlanSelector(shown ? selectSelection : selectNothing, sameSelection);\n}\n\n/** Props of {@link usePlanInspector}. */\nexport interface PlanInspectorProps {\n    /** Whether the Plan is given its inspector pane (`inspector`). */\n    shown: boolean;\n    /** The event kinds: each selected event is read through its kind. */\n    kinds: PlanValue[\"events\"];\n    /** The resource kinds: what an event and a row name their resource by. */\n    resources: PlanValue[\"resources\"];\n    /** The canvas's chrome facts: its scale, its words, and what it reads of its rows; `undefined` with no window. */\n    chrome: PlanChrome | undefined;\n    /** The event kinds' counts over the window: what the pane shows when nothing is selected. */\n    counts: PlanEventCounts | undefined;\n    /** The names the Plan keeps its viewer's state under. */\n    keys: PlanKeys;\n    /** The Plan's words. */\n    words: PlanWords;\n    /** What is selected on the canvas ({@link usePlanInspectorSelection}). */\n    selection: PlanInspectorSelection;\n    /** The selected events, read ({@link PlanSelectionReader}). */\n    events: readonly PlanInspectedEvent[];\n    /** The resources the rail shows, by resource kind (#1344): what the bulk edit offers of a kind its source narrows. */\n    shownResources: PlanEventShownValue;\n    /** The ids the viewer hides in the Series tab: a kind hidden there is in no figure of a row's. */\n    hidden: readonly string[];\n}\n\n/**\n * The selected events, read through their kinds, their drafts in place —\n * tracked, so a commit to a kind's record reads them again; an event no\n * longer there is left out. An event of a kind the cells' reader gives cells\n * (#1039) is read from the rows they hold, which no tracked read listens to:\n * it is read again as they move — the cells a commit reads again.\n *\n * @param kinds - The event kinds\n * @param elements - The selected events, by their elements' keys\n * @param drafts - Every kind's drafts (#1194) — the same object while they hold\n * @param editing - The kinds' editing, which reads an event where the canvas reads its rows (#1199); none without a window\n * @param cellRows - The rows the cells' reader holds of each kind it gives cells — the same object while they hold; none before it hands any on\n * @returns The events, in the order they were selected — the last read's while a read is in flight or has failed\n */\nfunction useSelectedEvents(\n    kinds: PlanValue[\"events\"], elements: readonly string[], drafts: EventDrafts, editing: PlanEventEditing | undefined,\n    cellRows: ScheduleCellsRead[\"held\"] | undefined,\n): readonly InspectedEvent[] {\n    const bySlot = useMemo(() => new Map(kinds.map((kind) => [kind.key, kind] as const)), [kinds]);\n    const readEvent = editing?.read;\n    const read = useCallback((): readonly InspectedEvent[] => {\n        const out: InspectedEvent[] = [];\n        for (const key of elements) {\n            const ref = parseRef(key);\n            if (!ref.success) continue;\n            const kind = bySlot.get(ref.value.kind);\n            if (kind === undefined) continue;\n            // The editing reads the latest drafts — these, which re-run the read as they move — and the latest rows the\n            // cells hold, the kind's here.\n            const got = readEvent !== undefined ? readEvent(kind.key, ref.value.key)\n                : getSomeorUndefined(kind.planEvent(ref.value.key, drafts.get(ref.value.kind) ?? NO_DRAFTS, NO_RANGE, NO_RANGE,\n                    heldRowOf(cellRows, ref.value.kind, ref.value.key)));\n            if (got !== undefined) out.push({ key, kind, item: got.item, row: got.row });\n        }\n        return out;\n    }, [bySlot, elements, drafts, readEvent, cellRows]);\n    const { result } = useTrackedEvaluation(read);\n    const held = useRef<readonly InspectedEvent[]>(NO_EVENTS);\n    return useMemo(() => {\n        if (!result.ok) {\n            console.error(\"[Plan] the selected events could not be read:\", result.error);\n            return held.current;\n        }\n        // The same events as the last read — each read is a new array — hold the last: nothing the pane shows moved.\n        if (sameEvents(held.current, result.value)) return held.current;\n        held.current = result.value;\n        return result.value;\n    }, [result]);\n}\n\n/** Whether two reads of the selected events read the same: each event's key, kind, drawing and row. */\nfunction sameEvents(a: readonly InspectedEvent[], b: readonly InspectedEvent[]): boolean {\n    return a.length === b.length && a.every((event, i) => {\n        const other = b[i]!;\n        return stringEqual(event.key, other.key) && Object.is(event.kind, other.kind) && itemEqual(event.item, other.item) && blobEqual(event.row, other.row);\n    });\n}\n\n/** Props of {@link PlanSelectionReader}. */\nexport interface PlanSelectionReaderProps {\n    /** The event kinds: each selected event is read through its kind. */\n    kinds: PlanValue[\"events\"];\n    /** The selected events, by their elements' keys. */\n    elements: readonly string[];\n    /** Every kind's drafts; none for a Plan whose kinds hold none. */\n    drafts: EventDrafts | undefined;\n    /** The kinds' editing, which reads an event where the canvas reads its rows; none without a window. */\n    editing: PlanEventEditing | undefined;\n    /** The rows the cells' reader holds of each kind it gives cells (#1039): an event of such a kind is read again as they move. */\n    held: ScheduleCellsRead[\"held\"] | undefined;\n    /** Where the events go: called only when they move. */\n    onRead: (events: readonly PlanInspectedEvent[]) => void;\n}\n\n/**\n * The selected events, read in a component of its own (see the module docs):\n * a read that lands re-runs it alone, and it hands the frame the events only\n * when what it read moves.\n *\n * @param props - What is read, and where it goes\n * @returns Nothing: it reads\n */\nexport function PlanSelectionReader({ kinds, elements, drafts, editing, held, onRead }: PlanSelectionReaderProps): null {\n    const events = useSelectedEvents(kinds, elements, drafts ?? NONE_DRAFTED, editing, held);\n    const reported = useRef<readonly InspectedEvent[]>(NO_EVENTS);\n    useLayoutEffect(() => {\n        // The same events, by identity: the read holds its last while what it read holds.\n        if (Object.is(reported.current, events)) return;\n        reported.current = events;\n        onRead(events);\n    });\n    return null;\n}\n\n/**\n * The inspector pane, as `BuilderFrame` draws it — see the module docs.\n *\n * @param props - Whether it is given, the kinds, the resources, the canvas's facts, the counts, the keys, the words, what is selected, the selected events, the resources the rail shows and the ids the viewer hides\n * @returns The pane — 320px wide, its collapsed state kept per viewer, its rail saying what is selected — or `undefined`, no pane, when the Plan is given no inspector\n */\nexport function usePlanInspector({\n    shown, kinds, resources, chrome, counts, keys, words, selection, events, shownResources, hidden,\n}: PlanInspectorProps): BuilderFrameDock | undefined {\n    const { m } = words;\n    // No `inspector`: no pane (#1197).\n    if (!shown) return undefined;\n    const row = selection.row !== null ? chrome?.inspect.row(selection.row) : undefined;\n    // The rail's line: what is selected.\n    const detail = events.length === 1 ? events[0]!.item.title\n        : events.length > 1 ? m.inspectorEvents({ n: events.length, count: words.number(events.length) })\n            : row?.gutter.label;\n    return {\n        label: m.inspectorPane(),\n        icon: \"sliders\",\n        size: INSPECTOR_SIZE,\n        persist: \"local\",\n        detail,\n        body: (\n            <PlanInspectorBody selection={selection} events={events} kinds={kinds} resources={resources} chrome={chrome}\n                counts={counts} keys={keys} words={words} shownResources={shownResources} hidden={hidden} />\n        ),\n    };\n}\n\n/** Props of the pane's body and its views. */\ninterface BodyProps {\n    selection: PlanSelection;\n    events: readonly InspectedEvent[];\n    kinds: PlanValue[\"events\"];\n    resources: PlanValue[\"resources\"];\n    chrome: PlanChrome | undefined;\n    counts: PlanEventCounts | undefined;\n    keys: PlanKeys;\n    words: PlanWords;\n    /** The resources the rail shows, by resource kind (#1344). */\n    shownResources: PlanEventShownValue;\n    /** The ids the viewer hides in the Series tab. */\n    hidden: readonly string[];\n}\n\n/**\n * The pane's body: one event, several, a row, or nothing — in a region that keeps the keyboard as a control goes with its\n * view, on the heading of the view drawn in its place (see the module docs).\n */\nconst PlanInspectorBody = memo(function PlanInspectorBody(props: BodyProps) {\n    const styles = useSlotRecipe({ key: \"planInspector\" })() as Styles;\n    const home = useFocusHome();\n    return (\n        <Box ref={home.ref} css={styles.home} onFocus={home.onFocus} onBlur={home.onBlur} data-inspector-home=\"\">\n            {bodyView(props, styles)}\n        </Box>\n    );\n});\n\n/** What the body shows: one event, several, a row, or nothing. */\nfunction bodyView(props: BodyProps, styles: Styles): ReactNode {\n    const { selection, events, chrome } = props;\n    // Each event its own view: what one showed never lands on the next.\n    if (events.length === 1) return <OneEvent key={events[0]!.key} {...props} styles={styles} event={events[0]!} />;\n    if (events.length > 1) return <SeveralEvents {...props} styles={styles} />;\n    if (selection.row !== null && chrome !== undefined) {\n        const row = chrome.inspect.row(selection.row);\n        if (row !== undefined) return <RowView key={row.key} {...props} styles={styles} chrome={chrome} rowKey={row.key} at={selection.at} />;\n    }\n    return <NothingSelected styles={styles} counts={props.counts} words={props.words} />;\n}\n\n// ============================================================================\n// Words\n// ============================================================================\n\n/**\n * When an event runs, as its head says it — its day and times, an instant's\n * one time, or that it waits in the backlog.\n *\n * @param item - The event\n * @param instant - Whether its kind's events are each one instant\n * @param w - The Plan's words\n * @returns `Mon, Oct 5, 2026 · 06:00–14:00`\n */\nfunction whenText(item: PlanEventItemValue, instant: boolean, w: PlanWords): string {\n    const start = getSomeorUndefined(item.start);\n    const end = getSomeorUndefined(item.end);\n    if (start === undefined || end === undefined) return w.m.inspectorUnscheduled();\n    if (instant) return w.m.inspectorWhen({ day: w.weekdayDate(start), from: w.time(start), endDay: undefined, to: undefined });\n    return spanText(start, end, w);\n}\n\n/**\n * A span as the inspector says it — its day and times, its end's day too\n * when it ends on another.\n *\n * @param start - When it starts\n * @param end - When it ends\n * @param w - The Plan's words\n * @returns `Tue, Oct 20, 2026 · 10:00–12:00`\n */\nfunction spanText(start: Date, end: Date, w: PlanWords): string {\n    const day = w.weekdayDate(start);\n    const endDay = w.weekdayDate(end);\n    return w.m.inspectorWhen({ day, from: w.time(start), endDay: stringEqual(endDay, day) ? undefined : endDay, to: w.time(end) });\n}\n\n// ============================================================================\n// Overlaps (#1198, PB53)\n// ============================================================================\n\n/** The glyph an overlaps banner leads with. */\nconst OVERLAP_ICON = { prefix: \"fas\", name: \"triangle-exclamation\" } as const;\n\n/** One line of an overlaps banner: the events it selects, when, and what. */\ninterface OverlapLine {\n    /** The events a click selects, by their elements' keys. */\n    readonly keys: readonly string[];\n    /** When: the event's span, or the pair's overlap. */\n    readonly when: string;\n    /** What: the event's title, or the pair's. */\n    readonly title: string;\n}\n\n/**\n * An overlaps banner — the shared `Banner` in its guard tone, as the\n * Calendar's inspector draws it (§8): its title, and a line per event or pair,\n * each a button that selects what it names and brings it into view.\n */\nfunction OverlapsBanner({ styles, title, lines, onSelect }: {\n    styles: Styles; title: string; lines: readonly OverlapLine[]; onSelect: (keys: readonly string[]) => void;\n}) {\n    return (\n        <Box css={styles.overlaps} data-inspector-overlaps=\"\">\n            <BannerView status=\"guard\" icon={OVERLAP_ICON} title={title} description={(\n                <Box as=\"ul\" css={styles.overlapList}>\n                    {lines.map((line) => {\n                        const at = line.keys.join(\" \");\n                        return (\n                            <Box as=\"li\" key={at} css={styles.overlapLine}>\n                                <chakra.button type=\"button\" css={styles.overlapItem} data-inspector-overlap={at} onClick={() => onSelect(line.keys)}>\n                                    <Box as=\"span\" css={styles.overlapWhen}>{line.when}</Box>\n                                    <Box as=\"span\" css={styles.overlapTitle}>{line.title}</Box>\n                                </chakra.button>\n                            </Box>\n                        );\n                    })}\n                </Box>\n            )} />\n        </Box>\n    );\n}\n\n/**\n * A resource by its name: its kind's row of that key, else its key.\n *\n * @param ref - The resource an event is on, if any\n * @param resources - The resources the pane names, by their kind and key\n * @param w - The Plan's words\n * @returns Its name, or `Unassigned`\n */\nfunction resourceText(ref: PlanEventItemValue[\"resource\"], resources: PlanResourceLookup, w: PlanWords): string {\n    const at = getSomeorUndefined(ref);\n    if (at === undefined) return w.m.inspectorUnassigned();\n    return resources(at)?.label ?? at.key;\n}\n\n/**\n * The one resource a view names, as the pane reads it by its key: the same\n * array while it names the same one, so its read is not asked again.\n *\n * @param ref - The resource, if any\n * @returns It, alone; none for none\n */\nfunction useNamedResource(ref: PlanResourceRefValue | undefined): readonly PlanResourceRefValue[] {\n    const text = ref === undefined ? undefined : printResource(ref);\n    return useMemo(() => {\n        if (text === undefined) return NO_RESOURCES_NAMED;\n        const read = parseResource(text);\n        return read.success ? [read.value] : NO_RESOURCES_NAMED;\n    }, [text]);\n}\n\n/** How long minutes run, in hours to one place — `26.5`. */\nfunction hoursText(minutes: number, w: PlanWords): string {\n    return w.number(Math.round(minutes / 6) / 10);\n}\n\n// ============================================================================\n// The edits (#1194, PB42, PB60)\n// ============================================================================\n\n/** No key a gesture has made yet. */\nconst NONE_MINTED: ReadonlySet<string> = new Set();\n\n/** What a new event's form is tinted against: nothing — every field it has is a change. */\nconst NEW_EVENT: Readonly<Record<string, unknown>> = {};\n\n/** Whether two field paths are one. */\nfunction samePath(a: readonly string[], b: readonly string[]): boolean {\n    return a.length === b.length && a.every((step, i) => stringEqual(step, b[i]!));\n}\n\n/** A gesture's label in the history, over one event or several — canonical English, as every history's labels are. */\nfunction labelOf(verb: string, events: readonly InspectedEvent[]): string {\n    return events.length === 1 ? `${verb} ${events[0]!.item.title}` : `${verb} ${events.length} events`;\n}\n\n/**\n * Whether every event can be duplicated: its kind's keys are ones a new key\n * is made of (String or Integer).\n */\nfunction canDuplicate(events: readonly InspectedEvent[], editing: PlanEventEditing | undefined): boolean {\n    return editing !== undefined && events.every((event) => editing.mint(event.kind.key, event.item.key, NONE_MINTED) !== undefined);\n}\n\n/**\n * Duplicate: a copy of each event under a new key, its row as drafted — one\n * transaction — and the copies then selected, on the row given.\n *\n * @param events - The events\n * @param editing - The event kinds' editing\n * @param chrome - The canvas's facts: what selects the copies\n * @param row - The row the copies are selected on: the selection's\n */\nfunction duplicateEvents(events: readonly InspectedEvent[], editing: PlanEventEditing | undefined, chrome: PlanChrome | undefined, row: RowKey | null): void {\n    if (editing === undefined) return;\n    const minted = new Set<string>();\n    const changes: PlanEventChange[] = [];\n    const copies: string[] = [];\n    for (const event of events) {\n        const id = editing.mint(event.kind.key, event.item.key, minted);\n        if (id === undefined) continue;\n        minted.add(id);\n        // A copy is a new event: absent before it, read nowhere (#1199).\n        changes.push({ kind: event.kind.key, id, row: event.row, created: true });\n        copies.push(printRef({ kind: event.kind.key, key: id }));\n    }\n    if (editing.record(changes, \"insert\", labelOf(\"Duplicate\", events))) chrome?.selectEvents(copies, row ?? undefined);\n}\n\n/**\n * Delete: each event, as one transaction.\n *\n * @param events - The events\n * @param editing - The event kinds' editing\n * @param chrome - The canvas's selection commands\n */\nfunction deleteEvents(events: readonly InspectedEvent[], editing: PlanEventEditing | undefined, chrome: PlanChrome | undefined): void {\n    if (removePlanEvents(events.map(event => event.key), editing, labelOf(\"Delete\", events))) chrome?.selectEvents([]);\n}\n\n// ============================================================================\n// One event (PB38, PB60)\n// ============================================================================\n\n/** Props of {@link OneEvent}. */\ninterface OneEventProps extends BodyProps {\n    styles: Styles;\n    event: InspectedEvent;\n}\n\n/**\n * One fact: its label and its value. A fact a field of the event's row is drawn as — its quantity, its state, its lane,\n * which no control edits here — takes the keyboard where an issue gone to asks for that field (`focusable`): by script,\n * out of the tab order, named by its label and its value.\n */\nfunction Fact({ styles, label, value, fact, focusable = false }: { styles: Styles; label: string; value: ReactNode; fact: string; focusable?: boolean }) {\n    const id = useId();\n    return (\n        <>\n            <Box as=\"dt\" id={`${id}-label`} css={styles.factLabel}>{label}</Box>\n            <Box as=\"dd\" id={`${id}-value`} css={styles.factValue} data-fact={fact}\n                {...(focusable ? { tabIndex: -1, \"aria-labelledby\": `${id}-label ${id}-value` } : {})}>{value}</Box>\n        </>\n    );\n}\n\n/**\n * Gives the keyboard to a fact an issue gone to asks for, as the form gives it to a field it draws: at once where it\n * shows, else once it does — the browser gives it to nothing hidden, and a change of an element around the fact (the\n * pane unfolded) is when it may show — and brings it into view.\n *\n * @param fact - The fact's value\n * @returns What stops the wait, while it waits; `undefined` once the fact has the keyboard\n */\nfunction takeFactWhenShown(fact: HTMLElement): (() => void) | undefined {\n    const take = (): boolean => {\n        if (typeof fact.checkVisibility === \"function\" && !fact.checkVisibility()) return false;\n        fact.focus({ preventScroll: true });\n        fact.scrollIntoView?.({ block: \"nearest\", inline: \"nearest\" });\n        return true;\n    };\n    if (take()) return undefined;\n    const observer = new MutationObserver((records) => {\n        if (records.some((record) => record.target.contains(fact)) && take()) observer.disconnect();\n    });\n    observer.observe(fact.ownerDocument.documentElement, { attributes: true, subtree: true });\n    return () => observer.disconnect();\n}\n\n/**\n * The fact a field is drawn as among an event's facts, where a role reads it.\n *\n * @param roles - The fields its kind's roles read\n * @param field - The field, by its form's key\n * @returns Its fact; `undefined` for a field no role reads, which its form draws\n */\nfunction roleFactOf(roles: PlanEventKindValue[\"roles\"], field: string): \"quantity\" | \"state\" | \"lane\" | undefined {\n    const reads = (role: option<string>) => role.type === \"some\" && stringEqual(role.value, field);\n    return reads(roles.quantity) ? \"quantity\" : reads(roles.state) ? \"state\" : reads(roles.lane) ? \"lane\" : undefined;\n}\n\n/** One event: its head, its overlaps, its facts, its fields or its kind's own inspector, and its gestures. */\nfunction OneEvent({ event, resources, keys, words, styles, counts, chrome, selection }: OneEventProps) {\n    const { m } = words;\n    const button = useRecipe({ key: \"button\" });\n    const { kind } = event;\n    const item = event.item;\n    const roles = kind.roles;\n    // Its edits (#1194): steps of the Plan's one history, on while the canvas takes a write and its kind a gesture.\n    const editing = chrome?.events;\n    const writable = writableFor([event], editing, chrome?.writable === true);\n    // What its gestures ask as they land — this render's — so the kind's own inspector, handed `update`, is not made\n    // again as the edits turn off and on.\n    const writes = useRef(writable);\n    writes.current = writable;\n    // What it overlaps (#1198, PB53): its kind's events on its resource at once — a line each, which selects it.\n    const peers = counts?.overlaps.peers.get(event.key) ?? [];\n    const start = getSomeorUndefined(item.start);\n    const end = getSomeorUndefined(item.end);\n    const lane = getSomeorUndefined(item.lane);\n    const quantity = getSomeorUndefined(item.quantity);\n    const status = getSomeorUndefined(item.status);\n    // Its resource by name — a paged kind's read by its key (#1199).\n    const named = useNamedResource(getSomeorUndefined(item.resource));\n    const resourceRows = usePlanResourceRows(resources, named);\n\n    // Its row, held by its data: a read that brings the same row again draws nothing new.\n    const row = useDataStable(event.row, blobEqual);\n    const rowType = useMemo(() => fromEastTypeValue(kind.editing.entryType) as StructType, [kind.editing.entryType]);\n    const value = useMemo(() => decodeBeast2For(rowType)(row), [rowType, row]);\n    // The kind's form, but the fields its roles read: each has its own line here.\n    const specs = useMemo(() => {\n        const roleFields = [roles.state, roles.quantity, roles.lane].flatMap((field) => (field.type === \"some\" ? [field.value] : []));\n        return kind.fields.filter((spec) => !roleFields.some((field) => stringEqual(field, spec.path[0]!)));\n    }, [kind.fields, roles]);\n    // The bound its quantity breaks, of those a hint gives its field in the kind's form (#1585): said on a line of its own\n    // under it, as the form's help line says one.\n    const quantityBreach = useMemo(() => {\n        const field = getSomeorUndefined(roles.quantity);\n        return field === undefined ? undefined : fieldBreaches(kind.fields.filter((spec) => samePath(spec.path, [field])), value)[0];\n    }, [kind.fields, roles.quantity, value]);\n    const fieldStyles = useSlotRecipe({ key: \"field\" })() as Styles;\n    // What its record holds (PB42): what a drafted field is tinted against — a new event's every field, against\n    // nothing. An event its drafts do not hold stands as its record holds it (#1199: a kind read a window at a time\n    // holds no snapshot to read it from).\n    const drafted = editing?.draftsOf(kind.key).has(item.key) === true;\n    const held = editing?.held(kind.key, item.key) ?? (drafted ? NEW_EVENT : value);\n    // Its refusals holding Save (#1525): the app's `ready` refusing it while it stands, each field one names ringed, the\n    // app's words for it under it.\n    const refusals = scheduleRefusals(editing?.sessions ?? []).filter((r) => stringEqual(r.kind, kind.key) && stringEqual(r.issue.entry, item.key));\n    const refused = refusals.length === 0 ? NO_REFUSED_FIELDS : refusedFields(refusals.map((r) => r.issue));\n    // What they say of a field a role reads, under its fact, which is where the Plan draws it — less the bound its\n    // quantity breaks, which its fact's own line says: a readiness raises a breach as an issue in the bound's words.\n    const factIssue = (role: option<string>, bound?: (typeof quantityBreach)): ReactNode => {\n        if (role.type !== \"some\") return null;\n        const bounds = bound === undefined ? [] : [fieldBreachIssue(bound, { entry: item.key }).message, fieldBreachText(bound, { ...words, m: fieldFormMessages })];\n        const said = (refused.get(role.value) ?? []).filter((line) => !bounds.some((text) => stringEqual(text, line)));\n        return said.length === 0 ? null : <Box css={fieldStyles.helperText} data-field-issue=\"\" data-fact-issue=\"\">{said.join(\" · \")}</Box>;\n    };\n    // A bound its row breaks (#1585), said in the tone its Save stands in: a row as stored warns, holding no Save; a\n    // changed one's is refused, holding Save — an error.\n    const breaches = refusals.length > 0 ? \"error\" : \"warn\";\n    const focus = useFieldAsk(kind.key, item.key);\n    // A field asked of it that a role reads takes the keyboard on its fact, which is its line in Details: the form leaves\n    // the field to the facts, and draws no control of it to take it.\n    const asked = focus === undefined ? undefined : roleFactOf(roles, focus);\n    const facts = useRef<HTMLDivElement | null>(null);\n    const taking = useRef<(() => void) | undefined>(undefined);\n    useEffect(() => {\n        if (asked === undefined) return;\n        taking.current?.();\n        const fact = facts.current?.querySelector<HTMLElement>(`[data-fact=\"${asked}\"]`);\n        taking.current = fact === null || fact === undefined ? undefined : takeFactWhenShown(fact);\n    }, [asked]);\n    useEffect(() => () => taking.current?.(), []);\n    // The form's draws: one more each time an edit records nothing, so its fields show what the row holds again.\n    const [redraws, setRedraws] = useState(0);\n    // A field edited (PB42): one transaction, written through the kind's own `write`, its value as bytes at the field's type.\n    // One that records nothing — the edits off meanwhile, the write turning it down, nothing changed — draws the form\n    // again, with nothing to say (#1585).\n    const onField = useCallback((path: readonly string[], next: unknown) => {\n        const spec = specs.find((s) => samePath(s.path, path));\n        if (editing === undefined || spec === undefined) return;\n        const value = encodeBeast2For(spec.type)(next as never);\n        if (!writes.current || !editing.record([{ kind: kind.key, id: item.key, gesture: variant(\"field\", { path: [...path], value }) }], \"typed\", labelOf(\"Edit\", [event]))) {\n            setRedraws((n) => n + 1);\n        }\n    }, [editing, specs, kind.key, item.key, event]);\n    // The kind's own inspector's `update` (PB60): the edited event, whole, one transaction — none while the edits are off,\n    // whatever control of the kind's own the fieldset does not reach.\n    const update = useCallback((edited: Uint8Array): null => {\n        if (writes.current) editing?.record([{ kind: kind.key, id: item.key, row: edited }], \"typed\", labelOf(\"Edit\", [event]));\n        return null;\n    }, [editing, kind.key, item.key, event]);\n    // The kind's own inspector (PB60): what it returns for the event, in place of the form.\n    const author = getSomeorUndefined(kind.inspector);\n    const own = useMemo(() => {\n        if (author === undefined) return undefined;\n        try {\n            return author(row, update);\n        } catch (err) {\n            console.error(`[Plan] ${kind.name}'s own inspector failed; its form shows instead:`, err);\n            return undefined;\n        }\n    }, [author, row, kind.name, update]);\n\n    return (\n        <Box css={styles.root} data-plan-inspector=\"event\">\n            <ScheduleInspectorHead styles={styles} kind={kind} title={item.title} when={whenText(item, kind.instant, words)} status={status} home />\n            {/* Under the head, as the Calendar's inspector has it (§8) — and out\n                of the edits' fieldset, so its lines select while that is disabled. */}\n            {peers.length > 0 && chrome !== undefined && (\n                <OverlapsBanner styles={styles}\n                    title={m.inspectorOverlaps({ n: peers.length, count: words.number(peers.length), on: resourceText(item.resource, resourceRows, words) })}\n                    lines={peers.map((peer) => ({ keys: [scheduleEventKey(peer)], when: whenText(peer, kind.instant, words), title: peer.title }))}\n                    onSelect={chrome.selectEvents} />\n            )}\n            {/* Over its form, as the Calendar's inspector shows an event's: each refusal's field by its form's label. */}\n            {refusals.length > 0 && (\n                <Box css={styles.refusals} data-inspector-refusals=\"\">\n                    <BannerView status=\"warning\" title={m.inspectorRefusals()} description={refusals.map((r) => refusalText(r.issue, kind.fields)).join(\"; \")} />\n                </Box>\n            )}\n            <Box as=\"dl\" ref={facts} css={styles.facts} data-inspector-facts=\"\">\n                <Fact styles={styles} fact=\"resource\" label={m.inspectorFact({ fact: \"resource\" })} value={resourceText(item.resource, resourceRows, words)} />\n                {start !== undefined && end !== undefined && (kind.instant\n                    ? <Fact styles={styles} fact=\"at\" label={m.inspectorFact({ fact: \"at\" })} value={words.dateTime(start)} />\n                    : (\n                        <>\n                            <Fact styles={styles} fact=\"start\" label={m.inspectorFact({ fact: \"start\" })} value={words.dateTime(start)} />\n                            <Fact styles={styles} fact=\"end\" label={m.inspectorFact({ fact: \"end\" })} value={words.dateTime(end)} />\n                        </>\n                    ))}\n                {lane !== undefined && <Fact styles={styles} fact=\"lane\" label={m.inspectorFact({ fact: \"lane\" })} value={<>{lane}{factIssue(roles.lane)}</>} focusable />}\n                {roles.state.type === \"some\" && <Fact styles={styles} fact=\"state\" label={m.inspectorFact({ fact: \"state\" })} value={<>{stateText(item.state, words)}{factIssue(roles.state)}</>} focusable />}\n                {quantity !== undefined && <Fact styles={styles} fact=\"quantity\" label={m.inspectorFact({ fact: \"quantity\" })} focusable value={<>\n                    {quantityText(quantity, words)}\n                    {/* A line of its own, in the form's help line's style and the tone its Save stands in. */}\n                    {quantityBreach !== undefined && (\n                        <Box css={fieldStyles.helperText} data-breach={breaches} data-fact-breach=\"\">{fieldBreachText(quantityBreach, { ...words, m: fieldFormMessages })}</Box>\n                    )}\n                    {factIssue(roles.quantity, quantityBreach)}\n                </>} />}\n            </Box>\n            <chakra.fieldset css={styles.edits} disabled={!writable} data-inspector-edits=\"\">\n                {own !== undefined ? (\n                    <Box css={styles.fields} data-inspector-fields=\"custom\">\n                        <Box css={styles.custom}>\n                            <EastChakraComponent value={own} storageKey={`${keys.frame}.inspector.${kind.key}`} />\n                        </Box>\n                    </Box>\n                ) : specs.length > 0 && (\n                    <Box css={styles.fields} data-inspector-fields=\"form\">\n                        <FieldForm key={redraws} specs={specs} value={value} baseline={held} issues={refused} focus={focus} breaches={breaches}\n                            onChange={editing !== undefined ? onField : NO_EDIT} />\n                    </Box>\n                )}\n                <Box css={styles.actions} data-inspector-actions=\"\">\n                    <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={!canDuplicate([event], editing)}\n                        data-inspector-action=\"duplicate\" onClick={() => { if (writes.current) duplicateEvents([event], editing, chrome, selection.row); }}>\n                        {m.inspectorAction({ action: \"duplicate\" })}\n                    </chakra.button>\n                    <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} data-inspector-action=\"delete\"\n                        onClick={() => { if (writes.current) deleteEvents([event], editing, chrome); }}>\n                        {m.inspectorAction({ action: \"delete\" })}\n                    </chakra.button>\n                </Box>\n            </chakra.fieldset>\n        </Box>\n    );\n}\n\n// ============================================================================\n// Several events (PB39)\n// ============================================================================\n\n/** Props of {@link SeveralEvents}. */\ninterface SeveralProps extends BodyProps {\n    styles: Styles;\n}\n\n/** Several events: how many, each kind's count, the list, and the bulk edit. */\nfunction SeveralEvents({ events, kinds, resources, words, styles, chrome, selection, shownResources }: SeveralProps) {\n    const { m } = words;\n    const button = useRecipe({ key: \"button\" });\n    // Its edits (#1194): steps of the Plan's one history, on while the canvas takes a write and every selected kind a gesture.\n    const editing = chrome?.events;\n    const writable = writableFor(events, editing, chrome?.writable === true);\n    // Each kind's count, in the kinds' order.\n    const counted = kinds\n        .map((kind) => ({ kind, n: events.filter((e) => stringEqual(e.kind.key, kind.key)).length }))\n        .filter(({ n }) => n > 0);\n    const selectedKinds = counted.map(({ kind }) => kind);\n    // The bulk edit's state and resource, as the form draws a choice and a reference: each an\n    // Option — Not set where the events differ — its spec's type the Option, as the form reads one.\n    const specs = useMemo((): FieldSpecValue[] => {\n        const out: FieldSpecValue[] = [];\n        if (selectedKinds.some((kind) => kind.roles.state.type === \"some\")) {\n            out.push({\n                path: [\"state\"], label: m.inspectorFact({ fact: \"state\" }), help: none, group: none,\n                type: toEastTypeValue(OptionType(STATE_CHOICE)), optional: true,\n                editor: variant(\"select\", STATES.map((state) => ({ case: state, label: m.state({ state }) }))),\n            });\n        }\n        if (selectedKinds.some((kind) => kind.takes.length > 0)) {\n            out.push({\n                path: [\"resource\"], label: m.inspectorFact({ fact: \"resource\" }), help: none, group: none,\n                type: toEastTypeValue(OptionType(StringType)), optional: true, editor: variant(\"reference\", { of: \"resource\" }),\n            });\n        }\n        return out;\n    }, [selectedKinds, m]);\n    // The resources the selected kinds are placed on: each its kind's rows, by name — a paged kind lists none (#1199).\n    // Of a kind the rail narrows, the ones its source shows, and those the selected events are on (#1344).\n    const options = useMemo(() => {\n        const slots = selectedKinds.flatMap((kind) => kind.takes);\n        const placed = resources.filter((r: PlanResourceKindValue) => slots.some((slot) => stringEqual(slot, r.key)));\n        const on = (kind: string, key: string): boolean => events.some((e) => {\n            const at = getSomeorUndefined(e.item.resource);\n            return at !== undefined && stringEqual(at.kind, kind) && stringEqual(at.key, key);\n        });\n        return {\n            resource: placed.flatMap((r) => {\n                const keys = shownResources.get(r.key);\n                return r.rows\n                    .filter((row) => keys === undefined || keys.has(row.key) || on(r.key, row.key))\n                    .map((row): FieldOption => ({ key: printResource({ kind: r.key, key: row.key }), label: row.label }));\n            }),\n        };\n    }, [selectedKinds, resources, shownResources, events]);\n    // The form's value: the state, and the resource, every selected event that has one shares — Not set where they differ.\n    const shared = useMemo(() => {\n        const states = events.filter((e) => e.kind.roles.state.type === \"some\").map((e) => stateWordOf(e.item.state));\n        const refs = events.filter((e) => e.kind.takes.length > 0).map((e) => e.item.resource);\n        const first = refs[0];\n        return {\n            state: states.length > 0 && states.every((word) => stringEqual(word, states[0]!)) ? some(variant(states[0]!, null)) : none,\n            resource: first !== undefined && first.type === \"some\" && refs.every((ref) => resourceEqual(ref, first)) ? some(printResource(first.value)) : none,\n        };\n    }, [events]);\n    // The bulk form's draws: one more each time a choice records nothing, so its fields show what the events share again.\n    const [redraws, setRedraws] = useState(0);\n    // The bulk edit (PB39): over every selected event that takes it, across kinds, one transaction. A choice that records\n    // nothing — the edits off meanwhile, Not set, the kinds' own writes turning it down — draws the form again, with\n    // nothing to say (#1585).\n    const onBulk = useCallback((path: readonly string[], next: unknown) => {\n        const recorded = (): boolean => {\n            if (editing === undefined || !writable) return false;\n            if (samePath(path, [\"state\"])) {\n                // A state chosen: written into each event whose kind reads one, at its state field.\n                const chosen = getSomeorUndefined(next as option<ValueTypeOf<typeof STATE_CHOICE>>);\n                if (chosen === undefined) return false;\n                const value = encodeState(stateOfWord(chosen.type as PlanStateWord));\n                const changes = events.flatMap((e): PlanEventChange[] => {\n                    const field = e.kind.roles.state;\n                    return field.type === \"some\" ? [{ kind: e.kind.key, id: e.item.key, gesture: variant(\"field\", { path: [field.value], value }) }] : [];\n                });\n                return editing.record(changes, \"typed\", labelOf(\"Set the state of\", events));\n            }\n            if (samePath(path, [\"resource\"])) {\n                // A resource chosen, or none: each scheduled event whose kind is placed on its kind, moved onto it, its times kept.\n                const chosen = getSomeorUndefined(next as option<string>);\n                const read = chosen === undefined ? undefined : parseResource(chosen);\n                if (read !== undefined && !read.success) return false;\n                const ref = read === undefined ? none : some(read.value);\n                const changes = events.flatMap((e): PlanEventChange[] => {\n                    const start = getSomeorUndefined(e.item.start);\n                    const end = getSomeorUndefined(e.item.end);\n                    if (start === undefined || end === undefined) return [];\n                    if (ref.type === \"some\" && !e.kind.takes.some((slot) => stringEqual(slot, ref.value.kind))) return [];\n                    return [{ kind: e.kind.key, id: e.item.key, gesture: variant(\"place\", { start, end, resource: ref }) }];\n                });\n                return editing.record(changes, \"move\", labelOf(\"Move\", events));\n            }\n            return false;\n        };\n        if (!recorded()) setRedraws((n) => n + 1);\n    }, [editing, events, writable]);\n    // A shift in time (PB39): every scheduled event a day or an hour either way, on its resource, one transaction.\n    const shift = (by: -1 | 1, unit: \"day\" | \"hour\") => {\n        if (editing === undefined || !writable) return;\n        const ms = by * (unit === \"day\" ? 86_400_000 : 3_600_000);\n        const changes = events.flatMap((e): PlanEventChange[] => {\n            const start = getSomeorUndefined(e.item.start);\n            const end = getSomeorUndefined(e.item.end);\n            if (start === undefined || end === undefined) return [];\n            const place = { start: new Date(start.getTime() + ms), end: new Date(end.getTime() + ms), resource: e.item.resource };\n            return [{ kind: e.kind.key, id: e.item.key, gesture: variant(\"place\", place) }];\n        });\n        editing.record(changes, \"move\", labelOf(\"Shift\", events));\n    };\n    return (\n        <Box css={styles.root} data-plan-inspector=\"events\">\n            <Box css={styles.head} {...FOCUS_HOME_PROPS}>\n                <Box css={styles.summary} data-inspector-several=\"\">{m.inspectorEvents({ n: events.length, count: words.number(events.length) })}</Box>\n                <Box css={styles.marks}>\n                    {counted.map(({ kind, n }) => (\n                        <Box as=\"span\" key={kind.key} css={styles.chip} data-inspector-kind-count={kind.key}>\n                            {m.inspectorKindCount({ kind: kind.name, n, count: words.number(n) })}\n                        </Box>\n                    ))}\n                </Box>\n            </Box>\n            <Box as=\"ul\" css={styles.list} data-inspector-list=\"\">\n                {events.map((event) => (\n                    <Box as=\"li\" key={event.key} css={styles.listItem} data-inspector-event={event.key}>\n                        <FontAwesomeIcon icon={[\"fas\", event.kind.icon as IconName]} />\n                        <Box css={styles.listText}>\n                            <Box as=\"span\" css={styles.listTitle}>{event.item.title}</Box>\n                            <Box as=\"span\" css={styles.listWhen}>{whenText(event.item, event.kind.instant, words)}</Box>\n                        </Box>\n                    </Box>\n                ))}\n            </Box>\n            <chakra.fieldset css={styles.edits} disabled={!writable} data-inspector-edits=\"\">\n                <Box css={styles.bulk} data-inspector-bulk=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"bulk\" })}</Box>\n                    {specs.length > 0 && <FieldForm key={redraws} specs={specs} value={shared} options={options} onChange={onBulk} />}\n                    <Box css={styles.shift} role=\"group\" aria-label={m.inspectorShiftLabel()} data-inspector-shift=\"\">\n                        {([[-1, \"day\"], [-1, \"hour\"], [1, \"hour\"], [1, \"day\"]] as const).map(([by, unit]) => (\n                            <chakra.button key={`${by}${unit}`} type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })}\n                                data-inspector-action={`shift:${by}${unit}`} onClick={() => shift(by, unit)}>\n                                {m.inspectorShift({ by, unit })}\n                            </chakra.button>\n                        ))}\n                    </Box>\n                </Box>\n                <Box css={styles.actions} data-inspector-actions=\"\">\n                    <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={!canDuplicate(events, editing)}\n                        data-inspector-action=\"duplicate\" onClick={() => { if (writable) duplicateEvents(events, editing, chrome, selection.row); }}>\n                        {m.inspectorAction({ action: \"duplicate\" })}\n                    </chakra.button>\n                    <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} data-inspector-action=\"delete\"\n                        onClick={() => { if (writable) deleteEvents(events, editing, chrome); }}>\n                        {m.inspectorAction({ action: \"delete\" })}\n                    </chakra.button>\n                </Box>\n            </chakra.fieldset>\n        </Box>\n    );\n}\n\n// ============================================================================\n// A row (PB40)\n// ============================================================================\n\n/** What a row stands for: a resource, an event kind's events on none, or neither. */\ntype RowTarget =\n    | { readonly kind: \"resource\"; readonly resources: PlanResourceKindValue; readonly key: string; readonly path: readonly string[] }\n    | { readonly kind: \"unassigned\"; readonly event: PlanEventKindValue }\n    | { readonly kind: \"row\" };\n\n/** The ways an event kind draws on a resource's rows. */\nconst DRAWS: readonly string[] = [\"span\", \"buckets\", \"cards\", \"marks\"];\n\n/**\n * What a row on the canvas stands for, by its id — the series a Plan gives its\n * event kinds' rows (e3-ui's `event-rows.ts`): a resource kind's row of a way\n * its kinds draw (`<slot>.<draw>`) or of one of its measures (the measure's\n * key), at the resource's path; an event kind's Unassigned row\n * (`<kind>.unassigned`); or any other.\n *\n * @param series - The row's series\n * @param path - The row's path: its resource's key last\n * @param kinds - The event kinds\n * @param resources - The resource kinds\n * @returns What it stands for\n */\nfunction targetOf(series: string, path: readonly string[], kinds: PlanValue[\"events\"], resources: PlanValue[\"resources\"]): RowTarget {\n    const key = path[path.length - 1];\n    if (key !== undefined) {\n        const owner = resources.find((r) => DRAWS.some((draw) => stringEqual(series, `${r.key}.${draw}`))\n            || r.measures.some((measure) => stringEqual(measure, series)));\n        if (owner !== undefined) return { kind: \"resource\", resources: owner, key, path };\n    }\n    const lost = kinds.find((k) => stringEqual(series, `${k.key}.unassigned`));\n    return lost !== undefined ? { kind: \"unassigned\", event: lost } : { kind: \"row\" };\n}\n\n/** No kind named. */\nconst NO_NAMES: readonly string[] = [];\n\n/** A row's events in the window: how many, how long, and their quantities — and the kinds counted none of. */\ninterface WindowFacts {\n    /** Whether any kind on the row is counted: the figures below are theirs. */\n    readonly counted: boolean;\n    readonly events: number;\n    readonly minutes: number;\n    readonly quantities: readonly PlanQuantityValue[];\n    /** The kinds on the row past the cap (#1039): none of their events is read, so the row counts none of them, and says so. */\n    readonly uncounted: readonly PlanEventKindValue[];\n}\n\n/** A `time` instant's Date; `undefined` for an instant of another arm. */\nfunction timeOf(t: PlanScale[\"window\"][\"min\"]): Date | undefined {\n    return t.type === \"time\" ? t.value : undefined;\n}\n\n/** A row's facts on their way (#1398, CL13): the cells its kinds are read by have not landed for its resource. */\nconst ROW_LOADING = \"loading\";\n\n/**\n * The events in the window a row stands for — a resource's, or an event\n * kind's on no resource — read through the kinds, their drafts in place,\n * tracked. A kind the cells' reader gives cells (#1039) reads them from what\n * its cells hold — every event of a row on screen — never over the window,\n * and while the reader holds none for the row's resource — scrolled out of the\n * blocks read, or before the first read lands — the row's facts are on their\n * way, never 0, until its cells land. A kind past the cap, none of whose\n * events is read, is counted on no row: the row says it is not counted, never\n * 0. A kind hidden in the Series tab is no part of what the canvas shows: in\n * no figure, and nothing says so. Every other kind — each is counted before it\n * is read — is read over the window only once its count over the range the\n * canvas reads is within the cap.\n *\n * @param target - What the row stands for\n * @param kinds - The event kinds\n * @param scale - The shared scale: its window\n * @param drafts - Every kind's drafts (#1194) — the same object while they hold\n * @param cells - The kinds' cells and counts, when the reader decides a kind\n * @param hidden - The ids the viewer hides in the Series tab\n * @returns The facts, or {@link ROW_LOADING} while its cells are on their way; `undefined` for a row that stands for no events, and before the first read answers\n */\nfunction useWindowFacts(\n    target: RowTarget, kinds: PlanValue[\"events\"], scale: PlanScale, drafts: EventDrafts, cells: ScheduleCellsRead | undefined, hidden: readonly string[],\n): WindowFacts | typeof ROW_LOADING | undefined {\n    const from = timeOf(scale.window.min);\n    const to = timeOf(scale.window.max);\n    // The range the canvas reads: what a kind is capped over.\n    const range = eventReadRange(scale);\n    const readFrom = range?.from.getTime();\n    const readTo = range?.to.getTime();\n    const read = useCallback((): WindowFacts | typeof READING | typeof ROW_LOADING | undefined => {\n        if (target.kind === \"row\" || from === undefined || to === undefined || readFrom === undefined || readTo === undefined) return undefined;\n        const on = target.kind === \"resource\" ? some({ kind: target.resources.key, key: target.key }) : undefined;\n        let counted = false;\n        let events = 0;\n        let minutes = 0;\n        const quantities: PlanQuantityValue[] = [];\n        const uncounted: PlanEventKindValue[] = [];\n        for (const kind of kinds) {\n            if (target.kind === \"resource\" ? !kind.takes.some((slot) => stringEqual(slot, target.resources.key)) : !stringEqual(kind.key, target.event.key)) continue;\n            // Hidden in the Series tab: no part of what the canvas shows — in no figure, and nothing says so.\n            if (hides(hidden, planHideId.events(kind.key))) continue;\n            // Past the cap: none of its events is read, so the row counts none of them — not counted, never 0.\n            if (cells?.capped.has(kind.key) === true) {\n                uncounted.push(kind);\n                continue;\n            }\n            const held = cells?.reads.get(kind.key);\n            // Read by its cells, which the reader holds none of for this resource — scrolled out of the blocks read, or\n            // not landed yet: its figures are on their way, never 0 (#1398, CL13).\n            if (held !== undefined && !cells!.windowed.has(kind.key) && target.kind === \"resource\" && cells!.drawn !== undefined && !cells!.drawn.has(target.key)) return ROW_LOADING;\n            // Every kind is counted before it is read: given no cells, it is read over the window once it is within the cap.\n            if (held === undefined) {\n                const within = scheduleWithinCap(kind.count, new Date(readFrom), new Date(readTo));\n                if (within.type !== \"some\" || !within.value) return READING;\n            }\n            const kindDrafts = (held === undefined ? drafts : cells!.drafts).get(kind.key) ?? NO_DRAFTS;\n            const items = kind.planItems(from, to, kindDrafts, held === undefined ? none : some(held));\n            if (items.type === \"none\") return READING;\n            counted = true;\n            for (const item of items.value) {\n                if (on !== undefined ? !resourceEqual(item.resource, on) : item.resource.type !== \"none\") continue;\n                events += 1;\n                minutes += Number(item.minutes);\n                const quantity = getSomeorUndefined(item.quantity);\n                if (quantity !== undefined) quantities.push(quantity);\n            }\n        }\n        return { counted, events, minutes, quantities, uncounted };\n    }, [target, kinds, from, to, readFrom, readTo, drafts, cells, hidden]);\n    const { result } = useTrackedEvaluation(read);\n    // The last facts read — or that they are on their way — held while a read is in flight or failed.\n    const held = useRef<WindowFacts | typeof ROW_LOADING | undefined>(undefined);\n    return useMemo(() => {\n        if (!result.ok) {\n            console.error(\"[Plan] the row's events could not be read:\", result.error);\n            return held.current;\n        }\n        if (result.value === READING) return held.current;\n        held.current = result.value;\n        return result.value;\n    }, [result]);\n}\n\n/** Props of {@link RowView}. */\ninterface RowProps extends BodyProps {\n    styles: Styles;\n    chrome: PlanChrome;\n    rowKey: RowKey;\n    at: PlanInstantValue | null;\n}\n\n/** A row: a resource's name, lines and group, its overlaps, its events in the window and its measures at a bucket — or an Unassigned row's events, or what any other row draws at a bucket. */\nfunction RowView({ rowKey, at, kinds, resources, chrome, counts, words, styles, hidden }: RowProps) {\n    const { m } = words;\n    const { inspect, scale } = chrome;\n    const row = inspect.row(rowKey)!;\n    const id = row.id.value;\n    const target = useMemo(() => targetOf(id.series, id.path, kinds, resources), [id, kinds, resources]);\n    const facts = useWindowFacts(target, kinds, scale, chrome.events?.drafts ?? NONE_DRAFTED, chrome.cells, hidden);\n    // Its overlaps (#1198, PB40): the pairs on its resource in the window, a line each, which selects the pair.\n    const on = target.kind === \"resource\" ? some({ kind: target.resources.key, key: target.key }) : undefined;\n    const pairs = on === undefined ? [] : (counts?.overlaps.pairs ?? []).filter((pair) => resourceEqual(pair.first.resource, on));\n    // Its resource: a listed kind's row, or a paged kind's read by its key (#1199).\n    const named = useNamedResource(on?.value);\n    const resourceRows = usePlanResourceRows(resources, named);\n    const resource = on !== undefined ? resourceRows(on.value) : undefined;\n    const group = resource !== undefined ? getSomeorUndefined(resource.group) : undefined;\n    const lines = resource !== undefined ? [getSomeorUndefined(resource.sub), getSomeorUndefined(resource.meta)].filter((line): line is string => line !== undefined) : [];\n    const bucketIndex = at !== null ? scale.bucketOf(at) : -1;\n    const bucket = bucketIndex >= 0 ? scale.buckets[bucketIndex] : undefined;\n    // The measures under a resource, at its path; any other row's own value.\n    const measures = target.kind === \"resource\"\n        ? target.resources.measures.flatMap((measure) => {\n            const key = rowKeyOf(variant(\"entry\", { series: measure, path: [...target.path] }) as typeof row.id);\n            const measured = inspect.row(key);\n            return measured === undefined ? [] : [{ key: measure, label: measured.gutter.label, rowKey: key }];\n        })\n        : target.kind === \"row\" ? [{ key: row.key, label: row.gutter.label, rowKey: row.key }] : [];\n    const title = target.kind === \"resource\" ? resource?.label ?? target.key\n        : target.kind === \"unassigned\" ? m.inspectorUnassigned() : row.gutter.label;\n    const eyebrow = target.kind === \"resource\" ? target.resources.name : target.kind === \"unassigned\" ? target.event.name : m.inspectorRow();\n    return (\n        <Box css={styles.root} data-plan-inspector=\"row\">\n            <Box css={styles.head} {...FOCUS_HOME_PROPS}>\n                <Box css={styles.eyebrow} data-inspector-kind=\"\">{eyebrow}</Box>\n                <Box css={styles.name} data-inspector-title=\"\">{title}</Box>\n                {lines.map((line, i) => <Box key={i} css={styles.when} data-inspector-line=\"\">{line}</Box>)}\n                {group !== undefined && (\n                    <Box css={styles.marks}>\n                        <Box as=\"span\" css={styles.chip} data-inspector-group=\"\">{group}</Box>\n                    </Box>\n                )}\n            </Box>\n            {pairs.length > 0 && (\n                <OverlapsBanner styles={styles}\n                    title={m.inspectorRowOverlaps({ n: pairs.length, count: words.number(pairs.length) })}\n                    lines={pairs.map((pair) => ({\n                        keys: [scheduleEventKey(pair.first), scheduleEventKey(pair.second)],\n                        when: spanText(pair.from, pair.to, words),\n                        title: m.inspectorOverlapPair({ first: pair.first.title, second: pair.second.title }),\n                    }))}\n                    onSelect={chrome.selectEvents} />\n            )}\n            {facts === ROW_LOADING ? (\n                // Its cells on their way (#1398, CL13): each figure a placeholder in its place, never 0, until they land.\n                <Box as=\"dl\" css={styles.facts} data-inspector-window=\"\" aria-busy=\"true\">\n                    <Fact styles={styles} fact=\"events\" label={m.inspectorFact({ fact: \"events\" })} value={<PlaceholderShape kind=\"number\" index={0} />} />\n                    <Fact styles={styles} fact=\"hours\" label={m.inspectorFact({ fact: \"hours\" })} value={<PlaceholderShape kind=\"number\" index={1} />} />\n                </Box>\n            ) : facts !== undefined && facts.counted && (\n                <Box as=\"dl\" css={styles.facts} data-inspector-window=\"\">\n                    <Fact styles={styles} fact=\"events\" label={m.inspectorFact({ fact: \"events\" })} value={words.number(facts.events)} />\n                    <Fact styles={styles} fact=\"hours\" label={m.inspectorFact({ fact: \"hours\" })} value={hoursText(facts.minutes, words)} />\n                    {facts.quantities.length > 0 && (\n                        <Fact styles={styles} fact=\"quantities\" label={m.inspectorFact({ fact: \"quantities\" })} value={totalsText(totalsByUnit(facts.quantities), words)} />\n                    )}\n                </Box>\n            )}\n            {/* The kinds the row counts none of (#1039): past the cap, none of their events read — said so, never 0. */}\n            {facts !== undefined && facts !== ROW_LOADING && facts.uncounted.length > 0 && (\n                <Box css={styles.hint} data-inspector-not-counted=\"\">{m.inspectorNotCounted({ kinds: facts.uncounted.map((kind) => kind.name), hours: NO_NAMES })}</Box>\n            )}\n            {measures.length > 0 && (\n                <Box css={styles.measures} data-inspector-measures=\"\">\n                    <Box css={styles.sectionHead}>{bucket !== undefined ? m.inspectorAt({ bucket: scale.bucketText(bucket) }) : m.inspectorSection({ section: \"measures\" })}</Box>\n                    {bucket === undefined || at === null\n                        ? <Box css={styles.hint} data-inspector-no-bucket=\"\">{m.inspectorNoBucket()}</Box>\n                        : (\n                            <Box as=\"dl\" css={styles.facts} data-inspector-at=\"\">\n                                {measures.map((measure) => (\n                                    <Fact key={measure.key} styles={styles} fact={`measure:${measure.key}`} label={measure.label}\n                                        value={inspect.valueAt(measure.rowKey, at) ?? m.inspectorNoValue()} />\n                                ))}\n                            </Box>\n                        )}\n                </Box>\n            )}\n        </Box>\n    );\n}\n\n// ============================================================================\n// Nothing selected (PB41)\n// ============================================================================\n\n/** Nothing selected: the window's counts, and three hints. */\nfunction NothingSelected({ styles, counts, words }: { styles: Styles; counts: PlanEventCounts | undefined; words: PlanWords }) {\n    const { m } = words;\n    const touch = useContext(FrameDrawer);\n    const stats = counts === undefined ? [] : [\n        // A kind whose events are not counted (#1039) is in no count: where no kind's are, there is none.\n        ...(counts.events !== undefined ? [{ stat: \"events\" as const, n: counts.events, text: words.number(counts.events) }] : []),\n        // The hours of the kinds read — where no kind's are, none; a kind read by its cells counts its hours over the rows\n        // drawn (#1039), and the stat says so.\n        ...(counts.minutes !== undefined\n            ? [{ stat: counts.drawn ? \"hoursInView\" as const : \"hours\" as const, n: counts.minutes, text: hoursText(counts.minutes, words) }] : []),\n        ...(counts.backlog !== undefined ? [{ stat: \"backlog\" as const, n: counts.backlog, text: words.number(counts.backlog) }] : []),\n    ];\n    return (\n        // No heading: the view is its own home, where the keyboard lands as the control it was on goes (#1398).\n        <Box css={styles.root} data-plan-inspector=\"none\" {...FOCUS_HOME_PROPS}>\n            {stats.length > 0 && (\n                <Box css={styles.stats} data-inspector-counts=\"\">\n                    {stats.map(({ stat, n, text }) => (\n                        <Box key={stat} css={styles.stat} data-count={stat}>\n                            <Box as=\"span\" css={styles.statValue}>{text}</Box>\n                            <Box as=\"span\" css={styles.statLabel}>{m.inspectorStat({ stat, n })}</Box>\n                        </Box>\n                    ))}\n                </Box>\n            )}\n            {/* The kinds whose events in the window are not counted, and those whose hours are not (#1039): said so in one\n                line, never 0. */}\n            {counts !== undefined && (counts.uncounted.length > 0 || counts.hoursNotCounted.length > 0) && (\n                <Box css={styles.hint} data-inspector-not-counted=\"\">\n                    {m.inspectorNotCounted({ kinds: counts.uncounted.map((kind) => kind.name), hours: counts.hoursNotCounted.map((kind) => kind.name) })}\n                </Box>\n            )}\n            <Box as=\"ul\" css={styles.hints}>\n                {touch ? <Box as=\"li\" css={styles.hint}>{m.inspectorHintTouch()}</Box>\n                    : ([1, 2, 3] as const).map((n) => <Box as=\"li\" key={n} css={styles.hint}>{m.inspectorHint({ n })}</Box>)}\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraPlan` — the Plan (#1193, `Plan Builder Spec.md` §7, §7.1, §8,\n * PB19–PB25): the one Plan, laid out in `BuilderFrame` wherever it is used.\n * There is no other Plan: no canvas without the frame, and no toolbar but its\n * one.\n *\n * The canvas (`usePlanCanvas`, `../canvas.tsx`) hands the frame main and the\n * facts its chrome is drawn from, and the frame places them in its regions:\n *\n * - **the toolbar** — the Plan's items (`usePlanToolbarItems`) on the frame's\n *   one folding row, in §7.1's order: the slice's narrowing, the scope badge,\n *   the key search, the grain, the slice's range, the resolution and the\n *   diagnostics; at the row's end the summary, the overlaps chip and the\n *   history item, which leaves its error to the banners. A Plan with none\n *   of them has no toolbar. ⌘Z undoes and ⇧⌘Z or ⌘Y redoes from anywhere in\n *   the frame, never while typing;\n * - **the history** (#1194) — one history across `data`'s editing session\n *   and each event kind's, a session per kind over its record: the history\n *   item's Undo and Redo step through the gestures in the order they were\n *   made whatever their source, its Discard drops every source's drafts, and\n *   its Save commits each source with a change as its own request;\n * - **the banners** — each session's (`SessionBanners`), an event kind's\n *   titled with its name: a Save's conflict, naming its rows or its events and\n *   who changed the record last; a refusal, with its reasons; a write with no\n *   answer, with Retry, which resends that source's request; a Save whose\n *   result could not be read back, with Retry; and the drafts the source moved\n *   under, with Discard, which drops that source's. Each leaves when what it\n *   reports does;\n * - **main** — the canvas, unchanged: the horizon brush, the ruler and the\n *   now line, the pinned rows, the rows — or, below 480px of main, the\n *   narrow layout's tabs and cards — the links and the overlays;\n * - **the footer** — the event kinds' counts (the events in the window, the\n *   backlog, and when a kind's record was last saved; \"…\" until their first\n *   read lands, never 0), the changes waiting on Save, the author's items, and\n *   the shared loading line, which says what of a paged source the view waits\n *   for, and a read of the event kinds' rows that failed, in the kinds' words,\n *   with Retry (#1398) — live under the cold-load skeleton, which covers\n *   the rest of the frame at the rows' pitch until the source's first window\n *   lands; after it a read in flight covers nothing, and main is busy. The\n *   line and the runs' placeholders show on the Plan's one reveal clock\n *   (`LoadingReveal`, CL4);\n * - **the overlaps** (#1198, PB51–PB53) — read with the counts: two events of\n *   a kind that warns of them, on one resource at once. Each event in a pair\n *   wears the warn ring on the canvas, the toolbar's chip counts the pairs and\n *   selects the first, and the inspector's banner lists what the selected\n *   event overlaps. They never block Save;\n * - **the panes** — the library in the start pane when the Plan's `library`\n *   lists a tab (#1195, `library.tsx`) — an author's tab's cards dragging onto\n *   the rows that take a card (#1259) or onto an event of their patch's kind,\n *   the templates and the backlog's events onto the event kinds' rows, and an\n *   event back onto the Backlog tab (#1196) — and the inspector in the end pane when\n *   it is given `inspector` — what is selected on the canvas (#1197,\n *   `inspector.tsx`): optional props, no prop, no pane. Their open tab and\n *   collapsed state persist under the Plan's `id` (`planKeys(id).frame`,\n *   PB25).\n *\n * What a viewer hides in the library's Series tab persists under the Plan's\n * `id` too (`planKeys(id).series`, PB29, `hidden.ts`), and only while the\n * library lists that tab, as nothing else could show it again: the event\n * kinds' rows leave it out through the `blocks` seam, and the canvas leaves\n * out the Plan's own `rows` it hides. What it switches of `data`'s picked\n * series is kept under the pick's own key (`pick.<key>`), and goes back into\n * the pick when the Plan mounts: the pick's state lives in the page's store,\n * which a reload empties. An event kind hidden there is in none of\n * the canvas's figures — the footer's counts and the inspector's — and nothing\n * says so (#1039).\n *\n * The narrowing is the Plan's one `Slice.bindRecords` (#1344): the canvas\n * reads its `rows` source and each event kind's through their parts\n * (`root/sources.ts`), and a paged resource kind's, whose windows are its\n * narrowing's rows; the frame follows the others itself through the shared\n * `FollowSources` — each resource kind's read whole, whose shown resources\n * are the rows its kind draws and the bulk edit's Chooser offers, each\n * templates list's, and each an author's tab names. A source whose narrowing could not\n * be read says so in a banner, with Retry, as a window that could not be\n * written does; a resource kind's narrowing resolving keeps the rows it\n * showed, busy. After a Save, the footer says what left each source's\n * narrowing. What the event kinds read — the footer's counts, the overlaps,\n * the backlog and what the rail hides of it — and the selected events are\n * each read in a component of their own (`PlanKindsReader`,\n * `PlanSelectionReader`), which hand the frame what they read only when it\n * moves: a kind narrowed through an interval index lands some fifty-five key\n * searches a window, and each would otherwise render the whole frame.\n *\n * A declared `style.height` / `maxHeight` is the whole Plan's: the frame\n * takes it, and the canvas fills main. Without one, the frame fills its\n * parent when the parent gives it a height, the canvas filling main, and\n * grows with its canvas when the parent grows with what it holds. The Plan\n * draws no border of its own.\n *\n * @packageDocumentation\n */\n\nimport { Fragment, memo, useCallback, useLayoutEffect, useMemo, useRef, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { Box, Button, useSlotRecipe } from \"@chakra-ui/react\";\nimport { SortedMap, StringType, compareFor, equalFor, equivalentFor, none, type ValueTypeOf } from \"@elaraai/east\";\nimport { Plan, PlanComponent, PlanEventBlocksType, PlanEventPagedType, PlanPayloadType, planKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, BuilderFrame, SessionBanners, getSomeorUndefined, historyShortcut, implementUIComponent, takeKey, typedInto, useDataStable, usePersistedState,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingReveal, keptRead } from \"@elaraai/east-ui-components/internal\";\nimport { FollowSources, type FollowedSources } from \"../../shared/schedule/follow-sources.js\";\nimport type { KeyVisibilityWords } from \"../../shared/schedule/visibility.js\";\nimport { usePlanCanvas } from \"../canvas.js\";\nimport { usePlanSelector } from \"../controller/react.js\";\nimport { removePlanEvents } from \"../edit/events.js\";\nimport type { PlanCanvasParts } from \"../root/chrome.js\";\nimport { ALL_SHOWN, type PlanEventRows, type PlanEventShownValue } from \"../root/events.js\";\nimport { ROWS_SOURCE, planFollowedSources, planNouns, type PlanEventPart } from \"../root/sources.js\";\nimport { usePlanToolbarItems } from \"../shell/Toolbar.js\";\nimport { PlanFooter, type PlanSaveNotice } from \"../shell/Footer.js\";\nimport type { PlanRootValue } from \"../model.js\";\nimport { PlanOverlapsContext } from \"../rows/element-overlap.js\";\nimport { usePlanWords, useResolvedPlanWords } from \"../words.js\";\nimport { PlanVocabularyProvider } from \"../messages.js\";\nimport { PlanKindsReader, type PlanBacklogEntry, type PlanKindsRead, type PlanOverlaps } from \"./counts.js\";\nimport { NONE_HIDDEN, hiddenOf, hides, rowsHiddenOf } from \"./hidden.js\";\nimport { NO_INSPECTED, PlanSelectionReader, usePlanInspector, usePlanInspectorSelection, type PlanInspectedEvent } from \"./inspector.js\";\nimport { tabLibrary, usePlanLibrary, type PlanPickValue } from \"./library.js\";\n\n/** The Plan's payload, decoded — what `<Plan>` returns through the `Plan` carrier (#1191). */\nexport type PlanValue = ValueTypeOf<typeof PlanPayloadType>;\n\n/** The Plan's event kinds, as its payload carries them (#1190). */\ntype PlanEventKinds = PlanValue[\"events\"];\n\n/** The Plan's resource kinds, as its payload carries them (#1190). */\ntype PlanResourceKinds = PlanValue[\"resources\"];\n\n/** The library pane's tabs, as the payload lists them (#1195). */\ntype PlanLibraryTabs = PlanValue[\"library\"];\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n// The memo compares CLOSURES too (#809). A Plan root is function-heavy — the\n// resolvers, the element callbacks, a paged source's `page` wrapping its\n// series — and `equalFor` calls every pair of functions equal, so a root that\n// differed only inside one (a resolver over new data, a series `match` over a\n// new threshold) was dropped and the canvas rendered the old closures.\nconst planRootEqual = equivalentFor(Plan.Types.Root);\n/** Whether two event-rows seams read the same rows: their functions by their IR and what they capture (#809). */\nconst eventBlocksEquivalent = equivalentFor(PlanEventBlocksType);\n/** Whether two paged kinds' seams read the same rows (#1199), likewise. */\nconst eventPagedEquivalent = equivalentFor(PlanEventPagedType);\n/** Whether two lists of event kinds read the same records, their seams compared by their IR and what they capture. */\nconst eventKindsEquivalent = equivalentFor(PlanPayloadType.fields.events);\n/** The payload's equivalence: its data, and its functions by their IR and what they capture (#809). */\nconst planPayloadEqual = equivalentFor(PlanPayloadType);\n/** Whether two sets of the app's words are one. */\nconst vocabularyEqual = equalFor(PlanPayloadType.fields.vocabulary);\n\n/** No event kinds: a Plan of `data` and `rows` alone. */\nconst NO_KINDS: PlanEventKinds = [];\n\n/** No resource kinds. */\nconst NO_RESOURCES: PlanResourceKinds = [];\n\n/** No library: no pane. */\nconst NO_LIBRARY: PlanLibraryTabs = [];\n\n/** Whether two libraries list the same tabs and cards: they hold data alone. */\nconst libraryEqual = equalFor(PlanPayloadType.fields.library);\n/** Whether two lists of resource kinds name the same resources — a paged kind's read by key (#1199) by its IR and what it captures. */\nconst resourcesEquivalent = equivalentFor(PlanPayloadType.fields.resources);\n/** Whether two drop vetoes are one: by their IR and what they capture (#809). */\nconst canDropEquivalent = equivalentFor(PlanPayloadType.fields.canDrop);\n\n/** The event kinds' drop veto, when the payload has one. */\ntype PlanEventCanDrop = PlanValue[\"canDrop\"];\n\n/** No veto: every drop the event kinds take lands. */\nconst NO_VETO: PlanEventCanDrop = none;\n\n/** No event kind has an event on the canvas. */\nconst NO_PATCH_KINDS: ReadonlySet<string> = new Set();\n\n/** Whether two event-rows props read the same rows — a paged kind's included (#1199). */\nfunction sameEventRows(a: PlanEventRows | undefined, b: PlanEventRows | undefined): boolean {\n    if (a === undefined || b === undefined) return a === b;\n    return a.count === b.count && eventBlocksEquivalent(a.blocks, b.blocks)\n        && (a.paged === undefined || b.paged === undefined\n            ? a.paged === undefined && b.paged === undefined\n            : eventPagedEquivalent(a.paged, b.paged));\n}\n\n/** No event in an overlap pair. */\nconst NO_OVERLAPS: ReadonlySet<string> = new Set();\n\n/** No source of the slice the frame follows. */\nconst NONE_FOLLOWED: FollowedSources = new Map();\n\n/** No event kind narrowed through a source of the slice. */\nconst NO_PARTS: readonly PlanEventPart[] = [];\n\n/** No Save notice: a Plan whose slice has no source a Save could move records out of. */\nconst NO_NOTICES: readonly PlanSaveNotice[] = [];\n\n/** What the event kinds read before their first read answers: no counts, and the rail hides nothing of the backlog. */\nconst NOTHING_READ: PlanKindsRead = { counts: undefined, backlog: { narrowing: [], hidden: undefined, counting: false, clear: undefined }, retained: false };\n\n/** No unscheduled event: a Plan with no event kinds. */\nconst NO_UNSCHEDULED: readonly PlanBacklogEntry[] = [];\n\nconst compareString = compareFor(StringType);\nconst stringEqual = equalFor(StringType);\n\n/**\n * Test-only render probe — lets \"a landing key search re-renders the event kinds' reader, never the frame\" be asserted\n * deterministically (#1344), as the Calendar's is. `undefined` outside tests.\n */\nlet planFrameRenderProbe: (() => void) | undefined;\n\n/**\n * Install (or clear) the test frame render probe. Test use only.\n *\n * @param fn - Called each time the frame renders; `undefined` clears it\n */\nexport function setPlanFrameRenderProbe(fn: (() => void) | undefined): void {\n    planFrameRenderProbe = fn;\n}\n\n/**\n * The resources the rail shows (#1344): by each resource kind whose source\n * narrows, the keys its source shows — the same object while each source's\n * keys stand, so the event kinds' rows are read again only when one moves.\n *\n * @param resources - The resource kinds\n * @param followed - What each source the frame follows shows\n * @returns The shown resources, by resource kind; none narrowed, {@link ALL_SHOWN}\n */\nfunction useShownResources(resources: PlanResourceKinds, followed: FollowedSources): PlanEventShownValue {\n    const held = useRef<{ entries: readonly (readonly [string, Set<string>])[]; shown: PlanEventShownValue }>({ entries: [], shown: ALL_SHOWN });\n    return useMemo(() => {\n        const entries = resources.flatMap((kind) => {\n            const keys = followed.get(kind.key)?.shown.keys;\n            return keys === undefined || keys.type === \"none\" ? [] : [[kind.key, keys.value] as const];\n        });\n        const was = held.current;\n        const same = entries.length === was.entries.length\n            && entries.every(([slot, keys], i) => stringEqual(slot, was.entries[i]![0]) && Object.is(keys, was.entries[i]![1]));\n        if (same) return was.shown;\n        const shown: PlanEventShownValue = entries.length === 0 ? ALL_SHOWN : new SortedMap(entries.map(([slot, keys]): [string, Set<string>] => [slot, keys]), compareString);\n        held.current = { entries, shown };\n        return shown;\n    }, [resources, followed]);\n}\n\n/**\n * The events in an overlap pair, by their elements' keys (#1198) — the same\n * set while its members hold, so a read that moved no pair renders no element.\n *\n * @param overlaps - The overlaps among the window's events\n * @returns The keys of every event in a pair\n */\nfunction useOverlapKeys(overlaps: PlanOverlaps | undefined): ReadonlySet<string> {\n    const held = useRef(NO_OVERLAPS);\n    return useMemo(() => {\n        const next = overlaps === undefined || overlaps.peers.size === 0 ? NO_OVERLAPS : new Set(overlaps.peers.keys());\n        const prev = held.current;\n        if (next.size === prev.size && [...next].every((key) => prev.has(key))) return prev;\n        held.current = next;\n        return next;\n    }, [overlaps]);\n}\n\n/** Props of {@link EastChakraPlan}. */\nexport interface EastChakraPlanProps {\n    /** The Plan root value: the canvas whole. */\n    value: PlanRootValue;\n    /** Storage key prefix for persisting component state. */\n    storageKey: string;\n    /** The event kinds' rows (#1192), drawn ahead of the root's own — a Plan of event kinds' payload carries them. */\n    events?: PlanEventRows | undefined;\n    /** The event kinds themselves (#1190), which the footer counts and the library lists — a Plan of event kinds' payload carries them. */\n    kinds?: PlanEventKinds | undefined;\n    /** The resource kinds (#1190), which the library's cards name — a Plan of event kinds' payload carries them. */\n    resources?: PlanResourceKinds | undefined;\n    /** The library pane's tabs (#1195) — the payload carries them; none, no pane. */\n    library?: PlanLibraryTabs | undefined;\n    /** Whether the Plan has its inspector pane (#1197) — the payload carries it; left out, no pane. */\n    inspector?: boolean | undefined;\n    /** The event kinds' drop veto (#1196) — the payload carries it: where a drop would put an event, to the refusal's message. */\n    canDrop?: PlanEventCanDrop | undefined;\n    /** What each source of the slice the frame follows shows (#1344) — each resource kind's, templates list's and tab's; none, a Plan whose payload follows none. */\n    followed?: FollowedSources | undefined;\n    /** The app's optimiser (#1409) — the payload carries its binding: what the Elara eye calls by name; none, no eye. */\n    optimise?: { readonly name: string } | undefined;\n    /** Whether the Plan's Autosave begins on — the payload carries its author's word; left out, off. */\n    autosave?: boolean | undefined;\n}\n\n/**\n * Renders the Plan in its frame — see the module docs.\n *\n * @param props - The root, its storage key, the event kinds and their rows, the resource kinds, the library's tabs, whether it has its inspector, the event kinds' drop veto, what each source the frame follows shows, and whether its Autosave begins on\n * @returns The Plan, in its frame\n */\nexport const EastChakraPlan = memo(function EastChakraPlan({\n    value, storageKey, events, kinds, resources, library: given, inspector, canDrop, followed = NONE_FOLLOWED, optimise, autosave,\n}: EastChakraPlanProps) {\n    const library = useDataStable(given ?? NO_LIBRARY, libraryEqual);\n    const id = getSomeorUndefined(value.id);\n    const keys = useMemo(() => planKeys(id), [id]);\n    // What this viewer hides in the Series tab (PB29), kept under the Plan's\n    // id: a Plan without the tab hides none — nothing on it could show them\n    // again, and another Plan under the same id may have hidden them.\n    const { state: stored, setState: store } = usePersistedState<readonly string[]>(keys.series, NONE_HIDDEN, keptRead.texts);\n    const series = useMemo(() => library.find((tab) => tab.type === \"series\"), [library]);\n    const hidden = useMemo(() => (series !== undefined ? hiddenOf(stored) : NONE_HIDDEN), [series, stored]);\n    const onHidden = useCallback((next: readonly string[]) => { store(next); }, [store]);\n    const rowsHidden = useMemo(\n        () => (series !== undefined && series.type === \"series\" ? rowsHiddenOf(series.value, hidden) : undefined),\n        [series, hidden]);\n    // An event kind's element selects its event (#1197).\n    const eventKinds = useMemo(() => (kinds ?? NO_KINDS).map((kind) => kind.key), [kinds]);\n    // The panel's own tabs whose cards land on the rows (#1259): the author's.\n    const panel = useMemo(() => library.flatMap((tab) => (tab.type === \"tab\" ? [tabLibrary(keys, tab.value)] : [])), [library, keys]);\n    // Each event kind a session over its record, under one history with `data`'s (#1194), its drags on the canvas (#1196).\n    const veto = useMemo(() => getSomeorUndefined(canDrop ?? NO_VETO), [canDrop]);\n    // Each resource kind's rows its source shows (#1344): what its kind draws, and the bulk edit's Chooser offers.\n    const resourceKinds = resources ?? NO_RESOURCES;\n    const shown = useShownResources(resourceKinds, followed);\n    // A resource kind's narrowing resolving, or failed: the rows it showed stay, busy.\n    const busy = resourceKinds.some((kind) => followed.get(kind.key)?.shown.busy === true);\n    const canvas = usePlanCanvas({\n        value, storageKey, events, hidden, rowsHidden, eventKinds, panel, kinds: kinds ?? NO_KINDS,\n        resources: resourceKinds, tabs: library, canDrop: veto, shown, busy, optimise, autosave: autosave === true,\n    });\n    return <>{canvas.provide(\n        <PlanFrame canvas={canvas} root={value} kinds={kinds ?? NO_KINDS} resources={resourceKinds} library={library}\n            inspector={inspector === true} hidden={hidden} onHidden={onHidden} followed={followed} shown={shown} />,\n    )}</>;\n}, (prev, next) => planRootEqual(prev.value, next.value) && prev.storageKey === next.storageKey\n    && (prev.followed ?? NONE_FOLLOWED) === (next.followed ?? NONE_FOLLOWED)\n    && (prev.inspector === true) === (next.inspector === true)\n    && (prev.autosave === true) === (next.autosave === true)\n    && (prev.optimise === undefined ? next.optimise === undefined : next.optimise !== undefined && stringEqual(prev.optimise.name, next.optimise.name))\n    && (Object.is(prev.canDrop, next.canDrop) || canDropEquivalent(prev.canDrop ?? NO_VETO, next.canDrop ?? NO_VETO))\n    && sameEventRows(prev.events, next.events)\n    && (prev.kinds === next.kinds || eventKindsEquivalent(prev.kinds ?? NO_KINDS, next.kinds ?? NO_KINDS))\n    && (prev.resources === next.resources || resourcesEquivalent(prev.resources ?? NO_RESOURCES, next.resources ?? NO_RESOURCES))\n    && (prev.library === next.library || libraryEqual(prev.library ?? NO_LIBRARY, next.library ?? NO_LIBRARY)));\n\n/** Props of {@link PlanFrame}. */\ninterface PlanFrameProps {\n    /** What the canvas hands its frame. */\n    canvas: PlanCanvasParts;\n    /** The Plan root value: its axis's now, and its pick over `data`'s series. */\n    root: PlanRootValue;\n    /** The Plan's event kinds — none for a Plan of `data` and `rows` alone. */\n    kinds: PlanEventKinds;\n    /** Its resource kinds. */\n    resources: PlanResourceKinds;\n    /** The library pane's tabs; none, no pane. */\n    library: PlanLibraryTabs;\n    /** Whether the Plan has its inspector pane. */\n    inspector: boolean;\n    /** The ids this viewer hides in the Series tab. */\n    hidden: readonly string[];\n    /** Replaces them. */\n    onHidden: (next: readonly string[]) => void;\n    /** What each source of the slice the frame follows shows (#1344). */\n    followed: FollowedSources;\n    /** The resources the rail shows, by resource kind (#1344). */\n    shown: PlanEventShownValue;\n}\n\n/**\n * The canvas's pick over `data`'s series, kept for the viewer while the\n * library lists the Series tab (PB29): the pick's state lives in the page's\n * store, which a reload empties, so what the tab writes into it is kept under\n * the pick's key as well, and goes back into the pick when the Plan mounts —\n * before it paints, so the series open as the viewer left them. An id the pick\n * no longer lists is dropped on the way back; a pick the tab never wrote opens\n * as its program sets it.\n *\n * @param pick - The canvas's own pick, when `data`'s series are picked\n * @param listed - Whether the library lists the Series tab\n * @returns The pick, what the tab writes into it kept\n */\nfunction useKeptPick(pick: PlanPickValue | undefined, listed: boolean): PlanPickValue | undefined {\n    const { state: kept, setState: keep } = usePersistedState<readonly string[] | undefined>(`pick.${pick?.key ?? \"\"}`, undefined, keptRead.texts);\n    // Once for each pick: after that the tab writes both.\n    const restored = useRef<string | undefined>(undefined);\n    useLayoutEffect(() => {\n        if (!listed || pick === undefined || (restored.current !== undefined && stringEqual(restored.current, pick.key))) return;\n        restored.current = pick.key;\n        if (kept === undefined) return;\n        const ids = pick.items.map((item) => item.id);\n        const back = hiddenOf(kept).filter((id) => hides(ids, id));\n        const now = pick.state.read();\n        if (back.length !== now.length || back.some((id) => !hides(now, id))) pick.state.write([...back]);\n    }, [listed, pick, kept]);\n    return useMemo(() => (!listed || pick === undefined ? pick : {\n        ...pick,\n        state: { ...pick.state, write: (next: string[]) => { keep(next); return pick.state.write(next); } },\n    }), [listed, pick, keep]);\n}\n\n/** The frame, its regions holding the canvas and its chrome — inside the canvas's contexts. */\nfunction PlanFrame({ canvas, root, kinds, resources, library, inspector, hidden, onHidden, followed, shown }: PlanFrameProps) {\n    planFrameRenderProbe?.();\n    const { chrome, main, bound, vars } = canvas;\n    const recipe = useSlotRecipe({ key: \"plan\" });\n    const styles = useMemo(() => recipe() as unknown as Styles, [recipe]);\n    const id = getSomeorUndefined(root.id);\n    const keys = useMemo(() => planKeys(id), [id]);\n    const words = usePlanWords();\n    const { m } = words;\n    // The backlog's weeks count from the axis's now, or from the clock when the Plan mounted.\n    const [mounted] = useState(() => new Date());\n    const now = root.axis.type === \"time\" ? getSomeorUndefined(root.axis.value.now) ?? mounted : mounted;\n    const given = useMemo((): PlanPickValue | undefined => getSomeorUndefined(root.pick), [root.pick]);\n    const pick = useKeptPick(given, library.some((tab) => tab.type === \"series\"));\n    // What the event kinds read, counted with every kind's drafts in place (#1194) — the counts, the overlaps, the\n    // backlog — and what the rail hides of the backlog (#1344), held with its cards (#1398), reported by a component of\n    // its own.\n    const [kindsRead, setKindsRead] = useState<PlanKindsRead>(NOTHING_READ);\n    const counts = kinds.length > 0 ? kindsRead.counts : undefined;\n    const start = usePlanLibrary({\n        library, kinds, resources, pick, keys, hidden, onHidden, now, words, takesCards: chrome?.takesCards === true,\n        // A Plan with no event kinds reads no backlog: there is nothing to wait for.\n        unscheduled: kinds.length === 0 ? NO_UNSCHEDULED : counts?.unscheduled,\n        takesEvents: chrome?.takesEvents === true, patchKinds: chrome?.patchKinds ?? NO_PATCH_KINDS,\n        followed, backlogNarrowing: kindsRead.backlog, backlogRetained: kinds.length > 0 && kindsRead.retained, backlogFlash: chrome?.optimise?.backlogFlash,\n    });\n    // The overlaps (#1198): the toolbar's chip, the warn rings, the inspector's banner.\n    const overlaps = counts?.overlaps;\n    const items = usePlanToolbarItems(chrome, overlaps);\n    const overlapKeys = useOverlapKeys(overlaps);\n    // What is selected, and the selected events, read by a component of their own (#1344).\n    const selection = usePlanInspectorSelection(inspector);\n    const [selected, setSelected] = useState<readonly PlanInspectedEvent[]>(NO_INSPECTED);\n    const end = usePlanInspector({ shown: inspector, kinds, resources, chrome, counts, keys, words, selection, events: selected, shownResources: shown, hidden });\n    // The Plan's one history (#1194): the history item reads it as one session.\n    const history = chrome?.history;\n    const session = history?.session;\n    const onAction = history?.onAction;\n    const selectedEvents = usePlanSelector(snapshot => snapshot.store.ui.elements);\n    const eventEditing = chrome?.events;\n    const selectEvents = chrome?.selectEvents;\n    // Delete writes only while the canvas takes a write: never while a run of the optimiser is out (R2), nor while what\n    // it shows stands in, retained (#1398, CL8).\n    const writable = chrome?.writable === true;\n    // The frame owns shortcuts even when no inspector is declared or its pane is collapsed; a key it acts on goes no\n    // further than the Plan (#1398).\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n        if (event.defaultPrevented || event.nativeEvent.isComposing || typedInto(event.target)) return;\n        const action = historyShortcut(event);\n        if (action !== undefined && onAction !== undefined) {\n            takeKey(event);\n            onAction(action);\n        } else if (!event.ctrlKey && !event.metaKey && !event.altKey && (event.key === \"Delete\" || event.key === \"Backspace\")\n            && writable && removePlanEvents(selectedEvents, eventEditing)) {\n            takeKey(event);\n            selectEvents?.([]);\n        }\n    }, [onAction, selectedEvents, eventEditing, selectEvents, writable]);\n    // A Plan with no control to show — no slice, no search, no group to fold, no overlaps, no editing — draws no toolbar.\n    const toolbar = items.some((item) => item !== undefined && item !== false) ? items : undefined;\n    // Each session's banners, in the history's order: `data`'s, then each event kind's, named — then each source the\n    // frame follows whose narrowing could not be read, with Retry, and a window that could not be written (#1344).\n    const bannerNodes: ReactNode[] = [];\n    // A run of the optimiser's banner first (#1409).\n    if (chrome?.optimise?.banner) bannerNodes.push(<Fragment key=\"optimise\">{chrome.optimise.banner}</Fragment>);\n    if (chrome !== undefined && history !== undefined) {\n        for (const held of chrome.sessions) {\n            bannerNodes.push(<SessionBanners key={held.key} session={held.session} words={chrome.words} onAction={held.onAction}\n                where={held.where} name={held.name} />);\n        }\n    }\n    for (const [source, followedSource] of followed) {\n        if (followedSource.error === undefined) continue;\n        bannerNodes.push(\n            <Box key={`source:${source}`} data-plan-banner=\"source\">\n                <BannerView status=\"error\" title={m.narrowingUnavailable({ name: followedSource.name })} description={followedSource.error}\n                    actions={<Button size=\"xs\" variant=\"outline\" onClick={followedSource.retry}>{m.retry()}</Button>} />\n            </Box>,\n        );\n    }\n    if (chrome?.windowError !== undefined) {\n        bannerNodes.push(\n            <Box key=\"window\" data-plan-banner=\"window\">\n                <BannerView status=\"error\" title={m.windowUnavailable({ axis: root.axis.type })} description={chrome.windowError} />\n            </Box>,\n        );\n    }\n    // A kind with more events in view than it draws, and no summary to shade them at this resolution (#1039): its rows\n    // hatched, and this — how many there are, or that they are not counted where its count is no number of them (a day\n    // index's), and the resolution its summary shades at.\n    for (const notice of chrome?.cells?.notices ?? []) {\n        const kind = notice.name.toLocaleLowerCase(words.locale);\n        bannerNodes.push(\n            <Box key={`cells:${notice.kind}`} data-plan-banner=\"cells\" data-plan-kind={notice.kind}>\n                <BannerView status=\"info\"\n                    title={notice.events === undefined ? m.tooManyEventsNotCounted({ kind })\n                        : m.tooManyEvents({ kind, n: notice.events, count: words.number(notice.events) })}\n                    description={m.tooManyEventsHint({ resolution: notice.resolution === undefined ? undefined : m.resolutionName({ resolution: notice.resolution }).toLocaleLowerCase(words.locale) })} />\n            </Box>,\n        );\n    }\n    const banners = bannerNodes.length > 0 ? <>{bannerNodes}</> : undefined;\n    // After a Save, what left each source's narrowing (#1344): the `rows` source's rows, each event kind's events.\n    const rowsPart = chrome?.rowsPart;\n    const eventParts = chrome?.eventParts ?? NO_PARTS;\n    const notices = useMemo((): readonly PlanSaveNotice[] => {\n        const out: PlanSaveNotice[] = [];\n        if (rowsPart !== undefined) {\n            out.push({ key: ROWS_SOURCE, slice: rowsPart, singular: m.saveNoticeNoun({ kind: undefined, n: 1 }), plural: m.saveNoticeNoun({ kind: undefined, n: 2 }) });\n        }\n        for (const { kind, part } of eventParts) {\n            const name = kind.name.toLocaleLowerCase(words.locale);\n            out.push({ key: kind.key, slice: part, singular: m.saveNoticeNoun({ kind: name, n: 1 }), plural: m.saveNoticeNoun({ kind: name, n: 2 }) });\n        }\n        return out.length === 0 ? NO_NOTICES : out;\n    }, [rowsPart, eventParts, m, words.locale]);\n    // What the footer's counts say before the event kinds' first read lands (#1398, CL13): \"…\", never 0.\n    const kindsUnread = kinds.length > 0 && kindsRead.counts === undefined;\n    const footer = chrome !== undefined\n        ? <PlanFooter styles={chrome.styles} items={chrome.footer} transport={chrome.transport} noun={chrome.rowsNoun}\n            counts={counts} unread={kindsUnread} pending={session?.pending} notices={notices}\n            optimise={chrome.optimise === undefined ? undefined : { line: chrome.optimise.line, legend: chrome.optimise.legend, flash: chrome.optimise.flash }} />\n        : undefined;\n    // The Plan's one reveal clock (#1398, CL4): the footer's line and the runs' placeholders show once a read the view\n    // waits for has passed the delay, and are held once shown — a flip renders them, never the frame.\n    const loading = chrome?.transport?.loading;\n    const waiting = loading !== undefined && loading.kind !== \"failed\";\n    // The run's landing (#1409) is measured and drawn over the whole frame — the bars and the counts alike.\n    const optimiseLanding = chrome?.optimise?.landing;\n    return (\n        <Box ref={optimiseLanding?.ref} css={optimiseLanding === undefined ? styles.frame : [styles.frame, optimiseLanding.css]} data-plan-frame=\"\" data-plan-bound={bound !== undefined ? \"\" : undefined}\n            style={{ ...vars, height: bound?.height, maxHeight: bound?.maxHeight }} {...optimiseLanding?.attributes}>\n            {kinds.length > 0 && (\n                <PlanKindsReader kinds={kinds} scale={chrome?.scale} drafts={chrome?.events?.drafts} parts={eventParts} cells={chrome?.cells}\n                    hidden={hidden} onRead={setKindsRead} />\n            )}\n            {inspector && (\n                <PlanSelectionReader kinds={kinds} elements={selection.elements} drafts={chrome?.events?.drafts} editing={chrome?.events}\n                    held={chrome?.cells?.held} onRead={setSelected} />\n            )}\n            <LoadingReveal waiting={waiting}>\n                <BuilderFrame\n                    storageKey={keys.frame}\n                    toolbar={toolbar}\n                    banners={banners}\n                    start={start}\n                    end={end}\n                    footer={footer}\n                    // A paged source's cold load is the frame's skeleton at the rows' pitch, its footer live and saying\n                    // what is read; after it, a read the view waits for covers nothing, and main is busy (#1398).\n                    loading={chrome?.cold}\n                    busy={chrome?.busy}\n                    loadingPitch={chrome?.pitch}\n                    liveFooter\n                    onKeyDown={onKeyDown}\n                >\n                    <PlanOverlapsContext.Provider value={overlapKeys}>{main}</PlanOverlapsContext.Provider>\n                </BuilderFrame>\n            </LoadingReveal>\n        </Box>\n    );\n}\n\n/** Props of {@link EastChakraPlanPayload}. */\nexport interface EastChakraPlanPayloadProps {\n    /** The payload, decoded. */\n    value: PlanValue;\n    /** Storage key prefix for persisting component state. */\n    storageKey: string;\n}\n\n/**\n * Renders a Plan's payload (#1191): its canvas, `plan`, in its frame\n * ({@link EastChakraPlan}), with its event kinds' rows ahead of the canvas's\n * own (#1192) — one block per resource kind, then the Unassigned rows', and a\n * paged kind's a window of its resources at a time (#1199) — its event kinds\n * counted in the footer, its library in the start pane (#1195), its\n * inspector in the end pane (#1197), and each source of its slice the frame\n * follows read through the payload's `narrowed` keys (#1344).\n *\n * @param props - The payload and its storage key\n * @returns The Plan, in its frame\n */\nexport const EastChakraPlanPayload = memo(function EastChakraPlanPayload({ value, storageKey }: EastChakraPlanPayloadProps) {\n    // The app's words (#1516), over whatever table a host gives it: everything below reads them.\n    const vocabulary = useDataStable(value.vocabulary, vocabularyEqual);\n    return <PlanVocabularyProvider vocabulary={vocabulary}><PlanPayloadFrame value={value} storageKey={storageKey} /></PlanVocabularyProvider>;\n}, (prev, next) => planPayloadEqual(prev.value, next.value) && prev.storageKey === next.storageKey);\n\n/** The payload's frame, inside the app's words. */\nfunction PlanPayloadFrame({ value, storageKey }: EastChakraPlanPayloadProps) {\n    const resourceKinds = value.resources.length;\n    const events = useMemo(\n        (): PlanEventRows | undefined => (value.blocks.type === \"some\"\n            ? { blocks: value.blocks.value, count: resourceKinds + 1, paged: getSomeorUndefined(value.paged) }\n            : undefined),\n        [value.blocks, value.paged, resourceKinds]);\n    // The sources the frame follows itself (#1344), each read once — one component each, so their hooks keep their\n    // order — in the Plan's words.\n    const { m, locale } = useResolvedPlanWords();\n    const chrome = getSomeorUndefined(value.plan.slice);\n    const sources = useMemo(() => planFollowedSources(value), [value]);\n    const nouns = useMemo(() => new Map(Object.entries(planNouns(value.events, value.resources, value.library, locale))),\n        [value.events, value.resources, value.library, locale]);\n    const said = useCallback((name: string): KeyVisibilityWords => ({ changed: m.narrowingChanged({ name }), failed: m.narrowingFailed({ name }) }), [m]);\n    return (\n        <FollowSources chrome={chrome} narrowed={value.narrowed} sources={sources} nouns={nouns} said={said}>\n            {(followed) => (\n                <EastChakraPlan value={value.plan} storageKey={storageKey} events={events} kinds={value.events}\n                    resources={value.resources} library={value.library} inspector={value.inspector}\n                    canDrop={value.canDrop} followed={followed} optimise={value.optimise.type === \"some\" ? { name: value.optimise.value.name } : undefined}\n                    autosave={value.settings.autosave} />\n            )}\n        </FollowSources>\n    );\n}\n\nimplementUIComponent(PlanComponent, EastChakraPlanPayload);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The state machine's vocabulary (`Sheet Spec.md` §6.1): the UI state, the\n * events the surface reports, the effects a transition returns as data, and\n * the context a transition may ask about the sheet. The transitions live in\n * `sheet-state.ts` (the core), `sheet-link-state.ts` (the link editor),\n * `sheet-suggest-state.ts` (the copilot) and `sheet-tabs-state.ts` (the view\n * tabs); every module imports its types from here so none imports another's\n * functions.\n *\n * @packageDocumentation\n */\n\nimport type { EditIssue } from \"@elaraai/east-ui-components\";\nimport type { SheetCandidate } from \"./candidates.js\";\nimport type { SheetKind } from \"./model.js\";\nimport type { SheetCellRefusalWord, SheetDropRefusalWord } from \"./messages.js\";\nimport type { ParseOutcome } from \"./parse/index.js\";\nimport type { LinkCandidate } from \"./link/predict.js\";\nimport type { LinkHalves } from \"./link/sides.js\";\nimport type { SheetCellValue, SheetMemberValue, SheetNounValue, SheetSavedView } from \"./values.js\";\n\n/** What a row-space index holds: a row, a blank padding row, or a group summary. */\nexport type SheetRowKind = \"row\" | \"blank\" | \"group\";\n\n/** The view tabs' own state (B§8); whether the active tab is dirty is derived by the component from the slice. */\nexport interface TabsState {\n    /** The active view's id; `null` = the pinned whole-sheet tab. */\n    active: string | null;\n    /** The next `view n` name's number. */\n    seq: number;\n    /** The tab being renamed, if any. */\n    renaming: string | null;\n    /** The rename buffer. */\n    renameVal: string;\n}\n\n/** The two halves' members. */\nexport type LinkGroups = [SheetMemberValue[], SheetMemberValue[]];\n\n/** The link editor's own state — the two halves, the caret's half, the chip selection. */\nexport interface LinkEdit {\n    /** Which half the caret is in: 0 = From, 1 = To. */\n    side: 0 | 1;\n    /** The resolved members of each half. */\n    groups: LinkGroups;\n    /** Whole-chip selection over the flat member list (From then To). */\n    chipSel: { anchor: number; focus: number } | null;\n    /** Bumps when the caret hops halves — the editor refocuses the active half. */\n    hop: number;\n}\n\n/** A cell position in the sheet's ROW space (bands and proposal rows are not rows). */\nexport interface CellRef {\n    r: number;\n    c: number;\n}\n\n/** The open editor. */\nexport interface EditBuffer {\n    r: number;\n    c: number;\n    /** The typed text. */\n    val: string;\n    /** The neg ring — the last commit attempt was unrecognised. */\n    err: boolean;\n    /** The armed candidate (`-1` = nothing armed — an empty buffer offers a menu, arms nothing). */\n    hi: number;\n    /** Opened by a printable key — caret at the end, nothing selected. */\n    seeded: boolean;\n    /** The text the editor opened with, when it opened on the cell's own value (not a key, not a link) — a commit of that same text writes nothing (#852). */\n    opened?: string | undefined;\n    /**\n     * The register member a gesture chose, by its key (#1536): the cell's own as the editor opens on it, an option of\n     * the menu, a strip chip, a candidate ⇥ or ⌘→ took. It commits as itself, so two members who show one label are\n     * told apart; typing, or ⌥ stepping the candidates, lets it go.\n     */\n    pick?: string | undefined;\n    /** The link editor's state — present on a link / set column. */\n    link?: LinkEdit;\n}\n\n/** One pending fill — the cell the copilot proposes for a blank cell, with its provenance (B§5.1). */\nexport interface PendingFill {\n    cell: SheetCellValue;\n    /** The provenance line the strip prints. */\n    meta: string;\n    /** The provider's position in the column's list — an earlier async provider that lands replaces a later one's fill. */\n    index: number;\n}\n\n/** One proposed row — the cells a patch set, with its provenance (B§5.2). */\nexport interface PendingRow {\n    cells: ReadonlyMap<string, SheetCellValue>;\n    meta: string;\n}\n\n/** The copilot's pending suggestions for one anchor row (B§5). */\nexport interface Suggestions {\n    /** The anchor row — a real row's id, or a blank row's synthetic id ({@link blankRowId}). */\n    anchorId: string;\n    /** Pending fills by column key. */\n    fill: ReadonlyMap<string, PendingFill>;\n    /** Proposed rows below the anchor, at most `ahead`. */\n    rows: readonly PendingRow[];\n    /** Providers still in flight — a column key, or `\"rows\"` for a proposer. */\n    pending: readonly string[];\n}\n\n/** What the planner rejected — remembered for the session so it is not offered again (B§5.2). */\nexport interface Rejections {\n    /** `${anchorId}|${key}` — a fill dismissed on a row. */\n    fills: ReadonlySet<string>;\n    /** `${driverKey}>${driverKey}` — a proposed follower rejected after a driver value. */\n    follows: ReadonlySet<string>;\n}\n\n/**\n * A row as a message names it (#861): a row by its number, or on a grouped\n * sheet a line by its number in its group (`title` its group's, `noun` the\n * host's word for a group) — worded at render.\n */\nexport type SheetRowRef =\n    | { line: false; number: number }\n    | { line: true; number: number; title: string | undefined; noun: string | undefined };\n\n/**\n * What a gesture leaves in the footer's `aria-live` line (#861): a message of\n * the Sheet's table by its id, with its parameters as data — counts raw, a\n * row as a {@link SheetRowRef}, a noun `undefined` where the host declares\n * none — so the reducer knows no locale; the footer words it (`noticeText`).\n * `issue` names the issue the history bar went to; `text` carries words that\n * are not the Sheet's own (an error a host's callback threw).\n */\nexport type SheetNotice =\n    | { id: \"groupOpened\" | \"groupFolded\"; noun: string | undefined }\n    | { id: \"groupsOpened\" | \"groupsFolded\"; n: number; noun: string | undefined; nouns: string | undefined }\n    | { id: \"subRowsShownAll\"; n: number; noun: string | undefined }\n    | { id: \"subRowsHidAll\"; noun: string | undefined }\n    | { id: \"subRowsShown\"; n: number }\n    | { id: \"subRowsHid\" | \"rowLeft\" | \"columnLeft\" | \"tabReverted\" | \"proposalDeselected\" | \"rowFillDismissed\" | \"discarded\" | \"newRow\" }\n    | { id: \"membersAdded\" | \"membersRemoved\" | \"predictedTaken\"; n: number }\n    | { id: \"lockedHalf\"; driver: string | undefined }\n    | { id: \"tabSaved\"; name: string; query: boolean }\n    | { id: \"tabClosed\"; name: string; active: boolean }\n    | { id: \"tabUpdated\"; name: string }\n    | { id: \"fillTaken\"; column: string; meta: string | undefined }\n    | { id: \"rowFilled\"; n: number; row: SheetRowRef }\n    | { id: \"proposalTaken\"; label: string | undefined; more: boolean }\n    | { id: \"proposalRejected\"; to: string | undefined; from: string | undefined }\n    | { id: \"fillDismissed\"; column: string }\n    | { id: \"deleted\"; n: number; what: \"rows\" | \"lines\" | \"groups\"; noun: string | undefined; nouns: string | undefined; again: boolean }\n    /**\n     * A paste: `actions` the action cells it passed by, which take no paste (T7), `wrote` false when no cell took it, and\n     * `refused` why the first cell it skipped was left as it was, where that is known.\n     */\n    | { id: \"pasted\"; rows: number; cols: number; skipped: number; actions?: number | undefined; wrote?: boolean | undefined; refused?: SheetCellRefusalWord | undefined }\n    /** A clear that left `n` cells as they were beside the `cleared` ones it cleared, and why the first was left. */\n    | { id: \"clearRefused\"; n: number; cleared: number; word: SheetCellRefusalWord }\n    /** An edit its cell would not take — a lock come since it opened, a blank where the value is never empty, text a column from data can't hold — and why. */\n    | { id: \"editRefused\"; word: SheetCellRefusalWord }\n    | { id: \"copied\"; rows: number; cols: number }\n    | { id: \"newGroup\"; noun: string | undefined }\n    /** An issue gone to: where it is, as the sheet names it, and the issue — the note goes once the session no longer holds it. */\n    | { id: \"issue\"; where: string; issue: EditIssue }\n    /** A card's ⏎ refused below the ring's row (#1187, SB45): why. */\n    | { id: \"dropRefused\"; word: SheetDropRefusalWord }\n    /** A new entry's key the app's `newKey` gave is taken already (#1536): its text — the gesture drafted nothing. */\n    | { id: \"keyTaken\"; key: string }\n    /** The app's `newKey` threw (#1536): why — the gesture drafted nothing. */\n    | { id: \"keyFailed\"; reason: string }\n    /**\n     * New rows given new keys, another write having added rows under the keys the sheet minted them (#1583): the first's\n     * key and its new one, and how many.\n     */\n    | { id: \"renumbered\"; from: string; to: string; n: number }\n    /**\n     * A new entry the app's `newRow` or `newGroup` left a required field of empty, one no person can set (#1536): what\n     * it would have been, the host's word for a group, and the field as the sheet labels it — the gesture drafted nothing.\n     */\n    | { id: \"cantAdd\"; what: \"row\" | \"line\" | \"group\"; noun: string | undefined; label: string }\n    | { id: \"text\"; text: string };\n\n/** All ephemeral UI state — one object, one reducer. */\nexport interface SheetUiState {\n    /** The ring. */\n    sel: CellRef;\n    /** The range's far corner, when a range is active. */\n    selEnd: CellRef | null;\n    /** The open editor. */\n    edit: EditBuffer | null;\n    /** The hovered cell (the ✓ take button's home). */\n    hover: CellRef | null;\n    /** The footer's `aria-live` line — the message the last gesture left (#861). */\n    msg: SheetNotice | null;\n    /** Rows appended past the padding with ↓ on the last row. */\n    appended: number;\n    /** The copilot's pending suggestions. */\n    sugg: Suggestions | null;\n    /** The fill the planner armed with Tab — the next target while it is pending. */\n    armed: CellRef | null;\n    /** The selected proposal row (its index under the anchor). */\n    gsel: number | null;\n    /** The session's rejection memory. */\n    rejected: Rejections;\n    /** A grouped sheet's fold overrides (#740): a group's or a line's id → folded (a line's `false`: its sub rows open). The open view keeps them; the narrowing itself is slice state, never held here. */\n    folds: ReadonlyMap<string, boolean>;\n    /** The view tabs. */\n    tabs: TabsState;\n    /**\n     * No ring is placed yet (#1531): a grid a host draws — the Record's — opens with none, and selects nothing. A press\n     * places it, and so does the first move key, on the first row's first cell that edits in place; no other key acts.\n     */\n    ringless: boolean;\n}\n\n/** A commit direction — where the ring goes after a commit. */\nexport type CommitDir = \"right\" | \"left\" | \"down\" | \"stay\" | \"blur\" | \"cancel\";\n\n/** Every interaction the surface can report. */\nexport type SheetEvent =\n    | { t: \"cell.down\"; r: number; c: number; shift: boolean }\n    | { t: \"cell.dbl\"; r: number; c: number }\n    | { t: \"cell.enter\"; r: number; c: number; dragging: boolean }\n    /** The pointer left the grid: no cell is hovered, and a strip that previews the hovered cell returns to the ring's (#1531). */\n    | { t: \"cell.leave\" }\n    | { t: \"row.pick\"; r: number; shift: boolean }\n    | { t: \"key\"; key: string; shift: boolean; meta: boolean; alt: boolean }\n    | { t: \"editor.change\"; val: string }\n    | { t: \"editor.key\"; key: string; shift: boolean; meta: boolean; alt: boolean; atEnd: boolean }\n    | { t: \"editor.blur\" }\n    /** A strip chip: a candidate — its label, and its member's key — or a link chip's members. */\n    | { t: \"strip.pick\"; label: string; key?: string | undefined; i: number; members?: SheetMemberValue[] }\n    /** The combobox chose an option (#1536) — stepped to while browsing, or pressed: its member, in the words it shows. */\n    | { t: \"editor.pick\"; label: string; key: string }\n    /** A click in a link editor's half moves the caret there (the buffer resolves first). */\n    | { t: \"half.down\"; side: 0 | 1 }\n    /** The controlled `selection` prop moved the ring — no `emit.select` echo. */\n    | { t: \"select.set\"; r: number; c: number }\n    /** A key's move the component finishes (#860): the ring lands where a `seek.step` or `seek.edge` was headed once its window arrives — reported and scrolled to, as a key's move is. */\n    | { t: \"select.move\"; r: number; c: number }\n    /**\n     * The rows changed underneath (a new value, a landed window): clamp.\n     * `moved` says where each row-space index from before now sits — a row\n     * by its identity, a padding row by its place among the padding — so the\n     * ring, a range, the editor, the hover and the armed fill follow their\n     * rows when rows move under them: a window landing above, a new\n     * revision, a host's write-back (#854). `null` for a row that LEFT the\n     * row space: an editor on it closes, since it would sit over another row\n     * and its text would land there (#877); every other place keeps its\n     * index, clamped. `undefined` where nothing is known of the row.\n     */\n    | { t: \"rows.changed\"; moved?: ((r: number) => number | null | undefined) | undefined }\n    /**\n     * The columns the grid draws changed underneath: a phone's frame putting\n     * the column it pins first, or back in its place; a column hidden or\n     * shown. `moved` says where each column index from before now sits, by\n     * the column's key, so the ring, a range, the editor, the hover and the\n     * armed fill follow their columns: an editor left at its index would\n     * write what was typed into the column now there. `null` for a column no\n     * longer drawn: an editor on it closes, and every other place keeps its\n     * index, clamped.\n     */\n    | { t: \"columns.changed\"; moved: (c: number) => number | null }\n    | { t: \"msg\"; msg: SheetNotice }\n    | { t: \"clipboard.copy\" }\n    | { t: \"clipboard.paste\"; text: string }\n    /** The copilot runner's result for an anchor (`null` = nothing to suggest). */\n    | { t: \"suggest.ready\"; anchorId: string; sugg: Suggestions | null }\n    /** An async provider settled: a fill for a column (`null` = it yielded nothing), or a proposer's rows. */\n    | { t: \"suggest.landed\"; anchorId: string; key: string; fill?: PendingFill | null; rows?: PendingRow[] }\n    /** The anchor became a real row (a blank row's first write): the suggestions follow its new id. */\n    | { t: \"suggest.rekey\"; from: string; to: string }\n    /** Every suggestion dropped (a new source). */\n    | { t: \"suggest.clear\" }\n    /** ✓ on a fill, or its strip chip. */\n    | { t: \"fill.take\"; key: string }\n    /** The gutter's → button: fill the whole row. */\n    | { t: \"fill.row\" }\n    /** A click on a proposal row selects it. */\n    | { t: \"proposal.pick\"; i: number }\n    /** ✓ on a proposal row — takes the row fill and the proposals up to it. */\n    | { t: \"proposal.take\"; i: number }\n    /** × on a proposal row — rejects it and remembers the pairing. */\n    | { t: \"proposal.reject\"; i: number }\n    // ── The narrowing and the view tabs (B§8) ──\n    /** The slice's narrowing changed underneath the sheet: the ring returns to the top. */\n    | { t: \"narrowing.changed\" }\n    /** A tab is picked (`null` = the whole sheet): the leaving tab keeps its folds, an unsaved query is discarded. */\n    | { t: \"tab.switch\"; id: string | null }\n    /** A tab opens WITHOUT persisting the one it leaves — the initial `activeView`; `folds`, the ones the last session left on it, when newer than the view's (#857). */\n    | { t: \"tab.open\"; id: string; folds?: ReadonlyMap<string, boolean> | undefined }\n    /** `+ TAB` — snapshot the current narrowing and folds as a view. */\n    | { t: \"tab.create\" }\n    /** × or a middle click — the active tab falls back to the sheet. */\n    | { t: \"tab.close\"; id: string }\n    /** ⏎ with a dirty tab: the tab now saves the current narrowing. */\n    | { t: \"tab.update\" }\n    /** esc with a dirty tab: the slice returns to the tab's saved narrowing. */\n    | { t: \"tab.revert\" }\n    | { t: \"tab.rename.start\"; id: string }\n    | { t: \"tab.rename.change\"; val: string }\n    | { t: \"tab.rename.commit\" }\n    | { t: \"tab.rename.cancel\" }\n    /** A tab dropped before the tab at `to` (`to` = the count appends). */\n    | { t: \"tab.reorder\"; id: string; to: number }\n    /** A key in the rail's search box the tabs claim: ⏎ updates a dirty tab; esc reverts a dirty tab, returns a clean one to the sheet, or clears the search. */\n    | { t: \"search.key\"; key: string }\n    // ── Grouped rows (#740) ──\n    /** The chevron, or Space with the ring on a band: the group folds or opens; `all` (⌥ on the chevron) applies the band's new state to every group. */\n    | { t: \"fold.toggle\"; r: number; all?: boolean }\n    /** The header corner's fold-all, or ⇧Space on a band: every group folds (`true`) or opens. */\n    | { t: \"fold.all\"; folded: boolean }\n    /** A line's chevron, or Space with the ring on a line that has sub rows (#844): they show or hide; `all` (⌥ on the chevron, ⇧Space) takes every line of its group the same way. */\n    | { t: \"subRows.toggle\"; r: number; all?: boolean };\n\n/** Where an edit came from (the wire `SheetSourceType` tags). */\nexport type EditSource = \"typed\" | \"pasted\" | \"fill\" | \"row\" | \"pattern\";\n\n/** Side effects, returned as data — never performed in the reducer. */\nexport type SheetEffect =\n    /** Write one cell (`null` = blank) — the component turns it into a commit or an insert. */\n    | { t: \"write\"; r: number; c: number; cell: SheetCellValue | null; text: string }\n    /** Write several cells of one row — a fill taken (`fill`) or the whole row filled (`row`). */\n    | { t: \"write.many\"; r: number; writes: readonly { c: number; cell: SheetCellValue }[]; source: EditSource }\n    /** The writes before it are one gesture and the writes after it another (#1531): a press that commits an open editor, then steps the cell it lands on, is two undo steps. */\n    | { t: \"gesture.end\" }\n    /** A press, ⏎ or F2 on a cell that edits out of place (#1531) — a Record's title: the host opens it where it edits it. */\n    | { t: \"open\"; r: number; c: number }\n    /** Insert proposed rows after the anchor, in order; `rest` re-anchors on the last one inserted. */\n    | { t: \"insert.rows\"; anchorR: number; rows: readonly PendingRow[]; rest: readonly PendingRow[] }\n    /** Clear a block of cells (stamped columns skipped by the component). */\n    | { t: \"clear\"; r0: number; r1: number; c0: number; c1: number }\n    /** Delete whole rows. */\n    | { t: \"delete.rows\"; r0: number; r1: number }\n    /** Copy a block. */\n    | { t: \"copy\"; r0: number; r1: number; c0: number; c1: number }\n    /** Paste text at a cell. */\n    | { t: \"paste\"; r: number; c: number; text: string }\n    | { t: \"focus.sheet\" }\n    | { t: \"focus.editor\"; selectAll: boolean }\n    /** The ring moved — `onSelect`. */\n    | { t: \"emit.select\"; r: number; c: number }\n    /** Bring a row into view. */\n    | { t: \"scroll.to\"; r: number }\n    /**\n     * ↓ past the last resident row, or ↑ above the first, on a paged sheet\n     * whose source goes on (#860): the component asks for the window beyond,\n     * and the ring moves `dir` onto its row, at column `c`, once it lands. A\n     * page (#1398, CL10) — PageDown past the last resident row, PageUp above\n     * the first — says the row it pages from and how many rows a page moves:\n     * the window a page on is asked for, and the ring lands there — fetch,\n     * then move.\n     */\n    | { t: \"seek.step\"; dir: 1 | -1; c: number; page?: { from: number; rows: number } | undefined }\n    /** ⌘Home / ⌘End on a paged sheet not at that end (#860): the component jumps the source there, and the ring lands on its first or last row, at column `c`. */\n    | { t: \"seek.edge\"; edge: \"first\" | \"last\"; c: number }\n    /** Move the ring to a row by ID once the body has re-formed (a fold-all keeps the ring on its group's band). */\n    | { t: \"select.id\"; id: string; c: number }\n    /** Re-ask the copilot for the edited row after the kind's latency (`instant` = 150 ms). */\n    | { t: \"schedule.suggest\"; latency: \"instant\" | \"idle\" }\n    /** The views changed — `onViewsChange`. */\n    | { t: \"emit.views\"; views: readonly SheetSavedView[] }\n    /** Write the slice's narrowing — a tab switch, a revert, the whole sheet. */\n    | { t: \"slice.write\"; state: SheetSavedView[\"narrowing\"] }\n    /** Focus the rail's search box (⌘/ · ⌘F). */\n    | { t: \"focus.search\" };\n\n/** What a transition may ask about the sheet — supplied with each event. */\nexport interface SheetMachineCtx {\n    /** Rows in row space (real + blank). */\n    rowCount: number;\n    /** Declared columns. */\n    colCount: number;\n    /** A grouped sheet: its rows are groups — the records a lens narrows — with fold controls. */\n    grouped?: boolean;\n    /** A lens narrows the sheet — ↓ on the last row must not append. */\n    lensActive: boolean;\n    /** The inline arm, or an exhausted paged source — ↓ on the last row may append. */\n    canAppend: boolean;\n    /**\n     * Whether the row space holds the source's first and last rows (#860): on\n     * a paged sheet an unloaded run lies past an end that is not, and a move\n     * across it asks the component for its window (`seek.step`, `seek.edge`).\n     * Absent ⇒ both ends are here (the inline arm).\n     */\n    edges?: { atStart: boolean; atEnd: boolean } | undefined;\n    /** How many rows a page moves — the rows the frame shows (#860); absent ⇒ ten. */\n    pageRows?: (() => number) | undefined;\n    /** Whether the cell may be edited (column editable, not stamped, sheet not read-only, row not owned where that matters). */\n    editableAt: (r: number, c: number) => boolean;\n    /** The kind of the cell at a row and column — a band's cell under the column, else the column's. */\n    kindAt: (r: number, c: number) => SheetKind;\n    /**\n     * A cell that steps in place rather than open an editor (#1531) — a cycle, a toggle, a boolean: its state after a\n     * step, the next (`1`), the one before (`-1`) or a cycle's first. `undefined` for any other cell, and absent on a\n     * sheet whose cells all edit.\n     */\n    stepAt?: ((r: number, c: number, step: 1 | -1 | \"first\") => SheetCellValue | undefined) | undefined;\n    /**\n     * Whether a cell steps in place, whether or not a step is there to take — given wherever {@link stepAt} is. A cycle\n     * over a register with no members steps nowhere, and is no text to type into either: no editor opens on it.\n     */\n    stepsAt?: ((r: number, c: number) => boolean) | undefined;\n    /** The cell a key sets on a cell that steps in place (#1531): a cycle's member whose label, key or alias it is. */\n    keyAt?: ((r: number, c: number, key: string) => SheetCellValue | undefined) | undefined;\n    /**\n     * Whether a cell edits out of place (#1531) — a Record's title: a press, ⏎ or F2 opens it through the host\n     * (`open`), and no editor opens on it. Absent on a sheet whose cells all edit in place.\n     */\n    opensAt?: ((r: number, c: number) => boolean) | undefined;\n    /** The strip previews the cell under the pointer (#1531): a key's move drops the hover, and the strip returns to the ring. */\n    previewsHover?: boolean | undefined;\n    /** Parse a buffer for a cell. */\n    parse: (r: number, c: number, text: string) => ParseOutcome;\n    /** The candidates for a buffer (the entry menu when empty). */\n    candidates: (r: number, c: number, text: string) => SheetCandidate[];\n    /** The armed candidate for a buffer, if any. */\n    candidateAt: (r: number, c: number, text: string, hi: number) => SheetCandidate | undefined;\n    /** The cell's edit form. */\n    editTextAt: (r: number, c: number) => string;\n    /** The key of the register member a cell holds (#1536): what its editor opens on, by the words the cell shows. */\n    memberAt?: ((r: number, c: number) => string | undefined) | undefined;\n    /** The link editor's context for a link / set column (`undefined` on every other kind). */\n    linkAt?: (r: number, c: number) => LinkEditCtx | undefined;\n    /** The row-space index of a row id — a real row's, or a blank row's synthetic id (`undefined` when not resident). */\n    rowOf?: (id: string) => number | undefined;\n    /** The id at a row-space index — a real row's, or a blank row's synthetic id. */\n    idAt?: (r: number) => string | undefined;\n    /** The column index of a key. */\n    columnOf?: (key: string) => number | undefined;\n    /** The driver member key a row resolves to. */\n    driverKeyAt?: (r: number) => string | undefined;\n    /** The driver column's key — a proposal's driver value sits under it. */\n    driverColumn?: string | undefined;\n    /** The 1-based row number at a row-space index (the footer's messages). */\n    numberAt?: (r: number) => number;\n    /** How the footer's messages name a row — a row, or on a grouped sheet a line of its group (#740, G3); worded at render (#861). */\n    rowRefAt?: (r: number) => SheetRowRef;\n    /** A new view's name when there is no query to name it from (#861) — the sheet's words, stored with the view. */\n    viewName?: ((seq: number) => string) | undefined;\n    /** The saved views, in order — the component's local layer over `views`. */\n    views?: readonly SheetSavedView[];\n    /** The slice's current narrowing (`undefined` without a bound slice). */\n    narrowing?: SheetSavedView[\"narrowing\"] | undefined;\n    /** The narrowing with nothing active — what the whole-sheet tab writes. */\n    emptyNarrowing?: SheetSavedView[\"narrowing\"] | undefined;\n    /** Whether the active tab's saved narrowing differs from the slice's — derived by the component. */\n    dirty?: boolean;\n    /** What the row-space index holds (#740); absent ⇒ every index is a row or a blank. */\n    rowKindAt?: (r: number) => SheetRowKind | undefined;\n    /** A group's band at a row-space index (#740): its id, its fold, and the row-space range of its lines (`undefined` when it has none or is folded). */\n    groupAt?: (r: number) => { id: string; folded: boolean; lines: { r0: number; r1: number } | undefined } | undefined;\n    /** The columns one cell spans (#740): a band's title spans its first columns; `undefined` ⇒ one column. */\n    spanAt?: (r: number, c: number) => { c0: number; c1: number } | undefined;\n    /** Every group's id in sheet order, the ones a lens hides included: what fold-all folds. */\n    groupIds?: readonly string[] | undefined;\n    /** Whether a row-space row is a LOOSE row between the groups (#846) — a grouped sheet's row that belongs to no group. */\n    looseAt?: ((r: number) => boolean) | undefined;\n    /** The word the messages use for a group (#844) — the host's. */\n    groupNoun?: SheetNounValue | undefined;\n    /** A line's SUB ROWS at a row-space index (#844): the line's id (the key they open under), how many, whether they show, and every line of its group that has sub rows. `undefined` = not a line, or a line with none. */\n    lineSubRowsAt?: ((r: number) => { id: string; count: number; open: boolean; group: readonly string[] } | undefined) | undefined;\n}\n\n/** What the link editor asks about its cell — built by the component per render. */\nexport interface LinkEditCtx {\n    /** The halves the row's driver makes live, and their lock tags. */\n    halves: LinkHalves;\n    /** The cell's current members. */\n    initial: LinkGroups;\n    /** The candidates for a buffer, members already in the cell excluded. */\n    candidates: (text: string, groups: LinkGroups) => LinkCandidate[];\n    /** The armed candidate. */\n    candidateAt: (text: string, hi: number, groups: LinkGroups) => LinkCandidate | undefined;\n    /** What a buffer resolves to — the armed candidate when it completes the text, else the grammar. */\n    resolve: (text: string, cand: LinkCandidate | undefined) => SheetMemberValue[];\n    /** The predicted members for a half — the column's pending fill minus what the cell holds. */\n    predicted: (side: 0 | 1, groups: LinkGroups, typed: string) => SheetMemberValue[];\n    /** The cell for the halves — `null` when both are empty. */\n    cell: (groups: LinkGroups) => SheetCellValue | null;\n    /** The driver member's name, for the hop-into-a-locked-half message — `undefined` when the row names none (#861: the words say \"this row\"). */\n    driverName: string | undefined;\n}\n\n/** One transition's result. */\nexport interface Transition {\n    state: SheetUiState;\n    effects: SheetEffect[];\n}\n\n/** The empty rejection memory. */\nexport const NO_REJECTIONS: Rejections = { fills: new Set(), follows: new Set() };\n\n/** No fold overridden. */\nexport const NO_FOLDS: ReadonlyMap<string, boolean> = new Map();\n\n/**\n * The initial UI state — `active` is the initial view tab, if the sheet opens on one; `folds`, the fold overrides it\n * opens with (#857); `ringless`, whether it opens with no ring placed (#1531).\n */\nexport function initialSheetState(sel: CellRef = { r: 0, c: 0 }, active: string | null = null, folds?: ReadonlyMap<string, boolean>, ringless = false): SheetUiState {\n    return {\n        sel, selEnd: null, edit: null, hover: null, msg: null, appended: 0, sugg: null, armed: null, gsel: null, rejected: NO_REJECTIONS,\n        folds: folds === undefined || folds.size === 0 ? NO_FOLDS : folds,\n        tabs: { active, seq: 1, renaming: null, renameVal: \"\" },\n        ringless,\n    };\n}\n\n/** Whether two cell refs name the same cell. */\nexport function same(a: CellRef, b: CellRef | null): boolean {\n    return b !== null && a.r === b.r && a.c === b.c;\n}\n\n/** Clamp a cell to the sheet. */\nexport function clamp(ref: CellRef, ctx: SheetMachineCtx): CellRef {\n    return {\n        r: Math.max(0, Math.min(Math.max(0, ctx.rowCount - 1), ref.r)),\n        c: Math.max(0, Math.min(Math.max(0, ctx.colCount - 1), ref.c)),\n    };\n}\n\n/** The selection rectangle. */\nexport function selectionRect(s: Pick<SheetUiState, \"sel\" | \"selEnd\">): { r0: number; r1: number; c0: number; c1: number } {\n    const e = s.selEnd ?? s.sel;\n    return {\n        r0: Math.min(s.sel.r, e.r), r1: Math.max(s.sel.r, e.r),\n        c0: Math.min(s.sel.c, e.c), c1: Math.max(s.sel.c, e.c),\n    };\n}\n\n/** A range spanning every column is a row selection. */\nexport function wholeRows(s: Pick<SheetUiState, \"sel\" | \"selEnd\">, colCount: number): { r0: number; r1: number } | null {\n    if (s.selEnd === null) return null;\n    const r = selectionRect(s);\n    return r.c0 === 0 && r.c1 === colCount - 1 ? { r0: r.r0, r1: r.r1 } : null;\n}\n\n/** The synthetic id of a blank padding row at a sheet position — the copilot's anchor before the row is real. */\nexport function blankRowId(position: number): string {\n    return ` blank:${position}`;\n}\n\n/** Whether an id names a blank padding row. */\nexport function isBlankRowId(id: string): boolean {\n    return id.startsWith(\" blank:\");\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The B§3 date grammar, in UTC — East `DateTime` values are UTC instants and\n * a sheet date is UTC midnight.\n *\n * Every printed form and every calendar entry form is an East datetime\n * PATTERN, printed and parsed by East's own tokenizer, printer and parser\n * (`formatDatePattern` / `parseDatePattern`), so the sheet and the language\n * agree on every date and this module keeps no month or weekday table of\n * its own. Only the RELATIVE forms are the grammar's: `+3` / `+3d` (the base\n * + n days), `4d` (the base COLUMN's value + n, only when the column declares\n * a base and it holds a date) and a weekday prefix of three or more letters\n * (the next occurrence after the base, never the base itself). The calendar\n * forms are ISO `yyyy-mm-dd`, `d/m`, `d/m/yy`, `d-m-yyyy`, `d.m` and\n * `17 nov [26]`; a missing year is the base's, rolled forward when the date\n * would precede the base. Display `17 Nov 26`; edit form `17/11/26`; strip\n * preview `Mon 17 Nov 26`; clipboard `17/11/2026`.\n *\n * A date column may read each row's date at a LEVEL (`Sheet.Types.DateLevel`,\n * #844): the week it falls in, the day, one end of a range of days, or the\n * day and its time. The cell is still one UTC instant; the level decides how\n * it prints, how it is typed (a trailing `hh:mm` at the time level) and how\n * an ACTUAL instant — when the work really happened — compares with it.\n *\n * @packageDocumentation\n */\n\nimport { formatDatePattern, parseDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport type { SheetWords } from \"../words.js\";\n\n/** The cell's display pattern — `17 Nov 26`. */\nexport const DATE_DISPLAY_PATTERN = \"D MMM YY\";\n/** The edit form — `17/11/26`. */\nexport const DATE_EDIT_PATTERN = \"D/M/YY\";\n/** The strip preview — `Mon 17 Nov 26`. */\nexport const DATE_LONG_PATTERN = \"ddd D MMM YY\";\n/** The clipboard form (B§10) — `17/11/2026`. */\nexport const DATE_CLIPBOARD_PATTERN = \"D/M/YYYY\";\n\nconst DAY_MS = 86_400_000;\n\n/** The separators a numeric calendar form takes. */\nconst SEPARATORS = [\"/\", \"-\", \".\"];\n\n/** The month-name forms, with and without the space. */\nconst NAMED = [\"D MMM\", \"D MMMM\", \"DMMM\", \"DMMMM\"];\n\n/** The calendar forms that carry their year, as East patterns. */\nconst DATED_PATTERNS: readonly string[] = [\n    \"YYYY-M-D\",\n    ...SEPARATORS.flatMap((s) => [`D${s}M${s}YYYY`, `D${s}M${s}YY`]),\n    ...NAMED.flatMap((p) => [`${p} YYYY`, `${p} YY`]),\n];\n\n/** The calendar forms without a year — the pattern with one, and the separator the year is appended with. */\nconst UNDATED_PATTERNS: readonly { pattern: string; join: string }[] = [\n    ...SEPARATORS.map((s) => ({ pattern: `D${s}M${s}YYYY`, join: s })),\n    ...NAMED.map((p) => ({ pattern: `${p} YYYY`, join: \" \" })),\n];\n\n/** UTC midnight of a date. */\nexport function utcMidnight(d: Date): Date {\n    return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));\n}\n\n/** Today at UTC midnight — the `today` the wire context carries. */\nexport function todayUtc(now: Date = new Date()): Date {\n    return utcMidnight(now);\n}\n\n/** A UTC date from calendar parts (month 1-based). Invalid parts overflow like `Date.UTC`. */\nexport function utcDate(y: number, m: number, d: number): Date {\n    return new Date(Date.UTC(y, m - 1, d));\n}\n\n/** `d` plus `n` days, in UTC. */\nexport function addDays(d: Date, n: number): Date {\n    return new Date(d.getTime() + n * DAY_MS);\n}\n\n/** Whole days from `a` to `b` (rounded). */\nexport function daysBetween(a: Date, b: Date): number {\n    return Math.round((utcMidnight(b).getTime() - utcMidnight(a).getTime()) / DAY_MS);\n}\n\n/** What the grammar needs beside the text. */\nexport interface DateParseContext {\n    /** Today, UTC midnight. */\n    today: Date;\n    /** The base column's value, when the column declares a base and the row holds one. */\n    base?: Date | undefined;\n}\n\n/** The first pattern the text parses as. */\nfunction parseDated(text: string): Date | undefined {\n    for (const pattern of DATED_PATTERNS) {\n        const d = parseDatePattern(pattern, text);\n        if (d !== undefined) return d;\n    }\n    return undefined;\n}\n\n/** A year-less form, with `year` appended the way the form separates its parts. */\nfunction parseUndated(text: string, year: number): Date | undefined {\n    for (const { pattern, join } of UNDATED_PATTERNS) {\n        const d = parseDatePattern(pattern, `${text}${join}${year}`);\n        if (d !== undefined) return d;\n    }\n    return undefined;\n}\n\n/**\n * Parse typed text to a UTC-midnight date.\n *\n * @returns the date; `undefined` for an empty buffer (a blank); `null` when unrecognised\n */\nexport function parseDate(text: string, ctx: DateParseContext): Date | null | undefined {\n    // A trailing `hh:mm` rides on the day (`fri 07:30`, `22/3 19:00`, or `19:00` alone on the base day).\n    const split = splitTimeToken(text);\n    if (split.time !== undefined) {\n        const day = split.rest === \"\" ? utcMidnight(ctx.base ?? ctx.today) : parseDate(split.rest, ctx);\n        if (day === null || day === undefined) return null;\n        return withTime(day, split.time.hh, split.time.mm);\n    }\n    const t = text.trim().toLowerCase().replace(/\\s+/g, \" \");\n    if (t === \"\") return undefined;\n    const base = ctx.base ?? ctx.today;\n    let m: RegExpExecArray | null;\n    if ((m = /^\\+(\\d+)d?$/.exec(t))) return addDays(base, Number(m[1]));\n    if ((m = /^(\\d+)d$/.exec(t))) {\n        // `4d` counts from the base COLUMN only — without one the form is unrecognised.\n        return ctx.base !== undefined ? addDays(ctx.base, Number(m[1])) : null;\n    }\n    if (/^[a-z]+$/.test(t)) {\n        // A weekday prefix names the next occurrence after the base, never the base itself.\n        if (t.length < 3) return null;\n        for (let n = 1; n <= 7; n++) {\n            const d = addDays(base, n);\n            if (formatDatePattern(\"dddd\", d).toLowerCase().startsWith(t)) return d;\n        }\n        return null;\n    }\n    const dated = parseDated(t);\n    if (dated !== undefined) return dated;\n    // A missing year is the base's, rolled forward when the date would precede the base.\n    const year = base.getUTCFullYear();\n    const thisYear = parseUndated(t, year);\n    if (thisYear === undefined) return null;\n    return thisYear.getTime() < base.getTime() ? parseUndated(t, year + 1) ?? null : thisYear;\n}\n\n/** `17 Nov 26` — the cell's display form. */\nexport function formatDateDisplay(d: Date): string {\n    return formatDatePattern(DATE_DISPLAY_PATTERN, d);\n}\n\n/** `17/11/26` — the edit form. */\nexport function formatDateEdit(d: Date): string {\n    return formatDatePattern(DATE_EDIT_PATTERN, d);\n}\n\n/** `Mon 17 Nov 26` — the strip preview. */\nexport function formatDateLong(d: Date): string {\n    return formatDatePattern(DATE_LONG_PATTERN, d);\n}\n\n/** `17/11/2026` — the clipboard form (B§10). */\nexport function formatDateClipboard(d: Date): string {\n    return formatDatePattern(DATE_CLIPBOARD_PATTERN, d);\n}\n\n// ── Levels ────────────────────────────────────────────────────────────────\n\n/** How deep a date is read and typed — the tags of `Sheet.Types.DateLevel`. */\nexport type WhenLevel = \"week\" | \"day\" | \"range\" | \"time\";\n\n/** Whether a string names a level — what a level rule cell holds. */\nexport function isWhenLevel(s: string): s is WhenLevel {\n    return s === \"week\" || s === \"day\" || s === \"range\" || s === \"time\";\n}\n\n/** The instant at `hh:mm` on `d`'s day. */\nexport function withTime(d: Date, hh: number, mm: number): Date {\n    return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), hh, mm));\n}\n\n/** Whether an instant carries a time of day. */\nexport const hasTime = (d: Date): boolean => d.getUTCHours() !== 0 || d.getUTCMinutes() !== 0;\n\nconst two = (n: number): string => String(n).padStart(2, \"0\");\n/** `19:00`. */\nexport const formatTime = (d: Date): string => `${two(d.getUTCHours())}:${two(d.getUTCMinutes())}`;\n\n/** The Monday of `d`'s week (UTC). */\nexport function weekStart(d: Date): Date {\n    const m = utcMidnight(d);\n    return addDays(m, -((m.getUTCDay() + 6) % 7));\n}\n\n/** A trailing `hh:mm` on typed text, split off: the rest, and the time it names. */\nexport function splitTimeToken(text: string): { rest: string; time?: { hh: number; mm: number } } {\n    const t = text.trim();\n    const m = /^(.*?)\\s*\\b(\\d{1,2}):(\\d{2})$/.exec(t);\n    if (m !== null) {\n        const hh = Number(m[2]);\n        const mm = Number(m[3]);\n        if (hh < 24 && mm < 60) return { rest: m[1]!.trim(), time: { hh, mm } };\n    }\n    return { rest: t };\n}\n\n/**\n * The edit form at a level: the day alone up to the range level, the day and\n * the clock at the time level (`22/3/26 19:00`). With no level, a date that\n * carries a time of day keeps it.\n *\n * @param d - The instant\n * @param level - The row's level, if the column declares one\n * @returns The text the editor opens with\n */\nexport function formatWhenEdit(d: Date, level?: WhenLevel): string {\n    const day = formatDateEdit(d);\n    if (level === \"week\" || level === \"day\" || level === \"range\") return day;\n    if (level === \"time\" || hasTime(d)) return `${day} ${formatTime(d)}`;\n    return day;\n}\n\n/** The cell's display form at a level — `22/03/26`. */\nexport const WHEN_DISPLAY_PATTERN = \"DD/MM/YY\";\n\n/**\n * What a date cell prints at a level: the day as `dd/mm/yy` (at the week\n * level, the week's Monday), the time after it at the time level, and the\n * RESOLUTION as a tag — `wk` · `day` · `range` · `time` in English, the\n * sheet's words (#861) — so a reader never infers the precision from the\n * shape of the text.\n *\n * @param d - The instant\n * @param level - The level it is read at\n * @param w - The sheet's words\n * @returns The text and its resolution tag\n */\nexport function formatWhen(d: Date, level: WhenLevel, w: SheetWords): { text: string; suffix: string } {\n    const suffix = w.m.whenTag({ level });\n    switch (level) {\n        case \"week\":  return { text: formatDatePattern(WHEN_DISPLAY_PATTERN, weekStart(d)), suffix };\n        case \"day\":   return { text: formatDatePattern(WHEN_DISPLAY_PATTERN, d), suffix };\n        case \"range\": return { text: formatDatePattern(WHEN_DISPLAY_PATTERN, d), suffix };\n        case \"time\":  return { text: `${formatDatePattern(WHEN_DISPLAY_PATTERN, d)} ${formatTime(d)}`, suffix };\n    }\n}\n\n/**\n * The forms a level accepts — the strip's `accepts` line, in the sheet's\n * words (#861).\n *\n * @param level - The level\n * @param w - The sheet's words\n * @returns The chip and the meta line\n */\nexport function whenAccepts(level: WhenLevel, w: SheetWords): { chip: string; meta: string } {\n    return { chip: w.m.whenAccepts({ level }), meta: w.m.whenAcceptsForms({ level }) };\n}\n\n/**\n * How an ACTUAL instant stands against the WANTED date at its level. Inside\n * the window the level names — the week, the day, an hour either side of a\n * time — it is on time; otherwise late or early by whole days, or by hours\n * under a day, measured from the wanted instant.\n *\n * @param wanted - The wanted date, as the cell holds it\n * @param level - The level it is read at\n * @param actual - When the work really happened\n * @param w - The sheet's words (#861)\n * @returns The tag (`+1d` · `−3h` · `actual`), its tone, and the words the cell's detail says (`3 hours late`)\n */\nexport function actualAgainst(wanted: Date, level: WhenLevel, actual: Date, w: SheetWords): { tag: string; tone: \"on\" | \"late\" | \"early\"; words: string } {\n    let lo: number;\n    let hi: number;\n    switch (level) {\n        case \"week\": lo = weekStart(wanted).getTime(); hi = lo + 7 * DAY_MS; break;\n        case \"day\": case \"range\": lo = utcMidnight(wanted).getTime(); hi = lo + DAY_MS; break;\n        case \"time\": lo = wanted.getTime() - 3_600_000; hi = wanted.getTime() + 3_600_000; break;\n    }\n    const t = actual.getTime();\n    if (t >= lo && t < hi) {\n        const on = { tone: \"on\", n: 0, count: w.number(0), unit: \"d\" } as const;\n        return { tag: w.m.actualTag(on), tone: \"on\", words: w.m.actualWords(on) };\n    }\n    const off = Math.abs(t - wanted.getTime());\n    const tone = t >= hi ? \"late\" : \"early\";\n    const inDays = off >= 20 * 3_600_000;\n    const n = inDays ? Math.max(1, Math.round(off / DAY_MS)) : Math.max(1, Math.round(off / 3_600_000));\n    const p = { tone, n, count: w.number(n), unit: inDays ? \"d\" : \"h\" } as const;\n    return { tag: w.m.actualTag(p), tone, words: w.m.actualWords(p) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * An action column's machine as the renderer walks it (#1475,\n * `Sheet Action Column - Behaviour Spec.md` §0, §10): the cases decoded from\n * the column's kind, a row's state read off its `Action` cell, its offer —\n * its state's `next`, or `start` with nothing taken — and the gate that says\n * whether it may act now. Pure: no React.\n *\n * @packageDocumentation\n */\n\nimport { NullType, decodeBeast2For, encodeBeast2For, fromEastTypeValue, isTypeEqual, variant, type EastType, type ValueTypeOf } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { Sheet } from \"@elaraai/e3-ui/internal\";\nimport type { SheetColumnMeta } from \"../model.js\";\nimport type { SheetCellValue, SheetContextValue } from \"../values.js\";\n\n/** The decoded wire kind of an action column. */\nexport type SheetActionKindValue = ValueTypeOf<typeof Sheet.Types.ActionKind>;\n/** One decoded wire case. */\nexport type SheetActionCaseValue = ValueTypeOf<typeof Sheet.Types.ActionCase>;\n/** How a case is asked for, decoded. */\nexport type SheetActionTakeValue = ValueTypeOf<typeof Sheet.Types.ActionTake>;\n/** Whether a row may act now, decoded. */\nexport type SheetActionGateValue = ValueTypeOf<typeof Sheet.Types.ActionGate>;\n/** What an action wrote beside its field, decoded: the row's cells and the band's. */\nexport type SheetActionUpdatesValue = ValueTypeOf<typeof Sheet.Types.ActionUpdates>;\n\n/** One case of an action column, as the cell and its overlays read it. */\nexport interface ActionCase {\n    /** The case's name. */\n    readonly name: string;\n    /** The action's verb. */\n    readonly label: string;\n    /** The state's word. */\n    readonly state: string;\n    /** The state's tone; `undefined` is neutral. */\n    readonly tone: string | undefined;\n    /** A Font Awesome solid icon's name. */\n    readonly icon: string | undefined;\n    /** The cases a row in this state may go to, in order. */\n    readonly next: readonly string[];\n    /** How it is asked for. */\n    readonly take: SheetActionTakeValue;\n    /** The case's value type. */\n    readonly valueType: EastType;\n    /** What the form opens with, encoded. */\n    readonly initial: ((ctx: SheetContextValue) => Uint8Array) | undefined;\n    /** What else taking it writes. */\n    readonly updates: ((value: Uint8Array, ctx: SheetContextValue, at: Date) => SheetActionUpdatesValue) | undefined;\n    /** The kind S14's grammar labels it by: a button, a choice (a menu) or a form. */\n    readonly kind: \"button\" | \"choice\" | \"form\";\n    /** Its value, encoded at its type. */\n    readonly encode: (value: unknown) => Uint8Array;\n    /** Its value, decoded. */\n    readonly decode: (bytes: Uint8Array) => unknown;\n}\n\n/** An action column's machine. */\nexport interface ActionColumn {\n    /** What a row with nothing taken may do. */\n    readonly start: readonly string[];\n    /** Every case by name. */\n    readonly cases: ReadonlyMap<string, ActionCase>;\n    /** The cases in the author's order. */\n    readonly order: readonly ActionCase[];\n    /** Whether a row may act now, over its wire context. */\n    readonly gate: (ctx: SheetContextValue) => SheetActionGateValue;\n    /** The rule cell holding a row's summary. */\n    readonly summary: string;\n    /** The rule cell holding how the row is named, if any. */\n    readonly name: string | undefined;\n    /** The rule cell holding the row's words beside its name, if any. */\n    readonly title: string | undefined;\n}\n\nconst columns = new WeakMap<object, ActionColumn>();\nconst NULL_BYTES = encodeBeast2For(NullType)(null);\n\n/**\n * A column's machine, decoded once per wire column.\n *\n * @param meta - The column\n * @returns Its machine, or `undefined` for any other kind\n */\nexport function actionColumnOf(meta: SheetColumnMeta | undefined): ActionColumn | undefined {\n    if (meta === undefined || meta.kind !== \"action\" || meta.raw.kind.type !== \"action\") return undefined;\n    const known = columns.get(meta.raw);\n    if (known !== undefined) return known;\n    const kind = meta.raw.kind.value;\n    const order = kind.cases.map((c): ActionCase => {\n        const valueType = fromEastTypeValue(c.valueType) as EastType;\n        const isNull = isTypeEqual(valueType, NullType);\n        const encode = isNull ? () => NULL_BYTES : (encodeBeast2For(valueType) as (value: unknown) => Uint8Array);\n        const decode = decodeBeast2For(valueType) as (bytes: Uint8Array) => unknown;\n        return {\n            name: c.case,\n            label: c.label,\n            state: c.state,\n            tone: getSomeorUndefined(c.tone)?.type,\n            icon: getSomeorUndefined(c.icon),\n            next: c.next,\n            take: c.take,\n            valueType,\n            initial: getSomeorUndefined(c.initial),\n            updates: getSomeorUndefined(c.updates),\n            kind: c.take.type === \"button\" ? \"button\" : c.take.type === \"form\" ? \"form\" : \"choice\",\n            encode,\n            decode,\n        };\n    });\n    const column: ActionColumn = {\n        start: kind.start,\n        cases: new Map(order.map((c) => [c.name, c])),\n        order,\n        gate: kind.gate,\n        summary: kind.summary,\n        name: getSomeorUndefined(kind.name),\n        title: getSomeorUndefined(kind.title),\n    };\n    columns.set(meta.raw, column);\n    return column;\n}\n\n/**\n * The case a row is in, from its `Action` cell.\n *\n * @param cell - The cell\n * @returns The case's name, or `undefined` while nothing is taken\n */\nexport function caseOf(cell: SheetCellValue | undefined): string | undefined {\n    return cell?.type === \"Action\" ? cell.value.case : undefined;\n}\n\n/**\n * The cases a row may go to by the machine alone — its state's `next`, or\n * `start` with nothing taken — in order.\n *\n * @param column - The machine\n * @param cell - The row's action cell\n * @returns The offered cases\n */\nexport function machineOffer(column: ActionColumn, cell: SheetCellValue | undefined): ActionCase[] {\n    const at = caseOf(cell);\n    const names = at === undefined ? column.start : column.cases.get(at)?.next ?? [];\n    return names.flatMap((n) => { const c = column.cases.get(n); return c === undefined ? [] : [c]; });\n}\n\n/** A row's offer: the machine's, and whether the row may act now. */\nexport interface ActionOffer {\n    /** The state the row is in, if a case is taken. */\n    readonly state: ActionCase | undefined;\n    /** The cases the machine offers, in order. */\n    readonly offered: readonly ActionCase[];\n    /** Why the row cannot act now (the column's `blocked`). */\n    readonly blocked: string | undefined;\n    /** The fields its draft still lacks (T6). */\n    readonly incomplete: readonly string[] | undefined;\n}\n\n/**\n * A row's offer, its gate asked over its wire context. A gate that throws is\n * said as the row's blocking reason, never thrown on: a row stays drawn.\n *\n * @param column - The machine\n * @param cell - The row's action cell\n * @param ctx - The row's wire context, or `undefined` where none is built (a read-only sheet asks none)\n * @returns The offer\n */\nexport function offerOf(column: ActionColumn, cell: SheetCellValue | undefined, ctx: SheetContextValue | undefined): ActionOffer {\n    const at = caseOf(cell);\n    const state = at === undefined ? undefined : column.cases.get(at);\n    const offered = machineOffer(column, cell);\n    if (offered.length === 0 || ctx === undefined) return { state, offered, blocked: undefined, incomplete: undefined };\n    let gate: SheetActionGateValue;\n    try { gate = column.gate(ctx); } catch (error) { return { state, offered, blocked: error instanceof Error ? error.message : String(error), incomplete: undefined }; }\n    if (gate.type === \"blocked\") return { state, offered, blocked: gate.value, incomplete: undefined };\n    if (gate.type === \"incomplete\") return { state, offered, blocked: undefined, incomplete: gate.value };\n    return { state, offered, blocked: undefined, incomplete: undefined };\n}\n\n/** Whether a row may take an offered case now. */\nexport function canTake(offer: ActionOffer): boolean {\n    return offer.offered.length > 0 && offer.blocked === undefined && offer.incomplete === undefined;\n}\n\n/**\n * The `Action` cell a case and its value make.\n *\n * @param c - The case\n * @param bytes - Its value, encoded\n * @returns The cell\n */\nexport function actionCell(c: ActionCase, bytes: Uint8Array): SheetCellValue {\n    return variant(\"Action\", { case: c.name, value: bytes });\n}\n\n/** A case's label in S14's grammar: a form's verb ends in `…`; a choice's caret is drawn beside it. */\nexport function verbOf(c: ActionCase): string {\n    return c.kind === \"form\" ? `${c.label}…` : c.label;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Sheet model (`Sheet Spec.md` §6) — the decoded value turned into what\n * the renderer walks: the column index, the body (real rows in sheet order,\n * the paged arm's unloaded bands, the blank padding rows), the driver lookup,\n * the cell display helpers, and a cell's mark with the one check of whether\n * a cell takes an edit (#1560).\n *\n * On a GROUPED sheet (#740) the body is the groups' BANDS with their lines\n * under them: a line is a `real` item whose row is a pseudo wire row over\n * the line's cells (so every cell helper reads it as a row) tagged with its\n * group ({@link LineGroup}). An open line's SUB ROWS (#844) hang under it\n * as `subRow` items, outside the row space. Under the lens (#1349) the body is\n * what it lays out over the record ({@link buildLensBody}): the rows the\n * narrowing keeps, one after another, each keeping its number, and a band\n * over each stretch of them not read yet — on a grouped sheet its groups, the\n * records, narrowing as flat rows do, a match's lines marked.\n *\n * Pure: no React, no DOM. The interaction state lives in `sheet-state.ts`;\n * the data lives in the component (local rows over the decoded value).\n *\n * @packageDocumentation\n */\n\nimport { none, variant } from \"@elaraai/east\";\nimport { formatDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport { type Formatters, type TickFormatOpt, getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type {\n    SheetCellValue, SheetColumnValue, SheetContextValue, SheetCustomKindValue, SheetGroupValue, SheetLineValue, SheetLinkValue, SheetMemberValue,\n    SheetNounValue, SheetRegisterMemberValue, SheetRootValue, SheetRowValue, SheetSubRowValue,\n} from \"./values.js\";\nimport type { SheetWords } from \"./words.js\";\nimport { blankRowId } from \"./sheet-types.js\";\nimport { DATE_DISPLAY_PATTERN, isWhenLevel, type WhenLevel } from \"./parse/date.js\";\nimport { actionColumnOf } from \"./actions/model.js\";\n\n// ── Columns ───────────────────────────────────────────────────────────────\n\n/** The column kinds (the arms of `SheetColumnKindType`); the last seven only a Record draws (#1528). */\nexport type SheetKind =\n    | \"text\" | \"date\" | \"quantity\" | \"integer\" | \"lookup\" | \"reference\" | \"enum\"\n    | \"set\" | \"link\" | \"stamped\" | \"custom\" | \"action\"\n    | \"title\" | \"person\" | \"boolean\" | \"toggle\" | \"cycle\" | \"age\" | \"audit\";\n\n/** Default column widths per kind (px) when the author declares none. */\nconst DEFAULT_WIDTH: Record<SheetKind, number> = {\n    text: 200, date: 96, quantity: 112, integer: 72, lookup: 200, reference: 120, enum: 124,\n    set: 240, link: 352, stamped: 104, custom: 140, action: 304,\n    title: 184, person: 160, boolean: 72, toggle: 80, cycle: 72, age: 92, audit: 232,\n};\n\n/** The copilot latency class of a kind (B§3): deterministic kinds are instant. */\nexport function latencyOf(kind: SheetKind): \"instant\" | \"idle\" {\n    switch (kind) {\n        case \"date\": case \"integer\": case \"lookup\": case \"reference\": case \"enum\": return \"instant\";\n        default: return \"idle\";\n    }\n}\n\n/** One decoded column, flattened for the renderer. */\nexport interface SheetColumnMeta {\n    /** The column key — the row field it sits on. */\n    key: string;\n    /** The header line. */\n    header: string;\n    /** The grey second header line. */\n    sub: string | undefined;\n    /** Track width in px. */\n    width: number;\n    /** The kind tag. */\n    kind: SheetKind;\n    /** Whether the sheet writes the column. */\n    editable: boolean;\n    /** The register the column resolves against (lookup · reference · enum · set · link · person · cycle). */\n    register: string | undefined;\n    /** An enum, lookup or link column's options rule (#844): the member keys a row is OFFERED (`undefined` = the whole register). Typed text still resolves against the whole register. */\n    options: ((ctx: SheetContextValue) => readonly string[] | undefined) | undefined;\n    /** A date column's level (#844): how deep a row's date is read and typed, read off the row's cells. */\n    level: ((cells: ReadonlyMap<string, SheetCellValue>) => WhenLevel) | undefined;\n    /** A date column's actual (#844): the key of the unrendered cell holding when the work really happened. */\n    actual: string | undefined;\n    /** The key of the unrendered cell whose text is this column's detail — the hover and the strip (#844). */\n    detailCell: string | undefined;\n    /** A date column's base column (`4d` counts from it). */\n    base: string | undefined;\n    /** A date column's display pattern (East date tokens). */\n    dateFormat: string | undefined;\n    /** A quantity column's unit per driver key. */\n    uom: ReadonlyMap<string, string> | undefined;\n    /** A quantity column's one unit for every row, after the value. */\n    unit: string | undefined;\n    /** A quantity column's display format. */\n    format: TickFormatOpt;\n    /** A toggle column's words for its two states: what a cell shows, and typed text sets. */\n    states: { on: string; off: string } | undefined;\n    /** A stamped column's owner. */\n    owner: string | undefined;\n    /** A custom kind's \"accepts\" line. */\n    accepts: string | undefined;\n    /** A custom kind's compiled parse — typed text + the wire context → an optional cell. */\n    customParse: SheetCustomKindValue[\"parse\"] | undefined;\n    /** A custom kind's compiled print. */\n    customPrint: SheetCustomKindValue[\"print\"] | undefined;\n    /** The raw decoded column (the link kind's declaration rides here for P3). */\n    raw: SheetColumnValue;\n}\n\n/** The column index — in declaration order, and by key. */\nexport interface SheetColumnIndex {\n    list: readonly SheetColumnMeta[];\n    byKey: ReadonlyMap<string, SheetColumnMeta>;\n    /** Σ widths, for the body's min-width. */\n    totalWidth: number;\n}\n\n/** A wire options rule as the renderer calls it — the offered keys, or `undefined` for the whole register. */\nfunction optionsRule(rule: { type: \"some\"; value: (ctx: SheetContextValue) => { type: string; value: unknown } } | { type: \"none\" }): SheetColumnMeta[\"options\"] {\n    if (rule.type !== \"some\") return undefined;\n    const fn = rule.value;\n    return (ctx) => {\n        const out = fn(ctx);\n        return out.type === \"some\" ? (out.value as readonly string[]) : undefined;\n    };\n}\n\n/** A level rule as the renderer calls it — the level named in the row's rule cell, `day` when it names none. */\nfunction levelRule(key: string | undefined): SheetColumnMeta[\"level\"] {\n    if (key === undefined) return undefined;\n    return (cells) => {\n        const c = cells.get(key);\n        return c !== undefined && c.type === \"String\" && isWhenLevel(c.value) ? c.value : \"day\";\n    };\n}\n\n/** Flatten the decoded columns. */\nexport function indexColumns(columns: readonly SheetColumnValue[]): SheetColumnIndex {\n    const list = columns.map((col): SheetColumnMeta => {\n        const kind = col.kind;\n        const meta: SheetColumnMeta = {\n            key: col.key,\n            header: col.header,\n            sub: getSomeorUndefined(col.sub),\n            width: parseWidth(getSomeorUndefined(col.width)) ?? DEFAULT_WIDTH[kind.type],\n            kind: kind.type,\n            editable: col.editable,\n            register: undefined,\n            options: undefined,\n            level: undefined,\n            actual: undefined,\n            detailCell: getSomeorUndefined(col.detailCell),\n            base: undefined,\n            dateFormat: undefined,\n            uom: undefined,\n            unit: undefined,\n            format: undefined,\n            states: undefined,\n            owner: undefined,\n            accepts: undefined,\n            customParse: undefined,\n            customPrint: undefined,\n            raw: col,\n        };\n        // The kind's payload, by its arm — the decoded variant narrows on `type`.\n        switch (kind.type) {\n            case \"date\":\n                meta.base = getSomeorUndefined(kind.value.base);\n                meta.dateFormat = getSomeorUndefined(kind.value.format);\n                meta.level = levelRule(getSomeorUndefined(kind.value.level));\n                meta.actual = getSomeorUndefined(kind.value.actual);\n                break;\n            case \"quantity\":\n                meta.uom = getSomeorUndefined(kind.value.uom);\n                meta.unit = getSomeorUndefined(kind.value.unit);\n                meta.format = getSomeorUndefined(kind.value.format);\n                break;\n            case \"lookup\":\n            case \"enum\":\n            case \"link\":\n                meta.register = kind.value.register;\n                meta.options = optionsRule(kind.value.options);\n                break;\n            case \"reference\":\n            case \"set\":\n            case \"person\":\n            case \"cycle\":\n                meta.register = kind.value.register;\n                break;\n            case \"toggle\":\n                meta.states = { on: kind.value.on, off: kind.value.off };\n                break;\n            case \"stamped\":\n                meta.owner = getSomeorUndefined(kind.value.owner);\n                break;\n            case \"custom\":\n                meta.accepts = kind.value.accepts;\n                meta.customParse = kind.value.parse;\n                meta.customPrint = kind.value.print;\n                break;\n            default:\n                break;\n        }\n        return meta;\n    });\n    return {\n        list,\n        byKey: new Map(list.map((c) => [c.key, c])),\n        totalWidth: list.reduce((sum, c) => sum + c.width, 0),\n    };\n}\n\n/** A declared CSS width to px — a bare number or a `px` length; anything else falls back. */\nexport function parseWidth(raw: string | undefined): number | undefined {\n    if (raw === undefined) return undefined;\n    const m = /^\\s*(\\d+(?:\\.\\d+)?)\\s*(px)?\\s*$/.exec(raw);\n    return m ? Math.round(Number(m[1])) : undefined;\n}\n\n// ── Grouped rows (#740) ───────────────────────────────────────────────────\n\n/** The cell key a group's title rides under — the wire's `SHEET_TITLE_CELL`. */\nexport const TITLE_KEY = \"$title\";\n\n/** The lens-record key a line's sub rows answer a search under (#844), reserved as {@link TITLE_KEY} is. */\nexport const SUB_ROWS_KEY = \"$subRows\";\n\n/** The separator inside a line's synthetic id — the group's id, then the line's wire key. */\nexport const LINE_ID_SEP = \"\\u001f\";\n\n/** A line's synthetic id — its group's id and its wire key. */\nexport function lineId(groupId: string, key: string): string {\n    return `${groupId}${LINE_ID_SEP}${key}`;\n}\n\n/** The group id and line key a synthetic line id names, or `undefined` for a plain row id. */\nexport function parseLineId(id: string): { groupId: string; key: string } | undefined {\n    const at = id.indexOf(LINE_ID_SEP);\n    if (at < 0) return undefined;\n    return { groupId: id.slice(0, at), key: id.slice(at + 1) };\n}\n\n/** The synthetic id of a group's blank line — the copilot's anchor before the line is real. */\nexport function blankLineId(groupId: string): string {\n    return ` blank:g:${groupId}`;\n}\n\n/** The wire key a line that the source does not hold yet carries — never a source index. */\nexport const NEW_LINE_KEY = \"+\";\n\n/** How a line item knows its group: the group's wire row, the line's wire key, its index among the group's wire lines, its 1-based number. */\nexport interface LineGroup {\n    row: SheetRowValue;\n    key: string;\n    index: number;\n    number: number;\n}\n\n/**\n * The band's cells and the title span, decoded from the wire group\n * declaration against the line columns.\n */\nexport interface SheetGroupIndex {\n    /** The field holding the lines — an `Array`, so a line's address is its position. */\n    linesField: string;\n    /** The band's cells by the line column key they sit under (the title under {@link TITLE_KEY}). */\n    cells: ReadonlyMap<string, SheetColumnMeta>;\n    /** How many leading columns the title spans — up to three, stopping before the first column with a band cell. */\n    titleSpan: number;\n    /** The host's word for a group (#844); `undefined` when it names none — the sheet's words say their own (#861). */\n    noun: SheetNounValue | undefined;\n    /** Whether rows of the line type stand between the groups (#846) — a LOOSE row: a wire row with no band. */\n    loose: boolean;\n}\n\n/**\n * Decode the wire group declaration.\n *\n * @param group - The wire group declaration\n * @param columns - The line columns\n * @param titleHeader - The sheet's word for the band title's column (#861)\n * @returns The band's cells, the title span and the host's noun\n */\nexport function indexGroup(group: SheetGroupValue, columns: SheetColumnIndex, titleHeader: string): SheetGroupIndex {\n    const cells = new Map<string, SheetColumnMeta>();\n    for (const cell of group.cells) {\n        const meta = indexColumns([{\n            key: cell.key, header: cell.key === TITLE_KEY ? titleHeader : columns.byKey.get(cell.key)?.header ?? cell.key,\n            sub: none, width: none, kind: cell.kind, dataType: cell.dataType, payloadType: cell.payloadType, editable: cell.editable, fill: [], detailCell: none,\n            from: none, mark: none,\n        }]).list[0]!;\n        cells.set(cell.key, meta);\n    }\n    let firstCell = columns.list.length;\n    columns.list.forEach((c, i) => { if (i < firstCell && cells.has(c.key)) firstCell = i; });\n    return { linesField: group.lines, cells, titleSpan: Math.max(1, Math.min(3, columns.list.length, firstCell)), noun: getSomeorUndefined(group.noun), loose: group.loose };\n}\n\n/**\n * Whether a grouped sheet's row is a LOOSE row between the groups (#846): a\n * row of the line type, with its own cells and no band.\n *\n * @param row - A grouped sheet's wire row\n * @returns `true` for a loose row, `false` for a group\n */\nexport function isLooseRow(row: SheetRowValue): boolean {\n    return row.band.type === \"none\";\n}\n\n/**\n * `n group(s)` in the host's noun, in the sheet's words — the count in the\n * app's locale (#850, #861).\n *\n * @param n - The count\n * @param noun - The host's word for a group\n * @param words - The sheet's words\n * @returns The phrase\n */\nexport function countNoun(n: number, noun: SheetNounValue, words: SheetWords): string {\n    return words.m.countNoun({ n, count: words.number(n), noun: noun.singular, nouns: noun.plural });\n}\n\n// A line's pseudo row is built once per group row and wire key, so its\n// identity is stable across body builds (the check cache, the row memo).\nconst lineRows = new WeakMap<SheetRowValue, Map<string, SheetRowValue>>();\n\n/** A line as a wire row — its group's id and key in the id, the group's `owned`, the line's cells and sub rows. */\nexport function lineRowOf(group: SheetRowValue, line: SheetLineValue): SheetRowValue {\n    let byKey = lineRows.get(group);\n    if (byKey === undefined) { byKey = new Map(); lineRows.set(group, byKey); }\n    const known = byKey.get(line.key);\n    if (known !== undefined && Object.is(known.cells, line.cells) && Object.is(known.subRows, line.subRows)) return known;\n    const row: SheetRowValue = { id: lineId(group.id, line.key), owned: group.owned, cells: line.cells, lines: [], band: none, subRows: line.subRows };\n    byKey.set(line.key, row);\n    return row;\n}\n\n/** The pseudo rows of a group's lines, in order. */\nexport function lineRowsOf(group: SheetRowValue): SheetRowValue[] {\n    return group.lines.map((l) => lineRowOf(group, l));\n}\n\n/** A group row with one line's cells replaced (by wire key), or appended when the key is not among its lines; the line keeps its sub rows. */\nexport function withLine(group: SheetRowValue, key: string, cells: ReadonlyMap<string, SheetCellValue>): SheetRowValue {\n    const lines = group.lines.map((l) => (l.key === key ? { ...l, cells: cells as Map<string, SheetCellValue> } : l));\n    if (!group.lines.some((l) => l.key === key)) lines.push({ key, cells: cells as Map<string, SheetCellValue>, subRows: [] });\n    return { ...group, lines };\n}\n\n/** A group row without the lines at the given wire keys. */\nexport function withoutLines(group: SheetRowValue, keys: ReadonlySet<string>): SheetRowValue {\n    return { ...group, lines: group.lines.filter((l) => !keys.has(l.key)) };\n}\n\n/** A line's ADDRESS in an edit event — its position among its group's lines. */\nexport function lineAddress(index: number): string {\n    return String(index);\n}\n\n/** The band's height per density (px). */\nexport function groupBandPx(size: \"sm\" | \"md\" | \"lg\"): number {\n    return size === \"sm\" ? 32 : size === \"lg\" ? 46 : 40;\n}\n\n// ── Registers and the driver ───────────────────────────────────────────────\n\n/**\n * The registers by name, with each member indexed by its key, by lower-cased\n * key or alias, and by the label it shows. A key names its own member before\n * anything else does — exactly, then case-insensitively before any alias — so\n * a member a gesture chooses, committed and shown by its key, is never found\n * again as another member whose alias or key's case its key shares (#1583).\n */\nexport interface SheetRegisterIndex {\n    byName: ReadonlyMap<string, readonly SheetRegisterMemberValue[]>;\n    /** Register name → key → member. */\n    keys: ReadonlyMap<string, ReadonlyMap<string, SheetRegisterMemberValue>>;\n    /** Register name → lower-cased key or alias → member: every member's key first, then the aliases. */\n    lookup: ReadonlyMap<string, ReadonlyMap<string, SheetRegisterMemberValue>>;\n    /** Register name → lower-cased label → the first member to show it. */\n    labels: ReadonlyMap<string, ReadonlyMap<string, SheetRegisterMemberValue>>;\n}\n\n/** Index the decoded registers. */\nexport function indexRegisters(registers: ReadonlyMap<string, { members: readonly SheetRegisterMemberValue[] }>): SheetRegisterIndex {\n    const byName = new Map<string, readonly SheetRegisterMemberValue[]>();\n    const keys = new Map<string, ReadonlyMap<string, SheetRegisterMemberValue>>();\n    const lookup = new Map<string, ReadonlyMap<string, SheetRegisterMemberValue>>();\n    const labels = new Map<string, ReadonlyMap<string, SheetRegisterMemberValue>>();\n    for (const [name, reg] of registers) {\n        byName.set(name, reg.members);\n        const exact = new Map<string, SheetRegisterMemberValue>();\n        const idx = new Map<string, SheetRegisterMemberValue>();\n        const shown = new Map<string, SheetRegisterMemberValue>();\n        for (const m of reg.members) {\n            if (!exact.has(m.key)) exact.set(m.key, m);\n            const k = m.key.toLowerCase();\n            if (!idx.has(k)) idx.set(k, m);\n        }\n        for (const m of reg.members) {\n            for (const a of m.aliases) {\n                const al = a.toLowerCase();\n                if (!idx.has(al)) idx.set(al, m);\n            }\n            const l = m.label.toLowerCase();\n            if (l !== \"\" && !shown.has(l)) shown.set(l, m);\n        }\n        keys.set(name, exact);\n        lookup.set(name, idx);\n        labels.set(name, shown);\n    }\n    return { byName, keys, lookup, labels };\n}\n\n/** The member a register resolves `text` to — by its key, else by key or alias case-insensitively: what a cell's value names. */\nexport function resolveMember(index: SheetRegisterIndex, register: string | undefined, text: string): SheetRegisterMemberValue | undefined {\n    if (register === undefined) return undefined;\n    return index.keys.get(register)?.get(text) ?? index.lookup.get(register)?.get(text.trim().toLowerCase());\n}\n\n/**\n * The member typed text names whole — by its key, else by key or alias\n * case-insensitively, else by the label it shows, the first member to show\n * it: a register column is typed in the words its cells show.\n *\n * @param index - The registers\n * @param register - The column's register\n * @param text - What was typed\n * @returns The member, or `undefined` where the text names none whole\n */\nexport function resolveTyped(index: SheetRegisterIndex, register: string | undefined, text: string): SheetRegisterMemberValue | undefined {\n    if (register === undefined) return undefined;\n    const t = text.trim();\n    return index.keys.get(register)?.get(t) ?? index.lookup.get(register)?.get(t.toLowerCase()) ?? index.labels.get(register)?.get(t.toLowerCase());\n}\n\n/** The driver member key a row resolves to — its driver column's String cell. */\nexport function driverKeyOf(row: SheetRowValue | undefined, driverColumn: string | undefined): string | undefined {\n    if (row === undefined || driverColumn === undefined) return undefined;\n    const cell = row.cells.get(driverColumn);\n    if (cell === undefined || cell.type !== \"String\") return undefined;\n    return cell.value === \"\" ? undefined : cell.value;\n}\n\n/**\n * The unit a quantity cell prints after its value: its row's driver member's,\n * else the one unit the column gives every row.\n *\n * @param meta - The column\n * @param driverKey - The row's driver member key, if it names one\n * @returns The unit, or `undefined` for a column with none\n */\nexport function unitOf(meta: SheetColumnMeta, driverKey: string | undefined): string | undefined {\n    return (driverKey !== undefined ? meta.uom?.get(driverKey) : undefined) ?? meta.unit;\n}\n\n// ── Cells ─────────────────────────────────────────────────────────────────\n\n/** The blank cell. */\nexport const NULL_CELL: SheetCellValue = variant(\"Null\", null);\n\n/** The empty link — both halves empty. */\nexport const EMPTY_LINK: SheetLinkValue = { from: [], to: [] };\n\n/** Whether a cell is blank (`Null`, an empty string, or an empty link). */\nexport function cellIsBlank(cell: SheetCellValue | undefined): boolean {\n    if (cell === undefined) return true;\n    switch (cell.type) {\n        case \"Null\": return true;\n        case \"String\": return cell.value === \"\";\n        case \"Link\": return cell.value.from.length === 0 && cell.value.to.length === 0;\n        default: return false;\n    }\n}\n\n/** Whether a row is blank — every declared cell blank. */\nexport function rowIsBlank(row: SheetRowValue, columns: SheetColumnIndex): boolean {\n    for (const c of columns.list) {\n        if (!cellIsBlank(row.cells.get(c.key))) return false;\n    }\n    return true;\n}\n\n/** A link member's text — the grammar's print form (B§4.1), what copy, search and the editor's buffer use. */\nexport function memberLabel(m: SheetMemberValue): string {\n    switch (m.type) {\n        case \"identified\": return m.value.key;\n        case \"range\": return `${m.value.from}-${m.value.to}`;\n        case \"counted\": return `${m.value.n} × ${m.value.key}`;\n        case \"placeholder\": return \"TBC\";\n        case \"text\": return m.value;\n    }\n    return \"\";\n}\n\n/** What a member's CHIP prints — its label, but a counted member as its kind alone: the count rides beside it ({@link memberChipCount}). */\nexport function memberChipLabel(m: SheetMemberValue): string {\n    return m.type === \"counted\" ? m.value.key : memberLabel(m);\n}\n\n/** A counted member's count, drawn as its chip's meta; `undefined` for every other member. */\nexport function memberChipCount(m: SheetMemberValue): string | undefined {\n    return m.type === \"counted\" ? String(m.value.n) : undefined;\n}\n\n/** Whether a member draws as a dashed chip (text · placeholder). */\nexport function memberIsDashed(m: SheetMemberValue): boolean {\n    return m.type === \"text\" || m.type === \"placeholder\";\n}\n\n/** A link value's planner text — `a > b` · `b` · `a >` (B§4.2). */\nexport function printLinkText(link: SheetLinkValue): string {\n    const a = link.from.map(memberLabel).join(\", \");\n    const b = link.to.map(memberLabel).join(\", \");\n    if (a !== \"\" && b !== \"\") return `${a} > ${b}`;\n    if (a !== \"\") return `${a} >`;\n    return b;\n}\n\n/**\n * A quantity's display text — through the declared format, in the viewer's\n * language (#852): `1,234.5`, `1.234,5` in German.\n *\n * @param n - The number\n * @param format - The column's declared format; `undefined` for a plain grouped number\n * @param words - The viewer's formatters\n * @returns The text; empty for a non-finite number\n */\nexport function formatQuantity(n: number, format: TickFormatOpt, words: Formatters): string {\n    if (!Number.isFinite(n)) return \"\";\n    return words.value(n, format);\n}\n\n/** A date's display text — the author's pattern, else `17 Nov 26`; East's own printer either way. */\nexport function formatDateCell(d: Date, pattern: string | undefined): string {\n    return formatDatePattern(pattern !== undefined && pattern !== \"\" ? pattern : DATE_DISPLAY_PATTERN, d);\n}\n\n/**\n * A cell's display text by kind (the read-only rendering). A link cell prints\n * through the grammar; a custom kind through its compiled `print`; a quantity\n * or integer in the viewer's language (#852) — the language its edit box\n * reads back.\n *\n * @param cell - The cell\n * @param meta - Its column\n * @param words - The viewer's formatters\n * @returns The text\n */\nexport function cellText(cell: SheetCellValue | undefined, meta: SheetColumnMeta, words: Formatters): string {\n    if (cell === undefined || cell.type === \"Null\") return \"\";\n    if (cell.type === \"Invalid\") return cell.value;\n    switch (meta.kind) {\n        case \"custom\":\n            if (meta.customPrint !== undefined) {\n                try { return meta.customPrint(cell); } catch (err) { console.error(`[Sheet] custom print failed on column \"${meta.key}\":`, err); }\n            }\n            return rawCellText(cell);\n        case \"date\":\n            return cell.type === \"DateTime\" ? formatDateCell(cell.value, meta.dateFormat) : rawCellText(cell);\n        case \"quantity\":\n            return cell.type === \"Float\" ? formatQuantity(cell.value, meta.format, words)\n                : cell.type === \"Integer\" ? formatQuantity(Number(cell.value), meta.format, words) : rawCellText(cell);\n        case \"integer\":\n            return cell.type === \"Integer\" ? formatQuantity(Number(cell.value), undefined, words)\n                : cell.type === \"Float\" ? formatQuantity(cell.value, undefined, words) : rawCellText(cell);\n        case \"action\":\n            // An action cell reads as its state's word (S4); its summary is a rule cell of its own.\n            return cell.type === \"Action\" ? actionColumnOf(meta)?.cases.get(cell.value.case)?.state ?? cell.value.case : rawCellText(cell);\n        case \"toggle\":\n            // A toggle reads as its state's word, the word typed back sets it.\n            return cell.type === \"Boolean\" && meta.states !== undefined ? (cell.value ? meta.states.on : meta.states.off) : rawCellText(cell);\n        default:\n            return rawCellText(cell);\n    }\n}\n\n/** A cell's text by its own tag, kind-agnostic. */\nexport function rawCellText(cell: SheetCellValue): string {\n    switch (cell.type) {\n        case \"Null\": return \"\";\n        case \"Boolean\": return String(cell.value);\n        case \"Integer\": return String(cell.value);\n        case \"Float\": return String(cell.value);\n        case \"Invalid\":\n        case \"String\": return cell.value;\n        case \"DateTime\": return formatDatePattern(DATE_DISPLAY_PATTERN, cell.value);\n        case \"Link\": return printLinkText(cell.value);\n        case \"Action\": return cell.value.case;\n    }\n    return \"\";\n}\n\n/** A sub row's printed text — its lead, detail and id, what a search matches it by. */\nexport function subRowText(s: SheetSubRowValue): string {\n    return [s.code, s.name, ...s.chips, ...s.facets.map((f) => `${f.label} ${f.value}`), s.id].filter((t) => t !== \"\").join(\" \");\n}\n\n// ── Marks and locks (#1560) ───────────────────────────────────────────────\n\n/** A cell's mark: the words drawn in it, and whether it locks the cell. */\nexport interface SheetCellMark {\n    /** The mark's words — a note, or why the cell is locked. */\n    words: string;\n    /** Whether the mark locks the cell, so no gesture writes it. */\n    lock: boolean;\n}\n\n/**\n * The mark on a column's cell, read off its row's cells where the column's\n * marks cross (`SheetMarkCellsType`): the root writes both cells for a mark,\n * and neither where the row has none.\n *\n * @param meta - The column\n * @param cells - The row's cells, read at the sheet's day; `undefined` for a row that holds none\n * @returns The mark, or `undefined` where the cell has none\n */\nexport function markOf(meta: Pick<SheetColumnMeta, \"raw\">, cells: ReadonlyMap<string, SheetCellValue> | undefined): SheetCellMark | undefined {\n    const at = getSomeorUndefined(meta.raw.mark);\n    if (at === undefined || cells === undefined) return undefined;\n    const words = cells.get(at.words);\n    if (words?.type !== \"String\") return undefined;\n    const lock = cells.get(at.lock);\n    return { words: words.value, lock: lock?.type === \"Boolean\" && lock.value };\n}\n\n/**\n * Whether a cell takes an edit — the one check every gesture asks, so none\n * can miss a lock: a step, typing, a paste, a clear, a fill and a drop. Its\n * column writes, and no mark locks it.\n *\n * @param meta - The column\n * @param cells - The row's cells; `undefined` for a row that holds none\n * @returns `true` when the cell can be edited\n */\nexport function cellWritable(meta: Pick<SheetColumnMeta, \"editable\" | \"raw\">, cells: ReadonlyMap<string, SheetCellValue> | undefined): boolean {\n    return meta.editable && markOf(meta, cells)?.lock !== true;\n}\n\n/**\n * Whether a column's cells take a clear. Every column's do but a column from\n * data's whose value isn't an option (its `from.clears`): there a blank is\n * nothing it can write.\n *\n * @param meta - The column\n * @returns `true` when a clear writes the cell blank\n */\nexport function takesClear(meta: Pick<SheetColumnMeta, \"raw\">): boolean {\n    const from = getSomeorUndefined(meta.raw.from);\n    return from === undefined || from.clears;\n}\n\n// ── The body ──────────────────────────────────────────────────────────────\n\n/**\n * One unloaded run of a paged source, above or below the resident rows — or,\n * under the lens (#1349), a stretch of the record it is still reading or\n * placing, where the narrowing's rows in it will be drawn.\n */\nexport interface SheetBand {\n    at: \"head\" | \"tail\" | \"reading\";\n    /** First source element covered (inclusive). */\n    from: number;\n    /** Last source element covered (inclusive). */\n    to: number;\n    /** How many of the sheet's elements it stands for, where that is not every one it covers: under the lens, the narrowing's rows in the stretch. */\n    elements?: number | undefined;\n    /** The band's pixel height (the ledger's geometry). */\n    px: number;\n}\n\n/** A resident window of a paged source whose read failed (#853) — one band where its rows would be. */\nexport interface SheetWindowFailure {\n    /** The window. */\n    w: number;\n    /** Its first and last source element (inclusive). */\n    from: number;\n    to: number;\n    /** How many of the sheet's elements it stands for, where that is not every one it covers: under the lens, the narrowing's rows in the segment. */\n    elements?: number | undefined;\n    /** Its height — the ledger's slot for it, so the rows that replace it take the same space. */\n    px: number;\n    /** Why its read failed. */\n    error: string;\n}\n\n/** A failed window, and the row it sits before (`rows.length`: after the last). */\nexport interface PlacedFailure {\n    failure: SheetWindowFailure;\n    at: number;\n}\n\n/** A contiguous run of rows between failed windows: `[start, end)`, and the source position of `start`. */\nexport interface RowSegment {\n    start: number;\n    end: number;\n    position: number;\n}\n\n/**\n * Where a paged run's failed windows sit among the rows on screen, and each\n * row's position (#853). The rows are the source's resident rows with the\n * local layer applied: a row the source served keeps its place relative to\n * the failed windows (by its source position), a row the planner added\n * follows the row before it. A position counts the rows before it — a row\n * removed locally renumbers the rows after it, as it always has — and every\n * element of a failed window before it: those rows exist, they could not be\n * read.\n *\n * @param rows - The rows on screen, in order\n * @param rowsOffset - The position of the run's first element\n * @param failures - The failed windows, ascending\n * @param sourcePosition - A row's source position, by id — `undefined` for a row the source did not serve\n * @returns Each row's position, where each failed window sits, and the contiguous segments between them\n */\nexport function layoutRun(\n    rows: readonly SheetRowValue[],\n    rowsOffset: number,\n    failures: readonly SheetWindowFailure[],\n    sourcePosition: (id: string) => number | undefined,\n): { positions: number[]; failures: PlacedFailure[]; segments: RowSegment[] } {\n    const positions = new Array<number>(rows.length);\n    const placed: PlacedFailure[] = [];\n    let next = 0;\n    let skipped = 0;\n    rows.forEach((row, i) => {\n        const at = sourcePosition(row.id);\n        while (at !== undefined && next < failures.length && at > failures[next]!.to) {\n            const failure = failures[next++]!;\n            placed.push({ failure, at: i });\n            skipped += failure.to - failure.from + 1;\n        }\n        positions[i] = rowsOffset + i + skipped;\n    });\n    for (; next < failures.length; next++) placed.push({ failure: failures[next]!, at: rows.length });\n    const segments: RowSegment[] = [];\n    let start = 0;\n    for (const { at } of placed) {\n        if (at > start) segments.push({ start, end: at, position: positions[start]! });\n        start = Math.max(start, at);\n    }\n    if (start < rows.length || segments.length === 0) segments.push({ start, end: rows.length, position: positions[start] ?? rowsOffset + rows.length + skipped });\n    return { positions, failures: placed, segments };\n}\n\n/**\n * The segment a row sits in — the contiguous run an author's context sees\n * around it (#853), so `rowsOffset + index` stays each of its rows' position.\n * A row past the end (a blank row, an append) is in the last one.\n *\n * @param segments - The run's segments ({@link layoutRun})\n * @param i - The row's index\n * @returns Its segment\n */\nexport function segmentOf(segments: readonly RowSegment[], i: number): RowSegment {\n    return segments.find((s) => i >= s.start && i < s.end) ?? segments[segments.length - 1]!;\n}\n\n/**\n * Where the rows the lens draws sit (#1349): each row's position in the\n * record — a row the planner added following the row before it — and the\n * contiguous runs of positions an author's context sees around a row, as\n * {@link layoutRun} gives them for a paged run.\n *\n * @param rows - The rows drawn, in order, the local layer applied\n * @param sourcePosition - A row's position in the record, by id — `undefined` for a row the record does not hold\n * @returns Each row's position, no failed windows (the lens draws a failed read as a band of its own), and the runs\n */\nexport function layoutLensRun(\n    rows: readonly SheetRowValue[],\n    sourcePosition: (id: string) => number | undefined,\n): { positions: number[]; failures: PlacedFailure[]; segments: RowSegment[] } {\n    const positions: number[] = [];\n    let last = -1;\n    for (const row of rows) {\n        const p = sourcePosition(row.id) ?? last + 1;\n        positions.push(p);\n        last = p;\n    }\n    const segments: RowSegment[] = [];\n    let start = 0;\n    for (let i = 1; i <= rows.length; i++) {\n        if (i < rows.length && positions[i] === positions[i - 1]! + 1) continue;\n        segments.push({ start, end: i, position: positions[start]! });\n        start = i;\n    }\n    if (segments.length === 0) segments.push({ start: 0, end: 0, position: 0 });\n    return { positions, failures: [], segments };\n}\n\n/** One body item — a real row (a line, when tagged with its group), a line's sub row, a blank padding row (a group's blank line, when tagged), a group's band, a paged band, or a proposal. */\nexport type SheetBodyItem =\n    | {\n        kind: \"real\";\n        /** The row's source position (0-based) — its row number minus one; a line: its GROUP's position. */\n        position: number;\n        /** Index among the RESIDENT real rows (the wire context's `rowIndex`); a line: its group's. */\n        residentIndex: number;\n        /** The wire row; a line: the pseudo row over the line's cells ({@link lineRowOf}). */\n        row: SheetRowValue;\n        /** A lens hit — the brand row number (B§8). */\n        hit: boolean;\n        /** A line's group (#740). */\n        group?: LineGroup | undefined;\n        /** A LOOSE row's index among the resident loose rows (#846) — a grouped sheet's row that belongs to no group. */\n        loose?: number | undefined;\n    }\n    | {\n        kind: \"blank\";\n        /** The sheet position the blank would take (0-based); a group's blank line: the group's position. */\n        position: number;\n        /** Which blank this is (0-based). */\n        blankIndex: number;\n        /** A group's blank line (#740) — `key` empty, `index` the line it would take. */\n        group?: LineGroup | undefined;\n    }\n    /**\n     * One SUB ROW under an open line (#844): full width under the line, none\n     * of the columns, outside the row space like a band — the ring never\n     * lands on it.\n     */\n    | {\n        kind: \"subRow\";\n        /** Its line's GROUP position, as the line's item has it. */\n        position: number;\n        /** The line it hangs under. */\n        group: LineGroup;\n        /** The line's synthetic id — the key its sub rows open under. */\n        lineId: string;\n        subRow: SheetSubRowValue;\n        /** Its index under the line, and how many the line has. */\n        index: number;\n        count: number;\n    }\n    /** A group's band (#740): the title, the eyebrow, the band cells, the fold. */\n    | {\n        kind: \"group\";\n        position: number;\n        residentIndex: number;\n        row: SheetRowValue;\n        folded: boolean;\n        /** The group's line count. */\n        count: number;\n    }\n    | { kind: \"band\"; band: SheetBand }\n    /** A resident window whose read failed (#853): its band, where its rows would be, with the reason and a Retry. */\n    | { kind: \"failed\"; failure: SheetWindowFailure }\n    | {\n        kind: \"proposal\";\n        /** The proposal's index under its anchor. */\n        index: number;\n        /** The row-space index of the anchor row. */\n        anchorR: number;\n        /** The sheet position the row would take (0-based) — its number minus one. */\n        position: number;\n        /** The 1-based number it would take (a line: within its group). */\n        number: number;\n        /** Proposed under a line (#740) — it carries the group's extent rule. */\n        grouped: boolean;\n        cells: ReadonlyMap<string, SheetCellValue>;\n        meta: string;\n    };\n\n/** What the body is built from. */\nexport interface SheetBodyInput {\n    /** The resident real rows, in sheet order (a grouped sheet: the groups). */\n    rows: readonly SheetRowValue[];\n    /** The source offset of `rows[0]` (`0` on the inline arm). */\n    rowsOffset: number;\n    /** Each row's position when the run has failed windows in it (#853, {@link layoutRun}); else `rowsOffset + i`. */\n    positions?: readonly number[] | undefined;\n    /** The failed windows, each drawn as a band before the row it sits before (#853). */\n    failures?: readonly PlacedFailure[] | undefined;\n    /** Padding rows below the last real one (a grouped sheet: `> 0` ⇒ each open group ends with a blank line). */\n    blanks: number;\n    /** Whether blanks may show — the inline arm, or a paged source that is exhausted. */\n    exhausted: boolean;\n    /** The source's total element count, once known (positions past the resident run). */\n    total: number | undefined;\n    head: SheetBand | undefined;\n    tail: SheetBand | undefined;\n    /** Whether each group is folded, and whether a line's sub rows were opened or closed by hand (`undefined` = never touched: closed). */\n    grouped?: { foldedOf: (row: SheetRowValue) => boolean; subRowsOpen?: ((lineId: string) => boolean | undefined) | undefined } | undefined;\n}\n\n/** Each failed window placed before row `i`, as body items (#853). */\nfunction failuresAt(input: SheetBodyInput, i: number, out: SheetBodyItem[]): void {\n    for (const p of input.failures ?? []) if (p.at === i) out.push({ kind: \"failed\", failure: p.failure });\n}\n\n/**\n * The body items, in order: head band · real rows (a failed window's band\n * where its rows would be, #853) · tail band · blanks. A grouped sheet builds\n * bands with their lines ({@link buildGroupedBody}). Under the lens the body\n * is the lens's ({@link buildLensBody}).\n */\nexport function buildBody(input: SheetBodyInput): SheetBodyItem[] {\n    if (input.grouped !== undefined) return buildGroupedBody(input, input.grouped);\n    const out: SheetBodyItem[] = [];\n    if (input.head !== undefined) out.push({ kind: \"band\", band: input.head });\n    input.rows.forEach((row, i) => {\n        failuresAt(input, i, out);\n        out.push({ kind: \"real\", position: input.positions?.[i] ?? input.rowsOffset + i, residentIndex: i, row, hit: false });\n    });\n    failuresAt(input, input.rows.length, out);\n    if (input.tail !== undefined) out.push({ kind: \"band\", band: input.tail });\n    if (input.exhausted) {\n        const last = input.total ?? input.rowsOffset + input.rows.length;\n        for (let i = 0; i < input.blanks; i++) {\n            out.push({ kind: \"blank\", position: last + i, blankIndex: i });\n        }\n    }\n    return out;\n}\n\n/**\n * A grouped sheet's body (#740): for each resident group its band, then —\n * unless folded — its lines, each open line's sub rows, and one blank line;\n * a LOOSE row between the groups (#846) is a plain row of its own.\n */\nfunction buildGroupedBody(input: SheetBodyInput, grouped: NonNullable<SheetBodyInput[\"grouped\"]>): SheetBodyItem[] {\n    const out: SheetBodyItem[] = [];\n    if (input.head !== undefined) out.push({ kind: \"band\", band: input.head });\n    // Each loose row's index among the resident loose rows.\n    let looseAt = 0;\n    input.rows.forEach((row, i) => {\n        failuresAt(input, i, out);\n        const loose = isLooseRow(row) ? looseAt++ : undefined;\n        groupItems(row, i, input.positions?.[i] ?? input.rowsOffset + i, false, grouped, input.blanks, out, loose);\n    });\n    failuresAt(input, input.rows.length, out);\n    if (input.tail !== undefined) out.push({ kind: \"band\", band: input.tail });\n    return out;\n}\n\n/**\n * One shown group's items: its band, then — unless folded — its lines, each\n * open line's sub rows, and its blank line (`blanks` > 0); a loose row (#846)\n * is one plain row. A group the lens's narrowing holds (`hit`) draws its\n * lines as matches, as a loose row the narrowing holds is one. The body, the\n * lens's body and the paged driver's window heights all come from here (#855).\n */\nfunction groupItems(\n    row: SheetRowValue,\n    i: number,\n    position: number,\n    hit: boolean,\n    grouped: NonNullable<SheetBodyInput[\"grouped\"]>,\n    blanks: number,\n    out: SheetBodyItem[],\n    loose?: number,\n): void {\n    if (isLooseRow(row)) {\n        out.push({ kind: \"real\", position, residentIndex: i, row, hit, loose: loose ?? 0 });\n        return;\n    }\n    const folded = grouped.foldedOf(row);\n    out.push({ kind: \"group\", position, residentIndex: i, row, folded, count: row.lines.length });\n    if (folded) return;\n    row.lines.forEach((line, j) => {\n        const lg: LineGroup = { row, key: line.key, index: j, number: j + 1 };\n        out.push({ kind: \"real\", position, residentIndex: i, row: lineRowOf(row, line), hit, group: lg });\n        // An open line's sub rows hang under it, opened by hand.\n        const subRows = line.subRows;\n        if (subRows.length === 0) return;\n        const id = lineId(row.id, line.key);\n        if (grouped.subRowsOpen?.(id) !== true) return;\n        subRows.forEach((subRow, k) => out.push({ kind: \"subRow\", position, group: lg, lineId: id, subRow, index: k, count: subRows.length }));\n    });\n    if (blanks > 0) {\n        out.push({ kind: \"blank\", position, blankIndex: 0, group: { row, key: \"\", index: row.lines.length, number: row.lines.length + 1 } });\n    }\n}\n\n/** One item of the lens's layout, the local layer applied to its rows (#1349): what {@link buildLensBody} draws. */\nexport type LensBodyInput =\n    /** A row drawn — one the narrowing holds, or one the planner added — at its position in the record. */\n    | { kind: \"row\"; position: number; row: SheetRowValue; hit: boolean }\n    /** A stretch still being read or placed. */\n    | { kind: \"band\"; band: SheetBand }\n    /** A segment whose read failed, or whose rows disagree with where e3 placed the narrowing's. */\n    | { kind: \"failed\"; failure: SheetWindowFailure };\n\n/**\n * The body under the lens (#1349): what it laid out over the record, in its\n * order — each row drawn and its bands. A grouped sheet's rows are its groups,\n * the records the narrowing holds: each shown group draws its band and, unless\n * folded, its lines and their open sub rows — a match's lines marked — and no\n * blank line, for a lens never invites the next row.\n *\n * @param items - The layout, the local layer applied to its rows\n * @param grouped - A grouped sheet's folds and open sub rows (`undefined` on a flat sheet)\n * @returns The body items\n */\nexport function buildLensBody(items: readonly LensBodyInput[], grouped: SheetBodyInput[\"grouped\"]): SheetBodyItem[] {\n    const out: SheetBodyItem[] = [];\n    // Each row's index among the rows drawn — the wire context's `rowIndex` — and each loose row's among the loose rows.\n    let resident = 0;\n    let looseAt = 0;\n    for (const item of items) {\n        switch (item.kind) {\n            case \"band\": out.push({ kind: \"band\", band: item.band }); break;\n            case \"failed\": out.push({ kind: \"failed\", failure: item.failure }); break;\n            case \"row\": {\n                const i = resident++;\n                if (grouped === undefined) {\n                    out.push({ kind: \"real\", position: item.position, residentIndex: i, row: item.row, hit: item.hit });\n                    break;\n                }\n                groupItems(item.row, i, item.position, item.hit, grouped, 0, out, isLooseRow(item.row) ? looseAt++ : undefined);\n                break;\n            }\n        }\n    }\n    return out;\n}\n\n/** The heights a sheet draws its items at (#855): a row's, a group band's and a sub row's least height. */\nexport interface SheetGeometry {\n    rowPx: number;\n    bandPx: number;\n    subRowPx: number;\n}\n\n/**\n * A body item's least height (#855): what the rows are estimated at until\n * they are measured, and what the paged driver sizes a window by.\n *\n * @param item - The body item\n * @param g - The sheet's geometry\n * @returns Its height in px\n */\nexport function itemPx(item: SheetBodyItem, g: SheetGeometry): number {\n    switch (item.kind) {\n        case \"group\": return g.bandPx;\n        case \"subRow\": return g.subRowPx;\n        case \"failed\": return Math.max(BAND_MIN_PX, item.failure.px);\n        case \"band\": return Math.max(BAND_MIN_PX, item.band.px);\n        default: return g.rowPx;\n    }\n}\n\n/**\n * What one source row draws, in px (#855): the least height of the items the\n * body builds for it. A flat row — or a loose row between the groups (#846) —\n * is one row; a group is its band and, unless folded, its lines, their open\n * sub rows and its blank line when the sheet draws one. The paged driver sizes\n * a window by it, so an unloaded band is as tall as its rows will be.\n *\n * @param row - A source row\n * @param g - The sheet's geometry\n * @param grouped - A grouped sheet's folds and open sub rows (`undefined` on a flat sheet)\n * @param blanks - The grouped sheet's blank lines per group (`0` when it draws none)\n * @returns Its height in px\n */\nexport function drawnPx(row: SheetRowValue, g: SheetGeometry, grouped: SheetBodyInput[\"grouped\"], blanks: number): number {\n    if (grouped === undefined) return g.rowPx;\n    const items: SheetBodyItem[] = [];\n    groupItems(row, 0, 0, false, grouped, blanks, items);\n    let px = 0;\n    for (const it of items) px += itemPx(it, g);\n    return px;\n}\n\n/**\n * The body with the copilot's proposed rows spliced in under their anchor\n * (B§5.2): dashed-topped hatched rows with real row numbers, excluded from\n * the row space like bands. Under a line anchor they number on within the\n * group, after the line's open sub rows.\n */\nexport function withProposals(\n    body: readonly SheetBodyItem[],\n    anchorBodyIndex: number,\n    rows: readonly { cells: ReadonlyMap<string, SheetCellValue>; meta: string }[],\n): SheetBodyItem[] {\n    if (rows.length === 0 || anchorBodyIndex < 0 || anchorBodyIndex >= body.length) return body as SheetBodyItem[];\n    const anchor = body[anchorBodyIndex]!;\n    if (anchor.kind !== \"real\" && anchor.kind !== \"blank\") return body as SheetBodyItem[];\n    let r = 0;\n    for (let i = 0; i <= anchorBodyIndex; i++) if (isRowSpace(body[i]!)) r++;\n    const anchorR = r - 1;\n    const anchorNumber = anchor.group !== undefined ? anchor.group.number : anchor.position + 1;\n    let at = anchorBodyIndex;\n    const anchorId = anchor.kind === \"real\" ? anchor.row.id : undefined;\n    while (anchorId !== undefined) {\n        const next = body[at + 1];\n        if (next?.kind !== \"subRow\" || next.lineId !== anchorId) break;\n        at++;\n    }\n    const out = body.slice(0, at + 1);\n    rows.forEach((p, i) => out.push({ kind: \"proposal\", index: i, anchorR, position: anchor.position + 1 + i, number: anchorNumber + 1 + i, grouped: anchor.group !== undefined, cells: p.cells, meta: p.meta }));\n    return out.concat(body.slice(at + 1));\n}\n\n/** Whether a body item occupies the ROW space (paged bands, sub rows and proposals do not; group summaries do). */\nexport function isRowSpace(item: SheetBodyItem): boolean {\n    return item.kind === \"real\" || item.kind === \"blank\" || item.kind === \"group\";\n}\n\n/** The body index of the real row (or the group band) with `id`, if resident. */\nexport function bodyIndexOfId(body: readonly SheetBodyItem[], id: string): number {\n    return body.findIndex((it) => (it.kind === \"real\" || it.kind === \"group\") && it.row.id === id);\n}\n\n/** The synthetic id of a blank item — a padding row's by position, a group's blank line's by group. */\nexport function blankIdOf(item: Extract<SheetBodyItem, { kind: \"blank\" }>): string {\n    return item.group !== undefined ? blankLineId(item.group.row.id) : blankRowId(item.position);\n}\n\n/** The last REAL row's id, if any — what an insert at the end lands after. */\nexport function lastRealId(body: readonly SheetBodyItem[]): string | undefined {\n    for (let i = body.length - 1; i >= 0; i--) {\n        const it = body[i]!;\n        if (it.kind === \"real\") return it.row.id;\n    }\n    return undefined;\n}\n\n/** A mounted body item's box on the screen (px). */\nexport interface ItemBox {\n    top: number;\n    bottom: number;\n}\n\n/**\n * What sticks under the column header, read off the MOUNTED rows rather than\n * estimated offsets, so rows that grew (wrapped chips, a sub row's wrapped\n * detail) never skew it:\n *\n * - the BAND of the group the row under the header belongs to, once that band\n *   has scrolled under the header (#740, G1) — never a folded group's, which\n *   has no lines under the header to stand for, nor over a loose row (#846),\n *   which belongs to no group;\n * - under that band, the open LINE the row under the band belongs to, once\n *   the line's own row has scrolled under the band — its sub rows scroll\n *   under it, and as its last sub row leaves, the line is pushed up with it.\n *\n * An item within a pixel of an edge counts as clear of it, so a row brought\n * to sit exactly under the band stops sticking.\n *\n * @param body - The body items\n * @param boxes - The mounted items' boxes, by body index\n * @param headerBottom - The header's bottom edge, on the boxes' scale\n * @param bandPx - The sticking band's height\n * @param rowPx - A line's height when its own row is not mounted\n * @returns The sticking band's body index; the sticking line's, and the top it sits at\n */\nexport function stickyRows(\n    body: readonly SheetBodyItem[],\n    boxes: ReadonlyMap<number, ItemBox>,\n    headerBottom: number,\n    bandPx: number,\n    rowPx: number,\n): { band: number | undefined; line: { index: number; top: number } | undefined } {\n    const at = (y: number): number | undefined => {\n        for (const [i, b] of boxes) if (b.top <= y && y < b.bottom) return i;\n        return undefined;\n    };\n    const u = at(headerBottom + 1);\n    let band: number | undefined;\n    for (let i = u ?? -1; i >= 0; i--) {\n        const it = body[i]!;\n        if (it.kind === \"group\") {\n            if (!it.folded && (boxes.get(i)?.top ?? -Infinity) <= headerBottom - 1) band = i;\n            break;\n        }\n        if (it.kind === \"band\" || it.kind === \"failed\") break;\n        if (it.kind === \"real\" && it.loose !== undefined) break;\n    }\n    const group = band !== undefined ? body[band] : undefined;\n    if (group?.kind !== \"group\") return { band, line: undefined };\n    const zone = headerBottom + bandPx;\n    const v = at(zone + 1);\n    if (v === undefined) return { band, line: undefined };\n    let l = v;\n    while (l > 0 && body[l]!.kind === \"subRow\") l--;\n    const line = body[l]!;\n    const opens = (k: number): boolean => { const s = body[k]; return s?.kind === \"subRow\" && line.kind === \"real\" && s.lineId === line.row.id; };\n    if (line.kind !== \"real\" || line.group?.row.id !== group.row.id || !opens(l + 1)) return { band, line: undefined };\n    const own = boxes.get(l);\n    if (own !== undefined && own.top > zone - 1) return { band, line: undefined };\n    let last = l + 1;\n    while (opens(last + 1)) last++;\n    const height = own !== undefined ? own.bottom - own.top : rowPx;\n    const end = boxes.get(last)?.bottom ?? Infinity;\n    return { band, line: { index: l, top: zone + Math.min(0, end - zone - height) } };\n}\n\n// ── Sizing ────────────────────────────────────────────────────────────────\n\n/** The blank-padding default (B§7). */\nexport const DEFAULT_BLANKS = 18;\n\n/** The gutter width default (px, the §7 sheet). */\nexport const DEFAULT_GUTTER_PX = 80;\n\n/** The band height (px) of a paged source's unloaded run when the ledger has no better geometry. */\nexport const BAND_MIN_PX = 22;\n\n/** The bottom padding below the last blank row (px). */\nexport const BOTTOM_PAD_PX = 120;\n\n/** The decoded root's density → recipe size + row height. */\nexport function densityOf(value: SheetRootValue): \"sm\" | \"md\" | \"lg\" {\n    const tag = getSomeorUndefined(value.density)?.type;\n    return tag === \"compact\" || tag === \"condensed\" ? \"sm\" : tag === \"comfortable\" ? \"lg\" : \"md\";\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The link grammar (B§4.1 — `Sheet Spec.md` §5 row 4): text ↔\n * `Sheet.Types.Link`, resolved against a column's register and the member\n * kinds it declares.\n *\n * - **identified** — a register key or alias, case-insensitively; bare digits\n *   try the identified keys' letter prefixes (`2140` ⇒ `R2140`); a\n *   `number + unit` attribute the register knows (`3m`, `3 M` ⇒ the\n *   `3 m beam saw` family) resolves with its spacing normalised — countable\n *   by attribute.\n * - **range** — `R2140-45` expands through the register; a short upper bound\n *   completes from the lower. A hyphen is a range only between two UNSPACED\n *   bare numbers — spaced, or beside a name, it is an arrow.\n * - **counted** — `N x kind` / `kind x N` with the declared ops, countable\n *   kinds only; a trailing qualifier becomes its own text token; multiplying\n *   an identified member keeps the whole token as text.\n * - **placeholder** — `TBC`.\n * - **text** — anything else, kept as typed. Entry is never blocked.\n *\n * The East-side twin (`Sheet.link.parse` / `print` in east-ui's `link.ts`)\n * is the syntactic half a task can run without the renderer; this module\n * adds the register-aware resolution the editor needs.\n */\n\nimport { variant } from \"@elaraai/east\";\nimport { memberLabel, type SheetColumnMeta } from \"../model.js\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { SheetLinkValue, SheetMemberValue, SheetRegisterMemberValue } from \"../values.js\";\nimport type { SheetWords } from \"../words.js\";\n\n/** The arrow forms that separate the halves (B§4.1). */\nexport const ARROW = /\\s*(?:->|-->|=>|→|>)\\s*|\\s+[-–]\\s+/;\n\n/** One declared member kind (the column's `members` list). */\nexport interface MemberKindDecl {\n    kind: string;\n    identified: boolean;\n    countable: boolean;\n    resolvesTo: string | undefined;\n    /** Runs of this kind's consecutive codes are named as one RANGE (#844): the entry menu offers each run as a range. */\n    ranged: boolean;\n}\n\n/** What the grammar resolves against — a column's register and its declared kinds. */\nexport interface LinkVocabulary {\n    /** The register's members. */\n    members: readonly SheetRegisterMemberValue[];\n    /** Lower-cased key → member. */\n    byKey: ReadonlyMap<string, SheetRegisterMemberValue>;\n    /** Lower-cased alias → member. */\n    byAlias: ReadonlyMap<string, SheetRegisterMemberValue>;\n    /** The declared member kinds. */\n    kinds: readonly MemberKindDecl[];\n    /** Kinds that resolve by code. */\n    identifiedKinds: ReadonlySet<string>;\n    /** Kinds that take the counted form. */\n    countableKinds: ReadonlySet<string>;\n    /** Whether ranges are accepted (a `range` kind is declared). */\n    ranges: boolean;\n    /** The multiplication tokens (`x`, `X`, `*`, `×`). */\n    ops: readonly string[];\n    /** The letter prefixes of the identified keys of the form `LETTERS+DIGITS` (`R` for `R2140`). */\n    prefixes: readonly string[];\n}\n\nconst DEFAULT_OPS = [\"x\", \"X\", \"*\", \"×\"];\n\n/** Build the vocabulary of a link / set column. */\nexport function linkVocabulary(meta: SheetColumnMeta, members: readonly SheetRegisterMemberValue[]): LinkVocabulary {\n    // The declaration rides the decoded kind — the variant narrows on `type`.\n    const kind = meta.raw.kind;\n    const decl = kind.type === \"link\" || kind.type === \"set\" ? kind.value : undefined;\n    const kinds: MemberKindDecl[] = (decl?.members ?? []).map((k) => ({\n        kind: k.kind, identified: k.identified, countable: k.countable, resolvesTo: getSomeorUndefined(k.resolvesTo),\n        ranged: k.ranged,\n    }));\n    const multiple = decl !== undefined ? getSomeorUndefined(decl.multiple) : undefined;\n    const byKey = new Map<string, SheetRegisterMemberValue>();\n    const byAlias = new Map<string, SheetRegisterMemberValue>();\n    const prefixes = new Set<string>();\n    const identifiedKinds = new Set(kinds.filter((k) => k.identified).map((k) => k.kind));\n    const countableKinds = new Set(kinds.filter((k) => k.countable).map((k) => k.kind));\n    for (const m of members) {\n        const k = m.key.toLowerCase();\n        if (!byKey.has(k)) byKey.set(k, m);\n        for (const a of m.aliases) {\n            const al = a.toLowerCase();\n            if (!byAlias.has(al)) byAlias.set(al, m);\n        }\n        const pm = /^([A-Za-z]+)(\\d+)$/.exec(m.key);\n        if (pm !== null && (identifiedKinds.size === 0 || identifiedKinds.has(m.kind))) prefixes.add(pm[1]!);\n    }\n    return {\n        members, byKey, byAlias, kinds, identifiedKinds, countableKinds,\n        ranges: kinds.some((k) => k.kind === \"range\"),\n        ops: multiple?.ops ?? DEFAULT_OPS,\n        prefixes: [...prefixes],\n    };\n}\n\n/**\n * The vocabulary narrowed to the members a row may be OFFERED (a link\n * column's `options` rule, #844): the entry menu, the\n * candidates and the grammar line read it, in the rule's order (the entry\n * menu leads with what the rule put first); a kind with no member left drops\n * out of the grammar line. Resolution of typed text keeps the whole register.\n */\nexport function narrowVocabulary(vocab: LinkVocabulary, allowed: ReadonlySet<string>): LinkVocabulary {\n    const rank = new Map<string, number>();\n    for (const k of allowed) if (!rank.has(k.toLowerCase())) rank.set(k.toLowerCase(), rank.size);\n    const members = vocab.members.filter((m) => rank.has(m.key.toLowerCase())).sort((a, b) => rank.get(a.key.toLowerCase())! - rank.get(b.key.toLowerCase())!);\n    const left = new Set(members.map((m) => m.kind));\n    const anyIdentified = members.some((m) => isIdentified(vocab, m));\n    const kinds = vocab.kinds.filter((k) => left.has(k.kind) || (k.kind === \"range\" && anyIdentified));\n    const byKey = new Map<string, SheetRegisterMemberValue>();\n    const byAlias = new Map<string, SheetRegisterMemberValue>();\n    const prefixes = new Set<string>();\n    const identifiedKinds = new Set(kinds.filter((k) => k.identified).map((k) => k.kind));\n    const countableKinds = new Set(kinds.filter((k) => k.countable).map((k) => k.kind));\n    for (const m of members) {\n        const k = m.key.toLowerCase();\n        if (!byKey.has(k)) byKey.set(k, m);\n        for (const a of m.aliases) { const al = a.toLowerCase(); if (!byAlias.has(al)) byAlias.set(al, m); }\n        const pm = /^([A-Za-z]+)(\\d+)$/.exec(m.key);\n        if (pm !== null && (identifiedKinds.size === 0 || identifiedKinds.has(m.kind))) prefixes.add(pm[1]!);\n    }\n    return { ...vocab, members, byKey, byAlias, kinds, identifiedKinds, countableKinds, ranges: kinds.some((k) => k.kind === \"range\"), prefixes: [...prefixes] };\n}\n\n/** Whether a member's kind takes the counted form. */\nexport function isCountable(vocab: LinkVocabulary, m: SheetRegisterMemberValue): boolean {\n    return vocab.countableKinds.size === 0 ? false : vocab.countableKinds.has(m.kind);\n}\n\n/** Whether a member's kind resolves by code (identified). */\nexport function isIdentified(vocab: LinkVocabulary, m: SheetRegisterMemberValue): boolean {\n    return vocab.identifiedKinds.size === 0 ? !isCountable(vocab, m) : vocab.identifiedKinds.has(m.kind);\n}\n\n/**\n * The register key a `number + unit` attribute names — `3m` · `3 M` ·\n * `3  m` ⇒ the `3 m beam saw` family — by key or alias, with the spacing\n * between the number and the unit normalised both ways.\n */\nexport function attributeKey(raw: string, vocab: LinkVocabulary): string | undefined {\n    const m = /^(\\d+(?:[.,]\\d+)?)\\s*([^\\d\\s]{1,8})$/.exec(raw.trim().toLowerCase());\n    if (m === null) return undefined;\n    for (const form of [`${m[1]}${m[2]}`, `${m[1]} ${m[2]}`]) {\n        const hit = vocab.byKey.get(form) ?? vocab.byAlias.get(form);\n        if (hit !== undefined) return hit.key;\n    }\n    return undefined;\n}\n\n/** The register member a token names — key, alias (a leading \"the\" dropped), a `number + unit` attribute, or bare digits + a prefix. */\nexport function resolveMember(raw: string, vocab: LinkVocabulary): SheetRegisterMemberValue | undefined {\n    const t = raw.trim().toLowerCase().replace(/\\s+/g, \" \");\n    if (t === \"\") return undefined;\n    const direct = vocab.byKey.get(t) ?? vocab.byKey.get(t.replace(/\\s+/g, \"\"));\n    if (direct !== undefined) return direct;\n    const alias = vocab.byAlias.get(t) ?? vocab.byAlias.get(t.replace(/^the\\s+/, \"\"));\n    if (alias !== undefined) return alias;\n    const named = vocab.byKey.get(t.replace(/^the\\s+/, \"\"));\n    if (named !== undefined) return named;\n    const attr = attributeKey(raw, vocab);\n    if (attr !== undefined) return vocab.byKey.get(attr.toLowerCase());\n    if (/^\\d{2,}$/.test(t)) {\n        for (const p of vocab.prefixes) {\n            const hit = vocab.byKey.get(`${p.toLowerCase()}${t}`);\n            if (hit !== undefined) return hit;\n        }\n    }\n    return undefined;\n}\n\n/** A regex over the declared multiplication tokens. */\nfunction opsClass(vocab: LinkVocabulary): string {\n    return `[${vocab.ops.map((o) => o.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"\")}]`;\n}\n\n/** The counted form — a count either side of an operator (`4 x router`, `Bay 2 × 3`). */\nexport function parseMultiple(raw: string, vocab: LinkVocabulary): { n: number; rest: string } | undefined {\n    const ops = opsClass(vocab);\n    const m = new RegExp(`^(?:(\\\\d{1,3})\\\\s*${ops}\\\\s*(.+)|(.+?)\\\\s*${ops}\\\\s*(\\\\d{1,3}))$`, \"i\").exec(raw.trim());\n    if (m === null) return undefined;\n    const n = Number(m[1] ?? m[4]);\n    const rest = (m[2] ?? m[3] ?? \"\").trim();\n    return n > 0 && rest !== \"\" ? { n, rest } : undefined;\n}\n\n/** A code's letters, number and optional trailing letter (`R2140`, `L0700B` — some registers' codes carry a suffix). */\nconst CODE = /^([A-Za-z]*)(\\d+)([A-Za-z]?)$/;\n\n/** The identified members in a numeric span — `R2140` … `R2145` — with the letters of `from` (and its suffix, when it has one). */\nexport function rangeMembers(from: string, to: string, vocab: LinkVocabulary): SheetRegisterMemberValue[] {\n    const a = CODE.exec(from);\n    const b = CODE.exec(to);\n    if (a === null || b === null) return [];\n    const prefix = a[1]!.toLowerCase();\n    const suffix = a[3]!.toLowerCase();\n    const lo = Math.min(Number(a[2]), Number(b[2]));\n    const hi = Math.max(Number(a[2]), Number(b[2]));\n    const out: SheetRegisterMemberValue[] = [];\n    for (const m of vocab.members) {\n        if (!isIdentified(vocab, m)) continue;\n        const km = CODE.exec(m.key);\n        if (km === null || km[1]!.toLowerCase() !== prefix || km[3]!.toLowerCase() !== suffix) continue;\n        const n = Number(km[2]);\n        if (n >= lo && n <= hi) out.push(m);\n    }\n    return out;\n}\n\n/**\n * A range token — `R2140-45` / `2140-2145` — to its normalised bounds, when\n * the register has members in the span. A short upper bound completes from\n * the lower; bare digits take an identified prefix that yields members.\n */\nexport function parseRange(raw: string, vocab: LinkVocabulary): { from: string; to: string; members: SheetRegisterMemberValue[] } | undefined {\n    if (!vocab.ranges) return undefined;\n    // Unspaced only: `R2140 - 45` is an arrow between two members, never a range. A trailing letter rides on either bound (`L0700B-L0823B`, `L0700B-23`).\n    const m = /^([A-Za-z]*)(\\d{2,})([A-Za-z]?)[-–]([A-Za-z]*)(\\d{1,})([A-Za-z]?)$/.exec(raw.trim());\n    if (m === null) return undefined;\n    let upper = m[5]!;\n    if (upper.length < m[2]!.length) upper = m[2]!.slice(0, m[2]!.length - upper.length) + upper;\n    const suffix = (m[3] !== \"\" ? m[3]! : m[6]!).toUpperCase();\n    const letters = m[1] !== \"\" ? [m[1]!] : m[4] !== \"\" ? [m[4]!] : vocab.prefixes;\n    for (const p of letters) {\n        // Take the register's own casing of the prefix.\n        const sample = vocab.members.find((x) => x.key.toLowerCase().startsWith(p.toLowerCase()) && /^[A-Za-z]+\\d+[A-Za-z]?$/.test(x.key));\n        const prefix = sample !== undefined ? sample.key.slice(0, p.length) : p.toUpperCase();\n        const from = `${prefix}${m[2]}${suffix}`;\n        const to = `${prefix}${upper}${suffix}`;\n        const members = rangeMembers(from, to, vocab);\n        if (members.length > 0) return { from, to, members };\n    }\n    return undefined;\n}\n\n// Members are built through `variant()` — a hand-rolled `{ type, value }` lacks the brand the encoder needs.\nconst identified = (key: string): SheetMemberValue => variant(\"identified\", { key });\nconst counted = (n: number, key: string): SheetMemberValue => variant(\"counted\", { n: BigInt(n), key });\nconst range = (from: string, to: string): SheetMemberValue => variant(\"range\", { from, to });\nconst text = (t: string): SheetMemberValue => variant(\"text\", t);\nconst PLACEHOLDER: SheetMemberValue = variant(\"placeholder\", null);\n\n/**\n * One token to its members: the placeholder, a range, a register member, the\n * counted form (a trailing qualifier becomes its own text token; multiplying\n * an identified member keeps the token as text), else text.\n */\nexport function classifyToken(raw: string, vocab: LinkVocabulary): SheetMemberValue[] {\n    const s = raw.trim().replace(/-+$/, \"\").trim();\n    if (s === \"\") return [];\n    if (/^tbc$/i.test(s)) return [PLACEHOLDER];\n    const rng = parseRange(s, vocab);\n    if (rng !== undefined) return [range(rng.from, rng.to)];\n    const mult = parseMultiple(s, vocab);\n    if (mult !== undefined) {\n        const words = mult.rest.split(/\\s+/);\n        for (let k = words.length; k >= 1; k--) {\n            const head = words.slice(0, k).join(\" \");\n            const base = resolveMember(head, vocab);\n            if (base === undefined) continue;\n            if (!isCountable(vocab, base)) return [text(s)];\n            const tail = words.slice(k).join(\" \").trim();\n            return tail !== \"\" ? [counted(mult.n, base.key), text(tail)] : [counted(mult.n, base.key)];\n        }\n    }\n    const member = resolveMember(s, vocab);\n    if (member !== undefined) return [identified(member.key)];\n    return [text(s)];\n}\n\n/** The members of one half — comma-separated tokens. */\nexport function parseHalfText(textIn: string, vocab: LinkVocabulary): SheetMemberValue[] {\n    return textIn.split(\",\").flatMap((tok) => classifyToken(tok, vocab));\n}\n\n/** The planner's text to a link — `a > b` both halves, `b` destination only, `a >` source only. */\nexport function parseLinkText(textIn: string, vocab: LinkVocabulary): SheetLinkValue {\n    const parts = textIn.split(ARROW);\n    if (parts.length === 1) return { from: [], to: parseHalfText(parts[0] ?? \"\", vocab) };\n    const from = parseHalfText(parts[0] ?? \"\", vocab);\n    const to = parts.slice(1).flatMap((p) => parseHalfText(p, vocab));\n    return { from, to };\n}\n\n/**\n * A member's chip meta — the register's line, `unassigned` for a counted\n * member (a count names no one in particular), the span of a range; the\n * sheet's words where it has its own (#861).\n *\n * @param m - The member\n * @param vocab - The column's vocabulary\n * @param w - The sheet's words\n * @returns The meta, or `\"\"`\n */\nexport function memberMeta(m: SheetMemberValue, vocab: LinkVocabulary, w: SheetWords): string {\n    switch (m.type) {\n        case \"identified\": {\n            const reg = vocab.byKey.get(m.value.key.toLowerCase());\n            return reg !== undefined ? getSomeorUndefined(reg.meta) ?? \"\" : \"\";\n        }\n        case \"counted\":\n            return vocab.byKey.has(m.value.key.toLowerCase()) ? w.m.unassigned() : \"\";\n        case \"range\": {\n            // The span in the kind's own word: `6 machines`.\n            const n = rangeMembers(m.value.from, m.value.to, vocab).length;\n            const kind = vocab.byKey.get(m.value.from.toLowerCase())?.kind;\n            return n > 0 ? w.m.rangeSpan({ n, count: w.number(n), kind }) : \"\";\n        }\n        default:\n            return \"\";\n    }\n}\n\n/** A member kind as a plural word (`machine` → `machines`, `family` → `families`, `bench` → `benches`). */\nexport function pluralKind(kind: string): string {\n    if (/[^aeiou]y$/i.test(kind)) return `${kind.slice(0, -1)}ies`;\n    if (/(s|x|z|ch|sh)$/i.test(kind)) return `${kind}es`;\n    return `${kind}s`;\n}\n\n/** The register key a member counts against — `undefined` for text and the placeholder. */\nexport function memberKey(m: SheetMemberValue): string | undefined {\n    switch (m.type) {\n        case \"identified\": return m.value.key;\n        case \"counted\": return m.value.key;\n        case \"range\": return m.value.from;\n        default: return undefined;\n    }\n}\n\n/** The lower-cased keys a link's members already hold — a member is never offered twice. */\nexport function usedKeys(members: readonly SheetMemberValue[], vocab: LinkVocabulary): Set<string> {\n    const used = new Set<string>();\n    for (const m of members) {\n        if (m.type === \"range\") {\n            for (const x of rangeMembers(m.value.from, m.value.to, vocab)) used.add(x.key.toLowerCase());\n            continue;\n        }\n        const k = memberKey(m);\n        if (k !== undefined) used.add(k.toLowerCase());\n    }\n    return used;\n}\n\n/** Print a link the way the planner types it (the model's print, re-exported for the grammar's callers). */\nexport { memberLabel as printMember };\nexport { printLinkText } from \"../model.js\";\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Every word the Sheet says itself (#861) — ONE typed message table, the\n * Plan's #820 table's twin. The toolbar and the view tabs, the header, the\n * rows, a failed run's line, the strip, the editor and the link cells, the\n * footer and the history bar, the insertion chips, the message each gesture\n * leaves, and the words it gives a reader for what it shows only by look all\n * come from here. What the AUTHOR wrote — a column's header, a group's noun,\n * a register's labels, a lock's tag, a footer item — is data, and never\n * passes through it; neither does what an input GRAMMAR reads (the date and\n * link grammars keep their forms).\n *\n * Each message is a function of named parameters, so a translation can put\n * them where its grammar wants them and choose its own plural forms. Numbers\n * arrive already formatted for the sheet's locale (the shared formatters,\n * #850); `n` is the raw count beside a formatted `count`, for plural rules. A\n * row's number is its identifier and arrives as written.\n *\n * English is the default. A host overrides any subset for a subtree with\n * {@link SheetMessagesProvider}; the locale numbers format in comes from\n * react-aria's `I18nProvider` above the app (the browser's otherwise).\n *\n * @packageDocumentation\n */\n\nimport { createContext, createElement, useContext, useMemo, type ReactNode } from \"react\";\nimport { editingMessages, getSomeorUndefined, type EditingMessages } from \"@elaraai/east-ui-components\";\nimport { type EditHistoryWord } from \"@elaraai/east-ui-components/internal\";\nimport { withArticle } from \"../shared/article.js\";\nimport { pagedLoadingMessages, type PagedLoadingMessages } from \"../shared/loading.js\";\nimport { hiddenByText } from \"../shared/schedule/hidden.js\";\nimport { pluralKind } from \"./link/grammar.js\";\nimport type { SheetKind } from \"./model.js\";\nimport type { SheetValue } from \"./frame/index.js\";\n\n/** A date column's level, as the words name it (#844). */\nexport type SheetLevelWord = \"week\" | \"day\" | \"range\" | \"time\";\n\n/** Which half of a link cell. */\nexport type SheetHalfWord = \"from\" | \"to\";\n\n/** Where an actual instant stands against the wanted date (#844). */\nexport type SheetToneWord = \"on\" | \"late\" | \"early\";\n\n/** The history bar's states that say something — the shared editing session's (#879). */\nexport type SheetHistoryWord = EditHistoryWord;\n\n/** What a view narrows by, as its hover title names it (B§8). */\nexport type SheetScopeWord = \"query\" | \"range\" | \"filter\" | \"none\";\n\n/** How the arity half's named members stand against the implied count (B§4.6). */\nexport type SheetArityWord = \"short\" | \"exact\" | \"over\";\n\n/** A tab of a builder's library pane: the templates, the columns, or one of the author's own (#1184, #1186). */\nexport type SheetLibraryTabWord = \"rows\" | \"columns\" | \"tab\";\n\n/** A tab of a builder's inspector pane (#1184). */\nexport type SheetInspectorTabWord = \"details\" | \"issues\";\n\n/** What the inspector shows one of (#1188): a row, a group's line, or a group's band. */\nexport type SheetInspectWord = \"row\" | \"line\" | \"band\";\n\n/** A gesture of the inspector's (#1188). */\nexport type SheetInspectActionWord = \"duplicate\" | \"delete\" | \"addLine\" | \"editInSheet\" | \"clear\";\n\n/**\n * Where a drop lands (#1187), as the words name it: before or after a row, a\n * line or a group (`what`, worded as the inspector names it); at a group's\n * start or its end; at the sheet's end; or, on a keyed source, where its key\n * sorts — a new row, or a new group (`noun`, the host's word for one).\n */\nexport type SheetDropPlaceWord =\n    | { place: \"before\" | \"after\"; what: string }\n    | { place: \"start\" | \"end\"; what: string }\n    | { place: \"sheetEnd\" }\n    | { place: \"sorted\"; group: boolean; noun: string };\n\n/**\n * Why a drop is refused where it rests (#1187): the sheet takes no edit; no\n * row (`line`: a grouped sheet's line) or group may be added; a card lands\n * only on a row or only on a band; a cell it sets is read only there; the\n * rows or the groups keep their place, or their key order; a line moves only\n * within its group (`what`, the group) and never out of the groups. `noun` and\n * `nouns` are the host's words for a group.\n */\nexport type SheetDropRefusalWord =\n    | { why: \"readOnly\" | \"ontoBand\" }\n    | { why: \"insertGroup\" | \"noGroupMove\"; nouns: string }\n    | { why: \"insert\" | \"ontoRow\" | \"noMove\"; line: boolean }\n    | { why: \"keyOrder\"; group: boolean; nouns: string }\n    | { why: \"column\"; header: string }\n    | { why: \"within\"; what: string }\n    | { why: \"lineOut\"; noun: string };\n\n/**\n * Why a paste, a clear or an edit left a cell as it was: a mark locks it\n * (`words`, the lock's own); its column is read only; its value isn't an\n * option, so it is never empty; it is an action cell, which only its actions\n * change; it is edited where ⏎ opens it, never in the grid (#1531); it steps\n * in place on a row the upstream system owns, which takes no step there (T9);\n * or `text` is no value its column reads, and a column from data keeps none it\n * can't read. `header` is the cell's column's.\n */\nexport type SheetCellRefusalWord =\n    | { why: \"locked\"; words: string }\n    | { why: \"readOnly\" | \"noClear\" | \"action\" | \"opens\" | \"owned\"; header: string }\n    | { why: \"unread\"; header: string; text: string };\n\n/**\n * The Sheet's message table — its own words, and the editing session's\n * ({@link EditingMessages}, #879: the history bar and the draft issues), so a\n * host translates the sheet's history bar where it translates the sheet.\n *\n * @remarks\n * Parameters named `count`, `from`, `to`, `total`, `loaded`, `rows`, `cols`,\n * `skipped`, `page` and `pages` are numbers already formatted for the locale;\n * `n` is the raw number beside them, for plural rules. `number` is a row's\n * number, as written. `noun` / `nouns` are the host's words for a group\n * (#844), `header` a column's header, `name` a view's name — the author's.\n */\nexport interface SheetMessages extends EditingMessages, PagedLoadingMessages {\n    // ── Counting ───────────────────────────────────────────────────────────\n    /** A count of the host's groups — `3 plans`. */\n    countNoun: (p: { n: number; count: string; noun: string; nouns: string }) => string;\n    /** The word for a group when the sheet declares none. */\n    groupNoun: () => string;\n    /** Its plural. */\n    groupNouns: () => string;\n\n    // ── The toolbar (§7) ───────────────────────────────────────────────────\n    /** The lens's count line — `3 matches`. */\n    lensCount: (p: { n: number; count: string }) => string;\n    /** The badge on a paged sheet's narrowing chrome, which sees only the loaded rows. */\n    scopeBadge: () => string;\n    /** The key search's icon — what a toolbar short of room folds its box to — and the head of the popover it opens the box in (#1221). */\n    keySearch: () => string;\n    /** The key search's icon and popover head once the views fold into it, over the search box — the row's last rung (#1345). */\n    keySearchViews: () => string;\n    /**\n     * A row the key search lists that the rail's narrowing hides — `JOB-10001 · hidden by the filters` (#1398, CL10) —\n     * until e3 has said which of the `rows` source's choices hide it: a pick of it then clears every one, and goes to the row.\n     */\n    keySearchHidden: (p: { key: string }) => string;\n    /**\n     * The same row once e3 has said which choices hide it — `JOB-10001 · hidden by Status: Ready — picking it clears that\n     * filter`: a pick of it clears them and goes to the row, every other choice kept. `filters` are those choices and\n     * `also` any the pick clears with them, a choice that cannot stand without one of them — each as the rail words it\n     * (`Status: Ready`).\n     */\n    keySearchHiddenBy: (p: { key: string; filters: readonly string[]; also: readonly string[] }) => string;\n\n    // ── The view tabs (B§8) ────────────────────────────────────────────────\n    /** The tablist's accessible name. */\n    tabList: () => string;\n    /** The whole-sheet tab. */\n    tabAll: () => string;\n    /** The whole-sheet tab's hover title. */\n    tabAllTitle: () => string;\n    /** A view's hover title: what it narrows by, and the gestures it takes. */\n    viewTitle: (p: { scope: SheetScopeWord; query: string }) => string;\n    /** A new view's name when there is no query to name it from — stored with the view. */\n    viewName: (p: { seq: string }) => string;\n    /** The rename box's accessible name. */\n    tabRename: () => string;\n    /** The dirty dot's title. */\n    tabDirty: () => string;\n    /** A tab's close control. */\n    tabClose: () => string;\n    /** The folded tabs' menu button — `+2`. */\n    tabMore: (p: { n: number; count: string }) => string;\n    /** The same button's accessible name. */\n    tabMoreName: (p: { n: number; count: string }) => string;\n    /** The same button's title. */\n    tabMoreTitle: () => string;\n    /** `+ tab`'s label. */\n    tabAdd: () => string;\n    /** `+ tab`'s accessible name. */\n    tabAddName: () => string;\n    /** `+ tab`'s title — with a query set, or without one. */\n    tabAddTitle: (p: { query: boolean }) => string;\n    /** The strip folded into one chip (#1221): its accessible name, naming the open view — `Views: All`. */\n    tabMenuName: (p: { name: string }) => string;\n    /** Its title. */\n    tabMenuTitle: () => string;\n    /** The chip's menu item that closes the open view — `Close \"Spraying\"`. */\n    tabCloseView: (p: { name: string }) => string;\n\n    // ── The history bar and the draft issues: the editing session's\n    // (`EditingMessages`) ────────────────────────────────────────────────────\n\n    // ── The header ─────────────────────────────────────────────────────────\n    /** The row numbers' column head. */\n    headerNumber: () => string;\n    /** The fold-all's accessible name — `Fold 3 plans`. */\n    foldAll: (p: { folded: boolean; groups: string }) => string;\n    /** The fold-all's title. */\n    foldAllTitle: (p: { folded: boolean; groups: string; noun: string }) => string;\n    /** The band title's column, where a column names it (the strip, a band cell's title). */\n    titleColumn: () => string;\n\n    // ── Rows ───────────────────────────────────────────────────────────────\n    /** A row's name — its gutter's accessible name. */\n    rowName: (p: { number: string }) => string;\n    /** A line's name in its group. */\n    lineName: (p: { number: string; group: string }) => string;\n    /** A row's gutter title — with the copilot's fill waiting on it, or not. */\n    rowTitle: (p: { fills: boolean }) => string;\n    /** A row's checkbox. */\n    selectRow: (p: { number: string; group: string | undefined }) => string;\n    /** A line's sub-row chevron's accessible name. */\n    subRows: (p: { open: boolean; n: number; count: string; line: string }) => string;\n    /** Its title. */\n    subRowsTitle: (p: { open: boolean; n: number; count: string; noun: string }) => string;\n    /** The gutter's fill button. */\n    fillRow: () => string;\n    /** Its title. */\n    fillRowTitle: () => string;\n    /** A new row's discard button. */\n    discardRow: () => string;\n    /**\n     * A folded gutter's row-actions button (#1215), its accessible name —\n     * `Actions — row 3`. Its menu's items are the words of the controls it\n     * holds: the gutter's decisions and the insertion strip's inserts.\n     */\n    rowActions: (p: { what: string }) => string;\n    /** Its title — and, when its row moves, that a drag on it moves the row. */\n    rowActionsTitle: (p: { movable: boolean }) => string;\n    /** A fill's take button. */\n    take: (p: { header: string }) => string;\n    /** Its title — the fill's provenance, when it has one. */\n    takeTitle: (p: { meta: string | undefined }) => string;\n    /** A suggested row's name. */\n    proposalName: (p: { number: string }) => string;\n    /** Its gutter title — a native tooltip, so it names its buttons by their words, never by their icons (#1263). */\n    proposalTitle: () => string;\n    /** Its checkbox. */\n    proposalSelect: () => string;\n    /** Its add button. */\n    proposalAccept: () => string;\n    /** The add button's title. */\n    proposalAcceptTitle: () => string;\n    /** Its reject button. */\n    proposalReject: () => string;\n    /** The reject button's title. */\n    proposalRejectTitle: () => string;\n    /** An author check that reported a state without saying why. */\n    issueAuthor: (p: { state: string }) => string;\n    /** A row check that threw. */\n    issueRowCheck: (p: { reason: string }) => string;\n    /** A group check that threw. */\n    issueGroupCheck: (p: { reason: string }) => string;\n    /** The footer's line for an issue the history bar went to. */\n    issueAt: (p: { where: string; message: string }) => string;\n\n    // ── Failures ───────────────────────────────────────────────────────────\n    // A run of rows not drawn yet says nothing (#1398, CL3); a failed one says so once, in the footer line's words\n    // (`lineFailed`, `retryRange`, `PagedLoadingMessages`).\n    /** A failed read's retry. */\n    retry: () => string;\n    /** Why the lens draws a record's rows as a failed band (#1349): which of them the narrowing holds disagrees with where e3 placed its rows — the record changed between the two reads. */\n    lensChanged: () => string;\n    /** A row that threw as it drew. */\n    rowFailed: (p: { number: string; reason: string }) => string;\n    /** A paged source that failed before anything landed. */\n    noSource: (p: { reason: string }) => string;\n    /** Why each marked cell of a row whose marks could not be read is locked (#1560): it stays locked until they are. */\n    marksUnread: () => string;\n\n    // ── Grouped rows (#740) ────────────────────────────────────────────────\n    /** A band's rowheader — `plan 2, 5 lines`. */\n    groupName: (p: { noun: string; number: string; n: number; count: string }) => string;\n    /** Its gutter title. */\n    groupTitle: (p: { noun: string }) => string;\n    /** Its checkbox. */\n    groupSelect: (p: { noun: string; title: string }) => string;\n    /** A new group's discard button. */\n    groupDiscard: (p: { noun: string }) => string;\n    /** Its chevron's accessible name. */\n    groupFold: (p: { folded: boolean; noun: string }) => string;\n    /** Its chevron's title. */\n    groupFoldTitle: (p: { folded: boolean }) => string;\n    /** A group with no title. */\n    untitled: () => string;\n    /** A band cell's title — its column's header and its value. */\n    bandCellTitle: (p: { header: string; value: string }) => string;\n\n    // ── Insertion ──────────────────────────────────────────────────────────\n    /** The insertion chips' group. */\n    insertHere: () => string;\n    /** The row chip's accessible name — a line on a grouped sheet. */\n    insertRow: (p: { ordered: boolean; line: boolean }) => string;\n    /** Its title. */\n    insertRowTitle: (p: { ordered: boolean; line: boolean }) => string;\n    /** The group chip's accessible name. */\n    insertGroup: (p: { ordered: boolean; noun: string }) => string;\n    /** Its title. */\n    insertGroupTitle: (p: { ordered: boolean; noun: string }) => string;\n    /** The insertion strip's group. */\n    insertStrip: () => string;\n    /** Insert above the selection. */\n    insertAbove: () => string;\n    /** Insert below it — or add one, in key order. */\n    insertBelow: (p: { ordered: boolean }) => string;\n    /** A new group. */\n    insertNewGroup: (p: { noun: string }) => string;\n\n    // ── The footer (B§9) ───────────────────────────────────────────────────\n    /** A grouped sheet's count line — `3 plans · 14 lines`, and `· 2 loose rows` when rows stand between the groups (#846). */\n    summary: (p: { groups: string; n: number; lines: string; nLoose: number; loose: string; nSub: number; subRows: string }) => string;\n    // The footer's loading line over a paged source (#1398, CL3), in what the rail counts the rows in: `lineLoading`,\n    // `lineFiltering`, `lineFailed` and `lineShort` (`PagedLoadingMessages`).\n    /** The key hint — a selected suggestion. */\n    hintProposal: () => string;\n    /** The key hint — the ring on a band. */\n    hintBand: (p: { noun: string }) => string;\n    /** The key hint — the ring on a line with sub rows. */\n    hintSubRows: (p: { open: boolean; n: number; count: string; noun: string }) => string;\n    /** The key hint — whole rows selected. */\n    hintRows: (p: { n: number; count: string }) => string;\n    /** The key hint — fills waiting. */\n    hintFills: () => string;\n    /** The key hint — suggested rows waiting. */\n    hintSuggestedRows: () => string;\n    /** The key hint. */\n    hintDefault: () => string;\n\n    // ── The strip (B§9) ────────────────────────────────────────────────────\n    /** What an empty field accepts — `START · accepts`. */\n    stripAccepts: (p: { header: string }) => string;\n    /** A link column's label, naming the half. */\n    stripHalf: (p: { header: string; half: SheetHalfWord | undefined }) => string;\n    /** The predicted members' label. */\n    stripPredicted: (p: { header: string }) => string;\n    /** The armed candidate's label — `⌥]` when there are others to step to. */\n    stripArmed: (p: { header: string; many: boolean }) => string;\n    /** The pending suggestions' label. */\n    stripSuggested: () => string;\n    /** A typed text no register member matches. */\n    stripNoMatch: () => string;\n    /** What a date field accepts. */\n    stripDate: () => string;\n    /** Its form. */\n    stripDateForm: () => string;\n    /** A date not yet whole. */\n    stripIncomplete: () => string;\n    /** What a number field accepts. */\n    stripNumber: (p: { unit: boolean }) => string;\n    /** A text that could not be read. */\n    stripUnrecognised: () => string;\n    /** Why a number field's text isn't taken, in the field's words for what it takes — `2.5 isn't a whole number` (#1585). */\n    stripNotNumber: (p: { text: string; whole: boolean }) => string;\n    /** What a custom column accepts when it says nothing. */\n    stripValue: () => string;\n    /** The days between the base column's date and this one. */\n    stripDays: (p: { n: number; count: string }) => string;\n    /** A predicted member's title. */\n    stripAdd: (p: { label: string }) => string;\n    /** The suggested rows chip — `+2 rows`. */\n    stripRows: (p: { n: number; count: string }) => string;\n    /** The pending rows' header. */\n    stripRowsHeader: () => string;\n    /** A provider still thinking. */\n    stripPending: (p: { header: string }) => string;\n    /** Its title. */\n    stripPendingTitle: (p: { header: string }) => string;\n    /** The keys — a text kept as typed. */\n    stripKeysTyped: () => string;\n    /** The keys — a menu with nothing armed. */\n    stripKeysFilter: () => string;\n    /** The keys — the armed candidate. */\n    stripKeysTake: (p: { many: boolean; index: string; total: string }) => string;\n    /** The keys — an empty date field. */\n    stripKeysDateEmpty: () => string;\n    /** The keys — an incomplete date. */\n    stripKeysDate: () => string;\n    /** The keys — a value to commit. */\n    stripKeysCommit: () => string;\n    /** The keys — a number field. */\n    stripKeysStep: () => string;\n    /** The keys — a custom column. */\n    stripKeysParse: () => string;\n    /** The keys — predicted members. */\n    stripKeysPredicted: () => string;\n    /** The keys — a link's armed candidate. */\n    stripKeysLinkTake: (p: { many: boolean; index: string; total: string; single: boolean }) => string;\n    /** The keys — a link half with nothing to offer. */\n    stripKeysLinkAdd: (p: { single: boolean }) => string;\n    /** The keys — the pending suggestions. */\n    stripKeysSuggested: () => string;\n    /** The keys — a resting cell's detail. */\n    stripKeysDetail: (p: { date: boolean }) => string;\n    /** The pager's title. */\n    stripPager: (p: { n: number; count: string; page: string; pages: string }) => string;\n    /** The pager's page — `1/3`. */\n    stripPage: (p: { page: string; pages: string }) => string;\n    /** The pager's back button. */\n    stripPrevious: () => string;\n    /** The pager's forward button. */\n    stripNext: () => string;\n\n    // ── The editor (B§4.4) ─────────────────────────────────────────────────\n    /** An enum's list with nothing in it. */\n    editorNoOptions: () => string;\n    /** A date's time box. */\n    editorTime: () => string;\n    /** Its placeholder. */\n    editorTimePlaceholder: () => string;\n    /** A locked half's warning, in the editor. */\n    editorLocked: (p: { half: SheetHalfWord }) => string;\n    /** The register editor's badge over its candidates — `2/5`. */\n    editorBadge: (p: { index: string; total: string }) => string;\n\n    // ── Links (B§4) ────────────────────────────────────────────────────────\n    /** An empty live half's label. */\n    halfLabel: (p: { half: SheetHalfWord }) => string;\n    /** A live half's title. */\n    halfTitle: (p: { half: SheetHalfWord }) => string;\n    /** A locked half's title — `Routing has no source · in place`. */\n    halfNone: (p: { driver: string; half: SheetHalfWord; lock: string | undefined }) => string;\n    /** The row whose driver says nothing, in a message about it. */\n    thisRow: () => string;\n    /** A counted member's count in the kind it resolves to — `4 machines`. */\n    countedMembers: (p: { n: number; count: string; kind: string | undefined }) => string;\n    /** A counted member names no one in particular. */\n    unassigned: () => string;\n    /** A range's span — `6 machines`. */\n    rangeSpan: (p: { n: number; count: string; kind: string | undefined }) => string;\n    /** A range candidate's meta — `→ 6 machines: R2140, …`. */\n    candidateRange: (p: { n: number; count: string; kind: string; names: string }) => string;\n    /** The enumerate alternative's meta. */\n    candidateEnumerate: (p: { n: number; count: string }) => string;\n    /** The placeholder candidate's meta. */\n    candidateTbc: () => string;\n    /** The predicted counted member's enumerate alternative. */\n    enumerateInstead: () => string;\n    /** A kind that resolves by code, in the grammar line. */\n    grammarCode: (p: { kind: string }) => string;\n    /** The counted form, in the grammar line. */\n    grammarCounted: () => string;\n    /** A range, in the grammar line. */\n    grammarRange: () => string;\n    /** The arity line (B§4.6) — `4 × CNC router implied · 3 named so far`. */\n    arity: (p: { count: string; key: string; named: string; state: SheetArityWord }) => string;\n    /** The `exists` check's flag. */\n    notInRegister: (p: { key: string }) => string;\n\n    // ── Dates at a level (#844) ────────────────────────────────────────────\n    /** A level's tag beside the date. */\n    whenTag: (p: { level: SheetLevelWord }) => string;\n    /** What a level accepts. */\n    whenAccepts: (p: { level: SheetLevelWord }) => string;\n    /** The forms it takes. */\n    whenAcceptsForms: (p: { level: SheetLevelWord }) => string;\n    /** An actual instant's tag — `+2d`, `−3h`, or on time. */\n    actualTag: (p: { tone: SheetToneWord; n: number; count: string; unit: \"d\" | \"h\" }) => string;\n    /** The same in words — `3 hours late`. */\n    actualWords: (p: { tone: SheetToneWord; n: number; count: string; unit: \"d\" | \"h\" }) => string;\n    /** When the work happened. */\n    detailHappened: (p: { when: string }) => string;\n    /** A date that has happened with nothing wanted. */\n    detailNoWanted: () => string;\n    /** Its title. */\n    detailHappenedTitle: (p: { when: string }) => string;\n    /** The wanted date. */\n    detailWanted: (p: { text: string; tag: string }) => string;\n    /** The title of a date that has happened against a wanted one. */\n    detailTitle: (p: { when: string; text: string; tag: string; words: string }) => string;\n\n    // ── What each gesture leaves (the footer's message) ────────────────────\n    /** A row, as a message names it — `row 4`, `line 3 of Bay 2 week 8`. */\n    rowRef: (p: { line: boolean; number: string; title: string | undefined; noun: string }) => string;\n    /** A group opened. */\n    noticeGroupOpened: (p: { noun: string }) => string;\n    /** A group folded. */\n    noticeGroupFolded: (p: { noun: string }) => string;\n    /** Every group opened. */\n    noticeGroupsOpened: (p: { groups: string }) => string;\n    /** Every group folded. */\n    noticeGroupsFolded: (p: { groups: string }) => string;\n    /** Every line's sub rows shown. */\n    noticeSubRowsShownAll: (p: { n: number; count: string; noun: string }) => string;\n    /** Every line's sub rows hidden. */\n    noticeSubRowsHidAll: (p: { noun: string }) => string;\n    /** A line's sub rows shown. */\n    noticeSubRowsShown: (p: { n: number; count: string }) => string;\n    /** A line's sub rows hidden. */\n    noticeSubRowsHid: () => string;\n    /** Members added to a link half. */\n    noticeMembersAdded: (p: { n: number; count: string }) => string;\n    /** Members removed from a link half. */\n    noticeMembersRemoved: (p: { n: number; count: string }) => string;\n    /** Predicted members taken. */\n    noticePredictedTaken: (p: { n: number; count: string }) => string;\n    /** A hop into a locked half. */\n    noticeLockedHalf: (p: { driver: string }) => string;\n    /** An editor whose row left the sheet closed (#877). */\n    noticeRowLeft: () => string;\n    /** An editor whose column the grid no longer draws closed. */\n    noticeColumnLeft: () => string;\n    /** A view saved — with a query, or without one. */\n    noticeTabSaved: (p: { name: string; query: boolean }) => string;\n    /** A view closed — the active one, or another. */\n    noticeTabClosed: (p: { name: string; active: boolean }) => string;\n    /** A view updated to the current search. */\n    noticeTabUpdated: (p: { name: string }) => string;\n    /** A view's search reverted. */\n    noticeTabReverted: () => string;\n    /** A fill taken. */\n    noticeFillTaken: (p: { column: string; meta: string | undefined }) => string;\n    /** A row filled. */\n    noticeRowFilled: (p: { n: number; count: string; row: string }) => string;\n    /** A suggested row taken. */\n    noticeProposalTaken: (p: { label: string | undefined; more: boolean }) => string;\n    /** A suggested row rejected. */\n    noticeProposalRejected: (p: { to: string | undefined; from: string | undefined }) => string;\n    /** A fill dismissed. */\n    noticeFillDismissed: (p: { column: string }) => string;\n    /** A selected suggestion let go. */\n    noticeProposalDeselected: () => string;\n    /** The row fill dismissed. */\n    noticeRowFillDismissed: () => string;\n    /** Rows, lines or groups deleted — `again`: the group is left empty, ⌫ again removes it. */\n    noticeDeleted: (p: { n: number; count: string; what: \"rows\" | \"lines\" | \"groups\"; noun: string; nouns: string; again: boolean }) => string;\n    /**\n     * A paste — `wrote` whether any cell took it; `nActions` the action cells it passed by, which take no paste (T7); `why`\n     * the first cell it skipped was left as it was, in {@link SheetMessages.cellRefused}'s words, where it says.\n     */\n    noticePasted: (p: { rows: string; cols: string; n: number; skipped: string; wrote: boolean; nActions: number; actions: string; why: string | undefined }) => string;\n    /** Why a gesture left a cell as it was — `Mon can't be left empty`, `locked: Booked centrally`. */\n    cellRefused: (p: SheetCellRefusalWord) => string;\n    /** A clear that left `n` cells as they were beside the `nCleared` it cleared, and why the first was — `Nothing cleared — Mon can't be left empty`. */\n    noticeClearRefused: (p: { n: number; count: string; nCleared: number; cleared: string; why: string }) => string;\n    /** An edit its cell would not take, and why — `Mon can't be left empty — the edit was not kept`. */\n    noticeEditRefused: (p: { why: string }) => string;\n    /** A copy. */\n    noticeCopied: (p: { rows: string; cols: string }) => string;\n    /** A new row discarded. */\n    noticeDiscarded: () => string;\n    /** A new row. */\n    noticeNewRow: () => string;\n    /** A new group. */\n    noticeNewGroup: (p: { noun: string }) => string;\n    /** A new entry's key the app's `newKey` gave is taken already (#1536) — `The new key 7 is taken`: nothing was drafted. */\n    noticeKeyTaken: (p: { key: string }) => string;\n    /** The app's `newKey` threw (#1536): nothing was drafted. */\n    noticeKeyFailed: (p: { reason: string }) => string;\n    /**\n     * New rows given new keys as they were saved (#1583): another save had added rows under the keys the sheet gave them —\n     * `J-104 was taken by another save — the new row is J-105`; `from` and `to` the first's keys, `n` how many.\n     */\n    noticeRenumbered: (p: { from: string; to: string; n: number; count: string }) => string;\n    /** A new row, line or group (`noun`) the app left a field of empty, one no person can set (#1536) — `Can't add a row — the app gives no Serial`: nothing was drafted. */\n    noticeCantAdd: (p: { what: \"row\" | \"line\" | \"group\"; noun: string; label: string }) => string;\n\n    // ── The builder (#1184) ────────────────────────────────────────────────\n    /** The library pane's name. */\n    libraryPane: () => string;\n    /** A library tab — the author names their own tabs. */\n    libraryTab: (p: { tab: \"rows\" | \"columns\" }) => string;\n    /** A library tab's empty state: its title — `No templates`, `Nothing in Crews` (#1186, SB37); `name` is an author's tab's. */\n    libraryEmpty: (p: { tab: SheetLibraryTabWord; name: string }) => string;\n    /** The line under it. */\n    libraryEmptyHint: (p: { tab: SheetLibraryTabWord; name: string }) => string;\n    /** What a library tab's search box counts its cards as — `template`, `templates`. */\n    libraryNoun: (p: { tab: SheetLibraryTabWord; n: number }) => string;\n    /** What a library tab's cards are grouped by: its grouping control's words. */\n    libraryGroupBy: (p: { tab: SheetLibraryTabWord }) => string;\n    /** A group template's line count, on its card — `4 lines` (SB33). */\n    templateLines: (p: { n: number; count: string }) => string;\n    /** A column's kind, as the Columns tab names it (SB36). */\n    columnKind: (p: { kind: SheetKind }) => string;\n    /** A phone's Library (`Mobile Sheet Spec.md` SH11): what a tap on an author's card does — sets it on `target` — or, with nothing to set it on, what to select first. */\n    libraryPhoneSet: (p: { target: string | undefined }) => string;\n    /** …and on a template: adds it below `target`, or what to select first. */\n    libraryPhoneAdd: (p: { target: string | undefined }) => string;\n    /** The mark on the card the target holds now. */\n    libraryPhoneCurrent: () => string;\n    /** Over a phone's Columns: what stays pinned, where one does, and what a tap does. */\n    libraryPhoneColumns: (p: { pinned: string | undefined }) => string;\n    /** A phone's column row's kind, the pinned column's said so — `text · pinned`. */\n    libraryPhoneKind: (p: { kind: string; pinned: boolean }) => string;\n    /** A phone's column row's accessible name — `Go to Good`. */\n    libraryPhoneGo: (p: { header: string }) => string;\n    /** A column's eye: shown, hidden, or the last one shown, which stays. */\n    columnEye: (p: { hidden: boolean; last: boolean }) => string;\n    /** The inspector pane's name. */\n    inspectorPane: () => string;\n    /** An inspector tab. */\n    inspectorTab: (p: { tab: SheetInspectorTabWord }) => string;\n    /** What the inspector shows — `row 3`, `line 2 of WO-2201`, `order 4` — over its fields, and on the collapsed rail (#1188, SB46). */\n    inspectorWhat: (p: { what: SheetInspectWord; number: string; title: string | undefined; noun: string }) => string;\n    /** A phone's Details' eyebrow names what is selected alone — `line 2`, `row 3`, `order 4` — its group by its id after it (SH12). */\n    inspectorPhoneWhat: (p: { what: SheetInspectWord; number: string; noun: string }) => string;\n    /** A draft's chip: changed since the record held it, or never saved (SB47). */\n    inspectorChip: (p: { state: \"pending\" | \"new\" }) => string;\n    /** The lock on a row the upstream system owns, and its title. */\n    inspectorOwned: () => string;\n    /** A section's head: the issues, the sub rows, a group's lines — `2 issues`. */\n    inspectorSection: (p: { section: \"issues\" | \"subRows\" | \"lines\"; n: number; count: string }) => string;\n    /** An inspector gesture — `Duplicate`, `Add line`; on a band, `with` its lines (SB49). */\n    inspectorAction: (p: { action: SheetInspectActionWord; header: string | undefined; withLines: boolean }) => string;\n    /** A link or set field's Edit in sheet while its column is hidden (SB48). */\n    inspectorHiddenColumn: (p: { header: string }) => string;\n    /** Several rows selected (SB50) — `3 rows selected`, `5 lines selected`. */\n    inspectorSeveral: (p: { n: number; count: string; lines: boolean }) => string;\n    /** The bulk edit's column choice, and what it sets across the rows. */\n    inspectorBulk: (p: { part: \"column\" | \"pick\" | \"hint\" }) => string;\n    /** Nothing selected (SB51): a count's label — `rows`, `pending`, `issues`. */\n    inspectorCount: (p: { what: \"rows\" | \"pending\" | \"issues\"; n: number }) => string;\n    /** The record's last commit and who made it — `saved 14:02 by planner`; `undefined` before its first. */\n    inspectorLastCommit: (p: { when: string | undefined; by: string | undefined }) => string;\n    /** Nothing selected: three hints, by their place. */\n    inspectorHint: (p: { n: 1 | 2 | 3 }) => string;\n    /** A row whose entry is not read yet. */\n    inspectorReading: () => string;\n    /** The Issues tab with nothing to list: its title, and the line under it (SB53). */\n    inspectorNoIssues: (p: { part: \"title\" | \"hint\" }) => string;\n    /** An issue's place and field — `row 4 · Qty`. */\n    inspectorIssueAt: (p: { where: string; field: string | undefined }) => string;\n    /** An issue whose row the rail's narrowing hides, in its line — `hidden by the filters` — until e3 has said which choices: a click then clears every one. */\n    inspectorIssueHidden: () => string;\n    /** …and once it has, as the key search's line says it — `hidden by Status: Ready — picking it clears that filter` (`keySearchHiddenBy`). */\n    inspectorIssueHiddenBy: (p: { filters: readonly string[]; also: readonly string[] }) => string;\n    /** The footer's last save, from the record's commits — `saved 14:02` (SB22). */\n    savedAt: (p: { when: string }) => string;\n    /** The banner over an entry the record does not hold (SB15). */\n    entryMissing: (p: { key: string }) => string;\n    /** What the rail's summary counts a flat sheet's rows in where its `rows` source has no label of its own — `rows` (#1345); a grouped sheet's, in its groups' noun. */\n    railRows: () => string;\n    /** The banner over a source of the rail whose narrowing could not be read (#1345) — `Templates results unavailable`; `name` is the source's label, or what it is counted in. */\n    sourceUnavailable: (p: { name: string }) => string;\n    /** Why: its results moved while they were read. */\n    sourceChanged: (p: { name: string }) => string;\n    /** Why: its results could not be read. */\n    sourceFailed: (p: { name: string }) => string;\n    /** Where a drop lands, under its ghost (#1187, SB38) — `after row 3`. */\n    dropPlace: (p: SheetDropPlaceWord) => string;\n    /** The same place as a screen reader hears the drag layer name it — `the gap after row 3`. */\n    dropPlaceName: (p: SheetDropPlaceWord) => string;\n    /** An author's card dropped on a row or a band, under its ghost (SB61) — `→ row 3`. */\n    dropOnto: (p: { what: string }) => string;\n    /** Why a drop is refused where it rests, red under its ghost (SB38). */\n    dropRefused: (p: SheetDropRefusalWord) => string;\n    /** A row's grip, its accessible name — `Move row 3` (SB44). */\n    dropGrip: (p: { what: string }) => string;\n    /** Its title. */\n    dropGripTitle: () => string;\n\n    // ── The action column (#1475–#1479) ────────────────────────────────────\n    /** An action cell with nothing taken and something offered (S8). */\n    actionNotStarted: () => string;\n    /** The ▾ part's accessible name (A2). */\n    actionMore: () => string;\n    /** A row whose draft lacks fields its actions need (T6) — `Fill Plan before taking an action`; `fields` are their labels. */\n    actionIncomplete: (p: { fields: readonly string[] }) => string;\n    /** The Menu's head over the direct actions (M5): how the author names the row, and its words beside it — `Step 30 · Fit`; neither, `Actions`. */\n    actionMenuHead: (p: { name: string | undefined; title: string | undefined }) => string;\n    /** The Menu's head over a choice's reasons (M5) — `Hold · reason`. */\n    actionMenuChoice: (p: { verb: string }) => string;\n    /** The popover's eyebrow (F4) — `Report · Step 30`. */\n    actionFormEyebrow: (p: { verb: string; name: string | undefined }) => string;\n    /** The popover's close button (F4). */\n    actionFormClose: () => string;\n    /** The popover's Cancel (F8). */\n    actionFormCancel: () => string;\n    /** What taking it writes (R5, F8) — `Sets Good 12 · Done 14:02`; nothing beside its field, `Sets nothing beside the action`. */\n    actionSets: (p: { facts: readonly string[] }) => string;\n    /** What a form's foot says while a required field is empty, in place of what it sets — `Needs Good parts`. */\n    actionNeeds: (p: { fields: readonly string[] }) => string;\n    /** The footer's line for ▾ on a range whose rows share no further case (T8). */\n    actionRangeNothing: () => string;\n    /** What a choice's preview says (R2) — `Pick a reason · sets …`. */\n    actionPickReason: (p: { facts: readonly string[] }) => string;\n    /** What a form's preview says (R2) — `Opens its form`. */\n    actionOpensForm: () => string;\n    /** The strip's label over an action (R2, R3) — `Report · Step 30`, or `Action · Step 30` for the ring's cell. */\n    actionStripLabel: (p: { verb: string | undefined; name: string | undefined }) => string;\n    /** The strip's line for the ring on an action cell (R3): its state and summary, then what it offers or why not. */\n    actionStripState: (p: { state: string | undefined; summary: string; offers: readonly string[]; blocked: string | undefined; incomplete: readonly string[] | undefined; readOnly: boolean }) => string;\n    /** The strip's keys hint on an action cell (R3). */\n    actionStripKeys: () => string;\n    /** The message a taken action leaves (T3) — `Completed Step 30 · set Good 12`. */\n    noticeActionTaken: (p: { state: string; name: string | undefined; n: number; count: string; facts: readonly string[] }) => string;\n    /** A phone's action bar: ← back to the row's actions (X7). */\n    actionBarBack: () => string;\n    /** A phone's action bar: the button listing the rest of the offer, past four (X6). */\n    actionBarMore: () => string;\n    /** A phone's action bar: ⌄ close (SH9). */\n    actionBarClose: () => string;\n    /** A phone's action bar over a row offered nothing further (SH9.1) — `No further actions · 24 good · done 08:42`. */\n    actionBarNothing: (p: { summary: string }) => string;\n    /** Why the field took no value (an action's `updates` threw, or its value could not be read): the gesture is refused. */\n    actionFailed: (p: { verb: string; reason: string }) => string;\n\n    // ── A phone's column pager (`Mobile Sheet Spec.md` SH1, SH2) ────────────\n    /** The readout's lead — `Columns`, before the range in view. */\n    pagerColumns: () => string;\n    /** What follows the range — `of 3`. */\n    pagerOf: (p: { n: number; total: string }) => string;\n    /** The readout's accessible name — `Columns 1–2 of 3 · go to a column`. */\n    pagerName: (p: { from: string; to: string; n: number; total: string }) => string;\n    /** The step back a column. */\n    pagerPrevious: () => string;\n    /** The step on a column. */\n    pagerNext: () => string;\n    /** The jump menu's eyebrow. */\n    pagerMenu: () => string;\n    /** The Row column's head, and its item in the jump menu (SH2). */\n    pagerRow: () => string;\n    /** What the jump menu says the Row column holds, as it says each column's kind (SH2). */\n    pagerRowKind: () => string;\n    /** The jump menu's checkbox that adds the Row column (SH2). */\n    pagerRowNumber: () => string;\n    /** Its note. */\n    pagerRowNumberNote: () => string;\n\n    // ── A phone's cell editor (`Mobile Sheet Spec.md` SH10) ────────────────\n    /** Its eyebrow: the column and the row — `Good · step 20 · Weld frame` as its action column names it, else `Good · line 2 of Frame assembly`. */\n    cellEditorEyebrow: (p: { header: string; what: string }) => string;\n    /** Its ⌄ close. */\n    cellEditorClose: () => string;\n    /** A number's − and + (SH10) — `Fewer Good`, `More Good`. */\n    cellEditorStep: (p: { header: string; more: boolean }) => string;\n    /** A time's Clear (SH10). */\n    cellEditorClear: () => string;\n    /** A time's help line (SH10). */\n    cellEditorTimeHelp: () => string;\n}\n\nconst plural = (n: number, one: string, many: string): string => (n === 1 ? one : many);\n\n/** A row the rail's narrowing hides, by the choices that do — joined as the rail's `Replaces …` joins them — and what a pick of it clears: the hidden pick's English. */\nconst hiddenBy = hiddenByText;\n\n/** The English table — the default: the editing session's words, then the sheet's own. */\nexport const sheetMessages: SheetMessages = {\n    ...editingMessages,\n    ...pagedLoadingMessages,\n    countNoun: ({ n, count, noun, nouns }) => `${count} ${plural(n, noun, nouns)}`,\n    groupNoun: () => \"group\",\n    groupNouns: () => \"groups\",\n\n    lensCount: ({ n, count }) => `${count} ${plural(n, \"match\", \"matches\")}`,\n    scopeBadge: () => \"loaded rows only\",\n    keySearch: () => \"Search Records\",\n    keySearchViews: () => \"Views and search\",\n    keySearchHidden: ({ key }) => `${key} · hidden by the filters`,\n    keySearchHiddenBy: ({ key, filters, also }) => `${key} · ${hiddenBy(filters, also)}`,\n\n    tabList: () => \"Views\",\n    tabAll: () => \"All\",\n    tabAllTitle: () => \"Every row — the whole sheet\",\n    viewTitle: ({ scope, query }) => {\n        const what = scope === \"query\" ? `\"${query}\"`\n            : scope === \"range\" ? \"a date window\"\n                : scope === \"filter\" ? \"a filter\"\n                    : \"no filter — the whole sheet\";\n        return `${what} · live · double-click renames · middle-click closes`;\n    },\n    viewName: ({ seq }) => `view ${seq}`,\n    tabRename: () => \"Rename tab\",\n    tabDirty: () => \"Unsaved query — ⏎ updates this tab · esc reverts\",\n    tabClose: () => \"Close tab\",\n    tabMore: ({ count }) => `+${count}`,\n    tabMoreName: ({ n, count }) => `${count} more ${plural(n, \"view\", \"views\")}`,\n    tabMoreTitle: () => \"More views\",\n    tabAdd: () => \"tab\",\n    tabAddName: () => \"New tab from this view\",\n    tabAddTitle: ({ query }) => (query\n        ? \"New tab from this search — its query, evaluated live\"\n        : \"New tab — no filter yet; search inside it and ⏎ to scope it\"),\n    tabMenuName: ({ name }) => `Views: ${name}`,\n    tabMenuTitle: () => \"Switch views, or save this one as a new tab\",\n    tabCloseView: ({ name }) => `Close \"${name}\"`,\n\n    headerNumber: () => \"#\",\n    foldAll: ({ folded, groups }) => (folded ? `Open ${groups}` : `Fold ${groups}`),\n    foldAllTitle: ({ folded, groups, noun }) => `${folded ? \"Open\" : \"Fold\"} ${groups} — ⌥ on a chevron, ⇧Space on a ${noun}`,\n    titleColumn: () => \"Title\",\n\n    rowName: ({ number }) => `Row ${number}`,\n    lineName: ({ number, group }) => `Line ${number} of ${group}`,\n    rowTitle: ({ fills }) => (fills ? \"Click the number to select the row · the button fills it\" : \"Select whole row — delete removes it\"),\n    selectRow: ({ number, group }) => (group !== undefined ? `Select row ${number} in ${group}` : `Select row ${number}`),\n    subRows: ({ open, n, count, line }) => `${open ? \"Hide\" : \"Show\"} the ${count} ${plural(n, \"row\", \"rows\")} under line ${line}`,\n    subRowsTitle: ({ open, n, count, noun }) => `${open ? \"Hide\" : \"Show\"} the ${count} ${plural(n, \"row\", \"rows\")} under this line — Space · ⌥ every line in the ${noun}`,\n    fillRow: () => \"Fill this row\",\n    fillRowTitle: () => \"Fill this row — ⌘⏎\",\n    discardRow: () => \"Discard new row\",\n    rowActions: ({ what }) => `Actions — ${what}`,\n    rowActionsTitle: ({ movable }) => (movable ? \"Its actions — drag to move it\" : \"Its actions\"),\n    take: ({ header }) => `Take ${header}`,\n    takeTitle: ({ meta }) => `Take — ${meta ?? \"suggested\"}`,\n    proposalName: ({ number }) => `Suggested row ${number}`,\n    proposalTitle: () => \"Suggested row — Add adds it, Reject rejects it\",\n    proposalSelect: () => \"Select this suggested row\",\n    proposalAccept: () => \"Add this suggested row\",\n    proposalAcceptTitle: () => \"Add this row to the plan — ⏎\",\n    proposalReject: () => \"Reject this suggestion\",\n    proposalRejectTitle: () => \"Reject — not offered after this activity again — ⌫\",\n    issueAuthor: ({ state }) => `Author check reports ${state}`,\n    issueRowCheck: ({ reason }) => `Row readiness failed: ${reason}`,\n    issueGroupCheck: ({ reason }) => `Group readiness failed: ${reason}`,\n    issueAt: ({ where, message }) => `${where}: ${message}`,\n\n    retry: () => \"Retry\",\n    lensChanged: () => \"the record changed while they were read\",\n    rowFailed: ({ number, reason }) => `Row ${number} could not be drawn — ${reason}`,\n    noSource: ({ reason }) => `NO ROWS — the paged source could not be read. ${reason} `,\n    marksUnread: () => \"Couldn't be read\",\n\n    groupName: ({ noun, number, n, count }) => `${noun} ${number}, ${count} ${plural(n, \"line\", \"lines\")}`,\n    groupTitle: ({ noun }) => `Select the ${noun}'s lines — delete removes them`,\n    groupSelect: ({ noun, title }) => `Select ${noun} ${title}`,\n    groupDiscard: ({ noun }) => `Discard new ${noun}`,\n    groupFold: ({ folded, noun }) => (folded ? `Open the ${noun}` : `Fold the ${noun}`),\n    groupFoldTitle: ({ folded }) => (folded ? \"Open — Space · ⌥ opens all\" : \"Fold — Space · ⌥ folds all\"),\n    untitled: () => \"Untitled\",\n    bandCellTitle: ({ header, value }) => `${header} — ${value}`,\n\n    insertHere: () => \"Insert here\",\n    insertRow: ({ ordered, line }) => (ordered ? `Insert ${line ? \"line\" : \"row\"} before` : `Add ${line ? \"line\" : \"row\"}`),\n    insertRowTitle: ({ ordered, line }) => (ordered ? `Insert a ${line ? \"line\" : \"row\"} here` : `Add a ${line ? \"line\" : \"row\"} in key order`),\n    insertGroup: ({ ordered, noun }) => (ordered ? `New ${noun}` : `Add ${noun}`),\n    insertGroupTitle: ({ ordered, noun }) => (ordered ? `Start a new ${noun} at the nearest ${noun} boundary` : `Add a ${noun} in key order`),\n    insertStrip: () => \"Row insertion\",\n    insertAbove: () => \"Insert above\",\n    insertBelow: ({ ordered }) => (ordered ? \"Insert below\" : \"Add row\"),\n    insertNewGroup: ({ noun }) => `New ${noun}`,\n\n    summary: ({ groups, n, lines, nLoose, loose, nSub, subRows }) =>\n        `${groups} · ${lines} ${plural(n, \"line\", \"lines\")}${nLoose > 0 ? ` · ${loose} loose ${plural(nLoose, \"row\", \"rows\")}` : \"\"}${nSub > 0 ? ` · ${subRows} sub ${plural(nSub, \"row\", \"rows\")}` : \"\"}`,\n    hintProposal:() => \"⏎ adds the selected row · ⌫ rejects it · esc deselects\",\n    hintBand: ({ noun }) => `⏎ renames the ${noun} · Space folds it · ⇧Space folds all · click its number to select its lines`,\n    hintSubRows: ({ open, n, count, noun }) => `Space ${open ? \"hides\" : \"shows\"} its ${count} sub ${plural(n, \"row\", \"rows\")} · ⇧Space every line's in the ${noun} · ⏎ edit`,\n    hintRows: ({ n, count }) => `${count} ${plural(n, \"row\", \"rows\")} selected · ⌫ deletes them · ⌘C copies`,\n    hintFills: () => \"⇥ walks the fills · ⌘⏎ fills the row · ⌘⇧⏎ takes everything · esc dismisses\",\n    hintSuggestedRows: () => \"⏎ adds the next suggested row · click a row to select it · esc dismisses\",\n    hintDefault: () => \"⏎ edit · esc cancel · click a row number to select it · ⌘C / ⌘V round-trips with Excel\",\n\n    stripAccepts: ({ header }) => `${header} · accepts`,\n    stripHalf: ({ header, half }) => (half === undefined ? header : `${header} · ${half}`),\n    stripPredicted: ({ header }) => `${header} · predicted`,\n    stripArmed: ({ header, many }) => `${many ? \"⌥] \" : \"\"}${header}`,\n    stripSuggested: () => \"suggested\",\n    stripNoMatch: () => \"no register match — kept as typed\",\n    stripDate: () => \"a date\",\n    stripDateForm: () => \"dd / mm / yyyy\",\n    stripIncomplete: () => \"incomplete\",\n    stripNumber: ({ unit }) => (unit ? \"number + unit\" : \"number\"),\n    stripUnrecognised: () => \"unrecognised\",\n    stripNotNumber: ({ text, whole }) => `${text} isn't ${whole ? \"a whole number\" : \"a number\"}`,\n    stripValue: () => \"a value\",\n    stripDays: ({ n, count }) => `${count} ${plural(Math.abs(n), \"day\", \"days\")}`,\n    stripAdd: ({ label }) => `Add ${label}`,\n    stripRows: ({ n, count }) => `+${count} ${plural(n, \"row\", \"rows\")}`,\n    stripRowsHeader: () => \"rows\",\n    stripPending: ({ header }) => `${header} ⋯`,\n    stripPendingTitle: ({ header }) => `${header} — thinking`,\n    stripKeysTyped: () => \"⏎ commit as typed\",\n    stripKeysFilter: () => \"type to filter · ⌥↓ to pick · click any\",\n    stripKeysTake: ({ many, index, total }) => `${many ? `${index} of ${total} · ` : \"\"}⇥ take`,\n    stripKeysDateEmpty: () => \"digits fill a segment · ↑↓ step it · ⇥ next\",\n    stripKeysDate: () => \"digits fill a segment · ⇥ next\",\n    stripKeysCommit: () => \"⏎ commit · esc cancel\",\n    stripKeysStep: () => \"↑↓ step · ⏎ commit\",\n    stripKeysParse: () => \"type to parse\",\n    stripKeysPredicted: () => \"⇥ one · ⌘→ all · or type\",\n    stripKeysLinkTake: ({ many, index, total, single }) =>\n        `${many ? `${index} of ${total} · ` : \"\"}⇥ take · , next${single ? \"\" : \" · > hops to the To half\"} · ⌘→ rest`,\n    stripKeysLinkAdd: ({ single }) => `, adds${single ? \"\" : \" · > hops to the To half\"} · ⏎ done`,\n    stripKeysSuggested: () => \"⇥ walk · ⌘⏎ row · ⌘⇧⏎ all · esc\",\n    stripKeysDetail: ({ date }) => (date ? \"⏎ edits the wanted date\" : \"⏎ edit\"),\n    stripPager: ({ count, page, pages }) => `${count} options · page ${page} of ${pages}`,\n    stripPage: ({ page, pages }) => `${page}/${pages}`,\n    stripPrevious: () => \"Previous options\",\n    stripNext: () => \"More options\",\n\n    editorNoOptions: () => \"no options\",\n    editorTime: () => \"Time\",\n    editorTimePlaceholder: () => \"hh:mm\",\n    editorLocked: ({ half }) => `This ${half === \"from\" ? \"source\" : \"destination\"} is locked — anything here is kept but flagged`,\n    editorBadge: ({ index, total }) => `${index}/${total}`,\n\n    halfLabel: ({ half }) => half,\n    halfTitle: ({ half }) => (half === \"from\" ? \"From\" : \"To\"),\n    halfNone: ({ driver, half, lock }) => `${driver} has no ${half === \"from\" ? \"source\" : \"destination\"}${lock !== undefined ? ` · ${lock}` : \"\"}`,\n    thisRow: () => \"This row\",\n    countedMembers: ({ n, count, kind }) => (kind !== undefined ? `${count} ${n === 1 ? kind : pluralKind(kind)}` : count),\n    unassigned: () => \"unassigned\",\n    rangeSpan: ({ count, kind }) => `${count} ${kind !== undefined ? pluralKind(kind) : \"members\"}`,\n    candidateRange: ({ count, kind, names }) => `→ ${count} ${pluralKind(kind)}: ${names}`,\n    candidateEnumerate: ({ count }) => `enumerate · ${count} members`,\n    candidateTbc: () => \"to confirm\",\n    enumerateInstead: () => \"name them now instead of leaving them to the scheduler\",\n    grammarCode: ({ kind }) => `${kind} code`,\n    grammarCounted: () => \"N x kind\",\n    grammarRange: () => \"a range\",\n    arity: ({ count, key, named, state }) =>\n        `${count} × ${key} implied · ${named} ${state === \"short\" ? \"named so far\" : state === \"over\" ? \"named — more than the quantity needs\" : \"named\"}`,\n    notInRegister: ({ key }) => `${key} is not in the register`,\n\n    whenTag: ({ level }) => (level === \"week\" ? \"wk\" : level),\n    whenAccepts: ({ level }) => {\n        switch (level) {\n            case \"week\": return \"a week — any day in it\";\n            case \"day\": return \"a day\";\n            case \"range\": return \"one end of the days it can run in\";\n            case \"time\": return \"a day and a time\";\n        }\n    },\n    whenAcceptsForms: ({ level }) => {\n        switch (level) {\n            case \"week\": return \"22/3 · fri · +7d · shown as its Monday\";\n            case \"day\": return \"22/3 · fri · +3d\";\n            case \"range\": return \"18/3 here, 22/3 at the other end\";\n            case \"time\": return \"22/3 19:00 · fri 07:30\";\n        }\n    },\n    actualTag: ({ tone, count, unit }) => (tone === \"on\" ? \"actual\" : `${tone === \"late\" ? \"+\" : \"−\"}${count}${unit}`),\n    actualWords: ({ tone, n, count, unit }) => (tone === \"on\" ? \"on time\"\n        : `${count} ${unit === \"d\" ? plural(n, \"day\", \"days\") : plural(n, \"hour\", \"hours\")} ${tone}`),\n    detailHappened: ({ when }) => `happened ${when}`,\n    detailNoWanted: () => \"no wanted date\",\n    detailHappenedTitle: ({ when }) => `Happened ${when} — no wanted date`,\n    detailWanted: ({ text, tag }) => `wanted ${text} · ${tag}`,\n    detailTitle: ({ when, text, tag, words }) => `Happened ${when} — wanted ${text} (${tag}) · ${words}`,\n\n    rowRef: ({ line, number, title, noun }) => (line ? `line ${number} of ${title ?? `the ${noun}`}` : `row ${number}`),\n    noticeGroupOpened: ({ noun }) => `Opened the ${noun}`,\n    noticeGroupFolded: ({ noun }) => `Folded the ${noun} — Space or the chevron opens it`,\n    noticeGroupsOpened: ({ groups }) => `Opened ${groups}`,\n    noticeGroupsFolded: ({ groups }) => `Folded ${groups} — the corner, ⌥ on a chevron or ⇧Space opens them`,\n    noticeSubRowsShownAll: ({ n, count, noun }) => `Showing the sub rows under ${count} ${plural(n, \"line\", \"lines\")} of the ${noun} — ⇧Space hides them`,\n    noticeSubRowsHidAll: ({ noun }) => `Hid the sub rows under the ${noun}'s lines`,\n    noticeSubRowsShown: ({ n, count }) => `Showing ${count} sub ${plural(n, \"row\", \"rows\")} under the line — Space hides them`,\n    noticeSubRowsHid: () => \"Hid the sub rows — Space shows them\",\n    noticeMembersAdded: ({ n, count }) => `Added ${count} ${plural(n, \"member\", \"members\")}`,\n    noticeMembersRemoved: ({ n, count }) => `${count} ${plural(n, \"member\", \"members\")} removed`,\n    noticePredictedTaken: ({ n, count }) => `Took ${count} predicted ${plural(n, \"member\", \"members\")}`,\n    noticeLockedHalf: ({ driver }) => `${driver} has no destination — kept, but flagged`,\n    noticeRowLeft: () => \"The edited row left the sheet — its edit was not kept\",\n    noticeColumnLeft: () => \"The edited column is no longer shown — its edit was not kept\",\n    noticeTabSaved: ({ name, query }) => (query\n        ? `Saved tab \"${name}\" — a live view: rows that match join it as the sheet changes`\n        : `Saved tab \"${name}\" — no filter; type a search and ⏎ to scope it`),\n    noticeTabClosed: ({ name, active }) => (active ? `Closed \"${name}\" — back to the whole sheet` : `Closed \"${name}\"`),\n    noticeTabUpdated: ({ name }) => `Tab \"${name}\" now saves this search`,\n    noticeTabReverted: () => \"Reverted to the tab's saved search\",\n    noticeFillTaken: ({ column, meta }) => `Took ${column} — ${meta ?? \"suggested\"}`,\n    noticeRowFilled: ({ n, count, row }) => `Filled ${count} ${plural(n, \"cell\", \"cells\")} on ${row}`,\n    noticeProposalTaken: ({ label, more }) => `Took ${label ?? \"the suggested row\"}${more ? \" — next one suggested below\" : \"\"}`,\n    noticeProposalRejected: ({ to, from }) => `Rejected — ${to ?? \"that row\"} will not be suggested after ${from ?? \"this\"} again`,\n    noticeFillDismissed: ({ column }) => `Dismissed — ${column} will not be suggested again on this row`,\n    noticeProposalDeselected: () => \"Deselected — esc again dismisses every suggestion\",\n    noticeRowFillDismissed: () => \"Row fill dismissed — esc again for the suggested rows\",\n    noticeDeleted: ({ n, count, what, noun, nouns, again }) => {\n        const deleted = what === \"groups\" ? `${count} ${plural(n, noun, nouns)}`\n            : `${count} ${what === \"lines\" ? plural(n, \"line\", \"lines\") : plural(n, \"row\", \"rows\")}`;\n        return `Deleted ${deleted}${again ? ` — ⌫ again removes the ${noun}` : \"\"}`;\n    },\n    noticePasted: ({ rows, cols, n, skipped, wrote, nActions, actions, why }) => (!wrote\n        ? `Nothing pasted${why !== undefined ? ` — ${why}` : nActions > 0 ? \" — an action cell takes no paste\" : \"\"}`\n        : `Pasted ${rows}×${cols} from clipboard${n > 0 ? ` · ${skipped} ${why !== undefined ? `skipped — ${why}` : \"unrecognised\"}` : \"\"}${nActions > 0 ? ` · ${actions} action ${plural(nActions, \"cell\", \"cells\")} skipped` : \"\"}`),\n    cellRefused: (p) => {\n        switch (p.why) {\n            case \"locked\": return `locked: ${p.words}`;\n            case \"readOnly\": return `${p.header} is read only`;\n            case \"noClear\": return `${p.header} can't be left empty`;\n            case \"action\": return `${p.header} changes only through its actions`;\n            case \"opens\": return `${p.header} is edited where ⏎ opens it`;\n            case \"owned\": return `${p.header} is owned upstream`;\n            case \"unread\": return `${p.header} can't hold \"${p.text}\"`;\n        }\n    },\n    noticeClearRefused: ({ count, nCleared, cleared, why }) => (nCleared === 0 ? `Nothing cleared — ${why}`\n        : `Cleared ${cleared} ${plural(nCleared, \"cell\", \"cells\")} · ${count} kept — ${why}`),\n    noticeEditRefused: ({ why }) => `${why} — the edit was not kept`,\n    noticeCopied: ({ rows, cols }) => `Copied ${rows}×${cols} to clipboard`,\n    noticeDiscarded: () => \"Discarded new row\",\n    noticeNewRow: () => \"New row\",\n    noticeNewGroup: ({ noun }) => `New ${noun}`,\n    noticeKeyTaken: ({ key }) => `The new key ${key} is taken`,\n    noticeKeyFailed: ({ reason }) => `No new key could be made — ${reason}`,\n    noticeRenumbered: ({ from, to, n, count }) => (n === 1 ? `${from} was taken by another save — the new row is ${to}`\n        : `${count} new rows renumbered — their keys were taken by another save`),\n    noticeCantAdd: ({ what, noun, label }) => {\n        const entry = what === \"group\" ? noun : what;\n        return `Can't add ${withArticle(entry)} — the app gives no ${label}`;\n    },\n\n    libraryPane: () => \"Library\",\n    libraryTab: ({ tab }) => (tab === \"rows\" ? \"Rows\" : \"Columns\"),\n    libraryEmpty: ({ tab, name }) => (tab === \"rows\" ? \"No templates\" : tab === \"columns\" ? \"No columns\" : `Nothing in ${name}`),\n    libraryEmptyHint: ({ tab, name }) => (tab === \"rows\" ? \"This sheet offers no rows or groups to drag in.\"\n        : tab === \"columns\" ? \"This sheet declares no columns.\"\n            : `${name} lists nothing yet.`),\n    libraryNoun: ({ tab, n }) => (tab === \"rows\" ? plural(n, \"template\", \"templates\")\n        : tab === \"columns\" ? plural(n, \"column\", \"columns\") : plural(n, \"card\", \"cards\")),\n    libraryGroupBy: ({ tab }) => (tab === \"rows\" ? \"Category\" : \"Group\"),\n    templateLines: ({ n, count }) => `${count} ${plural(n, \"line\", \"lines\")}`,\n    columnKind: ({ kind }) => kind,\n    libraryPhoneSet: ({ target }) => (target === undefined ? \"Select a row in the sheet, then tap a card here.\" : `Tap a card to set it on ${target}. On desktop you drag it there.`),\n    libraryPhoneAdd: ({ target }) => (target === undefined ? \"Select a row in the sheet, then tap a template here.\" : `Tap a template to add it below ${target}. On desktop you drag it there.`),\n    libraryPhoneCurrent: () => \"current\",\n    libraryPhoneColumns: ({ pinned }) => (pinned === undefined ? \"Tap a column to go to it.\" : `${pinned} stays pinned. Tap a column to go to it.`),\n    libraryPhoneKind: ({ kind, pinned }) => (pinned ? `${kind} · pinned` : kind),\n    libraryPhoneGo: ({ header }) => `Go to ${header}`,\n    columnEye: ({ hidden, last }) => (hidden ? \"Hidden — click to show\" : last ? \"Shown — the last column shown stays\" : \"Shown — click to hide\"),\n    inspectorPane: () => \"Inspector\",\n    inspectorTab: ({ tab }) => (tab === \"details\" ? \"Details\" : \"Issues\"),\n    inspectorWhat: ({ what, number, title, noun }) => (what === \"row\" ? `row ${number}`\n        : what === \"line\" ? `line ${number} of ${title ?? `the ${noun}`}` : `${noun} ${number}`),\n    inspectorPhoneWhat: ({ what, number, noun }) => (what === \"row\" ? `row ${number}` : what === \"line\" ? `line ${number}` : `${noun} ${number}`),\n    inspectorChip: ({ state }) => (state === \"pending\" ? \"Pending\" : \"New\"),\n    inspectorOwned: () => \"Owned upstream — its stamped cells are read only\",\n    inspectorSection: ({ section, n, count }) => (section === \"issues\" ? `${count} ${plural(n, \"issue\", \"issues\")}`\n        : section === \"subRows\" ? `${count} sub ${plural(n, \"row\", \"rows\")}` : `${count} ${plural(n, \"line\", \"lines\")}`),\n    inspectorAction: ({ action, header, withLines }) => {\n        switch (action) {\n            case \"duplicate\": return withLines ? \"Duplicate with its lines\" : \"Duplicate\";\n            case \"delete\": return withLines ? \"Delete with its lines\" : \"Delete\";\n            case \"addLine\": return \"Add line\";\n            case \"editInSheet\": return \"Edit in sheet\";\n            case \"clear\": return header === undefined ? \"Clear\" : `Clear ${header}`;\n        }\n    },\n    inspectorHiddenColumn: ({ header }) => `${header} is hidden — show it from the library's Columns tab to edit it in the sheet`,\n    inspectorSeveral: ({ n, count, lines }) => `${count} ${lines ? plural(n, \"line\", \"lines\") : plural(n, \"row\", \"rows\")} selected`,\n    inspectorBulk: ({ part }) => (part === \"column\" ? \"Set a column across them\"\n        : part === \"pick\" ? \"Column\" : \"An edit sets it on every one, as one step the history undoes\"),\n    inspectorCount: ({ what, n }) => (what === \"rows\" ? plural(n, \"row\", \"rows\") : what === \"pending\" ? \"pending\" : plural(n, \"issue\", \"issues\")),\n    inspectorLastCommit: ({ when, by }) => (when === undefined ? \"Not saved yet\" : by !== undefined && by !== \"\" ? `saved ${when} by ${by}` : `saved ${when}`),\n    inspectorHint: ({ n }) => (n === 1 ? \"Click a cell to see its row's every field here\"\n        : n === 2 ? \"Click a row number to select it — shift-click to select several\"\n            : \"Changes wait for Save; Undo takes back each one\"),\n    inspectorReading: () => \"Reading the row…\",\n    inspectorNoIssues: ({ part }) => (part === \"title\" ? \"No issues\" : \"Every change is complete — nothing stands in the way of Save.\"),\n    inspectorIssueAt: ({ where, field }) => (field === undefined ? where : `${where} · ${field}`),\n    inspectorIssueHidden: () => \"hidden by the filters\",\n    inspectorIssueHiddenBy: ({ filters, also }) => hiddenBy(filters, also),\n    savedAt: ({ when }) => `saved ${when}`,\n    entryMissing: ({ key }) => `The record holds no entry \"${key}\" — the sheet is empty and read only until it does`,\n    railRows: () => \"rows\",\n    sourceUnavailable: ({ name }) => `${name.charAt(0).toUpperCase()}${name.slice(1)} results unavailable`,\n    sourceChanged: ({ name }) => `${name.charAt(0).toUpperCase()}${name.slice(1)} results changed; retry the narrowing.`,\n    sourceFailed: ({ name }) => `Could not load ${name} results`,\n    dropPlace: (p) => {\n        switch (p.place) {\n            case \"before\": case \"after\": return `${p.place} ${p.what}`;\n            case \"start\": return `at the start of ${p.what}`;\n            case \"end\": return `at the end of ${p.what}`;\n            case \"sheetEnd\": return \"at the end\";\n            case \"sorted\": return `a new ${p.group ? p.noun : \"row\"} · in key order`;\n        }\n    },\n    dropPlaceName: (p) => {\n        switch (p.place) {\n            case \"before\": case \"after\": return `the gap ${p.place} ${p.what}`;\n            case \"start\": return `the start of ${p.what}`;\n            case \"end\": return `the end of ${p.what}`;\n            case \"sheetEnd\": return \"the end of the sheet\";\n            case \"sorted\": return `a new ${p.group ? p.noun : \"row\"}, in key order`;\n        }\n    },\n    dropOnto: ({ what }) => `→ ${what}`,\n    dropRefused: (p) => {\n        switch (p.why) {\n            case \"readOnly\": return \"The sheet is read only\";\n            case \"ontoBand\": return \"Drop onto a band\";\n            case \"insertGroup\": return `No new ${p.nouns} here`;\n            case \"noGroupMove\": return `The ${p.nouns} keep their place here`;\n            case \"insert\": return `No new ${p.line ? \"lines\" : \"rows\"} here`;\n            case \"ontoRow\": return `Drop onto a ${p.line ? \"line\" : \"row\"}`;\n            case \"noMove\": return `${p.line ? \"Lines\" : \"Rows\"} keep their place here`;\n            case \"keyOrder\": return `Key order places the ${p.group ? p.nouns : \"rows\"}`;\n            case \"column\": return `${p.header} is read only here`;\n            case \"within\": return `Lines move only within ${p.what}`;\n            case \"lineOut\": return `A line stays in a ${p.noun}`;\n        }\n    },\n    dropGrip: ({ what }) => `Move ${what}`,\n    dropGripTitle: () => \"Drag to move it to another seam\",\n\n    actionNotStarted: () => \"not started\",\n    actionMore: () => \"More actions\",\n    actionIncomplete: ({ fields }) => `Fill ${fields.join(\", \")} before taking an action`,\n    actionMenuHead: ({ name, title }) => (name === undefined && title === undefined ? \"Actions\" : [name, title].filter((t) => t !== undefined && t !== \"\").join(\" · \")),\n    actionMenuChoice: ({ verb }) => `${verb} · reason`,\n    actionFormEyebrow: ({ verb, name }) => (name === undefined || name === \"\" ? verb : `${verb} · ${name}`),\n    actionFormClose: () => \"Close\",\n    actionFormCancel: () => \"Cancel\",\n    actionSets: ({ facts }) => (facts.length === 0 ? \"Sets nothing beside the action\" : `Sets ${facts.join(\" · \")}`),\n    actionNeeds: ({ fields }) => `Needs ${fields.join(\", \")}`,\n    actionRangeNothing: () => \"Nothing more is offered to every selected row\",\n    actionPickReason: ({ facts }) => (facts.length === 0 ? \"Pick a reason\" : `Pick a reason · sets ${facts.join(\" · \")}`),\n    actionOpensForm: () => \"Opens its form\",\n    actionStripLabel: ({ verb, name }) => [verb ?? \"Action\", name].filter((t) => t !== undefined && t !== \"\").join(\" · \"),\n    actionStripState: ({ state, summary, offers, blocked, incomplete, readOnly }) => {\n        const what = readOnly ? \"read only\"\n            : incomplete !== undefined ? `fill ${incomplete.join(\", \")} first`\n                : blocked !== undefined ? blocked\n                    : offers.length > 0 ? `offers ${offers.join(\", \")}` : \"nothing further to take\";\n        return [state ?? \"not started\", summary, what].filter((t) => t !== \"\").join(\" · \");\n    },\n    actionStripKeys: () => \"⏎ takes the next\",\n    noticeActionTaken: ({ state, name, n, facts }) => {\n        const what = name === undefined || name === \"\" ? state : `${state} ${name}`;\n        return n === 0 || facts.length === 0 ? what : `${what} · set ${facts.join(\" · \")}`;\n    },\n    actionBarBack: () => \"Back to the actions\",\n    actionBarMore: () => \"More…\",\n    actionBarClose: () => \"Close action bar\",\n    actionBarNothing: ({ summary }) => (summary === \"\" ? \"No further actions\" : `No further actions · ${summary}`),\n    actionFailed: ({ verb, reason }) => `${verb} could not be taken — ${reason}`,\n\n    pagerColumns: () => \"Columns\",\n    pagerOf: ({ total }) => `of ${total}`,\n    pagerName: ({ from, to, total }) => `Columns ${from}–${to} of ${total} · go to a column`,\n    pagerPrevious: () => \"Previous column\",\n    pagerNext: () => \"Next column\",\n    pagerMenu: () => \"Go to column\",\n    pagerRow: () => \"Row\",\n    pagerRowKind: () => \"number\",\n    pagerRowNumber: () => \"Row number\",\n    pagerRowNumberNote: () => \"off by default\",\n\n    cellEditorEyebrow: ({ header, what }) => `${header} · ${what}`,\n    cellEditorClose: () => \"Close editor\",\n    cellEditorStep: ({ header, more }) => `${more ? \"More\" : \"Fewer\"} ${header}`,\n    cellEditorClear: () => \"Clear\",\n    cellEditorTimeHelp: () => \"24-hour time · digits fill a segment\",\n};\n\n/** The app's words for what the sheet draws of its own, as the payload carries them (#1516). */\nexport type SheetVocabulary = SheetValue[\"vocabulary\"];\n\n/**\n * A table in the app's own words (#1516): each word the app gave over the table above it, wherever the table says it, and\n * the rest as they stood, so a host's translation stands where the app gave none.\n *\n * @param parent - The table above\n * @param v - The app's words\n * @returns The table\n */\nexport function sheetMessagesIn(parent: SheetMessages, v: SheetVocabulary): SheetMessages {\n    const members = getSomeorUndefined(v.members);\n    const unassigned = getSomeorUndefined(v.unassigned);\n    const source = getSomeorUndefined(v.source);\n    const destination = getSomeorUndefined(v.destination);\n    const wanted = getSomeorUndefined(v.wanted);\n    const actual = getSomeorUndefined(v.actual);\n    const holds = (n: number): string | undefined => (members === undefined ? undefined : plural(n, members.one, members.other));\n    /** A half, in the app's word where it gave one. */\n    const halfWord = (half: SheetHalfWord): string | undefined => (half === \"from\" ? source : destination);\n    const capital = (word: string): string => `${word.charAt(0).toUpperCase()}${word.slice(1)}`;\n    /** The hop to the to half, in the key hints. */\n    const hops = (text: string): string => (destination === undefined ? text : text.replace(\"the To half\", `the ${capital(destination)} half`));\n    return {\n        ...parent,\n        unassigned: () => unassigned ?? parent.unassigned(),\n        rangeSpan: (p) => (p.kind === undefined && members !== undefined ? `${p.count} ${members.other}` : parent.rangeSpan(p)),\n        candidateEnumerate: (p) => (members === undefined ? parent.candidateEnumerate(p) : `enumerate · ${p.count} ${members.other}`),\n        noticeMembersAdded: (p) => (members === undefined ? parent.noticeMembersAdded(p) : `Added ${p.count} ${holds(p.n)}`),\n        noticeMembersRemoved: (p) => (members === undefined ? parent.noticeMembersRemoved(p) : `${p.count} ${holds(p.n)} removed`),\n        noticePredictedTaken: (p) => (members === undefined ? parent.noticePredictedTaken(p) : `Took ${p.count} predicted ${holds(p.n)}`),\n        halfLabel: ({ half }) => halfWord(half) ?? parent.halfLabel({ half }),\n        halfTitle: ({ half }) => { const word = halfWord(half); return word === undefined ? parent.halfTitle({ half }) : capital(word); },\n        stripHalf: (p) => { const word = p.half === undefined ? undefined : halfWord(p.half); return word === undefined ? parent.stripHalf(p) : `${p.header} · ${word}`; },\n        editorLocked: (p) => { const word = halfWord(p.half); return word === undefined ? parent.editorLocked(p) : `This ${word} is locked — anything here is kept but flagged`; },\n        halfNone: (p) => { const word = halfWord(p.half); return word === undefined ? parent.halfNone(p) : `${p.driver} has no ${word}${p.lock !== undefined ? ` · ${p.lock}` : \"\"}`; },\n        noticeLockedHalf: (p) => (destination === undefined ? parent.noticeLockedHalf(p) : `${p.driver} has no ${destination} — kept, but flagged`),\n        stripKeysLinkTake: (p) => hops(parent.stripKeysLinkTake(p)),\n        stripKeysLinkAdd: (p) => hops(parent.stripKeysLinkAdd(p)),\n        actualTag: (p) => (p.tone === \"on\" && actual !== undefined ? actual : parent.actualTag(p)),\n        stripKeysDetail: (p) => (p.date && wanted !== undefined ? `⏎ edits the ${wanted} date` : parent.stripKeysDetail(p)),\n        detailNoWanted: () => (wanted === undefined ? parent.detailNoWanted() : `no ${wanted} date`),\n        detailHappenedTitle: (p) => (wanted === undefined ? parent.detailHappenedTitle(p) : `Happened ${p.when} — no ${wanted} date`),\n        detailWanted: (p) => (wanted === undefined ? parent.detailWanted(p) : `${wanted} ${p.text} · ${p.tag}`),\n        detailTitle: (p) => (wanted === undefined ? parent.detailTitle(p) : `Happened ${p.when} — ${wanted} ${p.text} (${p.tag}) · ${p.words}`),\n    };\n}\n\nconst SheetMessagesContext = createContext<SheetMessages>(sheetMessages);\n\n/**\n * The message table in effect — {@link sheetMessages} with every\n * {@link SheetMessagesProvider} above overriding it.\n *\n * @returns The table\n */\nexport function useSheetMessages(): SheetMessages {\n    return useContext(SheetMessagesContext);\n}\n\n/** Props of {@link SheetVocabularyProvider}. */\nexport interface SheetVocabularyProviderProps {\n    /** The app's words, the same object while they hold. */\n    vocabulary: SheetVocabulary;\n    /** The subtree they apply to. */\n    children?: ReactNode;\n}\n\n/**\n * The app's own words for a sheet (#1516), over whatever table a host gives it.\n *\n * @param props - The words and the subtree\n * @returns The provider\n */\nexport function SheetVocabularyProvider({ vocabulary, children }: SheetVocabularyProviderProps) {\n    const parent = useSheetMessages();\n    const value = useMemo(() => sheetMessagesIn(parent, vocabulary), [parent, vocabulary]);\n    return createElement(SheetMessagesContext.Provider, { value }, children);\n}\n\n/** Props of {@link SheetMessagesProvider}. */\nexport interface SheetMessagesProviderProps {\n    /** The messages to override — any subset; the rest come from the table above. */\n    messages: Partial<SheetMessages>;\n    /** The subtree the overrides apply to. */\n    children?: ReactNode;\n}\n\n/**\n * Override the Sheet's words for a subtree — a translation, or a house style.\n * Providers nest: each overrides the table the one above it resolved.\n *\n * @remarks\n * The overrides are read by identity: define them once (module scope, or a\n * memo), as below. A new object on every render hands every sheet beneath a\n * new table, and each re-derives all of its words.\n *\n * @param props - The overrides and the subtree\n * @returns The provider\n *\n * @example\n * ```tsx\n * const GERMAN: Partial<SheetMessages> = {\n *     tabAll: () => \"Alle\",\n *     scopeBadge: () => \"nur geladene Zeilen\",\n *     lineLoading: ({ noun, from, to }) => (from === undefined || to === undefined ? [`${noun} werden geladen…`] : [`${noun} `, { strong: `${from}–${to}` }, \" werden geladen\"]),\n * };\n *\n * <I18nProvider locale=\"de-DE\">\n *     <SheetMessagesProvider messages={GERMAN}>\n *         <EastChakraComponent value={sheet} />\n *     </SheetMessagesProvider>\n * </I18nProvider>\n * ```\n */\nexport function SheetMessagesProvider({ messages, children }: SheetMessagesProviderProps) {\n    const parent = useSheetMessages();\n    const value = useMemo(() => ({ ...parent, ...messages }), [parent, messages]);\n    return createElement(SheetMessagesContext.Provider, { value }, children);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Sheet's words in its locale (#861) — the message table in effect\n * (`messages.ts`) and the number and date formatters its parameters are\n * filled from: the shared format module's (#850), so the Sheet prints numbers\n * exactly as every other component in the app does. The Plan's `words.ts`\n * twin.\n *\n * Two kinds of text reach the screen from outside React, and both are\n * resolved here, at render, so what is stored never knows a locale:\n *\n * - **The message a gesture leaves** — the reducer's {@link SheetNotice}: a\n *   message's id and its parameters, counts raw. {@link noticeText} words it.\n * - **The renderer's own readiness issues** — a draft field with no value, a\n *   text that could not be read, an author check that failed. They cross the\n *   wire to the host in the patch events, where their text is canonical\n *   English (stable, whatever the viewer reads), so the display reads them\n *   back ({@link issueText}) and words them in the table's language. An\n *   author's own issue is the author's text, and shows as written.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { formatters, useFormatters, type Formatters, sessionErrorText } from \"@elaraai/east-ui-components\";\nimport { DRAFT_ISSUE_TEXT, SESSION_TEXT } from \"@elaraai/east-ui-components/internal\";\nimport { sheetMessages, useSheetMessages, type SheetMessages } from \"./messages.js\";\nimport type { SheetNotice, SheetRowRef } from \"./sheet-types.js\";\n\n// The editing session's own error text and how it shows — shared by every\n// editable collection (#879); the sheet's history bar words it in its words.\nexport { SESSION_TEXT, sessionErrorText };\n\n/** The Sheet's words: its message table, and its locale's formatters. */\nexport interface SheetWords extends Formatters {\n    /** The message table in effect. */\n    m: SheetMessages;\n}\n\n/**\n * Build the words for a locale and a message table.\n *\n * @param locale - The BCP 47 locale\n * @param m - The message table\n * @returns The words\n */\nexport function sheetWords(locale: string, m: SheetMessages): SheetWords {\n    return { ...formatters(locale), m };\n}\n\n/** The words a sheet speaks with no provider above it: English, in `en-US`. */\nexport const SHEET_WORDS: SheetWords = sheetWords(\"en-US\", sheetMessages);\n\n/**\n * The sheet's words — its locale (react-aria's `useLocale`, through the\n * shared formatters) and the message table in effect\n * (`SheetMessagesProvider`), one object per change of either.\n *\n * @returns The words\n */\nexport function useSheetWords(): SheetWords {\n    const f = useFormatters();\n    const m = useSheetMessages();\n    return useMemo(() => ({ ...f, m }), [f, m]);\n}\n\n/**\n * A row, in words — `row 4`, or on a grouped sheet `line 3 of Bay 2 week 8`.\n *\n * @param ref - The row\n * @param w - The words\n * @returns The text\n */\nexport function rowRefText(ref: SheetRowRef, w: SheetWords): string {\n    return ref.line\n        ? w.m.rowRef({ line: true, number: String(ref.number), title: ref.title, noun: ref.noun ?? w.m.groupNoun() })\n        : w.m.rowRef({ line: false, number: String(ref.number), title: undefined, noun: w.m.groupNoun() });\n}\n\n/**\n * The footer's line for the message a gesture left.\n *\n * @param notice - The message\n * @param w - The words\n * @returns The text\n */\nexport function noticeText(notice: SheetNotice, w: SheetWords): string {\n    const { m } = w;\n    const noun = (x: string | undefined) => x ?? m.groupNoun();\n    const nouns = (x: string | undefined) => x ?? m.groupNouns();\n    switch (notice.id) {\n        case \"groupOpened\": return m.noticeGroupOpened({ noun: noun(notice.noun) });\n        case \"groupFolded\": return m.noticeGroupFolded({ noun: noun(notice.noun) });\n        case \"groupsOpened\":\n        case \"groupsFolded\": {\n            const groups = m.countNoun({ n: notice.n, count: w.number(notice.n), noun: noun(notice.noun), nouns: nouns(notice.nouns) });\n            return notice.id === \"groupsOpened\" ? m.noticeGroupsOpened({ groups }) : m.noticeGroupsFolded({ groups });\n        }\n        case \"subRowsShownAll\": return m.noticeSubRowsShownAll({ n: notice.n, count: w.number(notice.n), noun: noun(notice.noun) });\n        case \"subRowsHidAll\": return m.noticeSubRowsHidAll({ noun: noun(notice.noun) });\n        case \"subRowsShown\": return m.noticeSubRowsShown({ n: notice.n, count: w.number(notice.n) });\n        case \"subRowsHid\": return m.noticeSubRowsHid();\n        case \"membersAdded\": return m.noticeMembersAdded({ n: notice.n, count: w.number(notice.n) });\n        case \"membersRemoved\": return m.noticeMembersRemoved({ n: notice.n, count: w.number(notice.n) });\n        case \"predictedTaken\": return m.noticePredictedTaken({ n: notice.n, count: w.number(notice.n) });\n        case \"lockedHalf\": return m.noticeLockedHalf({ driver: notice.driver ?? m.thisRow() });\n        case \"rowLeft\": return m.noticeRowLeft();\n        case \"columnLeft\": return m.noticeColumnLeft();\n        case \"tabSaved\": return m.noticeTabSaved({ name: notice.name, query: notice.query });\n        case \"tabClosed\": return m.noticeTabClosed({ name: notice.name, active: notice.active });\n        case \"tabUpdated\": return m.noticeTabUpdated({ name: notice.name });\n        case \"tabReverted\": return m.noticeTabReverted();\n        case \"fillTaken\": return m.noticeFillTaken({ column: notice.column, meta: notice.meta });\n        case \"rowFilled\": return m.noticeRowFilled({ n: notice.n, count: w.number(notice.n), row: rowRefText(notice.row, w) });\n        case \"proposalTaken\": return m.noticeProposalTaken({ label: notice.label, more: notice.more });\n        case \"proposalRejected\": return m.noticeProposalRejected({ to: notice.to, from: notice.from });\n        case \"fillDismissed\": return m.noticeFillDismissed({ column: notice.column });\n        case \"proposalDeselected\": return m.noticeProposalDeselected();\n        case \"rowFillDismissed\": return m.noticeRowFillDismissed();\n        case \"deleted\": return m.noticeDeleted({\n            n: notice.n, count: w.number(notice.n), what: notice.what, noun: noun(notice.noun), nouns: nouns(notice.nouns), again: notice.again,\n        });\n        case \"pasted\": return m.noticePasted({\n            rows: w.number(notice.rows), cols: w.number(notice.cols), n: notice.skipped, skipped: w.number(notice.skipped),\n            wrote: notice.wrote ?? true, nActions: notice.actions ?? 0, actions: w.number(notice.actions ?? 0),\n            why: notice.refused === undefined ? undefined : m.cellRefused(notice.refused),\n        });\n        case \"clearRefused\": return m.noticeClearRefused({\n            n: notice.n, count: w.number(notice.n), nCleared: notice.cleared, cleared: w.number(notice.cleared), why: m.cellRefused(notice.word),\n        });\n        case \"editRefused\": return m.noticeEditRefused({ why: m.cellRefused(notice.word) });\n        case \"copied\": return m.noticeCopied({ rows: w.number(notice.rows), cols: w.number(notice.cols) });\n        case \"discarded\": return m.noticeDiscarded();\n        case \"newRow\": return m.noticeNewRow();\n        case \"newGroup\": return m.noticeNewGroup({ noun: noun(notice.noun) });\n        case \"issue\": return m.issueAt({ where: notice.where, message: issueText(notice.issue.message, w) });\n        case \"dropRefused\": return m.dropRefused(notice.word);\n        case \"keyTaken\": return m.noticeKeyTaken({ key: notice.key });\n        case \"keyFailed\": return m.noticeKeyFailed({ reason: notice.reason });\n        case \"renumbered\": return m.noticeRenumbered({ from: notice.from, to: notice.to, n: notice.n, count: w.number(notice.n) });\n        case \"cantAdd\": return m.noticeCantAdd({ what: notice.what, noun: noun(notice.noun), label: notice.label });\n        case \"text\": return notice.text;\n    }\n}\n\n/**\n * The renderer's own readiness issues, in their canonical English — the text\n * the patch events carry to the host: a draft's (the editing session's,\n * #879) and the sheet's author checks'. Read back here ({@link issueText}),\n * so the two never drift.\n */\nexport const ISSUE_TEXT = {\n    required: DRAFT_ISSUE_TEXT.required,\n    invalid: DRAFT_ISSUE_TEXT.invalid,\n    author: (state: string): string => sheetMessages.issueAuthor({ state }),\n    rowCheck: (reason: string): string => sheetMessages.issueRowCheck({ reason }),\n    groupCheck: (reason: string): string => sheetMessages.issueGroupCheck({ reason }),\n} as const;\n\n/** The canonical forms' fixed heads, to read an issue back by. */\nconst INVALID_HEAD = ISSUE_TEXT.invalid(\"\");\nconst AUTHOR_HEAD = ISSUE_TEXT.author(\"\");\nconst ROW_CHECK_HEAD = ISSUE_TEXT.rowCheck(\"\");\nconst GROUP_CHECK_HEAD = ISSUE_TEXT.groupCheck(\"\");\n\n/**\n * An issue's text as the sheet shows it: the renderer's own issue, read back\n * from its canonical form ({@link ISSUE_TEXT}) and worded in the table's\n * language; any other issue — an author's — as written.\n *\n * @param message - The issue's text, as the readiness carries it\n * @param w - The words\n * @returns The text to show\n */\nexport function issueText(message: string, w: SheetWords): string {\n    const { m } = w;\n    if (message === ISSUE_TEXT.required) return m.issueRequired();\n    if (message.startsWith(INVALID_HEAD)) return m.issueInvalid({ value: message.slice(INVALID_HEAD.length) });\n    if (message.startsWith(AUTHOR_HEAD)) return m.issueAuthor({ state: message.slice(AUTHOR_HEAD.length) });\n    if (message.startsWith(ROW_CHECK_HEAD)) return m.issueRowCheck({ reason: message.slice(ROW_CHECK_HEAD.length) });\n    if (message.startsWith(GROUP_CHECK_HEAD)) return m.issueGroupCheck({ reason: message.slice(GROUP_CHECK_HEAD.length) });\n    return message;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The footer (B§9): the host's counts · a state-sensitive key hint · a\n * right-aligned `aria-live` message for every action · and over a paged\n * source the shared loading line at its trailing end (#1398, CL3): what is\n * read, in what the rail counts the rows in — `Loading work orders\n * 8,301–8,500`, `Filtering work orders…`, `Couldn't read work orders\n * 8,301–8,500 · Retry` — never a count of the rows read. The rail never wraps\n * and never cuts a word: the key hint's hints end at a whole hint, then \"…\",\n * and the line shows its full text, its short form or its dot alone. A\n * builder adds the record's last save after the counts (SB22). A run of the\n * app's optimiser (#1409) takes the line's slot while it is out and just\n * after Stop, and during its highlight the hints end with `Elara change`.\n */\n\nimport { memo, useMemo, useRef } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { OptimiseLegendItem, getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { FooterMore, LoadingLine, RecordSliceSaveNotice, footerCut, useFooterFit, useLoadingReveal, useRevealed, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { pagedLoadingLine, type PagedLoading } from \"../shared/loading.js\";\nimport { useSheetWords } from \"./words.js\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { Sheet } from \"@elaraai/e3-ui/internal\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** One decoded footer item. */\nexport type SheetFooterItemValue = ValueTypeOf<typeof Sheet.Types.FooterItem>;\n\n/**\n * What a paged sheet reads now, or could not read (#1398, CL3): its source's\n * elements in flight, a narrowing's rows read while the last narrowing's\n * stand in, or a read that failed — a window's or a stretch's elements, or\n * the source's own count or revision — the shared paged source's line.\n */\nexport type SheetLoadingLine = PagedLoading;\n\nexport interface SheetFooterProps {\n    styles: Styles;\n    items: readonly SheetFooterItemValue[];\n    /** The sheet's own count line before the host's items — a grouped sheet's `3 plans · 14 lines` (#740, G12). */\n    summary?: string | undefined;\n    hint: string;\n    message: string;\n    /** What a paged source reads now, or could not read; `undefined` while nothing is in flight or failed, and inline (#1398). */\n    loading: SheetLoadingLine | undefined;\n    /** What the rail counts the rows in — `work orders`, a grouped sheet's groups: what the loading line names them by. */\n    noun: string;\n    /** Ask the source again, when the loading line says it could not be read (#853). */\n    onRetry?: (() => void) | undefined;\n    /** The record's last save, from its commits — `saved 14:02` (a builder's, SB22). */\n    saved?: string | undefined;\n    /** Exact, confirmed feedback when saved rows leave the indexed query. */\n    recordSlice?: ValueTypeOf<RecordSliceBindType> | undefined;\n    /** A run of the app's optimiser (#1409): what its line says while the call is out or just stopped, and whether the legend's `Elara change` shows. */\n    optimise?: { readonly line: LoadingLineValue | undefined; readonly legend: boolean } | undefined;\n}\n\n/** The separator the key hint's words run its hints on with — each of them a hint the fit keeps or cuts whole. */\nconst HINT_SEPARATOR = \" · \";\n\n/** Nothing to ask again: a sheet whose host gives no Retry. */\nconst NO_RETRY = () => undefined;\n\n/** Renders the footer. */\nexport const SheetFooter = memo(function SheetFooter({ styles, items, summary, hint, message, loading, noun, onRetry, saved, recordSlice, optimise }: SheetFooterProps) {\n    // The loading line, in the sheet's words and the app's locale (#850, #861), on the sheet's one reveal clock (CL4):\n    // its frame's `LoadingReveal`, which the runs' placeholders read too — else, alone, a clock of its own.\n    const words = useSheetWords();\n    const line = useMemo(() => pagedLoadingLine(loading, noun, words.m, words.number, onRetry ?? NO_RETRY), [loading, noun, words, onRetry]);\n    const revealed = useRevealed();\n    const alone = useLoadingReveal(revealed === undefined && loading !== undefined && loading.kind !== \"failed\");\n    const shown = revealed ?? alone;\n    const rail = useRef<HTMLDivElement>(null);\n    const fit = useFooterFit(rail);\n    const hints = hint === \"\" ? [] : hint.split(HINT_SEPARATOR);\n    const legend = optimise?.legend === true;\n    const units = hints.length + (legend ? 1 : 0);\n    // A run's line takes the slot, at once: a run is not a read.\n    const runLine = optimise?.line;\n    return (\n        <Box ref={rail} css={styles.footer} data-slot=\"footer\" data-footer-hints=\"\">\n            {(items.length > 0 || summary !== undefined || saved !== undefined) && (\n                <Box as=\"span\" css={styles.footerCounts} data-slot=\"footerCounts\">\n                    {summary !== undefined && <Box as=\"span\" data-slot=\"footerSummary\">{summary}</Box>}\n                    {items.map((it, i) => (\n                        <Box key={i} as=\"span\" data-tone={getSomeorUndefined(it.tone)?.type}>\n                            {i > 0 || summary !== undefined ? `· ${it.text}` : it.text}\n                        </Box>\n                    ))}\n                    {saved !== undefined && (\n                        <Box as=\"span\" data-slot=\"footerSaved\">{items.length > 0 || summary !== undefined ? `· ${saved}` : saved}</Box>\n                    )}\n                </Box>\n            )}\n            {recordSlice !== undefined && <RecordSliceSaveNotice slice={recordSlice} />}\n            {/* The key hint: its hints run on, each whole — a rail too narrow ends them at a whole hint, then \"…\". */}\n            <Box as=\"span\" css={styles.footerHint} data-slot=\"footerHint\" data-footer-units=\"\">\n                {hints.map((part, i) => (\n                    <Box key={i} as=\"span\" data-footer-unit=\"\" data-footer-cut={footerCut(i, fit)}>\n                        {i > 0 && <Box as=\"span\" css={styles.footerHintSep}>{HINT_SEPARATOR}</Box>}{part}\n                    </Box>\n                ))}\n                {/* During a run's highlight the hints end with `Elara change` (#1409), one more unit the fit keeps or cuts whole. */}\n                {legend && (\n                    <Box as=\"span\" data-footer-unit=\"\" data-footer-cut={footerCut(hints.length, fit)}>\n                        {hints.length > 0 && <Box as=\"span\" css={styles.footerHintSep}>{HINT_SEPARATOR}</Box>}<OptimiseLegendItem />\n                    </Box>\n                )}\n            </Box>\n            <FooterMore shown={fit.kept < units} />\n            {/* The message takes the rail's slack: the fit leaves it what the hints and the line leave, its words cut there. */}\n            <Box as=\"span\" css={styles.footerMessage} data-slot=\"footerMessage\" data-footer-slack=\"\" data-footer-live={message === \"\" ? undefined : \"\"} aria-live=\"polite\">{message}</Box>\n            <LoadingLine value={runLine ?? line} shown={shown || runLine !== undefined} form={fit.form} />\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * How a keyed source's rows sort (#880, #1182): by key, at the key's own\n * type. A row's id is its key's text — a String key itself, any other key its\n * `.east` printing — so a key that is not a String is read back from its id\n * and compared as what it is: a record keyed by number puts 9 before 10.\n *\n * @packageDocumentation\n */\nimport { compareFor, parseFor, StringType, type EastTypeValue } from \"@elaraai/east\";\n\nconst compareText = compareFor(StringType);\n\n/**\n * The order of a keyed source's row ids, at the key's own type.\n *\n * @param keyType - The source's key type, as the editing wire carries it\n * @returns A comparator over row ids: by key, with an id that names no key of the type after every key, by its text\n */\nexport function keyOrderOf(keyType: EastTypeValue): (a: string, b: string) => number {\n    if (keyType.type === \"String\") return compareText;\n    const parse = parseFor(keyType);\n    const compare = compareFor(keyType);\n    // Each id's key, read once.\n    const keys = new Map<string, { key: unknown } | null>();\n    const keyOf = (id: string): { key: unknown } | null => {\n        let found = keys.get(id);\n        if (found === undefined) {\n            const parsed = parse(id);\n            found = parsed.success ? { key: parsed.value } : null;\n            keys.set(id, found);\n        }\n        return found;\n    };\n    return (a, b) => {\n        const ka = keyOf(a);\n        const kb = keyOf(b);\n        if (ka !== null && kb !== null) return compare(ka.key, kb.key);\n        if (ka !== null) return -1;\n        if (kb !== null) return 1;\n        return compareText(a, b);\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The saved views' narrowing (#1345): every source's narrowing of the sheet's\n * one `Slice.bindRecords`, by the source's name — read off the rail, written\n * back to it as a view opens, compared, cleared and described through East's\n * own types.\n *\n * @packageDocumentation\n */\n\nimport { ArrayType, DictType, SortedMap, StringType, compareFor, equalFor, none, type ValueTypeOf } from \"@elaraai/east\";\nimport { Sheet } from \"@elaraai/e3-ui/internal\";\nimport { RecordSliceStateType, type RecordSlicesChromeType } from \"@elaraai/east-ui/internal\";\nimport type { SheetNarrowing, SheetSavedView } from \"./values.js\";\n\n/** One source's narrowing. */\ntype SourceState = ValueTypeOf<typeof RecordSliceStateType>;\n/** The rail's chrome, as the root carries it. */\ntype Chrome = ValueTypeOf<typeof RecordSlicesChromeType>;\n\nconst compareString = compareFor(StringType);\nconst narrowingsEqual = equalFor(DictType(StringType, RecordSliceStateType));\nconst viewsEqual = equalFor(ArrayType(Sheet.Types.RecordView));\n\n/** A source's narrowing with nothing chosen: its presentation (its resolution) kept. */\nfunction cleared(state: SourceState): SourceState {\n    return { ...state, where: new Map(), preset: none };\n}\n\n/**\n * The rail's narrowing now: each source's state, by its name.\n *\n * @param chrome - The sheet's rail\n * @returns Every source's narrowing\n */\nexport function narrowingOf(chrome: Chrome): SheetNarrowing {\n    return new SortedMap(chrome.slice.parts.map((part) => [part.source, part.slice.read()] as const), compareString);\n}\n\n/**\n * Writes a narrowing back to the rail, source by source: a source the\n * narrowing does not hold opens with nothing chosen, as a preset clears a\n * source it does not name.\n *\n * @param chrome - The sheet's rail\n * @param narrowing - The narrowing to write — a view's, or the whole sheet's\n */\nexport function writeNarrowing(chrome: Chrome, narrowing: SheetNarrowing): void {\n    for (const part of chrome.slice.parts) {\n        part.slice.write(narrowing.get(part.source) ?? cleared(part.slice.read()));\n    }\n}\n\n/** Whether two narrowings hold the same choices, through East's equality, by source. */\nexport function narrowingEqual(a: SheetNarrowing, b: SheetNarrowing): boolean {\n    return narrowingsEqual(a, b);\n}\n\n/** Value equality keeps optimistic tab changes when the host decodes a fresh payload. */\nexport function sheetViewsEqual(a: readonly SheetSavedView[], b: readonly SheetSavedView[]): boolean {\n    return viewsEqual([...a], [...b]);\n}\n\n/** The All tab clears every source's choices but keeps their presentation. */\nexport function clearNarrowing(state: SheetNarrowing): SheetNarrowing {\n    return new SortedMap([...state].map(([source, s]) => [source, cleared(s)] as const), compareString);\n}\n\n/** Search text for a new tab's default name: each source's prefix searches. Exact typed choices are not search text. */\nexport function narrowingQuery(state: SheetNarrowing): string {\n    return [...state.values()].flatMap((s) => [...s.where.values()].filter((choice) => choice.type === \"prefix\").map((choice) => choice.value)).join(\" \");\n}\n\n/** Escape clears every search, each source keeping its other choices and its presentation. */\nexport function clearSearch(state: SheetNarrowing): SheetNarrowing {\n    return new SortedMap([...state].map(([source, s]) => [source, s.where.size === 0 ? s\n        : { ...s, where: new Map([...s.where].filter(([, choice]) => choice.type !== \"prefix\")), preset: none }] as const), compareString);\n}\n\n/** A view's scope as the existing tab description names it. */\nexport function narrowingScope(state: SheetNarrowing): \"query\" | \"range\" | \"filter\" | \"none\" {\n    if (narrowingQuery(state).trim() !== \"\") return \"query\";\n    const choices = [...state.values()].flatMap((s) => [...s.where.values()]);\n    return choices.some((choice) => choice.type === \"range\") ? \"range\" : choices.length > 0 ? \"filter\" : \"none\";\n}\n\n/**\n * Writes the saved views back to the host's bind handle.\n *\n * @param views - The views, as the sheet holds them now\n * @param write - The views' write-back, if the host keeps them\n */\nexport function writeSheetViews(views: readonly SheetSavedView[], write: ((views: SheetSavedView[]) => unknown) | undefined): void {\n    write?.([...views]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Seed new entries and children at the single gesture boundary. @packageDocumentation */\nimport { decodeBeast2For, equalFor, variant, type EastType, type ValueTypeOf } from \"@elaraai/east\";\nimport { Sheet, type SheetEditingType } from \"@elaraai/e3-ui/internal\";\nimport type { SheetNotice } from \"./sheet-types.js\";\nimport type { EntryVersion, Placement } from \"./transactions.js\";\nimport type { SheetCellValue, SheetRowValue } from \"./values.js\";\n\n/**\n * A gesture the sheet refuses, and why, in the footer's words (#1536): a new entry whose key the app's `newKey` gives\n * taken already, a `newKey` that throws, or a new entry the app left a field of empty that no person can set. Thrown\n * where the gesture is built, before anything is drafted, so the gesture drafts nothing; the sheet says the notice,\n * and logs nothing.\n */\nexport class SheetRefused extends Error {\n    /** What the footer says. */\n    readonly notice: SheetNotice;\n\n    constructor(notice: SheetNotice) {\n        super(notice.id);\n        this.name = \"SheetRefused\";\n        this.notice = notice;\n    }\n}\n\nconst decodeWire = decodeBeast2For(Sheet.Types.Row);\nconst sameCell = equalFor(Sheet.Types.Cell);\ntype Cells = SheetRowValue[\"cells\"];\ntype Editing = ValueTypeOf<typeof SheetEditingType>;\ntype Prepared = { row: SheetRowValue; draft: unknown; previous: SheetRowValue | undefined };\n\n/** Omitted fields remain missing, including hidden required fields. */\nfunction emptyDraft(type: EastType): unknown {\n    if (type.type === \"Struct\") return Object.fromEntries(Object.entries(type.fields).map(([field, child]) => [field, emptyDraft(child)]));\n    if (type.type === \"Array\") return [];\n    return variant(\"missing\", null);\n}\n\n/** Preserve constructor values across successive wire events within one gesture. */\nfunction cellsAfter(input: Cells, defaults: Cells | undefined, previousInput?: Cells): Cells {\n    const cells = new Map(defaults);\n    for (const [key, value] of input) {\n        const previous = previousInput?.get(key);\n        if (previous !== undefined && sameCell(previous, value)) continue;\n        if (previousInput === undefined && value.type === \"Null\" && cells.has(key)) continue;\n        cells.set(key, value);\n    }\n    return cells;\n}\n\n/**\n * Invoke constructors only for newly materialized values. The returned base\n * maps child drafts by internal key before the typed decoder consumes cells.\n * Undo/redo replay the saved value and never run a constructor again.\n *\n * On a source with LOOSE rows between its groups (#846) the draft is the\n * entry's — a variant: a wire row with no band is a loose row, seeded by\n * `newRow` at its entry placement; one with a band is a group. A new line\n * there gets its id field minted by `mint` unless `newRow` supplied one: it is\n * the same domain field a loose row is identified by, never the line's\n * identity.\n *\n * @param input - The gesture's wire row\n * @param current - The entry's version before this event\n * @param previousInput - The wire row an earlier event of the gesture left\n * @param place - The entry's placement\n * @param editing - The decoded editing declaration\n * @param draftType - The entry's draft type\n * @param mint - Mints a new line's id on a source with loose rows\n * @returns The wire row, its draft and the wire row the decoder reads child drafts by\n */\nexport function prepareCreation(\n    input: SheetRowValue,\n    current: EntryVersion,\n    previousInput: SheetRowValue | undefined,\n    place: Placement,\n    editing: Editing,\n    draftType: EastType,\n    mint?: () => string,\n): Prepared {\n    const field = editing.children.type === \"some\" ? editing.children.value : undefined;\n    if (draftType.type !== \"Variant\") return prepareOf(input, current, previousInput, place, editing, draftType, field, undefined);\n    // An entry of groups and loose rows: prepare its arm, then wrap it.\n    const arm = input.band.type === \"none\" ? \"row\" : \"group\";\n    const armType = draftType.cases[arm];\n    if (armType === undefined) throw new Error(\"Expected an entry draft of a group or a row\");\n    const inner = current.draft === undefined ? undefined : (current.draft as variant).value;\n    const prepared = prepareOf(input, { ...current, draft: inner }, previousInput, place, editing, armType, arm === \"group\" ? field : undefined, mint);\n    return { ...prepared, draft: prepared.draft === undefined ? undefined : variant(arm, prepared.draft) };\n}\n\n/**\n * What a gesture's new entry — a row, a group, or a line of one — lacks that no person can set in the sheet (#1536):\n * the first of the declaration's `unsettable` fields its draft leaves missing, read as the gesture leaves it, so a\n * duplicate has its source's values. A new entry is one the gesture made, its lines new with it; a new line, one its\n * group did not hold before the gesture — a line moved in from another group brings its own draft.\n *\n * @param before - The entry's version before the gesture\n * @param after - Its version after it\n * @param editing - The decoded editing declaration\n * @param draftType - The entry's draft type\n * @returns What the new entry would have been, and the field's label — `undefined` when it lacks none\n */\nexport function unsetField(before: EntryVersion, after: EntryVersion, editing: Editing, draftType: EastType): { what: \"row\" | \"line\" | \"group\"; label: string } | undefined {\n    if (after.draft === undefined) return undefined;\n    const created = before.draft === undefined;\n    const missing = (draft: unknown, fields: Editing[\"unsettable\"][\"row\"]) => fields.find(({ field }) => (draft as Record<string, variant | undefined>)[field]?.type === \"missing\");\n    // An entry of groups and loose rows: its arm says which it is.\n    const arm = draftType.type === \"Variant\" ? (after.draft as variant) : undefined;\n    const draft = arm === undefined ? after.draft : arm.value;\n    const field = editing.children.type === \"some\" && arm?.type !== \"row\" ? editing.children.value : undefined;\n    if (field === undefined) {\n        const unset = created ? missing(draft, editing.unsettable.row) : undefined;\n        return unset === undefined ? undefined : { what: \"row\", label: unset.label };\n    }\n    const unset = created ? missing(draft, editing.unsettable.group) : undefined;\n    if (unset !== undefined) return { what: \"group\", label: unset.label };\n    const held = new Set(created ? [] : before.wire?.lines.map((line) => line.key));\n    const children = (draft as Record<string, unknown>)[field] as readonly unknown[];\n    for (const [i, line] of (after.wire?.lines ?? []).entries()) {\n        const lacks = held.has(line.key) ? undefined : missing(children[i], editing.unsettable.row);\n        if (lacks !== undefined) return { what: \"line\", label: lacks.label };\n    }\n    return undefined;\n}\n\n/** {@link prepareCreation} for one struct draft: a flat row, a loose row, or a group with its children. */\nfunction prepareOf(\n    input: SheetRowValue,\n    current: EntryVersion,\n    previousInput: SheetRowValue | undefined,\n    place: Placement,\n    editing: Editing,\n    draftType: EastType,\n    field: string | undefined,\n    mint: (() => string) | undefined,\n): Prepared {\n    const decodeDraft = decodeBeast2For(draftType);\n    let draft = current.draft;\n    let baseWire = current.wire;\n    let seeded = false;\n    if (draft === undefined && place.type === \"some\") {\n        const seed = field === undefined\n            ? editing.newRow.type === \"some\" ? editing.newRow.value({ destination: variant(\"entry\", place.value) }) : undefined\n            : editing.newGroup.type === \"some\" ? editing.newGroup.value({ place: place.value }) : undefined;\n        if (seed) { draft = decodeDraft(seed.draft); baseWire = decodeWire(seed.row); seeded = true; }\n    }\n    // Existing entries arrive as full projections. Only intra-gesture deltas\n    // need merging; a new entry overlays its explicit input onto its defaults.\n    const cells = seeded || previousInput !== undefined\n        ? cellsAfter(input.cells, baseWire?.cells, previousInput?.cells) : input.cells;\n    if (field === undefined) return { row: { ...input, cells }, draft, previous: baseWire };\n    if (draftType.type !== \"Struct\") throw new Error(\"Expected a group draft struct\");\n    const childrenType = draftType.fields[field];\n    if (childrenType?.type !== \"Array\") throw new Error(\"Expected child drafts\");\n    const childDraftType = childrenType.value;\n    const decodeChild = decodeBeast2For(childDraftType);\n    const idField = editing.idField.type === \"some\" ? editing.idField.value : undefined;\n    const mintsId = mint !== undefined && idField !== undefined && childDraftType.type === \"Struct\" && childDraftType.fields[idField] !== undefined;\n    const group = (draft ?? emptyDraft(draftType)) as Record<string, unknown>;\n    const oldChildren = group[field] as unknown[];\n    const byKey = new Map(baseWire?.lines.map((line, index) => [line.key, { line, draft: oldChildren[index] }]));\n    const oldInput = new Map(previousInput?.lines.map(line => [line.key, line]));\n    // The gesture's later wire events were created before these defaults.\n    // Retain constructor children that none of those events has seen yet.\n    const initialLines = seeded ? baseWire!.lines\n        : previousInput === undefined ? [] : baseWire?.lines.filter(line => !oldInput.has(line.key)) ?? [];\n    const incoming = [...initialLines, ...input.lines];\n    const children: unknown[] = [];\n    const lines = incoming.map((line, index) => {\n        const previous = byKey.get(line.key);\n        let childDraft = previous?.draft;\n        let defaults: Map<string, SheetCellValue> | undefined;\n        if (childDraft === undefined && editing.newRow.type === \"some\") {\n            const seed = editing.newRow.value({ destination: variant(\"child\", { group: input.id, index: BigInt(index) }) });\n            childDraft = decodeChild(seed.draft);\n            defaults = decodeWire(seed.row).cells;\n        }\n        let child = childDraft ?? emptyDraft(childDraftType);\n        // A new line beside loose rows (#846): its id field — a loose row's identity — minted unless supplied.\n        if (previous === undefined && mintsId && (child as Record<string, { type: string }>)[idField!]?.type === \"missing\") {\n            child = { ...(child as Record<string, unknown>), [idField!]: variant(\"value\", mint!()) };\n        }\n        children.push(child);\n        const cells = defaults !== undefined || previousInput !== undefined\n            ? cellsAfter(line.cells, defaults ?? previous?.line.cells, oldInput.get(line.key)?.cells) : line.cells;\n        return { ...line, cells };\n    });\n    const row = { ...input, cells, lines };\n    return { row, draft: { ...group, [field]: children }, previous: row };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The copilot runner (`Sheet Spec.md` §6.2 — B§5): providers run against the\n * row AS IT WOULD BE if the open editor committed, over the bridged WIRE\n * functions of §4.8 — the runner never sees the host's row type. Per column,\n * the first provider that yields wins, by position; owned rows are skipped;\n * nothing lands in an occupied cell; a fill the planner dismissed on that row\n * is not asked for again; results are memoised per (anchor, provisional row,\n * column, provider). Fills CHAIN in column order — a later column's providers\n * (and the proposers) see the earlier columns' fills as if taken, the\n * prototype's `row.start || fill.start`: the end derives from a predicted\n * start, the notes phrase and the station count read the predicted quantity. A synchronous provider answers inline; an asynchronous\n * one is returned as work the component tracks (`suggest-async.ts`) — a\n * later synchronous provider answers meanwhile, and an earlier asynchronous\n * one that lands replaces it (first that yields wins, still by position).\n * Proposers run the same way once per anchor, their rows capped at `ahead`,\n * never into an occupied slot, minus the follower pairings the planner\n * rejected.\n *\n * @packageDocumentation\n */\n\nimport { NULL_CELL, cellIsBlank, rawCellText, type SheetKind } from \"./model.js\";\nimport type { PendingFill, PendingRow, Rejections, Suggestions } from \"./sheet-types.js\";\nimport type { SheetCellValue, SheetContextValue, SheetProposalValue, SheetProposerValue, SheetProviderValue, SheetRowValue } from \"./values.js\";\n\n/** The copilot's latency per kind (B§3): deterministic kinds fire fast, the rest wait for a pause in typing. */\nexport const LATENCY_MS = { instant: 150, idle: 1100 } as const;\n\n/** A provider or a proposer on the wire — the compiled closure under its `sync` / `async` arm. */\nexport type WireProvider = SheetProviderValue | SheetProposerValue;\n\n/** What a synchronous fill provider returns — `Option<Fill>`. */\ntype FillOutcome = ReturnType<Extract<SheetProviderValue, { type: \"sync\" }>[\"value\"]>;\n\n/** One column's fill providers. */\nexport interface FillColumn {\n    key: string;\n    kind: SheetKind;\n    editable: boolean;\n    /** Whether a row's cell takes a fill — its column writes and no mark locks it (#1560); `editable` alone when absent. */\n    writable?: ((cells: ReadonlyMap<string, SheetCellValue>) => boolean) | undefined;\n    providers: readonly SheetProviderValue[];\n}\n\n/** What one run reads. */\nexport interface SuggestInput {\n    /** The anchor — a real row's id, or a blank row's synthetic id. */\n    anchorId: string;\n    /** The provisional anchor row (the open editor's value applied). */\n    row: SheetRowValue;\n    /** The column being edited — not filled, unless it is a link (predicted into). */\n    skipKey: string | undefined;\n    columns: readonly FillColumn[];\n    proposers: readonly SheetProposerValue[];\n    /** At most this many proposed rows. */\n    ahead: number;\n    /** The slot below the anchor is occupied — never propose into it. */\n    nextBusy: boolean;\n    /** The anchor's driver key (the rejected-follower pairings). */\n    driverKey: string | undefined;\n    driverColumn: string | undefined;\n    rejected: Rejections;\n    /** The wire context over a row — the provisional anchor, or the anchor with one cell blanked. */\n    contextOf: (row: SheetRowValue) => SheetContextValue;\n    memo: SuggestMemo;\n}\n\n/** An async provider's settled result. */\nexport type AsyncResult = { kind: \"fill\"; fill: PendingFill | null } | { kind: \"rows\"; rows: PendingRow[] };\n\n/** An async provider the component tracks — delivered only while its generation is current. */\nexport interface AsyncWork {\n    /** The column key, or `\"rows\"`. */\n    key: string;\n    index: number;\n    run: () => Promise<AsyncResult>;\n}\n\n/** One run's outcome. */\nexport interface SuggestOutcome {\n    sugg: Suggestions | null;\n    async: AsyncWork[];\n}\n\n/** The memo — settled results and in-flight promises per (anchor, provisional row, column, provider). */\nexport class SuggestMemo {\n    private readonly map = new Map<string, unknown>();\n    get(key: string): unknown { return this.map.get(key); }\n    has(key: string): boolean { return this.map.has(key); }\n    set(key: string, value: unknown): void {\n        if (this.map.size > 4000) this.map.clear();\n        this.map.set(key, value);\n    }\n    clear(): void { this.map.clear(); }\n}\n\n/** A row with one cell replaced. */\nfunction withCell(row: SheetRowValue, key: string, cell: SheetCellValue): SheetRowValue {\n    const cells = new Map(row.cells);\n    cells.set(key, cell);\n    return { ...row, cells };\n}\n\n/** A row's cells, printed — the memo's notion of \"the same provisional row\". */\nexport function hashRow(row: SheetRowValue): string {\n    const parts: string[] = [];\n    for (const [k, c] of row.cells) parts.push(`${k}=${c.type}:${rawCellText(c)}`);\n    return parts.join(\"|\");\n}\n\n/** The fill an East `Option<Fill>` value carries. */\nfunction fillOf(out: unknown, index: number): PendingFill | null {\n    const o = out as FillOutcome | null | undefined;\n    if (o === null || o === undefined || o.type !== \"some\") return null;\n    if (cellIsBlank(o.value.value)) return null;\n    return { cell: o.value.value, meta: o.value.meta, index };\n}\n\n/** The rows an East `Array<Proposal>` value carries. */\nfunction rowsOf(out: unknown): PendingRow[] {\n    const list = out as readonly SheetProposalValue[] | null | undefined;\n    if (list === null || list === undefined || !Array.isArray(list)) return [];\n    return list.map((p) => ({ cells: p.cells, meta: p.meta }));\n}\n\n/** The provider's East result — thrown errors read as nothing, with a diagnostic. */\nfunction callSync(p: WireProvider, ctx: SheetContextValue, where: string): unknown {\n    try {\n        return p.value(ctx);\n    } catch (err) {\n        console.error(`[Sheet] ${where} failed:`, err);\n        return null;\n    }\n}\n\n/** Start an async provider once — the promise is memoised so a re-run re-attaches instead of restarting it. */\nfunction startAsync<T>(memo: SuggestMemo, key: string, run: () => Promise<T>, where: string, fallback: T): Promise<T> {\n    const known = memo.get(key);\n    if (known instanceof Promise) return known as Promise<T>;\n    const p = Promise.resolve()\n        .then(run)\n        .catch((err: unknown) => {\n            console.error(`[Sheet] ${where} failed:`, err);\n            return fallback;\n        })\n        .then((res) => { memo.set(key, res); return res; });\n    memo.set(key, p);\n    return p;\n}\n\n/** Run the copilot once for an anchor. */\nexport function runSuggest(input: SuggestInput): SuggestOutcome {\n    const { row, memo } = input;\n    if (row.owned) return { sugg: null, async: [] };\n    const fill = new Map<string, PendingFill>();\n    const async: AsyncWork[] = [];\n    const pending = new Set<string>();\n    // The row as the providers see it: the anchor, plus the fills found so far (they chain in column order).\n    let provisional = row;\n    let provisionalHash: string | undefined;\n    let provisionalCtx: SheetContextValue | undefined;\n    const hash = () => (provisionalHash ??= hashRow(provisional));\n    const context = () => (provisionalCtx ??= input.contextOf(provisional));\n    const chain = (key: string, cell: SheetCellValue) => {\n        provisional = withCell(provisional, key, cell);\n        provisionalHash = undefined;\n        provisionalCtx = undefined;\n    };\n\n    for (const col of input.columns) {\n        if (!(col.writable?.(row.cells) ?? col.editable) || col.providers.length === 0) continue;\n        const predictedInto = col.kind === \"link\" || col.kind === \"set\";\n        if (col.key === input.skipKey && !predictedInto) continue;\n        if (input.rejected.fills.has(`${input.anchorId}|${col.key}`)) continue;\n        const occupied = !cellIsBlank(row.cells.get(col.key));\n        // The edited link column is predicted into: its providers see the row with that cell blank.\n        if (occupied && !(predictedInto && col.key === input.skipKey)) continue;\n        let ctxFor: SheetContextValue | undefined;\n        const ctx = () => {\n            if (ctxFor !== undefined) return ctxFor;\n            if (occupied) {\n                const cells = new Map(provisional.cells);\n                cells.set(col.key, NULL_CELL);\n                ctxFor = input.contextOf({ ...provisional, cells });\n            } else ctxFor = context();\n            return ctxFor;\n        };\n        const found = (out: PendingFill) => {\n            fill.set(col.key, out);\n            if (!occupied) chain(col.key, out.cell);\n        };\n        for (let i = 0; i < col.providers.length; i++) {\n            const p = col.providers[i]!;\n            const where = `fill provider #${i + 1} on column \"${col.key}\"`;\n            const mk = `${input.anchorId}${hash()}${col.key}${i}`;\n            if (p.type === \"sync\") {\n                let out: PendingFill | null;\n                if (memo.has(mk)) out = memo.get(mk) as PendingFill | null;\n                else {\n                    out = fillOf(callSync(p, ctx(), where), i);\n                    memo.set(mk, out);\n                }\n                if (out !== null) { found(out); break; }\n                continue;\n            }\n            const known = memo.get(mk);\n            if (known !== undefined && !(known instanceof Promise)) {\n                const out = known as PendingFill | null;\n                if (out !== null) { found(out); break; }\n                continue;\n            }\n            const promise = startAsync<PendingFill | null>(memo, mk, () => Promise.resolve(p.value(ctx())).then((o) => fillOf(o, i)), where, null);\n            pending.add(col.key);\n            async.push({ key: col.key, index: i, run: () => promise.then((f) => ({ kind: \"fill\", fill: f })) });\n        }\n    }\n\n    let rows: PendingRow[] = [];\n    if (!input.nextBusy && input.proposers.length > 0 && input.ahead > 0) {\n        const admit = (list: PendingRow[]): PendingRow[] => list\n            .filter((r) => {\n                const cell = input.driverColumn !== undefined ? r.cells.get(input.driverColumn) : undefined;\n                const to = cell !== undefined && cell.type === \"String\" ? cell.value : \"\";\n                return !(input.driverKey !== undefined && to !== \"\" && input.rejected.follows.has(`${input.driverKey}>${to}`));\n            })\n            .slice(0, input.ahead);\n        for (let i = 0; i < input.proposers.length; i++) {\n            const p = input.proposers[i]!;\n            const where = `proposer #${i + 1}`;\n            const mk = `${input.anchorId}${hash()}rows${i}`;\n            if (p.type === \"sync\") {\n                let out: PendingRow[];\n                if (memo.has(mk)) out = memo.get(mk) as PendingRow[];\n                else {\n                    out = rowsOf(callSync(p, context(), where));\n                    memo.set(mk, out);\n                }\n                const kept = admit(out);\n                if (kept.length > 0) { rows = kept; break; }\n                continue;\n            }\n            const known = memo.get(mk);\n            if (known !== undefined && !(known instanceof Promise)) {\n                const kept = admit(known as PendingRow[]);\n                if (kept.length > 0) { rows = kept; break; }\n                continue;\n            }\n            const promise = startAsync<PendingRow[]>(memo, mk, () => Promise.resolve(p.value(context())).then(rowsOf), where, []);\n            pending.add(\"rows\");\n            async.push({ key: \"rows\", index: i, run: () => promise.then((list) => ({ kind: \"rows\", rows: admit(list) })) });\n        }\n    }\n\n    if (fill.size === 0 && rows.length === 0 && pending.size === 0) return { sugg: null, async };\n    return { sugg: { anchorId: input.anchorId, fill, rows, pending: [...pending] }, async };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The async providers' in-flight registry (`Sheet Spec.md` §5 row 11): every\n * run of the copilot opens a generation; a settlement is delivered only while\n * its generation is current — a newer context cancels the wait (latest wins),\n * and a cancelled result is dropped, never landed. A rejected or thrown\n * provider is skipped with a diagnostic naming the column (the runner's\n * memoised promise carries the diagnostic; here the settlement just lands as\n * nothing).\n *\n * @packageDocumentation\n */\n\nimport type { AsyncWork, AsyncResult } from \"./suggest.js\";\n\n/** The in-flight registry — one generation at a time. */\nexport class InFlight {\n    private gen = 0;\n    /** Open a new generation: everything still in flight is superseded. */\n    begin(): number {\n        this.gen += 1;\n        return this.gen;\n    }\n    /** Whether a generation is still the current one. */\n    isCurrent(gen: number): boolean {\n        return gen === this.gen;\n    }\n    /** Supersede everything in flight. */\n    cancel(): void {\n        this.gen += 1;\n    }\n}\n\n/**\n * Track one piece of async work: deliver its settlement under the generation\n * guard. The delivery callback runs after the promise settles, on a microtask.\n */\nexport function trackWork(\n    inflight: InFlight,\n    gen: number,\n    work: AsyncWork,\n    deliver: (key: string, result: AsyncResult) => void,\n): void {\n    void work.run().then(\n        (result) => { if (inflight.isCurrent(gen)) deliver(work.key, result); },\n        (err: unknown) => {\n            console.error(`[Sheet] async provider on \"${work.key}\" failed:`, err);\n            if (inflight.isCurrent(gen)) deliver(work.key, work.key === \"rows\" ? { kind: \"rows\", rows: [] } : { kind: \"fill\", fill: null });\n        },\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The gutter's width — rail · number · actions. A fine pointer's least gutter\n * holds the actions column's 24 px buttons; a coarse pointer's keeps the\n * marker, the number and two 44 px actions in separate touch targets. A frame\n * too narrow for that gutter beside a cell FOLDS it (#1215): the actions go\n * into one 44 px row-actions button — the row's grip and its menu — beside the\n * rail and the number.\n *\n * The number column is as wide as the widest number the sheet shows, measured\n * in the number's own face, and never narrower than its least width: every\n * gutter grows by what it grows by, so the actions keep their room and no\n * number runs into the checkbox beside it.\n *\n * @packageDocumentation\n */\n\n/** The number column's least width: up to three digits, as the rows draw them. */\nexport const NUMBER_PX = 36;\n\n/** The gutter's least width: rail 28 · number 36 · actions 64. */\nexport const GUTTER_PX = 128;\n\n/** On a coarse pointer: the marker, the number and two 44 px actions in separate touch targets. */\nexport const COARSE_GUTTER_PX = 254;\n\n/** Folded (#1215): rail 28 · number 36 · one 44 px row-actions button. */\nexport const FOLDED_GUTTER_PX = 108;\n\n/** The gutter's least widths beside a number column of a given width. */\nexport interface GutterWidths {\n    /** A fine pointer's. */\n    fine: number;\n    /** A coarse pointer's. */\n    coarse: number;\n    /** A folded gutter's (#1215). */\n    folded: number;\n}\n\n/**\n * The gutter's least widths beside a number column `numberPx` wide: each grows\n * by what the column grows past {@link NUMBER_PX}, never shrinking below its\n * own, so the rail and the actions keep their widths.\n *\n * @param numberPx - The number column's width (px): the widest number the sheet shows, measured\n * @returns The fine pointer's, the coarse pointer's and the folded gutter's least widths\n */\nexport function gutterWidths(numberPx: number): GutterWidths {\n    const grown = Math.max(0, numberPx - NUMBER_PX);\n    return { fine: GUTTER_PX + grown, coarse: COARSE_GUTTER_PX + grown, folded: FOLDED_GUTTER_PX + grown };\n}\n\n/**\n * Whether the gutter folds its actions into one row-actions button (#1215):\n * on a coarse pointer, when the frame cannot show the full gutter and the\n * first column's least width beside it. The frame's own width decides, never\n * the window's — a builder's main folds while the window beside it is wide. A\n * fine pointer never folds, nor a frame not measured yet, nor a sheet with no\n * column to show.\n *\n * @param frame - The frame's width (px), `undefined` until it is measured\n * @param coarse - Whether the pointer is coarse\n * @param full - The full gutter's width (px) on that pointer\n * @param first - The first column's least width (px), `undefined` with no column\n * @returns Whether the gutter folds\n */\nexport function gutterFolds(frame: number | undefined, coarse: boolean, full: number, first: number | undefined): boolean {\n    return coarse && frame !== undefined && first !== undefined && frame < full + first;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Sheet's decoded value as the parts read it: the columns the grid draws — those the viewer hides left out, a phone's\n * pinned one first — the registers, the group declaration, the pitches and the gutter, the tracks, the app's callbacks and\n * its new keys, the narrowing and the views, the copilot's declaration and the row source.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useId, useMemo, useRef, useState, type RefObject } from \"react\";\nimport { SortedSet, StringType, StructType, compareFor, equalFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { Sheet } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, randomKeys, useCoarsePointer, useSlicesReactivity, useDataStable, type KnownKeys } from \"@elaraai/east-ui-components\";\nimport { useDensityHeights, devicePixels, type RowsViewport, windowedSourceOf } from \"@elaraai/east-ui-components/internal\";\nimport type { RecordSliceBindType, RecordSliceStateType } from \"@elaraai/east-ui/internal\";\nimport { DEFAULT_BLANKS, DEFAULT_GUTTER_PX, TITLE_KEY, cellWritable, densityOf, groupBandPx, indexColumns, indexGroup, indexRegisters, parseWidth } from \"./model.js\";\nimport { keyOrderOf } from \"./key-order.js\";\nimport { narrowingOf, sheetViewsEqual } from \"./view-state.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { todayUtc } from \"./parse/date.js\";\nimport { SheetRefused } from \"./creation.js\";\nimport { useSheetWords } from \"./words.js\";\nimport { SuggestMemo, type FillColumn } from \"./suggest.js\";\nimport { InFlight } from \"./suggest-async.js\";\nimport { NUMBER_PX, gutterFolds, gutterWidths } from \"./gutter.js\";\nimport type { SheetPagerColumn } from \"./Pager.js\";\nimport type { SheetNarrowing, SheetNounValue, SheetProposerValue, SheetRowValue, SheetSavedView, SheetDriverValue, SheetPagedSourceValue, SheetRootValue, SheetSelectionValue } from \"./values.js\";\nimport type { SheetHost, SheetHostLayout } from \"./parts.js\";\n\nconst sheetRootDataEqual = equalFor(Sheet.Types.Root);\n\nconst stringEqual = equalFor(StringType);\n\nconst compareString = compareFor(StringType);\n\n/** A live source's rows under one narrowing, named apart (#1354): the source and its narrowing, as East prints them. */\nconst printNarrowedSource = printFor(StructType({ source: StringType, narrowing: StringType }));\n\n/** A key made up at random: a new row's, where the app gives no rule of its own. */\nconst MADE_UP = randomKeys();\n\n/**\n * The narrowing a live source serves as it stands (#1354); `undefined` for any\n * other arm, or while it cannot be read — the paging says why, as it reads.\n *\n * @param source - The rows' windowed source, if any\n * @returns Its narrowing, as text\n */\nfunction narrowingOfSource(source: { query?: (() => string) | undefined } | undefined): string | undefined {\n    if (source?.query === undefined) return undefined;\n    try {\n        return source.query();\n    } catch {\n        return undefined;\n    }\n}\n\n/** No slice: no store key to follow. */\nconst NO_KEYS: readonly string[] = [];\n\n/** A phone's frame (`Mobile Sheet Spec.md` SH4): a pinned column's width, at the left, beside the window of columns. */\nexport const PHONE_PIN_PX = 150;\n\n/** How many columns a phone's frame shows at once beside any pinned one, unless the sheet's `narrow` says (SH1.4). */\nconst PHONE_COLUMNS = 2;\n\n/** What the jump menu keys the Row column by (SH2): no column's key, a name no author's column reaches through the grid. */\nconst ROW_COLUMN = \"\\u0000row\";\n\n/** A phone's band, px (SH6): 44, whatever the density. */\nconst PHONE_BAND_PX = 44;\n\n/**\n * The decode's East values, by their types' names: a value's inferred type carries East's variant brand, which the\n * declaration build cannot name (TS4058).\n */\ninterface SheetDecodeValues {\n    readonly capabilities: SheetRootValue[\"editing\"][\"edits\"];\n    readonly chrome: Extract<SheetRootValue[\"slice\"], { type: \"some\" }>[\"value\"] | undefined;\n    readonly declaredViews: SheetRootValue[\"views\"];\n    readonly decodedRows: readonly SheetRowValue[] | undefined;\n    readonly driver: SheetDriverValue | undefined;\n    readonly narrowing: SheetNarrowing | undefined;\n    readonly onSelectFn: Extract<SheetRootValue[\"onSelect\"], { type: \"some\" }>[\"value\"] | undefined;\n    readonly onViewsChangeFn: Extract<SheetRootValue[\"onViewsChange\"], { type: \"some\" }>[\"value\"] | undefined;\n    readonly pagedSource: SheetPagedSourceValue | undefined;\n    readonly proposers: SheetProposerValue[];\n    readonly rowsPart: ValueTypeOf<RecordSliceBindType> | undefined;\n    readonly rowsWhere: ValueTypeOf<typeof RecordSliceStateType>[\"where\"] | undefined;\n    readonly selection: SheetSelectionValue | undefined;\n    readonly views: readonly SheetSavedView[];\n    readonly viewsRef: RefObject<readonly SheetSavedView[]>;\n}\n\n/**\n * Decodes the Sheet's value into what every part reads (see the module docs).\n *\n * @param value - The Sheet root value\n * @param host - What the frame hands the parts\n * @returns The columns, the layout, the callbacks, the narrowing, the views and the row source\n */\nexport function useSheetDecode(value: SheetRootValue, host: SheetHost) {\n    // Changes identity on a DATA change only — what owns local state keys on\n    // it; callbacks come from `value` (#809).\n    const data = useDataStable(value, sheetRootDataEqual);\n    // The sheet's words (#861) — the message table in effect, and the\n    // counts the chrome prints (the summary, the hints, the messages, the\n    // lens line) in the app's locale (#850).\n    const words = useSheetWords();\n    // The grid's id: its cells' ids hang off it, and the view tabs name it as what they switch (#860).\n    const gridId = useId();\n    // ── Decode ────────────────────────────────────────────────────────────\n    // Every declared column — what a new row is made of — and the columns\n    // the grid draws: all but those the viewer hides (#1186), and every one\n    // when it would hide them all.\n    const allColumns = useMemo(() => indexColumns(value.columns), [value.columns]);\n    const hidden = host.hidden;\n    // A host draws the grid (#1531): its rows at its pitch, its lead before the columns, no gutter.\n    const hostGrid = host.grid;\n    // The frame's width: inside it (`clientWidth`), the view a sub row's well\n    // keeps its content to; its box (`offsetWidth`, which no scrollbar of its\n    // own changes), what decides whether the gutter folds (#1215).\n    const [viewPx, setViewPx] = useState<number | undefined>(undefined);\n    const [framePx, setFramePx] = useState<number | undefined>(undefined);\n    // A phone's frame (`Mobile Sheet Spec.md`): 560 wide or less — a frame not laid out yet (0 wide) is none. The\n    // columns are a window the pager pages (SH1), no gutter (R5) — and a host's grid no lead (#1536); the column the\n    // sheet's `narrow.pin` names, where it names one the grid draws, leads the row pinned at the left (SH4) — none by\n    // default (ruled 3 Nov 2026). The grid is a phone's as its host's frame is, where the host says — once the grid is\n    // laid out too: a window before its own width is known gives each column none, and the browser, keeping its snap\n    // target as they widen, opens the window a column on.\n    const phoneFrame = framePx !== undefined && framePx > 0 && (host.phone ?? framePx <= 560);\n    const narrow = useMemo(() => getSomeorUndefined(value.narrow), [value.narrow]);\n    const pinKey = narrow === undefined ? undefined : getSomeorUndefined(narrow.pin);\n    const columns = useMemo(() => {\n        const shown = hidden === undefined || hidden.size === 0 ? value.columns : value.columns.filter((c) => !hidden.has(c.key));\n        const drawn = shown.length === 0 ? value.columns : shown;\n        const pinAt = !phoneFrame || pinKey === undefined ? -1 : drawn.findIndex((c) => stringEqual(c.key, pinKey));\n        // The pinned column first, the others in their order beside it.\n        if (pinAt > 0) return indexColumns([drawn[pinAt]!, ...drawn.slice(0, pinAt), ...drawn.slice(pinAt + 1)]);\n        return drawn.length === value.columns.length ? allColumns : indexColumns(drawn);\n    }, [allColumns, value.columns, hidden, phoneFrame, pinKey]);\n    // Whether a phone's frame pins a column: the one `narrow.pin` names, led into first place above.\n    const pinned = phoneFrame && pinKey !== undefined && columns.list[0] !== undefined && stringEqual(columns.list[0].key, pinKey);\n    const pinPx = pinned ? PHONE_PIN_PX : 0;\n    // A phone's Row column (SH2, R5): the row numbers as a column of the window, off until the jump menu's `Row number` —\n    // never a host's grid's, which has no row numbers (#1531).\n    const [rowNumbersOn, setRowNumbers] = useState(false);\n    const rowNumbers = phoneFrame && hostGrid === undefined && rowNumbersOn;\n    const registers = useMemo(() => indexRegisters(value.registers), [value.registers]);\n    const driver = useMemo(() => getSomeorUndefined(value.driver), [value.driver]);\n    const driverColumn = driver?.column;\n    // Grouped rows (#740): the band's cells and the title span.\n    const titleColumn = words.m.titleColumn();\n    const group = useMemo(() => {\n        const g = getSomeorUndefined(value.group);\n        return g !== undefined ? indexGroup(g, columns, titleColumn) : undefined;\n    }, [value.group, columns, titleColumn]);\n    const titleMeta = group?.cells.get(TITLE_KEY);\n    // Rows of the line type may stand between the groups (#846): a LOOSE row.\n    const loose = group?.loose === true;\n    const style = useMemo(() => getSomeorUndefined(value.style), [value.style]);\n    const size = densityOf(value);\n    const coarse = useCoarsePointer();\n    // The pitches on the device-pixel grid the frame measures and places its rows on (`devicePixels`), as the Roster's\n    // and the Calendar's row floors are: at a fractional device pixel ratio a row drawn at a CSS pitch measures a\n    // fraction of a pixel off it, which the frame keeps by its key — the rows read as the sheet opened, leaving the run\n    // for a band as a far drag came to rest, took theirs with them and moved the view up by as much; under the lens every\n    // row and stretch mounting was a compensation of the scroll the view could only round, and the view crept as the\n    // narrowing's rows landed (#1398, CL8). On the grid each one measures as it was laid out, and rows land where their\n    // placeholders stood.\n    const densityRow = useDensityHeights(size).row;\n    // A phone's rows (SH5): 44 on a coarse pointer, 32 on a fine one, whatever the density — the rule included. A host's\n    // grid, its own pitch at every width (#1531).\n    const rowPx = devicePixels(phoneFrame && hostGrid === undefined ? (coarse ? 44 : 32) : Math.max(hostGrid?.rowPx ?? densityRow, coarse ? 45 : 0));\n    const bandPx = devicePixels(phoneFrame ? PHONE_BAND_PX : Math.max(groupBandPx(size), coarse ? 46 : 42));\n    // A sub row's least height; a wrapping detail grows it, and the rows are measured.\n    const subRowPx = devicePixels(30);\n    // The word for a group: the host's (#844), else the sheet's words (#861).\n    // The machine's messages carry only the host's, and word a missing one\n    // when they show — so a new table re-words them.\n    const declaredNoun = group?.noun;\n    const noun = useMemo<SheetNounValue>(() => declaredNoun ?? { singular: words.m.groupNoun(), plural: words.m.groupNouns() }, [declaredNoun, words.m]);\n    const readOnly = (getSomeorUndefined(value.readOnly) ?? false) || value.editing.onApply.type === \"none\";\n    const capabilities = value.editing.edits;\n    // A keyed source — paged (#880), or a record read whole (#1182): its rows\n    // sort by key, at the key's own type, so nothing is placed by position.\n    const keyed = value.editing.keyType.type === \"some\";\n    // The narrowing (#1345): one rail over the sheet's `Slice.bindRecords` —\n    // its `rows` source the rows', which the sheet pages from it; each other\n    // source narrows the templates list or the library tab that names it.\n    const chrome = useMemo(() => getSomeorUndefined(value.slice), [value.slice]);\n    const rowsPart = useMemo(() => sourcePart(chrome, \"rows\"), [chrome]);\n    // The query already orders these rows by its index. Drafting a cell must\n    // preserve that order; primary keys are identity, not display positions.\n    const keyOrder = useMemo(() => (!value.ordered && value.editing.keyType.type === \"some\" ? keyOrderOf(value.editing.keyType.value) : undefined), [value.editing.keyType, value.ordered]);\n    const canInsertRows = !readOnly && capabilities.insertRows;\n    const canInsertGroups = !readOnly && capabilities.insertGroups && group !== undefined;\n    // The grouped blank-tail path remains until all insertions use explicit destinations.\n    const blanks = !capabilities.insertRows ? 0 : group !== undefined ? (readOnly ? 0 : 1) : Number(getSomeorUndefined(value.blanks) ?? BigInt(DEFAULT_BLANKS));\n    // What moves the rows, as the frame reports it (#856): the element they\n    // scroll in, both ways.\n    const [viewport, setViewport] = useState<RowsViewport | null>(null);\n    // The number column: as wide as the widest number the sheet shows, in the\n    // number's own face (measured in `use-scroll.tsx`, before the first paint), never\n    // narrower than its least width — and every gutter grows by what it grows by.\n    const [numberPx, setNumberPx] = useState(NUMBER_PX);\n    const least = gutterWidths(numberPx);\n    // Touch targets fit in separate lanes; row heights include their seam borders.\n    const fullGutterPx = Math.max(parseWidth(style !== undefined ? getSomeorUndefined(style.gutterWidth) : undefined) ?? DEFAULT_GUTTER_PX, least.fine, coarse ? least.coarse : 0);\n    // A frame too narrow for the touch gutter beside the first column folds it: one row-actions button holds each row's actions (#1215).\n    const folded = hostGrid === undefined && gutterFolds(framePx, coarse, fullGutterPx, columns.list[0]?.width);\n    // A phone's frame has no gutter (R5): its rows are picked by their pinned cell, and their actions are the Inspector's.\n    // A host's grid has none either (#1531): its lead stands there — a Record's select column — where it has one, and on\n    // a phone's frame goes as the gutter does (#1536).\n    const gutterPx = phoneFrame ? 0 : hostGrid !== undefined ? hostGrid.leadPx : folded ? least.folded : fullGutterPx;\n    // The columns a phone's pager pages: every one but a pinned one; and what it pages, the Row column before them while it shows.\n    const pagedColumns = useMemo(() => (pinned ? columns.list.slice(1) : columns.list), [columns, pinned]);\n    const pagerColumns = useMemo((): readonly SheetPagerColumn[] => {\n        const each = pagedColumns.map((c): SheetPagerColumn => ({ key: c.key, header: c.header, kind: words.m.columnKind({ kind: c.kind }) }));\n        return rowNumbers ? [{ key: ROW_COLUMN, header: words.m.pagerRow(), kind: words.m.pagerRowKind() }, ...each] : each;\n    }, [pagedColumns, rowNumbers, words.m]);\n    // A phone's window (SH1.4): the frame's width less any pinned column, shared by the columns in view — as many as\n    // the sheet's `narrow.columns` says, else two, and never more than it pages: the window never ends at an empty slot.\n    const narrowColumns = narrow === undefined ? undefined : getSomeorUndefined(narrow.columns);\n    const phoneColumns = Math.max(1, Math.min(narrowColumns === undefined ? PHONE_COLUMNS : Number(narrowColumns), pagerColumns.length));\n    const slotPx = phoneFrame && viewPx !== undefined ? Math.max(0, (viewPx - pinPx) / phoneColumns) : 0;\n    // The frame's slack goes to the TEXT columns, each capped at 2.5× its\n    // width, and the last column takes the rest, out to the frame's edge: the\n    // grid ends at its own last column, never at an empty track after it. A\n    // host's grid keeps its last column at its own width, as any other, and\n    // what is left lies after it, empty: a Record's cells stay under their\n    // headers, never out at the frame's edge. A phone's frame: any pinned\n    // column, then a slot a column (SH1, SH4) — the gutter's cells drawn\n    // nowhere (the recipe), so they take no track, but as the Row column, a\n    // slot of its own first among the paged ones (SH2).\n    const gridTemplate = useMemo(() => {\n        if (phoneFrame) {\n            const tracks = columns.list.map((_c, i) => (i === 0 && pinned ? `${PHONE_PIN_PX}px` : `${slotPx}px`));\n            if (rowNumbers) tracks.splice(pinned ? 1 : 0, 0, `${slotPx}px`);\n            return tracks.join(\" \");\n        }\n        const last = columns.list.length - 1;\n        const tracks = columns.list.map((c, i) => (i === last && hostGrid === undefined ? `minmax(${c.width}px, 1fr)`\n            : c.kind === \"text\" ? `minmax(${c.width}px, ${Math.round(c.width * 2.5)}px)` : `${c.width}px`));\n        if (hostGrid !== undefined) tracks.push(\"1fr\");\n        // A host's grid with no lead has no lead track (#1531).\n        return hostGrid !== undefined && gutterPx === 0 ? tracks.join(\" \") : `${gutterPx}px ${tracks.join(\" \")}`;\n    }, [gutterPx, columns, phoneFrame, slotPx, pinned, rowNumbers, hostGrid]);\n    // How a host's rows and header are laid out (#1536): its lead's track, a phone's frame and its pinned column — one\n    // object while they hold, so no row's memo sees it change.\n    const hostLayout = useMemo((): SheetHostLayout => ({ lead: gutterPx > 0, phone: phoneFrame, pinPx }), [gutterPx, phoneFrame, pinPx]);\n    const minWidth = phoneFrame ? pinPx + slotPx * pagerColumns.length : gutterPx + columns.list.reduce((n, c) => n + c.width, 0);\n    // The window as it stands, for a pick of the phone's Library (SH11).\n    const pagerRef = useRef({ list: pagerColumns, slot: slotPx, inView: phoneColumns });\n    pagerRef.current = { list: pagerColumns, slot: slotPx, inView: phoneColumns };\n    const today = useMemo(() => todayUtc(), []);\n\n    // Callbacks — taken from the latest value on every render.\n    const onSelectFn = useMemo(() => getSomeorUndefined(value.onSelect), [value.onSelect]);\n    const onViewsChangeFn = useMemo(() => getSomeorUndefined(value.onViewsChange), [value.onViewsChange]);\n    // The sheet's rule for a new entry's key (#1536): the app's `newKey`'s, given every key taken, each as its text — else\n    // one made up at random, as every builder's is. A key the app gives that is taken, or a `newKey` that throws,\n    // refuses the gesture. Its session makes every new row's key by it (#1583, `use-session.ts`), and holds the key as\n    // its own: the sheet keeps none.\n    const newKeyFn = useMemo(() => getSomeorUndefined(value.newKey), [value.newKey]);\n    const makeKey = useCallback((known: KnownKeys): string => {\n        if (newKeyFn === undefined) return MADE_UP.make(known, undefined, undefined)!;\n        let key: string;\n        try {\n            key = newKeyFn(new SortedSet(known.ids(), compareString));\n        } catch (error) {\n            throw new SheetRefused({ id: \"keyFailed\", reason: error instanceof Error ? error.message : String(error) });\n        }\n        if (known.has(key)) throw new SheetRefused({ id: \"keyTaken\", key });\n        return key;\n    }, [newKeyFn]);\n    // The controlled selection follows the host's DATA: a closure-only change\n    // must not snap the ring back to it.\n    const selection = useMemo(() => getSomeorUndefined(data.selection), [data.selection]);\n    // The slice and the views run on a grouped sheet too.\n    const activeView = useMemo(() => getSomeorUndefined(value.activeView), [value.activeView]);\n\n    // ── The narrowing — every source's, live from the store (§3.8, #1345) ──\n    // A slice write moves the version, and nothing else here does (#611).\n    const sliceVersion = useSlicesReactivity(chrome?.slice.parts.map((part) => part.slice.key) ?? NO_KEYS);\n    const narrowing = useMemo<SheetNarrowing | undefined>(() => (chrome === undefined ? undefined : narrowingOf(chrome)),\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- sliceVersion IS the dependency of each part's `read()`: the store moves, no prop does (#611)\n        [chrome, sliceVersion]);\n    // The `rows` source's narrowing: what the lens draws over the record's rows (#1349).\n    const rowsWhere = useMemo(() => narrowing?.get(\"rows\")?.where, [narrowing]);\n\n    // ── The views — the local layer over `views` until the host writes back ──\n    // The layer sits over the host's views by VALUE, not identity: every host\n    // re-render decodes a fresh array, and a tab the host has not written back\n    // yet must survive a row write-back.\n    const declaredViews = value.views;\n    const [viewsState, setViewsState] = useState<{ over: readonly SheetSavedView[]; views: readonly SheetSavedView[] }>({ over: declaredViews, views: declaredViews });\n    const views = useMemo(() => Object.is(viewsState.over, declaredViews) || sheetViewsEqual(viewsState.over, declaredViews) ? viewsState.views : declaredViews, [viewsState, declaredViews]);\n    const viewsRef = useRef(views);\n    viewsRef.current = views;\n\n    // The copilot's declaration: the columns' fill providers and the proposers, as wire functions (§4.8).\n    const suggestDecl = useMemo(() => getSomeorUndefined(value.suggest), [value.suggest]);\n    const fillColumns = useMemo<FillColumn[]>(() => columns.list.map((m): FillColumn => {\n        const editable = m.editable && m.kind !== \"stamped\" && m.kind !== \"action\";\n        // A cell a mark locks takes no fill (#1560).\n        return { key: m.key, kind: m.kind, editable, writable: (cells) => editable && cellWritable(m, cells), providers: m.raw.fill };\n    }), [columns]);\n    const proposers = useMemo<SheetProposerValue[]>(() => suggestDecl?.propose ?? [], [suggestDecl]);\n    const ahead = Number(suggestDecl?.ahead ?? 2n);\n    const triggers = useMemo(() => new Set(suggestDecl?.triggers ?? []), [suggestDecl]);\n    const copilotOn = !readOnly && (proposers.length > 0 || fillColumns.some((c) => c.providers.length > 0));\n    // The memo empties on every new value — new data, or a provider closure\n    // the root memo saw change (#809).\n    const suggestMemo = useRef(new SuggestMemo());\n    useEffect(() => { suggestMemo.current.clear(); }, [value]);\n    const inflight = useRef(new InFlight());\n\n    // ── The row source: inline rows, or the paged driver ──────────────────\n    // Any windowed arm: `paged`; `pinned` naming its snapshot — the one the\n    // driver follows through changes, and the session edits — as a `rows`\n    // source's record is (#1349); or `live`, a narrowed source naming its\n    // narrowing too (#1354). A live source keeps its id under every narrowing,\n    // so the sheet names each narrowing's rows apart, by the source and the\n    // narrowing together: its paging, its key search and its scroll take a new\n    // narrowing as the new result it is, and the session edits the record\n    // whatever the narrowing. The narrowing is read as it stands: the slice's\n    // reactivity above re-renders the sheet when a choice moves it.\n    const windowed = windowedSourceOf(value.rows);\n    const narrowedBy = narrowingOfSource(windowed);\n    const pagedSource = useMemo(() => (windowed === undefined || narrowedBy === undefined ? windowed\n        : { ...windowed, id: printNarrowedSource({ source: windowed.id, narrowing: narrowedBy }) }), [windowed, narrowedBy]);\n    // Over a `rows` source the rows are its record's, every one in the record's order (#1349): the source's\n    // narrowing is drawn over them as the lens while it narrows them.\n    const recordRows = rowsPart !== undefined && windowed !== undefined && narrowedBy === undefined;\n    const lensWanted = recordRows && rowsWhere !== undefined && rowsWhere.size > 0;\n    const decodedRows = useMemo<readonly SheetRowValue[] | undefined>(\n        () => (data.rows.type === \"inline\" ? (data.rows.value as readonly SheetRowValue[]) : undefined),\n        [data.rows],\n    );\n    const named: SheetDecodeValues = {\n        capabilities, chrome, declaredViews, decodedRows, driver, narrowing, onSelectFn, onViewsChangeFn, pagedSource,\n        proposers, rowsPart, rowsWhere, selection, views, viewsRef,\n    };\n    return {\n        activeView, ahead, allColumns, bandPx, blanks, canInsertGroups, canInsertRows, columns, copilotOn, declaredNoun,\n        driverColumn, fillColumns, folded, framePx, gridId, gridTemplate, group, gutterPx, hostGrid, hostLayout,\n        inflight, keyOrder, keyed, lensWanted, loose, makeKey, minWidth, noun, numberPx, pagedColumns,\n        pagerColumns, pagerRef, phoneColumns, phoneFrame, pinPx, pinned, readOnly, recordRows, registers, rowNumbers,\n        rowPx, setFramePx, setNumberPx, setRowNumbers, setViewPx, setViewport, setViewsState, size, slotPx, subRowPx,\n        suggestMemo, titleMeta, today, triggers, viewPx, viewport, words, ...named,\n    };\n}\n\n/** What {@link useSheetDecode} gives the parts after it. */\nexport type SheetDecode = ReturnType<typeof useSheetDecode>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** The Sheet's identity of a paged source snapshot — its id and revision — for its key search and its driver (#851: the Sheet is its only user). @packageDocumentation */\nimport { OptionType, StringType, StructType, equalFor, none, printFor, some, type ValueTypeOf } from \"@elaraai/east\";\n\n/** An absent source and a source discovering its revision remain distinct. */\nexport const PagedSnapshotType = StructType({ source: OptionType(StringType), revision: OptionType(StringType) });\nexport type PagedSnapshot = ValueTypeOf<typeof PagedSnapshotType>;\nexport const pagedSourceEqual: (a: PagedSnapshot[\"source\"], b: PagedSnapshot[\"source\"]) => boolean = equalFor(PagedSnapshotType.fields.source);\nexport const pagedSnapshotEqual: (a: PagedSnapshot, b: PagedSnapshot) => boolean = equalFor(PagedSnapshotType);\n/** React requires a scalar key; East's canonical printer preserves the typed identity. */\nexport const pagedSnapshotKey: (snapshot: PagedSnapshot) => string = printFor(PagedSnapshotType);\n\n/** Construct the identity using East Option values, including the discovery state. */\nexport function pagedSnapshot(source: string | undefined, revision: string | undefined): PagedSnapshot {\n    return { source: source === undefined ? none : some(source), revision: revision === undefined ? none : some(revision) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The paged sheet's driver (`Sheet Spec.md` §3.13) — the Plan's stack\n * (#577: the window ledger, the residency policy) over a POSITIONAL source.\n * The run, its bands, the stand-in, the demand and the jump's pin are the\n * windowed logic it shares with the Plan's driver (`shared/windowed.ts`,\n * #1398); what is the Sheet's own is its React state, the rows' positions,\n * what the view waits for and a family's stand-in.\n *\n * A sheet window is an `Array<SheetRow>` in stream order, so windows\n * concatenate at their offsets (the Table rule). The resident rows are the\n * RUN: the stretch of resident windows that are in — landed, or failed —\n * nearest the element the viewport is centred on (#876). A window still in\n * flight ends the stretch, because a positional row space cannot carry a\n * hole it cannot place; the windows past it are the bands' until it lands.\n * So a window loading above the rows on screen never takes them off it, nor\n * does one loading below — even when a window beyond it lands first.\n * Everything above the run is the head band, everything below it the tail\n * band, each sized by the ledger so eviction moves nothing and a window\n * landing beside the run takes exactly its band's slot. The ledger measures\n * a landed window by what the body draws of its rows — the caller's\n * `heightOf`, the body's own geometry (#855) — so an unloaded band is sized\n * at the rate rows are drawn: a group's blank line counts only when the\n * sheet draws one, a folded group is its band, open sub rows count.\n *\n * # A failure belongs to its window (#853)\n *\n * A window whose read throws is recorded against that window and the rest\n * of the run reads on: the run CROSSES it — its elements are known, so the\n * rows after it keep their positions ({@link SheetPaging.positions}) — and\n * the renderer draws its band where its rows would be, with the reason and\n * a Retry. The reader never asks a failed window again by itself (a failing\n * source would be hammered once per frame); {@link SheetPaging.retry} does.\n * A `total()` or `revision()` that throws is the SOURCE's failure: chrome\n * beside the rows, never in their place. Only a source that fails before\n * anything has landed replaces the sheet — there is nothing else to show.\n * The Plan's driver does the same (#811).\n *\n * Exhaustion comes from `total()`: the blank tail (the sheet's invitation to\n * type the next row) appears only once every source element is resident —\n * a blank row above unloaded rows would lie about where the end is.\n *\n * # A new revision keeps the rows (#851)\n *\n * The rows cached for a source belong to its `revision()` — the snapshot its\n * windows are served from. When the revision moves (the dataset was written,\n * a `refresh` was asked for), the resident windows are read again at the new\n * one, and until each lands the rows it had stand in: the sheet never empties\n * between two snapshots of its data, and a row whose id survives keeps its\n * element. The geometry stays too — the ledger's measured heights, and its\n * total until the new snapshot's total says otherwise — so the scroll\n * position, the bands and the blank tail hold. The Plan's driver does the\n * same (#821).\n *\n * # A source read another way keeps the rows, retained (#1599)\n *\n * A source is the page that reads it: its author's projection is among its\n * `page`'s captures, so a source whose `page` is not EQUIVALENT to the one\n * that filled the cache serves other rows under the same id and revision\n * (#809), and every window is read again. The rows it drew stand in for each\n * window until its own lands, as across a revision — but RETAINED\n * ({@link SheetPaging.reread}): they are the last reading's rows under this\n * one's columns, so a gesture on one would be read by this reading's rules.\n * At rest the windows are read again in the same turn, from the runtime, and\n * nothing stands in. While a read of the source is on its way — after a Save,\n * or another session's write — they do: dropped instead, the grid emptied\n * until that read landed whenever the author's block was evaluated again\n * meanwhile, a State it reads or a record it reads whole having moved.\n *\n * # A jump owns the viewport (#854)\n *\n * A key search moves the run onto its target window and pins it, but the\n * sheet can only scroll to the target once its rows are on screen. Until then\n * every viewport report is taken from where the sheet still is — over the\n * head band the move left behind — and honouring one would move the run back\n * and undo the jump. So while a jump is pending, reports move nothing. It\n * SETTLES once the run around the target has stopped moving and the target's\n * window is in the run ({@link SheetPaging.jump}) — the windows above it may\n * still be loading (#876): a window landing beside the run takes its band's\n * slot, so nothing on screen moves. The sheet shows the target (the\n * ring on its row, or the failed band) and hands the viewport back with\n * {@link SheetPaging.clearJump}, and the reports resume from where it\n * scrolled to. The Plan's driver does the same (#812).\n *\n * # A key's jump keeps the rows shown (#1398, CL10)\n *\n * A key that goes past the rows read jumps as a key search does, but fetch,\n * then move. A step or a page into the window beside the run keeps the rows\n * drawn, live, as the run grows to it. A jump that takes them off the run —\n * ⌘Home or ⌘End to a far end, whose demand rebases there — holds them: the\n * rows shown as the key came stand in, whole and where they are (`held`),\n * until the jump has settled, and the windows they were read from stay in the\n * cache, never pruned for the jump's run. Settled, the jump's own rows are\n * drawn, and the sheet puts the ring on its row in the commit that draws them.\n * A clear before then (`clearJump`) — a gesture on the rows that stand in —\n * puts the run back as it was, its windows still read, so nothing is read\n * again for it. The Plan's Home and End do the same.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { StringType, equalFor, equivalentFor } from \"@elaraai/east\";\nimport { Sheet } from \"@elaraai/e3-ui/internal\";\nimport { pagedSnapshot, pagedSourceEqual } from \"./paged-snapshot.js\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport {\n    createLedger, observeWindow, type WindowLedger, NO_RESIDENCY, DEFAULT_RESIDENCY,\n    isEmpty, residentWindows, unpinAll, type Residency, type ResidencyOptions,\n} from \"@elaraai/east-ui-components/internal\";\nimport {\n    WindowStore, advanceAtRest, anchorAround, bandsAround, elementInBand, failedSpan, firstWindow, pinTarget, retryWindows, runAround, sourceChange,\n    type WindowReader, type WindowTravel,\n} from \"../shared/windowed.js\";\nimport { BAND_MIN_PX, type SheetBand, type SheetWindowFailure } from \"./model.js\";\nimport type { SheetPagedSourceValue, SheetRowValue, SheetWindowValue } from \"./values.js\";\n\n/** Source elements per window. */\nexport const SHEET_PAGE_SIZE = 200;\n\n/**\n * Where the viewport is, in the caller's terms — and, where the caller can\n * say, the source elements it shows (`shows`): what the footer's loading line\n * and the grid's busy follow (#1398), never the windows read ahead of it.\n */\nexport type SheetViewport =\n    | { kind: \"row\"; offset: number; shows?: ElementSpan | undefined }\n    | { kind: \"band\"; at: \"head\" | \"tail\"; px?: number | undefined; shows?: ElementSpan | undefined };\n\n/** A stretch of source elements, first and last (inclusive). */\nexport interface ElementSpan {\n    readonly from: number;\n    readonly to: number;\n}\n\n/** What the driver returns. */\nexport interface SheetPaging {\n    /** The resident rows — the run nearest the viewport (#876), in stream order (a failed window's rows are not among them, #853). */\n    rows: SheetRowValue[];\n    /** Each resident row's source position — a row after a failed window keeps its own (#853). */\n    positions: readonly number[];\n    /** The source offset of `rows[0]`. */\n    rowsOffset: number;\n    /** The resident windows whose read failed, ascending (#853): each is a band where its rows would be. */\n    failures: readonly SheetWindowFailure[];\n    /** Every element above the run — not resident, still loading, or past a window still loading (#876). */\n    head: SheetBand | undefined;\n    /** Every element below the run — not resident, still loading, or past a window still loading (#876). */\n    tail: SheetBand | undefined;\n    /** The source's element count, once known. */\n    total: number | undefined;\n    /**\n     * The revision that count was read at — the last one that gave a count, while it stands in for this one's (#851);\n     * `undefined` with no count. What a Save's rows are counted over: a count read since holds them (#1536).\n     */\n    totalRevision: string | undefined;\n    /** Whether every source element is resident. */\n    exhausted: boolean;\n    /** Whether a requested window is still in flight — one the view shows, or one read ahead of it. */\n    loading: boolean;\n    /** The windows in flight, ascending: a run is busy while one of its own is (#1398). */\n    pending: readonly number[];\n    /**\n     * The resident windows whose rows are the previous revision's, standing in until their read at this one lands (#851),\n     * ascending: what a Save's rows are drawn over as it left them, never as they were before it.\n     */\n    standing: readonly number[];\n    /** The revision the source is read at — its `revision()`, as last read (#851); `undefined` while it names none. */\n    revision: string | undefined;\n    /**\n     * Whether the view waits for a window it shows (#1398): one in flight, or one not read and not asked yet — the view\n     * on its way over rows not read, or resting there before its read is asked (CL6). What the footer's loading line and\n     * the grid's busy follow — never a window read ahead of the view, which nothing on screen waits for.\n     */\n    viewLoading: boolean;\n    /** The source elements the view waits for (#1398, CL3): the stretch of windows in flight among those it shows, first and last element; `undefined` while none is. */\n    reading: { from: number; to: number } | undefined;\n    /** The last query is still displayed while its replacement loads. */\n    replacing: boolean;\n    /**\n     * The rows shown were read another way — by a page this source's is not equivalent to (#809) — and stand in while\n     * its windows are read again (#1599): retained, taking no gesture, until every window the run holds has landed.\n     */\n    reread: boolean;\n    /**\n     * The rows shown as a key went past them stand in while the window it goes to is read (#1398, CL10): retained,\n     * and the line says that window is read (`reading`).\n     */\n    held: boolean;\n    /** Why the SOURCE could not be read — its `total()` or `revision()` threw — while its rows show (#853): chrome, never their replacement. */\n    sourceError: string | undefined;\n    /** Why the source could not be read before anything landed: there is nothing else to show, so this is the whole sheet (#853). */\n    error: string | undefined;\n    /**\n     * Whether a window of this source has landed (#1398, CL5): the cold load is over. A scroll far from the rows,\n     * every window it shows still on its way, draws the runs where they meet the view — never the cover again.\n     */\n    landedOnce: boolean;\n    /** Bump for `VirtualRows`' `sizeVersion` — heights change at constant count. */\n    sizeVersion: number;\n    /** A pending jump (#854): its target window, and whether it has SETTLED — the run around it has stopped moving and the target's window is in the run (#876), so the sheet can show it. While one is pending it owns the viewport. */\n    jump: { window: number; settled: boolean } | undefined;\n    /** Tell the driver where the viewport is. Ignored while a jump is pending (#854). */\n    reportViewport: (at: SheetViewport, isScrolling: boolean) => void;\n    /**\n     * Jump to a source element (a seek result): pin its window and rebase. A key's jump (`hold`) that takes the rows\n     * shown off the run leaves them standing in until it has settled (`held`, #1398, CL10).\n     */\n    jumpToElement: (element: number, hold?: boolean) => void;\n    /**\n     * Drop any pending jump — the search was cleared, or the sheet has shown the jump's target and hands the viewport\n     * back (#854) — or, while a key's jump holds the rows shown, put the run back as it was (#1398).\n     */\n    clearJump: () => void;\n    /** Ask again (#853): the failed window `w`, or — with none — the source and every failed window. At once (#1398): a source that can refresh rearms what failed first, and the windows are read again a microtask on, so the gap a read alone waits after a failure never holds a Retry back. */\n    retry: (w?: number) => void;\n    /**\n     * The stored entry the window standing at a source position read with the row of an id (#1599) — the window whose\n     * rows are drawn there, landed or standing in from the revision before: what a gesture on a row the sheet shows\n     * begins from, and what its marks are read over. `undefined` where the source's windows carry none.\n     */\n    entryOf: (id: string, at: number) => Uint8Array | undefined;\n}\n\n/** No window in flight. */\nconst NONE_PENDING: readonly number[] = [];\n/** No window standing in. */\nconst NONE_STANDING: readonly number[] = [];\n\nconst IDLE: SheetPaging = {\n    rows: [], positions: [], rowsOffset: 0, failures: [], head: undefined, tail: undefined, total: undefined, totalRevision: undefined,\n    exhausted: true, loading: false, pending: NONE_PENDING, standing: NONE_STANDING, revision: undefined, viewLoading: false, reading: undefined, replacing: false, reread: false, held: false,\n    sourceError: undefined, error: undefined, landedOnce: false, sizeVersion: 0, jump: undefined,\n    reportViewport: () => {}, jumpToElement: () => {}, clearJump: () => {}, retry: () => {}, entryOf: () => undefined,\n};\n\n/**\n * The windows in flight that the view shows (#1398): those its stretch of\n * elements meets — or, where the caller has not said what it shows, the\n * window the viewport is centred in.\n *\n * @param pending - The windows in flight, ascending\n * @param shows - The source elements the view shows, if known\n * @param at - The viewport's window\n * @returns The windows in flight among those it shows, ascending\n */\nexport function pendingInView(pending: readonly number[], shows: ElementSpan | undefined, at: number): readonly number[] {\n    const lo = shows === undefined ? at : Math.floor(Math.max(0, shows.from) / SHEET_PAGE_SIZE);\n    const hi = shows === undefined ? at : Math.floor(Math.max(0, shows.to) / SHEET_PAGE_SIZE);\n    const out = pending.filter((w) => w >= lo && w <= hi);\n    return out.length === pending.length ? pending : out;\n}\n\n/** One line naming why a source read failed. */\nfunction readFailure(err: unknown): string {\n    return err instanceof Error ? err.message : String(err);\n}\n\n/**\n * Whether two stretches of elements meet the same windows: all a view's stretch decides — which of the windows in flight\n * it waits for (#1398, CL9).\n */\nfunction sameWindows(a: ElementSpan, b: ElementSpan): boolean {\n    return Math.floor(a.from / SHEET_PAGE_SIZE) === Math.floor(b.from / SHEET_PAGE_SIZE) && Math.floor(a.to / SHEET_PAGE_SIZE) === Math.floor(b.to / SHEET_PAGE_SIZE);\n}\n\n/**\n * The elements being read (#1398, CL3): of the windows in flight, the\n * stretch of adjacent ones nearest the viewport's window — what the footer's\n * loading line names.\n *\n * @param pending - The windows in flight, ascending\n * @param at - The viewport's window\n * @param total - The source's element count, once known: the last window ends there\n * @returns The stretch's first and last element; `undefined` with none in flight\n */\nexport function readingStretch(pending: readonly number[], at: number, total: number | undefined): { from: number; to: number } | undefined {\n    let best: { first: number; last: number; distance: number } | undefined;\n    for (let i = 0; i < pending.length;) {\n        const first = pending[i]!;\n        let last = first;\n        while (pending[i + 1] === last + 1) { last += 1; i += 1; }\n        i += 1;\n        const distance = at < first ? first - at : at > last ? at - last : 0;\n        if (best === undefined || distance < best.distance) best = { first, last, distance };\n    }\n    if (best === undefined) return undefined;\n    const end = (best.last + 1) * SHEET_PAGE_SIZE;\n    return { from: best.first * SHEET_PAGE_SIZE, to: (total === undefined ? end : Math.min(total, end)) - 1 };\n}\n\n/** What the driver has read from a source, and at which revision. */\ninterface SourceCache {\n    /** The source that filled it — a source that is not EQUIVALENT drops it (#809). */\n    source: SheetPagedSourceValue | undefined;\n    /**\n     * Its windows landed at its revision, the previous revision's standing in for each until its own lands (#851), and\n     * why each failed window's read threw (#853) — not asked again while recorded.\n     */\n    store: WindowStore<readonly SheetRowValue[]>;\n    /** The source's last known `total()`, and the revision it was read at. */\n    total: number | undefined;\n    totalRevision: string | undefined;\n    /** Whether any window of this source has landed — until one has, a failure is the whole sheet (#853). */\n    landedOnce: boolean;\n    /**\n     * Whether its windows are read again for a page that reads them another way (#1599): what stands in for them\n     * meanwhile is the last reading's rows, retained — until every window asked for has landed.\n     */\n    reread: boolean;\n}\n\n/** A cache holding nothing. */\nfunction emptyCache(source: SheetPagedSourceValue | undefined): SourceCache {\n    return { source, store: new WindowStore(), total: undefined, totalRevision: undefined, landedOnce: false, reread: false };\n}\n\n/**\n * A key's jump holding the rows shown (#1398, CL10): the window it goes to,\n * what the sheet was handed as the key came — what stands in — where the run\n * stood then and where the view was centred, which way it travelled, and the\n * windows those rows were read from, kept in the cache while they stand in.\n */\ninterface Held {\n    readonly window: number;\n    readonly shown: SheetPaging;\n    readonly residency: Residency;\n    readonly centredOn: number;\n    readonly travel: WindowTravel;\n    readonly keep: ReadonlySet<number>;\n}\n\n/**\n * How the driver reads a window of its source: the rows the source serves, as it serves them.\n *\n * @param source - The source\n * @returns Its window reader\n */\nfunction sheetWindows(source: SheetPagedSourceValue): WindowReader<SheetWindowValue, readonly SheetRowValue[]> {\n    return { page: (offset, limit) => source.page(offset, limit), decode: (window) => window.rows, entries: (window) => window.entries, label: \"[Sheet]\" };\n}\n\n/** Whether two paged sources serve the same rows: the same id AND equivalent\n *  functions — `page` is the bridge over the author's projection, so its\n *  captures are what the rows are projected WITH (#809). */\nconst stringEqual = equalFor(StringType);\nconst FIRST_WINDOW: Residency = { ...NO_RESIDENCY, lo: 0, hi: 0 };\n\nconst pagedSourceEquivalent = equivalentFor(Sheet.Types.Root.fields.rows.cases.paged);\n\n/**\n * Drive a paged sheet source.\n *\n * @param source - The decoded `paged` arm (undefined ⇒ inline sheet; idles)\n * @param heightOf - What one source row draws, in px — the body's own geometry (#855); a new function re-measures the landed windows\n * @param policy - Residency policy (defaults to the Plan's)\n * @param family - Stable record identity; query changes within it retain the last usable view\n * @returns The resident rows, the bands, and the callbacks the renderer feeds\n */\nexport function useSheetPaging(\n    source: SheetPagedSourceValue | undefined,\n    heightOf: (row: SheetRowValue) => number,\n    policy: ResidencyOptions = DEFAULT_RESIDENCY,\n    family?: string,\n): SheetPaging {\n    const [storedLedger, setLedger] = useState<WindowLedger>(() => createLedger(0, SHEET_PAGE_SIZE));\n    const [storedResidency, setResidency] = useState<Residency>(NO_RESIDENCY);\n    // The element the viewport is centred on — its window is the demand's,\n    // and the run is the stretch nearest it (#876).\n    const [storedViewportAt, setViewportAt] = useState(0);\n    // The element the viewport was last reported centred on, exactly: the state above holds it only as what it decides\n    // moves (#1398, CL9).\n    const centredOn = useRef(0);\n    const [isScrolling, setIsScrolling] = useState(false);\n    // The source elements the view shows, as the caller last said (#1398): what the line and busy follow.\n    const [storedShows, setShows] = useState<ElementSpan | undefined>(undefined);\n    // What was last asked of each of the three, rendered yet or not: a report asks again only for what moves (CL9).\n    const asked = useRef<{ viewportAt: number; isScrolling: boolean; shows: ElementSpan | undefined }>({ viewportAt: 0, isScrolling: false, shows: undefined });\n    // Which way the viewport travels through the windows (CL6): the demand reads ahead that way.\n    const travel = useRef<WindowTravel>({ at: 0, way: 1 });\n    const [sizeVersion, setSizeVersion] = useState(0);\n    // A Retry reads again (#853): the read depends on it.\n    const [retries, setRetries] = useState(0);\n    // Read-once cache, owned by the source that filled it: a `page` whose\n    // closures changed serves different rows under the same id and revision,\n    // so a source that is not EQUIVALENT to the filler drops the cache and\n    // the resident windows re-read (#809). Reset here rather than in an\n    // effect so a swapped source cannot serve the previous one's rows for a\n    // frame. Within one source the cache follows its revision (#851).\n    const cacheRef = useRef<SourceCache>(emptyCache(undefined));\n    // The source the geometry was built for.\n    const geometryRef = useRef(pagedSnapshot(undefined, undefined).source);\n    // Demand must reset BEFORE reading the replacement, not in a later effect:\n    // an old deep scroll position has no meaning in the new narrowed source.\n    const sourceChanged = !pagedSourceEqual(geometryRef.current, pagedSnapshot(source?.id, undefined).source);\n    const ledger = sourceChanged ? createLedger(0, SHEET_PAGE_SIZE) : storedLedger;\n    const residency = sourceChanged ? FIRST_WINDOW : storedResidency;\n    const viewportAt = sourceChanged ? 0 : storedViewportAt;\n    const viewportWindow = Math.floor(viewportAt / SHEET_PAGE_SIZE);\n    const shows = sourceChanged ? undefined : storedShows;\n    const displayed = useRef<{ family: string; source: string; result: SheetPaging } | undefined>(undefined);\n    const replacingRef = useRef(false);\n    // A key's jump holding the rows shown (#1398, CL10), and what the sheet was handed last: what such a jump holds.\n    const heldRef = useRef<Held | undefined>(undefined);\n    const shownRef = useRef<SheetPaging | undefined>(undefined);\n\n    const read = useCallback(() => {\n        void retries;\n        if (source === undefined) return undefined;\n        const filled = cacheRef.current;\n        const change = sourceChange(filled.source, source, pagedSourceEquivalent);\n        if (change === \"reread\") {\n            // The same source, read another way (#809, #1599): every window is read again, and the rows it drew stand\n            // in — retained — for each until its own lands. Its count and its geometry are the source's still.\n            filled.source = source;\n            filled.store.restart();\n            filled.reread = true;\n        } else if (change === \"other\") cacheRef.current = emptyCache(source);\n        const held = cacheRef.current;\n        // The snapshot first: every window below is read at it. A new one\n        // is read afresh, and the rows each window had stand in until its\n        // own land (#851). A source that cannot say which snapshot it serves\n        // has failed as a whole (#853) — its windows then say so each, where\n        // their rows would be.\n        let revision = held.store.revision;\n        let sourceError: string | undefined;\n        try {\n            const r = source.revision?.();\n            revision = r?.type === \"some\" ? r.value : undefined;\n        } catch (err) {\n            console.error(\"[Sheet] paged source revision failed:\", err);\n            sourceError = readFailure(err);\n        }\n        // The windows a key's jump holds the rows of stand in for them still, for as long as it holds them (#1398, CL10).\n        const keep = heldRef.current?.keep;\n        held.store.at(revision, keep);\n        let total: number | undefined;\n        try {\n            const t = source.total();\n            if (t.type === \"some\") total = Number(t.value);\n        } catch (err) {\n            console.error(\"[Sheet] paged source total failed:\", err);\n            sourceError ??= readFailure(err);\n            // The count this revision last gave still holds — same revision,\n            // same rows — so the bands, the blank tail and the transport's\n            // count stand while the source says why beside them (#853).\n            if (held.totalRevision === revision) total = held.total;\n        }\n        // Same id and revision ⇒ same rows is the source's contract: a total\n        // that moves under ONE revision has broken it, and the cached rows\n        // cannot be trusted. One that moves with the revision is the content\n        // changing.\n        if (total !== undefined && held.total !== undefined && total !== held.total && held.totalRevision === revision) {\n            console.warn(`[Sheet] paged source \"${source.id}\" changed total() without a revision change; dropping cached windows.`);\n            held.store.windows.clear();\n            held.store.stale = undefined;\n        }\n        if (total !== undefined) {\n            held.total = total;\n            held.totalRevision = revision;\n        }\n        // Each resident window from the store, or read — one still in flight standing in for the rows it had at the\n        // previous revision; a failed one is not asked again by the reader, only by a Retry (#853).\n        const reads = held.store.read(sheetWindows(source), residentWindows(residency), SHEET_PAGE_SIZE, keep);\n        if (reads.resident.some(({ w }) => held.store.windows.has(w))) held.landedOnce = true;\n        // Read again for a page that reads them another way: once no window stands in, every row is this reading's.\n        if (held.reread && !reads.stale) held.reread = false;\n        return {\n            total,\n            // The revision the last count was read at: this one's, or the one before while this one gives none.\n            totalRevision: held.totalRevision,\n            landed: reads.resident.map(({ w, read: rows }) => ({ w, rows })),\n            failed: reads.failed,\n            // The windows in flight, ascending: what the footer's loading line names (#1398).\n            pending: reads.inFlight,\n            loading: reads.inFlight.length > 0,\n            sourceError,\n            standingIn: reads.stale,\n            // Which windows stand in, and the revision the rest are read at: what a Save's rows are drawn over.\n            standing: reads.standing,\n            revision,\n            landedOnce: held.landedOnce,\n            reread: held.reread,\n        };\n    }, [source, residency, retries]);\n\n    const { result } = useTrackedEvaluation(read);\n    const value = result.ok ? result.value : undefined;\n    const readError = result.ok ? undefined : readFailure(result.error);\n\n    // A Retry asks again now (#1398, `retryWindows`): the source rearms what failed, then the failure records go and\n    // the windows are read again.\n    // The entry a row drawn was read with: its own window's, landed or standing in (#1599).\n    const entryOf = useCallback((id: string, at: number) => cacheRef.current.store.entryOf(id, at, SHEET_PAGE_SIZE), []);\n    const retry = useCallback((w?: number) => {\n        retryWindows(source, () => {\n            cacheRef.current.store.forget(w);\n            setRetries((n) => n + 1);\n        });\n    }, [source]);\n\n    // The source's own total — the ledger is built from it, never from the\n    // stand-in below.\n    const sourceTotal = value?.total;\n    const landed = value?.landed;\n    useEffect(() => {\n        const id = pagedSnapshot(source?.id, undefined).source;\n        const sourceChanged = !pagedSourceEqual(geometryRef.current, id);\n        geometryRef.current = id;\n        // The geometry belongs to the source: a new revision keeps the\n        // measured heights, so nothing on screen moves (#851). A new source\n        // rebuilds it, and so does a new total — the content changed size.\n        let next = sourceChanged || (sourceTotal !== undefined && sourceTotal !== ledger.total)\n            ? createLedger(sourceTotal ?? (sourceChanged ? 0 : ledger.total), SHEET_PAGE_SIZE) : ledger;\n        // A window is as tall as the body draws its rows (#855).\n        for (const { w, rows } of landed ?? []) {\n            let px = 0;\n            for (const r of rows) px += heightOf(r);\n            next = observeWindow(next, w, { px, rows: rows.length });\n        }\n        if (sourceChanged) {\n            setResidency(FIRST_WINDOW);\n            centredOn.current = 0;\n            asked.current = { viewportAt: 0, isScrolling: false, shows: undefined };\n            setViewportAt(0);\n            setShows(undefined);\n            setIsScrolling(false);\n            travel.current = { at: 0, way: 1 };\n        }\n        if (next === ledger) return;\n        setLedger(next);\n        setSizeVersion(v => v + 1);\n    }, [source?.id, sourceTotal, landed, ledger, heightOf]);\n    // Between two revisions the source may know no total until the new\n    // one's first window lands. While the old rows stand in, the geometry\n    // stands too, so the bands, the blank tail and the scroll extent do not\n    // collapse under the reader (#851).\n    const total = sourceTotal ?? (value?.standingIn === true && ledger.total > 0 ? ledger.total : undefined);\n\n    // Demand follows the viewport once it shows intent (CL6): at rest, or while the frame reports the scroll slowed\n    // — the frame's `isScrolling` says which — reading ahead the way it travels.\n    useEffect(() => {\n        if (source === undefined) return;\n        if (ledger.windows === 0) {\n            if (isEmpty(residency)) setResidency(firstWindow);\n            return;\n        }\n        if (isScrolling) return;\n        const step = advanceAtRest(residency, ledger, viewportWindow, policy, travel.current);\n        travel.current = step.travel;\n        const next = step.residency;\n        if (next === residency) return;\n        setResidency(next);\n        // Whatever left the run leaves the cache with it, a stand-in too; a\n        // failure record leaves as well, so a window demanded again later is\n        // asked afresh (#853). What a key's jump holds the rows of stays while\n        // it holds them (#1398).\n        const keep = new Set(residentWindows(next));\n        for (const w of heldRef.current?.keep ?? []) keep.add(w);\n        cacheRef.current.store.prune(keep);\n        setSizeVersion((v) => v + 1);\n    }, [source, ledger, residency, viewportWindow, isScrolling, policy]);\n\n    // The windows that are in — landed, or failed (#853) — as the read last gave them.\n    const isIn = useMemo(() => {\n        const ins = new Set(value === undefined ? [] : [...value.landed.map((l) => l.w), ...value.failed.map((f) => f.w)]);\n        return (w: number) => ins.has(w);\n    }, [value]);\n    // The run (#876, `runAround`): the stretch of windows that are in around the one nearest the element the viewport was\n    // last reported centred on — the state holds it only as the anchor it gives moves (#1398, CL9, `reportViewport`),\n    // and a read landing takes the element as it is now.\n    const runWindows = useMemo(() => (value === undefined ? undefined : runAround(residency, isIn, sourceChanged ? 0 : centredOn.current, SHEET_PAGE_SIZE)),\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- `viewportAt` moves whenever the anchor the element gives does; the element itself is read as it is\n        [value, isIn, residency, viewportAt, sourceChanged]);\n\n    // The run's rows: its landed windows, and a failed window's band where its\n    // rows would be — its elements are known, so the run crosses it and the\n    // rows after it keep their positions (#853).\n    const run = useMemo(() => {\n        const rows: SheetRowValue[] = [];\n        const positions: number[] = [];\n        const failures: SheetWindowFailure[] = [];\n        if (value === undefined || runWindows === undefined) return { rows, positions, failures, from: residency.lo, to: residency.lo - 1 };\n        const byWindow = new Map(value.landed.map((l) => [l.w, l.rows]));\n        const failedBy = new Map(value.failed.map((f) => [f.w, f.error]));\n        for (let w = runWindows.from; w <= runWindows.to; w++) {\n            const landedRows = byWindow.get(w);\n            if (landedRows !== undefined) {\n                landedRows.forEach((row, k) => { rows.push(row); positions.push(w * SHEET_PAGE_SIZE + k); });\n                continue;\n            }\n            const error = failedBy.get(w);\n            // Its ledger slot, so the rows that replace it take the same space; floored so the reason and the Retry stay legible.\n            if (error !== undefined) failures.push({ w, ...failedSpan(ledger, w, total, SHEET_PAGE_SIZE, BAND_MIN_PX), error });\n        }\n        return { rows, positions, failures, from: runWindows.from, to: runWindows.to };\n    }, [value, runWindows, residency, ledger, total]);\n\n    // The bands follow the run, not the residency: the windows past a\n    // loading one are theirs until it lands (#876).\n    const bands = useMemo(() => {\n        const spans = bandsAround(ledger, residency, { from: run.from, to: run.to }, SHEET_PAGE_SIZE, total ?? ledger.total);\n        const head: SheetBand | undefined = spans.head === undefined ? undefined : { at: \"head\", ...spans.head };\n        const tail: SheetBand | undefined = spans.tail === undefined ? undefined : { at: \"tail\", ...spans.tail };\n        return { head, tail };\n    }, [residency, ledger, total, run.from, run.to]);\n\n    // Read by the viewport report, so a jump's pin changes nothing it closes over. A jump asked for owns the viewport\n    // from that moment, not from the render that pins its window: a report taken before then — the range the frame\n    // reports in the same commit as the key, from where the sheet still is — would move the demand back and leave the\n    // jump pinned to a window it never reads. A clear hands the viewport back at once, as it is asked.\n    const jumpingRef = useRef(false);\n    jumpingRef.current = residency.pins.size > 0;\n    // What the anchor is decided by, as this render has it: the windows in, and the residency — and what a key's jump\n    // asks of it, whether the jump takes the rows drawn off the run: the ledger, the run drawn and the policy (#1398).\n    const decided = useRef({ isIn, residency, ledger, drawn: { from: run.from, to: run.to }, policy });\n    decided.current = { isIn, residency, ledger, drawn: { from: run.from, to: run.to }, policy };\n    // A report draws the sheet again only for what it moves (#1398, CL9): the window the viewport is centred in, the run's\n    // anchor, the windows the view shows, whether the scroll is at rest — never each row the view passes. What holds is\n    // never asked again, so nothing is asked of React for it.\n    const reportViewport = useCallback((at: SheetViewport, scrolling: boolean) => {\n        const was = asked.current;\n        if (was.isScrolling !== scrolling) {\n            was.isScrolling = scrolling;\n            setIsScrolling(scrolling);\n        }\n        // What the view shows is the view's, a jump pending or not: the line follows the windows it meets.\n        const span = at.shows;\n        if (span === undefined ? was.shows !== undefined : was.shows === undefined || !sameWindows(was.shows, span)) {\n            const next = span === undefined ? undefined : { from: span.from, to: span.to };\n            was.shows = next;\n            setShows(next);\n        }\n        // A pending jump owns the viewport (#854): until the sheet has shown its\n        // target, a report is taken from where the sheet still IS, and moving\n        // the demand there would move the run back and undo the jump.\n        if (jumpingRef.current || replacingRef.current) return;\n        // A band's own geometry (`elementInBand`): the head starts at the top, the tail right after the run — not after\n        // the residency, whose last windows may still be loading inside the tail (#876).\n        const next = at.kind === \"band\"\n            ? elementInBand(ledger, { from: run.from, to: run.to }, at.at, at.px, SHEET_PAGE_SIZE)\n            : at.offset >= 0 ? at.offset : centredOn.current;\n        centredOn.current = next;\n        // The element held moves only with its window or the anchor it gives.\n        const { isIn: ins, residency: resident } = decided.current;\n        const moves = Math.floor(was.viewportAt / SHEET_PAGE_SIZE) !== Math.floor(next / SHEET_PAGE_SIZE)\n            || (!isEmpty(resident) && anchorAround(resident, ins, was.viewportAt, SHEET_PAGE_SIZE) !== anchorAround(resident, ins, next, SHEET_PAGE_SIZE));\n        if (!moves) return;\n        was.viewportAt = next;\n        setViewportAt(next);\n    }, [run.from, run.to, ledger]);\n\n    const jumpToElement = useCallback((element: number, hold = false) => {\n        const at = Math.max(0, element);\n        const w = Math.floor(at / SHEET_PAGE_SIZE);\n        // A key's jump that takes the rows drawn off the run — its demand rebases there — holds the rows shown until it\n        // has settled (#1398, CL10): the rows shown as the first such key came, however often the keys go again\n        // meanwhile. A step or a page into the window beside them keeps them drawn, and holds nothing. Any other jump\n        // takes its place.\n        const held = heldRef.current;\n        const shown = shownRef.current;\n        const { residency: resident, ledger: measured, drawn, policy: rule } = decided.current;\n        const leaves = (): boolean => {\n            if (drawn.to < drawn.from) return false;\n            const next = advanceAtRest(pinTarget(resident, w), measured, w, rule, travel.current).residency;\n            return next.hi < drawn.from || next.lo > drawn.to;\n        };\n        if (hold && held !== undefined) heldRef.current = { ...held, window: w };\n        else if (hold && shown !== undefined && !shown.replacing && shown.rows.length > 0 && leaves()) {\n            heldRef.current = { window: w, shown, residency: resident, centredOn: centredOn.current, travel: travel.current, keep: new Set(residentWindows(resident)) };\n        } else heldRef.current = undefined;\n        jumpingRef.current = true;\n        centredOn.current = at;\n        asked.current.viewportAt = at;\n        asked.current.isScrolling = false;\n        setViewportAt(at);\n        setIsScrolling(false);\n        setResidency((r) => pinTarget(r, w));\n    }, []);\n\n    const clearJump = useCallback(() => {\n        jumpingRef.current = false;\n        const held = heldRef.current;\n        if (held === undefined) {\n            setResidency((r) => unpinAll(r));\n            return;\n        }\n        // A gesture on the rows a key's jump holds: the run is put back as it stood, the view centred where it was,\n        // and the windows it was read from are still in the cache, so nothing is read again for it (#1398).\n        heldRef.current = undefined;\n        centredOn.current = held.centredOn;\n        asked.current.viewportAt = held.centredOn;\n        asked.current.isScrolling = false;\n        travel.current = held.travel;\n        setViewportAt(held.centredOn);\n        setIsScrolling(false);\n        setResidency(unpinAll(held.residency));\n    }, []);\n\n    // A pending jump, and whether it has SETTLED (#854): the run around it has\n    // stopped moving (the demand is met), and the target's window — landed,\n    // or failed (#853) — is in the run, so the sheet can show it. The windows\n    // above it may still be loading: landing, each takes its band's slot, and\n    // nothing on screen moves (#876). The pin stays until the sheet has shown\n    // the target and calls `clearJump`: dropped on landing, the reports of\n    // the render that first shows the rows (still from the old place) would\n    // undo it.\n    const pinned = [...residency.pins];\n    const target = pinned[0];\n    let settled = false;\n    if (target !== undefined && value !== undefined && !isEmpty(residency) && ledger.windows > 0) {\n        const met = advanceAtRest(residency, ledger, viewportWindow, policy, travel.current).residency === residency;\n        settled = met && run.from <= target && target <= run.to;\n    }\n    const jump = target === undefined ? undefined : { window: target, settled };\n\n    // What the view waits for (#1398): the windows in flight among those it shows — and a jump's target, which it is\n    // about to show — never one read ahead of it. One array while they hold.\n    const allPending = value?.pending ?? NONE_PENDING;\n    const viewPending = useMemo(() => {\n        const shown = pendingInView(allPending, shows, viewportWindow);\n        const extra = allPending.filter((w) => residency.pins.has(w) && !shown.includes(w));\n        return extra.length === 0 ? shown : [...shown, ...extra].sort((a, b) => a - b);\n    }, [allPending, shows, viewportWindow, residency.pins]);\n    // And what the view shows that is neither in nor asked yet (#1398, CL3): a window of the elements it shows — or, unsaid,\n    // the one it is centred in — not landed, failed or in flight. The view on its way over rows not read, or resting there\n    // before it has shown the intent their read waits for (CL6), waits for them from the moment it shows them: the line's\n    // reveal clock runs from then, never from their read.\n    const viewAwaits = useMemo(() => {\n        if (value === undefined || value.sourceError !== undefined || ledger.windows === 0) return false;\n        const lo = shows === undefined ? viewportWindow : Math.floor(Math.max(0, shows.from) / SHEET_PAGE_SIZE);\n        const hi = Math.min(ledger.windows - 1, shows === undefined ? viewportWindow : Math.floor(Math.max(0, shows.to) / SHEET_PAGE_SIZE));\n        for (let w = lo; w <= hi; w++) if (!isIn(w) && !allPending.includes(w)) return true;\n        return false;\n    }, [value, ledger.windows, shows, viewportWindow, isIn, allPending]);\n    // What the footer's loading line names (#1398): one object while the stretch holds, so the line it feeds — and\n    // the footer that measures itself as it renders — renders again only when the stretch moves.\n    const stretch = readingStretch(viewPending, viewportWindow, total);\n    const readingFrom = stretch?.from;\n    const readingTo = stretch?.to;\n    const reading = useMemo(\n        () => (readingFrom === undefined || readingTo === undefined ? undefined : { from: readingFrom, to: readingTo }),\n        [readingFrom, readingTo],\n    );\n\n    if (source === undefined) {\n        displayed.current = undefined;\n        replacingRef.current = false;\n        heldRef.current = undefined;\n        shownRef.current = undefined;\n        return IDLE;\n    }\n\n    // Until anything has landed there is nothing to show beside a failure:\n    // it is the whole sheet (#853).\n    const nothingShown = value === undefined || !value.landedOnce;\n    const failure = value?.failed[0]?.error ?? value?.sourceError;\n    const exhausted = total !== undefined && run.from === 0 && run.rows.length >= total;\n    const current: SheetPaging = {\n        rows: run.rows,\n        positions: run.positions,\n        rowsOffset: run.from * SHEET_PAGE_SIZE,\n        failures: run.failures,\n        head: bands.head,\n        tail: bands.tail,\n        total,\n        totalRevision: total === undefined ? undefined : value?.totalRevision,\n        exhausted,\n        loading: value?.loading ?? false,\n        pending: allPending,\n        standing: value === undefined || value.standing.length === 0 ? NONE_STANDING : value.standing,\n        revision: value?.revision,\n        viewLoading: viewPending.length > 0 || viewAwaits,\n        reading,\n        replacing: false,\n        reread: value?.reread === true,\n        held: false,\n        sourceError: nothingShown ? undefined : value?.sourceError,\n        error: readError ?? (nothingShown ? failure : undefined),\n        landedOnce: !nothingShown,\n        sizeVersion,\n        jump,\n        reportViewport,\n        jumpToElement,\n        clearJump,\n        retry,\n        entryOf,\n    };\n    // A key's jump holds the rows shown until it has settled — the window it goes to in the run, the demand met — or\n    // until the source cannot be read, or another source takes the sheet (#1398, CL10). Settled, the jump's rows are\n    // drawn, and the windows the held rows were read from leave the cache.\n    const hold = heldRef.current;\n    if (hold !== undefined && (sourceChanged || jump === undefined || jump.window !== hold.window || jump.settled || current.sourceError !== undefined)) {\n        heldRef.current = undefined;\n        if (!sourceChanged) cacheRef.current.store.prune(new Set(residentWindows(residency)));\n    } else if (hold !== undefined) {\n        const end = (hold.window + 1) * SHEET_PAGE_SIZE;\n        const held: SheetPaging = {\n            ...hold.shown,\n            pending: allPending, loading: true, viewLoading: true, replacing: false, held: true,\n            reading: { from: hold.window * SHEET_PAGE_SIZE, to: (total === undefined ? end : Math.min(total, end)) - 1 },\n            jump: { window: hold.window, settled: false },\n            reportViewport, jumpToElement, clearJump, retry,\n        };\n        shownRef.current = held;\n        return held;\n    }\n    const previous = displayed.current;\n    const sameFamily = family !== undefined && previous !== undefined && stringEqual(previous.family, family);\n    const replacement = sameFamily && !stringEqual(previous.source, source.id);\n    const ready = value?.total !== undefined && value.landed.some(window => window.w === 0);\n    replacingRef.current = replacement && !ready;\n    if (replacingRef.current && previous !== undefined) {\n        const reason = current.error ?? current.sourceError ?? current.failures[0]?.error;\n        const standing: SheetPaging = { ...current, rows: previous.result.rows, positions: previous.result.positions,\n            rowsOffset: previous.result.rowsOffset, failures: previous.result.failures,\n            head: previous.result.head, tail: previous.result.tail, total: previous.result.total, totalRevision: previous.result.totalRevision,\n            exhausted: previous.result.exhausted, sizeVersion: previous.result.sizeVersion,\n            jump: undefined, replacing: true, loading: reason === undefined, viewLoading: reason === undefined, reading: undefined,\n            error: undefined, sourceError: reason };\n        shownRef.current = standing;\n        return standing;\n    }\n    if (family !== undefined && (current.rows.length > 0 || current.exhausted)) {\n        displayed.current = { family, source: source.id, result: current };\n    } else if (!sameFamily) displayed.current = undefined;\n    shownRef.current = current;\n    return current;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n *\n * What a sheet persists under its `storageKey` (#857) — what the viewer\n * arranged: the folds, and where a bounded frame's scroll rests. Never the\n * ring, nor the narrowing (the slice owns it). The Plan's rule (#813).\n *\n * @packageDocumentation\n */\n\n/** Where a bounded sheet's scroll rests (#857) — an item, never pixels. */\nexport interface SheetAnchor {\n    /** The first body item showing under the header — its key among the virtual rows (`row:…`, `group:…`, `sub:…`). */\n    key: string;\n    /** How many px of it are scrolled past. */\n    offset: number;\n    /** Its body index — the clamped fallback when the key is gone. */\n    index: number;\n    /** On a paged sheet, the source element the item belongs to (a row; a line's or a sub row's group) — over an unloaded band, the element the band draws there — where a remount that has not loaded it yet looks for it. */\n    element: number | null;\n}\n\n/** What a sheet persists under its `storageKey` (#857). */\nexport interface SheetPersisted {\n    /** The tab the folds were left on (`null` = the whole sheet): they come back only when the sheet opens there. */\n    view: string | null;\n    /** The fold overrides there — a group's or a line's id → folded (a line's `false`: its sub rows open). */\n    folds: Array<[string, boolean]>;\n    /** Where a bounded frame's scroll rests, once the viewer has scrolled it. */\n    anchor: SheetAnchor | null;\n}\n\n/** Nothing persisted yet. */\nexport const NOT_PERSISTED: SheetPersisted = { view: null, folds: [], anchor: null };\n\n/**\n * The persisted state, read defensively: storage outlives versions and anyone\n * can write it, so each part is taken only in the shape this version writes\n * and dropped otherwise — never trusted into the reducer.\n *\n * @param stored - Whatever the storage holds under the sheet's key\n * @returns The parts this version can use\n */\nexport function persistedOf(stored: unknown): SheetPersisted {\n    if (typeof stored !== \"object\" || stored === null) return NOT_PERSISTED;\n    const { view, folds, anchor } = stored as Partial<Record<keyof SheetPersisted, unknown>>;\n    const okView = view === null || typeof view === \"string\";\n    const okFolds = Array.isArray(folds) && folds.every((e) =>\n        Array.isArray(e) && e.length === 2 && typeof e[0] === \"string\" && typeof e[1] === \"boolean\");\n    const a = anchor as Partial<SheetAnchor> | null | undefined;\n    const okAnchor = typeof a === \"object\" && a !== null && typeof a.key === \"string\"\n        && Number.isFinite(a.offset) && Number.isInteger(a.index) && (a.index ?? -1) >= 0\n        && (a.element === null || Number.isInteger(a.element));\n    return {\n        // Folds without the tab they belong to are nobody's.\n        view: okView && okFolds ? view as string | null : null,\n        folds: okView && okFolds ? folds as Array<[string, boolean]> : [],\n        anchor: okAnchor ? a as SheetAnchor : null,\n    };\n}\n\n/**\n * Whether the persisted folds are these — the same tab, the same overrides in\n * the same order. No folds are no folds on any tab, so a sheet no one has\n * folded never records the tab it opens on.\n *\n * @param p - What storage holds\n * @param view - The tab the folds are on\n * @param folds - The fold overrides\n * @returns Whether writing them would change nothing\n */\nexport function sameFolds(p: SheetPersisted, view: string | null, folds: ReadonlyMap<string, boolean>): boolean {\n    if (p.folds.length === 0 && folds.size === 0) return true;\n    if (p.view !== view || p.folds.length !== folds.size) return false;\n    let i = 0;\n    for (const [id, folded] of folds) {\n        const e = p.folds[i++]!;\n        if (e[0] !== id || e[1] !== folded) return false;\n    }\n    return true;\n}\n\n/** Two anchors are the same — `x` may be absent. */\nexport function sameAnchor(x: SheetAnchor | null, y: SheetAnchor): boolean {\n    return x !== null && x.key === y.key && x.offset === y.offset && x.index === y.index && x.element === y.element;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Optimise in the Sheet (#1409, #1418; `Optimise Spec.md` §5.1, §9.5, R25):\n * the current tab's rows as the run's request — every entry as the session\n * holds it, base plus every unapplied draft, by its key — and the result\n * landed on the rows as one edit: the diff by key recorded as one step of the\n * session (`session.record`, origin `optimise`), each row answered lifted\n * into its draft and projected to the wire row the source would show for it\n * (`editing.project`), and the operations the landing draws per cell — a\n * blank given a value an add, a value changed a change, a value cleared a\n * remove — kept until Apply.\n *\n * @packageDocumentation\n */\n\nimport { SortedMap, StringType, compareFor, decodeBeast2For, encodeBeast2For, equalFor, fromEastTypeValue, none, some, variant, type EastType } from \"@elaraai/east\";\nimport { Sheet, SheetOptimiseRequestTypeFor, SheetOptimiseResultTypeFor } from \"@elaraai/e3-ui/internal\";\nimport { diffOptimiseRows, optimiseIdOf, optimiseKeyOf } from \"../shared/func/optimise-diff.js\";\nimport type { OptimiseCounts } from \"../shared/func/use-optimise.js\";\nimport { liftDraft, normalizeDraft } from \"./draft-values.js\";\nimport { NULL_CELL, cellIsBlank, countNoun, lineId } from \"./model.js\";\nimport type { EntryUpdate, EntryVersion, Origin, Placement } from \"./transactions.js\";\nimport type { SheetCellValue, SheetNounValue, SheetRootValue, SheetRowValue } from \"./values.js\";\nimport type { SheetWords } from \"./words.js\";\n\n/** The rows by key, as the request and the result carry them. */\ntype Rows = SortedMap<unknown, unknown>;\n\n/** The run's request: the run's number, and the current tab's rows by key, as the session holds them. */\nexport interface SheetOptimiseRequest {\n    readonly run: bigint;\n    readonly rows: Rows;\n}\n\n/** The run's answer: the rows by key, complete. */\nexport interface SheetOptimiseResult {\n    readonly rows: Rows;\n}\n\n/** What a run did to one cell (R25): a blank given a value, a value changed, or a value cleared. */\nexport type SheetCellOp = \"add\" | \"chg\" | \"del\";\n\n/** What a run left on one row — an entry's own cells, a band's, or a line's — until Apply, and the run that did it. */\nexport interface SheetRowOps {\n    /** The row's own operation: a row the run added, or one it changed. */\n    readonly op: \"add\" | \"chg\";\n    /** Each cell the run changed, by column key. */\n    readonly cells: ReadonlyMap<string, SheetCellOp>;\n    /** Each changed cell as it stood before the run, by column key: the provenance's `Was …`. */\n    readonly previous: ReadonlyMap<string, SheetCellValue>;\n    /** The run's number, formatted: the provenance's `run #n`. */\n    readonly run: string;\n}\n\n/** A row's marks as its row draws them. */\nexport type SheetRowMarks = SheetRowOps;\n\n/**\n * What the runs left on the sheet's rows (R17): each row's operations by its\n * id — an entry's or a band's under the entry's id, a line's under\n * `lineId(group, key)` — a later run's over an earlier's on the same row.\n */\nexport interface SheetOptimised {\n    readonly rows: ReadonlyMap<string, SheetRowOps>;\n}\n\n/** The sheet's optimiser's types: the request and the result over the sheet's rows and its source's key. */\nexport interface SheetOptimiseTypes {\n    readonly request: EastType;\n    readonly result: EastType;\n    /** The sheet's row type: its entries'. */\n    readonly rowType: EastType;\n    /** The source's key type: a record's own, else `String` — an Array source's rows keyed by their id field. */\n    readonly keyType: EastType;\n}\n\n/** The kind the diff names the sheet's rows by: one record, every row. */\nconst ROWS = \"rows\";\n\nconst sameCell = equalFor(Sheet.Types.Cell);\nconst decodeWire = decodeBeast2For(Sheet.Types.Row);\n\n/**\n * The request and result types over the sheet's rows: what the bound\n * optimiser is called with, as the tag held it to.\n *\n * @param editing - The sheet's editing declaration: its entry and key types\n * @returns The types\n */\nexport function sheetOptimiseTypes(editing: Pick<SheetRootValue[\"editing\"], \"entryType\" | \"keyType\">): SheetOptimiseTypes {\n    const rowType = fromEastTypeValue(editing.entryType) as EastType;\n    const keyType = editing.keyType.type === \"some\" ? fromEastTypeValue(editing.keyType.value) as EastType : StringType;\n    return { request: SheetOptimiseRequestTypeFor(rowType, keyType), result: SheetOptimiseResultTypeFor(rowType, keyType), rowType, keyType };\n}\n\n/**\n * The run's scope, as the eye, the footer line and the banner name it (§10):\n * the tab's rows counted in the sheet's own words — `8 work orders`, a\n * grouped sheet's `3 plans`.\n *\n * @param n - How many rows the tab holds\n * @param noun - A grouped sheet's word for a group; `undefined` on a flat sheet\n * @param rowsNoun - What the rail counts a flat sheet's rows in — `work orders`, else `rows`\n * @param words - The sheet's words\n * @returns The scope's label\n */\nexport function sheetOptimisePeriod(n: number, noun: SheetNounValue | undefined, rowsNoun: string, words: SheetWords): string {\n    return noun !== undefined ? countNoun(n, noun, words) : words.m.countNoun({ n, count: words.number(n), noun: rowsNoun, nouns: rowsNoun });\n}\n\n/**\n * The run's request (R1, R25, O3, O5): the run's number, and the current tab's\n * rows by key as the session holds them — base plus every unapplied draft. A\n * draft with a field still missing has no row to send: it is left out, and\n * so untouched by the answer.\n *\n * @param entries - The tab's rows: its entries, the local layer applied\n * @param versionOf - An entry's version as it stands: the session's, else the source's; `undefined` while its page is not in\n * @param draftType - The entries' draft type\n * @param keyType - The source's key type\n * @param run - The run's number\n * @returns The request\n */\nexport function sheetOptimiseRequest(entries: readonly SheetRowValue[], versionOf: (id: string) => EntryVersion | undefined, draftType: EastType, keyType: EastType, run: number): SheetOptimiseRequest {\n    const keyOf = optimiseKeyOf(keyType);\n    const rows: Rows = new SortedMap([], compareFor(keyType) as (a: unknown, b: unknown) => number);\n    for (const entry of entries) {\n        const version = versionOf(entry.id);\n        if (version?.draft === undefined) continue;\n        const key = keyOf(entry.id);\n        if (key === undefined) continue;\n        const { domain } = normalizeDraft(draftType, version.draft, entry.id);\n        if (domain === undefined) continue;\n        rows.set(key, domain);\n    }\n    return { run: BigInt(run), rows };\n}\n\n/** What a landing is made over. */\nexport interface SheetLanding {\n    /** The sheet's editing declaration: its row projection. */\n    readonly editing: Pick<SheetRootValue[\"editing\"], \"project\">;\n    readonly types: SheetOptimiseTypes;\n    /** The entries' draft type. */\n    readonly draftType: EastType;\n    /** Whether the source is keyed: a new row takes its key's place; else it lands at the end. */\n    readonly keyed: boolean;\n    /** The request the result answers. */\n    readonly request: SheetOptimiseRequest;\n    readonly result: SheetOptimiseResult;\n    /** The step's label — `Elara run #7`. */\n    readonly label: string;\n    /** The run's number, formatted, for the provenance. */\n    readonly runText: string;\n    /** An entry's version as it stands: the session's, else the source's — absent for a row the sheet does not hold. */\n    readonly versionOf: (id: string) => EntryVersion;\n    /** Records the versions as one transaction of the session; answers whether it did. */\n    readonly record: (updates: readonly EntryUpdate[], origin: Origin, label: string) => boolean;\n    /** What earlier runs left on the rows, still the session's drafts. */\n    readonly before?: SheetOptimised | undefined;\n}\n\n/**\n * The cells a row's wire changed between two versions, and each as it stood.\n *\n * @param before - The row's cells before the run; `undefined` for a row it added\n * @param after - Its cells after\n * @returns Each changed cell's operation and its former value\n */\nfunction cellOps(before: ReadonlyMap<string, SheetCellValue> | undefined, after: ReadonlyMap<string, SheetCellValue>): Pick<SheetRowOps, \"cells\" | \"previous\"> {\n    const cells = new Map<string, SheetCellOp>();\n    const previous = new Map<string, SheetCellValue>();\n    for (const key of new Set([...(before?.keys() ?? []), ...after.keys()])) {\n        const was = before?.get(key) ?? NULL_CELL;\n        const now = after.get(key) ?? NULL_CELL;\n        if (sameCell(was, now)) continue;\n        cells.set(key, cellIsBlank(was) ? \"add\" : cellIsBlank(now) ? \"del\" : \"chg\");\n        previous.set(key, was);\n    }\n    return { cells, previous };\n}\n\n/**\n * What a run left on one entry's rows: its own cells — a row's, a band's —\n * and each of its lines' by the line's id, a new line's every cell an add.\n *\n * @param marks - Where the rows' marks are kept\n * @param before - The entry's wire row before the run; `undefined` for one it added\n * @param after - Its wire row after\n * @param run - The run's number, formatted\n */\nfunction markRows(marks: Map<string, SheetRowOps>, before: SheetRowValue | undefined, after: SheetRowValue, run: string): void {\n    const own = cellOps(before?.cells, after.cells);\n    if (own.cells.size > 0 || before === undefined) marks.set(after.id, { op: before === undefined ? \"add\" : \"chg\", ...own, run });\n    for (const line of after.lines) {\n        const was = before?.lines.find((l) => l.key === line.key);\n        const ops = cellOps(was?.cells, line.cells);\n        if (ops.cells.size > 0 || was === undefined) marks.set(lineId(after.id, line.key), { op: was === undefined ? \"add\" : \"chg\", ...ops, run });\n    }\n}\n\n/**\n * The result landed (R7, R8, R10, R25, §12): diffed against the request by\n * key and recorded as one step of the session, origin `optimise` — each row\n * answered lifted into its draft, its wire row the source's projection of it;\n * a row the request held and the result does not, removed; a new row placed\n * at its key's place on a keyed source, else at the end. A result equal to\n * the request records nothing and leaves what earlier runs left as it is\n * (R10); one that changes rows lays its marks over theirs.\n *\n * @param args - What the landing is made over\n * @returns What the run counted, and what the runs have left on the rows — unchanged by a run that changed nothing; `undefined` for a result the session would not take\n */\nexport function landSheetOptimise(args: SheetLanding): { counts: OptimiseCounts; optimised: SheetOptimised | undefined } | undefined {\n    const { editing, types, draftType, keyed, request, result, label, runText, versionOf, record, before: earlier } = args;\n    const diff = diffOptimiseRows(ROWS, types.rowType, optimiseIdOf(types.keyType), request.rows, result.rows);\n    const encodeEntry = encodeBeast2For(types.rowType) as (entry: unknown) => Uint8Array;\n    const project = (row: unknown, id: string): SheetRowValue => decodeWire(editing.project(encodeEntry(row), id)) as SheetRowValue;\n    // A new row's place: its key's on a keyed source, else after every row the sheet holds.\n    const place: Placement = keyed ? some(variant(\"keyOrder\", null)) : some(variant(\"ordered\", variant(\"end\", null)));\n    const updates: EntryUpdate[] = [];\n    const marks = new Map<string, SheetRowOps>();\n    for (const [key, op] of diff.ops) {\n        const id = key.slice(ROWS.length + 1);\n        const before = versionOf(id);\n        if (op.op === \"del\") {\n            updates.push({ id, before, after: { draft: undefined, wire: undefined, place: none } });\n            continue;\n        }\n        const wire = project(op.row, id);\n        const after: EntryVersion = { draft: liftDraft(draftType, op.row), wire, place: op.op === \"add\" ? place : before.place };\n        updates.push({ id, before, after });\n        markRows(marks, op.op === \"add\" ? undefined : before.wire, wire, runText);\n    }\n    if (updates.length === 0) return { counts: diff.counts, optimised: undefined };\n    if (!record(updates, \"optimise\", label)) return undefined;\n    return { counts: diff.counts, optimised: { rows: new Map([...(earlier?.rows ?? []), ...marks]) } };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The lens over a record (#1349, B§8): a filtered spreadsheet — only the rows\n * a narrowing keeps, one after another in the record's order, each at its row\n * number — laid out by where e3 places them. Pure: no React, no reads.\n *\n * e3 places a narrowing's rows segment by segment ({@link LensSegment}): how\n * many of them each record segment holds, read from the index alone. A segment\n * that holds none draws nothing and is never read. A segment that holds some\n * is read — its rows by position, and which of them the narrowing holds, asked\n * of e3 in one read — and draws the rows the narrowing holds. Until it is read\n * it is one band of as many rows as it holds matches, its placeholders at the\n * rows' own pitch: its rows land where they stood, and nothing around them\n * moves. So the layout is as tall as the narrowing's rows, e3's count of them,\n * however much of it is read.\n *\n * While the placement is incomplete, the matches not placed yet are spread,\n * by the narrowing's density, over where they can still lie — the stretches no\n * segment is listed for yet and the segments not read — so the bands and the\n * rows add up to the narrowing's every row then too.\n *\n * A segment read whole is checked against its placement: the matches its rows\n * hold must be the matches e3 placed there. When they differ the record changed\n * between the two reads, and the segment is a failed band that says so, with a\n * Retry, rather than rows that would show a match the index does not hold.\n *\n * What it lays out is drawn over the record's rows the local layer leaves\n * ({@link lensBodyItems}): a drafted row in its place, a removed one gone, a\n * new one after the row before it.\n *\n * @packageDocumentation\n */\n\nimport type { LensBodyInput, SheetBand, SheetWindowFailure } from \"./model.js\";\nimport type { SheetRowValue } from \"./values.js\";\n\n/** The most rows the lens reads in one page: a record Slice's page holds no more. */\nexport const LENS_PIECE_ROWS = 2048;\n\n/** A record segment some of the narrowing's rows fall in: where it is, its rows, and how many of them match. */\nexport interface LensSegment {\n    /** Its first row, in the record's order. */\n    offset: number;\n    /** How many rows it holds. */\n    count: number;\n    /** How many of the narrowing's rows it holds, as placed so far. */\n    matches: number;\n}\n\n/** Where the narrowing's rows sit in the record, as far as e3 has placed them. */\nexport interface LensPlacement {\n    /** The record's rows. */\n    records: number;\n    /** The segments holding the narrowing's rows, in the record's order. */\n    segments: readonly LensSegment[];\n    /** How many rows the narrowing holds. */\n    matches: number;\n    /** How many of them are placed. */\n    placed: number;\n    /** Whether every one is: until then a stretch no segment is listed for may hold some. */\n    complete: boolean;\n}\n\n/** One row the lens has read: the row, and whether the narrowing holds it, once asked. */\nexport interface LensRow {\n    row: SheetRowValue;\n    hit: boolean | undefined;\n}\n\n/** What a segment of matches is, read or not. */\nexport type LensSegmentState =\n    /** Its rows, and which the narrowing holds, are read: `rowAt` answers for each. */\n    | { kind: \"read\" }\n    /** Not read yet, or still being read. */\n    | { kind: \"unread\" }\n    /** Its read failed, and why. */\n    | { kind: \"failed\"; error: string };\n\n/** What the lens knows of the record now. */\nexport interface LensFacts {\n    /** Where the narrowing's rows sit. */\n    placement: LensPlacement;\n    /** A segment of matches' state, by its first row. */\n    segmentState: (offset: number) => LensSegmentState;\n    /** A row read, by its position in the record. */\n    rowAt: (position: number) => LensRow | undefined;\n}\n\n/** How the lens draws what it has not read: the height of one of the narrowing's records drawn — a row, or on a grouped sheet a group's band and a line. */\nexport interface LensGeometry {\n    entryPx: number;\n}\n\n/** One item of the lens, in the record's order. */\nexport type LensItem =\n    /** A row the narrowing holds, at its position in the record. */\n    | { kind: \"row\"; position: number; row: SheetRowValue }\n    /** Rows the lens has still to read, or to place: one band of their height, where they will be drawn. */\n    | { kind: \"pending\"; band: SheetBand }\n    /** A segment whose read failed, or whose rows disagree with where e3 placed the narrowing's: one band, with a Retry. */\n    | { kind: \"failed\"; failure: SheetWindowFailure };\n\n/** The lens laid out: its items, and how many of the narrowing's rows it draws. */\nexport interface LensLayout {\n    items: LensItem[];\n    /** The matches drawn. */\n    hits: number;\n}\n\n/** One stretch of the record, in its order: a segment of matches, or — while the placement is incomplete — a stretch not placed yet. */\nexport interface LensRegion {\n    kind: \"matched\" | \"unplaced\";\n    /** Its first row. */\n    from: number;\n    /** One past its last row. */\n    to: number;\n    /** A segment of matches': its matches, as placed so far. */\n    matches: number;\n}\n\n/**\n * The record's stretches that can hold the narrowing's rows, in its order:\n * each segment of matches, and, while the placement is incomplete, the\n * stretches between them that are not placed yet. Once it is complete, a\n * stretch between the segments holds none: it is no stretch of the lens's.\n *\n * @param placement - Where the narrowing's rows sit\n * @returns The stretches\n */\nexport function lensRegions(placement: LensPlacement): LensRegion[] {\n    const out: LensRegion[] = [];\n    let at = 0;\n    for (const segment of placement.segments) {\n        if (!placement.complete && segment.offset > at) out.push({ kind: \"unplaced\", from: at, to: segment.offset, matches: 0 });\n        out.push({ kind: \"matched\", from: segment.offset, to: segment.offset + segment.count, matches: segment.matches });\n        at = segment.offset + segment.count;\n    }\n    if (!placement.complete && placement.records > at) out.push({ kind: \"unplaced\", from: at, to: placement.records, matches: 0 });\n    return out;\n}\n\n/** One read the lens makes: a segment of matches' rows by position, and which of them the narrowing holds. */\nexport interface LensPiece {\n    /** Its key: its first row and how many. */\n    key: string;\n    /** Its first row. */\n    from: number;\n    /** How many rows. */\n    count: number;\n    /** The segment of matches it reads, by its first row. */\n    segment: number;\n}\n\n/**\n * The reads the lens's stretches take: each segment of matches whole, in pages\n * of at most {@link LENS_PIECE_ROWS}. A stretch not placed yet takes none.\n *\n * @param regions - The record's stretches\n * @returns The reads, in the record's order\n */\nexport function lensPieces(regions: readonly LensRegion[]): LensPiece[] {\n    const out: LensPiece[] = [];\n    for (const region of regions) {\n        if (region.kind !== \"matched\") continue;\n        for (let at = region.from; at < region.to; at += LENS_PIECE_ROWS) {\n            const count = Math.min(LENS_PIECE_ROWS, region.to - at);\n            out.push({ key: `${at}+${count}`, from: at, count, segment: region.from });\n        }\n    }\n    return out;\n}\n\n/**\n * The reads a view of the record's rows `[from, to]` wants, in the order they\n * are read: every segment that view meets, in the record's order, then the\n * nearest segments beyond it, after it and then before it, `beyond` of them\n * on each side. Each segment's pages are one group, read together, so a\n * segment is read whole or not at all. What has landed of them is kept while\n * they are wanted, however many there are: {@link lensReadInTurns} reads the\n * rest a turn at a time.\n *\n * @param pieces - Every read the lens takes, in the record's order\n * @param from - The view's first row\n * @param to - The view's last row\n * @param beyond - How many segments past the view on each side\n * @returns The groups wanted, in the order they are read\n */\nexport function lensDemand(pieces: readonly LensPiece[], from: number, to: number, beyond: number): LensPiece[][] {\n    // Consecutive pieces of one segment read together.\n    const groups: LensPiece[][] = [];\n    for (const p of pieces) {\n        const last = groups[groups.length - 1];\n        if (last !== undefined && last[0]!.segment === p.segment) last.push(p);\n        else groups.push([p]);\n    }\n    if (groups.length === 0) return [];\n    const end = (g: LensPiece[]) => g[g.length - 1]!.from + g[g.length - 1]!.count;\n    // The first group ending past the view's first row, and the last starting at or before its last.\n    let first = groups.findIndex((g) => end(g) > from);\n    if (first < 0) first = groups.length - 1;\n    let last = first;\n    while (last + 1 < groups.length && groups[last + 1]![0]!.from <= to) last++;\n    const out = groups.slice(first, last + 1);\n    for (let d = 1; d <= beyond; d++) {\n        const after = groups[last + d];\n        if (after !== undefined) out.push(after);\n        const before = groups[first - d];\n        if (before !== undefined) out.push(before);\n    }\n    return out;\n}\n\n/**\n * Asks for the wanted reads that have not landed, in their order, with at\n * most `budget` pieces in flight at once, so the record Slice's and the paging\n * runtime's bounded caches hold every page in flight: a group that would pass\n * the budget waits whole for a later turn, as one landing frees room for it.\n * A piece that lands as it is asked — its pages already held — takes no room,\n * so a view whose reads are held is read whole in one turn.\n *\n * @param groups - The groups wanted, in the order they are read ({@link lensDemand})\n * @param landed - Whether a piece has landed whole, or failed: either way, not asked again\n * @param request - Asks for a piece, returning whether it has landed whole\n * @param budget - The most pieces in flight at once\n */\nexport function lensReadInTurns(\n    groups: readonly (readonly LensPiece[])[],\n    landed: (piece: LensPiece) => boolean,\n    request: (piece: LensPiece) => boolean,\n    budget: number,\n): void {\n    let inFlight = 0;\n    for (const group of groups) {\n        const unread = group.filter((p) => !landed(p));\n        if (unread.length === 0 || inFlight + unread.length > budget) continue;\n        for (const p of unread) if (!request(p)) inFlight++;\n    }\n}\n\n/** Words the layout puts in a failed band: why a segment's rows cannot be drawn. */\nexport interface LensWords {\n    /** A segment whose rows disagree with where e3 placed the narrowing's rows: the record changed between the two reads. */\n    changed: string;\n}\n\n/**\n * Lays the lens out: the narrowing's rows, one after another in the record's\n * order, each at its row number; a band for each stretch of them not read or\n * not placed yet, as tall as the rows it stands for; a failed band for each\n * segment whose read failed or whose matches disagree with its placement. Its\n * work is the segments read, never the record's size.\n *\n * @param facts - What the lens knows of the record\n * @param geometry - How tall what is not read yet is drawn\n * @param words - The failed band's words\n * @returns The items, in the record's order, and how many of the narrowing's rows it draws\n */\nexport function layoutLens(facts: LensFacts, geometry: LensGeometry, words: LensWords): LensLayout {\n    const { placement } = facts;\n    const regions = lensRegions(placement);\n    // A segment read: the rows it holds that the narrowing holds, which — once every row is placed — must be as many\n    // as e3 placed there.\n    const held = regions.map((region) => {\n        if (region.kind !== \"matched\" || facts.segmentState(region.from).kind !== \"read\") return 0;\n        let n = 0;\n        for (let p = region.from; p < region.to; p++) if (facts.rowAt(p)?.hit === true) n++;\n        return n;\n    });\n    const states = regions.map((region, i): LensSegmentState => {\n        if (region.kind !== \"matched\") return { kind: \"unread\" };\n        const state = facts.segmentState(region.from);\n        if (state.kind !== \"read\" || !placement.complete) return state;\n        return held[i] === region.matches ? state : { kind: \"failed\", error: words.changed };\n    });\n    const read = (i: number) => regions[i]!.kind === \"matched\" && states[i]!.kind === \"read\";\n    // What the stretches draw for sure — a read segment its matches, any other segment the matches placed in it — and\n    // the rows still able to hold a match not placed yet: a stretch not placed, and a segment's rows not read.\n    let sure = 0;\n    let room = 0;\n    regions.forEach((region, i) => {\n        if (read(i)) { sure += held[i]!; return; }\n        sure += region.matches;\n        room += region.to - region.from - region.matches;\n    });\n    // The matches not placed yet, spread over that room by the narrowing's density there, each stretch's share rounded\n    // so the shares add up to them exactly.\n    const rest = placement.complete ? 0 : Math.max(0, placement.matches - sure);\n    let reached = 0;\n    let given = 0;\n    const extra = regions.map((region, i) => {\n        if (rest === 0 || room === 0 || read(i)) return 0;\n        reached += region.to - region.from - region.matches;\n        const upTo = Math.round((rest * reached) / room);\n        const share = upTo - given;\n        given = upTo;\n        return share;\n    });\n    const items: LensItem[] = [];\n    let hits = 0;\n    regions.forEach((region, i) => {\n        if (read(i)) {\n            for (let p = region.from; p < region.to; p++) {\n                const row = facts.rowAt(p);\n                if (row?.hit !== true) continue;\n                items.push({ kind: \"row\", position: p, row: row.row });\n                hits++;\n            }\n            return;\n        }\n        const elements = region.matches + extra[i]!;\n        if (elements === 0) return;\n        const px = elements * geometry.entryPx;\n        const state = states[i]!;\n        if (state.kind === \"failed\") {\n            items.push({ kind: \"failed\", failure: { w: region.from, from: region.from, to: region.to - 1, elements, px, error: state.error } });\n        } else {\n            items.push({ kind: \"pending\", band: { at: \"reading\", from: region.from, to: region.to - 1, elements, px } });\n        }\n    });\n    return { items, hits };\n}\n\n/**\n * The lens's layout over the rows the local layer leaves (#1349): each row\n * the layout draws as the layer has it — a drafted row in its place, a removed\n * one gone, the bands around it kept — and a row the planner added in its turn\n * among them, after the row before it.\n *\n * @param layout - The lens laid out over the record\n * @param rows - The rows drawn with the local layer applied, in order\n * @param positions - Each of those rows' positions in the record\n * @returns What the lens's body draws, in order\n */\nexport function lensBodyItems(layout: LensLayout, rows: readonly SheetRowValue[], positions: readonly number[]): LensBodyInput[] {\n    const placed = new Map<string, number>();\n    layout.items.forEach((item, index) => { if (item.kind === \"row\") placed.set(item.row.id, index); });\n    const out: LensBodyInput[] = [];\n    let next = 0;\n    /** The layout's items before `to` that are not its rows: the rows come from `rows`. */\n    const flush = (to: number) => {\n        for (; next < to; next++) {\n            const item = layout.items[next]!;\n            if (item.kind === \"pending\") out.push({ kind: \"band\", band: item.band });\n            else if (item.kind === \"failed\") out.push({ kind: \"failed\", failure: item.failure });\n        }\n    };\n    rows.forEach((row, i) => {\n        const at = placed.get(row.id);\n        if (at !== undefined && at >= next) {\n            flush(at);\n            next = at + 1;\n        }\n        // A row the layout drew is one the narrowing holds; a row the planner added is not, until the record says so.\n        out.push({ kind: \"row\", position: positions[i]!, row, hit: at !== undefined });\n    });\n    flush(layout.items.length);\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The lens's reads over a record (#1349): where e3 places the narrowing's\n * rows, and the rows of the segments that hold them near the view, each read\n * by position with one ask of which of them the narrowing holds. What it has\n * read it lays out ({@link layoutLens}): the narrowing's rows, one after\n * another in the record's order.\n *\n * - **Placement.** `recordSlicePlace` reads where the narrowing's rows sit,\n *   segment by segment, from the index alone, its windows landing a few at a\n *   time: the lens draws as they land.\n * - **Segments near the view.** Each segment of matches the view meets, and\n *   the nearest beyond it either side, is read — its rows through the sheet's\n *   rows source, by position, and which of them the narrowing holds through\n *   `recordSliceWithinAt`, over the same page — a turn at a time, at most the\n *   lens's budget of pages in flight, so the record Slice's and the paging\n *   runtime's bounded caches hold every page it waits on; what has landed is\n *   kept while the view wants it, so a view meeting more segments than one\n *   turn reads is read whole, turn by turn. A segment with no match is never\n *   read.\n * - **What it has read** is kept by the record's revision and the narrowing:\n *   a choice keeps the rows, its matches asked again; a new revision reads\n *   both again. Until a new narrowing or revision is laid out — its placement\n *   begun and the segments near the view read — the last layout stands in, so\n *   the sheet never empties between them. Switched off, the lens keeps its\n *   last layout for its host to stand in while the pages are read again.\n * - **A source read another way** — its id the same, its page no longer\n *   equivalent to the one that read the rows (#809) — has every row read\n *   again, and the last layout stands in until they are (#1599), retained\n *   ({@link RecordLens.reread}): its rows are the last reading's. At rest they\n *   are read in the same turn; while a read of the record is on its way they\n *   are not, and the sheet emptied to its bands whenever its author's block\n *   was evaluated again meanwhile.\n * - **A key search's jump** reads where its row is, beside the view, until\n *   that row is drawn — its host then scrolls to it — or is known to be a row\n *   the narrowing does not hold, when its host clears the filters that hide\n *   it and jumps again under the narrowing they leave (the hidden pick,\n *   `hidden.ts`): the view's own rows stay drawn throughout, and a jump made\n *   as a new narrowing is read lands once that narrowing draws the row.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport { StringType, equalFor, equivalentFor, none, printFor, type option, type ValueTypeOf } from \"@elaraai/east\";\nimport { Sheet } from \"@elaraai/e3-ui/internal\";\nimport type { SeekQueryType, SeekRangeType } from \"@elaraai/east-ui\";\nimport { RecordSliceWhereType, type RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { entryLookup, recordSlicePlace, recordSliceSeek, recordSliceWithinAt, type EntryLookup } from \"@elaraai/east-ui-components/internal\";\nimport { sourceChange } from \"../shared/windowed.js\";\nimport {\n    layoutLens, lensDemand, lensPieces, lensReadInTurns, lensRegions,\n    type LensFacts, type LensGeometry, type LensLayout, type LensPiece, type LensPlacement, type LensRow, type LensSegmentState, type LensWords,\n} from \"./lens-layout.js\";\nimport type { SheetPagedSourceValue, SheetRowValue } from \"./values.js\";\n\ntype Where = ValueTypeOf<typeof RecordSliceWhereType>;\n\n/** The most pages the lens has in flight at once: well within the record Slice's 32 cached pages and the paging runtime's held answers. */\nexport const LENS_BUDGET = 16;\n\n/** The segments past the view on either side the lens reads. */\nconst LENS_BEYOND = 2;\n\nconst printWhere = printFor(RecordSliceWhereType);\nconst stringEqual = equalFor(StringType);\n/** Whether two sources serve the same rows: the same id and equivalent functions, as the paged driver asks (#809). */\nconst sourceEquivalent = equivalentFor(Sheet.Types.Root.fields.rows.cases.paged);\n\n/** No narrowing: the record's own rows, in its order. */\nconst WHOLE_RECORD: Where = new Map();\n\n/**\n * Where a key lands among a `rows` source's record's own rows, in the\n * record's order (#1349): what the sheet's key search seeks over a record. A\n * tracked read: none while it is pending.\n *\n * @param part - The `rows` source's part of the slice\n * @param query - The key query, in the record's primary key's order\n * @returns Where it lands; none while pending\n */\nexport function seekRecord(part: ValueTypeOf<RecordSliceBindType>, query: ValueTypeOf<typeof SeekQueryType>): option<ValueTypeOf<typeof SeekRangeType>> {\n    return recordSliceSeek(part, WHOLE_RECORD, query);\n}\n\n/** One line naming why a read failed. */\nfunction readFailure(err: unknown): string {\n    return err instanceof Error ? err.message : String(err);\n}\n\n/** What the lens has read of one piece, at one revision. */\ninterface LandedPiece {\n    rows?: readonly SheetRowValue[] | undefined;\n    /** The stored entries the piece's page carried beside its rows (#1599), by id. */\n    entries?: EntryLookup | undefined;\n    hits?: readonly boolean[] | undefined;\n    error?: string | undefined;\n}\n\n/** What the lens has read, and at which revision and narrowing. */\ninterface LensCache {\n    /** The source the rows were read from. */\n    source: SheetPagedSourceValue | undefined;\n    /** The revision the rows and the answers are at. */\n    revision: string | undefined;\n    /** The narrowing the answers are for, printed. */\n    query: string | undefined;\n    /** Each piece's rows, by its key: a narrowing's choice keeps them. */\n    rows: Map<string, readonly SheetRowValue[]>;\n    /** The stored entries each piece's page carried beside those rows (#1599), by the piece's key: kept and let go with its rows. */\n    entries: Map<string, EntryLookup>;\n    /** Each piece's answers, by its key: for the narrowing and the revision. */\n    hits: Map<string, readonly boolean[]>;\n    /** Why each piece's read failed: not asked again until a Retry. */\n    failures: Map<string, string>;\n    /**\n     * Whether its rows are read again for a source that reads them another way (#1599): until the rows near the view\n     * have landed so, the layout the last reading drew stands in.\n     */\n    reread: boolean;\n}\n\nfunction emptyCache(source: SheetPagedSourceValue | undefined, reread = false): LensCache {\n    return { source, revision: undefined, query: undefined, rows: new Map(), entries: new Map(), hits: new Map(), failures: new Map(), reread };\n}\n\n/** What the lens's evaluation read. */\ninterface LensRead {\n    revision: string | undefined;\n    query: string;\n    placement: LensPlacement | undefined;\n    /** Why the placement could not be read. */\n    placementError: string | undefined;\n    pieces: readonly LensPiece[];\n    landed: ReadonlyMap<string, LandedPiece>;\n    /** Whether the placement has begun and every read near the view has landed: a layout to swap in. */\n    ready: boolean;\n    /** Whether a read the lens asked for is still in flight. */\n    loading: boolean;\n    /** The segments of matches it is reading, by their first rows, in the order it reads them — a jump's, then the view's. */\n    reading: readonly number[];\n    /** Whether the rows are read again for a source that reads them another way, and those near the view have still to land. */\n    reread: boolean;\n}\n\n/** A layout, the revision and narrowing it laid out, and the entries its rows were read with. */\ninterface Shown {\n    layout: LensLayout;\n    revision: string | undefined;\n    query: string;\n    /** The stored entry the page that read the row at a position carried for an id (#1599): this layout's own reading's. */\n    entryOf: (id: string, at: number) => Uint8Array | undefined;\n}\n\n/** No entry: a lens that draws nothing. */\nconst NO_ENTRY = (): undefined => undefined;\n\n/** The view, as the record's rows its first and last items stand for, under the narrowing it was reported under. */\ninterface LensView {\n    from: number;\n    to: number;\n    query: string;\n}\n\n/** The lens's view of the record, as the sheet draws it. */\nexport interface RecordLens {\n    /** The layout drawn: the narrowing's, the last one while a new narrowing or revision is read, or — switched off — the last one, kept for its host. */\n    layout: LensLayout | undefined;\n    /** The rows that layout draws, in the record's order, and each one's position. */\n    rows: readonly SheetRowValue[];\n    positions: readonly number[];\n    /** The record's rows, once placed. */\n    total: number | undefined;\n    /** How many rows the narrowing holds, once placed. */\n    matches: number | undefined;\n    /** The record's revision the lens reads at, once known: what the answers of which choices hide a row are kept by. */\n    revision: string | undefined;\n    /**\n     * Whether the layout drawn was read before that revision: the last one's, standing in while this one's is read —\n     * what a Save's rows are drawn over as it left them, never as they were before it.\n     */\n    readBefore: boolean;\n    /** Whether the narrowing's layout is drawn: its placement begun and the segments near the view read. */\n    ready: boolean;\n    /** Whether a read is still in flight. */\n    loading: boolean;\n    /**\n     * The segments of matches it is reading, each by its first row — a piece of it wanted and not landed yet, on its way\n     * or waiting a turn — in the order it reads them: a jump's, then those the view meets, then those beyond it. What its\n     * host names and marks busy of the stretches it draws as bands (#1398): never one it is not reading.\n     */\n    reading: readonly number[];\n    /** The last layout stands in while a new narrowing is read. */\n    replacing: boolean;\n    /**\n     * The last layout stands in while its rows are read again for a source that reads them another way (#1599):\n     * retained, since its rows are the last reading's, until the rows near the view have landed.\n     */\n    reread: boolean;\n    /** Why the placement could not be read, while rows show beside it. */\n    sourceError: string | undefined;\n    /** Why the placement could not be read, when nothing has been drawn. */\n    error: string | undefined;\n    /** Bumps when what is drawn changes height at a constant count. */\n    sizeVersion: number;\n    /** A key search's jump: its row, and whether it is drawn — or known to be a row the narrowing does not hold. */\n    jump: { window: number; settled: boolean } | undefined;\n    /** The view moved: the rows its first and last items stand for, read at rest. */\n    reportViewport: (from: number, to: number, isScrolling: boolean) => void;\n    /** Read where a row is, beside the view, until it is drawn — its host scrolls to it — or known hidden. */\n    jumpToElement: (position: number) => void;\n    /** Drop the jump: where it drew its row, the view stays read there until the frame reports where it rests. */\n    clearJump: () => void;\n    /** Ask again: a failed segment, by its first row, or with none everything that failed. */\n    retry: (w?: number) => void;\n    /**\n     * The stored entry the page that read the row drawn at a position carried for an id (#1599) — the reading the layout\n     * drawn was made from, the last one's while it stands in: what a gesture on a row the lens shows begins from, and\n     * what its marks are read over. `undefined` where the source's pages carry none.\n     */\n    entryOf: (id: string, at: number) => Uint8Array | undefined;\n}\n\n/** What {@link useRecordLens} lays out over. */\nexport interface RecordLensInput {\n    /** The record's own rows, every one in its order — `undefined` while the lens is off. */\n    source: SheetPagedSourceValue | undefined;\n    /** The `rows` source's part of the slice: what places the narrowing and asks which rows it holds. */\n    part: ValueTypeOf<RecordSliceBindType> | undefined;\n    /** The narrowing. */\n    where: Where | undefined;\n    geometry: LensGeometry;\n    words: LensWords;\n}\n\n/** The view before any is reported: the record's first row. */\nconst NO_VIEW: LensView = { from: 0, to: 0, query: \"\" };\n\n/** No segment read. */\nconst NOT_READING: readonly number[] = [];\n\n/**\n * Reads and lays out the lens over a record (#1349).\n *\n * @param input - The record's rows, the narrowing, and how the lens draws\n * @returns What the sheet draws, and the callbacks it feeds back\n */\nexport function useRecordLens(input: RecordLensInput): RecordLens {\n    const { source, part, where, geometry, words } = input;\n    const active = source !== undefined && part !== undefined && where !== undefined;\n    const query = where === undefined ? \"\" : printWhere(where);\n    // The view, by the narrowing it was reported under: a new narrowing starts at the top.\n    const [viewport, setViewport] = useState<LensView>(NO_VIEW);\n    const viewFrom = viewport.query === query ? viewport.from : 0;\n    const viewTo = viewport.query === query ? viewport.to : 0;\n    const [retries, setRetries] = useState(0);\n    const [jumpTarget, setJumpTarget] = useState<number | undefined>(undefined);\n    const jumpRef = useRef(jumpTarget);\n    jumpRef.current = jumpTarget;\n    const queryRef = useRef(query);\n    queryRef.current = query;\n    // Whether the pending jump's row is drawn: the host scrolls to it then.\n    const jumpDrawnRef = useRef(false);\n    const cacheRef = useRef<LensCache>(emptyCache(undefined));\n\n    const read = useCallback((): LensRead | undefined => {\n        void retries;\n        if (source === undefined || part === undefined || where === undefined) return undefined;\n        const held = cacheRef.current;\n        // A source that is not the one that read the rows reads them all again (#809) — and where it is the same source\n        // reading them another way, the layout the last reading drew stands in until they land (#1599).\n        const change = sourceChange(held.source, source, sourceEquivalent);\n        if (change !== \"same\") cacheRef.current = emptyCache(source, change === \"reread\");\n        const cache = cacheRef.current;\n        const r = source.revision?.();\n        const revision = r?.type === \"some\" ? r.value : undefined;\n        if (revision !== cache.revision) {\n            cache.revision = revision;\n            cache.rows = new Map();\n            cache.entries = new Map();\n            cache.hits = new Map();\n            cache.failures = new Map();\n        }\n        if (query !== cache.query) {\n            cache.query = query;\n            cache.hits = new Map();\n            cache.failures = new Map();\n        }\n        let placement: LensPlacement | undefined;\n        let placementError: string | undefined;\n        try {\n            const placed = recordSlicePlace(part, where);\n            if (placed.type === \"some\") {\n                placement = {\n                    records: Number(placed.value.records),\n                    segments: placed.value.segments.map((s) => ({ offset: Number(s.offset), count: Number(s.count), matches: Number(s.rows) })),\n                    matches: Number(placed.value.total), placed: Number(placed.value.placed), complete: placed.value.complete,\n                };\n            }\n        } catch (err) {\n            console.error(\"[Sheet] the lens could not place the narrowing's rows:\", err);\n            placementError = readFailure(err);\n        }\n        let pending = false;\n        const landed = new Map<string, LandedPiece>();\n        // The segments a piece of which is wanted and not landed yet — on its way, or waiting a turn — in the order wanted.\n        const reading: number[] = [];\n        let pieces: LensPiece[] = [];\n        if (placement !== undefined) {\n            pieces = lensPieces(lensRegions(placement));\n            // A pending jump's segments first, then the view's: the view keeps what it draws while the jump reads.\n            const seen = new Set<number>();\n            const wanted = [\n                ...(jumpTarget === undefined ? [] : lensDemand(pieces, jumpTarget, jumpTarget, LENS_BEYOND)),\n                ...lensDemand(pieces, viewFrom, viewTo, LENS_BEYOND),\n            ].filter((group) => {\n                const segment = group[0]!.segment;\n                if (seen.has(segment)) return false;\n                seen.add(segment);\n                return true;\n            });\n            // A piece has landed whole once its rows, and which of them the narrowing holds, are kept; a failed one is\n            // not asked again until a Retry.\n            const whole = (p: LensPiece): boolean => cache.failures.has(p.key) || (cache.rows.has(p.key) && cache.hits.has(p.key));\n            lensReadInTurns(wanted, whole, (p) => {\n                try {\n                    if (!cache.rows.has(p.key)) {\n                        const page = source.page(BigInt(p.from), BigInt(p.count));\n                        if (page.type === \"some\") {\n                            // One read: the page's rows, and the entries they were made from.\n                            cache.rows.set(p.key, page.value.rows);\n                            cache.entries.set(p.key, entryLookup(page.value.entries));\n                        }\n                    }\n                    if (!cache.hits.has(p.key)) {\n                        const asked = recordSliceWithinAt(part, where, BigInt(p.from), BigInt(p.count));\n                        if (asked.type === \"some\") cache.hits.set(p.key, asked.value);\n                    }\n                } catch (err) {\n                    console.error(`[Sheet] the lens could not read rows ${p.from + 1}–${p.from + p.count}:`, err);\n                    cache.failures.set(p.key, readFailure(err));\n                }\n                return whole(p);\n            }, LENS_BUDGET);\n            // Every piece wanted, as far as it has landed: one still to land — in flight, or waiting for a later\n            // turn — keeps the layout from being the narrowing's yet.\n            for (const group of wanted) {\n                for (const p of group) {\n                    const failed = cache.failures.get(p.key);\n                    if (failed !== undefined) { landed.set(p.key, { error: failed }); continue; }\n                    const piece: LandedPiece = { rows: cache.rows.get(p.key), entries: cache.entries.get(p.key), hits: cache.hits.get(p.key) };\n                    if (piece.rows === undefined || piece.hits === undefined) {\n                        pending = true;\n                        if (!reading.includes(p.segment)) reading.push(p.segment);\n                    }\n                    landed.set(p.key, piece);\n                }\n            }\n            // What left the view leaves the cache: the record Slice and the paging runtime keep their own, bounded.\n            for (const key of [...cache.rows.keys()]) if (!landed.has(key)) { cache.rows.delete(key); cache.entries.delete(key); }\n            for (const key of [...cache.hits.keys()]) if (!landed.has(key)) cache.hits.delete(key);\n            for (const key of [...cache.failures.keys()]) if (!landed.has(key)) cache.failures.delete(key);\n        }\n        const ready = placement !== undefined && !pending;\n        const loading = placementError === undefined && (placement === undefined || !placement.complete || pending);\n        // Read again for a source that reads them another way: once the rows near the view have landed, they are its own.\n        if (cache.reread && (ready || placementError !== undefined)) cache.reread = false;\n        return { revision, query, placement, placementError, pieces, landed, ready, loading, reading, reread: cache.reread };\n    }, [source, part, where, query, viewFrom, viewTo, jumpTarget, retries]);\n\n    const { result } = useTrackedEvaluation(read);\n    const value = result.ok ? result.value : undefined;\n    const readError = result.ok ? undefined : readFailure(result.error);\n    const valueRef = useRef(value);\n    valueRef.current = value;\n\n    // The rows read, by position, with whether the narrowing holds each; and each segment's state.\n    const known = useMemo(() => {\n        const rows = new Map<number, LensRow>();\n        const segments = new Map<number, LensSegmentState>();\n        // The entries each row's page carried, by the row's position: its own read's.\n        const entries = new Map<number, EntryLookup>();\n        if (value === undefined) return { rows, segments, entries };\n        // A segment is read when every one of its pages has landed whole; one failure fails it.\n        const whole = new Map<number, boolean>();\n        for (const p of value.pieces) {\n            const piece = value.landed.get(p.key);\n            if (piece?.error !== undefined) segments.set(p.segment, { kind: \"failed\", error: piece.error });\n            const done = piece !== undefined && piece.rows !== undefined && piece.hits !== undefined;\n            whole.set(p.segment, (whole.get(p.segment) ?? true) && done);\n            const pieceRows = piece?.rows;\n            if (pieceRows === undefined) continue;\n            const carried = piece?.entries;\n            pieceRows.forEach((row, i) => {\n                rows.set(p.from + i, { row, hit: piece?.hits?.[i] });\n                if (carried !== undefined) entries.set(p.from + i, carried);\n            });\n        }\n        for (const [segment, done] of whole) if (!segments.has(segment)) segments.set(segment, done ? { kind: \"read\" } : { kind: \"unread\" });\n        return { rows, segments, entries };\n    }, [value]);\n\n    const fresh = useMemo((): LensLayout | undefined => {\n        if (value?.placement === undefined) return undefined;\n        const facts: LensFacts = {\n            placement: value.placement,\n            segmentState: (offset) => known.segments.get(offset) ?? { kind: \"unread\" },\n            rowAt: (position) => known.rows.get(position),\n        };\n        return layoutLens(facts, geometry, words);\n    }, [value, known, geometry, words]);\n\n    // The entry each row of that layout was read with: its own page's, by the row's place in the record.\n    const readEntry = useMemo(() => {\n        const entries = known.entries;\n        return (id: string, at: number): Uint8Array | undefined => entries.get(at)?.(id);\n    }, [known]);\n\n    // The layout shown: the narrowing's once it is ready, the last one standing in until then. A lens switched on\n    // anew stands nothing of its own in: the rows its host showed last do. Switched off, it keeps its last layout.\n    const displayed = useRef<Shown | undefined>(undefined);\n    const wasActive = useRef(false);\n    if (active && !wasActive.current) displayed.current = undefined;\n    wasActive.current = active;\n    let shown: Shown | undefined = displayed.current;\n    let replacing = false;\n    let reread = false;\n    if (active && value !== undefined && fresh !== undefined) {\n        const previous = displayed.current;\n        const moved = previous !== undefined && (previous.revision !== value.revision || previous.query !== value.query || value.reread);\n        if (moved && !value.ready) {\n            replacing = previous.query !== value.query;\n            reread = value.reread;\n        } else {\n            shown = { layout: fresh, revision: value.revision, query: value.query, entryOf: readEntry };\n            displayed.current = shown;\n        }\n    } else if (active && shown !== undefined) {\n        replacing = shown.query !== query;\n    }\n    const layout = shown?.layout;\n\n    const drawn = useMemo(() => {\n        const rows: SheetRowValue[] = [];\n        const positions: number[] = [];\n        for (const item of layout?.items ?? []) {\n            if (item.kind !== \"row\") continue;\n            rows.push(item.row);\n            positions.push(item.position);\n        }\n        return { rows, positions };\n    }, [layout]);\n\n    // Heights change at a constant count as segments land: the frame measures again.\n    const sizeVersion = useMemo(() => {\n        let h = 0;\n        for (const item of layout?.items ?? []) {\n            const px = item.kind === \"pending\" ? item.band.px : item.kind === \"failed\" ? item.failure.px : -1;\n            h = (h * 31 + Math.round(px)) | 0;\n        }\n        return h;\n    }, [layout]);\n\n    const reportViewport = useCallback((from: number, to: number, isScrolling: boolean) => {\n        if (isScrolling) return;\n        const q = queryRef.current;\n        setViewport((current) => (current.from === from && current.to === to && current.query === q ? current : { from, to, query: q }));\n    }, []);\n    const jumpToElement = useCallback((position: number) => setJumpTarget(position), []);\n    const clearJump = useCallback(() => {\n        // A jump whose row is drawn hands the view to the frame, which scrolls there: until it reports where it rests,\n        // the view is read where the row is, so the row stays drawn (#854). One that drew nothing — a row the\n        // narrowing does not hold, or a read let go — leaves the view where it is.\n        const target = jumpRef.current;\n        if (target !== undefined && jumpDrawnRef.current) setViewport({ from: target, to: target, query: queryRef.current });\n        setJumpTarget(undefined);\n    }, []);\n\n    const retry = useCallback((w?: number) => {\n        const ask = () => {\n            const cache = cacheRef.current;\n            // What is asked again is read again whole: a segment, by its first row — a read that failed, or rows that\n            // disagreed with its placement.\n            for (const p of valueRef.current?.pieces ?? []) {\n                if (w !== undefined && p.segment !== w) continue;\n                cache.failures.delete(p.key);\n                cache.rows.delete(p.key);\n                cache.entries.delete(p.key);\n                cache.hits.delete(p.key);\n            }\n            if (w === undefined) cache.failures.clear();\n            setRetries((n) => n + 1);\n        };\n        // The source rearms what failed first (#1398), a microtask on: the records go and the lens reads again after\n        // it, so a read between the two never records the failure again from what the runtime held.\n        if (source?.refresh === undefined) { ask(); return; }\n        source.refresh(none);\n        queueMicrotask(ask);\n    }, [source]);\n\n    // A jump settles once its row is drawn — or the band of the read that failed where it is — or once the lens knows\n    // the row is none the narrowing holds: it lies where no segment of matches does, every row placed, or in a segment\n    // read whose rows say so.\n    const items = layout?.items ?? [];\n    const drawnAt = (p: number) => items.some((item) => (item.kind === \"row\" && item.position === p)\n        || (item.kind === \"failed\" && item.failure.from <= p && p <= item.failure.to));\n    const hiddenAt = (p: number): boolean => {\n        const placement = value?.placement;\n        if (placement === undefined) return false;\n        const segment = placement.segments.find((s) => s.offset <= p && p < s.offset + s.count);\n        if (segment === undefined) return placement.complete;\n        return known.segments.get(segment.offset)?.kind === \"read\" && known.rows.get(p)?.hit === false;\n    };\n    const jumpDrawn = jumpTarget !== undefined && drawnAt(jumpTarget);\n    jumpDrawnRef.current = jumpDrawn;\n    const settled = jumpTarget !== undefined && (jumpDrawn || hiddenAt(jumpTarget));\n    const failure = value?.placementError ?? readError;\n    // The segments it reads, one array while they hold: a landing elsewhere draws no band again for them.\n    const readingNow = active ? value?.reading ?? NOT_READING : NOT_READING;\n    const readingHeld = useRef(NOT_READING);\n    if (readingNow.length !== readingHeld.current.length || readingNow.some((at, i) => at !== readingHeld.current[i])) readingHeld.current = readingNow;\n    const reading = readingHeld.current;\n    // The layout drawn is the last revision's while this one's is read — or while the read fails, its revision unknown.\n    const laidOut = shown?.revision;\n    const readNow = value?.revision;\n    const readBefore = active && shown !== undefined && (value === undefined\n        || (laidOut === undefined || readNow === undefined ? laidOut !== readNow : !stringEqual(laidOut, readNow)));\n    return {\n        layout,\n        rows: drawn.rows,\n        positions: drawn.positions,\n        total: value?.placement?.records,\n        matches: value?.placement?.matches,\n        revision: active ? value?.revision : undefined,\n        readBefore,\n        ready: active && value !== undefined && value.ready && shown !== undefined && shown.query === query && shown.revision === value.revision,\n        loading: active && (value === undefined || value.loading),\n        reading,\n        replacing,\n        reread,\n        sourceError: layout === undefined ? undefined : failure,\n        error: active && layout === undefined ? failure : undefined,\n        sizeVersion,\n        jump: jumpTarget === undefined ? undefined : { window: jumpTarget, settled },\n        reportViewport,\n        jumpToElement,\n        clearJump,\n        retry,\n        entryOf: shown?.entryOf ?? NO_ENTRY,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Candidate scoring for the register kinds (B§3.1): whole-string prefix (0)\n * → every typed word prefixes some word, or any word prefix (1) → initials\n * in order, two or more characters (2) → substring (3); ties broken by how\n * often the value already appears in the sheet. Only a PREFIX match ghosts\n * inline; a non-prefix match previews as a replacement.\n *\n * With an empty buffer nothing is armed: the strip lists what the field\n * ACCEPTS — the driver column ranked by what usually follows the row above,\n * then by sheet frequency.\n *\n * Every register column is typed in the words its cells show (#1536): a\n * member is found by its key, by its label and by its aliases alike. A\n * candidate is a member — its key, what a commit writes, and its label, what\n * the strip, the menu and the ghost show; a lookup's free text is its own key\n * and label.\n *\n * @packageDocumentation\n */\n\nimport { resolveTyped, type SheetColumnMeta, type SheetRegisterIndex } from \"./model.js\";\nimport type { SheetRowValue } from \"./values.js\";\n\n/** One candidate: what a commit writes — a member's key — and the words it is shown and typed in, its label (else its key). */\nexport interface SheetCandidate {\n    key: string;\n    label: string;\n}\n\n/** The sheet facts a candidate list reads. */\nexport interface CandidateContext {\n    /** The registers. */\n    registers: SheetRegisterIndex;\n    /** The resident real rows, in sheet order. */\n    rows: readonly SheetRowValue[];\n    /** The edited row's index among `rows` (`-1` for a blank row). */\n    rowIndex: number;\n    /** The driver column's key, when the sheet declares one. */\n    driverColumn: string | undefined;\n    /** A column's options rule (#844), evaluated for the edited row: the member keys it is offered (`undefined` = the whole register). */\n    allowed?: ((meta: SheetColumnMeta) => ReadonlySet<string> | undefined) | undefined;\n}\n\n/** Score one label against a query (lower is better; `-1` = no match). */\nexport function scoreLabel(label: string, query: string): number {\n    const t = query.trim().toLowerCase();\n    if (t === \"\") return -1;\n    const lo = label.toLowerCase();\n    if (lo.startsWith(t)) return 0;\n    const words = lo.split(/[^a-z0-9]+/).filter(Boolean);\n    const parts = t.split(/\\s+/).filter(Boolean);\n    if (parts.length > 1 && parts.every((p) => words.some((w) => w.startsWith(p)))) return 1;\n    if (words.some((w) => w.startsWith(t))) return 1;\n    let wi = 0;\n    let ok = true;\n    for (const ch of t.replace(/\\s+/g, \"\")) {\n        let found = false;\n        while (wi < words.length) {\n            if (words[wi]![0] === ch) { found = true; wi++; break; }\n            wi++;\n        }\n        if (!found) { ok = false; break; }\n    }\n    if (ok && t.length >= 2) return 2;\n    if (lo.includes(t)) return 3;\n    return -1;\n}\n\n/** The labels matching `query`, best first; ties by `freq`. */\nexport function scoreCandidates(labels: readonly string[], query: string, freq?: ReadonlyMap<string, number>): string[] {\n    return labels\n        .map((x) => ({ x, s: scoreLabel(x, query) }))\n        .filter((o) => o.s >= 0)\n        .sort((a, b) => a.s - b.s || (freq?.get(b.x) ?? 0) - (freq?.get(a.x) ?? 0))\n        .map((o) => o.x);\n}\n\n/** How often each String value of `column` appears in the sheet. */\nexport function columnFrequency(rows: readonly SheetRowValue[], column: string): Map<string, number> {\n    const f = new Map<string, number>();\n    for (const r of rows) {\n        const c = r.cells.get(column);\n        if (c === undefined || c.type !== \"String\" || c.value === \"\") continue;\n        f.set(c.value, (f.get(c.value) ?? 0) + 1);\n    }\n    return f;\n}\n\n/** A register's members, in declaration order, each with the words it shows (its label, else its key) — narrowed to the column's options rule when the host gives one. */\nfunction members(ctx: CandidateContext, meta: SheetColumnMeta): { key: string; label: string; aliases: readonly string[] }[] {\n    if (meta.register === undefined) return [];\n    const all = (ctx.registers.byName.get(meta.register) ?? []).map((m) => ({ key: m.key, label: m.label !== \"\" ? m.label : m.key, aliases: m.aliases }));\n    const allowed = ctx.allowed?.(meta);\n    return allowed === undefined ? all : all.filter((m) => allowed.has(m.key));\n}\n\n/**\n * The members matching `query` by key, by label or by any alias, best\n * first: a member's score is its best over its spellings — its label as good\n * as its key, an alias match ranking just behind the same match on either —\n * ties by `freq`, then the register's order. A register's shorthand (an\n * abbreviation, a site's own word for a member) is an alias, not a substring\n * of the member's name.\n */\nfunction scoreMembers(list: readonly { key: string; label: string; aliases: readonly string[] }[], query: string, freq?: ReadonlyMap<string, number>): SheetCandidate[] {\n    return list\n        .map((m) => {\n            let s = scoreLabel(m.key, query);\n            const ls = scoreLabel(m.label, query);\n            if (ls >= 0 && (s < 0 || ls < s)) s = ls;\n            for (const a of m.aliases) {\n                const as = scoreLabel(a, query);\n                if (as >= 0 && (s < 0 || as + 0.25 < s)) s = as + 0.25;\n            }\n            return { m, s };\n        })\n        .filter((o) => o.s >= 0)\n        .sort((a, b) => a.s - b.s || (freq?.get(b.m.key) ?? 0) - (freq?.get(a.m.key) ?? 0))\n        .map((o) => ({ key: o.m.key, label: o.m.label }));\n}\n\n/** The String value of a row's column, or `\"\"`. */\nfunction stringAt(row: SheetRowValue | undefined, column: string): string {\n    const c = row?.cells.get(column);\n    return c !== undefined && c.type === \"String\" ? c.value : \"\";\n}\n\n/**\n * The entry menu — what the field accepts with an empty buffer. The driver\n * column ranks by what usually follows the row above (a value that most\n * often came right after the previous row's driver value, over the dated\n * rows in sheet order), then by sheet frequency, then the rest of the\n * register. Every other register column offers its members in their order.\n */\nexport function entryCandidates(meta: SheetColumnMeta, ctx: CandidateContext): SheetCandidate[] {\n    const list = members(ctx, meta);\n    switch (meta.kind) {\n        case \"enum\":\n        case \"reference\":\n        case \"person\":\n        case \"cycle\":\n            return list.slice(0, 8).map((m) => ({ key: m.key, label: m.label }));\n        case \"lookup\":\n            break;\n        default:\n            return [];\n    }\n    const score = new Map<string, number>();\n    const prev = ctx.rowIndex > 0 ? ctx.rows[ctx.rowIndex - 1] : undefined;\n    const prevValue = stringAt(prev, meta.key);\n    if (prevValue !== \"\") {\n        const real = ctx.rows.filter((r, i) => i !== ctx.rowIndex && stringAt(r, meta.key) !== \"\");\n        for (let i = 0; i < real.length - 1; i++) {\n            const a = stringAt(real[i], meta.key);\n            const b = stringAt(real[i + 1], meta.key);\n            if (a === prevValue && b !== prevValue) score.set(b, (score.get(b) ?? 0) + 10);\n        }\n    }\n    for (const r of ctx.rows) {\n        const v = stringAt(r, meta.key);\n        if (v !== \"\") score.set(v, (score.get(v) ?? 0) + 1);\n    }\n    const seen = [...score.keys()].sort((a, b) => score.get(b)! - score.get(a)!);\n    const rest = list.filter((m) => !score.has(m.key)).map((m) => m.key);\n    // A value the sheet holds shows as its member does — a member the row is not offered too — and free text as itself.\n    const shown = new Map((ctx.registers.byName.get(meta.register ?? \"\") ?? []).map((m) => [m.key, m.label]));\n    return seen.concat(rest).slice(0, 8).map((key) => {\n        const label = shown.get(key);\n        return { key, label: label !== undefined && label !== \"\" ? label : key };\n    });\n}\n\n/** The scored candidates for a typed buffer (the entry menu when empty): the register's members, found by key, label or alias. */\nexport function candidateList(meta: SheetColumnMeta, text: string, ctx: CandidateContext): SheetCandidate[] {\n    const t = text.trim();\n    if (t === \"\") return entryCandidates(meta, ctx);\n    const list = members(ctx, meta);\n    switch (meta.kind) {\n        case \"lookup\": return scoreMembers(list, t, columnFrequency(ctx.rows, meta.key));\n        case \"reference\":\n        case \"enum\":\n        case \"person\":\n        case \"cycle\": return scoreMembers(list, t);\n        default: return [];\n    }\n}\n\n/**\n * The candidate typed text commits to: the member it names whole — by key or\n * alias, else by the label it shows, the first member to show it — where the\n * row is offered that member; else the best candidate. Two members who show\n * one label are told apart by a pick (the menu, the strip, ⇥), never by the\n * words alone.\n *\n * @param meta - The register column\n * @param text - What was typed\n * @param ctx - The sheet facts\n * @returns The candidate, or `undefined` where nothing matches\n */\nexport function candidateFor(meta: SheetColumnMeta, text: string, ctx: CandidateContext): SheetCandidate | undefined {\n    if (text.trim() === \"\") return undefined;\n    const named = resolveTyped(ctx.registers, meta.register, text);\n    const allowed = ctx.allowed?.(meta);\n    if (named !== undefined && (allowed === undefined || allowed.has(named.key))) return { key: named.key, label: named.label !== \"\" ? named.label : named.key };\n    return candidateList(meta, text, ctx)[0];\n}\n\n/** Which candidate is armed: an explicit pick, else the top one once something is typed. */\nexport function armedIndex(text: string, hi: number): number {\n    if (hi >= 0) return hi;\n    return text.trim() === \"\" ? 0 : 0;\n}\n\n/** The armed candidate for a buffer (`undefined` with an empty buffer — entering arms nothing). */\nexport function candidateAt(meta: SheetColumnMeta, text: string, hi: number, ctx: CandidateContext): SheetCandidate | undefined {\n    if (text.trim() === \"\" && hi < 0) return undefined;\n    const list = candidateList(meta, text, ctx);\n    if (list.length === 0) return undefined;\n    const i = hi < 0 ? 0 : hi;\n    return list[Math.min(i, list.length - 1)];\n}\n\n/** The inline ghost — the top prefix candidate's suffix, else `\"\"`. */\nexport function ghostFor(text: string, candidate: string | undefined): string {\n    const t = text.trim();\n    if (t === \"\" || candidate === undefined) return \"\";\n    return candidate.toLowerCase().startsWith(t.toLowerCase()) ? candidate.slice(t.length) : \"\";\n}\n\n/** One word of the ghost — the copilot's word-wise accept. */\nexport function ghostWord(ghost: string): string {\n    if (ghost === \"\") return \"\";\n    const m = /^[\\s\\-–/]*[^\\s\\-–/]+/.exec(ghost);\n    return m ? m[0] : ghost;\n}\n\n/** A non-prefix match previews as a replacement (`→ Routing - Nesting`); `\"\"` when the ghost covers it. */\nexport function resolveFor(text: string, candidate: string | undefined): string {\n    const t = text.trim();\n    if (t === \"\" || candidate === undefined) return \"\";\n    if (ghostFor(text, candidate) !== \"\") return \"\";\n    return candidate.toLowerCase() === t.toLowerCase() ? \"\" : candidate;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The link editor's transitions (B§4.4 — `Sheet Spec.md` §5 row 7): the two\n * halves, the buffer that resolves to chips on `,` / ⏎ / a hop, the chip\n * selection, the ⇥ ladder. Pure functions over the machine state; the commit\n * is injected by the core so this module never imports it.\n *\n * @packageDocumentation\n */\n\nimport { ghostWord } from \"./candidates.js\";\nimport { memberLabel } from \"./model.js\";\nimport { ARROW } from \"./link/grammar.js\";\nimport type { LinkHalves } from \"./link/sides.js\";\nimport type {\n    CommitDir, EditBuffer, LinkEdit, LinkEditCtx, LinkGroups, SheetEffect, SheetEvent, SheetMachineCtx, SheetNotice, SheetUiState, Transition,\n} from \"./sheet-types.js\";\n\n/** The core's commit, injected. */\nexport type CommitFn = (s: SheetUiState, dir: CommitDir, ctx: SheetMachineCtx) => Transition;\n\n/** The half the caret opens in: the first live half still empty, else the destination. */\nexport function linkStartSide(halves: LinkHalves, groups: LinkGroups): 0 | 1 {\n    if (halves.from.live && groups[0].length === 0) return 0;\n    if (halves.to.live && groups[1].length === 0) return 1;\n    return halves.to.live ? 1 : 0;\n}\n\n/** The halves with the buffer resolved into the active one. */\nexport function withBuffer(edit: EditBuffer, linkCtx: LinkEditCtx): LinkGroups {\n    const link = edit.link!;\n    const groups: LinkGroups = [[...link.groups[0]], [...link.groups[1]]];\n    if (edit.val.trim() === \"\") return groups;\n    const cand = linkCtx.candidateAt(edit.val, edit.hi, link.groups);\n    groups[link.side] = groups[link.side].concat(linkCtx.resolve(edit.val, cand));\n    return groups;\n}\n\n/** Hop the caret to a half — the buffer resolves into the half it leaves. */\nexport function switchSide(s: SheetUiState, side: 0 | 1, ctx: SheetMachineCtx): Transition {\n    const edit = s.edit;\n    if (edit === null || edit.link === undefined || edit.link.side === side) return { state: s, effects: [] };\n    const linkCtx = ctx.linkAt?.(edit.r, edit.c);\n    if (linkCtx === undefined) return { state: s, effects: [] };\n    const groups = withBuffer(edit, linkCtx);\n    return {\n        state: { ...s, edit: { ...edit, val: \"\", hi: -1, err: false, link: { ...edit.link, side, groups, chipSel: null, hop: edit.link.hop + 1 } } },\n        effects: [{ t: \"focus.editor\", selectAll: false }, { t: \"schedule.suggest\", latency: \"idle\" }],\n    };\n}\n\n/** The flat chip list's range under the chip selection. */\nfunction chipRange(link: LinkEdit): { lo: number; hi: number } {\n    if (link.chipSel === null) return { lo: -1, hi: -2 };\n    return { lo: Math.min(link.chipSel.anchor, link.chipSel.focus), hi: Math.max(link.chipSel.anchor, link.chipSel.focus) };\n}\n\n/** The link editor's typing: `,` resolves the buffer, an arrow hops From → To (dropped in To). */\nexport function linkChange(s: SheetUiState, val: string, ctx: SheetMachineCtx): Transition {\n    const edit = s.edit!;\n    const link = edit.link!;\n    if (!val.includes(\",\") && !ARROW.test(val)) {\n        return { state: { ...s, edit: { ...edit, val, err: false, hi: val.trim() === \"\" ? -1 : 0, link: { ...link, chipSel: null } } }, effects: [{ t: \"schedule.suggest\", latency: \"idle\" }] };\n    }\n    const linkCtx = ctx.linkAt?.(edit.r, edit.c);\n    if (linkCtx === undefined) return { state: s, effects: [] };\n    const groups: LinkGroups = [[...link.groups[0]], [...link.groups[1]]];\n    let side = link.side;\n    let buf = \"\";\n    let warn: SheetNotice | undefined;\n    const push = (b: string) => {\n        const t = b.trim().replace(/-+$/, \"\").trim();\n        if (t === \"\") return;\n        // The armed candidate completes the buffer (the ghost the planner saw); else the grammar.\n        groups[side] = groups[side].concat(linkCtx.resolve(t, linkCtx.candidateAt(t, -1, groups)));\n    };\n    // An arrow typed in the From half hops to the To half; in the To half it is\n    // dropped. Hopping into a locked half is allowed but flagged — the text is kept.\n    const route = () => {\n        push(buf);\n        buf = \"\";\n        if (side === 0) {\n            side = 1;\n            if (!linkCtx.halves.to.live) warn = { id: \"lockedHalf\", driver: linkCtx.driverName };\n        }\n    };\n    for (let i = 0; i < val.length; i++) {\n        const ch = val[i]!;\n        if (ch === \",\") { push(buf); buf = \"\"; continue; }\n        if (ch === \">\" || ch === \"→\") { route(); continue; }\n        if (ch === \"-\" && val[i + 1] === \">\") continue;   // `->`: the hyphen buffered before the arrow\n        if ((ch === \"-\" || ch === \"–\") && /\\s$/.test(buf) && /^\\s/.test(val.slice(i + 1))) { route(); i++; continue; }\n        buf += ch;\n    }\n    const hopped = side !== link.side;\n    const effects: SheetEffect[] = [{ t: \"schedule.suggest\", latency: \"idle\" }];\n    if (hopped) effects.push({ t: \"focus.editor\", selectAll: false });\n    const rest = buf.replace(/^\\s+/, \"\");\n    return {\n        state: {\n            ...s,\n            msg: warn ?? s.msg,\n            edit: { ...edit, val: rest, err: false, hi: rest.trim() === \"\" ? -1 : 0, link: { ...link, side, groups, chipSel: null, hop: hopped ? link.hop + 1 : link.hop } },\n        },\n        effects,\n    };\n}\n\n/** The link editor's keys (B§4.4). */\nexport function linkKey(s: SheetUiState, e: Extract<SheetEvent, { t: \"editor.key\" }>, ctx: SheetMachineCtx, commit: CommitFn): Transition {\n    const edit = s.edit!;\n    const link = edit.link!;\n    const linkCtx = ctx.linkAt?.(edit.r, edit.c);\n    if (linkCtx === undefined) return commit(s, \"cancel\", ctx);\n    const setLink = (patch: Partial<LinkEdit>, more: Partial<EditBuffer> = {}, effects: SheetEffect[] = []): Transition =>\n        ({ state: { ...s, edit: { ...edit, ...more, link: { ...link, ...patch } } }, effects });\n    const flat = [...link.groups[0], ...link.groups[1]];\n    if (e.key === \"Escape\") {\n        if (link.chipSel !== null) return setLink({ chipSel: null });\n        return commit(s, \"cancel\", ctx);\n    }\n    if (e.alt && (e.key === \"]\" || e.key === \"[\" || e.key === \"ArrowDown\" || e.key === \"ArrowUp\")) {\n        const n = linkCtx.candidates(edit.val, link.groups).length;\n        if (n === 0) return { state: s, effects: [] };\n        const cur = edit.hi < 0 ? (edit.val.trim() === \"\" ? -1 : 0) : edit.hi;\n        const back = e.key === \"[\" || e.key === \"ArrowUp\";\n        return { state: { ...s, edit: { ...edit, hi: cur < 0 ? 0 : (cur + (back ? -1 : 1) + n) % n } }, effects: [{ t: \"schedule.suggest\", latency: \"instant\" }] };\n    }\n    if (e.key === \"Enter\") {\n        if (e.meta) return commit(s, \"stay\", ctx);\n        if (edit.val.trim() !== \"\") {\n            // With text: resolve to chips, stay.\n            const groups = withBuffer(edit, linkCtx);\n            return setLink({ groups, chipSel: null }, { val: \"\", hi: -1, err: false }, [{ t: \"schedule.suggest\", latency: \"idle\" }]);\n        }\n        return commit(s, \"down\", ctx);\n    }\n    if (e.key === \"Tab\") {\n        if (!e.shift && edit.val.trim() !== \"\") {\n            // 1 · the inline ghost or the armed candidate.\n            const cand = linkCtx.candidateAt(edit.val, edit.hi, link.groups);\n            if (cand !== undefined && cand.label.toLowerCase() !== edit.val.trim().toLowerCase()) {\n                return { state: { ...s, edit: { ...edit, val: cand.label, hi: 0 } }, effects: [{ t: \"schedule.suggest\", latency: \"instant\" }] };\n            }\n        }\n        if (!e.shift && edit.val.trim() === \"\") {\n            // 2 · one predicted chip.\n            const rest = linkCtx.predicted(link.side, link.groups, edit.val);\n            if (rest.length > 0) {\n                const groups: LinkGroups = [[...link.groups[0]], [...link.groups[1]]];\n                groups[link.side] = groups[link.side].concat([rest[0]!]);\n                return setLink({ groups }, {}, [{ t: \"schedule.suggest\", latency: \"instant\" }]);\n            }\n        }\n        // 3 · the divider, before the cell — a locked half is skipped.\n        if (!e.shift && link.side === 0 && linkCtx.halves.to.live) return switchSide(s, 1, ctx);\n        if (e.shift && link.side === 1 && linkCtx.halves.from.live) return switchSide(s, 0, ctx);\n        // 4 · commit.\n        return commit(s, e.shift ? \"left\" : \"right\", ctx);\n    }\n    // ⇧← / ⇧→ select whole chips — the unit of a collection cell is the member.\n    if (e.shift && (e.key === \"ArrowLeft\" || e.key === \"ArrowRight\") && flat.length > 0) {\n        const cs = link.chipSel;\n        if (e.key === \"ArrowLeft\" && (cs !== null || edit.val === \"\")) {\n            const next = cs !== null ? { anchor: cs.anchor, focus: Math.max(0, cs.focus - 1) } : { anchor: flat.length - 1, focus: flat.length - 1 };\n            return setLink({ chipSel: next });\n        }\n        if (e.key === \"ArrowRight\" && cs !== null) {\n            const f = cs.focus + 1;\n            return setLink({ chipSel: f > flat.length - 1 ? null : { anchor: cs.anchor, focus: f } });\n        }\n    }\n    if (link.chipSel !== null && (e.key === \"Backspace\" || e.key === \"Delete\")) {\n        const { lo, hi } = chipRange(link);\n        let i = 0;\n        const groups = link.groups.map((g) => g.filter(() => { const n = i++; return n < lo || n > hi; })) as LinkGroups;\n        return { state: { ...s, msg: { id: \"membersRemoved\", n: hi - lo + 1 }, edit: { ...edit, link: { ...link, groups, chipSel: null } } }, effects: [] };\n    }\n    if (link.chipSel !== null && (e.key === \"ArrowLeft\" || e.key === \"ArrowRight\")) return setLink({ chipSel: null });\n    if (e.key === \"Backspace\" && edit.val === \"\") {\n        // Pop the active half's last chip back into the buffer; an empty To crosses back to From.\n        if (link.groups[link.side].length > 0) {\n            const groups: LinkGroups = [[...link.groups[0]], [...link.groups[1]]];\n            const tok = groups[link.side].pop()!;\n            return setLink({ groups, chipSel: null }, { val: memberLabel(tok), hi: 0 });\n        }\n        if (link.side === 1) return switchSide(s, 0, ctx);\n        return { state: s, effects: [] };\n    }\n    if (e.key === \"ArrowRight\" && e.atEnd && edit.val.trim() !== \"\") {\n        const cand = linkCtx.candidateAt(edit.val, edit.hi, link.groups);\n        const ghost = cand !== undefined && cand.label.toLowerCase().startsWith(edit.val.trim().toLowerCase()) ? cand.label.slice(edit.val.trim().length) : \"\";\n        if (ghost !== \"\") {\n            const take = e.meta ? ghost : ghostWord(ghost);\n            return { state: { ...s, edit: { ...edit, val: edit.val + take } }, effects: [] };\n        }\n    }\n    if (e.meta && e.key === \"ArrowRight\" && edit.val.trim() === \"\") {\n        // The whole predicted remainder of the half in one press.\n        const rest = linkCtx.predicted(link.side, link.groups, edit.val);\n        if (rest.length > 0) {\n            const groups: LinkGroups = [[...link.groups[0]], [...link.groups[1]]];\n            groups[link.side] = groups[link.side].concat(rest);\n            return { state: { ...s, msg: { id: \"predictedTaken\", n: rest.length }, edit: { ...edit, link: { ...link, groups } } }, effects: [{ t: \"schedule.suggest\", latency: \"instant\" }] };\n        }\n    }\n    // Plain arrows at the edge of an empty buffer cross the divider.\n    if (e.key === \"ArrowRight\" && edit.val === \"\" && !e.meta && link.side === 0 && linkCtx.halves.to.live) return switchSide(s, 1, ctx);\n    if (e.key === \"ArrowLeft\" && edit.val === \"\" && link.chipSel === null && link.side === 1) return switchSide(s, 0, ctx);\n    return { state: s, effects: [] };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The copilot's transitions (B§5 — `Sheet Spec.md` §5 rows 10–13): what the\n * runner's results do to the state, the ⇥ walk over pending fills (first\n * press arms the next target, the next writes it and arms the following),\n * ⏎ taking the next suggestion, ⌘⏎ / ⌘⇧⏎ the row fill and everything, the\n * esc rungs (a selected proposal → the row fill → every suggestion), ⌫\n * rejecting the armed fill or the selected proposal — and the memory of what\n * was rejected. Pure functions over the machine state.\n *\n * @packageDocumentation\n */\n\nimport {\n    same,\n    type CellRef, type PendingFill, type PendingRow, type SheetEffect, type SheetEvent, type SheetMachineCtx, type SheetUiState, type Suggestions, type Transition,\n} from \"./sheet-types.js\";\nimport type { SheetCellValue } from \"./values.js\";\n\nconst none = (s: SheetUiState): Transition => ({ state: s, effects: [] });\n\n/** The pending fills in column order — the order ⇥ walks. */\nexport function fillOrder(sugg: Suggestions | null, ctx: SheetMachineCtx): { key: string; c: number }[] {\n    if (sugg === null || ctx.columnOf === undefined) return [];\n    const out: { key: string; c: number }[] = [];\n    for (const key of sugg.fill.keys()) {\n        const c = ctx.columnOf(key);\n        if (c !== undefined) out.push({ key, c });\n    }\n    return out.sort((a, b) => a.c - b.c);\n}\n\n/** The anchor's row-space index, if it is still on the sheet. */\nexport function anchorRow(sugg: Suggestions | null, ctx: SheetMachineCtx): number | undefined {\n    return sugg === null || ctx.rowOf === undefined ? undefined : ctx.rowOf(sugg.anchorId);\n}\n\n/** The one cell a ⇥ press writes next — exactly one, ever: the armed fill, else the first (last, walking back). */\nexport function nextTargetOf(s: SheetUiState, ctx: SheetMachineCtx, back = false): (CellRef & { key: string }) | null {\n    const order = fillOrder(s.sugg, ctx);\n    if (order.length === 0) return null;\n    const r = anchorRow(s.sugg, ctx);\n    if (r === undefined) return null;\n    if (s.armed !== null && s.armed.r === r) {\n        const hit = order.find((o) => o.c === s.armed!.c);\n        if (hit !== undefined) return { r, c: hit.c, key: hit.key };\n    }\n    const o = back ? order[order.length - 1]! : order[0]!;\n    return { r, c: o.c, key: o.key };\n}\n\n/** The suggestions minus one fill — `null` once nothing is pending. */\nfunction withoutFill(sugg: Suggestions, key: string): Suggestions | null {\n    const fill = new Map(sugg.fill);\n    fill.delete(key);\n    if (fill.size === 0 && sugg.rows.length === 0 && sugg.pending.length === 0) return null;\n    return { ...sugg, fill };\n}\n\n/** The text a proposal's driver cell carries (its activity), for the messages. */\nfunction driverText(cells: ReadonlyMap<string, SheetCellValue>, ctx: SheetMachineCtx): string {\n    const cell = ctx.driverColumn !== undefined ? cells.get(ctx.driverColumn) : undefined;\n    return cell !== undefined && cell.type === \"String\" ? cell.value : \"\";\n}\n\n/** Take one fill: write it, then arm the following target so the next ⇥ writes that one. */\nexport function takeFill(s: SheetUiState, ctx: SheetMachineCtx, key: string, back = false): Transition {\n    const sugg = s.sugg;\n    if (sugg === null) return none(s);\n    const f = sugg.fill.get(key);\n    const r = anchorRow(sugg, ctx);\n    const c = ctx.columnOf?.(key);\n    if (f === undefined || r === undefined || c === undefined) return none(s);\n    const effects: SheetEffect[] = [{ t: \"write.many\", r, writes: [{ c, cell: f.cell }], source: \"fill\" }];\n    let next: SheetUiState = { ...s, sugg: withoutFill(sugg, key), armed: null, gsel: null, msg: { id: \"fillTaken\", column: key, meta: f.meta === \"\" ? undefined : f.meta } };\n    const nt = nextTargetOf(next, ctx, back);\n    if (nt !== null) {\n        next = { ...next, sel: { r: nt.r, c: nt.c }, selEnd: null, armed: { r: nt.r, c: nt.c } };\n        effects.push({ t: \"emit.select\", r: nt.r, c: nt.c });\n    }\n    return { state: next, effects };\n}\n\n/** Fill the whole row in one step (⌘⏎, the gutter's →). */\nexport function fillRow(s: SheetUiState, ctx: SheetMachineCtx): Transition {\n    const sugg = s.sugg;\n    if (sugg === null || sugg.fill.size === 0) return none(s);\n    const r = anchorRow(sugg, ctx);\n    if (r === undefined) return none(s);\n    const writes = fillOrder(sugg, ctx).map((o) => ({ c: o.c, cell: sugg.fill.get(o.key)!.cell }));\n    if (writes.length === 0) return none(s);\n    const rest: Suggestions | null = sugg.rows.length > 0 || sugg.pending.length > 0 ? { ...sugg, fill: new Map() } : null;\n    const n = writes.length;\n    return {\n        state: { ...s, sugg: rest, armed: null, gsel: null, msg: { id: \"rowFilled\", n, row: ctx.rowRefAt?.(r) ?? { line: false, number: ctx.numberAt?.(r) ?? r + 1 } } },\n        effects: [{ t: \"write.many\", r, writes, source: \"row\" }],\n    };\n}\n\n/**\n * Take the proposals up to `upTo` (inclusive) — the row fill first, then the\n * rows in order; the rest re-anchor on the last row inserted so the next one\n * is already waiting (B§5.2).\n */\nexport function takeProposals(s: SheetUiState, ctx: SheetMachineCtx, upTo: number): Transition {\n    const sugg = s.sugg;\n    if (sugg === null) return none(s);\n    const r = anchorRow(sugg, ctx);\n    if (r === undefined) return none(s);\n    let next = s;\n    const effects: SheetEffect[] = [];\n    if (sugg.fill.size > 0) {\n        const filled = fillRow(s, ctx);\n        next = filled.state;\n        for (const effect of filled.effects) effects.push(effect);\n    }\n    const rows: readonly PendingRow[] = sugg.rows.slice(0, Math.max(0, upTo + 1));\n    const rest: readonly PendingRow[] = sugg.rows.slice(rows.length);\n    if (rows.length === 0) return { state: { ...next, gsel: null }, effects };\n    effects.push({ t: \"insert.rows\", anchorR: r, rows, rest });\n    const label = driverText(rows[0]!.cells, ctx);\n    return {\n        state: {\n            ...next, sugg: null, armed: null, gsel: null, selEnd: null,\n            msg: { id: \"proposalTaken\", label: label === \"\" ? undefined : label, more: rest.length > 0 },\n        },\n        effects,\n    };\n}\n\n/** Reject a proposal — and remember the pairing so it is not offered after that driver value again. */\nexport function rejectProposal(s: SheetUiState, ctx: SheetMachineCtx, i: number): Transition {\n    const sugg = s.sugg;\n    const row = sugg?.rows[i];\n    if (sugg === null || sugg === undefined || row === undefined) return none(s);\n    const r = anchorRow(sugg, ctx);\n    const from = r !== undefined ? ctx.driverKeyAt?.(r) ?? \"\" : \"\";\n    const to = driverText(row.cells, ctx);\n    const follows = new Set(s.rejected.follows);\n    if (from !== \"\" && to !== \"\") follows.add(`${from}>${to}`);\n    const rows = sugg.rows.filter((_x, n) => n !== i);\n    const rest: Suggestions | null = rows.length > 0 || sugg.fill.size > 0 || sugg.pending.length > 0 ? { ...sugg, rows } : null;\n    return {\n        state: {\n            ...s, gsel: null, sugg: rest, rejected: { ...s.rejected, follows },\n            msg: { id: \"proposalRejected\", to: to === \"\" ? undefined : to, from: from === \"\" ? undefined : from },\n        },\n        effects: [],\n    };\n}\n\n/** Dismiss one fill — remembered per row and key. */\nexport function rejectFill(s: SheetUiState, ctx: SheetMachineCtx, key: string): Transition {\n    const sugg = s.sugg;\n    if (sugg === null || !sugg.fill.has(key)) return none(s);\n    const fills = new Set(s.rejected.fills);\n    fills.add(`${sugg.anchorId}|${key}`);\n    void ctx;\n    return {\n        state: { ...s, sugg: withoutFill(sugg, key), armed: null, rejected: { ...s.rejected, fills }, msg: { id: \"fillDismissed\", column: key } },\n        effects: [],\n    };\n}\n\n/** The runner's result lands — for an anchor still on the sheet. */\nexport function applyReady(s: SheetUiState, ctx: SheetMachineCtx, anchorId: string, sugg: Suggestions | null): Transition {\n    if (ctx.rowOf?.(anchorId) === undefined) return none(s);\n    if (sugg !== null && sugg.anchorId !== anchorId) return none(s);\n    if (s.sugg === null && sugg === null) return none(s);\n    // The armed target survives when the new result still fills that cell.\n    const next: SheetUiState = { ...s, sugg, gsel: null };\n    const keep = s.armed !== null && nextTargetOf(next, ctx) !== null && same(s.armed, nextTargetOf(next, ctx));\n    return { state: keep ? next : { ...next, armed: null }, effects: [] };\n}\n\n/** An async provider settled — merged when its anchor and key are still pending. */\nexport function applyLanded(s: SheetUiState, e: Extract<SheetEvent, { t: \"suggest.landed\" }>): Transition {\n    const sugg = s.sugg;\n    if (sugg === null || sugg.anchorId !== e.anchorId || !sugg.pending.includes(e.key)) return none(s);\n    const pending = sugg.pending.filter((k) => k !== e.key);\n    let fill: ReadonlyMap<string, PendingFill> = sugg.fill;\n    let rows = sugg.rows;\n    if (e.key !== \"rows\" && e.fill !== undefined && e.fill !== null && !s.rejected.fills.has(`${sugg.anchorId}|${e.key}`)) {\n        const cur = fill.get(e.key);\n        // An earlier provider that lands outranks a later one's fill (first that yields wins, by position).\n        if (cur === undefined || e.fill.index < cur.index) {\n            const next = new Map(fill);\n            next.set(e.key, e.fill);\n            fill = next;\n        }\n    }\n    if (e.key === \"rows\" && e.rows !== undefined && e.rows.length > 0 && rows.length === 0) rows = e.rows;\n    const next: Suggestions | null = fill.size === 0 && rows.length === 0 && pending.length === 0 ? null : { ...sugg, fill, rows, pending };\n    return { state: { ...s, sugg: next }, effects: [] };\n}\n\n/** The anchor became a real row: the suggestions follow its new id. */\nexport function rekeySuggest(s: SheetUiState, from: string, to: string): SheetUiState {\n    if (s.sugg === null || s.sugg.anchorId !== from) return s;\n    const fills = new Set<string>();\n    for (const f of s.rejected.fills) fills.add(f.startsWith(`${from}|`) ? `${to}|${f.slice(from.length + 1)}` : f);\n    return { ...s, sugg: { ...s.sugg, anchorId: to }, rejected: { ...s.rejected, fills } };\n}\n\n/** Every suggestion dropped. */\nexport function clearSuggest(s: SheetUiState): SheetUiState {\n    if (s.sugg === null && s.armed === null && s.gsel === null) return s;\n    return { ...s, sugg: null, armed: null, gsel: null };\n}\n\n/** The rows changed: a suggestion whose anchor left the sheet goes with it; the proposal selection clamps. */\nexport function afterRowsChanged(s: SheetUiState, ctx: SheetMachineCtx): SheetUiState {\n    if (s.sugg === null) return s.gsel === null ? s : { ...s, gsel: null };\n    if (anchorRow(s.sugg, ctx) === undefined) return { ...s, sugg: null, armed: null, gsel: null };\n    if (s.gsel !== null && s.gsel >= s.sugg.rows.length) return { ...s, gsel: null };\n    return s;\n}\n\n/** The esc rungs the copilot adds: a selected proposal → the row fill (rows stay) → everything. `null` = nothing to drop. */\nexport function escSuggest(s: SheetUiState): Transition | null {\n    if (s.gsel !== null) return { state: { ...s, gsel: null, msg: { id: \"proposalDeselected\" } }, effects: [] };\n    if (s.sugg === null) return null;\n    if (s.sugg.fill.size > 0 && s.sugg.rows.length > 0) {\n        return { state: { ...s, sugg: { ...s.sugg, fill: new Map() }, armed: null, msg: { id: \"rowFillDismissed\" } }, effects: [] };\n    }\n    return { state: { ...s, sugg: null, armed: null, selEnd: null }, effects: [] };\n}\n\n/**\n * The sheet keys the copilot claims while something is pending (B§6): ⇥ walks\n * the fills then takes rows, ⏎ takes the next suggestion, ⌘⏎ the row fill,\n * ⌘⇧⏎ everything, ⌫ rejects the armed fill or the selected proposal. `null`\n * hands the key back to the sheet.\n */\nexport function suggestKey(s: SheetUiState, e: Extract<SheetEvent, { t: \"key\" }>, ctx: SheetMachineCtx): Transition | null {\n    if (e.key === \"Tab\") {\n        const nt = nextTargetOf(s, ctx, e.shift);\n        if (nt !== null) {\n            const onIt = s.armed !== null && same(s.armed, nt) && same(s.sel, nt);\n            if (onIt) return takeFill(s, ctx, nt.key, e.shift);\n            return {\n                state: { ...s, sel: { r: nt.r, c: nt.c }, selEnd: null, armed: { r: nt.r, c: nt.c }, gsel: null },\n                effects: [{ t: \"emit.select\", r: nt.r, c: nt.c }, { t: \"scroll.to\", r: nt.r }],\n            };\n        }\n        if (s.sugg !== null && s.sugg.rows.length > 0) return takeProposals(s, ctx, 0);\n        return null;\n    }\n    if (e.key === \"Enter\") {\n        if (e.meta && e.shift) return s.sugg === null ? none(s) : takeProposals(s, ctx, s.sugg.rows.length - 1);\n        if (e.meta) return s.sugg !== null && s.sugg.fill.size > 0 ? fillRow(s, ctx) : none(s);\n        if (s.gsel !== null) return takeProposals(s, ctx, s.gsel);\n        if (s.sugg !== null && s.sugg.fill.size > 0) return fillRow(s, ctx);\n        if (s.sugg !== null && s.sugg.rows.length > 0) return takeProposals(s, ctx, 0);\n        return null;\n    }\n    if ((e.key === \"Backspace\" || e.key === \"Delete\") && !e.meta) {\n        if (s.gsel !== null) return rejectProposal(s, ctx, s.gsel);\n        if (s.armed !== null) {\n            const nt = nextTargetOf(s, ctx);\n            if (nt !== null && same(s.sel, nt) && same(s.armed, nt)) return rejectFill(s, ctx, nt.key);\n        }\n        return null;\n    }\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The lens (B§8, `Sheet Spec.md` §3.8 / §6.3, #1349) — the `rows` source's\n * narrowing applied to the record's rows as a filtered spreadsheet applies its\n * filter: only the rows the narrowing holds show, one after another in the\n * record's order, each keeping its row number. e3 decides which rows the\n * narrowing holds, from the source's index (`lens-layout.ts` lays them out);\n * this module holds the parts that need no record: the count line, a view's\n * name and the tab fold.\n *\n * Pure: no React, no DOM.\n *\n * @packageDocumentation\n */\n\nimport { sheetMessages } from \"./messages.js\";\nimport type { SheetWords } from \"./words.js\";\n\n/**\n * The `n matches` line, in the sheet's words — its count in the app's locale\n * (#850, #861).\n *\n * @param matches - The rows the narrowing holds\n * @param words - The sheet's words\n * @returns The line\n */\nexport function lensCount(matches: number, words: SheetWords): string {\n    return words.m.lensCount({ n: matches, count: words.number(matches) });\n}\n\n/**\n * A view's name from its query (B§8): the query to 16 characters, else the\n * sheet's words for an unnamed view — `view n` in English (#861). The name is\n * stored with the view.\n *\n * @param query - The query the view saves\n * @param seq - The view's number\n * @param unnamed - The sheet's name for a view with no query; English when omitted\n * @returns The name\n */\nexport function viewName(query: string, seq: number, unnamed?: ((seq: number) => string) | undefined): string {\n    const q = query.trim();\n    if (q === \"\") return unnamed !== undefined ? unnamed(seq) : sheetMessages.viewName({ seq: String(seq) });\n    return q.length > 16 ? `${q.slice(0, 15)}…` : q;\n}\n\n/**\n * The tabs that stay visible when `folded` of them must hide under width\n * pressure (B§8): the first ones in order, the active tab always kept — it\n * takes the last visible slot when it would otherwise fold. The hidden tabs\n * ride the `+n` menu, in order.\n *\n * @param views - Every view, in order\n * @param active - The active view's id (`null` = the whole sheet)\n * @param folded - How many tabs must hide\n * @returns The visible and the hidden views\n */\nexport function foldTabs<T extends { id: string }>(views: readonly T[], active: string | null, folded: number): { visible: T[]; hidden: T[] } {\n    const keep = Math.max(0, views.length - Math.max(0, folded));\n    const activeIdx = active === null ? -1 : views.findIndex((v) => v.id === active);\n    if (activeIdx < 0 || activeIdx < keep) return { visible: views.slice(0, keep), hidden: views.slice(keep) };\n    const head = views.slice(0, Math.max(0, keep - 1));\n    return { visible: [...head, views[activeIdx]!], hidden: views.filter((_v, i) => i >= head.length && i !== activeIdx) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The view tabs' transitions (B§8 — `Sheet Spec.md` §5 rows 16–17): a tab\n * switch that persists the leaving tab's folds and writes the target's\n * narrowing into the slice; `+ TAB` snapshotting the current narrowing; ⏎\n * updating and esc reverting a dirty tab; close, rename and reorder; the\n * search box's keys; and a narrowing that changed underneath the sheet. Pure\n * functions over the machine state — the views and the slice's narrowing\n * arrive with the context, and every write leaves as an effect (`emit.views`,\n * `slice.write`).\n *\n * @packageDocumentation\n */\n\nimport { clearSearch, narrowingQuery } from \"./view-state.js\";\nimport { viewName } from \"./lens.js\";\nimport { NO_FOLDS, clamp, same, type SheetEffect, type SheetMachineCtx, type SheetUiState, type Transition } from \"./sheet-types.js\";\nimport type { SheetSavedView } from \"./values.js\";\n\nconst noop = (s: SheetUiState): Transition => ({ state: s, effects: [] });\n\n/** The fold overrides as the wire carries them (#740). */\nfunction wireFolds(folds: ReadonlyMap<string, boolean>): Map<string, boolean> {\n    return new Map([...folds].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)));\n}\n\n/** Whether two fold maps are the same. */\nfunction sameFolds(a: ReadonlyMap<string, boolean>, b: ReadonlyMap<string, boolean>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [k, v] of a) if (b.get(k) !== v) return false;\n    return true;\n}\n\n/** A view's folds, as the sheet opens it with them. */\nfunction foldsOf(view: SheetSavedView): ReadonlyMap<string, boolean> {\n    return view.folds.size === 0 ? NO_FOLDS : new Map(view.folds);\n}\n\n/** The active view, if any. */\nfunction activeView(s: SheetUiState, ctx: SheetMachineCtx): SheetSavedView | undefined {\n    return s.tabs.active === null ? undefined : (ctx.views ?? []).find((v) => v.id === s.tabs.active);\n}\n\n/**\n * The views with the active tab's folds persisted; an unsaved narrowing is\n * discarded on leave (B§8). The same array comes back when nothing changed.\n *\n * @param s - The state\n * @param views - The views\n * @returns The views, the active one's folds as they stand\n */\nexport function persistFolds(s: SheetUiState, views: readonly SheetSavedView[]): readonly SheetSavedView[] {\n    const a = s.tabs.active;\n    if (a === null) return views;\n    let changed = false;\n    const out = views.map((v) => {\n        if (v.id !== a || sameFolds(v.folds, s.folds)) return v;\n        changed = true;\n        return { ...v, folds: wireFolds(s.folds) };\n    });\n    return changed ? out : views;\n}\n\n/**\n * The narrowing changed underneath: the range and the proposal pick drop, and the ring returns to the top — a ring not\n * placed yet stays unplaced, and reports nothing (#1531).\n */\nexport function narrowed(s: SheetUiState, ctx: SheetMachineCtx): Transition {\n    const sel = clamp({ r: 0, c: s.sel.c }, ctx);\n    const effects: SheetEffect[] = [];\n    if (!s.ringless && !same(sel, s.sel)) effects.push({ t: \"emit.select\", r: sel.r, c: sel.c });\n    return { state: { ...s, sel, selEnd: null, gsel: null, armed: null }, effects };\n}\n\n// ── The tabs ──────────────────────────────────────────────────────────────\n\n/**\n * Pick a tab (`null` = the whole sheet): the leaving tab keeps its folds, the\n * target's narrowing goes into the slice, its folds come back, and the ring\n * returns to the top.\n *\n * @param s - The state\n * @param ctx - The context (its `views`, `emptyNarrowing`)\n * @param id - The view to open, or `null`\n * @param persist - Whether the leaving tab's folds are written back (the initial open passes `false`)\n * @returns The transition\n */\nexport function switchTab(s: SheetUiState, ctx: SheetMachineCtx, id: string | null, persist = true): Transition {\n    const views = ctx.views ?? [];\n    const kept = persist ? persistFolds(s, views) : views;\n    const view = id === null ? undefined : kept.find((v) => v.id === id);\n    if (id !== null && view === undefined) return noop(s);\n    const effects: SheetEffect[] = [];\n    if (kept !== views) effects.push({ t: \"emit.views\", views: kept });\n    const narrowing = view !== undefined ? view.narrowing : ctx.emptyNarrowing;\n    if (narrowing !== undefined) effects.push({ t: \"slice.write\", state: narrowing });\n    const sel = clamp({ r: 0, c: s.sel.c }, ctx);\n    // A ring not placed yet stays unplaced, and reports nothing (#1531).\n    if (!s.ringless && !same(sel, s.sel)) effects.push({ t: \"emit.select\", r: sel.r, c: sel.c });\n    effects.push({ t: \"focus.sheet\" });\n    return {\n        state: {\n            ...s,\n            tabs: { ...s.tabs, active: id, renaming: null, renameVal: \"\" },\n            folds: view !== undefined ? foldsOf(view) : NO_FOLDS,\n            sel, selEnd: null, gsel: null, armed: null,\n        },\n        effects,\n    };\n}\n\n/** `+ TAB` — the current narrowing and folds become a view, named from the query. */\nexport function createTab(s: SheetUiState, ctx: SheetMachineCtx): Transition {\n    const narrowing = ctx.narrowing;\n    if (narrowing === undefined) return noop(s);\n    const kept = persistFolds(s, ctx.views ?? []);\n    const query = narrowingQuery(narrowing);\n    let seq = s.tabs.seq;\n    let id = `view-${seq}`;\n    while (kept.some((v) => v.id === id)) { seq += 1; id = `view-${seq}`; }\n    const name = viewName(query, seq, ctx.viewName);\n    const view: SheetSavedView = { id, name, narrowing, folds: wireFolds(s.folds) };\n    return {\n        state: { ...s, tabs: { ...s.tabs, active: id, seq: seq + 1, renaming: null, renameVal: \"\" }, msg: { id: \"tabSaved\", name, query: query.trim() !== \"\" } },\n        effects: [{ t: \"emit.views\", views: [...kept, view] }],\n    };\n}\n\n/** × or a middle click — closing the active tab falls back to the whole sheet. */\nexport function closeTab(s: SheetUiState, ctx: SheetMachineCtx, id: string): Transition {\n    const views = ctx.views ?? [];\n    const t = views.find((v) => v.id === id);\n    if (t === undefined) return noop(s);\n    const rest = views.filter((v) => v.id !== id);\n    if (s.tabs.active !== id) return { state: { ...s, msg: { id: \"tabClosed\", name: t.name, active: false } }, effects: [{ t: \"emit.views\", views: rest }] };\n    const effects: SheetEffect[] = [{ t: \"emit.views\", views: rest }];\n    if (ctx.emptyNarrowing !== undefined) effects.push({ t: \"slice.write\", state: ctx.emptyNarrowing });\n    return {\n        state: { ...s, tabs: { ...s.tabs, active: null, renaming: null, renameVal: \"\" }, folds: NO_FOLDS, selEnd: null, gsel: null, msg: { id: \"tabClosed\", name: t.name, active: true } },\n        effects,\n    };\n}\n\n/** ⏎ with a dirty tab: the tab now saves the current narrowing (and the folds as they stand). */\nexport function updateTab(s: SheetUiState, ctx: SheetMachineCtx): Transition {\n    const t = activeView(s, ctx);\n    const narrowing = ctx.narrowing;\n    if (t === undefined || narrowing === undefined) return noop(s);\n    const views = (ctx.views ?? []).map((v) => (v.id === t.id ? { ...v, narrowing, folds: wireFolds(s.folds) } : v));\n    return { state: { ...s, msg: { id: \"tabUpdated\", name: t.name } }, effects: [{ t: \"emit.views\", views }] };\n}\n\n/** esc with a dirty tab: the slice returns to the tab's saved narrowing, the folds to its saved ones. */\nexport function revertTab(s: SheetUiState, ctx: SheetMachineCtx): Transition {\n    const t = activeView(s, ctx);\n    if (t === undefined) return noop(s);\n    return { state: { ...s, folds: foldsOf(t), msg: { id: \"tabReverted\" } }, effects: [{ t: \"slice.write\", state: t.narrowing }] };\n}\n\n/** A double click on a tab opens its name for editing. */\nexport function renameStart(s: SheetUiState, ctx: SheetMachineCtx, id: string): SheetUiState {\n    const t = (ctx.views ?? []).find((v) => v.id === id);\n    if (t === undefined) return s;\n    return { ...s, tabs: { ...s.tabs, renaming: id, renameVal: t.name } };\n}\n\n/** The rename buffer. */\nexport function renameChange(s: SheetUiState, val: string): SheetUiState {\n    if (s.tabs.renaming === null) return s;\n    return { ...s, tabs: { ...s.tabs, renameVal: val } };\n}\n\n/** ⏎ or a blur commits the rename — an empty name keeps the old one. */\nexport function renameCommit(s: SheetUiState, ctx: SheetMachineCtx): Transition {\n    const id = s.tabs.renaming;\n    if (id === null) return noop(s);\n    const name = s.tabs.renameVal.trim();\n    const state: SheetUiState = { ...s, tabs: { ...s.tabs, renaming: null, renameVal: \"\" } };\n    const views = ctx.views ?? [];\n    const t = views.find((v) => v.id === id);\n    if (t === undefined || name === \"\" || name === t.name) return { state, effects: [] };\n    return { state, effects: [{ t: \"emit.views\", views: views.map((v) => (v.id === id ? { ...v, name } : v)) }] };\n}\n\n/** esc drops the rename. */\nexport function renameCancel(s: SheetUiState): SheetUiState {\n    if (s.tabs.renaming === null) return s;\n    return { ...s, tabs: { ...s.tabs, renaming: null, renameVal: \"\" } };\n}\n\n/** A tab dropped before the tab at `to`. */\nexport function reorderTab(s: SheetUiState, ctx: SheetMachineCtx, id: string, to: number): Transition {\n    const views = [...(ctx.views ?? [])];\n    const fi = views.findIndex((v) => v.id === id);\n    if (fi < 0) return noop(s);\n    const moved = views.splice(fi, 1)[0]!;\n    const at = Math.max(0, Math.min(fi < to ? to - 1 : to, views.length));\n    views.splice(at, 0, moved);\n    if (at === fi) return noop(s);\n    return { state: s, effects: [{ t: \"emit.views\", views }] };\n}\n\n/** The tab rungs of the esc ladder: a dirty tab reverts, a clean tab returns to the sheet; `null` = no tab to act on. */\nexport function escTabs(s: SheetUiState, ctx: SheetMachineCtx): Transition | null {\n    if (s.tabs.active === null) return null;\n    return ctx.dirty === true ? revertTab(s, ctx) : switchTab(s, ctx, null);\n}\n\n/**\n * A key in the rail's search box (B§8): ⏎ updates a dirty tab; esc reverts a\n * dirty tab, returns a clean tab to the sheet, or clears the search on the\n * whole sheet. Both hand the focus back to the sheet. `null` = not claimed.\n */\nexport function searchKey(s: SheetUiState, ctx: SheetMachineCtx, key: string): Transition | null {\n    if (key === \"Enter\") {\n        const t = s.tabs.active !== null && ctx.dirty === true ? updateTab(s, ctx) : noop(s);\n        return { state: t.state, effects: [...t.effects, { t: \"focus.sheet\" }] };\n    }\n    if (key === \"Escape\") {\n        const rung = escTabs(s, ctx);\n        if (rung !== null) return { state: rung.state, effects: [...rung.effects, { t: \"focus.sheet\" }] };\n        const effects: SheetEffect[] = [];\n        if (ctx.narrowing !== undefined && narrowingQuery(ctx.narrowing) !== \"\") {\n            effects.push({ t: \"slice.write\", state: clearSearch(ctx.narrowing) });\n        }\n        effects.push({ t: \"focus.sheet\" });\n        return { state: s, effects };\n    }\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * THE Sheet state machine (`Sheet Spec.md` §6.1) — every piece of interaction\n * state in one pure reducer: the selection ring and range, the edit buffer,\n * hover, the footer message, the copilot's pending suggestions. No React, no\n * DOM, no East calls: what a transition needs to know about the sheet (row\n * and column counts, which cells are editable, how a buffer parses, the\n * candidates) arrives as a {@link SheetMachineCtx} with the event, and\n * everything that touches data or the host leaves as an effect the component\n * runs.\n *\n * The vocabulary lives in `sheet-types.ts`; the link editor's transitions in\n * `sheet-link-state.ts`; the copilot's in `sheet-suggest-state.ts`; the view\n * tabs' in `sheet-tabs-state.ts`.\n *\n * Non-negotiable transition rules (unit-tested as a table in\n * `sheet-state.test.ts`):\n *\n * - **Esc ladder**, one rung per press: editor → chip selection → a selected\n *   proposal → the row fill (rows stay) → every suggestion → range → a dirty\n *   tab reverts → a clean tab returns to the sheet.\n * - **The slice owns the query**: the reducer never stores it; a narrowing\n *   change returns the ring to the top; a tab switch is a `slice.write`\n *   effect; tabs never own rows.\n * - **Tab ladder** (B§4.4 / B§6): the inline ghost or armed candidate → one\n *   predicted chip → hop From → To (a locked half is skipped) → commit right;\n *   with fills pending and no editor: arm the next target, then write it and\n *   arm the following; rows pending: take the next.\n * - **Commit directions** — Tab right, ⇧Tab left, ⏎ / ↓ down (↓ on the last\n *   row appends unless a lens is active or the source is unexhausted), ↑ /\n *   blur stay; an unparseable value becomes an invalid draft carrying the\n *   original input, so it remains visible and undoable after leaving the cell.\n * - **The key map (#860)** — Home / End go to the row's first or last column\n *   and ⌘Home / ⌘End to the sheet's first or last cell (the last row that is\n *   not blank padding); PageUp / PageDown move a page of rows; ⇧ stretches a\n *   range instead. On a paged sheet ↓ past the last resident row, ↑ above the\n *   first, a page past either (#1398, CL10) and ⌘Home / ⌘End toward an end\n *   not yet resident ask the component for the window there (`seek.step`,\n *   `seek.edge`) — the ring lands once it arrives.\n * - **An unchanged buffer writes nothing** (#852): an editor closed on the\n *   text it opened with commits no write — nor takes a ghost when it was\n *   never touched — so opening a cell and pressing ⏎ never changes it.\n * - **A register member is typed in the words its cell shows** (#1536): the\n *   editor opens on its label; a member a gesture chooses — the cell's own as\n *   it opens, a menu option, a strip chip, a candidate ⇥ or ⌘→ takes —\n *   commits as itself, by its key, so two members who show one label are told\n *   apart; typed words commit to the member they name whole, else the best\n *   candidate. Back on the cell's own member, nothing is written.\n * - **A printable key seeds a fresh edit**; ⏎ / F2 edit with the value\n *   selected (⏎ takes a pending suggestion first); esc cancels.\n * - **A double press opens the editor, never again over it**: on the cell an\n *   editor is open on it keeps the edit as it stands.\n * - **Whole rows selected + ⌫ deletes the records**; ⌫ on cells clears them\n *   (never a stamped column — the component skips those); ⌫ on the armed\n *   fill or the selected proposal rejects it and remembers.\n * - **Cells that step in place (#1531)** — a Record's cycle, toggle and\n *   boolean: a press, Space or ⏎ takes the next state (⇧ the one before),\n *   ⌫ a cycle's first and a member's key sets it; none opens an editor — a\n *   cycle over no members neither. One no step reaches — an owned row's, a\n *   read-only one, a locked one, that cycle — takes a ⇧ press as any other\n *   cell does: the range stretches to it. A\n *   cell that edits out of place — a Record's title — opens through the host\n *   on a press, ⏎ or F2. A grid a host draws opens with no ring: a press\n *   places it, or the first move key, on the first row's first cell that\n *   edits in place.\n * - **Grouped rows (#740)**: arrows land on a band like a row; Space or the\n *   chevron folds it; the summary gutter selects its children. Insertion\n *   uses explicit controls. A lens over a grouped sheet narrows its groups,\n *   the records (#1349). A line with SUB ROWS takes Space the way a band\n *   does: they show or hide (⇧Space: every line of the group); the ring\n *   never lands on a sub row.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, variant } from \"@elaraai/east\";\nimport { ghostFor, ghostWord, resolveFor } from \"./candidates.js\";\nimport type { SheetKind } from \"./model.js\";\nimport {\n    same, clamp, selectionRect, wholeRows, initialSheetState,\n    type CellRef, type CommitDir, type EditBuffer, type LinkGroups, type SheetEffect, type SheetEvent, type SheetMachineCtx, type SheetNotice, type SheetUiState, type Transition,\n} from \"./sheet-types.js\";\nimport { linkStartSide, withBuffer, linkChange, linkKey, switchSide } from \"./sheet-link-state.js\";\nimport {\n    suggestKey, escSuggest, fillRow, takeFill, takeProposals, rejectProposal, applyReady, applyLanded, rekeySuggest, clearSuggest, afterRowsChanged,\n} from \"./sheet-suggest-state.js\";\nimport {\n    narrowed, switchTab, createTab, closeTab, updateTab, revertTab,\n    renameStart, renameChange, renameCommit, renameCancel, reorderTab, escTabs, searchKey,\n} from \"./sheet-tabs-state.js\";\nimport type { SheetCellValue } from \"./values.js\";\n\nexport * from \"./sheet-types.js\";\nexport { nextTargetOf, fillOrder, anchorRow } from \"./sheet-suggest-state.js\";\nexport { withBuffer } from \"./sheet-link-state.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** The register kinds — where ⌥ cycles candidates and Tab takes the ghost. */\nfunction isRegisterKind(kind: SheetKind): boolean {\n    return kind === \"lookup\" || kind === \"reference\" || kind === \"enum\" || kind === \"person\";\n}\n\n/**\n * The buffer once a gesture has chosen a register member (#1536): the words\n * it shows typed, the member armed among their candidates — what the strip,\n * the menu and the badge show — and its key what the commit writes.\n */\nfunction withPick(edit: EditBuffer, val: string, key: string, ctx: SheetMachineCtx): EditBuffer {\n    const hi = ctx.candidates(edit.r, edit.c, val).findIndex((cand) => stringEqual(cand.key, key));\n    return { ...edit, val, err: false, hi, pick: key };\n}\n\n/**\n * Move the ring to `to`, dropping the range, and place it where none was\n * (#1531); reports the move. A keyboard move scrolls the row into view; a\n * pointer move never does — the cell is under the pointer already, and moving\n * the sheet under a held button would read as a drag. Where the strip\n * previews the cell under the pointer, a keyboard move lets the hover go, so\n * the strip follows the ring.\n */\nfunction moveTo(s: SheetUiState, to: CellRef, ctx: SheetMachineCtx, effects: SheetEffect[], scroll = true): SheetUiState {\n    const next = clamp(to, ctx);\n    if (!s.ringless && same(next, s.sel) && s.selEnd === null) return s;\n    effects.push({ t: \"emit.select\", r: next.r, c: next.c });\n    if (scroll) effects.push({ t: \"scroll.to\", r: next.r });\n    const hover = scroll && ctx.previewsHover === true ? null : s.hover;\n    return { ...s, sel: next, selEnd: null, ringless: false, hover };\n}\n\n/** Where the first move key places the ring when none is placed (#1531): the first row's first cell that edits in place, else its first. */\nfunction firstPlace(ctx: SheetMachineCtx): CellRef {\n    for (let c = 0; c < ctx.colCount; c++) {\n        if (ctx.editableAt(0, c) && ctx.opensAt?.(0, c) !== true) return { r: 0, c };\n    }\n    return { r: 0, c: 0 };\n}\n\n/** The keys that move the ring — what places it when none is placed (#1531). */\nconst MOVE_KEYS: ReadonlySet<string> = new Set([\"ArrowDown\", \"ArrowUp\", \"ArrowLeft\", \"ArrowRight\", \"Home\", \"End\", \"PageDown\", \"PageUp\", \"Tab\"]);\n\n/** The column one step left or right of a cell — past the whole span of a band's title (#740). */\nfunction stepColumn(r: number, c: number, dir: 1 | -1, ctx: SheetMachineCtx): number {\n    const span = ctx.spanAt?.(r, c);\n    if (span === undefined) return c + dir;\n    return dir > 0 ? span.c1 + 1 : span.c0 - 1;\n}\n\n/** Open the editor on a cell — `seed` is a printable key that starts a fresh edit. */\nfunction startEdit(s: SheetUiState, r: number, c: number, seed: string | undefined, ctx: SheetMachineCtx): Transition {\n    if (r < 0 || r >= ctx.rowCount || c < 0 || c >= ctx.colCount) return { state: s, effects: [] };\n    // A cell that steps in place — a step to take or none — or edits out of place, never opens an editor (#1531).\n    if (!ctx.editableAt(r, c) || ctx.stepsAt?.(r, c) === true || ctx.opensAt?.(r, c) === true) return { state: s, effects: [] };\n    const effects: SheetEffect[] = [];\n    const moved = moveTo(s, { r, c }, ctx, effects);\n    const linkCtx = ctx.linkAt?.(r, c);\n    const val = linkCtx !== undefined ? seed ?? \"\" : seed ?? ctx.editTextAt(r, c);\n    const opened: EditBuffer = {\n        r, c, val, err: false, hi: seed !== undefined && seed.trim() !== \"\" ? 0 : -1, seeded: seed !== undefined,\n        opened: seed === undefined && linkCtx === undefined ? val : undefined,\n    };\n    // Opened on the cell's own register member, the editor holds that member — the one of two who share its words.\n    const own = seed === undefined && linkCtx === undefined ? ctx.memberAt?.(r, c) : undefined;\n    const edit = own !== undefined ? withPick(opened, val, own, ctx) : opened;\n    if (linkCtx !== undefined) {\n        // Existing content becomes chips; a seed replaces it (the spreadsheet convention).\n        const groups: LinkGroups = seed !== undefined ? [[], []] : [[...linkCtx.initial[0]], [...linkCtx.initial[1]]];\n        edit.link = { side: linkStartSide(linkCtx.halves, groups), groups, chipSel: null, hop: 0 };\n    }\n    effects.push({ t: \"focus.editor\", selectAll: seed === undefined && linkCtx === undefined });\n    effects.push({ t: \"schedule.suggest\", latency: \"idle\" });\n    return { state: { ...moved, edit, selEnd: null, armed: null, gsel: null }, effects };\n}\n\n/**\n * The text a register-kind commit takes: the member a gesture chose, by its\n * key; else the armed candidate's key when a ghost or a stepped candidate\n * applies; else the words typed, which the parse resolves (#1536).\n */\nexport function commitText(edit: EditBuffer, ctx: SheetMachineCtx): string {\n    if (!isRegisterKind(ctx.kindAt(edit.r, edit.c))) return edit.val;\n    if (edit.pick !== undefined) return edit.pick;\n    const cand = ctx.candidateAt(edit.r, edit.c, edit.val, edit.hi);\n    if (cand !== undefined && edit.val.trim() !== \"\" && (ghostFor(edit.val, cand.label) !== \"\" || edit.hi > 0)) return cand.key;\n    return edit.val;\n}\n\n/**\n * The cell the open editor would commit — what the copilot runs against\n * (`null` = a blank, `undefined` = unrecognised, nothing to run against).\n */\nexport function provisionalCell(edit: EditBuffer, ctx: SheetMachineCtx): SheetCellValue | null | undefined {\n    if (edit.link !== undefined) {\n        const linkCtx = ctx.linkAt?.(edit.r, edit.c);\n        if (linkCtx === undefined) return undefined;\n        return linkCtx.cell(withBuffer(edit, linkCtx));\n    }\n    const out = ctx.parse(edit.r, edit.c, commitText(edit, ctx));\n    if (out.kind === \"unrecognised\") return variant(\"Invalid\", edit.val);\n    return out.kind === \"cell\" ? out.cell : null;\n}\n\n/** Commit the open editor in a direction. */\nfunction commitEdit(s: SheetUiState, dir: CommitDir, ctx: SheetMachineCtx): Transition {\n    const edit = s.edit;\n    if (edit === null) return { state: s, effects: [] };\n    if (dir === \"cancel\") return { state: { ...s, edit: null }, effects: [{ t: \"focus.sheet\" }] };\n    if (edit.r >= ctx.rowCount) return { state: { ...s, edit: null }, effects: [] };\n    if (edit.link !== undefined) {\n        // The buffer resolves into the active half (the ghost taken); the cell is\n        // the two halves. Typed entry is never blocked, so a link always commits.\n        const linkCtx = ctx.linkAt?.(edit.r, edit.c);\n        if (linkCtx === undefined) return { state: { ...s, edit: null }, effects: [{ t: \"focus.sheet\" }] };\n        const groups = withBuffer(edit, linkCtx);\n        const effects: SheetEffect[] = [{ t: \"write\", r: edit.r, c: edit.c, cell: linkCtx.cell(groups), text: \"\" }];\n        let next: SheetUiState = { ...s, edit: null, armed: null };\n        if (dir !== \"blur\") effects.push({ t: \"focus.sheet\" });\n        next = moveAfterCommit(next, dir, ctx, effects);\n        return { state: next, effects };\n    }\n    const text = commitText(edit, ctx);\n    const effects: SheetEffect[] = [];\n    // Closed on the text it opened with, nothing changed and nothing is\n    // written (#852): the cell keeps its own value, never its edit form read\n    // back, and the history takes no step. An untouched editor (its buffer\n    // as it opened, no candidate cycled) never takes a ghost it was not\n    // asked for either. Holding a chosen member, it is unchanged while that\n    // member is the cell's own (#1536).\n    const own = edit.pick !== undefined ? ctx.memberAt?.(edit.r, edit.c) : undefined;\n    const unchanged = edit.opened !== undefined && (edit.pick !== undefined\n        ? own !== undefined && stringEqual(edit.pick, own)\n        : text === edit.opened || (edit.val === edit.opened && edit.hi < 0));\n    if (!unchanged) {\n        const outcome = ctx.parse(edit.r, edit.c, text);\n        effects.push({ t: \"write\", r: edit.r, c: edit.c, cell: outcome.kind === \"cell\" ? outcome.cell : outcome.kind === \"unrecognised\" ? variant(\"Invalid\", text) : null, text });\n    }\n    let next: SheetUiState = { ...s, edit: null, armed: null };\n    if (dir !== \"blur\") effects.push({ t: \"focus.sheet\" });\n    next = moveAfterCommit(next, dir, ctx, effects);\n    return { state: next, effects };\n}\n\n/** Commit the active editor and an accepted suggestion through one write per row. */\nfunction acceptSuggestion(s: SheetUiState, ctx: SheetMachineCtx, take: (state: SheetUiState) => Transition): Transition {\n    const committed = commitEdit(s, \"stay\", ctx);\n    const accepted = take(committed.state);\n    const pending = [...committed.effects, ...accepted.effects];\n    const combinedRows = new Set(pending.filter(effect => effect.t === \"write.many\").map(effect => effect.r));\n    const effects: SheetEffect[] = [];\n    for (const effect of pending) {\n        if (effect.t === \"write\" && combinedRows.has(effect.r)) continue;\n        if (effect.t !== \"write.many\") { effects.push(effect); continue; }\n        const writes = new Map<number, SheetCellValue>();\n        for (const previous of committed.effects) {\n            if (previous.t === \"write\" && previous.r === effect.r) writes.set(previous.c, previous.cell ?? variant(\"Null\", null));\n        }\n        for (const write of effect.writes) writes.set(write.c, write.cell);\n        effects.push({ ...effect, writes: [...writes].map(([c, cell]) => ({ c, cell })) });\n    }\n    return { state: accepted.state, effects };\n}\n\n/** Where the ring goes after a commit. */\nfunction moveAfterCommit(s: SheetUiState, dir: CommitDir, ctx: SheetMachineCtx, effects: SheetEffect[]): SheetUiState {\n    switch (dir) {\n        case \"right\": return moveTo(s, { r: s.sel.r, c: stepColumn(s.sel.r, s.sel.c, 1, ctx) }, ctx, effects);\n        case \"left\": return moveTo(s, { r: s.sel.r, c: stepColumn(s.sel.r, s.sel.c, -1, ctx) }, ctx, effects);\n        case \"down\": return moveDown(s, ctx, effects);\n        default: return s;\n    }\n}\n\n/**\n * ↓ — the last row appends when the sheet allows it (never under a lens); on\n * a paged sheet whose source goes on past it, the ring steps onto the next\n * window's first row once it lands (#860).\n */\nfunction moveDown(s: SheetUiState, ctx: SheetMachineCtx, effects: SheetEffect[]): SheetUiState {\n    if (s.sel.r + 1 >= ctx.rowCount) {\n        if (ctx.canAppend && !ctx.lensActive) {\n            const sel = { r: s.sel.r + 1, c: s.sel.c };\n            effects.push({ t: \"emit.select\", r: sel.r, c: sel.c }, { t: \"scroll.to\", r: sel.r });\n            return { ...s, sel, selEnd: null, appended: s.appended + 1 };\n        }\n        if (ctx.edges?.atEnd === false) effects.push({ t: \"seek.step\", dir: 1, c: s.sel.c });\n        return s.selEnd === null ? s : { ...s, selEnd: null };\n    }\n    return moveTo(s, { r: s.sel.r + 1, c: s.sel.c }, ctx, effects);\n}\n\n/** The last row that is not blank padding — where ⌘End lands (#860); the first row on a sheet of blanks. */\nfunction lastFilledRow(ctx: SheetMachineCtx): number {\n    let r = ctx.rowCount - 1;\n    while (r > 0 && ctx.rowKindAt?.(r) === \"blank\") r--;\n    return Math.max(0, r);\n}\n\n/** Fold or open the group whose band sits at `r` (#740); the ring lands on the band. */\nfunction toggleFold(s: SheetUiState, r: number, ctx: SheetMachineCtx): Transition {\n    const g = ctx.groupAt?.(r);\n    if (g === undefined) return { state: s, effects: [] };\n    const folds = new Map(s.folds);\n    folds.set(g.id, !g.folded);\n    const effects: SheetEffect[] = [];\n    const moved = moveTo(s, { r, c: s.sel.c }, ctx, effects, false);\n    return { state: { ...moved, folds, msg: { id: g.folded ? \"groupOpened\" : \"groupFolded\", noun: ctx.groupNoun?.singular } }, effects };\n}\n\n/**\n * What the ring re-finds once the body has re-formed: its group — the band\n * it is on, else the nearest band above (a line's) — or a loose row itself\n * (#846), which belongs to no group and stays where it is.\n */\nfunction refindOfRing(r: number, ctx: SheetMachineCtx): string | undefined {\n    if (ctx.looseAt?.(r) === true) return ctx.idAt?.(r);\n    for (let k = r; k >= 0; k--) {\n        if (ctx.rowKindAt?.(k) === \"group\") return ctx.groupAt?.(k)?.id;\n    }\n    return undefined;\n}\n\n/**\n * Fold or open EVERY group (the header's corner, ⌥ on a chevron, ⇧Space on a\n * band). The groups a lens hides fold too, so the state means the same once\n * the search clears. The ring stays with its group — or its loose row\n * (#846): the body re-forms under it, so it is re-found by id once the rows\n * have settled.\n */\nfunction foldAll(s: SheetUiState, folded: boolean, ctx: SheetMachineCtx): Transition {\n    const ids = ctx.groupIds ?? [];\n    if (ids.length === 0) return { state: s, effects: [] };\n    const folds = new Map(s.folds);\n    for (const id of ids) folds.set(id, folded);\n    const effects: SheetEffect[] = [];\n    const refind = refindOfRing(s.sel.r, ctx);\n    if (refind !== undefined) effects.push({ t: \"select.id\", id: refind, c: s.sel.c });\n    const msg: SheetNotice = { id: folded ? \"groupsFolded\" : \"groupsOpened\", n: ids.length, noun: ctx.groupNoun?.singular, nouns: ctx.groupNoun?.plural };\n    return { state: { ...s, selEnd: null, gsel: null, folds, msg }, effects };\n}\n\n/**\n * Show or hide the sub rows under the line at `r` (its chevron, Space);\n * `all` takes every line of its group the way this one goes. A hand's choice\n * is a fold override, so it persists with the view like a group's.\n */\nfunction toggleSubRows(s: SheetUiState, r: number, all: boolean, ctx: SheetMachineCtx): Transition {\n    const st = ctx.lineSubRowsAt?.(r);\n    if (st === undefined) return { state: s, effects: [] };\n    const open = !st.open;\n    const folds = new Map(s.folds);\n    const ids = all ? st.group : [st.id];\n    for (const id of ids) folds.set(id, !open);\n    const effects: SheetEffect[] = [];\n    const moved = moveTo(s, { r, c: s.sel.c }, ctx, effects, false);\n    const n = all ? ids.length : st.count;\n    const noun = ctx.groupNoun?.singular;\n    const msg: SheetNotice = all\n        ? open ? { id: \"subRowsShownAll\", n, noun } : { id: \"subRowsHidAll\", noun }\n        : open ? { id: \"subRowsShown\", n } : { id: \"subRowsHid\" };\n    return { state: { ...moved, folds, msg }, effects };\n}\n\n/** The sheet's keyboard (B§6) — no editor open. */\nfunction sheetKey(s: SheetUiState, e: Extract<SheetEvent, { t: \"key\" }>, ctx: SheetMachineCtx): Transition {\n    // ⌘/ and ⌘F focus the rail's search (B§6) — whatever the sheet holds.\n    if (e.meta && (e.key === \"/\" || e.key === \"f\")) return { state: s, effects: [{ t: \"focus.search\" }] };\n    if (ctx.rowCount === 0 || ctx.colCount === 0) return { state: s, effects: [] };\n    const effects: SheetEffect[] = [];\n    // No ring placed (#1531): a move key places it on the first row's first cell that edits in place; esc climbs its\n    // ladder as ever; every other key waits for a ring.\n    if (s.ringless && e.key !== \"Escape\") {\n        if (!MOVE_KEYS.has(e.key)) return { state: s, effects };\n        return { state: moveTo(s, firstPlace(ctx), ctx, effects), effects };\n    }\n    // A summary folds on Space; ⇧Space folds or opens every group the way this one goes.\n    const rowKind = ctx.rowKindAt?.(s.sel.r);\n    if (rowKind === \"group\" && e.key === \" \" && !e.meta && !e.alt) {\n        if (!e.shift) return toggleFold(s, s.sel.r, ctx);\n        const g = ctx.groupAt?.(s.sel.r);\n        return g === undefined ? { state: s, effects: [] } : foldAll(s, !g.folded, ctx);\n    }\n    // A line with sub rows: Space shows or hides them, ⇧Space every line's in the group (a line without them still takes Space as a keystroke).\n    if (rowKind === \"row\" && e.key === \" \" && !e.meta && !e.alt && ctx.lineSubRowsAt?.(s.sel.r) !== undefined) {\n        return toggleSubRows(s, s.sel.r, e.shift, ctx);\n    }\n    // A cell that steps in place (#1531): Space or ⏎ takes its next state (⇧ the one before), ⌫ a cycle's first, and a\n    // key that names a member sets it — none opens an editor, and a read-only cell takes none of them; nor does a cycle\n    // over no members, which has no state to take.\n    const stepAt = ctx.stepAt;\n    if (stepAt !== undefined && (s.selEnd === null || same(s.selEnd, s.sel)) && !e.meta && !e.alt && ctx.stepsAt?.(s.sel.r, s.sel.c) === true) {\n        const { r, c } = s.sel;\n        const write = (cell: SheetCellValue | undefined): Transition => ({ state: s, effects: ctx.editableAt(r, c) && cell !== undefined ? [{ t: \"write\", r, c, cell, text: \"\" }] : [] });\n        if (e.key === \" \" || e.key === \"Enter\") return write(stepAt(r, c, e.shift ? -1 : 1));\n        // ⌫ on one no step reaches is a clear, which leaves it as it is and says why (#1585).\n        if ((e.key === \"Backspace\" || e.key === \"Delete\") && ctx.editableAt(r, c)) return write(stepAt(r, c, \"first\"));\n        if (e.key.length === 1) return write(ctx.keyAt?.(r, c, e.key));\n    }\n    const dropPick = (t: Transition): Transition => (t.state.gsel === null ? t : { ...t, state: { ...t.state, gsel: null } });\n    const move = (dr: number, dc: number): Transition => {\n        const base = e.shift && s.selEnd !== null ? s.selEnd : s.sel;\n        const c = dc === 0 ? base.c : stepColumn(base.r, base.c, dc > 0 ? 1 : -1, ctx);\n        if (e.shift) {\n            const selEnd = clamp({ r: base.r + dr, c }, ctx);\n            return dropPick({ state: { ...s, selEnd }, effects });\n        }\n        if (dr === 1) return dropPick({ state: moveDown(s, ctx, effects), effects });\n        // ↑ above the first resident row, the source going on above it (#860).\n        if (dr === -1 && base.r === 0 && ctx.edges?.atStart === false) {\n            effects.push({ t: \"seek.step\", dir: -1, c: base.c });\n            return dropPick({ state: s.selEnd === null ? s : { ...s, selEnd: null }, effects });\n        }\n        return dropPick({ state: moveTo(s, { r: base.r + dr, c }, ctx, effects), effects });\n    };\n    /** Move — or, with ⇧, stretch the range — to a cell (#860). */\n    const moveOrExtend = (to: CellRef): Transition => {\n        if (e.shift) return dropPick({ state: { ...s, selEnd: clamp(to, ctx) }, effects });\n        return dropPick({ state: moveTo(s, to, ctx, effects), effects });\n    };\n    /** ⏎ or F2: the editor opens on the ring's cell — or the host opens a cell that edits out of place (#1531). */\n    const editRing = (): Transition => (ctx.opensAt?.(s.sel.r, s.sel.c) === true\n        ? { state: s, effects: [{ t: \"open\", r: s.sel.r, c: s.sel.c }] }\n        : startEdit(s, s.sel.r, s.sel.c, undefined, ctx));\n    switch (e.key) {\n        case \"ArrowDown\": return move(1, 0);\n        case \"ArrowUp\": return move(-1, 0);\n        case \"ArrowLeft\": return move(0, -1);\n        case \"ArrowRight\": return move(0, 1);\n        case \"Home\":\n        case \"End\": {\n            const first = e.key === \"Home\";\n            const c = first ? 0 : ctx.colCount - 1;\n            if (!e.meta) return moveOrExtend({ r: (e.shift && s.selEnd !== null ? s.selEnd : s.sel).r, c });\n            // ⌘Home / ⌘End: the sheet's first or last cell — on a paged sheet not\n            // at that end, a jump there, the ring landing once it arrives.\n            if (!e.shift && (first ? ctx.edges?.atStart : ctx.edges?.atEnd) === false) {\n                effects.push({ t: \"seek.edge\", edge: first ? \"first\" : \"last\", c });\n                return dropPick({ state: s.selEnd === null ? s : { ...s, selEnd: null }, effects });\n            }\n            return moveOrExtend({ r: first ? 0 : lastFilledRow(ctx), c });\n        }\n        case \"PageDown\":\n        case \"PageUp\": {\n            // A page of rows — the rows the frame shows — however they draw.\n            const n = Math.max(1, Math.floor(ctx.pageRows?.() ?? 10));\n            const base = e.shift && s.selEnd !== null ? s.selEnd : s.sel;\n            const down = e.key === \"PageDown\";\n            // A page past the resident rows of a paged sheet whose source goes on that way (#1398, CL10): the window a\n            // page on is asked for, and the ring lands there once it is in — fetch, then move — never at the loaded edge.\n            if (!e.shift && (down ? base.r + n >= ctx.rowCount && ctx.edges?.atEnd === false : base.r - n < 0 && ctx.edges?.atStart === false)) {\n                effects.push({ t: \"seek.step\", dir: down ? 1 : -1, c: base.c, page: { from: base.r, rows: n } });\n                return dropPick({ state: s.selEnd === null ? s : { ...s, selEnd: null }, effects });\n            }\n            return moveOrExtend({ r: base.r + (down ? n : -n), c: base.c });\n        }\n        case \"Tab\": {\n            const taken = suggestKey(s, e, ctx);\n            if (taken !== null) return taken;\n            return { state: moveTo(s, { r: s.sel.r, c: stepColumn(s.sel.r, s.sel.c, e.shift ? -1 : 1, ctx) }, ctx, effects), effects };\n        }\n        case \"Enter\": {\n            const taken = suggestKey(s, e, ctx);\n            if (taken !== null) return taken;\n            if (e.meta) return { state: s, effects };\n            return editRing();\n        }\n        case \"F2\":\n            return editRing();\n        case \"Escape\": {\n            const dropped = escSuggest(s);\n            if (dropped !== null) return dropped;\n            if (s.selEnd !== null) return { state: { ...s, selEnd: null }, effects };\n            const rung = escTabs(s, ctx);\n            return rung ?? { state: s, effects };\n        }\n        case \"Backspace\":\n        case \"Delete\": {\n            const rejected = suggestKey(s, e, ctx);\n            if (rejected !== null) return rejected;\n            const wr = wholeRows(s, ctx.colCount);\n            if (wr !== null || e.meta) {\n                const { r0, r1 } = wr ?? selectionRect(s);\n                effects.push({ t: \"delete.rows\", r0, r1 });\n                return { state: { ...s, sel: clamp({ r: r0, c: s.sel.c }, ctx), selEnd: null }, effects };\n            }\n            const rect = selectionRect(s);\n            effects.push({ t: \"clear\", ...rect });\n            return { state: s, effects };\n        }\n        default:\n            if (e.key.length === 1 && !e.meta && !e.alt) return startEdit(s, s.sel.r, s.sel.c, e.key, ctx);\n            return { state: s, effects };\n    }\n}\n\n/** The editor's keyboard — the link editor's keys first, then the scalar cells'. */\nfunction editorKey(s: SheetUiState, e: Extract<SheetEvent, { t: \"editor.key\" }>, ctx: SheetMachineCtx): Transition {\n    const edit = s.edit;\n    if (edit === null) return { state: s, effects: [] };\n    if (e.key === \"Enter\" && e.meta) {\n        // ⌘⏎ — commit in place, then take the row fill (B§6).\n        return acceptSuggestion(s, ctx, state => e.shift && state.sugg !== null\n            ? takeProposals(state, ctx, state.sugg.rows.length - 1) : fillRow(state, ctx));\n    }\n    if (edit.link !== undefined) return linkKey(s, e, ctx, commitEdit);\n    const kind = ctx.kindAt(edit.r, edit.c);\n    if (e.key === \"Escape\") return commitEdit(s, \"cancel\", ctx);\n    if (isRegisterKind(kind) && e.alt && (e.key === \"]\" || e.key === \"[\" || e.key === \"ArrowDown\" || e.key === \"ArrowUp\")) {\n        const n = ctx.candidates(edit.r, edit.c, edit.val).length;\n        if (n > 0) {\n            const cur = edit.hi < 0 ? (edit.val.trim() === \"\" ? -1 : 0) : edit.hi;\n            const back = e.key === \"[\" || e.key === \"ArrowUp\";\n            const hi = cur < 0 ? 0 : (cur + (back ? -1 : 1) + n) % n;\n            // The candidate stepped to is what commits now, not a member chosen before.\n            return { state: { ...s, edit: { ...edit, hi, pick: undefined } }, effects: [{ t: \"schedule.suggest\", latency: \"instant\" }] };\n        }\n        return { state: s, effects: [] };\n    }\n    if (e.key === \"Enter\") return commitEdit(s, \"down\", ctx);\n    if (e.key === \"Tab\") {\n        if (!e.shift && isRegisterKind(kind)) {\n            const cand = ctx.candidateAt(edit.r, edit.c, edit.val, edit.hi);\n            const ghost = ghostFor(edit.val, cand?.label);\n            const resolve = resolveFor(edit.val, cand?.label);\n            if (cand !== undefined && (ghost !== \"\" || resolve !== \"\")) {\n                return {\n                    state: { ...s, edit: withPick(edit, ghost !== \"\" ? edit.val + ghost : resolve, cand.key, ctx) },\n                    effects: [{ t: \"schedule.suggest\", latency: \"instant\" }],\n                };\n            }\n        }\n        return commitEdit(s, e.shift ? \"left\" : \"right\", ctx);\n    }\n    if (e.key === \"ArrowDown\") return commitEdit(s, \"down\", ctx);\n    if (e.key === \"ArrowUp\") return commitEdit(s, \"stay\", ctx);\n    if (e.key === \"ArrowRight\" && e.atEnd && isRegisterKind(kind)) {\n        const cand = ctx.candidateAt(edit.r, edit.c, edit.val, edit.hi);\n        const ghost = ghostFor(edit.val, cand?.label);\n        if (cand !== undefined && ghost !== \"\") {\n            const take = e.meta ? ghost : ghostWord(ghost);\n            // The whole ghost takes its candidate; a word of it is still typing.\n            const next = take === ghost ? withPick(edit, edit.val + take, cand.key, ctx) : { ...edit, val: edit.val + take, pick: undefined };\n            return { state: { ...s, edit: next }, effects: [] };\n        }\n    }\n    return { state: s, effects: [] };\n}\n\n/**\n * The pure transition function: `(state, event, ctx) → { state, effects }`.\n *\n * @param s - The current UI state\n * @param e - The interaction event\n * @param ctx - What the transition may ask about the sheet\n * @returns The next state plus the effects the component must run\n */\nexport function sheetReducer(s: SheetUiState, e: SheetEvent, ctx: SheetMachineCtx): Transition {\n    // Tab, narrowing and search events run on a grouped sheet too: its lens\n    // works on the groups, the records (#1349).\n    switch (e.t) {\n        case \"cell.down\": {\n            // A click commits an open editor in place first.\n            const closed = s.edit !== null ? commitEdit(s, \"stay\", ctx) : { state: s, effects: [] as SheetEffect[] };\n            const effects = closed.effects;\n            // A cell that steps in place (#1531): the press takes its next state, ⇧ the one before — never a range. With\n            // no ring placed, a ⇧ press has no range to stretch, and places the ring as a press does. A cell no step\n            // reaches — an owned row's, a read-only one, one its mark locks — is any other cell to a ⇧ press: had it\n            // moved the ring, the range the press means to stretch would be gone.\n            const stepped = ctx.stepAt?.(e.r, e.c, e.shift ? -1 : 1);\n            const steps = stepped !== undefined && ctx.editableAt(e.r, e.c);\n            if (e.shift && !steps && !closed.state.ringless) {\n                return { state: { ...closed.state, selEnd: clamp({ r: e.r, c: e.c }, ctx), gsel: null }, effects };\n            }\n            const moved = moveTo(closed.state, { r: e.r, c: e.c }, ctx, effects, false);\n            effects.push({ t: \"focus.sheet\" });\n            if (steps) {\n                // The editor's commit is its own undo step, the step another.\n                if (s.edit !== null) effects.push({ t: \"gesture.end\" });\n                effects.push({ t: \"write\", r: e.r, c: e.c, cell: stepped, text: \"\" });\n            }\n            // A cell that edits out of place opens where the host edits it (#1531).\n            if (!e.shift && ctx.opensAt?.(e.r, e.c) === true) effects.push({ t: \"open\", r: e.r, c: e.c });\n            return { state: moved.gsel === null ? moved : { ...moved, gsel: null }, effects };\n        }\n        case \"cell.dbl\":\n            // A double press inside the open editor — its step buttons pressed twice, a word double-clicked — reaches\n            // its cell too: opened afresh there, the editor would drop the edit as it stands for the cell's own text.\n            if (s.edit !== null && same(s.edit, e)) return { state: s, effects: [] };\n            return startEdit(s, e.r, e.c, undefined, ctx);\n        case \"cell.enter\": {\n            if (e.dragging) return { state: { ...s, selEnd: clamp({ r: e.r, c: e.c }, ctx) }, effects: [] };\n            if (s.hover !== null && s.hover.r === e.r && s.hover.c === e.c) return { state: s, effects: [] };\n            return { state: { ...s, hover: { r: e.r, c: e.c } }, effects: [] };\n        }\n        case \"cell.leave\":\n            return { state: s.hover === null ? s : { ...s, hover: null }, effects: [] };\n        case \"row.pick\": {\n            const closed = s.edit !== null ? commitEdit(s, \"stay\", ctx) : { state: s, effects: [] as SheetEffect[] };\n            const effects = closed.effects;\n            const last = Math.max(0, ctx.colCount - 1);\n            if (e.shift && !closed.state.ringless) return { state: { ...closed.state, selEnd: clamp({ r: e.r, c: last }, ctx), gsel: null }, effects };\n            // A band's gutter selects the group's lines (#740, G7); an empty or folded group selects the band itself.\n            const group = ctx.rowKindAt?.(e.r) === \"group\" ? ctx.groupAt?.(e.r) : undefined;\n            const r0 = group?.lines !== undefined ? group.lines.r0 : e.r;\n            const r1 = group?.lines !== undefined ? group.lines.r1 : e.r;\n            const selected = wholeRows(closed.state, ctx.colCount);\n            if (selected !== null && selected.r0 === r0 && selected.r1 === r1) {\n                effects.push({ t: \"focus.sheet\" });\n                return { state: { ...closed.state, selEnd: null, gsel: null }, effects };\n            }\n            effects.push({ t: \"emit.select\", r: r0, c: 0 }, { t: \"focus.sheet\" });\n            return { state: { ...closed.state, sel: clamp({ r: r0, c: 0 }, ctx), selEnd: clamp({ r: r1, c: last }, ctx), gsel: null, ringless: false }, effects };\n        }\n        case \"key\":\n            if (s.edit !== null) return { state: s, effects: [] };\n            return sheetKey(s, e, ctx);\n        case \"editor.change\": {\n            if (s.edit === null) return { state: s, effects: [] };\n            if (s.edit.link !== undefined) return linkChange(s, e.val, ctx);\n            const hi = e.val.trim() === \"\" ? -1 : 0;\n            // Typing lets a chosen member go: the words typed are what commits now.\n            return { state: { ...s, edit: { ...s.edit, val: e.val, err: false, hi, pick: undefined } }, effects: [{ t: \"schedule.suggest\", latency: \"idle\" }] };\n        }\n        case \"editor.key\":\n            return editorKey(s, e, ctx);\n        case \"editor.blur\":\n            return commitEdit(s, \"blur\", ctx);\n        case \"strip.pick\": {\n            if (s.edit === null) return { state: s, effects: [] };\n            if (s.edit.link !== undefined) {\n                // A link chip adds its members to the active half; the buffer clears.\n                const link = s.edit.link;\n                const members = e.members ?? [];\n                if (members.length === 0) return { state: s, effects: [] };\n                const groups: LinkGroups = [[...link.groups[0]], [...link.groups[1]]];\n                groups[link.side] = groups[link.side].concat(members);\n                return {\n                    state: { ...s, msg: { id: \"membersAdded\", n: members.length }, edit: { ...s.edit, val: \"\", hi: -1, err: false, link: { ...link, groups, chipSel: null } } },\n                    effects: [{ t: \"focus.editor\", selectAll: false }, { t: \"schedule.suggest\", latency: \"instant\" }],\n                };\n            }\n            // A candidate chip: its member, in the words it shows.\n            return {\n                state: { ...s, edit: e.key !== undefined ? withPick(s.edit, e.label, e.key, ctx) : { ...s.edit, val: e.label, hi: e.i, err: false } },\n                effects: [{ t: \"focus.editor\", selectAll: false }, { t: \"schedule.suggest\", latency: \"instant\" }],\n            };\n        }\n        case \"editor.pick\":\n            // The combobox chose a member: its words in the buffer, the member itself what commits.\n            if (s.edit === null || s.edit.link !== undefined) return { state: s, effects: [] };\n            return { state: { ...s, edit: withPick(s.edit, e.label, e.key, ctx) }, effects: [{ t: \"schedule.suggest\", latency: \"instant\" }] };\n        case \"half.down\": {\n            if (s.edit === null || s.edit.link === undefined) return { state: s, effects: [] };\n            if (s.edit.link.side === e.side) return { state: s, effects: [{ t: \"focus.editor\", selectAll: false }] };\n            return switchSide(s, e.side, ctx);\n        }\n        case \"select.move\": {\n            // A key's move landing once its window has (#860) — a key moves nothing while an editor is open.\n            if (s.edit !== null) return { state: s, effects: [] };\n            const effects: SheetEffect[] = [];\n            const moved = moveTo(s, { r: e.r, c: e.c }, ctx, effects);\n            return { state: moved.gsel === null ? moved : { ...moved, gsel: null }, effects };\n        }\n        case \"select.set\": {\n            // The host moved the ring: commit an open editor in place, follow, scroll — no echo.\n            const closed = s.edit !== null ? commitEdit(s, \"stay\", ctx) : { state: s, effects: [] as SheetEffect[] };\n            const sel = clamp({ r: e.r, c: e.c }, ctx);\n            if (!closed.state.ringless && same(sel, closed.state.sel) && closed.state.selEnd === null) return closed;\n            closed.effects.push({ t: \"scroll.to\", r: sel.r });\n            return { state: { ...closed.state, sel, selEnd: null, ringless: false }, effects: closed.effects };\n        }\n        case \"rows.changed\": {\n            // Each place follows its row when the rows moved under it (#854);\n            // one whose row left keeps its index, clamped — but not an open\n            // editor: over the row now at that index its text would land on\n            // that row. It closes, uncommitted, and the footer says why (#877).\n            const follow = <T extends CellRef>(ref: T): T => {\n                const r = e.moved?.(ref.r);\n                return r === undefined || r === null || r === ref.r ? ref : { ...ref, r };\n            };\n            const editLeft = s.edit !== null && e.moved?.(s.edit.r) === null;\n            const sel = clamp(follow(s.sel), ctx);\n            const selEnd = s.selEnd !== null ? clamp(follow(s.selEnd), ctx) : null;\n            const moved = s.edit !== null && !editLeft ? follow(s.edit) : null;\n            const edit = moved !== null && moved.r < ctx.rowCount && moved.c < ctx.colCount ? moved : null;\n            const hover = s.hover !== null ? follow(s.hover) : null;\n            const armed = s.armed !== null ? follow(s.armed) : null;\n            const msg: SheetNotice | null = editLeft ? { id: \"rowLeft\" } : s.msg;\n            const clamped = same(sel, s.sel) && (selEnd === null ? s.selEnd === null : same(selEnd, s.selEnd)) && edit === s.edit && hover === s.hover && armed === s.armed && msg === s.msg\n                ? s\n                : { ...s, sel, selEnd, edit, hover, armed, msg };\n            return { state: afterRowsChanged(clamped, ctx), effects: editLeft ? [{ t: \"focus.sheet\" }] : [] };\n        }\n        case \"columns.changed\": {\n            // Each place follows its column as the columns move under it; one\n            // whose column left keeps its index, clamped — but not an open\n            // editor: over the column now at that index, its text would be\n            // written there. It closes, uncommitted, and the footer says why.\n            const follow = <T extends CellRef>(ref: T): T => {\n                const c = e.moved(ref.c);\n                return c === null || c === ref.c ? ref : { ...ref, c };\n            };\n            const editLeft = s.edit !== null && e.moved(s.edit.c) === null;\n            const sel = clamp(follow(s.sel), ctx);\n            const selEnd = s.selEnd !== null ? clamp(follow(s.selEnd), ctx) : null;\n            const edit = s.edit !== null && !editLeft ? follow(s.edit) : null;\n            const hover = s.hover !== null ? follow(s.hover) : null;\n            const armed = s.armed !== null ? follow(s.armed) : null;\n            const msg: SheetNotice | null = editLeft ? { id: \"columnLeft\" } : s.msg;\n            const kept = same(sel, s.sel) && (selEnd === null ? s.selEnd === null : same(selEnd, s.selEnd)) && edit === s.edit && hover === s.hover && armed === s.armed && msg === s.msg;\n            return { state: kept ? s : { ...s, sel, selEnd, edit, hover, armed, msg }, effects: editLeft ? [{ t: \"focus.sheet\" }] : [] };\n        }\n        case \"msg\":\n            return s.msg === e.msg ? { state: s, effects: [] } : { state: { ...s, msg: e.msg }, effects: [] };\n        // With no ring placed there is nothing to copy, and nowhere to paste (#1531).\n        case \"clipboard.copy\": {\n            if (s.edit !== null || s.ringless) return { state: s, effects: [] };\n            return { state: s, effects: [{ t: \"copy\", ...selectionRect(s) }] };\n        }\n        case \"clipboard.paste\": {\n            if (s.edit !== null || s.ringless) return { state: s, effects: [] };\n            return { state: { ...s, sugg: null, armed: null, gsel: null }, effects: [{ t: \"paste\", r: s.sel.r, c: s.sel.c, text: e.text }] };\n        }\n        // ── The copilot ───────────────────────────────────────────────────\n        case \"suggest.ready\":\n            return applyReady(s, ctx, e.anchorId, e.sugg);\n        case \"suggest.landed\":\n            return applyLanded(s, e);\n        case \"suggest.rekey\":\n            return { state: rekeySuggest(s, e.from, e.to), effects: [] };\n        case \"suggest.clear\":\n            return { state: clearSuggest(s), effects: [] };\n        case \"fill.take\":\n            return acceptSuggestion(s, ctx, state => takeFill(state, ctx, e.key));\n        case \"fill.row\":\n            return acceptSuggestion(s, ctx, state => fillRow(state, ctx));\n        case \"proposal.pick\": {\n            const closed = s.edit !== null ? commitEdit(s, \"stay\", ctx) : { state: s, effects: [] as SheetEffect[] };\n            if (closed.state.sugg === null || e.i < 0 || e.i >= closed.state.sugg.rows.length) return closed;\n            closed.effects.push({ t: \"focus.sheet\" });\n            return { state: { ...closed.state, gsel: e.i, selEnd: null, armed: null }, effects: closed.effects };\n        }\n        case \"proposal.take\":\n            return acceptSuggestion(s, ctx, state => takeProposals(state, ctx, e.i));\n        case \"proposal.reject\":\n            return rejectProposal(s, ctx, e.i);\n        // ── The narrowing and the tabs (B§8) ───────────────────────────────\n        case \"narrowing.changed\":\n            return narrowed(s, ctx);\n        case \"tab.switch\":\n        case \"tab.create\":\n        case \"tab.close\": {\n            // A tab gesture commits an open editor in place first.\n            const closed = s.edit !== null ? commitEdit(s, \"stay\", ctx) : { state: s, effects: [] as SheetEffect[] };\n            const t = e.t === \"tab.switch\" ? switchTab(closed.state, ctx, e.id)\n                : e.t === \"tab.create\" ? createTab(closed.state, ctx)\n                    : closeTab(closed.state, ctx, e.id);\n            return { state: t.state, effects: [...closed.effects, ...t.effects] };\n        }\n        case \"tab.open\": {\n            const t = switchTab(s, ctx, e.id, false);\n            // The folds the last session left on this tab (#857), newer than the view's own.\n            return e.folds === undefined || t.state === s ? t : { ...t, state: { ...t.state, folds: e.folds } };\n        }\n        case \"tab.update\":\n            return updateTab(s, ctx);\n        case \"tab.revert\":\n            return revertTab(s, ctx);\n        case \"tab.rename.start\":\n            return { state: renameStart(s, ctx, e.id), effects: [] };\n        case \"tab.rename.change\":\n            return { state: renameChange(s, e.val), effects: [] };\n        case \"tab.rename.commit\":\n            return renameCommit(s, ctx);\n        case \"tab.rename.cancel\":\n            return { state: renameCancel(s), effects: [] };\n        case \"tab.reorder\":\n            return reorderTab(s, ctx, e.id, e.to);\n        case \"search.key\":\n            return searchKey(s, ctx, e.key) ?? { state: s, effects: [] };\n        // ── Grouped rows (#740) ───────────────────────────────────────────\n        case \"fold.toggle\": {\n            const closed = s.edit !== null ? commitEdit(s, \"stay\", ctx) : { state: s, effects: [] as SheetEffect[] };\n            // ⌥ on the chevron: every group goes the way this one does.\n            const g = e.all === true ? ctx.groupAt?.(e.r) : undefined;\n            const t = g !== undefined ? foldAll(closed.state, !g.folded, ctx) : toggleFold(closed.state, e.r, ctx);\n            return { state: t.state, effects: [...closed.effects, ...t.effects] };\n        }\n        case \"fold.all\": {\n            const closed = s.edit !== null ? commitEdit(s, \"stay\", ctx) : { state: s, effects: [] as SheetEffect[] };\n            const t = foldAll(closed.state, e.folded, ctx);\n            return { state: t.state, effects: [...closed.effects, ...t.effects] };\n        }\n        case \"subRows.toggle\": {\n            // A line's chevron: an open editor commits first, the ring lands on the line.\n            const closed = s.edit !== null ? commitEdit(s, \"stay\", ctx) : { state: s, effects: [] as SheetEffect[] };\n            const t = toggleSubRows(closed.state, e.r, e.all === true, ctx);\n            return { state: t.state, effects: [...closed.effects, ...t.effects] };\n        }\n    }\n}\n\n// ── The component-facing store (the Plan #610 pattern) ─────────────────────\n\n/** The one `useReducer` store: UI state + the effect batch. */\nexport interface SheetStore {\n    ui: SheetUiState;\n    /** The latest effectful event's batch — replaced per such event. */\n    fx: readonly SheetEffect[];\n    /** Bumps when an event yields effects; the component's drain gates on it. */\n    fxSeq: number;\n}\n\n/** Everything the store reducer handles. */\nexport type SheetAction =\n    | { t: \"event\"; e: SheetEvent; ctx: SheetMachineCtx }\n    /** A direct UI patch from the component (the range after a paste, a message). */\n    | { t: \"patch\"; patch: Partial<SheetUiState> };\n\n/**\n * The initial store — `active` is the initial view tab, if the sheet opens on one; `folds`, the fold overrides it opens\n * with (#857); `ringless`, whether it opens with no ring placed (#1531).\n */\nexport function initialSheetStore(sel?: CellRef, active: string | null = null, folds?: ReadonlyMap<string, boolean>, ringless = false): SheetStore {\n    return { ui: initialSheetState(sel, active, folds, ringless), fx: [], fxSeq: 0 };\n}\n\n/**\n * The store transition — pure: StrictMode double-invokes reducers, so the\n * effect batch rides the returned store and is run by the component's\n * seq-gated drain, never from inside a reducer.\n */\nexport function sheetStoreReducer(store: SheetStore, a: SheetAction): SheetStore {\n    switch (a.t) {\n        case \"event\": {\n            const { state, effects } = sheetReducer(store.ui, a.e, a.ctx);\n            if (state === store.ui && effects.length === 0) return store;\n            return effects.length === 0\n                ? { ...store, ui: state }\n                : { ...store, ui: state, fx: effects, fxSeq: store.fxSeq + 1 };\n        }\n        case \"patch\":\n            return { ...store, ui: { ...store.ui, ...a.patch } };\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Local placements, in order (#859). A draft's ordered place — before or\n * after another row, or at the start or the end — applies one after another,\n * as a batch applies them. The rows are a list linked through their ids, so a\n * move is a constant-time unlink and link: never a search and two splices over\n * the whole collection per move, which made a paste of thousands of placed\n * rows quadratic.\n *\n * @packageDocumentation\n */\n\nimport type { Placement } from \"./transactions.js\";\n\n/**\n * The rows in the order their placements put them, each applied in turn:\n * O(rows + moves).\n *\n * @remarks\n * A placement whose row or anchor is not among the rows moves nothing, and\n * neither does one anchored on its own row (a batch refuses it). A keyed\n * placement leaves the order to the key sort. Where two rows share an id,\n * the first is the one that moves and the one anchored on.\n *\n * @typeParam T - The row\n * @param rows - The rows in their current order\n * @param idOf - A row's id\n * @param moves - Each placed row's id and its placement, in the order they apply\n * @returns The rows in their new order — `rows` itself when nothing moved\n */\nexport function placeInOrder<T>(rows: T[], idOf: (row: T) => string, moves: Iterable<readonly [string, Placement]>): T[] {\n    const n = rows.length;\n    const at = new Map<string, number>();\n    for (let i = 0; i < n; i++) {\n        const id = idOf(rows[i]!);\n        if (!at.has(id)) at.set(id, i);\n    }\n    const prev = new Int32Array(n);\n    const next = new Int32Array(n);\n    for (let i = 0; i < n; i++) {\n        prev[i] = i - 1;\n        next[i] = i + 1 < n ? i + 1 : -1;\n    }\n    let head = n > 0 ? 0 : -1;\n    let tail = n - 1;\n    const unlink = (i: number) => {\n        const p = prev[i]!;\n        const q = next[i]!;\n        if (p >= 0) next[p] = q; else head = q;\n        if (q >= 0) prev[q] = p; else tail = p;\n    };\n    const linkBefore = (i: number, j: number) => {\n        const p = prev[j]!;\n        prev[i] = p;\n        next[i] = j;\n        prev[j] = i;\n        if (p >= 0) next[p] = i; else head = i;\n    };\n    const linkAfter = (i: number, j: number) => {\n        const q = next[j]!;\n        next[i] = q;\n        prev[i] = j;\n        next[j] = i;\n        if (q >= 0) prev[q] = i; else tail = i;\n    };\n    let moved = false;\n    for (const [id, placement] of moves) {\n        if (placement.type !== \"some\" || placement.value.type !== \"ordered\") continue;\n        const i = at.get(id);\n        if (i === undefined) continue;\n        const position = placement.value.value;\n        let j = -1;\n        if (position.type === \"before\" || position.type === \"after\") {\n            const anchor = at.get(position.value);\n            if (anchor === undefined || anchor === i) continue;\n            j = anchor;\n        }\n        unlink(i);\n        if (head < 0) {\n            // The row was the only one: it is the list again.\n            head = tail = i;\n            prev[i] = -1;\n            next[i] = -1;\n        } else if (position.type === \"start\") linkBefore(i, head);\n        else if (position.type === \"end\") linkAfter(i, tail);\n        else if (position.type === \"before\") linkBefore(i, j);\n        else linkAfter(i, j);\n        moved = true;\n    }\n    if (!moved) return rows;\n    const out: T[] = [];\n    for (let i = head; i >= 0; i = next[i]!) out.push(rows[i]!);\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Evaluate business requirements against the current draft collection —\n * linear in the rows and the drafts (#859): the source rows' drafts are read\n * once per source generation, placement is one ordered pass, and each draft's\n * position comes from one index. The author's row checks cross the wire as\n * one batch per evaluation (#882), so the rows are sent and built once, not\n * once per draft.\n *\n * @packageDocumentation\n */\nimport { fromEastTypeValue, decodeBeast2For, encodeBeast2For, none, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Sheet, SheetEditingType, SheetReadyBatchType, SheetReadyCheckType } from \"@elaraai/e3-ui/internal\";\nimport { liftDraft, type BatchReadiness } from \"./draft-values.js\";\nimport { raiseIssue } from \"@elaraai/east-ui-components/internal\";\nimport { keyOrderOf } from \"./key-order.js\";\nimport { placeInOrder } from \"./placement.js\";\nimport { ISSUE_TEXT } from \"./words.js\";\nimport type { EntryVersion } from \"./transactions.js\";\nimport type { SheetRowValue } from \"./values.js\";\n\ntype Editing = ValueTypeOf<typeof SheetEditingType>;\ntype Readiness = ValueTypeOf<typeof Sheet.Types.Readiness>;\ntype Issue = ValueTypeOf<typeof Sheet.Types.Issue>;\ntype ReadyCheck = ValueTypeOf<typeof SheetReadyCheckType>;\nconst encodeBatch = encodeBeast2For(SheetReadyBatchType);\n\n/**\n * Build one checker whose inputs are captured at the current source generation.\n *\n * @param editing - The decoded editing declaration\n * @param resident - The source's resident rows\n * @param positions - Each resident row's source position — a failed window before it does not move it (#853)\n * @param partial - Whether the rows are a window of a paged source\n * @param base - A resident row's own draft, by its id and its source position — the entry its window was read with,\n *   lifted — where the sheet's windows carry theirs (#1599): what a check reads the rows around a drafted one over,\n *   never an entry read on its own at the revision now, which is on its way while the rows are read again\n * @param landed - What a Save landed that the rows have still to read, asked as a check runs: each entry as the Save\n *   left it, as the grid draws it over the rows read before it — what a check reads in their place\n * @returns The checker, or `undefined` when the author declared no checks\n */\nexport function authorReadiness(\n    editing: Editing, resident: readonly SheetRowValue[], positions: readonly number[], partial: boolean,\n    base?: (id: string, at: number) => Uint8Array | undefined,\n    landed?: () => Iterable<readonly [string, { readonly after: EntryVersion }]>,\n) {\n    const rowCheck = editing.readyRow.type === \"some\" ? editing.readyRow.value : undefined;\n    const groupCheck = editing.readyGroup.type === \"some\" ? editing.readyGroup.value : undefined;\n    if (rowCheck === undefined && groupCheck === undefined) return undefined;\n    const draftType = fromEastTypeValue(editing.draftType);\n    const encodeDraft = encodeBeast2For(editing.draftType);\n    const decodeEntry = decodeBeast2For(editing.entryType);\n    const childField = editing.children.type === \"some\" ? editing.children.value : undefined;\n    // With loose rows between the groups (#846) an entry is a group or a row of\n    // its own: a wire row with no band is checked as a row, never as lines.\n    const looseSheet = draftType.type === \"Variant\";\n    const rowOnly = (wire: SheetRowValue): boolean => childField === undefined || (looseSheet && wire.band.type === \"none\");\n    const driverColumn = editing.driverColumn.type === \"some\" ? editing.driverColumn.value : undefined;\n    // A keyed source's rows sit in key order, at the key's own type (#1182).\n    const keyOrder = editing.keyType.type === \"some\" ? keyOrderOf(editing.keyType.value) : undefined;\n    // The source rows' drafts, read at their source offsets — once for this\n    // generation of the source, however many evaluations follow (#859). No\n    // callback can accidentally decode a neighbour's payload.\n    let residentDrafts: Map<string, Uint8Array> | undefined;\n    const sourceDrafts = (): ReadonlyMap<string, Uint8Array> => {\n        if (residentDrafts !== undefined) return residentDrafts;\n        const read = new Map<string, Uint8Array>();\n        for (const [index, wire] of resident.entries()) {\n            // The row as the grid shows it: over the entry its window was read with, where it carries one (#1599).\n            const own = base?.(wire.id, positions[index]!);\n            if (own !== undefined) { read.set(wire.id, own); continue; }\n            // A base read that throws leaves the row to the bridge: a check\n            // that needs it reports why, and the sheet stays up (#853).\n            let payload: ReturnType<Editing[\"readEntry\"]>;\n            try { payload = editing.readEntry(wire.id, BigInt(positions[index]!)); }\n            catch { continue; }\n            if (payload.type === \"some\") read.set(wire.id, encodeDraft(liftDraft(draftType, decodeEntry(payload.value))));\n        }\n        residentDrafts = read;\n        return read;\n    };\n    // Each source row's position: a failed window before it does not move it (#853).\n    const sourceAt = new Map(resident.map((wire, i) => [wire.id, positions[i]!] as const));\n    /** The driver member a row's cells name, if the driver column holds one. */\n    const driverOf = (cells: SheetRowValue[\"cells\"]): ReadyCheck[\"driver\"] => {\n        const driver = driverColumn === undefined ? undefined : cells.get(driverColumn);\n        return driver?.type === \"String\" ? some(driver.value) : none;\n    };\n    return (entries: ReadonlyMap<string, EntryVersion>): BatchReadiness => {\n        if (entries.size === 0) return variant(\"ready\", null);\n        const issues: Issue[] = [];\n        let invalid = false;\n        // Each issue is raised with its own check's kind: the batch below holds\n        // them all under one, and a row is marked for its own.\n        const report = (result: Readiness, entry: string, row?: number) => {\n            if (result.type === \"ready\") return;\n            invalid ||= result.type === \"invalid\";\n            const at = row === undefined ? none : some(BigInt(row));\n            if (result.value.length === 0) issues.push(raiseIssue(result.type, { entry, row: at, field: none, message: ISSUE_TEXT.author(result.type) }));\n            for (const issue of result.value) issues.push(raiseIssue(result.type, { entry, row: at, field: some(issue.field), message: issue.message }));\n        };\n        // The source rows' drafts, with the session's over them.\n        const drafts = new Map(sourceDrafts());\n        const byId = new Map(resident.map(row => [row.id, row]));\n        // What a Save landed over the rows read before it (#1599): each entry as the Save left it — one it removed is\n        // off the rows, one it added among them — so a check never reads a saved row as it stood before its Save.\n        const placed: (readonly [string, EntryVersion[\"place\"]])[] = [];\n        for (const [id, saved] of landed?.() ?? []) {\n            if (entries.has(id)) continue;\n            const version = saved.after;\n            if (version.draft === undefined || version.wire === undefined) { byId.delete(id); drafts.delete(id); continue; }\n            drafts.set(id, encodeDraft(version.draft));\n            byId.set(id, version.wire);\n            placed.push([id, version.place]);\n        }\n        for (const [id, entry] of entries) {\n            if (entry.draft === undefined || entry.wire === undefined) { byId.delete(id); drafts.delete(id); continue; }\n            drafts.set(id, encodeDraft(entry.draft));\n            byId.set(id, entry.wire);\n        }\n        let rows = [...byId.values()];\n        if (keyOrder !== undefined) rows.sort((a, b) => keyOrder(a.id, b.id));\n        else rows = placeInOrder(rows, row => row.id, [...placed, ...Array.from(entries, ([id, entry]) => [id, entry.place] as const)]);\n        const today = new Date();\n        today.setUTCHours(0, 0, 0, 0);\n        // Each row's position: a source row's own; a new row, the row before\n        // it's plus one. And each draft's place among the rows, by one index.\n        const placedAt: number[] = [];\n        const indexOf = new Map<string, number>();\n        rows.forEach((row, i) => {\n            placedAt.push(sourceAt.get(row.id) ?? (i > 0 ? placedAt[i - 1]! + 1 : positions[0] ?? 0));\n            if (!indexOf.has(row.id)) indexOf.set(row.id, i);\n        });\n        // The row checks, one batch for the evaluation (#882): a draft's row —\n        // a flat row, or a loose row (#846) — or each line of a draft's group.\n        // The rows cross the wire once and the bridge builds them once; the\n        // results return in the checks' order.\n        const checks: ReadyCheck[] = [];\n        let results: readonly Readiness[] = [];\n        if (rowCheck !== undefined) {\n            for (const [id, entry] of entries) {\n                if (entry.draft === undefined || entry.wire === undefined) continue;\n                const index = BigInt(indexOf.get(id)!);\n                if (rowOnly(entry.wire)) checks.push({ index, line: none, driver: driverOf(entry.wire.cells) });\n                else entry.wire.lines.forEach((line, at) => checks.push({ index, line: some(BigInt(at)), driver: driverOf(line.cells) }));\n            }\n            if (checks.length > 0) {\n                try { results = rowCheck(encodeBatch({ drafts, rows, rowsOffset: BigInt(placedAt[0] ?? 0), partial, today, checks })); }\n                catch (error) {\n                    // The batch itself failed — its rows could not be built — so\n                    // every check reports why. A check that throws fails alone:\n                    // the bridge catches it per check.\n                    const failed: Readiness = variant(\"invalid\", [{ field: \"\", message: ISSUE_TEXT.rowCheck(error instanceof Error ? error.message : String(error)) }]);\n                    results = checks.map(() => failed);\n                }\n            }\n        }\n        // Reported in the order the checks stand: a group's own check, then its lines'.\n        let next = 0;\n        for (const [id, entry] of entries) {\n            if (entry.draft === undefined || entry.wire === undefined) continue;\n            if (rowOnly(entry.wire)) {\n                if (rowCheck !== undefined) report(results[next++]!, id);\n                continue;\n            }\n            if (groupCheck !== undefined) {\n                try { report(groupCheck(drafts.get(id)!), id); }\n                catch (error) { report(variant(\"invalid\", [{ field: \"\", message: ISSUE_TEXT.groupCheck(error instanceof Error ? error.message : String(error)) }]), id); }\n            }\n            if (rowCheck !== undefined) for (let line = 0; line < entry.wire.lines.length; line++) report(results[next++]!, id, line);\n        }\n        return issues.length ? variant(invalid ? \"invalid\" : \"incomplete\", issues) : variant(\"ready\", null);\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The drafts an author's callbacks read a sheet's rows over (#1599): each row\n * as its person sees it — the rule a gesture begins by (east-ui-components'\n * `EditSession.startOf`), asked for the rows around the one a callback is for.\n *\n * A sheet's callbacks — a column's fill, its options, a custom parse, a link's\n * checks, the rows' readiness — read rows the grid shows, each over its\n * entry's draft: a field no column shows reaches them only so. e3-ui's bridge\n * takes a row's draft from the drafts it is handed, and reads the source for a\n * row they leave out — at the revision the source reads at now. While the rows\n * are read again, after a Save or another session's write, the grid shows them\n * as they were read and that read is on its way: a callback then saw the rows\n * around its own with every such field missing, so a check misfired and a fill\n * proposed nothing until the pages landed.\n *\n * So the sheet hands the bridge each shown row's draft itself: the session's;\n * else what a Save landed of it, while the rows have still to read that Save\n * (both the layer's); else the entry its window was read with (east-ui's\n * `CarriedWindowType`, by the row's id and its place in the source), lifted. A\n * row whose window carries no entry — a sheet over rows held whole, one that\n * writes nothing, a row not yet saved — is left to the bridge's own read, as\n * it was.\n *\n * @packageDocumentation\n */\n\nimport { decodeBeast2For, encodeBeast2For, fromEastTypeValue, type ValueTypeOf } from \"@elaraai/east\";\nimport type { SheetEditingType } from \"@elaraai/e3-ui/internal\";\nimport { liftDraft } from \"./draft-values.js\";\nimport type { RowSegment } from \"./model.js\";\nimport type { SheetRowValue } from \"./values.js\";\n\ntype Editing = ValueTypeOf<typeof SheetEditingType>;\n\n/** The drafts a sheet's callbacks read its rows over (see the module docs). */\nexport interface ShownDrafts {\n    /**\n     * The draft the entry a row was read with lifts to, encoded — made once an entry, however often it is asked for.\n     *\n     * @param id - The row's id\n     * @param at - Its place in the source\n     * @returns Its entry's draft; `undefined` for a row whose window carries no entry of it\n     */\n    readonly base: (id: string, at: number) => Uint8Array | undefined;\n    /**\n     * The drafts a callback over the rows reads them over: the layer's, and for each row it holds none of, the row's\n     * own. The same map while the rows, their runs and the layer are the same ones.\n     *\n     * @param rows - The rows the sheet lays out, the layer applied\n     * @param segments - Their contiguous runs: a row's place in the source is its run's, and its place in the run\n     * @param layer - Each drafted entry's draft, and each one a Save landed that the rows have still to read\n     * @returns Each row's draft, by its id, where it has one\n     */\n    readonly over: (rows: readonly SheetRowValue[], segments: readonly RowSegment[], layer: ReadonlyMap<string, Uint8Array>) => Map<string, Uint8Array>;\n    /**\n     * The drafts a check of one row reads it over: the layer's where it holds the row's, else the row's own alone.\n     *\n     * @param id - The id of the row the check is of — a line's group's, for a line\n     * @param at - Its place in the source\n     * @param layer - Each drafted entry's draft, and each one a Save landed that the rows have still to read\n     * @returns The drafts to hand the check\n     */\n    readonly of: (id: string, at: number, layer: Map<string, Uint8Array>) => Map<string, Uint8Array>;\n}\n\n/**\n * Makes the drafts a sheet's callbacks read its rows over (see the module docs).\n *\n * @param editing - The sheet's editing declaration: its entry and draft types\n * @param entryOf - The stored entry the window standing at a row's place in the source read with it; `undefined` where\n *   the sheet's windows carry none — its rows are held whole, or another query's stand in\n * @returns The drafts, by row\n */\nexport function shownDrafts(editing: Editing, entryOf: ((id: string, at: number) => Uint8Array | undefined) | undefined): ShownDrafts {\n    const draftType = fromEastTypeValue(editing.draftType);\n    const encodeDraft = encodeBeast2For(editing.draftType);\n    const decodeEntry = decodeBeast2For(editing.entryType);\n    // By the entry's bytes, which its window holds while it stands: a window read again carries other bytes.\n    const lifted = new WeakMap<Uint8Array, Uint8Array>();\n    const base = (id: string, at: number): Uint8Array | undefined => {\n        const entry = entryOf?.(id, at);\n        if (entry === undefined) return undefined;\n        let draft = lifted.get(entry);\n        if (draft === undefined) {\n            draft = encodeDraft(liftDraft(draftType, decodeEntry(entry)));\n            lifted.set(entry, draft);\n        }\n        return draft;\n    };\n    let last: {\n        readonly rows: readonly SheetRowValue[]; readonly segments: readonly RowSegment[];\n        readonly layer: ReadonlyMap<string, Uint8Array>; readonly drafts: Map<string, Uint8Array>;\n    } | undefined;\n    const alone = new WeakMap<Uint8Array, Map<string, Uint8Array>>();\n    return {\n        base,\n        over: (rows, segments, layer) => {\n            if (last !== undefined && last.rows === rows && last.segments === segments && last.layer === layer) return last.drafts;\n            const drafts = new Map(layer);\n            if (entryOf !== undefined) {\n                segments.forEach((segment, s) => {\n                    // The last run holds every row after its start, as a callback's context does.\n                    const end = s === segments.length - 1 ? rows.length : Math.min(segment.end, rows.length);\n                    for (let i = segment.start; i < end; i++) {\n                        const row = rows[i]!;\n                        if (drafts.has(row.id)) continue;\n                        const own = base(row.id, segment.position + (i - segment.start));\n                        if (own !== undefined) drafts.set(row.id, own);\n                    }\n                });\n            }\n            last = { rows, segments, layer, drafts };\n            return drafts;\n        },\n        of: (id, at, layer) => {\n            if (layer.has(id)) return layer;\n            const own = base(id, at);\n            if (own === undefined) return layer;\n            let one = alone.get(own);\n            if (one === undefined) {\n                one = new Map([[id, own]]);\n                alone.set(own, one);\n            }\n            return one;\n        },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A sheet's numbers its inspector's fields' bounds don't hold (#1585) — a\n * row's, a line's and a group's own — by the cell each is drawn in: its\n * column's, else the field's own key, which Details names it by. Two things\n * read them: the session's readiness, for each entry a draft changed, so its\n * Save waits (`use-editing.ts`); and each row's presentation, any row's — a\n * stored one nobody changed among them — so its cells wear the warn wash a\n * field still missing wears (`use-session.ts`). The check and its words are\n * the form's own (`fieldBreaches`).\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, isVariant, type ValueTypeOf } from \"@elaraai/east\";\nimport type { SheetFormsType } from \"@elaraai/e3-ui/internal\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { fieldBreaches, getSomeorUndefined, type FieldBreach } from \"@elaraai/east-ui-components\";\nimport { isBounded } from \"../shared/bounds.js\";\n\n/** The inspector's forms, as the payload carries them. */\nexport type SheetForms = ValueTypeOf<typeof SheetFormsType>;\ntype Form = SheetForms[\"row\"];\n\nconst stringEqual = equalFor(StringType);\n\n/** A form's numbers held to a least or a most, and the cell each is drawn in. */\ninterface BoundedForm {\n    /** Their specs. */\n    readonly specs: readonly FieldSpecValue[];\n    /** Each one's cell, by its key: its column's key, else its own. */\n    readonly cells: ReadonlyMap<string, string>;\n}\n\n/** A sheet's bounded numbers: a row's — a grouped sheet's line's — and a group's own. */\nexport interface SheetBounds {\n    /** A row's, or a line's. */\n    readonly row: BoundedForm | undefined;\n    /** A group's own fields'. */\n    readonly group: BoundedForm | undefined;\n}\n\n/** One number of an entry its bounds don't hold: its line, the cell it is drawn in, and the bound broken. */\nexport interface SheetBreach {\n    /** Its line's place in its group; `undefined` for the row's own, or the group's. */\n    readonly line: number | undefined;\n    /** The cell it is drawn in: its column's key, else its field's. */\n    readonly at: string;\n    /** The bound broken. */\n    readonly breach: FieldBreach;\n}\n\n/** A form's numbers held to a least or a most; `undefined` where it holds none. */\nfunction boundedOf(form: Form | undefined): BoundedForm | undefined {\n    const fields = form?.fields.filter((field) => isBounded(field.spec)) ?? [];\n    if (fields.length === 0) return undefined;\n    return {\n        specs: fields.map((field) => field.spec),\n        cells: new Map(fields.map((field) => [field.spec.path.join(\".\"), getSomeorUndefined(field.column) ?? field.spec.path.join(\".\")])),\n    };\n}\n\n/**\n * A sheet's bounded numbers, from its inspector's forms.\n *\n * @param forms - The forms; `undefined` for a sheet with no inspector, whose fields have no bounds\n * @returns Them; `undefined` where no form holds a number to a bound, and nothing is checked\n */\nexport function sheetBoundsOf(forms: SheetForms | undefined): SheetBounds | undefined {\n    const row = boundedOf(forms?.row);\n    const group = boundedOf(getSomeorUndefined(forms?.group));\n    return row === undefined && group === undefined ? undefined : { row, group };\n}\n\n/**\n * An entry's numbers its bounds don't hold, from the value its draft holds as\n * far as it holds one: a flat sheet's row; a group's own fields, then each of\n * its lines'; beside the groups, a loose row's — an entry a variant of the\n * two.\n *\n * @param bounds - The sheet's bounded numbers\n * @param held - The value the entry's draft holds\n * @param lines - A group's lines field; `undefined` for a flat sheet\n * @returns Each breach, its line's first\n */\nexport function entryBreaches(bounds: SheetBounds, held: unknown, lines: string | undefined): SheetBreach[] {\n    const out: SheetBreach[] = [];\n    const take = (form: BoundedForm | undefined, value: unknown, line: number | undefined) => {\n        if (form === undefined || value === undefined) return;\n        for (const breach of fieldBreaches(form.specs, value)) out.push({ line, at: form.cells.get(breach.key) ?? breach.key, breach });\n    };\n    const arm = isVariant(held) ? held : undefined;\n    const value = arm === undefined ? held : arm.value;\n    if (lines === undefined || (arm !== undefined && !stringEqual(arm.type, \"group\"))) {\n        take(bounds.row, value, undefined);\n        return out;\n    }\n    take(bounds.group, value, undefined);\n    ((value as Record<string, readonly unknown[] | undefined> | undefined)?.[lines] ?? []).forEach((line, i) => take(bounds.row, line, i));\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The day a sheet reads and writes its columns from data at (#1559): the\n * browser's local calendar date, at UTC midnight — the `day` an app's `read`,\n * `write` and `mark` are given, so a column keyed by date reads the day the\n * viewer is in, wherever they are. A host with a clock of its own gives it\n * ({@link SheetDayProvider}) — the Record's, so its cells from data turn over\n * with its age cells — and a sheet under none keeps its own, read again at each\n * whole minute while it reads anything at the day, and drawn again only when\n * the day turns.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext, useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { DateTimeType, equalFor } from \"@elaraai/east\";\n\nconst SheetDayContext = createContext<Date | undefined>(undefined);\nconst dayEqual = equalFor(DateTimeType);\nconst MINUTE_MS = 60_000;\n\n/**\n * The day an instant falls on, as a sheet's columns from data are given it: its local calendar date, at UTC midnight.\n *\n * @param now - The instant\n * @returns Its day\n */\nexport function sheetDayOf(now: Date): Date {\n    // The one place the viewer's timezone is read on purpose: the day is the date on their own calendar — the instant\n    // moved by their offset then, read in UTC as every East DateTime is.\n    const local = new Date(now.getTime() - now.getTimezoneOffset() * 60_000);\n    return new Date(Date.UTC(local.getUTCFullYear(), local.getUTCMonth(), local.getUTCDate()));\n}\n\n/**\n * Gives the sheets under it the day of a host's clock — one `Date` while the day holds, so a sheet reads its columns\n * from data again only as the day turns, however often the clock moves.\n *\n * @param props - The host's now, and the parts under it\n * @returns The provider\n */\nexport function SheetDayProvider({ now, children }: { now: Date; children: ReactNode }) {\n    const ms = sheetDayOf(now).getTime();\n    const day = useMemo(() => new Date(ms), [ms]);\n    return <SheetDayContext.Provider value={day}>{children}</SheetDayContext.Provider>;\n}\n\n/**\n * The day a sheet's columns from data are read and written at: its host's, else its own — read again at each whole\n * minute while it `reads`, the sheet drawn again only as the day turns.\n *\n * @param reads - Whether the sheet reads anything at the day: a column from data, or a mark\n * @returns The day\n */\nexport function useSheetDay(reads: boolean): Date {\n    const given = useContext(SheetDayContext);\n    const [own, setOwn] = useState(() => sheetDayOf(new Date()));\n    useEffect(() => {\n        if (given !== undefined || !reads) return undefined;\n        let timer: ReturnType<typeof setTimeout> | undefined;\n        const read = (): void => {\n            const now = new Date();\n            const day = sheetDayOf(now);\n            setOwn((was) => (dayEqual(was, day) ? was : day));\n            timer = setTimeout(read, MINUTE_MS - (now.getTime() % MINUTE_MS));\n        };\n        read();\n        return () => { if (timer !== undefined) clearTimeout(timer); };\n    }, [given, reads]);\n    return given ?? own;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A drafted row that stands through a carry-over (#1599) — pure: whether the\n * rows a sheet draws, read again, have closed over the place a drafted row\n * stood at.\n *\n * A sheet over a record read a page at a time draws a drafted row where its\n * page holds the row. A record that moves is read again a page at a time, and\n * the session reads each drafted row there by its key only after: until that\n * read lands, the session still holds the row as one its record holds. A row\n * changed here that another session removed is then on no page, and not yet a\n * row its draft adds: drawn only where a page holds it, it left the grid for a\n * round trip, and came back with its conflict.\n *\n * Such a row stands where it stood until its session has judged it — but only\n * one the rows read again have closed over, which tells it from a row the\n * sheet no longer draws because its page was let go, scrolled away from:\n *\n * - another row stands at the position it stood at, read at the revision the\n *   source reads at now; or\n * - none does, and the source, counted at that revision, ends before that\n *   position: it was the source's last row.\n *\n * A row whose page was let go has no row drawn at its position, in a source\n * that reaches past it. Positions are the source's own, in whatever order it\n * serves its rows, so the rule holds of a record's key order and of an index's\n * alike.\n *\n * @packageDocumentation\n */\n\n/**\n * Whether the rows the sheet draws now, read again, have closed over the position a row stood at (see the module docs):\n * the row is gone from its place in its source's rows as they are read now, never merely off the pages the sheet holds.\n *\n * @param position - The source position the row stood at\n * @param idAt - The row drawn at a source position now; `undefined` for none\n * @param readNow - Whether the row drawn at a source position was read at the revision its source reads at now\n * @param total - How many rows the source holds, counted at the revision it reads at now; `undefined` while that count is\n *   not known\n * @returns Whether they have\n */\nexport function closedOver(position: number, idAt: (position: number) => string | undefined, readNow: (position: number) => boolean, total: number | undefined): boolean {\n    // Another row stands there, read now: its page was read again, and holds the row no more.\n    if (idAt(position) !== undefined) return readNow(position);\n    // None does: closed over only where the source ends before it. A page let go leaves no row there, in a source that goes on.\n    return total !== undefined && total <= position;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * React integration for a sheet's editing — the shared editing session's hook\n * (`useEditSession`, #879) with the sheet's own gestures (its wire edits,\n * composed into one transaction, with any writes to the drafts' fields a\n * builder's inspector makes beside them, #1188, and the seeds a dropped\n * template's new entry takes, #1187) and its local layer over the resident\n * rows — what a Save landed among it, over the rows read before the Save,\n * until their source reads them again; and a row changed here that the rows,\n * read again, hold no more — another session removed it — standing where it\n * stood until its session has read it by its key (`standing-rows.ts`).\n *\n * @packageDocumentation\n */\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { OptionType, StringType, decodeBeast2For, encodeBeast2For, equalFor, fromEastTypeValue, isVariant, none, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Sheet, SheetEditingType } from \"@elaraai/e3-ui/internal\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { fieldBreachIssue, getSomeorUndefined, useEditSession, type EntryKeys } from \"@elaraai/east-ui-components\";\nimport { boundedReadiness, editWindow, normalizeDraft, prepareRecordSliceSave, recordSliceReadEntries, standingBeforeSave } from \"@elaraai/east-ui-components/internal\";\nimport { authorReadiness } from \"./readiness.js\";\nimport { shownDrafts, type ShownDrafts } from \"./shown-drafts.js\";\nimport { entryBreaches, type SheetBounds } from \"./bounds.js\";\nimport { sheetDayOf } from \"./day.js\";\nimport { SHEET_PAGE_SIZE } from \"./paging.js\";\nimport { entriesByKeyOf, readSinceAnswerOf } from \"../platform/paged-runtime.js\";\nimport { SheetRefused, prepareCreation, unsetField } from \"./creation.js\";\nimport { closedOver } from \"./standing-rows.js\";\nimport type { EntryVersion, EntryUpdate, Origin, Placement, SheetTransactions } from \"./transactions.js\";\nimport type { SheetEditValue, SheetPagedSourceValue, SheetRowValue } from \"./values.js\";\n\ntype Editing = ValueTypeOf<typeof SheetEditingType>;\nconst stringEqual = equalFor(StringType);\nconst encodeWire = encodeBeast2For(Sheet.Types.Row);\nconst NO_ROWS: readonly SheetRowValue[] = [];\nconst NO_POSITIONS: readonly number[] = [];\n/** A row as the Sheet's `project` answers it. */\nconst decodeRow = decodeBeast2For(Sheet.Types.Row);\nconst absent: EntryVersion = { draft: undefined, wire: undefined, place: none };\n/** A wire row's id — the entry it projects. */\nconst sheetRowId = (row: SheetRowValue): string => row.id;\n\n/** A projection of the transaction session over currently resident source rows. */\nexport interface LocalLayer {\n    edits: ReadonlyMap<string, SheetRowValue>;\n    appended: readonly SheetRowValue[];\n    removed: ReadonlySet<string>;\n    placements: ReadonlyMap<string, Placement>;\n}\nexport const EMPTY_LAYER: LocalLayer = { edits: new Map(), appended: [], removed: new Set(), placements: new Map() };\n\n/**\n * How the rows a sheet draws were read: the revision their source is read at\n * now, and which rows were read before it — standing in until their own read\n * lands (#851). What a Save landed is drawn over such rows as it left them\n * (`EditSession.landed`), never as they were before it.\n */\nexport interface SheetRowsRead {\n    /** The revision the source is read at now; `undefined` while it names none. */\n    readonly revision: string | undefined;\n    /** Whether the row drawn at a source position was read before that revision — given none, any row that may yet be drawn. */\n    readonly before: (position: number | undefined) => boolean;\n    /**\n     * How many rows the source holds, counted at that revision; `undefined` while its count there is not known. What\n     * tells a source's last row, gone from it, from a row whose page was let go (`standing-rows.ts`).\n     */\n    readonly total?: number | undefined;\n}\n\n/**\n * One entry, rewritten in the gesture that writes its cells (#1188) — given\n * the entry's version as the gesture's wire events left it, its new version:\n * a field no column shows, set on its draft; a duplicate's whole draft\n * copied, beside the wire row it was copied with.\n */\nexport type DraftEdit = (version: EntryVersion) => EntryVersion;\n\n/**\n * The seeds a gesture's new entries take in place of `newRow`'s and\n * `newGroup`'s (#1187): a dropped template's — the constructor's defaults with\n * the template's fields over them, built by the same code.\n */\nexport interface SheetSeeds {\n    /** A new row's (a new line's) seed. */\n    newRow?: Editing[\"newRow\"] | undefined;\n    /** A new group's seed, with its lines. */\n    newGroup?: Editing[\"newGroup\"] | undefined;\n}\n\n/** What {@link useSheetEditing} hands a sheet: its session, the layer over its rows, and its gesture recorder. */\nexport interface SheetEditingResult {\n    /** The session. */\n    session: SheetTransactions;\n    /** The session's edits over the resident rows. */\n    layer: LocalLayer;\n    /**\n     * Each entry the layer draws as a Save sent it — committed and not yet read back, or landed — by the revision it was\n     * drafted at: a count read there holds nothing of it, and one read since holds it already (#1536). `undefined` for\n     * one held from no revision (`LandedEntry.from`): a count read at a revision is the source's own.\n     */\n    savedFrom: ReadonlyMap<string, string | undefined>;\n    /**\n     * Aggregate a gesture's wire edits, the draft edits beside them (by\n     * entry), and the seeds its new entries take, into one transaction.\n     * Answers whether the session recorded it. A gesture that names itself — an action taken (#1477), `Mark Done` —\n     * gives its `label`; else the label is the origin's. A gesture that `joins` the last one — recorded with the same\n     * key — is one step with it (a phone's cell editor, `Mobile Sheet Spec.md` SH10.1). A gesture with a new entry, or\n     * a new line, the app left a field of empty that no person can set (#1536) throws {@link SheetRefused}, and nothing\n     * is drafted. An entry the sheet no longer draws — scrolled out of the rows read, or out of a narrowing's — begins\n     * from the version a host `held` of it while it was drawn (#1579): what removing a row ticked there takes.\n     */\n    record: (events: readonly SheetEditValue[], placements?: ReadonlyMap<string, Placement>, originOverride?: Origin, draftEdits?: ReadonlyMap<string, DraftEdit>, seeds?: SheetSeeds, label?: string, joins?: string, held?: ReadonlyMap<string, EntryVersion>) => boolean;\n    /**\n     * Record entry versions a gesture computed whole — the optimiser's answer\n     * (#1409), each entry's draft and wire row given — as one transaction of\n     * the origin and label named. Answers whether the session recorded it.\n     */\n    recordVersions: (updates: readonly EntryUpdate[], origin: Origin, label: string) => boolean;\n    /**\n     * An entry's version before any gesture: the session's; else, for one a Save landed that the rows have still to read,\n     * the version the Save left (#1583); else the source's, lifted into its draft.\n     */\n    original: (id: string) => EntryVersion;\n    /** Each drafted entry's draft, encoded. */\n    drafts: Map<string, Uint8Array>;\n    /**\n     * Each entry the layer draws from a draft, and its draft encoded: the session's, and what a Save landed among the\n     * rows read before it — what a sheet's cells from data are read over (#1559).\n     */\n    layerDrafts: { readonly entries: ReadonlyMap<string, EntryVersion>; readonly drafts: ReadonlyMap<string, Uint8Array> };\n    /**\n     * The drafts an author's callbacks read the rows over (#1599): each row as its person sees it — the layer's draft of\n     * it, else the entry its window was read with — never an entry read on its own at the revision now.\n     */\n    shown: ShownDrafts;\n    /**\n     * An entry's wire row as the record would show its draft — the Sheet's own `project` (#1475): what a gesture whose\n     * cells a rule reads (an action's summary) draws at once; `prior` while the draft is not complete.\n     */\n    project: (id: string, draft: unknown, prior: SheetRowValue | undefined) => SheetRowValue | undefined;\n    /** Editing is available now. */\n    available: boolean;\n    /** The session's version. */\n    version: number;\n}\n\n/**\n * Bind decoded callbacks and retain unresolved requests through remounts.\n *\n * @param declared - The decoded editing declaration\n * @param source - The windowed source — a session edits it only when it is pinned\n * @param rows - The source's resident rows\n * @param positions - Each resident row's source position — a failed window before it does not move it (#853)\n * @param storageKey - The view's key\n * @param recordSlice - The record query's primary-entry reader, independent of its narrowed windows\n * @param replacing - Displayed rows belong to the previous query and cannot be edited\n * @param retained - Displayed rows stand in while a key's far jump is read (#1398, CL10): the source's own rows, which\n *   the session still holds, but they take no gesture until the jump's rows replace them\n * @param mint - On a sheet with loose rows between its groups (#846), mints a new line's id field — the field a loose row is identified by\n * @param noun - The host's word for a group: what a refused new group is called (#1536)\n * @param day - The day a column from data writes its cells at (#1559) — the sheet's, which it reads them at; else the\n *   day each gesture is made on\n * @param rowsRead - How the rows were read, where they are read apart from a Save's confirmation — a paged source's\n *   pages, read again at the revision it committed: what the Save landed is drawn over the rows read before it until\n *   they are read again. Without it the rows are the source's as it is, and a Save's entries are theirs at once.\n * @param keys - How a new row is keyed (#1583): the rule the session makes each new row's key by, and makes it another\n *   by where another write adds its own row under it meanwhile; a key the session did not make keeps the two rows a\n *   conflict to choose between\n * @param bounds - The inspector's numbers held to bounds (#1585): an entry a draft changed waits for Save while one is\n *   outside them, as while a field is still missing; `undefined` holds none\n * @param rowsId - The id of the windowed source that gives the rows, no narrowing printed into it: what a Save's entries\n *   are read back by key through where no record Slice gives them (#1596)\n * @param autosave - Whether the builder's Autosave begins on, as its author says; off unless given\n * @param entryOf - The stored entry the window standing at a row's source position read with it (#1599), where the\n *   sheet's windows carry theirs — the pages', or the lens's: what a gesture on a row the sheet shows begins from while\n *   its window is read again, after a Save or another session's write, never a read at the revision the source reads\n *   at now, which is on its way\n * @returns The session, its layer and gesture recorder, the drafts, and whether editing is available\n */\nexport function useSheetEditing(declared: Editing, source: SheetPagedSourceValue | undefined, rows: readonly SheetRowValue[], positions: readonly number[], storageKey: string, mint?: () => string, recordSlice?: ValueTypeOf<RecordSliceBindType>, replacing = false, retained = false, noun?: string, day?: Date, rowsRead?: SheetRowsRead, keys?: EntryKeys, bounds?: SheetBounds, rowsId?: string, autosave?: boolean, entryOf?: (id: string, at: number) => Uint8Array | undefined): SheetEditingResult {\n    const currentRows = replacing ? NO_ROWS : rows;\n    const currentPositions = replacing ? NO_POSITIONS : positions;\n    const editing = useMemo(() => recordSlice === undefined ? declared : { ...declared, sourceId: recordSlice.sourceId }, [declared, recordSlice]);\n    // The session the bounds read each entry's original through, once it is made.\n    const sessionRef = useRef<SheetTransactions | undefined>(undefined);\n    // The entry of a row the sheet shows, by its place among the rows it shows: its own window's. None while the rows\n    // shown are another query's, which the session holds none of.\n    const shownEntry = useMemo(() => (entryOf === undefined || replacing ? undefined : entryOf), [entryOf, replacing]);\n    // Each row's own draft, for the callbacks that read the rows around the one they are for (#1599).\n    const shown = useMemo(() => shownDrafts(editing, shownEntry), [editing, shownEntry]);\n    // What a Save landed that the rows have still to read, as a check asks for it: set below, once the session is made.\n    const landedRef = useRef<() => Iterable<readonly [string, { readonly after: EntryVersion }]>>(() => []);\n    // The author's checks, and each changed entry's numbers outside their bounds (#1585), each named at its cell. They\n    // read every row as the grid shows it: the entry its window was read with, and what a Save landed over the rows\n    // read before it.\n    const ready = useMemo(() => {\n        const author = authorReadiness(editing, currentRows, currentPositions, source !== undefined, shown.base, () => landedRef.current());\n        if (bounds === undefined) return author;\n        const lines = getSomeorUndefined(editing.children);\n        return boundedReadiness(fromEastTypeValue(editing.draftType), (id, held) => entryBreaches(bounds, held, lines).map(({ line, at, breach }) =>\n            fieldBreachIssue(breach, { entry: id, row: line === undefined ? undefined : BigInt(line), field: at })), () => sessionRef.current?.originals, author);\n    }, [editing, currentRows, currentPositions, source, bounds, shown]);\n    // A draft the session made itself — carried over to the record's newer value, or settled — drawn as the record\n    // would show its entry (the Sheet's own `project`); a draft not yet complete keeps the row it had.\n    const wireOf = useMemo(() => {\n        const draftType = fromEastTypeValue(editing.draftType);\n        const encodeEntry = encodeBeast2For(editing.entryType) as (entry: unknown) => Uint8Array;\n        return (id: string, draft: unknown, prior: SheetRowValue | undefined): SheetRowValue | undefined => {\n            const entry = normalizeDraft(draftType, draft, id).domain;\n            return entry === undefined ? prior : decodeRow(editing.project(encodeEntry(entry), id)) as SheetRowValue;\n        };\n    }, [editing]);\n    // A new row the session makes another key — another write having added its own under the first (#1583) — goes on\n    // under it whole: its draft's identity field, where its draft holds one, and its row with it.\n    const underKey = useMemo(() => {\n        const idField = editing.idField.type === \"some\" ? editing.idField.value : undefined;\n        return (next: string, version: EntryVersion): EntryVersion => {\n            const held = version.draft;\n            const fields = (isVariant(held) ? held.value : held) as Record<string, unknown>;\n            const renamed = idField !== undefined && idField in fields ? { ...fields, [idField]: variant(\"value\", next) } : fields;\n            const draft = isVariant(held) ? variant(held.type, renamed) : renamed;\n            const prior = version.wire === undefined ? undefined : { ...version.wire, id: next };\n            return { draft, wire: wireOf(next, draft, prior), place: version.place };\n        };\n    }, [editing, wireOf]);\n    // Where no record Slice gives the rows, a Save's entries are read by key from the source's own rows (#1596).\n    const entriesByKey = useMemo(() => (rowsId === undefined || editing.keyType.type !== \"some\" ? undefined\n        : entriesByKeyOf(rowsId, fromEastTypeValue(editing.keyType.value), fromEastTypeValue(editing.entryType))), [rowsId, editing.keyType, editing.entryType]);\n    // Whether the workspace has read the source's record since its last write from here was answered: a Save's answer\n    // that comes after its pages have moved on never puts them back at the revision it names (#1599).\n    const sourceId = source?.id;\n    const followed = useMemo(() => (sourceId === undefined ? undefined : readSinceAnswerOf(sourceId)), [sourceId]);\n    // Only a PINNED source names the revision a session's base is (#880): an\n    // unpinned one leaves the session without a base, so nothing is drafted —\n    // and the factory refuses such a source an apply.\n    const pinned = useMemo(() => {\n        if (source === undefined) return undefined;\n        const { revision, refresh } = source;\n        return revision !== undefined && refresh !== undefined ? {\n            ...source, revision, refresh, followed, readCurrent: recordSlice?.readEntry, pageSize: SHEET_PAGE_SIZE,\n            // A window read back is its rows and the entries it carried beside them: one read (#1599).\n            page: (offset: bigint, count: bigint) => {\n                const window = source.page(offset, count);\n                return window.type === \"some\" ? some(editWindow(window.value.rows, window.value.entries)) : none;\n            },\n            readCurrentAll: recordSlice === undefined ? entriesByKey : (ids: readonly string[]) => recordSliceReadEntries(recordSlice, ids),\n        } : undefined;\n    }, [source, recordSlice, entriesByKey, followed]);\n    const prepare = useMemo(() => prepareRecordSliceSave(recordSlice, source?.revision), [recordSlice, source]);\n    // An entry's version before any gesture is the session's to say (`EditSession.startOf`, asked by the hook): its own;\n    // else, for one a Save landed that the rows have still to read, what the Save left (#1583) — never the rows read\n    // before it, nor nothing for one it added; else the row drawn. The session holds a landed entry exactly while its\n    // rows have still to read it: the effect below lets it go as they do.\n    const { session, observed, draftType, codecs, rowIndex, original, drafts, available, version } =\n        useEditSession<SheetRowValue>(editing, pinned, currentRows, currentPositions, storageKey, { idOf: sheetRowId, ready, prepare, wireOf, drawsLanded: true, wireType: Sheet.Types.Row, keys, underKey, autosave, entryOf: shownEntry });\n    sessionRef.current = session;\n    // Each row's copies past its first: a window read again at a new revision beside one still standing from before it\n    // holds a row twice where a change moved it from the one to the other.\n    const copies = useMemo(() => {\n        const later = new Map<string, number[]>();\n        currentRows.forEach((row, i) => {\n            if (rowIndex.get(row.id) === i) return;\n            const held = later.get(row.id);\n            if (held === undefined) later.set(row.id, [i]);\n            else held.push(i);\n        });\n        return later;\n    }, [currentRows, rowIndex]);\n    // What a Save landed is drawn over the rows as it left them until they read it (`EditSession.landed`), by the one\n    // rule every host asks (east-ui-components' `standingBeforeSave`): while the page its entry's row is on — any page,\n    // for one not drawn — stands from before the revision its source reads at now, or its source still reads at the\n    // revision it was drafted at. And while the rows are another query's, or held by a key's jump.\n    const awaiting = useCallback((id: string, from: string | undefined): boolean => {\n        if (rowsRead === undefined) return false;\n        if (replacing || retained) return true;\n        const before = (position: number | undefined): boolean => standingBeforeSave(rowsRead.before(position), rowsRead.revision, from);\n        const at = rowIndex.get(id);\n        if (at === undefined) return before(undefined);\n        // A copy read since the Save never lets the Save's version go while another copy was read before it (#1583).\n        return before(currentPositions[at]) || (copies.get(id)?.some((i) => before(currentPositions[i])) ?? false);\n    }, [rowsRead, replacing, retained, rowIndex, copies, currentPositions]);\n    landedRef.current = () => {\n        const waiting: (readonly [string, { readonly after: EntryVersion }])[] = [];\n        for (const [id, saved] of session.landed) if (awaiting(id, saved.from)) waiting.push([id, saved]);\n        return waiting;\n    };\n    /** Aggregate the renderer's writes — the draft edits beside them, its new entries seeded as it says — into one transaction at the effect boundary. */\n    const record = useCallback((events: readonly SheetEditValue[], placements?: ReadonlyMap<string, Placement>, originOverride?: Origin, draftEdits?: ReadonlyMap<string, DraftEdit>, seeds?: SheetSeeds, named?: string, joins?: string, held?: ReadonlyMap<string, EntryVersion>): boolean => {\n        if (replacing || retained || (!events.length && !draftEdits?.size) || !observed || !session.writable) return false;\n        session.observeBase(observed.base);\n        // A dropped template's new entry starts as its seed says, in place of the constructors' (#1187).\n        const seeded: Editing = seeds === undefined ? editing : { ...editing, newRow: seeds.newRow ?? editing.newRow, newGroup: seeds.newGroup ?? editing.newGroup };\n        const updates = new Map<string, EntryUpdate>();\n        const inputs = new Map<string, SheetRowValue>();\n        const at = day ?? sheetDayOf(new Date());\n        let origin: Origin = \"typed\";\n        // What an entry began from: the session's or the drawn rows' — else, for one the sheet no longer draws, what a\n        // host held of it while it was drawn (#1579).\n        const originalOf = (id: string): EntryVersion => {\n            const version = original(id);\n            return version.draft === undefined && version.wire === undefined ? held?.get(id) ?? version : version;\n        };\n        const update = (id: string, row: SheetRowValue | undefined, placement?: Placement) => {\n            const before = updates.get(id)?.before ?? originalOf(id);\n            const current = updates.get(id)?.after ?? before;\n            const prepared = row === undefined ? undefined : prepareCreation(row, current, inputs.get(id), placement ?? current.place, seeded, draftType, mint);\n            if (row !== undefined) inputs.set(id, row);\n            const after: EntryVersion = prepared === undefined ? absent : {\n                draft: codecs.decodeDraft(editing.decode(encodeWire(prepared.row), prepared.draft === undefined ? none : some(codecs.encodeDraft(prepared.draft)), prepared.previous === undefined ? none : some(encodeWire(prepared.previous)), at)),\n                wire: prepared.row, place: placement ?? current.place,\n            };\n            updates.set(id, { id, before, after });\n        };\n        for (const event of events) {\n            switch (event.type) {\n                case \"remove\": origin = \"remove\"; for (const id of event.value.rowIds) update(id, undefined); break;\n                case \"insert\": {\n                    origin = event.value.source.type;\n                    const place: Placement = placements?.get(event.value.row.id) ?? (editing.keyType.type === \"some\" ? some(variant(\"keyOrder\", null)) : some(variant(\"ordered\", event.value.afterRowId.type === \"some\" ? variant(\"after\", event.value.afterRowId.value) : variant(\"end\", null))));\n                    update(event.value.row.id, event.value.row, place); break;\n                }\n                case \"lineRemove\": origin = \"remove\"; update(event.value.rowId, event.value.row); break;\n                default: origin = event.value.source.type; update(event.value.rowId, event.value.row);\n            }\n        }\n        // The draft edits, over each entry as the wire events left it: a field no column shows, a duplicate's copy.\n        for (const [id, edit] of draftEdits ?? []) {\n            const before = updates.get(id)?.before ?? originalOf(id);\n            const current = updates.get(id)?.after ?? before;\n            if (current.draft === undefined) continue;\n            updates.set(id, { id, before, after: edit(current) });\n        }\n        // A new entry, or a new line, the app left a field of empty — one no person can set — is never drafted (#1536):\n        // the whole gesture is refused, and the footer names the field.\n        for (const { before, after } of updates.values()) {\n            const unset = unsetField(before, after, editing, draftType);\n            if (unset !== undefined) throw new SheetRefused({ id: \"cantAdd\", ...unset, noun });\n        }\n        const gestureOrigin = originOverride ?? origin;\n        const label = named !== undefined ? named : gestureOrigin === \"insert\" ? \"Insert row\" : gestureOrigin === \"drop\" ? \"Drop\" : gestureOrigin === \"move\" ? \"Move\"\n            : origin === \"pasted\" ? \"Paste cells\" : origin === \"remove\" ? \"Remove rows\" : origin === \"pattern\" ? \"Accept proposed rows\" : events.length === 0 ? \"Edit fields\" : \"Edit cells\";\n        return session.record([...updates.values()], gestureOrigin, label, joins);\n    }, [session, observed, original, codecs, editing, draftType, mint, replacing, retained, noun, day]);\n    const recordVersions = useCallback((updates: readonly EntryUpdate[], origin: Origin, label: string): boolean => {\n        if (replacing || updates.length === 0 || !observed || !session.writable) return false;\n        session.observeBase(observed.base);\n        return session.record(updates, origin, label);\n    }, [session, observed, replacing]);\n    // The source position each drafted row the rows draw stood at as the layer was last made: what stands through a\n    // carry-over (`standing-rows.ts`).\n    const stoodRef = useRef<ReadonlyMap<string, number>>(new Map());\n    const { layer, savedFrom } = useMemo((): { layer: LocalLayer; savedFrom: ReadonlyMap<string, string | undefined> } => {\n        const edits = new Map<string, SheetRowValue>();\n        const appended: SheetRowValue[] = [];\n        const removed = new Set<string>();\n        const placements = new Map<string, Placement>();\n        const samePlace = equalFor(OptionType(Sheet.Types.EntryPlacement));\n        // The entries drafted away from the source: what a Save landed of one is not drawn while it is.\n        const drafted = new Set<string>();\n        // A Save's entries, by the revision they were drafted at: while the source's commit is read back, each entry its\n        // request changes — one drafted again since among them — at the base the session holds still. An entry first\n        // drafted since the request was sent is a draft as any other.\n        const savedFrom = new Map<string, string | undefined>();\n        const committedFrom = session.status === \"reconciling\" ? session.drafts.revision : undefined;\n        // Whether the rows draw an entry: while another query's rows stand in, theirs — which the session indexes none\n        // of, and which may have read a Save's new entry already (#1583).\n        const drawnIds = replacing ? new Set(rows.map(sheetRowId)) : undefined;\n        const drawn = (id: string): boolean => drawnIds?.has(id) ?? rowIndex.has(id);\n        // Whether the session has yet to judge its drafts where its source reads now: carrying them over to a record that\n        // moved — or, from the very render the record moves in, before the session is told, standing at another revision\n        // with no request of its own out. Its word of a drafted row — that the record holds it — is then of the record as\n        // it was. (A session whose Save is out reads its own commit back, and carries nothing over meanwhile.)\n        const drafting = session.drafts.revision;\n        const carrying = rowsRead !== undefined && !replacing && !retained\n            && (session.carrying || (!session.locked && drafting !== undefined && rowsRead.revision !== undefined && !stringEqual(drafting, rowsRead.revision)));\n        // Whether the rows are their source's whole collection, as it is read now: one that holds no row of a drafted\n        // entry is the record holding none — nothing narrows it, and no page of it is still to land.\n        const whole = rowsRead === undefined && !replacing && !retained;\n        // The row drawn at a source position: asked of the few rows that stood, so made as the first is.\n        let placed: Map<number, string> | undefined;\n        const idAt = (position: number): string | undefined => {\n            if (placed === undefined) {\n                placed = new Map();\n                currentRows.forEach((row, i) => { const at = currentPositions[i]; if (at !== undefined && !placed!.has(at)) placed!.set(at, row.id); });\n            }\n            return placed.get(position);\n        };\n        const stood = stoodRef.current;\n        const stands = new Map<string, number>();\n        for (const [id, entry] of session.entries) {\n            const before = session.originals.get(id) ?? absent;\n            const same = codecs.draftEqual(before.draft === undefined ? none : some(before.draft), entry.draft === undefined ? none : some(entry.draft));\n            if (same && samePlace(before.place, entry.place)) {\n                // The acknowledged source uses fresh positional child keys.\n                // Preserve the session's internal keys by position at this\n                // checked base, so the next edit still finds its hidden fields.\n                const at = rowIndex.get(id);\n                const authoritative = at !== undefined ? rows[at] : undefined;\n                if (authoritative && entry.wire && authoritative.lines.some((line, i) => !stringEqual(line.key, entry.wire!.lines[i]?.key ?? line.key))) {\n                    edits.set(id, { ...authoritative, lines: authoritative.lines.map((line, i) => ({ ...line, key: entry.wire!.lines[i]?.key ?? line.key })) });\n                }\n                continue;\n            }\n            drafted.add(id);\n            if (committedFrom !== undefined && session.sends(id)) savedFrom.set(id, committedFrom);\n            // A draft over what a Save landed is drawn over the rows as that Save's version is, against what they hold\n            // of it from before the Save (#1583): one the Save added stands where it placed it, never off the rows.\n            const saved = session.landed.get(id);\n            const landed = saved !== undefined && awaiting(id, saved.from) ? saved : undefined;\n            const held = landed?.before ?? before;\n            const was = stood.get(id);\n            // A row its draft removes is drawn nowhere, and remembered where it stood: the removal taken back finds it so.\n            if (entry.wire === undefined) { removed.add(id); if (was !== undefined) stands.set(id, was); continue; }\n            if (held.draft === undefined && !drawn(id)) {\n                appended.push(entry.wire);\n                // The Save's new entry still: a count read since that Save holds it.\n                if (landed !== undefined) savedFrom.set(id, landed.from);\n            } else if (!drawn(id) && whole) {\n                // A row changed here that the whole collection, read again, holds no more: another session removed it,\n                // and its session is told only after the render that reads the collection (the shared hook carries\n                // the drafts over once drawn). It is drawn from its draft, at its place, as it is once its session\n                // has judged it a row its draft adds. Left to the session's word of it — that its record holds it —\n                // it left the grid for that one commit: unseen, but the frame took its scroll anchor there, on the\n                // next row, and scrolled the changed row out of view as it came back.\n                appended.push(entry.wire);\n                placements.set(id, entry.place);\n            } else if (!drawn(id) && carrying && was !== undefined && closedOver(was, idAt, (position) => !rowsRead.before(position), rowsRead.total)) {\n                // A row changed here that the rows, read again, hold no more — another session removed it — while its\n                // session has yet to read it by its key: it stands where it stood, never off the grid until that read\n                // lands. One the sheet no longer draws because its page was let go is told from it by the rows that\n                // closed over its place (`standing-rows.ts`).\n                appended.push(entry.wire);\n                stands.set(id, was);\n            } else {\n                edits.set(id, entry.wire);\n                const at = rowIndex.get(id);\n                const position = at === undefined ? undefined : currentPositions[at];\n                if (position !== undefined) stands.set(id, position);\n            }\n            if (!samePlace(held.place, entry.place)) placements.set(id, entry.place);\n        }\n        stoodRef.current = stands;\n        // What a Save landed, over the rows read before it: an entry it removed stays off them, one it added stands where\n        // it placed it until a row read again brings it, and one the rows hold is drawn as the Save left it.\n        for (const [id, saved] of session.landed) {\n            if (drafted.has(id) || !awaiting(id, saved.from)) continue;\n            savedFrom.set(id, saved.from);\n            const { before, after } = saved;\n            if (after.wire === undefined) { removed.add(id); continue; }\n            if (before.draft === undefined && !drawn(id)) appended.push(after.wire); else edits.set(id, after.wire);\n            if (!samePlace(before.place, after.place)) placements.set(id, after.place);\n        }\n        return { layer: { edits, appended, removed, placements }, savedFrom };\n        // The version tracks mutations to the session's maps.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [session, codecs, version, rows, rowIndex, awaiting, replacing, retained, currentRows, currentPositions, rowsRead]);\n    // A landed entry its rows have read again is the source's to draw: the session lets it go.\n    useLayoutEffect(() => {\n        const read: string[] = [];\n        for (const [id, saved] of session.landed) if (!awaiting(id, saved.from)) read.push(id);\n        if (read.length > 0) session.shown(read);\n    }, [session, version, awaiting]);\n    // A landed entry the session holds no draft of — one read back otherwise, its drafts gone with the Save — has its\n    // cells from data read over the version it landed as.\n    const layerDrafts = useMemo(() => {\n        let entries: Map<string, EntryVersion> | undefined;\n        let encoded: Map<string, Uint8Array> | undefined;\n        for (const [id, saved] of session.landed) {\n            if (session.entries.has(id) || saved.after.draft === undefined || !awaiting(id, saved.from)) continue;\n            entries ??= new Map(session.entries);\n            encoded ??= new Map(drafts);\n            entries.set(id, saved.after);\n            encoded.set(id, codecs.encodeDraft(saved.after.draft));\n        }\n        return { entries: entries ?? session.entries, drafts: encoded ?? drafts };\n        // The version tracks mutations to the session's maps.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [session, version, drafts, codecs, awaiting]);\n    return { session, layer, savedFrom, record, recordVersions, original, drafts, layerDrafts, shown, project: wireOf, available: available && !replacing && !retained, version };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A sheet's columns from data, read into its rows (#1559). Each row's cells\n * from data, and every column's marks, are read by the sheet's `cellsAt` at\n * the day: over the row's entry — the one its window read with it, where the\n * sheet's windows carry theirs (#1599), else as the source holds it (`readEntry`)\n * — and over its draft once a gesture has made one. The source's rows carry none of these\n * cells, so its projection stays pure, as it does for an age cell's count. A\n * row is read as it arrives, again whenever its draft changes, and every row\n * again as the day turns; the cells read stand over the row's own, and in\n * place of the last read's, so a mark the draft no longer has goes with it\n * (#1560).\n *\n * A lock never lifts for a read that can't see it: over a draft not yet whole —\n * a field empty, or holding text no column reads — the row's marks are not\n * read, and the last read's stand; and a row whose read fails keeps every\n * marked cell locked, its words saying it couldn't be read, the console why.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { encodeBeast2For, fromEastTypeValue, some, variant, type EastType, type ValueTypeOf } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { SheetReadFromType } from \"@elaraai/e3-ui/internal\";\nimport { normalizeDraft } from \"./draft-values.js\";\nimport type { EntryVersion } from \"./transactions.js\";\nimport type { LocalLayer } from \"./use-editing.js\";\nimport type { SheetRootValue, SheetRowValue } from \"./values.js\";\n\ntype Cells = SheetRowValue[\"cells\"];\n\n/** What reads a sheet's columns from data into its rows, at one day. */\nexport interface SheetCellsFromData {\n    /**\n     * The source's rows, each with the cells read over its entry — as they are while nothing is read. `entryOf` is the\n     * entry the window standing at a row's position read with it (#1599), where the sheet's windows carry theirs.\n     */\n    rows: (rows: readonly SheetRowValue[], positions: readonly number[], entryOf?: (id: string, at: number) => Uint8Array | undefined) => readonly SheetRowValue[];\n    /** The session's layer over them, each of its rows with the cells read over its draft. */\n    layer: (layer: LocalLayer, entries: ReadonlyMap<string, EntryVersion>, drafts: ReadonlyMap<string, Uint8Array>) => LocalLayer;\n    /** What the record holds of an entry a gesture began from, its cells from data read at the day: what a changed cell is told from. */\n    held: (began: EntryVersion) => Cells | undefined;\n}\n\n/** A sheet with nothing to read at the day. */\nconst NOTHING_READ: SheetCellsFromData = { rows: (rows) => rows, layer: (layer) => layer, held: (began) => began.wire?.cells };\n\n/**\n * Reads a sheet's columns from data into its rows at the day (see the module docs): each row once per entry, per draft\n * and per day, so a render that moves none of them reads nothing again.\n *\n * @param value - The sheet's root: its `cellsAt`, and its editing declaration's `readEntry` and draft type\n * @param day - The day the cells are read at\n * @param unread - The words in each marked cell of a row whose read failed: why it is locked\n * @returns The readers — the same ones while the root, the day and the words hold\n */\nexport function useCellsFromData(value: SheetRootValue, day: Date, unread: string): SheetCellsFromData {\n    const { cellsAt, columns, editing } = value;\n    return useMemo((): SheetCellsFromData => {\n        if (cellsAt.type === \"none\") return NOTHING_READ;\n        const cellsOf = cellsAt.value;\n        // The cells a read writes: each column from data's, and every column's marks — each mark's two cells.\n        const readKeys = new Set<string>();\n        const marks: { readonly words: string; readonly lock: string }[] = [];\n        for (const column of columns) {\n            if (getSomeorUndefined(column.from) !== undefined) readKeys.add(column.key);\n            const mark = getSomeorUndefined(column.mark);\n            if (mark !== undefined) { readKeys.add(mark.words); readKeys.add(mark.lock); marks.push(mark); }\n        }\n        const markKeys = new Set(marks.flatMap((mark) => [mark.words, mark.lock]));\n        const draftType = fromEastTypeValue(editing.draftType) as EastType;\n        const encodeDraft = encodeBeast2For(editing.draftType) as (draft: unknown) => Uint8Array;\n        // Whether a draft is whole: every field it needs set and read, so the marks over the row read too.\n        const whole = (draft: unknown, id: string): boolean => normalizeDraft(draftType, draft, id).domain !== undefined;\n        // An app's read or mark that throws leaves the row its own cells, every marked one locked, and is said once.\n        let said = false;\n        const locked = (row: SheetRowValue): SheetRowValue => {\n            if (marks.length === 0) return row;\n            const out = new Map(row.cells);\n            for (const mark of marks) { out.set(mark.words, variant(\"String\", unread)); out.set(mark.lock, variant(\"Boolean\", true)); }\n            return { ...row, cells: out };\n        };\n        const read = (row: SheetRowValue, from: ValueTypeOf<typeof SheetReadFromType>, marked: boolean): SheetRowValue => {\n            let cells: Cells;\n            try {\n                cells = cellsOf(from, day);\n            } catch (error) {\n                if (!said) console.error(\"[Sheet] a column from data or a mark could not be read:\", error);\n                said = true;\n                return locked(row);\n            }\n            // A read stands in for the last one: a cell it wrote that this one doesn't — a mark lifted — goes; but over a\n            // draft not yet whole, whose marks it can't read, the last read's marks stay.\n            const kept = (key: string): boolean => !readKeys.has(key) || cells.has(key) || (!marked && markKeys.has(key));\n            const stale = [...row.cells.keys()].some((key) => !kept(key));\n            if (cells.size === 0 && !stale) return row;\n            const out = new Map([...row.cells].filter(([key]) => kept(key)));\n            for (const [key, cell] of cells) out.set(key, cell);\n            return { ...row, cells: out };\n        };\n        const byEntry = new WeakMap<SheetRowValue, SheetRowValue>();\n        const byDraft = new WeakMap<SheetRowValue, { draft: unknown; row: SheetRowValue }>();\n        const byBegan = new WeakMap<EntryVersion, Cells | undefined>();\n        return {\n            rows: (rows, positions, entryOf) => rows.map((row, i) => {\n                const known = byEntry.get(row);\n                if (known !== undefined) return known;\n                // The entry the row's window read with it (#1599): a row stands at the revision it was read at while its\n                // window is read again — after a Save, or another session's write — and its entry read on its own, at the\n                // revision the source reads at now, is on its way then: a row drawn again meanwhile lost its marks, a lock\n                // among them. A row whose window carried none is read through the source — an entry whose page is not in\n                // reads nothing yet, and is asked again with the rows that bring it.\n                const position = positions[i];\n                const carried = position === undefined ? undefined : entryOf?.(row.id, position);\n                const entry = carried !== undefined ? some(carried) : position === undefined ? undefined : editing.readEntry(row.id, BigInt(position));\n                if (entry?.type !== \"some\") return row;\n                const out = read(row, variant(\"entry\", entry.value), true);\n                byEntry.set(row, out);\n                return out;\n            }),\n            layer: (layer, entries, drafts) => {\n                if (layer.edits.size === 0 && layer.appended.length === 0) return layer;\n                const overDraft = (row: SheetRowValue): SheetRowValue => {\n                    const draft = entries.get(row.id)?.draft;\n                    const bytes = drafts.get(row.id);\n                    if (draft === undefined || bytes === undefined) return row;\n                    const known = byDraft.get(row);\n                    if (known !== undefined && Object.is(known.draft, draft)) return known.row;\n                    const out = read(row, variant(\"draft\", bytes), whole(draft, row.id));\n                    byDraft.set(row, { draft, row: out });\n                    return out;\n                };\n                return { ...layer, edits: new Map([...layer.edits].map(([id, row]) => [id, overDraft(row)])), appended: layer.appended.map(overDraft) };\n            },\n            held: (began) => {\n                if (byBegan.has(began)) return byBegan.get(began);\n                // What the record held, as the day reads it now: a turn of the day since the gesture began marks no cell changed.\n                const wire = began.wire;\n                const cells = wire === undefined || began.draft === undefined ? wire?.cells\n                    : read(wire, variant(\"draft\", encodeDraft(began.draft)), whole(began.draft, wire.id)).cells;\n                byBegan.set(began, cells);\n                return cells;\n            },\n        };\n    }, [cellsAt, columns, editing, day, unread]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Presentation and local discard of a sheet's schema-checked drafts — an\n * entry's, or one line of a group's — over the shared draft presentation\n * (`src/editing/draft.ts`, #879).\n *\n * @packageDocumentation\n */\nimport { equalFor, none, variant, type EastType } from \"@elaraai/east\";\nimport { CLEAN_DRAFT, conflictMarks, presentDraft, type DraftPresentation as EntryPresentation } from \"@elaraai/east-ui-components/internal\";\nimport { type BatchReadiness } from \"@elaraai/east-ui-components\";\nimport type { EntryVersion, SheetTransactions } from \"./transactions.js\";\nimport { SHEET_WORDS, issueText, type SheetWords } from \"./words.js\";\n\n/** How a row presents: its draft's presentation — none for a row nobody drafted — and its numbers outside their bounds. */\nexport interface DraftPresentation extends EntryPresentation {\n    /**\n     * Each number the row holds outside its field's bounds (#1585), by the cell it is drawn in, and what it says there:\n     * the cells that wear the warn wash a field still missing wears — any row's, a stored one nobody changed among them.\n     * None for none.\n     */\n    readonly bounds?: ReadonlyMap<string, string> | undefined;\n}\n\n/**\n * A group's own draft: the entry's — or, on a sheet with loose rows between\n * its groups (#846), whose drafts are entry variants, the group arm's.\n */\nfunction groupDraftOf(type: EastType, draft: unknown): Record<string, unknown> | undefined {\n    if (draft === undefined) return undefined;\n    return (type.type === \"Variant\" ? (draft as { value: unknown }).value : draft) as Record<string, unknown>;\n}\n\n/** Read a child by its internal wire identity, never its current screen position. */\nfunction childOf(type: EastType, entry: EntryVersion | undefined, field: string, key: string): unknown {\n    const index = entry?.wire?.lines.findIndex(line => line.key === key) ?? -1;\n    const group = groupDraftOf(type, entry?.draft);\n    if (index < 0 || group === undefined) return undefined;\n    return (group[field] as unknown[])[index];\n}\n\n/**\n * Derive row affordances from the exact draft schema and acknowledged\n * baseline. The issues are the sheet's words (#861): the renderer's own read\n * back from their canonical English, an author's as written.\n *\n * @param session - The editing session\n * @param type - The entry's draft type — on a sheet with loose rows (#846), the variant of a group and a row\n * @param field - A group's children field\n * @param id - The entry\n * @param child - A line's key\n * @param readiness - The session's readiness, for the author's issues\n * @param words - The sheet's words\n * @returns The presentation\n */\nexport function draftPresentation(session: SheetTransactions, type: EastType, field: string | undefined, id: string, child?: string, readiness?: BatchReadiness, words: SheetWords = SHEET_WORDS): DraftPresentation {\n    const entry = session.entries.get(id);\n    if (entry?.draft === undefined) return CLEAN_DRAFT;\n    const points = session.conflicts.get(id)?.points;\n    const original = session.originals.get(id);\n    // A conflict's steps run from the entry, whatever row of it is presented.\n    const entryType = type;\n    let current: unknown = entry.draft;\n    let before = original?.draft;\n    let row: number | undefined;\n    if (child !== undefined) {\n        const groupType = type.type === \"Variant\" ? type.cases[\"group\"] : type;\n        if (field === undefined || groupType?.type !== \"Struct\" || groupType.fields[field]?.type !== \"Array\") return CLEAN_DRAFT;\n        current = childOf(type, entry, field, child);\n        before = childOf(type, original, field, child);\n        type = groupType.fields[field].value;\n        if (current === undefined) return CLEAN_DRAFT;\n        row = entry.wire?.lines.findIndex(line => line.key === child) ?? -1;\n    }\n    // A row never applied is dropped by its discard only while no request for its source is unresolved — the session's\n    // own, or another view's: one the session has sent may have landed, and a gesture is taken meanwhile all the same.\n    const presented = presentDraft({\n        type, current, before, entry: id, row, readiness, writable: session.writable && session.canDiscard,\n        text: (message) => issueText(message, words),\n    });\n    // Where it holds a conflict not yet chosen: the cells that wear the warn ring, or the row whole.\n    const conflicts = conflictMarks(points, entryType, child === undefined || field === undefined || row === undefined ? undefined : { field, index: row });\n    return conflicts === undefined ? presented : { ...presented, conflicts };\n}\n\n/**\n * How many fields a draft changes against the one its entry began from: a\n * struct's fields counted one by one, any other draft as one field.\n *\n * @param type - The entry's draft type\n * @returns The count, from the draft the entry began from and the draft as it stands\n */\nexport function draftChanges(type: EastType): (before: unknown, current: unknown) => number {\n    if (type.type !== \"Struct\") {\n        const equal = equalFor(type);\n        return (before, current) => (equal(before, current) ? 0 : 1);\n    }\n    const fields = Object.entries(type.fields).map(([name, field]) => ({ name, equal: equalFor(field) }));\n    return (before, current) => {\n        const was = before as Record<string, unknown>;\n        const now = current as Record<string, unknown>;\n        return fields.reduce((n, field) => (field.equal(was[field.name], now[field.name]) ? n : n + 1), 0);\n    };\n}\n\n/**\n * Discard only a never-applied row/group or child, as one ordinary undoable gesture — and only while no request for\n * its source is unresolved: a row the session has sent may have landed, and put back to nothing it would be a removal\n * to save, never a draft dropped.\n *\n * @param session - The editing session\n * @param type - The entry's draft type — on a sheet with loose rows (#846), the variant of a group and a row\n * @param field - A group's children field\n * @param id - The entry\n * @param child - A line's key\n * @returns Whether the draft was discarded\n */\nexport function discardDraft(session: SheetTransactions, type: EastType, field: string | undefined, id: string, child?: string): boolean {\n    if (!session.writable || !session.canDiscard) return false;\n    const before = session.entries.get(id);\n    if (before?.draft === undefined || before.wire === undefined) return false;\n    const baseline = session.originals.get(id);\n    if (child === undefined) {\n        if (baseline?.draft !== undefined) return false;\n        return session.record([{ id, before, after: { draft: undefined, wire: undefined, place: none } }], \"discard\", \"Discard new row\");\n    }\n    if (field === undefined || childOf(type, baseline, field, child) !== undefined) return false;\n    const index = before.wire.lines.findIndex(line => line.key === child);\n    if (index < 0) return false;\n    const group = groupDraftOf(type, before.draft)!;\n    const children = group[field] as unknown[];\n    const kept = { ...group, [field]: children.filter((_, i) => i !== index) };\n    const after: EntryVersion = {\n        ...before,\n        draft: type.type === \"Variant\" ? variant(\"group\", kept) : kept,\n        wire: { ...before.wire, lines: before.wire.lines.filter((_, i) => i !== index) },\n    };\n    return session.record([{ id, before, after }], \"discard\", \"Discard new row\");\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The local layer over the decoded rows: the rows with its edits, appends, removals and placements applied, what it\n * adds to a count of them and takes off it, a row with one cell replaced, a blank row, a line's minted key, and the\n * words a row is named by.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, none } from \"@elaraai/east\";\nimport { NEW_LINE_KEY, NULL_CELL, type SheetColumnIndex, type SheetColumnMeta } from \"./model.js\";\nimport { placeInOrder } from \"./placement.js\";\nimport type { LocalLayer } from \"./use-editing.js\";\nimport type { SheetCellValue, SheetRowValue } from \"./values.js\";\n\n/** A row as the sheet names it — a Record's title, else its first text column's text — where it holds one. */\nexport function rowNameOf(row: SheetRowValue | undefined, columns: SheetColumnIndex): string | undefined {\n    if (row === undefined) return undefined;\n    const named = [...columns.list.filter((column) => column.kind === \"title\"), ...columns.list.filter((column) => column.kind === \"text\")];\n    for (const column of named) {\n        const cell = row.cells.get(column.key);\n        if (cell?.type === \"String\" && cell.value.trim().length > 0) return cell.value;\n    }\n    return undefined;\n}\n\n/** The decoded rows with the local layer applied — its placements in one linear pass (#859), and a keyed source's rows in key order (#1182). */\nexport function applyLayer(source: readonly SheetRowValue[], layer: LocalLayer, keyOrder?: (a: string, b: string) => number): SheetRowValue[] {\n    if (layer.edits.size === 0 && layer.appended.length === 0 && layer.removed.size === 0 && layer.placements.size === 0) return source as SheetRowValue[];\n    const out: SheetRowValue[] = [];\n    for (const r of source) {\n        if (layer.removed.has(r.id)) continue;\n        out.push(layer.edits.get(r.id) ?? r);\n    }\n    for (const r of layer.appended) if (!layer.removed.has(r.id)) out.push(layer.edits.get(r.id) ?? r);\n    const placed = placeInOrder(out, (row) => row.id, layer.placements);\n    if (keyOrder !== undefined) placed.sort((a, b) => keyOrder(a.id, b.id));\n    return placed;\n}\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * What the local layer adds to a count of the source's rows, and takes off it (#1536): each new row, and each row a\n * draft removes — but a Save's, only over a count read at the revision it was drafted at, which holds nothing of it;\n * a count read since holds it already.\n *\n * @param layer - The local layer\n * @param savedFrom - Each entry the layer draws as a Save sent it, by the revision it was drafted at — `undefined` for one\n *   held from no revision, which a count read at a revision holds already\n * @param at - The revision the count was read at; `undefined` where it is not known, which counts each\n * @param among - The rows a narrowing's count is of: only a removed one among them is taken off. None for the record's\n * @returns The rows the layer adds, and those it takes off\n */\nexport function layerCounts(layer: LocalLayer, savedFrom: ReadonlyMap<string, string | undefined>, at: string | undefined, among?: readonly SheetRowValue[]): { added: number; removed: number } {\n    const counted = (id: string): boolean => {\n        if (!savedFrom.has(id) || at === undefined) return true;\n        const from = savedFrom.get(id);\n        return from !== undefined && stringEqual(from, at);\n    };\n    let added = 0;\n    for (const row of layer.appended) if (counted(row.id)) added += 1;\n    let removed = 0;\n    if (among === undefined) {\n        for (const id of layer.removed) if (counted(id)) removed += 1;\n    } else {\n        for (const row of among) if (layer.removed.has(row.id) && counted(row.id)) removed += 1;\n    }\n    return { added, removed };\n}\n\n/** A row with one cell replaced. */\nexport function withCell(row: SheetRowValue, key: string, cell: SheetCellValue): SheetRowValue {\n    const cells = new Map(row.cells);\n    cells.set(key, cell);\n    return { ...row, cells };\n}\n\n/** A fresh row — every declared cell blank; no lines and no band (a flat row, or a line as a pseudo row). */\nexport function blankRow(id: string, columns: readonly SheetColumnMeta[]): SheetRowValue {\n    return { id, owned: false, cells: new Map(columns.map((c) => [c.key, NULL_CELL])), lines: [], band: none, subRows: [] };\n}\n\nexport let mintCounter = 0;\n\n/** A renderer-minted line key (#740) — never a source index, unique within the group. */\nexport function mintLineKey(group: SheetRowValue): string {\n    for (;;) {\n        const key = `${NEW_LINE_KEY}${(mintCounter++).toString(36)}`;\n        if (!group.lines.some((l) => l.key === key)) return key;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The rows and their editing session: what survives a remount, the state machine's store and its folds, the lens and the\n * pages that draw the rows, each row's cells from data at the day, the session and the optimiser's run over it, the drafts,\n * what a row's drafts changed, and the rows with the local layer applied.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport { IntegerType, OptionType, StringType, StructType, equalFor, fromEastTypeValue, isVariant, none, printFor, some } from \"@elaraai/east\";\nimport { Sheet, SheetBatchReadinessType } from \"@elaraai/e3-ui/internal\";\nimport {\n    fieldBreachIssue, fieldBreachText, fieldFormMessages, getSomeorUndefined, useLanding, useLandingStyles, useDataStable, usePersistedState, type BatchReadiness,\n    type EditIssue, type EntryKeys,\n} from \"@elaraai/east-ui-components\";\nimport { kindOfIssue, windowedSourceOf } from \"@elaraai/east-ui-components/internal\";\nimport { RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { NULL_CELL, drawnPx, isLooseRow, layoutLensRun, layoutRun, type SheetGeometry } from \"./model.js\";\nimport { SHEET_PAGE_SIZE, useSheetPaging } from \"./paging.js\";\nimport { NOT_PERSISTED, persistedOf, type SheetPersisted } from \"./persisted.js\";\nimport { useOptimise, type OptimiseCounts } from \"../shared/func/use-optimise.js\";\nimport { sheetOptimiseTypes, type SheetOptimiseRequest, type SheetOptimiseResult, type SheetOptimised } from \"./optimise.js\";\nimport type { LensGeometry, LensWords } from \"./lens-layout.js\";\nimport { useRecordLens } from \"./use-lens.js\";\nimport { initialSheetStore, sheetStoreReducer } from \"./sheet-state.js\";\nimport { useSheetEditing, type LocalLayer, type SheetRowsRead } from \"./use-editing.js\";\nimport { useCellsFromData } from \"./cells-from-data.js\";\nimport { useSheetDay } from \"./day.js\";\nimport { draftChanges, draftPresentation, type DraftPresentation } from \"./draft-state.js\";\nimport { normalizeDraft } from \"./draft-values.js\";\nimport { entryBreaches, sheetBoundsOf, type SheetBreach } from \"./bounds.js\";\nimport type { EntryVersion } from \"./transactions.js\";\nimport type { SheetRowValue, SheetRootValue } from \"./values.js\";\nimport type { SheetHost, SheetRowChanges } from \"./parts.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport { applyLayer } from \"./local-rows.js\";\n\n/** The `rows` source's narrowing, as East prints it: what names a narrowing of the rows apart from another (#1349). */\nconst printRowsWhere = printFor(RecordSliceWhereType);\n\nconst cellEqual = equalFor(Sheet.Types.Cell);\nconst stringEqual = equalFor(StringType);\nconst lineEqual = equalFor(OptionType(IntegerType));\n\nconst readinessEqual = equalFor(SheetBatchReadinessType);\n\n/** A live source's rows under one narrowing, named apart (#1354): the source and its narrowing, as East prints them. */\nconst printNarrowedSource = printFor(StructType({ source: StringType, narrowing: StringType }));\n\nconst NOTHING: ReadonlySet<string> = new Set();\nconst NO_BREACHES: readonly SheetBreach[] = [];\nconst NO_ISSUES: readonly EditIssue[] = [];\n\n/** An entry's numbers outside their bounds, and its lines' keys. */\ninterface EntryBreaches {\n    readonly breaches: readonly SheetBreach[];\n    readonly lines: readonly string[];\n}\n\n/**\n * The session's East values, by their types' names: a value's inferred type carries East's variant brand, which the\n * declaration build cannot name (TS4058).\n */\ninterface SheetSessionValues {\n    readonly readiness: BatchReadiness;\n    readonly rows: SheetRowValue[];\n    readonly sourceRows: readonly SheetRowValue[];\n    readonly storedBreaches: readonly EditIssue[];\n}\n\n/**\n * Holds the rows the sheet draws and the session that edits them (see the module docs).\n *\n * @param value - The Sheet root value\n * @param storageKey - Storage key prefix for persisting component state\n * @param host - What the frame hands the parts\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @returns The store, the lens, the paging, the session, the drafts and the rows\n */\nexport function useSheetSession(value: SheetRootValue, storageKey: string, host: SheetHost, sheetDecode: SheetDecode) {\n    const {\n        activeView, bandPx, blanks, canInsertRows, columns, declaredNoun, decodedRows, driverColumn, group, hostGrid, keyOrder,\n        lensWanted, loose, makeKey, pagedSource, readOnly, rowPx, rowsPart, rowsWhere, subRowPx, words,\n    } = sheetDecode;\n    // ── What survives a remount (#857) ────────────────────────────────────\n    // Under the sheet's `storageKey`: the folds the viewer left, with the tab\n    // they left them on, and where the frame's scroll rests — the Plan's\n    // rule (#813). Read once, at mount; written when either changes, and only\n    // when it differs from what storage holds.\n    const { state: stored, setState: setStored } = usePersistedState<SheetPersisted>(storageKey, NOT_PERSISTED, persistedOf);\n    const [restored] = useState(() => persistedOf(stored));\n    const persistedRef = useRef(restored);\n    const persist = useCallback((next: SheetPersisted) => {\n        persistedRef.current = next;\n        setStored(next);\n    }, [setStored]);\n\n    // ── The state machine ─────────────────────────────────────────────────\n    const [store, dispatchStore] = useReducer(sheetStoreReducer, undefined, () => {\n        // The folds the last session left, when the sheet opens on the tab\n        // they were left on (#857).\n        const opening = activeView ?? null;\n        const restoredFolds = restored.view === opening && restored.folds.length > 0 ? new Map(restored.folds) : undefined;\n        // The ring opens on the first blank row's driver column (else its first\n        // column) — the prototype's \"type an activity on the empty row\"; a\n        // grouped sheet: the first group's blank line.\n        const c = Math.max(0, driverColumn !== undefined ? columns.list.findIndex((col) => col.key === driverColumn) : 0);\n        const first = decodedRows?.[0];\n        const firstFolded = first !== undefined && (restoredFolds?.get(first.id) ?? getSomeorUndefined(first.band)?.folded === true);\n        const blankLine = first !== undefined && !isLooseRow(first) && !firstFolded;\n        const r = group !== undefined ? (blankLine ? 1 + first.lines.length : 0) : decodedRows?.length ?? 0;\n        // Anywhere else the sheet opens with no ring placed (#1531) — a press places it, or the first move key: a ring\n        // nobody placed would sit on an entry, or a band, as if someone had chosen it (#1585). A host's grid draws no\n        // blank row; a sheet that adds no rows, or is read only, types none; a paged sheet's lie past rows not read yet;\n        // a grouped sheet whose first group is folded, or that opens on a loose row (#846), has no blank line to open on.\n        const onBlank = hostGrid === undefined && canInsertRows && blanks > 0 && decodedRows !== undefined && (group === undefined || blankLine);\n        return initialSheetStore({ r, c }, opening, restoredFolds, !onBlank);\n    });\n    const ui = store.ui;\n    const folds = ui.folds;\n    // A phone's bottom container — its action bar or its cell editor — ⌄ closed at a cell (SH9, SH10): it stays closed\n    // there until a press on a cell, that one or another. The cell is held by its row's id and its column's key, so the\n    // rows moving under it never reopens it.\n    const [barClosedAt, setBarClosedAt] = useState<{ id: string; key: string } | undefined>(undefined);\n    const foldedOf = useCallback((row: SheetRowValue): boolean => folds.get(row.id) ?? getSomeorUndefined(row.band)?.folded ?? false, [folds]);\n    // A line's sub rows fold under its id like a group under its own: `false` open, `true` closed, absent untouched.\n    const subRowsOpenOf = useCallback((lineKey: string): boolean | undefined => { const f = folds.get(lineKey); return f === undefined ? undefined : !f; }, [folds]);\n    // What the body draws of one source row (#855): the paged driver measures a\n    // window by it, so an unloaded band is as tall as its rows will be.\n    const geometry = useMemo<SheetGeometry>(() => ({ rowPx, bandPx, subRowPx }), [rowPx, bandPx, subRowPx]);\n    const heightOf = useCallback(\n        (row: SheetRowValue) => drawnPx(row, geometry, group !== undefined ? { foldedOf, subRowsOpen: subRowsOpenOf } : undefined, blanks),\n        [geometry, group, foldedOf, subRowsOpenOf, blanks],\n    );\n    // ── The lens (B§8, #1349) — the `rows` source's narrowing over the record ──\n    // e3 places the narrowing's rows; the lens reads the segments that hold\n    // them near the view, and lays out only the rows the narrowing keeps, each\n    // at its row number, a band at their pitch for those not read yet. A\n    // grouped sheet's rows are its groups: the records the narrowing holds.\n    const lensGeometry = useMemo<LensGeometry>(() => ({ entryPx: group !== undefined ? bandPx + rowPx : rowPx }), [rowPx, bandPx, group]);\n    const lensChangedWord = words.m.lensChanged();\n    const lensWords = useMemo<LensWords>(() => ({ changed: lensChangedWord }), [lensChangedWord]);\n    const lens = useRecordLens({\n        source: lensWanted ? pagedSource : undefined, part: rowsPart, where: rowsWhere,\n        geometry: lensGeometry, words: lensWords,\n    });\n    // What was drawn last — the lens's rows or the pages' — stands in while the other reads its first: a\n    // narrowing chosen or cleared never empties the sheet, the pages swapping for the lens once it has read the\n    // rows near the view (#1354). A sheet that opens on a narrowing reads no pages: the lens draws as it reads.\n    const drawnLast = useRef<\"lens\" | \"pages\" | undefined>(undefined);\n    const lensReady = lensWanted && lens.layout !== undefined && (lens.ready || drawnLast.current !== \"pages\");\n    const pagesStandIn = lensWanted && !lensReady && drawnLast.current === \"pages\";\n    const paging = useSheetPaging(lensReady || (lensWanted && !pagesStandIn) ? undefined : pagedSource, heightOf, undefined, rowsPart?.sourceId);\n    const pagesReady = paging.rows.length > 0 || paging.failures.length > 0 || paging.error !== undefined || (paging.exhausted && paging.total !== undefined);\n    const lensStandsIn = !lensWanted && lens.layout !== undefined && !pagesReady && drawnLast.current === \"lens\";\n    // The rows drawn are the lens's: what it laid out over the record.\n    const lensDrawn = lensReady || lensStandsIn;\n    useLayoutEffect(() => {\n        if (lensDrawn) drawnLast.current = \"lens\";\n        else if (pagedSource !== undefined && pagesReady) drawnLast.current = \"pages\";\n    });\n    const drawnRows: readonly SheetRowValue[] = decodedRows ?? (lensDrawn ? lens.rows : paging.rows);\n    const rowsOffset = decodedRows !== undefined || lensDrawn ? 0 : paging.rowsOffset;\n    // Each source row's position — its index inline; paged, its place in the\n    // source, which a failed window before it does not move (#853); under the\n    // lens, its place in the record.\n    const inlinePositions = useMemo(() => decodedRows?.map((_r, i) => i), [decodedRows]);\n    const sourcePositions: readonly number[] = inlinePositions ?? (lensDrawn ? lens.positions : paging.positions);\n    // Each row's cells from data and every column's marks, read at the day (#1559): over its entry here, over its draft\n    // once it has one (the layer, below) — the source's rows carry none of them.\n    const day = useSheetDay(value.cellsAt.type === \"some\");\n    const fromData = useCellsFromData(value, day, words.m.marksUnread());\n    // The entry each row drawn was read with (#1599): its own window's — the pages', or the lens's — whatever revision\n    // the source has moved to since. Rows held whole are read from as they are.\n    const entryOf = decodedRows !== undefined ? undefined : lensDrawn ? lens.entryOf : paging.entryOf;\n    const sourceRows = useMemo(() => fromData.rows(drawnRows, sourcePositions, entryOf), [fromData, drawnRows, sourcePositions, entryOf]);\n    // Every row resident: inline, or a paged source read to its end — never under the lens, which draws a part of the record.\n    const exhausted = decodedRows !== undefined || (!lensDrawn && paging.exhausted);\n    // The source's element count, once known, and the revision it was read at: a Save's rows are counted over a count\n    // read before it, never one read since, which holds them (#1536).\n    const total = lensDrawn ? lens.total : paging.total;\n    const totalRevision = lensDrawn ? lens.revision : paging.totalRevision;\n    // The rows shown are not the narrowing's yet — another narrowing's stand in, or nothing is read: they take no\n    // gesture (#1345). A new revision's rows reading under the last ones still do.\n    const standingIn = lensDrawn ? lens.replacing || lensStandsIn : paging.replacing || pagesStandIn || (lensWanted && !lensReady);\n    // Every key a new one's must not be (#1536), read as one is made: so it reaches the session made below.\n    const takenRef = useRef<() => Set<string>>(() => new Set());\n    // A new line beside loose rows (#846) takes an id made by the sheet's rule: the field a loose row is identified by, a\n    // key of the same rows. A line is no entry of the session's, so its id is none of the session's own.\n    const mintLineId = useCallback(() => {\n        const taken = takenRef.current();\n        return makeKey({ has: (id) => taken.has(id), ids: () => taken });\n    }, [makeKey]);\n    // How a new row is keyed (#1536, #1583): its key is the session's to make, by the sheet's rule, and the session's own\n    // until its row is saved — made another, by the same rule, where another Save takes it. A gesture says what it knows\n    // taken as it asks (`mintAmong`, below); a carry-over, which no gesture speaks for, reads what the sheet has read. A\n    // rule that can make no other key — the app's `newKey` refusing — leaves the two rows to choose between.\n    const keys = useMemo((): EntryKeys => ({\n        make: (known, _from, taken) => {\n            if (taken === undefined) return makeKey(known);\n            const read = takenRef.current();\n            return makeKey({ has: (id) => read.has(id) || known.has(id), ids: function* () { yield* read; yield* known.ids(); } });\n        },\n    }), [makeKey]);\n    // The rows a key's far jump holds stand in, retained, until its rows replace them (#1398, CL10): the source's own\n    // rows still, which the session holds, but they take no gesture. So do rows read another way than their source\n    // reads them now, while its windows are read again (#1599).\n    const keyHeld = lensDrawn ? lens.reread : paging.held || paging.reread;\n    // How the rows drawn were read: a Save's rows are drawn as it left them over those read before it — the pages a window\n    // at a time while a new revision's are read (#851), the lens a layout at a time — until their source reads them again.\n    const pagesStanding = paging.standing;\n    const rowsRead = useMemo((): SheetRowsRead | undefined => {\n        if (decodedRows !== undefined) return undefined;\n        // The source's count, where it was read at the revision the rows are read at now.\n        const counted = (revision: string | undefined): number | undefined =>\n            (total !== undefined && revision !== undefined && totalRevision !== undefined && stringEqual(totalRevision, revision) ? total : undefined);\n        if (lensDrawn) return { revision: lens.revision, before: () => lens.readBefore, total: counted(lens.revision) };\n        return {\n            revision: paging.revision,\n            before: (position) => position === undefined ? pagesStanding.length > 0 : pagesStanding.includes(Math.floor(position / SHEET_PAGE_SIZE)),\n            total: counted(paging.revision),\n        };\n    }, [decodedRows, lensDrawn, lens.revision, lens.readBefore, paging.revision, pagesStanding, total, totalRevision]);\n    // The inspector's numbers held to bounds (#1585): a changed row's Save waits while one is outside them.\n    const bounds = useMemo(() => sheetBoundsOf(host.forms), [host.forms]);\n    const editingState = useSheetEditing(value.editing, pagedSource, sourceRows, sourcePositions, storageKey, loose ? mintLineId : undefined, rowsPart, standingIn, keyHeld, declaredNoun?.singular, day, rowsRead, keys, bounds, windowedSourceOf(value.rows)?.id, host.autosave, entryOf);\n    const session = editingState.session;\n    // A new row given a new key as the drafts carried over, another write having added its own (#1583): the footer says\n    // so, once — never again as the sheet mounts over a session that did so before.\n    const renumbered = session.renumbered;\n    const renumberedSaid = useRef(renumbered);\n    useLayoutEffect(() => {\n        if (renumberedSaid.current === renumbered) return;\n        renumberedSaid.current = renumbered;\n        const first = [...renumbered][0];\n        if (first === undefined) return;\n        dispatchStore({ t: \"patch\", patch: { msg: { id: \"renumbered\", from: first[0], to: first[1], n: renumbered.size } } });\n    }, [renumbered, dispatchStore]);\n    // ── The app's optimiser (#1409, #1418) ────────────────────────────────\n    // One run over the current tab's rows, its result landed on them as one edit (`use-assembled.tsx`, once the rows and their\n    // versions are read); while the call is out the sheet holds its lock: no cell, row or field edit, no drop, no\n    // history action. The landing and the highlight are measured over the frame the sheet is laid in.\n    const landingRoot = useRef<HTMLDivElement | null>(null);\n    const landing = useLanding(landingRoot);\n    const landingStyles = useLandingStyles();\n    const optimiseTypes = useMemo(() => sheetOptimiseTypes(value.editing), [value.editing]);\n    // The rows as a narrowing of them names them (#1345, #1349): the source and the narrowing of its rows, together —\n    // the key search's scope, and the run's: a change of tab or narrowing stops a run out (O4).\n    const rowsQuery = printNarrowedSource({ source: pagedSource?.id ?? \"\", narrowing: rowsWhere === undefined ? \"\" : printRowsWhere(rowsWhere) });\n    const [optimised, setOptimised] = useState<SheetOptimised | undefined>(undefined);\n    const landRef = useRef<(result: SheetOptimiseResult, request: SheetOptimiseRequest, run: number) => OptimiseCounts | undefined>(() => undefined);\n    const run = useOptimise<SheetOptimiseRequest, SheetOptimiseResult>({\n        name: host.optimise?.name ?? null, requestType: optimiseTypes.request, resultType: optimiseTypes.result,\n        scope: `${rowsQuery}|${ui.tabs.active ?? \"\"}`, storageKey,\n        onLanded: (result, request, n) => landRef.current(result, request, n),\n    });\n    // The lock (R2): while a call is out, nothing is edited — what every write checks beside `readOnly`.\n    const locked = run.running;\n    const canEdit = !readOnly && !locked;\n    // The session's readiness, held by value: what keys on it — the rows'\n    // draft presentations — moves only when it does (#858).\n    const readiness = useDataStable(session.readiness, readinessEqual);\n    const draftType = useMemo(() => fromEastTypeValue(value.editing.draftType), [value.editing.draftType]);\n    const childField = getSomeorUndefined(value.editing.children);\n    // Every key a new one's must not be (#1536): each the sheet has read, and each its batch has drafted, a removed\n    // entry's among them, which the record holds until Apply. Beside loose rows, each drafted line's id too, a key of the\n    // same rows.\n    const lineIdField = loose ? getSomeorUndefined(value.editing.idField) : undefined;\n    const takenKeys = useCallback((): Set<string> => {\n        const taken = new Set<string>();\n        for (const row of sourceRows) taken.add(row.id);\n        for (const [id, entry] of session.entries) {\n            taken.add(id);\n            const draft = entry.draft;\n            if (lineIdField === undefined || childField === undefined || !isVariant(draft) || draft.type !== \"group\") continue;\n            for (const line of (draft.value as Record<string, unknown>)[childField] as readonly Record<string, unknown>[]) {\n                const held = line[lineIdField];\n                if (isVariant(held) && held.type === \"value\") taken.add(held.value as string);\n            }\n        }\n        return taken;\n    }, [sourceRows, session, lineIdField, childField]);\n    takenRef.current = takenKeys;\n    // A new row's key, as a gesture asks for one: the session's to make (#1583), past every key the gesture says is taken\n    // — the sheet's rows, and those it has made already, which the key then joins.\n    const mintAmong = useCallback((taken: Set<string>): string => {\n        const id = session.mint(undefined, taken);\n        if (id === undefined) throw new Error(\"The sheet's session is bound to no rule for a new row's key\");\n        taken.add(id);\n        return id;\n    }, [session]);\n    const draftVersion = editingState.version;\n    // Every gesture the session records, counted (#1533): what a host's status line lets the last gesture's words go by\n    // when the next has none of its own. A ref, read as the sheet draws: a recorded gesture moves the session, which\n    // draws the sheet again.\n    const gestureCount = useRef(0);\n    const recordSession = editingState.record;\n    const recordGesture = useCallback<typeof recordSession>((events, placements, originOverride, draftEdits, seeds, label, joins, held) => {\n        const recorded = recordSession(events, placements, originOverride, draftEdits, seeds, label, joins, held);\n        if (recorded) gestureCount.current += 1;\n        return recorded;\n    }, [recordSession]);\n    const drafts = editingState.drafts;\n    // The session's rows, each with its cells from data read over its draft (#1559) — a Save's landed rows over theirs.\n    const layerDrafts = editingState.layerDrafts;\n    const layer = useMemo(() => fromData.layer(editingState.layer, layerDrafts.entries, layerDrafts.drafts), [fromData, editingState.layer, layerDrafts]);\n    // Each entry's numbers outside their bounds (#1585), read once per session change — from its draft, else from the\n    // source's version of it — and its lines' keys: what its cells' wash and the Issues tab read.\n    const originalOf = editingState.original;\n    const breachesOf = useMemo(() => {\n        const byId = new Map<string, EntryBreaches>();\n        return (id: string): EntryBreaches | undefined => {\n            let found = byId.get(id);\n            if (found !== undefined || bounds === undefined) return found;\n            let version: EntryVersion | undefined = session.entries.get(id);\n            if (version === undefined) { try { version = originalOf(id); } catch { version = undefined; } }\n            found = {\n                breaches: version?.draft === undefined ? NO_BREACHES : entryBreaches(bounds, normalizeDraft(draftType, version.draft, id).held, childField),\n                lines: version?.wire?.lines.map((line) => line.key) ?? [],\n            };\n            byId.set(id, found);\n            return found;\n        };\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- draftVersion tracks changes within the stable transaction session.\n    }, [session, draftType, childField, draftVersion, bounds, originalOf]);\n    // A row's draft presentation, derived once per session change (#858): the\n    // gutter's decisions and the row read the same one, and between changes a\n    // row keeps it by identity, so its memo holds. Any row's numbers outside\n    // their bounds join it (#1585) — a stored row's nobody changed among them —\n    // so its cells wear the warn wash.\n    const draftOf = useMemo(() => {\n        const byEntry = new Map<string, Map<string | undefined, DraftPresentation>>();\n        const formWords = { ...words, m: fieldFormMessages };\n        return (id: string, child?: string): DraftPresentation => {\n            let byChild = byEntry.get(id);\n            if (byChild === undefined) { byChild = new Map(); byEntry.set(id, byChild); }\n            let found = byChild.get(child);\n            if (found === undefined) {\n                found = draftPresentation(session, draftType, childField, id, child, readiness, words);\n                const held = breachesOf(id);\n                const line = child === undefined ? undefined : held?.lines.findIndex((key) => stringEqual(key, child));\n                const own = held?.breaches.filter((b) => b.line === line) ?? NO_BREACHES;\n                if (own.length > 0) {\n                    const said = new Map(own.map((b) => [b.at, fieldBreachText(b.breach, formWords)] as const));\n                    found = { ...found, bounds: said, issues: new Map([...said, ...found.issues]) };\n                }\n                byChild.set(child, found);\n            }\n            return found;\n        };\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- draftVersion tracks changes within the stable transaction session.\n    }, [session, draftType, childField, readiness, draftVersion, words, breachesOf]);\n    // What a row's drafts changed against what the record holds (#1531), for a host's rows: derived once per session\n    // change and per rows, so between changes a row keeps it by identity and its memo holds.\n    const fieldChanges = useMemo(() => draftChanges(draftType), [draftType]);\n    const changesOf = useMemo(() => {\n        const byId = new Map<string, SheetRowChanges | null>();\n        return (id: string, row: SheetRowValue): SheetRowChanges | undefined => {\n            const known = byId.get(id);\n            if (known !== undefined) return known ?? undefined;\n            const began = session.originals.get(id);\n            const draft = session.entries.get(id)?.draft;\n            let found: SheetRowChanges | null = null;\n            if (began !== undefined && draft !== undefined) {\n                if (began.draft === undefined) {\n                    // Its fields still missing, as its readiness finds them: what a person must fill before Save.\n                    const checked = normalizeDraft(draftType, draft, id).readiness;\n                    const missing = new Set<string>();\n                    if (checked.type !== \"ready\") {\n                        for (const issue of checked.value) {\n                            if (issue.field.type === \"some\" && issue.row.type === \"none\" && kindOfIssue(issue, checked) === \"incomplete\") missing.add(issue.field.value);\n                        }\n                    }\n                    found = { added: true, dirty: NOTHING, held: undefined, fields: 0, missing };\n                } else {\n                    const dirty = new Set<string>();\n                    const held = fromData.held(began);\n                    for (const [key, cell] of row.cells) if (!cellEqual(held?.get(key) ?? NULL_CELL, cell)) dirty.add(key);\n                    found = { added: false, dirty, held, fields: fieldChanges(began.draft, draft), missing: NOTHING };\n                }\n            }\n            byId.set(id, found);\n            return found ?? undefined;\n        };\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- draftVersion tracks changes within the stable transaction session; the rows, what a change is read against.\n    }, [session, draftVersion, sourceRows, layer, draftType, fieldChanges, fromData]);\n    // Temporary writes within one reducer effect batch; the transaction session\n    // publishes the completed gesture and owns the rendered layer thereafter.\n    const layerRef = useRef(layer);\n    layerRef.current = layer;\n    const setLayer = useCallback((fn: (prev: LocalLayer) => LocalLayer) => { layerRef.current = fn(layerRef.current); }, []);\n    const rows = useMemo(() => applyLayer(sourceRows, layer, keyOrder), [sourceRows, layer, keyOrder]);\n    // The rows' numbers outside their bounds that hold no Save (#1585): each of a row nobody changed — whose readiness\n    // raises none — an issue the Issues tab lists amber beside its cell's wash, naming the row and the field in the\n    // hint's own words. A changed row's are its readiness's, which hold Save.\n    const storedBreaches = useMemo((): readonly EditIssue[] => {\n        if (bounds === undefined) return NO_ISSUES;\n        const raised = readiness.type === \"ready\" ? [] : readiness.value;\n        const out: EditIssue[] = [];\n        for (const row of rows) {\n            for (const { line, at, breach } of breachesOf(row.id)?.breaches ?? NO_BREACHES) {\n                const own = raised.some((issue) => stringEqual(issue.entry, row.id) && issue.field.type === \"some\" && stringEqual(issue.field.value, at)\n                    && lineEqual(issue.row, line === undefined ? none : some(BigInt(line))));\n                if (!own) out.push(fieldBreachIssue(breach, { entry: row.id, row: line === undefined ? undefined : BigInt(line), field: at }));\n            }\n        }\n        return out;\n    }, [bounds, readiness, rows, breachesOf]);\n    // Each row's position on screen, where each failed window sits among the\n    // rows, and the contiguous runs between them (#853) — under the lens, each\n    // row's place in the record, and the runs of rows it draws together.\n    const runLayout = useMemo(() => {\n        const at = new Map(sourceRows.map((row, i) => [row.id, sourcePositions[i]!] as const));\n        if (lensDrawn) return layoutLensRun(rows, (id) => at.get(id));\n        return layoutRun(rows, rowsOffset, decodedRows !== undefined ? [] : paging.failures, (id) => at.get(id));\n    }, [rows, rowsOffset, sourceRows, sourcePositions, decodedRows, paging.failures, lensDrawn]);\n    const named: SheetSessionValues = { readiness, rows, sourceRows, storedBreaches };\n    return {\n        barClosedAt, canEdit, changesOf, childField, dispatchStore, draftOf, draftType, draftVersion, drafts,\n        editingState, exhausted, foldedOf, folds, geometry, gestureCount, keyHeld, landRef, landing, landingRoot,\n        landingStyles, layer, layerRef, lens, lensDrawn, locked, mintAmong, mintLineId, optimiseTypes, optimised, pagesReady,\n        pagesStandIn, paging, persist, persistedRef, recordGesture, restored, rowsOffset, rowsQuery, run, runLayout,\n        session, setBarClosedAt, setLayer, setOptimised, standingIn, store, subRowsOpenOf, takenKeys, total, totalRevision, ui,\n        ...named,\n    };\n}\n\n/** What {@link useSheetSession} gives the parts after it. */\nexport type SheetSession = ReturnType<typeof useSheetSession>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Sides and locks (B§4.2 — `Sheet Spec.md` §5 row 5): the driver member's\n * `sides` value — `both` · `from` (To locked) · `to` (From locked) · `in`\n * (From locked, the divider drawn as a minus) — selects the live halves; the\n * column's lock rules name the tag a locked half shows. No driver, or a\n * driver without `sides`: both live.\n *\n * A locked half is never predicted into and Tab skips it, but typing into it\n * is allowed: the content is kept and the tag turns warn — a flag, not a\n * block.\n */\n\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { SheetColumnMeta } from \"../model.js\";\nimport type { SheetMemberValue } from \"../values.js\";\n\n/** The driver's sides value. */\nexport type SidesValue = \"both\" | \"from\" | \"to\" | \"in\";\n\n/** One half's state. */\nexport interface HalfState {\n    /** The half takes members: predicted into, Tab reaches it. */\n    live: boolean;\n    /** The lock tag's text when the half is locked (`\"\"` = locked without a tag, or live). */\n    lock: string;\n}\n\n/** Both halves of a link cell. */\nexport interface LinkHalves {\n    from: HalfState;\n    to: HalfState;\n    /** `in` — the divider draws as a minus. */\n    isIn: boolean;\n    sides: SidesValue;\n}\n\n/** The decoded sides declaration of a link column, flattened. */\nexport interface SidesDecl {\n    byDriver: ReadonlyMap<string, SidesValue>;\n    locks: readonly { half: \"from\" | \"to\"; when: SidesValue; label: string }[];\n}\n\n/** Read a link column's sides declaration off the decoded kind (`undefined` when it declares none). */\nexport function sidesDeclOf(meta: SheetColumnMeta): SidesDecl | undefined {\n    if (meta.raw.kind.type !== \"link\") return undefined;\n    const decl = getSomeorUndefined(meta.raw.kind.value.sides);\n    if (decl === undefined) return undefined;\n    return {\n        byDriver: new Map([...decl.byDriver].map(([k, v]) => [k, v.type])),\n        locks: decl.locks.map((l) => ({ half: l.half.type, when: l.when.type, label: l.label })),\n    };\n}\n\nconst BOTH: LinkHalves = { from: { live: true, lock: \"\" }, to: { live: true, lock: \"\" }, isIn: false, sides: \"both\" };\n\n/** The halves a row's driver value makes live, and the tags its locks show. */\nexport function halvesFor(decl: SidesDecl | undefined, driverKey: string | undefined): LinkHalves {\n    if (decl === undefined || driverKey === undefined) return BOTH;\n    const sides = decl.byDriver.get(driverKey) ?? \"both\";\n    const lockOf = (half: \"from\" | \"to\"): string => decl.locks.find((l) => l.half === half && l.when === sides)?.label ?? \"\";\n    return {\n        from: { live: sides === \"both\" || sides === \"from\", lock: sides === \"both\" || sides === \"from\" ? \"\" : lockOf(\"from\") },\n        to: { live: sides !== \"from\", lock: sides !== \"from\" ? \"\" : lockOf(\"to\") },\n        isIn: sides === \"in\",\n        sides,\n    };\n}\n\n/** The half the caret opens in: the first live half still empty, else the destination. */\nexport function startSide(halves: LinkHalves, groups: readonly [readonly SheetMemberValue[], readonly SheetMemberValue[]]): 0 | 1 {\n    if (halves.from.live && groups[0].length === 0) return 0;\n    if (halves.to.live && groups[1].length === 0) return 1;\n    return halves.to.live ? 1 : 0;\n}\n\n/** Whether a half with content sits under a lock — the warn treatment. */\nexport function halfWarns(half: HalfState, members: readonly SheetMemberValue[]): boolean {\n    return !half.live && members.length > 0;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Link autocomplete and prediction (B§4.5 — `Sheet Spec.md` §5 row 8).\n *\n * Candidates, in order: the exact identified code → identified codes by\n * prefix when the input looks like a code → countables by name / alias, each\n * followed by an *enumerate* alternative listing its free identified members\n * → identified codes by prefix otherwise → other countables by key prefix →\n * the placeholder. Members already in the cell are never offered twice. A\n * range shows one candidate: its expansion.\n *\n * Prediction runs only while the buffer is empty, per half, never into a\n * locked half, from the column's fill providers as `Link` values (the copilot\n * runner of P4 supplies the predicted link): the predicted members not yet\n * in the cell, a counted member withdrawn once the half has named members.\n */\n\nimport { variant } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { memberLabel } from \"../model.js\";\nimport {\n    classifyToken, isCountable, isIdentified, memberMeta, parseRange, resolveMember, usedKeys,\n    type LinkVocabulary,\n} from \"./grammar.js\";\nimport type { SheetLinkValue, SheetMemberValue, SheetRegisterMemberValue } from \"../values.js\";\nimport type { SheetWords } from \"../words.js\";\n\n/** One candidate the strip lists. */\nexport interface LinkCandidate {\n    /** The text the buffer takes (and the chip's label). */\n    label: string;\n    /** The register's line beside it. */\n    meta: string;\n    /** What picking it adds to the half. */\n    members: SheetMemberValue[];\n}\n\nconst identified = (key: string): SheetMemberValue => variant(\"identified\", { key });\n\n/**\n * The free identified members under a countable: the ones naming it as their\n * `parent` (a bay's machines), else the ones whose `meta` names it (a family's).\n */\nexport function membersUnder(parent: SheetRegisterMemberValue, vocab: LinkVocabulary, used: ReadonlySet<string>): SheetRegisterMemberValue[] {\n    const key = parent.key.toLowerCase();\n    const free = (m: SheetRegisterMemberValue) => isIdentified(vocab, m) && !used.has(m.key.toLowerCase());\n    const byParent = vocab.members.filter((m) => free(m) && getSomeorUndefined(m.parent)?.toLowerCase() === key);\n    if (byParent.length > 0) return byParent;\n    return vocab.members.filter((m) => free(m) && getSomeorUndefined(m.meta)?.toLowerCase() === key);\n}\n\n/**\n * The scored candidates for a typed buffer, in the B§4.5 order — their metas\n * in the sheet's words where they are its own (#861).\n *\n * @param query - The typed buffer\n * @param vocab - The column's vocabulary\n * @param used - The lower-cased keys the cell already holds\n * @param w - The sheet's words\n * @returns The candidates, best first\n */\nexport function linkCandidates(query: string, vocab: LinkVocabulary, used: ReadonlySet<string>, w: SheetWords): LinkCandidate[] {\n    const t = query.trim().toLowerCase();\n    if (t === \"\") return [];\n    const free = (m: SheetRegisterMemberValue) => !used.has(m.key.toLowerCase());\n    const rng = parseRange(t, vocab);\n    if (rng !== undefined) {\n        const names = rng.members.map((m) => m.key).join(\", \");\n        // The span in the kind's own word (`→ 6 machines: …`).\n        const n = rng.members.length;\n        return [{\n            label: `${rng.from}-${rng.to}`,\n            meta: w.m.candidateRange({ n, count: w.number(n), kind: rng.members[0]!.kind, names: names.length > 34 ? `${names.slice(0, 34)}…` : names }),\n            members: [variant(\"range\", { from: rng.from, to: rng.to })],\n        }];\n    }\n    const out: LinkCandidate[] = [];\n    const seen = new Set<string>();\n    const push = (m: SheetRegisterMemberValue, members?: SheetMemberValue[]) => {\n        if (seen.has(m.key)) return;\n        seen.add(m.key);\n        out.push({ label: m.label, meta: getSomeorUndefined(m.meta) ?? (isCountable(vocab, m) ? m.kind : \"\"), members: members ?? [identified(m.key)] });\n    };\n    const exact = resolveMember(query, vocab);\n    if (exact !== undefined && free(exact) && !isCountable(vocab, exact)) push(exact);\n    // A code prefix ghosts a code before a name gets a look — `r21` is someone\n    // typing R2140, not asking for a router.\n    const codeLike = /^[a-z]?\\d/.test(t);\n    const bare = t.replace(/\\s+/g, \"\");\n    const codeHits = vocab.members.filter((m) => isIdentified(vocab, m) && free(m) && (\n        m.key.toLowerCase().startsWith(bare)\n        || (/^\\d/.test(bare) && vocab.prefixes.some((p) => m.key.toLowerCase().startsWith(`${p.toLowerCase()}${bare}`)))\n    ));\n    if (codeLike) for (const m of codeHits) push(m);\n    // Countables by name / alias (a leading \"the\" dropped), each followed by its enumerate alternative.\n    const named = t.replace(/^the\\s+/, \"\");\n    for (const m of vocab.members) {\n        if (!isCountable(vocab, m) || !free(m)) continue;\n        const names = [m.key.toLowerCase(), m.label.toLowerCase(), ...m.aliases.map((a) => a.toLowerCase())];\n        if (!names.some((n) => n.startsWith(named) || n.replace(/^the\\s+/, \"\").startsWith(named))) continue;\n        push(m);\n        const under = membersUnder(m, vocab, used);\n        if (under.length > 0) {\n            out.push({\n                label: under.map((x) => x.key).join(\", \"),\n                meta: w.m.candidateEnumerate({ n: under.length, count: w.number(under.length) }),\n                members: under.map((x) => identified(x.key)),\n            });\n        }\n    }\n    if (!codeLike) for (const m of codeHits) push(m);\n    // Other countables by key prefix, spacing ignored (`bay2`, `3m`).\n    for (const m of vocab.members) {\n        if (!isCountable(vocab, m) || !free(m) || seen.has(m.key)) continue;\n        if (m.key.toLowerCase().replace(/\\s+/g, \"\").startsWith(bare)) push(m);\n    }\n    if (\"tbc\".startsWith(t)) out.push({ label: \"TBC\", meta: w.m.candidateTbc(), members: [variant(\"placeholder\", null)] });\n    return out;\n}\n\n/**\n * The armed candidate: the explicit pick, else the top one once something is typed.\n *\n * @param query - The typed buffer\n * @param hi - The explicit pick (`-1` = none)\n * @param vocab - The column's vocabulary\n * @param used - The lower-cased keys the cell already holds\n * @param w - The sheet's words\n * @returns The candidate, if any\n */\nexport function linkCandidateAt(query: string, hi: number, vocab: LinkVocabulary, used: ReadonlySet<string>, w: SheetWords): LinkCandidate | undefined {\n    if (query.trim() === \"\") return undefined;\n    const list = linkCandidates(query, vocab, used, w);\n    if (list.length === 0) return undefined;\n    return list[Math.min(Math.max(hi, 0), list.length - 1)];\n}\n\n/** The inline ghost — the armed candidate's suffix when it completes the buffer. */\nexport function linkGhost(query: string, cand: LinkCandidate | undefined): string {\n    const t = query.trim();\n    if (t === \"\" || cand === undefined) return \"\";\n    return cand.label.toLowerCase().startsWith(t.toLowerCase()) ? cand.label.slice(t.length) : \"\";\n}\n\n/** The replacement preview — a real match that is not a prefix (an alias, an attribute, a range). */\nexport function linkResolve(query: string, cand: LinkCandidate | undefined): string {\n    const t = query.trim();\n    if (t === \"\" || cand === undefined) return \"\";\n    if (linkGhost(query, cand) !== \"\") return \"\";\n    return cand.label.toLowerCase() === t.toLowerCase() ? \"\" : `${cand.label}${cand.meta !== \"\" ? `  ${cand.meta}` : \"\"}`;\n}\n\n/**\n * What a buffer resolves to on `,` / ⏎ / a hop / a commit: the armed\n * candidate when it completes the buffer, else the grammar over the text\n * (commas split, ranges expand, the counted form counts).\n */\nexport function resolveBuffer(query: string, cand: LinkCandidate | undefined, vocab: LinkVocabulary): SheetMemberValue[] {\n    const t = query.trim();\n    if (t === \"\") return [];\n    if (cand !== undefined && linkGhost(query, cand) !== \"\") return cand.members;\n    if (t.includes(\",\")) return t.split(\",\").flatMap((x) => classifyToken(x, vocab));\n    return classifyToken(t, vocab);\n}\n\n/**\n * The predicted members for one half — the fill's link minus what the cell\n * already holds; a counted member withdrawn once the half has named members;\n * never into a locked half; nothing while the buffer is typed.\n */\nexport function predictedMembers(\n    predicted: SheetLinkValue | undefined,\n    side: 0 | 1,\n    groups: readonly [readonly SheetMemberValue[], readonly SheetMemberValue[]],\n    live: boolean,\n    typed: string,\n    vocab: LinkVocabulary,\n): SheetMemberValue[] {\n    if (predicted === undefined || !live || typed.trim() !== \"\") return [];\n    const have = new Set([...groups[0], ...groups[1]].map((m) => memberLabel(m).toLowerCase()));\n    const used = usedKeys([...groups[0], ...groups[1]], vocab);\n    const named = groups[side].length > 0;\n    const out: SheetMemberValue[] = [];\n    for (const m of side === 0 ? predicted.from : predicted.to) {\n        if (have.has(memberLabel(m).toLowerCase())) continue;\n        if (m.type === \"identified\" && used.has(m.value.key.toLowerCase())) continue;\n        if (m.type === \"counted\" && named) continue;\n        out.push(m);\n    }\n    return out.slice(0, 5);\n}\n\n/** Whether `b` is the code after `a`: the same letters and suffix, the next number (`R2140` → `R2141`). */\nfunction follows(a: SheetRegisterMemberValue, b: SheetRegisterMemberValue): boolean {\n    if (a.kind !== b.kind) return false;\n    const x = /^([A-Za-z]*)(\\d+)([A-Za-z]?)$/.exec(a.key);\n    const y = /^([A-Za-z]*)(\\d+)([A-Za-z]?)$/.exec(b.key);\n    return x !== null && y !== null && x[1]!.toLowerCase() === y[1]!.toLowerCase() && x[3]!.toLowerCase() === y[3]!.toLowerCase() && Number(y[2]) === Number(x[2]) + 1;\n}\n\n/**\n * The entry menu of a link half, in the vocabulary's order (the options rule's,\n * when the row is offered a subset): the countable abstractions (nobody guesses\n * a code) and each RUN of a ranged kind's consecutive codes as one range\n * (`R2140-R2145`, #844); the identified codes only when nothing else is\n * offered. Nothing already used.\n *\n * @param vocab - The column's vocabulary\n * @param used - The lower-cased keys the cell already holds\n * @param w - The sheet's words (a range's span, #861)\n * @returns The menu\n */\nexport function linkEntryCandidates(vocab: LinkVocabulary, used: ReadonlySet<string>, w: SheetWords): LinkCandidate[] {\n    const out: LinkCandidate[] = [];\n    const ranged = new Set(vocab.kinds.filter((k) => k.ranged).map((k) => k.kind));\n    const members = vocab.members.filter((m) => !used.has(m.key.toLowerCase()));\n    const one = (m: SheetRegisterMemberValue): LinkCandidate => ({ label: m.label, meta: getSomeorUndefined(m.meta) ?? m.kind, members: [identified(m.key)] });\n    for (let i = 0; i < members.length && out.length < 8; i++) {\n        const m = members[i]!;\n        if (ranged.has(m.kind) && isIdentified(vocab, m)) {\n            let last = m;\n            let n = 1;\n            while (i + 1 < members.length && follows(last, members[i + 1]!)) { last = members[++i]!; n++; }\n            if (n === 1) out.push(one(m));\n            else out.push({ label: `${m.key}-${last.key}`, meta: w.m.rangeSpan({ n, count: w.number(n), kind: m.kind }), members: [variant(\"range\", { from: m.key, to: last.key })] });\n            continue;\n        }\n        if (isCountable(vocab, m)) out.push(one(m));\n    }\n    if (out.length > 0) return out;\n    for (const m of members) {\n        if (!isIdentified(vocab, m)) continue;\n        out.push(one(m));\n        if (out.length >= 8) break;\n    }\n    return out;\n}\n\n/**\n * The grammar line the strip states when a half has nothing to offer — the\n * forms the half takes, in the sheet's words (#861); `TBC` is the grammar's\n * own token.\n *\n * @param vocab - The column's vocabulary\n * @param w - The sheet's words\n * @returns The line\n */\nexport function grammarLine(vocab: LinkVocabulary, w: SheetWords): string {\n    const parts: string[] = [];\n    for (const k of vocab.kinds) {\n        if (k.kind === \"range\") continue;\n        parts.push(k.identified ? w.m.grammarCode({ kind: k.kind }) : k.kind);\n    }\n    if (vocab.countableKinds.size > 0) parts.push(w.m.grammarCounted());\n    if (vocab.ranges) parts.push(w.m.grammarRange());\n    parts.push(\"TBC\");\n    return parts.join(\" · \");\n}\n\n/**\n * The metas of a candidate list's members, for tests and the strip.\n *\n * @param c - The candidate\n * @param vocab - The column's vocabulary\n * @param w - The sheet's words\n * @returns The first meta a member has, or `\"\"`\n */\nexport function candidateMeta(c: LinkCandidate, vocab: LinkVocabulary, w: SheetWords): string {\n    return c.meta !== \"\" ? c.meta : c.members.map((m) => memberMeta(m, vocab, w)).find((s) => s !== \"\") ?? \"\";\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Member checks (B§2 `check` — `Sheet Spec.md` §3.4): `exists` is the\n * grammar's own — an identified, counted or range member must name a\n * register key; a placeholder or text passes — and the rest are the\n * author's, bridged wire functions over the check context returning\n * `some(message)` to flag a member. Flags are shown, never enforced; a check\n * that throws flags nothing and logs (fail-open).\n */\n\nimport type { LinkVocabulary } from \"./grammar.js\";\nimport type { SheetColumnMeta } from \"../model.js\";\nimport type { SheetMessages } from \"../messages.js\";\nimport type { SheetCheckContextValue, SheetCheckValue, SheetLinkValue, SheetMemberValue } from \"../values.js\";\n\n/** One check of a link column — the decoded wire check: `exists`, or the author's bridged rule. */\nexport type CheckDecl = SheetCheckValue;\n\n/** Read a link column's checks off the decoded kind. */\nexport function checksOf(meta: SheetColumnMeta): readonly CheckDecl[] {\n    return meta.raw.kind.type === \"link\" ? meta.raw.kind.value.check : [];\n}\n\n/** The flags on the members of a link — per half, per member index. */\nexport interface LinkFlags {\n    from: string[][];\n    to: string[][];\n}\n\n/** No flags. */\nexport const NO_FLAGS: LinkFlags = { from: [], to: [] };\n\n/** Whether any member is flagged. */\nexport function hasFlags(flags: LinkFlags): boolean {\n    return flags.from.some((f) => f.length > 0) || flags.to.some((f) => f.length > 0);\n}\n\n/**\n * The `exists` check on one member, flagged in the sheet's words (#861).\n *\n * @param m - The member\n * @param vocab - The column's vocabulary\n * @param messages - The sheet's message table\n * @returns The flag, or `undefined` when the member passes\n */\nexport function existsFlag(m: SheetMemberValue, vocab: LinkVocabulary, messages: SheetMessages): string | undefined {\n    switch (m.type) {\n        case \"identified\":\n        case \"counted\":\n            return vocab.byKey.has(m.value.key.toLowerCase()) ? undefined : messages.notInRegister({ key: m.value.key });\n        case \"range\":\n            return vocab.byKey.has(m.value.from.toLowerCase()) ? undefined : messages.notInRegister({ key: m.value.from });\n        default:\n            return undefined;\n    }\n}\n\n/**\n * Run a column's checks over a link.\n *\n * @param link - The link value\n * @param checks - The column's checks\n * @param vocab - The column's vocabulary (for `exists`)\n * @param contextFor - The wire check context for a member (`half`, `member` filled by the caller)\n * @param messages - The sheet's message table (the `exists` flag's words)\n * @returns The flags, per half and member\n */\nexport function checkLink(\n    link: SheetLinkValue,\n    checks: readonly CheckDecl[],\n    vocab: LinkVocabulary,\n    contextFor: (half: \"from\" | \"to\", member: SheetMemberValue) => SheetCheckContextValue,\n    messages: SheetMessages,\n): LinkFlags {\n    if (checks.length === 0) return NO_FLAGS;\n    const run = (half: \"from\" | \"to\", members: readonly SheetMemberValue[]): string[][] => members.map((m) => {\n        const flags: string[] = [];\n        for (const c of checks) {\n            if (c.type === \"exists\") {\n                const f = existsFlag(m, vocab, messages);\n                if (f !== undefined) flags.push(f);\n                continue;\n            }\n            try {\n                const out = c.value(contextFor(half, m));\n                if (out.type === \"some\") flags.push(out.value);\n            } catch (err) {\n                // Fail-open: a broken rule can never block entry.\n                console.error(\"[Sheet] link check failed:\", err);\n            }\n        }\n        return flags;\n    });\n    return { from: run(\"from\", link.from), to: run(\"to\", link.to) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The link columns' wiring (P3 — `Sheet Spec.md` §6.3 \"Links\"): one\n * vocabulary per link / set column, the per-driver halves and locks, the\n * checks run once per row value (a `WeakMap` over the immutable row), and the\n * link editor's context — candidates over the vocabulary, resolution, the\n * prediction from the column's pending fill, the cell for the halves. What a\n * row is OFFERED may be narrower than what it may hold: a column's `options`\n * rule (#844) narrows the candidates, never the resolution of typed text.\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { none, some, variant } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { driverKeyOf, type SheetBodyItem, type SheetColumnIndex, type SheetColumnMeta, type SheetRegisterIndex } from \"./model.js\";\nimport { linkVocabulary, narrowVocabulary, usedKeys, type LinkVocabulary } from \"./link/grammar.js\";\nimport { halvesFor, sidesDeclOf, type SidesDecl } from \"./link/sides.js\";\nimport { linkCandidates, linkCandidateAt, resolveBuffer, predictedMembers } from \"./link/predict.js\";\nimport { checksOf, checkLink, NO_FLAGS, type CheckDecl, type LinkFlags } from \"./link/checks.js\";\nimport type { LinkCellContext } from \"./cells/Cell.js\";\nimport type { LinkEditCtx, LinkGroups } from \"./sheet-types.js\";\nimport type { ShownDrafts } from \"./shown-drafts.js\";\nimport type { SheetArityValue, SheetCellValue, SheetDriverValue, SheetLinkValue, SheetRowValue } from \"./values.js\";\nimport type { SheetWords } from \"./words.js\";\n\n/** One link column's decoded declaration. */\nexport interface LinkColumn {\n    vocab: LinkVocabulary;\n    sides: SidesDecl | undefined;\n    checks: readonly CheckDecl[];\n    /** The arity rule on the wire — the half it counts and the bridged rule. */\n    arity: SheetArityValue | undefined;\n}\n\nexport interface UseSheetLinksArgs {\n    /** Each drafted entry's draft, and each one a Save landed that the rows have still to read. */\n    drafts: Map<string, Uint8Array>;\n    /** Each row's own draft, for a row those hold none of (#1599): what its checks read it over. */\n    shown: ShownDrafts;\n    columns: SheetColumnIndex;\n    registers: SheetRegisterIndex;\n    driver: SheetDriverValue | undefined;\n    driverColumn: string | undefined;\n    body: readonly SheetBodyItem[];\n    rowAt: (r: number) => SheetBodyItem | undefined;\n    /** The copilot's pending fill for a link cell — what the editor predicts from (`undefined` = none). */\n    predictedLink: (r: number, key: string) => SheetLinkValue | undefined;\n    /** The member keys a row is OFFERED on a link column — its `options` rule (`undefined` = the whole register). */\n    allowedFor?: ((r: number, meta: SheetColumnMeta) => ReadonlySet<string> | undefined) | undefined;\n    /** The sheet's words (#861): the candidates' metas and the `exists` flag speak them. */\n    words: SheetWords;\n}\n\nexport interface SheetLinks {\n    linkVocabularies: ReadonlyMap<string, LinkVocabulary>;\n    linkColumns: ReadonlyMap<string, LinkColumn>;\n    /** The row's driver member's name — `undefined` when the row names none (the words then say \"this row\", #861). */\n    driverName: (row: SheetRowValue | undefined) => string | undefined;\n    linkCellCtx: (row: SheetRowValue | undefined, meta: SheetColumnMeta) => LinkCellContext | undefined;\n    linkCtxFor: (r: number, c: number) => LinkEditCtx | undefined;\n}\n\n/** The link columns' vocabularies, halves, checks and editor contexts. */\nexport function useSheetLinks({ drafts, shown, columns, registers, driver, driverColumn, body, rowAt, predictedLink, allowedFor, words }: UseSheetLinksArgs): SheetLinks {\n    const linkVocabularies = useMemo(() => {\n        const out = new Map<string, LinkVocabulary>();\n        for (const meta of columns.list) {\n            if (meta.kind !== \"link\" && meta.kind !== \"set\") continue;\n            out.set(meta.key, linkVocabulary(meta, meta.register !== undefined ? registers.byName.get(meta.register) ?? [] : []));\n        }\n        return out;\n    }, [columns, registers]);\n    const linkColumns = useMemo(() => {\n        const out = new Map<string, LinkColumn>();\n        for (const meta of columns.list) {\n            if (meta.kind !== \"link\" && meta.kind !== \"set\") continue;\n            const members = meta.register !== undefined ? registers.byName.get(meta.register) ?? [] : [];\n            out.set(meta.key, {\n                vocab: linkVocabularies.get(meta.key) ?? linkVocabulary(meta, members),\n                sides: sidesDeclOf(meta),\n                checks: checksOf(meta),\n                arity: meta.raw.kind.type === \"link\" ? getSomeorUndefined(meta.raw.kind.value.arity) : undefined,\n            });\n        }\n        return out;\n    }, [columns, registers, linkVocabularies]);\n    const driverName = useCallback((row: SheetRowValue | undefined): string | undefined => {\n        const key = driverKeyOf(row, driverColumn);\n        if (key === undefined) return undefined;\n        const member = driver?.members.find((m) => m.key === key);\n        return member?.label ?? key;\n    }, [driverColumn, driver]);\n    // A provider may inspect hidden drafts or group fields while the visible\n    // child row stays identical. Reset the memoized results for either input —\n    // and for a new message table, whose words the `exists` flag speaks (#861).\n    const messages = words.m;\n    const flagCache = useMemo(() => new WeakMap<SheetRowValue, Map<string, LinkFlags>>(),\n        // These inputs invalidate the cache consumed by flagsFor below.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [drafts, linkColumns, messages]);\n    const flagsFor = useCallback((item: SheetBodyItem, meta: SheetColumnMeta): LinkFlags => {\n        if (item.kind !== \"real\") return NO_FLAGS;\n        const lc = linkColumns.get(meta.key);\n        const cell = item.row.cells.get(meta.key);\n        if (lc === undefined || lc.checks.length === 0 || cell === undefined || cell.type !== \"Link\") return NO_FLAGS;\n        let byKey = flagCache.get(item.row);\n        if (byKey === undefined) { byKey = new Map(); flagCache.set(item.row, byKey); }\n        const known = byKey.get(meta.key);\n        if (known !== undefined) return known;\n        // A line's check context names its GROUP and its line key (#740); a\n        // loose row's (#846) its place among the loose rows. The row is read as the grid shows it (#1599): over its\n        // draft, else over the entry it — a line's group — was read with.\n        const over = shown.of(item.group !== undefined ? item.group.row.id : item.row.id, item.position, drafts);\n        const flags = checkLink(cell.value, lc.checks, lc.vocab, (half, member) => ({\n            drafts: over, group: item.group !== undefined ? some(item.group.row) : none,\n            rowIndex: BigInt(item.group !== undefined ? item.group.index : item.loose ?? item.residentIndex),\n            rowId: item.group !== undefined ? item.group.row.id : item.row.id,\n            offset: BigInt(item.position),\n            line: item.group !== undefined ? some(item.group.key) : none,\n            row: item.row.cells, half: variant(half, null), member,\n        }), messages);\n        byKey.set(meta.key, flags);\n        return flags;\n    }, [linkColumns, drafts, shown, flagCache, messages]);\n    // The body as it is now, and its real items by their rows, made once a body as a cell first asks: what a cell's link\n    // context finds its row's item in. Read through a ref, so the context is the same function while what it is made\n    // of holds — a window landing draws no row again for it (#1398, CL9); a row that moves is drawn again for its\n    // place, and reads the body it is in.\n    const items = useRef<{ body: readonly SheetBodyItem[]; byRow: WeakMap<SheetRowValue, SheetBodyItem> | undefined }>({ body, byRow: undefined });\n    if (items.current.body !== body) items.current = { body, byRow: undefined };\n    const linkCellCtx = useCallback((row: SheetRowValue | undefined, meta: SheetColumnMeta): LinkCellContext | undefined => {\n        const lc = linkColumns.get(meta.key);\n        if (lc === undefined) return undefined;\n        let item: SheetBodyItem | undefined;\n        if (row !== undefined) {\n            const held = items.current;\n            if (held.byRow === undefined) {\n                // The first real item of each row, as a scan of the body finds it.\n                held.byRow = new WeakMap();\n                for (const it of held.body) if (it.kind === \"real\" && !held.byRow.has(it.row)) held.byRow.set(it.row, it);\n            }\n            item = held.byRow.get(row);\n        }\n        return {\n            halves: halvesFor(lc.sides, driverKeyOf(row, driverColumn)),\n            vocab: lc.vocab,\n            flags: item !== undefined ? flagsFor(item, meta) : NO_FLAGS,\n            driverName: driverName(row),\n        };\n    }, [linkColumns, driverColumn, flagsFor, driverName]);\n    const linkCtxFor = useCallback((r: number, c: number): LinkEditCtx | undefined => {\n        const meta = columns.list[c];\n        if (meta === undefined) return undefined;\n        const lc = linkColumns.get(meta.key);\n        if (lc === undefined) return undefined;\n        const it = rowAt(r);\n        const row = it !== undefined && it.kind === \"real\" ? it.row : undefined;\n        const cell = row?.cells.get(meta.key);\n        const current = cell !== undefined && cell.type === \"Link\" ? cell.value : undefined;\n        const halves = meta.kind === \"set\"\n            ? { from: { live: false, lock: \"\" }, to: { live: true, lock: \"\" }, isIn: false, sides: \"to\" as const }\n            : halvesFor(lc.sides, driverKeyOf(row, driverColumn));\n        const vocab = lc.vocab;\n        const usedOf = (groups: LinkGroups) => usedKeys([...groups[0], ...groups[1]], vocab);\n        const allowed = allowedFor?.(r, meta);\n        const offer = allowed !== undefined ? narrowVocabulary(vocab, allowed) : vocab;\n        return {\n            halves,\n            initial: [current !== undefined ? [...current.from] : [], current !== undefined ? [...current.to] : []],\n            candidates: (text, groups) => linkCandidates(text, offer, usedOf(groups), words),\n            candidateAt: (text, hi, groups) => linkCandidateAt(text, hi, offer, usedOf(groups), words),\n            resolve: (text, cand) => resolveBuffer(text, cand, vocab),\n            predicted: (side, groups, typed) => predictedMembers(predictedLink(r, meta.key), side, groups, side === 0 ? halves.from.live : halves.to.live, typed, vocab),\n            cell: (groups): SheetCellValue | null => (groups[0].length === 0 && groups[1].length === 0 ? null : variant(\"Link\", { from: groups[0], to: groups[1] })),\n            driverName: driverName(row),\n        };\n    }, [columns, linkColumns, rowAt, driverColumn, driverName, predictedLink, allowedFor, words]);\n    return { linkVocabularies, linkColumns, driverName, linkCellCtx, linkCtxFor };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\nimport type { SheetBodyItem } from \"./model.js\";\n\n/** Visible membership, with rail ends clipped to adjacent resident members. */\nexport interface SheetMembership {\n    id: string;\n    color: number;\n    above: boolean;\n    below: boolean;\n}\n\n/** Assigns a stable palette slot independent of sort order and folding. */\nexport function groupColor(id: string): number {\n    let hash = 2166136261;\n    for (const char of id) hash = Math.imul(hash ^ char.codePointAt(0)!, 16777619);\n    return (hash >>> 0) % 6 + 1;\n}\n\nfunction groupId(item: SheetBodyItem | undefined): string | undefined {\n    if (item?.kind === \"group\") return item.row.id;\n    // A line's sub rows sit inside its group: the rail runs through them.\n    if (item?.kind === \"subRow\") return item.group.row.id;\n    return item?.kind === \"real\" ? item.group?.row.id : undefined;\n}\n\n/** Stops rails at padding, proposals, hidden or unloaded runs and group boundaries. */\nexport function membershipAt(body: readonly SheetBodyItem[], index: number): SheetMembership | undefined {\n    const id = groupId(body[index]);\n    if (id === undefined) return undefined;\n    return { id, color: groupColor(id), above: groupId(body[index - 1]) === id, below: groupId(body[index + 1]) === id };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The split link cell (B§4.3 — `Sheet Spec.md` §5 row 6): the halves on a\n * `minmax(0,1fr) 16px minmax(0,1fr)` grid inside the cell's padding, the\n * arrow (a minus for an in-place driver) on the first 20 px line, chips\n * mono 10.5 on `bg.muted` with the register's meta only when a half holds a\n * single chip — a counted member prints its kind with the count as the meta,\n * worded in the kind it resolves to (`CNC router · 4 machines`) — dashed chips for text / placeholder / a proposal, the faint\n * FROM / TO labels on an empty live half, a lock tag on a locked one — warn\n * when it holds content — and a flagged member's warn treatment with its\n * message as the title.\n */\n\nimport { memo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowRightLong, faMinus } from \"@fortawesome/free-solid-svg-icons\";\nimport { memberChipLabel, memberIsDashed } from \"../model.js\";\nimport { memberMeta, type LinkVocabulary } from \"../link/grammar.js\";\nimport { halfWarns, type LinkHalves } from \"../link/sides.js\";\nimport type { LinkFlags } from \"../link/checks.js\";\nimport type { SheetLinkValue, SheetMemberValue } from \"../values.js\";\nimport { useSheetWords, type SheetWords } from \"../words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nexport interface LinkChipProps {\n    styles: Styles;\n    member: SheetMemberValue;\n    /** The register's line, shown when the half holds a single chip. */\n    meta: string;\n    /** A proposal or a prediction — dashed. */\n    ghost: boolean;\n    /** The checks' messages on this member. */\n    flags: readonly string[];\n    /** A counted member's count, worded (`4 machines`) — drawn as the chip's meta in place of the register's line. */\n    count?: string | undefined;\n}\n\n/**\n * A counted member's count in the words of the kind it resolves to — the\n * host's kind names (`4 machines`); the bare number when the vocabulary says\n * nothing about it. In the sheet's words (#861).\n *\n * @param member - The member\n * @param vocab - The column's vocabulary\n * @param w - The sheet's words\n * @returns The count's text, or `undefined` for a member that is not counted\n */\nexport function countText(member: SheetMemberValue, vocab: LinkVocabulary | undefined, w: SheetWords): string | undefined {\n    if (member.type !== \"counted\") return undefined;\n    const n = Number(member.value.n);\n    const kind = vocab?.byKey.get(member.value.key.toLowerCase())?.kind;\n    const noun = kind !== undefined ? vocab?.kinds.find((k) => k.kind === kind)?.resolvesTo : undefined;\n    return w.m.countedMembers({ n, count: w.number(n), kind: noun });\n}\n\n/** One chip. */\nexport const LinkChip = memo(function LinkChip({ styles, member, meta, ghost, flags, count }: LinkChipProps) {\n    const dashed = ghost || memberIsDashed(member);\n    const flagged = flags.length > 0;\n    return (\n        <Box\n            as=\"span\"\n            css={dashed ? styles.chipDashed : styles.chip}\n            data-slot=\"chip\"\n            data-member={member.type}\n            data-flag={flagged ? \"\" : undefined}\n            title={flagged ? flags.join(\" · \") : undefined}\n            style={flagged ? { color: \"var(--chakra-colors-status-warn)\", background: \"var(--chakra-colors-bg-warning-subtle)\", borderColor: \"var(--chakra-colors-status-warn)\" } : undefined}\n        >\n            {memberChipLabel(member)}\n            {count !== undefined\n                ? <Box as=\"span\" css={styles.chipMeta} data-slot=\"chipCount\">{count}</Box>\n                : meta !== \"\" && <Box as=\"span\" css={styles.chipMeta}>{meta}</Box>}\n        </Box>\n    );\n});\n\nexport interface LinkHalfProps {\n    styles: Styles;\n    half: \"from\" | \"to\";\n    members: readonly SheetMemberValue[];\n    state: LinkHalves[\"from\"];\n    vocab: LinkVocabulary | undefined;\n    flags: readonly (readonly string[])[];\n    ghost: boolean;\n    /** The driver's name for the lock tag's title — `undefined` when the row names none. */\n    driverName: string | undefined;\n}\n\n/** One half: the lock tag or the hint, then the chips. */\nexport const LinkHalfView = memo(function LinkHalfView({ styles, half, members, state, vocab, flags, ghost, driverName }: LinkHalfProps) {\n    // The half's words (#861).\n    const words = useSheetWords();\n    const { m } = words;\n    const warn = halfWarns(state, members);\n    const title = !state.live\n        ? m.halfNone({ driver: driverName ?? m.thisRow(), half, lock: state.lock !== \"\" ? state.lock : undefined })\n        : m.halfTitle({ half });\n    return (\n        <Box css={styles.half} data-half={half} data-locked={!state.live ? \"\" : undefined} title={title}>\n            {!state.live && state.lock !== \"\" && (\n                <Box as=\"span\" css={warn ? styles.lockWarn : styles.lockTag} data-slot={warn ? \"lockWarn\" : \"lockTag\"}>{state.lock}</Box>\n            )}\n            {state.live && members.length === 0 && <Box as=\"span\" css={styles.halfLabel} data-slot=\"halfLabel\">{m.halfLabel({ half })}</Box>}\n            {members.map((member, i) => (\n                <LinkChip\n                    key={i}\n                    styles={styles}\n                    member={member}\n                    meta={members.length === 1 && vocab !== undefined ? memberMeta(member, vocab, words) : \"\"}\n                    ghost={ghost}\n                    flags={flags[i] ?? []}\n                    count={countText(member, vocab, words)}\n                />\n            ))}\n        </Box>\n    );\n});\n\nexport interface LinkCellProps {\n    styles: Styles;\n    link: SheetLinkValue;\n    halves: LinkHalves;\n    vocab: LinkVocabulary | undefined;\n    flags: LinkFlags;\n    /** A proposal — every chip dashed. */\n    ghost: boolean;\n    /** The row's driver member's name — `undefined` when it names none. */\n    driverName: string | undefined;\n}\n\n/** Renders the split cell. */\nexport const LinkCell = memo(function LinkCell({ styles, link, halves, vocab, flags, ghost, driverName }: LinkCellProps) {\n    return (\n        <Box css={styles.linkGrid} data-slot=\"linkCell\" data-sides={halves.sides} data-ghost={ghost ? \"\" : undefined}>\n            <LinkHalfView styles={styles} half=\"from\" members={link.from} state={halves.from} vocab={vocab} flags={flags.from} ghost={ghost} driverName={driverName} />\n            <Box as=\"span\" css={styles.arrow} aria-hidden=\"true\" data-slot=\"arrow\">\n                <FontAwesomeIcon icon={halves.isIn ? faMinus : faArrowRightLong} />\n            </Box>\n            <LinkHalfView styles={styles} half=\"to\" members={link.to} state={halves.to} vocab={vocab} flags={flags.to} ghost={ghost} driverName={driverName} />\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * One read-only cell by kind (B§11): text · mono (date, stamped) · num + unit\n * (quantity, integer) · enum dot + word · the split link cell (`LinkCell`)\n * · a custom kind's `print`. A date read at a level (#844) prints `dd/mm/yy`\n * (and its time at the time level) with the resolution as a tag — unless its\n * column declares a `format`, which it prints alone, as the author's pattern\n * says its precision (`HH:mm` is `11:55`); once its\n * actual is known it prints when the work happened instead, the tag saying\n * how that stands against the wanted date. A ghost (a pending fill, P4) draws in\n * `fg.subtle` over the brand hatch; the next Tab target carries the dotted\n * underline.\n */\n\nimport { memo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { useSheetWords } from \"../words.js\";\nimport { EMPTY_LINK, cellIsBlank, cellText, memberIsDashed, memberLabel, type SheetColumnMeta } from \"../model.js\";\nimport { LinkCell } from \"./LinkCell.js\";\nimport { actualAgainst, formatWhen, type WhenLevel } from \"../parse/date.js\";\nimport type { LinkVocabulary } from \"../link/grammar.js\";\nimport type { LinkHalves } from \"../link/sides.js\";\nimport { NO_FLAGS, type LinkFlags } from \"../link/checks.js\";\nimport type { SheetCellValue, SheetRegisterMemberValue } from \"../values.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** What a link cell needs beyond its value. */\nexport interface LinkCellContext {\n    halves: LinkHalves;\n    vocab: LinkVocabulary | undefined;\n    flags: LinkFlags;\n    /** The row's driver member's name — `undefined` when it names none. */\n    driverName: string | undefined;\n}\n\nexport interface SheetCellContentProps {\n    styles: Styles;\n    meta: SheetColumnMeta;\n    cell: SheetCellValue | undefined;\n    /** Whether the row is blank — a stamped / enum column prints `—` only on a non-blank row. */\n    rowBlank: boolean;\n    /** The unit for a quantity cell (from the driver). */\n    unit: string | undefined;\n    /** The register member the cell names (an enum's, a reference's, a lookup's): its label is what the cell shows, an enum's tone its dot. */\n    member: SheetRegisterMemberValue | undefined;\n    /** A pending fill — drawn as a ghost when the cell is blank (P4). */\n    ghost: SheetCellValue | undefined;\n    /** The link cell's halves, vocabulary and flags. */\n    link: LinkCellContext | undefined;\n    /** A date cell's level for its row, and the actual instant once the work has happened (#844). */\n    when?: { level: WhenLevel; actual?: Date | undefined } | undefined;\n    /** A run of the optimiser changed the cell (#1409, R25): its value carries `data-op-value`, and fades in as the cell lands. */\n    marked?: boolean | undefined;\n}\n\n/** Renders a cell's content. */\nexport const SheetCellContent = memo(function SheetCellContent({ styles, meta, cell, rowBlank, unit, member, ghost, link, when, marked }: SheetCellContentProps) {\n    // Numbers in the viewer's language — the one its edit box reads back (#852) — and the sheet's words (#861).\n    const words = useSheetWords();\n    const mark = marked === true ? \"\" : undefined;\n    const blank = cellIsBlank(cell);\n    const shown = blank && ghost !== undefined ? ghost : cell;\n    const isGhost = blank && ghost !== undefined;\n    // A cell naming a register member shows the member's label; its key is what it holds, copies and pastes.\n    const named = !isGhost && member !== undefined && member.label !== \"\" && shown?.type === \"String\" && member.key === shown.value ? member.label : undefined;\n    if (shown?.type === \"Invalid\") return <Box as=\"span\" css={styles.cellText} data-op-value={mark} data-slot=\"cellText\">{shown.value}</Box>;\n    switch (meta.kind) {\n        case \"date\":\n        case \"stamped\": {\n            // Once the work has happened the cell prints when, to the minute; the tag says how that stands against the wanted date.\n            if (meta.kind === \"date\" && when?.actual !== undefined && !isGhost) {\n                const a = formatWhen(when.actual, \"time\", words);\n                const vs = shown?.type === \"DateTime\" ? actualAgainst(shown.value, when.level, when.actual, words)\n                    : { tag: words.m.actualTag({ tone: \"on\", n: 0, count: words.number(0), unit: \"d\" }), tone: \"on\" as const };\n                return (\n                    <>\n                        <Box as=\"span\" css={styles.cellMono} data-op-value={mark} data-mono=\"\" data-actual=\"\">{a.text}</Box>\n                        <Box as=\"span\" css={styles.cellRes} data-op-value={mark} data-slot=\"whenRes\" data-actual={vs.tone}>{vs.tag}</Box>\n                    </>\n                );\n            }\n            if (cellIsBlank(shown)) {\n                return meta.kind === \"stamped\" && !rowBlank ? <Box as=\"span\" css={styles.cellGhost} data-op-value={mark}>—</Box> : null;\n            }\n            // At a level the date prints `dd/mm/yy` (its time at the time level) and the resolution as a tag at the cell's right edge.\n            if (meta.kind === \"date\" && when !== undefined && shown?.type === \"DateTime\" && meta.dateFormat === undefined) {\n                const w = formatWhen(shown.value, when.level, words);\n                return (\n                    <>\n                        <Box as=\"span\" css={isGhost ? styles.cellGhost : styles.cellMono} data-op-value={mark} data-mono=\"\" data-level={when.level}>{w.text}</Box>\n                        <Box as=\"span\" css={styles.cellRes} data-op-value={mark} data-slot=\"whenRes\" data-level={when.level}>{w.suffix}</Box>\n                    </>\n                );\n            }\n            return <Box as=\"span\" css={isGhost ? styles.cellGhost : styles.cellMono} data-op-value={mark} data-mono=\"\">{cellText(shown, meta, words)}</Box>;\n        }\n        case \"quantity\":\n        case \"integer\": {\n            if (cellIsBlank(shown)) return null;\n            return (\n                <>\n                    <Box as=\"span\" css={isGhost ? styles.cellGhost : styles.cellNum} data-op-value={mark} data-num=\"\">{cellText(shown, meta, words)}</Box>\n                    {unit !== undefined && <Box as=\"span\" css={styles.cellUnit} data-op-value={mark}>{unit}</Box>}\n                </>\n            );\n        }\n        case \"enum\": {\n            if (cellIsBlank(shown)) return rowBlank ? null : <Box as=\"span\" css={styles.cellGhost} data-op-value={mark}>—</Box>;\n            const tone = member !== undefined ? getSomeorUndefined(member.tone)?.type : undefined;\n            if (isGhost) return <Box as=\"span\" css={styles.cellGhost} data-op-value={mark}>{cellText(shown, meta, words)}</Box>;\n            return (\n                <>\n                    <Box as=\"span\" css={styles.cellDot} data-op-value={mark} data-tone={tone} />\n                    <Box as=\"span\" css={styles.cellWord} data-op-value={mark}>{named ?? cellText(shown, meta, words)}</Box>\n                </>\n            );\n        }\n        case \"set\": {\n            if (shown === undefined || shown.type !== \"Link\") {\n                if (shown !== undefined && !cellIsBlank(shown)) return <Box as=\"span\" css={styles.cellText} data-op-value={mark}>{cellText(shown, meta, words)}</Box>;\n                return null;\n            }\n            const set = shown.value;\n            return (\n                <Box css={styles.half} data-op-value={mark} data-half=\"to\" style={{ justifyContent: \"flex-start\" }}>\n                    {set.to.map((m, i) => (\n                        <Box key={i} as=\"span\" css={memberIsDashed(m) || isGhost ? styles.chipDashed : styles.chip} data-slot=\"chip\" data-member={m.type}>{memberLabel(m)}</Box>\n                    ))}\n                </Box>\n            );\n        }\n        case \"link\": {\n            // The two halves are always drawn once the row has content, so an\n            // empty cell still says what it wants; blank rows stay blank.\n            if (shown !== undefined && shown.type !== \"Link\" && !cellIsBlank(shown)) {\n                return <Box as=\"span\" css={styles.cellText} data-op-value={mark}>{cellText(shown, meta, words)}</Box>;\n            }\n            if (rowBlank || link === undefined) return null;\n            const value = shown !== undefined && shown.type === \"Link\" ? shown.value : EMPTY_LINK;\n            return (\n                <LinkCell\n                    styles={styles}\n                    link={value}\n                    halves={link.halves}\n                    vocab={link.vocab}\n                    flags={isGhost ? NO_FLAGS : link.flags}\n                    ghost={isGhost}\n                    driverName={link.driverName}\n                />\n            );\n        }\n        default: {\n            if (cellIsBlank(shown)) return null;\n            return <Box as=\"span\" css={isGhost ? styles.cellGhost : styles.cellText} data-op-value={mark}>{named ?? cellText(shown, meta, words)}</Box>;\n        }\n    }\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A cell's DETAIL (#844) — what a cell says beyond its value. A date cell\n * whose work has happened prints when it happened; its detail is the wanted\n * date it stands against. A column with a `detailCell` names an unrendered\n * cell whose text is its detail. The hover title and the strip (while the\n * ring rests on the cell) both show it.\n *\n * Pure: no React, no DOM.\n *\n * @packageDocumentation\n */\n\nimport { actualAgainst, formatWhen, type WhenLevel } from \"./parse/date.js\";\nimport type { SheetColumnMeta } from \"./model.js\";\nimport type { SheetCellValue } from \"./values.js\";\nimport type { SheetWords } from \"./words.js\";\n\n/** A cell's detail — the strip's chips and meta, and the hover line. */\nexport interface CellDetail {\n    chips: string[];\n    meta: string;\n    title: string;\n}\n\n/**\n * The detail of a column's cell in a row, if it has one — in the sheet's\n * words (#861).\n *\n * @param meta - The column\n * @param cells - The row's cells (the unrendered rule cells included)\n * @param words - The sheet's words\n * @returns The detail, or `undefined` when the cell says nothing beyond its value\n */\nexport function cellDetail(meta: SheetColumnMeta, cells: ReadonlyMap<string, SheetCellValue>, words: SheetWords): CellDetail | undefined {\n    const { m } = words;\n    if (meta.kind === \"date\" && meta.actual !== undefined) {\n        const a = cells.get(meta.actual);\n        if (a !== undefined && a.type === \"DateTime\") {\n            const when = formatWhen(a.value, \"time\", words).text;\n            const w = cells.get(meta.key);\n            if (w === undefined || w.type !== \"DateTime\") return { chips: [m.detailHappened({ when })], meta: m.detailNoWanted(), title: m.detailHappenedTitle({ when }) };\n            const level: WhenLevel = meta.level?.(cells) ?? \"day\";\n            const wanted = formatWhen(w.value, level, words);\n            const vs = actualAgainst(w.value, level, a.value, words);\n            return {\n                chips: [m.detailWanted({ text: wanted.text, tag: wanted.suffix }), m.detailHappened({ when })],\n                meta: vs.words,\n                title: m.detailTitle({ when, text: wanted.text, tag: wanted.suffix, words: vs.words }),\n            };\n        }\n    }\n    if (meta.detailCell !== undefined) {\n        const c = cells.get(meta.detailCell);\n        if (c !== undefined && c.type === \"String\" && c.value !== \"\") return { chips: c.value.split(\" · \"), meta: \"\", title: c.value };\n    }\n    return undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Gutter insertion seams, the sheet's one insertion layer, and the keyboard-accessible companion strip. @packageDocumentation */\nimport { forwardRef } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faLayerGroup, faPlus } from \"@fortawesome/free-solid-svg-icons\";\nimport { useSheetWords } from \"./words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\nexport interface InsertionActions {\n    row?: (() => void) | undefined;\n    group?: (() => void) | undefined;\n    ordered: boolean;\n    groupOrdered: boolean;\n    preview?: ((kind: \"row\" | \"group\" | undefined) => void) | undefined;\n    /** A row here is a LINE — a grouped sheet's (the sheet's words say which, #861). */\n    line: boolean;\n    /** What a group is called — the host's noun (#844). */\n    noun: string;\n}\n\n/** Where the chips of the hovered seam sit, in the card's coordinates. */\nexport interface InsertSeam {\n    /** The row-space index of the row below the seam. */\n    r: number;\n    /**\n     * In the gutter's actions column, unless an action button occupies that\n     * column on either row the seam divides; then on the body side of the\n     * gutter edge, so nothing overlaps.\n     */\n    side: \"gutter\" | \"body\";\n    /** The row boundary (px from the card's top). */\n    top: number;\n    /** Where the chips start (px from the card's left). */\n    left: number;\n}\n\n/**\n * A SEAM: a hit strip centred on the row boundary across the gutter. It\n * draws nothing. Hovering it names the seam to the sheet, whose insertion\n * layer ({@link SheetInsertLayer}) then shows the chips there.\n */\nexport function SheetInsertPoint({ styles, side, onEnter, onLeave }: {\n    styles: Styles;\n    side: \"gutter\" | \"body\";\n    onEnter: (hit: HTMLElement) => void;\n    onLeave: (to: EventTarget | null) => void;\n}) {\n    return <Box css={styles.insertPoint} data-slot=\"insertPoint\" data-side={side} aria-hidden=\"true\"\n        onMouseEnter={event => onEnter(event.currentTarget)}\n        onMouseLeave={event => onLeave(event.relatedTarget)} />;\n}\n\n/**\n * The sheet's ONE insertion layer: the hovered seam's two chips — row (plus)\n * and group (layer-group), 24 px outlined — laid over the rows at the seam.\n * The layer sits above every row and under the pinned header, so no row's\n * content (a cell editor, the ring, the row above) ever covers the chips.\n * Keyboard activation never types into the sheet.\n */\nexport const SheetInsertLayer = forwardRef<HTMLDivElement, {\n    styles: Styles;\n    seam: InsertSeam;\n    actions: InsertionActions;\n    onLeave: (to: EventTarget | null) => void;\n}>(function SheetInsertLayer({ styles, seam, actions, onLeave }, ref) {\n    const { m } = useSheetWords();\n    const defaultKind = actions.row ? \"row\" : \"group\";\n    const { line, noun } = actions;\n    return <Box ref={ref} css={styles.insertLayer} data-slot=\"insertLayer\" data-side={seam.side}\n        style={{ top: `${seam.top}px`, left: `${seam.left}px` }}\n        onMouseLeave={event => onLeave(event.relatedTarget)}\n        onKeyDown={event => event.stopPropagation()}>\n        <Box css={styles.insertChips} data-slot=\"insertChips\" role=\"group\" aria-label={m.insertHere()}>\n            {actions.row && <chakra.button type=\"button\" css={styles.insertButton} data-slot=\"insertRow\"\n                aria-label={m.insertRow({ ordered: actions.ordered, line })} title={m.insertRowTitle({ ordered: actions.ordered, line })}\n                onMouseDown={event => { event.preventDefault(); event.stopPropagation(); }}\n                onMouseEnter={() => actions.preview?.(\"row\")} onMouseLeave={() => actions.preview?.(defaultKind)}\n                onClick={event => { event.stopPropagation(); actions.row?.(); }}><FontAwesomeIcon icon={faPlus} /></chakra.button>}\n            {actions.group && <chakra.button type=\"button\" css={styles.insertButton} data-slot=\"insertGroup\"\n                aria-label={m.insertGroup({ ordered: actions.groupOrdered, noun })} title={m.insertGroupTitle({ ordered: actions.groupOrdered, noun })}\n                onMouseDown={event => { event.preventDefault(); event.stopPropagation(); }}\n                onMouseEnter={() => actions.preview?.(\"group\")} onMouseLeave={() => actions.preview?.(defaultKind)}\n                onClick={event => { event.stopPropagation(); actions.group?.(); }}><FontAwesomeIcon icon={faLayerGroup} /></chakra.button>}\n        </Box>\n    </Box>;\n});\n\n/** A visible alternative to the gutter controls when whole rows are selected — in the sheet's words (#861). */\nexport function SheetInsertStrip({ styles, ordered, above, below, group, noun }: {\n    styles: Styles; ordered: boolean; above?: (() => void) | undefined; below?: (() => void) | undefined; group?: (() => void) | undefined;\n    /** The host's word for a group (#844); the sheet's own when it declares none. */\n    noun?: string | undefined;\n}) {\n    const { m } = useSheetWords();\n    if (!above && !below && !group) return null;\n    return <Box css={styles.insertStrip} role=\"group\" aria-label={m.insertStrip()}>\n        {ordered && above && <chakra.button type=\"button\" css={styles.insertChoice} onClick={above}>{m.insertAbove()}</chakra.button>}\n        {below && <chakra.button type=\"button\" css={styles.insertChoice} onClick={below}>{m.insertBelow({ ordered })}</chakra.button>}\n        {group && <chakra.button type=\"button\" css={styles.insertChoice} onClick={group}>{m.insertNewGroup({ noun: noun ?? m.groupNoun() })}</chakra.button>}\n    </Box>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * An action column's cell (#1475, `Sheet Action Column - Behaviour Spec.md`\n * §1–§3, §10): the left zone — the state's dot and word, then its summary,\n * or with nothing taken the absent value — then the next half, the offer's\n * first case, and the ▾ part holding the rest. The controls fill the cell\n * flush inside its rules and set no position of their own, so the grid's\n * ring, the cell's last child, paints over them (S11, S12). A row that may\n * not act now keeps its controls, off (T6); a cell that takes no action —\n * read only, owned, a phone's (T9, X4) — shows the state alone. A phone's\n * cell (`Mobile Sheet Spec.md` SH7) shows its summary under its state at 44px\n * rows, and, with nothing taken yet and the row free to act, `▶ Start` in the\n * brand: a tap on it opens the row's action bar.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useSyncExternalStore, type MouseEvent } from \"react\";\nimport { chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { faAngleDown, faPlay } from \"@fortawesome/free-solid-svg-icons\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { useSheetWords } from \"../words.js\";\nimport type { SheetCellValue } from \"../values.js\";\nimport { canTake, verbOf, type ActionCase, type ActionColumn, type ActionOffer } from \"./model.js\";\nimport type { SheetActionHost } from \"./host.js\";\n\n/** Which control of the cell holds its overlay open. */\nexport type ActionHeld = \"next\" | \"more\";\n\n/** Props of {@link ActionCell}. */\nexport interface ActionCellProps {\n    /** The column's machine. */\n    column: ActionColumn;\n    /** The row's summary: what follows its state (S7). */\n    summary: string;\n    /** The row's offer. */\n    offer: ActionOffer;\n    /** Whether the cell draws its controls: not on a read-only sheet, an owned row, a column that takes no edit, or a phone (T9, X4). */\n    controls: boolean;\n    /** A phone's cell with nothing taken and the row free to act: `▶ Start` in place of the absent value (SH7). */\n    startable?: boolean | undefined;\n    /** The cell's value is a draft (ST3). */\n    dirty: boolean;\n    /** The ring is on the cell (ST2). */\n    selected: boolean;\n    /** The control whose overlay is open. */\n    held: ActionHeld | undefined;\n    /** The next half pressed: take its case, or open its overlay. */\n    onNext: (c: ActionCase, anchor: HTMLElement) => void;\n    /** The ▾ part pressed: open the Menu of the rest of the offer. */\n    onMore: (anchor: HTMLElement) => void;\n    /** The pointer rests on a control (P8): its case, or `undefined` as it leaves. */\n    onPreview?: ((c: ActionCase | undefined) => void) | undefined;\n}\n\n/** The widest state word among a column's cases, by its characters: the slot every state takes (S5). */\nconst slots = new WeakMap<ActionColumn, string>();\nfunction stateSlot(column: ActionColumn): string {\n    const known = slots.get(column);\n    if (known !== undefined) return known;\n    const n = column.order.reduce((max, c) => Math.max(max, c.state.length), 0);\n    // A mono word's width is its characters and their tracking; then the dot and the gap (S4).\n    const slot = `calc(${n}ch + ${n * 0.1}em + 16px)`;\n    slots.set(column, slot);\n    return slot;\n}\n\n/** A case's icon, in its 14px slot; the slot is kept empty where it has none (S9). */\nfunction Icon({ css, c }: { css: unknown; c: ActionCase }) {\n    return (\n        <chakra.span css={css as never} data-slot=\"actionIcon\" data-check={c.icon === \"check\" ? \"\" : undefined} aria-hidden=\"true\">\n            {c.icon !== undefined && <FontAwesomeIcon icon={[\"fas\", c.icon as IconName]} />}\n        </chakra.span>\n    );\n}\n\n/** Stop the grid taking a press on a control as a press on its cell, and keep the focus where it is (K1). */\nfunction hold(event: MouseEvent): void {\n    event.preventDefault();\n    event.stopPropagation();\n}\n\n/** Renders an action column's cell. */\nexport const ActionCell = memo(function ActionCell({ column, summary, offer, controls, startable = false, dirty, selected, held, onNext, onMore, onPreview }: ActionCellProps) {\n    const styles = useSlotStyles(\"sheetAction\");\n    const { m } = useSheetWords();\n    const slot = useMemo(() => stateSlot(column), [column]);\n    const state = offer.state;\n    const first = offer.offered[0];\n    const rest = offer.offered.length > 1;\n    const open = canTake(offer);\n    const shown = controls && first !== undefined;\n    const tone = state?.tone;\n    // A column that can offer more than one case keeps its ▾ part's room on every row, so its next halves line up.\n    const roomForMore = useMemo(() => column.start.length > 1 || column.order.some((c) => c.next.length > 1), [column]);\n    // The control the pointer rests on, until it leaves — or goes from under it, as a case taken removes it (P8).\n    const resting = useRef<string | undefined>(undefined);\n    const restingCase = shown ? first.name : undefined;\n    useEffect(() => {\n        if (resting.current !== undefined && resting.current !== restingCase) { resting.current = undefined; onPreview?.(undefined); }\n    }, [restingCase, onPreview]);\n    useEffect(() => () => { if (resting.current !== undefined) onPreview?.(undefined); }, [onPreview]);\n    return (\n        <chakra.div css={styles.root} data-slot=\"actionCell\" data-on={selected || dirty ? \"\" : undefined}\n            style={{ [\"--action-slot\" as string]: slot }}>\n            <chakra.div css={styles.zone} data-slot=\"actionZone\">\n                {state !== undefined ? (\n                    <>\n                        <chakra.span css={styles.state} data-slot=\"actionState\" data-tone={tone} data-dirty={dirty ? \"\" : undefined} data-case={state.name}>\n                            <chakra.span css={styles.dot} data-slot=\"actionDot\" aria-hidden=\"true\" />\n                            {state.state}\n                        </chakra.span>\n                        {summary !== \"\" && <chakra.span css={styles.summary} data-slot=\"actionSummary\" data-dirty={dirty ? \"\" : undefined}>{summary}</chakra.span>}\n                    </>\n                ) : startable && first !== undefined ? (\n                    <chakra.span css={styles.start} data-slot=\"actionStart\"><FontAwesomeIcon icon={faPlay} aria-hidden />{verbOf(first)}</chakra.span>\n                ) : (\n                    <chakra.span css={styles.absent} data-slot=\"actionAbsent\">\n                        {offer.offered.length > 0 ? m.actionNotStarted() : offer.blocked ?? m.actionNotStarted()}\n                    </chakra.span>\n                )}\n            </chakra.div>\n            {shown && (\n                <chakra.button type=\"button\" css={styles.next} data-slot=\"actionNext\" data-kind={first.kind} data-case={first.name}\n                    tabIndex={-1} disabled={!open} data-disabled={open ? undefined : \"\"} data-held={held === \"next\" ? \"\" : undefined}\n                    aria-haspopup={first.kind === \"button\" ? undefined : first.kind === \"form\" ? \"dialog\" : \"menu\"}\n                    aria-expanded={first.kind === \"button\" ? undefined : held === \"next\"}\n                    title={offer.incomplete !== undefined ? m.actionIncomplete({ fields: offer.incomplete }) : offer.blocked}\n                    onMouseDown={hold}\n                    onClick={(event) => { event.stopPropagation(); if (open) onNext(first, event.currentTarget); }}\n                    onMouseEnter={() => { resting.current = first.name; onPreview?.(first); }}\n                    onMouseLeave={() => { resting.current = undefined; onPreview?.(undefined); }}>\n                    <Icon css={styles.icon} c={first} />\n                    {verbOf(first)}\n                    {first.kind === \"choice\" && <chakra.span css={styles.caret} data-slot=\"actionCaret\" aria-hidden=\"true\"><FontAwesomeIcon icon={faAngleDown} /></chakra.span>}\n                </chakra.button>\n            )}\n            {shown && rest && (\n                <chakra.button type=\"button\" css={styles.more} data-slot=\"actionMore\" tabIndex={-1}\n                    disabled={!open} data-disabled={open ? undefined : \"\"} data-held={held === \"more\" ? \"\" : undefined}\n                    aria-label={m.actionMore()} title={m.actionMore()} aria-haspopup=\"menu\" aria-expanded={held === \"more\"}\n                    onMouseDown={hold}\n                    onClick={(event) => { event.stopPropagation(); if (open) onMore(event.currentTarget); }}>\n                    <FontAwesomeIcon icon={faAngleDown} aria-hidden />\n                </chakra.button>\n            )}\n            {shown && !rest && roomForMore && <chakra.span css={styles.moreSpace} data-slot=\"actionMoreSpace\" aria-hidden=\"true\" />}\n        </chakra.div>\n    );\n});\n\n/** Props of {@link ActionCellSlot}. */\nexport interface ActionCellSlotProps {\n    /** What the cell asks of its sheet. */\n    host: SheetActionHost;\n    /** The row-space index. */\n    r: number;\n    /** The column's key. */\n    columnKey: string;\n    /** The column's machine. */\n    column: ActionColumn;\n    /** The row's action cell. */\n    cell: SheetCellValue | undefined;\n    /** The row's summary. */\n    summary: string;\n    /** The ring is on the cell. */\n    selected: boolean;\n}\n\n/**\n * An action cell in its row: it listens to its sheet's host, so an edit\n * anywhere that may move its offer draws it again, and nothing else of the\n * row (#858).\n */\nexport const ActionCellSlot = memo(function ActionCellSlot({ host, r, columnKey, column, cell, summary, selected }: ActionCellSlotProps) {\n    const seq = useSyncExternalStore(host.subscribe, host.version, host.version);\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- `seq` is the host's say that what the offer reads moved\n    const offer = useMemo(() => host.offer(r, columnKey), [host, r, columnKey, cell, seq]);\n    const onNext = useCallback((c: ActionCase, anchor: HTMLElement) => host.next(r, columnKey, c, anchor), [host, r, columnKey]);\n    const onMore = useCallback((anchor: HTMLElement) => host.more(r, columnKey, anchor), [host, r, columnKey]);\n    const onPreview = useCallback((c: ActionCase | undefined) => host.preview(r, columnKey, c), [host, r, columnKey]);\n    if (offer === undefined) return null;\n    return (\n        <ActionCell column={column} summary={summary} offer={offer} selected={selected}\n            controls={host.controls(r, columnKey)} startable={host.startable(r, columnKey)} dirty={host.dirty(r, columnKey)} held={host.held(r, columnKey)}\n            onNext={onNext} onMore={onMore} onPreview={onPreview} />\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Renders aligned spreadsheet rows and full-width group summaries. Group\n * membership lives in the gutter markers and rails; rows share one grid.\n * And the SUB ROWS under a line (#844): read-only rows that share none of\n * the line's columns — a tree and a `{line}.{n}` index in the gutter, then\n * one grey well spanning the rest.\n *\n * Where the sheet takes drops (#1187), each row, line and band is a drop\n * target and, when it moves, carries a grip in its gutter's actions column.\n *\n * A FOLDED gutter (#1215) — a coarse pointer's, in a frame too narrow for its\n * actions beside a cell — holds one row-actions button in place of the\n * actions column: the row's grip, and a tap's menu of its decisions and its\n * inserts.\n */\n\nimport { memo, useCallback, useId, useLayoutEffect, useMemo, useRef, useState, type MouseEvent, type ReactNode, type RefObject } from \"react\";\nimport { Box, chakra, Menu as ChakraMenu, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowRight, faCheck, faChevronRight, faEllipsisVertical, faGripVertical, faMinus, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport { none } from \"@elaraai/east\";\nimport {\n    getSomeorUndefined, optimiseMessages, useDragEventChip, useDropCell, type CellCoord, type DragHandle, type DragPayload, type DropCellOptions,\n} from \"@elaraai/east-ui-components\";\nimport { EastErrorBoundary, FrameMenuLayer, UnloadedRun, loadingLineText, type PlaceholderKind, type RunCell, type SlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport {\n    BAND_MIN_PX, TITLE_KEY, cellIsBlank, cellText, driverKeyOf, resolveMember, unitOf,\n    type LineGroup, type SheetBand, type SheetColumnIndex, type SheetColumnMeta, type SheetGroupIndex, type SheetKind, type SheetRegisterIndex, type SheetWindowFailure,\n} from \"./model.js\";\nimport { SheetCellContent, type LinkCellContext } from \"./cells/Cell.js\";\nimport { cellDetail } from \"./detail.js\";\nimport type { PendingFill } from \"./sheet-types.js\";\nimport type { SheetCellValue, SheetNounValue, SheetRowValue, SheetSubRowValue } from \"./values.js\";\nimport type { DraftPresentation } from \"./draft-state.js\";\nimport type { SheetMembership } from \"./membership.js\";\nimport type { SheetCellOp, SheetRowMarks } from \"./optimise.js\";\nimport { SheetInsertPoint } from \"./Insertion.js\";\nimport type { SheetRowDrop } from \"./drop.js\";\nimport { useSheetWords } from \"./words.js\";\nimport { ActionCellSlot } from \"./actions/ActionCell.js\";\nimport { actionColumnOf } from \"./actions/model.js\";\nimport type { SheetActionHost } from \"./actions/host.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** Whether a column's cell names a register member, which it shows by the member's label: an enum, a reference, a lookup, a person, a cycle. */\nexport function namesMember(meta: SheetColumnMeta): boolean {\n    return meta.kind === \"enum\" || meta.kind === \"reference\" || meta.kind === \"lookup\" || meta.kind === \"person\" || meta.kind === \"cycle\";\n}\n\n/**\n * Test-only render probe (#858) — lets \"a gesture re-renders only the rows it\n * touches\" be asserted as WHICH rows rendered, deterministically: a line or a\n * band reports its row-space index as it renders, and a copy that sticks under\n * the header says it is one. `undefined` outside tests; the call is a single\n * optional invocation. The Plan's `setBodyRowRenderProbe` (#815).\n */\nlet sheetRowRenderProbe: ((r: number, copy: boolean) => void) | undefined;\n/** Install (or clear) the test render probe. Test use only. */\nexport function setSheetRowRenderProbe(fn: ((r: number, copy: boolean) => void) | undefined): void {\n    sheetRowRenderProbe = fn;\n}\n\n// The gutter is three columns with three jobs — RAIL (select: a 14 px\n// checkbox on a 1 px connector) · NUMBER · ACTIONS (decide: 24 px ghost\n// buttons, Font Awesome 13 px). Inserts are not gutter content: both chips\n// float at the row boundary, threaded on the insertion line\n// (`Insertion.tsx`). A group's identity is its band plus the connector;\n// brand appears only for selection and insertion.\n\n/**\n * The chevron: Font Awesome's chevron-right on a line's number and a group's\n * band alike (#1263), in the recipe's 10 px box. It always points right; its\n * button turns it down when open (the recipe's `rotate`), so opening and\n * folding turn it rather than swap it.\n */\nfunction Chevron() {\n    return <FontAwesomeIcon icon={faChevronRight} aria-hidden />;\n}\n\n/**\n * A row a gesture has just brought into view (a line's sub rows opening, an\n * unfolded group's lines) drops in: it fades up from a few\n * pixels above, `order` places it in a short cascade. Once, when it mounts —\n * a row scrolled into view later arrives still — and not at all where the\n * viewer asks for less motion.\n */\nfunction useArrival(ref: RefObject<HTMLElement | null>, order: number | undefined): void {\n    useLayoutEffect(() => {\n        const el = ref.current;\n        if (order === undefined || el === null || typeof el.animate !== \"function\") return;\n        if (typeof window.matchMedia === \"function\" && window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n        const arrival = el.animate(\n            [{ opacity: 0, transform: \"translateY(-6px)\" }, { opacity: 1, transform: \"none\" }],\n            { duration: 220, delay: order * 16, easing: \"cubic-bezier(0.2, 0, 0, 1)\", fill: \"backwards\" },\n        );\n        return () => arrival.cancel();\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- a row arrives once, when it mounts\n    }, []);\n}\n\n/**\n * The rail: the connector behind, the checkbox on top (none on a blank row).\n * A group's checkbox goes indeterminate while some of its lines are picked.\n * Like every control inside the grid it is out of the tab order (#860): the\n * grid is one tab stop, and its keys reach what the controls do (⇧ with the\n * arrows, Home and End stretches a range over whole rows).\n */\nfunction Rail({ styles, membership, picked, mixed, label, selectable, onPick }: {\n    styles: Styles;\n    membership?: SheetMembership | undefined;\n    picked: boolean;\n    mixed: boolean;\n    label: string;\n    selectable: boolean;\n    onPick: (event: MouseEvent) => void;\n}) {\n    return <Box css={styles.rail} data-slot=\"rail\">\n        {membership !== undefined && <Box css={styles.connector} data-slot=\"connector\"\n            data-above={membership.above ? \"\" : undefined} data-below={membership.below ? \"\" : undefined} aria-hidden=\"true\" />}\n        {selectable && <chakra.button type=\"button\" css={styles.checkbox} data-slot=\"checkbox\" tabIndex={-1}\n            aria-label={label} title={label} aria-pressed={picked} data-mixed={mixed && !picked ? \"\" : undefined}\n            onMouseDown={(event) => { event.stopPropagation(); event.preventDefault(); }}\n            onClick={(event) => { event.stopPropagation(); onPick(event); }}>\n            {picked ? <FontAwesomeIcon icon={faCheck} /> : mixed ? <FontAwesomeIcon icon={faMinus} /> : null}\n        </chakra.button>}\n    </Box>;\n}\n\n/**\n * A row's part in drag and drop (#1187): its drop cell on the sheet's surface\n * — the seam the pointer's half picks, or the row itself for an author's\n * card — and, when it moves, its grip, carrying a ghost that names it. With\n * no drops, the row registers nothing and has no grip.\n *\n * @param self - The row's element\n * @param drop - The sheet's drops, when it takes them\n * @param dropRow - The row as its drop names it\n * @param movable - Whether its grip moves it\n * @param label - The row's name, as its gutter names it: what its ghost says, and the drag layer's announcements\n * @param ghostCss - The ghost's style\n * @returns The ref the row's element takes, and the grip's handle while it moves\n */\nfunction useRowDrop(self: RefObject<HTMLDivElement | null>, drop: SheetRowDrop | undefined, dropRow: string | undefined, movable: boolean,\n    label: string, ghostCss: Record<string, unknown> | undefined): { ref: (el: HTMLDivElement | null) => void; grip: DragHandle | undefined } {\n    // Registered at its seam below — the drag-start sweep's question; where a drag rests, the pointer's half answers.\n    const coord = useMemo((): CellCoord | null => (drop !== undefined && dropRow !== undefined ? { surface: drop.surface, row: dropRow, slot: \"after\" } : null), [drop, dropRow]);\n    const resolveCoord = useCallback((_x: number, y: number, payload: DragPayload): CellCoord => {\n        const box = self.current?.getBoundingClientRect();\n        return { surface: drop?.surface ?? \"\", row: dropRow ?? \"\", slot: box === undefined || drop === undefined ? \"\" : drop.slotAt(payload, box, y) };\n    }, [self, drop, dropRow]);\n    const options = useMemo((): DropCellOptions | undefined => (drop === undefined ? undefined : {\n        ...drop.options,\n        onHover: (x, y, payload) => {\n            const el = self.current;\n            if (el !== null) drop.hover(el, resolveCoord(x, y, payload), payload);\n        },\n    }), [self, drop, resolveCoord]);\n    const cell = useDropCell(coord, false, drop?.canDrop, coord === null ? undefined : resolveCoord, options);\n    // One ref, two jobs: the row's own element, and the layer's registration.\n    const ref = useCallback((el: HTMLDivElement | null) => {\n        self.current = el;\n        cell(el);\n    }, [self, cell]);\n    const from = useMemo((): Required<CellCoord> | null => (coord !== null && movable ? { ...coord, slot: \"\", event: coord.row } : null), [coord, movable]);\n    const ghost = useMemo(() => <Box css={ghostCss} data-slot=\"dragGhost\">{label}</Box>, [ghostCss, label]);\n    const grip = useDragEventChip(from, ghost, false, label);\n    return { ref, grip };\n}\n\n/**\n * A row's grip (#1187, SB44): the handle a row, a line or a band is dragged\n * to another seam by — the pointer's, and a touch's at once. Like every\n * control in the grid it is out of the tab order (#860), and a press on it\n * never picks the row.\n */\nfunction Grip({ styles, grip, what }: { styles: Styles; grip: DragHandle; what: string }) {\n    const { m } = useSheetWords();\n    return (\n        <Box as=\"span\" css={styles.rowGrip} data-slot=\"rowGrip\" data-drag-grip=\"\" {...grip} tabIndex={-1}\n            aria-label={m.dropGrip({ what })} title={m.dropGripTitle()}\n            onMouseDown={(event: MouseEvent) => { event.preventDefault(); event.stopPropagation(); }}>\n            <FontAwesomeIcon icon={faGripVertical} />\n        </Box>\n    );\n}\n\n/**\n * What a cell a run of the optimiser changed says on hover (#1409, R7, R25):\n * `Added by Elara · run #7` for a blank given a value, `Was 12 Mar · Elara\n * run #7` for a value changed or cleared.\n *\n * @param op - The cell's operation\n * @param was - The cell before the run\n * @param meta - Its column\n * @param run - The run's number, formatted\n * @param words - The sheet's words\n * @returns The provenance\n */\nfunction cellProvenance(op: SheetCellOp, was: SheetCellValue | undefined, meta: SheetColumnMeta, run: string, words: ReturnType<typeof useSheetWords>): string {\n    if (op === \"add\") return optimiseMessages.entryAdded({ run });\n    return optimiseMessages.entryChanged({ previous: was === undefined || cellIsBlank(was) ? \"—\" : cellText(was, meta, words), run });\n}\n\n/** One item of a folded gutter's menu (#1215): what it says, and what it does. */\nexport interface SheetRowAction {\n    /** The item's key in the menu. */\n    value: string;\n    /** Its words — the words of the control it stands for. */\n    label: string;\n    /** What it does. */\n    run: () => void;\n}\n\nconst NO_ACTIONS: readonly SheetRowAction[] = [];\n\n/**\n * A folded gutter's one control (#1215): the row's actions in a 44 px button.\n * A tap opens an anchored menu of what the unfolded gutter offers there — the\n * row's decisions, then the inserts at it, read as the menu opens; a drag on\n * it moves the row, as its grip does, and only a drag (`data-drag-grip=\"tap\"`\n * waits for travel). Like every control in the grid it takes no focus (#860):\n * it has no tab stop, so a closing menu leaves the focus where its action put\n * it — a new row's editor — or hands it to the grid.\n */\nfunction RowActions({ styles, r, grip, what, decisions, inserts }: {\n    styles: Styles;\n    /** The row-space index: where its inserts land. */\n    r: number;\n    /** The row's grip, when it moves. */\n    grip: DragHandle | undefined;\n    /** The row, as its grip names it. */\n    what: string;\n    /** The row's decisions, as its gutter offers them. */\n    decisions: readonly SheetRowAction[];\n    /** The inserts at a row, read when the menu opens — absent where nothing inserts. */\n    inserts: ((r: number) => readonly SheetRowAction[]) | undefined;\n}) {\n    const { m } = useSheetWords();\n    const self = useRef<HTMLElement | null>(null);\n    const gripRef = grip?.ref;\n    const ref = useCallback((el: HTMLElement | null) => {\n        self.current = el;\n        gripRef?.(el);\n    }, [gripRef]);\n    const [open, setOpen] = useState(false);\n    if (grip === undefined && decisions.length === 0 && inserts === undefined) return null;\n    const items = open ? [...decisions, ...(inserts?.(r) ?? NO_ACTIONS)] : NO_ACTIONS;\n    const select = (value: string) => {\n        items.find((item) => item.value === value)?.run();\n        // What the action did not focus, the grid takes back from the closing menu.\n        queueMicrotask(() => {\n            const card = self.current?.closest<HTMLElement>(\"[data-sheet-card]\");\n            if (card != null && !card.contains(document.activeElement)) card.focus({ preventScroll: true });\n        });\n    };\n    return (\n        <ChakraMenu.Root open={open} onOpenChange={(details) => setOpen(details.open)} onSelect={(details) => select(details.value)}\n            lazyMount unmountOnExit positioning={{ placement: \"bottom-start\" }}>\n            <ChakraMenu.Trigger asChild>\n                <Box as=\"span\" css={styles.rowActions} data-slot=\"rowActions\" data-drag-grip={grip !== undefined ? \"tap\" : undefined}\n                    {...grip} ref={ref} role=\"button\" tabIndex={undefined} aria-roledescription={undefined}\n                    aria-label={m.rowActions({ what })} title={m.rowActionsTitle({ movable: grip !== undefined })}\n                    onMouseDown={(event: MouseEvent) => { event.preventDefault(); event.stopPropagation(); }}>\n                    <FontAwesomeIcon icon={faEllipsisVertical} />\n                </Box>\n            </ChakraMenu.Trigger>\n            <FrameMenuLayer label={m.rowActions({ what })}>\n                        {items.map((item) => <ChakraMenu.Item key={item.value} value={item.value}>{item.label}</ChakraMenu.Item>)}\n                    </FrameMenuLayer>\n        </ChakraMenu.Root>\n    );\n}\n\n/**\n * The per-row facts the row renderer is handed — primitives and references\n * that hold still, so the memo skips every row a gesture does not touch (#858).\n */\nexport interface SheetRowProps {\n    styles: Styles;\n    /** The insertion seam above the row, by the side of the gutter its chips take — `undefined` where nothing inserts. */\n    seam?: \"gutter\" | \"body\" | undefined;\n    /** The seam is hovered: the sheet's one insertion layer shows its chips. */\n    onSeamEnter?: ((r: number, side: \"gutter\" | \"body\", hit: HTMLElement) => void) | undefined;\n    /** The pointer left the seam. */\n    onSeamLeave?: ((to: EventTarget | null) => void) | undefined;\n    insertPreview?: \"row\" | \"group\" | undefined;\n    /** Where the previewing seam's chips sit; the insertion line starts at them. */\n    insertSide?: \"gutter\" | \"body\" | undefined;\n    columns: SheetColumnIndex;\n    registers: SheetRegisterIndex;\n    driverColumn: string | undefined;\n    gridTemplate: string;\n    rowPx: number;\n    /** The row-space index. */\n    r: number;\n    /** The 1-based row number. */\n    number: number;\n    /** The grid's id (#860): each cell's id is `{idPrefix}-{r}-{c}`, what the grid names as its active cell. None on a copy that sticks under the header. */\n    idPrefix?: string | undefined;\n    /** The row's place among the grid's rows, the header first (#860). */\n    ariaRowIndex?: number | undefined;\n    /** The first body item — the row under the sticky header (its ring stays inside the cell). */\n    first?: boolean | undefined;\n    /** The real row, or `undefined` for a blank padding row. */\n    row: SheetRowValue | undefined;\n    /** A line's group: its number resets within the group; membership stays in the gutter. */\n    group?: LineGroup | undefined;\n    membership?: SheetMembership | undefined;\n    /** The link cell's halves, vocabulary and flags for a row (P3). */\n    linkCtx: (row: SheetRowValue | undefined, meta: SheetColumnMeta) => LinkCellContext | undefined;\n    /** The ring's column when it sits on this row. */\n    selC: number | undefined;\n    /** The range's columns when the row is inside it. */\n    range: { c0: number; c1: number } | undefined;\n    /** The whole row is selected (the gutter bar). */\n    picked: boolean;\n    /** A lens hit — the brand row number (B§8). */\n    hit: boolean;\n    /** The editor, when it sits on this row: the column and the element. */\n    editor: { c: number; node: ReactNode } | undefined;\n    /** The copilot's pending fills when this row is the anchor, by column key (B§5.1). */\n    fills: ReadonlyMap<string, PendingFill> | undefined;\n    /** The column of the next ⇥ target when it sits on this row. */\n    nextTargetC: number | undefined;\n    /** The hovered column when the pointer is on this row — the ✓ take button's home. */\n    hoverC: number | undefined;\n    onCellDown: (r: number, c: number, e: MouseEvent) => void;\n    onCellDouble: (r: number, c: number) => void;\n    onCellEnter: (r: number, c: number) => void;\n    onRowPick: (r: number, e: MouseEvent) => void;\n    /** ✓ on a fill. */\n    onTake: (key: string) => void;\n    /** The gutter's → button. */\n    onFillRow: () => void;\n    /** Schema-derived state of the current unapplied row. */\n    draft?: DraftPresentation | undefined;\n    /** Discard a never-applied row as an undoable gesture — the row's id, or a line's group and its key. */\n    onDiscard?: ((id: string, child?: string) => void) | undefined;\n    /** How many sub rows sit under this line (none: `undefined`), and whether they show. */\n    subRowCount?: number | undefined;\n    subRowsOpen?: boolean | undefined;\n    /** The chevron: show or hide them; `all` (⌥) takes every line of the group the same way. */\n    onSubRows?: ((r: number, all: boolean) => void) | undefined;\n    /** The host's word for a group (#844) — the chevron's title names it. */\n    noun?: SheetNounValue | undefined;\n    /** The copy that sticks under the group's band while the line's sub rows scroll under it. */\n    sticky?: boolean | undefined;\n    /** The line's group was just unfolded: it drops in, this far into the cascade. */\n    entering?: number | undefined;\n    /** The sheet's drops (#1187): the row is a drop target — a builder's sheet; absent where the sheet takes none. */\n    drop?: SheetRowDrop | undefined;\n    /** The row as its drop names it — `SheetDropRowType`, printed. */\n    dropRow?: string | undefined;\n    /** Its grip moves it (SB44). */\n    movable?: boolean | undefined;\n    /** The gutter is folded (#1215): one row-actions button holds the row's grip, its decisions and its inserts. */\n    foldedGutter?: boolean | undefined;\n    /** A folded gutter's inserts at a row, read when its menu opens — absent where nothing inserts. Stable. */\n    inserts?: ((r: number) => readonly SheetRowAction[]) | undefined;\n    /** What a run of the optimiser left on the row (#1409, R25), while it is the run's draft: each changed cell's mark, and its provenance on hover. */\n    marks?: SheetRowMarks | undefined;\n    /** What the row's action cells ask of the sheet (#1475): absent on a sheet with no action column. Stable. */\n    actions?: SheetActionHost | undefined;\n}\n\n/** Renders one row. */\nexport const SheetRow = memo(function SheetRow(props: SheetRowProps) {\n    const { styles, columns, registers, driverColumn, gridTemplate, rowPx, r, number, row, group, linkCtx, selC, range, picked, hit, editor, fills, nextTargetC, hoverC, first, seam, subRowCount } = props;\n    sheetRowRenderProbe?.(r, props.sticky === true);\n    const subRowsOpen = props.subRowsOpen === true;\n    // The row's words, its counts in the app's locale (#850, #861).\n    const words = useSheetWords();\n    const { m } = words;\n    const issuePrefix = useId();\n    const self = useRef<HTMLDivElement | null>(null);\n    useArrival(self, props.entering);\n    const invalid = props.draft?.invalid === true || (row !== undefined && [...row.cells.values()].some(cell => cell.type === \"Invalid\"));\n    const rowBlank = row === undefined;\n    const groupTitle = group?.row.cells.get(TITLE_KEY);\n    const groupName = group === undefined ? undefined : groupTitle?.type === \"String\" ? groupTitle.value : group.row.id;\n    const driverKey = driverKeyOf(row, driverColumn);\n    const hasFills = fills !== undefined && fills.size > 0;\n    // The row as its grip's name says it — `row 3`, `line 2 of WO-2201 · Kitchen, oak` — and as its gutter names it, what its ghost and the announcements say.\n    const noun = props.noun?.singular ?? m.groupNoun();\n    const what = group !== undefined\n        ? m.inspectorWhat({ what: \"line\", number: String(number), title: groupTitle?.type === \"String\" && groupTitle.value !== \"\" ? groupTitle.value : undefined, noun })\n        : m.inspectorWhat({ what: \"row\", number: String(number), title: undefined, noun });\n    const label = groupName !== undefined ? m.lineName({ number: String(number), group: groupName }) : m.rowName({ number: String(number) });\n    const { ref: rowRef, grip } = useRowDrop(self, props.drop, props.dropRow, props.movable === true && !rowBlank, label, styles.dragGhost);\n    // The row's discard — its gutter's ×, or its folded menu's item.\n    const discard = () => {\n        if (group !== undefined) props.onDiscard?.(group.row.id, group.key);\n        else if (row !== undefined) props.onDiscard?.(row.id);\n    };\n    // What a run of the optimiser left on the row's cells (#1409, R25), while the row is still the run's draft.\n    const marks = props.draft?.pending === true ? props.marks : undefined;\n    return (\n        <Box\n            ref={rowRef}\n            css={styles.row}\n            style={{ gridTemplateColumns: gridTemplate, minHeight: `${rowPx}px` }}\n            data-slot={props.sticky === true ? \"stickyLine\" : \"row\"}\n            data-insert-preview={props.insertPreview}\n            data-insert-side={props.insertPreview !== undefined ? props.insertSide : undefined}\n            data-row={r}\n            data-row-id={row?.id}\n            data-blank={rowBlank ? \"\" : undefined}\n            data-invalid={invalid ? \"\" : undefined}\n            data-draft={props.draft?.pending ? \"\" : undefined}\n            data-conflict={props.draft?.conflicts?.whole === true ? \"\" : undefined}\n            data-incomplete={props.draft?.incomplete ? \"\" : undefined}\n            data-owned={row?.owned ? \"\" : undefined}\n            data-anchor={hasFills ? \"\" : undefined}\n            data-first={first ? \"\" : undefined}\n            data-group-id={group?.row.id}\n            data-line={group !== undefined ? group.key : undefined}\n            data-picked={picked ? \"\" : undefined}\n            data-sub-rows-open={subRowsOpen ? \"\" : undefined}\n            role=\"row\"\n            aria-rowindex={props.ariaRowIndex}\n        >\n            <Box\n                css={styles.gutter}\n                data-slot=\"gutter\"\n                role=\"rowheader\"\n                aria-colindex={1}\n                aria-label={groupName !== undefined ? m.lineName({ number: String(number), group: groupName }) : m.rowName({ number: String(number) })}\n                onMouseDown={(e) => props.onRowPick(r, e)}\n                title={m.rowTitle({ fills: hasFills })}\n            >\n                {seam !== undefined && props.onSeamEnter !== undefined && props.onSeamLeave !== undefined && (\n                    <SheetInsertPoint styles={styles} side={seam} onEnter={(hit) => props.onSeamEnter?.(r, seam, hit)} onLeave={props.onSeamLeave} />\n                )}\n                <Rail styles={styles} membership={rowBlank ? undefined : props.membership} picked={picked} mixed={false} selectable={!rowBlank}\n                    label={m.selectRow({ number: String(number), group: groupName })}\n                    onPick={(event) => props.onRowPick(r, event)} />\n                <Box as=\"span\" css={styles.gutterNumber} data-slot=\"gutterNumber\" data-hit={hit ? \"\" : undefined} data-blank={rowBlank ? \"\" : undefined}\n                    data-chevron={subRowCount !== undefined ? \"\" : undefined}>\n                    {/* A line with sub rows: the chevron before its number shows or hides them (⌥ every line of the group); open, the tree's stem starts just under it. The number keeps clear of it. */}\n                    {subRowCount !== undefined && (\n                        <chakra.button type=\"button\" css={styles.subRowChevron} data-slot=\"subRowChevron\" data-open={subRowsOpen ? \"\" : undefined} tabIndex={-1}\n                            aria-expanded={subRowsOpen}\n                            aria-label={m.subRows({ open: subRowsOpen, n: subRowCount, count: words.number(subRowCount), line: String(number) })}\n                            title={m.subRowsTitle({ open: subRowsOpen, n: subRowCount, count: words.number(subRowCount), noun: props.noun?.singular ?? m.groupNoun() })}\n                            onMouseDown={(event) => { event.preventDefault(); event.stopPropagation(); props.onSubRows?.(r, event.altKey); }}\n                            onClick={(event) => { if (event.detail === 0) props.onSubRows?.(r, event.altKey); }}>\n                            <Chevron />\n                        </chakra.button>\n                    )}\n                    {subRowsOpen && <Box as=\"span\" css={styles.subRowStem} data-slot=\"subRowStem\" aria-hidden=\"true\" />}\n                    {number}\n                </Box>\n                {props.foldedGutter === true ? (\n                    <RowActions styles={styles} r={r} grip={grip} what={what} inserts={rowBlank ? undefined : props.inserts}\n                        decisions={[\n                            ...(hasFills ? [{ value: \"fill\", label: m.fillRow(), run: props.onFillRow }] : []),\n                            ...(props.draft?.discardable ? [{ value: \"discard\", label: m.discardRow(), run: discard }] : []),\n                        ]} />\n                ) : (\n                    <Box css={styles.gutterAction} data-slot=\"fillSlot\">\n                        {grip !== undefined && <Grip styles={styles} grip={grip} what={what} />}\n                        {hasFills && (\n                            <Box\n                                as=\"span\"\n                                css={styles.gutterButton}\n                                data-slot=\"fillRow\"\n                                data-kind=\"apply\"\n                                role=\"button\"\n                                aria-label={m.fillRow()}\n                                title={m.fillRowTitle()}\n                                onMouseDown={(e) => { e.preventDefault(); e.stopPropagation(); props.onFillRow(); }}\n                            >\n                                <FontAwesomeIcon icon={faArrowRight} />\n                            </Box>\n                        )}\n                        {props.draft?.discardable && <chakra.button\n                            type=\"button\" css={styles.gutterButton} tabIndex={-1}\n                            data-slot=\"discardDraft\" data-kind=\"discard\" aria-label={m.discardRow()} title={m.discardRow()}\n                            onMouseDown={(event) => { event.preventDefault(); event.stopPropagation(); }}\n                            onClick={(event) => { event.stopPropagation(); discard(); }}\n                        ><FontAwesomeIcon icon={faXmark} /></chakra.button>}\n                    </Box>\n                )}\n            </Box>\n            {columns.list.map((meta, c) => {\n                const cell: SheetCellValue | undefined = row?.cells.get(meta.key);\n                const issue = cell?.type === \"Invalid\" ? m.issueInvalid({ value: cell.value }) : props.draft?.issues.get(meta.key);\n                const issueId = `${issuePrefix}-${c}`;\n                const editing = editor?.c === c;\n                const selected = selC === c && !editing;\n                const inRange = range !== undefined && c >= range.c0 && c <= range.c1;\n                const unit = unitOf(meta, driverKey);\n                const member = namesMember(meta) && cell?.type === \"String\" ? resolveMember(registers, meta.register, cell.value) : undefined;\n                const fill = !editing && cellIsBlank(cell) ? fills?.get(meta.key) : undefined;\n                const isTarget = !editing && nextTargetC === c && fill !== undefined;\n                // A date cell's level comes from the row (#844); once its actual is known, that instant prints and the wanted date becomes the cell's detail.\n                const actualCell = meta.kind === \"date\" && meta.actual !== undefined ? row?.cells.get(meta.actual) : undefined;\n                const when = meta.kind === \"date\" && meta.level !== undefined && row !== undefined\n                    ? { level: meta.level(row.cells), actual: actualCell?.type === \"DateTime\" ? actualCell.value : undefined }\n                    : undefined;\n                const detail = row !== undefined ? cellDetail(meta, row.cells, words) : undefined;\n                const op = marks?.cells.get(meta.key);\n                const provenance = op === undefined || marks === undefined ? undefined : cellProvenance(op, marks.previous.get(meta.key), meta, marks.run, words);\n                const title = issue ?? (provenance === undefined ? detail?.title : detail?.title === undefined ? provenance : `${provenance} · ${detail.title}`);\n                // An action cell (#1475): its state, its summary and the controls of what it offers, over its sheet's host.\n                const action = meta.kind === \"action\" && props.actions !== undefined && row !== undefined ? actionColumnOf(meta) : undefined;\n                const summaryCell = action !== undefined ? row?.cells.get(action.summary) : undefined;\n                return (\n                    <Box\n                        key={meta.key}\n                        css={styles.cell}\n                        data-slot=\"cell\"\n                        data-key={meta.key}\n                        data-kind={meta.kind}\n                        data-editable={meta.editable ? \"\" : undefined}\n                        data-invalid={cell?.type === \"Invalid\" ? \"\" : undefined}\n                        // A number outside its field's bounds (#1585): the warn wash a field still missing wears.\n                        data-bounds={props.draft?.bounds?.has(meta.key) === true ? \"\" : undefined}\n                        data-conflict={props.draft?.conflicts?.fields.has(meta.key) === true ? \"\" : undefined}\n                        data-value={meta.kind === \"enum\" && cell?.type === \"String\" ? cell.value : undefined}\n                        data-op={op}\n                        data-fill={op !== undefined ? \"cell\" : undefined}\n                        aria-invalid={issue !== undefined ? true : undefined}\n                        aria-describedby={issue !== undefined ? issueId : undefined}\n                        title={title}\n                        data-selected={selected ? \"\" : undefined}\n                        data-blank={cellIsBlank(cell) ? \"\" : undefined}\n                        data-proposed={fill !== undefined ? \"\" : undefined}\n                        data-next-target={isTarget ? \"\" : undefined}\n                        role=\"gridcell\"\n                        id={props.idPrefix !== undefined ? `${props.idPrefix}-${r}-${c}` : undefined}\n                        aria-colindex={c + 2}\n                        aria-selected={selC === c || inRange}\n                        onMouseDown={(e) => props.onCellDown(r, c, e)}\n                        onDoubleClick={() => props.onCellDouble(r, c)}\n                        onMouseEnter={() => props.onCellEnter(r, c)}\n                    >\n                        {issue !== undefined && <Box as=\"span\" css={styles.cellIssue} id={issueId}>{issue}</Box>}\n                        {inRange && <Box css={styles.rangeWash} data-slot=\"rangeWash\" />}\n                        {fill !== undefined && <Box css={styles.hatch} data-slot=\"hatch\" aria-hidden=\"true\" />}\n                        {action !== undefined && props.actions !== undefined ? (\n                            <ActionCellSlot host={props.actions} r={r} columnKey={meta.key} column={action} cell={cell}\n                                summary={summaryCell?.type === \"String\" ? summaryCell.value : \"\"} selected={selC === c} />\n                        ) : <SheetCellContent\n                            styles={styles}\n                            meta={meta}\n                            cell={cell}\n                            rowBlank={rowBlank && fill === undefined}\n                            unit={unit}\n                            member={member}\n                            ghost={fill?.cell}\n                            link={meta.kind === \"link\" ? linkCtx(row, meta) : undefined}\n                            when={when}\n                            marked={op !== undefined}\n                        />}\n                        {isTarget && <Box css={styles.nextTarget} data-slot=\"nextTarget\" aria-hidden=\"true\" />}\n                        {fill !== undefined && hoverC === c && (\n                            <Box\n                                as=\"span\"\n                                css={styles.takeButton}\n                                data-slot=\"take\"\n                                role=\"button\"\n                                aria-label={m.take({ header: meta.header })}\n                                title={m.takeTitle({ meta: fill.meta === \"\" ? undefined : fill.meta })}\n                                onMouseDown={(e) => { e.preventDefault(); e.stopPropagation(); props.onTake(meta.key); }}\n                            >\n                                <FontAwesomeIcon icon={faCheck} />\n                            </Box>\n                        )}\n                        {selected && <Box css={styles.ring} data-slot=\"ring\" />}\n                        {editing && editor.node}\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n});\n\n// ── Sub rows under a line (#844) ──\n\nexport interface SheetSubRowProps {\n    styles: Styles;\n    /** The row's least height (px); it grows when its detail wraps. */\n    subRowPx: number;\n    subRow: SheetSubRowValue;\n    /** Its line's number in the group — the index reads `{line}.{n}`. */\n    parent: number;\n    /** Its index under the line, and how many the line has (the last ends the tree). */\n    index: number;\n    count: number;\n    /** The gutter's width (px) — the well starts at its edge. */\n    gutterPx: number;\n    /** The width of the view (px): the well's content stays inside it while the columns scroll sideways. */\n    viewPx: number | undefined;\n    membership?: SheetMembership | undefined;\n    /** Its line was just opened: it drops in, this far into the cascade. */\n    entering?: number | undefined;\n    /** The row's place among the grid's rows, the header first (#860). */\n    ariaRowIndex?: number | undefined;\n    /** How many columns the well spans (#860). */\n    colCount: number;\n}\n\n/**\n * One sub row of an open line. It shares none of the line's columns: the\n * gutter holds the tree — the stem from the line's chevron, an elbow into\n * this row, the last row's stem stopping at its middle — and the index\n * `{line}.{n}` on the surface; then ONE grey well spans the rest. The well\n * reads left to right: the LEAD (a code and a name; with no detail beside it\n * the name runs on past the lead rather than wrap inside it), the DETAIL (chips,\n * then labelled facets; it wraps and the row grows, never truncated), and\n * the ID pinned right so ids align down the sheet. The well's content stays\n * at the view's left edge as the columns scroll sideways. Read-only, and\n * outside the row space: the ring never lands on it.\n */\nexport const SheetSubRow = memo(function SheetSubRow({ styles, subRowPx, subRow, parent, index, count, gutterPx, viewPx, membership, entering, ariaRowIndex, colCount }: SheetSubRowProps) {\n    const last = index === count - 1;\n    const detail = subRow.chips.length > 0 || subRow.facets.length > 0;\n    const self = useRef<HTMLDivElement | null>(null);\n    useArrival(self, entering);\n    return (\n        <Box\n            ref={self}\n            css={styles.subRow}\n            style={{ minHeight: `${subRowPx}px` }}\n            data-slot=\"subRow\"\n            data-sub-row=\"\"\n            data-detail={detail ? \"\" : undefined}\n            data-last={last ? \"\" : undefined}\n            role=\"row\"\n            aria-rowindex={ariaRowIndex}\n        >\n            <Box css={styles.subRowGutter} data-slot=\"gutter\" role=\"rowheader\" aria-colindex={1} style={{ width: `${gutterPx}px` }}>\n                <Rail styles={styles} membership={membership} picked={false} mixed={false} selectable={false} label=\"\" onPick={() => {}} />\n                <Box as=\"span\" css={styles.subRowIndex} data-slot=\"subRowIndex\">{`${parent}.${index + 1}`}</Box>\n            </Box>\n            <Box css={styles.subRowWell} data-slot=\"subRowWell\" role=\"gridcell\" aria-colindex={2} aria-colspan={Math.max(1, colCount)}>\n                <Box css={styles.subRowContent} data-slot=\"subRowContent\"\n                    style={{ left: `${gutterPx}px`, ...(viewPx !== undefined ? { maxWidth: `${Math.max(0, viewPx - gutterPx)}px` } : {}) }}>\n                    <Box css={styles.subRowLead} data-slot=\"subRowLead\">\n                        {subRow.code !== \"\" && <Box as=\"span\" css={styles.subRowCode} data-slot=\"subRowCode\">{subRow.code}</Box>}\n                        <Box as=\"span\" css={styles.subRowName} data-slot=\"subRowName\">{subRow.name}</Box>\n                    </Box>\n                    {detail && <Box css={styles.subRowDetail} data-slot=\"subRowDetail\">\n                        {subRow.chips.map((c, i) => <Box key={`c${i}`} as=\"span\" css={styles.subRowChip} data-slot=\"subRowChip\">{c}</Box>)}\n                        {subRow.facets.map((f, i) => (\n                            <Box key={`f${i}`} as=\"span\" css={styles.subRowFacet} data-slot=\"subRowFacet\">\n                                <Box as=\"span\" css={styles.subRowFacetLabel} data-slot=\"subRowFacetLabel\">{f.label}</Box>\n                                <Box as=\"span\" css={styles.subRowFacetValue} data-slot=\"subRowFacetValue\">{f.value}</Box>\n                            </Box>\n                        ))}\n                    </Box>}\n                    {subRow.id !== \"\" && <Box as=\"span\" css={styles.subRowId} data-slot=\"subRowId\">{subRow.id}</Box>}\n                </Box>\n            </Box>\n        </Box>\n    );\n});\n\nexport interface SheetProposalRowProps {\n    styles: Styles;\n    insertion?: ReactNode;\n    insertPreview?: \"row\" | \"group\" | undefined;\n    columns: SheetColumnIndex;\n    registers: SheetRegisterIndex;\n    driverColumn: string | undefined;\n    gridTemplate: string;\n    rowPx: number;\n    /** The proposal's index under its anchor. */\n    index: number;\n    /** The 1-based row number it would take. */\n    number: number;\n    /** Proposed under a grouped line. */\n    grouped?: boolean | undefined;\n    cells: ReadonlyMap<string, SheetCellValue>;\n    meta: string;\n    /** Selected — the 3 px brand bar and the wash. */\n    picked: boolean;\n    linkCtx: (row: SheetRowValue | undefined, meta: SheetColumnMeta) => LinkCellContext | undefined;\n    onPick: (i: number) => void;\n    onAccept: (i: number) => void;\n    onReject: (i: number) => void;\n    /** The row's place among the grid's rows on a grouped sheet (#860); a flat sheet's proposal has no source position, so none. */\n    ariaRowIndex?: number | undefined;\n    /** The gutter is folded (#1215): ✓ and × are its row-actions button's menu. */\n    foldedGutter?: boolean | undefined;\n}\n\n/** A proposed row (B§5.2): dashed-topped, hatched, real numbers; ✓ adds it, × rejects it. */\nexport const SheetProposalRow = memo(function SheetProposalRow(props: SheetProposalRowProps) {\n    const { styles, columns, registers, driverColumn, gridTemplate, rowPx, index, number, cells, meta, picked, linkCtx } = props;\n    // The suggestion's words (#861).\n    const { m } = useSheetWords();\n    const pseudo: SheetRowValue = { id: \"\", owned: false, cells: cells as Map<string, SheetCellValue>, lines: [], band: none, subRows: [] };\n    const driverKey = driverKeyOf(pseudo, driverColumn);\n    const pick = (e: MouseEvent) => { if (e.button !== 0) return; e.preventDefault(); e.stopPropagation(); props.onPick(index); };\n    return (\n        <Box\n            css={styles.row}\n            style={{ gridTemplateColumns: gridTemplate, minHeight: `${rowPx}px` }}\n            data-slot=\"row\"\n            data-proposed=\"\"\n            data-proposal={index}\n            data-picked={picked ? \"\" : undefined}\n            role=\"row\"\n            aria-rowindex={props.ariaRowIndex}\n            title={meta}\n        >\n            <Box css={styles.gutter} data-slot=\"gutter\" role=\"rowheader\" aria-colindex={1} aria-label={m.proposalName({ number: String(number) })} onMouseDown={pick} title={m.proposalTitle()}>\n                <Rail styles={styles} membership={props.grouped ? { id: \"\", color: 0, above: true, below: true } : undefined} picked={picked} mixed={false} selectable\n                    label={m.proposalSelect()} onPick={pick} />\n                <Box as=\"span\" css={styles.gutterNumber} data-slot=\"gutterNumber\">{number}</Box>\n                {props.foldedGutter === true ? (\n                    <RowActions styles={styles} r={-1} grip={undefined} what={m.proposalName({ number: String(number) })} inserts={undefined}\n                        decisions={[\n                            { value: \"accept\", label: m.proposalAccept(), run: () => props.onAccept(index) },\n                            { value: \"reject\", label: m.proposalReject(), run: () => props.onReject(index) },\n                        ]} />\n                ) : (\n                    <Box css={styles.gutterAction} data-slot=\"proposalActions\">\n                        <Box\n                            as=\"span\"\n                            css={styles.gutterButton}\n                            data-slot=\"accept\"\n                            data-kind=\"accept\"\n                            role=\"button\"\n                            aria-label={m.proposalAccept()}\n                            title={m.proposalAcceptTitle()}\n                            onMouseDown={(e) => { e.preventDefault(); e.stopPropagation(); props.onAccept(index); }}\n                        >\n                            <FontAwesomeIcon icon={faCheck} />\n                        </Box>\n                        <Box\n                            as=\"span\"\n                            css={styles.gutterButton}\n                            data-slot=\"reject\"\n                            data-kind=\"reject\"\n                            role=\"button\"\n                            aria-label={m.proposalReject()}\n                            title={m.proposalRejectTitle()}\n                            onMouseDown={(e) => { e.preventDefault(); e.stopPropagation(); props.onReject(index); }}\n                        >\n                            <FontAwesomeIcon icon={faXmark} />\n                        </Box>\n                    </Box>\n                )}\n            </Box>\n            {columns.list.map((colMeta, c) => {\n                const cell = cells.get(colMeta.key);\n                const unit = unitOf(colMeta, driverKey);\n                const member = namesMember(colMeta) && cell?.type === \"String\" ? resolveMember(registers, colMeta.register, cell.value) : undefined;\n                const when = colMeta.kind === \"date\" && colMeta.level !== undefined ? { level: colMeta.level(cells) } : undefined;\n                return (\n                    <Box\n                        key={colMeta.key}\n                        css={styles.cell}\n                        data-slot=\"cell\"\n                        data-key={colMeta.key}\n                        data-kind={colMeta.kind}\n                        data-proposed=\"\"\n                        role=\"gridcell\"\n                        aria-colindex={c + 2}\n                        onMouseDown={pick}\n                    >\n                        {picked && <Box css={styles.rangeWash} data-slot=\"rangeWash\" />}\n                        <Box css={styles.hatch} data-slot=\"hatch\" aria-hidden=\"true\" />\n                        <SheetCellContent\n                            styles={styles}\n                            meta={colMeta}\n                            cell={undefined}\n                            rowBlank={false}\n                            unit={unit}\n                            member={member}\n                            ghost={cell !== undefined && !cellIsBlank(cell) ? cell : undefined}\n                            link={colMeta.kind === \"link\" ? linkCtx(pseudo, colMeta) : undefined}\n                            when={when}\n                        />\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n});\n\n/** A recipe slot's styles, as the shared run merges them over its own. */\nconst slot = (styles: Styles | SlotStyles, name: string): SystemStyleObject | undefined => styles[name] as SystemStyleObject | undefined;\n\n/** What a column's cells hold before their rows land (#1398): the issue's shape by the column's kind. */\nconst RUN_KINDS: Readonly<Record<SheetKind, PlaceholderKind>> = {\n    text: \"text\", lookup: \"text\", reference: \"text\", custom: \"text\",\n    date: \"date\", stamped: \"date\",\n    quantity: \"number\", integer: \"number\",\n    enum: \"enum\", set: \"chip\", link: \"link\", action: \"enum\",\n    title: \"text\", person: \"text\", boolean: \"boolean\", toggle: \"enum\", cycle: \"enum\", age: \"number\", audit: \"date\",\n};\n\nexport interface SheetRunRowProps {\n    /** The sheet recipe's slot styles — or a host's grid's, its `run` slots (#1531). */\n    styles: Styles | SlotStyles;\n    /** The run's place among the grid's rows, the header first: where its first element would be (#860). */\n    ariaRowIndex?: number | undefined;\n    /** A paged source's unloaded run, or a stretch of the record the lens is still reading (#1349). */\n    band?: SheetBand | undefined;\n    /** A window whose read failed (#853): the run said once, with its Retry (CL11). */\n    failure?: SheetWindowFailure | undefined;\n    /** Whether the run's rows are in flight: it is the region being read (`aria-busy`). */\n    loading: boolean;\n    /** The rows' grid tracks: the gutter, then each column's. */\n    gridTemplate: string;\n    /** The columns the grid draws. */\n    columns: SheetColumnIndex;\n    /** A row's height, px: the density's pitch. */\n    rowPx: number;\n    /** A grouped sheet's band height, px: each element a band, then its lines at the row's pitch; absent, a flat sheet. */\n    bandPx?: number | undefined;\n    /** Compact rows. */\n    dense: boolean;\n    /** What the rail counts the rows in — `work orders`: what a failed run's line names them by. */\n    noun: string;\n    /** Ask a failed window again. */\n    onRetry: (w: number) => void;\n    /**\n     * What the run's first cell, under the grid's lead track, stands for (#1531): the gutter's row number, by default,\n     * or a host's lead — a Record's select column, its box; `null` where the grid has no lead track.\n     */\n    lead?: PlaceholderKind | null | undefined;\n}\n\n/**\n * A run of the sheet's rows not drawn yet (#1398, CL2) — a paged source's\n * unloaded run, a stretch of the record the lens is still reading or placing\n * (#1349), or a window whose read failed (#853) — as the shared\n * `UnloadedRun`: rows at the density's pitch where the run meets the view,\n * with the sheet's own gutter, columns and rules, each cell its column kind's\n * placeholder. A flat sheet's runs keep their real row numbers. A lens\n * stretch stands for the narrowing's rows in it — as many placeholders as it\n * holds matches, at the pitch they land at — whose numbers are not known\n * until they are read, so its numbers are short bars, as a grouped sheet's\n * lines are, under a band of the band's height. A failed window is said once,\n * in its first row in view, with Retry; its other rows keep their numbers and\n * rules and carry nothing else (CL11). Its height is the ledger's slot, so the\n * rows that replace it take the same space. To the grid it is one row at its\n * first element's place, its one cell across the grid (#860), busy while its\n * rows are read; its placeholders are `aria-hidden`, and a failed run's line\n * is the cell instead (CL12).\n */\nexport const SheetRunRow = memo(function SheetRunRow({\n    styles, band, failure, loading, gridTemplate, columns, rowPx, bandPx, dense, noun, onRetry, ariaRowIndex, lead = \"rowNumber\",\n}: SheetRunRowProps) {\n    const words = useSheetWords();\n    const { m } = words;\n    const from = failure?.from ?? band?.from ?? 0;\n    const to = failure?.to ?? band?.to ?? -1;\n    // The elements it stands for: every one it covers, or under the lens the narrowing's rows among them.\n    const elements = failure !== undefined ? failure.elements : band?.elements;\n    const n = elements ?? Math.max(0, to - from + 1);\n    const px = Math.max(BAND_MIN_PX, failure?.px ?? band?.px ?? 0);\n    // The gutter — or a host's lead — then each column's cells: the column kind's shape on the sheet's own cell rules.\n    const cells = useMemo((): RunCell[] => [\n        ...(lead === null ? [] : [{ kind: lead, css: slot(styles, \"runGutter\") }]),\n        ...columns.list.map((meta): RunCell => ({ kind: RUN_KINDS[meta.kind], css: slot(styles, meta.kind === \"action\" ? \"runActionCell\" : \"runCell\") })),\n    ], [styles, columns, lead]);\n    // A grouped sheet's elements: a band each, then the lines the ledger's rate says an element draws.\n    const group = useMemo(() => {\n        if (bandPx === undefined) return undefined;\n        const each = n > 0 ? px / n : px;\n        return { band: bandPx, lines: Math.max(0, Math.round((each - bandPx) / rowPx)), css: slot(styles, \"runBand\") };\n    }, [bandPx, n, px, rowPx, styles]);\n    // A flat run's rows are the source's positions; a lens stretch's are not known until the lens draws them. Each is\n    // numbered as the gutter numbers the row that lands in its place: 24994, never 24,994.\n    const numbered = bandPx === undefined && elements === undefined;\n    const rowNumber = useCallback((index: number) => String(index + 1), []);\n    const range = { from: words.number(from + 1), to: words.number(to + 1) };\n    const w = failure?.w;\n    const failed = useMemo(() => (w === undefined ? undefined : {\n        message: loadingLineText(m.lineFailed({ noun, ...range })),\n        retry: { onRetry: () => onRetry(w), label: m.retry(), name: m.retryRange({ noun, ...range }) },\n        from: 1,\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- the range is its two formatted ends\n    }), [w, m, noun, range.from, range.to, onRetry]);\n    // To the grid the run is one row, its one cell across the gutter and every column (#860).\n    const cell = useMemo(() => ({ colIndex: 1, colSpan: columns.list.length + (lead === null ? 0 : 1) }), [columns, lead]);\n    return (\n        <Box\n            css={styles.run}\n            data-slot=\"band\"\n            data-band={failure !== undefined ? \"failed\" : band?.at}\n            data-failed={w}\n            data-elements={n}\n            role=\"row\"\n            aria-rowindex={ariaRowIndex}\n            aria-busy={loading && failure === undefined ? \"true\" : undefined}\n        >\n            <UnloadedRun height={px} pitch={rowPx} columns={gridTemplate} cells={cells} first={from}\n                rowNumber={numbered ? rowNumber : undefined} rowCss={slot(styles, \"runRow\")} group={group} failed={failed} cell={cell} dense={dense} />\n        </Box>\n    );\n});\n\nexport interface SheetRetryProps {\n    styles: Styles;\n    /** Ask again. */\n    onRetry: () => void;\n}\n\n/** The whole-sheet message's Retry (#853): a source that failed before any row landed asks again through it. */\nexport function SheetRetry({ styles, onRetry }: SheetRetryProps) {\n    const { m } = useSheetWords();\n    return (\n        <chakra.button type=\"button\" css={styles.retry} data-slot=\"retry\"\n            onMouseDown={(event) => { event.preventDefault(); event.stopPropagation(); }}\n            onClick={(event) => { event.stopPropagation(); onRetry(); }}>\n            {m.retry()}\n        </chakra.button>\n    );\n}\n\nexport interface SheetRowBoundaryProps {\n    styles: Styles;\n    /** The row's least height (px). */\n    rowPx: number;\n    /** Its 1-based number — what the diagnostic names. */\n    number: number;\n    /** The row's data — when it changes, the boundary tries again. */\n    resetKey: unknown;\n    children: ReactNode;\n}\n\n/**\n * A render failure stays in its row (#853): a row that throws while it\n * renders shows as a one-row diagnostic in its place, and the rows around it\n * keep working. It resets when the row's data changes. The Plan's part\n * boundary does the same (#811).\n */\nexport function SheetRowBoundary({ styles, rowPx, number, resetKey, children }: SheetRowBoundaryProps) {\n    const { m } = useSheetWords();\n    return (\n        <EastErrorBoundary\n            title={`Sheet row ${number}`}\n            resetKey={resetKey}\n            fallback={({ message }) => (\n                <Box css={styles.rowError} data-slot=\"rowError\" data-row-error={number} role=\"row\" style={{ minHeight: `${rowPx}px` }}>\n                    <Box as=\"span\" role=\"alert\">{m.rowFailed({ number: String(number), reason: message })}</Box>\n                </Box>\n            )}\n        >\n            {children}\n        </EastErrorBoundary>\n    );\n}\n\n// ── Grouped rows (#740) ───────────────────────────────────────────────────\n\nexport interface SheetGroupRowProps {\n    styles: Styles;\n    /** The insertion seam above the band, by the side of the gutter its chips take — `undefined` where nothing inserts. */\n    seam?: \"gutter\" | \"body\" | undefined;\n    onSeamEnter?: ((r: number, side: \"gutter\" | \"body\", hit: HTMLElement) => void) | undefined;\n    onSeamLeave?: ((to: EventTarget | null) => void) | undefined;\n    insertPreview?: \"row\" | \"group\" | undefined;\n    insertSide?: \"gutter\" | \"body\" | undefined;\n    columns: SheetColumnIndex;\n    registers: SheetRegisterIndex;\n    gridTemplate: string;\n    /** The band's height (px). */\n    bandPx: number;\n    /** The row-space index. */\n    r: number;\n    number: number;\n    /** The grid's id (#860): the title's id is `{idPrefix}-{r}-0`, a band cell's `{idPrefix}-{r}-{c}`. None on the copy that sticks under the header. */\n    idPrefix?: string | undefined;\n    /** The band's place among the grid's rows, the header first (#860). */\n    ariaRowIndex?: number | undefined;\n    membership?: SheetMembership | undefined;\n    /** The group's wire row — its band cells under {@link TITLE_KEY} and the line columns. */\n    row: SheetRowValue;\n    /** The band's cells and the title span. */\n    group: SheetGroupIndex;\n    folded: boolean;\n    /** The group's line count. */\n    count: number;\n    /** The first body item — the row under the sticky header. */\n    first?: boolean | undefined;\n    /** The copy that sticks under the column header while the group's lines scroll (G1). */\n    sticky?: boolean | undefined;\n    /** The ring's column when it sits on this band. */\n    selC: number | undefined;\n    /** The range's columns when the band is inside it. */\n    range: { c0: number; c1: number } | undefined;\n    /** The band is selected whole (the gutter bar). */\n    picked: boolean;\n    /** Some of the group's lines are picked: the band's checkbox goes indeterminate. */\n    mixed?: boolean | undefined;\n    /** The editor, when it sits on this band: the column and the element. */\n    editor: { c: number; node: ReactNode } | undefined;\n    onCellDown: (r: number, c: number, e: MouseEvent) => void;\n    onCellDouble: (r: number, c: number) => void;\n    onCellEnter: (r: number, c: number) => void;\n    /** The gutter: selects the group's lines. */\n    onRowPick: (r: number, e: MouseEvent) => void;\n    /** The chevron; `all` (⌥ held) applies the band's new state to every group. */\n    onFold: (r: number, all?: boolean) => void;\n    draft?: DraftPresentation | undefined;\n    /** Discard a never-applied group as an undoable gesture — the group's id. */\n    onDiscard?: ((id: string) => void) | undefined;\n    /** The sheet's drops (#1187): the band is a drop target — a builder's sheet; absent where the sheet takes none. */\n    drop?: SheetRowDrop | undefined;\n    /** The band as its drop names it — `SheetDropRowType`, printed. */\n    dropRow?: string | undefined;\n    /** Its grip moves the group (SB44). */\n    movable?: boolean | undefined;\n    /** The gutter is folded (#1215): one row-actions button holds the band's grip, its discard and its inserts. */\n    foldedGutter?: boolean | undefined;\n    /** A folded gutter's inserts at a row, read when its menu opens — absent where nothing inserts. Stable. */\n    inserts?: ((r: number) => readonly SheetRowAction[]) | undefined;\n    /** What a run of the optimiser left on the band's cells (#1409, R25), while the group is still the run's draft. */\n    marks?: SheetRowMarks | undefined;\n}\n\n/** Renders one full-width summary with a fold control and independent metadata. */\nexport const SheetGroupRow = memo(function SheetGroupRow(props: SheetGroupRowProps) {\n    const { styles, columns, registers, gridTemplate, bandPx, r, row, group, folded, count, first, sticky, selC, range, picked, editor, seam } = props;\n    sheetRowRenderProbe?.(r, sticky === true);\n    const titleCell = row.cells.get(TITLE_KEY);\n    const title = titleCell !== undefined && titleCell.type === \"String\" ? titleCell.value : \"\";\n    const sub = getSomeorUndefined(row.band)?.sub ?? \"\";\n    const span = group.titleSpan;\n    const titleMeta = group.cells.get(TITLE_KEY);\n    const titleSelected = selC !== undefined && selC < span && editor === undefined;\n    const titleEditing = editor !== undefined && editor.c < span;\n    // The band's words, its line count and cells' titles in the app's locale (#850, #852, #861).\n    const words = useSheetWords();\n    const { m } = words;\n    // The host's word for a group, else the sheet's own (#844, #861).\n    const word = group.noun?.singular ?? m.groupNoun();\n    // To assistive tech (#860) the band is a row: its rowheader names the\n    // group and its lines, the title is its first cell — the sub line that\n    // cell's description — and each band cell a cell under its column.\n    const subId = useId();\n    // The band as a drop target, and its group's grip (#1187): `Move order 2`, its ghost the group's title.\n    const self = useRef<HTMLDivElement | null>(null);\n    const what = m.inspectorWhat({ what: \"band\", number: String(props.number), title: title !== \"\" ? title : undefined, noun: word });\n    const { ref: bandRef, grip } = useRowDrop(self, props.drop, props.dropRow, props.movable === true, title !== \"\" ? title : what, styles.dragGhost);\n    // What a run of the optimiser left on the band's cells (#1409, R25), while the group is still the run's draft.\n    const marks = props.draft?.pending === true ? props.marks : undefined;\n    const titleOp = titleMeta === undefined ? undefined : marks?.cells.get(TITLE_KEY);\n    const titleProvenance = titleOp === undefined || marks === undefined || titleMeta === undefined ? undefined : cellProvenance(titleOp, marks.previous.get(TITLE_KEY), titleMeta, marks.run, words);\n    return (\n        <Box\n            ref={bandRef}\n            css={styles.groupRow}\n            style={{ gridTemplateColumns: gridTemplate, minHeight: `${bandPx}px` }}\n            data-slot={sticky === true ? \"stickyBand\" : \"row\"}\n            data-band-row=\"\"\n            data-draft={props.draft?.pending ? \"\" : undefined}\n            data-conflict={props.draft?.conflicts?.whole === true ? \"\" : undefined}\n            data-invalid={props.draft?.invalid ? \"\" : undefined}\n            data-incomplete={props.draft?.incomplete ? \"\" : undefined}\n            data-insert-preview={props.insertPreview}\n            data-insert-side={props.insertPreview !== undefined ? props.insertSide : undefined}\n            data-row={r}\n            data-row-id={row.id}\n            data-folded={folded ? \"\" : undefined}\n            data-owned={row.owned ? \"\" : undefined}\n            data-first={first ? \"\" : undefined}\n            data-picked={picked ? \"\" : undefined}\n            role=\"row\"\n            aria-rowindex={props.ariaRowIndex}\n            aria-expanded={!folded}\n        >\n            <Box css={styles.gutter} data-slot=\"gutter\" role=\"rowheader\" aria-colindex={1}\n                aria-label={m.groupName({ noun: word, number: String(props.number), n: count, count: words.number(count) })}\n                onMouseDown={(e) => props.onRowPick(r, e)} title={m.groupTitle({ noun: word })}>\n                {seam !== undefined && props.onSeamEnter !== undefined && props.onSeamLeave !== undefined && (\n                    <SheetInsertPoint styles={styles} side={seam} onEnter={(hit) => props.onSeamEnter?.(r, seam, hit)} onLeave={props.onSeamLeave} />\n                )}\n                <Rail styles={styles} membership={props.membership} picked={picked} mixed={props.mixed === true} selectable\n                    label={m.groupSelect({ noun: word, title })} onPick={(event) => props.onRowPick(r, event)} />\n                <Box as=\"span\" css={styles.gutterNumber} data-slot=\"gutterNumber\">{props.number}</Box>\n                {props.foldedGutter === true ? (\n                    <RowActions styles={styles} r={r} grip={grip} what={what} inserts={props.inserts}\n                        decisions={props.draft?.discardable ? [{ value: \"discard\", label: m.groupDiscard({ noun: word }), run: () => props.onDiscard?.(row.id) }] : NO_ACTIONS} />\n                ) : (\n                    <Box css={styles.gutterAction} data-slot=\"fillSlot\">\n                        {grip !== undefined && <Grip styles={styles} grip={grip} what={what} />}\n                        {props.draft?.discardable && <chakra.button\n                            type=\"button\" css={styles.gutterButton} tabIndex={-1}\n                            data-slot=\"discardDraft\" data-kind=\"discard\" aria-label={m.groupDiscard({ noun: word })} title={m.groupDiscard({ noun: word })}\n                            onMouseDown={(event) => { event.preventDefault(); event.stopPropagation(); }}\n                            onClick={(event) => { event.stopPropagation(); props.onDiscard?.(row.id); }}\n                        ><FontAwesomeIcon icon={faXmark} /></chakra.button>}\n                    </Box>\n                )}\n            </Box>\n            <Box css={styles.groupSummary} data-slot=\"groupSummary\" role=\"none\"\n                style={{ gridColumn: `span ${Math.max(1, columns.list.length)}` }}>\n                {/* The row's `aria-expanded` says whether it is open, and Space folds it: the chevron is the pointer's. */}\n                <chakra.button type=\"button\" css={styles.groupChevron} data-slot=\"fold\" tabIndex={-1} aria-hidden=\"true\"\n                    aria-label={m.groupFold({ folded, noun: word })} aria-expanded={!folded}\n                    title={m.groupFoldTitle({ folded })}\n                    onMouseDown={(event) => { event.preventDefault(); event.stopPropagation(); props.onFold(r, event.altKey); }}\n                    onClick={(event) => { if (event.detail === 0) props.onFold(r, event.altKey); }}>\n                    <Chevron />\n                </chakra.button>\n                <Box\n                    css={styles.groupTitle}\n                    data-slot=\"cell\"\n                    data-key={TITLE_KEY}\n                    data-kind=\"text\"\n                    data-selected={titleSelected ? \"\" : undefined}\n                    data-op={titleOp}\n                    data-fill={titleOp !== undefined ? \"cell\" : undefined}\n                    title={titleProvenance}\n                    role=\"gridcell\"\n                    id={props.idPrefix !== undefined ? `${props.idPrefix}-${r}-0` : undefined}\n                    aria-colindex={2}\n                    aria-colspan={span}\n                    aria-selected={(selC !== undefined && selC < span) || (range !== undefined && range.c0 < span)}\n                    aria-describedby={sub !== \"\" ? subId : undefined}\n                    onMouseDown={(e) => props.onCellDown(r, 0, e)}\n                    onDoubleClick={() => props.onCellDouble(r, 0)}\n                    onMouseEnter={() => props.onCellEnter(r, 0)}\n                >\n                    {range !== undefined && range.c0 < span && <Box css={styles.rangeWash} data-slot=\"rangeWash\" />}\n                    <Box as=\"span\" css={styles.groupTitleText} data-slot=\"groupTitle\" data-op-value={titleOp !== undefined ? \"\" : undefined}>{title === \"\" && titleMeta !== undefined ? m.untitled() : title}</Box>\n                    {titleSelected && <Box css={styles.ring} data-slot=\"ring\" />}\n                    {titleEditing && editor.node}\n                </Box>\n                {sub !== \"\" && <Box as=\"span\" css={styles.groupSub} data-slot=\"groupSub\" id={subId} aria-hidden=\"true\">{sub}</Box>}\n                <Box as=\"span\" css={styles.groupCount} data-slot=\"groupCount\" aria-hidden=\"true\">{words.number(count)}</Box>\n                {columns.list.map((colMeta, c) => {\n                    if (c < span) return null;\n                    const meta = group.cells.get(colMeta.key);\n                    if (meta === undefined) return null;\n                    const cell = meta !== undefined ? row.cells.get(colMeta.key) : undefined;\n                    const editing = editor?.c === c;\n                    const selected = selC === c && !editing;\n                    const inRange = range !== undefined && c >= range.c0 && c <= range.c1;\n                    const member = meta !== undefined && namesMember(meta) && cell?.type === \"String\" ? resolveMember(registers, meta.register, cell.value) : undefined;\n                    const op = marks?.cells.get(colMeta.key);\n                    const provenance = op === undefined || marks === undefined ? undefined : cellProvenance(op, marks.previous.get(colMeta.key), meta, marks.run, words);\n                    // A member by its label, as the cell shows it (the hand retest's 4); a number outside its bounds, what they are (#1585).\n                    const bound = props.draft?.bounds?.get(colMeta.key);\n                    const cellTitle = m.bandCellTitle({ header: colMeta.header, value: member !== undefined && member.label !== \"\" ? member.label : cellText(cell, meta, words) });\n                    const bandTitle = bound === undefined ? cellTitle : `${cellTitle} · ${bound}`;\n                    return (\n                        <Box\n                            key={colMeta.key}\n                            css={styles.groupCell}\n                            data-slot=\"cell\"\n                            data-key={colMeta.key}\n                            data-kind={meta?.kind}\n                            data-conflict={props.draft?.conflicts?.fields.has(colMeta.key) === true ? \"\" : undefined}\n                            data-bounds={bound !== undefined ? \"\" : undefined}\n                            data-selected={selected ? \"\" : undefined}\n                            data-blank={cellIsBlank(cell) ? \"\" : undefined}\n                            data-editable={meta !== undefined && meta.editable ? \"\" : undefined}\n                            data-op={op}\n                            data-fill={op !== undefined ? \"cell\" : undefined}\n                            role=\"gridcell\"\n                            id={props.idPrefix !== undefined ? `${props.idPrefix}-${r}-${c}` : undefined}\n                            aria-colindex={c + 2}\n                            aria-selected={selC === c || inRange}\n                            onMouseDown={(e) => props.onCellDown(r, c, e)}\n                            onDoubleClick={() => props.onCellDouble(r, c)}\n                            onMouseEnter={() => props.onCellEnter(r, c)}\n                            title={provenance === undefined ? bandTitle : `${provenance} · ${bandTitle}`}\n                        >\n                            {inRange && <Box css={styles.rangeWash} data-slot=\"rangeWash\" />}\n                            <SheetCellContent styles={styles} meta={meta} cell={cell} rowBlank={false} unit={unitOf(meta, undefined)} member={member} ghost={undefined} link={undefined} marked={op !== undefined} />\n                            {selected && <Box css={styles.ring} data-slot=\"ring\" />}\n                            {editing && editor.node}\n                        </Box>\n                    );\n                })}\n            </Box>\n        </Box>\n    );\n});\n\n/** The tone of an enum member, exported for the gutter's future status dot. */\nexport function memberTone(registers: SheetRegisterIndex, register: string | undefined, key: string): string | undefined {\n    const m = resolveMember(registers, register, key);\n    return m !== undefined ? getSomeorUndefined(m.tone)?.type : undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/** Stable destinations shared by insertion buttons, keyboard and previews. @packageDocumentation */\nimport { none, some, variant } from \"@elaraai/east\";\nimport type { SheetBodyItem } from \"./model.js\";\nimport type { Placement } from \"./transactions.js\";\nimport type { SheetEditValue, SheetRowValue } from \"./values.js\";\n\nexport interface InsertionAnchor {\n    /** Top-level identity, independent of source/viewport position. */\n    entry: string | undefined;\n    /** A child's internal key; undefined means the summary or a flat entry. */\n    child?: string | undefined;\n    /** A group's trailing blank row. */\n    tail?: boolean | undefined;\n    side: \"before\" | \"after\";\n}\nexport interface InsertRequest { kind: \"row\" | \"group\"; anchor: InsertionAnchor }\n\n/**\n * Where an insertion at a row's seam goes — the one anchor the seam's chips,\n * the keys and a drop (#1187) insert at: beside a line, in its group; at a\n * group's end, on its blank line; beside a row or a band; at the sheet's\n * end, on blank padding.\n *\n * @param item - The row-space item at the seam\n * @param side - Which side of it\n * @returns The anchor\n */\nexport function anchorAt(item: SheetBodyItem | undefined, side: \"before\" | \"after\"): InsertionAnchor {\n    if (item?.kind === \"real\" && item.group !== undefined) return { entry: item.group.row.id, child: item.group.key, side };\n    if (item?.kind === \"blank\" && item.group !== undefined) return { entry: item.group.row.id, tail: true, side };\n    return { entry: item?.kind === \"real\" || item?.kind === \"group\" ? item.row.id : undefined, side };\n}\n\n/**\n * Whether a row inserted at an anchor is a LOOSE row between the groups\n * (#846) rather than a line: beside a loose row, at the seam above a group's\n * band, or on a sheet with no rows yet. Below a band is the group's first\n * line; a line's seam and a group's blank line insert lines.\n *\n * @param anchor - Where the row goes\n * @param rows - The rows on screen, in order\n * @returns `true` when the new row stands on its own between the groups\n */\nexport function insertsLoose(anchor: InsertionAnchor, rows: readonly SheetRowValue[]): boolean {\n    if (anchor.child !== undefined || anchor.tail === true) return false;\n    if (anchor.entry === undefined) return true;\n    const parent = rows.find(row => row.id === anchor.entry);\n    if (parent === undefined) return false;\n    return parent.band.type === \"none\" || anchor.side === \"before\";\n}\n\n/** Group insertions snap around whole groups, never split a child array. */\nexport function groupInsertionSide(row: SheetRowValue, anchor: InsertionAnchor): \"before\" | \"after\" {\n    if (anchor.tail) return \"after\";\n    if (anchor.child === undefined) return anchor.side;\n    const index = row.lines.findIndex(line => line.key === anchor.child);\n    const slot = index + (anchor.side === \"after\" ? 1 : 0);\n    return slot <= row.lines.length / 2 ? \"before\" : \"after\";\n}\n\n/**\n * Build one wire gesture; constructors and draft decoding still run at the\n * common transaction boundary.\n *\n * @param request - What to insert, and where\n * @param rows - The rows on screen, in order\n * @param positionOf - A row's position by its index — a failed window before it counts (#853)\n * @param grouped - Whether the rows are groups\n * @param keyed - Whether the source is keyed\n * @param makeEntry - Mints a new entry's id\n * @param makeChild - Mints a new line's key in a group\n * @param loose - Whether rows may stand between the groups (#846): a row inserted where {@link insertsLoose} says is a loose row, not a line\n * @returns The gesture, or `undefined` when its anchor is gone\n */\nexport function insertionGesture(request: InsertRequest, rows: readonly SheetRowValue[], positionOf: (index: number) => number, grouped: boolean, keyed: boolean,\n    makeEntry: () => string, makeChild: (group: SheetRowValue) => string, loose = false,\n): { event: SheetEditValue; placement?: Placement; id: string; child?: string } | undefined {\n    const { kind, anchor } = request;\n    const at = anchor.entry === undefined ? -1 : rows.findIndex(row => row.id === anchor.entry);\n    if (anchor.entry !== undefined && at < 0) return undefined;\n    const parent = rows[at];\n    if (kind === \"row\" && grouped && !(loose && insertsLoose(anchor, rows))) {\n        if (parent === undefined) return undefined;\n        const childAt = anchor.child === undefined ? -1 : parent.lines.findIndex(line => line.key === anchor.child);\n        if (anchor.child !== undefined && childAt < 0) return undefined;\n        const index = anchor.tail ? parent.lines.length : childAt < 0 ? 0 : childAt + (anchor.side === \"after\" ? 1 : 0);\n        const key = makeChild(parent);\n        const lines = [...parent.lines];\n        lines.splice(index, 0, { key, cells: new Map(), subRows: [] });\n        return { id: parent.id, child: key, event: variant(\"lineInsert\", {\n            rowId: parent.id, offset: BigInt(positionOf(at)), after: index > 0 ? some(String(index - 1)) : none,\n            line: String(index), row: { ...parent, lines }, source: variant(\"typed\", null),\n        }) };\n    }\n    const id = makeEntry();\n    if (rows.some(row => row.id === id)) throw new Error(\"The new row id already exists in this sheet\");\n    const side = kind === \"group\" && parent !== undefined ? groupInsertionSide(parent, anchor) : anchor.side;\n    const placement: Placement = some(keyed ? variant(\"keyOrder\", null) : variant(\"ordered\", parent === undefined ? variant(\"end\", null) : variant(side, parent.id)));\n    const row: SheetRowValue = { id, owned: false, cells: new Map(), lines: [], band: kind === \"group\" ? some({ sub: \"\", folded: false }) : none, subRows: [] };\n    return { id, placement, event: variant(\"insert\", { afterRowId: none, row, source: variant(\"typed\", null) }) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The sheet's drops (#1187, `Sheet Builder Spec.md` §9.8, §10; SB38–SB40,\n * SB44, SB45, SB61): what a builder's library cards and the rows' own grips\n * do where they land, decided as data before anything is drawn or written.\n *\n * - **Where a drag rests** is a row of the row space — a flat row, a loose\n *   row, a group's line, its band, its blank line, or the blank tail — which\n *   the shared drag grammar's `CellRef` names by {@link SheetDropRowType},\n *   printed, its `slot` the seam the pointer's half picks (`before` /\n *   `after`), or `\"\"` for the row itself, where an author's card lands.\n * - **What a drop does** ({@link planDrop}): a template inserted at the seam,\n *   as the seam's own chips insert, seeded by the template (SB39, SB40); a\n *   card's cells set on the row, or on the band (SB61); a row, a line or a\n *   group moved to the seam (SB44); nothing, where the row already stands; or\n *   refused, with the reason the ghost says in red.\n * - **Its words** ({@link dropCaption}, {@link dropName}): the place it lands\n *   — `after row 3`, `→ row 3` — or why it can't, in the sheet's words.\n *\n * Pure: no React, no DOM. The sheet's core hands it the rows as they stand\n * ({@link SheetDropContext}), and runs a plan as one transaction.\n *\n * @packageDocumentation\n */\n\nimport { NullType, StringType, StructType, VariantType, parseFor, printFor, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport type { CellCoord, DragPayload, DropCellOptions, DropVeto } from \"@elaraai/east-ui-components\";\nimport { TITLE_KEY, lineId, type SheetBodyItem, type SheetColumnMeta } from \"./model.js\";\nimport { groupInsertionSide, insertsLoose, type InsertRequest, type InsertionAnchor } from \"./insertion-gesture.js\";\nimport type { SheetDropPlaceWord, SheetDropRefusalWord } from \"./messages.js\";\nimport type { SheetSeeds } from \"./use-editing.js\";\nimport type { SheetCellValue, SheetNounValue, SheetRowValue } from \"./values.js\";\nimport type { SheetWords } from \"./words.js\";\n\n// ── Where a drag rests ────────────────────────────────────────────────────\n\n/** A row of the row space a drag rests on — what a sheet's drop `CellRef` names in its `row`, printed. */\nexport const SheetDropRowType = VariantType({\n    /** A flat row — or a loose row between the groups (#846) — by its id. */\n    row: StringType,\n    /** A group's line: its group's id, and its key among the group's lines. */\n    line: StructType({ group: StringType, key: StringType }),\n    /** A group's band, by its group's id. */\n    band: StringType,\n    /** A group's blank line, by its group's id: a new line at the group's end. */\n    groupEnd: StringType,\n    /** The blank tail under a flat sheet's rows. */\n    end: NullType,\n});\n\n/** A row a drag rests on, decoded. */\nexport type SheetDropRow = ValueTypeOf<typeof SheetDropRowType>;\n\n/** A drop's row as its `CellRef` carries it. */\nexport const printDropRow: (row: SheetDropRow) => string = printFor(SheetDropRowType);\n\nconst parseDropRow = parseFor(SheetDropRowType);\n\n/**\n * The row a drop's `CellRef` names.\n *\n * @param text - The `CellRef`'s `row`\n * @returns The row, or `undefined` when the text names none — a coordinate another surface made\n */\nexport function readDropRow(text: string): SheetDropRow | undefined {\n    const read = parseDropRow(text);\n    return read.success ? read.value : undefined;\n}\n\n/** A seam's side of a row. */\nexport type SheetDropSide = \"before\" | \"after\";\n\n// ── What is dragged ───────────────────────────────────────────────────────\n\n/** A template the builder offers to drop (SB39, SB40): its name, whether it makes a row or a group, and the seeds its new entry takes. */\nexport interface SheetDropTemplate {\n    /** The template's name — the card's. */\n    name: string;\n    /** A row (a grouped sheet's line), or a group with its lines. */\n    kind: \"row\" | \"group\";\n    /** `newRow`'s or `newGroup`'s seed, the template's fields over its defaults: what the new entry starts as. */\n    seeds: SheetSeeds;\n}\n\n/** An author's card that drops (SB61): its label, and the cells its `drop` patch sets. */\nexport interface SheetDropCard {\n    /** The card's label. */\n    label: string;\n    /** The cells the patch sets, by the column key (a band's: the band cell's). */\n    sets: ReadonlyMap<string, SheetCellValue>;\n}\n\n/** What the host lets the sheet take, and from where (#1187): a builder's library and the rows' grips. */\nexport interface SheetDropHost {\n    /** The sheet's drop target: the surface its rows register on. */\n    surface: string;\n    /** The templates' library, and the templates by key — `undefined` when the builder lists no Rows tab. */\n    templates: { library: string; byKey: ReadonlyMap<string, SheetDropTemplate> } | undefined;\n    /** Each author's tab that drops, by its library: where its cards land, and its cards by key. */\n    tabs: ReadonlyMap<string, { lands: \"row\" | \"group\"; cards: ReadonlyMap<string, SheetDropCard> }>;\n}\n\n/** What is dragged, as the sheet reads it: a template, a card, or one of its own rows. */\nexport type SheetDropSource =\n    | { kind: \"template\"; template: SheetDropTemplate }\n    | { kind: \"card\"; card: SheetDropCard; lands: \"row\" | \"group\" }\n    | { kind: \"move\"; row: SheetDropRow };\n\n/**\n * A library card, as the sheet reads it.\n *\n * @param host - What the host offers\n * @param library - The card's library\n * @param key - The card's key\n * @returns The template or the card, or `undefined` when the host offers none by that key\n */\nexport function cardSource(host: SheetDropHost, library: string, key: string): SheetDropSource | undefined {\n    if (host.templates !== undefined && host.templates.library === library) {\n        const template = host.templates.byKey.get(key);\n        return template === undefined ? undefined : { kind: \"template\", template };\n    }\n    const tab = host.tabs.get(library);\n    const card = tab?.cards.get(key);\n    return tab === undefined || card === undefined ? undefined : { kind: \"card\", card, lands: tab.lands };\n}\n\n/**\n * What a drag carries, as the sheet reads it.\n *\n * @param host - What the host offers\n * @param payload - What the drag carries\n * @returns A library card, or one of the sheet's rows; `undefined` for anything else\n */\nexport function payloadSource(host: SheetDropHost, payload: DragPayload): SheetDropSource | undefined {\n    if (payload.kind === \"item\") return cardSource(host, payload.from.library, payload.from.key);\n    if (payload.kind !== \"event\") return undefined;\n    const row = readDropRow(payload.from.row);\n    return row === undefined ? undefined : { kind: \"move\", row };\n}\n\n/**\n * The slot a drag picks over a row: the row itself for an author's card, else\n * the seam the pointer's half is nearer.\n *\n * @param host - What the host offers\n * @param payload - What the drag carries\n * @param rect - The row's box\n * @param clientY - The pointer's height\n * @returns `\"\"`, `before` or `after`\n */\nexport function slotAt(host: SheetDropHost, payload: DragPayload, rect: { top: number; height: number }, clientY: number): string {\n    if (payloadSource(host, payload)?.kind === \"card\") return \"\";\n    return clientY < rect.top + rect.height / 2 ? \"before\" : \"after\";\n}\n\n// ── What a drop does ──────────────────────────────────────────────────────\n\n/** What a drop reads of the sheet as it stands. */\nexport interface SheetDropContext {\n    /** The rows on screen, in order: a flat sheet's rows, a grouped sheet's groups and loose rows. */\n    rows: readonly SheetRowValue[];\n    /** The body item at a row-space index. */\n    rowAt: (r: number) => SheetBodyItem | undefined;\n    /** The row-space index of a row, a band or a line, by its id — a line's by its synthetic id. */\n    rowOf: (id: string) => number | undefined;\n    /** The row-space index of a group's blank line. */\n    blankLineRowOf: (group: string) => number | undefined;\n    /** The row-space index of a flat sheet's first blank padding row: its tail. */\n    tailRow: number | undefined;\n    /** The rows of the row space. */\n    rowCount: number;\n    /** Whether the rows are groups (#740). */\n    grouped: boolean;\n    /** Whether rows stand between the groups (#846). */\n    loose: boolean;\n    /** Whether the source sorts its entries by key. */\n    keyed: boolean;\n    /** Whether a gesture may be made now: the sheet is not read only, and its session takes one. */\n    writable: boolean;\n    /** What the sheet's `edits` let it do. */\n    can: { insertRows: boolean; insertGroups: boolean; moveRows: \"none\" | \"within\" | \"between\"; moveGroups: boolean };\n    /** The column a card's cell lands under — on a band, its band cell — by key: whether the sheet writes it, and its header. */\n    columnAt: (band: boolean, key: string) => Pick<SheetColumnMeta, \"editable\" | \"kind\" | \"header\"> | undefined;\n    /** Whether a card's cell takes an edit on a row — its column writes, and no mark locks it (#1560); the column's `editable` alone when absent. */\n    writableAt?: ((r: number, band: boolean, key: string) => boolean) | undefined;\n    /** Where an insertion at a row's seam goes: the seam chips' own anchor. */\n    anchorFor: (r: number, side: SheetDropSide) => InsertionAnchor;\n}\n\n/** A drop's place: a seam beside a row of the row space, a group's start or end, the sheet's end, or a keyed source's key order. */\nexport type SheetDropPlace =\n    | { at: \"seam\"; r: number; side: SheetDropSide }\n    | { at: \"groupStart\" | \"groupEnd\"; r: number }\n    | { at: \"sheetEnd\" }\n    | { at: \"keyOrder\"; group: boolean };\n\n/** The seam a drop marks: a row of the row space, and the edge of it the insertion line runs along. */\nexport interface SheetDropMark {\n    r: number;\n    edge: \"top\" | \"bottom\";\n}\n\n/** Why a drop is refused where it rests. */\nexport type SheetDropRefusal =\n    /** The row it rests on, or the one it carries, has left the sheet. It says nothing. */\n    | { why: \"gone\" }\n    | { why: \"readOnly\" | \"insertGroup\" | \"ontoBand\" | \"noGroupMove\" | \"lineOut\" }\n    | { why: \"insert\" | \"ontoRow\" | \"noMove\"; line: boolean }\n    | { why: \"keyOrder\"; group: boolean }\n    | { why: \"column\"; header: string }\n    /** A line moves only within its group: the group's band. */\n    | { why: \"within\"; r: number };\n\n/** What a drop does where it rests. */\nexport type SheetDropPlan =\n    /** A template inserted where the seam's own chips would insert it, seeded by the template (SB39, SB40). */\n    | { kind: \"insert\"; template: SheetDropTemplate; request: InsertRequest; place: SheetDropPlace; mark: SheetDropMark | undefined }\n    /** A card's cells set on a row or a band (SB61). */\n    | { kind: \"set\"; card: SheetDropCard; r: number }\n    /** An entry — a flat or loose row, or a group with its lines — placed beside another, or at the end (SB44). */\n    | { kind: \"moveEntry\"; id: string; to: { side: SheetDropSide; anchor: string } | \"end\"; place: SheetDropPlace; mark: SheetDropMark }\n    /** A line moved within its group or into another (SB44): from its group and key, into a group at a slot of its lines as they stand. */\n    | { kind: \"moveLine\"; from: { group: string; key: string }; to: { group: string; index: number }; place: SheetDropPlace; mark: SheetDropMark }\n    /** The row is where the drop would put it: nothing moves. */\n    | { kind: \"stay\"; place: SheetDropPlace; mark: SheetDropMark }\n    | { kind: \"refused\"; why: SheetDropRefusal };\n\n/** A row of the row space, and what stands there. */\ninterface At {\n    r: number;\n    item: SheetBodyItem;\n}\n\nconst refused = (why: SheetDropRefusal): SheetDropPlan => ({ kind: \"refused\", why });\nconst seamMark = (r: number, side: SheetDropSide): SheetDropMark => ({ r, edge: side === \"before\" ? \"top\" : \"bottom\" });\n\n/**\n * Where a drop's row stands now.\n *\n * @param row - The row\n * @param ctx - The sheet as it stands\n * @returns Its row-space index and its item, or `undefined` once it has left the sheet\n */\nexport function locateDrop(row: SheetDropRow, ctx: SheetDropContext): At | undefined {\n    const r = row.type === \"row\" || row.type === \"band\" ? ctx.rowOf(row.value)\n        : row.type === \"line\" ? ctx.rowOf(lineId(row.value.group, row.value.key))\n            : row.type === \"groupEnd\" ? ctx.blankLineRowOf(row.value)\n                : ctx.tailRow;\n    const item = r === undefined ? undefined : ctx.rowAt(r);\n    return r === undefined || item === undefined ? undefined : { r, item };\n}\n\n/**\n * The row a row-space item is, as a drop names it.\n *\n * @param item - The item\n * @returns Its drop row; `undefined` for what no drop rests on (a band of\n *   unloaded rows, a sub row, a proposal)\n */\nexport function dropRowOf(item: SheetBodyItem): SheetDropRow | undefined {\n    switch (item.kind) {\n        case \"real\": return item.group !== undefined ? variant(\"line\", { group: item.group.row.id, key: item.group.key }) : variant(\"row\", item.row.id);\n        case \"group\": return variant(\"band\", item.row.id);\n        case \"blank\": return item.group !== undefined ? variant(\"groupEnd\", item.group.row.id) : variant(\"end\", null);\n        default: return undefined;\n    }\n}\n\n/**\n * What a drop does where it rests — see the module docs.\n *\n * @param source - What is dragged\n * @param row - The row it rests on\n * @param slot - The seam the pointer's half picks (`before` / `after`), or `\"\"`, the row itself\n * @param ctx - The sheet as it stands\n * @returns What the drop does, or why it is refused\n */\nexport function planDrop(source: SheetDropSource, row: SheetDropRow, slot: string, ctx: SheetDropContext): SheetDropPlan {\n    const at = locateDrop(row, ctx);\n    if (at === undefined) return refused({ why: \"gone\" });\n    if (!ctx.writable) return refused({ why: \"readOnly\" });\n    const side: SheetDropSide = slot === \"before\" ? \"before\" : \"after\";\n    switch (source.kind) {\n        case \"card\": return planCard(source.card, source.lands, at, ctx);\n        case \"template\": return source.template.kind === \"group\" ? planGroupTemplate(source.template, at, side, ctx) : planRowTemplate(source.template, at, side, ctx);\n        case \"move\": return planMove(source.row, at, side, ctx);\n    }\n}\n\n/**\n * What a card's ⏎ does (SB45): what a drop below the ring's row would — a\n * row template after it, a group template after its group, and a card on\n * the row itself.\n *\n * @param source - The card: a template, or an author's card\n * @param row - The ring's row\n * @param ctx - The sheet as it stands\n * @returns What the ⏎ does, or why it is refused there\n */\nexport function planBelow(source: SheetDropSource, row: SheetDropRow, ctx: SheetDropContext): SheetDropPlan {\n    if (source.kind !== \"template\" || source.template.kind !== \"group\") return planDrop(source, row, source.kind === \"card\" ? \"\" : \"after\", ctx);\n    const at = locateDrop(row, ctx);\n    if (at === undefined) return refused({ why: \"gone\" });\n    if (!ctx.writable) return refused({ why: \"readOnly\" });\n    if (!ctx.grouped || !ctx.can.insertGroups) return refused({ why: \"insertGroup\" });\n    // Below the ring's group — or the loose row it is on.\n    const entry = entryOf(at, ctx);\n    if (entry === undefined) return refused({ why: \"gone\" });\n    const request: InsertRequest = { kind: \"group\", anchor: { entry: entry.id, side: \"after\" } };\n    if (ctx.keyed) return { kind: \"insert\", template: source.template, request, place: { at: \"keyOrder\", group: true }, mark: undefined };\n    return { kind: \"insert\", template: source.template, request, place: { at: \"seam\", r: entry.r, side: \"after\" }, mark: entry.after };\n}\n\n/** A card's cells set on a row, or on a band (SB61) — refused anywhere else, or where a cell it sets is read only or locked. */\nfunction planCard(card: SheetDropCard, lands: \"row\" | \"group\", at: At, ctx: SheetDropContext): SheetDropPlan {\n    const band = at.item.kind === \"group\";\n    if (lands === \"group\" ? !band : at.item.kind !== \"real\") return refused(lands === \"group\" ? { why: \"ontoBand\" } : { why: \"ontoRow\", line: ctx.grouped });\n    for (const key of card.sets.keys()) {\n        const meta = ctx.columnAt(band, key);\n        if (meta === undefined || !(ctx.writableAt?.(at.r, band, key) ?? meta.editable) || meta.kind === \"stamped\") return refused({ why: \"column\", header: meta?.header ?? key });\n    }\n    return { kind: \"set\", card, r: at.r };\n}\n\n/**\n * A row template's insertion (SB39): where the seam's own row chip would\n * insert — beside the row it rests on by the pointer's half; at a group's\n * start on its band (a row before the group, beside loose rows, on the\n * band's top half); at its end on its blank line; at the sheet's end on the\n * blank tail. On a keyed source a new entry sits where its key sorts.\n */\nfunction planRowTemplate(template: SheetDropTemplate, at: At, side: SheetDropSide, ctx: SheetDropContext): SheetDropPlan {\n    if (!ctx.can.insertRows) return refused({ why: \"insert\", line: ctx.grouped });\n    const { r, item } = at;\n    // A band takes a line at its group's start, whatever the half — but beside loose rows its top half is a row before the group (#846).\n    const anchorSide: SheetDropSide = item.kind === \"group\" && !(ctx.loose && side === \"before\") ? \"after\" : side;\n    const anchor = ctx.anchorFor(r, anchorSide);\n    const request: InsertRequest = { kind: \"row\", anchor };\n    const entry = !ctx.grouped || (ctx.loose && insertsLoose(anchor, ctx.rows));\n    if (entry && ctx.keyed) return { kind: \"insert\", template, request, place: { at: \"keyOrder\", group: false }, mark: undefined };\n    if (item.kind === \"blank\") {\n        return { kind: \"insert\", template, request, place: item.group !== undefined ? { at: \"groupEnd\", r } : { at: \"sheetEnd\" }, mark: { r, edge: \"top\" } };\n    }\n    if (item.kind === \"group\" && anchorSide === \"after\") return { kind: \"insert\", template, request, place: { at: \"groupStart\", r }, mark: { r, edge: \"bottom\" } };\n    return { kind: \"insert\", template, request, place: { at: \"seam\", r, side: anchorSide }, mark: seamMark(r, anchorSide) };\n}\n\n/** A group template's insertion (SB40): at the seam between entries nearest where it rests, as the seam's group chip snaps. */\nfunction planGroupTemplate(template: SheetDropTemplate, at: At, side: SheetDropSide, ctx: SheetDropContext): SheetDropPlan {\n    if (!ctx.grouped || !ctx.can.insertGroups) return refused({ why: \"insertGroup\" });\n    const seam = entrySeam(at, side, ctx);\n    if (seam === undefined) return refused({ why: \"gone\" });\n    const request: InsertRequest = { kind: \"group\", anchor: { entry: seam.id, side: seam.side } };\n    if (ctx.keyed) return { kind: \"insert\", template, request, place: { at: \"keyOrder\", group: true }, mark: undefined };\n    return { kind: \"insert\", template, request, place: { at: \"seam\", r: seam.r, side: seam.side }, mark: seam.mark };\n}\n\n/** A grip's move (SB44): a row's, a line's or a band's. */\nfunction planMove(from: SheetDropRow, at: At, side: SheetDropSide, ctx: SheetDropContext): SheetDropPlan {\n    const src = locateDrop(from, ctx);\n    if (src === undefined) return refused({ why: \"gone\" });\n    const item = src.item;\n    if (item.kind === \"group\") {\n        if (!ctx.can.moveGroups) return refused(ctx.keyed ? { why: \"keyOrder\", group: true } : { why: \"noGroupMove\" });\n        const seam = entrySeam(at, side, ctx);\n        if (seam === undefined) return refused({ why: \"gone\" });\n        return entryMove(item.row.id, { side: seam.side, anchor: seam.id }, { at: \"seam\", r: seam.r, side: seam.side }, seam.mark, ctx);\n    }\n    if (item.kind !== \"real\") return refused({ why: \"gone\" });\n    if (item.group !== undefined) return planLineMove(item.group.row.id, item.group.key, item.group.index, at, side, ctx);\n    // A flat row, or a loose row between the groups (#846): an entry of its own.\n    if (ctx.can.moveRows === \"none\") return refused({ why: \"noMove\", line: false });\n    if (ctx.keyed) return refused({ why: \"keyOrder\", group: false });\n    if (ctx.grouped) {\n        // A loose row stays between the groups: it takes the seam between entries nearest where it rests.\n        const seam = entrySeam(at, side, ctx);\n        if (seam === undefined) return refused({ why: \"gone\" });\n        return entryMove(item.row.id, { side: seam.side, anchor: seam.id }, { at: \"seam\", r: seam.r, side: seam.side }, seam.mark, ctx);\n    }\n    if (at.item.kind === \"blank\") return entryMove(item.row.id, \"end\", { at: \"sheetEnd\" }, { r: at.r, edge: \"top\" }, ctx);\n    if (at.item.kind !== \"real\") return refused({ why: \"gone\" });\n    return entryMove(item.row.id, { side, anchor: at.item.row.id }, { at: \"seam\", r: at.r, side }, seamMark(at.r, side), ctx);\n}\n\n/**\n * A line's move (SB44): beside another line by the pointer's half, at a\n * group's start on its band, at its end on its blank line — within its own\n * group only when `edits.moveRows` is `within`; never out of the groups.\n */\nfunction planLineMove(group: string, key: string, index: number, at: At, side: SheetDropSide, ctx: SheetDropContext): SheetDropPlan {\n    if (ctx.can.moveRows === \"none\") return refused({ why: \"noMove\", line: true });\n    const { r, item } = at;\n    let into: SheetRowValue;\n    let slot: number;\n    let place: SheetDropPlace;\n    let mark: SheetDropMark;\n    if (item.kind === \"real\" && item.group !== undefined) {\n        into = item.group.row;\n        slot = item.group.index + (side === \"after\" ? 1 : 0);\n        place = { at: \"seam\", r, side };\n        mark = seamMark(r, side);\n    } else if (item.kind === \"group\") {\n        into = item.row;\n        slot = 0;\n        place = { at: \"groupStart\", r };\n        mark = { r, edge: \"bottom\" };\n    } else if (item.kind === \"blank\" && item.group !== undefined) {\n        into = item.group.row;\n        slot = into.lines.length;\n        place = { at: \"groupEnd\", r };\n        mark = { r, edge: \"top\" };\n    } else {\n        // A loose row or the blank tail: a line stays in a group.\n        return refused({ why: \"lineOut\" });\n    }\n    if (into.id !== group && ctx.can.moveRows === \"within\") return refused({ why: \"within\", r: ctx.rowOf(group) ?? r });\n    // Its own slot, or the one just after it: it stays where it is.\n    if (into.id === group && (slot === index || slot === index + 1)) return { kind: \"stay\", place, mark };\n    return { kind: \"moveLine\", from: { group, key }, to: { group: into.id, index: slot }, place, mark };\n}\n\n/** An entry placed beside another, or at the end — or left where it stands, when that is already its place. */\nfunction entryMove(id: string, to: { side: SheetDropSide; anchor: string } | \"end\", place: SheetDropPlace, mark: SheetDropMark, ctx: SheetDropContext): SheetDropPlan {\n    const i = ctx.rows.findIndex((row) => row.id === id);\n    if (to === \"end\") return i === ctx.rows.length - 1 ? { kind: \"stay\", place, mark } : { kind: \"moveEntry\", id, to, place, mark };\n    const j = ctx.rows.findIndex((row) => row.id === to.anchor);\n    if (j === i || (to.side === \"before\" && j === i + 1) || (to.side === \"after\" && j === i - 1)) return { kind: \"stay\", place, mark };\n    return { kind: \"moveEntry\", id, to, place, mark };\n}\n\n/** The entry a row of the row space belongs to — a band's, a line's or a blank line's group, or a loose row — with its band's (or its own) index, and the seam below it. */\nfunction entryOf(at: At, ctx: SheetDropContext): { id: string; r: number; after: SheetDropMark } | undefined {\n    const { r, item } = at;\n    if (item.kind === \"real\" && item.group === undefined) return { id: item.row.id, r, after: seamMark(r, \"after\") };\n    const group = item.kind === \"group\" ? item.row : item.kind === \"real\" || item.kind === \"blank\" ? item.group?.row : undefined;\n    if (group === undefined) return undefined;\n    const band = ctx.rowOf(group.id);\n    return band === undefined ? undefined : { id: group.id, r: band, after: belowGroup(band, group.id, ctx) };\n}\n\n/**\n * The seam between entries a group — dropped or moved — or a loose row lands\n * on, from where it rests: a loose row's own seam by the half; a band's top\n * half the seam above its group, and its bottom half the seam below it when\n * the group shows no lines (folded, or empty); a line, the nearer of its\n * group's two seams, as the seam's group chip snaps; the group's blank line,\n * the seam below it.\n */\nfunction entrySeam(at: At, side: SheetDropSide, ctx: SheetDropContext): { id: string; r: number; side: SheetDropSide; mark: SheetDropMark } | undefined {\n    const { r, item } = at;\n    if (item.kind === \"real\" && item.group === undefined) return { id: item.row.id, r, side, mark: seamMark(r, side) };\n    const entry = entryOf(at, ctx);\n    if (entry === undefined) return undefined;\n    let groupSide: SheetDropSide;\n    if (item.kind === \"group\") groupSide = side === \"after\" && (item.folded || item.count === 0) ? \"after\" : \"before\";\n    else if (item.kind === \"blank\") groupSide = \"after\";\n    else if (item.kind === \"real\" && item.group !== undefined) groupSide = groupInsertionSide(item.group.row, { entry: entry.id, child: item.group.key, side });\n    else return undefined;\n    return { id: entry.id, r: entry.r, side: groupSide, mark: groupSide === \"before\" ? { r: entry.r, edge: \"top\" } : entry.after };\n}\n\n/** The seam below a group: the top of the row after its last line (or its blank line), else the bottom of its last. */\nfunction belowGroup(band: number, id: string, ctx: SheetDropContext): SheetDropMark {\n    let last = band;\n    for (let k = band + 1; k < ctx.rowCount; k++) {\n        const it = ctx.rowAt(k);\n        if (it === undefined || !((it.kind === \"real\" || it.kind === \"blank\") && it.group?.row.id === id)) break;\n        last = k;\n    }\n    return last + 1 < ctx.rowCount ? { r: last + 1, edge: \"top\" } : { r: last, edge: \"bottom\" };\n}\n\n// ── Its words ─────────────────────────────────────────────────────────────\n\n/** A group's title, from its band's cell. */\nfunction titleOf(group: SheetRowValue): string | undefined {\n    const cell = group.cells.get(TITLE_KEY);\n    return cell !== undefined && cell.type === \"String\" && cell.value !== \"\" ? cell.value : undefined;\n}\n\n/**\n * A row of the row space, in words — `row 3`, `line 2 of WO-2201 · Kitchen,\n * oak`, `order 1` — as the inspector names it.\n *\n * @param r - The row's index\n * @param ctx - The sheet as it stands\n * @param words - The sheet's words\n * @param noun - The word for a group\n * @returns The words; `\"\"` for no row\n */\nexport function dropWhat(r: number, ctx: SheetDropContext, words: SheetWords, noun: SheetNounValue): string {\n    const item = ctx.rowAt(r);\n    const m = words.m;\n    if (item === undefined) return \"\";\n    if (item.kind === \"group\") return m.inspectorWhat({ what: \"band\", number: String(item.position + 1), title: titleOf(item.row), noun: noun.singular });\n    if (item.kind === \"blank\" && item.group !== undefined) return m.inspectorWhat({ what: \"band\", number: String(item.position + 1), title: titleOf(item.group.row), noun: noun.singular });\n    if ((item.kind === \"real\" || item.kind === \"blank\") && item.group !== undefined) {\n        return m.inspectorWhat({ what: \"line\", number: String(item.group.number), title: titleOf(item.group.row), noun: noun.singular });\n    }\n    return m.inspectorWhat({ what: \"row\", number: String(item.kind === \"real\" || item.kind === \"blank\" ? item.position + 1 : r + 1), title: undefined, noun: noun.singular });\n}\n\n/** A place, as its words take it. */\nfunction placeWord(place: SheetDropPlace, ctx: SheetDropContext, words: SheetWords, noun: SheetNounValue): SheetDropPlaceWord {\n    switch (place.at) {\n        case \"seam\": return { place: place.side, what: dropWhat(place.r, ctx, words, noun) };\n        case \"groupStart\": return { place: \"start\", what: dropWhat(place.r, ctx, words, noun) };\n        case \"groupEnd\": return { place: \"end\", what: dropWhat(place.r, ctx, words, noun) };\n        case \"sheetEnd\": return { place: \"sheetEnd\" };\n        case \"keyOrder\": return { place: \"sorted\", group: place.group, noun: noun.singular };\n    }\n}\n\n/** A refusal, as its words take it — `undefined` for one that says nothing. */\nfunction refusalWord(why: SheetDropRefusal, ctx: SheetDropContext, words: SheetWords, noun: SheetNounValue): SheetDropRefusalWord | undefined {\n    switch (why.why) {\n        case \"gone\": return undefined;\n        case \"readOnly\": case \"ontoBand\": return { why: why.why };\n        case \"insertGroup\": case \"noGroupMove\": return { why: why.why, nouns: noun.plural };\n        case \"lineOut\": return { why: \"lineOut\", noun: noun.singular };\n        case \"insert\": case \"ontoRow\": case \"noMove\": return { why: why.why, line: why.line };\n        case \"keyOrder\": return { why: \"keyOrder\", group: why.group, nouns: noun.plural };\n        case \"column\": return { why: \"column\", header: why.header };\n        case \"within\": return { why: \"within\", what: dropWhat(why.r, ctx, words, noun) };\n    }\n}\n\n/**\n * Why a plan is refused, as the words take it — what a card's ⏎ leaves in the\n * footer where it can't land (SB45).\n *\n * @param plan - The plan\n * @param ctx - The sheet as it stands\n * @param words - The sheet's words\n * @param noun - The word for a group\n * @returns The refusal's words; `undefined` for a plan that lands, or one refused without words\n */\nexport function dropRefusal(plan: SheetDropPlan, ctx: SheetDropContext, words: SheetWords, noun: SheetNounValue): SheetDropRefusalWord | undefined {\n    return plan.kind === \"refused\" ? refusalWord(plan.why, ctx, words, noun) : undefined;\n}\n\n/**\n * What the ghost says of a plan (SB38, SB61): the place a drop lands —\n * `after row 3`, `at the start of order 2`, `→ row 3` for a card — or, red,\n * why it can't.\n *\n * @param plan - The plan\n * @param ctx - The sheet as it stands\n * @param words - The sheet's words\n * @param noun - The word for a group\n * @returns The caption; `undefined` when it says nothing\n */\nexport function dropCaption(plan: SheetDropPlan, ctx: SheetDropContext, words: SheetWords, noun: SheetNounValue): string | undefined {\n    const m = words.m;\n    switch (plan.kind) {\n        case \"set\": return m.dropOnto({ what: dropWhat(plan.r, ctx, words, noun) });\n        case \"refused\": {\n            const word = refusalWord(plan.why, ctx, words, noun);\n            return word === undefined ? undefined : m.dropRefused(word);\n        }\n        default: return m.dropPlace(placeWord(plan.place, ctx, words, noun));\n    }\n}\n\n/**\n * Where a plan lands, as a screen reader hears the drag layer say it — `the\n * gap after row 3`, `row 3` for a card — or, refused, the row it rests on.\n *\n * @param plan - The plan\n * @param at - The row it rests on\n * @param ctx - The sheet as it stands\n * @param words - The sheet's words\n * @param noun - The word for a group\n * @returns The name\n */\nexport function dropName(plan: SheetDropPlan, at: number | undefined, ctx: SheetDropContext, words: SheetWords, noun: SheetNounValue): string {\n    switch (plan.kind) {\n        case \"set\": return dropWhat(plan.r, ctx, words, noun);\n        case \"refused\": return at === undefined ? \"\" : dropWhat(at, ctx, words, noun);\n        default: return words.m.dropPlaceName(placeWord(plan.place, ctx, words, noun));\n    }\n}\n\n// ── A row's part ──────────────────────────────────────────────────────────\n\n/**\n * What every row hands the drag layer, as a drop target and as a grip\n * (#1187): one object every row shares, held still while the sheet takes\n * drops, its functions reading the sheet as it stands.\n */\nexport interface SheetRowDrop {\n    /** The surface the rows register on. */\n    surface: string;\n    /** The veto: whether the drop a candidate event makes lands. */\n    canDrop: DropVeto;\n    /** The slot a drag picks over a row, from its box and the pointer's height. */\n    slotAt: (payload: DragPayload, rect: { top: number; height: number }, clientY: number) => string;\n    /** What the ghost says over a row, and its name for the announcements. */\n    options: Required<Pick<DropCellOptions, \"caption\" | \"name\">>;\n    /** Told each time a drag rests over a row that takes it: the row's element, where it rests, and what is dragged — the seam line, or the row itself, lights. */\n    hover: (el: HTMLElement, coord: CellCoord, payload: DragPayload) => void;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a body item is known by as the rows move: its key for the virtual rows, the source element it stands for, its\n * place in the row space and among the grid's rows, the record's rows it stands for under the lens, and its drop row.\n *\n * @packageDocumentation\n */\n\nimport { blankIdOf, bodyIndexOfId, type SheetBodyItem } from \"./model.js\";\nimport { isBlankRowId } from \"./sheet-state.js\";\nimport { dropRowOf, printDropRow } from \"./drop.js\";\n\n/**\n * The record's rows a body item stands for under the lens (#1349): a row's\n * own — a line's or a sub row's, its group's — or the stretch a band reads or\n * a failed read covers; none for a proposal, which no row stands behind yet.\n */\nexport function spanOf(it: SheetBodyItem): { from: number; to: number } | undefined {\n    switch (it.kind) {\n        case \"band\": return { from: it.band.from, to: it.band.to };\n        case \"failed\": return { from: it.failure.from, to: it.failure.to };\n        case \"proposal\": return undefined;\n        default: return { from: it.position, to: it.position };\n    }\n}\n\n/** The boxes of the rows the virtualizer has mounted, by body index (its row wrappers carry `data-index`). */\nexport function mountedBoxes(scrollEl: HTMLElement): Map<number, DOMRect> {\n    const out = new Map<number, DOMRect>();\n    for (const w of scrollEl.querySelectorAll<HTMLElement>(\":scope > div > [data-index]\")) out.set(Number(w.dataset.index), w.getBoundingClientRect());\n    return out;\n}\n\n/** A body item's identity for the virtual rows: it stays with the item when rows open, fold or move around it. */\nexport function keyOfItem(it: SheetBodyItem | undefined, i: number): string {\n    if (it === undefined) return `#${i}`;\n    switch (it.kind) {\n        case \"real\": return `row:${it.row.id}`;\n        case \"group\": return `group:${it.row.id}`;\n        case \"subRow\": return `sub:${it.lineId}#${it.index}`;\n        case \"blank\": return `blank:${blankIdOf(it)}`;\n        // A band is a place in one run, never an item (#1398): it is keyed by the elements it stands for — a paged run's\n        // band at each end, the lens's for each stretch it reads (#1349) — so a band that comes to stand for others, a\n        // window landing beside it, is another item, and never carries the height the frame measured for the last.\n        case \"band\": return `band:${it.band.at}:${it.band.from}-${it.band.to}`;\n        case \"failed\": return `failed:${it.failure.w}`;\n        case \"proposal\": return `proposal:${it.anchorR}#${it.index}`;\n    }\n    return `#${i}`;\n}\n\n/** The source element a body item belongs to (#857) — a row, or a line's or a sub row's group; `null` where no element stands behind it (a paged band, a blank). */\nexport function elementOf(it: SheetBodyItem): number | null {\n    switch (it.kind) {\n        case \"real\": case \"group\": case \"subRow\": return it.position;\n        case \"failed\": return it.failure.from;\n        default: return null;\n    }\n}\n\n/**\n * The source element under a resting view's top (#857): its item's — or,\n * over an unloaded band, the element the band draws at that depth. A band is\n * a place in one run, never an item: a remount's bands cover other elements,\n * so what persists for one is the element. Its rows are drawn at the ledger's\n * rate, so the depth maps to an element proportionally.\n */\nexport function elementUnder(it: SheetBodyItem, offset: number): number | null {\n    if (it.kind !== \"band\") return elementOf(it);\n    const { from, to, px } = it.band;\n    const n = to - from + 1;\n    return px > 0 ? from + Math.min(n - 1, Math.max(0, Math.floor((offset / px) * n))) : from;\n}\n\n/**\n * Where a persisted anchor whose item is gone lands (#857). On a paged sheet,\n * its element is the place: the first item at or past it — the band of a\n * failed window that holds it — because an index names a place only in the\n * run it was taken from. Otherwise its index, clamped to the body.\n */\nexport function placeOf(body: readonly SheetBodyItem[], index: number, element: number | undefined): number {\n    if (element !== undefined) {\n        const at = body.findIndex((it) => (it.kind === \"failed\" ? it.failure.to : elementOf(it) ?? -1) >= element);\n        if (at >= 0) return at;\n    }\n    return Math.min(index, body.length - 1);\n}\n\n/**\n * A row-space place's identity (#854): a row's or a group's id, a group's\n * blank line's (it names its group) — or, for a padding row, its place among\n * the padding: padding rows are alike, and their ids name positions that a\n * row inserted above moves (#877).\n */\nexport type RowSlot = { id: string } | { blank: number };\n\n/** The identity of a row-space item. */\nexport function slotOf(it: SheetBodyItem): RowSlot | undefined {\n    if (it.kind === \"real\" || it.kind === \"group\") return { id: it.row.id };\n    if (it.kind === \"blank\") return it.group !== undefined ? { id: blankIdOf(it) } : { blank: it.blankIndex };\n    return undefined;\n}\n\n/** Where each row-space place of `before` sits in `after` (#854) — `null` for a row that left (#877), `undefined` where `before` held nothing. */\nexport function followRows(before: readonly (RowSlot | undefined)[], after: readonly (RowSlot | undefined)[]): (r: number) => number | null | undefined {\n    const byId = new Map<string, number>();\n    const byBlank = new Map<number, number>();\n    after.forEach((slot, r) => {\n        if (slot === undefined) return;\n        if (\"id\" in slot) { if (!byId.has(slot.id)) byId.set(slot.id, r); }\n        else if (!byBlank.has(slot.blank)) byBlank.set(slot.blank, r);\n    });\n    return (r) => {\n        const slot = before[r];\n        if (slot === undefined) return undefined;\n        return (\"id\" in slot ? byId.get(slot.id) : byBlank.get(slot.blank)) ?? null;\n    };\n}\n\n/** What is open in a body: each group unfolded, each line whose sub rows show. */\nexport function openKeysOf(body: readonly SheetBodyItem[]): Set<string> {\n    const out = new Set<string>();\n    for (const it of body) {\n        if (it.kind === \"group\" && !it.folded) out.add(`group:${it.row.id}`);\n        else if (it.kind === \"subRow\") out.add(`line:${it.lineId}`);\n    }\n    return out;\n}\n\n/** The source position a row-space item stands at — a row's, a group's band, a blank's the place it would take; `undefined` off the row space. */\nexport function rowPositionOf(it: SheetBodyItem): number | undefined {\n    return it.kind === \"real\" || it.kind === \"group\" || it.kind === \"blank\" ? it.position : undefined;\n}\n\n/**\n * A body item's place among the grid's rows (#860), counting the header as\n * the first: on a flat sheet a row's source position (a band or a failed\n * window where its first element would be; a proposal has no place of its\n * own), so the count and every index describe the whole source; on a\n * grouped sheet, the body's order — an unloaded run is one row, the Plan's\n * rule (#819).\n */\nexport function ariaRowIndexOf(it: SheetBodyItem, i: number, grouped: boolean): number | undefined {\n    if (grouped) return i + 2;\n    switch (it.kind) {\n        case \"real\": case \"blank\": return it.position + 2;\n        case \"band\": return it.band.from + 2;\n        case \"failed\": return it.failure.from + 2;\n        default: return undefined;\n    }\n}\n\n/** The body index of an anchor — a real row (or a group's band) by id, a blank row or blank line by its synthetic id. */\nexport function anchorBodyIndex(body: readonly SheetBodyItem[], anchorId: string): number {\n    if (!isBlankRowId(anchorId)) return bodyIndexOfId(body, anchorId);\n    return body.findIndex((it) => it.kind === \"blank\" && blankIdOf(it) === anchorId);\n}\n\n/** A row-space item's drop row, printed — what its drop cell's `CellRef` carries. */\nexport function dropText(item: SheetBodyItem): string | undefined {\n    const row = dropRowOf(item);\n    return row === undefined ? undefined : printDropRow(row);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The body the grid walks — the rows, bands, sub rows, blanks and proposals in order — and its row space, with what a\n * transition asks of a place in it: the item, the column, the cell and the member at a row and column, and the contexts a\n * provider, a check and a parse are given there.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { StringType, equalFor, none, some } from \"@elaraai/east\";\nimport { NEW_LINE_KEY, NULL_CELL, blankIdOf, buildBody, buildLensBody, cellWritable, driverKeyOf, isLooseRow, isRowSpace, lineRowsOf, resolveMember as resolveRegisterMember, segmentOf, withProposals, type LineGroup, type SheetBodyItem, type SheetColumnMeta } from \"./model.js\";\nimport { lensBodyItems } from \"./lens-layout.js\";\nimport type { CandidateContext } from \"./candidates.js\";\nimport type { ParseContext } from \"./parse/index.js\";\nimport { useSheetLinks } from \"./use-links.js\";\nimport { membershipAt } from \"./membership.js\";\nimport { namesMember } from \"./Rows.js\";\nimport type { SheetCellValue, SheetContextValue, SheetLinkValue, SheetRegisterMemberValue, SheetRowValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport { anchorBodyIndex } from \"./items.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * Lays out the body and answers what a row and a column hold (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @returns The body, the row space and what each place in it holds\n */\nexport function useSheetBody(sheetDecode: SheetDecode, sheetSession: SheetSession) {\n    const {\n        allColumns, blanks, columns, driver, driverColumn, group, loose, registers, titleMeta, today, words,\n    } = sheetDecode;\n    const {\n        editingState, exhausted, foldedOf, lens, lensDrawn, paging, rows, rowsOffset, runLayout, subRowsOpenOf, ui,\n    } = sheetSession;\n    // What an author's callbacks read the rows over (#1599): each drafted entry's draft and each one a Save landed\n    // that the rows have still to read — and, for a row those hold none of, the entry its window was read with (`shown`).\n    const { shown } = editingState;\n    const drafts = editingState.layerDrafts.drafts as Map<string, Uint8Array>;\n    // ── The body ──────────────────────────────────────────────────────────\n    // Under the lens, what it laid out over the record, the local layer applied\n    // to its rows (#1349); else the rows, the paged arm's bands, and the blanks.\n    const lensLayout = lensDrawn ? lens.layout : undefined;\n    const bodyBase = useMemo<SheetBodyItem[]>(() => {\n        const grouped = group !== undefined ? { foldedOf, subRowsOpen: subRowsOpenOf } : undefined;\n        if (lensLayout !== undefined) return buildLensBody(lensBodyItems(lensLayout, rows, runLayout.positions), grouped);\n        return buildBody({\n            rows, rowsOffset, positions: runLayout.positions, failures: runLayout.failures,\n            blanks: group !== undefined ? blanks : blanks + ui.appended, exhausted,\n            total: paging.total, head: paging.head, tail: paging.tail, grouped,\n        });\n    }, [lensLayout, rows, rowsOffset, runLayout, blanks, ui.appended, exhausted, paging.total, paging.head, paging.tail, group, foldedOf, subRowsOpenOf]);\n    // The copilot's proposed rows sit under their anchor, outside the row space.\n    const body = useMemo<SheetBodyItem[]>(() => {\n        const sugg = ui.sugg;\n        if (sugg === null || sugg.rows.length === 0) return bodyBase;\n        return withProposals(bodyBase, anchorBodyIndex(bodyBase, sugg.anchorId), sugg.rows);\n    }, [bodyBase, ui.sugg]);\n    // Row space — the body without its runs not read or failed, its sub rows and its proposals.\n    const rowSpace = useMemo(() => {\n        const bodyIndexOf: number[] = [];\n        const rowOf: number[] = new Array<number>(body.length).fill(-1);\n        body.forEach((it, i) => {\n            if (!isRowSpace(it)) return;\n            rowOf[i] = bodyIndexOf.length;\n            bodyIndexOf.push(i);\n        });\n        return { bodyIndexOf, rowOf };\n    }, [body]);\n    const rowCount = rowSpace.bodyIndexOf.length;\n    const colCount = columns.list.length;\n    // Under the lens (#1349): the stretches it has not read — or whose read failed — beyond the rows it draws, by the\n    // record's rows they stand for: the first of them and the last, and the nearest before its first row and past its\n    // last. A key that crosses an end goes into them through the lens's jump, as a paged sheet's goes through its\n    // pages' (#860, #1398, CL10) — never stopping at the rows read.\n    const lensEnds = useMemo(() => {\n        if (!lensDrawn) return undefined;\n        const unread = (it: SheetBodyItem | undefined): { from: number; to: number } | undefined => (it?.kind === \"band\" ? { from: it.band.from, to: it.band.to }\n            : it?.kind === \"failed\" ? { from: it.failure.from, to: it.failure.to } : undefined);\n        const firstRow = rowSpace.bodyIndexOf[0] ?? body.length;\n        const lastRow = rowSpace.bodyIndexOf[rowSpace.bodyIndexOf.length - 1] ?? -1;\n        let first: { from: number; to: number } | undefined;\n        let before: { from: number; to: number } | undefined;\n        for (let i = 0; i < firstRow; i++) {\n            const span = unread(body[i]);\n            if (span === undefined) continue;\n            first ??= span;\n            before = span;\n        }\n        let after: { from: number; to: number } | undefined;\n        let last: { from: number; to: number } | undefined;\n        for (let i = body.length - 1; i > lastRow; i--) {\n            const span = unread(body[i]);\n            if (span === undefined) continue;\n            last ??= span;\n            after = span;\n        }\n        return { first, before, after, last };\n    }, [lensDrawn, body, rowSpace]);\n    // Each body item's place in its group's rail, once per body (#858): a\n    // row is handed its own entry, which holds still until the body moves.\n    const memberships = useMemo(() => body.map((_it, i) => membershipAt(body, i)), [body]);\n    const rowAt = useCallback((r: number): SheetBodyItem | undefined => {\n        const bi = rowSpace.bodyIndexOf[r];\n        return bi === undefined ? undefined : body[bi];\n    }, [rowSpace, body]);\n    /** The meta of the cell at a row and column — a band's cell under the column (the title over the first columns), else the column's (#740). */\n    const metaAt = useCallback((r: number, c: number): SheetColumnMeta | undefined => {\n        const col = columns.list[c];\n        if (group === undefined) return col;\n        const it = rowAt(r);\n        if (it === undefined) return col;\n        if (it.kind === \"group\") return c < group.titleSpan ? titleMeta : col !== undefined ? group.cells.get(col.key) : undefined;\n        return col;\n    }, [columns, group, titleMeta, rowAt]);\n    const cellAt = useCallback((r: number, c: number): SheetCellValue | undefined => {\n        const it = rowAt(r);\n        const meta = metaAt(r, c);\n        if (it === undefined || meta === undefined) return undefined;\n        if (it.kind === \"real\" || it.kind === \"group\") return it.row.cells.get(meta.key);\n        return undefined;\n    }, [rowAt, metaAt]);\n    // The cells of a row-space row (a line's, a band's; a blank line's are empty), for a date column's level.\n    const cellsAt = useCallback((r: number): ReadonlyMap<string, SheetCellValue> => {\n        const it = rowAt(r);\n        return it !== undefined && (it.kind === \"real\" || it.kind === \"group\") ? it.row.cells : new Map();\n    }, [rowAt]);\n    /** A date column's level for a row (#844). */\n    const levelAt = useCallback((r: number, meta: SheetColumnMeta) => (meta.kind === \"date\" && meta.level !== undefined ? meta.level(cellsAt(r)) : undefined), [cellsAt]);\n    /** Whether the cell at a row and column takes an edit (#1560): the one check every gesture asks, so none misses a lock. */\n    const writableAt = useCallback((r: number, c: number): boolean => {\n        const meta = metaAt(r, c);\n        return meta !== undefined && cellWritable(meta, cellsAt(r));\n    }, [metaAt, cellsAt]);\n    /** The register member a cell holds the key of (#1536) — the one its label shows for, as the cell draws it. */\n    const memberAt = useCallback((r: number, c: number): SheetRegisterMemberValue | undefined => {\n        const meta = metaAt(r, c);\n        const cell = cellAt(r, c);\n        if (meta === undefined || !namesMember(meta) || cell?.type !== \"String\") return undefined;\n        const member = resolveRegisterMember(registers, meta.register, cell.value);\n        return member !== undefined && stringEqual(member.key, cell.value) ? member : undefined;\n    }, [metaAt, cellAt, registers]);\n    const rowOf = useCallback((id: string): number | undefined => {\n        const bi = anchorBodyIndex(body, id);\n        if (bi < 0) return undefined;\n        const r = rowSpace.rowOf[bi];\n        return r === undefined || r < 0 ? undefined : r;\n    }, [body, rowSpace]);\n    const idAt = useCallback((r: number): string | undefined => {\n        const it = rowAt(r);\n        if (it === undefined) return undefined;\n        switch (it.kind) {\n            case \"real\": case \"group\": return it.row.id;\n            case \"blank\": return blankIdOf(it);\n            default: return undefined;\n        }\n    }, [rowAt]);\n    /** The row-space index of a group's blank line (#740). */\n    const blankLineRowOf = useCallback((groupId: string): number | undefined => {\n        const r = rowSpace.bodyIndexOf.findIndex((bi) => { const it = body[bi]; return it !== undefined && it.kind === \"blank\" && it.group?.row.id === groupId; });\n        return r < 0 ? undefined : r;\n    }, [rowSpace, body]);\n\n    // ── What a transition may ask ─────────────────────────────────────────\n    // A column's options rule (#844) reads the row's wire context; the context builder is declared below, so it is reached through a ref.\n    const wireContextForRef = useRef<((r: number) => SheetContextValue) | undefined>(undefined);\n    // The loose rows between the groups (#846), in order: what a loose row's candidates rank against.\n    const looseRows = useMemo(() => (loose ? rows.filter(isLooseRow) : []), [loose, rows]);\n    // A line's candidates rank against ITS GROUP's lines (the row above is the line above); a loose row's, against the loose rows.\n    const candidateCtxFor = useCallback((r: number): CandidateContext => {\n        const allowed = (meta: SheetColumnMeta): ReadonlySet<string> | undefined => {\n            const rule = meta.options;\n            const wire = wireContextForRef.current;\n            if (rule === undefined || wire === undefined) return undefined;\n            try {\n                const keys = rule(wire(r));\n                return keys === undefined ? undefined : new Set(keys);\n            } catch (err) {\n                console.error(`[Sheet] options rule failed on column \"${meta.key}\":`, err);\n                return undefined;\n            }\n        };\n        const it = rowAt(r);\n        const lg = it !== undefined && (it.kind === \"real\" || it.kind === \"blank\") ? it.group : undefined;\n        if (lg !== undefined) return { registers, rows: lineRowsOf(lg.row), rowIndex: lg.index, driverColumn, allowed };\n        if (it !== undefined && it.kind === \"real\" && it.loose !== undefined) return { registers, rows: looseRows, rowIndex: it.loose, driverColumn, allowed };\n        return { registers, rows, rowIndex: it !== undefined && it.kind === \"real\" ? it.residentIndex : -1, driverColumn, allowed };\n    }, [rowAt, registers, rows, looseRows, driverColumn]);\n    /** The wire context over a row — the copilot's, a check's, a custom parse's (§4.4); a line's names its group and its key (#740). */\n    const wireContextOf = useCallback((row: SheetRowValue | undefined, residentIndex: number, position: number, rowsNow: SheetRowValue[], lg?: LineGroup): SheetContextValue => {\n        const driverKey = driverKeyOf(row, driverColumn);\n        // The rows an author sees are the contiguous run around this one: a\n        // failed window is never inside them, so `rowsOffset + index` stays\n        // each one's position — the bridge reads their entries by it (#853).\n        const segments = runLayout.segments;\n        const seg = segmentOf(segments, residentIndex);\n        const last = seg === segments[segments.length - 1];\n        return {\n            // Each row as the grid shows it: the bridge reads the source for none of them.\n            drafts: shown.over(rowsNow, segments, drafts),\n            rowIndex: BigInt(lg !== undefined ? lg.index : residentIndex - seg.start),\n            rowId: lg !== undefined ? lg.row.id : row?.id ?? \"\",\n            offset: BigInt(position),\n            line: lg !== undefined ? some(lg.key === \"\" ? NEW_LINE_KEY : lg.key) : none,\n            row: row?.cells ?? new Map(allColumns.list.map((c) => [c.key, NULL_CELL])),\n            rows: rowsNow.slice(seg.start, last ? undefined : seg.end),\n            rowsOffset: BigInt(seg.position),\n            partial: !exhausted,\n            driver: driverKey !== undefined ? some(driverKey) : none,\n            today,\n        };\n    }, [driverColumn, allColumns, runLayout, exhausted, today, drafts, shown]);\n    // The position after the last row — where a blank row or an append lands.\n    const lastSegment = runLayout.segments[runLayout.segments.length - 1]!;\n    const endPosition = lastSegment.position + (lastSegment.end - lastSegment.start);\n    const wireContextFor = useCallback((r: number): SheetContextValue => {\n        const it = rowAt(r);\n        const row = it !== undefined && (it.kind === \"real\" || it.kind === \"group\") ? it.row : undefined;\n        const position = it !== undefined && (it.kind === \"real\" || it.kind === \"blank\" || it.kind === \"group\") ? it.position : endPosition;\n        const lg = it !== undefined && (it.kind === \"real\" || it.kind === \"blank\") ? it.group : undefined;\n        return wireContextOf(row, it !== undefined && (it.kind === \"real\" || it.kind === \"group\") ? it.residentIndex : rows.length, position, rows, lg);\n    }, [rowAt, rows, endPosition, wireContextOf]);\n    wireContextForRef.current = wireContextFor;\n    // The link editor predicts from the column's pending fill (B§4.5).\n    const predictedLink = useCallback((r: number, key: string): SheetLinkValue | undefined => {\n        const sugg = ui.sugg;\n        if (sugg === null || sugg.anchorId !== idAt(r)) return undefined;\n        const f = sugg.fill.get(key);\n        return f !== undefined && f.cell.type === \"Link\" ? f.cell.value : undefined;\n    }, [ui.sugg, idAt]);\n    // A link column's options rule narrows what a row is offered.\n    const allowedFor = useCallback((r: number, meta: SheetColumnMeta) => candidateCtxFor(r).allowed?.(meta), [candidateCtxFor]);\n    const links = useSheetLinks({ drafts, shown, columns, registers, driver, driverColumn, body, rowAt, predictedLink, allowedFor, words });\n    const { linkVocabularies, linkColumns, linkCellCtx, linkCtxFor } = links;\n    const parseCtxFor = useCallback((r: number, meta: SheetColumnMeta): ParseContext => {\n        let baseDate: Date | undefined;\n        if (meta.kind === \"date\" && meta.base !== undefined) {\n            const it = rowAt(r);\n            const b = it !== undefined && it.kind === \"real\" ? it.row.cells.get(meta.base) : undefined;\n            if (b !== undefined && b.type === \"DateTime\") baseDate = b.value;\n        }\n        return {\n            ...candidateCtxFor(r),\n            words,\n            today,\n            baseDate,\n            wireContext: meta.kind === \"custom\" ? wireContextFor(r) : undefined,\n            linkVocab: meta.kind === \"link\" || meta.kind === \"set\" ? linkVocabularies.get(meta.key) : undefined,\n        };\n    }, [rowAt, candidateCtxFor, words, today, wireContextFor, linkVocabularies]);\n    return {\n        allowedFor, blankLineRowOf, body, candidateCtxFor, cellAt, colCount, endPosition, idAt, lensEnds, lensLayout,\n        levelAt, linkCellCtx, linkColumns, linkCtxFor, linkVocabularies, memberAt, memberships, metaAt, parseCtxFor,\n        rowAt, rowCount, rowOf, rowSpace, wireContextFor, wireContextOf, writableAt,\n    };\n}\n\n/** What {@link useSheetBody} gives the parts after it. */\nexport type SheetBody = ReturnType<typeof useSheetBody>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * How a cell edits by its kind, where a host draws the grid (`Record - DX\n * Proposal.md` P2–P4, K2–K4). The cells that step in place: a cycle walks\n * its register's members in their order, a toggle and a boolean flip. A\n * click, Space or ⏎ takes the next state and ⇧ the one before; ⌫ sets a\n * cycle's first member and a toggle or a boolean off — or empties one a clear\n * empties, a column from data's (#1585); a key that is a member's label, key\n * or alias sets that member at once. They never open an editor. A title edits out of place:\n * a click, ⏎ or F2 opens it where the host edits it, never in the cell —\n * unless the host opens it nowhere, and then it edits in its cell as a text\n * does. The machine asks by the cell's kind, so the gesture is the shared\n * grid's, whatever draws it.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, variant } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { NULL_CELL, resolveTyped, type SheetColumnMeta, type SheetRegisterIndex } from \"./model.js\";\nimport type { SheetGridHost } from \"./parts.js\";\nimport type { SheetCellValue } from \"./values.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** A step: the next state, the one before, or the first — a cycle's first member, a toggle's or a boolean's off. */\nexport type SheetStep = 1 | -1 | \"first\";\n\n/**\n * Whether a column's cells step in place rather than open an editor.\n *\n * @param meta - The column\n * @returns Whether its cell is a cycle, a toggle or a boolean\n */\nexport function stepsInPlace(meta: SheetColumnMeta | undefined): boolean {\n    return meta?.kind === \"cycle\" || meta?.kind === \"toggle\" || meta?.kind === \"boolean\";\n}\n\n/**\n * Whether a column's cells edit out of place: the host opens them where it\n * edits them, and no editor, typing, paste or clear reaches them in the grid.\n * A host that opens nothing — a Record with no inspector — edits a title in\n * its cell, as a text.\n *\n * @param meta - The column\n * @param host - The host's grid; `undefined` for the Sheet's own\n * @returns Whether its cell is a title the host opens\n */\nexport function editsOutOfPlace(meta: SheetColumnMeta | undefined, host: Pick<SheetGridHost, \"onOpen\"> | undefined): boolean {\n    return meta?.kind === \"title\" && host?.onOpen !== undefined;\n}\n\n/**\n * A boolean's or a toggle's typed text as its state: a toggle's own words\n * first, then the words every checkbox reads.\n *\n * @param meta - The boolean or toggle column\n * @param text - What was typed\n * @returns The state, or `undefined` for text that names none\n */\nexport function booleanOf(meta: SheetColumnMeta, text: string): boolean | undefined {\n    const typed = text.trim().toLowerCase();\n    if (meta.states !== undefined) {\n        if (stringEqual(typed, meta.states.on.toLowerCase())) return true;\n        if (stringEqual(typed, meta.states.off.toLowerCase())) return false;\n    }\n    if ([\"true\", \"yes\", \"y\", \"1\", \"x\", \"on\"].some((word) => stringEqual(word, typed))) return true;\n    if ([\"false\", \"no\", \"n\", \"0\", \"off\"].some((word) => stringEqual(word, typed))) return false;\n    return undefined;\n}\n\n/**\n * A stepping cell's next state: a cycle's next member in the register's\n * order, round to the first — from no member, the first (the last going\n * back) — or its first; a toggle's or a boolean's other state, or its first:\n * off, or empty where a clear empties it.\n *\n * @param meta - The column\n * @param cell - The cell as it stands\n * @param registers - The registers\n * @param step - Which way, or the first\n * @returns The cell after the step; `undefined` for a column that does not step, or a step it does not take\n */\nexport function stepCell(meta: SheetColumnMeta | undefined, cell: SheetCellValue | undefined, registers: SheetRegisterIndex, step: SheetStep): SheetCellValue | undefined {\n    if (meta === undefined) return undefined;\n    switch (meta.kind) {\n        case \"cycle\": {\n            const members = registers.byName.get(meta.register ?? \"\") ?? [];\n            const n = members.length;\n            if (n === 0) return undefined;\n            if (step === \"first\") return variant(\"String\", members[0]!.key);\n            const at = cell?.type === \"String\" ? members.findIndex((m) => stringEqual(m.key, cell.value)) : -1;\n            const next = at < 0 ? (step > 0 ? 0 : n - 1) : (at + step + n) % n;\n            return variant(\"String\", members[next]!.key);\n        }\n        case \"toggle\":\n        case \"boolean\":\n            // ⌫ (#1585): off, as a cycle goes back to its first — empty where a clear empties it, a column from data's\n            // whose clear removes its entry; a Boolean field is never empty.\n            if (step === \"first\") return getSomeorUndefined(meta.raw.from)?.clears === true ? NULL_CELL : variant(\"Boolean\", false);\n            return variant(\"Boolean\", !(cell?.type === \"Boolean\" && cell.value));\n        default:\n            return undefined;\n    }\n}\n\n/**\n * The cell a key sets on a stepping cell (K4): on a cycle, the member the\n * key names — by its key or an alias, else by its label, as every register\n * column is typed; nothing on a toggle or a boolean.\n *\n * @param meta - The column\n * @param key - The key pressed\n * @param registers - The registers\n * @returns The cell, or `undefined` where the key names no member\n */\nexport function keyedCell(meta: SheetColumnMeta | undefined, key: string, registers: SheetRegisterIndex): SheetCellValue | undefined {\n    if (meta?.kind !== \"cycle\" || key.trim() === \"\") return undefined;\n    const member = resolveTyped(registers, meta.register, key);\n    return member === undefined ? undefined : variant(\"String\", member.key);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Parse / print dispatch by column kind (`Sheet Spec.md` §6): typed text to\n * a wire cell, and a cell back to its edit form. A custom kind calls the\n * factory's compiled East pair; the register kinds resolve through the\n * scored candidates — a member named whole by its key, an alias or its label,\n * else the top candidate — and keep the typed text where nothing matches; a\n * closed register's non-match (an enum's, a person's, a cycle's) remains\n * invalid. A register member opens for editing in the words its cell shows.\n *\n * @packageDocumentation\n */\n\nimport { variant } from \"@elaraai/east\";\nimport type { Formatters } from \"@elaraai/east-ui-components\";\nimport { parseDate, formatWhenEdit, type WhenLevel } from \"./date.js\";\nimport { parseQuantity, formatNumberBare } from \"./quantity.js\";\nimport { candidateFor, type CandidateContext } from \"../candidates.js\";\nimport { cellText, memberLabel, printLinkText, type SheetColumnMeta } from \"../model.js\";\nimport { parseLinkText, type LinkVocabulary } from \"../link/grammar.js\";\nimport { booleanOf } from \"../steps.js\";\nimport type { SheetCellValue, SheetContextValue, SheetLinkValue, SheetRegisterMemberValue } from \"../values.js\";\n\n/** The outcome of parsing an editor buffer. */\nexport type ParseOutcome =\n    /** An empty buffer — the blank cell. */\n    | { kind: \"blank\" }\n    /** A recognised value. */\n    | { kind: \"cell\"; cell: SheetCellValue }\n    /** Unrecognised — retained as invalid draft text at the gesture boundary. */\n    | { kind: \"unrecognised\" };\n\n/** What a parse may need beside the text and the column. */\nexport interface ParseContext extends CandidateContext {\n    /** The viewer's formatters — a number reads with their separators, as the cells print (#852). */\n    words: Formatters;\n    /** Today, UTC midnight. */\n    today: Date;\n    /** The base column's date for a date column with `base`, when the row holds one. */\n    baseDate?: Date | undefined;\n    /** The wire copilot context for a custom kind's `parse`. */\n    wireContext?: SheetContextValue | undefined;\n    /** A link / set column's vocabulary — the grammar resolves against it. */\n    linkVocab?: LinkVocabulary | undefined;\n}\n\n/** A cell of one arm — built through `variant()`, so it carries the brand the encoder needs. */\nexport function cellOf(tag: \"Null\", value: null): SheetCellValue;\nexport function cellOf(tag: \"Boolean\", value: boolean): SheetCellValue;\nexport function cellOf(tag: \"String\", value: string): SheetCellValue;\nexport function cellOf(tag: \"Float\", value: number): SheetCellValue;\nexport function cellOf(tag: \"Integer\", value: bigint): SheetCellValue;\nexport function cellOf(tag: \"DateTime\", value: Date): SheetCellValue;\nexport function cellOf(tag: \"Link\", value: SheetLinkValue): SheetCellValue;\nexport function cellOf(tag: string, value: unknown): SheetCellValue {\n    return variant(tag, value) as SheetCellValue;\n}\n\n/** Parse the editor buffer for a column. */\nexport function parseCell(meta: SheetColumnMeta, text: string, ctx: ParseContext): ParseOutcome {\n    const trimmed = text.trim();\n    switch (meta.kind) {\n        case \"text\":\n        case \"stamped\":\n        case \"title\":\n            return trimmed === \"\" ? { kind: \"blank\" } : { kind: \"cell\", cell: cellOf(\"String\", text) };\n        case \"date\": {\n            const d = parseDate(text, { today: ctx.today, base: ctx.baseDate });\n            if (d === undefined) return { kind: \"blank\" };\n            if (d === null) return { kind: \"unrecognised\" };\n            return { kind: \"cell\", cell: cellOf(\"DateTime\", d) };\n        }\n        case \"quantity\": {\n            const n = parseQuantity(text, ctx.words.separators);\n            if (n === undefined) return { kind: \"blank\" };\n            if (n === null) return { kind: \"unrecognised\" };\n            return { kind: \"cell\", cell: cellOf(\"Float\", n) };\n        }\n        case \"integer\": {\n            const n = parseQuantity(text, ctx.words.separators);\n            if (n === undefined) return { kind: \"blank\" };\n            if (n === null || !Number.isSafeInteger(n)) return { kind: \"unrecognised\" };\n            return { kind: \"cell\", cell: cellOf(\"Integer\", BigInt(n)) };\n        }\n        case \"lookup\":\n        case \"reference\": {\n            // An open register: the member the text names, else its best match, else the text as typed.\n            if (trimmed === \"\") return { kind: \"blank\" };\n            return { kind: \"cell\", cell: cellOf(\"String\", candidateFor(meta, text, ctx)?.key ?? trimmed) };\n        }\n        case \"enum\":\n        case \"person\":\n        case \"cycle\": {\n            // A closed register: the member the text names, else its best match; an unmatched text stays invalid draft text.\n            if (trimmed === \"\") return { kind: \"blank\" };\n            const pick = candidateFor(meta, text, ctx);\n            return pick === undefined ? { kind: \"unrecognised\" } : { kind: \"cell\", cell: cellOf(\"String\", pick.key) };\n        }\n        case \"toggle\":\n        case \"boolean\": {\n            if (trimmed === \"\") return { kind: \"blank\" };\n            const on = booleanOf(meta, trimmed);\n            return on === undefined ? { kind: \"unrecognised\" } : { kind: \"cell\", cell: cellOf(\"Boolean\", on) };\n        }\n        case \"set\":\n        case \"link\": {\n            if (trimmed === \"\") return { kind: \"blank\" };\n            // The grammar against the column's register; entry is never blocked —\n            // without a vocabulary the text is kept as a text member.\n            const link: SheetLinkValue = ctx.linkVocab !== undefined\n                ? parseLinkText(trimmed, ctx.linkVocab)\n                : { from: [], to: [variant(\"text\", trimmed)] };\n            if (meta.kind === \"set\" && link.from.length > 0) {\n                return { kind: \"cell\", cell: cellOf(\"Link\", { from: [], to: [...link.from, ...link.to] }) };\n            }\n            if (link.from.length === 0 && link.to.length === 0) return { kind: \"blank\" };\n            return { kind: \"cell\", cell: cellOf(\"Link\", link) };\n        }\n        case \"custom\": {\n            if (trimmed === \"\") return { kind: \"blank\" };\n            if (meta.customParse === undefined || ctx.wireContext === undefined) return { kind: \"unrecognised\" };\n            try {\n                const out = meta.customParse(text, ctx.wireContext);\n                if (out.type !== \"some\") return { kind: \"unrecognised\" };\n                return { kind: \"cell\", cell: out.value };\n            } catch (err) {\n                // Fail-open: a throwing parse reads as unrecognised, never a stuck editor.\n                console.error(`[Sheet] custom parse failed on column \"${meta.key}\":`, err);\n                return { kind: \"unrecognised\" };\n            }\n        }\n    }\n    return { kind: \"unrecognised\" };\n}\n\n/**\n * A cell's EDIT form — what the editor opens with: a register member in the\n * words its cell shows, its label (#1536); dates `17/11/26`, numbers bare\n * with the viewer's decimal separator (`1234,5` in German — the grammar reads\n * it back, #852); a date at the time level, or one carrying a time of day,\n * keeps it (`17/11/26 19:00`).\n *\n * @param cell - The cell\n * @param meta - Its column\n * @param words - The viewer's formatters\n * @param level - A date column's level for the row\n * @param member - The register member the cell holds the key of, where it holds one\n * @returns The text\n */\nexport function editText(cell: SheetCellValue | undefined, meta: SheetColumnMeta, words: Formatters, level?: WhenLevel, member?: SheetRegisterMemberValue): string {\n    if (cell === undefined || cell.type === \"Null\") return \"\";\n    switch (cell.type) {\n        case \"DateTime\": return formatWhenEdit(cell.value, level);\n        case \"Float\": return formatNumberBare(cell.value, words);\n        case \"Integer\": return String(cell.value);\n        case \"Invalid\": return cell.value;\n        case \"String\": return member !== undefined && member.label !== \"\" ? member.label : cell.value;\n        case \"Boolean\": return cellText(cell, meta, words);\n        case \"Link\": return printLinkText(cell.value);\n    }\n    return cellText(cell, meta, words);\n}\n\n/** The labels of a link's members, for the clipboard's two-column form. */\nexport function linkHalvesText(link: SheetLinkValue): [string, string] {\n    return [link.from.map(memberLabel).join(\", \"), link.to.map(memberLabel).join(\", \")];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the state machine may ask of the sheet as it stands (`SheetMachineCtx`), its dispatch, and what it hears of the\n * sheet moving under it: the rows changing, the narrowing changing, the view the sheet opens on, and the folds it keeps.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, type RefObject } from \"react\";\nimport { fromEastTypeValue } from \"@elaraai/east\";\nimport type { RowsViewport } from \"@elaraai/east-ui-components/internal\";\nimport { TITLE_KEY, driverKeyOf, isLooseRow, isRowSpace, lineId } from \"./model.js\";\nimport { clearNarrowing, narrowingEqual } from \"./view-state.js\";\nimport { sameFolds } from \"./persisted.js\";\nimport { candidateAt, candidateList } from \"./candidates.js\";\nimport { editText, parseCell } from \"./parse/index.js\";\nimport type { SheetEvent, SheetMachineCtx } from \"./sheet-state.js\";\nimport { editsOutOfPlace, keyedCell, stepCell, stepsInPlace } from \"./steps.js\";\nimport type { SheetSavedView, SheetNarrowing, SheetRootValue, SheetRowValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport { followRows, type RowSlot, slotOf } from \"./items.js\";\n\n/**\n * The machine's East values, by their types' names: a value's inferred type carries East's variant brand, which the\n * declaration build cannot name (TS4058).\n */\ninterface SheetMachineValues {\n    readonly emptyNarrowing: SheetNarrowing | undefined;\n    readonly expectedNarrowing: RefObject<SheetNarrowing | undefined>;\n    readonly seenRows: RefObject<{ source: readonly SheetRowValue[]; slots: (RowSlot | undefined)[] }>;\n}\n\n/**\n * Builds the machine's view of the sheet and follows the sheet as it moves (see the module docs).\n *\n * @param value - The Sheet root value\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @returns The machine's context, its dispatch and the refs it is read through\n */\nexport function useSheetMachine(value: SheetRootValue, sheetDecode: SheetDecode, sheetSession: SheetSession,\n    sheetBody: SheetBody) {\n    const {\n        activeView, canInsertRows, columns, declaredNoun, driverColumn, group, hostGrid, narrowing, pagedSource,\n        registers, rowPx, views, viewsRef, words,\n    } = sheetDecode;\n    const {\n        canEdit, dispatchStore, editingState, exhausted, lens, lensDrawn, paging, persist, persistedRef, restored, rows,\n        sourceRows, ui,\n    } = sheetSession;\n    const {\n        body, candidateCtxFor, cellAt, colCount, idAt, lensEnds, levelAt, linkCtxFor, memberAt, metaAt, parseCtxFor,\n        rowAt, rowCount, rowOf, rowSpace, writableAt,\n    } = sheetBody;\n    // The whole-sheet narrowing, and whether the active tab has drifted from its view (B§8).\n    const emptyNarrowing = useMemo(() => (narrowing !== undefined ? clearNarrowing(narrowing) : undefined), [narrowing]);\n    const activeViewValue = useMemo(() => (ui.tabs.active === null ? undefined : views.find((v) => v.id === ui.tabs.active)), [views, ui.tabs.active]);\n    const dirty = activeViewValue !== undefined && narrowing !== undefined && !narrowingEqual(activeViewValue.narrowing, narrowing);\n\n    // What moves a page (#860): the rows the frame shows — less one, so a\n    // page keeps a row of context. Unmeasured (a frame not laid out), the\n    // machine's default. The frame is the one the rows report (`viewport`,\n    // kept in `use-scroll.tsx`), read when the key comes.\n    const viewportRef = useRef<RowsViewport | null>(null);\n    const pageRows = useCallback((): number => {\n        const frame = viewportRef.current;\n        const px = frame === null ? 0 : frame.frame.clientHeight;\n        return px > 0 ? Math.max(1, Math.floor(px / rowPx) - 1) : 10;\n    }, [rowPx]);\n    const pagedHead = paging.head;\n    const pagedTail = paging.tail;\n    const jumpToElement = paging.jumpToElement;\n    // The jump in charge of the rows drawn: the lens's under the lens (#1349), else the pages'.\n    const lensJumpTo = lens.jumpToElement;\n    const lensClearJump = lens.clearJump;\n    const jumpTo = lensDrawn ? lensJumpTo : jumpToElement;\n    const clearJump = lensDrawn ? lensClearJump : paging.clearJump;\n    const ctx = useMemo<SheetMachineCtx>(() => ({\n        rowCount,\n        colCount,\n        lensActive: lensDrawn,\n        grouped: group !== undefined,\n        // Group insertion uses explicit controls; keyboard padding is flat-only. A host's grid draws no padding and adds\n        // rows its own way (the Record's Add): ↓ on its last row stays there.\n        canAppend: exhausted && canInsertRows && editingState.available && group === undefined && hostGrid === undefined,\n        // A paged sheet's ends (#860): an unloaded run past the row space is a band — under the lens, a stretch it has not\n        // read past the rows it draws (#1349).\n        edges: pagedSource === undefined ? undefined\n            : lensEnds !== undefined ? { atStart: lensEnds.before === undefined, atEnd: lensEnds.after === undefined }\n                : { atStart: pagedHead === undefined, atEnd: pagedTail === undefined },\n        pageRows,\n        editableAt: (r, c) => {\n            if (!canEdit || !editingState.available) return false;\n            const it = rowAt(r);\n            if (it === undefined || !isRowSpace(it)) return false;\n            const meta = metaAt(r, c);\n            if (meta === undefined) return false;\n            if (it.kind === \"blank\" && !canInsertRows) return false;\n            // An action column is written by its actions alone (T7): typed into, pasted over and cleared never. A locked\n            // cell takes no gesture at all (#1560).\n            if (!writableAt(r, c) || meta.kind === \"stamped\" || meta.kind === \"action\") return false;\n            // A cell that steps in place is a control, as an action cell is (#1531): an owned row's takes no step (T9).\n            if (hostGrid !== undefined && stepsInPlace(meta) && (it.kind === \"real\" || it.kind === \"group\") && it.row.owned) return false;\n            return true;\n        },\n        kindAt: (r, c) => metaAt(r, c)?.kind ?? \"text\",\n        // A host's grid (#1531): its cycles, toggles and booleans step in place, its titles open where the host edits\n        // them — in their cells, for a host that opens them nowhere — and its strip shows the cell under the pointer.\n        stepAt: hostGrid === undefined ? undefined : (r, c, step) => stepCell(metaAt(r, c), cellAt(r, c), registers, step),\n        stepsAt: hostGrid === undefined ? undefined : (r, c) => stepsInPlace(metaAt(r, c)),\n        keyAt: hostGrid === undefined ? undefined : (r, c, key) => keyedCell(metaAt(r, c), key, registers),\n        opensAt: hostGrid === undefined ? undefined : (r, c) => editsOutOfPlace(metaAt(r, c), hostGrid),\n        previewsHover: hostGrid !== undefined,\n        parse: (r, c, text) => {\n            const meta = metaAt(r, c);\n            if (meta === undefined) return { kind: \"unrecognised\" };\n            return parseCell(meta, text, parseCtxFor(r, meta));\n        },\n        candidates: (r, c, text) => {\n            const meta = metaAt(r, c);\n            return meta === undefined ? [] : candidateList(meta, text, candidateCtxFor(r));\n        },\n        candidateAt: (r, c, text, hi) => {\n            const meta = metaAt(r, c);\n            return meta === undefined ? undefined : candidateAt(meta, text, hi, candidateCtxFor(r));\n        },\n        editTextAt: (r, c) => {\n            const meta = metaAt(r, c);\n            return meta === undefined ? \"\" : editText(cellAt(r, c), meta, words, levelAt(r, meta), memberAt(r, c));\n        },\n        memberAt: (r, c) => memberAt(r, c)?.key,\n        // A band's cells are never link cells, whatever column they sit under.\n        linkAt: (r, c) => { const k = rowAt(r)?.kind; return k === \"group\" ? undefined : linkCtxFor(r, c); },\n        rowOf,\n        idAt,\n        columnOf: (key) => { const c = columns.list.findIndex((m) => m.key === key); return c < 0 ? undefined : c; },\n        driverKeyAt: (r) => { const it = rowAt(r); return driverKeyOf(it !== undefined && it.kind === \"real\" ? it.row : undefined, driverColumn); },\n        driverColumn,\n        numberAt: (r) => {\n            const it = rowAt(r);\n            if (it === undefined || !isRowSpace(it)) return r + 1;\n            if ((it.kind === \"real\" || it.kind === \"blank\") && it.group !== undefined) return it.group.number;\n            return it.kind === \"real\" || it.kind === \"blank\" ? it.position + 1 : r + 1;\n        },\n        // A row as the messages name it — worded when they show (#861).\n        rowRefAt: (r) => {\n            const it = rowAt(r);\n            const lg = it !== undefined && (it.kind === \"real\" || it.kind === \"blank\") ? it.group : undefined;\n            if (lg === undefined) return { line: false, number: it !== undefined && (it.kind === \"real\" || it.kind === \"blank\") ? it.position + 1 : r + 1 };\n            const title = lg.row.cells.get(TITLE_KEY);\n            return { line: true, number: lg.number, title: title !== undefined && title.type === \"String\" && title.value !== \"\" ? title.value : undefined, noun: declaredNoun?.singular };\n        },\n        viewName: (seq) => words.m.viewName({ seq: String(seq) }),\n        views,\n        narrowing,\n        emptyNarrowing,\n        dirty,\n        rowKindAt: (r) => {\n            const it = rowAt(r);\n            if (it === undefined) return undefined;\n            switch (it.kind) {\n                case \"real\": return \"row\";\n                case \"blank\": return \"blank\";\n                case \"group\": return \"group\";\n                default: return undefined;\n            }\n        },\n        groupAt: (r) => {\n            const it = rowAt(r);\n            if (it === undefined || it.kind !== \"group\") return undefined;\n            let r0: number | undefined;\n            let r1: number | undefined;\n            for (let k = r + 1; k < rowCount; k++) {\n                const x = rowAt(k);\n                if (x === undefined || x.kind !== \"real\" || x.group?.row.id !== it.row.id) break;\n                r0 ??= k;\n                r1 = k;\n            }\n            return { id: it.row.id, folded: it.folded, lines: r0 !== undefined && r1 !== undefined ? { r0, r1 } : undefined };\n        },\n        spanAt: (r, c) => {\n            if (group === undefined) return undefined;\n            const k = rowAt(r)?.kind;\n            return k === \"group\" && c < group.titleSpan ? { c0: 0, c1: group.titleSpan - 1 } : undefined;\n        },\n        // Every group the sheet holds — under the lens, those it draws (#1349): what fold-all folds — never a loose row (#846).\n        groupIds: group !== undefined ? rows.filter((row) => !isLooseRow(row)).map((row) => row.id) : undefined,\n        looseAt: (r) => { const it = rowAt(r); return it !== undefined && it.kind === \"real\" && it.loose !== undefined; },\n        // The host's word only: a message words a missing one when it shows (#861).\n        groupNoun: declaredNoun,\n        // A line's sub rows: whether they show is read off the body.\n        lineSubRowsAt: (r) => {\n            const bi = rowSpace.bodyIndexOf[r];\n            const it = bi !== undefined ? body[bi] : undefined;\n            if (it === undefined || it.kind !== \"real\" || it.group === undefined) return undefined;\n            const g = it.group.row;\n            const count = g.lines[it.group.index]?.subRows.length ?? 0;\n            if (count === 0) return undefined;\n            const next = body[bi! + 1];\n            return {\n                id: it.row.id, count,\n                open: next !== undefined && next.kind === \"subRow\" && next.lineId === it.row.id,\n                group: g.lines.filter((l) => l.subRows.length > 0).map((l) => lineId(g.id, l.key)),\n            };\n        },\n    }), [rowCount, colCount, lensDrawn, exhausted, canEdit, canInsertRows, editingState.available, group, declaredNoun, columns, rows, rowAt, metaAt, parseCtxFor, candidateCtxFor, cellAt, levelAt, memberAt, words, linkCtxFor, rowOf, idAt, driverColumn, views, narrowing, emptyNarrowing, dirty, rowSpace, body, pagedSource, pagedHead, pagedTail, lensEnds, pageRows, hostGrid, registers, writableAt]);\n    const ctxRef = useRef(ctx);\n    ctxRef.current = ctx;\n    const uiRef = useRef(ui);\n    uiRef.current = ui;\n    const dispatch = useCallback((e: SheetEvent) => dispatchStore({ t: \"event\", e, ctx: ctxRef.current }), [dispatchStore]);\n\n    // The columns the grid draws changed underneath — a phone's frame putting\n    // the column it pins first, or back in its place; a column hidden or\n    // shown: the ring, a range, the editor, the hover and the armed fill\n    // follow their COLUMNS, by their keys — an editor left at its index\n    // would write what was typed into the column now there. They follow\n    // before the rows are clamped below, which would otherwise drop an editor\n    // past the last column where its own column still stands.\n    const seenColumns = useRef(columns);\n    useEffect(() => {\n        const before = seenColumns.current;\n        seenColumns.current = columns;\n        if (before === columns) return;\n        const at = new Map(columns.list.map((m, c) => [m.key, c] as const));\n        if (before.list.length === columns.list.length && before.list.every((m, c) => at.get(m.key) === c)) return;\n        dispatch({ t: \"columns.changed\", moved: (c) => { const key = before.list[c]?.key; return key === undefined ? null : at.get(key) ?? null; } });\n    }, [columns, dispatch]);\n\n    // The rows changed underneath: clamp the ring, drop a suggestion whose\n    // anchor went. Source rows that moved under them — a window landing above\n    // the ring, a failed one landing after a Retry, a new revision, the\n    // host's write-back — shift the rows after: the ring, a range and an open\n    // editor follow their ROWS, not the indices they had (#854), and an\n    // editor whose row left closes (#877). Only a move of the SOURCE's rows\n    // is followed: the sheet's own writes put the ring where the new rows\n    // have it.\n    const rowSpaceSlots = useMemo(() => rowSpace.bodyIndexOf.map((bi) => slotOf(body[bi]!)), [rowSpace, body]);\n    const seenRows = useRef({ source: sourceRows, slots: rowSpaceSlots });\n    useEffect(() => {\n        const seen = seenRows.current;\n        seenRows.current = { source: sourceRows, slots: rowSpaceSlots };\n        const moved = seen.source !== sourceRows ? followRows(seen.slots, rowSpaceSlots) : undefined;\n        dispatch({ t: \"rows.changed\", moved });\n    }, [rows, rowCount, colCount, sourceRows, rowSpaceSlots, dispatch]);\n\n    // The slice's narrowing changed underneath the sheet (a keystroke in the\n    // search, a filter): the ring returns to the top — unless the sheet wrote\n    // that narrowing itself (a tab switch, a revert), which places the ring\n    // itself.\n    const expectedNarrowing = useRef<SheetSavedView[\"narrowing\"] | undefined>(undefined);\n    const seenNarrowing = useRef(narrowing);\n    useEffect(() => {\n        const prev = seenNarrowing.current;\n        seenNarrowing.current = narrowing;\n        if (narrowing === undefined || prev === undefined) return;\n        if (narrowingEqual(prev, narrowing)) return;\n        const expected = expectedNarrowing.current;\n        expectedNarrowing.current = undefined;\n        if (expected !== undefined && narrowingEqual(expected, narrowing)) return;\n        dispatch({ t: \"narrowing.changed\" });\n    }, [narrowing, dispatch]);\n\n    // A row's id is its key's `.east` text, but a String key's id is the String itself, which a seek takes quoted.\n    const keyIsText = useMemo(() => value.editing.keyType.type !== \"some\" || fromEastTypeValue(value.editing.keyType.value).type === \"String\", [value.editing.keyType]);\n\n    // The initial view opens on mount — with the folds the last session left\n    // on it, when it left them there (#857); a host that moves `activeView`\n    // later is followed.\n    const openedView = useRef<string | undefined>(undefined);\n    useEffect(() => {\n        if (activeView === undefined || activeView === openedView.current) return;\n        const first = openedView.current === undefined;\n        openedView.current = activeView;\n        if (!viewsRef.current.some((v) => v.id === activeView)) return;\n        const left = first && restored.view === activeView ? { folds: new Map(restored.folds) } : {};\n        dispatch({ t: \"tab.open\", id: activeView, ...left });\n    }, [activeView, dispatch, restored, viewsRef]);\n    // The folds persist with the tab they are on (#857).\n    useEffect(() => {\n        const p = persistedRef.current;\n        if (sameFolds(p, ui.tabs.active, ui.folds)) return;\n        persist({ ...p, view: ui.tabs.active, folds: [...ui.folds] });\n    }, [ui.folds, ui.tabs.active, persist, persistedRef]);\n    const named: SheetMachineValues = { emptyNarrowing, expectedNarrowing, seenRows };\n    return {\n        clearJump, ctx, ctxRef, dirty, dispatch, jumpTo, jumpToElement, keyIsText, lensJumpTo, rowSpaceSlots, uiRef,\n        viewportRef, ...named,\n    };\n}\n\n/** What {@link useSheetMachine} gives the parts after it. */\nexport type SheetMachine = ReturnType<typeof useSheetMachine>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Saving edits: a gesture's cell writes into the local layer as wire events — a row's commits, a new row, a group's lines —\n * its rows removed, and a proposed row inserted. The session records the events as one step once the gesture ends.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useRef, type RefObject } from \"react\";\nimport { equalFor, none, some, variant } from \"@elaraai/east\";\nimport { Sheet } from \"@elaraai/e3-ui/internal\";\nimport { NULL_CELL, bodyIndexOfId, cellIsBlank, isRowSpace, lineAddress, lineId, rowIsBlank, withLine, withoutLines, type SheetColumnMeta } from \"./model.js\";\nimport type { EditSource } from \"./sheet-state.js\";\nimport { SheetRefused } from \"./creation.js\";\nimport type { LocalLayer } from \"./use-editing.js\";\nimport type { SheetCellValue, SheetEditValue, SheetRowValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport { applyLayer, blankRow, mintLineKey, withCell } from \"./local-rows.js\";\n\nconst cellEqual = equalFor(Sheet.Types.Cell);\n\n/**\n * One cell write the component turns into a wire event; `extra` names the k-th\n * NEW row a write lands on past a group's blank line (a paste, #740 G9), or\n * past a loose row (#846 — a paste, a proposal). `key` names the write's\n * column in place of `c`, the grid's: a proposed row's cell under a column\n * the grid hides lands too (#1186).\n */\nexport interface CellWrite {\n    r: number;\n    c: number;\n    key?: string | undefined;\n    cell: SheetCellValue;\n    extra?: number | undefined;\n    /** Written though its column is not the viewer's to edit: a band cell an action's `updates` sets (#1477). */\n    force?: boolean | undefined;\n}\n\n/**\n * The writes' East values, by their types' names: a value's inferred type carries East's variant brand, which the\n * declaration build cannot name (TS4058).\n */\ninterface SheetWritesValues {\n    readonly gestureEvents: RefObject<SheetEditValue[]>;\n}\n\n/**\n * Writes a gesture's edits into the local layer, as the session's events (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @returns The writes, the removal and the proposals' inserts\n */\nexport function useSheetWrites(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody) {\n    const { allColumns, canInsertRows, capabilities, columns, group, keyOrder } = sheetDecode;\n    const { canEdit, dispatchStore, editingState, layerRef, mintAmong, setLayer, sourceRows, takenKeys } = sheetSession;\n    const { blankLineRowOf, body, metaAt, rowAt, rowCount, rowSpace } = sheetBody;\n    // ── Writes — the local layer, then the host ───────────────────────────\n    const gestureEvents = useRef<SheetEditValue[]>([]);\n    const emitEdit = useCallback((edit: SheetEditValue) => { gestureEvents.current.push(edit); }, []);\n    /** A gesture that failed: one the sheet refuses says why in the footer, in its words (#1536); anything else is logged, and says its own. */\n    const failed = useCallback((error: unknown) => {\n        if (error instanceof SheetRefused) {\n            dispatchStore({ t: \"patch\", patch: { msg: error.notice } });\n            return;\n        }\n        console.error(\"Sheet transaction failure\", error);\n        dispatchStore({ t: \"patch\", patch: { msg: { id: \"text\", text: error instanceof Error ? error.message : String(error) } } });\n    }, [dispatchStore]);\n    /**\n     * Write cells: a real row's commits land in the layer's edits (one\n     * `commit` event per changed cell, each carrying the row AFTER it); a\n     * blank row's cells become one inserted row (one `insert` event), and so\n     * do the k-th rows past a loose row (#846), each placed after the one\n     * before. Returns the row-space index the FIRST inserted row landed on, so\n     * the ring can follow a blank row that just became real, and the ids of\n     * the rows written, in order. A new row whose key is refused (#1536)\n     * refuses the whole write: nothing is written, the footer says why, and\n     * `refused` says so.\n     */\n    const writeCells = useCallback((writes: readonly CellWrite[], source: EditSource): { firstInserted: number | undefined; ids: string[]; refused?: boolean } => {\n        if (!canEdit || !editingState.available) return { firstInserted: undefined, ids: [] };\n        // Writes group by row, and by the extra new line they land on past a group's blank line.\n        const byRow = new Map<string, { r: number; extra: number; list: CellWrite[] }>();\n        for (const w of writes) {\n            const extra = w.extra ?? 0;\n            const k = `${w.r}#${extra}`;\n            const entry = byRow.get(k) ?? { r: w.r, extra, list: [] };\n            entry.list.push(w);\n            byRow.set(k, entry);\n        }\n        // A write's column: the one it names, hidden or not, else the grid's at its index.\n        const metaOf = (w: CellWrite): SheetColumnMeta | undefined => (w.key !== undefined ? allColumns.byKey.get(w.key) : columns.list[w.c]);\n        const base = layerRef.current;\n        const rowsNow = applyLayer(sourceRows, base, keyOrder);\n        const edits = new Map(base.edits);\n        const appended = [...base.appended];\n        const events: SheetEditValue[] = [];\n        const ids: string[] = [];\n        let lastId = rowsNow.length > 0 ? rowsNow[rowsNow.length - 1]!.id : undefined;\n        let firstInserted: number | undefined;\n        let inserted = 0;\n        const src = variant(source, null);\n        // The keys a new row's must not be (#1536) — one set per write, grown as\n        // its rows are minted, never a scan of the rows per new row (#859).\n        const takenIds = takenKeys();\n        for (const x of rowsNow) takenIds.add(x.id);\n        for (const x of appended) takenIds.add(x.id);\n        // The last new loose row placed after each loose row (#846): the next lands after it.\n        const chained = new Map<string, string>();\n        // A group's latest row through the layer (#740), and how a rewritten group lands back in it.\n        const currentGroup = (g: SheetRowValue): SheetRowValue => edits.get(g.id) ?? appended.find((x) => x.id === g.id) ?? g;\n        const setGroup = (g: SheetRowValue) => {\n            const at = appended.findIndex((x) => x.id === g.id);\n            if (at >= 0) appended[at] = g;\n            else edits.set(g.id, g);\n        };\n        const entries = [...byRow.values()].sort((a, b) => a.r - b.r || a.extra - b.extra);\n        try {\n            for (const { r, extra, list } of entries) {\n                const it = rowAt(r);\n                if (group !== undefined && it !== undefined) {\n                    // A line: its cells change inside its group; each changed cell commits the group after it.\n                    if (it.kind === \"real\" && it.group !== undefined) {\n                        const lg = it.group;\n                        let g = currentGroup(lg.row);\n                        const line = g.lines.find((l) => l.key === lg.key);\n                        const cells = new Map(line?.cells ?? it.row.cells);\n                        let changed = false;\n                        for (const w of list) {\n                            const meta = metaOf(w);\n                            if (meta === undefined) continue;\n                            if (cellEqual(cells.get(meta.key) ?? NULL_CELL, w.cell)) continue;\n                            cells.set(meta.key, w.cell);\n                            changed = true;\n                            g = withLine(g, lg.key, new Map(cells));\n                            events.push(variant(\"lineCommit\", { rowId: g.id, offset: BigInt(it.position), line: lineAddress(lg.index), key: meta.key, row: g, source: src }));\n                        }\n                        if (changed) setGroup(g);\n                        ids.push(it.row.id);\n                        continue;\n                    }\n                    // A group's blank line (or the k-th line past it): one line inserted at the end of the group.\n                    if (it.kind === \"blank\" && it.group !== undefined) {\n                        if (!canInsertRows) continue;\n                        const g0 = currentGroup(it.group.row);\n                        const cells = new Map<string, SheetCellValue>(allColumns.list.map((c) => [c.key, NULL_CELL]));\n                        for (const w of list) {\n                            const meta = metaOf(w);\n                            if (meta !== undefined) cells.set(meta.key, w.cell);\n                        }\n                        if (allColumns.list.every((c) => cellIsBlank(cells.get(c.key)))) continue;\n                        const key = mintLineKey(g0);\n                        const index = g0.lines.length;\n                        const last = g0.lines[index - 1];\n                        const g: SheetRowValue = { ...g0, lines: [...g0.lines, { key, cells, subRows: [] }] };\n                        events.push(variant(\"lineInsert\", {\n                            rowId: g.id, offset: BigInt(it.position),\n                            after: last !== undefined ? some(lineAddress(index - 1)) : none,\n                            line: lineAddress(index), row: g, source: src,\n                        }));\n                        setGroup(g);\n                        ids.push(lineId(g.id, key));\n                        if (firstInserted === undefined) firstInserted = r + extra;\n                        continue;\n                    }\n                    // Past a loose row (#846) — a paste's rows beyond the run, a\n                    // proposal under it: the k-th new loose row, after the one before.\n                    if (it.kind === \"real\" && it.loose !== undefined && extra > 0) {\n                        if (!canInsertRows) continue;\n                        let row = blankRow(\"\", allColumns.list);\n                        for (const w of list) {\n                            const meta = metaOf(w);\n                            if (meta !== undefined) row = withCell(row, meta.key, w.cell);\n                        }\n                        if (allColumns.list.every((c) => cellIsBlank(row.cells.get(c.key)))) continue;\n                        row = { ...row, id: mintAmong(takenIds) };\n                        const after = chained.get(it.row.id) ?? it.row.id;\n                        appended.push(row);\n                        events.push(variant(\"insert\", { afterRowId: some(after), row, source: src }));\n                        chained.set(it.row.id, row.id);\n                        ids.push(row.id);\n                        if (firstInserted === undefined) firstInserted = r + extra;\n                        continue;\n                    }\n                    // A band cell: the group's own field commits.\n                    if (it.kind === \"group\") {\n                        const g0 = currentGroup(it.row);\n                        let g = g0;\n                        for (const w of list) {\n                            const meta = w.key !== undefined ? group.cells.get(w.key) : metaAt(r, w.c);\n                            if (meta === undefined || (!meta.editable && w.force !== true)) continue;\n                            if (cellEqual(g.cells.get(meta.key) ?? NULL_CELL, w.cell)) continue;\n                            const cells = new Map(g.cells);\n                            cells.set(meta.key, w.cell);\n                            g = { ...g, cells };\n                            events.push(variant(\"commit\", { rowId: g.id, offset: BigInt(it.position), key: meta.key, row: g, source: src }));\n                        }\n                        if (!Object.is(g, g0)) setGroup(g);\n                        ids.push(g.id);\n                        continue;\n                    }\n                }\n                if (it !== undefined && it.kind === \"real\") {\n                    let row = edits.get(it.row.id) ?? it.row;\n                    for (const w of list) {\n                        const meta = metaOf(w);\n                        if (meta === undefined) continue;\n                        if (cellEqual(row.cells.get(meta.key) ?? NULL_CELL, w.cell)) continue;\n                        row = withCell(row, meta.key, w.cell);\n                        events.push(variant(\"commit\", { rowId: row.id, offset: BigInt(it.position), key: meta.key, row, source: src }));\n                    }\n                    if (!Object.is(row, it.row)) edits.set(row.id, row);\n                    ids.push(row.id);\n                    continue;\n                }\n                if (it !== undefined && !isRowSpace(it)) continue;\n                if (group !== undefined || !canInsertRows) continue;\n                // A blank row (or a row past the padding): one inserted row, keyed once it holds a value.\n                let row = blankRow(\"\", allColumns.list);\n                for (const w of list) {\n                    const meta = metaOf(w);\n                    if (meta !== undefined) row = withCell(row, meta.key, w.cell);\n                }\n                if (allColumns.list.every((c) => cellIsBlank(row.cells.get(c.key)))) continue;\n                row = { ...row, id: mintAmong(takenIds) };\n                appended.push(row);\n                events.push(variant(\"insert\", { afterRowId: lastId !== undefined ? some(lastId) : none, row, source: src }));\n                lastId = row.id;\n                ids.push(row.id);\n                if (firstInserted === undefined) firstInserted = rowsNow.length + inserted;\n                inserted += 1;\n            }\n        } catch (error) {\n            // A new row's key refused (#1536): nothing is written — the layer, the rows and the events are this write's own until it ends.\n            if (!(error instanceof SheetRefused)) throw error;\n            failed(error);\n            return { firstInserted: undefined, ids: [], refused: true };\n        }\n        if (events.length === 0) return { firstInserted: undefined, ids };\n        const next: LocalLayer = { edits, appended, removed: base.removed, placements: base.placements };\n        layerRef.current = next;\n        setLayer(() => next);\n        for (const e of events) emitEdit(e);\n        return { firstInserted, ids };\n    }, [sourceRows, rowAt, columns, allColumns, group, metaAt, takenKeys, mintAmong, failed, setLayer, emitEdit, canEdit, canInsertRows, keyOrder, editingState.available, layerRef]);\n    /**\n     * Delete whole rows. On a grouped sheet (#740, G7) lines in the range\n     * leave their groups (`lineRemove`) and loose rows in it leave the sheet\n     * (#846, `remove`); with neither in the range, the empty groups whose\n     * bands are in it leave the sheet (`remove`) — the two-step ladder: the\n     * rows, then the group.\n     */\n    const deleteRows = useCallback((r0: number, r1: number): { n: number; what: \"rows\" | \"lines\" | \"groups\"; emptiedBandR: number | undefined } => {\n        if (!canEdit || !editingState.available) return { n: 0, what: \"rows\", emptiedBandR: undefined };\n        const base = layerRef.current;\n        if (group !== undefined) {\n            const currentGroup = (g: SheetRowValue): SheetRowValue => base.edits.get(g.id) ?? base.appended.find((x) => x.id === g.id) ?? g;\n            const byGroup = new Map<string, { row: SheetRowValue; position: number; keys: string[]; addresses: string[] }>();\n            const bands: { row: SheetRowValue }[] = [];\n            const looseIds: string[] = [];\n            // The row-space rows this step removes, to find where an emptied band lands once they have gone.\n            const removedRs: number[] = [];\n            for (let r = r0; r <= r1; r++) {\n                const it = rowAt(r);\n                if (it === undefined) continue;\n                if (it.kind === \"real\" && it.group !== undefined) {\n                    const entry = byGroup.get(it.group.row.id) ?? { row: it.group.row, position: it.position, keys: [], addresses: [] };\n                    entry.keys.push(it.group.key);\n                    entry.addresses.push(lineAddress(it.group.index));\n                    byGroup.set(it.group.row.id, entry);\n                    removedRs.push(r);\n                } else if (it.kind === \"real\" && it.loose !== undefined) {\n                    looseIds.push(it.row.id);\n                    removedRs.push(r);\n                } else if (it.kind === \"group\") {\n                    bands.push({ row: it.row });\n                }\n            }\n            if (byGroup.size > 0 || looseIds.length > 0) {\n                const what = looseIds.length === 0 ? \"lines\" : \"rows\";\n                if (!capabilities.removeRows) return { n: 0, what, emptiedBandR: undefined };\n                const edits = new Map(base.edits);\n                const appended = [...base.appended];\n                let n = 0;\n                // The first group left empty: the ring selects its band, so ⌫ again removes the group (G7) —\n                // where the band lands once the rows above it in the range have gone.\n                let emptiedBandR: number | undefined;\n                for (const { row, position, keys, addresses } of byGroup.values()) {\n                    const g = withoutLines(currentGroup(row), new Set(keys));\n                    const at = appended.findIndex((x) => x.id === g.id);\n                    if (at >= 0) appended[at] = g; else edits.set(g.id, g);\n                    emitEdit(variant(\"lineRemove\", { rowId: g.id, offset: BigInt(position), lines: addresses, row: g }));\n                    n += keys.length;\n                    if (emptiedBandR === undefined && g.lines.length === 0) {\n                        const bandBi = bodyIndexOfId(body, g.id);\n                        const bandR = bandBi >= 0 ? rowSpace.rowOf[bandBi] : undefined;\n                        if (bandR !== undefined && bandR >= 0) emptiedBandR = bandR - removedRs.filter((r) => r < bandR).length;\n                    }\n                }\n                // Loose rows leave the sheet as entries of their own (#846).\n                if (looseIds.length > 0) emitEdit(variant(\"remove\", { rowIds: looseIds }));\n                n += looseIds.length;\n                const removed = looseIds.length > 0 ? new Set([...base.removed, ...looseIds]) : base.removed;\n                const next: LocalLayer = { edits, appended, removed, placements: base.placements };\n                layerRef.current = next;\n                setLayer(() => next);\n                return { n, what, emptiedBandR };\n            }\n            if (!capabilities.removeGroups) return { n: 0, what: \"groups\", emptiedBandR: undefined };\n            const ids = bands.filter((b) => currentGroup(b.row).lines.length === 0).map((b) => b.row.id);\n            if (ids.length === 0) return { n: 0, what: \"groups\", emptiedBandR: undefined };\n            const next: LocalLayer = { ...base, removed: new Set([...base.removed, ...ids]) };\n            layerRef.current = next;\n            setLayer(() => next);\n            emitEdit(variant(\"remove\", { rowIds: ids }));\n            return { n: ids.length, what: \"groups\", emptiedBandR: undefined };\n        }\n        if (!capabilities.removeRows) return { n: 0, what: \"rows\", emptiedBandR: undefined };\n        const ids: string[] = [];\n        for (let r = r0; r <= r1; r++) {\n            const it = rowAt(r);\n            if (it !== undefined && it.kind === \"real\") ids.push(it.row.id);\n        }\n        if (ids.length === 0) return { n: 0, what: \"rows\", emptiedBandR: undefined };\n        const next: LocalLayer = { ...base, removed: new Set([...base.removed, ...ids]) };\n        layerRef.current = next;\n        setLayer(() => next);\n        emitEdit(variant(\"remove\", { rowIds: ids }));\n        return { n: ids.length, what: \"rows\", emptiedBandR: undefined };\n    }, [group, rowAt, body, rowSpace, setLayer, emitEdit, canEdit, capabilities, editingState.available, layerRef]);\n    /** What a proposed row writes: its set cells under the editable columns — every declared one, the grid's hidden ones too (#1186). */\n    const proposalWrites = useCallback((cells: ReadonlyMap<string, SheetCellValue>): { key: string; cell: SheetCellValue }[] => {\n        const writes: { key: string; cell: SheetCellValue }[] = [];\n        for (const meta of allColumns.list) {\n            if (!meta.editable || meta.kind === \"stamped\" || meta.kind === \"action\") continue;\n            const cell = cells.get(meta.key);\n            if (cell !== undefined && !cellIsBlank(cell)) writes.push({ key: meta.key, cell });\n        }\n        return writes;\n    }, [allColumns]);\n    /** Insert one proposed row after a row: into the blank slot below it (B§5.2), else appended; on a grouped sheet into the anchor's group (#740, G11). */\n    const insertProposal = useCallback((afterR: number, cells: ReadonlyMap<string, SheetCellValue>, extra = 0): { id: string; r: number } | undefined => {\n        if (!canInsertRows) return undefined;\n        const writes = proposalWrites(cells);\n        if (writes.length === 0) return undefined;\n        if (group !== undefined) {\n            const anchor = rowAt(afterR);\n            const gid = anchor !== undefined && (anchor.kind === \"real\" || anchor.kind === \"blank\") ? anchor.group?.row.id : undefined;\n            const blankR = gid !== undefined ? blankLineRowOf(gid) : undefined;\n            if (blankR === undefined) return undefined;\n            const res = writeCells(writes.map((w) => ({ r: blankR, c: -1, key: w.key, cell: w.cell, extra })), \"pattern\");\n            const id = res.ids[0];\n            return id === undefined ? undefined : { id, r: blankR + extra };\n        }\n        const next = rowAt(afterR + 1);\n        let target: number;\n        if (next !== undefined && next.kind === \"blank\") target = afterR + 1;\n        else if (next !== undefined && next.kind === \"real\" && rowIsBlank(next.row, allColumns)) target = afterR + 1;\n        else {\n            const firstBlank = rowSpace.bodyIndexOf.findIndex((bi) => body[bi]!.kind === \"blank\");\n            target = firstBlank < 0 ? rowCount : firstBlank;\n        }\n        const res = writeCells(writes.map((w) => ({ r: target, c: -1, key: w.key, cell: w.cell })), \"pattern\");\n        const id = res.ids[0];\n        if (id === undefined) return undefined;\n        return { id, r: res.firstInserted ?? target };\n    }, [proposalWrites, allColumns, group, rowAt, blankLineRowOf, rowSpace, body, rowCount, writeCells, canInsertRows]);\n    /** Insert proposed rows under a loose row (#846): new loose rows after it, in order — one write, so each lands after the one before. Returns their ids. */\n    const insertLooseProposals = useCallback((afterR: number, proposals: readonly { cells: ReadonlyMap<string, SheetCellValue> }[]): string[] => {\n        if (!canInsertRows) return [];\n        const writes = proposals.flatMap((p, i) => proposalWrites(p.cells).map((w) => ({ r: afterR, c: -1, key: w.key, cell: w.cell, extra: i + 1 })));\n        return writes.length === 0 ? [] : writeCells(writes, \"pattern\").ids;\n    }, [canInsertRows, proposalWrites, writeCells]);\n    const named: SheetWritesValues = { gestureEvents };\n    return { deleteRows, emitEdit, failed, insertLooseProposals, insertProposal, writeCells, ...named };\n}\n\n/** What {@link useSheetWrites} gives the parts after it. */\nexport type SheetWrites = ReturnType<typeof useSheetWrites>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The copilot runner: a row's fill providers and proposers, asked after the kind's latency against the row as it would be\n * if the open editor committed, their asynchronous answers landing as they come.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { NULL_CELL, driverKeyOf, rowIsBlank } from \"./model.js\";\nimport { provisionalCell, type Suggestions } from \"./sheet-state.js\";\nimport { runSuggest } from \"./suggest.js\";\nimport { trackWork } from \"./suggest-async.js\";\nimport type { SheetRowValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport { blankRow, withCell } from \"./local-rows.js\";\n\n/** One copilot request — a run after a delay, or a result to deliver once the rows have rendered. */\nexport interface SuggestRequest {\n    seq: number;\n    rowId: string;\n    ms: number;\n    ready?: Suggestions;\n}\n\n/**\n * Runs the copilot for a row, once the rows have rendered (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @returns What asks the copilot to run\n */\nexport function useSheetCopilot(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetMachine: SheetMachine) {\n    const {\n        ahead, allColumns, columns, copilotOn, driverColumn, fillColumns, inflight, proposers, suggestMemo,\n    } = sheetDecode;\n    const { rows } = sheetSession;\n    const { rowAt, rowOf, wireContextOf } = sheetBody;\n    const { ctxRef, dispatch, uiRef } = sheetMachine;\n    // ── The copilot runner (§6.2) ─────────────────────────────────────────\n    const [suggestReq, setSuggestReq] = useState<SuggestRequest | null>(null);\n    const requestRun = useCallback((rowId: string, ms: number) => {\n        setSuggestReq((p) => ({ seq: (p?.seq ?? 0) + 1, rowId, ms }));\n    }, []);\n    const requestReady = useCallback((rowId: string, ready: Suggestions) => {\n        setSuggestReq((p) => ({ seq: (p?.seq ?? 0) + 1, rowId, ms: 0, ready }));\n    }, []);\n    /** Run the providers for an anchor — against the row as it would be if the open editor committed. */\n    const runFor = (rowId: string) => {\n        if (!copilotOn) return;\n        const r = rowOf(rowId);\n        const item = r !== undefined ? rowAt(r) : undefined;\n        if (r === undefined || item === undefined || (item.kind !== \"real\" && item.kind !== \"blank\")) return;\n        const current = uiRef.current;\n        let row: SheetRowValue = item.kind === \"real\" ? item.row : blankRow(\"\", allColumns.list);\n        let skipKey: string | undefined;\n        if (current.edit !== null && current.edit.r === r) {\n            const cell = provisionalCell(current.edit, ctxRef.current);\n            if (cell === undefined) return;   // unrecognised — nothing to run against\n            const meta = columns.list[current.edit.c];\n            if (meta !== undefined) {\n                row = withCell(row, meta.key, cell ?? NULL_CELL);\n                skipKey = meta.key;\n            }\n        }\n        if (rowIsBlank(row, allColumns)) {\n            dispatch({ t: \"suggest.ready\", anchorId: rowId, sugg: null });\n            return;\n        }\n        // A line runs against its group (#740): the bridge puts the line in place by its key, so the resident groups pass as they are.\n        const lg = item.group;\n        const residentIndex = item.kind === \"real\" ? item.residentIndex : rows.length;\n        const rowsNow = lg !== undefined ? rows : item.kind === \"real\" ? rows.map((x, i) => (i === residentIndex ? row : x)) : [...rows, row];\n        const below = rowAt(r + 1);\n        const nextBusy = below !== undefined && below.kind === \"real\" && !rowIsBlank(below.row, allColumns);\n        const outcome = runSuggest({\n            anchorId: rowId, row, skipKey, columns: fillColumns, proposers, ahead, nextBusy,\n            driverKey: driverKeyOf(row, driverColumn), driverColumn, rejected: current.rejected,\n            contextOf: (rw) => wireContextOf(rw, residentIndex, item.position, rowsNow, lg),\n            memo: suggestMemo.current,\n        });\n        const gen = inflight.current.begin();\n        dispatch({ t: \"suggest.ready\", anchorId: rowId, sugg: outcome.sugg });\n        for (const work of outcome.async) {\n            trackWork(inflight.current, gen, work, (key, result) => {\n                dispatch(result.kind === \"fill\"\n                    ? { t: \"suggest.landed\", anchorId: rowId, key, fill: result.fill }\n                    : { t: \"suggest.landed\", anchorId: rowId, key, rows: result.rows });\n            });\n        }\n    };\n    const runForRef = useRef(runFor);\n    runForRef.current = runFor;\n    useEffect(() => {\n        if (suggestReq === null) return;\n        if (suggestReq.ready !== undefined) {\n            dispatch({ t: \"suggest.ready\", anchorId: suggestReq.rowId, sugg: suggestReq.ready });\n            return;\n        }\n        const timer = setTimeout(() => runForRef.current(suggestReq.rowId), suggestReq.ms);\n        return () => clearTimeout(timer);\n    }, [suggestReq, dispatch]);\n    useEffect(() => {\n        const registry = inflight.current;\n        return () => registry.cancel();\n    }, [inflight]);\n    return { requestReady, requestRun };\n}\n\n/** What {@link useSheetCopilot} gives the parts after it. */\nexport type SheetCopilot = ReturnType<typeof useSheetCopilot>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The clipboard matrix (B§10): copy is tab-separated — dates `d/m/yyyy`,\n * numbers bare with the viewer's decimal separator (`1234,5` in German, what\n * a spreadsheet in that language reads, #852), a link cell as TWO columns\n * (From, To) printed through the grammar; paste lands at the selection, each\n * cell parsed by its kind — a stamped or read-only column's left as it was,\n * and said so — a link column consuming two clipboard cells.\n *\n * @packageDocumentation\n */\n\nimport type { Formatters } from \"@elaraai/east-ui-components\";\nimport { formatDateClipboard } from \"./parse/date.js\";\nimport { formatNumberBare } from \"./parse/quantity.js\";\nimport { linkHalvesText } from \"./parse/index.js\";\nimport type { SheetColumnMeta } from \"./model.js\";\nimport type { SheetCellValue } from \"./values.js\";\n\n/**\n * A cell's clipboard text — one column, or two for a link.\n *\n * @param cell - The cell\n * @param meta - Its column\n * @param words - The viewer's formatters (a number's decimal separator)\n * @returns The clipboard cells\n */\nexport function exportCell(cell: SheetCellValue | undefined, meta: SheetColumnMeta, words: Formatters): string[] {\n    if (meta.kind === \"link\" || meta.kind === \"set\") {\n        if (cell === undefined || cell.type !== \"Link\") return meta.kind === \"link\" ? [\"\", \"\"] : [\"\"];\n        const [from, to] = linkHalvesText(cell.value);\n        return meta.kind === \"link\" ? [from, to] : [to];\n    }\n    if (cell === undefined || cell.type === \"Null\") return [\"\"];\n    switch (cell.type) {\n        case \"DateTime\": return [formatDateClipboard(cell.value)];\n        case \"Float\": return [formatNumberBare(cell.value, words)];\n        case \"Integer\": return [String(cell.value)];\n        case \"Invalid\":\n        case \"String\": return [cell.value];\n        case \"Boolean\": return [String(cell.value)];\n        case \"Link\": return [linkHalvesText(cell.value).join(\" > \")];\n    }\n    return [\"\"];\n}\n\n/**\n * A block of cells as tab-separated lines; `skipRow` leaves rows out (a\n * group's band, #740 G9).\n *\n * @param cellAt - The cell at a row and column\n * @param columns - The columns\n * @param rect - The block\n * @param words - The viewer's formatters (a number's decimal separator)\n * @param skipRow - Rows to leave out\n * @returns The clipboard text\n */\nexport function exportMatrix(\n    cellAt: (r: number, c: number) => SheetCellValue | undefined,\n    columns: readonly SheetColumnMeta[],\n    rect: { r0: number; r1: number; c0: number; c1: number },\n    words: Formatters,\n    skipRow?: (r: number) => boolean,\n): string {\n    const lines: string[] = [];\n    for (let r = rect.r0; r <= rect.r1; r++) {\n        if (skipRow?.(r) === true) continue;\n        const cells: string[] = [];\n        for (let c = rect.c0; c <= rect.c1; c++) {\n            const meta = columns[c];\n            if (meta === undefined) continue;\n            for (const text of exportCell(cellAt(r, c), meta, words)) cells.push(text);\n        }\n        lines.push(cells.join(\"\\t\"));\n    }\n    return lines.join(\"\\n\");\n}\n\n/** Clipboard text to a matrix of cells (a trailing newline drops). */\nexport function parseMatrix(text: string): string[][] {\n    return text.replace(/\\r/g, \"\").split(\"\\n\")\n        .filter((x, i, a) => !(i === a.length - 1 && x === \"\"))\n        .map((x) => x.split(\"\\t\"));\n}\n\n/** Two clipboard columns (From, To) become one link text — a lone cell is taken as typed. */\nexport function joinHalves(a: string, b: string | undefined): string {\n    const A = a.trim();\n    const B = (b ?? \"\").trim();\n    if (b === undefined) return A;\n    if (A === \"\") return B;\n    if (B === \"\") return /\\s*(?:->|=>|→|>)\\s*|\\s+[-–]\\s+/.test(A) ? A : `${A} >`;\n    return `${A} > ${B}`;\n}\n\n/** One pasted cell, resolved against the column it lands on. */\nexport interface PastedCell {\n    /** Row offset from the paste anchor. */\n    dr: number;\n    /** The column index. */\n    c: number;\n    /** The text to parse. */\n    text: string;\n}\n\n/**\n * Lay a clipboard matrix over the columns from an anchor column: a link\n * column consumes two cells. A stamped or read-only column's cell is laid\n * too: the paste leaves it as it was, and says why (#1585).\n */\nexport function layoutPaste(matrix: readonly (readonly string[])[], columns: readonly SheetColumnMeta[], c0: number): { cells: PastedCell[]; width: number } {\n    const cells: PastedCell[] = [];\n    let width = 1;\n    matrix.forEach((line, dr) => {\n        let k = 0;\n        let c = c0;\n        while (k < line.length && c < columns.length) {\n            const meta = columns[c]!;\n            let text = line[k++] ?? \"\";\n            if (meta.kind === \"link\") text = joinHalves(text, k < line.length ? line[k++] : undefined);\n            cells.push({ dr, c, text });\n            c++;\n        }\n        width = Math.max(width, c - c0);\n    });\n    return { cells, width };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The effect runner: what each of the machine's transitions leaves to the component — a write, a clear, a paste, a copy, a\n * removal, a focus, a scroll, a jump past the rows read — run once the store has its batch, each gesture one step of the\n * history.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useRef, useState } from \"react\";\nimport { none, some, variant } from \"@elaraai/east\";\nimport { focusKeySearch, getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { NULL_CELL, cellIsBlank, latencyOf, markOf, takesClear, type SheetBodyItem, type SheetColumnMeta } from \"./model.js\";\nimport type { SheetCellRefusalWord } from \"./messages.js\";\nimport { SHEET_PAGE_SIZE } from \"./paging.js\";\nimport { writeNarrowing, writeSheetViews } from \"./view-state.js\";\nimport { parseCell } from \"./parse/index.js\";\nimport { exportMatrix, layoutPaste, parseMatrix } from \"./clipboard.js\";\nimport { isBlankRowId, type SheetEffect } from \"./sheet-state.js\";\nimport type { SheetNotice } from \"./sheet-types.js\";\nimport { LATENCY_MS } from \"./suggest.js\";\nimport { editsOutOfPlace, stepsInPlace } from \"./steps.js\";\nimport type { EditorFocusRequest } from \"./Editor.js\";\nimport type { SheetSelectionValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { CellWrite, SheetWrites } from \"./use-writes.js\";\nimport type { SheetCopilot } from \"./use-copilot.js\";\n\n/**\n * Runs the machine's effects (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetWrites - The cell writes, the removal and the proposals' inserts\n * @param sheetCopilot - What asks the copilot to run\n * @returns The runner, and the refs and requests its effects reach\n */\nexport function useSheetEffects(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetMachine: SheetMachine, sheetWrites: SheetWrites, sheetCopilot: SheetCopilot) {\n    const {\n        chrome, columns, copilotOn, declaredNoun, declaredViews, group, hostGrid, onSelectFn, onViewsChangeFn,\n        setViewsState, triggers, viewsRef, words,\n    } = sheetDecode;\n    const { canEdit, dispatchStore, paging, recordGesture, store } = sheetSession;\n    const { blankLineRowOf, cellAt, colCount, idAt, lensEnds, metaAt, parseCtxFor, rowAt, rowOf, rowSpace, writableAt } = sheetBody;\n    const { dispatch, expectedNarrowing, jumpToElement, lensJumpTo } = sheetMachine;\n    const { deleteRows, failed, gestureEvents, insertLooseProposals, insertProposal, writeCells } = sheetWrites;\n    const { requestReady, requestRun } = sheetCopilot;\n    // ── Effects ───────────────────────────────────────────────────────────\n    const cardRef = useRef<HTMLDivElement | null>(null);\n    // Where the toolbar's items are placed — the frame's toolbar: ⌘F looks\n    // in it for the key search, else a search box.\n    const toolbarRef = useRef<HTMLDivElement | null>(null);\n    /**\n     * A key's move across an unloaded run (#860), waiting for its window: the\n     * source element it is headed for, the window its jump pins, where the\n     * ring lands — the first row at or past the element, the last at or\n     * before it, or the last there that is not blank padding — the column,\n     * and the viewer's gestures counted when the key came.\n     */\n    const seekIntent = useRef<{ element: number; window: number; land: \"first\" | \"last\" | \"end\"; c: number; moves: number } | undefined>(undefined);\n    /** The viewer's gestures on the ring — keys, presses — counted: a key's move across an unloaded run lands only if none came after it (#860). */\n    const ringMoves = useRef(0);\n    /**\n     * Who asked for the driver's pending jump (#860): a key's move across an\n     * unloaded run, the key search, a remount's restore of its scroll, or the\n     * hidden pick's go to the row it revealed. The driver holds one jump — a\n     * key's move gives way to one it did not ask for, and the search drops\n     * only its own.\n     */\n    const jumpBy = useRef<\"key\" | \"search\" | \"anchor\" | \"reveal\" | undefined>(undefined);\n    // A keyboard move's reveal (#860): bumped with every `scroll.to`, and read once the frame has asked for its row.\n    const [revealSeq, setRevealSeq] = useState(0);\n    const [editorFocus, setEditorFocus] = useState<EditorFocusRequest>({ seq: 0, selectAll: true });\n    /**\n     * The body item a scroll brings into view, and how: the row the ring or a\n     * search lands on by the least scroll, and a new narrowing's first item at\n     * the top (#1349) — under the lens it may be a band taller than the view,\n     * which the least scroll would show by its end. The frame serves a target\n     * whose index moved; a `fresh` one (`nonce`) it serves though its index is\n     * the last one's — a jump asked for again, a new row put in the place of\n     * the row the last target named.\n     */\n    const [scrollTarget, setScrollTargetState] = useState<{ index: number; align: \"auto\" | \"start\"; nonce: number } | undefined>(undefined);\n    const setScrollTarget = useCallback((target: { index: number; align: \"auto\" | \"start\" }, fresh = false) => {\n        setScrollTargetState((was) => ({ ...target, nonce: (was?.nonce ?? 0) + (fresh ? 1 : 0) }));\n    }, []);\n    const runEffects = useCallback((effects: readonly SheetEffect[]) => {\n        gestureEvents.current = [];\n        /** The writes so far as one gesture: one step of the history. */\n        const recordSoFar = () => {\n            try { recordGesture(gestureEvents.current); }\n            catch (error) { failed(error); }\n            finally { gestureEvents.current = []; }\n        };\n        /** After a write: the ring follows an insert, a blank anchor's suggestions follow the new id, the copilot re-runs. */\n        const afterWrite = (r: number, res: { firstInserted: number | undefined; ids: string[] }, rerun: boolean) => {\n            const anchorBefore = idAt(r);\n            if (res.firstInserted !== undefined) {\n                // The blank row became real at the end of the sheet: the ring\n                // follows it, keeping whatever move the commit made.\n                const delta = store.ui.sel.r - r;\n                dispatchStore({ t: \"patch\", patch: { sel: { r: res.firstInserted + delta, c: store.ui.sel.c }, selEnd: null } });\n                if (anchorBefore !== undefined && isBlankRowId(anchorBefore) && res.ids[0] !== undefined) {\n                    dispatch({ t: \"suggest.rekey\", from: anchorBefore, to: res.ids[0] });\n                }\n            }\n            if (rerun && copilotOn && res.ids[0] !== undefined) requestRun(res.ids[0], 0);\n        };\n        /** Why a cell takes no edit: a mark's lock, in its words, else its column is read only. */\n        const lockedAt = (r: number, meta: SheetColumnMeta): SheetCellRefusalWord => {\n            const it = rowAt(r);\n            const mark = markOf(meta, it?.kind === \"real\" || it?.kind === \"group\" ? it.row.cells : undefined);\n            return mark?.lock === true ? { why: \"locked\", words: mark.words } : { why: \"readOnly\", header: meta.header };\n        };\n        for (const eff of effects) {\n            switch (eff.t) {\n                case \"write\": {\n                    const meta = metaAt(eff.r, eff.c);\n                    const cell = eff.cell ?? NULL_CELL;\n                    if (meta === undefined) break;\n                    // A cell locked since the editor opened takes no write, nor a blank a cell whose value is never empty,\n                    // nor text no column reads a column from data, which keeps none: the footer says why.\n                    const refused: SheetCellRefusalWord | undefined = !writableAt(eff.r, eff.c) ? lockedAt(eff.r, meta)\n                        : cellIsBlank(cell) && !takesClear(meta) ? { why: \"noClear\", header: meta.header }\n                            : cell.type === \"Invalid\" && getSomeorUndefined(meta.raw.from) !== undefined ? { why: \"unread\", header: meta.header, text: cell.value }\n                                : undefined;\n                    if (refused !== undefined) {\n                        dispatchStore({ t: \"patch\", patch: { msg: { id: \"editRefused\", word: refused } } });\n                        break;\n                    }\n                    const res = writeCells([{ r: eff.r, c: eff.c, cell }], \"typed\");\n                    afterWrite(eff.r, res, triggers.size === 0 || triggers.has(meta.key));\n                    break;\n                }\n                case \"write.many\": {\n                    // A cell locked since the fill was proposed keeps its value (#1560).\n                    const writes = eff.writes.filter((w) => writableAt(eff.r, w.c));\n                    if (writes.length === 0) break;\n                    const res = writeCells(writes.map((w) => ({ r: eff.r, c: w.c, cell: w.cell })), eff.source);\n                    afterWrite(eff.r, res, true);\n                    break;\n                }\n                case \"gesture.end\":\n                    recordSoFar();\n                    break;\n                case \"open\": {\n                    // A cell that edits out of place (#1531): the host opens it once this commit is drawn, as `onSelect` is told of a move.\n                    const key = columns.list[eff.c]?.key;\n                    const onOpen = hostGrid?.onOpen;\n                    if (key !== undefined && onOpen !== undefined) queueMicrotask(() => onOpen(eff.r, key));\n                    break;\n                }\n                case \"insert.rows\": {\n                    let afterR = eff.anchorR;\n                    let lastId: string | undefined;\n                    const anchorItem = rowAt(eff.anchorR);\n                    if (anchorItem !== undefined && anchorItem.kind === \"real\" && anchorItem.loose !== undefined) {\n                        // Under a loose row (#846): new loose rows after it.\n                        lastId = insertLooseProposals(eff.anchorR, eff.rows).at(-1);\n                    } else {\n                        for (const [i, p] of eff.rows.entries()) {\n                            const landed = insertProposal(afterR, p.cells, group !== undefined ? i : 0);\n                            if (landed === undefined) break;\n                            lastId = landed.id;\n                            if (group === undefined) afterR = landed.r;\n                        }\n                    }\n                    if (lastId === undefined) break;\n                    // Re-anchor on the row just taken: the rest are already waiting, else look forward again.\n                    if (eff.rest.length > 0) requestReady(lastId, { anchorId: lastId, fill: new Map(), rows: eff.rest, pending: [] });\n                    else if (copilotOn) requestRun(lastId, 0);\n                    break;\n                }\n                case \"clear\": {\n                    const writes: CellWrite[] = [];\n                    // The cells it leaves as they were, and why the first was: the footer says so.\n                    let kept = 0;\n                    let refused: SheetCellRefusalWord | undefined;\n                    // ⌫ on one cell alone (#1585): it says why it leaves that cell as it is, though the cell is blank.\n                    const one = eff.r0 === eff.r1 && eff.c0 === eff.c1;\n                    for (let r = eff.r0; r <= eff.r1; r++) {\n                        for (let c = eff.c0; c <= eff.c1; c++) {\n                            const meta = metaAt(r, c);\n                            if (meta === undefined || !canEdit) continue;\n                            const it = rowAt(r);\n                            // Each cell a clear leaves as it is says why, as a paste does (#1585): an action cell, which only its\n                            // actions change; a locked one, and one read only — a stamped one's among them; one that steps in place\n                            // on an owned row, which takes no step there (T9); one that edits out of place, which is cleared where\n                            // it edits, never in the grid (#1531); one whose value isn't an option.\n                            const why: SheetCellRefusalWord | undefined = meta.kind === \"action\" ? { why: \"action\", header: meta.header }\n                                : meta.kind === \"stamped\" || !writableAt(r, c) ? lockedAt(r, meta)\n                                    : hostGrid !== undefined && stepsInPlace(meta) && (it?.kind === \"real\" || it?.kind === \"group\") && it.row.owned\n                                        ? { why: \"owned\", header: meta.header }\n                                        : editsOutOfPlace(meta, hostGrid) ? { why: \"opens\", header: meta.header }\n                                            : !takesClear(meta) ? { why: \"noClear\", header: meta.header } : undefined;\n                            // A blank has nothing to clear — but that one cell is told why all the same, unless only that it can't be empty.\n                            if (cellIsBlank(cellAt(r, c)) && (!one || why === undefined || why.why === \"noClear\")) continue;\n                            if (why !== undefined) {\n                                kept += 1;\n                                refused ??= why;\n                                continue;\n                            }\n                            writes.push({ r, c, cell: NULL_CELL });\n                        }\n                    }\n                    if (writes.length > 0) writeCells(writes, \"typed\");\n                    if (refused !== undefined) dispatchStore({ t: \"patch\", patch: { msg: { id: \"clearRefused\", n: kept, cleared: writes.length, word: refused } } });\n                    break;\n                }\n                case \"delete.rows\": {\n                    if (!canEdit) break;\n                    const out = deleteRows(eff.r0, eff.r1);\n                    if (out.n === 0) break;\n                    const msg: SheetNotice = {\n                        id: \"deleted\", n: out.n, what: out.what, noun: declaredNoun?.singular, nouns: declaredNoun?.plural,\n                        // The group is left empty: ⌫ again removes it.\n                        again: out.emptiedBandR !== undefined,\n                    };\n                    if (out.emptiedBandR !== undefined) {\n                        dispatchStore({ t: \"patch\", patch: {\n                            sel: { r: out.emptiedBandR, c: 0 }, selEnd: { r: out.emptiedBandR, c: Math.max(0, colCount - 1) },\n                            msg,\n                        } });\n                    } else {\n                        dispatchStore({ t: \"patch\", patch: { msg } });\n                    }\n                    break;\n                }\n                case \"copy\": {\n                    // A band never copies (G9): a whole-group selection copies its lines.\n                    const text = exportMatrix(cellAt, columns.list, eff, words, (r) => { const k = rowAt(r)?.kind; return k === \"group\"; });\n                    if (typeof navigator !== \"undefined\" && navigator.clipboard !== undefined) {\n                        void navigator.clipboard.writeText(text).catch(() => {});\n                    }\n                    break;\n                }\n                case \"paste\": {\n                    if (!canEdit) break;\n                    const matrix = parseMatrix(eff.text);\n                    if (matrix.length === 0) break;\n                    const laid = layoutPaste(matrix, columns.list, eff.c);\n                    const writes: CellWrite[] = [];\n                    let skipped = 0;\n                    // The action cells it passes by (T7): said apart, never as unrecognised (the hand test's F18).\n                    let actions = 0;\n                    // Why the first cell it skips is left as it was, where that is known: the footer says so.\n                    let refused: SheetCellRefusalWord | undefined;\n                    // On a grouped sheet a paste lands on the anchor's group — its lines from the ring, its blank line, then new lines past it — never across a band (G9).\n                    const anchor = rowAt(eff.r);\n                    const gid = group !== undefined && anchor !== undefined && (anchor.kind === \"real\" || anchor.kind === \"blank\") ? anchor.group?.row.id : undefined;\n                    // On a loose row (#846): the loose rows from the ring down, then new loose rows after the last of them — never across a band.\n                    const isLoose = (it: SheetBodyItem | undefined): boolean => it !== undefined && it.kind === \"real\" && it.loose !== undefined;\n                    let looseEnd: number | undefined;\n                    if (isLoose(anchor)) for (looseEnd = eff.r; isLoose(rowAt(looseEnd + 1)); looseEnd++);\n                    if (group !== undefined && gid === undefined && looseEnd === undefined) break;\n                    const blankR = gid !== undefined ? blankLineRowOf(gid) : looseEnd;\n                    for (const p of laid.cells) {\n                        const meta = columns.list[p.c];\n                        if (meta === undefined) continue;\n                        // An action cell takes no paste (T7); a cell that edits out of place takes it where it edits (#1531) —\n                        // said so, or why it takes none there either (#1585).\n                        if (meta.kind === \"action\") { actions += 1; continue; }\n                        const r = eff.r + p.dr;\n                        // A stamped or read-only column takes none, and is said as skipped, and why (#1585).\n                        if (meta.kind === \"stamped\" || !meta.editable) { skipped += 1; refused ??= lockedAt(r, meta); continue; }\n                        if (editsOutOfPlace(meta, hostGrid)) {\n                            skipped += 1;\n                            refused ??= writableAt(r, p.c) ? { why: \"opens\", header: meta.header } : lockedAt(r, meta);\n                            continue;\n                        }\n                        const outcome = parseCell(meta, p.text, parseCtxFor(Math.min(r, blankR ?? r), meta));\n                        const cell = outcome.kind === \"unrecognised\" ? variant(\"Invalid\", p.text) : outcome.kind === \"cell\" ? outcome.cell : NULL_CELL;\n                        // A blank lands only where the cell takes a clear, text no column reads only where it can stand —\n                        // a column from data keeps none — and a cell it lands on in place only when it takes an edit, never\n                        // one that steps in place on an owned row, which takes no step there (T9): each is said as skipped,\n                        // and why.\n                        const kept: SheetCellRefusalWord | undefined = cellIsBlank(cell) && !takesClear(meta) ? { why: \"noClear\", header: meta.header }\n                            : outcome.kind === \"unrecognised\" && getSomeorUndefined(meta.raw.from) !== undefined ? { why: \"unread\", header: meta.header, text: p.text }\n                                : undefined;\n                        if (kept !== undefined) {\n                            skipped += 1;\n                            refused ??= kept;\n                            continue;\n                        }\n                        const inPlace = { r, c: p.c, cell };\n                        const it = rowAt(r);\n                        const owned = hostGrid !== undefined && stepsInPlace(meta) && (it?.kind === \"real\" || it?.kind === \"group\") && it.row.owned;\n                        const lands = writableAt(r, p.c) && !owned;\n                        const why = (): SheetCellRefusalWord => (owned && writableAt(r, p.c) ? { why: \"owned\", header: meta.header } : lockedAt(r, meta));\n                        if (looseEnd !== undefined) {\n                            if (r > looseEnd) writes.push({ r: looseEnd, c: p.c, cell, extra: r - looseEnd });\n                            else if (lands) writes.push(inPlace);\n                            else { skipped += 1; refused ??= why(); }\n                            continue;\n                        }\n                        if (gid !== undefined) {\n                            const target = rowAt(r);\n                            const inPlan = target !== undefined && (target.kind === \"real\" || target.kind === \"blank\") && target.group?.row.id === gid;\n                            if (inPlan && (blankR === undefined || r <= blankR) && lands) writes.push(inPlace);\n                            else if (blankR !== undefined && r > blankR) writes.push({ r: blankR, c: p.c, cell, extra: r - blankR });\n                            else skipped += 1;\n                            continue;\n                        }\n                        if (lands) writes.push(inPlace);\n                        else { skipped += 1; refused ??= why(); }\n                    }\n                    // A paste whose new rows' keys are refused writes nothing, and the footer says why (#1536).\n                    if (writes.length > 0 && writeCells(writes, \"pasted\").refused === true) break;\n                    const wide = Math.max(1, laid.width);\n                    dispatchStore({ t: \"patch\", patch: {\n                        selEnd: { r: eff.r + matrix.length - 1, c: Math.min(colCount - 1, eff.c + wide - 1) },\n                        msg: { id: \"pasted\", rows: matrix.length, cols: matrix[0]?.length ?? 0, skipped, actions, wrote: writes.length > 0, refused },\n                    } });\n                    break;\n                }\n                case \"focus.sheet\":\n                    cardRef.current?.focus({ preventScroll: true });\n                    break;\n                case \"focus.editor\":\n                    setEditorFocus((f) => ({ seq: f.seq + 1, selectAll: eff.selectAll }));\n                    break;\n                case \"emit.select\": {\n                    if (onSelectFn === undefined) break;\n                    const it = rowAt(eff.r);\n                    const meta = metaAt(eff.r, eff.c);\n                    const lg = it !== undefined && it.kind === \"real\" ? it.group : undefined;\n                    const sel: SheetSelectionValue = {\n                        rowId: it !== undefined && it.kind === \"real\" ? some(lg !== undefined ? lg.row.id : it.row.id) : it !== undefined && it.kind === \"group\" ? some(it.row.id) : none,\n                        line: lg !== undefined ? some(lg.key) : none,\n                        key: meta !== undefined ? some(meta.key) : none,\n                    };\n                    queueMicrotask(() => onSelectFn(sel));\n                    break;\n                }\n                case \"scroll.to\": {\n                    const bi = rowSpace.bodyIndexOf[eff.r];\n                    if (bi !== undefined) setScrollTarget({ index: bi, align: \"auto\" });\n                    setRevealSeq((n) => n + 1);\n                    break;\n                }\n                case \"seek.step\":\n                case \"seek.edge\": {\n                    // Across an unloaded run (#860): the window beyond is fetched the\n                    // way a key search jumps, and the ring lands once it is in (`use-jumps.ts`).\n                    const step = eff.t === \"seek.step\";\n                    if (lensEnds !== undefined) {\n                        // Under the lens (#1349): into the stretch it has not read past the rows it draws — a step's or a\n                        // page's the nearest that way, crossing in at its edge, as a grouped sheet's page does, for the\n                        // lens's rows are no run of elements; an end's the narrowing's first or last — read where it is\n                        // by the lens's jump, the rows shown drawn meanwhile, and the ring lands on its row once the lens\n                        // has drawn it (`use-jumps.ts`).\n                        const span = step ? (eff.dir > 0 ? lensEnds.after : lensEnds.before) : eff.edge === \"first\" ? lensEnds.first : lensEnds.last;\n                        if (span === undefined) break;\n                        const forward = step ? eff.dir > 0 : eff.edge === \"first\";\n                        const element = forward ? span.from : span.to;\n                        seekIntent.current = { element, window: element, land: forward ? \"first\" : step ? \"last\" : \"end\", c: eff.c, moves: ringMoves.current };\n                        jumpBy.current = \"key\";\n                        lensJumpTo(element);\n                        break;\n                    }\n                    const edge = step\n                        ? (eff.dir > 0 ? paging.tail?.from : paging.head?.to)\n                        : eff.edge === \"first\" ? 0 : paging.total !== undefined && paging.total > 0 ? paging.total - 1 : undefined;\n                    if (edge === undefined) break;\n                    // A page (#1398, CL10): a page's rows on from the row it pages from — on a flat sheet each row an\n                    // element, so the element a page on — into the run, and never past the source's ends; a grouped sheet's\n                    // rows are not its elements, and its page crosses into the run at its edge.\n                    const page = step ? eff.page : undefined;\n                    const from = page === undefined || group !== undefined ? undefined : rowAt(page.from);\n                    const paged = page === undefined || from === undefined || (from.kind !== \"real\" && from.kind !== \"blank\") ? undefined\n                        : from.position + (eff.t === \"seek.step\" && eff.dir > 0 ? page.rows : -page.rows);\n                    const last = paging.total !== undefined && paging.total > 0 ? paging.total - 1 : paging.tail?.to;\n                    const element = paged === undefined ? edge\n                        : step && eff.dir > 0 ? Math.min(last ?? paged, Math.max(edge, paged)) : Math.max(0, Math.min(edge, paged));\n                    const land = step ? (eff.dir > 0 ? \"first\" : \"last\") : eff.edge === \"first\" ? \"first\" : \"end\";\n                    seekIntent.current = { element, window: Math.floor(element / SHEET_PAGE_SIZE), land, c: eff.c, moves: ringMoves.current };\n                    jumpBy.current = \"key\";\n                    // Fetch, then move (#1398, CL10): the rows shown stand in, retained, the ring where it is, until the\n                    // window it goes to is in — then the ring lands there in the commit that draws it (`use-jumps.ts`).\n                    jumpToElement(element, true);\n                    break;\n                }\n                case \"select.id\": {\n                    // The body has re-formed (a fold-all): the ring re-finds its group's band by id.\n                    const r = rowOf(eff.id);\n                    if (r !== undefined) dispatch({ t: \"select.set\", r, c: eff.c });\n                    break;\n                }\n                case \"schedule.suggest\": {\n                    // The copilot runs against the row as it would be, after the kind's latency (B§3).\n                    if (!copilotOn) break;\n                    const edit = store.ui.edit;\n                    if (edit === null) break;\n                    const id = idAt(edit.r);\n                    if (id === undefined) break;\n                    const kind = metaAt(edit.r, edit.c)?.kind ?? \"text\";\n                    requestRun(id, eff.latency === \"instant\" || latencyOf(kind) === \"instant\" ? LATENCY_MS.instant : LATENCY_MS.idle);\n                    break;\n                }\n                case \"emit.views\": {\n                    // The views land locally at once (the interactive-state pattern) and reach the host in a microtask.\n                    const next = eff.views;\n                    setViewsState({ over: declaredViews, views: next });\n                    viewsRef.current = next;\n                    queueMicrotask(() => writeSheetViews(next, onViewsChangeFn));\n                    break;\n                }\n                case \"slice.write\": {\n                    // The sheet's own write places the ring itself: the change detector must not move it.\n                    // Every source takes its narrowing, as a view saved it (#1345).\n                    expectedNarrowing.current = eff.state;\n                    if (chrome !== undefined) writeNarrowing(chrome, eff.state);\n                    break;\n                }\n                case \"focus.search\": {\n                    // The key search, in either form — its box, or folded to its icon its popover (#1221); else the first box in the row.\n                    if (focusKeySearch(toolbarRef.current)) break;\n                    const input = toolbarRef.current?.querySelector<HTMLInputElement>(\"input\");\n                    input?.focus();\n                    input?.select();\n                    break;\n                }\n            }\n        }\n        recordSoFar();\n    }, [recordGesture, failed, writeCells, deleteRows, insertProposal, insertLooseProposals, columns, group, declaredNoun, words, metaAt, blankLineRowOf, canEdit, cellAt, colCount, parseCtxFor, onSelectFn, rowAt, rowOf, rowSpace, store.ui.sel, store.ui.edit, writableAt, idAt, copilotOn, triggers, requestRun, requestReady, dispatch, declaredViews, onViewsChangeFn, chrome, paging.head, paging.tail, paging.total, jumpToElement, lensEnds, lensJumpTo, hostGrid, dispatchStore, expectedNarrowing, gestureEvents, setViewsState, viewsRef, setScrollTarget]);\n    const drainedFx = useRef(0);\n    useLayoutEffect(() => {\n        if (store.fxSeq === drainedFx.current) return;\n        drainedFx.current = store.fxSeq;\n        runEffects(store.fx);\n    }, [store.fxSeq, store.fx, runEffects]);\n    return {\n        cardRef, editorFocus, jumpBy, revealSeq, ringMoves, runEffects, scrollTarget, seekIntent, setScrollTarget,\n        toolbarRef,\n    };\n}\n\n/** What {@link useSheetEffects} gives the parts after it. */\nexport type SheetEffects = ReturnType<typeof useSheetEffects>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The gestures that wait for an open editor to commit: a step of the history, a draft's discard and an insertion, and\n * where the ring lands once the body holds a row a gesture made.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useRef } from \"react\";\nimport type { HistoryAction } from \"@elaraai/east-ui-components\";\nimport { lineId } from \"./model.js\";\nimport type { Origin } from \"./transactions.js\";\nimport { anchorAt, insertionGesture, type InsertRequest, type InsertionAnchor } from \"./insertion-gesture.js\";\nimport type { SheetSeeds } from \"./use-editing.js\";\nimport { discardDraft } from \"./draft-state.js\";\nimport type { SheetHost } from \"./parts.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetWrites } from \"./use-writes.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport { mintLineKey } from \"./local-rows.js\";\n\n/** Where a gesture's new entry comes from when it is not the sheet's own: a dropped template's seeds, and its origin (#1187). */\nexport interface SheetInsertFrom {\n    seeds: SheetSeeds;\n    origin: Origin;\n}\n\n/**\n * Takes a history step, a discard or an insertion once any open editor has committed (see the module docs).\n *\n * @param host - What the frame hands the parts\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetWrites - The cell writes, the removal and the proposals' inserts\n * @param sheetEffects - The effect runner and what its effects reach\n * @returns The history's runner, the discard and the insertion\n */\nexport function useSheetGestures(host: SheetHost, sheetDecode: SheetDecode, sheetSession: SheetSession,\n    sheetBody: SheetBody, sheetMachine: SheetMachine, sheetWrites: SheetWrites, sheetEffects: SheetEffects) {\n    const {\n        canInsertGroups, canInsertRows, columns, declaredNoun, driverColumn, group, keyed, loose,\n    } = sheetDecode;\n    const {\n        canEdit, childField, dispatchStore, draftType, editingState, locked, mintAmong, recordGesture, rows, runLayout, session,\n        store, takenKeys, ui,\n    } = sheetSession;\n    const { endPosition, rowAt, rowOf, rowSpace } = sheetBody;\n    const { ctxRef, dispatch, uiRef } = sheetMachine;\n    const { failed } = sheetWrites;\n    const { cardRef, runEffects, setScrollTarget } = sheetEffects;\n    const pendingHistoryAction = useRef<HistoryAction | undefined>(undefined);\n    // A run's highlight ends with Undo, Apply and Discard; a Redo of its step replays its landing (R9, R16) — heard\n    // first, by the parts of the run (`use-assembled.tsx`), through a ref: they are built once the rows and their words are.\n    const actedRef = useRef<(action: HistoryAction, redoOrigin: string | undefined) => void>(() => undefined);\n    // The host hears each step (#1533), through a ref: the history's one runner stays as it is.\n    const onHistoryRef = useRef(host.onHistory);\n    onHistoryRef.current = host.onHistory;\n    const executeHistory = useCallback((action: HistoryAction) => {\n        actedRef.current(action, session.nextRedo?.origin);\n        // The footer's message said what the last gesture did: a step of the history moves past it (F13 of the hand test).\n        if (action !== \"refresh\") dispatchStore({ t: \"patch\", patch: { msg: null } });\n        // Told before the step, as the session stands; what it answers once the step is taken.\n        const after = action === \"refresh\" ? undefined : onHistoryRef.current?.(action, session);\n        if (action === \"apply\") void session.apply().then(after);\n        else if (action === \"refresh\") session.refresh();\n        else {\n            session[action]();\n            after?.();\n        }\n    }, [session, dispatchStore]);\n    const onHistoryAction = useCallback((action: HistoryAction) => {\n        // The lock (R2): no history action while a run's call is out — its item says so, and the keys are ignored.\n        if (locked) return;\n        if (uiRef.current.edit !== null && action !== \"refresh\") {\n            pendingHistoryAction.current = action;\n            dispatch({ t: \"editor.blur\" });\n        } else executeHistory(action);\n    }, [dispatch, executeHistory, locked, uiRef]);\n    useLayoutEffect(() => {\n        const action = pendingHistoryAction.current;\n        if (action === undefined) return;\n        pendingHistoryAction.current = undefined;\n        if (ui.edit === null) executeHistory(action);\n    }, [ui.edit, store.fxSeq, executeHistory]);\n\n    const pendingDiscard = useRef<{ id: string; child: string | undefined } | undefined>(undefined);\n    const executeDiscard = useCallback((id: string, child?: string) => {\n        if (!canEdit) return;\n        if (discardDraft(session, draftType, childField, id, child)) {\n            dispatchStore({ t: \"patch\", patch: { sugg: null, msg: { id: \"discarded\" } } });\n            cardRef.current?.focus({ preventScroll: true });\n        }\n    }, [session, draftType, childField, canEdit, cardRef, dispatchStore]);\n    const onDiscardDraft = useCallback((id: string, child?: string) => {\n        const open = uiRef.current.edit;\n        if (open !== null) {\n            const item = rowAt(open.r);\n            const target = item?.kind === \"group\" ? child === undefined && item.row.id === id\n                : item?.kind === \"real\" && (item.group !== undefined\n                    ? item.group.row.id === id && (child === undefined || item.group.key === child)\n                    : child === undefined && item.row.id === id);\n            if (!target) {\n                // Finish another row's editor before changing the row space.\n                pendingDiscard.current = { id, child };\n                dispatch({ t: \"editor.blur\" });\n                return;\n            }\n            // A discarded draft includes its uncommitted editor buffer.\n            dispatch({ t: \"editor.key\", key: \"Escape\", shift: false, meta: false, alt: false, atEnd: true });\n        }\n        executeDiscard(id, child);\n    }, [rowAt, dispatch, executeDiscard, uiRef]);\n    // The rows' one discard: stable, so no row's memo sees it change (#858).\n    const discardRef = useRef(onDiscardDraft);\n    discardRef.current = onDiscardDraft;\n    const onRowDiscard = useCallback((id: string, child?: string) => discardRef.current(id, child), []);\n    useLayoutEffect(() => {\n        const target = pendingDiscard.current;\n        if (target === undefined || ui.edit !== null) return;\n        pendingDiscard.current = undefined;\n        executeDiscard(target.id, target.child);\n    }, [ui.edit, store.fxSeq, executeDiscard]);\n\n    // Insertion retains identities while an open editor commits, then resolves\n    // the destination against the latest local collection.\n    const pendingInsertion = useRef<{ request: InsertRequest; from?: SheetInsertFrom | undefined; key?: string | undefined } | undefined>(undefined);\n    /**\n     * The row a gesture made, set or moved, once the body holds it: its\n     * editor opens on an insert of the sheet's own — or, where a host names\n     * the column (#1533), the ring lands there, a cell that edits out of place\n     * opening where the host edits it and any other its editor; after a drop\n     * (#1187) it is selected — on the column a card set first, when the grid\n     * shows it.\n     */\n    const pendingInsertFocus = useRef<{ id: string; child?: string; edit: boolean; key?: string | undefined } | undefined>(undefined);\n    const anchorFor = useCallback((r: number, side: \"before\" | \"after\"): InsertionAnchor => anchorAt(rowAt(r), side), [rowAt]);\n    /**\n     * Inserts a row or a group where a request says, as one transaction —\n     * seeded and labelled as a drop says, when it is one (#1187).\n     *\n     * @param request - What to insert, and where\n     * @param from - A drop's seeds and origin\n     * @param key - The column the ring lands on in the new row — a host's (#1533); the driver's, else the first editable, by default\n     * @returns Whether the session recorded it\n     */\n    const executeInsertion = useCallback((request: InsertRequest, from?: SheetInsertFrom, key?: string): boolean => {\n        if (!canEdit || !editingState.available || (request.kind === \"row\" ? !canInsertRows : !canInsertGroups)) return false;\n        // A new entry whose key is refused, or a gesture the session cannot take, inserts nothing: the footer says why (#1536).\n        try {\n            const gesture = insertionGesture(request, rows, (i) => runLayout.positions[i] ?? endPosition, group !== undefined, keyed,\n                () => mintAmong(takenKeys()), mintLineKey, loose);\n            if (gesture === undefined) return false;\n            const recorded = recordGesture([gesture.event], gesture.placement === undefined ? undefined : new Map([[gesture.id, gesture.placement]]), from?.origin ?? \"insert\", undefined, from?.seeds);\n            if (!recorded) return false;\n            pendingInsertFocus.current = { id: gesture.id, ...(gesture.child === undefined ? {} : { child: gesture.child }), edit: from === undefined, key };\n        } catch (error) {\n            failed(error);\n            return false;\n        }\n        // A drop is announced by the drag layer: the footer says nothing more.\n        dispatchStore({ t: \"patch\", patch: { sugg: null, selEnd: null, ...(from !== undefined ? {} : { msg: request.kind === \"group\" ? { id: \"newGroup\", noun: declaredNoun?.singular } : { id: \"newRow\" } }) } });\n        return true;\n    }, [canEdit, editingState.available, canInsertRows, canInsertGroups, rows, runLayout, endPosition, group, loose, declaredNoun, keyed, takenKeys, mintAmong, failed, recordGesture, dispatchStore]);\n    /** An insertion — once an open editor has committed. */\n    const insertWhenClosed = useCallback((request: InsertRequest, from?: SheetInsertFrom, key?: string): boolean => {\n        if (uiRef.current.edit === null) return executeInsertion(request, from, key);\n        pendingInsertion.current = { request, from, key };\n        dispatch({ t: \"editor.blur\" });\n        return true;\n    }, [dispatch, executeInsertion, uiRef]);\n    const onInsert = useCallback((kind: \"row\" | \"group\", r: number, side: \"before\" | \"after\") => {\n        insertWhenClosed({ kind, anchor: anchorFor(r, side) });\n    }, [anchorFor, insertWhenClosed]);\n    useLayoutEffect(() => {\n        if (ui.edit !== null || pendingInsertion.current === undefined) return;\n        const { request, from, key } = pendingInsertion.current;\n        pendingInsertion.current = undefined;\n        executeInsertion(request, from, key);\n    }, [ui.edit, store.fxSeq, executeInsertion]);\n    useLayoutEffect(() => {\n        const target = pendingInsertFocus.current;\n        if (target === undefined) return;\n        const id = target.child === undefined ? target.id : lineId(target.id, target.child);\n        const r = rowOf(id);\n        if (r === undefined) {\n            const parentR = rowOf(target.id);\n            if (target.child !== undefined && parentR !== undefined && rowAt(parentR)?.kind === \"group\") {\n                const parent = rowAt(parentR);\n                if (parent?.kind === \"group\" && parent.folded) dispatch({ t: \"fold.toggle\", r: parentR });\n            }\n            return;\n        }\n        pendingInsertFocus.current = undefined;\n        const item = rowAt(r);\n        // The view on the row, whatever the ring does: a row put where the ring stood — the ring keeps its place as the\n        // sheet's own rows move under it — leaves the ring no move to make, and so no scroll of its own to ask for. A\n        // fresh request, for the last may have named the index the row now holds.\n        const bi = rowSpace.bodyIndexOf[r];\n        if (bi !== undefined) setScrollTarget({ index: bi, align: \"auto\" }, true);\n        if (!target.edit) {\n            // A drop's row, selected: on the column a card set first, else where the ring was.\n            const keyC = target.key === undefined ? -1 : columns.list.findIndex(col => col.key === target.key);\n            dispatch({ t: \"select.move\", r, c: item?.kind === \"group\" ? 0 : keyC >= 0 ? keyC : uiRef.current.sel.c });\n            return;\n        }\n        if (item?.kind === \"group\" && item.folded) dispatch({ t: \"fold.toggle\", r });\n        const keyC = target.key === undefined || item?.kind === \"group\" ? -1 : columns.list.findIndex(col => col.key === target.key);\n        if (keyC >= 0) {\n            // A host's column (#1533): the ring on it — and a cell that edits out of place opens where the host edits it,\n            // as a press on it does.\n            if (ctxRef.current.opensAt?.(r, keyC) === true) {\n                dispatch({ t: \"select.move\", r, c: keyC });\n                // The press's own effects, run here: a press dispatched in this commit too would leave the store its\n                // effects alone, the move's lost.\n                runEffects([{ t: \"focus.sheet\" }, { t: \"open\", r, c: keyC }]);\n                return;\n            }\n            // Else its editor opens in the cell, as the sheet's own insert's does — the move after it then moving nothing\n            // — or, where the cell takes no editor, the move lands the ring on it.\n            dispatch({ t: \"cell.dbl\", r, c: keyC });\n            dispatch({ t: \"select.move\", r, c: keyC });\n            return;\n        }\n        const driverC = columns.list.findIndex(col => col.editable && col.key === driverColumn);\n        const c = item?.kind === \"group\" ? 0 : driverC >= 0 ? driverC : Math.max(0, columns.list.findIndex(col => col.editable));\n        dispatch({ t: \"cell.dbl\", r, c });\n    }, [rows, rowOf, rowAt, columns, driverColumn, dispatch, ctxRef, uiRef, rowSpace, setScrollTarget, runEffects]);\n    return { actedRef, anchorFor, insertWhenClosed, onHistoryAction, onInsert, onRowDiscard, pendingInsertFocus };\n}\n\n/** What {@link useSheetGestures} gives the parts after it. */\nexport type SheetGestures = ReturnType<typeof useSheetGestures>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A phone's column pager (`Mobile Sheet Spec.md` SH1, SH2): a 44px band over\n * the grid — the readout `Columns 1–2 of 3`, which opens the jump menu, and\n * ‹ › stepping the window a column. The window is the grid's own sideways\n * scroll, snapped to the columns past the pinned one (the recipe's\n * `scroll-snap`); the pager reads where it rests and moves it — over the\n * motion tokens' times, at once under reduced motion — so a swipe and a step\n * are one window. The jump menu lists every column but the pinned one, a\n * check on those in view and each column's kind, and a pick brings its column\n * into view; under a rule, where the grid has row numbers, `Row number` adds\n * the Row column, the row numbers as a column of the window, and puts the\n * window back at its start. ← and →\n * page it while the grid has the focus (SH8.1, {@link pageWindow}).\n *\n * @packageDocumentation\n */\n\nimport { memo, useEffect, useState } from \"react\";\nimport { Box, chakra, Menu as ChakraMenu } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCaretDown, faCaretUp, faCheck, faChevronLeft, faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { FrameMenuLayer, useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { useSheetWords } from \"./words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** Props of {@link SheetPager}. */\nexport interface SheetPagerProps {\n    styles: Styles;\n    /** The element the rows scroll in, sideways too: the window it moves. */\n    frame: HTMLElement | null;\n    /** The columns it pages: every column but the pinned one, in order — the Row column first, while it shows. */\n    columns: readonly SheetPagerColumn[];\n    /** A column's slot, px: the frame's width less the pinned column, shared by those in view. */\n    slotPx: number;\n    /** How many columns the window shows at once. */\n    inView: number;\n    /** Whether the Row column shows (SH2). */\n    rowNumbers: boolean;\n    /** Told as the viewer shows or hides the Row column; absent, the grid has no row numbers — a host's (#1536) — and the menu offers no `Row number`. */\n    onRowNumbers?: ((on: boolean) => void) | undefined;\n}\n\n/** A column of the window, as the jump menu lists it (SH2). */\nexport interface SheetPagerColumn {\n    key: string;\n    header: string;\n    /** Its kind, in words. */\n    kind: string;\n}\n\n/** The value of the jump menu's `Row number`, which no column's index is. */\nconst ROW_NUMBER_ITEM = \"row-number\";\n\n/** Whether the viewer asks for less motion: the window then jumps. */\nfunction reducedMotion(): boolean {\n    return typeof window.matchMedia === \"function\" && window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n}\n\n/**\n * Brings the window to a first column: one column over the base motion, more over the slow (SH1.2), at once under\n * reduced motion.\n *\n * @param frame - The element the rows scroll in\n * @param slotPx - A column's slot, px\n * @param last - The last first column the window can have\n * @param to - The first column asked for, held to the window's ends\n * @returns The first column it goes to\n */\nexport function pageWindow(frame: HTMLElement, slotPx: number, last: number, to: number): number {\n    const target = Math.min(last, Math.max(0, to));\n    frame.scrollTo({ left: target * slotPx, behavior: reducedMotion() ? \"auto\" : \"smooth\" });\n    return target;\n}\n\n/**\n * Reads where the window rests (SH1): its first column, off the frame as it scrolls — what the pager's readout says,\n * and a host's header cuts its group labels to (#1536).\n *\n * @param frame - The element the rows scroll in, sideways too; `null` reads nothing\n * @param slotPx - A column's slot, px\n * @param last - The last first column the window can have\n * @returns The first column in view, and a setter for a step's target, before the frame has moved to it\n */\nexport function useWindowFirst(frame: HTMLElement | null, slotPx: number, last: number): [number, (first: number) => void] {\n    const [first, setFirst] = useState(0);\n    useEffect(() => {\n        if (frame === null || slotPx <= 0) return undefined;\n        const read = () => setFirst(Math.min(last, Math.max(0, Math.round(frame.scrollLeft / slotPx))));\n        read();\n        frame.addEventListener(\"scroll\", read, { passive: true });\n        return () => frame.removeEventListener(\"scroll\", read);\n    }, [frame, slotPx, last]);\n    return [first, setFirst];\n}\n\n/** Renders a phone's column pager — see the module docs. */\nexport const SheetPager = memo(function SheetPager({ styles, frame, columns, slotPx, inView, rowNumbers, onRowNumbers }: SheetPagerProps) {\n    const words = useSheetWords();\n    const { m } = words;\n    const menuStyles = useSlotStyles(\"menu\");\n    const total = columns.length;\n    const last = Math.max(0, total - inView);\n    const [first, setFirst] = useWindowFirst(frame, slotPx, last);\n    const [open, setOpen] = useState(false);\n    const go = (to: number) => {\n        if (frame !== null) setFirst(pageWindow(frame, slotPx, last, to));\n    };\n    const shownTo = Math.min(total, first + inView);\n    const from = words.number(first + 1);\n    const to = words.number(shownTo);\n    return (\n        <Box css={styles.pager} data-slot=\"pager\">\n            <ChakraMenu.Root open={open} onOpenChange={(d) => setOpen(d.open)} positioning={{ placement: \"bottom-start\" }}\n                onSelect={(d) => {\n                    if (d.value === ROW_NUMBER_ITEM) return;\n                    const i = Number(d.value);\n                    // The pick into view: the window's first moved the least it must.\n                    if (i < first) go(i);\n                    else if (i >= first + inView) go(i - inView + 1);\n                }}>\n                <ChakraMenu.Trigger asChild>\n                    <chakra.button type=\"button\" css={styles.pagerReadout} data-slot=\"pagerReadout\"\n                        aria-label={m.pagerName({ from, to, n: total, total: words.number(total) })}>\n                        <span>{m.pagerColumns()} <b>{first + 1 === shownTo ? from : `${from}–${to}`}</b> {m.pagerOf({ n: total, total: words.number(total) })}</span>\n                        <Box as=\"span\" css={styles.pagerCaret} aria-hidden><FontAwesomeIcon icon={open ? faCaretUp : faCaretDown} /></Box>\n                    </chakra.button>\n                </ChakraMenu.Trigger>\n                <FrameMenuLayer label={m.pagerMenu()} css={styles.pagerMenu} data-slot=\"pagerMenu\">\n                            <ChakraMenu.ItemGroup>\n                                <ChakraMenu.ItemGroupLabel css={styles.pagerMenuHead}>{m.pagerMenu()}</ChakraMenu.ItemGroupLabel>\n                                {columns.map((col, i) => {\n                                    const shown = i >= first && i < shownTo;\n                                    return (\n                                        <ChakraMenu.Item key={col.key} value={String(i)} css={styles.pagerMenuItem} data-in-view={shown ? \"\" : undefined}>\n                                            <Box as=\"span\" css={styles.pagerMenuCheck} aria-hidden>{shown && <FontAwesomeIcon icon={faCheck} />}</Box>\n                                            <Box as=\"span\" css={styles.pagerMenuLabel}>{col.header}</Box>\n                                            <Box as=\"span\" css={[menuStyles.itemCommand, styles.pagerMenuKind]}>{col.kind}</Box>\n                                        </ChakraMenu.Item>\n                                    );\n                                })}\n                            </ChakraMenu.ItemGroup>\n                            {onRowNumbers !== undefined && (\n                                <>\n                                    <ChakraMenu.Separator />\n                                    <ChakraMenu.CheckboxItem value={ROW_NUMBER_ITEM} css={styles.pagerMenuItem} checked={rowNumbers} data-slot=\"pagerRowNumber\"\n                                        onCheckedChange={(on) => { onRowNumbers(on); go(0); }}>\n                                        <Box as=\"span\" css={styles.pagerMenuCheck} aria-hidden>{rowNumbers && <FontAwesomeIcon icon={faCheck} />}</Box>\n                                        <Box as=\"span\" css={styles.pagerMenuLabel}>{m.pagerRowNumber()}</Box>\n                                        <Box as=\"span\" css={[menuStyles.itemCommand, styles.pagerMenuKind]}>{m.pagerRowNumberNote()}</Box>\n                                    </ChakraMenu.CheckboxItem>\n                                </>\n                            )}\n                        </FrameMenuLayer>\n            </ChakraMenu.Root>\n            <chakra.button type=\"button\" css={styles.pagerStep} data-slot=\"pagerPrevious\" aria-label={m.pagerPrevious()}\n                aria-disabled={first <= 0 ? true : undefined} onClick={() => { if (first > 0) go(first - 1); }}>\n                <FontAwesomeIcon icon={faChevronLeft} />\n            </chakra.button>\n            <chakra.button type=\"button\" css={styles.pagerStep} data-slot=\"pagerNext\" aria-label={m.pagerNext()}\n                aria-disabled={first >= last ? true : undefined} onClick={() => { if (first < last) go(first + 1); }}>\n                <FontAwesomeIcon icon={faChevronRight} />\n            </chakra.button>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The pointer and the keyboard: the ring following a host's controlled selection, a press, a drag and a hover on a cell,\n * the grid's keys — the history's, ⏎ on an action cell, a phone's paging of the columns, the machine's — and the clipboard.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, type MouseEvent, type KeyboardEvent, type ClipboardEvent } from \"react\";\nimport { getSomeorUndefined, historyShortcut, takeKey } from \"@elaraai/east-ui-components\";\nimport { exportMatrix } from \"./clipboard.js\";\nimport { sheetReducer, selectionRect, type SheetEvent } from \"./sheet-state.js\";\nimport type { ActionCase } from \"./actions/model.js\";\nimport type { SheetActionHost } from \"./actions/host.js\";\nimport { pageWindow } from \"./Pager.js\";\nimport type { StripModel } from \"./Strip.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport type { SheetGestures } from \"./use-gestures.js\";\n\n/** The action cells' calls as the sheet stands (#1475): made afresh each render, read through a ref by the one host. */\nexport interface SheetActionApi extends Omit<SheetActionHost, \"subscribe\" | \"version\"> {\n    /** ⏎ on an action cell (K2). */\n    enter: (r: number, key: string) => void;\n    /** Take a case with its value at a cell — on a range down its column, every row of it (T8) — as one transaction (T1); `false` where a row may not take it. */\n    take: (r: number, key: string, c: ActionCase, value: unknown) => boolean;\n    /** Take a case with its value on rows, as one transaction. */\n    takeOn: (rs: readonly number[], key: string, c: ActionCase, value: unknown) => boolean;\n    /** The strip over an action (R2, R3), where it shows one. */\n    strip: () => StripModel | undefined;\n    /** What taking a case with a value would write, worded (F8). */\n    consequence: (c: ActionCase, value: unknown) => string;\n    /** Close the overlay (K6). */\n    close: () => void;\n    /** What taking a case with a value at a row would write, worded. */\n    consequenceAt: (r: number, key: string, c: ActionCase, value: unknown) => string;\n    /** What a case's form opens with at a row (F10). */\n    initial: (r: number, key: string, c: ActionCase) => unknown;\n}\n\n/**\n * Turns the pointer, the keys and the clipboard into the machine's events (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetEffects - The effect runner and what its effects reach\n * @param sheetGestures - The history's runner, the discard and the insertion\n * @returns The cells' and the grid's handlers\n */\nexport function useSheetInput(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetMachine: SheetMachine, sheetEffects: SheetEffects, sheetGestures: SheetGestures) {\n    const { columns, pagerColumns, phoneColumns, phoneFrame, selection, slotPx, words } = sheetDecode;\n    const { dispatchStore, setBarClosedAt, store } = sheetSession;\n    const { body, cellAt, rowAt, rowSpace } = sheetBody;\n    const { clearJump, ctxRef, dispatch, uiRef, viewportRef } = sheetMachine;\n    const { jumpBy, ringMoves, seekIntent } = sheetEffects;\n    const { onHistoryAction, onInsert } = sheetGestures;\n    // ── Controlled selection (§3.14) ──────────────────────────────────────\n    const controlledRowId = selection !== undefined ? getSomeorUndefined(selection.rowId) : undefined;\n    const controlledLine = selection !== undefined ? getSomeorUndefined(selection.line) : undefined;\n    const controlledKey = selection !== undefined ? getSomeorUndefined(selection.key) : undefined;\n    const controlledR = useMemo(() => {\n        if (controlledRowId === undefined) return undefined;\n        const bi = body.findIndex((it) =>\n            it.kind === \"real\"\n                ? (it.group !== undefined ? it.group.row.id === controlledRowId && it.group.key === controlledLine : it.row.id === controlledRowId)\n                : it.kind === \"group\" && it.row.id === controlledRowId && controlledLine === undefined);\n        return bi >= 0 ? rowSpace.rowOf[bi] : undefined;\n    }, [controlledRowId, controlledLine, body, rowSpace]);\n    const controlledC = useMemo(\n        () => (controlledKey === undefined ? undefined : columns.list.findIndex((c) => c.key === controlledKey)),\n        [controlledKey, columns],\n    );\n    useEffect(() => {\n        if (selection === undefined) return;\n        if (controlledR === undefined && (controlledC === undefined || controlledC < 0)) return;\n        const current = uiRef.current.sel;\n        dispatch({ t: \"select.set\", r: controlledR ?? current.r, c: controlledC !== undefined && controlledC >= 0 ? controlledC : current.c });\n    }, [selection, controlledR, controlledC, dispatch, uiRef]);\n\n    // The action cells' calls as the sheet stands (#1475): ⏎ on an action cell asks them, and the action column makes them.\n    const actionApi = useRef<SheetActionApi | undefined>(undefined);\n\n    // ── Input ─────────────────────────────────────────────────────────────\n    // A range drag is a press followed by pointer MOVEMENT; a mouseenter with\n    // no movement (the sheet moved under a stationary pointer — a paged\n    // window landing, a fill changing a row) never extends the range. The\n    // drag is over as its button lifts, and as much when its lift is never\n    // heard — let go off the window, or under another app: a move with the\n    // button no longer held ends it, and so does the window losing the page,\n    // so no range is left following a pointer that holds nothing (the rule\n    // every gesture is held to, east-ui-components' `src/pointer/`).\n    const pressed = useRef(false);\n    const dragging = useRef(false);\n    useEffect(() => {\n        const up = () => { pressed.current = false; dragging.current = false; };\n        const move = (e: globalThis.MouseEvent) => {\n            if ((e.buttons & 1) === 0) up();\n            else if (pressed.current) dragging.current = true;\n        };\n        window.addEventListener(\"mouseup\", up);\n        window.addEventListener(\"mousemove\", move);\n        window.addEventListener(\"blur\", up);\n        return () => {\n            window.removeEventListener(\"mouseup\", up);\n            window.removeEventListener(\"mousemove\", move);\n            window.removeEventListener(\"blur\", up);\n        };\n    }, []);\n    /**\n     * A gesture on the ring (#860): counted — a key's move past the rows read lands only if none came after it — and,\n     * when it is no such move itself, it abandons one still on its way at once, the rows that move holds put back as\n     * they were (#1398, CL10): a window landing after the gesture never draws its rows over the place the viewer is at.\n     */\n    const ringGesture = useCallback((seeks = false) => {\n        ringMoves.current += 1;\n        if (seeks || seekIntent.current === undefined || jumpBy.current !== \"key\") return;\n        seekIntent.current = undefined;\n        clearJump();\n    }, [clearJump, jumpBy, ringMoves, seekIntent]);\n    const onCellDown = useCallback((r: number, c: number, e: MouseEvent) => {\n        if (e.button !== 0) return;\n        e.preventDefault();\n        pressed.current = !e.shiftKey;\n        dragging.current = false;\n        ringGesture();\n        // A press opens a phone's action bar again, wherever it was closed (SH9).\n        setBarClosedAt(undefined);\n        dispatch({ t: \"cell.down\", r, c, shift: e.shiftKey });\n    }, [dispatch, ringGesture, setBarClosedAt]);\n    const onCellDouble = useCallback((r: number, c: number) => { ringGesture(); dispatch({ t: \"cell.dbl\", r, c }); }, [dispatch, ringGesture]);\n    const onCellEnter = useCallback((r: number, c: number) => dispatch({ t: \"cell.enter\", r, c, dragging: dragging.current }), [dispatch]);\n    // The pointer leaving a host's grid (#1531): no cell is hovered, and its strip returns to the ring's cell.\n    const onGridLeave = useCallback(() => dispatch({ t: \"cell.leave\" }), [dispatch]);\n    const onRowPick = useCallback((r: number, e: MouseEvent) => {\n        if (e.button !== 0) return;\n        e.preventDefault();\n        ringGesture();\n        dispatch({ t: \"row.pick\", r, shift: e.shiftKey });\n    }, [dispatch, ringGesture]);\n    const onTake = useCallback((key: string) => dispatch({ t: \"fill.take\", key }), [dispatch]);\n    const onFillRow = useCallback(() => dispatch({ t: \"fill.row\" }), [dispatch]);\n    const onProposalPick = useCallback((i: number) => dispatch({ t: \"proposal.pick\", i }), [dispatch]);\n    const onProposalAccept = useCallback((i: number) => dispatch({ t: \"proposal.take\", i }), [dispatch]);\n    const onProposalReject = useCallback((i: number) => dispatch({ t: \"proposal.reject\", i }), [dispatch]);\n    // Every key the grid acts on goes no further than the Sheet (#1398): a printable key that starts an edit — `[` among\n    // them — never reaches a shortcut of the page around it.\n    const onKeyDown = useCallback((e: KeyboardEvent<HTMLDivElement>) => {\n        if (store.ui.edit !== null) return;\n        if (e.altKey && e.key === \"Insert\") {\n            takeKey(e); ringGesture(); onInsert(\"row\", store.ui.sel.r, e.shiftKey ? \"before\" : \"after\"); return;\n        }\n        const meta = e.metaKey || e.ctrlKey;\n        // The history keys every collection shares (#988).\n        const historyKey = historyShortcut(e);\n        if (historyKey !== undefined) {\n            takeKey(e);\n            ringGesture();\n            onHistoryAction(historyKey);\n            return;\n        }\n        // The browser's own clipboard keys become copy / paste events.\n        if (meta && (e.key === \"c\" || e.key === \"v\" || e.key === \"x\" || e.key === \"a\")) return;\n        // ⏎ on an action cell takes the offer's first case (K2): a button at once, a choice's Menu, a form's Popover.\n        const single = store.ui.selEnd === null || (store.ui.selEnd.r === store.ui.sel.r && store.ui.selEnd.c === store.ui.sel.c);\n        if (e.key === \"Enter\" && !e.shiftKey && !meta && !e.altKey && single && !store.ui.ringless) {\n            const at = ctxRef.current.kindAt(store.ui.sel.r, store.ui.sel.c) === \"action\" ? columns.list[store.ui.sel.c] : undefined;\n            if (at !== undefined) {\n                takeKey(e);\n                actionApi.current?.enter(store.ui.sel.r, at.key);\n                return;\n            }\n        }\n        // On a phone's frame ← and → page the columns while the grid has the focus, the ring where it is (SH8.1, R4).\n        if (phoneFrame && (e.key === \"ArrowLeft\" || e.key === \"ArrowRight\") && !e.shiftKey && !meta && !e.altKey) {\n            takeKey(e);\n            const frame = viewportRef.current?.frame;\n            if (frame !== undefined && slotPx > 0) {\n                const first = Math.round(frame.scrollLeft / slotPx);\n                pageWindow(frame, slotPx, Math.max(0, pagerColumns.length - phoneColumns), first + (e.key === \"ArrowRight\" ? 1 : -1));\n            }\n            return;\n        }\n        const handled = [\"ArrowDown\", \"ArrowUp\", \"ArrowLeft\", \"ArrowRight\", \"Home\", \"End\", \"PageUp\", \"PageDown\", \"Tab\", \"Enter\", \"F2\", \"Escape\", \"Backspace\", \"Delete\"];\n        const printable = e.key.length === 1 && !meta && !e.altKey;\n        const toSearch = meta && (e.key === \"/\" || e.key === \"f\");\n        if (!handled.includes(e.key) && !printable && !toSearch) return;\n        // A Tab the sheet has no use for — the ring on the row's last column\n        // (⇧: its first), nothing pending — is the browser's (#860): focus\n        // leaves the grid, which is never a keyboard trap. The reducer is\n        // pure, so asking it is free.\n        if (e.key === \"Tab\") {\n            const probe = sheetReducer(uiRef.current, { t: \"key\", key: \"Tab\", shift: e.shiftKey, meta, alt: e.altKey }, ctxRef.current);\n            if (probe.state === uiRef.current && probe.effects.length === 0) return;\n        }\n        takeKey(e);\n        const event: SheetEvent = { t: \"key\", key: e.key, shift: e.shiftKey, meta, alt: e.altKey };\n        // A key that goes past the rows read again takes a move still on its way over (#1398): asked of the pure reducer.\n        const seeks = seekIntent.current !== undefined\n            && sheetReducer(uiRef.current, event, ctxRef.current).effects.some((fx) => fx.t === \"seek.step\" || fx.t === \"seek.edge\");\n        ringGesture(seeks);\n        dispatch(event);\n    }, [dispatch, store.ui.edit, store.ui.sel.r, store.ui.sel.c, store.ui.selEnd, store.ui.ringless, columns, onHistoryAction, onInsert, ringGesture, phoneFrame, slotPx, pagerColumns, phoneColumns, ctxRef, seekIntent, uiRef, viewportRef]);\n    // A band never copies (G9): a whole-group selection copies its lines.\n    const isBandRow = useCallback((r: number) => { const k = rowAt(r)?.kind; return k === \"group\"; }, [rowAt]);\n    const onCopy = useCallback((e: ClipboardEvent<HTMLDivElement>) => {\n        // With no ring placed, nothing is selected to copy (#1531).\n        if (store.ui.edit !== null || store.ui.ringless) return;\n        e.preventDefault();\n        const rect = selectionRect(store.ui);\n        e.clipboardData.setData(\"text/plain\", exportMatrix(cellAt, columns.list, rect, words, isBandRow));\n        let copied = 0;\n        for (let r = rect.r0; r <= rect.r1; r++) if (!isBandRow(r)) copied += 1;\n        dispatchStore({ t: \"patch\", patch: { msg: { id: \"copied\", rows: copied, cols: rect.c1 - rect.c0 + 1 } } });\n    }, [store.ui, cellAt, columns, isBandRow, words, dispatchStore]);\n    const onPaste = useCallback((e: ClipboardEvent<HTMLDivElement>) => {\n        if (store.ui.edit !== null) return;\n        const text = e.clipboardData.getData(\"text/plain\");\n        if (text === \"\") return;\n        e.preventDefault();\n        dispatch({ t: \"clipboard.paste\", text });\n    }, [dispatch, store.ui.edit]);\n    return {\n        actionApi, onCellDouble, onCellDown, onCellEnter, onCopy, onFillRow, onGridLeave, onKeyDown, onPaste,\n        onProposalAccept, onProposalPick, onProposalReject, onRowPick, onTake, ringGesture,\n    };\n}\n\n/** What {@link useSheetInput} gives the parts after it. */\nexport type SheetInput = ReturnType<typeof useSheetInput>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The overlay editor (B§4.4 / B§6): the cell's field at inset −1 with the\n * 2 px brand ring, and the neg ring when the last commit was unrecognised.\n * The ring IS the field chrome — every field inside it is borderless.\n *\n * Which field depends on the column kind:\n *\n * - a **date** column mounts the common date field (the segmented\n *   `dd / mm / yyyy` control the `Input` renderer uses) — digits fill the\n *   segments, ↑ / ↓ step one, ← / → move between them, ⇥ leaves the last\n *   segment for the next cell; the buffer the machine holds is the date's\n *   edit form, so the commit parses exactly what the field shows;\n * - a **quantity** / **integer** column mounts the common number field\n *   (the stepper column on its right edge, ↑ / ↓ step), which takes what the\n *   quantity grammar reads — digits, the decimal separator, a `k` or `m`;\n * - a **text** / **custom** column mounts the common text input;\n * - the **register kinds** (lookup · reference) keep the typed buffer — one\n *   mono input with the inline ghost drawn in a mirror behind the caret, a\n *   `→ replacement` preview and a `k/n` badge — because their candidates\n *   live in the docked strip, never in a popover (B§9);\n * - an **enum** column — and a Record's **person** column, the menu of its\n *   register's people — mounts the common combobox the way a\n *   date column mounts the common date field: the Chakra combobox parts\n *   over the machine's own buffer and candidates (`options`, best first),\n *   each option its member in the words its cell shows, the list open while\n *   the editor is, the armed candidate highlighted, a click on an option\n *   committing that member. The machine keeps every key — ⏎ ⇥ esc ↑ ↓ are\n *   captured before the combobox sees them;\n * - a **link** / **set** column draws BOTH halves on the cell's own grid:\n *   the active half carries a 1.5 px brand underline and the only input;\n *   the other half's chips are clickable to move the caret. Existing content\n *   is chips; the buffer resolves to chips on `,` / ⏎ / a hop; ⇧← / ⇧→ select\n *   whole chips. Focus moving between the two halves is not leaving the cell.\n *\n * The editor stops keyboard propagation: the sheet owns every other key.\n */\n\nimport { memo, useEffect, useMemo, useRef, type KeyboardEvent, type ChangeEvent, type FocusEvent, type InputEvent, type MouseEvent, type ReactNode } from \"react\";\nimport { Box, Combobox as ChakraCombobox, Input as ChakraInput, NumberInput as ChakraNumberInput, Portal, chakra, createListCollection, useCombobox } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowRightLong, faChevronDown, faChevronUp, faMinus } from \"@fortawesome/free-solid-svg-icons\";\nimport type { DateValue } from \"@internationalized/date\";\nimport { CompoundDateField, CompoundDateInput, CompoundDateSegment, dateToCalendarDate, dateValueToDate, useDensity } from \"@elaraai/east-ui-components/internal\";\nimport { memberIsDashed, memberLabel, type SheetKind } from \"./model.js\";\nimport { formatDateEdit, splitTimeToken, type WhenLevel } from \"./parse/date.js\";\nimport { formatNumberBare, typedQuantity } from \"./parse/quantity.js\";\nimport type { LinkVocabulary } from \"./link/grammar.js\";\nimport type { LinkHalves } from \"./link/sides.js\";\nimport type { LinkGroups } from \"./sheet-state.js\";\nimport type { SheetMemberValue } from \"./values.js\";\nimport { useSheetWords } from \"./words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** A focus request — bumped by the machine's `focus.editor` effect. */\nexport interface EditorFocusRequest {\n    seq: number;\n    selectAll: boolean;\n}\n\n/** The link editor's view. */\nexport interface LinkEditorView {\n    side: 0 | 1;\n    halves: LinkHalves;\n    groups: LinkGroups;\n    /** The flat chip range under the selection. */\n    chipSel: { lo: number; hi: number } | null;\n    /** The predicted members per half (P4). */\n    predicted: [readonly SheetMemberValue[], readonly SheetMemberValue[]];\n    vocab: LinkVocabulary | undefined;\n    /** Bumps on a hop — the new half's input takes focus. */\n    hop: number;\n    /** A `set` column — one half, no arrow. */\n    single: boolean;\n}\n\n/** One option of a combobox column's menu: a register member, best first — its key, and the words its cell shows. */\nexport interface EditorOption {\n    key: string;\n    label: string;\n    meta?: string | undefined;\n    tone?: string | undefined;\n}\n\n/** The keys the machine sees from the editor. */\nexport interface EditorKey {\n    key: string;\n    shift: boolean;\n    meta: boolean;\n    alt: boolean;\n    atEnd: boolean;\n}\n\nexport interface SheetEditorProps {\n    styles: Styles;\n    /** The column kind — which field the ring holds. */\n    kind: SheetKind;\n    value: string;\n    /** A date column's buffer as a date (`undefined` while the buffer is empty or incomplete). */\n    date: Date | undefined;\n    /** The printable key that opened the editor, if one did — the date field types it into its first segment. */\n    seed: string | undefined;\n    /** The inline ghost (the top prefix candidate's suffix). */\n    ghost: string;\n    /** A non-prefix match, previewed as a replacement. */\n    resolve: string;\n    /** `k/n` over the candidates. */\n    badge: string;\n    /** The neg ring. */\n    error: boolean;\n    focus: EditorFocusRequest;\n    ariaLabel: string;\n    /** The link editor, on a link / set column. */\n    link: LinkEditorView | undefined;\n    /** An enum column's options (the machine's candidates), best first. */\n    options?: readonly EditorOption[] | undefined;\n    /** The armed option's index (`-1` = none armed). */\n    highlighted?: number | undefined;\n    /** Browsing: the buffer is a whole option (or empty), so ↑ ↓ step the buffer through the options here instead of the machine's candidates. */\n    browse?: boolean | undefined;\n    /** A click on an option: the sheet writes its member and moves on. */\n    onPick?: ((option: EditorOption) => void) | undefined;\n    /** ↑ ↓ while browsing reach an option: the buffer holds its member — the one of two who share its words. */\n    onBrowse?: ((option: EditorOption) => void) | undefined;\n    /** A date column's level for this row (#844): at `time` the field grows a time box. */\n    whenLevel?: WhenLevel | undefined;\n    onChange: (val: string) => void;\n    onKey: (e: EditorKey) => boolean;\n    onBlur: () => void;\n    onHalfDown: (side: 0 | 1) => void;\n}\n\nconst NO_OPTIONS: readonly EditorOption[] = [];\n/** The keys the machine owns on the combobox — captured before the combobox's own handlers. */\nconst COMBOBOX_MACHINE_KEYS = new Set([\"Enter\", \"Escape\", \"Tab\", \"ArrowUp\", \"ArrowDown\"]);\n\n/**\n * The number field's own format, in the viewer's language (#852): the bare\n * edit form, never grouped — `1234,5` in German. Without format options the\n * field reads with `parseFloat` and prints with `String` whatever its locale,\n * so `1234,5` would open as `1234`. Fifteen significant digits: a float prints\n * as it was written up to there (it carries about sixteen). The field shows\n * the bare form; what it TAKES as it is typed is the grammar's to say, never\n * this format's ({@link SheetEditor}'s number field). On ⏎ and on a blur\n * the field rewrites its value in this format, but its handlers run after\n * the editor's (Zag merges the given handlers first), so a commit always\n * reads the buffer, never that rewrite.\n */\nconst NUMBER_FORMAT: Intl.NumberFormatOptions = { useGrouping: false, maximumSignificantDigits: 15 };\n/** An integer column's number field: whole numbers, every digit. */\nconst INTEGER_FORMAT: Intl.NumberFormatOptions = { useGrouping: false, maximumFractionDigits: 0 };\n\n/** The window after a hop in which a blur is the OLD input going away, not the planner leaving. */\nconst HOP_GRACE_MS = 300;\n\n/** The register kinds — the typed buffer with the ghost mirror (B§3.1); an enum or a person column mounts the combobox instead. */\nfunction isRegisterKind(kind: SheetKind): boolean {\n    return kind === \"lookup\" || kind === \"reference\" || kind === \"enum\" || kind === \"person\";\n}\n\n/**\n * Whether a column's editor is the combobox: its register's members in a menu.\n *\n * @param kind - The column kind\n * @returns Whether it is an enum or a person column\n */\nexport function isComboboxKind(kind: SheetKind): boolean {\n    return kind === \"enum\" || kind === \"person\";\n}\n\n/** The keys a field hands the machine — the rest are the field's own. */\nfunction forwards(kind: SheetKind, key: string): boolean {\n    if (kind === \"quantity\" || kind === \"integer\") return key !== \"ArrowUp\" && key !== \"ArrowDown\" && key !== \"Home\" && key !== \"End\";\n    return true;\n}\n\n/** The date field's editable segments, in order. */\nfunction segmentsOf(root: HTMLElement | null): HTMLElement[] {\n    return root === null ? [] : [...root.querySelectorAll<HTMLElement>('[role=\"spinbutton\"]')];\n}\n\n/** Renders the overlay editor. */\nexport const SheetEditor = memo(function SheetEditor({ styles, kind, value, date, seed, ghost, resolve, badge, error, focus, ariaLabel, link, options, highlighted, browse, onPick, onBrowse, whenLevel, onChange, onKey, onBlur, onHalfDown }: SheetEditorProps) {\n    const density = useDensity();\n    const controlSize = density === \"comfortable\" ? \"md\" : density === \"condensed\" ? \"xs\" : \"sm\";\n    // The number field reads and steps the buffer in the viewer's language — the one the cells print and the grammar reads (#852) — and the editor speaks the sheet's words (#861).\n    const words = useSheetWords();\n    const { locale, m } = words;\n    const rootRef = useRef<HTMLDivElement | null>(null);\n    const inputRef = useRef<HTMLInputElement | null>(null);\n    const lastFocus = useRef(\"\");\n    const hopAt = useRef(0);\n    const seeded = useRef(false);\n    const isDate = link === undefined && kind === \"date\";\n    const isCombobox = link === undefined && isComboboxKind(kind);\n    // The combobox over the machine's candidates: the list is\n    // open while the editor is, the input is the buffer, the highlight is the\n    // armed candidate, and a selection (a click) is a pick.\n    const items = options ?? NO_OPTIONS;\n    const collection = useMemo(() => createListCollection<EditorOption>({ items: items as EditorOption[], itemToValue: (o) => o.key, itemToString: (o) => o.label }), [items]);\n    const armed = highlighted !== undefined && highlighted >= 0 ? items[highlighted]?.key ?? null : null;\n    const combobox = useCombobox<EditorOption>({\n        collection,\n        open: isCombobox,\n        inputValue: value,\n        value: [],\n        highlightedValue: armed,\n        inputBehavior: \"none\",\n        selectionBehavior: \"preserve\",\n        allowCustomValue: true,\n        loopFocus: false,\n        openOnClick: true,\n        closeOnSelect: false,\n        // No dismissable layer: the sheet owns esc and the outside press (the layer would take esc at the document before the machine hears it).\n        disableLayer: true,\n        positioning: { placement: \"bottom-start\", gutter: 4, sameWidth: false },\n        onInputValueChange: (d) => { if (d.inputValue !== value) onChange(d.inputValue); },\n        onValueChange: (d) => { const o = items.find((x) => x.key === d.value[0]); if (o !== undefined) onPick?.(o); },\n    });\n    const focusKey = `${focus.seq}:${link?.hop ?? 0}:${link?.side ?? -1}`;\n    // A PASSIVE effect, after the fields' own: the number field's machine\n    // starts, and the date field attaches its segment listeners, in their\n    // effects — a focus fired from a layout effect would reach a machine that\n    // has not started and a segment with no listener, and be dropped.\n    useEffect(() => {\n        if (lastFocus.current === focusKey) return;\n        lastFocus.current = focusKey;\n        hopAt.current = Date.now();\n        if (isDate) {\n            // The first segment takes focus; a printable key that opened the\n            // editor is typed into it, the way the field takes any digit.\n            const first = segmentsOf(rootRef.current)[0];\n            if (first === undefined) return;\n            first.focus({ preventScroll: true });\n            if (seed !== undefined && !seeded.current && typeof InputEvent !== \"undefined\") {\n                seeded.current = true;\n                first.dispatchEvent(new InputEvent(\"beforeinput\", { data: seed, inputType: \"insertText\", bubbles: true, cancelable: true }));\n            }\n            return;\n        }\n        const el = inputRef.current;\n        if (el === null) return;\n        el.focus({ preventScroll: true });\n        if (focus.selectAll && link === undefined) {\n            el.select();\n            // The combobox settles its own caret after focus; select again once it has.\n            if (isCombobox) requestAnimationFrame(() => { if (document.activeElement === el) el.select(); });\n        } else el.setSelectionRange(el.value.length, el.value.length);\n    }, [focusKey, focus.selectAll, link, isDate, isCombobox, seed]);\n\n    const forward = (e: KeyboardEvent<HTMLElement>, atEnd: boolean): boolean =>\n        onKey({ key: e.key, shift: e.shiftKey, meta: e.metaKey || e.ctrlKey, alt: e.altKey, atEnd });\n    const handleKey = (e: KeyboardEvent<HTMLInputElement>) => {\n        e.stopPropagation();\n        if (!forwards(kind, e.key)) return;\n        const el = e.currentTarget;\n        const atEnd = el.selectionStart === el.value.length && el.selectionEnd === el.value.length;\n        if (forward(e, atEnd)) e.preventDefault();\n    };\n    // The number field takes what the quantity grammar reads, not what its own\n    // format does: that dropped a key without a word, so `1.005k` read 1.005\n    // and `2.5` in an integer column 25. A `k` or `m` completing a number\n    // turns the text into that number, so the field steps from it; a fraction\n    // in an integer column stays, for the strip to call unrecognised and the\n    // commit to refuse. Judged here, on the way down, the key never reaches\n    // the field's own check on the input.\n    const handleNumberInput = (e: InputEvent<HTMLDivElement>) => {\n        const el = inputRef.current;\n        if (el === null || e.target !== el) return;\n        e.stopPropagation();\n        const at = el.selectionStart ?? el.value.length;\n        const typed = typedQuantity(`${el.value.slice(0, at)}${e.data}${el.value.slice(el.selectionEnd ?? at)}`, words.separators);\n        if (typed.kind === \"take\") return;\n        e.preventDefault();\n        if (typed.kind === \"read\") onChange(formatNumberBare(typed.n, words));\n    };\n    // The date field owns its keys (digits, arrows, backspace); ⏎ and esc are\n    // the sheet's, and ⇥ is the sheet's only at the edge segments.\n    const handleDateKey = (e: KeyboardEvent<HTMLDivElement>) => {\n        if (e.key === \"Enter\" || e.key === \"Escape\") { e.stopPropagation(); if (forward(e, true)) e.preventDefault(); return; }\n        if (e.key !== \"Tab\") return;\n        const segments = segmentsOf(rootRef.current);\n        const active = typeof document !== \"undefined\" ? document.activeElement : null;\n        const edge = e.shiftKey ? segments[0] : segments[segments.length - 1];\n        if (edge !== undefined && edge === active && forward(e, true)) { e.preventDefault(); e.stopPropagation(); }\n    };\n    const handleChange = (e: ChangeEvent<HTMLInputElement>) => onChange(e.target.value);\n    // The buffer's trailing time survives a change of day.\n    const timeToken = (): string => { const t = value.trim(); const { rest } = splitTimeToken(t); return t.length > rest.length ? t.slice(rest.length).trim() : \"\"; };\n    const handleDateChange = (next: DateValue | null) => {\n        if (next === null) { onChange(\"\"); return; }\n        const tok = timeToken();\n        onChange(`${formatDateEdit(dateValueToDate(next))}${tok !== \"\" ? ` ${tok}` : \"\"}`);\n    };\n    const setTimeToken = (tok: string) => { const { rest } = splitTimeToken(value); onChange(`${rest}${tok !== \"\" ? ` ${tok}` : \"\"}`.trim()); };\n    const handleTimeKey = (e: KeyboardEvent<HTMLInputElement>) => {\n        if (e.key === \"Enter\" || e.key === \"Escape\" || e.key === \"Tab\") { e.stopPropagation(); if (forward(e, true)) e.preventDefault(); return; }\n        e.stopPropagation();\n    };\n    // The combobox: the machine's keys are taken here, before the combobox's own handlers see them.\n    const handleComboboxKeyCapture = (e: KeyboardEvent<HTMLElement>) => {\n        if (!COMBOBOX_MACHINE_KEYS.has(e.key)) return;\n        e.stopPropagation();\n        // Browsing: ↑ ↓ step the buffer through the options — by member, so a namesake is reached too; ⏎ then commits it.\n        if (browse === true && (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") && items.length > 0) {\n            e.preventDefault();\n            const i = highlighted ?? -1;\n            const next = e.key === \"ArrowDown\" ? Math.min(i + 1, items.length - 1) : Math.max(i - 1, 0);\n            const o = items[next];\n            if (o !== undefined && next !== i) onBrowse?.(o);\n            return;\n        }\n        const el = inputRef.current;\n        const atEnd = el === null || (el.selectionStart === el.value.length && el.selectionEnd === el.value.length);\n        // Typing: ↑ ↓ step the machine's candidates (its ⌥↑ / ⌥↓), never leave the cell — the list is what is being stepped.\n        if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n            e.preventDefault();\n            onKey({ key: e.key, shift: e.shiftKey, meta: e.metaKey || e.ctrlKey, alt: true, atEnd });\n            return;\n        }\n        if (forward(e, atEnd)) e.preventDefault();\n    };\n    const handleBlur = (e: FocusEvent<HTMLElement>) => {\n        // Focus moving inside the editor (between the two halves, the date's\n        // segments, the number field's steppers) is not leaving the cell; an\n        // input unmounting under a hop is not the planner leaving either.\n        const to = e.relatedTarget as HTMLElement | null;\n        if (to !== null && rootRef.current !== null && rootRef.current.contains(to)) return;\n        // The combobox's list lives in a portal: a press on it is not leaving either.\n        if (to !== null && to.closest('[data-scope=\"combobox\"][data-part=\"content\"]') !== null) return;\n        if (!e.currentTarget.isConnected) return;\n        if (Date.now() - hopAt.current < HOP_GRACE_MS) return;\n        onBlur();\n    };\n    const stop = (e: { stopPropagation: () => void }) => e.stopPropagation();\n\n    /** The typed buffer with the ghost mirror — the register kinds and the link halves. */\n    const typed = (side: 0 | 1 | undefined) => (\n        <Box css={styles.editorField} style={link !== undefined ? { flex: \"1\", minWidth: \"24px\", height: \"22px\" } : undefined}>\n            <Box css={styles.editorMirror} aria-hidden=\"true\">\n                <span style={{ visibility: \"hidden\" }}>{value}</span>\n                <Box as=\"span\" css={styles.editorGhost} data-slot=\"editorGhost\">{ghost}</Box>\n            </Box>\n            <chakra.input\n                ref={inputRef}\n                css={styles.editorInput}\n                value={value}\n                aria-label={ariaLabel}\n                aria-autocomplete=\"inline\"\n                data-slot=\"editorInput\"\n                data-side={side}\n                onChange={handleChange}\n                onKeyDown={handleKey}\n                onBlur={handleBlur}\n                onCopy={stop}\n                onPaste={stop}\n            />\n        </Box>\n    );\n\n    /** The common text input, borderless inside the ring. */\n    const text = (\n        <Box css={styles.editorField}>\n            <ChakraInput\n                unstyled\n                ref={inputRef}\n                css={styles.editorInput}\n                value={value}\n                aria-label={ariaLabel}\n                data-slot=\"editorInput\"\n                onChange={handleChange}\n                onKeyDown={handleKey}\n                onBlur={handleBlur}\n                onCopy={stop}\n                onPaste={stop}\n            />\n        </Box>\n    );\n\n    /** The common number field: the input and its stepper column — Font Awesome's chevrons (#1263) — borderless inside the ring. */\n    const number = (\n        <ChakraNumberInput.Root\n            size={controlSize}\n            css={styles.editorNumber}\n            data-slot=\"editorNumber\"\n            value={value}\n            locale={locale}\n            formatOptions={kind === \"integer\" ? INTEGER_FORMAT : NUMBER_FORMAT}\n            inputMode={kind === \"integer\" ? \"numeric\" : \"decimal\"}\n            onValueChange={(d) => onChange(d.value)}\n            onBeforeInputCapture={handleNumberInput}\n        >\n            <ChakraNumberInput.Input\n                ref={inputRef}\n                css={styles.editorNumberInput}\n                aria-label={ariaLabel}\n                data-slot=\"editorInput\"\n                onKeyDown={handleKey}\n                onBlur={handleBlur}\n                onCopy={stop}\n                onPaste={stop}\n            />\n            <ChakraNumberInput.Control css={styles.editorStepper} data-slot=\"editorStepper\">\n                <ChakraNumberInput.IncrementTrigger><FontAwesomeIcon icon={faChevronUp} /></ChakraNumberInput.IncrementTrigger>\n                <ChakraNumberInput.DecrementTrigger><FontAwesomeIcon icon={faChevronDown} /></ChakraNumberInput.DecrementTrigger>\n            </ChakraNumberInput.Control>\n        </ChakraNumberInput.Root>\n    );\n\n    /** The common combobox: the buffer as its input, the machine's candidates as its list. */\n    const comboboxField = (\n        <ChakraCombobox.RootProvider value={combobox} size={controlSize} css={styles.editorCombobox} data-slot=\"editorCombobox\" onKeyDownCapture={handleComboboxKeyCapture} onKeyDown={stop}>\n            <ChakraCombobox.Control unstyled css={styles.editorField}>\n                <ChakraCombobox.Input\n                    unstyled\n                    ref={inputRef}\n                    css={styles.editorInput}\n                    aria-label={ariaLabel}\n                    data-slot=\"editorInput\"\n                    onBlur={handleBlur}\n                    onCopy={stop}\n                    onPaste={stop}\n                />\n            </ChakraCombobox.Control>\n            <Portal>\n                <ChakraCombobox.Positioner css={styles.editorMenu} data-slot=\"editorMenu\">\n                    <ChakraCombobox.Content onMouseDown={(e) => e.preventDefault()}>\n                        {items.length === 0 && <ChakraCombobox.Empty css={styles.editorOptionMeta}>{m.editorNoOptions()}</ChakraCombobox.Empty>}\n                        {items.map((o) => (\n                            <ChakraCombobox.Item key={o.key} item={o} css={styles.editorOption} data-slot=\"editorOption\">\n                                {o.tone !== undefined && <Box as=\"span\" css={styles.cellDot} data-tone={o.tone} aria-hidden=\"true\" />}\n                                <ChakraCombobox.ItemText>{o.label}</ChakraCombobox.ItemText>\n                                {o.meta !== undefined && o.meta !== \"\" && <Box as=\"span\" css={styles.editorOptionMeta} data-slot=\"editorOptionMeta\">{o.meta}</Box>}\n                            </ChakraCombobox.Item>\n                        ))}\n                    </ChakraCombobox.Content>\n                </ChakraCombobox.Positioner>\n            </Portal>\n        </ChakraCombobox.RootProvider>\n    );\n\n    /** The common date field — the segmented control over the buffer's date; at the time level a time box follows it. */\n    const timeNow = (() => { const s = splitTimeToken(value); return s.time !== undefined ? `${String(s.time.hh).padStart(2, \"0\")}:${String(s.time.mm).padStart(2, \"0\")}` : \"\"; })();\n    const dateField = (\n        <Box css={styles.editorDate} data-slot=\"editorDate\" data-level={whenLevel} onKeyDownCapture={handleDateKey} onKeyDown={stop} onBlur={handleBlur}>\n            <CompoundDateField size={controlSize} {...(date !== undefined ? { value: dateToCalendarDate(date) } : {})} onChange={handleDateChange} aria-label={ariaLabel}>\n                <CompoundDateInput>\n                    {({ segment }) => <CompoundDateSegment segment={segment} />}\n                </CompoundDateInput>\n            </CompoundDateField>\n            {whenLevel === \"time\" && (\n                <chakra.input css={styles.editorTime} data-slot=\"editorTime\" aria-label={m.editorTime()} placeholder={m.editorTimePlaceholder()} defaultValue={timeNow} key={timeNow}\n                    onMouseDown={(e) => e.stopPropagation()}\n                    onKeyDown={handleTimeKey}\n                    onChange={(e) => { const v = e.currentTarget.value.trim(); if (/^\\d{1,2}:\\d{2}$/.test(v)) setTimeToken(v); }}\n                    onBlur={(e) => { const v = e.currentTarget.value.trim(); if (/^\\d{1,2}:\\d{2}$/.test(v)) setTimeToken(v); handleBlur(e); }} />\n            )}\n        </Box>\n    );\n\n    const half = (side: 0 | 1) => {\n        if (link === undefined) return null;\n        const key: \"from\" | \"to\" = side === 0 ? \"from\" : \"to\";\n        const state = link.halves[key];\n        const members = link.groups[side];\n        const active = link.side === side;\n        const offset = side === 0 ? 0 : link.groups[0].length;\n        const warn = !state.live && (members.length > 0 || active);\n        const onDown = (e: MouseEvent) => {\n            if ((e.target as HTMLElement).tagName === \"INPUT\") { e.stopPropagation(); return; }\n            e.preventDefault();\n            e.stopPropagation();\n            onHalfDown(side);\n        };\n        return (\n            <Box\n                css={styles.half}\n                data-half={key}\n                data-active={active ? \"\" : undefined}\n                data-locked={!state.live ? \"\" : undefined}\n                style={{ position: \"relative\", minHeight: \"34px\", alignItems: \"center\", padding: side === 0 ? \"7px 3px 7px 0\" : \"7px 0 7px 3px\", justifyContent: \"flex-start\" }}\n                onMouseDown={onDown}\n            >\n                {active && <Box aria-hidden=\"true\" style={{ position: \"absolute\", left: side === 0 ? 0 : 3, right: side === 0 ? 3 : 0, bottom: 4, height: \"1.5px\", background: \"var(--chakra-colors-brand-solid)\", pointerEvents: \"none\" }} />}\n                {!state.live && state.lock !== \"\" && (\n                    <Box as=\"span\" css={warn ? styles.lockWarn : styles.lockTag} data-slot={warn ? \"lockWarn\" : \"lockTag\"}\n                        title={warn ? m.editorLocked({ half: key }) : undefined}>\n                        {state.lock}\n                    </Box>\n                )}\n                {state.live && members.length === 0 && <Box as=\"span\" css={styles.halfLabel} data-slot=\"halfLabel\">{m.halfLabel({ half: key })}</Box>}\n                {members.map((member, i) => {\n                    const n = offset + i;\n                    const picked = link.chipSel !== null && n >= link.chipSel.lo && n <= link.chipSel.hi;\n                    return (\n                        <Box key={i} as=\"span\" css={picked ? styles.chipPicked : memberIsDashed(member) ? styles.chipDashed : styles.chip}\n                            data-slot=\"chip\" data-member={member.type} data-picked={picked ? \"\" : undefined}>\n                            {memberLabel(member)}\n                        </Box>\n                    );\n                })}\n                {active && typed(side)}\n                {link.predicted[side].map((member, i) => (\n                    <Box key={`p${i}`} as=\"span\" css={styles.chipDashed} data-slot=\"chip\" data-predicted=\"\" style={{ paddingLeft: 6, paddingRight: 6 }}>\n                        {memberLabel(member)}\n                    </Box>\n                ))}\n            </Box>\n        );\n    };\n\n    let field: ReactNode;\n    if (link !== undefined) {\n        field = link.single ? (\n            <Box css={styles.linkGrid} style={{ gridTemplateColumns: \"minmax(0,1fr)\" }}>\n                {half(1)}\n            </Box>\n        ) : (\n            <Box css={styles.linkGrid}>\n                {half(0)}\n                <Box as=\"span\" css={styles.arrow} aria-hidden=\"true\" style={{ height: \"34px\" }}>\n                    <FontAwesomeIcon icon={link.halves.isIn ? faMinus : faArrowRightLong} />\n                </Box>\n                {half(1)}\n            </Box>\n        );\n    } else if (kind === \"date\") field = dateField;\n    else if (isCombobox) field = comboboxField;\n    else if (kind === \"quantity\" || kind === \"integer\") field = number;\n    else if (isRegisterKind(kind)) field = typed(undefined);\n    else field = text;\n\n    return (\n        <>\n            <Box ref={rootRef} css={styles.editor} data-slot=\"editor\" data-kind={kind} data-error={error ? \"\" : undefined} data-link={link !== undefined ? \"\" : undefined} onMouseDown={stop}>\n                {field}\n                {link === undefined && isRegisterKind(kind) && !isCombobox && (resolve !== \"\" || badge !== \"\") && (\n                    <Box display=\"flex\" alignItems=\"center\" gap=\"8px\" paddingLeft=\"8px\" flex=\"none\">\n                        {resolve !== \"\" && (\n                            <Box as=\"span\" css={styles.editorResolve} data-slot=\"editorResolve\">\n                                <FontAwesomeIcon icon={faArrowRightLong} style={{ fontSize: \"9px\" }} />\n                                {resolve}\n                            </Box>\n                        )}\n                        {badge !== \"\" && <Box as=\"span\" css={styles.editorBadge}>{badge}</Box>}\n                    </Box>\n                )}\n            </Box>\n            {error && <Box css={styles.editorError} data-slot=\"editorError\" />}\n        </>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The open editor: the sheet recipe's styles, and what the editor over the ring's cell shows — its candidates, its ghost,\n * a combobox's menu, a date's field, a link's halves — and what its keys, its picks and its blur tell the machine.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo } from \"react\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { candidateAt, candidateList, ghostFor, resolveFor } from \"./candidates.js\";\nimport { parseDate } from \"./parse/date.js\";\nimport { isComboboxKind, type EditorOption, type LinkEditorView } from \"./Editor.js\";\nimport type { StripAction } from \"./Strip.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { Styles } from \"./parts.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * Reads what the open editor shows, and handles what it is told (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @returns The styles, the editor's view and its handlers\n */\nexport function useSheetOpenEditor(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetMachine: SheetMachine) {\n    const { registers, size, today, words } = sheetDecode;\n    const { ui } = sheetSession;\n    const { candidateCtxFor, levelAt, linkCtxFor, linkVocabularies, metaAt, parseCtxFor } = sheetBody;\n    const { dispatch, uiRef } = sheetMachine;\n    // ── Recipe + layout ───────────────────────────────────────────────────\n    const recipe = useSlotRecipe({ key: \"sheet\" });\n    const styles = useMemo(() => recipe({ size } as Record<string, unknown>) as unknown as Styles, [recipe, size]);\n\n    // ── The editor and the strip ──────────────────────────────────────────\n    const edit = ui.edit;\n    const editMeta = edit !== null ? metaAt(edit.r, edit.c) : undefined;\n    const editCand = useMemo(() => {\n        if (edit === null || editMeta === undefined || edit.link !== undefined) return undefined;\n        return candidateAt(editMeta, edit.val, edit.hi, candidateCtxFor(edit.r));\n    }, [edit, editMeta, candidateCtxFor]);\n    const editGhost = edit !== null ? ghostFor(edit.val, editCand?.label) : \"\";\n    const editResolve = edit !== null ? resolveFor(edit.val, editCand?.label) : \"\";\n    const editBadge = useMemo(() => {\n        if (edit === null || editMeta === undefined || edit.val.trim() === \"\" || edit.link !== undefined) return \"\";\n        const n = candidateList(editMeta, edit.val, candidateCtxFor(edit.r)).length;\n        return n > 1 ? words.m.editorBadge({ index: words.number(Math.min(Math.max(edit.hi, 0), n - 1) + 1), total: words.number(n) }) : \"\";\n    }, [edit, editMeta, candidateCtxFor, words]);\n    const onEditorChange = useCallback((val: string) => dispatch({ t: \"editor.change\", val }), [dispatch]);\n    // A combobox column's menu: its register's members, each in the words its\n    // cell shows (#1536). Two modes over the machine's buffer: BROWSING — the\n    // buffer is empty, or holds a member (the cell's own on open, one chosen)\n    // or spells one whole — lists every option the row may take with that one\n    // highlighted, and ↑ ↓ step the buffer through them, member by member;\n    // TYPING — a partial buffer — lists the machine's candidates with its armed\n    // one highlighted, exactly what the strip shows. ⏎ commits the buffer\n    // either way; a click writes the option's member and moves on like ⏎.\n    const editCombobox = useMemo<{ options: EditorOption[]; highlighted: number; browse: boolean } | undefined>(() => {\n        if (edit === null || editMeta === undefined || !isComboboxKind(editMeta.kind)) return undefined;\n        const cctx = candidateCtxFor(edit.r);\n        const allowed = cctx.allowed?.(editMeta);\n        const members = (registers.byName.get(editMeta.register ?? \"\") ?? []).filter((m) => allowed === undefined || allowed.has(m.key));\n        const typed = edit.val.trim().toLowerCase();\n        const pick = edit.pick;\n        // The member the buffer holds: the one a gesture chose, else one it spells whole — its key, or the words it shows.\n        const named = pick !== undefined ? members.findIndex((m) => stringEqual(m.key, pick))\n            : typed === \"\" ? -1 : members.findIndex((m) => stringEqual(m.key.toLowerCase(), typed) || stringEqual(m.label.toLowerCase(), typed));\n        const browse = typed === \"\" || named >= 0;\n        const shown = browse ? members.map((m) => ({ key: m.key, label: m.label !== \"\" ? m.label : m.key })) : candidateList(editMeta, edit.val, cctx);\n        const byKey = new Map(members.map((m) => [m.key, m]));\n        const options = shown.map((c): EditorOption => {\n            const m = byKey.get(c.key);\n            return { key: c.key, label: c.label, meta: m !== undefined ? getSomeorUndefined(m.meta) : undefined, tone: m !== undefined ? getSomeorUndefined(m.tone)?.type : undefined };\n        });\n        return { options, browse, highlighted: browse ? named : edit.hi >= 0 ? Math.min(edit.hi, options.length - 1) : options.length > 0 ? 0 : -1 };\n    }, [edit, editMeta, candidateCtxFor, registers]);\n    const onEditorPick = useCallback((option: EditorOption) => {\n        dispatch({ t: \"editor.pick\", label: option.label, key: option.key });\n        dispatch({ t: \"editor.key\", key: \"Enter\", shift: false, meta: false, alt: false, atEnd: true });\n    }, [dispatch]);\n    const onEditorBrowse = useCallback((option: EditorOption) => dispatch({ t: \"editor.pick\", label: option.label, key: option.key }), [dispatch]);\n    // A date column's buffer is its edit form; the date field shows the date it names.\n    const editDate = useMemo(() => {\n        if (edit === null || editMeta === undefined || editMeta.kind !== \"date\") return undefined;\n        return parseDate(edit.val, { today, base: parseCtxFor(edit.r, editMeta).baseDate }) ?? undefined;\n    }, [edit, editMeta, today, parseCtxFor]);\n    const editWhenLevel = edit !== null && editMeta !== undefined ? levelAt(edit.r, editMeta) : undefined;\n    const linkEdit = edit?.link;\n    const linkEditCtx = useMemo(() => (edit !== null && linkEdit !== undefined ? linkCtxFor(edit.r, edit.c) : undefined), [edit, linkEdit, linkCtxFor]);\n    const linkArmed = useMemo(() => (edit !== null && linkEdit !== undefined && linkEditCtx !== undefined ? linkEditCtx.candidateAt(edit.val, edit.hi, linkEdit.groups) : undefined), [edit, linkEdit, linkEditCtx]);\n    const linkGhostText = edit !== null && linkArmed !== undefined && linkArmed.label.toLowerCase().startsWith(edit.val.trim().toLowerCase()) && edit.val.trim() !== \"\"\n        ? linkArmed.label.slice(edit.val.trim().length) : \"\";\n    const onEditorKey = useCallback((k: { key: string; shift: boolean; meta: boolean; alt: boolean; atEnd: boolean }): boolean => {\n        const current = uiRef.current.edit;\n        dispatch({ t: \"editor.key\", ...k });\n        if ([\"Escape\", \"Enter\", \"Tab\"].includes(k.key)) return true;\n        if (k.alt && (k.key === \"]\" || k.key === \"[\")) return true;\n        if (current !== null && current.link !== undefined) {\n            const link = current.link;\n            const chips = link.groups[0].length + link.groups[1].length;\n            if (k.shift && (k.key === \"ArrowLeft\" || k.key === \"ArrowRight\") && chips > 0 && (link.chipSel !== null || current.val === \"\")) return true;\n            if ((k.key === \"Backspace\" || k.key === \"Delete\") && (link.chipSel !== null || current.val === \"\")) return true;\n            if (k.key === \"ArrowRight\" && k.atEnd && (linkGhostText !== \"\" || (current.val === \"\" && link.side === 0))) return true;\n            if (k.key === \"ArrowLeft\" && current.val === \"\" && link.side === 1) return true;\n            return false;\n        }\n        if (k.key === \"ArrowDown\" || k.key === \"ArrowUp\") return true;\n        if (k.key === \"ArrowRight\" && k.atEnd && editGhost !== \"\") return true;\n        return false;\n    }, [dispatch, editGhost, linkGhostText, uiRef]);\n    const onEditorBlur = useCallback(() => dispatch({ t: \"editor.blur\" }), [dispatch]);\n    const onStripAction = useCallback((a: StripAction) => {\n        switch (a.kind) {\n            case \"candidate\": dispatch({ t: \"strip.pick\", label: a.label, key: a.key, i: a.i }); break;\n            case \"members\": dispatch({ t: \"strip.pick\", label: a.label, i: -1, members: a.members }); break;\n            case \"fill\": dispatch({ t: \"fill.take\", key: a.key }); break;\n            case \"rows\": dispatch({ t: \"proposal.take\", i: (uiRef.current.sugg?.rows.length ?? 1) - 1 }); break;\n        }\n    }, [dispatch, uiRef]);\n    const onHalfDown = useCallback((side: 0 | 1) => dispatch({ t: \"half.down\", side }), [dispatch]);\n    const linkView = useMemo<LinkEditorView | undefined>(() => {\n        if (edit === null || linkEdit === undefined || linkEditCtx === undefined || editMeta === undefined) return undefined;\n        const lo = linkEdit.chipSel === null ? -1 : Math.min(linkEdit.chipSel.anchor, linkEdit.chipSel.focus);\n        const hi = linkEdit.chipSel === null ? -2 : Math.max(linkEdit.chipSel.anchor, linkEdit.chipSel.focus);\n        return {\n            side: linkEdit.side,\n            halves: linkEditCtx.halves,\n            groups: linkEdit.groups,\n            chipSel: linkEdit.chipSel === null ? null : { lo, hi },\n            predicted: [linkEditCtx.predicted(0, linkEdit.groups, linkEdit.side === 0 ? edit.val : \"\"), linkEditCtx.predicted(1, linkEdit.groups, linkEdit.side === 1 ? edit.val : \"\")],\n            vocab: linkVocabularies.get(editMeta.key),\n            hop: linkEdit.hop,\n            single: editMeta.kind === \"set\",\n        };\n    }, [edit, linkEdit, linkEditCtx, editMeta, linkVocabularies]);\n    return {\n        edit, editBadge, editCombobox, editDate, editGhost, editMeta, editResolve, editWhenLevel, linkArmed, linkEdit,\n        linkEditCtx, linkGhostText, linkView, onEditorBlur, onEditorBrowse, onEditorChange, onEditorKey, onEditorPick,\n        onHalfDown, onStripAction, styles,\n    };\n}\n\n/** What {@link useSheetOpenEditor} gives the parts after it. */\nexport type SheetOpenEditor = ReturnType<typeof useSheetOpenEditor>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the frame shows while a paged source, or the lens, reads: the footer's loading line, the cold load the skeleton\n * covers, and a read in flight after it.\n *\n * @packageDocumentation\n */\n\nimport { useMemo, useRef, useState } from \"react\";\nimport type { SheetBodyItem } from \"./model.js\";\nimport type { SheetLoadingLine } from \"./Footer.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetLoadingFacts } from \"./parts.js\";\n\n/**\n * Says how the sheet's reads stand (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @returns The loading line and the frame's loading facts\n */\nexport function useSheetReading(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody) {\n    const { decodedRows, lensWanted, pagedSource, rowPx } = sheetDecode;\n    const { lens, lensDrawn, pagesReady, pagesStandIn, paging, standingIn } = sheetSession;\n    const { body } = sheetBody;\n    // Under the lens (#1349): whether it is still reading, and why it could not place the narrowing's rows — beside\n    // the rows it drew, or beside the pages that stand in while it reads.\n    const lensLoading = lens.loading;\n    // The stretches the lens reads (#1398): what the line names and the runs it draws mark busy — never one it is not reading.\n    const lensReading = lens.reading;\n    // Whether the view shows a stretch the lens has not read (#1398, CL3), as the frame's every report says — the scroll on\n    // its way, and at rest before the lens has heard it, too: the lens hears the view and reads there only once it rests,\n    // but the view waits for what it shows from the moment it shows it, so the line's reveal clock runs from then.\n    const [lensAwaits, setLensAwaits] = useState(false);\n    const lensAwaitsNow = useRef(false);\n    const lensAwaiting = lensDrawn && lensAwaits;\n    const lensSourceError = lens.sourceError;\n    const lensError = lens.error;\n    // A source that failed before anything landed: nothing else to show (#853) — the pages', or the lens's\n    // placement of the narrowing's rows with no rows drawn and none standing in (#1349).\n    const sourceFailure = paging.error ?? (lensWanted && !pagesStandIn ? lensError : undefined);\n    // What the footer's loading line says (#1398, CL3): a read that failed — a window's or a stretch's, else the\n    // source's own — then a narrowing's rows read while the last ones stand in, then the elements in flight: the\n    // pages' nearest the view, or the lens's first stretch it reads.\n    const line = useMemo<SheetLoadingLine | undefined>(() => {\n        if (pagedSource === undefined) return undefined;\n        const failed = body.find((it) => it.kind === \"failed\");\n        if (failed?.kind === \"failed\") return { kind: \"failed\", from: failed.failure.from, to: failed.failure.to, reason: failed.failure.error };\n        const reason = sourceFailure ?? (lensDrawn ? lensSourceError : pagesStandIn ? lensError : paging.sourceError);\n        if (reason !== undefined) return { kind: \"failed\", from: undefined, to: undefined, reason };\n        if (standingIn) return { kind: \"filtering\" };\n        if (lensDrawn) {\n            if (!lensLoading && !lensAwaiting) return undefined;\n            // The stretch the lens reads first — a jump's, else the nearest the view — never a band it is not reading: one far\n            // from the view, or one its placement has still to place; none named while the view waits for the lens to hear it.\n            const bands = body.filter((it): it is Extract<SheetBodyItem, { kind: \"band\" }> => it.kind === \"band\");\n            const at = lensReading.find((from) => bands.some((it) => it.band.from === from));\n            const reading = at === undefined ? undefined : bands.find((it) => it.band.from === at);\n            return reading !== undefined ? { kind: \"loading\", from: reading.band.from, to: reading.band.to } : { kind: \"loading\", from: undefined, to: undefined };\n        }\n        // A window the view shows, never one read ahead of it: nothing on screen waits for that.\n        if (!paging.viewLoading) return undefined;\n        return { kind: \"loading\", from: paging.reading?.from, to: paging.reading?.to };\n    }, [pagedSource, body, sourceFailure, lensDrawn, lensSourceError, pagesStandIn, lensError, paging.sourceError, standingIn, lensLoading, lensAwaiting, lensReading, paging.viewLoading, paging.reading]);\n    // Cold load (#1398, CL5): a paged source with nothing drawn yet and no failure to say — the frame's skeleton\n    // covers it at the rows' pitch. After it, a read the view waits for leaves everything live and the grid busy: a\n    // scroll far from the rows, every window it shows still on its way, draws the runs there and is never covered.\n    const cold = pagedSource === undefined ? undefined\n        : decodedRows === undefined && !lensDrawn && !pagesReady && !paging.landedOnce && !pagesStandIn && sourceFailure === undefined;\n    const busy = cold === false && (standingIn || (lensDrawn ? lensLoading || lensAwaiting : paging.viewLoading));\n    const loadingFacts = useMemo<SheetLoadingFacts>(() => ({ cold, busy, pitch: rowPx }), [cold, busy, rowPx]);\n    return { busy, cold, lensAwaitsNow, lensReading, line, loadingFacts, setLensAwaits, sourceFailure };\n}\n\n/** What {@link useSheetReading} gives the parts after it. */\nexport type SheetReading = ReturnType<typeof useSheetReading>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The paged sheet's KEY SEARCH (`Sheet Spec.md` §3.13, §5 row 21) — on a\n * keyed source the rail's search stops being a row filter over the loaded\n * prefix and becomes a seek over the whole source: a query is answered in\n * SOURCE POSITIONS, a jump rebases the residency there (the windows in\n * between are never fetched), and the ring lands on the row once its window\n * is resident.\n *\n * Simpler than the Plan's (e3-ui-components' `plan/use-seek.ts`): a sheet row IS a source\n * element, so the k-th match is the row at `range.row + k` — the control's\n * prev / next step exactly.\n *\n * The box lists the match run's rows wherever they are (#1398, CL10): each\n * read through the source by its position, a far match's as well as one on\n * screen, never only the rows the sheet has drawn — and, under a narrowing of\n * the record's rows, each the narrowing hides marked so, and once e3 has said\n * which of the `rows` source's choices hide it (`hidden.ts`, asked for the\n * rows listed, the box listing them again as the answer lands), named: `·\n * hidden by Status: Ready — picking it clears that filter`. The sheet shows\n * only the rows the narrowing keeps, so a pick of a row it hides clears those\n * filters — every choice of the source, while e3 has not said which — and\n * goes to the row once the narrowing they leave draws it (the hidden pick).\n *\n * The bridge from the tracked `seek` read (`none` while searching, re-fires\n * when it lands) to the control's promise is the Plan's: the query goes into\n * state, the read runs inside {@link useTrackedEvaluation}, and the pending\n * promise resolves on the frame the answer arrives.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { StringType, toEastTypeValue, type EastTypeValue, type option } from \"@elaraai/east\";\nimport { type DatasetKeyMatchRange, type DatasetKeyQuery, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { pagedSnapshot, pagedSnapshotEqual, pagedSnapshotKey } from \"./paged-snapshot.js\";\nimport { awaitTracked, toSeekQuery } from \"@elaraai/east-ui-components/internal\";\nimport type { SheetPagedSourceValue, SheetRowValue } from \"./values.js\";\n\n/** A sheet's keys are Strings — the search input parses against that. */\nconst KEY_TYPE: EastTypeValue = toEastTypeValue(StringType);\n\n/** A row the box lists: its place in the source, its line, and what the box shows once it is picked — its key. */\nexport interface SheetListed {\n    readonly row: number;\n    readonly label: string;\n    readonly text: string;\n}\n\n/** What the toolbar's key search drives — the shared item's source (`useKeySearchToolbarItem`, #1221). */\nexport interface SheetSearch {\n    /** Source snapshot identity; remounts cached positional search results. */\n    resetKey: string;\n    keyType: EastTypeValue;\n    /** Locate a query — resolves when the tracked search lands. */\n    find: (query: DatasetKeyQuery) => Promise<DatasetKeyMatchRange>;\n    /** Label the popup's rows of the match run, each read through the source by its position — its row's id, and whether a narrowing hides it, and by which filters. */\n    listRange: (row: number, limit: number) => Promise<SheetListed[]>;\n    /** Jump to the match at source position `row` — a row the narrowing hides, by clearing the filters that hide it. */\n    jump: (row: number) => void;\n    /** Drop the query and its jump target. */\n    clear: () => void;\n    /** Moves as e3 says which filters hide the rows listed: the box lists them again. */\n    relist?: number | undefined;\n}\n\nexport interface SheetSeekState {\n    /** Mount data for the search control — `undefined` when the source declares no `seek`. */\n    search: SheetSearch | undefined;\n    /** The source position the ring should land on once resident. */\n    target: number | undefined;\n    /** The target landed (or was abandoned). */\n    clearTarget: () => void;\n}\n\n/**\n * Which of the source's rows `[from, from + count)` a narrowing of them holds — a tracked read, `none` while pending:\n * the `rows` source's narrowing drawn over its record's rows as the lens (#1349).\n */\nexport type SheetSeekHeld = (from: number, count: number) => option<readonly boolean[]>;\n\n/**\n * A narrowing of the source's rows that hides some of them: what the box asks\n * of a listed row, what it says of one it hides, and what a pick of one does\n * (the hidden pick).\n */\nexport interface SheetSeekNarrowing {\n    /** Which of a run of the rows it holds. */\n    held: SheetSeekHeld;\n    /** A listed row it hides, as the box lists it, by its key: the filters that hide it once e3 has said, else that filters do. */\n    hiddenLine: (key: string) => string;\n    /** Asks e3 which filters hide the listed rows it hides, by the listing's first row, each row's key and whether it holds each. */\n    askHidden: (from: number, keys: readonly string[], held: readonly boolean[]) => void;\n    /** A pick of a listed row it hides, by its position and its key: those filters cleared, and the row gone to. */\n    reveal: (row: number, key: string) => void;\n    /** Moves as e3's answers land: the box lists its rows again. */\n    version: number;\n}\n\n/**\n * Wire a paged source's `seek` to the sheet.\n *\n * @param source - The decoded `paged` arm (undefined ⇒ inline sheet)\n * @param jumpToElement - Ask the driver to rebase residency on a position\n * @param clearJump - Drop the driver's pending jump pin\n * @param narrowing - A narrowing of the source's rows that hides some of them, and what the box does about those; else `undefined`\n * @returns The search mount and the landing target\n */\nexport function useSheetSeek(\n    source: SheetPagedSourceValue | undefined,\n    jumpToElement: (element: number) => void,\n    clearJump: () => void,\n    narrowing: SheetSeekNarrowing | undefined,\n): SheetSeekState {\n    const [query, setQuery] = useState<unknown>(null);\n    const [target, setTarget] = useState<number | undefined>(undefined);\n    // What `listRange` reads — refs: the control awaits `onFind` and then calls\n    // the `onListRange` it captured before the state committed (#614).\n    const latest = useRef({ source, narrowing });\n    useLayoutEffect(() => { latest.current = { source, narrowing }; });\n    // The rows listed that the narrowing hides, by their positions: a pick of one clears the filters hiding it.\n    const hiddenAt = useRef(new Map<number, string>());\n    const pending = useRef<{ resolve: (r: DatasetKeyMatchRange) => void; reject: (e: unknown) => void } | null>(null);\n\n    const seekFn = useMemo(() => {\n        if (source === undefined) return undefined;\n        return source.seek.type === \"some\" ? source.seek.value : undefined;\n    }, [source]);\n\n    const read = useCallback(() => {\n        const revision = source?.revision?.();\n        const answer = seekFn === undefined || query === null ? undefined\n            : seekFn(query as never);\n        return { revision, answer };\n    }, [source, seekFn, query]);\n    const { result } = useTrackedEvaluation(read);\n    const revision = result.ok && result.value.revision?.type === \"some\"\n        ? result.value.revision.value : undefined;\n    const snapshot = useMemo(() => pagedSnapshot(source?.id, revision), [source?.id, revision]);\n    const resetKey = pagedSnapshotKey(snapshot);\n    const previousSnapshot = useRef(snapshot);\n    const snapshotChanged = !pagedSnapshotEqual(previousSnapshot.current, snapshot);\n\n    useEffect(() => {\n        const waiting = pending.current;\n        if (waiting === null) return;\n        if (!result.ok) {\n            pending.current = null;\n            waiting.reject(result.error);\n            return;\n        }\n        const answer = result.value.answer;\n        if (answer === undefined || answer.type !== \"some\" || answer.value === undefined) return;\n        pending.current = null;\n        waiting.resolve({ found: answer.value.found, row: Number(answer.value.row), count: Number(answer.value.count) });\n    }, [result]);\n\n    const find = useCallback((q: DatasetKeyQuery) => new Promise<DatasetKeyMatchRange>((resolve, reject) => {\n        pending.current?.reject(new Error(\"superseded by a newer query\"));\n        pending.current = { resolve, reject };\n        setQuery(toSeekQuery(q));\n    }), []);\n\n    const listRange = useCallback(async (row: number, limit: number): Promise<SheetListed[]> => {\n        // The head of the match run, by POSITION: its rows read through the source — on screen, far off, or hidden by\n        // the narrowing, whose window the sheet has not drawn (#1398, CL10) — each its row's id.\n        const { source: from, narrowing } = latest.current;\n        // The snapshot it lists at: a new one keeps nothing this listing learns.\n        const listing = hiddenAt.current;\n        if (from === undefined || limit <= 0) return [];\n        const rows: readonly SheetRowValue[] = (await awaitTracked(() => from.page(BigInt(row), BigInt(limit)))).rows;\n        const shown = narrowing === undefined || rows.length === 0 ? undefined : await awaitTracked(() => narrowing.held(row, rows.length));\n        // Those the narrowing hides: e3 is asked which of its filters hide each — the box listing them again as it says\n        // (`relist`) — and a pick of one clears them (the hidden pick).\n        if (shown !== undefined && narrowing !== undefined && Object.is(hiddenAt.current, listing)) {\n            rows.forEach((r, i) => { if (shown[i]) listing.delete(row + i); else listing.set(row + i, r.id); });\n            narrowing.askHidden(row, rows.map((r) => r.id), shown);\n        }\n        // A pick shows the row's key in the box: what its query is typed against.\n        return rows.map((r, i) => ({ row: row + i, label: shown !== undefined && !shown[i] && narrowing !== undefined ? narrowing.hiddenLine(r.id) : r.id, text: r.id }));\n    }, []);\n\n    const jump = useCallback((row: number) => {\n        // A row the narrowing hides, as the box listed it: the filters hiding it cleared, and the row gone to there — never\n        // a jump under the narrowing that hides it (the hidden pick).\n        const key = hiddenAt.current.get(row);\n        const reveal = latest.current.narrowing?.reveal;\n        if (key !== undefined && reveal !== undefined) {\n            setTarget(undefined);\n            reveal(row, key);\n            return;\n        }\n        jumpToElement(row);\n        setTarget(row);\n    }, [jumpToElement]);\n\n    const clear = useCallback(() => {\n        pending.current?.reject(new Error(\"search cleared\"));\n        pending.current = null;\n        setQuery(null);\n        setTarget(undefined);\n        clearJump();\n    }, [clearJump]);\n\n    const clearTarget = useCallback(() => setTarget(undefined), []);\n\n    // Clear positions before passive effects can settle an answer from the\n    // previous snapshot. A query can be repeated against the new source, but\n    // its old element index cannot be reused there.\n    useLayoutEffect(() => {\n        if (pagedSnapshotEqual(previousSnapshot.current, snapshot)) return;\n        previousSnapshot.current = snapshot;\n        // The rows the old snapshot's narrowing hid are no one's now.\n        hiddenAt.current = new Map();\n        clear();\n    }, [snapshot, clear]);\n    const clearJumpRef = useRef(clearJump);\n    useLayoutEffect(() => { clearJumpRef.current = clearJump; });\n    useEffect(() => () => {\n        pending.current?.reject(new Error(\"search source unmounted\"));\n        pending.current = null;\n        clearJumpRef.current();\n    }, []);\n\n    const relist = narrowing?.version;\n    const search = useMemo<SheetSearch | undefined>(\n        () => (seekFn === undefined ? undefined : { resetKey, keyType: KEY_TYPE, find, listRange, jump, clear, relist }),\n        [resetKey, seekFn, find, listRange, jump, clear, relist],\n    );\n\n    return { search, target: snapshotChanged ? undefined : target, clearTarget };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Where the view goes: the key search and its jumps, a row the narrowing hides named and gone to, a key's move past the\n * rows read landing once they are, the scroll restored after a remount, a row kept in view through a new narrowing, and an\n * issue's cell gone to.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { StringType, StructType, equalFor, fromEastTypeValue, none, parseFor, printFor, some, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { recordSliceWithinAt } from \"@elaraai/east-ui-components/internal\";\nimport type { SeekQueryType } from \"@elaraai/east-ui\";\nimport { RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { isRowSpace, type SheetBodyItem } from \"./model.js\";\nimport { narrowingOf } from \"./view-state.js\";\nimport { sameAnchor, type SheetAnchor } from \"./persisted.js\";\nimport { useSheetSeek, type SheetSeekNarrowing } from \"./use-seek.js\";\nimport { hiddenLine, hiddenOf, useHidden, useRelist } from \"../shared/schedule/hidden.js\";\nimport { useHiddenPick } from \"../shared/schedule/hidden-pick.js\";\nimport { seekRecord } from \"./use-lens.js\";\nimport type { SheetTransactions } from \"./transactions.js\";\nimport type { SheetRootValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport { rowNameOf } from \"./local-rows.js\";\nimport { elementOf, elementUnder, keyOfItem, placeOf, rowPositionOf, spanOf } from \"./items.js\";\n\nexport type SheetTransactionsIssue = SheetTransactions[\"issues\"][number];\n\nexport type SeekQuery = ValueTypeOf<typeof SeekQueryType>;\n\n/**\n * A row the `rows` source's narrowing hid, being gone to (the hidden pick):\n * its place in the record, the rows as the narrowing it came from and the one\n * the pick left them under name them (`rowsQuery`), whether the pick was an\n * issue's — its cell then takes the ring — and whether its jump is made.\n */\nexport interface SheetReveal {\n    element: number;\n    from: string;\n    to: string;\n    issue: boolean;\n    jumped: boolean;\n}\n\n/** The `rows` source's narrowing, as East prints it: what names a narrowing of the rows apart from another (#1349). */\nconst printRowsWhere = printFor(RecordSliceWhereType);\n\nconst stringEqual = equalFor(StringType);\n\n/** A live source's rows under one narrowing, named apart (#1354): the source and its narrowing, as East prints them. */\nconst printNarrowedSource = printFor(StructType({ source: StringType, narrowing: StringType }));\n\n/**\n * Takes the view where the key search, a key, a remount or an issue sends it (see the module docs).\n *\n * @param value - The Sheet root value\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetEffects - The effect runner and what its effects reach\n * @returns The key search, the hidden pick, the scroll's anchor and the issue gone to\n */\nexport function useSheetJumps(value: SheetRootValue, sheetDecode: SheetDecode, sheetSession: SheetSession,\n    sheetBody: SheetBody, sheetMachine: SheetMachine, sheetEffects: SheetEffects) {\n    const { chrome, columns, group, lensWanted, pagedSource, recordRows, rowsPart, rowsWhere, words } = sheetDecode;\n    const {\n        dispatchStore, lens, lensDrawn, paging, persist, persistedRef, restored, rows, rowsQuery, sourceRows,\n        standingIn,\n    } = sheetSession;\n    const { body, rowSpace } = sheetBody;\n    const {\n        clearJump, dispatch, expectedNarrowing, jumpTo, jumpToElement, lensJumpTo, rowSpaceSlots, seenRows, uiRef,\n    } = sheetMachine;\n    const { cardRef, jumpBy, ringMoves, scrollTarget, seekIntent, setScrollTarget } = sheetEffects;\n    // ── The key search over a keyed paged source (§3.13) ──────────────────\n    // Its jumps are its own (#860): cleared — by the viewer, or by a new\n    // snapshot — it drops only a jump it asked for, never a key's move. Over a\n    // `rows` source it seeks the record's own order (#1349); under the lens its\n    // jump reads where its row lands and goes there where the narrowing keeps\n    // it. A row the narrowing hides is marked so in the box, by the filters that\n    // hide it once e3 has said, and a pick of it clears them and goes to it (the\n    // hidden pick, below).\n    const searchJump = useCallback((element: number) => { jumpBy.current = \"search\"; jumpTo(element); }, [jumpTo, jumpBy]);\n    const searchClearJump = useCallback(() => { if (jumpBy.current === \"search\") clearJump(); }, [clearJump, jumpBy]);\n    const recordSeek = useMemo(() => (rowsPart === undefined ? undefined : (query: SeekQuery) => seekRecord(rowsPart, query)), [rowsPart]);\n    // Over a `rows` source the key search seeks the record's own order, and starts afresh with each narrowing of the\n    // rows, as it did while they were the narrowing's alone (#1345): its source's id names the narrowing too.\n    const seekSource = useMemo(() => (recordRows && recordSeek !== undefined && pagedSource !== undefined && pagedSource.seek.type === \"none\"\n        ? { ...pagedSource, id: rowsQuery, seek: some(recordSeek) } : pagedSource), [recordRows, recordSeek, pagedSource, rowsQuery]);\n    // ── The hidden pick (`shared/schedule/hidden.ts`, `hidden-pick.tsx`): a row the narrowing hides, named and gone to ──\n    // Which of the `rows` source's choices hide a row its narrowing hides, asked of e3 through the record's indexes for\n    // the rows the box lists and for the issues' rows — never worked out here — and kept by the lens's revision and the\n    // narrowing. A row's record key by its id, and its id by its key: a String key's id is the String itself, any other\n    // key's its `.east` text.\n    const recordKeys = useMemo(() => {\n        const keyType = value.editing.keyType.type === \"some\" ? fromEastTypeValue(value.editing.keyType.value) : StringType;\n        const text = keyType.type === \"String\";\n        const parseKey = parseFor(keyType);\n        const printKey = printFor(keyType);\n        return {\n            keyOf: (id: string): option<unknown> => {\n                if (text) return some(id);\n                const read = parseKey(id);\n                return read.success ? some(read.value) : none;\n            },\n            idOf: (key: unknown): string => (text ? key as string : printKey(key as never)),\n        };\n    }, [value.editing.keyType]);\n    const rowsPick = useHidden({\n        name: \"Sheet\", part: lensWanted ? rowsPart : undefined, where: lensWanted ? rowsWhere : undefined, revision: lens.revision,\n        keyOf: recordKeys.keyOf, idOf: recordKeys.idOf,\n    });\n    // A pick of a row the narrowing hides — the box's, or Go to issue's — clears the filters hiding it and goes to it: the\n    // lens's jump lands it (below), so the shared pick clears, and hands the keyboard on.\n    const pick = useHiddenPick({\n        onError: (said, reason) => {\n            console.error(\"[Sheet] the filters hiding a row could not be cleared:\", reason);\n            dispatchStore({ t: \"patch\", patch: { msg: { id: \"text\", text: said } } });\n        },\n        uncleared: \"The filters hiding the row could not be cleared\",\n    });\n    const [reveal, setReveal] = useState<SheetReveal | undefined>(undefined);\n    // The rows' narrowing a reveal wrote: it places the view itself, so a narrowing keeping the row at the view's top\n    // leaves it be (below).\n    const revealedQuery = useRef<string | undefined>(undefined);\n    /** The row an issue sent the key search to, by its entry and its place: a jump that finds it hidden reveals it for the issue. */\n    const issueSought = useRef<{ entry: string; row: number } | undefined>(undefined);\n    const revealHidden = useCallback((element: number, key: string | undefined, issue: boolean) => {\n        if (chrome === undefined || rowsPart === undefined || pagedSource === undefined) return;\n        // A row the lens finds hidden: the filters hiding it, as e3 named them — every choice of the `rows` source, until it\n        // has — cleared as the rail clears them: a rail change like any other, which a saved view's tab marks dirty and Esc\n        // there reverts.\n        const state = key === undefined ? undefined : rowsPick.rows.stateOf(key);\n        if (!pick.clear([{ pick: rowsPick, answer: state !== undefined && state.hidden ? state.answer : undefined }])) return;\n        // The sheet's own write: the ring goes to the row, never back to the top, and the view with it.\n        expectedNarrowing.current = narrowingOf(chrome);\n        const to = printNarrowedSource({ source: pagedSource.id, narrowing: printRowsWhere(rowsPart.read().where) });\n        revealedQuery.current = to;\n        setReveal({ element, from: rowsQuery, to, issue, jumped: false });\n    }, [chrome, rowsPart, pagedSource, rowsPick, pick, rowsQuery, expectedNarrowing]);\n    const revealRef = useRef(revealHidden);\n    revealRef.current = revealHidden;\n    // The box lists the rows its key finds wherever they are, each read by its place in the record, and says which the\n    // `rows` source's narrowing hides (#1398, CL10): under the lens, which of them the narrowing holds — and, once e3 has\n    // said, the filters that hide each, in the sheet's words for the line — listing them again as the answers land.\n    const hiddenRelist = useRelist([rowsPick]);\n    const seekNarrowing = useMemo<SheetSeekNarrowing | undefined>(() => (lensWanted && rowsPart !== undefined && rowsWhere !== undefined ? {\n        held: (from: number, count: number) => recordSliceWithinAt(rowsPart, rowsWhere, BigInt(from), BigInt(count)),\n        hiddenLine: (key: string) => {\n            const hidden = hiddenOf([{ pick: rowsPick, id: key }]);\n            return hidden === undefined ? key\n                : hiddenLine(hidden, words, { hiddenByFilters: () => words.m.keySearchHidden({ key }), hiddenBy: (p) => words.m.keySearchHiddenBy({ key, ...p }) });\n        },\n        askHidden: rowsPick.rows.askListed,\n        reveal: (row: number, key: string) => revealRef.current(row, key, false),\n        version: hiddenRelist,\n    } : undefined), [lensWanted, rowsPart, rowsWhere, rowsPick, words, hiddenRelist]);\n    const seek = useSheetSeek(seekSource, searchJump, searchClearJump, seekNarrowing);\n    // A pick in the key search hands the keyboard to the grid (#1398): the grid's focus lands with the ring, on the picked\n    // row's cell, once the row is drawn and the box has let the keyboard go — a hidden pick's once the narrowing it\n    // leaves draws the row; a step leaves it in the box.\n    const handOff = pick.handOff;\n    const pickSearch = useMemo(() => (seek.search === undefined ? undefined : pick.search(seek.search)), [seek.search, pick]);\n    const focusGrid = useCallback(() => { cardRef.current?.focus({ preventScroll: true }); }, [cardRef]);\n    // A jump's target is shown once its window settles (#854): the ring goes\n    // to the sought row (no echo — the host hears the move through onSelect),\n    // or the view to the band of the window that could not be read (#853).\n    // The jump hands the viewport back only after the scroll to it is asked\n    // for — the reports taken before, from the old place, would undo it.\n    const handBack = useRef(false);\n    const activeJump = lensDrawn ? lens.jump : paging.jump;\n    const jumpInFlight = activeJump !== undefined && !activeJump.settled;\n    /**\n     * Shows a settled jump's element: the ring on its row — when `ring` — and the view on it, or on the band of the window\n     * that could not be read there; the viewport handed back once the scroll is asked for.\n     *\n     * @returns Whether anything shows it\n     */\n    const landJump = useCallback((target: number, ring: boolean): boolean => {\n        // A sought element is a row, or on a grouped sheet a group — the ring lands on its band — or a loose row (#846).\n        const bi = body.findIndex((it) => {\n            if (group !== undefined) return (it.kind === \"group\" || (it.kind === \"real\" && it.loose !== undefined)) && it.position === target;\n            return it.kind === \"real\" && it.position === target;\n        });\n        const r = bi >= 0 ? rowSpace.rowOf[bi] : undefined;\n        if (ring && r !== undefined && r >= 0) dispatch({ t: \"select.set\", r, c: uiRef.current.sel.c });\n        const shown = bi >= 0 ? bi : body.findIndex((it) => it.kind === \"failed\" && it.failure.from <= target && target <= it.failure.to);\n        if (shown < 0) return false;\n        setScrollTarget({ index: shown, align: \"auto\" }, true);\n        handBack.current = true;\n        return true;\n    }, [body, rowSpace, group, dispatch, setScrollTarget, uiRef]);\n    useEffect(() => {\n        const target = seek.target;\n        if (target === undefined || jumpInFlight) return;\n        seek.clearTarget();\n        if (landJump(target, true)) {\n            handOff.land(focusGrid);\n            return;\n        }\n        // Nothing to show: the viewport is the viewer's again. Under the lens the narrowing hides the row (the hidden\n        // pick): the filters hiding it are cleared — those e3 named, else every choice of the `rows` source — and the\n        // row gone to once the narrowing they leave draws it; the issue's cell, when an issue sought it.\n        clearJump();\n        if (!lensDrawn) {\n            handOff.drop();\n            return;\n        }\n        const sought = issueSought.current;\n        issueSought.current = undefined;\n        const issue = sought !== undefined && sought.row === target ? sought : undefined;\n        revealRef.current(target, issue?.entry, issue !== undefined);\n    }, [seek, jumpInFlight, landJump, clearJump, lensDrawn, handOff, focusGrid]);\n    // The frame's own effects run first, so by now it has asked for the scroll: a fresh target's, which a jump's is.\n    const scrollNonce = scrollTarget?.nonce;\n    useEffect(() => {\n        if (!handBack.current) return;\n        handBack.current = false;\n        clearJump();\n    }, [scrollNonce, clearJump]);\n    // A reveal goes to its row once the narrowing it wrote is in (the hidden pick): the jump the lens makes, landing\n    // once that narrowing draws the row — or, with nothing left narrowing the rows, the pages' jump. A narrowing written\n    // since decides for itself.\n    useEffect(() => {\n        const going = reveal;\n        if (going === undefined) return;\n        if (!stringEqual(rowsQuery, going.to)) {\n            if (!stringEqual(rowsQuery, going.from)) setReveal(undefined);\n            return;\n        }\n        if (!going.jumped) {\n            jumpBy.current = \"reveal\";\n            if (lensWanted) lensJumpTo(going.element);\n            else jumpToElement(going.element);\n            setReveal({ ...going, jumped: true });\n            return;\n        }\n        const jump = lensWanted ? lens.jump : paging.jump;\n        if (jump === undefined || !jump.settled) return;\n        setReveal(undefined);\n        // An issue's cell takes the ring and the keyboard as its row lands (`pendingIssue`); a pick's row takes them here.\n        if (!landJump(going.element, !going.issue)) {\n            clearJump();\n            handOff.drop();\n            return;\n        }\n        if (!going.issue) handOff.land(focusGrid);\n    }, [reveal, rowsQuery, lensWanted, lensJumpTo, jumpToElement, lens.jump, paging.jump, landJump, clearJump, handOff, focusGrid, jumpBy]);\n    // A key's move across an unloaded run (#860) lands once its window is in\n    // the run: the ring goes to the first row at or past the element it was\n    // headed for (↓, ⌘Home), the last at or before it (↑), or the last there\n    // that is not blank padding (⌘End) — and where the window could not be\n    // read, the view goes to its band. A gesture since the key, or an open\n    // editor, abandons it, the rows it held put back as they were; a jump the\n    // move did not ask for — the key search's — takes its place. Either way\n    // the viewport is handed back once the scroll is asked for, as a search's\n    // is. It lands in the commit that draws the jump's rows, before paint\n    // (#1398, CL10): until then the rows shown stand in (the driver's `held`),\n    // and then the ring and the view are on the row it went to in the frame\n    // that first shows the jump's rows — never a frame of them at the old\n    // place. The ring it places is placed in these rows: nothing follows it\n    // there from the rows that stood in. Under the lens (#1349) the jump is the\n    // lens's: the rows shown stay drawn while it reads where it goes, and the\n    // ring lands once the stretch it lands in is read — the lens's jump settles\n    // on its own row, and the lens may still be reading the rows beside it.\n    const keyJump = lensDrawn ? lens.jump : paging.jump;\n    const lensView = lens.reportViewport;\n    useLayoutEffect(() => {\n        const intent = seekIntent.current;\n        if (intent === undefined) return;\n        if (jumpBy.current !== \"key\") { seekIntent.current = undefined; return; }\n        // The render that pins its window is still to come.\n        if (keyJump === undefined || keyJump.window !== intent.window) return;\n        if (ringMoves.current !== intent.moves || uiRef.current.edit !== null) {\n            seekIntent.current = undefined;\n            clearJump();\n            return;\n        }\n        if (!keyJump.settled) return;\n        if (lensDrawn) {\n            // The first stretch at or past where it goes — or, landing on the last row there, at or before it: a band still\n            // read holds the ring back until it is drawn, so it never lands on a row short of it.\n            const meets = (it: SheetBodyItem): boolean => {\n                const span = spanOf(it);\n                if (span === undefined || (it.kind !== \"band\" && it.kind !== \"failed\" && !isRowSpace(it))) return false;\n                return intent.land === \"first\" ? span.to >= intent.element : span.from <= intent.element;\n            };\n            let at: SheetBodyItem | undefined;\n            if (intent.land === \"first\") at = body.find(meets);\n            else for (let i = body.length - 1; i >= 0 && at === undefined; i--) if (meets(body[i]!)) at = body[i];\n            if (at?.kind === \"band\") return;\n        }\n        seekIntent.current = undefined;\n        const positionOf = (it: SheetBodyItem): number | undefined => (intent.land === \"end\" ? elementOf(it) ?? undefined : rowPositionOf(it));\n        let bi = -1;\n        if (intent.land === \"first\") bi = body.findIndex((it) => { const p = positionOf(it); return p !== undefined && p >= intent.element; });\n        else for (let i = body.length - 1; i >= 0 && bi < 0; i--) { const p = positionOf(body[i]!); if (p !== undefined && p <= intent.element && isRowSpace(body[i]!)) bi = i; }\n        const r = bi >= 0 ? rowSpace.rowOf[bi] : undefined;\n        if (r !== undefined && r >= 0) {\n            seenRows.current = { source: sourceRows, slots: rowSpaceSlots };\n            dispatch({ t: \"select.move\", r, c: intent.c });\n        }\n        const shown = r !== undefined && r >= 0 ? bi : body.findIndex((it) => it.kind === \"failed\" && it.failure.from <= intent.element && intent.element <= it.failure.to);\n        // Nothing to show (a lens hides every row there): the viewport is the viewer's again.\n        if (shown < 0) { clearJump(); return; }\n        // Under the lens, the view is where the ring landed from here on, so what it read there stays read — the jump's own\n        // row may be one the narrowing does not hold, which hands the lens no view — until the frame reports where it rests.\n        const landedAt = lensDrawn ? spanOf(body[shown]!) : undefined;\n        if (landedAt !== undefined) lensView(landedAt.from, landedAt.to, false);\n        setScrollTarget({ index: shown, align: \"auto\" }, true);\n        handBack.current = true;\n    }, [keyJump, lensDrawn, lensView, body, rowSpace, dispatch, clearJump, sourceRows, rowSpaceSlots, jumpBy, ringMoves, seekIntent, seenRows, setScrollTarget, uiRef]);\n\n    // ── Where the scroll rests (#857) ─────────────────────────────────────\n    // The anchor the last session left is restored once its item is in the\n    // body; a paged sheet first fetches the window its element is in, the way\n    // a key search jumps, and hands the viewport back once the frame has\n    // scrolled there. The element is clamped to the source's count first: a\n    // jump past the end pins a window no demand makes resident, so it would\n    // never settle — and a pending jump owns the viewport. An anchor whose\n    // item is gone lands in its place (`placeOf`). Where the frame mounts is never reported\n    // (`VirtualRows` reports settles, not its first rest), so the top the\n    // sheet opens at never overwrites the anchor it restores.\n    const [anchorPhase, setAnchorPhase] = useState<\"pending\" | \"seeking\" | \"settled\">(() => (restored.anchor === null ? \"settled\" : \"pending\"));\n    const [restoreAnchor, setRestoreAnchor] = useState<{ index: number; offset: number } | undefined>(undefined);\n    const anchorHandBack = useRef(false);\n    const anchorJump = paging.jump;\n    const pagedTotal = paging.total;\n    const lensReadyNow = lens.ready;\n    useEffect(() => {\n        if (anchorPhase === \"settled\") return;\n        const saved = restored.anchor;\n        if (saved === null) { setAnchorPhase(\"settled\"); return; }\n        // Under the lens (#1349) a row it has laid out comes back where it was, once the layout near the top is drawn;\n        // a row the lens does not draw, the view starts at the top: no element of the record is sought for it.\n        if (lensWanted) {\n            if (!lensReadyNow) return;\n            const shown = body.findIndex((it, i) => it.kind !== \"band\" && keyOfItem(it, i) === saved.key);\n            if (shown >= 0) setRestoreAnchor({ index: shown, offset: saved.offset });\n            setAnchorPhase(\"settled\");\n            return;\n        }\n        if (body.length === 0) return;\n        // A band is a place in one run, never the item (see elementUnder): its element decides.\n        const at = body.findIndex((it, i) => it.kind !== \"band\" && keyOfItem(it, i) === saved.key);\n        // Where its element is now: a source that shrank past it keeps its last one.\n        const element = pagedSource !== undefined && saved.element !== null && pagedTotal !== undefined && pagedTotal > 0\n            ? Math.min(saved.element, pagedTotal - 1) : undefined;\n        if (at < 0 && element !== undefined) {\n            if (anchorPhase === \"pending\") {\n                setAnchorPhase(\"seeking\");\n                jumpBy.current = \"anchor\";\n                jumpToElement(element);\n                return;\n            }\n            // Until its window is in the run — landed, or failed — the item may yet come.\n            if (anchorJump === undefined || !anchorJump.settled) return;\n        }\n        anchorHandBack.current = anchorPhase === \"seeking\";\n        setRestoreAnchor(at >= 0 ? { index: at, offset: saved.offset } : { index: placeOf(body, saved.index, element), offset: 0 });\n        setAnchorPhase(\"settled\");\n    }, [anchorPhase, restored, body, pagedSource, pagedTotal, jumpToElement, anchorJump, lensWanted, lensReadyNow, jumpBy]);\n    useEffect(() => {\n        if (!anchorHandBack.current) return;\n        anchorHandBack.current = false;\n        clearJump();\n    }, [restoreAnchor, clearJump]);\n\n    // ── A narrowing keeps the row in view (#1398, CL8) ────────────────────\n    // A new narrowing of the rows keeps the row at the top of the view where it was — by its key, and the px into it —\n    // when the narrowing holds it, and else starts at the top, the view's top at the first item's however tall it is\n    // (#1345, #1349). Drawn already, the row is put back there at once. Over the record's rows, one the narrowing holds\n    // but has not drawn — far from where the lens reads first, or in a window the pages have not read — is read where it\n    // is, as a key search's jump reads it, and put back once drawn: under the lens the narrowing says whether it holds\n    // the row; the record's own rows hold every one. A narrowed source's own rows have no place to keep but their\n    // order: a new narrowing of them starts at the top.\n    const [keeping, setKeeping] = useState<{ anchor: SheetAnchor; element: number; phase: \"asking\" | \"seeking\"; query: string } | undefined>(undefined);\n    const toTop = useCallback(() => { setScrollTarget({ index: 0, align: \"start\" }, true); }, [setScrollTarget]);\n    const seenRowsQuery = useRef(rowsQuery);\n    useEffect(() => {\n        if (standingIn) return;\n        const previous = seenRowsQuery.current;\n        seenRowsQuery.current = rowsQuery;\n        if (rowsPart === undefined || previous === rowsQuery) return;\n        // A narrowing a reveal wrote: the reveal takes the view to its row (the hidden pick).\n        const revealed = revealedQuery.current;\n        revealedQuery.current = undefined;\n        if (revealed !== undefined && stringEqual(revealed, rowsQuery)) { setKeeping(undefined); return; }\n        const anchor = persistedRef.current.anchor;\n        const at = anchor === null ? -1 : body.findIndex((it, i) => (it.kind === \"real\" || it.kind === \"group\") && keyOfItem(it, i) === anchor.key);\n        if (anchor !== null && at >= 0) {\n            setKeeping(undefined);\n            setRestoreAnchor({ index: at, offset: anchor.offset });\n            return;\n        }\n        if (anchor !== null && recordRows && anchor.element !== null && (anchor.key.startsWith(\"row:\") || anchor.key.startsWith(\"group:\"))) {\n            setKeeping({ anchor, element: anchor.element, phase: \"asking\", query: rowsQuery });\n            return;\n        }\n        setKeeping(undefined);\n        toTop();\n    }, [rowsQuery, rowsPart, standingIn, body, recordRows, toTop, persistedRef]);\n    // Whether the new narrowing holds the row: every row where nothing narrows the record's rows; under the lens, as the\n    // narrowing says — a tracked read, none while it is asked.\n    const askKept = useCallback(() => {\n        if (keeping === undefined || keeping.phase !== \"asking\") return none;\n        if (!lensWanted || rowsPart === undefined || rowsWhere === undefined) return some(true);\n        const held = recordSliceWithinAt(rowsPart, rowsWhere, BigInt(keeping.element), 1n);\n        return held.type === \"some\" ? some(held.value[0] === true) : none;\n    }, [keeping, lensWanted, rowsPart, rowsWhere]);\n    const keptHeld = useTrackedEvaluation(askKept).result;\n    const keptJump = lensDrawn ? lens.jump : paging.jump;\n    useEffect(() => {\n        if (keeping === undefined) return;\n        // Another narrowing since: it decides for itself.\n        if (keeping.query !== rowsQuery) { setKeeping(undefined); return; }\n        if (keeping.phase === \"asking\") {\n            if (!keptHeld.ok) { setKeeping(undefined); toTop(); return; }\n            if (keptHeld.value.type === \"none\") return;\n            if (!keptHeld.value.value) { setKeeping(undefined); toTop(); return; }\n            setKeeping({ ...keeping, phase: \"seeking\" });\n            jumpBy.current = \"anchor\";\n            if (lensDrawn) lensJumpTo(keeping.element);\n            else jumpToElement(keeping.element);\n            return;\n        }\n        if (keptJump === undefined || !keptJump.settled) return;\n        setKeeping(undefined);\n        const at = body.findIndex((it, i) => (it.kind === \"real\" || it.kind === \"group\") && keyOfItem(it, i) === keeping.anchor.key);\n        if (at < 0) { clearJump(); toTop(); return; }\n        // Put back, the view is the viewer's again once the frame has scrolled there.\n        anchorHandBack.current = true;\n        setRestoreAnchor({ index: at, offset: keeping.anchor.offset });\n    }, [keeping, keptHeld, rowsQuery, lensDrawn, lensJumpTo, jumpToElement, keptJump, body, clearJump, toTop, jumpBy]);\n\n    const onAnchorChange = useCallback((at: { index: number; offset: number }) => {\n        const item = body[at.index];\n        if (item === undefined) return;\n        const next: SheetAnchor = { key: keyOfItem(item, at.index), offset: at.offset, index: at.index, element: pagedSource !== undefined ? elementUnder(item, at.offset) : null };\n        const p = persistedRef.current;\n        if (sameAnchor(p.anchor, next)) return;\n        persist({ ...p, anchor: next });\n    }, [body, pagedSource, persist, persistedRef]);\n\n    const [pendingIssue, setPendingIssue] = useState<SheetTransactionsIssue | undefined>(undefined);\n    const onIssue = useCallback((issue: SheetTransactionsIssue) => {\n        dispatch({ t: \"editor.blur\" });\n        setPendingIssue(issue);\n    }, [dispatch]);\n    useEffect(() => {\n        const issue = pendingIssue;\n        if (issue === undefined) return;\n        const groupIndex = body.findIndex(item => item.kind === \"group\" && stringEqual(item.row.id, issue.entry));\n        const groupItem = body[groupIndex];\n        if (issue.row.type === \"some\" && groupItem?.kind === \"group\" && groupItem.folded) {\n            dispatch({ t: \"fold.toggle\", r: rowSpace.rowOf[groupIndex]! });\n            return;\n        }\n        const index = issue.row.type === \"none\" ? body.findIndex(item => (item.kind === \"real\" || item.kind === \"group\") && stringEqual(item.row.id, issue.entry))\n            : body.findIndex(item => item.kind === \"real\" && item.group !== undefined && stringEqual(item.group.row.id, issue.entry) && item.group.index === Number(issue.row.value));\n        if (index < 0) return;\n        const r = rowSpace.rowOf[index]!;\n        const field = issue.field.type === \"some\" ? issue.field.value : undefined;\n        const column = field === undefined ? -1 : columns.list.findIndex(col => stringEqual(col.key, field));\n        dispatch({ t: \"select.set\", r, c: Math.max(0, column) });\n        setScrollTarget({ index, align: \"auto\" });\n        // The note names the place as the sheet does: the column by its header, else the row by its first text.\n        const where = column >= 0 ? columns.list[column]!.header : rowNameOf(rows.find((row) => stringEqual(row.id, issue.entry)), columns) ?? issue.entry;\n        dispatchStore({ t: \"patch\", patch: { msg: { id: \"issue\", where, issue } } });\n        cardRef.current?.focus({ preventScroll: true });\n        setPendingIssue(undefined);\n    }, [pendingIssue, body, rowSpace, columns, rows, dispatch, cardRef, dispatchStore, setScrollTarget]);\n    return { issueSought, onAnchorChange, onIssue, pickSearch, restoreAnchor, revealRef, rowsPick, seek };\n}\n\n/** What {@link useSheetJumps} gives the parts after it. */\nexport type SheetJumps = ReturnType<typeof useSheetJumps>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useCallback } from \"react\";\nimport { none, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport type { SheetSavedView } from \"./values.js\";\n\ninterface Count { count: number | undefined; error?: string }\n\n/**\n * Exact indexed counts for the saved tabs (#1345): each view's narrowing of\n * the `rows` source, counted through the record's indexes — the rows the tab\n * shows — and the whole record's for All. A view that holds no `rows`\n * narrowing counts every row. Pending counts never become resident-row counts.\n *\n * @param rows - The `rows` source's part of the sheet's slice; `undefined` with no `rows` source\n * @param views - The saved views\n * @returns The whole count, and each view's, by its id\n */\nexport function useRecordViewCounts(rows: ValueTypeOf<RecordSliceBindType> | undefined, views: readonly SheetSavedView[]) {\n    const read = useCallback(() => {\n        const counts = new Map<string, Count>();\n        if (rows === undefined) return { total: undefined, counts };\n        const total = rows.total();\n        for (const view of views) {\n            try {\n                // A saved view's narrowing, read alone: never a read by area (#1432).\n                const count = rows.countWhere({ where: view.narrowing.get(\"rows\")?.where ?? new Map(), area: none });\n                counts.set(view.id, { count: count.type === \"some\" ? Number(count.value) : undefined });\n            } catch (error) {\n                counts.set(view.id, { count: undefined, error: error instanceof Error ? error.message : String(error) });\n            }\n        }\n        return { total: total.type === \"some\" ? Number(total.value) : undefined, counts };\n    }, [rows, views]);\n    return useTrackedEvaluation(read).result;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The view tabs (B§8, `Sheet Spec.md` §5 row 17): the pinned whole-sheet\n * tab with the planned count, one tab per saved view with its live match\n * count, the dirty dot when the slice's narrowing has drifted from the\n * active view's, × (hover neg) and middle-click to close, double-click to\n * rename, drag to reorder, and `+ TAB` to snapshot the current view. The\n * tabs are chrome over the machine: every gesture is an event, every\n * change to the views leaves as `emit.views`.\n *\n * The tabs are a WAI-ARIA tablist (#860), one tab stop on the active tab:\n * ← / → move between the tabs and Home / End to the first and last, Enter\n * or Space switches to the one focused, Delete closes it and F2 renames it —\n * and a rename or a close by the keyboard leaves the focus on a tab. `+n`\n * and `+ TAB` are buttons beside the tablist; a tab's × is the pointer's,\n * and Delete is the keyboard's.\n *\n * Under width pressure the strip never scrolls. The toolbar folds it, as\n * forms of its one ladder (#952): its trailing tabs fold — the active one\n * always kept — into a `+n` menu that switches to the tab picked; then, as\n * the row needs, the strip drops its `+ TAB` label and the whole-sheet\n * count, caps its names, and closes up; then (#1221) it folds into one\n * chip — the open view's tab with a caret — whose menu holds every view,\n * `+ TAB` and the open view's close ({@link SheetTabsFold}). Where the sheet\n * has a key search, the chip folds last into the key search's popover\n * (#1345): every view a choice over the search box, then `+ TAB` and the open\n * view's close. Renaming and reordering wait for a row with room for the tabs.\n *\n * In a phone's frame (`strip: \"phone\"`, `Mobile Builder Frame Spec.md` FR2)\n * the strip is every tab inline at 44px, scrolling sideways in the row's\n * slack, each with its count and no ×, and `+ TAB` only while the narrowing is\n * one no tab holds — the whole sheet's narrowed, or the open view's drifted.\n */\n\nimport { memo, useEffect, useLayoutEffect, useRef, type DragEvent, type KeyboardEvent, type MouseEvent } from \"react\";\nimport { Box, Button, chakra, Menu as ChakraMenu, useSlotRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faChevronDown, faPlus, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport { FrameMenuLayer, SliceChoiceGroup, SliceClearButton, useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { foldTabs } from \"./lens.js\";\nimport { useSheetWords } from \"./words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** The whole-sheet tab's key among the tabs. */\nconst ALL = \"all\";\n\n/** The folded strip's menu items (#1221): a view's value is its id after this prefix, so none is taken for another item. */\nconst MENU_VIEW = \"view:\";\n/** The menu's `+ TAB`. */\nconst MENU_NEW = \"+new\";\n/** The menu's close of the open view. */\nconst MENU_CLOSE = \"+close\";\n\n/** The strip's form, as the toolbar folds it (#952). */\nexport interface SheetTabsFold {\n    /** How many trailing tabs fold into the `+n` menu — the active tab never does. */\n    folded: number;\n    /** Past its fold, how far the strip closes up: `compact` drops the\n     *  `+ TAB` label and the whole-sheet count, `capped` caps the tab names\n     *  at 72px as well, `closed` closes the gaps and drops every count;\n     *  `menu` (#1221) folds it into one chip, the open view's, whose menu\n     *  holds every view, `+ TAB` and the open view's close; and `search`\n     *  (#1345) is the views as the key search's popover holds them, once the\n     *  chip folds into it: every view a choice, then `+ TAB` and the open\n     *  view's close; `phone` is a phone's frame's strip (see the module docs). */\n    strip?: \"compact\" | \"capped\" | \"closed\" | \"menu\" | \"search\" | \"phone\" | undefined;\n    /** In the key search's popover: closes it once a view is picked, made or closed there, as the chip's menu closes. */\n    onDone?: (() => void) | undefined;\n}\n\n/** One tab's facts. */\nexport interface SheetTabView {\n    id: string;\n    name: string;\n    /** Rows the view's narrowing matches, live. */\n    count: number | undefined;\n    /** The hover title — the query and the gestures. */\n    title: string;\n}\n\nexport interface SheetTabsProps {\n    styles: Styles;\n    views: readonly SheetTabView[];\n    /** The pinned whole-sheet tab's count — the planned rows. */\n    wholeCount: number | undefined;\n    /** The active view's id; `null` = the whole sheet. */\n    active: string | null;\n    /** The active view's narrowing differs from the slice's. */\n    dirty: boolean;\n    /** Whether a query is set — the `+ TAB` title. */\n    hasQuery: boolean;\n    /** Whether any choice narrows the sheet — a query, a value, a range: what a phone's strip offers `+ TAB` over on the whole sheet. */\n    narrowed?: boolean | undefined;\n    renaming: string | null;\n    renameVal: string;\n    /** The element the tabs switch — the sheet's grid (`aria-controls`). */\n    panelId?: string | undefined;\n    /** The strip's form, as the toolbar folds it — nothing folded by default. */\n    fold?: SheetTabsFold | undefined;\n    /** Whether a run of the optimiser has just landed (#1409): the open tab's count flashes once with its cascade. */\n    flash?: boolean | undefined;\n    onSwitch: (id: string | null) => void;\n    onCreate: () => void;\n    onClose: (id: string) => void;\n    onRenameStart: (id: string) => void;\n    onRenameChange: (val: string) => void;\n    onRenameCommit: () => void;\n    onRenameCancel: () => void;\n    onReorder: (id: string, to: number) => void;\n}\n\n/** Renders the tab strip. */\nexport const SheetTabs = memo(function SheetTabs(props: SheetTabsProps) {\n    const { styles, views, wholeCount, active, dirty, hasQuery, narrowed, renaming, renameVal, panelId, fold, flash } = props;\n    const menuStyles = useSlotRecipe({ key: \"menu\" })() as unknown as Styles;\n    const phone = useSlotStyles(\"toolbarPhone\");\n    // The tabs' words and counts, in the app's locale (#850, #861).\n    const words = useSheetWords();\n    const { m } = words;\n    const dragging = useRef<string | null>(null);\n    const renameRef = useRef<HTMLInputElement | null>(null);\n    const skipBlur = useRef(false);\n    useEffect(() => {\n        if (renaming !== null && renameRef.current !== null) {\n            renameRef.current.focus();\n            renameRef.current.select();\n        }\n    }, [renaming]);\n\n    // The fold the toolbar chose: the trailing tabs in the `+n` menu (#952).\n    const { visible, hidden } = foldTabs(views, active, fold?.folded ?? 0);\n\n    // The tablist's keys (#860). The tabs in order, the whole sheet first; the\n    // one tab stop is the active tab.\n    const tabEls = useRef(new Map<string, HTMLElement>());\n    const tabRef = (key: string) => (el: HTMLElement | null) => {\n        if (el !== null) tabEls.current.set(key, el);\n        else tabEls.current.delete(key);\n    };\n    const order = [ALL, ...visible.map((v) => v.id)];\n    const current = active ?? ALL;\n    // A tab the focus goes to once the tabs have drawn — after a rename or a\n    // close by the keyboard; the whole-sheet tab when that one is gone.\n    const focusNext = useRef<string | undefined>(undefined);\n    useLayoutEffect(() => {\n        const key = focusNext.current;\n        if (key === undefined || renaming !== null) return;\n        focusNext.current = undefined;\n        (tabEls.current.get(key) ?? tabEls.current.get(ALL))?.focus();\n    });\n    const onTabKey = (key: string) => (e: KeyboardEvent<HTMLElement>) => {\n        const i = order.indexOf(key);\n        const n = order.length;\n        let to: string | undefined;\n        switch (e.key) {\n            case \"ArrowRight\": to = order[(i + 1) % n]; break;\n            case \"ArrowLeft\": to = order[(i - 1 + n) % n]; break;\n            case \"Home\": to = order[0]; break;\n            case \"End\": to = order[n - 1]; break;\n            case \"Enter\":\n            case \" \":\n                if (key !== current) props.onSwitch(key === ALL ? null : key);\n                break;\n            case \"Delete\":\n                if (key === ALL) return;\n                focusNext.current = order[i + 1] ?? order[i - 1];\n                props.onClose(key);\n                break;\n            case \"F2\":\n                if (key === ALL) return;\n                props.onRenameStart(key);\n                break;\n            default:\n                return;\n        }\n        e.preventDefault();\n        e.stopPropagation();\n        if (to !== undefined) tabEls.current.get(to)?.focus();\n    };\n\n    const onDragOver = (e: DragEvent) => e.preventDefault();\n    const dropAt = (to: number) => (e: DragEvent) => {\n        e.preventDefault();\n        const id = dragging.current;\n        dragging.current = null;\n        if (id !== null) props.onReorder(id, to);\n    };\n    const onRenameKey = (e: KeyboardEvent<HTMLInputElement>) => {\n        e.stopPropagation();\n        // Ended by the keyboard, the focus goes back to the tab.\n        if (e.key === \"Enter\") { e.preventDefault(); skipBlur.current = true; focusNext.current = renaming ?? undefined; props.onRenameCommit(); }\n        if (e.key === \"Escape\") { e.preventDefault(); skipBlur.current = true; focusNext.current = renaming ?? undefined; props.onRenameCancel(); }\n    };\n    const onRenameBlur = () => {\n        if (skipBlur.current) { skipBlur.current = false; return; }\n        props.onRenameCommit();\n    };\n\n    // Folded with the key search into its popover (#1345): every view a choice, the open one pressed, each with\n    // its count; then `+ TAB` and the open view's close — what the chip's menu holds, and each closes the popover,\n    // as an item closes the chip's menu.\n    if (fold?.strip === \"search\") {\n        const open = active === null ? undefined : views.find((v) => v.id === active);\n        const count = (n: number | undefined) => (n === undefined ? null : BigInt(n));\n        const done = (act: () => void) => () => { act(); fold.onDone?.(); };\n        return (\n            <Box css={styles.searchViews} data-slot=\"searchViews\" role=\"group\" aria-label={m.tabList()}>\n                <SliceChoiceGroup\n                    choices={[\n                        { id: ALL, label: m.tabAll(), active: active === null, count: count(wholeCount) },\n                        ...views.map((v) => ({ id: `${MENU_VIEW}${v.id}`, label: v.name, active: v.id === active, count: count(v.count) })),\n                    ]}\n                    onPick={(id) => done(() => props.onSwitch(id.startsWith(MENU_VIEW) ? id.slice(MENU_VIEW.length) : null))()} />\n                <Box css={styles.searchViewsActions}>\n                    <Button size=\"xs\" variant=\"ghost\" title={m.tabAddTitle({ query: hasQuery })} onClick={done(props.onCreate)}>\n                        <FontAwesomeIcon icon={faPlus} />{m.tabAddName()}\n                    </Button>\n                    {open !== undefined && <SliceClearButton label={m.tabCloseView({ name: open.name })} onClick={done(() => props.onClose(open.id))} />}\n                </Box>\n            </Box>\n        );\n    }\n\n    // A phone's (FR2): every tab inline, scrolling sideways; `+ TAB` while the narrowing is one no tab holds.\n    if (fold?.strip === \"phone\") {\n        const canAdd = active === null ? narrowed === true : dirty;\n        const tab = (key: string, label: string, count: number | undefined, on: boolean, title: string) => (\n            <chakra.button key={key} ref={tabRef(key)} type=\"button\" css={phone.view} data-slot=\"tab\" data-tab={key}\n                data-active={on ? \"\" : undefined} data-dirty={on && dirty && key !== ALL ? \"\" : undefined}\n                role=\"tab\" aria-selected={on} aria-controls={panelId} tabIndex={current === key ? 0 : -1} title={title}\n                onClick={() => { if (!on) props.onSwitch(key === ALL ? null : key); }} onKeyDown={onTabKey(key)}>\n                <Box as=\"span\" css={phone.viewLabel} data-slot=\"tabLabel\">{label}</Box>\n                <Box as=\"span\" css={phone.viewCount} data-slot=\"tabCount\" data-opn={flash === true && on ? \"\" : undefined}>{count === undefined ? \"…\" : words.number(count)}</Box>\n            </chakra.button>\n        );\n        return (\n            <Box css={phone.views} data-slot=\"tabs\" data-strip=\"phone\">\n                <Box display=\"contents\" role=\"tablist\" aria-label={m.tabList()}>\n                    {tab(ALL, m.tabAll(), wholeCount, active === null, m.tabAllTitle())}\n                    {views.map((v) => tab(v.id, v.name, v.count, active === v.id, v.title))}\n                </Box>\n                {canAdd && <chakra.button type=\"button\" css={phone.viewAdd} data-slot=\"tabAdd\" aria-label={m.tabAddName()}\n                    title={m.tabAddTitle({ query: hasQuery })} onClick={props.onCreate}>+ {m.tabAdd()}</chakra.button>}\n            </Box>\n        );\n    }\n\n    // Folded into one chip (#1221): the open view's tab and a caret, its menu\n    // every view, `+ TAB` and the open view's close.\n    if (fold?.strip === \"menu\") {\n        const open = active === null ? undefined : views.find((v) => v.id === active);\n        const name = open?.name ?? m.tabAll();\n        return (\n            <Box css={styles.tabs} data-slot=\"tabs\" data-strip=\"menu\">\n                <ChakraMenu.Root positioning={{ placement: \"bottom-start\" }} onSelect={(d) => {\n                    if (d.value === MENU_NEW) props.onCreate();\n                    else if (d.value === MENU_CLOSE) { if (active !== null) props.onClose(active); }\n                    else props.onSwitch(d.value.startsWith(MENU_VIEW) ? d.value.slice(MENU_VIEW.length) : null);\n                }}>\n                    <ChakraMenu.Trigger asChild>\n                        <chakra.button type=\"button\" css={styles.tabMenu} data-slot=\"tabMenu\" data-tab={active ?? ALL}\n                            aria-label={m.tabMenuName({ name })} title={m.tabMenuTitle()}>\n                            <Box as=\"span\" css={styles.tabLabel} data-slot=\"tabLabel\">{name}</Box>\n                            {open !== undefined && dirty && <Box as=\"span\" css={styles.tabDot} data-slot=\"tabDot\" title={m.tabDirty()} />}\n                            <FontAwesomeIcon icon={faChevronDown} data-slot=\"tabMenuCaret\" />\n                        </chakra.button>\n                    </ChakraMenu.Trigger>\n                    <FrameMenuLayer label={m.tabList()}>\n                                <ChakraMenu.Item value={ALL} title={m.tabAllTitle()}>\n                                    {m.tabAll()}\n                                    <Box as=\"span\" css={menuStyles.itemCommand}>{wholeCount === undefined ? \"…\" : words.number(wholeCount)}</Box>\n                                </ChakraMenu.Item>\n                                {views.map((v) => (\n                                    <ChakraMenu.Item key={v.id} value={`${MENU_VIEW}${v.id}`} title={v.title}>\n                                        {v.name}\n                                        <Box as=\"span\" css={menuStyles.itemCommand}>{v.count === undefined ? \"…\" : words.number(v.count)}</Box>\n                                    </ChakraMenu.Item>\n                                ))}\n                                <ChakraMenu.Separator />\n                                <ChakraMenu.Item value={MENU_NEW} title={m.tabAddTitle({ query: hasQuery })}>{m.tabAddName()}</ChakraMenu.Item>\n                                {open !== undefined && <ChakraMenu.Item value={MENU_CLOSE}>{m.tabCloseView({ name: open.name })}</ChakraMenu.Item>}\n                            </FrameMenuLayer>\n                </ChakraMenu.Root>\n            </Box>\n        );\n    }\n\n    return (\n        <Box css={styles.tabs} data-slot=\"tabs\" data-folded={hidden.length > 0 ? hidden.length : undefined} data-strip={fold?.strip}>\n            <Box css={styles.tabList} data-slot=\"tabList\" role=\"tablist\" aria-label={m.tabList()}>\n                <Box\n                    ref={tabRef(ALL)}\n                    as=\"span\"\n                    css={styles.tab}\n                    data-slot=\"tab\"\n                    data-tab=\"all\"\n                    data-active={active === null ? \"\" : undefined}\n                    role=\"tab\"\n                    aria-selected={active === null}\n                    aria-controls={panelId}\n                    tabIndex={current === ALL ? 0 : -1}\n                    title={m.tabAllTitle()}\n                    onMouseDown={(e: MouseEvent) => { if (e.button !== 0) return; e.preventDefault(); props.onSwitch(null); }}\n                    onKeyDown={onTabKey(ALL)}\n                    onDragOver={onDragOver}\n                    onDrop={dropAt(0)}\n                >\n                    {m.tabAll()}\n                    <Box as=\"span\" css={styles.tabCount} data-slot=\"tabCount\" data-opn={flash === true && active === null ? \"\" : undefined}>{wholeCount === undefined ? \"…\" : words.number(wholeCount)}</Box>\n                </Box>\n                {visible.map((v) => {\n                    const on = active === v.id;\n                    const i = views.findIndex((x) => x.id === v.id);\n                    if (renaming === v.id) {\n                        return (\n                            <Box key={v.id} as=\"span\" css={styles.tab} data-slot=\"tab\" data-tab={v.id} data-active=\"\" data-renaming=\"\" role=\"tab\" aria-selected={on}>\n                                <chakra.input\n                                    ref={renameRef}\n                                    css={styles.tabRename}\n                                    data-slot=\"tabRename\"\n                                    value={renameVal}\n                                    aria-label={m.tabRename()}\n                                    onChange={(e) => props.onRenameChange(e.target.value)}\n                                    onKeyDown={onRenameKey}\n                                    onBlur={onRenameBlur}\n                                />\n                            </Box>\n                        );\n                    }\n                    return (\n                        <Box\n                            key={v.id}\n                            ref={tabRef(v.id)}\n                            as=\"span\"\n                            css={styles.tab}\n                            data-slot=\"tab\"\n                            data-tab={v.id}\n                            data-active={on ? \"\" : undefined}\n                            data-dirty={on && dirty ? \"\" : undefined}\n                            role=\"tab\"\n                            aria-selected={on}\n                            aria-controls={panelId}\n                            tabIndex={current === v.id ? 0 : -1}\n                            title={v.title}\n                            draggable\n                            onMouseDown={(e: MouseEvent) => { if (e.button !== 0 || on) return; e.preventDefault(); props.onSwitch(v.id); }}\n                            onKeyDown={onTabKey(v.id)}\n                            onAuxClick={(e: MouseEvent) => { if (e.button === 1) { e.preventDefault(); props.onClose(v.id); } }}\n                            onDoubleClick={(e: MouseEvent) => { e.preventDefault(); props.onRenameStart(v.id); }}\n                            onDragStart={() => { dragging.current = v.id; }}\n                            onDragOver={onDragOver}\n                            onDrop={dropAt(i)}\n                        >\n                            <Box as=\"span\" css={styles.tabLabel} data-slot=\"tabLabel\">{v.name}</Box>\n                            <Box as=\"span\" css={styles.tabCount} data-slot=\"tabCount\" data-opn={flash === true && on ? \"\" : undefined}>{v.count === undefined ? \"…\" : words.number(v.count)}</Box>\n                            {on && dirty && (\n                                <Box as=\"span\" css={styles.tabDot} data-slot=\"tabDot\" title={m.tabDirty()} />\n                            )}\n                            {/* The pointer's close; the keyboard's is Delete on the tab. */}\n                            <Box\n                                as=\"span\"\n                                css={styles.tabClose}\n                                data-slot=\"tabClose\"\n                                aria-hidden=\"true\"\n                                title={m.tabClose()}\n                                onMouseDown={(e: MouseEvent) => { e.preventDefault(); e.stopPropagation(); props.onClose(v.id); }}\n                            >\n                                <FontAwesomeIcon icon={faXmark} />\n                            </Box>\n                        </Box>\n                    );\n                })}\n            </Box>\n            {hidden.length > 0 && (\n                <ChakraMenu.Root positioning={{ placement: \"bottom-start\" }} onSelect={(d) => props.onSwitch(d.value)}>\n                    <ChakraMenu.Trigger asChild>\n                        <chakra.button type=\"button\" css={styles.tabMore} data-slot=\"tabMore\"\n                            aria-label={m.tabMoreName({ n: hidden.length, count: words.number(hidden.length) })} title={m.tabMoreTitle()}>\n                            {m.tabMore({ n: hidden.length, count: words.number(hidden.length) })}\n                            <FontAwesomeIcon icon={faChevronDown} style={{ fontSize: \"8px\", opacity: 0.7 }} />\n                        </chakra.button>\n                    </ChakraMenu.Trigger>\n                    <FrameMenuLayer label={m.tabMoreTitle()}>\n                                {hidden.map((v) => (\n                                    <ChakraMenu.Item key={v.id} value={v.id} title={v.title}>\n                                        {v.name}\n                                        <Box as=\"span\" css={menuStyles.itemCommand}>{v.count === undefined ? \"…\" : words.number(v.count)}</Box>\n                                    </ChakraMenu.Item>\n                                ))}\n                            </FrameMenuLayer>\n                </ChakraMenu.Root>\n            )}\n            <chakra.button\n                type=\"button\"\n                css={styles.tabAdd}\n                data-slot=\"tabAdd\"\n                aria-label={m.tabAddName()}\n                title={m.tabAddTitle({ query: hasQuery })}\n                onMouseDown={(e: MouseEvent) => { if (e.button !== 0) return; e.preventDefault(); props.onCreate(); }}\n                // Enter or Space on the focused button: a click with no pointer behind it.\n                onClick={(e: MouseEvent) => { if (e.detail === 0) props.onCreate(); }}\n                onDragOver={onDragOver}\n                onDrop={dropAt(views.length)}\n            >\n                <FontAwesomeIcon icon={faPlus} style={{ fontSize: \"8px\" }} />\n                <Box as=\"span\" data-slot=\"tabAddLabel\">{m.tabAdd()}</Box>\n            </chakra.button>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The view tabs and the lens's chrome: each tab's count, a grouped sheet's summary, the folds, and the lens's count line.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo } from \"react\";\nimport { countNoun, isLooseRow, lineRowsOf, rowIsBlank } from \"./model.js\";\nimport { narrowingQuery, narrowingScope } from \"./view-state.js\";\nimport { useRecordViewCounts } from \"./use-record-view-counts.js\";\nimport { lensCount } from \"./lens.js\";\nimport type { SheetWords } from \"./words.js\";\nimport { SheetTabs, type SheetTabsFold, type SheetTabView } from \"./Tabs.js\";\nimport type { SheetToolbarTabs } from \"./Toolbar.js\";\nimport type { SheetSavedView } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetOpenEditor } from \"./use-open-editor.js\";\n\n/** A view's hover title, worded by the existing Sheet message table. */\nfunction viewTitle(view: SheetSavedView, words: SheetWords): string {\n    const q = narrowingQuery(view.narrowing).trim();\n    return words.m.viewTitle({ scope: narrowingScope(view.narrowing), query: q });\n}\n\n/**\n * Reads the view tabs and what the toolbar says of the lens (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetOpenEditor - The styles and the open editor\n * @returns The tabs, the summary, the folds and the lens's count\n */\nexport function useSheetViewTabs(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetMachine: SheetMachine, sheetOpenEditor: SheetOpenEditor) {\n    const { allColumns, gridId, group, lensWanted, narrowing, noun, rowsPart, views, words } = sheetDecode;\n    const { foldedOf, lens, rows, ui } = sheetSession;\n    const { lensLayout } = sheetBody;\n    const { dirty, dispatch } = sheetMachine;\n    const { styles } = sheetOpenEditor;\n    // ── The view tabs and the lens's chrome (B§8) ─────────────────────────\n    // A grouped sheet counts LINES (#740) — and its loose rows, each a row of its own (#846). A row is\n    // counted by every declared column, the hidden ones too (#1186).\n    const countedRows = useMemo(() => (group !== undefined ? rows.flatMap((g) => (isLooseRow(g) ? [g] : lineRowsOf(g))) : rows), [group, rows]);\n    const wholeCount = useMemo(() => countedRows.filter((row) => !rowIsBlank(row, allColumns)).length, [countedRows, allColumns]);\n    // Each tab counts the rows its view's narrowing of the `rows` source shows, through the record's indexes (#1345):\n    // the records — a grouped sheet's groups — never the resident rows.\n    const recordViewCounts = useRecordViewCounts(rowsPart, views);\n    const tabWholeCount = recordViewCounts.ok ? recordViewCounts.value.total : undefined;\n    const tabViews = useMemo<SheetTabView[]>(() => {\n        if (rowsPart === undefined) return [];\n        return views.map((v) => {\n            const result = recordViewCounts.ok ? recordViewCounts.value.counts.get(v.id) : undefined;\n            return { id: v.id, name: v.name, count: result?.count,\n                title: result?.error === undefined ? viewTitle(v, words) : `${viewTitle(v, words)} — ${result.error}` };\n        });\n    }, [rowsPart, recordViewCounts, views, words]);\n    const summary = useMemo(() => {\n        if (group === undefined) return undefined;\n        // The groups, their lines and the sub rows under them — and the loose rows between the groups (#846).\n        const groups = rows.filter((g) => !isLooseRow(g));\n        const lines = groups.reduce((n, g) => n + g.lines.length, 0);\n        const looseCount = rows.length - groups.length;\n        const subRows = groups.reduce((n, g) => n + g.lines.reduce((m, l) => m + l.subRows.length, 0), 0);\n        return words.m.summary({\n            groups: countNoun(groups.length, noun, words), n: lines, lines: words.number(lines),\n            nLoose: looseCount, loose: words.number(looseCount), nSub: subRows, subRows: words.number(subRows),\n        });\n    }, [group, noun, rows, words]);\n    const onTabSwitch = useCallback((id: string | null) => dispatch({ t: \"tab.switch\", id }), [dispatch]);\n    const onTabCreate = useCallback(() => dispatch({ t: \"tab.create\" }), [dispatch]);\n    const onTabClose = useCallback((id: string) => dispatch({ t: \"tab.close\", id }), [dispatch]);\n    const onTabRenameStart = useCallback((id: string) => dispatch({ t: \"tab.rename.start\", id }), [dispatch]);\n    const onTabRenameChange = useCallback((val: string) => dispatch({ t: \"tab.rename.change\", val }), [dispatch]);\n    const onTabRenameCommit = useCallback(() => dispatch({ t: \"tab.rename.commit\" }), [dispatch]);\n    const onTabRenameCancel = useCallback(() => dispatch({ t: \"tab.rename.cancel\" }), [dispatch]);\n    const onTabReorder = useCallback((id: string, to: number) => dispatch({ t: \"tab.reorder\", id, to }), [dispatch]);\n    const onFold = useCallback((r: number, all?: boolean) => dispatch({ t: \"fold.toggle\", r, ...(all === true ? { all: true } : {}) }), [dispatch]);\n    // A line's chevron: its sub rows show or hide; ⌥ takes the group's every line.\n    const onSubRows = useCallback((r: number, all: boolean) => dispatch({ t: \"subRows.toggle\", r, ...(all ? { all: true } : {}) }), [dispatch]);\n    // The header corner's fold-all: whether every group is folded decides which way it goes.\n    const onFoldAll = useCallback((folded: boolean) => dispatch({ t: \"fold.all\", folded }), [dispatch]);\n    const foldAll = useMemo(() => {\n        if (group === undefined) return undefined;\n        // Loose rows have nothing to fold (#846): fold-all passes them by.\n        const groups = rows.filter((row) => !isLooseRow(row));\n        return { folded: groups.length > 0 && groups.every((row) => foldedOf(row)), count: groups.length, noun, onFoldAll };\n    }, [group, noun, rows, foldedOf, onFoldAll]);\n    const hasQuery = narrowing !== undefined && narrowingQuery(narrowing).trim() !== \"\";\n    // Whether any source holds a choice: what a phone's strip offers `+ TAB` over, on the whole sheet (FR2).\n    const narrowed = narrowing !== undefined && narrowingScope(narrowing) !== \"none\";\n    // The view tabs, as the toolbar folds them (#952): the strip in each of\n    // its forms, how far it can fold, and what it shows — so a change of it\n    // has the strip measured again.\n    const tabsVersion = `${tabViews.map((v) => `${v.id}:${v.name}:${v.count}`).join(\"|\")}|${tabWholeCount}|${ui.tabs.active ?? \"\"}|${dirty}|${hasQuery}|${narrowed}`;\n    // The view tabs show while the slice narrows the rows: each view is every source's narrowing.\n    const tabs: SheetToolbarTabs | undefined = rowsPart !== undefined\n        ? {\n            maxFold: tabViews.length - (tabViews.some((v) => v.id === ui.tabs.active) ? 1 : 0),\n            version: tabsVersion,\n            held: ui.tabs.renaming !== null,\n            render: (fold: SheetTabsFold) => (\n                <SheetTabs\n                    styles={styles}\n                    views={tabViews}\n                    wholeCount={tabWholeCount}\n                    active={ui.tabs.active}\n                    dirty={dirty}\n                    hasQuery={hasQuery}\n                    narrowed={narrowed}\n                    renaming={ui.tabs.renaming}\n                    renameVal={ui.tabs.renameVal}\n                    fold={fold}\n                    onSwitch={onTabSwitch}\n                    onCreate={onTabCreate}\n                    onClose={onTabClose}\n                    onRenameStart={onTabRenameStart}\n                    onRenameChange={onTabRenameChange}\n                    onRenameCommit={onTabRenameCommit}\n                    onRenameCancel={onTabRenameCancel}\n                    onReorder={onTabReorder}\n                    panelId={gridId}\n                />\n            ),\n        }\n        : undefined;\n    // The lens's count line (#1349): the rows — a grouped sheet's groups — the narrowing holds, as e3 counts them.\n    const lensMatches = lens.matches;\n    const count = !lensWanted || lensLayout === undefined ? \"\" : lensCount(lensMatches ?? lensLayout.hits, words);\n    return { count, foldAll, lensMatches, onFold, onSubRows, summary, tabs, wholeCount };\n}\n\n/** What {@link useSheetViewTabs} gives the parts after it. */\nexport type SheetViewTabs = ReturnType<typeof useSheetViewTabs>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Arity (B§4.6 — `Sheet Spec.md` §5 row 9): while the arity half is being\n * edited the strip meta reads *4 × CNC router implied · 3 named so far* — never\n * inside the cell. Named = each identified member once, a counted member by\n * its count, a range by its span; text and placeholders do not count.\n */\n\nimport { rangeMembers, type LinkVocabulary } from \"./grammar.js\";\nimport type { SheetMemberValue } from \"../values.js\";\nimport type { SheetWords } from \"../words.js\";\n\n/** A counted member the arity rule proposes. */\nexport interface Counted {\n    n: number;\n    key: string;\n}\n\n/** How many members a half names. */\nexport function namedCount(members: readonly SheetMemberValue[], vocab: LinkVocabulary): number {\n    let n = 0;\n    for (const m of members) {\n        switch (m.type) {\n            case \"identified\": n += 1; break;\n            case \"counted\": n += Number(m.value.n); break;\n            case \"range\": n += rangeMembers(m.value.from, m.value.to, vocab).length; break;\n            default: break;\n        }\n    }\n    return n;\n}\n\n/**\n * The strip meta for the arity half, in the sheet's words (#861) — `\"\"` when\n * nothing is implied or named.\n *\n * @param implied - The count the arity rule implies\n * @param named - How many members the half names\n * @param w - The sheet's words\n * @returns The line\n */\nexport function arityMeta(implied: Counted | undefined, named: number, w: SheetWords): string {\n    if (implied === undefined || implied.n <= 0 || named <= 0) return \"\";\n    const state = named < implied.n ? \"short\" : named > implied.n ? \"over\" : \"exact\";\n    return w.m.arity({ count: w.number(implied.n), key: implied.key, named: w.number(named), state });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The docked strip (B§9) — the only surface for candidates, previews and\n * provenance; nothing ever floats over the sheet. Six states: editing with\n * an empty buffer (what the field ACCEPTS, nothing armed), editing with\n * candidates (the armed chip in brand tint), the link's prediction and\n * no-candidate lines, the date / quantity preview, and — not editing — the\n * pending suggestions: one chip per pending fill (the next target armed),\n * `+n rows`, a dashed pending chip per provider still in flight, the\n * provenance line. `buildStrip` is pure; `SheetStrip` draws it.\n *\n * The strip never scrolls and never clips a chip mid-way:\n * the chips are measured once (an unseen copy of the row) and cut into\n * PAGES that fit the row, with a `‹ 1/3 ›` pager at the row's end when there\n * is more than one; the page follows the armed chip. The band stands as tall\n * as a row and its type matches the cells' (chips mono 12). A seventh state:\n * with nothing to suggest and the ring resting on a cell that says more than\n * its value, the strip shows the cell's DETAIL (`detail.ts`, #844) — the\n * wanted date behind one that has happened, a column's `detail` text.\n */\n\nimport { memo, useLayoutEffect, useRef, useState } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faChevronLeft, faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { candidateList, candidateAt, type CandidateContext } from \"./candidates.js\";\nimport { cellText, formatQuantity, memberLabel, type SheetColumnMeta } from \"./model.js\";\nimport type { LinkCandidate } from \"./link/predict.js\";\nimport { parseDate, formatDateLong, daysBetween, formatWhen, whenAccepts, type WhenLevel } from \"./parse/date.js\";\nimport { parseQuantity } from \"./parse/quantity.js\";\nimport type { EditBuffer } from \"./sheet-types.js\";\nimport type { SheetCellValue, SheetMemberValue } from \"./values.js\";\nimport { useSheetWords, type SheetWords } from \"./words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nconst stringEqual = equalFor(StringType);\n\n/** What a strip chip does when clicked. */\nexport type StripAction =\n    /** A candidate — its member replaces the buffer, in the words it shows. */\n    | { kind: \"candidate\"; label: string; key: string; i: number }\n    /** A link chip — adds members to the active half. */\n    | { kind: \"members\"; label: string; members: SheetMemberValue[] }\n    /** A pending fill — takes it. */\n    | { kind: \"fill\"; key: string }\n    /** The `+n rows` chip — takes every suggestion. */\n    | { kind: \"rows\" };\n\n/** One strip chip. */\nexport interface StripChip {\n    key: string;\n    label: string;\n    /** Armed (brand tint). */\n    on: boolean;\n    /** A preview-only entry — not an action. */\n    flat: boolean;\n    /** Pending — an async provider in flight. */\n    pending?: boolean;\n    title: string;\n    /** What a click does. */\n    action?: StripAction | undefined;\n}\n\n/** The strip model. */\nexport interface StripModel {\n    on: boolean;\n    label: string;\n    chips: StripChip[];\n    meta: string;\n    keys: string;\n}\n\nconst OFF: StripModel = { on: false, label: \"\", chips: [], meta: \"\", keys: \"\" };\n\n/** What the strip reads beside the edit buffer. */\nexport interface StripInput {\n    /** The sheet's words — the strip speaks them (#861), and a number reads and previews in the viewer's language, as the cells print (#852). */\n    words: SheetWords;\n    edit: EditBuffer | null;\n    meta: SheetColumnMeta | undefined;\n    candidates: CandidateContext | undefined;\n    today: Date;\n    /** The base column's date for a date column with `base`. */\n    baseDate: Date | undefined;\n    /** The unit for a quantity column (from the driver). */\n    unit: string | undefined;\n    /** A custom kind's parse of the buffer, for its preview. */\n    customPreview: SheetCellValue | null | undefined;\n    /** The link editor's facts, on a link / set column. */\n    link?: StripLinkInput | undefined;\n    /** The pending suggestions, when no editor is open (B§9's sixth state). */\n    suggested?: StripSuggestInput | undefined;\n    /** A date column's level for the edited row (#844). */\n    whenLevel?: WhenLevel | undefined;\n    /** The ring's cell's detail, when no editor is open and nothing is suggested. */\n    detail?: StripDetailInput | undefined;\n}\n\n/** What the strip shows of a resting cell's detail: the column, the detail's parts, its meta, the keys. */\nexport interface StripDetailInput {\n    label: string;\n    chips: readonly string[];\n    meta: string;\n    keys: string;\n}\n\n/** What the link strip states read (B§9). */\nexport interface StripLinkInput {\n    side: 0 | 1;\n    /** The candidates for the buffer, members already in the cell excluded. */\n    candidates: LinkCandidate[];\n    /** The armed candidate. */\n    armed: LinkCandidate | undefined;\n    /** The entry menu — the countable abstractions. */\n    entry: LinkCandidate[];\n    /** The predicted members of the active half, with an enumerate alternative and their provenance. */\n    predicted: readonly SheetMemberValue[];\n    enumerate: LinkCandidate | undefined;\n    predictedMeta: string;\n    /** The arity meta while the arity half is edited. */\n    arity: string;\n    /** The grammar in one line. */\n    grammar: string;\n}\n\n/** The pending suggestions the strip states when no editor is open. */\nexport interface StripSuggestInput {\n    /** The pending fills in column order — the header, the value's text, the provenance; the next target armed. */\n    fills: readonly { key: string; header: string; text: string; meta: string; armed: boolean }[];\n    /** Proposed rows pending. */\n    rows: number;\n    /** The first proposal's provenance. */\n    rowsMeta: string;\n    /** Providers still in flight, by header. */\n    pending: readonly { key: string; header: string }[];\n}\n\nconst flat = (label: string): StripChip[] => [{ key: \"v\", label, on: false, flat: true, title: \"\" }];\n\n/** The strip for the current state (pure). */\nexport function buildStrip(input: StripInput): StripModel {\n    const { edit, meta, words } = input;\n    const { m } = words;\n    if (edit === null || meta === undefined) {\n        if (input.suggested !== undefined) return buildSuggestStrip(input.suggested, words);\n        // Nothing to suggest: the resting cell's detail, when it has one.\n        const d = input.detail;\n        return d === undefined ? OFF : { on: true, label: d.label, chips: d.chips.map((c, i) => ({ key: `d${i}`, label: c, on: false, flat: true, title: c })), meta: d.meta, keys: d.keys };\n    }\n    const empty = edit.val.trim() === \"\";\n    const header = meta.header.toUpperCase();\n    if ((meta.kind === \"link\" || meta.kind === \"set\") && input.link !== undefined) return buildLinkStrip(header, edit.val, input.link, meta.kind === \"set\", words);\n    switch (meta.kind) {\n        case \"lookup\":\n        case \"reference\":\n        case \"enum\":\n        case \"person\": {\n            if (input.candidates === undefined) return OFF;\n            const list = candidateList(meta, edit.val, input.candidates);\n            if (list.length === 0) {\n                return empty ? OFF : { on: true, label: header, chips: flat(m.stripNoMatch()), meta: \"\", keys: m.stripKeysTyped() };\n            }\n            const armed = candidateAt(meta, edit.val, edit.hi, input.candidates);\n            const hi = armed === undefined ? -1 : Math.max(0, list.findIndex((c) => stringEqual(c.key, armed.key)));\n            // The strip pages, so more than a handful can be offered; each chip is a member, in the words it shows.\n            const chips: StripChip[] = list.slice(0, 12).map((c, i) => ({\n                key: `a${i}`,\n                label: c.label.length > 34 ? `${c.label.slice(0, 33)}…` : c.label,\n                on: i === hi,\n                flat: false,\n                title: c.label,\n                action: { kind: \"candidate\", label: c.label, key: c.key, i },\n            }));\n            const at = list[hi];\n            const member = at !== undefined ? input.candidates.registers.byName.get(meta.register ?? \"\")?.find((x) => stringEqual(x.key, at.key)) : undefined;\n            const memberMeta = member !== undefined ? getSomeorUndefined(member.meta) ?? \"\" : \"\";\n            if (hi < 0) {\n                return { on: true, label: m.stripAccepts({ header }), chips, meta: memberMeta, keys: m.stripKeysFilter() };\n            }\n            const many = list.length > 1;\n            return {\n                on: true,\n                label: m.stripArmed({ header, many }),\n                chips,\n                meta: memberMeta,\n                keys: m.stripKeysTake({ many, index: words.number(hi + 1), total: words.number(list.length) }),\n            };\n        }\n        case \"date\": {\n            // The date field: digits fill the segments; the strip previews the date it holds.\n            // At a level (#844) the strip says what the level accepts and previews the date as the cell will print it.\n            const level = input.whenLevel;\n            if (empty) {\n                const acc = level !== undefined ? whenAccepts(level, words) : { chip: m.stripDate(), meta: m.stripDateForm() };\n                return { on: true, label: m.stripAccepts({ header }), chips: flat(acc.chip), meta: acc.meta, keys: m.stripKeysDateEmpty() };\n            }\n            const d = parseDate(edit.val, { today: input.today, base: input.baseDate });\n            if (d === null || d === undefined) {\n                return { on: true, label: header, chips: flat(m.stripIncomplete()), meta: level !== undefined ? whenAccepts(level, words).meta : m.stripDateForm(), keys: m.stripKeysDate() };\n            }\n            const days = input.baseDate !== undefined ? daysBetween(input.baseDate, d) : undefined;\n            const span = days !== undefined ? m.stripDays({ n: days, count: words.number(days) }) : \"\";\n            if (level !== undefined) {\n                const w = formatWhen(d, level, words);\n                const shown = `${w.text} · ${w.suffix}`;\n                return { on: true, label: header, chips: flat(shown), meta: span !== \"\" ? span : formatDateLong(d), keys: m.stripKeysCommit() };\n            }\n            return { on: true, label: header, chips: flat(formatDateLong(d)), meta: span, keys: m.stripKeysCommit() };\n        }\n        case \"quantity\":\n        case \"integer\": {\n            // The number field: the quantity grammar, in the viewer's language (#852).\n            const accepts = meta.kind === \"quantity\" ? `${words.bare(1200)} · ${words.bare(1200.5)}` : words.bare(1200);\n            if (empty) {\n                return { on: true, label: m.stripAccepts({ header }), chips: flat(m.stripNumber({ unit: meta.kind === \"quantity\" })), meta: accepts, keys: m.stripKeysStep() };\n            }\n            const n = parseQuantity(edit.val, words.separators);\n            // An integer column's fraction is unrecognised, as its commit has it — never offered with the keys that commit it.\n            // The strip says what was typed and why it isn't taken, with no number of its own beside it to read as the\n            // cell's (#1585).\n            if (n === null || n === undefined || (meta.kind === \"integer\" && !Number.isSafeInteger(n))) {\n                return { on: true, label: header, chips: flat(m.stripUnrecognised()), meta: m.stripNotNumber({ text: edit.val.trim(), whole: meta.kind === \"integer\" }), keys: \"\" };\n            }\n            const unit = meta.kind === \"quantity\" && input.unit !== undefined ? ` ${input.unit}` : \"\";\n            return { on: true, label: header, chips: flat(`${formatQuantity(n, meta.kind === \"quantity\" ? meta.format : undefined, words)}${unit}`), meta: \"\", keys: m.stripKeysStep() };\n        }\n        case \"custom\": {\n            if (empty) return { on: true, label: m.stripAccepts({ header }), chips: flat(meta.accepts ?? m.stripValue()), meta: \"\", keys: m.stripKeysParse() };\n            const p = input.customPreview;\n            if (p === undefined || p === null) return { on: true, label: header, chips: flat(m.stripUnrecognised()), meta: meta.accepts ?? \"\", keys: \"\" };\n            return { on: true, label: header, chips: flat(cellText(p, meta, words)), meta: meta.accepts ?? \"\", keys: \"\" };\n        }\n        default:\n            return OFF;\n    }\n}\n\n/** The link strip states (B§9): predicted · candidates · the entry menu · the grammar line. */\nfunction buildLinkStrip(header: string, val: string, link: StripLinkInput, single: boolean, words: SheetWords): StripModel {\n    const { m } = words;\n    const empty = val.trim() === \"\";\n    // The column, and on a link the half being edited.\n    const half = m.stripHalf({ header, half: single ? undefined : link.side === 1 ? \"to\" : \"from\" });\n    const chipOf = (c: LinkCandidate, i: number, on: boolean): StripChip => ({\n        key: `a${i}`, label: c.label.length > 34 ? `${c.label.slice(0, 33)}…` : c.label, on, flat: false, title: c.label,\n        action: { kind: \"members\", label: c.label, members: c.members },\n    });\n    // A prediction is more specific than the register's entry menu.\n    if (empty && link.predicted.length > 0) {\n        const chips: StripChip[] = link.predicted.map((member, i) => ({\n            key: `p${i}`, label: memberLabel(member), on: i === 0, flat: false, title: m.stripAdd({ label: memberLabel(member) }),\n            action: { kind: \"members\", label: memberLabel(member), members: [member] },\n        }));\n        if (link.enumerate !== undefined) chips.push(chipOf(link.enumerate, 99, false));\n        return { on: true, label: m.stripPredicted({ header }), chips, meta: link.predictedMeta, keys: m.stripKeysPredicted() };\n    }\n    const list = empty ? link.entry : link.candidates;\n    if (list.length > 0) {\n        const armed = empty ? undefined : link.armed;\n        // The armed candidate is a fresh object each time the list is built: find it by what it is, not by identity (else the first chip stays lit while ⌥] moves the pick).\n        const hi = armed === undefined ? -1 : Math.max(0, list.findIndex((c) => c.label === armed.label));\n        const chips = list.slice(0, 24).map((c, i) => chipOf(c, i, i === hi));\n        if (hi < 0) {\n            return { on: true, label: m.stripAccepts({ header: half }), chips, meta: link.arity, keys: m.stripKeysFilter() };\n        }\n        const many = list.length > 1;\n        return {\n            on: true,\n            label: m.stripArmed({ header: half, many }),\n            chips,\n            meta: armed?.meta ?? \"\",\n            keys: m.stripKeysLinkTake({ many, index: words.number(hi + 1), total: words.number(list.length), single }),\n        };\n    }\n    // Nothing to offer is still worth a line: the grammar, and the arity check.\n    return {\n        on: true,\n        label: m.stripAccepts({ header: half }),\n        chips: flat(empty ? link.grammar : m.stripNoMatch()),\n        meta: link.arity,\n        keys: m.stripKeysLinkAdd({ single }),\n    };\n}\n\n/** The suggestions state (B§9): one chip per pending fill, `+n rows`, the pending providers, the provenance. */\nfunction buildSuggestStrip(s: StripSuggestInput, words: SheetWords): StripModel {\n    const { m } = words;\n    const chips: StripChip[] = s.fills.map((f) => ({\n        key: `f${f.key}`, label: f.header, on: f.armed, flat: false,\n        title: `${f.text}${f.meta !== \"\" ? ` — ${f.meta}` : \"\"}`,\n        action: { kind: \"fill\", key: f.key },\n    }));\n    if (s.rows > 0) chips.push({ key: \"rows\", label: m.stripRows({ n: s.rows, count: words.number(s.rows) }), on: false, flat: false, title: s.rowsMeta, action: { kind: \"rows\" } });\n    for (const p of s.pending) chips.push({ key: `p${p.key}`, label: m.stripPending({ header: p.header }), on: false, flat: false, pending: true, title: m.stripPendingTitle({ header: p.header }) });\n    if (chips.length === 0) return OFF;\n    const armed = s.fills.find((f) => f.armed);\n    const meta = armed !== undefined && armed.meta !== \"\" ? armed.meta : s.fills[0]?.meta !== undefined && s.fills[0].meta !== \"\" ? s.fills[0].meta : s.rowsMeta;\n    return { on: true, label: m.stripSuggested(), chips, meta, keys: m.stripKeysSuggested() };\n}\n\nexport interface SheetStripProps {\n    styles: Styles;\n    model: StripModel;\n    onAction: (action: StripAction) => void;\n}\n\n// The pager's width, set aside at the row's end on every page once the chips run past one.\nconst PAGER_PX = 84;\n/** The gap between chips (the recipe's `stripChips` gap). */\nconst GAP_PX = 4;\n\n/** What a set of chips is, for the page cut — their keys, labels and which is armed. */\nconst chipSignature = (chips: readonly StripChip[]): string =>\n    chips.map((c) => `${c.key}\\u0000${c.label}\\u0000${c.on ? 1 : 0}${c.flat ? \"f\" : \"\"}${c.pending ? \"p\" : \"\"}`).join(\"\\u0001\");\n\n/** Renders the docked strip — the chips of the current page, the pager when there is more than one. */\nexport const SheetStrip = memo(function SheetStrip({ styles, model, onAction }: SheetStripProps) {\n    // The pager's words, its numbers in the app's locale (#861).\n    const words = useSheetWords();\n    const { m } = words;\n    const rowRef = useRef<HTMLDivElement | null>(null);\n    const measureRef = useRef<HTMLDivElement | null>(null);\n    const [width, setWidth] = useState(0);\n    /** The index the chips of each page start at. */\n    const [starts, setStarts] = useState<number[]>([0]);\n    const [page, setPage] = useState(0);\n    const on = model.on;\n    const signature = chipSignature(model.chips);\n    // The row's width, live.\n    useLayoutEffect(() => {\n        const el = rowRef.current;\n        if (!on || el === null) return undefined;\n        const read = () => setWidth(el.clientWidth);\n        read();\n        if (typeof ResizeObserver === \"undefined\") return undefined;\n        const ro = new ResizeObserver(read);\n        ro.observe(el);\n        return () => ro.disconnect();\n    }, [on]);\n    // Cut the chips into pages by their measured widths: one page when they all fit, else the pager's width set aside on every page.\n    useLayoutEffect(() => {\n        const measure = measureRef.current;\n        if (!on || measure === null || width <= 0) { setStarts([0]); return; }\n        const widths = Array.from(measure.children, (k) => (k as HTMLElement).offsetWidth);\n        const total = widths.reduce((a, w) => a + w, 0) + GAP_PX * Math.max(0, widths.length - 1);\n        if (total <= width) { setStarts([0]); return; }\n        const avail = Math.max(40, width - PAGER_PX);\n        const out = [0];\n        let x = 0;\n        widths.forEach((w, i) => {\n            const need = (x === 0 ? 0 : GAP_PX) + w;\n            if (x > 0 && x + need > avail) { out.push(i); x = w; } else x += need;\n        });\n        setStarts(out);\n    }, [on, signature, width]);\n    // The page follows the armed chip; a fresh set of chips opens on its first page.\n    const armedAt = model.chips.findIndex((c) => c.on);\n    useLayoutEffect(() => {\n        if (armedAt < 0) { setPage(0); return; }\n        let p = 0;\n        for (let i = 0; i < starts.length; i++) if (starts[i]! <= armedAt) p = i;\n        setPage(p);\n    }, [armedAt, starts, signature]);\n    if (!on) return null;\n    const cur = Math.min(page, starts.length - 1);\n    const from = starts[cur] ?? 0;\n    const to = cur + 1 < starts.length ? starts[cur + 1]! : model.chips.length;\n    const paged = starts.length > 1;\n    // Which page, of how many — in the app's locale.\n    const at = { page: words.number(cur + 1), pages: words.number(starts.length) };\n    const chipStyle = (ch: StripChip) => (ch.flat ? styles.stripChipFlat : ch.on ? styles.stripChipOn : styles.stripChip);\n    return (\n        <Box css={styles.strip} data-slot=\"strip\" data-paged={paged ? \"\" : undefined}>\n            <Box as=\"span\" css={styles.stripLabel} data-slot=\"stripLabel\">{model.label}</Box>\n            <Box ref={rowRef} css={styles.stripChips} data-slot=\"stripChips\">\n                {model.chips.slice(from, to).map((ch) => ch.flat\n                    ? <Box key={ch.key} as=\"span\" css={styles.stripChipFlat} data-slot=\"stripChip\" data-flat=\"\">{ch.label}</Box>\n                    : (\n                        <Box\n                            key={ch.key}\n                            as=\"span\"\n                            css={ch.on ? styles.stripChipOn : styles.stripChip}\n                            data-slot=\"stripChip\"\n                            data-armed={ch.on ? \"\" : undefined}\n                            data-pending={ch.pending ? \"\" : undefined}\n                            title={ch.title}\n                            // mousedown, not click: preventDefault keeps focus in the editor so the cell stays open.\n                            onMouseDown={(e) => { e.preventDefault(); if (ch.action !== undefined) onAction(ch.action); }}\n                        >\n                            {ch.label}\n                        </Box>\n                    ))}\n                {paged && (\n                    <Box as=\"span\" css={styles.stripPager} data-slot=\"stripPager\" title={m.stripPager({ n: model.chips.length, count: words.number(model.chips.length), ...at })}>\n                        <chakra.button\n                            type=\"button\" css={styles.stripPage} data-slot=\"stripPage\" data-dir=\"prev\" aria-label={m.stripPrevious()} disabled={cur === 0}\n                            onMouseDown={(e) => { e.preventDefault(); if (cur > 0) setPage(cur - 1); }}\n                        >\n                            <FontAwesomeIcon icon={faChevronLeft} />\n                        </chakra.button>\n                        <Box as=\"span\" css={styles.stripPageCount} data-slot=\"stripPageCount\">{m.stripPage(at)}</Box>\n                        <chakra.button\n                            type=\"button\" css={styles.stripPage} data-slot=\"stripPage\" data-dir=\"next\" aria-label={m.stripNext()} disabled={cur >= starts.length - 1}\n                            onMouseDown={(e) => { e.preventDefault(); if (cur < starts.length - 1) setPage(cur + 1); }}\n                        >\n                            <FontAwesomeIcon icon={faChevronRight} />\n                        </chakra.button>\n                    </Box>\n                )}\n            </Box>\n            {/* Every chip once more, unseen and unconstrained — the pages are cut by these widths. */}\n            <Box ref={measureRef} css={styles.stripMeasure} aria-hidden=\"true\" data-slot=\"stripMeasure\">\n                {model.chips.map((ch) => <Box key={ch.key} as=\"span\" css={chipStyle(ch)}>{ch.label}</Box>)}\n            </Box>\n            <Box as=\"span\" css={styles.stripMeta} data-slot=\"stripMeta\" title={model.meta}>{model.meta}</Box>\n            <Box as=\"span\" css={styles.stripKeys}>{model.keys}</Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What is said of the ring's cell: the copilot's fills and proposals for it, its detail, the strip's model, what the grid\n * tells assistive tech of its rows and its active cell, and the footer's key hint.\n *\n * @packageDocumentation\n */\n\nimport { useMemo, useRef } from \"react\";\nimport { variant } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { cellText, driverKeyOf, resolveMember as resolveRegisterMember, unitOf } from \"./model.js\";\nimport { cellDetail } from \"./detail.js\";\nimport { parseCell } from \"./parse/index.js\";\nimport { usedKeys, narrowVocabulary, resolveMember as resolveVocabMember } from \"./link/grammar.js\";\nimport { linkEntryCandidates, grammarLine, membersUnder, type LinkCandidate } from \"./link/predict.js\";\nimport { namedCount, arityMeta, type Counted } from \"./link/arity.js\";\nimport { wholeRows, nextTargetOf, fillOrder } from \"./sheet-state.js\";\nimport { buildStrip, type StripLinkInput, type StripSuggestInput } from \"./Strip.js\";\nimport type { SheetCellValue, SheetMemberValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetOpenEditor } from \"./use-open-editor.js\";\n\n/**\n * Reads what the strip, assistive tech and the footer's hint say of the ring (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetOpenEditor - The styles and the open editor\n * @returns The strip, the grid's counts and active cell, and the hint\n */\nexport function useSheetRing(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetMachine: SheetMachine, sheetOpenEditor: SheetOpenEditor) {\n    const { columns, driverColumn, gridId, group, hostGrid, noun, pagedSource, registers, today, words } = sheetDecode;\n    const { total, ui } = sheetSession;\n    const {\n        allowedFor, body, colCount, endPosition, idAt, linkColumns, metaAt, parseCtxFor, rowAt, rowOf, wireContextFor,\n    } = sheetBody;\n    const { ctx } = sheetMachine;\n    const { edit, editMeta, editWhenLevel, linkArmed, linkEdit, linkEditCtx } = sheetOpenEditor;\n    // ── The copilot's surfaces: the anchor's fills, the next target, the proposal rows ──\n    const anchorR = useMemo(() => (ui.sugg !== null ? rowOf(ui.sugg.anchorId) : undefined), [ui.sugg, rowOf]);\n    const nextTarget = useMemo(() => nextTargetOf(ui, ctx), [ui, ctx]);\n    const suggested = useMemo<StripSuggestInput | undefined>(() => {\n        if (edit !== null || ui.sugg === null) return undefined;\n        const sugg = ui.sugg;\n        const fills = fillOrder(sugg, ctx).map(({ key }) => {\n            const f = sugg.fill.get(key)!;\n            const meta = columns.byKey.get(key);\n            return { key, header: meta?.header ?? key, text: meta !== undefined ? cellText(f.cell, meta, words) : \"\", meta: f.meta, armed: nextTarget?.key === key };\n        });\n        const pending = sugg.pending.map((key) => ({ key, header: key === \"rows\" ? words.m.stripRowsHeader() : columns.byKey.get(key)?.header ?? key }));\n        return { fills, rows: sugg.rows.length, rowsMeta: sugg.rows[0]?.meta ?? \"\", pending };\n    }, [edit, ui.sugg, ctx, columns, nextTarget, words]);\n\n    // The resting ring's cell detail (#844): the wanted date behind one that has happened, a column's detail text (with an enum member's own meta beside it).\n    // On a host's grid, the cell under the pointer's, else the ring's once it is placed (#1531).\n    const previewed = hostGrid !== undefined && ui.hover !== null ? ui.hover : ui.ringless ? undefined : ui.sel;\n    const detail = useMemo(() => {\n        if (edit !== null || ui.selEnd !== null || previewed === undefined) return undefined;\n        const meta = metaAt(previewed.r, previewed.c);\n        const it = rowAt(previewed.r);\n        if (meta === undefined || it === undefined || it.kind !== \"real\") return undefined;\n        const d = cellDetail(meta, it.row.cells, words);\n        if (d === undefined) return undefined;\n        const cell = it.row.cells.get(meta.key);\n        const member = meta.kind === \"enum\" && cell !== undefined && cell.type === \"String\" ? resolveRegisterMember(registers, meta.register, cell.value) : undefined;\n        const memberMeta = member !== undefined ? getSomeorUndefined(member.meta) ?? \"\" : \"\";\n        return { label: meta.header.toUpperCase(), chips: d.chips, meta: d.meta !== \"\" ? d.meta : memberMeta, keys: words.m.stripKeysDetail({ date: meta.kind === \"date\" }) };\n    }, [edit, ui.selEnd, previewed, metaAt, rowAt, registers, words]);\n    const strip = useMemo(() => {\n        if (edit === null || editMeta === undefined) return buildStrip({ edit: null, meta: undefined, candidates: undefined, words, today, baseDate: undefined, unit: undefined, customPreview: undefined, suggested, detail });\n        const pctx = parseCtxFor(edit.r, editMeta);\n        const it = rowAt(edit.r);\n        const driverKey = driverKeyOf(it !== undefined && it.kind === \"real\" ? it.row : undefined, driverColumn);\n        let customPreview: SheetCellValue | null | undefined;\n        if (editMeta.kind === \"custom\" && edit.val.trim() !== \"\") {\n            const out = parseCell(editMeta, edit.val, pctx);\n            customPreview = out.kind === \"cell\" ? out.cell : null;\n        }\n        let link: StripLinkInput | undefined;\n        if (linkEdit !== undefined && linkEditCtx !== undefined) {\n            const lc = linkColumns.get(editMeta.key);\n            const vocab = lc?.vocab;\n            // The entry menu and the grammar line offer what the row may take (its options rule).\n            const allowedKeys = allowedFor(edit.r, editMeta);\n            const offer = vocab !== undefined && allowedKeys !== undefined ? narrowVocabulary(vocab, allowedKeys) : vocab;\n            const used = vocab !== undefined ? usedKeys([...linkEdit.groups[0], ...linkEdit.groups[1]], vocab) : new Set<string>();\n            let arity = \"\";\n            if (lc?.arity !== undefined && vocab !== undefined && (lc.arity.half.type === \"from\" ? 0 : 1) === linkEdit.side) {\n                let implied: Counted | undefined;\n                try {\n                    const out = lc.arity.implied(wireContextFor(edit.r));\n                    if (out.type === \"some\") implied = { n: Number(out.value.n), key: out.value.key };\n                } catch (err) {\n                    console.error(`[Sheet] arity rule failed on column \"${editMeta.key}\":`, err);\n                }\n                arity = arityMeta(implied, namedCount(linkEdit.groups[linkEdit.side], vocab), words);\n            }\n            const predicted = linkEditCtx.predicted(linkEdit.side, linkEdit.groups, edit.val);\n            // A counted member is the plan-level answer; naming the members is the\n            // schedule-level one — offered as the alternative, never assumed (B§4.5).\n            let enumerate: LinkCandidate | undefined;\n            const counted = predicted.find((m): m is Extract<SheetMemberValue, { type: \"counted\" }> => m.type === \"counted\");\n            if (counted !== undefined && vocab !== undefined) {\n                const n = Number(counted.value.n);\n                const parent = resolveVocabMember(counted.value.key, vocab);\n                const free = parent !== undefined ? membersUnder(parent, vocab, used).slice(0, n) : [];\n                if (free.length === n && free.length > 0) {\n                    enumerate = {\n                        label: free.map((m) => m.key).join(\", \"),\n                        meta: words.m.enumerateInstead(),\n                        members: free.map((m) => variant(\"identified\", { key: m.key })),\n                    };\n                }\n            }\n            const fill = ui.sugg !== null && ui.sugg.anchorId === idAt(edit.r) ? ui.sugg.fill.get(editMeta.key) : undefined;\n            link = {\n                side: linkEdit.side,\n                candidates: linkEditCtx.candidates(edit.val, linkEdit.groups),\n                armed: linkArmed,\n                entry: offer !== undefined ? linkEntryCandidates(offer, used, words) : [],\n                predicted,\n                enumerate,\n                predictedMeta: fill?.meta ?? \"\",\n                arity,\n                grammar: offer !== undefined ? grammarLine(offer, words) : \"\",\n            };\n        }\n        return buildStrip({\n            edit, meta: editMeta, candidates: pctx, words, today,\n            baseDate: pctx.baseDate,\n            unit: unitOf(editMeta, driverKey),\n            customPreview,\n            link,\n            whenLevel: editWhenLevel,\n        });\n    }, [edit, editMeta, words, today, parseCtxFor, rowAt, driverColumn, linkEdit, linkEditCtx, linkArmed, linkColumns, wireContextFor, suggested, ui.sugg, idAt, editWhenLevel, allowedFor, detail]);\n\n    const wr = wholeRows(ui, colCount);\n    // What the grid tells assistive tech (#860): its rows, counted the way\n    // their indices run — on a flat sheet by source position, so the whole\n    // source's (-1 until a paged source has counted itself) and the blank\n    // padding; on a grouped sheet in body order — the header first — once\n    // no run of it is unread, and -1 until then: groups not read yet draw\n    // lines no count knows (#1398, CL12); and the ring's cell, which a band's\n    // title stands for across its span and under the columns it has no cell\n    // in.\n    const blankRows = useMemo(() => body.reduce((n, it) => (it.kind === \"blank\" && it.group === undefined ? n + 1 : n), 0), [body]);\n    const unreadRuns = useMemo(() => body.some((it) => it.kind === \"band\" || it.kind === \"failed\"), [body]);\n    const ariaRowCount = group !== undefined ? (unreadRuns ? -1 : body.length + 1)\n        : pagedSource !== undefined && total === undefined ? -1\n            : Math.max(total ?? 0, endPosition) + blankRows + 1;\n    // No row is the ring's before it is placed (#1531): no phone's column head is marked for it, no hint speaks of it.\n    const ringItem = ui.ringless ? undefined : rowAt(ui.sel.r);\n    const ringCol = ringItem?.kind === \"group\" && group !== undefined && (ui.sel.c < group.titleSpan || !group.cells.has(columns.list[ui.sel.c]?.key ?? \"\")) ? 0 : ui.sel.c;\n    const activeCell = !ui.ringless && ringItem !== undefined && colCount > 0 ? `${gridId}-${ui.sel.r}-${ringCol}` : undefined;\n    // What a keyboard move's reveal reads (`use-scroll.tsx`): the ring's cell, and the column it sits under.\n    const ringCellRef = useRef<{ id: string | undefined; col: number }>({ id: undefined, col: 0 });\n    ringCellRef.current = { id: activeCell, col: ringCol };\n    const hasFills = ui.sugg !== null && ui.sugg.fill.size > 0;\n    const hasRows = ui.sugg !== null && ui.sugg.rows.length > 0;\n    const ringKind = ui.ringless ? undefined : ctx.rowKindAt?.(ui.sel.r);\n    const ringSubRows = ringKind === \"row\" ? ctx.lineSubRowsAt?.(ui.sel.r) : undefined;\n    const picked = wr !== null ? wr.r1 - wr.r0 + 1 : 0;\n    const hint = ui.gsel !== null\n        ? words.m.hintProposal()\n        : ringKind === \"group\" && wr === null\n            ? words.m.hintBand({ noun: noun.singular })\n        // A line with sub rows under it.\n        : ringSubRows !== undefined && wr === null && ui.sugg === null\n            ? words.m.hintSubRows({ open: ringSubRows.open, n: ringSubRows.count, count: words.number(ringSubRows.count), noun: noun.singular })\n        : wr !== null\n            ? words.m.hintRows({ n: picked, count: words.number(picked) })\n            : hasFills\n                ? words.m.hintFills()\n                : hasRows\n                    ? words.m.hintSuggestedRows()\n                    : words.m.hintDefault();\n    return {\n        activeCell, anchorR, ariaRowCount, hint, nextTarget, previewed, ringCellRef, ringCol, ringItem, strip,\n        suggested, unreadRuns, wr,\n    };\n}\n\n/** What {@link useSheetRing} gives the parts after it. */\nexport type SheetRing = ReturnType<typeof useSheetRing>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The rows' scroll: what it reports to the paging or the lens, the open editor laid over its cell, the frame's widths and\n * the number column's, the band and the line that stick under the header, a keyboard move's reveal of its column, and the\n * slide of the rows a fold or an opening moves.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { isLooseRow, itemPx, stickyRows } from \"./model.js\";\nimport type { SheetViewport } from \"./paging.js\";\nimport { selectionRect } from \"./sheet-state.js\";\nimport { NUMBER_PX } from \"./gutter.js\";\nimport { SheetEditor } from \"./Editor.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport type { SheetOpenEditor } from \"./use-open-editor.js\";\nimport type { SheetReading } from \"./use-reading.js\";\nimport type { SheetRing } from \"./use-ring.js\";\nimport { elementUnder, keyOfItem, mountedBoxes, openKeysOf, spanOf } from \"./items.js\";\n\nconst NOTHING: ReadonlySet<string> = new Set();\n\n/** How long rows slide after a gesture that folds or opens (ms) — a little past the slide itself. */\nconst MOVE_MS = 320;\n\n/**\n * Lays the rows out in their scroll, and follows it (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetEffects - The effect runner and what its effects reach\n * @param sheetOpenEditor - The styles and the open editor\n * @param sheetReading - The loading line and the frame's loading facts\n * @param sheetRing - The strip, the active cell and the hint\n * @returns The viewport's report, the editor's node, the sticky rows, the sizes and the motion\n */\nexport function useSheetScroll(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetMachine: SheetMachine, sheetEffects: SheetEffects, sheetOpenEditor: SheetOpenEditor,\n    sheetReading: SheetReading, sheetRing: SheetRing) {\n    const {\n        bandPx, blanks, group, gutterPx, phoneFrame, pinPx, rowNumbers, rowPx, setFramePx, setNumberPx, setViewPx,\n        viewport,\n    } = sheetDecode;\n    const { folds, geometry, lens, lensDrawn, paging, rows, total, ui } = sheetSession;\n    const { body, endPosition } = sheetBody;\n    const { viewportRef } = sheetMachine;\n    const { editorFocus, revealSeq } = sheetEffects;\n    const {\n        edit, editBadge, editCombobox, editDate, editGhost, editMeta, editResolve, editWhenLevel, linkGhostText,\n        linkView, onEditorBlur, onEditorBrowse, onEditorChange, onEditorKey, onEditorPick, onHalfDown, styles,\n    } = sheetOpenEditor;\n    const { lensAwaitsNow, setLensAwaits } = sheetReading;\n    const { ringCellRef } = sheetRing;\n    // ── Viewport → the driver (paged), or the lens (#1349) ────────────────\n    const reportViewport = paging.reportViewport;\n    const lensReport = lens.reportViewport;\n    const reportRange = useCallback((\n        range: { startIndex: number; endIndex: number },\n        isScrolling: boolean,\n        center?: { index: number; withinPx: number },\n        shown?: { startIndex: number; endIndex: number },\n    ) => {\n        // Under the lens, whether the items the view shows hold a stretch it has not read — said at once, from every\n        // report: the view waits for it from the moment it shows it (#1398, CL3).\n        let awaits = false;\n        if (lensDrawn) {\n            const lo = shown?.startIndex ?? range.startIndex;\n            const hi = shown?.endIndex ?? range.endIndex;\n            for (let i = lo; i <= hi && !awaits; i++) awaits = body[i]?.kind === \"band\";\n        }\n        if (awaits !== lensAwaitsNow.current) {\n            lensAwaitsNow.current = awaits;\n            setLensAwaits(awaits);\n        }\n        if (lensDrawn) {\n            // The record's rows the mounted items stand for, from the first's to the last's: the lens reads the segments they meet.\n            let from: number | undefined;\n            let to: number | undefined;\n            for (let i = range.startIndex; i <= range.endIndex && from === undefined; i++) from = body[i] !== undefined ? spanOf(body[i]!)?.from : undefined;\n            for (let i = range.endIndex; i >= range.startIndex && to === undefined; i--) to = body[i] !== undefined ? spanOf(body[i]!)?.to : undefined;\n            if (from !== undefined && to !== undefined) lensReport(from, to, isScrolling);\n            return;\n        }\n        const mid = Math.floor((range.startIndex + range.endIndex) / 2);\n        const item = body[center?.index ?? mid] ?? body[range.startIndex];\n        if (item === undefined) return;\n        // The source elements the view shows (#1398): the rows' own, a band's edge where it meets the view — its\n        // bottom above the rows, its top below them — and, under the view's centre, the band's element there.\n        let from: number | undefined;\n        let to: number | undefined;\n        const take = (p: number) => { from = from === undefined || p < from ? p : from; to = to === undefined || p > to ? p : to; };\n        for (let i = range.startIndex; i <= range.endIndex; i++) {\n            const it = body[i];\n            if (it === undefined || it.kind === \"proposal\") continue;\n            if (it.kind === \"band\") {\n                if (i === center?.index) take(elementUnder(it, center.withinPx) ?? it.band.from);\n                else take(it.band.at === \"head\" ? it.band.to : it.band.from);\n            } else if (it.kind === \"failed\") take(it.failure.from);\n            else take(it.position);\n        }\n        const shows = from !== undefined && to !== undefined ? { from, to } : undefined;\n        let at: SheetViewport;\n        if (item.kind === \"band\") at = item.band.at === \"reading\" ? { kind: \"row\", offset: item.band.from, shows } : { kind: \"band\", at: item.band.at, px: center?.withinPx, shows };\n        else if (item.kind === \"failed\") at = { kind: \"row\", offset: item.failure.from, shows };\n        else at = { kind: \"row\", offset: item.position, shows };\n        reportViewport(at, isScrolling);\n    }, [body, reportViewport, lensDrawn, lensReport, lensAwaitsNow, setLensAwaits]);\n\n    // ── Rows ──────────────────────────────────────────────────────────────\n    const rect = selectionRect(ui);\n    const editorNode = useMemo<ReactNode>(() => edit !== null && editMeta !== undefined\n        ? (\n            <SheetEditor\n                styles={styles}\n                kind={editMeta.kind}\n                value={edit.val}\n                date={editDate}\n                seed={edit.seeded && edit.val.length === 1 ? edit.val : undefined}\n                ghost={linkView !== undefined ? linkGhostText : editGhost}\n                resolve={editResolve}\n                badge={editBadge}\n                error={edit.err}\n                focus={editorFocus}\n                ariaLabel={editMeta.header}\n                link={linkView}\n                options={editCombobox?.options}\n                highlighted={editCombobox?.highlighted}\n                browse={editCombobox?.browse}\n                onPick={onEditorPick}\n                onBrowse={onEditorBrowse}\n                whenLevel={editWhenLevel}\n                onChange={onEditorChange}\n                onKey={onEditorKey}\n                onBlur={onEditorBlur}\n                onHalfDown={onHalfDown}\n            />\n        )\n        : null, [edit, editMeta, editDate, styles, editGhost, editResolve, editBadge, editorFocus, onEditorChange, onEditorKey, onEditorBlur, linkView, linkGhostText, onHalfDown, editCombobox, onEditorPick, onEditorBrowse, editWhenLevel]);\n    // What a row in the range and the edited row are handed, held still while\n    // they are the same — a hover elsewhere renders neither (#858).\n    const rangeCols = useMemo(() => ({ c0: rect.c0, c1: rect.c1 }), [rect.c0, rect.c1]);\n    const editC = edit !== null ? edit.c : undefined;\n    const editorAt = useMemo(() => (editC !== undefined ? { c: editC, node: editorNode } : undefined), [editC, editorNode]);\n    // ── The sticky band (#740, G1) — which band sits under the header at the scroll offset ──\n    // The same heights the paged driver measures windows by (#855).\n    const sizeOf = useCallback((i: number): number => {\n        const item = body[i];\n        return item === undefined ? rowPx : itemPx(item, geometry);\n    }, [body, rowPx, geometry]);\n    // A row keeps its place on screen when a window lands above it at a height\n    // its estimate missed (#878) — the frame anchors the scroll on it. An\n    // unloaded band never anchors: rows landing below it move its top.\n    const anchorable = useCallback((i: number): boolean => body[i]?.kind !== \"band\", [body]);\n    viewportRef.current = viewport;\n    // The header pins in the frame, which scrolls its own rows: the band and\n    // the line that stick under it are read off it.\n    const pinnedFrame = viewport?.frame ?? null;\n    // The frame's widths (`use-decode.ts`), measured before the first paint: a sheet\n    // that folds its gutter never paints the gutter it folds.\n    const viewFrame = viewport?.frame;\n    useLayoutEffect(() => {\n        if (viewFrame === undefined || typeof ResizeObserver === \"undefined\") return;\n        const measure = () => { setViewPx(viewFrame.clientWidth); setFramePx(viewFrame.offsetWidth); };\n        const observer = new ResizeObserver(measure);\n        observer.observe(viewFrame);\n        measure();\n        return () => observer.disconnect();\n    }, [viewFrame, setFramePx, setViewPx]);\n    // The Row column shown or hidden puts the window back at its start (SH2): once it is laid out, for the browser re-snaps\n    // the scroll to the column it rested on as the tracks change.\n    const rowNumbersWere = useRef(rowNumbers);\n    useLayoutEffect(() => {\n        if (rowNumbersWere.current === rowNumbers) return;\n        rowNumbersWere.current = rowNumbers;\n        if (viewFrame !== undefined) viewFrame.scrollLeft = 0;\n    }, [rowNumbers, viewFrame]);\n    // The widest number each of the gutter's numbers can show: a row's — a\n    // flat sheet's blank padding and a proposal's among them — a band's, a\n    // loose row's and a line's; and, apart, a line's with its sub rows'\n    // chevron before it. A group folded or not loaded yet counts as it will\n    // show, so the column holds still as the viewer folds and scrolls.\n    const widest = useMemo(() => {\n        let plain = Math.max(total ?? 0, endPosition) + (group === undefined ? blanks + ui.appended : 0);\n        let chevron = 0;\n        if (group !== undefined) {\n            for (const g of rows) {\n                if (isLooseRow(g)) continue;\n                plain = Math.max(plain, g.lines.length + (blanks > 0 ? 1 : 0));\n                g.lines.forEach((line, j) => { if (line.subRows.length > 0) chevron = Math.max(chevron, j + 1); });\n            }\n        }\n        if (ui.sugg !== null && ui.sugg.rows.length > 0) for (const it of body) if (it.kind === \"proposal\") plain = Math.max(plain, it.number);\n        return { plain, chevron };\n    }, [total, endPosition, group, blanks, ui.appended, ui.sugg, rows, body]);\n    // The number column's width: those numbers as the rows draw them (the\n    // probe in the card), measured before the first paint, and again whenever\n    // the probe changes size — its face landing, or the grid drawn again after\n    // it was hidden.\n    const [numberProbe, setNumberProbe] = useState<HTMLElement | null>(null);\n    useLayoutEffect(() => {\n        if (numberProbe === null) return undefined;\n        const measure = () => {\n            let px = NUMBER_PX;\n            for (const n of numberProbe.children) px = Math.max(px, Math.ceil(n.getBoundingClientRect().width));\n            setNumberPx(px);\n        };\n        measure();\n        if (typeof ResizeObserver === \"undefined\") return undefined;\n        const observer = new ResizeObserver(measure);\n        observer.observe(numberProbe);\n        return () => observer.disconnect();\n    }, [numberProbe, widest.plain, widest.chevron, setNumberPx]);\n    // What sticks under the header is read off the MOUNTED rows\n    // (`stickyRows`): the band of the group whose lines scroll under it, and\n    // under the band the open line whose sub rows scroll under that. The\n    // line's copy follows the scroll through its own style, so a frame never\n    // re-renders the sheet for it — only a change of line does.\n    const headerRef = useRef<HTMLDivElement | null>(null);\n    const stickyLineRef = useRef<HTMLDivElement | null>(null);\n    const stickyLineTop = useRef(0);\n    const [stickyAt, setStickyAt] = useState<number | undefined>(undefined);\n    const [stickyLineAt, setStickyLineAt] = useState<number | undefined>(undefined);\n    useEffect(() => {\n        const el = pinnedFrame;\n        if (el === null || group === undefined) {\n            setStickyAt(undefined);\n            setStickyLineAt(undefined);\n            return;\n        }\n        let frame = 0;\n        const update = () => {\n            frame = 0;\n            const head = headerRef.current;\n            if (head === null) return;\n            const frameBox = head.getBoundingClientRect();\n            const bandCopy = head.querySelector<HTMLElement>(\"[data-slot=stickyBand]\");\n            const found = stickyRows(body, mountedBoxes(el), frameBox.bottom, bandCopy !== null ? bandCopy.getBoundingClientRect().height : bandPx, rowPx);\n            setStickyAt(found.band);\n            setStickyLineAt(found.line?.index);\n            if (found.line === undefined) return;\n            stickyLineTop.current = found.line.top - frameBox.top;\n            if (stickyLineRef.current !== null) stickyLineRef.current.style.top = `${stickyLineTop.current}px`;\n        };\n        const onScroll = () => { if (frame === 0) frame = requestAnimationFrame(update); };\n        update();\n        el.addEventListener(\"scroll\", onScroll, { passive: true });\n        // Rows that slid after a fold or an opening have landed: read them again.\n        el.addEventListener(\"transitionend\", onScroll);\n        return () => {\n            el.removeEventListener(\"scroll\", onScroll);\n            el.removeEventListener(\"transitionend\", onScroll);\n            if (frame !== 0) cancelAnimationFrame(frame);\n        };\n    }, [pinnedFrame, body, group, bandPx, rowPx]);\n    // A line that has just begun to stick: its copy takes the top the scroll found for it before it paints.\n    useLayoutEffect(() => {\n        if (stickyLineRef.current !== null) stickyLineRef.current.style.top = `${stickyLineTop.current}px`;\n    }, [stickyLineAt]);\n    // The ring's cell in view after a keyboard move (#860). The frame brings\n    // the ring's ROW in; what it cannot is the column — the rows scroll\n    // sideways inside the card. The column's header cell says where the column\n    // is: it is always mounted, and it shares the column's box. The gutter is\n    // sticky, so the columns show right of it.\n    useEffect(() => {\n        if (revealSeq === 0) return;\n        const view = viewportRef.current;\n        if (view === null) return;\n        const { col } = ringCellRef.current;\n        const frame = view.frame;\n        const head = headerRef.current?.querySelectorAll<HTMLElement>('[data-slot=\"headerCell\"]')[col];\n        if (head !== undefined) {\n            const box = frame.getBoundingClientRect();\n            const left = box.left + frame.clientLeft + (phoneFrame ? pinPx : gutterPx);\n            const right = box.left + frame.clientLeft + frame.clientWidth;\n            const cell = head.getBoundingClientRect();\n            if (cell.left < left) frame.scrollLeft -= left - cell.left;\n            else if (cell.right > right) frame.scrollLeft += Math.min(cell.right - right, cell.left - left);\n        }\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- a keyboard move is the trigger; the ring and the frame are read as they are then\n    }, [revealSeq]);\n    /**\n     * Bring a sticking line out from under its copy: the rows\n     * scroll until the line's own row sits just under the band, where the\n     * copy was, so a press on the copy lands on the line in view (the ring,\n     * the editor) and closing its sub rows leaves it where it stood. With\n     * `closing`, the press closes the group's every line (⌥): the open sub\n     * rows above this line are about to leave too, so the scroll takes them\n     * off ahead of time.\n     */\n    const revealLine = useCallback((at: number, closing: boolean) => {\n        const el = pinnedFrame;\n        const head = headerRef.current;\n        if (el === null || head === null) return;\n        const boxes = mountedBoxes(el);\n        // The line's top: its own row's, else worked back from the first row mounted after it.\n        let top = boxes.get(at)?.top;\n        if (top === undefined) {\n            let k = at + 1;\n            while (k < body.length && !boxes.has(k)) k++;\n            const next = boxes.get(k);\n            if (next === undefined) return;\n            top = next.top;\n            for (let j = at; j < k; j++) top -= sizeOf(j);\n        }\n        let leaving = 0;\n        if (closing) for (let j = at - 1; j >= 0 && body[j]!.kind !== \"group\"; j--) if (body[j]!.kind === \"subRow\") leaving += boxes.get(j)?.height ?? sizeOf(j);\n        const bandCopy = head.querySelector<HTMLElement>(\"[data-slot=stickyBand]\");\n        el.scrollTop += top - (head.getBoundingClientRect().bottom + (bandCopy !== null ? bandCopy.getBoundingClientRect().height : 0)) - leaving;\n    }, [pinnedFrame, body, sizeOf]);\n\n    // A gesture that folds or opens (a chevron, Space, ⇧Space,\n    // ⌥, fold-all) moves rows. The virtual rows are keyed by identity, so a row\n    // that moves keeps its element: for a moment after such a gesture the rows\n    // slide to their new places (`data-moving` on the root) and the rows it\n    // brings into view — a line's sub rows, an unfolded group's lines — drop in\n    // one after another. A gesture is a change of the folds on the same view:\n    // the lens, a view switch and a scroll move nothing.\n    const itemKey = useCallback((i: number): string => keyOfItem(body[i], i), [body]);\n    const openKeys = useMemo(() => openKeysOf(body), [body]);\n    /** What the last committed render had open, under which folds and view. */\n    const seenRef = useRef<{ folds: ReadonlyMap<string, boolean>; tab: string | null; open: ReadonlySet<string> } | undefined>(undefined);\n    const seen = seenRef.current;\n    const gesture = seen !== undefined && seen.folds !== folds && seen.tab === ui.tabs.active;\n    /** What the gesture opened: the rows under these keys arrive. */\n    const arriving = useMemo(() => (gesture && seen !== undefined ? new Set([...openKeys].filter((k) => !seen.open.has(k))) : NOTHING), [gesture, seen, openKeys]);\n    const [movingSince, setMovingSince] = useState(0);\n    useLayoutEffect(() => {\n        const was = seenRef.current;\n        seenRef.current = { folds, tab: ui.tabs.active, open: openKeys };\n        if (was !== undefined && was.folds !== folds && was.tab === ui.tabs.active) setMovingSince(performance.now());\n    }, [folds, ui.tabs.active, openKeys]);\n    useEffect(() => {\n        if (movingSince === 0) return;\n        const t = setTimeout(() => setMovingSince(0), MOVE_MS);\n        return () => clearTimeout(t);\n    }, [movingSince]);\n    const moving = gesture || movingSince !== 0;\n    return {\n        anchorable, arriving, editorAt, headerRef, itemKey, moving, rangeCols, rect, reportRange, revealLine,\n        setNumberProbe, sizeOf, stickyAt, stickyLineAt, stickyLineRef, widest,\n    };\n}\n\n/** What {@link useSheetScroll} gives the parts after it. */\nexport type SheetScroll = ReturnType<typeof useSheetScroll>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What each row is handed beside its cells: the drop it takes and the grip that moves it, the seam above it and its\n * inserts, a folded gutter's menu, a band's mixed pick, and what a run of rows not read yet says and retries.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useDragLayerOptional, type CellCoord, type DragEventValue, type DragPayload } from \"@elaraai/east-ui-components\";\nimport { recordSliceNoun } from \"@elaraai/east-ui-components/internal\";\nimport { SHEET_PAGE_SIZE } from \"./paging.js\";\nimport { slotAt, type SheetRowDrop } from \"./drop.js\";\nimport type { InsertionActions, InsertSeam } from \"./Insertion.js\";\nimport { insertsLoose, groupInsertionSide } from \"./insertion-gesture.js\";\nimport type { SheetRowAction } from \"./Rows.js\";\nimport type { SheetHost } from \"./parts.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport type { SheetGestures } from \"./use-gestures.js\";\nimport type { SheetReading } from \"./use-reading.js\";\nimport type { SheetRing } from \"./use-ring.js\";\nimport type { SheetScroll } from \"./use-scroll.js\";\n\n/**\n * The sheet's drops as they stand (#1187): what the rows' shared\n * {@link SheetRowDrop} and the sheet's drop target call — made afresh each\n * render, read through a ref, so neither changes for it.\n */\nexport interface SheetDropApi {\n    /** Whether the drop a candidate event makes lands. */\n    canDrop: (event: DragEventValue) => boolean;\n    /** What the ghost says where a drag rests. */\n    caption: (coord: CellCoord, payload: DragPayload) => string | undefined;\n    /** Where it rests, as the announcements name it. */\n    name: (coord: CellCoord, payload: DragPayload) => string;\n    /** A drag rests over a row that takes it: the seam, or the row, lights. */\n    hover: (el: HTMLElement, coord: CellCoord, payload: DragPayload) => void;\n    /** A completed drag: run as one transaction — `false` when nothing changed. */\n    drop: (event: DragEventValue) => boolean;\n}\n\n/**\n * Builds what the rows are handed beside their cells (see the module docs).\n *\n * @param host - What the frame hands the parts\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetEffects - The effect runner and what its effects reach\n * @param sheetGestures - The history's runner, the discard and the insertion\n * @param sheetReading - The loading line and the frame's loading facts\n * @param sheetRing - The strip, the active cell and the hint\n * @param sheetScroll - The scroll's report, the sticky rows, the sizes and the motion\n * @returns The rows' drop, seams, inserts, decisions and runs\n */\nexport function useSheetRowParts(host: SheetHost, sheetDecode: SheetDecode, sheetSession: SheetSession,\n    sheetBody: SheetBody, sheetMachine: SheetMachine, sheetEffects: SheetEffects, sheetGestures: SheetGestures,\n    sheetReading: SheetReading, sheetRing: SheetRing, sheetScroll: SheetScroll) {\n    const {\n        canInsertGroups, canInsertRows, capabilities, chrome, folded, group, hostGrid, keyed, loose, noun, viewport,\n        words,\n    } = sheetDecode;\n    const { canEdit, draftOf, editingState, lens, lensDrawn, paging, rows, ui } = sheetSession;\n    const { blankLineRowOf, body, rowOf, rowSpace } = sheetBody;\n    const { ctx } = sheetMachine;\n    const { cardRef } = sheetEffects;\n    const { anchorFor, onInsert } = sheetGestures;\n    const { lensReading } = sheetReading;\n    const { anchorR, wr } = sheetRing;\n    const { headerRef } = sheetScroll;\n    // ── Drag and drop: what the rows hold (#1187) ─────────────────────────\n    // With the frame's drops, every row is a drop target on the sheet's\n    // surface, and a row, a line or a band its grip moves: one object every\n    // row shares, held still while the frame's drops are, its functions reading the\n    // plans the sheet makes (`dropApi`, in `use-drops.ts`), so no row renders again for a\n    // drag. A sheet that takes no gesture now — read only, or between an\n    // Apply's request and its answer — takes no drop either.\n    const dropHost = host.drop;\n    const dragActive = useDragLayerOptional()?.active === true;\n    // No drop target and no grip while a run's call is out (R2).\n    const dropOn = dropHost !== undefined && canEdit && editingState.available;\n    const dropApi = useRef<SheetDropApi | undefined>(undefined);\n    const rowDrop = useMemo<SheetRowDrop | undefined>(() => (dropHost === undefined ? undefined : {\n        surface: dropHost.surface,\n        canDrop: (event) => dropApi.current?.canDrop(event) ?? false,\n        slotAt: (payload, rect, clientY) => slotAt(dropHost, payload, rect, clientY),\n        options: {\n            caption: (coord, payload) => dropApi.current?.caption(coord, payload),\n            name: (coord, payload) => dropApi.current?.name(coord, payload) ?? \"\",\n        },\n        hover: (el, coord, payload) => dropApi.current?.hover(el, coord, payload),\n    }), [dropHost]);\n    // What a grip moves (SB44): flat and loose rows where they keep no key order, lines, and groups.\n    const moveRowsOn = dropOn && capabilities.moveRows.type !== \"none\";\n    const movesRows = moveRowsOn && !keyed;\n    const movesLines = moveRowsOn;\n    const movesGroups = dropOn && capabilities.moveGroups;\n    const [insertPreview, setInsertPreview] = useState<{ r: number; kind: \"row\" | \"group\"; side: \"gutter\" | \"body\" } | undefined>(undefined);\n    const canInsert = canEdit && editingState.available && (canInsertRows || canInsertGroups);\n    // A drag in flight owns the gutter: no seam offers its chips under it — nor\n    // does a folded gutter, whose rows' menus hold the inserts (#1215), nor a\n    // host's grid, which has no gutter (#1531).\n    const seamsOn = canInsert && !dragActive && !folded && hostGrid === undefined;\n    /** What the seam above row `r` offers, and what each chip previews. */\n    const insertActions = useCallback((r: number, side: \"gutter\" | \"body\"): InsertionActions => {\n        const anchor = anchorFor(r, \"before\");\n        const ordered = anchor.child !== undefined || anchor.tail === true || !keyed;\n        // Above a band, or beside a loose row, the row chip inserts a loose row (#846) — a row, not a line.\n        const looseRow = loose && insertsLoose(anchor, rows);\n        return {\n            ordered, groupOrdered: !keyed,\n            line: group !== undefined && !looseRow, noun: noun.singular,\n            row: canInsertRows && (group === undefined || anchor.entry !== undefined || looseRow) ? () => onInsert(\"row\", r, \"before\") : undefined,\n            group: canInsertGroups ? () => onInsert(\"group\", r, \"before\") : undefined,\n            preview: kind => {\n                if (kind === undefined || (kind === \"row\" ? !ordered : keyed)) { setInsertPreview(undefined); return; }\n                if (kind === \"row\") { setInsertPreview({ r, kind, side }); return; }\n                const parent = rows.find(row => row.id === anchor.entry);\n                if (parent === undefined) { setInsertPreview(undefined); return; }\n                const gside = groupInsertionSide(parent, anchor);\n                const next = rows[rows.indexOf(parent) + 1];\n                const target = gside === \"before\" ? rowOf(parent.id) : next === undefined ? blankLineRowOf(parent.id) : rowOf(next.id);\n                setInsertPreview(target === undefined ? undefined : { r: target, kind, side });\n            },\n        };\n    }, [canInsertRows, canInsertGroups, anchorFor, keyed, group, loose, noun, onInsert, rows, rowOf, blankLineRowOf]);\n    // The hovered seam. Its chips are drawn once, in the card's insertion\n    // layer, placed from the seam's and the gutter's boxes on the screen: the\n    // layer sits over every row and under the pinned header, so nothing a row\n    // holds (its editor, its ring, the row above) ever covers them.\n    const [seam, setSeam] = useState<InsertSeam | undefined>(undefined);\n    const seamHitRef = useRef<HTMLElement | null>(null);\n    const insertLayerRef = useRef<HTMLDivElement | null>(null);\n    const onSeamEnter = useCallback((r: number, side: \"gutter\" | \"body\", hit: HTMLElement) => {\n        const card = cardRef.current;\n        const gutter = hit.closest<HTMLElement>(\"[data-slot=gutter]\");\n        if (card === null || gutter === null) return;\n        const cardBox = card.getBoundingClientRect();\n        const hitBox = hit.getBoundingClientRect();\n        const gutterBox = gutter.getBoundingClientRect();\n        seamHitRef.current = hit;\n        // The chips sit wholly below the column header: the seam above the first row lies on its edge.\n        const headerBottom = headerRef.current?.getBoundingClientRect().bottom ?? -Infinity;\n        const top = Math.max(hitBox.top + hitBox.height / 2, headerBottom + 12) - cardBox.top;\n        // The chips: 8 px into the gutter's actions column — wherever the number column beside it ends — else from the gutter edge.\n        const actions = side === \"gutter\" ? gutter.querySelector<HTMLElement>(\":scope > [data-slot=fillSlot]\") : null;\n        setSeam({ r, side, top, left: (actions !== null ? actions.getBoundingClientRect().left + 8 : gutterBox.right) - cardBox.left });\n        insertActions(r, side).preview?.(canInsertRows ? \"row\" : \"group\");\n    }, [insertActions, canInsertRows, cardRef, headerRef]);\n    /** The pointer left the seam or its chips: they stay while it moves between the two. */\n    const onSeamLeave = useCallback((to: EventTarget | null) => {\n        if (to instanceof Node && (insertLayerRef.current?.contains(to) === true || seamHitRef.current?.contains(to) === true)) return;\n        seamHitRef.current = null;\n        setSeam(undefined);\n        setInsertPreview(undefined);\n    }, []);\n    // A scroll moves the rows from under the chips, and a change of rows moves the seam: either way the chips go until the pointer finds a seam again.\n    // The scroll is the frame's, either way. A drag starting takes them too (#1187).\n    useEffect(() => { setSeam(undefined); setInsertPreview(undefined); }, [body, dragActive]);\n    useEffect(() => {\n        if (viewport === null) return;\n        const hide = () => { setSeam(undefined); setInsertPreview(undefined); };\n        const frame = viewport.frame;\n        frame.addEventListener(\"scroll\", hide, { passive: true });\n        return () => { frame.removeEventListener(\"scroll\", hide); };\n    }, [viewport]);\n    // A row draws its own seam from primitives and this one stable handler,\n    // so hovering a seam, or a gesture anywhere, never hands every row a new\n    // element (#858).\n    const seamEnterRef = useRef(onSeamEnter);\n    seamEnterRef.current = onSeamEnter;\n    const onRowSeamEnter = useCallback((r: number, side: \"gutter\" | \"body\", hit: HTMLElement) => seamEnterRef.current(r, side, hit), []);\n    // Whether a body item shows an action button in the gutter's actions column: a proposal's ✓ ×, an anchor's → fill, a draft's × discard.\n    const hasDecisions = useCallback((i: number): boolean => {\n        const it = body[i];\n        if (it === undefined) return false;\n        if (it.kind === \"proposal\") return true;\n        const r = rowSpace.rowOf[i] ?? -1;\n        // The copilot's → sits on its anchor — a real row, or the blank line being typed on.\n        if ((it.kind === \"real\" || it.kind === \"blank\") && anchorR === r && ui.sugg !== null && ui.sugg.fill.size > 0) return true;\n        if (it.kind === \"real\") return draftOf(it.group?.row.id ?? it.row.id, it.group?.key).discardable;\n        if (it.kind === \"group\") return draftOf(it.row.id).discardable;\n        return false;\n    }, [body, rowSpace, anchorR, ui.sugg, draftOf]);\n    /** The seam above body item `i` takes the gutter unless an action sits in the actions column on either side of it. */\n    const seamSide = useCallback((i: number): \"gutter\" | \"body\" => (hasDecisions(i) || hasDecisions(i - 1) ? \"body\" : \"gutter\"), [hasDecisions]);\n    /**\n     * A folded gutter's inserts at a row (#1215): what the insertion strip\n     * offers with the row selected, in its words — above and below it (in\n     * key order, one to add), and a new group where the sheet takes one.\n     */\n    const insertsAt = (r: number): SheetRowAction[] => {\n        if (!canEdit || !editingState.available) return [];\n        const ordered = !keyed || anchorFor(r, \"before\").child !== undefined;\n        const out: SheetRowAction[] = [];\n        if (canInsertRows && ordered) out.push({ value: \"insertAbove\", label: words.m.insertAbove(), run: () => onInsert(\"row\", r, \"before\") });\n        if (canInsertRows && (group === undefined || loose || rows.length > 0)) out.push({ value: \"insertBelow\", label: words.m.insertBelow({ ordered }), run: () => onInsert(\"row\", r, \"after\") });\n        if (canInsertGroups) out.push({ value: \"insertGroup\", label: words.m.insertNewGroup({ noun: noun.singular }), run: () => onInsert(\"group\", r, \"after\") });\n        return out;\n    };\n    // Read as a row's menu opens, so no row renders again for it (#858).\n    const insertsRef = useRef(insertsAt);\n    insertsRef.current = insertsAt;\n    const rowInserts = useCallback((r: number) => insertsRef.current(r), []);\n    const foldedInserts = folded && canInsert ? rowInserts : undefined;\n\n    // A group's band is \"mixed\" while some, not all, of its lines are picked (the band's checkbox goes indeterminate).\n    const bandMixed = useCallback((r: number, picked: boolean): boolean => {\n        if (wr === null || picked) return false;\n        const g = ctx.groupAt?.(r);\n        return g?.lines !== undefined && !(g.lines.r1 < wr.r0 || g.lines.r0 > wr.r1);\n    }, [wr, ctx]);\n    // What the rail counts each source in where it has no label of its own (#1345): the rows in the sheet's word for\n    // them — a grouped sheet's groups' — and each other source in the word the frame gives it.\n    const hostNouns = host.nouns;\n    const railNouns = useMemo(() => (chrome === undefined ? undefined : Object.fromEntries(chrome.slice.parts.flatMap((part) => (part.label.type === \"some\" ? []\n        : [[part.source, part.source === \"rows\" ? (group !== undefined ? noun.plural : words.m.railRows()) : hostNouns?.get(part.source) ?? part.source] as const])))),\n    [chrome, group, noun, words.m, hostNouns]);\n    // What the loading line and a failed run name the rows by: what the rail counts them in (#1398).\n    const rowsSource = chrome?.slice.parts.find((part) => part.source === \"rows\");\n    const rowsNoun = rowsSource === undefined ? (group !== undefined ? noun.plural : words.m.railRows()) : recordSliceNoun(rowsSource, railNouns, words.locale);\n    // A failed read's Retry: the lens's segment, or the paged window (#853, #1349).\n    const retryRead = lensDrawn ? lens.retry : paging.retry;\n    // Whether a run's own reads are in flight (#1398): a stretch under the lens while the lens reads its segment (#1349) —\n    // never one it is not reading, far from the view or still to be placed; a paged run while one of the windows it\n    // stands for is — never because another, read ahead elsewhere, is.\n    const pendingWindows = paging.pending;\n    const runLoading = useCallback((band: { at: string; from: number; to: number }): boolean => (band.at === \"reading\"\n        ? lensReading.includes(band.from)\n        : pendingWindows.some((w) => w * SHEET_PAGE_SIZE <= band.to && (w + 1) * SHEET_PAGE_SIZE - 1 >= band.from)), [pendingWindows, lensReading]);\n    return {\n        bandMixed, dragActive, dropApi, dropHost, dropOn, foldedInserts, insertActions, insertLayerRef, insertPreview,\n        movesGroups, movesLines, movesRows, onRowSeamEnter, onSeamLeave, railNouns, retryRead, rowDrop, rowsNoun,\n        runLoading, seam, seamSide, seamsOn,\n    };\n}\n\n/** What {@link useSheetRowParts} gives the parts after it. */\nexport type SheetRowParts = ReturnType<typeof useSheetRowParts>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What an action cell asks of its sheet (#1475): one object every row shares,\n * held still for the sheet's life, so no row renders again for it (#858). A\n * row's offer reads every resident row — its gate sees them all — so an edit\n * anywhere may move it: the host's store says so, and only the action cells,\n * which listen, draw again; every other cell keeps its memo.\n *\n * @packageDocumentation\n */\n\nimport type { ActionCase, ActionOffer } from \"./model.js\";\nimport type { ActionHeld } from \"./ActionCell.js\";\n\n/** What an action cell asks of its sheet. */\nexport interface SheetActionHost {\n    /** Hear that what the cells show may have moved: the rows, the drafts, an overlay. */\n    subscribe: (listener: () => void) => () => void;\n    /** Moves whenever the cells should look again. */\n    version: () => number;\n    /** A row's offer at an action column, its gate asked over the row's context. */\n    offer: (r: number, key: string) => ActionOffer | undefined;\n    /** Whether the cell draws its controls (T9, X4). */\n    controls: (r: number, key: string) => boolean;\n    /** Whether a phone's cell offers a start (`Mobile Sheet Spec.md` SH7): nothing taken yet, and the row may act now. */\n    startable: (r: number, key: string) => boolean;\n    /** The control of the cell whose overlay is open. */\n    held: (r: number, key: string) => ActionHeld | undefined;\n    /** Whether the cell's value is a draft (ST3). */\n    dirty: (r: number, key: string) => boolean;\n    /** The next half pressed: a button taken at once, a choice's Menu or a form's Popover opened (P2–P4). */\n    next: (r: number, key: string, c: ActionCase, anchor: HTMLElement) => void;\n    /** The ▾ part pressed: the Menu of the rest of the offer (P5). */\n    more: (r: number, key: string, anchor: HTMLElement) => void;\n    /** The pointer rests on a control, or leaves it (P8). */\n    preview: (r: number, key: string, c: ActionCase | undefined) => void;\n}\n\n/** The store a host's cells listen to. */\nexport interface ActionStore {\n    subscribe: (listener: () => void) => () => void;\n    version: () => number;\n    /** Tell the cells to look again. */\n    bump: () => void;\n}\n\n/**\n * A store the action cells listen to.\n *\n * @returns The store\n */\nexport function createActionStore(): ActionStore {\n    const listeners = new Set<() => void>();\n    let seq = 0;\n    return {\n        subscribe: (listener) => {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n        version: () => seq,\n        bump: () => {\n            seq += 1;\n            for (const listener of [...listeners]) listener();\n        },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What an action's form holds, as its three places hold it — the grid's\n * popover, the inspector's inline form and a phone's bar (#1476, #1478,\n * #1479): a field's value along its path, and which required field is left\n * empty. A field emptied as it is typed in is empty whatever value it last\n * told: a number field that is cleared tells nothing (the hand test's F3), so\n * its own text is read too. A path steps into a variant through the case it\n * holds (#1549), and a field under a case it does not hold is not shown, and\n * not required.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, isVariant, variant } from \"@elaraai/east\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * A value with one field along a path set: a step into a variant sets its\n * case's value while it holds that case, and leaves it as it is while it holds\n * another.\n *\n * @param value - The form's value\n * @param path - The field's path\n * @param to - Its new value\n * @returns The value with it set\n */\nexport function setAt(value: unknown, path: readonly string[], to: unknown): unknown {\n    if (path.length === 0) return to;\n    const [head, ...rest] = path;\n    if (isVariant(value)) return stringEqual(value.type, head!) ? variant(head!, setAt(value.value, rest, to)) : value;\n    const at = (value ?? {}) as Record<string, unknown>;\n    return { ...at, [head!]: setAt(at[head!], rest, to) };\n}\n\n/**\n * A field's value along a path: a step into a variant its case's value while\n * it holds that case.\n *\n * @param value - The form's value\n * @param path - The field's path\n * @returns Its value, `undefined` for none, or for a case the variant does not hold\n */\nexport function getAt(value: unknown, path: readonly string[]): unknown {\n    let at = value;\n    for (const name of path) {\n        if (at === undefined || at === null) return undefined;\n        at = isVariant(at) ? (stringEqual(at.type, name) ? at.value : undefined) : (at as Record<string, unknown>)[name];\n    }\n    return at;\n}\n\n/**\n * The first required field left empty: one holding no value, or a text input the viewer has emptied — never one under\n * a case its variant does not hold, which the form does not show.\n *\n * @param specs - The form's fields\n * @param value - The form's value as it stands\n * @param root - The element the form is drawn in, whose inputs are read\n * @returns The field, or `undefined` while every required one holds a value\n */\nexport function emptyRequired(specs: readonly FieldSpecValue[], value: unknown, root: HTMLElement | null): FieldSpecValue | undefined {\n    return specs.find((spec) => {\n        if (spec.optional) return false;\n        if (getAt(value, spec.path) === undefined) {\n            // Under a case its variant does not hold: down the path, a variant holding another case.\n            let at = value;\n            for (const name of spec.path) {\n                if (at === undefined || at === null) return true;\n                if (isVariant(at) && !stringEqual(at.type, name)) return false;\n                at = isVariant(at) ? at.value : (at as Record<string, unknown>)[name];\n            }\n            return true;\n        }\n        const input = root?.querySelector<HTMLInputElement>(`[data-field=\"${spec.path.join(\".\")}\"] input:not([type=radio]):not([type=checkbox])`);\n        return input !== null && input !== undefined && input.value.trim() === \"\";\n    });\n}\n\n/** The first control of a form: a text box, a choice's radio or a date's segment (K5; the hand test's F1 for a date field). */\nexport const FIRST_CONTROL = \"input:not([type=hidden]), textarea, [role=radio], [role=spinbutton]\";\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * An action cell's one overlay (#1476, `Sheet Action Column - Behaviour\n * Spec.md` §5, §6): the Menu of a choice's reasons or of the rest of the\n * offer, and the anchored Popover of a form's fields. The Menu is the shared\n * Menu card, hung from the control that opened it; the form is the shared\n * anchored popover (`SliceEditPopover`) around `FieldForm`, the inspector's\n * own form, so an action asks for its value as every builder's Details does.\n * Neither ever opens a dialog (X13).\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent } from \"react\";\nimport { Menu as ChakraMenu, Portal, chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { variant } from \"@elaraai/east\";\nimport { FieldForm, SliceEditPopover, type FieldOption } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { useSheetWords } from \"../words.js\";\nimport type { SheetRegisterIndex } from \"../model.js\";\nimport { verbOf, type ActionCase } from \"./model.js\";\nimport { FIRST_CONTROL, emptyRequired, getAt, setAt } from \"./form-check.js\";\n\n/** The overlay open on an action cell, as its sheet holds it. */\nexport type ActionOverlayState =\n    | {\n        kind: \"menu\";\n        r: number;\n        /** The rows it takes on: a range down the column (T8), else the cell's own. */\n        rs: readonly number[];\n        key: string;\n        /** The control that opened it, held while it is open. */\n        part: \"next\" | \"more\";\n        anchor: HTMLElement;\n        /** The cases it lists: a choice's reasons, or the rest of the offer (M5). */\n        cases: readonly ActionCase[];\n        /** How the menu names the row (M5). */\n        head: string;\n    }\n    | {\n        kind: \"form\";\n        r: number;\n        /** The rows it takes on: a range down the column asks once (T8), else the cell's own. */\n        rs: readonly number[];\n        key: string;\n        part: \"next\" | \"more\";\n        anchor: HTMLElement;\n        /** The case it asks for. */\n        case: ActionCase;\n        /** The value it opens with (F10), decoded; `undefined` for none. */\n        initial: unknown;\n        /** How the row is named in its eyebrow (F4). */\n        name: string | undefined;\n        /** The row's words beside its name (F4). */\n        meta: string | undefined;\n    };\n\n/**\n * While an overlay is open, a press outside it only closes it (P6): the press and its click go no further, so a\n * dismissing click never also runs what it lands on — an Undo, another cell.\n *\n * @param inside - Whether an element is the overlay's own\n * @param onClose - Close it\n */\nfunction useOutsideDismiss(inside: (el: Element) => boolean, onClose: () => void): void {\n    const latest = useRef({ inside, onClose });\n    latest.current = { inside, onClose };\n    useEffect(() => {\n        const outside = (event: Event) => event.target instanceof Element && !latest.current.inside(event.target);\n        // The click a dismissing press makes is swallowed even once the overlay has gone — its library may close it on\n        // the press — and only that click: one that never comes (a drag) stops being waited for.\n        const press = (event: Event) => {\n            if (!outside(event) || event.type !== \"pointerdown\") return;\n            const close = latest.current.onClose;\n            const swallow = (click: Event) => {\n                click.preventDefault();\n                click.stopImmediatePropagation();\n                clearTimeout(timer);\n                close();\n            };\n            const timer = setTimeout(() => window.removeEventListener(\"click\", swallow, true), 1_000);\n            window.addEventListener(\"click\", swallow, { capture: true, once: true });\n        };\n        const swallowPress = (event: Event) => {\n            if (!outside(event)) return;\n            event.preventDefault();\n            event.stopImmediatePropagation();\n        };\n        window.addEventListener(\"pointerdown\", press, true);\n        window.addEventListener(\"mousedown\", swallowPress, true);\n        return () => {\n            window.removeEventListener(\"pointerdown\", press, true);\n            window.removeEventListener(\"mousedown\", swallowPress, true);\n        };\n    }, []);\n}\n\n/** Whether an element is inside an open overlay of the action column's: its Menu or its form. */\nconst insideOverlay = (el: Element) => el.closest(\"[data-sheet-action-menu], [data-sheet-action-form], [data-scope=popover], [data-scope=select], [data-scope=combobox]\") !== null;\n\n/** A choice, as the Menu lists it: its case, its words, and its value. */\ninterface Choice {\n    id: string;\n    label: string;\n    value: unknown;\n}\n\n/** A choice case's reasons, in their words: a menu's options, or a register's members. */\nfunction choicesOf(c: ActionCase, registers: SheetRegisterIndex): Choice[] {\n    if (c.take.type === \"menu\") return c.take.value.map((o) => ({ id: `${c.name}:${o.case}`, label: o.label, value: variant(o.case, null) }));\n    if (c.take.type === \"register\") return (registers.byName.get(c.take.value) ?? []).map((m) => ({ id: `${c.name}:${m.key}`, label: m.label === \"\" ? m.key : m.label, value: m.key }));\n    return [];\n}\n\n/** Props of {@link ActionMenu}. */\nexport interface ActionMenuProps {\n    state: Extract<ActionOverlayState, { kind: \"menu\" }>;\n    registers: SheetRegisterIndex;\n    /** A case taken with its value (M8): a button's null, a choice's reason. */\n    onTake: (c: ActionCase, value: unknown) => void;\n    /** A form case run from the Menu (M8): its Popover opens in the Menu's place, hung from the same control. */\n    onForm: (c: ActionCase) => void;\n    onClose: () => void;\n    /** The pointer rests on an item, or leaves it (P9): its case, previewed in the strip. */\n    onPreview?: ((c: ActionCase | undefined) => void) | undefined;\n}\n\n/**\n * The Menu of an action cell (§5): the direct actions first, numbered, under\n * how the row is named; then one group per choice, its reasons in their\n * words. A digit runs the item with that number (K4).\n */\nexport const ActionMenu = memo(function ActionMenu({ state, registers, onTake, onForm, onClose, onPreview }: ActionMenuProps) {\n    const styles = useSlotStyles(\"sheetAction\");\n    const { m } = useSheetWords();\n    const direct = state.cases.filter((c) => c.kind !== \"choice\");\n    const choices = state.cases.filter((c) => c.kind === \"choice\");\n    // Each item's run: a form's opens its Popover in the Menu's place (M8) — the Menu never closes first, which would\n    // hand the focus back to the grid under the form (F1 of the hand test); any other is taken, and the Menu closes.\n    // A form picked: the Menu's own close as it selects is the form's opening, never a close of the overlay.\n    const formed = useRef(false);\n    const items = useMemo(() => {\n        const out = new Map<string, () => void>();\n        for (const c of direct) out.set(`direct:${c.name}`, () => { if (c.kind === \"form\") { formed.current = true; onForm(c); } else { onTake(c, null); onClose(); } });\n        for (const c of choices) for (const choice of choicesOf(c, registers)) out.set(choice.id, () => { onTake(c, choice.value); onClose(); });\n        return out;\n    }, [direct, choices, registers, onForm, onTake, onClose]);\n    useOutsideDismiss(insideOverlay, onClose);\n    // An item the pointer rests on goes from under it as the Menu closes, picked or not, and never says it left: the\n    // strip lets its preview go as the Menu does (P9; F2 of the hand retest).\n    const previewRef = useRef(onPreview);\n    previewRef.current = onPreview;\n    useEffect(() => () => previewRef.current?.(undefined), []);\n    const anchor = state.anchor;\n    // Under the control, its right edge on the control's, flipping above where it would pass the sheet's bottom (M6).\n    const positioning = useMemo(() => ({\n        placement: \"bottom-end\" as const, gutter: 4, flip: true,\n        getAnchorRect: () => anchor.getBoundingClientRect(),\n        boundary: () => anchor.closest<HTMLElement>(\"[data-sheet-card]\") ?? document.documentElement,\n    }), [anchor]);\n    const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n        const n = event.key.length === 1 ? Number(event.key) : NaN;\n        const c = Number.isInteger(n) && n >= 1 ? direct[n - 1] : undefined;\n        if (c === undefined) return;\n        event.preventDefault();\n        event.stopPropagation();\n        items.get(`direct:${c.name}`)?.();\n    };\n    return (\n        <ChakraMenu.Root open onOpenChange={(d) => { if (!d.open && !formed.current) onClose(); }} positioning={positioning}\n            onSelect={(d) => { items.get(d.value)?.(); }}>\n            <Portal>\n                <ChakraMenu.Positioner>\n                    <ChakraMenu.Content css={styles.menu} data-sheet-action-menu=\"\" onKeyDown={onKeyDown}>\n                        {direct.length > 0 && (\n                            <ChakraMenu.ItemGroup>\n                                <ChakraMenu.ItemGroupLabel css={styles.menuHead}>{state.head}</ChakraMenu.ItemGroupLabel>\n                                {direct.map((c, i) => (\n                                    <ChakraMenu.Item key={c.name} value={`direct:${c.name}`} data-case={c.name}\n                                        onPointerEnter={() => onPreview?.(c)} onPointerLeave={() => onPreview?.(undefined)}>\n                                        {c.icon !== undefined && <FontAwesomeIcon icon={[\"fas\", c.icon as IconName]} aria-hidden />}\n                                        {verbOf(c)}\n                                        <chakra.span css={styles.menuKbd} aria-hidden=\"true\">{i + 1}</chakra.span>\n                                    </ChakraMenu.Item>\n                                ))}\n                            </ChakraMenu.ItemGroup>\n                        )}\n                        {choices.map((c) => (\n                            <ChakraMenu.ItemGroup key={c.name}>\n                                {(direct.length > 0 || choices.length > 1 || state.part === \"more\") && <ChakraMenu.Separator />}\n                                <ChakraMenu.ItemGroupLabel css={styles.menuHead}>{m.actionMenuChoice({ verb: c.label })}</ChakraMenu.ItemGroupLabel>\n                                {choicesOf(c, registers).map((choice) => (\n                                    <ChakraMenu.Item key={choice.id} value={choice.id} data-case={c.name}\n                                        onPointerEnter={() => onPreview?.(c)} onPointerLeave={() => onPreview?.(undefined)}>{choice.label}</ChakraMenu.Item>\n                                ))}\n                            </ChakraMenu.ItemGroup>\n                        ))}\n                    </ChakraMenu.Content>\n                </ChakraMenu.Positioner>\n            </Portal>\n        </ChakraMenu.Root>\n    );\n});\n\n/** A form's value as `FieldForm` edits it: the struct, or a scalar case's value under its name. */\nfunction formValueOf(c: ActionCase, value: unknown, scalar: boolean): unknown {\n    return scalar ? { [c.name]: value } : value;\n}\n\n/** Props of {@link ActionForm}. */\nexport interface ActionFormProps {\n    state: Extract<ActionOverlayState, { kind: \"form\" }>;\n    registers: SheetRegisterIndex;\n    /** What taking it with the values as they stand would write (F8): the consequence line. */\n    consequence: (c: ActionCase, value: unknown) => string;\n    /** The case taken with its value (F9). */\n    onTake: (c: ActionCase, value: unknown) => void;\n    onClose: () => void;\n}\n\n/**\n * A form case's Popover (§6): the eyebrow naming the action and the row, the\n * case's fields through `FieldForm`, the consequence, Cancel and the verb. A\n * required field left empty keeps it open, the focus on that field (F9); a\n * number typed past its field's bounds is refused as it is typed, the field\n * saying the bound, so an action takes no value its form's bounds don't hold.\n */\nexport const ActionForm = memo(function ActionForm({ state, registers, consequence, onTake, onClose }: ActionFormProps) {\n    const styles = useSlotStyles(\"sheetAction\");\n    // Cancel and the verb are Default buttons, never a Primary (F8).\n    const button = useRecipe({ key: \"button\" });\n    const { m } = useSheetWords();\n    const c = state.case;\n    const form = c.take.type === \"form\" ? c.take.value : undefined;\n    const specs = useMemo((): readonly FieldSpecValue[] => form?.specs ?? [], [form]);\n    const scalar = form?.scalar ?? false;\n    const [value, setValue] = useState<unknown>(() => formValueOf(c, state.initial, scalar));\n    // What ⏎ takes: the values as the field's own ⏎ has just written them, before the form draws again.\n    const valueRef = useRef(value);\n    const [missing, setMissing] = useState<string | undefined>(undefined);\n    const bodyRef = useRef<HTMLDivElement | null>(null);\n    const options = useMemo(() => {\n        const out: Record<string, FieldOption[]> = {};\n        for (const spec of specs) {\n            if (spec.editor.type !== \"reference\") continue;\n            const of = spec.editor.value.of;\n            out[of] = (registers.byName.get(of) ?? []).map((mm) => ({ key: mm.key, label: mm.label === \"\" ? mm.key : mm.label }));\n        }\n        return out;\n    }, [specs, registers]);\n    const onChange = useCallback((path: readonly string[], to: unknown) => {\n        valueRef.current = setAt(valueRef.current, path, to);\n        setValue(valueRef.current);\n        setMissing(undefined);\n    }, []);\n    const caseOf = (v: unknown): unknown => (scalar ? getAt(v, [c.name]) : v);\n    const caseValue = caseOf(value);\n    // A required field emptied as it is typed in: the foot says what it needs, never what a take it would refuse writes.\n    const [emptied, setEmptied] = useState<FieldSpecValue | undefined>(undefined);\n    const onInput = () => setEmptied(emptyRequired(specs, valueRef.current, bodyRef.current));\n    const take = () => {\n        const now = valueRef.current;\n        // A required field left empty (F9): the popover stays, the focus on it.\n        const empty = emptyRequired(specs, now, bodyRef.current);\n        if (empty !== undefined) {\n            const key = empty.path.join(\".\");\n            setMissing(key);\n            bodyRef.current?.querySelector<HTMLElement>(`[data-field=\"${key}\"] :is(${FIRST_CONTROL}, button)`)?.focus();\n            return;\n        }\n        onTake(c, caseOf(now));\n        onClose();\n    };\n    useOutsideDismiss(insideOverlay, onClose);\n    // On open, the focus in the first field, its value selected (K5) — once the control that opened it has let it go.\n    useEffect(() => {\n        let second = 0;\n        const first = requestAnimationFrame(() => {\n            second = requestAnimationFrame(() => {\n                // A date's first segment is its control (F1 of the hand retest).\n                const field = bodyRef.current?.querySelector<HTMLElement>(FIRST_CONTROL);\n                field?.focus({ preventScroll: true });\n                if (field instanceof HTMLInputElement) field.select();\n            });\n        });\n        return () => { cancelAnimationFrame(first); cancelAnimationFrame(second); };\n    }, []);\n    const anchor = state.anchor;\n    // Its left 24 px left of the control's centre (F3): it hangs, centred, from a point 136 px right of it.\n    const hangFrom = useCallback(() => {\n        const box = anchor.getBoundingClientRect();\n        return { x: box.x + box.width / 2 + 136, y: box.y, width: 0, height: box.height };\n    }, [anchor]);\n    const missingSpec = missing === undefined ? undefined : specs.find((spec) => spec.path.join(\".\") === missing);\n    return (\n        <SliceEditPopover open onOpenChange={(open) => { if (!open) onClose(); }} anchor={null} hangFrom={hangFrom} still\n            label={(\n                <chakra.span css={styles.formLabel} data-slot=\"actionFormLabel\">\n                    <chakra.span css={styles.formEyebrow} data-slot=\"actionFormEyebrow\">{m.actionFormEyebrow({ verb: c.label, name: state.name })}</chakra.span>\n                    {state.meta !== undefined && <chakra.span css={styles.formMeta} data-slot=\"actionFormMeta\">{state.meta}</chakra.span>}\n                </chakra.span>\n            )}\n            initialFocusEl={() => bodyRef.current?.querySelector<HTMLElement>(FIRST_CONTROL) ?? null}\n            footLeft={<chakra.span css={styles.formConsequence} data-slot=\"actionConsequence\" title={emptied !== undefined ? undefined : consequence(c, caseValue)}>\n                {emptied !== undefined ? m.actionNeeds({ fields: [emptied.label] }) : consequence(c, caseValue)}\n            </chakra.span>}\n            footActions={(\n                <>\n                    <chakra.button type=\"button\" css={[button({ variant: \"outline\", size: \"xs\" }), styles.formButton]} data-slot=\"actionCancel\" onClick={onClose}>{m.actionFormCancel()}</chakra.button>\n                    <chakra.button type=\"button\" css={[button({ variant: \"outline\", size: \"xs\" }), styles.formButton]} data-slot=\"actionTake\" onClick={take}>{c.label}</chakra.button>\n                </>\n            )}>\n            <chakra.div ref={bodyRef} css={styles.formBody} data-sheet-action-form=\"\" data-case={c.name} onInput={onInput}\n                // ⏎ in a field takes the action (K5, F9) — heard before the field, which may keep its own Enter (a date's\n                // segments do: F1 of the hand retest). A text area keeps its line breaks; an open list, its pick.\n                onKeyDownCapture={(event: KeyboardEvent<HTMLDivElement>) => {\n                    if (event.key !== \"Enter\" || event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) return;\n                    const at = event.target as HTMLElement;\n                    if (at.tagName === \"TEXTAREA\" || at.closest(\"[aria-expanded=true]\") !== null) return;\n                    if (at.tagName === \"BUTTON\" && at.getAttribute(\"role\") !== \"radio\") return;\n                    event.preventDefault();\n                    event.stopPropagation();\n                    queueMicrotask(take);\n                }}>\n                <FieldForm specs={specs} value={value} options={options} onChange={onChange} live refusesBreaches />\n                {missingSpec !== undefined && <chakra.span css={styles.formError} data-slot=\"actionFormError\" role=\"alert\">{m.issueRequired()} — {missingSpec.label}</chakra.span>}\n            </chakra.div>\n        </SliceEditPopover>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * An action field in the inspector's Details (#1478): the row's state and\n * summary as its cell draws them, then a button for each case its row is\n * offered — off, with why, while it may not act — and under them, inline, a\n * choice's reasons or a form's fields through `FieldForm` — a number typed past\n * its bounds refused, the field saying the bound — its consequence,\n * Cancel and the verb. Every case is taken through the same command as the\n * grid's, one transaction (T1). In a phone's drawer (`Mobile Sheet Spec.md`\n * SH12) the state stands 44 tall and the cases are the action bar's Default\n * 44 buttons, two to a line.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useContext, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport { chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { variant } from \"@elaraai/east\";\nimport { FieldForm, type FieldOption } from \"@elaraai/east-ui-components\";\nimport { FrameDrawer, useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { useSheetWords } from \"../words.js\";\nimport type { SheetRegisterIndex } from \"../model.js\";\nimport type { SheetCellValue } from \"../values.js\";\nimport { ActionCell } from \"./ActionCell.js\";\nimport { canTake, verbOf, type ActionCase, type ActionColumn } from \"./model.js\";\nimport { emptyRequired, getAt, setAt } from \"./form-check.js\";\nimport type { SheetActionHost } from \"./host.js\";\nimport { useSheetInspect } from \"../index.js\";\n\n/** What the inspector's action field takes beyond the cell's host. */\nexport interface ActionPanelApi {\n    /** Take a case with its value, one transaction. */\n    take: (r: number, key: string, c: ActionCase, value: unknown) => boolean;\n    /** What taking it would write, worded (F8). */\n    consequence: (r: number, key: string, c: ActionCase, value: unknown) => string;\n    /** What a form opens with (F10), decoded. */\n    initial: (r: number, key: string, c: ActionCase) => unknown;\n}\n\n/** Props of {@link ActionPanel}. */\nexport interface ActionPanelProps {\n    host: SheetActionHost;\n    api: ActionPanelApi;\n    r: number;\n    columnKey: string;\n    column: ActionColumn;\n    cell: SheetCellValue | undefined;\n    summary: string;\n    registers: SheetRegisterIndex;\n    /** Whether the action cell takes an edit: its column writes, and no mark locks it (#1560). */\n    writable: boolean;\n}\n\n/** Renders an action field in the inspector. */\nexport const ActionPanel = memo(function ActionPanel({ host, api, r, columnKey, column, cell, summary, registers, writable }: ActionPanelProps) {\n    const styles = useSlotStyles(\"sheetAction\");\n    const button = useRecipe({ key: \"button\" });\n    const phone = useContext(FrameDrawer);\n    const { m } = useSheetWords();\n    const seq = useSyncExternalStore(host.subscribe, host.version, host.version);\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- `seq` is the host's say that what the offer reads moved\n    const offer = useMemo(() => host.offer(r, columnKey), [host, r, columnKey, cell, seq]);\n    const [open, setOpen] = useState<ActionCase | undefined>(undefined);\n    const [value, setValue] = useState<unknown>(undefined);\n    const valueRef = useRef<unknown>(undefined);\n    // The required field a take found empty, named in the error as the popover names it.\n    const [missing, setMissing] = useState<FieldSpecValue | undefined>(undefined);\n    // The inline form's element, whose inputs say a required field was emptied (F3 of the hand test), and that field.\n    const formRef = useRef<HTMLDivElement | null>(null);\n    const [emptied, setEmptied] = useState<FieldSpecValue | undefined>(undefined);\n    // A phone's cells draw no controls (X4), but its drawer's field takes the cases as the grid's would: while the sheet\n    // takes an edit, the cell is writable and the row is not owned upstream (SH12).\n    const inspect = useSheetInspect();\n    const owned = inspect.selected.kind === \"one\" && inspect.selected.place.owned;\n    const controls = host.controls(r, columnKey) || (phone && inspect.writable && writable && !owned);\n    const choose = (c: ActionCase) => {\n        if (c.kind === \"button\") { api.take(r, columnKey, c, null); return; }\n        const form = c.take.type === \"form\" ? c.take.value : undefined;\n        const initial = c.kind === \"form\" ? api.initial(r, columnKey, c) : undefined;\n        valueRef.current = form?.scalar === true ? { [c.name]: initial } : initial;\n        setValue(valueRef.current);\n        setMissing(undefined);\n        setEmptied(undefined);\n        setOpen(open?.name === c.name ? undefined : c);\n    };\n    const onChange = useCallback((path: readonly string[], to: unknown) => {\n        valueRef.current = setAt(valueRef.current, path, to);\n        setValue(valueRef.current);\n        setMissing(undefined);\n    }, []);\n    const options = useMemo(() => {\n        const out: Record<string, FieldOption[]> = {};\n        for (const [name, members] of registers.byName) out[name] = members.map((mm) => ({ key: mm.key, label: mm.label === \"\" ? mm.key : mm.label }));\n        return out;\n    }, [registers]);\n    if (offer === undefined) return null;\n    const may = canTake(offer) && controls;\n    const why = offer.incomplete !== undefined ? m.actionIncomplete({ fields: offer.incomplete }) : offer.blocked;\n    const form = open?.take.type === \"form\" ? open.take.value : undefined;\n    const specs: readonly FieldSpecValue[] = form?.specs ?? [];\n    const caseValue = (v: unknown): unknown => (form?.scalar === true && open !== undefined ? getAt(v, [open.name]) : v);\n    const takeForm = () => {\n        if (open === undefined) return;\n        const now = valueRef.current;\n        const empty = emptyRequired(specs, now, formRef.current);\n        if (empty !== undefined) { setMissing(empty); return; }\n        if (api.take(r, columnKey, open, caseValue(now))) setOpen(undefined);\n    };\n    return (\n        <chakra.div css={styles.panel} data-inspector-action-field={columnKey}>\n            <chakra.div css={styles.panelState} data-phone={phone ? \"\" : undefined}>\n                <ActionCell column={column} summary={summary} offer={offer} controls={false} dirty={host.dirty(r, columnKey)}\n                    selected={false} held={undefined} onNext={() => undefined} onMore={() => undefined} />\n            </chakra.div>\n            {controls && offer.offered.length > 0 && (\n                <chakra.div css={phone ? styles.barRest : styles.panelActions} data-inspector-actions-offered=\"\"\n                    style={phone ? { [\"--action-rest\" as string]: \"2\" } : undefined}>\n                    {offer.offered.map((c) => (\n                        <chakra.button key={c.name} type=\"button\" css={phone ? [button({ variant: \"outline\", size: \"md\" }), styles.barButton] : button({ variant: \"outline\", size: \"xs\" })} disabled={!may}\n                            data-inspector-take={c.name} aria-expanded={c.kind === \"button\" ? undefined : open?.name === c.name} title={may ? undefined : why}\n                            onClick={() => choose(c)}>\n                            {c.icon !== undefined && <FontAwesomeIcon icon={[\"fas\", c.icon as IconName]} aria-hidden />}\n                            {verbOf(c)}\n                        </chakra.button>\n                    ))}\n                    {!may && why !== undefined && <chakra.span css={styles.menuReason} data-inspector-action-why=\"\">{why}</chakra.span>}\n                </chakra.div>\n            )}\n            {open !== undefined && open.kind === \"choice\" && (\n                <chakra.div css={styles.panelChoices} data-inspector-action-choices={open.name} role=\"group\" aria-label={m.actionMenuChoice({ verb: open.label })}>\n                    {(open.take.type === \"menu\" ? open.take.value.map((o) => ({ id: o.case, label: o.label, value: variant(o.case, null) as unknown }))\n                        : open.take.type === \"register\" ? (registers.byName.get(open.take.value) ?? []).map((mm) => ({ id: mm.key, label: mm.label === \"\" ? mm.key : mm.label, value: mm.key as unknown }))\n                            : []).map((choice) => (\n                        <chakra.button key={choice.id} type=\"button\" css={button({ variant: \"ghost\", size: \"xs\" })} data-inspector-choice={choice.id}\n                            onClick={() => { if (api.take(r, columnKey, open, choice.value)) setOpen(undefined); }}>\n                            {choice.label}\n                        </chakra.button>\n                    ))}\n                </chakra.div>\n            )}\n            {open !== undefined && open.kind === \"form\" && (\n                <chakra.div ref={formRef} css={styles.panelForm} data-inspector-action-form={open.name}\n                    onInput={() => setEmptied(emptyRequired(specs, valueRef.current, formRef.current))}>\n                    <FieldForm specs={specs} value={value} options={options} onChange={onChange} live refusesBreaches />\n                    {missing !== undefined && <chakra.span css={styles.formError} role=\"alert\">{m.issueRequired()} — {missing.label}</chakra.span>}\n                    <chakra.div css={styles.formFoot}>\n                        <chakra.span css={styles.formConsequence} data-consequence=\"\">\n                            {emptied !== undefined ? m.actionNeeds({ fields: [emptied.label] }) : api.consequence(r, columnKey, open, caseValue(value))}\n                        </chakra.span>\n                        <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} onClick={() => setOpen(undefined)}>{m.actionFormCancel()}</chakra.button>\n                        <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} data-inspector-take-form=\"\" onClick={takeForm}>{open.label}</chakra.button>\n                    </chakra.div>\n                </chakra.div>\n            )}\n        </chakra.div>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A phone's action bar (#1479, `Sheet Action Column - Behaviour Spec.md`\n * §12): in a frame of 560 or less the action cells show their state alone,\n * and the docked strip becomes the selected row's actions — its eyebrow with\n * the state at its end, the first offered case full width, the rest on one\n * line below (two and More… past four), the first case's consequence (X3,\n * X5, X6). A choice or a form opens inside the bar, never floating: a head\n * with ← back and the eyebrow, a choice's reasons as 44px rows, a form's\n * fields through `FieldForm` — a number typed past its bounds refused, the\n * field saying the bound — its consequence, then Cancel and the verb as two\n * halves (X7). Taking a case returns the bar to the row's new offer (X8),\n * through the same command as the grid's.\n *\n * As the designer drew it (`Mobile Sheet Spec.md` SH9): it opens on a tapped\n * Action cell, its head 44 — ‹ back in a sub-view, the eyebrow in ink, the\n * state, and ⌄ close — then its buttons, 44 Default buttons; a blocked row\n * says why in running text, and a row with nothing further says so with its\n * summary.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport { chakra, useRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport type { IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { faChevronDown, faChevronLeft, faEllipsis } from \"@fortawesome/free-solid-svg-icons\";\nimport { variant } from \"@elaraai/east\";\nimport { FieldForm, type FieldOption } from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { useSheetWords } from \"../words.js\";\nimport type { SheetRegisterIndex } from \"../model.js\";\nimport { canTake, verbOf, type ActionCase } from \"./model.js\";\nimport { emptyRequired, getAt, setAt } from \"./form-check.js\";\nimport type { SheetActionHost } from \"./host.js\";\nimport type { ActionPanelApi } from \"./ActionPanel.js\";\n\n/** Props of {@link ActionBar}. */\nexport interface ActionBarProps {\n    host: SheetActionHost;\n    api: ActionPanelApi;\n    /** The selected row. */\n    r: number;\n    /** The action column's key. */\n    columnKey: string;\n    /** How the row is named, and its words beside it (X5). */\n    name: string | undefined;\n    title: string | undefined;\n    registers: SheetRegisterIndex;\n    /** Whether the row takes actions here: not on a read-only sheet, an owned row or a column that takes no edit (T9). */\n    writable: boolean;\n    /** The row's summary: what a row with nothing further offered says after `No further actions` (SH9.1). */\n    summary?: string | undefined;\n    /** ⌄ close: the bar goes until the ring moves (SH9). */\n    onClose?: (() => void) | undefined;\n}\n\n/** The most cases the bar's buttons show before More… (X6). */\nconst BAR_MAX = 4;\n\n/** What the bar shows: the row's buttons, the rest of them, or a case opened inside it. */\ntype BarView = { kind: \"buttons\" } | { kind: \"more\" } | { kind: \"choice\"; c: ActionCase } | { kind: \"form\"; c: ActionCase };\n\n/** Renders a phone's action bar for the selected row. */\nexport const ActionBar = memo(function ActionBar({ host, api, r, columnKey, name, title, registers, writable, summary = \"\", onClose }: ActionBarProps) {\n    const styles = useSlotStyles(\"sheetAction\");\n    const button = useRecipe({ key: \"button\" });\n    const { m } = useSheetWords();\n    const seq = useSyncExternalStore(host.subscribe, host.version, host.version);\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- `seq` is the host's say that what the offer reads moved\n    const offer = useMemo(() => host.offer(r, columnKey), [host, r, columnKey, seq]);\n    const [view, setView] = useState<BarView>({ kind: \"buttons\" });\n    const [value, setValue] = useState<unknown>(undefined);\n    const valueRef = useRef<unknown>(undefined);\n    // The required field a take found empty, named in the error as the popover names it.\n    const [missing, setMissing] = useState<FieldSpecValue | undefined>(undefined);\n    // The bar's form, whose inputs say a required field was emptied (F3 of the hand test), and that field.\n    const formRef = useRef<HTMLDivElement | null>(null);\n    const [emptied, setEmptied] = useState<FieldSpecValue | undefined>(undefined);\n    const onChange = useCallback((path: readonly string[], to: unknown) => {\n        valueRef.current = setAt(valueRef.current, path, to);\n        setValue(valueRef.current);\n        setMissing(undefined);\n    }, []);\n    const options = useMemo(() => {\n        const out: Record<string, FieldOption[]> = {};\n        for (const [reg, members] of registers.byName) out[reg] = members.map((mm) => ({ key: mm.key, label: mm.label === \"\" ? mm.key : mm.label }));\n        return out;\n    }, [registers]);\n    if (offer === undefined) return null;\n    const controls = writable;\n    const may = canTake(offer);\n    const why = offer.incomplete !== undefined ? m.actionIncomplete({ fields: offer.incomplete }) : offer.blocked;\n    const eyebrow = [name, title].filter((t) => t !== undefined && t !== \"\").join(\" · \");\n    const take = (c: ActionCase, v: unknown) => { if (api.take(r, columnKey, c, v)) setView({ kind: \"buttons\" }); };\n    const open = (c: ActionCase) => {\n        if (c.kind === \"button\") { take(c, null); return; }\n        if (c.kind === \"choice\") { setView({ kind: \"choice\", c }); return; }\n        const form = c.take.type === \"form\" ? c.take.value : undefined;\n        const initial = api.initial(r, columnKey, c);\n        valueRef.current = form?.scalar === true ? { [c.name]: initial } : initial;\n        setValue(valueRef.current);\n        setMissing(undefined);\n        setEmptied(undefined);\n        setView({ kind: \"form\", c });\n    };\n    // ⌄ close, at the head's end (SH9).\n    const close = onClose === undefined ? null : (\n        <chakra.button type=\"button\" css={styles.barClose} aria-label={m.actionBarClose()} data-bar-close=\"\" onClick={onClose}>\n            <FontAwesomeIcon icon={faChevronDown} aria-hidden />\n        </chakra.button>\n    );\n    const caseButton = (c: ActionCase, first: boolean) => (\n        <chakra.button key={c.name} type=\"button\" css={[button({ variant: \"outline\", size: \"md\" }), styles.barButton]} disabled={!may}\n            data-bar-take={c.name} data-first={first ? \"\" : undefined} title={may ? undefined : why} onClick={() => open(c)}>\n            {c.icon !== undefined && <chakra.span data-check={c.icon === \"check\" ? \"\" : undefined}><FontAwesomeIcon icon={[\"fas\", c.icon as IconName]} aria-hidden /></chakra.span>}\n            {verbOf(c)}\n        </chakra.button>\n    );\n    // A case opened inside the bar (X7): ← back, its eyebrow, then its reasons or its fields.\n    if (view.kind === \"choice\" || view.kind === \"form\") {\n        const c = view.c;\n        const back = (\n            <chakra.div css={styles.barHead}>\n                <chakra.button type=\"button\" css={styles.barBack} aria-label={m.actionBarBack()} data-bar-back=\"\"\n                    onClick={() => setView({ kind: \"buttons\" })}>\n                    <FontAwesomeIcon icon={faChevronLeft} aria-hidden />\n                </chakra.button>\n                <chakra.span css={styles.barEyebrow}>{m.actionFormEyebrow({ verb: c.label, name })}</chakra.span>\n                {close}\n            </chakra.div>\n        );\n        if (c.kind === \"choice\") {\n            const choices = c.take.type === \"menu\" ? c.take.value.map((o) => ({ id: o.case, label: o.label, value: variant(o.case, null) as unknown }))\n                : c.take.type === \"register\" ? (registers.byName.get(c.take.value) ?? []).map((mm) => ({ id: mm.key, label: mm.label === \"\" ? mm.key : mm.label, value: mm.key as unknown }))\n                    : [];\n            return (\n                <chakra.div key=\"choice\" css={styles.bar} data-sheet-action-bar=\"choice\" data-case={c.name} role=\"group\" aria-label={m.actionMenuChoice({ verb: c.label })}>\n                    {back}\n                    {choices.map((choice) => (\n                        <chakra.button key={choice.id} type=\"button\" css={[button({ variant: \"outline\", size: \"md\" }), styles.barChoice]} data-bar-choice={choice.id}\n                            onClick={() => take(c, choice.value)}>\n                            {choice.label}\n                        </chakra.button>\n                    ))}\n                </chakra.div>\n            );\n        }\n        const form = c.take.type === \"form\" ? c.take.value : undefined;\n        const specs: readonly FieldSpecValue[] = form?.specs ?? [];\n        const caseOf = (v: unknown): unknown => (form?.scalar === true ? getAt(v, [c.name]) : v);\n        const takeForm = () => {\n            const now = valueRef.current;\n            const empty = emptyRequired(specs, now, formRef.current);\n            if (empty !== undefined) { setMissing(empty); return; }\n            take(c, caseOf(now));\n        };\n        return (\n            <chakra.div key=\"form\" ref={formRef} css={styles.bar} data-sheet-action-bar=\"form\" data-case={c.name}\n                onInput={() => setEmptied(emptyRequired(specs, valueRef.current, formRef.current))}>\n                {back}\n                <FieldForm specs={specs} value={value} options={options} onChange={onChange} live refusesBreaches />\n                {missing !== undefined && <chakra.span css={styles.formError} role=\"alert\">{m.issueRequired()} — {missing.label}</chakra.span>}\n                <chakra.span css={styles.barConsequence}>\n                    {emptied !== undefined ? m.actionNeeds({ fields: [emptied.label] }) : api.consequence(r, columnKey, c, caseOf(value))}\n                </chakra.span>\n                <chakra.div css={styles.barRest} data-bar-foot=\"\" style={{ [\"--action-rest\" as string]: \"2\" }}>\n                    <chakra.button type=\"button\" css={[button({ variant: \"outline\", size: \"md\" }), styles.barButton]} onClick={() => setView({ kind: \"buttons\" })}>{m.actionFormCancel()}</chakra.button>\n                    <chakra.button type=\"button\" css={[button({ variant: \"outline\", size: \"md\" }), styles.barButton]} data-bar-take-form=\"\" onClick={takeForm}>{c.label}</chakra.button>\n                </chakra.div>\n            </chakra.div>\n        );\n    }\n    const [first, ...rest] = offer.offered;\n    // More than four offered: two of the rest and More…, which lists the others inside the bar (X6).\n    const folded = offer.offered.length > BAR_MAX;\n    const shown = view.kind === \"more\" ? rest : folded ? rest.slice(0, 2) : rest;\n    const consequence = first !== undefined && first.kind === \"button\" ? api.consequence(r, columnKey, first, null) : undefined;\n    return (\n        <chakra.div key=\"buttons\" css={styles.bar} data-sheet-action-bar=\"buttons\">\n            <chakra.div css={styles.barHead}>\n                <chakra.span css={styles.barEyebrow} data-bar-eyebrow=\"\">{eyebrow}</chakra.span>\n                {offer.state !== undefined ? (\n                    <chakra.span css={[styles.state, styles.barState]} data-tone={offer.state.tone} data-bar-state=\"\">\n                        <chakra.span css={styles.dot} aria-hidden=\"true\" />\n                        {offer.state.state}\n                    </chakra.span>\n                ) : <chakra.span css={[styles.absent, styles.barState]} data-bar-state=\"\">{m.actionNotStarted()}</chakra.span>}\n                {close}\n            </chakra.div>\n            {/* A row that waits says why, in running text (SH9.3); one with nothing further says so, with its summary (SH9.1). */}\n            {controls && !may && why !== undefined && <chakra.span css={styles.barWhy} data-bar-why=\"\">{why}</chakra.span>}\n            {controls && may && first === undefined && (\n                <chakra.span css={styles.barConsequence} data-bar-terminal=\"\">{m.actionBarNothing({ summary })}</chakra.span>\n            )}\n            {controls && may && first !== undefined && (\n                <>\n                    {view.kind !== \"more\" && <chakra.div css={styles.barFirst}>{caseButton(first, true)}</chakra.div>}\n                    {(shown.length > 0 || folded) && (\n                        <chakra.div css={styles.barRest} style={{ [\"--action-rest\" as string]: String(Math.min(3, shown.length + (folded && view.kind !== \"more\" ? 1 : 0))) }}>\n                            {shown.map((c) => caseButton(c, false))}\n                            {folded && view.kind !== \"more\" && (\n                                <chakra.button type=\"button\" css={[button({ variant: \"outline\", size: \"md\" }), styles.barButton]} data-bar-more=\"\" onClick={() => setView({ kind: \"more\" })}>\n                                    <FontAwesomeIcon icon={faEllipsis} aria-hidden />\n                                    {m.actionBarMore()}\n                                </chakra.button>\n                            )}\n                        </chakra.div>\n                    )}\n                    {may && consequence !== undefined && <chakra.span css={styles.barConsequence} data-bar-consequence=\"\">{consequence}</chakra.span>}\n                </>\n            )}\n        </chakra.div>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The action buttons: an action column's cells, its Menu and its form, a case taken on a row or down a range as one\n * transaction, the strip over an action, the inspector's action field, and a phone's bottom container — the ring's action\n * bar, or its cell editor.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { Sheet } from \"@elaraai/e3-ui/internal\";\nimport { NULL_CELL, TITLE_KEY, cellText, cellWritable, lineId, resolveMember as resolveRegisterMember, type SheetColumnMeta } from \"./model.js\";\nimport { selectionRect } from \"./sheet-state.js\";\nimport type { EntryVersion } from \"./transactions.js\";\nimport { editsOutOfPlace, stepsInPlace } from \"./steps.js\";\nimport { actionCell, actionColumnOf, canTake, caseOf, offerOf, verbOf, type ActionCase } from \"./actions/model.js\";\nimport { createActionStore, type SheetActionHost } from \"./actions/host.js\";\nimport { ActionForm, ActionMenu, type ActionOverlayState } from \"./actions/ActionOverlay.js\";\nimport { ActionPanel, type ActionPanelApi } from \"./actions/ActionPanel.js\";\nimport { ActionBar } from \"./actions/ActionBar.js\";\nimport { followRows } from \"./items.js\";\nimport type { DraftEdit } from \"./use-editing.js\";\nimport type { SheetCellValue, SheetRowValue } from \"./values.js\";\nimport type { SheetHost } from \"./parts.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { CellWrite, SheetWrites } from \"./use-writes.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport type { SheetInput } from \"./use-input.js\";\n\nconst cellEqual = equalFor(Sheet.Types.Cell);\nconst stringEqual = equalFor(StringType);\n\n/** The dwell before the strip previews the action the pointer rests on, and the grace before it lets it go (P8, N5). */\nconst PREVIEW_MS = 120;\n\n/**\n * Builds the action column's host and what it opens (see the module docs).\n *\n * @param host - What the frame hands the parts\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetWrites - The cell writes, the removal and the proposals' inserts\n * @param sheetEffects - The effect runner and what its effects reach\n * @param sheetInput - The cells' and the grid's handlers\n * @returns The action host, its overlay, the phone's bar and cell editor\n */\nexport function useSheetActions(host: SheetHost, sheetDecode: SheetDecode, sheetSession: SheetSession,\n    sheetBody: SheetBody, sheetMachine: SheetMachine, sheetWrites: SheetWrites, sheetEffects: SheetEffects,\n    sheetInput: SheetInput) {\n    const {\n        allColumns, columns, framePx, gridId, group, hostGrid, phoneFrame, readOnly, registers, words,\n    } = sheetDecode;\n    const {\n        barClosedAt, canEdit, dispatchStore, draftVersion, editingState, recordGesture, rows, session, setBarClosedAt,\n        sourceRows, ui,\n    } = sheetSession;\n    const { idAt, metaAt, rowAt, rowOf, wireContextFor, writableAt } = sheetBody;\n    const { dispatch, rowSpaceSlots, seenRows } = sheetMachine;\n    const { failed, gestureEvents, writeCells } = sheetWrites;\n    const { cardRef } = sheetEffects;\n    const { actionApi, ringGesture } = sheetInput;\n    // ── The action column (#1475–#1477) ────────────────────────────────\n    // Every row's action cells ask one host, held still for the sheet's life (#858); what they read is the sheet as it\n    // stands (`actionApi`, made afresh each render), and its store tells them to look again as the rows, the drafts or\n    // the overlay move — only they draw again. A taken action is one transaction (T1): its field's new case, the cells\n    // its `updates` writes on the row and on its group's band, and the entry drawn again as the record would show it.\n    const hasActions = useMemo(() => allColumns.list.some((col) => col.kind === \"action\"), [allColumns]);\n    const actionStore = useMemo(createActionStore, []);\n    // The overlay is held by its rows' ids, never their places: a window landing above them, or a row another session\n    // adds, moves them, and a place would then name another row — the one a pick would take its case on. It is drawn\n    // at their places as they stand, and closes once one of them is gone.\n    const [heldOverlay, setHeldOverlay] = useState<{ overlay: ActionOverlayState; id: string; ids: readonly string[] } | undefined>(undefined);\n    const setActionOverlay = (overlay: ActionOverlayState | undefined) => {\n        if (overlay === undefined) { setHeldOverlay(undefined); return; }\n        const id = idAt(overlay.r);\n        const ids = overlay.rs.flatMap((r) => { const at = idAt(r); return at === undefined ? [] : [at]; });\n        if (id !== undefined && ids.length === overlay.rs.length) setHeldOverlay({ overlay, id, ids });\n    };\n    const actionOverlay = useMemo((): ActionOverlayState | undefined => {\n        if (heldOverlay === undefined) return undefined;\n        const { overlay } = heldOverlay;\n        const r = rowOf(heldOverlay.id);\n        const rs = heldOverlay.ids.flatMap((id) => { const at = rowOf(id); return at === undefined ? [] : [at]; });\n        if (r === undefined || rs.length !== heldOverlay.ids.length) return undefined;\n        return r === overlay.r && rs.every((at, i) => at === overlay.rs[i]) ? overlay : { ...overlay, r, rs };\n    }, [heldOverlay, rowOf]);\n    // The action the pointer rests on, previewed in the strip (P8), and the dwell before it shows or goes.\n    const [actionPreview, setActionPreview] = useState<{ r: number; key: string; c: ActionCase } | undefined>(undefined);\n    const previewTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n    useEffect(() => () => { if (previewTimer.current !== undefined) clearTimeout(previewTimer.current); }, []);\n    const actionHost = useMemo<SheetActionHost>(() => ({\n        subscribe: actionStore.subscribe,\n        version: actionStore.version,\n        offer: (r, key) => actionApi.current?.offer(r, key),\n        controls: (r, key) => actionApi.current?.controls(r, key) ?? false,\n        startable: (r, key) => actionApi.current?.startable(r, key) ?? false,\n        held: (r, key) => actionApi.current?.held(r, key),\n        dirty: (r, key) => actionApi.current?.dirty(r, key) ?? false,\n        next: (r, key, c, anchor) => actionApi.current?.next(r, key, c, anchor),\n        more: (r, key, anchor) => actionApi.current?.more(r, key, anchor),\n        preview: (r, key, c) => actionApi.current?.preview(r, key, c),\n    }), [actionStore, actionApi]);\n    /** The action cell at a row: its row, its column and its machine — a line's or a flat row's, never a band's or a blank's. */\n    const actionAt = (r: number, key: string) => {\n        const it = rowAt(r);\n        const meta = allColumns.byKey.get(key);\n        const column = actionColumnOf(meta);\n        if (it === undefined || it.kind !== \"real\" || meta === undefined || column === undefined) return undefined;\n        return { it, meta, column, cell: it.row.cells.get(key), lg: it.group };\n    };\n    /** A rule cell's text on a row (an action column's summary, name or title), if it holds one. */\n    const ruleText = (row: SheetRowValue, key: string | undefined): string | undefined => {\n        const cell = key === undefined ? undefined : row.cells.get(key);\n        return cell?.type === \"String\" && cell.value !== \"\" ? cell.value : undefined;\n    };\n    /** What a case's `updates` would write, as facts (R5): each cell it changes, `{header} {value}`, the row's then the band's. */\n    const actionFacts = (r: number, key: string, c: ActionCase, bytes: Uint8Array): { updates: ReturnType<NonNullable<ActionCase[\"updates\"]>> | undefined; facts: string[] } => {\n        const updates = c.updates?.(bytes, wireContextFor(r), new Date());\n        const facts: string[] = [];\n        const a = actionAt(r, key);\n        // A value in words: a register member by its label, anything else as its column prints it.\n        const said = (cell: SheetCellValue, meta: SheetColumnMeta): string => {\n            const member = meta.register !== undefined && cell.type === \"String\" ? resolveRegisterMember(registers, meta.register, cell.value) : undefined;\n            return member !== undefined && member.label !== \"\" ? member.label : cellText(cell, meta, words);\n        };\n        // The row's cells in the columns' order (R5), then the band's, named by the group: `WO-1042 On hold`.\n        for (const meta of allColumns.list) {\n            const cell = updates?.row.get(meta.key);\n            if (cell === undefined || (a !== undefined && cellEqual(a.it.row.cells.get(meta.key) ?? NULL_CELL, cell))) continue;\n            facts.push(`${meta.header} ${said(cell, meta)}`);\n        }\n        const groupName = a?.lg !== undefined ? a.lg.row.id : undefined;\n        for (const [k, cell] of updates?.group ?? []) {\n            const meta = group?.cells.get(k);\n            if (meta === undefined || (a?.lg !== undefined && cellEqual(a.lg.row.cells.get(k) ?? NULL_CELL, cell))) continue;\n            facts.push(`${groupName ?? meta.header} ${said(cell, meta)}`);\n        }\n        return { updates, facts };\n    };\n    const projectEntry = editingState.project;\n    /**\n     * Take a case with its value on rows, as one transaction (T1, T8): on each, its field's new case, the cells its\n     * `updates` writes on the row and on its group's band, and its entry drawn again as the record would show its draft.\n     * Every row must be offered the case now, or nothing is taken.\n     */\n    const takeAction = (rs: readonly number[], key: string, c: ActionCase, value: unknown): boolean => {\n        if (!canEdit || !editingState.available || rs.length === 0) return false;\n        const at = rs.map((r) => ({ r, a: actionAt(r, key) }));\n        if (at.some(({ r, a }) => {\n            if (a === undefined) return true;\n            const offer = offerOf(a.column, a.cell, wireContextFor(r));\n            return !canTake(offer) || !offer.offered.some((o) => o.name === c.name);\n        })) return false;\n        const writes: CellWrite[] = [];\n        const edits = new Map<string, DraftEdit>();\n        const facts: string[] = [];\n        let bytes: Uint8Array;\n        try {\n            bytes = c.encode(value);\n            for (const { r, a } of at) {\n                const taken = actionFacts(r, key, c, bytes);\n                if (rs.length === 1) for (const fact of taken.facts) facts.push(fact);\n                writes.push({ r, c: -1, key, cell: actionCell(c, bytes) });\n                for (const [k, cell] of taken.updates?.row ?? []) writes.push({ r, c: -1, key: k, cell });\n                const bandR = a!.lg !== undefined ? rowOf(a!.lg.row.id) : undefined;\n                if (bandR !== undefined) for (const [k, cell] of taken.updates?.group ?? []) writes.push({ r: bandR, c: -1, key: k, cell, force: true });\n                const entry = a!.lg !== undefined ? a!.lg.row.id : a!.it.row.id;\n                // The entry drawn again as the record would show its draft: its summary and every rule cell read the new case.\n                edits.set(entry, (version: EntryVersion): EntryVersion => {\n                    const projected = projectEntry(entry, version.draft, version.wire);\n                    if (projected === undefined || version.wire === undefined) return version;\n                    const keys = version.wire.lines;\n                    return { ...version, wire: { ...projected, id: version.wire.id, lines: projected.lines.map((line, i) => ({ ...line, key: keys[i]?.key ?? line.key })) } };\n                });\n            }\n        } catch (error) {\n            console.error(`[Sheet] the action \"${c.name}\" failed on column \"${key}\":`, error);\n            dispatchStore({ t: \"patch\", patch: { msg: { id: \"text\", text: words.m.actionFailed({ verb: c.label, reason: error instanceof Error ? error.message : String(error) }) } } });\n            return false;\n        }\n        gestureEvents.current = [];\n        let recorded = false;\n        try {\n            writeCells(writes, \"typed\");\n            recorded = recordGesture(gestureEvents.current, undefined, \"action\", edits, undefined, c.label);\n        } catch (error) {\n            failed(error);\n        } finally {\n            gestureEvents.current = [];\n        }\n        if (!recorded) return false;\n        // What the strip previewed is taken: the ring's cell says itself again (P8).\n        if (previewTimer.current !== undefined) { clearTimeout(previewTimer.current); previewTimer.current = undefined; }\n        setActionPreview(undefined);\n        const first = at[0]!.a!;\n        const name = rs.length === 1 ? ruleText(first.it.row, first.column.name) : words.m.inspectorSeveral({ n: rs.length, count: words.number(rs.length), lines: group !== undefined });\n        dispatchStore({ t: \"patch\", patch: { msg: { id: \"text\", text: words.m.noticeActionTaken({ state: c.state, name, n: facts.length, count: words.number(facts.length), facts }) } } });\n        return true;\n    };\n    /**\n     * The rows an action at a cell is taken on (T8): a range down the action column, every one of its rows an action\n     * row; else the cell's own row.\n     */\n    const actionRows = (r: number, key: string): number[] => {\n        const ci = columns.list.findIndex((col) => col.key === key);\n        const rect = selectionRect(ui);\n        if (ui.selEnd === null || rect.c0 !== ci || rect.c1 !== ci || r < rect.r0 || r > rect.r1 || rect.r0 === rect.r1) return [r];\n        const rs: number[] = [];\n        for (let k = rect.r0; k <= rect.r1; k++) if (actionAt(k, key) !== undefined) rs.push(k);\n        return rs.length === 0 ? [r] : rs;\n    };\n    /** What every row of a range is offered (T8): the first row's offer, less a case another row is not offered — none taken while any row may not act. */\n    const rangeOffer = (rs: readonly number[], key: string): ActionCase[] => {\n        const offers = rs.map((r) => { const a = actionAt(r, key); return a === undefined ? undefined : offerOf(a.column, a.cell, wireContextFor(r)); });\n        if (offers.some((o) => o === undefined || !canTake(o))) return [];\n        const [head, ...rest] = offers as NonNullable<(typeof offers)[number]>[];\n        return (head?.offered ?? []).filter((c) => rest.every((o) => o.offered.some((x) => x.name === c.name)));\n    };\n    /** The menu's head and the form's eyebrow name the row (M5, F4): its name and title rule cells, else its number. */\n    const actionHead = (r: number, key: string): { name: string | undefined; title: string | undefined } => {\n        const a = actionAt(r, key);\n        if (a === undefined) return { name: undefined, title: undefined };\n        const name = ruleText(a.it.row, a.column.name) ?? (a.lg !== undefined ? words.m.lineName({ number: String(a.lg.number), group: ruleText(a.lg.row, TITLE_KEY) ?? a.lg.row.id }) : words.m.rowName({ number: String(a.it.position + 1) }));\n        return { name, title: ruleText(a.it.row, a.column.title) };\n    };\n    /** What a form opens with (F10): the case's `initial`, else the row's value while it holds this case, else nothing. */\n    const initialOf = (r: number, key: string, c: ActionCase): unknown => {\n        const a = actionAt(r, key);\n        if (a === undefined) return undefined;\n        try {\n            return c.initial !== undefined ? c.decode(c.initial(wireContextFor(r)))\n                : a.cell?.type === \"Action\" && caseOf(a.cell) === c.name ? c.decode(a.cell.value.value) : undefined;\n        } catch (error) {\n            console.error(`[Sheet] the form of \"${c.name}\" could not open with its value:`, error);\n            return undefined;\n        }\n    };\n    const openForm = (r: number, key: string, c: ActionCase, anchor: HTMLElement, part: \"next\" | \"more\", rs: readonly number[] = [r]) => {\n        if (actionAt(r, key) === undefined) return;\n        const head = actionHead(r, key);\n        // A range's form asks once (T8): it opens on the first row's value, and its answer goes to every row.\n        setActionOverlay({ kind: \"form\", r, rs, key, part, anchor, case: c, initial: rs.length > 1 ? undefined : initialOf(r, key, c), name: head.name, meta: head.title });\n    };\n    /** What taking a case with a value would write, worded (F8, R2). */\n    const consequenceAt = (r: number, key: string, c: ActionCase, value: unknown): string => {\n        try { return words.m.actionSets({ facts: actionFacts(r, key, c, c.encode(value)).facts }); }\n        catch { return \"\"; }\n    };\n    /** Whether a row takes actions at a column (T9): a sheet that takes edits, a cell it writes that no mark locks (#1560), a row no system owns. */\n    const actionWritable = (r: number, key: string): boolean => {\n        const a = actionAt(r, key);\n        return a !== undefined && canEdit && cellWritable(a.meta, a.it.row.cells) && !(a.lg?.row ?? a.it.row).owned;\n    };\n    const ringOn = (r: number, key: string) => {\n        const c = columns.list.findIndex((col) => col.key === key);\n        if (c >= 0) { ringGesture(); dispatch({ t: \"select.move\", r, c }); }\n    };\n    /**\n     * A press on a cell's control takes no focus of its own (K1), so the grid takes it: ⏎ then takes the next case, and\n     * ⌘Z undoes the one taken — from a page whose focus was never in the grid too (review of #1481, finding 1). An\n     * overlay the press opens moves the focus into itself, and gives it back to the grid as it closes (K6).\n     */\n    const focusOnPress = () => { cardRef.current?.focus({ preventScroll: true }); };\n    const closeOverlay = () => {\n        setActionOverlay(undefined);\n        // What the overlay's items previewed goes with it, taken or not (P9; F2 of the hand retest).\n        if (previewTimer.current !== undefined) { clearTimeout(previewTimer.current); previewTimer.current = undefined; }\n        setActionPreview(undefined);\n        // Focus goes back to the grid, whose ring is on the cell (K6) — unless another overlay took its place.\n        queueMicrotask(() => { if (actionOverlayRef.current === undefined) cardRef.current?.focus({ preventScroll: true }); });\n    };\n    actionApi.current = !hasActions ? undefined : {\n        offer: (r, key) => {\n            const a = actionAt(r, key);\n            if (a === undefined) return undefined;\n            return offerOf(a.column, a.cell, canEdit && editingState.available ? wireContextFor(r) : undefined);\n        },\n        // Owned rows, a read-only sheet, a column that takes no edit, and a phone's frame show the state alone (T9, X4).\n        controls: (r, key) => actionWritable(r, key) && !phoneFrame,\n        // A phone's cell with nothing taken, its row free to act and offered a case now: `▶ Start` (SH7).\n        startable: (r, key) => {\n            if (!phoneFrame || !actionWritable(r, key) || !editingState.available) return false;\n            const a = actionAt(r, key);\n            if (a === undefined || a.cell?.type === \"Action\") return false;\n            return canTake(offerOf(a.column, a.cell, wireContextFor(r)));\n        },\n        held: (r, key) => (actionOverlay !== undefined && actionOverlay.r === r && actionOverlay.key === key ? actionOverlay.part : undefined),\n        dirty: (r, key) => {\n            const a = actionAt(r, key);\n            if (a === undefined) return false;\n            // Against what the record held where the drafts began; an entry no gesture touched is no draft.\n            const began = session.originals.get(a.lg !== undefined ? a.lg.row.id : a.it.row.id);\n            if (began === undefined) return false;\n            const wire = began.wire;\n            const was = a.lg !== undefined ? wire?.lines.find((line) => line.key === a.lg!.key)?.cells.get(key) : wire?.cells.get(key);\n            return !cellEqual(was ?? NULL_CELL, a.cell ?? NULL_CELL);\n        },\n        next: (r, key, c, anchor) => {\n            // Over a range down the column, the case on every row of it (T8); else the ring moves to the cell first (P2–P4).\n            const rs = actionRows(r, key);\n            if (rs.length > 1) { if (!rangeOffer(rs, key).some((o) => o.name === c.name)) return; }\n            else ringOn(r, key);\n            focusOnPress();\n            if (c.kind === \"button\") takeAction(rs, key, c, null);\n            else if (c.kind === \"form\") openForm(r, key, c, anchor, \"next\", rs);\n            else setActionOverlay({ kind: \"menu\", r, rs, key, part: \"next\", anchor, cases: [c], head: words.m.actionMenuHead(actionHead(r, key)) });\n        },\n        more: (r, key, anchor) => {\n            const rs = actionRows(r, key);\n            if (rs.length === 1) ringOn(r, key);\n            focusOnPress();\n            const a = actionAt(r, key);\n            if (a === undefined) return;\n            const offer = offerOf(a.column, a.cell, wireContextFor(r));\n            if (!canTake(offer)) return;\n            const first = offer.offered[0];\n            const cases = rs.length > 1 ? rangeOffer(rs, key).filter((c) => c.name !== first?.name) : offer.offered.slice(1);\n            // Nothing more every row of a range is offered: no Menu, and the footer says why (T8; F12 of the hand retest).\n            if (cases.length === 0) {\n                if (rs.length > 1) dispatchStore({ t: \"patch\", patch: { msg: { id: \"text\", text: words.m.actionRangeNothing() } } });\n                return;\n            }\n            setActionOverlay({ kind: \"menu\", r, rs, key, part: \"more\", anchor, cases, head: words.m.actionMenuHead(actionHead(r, key)) });\n        },\n        preview: (r, key, c) => {\n            // The strip previews an action the pointer rests on, after a dwell, and lets it go a grace after it leaves (P8, N5).\n            if (previewTimer.current !== undefined) clearTimeout(previewTimer.current);\n            previewTimer.current = setTimeout(() => {\n                previewTimer.current = undefined;\n                setActionPreview(c === undefined ? undefined : { r, key, c });\n            }, PREVIEW_MS);\n        },\n        enter: (r, key) => {\n            // ⏎ on an action cell (K2): the offer's first case, its control the anchor — the cell where none is drawn.\n            const a = actionAt(r, key);\n            if (a === undefined) return;\n            const offer = offerOf(a.column, a.cell, canEdit && editingState.available ? wireContextFor(r) : undefined);\n            const first = offer.offered[0];\n            if (first === undefined || !canTake(offer)) return;\n            const c = columns.list.findIndex((col) => col.key === key);\n            const cellEl = document.getElementById(`${gridId}-${r}-${c}`);\n            const anchor = cellEl?.querySelector<HTMLElement>(\"[data-slot=actionNext]\") ?? cellEl;\n            if (anchor === null || anchor === undefined) return;\n            actionApi.current?.next(r, key, first, anchor);\n        },\n        take: (r, key, c, value) => takeAction(actionRows(r, key), key, c, value),\n        consequence: (c, value) => (actionOverlay === undefined ? \"\" : consequenceAt(actionOverlay.r, actionOverlay.key, c, value)),\n        takeOn: takeAction,\n        consequenceAt,\n        initial: initialOf,\n        close: closeOverlay,\n        strip: () => {\n            // The strip over an action (R2, R3): the action the pointer rests on, else the ring's action cell.\n            if (ui.edit !== null || ui.sugg !== null) return undefined;\n            const preview = actionPreview;\n            if (preview !== undefined) {\n                const a = actionAt(preview.r, preview.key);\n                if (a === undefined) return undefined;\n                const { c } = preview;\n                const name = actionHead(preview.r, preview.key).name;\n                let text: string;\n                try {\n                    text = c.kind === \"form\" ? words.m.actionOpensForm()\n                        : c.kind === \"button\" ? words.m.actionSets({ facts: actionFacts(preview.r, preview.key, c, c.encode(null)).facts })\n                            : words.m.actionPickReason({ facts: [] });\n                } catch { text = \"\"; }\n                return { on: true, label: words.m.actionStripLabel({ verb: verbOf(c), name }), chips: [{ key: \"v\", label: text, on: false, flat: true, title: text }], meta: \"\", keys: \"\" };\n            }\n            const ringMeta = metaAt(ui.sel.r, ui.sel.c);\n            if (ui.ringless || ui.selEnd !== null || ringMeta?.kind !== \"action\") return undefined;\n            const a = actionAt(ui.sel.r, ringMeta.key);\n            if (a === undefined) return undefined;\n            const offer = offerOf(a.column, a.cell, canEdit && editingState.available ? wireContextFor(ui.sel.r) : undefined);\n            const text = words.m.actionStripState({\n                state: offer.state?.state, summary: ruleText(a.it.row, a.column.summary) ?? \"\", offers: offer.offered.map(verbOf),\n                blocked: offer.blocked, incomplete: offer.incomplete, readOnly: !(actionApi.current?.controls(ui.sel.r, ringMeta.key) ?? false),\n            });\n            // ⏎ is offered only where it takes something (R3).\n            const takes = canTake(offer) && (actionApi.current?.controls(ui.sel.r, ringMeta.key) ?? false);\n            return { on: true, label: words.m.actionStripLabel({ verb: undefined, name: actionHead(ui.sel.r, ringMeta.key).name }), chips: [{ key: \"v\", label: text, on: false, flat: true, title: text }], meta: \"\", keys: takes ? words.m.actionStripKeys() : \"\" };\n        },\n    };\n    // The cells look again as what they read moves: the rows and their drafts, the overlay, the frame's width.\n    useLayoutEffect(() => {\n        if (hasActions) actionStore.bump();\n    }, [hasActions, actionStore, rows, draftVersion, actionOverlay, canEdit, editingState.available, framePx]);\n    // An overlay whose row went — a narrowing, a new revision — closes; one whose rows moved goes with them.\n    useEffect(() => {\n        if (heldOverlay !== undefined && (actionOverlay === undefined || actionApi.current?.offer(actionOverlay.r, actionOverlay.key) === undefined)) setHeldOverlay(undefined);\n    }, [heldOverlay, actionOverlay, rows, actionApi]);\n    const onActionTake = useCallback((c: ActionCase, value: unknown) => {\n        const at = actionOverlayRef.current;\n        if (at !== undefined) actionApi.current?.takeOn(at.rs, at.key, c, value);\n    }, [actionApi]);\n    const actionOverlayRef = useRef(actionOverlay);\n    actionOverlayRef.current = actionOverlay;\n    const onActionForm = useCallback((c: ActionCase) => {\n        const at = actionOverlayRef.current;\n        if (at === undefined) return;\n        // A form run from the Menu opens in its place, hung from the control that opened the Menu (M8).\n        actionApiOpenForm.current(at.r, at.key, c, at.anchor, at.part, at.rs);\n    }, []);\n    const actionApiOpenForm = useRef(openForm);\n    actionApiOpenForm.current = openForm;\n    const onActionClose = useCallback(() => actionApi.current?.close(), [actionApi]);\n    // A Menu item the pointer rests on is previewed as a control is (P9).\n    const onMenuPreview = useCallback((c: ActionCase | undefined) => {\n        const at = actionOverlayRef.current;\n        if (at !== undefined) actionApi.current?.preview(at.r, at.key, c);\n    }, [actionApi]);\n    const actionConsequence = useCallback((c: ActionCase, value: unknown) => actionApi.current?.consequence(c, value) ?? \"\", [actionApi]);\n    // A form is its row's while it is open — what is typed in it stays as the rows move.\n    const actionOverlayNode = actionOverlay === undefined || heldOverlay === undefined ? null\n        : actionOverlay.kind === \"menu\"\n            ? <ActionMenu state={actionOverlay} registers={registers} onTake={onActionTake} onForm={onActionForm} onClose={onActionClose} onPreview={onMenuPreview} />\n            : <ActionForm key={`${heldOverlay.id}:${actionOverlay.key}:${actionOverlay.case.name}`} state={actionOverlay} registers={registers}\n                consequence={actionConsequence} onTake={onActionTake} onClose={onActionClose} />;\n    const rowActions = hasActions ? actionHost : undefined;\n    // The ring's row in a phone's bottom container: where it stands among the rows now. In the render the rows move\n    // under it — a window landing above, another session's row — the machine has not followed them yet, and its place\n    // names whatever row stands there now: the container would draw that row for a render, and the editor open on the\n    // ring's would go and come back without what was typed in it. It is followed here as the machine will follow it: a\n    // row that left keeps its place, as the ring does.\n    const seen = seenRows.current;\n    const ringR = (seen.source === sourceRows ? undefined : followRows(seen.slots, rowSpaceSlots)(ui.sel.r)) ?? ui.sel.r;\n    // A phone's action bar (#1479; `Mobile Sheet Spec.md` SH9, R3): the ring's Action cell's actions in the docked strip's\n    // place, opened by a tap on that cell — never on a row's other cells — and ⌄ closed until the ring moves to another\n    // cell: the ring's row and column by their identities, which the rows moving under it never changes.\n    const ringColumn = columns.list[ui.sel.c];\n    const ringId = idAt(ringR);\n    const ringAt = ringId === undefined || ringColumn === undefined ? undefined : { id: ringId, key: ringColumn.key };\n    const barClosed = barClosedAt !== undefined && ringAt !== undefined && stringEqual(barClosedAt.id, ringAt.id) && stringEqual(barClosedAt.key, ringAt.key);\n    const barKey = phoneFrame && !ui.ringless && ui.selEnd === null && ringColumn?.kind === \"action\" && !barClosed ? ringColumn.key : undefined;\n    const barRow = barKey !== undefined ? actionAt(ringR, barKey) : undefined;\n    // The bar's head names the step's group too — `WO-1042 · step 20` — as nothing else on a phone's screen may (X5; F17 of the hand test).\n    const barHeadOf = (r: number, key: string) => {\n        const head = actionHead(r, key);\n        const lg = actionAt(r, key)?.lg;\n        return lg === undefined || head.name === undefined ? head : { ...head, name: `${lg.row.id} · ${head.name}` };\n    };\n    const barHead = barKey !== undefined && barRow !== undefined ? barHeadOf(ringR, barKey) : undefined;\n    // The inspector's action field (#1478): the same host and the same command as the grid's.\n    const panelApi = useMemo<ActionPanelApi>(() => ({\n        take: (r, key, c, value) => actionApi.current?.take(r, key, c, value) ?? false,\n        consequence: (r, key, c, value) => actionApi.current?.consequenceAt(r, key, c, value) ?? \"\",\n        initial: (r, key, c) => actionApi.current?.initial(r, key, c),\n    }), [actionApi]);\n    const drawAction = useCallback((r: number, key: string): ReactNode => {\n        const it = rowAt(r);\n        const meta = allColumns.byKey.get(key);\n        const column = actionColumnOf(meta);\n        if (it === undefined || it.kind !== \"real\" || column === undefined) return null;\n        const summary = it.row.cells.get(column.summary);\n        return <ActionPanel host={actionHost} api={panelApi} r={r} columnKey={key} column={column} cell={it.row.cells.get(key)}\n            summary={summary?.type === \"String\" ? summary.value : \"\"} registers={registers} writable={meta !== undefined && cellWritable(meta, it.row.cells)} />;\n    }, [rowAt, allColumns, actionHost, panelApi, registers]);\n    const actionBar = barKey === undefined || barRow === undefined || barHead === undefined ? undefined\n        : <ActionBar key={barRow.lg !== undefined ? lineId(barRow.lg.row.id, barRow.lg.key) : barRow.it.row.id} host={actionHost} api={panelApi} r={ringR} columnKey={barKey}\n            name={barHead.name} title={barHead.title} registers={registers} writable={actionWritable(ringR, barKey)}\n            summary={ruleText(barRow.it.row, barRow.column.summary) ?? \"\"} onClose={() => setBarClosedAt(ringAt)} />;\n    // A phone's cell editor (`Mobile Sheet Spec.md` SH10, R9): the ring's cell of every other kind edits in the same\n    // bottom container — the inspector's form at touch size, its field alone, the frame's — opened by a press on the cell\n    // and ⌄ closed as the bar is. A cell that takes no edit opens nothing (SH10.2), a locked one too (#1560); a sheet read only opens nothing; nor,\n    // on a host's grid, does a cell that steps in place or opens where the host edits it (#1536): the press takes it there.\n    const hostEditor = host.cellEditor;\n    // Its eyebrow names the row as the action bar's does — its action column's name and title — where it has one.\n    const rowActionName = (r: number): string | undefined => {\n        const key = allColumns.list.find((col) => col.kind === \"action\")?.key;\n        if (key === undefined || actionAt(r, key) === undefined) return undefined;\n        const head = actionHead(r, key);\n        const named = [head.name, head.title].filter((t): t is string => t !== undefined && t !== \"\");\n        return named.length === 0 ? undefined : named.join(\" · \");\n    };\n    const ringC = ui.sel.c;\n    const ringMeta = metaAt(ringR, ringC);\n    const ringRow = rowAt(ringR);\n    const cellEditor = !phoneFrame || hostEditor === undefined || ui.ringless || ui.selEnd !== null || barClosed || readOnly || ringMeta === undefined\n        || !writableAt(ringR, ringC) || ringMeta.kind === \"action\" || ringMeta.kind === \"stamped\" || (hostGrid !== undefined && (stepsInPlace(ringMeta) || editsOutOfPlace(ringMeta, hostGrid)))\n        || (ringRow?.kind !== \"real\" && ringRow?.kind !== \"group\") || ringAt === undefined ? undefined\n        : hostEditor({ r: ringR, id: ringAt.id, columnKey: ringMeta.key, band: ringRow.kind === \"group\", name: rowActionName(ringR), onClose: () => setBarClosedAt(ringAt) });\n    return { actionBar, actionOverlayNode, cellEditor, drawAction, rowActions };\n}\n\n/** What {@link useSheetActions} gives the parts after it. */\nexport type SheetActions = ReturnType<typeof useSheetActions>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Drawing the rows: each body item as the grid draws it — a run not read yet, a sub row, a proposal, a band, a row a host\n * draws, or the Sheet's own row — with what the optimiser's runs left on it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, type ReactNode } from \"react\";\nimport { lineId } from \"./model.js\";\nimport type { SheetRowMarks } from \"./optimise.js\";\nimport { SheetRow, SheetRunRow, SheetProposalRow, SheetGroupRow, SheetRowBoundary, SheetSubRow } from \"./Rows.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetGestures } from \"./use-gestures.js\";\nimport type { SheetInput } from \"./use-input.js\";\nimport type { SheetOpenEditor } from \"./use-open-editor.js\";\nimport type { SheetViewTabs } from \"./use-view-tabs.js\";\nimport type { SheetRing } from \"./use-ring.js\";\nimport type { SheetScroll } from \"./use-scroll.js\";\nimport type { SheetRowParts } from \"./use-row-parts.js\";\nimport type { SheetActions } from \"./use-actions.js\";\nimport { ariaRowIndexOf, dropText } from \"./items.js\";\n\n/**\n * Builds the virtual rows' renderer (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetGestures - The history's runner, the discard and the insertion\n * @param sheetInput - The cells' and the grid's handlers\n * @param sheetOpenEditor - The styles and the open editor\n * @param sheetViewTabs - The view tabs, the summary and the folds\n * @param sheetRing - The strip, the active cell and the hint\n * @param sheetScroll - The scroll's report, the sticky rows, the sizes and the motion\n * @param sheetRowParts - The rows' drop, seams, inserts and runs\n * @param sheetActions - The action host, its overlay and the phone's bottom container\n * @returns The row renderer\n */\nexport function useSheetRows(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetGestures: SheetGestures, sheetInput: SheetInput, sheetOpenEditor: SheetOpenEditor,\n    sheetViewTabs: SheetViewTabs, sheetRing: SheetRing, sheetScroll: SheetScroll, sheetRowParts: SheetRowParts,\n    sheetActions: SheetActions) {\n    const {\n        bandPx, columns, driverColumn, folded, gridId, gridTemplate, group, gutterPx, hostGrid, hostLayout, noun,\n        registers, rowPx, size, subRowPx, viewPx,\n    } = sheetDecode;\n    const { canEdit, changesOf, draftOf, editingState, optimised, ui } = sheetSession;\n    const { body, colCount, linkCellCtx, memberships, rowSpace } = sheetBody;\n    const { onRowDiscard } = sheetGestures;\n    const {\n        onCellDouble, onCellDown, onCellEnter, onFillRow, onProposalAccept, onProposalPick, onProposalReject, onRowPick,\n        onTake,\n    } = sheetInput;\n    const { edit, styles } = sheetOpenEditor;\n    const { onFold, onSubRows } = sheetViewTabs;\n    const { anchorR, nextTarget, wr } = sheetRing;\n    const { arriving, editorAt, rangeCols, rect } = sheetScroll;\n    const {\n        bandMixed, dropOn, foldedInserts, insertPreview, movesGroups, movesLines, movesRows, onRowSeamEnter,\n        onSeamLeave, retryRead, rowDrop, rowsNoun, runLoading, seamSide, seamsOn,\n    } = sheetRowParts;\n    const { rowActions } = sheetActions;\n    // What the runs of the optimiser left on each row (#1409, R25), by the row's id — a line's by its line id — while the\n    // drafts hold it: each row is handed its own marks, held still until a run touches it again.\n    const marks: ReadonlyMap<string, SheetRowMarks> | undefined = optimised?.rows;\n    const renderRow = useCallback((i: number): ReactNode => {\n        const item = body[i];\n        if (item === undefined) return null;\n        // Its place among the grid's rows (#860).\n        const ariaRowIndex = ariaRowIndexOf(item, i, group !== undefined);\n        // A run of rows not drawn yet (#1398, CL2): an unloaded run, a stretch the lens reads, or a failed window.\n        if (item.kind === \"band\" || item.kind === \"failed\") {\n            return (\n                <SheetRunRow styles={hostGrid?.runStyles ?? styles} band={item.kind === \"band\" ? item.band : undefined} failure={item.kind === \"failed\" ? item.failure : undefined}\n                    loading={item.kind === \"band\" && runLoading(item.band)} gridTemplate={gridTemplate} columns={columns} rowPx={rowPx}\n                    bandPx={group !== undefined ? bandPx : undefined} dense={size === \"sm\"} noun={rowsNoun} onRetry={retryRead} ariaRowIndex={ariaRowIndex}\n                    // A host's grid (#1531): its lead's shape in the lead track, where it is laid out.\n                    lead={hostGrid === undefined ? undefined : hostLayout.lead ? hostGrid.leadRun : null} />\n            );\n        }\n        if (item.kind === \"subRow\") {\n            return (\n                <SheetSubRow\n                    styles={styles}\n                    subRowPx={subRowPx}\n                    subRow={item.subRow}\n                    parent={item.group.number}\n                    index={item.index}\n                    count={item.count}\n                    gutterPx={gutterPx}\n                    viewPx={viewPx}\n                    membership={memberships[i]}\n                    entering={arriving.has(`line:${item.lineId}`) ? Math.min(item.index, 8) : undefined}\n                    ariaRowIndex={ariaRowIndex}\n                    colCount={colCount}\n                />\n            );\n        }\n        if (item.kind === \"proposal\") {\n            return (\n                <SheetProposalRow\n                    styles={styles}\n                    columns={columns}\n                    registers={registers}\n                    driverColumn={driverColumn}\n                    gridTemplate={gridTemplate}\n                    rowPx={rowPx}\n                    index={item.index}\n                    number={item.number}\n                    grouped={item.grouped}\n                    cells={item.cells}\n                    meta={item.meta}\n                    picked={ui.gsel === item.index}\n                    linkCtx={linkCellCtx}\n                    onPick={onProposalPick}\n                    onAccept={onProposalAccept}\n                    onReject={onProposalReject}\n                    ariaRowIndex={ariaRowIndex}\n                    foldedGutter={folded}\n                />\n            );\n        }\n        const r = rowSpace.rowOf[i] ?? -1;\n        const inRangeRow = ui.selEnd !== null && r >= rect.r0 && r <= rect.r1;\n        if (item.kind === \"group\") {\n            if (group === undefined) return null;\n            return (\n                <SheetRowBoundary styles={styles} rowPx={bandPx} number={item.position + 1} resetKey={item.row}>\n                <SheetGroupRow\n                    styles={styles}\n                    columns={columns}\n                    registers={registers}\n                    gridTemplate={gridTemplate}\n                    bandPx={bandPx}\n                    seam={seamsOn ? seamSide(i) : undefined}\n                    onSeamEnter={onRowSeamEnter}\n                    onSeamLeave={onSeamLeave}\n                    insertPreview={insertPreview?.r === r ? insertPreview.kind : undefined}\n                    insertSide={insertPreview?.r === r ? insertPreview.side : undefined}\n                    r={r}\n                    row={item.row}\n                    number={item.position + 1}\n                    idPrefix={gridId}\n                    ariaRowIndex={ariaRowIndex}\n                    membership={memberships[i]}\n                    draft={draftOf(item.row.id)}\n                    onDiscard={onRowDiscard}\n                    group={group}\n                    folded={item.folded}\n                    count={item.count}\n                    first={i === 0}\n                    selC={!ui.ringless && ui.sel.r === r ? ui.sel.c : undefined}\n                    range={inRangeRow ? rangeCols : undefined}\n                    picked={wr !== null && r >= wr.r0 && r <= wr.r1}\n                    mixed={bandMixed(r, wr !== null && r >= wr.r0 && r <= wr.r1)}\n                    editor={edit !== null && edit.r === r ? editorAt : undefined}\n                    onCellDown={onCellDown}\n                    onCellDouble={onCellDouble}\n                    onCellEnter={onCellEnter}\n                    onRowPick={onRowPick}\n                    onFold={onFold}\n                    drop={dropOn ? rowDrop : undefined}\n                    dropRow={dropOn ? dropText(item) : undefined}\n                    movable={movesGroups}\n                    foldedGutter={folded}\n                    inserts={foldedInserts}\n                    marks={marks?.get(item.row.id)}\n                />\n                </SheetRowBoundary>\n            );\n        }\n        // A host draws the row (#1531): the Sheet's gestures, its cells' content and its editor, in the host's anatomy.\n        if (hostGrid !== undefined) {\n            const HostRow = hostGrid.Row;\n            const real = item.kind === \"real\" ? item.row : undefined;\n            return (\n                <SheetRowBoundary styles={styles} rowPx={rowPx} number={item.position + 1} resetKey={real}>\n                    <HostRow\n                        styles={styles}\n                        r={r}\n                        row={real}\n                        columns={columns}\n                        registers={registers}\n                        driverColumn={driverColumn}\n                        gridTemplate={gridTemplate}\n                        layout={hostLayout}\n                        rowPx={rowPx}\n                        idPrefix={gridId}\n                        ariaRowIndex={ariaRowIndex}\n                        selC={!ui.ringless && ui.sel.r === r ? ui.sel.c : undefined}\n                        range={inRangeRow ? rangeCols : undefined}\n                        editor={edit !== null && edit.r === r ? editorAt : undefined}\n                        draft={real !== undefined ? draftOf(real.id) : undefined}\n                        changes={real !== undefined ? changesOf(real.id, real) : undefined}\n                        writable={canEdit && editingState.available}\n                        linkCtx={linkCellCtx}\n                        actions={rowActions}\n                        onCellDown={onCellDown}\n                        onCellDouble={onCellDouble}\n                        onCellEnter={onCellEnter}\n                    />\n                </SheetRowBoundary>\n            );\n        }\n        const lg = item.group;\n        // A line with sub rows: how many, and whether they hang under it now.\n        const subRowCount = item.kind === \"real\" && lg !== undefined ? lg.row.lines[lg.index]?.subRows.length ?? 0 : 0;\n        const nextItem = body[i + 1];\n        const subRowsOpen = subRowCount > 0 && nextItem !== undefined && nextItem.kind === \"subRow\" && item.kind === \"real\" && nextItem.lineId === item.row.id;\n        return (\n            <SheetRowBoundary styles={styles} rowPx={rowPx} number={lg !== undefined ? lg.number : item.position + 1} resetKey={item.kind === \"real\" ? item.row : undefined}>\n            <SheetRow\n                styles={styles}\n                columns={columns}\n                registers={registers}\n                driverColumn={driverColumn}\n                gridTemplate={gridTemplate}\n                rowPx={rowPx}\n                seam={seamsOn ? seamSide(i) : undefined}\n                onSeamEnter={onRowSeamEnter}\n                onSeamLeave={onSeamLeave}\n                insertPreview={insertPreview?.r === r ? insertPreview.kind : undefined}\n                insertSide={insertPreview?.r === r ? insertPreview.side : undefined}\n                r={r}\n                number={lg !== undefined ? lg.number : item.position + 1}\n                idPrefix={gridId}\n                ariaRowIndex={ariaRowIndex}\n                first={i === 0}\n                row={item.kind === \"real\" ? item.row : undefined}\n                group={lg}\n                membership={memberships[i]}\n                draft={item.kind === \"real\" ? draftOf(lg?.row.id ?? item.row.id, lg?.key) : undefined}\n                onDiscard={item.kind === \"real\" ? onRowDiscard : undefined}\n                linkCtx={linkCellCtx}\n                selC={!ui.ringless && ui.sel.r === r ? ui.sel.c : undefined}\n                range={inRangeRow ? rangeCols : undefined}\n                picked={wr !== null && r >= wr.r0 && r <= wr.r1}\n                hit={item.kind === \"real\" && item.hit}\n                editor={edit !== null && edit.r === r ? editorAt : undefined}\n                fills={anchorR === r && ui.sugg !== null ? ui.sugg.fill : undefined}\n                nextTargetC={nextTarget !== null && nextTarget.r === r ? nextTarget.c : undefined}\n                hoverC={ui.hover !== null && ui.hover.r === r ? ui.hover.c : undefined}\n                onCellDown={onCellDown}\n                onCellDouble={onCellDouble}\n                onCellEnter={onCellEnter}\n                onRowPick={onRowPick}\n                onTake={onTake}\n                onFillRow={onFillRow}\n                subRowCount={subRowCount > 0 ? subRowCount : undefined}\n                subRowsOpen={subRowsOpen}\n                onSubRows={onSubRows}\n                noun={noun}\n                entering={lg !== undefined && arriving.has(`group:${lg.row.id}`) ? Math.min(lg.index, 8) : undefined}\n                drop={dropOn ? rowDrop : undefined}\n                dropRow={dropOn ? dropText(item) : undefined}\n                movable={item.kind === \"real\" && (lg !== undefined ? movesLines : movesRows)}\n                foldedGutter={folded}\n                inserts={foldedInserts}\n                marks={item.kind === \"real\" ? marks?.get(lg !== undefined ? lineId(lg.row.id, lg.key) : item.row.id) : undefined}\n                actions={rowActions}\n            />\n            </SheetRowBoundary>\n        );\n    }, [folded, foldedInserts, draftOf, memberships, seamsOn, seamSide, onRowSeamEnter, onSeamLeave, insertPreview, onRowDiscard, body, styles, runLoading, retryRead, rowsNoun, size, rowSpace, ui.selEnd, ui.sel, ui.sugg, ui.gsel, ui.hover, ui.ringless, rect, rangeCols, columns, registers, driverColumn, gridTemplate, rowPx, bandPx, subRowPx, gutterPx, viewPx, group, noun, wr, bandMixed, edit, editorAt, anchorR, nextTarget, onCellDown, onCellDouble, onCellEnter, onRowPick, onTake, onFillRow, onProposalPick, onProposalAccept, onProposalReject, onFold, onSubRows, linkCellCtx, arriving, gridId, colCount, dropOn, rowDrop, movesGroups, movesLines, movesRows, marks, rowActions, hostGrid, hostLayout, changesOf, canEdit, editingState.available]);\n    return { renderRow };\n}\n\n/** What {@link useSheetRows} gives the parts after it. */\nexport type SheetRows = ReturnType<typeof useSheetRows>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The side panel's reads and gestures: the target the ring or the range selects, its draft against what the record\n * holds, its writes, duplicates and removals, a host's own Add and Delete, the cells drawn as the grid draws them, and the\n * batch's issues, gone to where they are. A write asks each cell the one check the grid's gestures ask (#1560): a cell\n * its mark locks takes none, nor one with no blank a clear (#1561).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, type ReactNode } from \"react\";\nimport { StringType, equalFor, printFor, some, variant, type EastType, type PatchPath, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { SheetDraftFieldType } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, type EditIssue } from \"@elaraai/east-ui-components\";\nimport { kindOfIssue } from \"@elaraai/east-ui-components/internal\";\nimport { EditingIssueType } from \"@elaraai/east-ui/internal\";\nimport {\n    NULL_CELL, TITLE_KEY, cellIsBlank, cellText, cellWritable, driverKeyOf, lineAddress, markOf, resolveMember as resolveRegisterMember, takesClear, unitOf, type SheetColumnMeta,\n} from \"./model.js\";\nimport type { SheetCellRefusalWord } from \"./messages.js\";\nimport { clearSearch, narrowingQuery, writeNarrowing } from \"./view-state.js\";\nimport { askHiding, hiddenLine } from \"../shared/schedule/hidden.js\";\nimport { parseCell } from \"./parse/index.js\";\nimport { selectionRect } from \"./sheet-state.js\";\nimport type { EntryVersion } from \"./transactions.js\";\nimport { normalizeDraft } from \"./draft-values.js\";\nimport { namesMember } from \"./Rows.js\";\nimport { SheetCellContent } from \"./cells/Cell.js\";\nimport type { DraftEdit, LocalLayer } from \"./use-editing.js\";\nimport type { SheetCellValue, SheetEditValue, SheetRowValue, SheetRootValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { CellWrite, SheetWrites } from \"./use-writes.js\";\nimport type { SheetCopilot } from \"./use-copilot.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport type { SheetGestures } from \"./use-gestures.js\";\nimport type { SheetOpenEditor } from \"./use-open-editor.js\";\nimport type { SheetJumps } from \"./use-jumps.js\";\nimport type { SheetViewTabs } from \"./use-view-tabs.js\";\nimport type { SheetActions } from \"./use-actions.js\";\nimport type { SheetDuplicateOptions, SheetInspect, SheetInspectPlace, SheetInspectTarget, SheetInspectWrite, SheetRowChanges, SheetSelected } from \"./parts.js\";\nimport { mintLineKey, rowNameOf } from \"./local-rows.js\";\n\nconst stringEqual = equalFor(StringType);\n\nconst issueEqual = equalFor(EditingIssueType);\n\nconst printString = printFor(StringType);\n\n/**\n * A record field's value as a column's cell holds it — the case its East type\n * names, through an option — or `undefined` for none, and for a type no cell\n * holds.\n */\nfunction cellOfValue(value: unknown, type: EastType | undefined): SheetCellValue | undefined {\n    if (type?.type === \"Variant\" && \"some\" in type.cases && \"none\" in type.cases) {\n        const held = value as option<unknown>;\n        return held.type === \"some\" ? cellOfValue(held.value, type.cases.some) : undefined;\n    }\n    switch (type?.type) {\n        case \"Boolean\": return variant(\"Boolean\", value as boolean);\n        case \"Integer\": return variant(\"Integer\", value as bigint);\n        case \"Float\": return variant(\"Float\", value as number);\n        case \"String\": return variant(\"String\", value as string);\n        case \"DateTime\": return variant(\"DateTime\", value as Date);\n        default: return undefined;\n    }\n}\n\n/** One field of a draft, decoded: missing, a value, or the text that could not be read. */\ntype DraftFieldValue = ValueTypeOf<ReturnType<typeof SheetDraftFieldType<EastType>>>;\n\n/** A draft struct's fields as their values: a field's value, `undefined` while it is missing or unreadable. */\nexport function draftValues(draft: Record<string, unknown>, children: string | undefined): Record<string, unknown> {\n    const out: Record<string, unknown> = {};\n    for (const [field, state] of Object.entries(draft)) {\n        if (field === children) continue;\n        const s = state as DraftFieldValue;\n        out[field] = s.type === \"value\" ? s.value : undefined;\n    }\n    return out;\n}\n\n/** A draft struct with fields set: a value, or missing for `undefined`. */\nexport function withFields(draft: Record<string, unknown>, fields: ReadonlyMap<string, unknown>): Record<string, unknown> {\n    const next = { ...draft };\n    for (const [field, value] of fields) next[field] = value === undefined ? variant(\"missing\", null) : variant(\"value\", value);\n    return next;\n}\n\n/**\n * Builds what the inspector pane reads of the sheet and the gestures it makes (see the module docs).\n *\n * @param value - The Sheet root value\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetWrites - The cell writes, the removal and the proposals' inserts\n * @param sheetCopilot - What asks the copilot to run\n * @param sheetEffects - The effect runner and what its effects reach\n * @param sheetGestures - The history's runner, the discard and the insertion\n * @param sheetOpenEditor - The styles and the open editor\n * @param sheetJumps - The key search, the scroll's anchor and the issue gone to\n * @param sheetViewTabs - The view tabs, the summary and the folds\n * @param sheetActions - The action host, its overlay and the phone's bottom container\n * @returns The inspector's reads and gestures, and a host's Add and Delete\n */\nexport function useSheetInspector(value: SheetRootValue, sheetDecode: SheetDecode, sheetSession: SheetSession,\n    sheetBody: SheetBody, sheetMachine: SheetMachine, sheetWrites: SheetWrites, sheetCopilot: SheetCopilot,\n    sheetEffects: SheetEffects, sheetGestures: SheetGestures, sheetOpenEditor: SheetOpenEditor, sheetJumps: SheetJumps,\n    sheetViewTabs: SheetViewTabs, sheetActions: SheetActions) {\n    const {\n        allColumns, canInsertGroups, canInsertRows, capabilities, chrome, columns, copilotOn, declaredNoun,\n        driverColumn, group, lensWanted, loose, narrowing, registers, triggers, words,\n    } = sheetDecode;\n    const {\n        canEdit, changesOf, childField, dispatchStore, draftOf, draftType, draftVersion, editingState, layerRef, mintAmong, mintLineId,\n        readiness, recordGesture, rows, session, setLayer, sourceRows, store, storedBreaches, takenKeys, ui,\n    } = sheetSession;\n    const { allowedFor, body, idAt, levelAt, linkCellCtx, parseCtxFor, rowAt, rowSpace } = sheetBody;\n    const { dispatch, expectedNarrowing, keyIsText, uiRef } = sheetMachine;\n    const { emitEdit, failed, gestureEvents, writeCells } = sheetWrites;\n    const { requestRun } = sheetCopilot;\n    const { cardRef, runEffects } = sheetEffects;\n    const { insertWhenClosed, pendingInsertFocus } = sheetGestures;\n    const { styles } = sheetOpenEditor;\n    const { issueSought, onIssue, revealRef, rowsPick, seek } = sheetJumps;\n    const { wholeCount } = sheetViewTabs;\n    const { drawAction } = sheetActions;\n    // ── The inspector's reads and gestures (#1188) ────────────────────────\n    // Nothing here reads the source until the inspector pane asks for a\n    // target: a sheet with no inspector pane reads nothing for it.\n    const originalOf = editingState.original;\n    // What the source holds for an entry no gesture has touched, lifted into\n    // its draft — read once while the resident rows and the session stand, so a\n    // paged source's page is read again only when its windows move, its\n    // revision does, or a Save lands what it saved over the rows read before\n    // it and lets it go as they read it again (#1583).\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- the resident rows and the session's version are the cache's key: either moving empties it.\n    const lifted = useMemo(() => new Map<string, EntryVersion | undefined>(), [sourceRows, draftVersion]);\n    // An entry's version as it stands: the session's, else what a Save left of it or the source's — or none while its page is not in.\n    const versionOf = useCallback((id: string): EntryVersion | undefined => {\n        const held = session.entries.get(id);\n        if (held !== undefined) return held;\n        if (lifted.has(id)) return lifted.get(id);\n        let read: EntryVersion | undefined;\n        try { read = originalOf(id); } catch { read = undefined; }\n        lifted.set(id, read);\n        return read;\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- draftVersion tracks changes within the stable transaction session.\n    }, [session, originalOf, lifted, draftVersion]);\n    // The draft struct a target is: a row's (an entry's arm, beside loose rows), a band's group's, a line's child by its key.\n    const structOf = useCallback((version: EntryVersion | undefined, child: string | undefined): { draft: Record<string, unknown>; type: EastType } | undefined => {\n        if (version?.draft === undefined) return undefined;\n        const looseDraft = draftType.type === \"Variant\";\n        const draft = (looseDraft ? (version.draft as ValueTypeOf<typeof draftType>).value : version.draft) as Record<string, unknown>;\n        const armType: EastType = looseDraft ? (draftType.cases as Record<string, EastType>)[(version.draft as ValueTypeOf<typeof draftType>).type as string]! : draftType;\n        if (child === undefined) return { draft, type: armType };\n        if (childField === undefined || armType.type !== \"Struct\") return undefined;\n        const index = version.wire?.lines.findIndex((line) => stringEqual(line.key, child)) ?? -1;\n        const children = draft[childField] as unknown[] | undefined;\n        const childType = (armType.fields as Record<string, EastType>)[childField];\n        if (index < 0 || children === undefined || childType?.type !== \"Array\") return undefined;\n        return { draft: children[index] as Record<string, unknown>, type: childType.value as EastType };\n    }, [draftType, childField]);\n    // Where a row, a line or a band stands, read off the body: no read of the source.\n    const placeAt = useCallback((r: number): SheetInspectPlace | undefined => {\n        const it = rowAt(r);\n        if (it === undefined || (it.kind !== \"real\" && it.kind !== \"group\")) return undefined;\n        const lg = it.kind === \"real\" ? it.group : undefined;\n        const groupRow = lg !== undefined ? lg.row : it.kind === \"group\" ? it.row : undefined;\n        const title = groupRow?.cells.get(TITLE_KEY);\n        return {\n            r,\n            kind: it.kind === \"group\" ? \"band\" : lg !== undefined ? \"line\" : \"row\",\n            entry: lg !== undefined ? lg.row.id : it.row.id,\n            child: lg?.key,\n            index: lg?.index,\n            row: it.row,\n            number: lg !== undefined ? lg.number : it.position + 1,\n            group: groupRow !== undefined ? { title: title !== undefined && title.type === \"String\" && title.value !== \"\" ? title.value : undefined, lines: groupRow.lines.length } : undefined,\n            owned: (groupRow ?? it.row).owned,\n            subRows: lg !== undefined ? lg.row.lines[lg.index]?.subRows ?? [] : it.row.subRows,\n        };\n    }, [rowAt]);\n    const targetAt = useCallback((r: number): SheetInspectTarget | undefined => {\n        const place = placeAt(r);\n        if (place === undefined) return undefined;\n        const { entry, child, kind } = place;\n        const current = structOf(versionOf(entry), child);\n        // What the record holds: the version the first gesture began from — or, never touched, the draft itself.\n        const began = session.originals.get(entry);\n        const base = began === undefined ? current : structOf(began, child);\n        const children = kind === \"line\" ? undefined : childField;\n        return {\n            ...place,\n            value: current === undefined ? undefined : draftValues(current.draft, children),\n            baseline: base === undefined ? undefined : draftValues(base.draft, children),\n            complete: current === undefined || kind === \"band\" ? undefined : normalizeDraft(current.type, current.draft, entry).domain,\n            presentation: draftOf(entry, child),\n        };\n    }, [placeAt, structOf, versionOf, session, childField, draftOf]);\n    // What the ring and the range hold: a hover, a key, an editor elsewhere leave it as it is — and nothing before the\n    // ring is placed (#1531).\n    const selSel = ui.sel;\n    const selEnd = ui.selEnd;\n    const ringless = ui.ringless;\n    const selected = useMemo((): SheetSelected => {\n        if (ringless) return { kind: \"none\" };\n        const rect = selectionRect({ sel: selSel, selEnd });\n        if (rect.r0 === rect.r1) {\n            const place = placeAt(rect.r0);\n            return place === undefined ? { kind: \"none\" } : { kind: \"one\", place };\n        }\n        // Several rows: the rows and lines in the range — a band stands for its lines.\n        const rs: number[] = [];\n        for (let r = rect.r0; r <= rect.r1; r++) {\n            const it = rowAt(r);\n            if (it !== undefined && it.kind === \"real\") rs.push(r);\n        }\n        if (rs.length === 0) return { kind: \"none\" };\n        if (rs.length === 1) {\n            const place = placeAt(rs[0]!);\n            return place === undefined ? { kind: \"none\" } : { kind: \"one\", place };\n        }\n        return { kind: \"several\", rs, r0: rect.r0, r1: rect.r1 };\n    }, [ringless, selSel, selEnd, rowAt, placeAt]);\n    const inspectWrite = useCallback((writes: readonly SheetInspectWrite[], joins?: string): SheetCellRefusalWord | undefined => {\n        if (!canEdit || !editingState.available) return undefined;\n        gestureEvents.current = [];\n        const cellWrites: CellWrite[] = [];\n        const draftEdits = new Map<string, DraftEdit>();\n        const touched: { r: number; keys: string[] }[] = [];\n        // Why the first cell it leaves as it was is left: the footer says so, and the write answers it.\n        let refused: SheetCellRefusalWord | undefined;\n        for (const w of writes) {\n            const it = rowAt(w.r);\n            if (it === undefined || (it.kind !== \"real\" && it.kind !== \"group\")) continue;\n            const keys: string[] = [];\n            // The one check each cell asks, as the grid's gestures do: a cell its mark locks takes nothing, one whose column\n            // has no blank — a column from data's value that is no option — no clear, and a column from data no text it\n            // can't read, of which it keeps none.\n            const metaOf = (key: string) => (it.kind === \"group\" ? group?.cells.get(key) : allColumns.byKey.get(key));\n            const refusal = (meta: SheetColumnMeta | undefined, cell: SheetCellValue): SheetCellRefusalWord | undefined => {\n                if (meta === undefined) return undefined;\n                if (!cellWritable(meta, it.row.cells)) {\n                    const mark = markOf(meta, it.row.cells);\n                    return mark?.lock === true ? { why: \"locked\", words: mark.words } : { why: \"readOnly\", header: meta.header };\n                }\n                if (cellIsBlank(cell) && !takesClear(meta)) return { why: \"noClear\", header: meta.header };\n                return cell.type === \"Invalid\" && getSomeorUndefined(meta.raw.from) !== undefined ? { why: \"unread\", header: meta.header, text: cell.value } : undefined;\n            };\n            for (const [key, cell] of w.cells ?? []) {\n                const why = refusal(metaOf(key), cell);\n                if (why !== undefined) {\n                    refused ??= why;\n                    continue;\n                }\n                cellWrites.push({ r: w.r, c: -1, key, cell });\n                keys.push(key);\n            }\n            for (const [key, text] of w.texts ?? []) {\n                // As typing in the cell reads it: blank is the blank cell, unreadable text kept as typed.\n                const meta = metaOf(key);\n                if (meta === undefined) continue;\n                const outcome = parseCell(meta, text, parseCtxFor(w.r, meta));\n                const cell = outcome.kind === \"cell\" ? outcome.cell : outcome.kind === \"unrecognised\" ? variant(\"Invalid\", text) : NULL_CELL;\n                const why = refusal(meta, cell);\n                if (why !== undefined) {\n                    refused ??= why;\n                    continue;\n                }\n                cellWrites.push({ r: w.r, c: -1, key, cell });\n                keys.push(key);\n            }\n            touched.push({ r: w.r, keys });\n            const fields = w.fields;\n            if (fields === undefined || fields.size === 0) continue;\n            const lg = it.kind === \"real\" ? it.group : undefined;\n            const entry = lg !== undefined ? lg.row.id : it.row.id;\n            const child = lg?.key;\n            const prior = draftEdits.get(entry);\n            draftEdits.set(entry, (version) => {\n                const before = prior === undefined ? version : prior(version);\n                const at = structOf(before, child);\n                if (at === undefined) return before;\n                const set = withFields(at.draft, fields);\n                const looseDraft = draftType.type === \"Variant\";\n                const arm = looseDraft ? (before.draft as ValueTypeOf<typeof draftType>).type as string : undefined;\n                if (child === undefined) return { ...before, draft: looseDraft ? variant(arm!, set) : set };\n                const outer = (looseDraft ? (before.draft as ValueTypeOf<typeof draftType>).value : before.draft) as Record<string, unknown>;\n                const index = before.wire?.lines.findIndex((line) => stringEqual(line.key, child)) ?? -1;\n                const kids = [...(outer[childField!] as unknown[])];\n                kids[index] = set;\n                const next = { ...outer, [childField!]: kids };\n                return { ...before, draft: looseDraft ? variant(arm!, next) : next };\n            });\n        }\n        const said = refused === undefined ? undefined : { id: \"editRefused\" as const, word: refused };\n        // A write every cell of which was refused is no gesture.\n        if (cellWrites.length === 0 && draftEdits.size === 0) {\n            if (said !== undefined) dispatchStore({ t: \"patch\", patch: { msg: said } });\n            return refused;\n        }\n        if (cellWrites.length > 0) writeCells(cellWrites, \"typed\");\n        try { recordGesture(gestureEvents.current, undefined, \"typed\", draftEdits, undefined, undefined, joins); }\n        catch (error) { failed(error); }\n        finally { gestureEvents.current = []; }\n        if (said !== undefined) dispatchStore({ t: \"patch\", patch: { msg: said } });\n        // The copilot asks again for a row whose trigger column changed, as typing in it does.\n        if (copilotOn) {\n            for (const { r, keys } of touched) {\n                if (!keys.some((key) => triggers.size === 0 || triggers.has(key))) continue;\n                const id = idAt(r);\n                if (id !== undefined) requestRun(id, 0);\n            }\n        }\n        return refused;\n    }, [canEdit, editingState.available, rowAt, group, allColumns, parseCtxFor, structOf, draftType, childField, writeCells, recordGesture, failed, copilotOn, triggers, idAt, requestRun, gestureEvents, dispatchStore]);\n    const editInSheet = useCallback((r: number, key: string): boolean => {\n        const c = columns.list.findIndex((col) => stringEqual(col.key, key));\n        if (c < 0 || rowAt(r) === undefined) return false;\n        dispatch({ t: \"select.set\", r, c });\n        cardRef.current?.focus({ preventScroll: true });\n        return true;\n    }, [columns, rowAt, dispatch, cardRef]);\n    const removeRows = useCallback((r0: number, r1: number) => { runEffects([{ t: \"delete.rows\", r0, r1 }]); }, [runEffects]);\n    const duplicate = useCallback((rs: readonly number[], options?: SheetDuplicateOptions): boolean => {\n        if (!canEdit || !editingState.available) return false;\n        const idField = getSomeorUndefined(value.editing.idField);\n        const events: SheetEditValue[] = [];\n        const draftEdits = new Map<string, DraftEdit>();\n        const typed = variant(\"typed\", null);\n        // A copy's draft: the source's, with its own identity where the struct carries one.\n        const withIdentity = (draft: Record<string, unknown>, id: string): Record<string, unknown> =>\n            (idField !== undefined && idField in draft ? { ...draft, [idField]: variant(\"value\", id) } : draft);\n        // The field a host's copy leaves empty (#1534) — a Record's title: missing on its draft, and blank under the column\n        // over it, which its key names.\n        const empty = options?.empty;\n        const emptied = (draft: Record<string, unknown>): Record<string, unknown> =>\n            (empty !== undefined && empty in draft ? withFields(draft, new Map([[empty, undefined]])) : draft);\n        const blanked = (cells: SheetRowValue[\"cells\"]): SheetRowValue[\"cells\"] =>\n            (empty === undefined || !cells.has(empty) ? cells : new Map([...cells, [empty, NULL_CELL]]));\n        // The first copy: where a host's ring lands once the body holds it.\n        let first: { id: string; child?: string } | undefined;\n        // A group as the layer has it now: lines inserted earlier in this gesture included.\n        const groupsNow = new Map<string, SheetRowValue>();\n        const groupOf = (g: SheetRowValue) => groupsNow.get(g.id) ?? layerRef.current.edits.get(g.id) ?? layerRef.current.appended.find((x) => x.id === g.id) ?? g;\n        // A copy whose key is refused, or a gesture the session cannot take, duplicates nothing: the footer says why (#1536).\n        try {\n            for (const r of rs) {\n                const it = rowAt(r);\n                if (it === undefined || (it.kind !== \"real\" && it.kind !== \"group\")) continue;\n                const lg = it.kind === \"real\" ? it.group : undefined;\n                if (lg !== undefined) {\n                    // A line: its copy just after it in its group.\n                    if (!canInsertRows) continue;\n                    const g0 = groupOf(lg.row);\n                    const index = g0.lines.findIndex((line) => stringEqual(line.key, lg.key));\n                    const source = structOf(versionOf(lg.row.id), lg.key);\n                    if (index < 0 || source === undefined) continue;\n                    const key = mintLineKey(g0);\n                    const line = g0.lines[index]!;\n                    const g: SheetRowValue = { ...g0, lines: [...g0.lines.slice(0, index + 1), { ...line, key, cells: blanked(line.cells) }, ...g0.lines.slice(index + 1)] };\n                    groupsNow.set(g.id, g);\n                    events.push(variant(\"lineInsert\", { rowId: g.id, offset: BigInt(it.position), after: some(lineAddress(index)), line: lineAddress(index + 1), row: g, source: typed }));\n                    first ??= { id: g.id, child: key };\n                    const prior = draftEdits.get(g.id);\n                    const copy = emptied(loose ? withIdentity(source.draft, mintLineId()) : source.draft);\n                    draftEdits.set(g.id, (version) => {\n                        const before = prior === undefined ? version : prior(version);\n                        const looseDraft = draftType.type === \"Variant\";\n                        const outer = (looseDraft ? (before.draft as ValueTypeOf<typeof draftType>).value : before.draft) as Record<string, unknown>;\n                        const at = before.wire?.lines.findIndex((l) => stringEqual(l.key, key)) ?? -1;\n                        if (at < 0) return before;\n                        const kids = [...(outer[childField!] as unknown[])];\n                        kids[at] = copy;\n                        const next = { ...outer, [childField!]: kids };\n                        return { ...before, draft: looseDraft ? variant(\"group\", next) : next };\n                    });\n                    continue;\n                }\n                // A row, or a band's group with its lines: a new entry just after it, its draft the source's.\n                if (it.kind === \"group\" ? !canInsertGroups : !canInsertRows) continue;\n                const version = versionOf(it.row.id);\n                if (version?.draft === undefined) continue;\n                const id = mintAmong(takenKeys());\n                let copy: SheetRowValue = { ...it.row, id, owned: false, lines: [], cells: blanked(it.row.cells) };\n                for (const line of it.row.lines) copy = { ...copy, lines: [...copy.lines, { ...line, key: mintLineKey(copy) }] };\n                events.push(variant(\"insert\", { afterRowId: some(it.row.id), row: copy, source: typed }));\n                first ??= { id };\n                const looseDraft = draftType.type === \"Variant\";\n                const arm = looseDraft ? (version.draft as ValueTypeOf<typeof draftType>).type as string : undefined;\n                const inner = (looseDraft ? (version.draft as ValueTypeOf<typeof draftType>).value : version.draft) as Record<string, unknown>;\n                let draft = emptied(withIdentity(inner, id));\n                if (childField !== undefined && it.kind === \"group\" && loose) {\n                    draft = { ...draft, [childField]: (draft[childField] as Record<string, unknown>[]).map((c) => withIdentity(c, mintLineId())) };\n                }\n                const final = looseDraft ? variant(arm!, draft) : draft;\n                draftEdits.set(id, (v) => ({ ...v, draft: final, wire: copy }));\n            }\n            if (events.length === 0) return false;\n            const recorded = recordGesture(events, undefined, \"insert\", draftEdits);\n            // A host's ring lands on its column in the first copy, once the body holds it — opening where the host edits\n            // it, as a host's Add's does (#1534).\n            if (recorded && options?.ring !== undefined && first !== undefined) pendingInsertFocus.current = { ...first, edit: true, key: options.ring };\n            return recorded;\n        } catch (error) {\n            failed(error);\n            return false;\n        }\n    }, [canEdit, editingState.available, value.editing.idField, takenKeys, mintAmong, failed, rowAt, canInsertRows, canInsertGroups, structOf, versionOf, loose, mintLineId, draftType, childField, recordGesture, layerRef, pendingInsertFocus]);\n    const addLine = useCallback((bandR: number) => {\n        const it = rowAt(bandR);\n        if (it === undefined || it.kind !== \"group\") return;\n        insertWhenClosed({ kind: \"row\", anchor: { entry: it.row.id, tail: true, side: \"before\" } });\n    }, [rowAt, insertWhenClosed]);\n    const removeGroup = useCallback((bandR: number) => {\n        const it = rowAt(bandR);\n        if (it === undefined || it.kind !== \"group\" || !canEdit || !editingState.available || !capabilities.removeGroups) return;\n        gestureEvents.current = [];\n        const base = layerRef.current;\n        const next: LocalLayer = { ...base, removed: new Set([...base.removed, it.row.id]) };\n        layerRef.current = next;\n        setLayer(() => next);\n        emitEdit(variant(\"remove\", { rowIds: [it.row.id] }));\n        try { recordGesture(gestureEvents.current); }\n        catch (error) { failed(error); }\n        finally { gestureEvents.current = []; }\n        dispatchStore({ t: \"patch\", patch: { selEnd: null, msg: { id: \"deleted\", n: 1, what: \"groups\", noun: declaredNoun?.singular, nouns: declaredNoun?.plural, again: false } } });\n    }, [rowAt, canEdit, editingState.available, capabilities, setLayer, emitEdit, recordGesture, failed, declaredNoun, dispatchStore, gestureEvents, layerRef]);\n    // ── A host's own Add and Delete (#1533) ───────────────────────────────\n    // Read through refs, so what a host's chrome holds of them never changes: each acts on the sheet as it stands.\n    /** Adds a row first in the rows — its key's place, where the rows are keyed — the rail's search cleared first, so it is never hidden. */\n    const addEntry = (column?: string) => {\n        if (chrome !== undefined && narrowing !== undefined && narrowingQuery(narrowing).trim() !== \"\") {\n            // The sheet's own write: the ring goes to the new row, never back to the top.\n            const cleared = clearSearch(narrowing);\n            expectedNarrowing.current = cleared;\n            writeNarrowing(chrome, cleared);\n        }\n        insertWhenClosed({ kind: \"row\", anchor: { entry: rows[0]?.id, side: \"before\" } }, undefined, column);\n    };\n    const addRef = useRef(addEntry);\n    addRef.current = addEntry;\n    const addRow = useCallback((column?: string) => addRef.current(column), []);\n    /**\n     * Removes the rows of these ids the sheet draws — and those it no longer draws that a host held while it did (#1579)\n     * — as one transaction: a new row is simply dropped, and the ring goes with its row.\n     */\n    const executeRemoval = (ids: readonly string[], held?: ReadonlyMap<string, EntryVersion>) => {\n        if (!canEdit || !editingState.available || !capabilities.removeRows) return;\n        const drawn = new Set(rows.map((row) => row.id));\n        const gone = ids.filter((id) => drawn.has(id) || held?.has(id) === true);\n        if (gone.length === 0) return;\n        gestureEvents.current = [];\n        const base = layerRef.current;\n        const next: LocalLayer = { ...base, removed: new Set([...base.removed, ...gone]) };\n        layerRef.current = next;\n        setLayer(() => next);\n        emitEdit(variant(\"remove\", { rowIds: gone }));\n        let recorded = false;\n        try { recorded = recordGesture(gestureEvents.current, undefined, undefined, undefined, undefined, undefined, undefined, held); }\n        catch (error) { failed(error); }\n        finally { gestureEvents.current = []; }\n        if (!recorded) return;\n        const now = uiRef.current;\n        const ring = now.ringless ? undefined : idAt(now.sel.r);\n        dispatchStore({ t: \"patch\", patch: {\n            selEnd: null, ...(ring !== undefined && gone.includes(ring) ? { ringless: true } : {}),\n            msg: { id: \"deleted\", n: gone.length, what: \"rows\", noun: declaredNoun?.singular, nouns: declaredNoun?.plural, again: false },\n        } });\n    };\n    const removalRef = useRef(executeRemoval);\n    removalRef.current = executeRemoval;\n    // A removal waits for an open editor to commit, as an insertion does.\n    const pendingRemoval = useRef<{ ids: readonly string[]; held: ReadonlyMap<string, EntryVersion> | undefined } | undefined>(undefined);\n    const removeRowsById = useCallback((ids: readonly string[], held?: ReadonlyMap<string, EntryVersion>) => {\n        if (uiRef.current.edit === null) { removalRef.current(ids, held); return; }\n        pendingRemoval.current = { ids, held };\n        dispatch({ t: \"editor.blur\" });\n    }, [dispatch, uiRef]);\n    useLayoutEffect(() => {\n        const pending = pendingRemoval.current;\n        if (ui.edit !== null || pending === undefined) return;\n        pendingRemoval.current = undefined;\n        removalRef.current(pending.ids, pending.held);\n    }, [ui.edit, store.fxSeq]);\n    // What a host holds of a row it may remove once the sheet no longer draws it (#1579): its version as it stands now —\n    // the session's, else what the record holds — or none for a row not read.\n    const holdNow = (id: string): EntryVersion | undefined => {\n        const version = versionOf(id);\n        return version === undefined || (version.draft === undefined && version.wire === undefined) ? undefined : version;\n    };\n    const holdRef = useRef(holdNow);\n    holdRef.current = holdNow;\n    const holdRow = useCallback((id: string) => holdRef.current(id), []);\n    // A column, or a band's cell, by its key at a row.\n    const columnAt = useCallback((r: number, key: string): SheetColumnMeta | undefined => {\n        const it = rowAt(r);\n        return it?.kind === \"group\" ? group?.cells.get(key) : allColumns.byKey.get(key);\n    }, [rowAt, group, allColumns]);\n    const inspectCellAt = useCallback((r: number, key: string): SheetCellValue | undefined => {\n        const it = rowAt(r);\n        return it !== undefined && (it.kind === \"real\" || it.kind === \"group\") ? it.row.cells.get(key) : undefined;\n    }, [rowAt]);\n    const inspectWritableAt = useCallback((r: number, key: string): boolean => {\n        const it = rowAt(r);\n        const meta = columnAt(r, key);\n        return meta !== undefined && it !== undefined && (it.kind === \"real\" || it.kind === \"group\") && cellWritable(meta, it.row.cells);\n    }, [rowAt, columnAt]);\n    // What a row's drafts changed, as the grid tints its cells by it: a line's and a band's are their group's.\n    const changesAt = useCallback((r: number): SheetRowChanges | undefined => {\n        const it = rowAt(r);\n        return it?.kind === \"real\" && it.group === undefined ? changesOf(it.row.id, it.row) : undefined;\n    }, [rowAt, changesOf]);\n    const unitAt = useCallback((r: number, key: string): string | undefined => {\n        const meta = columnAt(r, key);\n        const it = rowAt(r);\n        const driverKey = driverKeyOf(it !== undefined && it.kind === \"real\" ? it.row : undefined, driverColumn);\n        return meta === undefined ? undefined : unitOf(meta, driverKey);\n    }, [columnAt, rowAt, driverColumn]);\n    const inspectLevelAt = useCallback((r: number, key: string) => {\n        const meta = columnAt(r, key);\n        return meta === undefined ? undefined : levelAt(r, meta);\n    }, [columnAt, levelAt]);\n    const allowedAt = useCallback((r: number, key: string): ReadonlySet<string> | undefined => {\n        const meta = columnAt(r, key);\n        return meta === undefined ? undefined : allowedFor(r, meta);\n    }, [columnAt, allowedFor]);\n    const drawCell = useCallback((r: number, key: string): ReactNode => {\n        const it = rowAt(r);\n        const meta = columnAt(r, key);\n        if (it === undefined || meta === undefined || (it.kind !== \"real\" && it.kind !== \"group\")) return null;\n        const cell = it.row.cells.get(meta.key);\n        const member = namesMember(meta) && cell !== undefined && cell.type === \"String\" ? resolveRegisterMember(registers, meta.register, cell.value) : undefined;\n        return (\n            <SheetCellContent styles={styles} meta={meta} cell={cell} rowBlank={false} unit={unitAt(r, key)} member={member} ghost={undefined}\n                link={meta.kind === \"link\" && it.kind === \"real\" ? linkCellCtx(it.row, meta) : undefined} />\n        );\n    }, [rowAt, columnAt, registers, styles, unitAt, linkCellCtx]);\n    const seekSearch = seek.search;\n    const goToIssue = useCallback((issue: EditIssue) => {\n        onIssue(issue);\n        // On a paged sheet the issue's row may not be in yet: its key is sought, and the row lands where the key\n        // search's would — under the lens, where the narrowing keeps it (#1349).\n        const resident = body.some((it) => (it.kind === \"group\" ? stringEqual(it.row.id, issue.entry)\n            : it.kind === \"real\" ? stringEqual(it.group?.row.id ?? it.row.id, issue.entry) : false));\n        if (resident || seekSearch === undefined) return;\n        // A seek takes the key's `.east` text: a String key's is quoted, any other key's is its id.\n        const literal = keyIsText ? printString(issue.entry) : issue.entry;\n        void seekSearch.find({ key: literal }).then((range) => {\n            if (!range.found) return;\n            // A row the narrowing hides, known so (the hidden pick): the filters hiding it cleared — those e3 named, else\n            // every one — and the issue's cell gone to once the narrowing they leave draws its row. Else the row is sought\n            // where it is, and a jump that finds it hidden reveals it so.\n            const state = rowsPick.rows.stateOf(issue.entry);\n            if (state !== undefined && state.hidden) { revealRef.current(range.row, issue.entry, true); return; }\n            issueSought.current = { entry: issue.entry, row: range.row };\n            seekSearch.jump(range.row);\n        }).catch(() => { /* superseded or cleared */ });\n    }, [onIssue, body, seekSearch, keyIsText, rowsPick, issueSought, revealRef]);\n    // A conflict's row as the sheet shows it, in the cards of the history's popover: its first text column's text —\n    // `Panel cutting` — where it holds one, else its key. A row the draft removed is off the rows shown, and is named\n    // all the same: by the row the session holds of what the record does, wherever the sheet has scrolled to. Read as\n    // the popover draws, so the history item is the same while the rows move.\n    const namingNow = useRef({ rows, columns, session });\n    namingNow.current = { rows, columns, session };\n    const rowWhere = useCallback((issue: EditIssue) => {\n        const { rows: shown, columns: drawn, session: held } = namingNow.current;\n        return rowNameOf(shown.find((r) => stringEqual(r.id, issue.entry)) ?? held.originals.get(issue.entry)?.wire, drawn) ?? issue.entry;\n    }, []);\n    // A conflict's value as its column writes it — a date in the column's format — where the field it is in is a\n    // column's own; else as the card reads it.\n    const conflictValue = useCallback((_issue: EditIssue, path: PatchPath, value: unknown, type: EastType | undefined) => {\n        let field: string | undefined;\n        for (const step of path) {\n            if (step.kind !== \"field\") continue;\n            if (field !== undefined) return undefined;\n            field = step.name;\n        }\n        const meta = field === undefined ? undefined : namingNow.current.columns.byKey.get(field);\n        const cell = meta === undefined ? undefined : cellOfValue(value, type);\n        return meta === undefined || cell === undefined ? undefined : cellText(cell, meta, words);\n    }, [words]);\n    // The issues' rows the narrowing may hide — those the body does not draw — asked of e3 as the Issues tab lists them,\n    // and what an issue's line says of one it hides, in the sheet's words for an issue (the hidden pick).\n    const drawnEntries = useMemo(() => {\n        const ids = new Set<string>();\n        for (const it of body) {\n            if (it.kind === \"group\") ids.add(it.row.id);\n            else if (it.kind === \"real\") ids.add(it.group?.row.id ?? it.row.id);\n        }\n        return ids;\n    }, [body]);\n    const askHidden = useCallback((issues: readonly EditIssue[]) => {\n        if (!lensWanted) return;\n        askHiding(issues.flatMap((issue) => (drawnEntries.has(issue.entry) ? [] : [{ pick: rowsPick, id: issue.entry }])), false);\n    }, [lensWanted, drawnEntries, rowsPick]);\n    const hiddenNote = useCallback((issue: EditIssue): string | undefined => {\n        if (!lensWanted || drawnEntries.has(issue.entry)) return undefined;\n        const state = rowsPick.rows.stateOf(issue.entry);\n        if (state === undefined || !state.hidden) return undefined;\n        return hiddenLine([{ pick: rowsPick, answer: state.answer }], words, { hiddenByFilters: words.m.inspectorIssueHidden, hiddenBy: words.m.inspectorIssueHiddenBy });\n    }, [lensWanted, drawnEntries, rowsPick, words]);\n    // The batch's issues, then a stored row's numbers outside their bounds, which hold no Save (#1585).\n    const issueList = useMemo((): readonly EditIssue[] => {\n        const ready = session.readiness;\n        return [...(ready.type === \"ready\" ? [] : ready.value), ...session.issues, ...storedBreaches];\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- draftVersion tracks changes within the stable transaction session.\n    }, [session, readiness, draftVersion, storedBreaches]);\n    // The footer's note of an issue gone to goes once the session no longer holds the issue: a conflict chosen, a\n    // check met, a refusal answered. The session is mutable: draftVersion moves with its conflicts.\n    const noted = ui.msg?.id === \"issue\" ? ui.msg.issue : undefined;\n    useEffect(() => {\n        if (noted === undefined || issueList.some((issue) => issueEqual(issue, noted))) return;\n        for (const entry of session.conflicts.values()) {\n            if (stringEqual(entry.id, noted.entry) && entry.points.some((point) => issueEqual(session.conflictIssue(entry.id, point), noted))) return;\n        }\n        dispatchStore({ t: \"patch\", patch: { msg: null } });\n    }, [noted, issueList, session, draftVersion, dispatchStore]);\n    // A conflict's choice is a step of the history too, taken in the conflicts popover and never through the history's\n    // runner: the footer's note of the last gesture goes with it, as it does with an Undo (F13 of the hand test) — a\n    // removal's `Apply writes it, Undo restores` is so no more once the other side is taken. The session is mutable:\n    // draftVersion moves with its conflicts.\n    const chosen = session.settled.length;\n    const chosenBefore = useRef(chosen);\n    useEffect(() => {\n        const more = chosen > chosenBefore.current;\n        chosenBefore.current = chosen;\n        if (more) dispatchStore({ t: \"patch\", patch: { msg: null } });\n    }, [chosen, dispatchStore]);\n    const kindOf = useCallback((issue: EditIssue): \"incomplete\" | \"invalid\" | \"warning\" => {\n        const ready = session.readiness;\n        // The very issue the readiness raised (identity, not equality): an Apply's look alike and are not its; nor are a\n        // stored row's numbers outside their bounds, which warn.\n        if (ready.type !== \"ready\" && ready.value.some((raised) => Object.is(raised, issue))) return kindOfIssue(issue, ready);\n        return storedBreaches.some((stored) => Object.is(stored, issue)) ? \"warning\" : \"invalid\";\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- draftVersion tracks changes within the stable transaction session.\n    }, [session, readiness, draftVersion, storedBreaches]);\n    // Where an issue's row stands among the rows drawn (#1534), as Go to issue finds it: a row or a band by its entry, a\n    // line by its place in its group — none where the body does not draw it.\n    const placeOfIssue = useCallback((issue: EditIssue): SheetInspectPlace | undefined => {\n        const line = getSomeorUndefined(issue.row);\n        const index = line === undefined\n            ? body.findIndex((item) => (item.kind === \"real\" || item.kind === \"group\") && stringEqual(item.row.id, issue.entry))\n            : body.findIndex((item) => item.kind === \"real\" && item.group !== undefined && stringEqual(item.group.row.id, issue.entry) && item.group.index === Number(line));\n        const r = index < 0 ? undefined : rowSpace.rowOf[index];\n        return r === undefined || r < 0 ? undefined : placeAt(r);\n    }, [body, rowSpace, placeAt]);\n    const inspect = useMemo((): SheetInspect => ({\n        selected, targetAt,\n        writable: canEdit && editingState.available,\n        can: {\n            insertRows: canEdit && canInsertRows && editingState.available,\n            insertGroups: canEdit && canInsertGroups && editingState.available,\n            removeRows: canEdit && capabilities.removeRows && editingState.available,\n            removeGroups: canEdit && capabilities.removeGroups && editingState.available,\n        },\n        counts: { rows: wholeCount, pending: session.pending, issues: issueList.length },\n        issues: issueList,\n        kindOf,\n        write: inspectWrite, editInSheet, remove: removeRows, duplicate, addLine, removeGroup, goToIssue, hiddenNote, askHidden, placeOf: placeOfIssue,\n        columnAt, cellAt: inspectCellAt, writableAt: inspectWritableAt, changesAt, unitAt, levelAt: inspectLevelAt, allowedAt, drawCell, drawAction,\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- draftVersion tracks the session's pending count.\n    }), [selected, targetAt, canEdit, editingState.available, canInsertRows, canInsertGroups, capabilities, wholeCount, session, issueList, kindOf, inspectWrite, editInSheet, removeRows, duplicate, addLine, removeGroup, goToIssue, hiddenNote, askHidden, placeOfIssue, columnAt, inspectCellAt, inspectWritableAt, changesAt, unitAt, inspectLevelAt, allowedAt, drawCell, drawAction, draftVersion]);\n    return { addRow, conflictValue, goToIssue, holdRow, inspect, removeRowsById, rowWhere, versionOf };\n}\n\n/** What {@link useSheetInspector} gives the parts after it. */\nexport type SheetInspector = ReturnType<typeof useSheetInspector>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Drag and drop: each drop planned from the rows as they stand and run as one transaction — a template inserted, a card's\n * cells set, a row, a line or a group moved — a library card's ⏎, and a phone's Library.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { StringType, equalFor, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Sheet } from \"@elaraai/e3-ui/internal\";\nimport { useDragTarget, type DragEventValue, type DragTargetConfig } from \"@elaraai/east-ui-components\";\nimport { NULL_CELL, TITLE_KEY, cellWritable } from \"./model.js\";\nimport type { EntryVersion, Origin, Placement } from \"./transactions.js\";\nimport { cardSource, dropCaption, dropName, dropRefusal, dropRowOf, locateDrop, payloadSource, planBelow, planDrop, readDropRow, type SheetDropContext, type SheetDropMark, type SheetDropPlan, type SheetDropRow, type SheetDropSource } from \"./drop.js\";\nimport { pageWindow } from \"./Pager.js\";\nimport type { DraftEdit } from \"./use-editing.js\";\nimport type { SheetLineValue } from \"./values.js\";\nimport type { SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetWrites } from \"./use-writes.js\";\nimport type { SheetCopilot } from \"./use-copilot.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport type { SheetGestures } from \"./use-gestures.js\";\nimport type { SheetRowParts } from \"./use-row-parts.js\";\nimport type { SheetInspector } from \"./use-inspector.js\";\nimport type { SheetPhoneLibrary } from \"./parts.js\";\nimport { mintLineKey } from \"./local-rows.js\";\n\nconst stringEqual = equalFor(StringType);\n\nconst cellEqual = equalFor(Sheet.Types.Cell);\n\n/**\n * Plans and runs the sheet's drops (see the module docs).\n *\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetWrites - The cell writes, the removal and the proposals' inserts\n * @param sheetCopilot - What asks the copilot to run\n * @param sheetEffects - The effect runner and what its effects reach\n * @param sheetGestures - The history's runner, the discard and the insertion\n * @param sheetRowParts - The rows' drop, seams, inserts and runs\n * @param sheetInspector - The inspector's reads and gestures, and a host's Add and Delete\n * @returns The library's ⏎ and the phone's Library\n */\nexport function useSheetDrops(sheetDecode: SheetDecode, sheetSession: SheetSession, sheetBody: SheetBody,\n    sheetMachine: SheetMachine, sheetWrites: SheetWrites, sheetCopilot: SheetCopilot, sheetEffects: SheetEffects,\n    sheetGestures: SheetGestures, sheetRowParts: SheetRowParts, sheetInspector: SheetInspector) {\n    const {\n        allColumns, canInsertGroups, canInsertRows, capabilities, copilotOn, group, keyed, loose, noun, pagerRef,\n        triggers, words,\n    } = sheetDecode;\n    const { canEdit, childField, dispatchStore, draftType, editingState, recordGesture, rows, ui } = sheetSession;\n    const { blankLineRowOf, body, idAt, rowAt, rowCount, rowOf, rowSpace } = sheetBody;\n    const { uiRef, viewportRef } = sheetMachine;\n    const { failed, gestureEvents, writeCells } = sheetWrites;\n    const { requestRun } = sheetCopilot;\n    const { cardRef } = sheetEffects;\n    const { anchorFor, insertWhenClosed, pendingInsertFocus } = sheetGestures;\n    const { dragActive, dropApi, dropHost, dropOn } = sheetRowParts;\n    const { versionOf } = sheetInspector;\n    // ── Drag and drop: the plans (#1187) ──────────────────────────────────\n    // Every drop is planned (`drop.ts`) from the rows as they stand — the\n    // veto, the ghost's caption, its name and the drop itself read the same\n    // plan — and runs as one transaction: a template's insertion, a card's\n    // cells, a move. A move is the entry's placement, or its groups' lines\n    // rewritten, the wire and the draft side by side.\n    const tailRow = useMemo(() => {\n        const r = rowSpace.bodyIndexOf.findIndex((bi) => { const it = body[bi]; return it !== undefined && it.kind === \"blank\" && it.group === undefined; });\n        return r < 0 ? undefined : r;\n    }, [rowSpace, body]);\n    const dropCtx = useMemo((): SheetDropContext => ({\n        rows, rowAt, rowOf, blankLineRowOf, tailRow, rowCount,\n        grouped: group !== undefined, loose, keyed,\n        writable: canEdit && editingState.available,\n        can: { insertRows: canInsertRows, insertGroups: canInsertGroups, moveRows: capabilities.moveRows.type, moveGroups: capabilities.moveGroups },\n        columnAt: (band, key) => (band ? group?.cells.get(key) : allColumns.byKey.get(key)),\n        // A card's cell on the row it lands on: its column writes, and no mark there locks it (#1560).\n        writableAt: (r, band, key) => {\n            const meta = band ? group?.cells.get(key) : allColumns.byKey.get(key);\n            const it = rowAt(r);\n            return meta !== undefined && cellWritable(meta, it !== undefined && (it.kind === \"real\" || it.kind === \"group\") ? it.row.cells : undefined);\n        },\n        anchorFor,\n    }), [rows, rowAt, rowOf, blankLineRowOf, tailRow, rowCount, group, loose, keyed, canEdit, editingState.available, canInsertRows, canInsertGroups, capabilities, allColumns, anchorFor]);\n    // A drop row's text, read once: the rows print their own, so the same few come back.\n    const dropRows = useRef(new Map<string, SheetDropRow | undefined>()).current;\n    const readRow = useCallback((text: string): SheetDropRow | undefined => {\n        if (!dropRows.has(text)) {\n            if (dropRows.size > 4096) dropRows.clear();\n            dropRows.set(text, readDropRow(text));\n        }\n        return dropRows.get(text);\n    }, [dropRows]);\n    /** A drop's plan, at a coordinate the rows made. */\n    const planAt = (source: SheetDropSource, at: { row: string; slot: string }): SheetDropPlan => {\n        const row = readRow(at.row);\n        return row === undefined ? { kind: \"refused\", why: { why: \"gone\" } } : planDrop(source, row, at.slot, dropCtx);\n    };\n    /** What a completed drag, or a candidate, carries, and where it lands — `undefined` for one the sheet did not make. */\n    const readEvent = (event: DragEventValue): { source: SheetDropSource; at: { row: string; slot: string } } | undefined => {\n        if (dropHost === undefined) return undefined;\n        if (event.type === \"add\") {\n            const source = cardSource(dropHost, event.value.from.library, event.value.from.key);\n            return source === undefined ? undefined : { source, at: event.value.into };\n        }\n        if (event.type === \"move\") {\n            const row = readRow(event.value.from.row);\n            return row === undefined ? undefined : { source: { kind: \"move\", row }, at: event.value.to };\n        }\n        return undefined;\n    };\n    // The row the seam line runs along, and its edge: written, never rendered, as a drag rests (the Plan's landing band's way).\n    const markedSeam = useRef<HTMLElement | null>(null);\n    const markSeam = (mark: SheetDropMark | undefined) => {\n        const el = mark === undefined ? null\n            : cardRef.current?.querySelector<HTMLElement>(`[data-row=\"${mark.r}\"]:not([data-slot=stickyBand]):not([data-slot=stickyLine])`) ?? null;\n        if (markedSeam.current !== null && markedSeam.current !== el) markedSeam.current.removeAttribute(\"data-drop-seam\");\n        markedSeam.current = el;\n        if (el !== null && mark !== undefined) el.setAttribute(\"data-drop-seam\", mark.edge);\n    };\n    // A drag over: no row keeps a mark.\n    useEffect(() => {\n        if (dragActive) return;\n        markedSeam.current?.removeAttribute(\"data-drop-seam\");\n        markedSeam.current = null;\n        for (const el of cardRef.current?.querySelectorAll(\"[data-drop-at]\") ?? []) el.removeAttribute(\"data-drop-at\");\n    }, [dragActive, cardRef]);\n    /** A group entry's version with its lines rewritten: the wire lines and the draft's children, side by side. */\n    const withLines = useCallback((version: EntryVersion, edit: (lines: SheetLineValue[], kids: unknown[]) => void): EntryVersion => {\n        const wire = version.wire;\n        if (wire === undefined || version.draft === undefined || childField === undefined) return version;\n        const looseDraft = draftType.type === \"Variant\";\n        const outer = (looseDraft ? (version.draft as ValueTypeOf<typeof draftType>).value : version.draft) as Record<string, unknown>;\n        const lines = [...wire.lines];\n        const kids = [...(outer[childField] as unknown[])];\n        edit(lines, kids);\n        const next = { ...outer, [childField]: kids };\n        return { ...version, wire: { ...wire, lines }, draft: looseDraft ? variant(\"group\", next) : next };\n    }, [childField, draftType]);\n    /** A gesture of draft edits alone — a move — recorded as one transaction. */\n    const recordEdits = useCallback((origin: Origin, edits: ReadonlyMap<string, DraftEdit>): boolean => {\n        try { return recordGesture([], undefined, origin, edits); }\n        catch (error) {\n            failed(error);\n            return false;\n        }\n    }, [recordGesture, failed]);\n    /**\n     * Runs a drop's plan as one transaction (SB39, SB40, SB44, SB61), the row\n     * it made, set or moved selected once the body holds it.\n     *\n     * @returns Whether it changed anything\n     */\n    const runDrop = useCallback((plan: SheetDropPlan): boolean => {\n        switch (plan.kind) {\n            case \"refused\":\n            case \"stay\":\n                return false;\n            case \"insert\":\n                return insertWhenClosed(plan.request, { seeds: plan.template.seeds, origin: \"drop\" });\n            case \"set\": {\n                const item = rowAt(plan.r);\n                if (item === undefined || (item.kind !== \"real\" && item.kind !== \"group\") || plan.card.sets.size === 0) return false;\n                gestureEvents.current = [];\n                let recorded = false;\n                try {\n                    writeCells([...plan.card.sets].map(([key, cell]) => ({ r: plan.r, c: -1, key, cell })), \"typed\");\n                    recorded = recordGesture(gestureEvents.current, undefined, \"drop\");\n                } catch (error) {\n                    failed(error);\n                } finally {\n                    gestureEvents.current = [];\n                }\n                if (!recorded) return false;\n                const keys = [...plan.card.sets.keys()];\n                // The copilot asks again for a row whose trigger column the card set, as typing in it does.\n                if (copilotOn && keys.some((key) => triggers.size === 0 || triggers.has(key))) {\n                    const id = idAt(plan.r);\n                    if (id !== undefined) requestRun(id, 0);\n                }\n                const lg = item.kind === \"real\" ? item.group : undefined;\n                pendingInsertFocus.current = { id: lg !== undefined ? lg.row.id : item.row.id, ...(lg !== undefined ? { child: lg.key } : {}), edit: false, key: keys[0] };\n                return true;\n            }\n            case \"moveEntry\": {\n                const placement: Placement = some(variant(\"ordered\", plan.to === \"end\" ? variant(\"end\", null) : variant(plan.to.side, plan.to.anchor)));\n                const recorded = recordEdits(\"move\", new Map([[plan.id, (version: EntryVersion): EntryVersion => ({ ...version, place: placement })]]));\n                if (recorded) pendingInsertFocus.current = { id: plan.id, edit: false };\n                return recorded;\n            }\n            case \"moveLine\": {\n                const { from, to } = plan;\n                const source = versionOf(from.group);\n                const at = source?.wire?.lines.findIndex((line) => line.key === from.key) ?? -1;\n                if (source === undefined || source.wire === undefined || at < 0) return false;\n                const edits = new Map<string, DraftEdit>();\n                let key = from.key;\n                if (to.group === from.group) {\n                    // Within its group: out of its slot, into the one it was dropped at.\n                    edits.set(from.group, (version) => withLines(version, (lines, kids) => {\n                        const i = lines.findIndex((line) => line.key === from.key);\n                        if (i < 0) return;\n                        const [line] = lines.splice(i, 1);\n                        const [kid] = kids.splice(i, 1);\n                        const slot = to.index > i ? to.index - 1 : to.index;\n                        lines.splice(slot, 0, line!);\n                        kids.splice(slot, 0, kid);\n                    }));\n                } else {\n                    // Into another group: out of its own, into the other under a key of the other's — its draft with it.\n                    const target = versionOf(to.group)?.wire;\n                    const outer = (draftType.type === \"Variant\" ? (source.draft as ValueTypeOf<typeof draftType> | undefined)?.value : source.draft) as Record<string, unknown> | undefined;\n                    const kid = childField === undefined ? undefined : (outer?.[childField] as unknown[] | undefined)?.[at];\n                    if (target === undefined || kid === undefined) return false;\n                    key = mintLineKey(target);\n                    const moved: SheetLineValue = { ...source.wire.lines[at]!, key };\n                    edits.set(from.group, (version) => withLines(version, (lines, kids) => {\n                        const i = lines.findIndex((line) => line.key === from.key);\n                        if (i < 0) return;\n                        lines.splice(i, 1);\n                        kids.splice(i, 1);\n                    }));\n                    edits.set(to.group, (version) => withLines(version, (lines, kids) => {\n                        lines.splice(Math.min(to.index, lines.length), 0, moved);\n                        kids.splice(Math.min(to.index, kids.length), 0, kid);\n                    }));\n                }\n                const recorded = recordEdits(\"move\", edits);\n                if (recorded) pendingInsertFocus.current = { id: to.group, child: key, edit: false };\n                return recorded;\n            }\n        }\n    }, [insertWhenClosed, rowAt, writeCells, recordGesture, failed, copilotOn, triggers, idAt, requestRun, recordEdits, versionOf, withLines, draftType, childField, gestureEvents, pendingInsertFocus]);\n    dropApi.current = dropHost === undefined ? undefined : {\n        canDrop: (event) => {\n            const read = readEvent(event);\n            return read !== undefined && planAt(read.source, read.at).kind !== \"refused\";\n        },\n        caption: (coord, payload) => {\n            const source = payloadSource(dropHost, payload);\n            return source === undefined ? undefined : dropCaption(planAt(source, coord), dropCtx, words, noun);\n        },\n        name: (coord, payload) => {\n            const source = payloadSource(dropHost, payload);\n            const row = readRow(coord.row);\n            if (source === undefined || row === undefined) return \"\";\n            return dropName(planAt(source, coord), locateDrop(row, dropCtx)?.r, dropCtx, words, noun);\n        },\n        hover: (el, coord, payload) => {\n            const source = payloadSource(dropHost, payload);\n            if (source === undefined) return;\n            const plan = planAt(source, coord);\n            el.setAttribute(\"data-drop-at\", plan.kind === \"set\" ? \"row\" : \"seam\");\n            markSeam(plan.kind === \"set\" || plan.kind === \"refused\" ? undefined : plan.mark);\n        },\n        drop: (event) => {\n            const read = readEvent(event);\n            return read !== undefined && runDrop(planAt(read.source, read.at));\n        },\n    };\n    // The surface the rows register on, taking the library's templates and every author's tab that drops.\n    const dropTarget = useMemo((): DragTargetConfig | null => (dropHost === undefined || !dropOn ? null : {\n        id: dropHost.surface,\n        sources: [...(dropHost.templates !== undefined ? [dropHost.templates.library] : []), ...dropHost.tabs.keys()],\n        kinds: { add: true, move: true },\n        onDrag: (event) => dropApi.current?.drop(event) ?? false,\n    }), [dropHost, dropOn, dropApi]);\n    useDragTarget(dropTarget);\n    // A library card's ⏎ (SB45): the drop below the ring's row — or, where it is refused, why, in the footer. Before the\n    // ring is placed there is no row to drop below (#1531).\n    const enterCard = (library: string, key: string) => {\n        if (dropHost === undefined) return;\n        const source = cardSource(dropHost, library, key);\n        const item = uiRef.current.ringless ? undefined : rowAt(uiRef.current.sel.r);\n        const row = item === undefined ? undefined : dropRowOf(item);\n        if (source === undefined || row === undefined) return;\n        const plan = planBelow(source, row, dropCtx);\n        if (plan.kind !== \"refused\") {\n            runDrop(plan);\n            return;\n        }\n        const word = dropRefusal(plan, dropCtx, words, noun);\n        if (word !== undefined) dispatchStore({ t: \"patch\", patch: { msg: { id: \"dropRefused\", word } } });\n    };\n    const enterRef = useRef(enterCard);\n    enterRef.current = enterCard;\n    const enter = useCallback((library: string, key: string) => enterRef.current(library, key), []);\n    // A phone's Library (SH11): a tap on an author's card is its drop on the row it lands on — a group's card on the ring's\n    // band, or the band of the line the ring is on; a tap on a template its ⏎. Before the ring is placed no card has a\n    // row to land on, and the view asks for one (#1531).\n    const cardRing = ui.ringless ? undefined : ui.sel.r;\n    const cardTargetR = (lands: \"row\" | \"group\"): number | undefined => {\n        if (cardRing === undefined) return undefined;\n        const item = rowAt(cardRing);\n        if (lands === \"row\") return item?.kind === \"real\" ? cardRing : undefined;\n        if (item?.kind === \"group\") return cardRing;\n        return item?.kind === \"real\" && item.group !== undefined ? rowOf(item.group.row.id) : undefined;\n    };\n    const phoneLibrary: SheetPhoneLibrary = {\n        targetOf: (library) => {\n            const tab = dropHost?.tabs.get(library);\n            const r = tab === undefined ? cardRing : cardTargetR(tab.lands);\n            const item = r === undefined ? undefined : rowAt(r);\n            if (item === undefined || (item.kind !== \"real\" && item.kind !== \"group\")) return undefined;\n            if (item.kind === \"group\") {\n                const title = item.row.cells.get(TITLE_KEY);\n                return title?.type === \"String\" && title.value !== \"\" ? `${item.row.id} · ${title.value}` : item.row.id;\n            }\n            const lg = item.group;\n            return words.m.inspectorWhat({ what: lg !== undefined ? \"line\" : \"row\", number: String(lg !== undefined ? lg.number : item.position + 1), title: lg?.row.id, noun: noun.singular });\n        },\n        holds: (library, key) => {\n            const tab = dropHost?.tabs.get(library);\n            const card = tab?.cards.get(key);\n            const r = tab === undefined ? undefined : cardTargetR(tab.lands);\n            const item = r === undefined ? undefined : rowAt(r);\n            if (card === undefined || card.sets.size === 0 || item === undefined || (item.kind !== \"real\" && item.kind !== \"group\")) return false;\n            for (const [k, cell] of card.sets) if (!cellEqual(item.row.cells.get(k) ?? NULL_CELL, cell)) return false;\n            return true;\n        },\n        tap: (library, key) => {\n            const tab = dropHost?.tabs.get(library);\n            if (dropHost === undefined || tab === undefined) { enterCard(library, key); return; }\n            const source = cardSource(dropHost, library, key);\n            const r = cardTargetR(tab.lands);\n            const item = r === undefined ? undefined : rowAt(r);\n            const row = item === undefined ? undefined : dropRowOf(item);\n            if (source === undefined || row === undefined) return;\n            const plan = planBelow(source, row, dropCtx);\n            if (plan.kind !== \"refused\") {\n                runDrop(plan);\n                return;\n            }\n            const word = dropRefusal(plan, dropCtx, words, noun);\n            if (word !== undefined) dispatchStore({ t: \"patch\", patch: { msg: { id: \"dropRefused\", word } } });\n        },\n        goToColumn: useCallback((key: string) => {\n            const { list, slot, inView } = pagerRef.current;\n            const frame = viewportRef.current?.frame;\n            const at = list.findIndex((col) => stringEqual(col.key, key));\n            if (frame === undefined || at < 0 || slot <= 0) return;\n            const first = Math.round(frame.scrollLeft / slot);\n            pageWindow(frame, slot, Math.max(0, list.length - inView), at < first ? at : at >= first + inView ? at - inView + 1 : first);\n        }, [pagerRef, viewportRef]),\n    };\n    return { enter, phoneLibrary };\n}\n\n/** What {@link useSheetDrops} gives the parts after it. */\nexport type SheetDrops = ReturnType<typeof useSheetDrops>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The two-line sticky header (B§11): the gutter's corner — a checkbox over\n * the rail (indeterminate while any row is picked), `#` over the numbers\n * and, on a grouped sheet, the fold-all over the actions column (a ghost\n * button like the rows' actions, drawn as the group chevron doubled —\n * Font Awesome's angles-right — and turning like it: right while every\n * group is folded, down otherwise) —\n * then one cell per column: the label line (mono 10/600/.16em uppercase)\n * over the grey `sub` line that tells the planner what the cell accepts.\n * To assistive tech it is the grid's first row, the gutter its first column\n * (#860); the fold-all is out of the tab order like every control in the\n * grid — ⇧Space on a band does what it does.\n */\n\nimport { memo } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faAnglesRight, faMinus } from \"@fortawesome/free-solid-svg-icons\";\nimport { countNoun, type SheetColumnMeta } from \"./model.js\";\nimport type { SheetNounValue } from \"./values.js\";\nimport { useSheetWords } from \"./words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\nexport interface SheetHeaderProps {\n    styles: Styles;\n    columns: readonly SheetColumnMeta[];\n    /** The CSS grid template — the gutter track then one per column. */\n    gridTemplate: string;\n    /** Whether any row is picked — the corner checkbox goes indeterminate. */\n    picked?: boolean | undefined;\n    /** The fold-all, on a grouped sheet only: whether every group is folded (the action is then to open them), how many, the host's noun, and the gesture. */\n    foldAll?: { folded: boolean; count: number; noun: SheetNounValue; onFoldAll: (folded: boolean) => void } | undefined;\n    /** On a phone's frame, the column of the selected cell: its head is tinted (`Mobile Sheet Spec.md` SH3). */\n    selected?: number | undefined;\n    /** On a phone's frame, the row numbers show as the Row column (SH2), its head named so. */\n    rowNumbers?: boolean | undefined;\n}\n\n/** The fold-all's mark: Font Awesome's angles-right — the groups' chevron doubled — in the recipe's 10 px box (#1263); the button turns it down while any group is open. */\nfunction DoubleChevron() {\n    return <FontAwesomeIcon icon={faAnglesRight} aria-hidden />;\n}\n\n/** Renders the header row. */\nexport const SheetHeader = memo(function SheetHeader({ styles, columns, gridTemplate, picked, foldAll, selected, rowNumbers }: SheetHeaderProps) {\n    // The fold-all's words, its count in the app's locale (#850, #861).\n    const words = useSheetWords();\n    const { m } = words;\n    const groups = foldAll !== undefined ? countNoun(foldAll.count, foldAll.noun, words) : \"\";\n    return (\n        <Box css={styles.header} style={{ gridTemplateColumns: gridTemplate }} data-slot=\"header\" role=\"row\" aria-rowindex={1}>\n            <Box css={styles.headerGutter} data-slot=\"headerGutter\" role=\"columnheader\" aria-colindex={1}>\n                <Box css={styles.rail} data-slot=\"rail\">\n                    <Box as=\"span\" css={styles.checkbox} data-slot=\"checkbox\" data-mixed={picked ? \"\" : undefined} aria-hidden=\"true\">\n                        {picked && <FontAwesomeIcon icon={faMinus} />}\n                    </Box>\n                </Box>\n                <Box as=\"span\" css={styles.headerNumber} data-slot=\"headerNumber\">{rowNumbers === true ? m.pagerRow() : m.headerNumber()}</Box>\n                <Box css={styles.gutterAction} data-slot=\"foldAllSlot\">\n                    {foldAll !== undefined && foldAll.count > 0 && (\n                        <chakra.button\n                            type=\"button\" css={styles.gutterButton} data-slot=\"foldAll\" data-kind=\"fold\" data-folded={foldAll.folded ? \"\" : undefined} tabIndex={-1}\n                            aria-expanded={!foldAll.folded}\n                            aria-label={m.foldAll({ folded: foldAll.folded, groups })}\n                            title={m.foldAllTitle({ folded: foldAll.folded, groups, noun: foldAll.noun.singular })}\n                            onMouseDown={(event) => { event.preventDefault(); event.stopPropagation(); }}\n                            onClick={(event) => { event.stopPropagation(); foldAll.onFoldAll(!foldAll.folded); }}>\n                            <DoubleChevron />\n                        </chakra.button>\n                    )}\n                </Box>\n            </Box>\n            {columns.map((col, i) => (\n                <Box key={col.key} css={styles.headerCell} data-slot=\"headerCell\" data-key={col.key} data-kind={col.kind} data-col-selected={selected === i ? \"\" : undefined} role=\"columnheader\" aria-colindex={i + 2} title={col.sub}>\n                    <Box as=\"span\" css={styles.headerLabel}>{col.header}</Box>\n                    {col.sub !== undefined && <Box as=\"span\" css={styles.headerSub}>{col.sub}</Box>}\n                </Box>\n            ))}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The toolbar's items (§7): the view tabs at left, then the lens's\n * `n matches` line, and hugging the row's right edge the key search over a\n * paged source's `seek`, the rail — one over the sheet's `Slice.bindRecords`,\n * each source's fields in source order, the presets, and one summary counting\n * each source (#1345) — the paged scope badge *loaded rows only* while nothing\n * narrows the rows, and the history controls. The count line is the lens's\n * (#1349): it shows while the `rows` source's narrowing narrows the rows.\n *\n * ONE row, always — nothing wraps and nothing scrolls. They are the frame's\n * toolbar's items, the shared toolbar (#952), folded on one ladder, in this\n * order:\n *   1. the rail gives way first — its fields fold into summary chips, then\n *      into one chip, then into its icon (every one of them opens the slice\n *      editor popover);\n *   2. the tabs fold into their `+n` menu, one tab at a time, the active tab\n *      always kept;\n *   3. the count line goes;\n *   4. the tab strip drops the `+ TAB` label and the whole-sheet count;\n *   5. the tab names cap at 72px;\n *   6. the strip closes up, its counts with it;\n *   7. the key search's box folds to its icon, which opens the box in a\n *      popover (#1221) — the shared item the Plan's toolbar takes too;\n *   8. the strip folds into one chip, the open view's tab, whose menu holds\n *      every view, `+ TAB` and the open view's close (#1221) — so a phone's\n *      row holds the views a planner has saved;\n *   9. where the sheet has a key search, the chip folds into the key search's\n *      popover, one move (#1345): its views, `+ TAB` and the open view's\n *      close over the search box, as the Flowchart's orientation sits over\n *      find state's — so a phone's row keeps the rail and Save beside it;\n * and the history item folds last, to its buttons.\n * Each is a form of an item, measured and chosen before paint: the toolbar's\n * configuration is a function of its width, whatever width it came from.\n *\n * The items are a part of their own (SB4): `useSheetToolbarItemsFor` builds\n * them, and the Sheet's frame places them in its one toolbar (#1216). A host\n * that lays out a row of its own takes them as parts (`useSheetToolbarPartsFor`,\n * #1533): the Record's row is its title, the rail, its status line, Add and\n * Delete, and the history — no view tabs, count line, key search or badge.\n *\n * In a phone's frame (`Mobile Builder Frame Spec.md` FR2) the row is the\n * views, every tab inline and scrolling sideways, then the rail's summary as\n * the count line, the Filters button and Search Records — each item's phone\n * form; the history and the eye are the toolbar's second row.\n */\n\nimport { type ReactNode } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSlicesChromeType } from \"@elaraai/east-ui/internal\";\nimport { HOST_RANK, useRecordSlicesToolbarItems } from \"@elaraai/east-ui-components/internal\";\nimport { type ToolbarItem, useKeySearchToolbarItem } from \"@elaraai/east-ui-components\";\nimport type { SheetTabsFold } from \"./Tabs.js\";\nimport type { SheetSearch } from \"./use-seek.js\";\nimport { useSheetWords } from \"./words.js\";\n\ntype Styles = Record<string, Record<string, unknown>>;\n\n/** The sheet's own fold ranks, after every step of the slice rail's (#952) —\n *  the order in the module doc. */\nconst SHEET_RANK = {\n    tabFold: HOST_RANK,\n    count: HOST_RANK + 1,\n    stripCompact: HOST_RANK + 2,\n    stripCapped: HOST_RANK + 3,\n    close: HOST_RANK + 4,\n    seek: HOST_RANK + 5,\n    tabsMenu: HOST_RANK + 6,\n    searchViews: HOST_RANK + 7,\n} as const;\n\n/** The bundle the views' chip and the key search fold into one popover by (#1345). */\nconst SEARCH_VIEWS = \"sheet.searchViews\";\n\n/** The view tabs, as the toolbar folds them. */\nexport interface SheetToolbarTabs {\n    /** The strip in a fold. */\n    render: (fold: SheetTabsFold) => ReactNode;\n    /** How many tabs can fold into `+n` — every view but the active one. */\n    maxFold: number;\n    /** Changes when what the strip shows does (a view added, renamed or\n     *  closed, a count moving, another tab active): its widths are measured again. */\n    version: string;\n    /** A tab is being renamed: the strip keeps its form. */\n    held: boolean;\n}\n\nexport interface SheetToolbarProps {\n    styles: Styles;\n    /** The rail (#1345): one over the sheet's `Slice.bindRecords`, its affordances and its persistence; `undefined` with no slice. */\n    chrome?: ValueTypeOf<RecordSlicesChromeType> | undefined;\n    /** What each source is counted in on the rail's summary, by its name — `rows`, `orders`, `templates`. */\n    nouns?: Readonly<Record<string, string>> | undefined;\n    /** The lens count line — `3 matches`; empty without a narrowing. */\n    count: string;\n    /** The paged scope badge: the rows still to load, and nothing narrowing them. */\n    partial: boolean;\n    /** The view tabs — while the slice narrows the rows. */\n    tabs?: SheetToolbarTabs | undefined;\n    /** Key search over the paged source's `seek`. */\n    search?: SheetSearch | undefined;\n    /** The editing session's history item (#988) — undo · redo · discard · apply at the row's end, right of the rail. */\n    history?: ToolbarItem | undefined;\n    /** The Elara eye (#1409): the app's optimiser's item, immediately before the history item; `undefined` with no optimiser. */\n    optimise?: ToolbarItem | undefined;\n    /** Whether a run of the optimiser has just landed (#1409): the count line flashes once with its cascade. */\n    flash?: boolean | undefined;\n}\n\n/** The toolbar's items as parts (#1533), each with its forms and its fold ranks: `undefined` for one the sheet has no use for. */\nexport interface SheetToolbarParts {\n    /** The view tabs, while the slice narrows the rows. */\n    tabs: ToolbarItem | undefined;\n    /** The lens's count line, while a narrowing narrows the rows. */\n    count: ToolbarItem | undefined;\n    /** The key search over a seekable source. */\n    seek: ToolbarItem | undefined;\n    /** The rail over the sheet's slice: its fields, its presets and its summary, in the rail's order. */\n    rail: readonly ToolbarItem[];\n    /** The paged scope badge, while rows are still to load and nothing narrows them. */\n    badge: ToolbarItem | undefined;\n    /** The Elara eye, immediately before the history item. */\n    optimise: ToolbarItem | undefined;\n    /** The editing session's history item, at the row's end. */\n    history: ToolbarItem | undefined;\n}\n\n/**\n * Builds the toolbar's items as parts (#1533): what a host that lays out a\n * row of its own takes some of.\n *\n * @param props - What the items show and drive.\n * @returns The parts\n */\nexport function useSheetToolbarPartsFor({ styles, chrome, nouns, count, partial, tabs, search, history, optimise, flash }: SheetToolbarProps): SheetToolbarParts {\n    // The toolbar's own words (#861).\n    const { m } = useSheetWords();\n\n    // The key search over a seekable source: its box, or its icon on a row short of room — and, where the sheet\n    // has views, last its popover holding them over its box, the views' chip gone in the same move (#1345).\n    const combine = tabs !== undefined && search !== undefined;\n    const keySearch = useKeySearchToolbarItem(search, {\n        side: \"end\", rank: SHEET_RANK.seek, label: m.keySearch(),\n        compact: combine ? { label: m.keySearchViews(), controls: (close) => tabs.render({ folded: tabs.maxFold, strip: \"search\", onDone: close }) } : undefined,\n    });\n    const seek: ToolbarItem | undefined = keySearch !== undefined && combine\n        ? { ...keySearch, rank: [SHEET_RANK.seek, SHEET_RANK.searchViews], bundle: [undefined, SEARCH_VIEWS] }\n        : keySearch;\n\n    // The rail: one over every source of the sheet's slice, each counted in its own noun (#1345).\n    const rail = useRecordSlicesToolbarItems(chrome?.slice, {\n        ...(nouns === undefined ? {} : { nouns }),\n        ...(chrome === undefined ? {} : { affordances: chrome.affordances.map((a) => a.type) }),\n        ...(chrome?.persist.type === \"some\" ? { persist: chrome.persist.value.type } : {}),\n    });\n\n    // The tabs: one tab at a time into `+n`, then the strip's own closing up,\n    // then the strip as one chip (#1221) — and, with a key search, last into\n    // the search's popover, the chip gone in the move that folds it there (#1345).\n    const tabsItem: ToolbarItem | undefined = tabs === undefined ? undefined : {\n        key: \"tabs\",\n        forms: [\n            ...Array.from({ length: tabs.maxFold + 1 }, (_f, folded) => tabs.render({ folded })),\n            tabs.render({ folded: tabs.maxFold, strip: \"compact\" }),\n            tabs.render({ folded: tabs.maxFold, strip: \"capped\" }),\n            tabs.render({ folded: tabs.maxFold, strip: \"closed\" }),\n            tabs.render({ folded: tabs.maxFold, strip: \"menu\" }),\n            ...(combine ? [null] : []),\n        ],\n        rank: [\n            ...Array.from({ length: tabs.maxFold }, () => SHEET_RANK.tabFold),\n            SHEET_RANK.stripCompact, SHEET_RANK.stripCapped, SHEET_RANK.close, SHEET_RANK.tabsMenu,\n            ...(combine ? [SHEET_RANK.searchViews] : []),\n        ],\n        bundle: combine ? [...Array.from({ length: tabs.maxFold + 4 }, () => undefined), SEARCH_VIEWS] : undefined,\n        version: tabs.version,\n        held: tabs.held,\n        // A phone's (FR2): every tab inline, scrolling sideways in the row's slack.\n        phone: { form: tabs.render({ folded: 0, strip: \"phone\" }), grow: true },\n    };\n\n    return {\n        tabs: tabsItem,\n        count: count === \"\" ? undefined : {\n            key: \"count\",\n            forms: [<Box as=\"span\" css={styles.toolbarCount} data-slot=\"toolbarCount\" data-opn={flash === true ? \"\" : undefined}>{count}</Box>, null],\n            rank: SHEET_RANK.count,\n            // A phone's row has one count line, the rail's summary (`2 of 7 lines`): the lens's gives way to it.\n            phone: { form: null },\n        },\n        seek,\n        rail,\n        badge: partial ? { key: \"badge\", side: \"end\", forms: [<Box as=\"span\" css={styles.toolbarBadge} data-slot=\"toolbarBadge\">{m.scopeBadge()}</Box>] } : undefined,\n        optimise,\n        history,\n    };\n}\n\n/**\n * The Sheet's row of its toolbar's parts, in order: the view tabs, the count\n * line, the key search, the rail, the badge, the eye and the history.\n *\n * @param parts - The parts\n * @returns The items, an `undefined` entry for each the sheet has no use for\n */\nexport function sheetToolbarRow(parts: SheetToolbarParts): ReadonlyArray<ToolbarItem | false | undefined> {\n    return [parts.tabs, parts.count, parts.seek, ...parts.rail, parts.badge, parts.optimise, parts.history];\n}\n\n/**\n * Builds the toolbar's items in the row's order, each with its forms and its\n * fold ranks: what the Sheet's frame places in its toolbar (SB4).\n *\n * @param props - What the items show and drive.\n * @returns The items, a falsy entry for each the sheet has no use for.\n */\nexport function useSheetToolbarItemsFor(props: SheetToolbarProps): ReadonlyArray<ToolbarItem | false | undefined> {\n    return sheetToolbarRow(useSheetToolbarPartsFor(props));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The parts as the frame places them (SB4): the optimiser's parts, the toolbar's items, what a host's chrome counts, the\n * root's facts, the footer and the history; and the grid — the header with its sticky copies, the rows, a host's empty\n * state, the strip or a phone's bottom container, and the action overlay — or, where the source failed before any row\n * landed, why.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, type CSSProperties } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { optimiseMessages, historyToolbarItem } from \"@elaraai/east-ui-components\";\nimport { VirtualRows } from \"@elaraai/east-ui-components/internal\";\nimport { BOTTOM_PAD_PX } from \"./model.js\";\nimport { clearNarrowing, clearSearch, narrowingEqual, narrowingQuery, writeNarrowing } from \"./view-state.js\";\nimport { useOptimiseParts } from \"../shared/func/optimise-parts.js\";\nimport { landSheetOptimise, sheetOptimisePeriod, sheetOptimiseRequest, type SheetOptimiseRequest } from \"./optimise.js\";\nimport { noticeText } from \"./words.js\";\nimport { SheetInsertLayer, SheetInsertStrip } from \"./Insertion.js\";\nimport { SheetHeader } from \"./Header.js\";\nimport { SheetRow, SheetGroupRow, SheetRetry } from \"./Rows.js\";\nimport { SheetPager, useWindowFirst } from \"./Pager.js\";\nimport { SheetStrip } from \"./Strip.js\";\nimport { layerCounts } from \"./local-rows.js\";\nimport type { SheetFooterProps } from \"./Footer.js\";\nimport { sheetToolbarRow, useSheetToolbarPartsFor } from \"./Toolbar.js\";\nimport type { SheetRootValue } from \"./values.js\";\nimport { PHONE_PIN_PX, type SheetDecode } from \"./use-decode.js\";\nimport type { SheetSession } from \"./use-session.js\";\nimport type { SheetBody } from \"./use-body.js\";\nimport type { SheetMachine } from \"./use-machine.js\";\nimport type { SheetEffects } from \"./use-effects.js\";\nimport type { SheetGestures } from \"./use-gestures.js\";\nimport type { SheetInput } from \"./use-input.js\";\nimport type { SheetOpenEditor } from \"./use-open-editor.js\";\nimport type { SheetReading } from \"./use-reading.js\";\nimport type { SheetJumps } from \"./use-jumps.js\";\nimport type { SheetViewTabs } from \"./use-view-tabs.js\";\nimport type { SheetRing } from \"./use-ring.js\";\nimport type { SheetScroll } from \"./use-scroll.js\";\nimport type { SheetRowParts } from \"./use-row-parts.js\";\nimport type { SheetActions } from \"./use-actions.js\";\nimport type { SheetRows } from \"./use-rows.js\";\nimport type { SheetInspector } from \"./use-inspector.js\";\nimport type { SheetDrops } from \"./use-drops.js\";\nimport type { SheetEntries, SheetHistory, SheetOptimiseParts, SheetParts, SheetRootFacts } from \"./parts.js\";\nimport { dropText } from \"./items.js\";\n\n/** The rows' scroll element: sideways as wide as the columns; on a phone, snapping to a column — past a pinned one (SH1.3). */\nconst WIDE_ROOT_CSS = { overflowX: \"auto\" } as const;\n\nconst PHONE_ROOT_CSS = { overflowX: \"auto\", scrollSnapType: \"x mandatory\", scrollbarWidth: \"none\" } as const;\n\nconst PHONE_PINNED_ROOT_CSS = { ...PHONE_ROOT_CSS, scrollPaddingLeft: `${PHONE_PIN_PX}px` } as const;\n\n/**\n * Puts the sheet's shared state together as the parts the frame places (see the module docs).\n *\n * @param value - The Sheet root value\n * @param sheetDecode - The decoded columns, layout, callbacks, narrowing and row source\n * @param sheetSession - The store, the lens, the paging, the session and the rows\n * @param sheetBody - The body, the row space and the cells at each place\n * @param sheetMachine - The machine's context and dispatch\n * @param sheetEffects - The effect runner and what its effects reach\n * @param sheetGestures - The history's runner, the discard and the insertion\n * @param sheetInput - The cells' and the grid's handlers\n * @param sheetOpenEditor - The styles and the open editor\n * @param sheetReading - The loading line and the frame's loading facts\n * @param sheetJumps - The key search, the scroll's anchor and the issue gone to\n * @param sheetViewTabs - The view tabs, the summary and the folds\n * @param sheetRing - The strip, the active cell and the hint\n * @param sheetScroll - The scroll's report, the sticky rows, the sizes and the motion\n * @param sheetRowParts - The rows' drop, seams, inserts and runs\n * @param sheetActions - The action host, its overlay and the phone's bottom container\n * @param sheetRows - The row renderer\n * @param sheetInspector - The inspector's reads and gestures, and a host's Add and Delete\n * @param sheetDrops - The library's ⏎ and the phone's Library\n * @returns The parts\n */\nexport function useSheetAssembled(value: SheetRootValue, sheetDecode: SheetDecode, sheetSession: SheetSession,\n    sheetBody: SheetBody, sheetMachine: SheetMachine, sheetEffects: SheetEffects, sheetGestures: SheetGestures,\n    sheetInput: SheetInput, sheetOpenEditor: SheetOpenEditor, sheetReading: SheetReading, sheetJumps: SheetJumps,\n    sheetViewTabs: SheetViewTabs, sheetRing: SheetRing, sheetScroll: SheetScroll, sheetRowParts: SheetRowParts,\n    sheetActions: SheetActions, sheetRows: SheetRows, sheetInspector: SheetInspector,\n    sheetDrops: SheetDrops): SheetParts {\n    const {\n        bandPx, canInsertGroups, canInsertRows, chrome, columns, copilotOn, decodedRows, driverColumn, folded, gridId,\n        gridTemplate, group, gutterPx, hostGrid, hostLayout, keyed, lensWanted, loose, minWidth, narrowing, noun,\n        numberPx, pagedColumns, pagedSource, pagerColumns, phoneColumns, phoneFrame, pinPx, pinned, readOnly, registers,\n        rowNumbers, rowPx, rowsPart, setRowNumbers, setViewport, slotPx, viewPx, viewport, words,\n    } = sheetDecode;\n    const {\n        canEdit, changesOf, draftOf, draftType, draftVersion, editingState, exhausted, gestureCount, keyHeld, landRef,\n        landing, landingRoot, landingStyles, layer, lens, lensDrawn, locked, optimiseTypes, optimised, paging, rows,\n        rowsQuery, run, session, setOptimised, sourceRows, standingIn, total, totalRevision, ui,\n    } = sheetSession;\n    const { body, colCount, lensLayout, linkCellCtx, memberships, rowAt, rowSpace } = sheetBody;\n    const { emptyNarrowing } = sheetMachine;\n    const { cardRef, scrollTarget, toolbarRef } = sheetEffects;\n    const { actedRef, anchorFor, onHistoryAction, onInsert, onRowDiscard } = sheetGestures;\n    const {\n        actionApi, onCellDouble, onCellDown, onCellEnter, onCopy, onFillRow, onGridLeave, onKeyDown, onPaste, onRowPick,\n        onTake,\n    } = sheetInput;\n    const { edit, onStripAction, styles } = sheetOpenEditor;\n    const { busy, cold, line, loadingFacts, sourceFailure } = sheetReading;\n    const { onAnchorChange, pickSearch, restoreAnchor } = sheetJumps;\n    const { count, foldAll, lensMatches, onFold, onSubRows, summary, tabs, wholeCount } = sheetViewTabs;\n    const {\n        activeCell, ariaRowCount, hint, previewed, ringCol, ringItem, strip, suggested, unreadRuns, wr,\n    } = sheetRing;\n    const {\n        anchorable, headerRef, itemKey, moving, reportRange, revealLine, setNumberProbe, sizeOf, stickyAt, stickyLineAt,\n        stickyLineRef, widest,\n    } = sheetScroll;\n    const {\n        bandMixed, dropOn, foldedInserts, insertActions, insertLayerRef, onSeamLeave, railNouns, rowDrop, rowsNoun,\n        seam, seamsOn,\n    } = sheetRowParts;\n    const { actionBar, actionOverlayNode, cellEditor } = sheetActions;\n    const { renderRow } = sheetRows;\n    const { addRow, conflictValue, goToIssue, holdRow, inspect, removeRowsById, rowWhere, versionOf } = sheetInspector;\n    const { enter, phoneLibrary } = sheetDrops;\n    // ── The app's optimiser's parts (#1409, #1418) ─────────────────────────\n    // The eye before the history item, the banner, the footer line and the legend, over the run (`use-session.ts`); the request\n    // is the tab's rows as the session holds them, and the result lands as one step once the rows have moved.\n    const period = sheetOptimisePeriod(wholeCount, group !== undefined ? noun : undefined, rowsNoun, words);\n    const optimiseKeyType = optimiseTypes.keyType;\n    // The eye is listed only where the rows can be optimised (ruled 25 Oct 2026): never read only; while a narrowing's\n    // rows are read it waits, disabled, in its place.\n    const optimiseParts = useOptimiseParts<SheetOptimiseRequest>({\n        run, landing, period, readOnly, busy: !editingState.available,\n        request: (n) => sheetOptimiseRequest(rows, versionOf, draftType, optimiseKeyType, n), landKey: rows,\n    });\n    actedRef.current = optimiseParts.acted;\n    const originalVersion = editingState.original;\n    const recordVersions = editingState.recordVersions;\n    const landAfter = optimiseParts.landAfter;\n    landRef.current = (result, request, n) => {\n        const runText = words.number(n);\n        const landed = landSheetOptimise({\n            editing: value.editing, types: optimiseTypes, draftType, keyed, request, result, label: optimiseMessages.step({ run: runText }), runText,\n            versionOf: (id) => versionOf(id) ?? originalVersion(id), record: recordVersions, before: optimised,\n        });\n        if (landed === undefined) return undefined;\n        // A run that changed nothing leaves what earlier runs left (R10).\n        if (landed.optimised !== undefined) { setOptimised(landed.optimised); landAfter(n); }\n        return landed.counts;\n    };\n    // What a run left on the rows goes with the drafts (R17): once nothing is pending — Save, Discard — nothing is\n    // marked. An Undo leaves nothing pending too, but its Redo brings the run's step back (R9): what the run left is\n    // kept while that step is the next to redo.\n    const sessionPending = session.pending;\n    // `draftVersion` tracks the session's pending count and its redo stack, which the session object itself does not move with.\n    useEffect(() => {\n        if (sessionPending === 0 && session.nextRedo?.origin !== \"optimise\") setOptimised(undefined);\n    }, [sessionPending, draftVersion, session, setOptimised]);\n    const flash = optimised !== undefined && landing.lit;\n\n    // ── The parts' facts: the toolbar's items (§7), the root, the footer ──\n    const toolbarParts = useSheetToolbarPartsFor({\n        styles,\n        chrome,\n        nouns: railNouns,\n        count,\n        // Loaded rows only, while nothing narrows them: a `rows` source pages the record's own narrowing.\n        partial: pagedSource !== undefined && !exhausted && rowsPart === undefined,\n        tabs,\n        search: pickSearch,\n        // The session's error is the frame's banner (#1184), never a line under the item. Its issues button goes to the\n        // first issue as the Issues tab's lines do: sought where its row is not drawn, its filters cleared where they hide it.\n        history: !readOnly ? historyToolbarItem({ session, words, editing: ui.edit !== null, onAction: onHistoryAction, onIssue: goToIssue, where: rowWhere, conflictValue, showError: false, locked }) : undefined,\n        optimise: optimiseParts.toolbarItem,\n        flash,\n    });\n    const toolbar = { items: sheetToolbarRow(toolbarParts), parts: toolbarParts, ref: toolbarRef };\n    // What a host's own chrome counts and changes (#1533). The record's rows and the narrowing's, the drafts applied:\n    // each new row one more of both — under the lens a planner's row stands among the narrowing's until the record says\n    // otherwise — and each row a draft removes one fewer; a Save's, only while the count was read before it (#1536).\n    // The narrowing's count is the lens's placement, read with the record's count; else its layout's, read with the rows\n    // it draws — which a Save's rows are drawn over only while they were read before it.\n    const savedFrom = editingState.savedFrom;\n    const ofRecord = layerCounts(layer, savedFrom, totalRevision);\n    const recordTotal = decodedRows !== undefined ? rows.length : total === undefined ? undefined : total + ofRecord.added - ofRecord.removed;\n    const narrowedCount = !lensDrawn ? undefined : lensMatches ?? lensLayout?.hits;\n    const ofNarrowing = narrowedCount === undefined ? undefined : layerCounts(layer, savedFrom, lensMatches !== undefined ? lens.revision : undefined, sourceRows);\n    const entries: SheetEntries = {\n        rows,\n        changes: changesOf,\n        whole: decodedRows !== undefined || (!unreadRuns && (lensDrawn ? lensLayout !== undefined : paging.exhausted)),\n        count: { shown: !lensDrawn ? recordTotal : narrowedCount === undefined || ofNarrowing === undefined ? undefined : narrowedCount + ofNarrowing.added - ofNarrowing.removed, total: recordTotal },\n        narrowing: rowsQuery,\n        notice: ui.msg,\n        gestures: gestureCount.current,\n        add: addRow,\n        remove: removeRowsById,\n        hold: holdRow,\n    };\n    const root: SheetRootFacts = {\n        partial: pagedSource !== undefined && !exhausted,\n        copilot: copilotOn,\n        lens: lensWanted,\n        view: ui.tabs.active ?? undefined,\n        moving,\n    };\n    // Ask again: the lens's reads while it narrows the rows, else the pages' (#853, #1349).\n    const lensRetry = lens.retry;\n    const pagesRetry = paging.retry;\n    const retrySource = useCallback(() => { if (lensWanted) lensRetry(); else pagesRetry(); }, [lensWanted, lensRetry, pagesRetry]);\n    const footer: SheetFooterProps = {\n        styles, items: value.footer, summary, hint, message: ui.msg === null ? \"\" : noticeText(ui.msg, words), loading: line, noun: rowsNoun, onRetry: retrySource,\n        optimise: { line: optimiseParts.line, legend: optimiseParts.legend },\n    };\n    const history: SheetHistory = { session, onAction: onHistoryAction };\n    const optimise: SheetOptimiseParts = { banner: optimiseParts.banner, landing: { ref: landingRoot, attributes: landing.attributes, css: landingStyles.main } };\n    // Where a phone's window rests, read as the pager reads it, for a host's header (#1536): a group's label is cut to\n    // its columns in view, so it holds clear of the pinned column as the window pages.\n    const hostPhone = hostGrid !== undefined && phoneFrame;\n    const [windowFirst] = useWindowFirst(hostPhone ? viewport?.frame ?? null : null, slotPx, Math.max(0, pagerColumns.length - phoneColumns));\n\n    if (sourceFailure !== undefined) {\n        const failure = (\n            <Box css={styles.diagnostic} data-sheet-error role=\"alert\">\n                {words.m.noSource({ reason: sourceFailure })}\n                <SheetRetry styles={styles} onRetry={retrySource} />\n            </Box>\n        );\n        return { styles, root, toolbar, grid: null, footer, loading: loadingFacts, history, failure, inspect, enter, optimise, phoneLibrary, entries };\n    }\n\n    const stickyItem = stickyAt !== undefined ? body[stickyAt] : undefined;\n    // The open line whose sub rows scroll under the band.\n    const stuck = stickyLineAt !== undefined ? body[stickyLineAt] : undefined;\n    const stuckLine = stickyLineAt !== undefined && stuck !== undefined && stuck.kind === \"real\" && stuck.group !== undefined\n        ? { at: stickyLineAt, r: rowSpace.rowOf[stickyLineAt] ?? -1, row: stuck.row, lg: stuck.group, hit: stuck.hit, dropRow: dropText(stuck) }\n        : undefined;\n    const HostHeader = hostGrid?.Header;\n    const header = (\n        <Box ref={headerRef} position=\"relative\">\n            {HostHeader !== undefined\n                // A host's header (#1531): its column cells are `headerCell`s, as the Sheet's, which a key's reveal reads.\n                ? <HostHeader columns={columns.list} gridTemplate={gridTemplate} layout={hostLayout} rowPx={rowPx} rowIds={rows.map((row) => row.id)} whole={entries.whole}\n                    columnWindow={hostPhone && slotPx > 0 ? { first: windowFirst, inView: phoneColumns, slotPx } : undefined} />\n                : <SheetHeader styles={styles} columns={columns.list} gridTemplate={gridTemplate} picked={wr !== null} foldAll={foldAll} rowNumbers={rowNumbers}\n                    selected={phoneFrame && ui.selEnd === null && (ringItem?.kind === \"real\" || ringItem?.kind === \"group\") ? ringCol : undefined} />}\n            {stickyItem !== undefined && stickyItem.kind === \"group\" && group !== undefined && stickyAt !== undefined && (\n                // The band of the group whose lines scroll under the header (G1) — laid over the rows, so the list never moves.\n                // A copy: the band itself is the grid's row (#860).\n                <Box position=\"absolute\" top=\"100%\" left=\"0\" right=\"0\" aria-hidden=\"true\">\n                    <SheetGroupRow\n                        styles={styles}\n                        columns={columns}\n                        registers={registers}\n                        gridTemplate={gridTemplate}\n                        bandPx={bandPx}\n                        r={rowSpace.rowOf[stickyAt] ?? -1}\n                        row={stickyItem.row}\n                        number={stickyItem.position + 1}\n                        membership={memberships[stickyAt]}\n                        draft={draftOf(stickyItem.row.id)}\n                        onDiscard={onRowDiscard}\n                        group={group}\n                        folded={stickyItem.folded}\n                        count={stickyItem.count}\n                        sticky\n                        selC={undefined}\n                        range={undefined}\n                        picked={false}\n                        mixed={bandMixed(rowSpace.rowOf[stickyAt] ?? -1, false)}\n                        editor={undefined}\n                        onCellDown={onCellDown}\n                        onCellDouble={onCellDouble}\n                        onCellEnter={onCellEnter}\n                        onRowPick={onRowPick}\n                        onFold={onFold}\n                        // A drop over the copy lands on its band: the band itself lies under the header (#1187).\n                        drop={dropOn ? rowDrop : undefined}\n                        dropRow={dropOn ? dropText(stickyItem) : undefined}\n                        foldedGutter={folded}\n                        inserts={foldedInserts}\n                    />\n                </Box>\n            )}\n            {stuckLine !== undefined && (\n                // The line whose sub rows scroll under the band: laid over the rows just under the band, and\n                // BENEATH the band and the header (z −1 inside the pinned header), so it slides away under them as its last\n                // sub row leaves. A press on it first brings the line itself back under the band (`revealLine`). A copy,\n                // like the band's (#860).\n                <Box ref={stickyLineRef} position=\"absolute\" left=\"0\" right=\"0\" zIndex=\"-1\" aria-hidden=\"true\">\n                    <SheetRow\n                        styles={styles}\n                        columns={columns}\n                        registers={registers}\n                        driverColumn={driverColumn}\n                        gridTemplate={gridTemplate}\n                        rowPx={rowPx}\n                        r={stuckLine.r}\n                        number={stuckLine.lg.number}\n                        row={stuckLine.row}\n                        group={stuckLine.lg}\n                        membership={memberships[stuckLine.at]}\n                        draft={draftOf(stuckLine.lg.row.id, stuckLine.lg.key)}\n                        onDiscard={onRowDiscard}\n                        linkCtx={linkCellCtx}\n                        selC={undefined}\n                        range={undefined}\n                        picked={false}\n                        hit={stuckLine.hit}\n                        editor={undefined}\n                        fills={undefined}\n                        nextTargetC={undefined}\n                        hoverC={undefined}\n                        onCellDown={(r, c, e) => { if (e.button === 0) revealLine(stuckLine.at, false); onCellDown(r, c, e); }}\n                        onCellDouble={onCellDouble}\n                        onCellEnter={onCellEnter}\n                        onRowPick={(r, e) => { if (e.button === 0) revealLine(stuckLine.at, false); onRowPick(r, e); }}\n                        onTake={onTake}\n                        onFillRow={onFillRow}\n                        subRowCount={stuckLine.lg.row.lines[stuckLine.lg.index]?.subRows.length ?? 0}\n                        subRowsOpen\n                        onSubRows={(r, all) => { revealLine(stuckLine.at, all); onSubRows(r, all); }}\n                        noun={noun}\n                        sticky\n                        drop={dropOn ? rowDrop : undefined}\n                        dropRow={dropOn ? stuckLine.dropRow : undefined}\n                        foldedGutter={folded}\n                        inserts={foldedInserts}\n                    />\n                </Box>\n            )}\n        </Box>\n    );\n    // A host's empty state (#1531): under its header, once every row is read and the narrowing leaves none to show.\n    const HostEmpty = hostGrid?.Empty;\n    const searched = narrowing !== undefined && narrowingQuery(narrowing).trim() !== \"\";\n    const narrowedAll = narrowing !== undefined && emptyNarrowing !== undefined && !narrowingEqual(narrowing, emptyNarrowing);\n    const empty = HostEmpty !== undefined && narrowing !== undefined && narrowedAll && body.length === 0 && cold !== true && !busy\n        ? <HostEmpty query={searched} onClear={() => { if (chrome !== undefined) writeNarrowing(chrome, searched ? clearSearch(narrowing) : clearNarrowing(narrowing)); }} />\n        : undefined;\n    // The strip docked under the rows: an action's, else the Sheet's — or a host's (#1533), its own words for the cell\n    // under the pointer, else the ring's, and the Sheet's while that speaks of what is in hand.\n    const actionStrip = actionApi.current?.strip();\n    const sheetStrip = actionStrip ?? strip;\n    const HostStrip = hostGrid?.Strip;\n    const stripItem = previewed === undefined ? undefined : rowAt(previewed.r);\n    const stripColumn = previewed === undefined ? undefined : columns.list[previewed.c];\n    const stripAt = previewed !== undefined && stripItem?.kind === \"real\" && stripColumn !== undefined\n        ? { r: previewed.r, row: stripItem.row, column: stripColumn, changes: changesOf(stripItem.row.id, stripItem.row) } : undefined;\n    const stripNode = HostStrip !== undefined\n        ? <HostStrip styles={styles} model={sheetStrip} onAction={onStripAction} own={edit !== null || ui.selEnd !== null || suggested !== undefined || actionStrip !== undefined}\n            at={stripAt} columns={columns} registers={registers} writable={canEdit && editingState.available} />\n        : <SheetStrip styles={styles} model={sheetStrip} onAction={onStripAction} />;\n    // The grid with its strip (SB4): the card — the header, the rows and the\n    // insertion layer — the insertion strip, and the strip docked under them.\n    const grid = (\n        <>\n            {/* A phone's column pager over the grid (SH1): the window of columns beside any pinned one — its `Row number` the Sheet's own. */}\n            {phoneFrame && pagedColumns.length > phoneColumns && (\n                <SheetPager styles={styles} frame={viewport?.frame ?? null} columns={pagerColumns} slotPx={slotPx} inView={phoneColumns} rowNumbers={rowNumbers}\n                    onRowNumbers={hostGrid === undefined ? setRowNumbers : undefined} />\n            )}\n            <Box\n                ref={cardRef}\n                id={gridId}\n                css={styles.card}\n                tabIndex={0}\n                data-sheet-card\n                // Where the gutter ends — what the seam lines start from — whether it folded (#1215), and how wide its number column is.\n                data-gutter={folded ? \"folded\" : undefined}\n                // A phone's frame (`Mobile Sheet Spec.md`): its window of columns, any pinned column, its band across the view.\n                data-phone={phoneFrame ? \"\" : undefined}\n                data-pin={pinned ? \"\" : undefined}\n                data-row-numbers={rowNumbers ? \"\" : undefined}\n                style={{ \"--sheet-gutter\": `${gutterPx}px`, \"--sheet-number\": `${numberPx}px`, \"--sheet-view\": `${viewPx ?? 0}px`, \"--sheet-pin\": `${pinPx}px` } as CSSProperties}\n                role=\"grid\"\n                // Rows that stand in — a narrowing's last, those a key's far jump holds, or the last reading's while their\n                // source reads them another way (#1599) — are retained (#1398, CL8, CL10): readable and walked by the\n                // keys, the frame's main busy, and taking no edit, drag or drop.\n                aria-disabled={standingIn || keyHeld ? true : undefined}\n                aria-rowcount={ariaRowCount}\n                aria-colcount={colCount + (hostGrid !== undefined && gutterPx === 0 ? 0 : 1)}\n                aria-multiselectable\n                aria-activedescendant={activeCell}\n                onKeyDown={onKeyDown}\n                onCopy={onCopy}\n                onPaste={onPaste}\n                onMouseLeave={hostGrid !== undefined ? onGridLeave : undefined}\n            >\n                <VirtualRows\n                    height={undefined}\n                    maxHeight={undefined}\n                    fillParent\n                    header={header}\n                    // A host's grid has no padding under its rows (#1531): its empty state, when it shows one.\n                    footer={hostGrid === undefined ? <Box height={`${BOTTOM_PAD_PX}px`} /> : empty}\n                    count={body.length}\n                    estimateSize={sizeOf}\n                    getItemKey={itemKey}\n                    anchorable={anchorable}\n                    // At its very start the sheet stays on its start (#1599): a row put back first — one removed here and\n                    // taken back as another session left it — or one added there is shown, never left under the header.\n                    startStays\n                    onViewport={setViewport}\n                    renderRow={renderRow}\n                    minWidth={`${minWidth}px`}\n                    headerZIndex={6}\n                    scrollToIndex={scrollTarget?.index}\n                    scrollNonce={scrollTarget?.nonce}\n                    scrollAlign={scrollTarget?.align ?? \"auto\"}\n                    onRangeChange={pagedSource !== undefined ? reportRange : undefined}\n                    sizeVersion={lensDrawn ? lens.sizeVersion : paging.sizeVersion}\n                    // Where the scroll rests, persisted and restored as an item (#857).\n                    onAnchorChange={onAnchorChange}\n                    restoreAnchor={restoreAnchor}\n                    // A phone's columns snap to the window's slots, past any pinned column (SH1.3).\n                    rootCss={phoneFrame ? (pinned ? PHONE_PINNED_ROOT_CSS : PHONE_ROOT_CSS) : WIDE_ROOT_CSS}\n                />\n                {seam !== undefined && seamsOn && (\n                    <SheetInsertLayer ref={insertLayerRef} styles={styles} seam={seam} actions={insertActions(seam.r, seam.side)} onLeave={onSeamLeave} />\n                )}\n                {/* What the number column is measured by: the widest numbers, drawn as the rows draw them at their boldest (a hit's) — never shown, never hit. */}\n                <Box as=\"span\" ref={setNumberProbe} css={styles.numberMeasure} data-slot=\"numberMeasure\" aria-hidden=\"true\">\n                    <Box as=\"span\" css={styles.gutterNumber} data-hit=\"\">{widest.plain}</Box>\n                    {widest.chevron > 0 && <Box as=\"span\" css={styles.gutterNumber} data-hit=\"\" data-chevron=\"\">{widest.chevron}</Box>}\n                </Box>\n            </Box>\n            {/* With rows picked; or, with none, only once a completed read says there are none (#1398, CL13) — never while a paged source is still read. */}\n            {hostGrid === undefined && (wr !== null && edit === null || (rows.length === 0 && exhausted)) && canEdit && editingState.available && <SheetInsertStrip styles={styles}\n                ordered={!keyed || anchorFor(ui.sel.r, \"before\").child !== undefined}\n                above={canInsertRows ? () => onInsert(\"row\", wr?.r0 ?? ui.sel.r, \"before\") : undefined}\n                below={canInsertRows && (group === undefined || loose || rows.length > 0) ? () => onInsert(\"row\", wr?.r1 ?? ui.sel.r, \"after\") : undefined}\n                group={canInsertGroups ? () => onInsert(\"group\", wr?.r1 ?? ui.sel.r, \"after\") : undefined}\n                noun={noun.singular} />}\n            {cellEditor ?? actionBar ?? stripNode}\n            {actionOverlayNode}\n        </>\n    );\n    return { styles, root, toolbar, grid, footer, loading: loadingFacts, history, failure: undefined, inspect, enter, optimise, phoneLibrary, entries };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Sheet's shared state and its parts — the planning spreadsheet (`Sheet\n * Spec.md` §6): decode, the row source (both arms), the local data layer\n * (edits over the decoded rows until the source writes back), THE state\n * machine, the effect runner, the copilot runner (§6.2), and what they draw —\n * the toolbar's items · the sticky two-line header · virtualised rows · the\n * docked strip · the footer.\n *\n * The Sheet itself — `<Sheet>`, the `Sheet` extension `@elaraai/e3-ui`\n * declares (#1216) — is `EastChakraSheet` (`frame/index.tsx`): one\n * `BuilderFrame` whose regions hold these parts.\n *\n * Three parts over one shared state (SB4, #1181). `SheetProvider` builds the\n * store, the editing session, the lens and the selection, every hook in the\n * order it always ran, and the frame places what it builds: the toolbar's\n * items (`useSheetToolbarItems()`) in its one toolbar, `SheetGrid` — the\n * header, the rows and the strip, inside `SheetRoot` — in main, which it\n * fills, scrolling its own rows, and the footer (`useSheetFooter()`'s props)\n * in its footer, driving one grid (SB5). Its banners read the session\n * through `useSheetHistory()` (#1184), so the history item shows no error of\n * its own. What the frame hands the parts besides is {@link SheetHost}: the\n * columns the viewer hides, the drops the sheet takes, and what its rail\n * counts each source in.\n *\n * A host with chrome of its own — the Record's title, status line, Add,\n * Delete and footer (#1533) — takes the toolbar's items as parts\n * (`useSheetToolbarParts()`) and lays out its own row of them, and reads the\n * rows as its chrome counts and changes them (`useSheetEntries()`): the rows\n * drawn, how many the narrowing shows of how many the record holds, the last\n * gesture's notice, and a gesture that adds a row and one that removes rows,\n * each one step of the history. It hears each step of the history as it is\n * taken (`SheetHost.onHistory`), to say what the step did in its own words.\n *\n * Its narrowing is one rail over the sheet's `Slice.bindRecords` (#1345):\n * the sheet's rows are its `rows` source's record, every one in the record's\n * order, paged from it, and the source's narrowing is drawn over them as the\n * lens (#1349, `use-lens.ts`) — a filtered spreadsheet: e3 places the\n * narrowing's rows from the source's index, the lens reads the record's\n * segments that hold them near the view, and it draws only the rows the\n * narrowing keeps, one after another, each at its row number, a band at their\n * own pitch standing for those not read yet. A saved view holds every\n * source's narrowing, by the source's name, with a grouped sheet's folds.\n *\n * A row the narrowing hides is reached by clearing the filters that hide it\n * (the shared hidden pick, `shared/schedule/hidden.ts`, `hidden-pick.tsx`):\n * Search Records' line for it, and an issue's line in the Issues tab, name the\n * `rows` source's choices that hide it, as the rail words them — asked of e3\n * through the record's indexes, at the lens's revision, and `· hidden by the\n * filters` until it has said — and a pick of it, or Go to issue on it, clears\n * just them, every other choice kept (every choice, while e3 has not said\n * which): a rail change like any other, which a saved view's tab marks dirty\n * and Esc there reverts. The ring lands on the row once the narrowing they\n * leave draws it, at its row number, the lens's jump landing it.\n *\n * A source-bound transaction session retains draft gestures and history —\n * the editing session every editable collection shares (`src/editing/`,\n * #879), with its history bar in the toolbar, in the sheet's words.\n * onPatch observes each completed gesture; onApply submits a checked batch.\n * Overlays retire only after the source acknowledges the committed result.\n * Function values come from the latest render; submitted callbacks remain\n * captured until their request resolves.\n *\n * The Sheet's memo compares with `equivalentFor` (#809), so a value whose\n * only change is a closure — a swapped provider, an `onPatch` over new data —\n * still re-renders, and every function is taken from the latest value\n * (§6.2). The derivations that own local state (the decoded rows, the\n * controlled selection) key on the value's DATA identity instead, and the\n * transaction session on its source and schema, so such a change never\n * resets them; the copilot's memo is keyed on the value's identity.\n *\n * Grouped rows (#740): the source rows are GROUPS; the body draws each\n * group's band over its lines (pseudo rows tagged with their group), one\n * blank line per open group during the insertion migration. A write on a line\n * rewrites its group (`lineCommit` / `lineInsert` / `lineRemove` carry the\n * whole group after the edit, a line's address as its position); a\n * summary field commits the group. Explicit insertion controls create groups.\n *\n * A line may carry SUB ROWS (#844): read-only rows under the line that\n * share none of its columns, outside the row space, opened by the line's\n * chevron or Space. A gesture\n * that folds or opens moves rows with a short slide, and the rows it brings\n * into view drop in; nothing moves on a scroll, a lens change or a view\n * switch, and nothing at all under reduced motion.\n *\n * The frame's drops (`SheetHost.drop`, #1187) make each row a drop target on\n * the sheet's surface and each row's gutter a grip: its library's templates\n * insert at a seam, its author's cards set their cells on a row or a band,\n * and a row, a line or a group moves to another seam —\n * each drop one transaction, planned by `drop.ts` from the rows as they\n * stand, and the ghost saying where it lands, or why it can't.\n *\n * On a coarse pointer, a frame too narrow for the touch gutter beside the\n * first column FOLDS the gutter (#1215, `gutter.ts`): each row's actions go\n * into one 44 px row-actions button — its grip, and a tap's menu of its\n * decisions and the inserts at it — and the seams offer no chips.\n *\n * `useSheet` builds the parts from hooks, each in a module of its own and\n * each handed what the hooks before it give, called in the order they always\n * ran: the decoded value (`use-decode.ts`); the rows and their editing\n * session (`use-session.ts`); the body the grid walks (`use-body.ts`); the\n * state machine (`use-machine.ts`); saving edits (`use-writes.ts`); the\n * copilot (`use-copilot.ts`); the effect runner (`use-effects.ts`); the\n * gestures that wait for an open editor (`use-gestures.ts`); the pointer and\n * the keyboard (`use-input.ts`); the open editor (`use-open-editor.ts`); what\n * the frame shows while rows are read (`use-reading.ts`); where the view goes\n * (`use-jumps.ts`); the view tabs (`use-view-tabs.tsx`); what is said of the\n * ring's cell (`use-ring.ts`); the rows' scroll (`use-scroll.tsx`); what each\n * row is handed (`use-row-parts.ts`); the action buttons (`use-actions.tsx`);\n * drawing the rows (`use-rows.tsx`); the side panel (`use-inspector.tsx`);\n * drag and drop (`use-drops.ts`); and the parts as the frame places them\n * (`use-assembled.tsx`). What they build is declared in `parts.ts`.\n */\n\nimport { createContext, useContext, type ReactNode, type RefObject } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { getSomeorUndefined, type ToolbarItem } from \"@elaraai/east-ui-components\";\nimport { DensityProvider } from \"@elaraai/east-ui-components/internal\";\nimport type { SheetFooterProps } from \"./Footer.js\";\nimport type { SheetToolbarParts } from \"./Toolbar.js\";\nimport type { SheetRootValue } from \"./values.js\";\nimport { useSheetDecode } from \"./use-decode.js\";\nimport { useSheetSession } from \"./use-session.js\";\nimport { useSheetBody } from \"./use-body.js\";\nimport { useSheetMachine } from \"./use-machine.js\";\nimport { useSheetWrites } from \"./use-writes.js\";\nimport { useSheetCopilot } from \"./use-copilot.js\";\nimport { useSheetEffects } from \"./use-effects.js\";\nimport { useSheetGestures } from \"./use-gestures.js\";\nimport { useSheetInput } from \"./use-input.js\";\nimport { useSheetOpenEditor } from \"./use-open-editor.js\";\nimport { useSheetReading } from \"./use-reading.js\";\nimport { useSheetJumps } from \"./use-jumps.js\";\nimport { useSheetViewTabs } from \"./use-view-tabs.js\";\nimport { useSheetRing } from \"./use-ring.js\";\nimport { useSheetScroll } from \"./use-scroll.js\";\nimport { useSheetRowParts } from \"./use-row-parts.js\";\nimport { useSheetActions } from \"./use-actions.js\";\nimport { useSheetRows } from \"./use-rows.js\";\nimport { useSheetInspector } from \"./use-inspector.js\";\nimport { useSheetDrops } from \"./use-drops.js\";\nimport { useSheetAssembled } from \"./use-assembled.js\";\nimport type { SheetEntries, SheetHistory, SheetHost, SheetInspect, SheetLoadingFacts, SheetOptimiseParts, SheetParts, SheetPhoneLibrary } from \"./parts.js\";\n\nexport type {\n    SheetOptimiseParts, SheetParts, SheetEntries, SheetEntryHold, SheetPhoneLibrary, SheetLoadingFacts, SheetHistory, SheetHost,\n    SheetRowChanges, SheetHostRowProps, SheetHostHeaderProps, SheetColumnWindow, SheetHostLayout, SheetHostEmptyProps,\n    SheetHostStripCell, SheetHostStripProps, SheetGridHost, SheetCellEditorAt, SheetInspectPlace, SheetInspectTarget,\n    SheetSelected, SheetDuplicateOptions, SheetInspectWrite, SheetInspect,\n} from \"./parts.js\";\n\nexport type { SheetRootValue, SheetRowValue, SheetCellValue } from \"./values.js\";\n\n/**\n * Builds the sheet's shared state and the parts it lays out: the root's\n * whole body, its hooks in the order they always ran.\n */\nfunction useSheet(value: SheetRootValue, storageKey: string, host: SheetHost): SheetParts {\n    const sheetDecode = useSheetDecode(value, host);\n    const sheetSession = useSheetSession(value, storageKey, host, sheetDecode);\n    const sheetBody = useSheetBody(sheetDecode, sheetSession);\n    const sheetMachine = useSheetMachine(value, sheetDecode, sheetSession, sheetBody);\n    const sheetWrites = useSheetWrites(sheetDecode, sheetSession, sheetBody);\n    const sheetCopilot = useSheetCopilot(sheetDecode, sheetSession, sheetBody, sheetMachine);\n    const sheetEffects = useSheetEffects(sheetDecode, sheetSession, sheetBody, sheetMachine, sheetWrites, sheetCopilot);\n    const sheetGestures = useSheetGestures(host, sheetDecode, sheetSession, sheetBody, sheetMachine, sheetWrites,\n        sheetEffects);\n    const sheetInput = useSheetInput(sheetDecode, sheetSession, sheetBody, sheetMachine, sheetEffects, sheetGestures);\n    const sheetOpenEditor = useSheetOpenEditor(sheetDecode, sheetSession, sheetBody, sheetMachine);\n    const sheetReading = useSheetReading(sheetDecode, sheetSession, sheetBody);\n    const sheetJumps = useSheetJumps(value, sheetDecode, sheetSession, sheetBody, sheetMachine, sheetEffects);\n    const sheetViewTabs = useSheetViewTabs(sheetDecode, sheetSession, sheetBody, sheetMachine, sheetOpenEditor);\n    const sheetRing = useSheetRing(sheetDecode, sheetSession, sheetBody, sheetMachine, sheetOpenEditor);\n    const sheetScroll = useSheetScroll(sheetDecode, sheetSession, sheetBody, sheetMachine, sheetEffects,\n        sheetOpenEditor, sheetReading, sheetRing);\n    const sheetRowParts = useSheetRowParts(host, sheetDecode, sheetSession, sheetBody, sheetMachine, sheetEffects,\n        sheetGestures, sheetReading, sheetRing, sheetScroll);\n    const sheetActions = useSheetActions(host, sheetDecode, sheetSession, sheetBody, sheetMachine, sheetWrites,\n        sheetEffects, sheetInput);\n    const sheetRows = useSheetRows(sheetDecode, sheetSession, sheetBody, sheetGestures, sheetInput, sheetOpenEditor,\n        sheetViewTabs, sheetRing, sheetScroll, sheetRowParts, sheetActions);\n    const sheetInspector = useSheetInspector(value, sheetDecode, sheetSession, sheetBody, sheetMachine, sheetWrites,\n        sheetCopilot, sheetEffects, sheetGestures, sheetOpenEditor, sheetJumps, sheetViewTabs, sheetActions);\n    const sheetDrops = useSheetDrops(sheetDecode, sheetSession, sheetBody, sheetMachine, sheetWrites, sheetCopilot,\n        sheetEffects, sheetGestures, sheetRowParts, sheetInspector);\n    return useSheetAssembled(value, sheetDecode, sheetSession, sheetBody, sheetMachine, sheetEffects, sheetGestures,\n        sheetInput, sheetOpenEditor, sheetReading, sheetJumps, sheetViewTabs, sheetRing, sheetScroll, sheetRowParts,\n        sheetActions, sheetRows, sheetInspector, sheetDrops);\n}\n\nconst SheetContext = createContext<SheetParts | undefined>(undefined);\n\n/** The shared state the parts read; a part outside a {@link SheetProvider} is a mistake of the frame's, and throws. */\nfunction useSheetParts(): SheetParts {\n    const parts = useContext(SheetContext);\n    if (parts === undefined) throw new Error(\"A Sheet part is placed outside a SheetProvider\");\n    return parts;\n}\n\nexport interface SheetProviderProps {\n    /** The Sheet root value. */\n    value: SheetRootValue;\n    /** Storage key prefix for persisting component state. */\n    storageKey: string;\n    /** What the frame hands the parts: the columns hidden, and the drops taken; nothing by default. */\n    host?: SheetHost | undefined;\n    /** Where the frame places the parts. */\n    children: ReactNode;\n}\n\nconst NO_HOST: SheetHost = {};\n\n/**\n * Provides the sheet's one shared state (SB4): the store, the editing\n * session, the lens and the selection, for the parts below it, wherever the\n * frame places them (SB5). The declared density reaches every one of them.\n */\nexport function SheetProvider({ value, storageKey, host = NO_HOST, children }: SheetProviderProps) {\n    const parts = useSheet(value, storageKey, host);\n    const provided = <SheetContext.Provider value={parts}>{children}</SheetContext.Provider>;\n    const densityTag = getSomeorUndefined(value.density)?.type;\n    return densityTag !== undefined\n        ? <DensityProvider value={densityTag}>{provided}</DensityProvider>\n        : provided;\n}\n\n/**\n * Reads the toolbar's items (§7) in the row's order and on its fold ladder:\n * the view tabs, the count, the key search, the slice's rail, the scope badge\n * and the history item. The frame lays them out with\n * the shared `Toolbar`, and puts {@link useSheetToolbarRef}'s ref on the\n * element that holds them.\n *\n * @returns The items, a falsy entry for each the sheet has no use for.\n */\nexport function useSheetToolbarItems(): ReadonlyArray<ToolbarItem | false | undefined> {\n    return useSheetParts().toolbar.items;\n}\n\n/**\n * Reads the toolbar's items as parts (#1533) — the view tabs, the count line,\n * the key search, the rail, the scope badge, the Elara eye and the history\n * item, each with its forms and its fold ranks — for a host that lays out a\n * row of its own from some of them: the Record's title, the rail, its status\n * line, Add and Delete, and the history.\n *\n * @returns The parts, `undefined` for each the sheet has no use for\n */\nexport function useSheetToolbarParts(): SheetToolbarParts {\n    return useSheetParts().toolbar.parts;\n}\n\n/**\n * Reads the rows as a host's own chrome counts and changes them (#1533): the\n * rows drawn, how many the narrowing shows of how many the record holds, the\n * last gesture's notice, the gestures recorded, and the host's Add and\n * Delete.\n *\n * @returns The rows' counts, the notice and the two gestures — the gestures stable\n */\nexport function useSheetEntries(): SheetEntries {\n    return useSheetParts().entries;\n}\n\n/**\n * Reads the ref for the element that holds the toolbar's items: ⌘F and ⌘/\n * in the grid put the focus on the key search in it — its box, or, folded to\n * its icon, the box in its popover (#1221) — else on the first search box.\n *\n * @returns The ref, for the element the frame lays the items out in.\n */\nexport function useSheetToolbarRef(): RefObject<HTMLDivElement | null> {\n    return useSheetParts().toolbar.ref;\n}\n\n/**\n * Reads the footer's props: the counts, the key hint, the live message and\n * what the loading line says of a paged source, for the footer the frame\n * places.\n *\n * @returns The props of the sheet's footer.\n */\nexport function useSheetFooter(): SheetFooterProps {\n    return useSheetParts().footer;\n}\n\n/**\n * Reads how the frame shows a paged source being read (#1398): its cold load\n * — the frame's skeleton, at the rows' pitch — and a read in flight after it,\n * which leaves everything live and the region being read busy.\n *\n * @returns The facts the frame takes as `loading`, `busy` and `loadingPitch`\n */\nexport function useSheetLoading(): SheetLoadingFacts {\n    return useSheetParts().loading;\n}\n\n/**\n * Reads the editing session and its history actions, for the frame's\n * banners (`SessionBanners`), which show the session's state, their Retry\n * and Discard run as the history item's do.\n *\n * @returns The session, and the actions' runner\n */\nexport function useSheetHistory(): SheetHistory {\n    return useSheetParts().history;\n}\n\n/**\n * Reads what the inspector pane shows of the sheet and the gestures it\n * makes (#1188): what is selected — one row, line or band, several rows, or\n * nothing — each target's draft against what the record holds, the batch's\n * issues, and the writes, each one transaction as typing in the grid is.\n *\n * @returns The sheet's inspector facts and gestures\n */\nexport function useSheetInspect(): SheetInspect {\n    return useSheetParts().inspect;\n}\n\n/**\n * Reads what the frame places of a run of the app's optimiser (#1409, #1418):\n * the banner the result lands with, for the banners slot before the\n * session's, and the landing — the ref, the attributes and the styles for\n * the frame's own root, under which the cascade is measured and from which\n * the cells' flares, the glow and the counts' flash are drawn.\n *\n * @returns The run's parts for the frame\n */\nexport function useSheetOptimise(): SheetOptimiseParts {\n    return useSheetParts().optimise;\n}\n\n/**\n * Reads what the library pane calls on a card's ⏎ (#1187, SB45): the card,\n * by its library and its key, taken as a drop below the ring's row — a\n * template inserted after it, an author's card's cells set on it — or, where\n * that is refused, why, in the footer.\n *\n * @returns The ⏎ — stable\n */\nexport function useSheetDropEnter(): (library: string, key: string) => void {\n    return useSheetParts().enter;\n}\n\n/**\n * Reads what a phone's Library reads of the sheet, and the taps it makes (`Mobile Sheet Spec.md` SH11, R7).\n *\n * @returns What a card's tap acts on, whether a card is what it holds now, the tap, and the go to a column\n */\nexport function useSheetPhoneLibrary(): SheetPhoneLibrary {\n    return useSheetParts().phoneLibrary;\n}\n\n/**\n * Renders the element the grid is laid in: the sheet's root, its recipe's\n * root styles, and the attributes its rows' styles key on (`data-sheet`,\n * `data-lens`, `data-view`, `data-moving`, …). It fills the frame's main\n * region, and the grid in it scrolls its own rows.\n */\nexport function SheetRoot({ children }: { children: ReactNode }) {\n    const { styles, root } = useSheetParts();\n    return (\n        <Box css={styles.root} data-sheet data-sheet-partial={root.partial ? \"\" : undefined} data-copilot={root.copilot ? \"\" : undefined}\n            data-lens={root.lens ? \"\" : undefined} data-view={root.view} data-moving={root.moving ? \"\" : undefined}>\n            {children}\n        </Box>\n    );\n}\n\n/**\n * Renders the grid with its strip: the header, the rows, the insertion\n * controls, and the strip docked under them — or, when the source failed\n * before any row landed, why, with its Retry (#853).\n */\nexport function SheetGrid() {\n    const parts = useSheetParts();\n    return parts.failure ?? parts.grid;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The inspector pane (#1188, `Sheet Builder Spec.md` §5.3, §8, §9.9,\n * SB46–SB53, SB58): the Sheet's end pane, when it is given one (#1216), its\n * tabs Details and Issues — Issues with its count — and, collapsed, a rail\n * with its icon, the issue count and what is selected.\n *\n * Details shows what the ring and the range select:\n *\n * - **one row or line** (SB47): its number and id, a Pending or New chip,\n *   the lock of a row owned upstream, its issues, every field of its type\n *   through `FieldForm` (the payload's form: a column's kind its field's\n *   editor, a field with no column by its type — and each member of a column\n *   from data a line of its own, its cell, #1561), its sub rows read only, then\n *   Duplicate and Delete. A link or set field shows its halves as the grid\n *   draws them, with Edit in sheet, which puts the ring on its cell (SB48). An\n *   edit is one transaction, as typing in the cell is: a field with a column\n *   is written through its cell — the cells a patch of it sets, or a custom\n *   column's text read by its own parse — and asks the copilot again when its\n *   column is a trigger; a field with none is set on the draft (SB52). A\n *   number's box emptied is its cell emptied, as emptying the cell is: blank,\n *   the field then not set, where its column takes a clear. An edit its cell\n *   refuses — a clear of a value that is never empty — leaves the field\n *   showing what the row holds, the reason under it as the footer's line says\n *   it. A field the drafts changed is tinted against what the source holds.\n *   A number its field's bounds don't hold is said once, in its help line —\n *   a phone's stepper's too — in the tone the row's Save stands in (#1585): a\n *   warning while the row is as stored, an error once its change holds Save.\n *   With the author's own Details (SB58), a complete row shows what they return in\n *   place of the form, and their `update` is one transaction; a row still\n *   missing a field, or holding one unreadable, shows the form until it is\n *   complete;\n * - **a band** (SB49): its group's own fields, its line count and its issues,\n *   then Add line, Duplicate with its lines, Delete with its lines;\n * - **several rows** (SB50): their count, a column set or cleared across\n *   them, Duplicate and Delete — each one transaction;\n * - **nothing** (SB51): the rows, the pending drafts and the issues counted,\n *   over a record its last commit and who made it, and three hints.\n *\n * Issues (SB53) lists every issue of the batch by row — a field still\n * missing or unreadable, an author's check, an Apply's conflict or refusal —\n * each a control that goes to its cell, seeking its row on a paged sheet. An\n * issue whose row the rail's filters hide says so, and by which once e3 has\n * said — `hidden by Status: Ready — picking it clears that filter` — and a\n * click clears them and goes to the row (the hidden pick, `hidden.ts`).\n *\n * Styles are the `sheetInspector` recipe's, the form's `fieldForm`'s and a\n * link cell's the `sheet` recipe's; the pane — its tab row, its collapse\n * control and its rail — is the Dock's.\n *\n * A host with a view of its own (#1534) — the Record's — draws Details for one\n * row and for nothing in the Sheet's place ({@link SheetInspectorHost}), a\n * phone's drawer's among them, over the same reads and writes, the form's own\n * (`useTargetForm`) among them, and names an issue's row in the Issues tab in\n * its own words. Several rows stay the Sheet's; so does a complete row given\n * the author's own Details.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useContext, useEffect, useMemo, useState, type ComponentType, type ReactNode } from \"react\";\nimport { Box, chakra, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faChevronDown, faLock, faMinus, faPlus } from \"@fortawesome/free-solid-svg-icons\";\nimport {\n    ArrayType, FloatType, IntegerType, NullType, OptionType, StringType, VariantType, compareFor, decodeBeast2For, defaultValue, encodeBeast2For, equalFor, fromEastTypeValue, isTypeEqual, none, printFor, some,\n    toEastTypeValue, variant, type EastType, type StructType, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport type { FieldEditorValue, FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { Sheet, type sheetKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    EastChakraComponent, FieldForm, fieldBreaches, fieldFormMessages, getSomeorUndefined, useDataStable, type BuilderFrameDock, type EditIssue,\n    type FieldOption,\n} from \"@elaraai/east-ui-components\";\nimport { FrameDrawer, useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { useSheetInspect, type SheetCellEditorAt, type SheetInspect, type SheetInspectPlace, type SheetInspectTarget, type SheetInspectWrite, type SheetSelected } from \"../index.js\";\nimport { formatTime, splitTimeToken, todayUtc, withTime } from \"../parse/date.js\";\nimport { NULL_CELL, cellText, indexRegisters, takesClear, type SheetColumnMeta } from \"../model.js\";\nimport type { SheetCellValue } from \"../values.js\";\nimport { issueText, type SheetWords } from \"../words.js\";\nimport { actionColumnOf } from \"../actions/model.js\";\nimport { setAt } from \"../actions/form-check.js\";\nimport { namesMember } from \"../Rows.js\";\nimport type { SheetValue } from \"./index.js\";\n\n/**\n * What the inspector reads of its payload: the grid's root, the inspector pane and the record's history — a Sheet's,\n * or a Record's (#1531), which mounts it over the same parts.\n */\nexport type SheetInspectorValue = Pick<SheetValue, \"sheet\" | \"inspector\" | \"history\">;\n\n/** The inspector pane, decoded: its forms, and the author's own Details. */\nexport type PaneValue = Extract<SheetValue[\"inspector\"], { type: \"some\" }>[\"value\"];\n/** One inspector form, decoded: its struct, its fields, the fields its columns write and show, and `encode`. */\nexport type FormValue = PaneValue[\"forms\"][\"row\"];\n/** What the author's own Details return for a complete row (SB58): the UI drawn in the form's place. */\nexport type AuthorDetails = ReturnType<Extract<PaneValue[\"custom\"], { type: \"some\" }>[\"value\"]>;\n/** One field of a form, decoded. */\ntype FormField = FormValue[\"fields\"][number];\n/** The names the sheet keeps its viewer's state under. */\ntype SheetKeys = ReturnType<typeof sheetKeys>;\ntype Styles = Record<string, SystemStyleObject>;\n\nconst stringEqual = equalFor(StringType);\nconst pathEqual = equalFor(ArrayType(StringType));\n\n/** The inspector open: the Calendar's 320px (§8). */\nconst INSPECTOR_SIZE = \"320px\";\n\n/** The bulk edit's choice of a column: a name no struct's field takes. */\nconst PICK = \"$column\";\n\n/** A field's path as one key. */\nconst pathKey = (path: readonly string[]) => path.join(\"\\u001f\");\n\n/** The record's last commit, as the footer and the inspector say it (SB22, SB51). */\nexport interface SheetLastCommit {\n    /** When — the day's time when it was today, in full otherwise. */\n    when: string;\n    /** Who made it: the commit's actor. */\n    by: string;\n}\n\n/** Props of {@link useSheetInspector}. */\nexport interface SheetInspectorProps {\n    /** The payload: its inspector pane, the sheet's registers and editing, and whether it is over a record. */\n    value: SheetInspectorValue;\n    /** The names the sheet keeps its viewer's state under. */\n    keys: SheetKeys;\n    /** The sheet's words. */\n    words: SheetWords;\n    /** The columns this viewer hides: a link field's Edit in sheet waits for its column to show. */\n    hidden: ReadonlySet<string>;\n    /** The record's last commit, when it has one. */\n    lastCommit: SheetLastCommit | undefined;\n    /** What a host draws in the Sheet's place (#1534): its own Details, and its words for an issue's row; absent, the Sheet's. */\n    host?: SheetInspectorHost | undefined;\n}\n\n/**\n * What a host draws in the inspector in the Sheet's place (#1534) — the Record's: Details for one row and for nothing,\n * and the words an issue's line names its row by.\n */\nexport interface SheetInspectorHost {\n    /**\n     * Details while the ring selects one place — a row, a line or a band — or nothing: in a phone's drawer too, where\n     * they draw at touch size, as the Sheet's own do there (SH12). Several rows are the Sheet's. A complete row given\n     * the author's own Details shows them in the form's place ({@link useAuthorDetails}).\n     */\n    Details: ComponentType<SheetInspectorDetailsProps>;\n    /**\n     * How an issue's line in the Issues tab names its row, given where the row stands among the rows drawn —\n     * `undefined` for one the sheet does not draw; absent, by its entry, a line by its place in its group.\n     */\n    where?: ((issue: EditIssue, place: SheetInspectPlace | undefined) => string) | undefined;\n}\n\n/** What a host's Details is given ({@link SheetInspectorHost.Details}). */\nexport interface SheetInspectorDetailsProps {\n    /** The payload: the grid's root, the inspector pane and the record's history. */\n    value: SheetInspectorValue;\n    /** The pane: its forms, and the author's own Details. */\n    pane: PaneValue;\n    /** The names the sheet keeps its viewer's state under. */\n    keys: SheetKeys;\n    /** The sheet's words. */\n    words: SheetWords;\n    /** The columns this viewer hides. */\n    hidden: ReadonlySet<string>;\n    /** The host's word for a group. */\n    noun: string;\n    /** What the ring selects: one row's place, or nothing. */\n    selected: Exclude<SheetSelected, { kind: \"several\" }>;\n}\n\n/** The host's word for a group, or the sheet's. */\nfunction nounOf(value: SheetInspectorValue, words: SheetWords): string {\n    const group = getSomeorUndefined(value.sheet.group);\n    return (group !== undefined ? getSomeorUndefined(group.noun)?.singular : undefined) ?? words.m.groupNoun();\n}\n\n/**\n * What the inspector shows, as its head and its rail name it — `row 3`, `line 2 of WO-2201`, `order 4`.\n *\n * @param place - Where it stands\n * @param words - The sheet's words\n * @param noun - The host's word for a group\n * @returns Its name\n */\nexport function whatOf(place: SheetInspectPlace, words: SheetWords, noun: string): string {\n    return words.m.inspectorWhat({ what: place.kind, number: words.number(place.number), title: place.group?.title, noun });\n}\n\n/**\n * The inspector pane, as `BuilderFrame` draws it — see the module docs.\n *\n * @param props - The payload, the sheet's keys, the words, the columns hidden, the last commit, and what a host draws in the Sheet's place\n * @returns The pane — its tabs Details and Issues, 320px wide, its collapsed state kept per viewer (SB24) — or `undefined`, no pane, when the sheet is given no inspector\n */\nexport function useSheetInspector({ value, keys, words, hidden, lastCommit, host }: SheetInspectorProps): BuilderFrameDock | undefined {\n    const { m } = words;\n    const inspect = useSheetInspect();\n    const pane = getSomeorUndefined(value.inspector);\n    // No `inspector`: no pane (#1216).\n    if (pane === undefined) return undefined;\n    const noun = nounOf(value, words);\n    const issues = inspect.counts.issues;\n    const selected = inspect.selected;\n    // The rail's line: what is selected.\n    const detail = selected.kind === \"one\" ? whatOf(selected.place, words, noun)\n        : selected.kind === \"several\" ? m.inspectorSeveral({ n: selected.rs.length, count: words.number(selected.rs.length), lines: getSomeorUndefined(value.sheet.group) !== undefined })\n            : undefined;\n    return {\n        label: m.inspectorPane(),\n        icon: \"sliders\",\n        size: INSPECTOR_SIZE,\n        persist: \"local\",\n        badge: issues > 0 ? words.number(issues) : undefined,\n        detail,\n        tabs: [\n            { key: \"details\", label: m.inspectorTab({ tab: \"details\" }),\n                body: <SheetInspectorDetails value={value} pane={pane} keys={keys} words={words} hidden={hidden} lastCommit={lastCommit} host={host} noun={noun} /> },\n            { key: \"issues\", label: m.inspectorTab({ tab: \"issues\" }), count: words.number(issues),\n                body: <SheetInspectorIssues forms={pane.forms} columns={value.sheet.columns} words={words} noun={noun} where={host?.where} /> },\n        ],\n    };\n}\n\n/** Props of the Details tab and its views. */\ninterface DetailsProps extends SheetInspectorProps {\n    /** The pane: its forms, and the author's own Details. */\n    pane: PaneValue;\n    /** The host's word for a group. */\n    noun: string;\n}\n\n/** The Details tab: what is selected — one row, a band, several rows, or nothing. */\nconst SheetInspectorDetails = memo(function SheetInspectorDetails(props: DetailsProps) {\n    const inspect = useSheetInspect();\n    const styles = useSlotRecipe({ key: \"sheetInspector\" })() as Styles;\n    const selected = inspect.selected;\n    // A host's own Details for one place and for nothing (#1534), a phone's drawer's too, at touch size (#1536).\n    const Host = props.host?.Details;\n    if (Host !== undefined && selected.kind !== \"several\") {\n        return <Host value={props.value} pane={props.pane} keys={props.keys} words={props.words} hidden={props.hidden} noun={props.noun} selected={selected} />;\n    }\n    if (selected.kind === \"none\") {\n        return <NothingSelected styles={styles} inspect={inspect} words={props.words} record={props.value.history.type === \"some\"} lastCommit={props.lastCommit} />;\n    }\n    // Each selection its own form: what was typed for one row never lands on the next.\n    if (selected.kind === \"several\") return <SeveralRows key={`${selected.r0}:${selected.r1}`} {...props} styles={styles} inspect={inspect} rs={selected.rs} r0={selected.r0} r1={selected.r1} />;\n    const place = selected.place;\n    const form = place.kind === \"band\" ? getSomeorUndefined(props.pane.forms.group) : props.pane.forms.row;\n    if (form === undefined) return null;\n    return <TargetDetails key={`${place.kind}\\u001f${place.entry}\\u001f${place.child ?? \"\"}`} {...props} styles={styles} inspect={inspect} place={place} form={form} />;\n});\n\n// ============================================================================\n// One row, line or band\n// ============================================================================\n\n/** A cell's value as a field of the spec's type: the payload, `undefined` for a blank or unreadable one — an Option's `some` or `none`. */\nfunction cellValue(cell: SheetCellValue | undefined, optional: boolean): unknown {\n    const held = cell === undefined || cell.type === \"Null\" || cell.type === \"Invalid\" ? undefined : cell.value;\n    return optional ? (held === undefined ? none : some(held)) : held;\n}\n\n/** An action cell as its field's value (#1478): its case and its value, decoded at the case's type — an Option's `some` or `none`. */\nfunction actionValue(meta: SheetColumnMeta, cell: SheetCellValue | undefined, optional: boolean): unknown {\n    const c = cell?.type === \"Action\" ? actionColumnOf(meta)?.cases.get(cell.value.case) : undefined;\n    const held = c === undefined || cell?.type !== \"Action\" ? undefined : variant(c.name, c.decode(cell.value.value));\n    return optional ? (held === undefined ? none : some(held)) : held;\n}\n\n/** A payload as the cell its column holds it in. */\nfunction cellOfPayload(type: EastType, payload: unknown): SheetCellValue {\n    const tag = isTypeEqual(type, Sheet.Types.Link) ? \"Link\" : type.type;\n    return variant(tag, payload) as SheetCellValue;\n}\n\n/** A custom column's text as its field: none (or `undefined`) for no text. */\nfunction textValue(text: string, optional: boolean): unknown {\n    return optional ? (text === \"\" ? none : some(text)) : (text === \"\" ? undefined : text);\n}\n\n/** A patch of one field of a struct, `next` its value: what a column's projection writes as the cells it sets. */\nfunction patchOne(struct: StructType, name: string, next: unknown): Record<string, unknown> {\n    return Object.fromEntries(Object.keys(struct.fields).map((field) => [field, stringEqual(field, name) ? some(next) : none]));\n}\n\n/**\n * A member's line's editor (#1561): its kind's, as the inspector's form gives a column's field its kind's — read only\n * where its column writes nothing, and for a stamped code, a link and a set, which the grid edits — at the cell's\n * value: a quantity in its unit at the row, a date at its level there.\n *\n * @param meta - The column made for the member\n * @param unit - A quantity's unit at the row\n * @param level - A date's level at the row\n * @returns The editor\n */\nfunction memberEditor(meta: SheetColumnMeta, unit: string | undefined, level: \"week\" | \"day\" | \"range\" | \"time\" | undefined): FieldEditorValue {\n    if (!meta.editable) return variant(\"readonly\", null);\n    switch (meta.kind) {\n        case \"text\":\n        case \"title\":\n        case \"custom\": return variant(\"text\", { placeholder: none });\n        // A date at a week, a day or a range is a date alone, as the grid reads it; at the time level, a date and its time.\n        case \"date\": return variant(\"datetime\", { precision: level === \"time\" ? none : some(variant(\"date\", null)) });\n        case \"quantity\":\n        case \"integer\": return variant(\"number\", { unit: unit === undefined ? none : some(unit), step: none, min: none, max: none });\n        // Its members at the row, by its key: a select's offered the column's own.\n        case \"enum\":\n        case \"reference\":\n        case \"person\":\n        case \"cycle\": return variant(\"reference\", { of: meta.key });\n        case \"boolean\":\n        case \"toggle\": return variant(\"checkbox\", null);\n        default: return variant(\"readonly\", null);\n    }\n}\n\n/**\n * A member's line (#1561): the cell a column from data shows for its member, as a field of the form at the column's\n * key — of the value the cell holds, a custom column's its text, an Option where a clear writes none — labelled by\n * the member's header, its column's second line its help.\n *\n * @param meta - The column made for the member\n * @param editor - Its editor at the row ({@link memberEditor})\n * @returns The field's spec\n */\nfunction memberSpec(meta: SheetColumnMeta, editor: FieldEditorValue): FieldSpecValue {\n    const held = meta.kind === \"custom\" ? StringType : fromEastTypeValue(meta.raw.payloadType) as EastType;\n    const optional = takesClear(meta);\n    return {\n        path: [meta.key], label: meta.header, help: meta.sub === undefined ? none : some(meta.sub), group: none,\n        type: toEastTypeValue(optional ? OptionType(held) : held), optional, editor,\n    };\n}\n\n/** Props of {@link TargetDetails}. */\ninterface PlaceProps extends DetailsProps {\n    styles: Styles;\n    inspect: SheetInspect;\n    place: SheetInspectPlace;\n    form: FormValue;\n}\n\n/** Props of {@link TargetView}. */\ninterface TargetProps extends Omit<PlaceProps, \"place\"> {\n    target: SheetInspectTarget;\n}\n\n/** One row, line or band: its target — its draft and what the record holds — read as Details shows it, and drawn. */\nfunction TargetDetails({ place, ...props }: PlaceProps) {\n    const targetAt = props.inspect.targetAt;\n    const target = useMemo(() => targetAt(place.r), [targetAt, place.r]);\n    return target === undefined ? null : <TargetView {...props} target={target} />;\n}\n\n/** One target's form, as {@link useTargetForm} reads it: what `FieldForm` draws it with. */\nexport interface TargetForm {\n    /** The specs at this row: the form's fields, then each member of a column from data a line of its own (#1561). */\n    specs: FieldSpecValue[];\n    /** The column each spec is read and written through, in the specs' order, by key — a member's line its column's; `undefined` for a field the draft holds alone. */\n    columns: (string | undefined)[];\n    /** Each select's members at this row, by the field's path. */\n    options: Record<string, FieldOption[]>;\n    /** The form's value: the draft's fields. */\n    formValue: Record<string, unknown>;\n    /** What the record holds, as the value holds the draft: a field that differs is tinted. */\n    baseline: Record<string, unknown>;\n    /** An edit of a field, written as typing in the grid writes it: why its cell refused it, in the Sheet's words, where it did. */\n    onChange: (path: readonly string[], next: unknown) => string | void;\n    /** The controls the form takes from the grid: a link's or a set's halves, an action's state, a member's label. */\n    renderControl: (spec: FieldSpecValue) => ReactNode | undefined;\n    /** The form's struct. */\n    struct: StructType;\n}\n\n/**\n * The form's specs, values and edits for one target — the payload's form at\n * this row: a quantity's unit and a date's level from its row, a select's\n * members as its column's options rule offers them, a custom column's text\n * by its print and a read-only column's value from its cell, and each edit\n * written as typing in the grid writes it — each one step of the history, or,\n * given `joins`, one step with the edits before it under that key (a phone's\n * cell editor, SH10.1). A host's Details draws its form from it (#1534).\n *\n * Each member of a column from data is a line of its own after the form's\n * fields (#1561), whose field the form leaves out: the member's cell at the\n * column's key, read as the grid reads it at the day, tinted where it differs\n * from the cell the record holds, and written as typing in the cell writes it\n * — through the column's `write`, over the field as drafted so far. An age's\n * shows no line, as a column's age shows no field.\n *\n * @param input - The payload, the words, the columns hidden, the `sheetInspector` styles, the sheet's reads and writes, the target and its form — and the key its edits join under, if they are one step\n * @returns The form, as `FieldForm` draws it\n */\nexport function useTargetForm({ value, words, hidden, styles, inspect, target, form, joins }: Pick<TargetProps, \"value\" | \"words\" | \"hidden\" | \"styles\" | \"inspect\" | \"target\" | \"form\"> & { joins?: string | undefined }): TargetForm {\n    const { m } = words;\n    const button = useRecipe({ key: \"button\" });\n    const r = target.r;\n    // A write, and why its cell refused it in the Sheet's words — what the field says under it.\n    const write = useCallback((writes: readonly SheetInspectWrite[]): string | undefined => {\n        const refused = inspect.write(writes, joins);\n        return refused === undefined ? undefined : m.cellRefused(refused);\n    }, [inspect, joins, m]);\n    const struct = useMemo(() => fromEastTypeValue(form.type) as StructType, [form.type]);\n    const encodePatch = useMemo(() => encodeBeast2For(Sheet.Types.Patch(struct)), [struct]);\n    const registers = useMemo(() => indexRegisters(value.sheet.registers), [value.sheet.registers]);\n    const byPath = useMemo(() => new Map(form.fields.map((f) => [pathKey(f.spec.path), f])), [form.fields]);\n    const metaOf = useCallback((f: FormField): SheetColumnMeta | undefined => {\n        const key = getSomeorUndefined(f.column);\n        return key === undefined ? undefined : inspect.columnAt(r, key);\n    }, [inspect, r]);\n    // The members of the columns from data at this row, each a line of its own (#1561) — but an age's, which shows no field.\n    const members = useMemo(() => value.sheet.columns.flatMap((column): SheetColumnMeta[] => {\n        if (getSomeorUndefined(column.from) === undefined) return [];\n        const meta = inspect.columnAt(r, column.key);\n        return meta === undefined || meta.kind === \"age\" ? [] : [meta];\n    }), [value.sheet.columns, inspect, r]);\n    const memberOf = useMemo(() => new Map(members.map((meta) => [meta.key, meta] as const)), [members]);\n    // A member's line's editor at this row: a quantity's unit, a date's level, its own.\n    const editorOf = useCallback((meta: SheetColumnMeta) => memberEditor(meta, meta.kind === \"quantity\" ? inspect.unitAt(r, meta.key) : undefined,\n        meta.kind === \"date\" ? inspect.levelAt(r, meta.key) : undefined), [inspect, r]);\n\n    // The specs at this row: a select's own members, a quantity's unit, a date's level, a stamped code's owner — and each\n    // member's line.\n    const specs = useMemo(() => [...form.fields.map((f): FieldSpecValue => {\n        const meta = metaOf(f);\n        const editor = f.spec.editor;\n        // Each select its own members at this row, by its path: two fields over one register may be offered different ones.\n        if (editor.type === \"reference\") return { ...f.spec, editor: variant(\"reference\", { of: pathKey(f.spec.path) }) };\n        if (meta?.kind === \"quantity\" && editor.type === \"number\" && editor.value.unit.type === \"none\") {\n            const unit = inspect.unitAt(r, meta.key);\n            return unit === undefined ? f.spec : { ...f.spec, editor: variant(\"number\", { ...editor.value, unit: some(unit) }) };\n        }\n        if (meta?.kind === \"date\" && editor.type === \"datetime\" && editor.value.precision.type === \"none\" && inspect.levelAt(r, meta.key) !== \"time\") {\n            // A date at a week, a day or a range is a date alone, as the grid reads it; at the time level, a date and its time.\n            return { ...f.spec, editor: variant(\"datetime\", { precision: some(variant(\"date\", null)) }) };\n        }\n        if (meta?.kind === \"stamped\" && meta.owner !== undefined && f.spec.help.type === \"none\") return { ...f.spec, help: some(meta.owner) };\n        return f.spec;\n    }), ...members.map((meta) => memberSpec(meta, editorOf(meta)))], [form.fields, metaOf, inspect, r, members, editorOf]);\n    const columns = useMemo(() => [...form.fields.map((f) => getSomeorUndefined(f.column)), ...members.map((meta) => meta.key)], [form.fields, members]);\n\n    // A select's members: its register's, as its column's options rule offers them at this row — a member's line's, its column's.\n    const options = useMemo(() => {\n        const out: Record<string, FieldOption[]> = {};\n        const offered = (register: string, key: string | undefined): FieldOption[] => {\n            const allowed = key !== undefined ? inspect.allowedAt(r, key) : undefined;\n            return (registers.byName.get(register) ?? [])\n                .filter((member) => allowed === undefined || allowed.has(member.key))\n                .map((member) => {\n                    const meta = getSomeorUndefined(member.meta);\n                    return { key: member.key, label: meta === undefined ? member.label : `${member.label} · ${meta}` };\n                });\n        };\n        for (const f of form.fields) {\n            if (f.spec.editor.type !== \"reference\") continue;\n            out[pathKey(f.spec.path)] = offered(f.spec.editor.value.of, getSomeorUndefined(f.column));\n        }\n        for (const meta of members) {\n            if (meta.register !== undefined && editorOf(meta).type === \"reference\") out[pathKey([meta.key])] = offered(meta.register, meta.key);\n        }\n        return out;\n    }, [form.fields, registers, inspect, r, members, editorOf]);\n\n    // The form's value and baseline: the draft's fields — a custom column's text by its print, a read-only column's from its cell.\n    const { formValue, baseline } = useMemo(() => {\n        const current: Record<string, unknown> = { ...(target.value ?? {}) };\n        // A row never applied began from nothing: every field it has is a change.\n        const began: Record<string, unknown> = target.baseline === undefined ? {} : { ...target.baseline };\n        for (const f of form.fields) {\n            const meta = metaOf(f);\n            if (meta === undefined) continue;\n            const name = f.spec.path[0]!;\n            if (meta.kind === \"custom\" && f.spec.editor.type === \"text\") {\n                current[name] = textValue(cellText(inspect.cellAt(r, meta.key), meta, words), f.spec.optional);\n                if (target.baseline === undefined) continue;\n                const was = target.baseline[name];\n                const payload = f.spec.optional ? getSomeorUndefined(was as option<unknown>) : was;\n                const payloadType = fromEastTypeValue(meta.raw.payloadType) as EastType;\n                began[name] = textValue(payload === undefined ? \"\" : cellText(cellOfPayload(payloadType, payload), meta, words), f.spec.optional);\n            } else if (meta.kind === \"action\") {\n                // An action field: its case as its cell holds it, never tinted — the actions write it (#1478).\n                current[name] = actionValue(meta, inspect.cellAt(r, meta.key), f.spec.optional);\n                began[name] = current[name];\n            } else if (f.spec.editor.type === \"readonly\") {\n                // What the grid shows, never tinted.\n                current[name] = cellValue(inspect.cellAt(r, meta.key), f.spec.optional);\n                began[name] = current[name];\n            }\n        }\n        // A member's line: its cell as the grid shows it, against the cell the record holds — as it stands on a row no\n        // gesture has touched, and none on a new row, whose every value is a change.\n        const changes = inspect.changesAt(r);\n        for (const meta of members) {\n            const optional = takesClear(meta);\n            const valueOf = (cell: SheetCellValue | undefined) => (meta.kind === \"custom\" ? textValue(cellText(cell, meta, words), optional) : cellValue(cell, optional));\n            current[meta.key] = valueOf(inspect.cellAt(r, meta.key));\n            if (changes === undefined) began[meta.key] = current[meta.key];\n            else if (!changes.added) began[meta.key] = valueOf(changes.held?.get(meta.key));\n        }\n        return { formValue: current, baseline: began };\n    }, [target, form.fields, metaOf, inspect, r, words, members]);\n\n    const onChange = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        // A member's line: its cell, written as typing in it writes it — the column's `write` over the field as drafted\n        // so far; emptied, the blank cell, which the write refuses where a clear writes nothing.\n        const member = path.length === 1 ? memberOf.get(path[0]!) : undefined;\n        if (member !== undefined) {\n            const held = takesClear(member) ? getSomeorUndefined(next as option<unknown>) : next;\n            if (member.kind === \"custom\") return write([{ r, texts: new Map([[member.key, held === undefined ? \"\" : held as string]]) }]);\n            const blank = held === undefined || (editorOf(member).type === \"text\" && stringEqual(held as string, \"\"));\n            return write([{ r, cells: new Map([[member.key, blank ? NULL_CELL : cellOfPayload(fromEastTypeValue(member.raw.payloadType) as EastType, held)]]) }]);\n        }\n        const f = byPath.get(pathKey(path));\n        if (f === undefined) return undefined;\n        const key = getSomeorUndefined(f.column);\n        const name = path[0]!;\n        if (key !== undefined) {\n            const meta = inspect.columnAt(r, key);\n            if (meta === undefined) return undefined;\n            // A custom column reads its text with its own parse, as typing in its cell does.\n            if (meta.kind === \"custom\") {\n                const text = f.spec.optional ? getSomeorUndefined(next as option<string>) ?? \"\" : next as string;\n                return write([{ r, texts: new Map([[key, text]]) }]);\n            }\n            // Emptied, a field is the blank cell, as typing nothing in the cell is.\n            const held = f.spec.optional ? getSomeorUndefined(next as option<unknown>) : next;\n            if (held === undefined || (f.spec.editor.type === \"text\" && stringEqual(held as string, \"\"))) return write([{ r, cells: new Map([[key, NULL_CELL]]) }]);\n            // The cells a patch of the one field sets, through the column's projection.\n            return write([{ r, cells: form.encode(encodePatch(patchOne(struct, name, next) as never)) }]);\n        }\n        // No column: the field on the draft — a nested field rebuilt under its struct, and a case's value under its\n        // variant while it holds that case (#1549), from its type's default when the field has none yet.\n        if (path.length === 1) return write([{ r, fields: new Map([[name, next]]) }]);\n        const fieldType = (struct.fields as Record<string, EastType>)[name]!;\n        const top = target.value?.[name] ?? defaultValue(fieldType);\n        return write([{ r, fields: new Map([[name, setAt(top, path.slice(1), next)]]) }]);\n    }, [byPath, inspect, r, struct, form, encodePatch, target.value, write, memberOf, editorOf]);\n\n    // A link or set field: its halves as the grid draws them, and Edit in sheet (SB48) — a member's line's too.\n    const renderControl = useCallback((spec: FieldSpecValue): ReactNode | undefined => {\n        const f = byPath.get(pathKey(spec.path));\n        const key = f !== undefined ? getSomeorUndefined(f.column) : spec.path.length === 1 && memberOf.has(spec.path[0]!) ? spec.path[0] : undefined;\n        const meta = key === undefined ? undefined : inspect.columnAt(r, key);\n        // An action field: its state, the cases its row is offered, and a choice's or a form's inline (#1478).\n        if (key !== undefined && meta?.kind === \"action\") return inspect.drawAction(r, key);\n        // A read-only field naming a register member says its label, as its cell does — never its key (F7 of the hand test).\n        if (key !== undefined && meta !== undefined && spec.editor.type === \"readonly\" && namesMember(meta)) {\n            return <Box css={styles.linkCell} data-inspector-member={key}>{inspect.drawCell(r, key)}</Box>;\n        }\n        if (key === undefined || meta === undefined || (meta.kind !== \"link\" && meta.kind !== \"set\")) return undefined;\n        const shown = !hidden.has(key);\n        return (\n            <Box css={styles.link} data-inspector-link={key}>\n                <Box css={styles.linkCell}>{inspect.drawCell(r, key)}</Box>\n                <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={!shown}\n                    title={shown ? undefined : m.inspectorHiddenColumn({ header: meta.header })} data-inspector-edit-in-sheet=\"\"\n                    onClick={() => { inspect.editInSheet(r, key); }}>\n                    {m.inspectorAction({ action: \"editInSheet\", header: undefined, withLines: false })}\n                </chakra.button>\n            </Box>\n        );\n    }, [byPath, inspect, r, hidden, styles, button, m, memberOf]);\n\n    return { specs, columns, options, formValue, baseline, onChange, renderControl, struct };\n}\n\n/** One issue of a target, as Details lists it. */\nexport interface TargetIssue {\n    /** Its place among the batch's issues: the list's key. */\n    key: string;\n    /** The field it names, by its label — a member's cell of a column from data by its column's header — else its name; `undefined` for an issue of the whole row. */\n    field: string | undefined;\n    /** The field's name, as the form keys it; `undefined` for an issue of the whole row. */\n    name: string | undefined;\n    /** What is wrong, in the sheet's words. */\n    text: string;\n    /** A field still missing, or one refused; or a stored row's number outside its bounds, which warns (#1585). */\n    kind: \"incomplete\" | \"invalid\" | \"warning\";\n}\n\n/**\n * A form's fields' words by their names, as an issue names a field: a field's own spec's label — a variant's, never\n * one of its cases' fields' (#1549) — else, under a nested struct's name, the last of its fields'; and a nested field —\n * a case's among them — by its path joined by \".\", as a number its bounds don't hold is named (#1585).\n *\n * @param fields - The form's fields\n * @returns Each name and its words, as a `Map` takes them: a field's own after its nested fields', which it overrides\n */\nfunction labelsOf(fields: readonly FormField[]): (readonly [string, string])[] {\n    const own = (f: FormField) => f.spec.path.length === 1;\n    return [...fields.filter((f) => !own(f)), ...fields.filter(own)].flatMap((f) => (own(f) ? [[f.spec.path[0]!, f.spec.label] as const]\n        : [[f.spec.path[0]!, f.spec.label] as const, [f.spec.path.join(\".\"), f.spec.label] as const]));\n}\n\n/**\n * A target's issues, by field: each its field's label — else the header of the column it names, as one of a column\n * from data's cells is named by its column key, which no form field holds — else its name, and its text in the sheet's\n * words.\n *\n * @param target - The row, line or band\n * @param inspect - The sheet's reads: the batch's issues, and the columns at the target's row\n * @param form - The target's form: its fields' labels\n * @param words - The sheet's words\n * @returns Its issues, in the batch's order\n */\nexport function targetIssues(target: SheetInspectTarget, inspect: SheetInspect, form: FormValue, words: SheetWords): TargetIssue[] {\n    const labels = new Map(labelsOf(form.fields));\n    const out: TargetIssue[] = [];\n    inspect.issues.forEach((issue, i) => {\n        if (!stringEqual(issue.entry, target.entry)) return;\n        const row = getSomeorUndefined(issue.row);\n        // A line's issues are addressed to its place in the group; a row's and a band's to none.\n        if (target.index === undefined ? row !== undefined : row === undefined || Number(row) !== target.index) return;\n        const field = getSomeorUndefined(issue.field);\n        const label = field === undefined ? undefined : labels.get(field) ?? inspect.columnAt(target.r, field)?.header ?? field;\n        out.push({ key: `${i}`, field: label, name: field, text: issueText(issue.message, words), kind: inspect.kindOf(issue) });\n    });\n    return out;\n}\n\n/**\n * A target's issues by the field each names, as its form keys it, each field with what its issues say of it, in their\n * order: what a host that washes the fields its issues name hands the form (`FieldForm`'s `issues`), which then says\n * each field's words under it (ruled 13 Nov 2026) — the Record's Details (IN3). An issue of the whole row names none.\n *\n * @param issues - The target's issues ({@link targetIssues})\n * @returns Each field they name, and the words under it\n */\nexport function issuesByField(issues: readonly TargetIssue[]): ReadonlyMap<string, readonly string[]> {\n    const out = new Map<string, string[]>();\n    for (const issue of issues) {\n        if (issue.name === undefined) continue;\n        const said = out.get(issue.name);\n        if (said === undefined) out.set(issue.name, [issue.text]);\n        else said.push(issue.text);\n    }\n    return out;\n}\n\n/**\n * The author's own Details for a complete row (SB58): what their function returns for the row as bytes, its edit\n * written back as one transaction — every field its columns write through them at once, a field with none on the\n * draft. `undefined` for a band, for a row still missing a field or holding one unreadable, for a pane with no Details\n * of the author's, and where their function fails: the form shows there. A host's Details draws them too (#1534).\n *\n * @param input - The payload, the pane, the sheet's reads and writes, the target, its form and the form's struct\n * @returns What the author's function returns, drawn in the form's place\n */\nexport function useAuthorDetails({ value, pane, inspect, target, form, struct }: {\n    value: SheetInspectorValue; pane: PaneValue; inspect: SheetInspect; target: SheetInspectTarget; form: FormValue; struct: StructType;\n}): AuthorDetails | undefined {\n    const band = target.kind === \"band\";\n    const idField = getSomeorUndefined(value.sheet.editing.idField);\n    const author = getSomeorUndefined(pane.custom);\n    const codec = useMemo(() => ({ encode: encodeBeast2For(struct), decode: decodeBeast2For(struct), patch: encodeBeast2For(Sheet.Types.Patch(struct)) }), [struct]);\n    const equals = useMemo(() => new Map(Object.entries(struct.fields as Record<string, EastType>).map(([k, t]) => [k, equalFor(t)])), [struct]);\n    const rowEqual = useMemo(() => {\n        const equal = equalFor(struct);\n        return (a: unknown, b: unknown) => (a === undefined || b === undefined ? a === b : equal(a as never, b as never));\n    }, [struct]);\n    // The row held by its data: a gesture elsewhere never calls the author's function again.\n    const complete = useDataStable(target.complete, rowEqual);\n    const update = useCallback((bytes: Uint8Array): null => {\n        if (complete === undefined) return null;\n        const edited = codec.decode(bytes) as Record<string, unknown>;\n        const before = complete as Record<string, unknown>;\n        const columns = new Set(form.columns);\n        const readonly = new Set(form.readonly);\n        const fields = new Map<string, unknown>();\n        let throughColumns = false;\n        for (const [name, same] of equals) {\n            // Its identity is the header's, and a read-only column's field the grid's: neither changes here.\n            if ((idField !== undefined && stringEqual(name, idField)) || readonly.has(name) || same(edited[name], before[name])) continue;\n            if (columns.has(name)) throughColumns = true;\n            else fields.set(name, edited[name]);\n        }\n        // Every field its columns write, through them at once — a link's two halves one cell; a cell that holds its value already writes nothing.\n        const cells = throughColumns\n            ? form.encode(codec.patch(Object.fromEntries([...equals.keys()].map((name) => [name, columns.has(name) ? some(edited[name]) : none])) as never))\n            : undefined;\n        const write: SheetInspectWrite = { r: target.r, cells, fields };\n        inspect.write([write]);\n        return null;\n    }, [complete, codec, equals, form, idField, inspect, target.r]);\n    return useMemo(() => {\n        if (band || author === undefined || complete === undefined) return undefined;\n        try {\n            return author(codec.encode(complete as Record<string, unknown>), update);\n        } catch (err) {\n            console.error(\"[Sheet] the inspector failed; the form shows instead:\", err);\n            return undefined;\n        }\n    }, [band, author, complete, codec, update]);\n}\n\n/** One row, line or band: its head, its issues, its fields, its sub rows and its gestures (SB47, SB49). */\nfunction TargetView(props: TargetProps) {\n    const { value, keys, words, styles, inspect, target, form, noun } = props;\n    const { m } = words;\n    const button = useRecipe({ key: \"button\" });\n    const edit = useTargetForm(props);\n    const band = target.kind === \"band\";\n    const issues = targetIssues(target, inspect, form, words);\n    // A bound the row breaks (#1585), said in the tone its Save stands in: as stored it warns; its change held, an error.\n    const breaches = issues.some((issue) => issue.kind !== \"warning\") ? \"error\" : \"warn\";\n    const isNew = target.baseline === undefined && target.value !== undefined;\n    const idField = getSomeorUndefined(value.sheet.editing.idField);\n    // Its id: a line's own where it has one (beside loose rows), else its entry's.\n    const ownId = target.kind === \"line\" && idField !== undefined ? target.value?.[idField] : undefined;\n    // The author's own Details for a complete row (SB58): its row as bytes, its edit back as one transaction.\n    const own = useAuthorDetails({ value, pane: props.pane, inspect, target, form, struct: edit.struct });\n\n    const subRows = target.subRows;\n    const can = inspect.can;\n    // A sheet that takes edits keeps its chip's row while there is none (#1584): the first edit's chip moves nothing.\n    const writes = !(getSomeorUndefined(value.sheet.readOnly) ?? false) && value.sheet.editing.onApply.type === \"some\";\n    // In a phone's drawer (SH12): its head, each field a section of its own at touch size, and its gestures at 44.\n    const phone = useContext(FrameDrawer);\n    if (phone && own === undefined && target.value !== undefined) {\n        return <PhoneTarget {...props} edit={edit} issues={issues} breaches={breaches} isNew={isNew} ownId={ownId as string | undefined} writes={writes} />;\n    }\n    return (\n        <Box css={styles.root} data-sheet-inspector={target.kind}>\n            <Box css={styles.head}>\n                <Box css={styles.eyebrow} data-inspector-what=\"\">{whatOf(target, words, noun)}</Box>\n                <Box css={styles.name} data-inspector-id=\"\">{ownId !== undefined ? ownId as string : target.entry}</Box>\n                <Box css={styles.marks} data-writes={writes ? \"\" : undefined}>\n                    {isNew ? <Box as=\"span\" css={styles.chip} data-state=\"new\">{m.inspectorChip({ state: \"new\" })}</Box>\n                        : target.presentation.pending ? <Box as=\"span\" css={styles.chip} data-state=\"pending\">{m.inspectorChip({ state: \"pending\" })}</Box>\n                            : null}\n                    {target.owned && (\n                        <Box as=\"span\" css={styles.lock} role=\"img\" aria-label={m.inspectorOwned()} title={m.inspectorOwned()} data-inspector-lock=\"\">\n                            <FontAwesomeIcon icon={faLock} />\n                        </Box>\n                    )}\n                    {band && target.group !== undefined && (\n                        <Box as=\"span\" css={styles.lock} data-inspector-lines=\"\">\n                            {m.inspectorSection({ section: \"lines\", n: target.group.lines, count: words.number(target.group.lines) })}\n                        </Box>\n                    )}\n                </Box>\n            </Box>\n            {issues.length > 0 && (\n                <Box css={styles.issues} data-inspector-issues=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"issues\", n: issues.length, count: words.number(issues.length) })}</Box>\n                    {issues.map((issue) => (\n                        <Box key={issue.key} css={styles.issue}>\n                            {issue.field !== undefined && <Box as=\"span\" css={styles.issueField}>{issue.field}</Box>}\n                            <Box as=\"span\" css={styles.issueText} data-kind={issue.kind}>{issue.text}</Box>\n                        </Box>\n                    ))}\n                </Box>\n            )}\n            <Box css={styles.fields} data-inspector-fields={own !== undefined ? \"custom\" : \"form\"}>\n                {target.value === undefined\n                    ? <Box css={styles.emptyHint}>{m.inspectorReading()}</Box>\n                    : own !== undefined\n                        ? <EastChakraComponent value={own} storageKey={`${keys.frame}.inspector`} />\n                        : <FieldForm specs={edit.specs} value={edit.formValue} baseline={edit.baseline} options={edit.options}\n                            onChange={edit.onChange} takesUnset readOnly={!inspect.writable} renderControl={edit.renderControl} breaches={breaches} />}\n            </Box>\n            {subRows.length > 0 && (\n                <Box css={styles.subRows} data-inspector-sub-rows=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"subRows\", n: subRows.length, count: words.number(subRows.length) })}</Box>\n                    {subRows.map((sub, i) => (\n                        <Box key={`${sub.id}\\u001f${i}`} css={styles.subRow} data-inspector-sub-row=\"\">\n                            {sub.code !== \"\" && <Box as=\"span\" css={styles.subRowCode}>{sub.code}</Box>}\n                            <Box as=\"span\" css={styles.subRowName}>{sub.name}</Box>\n                            {(sub.chips.length > 0 || sub.facets.length > 0) && (\n                                <Box as=\"span\" css={styles.subRowFacts}>\n                                    {[...sub.chips, ...sub.facets.map((facet) => `${facet.label} ${facet.value}`)].join(\" · \")}\n                                </Box>\n                            )}\n                        </Box>\n                    ))}\n                </Box>\n            )}\n            <Box css={styles.actions} data-inspector-actions=\"\">\n                {band && (\n                    <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={!can.insertRows}\n                        data-inspector-action=\"addLine\" onClick={() => inspect.addLine(target.r)}>\n                        {m.inspectorAction({ action: \"addLine\", header: undefined, withLines: false })}\n                    </chakra.button>\n                )}\n                <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={band ? !can.insertGroups : !can.insertRows}\n                    data-inspector-action=\"duplicate\" onClick={() => inspect.duplicate([target.r])}>\n                    {m.inspectorAction({ action: \"duplicate\", header: undefined, withLines: band })}\n                </chakra.button>\n                <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={band ? !can.removeGroups : !can.removeRows}\n                    data-inspector-action=\"delete\" onClick={() => { if (band) inspect.removeGroup(target.r); else inspect.remove(target.r, target.r); }}>\n                    {m.inspectorAction({ action: \"delete\", header: undefined, withLines: band })}\n                </chakra.button>\n            </Box>\n        </Box>\n    );\n}\n\n/** Props of {@link PhoneTarget}. */\ninterface PhoneTargetProps extends TargetProps {\n    edit: ReturnType<typeof useTargetForm>;\n    issues: TargetIssue[];\n    /** The tone a bound the row breaks is said in (#1585): a warning as stored, an error once its change holds Save. */\n    breaches: \"warn\" | \"error\";\n    isNew: boolean;\n    ownId: string | undefined;\n    /** Whether the sheet takes edits: its head keeps its chip's row. */\n    writes: boolean;\n}\n\n/**\n * One row, line or band in a phone's drawer (`Mobile Sheet Spec.md` SH12, the\n * designer's `WorkOrdersPhone`): its head — the eyebrow naming its line, its\n * action's name and its entry, then its title (the action column's, else its\n * id) and a draft's chip — its issues, each field it edits a section of its\n * own (its label over its name, then its control: a number's stepper and a\n * time's field as the cell editor draws them, an action's state and cases, and\n * every other kind its form's own input at touch size), its sub rows, and its\n * gestures as Default 44 buttons.\n */\nfunction PhoneTarget({ value, words, hidden, styles, inspect, target, form, noun, edit, issues, breaches, isNew, ownId, writes }: PhoneTargetProps) {\n    const { m } = words;\n    const button = useRecipe({ key: \"button\" });\n    const bar = useSlotStyles(\"sheetAction\");\n    const r = target.r;\n    const band = target.kind === \"band\";\n    const byPath = useMemo(() => new Map(form.fields.map((f) => [pathKey(f.spec.path), f])), [form.fields]);\n    // Its action column's name and title — `step 20`, `Weld frame` — as the grid's action cell reads them.\n    const action = form.fields.map((f) => getSomeorUndefined(f.column)).map((key) => (key === undefined ? undefined : actionColumnOf(inspect.columnAt(r, key))))\n        .find((c) => c !== undefined);\n    const ruleText = (key: string | undefined): string | undefined => {\n        const cell = key === undefined ? undefined : inspect.cellAt(r, key);\n        return cell?.type === \"String\" && cell.value !== \"\" ? cell.value : undefined;\n    };\n    const actionName = ruleText(action?.name);\n    const title = ruleText(action?.title);\n    const id = ownId ?? target.entry;\n    const where = m.inspectorPhoneWhat({ what: target.kind, number: words.number(target.number), noun });\n    const eyebrow = [where, actionName, stringEqual(id, title ?? \"\") ? undefined : id].filter((t): t is string => t !== undefined && t !== \"\").join(\" · \");\n    const chip = isNew ? \"new\" : target.presentation.pending ? \"pending\" : undefined;\n    // The fields it edits: every field but those the grid alone shows — an action's, which its cases write, among them.\n    const specs = useMemo(() => edit.specs.filter((spec) => {\n        if (spec.editor.type !== \"readonly\") return true;\n        const key = getSomeorUndefined(byPath.get(pathKey(spec.path))?.column ?? none);\n        return key !== undefined && inspect.columnAt(r, key)?.kind === \"action\";\n    }), [edit.specs, byPath, inspect, r]);\n    // Each field a section of its own: a variant's with the fields of its cases, which its form draws in a block under\n    // its choice (#1549) — the fields after it at paths through it.\n    const sections = useMemo(() => {\n        const out: FieldSpecValue[][] = [];\n        for (const spec of specs) {\n            const head = out[out.length - 1]?.[0];\n            if (head !== undefined && spec.path.length > head.path.length && pathEqual(spec.path.slice(0, head.path.length), head.path)) out[out.length - 1]!.push(spec);\n            else out.push([spec]);\n        }\n        return out;\n    }, [specs]);\n    const can = inspect.can;\n    return (\n        <Box css={styles.root} data-sheet-inspector={target.kind} data-phone=\"\">\n            <Box css={styles.phoneHead} data-writes={writes ? \"\" : undefined}>\n                <Box as=\"span\" css={styles.phoneEyebrow} data-inspector-what=\"\">{eyebrow}</Box>\n                <Box as=\"span\" css={styles.phoneName} data-inspector-id=\"\">{title ?? id}</Box>\n                {chip !== undefined && <Box as=\"span\" css={styles.phoneChip} data-state={chip}>{m.inspectorChip({ state: chip })}</Box>}\n                {target.owned && (\n                    <Box as=\"span\" css={styles.lock} data-inspector-lock=\"\"><FontAwesomeIcon icon={faLock} aria-hidden />{m.inspectorOwned()}</Box>\n                )}\n            </Box>\n            {issues.length > 0 && (\n                <Box css={styles.issues} data-inspector-issues=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"issues\", n: issues.length, count: words.number(issues.length) })}</Box>\n                    {issues.map((issue) => (\n                        <Box key={issue.key} css={styles.issue}>\n                            {issue.field !== undefined && <Box as=\"span\" css={styles.issueField}>{issue.field}</Box>}\n                            <Box as=\"span\" css={styles.issueText} data-kind={issue.kind}>{issue.text}</Box>\n                        </Box>\n                    ))}\n                </Box>\n            )}\n            <Box data-inspector-fields=\"phone\">\n                {sections.map((section) => {\n                    const spec = section[0]!;\n                    const f = byPath.get(pathKey(spec.path));\n                    const key = f === undefined ? undefined : getSomeorUndefined(f.column);\n                    return <PhoneField key={pathKey(spec.path)} words={words} hidden={hidden} styles={styles} bar={bar} inspect={inspect} r={r} columnKey={key} spec={spec} section={section} edit={edit} value={value}\n                        breaches={breaches} />;\n                })}\n            </Box>\n            {target.subRows.length > 0 && (\n                <Box css={styles.subRows} data-inspector-sub-rows=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"subRows\", n: target.subRows.length, count: words.number(target.subRows.length) })}</Box>\n                    {target.subRows.map((sub, i) => (\n                        <Box key={`${sub.id}\\u001f${i}`} css={styles.subRow} data-inspector-sub-row=\"\">\n                            {sub.code !== \"\" && <Box as=\"span\" css={styles.subRowCode}>{sub.code}</Box>}\n                            <Box as=\"span\" css={styles.subRowName}>{sub.name}</Box>\n                        </Box>\n                    ))}\n                </Box>\n            )}\n            <Box css={styles.phoneActions} data-inspector-actions=\"\">\n                {band && (\n                    <chakra.button type=\"button\" css={[button({ variant: \"outline\", size: \"md\" }), styles.phoneButton]} disabled={!can.insertRows}\n                        data-inspector-action=\"addLine\" onClick={() => inspect.addLine(r)}>\n                        {m.inspectorAction({ action: \"addLine\", header: undefined, withLines: false })}\n                    </chakra.button>\n                )}\n                <chakra.button type=\"button\" css={[button({ variant: \"outline\", size: \"md\" }), styles.phoneButton]} disabled={band ? !can.insertGroups : !can.insertRows}\n                    data-inspector-action=\"duplicate\" onClick={() => inspect.duplicate([r])}>\n                    {m.inspectorAction({ action: \"duplicate\", header: undefined, withLines: band })}\n                </chakra.button>\n                <chakra.button type=\"button\" css={[button({ variant: \"outline\", size: \"md\" }), styles.phoneButton]} disabled={band ? !can.removeGroups : !can.removeRows}\n                    data-inspector-action=\"delete\" onClick={() => { if (band) inspect.removeGroup(r); else inspect.remove(r, r); }}>\n                    {m.inspectorAction({ action: \"delete\", header: undefined, withLines: band })}\n                </chakra.button>\n            </Box>\n        </Box>\n    );\n}\n\n/** Props of {@link PhoneField}. */\ninterface PhoneFieldProps {\n    value: SheetInspectorValue;\n    words: SheetWords;\n    hidden: ReadonlySet<string>;\n    styles: Styles;\n    bar: Styles;\n    inspect: SheetInspect;\n    r: number;\n    columnKey: string | undefined;\n    spec: FieldSpecValue;\n    /** The field's specs: its own, then — a variant's — the fields of its cases, drawn in its block (#1549). */\n    section: readonly FieldSpecValue[];\n    edit: ReturnType<typeof useTargetForm>;\n    /** The tone a bound the row breaks is said in (#1585). */\n    breaches: \"warn\" | \"error\";\n}\n\n/** One field of a phone's Details (SH12): a section of its own, its label over its name, then its control at touch size. */\nfunction PhoneField({ words, styles, bar, inspect, r, columnKey, spec, section, edit, breaches }: PhoneFieldProps) {\n    const dirty = useDirty(spec, edit.formValue, edit.baseline);\n    const meta = columnKey === undefined ? undefined : inspect.columnAt(r, columnKey);\n    const header = meta?.header ?? spec.label;\n    const touch = columnKey === undefined ? undefined : touchKind(inspect, r, columnKey, spec);\n    return (\n        <Box css={styles.phoneField} data-inspector-field={pathKey(spec.path)}>\n            <Box css={styles.phoneFieldHead}>\n                <Box as=\"span\" css={styles.phoneLabel}>\n                    {spec.label}\n                    {/* An action's state stands where its name would, at the row's end. */}\n                    {meta?.kind !== \"action\" && <Box as=\"span\" css={styles.phoneKey}>{spec.path.join(\".\")}</Box>}\n                </Box>\n            </Box>\n            {columnKey !== undefined && meta?.kind === \"action\"\n                ? inspect.drawAction(r, columnKey)\n                : columnKey !== undefined && touch !== undefined\n                    ? <TouchControl inspect={inspect} words={words} bar={bar} r={r} columnKey={columnKey} spec={spec} header={header} dirty={dirty} joins={undefined}\n                        breaches={breaches} />\n                    : <FieldForm specs={section} value={edit.formValue} baseline={edit.baseline} options={edit.options}\n                        onChange={edit.onChange} takesUnset readOnly={!inspect.writable} renderControl={edit.renderControl} breaches={breaches} />}\n        </Box>\n    );\n}\n\n// ============================================================================\n// A phone's cell editor (`Mobile Sheet Spec.md` SH10, R9, R10)\n// ============================================================================\n\n/** The runs of a phone's cell editor: each editor opened is one, its edits one step of the history (SH10.1). */\nlet cellEditorRuns = 0;\n\nconst printInteger = printFor(IntegerType);\nconst printFloat = printFor(FloatType);\nconst compareIntegers = compareFor(IntegerType);\nconst compareFloats = compareFor(FloatType);\n\n/**\n * A phone's cell editor for a sheet given an inspector (SH10, R9): what the\n * Sheet's bottom container shows for the ring's cell — the pane's form at\n * touch size, the field the cell's column writes — or `undefined` where the\n * sheet has no inspector, or its form no field for that column, and the\n * docked strip shows.\n *\n * @param value - The payload: its inspector's forms\n * @param words - The sheet's words\n * @param hidden - The columns this viewer hides\n * @returns The editor for a cell, as `SheetHost.cellEditor` takes it\n */\nexport function sheetCellEditor(value: SheetInspectorValue, words: SheetWords, hidden: ReadonlySet<string>): (at: SheetCellEditorAt) => ReactNode | undefined {\n    const pane = getSomeorUndefined(value.inspector);\n    const noun = nounOf(value, words);\n    return (at) => {\n        if (pane === undefined) return undefined;\n        const form = at.band ? getSomeorUndefined(pane.forms.group) : pane.forms.row;\n        const field = form?.fields.find((f) => { const key = getSomeorUndefined(f.column); return key !== undefined && stringEqual(key, at.columnKey); });\n        if (form === undefined || field === undefined || field.spec.editor.type === \"readonly\") return undefined;\n        // Its row's by its id, never its place: the rows moving under it — a window landing above, another session's\n        // row — never draw it afresh, and what is typed in it stays.\n        return <SheetCellEditor key={`${at.id}\\u001f${at.columnKey}`} value={value} words={words} hidden={hidden} at={at} form={form} field={field} noun={noun} />;\n    };\n}\n\n/** Props of {@link SheetCellEditor}. */\ninterface CellEditorProps {\n    value: SheetInspectorValue;\n    words: SheetWords;\n    hidden: ReadonlySet<string>;\n    at: SheetCellEditorAt;\n    form: FormValue;\n    field: FormField;\n    noun: string;\n}\n\n/**\n * A phone's cell editor (SH10): in the bottom container, under its head — the\n * eyebrow naming the column and the row, and ⌄ close — the field the cell's\n * column writes. A number is − · the field · its unit · + (digits only), a\n * time of day its `hh:mm` field, filled as digits are typed, and Clear; every\n * other kind its form's own input at touch size (R9). Its edits while it stays\n * open are one step of the history (SH10.1), each written as the inspector\n * writes it.\n */\nfunction SheetCellEditor({ value, words, hidden, at, form, field, noun }: CellEditorProps) {\n    const inspect = useSheetInspect();\n    const styles = useSlotRecipe({ key: \"sheetInspector\" })() as Styles;\n    const bar = useSlotStyles(\"sheetAction\");\n    const { m } = words;\n    const targetAt = inspect.targetAt;\n    const target = useMemo(() => targetAt(at.r), [targetAt, at.r]);\n    const meta = inspect.columnAt(at.r, at.columnKey);\n    const header = meta?.header ?? field.spec.label;\n    const head = (\n        <chakra.div css={bar.barHead}>\n            <chakra.span css={bar.barEyebrow} data-cell-editor-eyebrow=\"\">\n                {target === undefined && at.name === undefined ? header : m.cellEditorEyebrow({ header, what: at.name ?? whatOf(target!, words, noun) })}\n            </chakra.span>\n            <chakra.button type=\"button\" css={bar.barClose} aria-label={m.cellEditorClose()} data-cell-editor-close=\"\" onClick={at.onClose}>\n                <FontAwesomeIcon icon={faChevronDown} aria-hidden />\n            </chakra.button>\n        </chakra.div>\n    );\n    return (\n        <chakra.div css={bar.bar} data-sheet-cell-editor={at.columnKey} role=\"group\" aria-label={header}>\n            {head}\n            {target === undefined || target.value === undefined\n                ? <chakra.span css={bar.cellHelp}>{m.inspectorReading()}</chakra.span>\n                : <CellEditorField value={value} words={words} hidden={hidden} styles={styles} bar={bar} inspect={inspect} target={target} form={form} field={field} at={at} header={header} />}\n        </chakra.div>\n    );\n}\n\n/** Props of {@link CellEditorField}. */\ninterface CellEditorFieldProps {\n    value: SheetInspectorValue;\n    words: SheetWords;\n    hidden: ReadonlySet<string>;\n    styles: Styles;\n    bar: Styles;\n    inspect: SheetInspect;\n    target: SheetInspectTarget;\n    form: FormValue;\n    field: FormField;\n    at: SheetCellEditorAt;\n    header: string;\n}\n\n/** The field a phone's cell editor holds — see {@link SheetCellEditor}. */\nfunction CellEditorField({ value, words, hidden, styles, bar, inspect, target, form, field, at, header }: CellEditorFieldProps) {\n    // One run while the editor is open: its edits are one step (SH10.1).\n    const [joins] = useState(() => `cellEditor:${++cellEditorRuns}`);\n    const edit = useTargetForm({ value, words, hidden, styles, inspect, target, form, joins });\n    const spec = edit.specs.find((s) => stringEqual(pathKey(s.path), pathKey(field.spec.path))) ?? field.spec;\n    const specs = useMemo(() => [spec], [spec]);\n    const writable = inspect.writable;\n    const dirty = useDirty(spec, edit.formValue, edit.baseline);\n    // A bound the row breaks (#1585), said in the tone its Save stands in, as Details says it.\n    const breaches = targetIssues(target, inspect, form, words).some((issue) => issue.kind !== \"warning\") ? \"error\" : \"warn\";\n    if (touchKind(inspect, at.r, at.columnKey, spec) !== undefined) {\n        return <TouchControl inspect={inspect} words={words} bar={bar} r={at.r} columnKey={at.columnKey} spec={spec} header={header} dirty={dirty} joins={joins}\n            breaches={breaches} />;\n    }\n    // Every other kind (R9): the form's own input, at touch size.\n    return (\n        <chakra.div css={bar.cellForm} data-cell-form=\"\">\n            <FieldForm specs={specs} value={edit.formValue} baseline={edit.baseline} options={edit.options}\n                onChange={edit.onChange} readOnly={!writable} renderControl={edit.renderControl} live breaches={breaches} />\n        </chakra.div>\n    );\n}\n\n/** Whether a field's value as the drafts hold it differs from what the record holds: the field tinted. */\nfunction useDirty(spec: FieldSpecValue, formValue: Record<string, unknown>, baseline: Record<string, unknown>): boolean {\n    const fieldType = useMemo(() => fromEastTypeValue(spec.type) as EastType, [spec.type]);\n    const same = useMemo(() => equalFor(fieldType), [fieldType]);\n    const name = spec.path[0]!;\n    const now = formValue[name];\n    const was = baseline[name];\n    return now === undefined || was === undefined ? now !== was : !same(now as never, was as never);\n}\n\n/** Which touch control a field takes at a row (SH10): a number's stepper, a time of day's field, or none. */\nfunction touchKind(inspect: SheetInspect, r: number, columnKey: string, spec: FieldSpecValue): \"number\" | \"time\" | undefined {\n    const meta = inspect.columnAt(r, columnKey);\n    if ((meta?.kind === \"integer\" || meta?.kind === \"quantity\") && spec.editor.type === \"number\") return \"number\";\n    if (meta?.kind === \"date\" && inspect.levelAt(r, columnKey) === \"time\") return \"time\";\n    return undefined;\n}\n\n/** Props of {@link TouchControl}. */\ninterface TouchControlProps {\n    inspect: SheetInspect;\n    words: SheetWords;\n    bar: Styles;\n    r: number;\n    columnKey: string;\n    spec: FieldSpecValue;\n    header: string;\n    dirty: boolean;\n    /** The key a run of edits joins under as one step, if it is one (SH10.1). */\n    joins: string | undefined;\n    /** The tone a bound the row breaks is said in (#1585): a warning as stored, an error once its change holds Save. */\n    breaches: \"warn\" | \"error\";\n}\n\n/**\n * A field's touch control, as a phone's cell editor and a phone's Details draw\n * it (SH10, SH12): a number − · the field · its unit · + (digits only), and\n * under it its help, its bounds as the form words them — a value they don't\n * hold said there once, as the form says it, in the tone the row's Save stands\n * in, the field's edge with it (#1585); a time of day its `hh:mm` field,\n * filled as digits are typed, and Clear — or `null` for every other kind,\n * which its form's own input edits.\n */\nfunction TouchControl({ inspect, words, bar, r, columnKey, spec, header, dirty, joins, breaches }: TouchControlProps) {\n    const { m } = words;\n    const kind = touchKind(inspect, r, columnKey, spec);\n    const cell = inspect.cellAt(r, columnKey);\n    const writable = inspect.writable;\n    const fieldType = useMemo(() => fromEastTypeValue(spec.type) as EastType, [spec.type]);\n    const writeCell = useCallback((next: SheetCellValue) => inspect.write([{ r, cells: new Map([[columnKey, next]]) }], joins), [inspect, r, columnKey, joins]);\n    const writeText = useCallback((text: string) => inspect.write([{ r, texts: new Map([[columnKey, text]]) }], joins), [inspect, r, columnKey, joins]);\n    // A number (SH10): − · the field · its unit · +, digits only, held to its editor's bounds.\n    if (kind === \"number\" && spec.editor.type === \"number\") {\n        const number = spec.editor.value;\n        // An Option's input edits its value's type, as the form's does.\n        const inner = spec.optional && fieldType.type === \"Variant\" ? (fieldType.cases as Record<string, EastType>)[\"some\"]! : fieldType;\n        const integer = isTypeEqual(inner, IntegerType);\n        const held = cell?.type === \"Integer\" || cell?.type === \"Float\" ? cell.value : undefined;\n        const unit = getSomeorUndefined(number.unit) ?? inspect.unitAt(r, columnKey);\n        const min = getSomeorUndefined(number.min);\n        const max = getSomeorUndefined(number.max);\n        const step = getSomeorUndefined(number.step) ?? 1;\n        const stepBy = (more: boolean) => {\n            if (integer) {\n                const by = BigInt(Math.max(1, Math.round(step)));\n                let n = ((held as bigint | undefined) ?? 0n) + (more ? by : -by);\n                if (min !== undefined && compareIntegers(n, BigInt(Math.ceil(min))) < 0) n = BigInt(Math.ceil(min));\n                if (max !== undefined && compareIntegers(n, BigInt(Math.floor(max))) > 0) n = BigInt(Math.floor(max));\n                writeCell(variant(\"Integer\", n));\n                return;\n            }\n            let f = ((held as number | undefined) ?? 0) + (more ? step : -step);\n            if (min !== undefined && compareFloats(f, min) < 0) f = min;\n            if (max !== undefined && compareFloats(f, max) > 0) f = max;\n            writeCell(variant(\"Float\", f));\n        };\n        const printed = held === undefined ? \"\" : integer ? printInteger(held as bigint) : printFloat(held as number);\n        // Its help, and its bounds as the form words them (`Min 0`).\n        const bounds = min === undefined && max === undefined ? undefined : fieldFormMessages.numberHelp({\n            min: min === undefined ? undefined : words.number(min), max: max === undefined ? undefined : words.number(max), unit: undefined, step: undefined,\n        });\n        const help = [bounds, getSomeorUndefined(spec.help)].filter((part): part is string => part !== undefined && part !== \"\");\n        // A value its bounds don't hold: its help line, which names them, in the row's tone, as Details says it (#1585).\n        const breach = held === undefined ? undefined\n            : fieldBreaches([spec], spec.path.reduceRight<unknown>((inner, name) => ({ [name]: inner }), spec.optional ? some(held) : held))[0];\n        const tone = breach === undefined ? undefined : breaches;\n        return (\n            <>\n                <chakra.div css={bar.cellLine}>\n                    <chakra.button type=\"button\" css={bar.cellStep} aria-label={m.cellEditorStep({ header, more: false })} disabled={!writable} data-cell-step=\"fewer\" onClick={() => stepBy(false)}>\n                        <FontAwesomeIcon icon={faMinus} aria-hidden />\n                    </chakra.button>\n                    <TypedInput css={bar.cellInput} printed={printed} dirty={dirty} label={header} disabled={!writable} inputMode={integer ? \"numeric\" : \"decimal\"}\n                        accept={(typed) => (integer ? typed.replace(/[^\\d-]/g, \"\") : typed.replace(/[^\\d.,-]/g, \"\"))} onTyped={writeText} breach={tone} />\n                    {unit !== undefined && <chakra.span css={bar.cellUnit} data-cell-unit=\"\">{unit}</chakra.span>}\n                    <chakra.button type=\"button\" css={bar.cellStep} aria-label={m.cellEditorStep({ header, more: true })} disabled={!writable} data-cell-step=\"more\" onClick={() => stepBy(true)}>\n                        <FontAwesomeIcon icon={faPlus} aria-hidden />\n                    </chakra.button>\n                </chakra.div>\n                {help.length > 0 && <chakra.span css={bar.cellHelp} data-cell-help=\"\" data-breach={tone}>{help.join(\" · \")}</chakra.span>}\n            </>\n        );\n    }\n    // A time of day (SH10): its `hh:mm`, filled as digits are typed, on the day the cell holds — today, where it holds none — and Clear.\n    if (kind === \"time\") {\n        const held = cell?.type === \"DateTime\" ? cell.value : undefined;\n        const printed = held === undefined ? \"\" : formatTime(held);\n        const fill = (typed: string): string => {\n            const digits = typed.replace(/\\D/g, \"\").slice(0, 4);\n            return digits.length <= 2 ? digits : `${digits.slice(0, 2)}:${digits.slice(2)}`;\n        };\n        const onTyped = (text: string) => {\n            const split = splitTimeToken(text);\n            if (text.length === 5 && split.time !== undefined) writeCell(variant(\"DateTime\", withTime(held ?? todayUtc(), split.time.hh, split.time.mm)));\n        };\n        return (\n            <>\n                <chakra.div css={bar.cellLine}>\n                    <TypedInput css={bar.cellInput} printed={printed} dirty={dirty} label={header} disabled={!writable} inputMode=\"numeric\"\n                        placeholder={m.editorTimePlaceholder()} accept={fill} onTyped={onTyped} />\n                    <chakra.button type=\"button\" css={bar.cellClear} disabled={!writable || held === undefined} data-cell-clear=\"\" onClick={() => writeCell(NULL_CELL)}>\n                        {m.cellEditorClear()}\n                    </chakra.button>\n                </chakra.div>\n                <chakra.span css={bar.cellHelp} data-cell-help=\"\">{m.cellEditorTimeHelp()}</chakra.span>\n            </>\n        );\n    }\n    return null;\n}\n\n/** Props of {@link TypedInput}. */\ninterface TypedInputProps {\n    css: SystemStyleObject | undefined;\n    /** The cell's value as the field shows it, while it is not being typed into. */\n    printed: string;\n    dirty: boolean;\n    label: string;\n    disabled: boolean;\n    inputMode: \"numeric\" | \"decimal\";\n    placeholder?: string | undefined;\n    /** What the field holds of what was typed: the characters it takes, in its form. */\n    accept: (typed: string) => string;\n    /** Told what the field holds after each keystroke. */\n    onTyped: (text: string) => void;\n    /** The tone of a bound its value breaks (#1585): its edge, and — an error — invalid; `undefined` while it breaks none. */\n    breach?: \"warn\" | \"error\" | undefined;\n}\n\n/** A phone's cell editor's field: what is typed into it stands while it is typed, and the cell's value otherwise. */\nfunction TypedInput({ css, printed, dirty, label, disabled, inputMode, placeholder, accept, onTyped, breach }: TypedInputProps) {\n    const [typed, setTyped] = useState<string | undefined>(undefined);\n    return (\n        <chakra.input css={css} value={typed ?? printed} aria-label={label} disabled={disabled} inputMode={inputMode} placeholder={placeholder}\n            aria-invalid={breach === \"error\" ? true : undefined} data-dirty={dirty ? \"\" : undefined} data-breach={breach} data-cell-input=\"\"\n            onChange={(e) => { const next = accept(e.currentTarget.value); setTyped(next); onTyped(next); }}\n            onBlur={() => setTyped(undefined)} />\n    );\n}\n\n// ============================================================================\n// Several rows (SB50)\n// ============================================================================\n\n/** Props of {@link SeveralRows}. */\ninterface SeveralProps extends DetailsProps {\n    styles: Styles;\n    inspect: SheetInspect;\n    rs: readonly number[];\n    r0: number;\n    r1: number;\n}\n\n/** Several rows: their count, a column set or cleared across them, Duplicate and Delete — each one transaction. */\nfunction SeveralRows({ value, pane, words, styles, inspect, rs, r0, r1 }: SeveralProps) {\n    const { m } = words;\n    const button = useRecipe({ key: \"button\" });\n    const form = pane.forms.row;\n    const lines = getSomeorUndefined(value.sheet.group) !== undefined;\n    // The columns a bulk edit sets: the editable ones the form edits — never a stamped, a link or a set column, which the grid\n    // edits — and of those only one a cell of the rows takes: a column every row's mark locks is no input at all.\n    const editable = useMemo(() => form.fields.filter((f) => {\n        const key = getSomeorUndefined(f.column);\n        if (key === undefined) return false;\n        const meta = inspect.columnAt(rs[0]!, key);\n        return meta !== undefined && meta.editable && meta.kind !== \"stamped\" && meta.kind !== \"link\" && meta.kind !== \"set\" && f.spec.editor.type !== \"readonly\"\n            && rs.some((r) => inspect.writableAt(r, key));\n    }), [form.fields, inspect, rs]);\n    const [column, setColumn] = useState<string | undefined>(undefined);\n    const [held, setHeld] = useState<unknown>(undefined);\n    const chosen = editable.find((f) => column !== undefined && stringEqual(getSomeorUndefined(f.column) ?? \"\", column)) ?? editable[0];\n    const chosenKey = chosen === undefined ? undefined : getSomeorUndefined(chosen.column);\n    const chosenMeta = chosenKey === undefined ? undefined : inspect.columnAt(rs[0]!, chosenKey);\n    const struct = useMemo(() => fromEastTypeValue(form.type) as StructType, [form.type]);\n    const encodePatch = useMemo(() => encodeBeast2For(Sheet.Types.Patch(struct)), [struct]);\n    const registers = useMemo(() => indexRegisters(value.sheet.registers), [value.sheet.registers]);\n    // The column choice: a select of the columns, as FieldForm draws a variant's cases.\n    const pickSpec = useMemo((): FieldSpecValue | undefined => {\n        if (editable.length === 0) return undefined;\n        const cases = Object.fromEntries(editable.map((f) => [getSomeorUndefined(f.column)!, NullType]));\n        return {\n            path: [PICK], label: m.inspectorBulk({ part: \"pick\" }), help: none, group: none,\n            type: toEastTypeValue(VariantType(cases)), optional: false,\n            editor: variant(\"select\", editable.map((f) => ({ case: getSomeorUndefined(f.column)!, label: f.spec.label }))),\n        };\n    }, [editable, m]);\n    // The value to set: the chosen column's field — a select over its register's every member, as no one row narrows them.\n    const valueSpec = useMemo((): FieldSpecValue | undefined => {\n        if (chosen === undefined) return undefined;\n        const spec = { ...chosen.spec, help: some(m.inspectorBulk({ part: \"hint\" })) };\n        return chosen.spec.editor.type === \"reference\" ? { ...spec, editor: variant(\"reference\", { of: pathKey(chosen.spec.path) }) } : spec;\n    }, [chosen, m]);\n    const specs = useMemo(() => (pickSpec === undefined || valueSpec === undefined ? [] : [pickSpec, valueSpec]), [pickSpec, valueSpec]);\n    const options = useMemo(() => {\n        if (chosen === undefined || chosen.spec.editor.type !== \"reference\") return undefined;\n        const members = registers.byName.get(chosen.spec.editor.value.of) ?? [];\n        return { [pathKey(chosen.spec.path)]: members.map((member): FieldOption => ({ key: member.key, label: member.label })) };\n    }, [chosen, registers]);\n    const formValue = useMemo(() => (chosen === undefined || chosenKey === undefined ? {} : { [PICK]: variant(chosenKey, null), [chosen.spec.path[0]!]: held }), [chosen, chosenKey, held]);\n    const writeAcross = useCallback((write: (r: number) => SheetInspectWrite) => { inspect.write(rs.map(write)); }, [inspect, rs]);\n    const onChange = useCallback((path: readonly string[], next: unknown) => {\n        if (stringEqual(path[0]!, PICK)) { setColumn((next as ValueTypeOf<VariantType>).type as string); setHeld(undefined); return; }\n        if (chosen === undefined || chosenKey === undefined || chosenMeta === undefined) return;\n        setHeld(next);\n        const name = chosen.spec.path[0]!;\n        const set = chosen.spec.optional ? getSomeorUndefined(next as option<unknown>) : next;\n        // A custom column's text, read on each row by its own parse.\n        if (chosenMeta.kind === \"custom\") {\n            const text = set === undefined ? \"\" : set as string;\n            writeAcross((r) => ({ r, texts: new Map([[chosenKey, text]]) }));\n            return;\n        }\n        if (set === undefined || (chosen.spec.editor.type === \"text\" && stringEqual(set as string, \"\"))) {\n            writeAcross((r) => ({ r, cells: new Map([[chosenKey, NULL_CELL]]) }));\n            return;\n        }\n        const cells = form.encode(encodePatch(patchOne(struct, name, next) as never));\n        writeAcross((r) => ({ r, cells }));\n    }, [chosen, chosenKey, chosenMeta, struct, form, encodePatch, writeAcross]);\n    const can = inspect.can;\n    return (\n        <Box css={styles.root} data-sheet-inspector=\"several\">\n            <Box css={styles.head}>\n                <Box css={styles.summary} data-inspector-several=\"\">{m.inspectorSeveral({ n: rs.length, count: words.number(rs.length), lines })}</Box>\n            </Box>\n            {chosen !== undefined && chosenKey !== undefined && (\n                <Box css={styles.bulk} data-inspector-bulk=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorBulk({ part: \"column\" })}</Box>\n                    <FieldForm specs={specs} value={formValue} options={options} onChange={onChange} takesUnset readOnly={!inspect.writable} />\n                    <Box css={styles.marks}>\n                        <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={!inspect.writable} data-inspector-action=\"clear\"\n                            onClick={() => { setHeld(undefined); writeAcross((r) => ({ r, cells: new Map([[chosenKey, NULL_CELL]]) })); }}>\n                            {m.inspectorAction({ action: \"clear\", header: chosen.spec.label, withLines: false })}\n                        </chakra.button>\n                    </Box>\n                </Box>\n            )}\n            <Box css={styles.actions} data-inspector-actions=\"\">\n                <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={!can.insertRows}\n                    data-inspector-action=\"duplicate\" onClick={() => inspect.duplicate(rs)}>\n                    {m.inspectorAction({ action: \"duplicate\", header: undefined, withLines: false })}\n                </chakra.button>\n                <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={!can.removeRows}\n                    data-inspector-action=\"delete\" onClick={() => inspect.remove(r0, r1)}>\n                    {m.inspectorAction({ action: \"delete\", header: undefined, withLines: false })}\n                </chakra.button>\n            </Box>\n        </Box>\n    );\n}\n\n// ============================================================================\n// Nothing selected (SB51)\n// ============================================================================\n\n/**\n * Nothing selected: the counts, over a record its last commit and who made\n * it, and three hints.\n */\nfunction NothingSelected({ styles, inspect, words, record, lastCommit }: {\n    styles: Styles; inspect: SheetInspect; words: SheetWords; record: boolean; lastCommit: SheetLastCommit | undefined;\n}) {\n    const { m } = words;\n    const { rows, pending, issues } = inspect.counts;\n    const stats: [what: \"rows\" | \"pending\" | \"issues\", n: number][] = [[\"rows\", rows], [\"pending\", pending], [\"issues\", issues]];\n    return (\n        <Box css={styles.root} data-sheet-inspector=\"none\">\n            <Box css={styles.stats} data-inspector-counts=\"\">\n                {stats.map(([what, n]) => (\n                    <Box key={what} css={styles.stat} data-count={what}>\n                        <Box as=\"span\" css={styles.statValue}>{words.number(n)}</Box>\n                        <Box as=\"span\" css={styles.statLabel}>{m.inspectorCount({ what, n })}</Box>\n                    </Box>\n                ))}\n            </Box>\n            {record && <Box css={styles.commit} data-inspector-commit=\"\">{m.inspectorLastCommit({ when: lastCommit?.when, by: lastCommit?.by })}</Box>}\n            <Box as=\"ul\" css={styles.hints}>\n                {([1, 2, 3] as const).map((n) => <Box as=\"li\" key={n} css={styles.hint}>{m.inspectorHint({ n })}</Box>)}\n            </Box>\n        </Box>\n    );\n}\n\n// ============================================================================\n// Issues (SB53)\n// ============================================================================\n\n/** The Issues tab: every issue of the batch by row, each a control that goes to its cell. */\nconst SheetInspectorIssues = memo(function SheetInspectorIssues({ forms, columns, words, noun, where: hostWhere }: {\n    forms: PaneValue[\"forms\"]; columns: SheetInspectorValue[\"sheet\"][\"columns\"]; words: SheetWords; noun: string; where?: SheetInspectorHost[\"where\"];\n}) {\n    const { m } = words;\n    const inspect = useSheetInspect();\n    const styles = useSlotRecipe({ key: \"sheetInspector\" })() as Styles;\n    // A field's words: its label in the row's form or the group's — else the header of the column it names, as one of a\n    // column from data's cells is named by its column key, which no form field holds — else its name.\n    const labels = useMemo(() => new Map([\n        ...columns.map((column) => [column.key, column.header] as const),\n        ...labelsOf(getSomeorUndefined(forms.group)?.fields ?? []), ...labelsOf(forms.row.fields),\n    ]), [forms, columns]);\n    // An issue's place: a host's words for it, given where its row stands among the rows drawn (#1534) — else its entry,\n    // or a line of its group.\n    const placeOf = inspect.placeOf;\n    const where = useCallback((issue: EditIssue) => {\n        if (hostWhere !== undefined) return hostWhere(issue, placeOf(issue));\n        const row = getSomeorUndefined(issue.row);\n        return row === undefined ? issue.entry : m.rowRef({ line: true, number: words.number(Number(row) + 1), title: issue.entry, noun });\n    }, [m, words, noun, hostWhere, placeOf]);\n    // Whether the rail's filters hide the rows of the issues the sheet does not draw, and by which, asked of e3 while the\n    // tab lists them (the hidden pick).\n    const { issues, askHidden } = inspect;\n    useEffect(() => { askHidden(issues); }, [askHidden, issues]);\n    if (inspect.issues.length === 0) {\n        return (\n            <Box css={styles.empty} data-inspector-no-issues=\"\">\n                <Box as=\"span\" css={styles.emptyTitle}>{m.inspectorNoIssues({ part: \"title\" })}</Box>\n                <Box as=\"span\" css={styles.emptyHint}>{m.inspectorNoIssues({ part: \"hint\" })}</Box>\n            </Box>\n        );\n    }\n    return (\n        <Box as=\"ul\" css={styles.issueList} data-inspector-issue-list=\"\">\n            {inspect.issues.map((issue, i) => {\n                const field = getSomeorUndefined(issue.field);\n                const hidden = inspect.hiddenNote(issue);\n                return (\n                    <Box as=\"li\" key={i}>\n                        <chakra.button type=\"button\" css={styles.issueItem} onClick={() => inspect.goToIssue(issue)} data-inspector-issue=\"\">\n                            <Box as=\"span\" css={styles.issueWhere}>{m.inspectorIssueAt({ where: where(issue), field: field === undefined ? undefined : labels.get(field) ?? field })}</Box>\n                            <Box as=\"span\" css={styles.issueMessage} data-kind={inspect.kindOf(issue)}>{issueText(issue.message, words)}</Box>\n                            {hidden !== undefined && <Box as=\"span\" css={styles.issueHidden} data-inspector-issue-hidden=\"\">{hidden}</Box>}\n                        </chakra.button>\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Sheet's Library in a phone's view (`Mobile Sheet Spec.md` SH11, R7): no\n * drag there, so each tab says what a tap does and lists a 44px row a card. A\n * tap on an author's card sets it on the selected row or band, as its drop\n * does, its row marked `current` while the target holds it; a tap on a template\n * adds it below the selected row, as its ⏎ does. A tap on a column closes the\n * view and pages the window to it, its eye still hiding it. A tab with nothing\n * to list, whatever its filters, keeps the Library's own empty state.\n *\n * @packageDocumentation\n */\n\nimport { useContext, type ReactNode } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faArrowRight, faEye, faEyeSlash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FrameDrawer, FramePane, useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { getSomeorUndefined, type LibraryItemValue } from \"@elaraai/east-ui-components\";\nimport { useSheetPhoneLibrary } from \"../index.js\";\nimport { useSheetWords } from \"../words.js\";\n\n/** Props of {@link PhoneCards}. */\nexport interface PhoneCardsProps {\n    /** The tab's library: what its cards drop from. */\n    library: string;\n    /** What the hint says: a tap sets an author's card, or adds a template. */\n    verb: \"set\" | \"add\";\n    /** Its cards, as the Library lists them. */\n    items: readonly LibraryItemValue[];\n    /** The Library, drawn on a wider frame and for an empty tab. */\n    children: ReactNode;\n}\n\n/** An author's tab's or the templates' cards in a phone's view — see the module docs. */\nexport function PhoneCards({ library, verb, items, children }: PhoneCardsProps) {\n    const { m } = useSheetWords();\n    const phone = useContext(FrameDrawer);\n    const styles = useSlotStyles(\"sheet\");\n    const cards = useSheetPhoneLibrary();\n    if (!phone || items.length === 0) return <>{children}</>;\n    const target = cards.targetOf(library);\n    return (\n        <Box css={styles.phoneList} data-sheet-phone-list=\"\">\n            <Box css={styles.phoneHint} data-sheet-phone-hint=\"\">{verb === \"set\" ? m.libraryPhoneSet({ target }) : m.libraryPhoneAdd({ target })}</Box>\n            {items.map((item) => {\n                const meta = getSomeorUndefined(item.sublabel);\n                return (\n                    <Box key={item.key} css={styles.phoneRow} data-sheet-phone-row={item.key}>\n                        <chakra.button type=\"button\" css={styles.phoneRowMain} aria-disabled={target === undefined ? true : undefined}\n                            onClick={() => { if (target !== undefined) cards.tap(library, item.key); }}>\n                            <Box as=\"span\" css={styles.phoneRowLabel}>{item.label}</Box>\n                            {cards.holds(library, item.key) && <Box as=\"span\" css={styles.phoneRowMark} data-sheet-phone-current=\"\">{m.libraryPhoneCurrent()}</Box>}\n                            {meta !== undefined && <Box as=\"span\" css={styles.phoneRowMeta}>{meta}</Box>}\n                        </chakra.button>\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n}\n\n/** A column of the phone's Columns tab. */\nexport interface PhoneColumn {\n    key: string;\n    header: string;\n    /** Its kind, in words. */\n    kind: string;\n    /** The viewer hides it. */\n    hidden: boolean;\n    /** What its eye says. */\n    eye: string;\n    /** The last column shown, whose eye stays. */\n    last: boolean;\n}\n\n/** Props of {@link PhoneColumns}. */\nexport interface PhoneColumnsProps {\n    /** The declared columns, in their order. */\n    columns: readonly PhoneColumn[];\n    /** The column the sheet pins on a phone, by its key. */\n    pin: string | undefined;\n    /** Hides a column, or shows it again. */\n    onToggle: (key: string) => void;\n    /** The Library, drawn on a wider frame. */\n    children: ReactNode;\n}\n\n/** The Columns tab in a phone's view — see the module docs. */\nexport function PhoneColumns({ columns, pin, onToggle, children }: PhoneColumnsProps) {\n    const { m } = useSheetWords();\n    const phone = useContext(FrameDrawer);\n    const styles = useSlotStyles(\"sheet\");\n    const { goToColumn } = useSheetPhoneLibrary();\n    // The view the list is drawn in, closed by the frame as its collapse closes it.\n    const pane = useContext(FramePane);\n    if (!phone) return <>{children}</>;\n    const pinned = columns.find((col) => col.key === pin)?.header;\n    const go = (col: PhoneColumn) => {\n        pane?.close();\n        if (col.key === pin) return;\n        // A column it hides comes back first, and is gone to once the grid has drawn it.\n        if (col.hidden) {\n            onToggle(col.key);\n            requestAnimationFrame(() => goToColumn(col.key));\n        } else goToColumn(col.key);\n    };\n    return (\n        <Box css={styles.phoneList} data-sheet-phone-list=\"\">\n            <Box css={styles.phoneHint} data-sheet-phone-hint=\"\">{m.libraryPhoneColumns({ pinned })}</Box>\n            {columns.map((col) => (\n                <Box key={col.key} css={styles.phoneRow} data-sheet-phone-row={col.key} data-off={col.hidden ? \"\" : undefined}>\n                    <chakra.button type=\"button\" css={styles.phoneRowMain} aria-label={m.libraryPhoneGo({ header: col.header })} onClick={() => go(col)}>\n                        <Box as=\"span\" css={styles.phoneRowLabel}>{col.header}</Box>\n                        <Box as=\"span\" css={styles.phoneRowMeta}>{m.libraryPhoneKind({ kind: col.kind, pinned: col.key === pin })}</Box>\n                        <FontAwesomeIcon icon={faArrowRight} aria-hidden />\n                    </chakra.button>\n                    <chakra.button type=\"button\" css={styles.phoneRowEye} aria-label={col.eye} title={col.eye} aria-disabled={col.last ? true : undefined} data-sheet-phone-eye=\"\"\n                        onClick={() => { if (!col.last) onToggle(col.key); }}>\n                        <FontAwesomeIcon icon={col.hidden ? faEyeSlash : faEye} aria-hidden />\n                    </chakra.button>\n                </Box>\n            ))}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The library pane (`Sheet Builder Spec.md` §7, §8, §9.7, SB32, SB33, SB36,\n * SB37, SB59, SB60): the Sheet's start pane (#1216), its tabs the ones the\n * author's `library` lists, in that order, each a `Library` with its count\n * after its name and a search — what the sheet offers to drag into its\n * rows, and the columns a viewer shows and hides. A sheet whose `library`\n * lists no tab has no pane.\n *\n * - **Rows** (`Sheet.library.rows()`) — the templates, grouped by their\n *   `group`: a card names the template and, under it, what it sets — its\n *   cells as the columns print them, in column order — or, for a group\n *   template, its band cells and how many lines it drops. Each templates\n *   list follows its source of the rail (#1345): the tab shows the cards its\n *   sources show, counts them (`3 of 8`), and says so when the rail leaves it\n *   none, with Clear filters for those sources alone.\n * - **Columns** (`Sheet.library.columns()`) — the declared columns in their\n *   order, each with its kind and an eye; a click hides it, or shows it\n *   again, dimmed while hidden. The last column shown stays.\n * - **An author's tab** (`Sheet.library.tab(…)`) — its cards, each its label\n *   and its meta under it, with the tab's icon, grouped by its `group` and\n *   searched by key, label and meta. A click selects a card, and a click on\n *   the selected card lets it go. A tab that declares a `drop` offers its\n *   cards to drag (#1187). A tab that names a source follows it as the Rows\n *   tab does; one that names none lists its cards whole.\n * - An empty tab says so (SB37), in the shared empty state; collapsed, the\n *   pane is a rail with the templates' count, or the first tab's when the\n *   library lists no Rows tab. A tab over a source takes no gesture while\n *   its source resolves.\n *\n * Template cards drag from the library `${sheetKeys(name).library}:rows` names,\n * an author's tab's from `…:tab:<its name>` ({@link templatesLibrary},\n * {@link tabLibrary}) — the libraries the sheet takes drops from (#1187). A\n * draggable card's ⏎ is the sheet's: the card, dropped below the ring's row\n * (SB45). In a phone's view, where nothing drags, each tab is its rows at\n * touch size, a tap in place of the gesture (`phone-library.tsx`, SH11).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useState } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { StringType, StructType, decodeBeast2For, equalFor, none, printFor, some, variant } from \"@elaraai/east\";\nimport { Sheet, type sheetKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    EastChakraLibrary, getSomeorUndefined, type BuilderFrameDock, type LibraryItemValue, type LibraryValue,\n} from \"@elaraai/east-ui-components\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { sourceTab, sourcesTab, type SourceShown, type SourceTab } from \"../../shared/schedule/source-tab.js\";\nimport { useSheetDropEnter } from \"../index.js\";\nimport { PhoneCards, PhoneColumns, type PhoneColumn } from \"./phone-library.js\";\nimport type { SheetLibraryTabWord } from \"../messages.js\";\nimport { TITLE_KEY, cellIsBlank, cellText, indexColumns, indexGroup, type SheetColumnIndex, type SheetColumnMeta } from \"../model.js\";\nimport type { SheetCellValue } from \"../values.js\";\nimport type { SheetWords } from \"../words.js\";\nimport type { SheetValue } from \"./index.js\";\nimport type { FollowedSources } from \"../../shared/schedule/follow-sources.js\";\n\n/** One template, decoded. */\ntype SheetTemplateValue = SheetValue[\"templates\"][number];\n/** An author's tab, decoded. */\ntype SheetAuthorTabValue = Extract<SheetValue[\"library\"][number], { type: \"tab\" }>[\"value\"];\n/** The names the sheet keeps its viewer's state under. */\ntype SheetKeys = ReturnType<typeof sheetKeys>;\n\nconst stringEqual = equalFor(StringType);\nconst decodeRow = decodeBeast2For(Sheet.Types.Row);\n/** A template's card's identity: its key in its record, beside its list's source. */\nconst TemplateCardKeyType = StructType({ source: StringType, key: StringType });\nconst printCardKey = printFor(TemplateCardKeyType);\n\n/** What a tab that names no source shows: its cards whole. */\nconst WHOLE: SourceShown = { keys: none, busy: false, ready: true, clear: undefined };\n\n/** The library open: the Calendar's 272px (§8). */\nconst LIBRARY_SIZE = \"272px\";\n\n/** A library tab's cards fill the pane and scroll there, every card mounted. */\nconst FILL = some({ height: some(\"fill\"), maxHeight: none, virtualization: some(false), columns: none, mediaPlacement: none, mediaSize: none });\n\n/** Props of {@link useSheetLibrary}. */\nexport interface SheetLibraryProps {\n    /** The sheet's payload: the sheet, the templates and the library's tabs. */\n    value: SheetValue;\n    /** The names the sheet keeps its viewer's state under. */\n    keys: SheetKeys;\n    /** The columns this viewer hides, by key. */\n    hidden: ReadonlySet<string>;\n    /** Hides a column the grid shows, or shows a hidden one again. */\n    onToggleColumn: (key: string) => void;\n    /** The sheet's words. */\n    words: SheetWords;\n    /** What each source the library follows shows (#1345). */\n    followed: FollowedSources;\n}\n\n/**\n * A template's card's key (#1345): its key in its templates record, beside\n * its list's source — two lists' templates may share a key, each in its own\n * record. What the Rows tab's cards drag by, and the sheet's drops find them by.\n *\n * @param template - The template: its list's source, and its key in that list's record\n * @returns Its card's key\n */\nexport function templateCardKey(template: Pick<SheetTemplateValue, \"source\" | \"key\">): string {\n    return printCardKey({ source: template.source, key: template.key });\n}\n\n/**\n * The Rows tab over its templates lists (#1345): each list a record of its\n * own following its own source — the shared {@link sourcesTab} — counted\n * together, its Clear filters clearing each narrowing source, and its own\n * empty words the sheet's.\n *\n * @param templates - Every template, each with the source its list follows\n * @param followed - What each source shows\n * @param words - The sheet's words\n * @returns The tab's cards, its count, its narrowed and its own empty states, and its pane's attributes\n */\nfunction templatesTab(templates: readonly SheetTemplateValue[], followed: FollowedSources, words: SheetWords): SourceTab<SheetTemplateValue> {\n    const shownOf = (source: string): SourceShown => followed.get(source)?.shown ?? WHOLE;\n    const sources = templates.map((template) => template.source).filter((source, i, all) => all.findIndex((other) => stringEqual(other, source)) === i);\n    const tab = sourcesTab({\n        cards: templates, keyOf: (template) => template.key, sources: sources.map(shownOf), sourceOf: (template) => shownOf(template.source),\n        noun: words.m.libraryNoun({ tab: \"rows\", n: 2 }), words,\n    });\n    return {\n        ...tab,\n        empty: tab.empty === undefined ? undefined : { title: words.m.libraryEmpty({ tab: \"rows\", name: \"\" }), description: words.m.libraryEmptyHint({ tab: \"rows\", name: \"\" }) },\n    };\n}\n\n/** A card's line under its name: the texts, the blank ones left out. */\nfunction line(texts: readonly string[]): string {\n    return texts.filter((text) => text !== \"\").join(\" · \");\n}\n\n/** A cell as its column prints it, or `\"\"` for a blank one. */\nfunction printed(cell: SheetCellValue | undefined, meta: SheetColumnMeta | undefined, words: SheetWords): string {\n    return cell === undefined || meta === undefined || cellIsBlank(cell) ? \"\" : cellText(cell, meta, words);\n}\n\n/**\n * How many lines a group template drops: its seed's, as a drop would make it.\n *\n * @param template - A group template\n * @param keyed - Whether the sheet's groups sit in key order, or where they are put\n * @returns The count, or `undefined` when the seed fails\n */\nfunction seededLines(template: SheetTemplateValue, keyed: boolean): number | undefined {\n    if (template.seed.type !== \"group\") return undefined;\n    try {\n        const seeded = template.seed.value({ place: keyed ? variant(\"keyOrder\", null) : variant(\"ordered\", variant(\"end\", null)) });\n        return decodeRow(seeded.row).lines.length;\n    } catch (err) {\n        console.error(`[Sheet] group template \"${template.key}\" could not be seeded:`, err);\n        return undefined;\n    }\n}\n\n/**\n * What a template sets, as its card says it (SB33): a row template's cells as\n * the columns print them, in column order; a group template's title and band\n * cells, then the lines it drops.\n *\n * @param template - The template\n * @param columns - The declared columns\n * @param group - The band's cells, on a grouped sheet\n * @param keyed - Whether the sheet's groups sit in key order\n * @param words - The sheet's words\n * @returns The card's line\n */\nfunction templateLine(template: SheetTemplateValue, columns: SheetColumnIndex, group: ReturnType<typeof indexGroup> | undefined, keyed: boolean, words: SheetWords): string {\n    if (template.seed.type === \"row\") return line(columns.list.map((meta) => printed(template.cells.get(meta.key), meta, words)));\n    const lines = seededLines(template, keyed);\n    return line([\n        printed(template.cells.get(TITLE_KEY), group?.cells.get(TITLE_KEY), words),\n        ...columns.list.map((col) => printed(template.cells.get(col.key), group?.cells.get(col.key), words)),\n        lines === undefined ? \"\" : words.m.templateLines({ n: lines, count: words.number(lines) }),\n    ]);\n}\n\n/** A card with nothing but its face: no media, byline, action, facets or secondary facts. */\nfunction card(fields: Pick<LibraryItemValue, \"key\" | \"label\" | \"sublabel\" | \"icon\" | \"status\" | \"trailing\" | \"draggable\" | \"filtered\" | \"placed\" | \"search\" | \"groups\">): LibraryItemValue {\n    return { ...fields, media: none, avatar: none, byline: none, action: none, facets: new Map(), dims: new Map() };\n}\n\n/** The pane's tab of an author's tab: its key among the pane's tabs, and its cards' library. */\nfunction authorTabKey(tab: SheetAuthorTabValue): string {\n    return `tab:${tab.name}`;\n}\n\n/**\n * The library a sheet's templates drag from — the Rows tab's (#1187).\n *\n * @param keys - The sheet's keys\n * @returns The library's id\n */\nexport function templatesLibrary(keys: SheetKeys): string {\n    return `${keys.library}:rows`;\n}\n\n/**\n * The library an author's tab's cards drag from (#1187).\n *\n * @param keys - The sheet's keys\n * @param tab - The author's tab\n * @returns The library's id\n */\nexport function tabLibrary(keys: SheetKeys, tab: SheetAuthorTabValue): string {\n    return `${keys.library}:${authorTabKey(tab)}`;\n}\n\n/**\n * The library pane, as `BuilderFrame` draws it — see the module docs.\n *\n * @param props - The payload, the sheet's keys, the columns hidden and their toggle, and the words\n * @returns The pane — its tabs the ones `library` lists, each with its count; 272px wide; its collapsed state kept per viewer (SB24) — or `undefined`, no pane, when `library` lists none\n */\nexport function useSheetLibrary({ value, keys, hidden, onToggleColumn, words, followed }: SheetLibraryProps): BuilderFrameDock | undefined {\n    const { m } = words;\n    const sheet = value.sheet;\n    // A tab over a source's body: it fills the tab, busy and taking no gesture while its source resolves. The sheet's\n    // recipe made once for the theme (#1398, CL9): the library is drawn again with the sheet, a landing at a time.\n    const styles = useSlotStyles(\"sheet\");\n    const columns = useMemo(() => indexColumns(sheet.columns), [sheet.columns]);\n    const keyed = sheet.editing.keyType.type === \"some\";\n    const titleColumn = m.titleColumn();\n    const group = useMemo(() => {\n        const g = getSomeorUndefined(sheet.group);\n        return g === undefined ? undefined : indexGroup(g, columns, titleColumn);\n    }, [sheet.group, columns, titleColumn]);\n\n    const noun = useCallback((tab: SheetLibraryTabWord) => some({ singular: m.libraryNoun({ tab, n: 1 }), plural: m.libraryNoun({ tab, n: 2 }) }), [m]);\n    const empty = useCallback((tab: SheetLibraryTabWord, name: string) => ({ title: m.libraryEmpty({ tab, name }), description: m.libraryEmptyHint({ tab, name }) }), [m]);\n\n    // A draggable card's ⏎: the card, dropped below the ring's row (SB45).\n    const enter = useSheetDropEnter();\n\n    // ── Rows: the templates, by their group (SB33), each list following its source (#1345) ──\n    const templates = value.templates;\n    const rowsFollow = useMemo(() => templatesTab(templates, followed, words), [templates, followed, words]);\n    const rows = useMemo((): LibraryValue => ({\n        id: templatesLibrary(keys),\n        hint: none,\n        items: rowsFollow.cards.map((template) => {\n            const category = getSomeorUndefined(template.group);\n            const sets = templateLine(template, columns, group, keyed, words);\n            return card({\n                key: templateCardKey(template),\n                label: template.name,\n                sublabel: sets === \"\" ? none : some(sets),\n                icon: none,\n                status: none,\n                trailing: none,\n                draggable: true,\n                filtered: false,\n                placed: false,\n                search: some(line([template.name, category ?? \"\", sets])),\n                groups: category === undefined ? new Map() : new Map([[\"category\", category]]),\n            });\n        }),\n        groupOptions: [{ key: \"category\", label: m.libraryGroupBy({ tab: \"rows\" }) }],\n        groupSummaries: new Map(),\n        dimOptions: [],\n        defaultDimensions: [],\n        filterOptions: [],\n        searchable: true,\n        noun: noun(\"rows\"),\n        addLabel: none,\n        onAdd: none,\n        onCardClick: none,\n        slice: none,\n        style: FILL,\n        variant: none,\n        layout: none,\n        toolbar: true,\n    }), [keys, rowsFollow, columns, group, keyed, words, m, noun]);\n\n    // ── Columns: each with its kind and an eye (SB36) ───────────────────\n    const shown = columns.list.filter((col) => !hidden.has(col.key)).length;\n    const onColumn = useCallback((key: string) => {\n        // The last column shown stays.\n        if (!hidden.has(key) && shown <= 1) return;\n        onToggleColumn(key);\n    }, [hidden, shown, onToggleColumn]);\n    const columnCards = useMemo((): LibraryValue => ({\n        id: `${keys.library}:columns`,\n        hint: none,\n        items: columns.list.map((col) => {\n            const off = hidden.has(col.key);\n            const kind = m.columnKind({ kind: col.kind });\n            return card({\n                key: col.key,\n                label: col.header,\n                sublabel: some(kind),\n                icon: none,\n                status: none,\n                trailing: some({ icon: off ? \"eye-slash\" : \"eye\", label: m.columnEye({ hidden: off, last: !off && shown <= 1 }), tone: none }),\n                draggable: false,\n                filtered: off,\n                placed: false,\n                search: some(line([col.header, col.key, kind])),\n                groups: new Map(),\n            });\n        }),\n        groupOptions: [],\n        groupSummaries: new Map(),\n        dimOptions: [],\n        defaultDimensions: [],\n        filterOptions: [],\n        searchable: true,\n        noun: noun(\"columns\"),\n        addLabel: none,\n        onAdd: none,\n        onCardClick: some((key: string) => { onColumn(key); return null; }),\n        slice: none,\n        style: FILL,\n        variant: none,\n        layout: none,\n        toolbar: true,\n    }), [keys.library, columns, hidden, shown, onColumn, m, noun]);\n    // The same columns as a phone's view lists them (SH11, R7).\n    const narrow = getSomeorUndefined(sheet.narrow);\n    const pin = narrow === undefined ? undefined : getSomeorUndefined(narrow.pin);\n    const phoneColumns = useMemo(() => columns.list.map((col): PhoneColumn => {\n        const off = hidden.has(col.key);\n        return { key: col.key, header: col.header, kind: m.columnKind({ kind: col.kind }), hidden: off, eye: m.columnEye({ hidden: off, last: !off && shown <= 1 }), last: !off && shown <= 1 };\n    }), [columns, hidden, shown, m]);\n\n    // ── An author's tabs: their cards, a click selecting one (SB60) ─────\n    // The card each tab's click selected, by the tab's key.\n    const [picked, setPicked] = useState<ReadonlyMap<string, string>>(() => new Map());\n    const onAuthorCard = useCallback((tabKey: string, key: string) => {\n        setPicked((was) => {\n            const next = new Map(was);\n            const chosen = was.get(tabKey);\n            if (chosen !== undefined && stringEqual(chosen, key)) next.delete(tabKey);\n            else next.set(tabKey, key);\n            return next;\n        });\n    }, []);\n    const authorTabs = useMemo(() => value.library.flatMap((tab) => (tab.type === \"tab\" ? [tab.value] : [])), [value.library]);\n    // Each follows the source it names (#1345); one that names none lists its cards whole.\n    const authorFollows = useMemo(() => new Map(authorTabs.map((tab) => {\n        const source = getSomeorUndefined(tab.source);\n        const shown = source === undefined ? WHOLE : followed.get(source)?.shown ?? WHOLE;\n        return [authorTabKey(tab), sourceTab({ cards: tab.cards, keyOf: (c) => c.key, shown, noun: tab.name.toLocaleLowerCase(words.locale), words })] as const;\n    })), [authorTabs, followed, words]);\n    const authorLibraries = useMemo(() => new Map(authorTabs.map((tab): [string, LibraryValue] => {\n        const tabKey = authorTabKey(tab);\n        const chosen = picked.get(tabKey);\n        const icon = getSomeorUndefined(tab.icon);\n        return [tabKey, {\n            id: tabLibrary(keys, tab),\n            hint: none,\n            items: (authorFollows.get(tabKey)?.cards ?? tab.cards).map((c) => {\n                const meta = getSomeorUndefined(c.meta);\n                const category = getSomeorUndefined(c.group);\n                return card({\n                    key: c.key,\n                    label: c.label,\n                    sublabel: meta === undefined ? none : some(meta),\n                    icon: icon === undefined ? none : some(icon),\n                    status: none,\n                    trailing: none,\n                    draggable: tab.drop.type === \"some\",\n                    filtered: false,\n                    placed: chosen !== undefined && stringEqual(chosen, c.key),\n                    search: some(line([c.key, c.label, meta ?? \"\"])),\n                    groups: category === undefined ? new Map() : new Map([[\"group\", category]]),\n                });\n            }),\n            groupOptions: tab.cards.some((c) => c.group.type === \"some\") ? [{ key: \"group\", label: m.libraryGroupBy({ tab: \"tab\" }) }] : [],\n            groupSummaries: new Map(),\n            dimOptions: [],\n            defaultDimensions: [],\n            filterOptions: [],\n            searchable: true,\n            noun: noun(\"tab\"),\n            addLabel: none,\n            onAdd: none,\n            onCardClick: some((key: string) => { onAuthorCard(tabKey, key); return null; }),\n            slice: none,\n            style: FILL,\n            variant: none,\n            layout: none,\n            toolbar: true,\n        }];\n    })), [authorTabs, authorFollows, picked, keys, m, noun, onAuthorCard]);\n\n    return useMemo((): BuilderFrameDock | undefined => {\n        // No tab listed: no pane (SB59).\n        if (value.library.length === 0) return undefined;\n        const tabs = value.library.map((tab) => {\n            if (tab.type === \"rows\") {\n                const onEnter = (key: string) => enter(templatesLibrary(keys), key);\n                // Its sources' cards, counted, and while one narrows what it says when that leaves it none (#1345).\n                return { key: \"rows\", label: m.libraryTab({ tab: \"rows\" }), count: rowsFollow.count,\n                    body: <Box css={styles.pane} data-sheet-library=\"rows\" {...rowsFollow.pane}>\n                        <PhoneCards library={templatesLibrary(keys)} verb=\"add\" items={rows.items}>\n                            <EastChakraLibrary value={rows} storageKey={`${keys.library}.rows`} empty={rowsFollow.empty} narrowing={rowsFollow.narrowing} onCardEnter={onEnter} />\n                        </PhoneCards>\n                    </Box> };\n            }\n            if (tab.type === \"columns\") {\n                return { key: \"columns\", label: m.libraryTab({ tab: \"columns\" }), count: columnCards.items.length,\n                    body: <PhoneColumns columns={phoneColumns} pin={pin} onToggle={onColumn}>\n                        <EastChakraLibrary value={columnCards} storageKey={`${keys.library}.columns`} empty={empty(\"columns\", \"\")} />\n                    </PhoneColumns> };\n            }\n            const tabKey = authorTabKey(tab.value);\n            const library = authorLibraries.get(tabKey)!;\n            const follows = authorFollows.get(tabKey)!;\n            // A tab whose cards drop takes their ⏎ too; another's cards click on it.\n            const onEnter = tab.value.drop.type === \"some\" ? (key: string) => enter(tabLibrary(keys, tab.value), key) : undefined;\n            return { key: tabKey, label: tab.value.name, count: follows.count,\n                body: <Box css={styles.pane} data-sheet-library={tabKey} {...follows.pane}>\n                    {tab.value.drop.type === \"some\" ? (\n                        <PhoneCards library={tabLibrary(keys, tab.value)} verb=\"set\" items={library.items}>\n                            <EastChakraLibrary value={library} storageKey={`${keys.library}.${tabKey}`} empty={follows.empty === undefined ? undefined : empty(\"tab\", tab.value.name)}\n                                narrowing={follows.narrowing} onCardEnter={onEnter} />\n                        </PhoneCards>\n                    ) : (\n                        <EastChakraLibrary value={library} storageKey={`${keys.library}.${tabKey}`} empty={follows.empty === undefined ? undefined : empty(\"tab\", tab.value.name)}\n                            narrowing={follows.narrowing} onCardEnter={onEnter} />\n                    )}\n                </Box> };\n        });\n        // Collapsed, the rail counts the templates the rail shows — or, with no Rows tab, the first tab's cards.\n        const listsRows = value.library.some((tab) => tab.type === \"rows\");\n        return {\n            label: m.libraryPane(),\n            icon: \"layer-group\",\n            badge: listsRows ? rowsFollow.cards.length : tabs[0]!.count,\n            size: LIBRARY_SIZE,\n            persist: \"local\",\n            tabs,\n        };\n    }, [value.library, m, rows, rowsFollow, columnCards, phoneColumns, pin, onColumn, authorLibraries, authorFollows, keys, empty, enter, styles.pane]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The sources of the Sheet's rail its library follows (#1345): each templates\n * list's, whose shown keys narrow the Rows tab's cards of that list, and each\n * author's tab's that names one — and what the rail counts each in. The\n * shared `FollowSources` reads them.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport type { SheetWords } from \"../words.js\";\nimport type { SheetValue } from \"./index.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * The sources the library follows: each templates list's, then each author's\n * tab's that names one — each once, in that order.\n *\n * @param value - The payload\n * @returns The sources' names\n */\nexport function followedSources(value: SheetValue): string[] {\n    const named = [\n        ...value.templates.map((template) => template.source),\n        ...value.library.flatMap((tab) => (tab.type === \"tab\" && tab.value.source.type === \"some\" ? [tab.value.source.value] : [])),\n    ];\n    return named.filter((source, i) => named.findIndex((other) => stringEqual(other, source)) === i);\n}\n\n/**\n * What the rail counts each source the library follows in (#1345): a\n * templates list's source, templates; an author's tab's, its name as running\n * text writes it.\n *\n * @param value - The payload\n * @param words - The sheet's words\n * @returns Each source's noun, by its name\n */\nexport function followedNouns(value: SheetValue, words: SheetWords): ReadonlyMap<string, string> {\n    const nouns = new Map<string, string>();\n    for (const template of value.templates) nouns.set(template.source, words.m.libraryNoun({ tab: \"rows\", n: 2 }));\n    for (const tab of value.library) {\n        if (tab.type === \"tab\" && tab.value.source.type === \"some\" && !nouns.has(tab.value.source.value)) {\n            nouns.set(tab.value.source.value, tab.value.name.toLocaleLowerCase(words.locale));\n        }\n    }\n    return nouns;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraSheet` — the renderer of the `Sheet` extension declared in\n * `@elaraai/e3-ui` (#1216, `Sheet Builder Spec.md` §7, §8, SB18–SB24): the\n * one Sheet, laid out in `BuilderFrame` wherever it is used. There is no\n * other Sheet: no layout without the frame, and no toolbar but its one.\n *\n * The payload's `sheet` is the grid's root whole, and `SheetProvider` builds\n * its one shared state from it — the store, the editing session, the lens\n * and the selection. The frame places the sheet's parts in its regions:\n *\n * - **the toolbar** — the sheet's items (`useSheetToolbarItems`) on the\n *   frame's one folding row, in §7.1's order: the view tabs, the key search,\n *   the rail over the sheet's `Slice.bindRecords` (#1345), the scope badge,\n *   and the history item, which leaves its error to the banners. ⌘F in the\n *   grid reaches the key search in it — its box, or, folded to its icon, the\n *   box in its popover (#1221). A sheet with none of them — read only, with\n *   no slice and no key search — has no toolbar;\n * - **the banners** — the session's (`SessionBanners`): an Apply's conflict,\n *   naming its rows and who changed the record last; a refusal, with its\n *   reason; an unknown outcome and a failed confirmation read, each with\n *   Retry; the out-of-date notice, with Discard — then each source the\n *   library follows whose narrowing could not be read, with Retry — and last,\n *   an `entry` the record does not hold;\n * - **the library**, the start pane, when the sheet is given one — its tabs\n *   the ones `library` lists, and no pane when it lists none (#1186, SB59);\n *   the Rows tab follows each templates list's source of the rail, and an\n *   author's tab the source it names, each counting what it shows (#1345) —\n *   and **the inspector**, the end pane, when the sheet is given one —\n *   Details for what is selected, its every field through the pane's form or\n *   the author's own Details, and the batch's Issues (#1188) — whose form, at\n *   touch size, is a phone's cell editor in the grid's bottom container\n *   (`Mobile Sheet Spec.md` SH10): `BuilderFrame`'s\n *   panes, whose open tab and collapsed state persist under the sheet's\n *   `name`. The library's Columns tab hides columns from the grid, per viewer,\n *   under the sheet's `name` too (SB36); a sheet whose library lists no\n *   Columns tab hides none;\n * - **main** — the grid, filling the room the panes leave and scrolling its\n *   own rows, the strip docked under it;\n * - **the footer** — the sheet's, and over a record its last save, from the\n *   record's commits, which the inspector also says with who made it; over\n *   the slice's `rows` source, the rows a Save took out of the narrowing; and\n *   over a paged source the shared loading line, saying what is read (#1398).\n *\n * A paged source's cold load is the frame's skeleton, its rows at the sheet's\n * pitch and its footer live; after it, a read in flight — a window, a\n * narrowing's rows — covers nothing, and main, the grid, is busy (#1398, CL5).\n *\n * ⌘Z undoes and ⇧⌘Z or ⌘Y redoes from anywhere in the frame — a pane, the\n * toolbar — as the history item does (#1185, SB26): the grid answers its own,\n * and a field being typed into keeps its own undo.\n *\n * The sheet takes drops (#1187, SB38–SB40, SB44, SB45, SB61) on its own\n * surface (`sheetKeys(name).surface`): the Rows tab's templates, and the\n * cards of every author's tab that declares a `drop` — each card's cells the\n * patch it sets — while its rows' grips move rows, lines and groups.\n *\n * The sheet fills its parent and draws no border.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useMemo, useRef, type KeyboardEvent, type RefObject } from \"react\";\nimport { Box, Button } from \"@chakra-ui/react\";\nimport { StringType, equalFor, equivalentFor, none, some, type ValueTypeOf } from \"@elaraai/east\";\nimport { SheetComponent, SheetPayloadType, sheetKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, BuilderFrame, NARROW_FRAME, SessionBanners, getSomeorUndefined, historyShortcut, implementUIComponent, takeKey, typedInto, useContainerWidth, useDataStable,\n    usePersistedState, useTrackedEvaluation, type EditIssue,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingReveal, keptRead } from \"@elaraai/east-ui-components/internal\";\nimport { FollowSources, type FollowedSources } from \"../../shared/schedule/follow-sources.js\";\nimport { sourcePart, type KeyVisibilityWords } from \"../../shared/schedule/visibility.js\";\nimport type { SheetDropCard, SheetDropHost, SheetDropTemplate } from \"../drop.js\";\nimport { SheetFooter } from \"../Footer.js\";\nimport {\n    SheetGrid, SheetProvider, SheetRoot, useSheetFooter, useSheetHistory, useSheetLoading, useSheetOptimise, useSheetToolbarItems, useSheetToolbarRef, type SheetHost,\n} from \"../index.js\";\nimport { todayUtc } from \"../parse/date.js\";\nimport { authorOf } from \"../../shared/records/author.js\";\nimport { SheetVocabularyProvider } from \"../messages.js\";\nimport { issueText, useSheetWords, type SheetWords } from \"../words.js\";\nimport { sheetCellEditor, useSheetInspector, type SheetLastCommit } from \"./inspector.js\";\nimport { tabLibrary, templateCardKey, templatesLibrary, useSheetLibrary } from \"./library.js\";\nimport { followedNouns, followedSources } from \"./sources.js\";\n\n/** The renderer's payload, decoded. */\nexport type SheetValue = ValueTypeOf<typeof SheetPayloadType>;\n\n/** The names the sheet keeps its viewer's state under. */\ntype SheetKeys = ReturnType<typeof sheetKeys>;\n\n/** The payload's equivalence: its data, and its functions by their IR and what they capture. */\nconst payloadEquivalent = equivalentFor(SheetPayloadType);\n/** Whether two sets of the app's words are one. */\nconst vocabularyEqual = equalFor(SheetPayloadType.fields.vocabulary);\nconst stringEqual = equalFor(StringType);\n\n/** No column hidden: what a viewer who has hidden none keeps. */\nconst NONE_HIDDEN: readonly string[] = [];\n\n/** No column hidden, as the grid reads it. */\nconst NO_COLUMN_HIDDEN: ReadonlySet<string> = new Set();\n\n/**\n * What the sheet takes dropped (#1187): on its surface, the Rows tab's\n * templates — each seeded as `newRow`'s or `newGroup`'s seed with its fields\n * over them — and the cards of every author's tab that declares a `drop`,\n * each card's cells the patch it sets.\n *\n * @param value - The payload\n * @param keys - The sheet's keys\n * @returns The sheet's drop host\n */\nfunction dropHostOf(value: SheetValue, keys: SheetKeys): SheetDropHost {\n    const listsRows = value.library.some((tab) => tab.type === \"rows\");\n    // By each card's key: two lists' templates may share a key in their records (#1345).\n    const templates = new Map(value.templates.map((t): [string, SheetDropTemplate] => [templateCardKey(t), {\n        name: t.name,\n        kind: t.seed.type,\n        seeds: t.seed.type === \"row\" ? { newRow: some(t.seed.value) } : { newGroup: some(t.seed.value) },\n    }]));\n    const tabs = new Map(value.library.flatMap((tab) => (tab.type === \"tab\" && tab.value.drop.type === \"some\"\n        ? [[tabLibrary(keys, tab.value), {\n            lands: tab.value.drop.value.type,\n            cards: new Map(tab.value.cards.map((card): [string, SheetDropCard] => [card.key, { label: card.label, sets: card.sets }])),\n        }] as const]\n        : [])));\n    return { surface: keys.surface, templates: listsRows ? { library: templatesLibrary(keys), byKey: templates } : undefined, tabs };\n}\n\n/**\n * The columns a viewer hides, as storage holds them: a list of keys, or\n * anything else a store held by mistake, which hides none.\n *\n * @param stored - What storage holds\n * @returns The keys hidden\n */\nfunction hiddenOf(stored: unknown): ReadonlySet<string> {\n    return new Set(Array.isArray(stored) ? stored.filter((key): key is string => typeof key === \"string\") : []);\n}\n\n/** Props of {@link EastChakraSheet}. */\nexport interface EastChakraSheetProps {\n    /** The payload, decoded. */\n    value: SheetValue;\n    /** The structural storage key. */\n    storageKey: string;\n}\n\n/**\n * The record's last commit (SB22, SB51): its newest commit's time, as the\n * day's time when it was today and in full otherwise, and who made it — what\n * a Sheet's footer and inspector say, and a Record's (#1531).\n *\n * @param history - The payload's `history`: over a record, its commits, newest first; `none` over `data`\n * @param words - The sheet's words\n * @returns The last commit, or `undefined` over `data`, while the commits are unread, or when there are none\n */\nexport function useLastCommit(history: SheetValue[\"history\"], words: SheetWords): SheetLastCommit | undefined {\n    const commits = getSomeorUndefined(history);\n    // Read where the sheet renders, and again when the record moves.\n    const read = useCallback(() => (commits === undefined ? none : commits()), [commits]);\n    const { result } = useTrackedEvaluation(read);\n    const last = result.ok && result.value.type === \"some\" ? result.value.value[0] : undefined;\n    const when = last === undefined ? undefined : stringEqual(words.date(last.at), words.date(todayUtc())) ? words.time(last.at) : words.dateTime(last.at);\n    // The person who made it; the platform's own commits — the deploy's (`system:deploy`) — and a write that named no\n    // one name no one.\n    const by = last === undefined ? undefined : authorOf(last.actor) ?? \"\";\n    // Held by its words: a render that reads the same commit hands the inspector the same one.\n    return useMemo(() => (when === undefined || by === undefined ? undefined : { when, by }), [when, by]);\n}\n\n/**\n * Renders the Sheet — see the module docs.\n *\n * @param props - The payload and its storage key\n * @returns The sheet, in its frame\n */\nexport function EastChakraSheet({ value, storageKey }: EastChakraSheetProps) {\n    // The app's words (#1516), over whatever table a host gives it: everything below reads them.\n    const vocabulary = useDataStable(value.vocabulary, vocabularyEqual);\n    return <SheetVocabularyProvider vocabulary={vocabulary}><SheetPayloadFrame value={value} storageKey={storageKey} /></SheetVocabularyProvider>;\n}\n\n/** The sheet, inside the app's words. */\nconst SheetPayloadFrame = memo(function SheetPayloadFrame({ value, storageKey }: EastChakraSheetProps) {\n    const name = getSomeorUndefined(value.name);\n    const keys = useMemo(() => sheetKeys(name), [name]);\n    // The columns this viewer hides (SB36), kept under the sheet's name: the\n    // grid leaves them out, and the library's Columns tab shows and hides them.\n    // A sheet without that tab hides none — nothing on it could show them\n    // again, and another sheet under the same name may have hidden them.\n    const { state: stored, setState: store } = usePersistedState<readonly string[]>(keys.columns, NONE_HIDDEN, keptRead.texts);\n    const listsColumns = value.library.some((tab) => tab.type === \"columns\");\n    const hidden = useMemo(() => (listsColumns ? hiddenOf(stored) : NO_COLUMN_HIDDEN), [listsColumns, stored]);\n    const onToggleColumn = useCallback((key: string) => {\n        store((was) => {\n            const off = [...hiddenOf(was)];\n            return off.some((k) => stringEqual(k, key)) ? off.filter((k) => !stringEqual(k, key)) : [...off, key];\n        });\n    }, [store]);\n    // What the sheet takes dropped: its templates and its author's cards, on its own surface (#1187).\n    const drop = useMemo(() => dropHostOf(value, keys), [value, keys]);\n    // What the rail counts each source the library follows in (#1345).\n    const words = useSheetWords();\n    const nouns = useMemo(() => followedNouns(value, words), [value, words]);\n    // The app's optimiser (#1409): its binding, which the Elara eye calls by name.\n    const optimise = value.optimise.type === \"some\" ? value.optimise.value.name : undefined;\n    // A phone's cell editor (`Mobile Sheet Spec.md` SH10, R9): the inspector's form at touch size, in the bottom container.\n    const cellEditor = useMemo(() => sheetCellEditor(value, words, hidden), [value, words, hidden]);\n    // The grid is a phone's as the frame is, 560 wide or less — never as main is, which a pane's rail beside it leaves\n    // narrower than the frame. Until the frame is laid out, the grid's own width decides.\n    const frameRef = useRef<HTMLDivElement | null>(null);\n    const frameWidth = useContainerWidth(frameRef);\n    const phone = frameWidth > 0 ? frameWidth <= NARROW_FRAME : undefined;\n    // The inspector's forms: the bounds a row's numbers are held to (#1585).\n    const forms = getSomeorUndefined(value.inspector)?.forms;\n    // What the frame hands the parts: the columns the viewer hid, the drops the sheet takes, the sources' nouns, the\n    // optimiser, a phone's cell editor, whether the grid is a phone's, the inspector's forms, and whether its Autosave\n    // begins on.\n    const autosave = value.autosave;\n    const host = useMemo((): SheetHost => ({ hidden, drop, nouns, optimise: optimise === undefined ? undefined : { name: optimise }, cellEditor, phone, forms, autosave }),\n        [hidden, drop, nouns, optimise, cellEditor, phone, forms, autosave]);\n    return (\n        <SheetProvider value={value.sheet} storageKey={storageKey} host={host}>\n            <SheetFrame value={value} keys={keys} hidden={hidden} onToggleColumn={onToggleColumn} nouns={nouns} frameRef={frameRef} />\n        </SheetProvider>\n    );\n}, (prev, next) => payloadEquivalent(prev.value, next.value) && prev.storageKey === next.storageKey);\n\n/** Props of {@link SheetFrame}. */\ninterface SheetFrameProps {\n    /** The payload, decoded. */\n    value: SheetValue;\n    /** The names the sheet keeps its viewer's state under. */\n    keys: SheetKeys;\n    /** The columns this viewer hides. */\n    hidden: ReadonlySet<string>;\n    /** Hides a column, or shows it again. */\n    onToggleColumn: (key: string) => void;\n    /** What the rail counts each source the library follows in. */\n    nouns: ReadonlyMap<string, string>;\n    /** The frame's root: what the frame's width, and so whether the grid is a phone's, is measured on. */\n    frameRef: RefObject<HTMLDivElement | null>;\n}\n\n/**\n * The frame, once each source its library follows is read (#1345): what the\n * Rows tab and an author's tab show of their sources, and the banners of the\n * ones that could not be read.\n */\nfunction SheetFrame(props: SheetFrameProps) {\n    const { m } = useSheetWords();\n    const { value, nouns } = props;\n    const chrome = getSomeorUndefined(value.sheet.slice);\n    const sources = useMemo(() => followedSources(value), [value]);\n    // What a source's failed narrowing says, in the sheet's words.\n    const said = useCallback((name: string): KeyVisibilityWords => ({ changed: m.sourceChanged({ name }), failed: m.sourceFailed({ name }) }), [m]);\n    return (\n        <FollowSources chrome={chrome} narrowed={value.narrowed} sources={sources} nouns={nouns} said={said}>\n            {(followed) => <SheetFrameBody {...props} followed={followed} />}\n        </FollowSources>\n    );\n}\n\n/** The frame, its regions holding the sheet's parts. */\nfunction SheetFrameBody({ value, keys, hidden, onToggleColumn, frameRef, followed }: SheetFrameProps & { followed: FollowedSources }) {\n    const words = useSheetWords();\n    const { m } = words;\n    const items = useSheetToolbarItems();\n    const toolbarRef = useSheetToolbarRef();\n    const footer = useSheetFooter();\n    const loading = useSheetLoading();\n    const { session, onAction } = useSheetHistory();\n    const optimise = useSheetOptimise();\n    const lastCommit = useLastCommit(value.history, words);\n    const saved = lastCommit === undefined ? undefined : m.savedAt({ when: lastCommit.when });\n    const library = useSheetLibrary({ value, keys, hidden, onToggleColumn, words, followed });\n    const inspector = useSheetInspector({ value, keys, words, hidden, lastCommit });\n    // A Save that takes rows out of the `rows` source's narrowing says so in the footer.\n    const rowsPart = useMemo(() => sourcePart(getSomeorUndefined(value.sheet.slice), \"rows\"), [value.sheet.slice]);\n    // An issue's place: its row's key, or on a grouped sheet its line in its group.\n    const where = useCallback((issue: EditIssue) => (issue.entry === \"\" || issue.row.type === \"none\" ? issue.entry\n        : m.rowRef({ line: true, number: words.number(Number(issue.row.value) + 1), title: issue.entry, noun: m.groupNoun() })), [m, words]);\n    const readIssue = useCallback((message: string) => issueText(message, words), [words]);\n    // The history keys from anywhere in the frame (SB26): the grid's own it has answered already. Taken, they go no\n    // further than the Sheet (#1398).\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n        if (event.defaultPrevented || typedInto(event.target)) return;\n        const action = historyShortcut(event);\n        if (action === undefined) return;\n        takeKey(event);\n        onAction(action);\n    }, [onAction]);\n    const missing = getSomeorUndefined(value.missing);\n    // A sheet with no control to show — read only, no slice, no key search — draws no toolbar.\n    const toolbar = items.some((item) => item !== undefined && item !== false) ? items : undefined;\n    const failed = [...followed.values()].filter((source) => source.error !== undefined);\n    const banners = (\n        <>\n            {optimise.banner}\n            <SessionBanners session={session} words={words} onAction={onAction} where={where} issueText={readIssue} />\n            {failed.map((source) => (\n                <Box key={source.name} data-sheet-banner=\"source\">\n                    <BannerView status=\"error\" title={m.sourceUnavailable({ name: source.name })} description={source.error}\n                        actions={<Button size=\"xs\" variant=\"outline\" onClick={source.retry}>{m.retry()}</Button>} />\n                </Box>\n            ))}\n            {missing !== undefined && (\n                <Box data-sheet-banner=\"missing\">\n                    <BannerView status=\"neutral\" title={m.entryMissing({ key: missing })} />\n                </Box>\n            )}\n        </>\n    );\n    // The sheet's one reveal clock (#1398, CL4): the footer's line and the runs' placeholders show once a read the view\n    // waits for has passed the delay, and are held once shown — a flip renders them, never the frame.\n    const waiting = footer.loading !== undefined && footer.loading.kind !== \"failed\";\n    // The run's landing (#1409) is measured and drawn over the whole frame — the cells and the counts alike — on the\n    // frame's own root: the sheet has no root of its own around its frame, and a wrapper there would be the box a host\n    // sizes and measures the sheet through. The frame's width is measured on it too.\n    const landingRef = optimise.landing.ref;\n    const rootRef = useCallback((root: HTMLDivElement | null) => {\n        landingRef.current = root;\n        frameRef.current = root;\n    }, [landingRef, frameRef]);\n    return (\n        <LoadingReveal waiting={waiting}>\n            <BuilderFrame\n                ref={rootRef}\n                rootCss={optimise.landing.css}\n                rootProps={optimise.landing.attributes}\n                storageKey={keys.frame}\n                toolbar={toolbar}\n                toolbarRef={toolbarRef}\n                banners={banners}\n                start={library}\n                end={inspector}\n                footer={<SheetFooter {...footer} saved={saved} recordSlice={rowsPart} />}\n                // A paged source's cold load is the frame's skeleton at the rows' pitch, its footer live and saying what\n                // is read; after it, a read the view waits for leaves everything live and the grid busy (#1398).\n                loading={loading.cold}\n                busy={loading.busy}\n                loadingPitch={loading.pitch}\n                liveFooter\n                onKeyDown={onKeyDown}\n            >\n                <SheetRoot>\n                    <SheetGrid />\n                </SheetRoot>\n            </BuilderFrame>\n        </LoadingReveal>\n    );\n}\n\nimplementUIComponent(SheetComponent, EastChakraSheet);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Record's clock (`Record - DX Proposal.md` §2.3, C7): the instant its\n * age cells count to — the browser's, read as the Record mounts and again at\n * each whole minute — and an age column's count of a row's moment against\n * it: its hours to the instant, its days and weeks to the viewer's own day.\n * Every part that counts reads the one instant, so a day that turns over\n * where the viewer is moves the age cells, their stale dots, the footer's\n * count, the inspector's facts and the cells from data, read at its day\n * (#1559), together.\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext, type ReactNode } from \"react\";\nimport { IntegerType, lessFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { useNow } from \"../shared/time/now-line.js\";\nimport { SheetDayProvider, sheetDayOf } from \"../sheet/day.js\";\nimport type { SheetColumnMeta } from \"../sheet/model.js\";\nimport type { SheetCellValue } from \"../sheet/values.js\";\n\nconst RecordClockContext = createContext<Date | undefined>(undefined);\n\n/**\n * Provides the Record's clock to the parts under it, and its day to the sheet's. As it moves, only the parts that read\n * it draw again — the sheet's, only as the day turns.\n *\n * @param props - The parts under it\n * @returns The provider\n */\nexport function RecordClock({ children }: { children: ReactNode }) {\n    const now = useNow(undefined);\n    return <RecordClockContext.Provider value={now}><SheetDayProvider now={now}>{children}</SheetDayProvider></RecordClockContext.Provider>;\n}\n\n/**\n * Reads the instant the Record counts to; a part outside a {@link RecordClock} is a mistake of the frame's, and throws.\n *\n * @returns Now, as the Record's clock last read it\n */\nexport function useRecordNow(): Date {\n    const now = useContext(RecordClockContext);\n    if (now === undefined) throw new Error(\"A Record part reads the clock outside a RecordClock\");\n    return now;\n}\n\n/** An age column's count at a row: the hours since the row's moment, or the days or weeks since its date, against the column's threshold. */\nexport interface RecordAge {\n    /** Whole units since the moment. */\n    n: bigint;\n    /** What one counts. */\n    unit: \"hours\" | \"days\" | \"weeks\";\n    /** At or past this many, the row is stale. */\n    threshold: bigint | undefined;\n    /** Whether the count has reached the threshold. */\n    stale: boolean;\n}\n\nconst integerLess = lessFor(IntegerType);\n\n/**\n * An age column's count at a row — its `elapsed`, from the row's moment: its hours to now, its days and weeks to the\n * viewer's own day ({@link sheetDayOf}), so they turn over at the viewer's midnight, as the columns read at the day do.\n *\n * @param meta - The column\n * @param cell - The row's moment: a DateTime, else none\n * @param now - The Record's now\n * @returns The count; `undefined` for a column that counts nothing, a row with no moment, or an `elapsed` that fails\n */\nexport function ageOf(meta: SheetColumnMeta, cell: SheetCellValue | undefined, now: Date): RecordAge | undefined {\n    const kind = meta.raw.kind;\n    if (kind.type !== \"age\" || cell?.type !== \"DateTime\") return undefined;\n    let n: bigint;\n    try {\n        n = kind.value.elapsed(cell.value, kind.value.unit.type === \"hours\" ? now : sheetDayOf(now));\n    } catch (err) {\n        console.error(`[Record] elapsed failed on column \"${meta.key}\":`, err);\n        return undefined;\n    }\n    const threshold = getSomeorUndefined(kind.value.stale);\n    return { n, unit: kind.value.unit.type, threshold, stale: threshold !== undefined && !integerLess(n, threshold) };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Record's own words (`Record - DX Proposal.md` SL1, ST8, EM1, C1–C10,\n * FR5, FR6, AD1–AD7, SP1–SP6, FT1, IN2–IN4, IN7–IN9): its select column's,\n * a new row's required cell's, its empty state's, its cells' — their hovers,\n * an age's and an audit's, the words for no one and for no value where a\n * column gives none, and a mark's after a cell's own — and its toolbar's, its status line's, its strip's, its\n * footer's and its inspector's, each in the Record's word for its rows. Every\n * other word it shows is the Sheet's, but the message of an empty field a new\n * row needs, which the Record says its own way in the Sheet's place.\n *\n * @packageDocumentation\n */\n\nimport { withArticle } from \"../shared/article.js\";\n\n/** What an age counts. */\ntype AgeUnit = \"hours\" | \"days\" | \"weeks\";\n\n/** An age's unit, one and many. */\nconst UNITS: Readonly<Record<AgeUnit, readonly [string, string]>> = {\n    hours: [\"hour\", \"hours\"],\n    days: [\"day\", \"days\"],\n    weeks: [\"week\", \"weeks\"],\n};\n\n/** A count of rows in the Record's word for them, one and many: `1 person`, `2 people`. */\nfunction counted(p: { n: number; count: string; noun: string; nouns: string }): string {\n    return `${p.count} ${p.n === 1 ? p.noun : p.nouns}`;\n}\n\n/** A count of changes: `1 change`, `3 changes`. */\nfunction changesOf(n: number, count: string): string {\n    return `${count} ${n === 1 ? \"change\" : \"changes\"}`;\n}\n\n/** What an Apply sends (AD4): the fields it changes and on how many rows the record holds, the rows it adds, and those it deletes. */\nexport interface RecordTally {\n    /** How many fields it changes on rows the record holds. */\n    readonly changes: number;\n    /** On how many of them. */\n    readonly changed: number;\n    /** How many new rows. */\n    readonly added: number;\n    /** How many rows it deletes. */\n    readonly deleted: number;\n}\n\n/** A line's words, parts of them in the line's strong ink: the footer's `N of M people`, its N strong. */\nexport type RecordLineText = readonly (string | { readonly strong: string })[];\n\n/** The Record's message table. */\nexport interface RecordMessages {\n    /** The header's box: every row shown ticked, it unticks them all. */\n    tickAll: (p: { all: boolean }) => string;\n    /** A row's box, by the row's name. */\n    tickRow: (p: { name: string; ticked: boolean }) => string;\n    /** A new row's empty cell a person must fill. */\n    required: (p: { header: string }) => string;\n    /** Nothing shown: the rail's search matches no row — else its filters. */\n    emptyTitle: (p: { nouns: string; query: boolean }) => string;\n    /** Nothing shown: clears the search — else the filters. */\n    emptyClear: (p: { query: boolean }) => string;\n    /** A title's hover: the title, and the row's key. */\n    titleTitle: (p: { title: string; id: string }) => string;\n    /** A person cell with no one in it, where its column gives no words of its own. */\n    unassigned: () => string;\n    /** A cell with no value, where its column gives no words of its own. */\n    absent: () => string;\n    /** A cell's words — its hover, its strip's — with its mark's after them (#1560): `Competent · locked: licence`. */\n    marked: (p: { text: string | undefined; words: string; lock: boolean }) => string;\n    /** A cycle's or a toggle's hover: its column, the state it holds, and — while a draft changed it — the record's. */\n    stateTitle: (p: { header: string; state: string; was: string | undefined }) => string;\n    /** The dot of an age at its column's threshold. */\n    stale: () => string;\n    /** An age's hover: the count, and once it is stale, the threshold. */\n    ageTitle: (p: { count: string; one: boolean; unit: AgeUnit; stale: boolean; threshold: string | undefined }) => string;\n    /** An audit's verb and who, beside its date in blame mode. */\n    auditMeta: (p: { verb: string; by: string }) => string;\n    /** An audit's hover: when, to the minute, then the verb and who. */\n    auditTitle: (p: { when: string; verb: string; by: string }) => string;\n    /** An audit while the row's drafts change its fields. */\n    pending: () => string;\n    /** How many fields they change: `2 changes` in blame mode, `2` in date mode. */\n    pendingMeta: (p: { count: string; one: boolean; blame: boolean }) => string;\n    /** A pending audit's hover. */\n    pendingTitle: (p: { count: string }) => string;\n    /** The rows, where the Record names them no other way: one and many. */\n    rowNoun: () => { singular: string; plural: string };\n    /** Add's words (FR6). */\n    add: () => string;\n    /** Add's hover: what it drafts. */\n    addTip: (p: { noun: string }) => string;\n    /** Delete's words (FR6). */\n    delete: () => string;\n    /** Delete's hover: how many rows it deletes, or how to choose them. */\n    deleteTip: (p: { n: number; count: string }) => string;\n    /** The status line once Add has drafted a row (AD1). */\n    added: (p: { noun: string }) => string;\n    /** The status line once Add drafted nothing: the field no person can set that the app left empty (AD2). */\n    cantAdd: (p: { noun: string; label: string }) => string;\n    /**\n     * The status line once new rows took new keys as they were saved, another save having added rows under theirs\n     * (#1583): the first's keys, and how many.\n     */\n    renumbered: (p: { from: string; to: string; n: number; count: string; noun: string; nouns: string }) => string;\n    /** The status line once Delete has taken rows out (AD5). */\n    deleted: (p: { n: number; count: string; noun: string; nouns: string }) => string;\n    /** The status line once Undo has put deleted rows back (AD5). */\n    restored: (p: { n: number; count: string; noun: string; nouns: string }) => string;\n    /** The status line once Undo has taken a step back (AD7). */\n    undid: () => string;\n    /** The status line once Redo has taken a step again (AD7). */\n    redid: () => string;\n    /** The status line once Discard has dropped every draft (AD6). */\n    discarded: (p: { n: number; count: string }) => string;\n    /** The status line once Apply's batch is written (AD4): what it sent, each count in words by `count`. */\n    applied: (p: { tally: RecordTally; count: (n: number) => string; noun: string; nouns: string }) => string;\n    /** The status line once Issues has taken the ring to the first (AD3): the empty fields, or every issue where the app's refusals are among them. */\n    issues: (p: { n: number; count: string; refused: boolean }) => string;\n    /** The status line while rows are ticked (FR5). */\n    selected: (p: { count: string; of: string }) => string;\n    /** The footer's rows (FT1): the narrowing's, of the record's — the first strong. */\n    shownOf: (p: { shown: string; total: string; n: number; noun: string; nouns: string }) => RecordLineText;\n    /** The footer's stale note (FT1): how many rows the first age column with a threshold says are stale. */\n    staleNote: (p: { count: string; threshold: string; unit: AgeUnit; one: boolean }) => string;\n    /** The strip over nothing (SP1): what a click on a cell does, and on a row. */\n    stripRest: (p: { steps: boolean; inspector: boolean }) => string;\n    /** The strip's keys where the cell takes none of its own: the ring's moves. */\n    stripMove: () => string;\n    /** The strip's label over a cell holding a state (SP2): its column, and the state. */\n    stripState: (p: { header: string; state: string }) => string;\n    /** The strip over a cycle (SP2): the row, the state's name, what the record holds while a draft changed it, and — where it steps — where a click and a ⇧-click take it. */\n    stripCycle: (p: { name: string; meta: string; was: string | undefined; next: string | undefined; previous: string | undefined }) => string;\n    /** A cycle's keys (SP2): Space steps, the members' one-key labels set, ⌫ sets the first. */\n    stripCycleKeys: (p: { set: string | undefined; first: string }) => string;\n    /** The strip over a toggle or a boolean: the row, what the record holds while a draft changed it, and — where it flips — what a click sets. */\n    stripFlip: (p: { name: string; was: string | undefined; next: string | undefined }) => string;\n    /** A toggle's or a boolean's keys. */\n    stripFlipKeys: () => string;\n    /** A boolean's state in words, where a toggle says its own. */\n    booleanWord: (p: { on: boolean }) => string;\n    /** The strip's label over a title (SP3): the Record's word for a row, and its key. */\n    stripTitle: (p: { noun: string; id: string }) => string;\n    /** The strip over a title (SP3): the title, a word of the row's, and where its details are. */\n    stripTitleText: (p: { title: string; detail: string | undefined; inspector: boolean }) => string;\n    /** The strip over an age (SP4): what it counts, and its threshold — or, stale, for how long. */\n    stripAge: (p: { unit: AgeUnit; count: string; one: boolean; stale: boolean; threshold: string | undefined }) => string;\n    /** The strip over an audit while the row's drafts change its fields (SP5). */\n    stripPending: (p: { count: string }) => string;\n    /** The strip over a new row's empty field a person must fill (SP6): what Apply waits for, and how the field is set. */\n    stripRequired: (p: { noun: string; how: { cycle: string } | \"click\" | \"inspector\" | undefined }) => string;\n    /** A new row's field's keys (SP6). */\n    stripRemoveRow: () => string;\n    /** A Sheet kind's keys, at rest: ⏎ edits, where it edits. */\n    stripEdit: (p: { editable: boolean }) => string;\n    /** The inspector's chip on a row whose drafts change its fields (IN2): how many. */\n    detailsPending: (p: { count: string }) => string;\n    /** The inspector's counts with no row selected (IN8): the rows shown, the drafts pending, the rows stale. */\n    detailsStat: (p: { stat: \"shown\" | \"pending\" | \"stale\" }) => string;\n    /** The inspector with no row selected (IN8): where a row's fields show. */\n    detailsHint: () => string;\n    /** The inspector's section of the fields of a column group with no label (IN4). */\n    otherGroup: () => string;\n    /** An empty field a new row needs, as its Details' issues and the Issues tab say it (IN3, IN9). */\n    fieldRequired: () => string;\n    /** A new row with no title yet, as the Issues tab and the banners name it (IN9): `New person`. */\n    newRow: (p: { noun: string }) => string;\n    /** The status line once Duplicate has drafted a copy of a row (IN7): the row copied, by its name. */\n    duplicated: (p: { name: string }) => string;\n}\n\n/** The Record's words in English. */\nexport const recordMessages: RecordMessages = {\n    tickAll: ({ all }) => (all ? \"Deselect all\" : \"Select all shown\"),\n    tickRow: ({ name, ticked }) => `${ticked ? \"Deselect\" : \"Select\"} ${name}`,\n    required: ({ header }) => `${header} · required`,\n    emptyTitle: ({ nouns, query }) => `No ${nouns} match the ${query ? \"search\" : \"filters\"}`,\n    emptyClear: ({ query }) => `Clear the ${query ? \"search\" : \"filters\"} →`,\n    titleTitle: ({ title, id }) => `${title} · ${id}`,\n    unassigned: () => \"Unassigned\",\n    absent: () => \"—\",\n    marked: ({ text, words, lock }) => [text ?? \"\", lock ? (words === \"\" ? \"locked\" : `locked: ${words}`) : words].filter((part) => part !== \"\").join(\" · \"),\n    stateTitle: ({ header, state, was }) => (was === undefined ? `${header} · ${state}` : `${header} · ${state} · was ${was}`),\n    stale: () => \"Stale\",\n    ageTitle: ({ count, one, unit, stale, threshold }) => {\n        const age = `${count} ${UNITS[unit][one ? 0 : 1]}`;\n        return !stale ? age : threshold === undefined ? `Stale · ${age}` : `Stale · ${age} · threshold ${threshold}`;\n    },\n    // The parts a row holds, the empty ones left out.\n    auditMeta: ({ verb, by }) => [verb, by].filter((part) => part !== \"\").join(\" · \"),\n    auditTitle: ({ when, verb, by }) => [when, verb, by].filter((part) => part !== \"\").join(\" · \"),\n    pending: () => \"Pending\",\n    pendingMeta: ({ count, one, blame }) => (blame ? `${count} ${one ? \"change\" : \"changes\"}` : count),\n    pendingTitle: ({ count }) => `${count} pending`,\n    rowNoun: () => ({ singular: \"row\", plural: \"rows\" }),\n    add: () => \"Add\",\n    addTip: ({ noun }) => `Add ${withArticle(noun)}`,\n    delete: () => \"Delete\",\n    deleteTip: ({ n, count }) => (n === 0 ? \"Tick rows to delete them\" : `Delete ${count} selected`),\n    added: ({ noun }) => `Added ${withArticle(noun)}`,\n    cantAdd: ({ noun, label }) => `Can't add ${withArticle(noun)} — the app gives no ${label}`,\n    renumbered: ({ from, to, n, count, noun, nouns }) => (n === 1 ? `${from} was taken by another save — the new ${noun} is ${to}`\n        : `${count} new ${nouns} renumbered — their keys were taken by another save`),\n    deleted: (p) => `Deleted ${counted(p)} · Apply writes it, Undo restores`,\n    restored: (p) => `Restored ${counted(p)}`,\n    undid: () => \"Undid one change\",\n    redid: () => \"Redid one change\",\n    discarded: ({ n, count }) => `Discarded ${changesOf(n, count)}`,\n    // `Applied 3 changes to 2 people · added 1 · deleted 1`: what leads, then the rest, each part only where there is one.\n    applied: ({ tally, count, noun, nouns }) => {\n        const parts: string[] = [];\n        if (tally.changes > 0) parts.push(`${changesOf(tally.changes, count(tally.changes))} to ${counted({ n: tally.changed, count: count(tally.changed), noun, nouns })}`);\n        if (tally.added > 0) parts.push(parts.length === 0 ? `${count(tally.added)} new ${tally.added === 1 ? noun : nouns}` : `added ${count(tally.added)}`);\n        if (tally.deleted > 0) {\n            parts.push(parts.length === 0 ? `the deletion of ${counted({ n: tally.deleted, count: count(tally.deleted), noun, nouns })}` : `deleted ${count(tally.deleted)}`);\n        }\n        return parts.length === 0 ? \"Applied\" : `Applied ${parts.join(\" · \")}`;\n    },\n    issues: ({ n, count, refused }) => (refused ? `${count} ${n === 1 ? \"issue holds\" : \"issues hold\"} Apply` : `${count} required ${n === 1 ? \"field\" : \"fields\"} empty`),\n    selected: ({ count, of }) => `${count} selected of ${of}`,\n    shownOf: ({ shown, total, n, noun, nouns }) => [{ strong: shown }, ` of ${total} ${n === 1 ? noun : nouns}`],\n    staleNote: ({ count, threshold, unit, one }) => `${count} stale · no update in ${threshold} ${UNITS[unit][one ? 0 : 1]}`,\n    stripRest: ({ steps, inspector }) => (steps && inspector ? \"Click a cell to step it · select a row to open it in the inspector\"\n        : steps ? \"Click a cell to step it\" : inspector ? \"Select a row to open it in the inspector\" : \"\"),\n    stripMove: () => \"↑ ↓ ← → move\",\n    stripState: ({ header, state }) => `${header} · ${state}`,\n    // The parts the cell has, in order: `A. Morgan · Supervised · was 0 · click → 2 · ⇧-click → 0`.\n    stripCycle: ({ name, meta, was, next, previous }) => [name, meta, was === undefined ? \"\" : `was ${was}`, next === undefined ? \"\" : `click → ${next}`,\n        previous === undefined ? \"\" : `⇧-click → ${previous}`].filter((part) => part !== \"\").join(\" · \"),\n    stripCycleKeys: ({ set, first }) => (set === undefined ? `space next · ⌫ ${first}` : `space next · ${set} set · ⌫ ${first}`),\n    stripFlip: ({ name, was, next }) => [name, was === undefined ? \"\" : `was ${was}`, next === undefined ? \"\" : `click → ${next}`].filter((part) => part !== \"\").join(\" · \"),\n    stripFlipKeys: () => \"space flips\",\n    booleanWord: ({ on }) => (on ? \"yes\" : \"no\"),\n    stripTitle: ({ noun, id }) => `${noun} · ${id}`,\n    stripTitleText: ({ title, detail, inspector }) => [title, detail ?? \"\", inspector ? \"details in the inspector\" : \"\"].filter((part) => part !== \"\").join(\" · \"),\n    stripAge: ({ unit, count, one, stale, threshold }) => {\n        const counted = UNITS[unit];\n        if (stale) return threshold === undefined ? `Stale · no change for ${count} ${counted[one ? 0 : 1]}` : `Stale · no change for ${count} ${counted[one ? 0 : 1]} · threshold ${threshold}`;\n        const since = `${counted[1].charAt(0).toUpperCase()}${counted[1].slice(1)} since the last change`;\n        return threshold === undefined ? since : `${since} · stale from ${threshold}`;\n    },\n    stripPending: ({ count }) => `${count} pending · applies with the history bar`,\n    stripRequired: ({ noun, how }) => {\n        const waits = `Required · Apply waits for every field of a new ${noun}`;\n        return how === undefined ? waits : how === \"click\" ? `${waits} · click sets it` : how === \"inspector\" ? `${waits} · set it in the inspector` : `${waits} · click sets ${how.cycle}`;\n    },\n    stripRemoveRow: () => \"⌘Z removes the row\",\n    stripEdit: ({ editable }) => (editable ? \"⏎ edit · ↑ ↓ ← → move\" : \"↑ ↓ ← → move\"),\n    detailsPending: ({ count }) => `${count} pending`,\n    detailsStat: ({ stat }) => (stat === \"shown\" ? \"Shown\" : stat === \"pending\" ? \"Pending\" : \"Stale\"),\n    detailsHint: () => \"Select a row to see its fields here.\",\n    otherGroup: () => \"Other\",\n    fieldRequired: () => \"Required\",\n    newRow: ({ noun }) => `New ${noun}`,\n    duplicated: ({ name }) => `Duplicated ${name}`,\n};\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The cells of the kinds only a Record draws (`Record - DX Proposal.md`\n * C1–C10), each from its row's cells and its column's payload, its look a\n * data attribute on the record recipe's slots:\n *\n * - **title** (C1) — the title, its neutral initials before it with `avatar`;\n * - **person** (C2) — the member's initials and label, or a dashed ring and the\n *   words for no one;\n * - **boolean** (C3) — a checkbox;\n * - **cycle** and **toggle** (C4–C6) — a chip as wide as its column's widest\n *   label, a scale's member up the heat ramp and any other in its tone's\n *   wash; or the mark look, a scale's pips — a toggle's one — or a valence's\n *   dot and word;\n * - **age** (C7) — whole units to the Record's clock, a dot once it is stale;\n * - **audit** (C8, C9) — the date, and in blame mode the verb and who; while\n *   the row's drafts change its fields, PENDING and how many;\n * - **an absent value** (C10) — in the column's words, else a dash.\n *\n * A row the record does not hold yet has no age and no audit to show. Every\n * other kind draws as the Sheet's cell content draws it (C11).\n *\n * @packageDocumentation\n */\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCheck } from \"@fortawesome/free-solid-svg-icons\";\nimport { IntegerType, StringType, equalFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { formatDatePattern, type SlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport type { SheetRowChanges } from \"../sheet/index.js\";\nimport { resolveMember, type SheetColumnIndex, type SheetColumnMeta, type SheetRegisterIndex } from \"../sheet/model.js\";\nimport type { SheetCellValue, SheetRowValue } from \"../sheet/values.js\";\nimport type { SheetWords } from \"../sheet/words.js\";\nimport { ageOf } from \"./clock.js\";\nimport { recordMessages as m } from \"./messages.js\";\n\nconst stringEqual = equalFor(StringType);\nconst integerEqual = equalFor(IntegerType);\n\n/** What a cell of a Record's own kind draws, and what it says on hover. */\nexport interface RecordCellView {\n    /** What the cell holds. */\n    content: ReactNode;\n    /** Its hover; `undefined` where it says nothing beyond its value. */\n    title: string | undefined;\n}\n\n/** What a cell of a Record's own kind is drawn from. */\nexport interface RecordCellInput {\n    /** The record recipe's slot styles. */\n    styles: SlotStyles;\n    /** The cell's column. */\n    meta: SheetColumnMeta;\n    /** The cell's row: its key, and the rule cells an audit reads. */\n    row: SheetRowValue;\n    /** The cell. */\n    cell: SheetCellValue | undefined;\n    /** The registers, by name. */\n    registers: SheetRegisterIndex;\n    /** What the row's drafts changed; `undefined` for a row no gesture has touched. */\n    changes: SheetRowChanges | undefined;\n    /** The Record's now: what an age counts to. */\n    now: Date;\n    /** The Sheet's words: the counts in the viewer's language. */\n    words: SheetWords;\n    /** A cycle's or a toggle's chip's least width in characters: its column's widest label. */\n    chip: number | undefined;\n}\n\n/**\n * A name's initials (C1): the first letters of its first and last words, its\n * dots left out — `A. Morgan` is `AM`; a single word, its first letter.\n *\n * @param name - The name\n * @returns The initials, as written: the recipe sets their case\n */\nfunction initialsOf(name: string): string {\n    const parts = name.replace(/\\./g, \"\").split(/\\s+/).filter((part) => part !== \"\");\n    if (parts.length === 0) return \"\";\n    const first = [...parts[0]!][0] ?? \"\";\n    return parts.length === 1 ? first : first + ([...parts[parts.length - 1]!][0] ?? \"\");\n}\n\n/**\n * A scale's member's look (C5): the first empty, the rest up the heat ramp\n * to its fourth step, evenly — of three members, the second's the second step\n * and the third's the fourth. The footer's legend draws its chips so (FT2).\n *\n * @param at - The member's place in the register; `-1` for a key no member has\n * @param n - How many members the register has\n * @returns The look\n */\nexport function heatOf(at: number, n: number): string {\n    return at <= 0 || n < 2 ? \"none\" : `heat-${Math.max(1, Math.round((4 * at) / (n - 1)))}`;\n}\n\n/**\n * The label a register's member shows for the key a cell holds, as the\n * Sheet's cells show it: the key itself where no member has it.\n *\n * @param registers - The registers\n * @param register - The column's register\n * @param key - The key\n * @returns The label\n */\nfunction labelFor(registers: SheetRegisterIndex, register: string | undefined, key: string): string {\n    const member = resolveMember(registers, register, key);\n    return member !== undefined && stringEqual(member.key, key) && member.label !== \"\" ? member.label : key;\n}\n\n/**\n * Each cycle's and toggle's chip's least width in characters, by column key\n * (C4): its widest label, one width a column, so its states line up.\n *\n * @param columns - The columns drawn\n * @param registers - The registers\n * @returns The widths\n */\nexport function chipWidths(columns: SheetColumnIndex, registers: SheetRegisterIndex): ReadonlyMap<string, number> {\n    const out = new Map<string, number>();\n    for (const meta of columns.list) {\n        const kind = meta.raw.kind;\n        const labels = kind.type === \"toggle\" ? [kind.value.on, kind.value.off]\n            : kind.type === \"cycle\" ? (registers.byName.get(kind.value.register) ?? []).map((member) => (member.label !== \"\" ? member.label : member.key))\n                : undefined;\n        if (labels !== undefined) out.set(meta.key, labels.reduce((n, label) => Math.max(n, [...label].length), 0));\n    }\n    return out;\n}\n\n/**\n * A cell of one of the kinds only a Record draws — see the module docs.\n *\n * @param input - The cell, its row and its column, and what they are read against\n * @returns What the cell draws and says on hover; `undefined` for a Sheet kind, which the Sheet's cell content draws\n */\nexport function recordCell(input: RecordCellInput): RecordCellView | undefined {\n    const { styles, meta, row, cell, registers, changes, now, words, chip } = input;\n    const kind = meta.raw.kind;\n    // A chip's least width: its column's widest label, at the chip's own face.\n    const chipStyle = { \"--record-chip-ch\": chip ?? 0 } as CSSProperties;\n    switch (kind.type) {\n        case \"title\": {\n            const title = cell?.type === \"String\" ? cell.value : \"\";\n            if (title === \"\") return { content: null, title: undefined };\n            return {\n                content: (\n                    <>\n                        {kind.value.avatar && <Box as=\"span\" css={styles.avatar} data-slot=\"avatar\" aria-hidden=\"true\">{initialsOf(title)}</Box>}\n                        <Box as=\"span\" css={styles.titleCell} data-slot=\"titleCell\">{title}</Box>\n                    </>\n                ),\n                title: m.titleTitle({ title, id: row.id }),\n            };\n        }\n        case \"person\": {\n            const key = cell?.type === \"String\" ? cell.value : \"\";\n            if (key === \"\") {\n                const nobody = getSomeorUndefined(kind.value.unassigned) ?? m.unassigned();\n                return {\n                    content: (\n                        <>\n                            <Box as=\"span\" css={styles.nobody} data-slot=\"nobody\" role=\"img\" aria-label={nobody} />\n                            <Box as=\"span\" css={styles.personLabel} data-slot=\"personLabel\" data-nobody=\"\" aria-hidden=\"true\">{nobody}</Box>\n                        </>\n                    ),\n                    title: undefined,\n                };\n            }\n            const label = labelFor(registers, kind.value.register, key);\n            return {\n                content: (\n                    <>\n                        <Box as=\"span\" css={styles.avatar} data-slot=\"avatar\" aria-hidden=\"true\">{initialsOf(label)}</Box>\n                        <Box as=\"span\" css={styles.personLabel} data-slot=\"personLabel\">{label}</Box>\n                    </>\n                ),\n                title: label,\n            };\n        }\n        case \"boolean\": {\n            const on = cell?.type === \"Boolean\" && cell.value;\n            return {\n                content: (\n                    <Box as=\"span\" css={styles.box} data-slot=\"box\" data-on={on ? \"\" : undefined} role=\"checkbox\" aria-checked={on} aria-label={meta.header}>\n                        {on && <FontAwesomeIcon icon={faCheck} />}\n                    </Box>\n                ),\n                title: undefined,\n            };\n        }\n        case \"toggle\": {\n            if (cell?.type !== \"Boolean\") return { content: <Box as=\"span\" css={styles.absent} data-slot=\"absent\">{m.absent()}</Box>, title: undefined };\n            const state = cell.value ? kind.value.on : kind.value.off;\n            // What the record holds, while a draft changed it.\n            const held = changes !== undefined && changes.dirty.has(meta.key) ? changes.held?.get(meta.key) : undefined;\n            return {\n                content: kind.value.look.type === \"mark\"\n                    ? (\n                        <Box as=\"span\" css={styles.pips} data-slot=\"pips\" role=\"img\" aria-label={state}>\n                            <Box as=\"span\" css={styles.pip} data-slot=\"pip\" data-on={cell.value ? \"\" : undefined} />\n                        </Box>\n                    )\n                    : <Box as=\"span\" css={styles.chip} data-slot=\"chip\" data-look={cell.value ? \"heat-4\" : \"none\"} style={chipStyle}>{state}</Box>,\n                title: m.stateTitle({ header: meta.header, state, was: held?.type === \"Boolean\" ? (held.value ? kind.value.on : kind.value.off) : undefined }),\n            };\n        }\n        case \"cycle\": {\n            const key = cell?.type === \"String\" ? cell.value : \"\";\n            if (key === \"\") return { content: <Box as=\"span\" css={styles.absent} data-slot=\"absent\">{m.absent()}</Box>, title: undefined };\n            const members = registers.byName.get(kind.value.register) ?? [];\n            const at = members.findIndex((member) => stringEqual(member.key, key));\n            const member = members[at];\n            const label = member === undefined ? key : member.label !== \"\" ? member.label : member.key;\n            const tone = member === undefined ? undefined : getSomeorUndefined(member.tone)?.type;\n            const held = changes !== undefined && changes.dirty.has(meta.key) ? changes.held?.get(meta.key) : undefined;\n            const content = kind.value.look.type === \"chip\"\n                ? (\n                    <Box as=\"span\" css={styles.chip} data-slot=\"chip\" style={chipStyle}\n                        data-look={kind.value.scale ? heatOf(at, members.length) : tone === undefined || tone === \"neutral\" ? \"none\" : tone}>\n                        {label}\n                    </Box>\n                )\n                : kind.value.scale\n                    // A scale's pips: one for each member after the first, filled up to the cell's.\n                    ? (\n                        <Box as=\"span\" css={styles.pips} data-slot=\"pips\" role=\"img\" aria-label={label}>\n                            {members.slice(1).map((_member, j) => <Box key={j} as=\"span\" css={styles.pip} data-slot=\"pip\" data-on={j < at ? \"\" : undefined} />)}\n                        </Box>\n                    )\n                    : (\n                        <Box as=\"span\" css={styles.mark} data-slot=\"mark\" data-tone={tone ?? \"neutral\"}>\n                            <Box as=\"span\" css={styles.markDot} data-slot=\"markDot\" aria-hidden=\"true\" />\n                            <Box as=\"span\" css={styles.markWord} data-slot=\"markWord\">{label}</Box>\n                        </Box>\n                    );\n            return {\n                content,\n                // A member's hover is its name, its `meta`, where it has one.\n                title: m.stateTitle({\n                    header: meta.header,\n                    state: member === undefined ? label : getSomeorUndefined(member.meta) ?? label,\n                    was: held?.type === \"String\" ? labelFor(registers, kind.value.register, held.value) : undefined,\n                }),\n            };\n        }\n        case \"age\": {\n            const age = changes?.added === true ? undefined : ageOf(meta, cell, now);\n            // The column's own words for no moment say themselves on hover too, where a narrow column ends them in an ellipsis.\n            const absent = getSomeorUndefined(kind.value.absent);\n            if (age === undefined) return { content: <Box as=\"span\" css={styles.absent} data-slot=\"absent\">{absent ?? m.absent()}</Box>, title: absent };\n            const count = words.number(age.n);\n            return {\n                content: (\n                    <>\n                        {age.stale && <Box as=\"span\" css={styles.staleDot} data-slot=\"staleDot\" role=\"img\" aria-label={m.stale()} />}\n                        <Box as=\"span\" css={styles.age} data-slot=\"age\" data-stale={age.stale ? \"\" : undefined}>{count}</Box>\n                    </>\n                ),\n                title: m.ageTitle({\n                    count, one: integerEqual(age.n, 1n), unit: age.unit, stale: age.stale,\n                    threshold: age.threshold === undefined ? undefined : words.number(age.threshold),\n                }),\n            };\n        }\n        case \"audit\": {\n            const blame = kind.value.mode.type === \"blame\";\n            // While the row's drafts change its fields: how many, in either mode (C9).\n            if (changes !== undefined && !changes.added && changes.fields > 0) {\n                const count = words.number(changes.fields);\n                return {\n                    content: (\n                        <>\n                            <Box as=\"span\" css={styles.pending} data-slot=\"pending\"><Box as=\"span\" css={styles.pendingDot} data-slot=\"pendingDot\" aria-hidden=\"true\" />{m.pending()}</Box>\n                            <Box as=\"span\" css={styles.pendingMeta} data-slot=\"pendingMeta\">{m.pendingMeta({ count, one: changes.fields === 1, blame })}</Box>\n                        </>\n                    ),\n                    title: m.pendingTitle({ count }),\n                };\n            }\n            if (changes?.added === true || cell?.type !== \"DateTime\") {\n                const absent = getSomeorUndefined(kind.value.absent);\n                return { content: <Box as=\"span\" css={styles.absent} data-slot=\"absent\">{absent ?? m.absent()}</Box>, title: absent };\n            }\n            // Who and what: the rule cells the column names, each a String, or none.\n            const verbCell = row.cells.get(kind.value.verb);\n            const byCell = row.cells.get(kind.value.by);\n            const verb = verbCell?.type === \"String\" ? verbCell.value : \"\";\n            const by = byCell?.type === \"String\" ? byCell.value : \"\";\n            const said = m.auditMeta({ verb, by });\n            return {\n                content: (\n                    <>\n                        <Box as=\"span\" css={styles.auditDate} data-slot=\"auditDate\">{formatDatePattern(\"YYYY-MM-DD\", cell.value)}</Box>\n                        {blame && said !== \"\" && <Box as=\"span\" css={styles.auditMeta} data-slot=\"auditMeta\">{said}</Box>}\n                    </>\n                ),\n                title: m.auditTitle({ when: formatDatePattern(\"YYYY-MM-DD HH:mm\", cell.value), verb, by }),\n            };\n        }\n        default:\n            return undefined;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Record's footer (`Record - DX Proposal.md` FT1, FT2): `N of M people`\n * — the rows the narrowing shows, of the record's — and the record's last\n * save after it, the stale note of the first age column with a threshold,\n * and at the right the legend of the register every cycle column names: each\n * member's chip in its look, and its name beside it where it has one — a chip\n * says its label already — or its name alone in the mark look. The shared\n * loading line takes its slot at the trailing end.\n *\n * The rail never wraps and never cuts a word: the legend ends at a whole\n * member, then \"…\", where the rail is short of room (#1398, CL3) — the \"…\"\n * alone where not even its first member fits beside the counts. On a phone\n * it shows nothing but what speaks — the loading line, a Save's notice, and\n * the status line's words, which the phone's toolbar has no room for — in\n * the band the frame lays over main's foot (ruled 7 Nov 2026).\n *\n * @packageDocumentation\n */\n\nimport { memo, useMemo, useRef, type CSSProperties } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { IntegerType, StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { FooterMore, LoadingLine, RecordSliceSaveNotice, footerCut, useFooterFit, useLoadingReveal, useRevealed, type SlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { pagedLoadingLine } from \"../shared/loading.js\";\nimport type { SheetLoadingLine } from \"../sheet/Footer.js\";\nimport type { SheetEntries } from \"../sheet/index.js\";\nimport type { SheetColumnIndex, SheetRegisterIndex } from \"../sheet/model.js\";\nimport type { SheetRowValue } from \"../sheet/values.js\";\nimport { useSheetWords, type SheetWords } from \"../sheet/words.js\";\nimport { heatOf } from \"./cells.js\";\nimport { ageOf } from \"./clock.js\";\nimport { recordMessages as m, type RecordLineText } from \"./messages.js\";\n\nconst stringEqual = equalFor(StringType);\nconst integerEqual = equalFor(IntegerType);\n\n/** One member of the legend (FT2). */\nexport interface RecordLegendItem {\n    /** Its chip's look — a scale's step, a valence's wash, or none; `undefined` in the mark look, which draws no chip. */\n    look: string | undefined;\n    /** Its chip's words: the member's label. */\n    label: string;\n    /** Its name: the member's `meta` — none beside a chip where it has none, the chip saying its label; in the mark look, which draws no chip, its label. */\n    name: string | undefined;\n}\n\n/** The legend: its members, and their chips' least width in characters — the widest label, so the chips line up. */\nexport interface RecordLegend {\n    items: readonly RecordLegendItem[];\n    chip: number;\n}\n\n/** No legend: a Record with no cycle column, or whose cycle columns name more than one register. */\nconst NO_LEGEND: RecordLegend = { items: [], chip: 0 };\n\n/**\n * The legend (FT2): where every cycle column names one register, its members\n * in its order, each drawn as the first cycle column draws it.\n *\n * @param columns - The columns\n * @param registers - The registers, by name\n * @returns The legend; none where the cycle columns name no register, or several\n */\nexport function legendOf(columns: SheetColumnIndex, registers: SheetRegisterIndex): RecordLegend {\n    let first: { register: string; scale: boolean; mark: boolean } | undefined;\n    for (const meta of columns.list) {\n        const kind = meta.raw.kind;\n        if (kind.type !== \"cycle\") continue;\n        if (first === undefined) first = { register: kind.value.register, scale: kind.value.scale, mark: kind.value.look.type === \"mark\" };\n        else if (!stringEqual(kind.value.register, first.register)) return NO_LEGEND;\n    }\n    if (first === undefined) return NO_LEGEND;\n    const { register, scale, mark } = first;\n    const members = registers.byName.get(register) ?? [];\n    const items = members.map((member, at): RecordLegendItem => {\n        const label = member.label !== \"\" ? member.label : member.key;\n        const tone = getSomeorUndefined(member.tone)?.type;\n        return {\n            look: mark ? undefined : scale ? heatOf(at, members.length) : tone === undefined || tone === \"neutral\" ? \"none\" : tone,\n            label,\n            name: getSomeorUndefined(member.meta) ?? (mark ? label : undefined),\n        };\n    });\n    return { items, chip: items.reduce((n, item) => Math.max(n, [...item.label].length), 0) };\n}\n\n/** The rows the first age column with a threshold says are stale: how many, at what threshold, and what it counts. */\nexport interface RecordStaleCount {\n    /** How many rows are stale. */\n    n: number;\n    /** At or past this many, a row is stale. */\n    threshold: bigint;\n    /** What the column counts. */\n    unit: \"hours\" | \"days\" | \"weeks\";\n}\n\n/**\n * How many of the rows the first age column with a threshold says are stale,\n * to the Record's clock: what the footer's note (FT1) and the inspector's\n * count with no row selected (IN8) say. A new row is never stale: the record\n * holds no age of it yet, and the grid draws it none.\n *\n * @param columns - The columns\n * @param rows - The rows to count: every row the narrowing shows\n * @param changes - What a row's drafts changed: whether it is new\n * @param now - The Record's now\n * @returns The count; `undefined` with no such column\n */\nexport function staleCountOf(columns: SheetColumnIndex, rows: readonly SheetRowValue[], changes: SheetEntries[\"changes\"], now: Date): RecordStaleCount | undefined {\n    for (const meta of columns.list) {\n        const kind = meta.raw.kind;\n        if (kind.type !== \"age\") continue;\n        const threshold = getSomeorUndefined(kind.value.stale);\n        if (threshold === undefined) continue;\n        let n = 0;\n        for (const row of rows) if (changes(row.id, row)?.added !== true && ageOf(meta, row.cells.get(meta.key), now)?.stale === true) n += 1;\n        return { n, threshold, unit: kind.value.unit.type };\n    }\n    return undefined;\n}\n\n/**\n * The stale note (FT1): how many of the rows the first age column with a\n * threshold says are stale, to the Record's clock — a new row never.\n *\n * @param columns - The columns\n * @param rows - The rows to count: every row the narrowing shows\n * @param changes - What a row's drafts changed: whether it is new\n * @param now - The Record's now\n * @param words - The Sheet's words: the counts in the viewer's language\n * @returns The note; `undefined` with no such column, or no row stale\n */\nexport function staleNoteOf(columns: SheetColumnIndex, rows: readonly SheetRowValue[], changes: SheetEntries[\"changes\"], now: Date, words: SheetWords): string | undefined {\n    const stale = staleCountOf(columns, rows, changes, now);\n    if (stale === undefined || stale.n === 0) return undefined;\n    return m.staleNote({ count: words.number(stale.n), threshold: words.number(stale.threshold), unit: stale.unit, one: integerEqual(stale.threshold, 1n) });\n}\n\n/** Props of {@link RecordFooter}. */\nexport interface RecordFooterProps {\n    /** The record recipe's slot styles. */\n    styles: SlotStyles;\n    /** The rows shown, of the record's — `N of M people`, N strong; `undefined` while either is not known. */\n    count: RecordLineText | undefined;\n    /** The record's last save, from its commits — `saved 14:02` (SB22). */\n    saved: string | undefined;\n    /** The stale note; `undefined` for none. */\n    stale: string | undefined;\n    /** Exact, confirmed feedback when saved rows leave the `rows` source's narrowing. */\n    recordSlice: ValueTypeOf<RecordSliceBindType> | undefined;\n    /** The legend. */\n    legend: RecordLegend;\n    /** The status line's words: what a phone's band says, its toolbar having no room for them. */\n    live: string;\n    /** What a paged source reads now, or could not read. */\n    loading: SheetLoadingLine | undefined;\n    /** What the rail counts the rows in: what the loading line names them by. */\n    noun: string;\n    /** Ask the source again, when the loading line says it could not be read. */\n    onRetry: (() => void) | undefined;\n}\n\n/** Nothing to ask again: a Record whose source gives no Retry. */\nconst NO_RETRY = () => undefined;\n\n/** Renders the footer — see the module docs. */\nexport const RecordFooter = memo(function RecordFooter({ styles, count, saved, stale, recordSlice, legend, live, loading, noun, onRetry }: RecordFooterProps) {\n    // The loading line, in the Sheet's words, on the frame's one reveal clock (CL4) — else, alone, a clock of its own.\n    const words = useSheetWords();\n    const line = useMemo(() => pagedLoadingLine(loading, noun, words.m, words.number, onRetry ?? NO_RETRY), [loading, noun, words, onRetry]);\n    const revealed = useRevealed();\n    const alone = useLoadingReveal(revealed === undefined && loading !== undefined && loading.kind !== \"failed\");\n    const shown = revealed ?? alone;\n    const rail = useRef<HTMLDivElement>(null);\n    const fit = useFooterFit(rail);\n    // Every legend chip as wide as the widest label, at its own face, as a cell's chips are.\n    const chipStyle = { \"--record-chip-ch\": legend.chip } as CSSProperties;\n    const units = legend.items.length;\n    return (\n        // The counts are kept whole beside the legend, which folds to its \"…\" alone where they leave it no room.\n        <Box ref={rail} css={styles.footer} data-slot=\"footer\" data-footer-fold=\"\">\n            {(count !== undefined || saved !== undefined) && (\n                <Box as=\"span\" css={styles.footerCount} data-slot=\"footerCount\">\n                    {count?.map((part, i) => (typeof part === \"string\" ? part : <b key={i}>{part.strong}</b>))}\n                    {saved !== undefined && (count === undefined ? saved : ` · ${saved}`)}\n                </Box>\n            )}\n            {stale !== undefined && <Box as=\"span\" css={styles.footerNote} data-slot=\"footerNote\">{stale}</Box>}\n            {recordSlice !== undefined && <RecordSliceSaveNotice slice={recordSlice} />}\n            {/* The slack between the counts and the legend: fitted at no width, so the legend is cut only for room it lacks. */}\n            <Box as=\"span\" css={styles.footerSpacer} data-footer-slack=\"\" aria-hidden=\"true\" />\n            {units > 0 && (\n                <Box as=\"span\" css={styles.legend} data-slot=\"legend\" data-footer-units=\"\" data-footer-cut={fit.kept === 0 ? \"\" : undefined}>\n                    {legend.items.map((item, i) => (\n                        <Box key={i} as=\"span\" css={styles.legendItem} data-slot=\"legendItem\" data-footer-unit=\"\" data-footer-cut={footerCut(i, fit)}>\n                            {item.look !== undefined && <Box as=\"span\" css={styles.legendChip} data-slot=\"legendChip\" data-look={item.look} style={chipStyle}>{item.label}</Box>}\n                            {item.name !== undefined && <Box as=\"span\" css={styles.legendName} data-slot=\"legendName\">{item.name}</Box>}\n                        </Box>\n                    ))}\n                </Box>\n            )}\n            <FooterMore shown={fit.kept < units} />\n            {/* The status line's words, seen and heard on a phone alone: elsewhere the toolbar's line says them. */}\n            <Box as=\"span\" css={styles.footerLive} data-slot=\"footerLive\" data-footer-live={live === \"\" ? undefined : \"\"} role=\"status\" aria-live=\"polite\">{live}</Box>\n            <LoadingLine value={line} shown={shown} form={fit.form} />\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Record's grid (`Record - DX Proposal.md` GR1–GR4, HD1–HD4, SL1, EM1,\n * ST1–ST9), in the Table's anatomy, drawn by the Sheet's grid through\n * its host (decision 8): the Sheet's one machine, session, lens and paging\n * under it, and here what a row, the header and the empty state look like.\n *\n * - **A row** — its select column's box, then a cell for each column: a\n *   Record kind's its own (`cells.tsx`, C1–C10), counting an age to the\n *   Record's clock, and a Sheet kind's the Sheet's (C11). The ring's row and\n *   a ticked row are selected; a row holding drafts takes the draft wash;\n *   the ring's cell is active; a cell its drafts changed is tinted until\n *   Apply; a new row's empty cell a person must fill is washed and says so on\n *   hover, as is any row's number its field's bounds don't hold; a cycle, a toggle or a boolean a person may step lights under the\n *   pointer; an owned row, and every row of a read-only Record, takes no\n *   hover. A cell's mark (#1560) draws its words: a note after the value, or\n *   in an empty cell in its place; a lock the design system's Tag, after the\n *   value or alone, and the cell it locks takes no hover and no gesture. A\n *   conflict not yet chosen rings its cell in the warn colour — a column from\n *   data's where it falls on its member's place in the field — or the row's\n *   edge, where the row itself is one — as the Sheet's rows draw it; a row\n *   with a field still missing is marked incomplete, and a cell's issue is\n *   its description to a screen reader.\n * - **The header** — the column groups' row, each group's label over a rule\n *   under its columns, the columns before the first group and an unlabelled\n *   group drawing neither, then the header row, the select column's box\n *   ticking every row shown, or unticking them once every one is — drawn only\n *   while every row the narrowing shows is read: a paged record's not read\n *   whole has none, so it never ticks the rows read so far for all (#1579).\n * - **The empty state** — the narrowing leaves no row to show: it says so,\n *   and clears the search, or the filters.\n *\n * A press anywhere in the select column's cell ticks, not only on its box. A\n * tick never moves the ring, and the ring never ticks. The select column\n * stays at the left as the columns scroll sideways; a read-only Record has\n * none.\n *\n * On a phone's frame the grid is the Sheet's (#1536): no select column — a row\n * is picked by its title, and its ticks are not shown — the title held at the\n * left behind a strong rule, and the other columns a window the Sheet's pager\n * pages; over them, the pinned title's segment of the group row its own,\n * drawing nothing, and each group's label held over its columns in view and\n * cut to them, as the Sheet says which are in view.\n *\n * @packageDocumentation\n */\n\nimport { createContext, memo, useContext, useId, useMemo, useSyncExternalStore, type CSSProperties } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCheck, faMinus } from \"@fortawesome/free-solid-svg-icons\";\nimport { StringType, equalFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordPayloadType } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { ConflictMarks, SlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport type { SheetHostEmptyProps, SheetHostHeaderProps, SheetHostRowProps } from \"../sheet/index.js\";\nimport { cellIsBlank, cellWritable, driverKeyOf, markOf, resolveMember, unitOf, type SheetColumnIndex, type SheetColumnMeta } from \"../sheet/model.js\";\nimport { SheetCellContent } from \"../sheet/cells/Cell.js\";\nimport { cellDetail } from \"../sheet/detail.js\";\nimport { namesMember } from \"../sheet/Rows.js\";\nimport { stepsInPlace } from \"../sheet/steps.js\";\nimport { ActionCellSlot } from \"../sheet/actions/ActionCell.js\";\nimport { actionColumnOf } from \"../sheet/actions/model.js\";\nimport { useSheetWords } from \"../sheet/words.js\";\nimport type { SheetRowValue } from \"../sheet/values.js\";\nimport { chipWidths, recordCell } from \"./cells.js\";\nimport { useRecordNow } from \"./clock.js\";\nimport { recordMessages as m } from \"./messages.js\";\nimport type { RecordNoun } from \"./status.js\";\nimport type { RecordTicks } from \"./ticks.js\";\n\n/** The Record's column groups, decoded. */\ntype RecordColumnGroups = ValueTypeOf<typeof RecordPayloadType>[\"columnGroups\"];\n\nconst stringEqual = equalFor(StringType);\n/** A member's key as a conflict's step names a `Dict`'s key: as East prints it. */\nconst printKey = printFor(StringType);\n\n/**\n * What the Record's grid parts read beside the Sheet's: the record recipe's styles, the ticks, the column groups, the\n * rows' word, the title and whether there is an inspector.\n */\nexport interface RecordGrid {\n    /** The record recipe's slot styles, at the Record's density. */\n    styles: SlotStyles;\n    /** The rows ticked. */\n    ticks: RecordTicks;\n    /** The column groups, in order. */\n    groups: RecordColumnGroups;\n    /** The rows' word, one and many — `person`, `people`: what the empty state and the strip say. */\n    noun: RecordNoun;\n    /** The Record's title: what the strip over nothing names (SP1). */\n    title: string | undefined;\n    /** Whether the Record has an inspector: where the strip sends a row's details (SP1, SP3). */\n    inspector: boolean;\n}\n\nconst RecordGridContext = createContext<RecordGrid | undefined>(undefined);\n\n/** Provides what the Record's grid parts read beside the Sheet's. */\nexport const RecordGridProvider = RecordGridContext.Provider;\n\n/**\n * Reads what the Record's grid parts read beside the Sheet's; a part outside a {@link RecordGridProvider} is a\n * mistake of the frame's, and throws.\n *\n * @returns The Record's grid facts\n */\nexport function useRecordGrid(): RecordGrid {\n    const grid = useContext(RecordGridContext);\n    if (grid === undefined) throw new Error(\"A Record grid part is drawn outside a RecordGridProvider\");\n    return grid;\n}\n\n/**\n * How a column's cells and its header sit in them (GR2): a cycle's, a toggle's and a boolean's centred; an age's and a\n * number's at the end, a number's header over its figures; every other at the start.\n */\nfunction alignOf(meta: SheetColumnMeta): \"center\" | \"end\" | undefined {\n    return meta.kind === \"cycle\" || meta.kind === \"toggle\" || meta.kind === \"boolean\" ? \"center\"\n        : meta.kind === \"age\" || meta.kind === \"quantity\" || meta.kind === \"integer\" ? \"end\" : undefined;\n}\n\n/**\n * The Record's title column — the one a phone pins: its first title column but one made from data, whose cells title a\n * member's value, never the row. What the head of a row's Details names, and where Add and Duplicate put the ring.\n *\n * @param columns - The columns drawn\n * @returns The title column, or `undefined` for a Record with none\n */\nexport function titleColumnOf(columns: SheetColumnIndex): SheetColumnMeta | undefined {\n    return columns.list.find((meta) => meta.kind === \"title\" && meta.raw.from.type === \"none\");\n}\n\n/**\n * A row's title as it reads: its title column's text, else — with no title column — its first text's but one made\n * from data; `undefined` where that is empty.\n *\n * @param row - The row\n * @param columns - The columns drawn\n * @returns The title, or `undefined`\n */\nexport function titleOf(row: SheetRowValue, columns: SheetColumnIndex): string | undefined {\n    const named = titleColumnOf(columns) ?? columns.list.find((meta) => meta.kind === \"text\" && meta.raw.from.type === \"none\");\n    const cell = named === undefined ? undefined : row.cells.get(named.key);\n    return cell?.type === \"String\" && cell.value.trim().length > 0 ? cell.value : undefined;\n}\n\n/**\n * A row as its box and the strip name it: its title, else its first text, else its key.\n *\n * @param row - The row\n * @param columns - The columns drawn\n * @returns The name\n */\nexport function nameOf(row: SheetRowValue, columns: SheetColumnIndex): string {\n    return titleOf(row, columns) ?? row.id;\n}\n\n/**\n * Whether a conflict not yet chosen falls on a cell: on its column's field — or a column from data's on its member's\n * place in the field, a `Dict`'s entry keyed by the member or the struct's field, or on the field whole.\n *\n * @param meta - The cell's column\n * @param conflicts - Where the row's conflicts are\n * @returns Whether the cell wears the warn ring\n */\nfunction conflicted(meta: SheetColumnMeta, conflicts: ConflictMarks | undefined): boolean {\n    if (conflicts === undefined) return false;\n    const from = getSomeorUndefined(meta.raw.from);\n    if (from === undefined) return conflicts.fields.has(meta.key);\n    return conflicts.within.get(from.field)?.some(([step]) => step === undefined\n        || (step.kind === \"key\" && stringEqual(step.key, printKey(from.member)))\n        || (step.kind === \"field\" && stringEqual(step.name, from.member))) === true;\n}\n\n/**\n * A row (GR1–GR3, SL1, ST1–ST9): its select column's box, then its cells, the\n * Sheet's gestures on each — see the module docs.\n */\nexport const RecordRow = memo(function RecordRow(props: SheetHostRowProps) {\n    const { styles: sheetStyles, r, row, columns, registers, gridTemplate, layout, rowPx, idPrefix, selC, range, editor, draft, changes, writable } = props;\n    const { styles, ticks } = useRecordGrid();\n    const words = useSheetWords();\n    // Each cell's issue, read out as its description: `{issuePrefix}-{c}`.\n    const issuePrefix = useId();\n    // The select column, where the grid lays it out: a read-only Record has none, nor a phone's frame.\n    const lead = layout.lead;\n    const pinned = layout.pinPx > 0;\n    // The clock, read once for the row's every age; the row draws again as it moves.\n    const now = useRecordNow();\n    const chips = useMemo(() => chipWidths(columns, registers), [columns, registers]);\n    const id = row?.id;\n    // A tick shows where the select column does: on a phone a row is picked by its title.\n    const ticked = useSyncExternalStore(ticks.subscribe, () => lead && id !== undefined && ticks.has(id));\n    // An owned row, and a Record no gesture may change, takes no hover and steps nothing (ST9).\n    const owned = row?.owned === true;\n    const still = owned || !writable;\n    const driverKey = driverKeyOf(row, props.driverColumn);\n    const last = columns.list.length - 1;\n    const name = row === undefined ? \"\" : nameOf(row, columns);\n    return (\n        <Box\n            css={styles.row}\n            style={{ gridTemplateColumns: gridTemplate, height: `${rowPx}px` }}\n            data-slot=\"row\"\n            data-row={r}\n            data-row-id={id}\n            data-selected={selC !== undefined || range !== undefined || ticked ? \"\" : undefined}\n            data-ticked={ticked ? \"\" : undefined}\n            data-draft={draft?.pending === true ? \"\" : undefined}\n            data-conflict={draft?.conflicts?.whole === true ? \"\" : undefined}\n            data-incomplete={draft?.incomplete === true ? \"\" : undefined}\n            data-still={still ? \"\" : undefined}\n            role=\"row\"\n            aria-rowindex={props.ariaRowIndex}\n            aria-selected={selC !== undefined || ticked}\n        >\n            {lead && (\n                // The whole cell ticks, its box the checkbox a screen reader names; a press leaves the keyboard where it is.\n                <Box css={styles.cell} data-pick=\"\" data-first=\"\" role=\"gridcell\" aria-colindex={1}\n                    onMouseDown={row !== undefined ? (event) => { event.preventDefault(); event.stopPropagation(); } : undefined}\n                    onClick={row !== undefined ? (event) => { event.stopPropagation(); ticks.toggle(row.id); } : undefined}>\n                    {row !== undefined && (\n                        // Out of the tab order, as every control in the grid is: the grid is one tab stop.\n                        <chakra.button type=\"button\" css={styles.tick} tabIndex={-1} role=\"checkbox\" aria-checked={ticked}\n                            aria-label={m.tickRow({ name, ticked })} title={m.tickRow({ name, ticked })} data-on={ticked ? \"\" : undefined}>\n                            {ticked && <FontAwesomeIcon icon={faCheck} />}\n                        </chakra.button>\n                    )}\n                </Box>\n            )}\n            {columns.list.map((meta, c) => {\n                const cell = row?.cells.get(meta.key);\n                const editing = editor?.c === c;\n                // The one check every gesture asks (#1560): the column writes, and no mark locks the cell.\n                const mark = markOf(meta, row?.cells);\n                const locked = mark?.lock === true;\n                const editable = writable && cellWritable(meta, row?.cells) && meta.kind !== \"stamped\" && meta.kind !== \"action\";\n                // A new row's empty cell a person must fill (ST8) — its field still missing: never an option's, nor a column\n                // from data's — washed, empty, and saying so on hover.\n                const required = changes?.added === true && editable && cellIsBlank(cell) && changes.missing.has(meta.key);\n                // A number its field's bounds don't hold (#1585), whatever row holds it: washed as a missing field is, saying the bound.\n                const bounded = draft?.bounds?.has(meta.key) === true;\n                const issue = cell?.type === \"Invalid\" ? words.m.issueInvalid({ value: cell.value }) : draft?.issues.get(meta.key);\n                const issueId = `${issuePrefix}-${c}`;\n                const detail = row !== undefined ? cellDetail(meta, row.cells, words) : undefined;\n                const member = namesMember(meta) && cell?.type === \"String\" ? resolveMember(registers, meta.register, cell.value) : undefined;\n                const actualCell = meta.kind === \"date\" && meta.actual !== undefined ? row?.cells.get(meta.actual) : undefined;\n                const when = meta.kind === \"date\" && meta.level !== undefined && row !== undefined\n                    ? { level: meta.level(row.cells), actual: actualCell?.type === \"DateTime\" ? actualCell.value : undefined }\n                    : undefined;\n                // An action cell (#1475): its state, its summary and the controls of what it offers, over the Sheet's host.\n                const action = meta.kind === \"action\" && props.actions !== undefined && row !== undefined ? actionColumnOf(meta) : undefined;\n                const summary = action !== undefined ? row?.cells.get(action.summary) : undefined;\n                // A Record kind's cell, and what it says on hover; a Sheet kind's is the Sheet's (C11).\n                const view = row === undefined || required ? undefined\n                    : recordCell({ styles, meta, row, cell, registers, changes, now, words, chip: chips.get(meta.key) });\n                // A mark's words: in an empty cell in its place — but an action cell's, whose state draws whatever it holds — else\n                // after the value; a lock's as the Tag either way.\n                const alone = mark !== undefined && action === undefined && cellIsBlank(cell);\n                const marked = mark === undefined || (mark.words === \"\" && !locked) ? null\n                    : locked ? <Box as=\"span\" css={styles.lock} data-slot=\"lock\" data-alone={alone ? \"\" : undefined}>{mark.words}</Box>\n                        : <Box as=\"span\" css={alone ? styles.absent : styles.note} data-slot=\"note\" data-alone={alone ? \"\" : undefined}>{mark.words}</Box>;\n                const said = required ? m.required({ header: meta.header }) : issue ?? view?.title ?? detail?.title;\n                return (\n                    <Box\n                        key={meta.key}\n                        css={styles.cell}\n                        data-slot=\"cell\"\n                        data-key={meta.key}\n                        data-kind={meta.kind}\n                        data-active={selC === c && !editing ? \"\" : undefined}\n                        data-steps={editable && !owned && stepsInPlace(meta) ? \"\" : undefined}\n                        data-dirty={changes?.dirty.has(meta.key) === true ? \"\" : undefined}\n                        data-required={required ? \"\" : undefined}\n                        data-bounds={bounded ? \"\" : undefined}\n                        data-first={!lead && c === 0 ? \"\" : undefined}\n                        data-last={c === last ? \"\" : undefined}\n                        data-pinned={pinned && c === 0 ? \"\" : undefined}\n                        data-align={alignOf(meta)}\n                        data-still={still || locked ? \"\" : undefined}\n                        data-locked={locked ? \"\" : undefined}\n                        data-conflict={conflicted(meta, draft?.conflicts) ? \"\" : undefined}\n                        // A required cell's one issue is that it is empty: it says so in the Record's words. A mark's words follow.\n                        title={mark === undefined ? said : m.marked({ text: said, words: mark.words, lock: locked })}\n                        aria-invalid={issue !== undefined ? true : undefined}\n                        aria-describedby={issue !== undefined ? issueId : undefined}\n                        aria-readonly={locked ? true : undefined}\n                        role=\"gridcell\"\n                        id={`${idPrefix}-${r}-${c}`}\n                        aria-colindex={c + (lead ? 2 : 1)}\n                        aria-selected={selC === c || (range !== undefined && c >= range.c0 && c <= range.c1)}\n                        onMouseDown={(event) => props.onCellDown(r, c, event)}\n                        onDoubleClick={() => props.onCellDouble(r, c)}\n                        onMouseEnter={() => props.onCellEnter(r, c)}\n                    >\n                        {issue !== undefined && <Box as=\"span\" css={sheetStyles.cellIssue} id={issueId}>{issue}</Box>}\n                        {alone ? null : required ? null : action !== undefined && props.actions !== undefined ? (\n                            <ActionCellSlot host={props.actions} r={r} columnKey={meta.key} column={action} cell={cell}\n                                summary={summary?.type === \"String\" ? summary.value : \"\"} selected={selC === c} />\n                        ) : view !== undefined ? view.content : (\n                            <SheetCellContent\n                                styles={sheetStyles}\n                                meta={meta}\n                                cell={cell}\n                                rowBlank={row === undefined}\n                                unit={unitOf(meta, driverKey)}\n                                member={member}\n                                ghost={undefined}\n                                link={meta.kind === \"link\" ? props.linkCtx(row, meta) : undefined}\n                                when={when}\n                            />\n                        )}\n                        {marked}\n                        {editing && editor.node}\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n});\n\n/** One segment of the column groups' row: a group's columns, or a run of columns no labelled group holds. */\ninterface GroupSegment {\n    /** The group's label; `undefined` for an unlabelled run, which draws no label and no rule. */\n    label: string | undefined;\n    /** How many tracks it spans. */\n    span: number;\n    /** The group's place among the groups; `-1` for columns in none. */\n    at: number;\n    /** A phone's pinned column's own, held at the left with it: it draws nothing. */\n    pinned: boolean;\n    /** Where its first track stands among the columns drawn: the select column's at `-1`, before the first. */\n    from: number;\n}\n\n/**\n * The column groups' row over the columns drawn (HD1): each group's run of\n * columns one segment, and the columns before, between and after them — the\n * select column with the first — segments with no label. A column a phone's\n * frame pins is a segment of its own, which draws nothing: the groups are\n * labelled over the window beside it.\n *\n * @param columns - The columns drawn\n * @param groups - The column groups\n * @param lead - Whether the grid lays out its select column\n * @param pinned - Whether the first column is held at the left\n * @returns The segments, or `undefined` with no group, which draws no row\n */\nfunction segmentsOf(columns: readonly SheetColumnMeta[], groups: RecordColumnGroups, lead: boolean, pinned: boolean): GroupSegment[] | undefined {\n    if (groups.length === 0) return undefined;\n    const groupOf = new Map<string, number>();\n    groups.forEach((group, i) => { for (const key of group.columnKeys) groupOf.set(key, i); });\n    const out: GroupSegment[] = [];\n    const take = (at: number, from: number) => {\n        const before = out[out.length - 1];\n        if (before !== undefined && !before.pinned && before.at === at) { before.span += 1; return; }\n        const label = at < 0 ? undefined : groups[at]!.label;\n        out.push({ label: label === undefined || label.trim().length === 0 ? undefined : label, span: 1, at, pinned: false, from });\n    };\n    if (lead) take(-1, -1);\n    columns.forEach((meta, c) => {\n        if (pinned && c === 0) out.push({ label: undefined, span: 1, at: -1, pinned: true, from: 0 });\n        else take(groupOf.get(meta.key) ?? -1, c);\n    });\n    return out;\n}\n\n/**\n * The header (GR4, HD1–HD4, SL1): the column groups' row, then the header\n * row, its select column's box ticking every row shown. The two stick\n * together over the rows; nothing sorts.\n */\nexport function RecordHeader({ columns, gridTemplate, layout, rowPx, rowIds, whole, columnWindow }: SheetHostHeaderProps) {\n    const { styles, ticks, groups } = useRecordGrid();\n    const lead = layout.lead;\n    const pinned = layout.pinPx > 0;\n    useSyncExternalStore(ticks.subscribe, ticks.version);\n    const n = ticks.count(rowIds);\n    const all = rowIds.length > 0 && n === rowIds.length;\n    const some = n > 0 && !all;\n    const segments = useMemo(() => segmentsOf(columns, groups, lead, pinned), [columns, groups, lead, pinned]);\n    const last = columns.length - 1;\n    // A phone's window among the columns drawn: the paged ones start past the pinned one.\n    const shownFrom = columnWindow === undefined ? 0 : columnWindow.first + (pinned ? 1 : 0);\n    return (\n        // The pinned column's width: on a phone a group's label holds past it, over the group's columns in view.\n        <Box css={styles.head} data-slot=\"head\" data-phone={layout.phone ? \"\" : undefined} style={{ \"--record-pin\": `${layout.pinPx}px` } as CSSProperties}>\n            {segments !== undefined && (\n                <Box css={styles.groupRow} style={{ gridTemplateColumns: gridTemplate }} data-slot=\"groupRow\" aria-hidden=\"true\">\n                    {segments.map((segment, i) => {\n                        // How much of the group the window shows: its label is cut to it, so a long one holds clear of the\n                        // pinned column as the window pages part of the group off (#1536).\n                        const shown = columnWindow === undefined ? undefined\n                            : Math.max(0, Math.min(segment.from + segment.span, shownFrom + columnWindow.inView) - Math.max(segment.from, shownFrom)) * columnWindow.slotPx;\n                        return (\n                            <Box key={i} css={styles.groupSeg} style={{ gridColumn: `span ${segment.span}` }} data-slot=\"groupSeg\" data-pinned={segment.pinned ? \"\" : undefined}>\n                                {segment.label !== undefined && (\n                                    <Box css={styles.groupLabel} data-slot=\"groupLabel\" title={segment.label}\n                                        style={shown === undefined ? undefined : { \"--record-group-shown\": `${shown}px` } as CSSProperties}>{segment.label}</Box>\n                                )}\n                                <Box css={styles.groupRule} data-unlabelled={segment.label === undefined ? \"\" : undefined} />\n                            </Box>\n                        );\n                    })}\n                </Box>\n            )}\n            <Box css={styles.headerRow} style={{ gridTemplateColumns: gridTemplate, height: `${rowPx}px` }} data-slot=\"headerRow\" role=\"row\" aria-rowindex={1}>\n                {lead && (\n                    // While it draws its box, the whole cell ticks every row shown, or unticks them.\n                    <Box css={styles.headerCell} data-tick=\"\" data-first=\"\" role=\"columnheader\" aria-colindex={1}\n                        onMouseDown={whole ? (event) => { event.preventDefault(); event.stopPropagation(); } : undefined}\n                        onClick={whole ? () => { if (all) ticks.clear(); else ticks.set(rowIds); } : undefined}>\n                        {whole && (\n                            <chakra.button type=\"button\" css={styles.tick} tabIndex={-1} role=\"checkbox\" aria-checked={all ? true : some ? \"mixed\" : false}\n                                aria-label={m.tickAll({ all })} title={m.tickAll({ all })} data-on={all ? \"\" : undefined} data-mixed={some ? \"\" : undefined}>\n                                {all ? <FontAwesomeIcon icon={faCheck} /> : some ? <FontAwesomeIcon icon={faMinus} /> : null}\n                            </chakra.button>\n                        )}\n                    </Box>\n                )}\n                {columns.map((meta, c) => (\n                    // Each column's cell is a `headerCell`, as the Sheet's are: a key's move reads where its column is from it.\n                    <Box key={meta.key} css={styles.headerCell} data-slot=\"headerCell\" data-key={meta.key} data-kind={meta.kind}\n                        data-first={!lead && c === 0 ? \"\" : undefined} data-last={c === last ? \"\" : undefined} data-pinned={pinned && c === 0 ? \"\" : undefined}\n                        data-align={alignOf(meta)} role=\"columnheader\" aria-colindex={c + (lead ? 2 : 1)} title={meta.header}>\n                        <Box as=\"span\" css={styles.headerLabel}>{meta.header}</Box>\n                    </Box>\n                ))}\n            </Box>\n        </Box>\n    );\n}\n\n/** The empty state (EM1): the narrowing leaves no row to show — it says so, and clears the search, or the filters. */\nexport function RecordEmpty({ query, onClear }: SheetHostEmptyProps) {\n    const { styles, noun } = useRecordGrid();\n    return (\n        <Box css={styles.empty} data-slot=\"empty\" role=\"status\">\n            <Box as=\"span\" css={styles.emptyMark} aria-hidden=\"true\">×</Box>\n            <Box as=\"span\" css={styles.emptyTitle}>{m.emptyTitle({ nouns: noun.plural, query })}</Box>\n            <chakra.button type=\"button\" css={styles.emptyClear} data-slot=\"emptyClear\" onClick={onClear}>\n                <Box as=\"span\" css={styles.emptyBox} aria-hidden=\"true\">☐</Box>\n                <Box as=\"span\" css={styles.emptyLink}>{m.emptyClear({ query })}</Box>\n            </chakra.button>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Record's Details (`Record - DX Proposal.md` IN1–IN8), drawn in the\n * Sheet's inspector pane in the Sheet's place (`SheetInspectorHost`), over the\n * Sheet's reads and writes:\n *\n * - **one row** — its head: the eyebrow naming its row, its title, and a\n *   chip, New or how many of its fields its drafts change (IN2); its issues\n *   over its form, each field's label and message, the field each names washed\n *   in the form (IN3) and saying the issue's words under it (ruled 13 Nov\n *   2026); its fields in column order, each column group a section\n *   under its label — an unlabelled group's `Other` — and the fields no column\n *   shows after them (IN4), each member of a column from data a line of its\n *   own in its group's section (#1561), a cycle, a toggle and a boolean each\n *   one line of radios (IN5); a cell's mark its field's help, and a lock's\n *   field read only (D1); its facts last, the audit's and the age's, read\n *   only, an age warning once stale (IN6); then Duplicate and Delete (IN7);\n * - **nothing** — the rows shown, the drafts pending and the rows stale, then\n *   where a row's fields show (IN8).\n *\n * Every edit is the Sheet's form's, written as the row's cell writes it — a\n * number's box emptied as its cell emptied: one draft and one step of the\n * history — or, refused by its cell, none, the field\n * showing what the row holds and why under it. A number its field's bounds\n * don't hold is said once, in its help line, in the tone the row's Save stands\n * in (#1585): a warning while the row is as stored, an error once its change\n * holds Save. A complete row given the author's own\n * Details shows them in the form's place (SB58). A title opened, a copy made\n * and an issue gone to put the keyboard in their field (AD1, IN7, IN9): the\n * focus the Record asks for ({@link RecordInspector}). Several rows are the\n * Sheet's. A phone's drawer holds these Details at touch size (SH12): the head\n * and the gestures as the Sheet's phone Details draw theirs, the form's lines\n * and inputs touch-sized there already, and no field taking the keyboard\n * unasked — a tap gives it.\n *\n * Styles are the `sheetInspector` recipe's, the form's `fieldForm`'s, and a\n * fact's value the `record` recipe's.\n *\n * @packageDocumentation\n */\n\nimport { createContext, memo, useCallback, useContext, useEffect, useMemo, type ReactNode } from \"react\";\nimport { Box, chakra, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faLock } from \"@fortawesome/free-solid-svg-icons\";\nimport { defaultValue, equalFor, fromEastTypeValue, none, some, variant, type EastType } from \"@elaraai/east\";\nimport { Field, type FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport {\n    EastChakraComponent, EastChakraField, FieldForm, fieldFormMessages, getSomeorUndefined, type FieldLineChoice,\n} from \"@elaraai/east-ui-components\";\nimport { FrameDrawer, formatDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport { useSheetEntries, useSheetInspect, type SheetInspect, type SheetInspectPlace, type SheetInspectTarget } from \"../sheet/index.js\";\nimport { issuesByField, targetIssues, useAuthorDetails, useTargetForm, whatOf, type FormValue, type SheetInspectorDetailsProps } from \"../sheet/frame/inspector.js\";\nimport { indexColumns, indexRegisters, markOf, type SheetColumnIndex } from \"../sheet/model.js\";\nimport type { SheetWords } from \"../sheet/words.js\";\nimport { ageOf, useRecordNow } from \"./clock.js\";\nimport { staleCountOf } from \"./footer.js\";\nimport { nameOf, titleColumnOf, titleOf, useRecordGrid } from \"./grid.js\";\nimport { recordMessages as rm } from \"./messages.js\";\nimport type { RecordNoun, RecordStatus } from \"./status.js\";\nimport type { RecordTicks } from \"./ticks.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n// The shared Field's payload with nothing set: a fact's label and key over the value the Record draws itself.\nconst FIELD = defaultValue<typeof Field.Types.Field>(Field.Types.Field);\nconst FIELD_STYLE = defaultValue<typeof Field.Types.Field.fields.style.cases.some>(Field.Types.Field.fields.style.cases.some);\n\n/** A field's key, as the form keys it. */\nconst formKey = (path: readonly string[]) => path.join(\".\");\n\n/** A request for the keyboard in a field of a row's Details: a title opened (AD1), a copy made (IN7), an issue gone to (IN9). */\nexport interface RecordFocus {\n    /** The row's row-space index. */\n    r: number;\n    /** The field, by the form's key. */\n    key: string;\n    /** Which request it is: each later than the one before. */\n    seq: number;\n}\n\n/** What the Record's Details read beside the Sheet's. */\nexport interface RecordInspector {\n    /** The field asked to take the keyboard, until the form has given it. */\n    focus: RecordFocus | undefined;\n    /** Says the form gave the keyboard to the field a request asked for — or that the ring left its row first. */\n    focused: (seq: number) => void;\n    /** The status line's steps: what a Duplicate tells (IN7). */\n    status: RecordStatus;\n    /** The rows ticked: a row Details deletes is unticked. */\n    ticks: RecordTicks;\n    /** No gesture changes the Record: no Duplicate, no Delete. */\n    readOnly: boolean;\n}\n\nconst RecordInspectorContext = createContext<RecordInspector | undefined>(undefined);\n\n/** Provides what the Record's Details read beside the Sheet's. */\nexport const RecordInspectorProvider = RecordInspectorContext.Provider;\n\n/** What the Record's Details read; a Details outside a {@link RecordInspectorProvider} is a mistake of the frame's, and throws. */\nfunction useRecordInspector(): RecordInspector {\n    const inspector = useContext(RecordInspectorContext);\n    if (inspector === undefined) throw new Error(\"A Record's Details are drawn outside a RecordInspectorProvider\");\n    return inspector;\n}\n\n/**\n * How an issue's line in the Issues tab names its row (IN9): by its title — `C. Patel`; a new row with none yet in the\n * Record's word for its rows, `New person` — else, where the narrowing hides it or it is not read yet, by its key. A\n * Record draws no row numbers, so a row's place among the rows names nothing a person sees.\n *\n * @param columns - The columns drawn: where a row's title is\n * @param noun - The Record's word for its rows\n * @param added - Whether the row at a row-space index is new, never applied\n * @returns The words for an issue's row, as `SheetInspectorHost.where` takes them\n */\nexport function recordIssueWhere(columns: SheetColumnIndex, noun: RecordNoun, added: (r: number) => boolean): (issue: { entry: string }, place: SheetInspectPlace | undefined) => string {\n    return (issue, place) => {\n        if (place === undefined) return issue.entry;\n        return titleOf(place.row, columns) ?? (added(place.r) ? rm.newRow({ noun: noun.singular }) : issue.entry);\n    };\n}\n\n/**\n * The Record's Details — see the module docs: one row's, or nothing's.\n *\n * @param props - The payload, the pane, the keys, the words, the columns hidden, the word for a group, and what the ring selects\n * @returns The Details\n */\nexport const RecordDetails = memo(function RecordDetails(props: SheetInspectorDetailsProps) {\n    const { value, pane, words, selected } = props;\n    const inspect = useSheetInspect();\n    const styles = useSlotRecipe({ key: \"sheetInspector\" })() as Styles;\n    const { focus, focused } = useRecordInspector();\n    const columns = useMemo(() => indexColumns(value.sheet.columns), [value.sheet.columns]);\n    // A field asked for on a row the ring has left goes unanswered: it never takes the keyboard on that row's next visit.\n    const at = selected.kind === \"one\" ? selected.place.r : undefined;\n    useEffect(() => {\n        if (focus !== undefined && focus.r !== at) focused(focus.seq);\n    }, [focus, at, focused]);\n    if (selected.kind === \"none\") return <RecordNothing styles={styles} inspect={inspect} words={words} columns={columns} />;\n    const place = selected.place;\n    const form = place.kind === \"band\" ? getSomeorUndefined(pane.forms.group) : pane.forms.row;\n    if (form === undefined) return null;\n    // Each row its own form: what was typed for one never lands on the next.\n    return <RecordTargetDetails key={`${place.kind}\\u001f${place.entry}\\u001f${place.child ?? \"\"}`} {...props} styles={styles} inspect={inspect}\n        columns={columns} place={place} form={form} />;\n});\n\n/** Props of {@link RecordTargetDetails}. */\ninterface RecordPlaceProps extends SheetInspectorDetailsProps {\n    styles: Styles;\n    inspect: SheetInspect;\n    columns: SheetColumnIndex;\n    place: SheetInspectPlace;\n    form: FormValue;\n}\n\n/** One row: its target — its draft and what the record holds — read as Details shows it, and drawn. */\nfunction RecordTargetDetails({ place, ...props }: RecordPlaceProps) {\n    const targetAt = props.inspect.targetAt;\n    const target = useMemo(() => targetAt(place.r), [targetAt, place.r]);\n    return target === undefined ? null : <RecordTarget {...props} target={target} />;\n}\n\n/** One fact of a row (IN6): its column, and its value in words. */\ninterface RecordFact {\n    key: string;\n    label: string;\n    text: string;\n    stale: boolean;\n}\n\n/** One row's Details: its head, its issues, its fields, its facts and its gestures (IN2–IN7). */\nfunction RecordTarget({ value, pane, keys, words, hidden, noun, styles, inspect, columns, form, target }: Omit<RecordPlaceProps, \"place\"> & { target: SheetInspectTarget }) {\n    const { m } = words;\n    const button = useRecipe({ key: \"button\" });\n    const { styles: record, groups } = useRecordGrid();\n    const { focus, focused, status, ticks, readOnly } = useRecordInspector();\n    const entries = useSheetEntries();\n    const now = useRecordNow();\n    const edit = useTargetForm({ value, words, hidden, styles, inspect, target, form });\n    const own = useAuthorDetails({ value, pane, inspect, target, form, struct: edit.struct });\n    const issues = targetIssues(target, inspect, form, words);\n    // A bound the row breaks (#1585), said in the tone its Save stands in: as stored it warns; its change held, an error.\n    const breaches = issues.some((issue) => issue.kind !== \"warning\") ? \"error\" : \"warn\";\n    const registers = useMemo(() => indexRegisters(value.sheet.registers), [value.sheet.registers]);\n    const isNew = target.baseline === undefined && target.value !== undefined;\n    const r = target.r;\n    // In a phone's drawer (SH12): its head and its gestures at touch size.\n    const phone = useContext(FrameDrawer);\n\n    // Its title, as the head names it: the title column's text — else, with no title column, its first text, else its key.\n    const titleKey = useMemo(() => titleColumnOf(columns)?.key, [columns]);\n    const titleCell = titleKey === undefined ? undefined : target.row.cells.get(titleKey);\n    const title = titleKey === undefined ? nameOf(target.row, columns) : titleCell?.type === \"String\" ? titleCell.value.trim() : \"\";\n\n    // How many of its fields its drafts change (IN2), each compared by East at its type: what the chip counts.\n    const equals = useMemo(() => Object.entries(edit.struct.fields as Record<string, EastType>).map(([name, type]) => [name, equalFor(type)] as const), [edit.struct]);\n    const changed = useMemo(() => {\n        const now = target.value;\n        const was = target.baseline;\n        if (now === undefined || was === undefined) return 0;\n        return equals.reduce((n, [name, same]) => {\n            const a = now[name];\n            const b = was[name];\n            const differs = a === undefined || b === undefined ? (a === undefined) !== (b === undefined) : !same(a as never, b as never);\n            return differs ? n + 1 : n;\n        }, 0);\n    }, [target, equals]);\n\n    // Its fields in column order, each column group a section under its label — an unlabelled group's `Other` — the fields\n    // no column shows after them, in the form's order (IN4): a variant's cases' fields right after it, its block under its\n    // choice (#1549) — a column's field is one spec, never a variant's cases'. Each member of a column from data is a line\n    // in its column's place, in its group's section (#1561). The audit is a fact, never a field (IN6). A cell's mark is its\n    // field's help, after its own, a lock's words saying so — and a lock reads the field only, as the grid's cell (D1).\n    const cells = target.row.cells;\n    const specs = useMemo(() => {\n        const order = new Map(columns.list.map((meta, i) => [meta.key, i] as const));\n        const groupOf = new Map<string, string>();\n        for (const group of groups) for (const key of group.columnKeys) groupOf.set(key, group.label.trim().length === 0 ? rm.otherGroup() : group.label);\n        const placed = edit.specs.flatMap((spec, i): { spec: FieldSpecValue; at: number }[] => {\n            const key = edit.columns[i];\n            const at = key === undefined ? undefined : order.get(key);\n            if (key === undefined || at === undefined) return [{ spec, at: columns.list.length + i }];\n            const meta = columns.byKey.get(key);\n            if (meta?.kind === \"audit\") return [];\n            const group = groupOf.get(key);\n            const grouped = group === undefined ? spec : { ...spec, group: some(group) };\n            const mark = meta === undefined ? undefined : markOf(meta, cells);\n            if (mark === undefined) return [{ spec: grouped, at }];\n            const help = rm.marked({ text: getSomeorUndefined(spec.help), words: mark.words, lock: mark.lock });\n            return [{ spec: { ...grouped, help: help === \"\" ? none : some(help), ...(mark.lock ? { editor: variant(\"readonly\", null) } : {}) }, at }];\n        });\n        return placed.sort((a, b) => a.at - b.at).map((p) => p.spec);\n    }, [edit.specs, edit.columns, columns, groups, cells]);\n\n    // A cycle, a toggle and a boolean, each one line of radios (IN5) — a member's line's among them: a cycle's members as\n    // its options rule offers them at this row, a toggle's on and off, a boolean's yes and no.\n    const lines = useMemo(() => {\n        const out = new Map<string, readonly FieldLineChoice[]>();\n        edit.specs.forEach((spec, i) => {\n            const key = edit.columns[i];\n            const kind = key === undefined ? undefined : inspect.columnAt(r, key)?.raw.kind;\n            if (key === undefined || kind === undefined) return;\n            if (kind.type === \"cycle\") {\n                const allowed = inspect.allowedAt(r, key);\n                // What a member's choice sets: a String field its key — and a cycle over a variant, whose steps the wire\n                // keys by the cases' names, the case its key names. A member's line holds its cell's key.\n                const ofCases = (fromEastTypeValue(spec.type) as EastType).type === \"Variant\" && !spec.optional;\n                out.set(formKey(spec.path), (registers.byName.get(kind.value.register) ?? [])\n                    .filter((member) => allowed === undefined || allowed.has(member.key))\n                    .map((member) => ({ value: ofCases ? variant(member.key, null) : member.key, label: member.label !== \"\" ? member.label : member.key })));\n            } else if (kind.type === \"toggle\") {\n                out.set(formKey(spec.path), [{ value: true, label: kind.value.on }, { value: false, label: kind.value.off }]);\n            } else if (kind.type === \"boolean\") {\n                out.set(formKey(spec.path), [{ value: true, label: fieldFormMessages.yesNo({ value: true }) }, { value: false, label: fieldFormMessages.yesNo({ value: false }) }]);\n            }\n        });\n        return out;\n    }, [edit.specs, edit.columns, inspect, r, registers]);\n    // A line draws its choices, or read only the choice made — a lock's too: never its cell's own control.\n    const editControl = edit.renderControl;\n    const renderControl = useCallback((spec: FieldSpecValue) => (lines.has(formKey(spec.path)) ? undefined : editControl(spec)), [lines, editControl]);\n\n    // The fields its issues name, washed in the form (IN3), each saying under it what its issues say of it, in their\n    // order (ruled 13 Nov 2026): a field gone to says why it is named, whatever of the issues over the form is in view.\n    const named = issuesByField(issues);\n\n    // The field asked to take the keyboard on this row, once the form is drawn to give it; then the request is answered —\n    // in a phone's drawer at once, the field left to a tap, so no keyboard rises over the drawer unasked. The author's own\n    // Details take no request: it is answered as they show, so it never fires once the form takes their place.\n    const drawn = target.value !== undefined && own === undefined;\n    const asked = focus !== undefined && focus.r === r && drawn ? focus.key : undefined;\n    const focusKey = phone ? undefined : asked;\n    const ownShown = target.value !== undefined && own !== undefined;\n    useEffect(() => {\n        if (focus !== undefined && (asked !== undefined || (ownShown && focus.r === r))) focused(focus.seq);\n    }, [focus, asked, ownShown, r, focused]);\n\n    // Its facts (IN6): the audit's when, verb and who, and the age's count — none on a row the record does not hold yet.\n    const facts = useMemo((): RecordFact[] => {\n        if (isNew) return [];\n        return columns.list.flatMap((meta): RecordFact[] => {\n            const kind = meta.raw.kind;\n            const cell = target.row.cells.get(meta.key);\n            if (kind.type === \"audit\") {\n                if (cell?.type !== \"DateTime\") return [{ key: meta.key, label: meta.header, text: getSomeorUndefined(kind.value.absent) ?? rm.absent(), stale: false }];\n                const verbCell = target.row.cells.get(kind.value.verb);\n                const byCell = target.row.cells.get(kind.value.by);\n                const when = formatDatePattern(\"YYYY-MM-DD HH:mm\", cell.value);\n                return [{ key: meta.key, label: meta.header, stale: false, text: rm.auditTitle({\n                    when, verb: verbCell?.type === \"String\" ? verbCell.value : \"\", by: byCell?.type === \"String\" ? byCell.value : \"\",\n                }) }];\n            }\n            if (kind.type === \"age\") {\n                const age = ageOf(meta, cell, now);\n                return [age === undefined\n                    ? { key: meta.key, label: meta.header, text: getSomeorUndefined(kind.value.absent) ?? rm.absent(), stale: false }\n                    : { key: meta.key, label: meta.header, text: words.number(age.n), stale: age.stale }];\n            }\n            return [];\n        });\n    }, [isNew, columns, target.row, now, words]);\n\n    // Its gestures (IN7): a copy after it, its title empty and the keyboard in it, and its deletion — none on a Record no\n    // gesture changes, nor a gesture the record does not take.\n    const capabilities = value.sheet.editing.edits;\n    const name = nameOf(target.row, columns);\n    const onDuplicate = () => {\n        if (inspect.duplicate([r], { empty: titleKey, ring: titleKey })) status.say({ id: \"duplicated\", name });\n    };\n    const onDelete = () => {\n        if (ticks.has(target.entry)) ticks.toggle(target.entry);\n        entries.remove([target.entry]);\n    };\n    const chipCss = phone ? styles.phoneChip : styles.chip;\n    const chip: ReactNode = isNew ? <Box as=\"span\" css={chipCss} data-state=\"new\">{m.inspectorChip({ state: \"new\" })}</Box>\n        : target.presentation.pending\n            ? <Box as=\"span\" css={chipCss} data-state=\"pending\">{changed > 0 ? rm.detailsPending({ count: words.number(changed) }) : m.inspectorChip({ state: \"pending\" })}</Box>\n            : null;\n    const heading = title !== \"\" ? title : <Box as=\"span\" css={record.absent}>{rm.absent()}</Box>;\n    // Duplicate and Delete: a phone's touch-sized Default buttons, as the Sheet's phone Details draw theirs.\n    const gesture = phone ? [button({ variant: \"outline\", size: \"md\" }), styles.phoneButton] : [button({ variant: \"outline\", size: \"xs\" })];\n    // A Record that takes edits keeps its chip's row while there is none (#1584): the first edit's chip moves nothing.\n    const writes = readOnly ? undefined : \"\";\n    return (\n        <Box css={styles.root} data-sheet-inspector={target.kind} data-record-details=\"row\" data-record-entry={target.entry} data-phone={phone ? \"\" : undefined}>\n            {phone ? (\n                <Box css={styles.phoneHead} data-writes={writes}>\n                    <Box as=\"span\" css={styles.phoneEyebrow} data-inspector-what=\"\">{whatOf(target, words, noun)}</Box>\n                    <Box as=\"span\" css={styles.phoneName} data-inspector-id=\"\">{heading}</Box>\n                    {chip}\n                    {target.owned && <Box as=\"span\" css={styles.lock} data-inspector-lock=\"\"><FontAwesomeIcon icon={faLock} aria-hidden />{m.inspectorOwned()}</Box>}\n                </Box>\n            ) : (\n                <Box css={styles.head}>\n                    <Box css={styles.eyebrow} data-inspector-what=\"\">{whatOf(target, words, noun)}</Box>\n                    <Box css={styles.name} data-inspector-id=\"\">{heading}</Box>\n                    <Box css={styles.marks} data-writes={writes}>\n                        {chip}\n                        {target.owned && (\n                            <Box as=\"span\" css={styles.lock} role=\"img\" aria-label={m.inspectorOwned()} title={m.inspectorOwned()} data-inspector-lock=\"\">\n                                <FontAwesomeIcon icon={faLock} />\n                            </Box>\n                        )}\n                    </Box>\n                </Box>\n            )}\n            {issues.length > 0 && (\n                <Box css={styles.issues} data-inspector-issues=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"issues\", n: issues.length, count: words.number(issues.length) })}</Box>\n                    {issues.map((issue) => (\n                        <Box key={issue.key} css={styles.issue}>\n                            {issue.field !== undefined && <Box as=\"span\" css={styles.issueField}>{issue.field}</Box>}\n                            <Box as=\"span\" css={styles.issueText} data-kind={issue.kind}>{issue.text}</Box>\n                        </Box>\n                    ))}\n                </Box>\n            )}\n            <Box css={styles.fields} data-inspector-fields={own !== undefined ? \"custom\" : \"form\"}>\n                {target.value === undefined\n                    ? <Box css={styles.emptyHint}>{m.inspectorReading()}</Box>\n                    : own !== undefined\n                        ? <EastChakraComponent value={own} storageKey={`${keys.frame}.inspector`} />\n                        : <FieldForm specs={specs} value={edit.formValue} baseline={edit.baseline} options={edit.options} onChange={edit.onChange}\n                            takesUnset readOnly={!inspect.writable} renderControl={renderControl} lines={lines} issues={named} focus={focusKey} breaches={breaches} />}\n            </Box>\n            {facts.length > 0 && (\n                <Box css={record.facts} data-record-facts=\"\">\n                    {facts.map((fact) => (\n                        <Box key={fact.key} data-record-fact={fact.key}>\n                            <EastChakraField value={{ ...FIELD, label: fact.label, readOnly: some(true), style: some({ ...FIELD_STYLE, schemaKey: some(fact.key) }) }}\n                                storageKey={`record.fact.${fact.key}`}\n                                controlNode={<chakra.input css={record.factValue} readOnly value={fact.text} title={fact.text} aria-label={fact.label}\n                                    data-stale={fact.stale ? \"\" : undefined} />} />\n                        </Box>\n                    ))}\n                </Box>\n            )}\n            {!readOnly && (capabilities.insertRows || capabilities.removeRows) && (\n                <Box css={phone ? styles.phoneActions : styles.actions} data-inspector-actions=\"\">\n                    {capabilities.insertRows && (\n                        <chakra.button type=\"button\" css={gesture} disabled={!inspect.can.insertRows}\n                            data-inspector-action=\"duplicate\" onClick={onDuplicate}>\n                            {m.inspectorAction({ action: \"duplicate\", header: undefined, withLines: false })}\n                        </chakra.button>\n                    )}\n                    {capabilities.removeRows && (\n                        <chakra.button type=\"button\" css={gesture} disabled={!inspect.can.removeRows}\n                            data-inspector-action=\"delete\" onClick={onDelete}>\n                            {m.inspectorAction({ action: \"delete\", header: undefined, withLines: false })}\n                        </chakra.button>\n                    )}\n                </Box>\n            )}\n        </Box>\n    );\n}\n\n/**\n * No row selected (IN8): the rows the narrowing shows, the drafts pending and the rows stale — each a dash while it is\n * not known, the stale count until every row shown is read — then where a row's fields show.\n */\nfunction RecordNothing({ styles, inspect, words, columns }: { styles: Styles; inspect: SheetInspect; words: SheetWords; columns: SheetColumnIndex }) {\n    const { styles: record } = useRecordGrid();\n    const entries = useSheetEntries();\n    const now = useRecordNow();\n    const shown = entries.count.shown;\n    const stale = entries.whole ? staleCountOf(columns, entries.rows, entries.changes, now) : undefined;\n    const stats: [stat: \"shown\" | \"pending\" | \"stale\", text: string | undefined][] = [\n        [\"shown\", shown === undefined ? undefined : words.number(shown)],\n        [\"pending\", words.number(inspect.counts.pending)],\n        [\"stale\", stale === undefined ? undefined : words.number(stale.n)],\n    ];\n    return (\n        <Box css={styles.root} data-sheet-inspector=\"none\" data-record-details=\"none\">\n            <Box css={styles.stats} data-inspector-counts=\"\">\n                {stats.map(([stat, text]) => (\n                    <Box key={stat} css={styles.stat} data-count={stat}>\n                        <Box as=\"span\" css={[styles.statValue, record.statValue]}>{text ?? rm.absent()}</Box>\n                        <Box as=\"span\" css={styles.statLabel}>{rm.detailsStat({ stat })}</Box>\n                    </Box>\n                ))}\n            </Box>\n            <Box css={styles.hints}>\n                <Box as=\"p\" css={styles.hint} data-record-hint=\"\">{rm.detailsHint()}</Box>\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the Record's status line says (`Record - DX Proposal.md` FR5,\n * AD1–AD7), in the Record's word for its rows:\n *\n * - **the last gesture's words** — the Sheet's notice, worded again where the\n *   Record has words of its own: a row added, rows deleted, an Add the app\n *   gave nothing to draft from, the issues gone to; every other notice in the\n *   Sheet's words;\n * - **else what a step of the history did** — Undo, Redo, Discard and\n *   Apply, each told as it is taken ({@link stepOf}, {@link createRecordStatus}),\n *   an Apply once its batch is read back, as the history bar stops saying it\n *   reads it, and a Duplicate, which the Sheet's notice says nothing of (IN7) —\n *   until a gesture or a notice comes after it;\n * - **else how many rows are ticked**, of the rows shown.\n *\n * What an Apply sends and a Discard drops is tallied before the step is taken\n * ({@link tallyDrafts}): after it the session holds none of it.\n *\n * Of the three, the line says whichever spoke last and still has words\n * ({@link useRecordStatusLine}): a notice the Sheet has cleared has none, nor a\n * step a gesture has come after, nor the ticks once none is ticked.\n *\n * @packageDocumentation\n */\n\nimport { useState, useSyncExternalStore } from \"react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport type { EditIssue, HistoryAction } from \"@elaraai/east-ui-components\";\nimport { DRAFT_ISSUE_TEXT } from \"@elaraai/east-ui-components/internal\";\nimport type { SheetNotice } from \"../sheet/sheet-types.js\";\nimport type { SheetTransactions } from \"../sheet/transactions.js\";\nimport { noticeText, type SheetWords } from \"../sheet/words.js\";\nimport { recordMessages as m, type RecordTally } from \"./messages.js\";\nimport type { RecordTicks } from \"./ticks.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** The Record's word for its rows, one and many: `person`, `people`. */\nexport interface RecordNoun {\n    readonly singular: string;\n    readonly plural: string;\n}\n\n/** What a step of the history did (AD4–AD7), or a Duplicate the inspector drafted (IN7), as the status line says it. */\nexport type RecordStep =\n    | { readonly id: \"undid\" | \"redid\" }\n    | { readonly id: \"restored\"; readonly n: number }\n    | { readonly id: \"discarded\"; readonly n: number }\n    | { readonly id: \"applied\"; readonly tally: RecordTally }\n    | { readonly id: \"duplicated\"; readonly name: string };\n\n/** A step the status line was told of, and when: each told later than the one before. */\nexport interface RecordSaid {\n    readonly step: RecordStep;\n    readonly seq: number;\n}\n\n/** The steps the status line is told of, read through `useSyncExternalStore`. */\nexport interface RecordStatus {\n    /** Hears every step told; returns the call that stops it. */\n    subscribe: (listener: () => void) => () => void;\n    /** The step told last, if any. */\n    said: () => RecordSaid | undefined;\n    /** Tells a step. */\n    say: (step: RecordStep) => void;\n}\n\n/**\n * Makes a Record's status line's store, no step told.\n *\n * @returns The store\n */\nexport function createRecordStatus(): RecordStatus {\n    let said: RecordSaid | undefined;\n    const listeners = new Set<() => void>();\n    return {\n        subscribe: (listener) => {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n        said: () => said,\n        say: (step) => {\n            said = { step, seq: (said?.seq ?? 0) + 1 };\n            for (const listener of listeners) listener();\n        },\n    };\n}\n\n/**\n * What the drafts send as an Apply (AD4): the fields they change on rows the\n * record holds and on how many, the rows they add, and those they delete — a\n * new row a draft dropped again none of them.\n *\n * @param session - The editing session\n * @param fields - How many fields a draft changes against the one its entry began from\n * @returns The tally\n */\nexport function tallyDrafts(session: SheetTransactions, fields: (before: unknown, current: unknown) => number): RecordTally {\n    let changes = 0;\n    let changed = 0;\n    let added = 0;\n    let deleted = 0;\n    for (const [id, entry] of session.entries) {\n        const was = session.originals.get(id)?.draft;\n        const now = entry.draft;\n        if (was === undefined) {\n            if (now !== undefined) added += 1;\n            continue;\n        }\n        if (now === undefined) {\n            deleted += 1;\n            continue;\n        }\n        const n = fields(was, now);\n        if (n === 0) continue;\n        changes += n;\n        changed += 1;\n    }\n    return { changes, changed, added, deleted };\n}\n\n/**\n * What a step of the history will have done, read before it is taken: Undo\n * of a deletion restores its rows; any other Undo, and any Redo, one change;\n * Discard drops every draft; Apply sends them.\n *\n * @param action - The step\n * @param session - The editing session, as it stands before the step\n * @param fields - How many fields a draft changes against the one its entry began from\n * @returns The step's words' facts; `undefined` for a step the session will not take, and a refresh\n */\nexport function stepOf(action: HistoryAction, session: SheetTransactions, fields: (before: unknown, current: unknown) => number): RecordStep | undefined {\n    switch (action) {\n        case \"undo\": {\n            const step = session.nextUndo;\n            if (!session.canUndo || step === undefined) return undefined;\n            return step.origin === \"remove\" ? { id: \"restored\", n: step.entries } : { id: \"undid\" };\n        }\n        case \"redo\":\n            return session.canRedo ? { id: \"redid\" } : undefined;\n        case \"discard\": {\n            if (!session.canDiscard || session.pending === 0) return undefined;\n            const tally = tallyDrafts(session, fields);\n            // A change of a row's place alone is a change too.\n            return { id: \"discarded\", n: Math.max(tally.changes + tally.added + tally.deleted, session.pending) };\n        }\n        case \"apply\":\n            return session.canApply ? { id: \"applied\", tally: tallyDrafts(session, fields) } : undefined;\n        default:\n            return undefined;\n    }\n}\n\n/**\n * The status line's words for a step of the history.\n *\n * @param step - What the step did\n * @param words - The Sheet's words: the counts in the viewer's language\n * @param noun - The Record's word for its rows\n * @returns The words\n */\nexport function stepText(step: RecordStep, words: SheetWords, noun: RecordNoun): string {\n    switch (step.id) {\n        case \"undid\": return m.undid();\n        case \"redid\": return m.redid();\n        case \"restored\": return m.restored({ n: step.n, count: words.number(step.n), noun: noun.singular, nouns: noun.plural });\n        case \"discarded\": return m.discarded({ n: step.n, count: words.number(step.n) });\n        case \"applied\": return m.applied({ tally: step.tally, count: (n) => words.number(n), noun: noun.singular, nouns: noun.plural });\n        case \"duplicated\": return m.duplicated({ name: step.name });\n    }\n}\n\n/**\n * The status line's words for the Sheet's notice: the Record's own where it\n * has them, every other notice in the Sheet's words.\n *\n * @param notice - The notice the last gesture left\n * @param words - The Sheet's words\n * @param noun - The Record's word for its rows\n * @param issues - Every issue holding Apply: what an issue gone to counts\n * @returns The words\n */\nexport function recordNoticeText(notice: SheetNotice, words: SheetWords, noun: RecordNoun, issues: readonly EditIssue[]): string {\n    switch (notice.id) {\n        case \"newRow\": return m.added({ noun: noun.singular });\n        case \"deleted\":\n            return notice.what !== \"rows\" ? noticeText(notice, words)\n                : m.deleted({ n: notice.n, count: words.number(notice.n), noun: noun.singular, nouns: noun.plural });\n        case \"cantAdd\": return notice.what === \"row\" ? m.cantAdd({ noun: noun.singular, label: notice.label }) : noticeText(notice, words);\n        case \"renumbered\": return m.renumbered({ from: notice.from, to: notice.to, n: notice.n, count: words.number(notice.n), noun: noun.singular, nouns: noun.plural });\n        case \"issue\": {\n            // The issues holding Apply: a new row's empty fields alone, or the app's refusals among them (AD3).\n            if (issues.length === 0) return noticeText(notice, words);\n            const refused = issues.some((issue) => !stringEqual(issue.message, DRAFT_ISSUE_TEXT.required));\n            return m.issues({ n: issues.length, count: words.number(issues.length), refused });\n        }\n        default: return noticeText(notice, words);\n    }\n}\n\n/** When each of the status line's voices last spoke — a count of every time any did — and what it said then. */\ninterface StatusOrder {\n    /** How many times a voice has spoken. */\n    n: number;\n    /** The notice last seen, and when it came: `-1` for none. */\n    notice: { of: SheetNotice | null; at: number };\n    /** The step last told, when, and how many gestures had been recorded then: one more takes its words away. */\n    step: { seq: number; at: number; gestures: number };\n    /** The ticks as last seen, and when they last moved. */\n    ticks: { version: number; at: number };\n}\n\n/** What {@link useRecordStatusLine} reads. */\nexport interface RecordStatusInput {\n    /** The steps of the history the Record has told. */\n    status: RecordStatus;\n    /** The Sheet's notice: the last gesture's words, `null` once a step of the history moved past them. */\n    notice: SheetNotice | null;\n    /** How many gestures the Sheet has recorded. */\n    gestures: number;\n    /** The rows ticked. */\n    ticks: RecordTicks;\n    /** How many of the rows shown are ticked. */\n    ticked: number;\n    /** How many rows are shown. */\n    of: number;\n    /** Every issue holding Apply: what the words of an issue gone to count. */\n    issues: readonly EditIssue[];\n    /** The Sheet's words. */\n    words: SheetWords;\n    /** The Record's word for its rows. */\n    noun: RecordNoun;\n}\n\n/**\n * The status line's words (FR5): the notice, the step or the ticks — whichever\n * spoke last and still has words — see the module docs.\n *\n * @param input - The voices, and what their words are made of\n * @returns The words; empty while no voice has any\n */\nexport function useRecordStatusLine(input: RecordStatusInput): string {\n    const { status, notice, gestures, ticks, ticked, of, issues, words, noun } = input;\n    const said = useSyncExternalStore(status.subscribe, status.said);\n    const version = useSyncExternalStore(ticks.subscribe, ticks.version);\n    const [order, setOrder] = useState<StatusOrder>(() => ({\n        n: 0, notice: { of: notice, at: -1 }, step: { seq: said?.seq ?? 0, at: -1, gestures }, ticks: { version, at: -1 },\n    }));\n    // Each voice that has spoken since the last render, counted as it is read — state the render adjusts, never a ref it writes.\n    let next = order;\n    if (!Object.is(next.notice.of, notice)) next = { ...next, n: next.n + 1, notice: { of: notice, at: notice === null ? -1 : next.n + 1 } };\n    if (said !== undefined && said.seq !== next.step.seq) next = { ...next, n: next.n + 1, step: { seq: said.seq, at: next.n + 1, gestures } };\n    if (version !== next.ticks.version) next = { ...next, n: next.n + 1, ticks: { version, at: next.n + 1 } };\n    if (next !== order) setOrder(next);\n    const voices: readonly { at: number; text: string | undefined }[] = [\n        { at: next.notice.at, text: notice === null ? undefined : recordNoticeText(notice, words, noun, issues) },\n        { at: next.step.at, text: said === undefined || gestures !== next.step.gestures ? undefined : stepText(said.step, words, noun) },\n        { at: next.ticks.at, text: ticked === 0 ? undefined : m.selected({ count: words.number(ticked), of: words.number(of) }) },\n    ];\n    let spoken: { at: number; text: string } | undefined;\n    for (const voice of voices) if (voice.text !== undefined && (spoken === undefined || voice.at > spoken.at)) spoken = { at: voice.at, text: voice.text };\n    return spoken?.text ?? \"\";\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Record's strip (`Record - DX Proposal.md` SP1–SP7), docked under its\n * rows in the Sheet's place (#1533): the Record's words for the cell under\n * the pointer, else the ring's —\n *\n * - **nothing** (SP1) — the title, and what a click on a cell and on a row does;\n * - **a cycle** (SP2) — its column and state; the row, the state's name, what\n *   the record holds while a draft changed it, and where a click and a\n *   ⇧-click take it; Space, the members' one-key labels and ⌫ in its keys —\n *   and a toggle and a boolean as two states a click flips;\n * - **a title** (SP3) — the Record's word for a row and its key; the title, a\n *   word of the row's, and where its details are — with no inspector, ⏎ where\n *   it edits, as any other kind's;\n * - **an age** (SP4) — its column and count; what it counts and its\n *   threshold, or for how long the row is stale;\n * - **an audit** (SP5) — when, its verb and who, or how many drafts wait;\n * - **a new row's empty field** (SP6) — that Apply waits for it, and how it is\n *   set: a click on a cycle, a toggle or a boolean, else the inspector;\n * - **any other kind** (SP7) — its column and its value, and ⏎ where it edits.\n *\n * Where a cell steps nothing — an owned row, a Record read only, a cell a\n * mark locks — it says where it is and no more; a cell's mark's words follow\n * what it says (#1560). While the Sheet's strip speaks of what is in hand —\n * an open editor, a range, an action — it is the strip; so it is over a cell\n * whose column gives a `detail` of its own, a base field every column takes:\n * the column's words for the cell, of any kind.\n *\n * @packageDocumentation\n */\n\nimport { memo } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { IntegerType, StringType, equalFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { formatDatePattern } from \"@elaraai/east-ui-components/internal\";\nimport type { SheetHostStripCell, SheetHostStripProps } from \"../sheet/index.js\";\nimport { cellIsBlank, cellText, cellWritable, markOf, resolveMember, type SheetColumnIndex, type SheetColumnMeta, type SheetRegisterIndex } from \"../sheet/model.js\";\nimport { namesMember } from \"../sheet/Rows.js\";\nimport { SheetStrip } from \"../sheet/Strip.js\";\nimport { stepCell, stepsInPlace } from \"../sheet/steps.js\";\nimport type { SheetCellValue } from \"../sheet/values.js\";\nimport { useSheetWords, type SheetWords } from \"../sheet/words.js\";\nimport { ageOf, useRecordNow } from \"./clock.js\";\nimport { nameOf, useRecordGrid } from \"./grid.js\";\nimport { recordMessages as m } from \"./messages.js\";\nimport type { RecordNoun } from \"./status.js\";\n\nconst stringEqual = equalFor(StringType);\nconst integerEqual = equalFor(IntegerType);\n\n/** What the Record's strip says: its label, its words and its keys. */\nexport interface RecordStripText {\n    label: string;\n    text: string;\n    keys: string;\n}\n\n/** What the Record's strip is read from. */\nexport interface RecordStripInput {\n    /** The cell it speaks of; `undefined` for none. */\n    at: SheetHostStripCell | undefined;\n    /** The columns the grid draws. */\n    columns: SheetColumnIndex;\n    /** The registers, by name. */\n    registers: SheetRegisterIndex;\n    /** Whether a gesture may be made now. */\n    writable: boolean;\n    /** The Record's title. */\n    title: string | undefined;\n    /** The Record's word for its rows. */\n    noun: RecordNoun;\n    /** Whether the Record has an inspector. */\n    inspector: boolean;\n    /** The Sheet's words. */\n    words: SheetWords;\n    /** The Record's now: what an age counts to. */\n    now: Date;\n}\n\n/** A cell's value in words: a register's member by the label it shows, anything else as its column prints it — none, a dash. */\nfunction valueText(meta: SheetColumnMeta, cell: SheetCellValue | undefined, registers: SheetRegisterIndex, words: SheetWords): string {\n    if (cell === undefined || cellIsBlank(cell)) return m.absent();\n    const member = namesMember(meta) && cell.type === \"String\" ? resolveMember(registers, meta.register, cell.value) : undefined;\n    return member !== undefined && stringEqual(member.key, cell.type === \"String\" ? cell.value : \"\") && member.label !== \"\" ? member.label : cellText(cell, meta, words);\n}\n\n/**\n * The Record's words for the strip — see the module docs.\n *\n * @param input - The cell, and what its words are read against\n * @returns The words; `undefined` for any other kind (SP7)\n */\nexport function recordStripOf(input: RecordStripInput): RecordStripText | undefined {\n    const { at, columns, registers, writable, title, noun, inspector, words, now } = input;\n    if (at === undefined) {\n        const steps = writable && columns.list.some((meta) => meta.editable && stepsInPlace(meta));\n        return { label: title ?? \"\", text: m.stripRest({ steps, inspector }), keys: m.stripMove() };\n    }\n    const { row, column: meta, changes } = at;\n    const cell = row.cells.get(meta.key);\n    const kind = meta.raw.kind;\n    // Where the cell steps: a gesture may be made, the cell takes an edit — its column writes, and no mark locks it — and no\n    // system owns the row.\n    const steps = writable && cellWritable(meta, row.cells) && !row.owned;\n    // A new row's empty field a person must fill, as the grid washes it.\n    if (changes?.added === true && cellWritable(meta, row.cells) && meta.kind !== \"stamped\" && meta.kind !== \"action\" && cellIsBlank(cell) && changes.missing.has(meta.key)) {\n        const first = kind.type === \"cycle\" ? registers.byName.get(kind.value.register)?.[0] : undefined;\n        const how = kind.type === \"cycle\" ? (first === undefined ? undefined : { cycle: first.label !== \"\" ? first.label : first.key })\n            : kind.type === \"toggle\" || kind.type === \"boolean\" ? \"click\" as const : inspector ? \"inspector\" as const : undefined;\n        return { label: meta.header, text: m.stripRequired({ noun: noun.singular, how }), keys: m.stripRemoveRow() };\n    }\n    const name = nameOf(row, columns);\n    // What the record holds while a draft changed the cell.\n    const held = changes !== undefined && changes.dirty.has(meta.key) ? changes.held?.get(meta.key) : undefined;\n    switch (kind.type) {\n        case \"cycle\": {\n            const members = registers.byName.get(kind.value.register) ?? [];\n            const labelOf = (key: string): string => {\n                const member = members.find((candidate) => stringEqual(candidate.key, key));\n                return member === undefined ? key : member.label !== \"\" ? member.label : member.key;\n            };\n            const key = cell?.type === \"String\" ? cell.value : \"\";\n            const member = members.find((candidate) => stringEqual(candidate.key, key));\n            // Where a click and a ⇧-click take it: the shared machine's own steps.\n            const towards = (step: 1 | -1): string | undefined => {\n                const next = steps ? stepCell(meta, cell, registers, step) : undefined;\n                return next?.type === \"String\" ? labelOf(next.value) : undefined;\n            };\n            // The members a key sets at once (K4): each by its first spelling one key long — `0–2`, the aliases `1–3`.\n            const singles = members.flatMap((candidate) => [candidate.label, ...candidate.aliases].filter((spelling) => [...spelling].length === 1).slice(0, 1));\n            const set = singles.length === 0 ? undefined : singles.length === 1 ? singles[0] : `${singles[0]}–${singles[singles.length - 1]}`;\n            return {\n                label: m.stripState({ header: meta.header, state: key === \"\" ? m.absent() : labelOf(key) }),\n                text: m.stripCycle({\n                    name, meta: member === undefined ? \"\" : getSomeorUndefined(member.meta) ?? \"\",\n                    was: held?.type === \"String\" ? labelOf(held.value) : undefined, next: towards(1), previous: towards(-1),\n                }),\n                keys: steps && members[0] !== undefined ? m.stripCycleKeys({ set, first: labelOf(members[0].key) }) : m.stripMove(),\n            };\n        }\n        case \"toggle\":\n        case \"boolean\": {\n            const said = (on: boolean) => (kind.type === \"toggle\" ? (on ? kind.value.on : kind.value.off) : m.booleanWord({ on }));\n            const on = cell?.type === \"Boolean\" && cell.value;\n            return {\n                label: m.stripState({ header: meta.header, state: said(on) }),\n                text: m.stripFlip({ name, was: held?.type === \"Boolean\" ? said(held.value) : undefined, next: steps ? said(!on) : undefined }),\n                keys: steps ? m.stripFlipKeys() : m.stripMove(),\n            };\n        }\n        case \"title\": {\n            // A word of the row's: the first column after the title that reads as words and holds some.\n            let detail: string | undefined;\n            for (const other of columns.list.slice(columns.list.indexOf(meta) + 1)) {\n                if (other.kind !== \"text\" && other.kind !== \"reference\" && other.kind !== \"enum\" && other.kind !== \"person\") continue;\n                const value = row.cells.get(other.key);\n                if (value?.type !== \"String\" || value.value.trim() === \"\") continue;\n                detail = valueText(other, value, registers, words);\n                break;\n            }\n            // With no inspector it edits in its cell, as a text does, and says so.\n            return {\n                label: m.stripTitle({ noun: noun.singular, id: row.id }), text: m.stripTitleText({ title: name, detail, inspector }),\n                keys: inspector ? m.stripMove() : m.stripEdit({ editable: steps }),\n            };\n        }\n        case \"age\": {\n            const age = changes?.added === true ? undefined : ageOf(meta, cell, now);\n            const threshold = getSomeorUndefined(kind.value.stale);\n            if (age === undefined) {\n                // No moment to count from: the column's words for none, and what it counts.\n                return {\n                    label: m.stripState({ header: meta.header, state: getSomeorUndefined(kind.value.absent) ?? m.absent() }),\n                    text: m.stripAge({ unit: kind.value.unit.type, count: \"\", one: false, stale: false, threshold: threshold === undefined ? undefined : words.number(threshold) }),\n                    keys: m.stripMove(),\n                };\n            }\n            const count = words.number(age.n);\n            return {\n                label: m.stripState({ header: meta.header, state: count }),\n                text: m.stripAge({ unit: age.unit, count, one: integerEqual(age.n, 1n), stale: age.stale, threshold: age.threshold === undefined ? undefined : words.number(age.threshold) }),\n                keys: m.stripMove(),\n            };\n        }\n        case \"audit\": {\n            if (changes !== undefined && !changes.added && changes.fields > 0) return { label: meta.header, text: m.stripPending({ count: words.number(changes.fields) }), keys: m.stripMove() };\n            if (changes?.added === true || cell?.type !== \"DateTime\") return { label: meta.header, text: getSomeorUndefined(kind.value.absent) ?? m.absent(), keys: m.stripMove() };\n            const verbCell = row.cells.get(kind.value.verb);\n            const byCell = row.cells.get(kind.value.by);\n            const verb = verbCell?.type === \"String\" ? verbCell.value : \"\";\n            const by = byCell?.type === \"String\" ? byCell.value : \"\";\n            return { label: meta.header, text: m.auditTitle({ when: formatDatePattern(\"YYYY-MM-DD HH:mm\", cell.value), verb, by }), keys: m.stripMove() };\n        }\n        default:\n            return undefined;\n    }\n}\n\n/** Renders the Record's strip — see the module docs. */\nexport const RecordStrip = memo(function RecordStrip({ styles: sheetStyles, model, onAction, own, at, columns, registers, writable }: SheetHostStripProps) {\n    const { styles, title, noun, inspector } = useRecordGrid();\n    const words = useSheetWords();\n    const now = useRecordNow();\n    // What is in hand, or the column's own detail of the cell: the Sheet's strip.\n    if (own || model.on) return <SheetStrip styles={sheetStyles} model={model} onAction={onAction} />;\n    const said = recordStripOf({ at, columns, registers, writable, title, noun, inspector, words, now });\n    // Any other kind (SP7): its column and its value, so the band stays.\n    const line = said ?? (at === undefined ? undefined : {\n        label: at.column.header, text: valueText(at.column, at.row.cells.get(at.column.key), registers, words),\n        keys: m.stripEdit({ editable: writable && cellWritable(at.column, at.row.cells) && !at.row.owned }),\n    });\n    if (line === undefined) return null;\n    // The cell's mark, after what the strip says of it (#1560).\n    const mark = at === undefined ? undefined : markOf(at.column, at.row.cells);\n    const text = mark === undefined ? line.text : m.marked({ text: line.text, words: mark.words, lock: mark.lock });\n    return (\n        <Box css={styles.strip} data-slot=\"strip\" data-record-strip=\"\">\n            <Box as=\"span\" css={styles.stripLabel} data-slot=\"stripLabel\">{line.label}</Box>\n            <Box as=\"span\" css={styles.stripText} data-slot=\"stripText\" title={text === \"\" ? undefined : text}>{text}</Box>\n            {line.keys !== \"\" && <Box as=\"span\" css={styles.stripKeys} data-slot=\"stripKeys\">{line.keys}</Box>}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The rows a Record's select column ticks (`Record - DX Proposal.md` SL1,\n * P5), by row id: held apart from the ring, which a tick never moves, and read\n * through `useSyncExternalStore` — a row by its own tick, so a tick draws that\n * row and the header again, and no other.\n *\n * A tick outlives its row's place among the rows read (#1579): a paged record\n * drops a row as the grid scrolls far from it, and its tick stays, holding\n * what the Sheet held of the row as it was ticked — so Delete takes it still.\n *\n * @packageDocumentation\n */\n\nimport type { SheetEntryHold } from \"../sheet/index.js\";\n\n/** What a tick holds of its row: what the Sheet held of it as it was ticked, or `undefined` for a row not read. */\ntype Held = SheetEntryHold | undefined;\n\n/** The rows ticked, and the calls that change them. */\nexport interface RecordTicks {\n    /** Hears every change; returns the call that stops it. */\n    subscribe: (listener: () => void) => () => void;\n    /** Whether a row is ticked. */\n    has: (id: string) => boolean;\n    /** Moves with every change: what the header reads. */\n    version: () => number;\n    /** Ticks a row, or unticks it. */\n    toggle: (id: string) => void;\n    /** Ticks these rows, and only them. */\n    set: (ids: readonly string[]) => void;\n    /** Unticks every row. */\n    clear: () => void;\n    /** How many of these rows are ticked. */\n    count: (ids: readonly string[]) => number;\n    /** How many rows are ticked: those the rows read no longer hold among them. */\n    size: () => number;\n    /** Each row ticked, in the order ticked, and what the Sheet held of it as it was ticked. */\n    held: () => ReadonlyMap<string, Held>;\n    /** Where a tick takes what the Sheet holds of its row: the frame's, as the Sheet's rows stand. */\n    holdWith: (hold: (id: string) => Held) => void;\n}\n\n/**\n * Makes a Record's ticks, none ticked.\n *\n * @returns The ticks\n */\nexport function createRecordTicks(): RecordTicks {\n    let ticked: ReadonlyMap<string, Held> = new Map();\n    let version = 0;\n    let hold: (id: string) => Held = () => undefined;\n    const listeners = new Set<() => void>();\n    const change = (next: ReadonlyMap<string, Held>) => {\n        ticked = next;\n        version += 1;\n        for (const listener of listeners) listener();\n    };\n    return {\n        subscribe: (listener) => {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n        has: (id) => ticked.has(id),\n        version: () => version,\n        toggle: (id) => {\n            const next = new Map(ticked);\n            if (!next.delete(id)) next.set(id, hold(id));\n            change(next);\n        },\n        set: (ids) => change(new Map(ids.map((id) => [id, ticked.has(id) ? ticked.get(id) : hold(id)] as const))),\n        clear: () => { if (ticked.size > 0) change(new Map()); },\n        count: (ids) => ids.reduce((n, id) => (ticked.has(id) ? n + 1 : n), 0),\n        size: () => ticked.size,\n        held: () => ticked,\n        holdWith: (next) => { hold = next; },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Record's toolbar (`Record - DX Proposal.md` FR2–FR7): left to right the\n * title and the count of the record's rows, the rail over its slice, the\n * status line, Add and Delete, and the history bar — the Sheet's items taken\n * as parts, beside the Record's own.\n *\n * One row, folded by the shared ladder (#952): the rail gives way first, as\n * it does in every builder's toolbar; then the title's count goes, then Add\n * and Delete fold to their icons, and the history folds last. The status\n * line takes the row's slack and nothing more, so it never holds a fold back:\n * a row short of room cuts its words with an ellipsis, down to nothing.\n *\n * In a phone's frame (`Mobile Builder Frame Spec.md` FR2) the row is the\n * title, the rail's summary and its Filters button, and Add as its icon at\n * the row's end; the status line says its words in the footer's band (FR5),\n * Delete is not drawn — a phone has no select column, and a row is deleted\n * from the inspector — and the history is the toolbar's second row.\n *\n * @packageDocumentation\n */\n\nimport { Box, chakra, Portal, Tooltip, useRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faMinus, faPlus } from \"@fortawesome/free-solid-svg-icons\";\nimport type { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport type { ToolbarItem } from \"@elaraai/east-ui-components\";\nimport { HOST_RANK, useSlotStyles, type SlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport type { SheetToolbarParts } from \"../sheet/Toolbar.js\";\nimport { recordMessages as m } from \"./messages.js\";\nimport type { RecordNoun } from \"./status.js\";\n\n/** The Record's own fold ranks, after every step of the rail's (#952): the title's count, then Add and Delete to their icons. */\nconst RECORD_RANK = { count: HOST_RANK, actions: HOST_RANK + 1 } as const;\n\n/** Props of {@link useRecordToolbarItems}. */\nexport interface RecordToolbarProps {\n    /** The record recipe's slot styles. */\n    styles: SlotStyles;\n    /** The Sheet's toolbar items, as parts: the rail, the Elara eye and the history are the Record's. */\n    parts: SheetToolbarParts;\n    /** The title; `undefined` for a Record with none, which leads its row with the rail. */\n    title: string | undefined;\n    /** The record's rows, counted in the viewer's language; `undefined` while not known. */\n    count: string | undefined;\n    /** The status line's words. */\n    status: string;\n    /** The Record's word for its rows. */\n    noun: RecordNoun;\n    /** Add, where the Record adds rows; `undefined` hides it. */\n    onAdd: (() => void) | undefined;\n    /** Delete of the ticked rows, where the Record deletes rows; `undefined` hides it. */\n    onDelete: (() => void) | undefined;\n    /** How many of the rows shown are ticked: Delete is off at none. */\n    ticked: number;\n    /** That count in the viewer's language: what Delete's tooltip says. */\n    tickedCount: string;\n    /**\n     * Whether a gesture may be made now: Add and Delete are off while the session takes none — an Apply out — and while\n     * the rows take none, a narrowing standing in or a far jump held.\n     */\n    writable: boolean;\n}\n\n/** One of Add and Delete: its icon and, unfolded, its words — its tooltip on hover, the button disabled or not. */\nfunction RecordAction({ css, icon, label, tip, disabled, labelled, part, onClick }: {\n    css: SystemStyleObject | SystemStyleObject[];\n    icon: IconDefinition;\n    label: string;\n    tip: string;\n    disabled: boolean;\n    /** Its words beside its icon; folded, its icon alone, named by its label. */\n    labelled: boolean;\n    /** What the tests and the visual invariants find it by. */\n    part: \"add\" | \"delete\";\n    onClick: () => void;\n}) {\n    return (\n        <Tooltip.Root openDelay={250}>\n            <Tooltip.Trigger asChild>\n                {/* A span holds the hover: a disabled button takes no pointer events, and Delete's tooltip says why it is off. */}\n                <span>\n                    <chakra.button type=\"button\" css={css} aria-label={labelled ? undefined : label} disabled={disabled}\n                        data-record-action={part} onClick={onClick}>\n                        <FontAwesomeIcon icon={icon} />\n                        {labelled && label}\n                    </chakra.button>\n                </span>\n            </Tooltip.Trigger>\n            <Portal><Tooltip.Positioner><Tooltip.Content>{tip}</Tooltip.Content></Tooltip.Positioner></Portal>\n        </Tooltip.Root>\n    );\n}\n\n/**\n * Builds the Record's toolbar items in the row's order — see the module docs.\n *\n * @param props - What the items show and drive\n * @returns The items, a falsy entry for each the Record has no use for\n */\nexport function useRecordToolbarItems(props: RecordToolbarProps): ReadonlyArray<ToolbarItem | false | undefined> {\n    const { styles, parts, title, count, status, noun, onAdd, onDelete, ticked, tickedCount, writable } = props;\n    const buttonRecipe = useRecipe({ key: \"button\" });\n    const iconRecipe = useRecipe({ key: \"iconButton\" });\n    const phoneStyles = useSlotStyles(\"toolbarPhone\");\n    const button = [buttonRecipe({ variant: \"outline\", size: \"sm\" }), styles.action] as SystemStyleObject[];\n    const icon = [iconRecipe({ variant: \"outline\", size: \"sm\" }), styles.action] as SystemStyleObject[];\n    const addTip = m.addTip({ noun: noun.singular });\n    const deleteTip = m.deleteTip({ n: ticked, count: tickedCount });\n\n    const titleOf = (counted: boolean) => (\n        <Box as=\"span\" css={styles.title} data-slot=\"title\">\n            <Box as=\"span\" css={styles.titleText} data-slot=\"titleText\">{title}</Box>\n            {counted && count !== undefined && <Box as=\"span\" css={styles.titleCount} data-slot=\"titleCount\">{count}</Box>}\n        </Box>\n    );\n    // A phone's row counts the rows in the rail's summary, where there is a rail: the title's count is the row's only count where there is none.\n    const titleItem: ToolbarItem | undefined = title === undefined ? undefined : {\n        key: \"record-title\",\n        forms: count === undefined ? [titleOf(false)] : [titleOf(true), titleOf(false)],\n        rank: RECORD_RANK.count,\n        version: count,\n        phone: { form: titleOf(parts.rail.length === 0) },\n    };\n\n    // The last gesture's words: a live region always there, so a screen reader hears each change of them.\n    const statusItem: ToolbarItem = {\n        key: \"record-status\",\n        side: \"end\",\n        forms: [<Box as=\"span\" css={styles.status} data-slot=\"status\" role=\"status\" aria-live=\"polite\" title={status === \"\" ? undefined : status}>{status}</Box>],\n        grow: true,\n        // A phone's row has no room for them: its footer's band says them.\n        phone: { form: null },\n    };\n\n    const actionsOf = (labelled: boolean) => (\n        <Box as=\"span\" css={styles.actions} data-slot=\"actions\">\n            {onAdd !== undefined && (\n                <RecordAction css={labelled ? button : icon} icon={faPlus} label={m.add()} tip={addTip} disabled={!writable} labelled={labelled} part=\"add\" onClick={onAdd} />\n            )}\n            {onDelete !== undefined && (\n                <RecordAction css={labelled ? button : icon} icon={faMinus} label={m.delete()} tip={deleteTip} disabled={!writable || ticked === 0} labelled={labelled}\n                    part=\"delete\" onClick={onDelete} />\n            )}\n        </Box>\n    );\n    const actionsItem: ToolbarItem | undefined = onAdd === undefined && onDelete === undefined ? undefined : {\n        key: \"record-actions\",\n        side: \"end\",\n        forms: [actionsOf(true), actionsOf(false)],\n        rank: RECORD_RANK.actions,\n        // A phone's: Add as its icon at the row's end, after the rail's Filters button; Delete is the inspector's.\n        phone: {\n            form: onAdd === undefined ? null : (\n                <chakra.button type=\"button\" css={phoneStyles.search} aria-label={addTip} title={addTip} disabled={!writable} data-record-action=\"add\" onClick={onAdd}>\n                    <FontAwesomeIcon icon={faPlus} />\n                </chakra.button>\n            ),\n            order: 2,\n        },\n    };\n\n    return [titleItem, ...parts.rail, statusItem, actionsItem, parts.optimise, parts.history];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraRecord` — the renderer of the `Record` extension declared in\n * `@elaraai/e3-ui` (`Record - DX Proposal.md` FR1): a system of records'\n * table in the Table's anatomy, laid out in `BuilderFrame`, over the Sheet's\n * one shared state — its machine, its editing session, its lens and its\n * paging — whose grid draws the Record's rows, header, select column and\n * empty state through its host (decision 8, `grid.tsx`).\n *\n * The frame's regions:\n *\n * - **the toolbar** — the title and the count of the record's rows, the rail\n *   over the record's slice, the status line, Add and Delete, and the history\n *   bar (`toolbar.tsx`, FR2–FR7); the status line says the last gesture's\n *   words, a step of the history's, or how many rows are ticked\n *   (`status.ts`, FR5, AD1–AD7);\n * - **the banners** — the session's, then an `entry` the record does not\n *   hold;\n * - **main** — the grid, filling the room the inspector leaves and scrolling\n *   its own rows, the strip docked under it. Beside the inspector it keeps\n *   more than a phone's frame, and where it could not the inspector overlays\n *   it. The grid draws as on a phone only in a phone's frame: the frame's\n *   width decides, never the room an overlaid inspector's rail leaves main;\n * - **the inspector**, the end pane, 320 wide, when the Record is given one —\n *   Details for the ring's row (`inspector.tsx`, IN1–IN8), and the batch's\n *   Issues, each naming its row by its title — a new row with none yet as\n *   `New person`, a row not drawn by its key (IN9) — and\n *   an empty field a new row needs `Required` in both, the Record's word; a\n *   press, ⏎ or F2 on a title opens it on Details with the keyboard in the\n *   title's field, as Add and Duplicate do — and the history bar's Issues and\n *   an issue's line, in the field the issue names — its open tab kept per\n *   viewer;\n * - **the footer** — the rows shown of the record's, the record's last save,\n *   the stale note and the legend (`footer.tsx`, FT1, FT2).\n *\n * Add drafts a row — first in the rows, in its key's place where they are\n * keyed — the rail's search cleared so it shows, and the ring on its title,\n * which opens it on Details (AD1). With no inspector a title edits in its\n * cell, as a text does, and Add opens its editor there. Delete takes the\n * ticked rows out as one draft, and the ticks with them (AD5) — a row a paged\n * record has dropped as the grid scrolled on among them (#1579); Discard drops\n * the ticks with every draft (AD6), and a new search or filter drops them, so\n * Delete never takes a row the narrowing hides.\n *\n * On a phone — the frame 560 wide or less — the frame is the BuilderFrame's\n * phone frame, the inspector its drawer, and the grid the Sheet's on a phone:\n * the title column pinned at the left, the Sheet's pager stepping through the\n * other columns, and no select column (`grid.tsx`). Its toolbar is the title,\n * the rail and Add; the status line's words are its footer's band. A press on\n * a cell of the Sheet's kinds edits it in the bottom container, the\n * inspector's field at touch size (SH10), and the drawer holds the Record's\n * own Details.\n *\n * Its rows are 36, 32 or 28 tall, the rule included — the Record's own\n * density, else the one it is placed in, else comfortable — at the theme's\n * `sizes.row` tokens, and its header row the same. Its ages count to one\n * clock, the browser's, read again each minute (`clock.tsx`). ⌘Z undoes and\n * ⇧⌘Z redoes from anywhere in the frame, as the Sheet's do. It fills its\n * parent and draws no border.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, type KeyboardEvent, type RefObject } from \"react\";\nimport { Box, useToken } from \"@chakra-ui/react\";\nimport { equivalentFor, fromEastTypeValue, type ValueTypeOf } from \"@elaraai/east\";\nimport { RecordComponent, RecordPayloadType, type sheetKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, BuilderFrame, NARROW_FRAME, SessionBanners, getSomeorUndefined, historyShortcut, implementUIComponent, takeKey, typedInto, useContainerWidth,\n    usePersistedState, type BuilderFramePanes, type EditIssue, type HistoryAction,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingReveal, keptRead, useDensity, useSlotStyles, type SlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport {\n    SheetGrid, SheetProvider, useSheetEntries, useSheetFooter, useSheetHistory, useSheetInspect, useSheetLoading, useSheetToolbarParts, useSheetToolbarRef,\n    type SheetEntryHold, type SheetHost,\n} from \"../sheet/index.js\";\nimport { draftChanges } from \"../sheet/draft-state.js\";\nimport { SheetMessagesProvider, type SheetMessages } from \"../sheet/messages.js\";\nimport { useLastCommit } from \"../sheet/frame/index.js\";\nimport { sheetCellEditor, useSheetInspector, type SheetInspectorHost } from \"../sheet/frame/inspector.js\";\nimport { indexColumns, indexRegisters } from \"../sheet/model.js\";\nimport type { SheetTransactions } from \"../sheet/transactions.js\";\nimport { issueText, useSheetWords } from \"../sheet/words.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { RecordClock, useRecordNow } from \"./clock.js\";\nimport { RecordFooter, legendOf, staleNoteOf } from \"./footer.js\";\nimport { RecordEmpty, RecordGridProvider, RecordHeader, RecordRow, titleColumnOf, useRecordGrid, type RecordGrid } from \"./grid.js\";\nimport { RecordDetails, RecordInspectorProvider, recordIssueWhere, type RecordFocus, type RecordInspector } from \"./inspector.js\";\nimport { recordMessages as rm } from \"./messages.js\";\nimport { createRecordStatus, stepOf, useRecordStatusLine, type RecordNoun, type RecordStatus } from \"./status.js\";\nimport { RecordStrip } from \"./strip.js\";\nimport { createRecordTicks, type RecordTicks } from \"./ticks.js\";\nimport { useRecordToolbarItems } from \"./toolbar.js\";\n\n/** The renderer's payload, decoded. */\nexport type RecordValue = ValueTypeOf<typeof RecordPayloadType>;\n\n/** The names a Record keeps its viewer's state under. */\ntype RecordKeys = ReturnType<typeof sheetKeys>;\n\n/** The payload's equivalence: its data, and its functions by their IR and what they capture. */\nconst payloadEquivalent = equivalentFor(RecordPayloadType);\n\n/** The select column's width, px (SL1): 20 in, the 14 box, 12 out. */\nconst SELECT_PX = 46;\n\n/**\n * The narrowest main gets beside a pinned inspector, px: wider than a phone's\n * frame, so a pinned inspector never leaves the grid less room than a phone's.\n */\nconst MIN_MAIN_PX = NARROW_FRAME + 1;\n\n/** The Sheet's words the Record says its own way (IN3, IN9): an empty field a new row needs. */\nconst RECORD_SHEET_MESSAGES: Partial<SheetMessages> = { issueRequired: rm.fieldRequired };\n\n/** No column hidden: a Record has no Columns tab. */\nconst NO_COLUMN_HIDDEN: ReadonlySet<string> = new Set();\n\n/** The inspector's tab, as storage holds it. */\nconst readTab = keptRead.record({ tab: keptRead.string });\n\n/**\n * The names a Record keeps its viewer's state under, as a Sheet's are named —\n * apart from a Sheet's of the same name.\n *\n * @param name - The Record's `name`, if it has one\n * @returns Its frame's, its columns', its library's and its surface's names\n */\nfunction recordKeys(name: string | undefined): RecordKeys {\n    const suffix = name === undefined ? \"\" : `.${name}`;\n    return { frame: `record${suffix}.frame`, columns: `record${suffix}.columns`, library: `record.library${suffix}`, surface: `record${suffix}.surface` };\n}\n\n/** Props of {@link EastChakraRecord}. */\nexport interface EastChakraRecordProps {\n    /** The payload, decoded. */\n    value: RecordValue;\n    /** The structural storage key. */\n    storageKey: string;\n}\n\n/**\n * Renders the Record — see the module docs.\n *\n * @param props - The payload and its storage key\n * @returns The Record, in its frame\n */\nexport const EastChakraRecord = memo(function EastChakraRecord({ value, storageKey }: EastChakraRecordProps) {\n    const words = useSheetWords();\n    const name = getSomeorUndefined(value.name);\n    const keys = useMemo(() => recordKeys(name), [name]);\n    // The rows' density (GR1): the Record's own, else the one it is placed in, else comfortable — its height the theme's.\n    const placed = useDensity();\n    const density = getSomeorUndefined(value.sheet.density)?.type ?? placed ?? \"comfortable\";\n    const [rowHeight] = useToken(\"sizes\", [`row.${density}`]);\n    const rowPx = Number.parseInt(rowHeight ?? \"\", 10);\n    const styles = useSlotStyles(\"record\", { density });\n    // A read-only Record has no select column: nothing it ticks could be acted on.\n    const readOnly = (getSomeorUndefined(value.sheet.readOnly) ?? false) || value.sheet.editing.onApply.type === \"none\";\n    const [ticks] = useState(createRecordTicks);\n    const [status] = useState(createRecordStatus);\n    // The grid is a phone's as its frame is, 560 wide or less — never as main is, which an overlaid inspector's rail\n    // leaves narrower than the frame. Until the frame is laid out, the grid's own width decides.\n    const frameRef = useRef<HTMLDivElement | null>(null);\n    const frameWidth = useContainerWidth(frameRef);\n    const phone = frameWidth > 0 ? frameWidth <= NARROW_FRAME : undefined;\n    // A title opens where it edits (P4): the inspector, on Details — its open tab kept per viewer — opened through the\n    // frame's panes, as the Record's own code opens them.\n    const { state: pane, setState: setPane } = usePersistedState<{ tab: string }>(`${keys.frame}.inspector.tab`, { tab: \"details\" }, readTab);\n    const panes = useRef<BuilderFramePanes>(null);\n    const openDetails = useCallback(() => {\n        setPane({ tab: \"details\" });\n        panes.current?.open(\"end\");\n    }, [setPane]);\n    // …with the keyboard in the title's field (AD1), as a copy's (IN7) and an issue's once it is gone to (IN9): asked of\n    // the row's Details, which answer once their form has given it.\n    const [focus, setFocus] = useState<RecordFocus | undefined>(undefined);\n    const focusSeq = useRef(0);\n    const onOpen = useCallback((r: number, key: string) => {\n        focusSeq.current += 1;\n        setFocus({ r, key, seq: focusSeq.current });\n        openDetails();\n    }, [openDetails]);\n    const focused = useCallback((seq: number) => setFocus((was) => (was !== undefined && was.seq === seq ? undefined : was)), []);\n    // Each step of the history, told to the status line in the Record's words once it is taken (AD4–AD7): what it\n    // will take back or send read before it is taken — after it, the session holds none of it. Discard drops the ticks\n    // with the drafts (AD6); an Apply is told once its batch is written and read back — while the session reads it\n    // back the history bar says so, and the toolbar says one thing at a time — a refusal saying itself in the banners.\n    const fields = useMemo(() => draftChanges(fromEastTypeValue(value.sheet.editing.draftType)), [value.sheet.editing.draftType]);\n    // An Apply's words waiting for its batch to be read back: what stops the wait, as the Record is let go.\n    const reading = useRef<(() => void) | undefined>(undefined);\n    useEffect(() => () => reading.current?.(), []);\n    const onHistory = useCallback((action: HistoryAction, session: SheetTransactions) => {\n        const step = stepOf(action, session, fields);\n        if (step === undefined) return undefined;\n        return () => {\n            if (step.id !== \"applied\") {\n                if (step.id === \"discarded\") ticks.clear();\n                status.say(step);\n                return;\n            }\n            // Written, the session reads the batch back and leaves it idle; refused, or its outcome unknown, it is never told.\n            const told = (): boolean => {\n                if (session.status === \"reconciling\") return false;\n                if (session.status === \"idle\" && session.error === undefined) status.say(step);\n                return true;\n            };\n            if (told()) return;\n            reading.current?.();\n            const stop = session.subscribe(() => {\n                if (!told()) return;\n                stop();\n                if (Object.is(reading.current, stop)) reading.current = undefined;\n            });\n            reading.current = stop;\n        };\n    }, [fields, ticks, status]);\n    // A phone's cell editor (SH10): a cell of the Sheet's kinds edits in the bottom container, its inspector's field at\n    // touch size; a cycle, a toggle and a boolean step where they are pressed, and a title opens its Details — or, with\n    // no inspector, edits there as a text does.\n    const cellEditor = useMemo(() => sheetCellEditor(value, words, NO_COLUMN_HIDDEN), [value, words]);\n    // With no inspector a title opens nowhere: it edits in its cell, as a text does, and Add opens its editor there.\n    const inspector = value.inspector.type === \"some\";\n    // The inspector's forms: the bounds a row's numbers are held to (#1585).\n    const forms = getSomeorUndefined(value.inspector)?.forms;\n    const host = useMemo((): SheetHost => ({\n        grid: {\n            rowPx, leadPx: readOnly ? 0 : SELECT_PX, leadRun: \"check\", runStyles: styles, Row: RecordRow, Header: RecordHeader, Empty: RecordEmpty,\n            Strip: RecordStrip, onOpen: inspector ? onOpen : undefined,\n        },\n        phone,\n        onHistory,\n        cellEditor,\n        forms,\n        // Whether its Autosave begins on, as its author says.\n        autosave: value.autosave,\n    }), [rowPx, readOnly, phone, styles, inspector, onOpen, onHistory, cellEditor, forms, value.autosave]);\n    const noun = useMemo((): RecordNoun => getSomeorUndefined(value.noun) ?? rm.rowNoun(), [value.noun]);\n    const title = getSomeorUndefined(value.title);\n    const grid = useMemo((): RecordGrid => ({ styles, ticks, groups: value.columnGroups, noun, title, inspector }), [styles, ticks, value.columnGroups, noun, title, inspector]);\n    const inspection = useMemo((): RecordInspector => ({ focus, focused, status, ticks, readOnly }), [focus, focused, status, ticks, readOnly]);\n    const onTab = useCallback((tab: string) => setPane({ tab }), [setPane]);\n    return (\n        <SheetMessagesProvider messages={RECORD_SHEET_MESSAGES}>\n            <RecordClock>\n                <RecordGridProvider value={grid}>\n                    <SheetProvider value={value.sheet} storageKey={storageKey} host={host}>\n                        <RecordInspectorProvider value={inspection}>\n                            <RecordFrame value={value} keys={keys} styles={styles} frameRef={frameRef} panesRef={panes} tab={pane.tab} onTab={onTab} onOpen={onOpen}\n                                openDetails={openDetails} ticks={ticks} status={status} readOnly={readOnly} />\n                        </RecordInspectorProvider>\n                    </SheetProvider>\n                </RecordGridProvider>\n            </RecordClock>\n        </SheetMessagesProvider>\n    );\n}, (prev, next) => payloadEquivalent(prev.value, next.value) && prev.storageKey === next.storageKey);\n\n/** Props of {@link RecordFrame}. */\ninterface RecordFrameProps {\n    value: RecordValue;\n    keys: RecordKeys;\n    /** The record recipe's slot styles. */\n    styles: SlotStyles;\n    /** The frame's root, whose width says whether the grid is a phone's. */\n    frameRef: RefObject<HTMLDivElement | null>;\n    /** The frame's panes: where a title's press opens the inspector. */\n    panesRef: RefObject<BuilderFramePanes | null>;\n    /** The inspector's open tab. */\n    tab: string;\n    /** Opens an inspector tab. */\n    onTab: (tab: string) => void;\n    /** Opens the inspector on a row's Details, with the keyboard in a field: its row-space index, and the field's key. */\n    onOpen: (r: number, key: string) => void;\n    /** Opens the inspector on Details. */\n    openDetails: () => void;\n    /** The rows ticked. */\n    ticks: RecordTicks;\n    /** The steps of the history the status line is told of. */\n    status: RecordStatus;\n    /** No gesture changes the Record: no Add, no Delete. */\n    readOnly: boolean;\n}\n\n/** The frame, its regions holding the Sheet's parts and the Record's grid. */\nfunction RecordFrame({ value, keys, styles, frameRef, panesRef, tab, onTab, onOpen, openDetails, ticks, status, readOnly }: RecordFrameProps) {\n    const words = useSheetWords();\n    const { m } = words;\n    const parts = useSheetToolbarParts();\n    const toolbarRef = useSheetToolbarRef();\n    const entries = useSheetEntries();\n    const footer = useSheetFooter();\n    const loading = useSheetLoading();\n    const { session, onAction } = useSheetHistory();\n    const inspect = useSheetInspect();\n    const now = useRecordNow();\n    const lastCommit = useLastCommit(value.history, words);\n    const saved = lastCommit === undefined ? undefined : m.savedAt({ when: lastCommit.when });\n    const { noun, title } = useRecordGrid();\n    const columns = useMemo(() => indexColumns(value.sheet.columns), [value.sheet.columns]);\n    const registers = useMemo(() => indexRegisters(value.sheet.registers), [value.sheet.registers]);\n    // An issue's row named by its title — a new one with none yet in the Record's word for its rows — else by its key\n    // (IN9): in the Issues tab's lines and the banners alike.\n    const changesAt = inspect.changesAt;\n    const issueWhere = useMemo(() => recordIssueWhere(columns, noun, (r) => changesAt(r)?.added === true), [columns, noun, changesAt]);\n    // The inspector's Details the Record's (IN1–IN8), and its issues' rows named as above.\n    const inspectorHost = useMemo((): SheetInspectorHost => ({ Details: RecordDetails, where: issueWhere }), [issueWhere]);\n    const inspector = useSheetInspector({ value, keys, words, hidden: NO_COLUMN_HIDDEN, lastCommit, host: inspectorHost });\n    const end = inspector === undefined ? undefined : { ...inspector, tab, onTabChange: onTab };\n    // A Save that takes rows out of the `rows` source's narrowing says so in the footer.\n    const rowsPart = useMemo(() => sourcePart(getSomeorUndefined(value.sheet.slice), \"rows\"), [value.sheet.slice]);\n    // The rows ticked: what Delete deletes and the status line counts — a row a paged record has dropped as the grid\n    // scrolled on among them, its tick holding what the Sheet held of it (#1579).\n    ticks.holdWith(entries.hold);\n    const tickVersion = useSyncExternalStore(ticks.subscribe, ticks.version);\n    // eslint-disable-next-line react-hooks/exhaustive-deps -- tickVersion moves with every tick: the ticks are a store read by its version.\n    const ticked = useMemo(() => ticks.size(), [ticks, tickVersion]);\n    // A tick is of the rows a narrowing shows: a new search or filter starts with none ticked, so Delete never takes a row it hides.\n    const narrowing = entries.narrowing;\n    useEffect(() => { ticks.clear(); }, [narrowing, ticks]);\n    const shown = entries.count.shown;\n    const total = entries.count.total;\n    // Every issue holding Apply, as the history bar counts them: what an issue gone to says it is one of (AD3).\n    const readiness = session.readiness;\n    const issues = readiness.type === \"ready\" ? session.issues : readiness.value;\n    const statusLine = useRecordStatusLine({\n        status, notice: entries.notice, gestures: entries.gestures, ticks, ticked, of: shown ?? entries.rows.length, issues, words, noun,\n    });\n    // Issues takes the ring to the first issue's field, its row opened on Details with the keyboard in the field (AD3, IN9),\n    // as the Issues tab's lines do. Where the row stands is read as the notice comes, never again as the rows move.\n    const notice = entries.notice;\n    const placeOf = useRef(inspect.placeOf);\n    placeOf.current = inspect.placeOf;\n    useEffect(() => {\n        if (notice?.id !== \"issue\") return;\n        const place = placeOf.current(notice.issue);\n        const field = getSomeorUndefined(notice.issue.field);\n        if (place !== undefined && field !== undefined) onOpen(place.r, field);\n        else openDetails();\n    }, [notice, onOpen, openDetails]);\n    // Add drafts a row, its ring on the title (AD1); Delete the ticked rows (AD5), the ticks going with them.\n    const capabilities = value.sheet.editing.edits;\n    const titleKey = useMemo(() => titleColumnOf(columns)?.key, [columns]);\n    const add = entries.add;\n    const remove = entries.remove;\n    const onAdd = useCallback(() => add(titleKey), [add, titleKey]);\n    const onDelete = useCallback(() => {\n        const ticksHeld = ticks.held();\n        const held = new Map<string, SheetEntryHold>();\n        for (const [id, version] of ticksHeld) if (version !== undefined) held.set(id, version);\n        remove([...ticksHeld.keys()], held);\n        ticks.clear();\n    }, [remove, ticks]);\n    // Add and Delete are off while the rows take no gesture — a narrowing standing in, a far jump held — as the session's\n    // add and remove would refuse it then.\n    const items = useRecordToolbarItems({\n        styles, parts, title, count: total === undefined ? undefined : words.number(total), status: statusLine, noun,\n        onAdd: readOnly || !capabilities.insertRows ? undefined : onAdd,\n        onDelete: readOnly || !capabilities.removeRows ? undefined : onDelete,\n        ticked, tickedCount: words.number(ticked), writable: session.writable && inspect.writable,\n    });\n    // The footer (FT1, FT2): the rows shown of the record's, the stale note over every row shown but a new one, and the legend.\n    const count = shown === undefined || total === undefined ? undefined\n        : rm.shownOf({ shown: words.number(shown), total: words.number(total), n: total, noun: noun.singular, nouns: noun.plural });\n    const stale = entries.whole ? staleNoteOf(columns, entries.rows, entries.changes, now, words) : undefined;\n    const legend = useMemo(() => legendOf(columns, registers), [columns, registers]);\n    // An issue's place in a banner: its row, named as the Issues tab names it — a Record's rows have no lines.\n    const where = useCallback((issue: EditIssue) => issueWhere(issue, placeOf.current(issue)), [issueWhere]);\n    const readIssue = useCallback((message: string) => issueText(message, words), [words]);\n    // The history keys from anywhere in the frame: the grid's own it has answered already.\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n        if (event.defaultPrevented || typedInto(event.target)) return;\n        const action = historyShortcut(event);\n        if (action === undefined) return;\n        takeKey(event);\n        onAction(action);\n    }, [onAction]);\n    const missing = getSomeorUndefined(value.missing);\n    // No control to show — read only, no title, no slice — no toolbar.\n    const toolbar = items.some((item) => item !== undefined && item !== false && item.key !== \"record-status\") ? items : undefined;\n    const banners = (\n        <>\n            <SessionBanners session={session} words={words} onAction={onAction} where={where} issueText={readIssue} />\n            {missing !== undefined && (\n                <Box data-record-banner=\"missing\">\n                    <BannerView status=\"neutral\" title={m.entryMissing({ key: missing })} />\n                </Box>\n            )}\n        </>\n    );\n    // One reveal clock, as the Sheet's: the footer's line and the runs' placeholders show once a read the view waits for has passed the delay.\n    const waiting = footer.loading !== undefined && footer.loading.kind !== \"failed\";\n    return (\n        <LoadingReveal waiting={waiting}>\n            <BuilderFrame\n                ref={frameRef}\n                panesRef={panesRef}\n                storageKey={keys.frame}\n                toolbar={toolbar}\n                toolbarRef={toolbarRef}\n                banners={banners}\n                end={end}\n                minMain={MIN_MAIN_PX}\n                footer={<RecordFooter styles={styles} count={count} saved={saved} stale={stale} recordSlice={rowsPart} legend={legend} live={statusLine}\n                    loading={footer.loading} noun={footer.noun} onRetry={footer.onRetry} />}\n                loading={loading.cold}\n                busy={loading.busy}\n                loadingPitch={loading.pitch}\n                liveFooter\n                onKeyDown={onKeyDown}\n            >\n                <Box css={styles.root} data-record=\"\">\n                    <Box css={styles.grid}>\n                        <SheetGrid />\n                    </Box>\n                </Box>\n            </BuilderFrame>\n        </LoadingReveal>\n    );\n}\n\nimplementUIComponent(RecordComponent, EastChakraRecord);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Where a key a builder's canvas hears comes from (#1398): the Schematic's and\n * the Flowchart's canvases hear a key from inside their frame as it leaves the\n * frame, and one from the page itself — nothing focused — at the window. A key\n * from anywhere else on the page, a layer portaled out of the frame among it,\n * is never the canvas's: a key typed elsewhere never acts on it. And a control\n * in the frame keeps its own Space ({@link keepsSpace}): the Schematic's\n * canvas holds Space as its momentary Select only from itself, the page, or an\n * element that acts on none.\n *\n * @packageDocumentation\n */\n\n/**\n * Whether a key comes from nowhere in particular — the page, its body, with nothing focused — and so passed through no\n * element of the frame: the window hears it for the canvas. One from inside the frame the frame hears as it leaves it,\n * and takes there (#1398).\n *\n * @param target - The key's target\n * @returns Whether it is the page's\n */\nexport function keyFromPage(target: EventTarget | null): boolean {\n    if (!(target instanceof Element)) return true;\n    const doc = target.ownerDocument;\n    return target === doc.body || target === doc.documentElement;\n}\n\n/**\n * Whether a key the frame hears leave comes from the frame's own regions: never from a layer portaled out of it — a\n * popover, a menu, a Chooser's list — which is that layer's, as the frame leaves such a layer its Esc (`BuilderFrame`),\n * nor from another frame on the page. A key's way up the page's components runs through each portal to the part that\n * opened it, so the frame hears that layer's keys too: the page's own elements say whose they are.\n *\n * @param inside - An element of the frame: the canvas's\n * @param target - The key's target\n * @returns Whether the frame holds it\n */\nexport function keyInFrame(inside: Element | null, target: EventTarget | null): boolean {\n    const frame = inside?.closest(\"[data-builder-frame]\") ?? inside;\n    return frame !== null && frame !== undefined && target instanceof Node && frame.contains(target);\n}\n\n/** What acts on Space itself: a control, a field, and every widget role's element. */\nconst OWN_SPACE = [\n    \"button\", \"a[href]\", \"input\", \"select\", \"textarea\", \"summary\", \"[contenteditable]:not([contenteditable=\\\"false\\\"])\",\n    ...[\"button\", \"checkbox\", \"radio\", \"switch\", \"tab\", \"option\", \"menuitem\", \"menuitemcheckbox\", \"menuitemradio\", \"combobox\", \"slider\",\n        \"spinbutton\", \"link\", \"textbox\", \"searchbox\", \"treeitem\", \"tree\", \"listbox\", \"grid\", \"gridcell\", \"radiogroup\", \"tablist\", \"menu\",\n        \"menubar\"].map((role) => `[role=\"${role}\"]`),\n].join(\", \");\n\n/**\n * Whether a key's target keeps its Space (#1398): a control a press of Space acts on — a button, a link, a field, a\n * checkbox, a radio, a Chooser's trigger, any widget role's element — as a browser activates a focused button on it. A\n * canvas holds Space as a momentary tool only from itself, from the page, or from an element that acts on none; from\n * a control in its frame it leaves Space to the control.\n *\n * @param target - The key's target\n * @param canvas - The canvas's element: its own Space is the canvas's\n * @returns Whether the target keeps its Space\n */\nexport function keepsSpace(target: EventTarget | null, canvas: Element | null): boolean {\n    if (!(target instanceof Element) || target === canvas) return false;\n    return target.closest(OWN_SPACE) !== null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's details model (#1508, `Flowchart Records Spec.md` R19, R22,\n * R26, R27, R33, R34, R38): the app's rows a state's card and a transition's\n * label draw from, read as their kind is, counted into the flowchart's bins,\n * and each card's size — pure, but for its reader.\n *\n * - **Read as the kind is** (R19). Beside a kind read whole the details are\n *   read whole, through their `rows`; beside one read through its source, by\n *   the keys of the rows drawn, every key in one request, through the paged\n *   read they name (`defaultPagedRuntime.rowsAll`, as the Schematic reads its\n *   far ends), each key's text read back at the kind's key type, as the\n *   details are keyed (#1549). Either way a row is matched to the kind's by\n *   its key: a key the details hold no row of draws *no data* (R33), and a\n *   details row keyed as no row drawn draws nothing and is no issue (R38). The\n *   last settled read stands while a newer one is in flight; a key no settled\n *   read asked of draws a placeholder (R34); a failed read keeps what it held,\n *   and says why.\n * - **The flowchart's bins** (R26, R27). A histogram read's bins are shared by\n *   every card that draws it, so a bar is the same span on each: the app's\n *   `bins`, checked as they land — an Array the app binds may hold no edge, one\n *   that is no finite number, or two that do not ascend, and is then listed in\n *   Issues, its bars drawn on no card — else every drawn row's edges merged. A\n *   Dict's durations count in the bin that holds them, one under the first edge\n *   in the first; an Array's counts are a bin each, each at its bin's edge. A\n *   count at no edge — an Array of another length than its bins, whose counts\n *   e3-ui puts at `NaN` — or one that is no count, negative or not finite, no\n *   bin holds: the row is listed in Issues, and a histogram none of whose\n *   counts a bin holds has nothing to show.\n * - **Bars** (R26): on a band axis, the default, a bar a bin, equal widths; on a\n *   linear axis each bar as wide as its span and as tall as its count over it,\n *   so its area is its count, the open last bin as wide as the one before it.\n *   Each card is scaled to its own tallest bar.\n * - **Each card's size** (R22, §4), the visual spec's, from the reads it shows:\n *   272 wide where a read draws on the canvas; its head, a rule, then each read\n *   in the details' order, 12 apart inside 12 of padding. A tag list wraps by\n *   its tags' widths — measured where the card draws, estimated elsewhere —\n *   three lines at most, then +n.\n * - **Weighed by the rail's picks** (#1522, R43–R46). Details that name a\n *   source of the rail are read by key whatever their kind's read: the drawn\n *   rows through their entries index's lean rows, and the picked keys' ranges\n *   of the index, re-read as the picks change — never the record's own rows.\n *   A row's picked entries are what each read the picks weigh draws, added up\n *   by kind in East (`fold`); a row holding none of them says *no data* in\n *   those reads and draws its own in the others; with no pick, every read\n *   draws the row's own. The source's other fields narrow the rows: a row they\n *   leave out reads as a row there is none of (R33). A source over another\n *   record than the details' is listed in Issues, and its picks weigh nothing.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport {\n    BlobType, FloatType, IntegerType, SortedMap, SortedSet, StringType, compareFor, encodeBeast2For, equalFor, fromEastTypeValue, lessFor, none,\n    printFor, some, variant, type EastType, type EastTypeValue, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport type { Flowchart } from \"@elaraai/e3-ui/internal\";\nimport type { RecordSliceBindType, RecordSliceChoiceType, RecordSliceEntry, RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { getSomeorUndefined, useTrackedEvaluation, type Formatters } from \"@elaraai/east-ui-components\";\nimport { recordChoiceSummary, recordSliceWithin } from \"@elaraai/east-ui-components/internal\";\nimport { indexedBindingOf, type IndexedBindingRead } from \"../platform/indexed-paged.js\";\nimport { defaultPagedRuntime, pagedSourceOf, type PagedSource } from \"../platform/paged-runtime.js\";\nimport { STRING_KEYS, kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport type { FlowchartModel, FlowchartValue } from \"./model.js\";\n\n/** A kind's details, decoded: each read described, and its rows' values. */\nexport type FlowchartDetailsValue = ValueTypeOf<typeof Flowchart.Types.Details>;\n\n/** One read, described. */\nexport type FlowchartReadValue = ValueTypeOf<typeof Flowchart.Types.Read>;\n\n/** A details row's values: one a read, in the reads' order. */\nexport type FlowchartDetailRowValue = ValueTypeOf<typeof Flowchart.Types.DetailRow>;\n\n/** A histogram's value in a row: its counts, each at the lower edge of the bin it counts. */\ntype HistogramValue = Extract<FlowchartDetailRowValue[number], { type: \"histogram\" }>[\"value\"];\n\n/** A list's value in a row: its items, by name. */\ntype ListValue = Extract<FlowchartDetailRowValue[number], { type: \"list\" }>[\"value\"];\n\n/** A tags read's looks: each a tag's, first defined, first shown. */\nexport type FlowchartTagColors = Extract<FlowchartReadValue, { type: \"tags\" }>[\"value\"][\"colors\"];\n\n/** How the rail's picks weigh a kind's details, as the payload gives it (#1522). */\nexport type FlowchartWeighedValue = ValueTypeOf<typeof Flowchart.Types.Weighed>;\n\n/** A source's part of the rail: its record Slice's controls, as the payload's chrome carries them. */\nexport type FlowchartSlicePart = ValueTypeOf<RecordSliceBindType>;\n\n/** The kinds that carry details. */\nexport type FlowchartDetailsSort = \"states\" | \"transitions\";\n\n/** A kind carrying details, as the payload gives it. */\nexport interface FlowchartDetailsKind {\n    /** Its name: what Issues names its refused bins by. */\n    readonly name: string;\n    /** Its details. */\n    readonly details: FlowchartDetailsValue;\n    /** Its keys (#1549): the details, keyed as the kind is, are asked by each key's text read back at its key type; String's by default. */\n    readonly keys?: KindKeys | undefined;\n    /** The rail's part whose picks weigh them (#1522); `undefined` for details none weighs. */\n    readonly weighing?: FlowchartSlicePart | undefined;\n}\n\n/** The kinds carrying details: `undefined` for a kind with none. */\nexport interface FlowchartDetailsKinds {\n    /** The states'. */\n    readonly states: FlowchartDetailsKind | undefined;\n    /** The transitions'. */\n    readonly transitions: FlowchartDetailsKind | undefined;\n}\n\n/**\n * The kinds carrying details, from the payload.\n *\n * @param value - The payload\n * @returns Each kind's name, details and keys, where it has some\n */\nexport function detailsKindsOf(value: FlowchartValue): FlowchartDetailsKinds {\n    const chrome = getSomeorUndefined(value.slice);\n    const kind = (name: string, details: FlowchartDetailsValue | undefined, keyType: EastTypeValue): FlowchartDetailsKind | undefined => {\n        if (details === undefined) return undefined;\n        // Weighed, the rail's part of the source whose picks weigh them (#1522): the payload refuses a source the slice lacks.\n        const weighed = getSomeorUndefined(details.weighed);\n        return { name, details, keys: kindKeys(keyType), weighing: weighed === undefined ? undefined : sourcePart(chrome, weighed.source) };\n    };\n    const transitions = getSomeorUndefined(value.transitions);\n    return {\n        states: kind(value.states.name, getSomeorUndefined(value.states.details), value.states.keyType),\n        transitions: transitions === undefined ? undefined : kind(transitions.name, getSomeorUndefined(transitions.details), transitions.keyType),\n    };\n}\n\nconst compareKey = compareFor(StringType);\nconst sameString = equalFor(StringType);\nconst compareFloat = compareFor(FloatType);\nconst lessFloat = lessFor(FloatType);\nconst sameBytes = equalFor(BlobType);\nconst compareRow = compareFor(IntegerType);\n\n/** Why a read failed, as the box says it. */\nfunction messageOf(error: unknown): string {\n    return error instanceof Error ? error.message : String(error);\n}\n\n// ============================================================================\n// The rows drawn\n// ============================================================================\n\n/** The keys of the rows the canvas draws, by kind, each in their keys' order at its key type: what the details are matched to, and asked by. */\nexport interface FlowchartDrawnKeys {\n    /** The states drawn: a ghost stands for no row, so none of them. */\n    readonly states: readonly string[];\n    /** The transitions drawn: those routed, and those in place, drawn as their state's `↻ n`. */\n    readonly transitions: readonly string[];\n}\n\n/**\n * The keys of the rows a model draws (R19): what the details are asked by.\n *\n * @param model - What the canvas draws, the drafts in place\n * @returns Each kind's keys, in their keys' order at its key type (#1549)\n */\nexport function drawnKeysOf(model: FlowchartModel): FlowchartDrawnKeys {\n    const states = new Set<string>();\n    const transitions = new Set<string>();\n    for (const node of model.nodes) {\n        if (!node.ghost) states.add(node.key);\n        for (const key of node.inPlaceKeys) transitions.add(key);\n    }\n    for (const link of model.links) transitions.add(link.key);\n    return {\n        states: model.keys.states.order(states).map(({ text }) => text),\n        transitions: model.keys.transitions.order(transitions).map(({ text }) => text),\n    };\n}\n\n/** Two lists of keys holding the same keys, in the same order. */\nfunction sameKeys(a: readonly string[], b: readonly string[]): boolean {\n    return a.length === b.length && a.every((key, i) => sameString(key, b[i]!));\n}\n\n/**\n * The keys of the rows a model draws, the same object while they are the same:\n * a draft or a page landing moves the model, and seldom the keys it draws.\n *\n * @param model - What the canvas draws\n * @returns Each kind's keys\n */\nexport function useDrawnKeys(model: FlowchartModel): FlowchartDrawnKeys {\n    const held = useRef<FlowchartDrawnKeys | undefined>(undefined);\n    const now = useMemo(() => drawnKeysOf(model), [model]);\n    const was = held.current;\n    const kept = was !== undefined && sameKeys(was.states, now.states) && sameKeys(was.transitions, now.transitions) ? was : now;\n    held.current = kept;\n    return kept;\n}\n\n// ============================================================================\n// The read\n// ============================================================================\n\n/** Each key's row, as bytes at the details' row type — `null` for a key the details hold no row of. */\nexport type FlowchartDetailBytes = ReadonlyMap<string, Uint8Array | null>;\n\n/**\n * How the details are read by key, beside a kind read through its source\n * (R19): the rows of the keys asked, every key in one request, each key's text\n * read back at the kind's key type (#1549) — `none` while in flight. Throws\n * the read's failure.\n */\nexport type FlowchartPagedRows = (paged: string, keys: readonly string[], keyed: KindKeys) => option<FlowchartDetailBytes>;\n\n/** Each paged source's row encoder: what turns a row read by key back into the bytes `values` reads. */\nconst ENCODERS = new WeakMap<PagedSource, (row: unknown) => Uint8Array>();\n\n/**\n * The details read by key through the paged read named (R19):\n * `defaultPagedRuntime.rowsAll` over the keys asked, one request and one\n * channel, each row encoded back at the Dict's row type, as the details'\n * `values` reads it.\n *\n * @param paged - The paged read's handle id\n * @param keys - The keys of the rows drawn, as their texts\n * @param keyed - The kind's keys, which the details are keyed as: a text no key prints as holds no row\n * @returns Each key's row's bytes — `null` for none — once every one is known; `none` while in flight\n * @throws {Error} Naming the read, where `Data.bindPaged` has bound no handle of its id; the read's failure, until a read\n *   after the retry gap asks again\n */\nexport const pagedDetailRows: FlowchartPagedRows = (paged, keys, keyed) => {\n    const source = pagedSourceOf(paged);\n    if (source === undefined) throw new Error(`The details' paged read '${paged}' names no handle Data.bindPaged has bound`);\n    const rows = new Map<string, Uint8Array | null>(keys.map((text) => [text, null] as const));\n    // Each text read back at the kind's key type: one no key prints as holds no row, and is asked nothing.\n    const asked = keys.flatMap((text) => {\n        const key = keyed.keyOf(text);\n        return key === undefined ? [] : [key];\n    });\n    if (asked.length === 0) return some(rows);\n    const read = defaultPagedRuntime.rowsAll(source, asked);\n    if (read.type !== \"some\") return none;\n    let encode = ENCODERS.get(source);\n    if (encode === undefined) {\n        // A Dict's own rows: `rowsAll` reads none else.\n        const rowType = (source.type.value as { readonly value: Parameters<typeof fromEastTypeValue>[0] }).value;\n        encode = encodeBeast2For(fromEastTypeValue(rowType)) as (row: unknown) => Uint8Array;\n        ENCODERS.set(source, encode);\n    }\n    for (const row of read.value) rows.set(keyed.textOf(row.key), row.row.type === \"some\" ? encode(row.row.value) : null);\n    return some(rows);\n};\n\n/**\n * A weighed kind's rows, as one read found them (#1522): each drawn key's row\n * as bytes — `null` for a key the details hold no row of — the rows\n * themselves, which the source's other fields are asked of, and each row's\n * picked entries as bytes, each an entry's value, in the entries' key order.\n */\nexport interface FlowchartWeighedBytes {\n    /** Each drawn key's lean row's bytes: the row with the Dict field the entries index files emptied. */\n    readonly rows: FlowchartDetailBytes;\n    /** Each drawn key's lean row, by key: what a membership read asks of the source's other fields. */\n    readonly lean: ReadonlyMap<string, unknown>;\n    /** Each drawn row's picked entries' bytes, by key — a row holding none of the picks absent. */\n    readonly entries: ReadonlyMap<string, readonly Uint8Array[]>;\n}\n\n/**\n * How weighed details are read by key (#1522, R44): the drawn rows through\n * their entries index's lean rows, each key's text read back at the kind's key\n * type (#1549), and the picked keys' ranges of the index, each kept to the rows\n * drawn — `none` while in flight. Throws the read's failure.\n */\nexport type FlowchartWeighedRows = (paged: string, weighed: FlowchartWeighedValue, picks: readonly string[], keys: readonly string[], keyed: KindKeys) => option<FlowchartWeighedBytes>;\n\n/** A binding's encoders, made once: a key's `.east` literal, a row's bytes, and an entry's, by its index. */\ninterface WeighedCodecs {\n    readonly key: (key: unknown) => string;\n    readonly row: (row: unknown) => Uint8Array;\n    readonly entries: Map<string, (value: unknown) => Uint8Array>;\n}\n\n/** Each binding's encoders. */\nconst WEIGHED_CODECS = new WeakMap<IndexedBindingRead, WeighedCodecs>();\n\n/** A binding's encoders, made the first time it is read. */\nfunction codecsOf(binding: IndexedBindingRead): WeighedCodecs {\n    let codecs = WEIGHED_CODECS.get(binding);\n    if (codecs === undefined) {\n        codecs = {\n            key: printFor(binding.key as EastType) as (key: unknown) => string,\n            row: encodeBeast2For(binding.row as EastType) as (row: unknown) => Uint8Array,\n            entries: new Map(),\n        };\n        WEIGHED_CODECS.set(binding, codecs);\n    }\n    return codecs;\n}\n\n/** A run of a source's entries, as a search found it. */\ntype Run = { readonly found: boolean; readonly row: bigint; readonly count: bigint };\n\n/**\n * The weighed details read through the binding they name (#1522, R44): the\n * drawn keys searched in the entries index's lean rows and the picked keys in\n * the index, in one request each, then the rows found and the picked keys'\n * ranges read, in one request each — so a pick reads its ranges, and the rows\n * by key, and never the record's own rows. Each entry is kept to the rows\n * drawn, a row's in the entries' key order.\n *\n * @param paged - The binding's id\n * @param weighed - How the picks weigh the details\n * @param picks - The picked keys, as `.east` literals of the Dict's keys\n * @param keys - The keys of the rows drawn, as their texts, in their keys' order\n * @param keyed - The kind's keys, which the details are keyed as: a text no key prints as holds no row\n * @returns The rows, and their picked entries, once every one is known; `none` while in flight\n * @throws {Error} Naming the read, where `Data.bindPaged` has bound no binding of its id, or one listing no such entries\n *   index; the read's failure, until a read after the retry gap asks again\n */\nexport const weighedDetailRows: FlowchartWeighedRows = (paged, weighed, picks, keys, keyed) => {\n    const binding = indexedBindingOf(paged);\n    if (binding === undefined) throw new Error(`The details' paged read '${paged}' names no binding Data.bindPaged has bound over a record's indexes`);\n    const index = binding.entries.get(weighed.index);\n    if (index === undefined) throw new Error(`The details' binding '${paged}' lists no entries index '${weighed.index}'`);\n    const codecs = codecsOf(binding);\n    let entry = codecs.entries.get(weighed.index);\n    if (entry === undefined) {\n        entry = encodeBeast2For(index.value) as (value: unknown) => Uint8Array;\n        codecs.entries.set(weighed.index, entry);\n    }\n    const { seekAll, runsAll } = binding.batches;\n    // The drawn rows, each a run of one of the lean rows — its text read back at the kind's key type, one no key prints\n    // as asked nothing; the picked keys, each its range of the index — asked together.\n    const asked = keys.flatMap((text) => {\n        const key = keyed.keyOf(text);\n        return key === undefined ? [] : [key];\n    });\n    const found = asked.length === 0 ? some([] as Run[]) : seekAll(index.rows, asked.map((key) => variant(\"key\", codecs.key(key))));\n    const ranges = picks.length === 0 ? some([] as Run[]) : seekAll(weighed.index, picks.map((pick) => variant(\"key\", pick)));\n    if (found.type === \"none\" || ranges.type === \"none\") return none;\n    const rowRuns = found.value.filter((run) => run.found);\n    // The ranges in the index's order — the picked keys' — so a row's entries come in their keys' order.\n    const pickRuns = ranges.value.filter((run) => run.found && compareRow(run.count, 0n) > 0).sort((a, b) => compareRow(a.row, b.row));\n    const lean = rowRuns.length === 0 ? some([] as RecordSliceEntry[]) : runsAll(index.rows, rowRuns) as option<RecordSliceEntry[]>;\n    const held = pickRuns.length === 0 ? some([] as RecordSliceEntry[]) : runsAll(weighed.index, pickRuns) as option<RecordSliceEntry[]>;\n    if (lean.type === \"none\" || held.type === \"none\") return none;\n    const rows = new Map<string, Uint8Array | null>(keys.map((key) => [key, null] as const));\n    const leanRows = new Map<string, unknown>();\n    for (const read of lean.value) {\n        const row = read.row === undefined ? undefined : getSomeorUndefined(read.row);\n        if (row === undefined) continue;\n        const key = keyed.textOf(read.key);\n        rows.set(key, codecs.row(row));\n        leanRows.set(key, row);\n    }\n    const entries = new Map<string, Uint8Array[]>();\n    for (const read of held.value) {\n        const key = keyed.textOf(read.key);\n        const value = read.value === undefined ? undefined : getSomeorUndefined(read.value);\n        // Kept to the rows drawn: a range holds every row's entry of its key.\n        if (value === undefined || !leanRows.has(key)) continue;\n        const list = entries.get(key);\n        if (list === undefined) entries.set(key, [entry(value)]);\n        else list.push(entry(value));\n    }\n    return some({ rows, lean: leanRows, entries });\n};\n\n/**\n * A Retry of the details (R34): each kind's paged read asked again what failed\n * of it, at once — not after the retry gap a read alone waits — as a Retry\n * asks a source of the rail (`defaultPagedRuntime.askAgain`). A kind read\n * whole is read again as the read's attempt moves; one weighed by the rail's\n * picks asks its binding's record again (#1522).\n *\n * @param kinds - The kinds carrying details\n */\nexport function askDetailsAgain(kinds: FlowchartDetailsKinds): void {\n    for (const kind of [kinds.states, kinds.transitions]) {\n        const paged = kind === undefined ? undefined : getSomeorUndefined(kind.details.paged);\n        if (paged === undefined) continue;\n        if (kind!.details.weighed.type === \"some\") {\n            indexedBindingOf(paged)?.askAgain();\n            continue;\n        }\n        const source = pagedSourceOf(paged);\n        if (source !== undefined) defaultPagedRuntime.askAgain(source);\n    }\n}\n\n/**\n * How the rail's picks weigh one kind's details, as one read found them\n * (#1522): the picks, and each drawn row's picked entries.\n */\ninterface WeighedRead {\n    /** The picks, as `.east` literals of the Dict's keys: none, and every read draws the row's own. */\n    readonly picks: readonly string[];\n    /** Each drawn row's picked entries' bytes, by key: a row holding none of the picks absent. */\n    readonly entries: ReadonlyMap<string, readonly Uint8Array[]>;\n    /** Whether the rail's source narrows another record than the details read: its picks then weigh nothing. */\n    readonly apart: boolean;\n}\n\n/** One kind's details as one read found them: each drawn key's row as bytes once landed, `undefined` while in flight; or why it failed. */\ninterface KindRead {\n    readonly rows: FlowchartDetailBytes | undefined;\n    readonly error: string | undefined;\n    /** Weighed by the rail's picks (#1522); `undefined` for details none weighs. */\n    readonly weighed?: WeighedRead | undefined;\n}\n\n/** A read in flight. */\nconst IN_FLIGHT: KindRead = { rows: undefined, error: undefined };\n\n/** No row asked of: a kind with nothing drawn. */\nconst NO_BYTES: FlowchartDetailBytes = new Map<string, Uint8Array | null>();\n\n/** No picked entries. */\nconst NO_ENTRIES: ReadonlyMap<string, readonly Uint8Array[]> = new Map<string, readonly Uint8Array[]>();\n\n/** A narrowing without one field's choice: the source's other fields', which narrow the details' rows (#1522). */\nfunction withoutField(where: ValueTypeOf<RecordSliceWhereType>, field: string): ValueTypeOf<RecordSliceWhereType> {\n    return new SortedMap<string, ValueTypeOf<RecordSliceChoiceType>>([...where].filter(([at]) => !sameString(at, field)), compareKey);\n}\n\n/**\n * One kind's details weighed by the rail's picks (#1522, R44, R45): the picks\n * read from the source's part as they stand, so a pick reads again; the rows\n * and their picked entries read by key; and a row the source's other fields\n * leave out read as a row there is none of (R33). A source over another\n * record than the details' weighs nothing.\n *\n * @param kind - The kind\n * @param weighed - How the picks weigh its details\n * @param keys - The keys of its rows drawn\n * @param weighedRows - How weighed details are read by key\n * @returns The rows' bytes and their picked entries, in flight, or why the read failed\n */\nfunction readWeighed(kind: FlowchartDetailsKind, weighed: FlowchartWeighedValue, keys: readonly string[], weighedRows: FlowchartWeighedRows): KindRead {\n    const paged = getSomeorUndefined(kind.details.paged);\n    if (paged === undefined) throw new Error(\"The details the rail's picks weigh name no paged read\");\n    const keyed = kind.keys ?? STRING_KEYS;\n    const part = kind.weighing;\n    const where = part?.read().where;\n    // Two bindings of different records of one type: the source's picks are of another record's rows.\n    const recordId = indexedBindingOf(paged)?.recordId;\n    const apart = part !== undefined && recordId !== undefined && !sameString(part.sourceId, recordId);\n    const choice = apart ? undefined : where?.get(weighed.field);\n    const picks = choice?.type === \"values\" ? choice.value : [];\n    if (keys.length === 0) return { rows: NO_BYTES, error: undefined, weighed: { picks, entries: NO_ENTRIES, apart } };\n    // In flight, the picks asked: picks that moved draw the reads they weigh as placeholders until their ranges land (R44).\n    const flight: KindRead = { rows: undefined, error: undefined, weighed: { picks, entries: NO_ENTRIES, apart } };\n    const got = weighedRows(paged, weighed, picks, keys, keyed);\n    if (got.type === \"none\") return flight;\n    let rows = got.value.rows;\n    const others = apart || where === undefined || part === undefined ? undefined : withoutField(where, weighed.field);\n    if (others !== undefined && others.size > 0) {\n        // The source's other fields narrow the details' rows: each drawn row asked of them, at its key, in one read.\n        const asked = keys.flatMap((key) => {\n            const row = got.value.lean.get(key);\n            return row === undefined ? [] : [{ key, row }];\n        });\n        const within = asked.length === 0 ? some([] as boolean[])\n            : recordSliceWithin(part!, others, asked.map(({ key, row }) => ({ key: keyed.keyOf(key), row })));\n        if (within.type === \"none\") return flight;\n        const kept = new Map(rows);\n        asked.forEach(({ key }, i) => {\n            if (within.value[i] !== true) kept.set(key, null);\n        });\n        rows = kept;\n    }\n    return { rows, error: undefined, weighed: { picks, entries: got.value.entries, apart } };\n}\n\n/**\n * One kind's details, read as the kind is (R19): whole — every drawn key\n * matched to the record's rows — or by the drawn keys, in one request; or,\n * weighed by the rail's picks, by key whatever the kind's read (#1522).\n *\n * @param kind - The kind\n * @param keys - The keys of its rows drawn\n * @param paged - How a paged read answers keys\n * @param weighedRows - How weighed details are read by key\n * @returns The rows' bytes, in flight, or why the read failed\n */\nfunction readKind(kind: FlowchartDetailsKind, keys: readonly string[], paged: FlowchartPagedRows, weighedRows: FlowchartWeighedRows): KindRead {\n    const details = kind.details;\n    try {\n        const weighed = getSomeorUndefined(details.weighed);\n        if (weighed !== undefined) return readWeighed(kind, weighed, keys, weighedRows);\n        const whole = getSomeorUndefined(details.rows);\n        if (whole !== undefined) {\n            const got = whole();\n            if (got.type === \"none\") return IN_FLIGHT;\n            const rows = new Map<string, Uint8Array | null>();\n            for (const key of keys) rows.set(key, got.value.get(key) ?? null);\n            return { rows, error: undefined };\n        }\n        const id = getSomeorUndefined(details.paged);\n        if (keys.length === 0) return { rows: NO_BYTES, error: undefined };\n        if (id === undefined) return { rows: new Map(keys.map((key) => [key, null] as const)), error: undefined };\n        const got = paged(id, keys, kind.keys ?? STRING_KEYS);\n        return got.type === \"none\" ? IN_FLIGHT : { rows: got.value, error: undefined };\n    } catch (error) {\n        return { rows: undefined, error: messageOf(error) };\n    }\n}\n\n/**\n * How the rail's picks weigh one kind's details (#1522): the picks as they\n * stand, and the rows holding them as the last settled read found them.\n */\nexport interface FlowchartWeighedRead {\n    /** The picks, as `.east` literals of the Dict's keys: none, and every read draws the row's own. */\n    readonly picks: readonly string[];\n    /** The drawn rows holding a pick, as the last settled read found them: a row holding none says *no data* in the reads the picks weigh. */\n    readonly holding: ReadonlySet<string>;\n    /** Whether the rail's source narrows another record than the details read: Issues lists it, and every read draws the row's own. */\n    readonly apart: boolean;\n    /** Whether the picks moved since the last settled read and their ranges are in flight: the reads they weigh draw their placeholder (R44). */\n    readonly pending: boolean;\n}\n\n/** What the details read holds of one kind. */\nexport interface FlowchartDetailsRead {\n    /**\n     * Each drawn row's values the last settled read holds, by key — `null` for a key the details hold no row of, which\n     * draws *no data* (R33). A key no settled read asked of is absent: its card draws a placeholder (R34).\n     */\n    readonly rows: ReadonlyMap<string, FlowchartDetailRowValue | null>;\n    /** Whether a read is in flight, the last settled one standing in meanwhile. */\n    readonly reading: boolean;\n    /** Why the latest read failed, said once in the canvas's box (R34); what the last settled read held stands. */\n    readonly error: string | undefined;\n    /** How the rail's picks weigh them, as the last settled read found it (#1522); `undefined` for details none weighs. */\n    readonly weighed?: FlowchartWeighedRead | undefined;\n}\n\n/** What the details read holds, by kind: `undefined` for a kind with no details. */\nexport interface FlowchartDetailsData {\n    /** The states' details. */\n    readonly states: FlowchartDetailsRead | undefined;\n    /** The transitions' details. */\n    readonly transitions: FlowchartDetailsRead | undefined;\n}\n\n/** The frame's details before the reader first reports: every kind's in flight. */\nexport const NO_DETAILS: FlowchartDetailsData = { states: undefined, transitions: undefined };\n\n/** No row held. */\nconst NO_ROWS: ReadonlyMap<string, never> = new Map<string, never>();\n\n/** Two reasons the same, or both none. */\nfunction sameError(a: string | undefined, b: string | undefined): boolean {\n    return a === undefined || b === undefined ? a === b : sameString(a, b);\n}\n\n/** A kind's rows' values as they were, where every key holds the same as it did. */\nfunction steadyRows(\n    was: ReadonlyMap<string, FlowchartDetailRowValue | null>,\n    now: ReadonlyMap<string, FlowchartDetailRowValue | null>,\n): ReadonlyMap<string, FlowchartDetailRowValue | null> {\n    if (was.size !== now.size) return now;\n    for (const [key, row] of now) {\n        if (!was.has(key) || !Object.is(was.get(key), row)) return now;\n    }\n    return was;\n}\n\n/** Two lists of entries' bytes the same, entry by entry. */\nfunction sameEntries(a: readonly Uint8Array[], b: readonly Uint8Array[]): boolean {\n    return a.length === b.length && a.every((bytes, i) => sameBytes(bytes, b[i]!));\n}\n\n/** Two lists of picks the same, pick by pick. */\nfunction samePicks(a: readonly string[], b: readonly string[]): boolean {\n    return a.length === b.length && a.every((pick, i) => sameString(pick, b[i]!));\n}\n\n/** The same weighing as before, where nothing in it moved. */\nfunction steadyWeighed(was: FlowchartWeighedRead | undefined, now: FlowchartWeighedRead): FlowchartWeighedRead {\n    if (was === undefined || was.apart !== now.apart || was.pending !== now.pending || !samePicks(was.picks, now.picks) || was.holding.size !== now.holding.size) return now;\n    for (const key of now.holding) if (!was.holding.has(key)) return now;\n    return was;\n}\n\n/** Whether a read in flight asks other picks than the last settled read weighed by — or picks of a record it now reads apart from. */\nfunction picksMoved(asked: WeighedRead | undefined, settled: FlowchartWeighedRead | undefined): boolean {\n    return asked !== undefined && settled !== undefined && (asked.apart !== settled.apart || !samePicks(asked.picks, settled.picks));\n}\n\n/** No entries a row holds: its row's own values. */\nconst OWN: readonly Uint8Array[] = [];\n\n/**\n * One kind's details across reads: each row's values worked out once for its\n * bytes — and, weighed, its picked entries' — the last settled rows standing\n * while a newer read is in flight or fails, and the same objects while nothing\n * moves.\n */\nclass KindDetails {\n    /** The `values` the rows were worked out by: another payload's works them out afresh. */\n    private by: FlowchartDetailsValue[\"values\"] | undefined;\n    /** Each row's values, by key, beside the bytes and the picked entries they came from. */\n    private worked = new Map<string, { readonly bytes: Uint8Array; readonly entries: readonly Uint8Array[]; readonly row: FlowchartDetailRowValue }>();\n    /** The read last taken, and what came of it: the same read taken again moves nothing. */\n    private taken: {\n        readonly read: KindRead; readonly rows: ReadonlyMap<string, FlowchartDetailRowValue | null>; readonly error: string | undefined;\n        readonly weighed: FlowchartWeighedRead | undefined;\n    } | undefined;\n    /** The rows the last settled read held. */\n    private settled: ReadonlyMap<string, FlowchartDetailRowValue | null> = NO_ROWS;\n    /** How the picks weighed them, as the last settled read found it. */\n    private settledWeighed: FlowchartWeighedRead | undefined;\n    /** The picks in flight, as last handed out: the same picks in flight hand out the same object. */\n    private pendingWeighed: FlowchartWeighedRead | undefined;\n    /** What was handed out last. */\n    private last: FlowchartDetailsRead | undefined;\n\n    /**\n     * Takes one read.\n     *\n     * @param details - The kind's details\n     * @param read - What the read found\n     * @returns What the kind's details hold now\n     */\n    take(details: FlowchartDetailsValue, read: KindRead): FlowchartDetailsRead {\n        if (!Object.is(this.by, details.values)) {\n            this.by = details.values;\n            this.worked = new Map();\n            this.taken = undefined;\n        }\n        const fold = getSomeorUndefined(details.weighed)?.fold;\n        let rows = this.settled;\n        let weighed = this.settledWeighed;\n        let error = read.error;\n        if (this.taken !== undefined && Object.is(this.taken.read, read)) {\n            rows = this.taken.rows;\n            error = this.taken.error;\n            weighed = this.taken.weighed;\n        } else if (read.rows !== undefined) {\n            try {\n                const next = new Map<string, FlowchartDetailRowValue | null>();\n                const worked = new Map<string, { readonly bytes: Uint8Array; readonly entries: readonly Uint8Array[]; readonly row: FlowchartDetailRowValue }>();\n                const holding = new Set<string>();\n                const picked = read.weighed !== undefined && read.weighed.picks.length > 0 && !read.weighed.apart;\n                for (const [key, bytes] of read.rows) {\n                    if (bytes === null) {\n                        next.set(key, null);\n                        continue;\n                    }\n                    // Weighed by the picks, a row holding some draws them added up; one holding none, its own (R45).\n                    const entries = picked ? read.weighed!.entries.get(key) ?? OWN : OWN;\n                    if (entries.length > 0) holding.add(key);\n                    const held = this.worked.get(key);\n                    const row = held !== undefined && sameBytes(held.bytes, bytes) && sameEntries(held.entries, entries) ? held.row\n                        : entries.length > 0 && fold !== undefined ? fold(bytes, [...entries]) : details.values(bytes);\n                    worked.set(key, { bytes, entries, row });\n                    next.set(key, row);\n                }\n                this.worked = worked;\n                rows = this.settled = steadyRows(this.settled, next);\n                weighed = this.settledWeighed = read.weighed === undefined ? undefined\n                    : steadyWeighed(this.settledWeighed, { picks: read.weighed.picks, holding, apart: read.weighed.apart, pending: false });\n            } catch (failure) {\n                error = messageOf(failure);\n            }\n            this.taken = { read, rows, error, weighed };\n        }\n        const reading = read.rows === undefined && read.error === undefined;\n        // Picks that moved, in flight: the reads they weigh wait for their ranges, the rows they hold as last settled.\n        if (reading && picksMoved(read.weighed, weighed)) {\n            weighed = this.pendingWeighed = steadyWeighed(this.pendingWeighed, { picks: read.weighed!.picks, holding: weighed!.holding, apart: read.weighed!.apart, pending: true });\n        }\n        const last = this.last;\n        if (last !== undefined && Object.is(last.rows, rows) && last.reading === reading && sameError(last.error, error) && Object.is(last.weighed, weighed)) {\n            return last;\n        }\n        this.last = weighed === undefined ? { rows, reading, error } : { rows, reading, error, weighed };\n        return this.last;\n    }\n}\n\n/**\n * Reads the details (see the module docs): each kind's beside its kind, by the\n * rows drawn.\n *\n * @param kinds - The kinds carrying details\n * @param drawn - The keys of the rows drawn\n * @param attempt - Moves to read every kind afresh: a Retry\n * @param paged - How a paged read answers keys: `pagedDetailRows`, unless a test gives its own\n * @param weighedRows - How weighed details are read by key: `weighedDetailRows`, unless a test gives its own\n * @returns What the details read holds\n */\nexport function useFlowchartDetails(\n    kinds: FlowchartDetailsKinds, drawn: FlowchartDrawnKeys, attempt = 0, paged: FlowchartPagedRows = pagedDetailRows,\n    weighedRows: FlowchartWeighedRows = weighedDetailRows,\n): FlowchartDetailsData {\n    const states = kinds.states;\n    const transitions = kinds.transitions;\n    const read = useCallback(() => {\n        // A Retry reads every kind again.\n        void attempt;\n        return {\n            states: states === undefined ? undefined : readKind(states, drawn.states, paged, weighedRows),\n            transitions: transitions === undefined ? undefined : readKind(transitions, drawn.transitions, paged, weighedRows),\n        };\n    }, [states, transitions, drawn, paged, weighedRows, attempt]);\n    const { result } = useTrackedEvaluation(read);\n    const holders = useRef<{ readonly states: KindDetails; readonly transitions: KindDetails } | undefined>(undefined);\n    holders.current ??= { states: new KindDetails(), transitions: new KindDetails() };\n    const held = holders.current;\n    const failed: KindRead | undefined = result.ok ? undefined : { rows: undefined, error: messageOf(result.error) };\n    const statesRead = states === undefined ? undefined\n        : held.states.take(states.details, failed ?? (result.ok ? result.value.states : undefined) ?? IN_FLIGHT);\n    const transitionsRead = transitions === undefined ? undefined\n        : held.transitions.take(transitions.details, failed ?? (result.ok ? result.value.transitions : undefined) ?? IN_FLIGHT);\n    return useMemo((): FlowchartDetailsData => ({ states: statesRead, transitions: transitionsRead }), [statesRead, transitionsRead]);\n}\n\n/**\n * The details' reads, in a component of their own, as the records' are\n * (`read.ts`): each read that lands renders it again alone, and it hands the\n * frame what it read only when that moves.\n *\n * @param props - The kinds carrying details, the keys of the rows drawn, the read's attempt, and where the details go\n * @returns Nothing: it reads\n */\nexport function FlowchartDetailsReader({ kinds, drawn, attempt, onDetails }: {\n    kinds: FlowchartDetailsKinds; drawn: FlowchartDrawnKeys; attempt: number; onDetails: (details: FlowchartDetailsData) => void;\n}): null {\n    const details = useFlowchartDetails(kinds, drawn, attempt);\n    const reported = useRef<FlowchartDetailsData | undefined>(undefined);\n    useEffect(() => {\n        if (Object.is(reported.current, details)) return;\n        reported.current = details;\n        onDetails(details);\n    });\n    return null;\n}\n\n// ============================================================================\n// The flowchart's bins\n// ============================================================================\n\n/** A histogram read's bins, shared by every card that draws it (R26). */\nexport interface FlowchartBins {\n    /**\n     * Its edges, ascending and finite: the app's, else every drawn row's edges merged — none while no row counts\n     * anything. Each bin reaches from its edge to the next; the last is open.\n     */\n    readonly edges: readonly number[];\n    /** How its bars space them. */\n    readonly scale: \"band\" | \"linear\";\n}\n\n/** A histogram's counts in the flowchart's bins (R27). */\nexport interface FlowchartBinCounts {\n    /** Each bin's count, in the bins' order. */\n    readonly counts: readonly number[];\n    /** What they count, together. */\n    readonly total: number;\n    /** Whether a count fell in no bin: one at no edge, or one that is no count — negative, or not finite. */\n    readonly unheld: boolean;\n}\n\n/** Why the bins the app binds are refused (R27), as found. */\nexport type FlowchartBinsRefusal =\n    | { readonly why: \"empty\" }\n    | { readonly why: \"number\"; readonly edge: number }\n    | { readonly why: \"order\"; readonly before: number; readonly after: number };\n\n/** Why, in the app's locale: what Issues says. */\nexport type FlowchartBinsRefusalWord =\n    | { readonly why: \"empty\" }\n    | { readonly why: \"number\"; readonly edge: string }\n    | { readonly why: \"order\"; readonly before: string; readonly after: string };\n\n/**\n * The bins the app binds, checked as they land (R27) — as a literal's are\n * when built.\n *\n * @param edges - The edges\n * @returns Why they are refused — none given, an edge that is no finite number, or the first two that do not ascend; `undefined` for none\n */\nexport function binsRefusal(edges: readonly number[]): FlowchartBinsRefusal | undefined {\n    if (edges.length === 0) return { why: \"empty\" };\n    for (const edge of edges) if (!Number.isFinite(edge)) return { why: \"number\", edge };\n    for (let i = 1; i < edges.length; i++) {\n        if (!lessFloat(edges[i - 1]!, edges[i]!)) return { why: \"order\", before: edges[i - 1]!, after: edges[i]! };\n    }\n    return undefined;\n}\n\n/**\n * The bin that holds a duration (R27): the last whose edge it is at or past —\n * one under the first edge in the first.\n *\n * @param edges - The bins' edges, ascending\n * @param at - The duration, a number\n * @returns The bin's place\n */\nfunction binOf(edges: readonly number[], at: number): number {\n    let lo = 0;\n    let hi = edges.length - 1;\n    while (lo < hi) {\n        const mid = (lo + hi + 1) >> 1;\n        if (lessFloat(at, edges[mid]!)) hi = mid - 1;\n        else lo = mid;\n    }\n    return lo;\n}\n\n/**\n * A row's histogram counted into the flowchart's bins (R27): each count in the\n * bin that holds its edge, one under the first edge in the first — an Array's\n * each at its own bin's edge, so a bin each.\n *\n * @param value - The row's histogram: its counts, each at an edge\n * @param edges - The flowchart's bins' edges, ascending\n * @returns Each bin's count, their total, and whether a count fell in no bin\n */\nexport function countIntoBins(value: HistogramValue, edges: readonly number[]): FlowchartBinCounts {\n    const counts = edges.map(() => 0);\n    let total = 0;\n    let unheld = false;\n    for (const bin of value) {\n        // At no edge — NaN, an Array of another length than its bins — or no count: no bin holds it.\n        if (edges.length === 0 || Number.isNaN(bin.from) || !Number.isFinite(bin.count) || lessFloat(bin.count, 0)) {\n            unheld = true;\n            continue;\n        }\n        const at = binOf(edges, bin.from);\n        counts[at] = counts[at]! + bin.count;\n        total += bin.count;\n    }\n    return { counts, total, unheld };\n}\n\n/**\n * The edges of every drawn row's histogram at a read, merged (R26): the bins\n * the rows share where the app gives none.\n *\n * @param keys - The rows drawn\n * @param rows - Their values\n * @param index - The read's place\n * @param skipOf - Which of a row's reads count nothing: those saying *no data*, where the rail's picks weigh a row holding none of them,\n *   and those waiting on picks that moved (#1522)\n * @returns The finite edges, ascending, each once\n */\nfunction mergedEdges(\n    keys: readonly string[], rows: ReadonlyMap<string, FlowchartDetailRowValue | null>, index: number, skipOf: (key: string) => readonly boolean[],\n): number[] {\n    const edges = new SortedSet<number>([], compareFloat);\n    for (const key of keys) {\n        if (skipOf(key)[index] === true) continue;\n        const value = rows.get(key)?.[index];\n        if (value?.type !== \"histogram\") continue;\n        for (const bin of value.value) if (Number.isFinite(bin.from)) edges.add(bin.from);\n    }\n    return [...edges];\n}\n\n// ============================================================================\n// Bars and the axis\n// ============================================================================\n\n/** One bar, across its axis: where it starts and ends, and how tall it is — each a share of the axis and of the card's tallest bar. */\nexport interface FlowchartBar {\n    /** Where it starts, from 0 at the axis's start to 1 at its end. */\n    readonly from: number;\n    /** Where it ends. */\n    readonly to: number;\n    /** How tall it is, the card's tallest 1. */\n    readonly height: number;\n    /** What it counts. */\n    readonly count: number;\n}\n\n/**\n * Each bin's span as a linear axis draws it: to the next edge, the open last as\n * wide as the one before it — one bin alone the whole axis.\n */\nfunction spansOf(edges: readonly number[]): number[] {\n    const n = edges.length;\n    return edges.map((edge, i) => (i < n - 1 ? edges[i + 1]! - edge : n > 1 ? edge - edges[n - 2]! : 1));\n}\n\n/**\n * A card's bars over the flowchart's bins (R26): on a band axis a bar a bin,\n * equal widths, as tall as its count; on a linear axis each as wide as its span\n * and as tall as its count over it, so its area is its count, the open last\n * bin as wide as the one before it. Scaled to the card's tallest.\n *\n * @param bins - The flowchart's bins\n * @param counts - The card's count in each\n * @returns Each bin's bar, in order\n */\nexport function barsOf(bins: FlowchartBins, counts: readonly number[]): FlowchartBar[] {\n    const n = bins.edges.length;\n    if (n === 0) return [];\n    const spans = spansOf(bins.edges);\n    const extent = spans.reduce((sum, span) => sum + span, 0);\n    const linear = bins.scale === \"linear\";\n    const heights = counts.map((count, i) => (linear ? count / spans[i]! : count));\n    const tallest = heights.reduce((max, h) => Math.max(max, h), 0);\n    let at = 0;\n    return counts.map((count, i) => {\n        const width = linear ? spans[i]! / extent : 1 / n;\n        const from = linear ? at : i / n;\n        at += width;\n        return { from, to: from + width, height: tallest > 0 ? heights[i]! / tallest : 0, count };\n    });\n}\n\n/**\n * Where a duration sits across the axis (R26, R28): on a band axis, as far\n * across its bin as it is across its span — the open last bin as wide as the\n * one before it; on a linear axis, to scale. Under the first edge, the axis's\n * start; past the end, the end.\n *\n * @param bins - The flowchart's bins\n * @param at - The duration\n * @returns Its place, from 0 at the axis's start to 1 at its end\n */\nexport function axisAt(bins: FlowchartBins, at: number): number {\n    const { edges } = bins;\n    const n = edges.length;\n    if (n === 0 || Number.isNaN(at) || lessFloat(at, edges[0]!)) return 0;\n    const spans = spansOf(edges);\n    if (bins.scale === \"linear\") {\n        const extent = spans.reduce((sum, span) => sum + span, 0);\n        return Math.min(1, (at - edges[0]!) / extent);\n    }\n    const bin = binOf(edges, at);\n    return Math.min(1, (bin + Math.min(1, (at - edges[bin]!) / spans[bin]!)) / n);\n}\n\n// ============================================================================\n// The details model\n// ============================================================================\n\n/** One row's details: its values, one a read, and each histogram's counts in the flowchart's bins. */\nexport interface FlowchartRowDetails {\n    /** Its values, one a read, in the reads' order. */\n    readonly values: FlowchartDetailRowValue;\n    /** Each read's counts, by its place: a histogram's in its bins; `undefined` where its bins are refused, and for every other read. */\n    readonly counts: readonly (FlowchartBinCounts | undefined)[];\n    /** Whether each read says *no data*, by its place: one the rail's picks weigh, of a row holding none of them (#1522, R45). */\n    readonly noData: readonly boolean[];\n    /** Whether each read draws its placeholder, by its place: one the rail's picks weigh, while the ranges of picks that moved are in flight (#1522, R44). */\n    readonly pending: readonly boolean[];\n}\n\n/**\n * A row's value at a read, as the canvas, a label and the inspector draw it:\n * `undefined` where it says *no data* — a read the rail's picks weigh, of a\n * row holding none of them (#1522, R45) — and where it waits on picks that\n * moved (R44).\n *\n * @param row - The row's details\n * @param index - The read's place\n * @returns Its value; `undefined` for *no data*, and while it waits\n */\nexport function valueAt(row: FlowchartRowDetails | undefined, index: number): FlowchartDetailRowValue[number] | undefined {\n    return row === undefined || row.noData[index] === true || row.pending[index] === true ? undefined : row.values[index];\n}\n\n/**\n * Whether a row's read draws its placeholder: its row not landed (R34), or a\n * read the rail's picks weigh while the ranges of picks that moved are in\n * flight (#1522, R44).\n *\n * @param row - The row's details; `undefined` while it lands\n * @param index - The read's place\n * @returns Whether it waits\n */\nexport function waitsAt(row: FlowchartRowDetails | undefined, index: number): boolean {\n    return row === undefined || row.pending[index] === true;\n}\n\n/** The line the inspector names the rail's picks in (#1522, R46): the field, as the rail names it, and the picks. */\nexport interface FlowchartWeighedLine {\n    /** The field, as the rail labels it — `Service`. */\n    readonly label: string;\n    /** The picks, as the rail names them — `Standard, Priority`. */\n    readonly picks: string;\n}\n\n/** One kind's details, as the canvas, the inspector and Issues draw them. */\nexport interface FlowchartKindDetails {\n    /** Its reads, in the details' order: each described, and where it shows. */\n    readonly reads: FlowchartDetailsValue[\"reads\"];\n    /** Whether a read shows on the canvas: a state's card is then 272 wide, its reads under its head (R22). */\n    readonly onCanvas: boolean;\n    /** Each read's bins, by its place: a histogram's; `undefined` for one whose bins the app binds are refused, and for every other read. */\n    readonly bins: readonly (FlowchartBins | undefined)[];\n    /** Each drawn row's details, by key: `null` for a key the details hold no row of; a key absent has not landed. */\n    readonly rows: ReadonlyMap<string, FlowchartRowDetails | null>;\n    /** Whether a read is in flight. */\n    readonly reading: boolean;\n    /** Why the latest read failed. */\n    readonly error: string | undefined;\n    /** The rail's picks that weigh them, as the inspector names them (#1522, R46); `undefined` with no pick, and for details none weighs. */\n    readonly weighedBy: FlowchartWeighedLine | undefined;\n}\n\n/** What Issues lists of the details (R38). */\nexport type FlowchartDetailsFinding =\n    /** A row's histogram holding counts no bin holds, by the row's kind and key and the read's label. */\n    | { readonly finding: \"counts\"; readonly sort: FlowchartDetailsSort; readonly key: string; readonly read: string }\n    /** A histogram's bins, as the app binds them, refused: by the kind's name and the read's label, and why. */\n    | { readonly finding: \"bins\"; readonly sort: FlowchartDetailsSort; readonly kind: string; readonly read: string; readonly refusal: FlowchartBinsRefusalWord }\n    /** The rail's source whose picks weigh a kind's details narrowing another record than they read (#1522): by the kind's name and the source. */\n    | { readonly finding: \"weighed\"; readonly sort: FlowchartDetailsSort; readonly kind: string; readonly source: string };\n\n/** The details model: each kind's, and what Issues lists. */\nexport interface FlowchartDetailsModel {\n    /** The states' details; `undefined` for states with none. */\n    readonly states: FlowchartKindDetails | undefined;\n    /** The transitions' details. */\n    readonly transitions: FlowchartKindDetails | undefined;\n    /** What Issues lists: each kind's refused bins, in the reads' order, then its rows' counts no bin holds, in key order. */\n    readonly findings: readonly FlowchartDetailsFinding[];\n}\n\n/** A read's label. */\nfunction labelOf(read: FlowchartReadValue): string {\n    return read.value.label;\n}\n\n/**\n * The line naming the rail's picks (#1522, R46): the field as the rail labels\n * it, and the picks as the rail names them — the field's own name where the\n * source offers no such field.\n *\n * @param part - The source's part of the rail\n * @param field - The Dict field the entries index files\n * @param picks - The picks, as `.east` literals of its keys\n * @param words - The app's formatters\n * @returns The line\n */\nfunction weighedLineOf(part: FlowchartSlicePart | undefined, field: string, picks: readonly string[], words: Formatters): FlowchartWeighedLine {\n    const offered = part?.config.fields.find((candidate) => sameString(candidate.fieldId, field));\n    if (offered === undefined) return { label: field, picks: picks.join(\", \") };\n    return { label: offered.label, picks: recordChoiceSummary(offered, variant(\"values\", [...picks]), words) };\n}\n\n/** Why the bins are refused, its numbers in the app's locale. */\nfunction refusalWord(refusal: FlowchartBinsRefusal, words: Formatters): FlowchartBinsRefusalWord {\n    switch (refusal.why) {\n        case \"empty\": return refusal;\n        case \"number\": return { why: \"number\", edge: words.number(refusal.edge) };\n        case \"order\": return { why: \"order\", before: words.number(refusal.before), after: words.number(refusal.after) };\n    }\n}\n\n/**\n * The details model (see the module docs): each kind's reads, its\n * histograms' bins, each drawn row's values counted into them, and what Issues\n * lists. Pure.\n *\n * @param kinds - The kinds carrying details\n * @param data - What the details read holds\n * @param drawn - The keys of the rows drawn\n * @param words - The formatters: Issues' numbers in the app's locale\n * @returns The model\n */\nexport function flowchartDetailsModel(kinds: FlowchartDetailsKinds, data: FlowchartDetailsData, drawn: FlowchartDrawnKeys, words: Formatters): FlowchartDetailsModel {\n    const findings: FlowchartDetailsFinding[] = [];\n    const kind = (sort: FlowchartDetailsSort, given: FlowchartDetailsKind | undefined, read: FlowchartDetailsRead | undefined): FlowchartKindDetails | undefined => {\n        if (given === undefined) return undefined;\n        const { name, details } = given;\n        const keys = sort === \"states\" ? drawn.states : drawn.transitions;\n        const held = read?.rows ?? NO_ROWS;\n        const reads = details.reads;\n        // Weighed by the rail's picks (#1522): a row holding none says no data in the reads the picks weigh.\n        const weighed = getSomeorUndefined(details.weighed);\n        const picked = read?.weighed;\n        if (weighed !== undefined && picked?.apart === true) findings.push({ finding: \"weighed\", sort, kind: name, source: weighed.source });\n        const weighing = weighed !== undefined && picked !== undefined && picked.picks.length > 0 && !picked.apart;\n        const pending = weighed !== undefined && picked?.pending === true ? weighed.reads : undefined;\n        const own = reads.map(() => false);\n        // Picks in flight: the reads they weigh wait, whatever the rows held of the picks before.\n        const noDataOf = (key: string): readonly boolean[] => (weighing && pending === undefined && !picked!.holding.has(key) ? weighed!.reads : own);\n        const skipOf = (key: string): readonly boolean[] => pending ?? noDataOf(key);\n        const bins = reads.map((entry, i): FlowchartBins | undefined => {\n            if (entry.read.type !== \"histogram\") return undefined;\n            const histogram = entry.read.value;\n            const given = getSomeorUndefined(histogram.bins);\n            if (given === undefined) return { edges: mergedEdges(keys, held, i, skipOf), scale: histogram.scale.type };\n            const refusal = binsRefusal(given);\n            if (refusal === undefined) return { edges: given, scale: histogram.scale.type };\n            findings.push({ finding: \"bins\", sort, kind: name, read: histogram.label, refusal: refusalWord(refusal, words) });\n            return undefined;\n        });\n        const rows = new Map<string, FlowchartRowDetails | null>();\n        for (const key of keys) {\n            const row = held.get(key);\n            if (row === undefined) continue;\n            if (row === null) {\n                rows.set(key, null);\n                continue;\n            }\n            const noData = noDataOf(key);\n            const skip = skipOf(key);\n            const counts = reads.map((_entry, i) => {\n                const edges = bins[i]?.edges;\n                const at = skip[i] === true ? undefined : row[i];\n                return edges === undefined || at?.type !== \"histogram\" ? undefined : countIntoBins(at.value, edges);\n            });\n            reads.forEach((entry, i) => {\n                if (counts[i]?.unheld === true) findings.push({ finding: \"counts\", sort, key, read: labelOf(entry.read) });\n            });\n            rows.set(key, { values: row, counts, noData, pending: pending ?? own });\n        }\n        return {\n            reads, onCanvas: reads.some((entry) => entry.show.type !== \"inspector\"), bins, rows,\n            reading: read === undefined || read.reading, error: read?.error,\n            weighedBy: weighing ? weighedLineOf(given.weighing, weighed!.field, picked!.picks, words) : undefined,\n        };\n    };\n    const states = kind(\"states\", kinds.states, data.states);\n    const transitions = kind(\"transitions\", kinds.transitions, data.transitions);\n    return { states, transitions, findings };\n}\n\n// ============================================================================\n// Each card's size\n// ============================================================================\n\n/** A card's width where its details draw on it (R22): 116 without. */\nexport const DETAILS_CARD_W = 272;\n\n/** The card's edge, top and bottom. */\nconst CARD_EDGE = 1;\n/** The card's head inside its edge — the label over the key 4 apart, 12 in from either side: 56 with its edges, the visual spec's. */\nconst CARD_HEAD = 54;\n/** The rule under the head. */\nconst CARD_RULE = 1;\n/** The body's padding, on every side. */\nconst CARD_PAD = 12;\n/** Between two reads. */\nconst READ_GAP = 12;\n/** What the reads draw across: the card inside its edges and its padding — a card's bars and their axis span it. */\nexport const DETAILS_INNER_W = DETAILS_CARD_W - 2 * CARD_EDGE - 2 * CARD_PAD;\n/** The card's head with its top edge and the rule under it: where an editor renaming the state sits. */\nexport const DETAILS_HEAD_H = CARD_EDGE + CARD_HEAD + CARD_RULE;\n/** A figure's line — and *no data* in its place. */\nconst FIGURE_H = 16;\n/** A line of tags — and *no data* or *none* in its place. */\nconst TAG_H = 15;\n/** Between two lines of tags, and between two tags. */\nconst TAG_GAP = 4;\n/** A tag list's lines at most: then +n. */\nconst TAG_LINES = 3;\n/** Between a tag list's label column and its tags. */\nconst TAG_LABEL_GAP = 8;\n/** A read's title, over its bars or its list. */\nconst TITLE_H = 14;\n/** Between a title and what it is over, between the bars and their axis, and between a list's rows. */\nconst BLOCK_GAP = 4;\n/** The bars on a card. */\nconst BARS_H = 28;\n/** Their axis. */\nconst AXIS_H = 12;\n/** A list's row. */\nconst LIST_ROW_H = 16;\n/** *No data* or *none* under a title. */\nconst NO_DATA_H = 16;\n\n/** How wide a card's words draw, in px: a read's label in a tag list's label column, and a tag — its padding and rule in. */\nexport interface FlowchartTextMeasure {\n    /** A read's label, as the label column draws it. */\n    readonly label: (text: string) => number;\n    /** A tag, as a card draws it — and the +n that ends a list cut short. */\n    readonly tag: (text: string) => number;\n}\n\n/** A label's width a character, the visual spec's: mono 9.5, 600, 0.14em apart, in capitals. */\nconst LABEL_CHAR = 7.33;\n/** A tag's width a character, the visual spec's: mono 9.5, 500. */\nconst TAG_CHAR = 6;\n/** A tag's padding, 4 either side, and its 1px rule. */\nconst TAG_PAD = 10;\n\n/** The estimate where nothing measures — a test's, or a layout before the card draws: the visual spec's type, a character at a time. */\nexport const ESTIMATED_TEXT: FlowchartTextMeasure = {\n    label: (text) => LABEL_CHAR * [...text].length,\n    tag: (text) => TAG_CHAR * [...text].length + TAG_PAD,\n};\n\n/** One line of a card's list (R29): an item, its share of the list's total, and its note. */\nexport interface FlowchartListLine {\n    /** The item's name. */\n    readonly name: string;\n    /** Its value. */\n    readonly value: number;\n    /** Its share of the list's total, 0 to 1. */\n    readonly share: number;\n    /** Its note, from its draw. */\n    readonly note: string | undefined;\n}\n\n/** What a card draws of one read. */\nexport type FlowchartCardDraws =\n    /** Its row has not landed: a placeholder (R34). */\n    | { readonly kind: \"placeholder\" }\n    /** No row, or nothing to show: *no data* (R33, R41). */\n    | { readonly kind: \"noData\" }\n    /** A figure's value. */\n    | { readonly kind: \"figure\"; readonly value: number }\n    /** A tag list's lines — none: *none* — and the tags past its third, behind +n. */\n    | { readonly kind: \"tags\"; readonly lines: readonly (readonly string[])[]; readonly rest: readonly string[] }\n    /** A histogram's bars. */\n    | { readonly kind: \"bars\"; readonly bars: readonly FlowchartBar[] }\n    /** A list's top lines — none: *none*. */\n    | { readonly kind: \"list\"; readonly lines: readonly FlowchartListLine[] };\n\n/** One read a card shows, in its block. */\nexport interface FlowchartCardRead {\n    /** Its place in the details' order. */\n    readonly index: number;\n    /** Its block's top, from the card's. */\n    readonly top: number;\n    /** Its block's height. */\n    readonly height: number;\n    /** A tag list's label column, the widest label of the tag lists it stands among; `undefined` for any other read. */\n    readonly column: number | undefined;\n    /** What it draws. */\n    readonly draws: FlowchartCardDraws;\n}\n\n/** A state's card where its details draw (R22): its size, and each read it shows in its block. */\nexport interface FlowchartCard {\n    /** Its width. */\n    readonly width: number;\n    /** Its height: its head, a rule, then its reads 12 apart inside 12 of padding. */\n    readonly height: number;\n    /** The reads it shows, in the details' order. */\n    readonly reads: readonly FlowchartCardRead[];\n}\n\n/** A placeholder, while the row lands. */\nconst PLACEHOLDER: FlowchartCardDraws = { kind: \"placeholder\" };\n/** *No data*. */\nconst NO_DATA: FlowchartCardDraws = { kind: \"noData\" };\n\n/**\n * A list's lines on the canvas, as its read gives them (R29): 1 to 3.\n *\n * @param read - The list read\n * @returns How many lines it draws on a card or a label\n */\nexport function listTopOf(read: Extract<FlowchartReadValue, { type: \"list\" }>[\"value\"]): number {\n    return Math.min(3, Math.max(1, Number(read.top)));\n}\n\n/**\n * A list's top lines by value (R29): its items by value, highest first — ties\n * in the row's order — each with its share of the list's total.\n *\n * @param items - The row's items\n * @param top - How many lines\n * @returns The lines\n */\nexport function listLines(items: ListValue, top: number): FlowchartListLine[] {\n    const counts = (n: number): boolean => Number.isFinite(n) && !lessFloat(n, 0);\n    const total = items.reduce((sum, item) => sum + (counts(item.value) ? item.value : 0), 0);\n    return [...items].sort((a, b) => compareFloat(b.value, a.value)).slice(0, top).map((item) => ({\n        name: item.name, value: item.value, share: total > 0 && counts(item.value) ? item.value / total : 0, note: getSomeorUndefined(item.note),\n    }));\n}\n\n/**\n * A row's tags in the order their looks are defined, then the rest in the\n * row's order (R30): each once — as a card, the inspector and the legend show\n * them.\n *\n * @param colors - The read's looks\n * @param tags - The row's tags\n * @returns The tags, in that order\n */\nexport function orderedTags(colors: FlowchartTagColors, tags: readonly string[]): string[] {\n    const held = new SortedSet<string>(tags, compareKey);\n    const placed = new SortedSet<string>([], compareKey);\n    const out: string[] = [];\n    const place = (tag: string) => {\n        if (placed.has(tag)) return;\n        placed.add(tag);\n        out.push(tag);\n    };\n    for (const color of colors) if (held.has(color.tag)) place(color.tag);\n    for (const tag of tags) place(tag);\n    return out;\n}\n\n/**\n * A tag list's lines across its width (R30): wrapping, three lines at most —\n * then the third ends in +n, a tag at a time leaving it until the +n fits.\n *\n * @param tags - The tags, in their order\n * @param width - The width beside the label column\n * @param measure - How wide a tag draws\n * @returns The lines, and the tags past them\n */\nfunction tagLines(tags: readonly string[], width: number, measure: FlowchartTextMeasure): { lines: string[][]; rest: string[] } {\n    const lines: string[][] = [];\n    let line: string[] = [];\n    let x = 0;\n    for (const tag of tags) {\n        const w = measure.tag(tag);\n        if (line.length > 0 && x + TAG_GAP + w > width) {\n            lines.push(line);\n            line = [];\n        }\n        x = line.length === 0 ? w : x + TAG_GAP + w;\n        line.push(tag);\n    }\n    if (line.length > 0) lines.push(line);\n    if (lines.length <= TAG_LINES) return { lines, rest: [] };\n    const kept = lines.slice(0, TAG_LINES);\n    const rest = lines.slice(TAG_LINES).flat();\n    const last = kept[TAG_LINES - 1]!;\n    const across = (tagsOf: readonly string[]) => tagsOf.reduce((sum, tag, i) => sum + (i > 0 ? TAG_GAP : 0) + measure.tag(tag), 0);\n    while (last.length > 0 && across(last) + TAG_GAP + measure.tag(`+${rest.length}`) > width) rest.unshift(last.pop()!);\n    return { lines: kept, rest };\n}\n\n/** What a card draws of one read, its row's values given. */\nfunction drawsOf(\n    read: FlowchartReadValue, index: number, row: FlowchartRowDetails | null | undefined, kind: FlowchartKindDetails,\n    column: number, measure: FlowchartTextMeasure,\n): FlowchartCardDraws {\n    if (row === undefined) return PLACEHOLDER;\n    if (row === null) return NO_DATA;\n    if (waitsAt(row, index)) return PLACEHOLDER;\n    const at = valueAt(row, index);\n    switch (read.type) {\n        case \"figure\": {\n            const figure = at?.type === \"figure\" ? getSomeorUndefined(at.value) : undefined;\n            return figure === undefined ? NO_DATA : { kind: \"figure\", value: figure };\n        }\n        case \"histogram\": {\n            const bins = kind.bins[index];\n            const counts = row.counts[index];\n            return bins === undefined || counts === undefined || !(counts.total > 0) ? NO_DATA : { kind: \"bars\", bars: barsOf(bins, counts.counts) };\n        }\n        case \"list\":\n            return at?.type !== \"list\" ? NO_DATA : { kind: \"list\", lines: listLines(at.value, listTopOf(read.value)) };\n        case \"tags\":\n            return at?.type !== \"tags\" ? NO_DATA : { kind: \"tags\", ...tagLines(orderedTags(read.value.colors, at.value), DETAILS_INNER_W - column - TAG_LABEL_GAP, measure) };\n    }\n}\n\n/** A read's block height on a card (§4). */\nfunction heightOf(read: FlowchartReadValue, draws: FlowchartCardDraws): number {\n    switch (read.type) {\n        case \"figure\":\n            return FIGURE_H;\n        case \"tags\": {\n            const lines = draws.kind === \"tags\" ? Math.max(1, draws.lines.length) : 1;\n            return lines * TAG_H + (lines - 1) * TAG_GAP;\n        }\n        case \"histogram\":\n            return TITLE_H + BLOCK_GAP + (draws.kind === \"noData\" ? NO_DATA_H : BARS_H + BLOCK_GAP + AXIS_H);\n        case \"list\": {\n            const lines = draws.kind === \"list\" ? draws.lines.length : draws.kind === \"placeholder\" ? listTopOf(read.value) : 0;\n            return TITLE_H + BLOCK_GAP + (lines === 0 ? NO_DATA_H : lines * LIST_ROW_H + (lines - 1) * BLOCK_GAP);\n        }\n    }\n}\n\n/**\n * A state's card where its details draw (R22, §4): each read it shows, in the\n * details' order, in its block — a placeholder while its row lands, drawn as\n * full, *no data* for no row — and its size from them: 272 wide; its head, a\n * rule, then the blocks 12 apart inside 12 of padding.\n *\n * @param kind - The states' details\n * @param key - The state's key\n * @param measure - How wide its words draw: measured where the card draws, else {@link ESTIMATED_TEXT}\n * @returns The card; `undefined` where no read shows on the canvas, and the card is today's\n */\nexport function detailsCardOf(kind: FlowchartKindDetails, key: string, measure: FlowchartTextMeasure = ESTIMATED_TEXT): FlowchartCard | undefined {\n    if (!kind.onCanvas) return undefined;\n    const row = kind.rows.get(key);\n    const shown = kind.reads.flatMap((entry, index) => (entry.show.type === \"inspector\" ? [] : [{ read: entry.read, index }]));\n    // Tag lists one after another share a label column, as wide as their widest label.\n    const columns = new Map<number, number>();\n    for (let i = 0; i < shown.length;) {\n        let j = i;\n        let width = 0;\n        while (j < shown.length && shown[j]!.read.type === \"tags\") {\n            width = Math.max(width, Math.ceil(measure.label(labelOf(shown[j]!.read))));\n            j += 1;\n        }\n        for (let k = i; k < j; k++) columns.set(shown[k]!.index, width);\n        i = Math.max(j, i + 1);\n    }\n    let top = CARD_EDGE + CARD_HEAD + CARD_RULE + CARD_PAD;\n    const reads = shown.map(({ read, index }): FlowchartCardRead => {\n        const column = columns.get(index);\n        const draws = drawsOf(read, index, row, kind, column ?? 0, measure);\n        const height = heightOf(read, draws);\n        const at = top;\n        top += height + READ_GAP;\n        return { index, top: at, height, column, draws };\n    });\n    return { width: DETAILS_CARD_W, height: top - READ_GAP + CARD_PAD + CARD_EDGE, reads };\n}\n\n// ============================================================================\n// A transition label's lines\n// ============================================================================\n\n/** One line under a transition label's evidence (R32). */\nexport type FlowchartLabelLine =\n    /** Its row has not landed: a placeholder, a line high (R34). */\n    | { readonly kind: \"placeholder\" }\n    /** A figure: its label, its value — `undefined` where the row lacks it, *no data* — and its unit (R25). */\n    | { readonly kind: \"figure\"; readonly label: string; readonly value: number | undefined; readonly unit: string | undefined }\n    /** One of a list's top items: its name, and its share of the list's total (R29). */\n    | { readonly kind: \"item\"; readonly name: string; readonly share: number }\n    /** A list with no items: *none*. */\n    | { readonly kind: \"none\" }\n    /** A list the rail's picks weigh, of a row holding none of them: its label, and *no data* (#1522, R45). */\n    | { readonly kind: \"noData\"; readonly label: string };\n\n/** A placeholder line, while the row lands. */\nconst PLACEHOLDER_LINE: FlowchartLabelLine = { kind: \"placeholder\" };\n/** *None*, in a list's place. */\nconst NONE_LINE: FlowchartLabelLine = { kind: \"none\" };\n\n/**\n * A transition label's lines under its evidence (R32): each read it shows on\n * the canvas, in the details' order — a figure a line, a list its top items by\n * value, or *none* — no line for a row there is none of, which keeps its\n * evidence line alone (R33), and while the row lands each read's lines as\n * placeholders, so the label is as tall as it will be (R34). The build refuses\n * tags and histograms on a label, and lines past three (R21).\n *\n * @param kind - The transitions' details\n * @param key - The transition's key\n * @returns Its lines, in order; none where no read shows on the canvas\n */\nexport function detailsLabelOf(kind: FlowchartKindDetails, key: string): FlowchartLabelLine[] {\n    if (!kind.onCanvas) return [];\n    const row = kind.rows.get(key);\n    if (row === null) return [];\n    const lines: FlowchartLabelLine[] = [];\n    kind.reads.forEach((entry, index) => {\n        if (entry.show.type === \"inspector\") return;\n        const read = entry.read;\n        const at = row === undefined ? undefined : valueAt(row, index);\n        const waits = waitsAt(row, index);\n        if (read.type === \"figure\") {\n            lines.push(waits ? PLACEHOLDER_LINE : {\n                kind: \"figure\", label: read.value.label, value: at?.type === \"figure\" ? getSomeorUndefined(at.value) : undefined, unit: getSomeorUndefined(read.value.unit),\n            });\n        } else if (read.type === \"list\") {\n            const top = listTopOf(read.value);\n            if (row === undefined || waits) {\n                for (let i = 0; i < top; i++) lines.push(PLACEHOLDER_LINE);\n                return;\n            }\n            if (row.noData[index] === true) {\n                lines.push({ kind: \"noData\", label: read.value.label });\n                return;\n            }\n            const items = at?.type === \"list\" ? listLines(at.value, top) : [];\n            if (items.length === 0) lines.push(NONE_LINE);\n            for (const item of items) lines.push({ kind: \"item\", name: item.name, share: item.share });\n        }\n    });\n    return lines;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The details' words and axes (#1510, `Flowchart Records Spec.md` R28, R29,\n * R36, R41) — pure: what a card, a label, the legend and the inspector print of\n * a read, in the app's locale, and the ticks an axis draws across its width.\n *\n * - **Durations** (R41): from the read's unit — `0` alone; under an hour in\n *   minutes, under a day in hours, whole weeks in weeks, else days: `15m`,\n *   `4h`, `2d`, `1w` — the number in the app's locale.\n * - **A bin** by its edges — `4h – 8h`; the last, open — `1w or more`.\n * - **A histogram's caption** (R36): where half and nine in ten of its counts\n *   fall — the first bin whose count so far reaches each, within its end, or,\n *   reaching the open last bin, over its edge.\n * - **A share** (R29): a whole percent; above nothing but under one percent,\n *   `<1%`.\n * - **The axis** (R28): the first edge, then the app's ticks — each printed\n *   from the unit, the last edge's ending in +, its bin open; or the app's own\n *   words, as given — or, without any, round durations it has room for. Each\n *   sits where `axisAt` puts it, a pixel in from there but the first; one that\n *   would pass the axis's end ends there, drawn from the end so its words\n *   end there whatever they measure; one too close to the tick before\n *   it, or to the last, is left out — never the first, and the last only where\n *   it meets the first. The visual spec's `ticksFor`.\n *\n * @packageDocumentation\n */\n\nimport { FloatType, SortedSet, compareFor, equalFor, lessFor } from \"@elaraai/east\";\nimport { axisAt, type FlowchartBins } from \"./details.js\";\nimport type { FlowchartDurationStep, FlowchartMarkWord, FlowchartWords } from \"./messages.js\";\n\nconst compareFloat = compareFor(FloatType);\nconst sameFloat = equalFor(FloatType);\nconst lessFloat = lessFor(FloatType);\n\n/** A histogram's durations' unit, as its read gives it. */\nexport type FlowchartDurationUnit = \"minutes\" | \"hours\" | \"days\";\n\n/** Each unit, in minutes. */\nconst IN_MINUTES: { readonly [U in FlowchartDurationUnit]: number } = { minutes: 1, hours: 60, days: 1440 };\n/** An hour, a day and a week, in minutes. */\nconst HOUR = 60;\nconst DAY = 1440;\nconst WEEK = 10080;\n\n/** A duration in the step it prints in, and its number there. */\nexport interface FlowchartDuration {\n    /** Its step: `zero` alone, else minutes, hours, days or whole weeks. */\n    readonly step: FlowchartDurationStep;\n    /** Its number in that step. */\n    readonly n: number;\n}\n\n/**\n * The step a duration prints in (R41): `0` alone; under an hour, minutes;\n * under a day, hours; whole weeks, weeks; else days.\n *\n * @param value - The duration, in its unit\n * @param unit - The read's unit\n * @returns Its step, and its number there\n */\nexport function durationOf(value: number, unit: FlowchartDurationUnit): FlowchartDuration {\n    const minutes = value * IN_MINUTES[unit];\n    if (isZero(minutes)) return { step: \"zero\", n: 0 };\n    const size = Math.abs(minutes);\n    if (lessFloat(size, HOUR)) return { step: \"minutes\", n: minutes };\n    if (lessFloat(size, DAY)) return { step: \"hours\", n: minutes / HOUR };\n    if (isZero(minutes % WEEK)) return { step: \"weeks\", n: minutes / WEEK };\n    return { step: \"days\", n: minutes / DAY };\n}\n\n/** Nothing, either side of it. */\nfunction isZero(n: number): boolean {\n    return sameFloat(n, 0) || sameFloat(n, -0);\n}\n\n/**\n * A duration as the details print it (R41) — `15m`, `4h`, `2d`, `1w`, `0`.\n *\n * @param value - The duration, in its unit\n * @param unit - The read's unit\n * @param words - The flowchart's words\n * @returns Its words\n */\nexport function durationText(value: number, unit: FlowchartDurationUnit, words: FlowchartWords): string {\n    const { step, n } = durationOf(value, unit);\n    return words.m.detailsDuration({ step, n: words.number(n) });\n}\n\n/**\n * A bin's words, by its place (R41): its edges — `4h – 8h` — or, the last,\n * open — `1w or more`.\n *\n * @param edges - The flowchart's bins' edges, ascending\n * @param bin - The bin's place\n * @param unit - The read's unit\n * @param words - The flowchart's words\n * @returns Its words\n */\nexport function binText(edges: readonly number[], bin: number, unit: FlowchartDurationUnit, words: FlowchartWords): string {\n    const from = durationText(edges[bin]!, unit, words);\n    return words.m.detailsBin({ from, to: bin >= edges.length - 1 ? undefined : durationText(edges[bin + 1]!, unit, words) });\n}\n\n/**\n * A histogram's caption (R36, R41): where half and nine in ten of its counts\n * fall — `Half within 4h · nine in ten within 2d`; `over 1w` where they reach\n * the open last bin.\n *\n * @param edges - The flowchart's bins' edges, ascending\n * @param counts - The row's count in each bin\n * @param unit - The read's unit\n * @param words - The flowchart's words\n * @returns The caption; `undefined` where nothing is counted\n */\nexport function marksText(edges: readonly number[], counts: readonly number[], unit: FlowchartDurationUnit, words: FlowchartWords): string | undefined {\n    const total = counts.reduce((sum, n) => sum + n, 0);\n    if (edges.length === 0 || !lessFloat(0, total)) return undefined;\n    let running = 0;\n    let half = edges.length - 1;\n    let nine = edges.length - 1;\n    let halfFound = false;\n    let nineFound = false;\n    counts.forEach((n, i) => {\n        running += n;\n        if (!halfFound && !lessFloat(running, 0.5 * total)) { half = i; halfFound = true; }\n        if (!nineFound && !lessFloat(running, 0.9 * total)) { nine = i; nineFound = true; }\n    });\n    const mark = (bin: number): FlowchartMarkWord => (bin >= edges.length - 1\n        ? { where: \"over\", at: durationText(edges[edges.length - 1]!, unit, words) }\n        : { where: \"within\", at: durationText(edges[bin + 1]!, unit, words) });\n    return words.m.detailsMarks({ half: mark(half), nine: mark(nine) });\n}\n\n/**\n * A share in the app's locale (R29, R41): a whole percent — above nothing but\n * under one percent, `<1%`.\n *\n * @param share - The share, 0 to 1\n * @param words - The flowchart's words\n * @returns Its words\n */\nexport function shareText(share: number, words: FlowchartWords): string {\n    return lessFloat(0, share) && lessFloat(share, 0.01) ? words.m.detailsShareUnder({ least: words.percent(0.01) }) : words.percent(share);\n}\n\n/** One tick an axis draws: its words, where they start across the axis, and how wide they draw — in px. */\nexport interface FlowchartTick {\n    /** Its words. */\n    readonly text: string;\n    /** Where its words start, from the axis's start: by the estimate, where it ends at the axis's end. */\n    readonly x: number;\n    /** How wide they draw, by the estimate. */\n    readonly w: number;\n    /**\n     * Whether it ends at the axis's end, its words going no further whatever\n     * they measure: drawn from the end, since a browser that rounds each\n     * character to a whole pixel draws them wider than the estimate.\n     */\n    readonly end: boolean;\n}\n\n/** A tick the app lists: where it is, in the read's unit, and its own words where it gives them. */\nexport interface FlowchartTickAt {\n    /** Where it is. */\n    readonly at: number;\n    /** The app's words for it; `undefined`, printed from the unit. */\n    readonly label: string | undefined;\n}\n\n/** A tick's text a character, on a card, in px: mono 9.5, the visual spec's. */\nexport const CARD_TICK_CHAR = 5.7;\n/** A tick's text a character, in the inspector, in px: mono 10, the visual spec's. */\nexport const PANE_TICK_CHAR = 6;\n/** The least room between two ticks' words, in px: the visual spec's. */\nconst TICK_GAP = 6;\n\n/**\n * The round durations an axis names where the app lists no ticks (R28), in\n * minutes: minutes, hours, a day, days and weeks.\n */\nconst ROUND: readonly number[] = [1, 5, 15, 30, HOUR, 2 * HOUR, 4 * HOUR, 8 * HOUR, 12 * HOUR, DAY, 2 * DAY, 4 * DAY, WEEK, 2 * WEEK, 4 * WEEK, 8 * WEEK, 13 * WEEK, 26 * WEEK, 52 * WEEK];\n\n/**\n * The ticks an axis draws across its width (R28; see the module docs): the\n * first edge, then the app's ticks or round durations, each placed where\n * `axisAt` puts it, those that do not fit left out.\n *\n * @param bins - The flowchart's bins\n * @param unit - The read's unit\n * @param ticks - The ticks the app lists; `undefined`, round durations\n * @param width - The axis's width, in px\n * @param char - A tick's text a character, in px\n * @param words - The flowchart's words\n * @returns The ticks drawn, in order\n */\nexport function axisTicks(\n    bins: FlowchartBins, unit: FlowchartDurationUnit, ticks: readonly FlowchartTickAt[] | undefined, width: number, char: number, words: FlowchartWords,\n): FlowchartTick[] {\n    const edges = bins.edges;\n    if (edges.length === 0 || !lessFloat(0, width)) return [];\n    const first = edges[0]!;\n    const last = edges[edges.length - 1]!;\n    const listed: FlowchartTickAt[] = ticks !== undefined\n        ? [...ticks].sort((a, b) => compareFloat(a.at, b.at))\n        : ROUND.map((minutes) => ({ at: minutes / IN_MINUTES[unit], label: undefined })).filter((tick) => !lessFloat(last, tick.at));\n    // Each place once, past the first edge: the first edge's tick is the first.\n    const seen = new SortedSet<number>([first], compareFloat);\n    const named = listed.filter((tick) => {\n        if (!lessFloat(first, tick.at) || seen.has(tick.at)) return false;\n        seen.add(tick.at);\n        return true;\n    });\n    const placed = [{ at: first, label: undefined }, ...named].map(({ at, label }): FlowchartTick => {\n        const printed = durationText(at, unit, words);\n        const text = label ?? (sameFloat(at, last) ? words.m.detailsOpen({ at: printed }) : printed);\n        const w = [...text].length * char;\n        let x = axisAt(bins, at) * width;\n        if (lessFloat(0, x)) x += 1;\n        const end = lessFloat(width, x + w);\n        if (end) x = width - w;\n        return { text, x, w, end };\n    });\n    const head = placed[0]!;\n    if (placed.length === 1) return [head];\n    const tail = placed[placed.length - 1]!;\n    // The last only where it meets the first; past it, nothing in between that would crowd it.\n    const withTail = !lessFloat(tail.x, head.x + head.w + TICK_GAP);\n    const stop = withTail ? tail.x : Number.POSITIVE_INFINITY;\n    const out: FlowchartTick[] = [head];\n    let end = head.x + head.w;\n    for (const tick of placed.slice(1, -1)) {\n        if (lessFloat(tick.x, end + TICK_GAP) || lessFloat(stop, tick.x + tick.w + TICK_GAP)) continue;\n        out.push(tick);\n        end = tick.x + tick.w;\n    }\n    if (withTail) out.push(tail);\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the canvas draws of the details beside its cards (#1510, `Flowchart\n * Records Spec.md` R30, R31, §4) — pure: a tag's look, the legend's rows and\n * its groups of tags, the legend's height, and the words the canvas measures\n * as a card draws them.\n *\n * - **A tag's look** (R30): its definition's, the first naming it. Subtle, the\n *   default, in a palette is a wash of it; in gray or neutral, or for a tag no\n *   definition names, the neutral look; any other variant is the Tag\n *   recipe's, in its definition's palette.\n * - **The legend** (R31, §4): under today's four rows, a row for each\n *   figure, histogram and list the cards and labels draw, in the details'\n *   order — the states', then the transitions' — each its mark and its words;\n *   and beside them, one over another, a group for each tag list on the cards\n *   it lists, its label, then the defined tags the cards show, in the order\n *   defined. A tag no definition names is left out; a group whose tags no card\n *   shows yet — before a row lands, say — is its label alone.\n * - **Its height** (§4): its rows' column — its title, then 22 a row — or its\n *   groups' column — each its title, then its tags wrapped across 236, 15 a\n *   line and 4 between, one over another 12 apart — whichever is taller, in\n *   its padding and its rule: what the layout keeps under the drawing for it.\n *\n * @packageDocumentation\n */\n\nimport { SortedSet, StringType, compareFor, equalFor } from \"@elaraai/east\";\nimport { listTopOf, valueAt, type FlowchartDetailsModel, type FlowchartKindDetails, type FlowchartTagColors, type FlowchartTextMeasure } from \"./details.js\";\nimport { durationText } from \"./details-words.js\";\nimport type { FlowchartWords } from \"./messages.js\";\n\nconst compareKey = compareFor(StringType);\nconst sameString = equalFor(StringType);\n\n/** A tag's look (R30), as the canvas, the legend and the inspector draw it. */\nexport type FlowchartTagLook =\n    /** Subtle in a palette: a 6% wash of it on a 1px rule of it, in its text step. */\n    | { readonly look: \"wash\"; readonly palette: string }\n    /** Gray, neutral, or no definition: `--paper-3` on a 1px `--rule`. */\n    | { readonly look: \"neutral\" }\n    /** Any other variant: the Tag recipe's, in its definition's palette. */\n    | { readonly look: \"recipe\"; readonly palette: string; readonly variant: string };\n\n/** The neutral look. */\nconst NEUTRAL: FlowchartTagLook = { look: \"neutral\" };\n\n/**\n * A tag's look (R30): its definition's — the first naming it — else neutral.\n *\n * @param colors - The read's looks\n * @param tag - The tag\n * @returns Its look\n */\nexport function tagLookOf(colors: FlowchartTagColors, tag: string): FlowchartTagLook {\n    const color = colors.find((defined) => sameString(defined.tag, tag));\n    if (color === undefined) return NEUTRAL;\n    const palette = color.colorPalette.type;\n    const variant = color.variant.type;\n    if (variant === \"subtle\") return palette === \"gray\" || palette === \"neutral\" ? NEUTRAL : { look: \"wash\", palette };\n    return { look: \"recipe\", palette, variant };\n}\n\n/** What a legend row's mark draws: a figure's `123`, bars, a list's lines and shares, or a label's badge and its lines. */\nexport type FlowchartLegendMark = \"figure\" | \"bars\" | \"lines\" | \"label\";\n\n/** One row the legend adds for a read the cards and labels draw (R31). */\nexport interface FlowchartLegendRead {\n    /** Its kind and its place in the details: what keys it. */\n    readonly key: string;\n    /** Its mark. */\n    readonly mark: FlowchartLegendMark;\n    /** Its words: the read's label, and what it shows. */\n    readonly text: string;\n}\n\n/** One tag a legend's group lists: the tag, and its look. */\nexport interface FlowchartLegendTag {\n    readonly tag: string;\n    readonly look: FlowchartTagLook;\n}\n\n/** One group of tags beside the legend's rows (R31): a tag list's label, then its defined tags the cards show. */\nexport interface FlowchartLegendGroup {\n    /** Its read's place in the states' details: what keys it. */\n    readonly key: string;\n    /** The read's label. */\n    readonly label: string;\n    /** Its tags, in the order defined: none while no card shows one. */\n    readonly tags: readonly FlowchartLegendTag[];\n}\n\n/** What the legend adds of the details: its rows, and its groups of tags. */\nexport interface FlowchartLegend {\n    readonly reads: readonly FlowchartLegendRead[];\n    readonly groups: readonly FlowchartLegendGroup[];\n}\n\n/** No details on the canvas: the legend draws today's rows alone. */\nexport const NO_LEGEND: FlowchartLegend = { reads: [], groups: [] };\n\n/** One kind's reads on the canvas, as the legend's rows name them. */\nfunction readRows(kind: FlowchartKindDetails | undefined, sort: \"states\" | \"transitions\", words: FlowchartWords): FlowchartLegendRead[] {\n    if (kind === undefined || !kind.onCanvas) return [];\n    const on = sort === \"states\" ? \"card\" as const : \"label\" as const;\n    const rows: FlowchartLegendRead[] = [];\n    kind.reads.forEach((entry, index) => {\n        if (entry.show.type === \"inspector\") return;\n        const key = `${sort}:${index}`;\n        const read = entry.read;\n        switch (read.type) {\n            case \"figure\":\n                rows.push({ key, mark: on === \"card\" ? \"figure\" : \"label\", text: words.m.legendRead({ read: \"figure\", label: read.value.label, on }) });\n                return;\n            case \"histogram\": {\n                const edges = kind.bins[index]?.edges ?? [];\n                const unit = read.value.unit.type;\n                rows.push({\n                    key, mark: \"bars\",\n                    text: words.m.legendRead({\n                        read: \"histogram\", label: read.value.label, scale: read.value.scale.type,\n                        first: edges.length === 0 ? undefined : durationText(edges[0]!, unit, words),\n                        last: edges.length < 2 ? undefined : durationText(edges[edges.length - 1]!, unit, words),\n                    }),\n                });\n                return;\n            }\n            case \"list\":\n                rows.push({\n                    key, mark: on === \"card\" ? \"lines\" : \"label\",\n                    text: words.m.legendRead({ read: \"list\", label: read.value.label, top: words.number(listTopOf(read.value)), on }),\n                });\n                return;\n            case \"tags\":\n                return;\n        }\n    });\n    return rows;\n}\n\n/**\n * What the legend adds of the details (R31; see the module docs): its rows for\n * the reads the cards and labels draw, and its groups of tags.\n *\n * @param details - The details model\n * @param words - The flowchart's words\n * @returns The legend's reads and groups\n */\nexport function legendOf(details: FlowchartDetailsModel, words: FlowchartWords): FlowchartLegend {\n    const reads = [...readRows(details.states, \"states\", words), ...readRows(details.transitions, \"transitions\", words)];\n    const groups: FlowchartLegendGroup[] = [];\n    const states = details.states;\n    if (states !== undefined && states.onCanvas) {\n        states.reads.forEach((entry, index) => {\n            if (entry.read.type !== \"tags\" || !entry.read.value.legend || entry.show.type === \"inspector\") return;\n            const colors = entry.read.value.colors;\n            // The tags the cards show: every landed row's.\n            const shown = new SortedSet<string>([], compareKey);\n            for (const row of states.rows.values()) {\n                const at = row === null ? undefined : valueAt(row, index);\n                if (at?.type === \"tags\") for (const tag of at.value) shown.add(tag);\n            }\n            const listed = new SortedSet<string>([], compareKey);\n            const tags: FlowchartLegendTag[] = [];\n            for (const color of colors) {\n                if (!shown.has(color.tag) || listed.has(color.tag)) continue;\n                listed.add(color.tag);\n                tags.push({ tag: color.tag, look: tagLookOf(colors, color.tag) });\n            }\n            groups.push({ key: `tags:${index}`, label: entry.read.value.label, tags });\n        });\n    }\n    return reads.length === 0 && groups.length === 0 ? NO_LEGEND : { reads, groups };\n}\n\n/** Today's rows: planned, observed, the decision trigger and the in-place transition. */\nconst TODAY_ROWS = 4;\n/** The legend's title: mono 9, its line 11.25. */\nconst LEGEND_TITLE = 11.25;\n/** A row, and the gap before it. */\nconst LEGEND_ROW = 16 + 6;\n/** Between a group's title and its tags. */\nconst GROUP_GAP = 4;\n/** A tag in a group: the card's size. */\nconst GROUP_TAG_H = 15;\n/** Between two lines of a group's tags, and between two tags. */\nconst GROUP_TAG_GAP = 4;\n/** Between two groups, one over another. */\nconst GROUPS_GAP = 12;\n/** What a group's tags wrap across: the visual spec's. */\nexport const LEGEND_GROUP_W = 236;\n/** The legend's padding, 10 above and below, and its 1px rule. */\nconst LEGEND_CHROME = 2 * 10 + 2 * 1;\n\n/** How many lines a group's tags take across its width. */\nfunction groupLines(tags: readonly FlowchartLegendTag[], measure: FlowchartTextMeasure): number {\n    let lines = 0;\n    let x = 0;\n    for (const { tag } of tags) {\n        const w = measure.tag(tag);\n        if (lines === 0 || x + GROUP_TAG_GAP + w > LEGEND_GROUP_W) {\n            lines += 1;\n            x = w;\n        } else x += GROUP_TAG_GAP + w;\n    }\n    return lines;\n}\n\n/**\n * The legend's height (§4; see the module docs): what the layout keeps under\n * the drawing for it.\n *\n * @param legend - What it adds of the details\n * @param measure - How wide a tag draws\n * @returns Its height, in px, a whole number\n */\nexport function legendHeight(legend: FlowchartLegend, measure: FlowchartTextMeasure): number {\n    const rows = LEGEND_TITLE + (TODAY_ROWS + legend.reads.length) * LEGEND_ROW;\n    // The groups one over another, 12 apart.\n    const groups = legend.groups.reduce((column, group, i) => {\n        const lines = groupLines(group.tags, measure);\n        // A group no card shows a tag of yet is its title alone.\n        const height = lines === 0 ? LEGEND_TITLE : LEGEND_TITLE + GROUP_GAP + lines * GROUP_TAG_H + (lines - 1) * GROUP_TAG_GAP;\n        return column + (i === 0 ? 0 : GROUPS_GAP) + height;\n    }, 0);\n    return Math.ceil(Math.max(rows, groups) + LEGEND_CHROME);\n}\n\n/** The words a card draws that the canvas measures: its tag lists' labels, and their tags with every +n they may end in. */\nexport interface FlowchartProbeTexts {\n    readonly labels: readonly string[];\n    readonly tags: readonly string[];\n}\n\n/** Nothing to measure. */\nexport const NO_PROBE: FlowchartProbeTexts = { labels: [], tags: [] };\n\n/**\n * The words the canvas measures as a card draws them (#1510): each tag list's\n * label on the cards, each tag a landed row holds there, and each +n a list of\n * them may end in — so a card is measured before the layout places it.\n *\n * @param kind - The states' details\n * @param words - The flowchart's words: a +n's\n * @returns The labels and the tags, each once\n */\nexport function probeTextsOf(kind: FlowchartKindDetails | undefined, words: FlowchartWords): FlowchartProbeTexts {\n    if (kind === undefined || !kind.onCanvas) return NO_PROBE;\n    const labels = new SortedSet<string>([], compareKey);\n    const tags = new SortedSet<string>([], compareKey);\n    let most = 0;\n    kind.reads.forEach((entry, index) => {\n        if (entry.read.type !== \"tags\" || entry.show.type === \"inspector\") return;\n        labels.add(entry.read.value.label);\n        for (const row of kind.rows.values()) {\n            const at = row === null ? undefined : valueAt(row, index);\n            if (at?.type !== \"tags\") continue;\n            for (const tag of at.value) tags.add(tag);\n            most = Math.max(most, at.value.length);\n        }\n    });\n    for (let n = 1; n <= most; n++) tags.add(words.m.detailsMore({ count: words.number(n) }));\n    return labels.size === 0 ? NO_PROBE : { labels: [...labels], tags: [...tags] };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What a state's card draws of its details (#1510, `Flowchart Records\n * Spec.md` R22, R25–R30, R33, R34), the legend's marks for the reads (R31),\n * a tag in its look, and the probe that measures a card's words as it draws\n * them — in the `flowchart` recipe's slots, which own every colour, size and\n * type: these set data attributes and geometry alone.\n *\n * - **The card**: its head — its label, its ×n and ↻ n, over its key — then\n *   each read the details show on the canvas, in their order, each in the\n *   block its model gives it: a figure's line, its value in the app's locale\n *   with its unit; a tag list beside its label, its lines, the last ending in\n *   +n, its title naming the rest; a title over bars — each a bin, 2 short of\n *   the next, or on a linear axis, too thin for that, flush with it and a pixel\n *   at least; as tall as its count over the card's tallest — and the axis's\n *   ticks; a title over a list's top lines, each its name, a track filled to\n *   its share, and the share. *No data* for a row there is none of or a value\n *   it lacks, *none* for a list with no items; while a row lands, the shared\n *   placeholder shapes where its values go, its labels drawn.\n * - **A tag** (R30), the card's, the legend's and the inspector's: a wash or\n *   the neutral look in the recipe's own slot, or the design system's Tag in\n *   its definition's variant and palette, the slot giving it its size.\n * - **The probe** (#1510): the tag lists' labels and their tags, drawn out of\n *   sight in the slots a card draws them with, measured after each render and\n *   again once the fonts land — so a card's tags wrap, and its height is\n *   known, before the layout places it; where nothing measures (a test's DOM),\n *   the estimate stands.\n *\n * @packageDocumentation\n */\n\nimport { useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { Box, Tag as ChakraTag, chakra, type SystemStyleObject, type TagRootProps } from \"@chakra-ui/react\";\nimport { FloatType, lessFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { PlaceholderShape } from \"@elaraai/east-ui-components/internal\";\nimport {\n    DETAILS_INNER_W, ESTIMATED_TEXT, listTopOf,\n    type FlowchartBar, type FlowchartBins, type FlowchartCard, type FlowchartCardRead, type FlowchartKindDetails, type FlowchartReadValue, type FlowchartTextMeasure,\n} from \"./details.js\";\nimport { NO_PROBE, tagLookOf, type FlowchartLegendMark, type FlowchartProbeTexts, type FlowchartTagLook } from \"./details-draw.js\";\nimport { CARD_TICK_CHAR, axisTicks, marksText, shareText, type FlowchartTickAt } from \"./details-words.js\";\nimport type { FlowchartWords } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** A bar on a card at most, inside the bars' 1px rule (R26): the visual spec's 27. */\nconst CARD_BAR_MOST = 27;\n\n/** A share as a CSS length across its box. */\nconst across = (share: number): string => `${share * 100}%`;\n\nconst lessFloat = lessFor(FloatType);\n\n/** The room between two bars, in px: each 2 short of the next (R26). */\nconst BAR_GAP = 2;\n\n/** Where a bar draws across its axis, as CSS. */\nexport interface FlowchartBarAcross {\n    /** Where it starts, a share of the axis. */\n    readonly left: string;\n    /** Its width: its span 2 short of the next, or its span alone where it draws flush. */\n    readonly width: string;\n    /** Where it draws flush, a pixel; else none. */\n    readonly minWidth: string | undefined;\n    /** Whether it draws flush with its neighbours: too thin for the room between them. */\n    readonly flush: boolean;\n}\n\n/**\n * Where a bar draws across an axis `width` px wide (R26): from its start, 2\n * short of its span, the room to the next — or, on a linear axis, where its\n * span leaves under a pixel past that room, its span alone, flush with its\n * neighbours and a pixel at least, so a thin bin still shows what it counts.\n *\n * @param bins - The flowchart's bins\n * @param bar - The bar\n * @param width - The axis's width, in px\n * @returns Its start, its width and its least, and whether it draws flush\n */\nexport function barAcross(bins: FlowchartBins, bar: FlowchartBar, width: number): FlowchartBarAcross {\n    const share = bar.to - bar.from;\n    const flush = bins.scale === \"linear\" && lessFloat(share * width - BAR_GAP, 1);\n    return flush\n        ? { left: across(bar.from), width: across(share), minWidth: \"1px\", flush }\n        : { left: across(bar.from), width: `calc(${across(share)} - ${BAR_GAP}px)`, minWidth: undefined, flush };\n}\n\n/**\n * A bar's height on a card: as tall as its count over the card's tallest, a\n * pixel at least where it counts anything.\n *\n * @param bar - The bar\n * @returns Its height, in px\n */\nexport function cardBarHeight(bar: FlowchartBar): number {\n    return bar.count > 0 ? Math.max(1, Math.round(bar.height * CARD_BAR_MOST)) : 0;\n}\n\n/** Props of {@link FlowchartTag}. */\nexport interface FlowchartTagProps {\n    /** Its size: the card's slot, or the inspector's. */\n    readonly css: SystemStyleObject | undefined;\n    /** Its words. */\n    readonly text: string;\n    /** Its look. */\n    readonly look: FlowchartTagLook;\n    /** What it names where its words do not: a +n's, the tags past it. */\n    readonly title?: string | undefined;\n    /** A +n's mark: the tags it stands for. */\n    readonly more?: boolean | undefined;\n}\n\n/** The Tag recipe's `colored`: a Tag drawn in the palette it is given. */\nconst COLORED = { colored: true } as TagRootProps;\n\n/**\n * A tag in its look (R30): a wash or the neutral look in the slot it is given,\n * or the design system's Tag in its definition's variant and palette — the\n * Tag's `colored`, so it draws in the palette — the slot giving it its size\n * alone, its words in the Tag itself, at the slot's type: the Tag's label\n * takes its own size's type, 12px on 16.\n *\n * @param props - Its size, words, look, and title\n * @returns The tag\n */\nexport function FlowchartTag({ css, text, look, title, more }: FlowchartTagProps) {\n    const marks = { \"data-flowchart-tag\": more === true ? undefined : text, \"data-flowchart-more\": more === true ? \"\" : undefined, title };\n    if (look.look === \"recipe\") {\n        return (\n            <ChakraTag.Root css={css} variant={look.variant as TagRootProps[\"variant\"]} colorPalette={look.palette} {...COLORED} data-look=\"recipe\" {...marks}>\n                {text}\n            </ChakraTag.Root>\n        );\n    }\n    return (\n        <chakra.span css={css} colorPalette={look.look === \"wash\" ? look.palette : undefined} data-look={look.look} {...marks}>\n            {text}\n        </chakra.span>\n    );\n}\n\n/** The neutral look: a +n's. */\nconst NEUTRAL: FlowchartTagLook = { look: \"neutral\" };\n\n/** Props of {@link FlowchartCardContent}. */\nexport interface FlowchartCardContentProps {\n    /** The `flowchart` recipe's slots. */\n    readonly styles: Styles;\n    /** The states' details. */\n    readonly kind: FlowchartKindDetails;\n    /** The card: its reads, each in its block. */\n    readonly card: FlowchartCard;\n    /** The flowchart's words. */\n    readonly words: FlowchartWords;\n    /** What the head names it: its label, else its key. */\n    readonly name: string;\n    /** Its key under its name; `undefined` where the name is the key. */\n    readonly code: string | undefined;\n    /** Its ×n and ↻ n, beside its name. */\n    readonly badges: ReactNode;\n}\n\n/**\n * A state's card where its details draw (R22; see the module docs): its head,\n * then its reads.\n *\n * @param props - The recipe's slots, the details, the card, the words, its name and key, and its badges\n * @returns The card's contents\n */\nexport function FlowchartCardContent({ styles, kind, card, words, name, code, badges }: FlowchartCardContentProps) {\n    return (\n        <>\n            <Box css={styles.cardHead} data-card-head=\"\">\n                <Box css={styles.cardTitle}>\n                    <Box as=\"span\" css={styles.cardName} data-card-name=\"\" title={name}>{name}</Box>\n                    {badges}\n                </Box>\n                {code !== undefined && <Box as=\"span\" css={styles.cardKey} data-card-key=\"\">{code}</Box>}\n            </Box>\n            <Box css={styles.cardBody} data-card-body=\"\">\n                {card.reads.map((read) => <CardRead key={read.index} styles={styles} kind={kind} read={read} words={words} />)}\n            </Box>\n        </>\n    );\n}\n\n/** One read in its block on a card. */\nfunction CardRead({ styles, kind, read, words }: { styles: Styles; kind: FlowchartKindDetails; read: FlowchartCardRead; words: FlowchartWords }) {\n    const described = kind.reads[read.index]!.read;\n    const m = words.m;\n    const draws = read.draws;\n    const block = { \"data-card-read\": read.index, \"data-read\": described.type, style: { height: read.height } };\n    const empty = (text: string) => <Box as=\"span\" css={styles.noData} data-card-empty=\"\">{text}</Box>;\n    const label = <Box as=\"span\" css={styles.readLabel} data-read-label=\"\">{described.value.label}</Box>;\n    switch (described.type) {\n        case \"figure\": {\n            const unit = getSomeorUndefined(described.value.unit);\n            return (\n                <Box css={styles.figure} {...block}>\n                    {label}\n                    {draws.kind === \"figure\" ? (\n                        <Box as=\"span\" css={styles.figureValue} data-card-value=\"\">\n                            <Box as=\"span\" css={styles.figureNumber}>{words.number(draws.value)}</Box>\n                            {unit !== undefined && <Box as=\"span\" css={styles.figureUnit}>{unit}</Box>}\n                        </Box>\n                    ) : draws.kind === \"placeholder\" ? (\n                        <Box css={styles.placeholder} data-place=\"figure\"><PlaceholderShape kind=\"number\" index={read.index} /></Box>\n                    ) : empty(m.detailsNoData())}\n                </Box>\n            );\n        }\n        case \"tags\":\n            return (\n                <Box css={styles.tags} {...block}>\n                    <Box as=\"span\" css={styles.readLabel} data-read-label=\"\" style={{ width: read.column }}>{described.value.label}</Box>\n                    <Box css={styles.tagLines} data-tag-lines=\"\">\n                        {draws.kind === \"placeholder\" ? (\n                            <Box css={styles.placeholder} data-place=\"tags\" data-dense=\"\"><PlaceholderShape kind=\"chip\" index={read.index} /></Box>\n                        ) : draws.kind !== \"tags\" ? empty(m.detailsNoData())\n                            : draws.lines.length === 0 ? empty(m.detailsNone())\n                                : draws.lines.map((line, l) => (\n                                    <Box key={l} css={styles.tagLine} data-tag-line={l}>\n                                        {line.map((tag) => <FlowchartTag key={tag} css={styles.tag} text={tag} look={tagLookOf(described.value.colors, tag)} />)}\n                                        {l === draws.lines.length - 1 && draws.rest.length > 0 && (\n                                            <FlowchartTag css={styles.tag} more look={NEUTRAL} text={m.detailsMore({ count: words.number(draws.rest.length) })}\n                                                title={m.detailsRest({ tags: draws.rest })} />\n                                        )}\n                                    </Box>\n                                ))}\n                    </Box>\n                </Box>\n            );\n        case \"histogram\": {\n            const bins = kind.bins[read.index];\n            const unit = described.value.unit.type;\n            return (\n                <Box css={styles.histogram} {...block}>\n                    {label}\n                    {draws.kind === \"placeholder\" ? (\n                        <Box css={styles.placeholder} data-place=\"bars\"><PlaceholderShape kind=\"fill\" index={read.index} /></Box>\n                    ) : draws.kind !== \"bars\" || bins === undefined ? empty(m.detailsNoData()) : (\n                        <>\n                            <Box css={styles.bars} data-card-bars=\"\" role=\"img\"\n                                aria-label={marksText(bins.edges, draws.bars.map((bar) => bar.count), unit, words) ?? described.value.label}>\n                                {draws.bars.map((bar, b) => {\n                                    if (!(bar.count > 0)) return null;\n                                    const at = barAcross(bins, bar, DETAILS_INNER_W);\n                                    return (\n                                        <Box as=\"span\" key={b} css={styles.bar} data-bin={b} data-flush={at.flush ? \"\" : undefined}\n                                            style={{ left: at.left, width: at.width, minWidth: at.minWidth, height: cardBarHeight(bar) }} />\n                                    );\n                                })}\n                            </Box>\n                            <Box css={styles.axis} data-card-axis=\"\" aria-hidden=\"true\">\n                                {axisTicks(bins, unit, ticksOf(described.value.ticks), DETAILS_INNER_W, CARD_TICK_CHAR, words).map((tick) => (\n                                    <Box as=\"span\" key={tick.text} css={styles.tick} data-tick=\"\" style={tick.end ? { right: 0 } : { left: tick.x }}>{tick.text}</Box>\n                                ))}\n                            </Box>\n                        </>\n                    )}\n                </Box>\n            );\n        }\n        case \"list\":\n            return (\n                <Box css={styles.list} {...block}>\n                    {label}\n                    {draws.kind === \"placeholder\" ? Array.from({ length: listTopOf(described.value) }, (_, i) => (\n                        <Box key={i} css={styles.placeholder} data-place=\"row\"><PlaceholderShape kind=\"text\" index={read.index + i} /></Box>\n                    )) : draws.kind !== \"list\" ? empty(m.detailsNoData())\n                        : draws.lines.length === 0 ? empty(m.detailsNone())\n                            : draws.lines.map((line, i) => (\n                                <Box key={i} css={styles.listRow} data-list-row={i}>\n                                    <Box as=\"span\" css={styles.listName} title={line.name}>{line.name}</Box>\n                                    <Box as=\"span\" css={styles.listTrack} aria-hidden=\"true\"><Box as=\"span\" css={styles.listFill} style={{ width: across(line.share) }} /></Box>\n                                    <Box as=\"span\" css={styles.listShare}>{shareText(line.share, words)}</Box>\n                                </Box>\n                            ))}\n                </Box>\n            );\n    }\n}\n\n/**\n * The ticks a histogram read lists (R28): each where it is, and its own words\n * where it gives them; `undefined` where it lists none, and the axis names\n * round durations.\n *\n * @param ticks - The read's ticks\n * @returns The ticks\n */\nexport function ticksOf(ticks: Extract<FlowchartReadValue, { type: \"histogram\" }>[\"value\"][\"ticks\"]): FlowchartTickAt[] | undefined {\n    const given = getSomeorUndefined(ticks);\n    return given?.map((tick) => ({ at: tick.at, label: getSomeorUndefined(tick.label) }));\n}\n\n/**\n * A read's mark in the legend (R31): a figure's `123`; four bars on a base; a\n * list's two lines and their shares; a label's badge and its two lines — the\n * recipe's colours, by each part's `data-mark`.\n *\n * @param props - The mark\n * @returns The mark\n */\nexport function FlowchartLegendMarkView({ styles, mark }: { styles: Styles; mark: FlowchartLegendMark }) {\n    switch (mark) {\n        case \"figure\":\n            return <Box as=\"span\" css={styles.legendMark} data-legend-mark={mark}><Box as=\"span\" css={styles.legendFigure}>123</Box></Box>;\n        case \"bars\":\n            return (\n                <Box as=\"span\" css={styles.legendMark} data-legend-mark={mark}>\n                    <svg width={28} height={16} aria-hidden=\"true\">\n                        <rect data-mark=\"bar\" x={3} y={10} width={4} height={4} />\n                        <rect data-mark=\"bar\" x={8.5} y={4} width={4} height={10} />\n                        <rect data-mark=\"bar\" x={14} y={2} width={4} height={12} />\n                        <rect data-mark=\"bar\" x={19.5} y={8} width={4} height={6} />\n                        <line data-mark=\"base\" x1={2} y1={14.5} x2={26} y2={14.5} />\n                    </svg>\n                </Box>\n            );\n        case \"lines\":\n            return (\n                <Box as=\"span\" css={styles.legendMark} data-legend-mark={mark}>\n                    <svg width={28} height={16} aria-hidden=\"true\">\n                        <rect data-mark=\"bar\" x={2} y={3} width={14} height={3} />\n                        <rect data-mark=\"bar\" x={2} y={10} width={8} height={3} />\n                        <rect data-mark=\"share\" x={19} y={3} width={7} height={3} />\n                        <rect data-mark=\"share\" x={19} y={10} width={7} height={3} />\n                    </svg>\n                </Box>\n            );\n        case \"label\":\n            return (\n                <Box as=\"span\" css={styles.legendMark} data-legend-mark={mark}>\n                    <svg width={28} height={16} aria-hidden=\"true\">\n                        <rect data-mark=\"badge\" x={2.5} y={1.5} width={23} height={13} rx={2} />\n                        <line data-mark=\"line\" x1={6} y1={5.5} x2={22} y2={5.5} />\n                        <line data-mark=\"detail\" x1={8} y1={10.5} x2={20} y2={10.5} />\n                    </svg>\n                </Box>\n            );\n    }\n}\n\n/** Each measured word's width, by its text: a label's, and a tag's. */\ninterface Measured {\n    readonly label: ReadonlyMap<string, number>;\n    readonly tag: ReadonlyMap<string, number>;\n}\n\n/** Nothing measured yet. */\nconst NOTHING_MEASURED: Measured = { label: new Map(), tag: new Map() };\n\n/** Two measures the same, to a hundredth of a px. */\nfunction sameWidths(a: ReadonlyMap<string, number>, b: ReadonlyMap<string, number>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [text, w] of b) {\n        const was = a.get(text);\n        if (was === undefined || Math.abs(was - w) > 0.01) return false;\n    }\n    return true;\n}\n\n/**\n * How wide a card's words draw (#1510; see the module docs): the probe that\n * measures them, and the measure the cards are worked out with — measured\n * where the probe measures, estimated where it does not.\n *\n * @param styles - The `flowchart` recipe's slots\n * @param texts - The words to measure\n * @returns The measure, and the probe to draw out of sight\n */\nexport function useFlowchartTextMeasure(styles: Styles, texts: FlowchartProbeTexts): { measure: FlowchartTextMeasure; probe: ReactNode } {\n    const probeRef = useRef<HTMLDivElement | null>(null);\n    const [measured, setMeasured] = useState<Measured>(NOTHING_MEASURED);\n    // The fonts landing change what the words measure: measured again.\n    const [fonts, setFonts] = useState(0);\n    useEffect(() => {\n        const set = typeof document === \"undefined\" ? undefined : document.fonts;\n        if (set === undefined) return;\n        let live = true;\n        const again = (): void => { if (live) setFonts((n) => n + 1); };\n        void set.ready.then(again);\n        set.addEventListener(\"loadingdone\", again);\n        return () => {\n            live = false;\n            set.removeEventListener(\"loadingdone\", again);\n        };\n    }, []);\n    useLayoutEffect(() => {\n        const el = probeRef.current;\n        if (el === null) return;\n        const label = new Map<string, number>();\n        const tag = new Map<string, number>();\n        for (const word of el.querySelectorAll<HTMLElement>(\"[data-measure]\")) {\n            const w = word.getBoundingClientRect().width;\n            // Nothing measures here — a test's DOM: the estimate stands.\n            if (!(w > 0)) continue;\n            (word.dataset.measure === \"label\" ? label : tag).set(word.textContent ?? \"\", w);\n        }\n        setMeasured((was) => (sameWidths(was.label, label) && sameWidths(was.tag, tag) ? was : { label, tag }));\n    }, [texts, fonts]);\n    const measure = useMemo((): FlowchartTextMeasure => ({\n        label: (text) => measured.label.get(text) ?? ESTIMATED_TEXT.label(text),\n        tag: (text) => measured.tag.get(text) ?? ESTIMATED_TEXT.tag(text),\n    }), [measured]);\n    const probe = texts === NO_PROBE ? null : (\n        <Box ref={probeRef} css={styles.measure} aria-hidden=\"true\" data-flowchart-measure=\"\">\n            {texts.labels.map((text) => <Box as=\"span\" key={`label:${text}`} css={styles.readLabel} data-measure=\"label\">{text}</Box>)}\n            {texts.tags.map((text) => <Box as=\"span\" key={`tag:${text}`} css={styles.tag} data-look=\"neutral\" data-measure=\"tag\">{text}</Box>)}\n        </Box>\n    );\n    return { measure, probe };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Flowchart layout — pure geometry. No React imports.\n *\n * Implements the spec's link-geometry contract:\n * - H/V segments only — never diagonal, never bezier.\n * - Corners are quarter-arcs r 8; in tight channels r may shrink to 4,\n *   never to a sharp corner.\n * - ≥ 12px straight leaving a handle before the first corner, ≥ 12px\n *   between consecutive corners, ≥ 12px straight entry before the\n *   arrowhead.\n * - Parallel runs sit ≥ 16px apart (per-gap channel assignment).\n * - One fixed handle per side (centre of each edge). A link joins the\n *   CLOSEST FACING pair of handles on its two nodes — the router picks\n *   the nearest pair and routes H/V between them. Links converge at the\n *   handle; paths start and end at the 7px handle RING's edge so the\n *   fixed 12px arrowhead tip butts the ring, never past or before it.\n *   TD swaps the axes via a logical-space transpose (cards stay upright).\n * - Cards are as big as what they show (R22): 116 × 40, or — where the\n *   details draw on them — the card's width and each its own height. Left\n *   to right each row is as tall as its tallest card, its cards centred in\n *   it; top down the lanes are as tall as the tallest card. Two cards side\n *   by side keep room for the widest label between them (R24).\n * - A link's sides are chosen over a box of the card's width and 40,\n *   centred on its card, so they are today's whatever the card's height,\n *   and its route meets the card's own sides (R23). A route keeps its\n *   sides and never crosses a card: where its straight line would, it\n *   turns into the gutter between rows, or the gap beside a lane, and back.\n * - The decision diamond anchors to the midpoint of the longest straight\n *   segment; labels place collision-aware over their boxes (R32): today's\n *   places, then steps off each segment, and where none is clear, the\n *   place tried that covers least of the cards, then of the labels.\n */\n\nimport type { FlowchartModel, ModelLink } from \"./model.js\";\n\n// ── Spec dimensional constants ─────────────────────────────────────────────\nexport const NODE_W = 116;\nexport const NODE_H = 40;\nexport const CORNER_R = 8;\nexport const CORNER_R_MIN = 4;\nexport const MIN_STRAIGHT = 12;\nexport const CHANNEL_GAP = 16;\nexport const LANE_MIN_W = 166;\nexport const LANE_HEADER_H = 40;\nexport const ROW_PITCH = 96;\nexport const CANVAS_PAD_BOTTOM = 48;\nexport const LANE_TAIL_W = 78;\n/** Handle ring radius — paths stop at the ring edge. */\nexport const RING_R = 3.5;\n/** A label's box height with one line: its evidence. */\nexport const BADGE_H = 18;\n\n/** Between two rows, left to right: today's pitch past a card (§4). */\nconst ROW_GAP = ROW_PITCH - NODE_H;\n/** Left to right, the least room between two lanes' cards: today's lane past its card (R24). */\nconst LANE_GAP = LANE_MIN_W - NODE_W;\n/** Top down, the least room between two rows' cards: today's 168 pitch past the card (R24). */\nconst TD_ROW_GAP = 52;\n/** Top down, the most that room widens to where the width allows: today's 260 pitch past the card (§4). */\nconst TD_ROW_GAP_MOST = 144;\n/** Top down, a lane past its tallest card: today's 112 past the 40 (§4). */\nconst TD_LANE_GAP = 72;\n/** Where the details draw on the cards, the room beside the widest label between two cards (R24). */\nconst LABEL_ROOM = 24;\n/** A label's line past its first (§4). */\nexport const LABEL_LINE_H = 13;\n/** A label's width a character, mono 10 (§4). */\nconst LABEL_CHAR_W = 5.8;\n/** A label's padding across. */\nconst LABEL_PAD_W = 14;\n/** The steps a label takes across a segment, off its middle, each way (§4): 22 to 112px, 18 apart. */\nconst LABEL_STEPS: readonly number[] = [22, -22, 40, -40, 58, -58, 76, -76, 94, -94, 112, -112];\n\nexport interface Pt { x: number; y: number }\n\nexport interface NodeRect {\n    key: string;\n    x: number; y: number; w: number; h: number;\n    cx: number; cy: number;\n    /** Fixed handle points (centre of each edge). */\n    left: Pt; right: Pt; top: Pt; bottom: Pt;\n}\n\nexport type HandleSide = \"left\" | \"right\" | \"top\" | \"bottom\";\n\n/** One occupied connection point on a node border. */\nexport interface HandleInfo {\n    side: HandleSide;\n    pt: Pt;\n    /** Keys of the links converging at this handle. */\n    links: string[];\n}\n\nexport interface RouteSeg { a: Pt; b: Pt }\n\nexport interface LinkRoute {\n    key: string;\n    /** SVG path data (H/V runs joined by quarter-arc corners), trimmed to\n     * the handle-ring edges at both ends. */\n    d: string;\n    /** The in-handle the arrow terminates on (ring centre). */\n    end: Pt;\n    /** Straight segments (untrimmed; for anchors + hit testing). */\n    segs: RouteSeg[];\n    /** Midpoint of the longest straight run — diamond anchor. */\n    mid: Pt;\n    /** Handle-ring centres this route touches (out + in). */\n    ports: [Pt, Pt];\n    /** Its label's box, collision-resolved (R32); absent, it draws none. */\n    label?: LabelPlace;\n}\n\n/** A transition label's size (§4): its evidence line and its details' lines. */\nexport interface LabelBox { readonly w: number; readonly h: number }\n\n/** Where a transition's label stands: its box. */\nexport interface LabelPlace { x: number; y: number; w: number; h: number }\n\n/** One row states stand in, along the stacking axis — LR's y, TD's x. */\nexport interface LayoutRow {\n    /** Where it starts. */\n    readonly start: number;\n    /** How far it reaches: left to right, as tall as its tallest card; top down, the card's width. */\n    readonly size: number;\n}\n\nexport interface LaneBand {\n    key: string;\n    label: string;\n    x: number; y: number; w: number; h: number;\n    /** Alternating paper-2 tint per the spec. */\n    tinted: boolean;\n    /** Header anchor along the lane axis (LR: band centre x; TD: band top y). */\n    cx: number;\n}\n\nexport interface FlowchartLayout {\n    width: number;\n    height: number;\n    orientation: \"LR\" | \"TD\";\n    lanes: LaneBand[];\n    nodes: Map<string, NodeRect>;\n    routes: LinkRoute[];\n    /** Occupied connection points per node (idle handles are hidden). */\n    handles: Map<string, HandleInfo[]>;\n    /** \"+ STATE\" ghost cell per lane — the exact grid cell one row below\n     * that lane's last node (nothing shifts on commit). */\n    laneGhosts: Map<string, { x: number; y: number; w: number; h: number }>;\n    /** The dashed \"+ LANE\" affordance rect at the tail (full lane height,\n     * 14px insets) — drawn where the flowchart edits (#1247). */\n    laneTail: { x: number; y: number; w: number; h: number };\n    /** The rows states stand in along the stacking axis — LR's y, TD's x —\n     * then the row past the last, where a lane's \"+ STATE\" ghost stands after\n     * its last state: each row's start and size. A dropped state lands in one\n     * (#1249). */\n    rows: readonly LayoutRow[];\n    /** How far a row's cell reaches across its lane — left to right the card's\n     * width, top down the tallest card's height: what a state standing there\n     * takes. */\n    cellAcross: number;\n}\n\n/** A row of the layout's, its index kept to the rows it holds. */\nfunction rowOf(layout: FlowchartLayout, row: number): LayoutRow {\n    return layout.rows[Math.min(Math.max(row, 0), layout.rows.length - 1)]!;\n}\n\n/**\n * The cell a state stands in, at a row of a lane's band: the row's span,\n * across the lane's cards — what a state drawn there, or dropped there\n * (#1249), takes.\n *\n * @param layout - The laid-out flow\n * @param lane - The lane's band\n * @param row - The row, from the band's first\n * @returns The cell, in the canvas's px\n */\nexport function rowCell(layout: FlowchartLayout, lane: LaneBand, row: number): { x: number; y: number; w: number; h: number } {\n    const at = rowOf(layout, row);\n    const across = layout.cellAcross;\n    return layout.orientation === \"TD\"\n        ? { x: at.start, y: lane.y + lane.h / 2 - across / 2, w: at.size, h: across }\n        : { x: lane.x + lane.w / 2 - across / 2, y: at.start, w: across, h: at.size };\n}\n\n/**\n * Where the landing line runs for a state dropped at a row of a lane's band\n * (#1249): across the node's footprint, in the middle of the gap before that\n * row — the 16px under the lane's header before the first row, half the gap\n * between two rows before any other — between the state above it and the one\n * it lands before. Its thickness is the recipe's.\n *\n * @param layout - The laid-out flow\n * @param lane - The lane's band\n * @param row - The row the state lands in\n * @returns The line's start, and its length across the band — `w` in LR, `h` in TD; the other is 0\n */\nexport function landingSeam(layout: FlowchartLayout, lane: LaneBand, row: number): { x: number; y: number; w: number; h: number } {\n    const cell = rowCell(layout, lane, row);\n    const td = layout.orientation === \"TD\";\n    // The gap before the row, along the stacking axis: under the header, or between two rows.\n    const at = Math.min(Math.max(row, 0), layout.rows.length - 1);\n    const before = at === 0 ? LANE_HEADER_H : layout.rows[at - 1]!.start + layout.rows[at - 1]!.size;\n    const gap = layout.rows[at]!.start - before;\n    return td ? { x: cell.x - gap / 2, y: cell.y, w: 0, h: cell.h } : { x: cell.x, y: cell.y - gap / 2, w: cell.w, h: 0 };\n}\n\n/** Rounds to half-pixels for crisp 1px strokes. */\nconst px = (v: number): number => Math.round(v * 2) / 2;\n\nfunction nodeRect(x: number, y: number, w: number, h: number, key: string): NodeRect {\n    const cx = x + w / 2, cy = y + h / 2;\n    return {\n        key, x, y, w, h, cx, cy,\n        left: { x, y: cy }, right: { x: x + w, y: cy },\n        top: { x: cx, y }, bottom: { x: cx, y: y + h },\n    };\n}\n\n/**\n * Builds an H/V path with quarter-arc corners from an orthogonal point\n * run. Consecutive points must differ in exactly one axis. The corner\n * radius shrinks (to ≥ CORNER_R_MIN) when adjacent runs are short —\n * never to a sharp corner.\n */\nexport function roundedPath(points: Pt[]): { d: string; segs: RouteSeg[] } {\n    if (points.length < 2) return { d: \"\", segs: [] };\n    const segs: RouteSeg[] = [];\n    for (let i = 0; i < points.length - 1; i++) {\n        const a = points[i]!, b = points[i + 1]!;\n        segs.push({ a, b });\n    }\n    const first = points[0]!;\n    let d = `M${px(first.x)} ${px(first.y)}`;\n    for (let i = 1; i < points.length; i++) {\n        const prev = points[i - 1]!, cur = points[i]!;\n        const next = points[i + 1];\n        if (next === undefined) {\n            d += `L${px(cur.x)} ${px(cur.y)}`;\n            break;\n        }\n        // Corner at `cur`: shrink r to fit both adjacent runs.\n        const inLen = Math.abs(cur.x - prev.x) + Math.abs(cur.y - prev.y);\n        const outLen = Math.abs(next.x - cur.x) + Math.abs(next.y - cur.y);\n        const r = Math.max(CORNER_R_MIN, Math.min(CORNER_R, inLen / 2, outLen / 2));\n        const inDx = Math.sign(cur.x - prev.x), inDy = Math.sign(cur.y - prev.y);\n        const outDx = Math.sign(next.x - cur.x), outDy = Math.sign(next.y - cur.y);\n        d += `L${px(cur.x - inDx * r)} ${px(cur.y - inDy * r)}`;\n        d += `Q${px(cur.x)} ${px(cur.y)} ${px(cur.x + outDx * r)} ${px(cur.y + outDy * r)}`;\n    }\n    return { d, segs };\n}\n\n/** Trims the first and last runs by the handle-ring radius so the stroke\n * leaves from / the arrow tip butts into the ring edge. */\nfunction trimToRings(points: Pt[]): Pt[] {\n    if (points.length < 2) return points;\n    const out = points.map(p => ({ ...p }));\n    const a0 = out[0]!, a1 = out[1]!;\n    a0.x += Math.sign(a1.x - a0.x) * RING_R;\n    a0.y += Math.sign(a1.y - a0.y) * RING_R;\n    const z0 = out[out.length - 1]!, z1 = out[out.length - 2]!;\n    z0.x += Math.sign(z1.x - z0.x) * RING_R;\n    z0.y += Math.sign(z1.y - z0.y) * RING_R;\n    return out;\n}\n\n/** Midpoint of the longest straight run. */\nexport function longestRunMid(segs: readonly RouteSeg[]): Pt {\n    let best: RouteSeg | undefined;\n    let bestLen = -1;\n    for (const s of segs) {\n        const len = Math.abs(s.b.x - s.a.x) + Math.abs(s.b.y - s.a.y);\n        if (len > bestLen) { bestLen = len; best = s; }\n    }\n    if (!best) return { x: 0, y: 0 };\n    return { x: (best.a.x + best.b.x) / 2, y: (best.a.y + best.b.y) / 2 };\n}\n\n\n/** Outward normal per handle side. */\nconst NORMALS: Record<HandleSide, Pt> = {\n    left: { x: -1, y: 0 }, right: { x: 1, y: 0 }, top: { x: 0, y: -1 }, bottom: { x: 0, y: 1 },\n};\nconst ALL_SIDES: readonly HandleSide[] = [\"left\", \"right\", \"top\", \"bottom\"];\n\n/** Drops duplicate / colinear intermediate points from an orthogonal run. */\nfunction collapsePts(pts: Pt[]): Pt[] {\n    const out: Pt[] = [];\n    for (const p of pts) {\n        const n = out.length;\n        if (n > 0 && out[n - 1]!.x === p.x && out[n - 1]!.y === p.y) continue;\n        if (n > 1) {\n            const q = out[n - 2]!, r = out[n - 1]!;\n            if ((q.x === r.x && r.x === p.x) || (q.y === r.y && r.y === p.y)) { out[n - 1] = p; continue; }\n        }\n        out.push(p);\n    }\n    return out;\n}\n\n/** The CLOSEST FACING pair of handles between two node rects. */\nexport function selectPair(a: NodeRect, b: NodeRect): { sa: HandleSide; sb: HandleSide } {\n    let best: { sa: HandleSide; sb: HandleSide; d: number } | undefined;\n    for (const sa of ALL_SIDES) {\n        for (const sb of ALL_SIDES) {\n            const pa = a[sa], pb = b[sb];\n            const nA = NORMALS[sa], nB = NORMALS[sb];\n            const facesA = nA.x * (b.cx - pa.x) + nA.y * (b.cy - pa.y) > 0;\n            const facesB = nB.x * (a.cx - pb.x) + nB.y * (a.cy - pb.y) > 0;\n            if (!facesA || !facesB) continue;\n            const d = Math.abs(pa.x - pb.x) + Math.abs(pa.y - pb.y);\n            if (best === undefined || d < best.d) best = { sa, sb, d };\n        }\n    }\n    return best ?? { sa: \"right\", sb: \"left\" };\n}\n\n/** The orthogonal point run between a chosen handle pair (no channel\n * staggering — computeLayout overrides the mid run for that). */\nexport function pairPoints(a: NodeRect, b: NodeRect, sa: HandleSide, sb: HandleSide, mx?: number): Pt[] {\n    const outP = a[sa], inP = b[sb];\n    const n1 = NORMALS[sa], n2 = NORMALS[sb];\n    let pts: Pt[];\n    if (n1.x !== 0 && n2.x !== 0) {\n        const m = mx ?? (outP.x + inP.x) / 2;\n        pts = outP.y === inP.y ? [outP, inP] : [outP, { x: m, y: outP.y }, { x: m, y: inP.y }, inP];\n    } else if (n1.y !== 0 && n2.y !== 0) {\n        const my = (outP.y + inP.y) / 2;\n        pts = outP.x === inP.x ? [outP, inP] : [outP, { x: outP.x, y: my }, { x: inP.x, y: my }, inP];\n    } else if (n1.x !== 0) {\n        pts = [outP, { x: inP.x, y: outP.y }, inP];\n    } else {\n        pts = [outP, { x: outP.x, y: inP.y }, inP];\n    }\n    return collapsePts(pts);\n}\n\n/** The box a link's sides are chosen over (R23): the card's width and today's\n * 40, centred on the card — so a tall card's sides are a short one's. */\nfunction sideBox(r: NodeRect): NodeRect {\n    return nodeRect(r.x, r.cy - NODE_H / 2, r.w, NODE_H, r.key);\n}\n\n/** Spec-compliant DRAG PREVIEW between two nodes — the exact H/V route\n * (r 8 corners, ring-trimmed) the committed link would take. */\nexport function previewLinkPath(a: NodeRect, b: NodeRect): string {\n    const { sa, sb } = selectPair(sideBox(a), sideBox(b));\n    return roundedPath(trimToRings(pairPoints(a, b, sa, sb))).d;\n}\n\n/**\n * A transition label's box (§4): 18 high, and 13 for each line past its\n * first; as wide as its longest line, 5.8 a character and 14.\n *\n * @param lines - Its lines: its evidence line, then its details' (R32)\n * @returns Its size\n */\nexport function labelBox(lines: readonly string[]): LabelBox {\n    const longest = lines.reduce((n, line) => Math.max(n, line.length), 0);\n    return { w: longest * LABEL_CHAR_W + LABEL_PAD_W, h: BADGE_H + LABEL_LINE_H * Math.max(0, lines.length - 1) };\n}\n\n/** Spec-compliant DRAG PREVIEW from a handle to a free cursor point —\n * an orthogonal Z/L run instead of a diagonal rubber band. */\nexport function previewCursorPath(a: NodeRect, side: HandleSide, c: Pt): string {\n    const P1 = a[side];\n    const n = NORMALS[side];\n    let pts: Pt[];\n    if (n.x !== 0) {\n        const m = (P1.x + c.x) / 2;\n        pts = Math.abs(c.y - P1.y) < 2 ? [P1, c] : [P1, { x: m, y: P1.y }, { x: m, y: c.y }, c];\n    } else {\n        const m = (P1.y + c.y) / 2;\n        pts = Math.abs(c.x - P1.x) < 2 ? [P1, c] : [P1, { x: P1.x, y: m }, { x: c.x, y: m }, c];\n    }\n    pts = collapsePts(pts);\n    // trim only the start to the ring edge; the free end rides the cursor\n    if (pts.length >= 2) {\n        const p0 = pts[0]!, p1 = pts[1]!;\n        pts[0] = { x: p0.x + Math.sign(p1.x - p0.x) * RING_R, y: p0.y + Math.sign(p1.y - p0.y) * RING_R };\n    }\n    return roundedPath(pts).d;\n}\n\n/** A slot a link holds in the gap between two lanes, where a segment of it\n * goes along the gap. */\ninterface ChannelClaim {\n    /** The gap: gap g lies between lanes g − 1 and g. */\n    readonly gap: number;\n    /** Its slot in the gap, from the first claim's. */\n    slot: number;\n}\n\n/**\n * Gives each claim a slot of its own in its gap, in the order claimed, so\n * parallel segments sit ≥ 16px apart.\n *\n * @param claims - The claims, in order\n * @returns How many claims each gap holds\n */\nfunction planChannels(claims: readonly ChannelClaim[]): Map<number, number> {\n    const count = new Map<number, number>();\n    for (const claim of claims) {\n        claim.slot = count.get(claim.gap) ?? 0;\n        count.set(claim.gap, claim.slot + 1);\n    }\n    return count;\n}\n\n/** A box on the canvas: a card's, a label's, or one a label keeps off. */\nexport interface Rect { x: number; y: number; w: number; h: number }\n\nconst intersects = (a: Rect, b: Rect, pad: number): boolean =>\n    a.x - pad < b.x + b.w && a.x + a.w + pad > b.x && a.y - pad < b.y + b.h && a.y + a.h + pad > b.y;\n\n/** How much of one box another covers, in px². */\nconst overlapArea = (a: Rect, b: Rect): number =>\n    Math.max(0, Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x)) * Math.max(0, Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y));\n\n/** Whether an H/V segment passes through a card's inside: along its edge is outside it. */\nconst runCrosses = (a: Pt, b: Pt, r: Rect): boolean =>\n    Math.min(a.x, b.x) < r.x + r.w && Math.max(a.x, b.x) > r.x && Math.min(a.y, b.y) < r.y + r.h && Math.max(a.y, b.y) > r.y;\n\n/** A straight segment's length. */\nconst runLength = (s: RouteSeg): number => Math.abs(s.b.x - s.a.x) + Math.abs(s.b.y - s.a.y);\n\n/** Whether one tally is less than another, its first count first. */\nfunction tallyLess(a: readonly number[], b: readonly number[]): boolean {\n    for (let i = 0; i < a.length; i++) {\n        if (a[i]! < b[i]!) return true;\n        if (a[i]! > b[i]!) return false;\n    }\n    return false;\n}\n\n/**\n * Where a transition's label stands (R32): today's places — each segment,\n * longest first, at its middle, a third and two thirds, on a vertical segment\n * on the line and on a horizontal one above it — then the steps across each\n * segment off its middle, the longest first: the first clear of the cards,\n * the keep-outs and the labels placed. Where none is, the place tried that\n * covers least of the cards, then of the labels, then of the keep-outs.\n *\n * @param segs - The route's straight segments\n * @param size - The label's size\n * @param cards - The cards\n * @param keepOut - What else a label stays off: the lanes' headers, the handle rings and the diamonds\n * @param labels - The labels placed\n * @returns Its box\n */\nexport function placeLabel(segs: readonly RouteSeg[], size: LabelBox, cards: readonly Rect[], keepOut: readonly Rect[], labels: readonly Rect[]): LabelPlace {\n    const boxAt = (c: Pt): LabelPlace => ({ x: c.x - size.w / 2, y: c.y - size.h / 2, w: size.w, h: size.h });\n    const clear = (box: Rect): boolean => ![cards, keepOut, labels].some((of) => of.some((o) => intersects(box, o, 4)));\n    const vertical = (s: RouteSeg): boolean => Math.abs(s.b.x - s.a.x) < Math.abs(s.b.y - s.a.y);\n    const bySize = [...segs].sort((s1, s2) => runLength(s2) - runLength(s1));\n    const tried: LabelPlace[] = [];\n    for (const seg of bySize) {\n        for (const t of [0.5, 0.32, 0.68]) {\n            const cx = seg.a.x + (seg.b.x - seg.a.x) * t;\n            const cy = seg.a.y + (seg.b.y - seg.a.y) * t;\n            // Vertical segments carry the label ON the line; horizontal ones sit\n            // it just above, so it doesn't sever the stroke.\n            const box = boxAt(vertical(seg) ? { x: cx, y: cy } : { x: cx, y: cy - size.h / 2 - 4 });\n            if (clear(box)) return box;\n            tried.push(box);\n        }\n    }\n    for (const seg of bySize) {\n        const mid = { x: (seg.a.x + seg.b.x) / 2, y: (seg.a.y + seg.b.y) / 2 };\n        for (const off of LABEL_STEPS) {\n            const box = boxAt(vertical(seg) ? { x: mid.x + off, y: mid.y } : { x: mid.x, y: mid.y + off });\n            if (clear(box)) return box;\n            tried.push(box);\n        }\n    }\n    const cover = (box: Rect, of: readonly Rect[]): number => of.reduce((sum, o) => sum + overlapArea(box, o), 0);\n    let best: LabelPlace | undefined;\n    let least: readonly number[] = [];\n    for (const box of tried) {\n        const tally = [cover(box, cards), cover(box, labels), cover(box, keepOut)];\n        if (best === undefined || tallyLess(tally, least)) {\n            best = box;\n            least = tally;\n        }\n    }\n    return best ?? boxAt(longestRunMid(segs));\n}\n\nexport interface LayoutOptions {\n    /** Available width in px (the canvas grows beyond it if lanes need more). */\n    width: number;\n    orientation: \"LR\" | \"TD\";\n    /** Extra bottom padding reserving space for the legend overlay. */\n    legendPad?: number | undefined;\n    /** Minimum canvas height — lanes stretch to fill a pinned frame body. */\n    minHeight?: number | undefined;\n    /** Each lane's width in px, where a phone's window of lanes sets it; left out, the lanes fill `width`. Left to right only. */\n    laneWidth?: number | undefined;\n    /**\n     * The width of a phone's window that holds one lane, px, where the details\n     * draw on the cards (R40, D24): each lane at least that wide, so no other\n     * lane's card shows beside its own; a lane wider keeps its width, the\n     * card's and the room for labels. Left to right only.\n     */\n    laneWindow?: number | undefined;\n    /**\n     * The cards, where the details draw on them (R22): their width, and each\n     * one's height by its state's key — a key left out, a ghost's, is 40. Two\n     * cards side by side then keep the widest label's width and 24 between\n     * them (R24). Left out, every card is today's 116 × 40.\n     */\n    cards?: { readonly width: number; readonly heights: ReadonlyMap<string, number> } | undefined;\n    /** Each label's size, by its transition's key (R32): a transition left out draws none. Left out, each transition with evidence draws its evidence line. */\n    labels?: ReadonlyMap<string, LabelBox> | undefined;\n}\n\n/** How a route leaves its straight line where that line would cross a card, its sides kept. */\ntype Detour =\n    /** Sides facing across lanes: out to the gap past its own lane, along the gutter between rows, down the gap before the far lane. */\n    | { readonly kind: \"gutter\"; readonly claim: ChannelClaim; readonly at: number }\n    /** Ends facing in one lane: into the gutter past its card, along the gap beside the lane, back in the gutter before the far card. */\n    | { readonly kind: \"side\"; readonly claim: ChannelClaim; readonly from: number; readonly to: number }\n    /** Ends facing across lanes: the segment between them along a gutter. */\n    | { readonly kind: \"across\"; readonly at: number };\n\n/** A link as routed: its cards, its sides, the slot it holds in the gap before its far lane, and its detour. */\ninterface Routed {\n    readonly link: ModelLink;\n    readonly a: NodeRect;\n    readonly b: NodeRect;\n    readonly sa: HandleSide;\n    readonly sb: HandleSide;\n    /** Its slot in the gap before its far lane, where it goes between lanes; there its sides facing across turn. */\n    readonly far: ChannelClaim | undefined;\n    /** Whether its sides face across lanes, and turn in that gap. */\n    readonly turns: boolean;\n    readonly detour: Detour | undefined;\n}\n\n/**\n * The layout's sizes, worked out before anything is placed: what\n * {@link computeLayout} draws at, and what {@link layoutExtent} says of it —\n * from one place, so the two never drift.\n */\ninterface Sizing {\n    /** The card's width. */\n    readonly cardW: number;\n    /** A card's height, by its state's key. */\n    readonly cardH: (key: string) => number;\n    /** A card's logical extent along the lane axis, from its height. */\n    readonly mainOf: (h: number) => number;\n    /** A card's logical extent along the stacking axis, from its height. */\n    readonly crossOf: (h: number) => number;\n    /** Each label's size, by its transition's key: a transition left out draws none. */\n    readonly labelSizes: ReadonlyMap<string, LabelBox>;\n    /** The tallest card's height. */\n    readonly tallestCard: number;\n    readonly laneCount: number;\n    readonly rowCount: number;\n    /** The gap between two rows. */\n    readonly rowGap: number;\n    /** The rows, then the row past the last. */\n    readonly rows: readonly LayoutRow[];\n    /** A lane's width along the lane axis. */\n    readonly laneW: number;\n    /** The logical cross extent: LR's canvas height, TD's canvas width. */\n    readonly crossExtent: number;\n    /** The logical main extent: the lanes and the band row's tail. */\n    readonly mainExtent: number;\n    /** How far the bands reach along the stacking axis: left to right, under the legend too. */\n    readonly bandExtent: number;\n    /** The canvas's width. */\n    readonly width: number;\n    /** The canvas's height, the legend's room in it. */\n    readonly height: number;\n}\n\n/**\n * The layout's sizes (see {@link Sizing}).\n *\n * @param model - The view model\n * @param opts - What the layout is computed for\n * @returns Its sizes\n */\nfunction sizingOf(model: FlowchartModel, opts: LayoutOptions): Sizing {\n    const td = opts.orientation === \"TD\";\n\n    // ── Sizes: the cards' (R22) and the labels' (R32) ─────────────────────\n    const cardW = opts.cards?.width ?? NODE_W;\n    const cardH = (key: string): number => opts.cards?.heights.get(key) ?? NODE_H;\n    // Logical extents: main along the lane axis, cross along the stacking one.\n    const mainOf = (h: number): number => (td ? h : cardW);\n    const crossOf = (h: number): number => (td ? cardW : h);\n    const labelSizes = new Map<string, LabelBox>();\n    for (const l of model.links) {\n        const size = opts.labels !== undefined ? opts.labels.get(l.key) : l.badgeText === undefined ? undefined : labelBox([l.badgeText]);\n        if (size !== undefined) labelSizes.set(l.key, size);\n    }\n    const widest = [...labelSizes.values()].reduce((n, s) => Math.max(n, s.w), 0);\n    const tallestLabel = [...labelSizes.values()].reduce((n, s) => Math.max(n, s.h), BADGE_H);\n    const tallestCard = model.nodes.reduce((n, node) => Math.max(n, cardH(node.key)), NODE_H);\n    // Between two cards side by side: today's least, or — where the details draw on the cards — the widest label and 24 (R24).\n    const room = (least: number): number => (opts.cards === undefined ? least : Math.max(least, Math.round(widest) + LABEL_ROOM));\n\n    const laneCount = Math.max(model.lanes.length, 1);\n    const rowCount = Math.max(1, ...model.nodes.map(n => n.laneOrder + 1));\n\n    // ── Rows: left to right each as tall as its tallest card, 56 between them;\n    // top down the card's width, the room R24 keeps between them, which — as\n    // today — widens where the width allows ─────────────────────────────────\n    let rowGap = td ? room(TD_ROW_GAP) : ROW_GAP;\n    if (td) {\n        const avail = opts.width - LANE_HEADER_H - 16 - CANVAS_PAD_BOTTOM;\n        if (avail > rowCount * (cardW + rowGap)) rowGap = Math.min(Math.max(rowGap, TD_ROW_GAP_MOST), Math.floor(avail / rowCount) - cardW);\n    }\n    const rowSizes = Array.from({ length: rowCount + 1 }, () => crossOf(NODE_H));\n    for (const n of model.nodes) rowSizes[n.laneOrder] = Math.max(rowSizes[n.laneOrder]!, crossOf(cardH(n.key)));\n    const rows: LayoutRow[] = [];\n    for (let i = 0, start = LANE_HEADER_H + 16; i <= rowCount; i++) {\n        rows.push({ start, size: rowSizes[i]! });\n        start += rowSizes[i]! + rowGap;\n    }\n\n    // ── Lanes: left to right the card's width and the room beside it, at\n    // least today's 166, filling the width; top down the tallest card and 72,\n    // and 26 for each line a label adds (§4) ───────────────────────────────\n    // On a phone holding one lane, where the details draw on the cards, each lane at least the window's width (R40).\n    const laneMin = td ? tallestCard + TD_LANE_GAP + 2 * (tallestLabel - BADGE_H) : Math.max(cardW + room(LANE_GAP), opts.laneWindow ?? 0);\n    const laneSpan = td ? Number.POSITIVE_INFINITY : opts.width - LANE_TAIL_W;\n    const laneW = opts.laneWidth ?? Math.max(laneMin, Number.isFinite(laneSpan) ? Math.floor(laneSpan / laneCount) : laneMin);\n    // Logical cross extent (LR: canvas height; TD: canvas width).\n    let crossExtent = rows[rowCount]!.start + CANVAS_PAD_BOTTOM;\n    if (!td && opts.minHeight !== undefined) crossExtent = Math.max(crossExtent, opts.minHeight - (opts.legendPad ?? 0));\n    if (td) crossExtent = Math.max(crossExtent, opts.width);\n    const mainExtent = laneCount * laneW + LANE_TAIL_W;\n    // Bands span the FULL component (in LR that includes the legend strip —\n    // the legend floats over them, exactly as the spec sheet draws it).\n    const bandExtent = crossExtent + (td ? 0 : (opts.legendPad ?? 0));\n    return {\n        cardW, cardH, mainOf, crossOf, labelSizes, tallestCard, laneCount, rowCount, rowGap, rows, laneW, crossExtent, mainExtent, bandExtent,\n        width: td ? crossExtent : mainExtent,\n        height: (td ? mainExtent : crossExtent) + (opts.legendPad ?? 0),\n    };\n}\n\n/**\n * The layout's own size (R42): what {@link computeLayout} draws at with no\n * room to fill — no width for its lanes to stretch across or its rows to\n * widen into, and no height for its lanes to fill. A zoom's Fit scales it\n * into main.\n *\n * @param model - The view model\n * @param opts - What the layout is computed for, but the room it fills\n * @returns Its width and its height\n */\nexport function layoutExtent(model: FlowchartModel, opts: Omit<LayoutOptions, \"width\" | \"minHeight\">): { readonly width: number; readonly height: number } {\n    const { width, height } = sizingOf(model, { ...opts, width: 0, minHeight: undefined });\n    return { width, height };\n}\n\n/**\n * Computes the full layout. The algorithm works in LOGICAL space (lanes\n * along X, stacking along Y); for TD the finished geometry transposes\n * (the spec: \"TD orientation swaps the axes\") — logical right/bottom\n * out-handles become real bottom/right, cards stay upright.\n */\nexport function computeLayout(model: FlowchartModel, opts: LayoutOptions): FlowchartLayout {\n    const td = opts.orientation === \"TD\";\n    const tp = (p: Pt): Pt => (td ? { x: p.y, y: p.x } : p);\n    const {\n        cardW, cardH, mainOf, crossOf, labelSizes, tallestCard, laneCount, rowCount, rowGap, rows, laneW, crossExtent, mainExtent, bandExtent, width, height,\n    } = sizingOf(model, opts);\n    /** The middle of the gutter after a row: where a route passes between rows. */\n    const gutterAfter = (row: number): number => rows[row]!.start + rows[row]!.size + rowGap / 2;\n\n    const lanes: LaneBand[] = model.lanes.map((l, i) => {\n        const a = tp({ x: i * laneW, y: 0 });\n        const b = tp({ x: (i + 1) * laneW, y: bandExtent });\n        return {\n            key: l.key,\n            label: l.label,\n            x: Math.min(a.x, b.x), y: Math.min(a.y, b.y),\n            w: Math.abs(b.x - a.x), h: Math.abs(b.y - a.y),\n            tinted: i % 2 === 1,\n            cx: i * laneW + laneW / 2,\n        };\n    });\n\n    // Real node rects: each card its width and its own height, upright in both orientations.\n    const nodes = new Map<string, NodeRect>();\n    // Logical rects drive the router.\n    const logicalNodes = new Map<string, NodeRect>();\n    // The box each link's sides are chosen over (R23): the card's width and today's 40, centred on the card.\n    const sideBoxes = new Map<string, NodeRect>();\n    for (const n of model.nodes) {\n        const h = cardH(n.key);\n        const centre = Math.min(n.laneIndex, laneCount - 1) * laneW + laneW / 2;\n        const row = rows[n.laneOrder]!;\n        const middle = row.start + row.size / 2;\n        logicalNodes.set(n.key, nodeRect(centre - mainOf(h) / 2, middle - crossOf(h) / 2, mainOf(h), crossOf(h), n.key));\n        sideBoxes.set(n.key, nodeRect(centre - mainOf(NODE_H) / 2, middle - crossOf(NODE_H) / 2, mainOf(NODE_H), crossOf(NODE_H), n.key));\n        const p = tp({ x: centre - mainOf(h) / 2, y: middle - crossOf(h) / 2 });\n        nodes.set(n.key, nodeRect(p.x, p.y, cardW, h, n.key));\n    }\n\n    const realHeightHint = td ? mainExtent : crossExtent;\n    // \"+ STATE\" ghost cells — one per lane, parked one row below the lane's\n    // last node (or the first row when empty): the card's width and 40,\n    // centred in that row's slot. It has no row, so no reads.\n    const laneGhosts = new Map<string, { x: number; y: number; w: number; h: number }>();\n    for (let i = 0; i < model.lanes.length; i++) {\n        const count = model.nodes.reduce((n, node) => (node.laneIndex === i ? Math.max(n, node.laneOrder + 1) : n), 0);\n        const centre = i * laneW + laneW / 2;\n        const slot = rows[Math.min(count, rowCount)]!;\n        const p = tp({ x: centre - mainOf(NODE_H) / 2, y: slot.start + slot.size / 2 - crossOf(NODE_H) / 2 });\n        laneGhosts.set(model.lanes[i]!.key, { x: p.x, y: p.y, w: cardW, h: NODE_H });\n    }\n\n    /** Maps a LOGICAL side to the REAL side after transpose. */\n    const realSide = (side: HandleSide): HandleSide =>\n        !td ? side : side === \"left\" ? \"top\" : side === \"right\" ? \"bottom\" : side === \"top\" ? \"left\" : \"right\";\n\n    const handles = new Map<string, Map<HandleSide, string[]>>();\n    const occupy = (nodeKey: string, logicalSide: HandleSide, linkKey: string): void => {\n        let m = handles.get(nodeKey);\n        if (m === undefined) { m = new Map(); handles.set(nodeKey, m); }\n        const side = realSide(logicalSide);\n        const arr = m.get(side) ?? [];\n        arr.push(linkKey);\n        m.set(side, arr);\n    };\n\n    // ── Routes ────────────────────────────────────────────────────────────\n    /** Whether a path of points crosses a card other than its ends. */\n    const crossesCard = (pts: readonly Pt[], a: NodeRect, b: NodeRect): boolean => {\n        for (const rect of logicalNodes.values()) {\n            if (rect === a || rect === b) continue;\n            for (let i = 0; i < pts.length - 1; i++) if (runCrosses(pts[i]!, pts[i + 1]!, rect)) return true;\n        }\n        return false;\n    };\n    /** The gutters a detour may follow between two rows, nearest the first row first: between them, else either side of the one. */\n    const guttersBetween = (from: number, to: number): number[] => {\n        if (from < to) return Array.from({ length: to - from }, (_, i) => gutterAfter(from + i));\n        if (from > to) return Array.from({ length: from - to }, (_, i) => gutterAfter(from - 1 - i));\n        return from > 0 ? [gutterAfter(from), gutterAfter(from - 1)] : [gutterAfter(from)];\n    };\n    /** A gap's middle: the boundary of the lanes it lies between. */\n    const gapX = (gap: number): number => gap * laneW;\n    const gutterPts = (a: NodeRect, b: NodeRect, sa: HandleSide, sb: HandleSide, x1: number, x2: number, at: number): Pt[] => {\n        const outP = a[sa], inP = b[sb];\n        return collapsePts([outP, { x: x1, y: outP.y }, { x: x1, y: at }, { x: x2, y: at }, { x: x2, y: inP.y }, inP]);\n    };\n    const sidePts = (a: NodeRect, b: NodeRect, sa: HandleSide, sb: HandleSide, x: number, from: number, to: number): Pt[] => {\n        const outP = a[sa], inP = b[sb];\n        return collapsePts([outP, { x: outP.x, y: from }, { x, y: from }, { x, y: to }, { x: inP.x, y: to }, inP]);\n    };\n    const acrossPts = (a: NodeRect, b: NodeRect, sa: HandleSide, sb: HandleSide, at: number): Pt[] => {\n        const outP = a[sa], inP = b[sb];\n        return collapsePts([outP, { x: outP.x, y: at }, { x: inP.x, y: at }, inP]);\n    };\n\n    // Each link's sides over the boxes, and — where its straight line would cross a card — its detour.\n    const routed: Routed[] = [];\n    const detourClaims: ChannelClaim[] = [];\n    for (const l of model.links) {\n        const a = logicalNodes.get(l.from), b = logicalNodes.get(l.to);\n        if (!a || !b) continue;\n        const na = model.nodesByKey.get(l.from)!, nb = model.nodesByKey.get(l.to)!;\n        // A link joins the CLOSEST FACING pair of handles on its two nodes\n        // (spec: handles are direction-agnostic; the router picks the\n        // nearest pair and routes H/V between them), chosen over the boxes.\n        const { sa, sb } = selectPair(sideBoxes.get(l.from)!, sideBoxes.get(l.to)!);\n        const across = (s: HandleSide): boolean => s === \"left\" || s === \"right\";\n        // Every cross-lane link holds a slot in the gap before its far lane, as today.\n        const farGap = na.laneIndex === nb.laneIndex ? undefined : na.laneIndex < nb.laneIndex ? nb.laneIndex : nb.laneIndex + 1;\n        const far: ChannelClaim | undefined = farGap === undefined ? undefined : { gap: farGap, slot: 0 };\n        // Facing-horizontal cross-lane segments turn in that slot, so parallels sit >= 16px apart.\n        const turns = farGap !== undefined && sa !== sb && across(sa) && across(sb);\n        const straight = pairPoints(a, b, sa, sb, turns ? gapX(farGap) : undefined);\n        let detour: Detour | undefined;\n        if (crossesCard(straight, a, b)) {\n            if (turns) {\n                const nearGap = na.laneIndex < nb.laneIndex ? na.laneIndex + 1 : na.laneIndex;\n                const at = nearGap === farGap ? undefined\n                    : guttersBetween(na.laneOrder, nb.laneOrder).find((g) => !crossesCard(gutterPts(a, b, sa, sb, gapX(nearGap), gapX(farGap), g), a, b));\n                if (at !== undefined) detour = { kind: \"gutter\", claim: { gap: nearGap, slot: 0 }, at };\n            } else if (!across(sa) && !across(sb) && sa !== sb && na.laneOrder !== nb.laneOrder) {\n                const down = na.laneOrder < nb.laneOrder;\n                if (farGap === undefined) {\n                    // One lane: beside it, in the gap on its right — or on its left, the last lane's, before \"+ LANE\".\n                    const lane = na.laneIndex;\n                    const gap = lane + 1 < laneCount || lane === 0 ? lane + 1 : lane;\n                    const from = down ? gutterAfter(na.laneOrder) : gutterAfter(na.laneOrder - 1);\n                    const to = down ? gutterAfter(nb.laneOrder - 1) : gutterAfter(nb.laneOrder);\n                    if (!crossesCard(sidePts(a, b, sa, sb, gapX(gap), from, to), a, b)) detour = { kind: \"side\", claim: { gap, slot: 0 }, from, to };\n                } else {\n                    const at = guttersBetween(na.laneOrder, nb.laneOrder).find((g) => !crossesCard(acrossPts(a, b, sa, sb, g), a, b));\n                    if (at !== undefined) detour = { kind: \"across\", at };\n                }\n            }\n        }\n        if (detour !== undefined && detour.kind !== \"across\") detourClaims.push(detour.claim);\n        routed.push({ link: l, a, b, sa, sb, far, turns, detour });\n    }\n    // The slots: each gap's cross-lane links in their order, as today, then its detours.\n    const slots = planChannels([...routed.flatMap((r) => (r.far === undefined ? [] : [r.far])), ...detourClaims]);\n    const channelX = (claim: ChannelClaim): number => {\n        const spread = ((slots.get(claim.gap) ?? 1) - 1) * CHANNEL_GAP;\n        return gapX(claim.gap) - spread / 2 + claim.slot * CHANNEL_GAP;\n    };\n\n    const routes: LinkRoute[] = [];\n    for (const { link: l, a, b, sa, sb, far, turns, detour } of routed) {\n        const mx = turns && far !== undefined ? channelX(far) : undefined;\n        const pts = detour?.kind === \"gutter\" ? gutterPts(a, b, sa, sb, channelX(detour.claim), mx!, detour.at)\n            : detour?.kind === \"side\" ? sidePts(a, b, sa, sb, channelX(detour.claim), detour.from, detour.to)\n            : detour?.kind === \"across\" ? acrossPts(a, b, sa, sb, detour.at)\n            : pairPoints(a, b, sa, sb, mx);\n        occupy(l.from, sa, l.key);\n        occupy(l.to, sb, l.key);\n        const realPts = trimToRings(pts.map(tp));\n        const { d } = roundedPath(realPts);\n        // Anchor segs use the UNtrimmed run for stable midpoints.\n        const segs: RouteSeg[] = [];\n        const anchorPts = pts.map(tp);\n        for (let i = 0; i < anchorPts.length - 1; i++) segs.push({ a: anchorPts[i]!, b: anchorPts[i + 1]! });\n        routes.push({\n            key: l.key,\n            d,\n            end: tp(b[sb]),\n            segs,\n            mid: longestRunMid(segs),\n            ports: [tp(a[sa]), tp(b[sb])],\n        });\n    }\n\n    // ── Occupied handle points (real coords, ring centres on the border) ──\n    const handleInfos = new Map<string, HandleInfo[]>();\n    for (const [nodeKey, sides] of handles) {\n        const rect = nodes.get(nodeKey);\n        if (!rect) continue;\n        const infos: HandleInfo[] = [];\n        for (const [side, links] of sides) {\n            infos.push({ side, pt: rect[side], links });\n        }\n        handleInfos.set(nodeKey, infos);\n    }\n\n    // ── Collision-aware labels (R32) ──────────────────────────────────────\n    const cards: Rect[] = [...nodes.values()].map(r => ({ x: r.x, y: r.y, w: r.w, h: r.h }));\n    // The lane-header strip is a keep-out (labels never overlap the lanes' names).\n    const keepOut: Rect[] = [td ? { x: 0, y: 0, w: 108, h: realHeightHint } : { x: 0, y: 0, w: mainExtent, h: LANE_HEADER_H }];\n    // Handle rings are keep-outs too.\n    for (const infos of handleInfos.values()) {\n        for (const h of infos) keepOut.push({ x: h.pt.x - 6, y: h.pt.y - 6, w: 12, h: 12 });\n    }\n    // Diamond keep-outs at the midpoint of every triggered link's longest segment: the diamond keeps the middle, its label beside it.\n    const routeOf = new Map(routes.map((r) => [r.key, r] as const));\n    for (const l of model.links) {\n        const r = l.trigger === undefined ? undefined : routeOf.get(l.key);\n        if (r) keepOut.push({ x: r.mid.x - 14, y: r.mid.y - 14, w: 28, h: 28 });\n    }\n    const placed: Rect[] = [];\n    for (const l of model.links) {\n        const size = labelSizes.get(l.key);\n        const r = routeOf.get(l.key);\n        if (size === undefined || r === undefined) continue;\n        const box = placeLabel(r.segs, size, cards, keepOut, placed);\n        r.label = box;\n        placed.push(box);\n    }\n\n    // ── Tail affordance: full lane height, 14px insets (spec markup) ──────\n    const tailA = tp({ x: laneCount * laneW + 8, y: 14 });\n    const tailB = tp({ x: laneCount * laneW + LANE_TAIL_W - 8, y: bandExtent - 14 });\n\n    return {\n        width,\n        height,\n        orientation: opts.orientation,\n        lanes,\n        nodes,\n        routes,\n        handles: handleInfos,\n        laneGhosts,\n        laneTail: {\n            x: Math.min(tailA.x, tailB.x),\n            y: Math.min(tailA.y, tailB.y),\n            w: Math.abs(tailB.x - tailA.x),\n            h: Math.abs(tailB.y - tailA.y),\n        },\n        rows,\n        cellAcross: td ? tallestCard : cardW,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * When an element's scroll has come to rest: what a window that snaps to what\n * it holds waits for — a phone's pager settling on the nearer lane once a swipe\n * is let go.\n *\n * A browser says so with `scrollend`, where it has the event: then that alone\n * is heard. An older iPhone has none, in any browser on it, and would never\n * settle. There the scroll is at rest once it has not moved for\n * {@link SCROLL_REST_MS} with no finger on the page: a finger resting\n * mid-swipe holds the scroll, so nothing settles under it; its lift is a rest\n * of its own; and a scroll carried on by its own momentum goes on moving, so it\n * is waited out. The fingers on the page are the browser's own count\n * (`TouchEvent.touches`), read at each touch event, never kept: a lift the\n * page is never told of is forgotten at the next touch, and as the window\n * loses the page.\n *\n * @packageDocumentation\n */\n\n/** How long a scroll must stand still to have come to rest, where the browser never says it has (ms). */\nexport const SCROLL_REST_MS = 100;\n\n/**\n * Tells when an element's scroll has come to rest (see the module docs).\n *\n * @param element - The element that scrolls\n * @param rest - Called each time its scroll comes to rest\n * @returns What stops listening\n */\nexport function onScrollRest(element: HTMLElement, rest: () => void): () => void {\n    const win = element.ownerDocument.defaultView;\n    if (win === null) return () => undefined;\n    // Asked of the page as it is, never of its type: every browser's type has the event, and an older iPhone's page has none.\n    if (Reflect.has(win, \"onscrollend\")) {\n        element.addEventListener(\"scrollend\", rest, { passive: true });\n        return () => { element.removeEventListener(\"scrollend\", rest); };\n    }\n    let timer: number | undefined;\n    let fingers = 0;\n    const wait = (): void => {\n        if (timer !== undefined) win.clearTimeout(timer);\n        timer = win.setTimeout(() => {\n            timer = undefined;\n            if (fingers === 0) rest();\n        }, SCROLL_REST_MS);\n    };\n    const touched = (event: TouchEvent): void => {\n        fingers = event.touches.length;\n        // The last finger lifted: where it leaves the scroll is a rest, unless the scroll carries on.\n        if (fingers === 0) wait();\n    };\n    const left = (): void => { fingers = 0; };\n    const touches = [\"touchstart\", \"touchend\", \"touchcancel\"] as const;\n    element.addEventListener(\"scroll\", wait, { passive: true });\n    for (const type of touches) element.addEventListener(type, touched, { passive: true });\n    win.addEventListener(\"blur\", left);\n    return () => {\n        if (timer !== undefined) win.clearTimeout(timer);\n        timer = undefined;\n        element.removeEventListener(\"scroll\", wait);\n        for (const type of touches) element.removeEventListener(type, touched);\n        win.removeEventListener(\"blur\", left);\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A phone's lane pager (ruled 3 Nov 2026): a 44px band over the Flowchart's\n * canvas, as the Sheet's column pager is — the readout `Lanes 1–2 of 3`, and\n * ‹ › stepping the window a lane. The window is the canvas's own sideways\n * scroll: the pager reads where it rests and moves it — smoothly, at once\n * under reduced motion — so a swipe and a step are one window, and › reaches\n * what stands past the last lane, `+ LANE`, as a swipe does. A window that comes\n * to rest between two lanes — a swipe let go there — settles on the nearer, as a\n * step would: at rest as the browser says it (`scrollend`), and on an older\n * iPhone, which never does, once its scroll has stood still a moment\n * (`../shared/scroll-rest.ts`). A Find's pick opens on whole lanes (the canvas's). Where the\n * details draw on the cards a lane keeps its width, wider than the window, and\n * each step brings its card to the window's middle — the middle of what the\n * window shows, its scrollbar left out — as the window opens, as it resizes and\n * as a swipe settles too (R40, D24). Zoomed (R42), a lane is as wide as the\n * zoom draws it: the window holds as many whole lanes as fit, each step moves\n * a lane's zoomed width, and a lane is centred only while it is wider than the\n * window. Its looks are the Sheet's pager's, in the `sheet` recipe.\n *\n * @packageDocumentation\n */\n\nimport { memo, useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { Box, chakra } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faChevronLeft, faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { useSlotStyles } from \"@elaraai/east-ui-components/internal\";\nimport { onScrollRest } from \"../shared/scroll-rest.js\";\nimport type { FlowchartWords } from \"./messages.js\";\n\n/** Props of {@link FlowchartLanePager}. */\nexport interface FlowchartLanePagerProps {\n    /** The element the canvas scrolls in: the window it moves. */\n    frame: HTMLElement | null;\n    /** How many lanes the flow has. */\n    total: number;\n    /** How many whole lanes the window shows at once. */\n    inView: number;\n    /** A lane's width as drawn, at the zoom, px. */\n    slotPx: number;\n    /** Whether each step brings its lane's card to the window's middle while the lane is wider than the window — where the details draw on the cards; otherwise, and once the lane is no wider, each step brings a lane to the window's start. */\n    centred: boolean;\n    /** The flowchart's words. */\n    words: FlowchartWords;\n}\n\n/** Whether the viewer asks for less motion: the window then jumps. */\nfunction reducedMotion(): boolean {\n    return typeof window.matchMedia === \"function\" && window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n}\n\n/** Renders a phone's lane pager — see the module docs. */\nexport const FlowchartLanePager = memo(function FlowchartLanePager({ frame, total, inView, slotPx, centred, words }: FlowchartLanePagerProps) {\n    const styles = useSlotStyles(\"sheet\");\n    const last = Math.max(0, total - inView);\n    // What the window shows across, its scrollbar left out: read as it opens and each time it resizes.\n    const [shows, setShows] = useState(0);\n    useLayoutEffect(() => {\n        if (frame === null || !centred) return undefined;\n        const measure = () => setShows(frame.clientWidth);\n        measure();\n        const observer = new ResizeObserver(measure);\n        observer.observe(frame);\n        return () => observer.disconnect();\n    }, [frame, centred]);\n    // Where the window rests on a lane: past its start by half what the lane is wider than what the window shows, so its card\n    // stands in the middle — at its start where the lane is no wider, zoomed out.\n    const offset = centred && shows > 0 ? Math.max(0, Math.round((slotPx - shows) / 2)) : 0;\n    // The first lane in view, and whether the view is at the canvas's end: where the window rests, read off the canvas as it scrolls.\n    const [first, setFirst] = useState(0);\n    const [atEnd, setAtEnd] = useState(false);\n    useEffect(() => {\n        if (frame === null || slotPx <= 0) return undefined;\n        const read = () => {\n            setFirst(Math.min(last, Math.max(0, Math.round((frame.scrollLeft - offset) / slotPx))));\n            setAtEnd(frame.scrollLeft + frame.clientWidth >= frame.scrollWidth - 1);\n        };\n        // At rest between two lanes it settles on the nearer — its card in the middle where a lane is wider than the window —\n        // never at the canvas's end, which stands past the last lane's start.\n        const settle = () => {\n            const at = Math.max(0, Math.round((frame.scrollLeft - offset) / slotPx)) * slotPx + offset;\n            if (Math.abs(frame.scrollLeft - at) > 1 && frame.scrollLeft + frame.clientWidth < frame.scrollWidth - 1) {\n                frame.scrollTo({ left: at, behavior: reducedMotion() ? \"auto\" : \"smooth\" });\n            }\n        };\n        read();\n        frame.addEventListener(\"scroll\", read, { passive: true });\n        const stop = onScrollRest(frame, settle);\n        return () => {\n            frame.removeEventListener(\"scroll\", read);\n            stop();\n        };\n    }, [frame, slotPx, offset, last]);\n    // A lane wider than the window: its card to the window's middle as the window opens, and on the lane it rests on as it resizes.\n    const rested = useRef<{ slotPx: number; offset: number } | undefined>(undefined);\n    useLayoutEffect(() => {\n        if (frame === null || slotPx <= 0) return;\n        const was = rested.current;\n        rested.current = { slotPx, offset };\n        if (offset === 0 && (was === undefined || was.offset === 0)) return;\n        const lane = was === undefined ? 0 : Math.min(last, Math.max(0, Math.round((frame.scrollLeft - was.offset) / was.slotPx)));\n        frame.scrollLeft = lane * slotPx + offset;\n    }, [frame, slotPx, offset, last]);\n    // The canvas's end holds it past the last lane's start; the browser stops the scroll there.\n    const go = (to: number) => {\n        if (frame !== null) frame.scrollTo({ left: Math.max(0, Math.max(0, to) * slotPx + offset), behavior: reducedMotion() ? \"auto\" : \"smooth\" });\n    };\n    // Past the last lane's start, at what stands after it: a step back comes to that lane first.\n    const pastLast = atEnd && frame !== null && frame.scrollLeft > first * slotPx + offset + 1;\n    const from = words.number(first + 1);\n    const to = words.number(Math.min(total, first + inView));\n    const range = inView === 1 ? from : `${from}–${to}`;\n    return (\n        <Box css={styles.pager} data-slot=\"pager\" data-flowchart-lane-pager=\"\">\n            <Box as=\"span\" css={styles.pagerReadout} data-slot=\"pagerReadout\" role=\"status\">{words.m.lanePager({ range, total: words.number(total) })}</Box>\n            <chakra.button type=\"button\" css={styles.pagerStep} data-slot=\"pagerPrevious\" aria-label={words.m.laneStep({ more: false })}\n                aria-disabled={first <= 0 && !pastLast ? true : undefined} onClick={() => { go(pastLast ? first : first - 1); }}>\n                <FontAwesomeIcon icon={faChevronLeft} />\n            </chakra.button>\n            <chakra.button type=\"button\" css={styles.pagerStep} data-slot=\"pagerNext\" aria-label={words.m.laneStep({ more: true })}\n                aria-disabled={atEnd ? true : undefined} onClick={() => { if (!atEnd) go(first >= last ? total : first + 1); }}>\n                <FontAwesomeIcon icon={faChevronRight} />\n            </chakra.button>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Flowchart connect-gesture helpers — pure, React-free, unit-tested\n * (the Schematic pattern: geometry/derivation split out of the\n * composition root so the interactive seams stay small and reliable).\n */\n\nimport type { FlowchartModel } from \"./model.js\";\nimport type { FlowchartLayout, HandleSide, NodeRect, Pt } from \"./layout.js\";\n\n/** Drop tolerance around a node's rect — releasing anywhere over the\n * node (or this close to it) lands the connection; nobody should have\n * to hit a 7px ring. */\nexport const DROP_PAD = 14;\n\n/** The node whose padded rect contains `p` (last match wins — matches\n * paint order), excluding the drag source. */\nexport function dropTargetAt(layout: FlowchartLayout, p: Pt, exclude?: string): string | null {\n    let hit: string | null = null;\n    for (const [key, r] of layout.nodes) {\n        if (key === exclude) continue;\n        if (p.x >= r.x - DROP_PAD && p.x <= r.x + r.w + DROP_PAD\n            && p.y >= r.y - DROP_PAD && p.y <= r.y + r.h + DROP_PAD) hit = key;\n    }\n    return hit;\n}\n\n/** The existing same-direction link between two nodes, if any — a drop\n * that would duplicate it is absorbed (the existing link pulses instead).\n * The reverse direction stays legal: back-links are semantically distinct. */\nexport function existingLink(model: FlowchartModel, from: string, to: string): string | undefined {\n    return model.links.find(l => l.from === from && l.to === to)?.key;\n}\n\n/** The handle point of `rect` nearest to `p` — the draft line's snap\n * target while hovering a valid drop. */\nexport function nearestHandle(rect: NodeRect, p: Pt): Pt {\n    const sides: readonly HandleSide[] = [\"left\", \"right\", \"top\", \"bottom\"];\n    let best: Pt = rect.left;\n    let bd = Number.POSITIVE_INFINITY;\n    for (const s of sides) {\n        const h = rect[s];\n        const d = Math.abs(h.x - p.x) + Math.abs(h.y - p.y);\n        if (d < bd) { bd = d; best = h; }\n    }\n    return best;\n}\n\n/** The lane band containing `p` — the move-drag's highlight/drop target. */\nexport function laneAt(layout: FlowchartLayout, p: Pt): string | null {\n    for (const lane of layout.lanes) {\n        if (p.x >= lane.x && p.x <= lane.x + lane.w && p.y >= lane.y && p.y <= lane.y + lane.h) return lane.key;\n    }\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The flowchart's gestures, as the rows each changes (#1503, `Flowchart\n * Records Spec.md` R8–R10, R13, D2, D6) — pure and React-free: each gesture\n * over what the flowchart holds, its drafts in place, as the edits\n * `editing.ts` records — one step of the history across the records it\n * touches. Each writes its roles' fields alone, every other field as it was\n * (R8).\n *\n * - **+ LANE** adds a lane keyed `lane-<n>` and labelled `Lane <n>`, `n` the\n *   first number past the lanes' count whose key no lane takes, its order one\n *   past the last; a lane's rename writes its label; × deletes a lane, offered\n *   while no state the flowchart holds stands in it.\n * - **+ STATE** adds a state from its lane's editor: its key and its label, its\n *   lane, its order one past the lane's last. A move writes its lane and its\n *   order, the middle of the two cards it lands between; a rename its label;\n *   Duplicate adds the row after itself under its key made unique (`-2`, `-3`,\n *   …).\n * - **Connect** adds a transition keyed unique and never drawn: its ends, every\n *   other field its type's default. The inspector writes a transition's ends\n *   and its decision.\n * - **Del** of a state deletes it, every transition the flowchart holds naming\n *   it — those it draws, and those hidden with their far end — and its key from\n *   each decision's queue; several states are one step (D6). A transition the\n *   narrowing hides that names it is left. A decision's Del clears it from the\n *   transitions the flowchart holds.\n * - **A card dropped** adds a state from its values where it lands, keyed\n *   `state-<n>`, its order between the cards it lands between; gives a\n *   transition its values, its ends and its key kept; adds a lane from its\n *   values where it lands, keyed `lane-<n>`, its order between the lanes'.\n * - **A new row's key**, changed in the form before Save, moves the row to it,\n *   and the transitions naming a state and the decisions queuing it, or the\n *   states naming a lane, follow (R9).\n * - **A new row's key is its kind's** (#1549, `editing.ts`' `newKey`): the\n *   text above where it is keyed by String; built from the row by its kind's\n *   `key`, a gesture refused that builds one a row holds; one past the largest\n *   by Integer; and by any other type a placeholder, made up as the text above,\n *   until the viewer types it — a gesture naming that row in another row's\n *   field refused until then. A kind whose key type the form can't type, and\n *   that builds none, adds no row: the gesture says why.\n * - **A key built from the row follows the row** (#1549, `followBuiltKeys`):\n *   a gesture writing the fields its kind's `key` reads moves the row under the\n *   key they build, and what names the row follows — refused, naming the row,\n *   where another row holds that key once the gesture is made, so a swap or a\n *   shift passes (#1581), and while a kind that may name it isn't held whole\n *   (#1580): the rail hides some of its rows, or it takes no edit now — a Save\n *   in flight — so what it leaves would keep the old key.\n *\n * A kind read only takes no gesture of its own (R13). Where a gesture reaches\n * past its own kind — the transitions a state's Del deletes, the queues it\n * leaves, the transitions a decision's Del clears — a kind read only is left\n * as it is, and Issues lists what it names that is gone.\n *\n * An order written between two rows is the middle of theirs; at an end, one\n * past the last or one before the first. A lane's Integer order takes a whole\n * number alone: between two a whole number apart, the lanes after it move one\n * along, in the same step.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, none, some } from \"@elaraai/east\";\nimport type { Origin } from \"@elaraai/east-ui-components\";\nimport type { FlowchartEdit, FlowchartFieldWrites, FlowchartMove, FlowchartNewKey, FlowchartTransitionWrite } from \"./editing.js\";\nimport type { FlowchartWaiting } from \"./drafted.js\";\nimport type { FlowchartModel, FlowchartRow, FlowchartRows, FlowchartTransitionRoles, ModelNode } from \"./model.js\";\nimport type { FlowchartSort } from \"./read.js\";\n\nconst keyEqual = equalFor(StringType);\n\n/** The gestures the flowchart takes, each one step of the history. */\nexport type FlowchartGesture =\n    | \"addLane\" | \"renameLane\" | \"deleteLane\"\n    | \"addState\" | \"renameState\" | \"moveStates\" | \"deleteStates\" | \"duplicateState\"\n    | \"connect\" | \"editLink\" | \"deleteLink\" | \"deleteDecision\"\n    | \"dropCard\" | \"form\" | \"details\" | \"rekey\";\n\n/** The gesture each is recorded as, in the history and its patch events. */\nexport const EDIT_ORIGIN: { readonly [G in FlowchartGesture]: Origin } = {\n    addLane: \"insert\",\n    renameLane: \"typed\",\n    deleteLane: \"remove\",\n    addState: \"insert\",\n    renameState: \"typed\",\n    moveStates: \"move\",\n    deleteStates: \"remove\",\n    duplicateState: \"insert\",\n    connect: \"insert\",\n    editLink: \"typed\",\n    deleteLink: \"remove\",\n    deleteDecision: \"remove\",\n    dropCard: \"drop\",\n    form: \"typed\",\n    details: \"row\",\n    rekey: \"typed\",\n};\n\n/** What a gesture reads: what the flowchart draws, its rows, and what each kind takes. */\nexport interface FlowchartHolding {\n    /** What the flowchart draws. */\n    readonly model: FlowchartModel;\n    /** The rows it draws, the drafts in place. */\n    readonly rows: FlowchartRows;\n    /** The transitions it holds but does not draw, hidden with their far end, their drafts in place. */\n    readonly hidden: readonly FlowchartRow<FlowchartTransitionRoles>[];\n    /** The drafted rows the narrowing hides, waiting in their sessions. */\n    readonly waiting: readonly FlowchartWaiting[];\n    /**\n     * Whether a kind takes a gesture now.\n     *\n     * @param sort - The kind\n     */\n    readonly can: (sort: FlowchartSort) => boolean;\n    /**\n     * Whether the flowchart holds a key of a kind already.\n     *\n     * @param sort - The kind\n     * @param key - The key\n     */\n    readonly taken: (sort: FlowchartSort, key: string) => boolean;\n    /**\n     * Whether a row of a kind stands under a key (#1549): one a draft deletes stands free.\n     *\n     * @param sort - The kind\n     * @param key - The key\n     */\n    readonly stands: (sort: FlowchartSort, key: string) => boolean;\n    /**\n     * A new transition's key, unique among the transitions' and those given.\n     *\n     * @param minted - The keys the gesture has minted already\n     */\n    readonly mintTransition: (minted: ReadonlySet<string>) => string;\n    /** Whether the decisions queue states by their keys: a state's Del takes its key out, and its move to a new key takes it there. */\n    readonly unqueues: boolean;\n    /** Whether the lanes' order takes a whole number alone: an Integer field. */\n    readonly wholeLaneOrders: boolean;\n    /**\n     * A new row's key, as its kind makes one (#1549; `editing.ts`' `newKey`).\n     *\n     * @param sort - The row's kind\n     * @param made - The edit making the row, under any key\n     * @param madeUp - The text the gesture makes up, unique by what it is told is taken\n     * @param minted - The keys the gesture has made already\n     */\n    readonly newKey: (sort: FlowchartSort, made: FlowchartEdit, madeUp: (taken: (key: string) => boolean) => string,\n        minted?: ReadonlySet<string>) => FlowchartNewKey | undefined;\n    /**\n     * The rows a gesture moves under the keys their fields build once it writes them (#1549; `editing.ts`' `moves`).\n     *\n     * @param edits - The gesture's edits\n     */\n    readonly moves: (edits: readonly FlowchartEdit[]) => FlowchartMove[];\n    /**\n     * Why the flowchart may not hold every row of a kind it writes (#1580): the rail hides some, or the kind takes no edit\n     * now — a Save in flight, or its rows not read; `undefined` where it holds them all, or writes none of the kind.\n     *\n     * @param sort - The kind\n     */\n    readonly unheld: (sort: FlowchartSort) => FlowchartUnheld | undefined;\n    /**\n     * Whether a gesture created a row this session: no stored row names it (#1580).\n     *\n     * @param sort - The row's kind\n     * @param key - Its key\n     */\n    readonly created: (sort: FlowchartSort, key: string) => boolean;\n}\n\n/** Why the flowchart may not hold every row of a kind (#1580): the rail hides some, or the kind takes no edit now. */\nexport type FlowchartUnheld = \"filtered\" | \"busy\";\n\n/** Why a gesture records nothing (#1549), as the footer says it. */\nexport type FlowchartRefusal =\n    /** The key a row builds is held already, by the row of that key. */\n    | { readonly refusal: \"taken\"; readonly sort: FlowchartSort; readonly key: string }\n    /** It names a row held under a placeholder, in another row's field: that row's key is still to be typed. */\n    | { readonly refusal: \"placeholder\"; readonly sort: FlowchartSort; readonly key: string }\n    /** Its kind's keys are of a type the form can't type, by the type's name, and its kind builds none. */\n    | { readonly refusal: \"untyped\"; readonly sort: FlowchartSort; readonly type: string }\n    /**\n     * A row whose key the gesture moves, which rows of another kind name — by that kind (`by`) — that the flowchart doesn't\n     * all hold, and why (#1580): what it leaves out would keep naming the old key.\n     */\n    | { readonly refusal: \"unheld\"; readonly sort: FlowchartSort; readonly key: string; readonly by: FlowchartSort; readonly why: FlowchartUnheld };\n\n/** One gesture's edits, and the key of the row it adds, if it adds one. */\nexport interface GestureEdits {\n    /** The rows it changes. */\n    readonly edits: readonly FlowchartEdit[];\n    /** The key of the row it adds. */\n    readonly key?: string | undefined;\n    /** Why it records nothing, as the footer says it (#1549): its edits none. */\n    readonly refused?: FlowchartRefusal | undefined;\n    /** The rows it moves under the keys their fields now build (#1549): where what is selected follows them. */\n    readonly moved?: readonly FlowchartMove[] | undefined;\n}\n\n/** A gesture refused, saying why. */\nfunction refusedFor(refusal: FlowchartRefusal): GestureEdits {\n    return { edits: [], refused: refusal };\n}\n\n/** Whether a key of a kind is a placeholder's — a new row's whose key is still to be typed (#1549). */\nfunction placeholderOf(holding: FlowchartHolding, sort: FlowchartSort, key: string): boolean {\n    return !holding.model.keys[sort].isKey(key);\n}\n\n/**\n * A new row's key, as its kind makes it (#1549), or why the gesture records\n * nothing.\n *\n * @param holding - What the gesture reads\n * @param sort - The row's kind\n * @param made - The edit making the row, under any key\n * @param madeUp - The text the gesture makes up, unique by what it is told is taken\n * @returns The key, or the refusal; `undefined` while the key is still to be read\n */\nfunction newRowKey(holding: FlowchartHolding, sort: FlowchartSort, made: FlowchartEdit,\n    madeUp: (taken: (key: string) => boolean) => string): { readonly key: string } | { readonly refused: FlowchartRefusal } | undefined {\n    const keyed = holding.newKey(sort, made, madeUp);\n    if (keyed === undefined) return undefined;\n    if (\"taken\" in keyed) return { refused: { refusal: \"taken\", sort, key: keyed.taken } };\n    if (\"untyped\" in keyed) return { refused: { refusal: \"untyped\", sort, type: keyed.untyped } };\n    return keyed;\n}\n\n/**\n * A key no row of its kind takes: the key wanted, else that key with `-2`,\n * `-3`, … after it.\n *\n * @param wanted - The key wanted\n * @param taken - Whether a row takes a key\n * @returns The key\n */\nexport function uniqueKey(wanted: string, taken: (key: string) => boolean): string {\n    if (!taken(wanted)) return wanted;\n    for (let n = 2; ; n++) {\n        const key = `${wanted}-${n}`;\n        if (!taken(key)) return key;\n    }\n}\n\n/**\n * A key numbered for a new row: `<prefix>-<n>`, `n` the first number from\n * `from` whose key no row takes — as + LANE keys a lane `lane-<n>`.\n *\n * @param prefix - What the row is: `lane`, `state`\n * @param from - The first number tried: one past the rows' count\n * @param taken - Whether a row takes a key\n * @returns The key, and its number\n */\nexport function numberedKey(prefix: string, from: number, taken: (key: string) => boolean): { key: string; n: number } {\n    let n = from;\n    while (taken(`${prefix}-${n}`)) n++;\n    return { key: `${prefix}-${n}`, n };\n}\n\n/** A row as it is placed among its neighbours: its key, and its order — `undefined` for a kind with none. */\nexport interface Placed {\n    /** Its key. */\n    readonly key: string;\n    /** Its order. */\n    readonly order: number | undefined;\n}\n\n/** Where a row lands among its neighbours: its order, and the neighbours after it that move one along. */\nexport interface Placement {\n    /** Its order. */\n    readonly order: number;\n    /** The neighbours after it that move along to make room, each with its new order: a whole order's alone. */\n    readonly shifts: readonly Placed[];\n}\n\n/**\n * The order of a row landing among its neighbours: the middle of the two it\n * lands between; at an end, one past the last or one before the first; among\n * none, 1. A whole order between two a whole number apart is one past the\n * first, and the neighbours after it move one along, as far as they need.\n *\n * @param rows - Its neighbours, in their order: the row itself left out\n * @param at - Where it lands among them: 0 before the first, `rows.length` after the last\n * @param whole - Whether the order takes a whole number alone\n * @returns Its order, and the neighbours that move\n */\nexport function between(rows: readonly Placed[], at: number, whole: boolean): Placement {\n    const prev = at > 0 ? rows[at - 1]?.order : undefined;\n    const next = at < rows.length ? rows[at]?.order : undefined;\n    if (prev !== undefined && next !== undefined) {\n        if (!whole) return { order: (prev + next) / 2, shifts: [] };\n        const gap = next - prev;\n        if (gap >= 2) return { order: prev + Math.floor(gap / 2), shifts: [] };\n        // No whole number between: one past the first, and the rows after it along by one as far as they meet it.\n        const order = prev + 1;\n        const shifts: Placed[] = [];\n        let last = order;\n        for (let i = at; i < rows.length; i++) {\n            const held = rows[i]!.order;\n            if (held === undefined || held > last) break;\n            last += 1;\n            shifts.push({ key: rows[i]!.key, order: last });\n        }\n        return { order, shifts };\n    }\n    if (prev !== undefined) return { order: prev + 1, shifts: [] };\n    if (next !== undefined) return { order: next - 1, shifts: [] };\n    return { order: 1, shifts: [] };\n}\n\n/**\n * Orders for several rows landing together among their neighbours, in the\n * order given, evenly between the two they land between: a state's Float\n * order.\n *\n * @param rows - Their neighbours, in their order: the rows themselves left out\n * @param at - Where they land among them\n * @param count - How many land\n * @returns Each one's order\n */\nfunction spread(rows: readonly Placed[], at: number, count: number): number[] {\n    const prev = at > 0 ? rows[at - 1]?.order : undefined;\n    const next = at < rows.length ? rows[at]?.order : undefined;\n    return Array.from({ length: count }, (_, i) => {\n        if (prev !== undefined && next !== undefined) return prev + ((next - prev) * (i + 1)) / (count + 1);\n        if (prev !== undefined) return prev + i + 1;\n        if (next !== undefined) return next - (count - i);\n        return i + 1;\n    });\n}\n\n/**\n * The states a band draws, in its order — its ghosts left out.\n *\n * @param model - What the flowchart draws\n * @param band - The band's place among the model's lanes\n * @param leave - The states left out besides: those a move lifts\n * @returns The states\n */\nfunction bandStates(model: FlowchartModel, band: number, leave: ReadonlySet<string> = NO_KEYS): ModelNode[] {\n    return model.nodes\n        .filter((node) => node.laneIndex === band && !node.ghost && !leave.has(node.key))\n        .sort((a, b) => a.laneOrder - b.laneOrder);\n}\n\n/** No key. */\nconst NO_KEYS: ReadonlySet<string> = new Set<string>();\n\n/**\n * The band a gesture lands in, as a state's lane names it: a lane of the\n * app's by its key; the one band of a flowchart given no lanes, none. No lane\n * takes no gesture.\n *\n * @param model - What the flowchart draws\n * @param band - The band's key\n * @returns Its place and the lane it writes; `undefined` for No lane, or a band the model has not\n */\nfunction landing(model: FlowchartModel, band: string): { index: number; lane: ReturnType<typeof some<string>> | typeof none } | undefined {\n    const index = model.lanes.findIndex((lane) => keyEqual(lane.key, band));\n    const lane = model.lanes[index];\n    if (lane === undefined || lane.band === \"noLane\") return undefined;\n    return { index, lane: lane.band === \"lane\" ? some(lane.key) : none };\n}\n\n/** Every transition the flowchart holds, its drafts in place: those drawn, and those hidden with their far end. */\nfunction heldTransitions(holding: FlowchartHolding): FlowchartRow<FlowchartTransitionRoles>[] {\n    return [...holding.rows.transitions, ...holding.hidden];\n}\n\n// ── Lanes ────────────────────────────────────────────────────────────────────\n\n/** The lanes of the app's, as the band row draws them. */\nfunction appLanes(model: FlowchartModel): Placed[] {\n    return model.lanes.filter((lane) => lane.band === \"lane\").map((lane) => ({ key: lane.key, order: lane.order }));\n}\n\n/**\n * + LANE: a lane at the end of the band row, keyed `lane-<n>`, labelled for\n * `n`, its order one past the last.\n *\n * @param holding - What the gesture reads\n * @param label - The new lane's label, for its number (`Lane 6`)\n * @returns Its edits and its key; `undefined` while the lanes take no gesture\n */\nexport function addLane(holding: FlowchartHolding, label: (n: number) => string): GestureEdits | undefined {\n    if (!holding.can(\"lanes\")) return undefined;\n    const lanes = appLanes(holding.model);\n    const { n } = numberedKey(\"lane\", lanes.length + 1, (k) => holding.taken(\"lanes\", k));\n    const { order } = between(lanes, lanes.length, holding.wholeLaneOrders);\n    const write = { label: some(label(n)), order: some(order) };\n    const made = newRowKey(holding, \"lanes\", { op: \"createLane\", key: \"\", write, values: none },\n        (taken) => numberedKey(\"lane\", lanes.length + 1, taken).key);\n    if (made === undefined || \"refused\" in made) return made === undefined ? undefined : refusedFor(made.refused);\n    return { edits: [{ op: \"createLane\", key: made.key, write, values: none }], key: made.key };\n}\n\n/**\n * A lane card dropped on the band row: a lane from its values where it lands,\n * keyed `lane-<n>`, its order between the lanes it lands between.\n *\n * @param holding - What the gesture reads\n * @param at - Where it lands among the lanes: 0 before the first, their count at the band row's tail\n * @param values - The card's values\n * @returns Its edits and its key; `undefined` while the lanes take no gesture\n */\nexport function dropLane(holding: FlowchartHolding, at: number, values: Uint8Array): GestureEdits | undefined {\n    if (!holding.can(\"lanes\")) return undefined;\n    const lanes = appLanes(holding.model);\n    const { order, shifts } = between(lanes, Math.max(0, Math.min(at, lanes.length)), holding.wholeLaneOrders);\n    const write = { label: none, order: some(order) };\n    const made = newRowKey(holding, \"lanes\", { op: \"createLane\", key: \"\", write, values: some(values) },\n        (taken) => numberedKey(\"lane\", lanes.length + 1, taken).key);\n    if (made === undefined || \"refused\" in made) return made === undefined ? undefined : refusedFor(made.refused);\n    return {\n        edits: [\n            { op: \"createLane\", key: made.key, write, values: some(values) },\n            ...shifts.map((shift): FlowchartEdit => ({ op: \"writeLane\", key: shift.key, write: { label: none, order: some(shift.order!) } })),\n        ],\n        key: made.key,\n    };\n}\n\n/**\n * A lane's rename: its label.\n *\n * @param holding - What the gesture reads\n * @param key - The lane's key\n * @param label - Its new label\n * @returns Its edits; `undefined` while the lanes take no gesture\n */\nexport function renameLane(holding: FlowchartHolding, key: string, label: string): GestureEdits | undefined {\n    if (!holding.can(\"lanes\")) return undefined;\n    return { edits: [{ op: \"writeLane\", key, write: { label: some(label), order: none } }] };\n}\n\n/**\n * × on a lane: offered while no state the flowchart holds stands in it, whose\n * states would have no lane to stand in.\n *\n * @param holding - What the gesture reads\n * @param key - The lane's key\n * @returns Its edits; `undefined` while the lane holds a state, or the lanes take no gesture\n */\nexport function deleteLane(holding: FlowchartHolding, key: string): GestureEdits | undefined {\n    if (!holding.can(\"lanes\") || (holding.model.laneStates.get(key) ?? 0) > 0) return undefined;\n    return { edits: [{ op: \"remove\", sort: \"lanes\", key }] };\n}\n\n// ── States ───────────────────────────────────────────────────────────────────\n\n/**\n * + STATE from a lane's editor: its key and its label, its lane, its order\n * one past the lane's last. A key the flowchart holds already is refused. A\n * key the editor takes no typing of — the states keyed by another type than\n * String, or building their keys — is the kind's to make, `state-<n>` made up\n * where it makes one so (#1549).\n *\n * @param holding - What the gesture reads\n * @param band - The band's key\n * @param key - The state's key, as typed; `undefined` for one the kind makes\n * @param label - Its label\n * @returns Its edits and its key, or why it records nothing; `undefined` for a key taken, No lane, or while the states take no gesture\n */\nexport function addState(holding: FlowchartHolding, band: string, key: string | undefined, label: string): GestureEdits | undefined {\n    const land = landing(holding.model, band);\n    if (land === undefined || !holding.can(\"states\")) return undefined;\n    if (land.lane.type === \"some\" && placeholderOf(holding, \"lanes\", land.lane.value)) return refusedFor({ refusal: \"placeholder\", sort: \"lanes\", key: land.lane.value });\n    const states = bandStates(holding.model, land.index);\n    const { order } = between(states, states.length, false);\n    const write = { label: some(label), lane: land.lane, order: some(order) };\n    if (key !== undefined) {\n        if (key.length === 0 || holding.taken(\"states\", key)) return undefined;\n        return { edits: [{ op: \"createState\", key, write, values: none }], key };\n    }\n    const count = holding.model.nodes.filter((node) => !node.ghost).length;\n    const made = newRowKey(holding, \"states\", { op: \"createState\", key: \"\", write, values: none }, (taken) => numberedKey(\"state\", count + 1, taken).key);\n    if (made === undefined || \"refused\" in made) return made === undefined ? undefined : refusedFor(made.refused);\n    return { edits: [{ op: \"createState\", key: made.key, write, values: none }], key: made.key };\n}\n\n/**\n * A state card dropped on a lane: a state from its values where it lands,\n * keyed `state-<n>`, its order between the cards it lands between.\n *\n * @param holding - What the gesture reads\n * @param band - The band's key\n * @param at - Where it lands among the band's states: 0 before the first, their count after the last\n * @param values - The card's values\n * @returns Its edits and its key; `undefined` for No lane, or while the states take no gesture\n */\nexport function dropState(holding: FlowchartHolding, band: string, at: number, values: Uint8Array): GestureEdits | undefined {\n    const land = landing(holding.model, band);\n    if (land === undefined || !holding.can(\"states\")) return undefined;\n    if (land.lane.type === \"some\" && placeholderOf(holding, \"lanes\", land.lane.value)) return refusedFor({ refusal: \"placeholder\", sort: \"lanes\", key: land.lane.value });\n    const states = bandStates(holding.model, land.index);\n    const count = holding.model.nodes.filter((node) => !node.ghost).length;\n    const { order } = between(states, Math.max(0, Math.min(at, states.length)), false);\n    const write = { label: none, lane: land.lane, order: some(order) };\n    const made = newRowKey(holding, \"states\", { op: \"createState\", key: \"\", write, values: some(values) },\n        (taken) => numberedKey(\"state\", count + 1, taken).key);\n    if (made === undefined || \"refused\" in made) return made === undefined ? undefined : refusedFor(made.refused);\n    return { edits: [{ op: \"createState\", key: made.key, write, values: some(values) }], key: made.key };\n}\n\n/**\n * A state's rename: its label.\n *\n * @param holding - What the gesture reads\n * @param key - The state's key\n * @param label - Its new label\n * @returns Its edits; `undefined` while the states take no gesture\n */\nexport function renameState(holding: FlowchartHolding, key: string, label: string): GestureEdits | undefined {\n    if (!holding.can(\"states\")) return undefined;\n    return { edits: [{ op: \"writeState\", key, write: { label: some(label), lane: none, order: none } }] };\n}\n\n/**\n * States moved to a band, together: each its lane and its order, evenly\n * between the two cards they land between, in their order before the move.\n *\n * @param holding - What the gesture reads\n * @param keys - The states' keys\n * @param band - The band's key\n * @param at - Where they land among the band's other states; `undefined` after the last\n * @returns Its edits; `undefined` for No lane, no state among the keys, or while the states take no gesture\n */\nexport function moveStates(holding: FlowchartHolding, keys: readonly string[], band: string, at?: number): GestureEdits | undefined {\n    const land = landing(holding.model, band);\n    if (land === undefined || !holding.can(\"states\")) return undefined;\n    if (land.lane.type === \"some\" && placeholderOf(holding, \"lanes\", land.lane.value)) return refusedFor({ refusal: \"placeholder\", sort: \"lanes\", key: land.lane.value });\n    const lifted = new Set(keys);\n    const moving = holding.model.nodes\n        .filter((node) => !node.ghost && lifted.has(node.key))\n        .sort((a, b) => a.laneIndex - b.laneIndex || a.laneOrder - b.laneOrder);\n    if (moving.length === 0) return undefined;\n    const stay = bandStates(holding.model, land.index, lifted);\n    const orders = spread(stay, at === undefined ? stay.length : Math.max(0, Math.min(at, stay.length)), moving.length);\n    return {\n        edits: moving.map((node, i): FlowchartEdit => ({\n            op: \"writeState\", key: node.key, write: { label: none, lane: land.lane, order: some(orders[i]!) },\n        })),\n    };\n}\n\n/**\n * Duplicate: the state after itself in its band, under its key made unique,\n * every field as it has them — or under the key its kind makes (#1549).\n *\n * @param holding - What the gesture reads\n * @param key - The state's key\n * @returns Its edits and the copy's key; `undefined` for a ghost, or while the states take no gesture\n */\nexport function duplicateState(holding: FlowchartHolding, key: string): GestureEdits | undefined {\n    const node = holding.model.nodesByKey.get(key);\n    if (node === undefined || node.ghost || !holding.can(\"states\")) return undefined;\n    const states = bandStates(holding.model, node.laneIndex);\n    const at = states.findIndex((state) => keyEqual(state.key, key));\n    const { order } = between(states, at + 1, false);\n    const made = newRowKey(holding, \"states\", { op: \"copy\", sort: \"states\", key: \"\", from: key, order }, (taken) => uniqueKey(key, taken));\n    if (made === undefined || \"refused\" in made) return made === undefined ? undefined : refusedFor(made.refused);\n    return { edits: [{ op: \"copy\", sort: \"states\", key: made.key, from: key, order }], key: made.key };\n}\n\n/**\n * Del of states, one step (D6): each state; every transition the flowchart\n * holds naming one — drawn, or hidden with its far end; and each one's key\n * from every decision's queue. A ghost — an end no state is keyed by — takes\n * its transitions alone. A kind read only beside the states is left as it is.\n *\n * @param holding - What the gesture reads\n * @param keys - The states' keys\n * @returns Its edits; `undefined` for nothing to delete, or a state while the states take no gesture\n */\nexport function deleteStates(holding: FlowchartHolding, keys: readonly string[]): GestureEdits | undefined {\n    const gone = new Set<string>();\n    const edits: FlowchartEdit[] = [];\n    for (const key of keys) {\n        const node = holding.model.nodesByKey.get(key);\n        if (node === undefined || gone.has(key)) continue;\n        gone.add(key);\n        if (node.ghost) continue;\n        if (!holding.can(\"states\")) return undefined;\n        edits.push({ op: \"remove\", sort: \"states\", key });\n    }\n    if (holding.can(\"transitions\")) {\n        for (const transition of heldTransitions(holding)) {\n            if (gone.has(transition.roles.from) || gone.has(transition.roles.to)) edits.push({ op: \"remove\", sort: \"transitions\", key: transition.key });\n        }\n    }\n    if (holding.unqueues && holding.can(\"decisions\")) {\n        for (const decision of holding.rows.decisions) {\n            const queued = new Set<string>();\n            for (const state of decision.roles.queue) {\n                if (!gone.has(state) || queued.has(state)) continue;\n                queued.add(state);\n                edits.push({ op: \"unqueue\", key: decision.key, state });\n            }\n        }\n    }\n    return edits.length === 0 ? undefined : { edits };\n}\n\n// ── Transitions and decisions ────────────────────────────────────────────────\n\n/**\n * Connect: a transition between two states, keyed unique and never drawn —\n * its ends, every other field its kind's values of them — or keyed as its kind\n * makes one (#1549). A state under a placeholder takes no transition until its\n * key is typed.\n *\n * @param holding - What the gesture reads\n * @param from - The state it leaves\n * @param to - The state it enters; `from` itself for one in place\n * @returns Its edits and its key, or why it records nothing; `undefined` while the transitions take no gesture\n */\nexport function connect(holding: FlowchartHolding, from: string, to: string): GestureEdits | undefined {\n    if (!holding.can(\"transitions\")) return undefined;\n    for (const end of [from, to]) if (placeholderOf(holding, \"states\", end)) return refusedFor({ refusal: \"placeholder\", sort: \"states\", key: end });\n    const write = { from: some(from), to: some(to), decision: none };\n    const made = newRowKey(holding, \"transitions\", { op: \"createTransition\", key: \"\", write, values: none }, () => holding.mintTransition(NO_KEYS));\n    if (made === undefined || \"refused\" in made) return made === undefined ? undefined : refusedFor(made.refused);\n    return { edits: [{ op: \"createTransition\", key: made.key, write, values: none }], key: made.key };\n}\n\n/**\n * A transition's ends or its decision, as the inspector writes them: those\n * given, every other field as it was.\n *\n * @param holding - What the gesture reads\n * @param key - Its key\n * @param write - Its roles written: an end's new state, its decision — `some(none)` to clear it\n * @returns Its edits; `undefined` for nothing written, or while the transitions take no gesture\n */\nexport function editLink(holding: FlowchartHolding, key: string, write: FlowchartTransitionWrite): GestureEdits | undefined {\n    if (!holding.can(\"transitions\")) return undefined;\n    if (write.from.type === \"none\" && write.to.type === \"none\" && write.decision.type === \"none\") return undefined;\n    for (const end of [write.from, write.to]) {\n        if (end.type === \"some\" && placeholderOf(holding, \"states\", end.value)) return refusedFor({ refusal: \"placeholder\", sort: \"states\", key: end.value });\n    }\n    return { edits: [{ op: \"writeTransition\", key, write }] };\n}\n\n/**\n * Del of a transition.\n *\n * @param holding - What the gesture reads\n * @param key - Its key\n * @returns Its edits; `undefined` while the transitions take no gesture\n */\nexport function deleteLink(holding: FlowchartHolding, key: string): GestureEdits | undefined {\n    if (!holding.can(\"transitions\")) return undefined;\n    return { edits: [{ op: \"remove\", sort: \"transitions\", key }] };\n}\n\n/**\n * A transition card dropped on a transition: its values, its ends and its key\n * kept.\n *\n * @param holding - What the gesture reads\n * @param key - The transition's key\n * @param values - The card's values\n * @returns Its edits; `undefined` while the transitions take no gesture\n */\nexport function dropTransition(holding: FlowchartHolding, key: string, values: Uint8Array): GestureEdits | undefined {\n    if (!holding.can(\"transitions\")) return undefined;\n    return { edits: [{ op: \"retypeTransition\", key, values }] };\n}\n\n/**\n * Del of a decision: cleared from every transition the flowchart holds naming\n * it, while the transitions take a gesture.\n *\n * @param holding - What the gesture reads\n * @param key - The decision's key\n * @returns Its edits; `undefined` while the decisions take no gesture\n */\nexport function deleteDecision(holding: FlowchartHolding, key: string): GestureEdits | undefined {\n    if (!holding.can(\"decisions\")) return undefined;\n    const edits: FlowchartEdit[] = [{ op: \"remove\", sort: \"decisions\", key }];\n    if (holding.can(\"transitions\")) {\n        for (const transition of heldTransitions(holding)) {\n            const decision = transition.roles.decision;\n            if (decision.type === \"some\" && keyEqual(decision.value, key)) {\n                edits.push({ op: \"writeTransition\", key: transition.key, write: { from: none, to: none, decision: some(none) } });\n            }\n        }\n    }\n    return { edits };\n}\n\n// ── The form ─────────────────────────────────────────────────────────────────\n\n/**\n * The form's fields on a row: those no role writes.\n *\n * @param holding - What the gesture reads\n * @param sort - The row's kind\n * @param key - Its key\n * @param sets - The fields it sets\n * @returns Its edits; `undefined` while the kind takes no gesture\n */\nexport function setFields(holding: FlowchartHolding, sort: FlowchartSort, key: string, sets: FlowchartFieldWrites): GestureEdits | undefined {\n    if (!holding.can(sort)) return undefined;\n    return { edits: [{ op: \"set\", sort, key, sets }] };\n}\n\n/**\n * A row whole, as a kind's own Details hand it back.\n *\n * @param holding - What the gesture reads\n * @param sort - The row's kind\n * @param key - Its key\n * @param row - The row\n * @returns Its edits; `undefined` while the kind takes no gesture\n */\nexport function setRow(holding: FlowchartHolding, sort: FlowchartSort, key: string, row: Uint8Array): GestureEdits | undefined {\n    if (!holding.can(sort)) return undefined;\n    return { edits: [{ op: \"row\", sort, key, row }] };\n}\n\n/**\n * A new row's key, changed in the form before Save (R9): the row under its new\n * key, and the transitions naming a state and the decisions queuing it, or the\n * states naming a lane, following it — those drawn, those hidden with their far\n * end and those waiting. A key a row of the flowchart stands under already is\n * refused; one whose row a draft deletes is free (#1581).\n *\n * @param holding - What the gesture reads\n * @param sort - The row's kind: a state's or a lane's\n * @param from - Its key\n * @param to - Its new key\n * @returns Its edits; `undefined` for a key taken or empty, or while the kind takes no gesture\n */\nexport function rekey(holding: FlowchartHolding, sort: \"states\" | \"lanes\", from: string, to: string): GestureEdits | undefined {\n    if (!holding.can(sort) || to.length === 0 || keyEqual(from, to) || holding.stands(sort, to)) return undefined;\n    const unheld = unheldNamer(holding, [{ sort, key: from }]);\n    if (unheld !== undefined) return refusedFor(unheld);\n    return { edits: [{ op: \"copy\", sort, key: to, from }, { op: \"remove\", sort, key: from }, ...namers(holding, sort, from, to)], key: to };\n}\n\n/** The kinds whose rows name a row of a kind by its key: a lane its states', a state its transitions' — and the decisions queuing it, where they do. */\nfunction namingSorts(holding: FlowchartHolding, sort: FlowchartSort): readonly FlowchartSort[] {\n    if (sort === \"lanes\") return [\"states\"];\n    if (sort === \"states\") return holding.unqueues ? [\"transitions\", \"decisions\"] : [\"transitions\"];\n    return [];\n}\n\n/**\n * Why a gesture can't move the rows it moves (#1580): the first kind that may\n * name one whose rows the flowchart doesn't all hold — the rail hiding some,\n * which {@link namers} can't follow it in, or taking no edit now, which it\n * leaves. A row a gesture created this session no stored row names, so the rail\n * hiding some refuses it nothing.\n *\n * @param holding - What the gesture reads\n * @param moves - The rows it moves, each by its kind and its key\n * @returns The refusal; `undefined` where every kind that may name them is held whole\n */\nfunction unheldNamer(holding: FlowchartHolding, moves: readonly { readonly sort: FlowchartSort; readonly key: string }[]): FlowchartRefusal | undefined {\n    for (const move of moves) {\n        for (const by of namingSorts(holding, move.sort)) {\n            const why = holding.unheld(by);\n            if (why === undefined || (why === \"filtered\" && holding.created(move.sort, move.key))) continue;\n            return { refusal: \"unheld\", sort: move.sort, key: move.key, by, why };\n        }\n    }\n    return undefined;\n}\n\n/**\n * What names a row moving to a new key, following it: a state's transitions —\n * those drawn, those hidden with their far end and those waiting — and the\n * decisions queuing it, and a lane's states, drawn and waiting; each while its\n * kind takes a gesture.\n *\n * @param holding - What the gesture reads\n * @param sort - The row's kind\n * @param from - Its key\n * @param to - Its new key\n * @returns The edits writing each one's field naming it to the new key\n */\nfunction namers(holding: FlowchartHolding, sort: FlowchartSort, from: string, to: string): FlowchartEdit[] {\n    const edits: FlowchartEdit[] = [];\n    if (sort === \"states\" && holding.unqueues && holding.can(\"decisions\")) {\n        for (const decision of holding.rows.decisions) {\n            if (decision.roles.queue.some((state) => keyEqual(state, from))) edits.push({ op: \"requeue\", key: decision.key, from, to });\n        }\n    }\n    if (sort === \"states\" && holding.can(\"transitions\")) {\n        const waiting = holding.waiting.flatMap((row) => (row.sort === \"transitions\" ? [{ key: row.key, roles: row.roles }] : []));\n        for (const transition of [...heldTransitions(holding), ...waiting]) {\n            const leaves = keyEqual(transition.roles.from, from);\n            const enters = keyEqual(transition.roles.to, from);\n            if (!leaves && !enters) continue;\n            edits.push({\n                op: \"writeTransition\", key: transition.key,\n                write: { from: leaves ? some(to) : none, to: enters ? some(to) : none, decision: none },\n            });\n        }\n    }\n    if (sort === \"lanes\" && holding.can(\"states\")) {\n        const waiting = holding.waiting.flatMap((row) => (row.sort === \"states\" ? [{ key: row.key, roles: row.roles }] : []));\n        for (const state of [...holding.rows.states, ...waiting]) {\n            const lane = state.roles.lane;\n            if (lane.type === \"some\" && keyEqual(lane.value, from)) {\n                edits.push({ op: \"writeState\", key: state.key, write: { label: none, lane: some(to), order: none } });\n            }\n        }\n    }\n    return edits;\n}\n\n/** The kind an edit writes a row of. */\nfunction sortOfEdit(edit: FlowchartEdit): FlowchartSort {\n    switch (edit.op) {\n        case \"createState\": case \"writeState\": return \"states\";\n        case \"createTransition\": case \"writeTransition\": case \"retypeTransition\": return \"transitions\";\n        case \"createLane\": case \"writeLane\": return \"lanes\";\n        case \"unqueue\": case \"requeue\": return \"decisions\";\n        default: return edit.sort;\n    }\n}\n\n/** How many times a row's move can reach another's: a lane's to its states', a state's to its transitions'. */\nconst FOLLOWS = 4;\n\n/**\n * Whether a key a row moves to is held once the gesture is made (#1581):\n * another row moves there too, or a row stands there that the gesture leaves\n * there — a row moving off it frees it, so a swap or a shift passes.\n *\n * @param holding - What the gesture reads\n * @param moves - The rows the gesture moves\n * @param move - The row moving\n * @returns Whether its new key is held\n */\nfunction heldOnceMoved(holding: FlowchartHolding, moves: readonly FlowchartMove[], move: FlowchartMove): boolean {\n    const at = (sort: FlowchartSort, key: string): boolean => sort === move.sort && keyEqual(key, move.to);\n    if (moves.some((other) => other !== move && at(other.sort, other.to))) return true;\n    return holding.stands(move.sort, move.to) && !moves.some((other) => at(other.sort, other.key));\n}\n\n/**\n * A gesture's edits with each row whose kind builds its key from its row\n * moved under the key its fields build once the gesture writes them (#1549):\n * the row copied under its new key before any of its edits, so each writes it\n * there; then gone from its old key; then what names it following — a lane's\n * states, a state's transitions and the decisions queuing it — whose own keys,\n * built from what they name, move them in turn. A key another row stands under\n * once the gesture is made, or another moving row takes, refuses the gesture,\n * naming that key — one a row moves off is free, so a swap or a shift passes,\n * the row copied onto it replacing the one moving off, whose key it leaves\n * standing (#1581); so does a kind that may name a moving row the flowchart\n * doesn't hold whole (#1580).\n *\n * @param holding - What the gesture reads\n * @param made - The gesture's edits\n * @returns The edits with every move, and the rows moved; the refusal, with no edits, where a key is taken or what may\n *   name a moving row isn't held\n */\nexport function followBuiltKeys(holding: FlowchartHolding, made: GestureEdits): GestureEdits {\n    if (made.refused !== undefined || made.edits.length === 0) return made;\n    let edits = made.edits;\n    const moved: FlowchartMove[] = [];\n    for (let pass = 0; pass < FOLLOWS; pass++) {\n        const moves = holding.moves(edits);\n        if (moves.length === 0) break;\n        for (const move of moves) {\n            if (heldOnceMoved(holding, moves, move)) return refusedFor({ refusal: \"taken\", sort: move.sort, key: move.to });\n        }\n        const unheld = unheldNamer(holding, moves);\n        if (unheld !== undefined) return refusedFor(unheld);\n        const to = (sort: FlowchartSort, key: string) => moves.find((move) => move.sort === sort && keyEqual(move.key, key))?.to;\n        // A row copied onto a key another moving row leaves replaces that row; a key another moving row takes stays.\n        const vacated = (move: FlowchartMove) => moves.some((other) => other.sort === move.sort && keyEqual(other.key, move.to));\n        const refilled = (move: FlowchartMove) => moves.some((other) => other.sort === move.sort && keyEqual(other.to, move.key));\n        edits = [\n            ...moves.map((move): FlowchartEdit => ({ op: \"copy\", sort: move.sort, key: move.to, from: move.key, ...(vacated(move) ? { replaces: true as const } : {}) })),\n            ...edits.map((edit): FlowchartEdit => {\n                const moving = edit.op === \"copy\" || edit.op === \"remove\" ? undefined : to(sortOfEdit(edit), edit.key);\n                return moving === undefined ? edit : { ...edit, key: moving };\n            }),\n            ...moves.filter((move) => !refilled(move)).map((move): FlowchartEdit => ({ op: \"remove\", sort: move.sort, key: move.key })),\n            ...moves.flatMap((move) => namers(holding, move.sort, move.key, move.to)),\n        ];\n        moved.push(...moves);\n    }\n    return moved.length === 0 ? made : { ...made, edits, moved };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the Flowchart has selected (#1503, `Flowchart Records Spec.md` R6, R8)\n * — pure and React-free: a state, a transition, a decision or a lane, by its\n * key — a lane by a click on its header — or several states, shift-, ⌘- or\n * Ctrl-clicked into one selection. The frame holds it: the canvas marks it and\n * Del deletes it, the inspector shows its Details, a card's ⏎ drops on it, and\n * a click on an issue selects what the issue names.\n *\n * - {@link toggleState} puts a state into the selection, or takes it out;\n * - {@link selectionHeld} is the selection as the canvas draws the records\n *   now: an Undo, a gesture that takes away what it names, or a narrowing\n *   that leaves it out — drawing it as context, or not at all — leaves\n *   nothing of it.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport type { FlowchartModel } from \"./model.js\";\n\nconst keyEqual = equalFor(StringType);\n\n/**\n * What is selected: one state, transition, decision or lane, by its key, or\n * several states, in the order they were selected.\n */\nexport type FlowchartSelection =\n    | { readonly kind: \"state\" | \"link\" | \"trigger\" | \"lane\"; readonly key: string }\n    | { readonly kind: \"states\"; readonly keys: readonly string[] };\n\n/**\n * The states a selection holds: its one state, its several, or none.\n *\n * @param selection - What is selected\n * @returns The states' keys, in the order they were selected\n */\nexport function selectedStates(selection: FlowchartSelection | null): readonly string[] {\n    if (selection === null) return [];\n    if (selection.kind === \"states\") return selection.keys;\n    return selection.kind === \"state\" ? [selection.key] : [];\n}\n\n/**\n * Whether two selections are one: what the canvas marks, and the inspector\n * shows, need not move.\n *\n * @param a - A selection, or none\n * @param b - Another, or none\n * @returns Whether they select the same, in the same order\n */\nexport function selectionEqual(a: FlowchartSelection | null, b: FlowchartSelection | null): boolean {\n    if (a === null || b === null) return a === null && b === null;\n    if (a.kind === \"states\" || b.kind === \"states\") {\n        return a.kind === \"states\" && b.kind === \"states\" && a.keys.length === b.keys.length && a.keys.every((key, i) => keyEqual(key, b.keys[i]!));\n    }\n    return a.kind === b.kind && keyEqual(a.key, b.key);\n}\n\n/**\n * A state shift-, ⌘- or Ctrl-clicked: put into the selection, or — selected\n * already — taken out of it. A selection of anything but states starts again\n * from the state; several states taken down to one are that state alone.\n *\n * @param selection - What is selected\n * @param key - The state clicked\n * @returns The selection after the click; `null` when the click took out its last state\n */\nexport function toggleState(selection: FlowchartSelection | null, key: string): FlowchartSelection | null {\n    const keys = selectedStates(selection);\n    if (keys.length === 0) return { kind: \"state\", key };\n    const kept = keys.filter((k) => !keyEqual(k, key));\n    if (kept.length === keys.length) return { kind: \"states\", keys: [...keys, key] };\n    if (kept.length === 0) return null;\n    return kept.length === 1 ? { kind: \"state\", key: kept[0]! } : { kind: \"states\", keys: kept };\n}\n\n/**\n * Whether the canvas draws a state of a key as itself — its card, or the\n * ghost a transition naming it draws — never as context.\n *\n * @param model - What the canvas draws\n * @param key - The state's key\n * @returns Whether a path selects it\n */\nexport function drawsState(model: FlowchartModel, key: string): boolean {\n    const node = model.nodesByKey.get(key);\n    return node !== undefined && !node.dimmed;\n}\n\n/**\n * Whether the canvas draws a transition as itself — its line, or its state's\n * `↻ n` badge — never as context.\n *\n * @param model - What the canvas draws\n * @param key - The transition's key\n * @returns Whether a path selects it\n */\nexport function drawsTransition(model: FlowchartModel, key: string): boolean {\n    return model.links.some((link) => keyEqual(link.key, key) && !link.dimmed)\n        || model.nodes.some((node) => !node.dimmed && node.inPlaceKeys.some((k) => keyEqual(k, key)));\n}\n\n/**\n * The selection as the canvas draws the records now: what it names that the\n * canvas no longer draws as itself goes — a state, a transition, a decision\n * or a lane an Undo, a gesture or the narrowing took away — several states\n * keep those still drawn, and one left is that state alone. Only a lane of\n * the app's is selected: never *No lane*, nor the one band of a Flowchart\n * given no lanes.\n *\n * @param selection - What is selected\n * @param model - What the canvas draws, the drafts in place\n * @returns The selection itself while the canvas draws all it names — the same object — else what is left of it, or `null`\n */\nexport function selectionHeld(selection: FlowchartSelection | null, model: FlowchartModel): FlowchartSelection | null {\n    if (selection === null) return null;\n    switch (selection.kind) {\n        case \"state\": return drawsState(model, selection.key) ? selection : null;\n        case \"link\": return drawsTransition(model, selection.key) ? selection : null;\n        case \"trigger\": return model.triggers.has(selection.key) ? selection : null;\n        case \"lane\": return model.lanes.some((lane) => lane.band === \"lane\" && keyEqual(lane.key, selection.key)) ? selection : null;\n        case \"states\": {\n            const kept = selection.keys.filter((key) => drawsState(model, key));\n            if (kept.length === selection.keys.length) return selection;\n            if (kept.length === 0) return null;\n            return kept.length === 1 ? { kind: \"state\", key: kept[0]! } : { kind: \"states\", keys: kept };\n        }\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's drops (#1501, `Flowchart Records Spec.md` R14, D5, D8) —\n * pure and React-free: what a library card does where it lands, decided as\n * data before anything is drawn or written. The frame records a plan as one\n * step of the editing's history (`use-drop.ts`), and the canvas works out\n * where a drag rests from its own drawing.\n *\n * - **What is dragged** ({@link FlowchartDropCard}, {@link dropHostOf}): a\n *   card of a tab that drops — a state's card, which adds a state where it\n *   lands on a lane; a transition's card, which gives a transition its values;\n *   a lane's card, which adds a lane where it lands on the band row; an\n *   author's card, whose patch sets its fields on a row of the kind it names.\n * - **Where a drag rests** ({@link FlowchartDropAtType}, {@link dropAtPoint}):\n *   what lies under the pointer of what the card lands on — a lane, and the\n *   row a new state takes in it; a state; a transition, near its line; a\n *   lane's header; the gap between two lanes, or the band row's tail; a\n *   decision's diamond — or the canvas, where nothing it lands on lies. A row\n *   the narrowing draws as context, and the band *No lane*, take no card. The\n *   shared drag grammar's `CellRef` carries it in its `row`, printed.\n * - **What a drop does** ({@link planDrop}, {@link dropEdits}): a state from\n *   the card's values in the lane it lands in, keyed `state-<n>`, its order\n *   between the cards it lands between; a transition given the card's values,\n *   its ends and its key kept; a lane from the card's values where it lands,\n *   keyed `lane-<n>`, its order between the lanes'; an author's card's fields\n *   set — or refused, with the reason the ghost says in red: anywhere but what\n *   the card lands on, a kind read only (R13), a kind taking no edit now, a\n *   kind adding no row — its keys of a type the form can't type, building none\n *   — or a state's card on a lane whose key is still to be typed (#1549).\n * - **⏎ on a card** ({@link enterAt}): a drop on the canvas's selection — a\n *   state's card after the selected state, at the end of the selected lane, or\n *   at the end of the first lane; a lane's card after the selected lane, or at\n *   the band row's tail; any other card on what is selected, when that is what\n *   it lands on.\n * - **Its words** ({@link dropCaption}, {@link dropName}, {@link dropRefusal},\n *   {@link dropLabel}) and **its marks** ({@link markOf}): the lane it lands\n *   in and the row, the gap a lane lands in, or what it sets its fields on.\n *\n * @packageDocumentation\n */\n\nimport { IntegerType, NullType, StringType, StructType, VariantType, equalFor, parseFor, printFor, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { getSomeorUndefined, type DragPayload, type DropCellOptions, type DropVeto } from \"@elaraai/east-ui-components\";\nimport { dropTargetAt, laneAt } from \"./connect.js\";\nimport type { FlowchartFieldWrites } from \"./editing.js\";\nimport { dropLane, dropState, dropTransition, setFields, type FlowchartHolding, type GestureEdits } from \"./edits.js\";\nimport type { FlowchartLayout, Pt, RouteSeg } from \"./layout.js\";\nimport type { FlowchartDropPlaceWord, FlowchartDropRefusalWord, FlowchartDropWhatWord, FlowchartLandsWord, FlowchartMessages } from \"./messages.js\";\nimport type { FlowchartModel, FlowchartValue, ModelNode } from \"./model.js\";\nimport type { FlowchartSort } from \"./read.js\";\nimport { drawsTransition, type FlowchartSelection } from \"./selection.js\";\n\nconst keyEqual = equalFor(StringType);\n\n// ── What is dragged ───────────────────────────────────────────────────────\n\n/** What a library card lands on. */\nexport type FlowchartLands = FlowchartLandsWord;\n\n/** A card the canvas takes, as the Flowchart reads it: what its drop does, and its name. */\nexport type FlowchartDropCard =\n    /** A state's card: a new state where it lands on a lane, every field but its lane and its order the card's values. */\n    | { readonly does: \"addState\"; readonly label: string; readonly values: Uint8Array }\n    /** A transition's card: its values given to the transition it lands on, its ends and its key kept. */\n    | { readonly does: \"retype\"; readonly label: string; readonly values: Uint8Array }\n    /** A lane's card: a new lane where it lands on the band row, every field but its order the card's values. */\n    | { readonly does: \"addLane\"; readonly label: string; readonly values: Uint8Array }\n    /** An author's card: the fields its patch sets, on a row of the kind its patch names. */\n    | { readonly does: \"set\"; readonly sort: FlowchartSort; readonly label: string; readonly sets: FlowchartFieldWrites };\n\n/**\n * The kind a card writes.\n *\n * @param card - The card\n * @returns The kind\n */\nexport function cardSort(card: FlowchartDropCard): FlowchartSort {\n    switch (card.does) {\n        case \"addState\": return \"states\";\n        case \"retype\": return \"transitions\";\n        case \"addLane\": return \"lanes\";\n        case \"set\": return card.sort;\n    }\n}\n\n/** What an author's card lands on, by the kind its patch names. */\nconst SET_LANDS: { readonly [S in FlowchartSort]: FlowchartLands } = {\n    states: \"state\", transitions: \"transition\", lanes: \"header\", decisions: \"decision\",\n};\n\n/**\n * What a card lands on.\n *\n * @param card - The card\n * @returns What it lands on\n */\nexport function landsOf(card: FlowchartDropCard): FlowchartLands {\n    switch (card.does) {\n        case \"addState\": return \"lane\";\n        case \"retype\": return \"transition\";\n        case \"addLane\": return \"gap\";\n        case \"set\": return SET_LANDS[card.sort];\n    }\n}\n\n/** What the canvas takes dropped: its drop target, and each library whose cards drop — its cards by key. */\nexport interface FlowchartDropHost {\n    /** The Flowchart's drop target: the surface its canvas registers on. */\n    readonly surface: string;\n    /** Each library whose cards drop, by its id: its cards, by key. */\n    readonly libraries: ReadonlyMap<string, ReadonlyMap<string, FlowchartDropCard>>;\n}\n\n/** A kind's cards, as the wire carries them. */\ntype Templates = FlowchartValue[\"states\"][\"templates\"];\n\n/** A kind's cards by key, each read as a card that drops. */\nfunction cardsOf(templates: Templates, does: \"addState\" | \"retype\" | \"addLane\"): ReadonlyMap<string, FlowchartDropCard> {\n    return new Map(templates.map((template) => [template.key, { does, label: template.name, values: template.values }] as const));\n}\n\n/** The kinds that carry cards, as the drops read them. */\nexport interface FlowchartCardKinds {\n    /** The states' cards. */\n    readonly states: Templates;\n    /** The transitions' cards; none for a Flowchart given no transitions. */\n    readonly transitions: Templates;\n    /** The lanes' cards; none for a Flowchart given no lanes. */\n    readonly lanes: Templates;\n}\n\n/**\n * What the canvas takes dropped, from the tabs the payload lists: the Steps\n * tab's cards, each adding a state; the Transitions tab's, each giving a\n * transition its values; the Lanes tab's, each adding a lane; and each\n * author's tab whose patch names a kind, its cards by their keys. An author's\n * tab with no `drop` drops nothing.\n *\n * @param surface - The Flowchart's drop target\n * @param libraryOf - The library a tab's cards drag from, by the tab's key\n * @param tabs - The tabs the payload lists\n * @param kinds - The kinds' cards\n * @returns What the canvas takes\n */\nexport function dropHostOf(surface: string, libraryOf: (tabKey: string) => string, tabs: FlowchartValue[\"library\"], kinds: FlowchartCardKinds): FlowchartDropHost {\n    const libraries = new Map<string, ReadonlyMap<string, FlowchartDropCard>>();\n    for (const tab of tabs) {\n        switch (tab.type) {\n            case \"states\": libraries.set(libraryOf(\"states\"), cardsOf(kinds.states, \"addState\")); break;\n            case \"transitions\": libraries.set(libraryOf(\"transitions\"), cardsOf(kinds.transitions, \"retype\")); break;\n            case \"lanes\": libraries.set(libraryOf(\"lanes\"), cardsOf(kinds.lanes, \"addLane\")); break;\n            case \"tab\": {\n                const sort = getSomeorUndefined(tab.value.drop) as FlowchartSort | undefined;\n                if (sort === undefined) break;\n                libraries.set(libraryOf(`tab:${tab.value.name}`),\n                    new Map(tab.value.cards.map((card) => [card.key, { does: \"set\", sort, label: card.label, sets: card.sets }] as const)));\n                break;\n            }\n        }\n    }\n    return { surface, libraries };\n}\n\n/**\n * A card the canvas takes, by its library and its key.\n *\n * @param host - What the canvas takes\n * @param library - The card's library\n * @param key - The card's key\n * @returns The card, or `undefined` for one no tab that drops lists\n */\nexport function cardOf(host: FlowchartDropHost, library: string, key: string): FlowchartDropCard | undefined {\n    return host.libraries.get(library)?.get(key);\n}\n\n// ── Where a drag rests ────────────────────────────────────────────────────\n\n/** Where a drag rests over the canvas, for what it carries — what a Flowchart's drop `CellRef` names in its `row`, printed. */\nexport const FlowchartDropAtType = VariantType({\n    /** A band, by its key, and the row a new state takes in it: after the states above the pointer. */\n    lane: StructType({ lane: StringType, row: IntegerType }),\n    /** A state, by its key. */\n    state: StringType,\n    /** A transition, by its key. */\n    transition: StringType,\n    /** A lane's header, by the lane's key. */\n    header: StringType,\n    /** Where a new lane lands among the lanes: 0 before the first, their count at the band row's tail. */\n    gap: IntegerType,\n    /** A decision's diamond, by the decision's key. */\n    decision: StringType,\n    /** The canvas, where nothing the card lands on lies under the pointer. */\n    canvas: NullType,\n});\n\n/** Where a drag rests, decoded. */\nexport type FlowchartDropAt = ValueTypeOf<typeof FlowchartDropAtType>;\n\n/** Where a drag rests, as its `CellRef` carries it. */\nexport const printDropAt: (at: FlowchartDropAt) => string = printFor(FlowchartDropAtType);\n\nconst parseDropAt = parseFor(FlowchartDropAtType);\n\n/**\n * Where a drop's `CellRef` says the drag rests.\n *\n * @param text - The `CellRef`'s `row`\n * @returns Where it rests, or `undefined` when the text names nowhere — a coordinate another surface made\n */\nexport function readDropAt(text: string): FlowchartDropAt | undefined {\n    const read = parseDropAt(text);\n    return read.success ? read.value : undefined;\n}\n\n/** The canvas, where nothing a card lands on lies: where the canvas's drop cell rests before a drag says otherwise. */\nexport const ON_CANVAS: FlowchartDropAt = variant(\"canvas\", null);\n\n/** How near a transition's line a drag rests on it, either side, in px — wider than the line's 12px hit path, so nobody has to hit the line. */\nexport const LINK_PAD = 10;\n\n/** How near a decision's diamond a drag rests on it: its half-diagonal, 11px, and a margin. */\nexport const DIAMOND_PAD = 16;\n\n/** A point's place along the axis a lane's states stack on: LR's y, TD's x. */\nconst crossOf = (layout: FlowchartLayout, p: Pt): number => (layout.orientation === \"TD\" ? p.x : p.y);\n\n/** A point's place along the axis the lanes stand on: LR's x, TD's y. */\nconst alongOf = (layout: FlowchartLayout, p: Pt): number => (layout.orientation === \"TD\" ? p.y : p.x);\n\n/**\n * The row a new state takes in a band, at a point: after every state of the\n * band whose middle lies above the pointer — in TD, before it.\n *\n * @param layout - The laid-out flowchart\n * @param held - How many states the band draws\n * @param p - The point, in the canvas's px\n * @returns The row, from 0 — before the band's first state — to `held`, after its last\n */\nexport function rowAt(layout: FlowchartLayout, held: number, p: Pt): number {\n    const cross = crossOf(layout, p);\n    // Each row's middle is its states': each card stands centred in its row.\n    let above = 0;\n    while (above < held && above < layout.rows.length && cross > layout.rows[above]!.start + layout.rows[above]!.size / 2) above += 1;\n    return above;\n}\n\n/** How far a point is from a straight run of a transition's line. */\nfunction distanceToRun(p: Pt, run: RouteSeg): number {\n    const x = Math.max(Math.min(run.a.x, run.b.x), Math.min(p.x, Math.max(run.a.x, run.b.x)));\n    const y = Math.max(Math.min(run.a.y, run.b.y), Math.min(p.y, Math.max(run.a.y, run.b.y)));\n    return Math.hypot(p.x - x, p.y - y);\n}\n\n/**\n * The transition whose line runs nearest a point, within {@link LINK_PAD} —\n * one drawn as context left out; an in-place transition, folded into its\n * state's `↻` badge, has no line.\n *\n * @param layout - The laid-out flowchart\n * @param model - The view model: which transitions draw as context\n * @param p - The point\n * @returns Its key, or `undefined`\n */\nexport function linkAt(layout: FlowchartLayout, model: FlowchartModel, p: Pt): string | undefined {\n    const context = new Set(model.links.filter((link) => link.dimmed).map((link) => link.key));\n    let best: { key: string; d: number } | undefined;\n    for (const route of layout.routes) {\n        if (context.has(route.key)) continue;\n        for (const run of route.segs) {\n            const d = distanceToRun(p, run);\n            if (d <= LINK_PAD && (best === undefined || d < best.d)) best = { key: route.key, d };\n        }\n    }\n    return best?.key;\n}\n\n/**\n * The decision whose diamond lies under a point, within {@link DIAMOND_PAD}\n * of its middle — a transition naming a decision the Flowchart doesn't hold,\n * or one drawn as context, draws none a card lands on.\n *\n * @param layout - The laid-out flowchart\n * @param model - The view model: the decisions each transition names\n * @param p - The point\n * @returns The decision's key, or `undefined`\n */\nexport function diamondAt(layout: FlowchartLayout, model: FlowchartModel, p: Pt): string | undefined {\n    const links = new Map(model.links.map((l) => [l.key, l] as const));\n    for (const route of layout.routes) {\n        const link = links.get(route.key);\n        const trigger = link?.trigger;\n        if (link === undefined || link.dimmed || trigger === undefined || !model.triggers.has(trigger)) continue;\n        if (Math.abs(p.x - route.mid.x) + Math.abs(p.y - route.mid.y) <= DIAMOND_PAD) return trigger;\n    }\n    return undefined;\n}\n\n/**\n * The lane whose header holds a point: the band's strip before its first row\n * — across the top in LR, down the side in TD. Only a lane of the app's has a\n * header a card lands on: never *No lane*, nor the one band of a Flowchart\n * given no lanes.\n *\n * @param layout - The laid-out flowchart\n * @param model - The view model\n * @param p - The point\n * @returns The lane's key, or `undefined`\n */\nexport function headerAt(layout: FlowchartLayout, model: FlowchartModel, p: Pt): string | undefined {\n    if (crossOf(layout, p) >= layout.rows[0]!.start) return undefined;\n    const key = laneAt(layout, p);\n    const lane = key === null ? undefined : model.lanes.find((l) => keyEqual(l.key, key));\n    return lane?.band === \"lane\" ? lane.key : undefined;\n}\n\n/**\n * Where a new lane lands at a point: before the first lane of the app's whose\n * middle lies past the pointer — after the last, the band row's tail. A\n * Flowchart given no lanes has no gap.\n *\n * @param layout - The laid-out flowchart\n * @param model - The view model\n * @param p - The point\n * @returns The gap, from 0 to the lanes' count; `undefined` with no lanes given\n */\nexport function gapAt(layout: FlowchartLayout, model: FlowchartModel, p: Pt): number | undefined {\n    if (model.standIn) return undefined;\n    const lanes = model.lanes.filter((lane) => lane.band === \"lane\").length;\n    const along = alongOf(layout, p);\n    const td = layout.orientation === \"TD\";\n    for (let i = 0; i < lanes; i++) {\n        const band = layout.lanes[i];\n        if (band === undefined) break;\n        const start = td ? band.y : band.x;\n        const size = td ? band.h : band.w;\n        if (along < start + size / 2) return i;\n    }\n    return lanes;\n}\n\n/**\n * Where a gap stands along the lanes' axis: the start of the lane it lands\n * before, or the end of the last lane of the app's.\n *\n * @param layout - The laid-out flowchart\n * @param at - The gap\n * @returns Its place, in the canvas's px — LR's x, TD's y\n */\nexport function gapLine(layout: FlowchartLayout, at: number): number {\n    const td = layout.orientation === \"TD\";\n    const before = layout.lanes[at];\n    if (before !== undefined) return td ? before.y : before.x;\n    const last = layout.lanes[at - 1];\n    if (last === undefined) return 0;\n    return td ? last.y + last.h : last.x + last.w;\n}\n\n/** The states a band draws, in its order: its ghosts left out — a state drawn as context keeps its row. */\nfunction bandStates(model: FlowchartModel, band: number): ModelNode[] {\n    return model.nodes.filter((node) => node.laneIndex === band && !node.ghost).sort((a, b) => a.laneOrder - b.laneOrder);\n}\n\n/**\n * Where a drag rests at a point of the canvas, for a card that lands on what\n * it names: a band and the row a new state takes in it ({@link rowAt}) —\n * never *No lane*; a state — its card, or as near as `connect.ts`' drop pad —\n * never a ghost; a transition near its line; a lane's header; a gap between\n * the lanes ({@link gapAt}); a decision's diamond. A row drawn as context\n * takes no card. Anywhere else, the canvas.\n *\n * @param lands - What the card lands on\n * @param layout - The laid-out flowchart\n * @param model - The view model\n * @param p - The point, in the canvas's px\n * @returns Where the drag rests\n */\nexport function dropAtPoint(lands: FlowchartLands, layout: FlowchartLayout, model: FlowchartModel, p: Pt): FlowchartDropAt {\n    switch (lands) {\n        case \"lane\": {\n            const key = laneAt(layout, p);\n            const index = key === null ? -1 : model.lanes.findIndex((l) => keyEqual(l.key, key));\n            const band = model.lanes[index];\n            if (band === undefined || band.band === \"noLane\") return ON_CANVAS;\n            return variant(\"lane\", { lane: band.key, row: BigInt(rowAt(layout, bandStates(model, index).length, p)) });\n        }\n        case \"state\": {\n            const key = dropTargetAt(layout, p);\n            const node = key === null ? undefined : model.nodesByKey.get(key);\n            return node === undefined || node.ghost || node.dimmed ? ON_CANVAS : variant(\"state\", node.key);\n        }\n        case \"transition\": {\n            const key = linkAt(layout, model, p);\n            return key === undefined ? ON_CANVAS : variant(\"transition\", key);\n        }\n        case \"header\": {\n            const key = headerAt(layout, model, p);\n            return key === undefined ? ON_CANVAS : variant(\"header\", key);\n        }\n        case \"gap\": {\n            const at = gapAt(layout, model, p);\n            return at === undefined ? ON_CANVAS : variant(\"gap\", BigInt(at));\n        }\n        case \"decision\": {\n            const key = diamondAt(layout, model, p);\n            return key === undefined ? ON_CANVAS : variant(\"decision\", key);\n        }\n    }\n}\n\n// ── What a drop does ──────────────────────────────────────────────────────\n\n/** What a drop reads of the Flowchart as it stands. */\nexport interface FlowchartDropContext {\n    /** What the Flowchart draws now, the drafts in place. */\n    readonly model: FlowchartModel;\n    /** Whether a kind is edited at all: bound with its patch door, and the Flowchart not read only (R13). */\n    readonly editable: (sort: FlowchartSort) => boolean;\n    /** Whether a kind takes an edit now: no Save on its way, nothing the canvas draws standing in. */\n    readonly available: (sort: FlowchartSort) => boolean;\n    /** A kind's name, as a sentence writes it (`state`). */\n    readonly kindName: (sort: FlowchartSort) => string;\n    /** Why a kind adds no row (#1549): its key type's name, where the form can't type it and the kind builds none; `undefined` for one that adds rows. */\n    readonly untyped: (sort: FlowchartSort) => string | undefined;\n}\n\n/** Why a drop is refused where it rests: in its words, or — what it lands on having left the drawing — in none. */\nexport type FlowchartDropRefusal = { readonly why: \"gone\" } | FlowchartDropRefusalWord;\n\n/** What a drop does where it rests. */\nexport type FlowchartDropPlan =\n    /** A state added in a band at a row, from a card's values, and where its words say it lands. */\n    | { readonly kind: \"addState\"; readonly band: string; readonly row: number; readonly values: Uint8Array; readonly place: FlowchartDropPlaceWord }\n    /** A transition given a card's values, and what it is, in words. */\n    | { readonly kind: \"retype\"; readonly key: string; readonly values: Uint8Array; readonly what: FlowchartDropWhatWord }\n    /** A lane added among the lanes, from a card's values, and where its words say it lands. */\n    | { readonly kind: \"addLane\"; readonly at: number; readonly values: Uint8Array; readonly place: FlowchartDropPlaceWord }\n    /** An author's card's fields set on a row of a kind, and what it is, in words. */\n    | { readonly kind: \"set\"; readonly sort: FlowchartSort; readonly key: string; readonly sets: FlowchartFieldWrites; readonly what: FlowchartDropWhatWord }\n    | { readonly kind: \"refused\"; readonly why: FlowchartDropRefusal };\n\nconst refused = (why: FlowchartDropRefusal): FlowchartDropPlan => ({ kind: \"refused\", why });\nconst GONE: FlowchartDropPlan = refused({ why: \"gone\" });\n\n/** A state's card on a band at a row: where it lands among the band's states — never a lane whose key is still to be typed. */\nfunction planState(model: FlowchartModel, band: string, row: number, values: Uint8Array, laneName: string): FlowchartDropPlan {\n    const index = model.lanes.findIndex((lane) => keyEqual(lane.key, band));\n    const lane = model.lanes[index];\n    if (lane === undefined) return GONE;\n    if (lane.band === \"noLane\") return refused({ why: \"onto\", lands: \"lane\" });\n    if (lane.band === \"lane\" && !model.keys.lanes.isKey(lane.key)) return refused({ why: \"placeholder\", kind: laneName });\n    const states = bandStates(model, index);\n    const r = Math.max(0, Math.min(row, states.length));\n    const name = lane.band === \"lane\" ? lane.label : undefined;\n    const above = r > 0 ? states[r - 1]!.key : undefined;\n    const place: FlowchartDropPlaceWord = above !== undefined ? { place: \"after\", lane: name, after: above }\n        : states.length > 0 ? { place: \"start\", lane: name } : { place: \"in\", lane: name };\n    return { kind: \"addState\", band: lane.key, row: r, values, place };\n}\n\n/** A lane's card at a gap: where it lands among the lanes. */\nfunction planLane(model: FlowchartModel, at: number, values: Uint8Array): FlowchartDropPlan {\n    const lanes = model.lanes.filter((lane) => lane.band === \"lane\");\n    const i = Math.max(0, Math.min(at, lanes.length));\n    const before = lanes[i];\n    return { kind: \"addLane\", at: i, values, place: before === undefined ? { place: \"end\" } : { place: \"before\", lane: before.label } };\n}\n\n/** An author's card on a row of its kind, where the drag rests: what it is, in words, or why it is refused. */\nfunction planSet(card: Extract<FlowchartDropCard, { does: \"set\" }>, at: FlowchartDropAt, model: FlowchartModel): FlowchartDropPlan {\n    const set = (key: string, what: FlowchartDropWhatWord): FlowchartDropPlan => ({ kind: \"set\", sort: card.sort, key, sets: card.sets, what });\n    switch (card.sort) {\n        case \"states\": {\n            if (at.type !== \"state\") return refused({ why: \"onto\", lands: \"state\" });\n            const node = model.nodesByKey.get(at.value);\n            return node === undefined || node.ghost || node.dimmed ? GONE : set(node.key, { what: \"state\", key: node.key });\n        }\n        case \"transitions\": {\n            if (at.type !== \"transition\") return refused({ why: \"onto\", lands: \"transition\" });\n            return whatTransition(model, at.value, (what) => set(at.value, what));\n        }\n        case \"lanes\": {\n            if (at.type !== \"header\") return refused({ why: \"onto\", lands: \"header\" });\n            const lane = model.lanes.find((l) => keyEqual(l.key, at.value));\n            return lane === undefined || lane.band !== \"lane\" ? GONE : set(lane.key, { what: \"header\", lane: lane.label });\n        }\n        case \"decisions\": {\n            if (at.type !== \"decision\") return refused({ why: \"onto\", lands: \"decision\" });\n            const decision = model.triggers.get(at.value);\n            return decision === undefined ? GONE : set(decision.key, { what: \"decision\", label: decision.label });\n        }\n    }\n}\n\n/** A transition the Flowchart draws as itself, by its ends in words — or gone. */\nfunction whatTransition(model: FlowchartModel, key: string, plan: (what: FlowchartDropWhatWord) => FlowchartDropPlan): FlowchartDropPlan {\n    if (!drawsTransition(model, key)) return GONE;\n    const link = model.links.find((l) => keyEqual(l.key, key));\n    if (link !== undefined) return plan({ what: \"transition\", from: link.from, to: link.to });\n    const node = model.nodes.find((n) => n.inPlaceKeys.some((k) => keyEqual(k, key)));\n    return node === undefined ? GONE : plan({ what: \"transition\", from: node.key, to: node.key });\n}\n\n/**\n * What a drop does where it rests — see the module docs. A card of a kind\n * read only, or of a kind taking no edit now, is refused wherever it rests, and\n * so is one adding a row of a kind that adds none (#1549); otherwise a card is\n * refused anywhere but what it lands on, and says nothing where that has left\n * the drawing.\n *\n * @param card - The card dragged\n * @param at - Where the drag rests\n * @param ctx - The Flowchart as it stands\n * @returns What the drop does, or why it is refused\n */\nexport function planDrop(card: FlowchartDropCard, at: FlowchartDropAt, ctx: FlowchartDropContext): FlowchartDropPlan {\n    const sort = cardSort(card);\n    if (!ctx.editable(sort)) return refused({ why: \"readOnly\", kind: ctx.kindName(sort) });\n    if (!ctx.available(sort)) return refused({ why: \"busy\", kind: ctx.kindName(sort) });\n    // A card adding a row of a kind that adds none: its keys can't be typed, and it builds none (#1549).\n    const untyped = card.does === \"addState\" || card.does === \"addLane\" ? ctx.untyped(sort) : undefined;\n    if (untyped !== undefined) return refused({ why: \"untyped\", kind: ctx.kindName(sort), type: untyped });\n    const model = ctx.model;\n    switch (card.does) {\n        case \"addState\":\n            return at.type === \"lane\" ? planState(model, at.value.lane, Number(at.value.row), card.values, ctx.kindName(\"lanes\"))\n                : refused({ why: \"onto\", lands: \"lane\" });\n        case \"retype\":\n            return at.type === \"transition\"\n                ? whatTransition(model, at.value, (what) => ({ kind: \"retype\", key: at.value, values: card.values, what }))\n                : refused({ why: \"onto\", lands: \"transition\" });\n        case \"addLane\":\n            return at.type === \"gap\" && !model.standIn ? planLane(model, Number(at.value), card.values) : refused({ why: \"onto\", lands: \"gap\" });\n        case \"set\":\n            return planSet(card, at, model);\n    }\n}\n\n/**\n * The edits a plan writes, one step of the history: a state from the card's\n * values where it lands; a transition's values; a lane from the card's values\n * where it lands; an author's card's fields — none for a refusal.\n *\n * @param plan - The plan\n * @param holding - What the Flowchart holds now\n * @returns The edits and the key of the row they add; `undefined` for a refusal, or a kind taking no gesture\n */\nexport function dropEdits(plan: FlowchartDropPlan, holding: FlowchartHolding): GestureEdits | undefined {\n    switch (plan.kind) {\n        case \"refused\": return undefined;\n        case \"addState\": return dropState(holding, plan.band, plan.row, plan.values);\n        case \"retype\": return dropTransition(holding, plan.key, plan.values);\n        case \"addLane\": return dropLane(holding, plan.at, plan.values);\n        case \"set\": return setFields(holding, plan.sort, plan.key, plan.sets);\n    }\n}\n\n/**\n * What a drop brings onto the canvas, which it selects: the state or the lane\n * it added; nothing for a drop on a row.\n *\n * @param plan - The plan\n * @param edits - What it wrote\n * @returns The selection, or `undefined`\n */\nexport function droppedSelection(plan: FlowchartDropPlan, edits: GestureEdits): FlowchartSelection | undefined {\n    if (edits.key === undefined) return undefined;\n    if (plan.kind === \"addState\") return { kind: \"state\", key: edits.key };\n    if (plan.kind === \"addLane\") return { kind: \"lane\", key: edits.key };\n    return undefined;\n}\n\n// ── ⏎ on a card ───────────────────────────────────────────────────────────\n\n/**\n * Where ⏎ on a card drops it: on the canvas's selection. A state's card lands\n * after the selected state, in its band; with a lane selected, at the end of\n * that lane; with neither, at the end of the first band that takes states. A\n * lane's card lands after the selected lane, else at the band row's tail. Any\n * other card lands on the selected state, transition, decision or lane when it\n * lands on that. A selection the drawing no longer holds is none.\n *\n * @param lands - What the card lands on\n * @param selection - What the canvas has selected\n * @param model - What the Flowchart draws now\n * @returns Where it drops — the canvas, where the selection takes no such card\n */\nexport function enterAt(lands: FlowchartLands, selection: FlowchartSelection | null, model: FlowchartModel): FlowchartDropAt {\n    const picked = (kind: \"state\" | \"link\" | \"trigger\" | \"lane\"): string | undefined =>\n        (selection !== null && selection.kind === kind ? selection.key : undefined);\n    const laneOf = (key: string | undefined) => (key === undefined ? -1 : model.lanes.findIndex((l) => keyEqual(l.key, key) && l.band === \"lane\"));\n    switch (lands) {\n        case \"lane\": {\n            const key = picked(\"state\");\n            const node = key === undefined ? undefined : model.nodesByKey.get(key);\n            if (node !== undefined && !node.ghost && !node.dimmed && model.lanes[node.laneIndex]?.band !== \"noLane\") {\n                const states = bandStates(model, node.laneIndex);\n                const row = states.findIndex((state) => keyEqual(state.key, node.key)) + 1;\n                return variant(\"lane\", { lane: model.lanes[node.laneIndex]!.key, row: BigInt(row) });\n            }\n            // The selected lane, or else the first band that takes states: at its end.\n            const chosen = laneOf(picked(\"lane\"));\n            const index = chosen >= 0 ? chosen : model.lanes.findIndex((lane) => lane.band !== \"noLane\");\n            const band = model.lanes[index];\n            if (band === undefined) return ON_CANVAS;\n            return variant(\"lane\", { lane: band.key, row: BigInt(bandStates(model, index).length) });\n        }\n        case \"gap\": {\n            if (model.standIn) return ON_CANVAS;\n            const chosen = laneOf(picked(\"lane\"));\n            return variant(\"gap\", BigInt(chosen >= 0 ? chosen + 1 : model.lanes.filter((lane) => lane.band === \"lane\").length));\n        }\n        case \"state\": {\n            const key = picked(\"state\");\n            const node = key === undefined ? undefined : model.nodesByKey.get(key);\n            return node !== undefined && !node.ghost && !node.dimmed ? variant(\"state\", node.key) : ON_CANVAS;\n        }\n        case \"transition\": {\n            const key = picked(\"link\");\n            return key !== undefined && drawsTransition(model, key) ? variant(\"transition\", key) : ON_CANVAS;\n        }\n        case \"decision\": {\n            const key = picked(\"trigger\");\n            return key !== undefined && model.triggers.has(key) ? variant(\"decision\", key) : ON_CANVAS;\n        }\n        case \"header\": {\n            const key = picked(\"lane\");\n            return laneOf(key) >= 0 ? variant(\"header\", key!) : ON_CANVAS;\n        }\n    }\n}\n\n// ── Its marks ─────────────────────────────────────────────────────────────\n\n/** What the canvas marks while a drag rests where it lands: the band and the row a state takes, the gap a lane lands in, a lane's header, or what a card sets its fields on. */\nexport type FlowchartDropMark =\n    | { readonly kind: \"lane\"; readonly lane: string; readonly row: number }\n    | { readonly kind: \"gap\"; readonly at: number }\n    | { readonly kind: \"header\"; readonly lane: string }\n    | { readonly kind: \"state\" | \"transition\" | \"decision\"; readonly key: string };\n\n/**\n * What the canvas marks for a plan: the band a state lands in and its row,\n * the gap a lane lands in, the lane whose header a card sets, or the state,\n * transition or decision a card lands on — nothing for a refusal.\n *\n * @param plan - The plan\n * @returns The mark, or `undefined`\n */\nexport function markOf(plan: FlowchartDropPlan): FlowchartDropMark | undefined {\n    switch (plan.kind) {\n        case \"refused\": return undefined;\n        case \"addState\": return { kind: \"lane\", lane: plan.band, row: plan.row };\n        case \"addLane\": return { kind: \"gap\", at: plan.at };\n        case \"retype\": return { kind: \"transition\", key: plan.key };\n        case \"set\": {\n            switch (plan.sort) {\n                case \"states\": return { kind: \"state\", key: plan.key };\n                case \"transitions\": return { kind: \"transition\", key: plan.key };\n                case \"lanes\": return { kind: \"header\", lane: plan.key };\n                case \"decisions\": return { kind: \"decision\", key: plan.key };\n            }\n        }\n    }\n}\n\n/**\n * Whether two marks are one: what the canvas draws need not move.\n *\n * @param a - A mark, or none\n * @param b - Another, or none\n * @returns Whether they mark the same place\n */\nexport function markEqual(a: FlowchartDropMark | undefined, b: FlowchartDropMark | undefined): boolean {\n    if (a === undefined || b === undefined) return a === undefined && b === undefined;\n    switch (a.kind) {\n        case \"lane\": return b.kind === \"lane\" && keyEqual(a.lane, b.lane) && a.row === b.row;\n        case \"gap\": return b.kind === \"gap\" && a.at === b.at;\n        case \"header\": return b.kind === \"header\" && keyEqual(a.lane, b.lane);\n        default: return b.kind === a.kind && keyEqual(a.key, (b as { readonly key: string }).key);\n    }\n}\n\n// ── Its words ─────────────────────────────────────────────────────────────\n\n/**\n * What the ghost says of a plan: where a state lands — `after SRT in Sort` —\n * where a lane lands — `before Sort` — or what a card sets its fields on —\n * `onto SRT → LDD` — or, red, why it can't: `Drop onto a transition`.\n *\n * @param plan - The plan\n * @param m - The Flowchart's messages\n * @returns The caption; `undefined` for a refusal that says nothing\n */\nexport function dropCaption(plan: FlowchartDropPlan, m: FlowchartMessages): string | undefined {\n    switch (plan.kind) {\n        case \"addState\":\n        case \"addLane\": return m.dropPlace(plan.place);\n        case \"retype\":\n        case \"set\": return m.dropOnto({ what: m.dropWhat(plan.what) });\n        case \"refused\": return plan.why.why === \"gone\" ? undefined : m.dropRefused(plan.why);\n    }\n}\n\n/**\n * Why a plan is refused, as the footer says it for a card's ⏎.\n *\n * @param plan - The plan\n * @param m - The Flowchart's messages\n * @returns The words; `undefined` for a plan that lands, or a refusal that says nothing\n */\nexport function dropRefusal(plan: FlowchartDropPlan, m: FlowchartMessages): string | undefined {\n    return plan.kind === \"refused\" && plan.why.why !== \"gone\" ? m.dropRefused(plan.why) : undefined;\n}\n\n/**\n * Where a plan lands, as a screen reader hears the drag layer say it — `Sort,\n * after SRT`, `SRT → LDD` — or, refused, the canvas.\n *\n * @param plan - The plan\n * @param m - The Flowchart's messages\n * @returns The name\n */\nexport function dropName(plan: FlowchartDropPlan, m: FlowchartMessages): string {\n    switch (plan.kind) {\n        case \"addState\":\n        case \"addLane\": return m.dropPlaceName(plan.place);\n        case \"retype\":\n        case \"set\": return m.dropWhat(plan.what);\n        case \"refused\": return m.dropCanvas();\n    }\n}\n\n/**\n * A drop's step in the history, and its Save's — `Drop Held on Sort, after\n * SRT`.\n *\n * @param plan - The plan: one that lands\n * @param card - The card dropped\n * @param m - The Flowchart's messages\n * @returns The name\n */\nexport function dropLabel(plan: FlowchartDropPlan, card: FlowchartDropCard, m: FlowchartMessages): string {\n    return m.dropLabel({ card: card.label, onto: dropName(plan, m) });\n}\n\n// ── The canvas's part ─────────────────────────────────────────────────────\n\n/**\n * What the canvas hands the drag layer as its one drop cell: built by the\n * frame and held still while the Flowchart takes drops, its functions reading\n * the Flowchart as it stands. The canvas works out where a drag rests from its\n * own drawing, and marks it.\n */\nexport interface FlowchartCanvasDrop {\n    /** The surface the cell registers on: the Flowchart's drop target. */\n    readonly surface: string;\n    /** What a drag carries, as the Flowchart reads it — a card a tab of its library drops — or `undefined`. */\n    readonly cardOf: (payload: DragPayload) => FlowchartDropCard | undefined;\n    /** What a drop of a card where a drag rests does, over the Flowchart as it stands. */\n    readonly plan: (card: FlowchartDropCard, at: FlowchartDropAt) => FlowchartDropPlan;\n    /** The veto: whether the drop a candidate event makes lands. */\n    readonly canDrop: DropVeto;\n    /** What the ghost says where the drag rests, and that place's name for the announcements. */\n    readonly options: Required<Pick<DropCellOptions, \"caption\" | \"name\">>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's canvas (#1502, #1503, `Flowchart Records Spec.md` R6–R10,\n * R13, D4, D12) — the records drawn, with the canvas's options, in its frame's\n * main: lane bands, state cards, H/V-routed transitions, decision diamonds,\n * evidence badges, the legend and the minimap, with the dim ladder, the\n * selection, ⌥-click tracing and, where a kind edits, its gestures. The\n * dimensional contract (node 116×40 r6, 7px handle rings, fixed 6.5px\n * arrowheads butting the rings, dim ladder 1.0 / 0.45 / 0.15) lives in\n * `layout.ts` and the `flowchart` slot recipe, which stays in\n * east-ui-components' theme. Colours resolve through the recipe's `--fc-*`\n * variables (theme-aware, dark-mode overrides), which the Flowchart's root\n * sets. It draws no hover card: the inspector shows what is selected.\n *\n * - **The bands** are the model's: each lane of the app's, in its order; *No\n *   lane*, last, holding the states naming no lane the Flowchart holds (D12);\n *   or, given no lanes, one band holding every state. Only a lane of the\n *   app's takes a gesture of its own — a click on its header selects it, a\n *   double-click renames it, its × deletes it, its \"+ STATE\" adds a state to\n *   it — and the one band of a Flowchart given no lanes takes \"+ STATE\". *No\n *   lane* takes none: a state there is moved out of it.\n * - **A row the narrowing leaves out**, under `\"dim\"`, draws faded at the dim\n *   ladder's last step, marked `data-context`: no click, hover, drag or key\n *   reaches it, and no card lands on it (R6).\n * - **The selection** is the frame's (`selection.ts`): the canvas marks it and\n *   tells the frame each click — a state's card, a transition, a decision's\n *   diamond, or a lane's header; a shift-, ⌘- or Ctrl-click on a state puts it\n *   into a selection of several, or takes it out; a click on the canvas where\n *   nothing is, and Esc, select nothing. Esc is the canvas's from inside its\n *   frame — heard as it leaves the frame (the handle's `key`), never in a\n *   field being typed into nor from a layer portaled out of the frame — and\n *   from the page itself, nothing focused, while the pointer is over the\n *   canvas, at the window (`../shared/frame-keys.ts`). Every key the canvas\n *   acts on goes no further than the Flowchart (`takeKey`, #1398).\n * - **The gestures** are the frame's `edit`, one member per gesture, each\n *   there while its kind edits (R13); each is one step of the history: \"+\n *   LANE\" at the band row's tail; a lane's header double-clicked into its\n *   rename in place, and its × — off while the lane holds states, its tooltip\n *   saying why; the \"+ STATE\" ghost a hovered band parks under its last state,\n *   which opens the inline editor — its key and its label, a key the Flowchart\n *   holds already refused as it is typed, or its label alone where the states'\n *   kind makes their keys (#1549); a state double-clicked into its\n *   rename, its key shown fixed (R9); a state dragged to another lane, or —\n *   where the states carry an `order` — between two cards, a line marking\n *   where it lands (D4); a handle dragged to a state, which `canConnect` may\n *   veto, a drop on the source its in-place transition, a drop that would\n *   repeat a transition pulsing it instead; and Del — in the canvas, never in\n *   a field being typed into — deleting the selected state or states with\n *   their transitions, the transition, the decision, or the lane while it\n *   holds no state. A drag is its pointer's (east-ui-components'\n *   `followPointer`): no other pointer's moves carry it, and another finger's\n *   lift neither ends it nor lands it. One the browser takes the pointer back\n *   from, or the window loses the page under, lands nothing; one is in flight\n *   at a time, a new press letting go of one still held. And the canvas\n *   selects no text (the recipe's), so a card's drag never turns into the\n *   browser's own drag of its words, however often it is carried.\n * - **Drops**: where a tab of the library drops, the canvas is one drop cell\n *   of the shared drag layer, on the frame's drop target (`use-drop.ts`): it\n *   works out where a drag rests from its own drawing (`drop.ts`'\n *   `dropAtPoint`) — a band and the row a state takes there, a state, a\n *   transition, a lane's header, the gap a lane lands in, a decision's diamond\n *   — and, while the drop there lands, marks it: the band takes a wash and a\n *   line marks where the state lands; a line marks the gap a lane lands in;\n *   the state, the transition — the brand wash — or the diamond takes the\n *   brand. The marks show only while the drag rests over the canvas and the\n *   drop lands (the recipe's); a drag over the canvas raises no dimming and no\n *   \"+ STATE\" ghost.\n * - **The details** (#1510, R22–R34, R39): where the app puts a state's reads\n *   on the canvas, its card is 272 wide — its head, a rule, then the reads in\n *   their order (`details-card.tsx`), its tag lists' words measured out of\n *   sight as a card draws them, before the layout places it; a transition's\n *   label draws its lines under its evidence, a placeholder bar each while its\n *   row lands; and the legend adds a row for each figure, histogram and list\n *   the cards and labels draw, and beside them, one over another, a group for\n *   each tag list it lists (`details-draw.ts`), the layout keeping its height\n *   under the drawing.\n *\n * A read that failed is said once on the canvas (R5): the shared failure box\n * (`LoadingFailedBox`) at its box's top-left, in view however the drawing\n * scrolls — its words and its Retry the footer's loading line's — over what the\n * canvas drew, which stays as it was read; and over nothing, where nothing was.\n *\n * The canvas fills main and scrolls both ways inside it: its lanes run the\n * whole of main's height, and a Flowchart larger than main scrolls in its own\n * box, the frame's toolbar and footer staying put — and the minimap with\n * them, in main's corner over the canvas. Its toolbar's items and its footer\n * are the frame's (`toolbar.tsx`, `footer.tsx`): the model and the\n * orientation come from the frame, and what the frame selects — Find's pick, a\n * drop, an issue's row — comes as a `reveal`, which selects it and scrolls it\n * into view.\n *\n * **The zoom** (#1519, R42): the canvas opens at the cards' own size, and the\n * frame zooms it through its handle (`zoomBy`, `fit`) — about the view's\n * middle, held as a share of the drawing's width and height — between Fit and\n * that size, hearing where it stands (`onZoomRange`). Fit is the whole\n * flowchart in view, taken from the layout's own size (`layoutExtent`), the\n * size it draws at with no room to fill; a zoom Fit or Zoom out puts there\n * follows Fit as the flowchart and main change, and a zoom below a new Fit\n * comes up to it. The layout is computed for main's size over the zoom, so the\n * lanes fill main at any zoom, and the drawing is scaled from its corner\n * inside a box of the size it is drawn at, which main scrolls. The pointer,\n * the drops and a reveal's scroll read the canvas through the zoom; the\n * minimap, the lane pager and a failed read's box keep their size. A phone's\n * window holds as many whole lanes as the zoom fits, each lane keeping its\n * width. The zoom is the viewer's while the canvas is drawn, never\n * remembered, as its scroll is not.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, type Ref } from \"react\";\nimport { Box, Portal, Tooltip, chakra, useSlotRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faBan, faPlus, faRotateRight, faXmark } from \"@fortawesome/free-solid-svg-icons\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport {\n    getSomeorUndefined, takeKey, typedInto, useDragLayerOptional, useDropCell, type CellCoord, type DragPayload,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingFailedBox, followPointer, type PointerFollow } from \"@elaraai/east-ui-components/internal\";\nimport { keyFromPage, keyInFrame } from \"../shared/frame-keys.js\";\nimport type { FlowchartWords } from \"./messages.js\";\nimport type { FlowchartCanvasValue, FlowchartModel, ModelBand, ModelLink, ModelNode } from \"./model.js\";\nimport {\n    DETAILS_CARD_W, DETAILS_HEAD_H, detailsCardOf, detailsLabelOf, type FlowchartCard, type FlowchartDetailsModel, type FlowchartLabelLine,\n} from \"./details.js\";\nimport { FlowchartCardContent, FlowchartLegendMarkView, FlowchartTag, useFlowchartTextMeasure } from \"./details-card.js\";\nimport { legendHeight, legendOf, probeTextsOf } from \"./details-draw.js\";\nimport { shareText } from \"./details-words.js\";\nimport {\n    computeLayout, labelBox, landingSeam, layoutExtent, previewCursorPath, previewLinkPath,\n    type FlowchartLayout, type LabelBox, type LinkRoute, type Pt,\n    BADGE_H, LABEL_LINE_H, LANE_HEADER_H, NODE_W, RING_R,\n} from \"./layout.js\";\nimport { FlowchartLanePager } from \"./lane-pager.js\";\nimport { dropTargetAt, existingLink, laneAt } from \"./connect.js\";\nimport {\n    ON_CANVAS, dropAtPoint, gapLine, landsOf, markEqual, markOf, printDropAt, readDropAt, rowAt,\n    type FlowchartCanvasDrop, type FlowchartDropMark,\n} from \"./drop.js\";\nimport { selectedStates, toggleState, type FlowchartSelection } from \"./selection.js\";\nimport type { FlowchartOrientation } from \"./toolbar.js\";\nimport type { ZoomRange } from \"../shared/schedule/zoom.js\";\n\ntype SelectFn = ((key: string) => unknown) | undefined;\n\n/**\n * What the frame asks the canvas to select and bring into view: a state Find\n * picked or a drop added, or what a click in the inspector names — a\n * transition in a state's Details, an issue's row — once per ask.\n */\nexport interface FlowchartReveal {\n    /** What to select. */\n    readonly selection: FlowchartSelection;\n    /** The ask's number: each a new one, so a second ask of one thing reveals it again. */\n    readonly seq: number;\n    /** `false`: selected where it stands, never scrolled — a state dropped where the pointer is, a key edited in the inspector. */\n    readonly scroll?: boolean | undefined;\n}\n\n/** Where a drag rests over the canvas before it says otherwise: the canvas itself. */\nconst CANVAS_AT = printDropAt(ON_CANVAS);\n\n/** How far inside the canvas's box a failed read's box sits, from its top-left (R5), in px: the Schematic's. */\nconst FAILED_INSET_PX = 16;\n\n/** A read that failed, as the canvas says it (R5): the footer's loading line's words, and its Retry. */\nexport interface FlowchartCanvasFailure {\n    /** Its words: `Couldn't read states`. */\n    readonly message: string;\n    /** Asks again. */\n    readonly retry: () => void;\n}\n\nconst keyEqual = equalFor(StringType);\n\n/**\n * The canvas's gestures, each one step of the history, made by the frame —\n * each there while the kind it writes edits (R13), and left out otherwise. The\n * canvas hands each what it gathered — keys, labels, bands — and the frame\n * records what it changes.\n */\nexport interface FlowchartCanvasEdit {\n    /** \"+ LANE\": a lane at the band row's tail. */\n    readonly addLane?: (() => void) | undefined;\n    /** A lane's header renamed. */\n    readonly renameLane?: ((key: string, label: string) => void) | undefined;\n    /** A lane's ×: deleted, while it holds no state. */\n    readonly deleteLane?: ((key: string) => void) | undefined;\n    /**\n     * The \"+ STATE\" ghost's editor committed: a state at the end of its band, its key and its label as typed — its key\n     * `undefined` where the editor types none, the kind making it (#1549); whether it was recorded.\n     */\n    readonly addState?: ((band: string, key: string | undefined, label: string) => boolean) | undefined;\n    /**\n     * Whether the Flowchart holds a state of a key already: the \"+ STATE\" editor refuses it as it is typed. The editor\n     * types a key only with it: without, the states' kind makes each one's (#1549).\n     */\n    readonly stateKeyTaken?: ((key: string) => boolean) | undefined;\n    /**\n     * Why \"+ STATE\" or \"+ LANE\" adds nothing (#1549): its kind's keys are of a type the form can't type, and it builds\n     * none — the control off, its tooltip saying why.\n     */\n    readonly off?: { readonly states?: string | undefined; readonly lanes?: string | undefined } | undefined;\n    /** A state's editor committed: its label. */\n    readonly renameState?: ((key: string, label: string) => void) | undefined;\n    /** States dragged to a band — and, where the states carry an `order`, to a place among its other states. */\n    readonly moveStates?: ((keys: readonly string[], band: string, at?: number) => void) | undefined;\n    /** Del on the selected state or states: each deleted with its transitions. */\n    readonly deleteStates?: ((keys: readonly string[]) => void) | undefined;\n    /** A handle dragged to a state; the state itself for an in-place transition. */\n    readonly connect?: ((from: string, to: string) => void) | undefined;\n    /** Del on a selected transition. */\n    readonly deleteLink?: ((key: string) => void) | undefined;\n    /** Del on a selected decision: cleared from the transitions it governs. */\n    readonly deleteDecision?: ((key: string) => void) | undefined;\n}\n\n/** What the frame hears the canvas's keys through (#1398), and zooms it through (R42). */\nexport interface FlowchartCanvasHandle {\n    /**\n     * Hears a key from inside the frame as it leaves it — after every part of it that takes keys of its own: Esc, the\n     * canvas's, taken there where it acts, going no further.\n     */\n    key(event: React.KeyboardEvent<HTMLElement>): void;\n    /**\n     * Zooms by a factor, never past Fit nor the cards' own size, bringing what is selected to the view's middle, and\n     * about the view's middle when nothing is: Zoom out and Zoom in (R42).\n     */\n    zoomBy(factor: number): void;\n    /** Puts the whole flowchart in view, and keeps it there as the flowchart and main change: Fit (R42). */\n    fit(): void;\n}\n\n/** Props of {@link FlowchartCanvasView}. */\nexport interface FlowchartCanvasViewProps {\n    /** What the canvas draws the records with. */\n    readonly canvas: FlowchartCanvasValue;\n    /** The keys of the states holding a conflict not yet chosen: their nodes wear the warn ring. None by default. */\n    readonly conflicted?: ReadonlySet<string> | undefined;\n    /**\n     * The keys of the states whose rows hold a number outside its field's bounds, stored or changed (#1585): their nodes\n     * wear the warn ring too. None by default.\n     */\n    readonly bounded?: ReadonlySet<string> | undefined;\n    /** The view model: the records, the drafts in place. */\n    readonly model: FlowchartModel;\n    /** The details model: each card's size where the details draw on the cards, and each label's lines (R22, R32). */\n    readonly details: FlowchartDetailsModel;\n    /** Left to right, or top down. */\n    readonly orientation: FlowchartOrientation;\n    /** What the frame asked the canvas to select and bring into view last, or `null`. */\n    readonly reveal: FlowchartReveal | null;\n    /** The gestures, where a kind edits; `undefined`, no kind edits, and the selection and the dim ladder stay. */\n    readonly edit: FlowchartCanvasEdit | undefined;\n    /** The canvas's drop cell, where a tab of the library drops; `undefined`, it takes no drop. */\n    readonly drop?: FlowchartCanvasDrop | undefined;\n    /** What is selected: the frame's, as the canvas draws the records. */\n    readonly selection: FlowchartSelection | null;\n    /** Selects something, or nothing — a click, a shift-click, Esc, a click where nothing is: the frame's selection moves. */\n    readonly onSelect: (selection: FlowchartSelection | null) => void;\n    /** The Flowchart's words: the gestures' names, and its counts in the app's locale. */\n    readonly words: FlowchartWords;\n    /** The structural storage key. */\n    readonly storageKey: string;\n    /** Hands the frame the canvas's element, which fills main: what the frame measures main's width by. */\n    readonly onElement?: ((element: HTMLDivElement | null) => void) | undefined;\n    /** A read that failed, said once at the canvas's top-left with Retry; `undefined` while none has. */\n    readonly failure?: FlowchartCanvasFailure | undefined;\n    /** The canvas's handle, the frame's: what a key from inside the frame reaches the canvas through, and what zooms it. */\n    readonly ref?: Ref<FlowchartCanvasHandle> | undefined;\n    /** Told whether the zoom stands at Fit and at the cards' own size, as either changes (R42): the toolbar's Zoom out and Zoom in are off there. */\n    readonly onZoomRange?: ((range: ZoomRange) => void) | undefined;\n}\n\n/** All East callbacks route through one funnel: microtask + try/catch. */\nfunction dispatchEast(name: string, run: () => unknown): void {\n    queueMicrotask(() => {\n        try {\n            const out = run();\n            if (out instanceof Promise) out.catch(err => console.error(`[Flowchart] ${name} callback failed:`, err));\n        } catch (err) {\n            console.error(`[Flowchart] ${name} callback failed:`, err);\n        }\n    });\n}\n\n// ── Palette — recipe-defined vars mirroring the spec's DS tokens ──────────\nconst INK = \"var(--fc-ink)\";            // planned stroke + badge numerals (--ink-2)\nconst INK_3 = \"var(--fc-ink3)\";         // secondary text (--ink-3)\nconst PAPER = \"var(--fc-paper)\";        // card / badge fill (--paper)\nconst LANE_TINT = \"var(--fc-lane)\";     // alternating band fill (--paper-2)\nconst RULE_STRONG = \"var(--fc-rule-strong)\";\nconst INFO = \"var(--fc-info)\";          // observed (--info)\nconst BRAND = \"var(--fc-brand)\";        // selection halo (--brand)\nconst BRAND_D = \"var(--fc-brand-d)\";    // selection stroke, diamonds (--brand-d)\nconst BRAND_DD = \"var(--fc-brand-dd)\";  // selected badge numerals (--brand-dd)\nconst NEG = \"var(--fc-neg)\";            // unresolved (--neg)\n\nconst CLASS_STROKE = { planned: INK, observed: INFO, unresolved: NEG } as const;\nconst CLASS_DASH = { planned: undefined, observed: \"5 4\", unresolved: \"4 4\" } as const;\nconst CLASS_MARKER = { planned: \"ink\", observed: \"info\", unresolved: \"neg\" } as const;\n\nconst MONO = \"var(--chakra-fonts-mono)\";\n\ntype Hover = { kind: \"state\" | \"link\" | \"trigger\"; key: string } | null;\ntype Selection = FlowchartSelection | null;\n\n/** Dim ladder per the spec — three steps only, opacity only. A row the narrowing leaves out stands at its last. */\nconst FOCUS = 1.0, CONTEXT = 0.45, FADED = 0.15;\n\ninterface DimSets {\n    active: boolean;\n    restLevel: number;\n    nodes: ReadonlySet<string>;\n    links: ReadonlySet<string>;\n}\n\nconst NO_DIM: DimSets = { active: false, restLevel: CONTEXT, nodes: new Set(), links: new Set() };\n\nfunction computeDim(model: FlowchartModel, hover: Hover): DimSets {\n    if (hover === null) return NO_DIM;\n    const nodes = new Set<string>();\n    const links = new Set<string>();\n    if (hover.kind === \"state\") {\n        nodes.add(hover.key);\n        for (const l of model.links) {\n            if (keyEqual(l.from, hover.key) || keyEqual(l.to, hover.key)) {\n                links.add(l.key);\n                nodes.add(l.from);\n                nodes.add(l.to);\n            }\n        }\n        return { active: true, restLevel: CONTEXT, nodes, links };\n    }\n    if (hover.kind === \"link\") {\n        const l = model.links.find(x => keyEqual(x.key, hover.key));\n        if (l) { links.add(l.key); nodes.add(l.from); nodes.add(l.to); }\n        return { active: true, restLevel: CONTEXT, nodes, links };\n    }\n    const t = model.triggers.get(hover.key);\n    if (t) {\n        for (const key of t.governs) {\n            links.add(key);\n            const l = model.links.find(x => keyEqual(x.key, key));\n            if (l) { nodes.add(l.from); nodes.add(l.to); }\n        }\n        for (const q of t.queue) nodes.add(q);\n    }\n    return { active: true, restLevel: FADED, nodes, links };\n}\n\n/** Ring colour per the spec connector anatomy: brand if any attached link\n * is selected, info if only observed links attach, otherwise ink. */\nfunction portColor(attached: ModelLink[], selectedLink: string | null): string {\n    if (attached.some(l => selectedLink !== null && keyEqual(l.key, selectedLink))) return BRAND_D;\n    if (attached.length > 0 && attached.every(l => l.cls === \"observed\")) return INFO;\n    if (attached.length > 0 && attached.every(l => l.cls === \"unresolved\")) return NEG;\n    return INK;\n}\n\n/** How many lanes a phone's window shows at once, unless the canvas's `narrow.lanes` says. */\nconst PHONE_LANES = 2;\n/** A phone's main: 560 wide or narrower, as the frame's phone is. */\nconst PHONE_MAIN = 560;\n/** Beside a phone's lane's card, however many lanes it is told to show: room for its handles. A lane is counted at its card's width and this (R40). */\nconst PHONE_LANE_ROOM = 16;\n\n/**\n * A label line's words (R32): a figure's label, its value in the app's locale\n * and its unit — *no data* where the row lacks it (R25); an item's name and\n * its share (R29); *none*; a list the rail's picks weigh, of a row holding\n * none of them, its label and *no data* (#1522); a placeholder's, none.\n *\n * @param line - The line\n * @param words - The flowchart's words\n * @returns Its words\n */\nfunction labelLineText(line: FlowchartLabelLine, words: FlowchartWords): string {\n    switch (line.kind) {\n        case \"placeholder\": return \"\";\n        case \"figure\": return line.value === undefined ? `${line.label} ${words.m.detailsNoData()}` : `${line.label} ${words.number(line.value)}${line.unit === undefined ? \"\" : ` ${line.unit}`}`;\n        case \"item\": return `${line.name} ${shareText(line.share, words)}`;\n        case \"none\": return words.m.detailsNone();\n        case \"noData\": return `${line.label} ${words.m.detailsNoData()}`;\n    }\n}\n\n/** What a placeholder line counts as across a label's box, while its row lands (R34): ten characters. */\nconst PLACEHOLDER_LINE = \"0\".repeat(10);\n/** A placeholder line's bar on a label: 6 high, centred on its line, as wide as its ten characters. */\nconst PLACEHOLDER_BAR = { w: 58, h: 6, above: 6.5 } as const;\n/** A label's first line's baseline under its box's top: the evidence's (BADGE_H / 2 + 3.5, mono 10). */\nconst LABEL_BASELINE = BADGE_H / 2 + 3.5;\n\n/** A lane's ×: its box's side, centred on its glyph. */\nconst CLOSE_BOX = 14;\n/** A lane header's middle above its baseline: half the height of its caps, mono 12px. */\nconst HEAD_MIDDLE = 4.5;\n\n/**\n * Where a lane's header stands: its anchor — the band's middle across the top\n * in LR, its start down the side in TD — its baseline, and the middle of its\n * ×, past the label's end (mono 12 / ls 2.6 ⇒ ~9.8px a glyph).\n *\n * @param layout - The laid-out records\n * @param lane - The lane's band\n * @returns The header's anchor and baseline, whether it runs down the side, and its ×'s middle\n */\nfunction laneHead(layout: FlowchartLayout, lane: FlowchartLayout[\"lanes\"][number]): { x: number; y: number; td: boolean; close: number } {\n    const td = layout.orientation === \"TD\";\n    const x = td ? 12 : lane.cx;\n    const y = td ? lane.y + 24 : 26;\n    const labelW = lane.label.length * 9.8;\n    return { x, y, td, close: (td ? x + labelW + 12 : x + labelW / 2 + 14) + 3.5 };\n}\n\n/**\n * Where a click on a lane's header lands: the band's strip before its first\n * row — across the band's top in LR; in TD, down to the header's × along the\n * band's side — so nobody has to hit the label's letters.\n *\n * @param layout - The laid-out records\n * @param lane - The lane's band\n * @returns The strip, in the canvas's px\n */\nfunction laneHeadBox(layout: FlowchartLayout, lane: FlowchartLayout[\"lanes\"][number]): { x: number; y: number; w: number; h: number } {\n    if (layout.orientation !== \"TD\") return { x: lane.x, y: lane.y, w: lane.w, h: LANE_HEADER_H };\n    return { x: lane.x, y: lane.y, w: Math.max(0, laneHead(layout, lane).close - CLOSE_BOX / 2 - lane.x), h: LANE_HEADER_H };\n}\n\n/**\n * The point of the canvas a selection is brought to the middle of the view\n * at: a state's card, a transition's longest stretch — an in-place one's state —\n * a decision's first diamond, a lane's header, or several states' first.\n *\n * @param layout - The laid-out records\n * @param model - The view model\n * @param selection - What is selected\n * @returns The point, or `undefined` for what the canvas draws nowhere\n */\nfunction revealPoint(layout: FlowchartLayout, model: FlowchartModel, selection: FlowchartSelection): Pt | undefined {\n    const nodeAt = (key: string): Pt | undefined => {\n        const rect = layout.nodes.get(key);\n        return rect === undefined ? undefined : { x: rect.cx, y: rect.cy };\n    };\n    switch (selection.kind) {\n        case \"state\": return nodeAt(selection.key);\n        case \"states\": return selection.keys.length === 0 ? undefined : nodeAt(selection.keys[0]!);\n        case \"link\": {\n            const route = layout.routes.find((r) => keyEqual(r.key, selection.key));\n            if (route !== undefined) return route.mid;\n            const folded = model.nodes.find((n) => n.inPlaceKeys.some((k) => keyEqual(k, selection.key)));\n            return folded === undefined ? undefined : nodeAt(folded.key);\n        }\n        case \"trigger\": {\n            const governs = model.triggers.get(selection.key)?.governs ?? [];\n            const route = layout.routes.find((r) => governs.some((k) => keyEqual(k, r.key)));\n            return route?.mid;\n        }\n        case \"lane\": {\n            const lane = layout.lanes.find((l) => keyEqual(l.key, selection.key));\n            if (lane === undefined) return undefined;\n            const head = laneHead(layout, lane);\n            return { x: head.x, y: head.y };\n        }\n    }\n}\n\n/**\n * Whether the card a selection is brought to still waits on its details: a\n * state's card — the first of several — drawn with reads whose row no read\n * has brought yet, and no read failed. Until its row lands the card draws a\n * placeholder, and it takes its own height as it lands (R22, R34); a failed\n * read leaves the placeholder standing.\n *\n * @param selection - What is selected\n * @param cards - Each state's card, where the details draw on the cards\n * @param states - The states' details\n * @returns Whether its card is still to land\n */\nfunction awaitsRow(selection: FlowchartSelection, cards: ReadonlyMap<string, FlowchartCard> | undefined, states: FlowchartDetailsModel[\"states\"]): boolean {\n    const key = selection.kind === \"state\" ? selection.key : selection.kind === \"states\" ? selection.keys[0] : undefined;\n    return key !== undefined && states !== undefined && states.error === undefined && cards?.has(key) === true && !states.rows.has(key);\n}\n\n/** Badge chrome inherits the link class (spec markup: observed = dashed\n * info; selected = solid brand-d border, brand-dd numerals). */\nfunction badgeStyle(cls: ModelLink[\"cls\"], selected: boolean): { stroke: string; dash: string | undefined; text: string } {\n    if (selected) return { stroke: BRAND_D, dash: undefined, text: BRAND_DD };\n    if (cls === \"observed\") return { stroke: INFO, dash: \"4 3\", text: INFO };\n    if (cls === \"unresolved\") return { stroke: NEG, dash: \"4 3\", text: NEG };\n    return { stroke: RULE_STRONG, dash: undefined, text: INK };\n}\n\n/** The states a band draws, in its order — its ghosts left out: the rows a moved or dropped state lands among. */\nfunction bandStates(model: FlowchartModel, band: number): ModelNode[] {\n    return model.nodes.filter((node) => node.laneIndex === band && !node.ghost).sort((a, b) => a.laneOrder - b.laneOrder);\n}\n\n/** A state moved by its card: where the pointer is, the band under it, and — where the states carry an order — the row of that band it lands at. */\ninterface MoveDrag {\n    readonly key: string;\n    readonly x: number;\n    readonly y: number;\n    /** The band under the pointer, by its key; `null` for none, or one taking no state. */\n    readonly overLane: string | null;\n    /** The row of that band it lands at, among the band's states as drawn — the line's place; `null` where the band's order is not the states'. */\n    readonly row: number | null;\n}\n\n/**\n * The canvas: the records, drawn with the canvas's options, filling its\n * frame's main — see the module docs.\n *\n * @param props - The canvas's options, the view model, the orientation, what to reveal, the gestures, the drop cell, the selection and what selects, the words, the storage key, the frame's handle and what hears the zoom\n * @returns The canvas's box, which scrolls the records inside it\n */\nexport function FlowchartCanvasView({\n    canvas, model, details, orientation, reveal, edit, drop, selection, onSelect, words, storageKey, onElement, failure, ref, conflicted, bounded, onZoomRange,\n}: FlowchartCanvasViewProps) {\n    const styles = useSlotRecipe({ key: \"flowchart\" })();\n\n    // ── decode ────────────────────────────────────────────────────────────\n    const legendOn = getSomeorUndefined(canvas.legend) ?? true;\n    const minimapOpt = getSomeorUndefined(canvas.minimap);\n\n    const onSelectStateFn = useMemo(() => getSomeorUndefined(canvas.onSelectState) as SelectFn, [canvas.onSelectState]);\n    const onSelectLinkFn = useMemo(() => getSomeorUndefined(canvas.onSelectLink) as SelectFn, [canvas.onSelectLink]);\n    const onSelectTriggerFn = useMemo(() => getSomeorUndefined(canvas.onSelectTrigger) as SelectFn, [canvas.onSelectTrigger]);\n    const onTracePathFn = useMemo(() => getSomeorUndefined(canvas.onTracePath) as SelectFn, [canvas.onTracePath]);\n    const canConnectFn = useMemo(\n        () => getSomeorUndefined(canvas.canConnect) as ((from: string, to: string) => boolean) | undefined,\n        [canvas.canConnect]);\n\n    // What each band is: only a lane of the app's takes a gesture of its own; No lane takes none.\n    const bands = useMemo(() => new Map<string, ModelBand>(model.lanes.map((lane) => [lane.key, lane.band])), [model]);\n    const isLane = useCallback((key: string) => bands.get(key) === \"lane\", [bands]);\n    /** Whether a band takes a state — \"+ STATE\", a move, a drop: a lane of the app's, or the one band of a Flowchart given no lanes. */\n    const takesStates = useCallback((key: string) => { const band = bands.get(key); return band === \"lane\" || band === \"all\"; }, [bands]);\n\n    // ── view state ────────────────────────────────────────────────────────\n    // The selection is the frame's: its latest, for the keys, and what moves it.\n    const selectionRef = useRef<Selection>(selection);\n    selectionRef.current = selection;\n    const onSelectRef = useRef(onSelect);\n    onSelectRef.current = onSelect;\n    const pickedStates = selectedStates(selection);\n    const [hover, setHover] = useState<Hover>(null);\n    // The dimming, for Esc: what it puts back.\n    const hoverRef = useRef<Hover>(hover);\n    hoverRef.current = hover;\n    // A drag in flight: it raises no dimming and no \"+ STATE\" ghost.\n    const dragging = useDragLayerOptional()?.active ?? false;\n    const draggingRef = useRef(dragging);\n    draggingRef.current = dragging;\n    /** What the pointer is over, for the dim ladder — never while a drag is in flight. */\n    const hoverOn = useCallback((next: Hover) => { if (!draggingRef.current) setHover(next); }, []);\n\n    // Connect-drag draft (one object; pure helpers live in connect.ts).\n    const [draft, setDraft] = useState<{\n        from: string; side: \"left\" | \"right\" | \"top\" | \"bottom\";\n        x: number; y: number; over: string | null; allowed: boolean; dup: string | undefined;\n    } | null>(null);\n    const draftRef = useRef<typeof draft>(null);\n    draftRef.current = draft;\n    // One pulse mechanism for both outcomes: a drop that would duplicate an\n    // existing link pulses IT; a successful create pulses the new link once\n    // its row arrives. Matched by endpoints, auto-cleared.\n    const [pulse, setPulse] = useState<{ from: string; to: string; seq: number } | null>(null);\n    // Inline lane-header rename (one object; commit → the rename).\n    const [laneEdit, setLaneEdit] = useState<{ key: string; label: string } | null>(null);\n    // \"+ STATE\" ghost reveal (spec Flowchart.Lane): one hovered band at a time.\n    const [laneHover, setLaneHover] = useState<string | null>(null);\n    // One inline node editor for BOTH the ghost's commit — a new state's key and label — and a double-click's rename.\n    const [stateEditor, setStateEditor] = useState<\n        | { mode: \"add\"; lane: string; code: string; label: string }\n        | { mode: \"edit\"; key: string; label: string; was: string }\n        | null\n    >(null);\n    // A state dragged by its card (one object; the candidate band and the line where it lands live).\n    const [moveDrag, setMoveDrag] = useState<MoveDrag | null>(null);\n    const moveDragRef = useRef<MoveDrag | null>(null);\n    moveDragRef.current = moveDrag;\n    const movedRef = useRef(false);\n    useEffect(() => {\n        if (pulse === null) return;\n        const t = setTimeout(() => setPulse(null), 1100);\n        return () => clearTimeout(t);\n    }, [pulse]);\n    // A drag picked up: the state or transition the pointer rested on lets go of its dimming.\n    useEffect(() => {\n        if (!dragging) return;\n        setHover(null);\n    }, [dragging]);\n\n    // ── measure ───────────────────────────────────────────────────────────\n    const bodyRef = useRef<HTMLDivElement | null>(null);\n    // The body's element, the frame's too: what it measures main's width by.\n    const onBody = useCallback((element: HTMLDivElement | null) => {\n        bodyRef.current = element;\n        onElement?.(element);\n    }, [onElement]);\n    const [size, setSize] = useState<{ w: number; h: number } | null>(null);\n    useLayoutEffect(() => {\n        const el = bodyRef.current;\n        if (!el) return;\n        const measure = (): void => setSize({ w: el.clientWidth, h: el.clientHeight });\n        measure();\n        const ro = new ResizeObserver(measure);\n        ro.observe(el);\n        return () => ro.disconnect();\n    }, []);\n\n    // ── sizes: each card's where the details draw on the cards, measured as it draws, and each label's (R22, R32) ──\n    // The tag lists' words, measured out of sight in the slots a card draws them with, before the layout places it.\n    const probeTexts = useMemo(() => probeTextsOf(details.states, words), [details.states, words]);\n    const { measure, probe } = useFlowchartTextMeasure(styles, probeTexts);\n    const cardsByKey = useMemo(() => {\n        const kind = details.states;\n        if (kind === undefined || !kind.onCanvas) return undefined;\n        // A ghost stands for no row, so it has no reads: the card's width and 40.\n        const out = new Map<string, FlowchartCard>();\n        for (const node of model.nodes) {\n            const card = node.ghost ? undefined : detailsCardOf(kind, node.key, measure);\n            if (card !== undefined) out.set(node.key, card);\n        }\n        return out;\n    }, [model, details.states, measure]);\n    const cards = useMemo(() => (cardsByKey === undefined ? undefined : {\n        width: DETAILS_CARD_W,\n        heights: new Map([...cardsByKey].map(([key, card]) => [key, card.height] as const)),\n    }), [cardsByKey]);\n    const labels = useMemo(() => {\n        const kind = details.transitions;\n        if (kind === undefined || !kind.onCanvas) return undefined;\n        // Its evidence line, then its details' lines: a label with neither draws none.\n        const sizes = new Map<string, LabelBox>();\n        const lines = new Map<string, readonly FlowchartLabelLine[]>();\n        for (const link of model.links) {\n            const detail = detailsLabelOf(kind, link.key);\n            const texts = [\n                ...(link.badgeText === undefined ? [] : [link.badgeText]),\n                ...detail.map((line) => (line.kind === \"placeholder\" ? PLACEHOLDER_LINE : labelLineText(line, words))),\n            ];\n            if (texts.length === 0) continue;\n            sizes.set(link.key, labelBox(texts));\n            lines.set(link.key, detail);\n        }\n        return { sizes, lines };\n    }, [model, details.transitions, words]);\n    // What the legend adds of the details: its rows and its groups of tags, and the room the layout keeps for it (§4).\n    const legend = useMemo(() => legendOf(details, words), [details, words]);\n    const legendPad = legendOn ? legendHeight(legend, measure) : 0;\n\n    // A phone's window of lanes, left to right: as many across main's width as the canvas's `narrow.lanes` says, which\n    // its pager steps through — as many whole lanes as main holds, each counted at its card's width and 16, so none is\n    // cut however many it is told to show, and the readout says what shows — and never more than the flow has, so the\n    // window never ends at an empty slot: a flow of one lane fills it. The lanes fill the window; where the details\n    // draw on the cards a phone holds one, keeping its width — at least the window's — and each step brings its card\n    // to the window's middle (R40, D24). Top down, the lanes stack and the view scrolls down them.\n    const narrow = getSomeorUndefined(canvas.narrow);\n    const narrowLanes = narrow === undefined ? undefined : getSomeorUndefined(narrow.lanes);\n    const lanesAsked = narrowLanes === undefined ? PHONE_LANES : Number(narrowLanes);\n    const laneLeast = (cards?.width ?? NODE_W) + PHONE_LANE_ROOM;\n    const windowed = size !== null && size.w > 0 && size.w <= PHONE_MAIN && orientation === \"LR\";\n    const lanesInView = windowed ? Math.max(1, Math.min(lanesAsked, Math.floor(size.w / laneLeast), model.lanes.length)) : lanesAsked;\n    const laneWidth = windowed && cards === undefined ? Math.max(laneLeast, Math.floor(size.w / lanesInView)) : undefined;\n    // The one lane the window holds where the details draw on the cards: at least the window's width, so no other lane shows beside it.\n    const laneWindow = windowed && cards !== undefined ? size.w : undefined;\n\n    // ── zoom (R42) ────────────────────────────────────────────────────────\n    // The viewer's zoom: a scale — 1, the cards' own size, where the canvas opens — or Fit, which follows the flowchart's\n    // size. Fit is taken from the layout's own size, the size it draws at with no room to fill, so it never waits on the\n    // layout it sets.\n    const [chosen, setChosen] = useState<number | \"fit\">(1);\n    const fit = useMemo(() => {\n        if (size === null || size.w <= 0 || size.h <= 0) return 1;\n        const own = layoutExtent(model, { orientation, legendPad, laneWidth, laneWindow, cards, labels: labels?.sizes });\n        return Math.min(1, size.w / own.width, size.h / own.height);\n    }, [model, size, orientation, legendPad, laneWidth, laneWindow, cards, labels]);\n    // Never past either end: a zoom below a new Fit comes up to it.\n    const zoom = chosen === \"fit\" ? fit : Math.min(1, Math.max(fit, chosen));\n    const zoomRef = useRef(zoom);\n    zoomRef.current = zoom;\n    const fitRef = useRef(fit);\n    fitRef.current = fit;\n    const layout: FlowchartLayout | null = useMemo(\n        () => (size === null ? null : computeLayout(model, {\n            // The lanes fill main at any zoom: laid out for main's size over it.\n            width: size.w / zoom,\n            orientation,\n            legendPad,\n            // The lanes run the whole of main's height.\n            minHeight: size.h > 0 ? size.h / zoom : undefined,\n            laneWidth,\n            laneWindow,\n            cards,\n            labels: labels?.sizes,\n        })),\n        [model, size, zoom, orientation, legendPad, laneWidth, laneWindow, cards, labels],\n    );\n    // The window's lane: where the details draw on the cards, wider than the window, which rests with its card in the middle.\n    const laneSlot = layout?.lanes[0]?.w ?? 0;\n    // The whole lanes a phone's window holds: each lane as wide as the zoom draws it, so more of them zoomed out (R42).\n    const lanesShown = windowed && laneSlot > 0 ? Math.max(lanesInView, Math.floor(size.w / (laneSlot * zoom) + 1e-6)) : lanesInView;\n    // The toolbar hears where the zoom stands: at Fit, Zoom out is off; at the cards' own size, Zoom in.\n    const atFit = zoom <= fit + 1e-9;\n    const atLimit = zoom >= 1 - 1e-9;\n    useEffect(() => { onZoomRange?.({ atFit, atLimit }); }, [onZoomRange, atFit, atLimit]);\n\n    // ── drops ─────────────────────────────────────────────────────────────\n    // The canvas is one drop cell: where a drag rests is worked out from the\n    // drawing as it stands, and marked while the drop there lands.\n    const layoutRef = useRef(layout);\n    layoutRef.current = layout;\n    const modelRef = useRef(model);\n    modelRef.current = model;\n    const wrapRef = useRef<HTMLDivElement | null>(null);\n    const [dropMark, setDropMark] = useState<FlowchartDropMark | undefined>(undefined);\n    // The drag over: nothing stays marked.\n    useEffect(() => { if (!dragging) setDropMark(undefined); }, [dragging]);\n    /** Where a drag rests at a client point, for what it carries: the coordinate its drop's `CellRef` names. */\n    const resolveDrop = useCallback((clientX: number, clientY: number, payload: DragPayload): CellCoord => {\n        const surface = drop?.surface ?? \"\";\n        const card = drop?.cardOf(payload);\n        const drawn = layoutRef.current;\n        const wrap = wrapRef.current;\n        if (card === undefined || drawn === null || wrap === null) return { surface, row: CANVAS_AT, slot: \"\" };\n        // The pointer over the drawing, in its own px: the drawing is scaled from its corner at the zoom (R42).\n        const box = wrap.getBoundingClientRect();\n        const z = zoomRef.current;\n        return { surface, row: printDropAt(dropAtPoint(landsOf(card), drawn, modelRef.current, { x: (clientX - box.left) / z, y: (clientY - box.top) / z })), slot: \"\" };\n    }, [drop]);\n    /** The drag rests where its drop lands: the canvas marks it. */\n    const hoverDrop = useCallback((clientX: number, clientY: number, payload: DragPayload) => {\n        const card = drop?.cardOf(payload);\n        const at = readDropAt(resolveDrop(clientX, clientY, payload).row);\n        const mark = drop === undefined || card === undefined || at === undefined ? undefined : markOf(drop.plan(card, at));\n        setDropMark((was) => (markEqual(was, mark) ? was : mark));\n    }, [drop, resolveDrop]);\n    const dropOptions = useMemo(() => (drop === undefined ? undefined : { ...drop.options, onHover: hoverDrop }), [drop, hoverDrop]);\n    const dropCell = useDropCell(drop === undefined || layout === null ? null : { surface: drop.surface, row: CANVAS_AT, slot: \"\" },\n        false, drop?.canDrop, resolveDrop, dropOptions);\n    const setWrap = useCallback((el: HTMLDivElement | null) => {\n        wrapRef.current = el;\n        dropCell(el);\n    }, [dropCell]);\n\n    // ── dim ladder ────────────────────────────────────────────────────────\n    const dim = useMemo(() => computeDim(model, hover), [model, hover]);\n    const nodeOpacity = (node: ModelNode): number =>\n        (node.dimmed ? FADED : !dim.active ? FOCUS : dim.nodes.has(node.key) ? FOCUS : dim.restLevel);\n    const linkOpacity = (link: ModelLink): number =>\n        (link.dimmed ? FADED : !dim.active ? FOCUS : dim.links.has(link.key) ? FOCUS : dim.restLevel);\n    const selectedLink = selection?.kind === \"link\" ? selection.key : null;\n    const isSelectedLink = (key: string): boolean => selectedLink !== null && keyEqual(key, selectedLink);\n    const fade = (on: boolean): string | undefined => (on ? \"opacity 150ms ease\" : undefined);\n\n    // ── interactions ──────────────────────────────────────────────────────\n    // The frame's selection moves, and the host hears a state, a transition or a decision selected alone.\n    const select = useCallback((sel: Selection) => {\n        onSelectRef.current(sel);\n        if (sel === null) return;\n        if (sel.kind === \"state\" && onSelectStateFn) dispatchEast(\"onSelectState\", () => onSelectStateFn(sel.key));\n        if (sel.kind === \"link\" && onSelectLinkFn) dispatchEast(\"onSelectLink\", () => onSelectLinkFn(sel.key));\n        if (sel.kind === \"trigger\" && onSelectTriggerFn) dispatchEast(\"onSelectTrigger\", () => onSelectTriggerFn(sel.key));\n    }, [onSelectStateFn, onSelectLinkFn, onSelectTriggerFn]);\n\n    // What the frame asks for — a state Find picked, a drop added, what a\n    // click in the inspector names: selected, as a click selects it, and —\n    // but for a state dropped where the pointer is, or a key edited where it\n    // stands — scrolled to the middle of the canvas's box at the zoom it\n    // stands at, which it leaves as it is: once per ask. A state whose card\n    // still waits on its details — one ⏎ just added, say — is scrolled to once\n    // they land, at the height its card then takes.\n    const scrollRef = useRef<HTMLDivElement | null>(null);\n    // The element itself, for the lane pager, which hears it scroll.\n    const [scrollEl, setScrollEl] = useState<HTMLDivElement | null>(null);\n    const setScroll = useCallback((el: HTMLDivElement | null) => {\n        scrollRef.current = el;\n        setScrollEl(el);\n    }, []);\n    // An editor in place — a lane's rename, a state's key and label — takes its focused field with it as it closes on ⏎ or\n    // Esc, which leaves the focus on the page's body, where the frame's ⌘Z and ⌘⇧Z go unheard (review of #1481, finding\n    // 2): the canvas takes it back. A blur that moved the focus somewhere is left there.\n    const editing = laneEdit !== null || stateEditor !== null;\n    const wasEditing = useRef(editing);\n    useEffect(() => {\n        const closed = wasEditing.current && !editing;\n        wasEditing.current = editing;\n        if (!closed) return;\n        const at = document.activeElement;\n        if (at === null || at === document.body) scrollRef.current?.focus({ preventScroll: true });\n    }, [editing]);\n    /**\n     * Scrolls a point of the drawing to the middle of the canvas's box at the\n     * zoom it stands at, the scroll stopping at its ends: what a selection\n     * asked for, and a zoom towards what is selected, bring it there.\n     */\n    const centre = useCallback((box: HTMLDivElement, at: Pt): void => {\n        if (layout === null) return;\n        const left = Math.max(0, at.x * zoom - box.clientWidth / 2);\n        // A phone's window of lanes opens on whole lanes, the nearest that hold it, and never past the last lane's start: a\n        // state in the last lane, centred, would stop at the canvas's end, with the lane before it cut (hand test row 14).\n        // A lane wider than the window, where the details draw on the cards, opens with its card in the middle. A lane is\n        // as wide as the zoom draws it (R42).\n        const step = laneSlot * zoom;\n        box.scrollLeft = !windowed || step <= 0 || (cards !== undefined && step > box.clientWidth) ? left\n            : Math.min(Math.round(left / step), Math.max(0, layout.lanes.length - lanesShown)) * step;\n        box.scrollTop = Math.max(0, at.y * zoom - box.clientHeight / 2);\n    }, [layout, zoom, laneSlot, windowed, cards, lanesShown]);\n    // The ask last selected, and the last one done: scrolled to, or with nothing to scroll.\n    const asked = useRef(0);\n    const revealed = useRef(0);\n    useEffect(() => {\n        if (reveal === null || reveal.seq === revealed.current) return;\n        if (reveal.seq !== asked.current) {\n            asked.current = reveal.seq;\n            select(reveal.selection);\n        }\n        if (reveal.scroll !== false && awaitsRow(reveal.selection, cardsByKey, details.states)) return;\n        revealed.current = reveal.seq;\n        if (reveal.scroll === false || layout === null) return;\n        const at = revealPoint(layout, model, reveal.selection);\n        const box = scrollRef.current;\n        if (at !== undefined && box !== null) centre(box, at);\n    }, [reveal, layout, model, select, cardsByKey, details.states, centre]);\n\n    // A zoom asked for (R42): Zoom out and Zoom in bring what is selected to the middle of the view at the new zoom, where\n    // finding it would. With nothing selected, or what is selected drawn nowhere, and at Fit, the view's middle stays: a\n    // share of the drawing's width and height, which the layout keeps as it fills main at the new zoom, brought back to\n    // the middle once the canvas is drawn there.\n    const middle = useRef<{ x: number; y: number; towards: Selection } | undefined>(undefined);\n    const zoomTo = useCallback((next: number | \"fit\", towards: Selection) => {\n        const box = scrollRef.current;\n        const drawn = layoutRef.current;\n        const was = zoomRef.current;\n        const to = next === \"fit\" ? fitRef.current : next;\n        if (box !== null && drawn !== null && drawn.width > 0 && drawn.height > 0 && Math.abs(to - was) > 1e-9) {\n            middle.current = {\n                x: (box.scrollLeft + box.clientWidth / 2) / (drawn.width * was),\n                y: (box.scrollTop + box.clientHeight / 2) / (drawn.height * was),\n                towards,\n            };\n        }\n        setChosen(next);\n    }, []);\n    useLayoutEffect(() => {\n        const at = middle.current;\n        const box = scrollRef.current;\n        if (at === undefined || box === null || layout === null) return;\n        middle.current = undefined;\n        const selected = at.towards === null ? undefined : revealPoint(layout, model, at.towards);\n        if (selected !== undefined) {\n            centre(box, selected);\n            return;\n        }\n        box.scrollLeft = Math.max(0, at.x * layout.width * zoom - box.clientWidth / 2);\n        box.scrollTop = Math.max(0, at.y * layout.height * zoom - box.clientHeight / 2);\n    }, [layout, zoom, model, centre]);\n    // Zoom out and Zoom in: ×1.5 or ÷1.5, never past Fit, where the zoom follows Fit, nor past the cards' own size;\n    // towards what is selected.\n    const zoomBy = useCallback((factor: number) => {\n        const was = zoomRef.current;\n        const least = fitRef.current;\n        const next = Math.min(1, Math.max(least, was * factor));\n        if (Math.abs(next - was) <= 1e-9) return;\n        zoomTo(next <= least + 1e-9 ? \"fit\" : next >= 1 - 1e-9 ? 1 : next, selectionRef.current);\n    }, [zoomTo]);\n    const fitView = useCallback(() => zoomTo(\"fit\", null), [zoomTo]);\n\n    // Esc restores everything at once (the spec): nothing selected, nothing dimmed, no transition being drawn — and says\n    // whether it had any of them to put back: an Esc with nothing to put back does nothing, and goes on as it came.\n    const escape = useCallback((): boolean => {\n        if (selectionRef.current === null && hoverRef.current === null && draftRef.current === null) return false;\n        onSelectRef.current(null);\n        setHover(null);\n        setDraft(null);\n        return true;\n    }, []);\n    // Whether the pointer is over the canvas: a key from the page itself, nothing focused, is the canvas's only then.\n    const hoveredRef = useRef(false);\n    // A key from inside the frame, heard as it leaves it (the handle's `key`), after every part of it that takes keys of\n    // its own: Esc is the canvas's from the frame's own regions — never from a field being typed into, which keeps its\n    // own Esc, what it holds put back and the selection kept, nor from a layer portaled out of the frame, a popover or a\n    // menu, which is that layer's — and is taken where it acts (#1398).\n    const onFrameKey = useCallback((e: React.KeyboardEvent<HTMLElement>): void => {\n        if (e.key !== \"Escape\" || e.defaultPrevented || typedInto(e.target) || !keyInFrame(bodyRef.current, e.target)) return;\n        if (escape()) takeKey(e);\n    }, [escape]);\n    useImperativeHandle(ref, () => ({ key: onFrameKey, zoomBy, fit: fitView }), [onFrameKey, zoomBy, fitView]);\n    // A key from the page itself, which no part of the frame hears: the window's, while the pointer is over the canvas.\n    // A key typed anywhere else on the page — another builder's, a field's, a menu's — never acts on the canvas.\n    useEffect(() => {\n        const onKey = (e: KeyboardEvent): void => {\n            if (e.key !== \"Escape\" || e.defaultPrevented || !hoveredRef.current || !keyFromPage(e.target)) return;\n            if (escape()) e.preventDefault();\n        };\n        window.addEventListener(\"keydown\", onKey);\n        return () => window.removeEventListener(\"keydown\", onKey);\n    }, [escape]);\n\n    // Del deletes the selection — heard in the canvas, never in a field being\n    // typed into, which keeps its own Del: a state or several with their\n    // transitions, a transition, a decision cleared from the transitions it\n    // governs, a lane holding no state — each while its kind edits, the key\n    // going no further than the Flowchart (#1398).\n    const onCanvasKey = useCallback((e: React.KeyboardEvent<HTMLDivElement>): void => {\n        if ((e.key !== \"Delete\" && e.key !== \"Backspace\") || edit === undefined || typedInto(e.target)) return;\n        const sel = selectionRef.current;\n        if (sel === null) return;\n        const run = ((): (() => void) | undefined => {\n            switch (sel.kind) {\n                case \"state\": return edit.deleteStates === undefined ? undefined : () => edit.deleteStates!([sel.key]);\n                case \"states\": return edit.deleteStates === undefined ? undefined : () => edit.deleteStates!(sel.keys);\n                case \"link\": return edit.deleteLink === undefined ? undefined : () => edit.deleteLink!(sel.key);\n                case \"trigger\": return edit.deleteDecision === undefined ? undefined : () => edit.deleteDecision!(sel.key);\n                // A lane holding states is never deleted: Del leaves it, selected.\n                case \"lane\": return edit.deleteLane === undefined || (modelRef.current.laneStates.get(sel.key) ?? 0) > 0\n                    ? undefined : () => edit.deleteLane!(sel.key);\n            }\n        })();\n        if (run === undefined) return;\n        takeKey(e);\n        onSelectRef.current(null);\n        setHover(null);\n        run();\n    }, [edit]);\n\n    const canConnect = useCallback((from: string, to: string): boolean => {\n        // from === to is LEGAL: dropping on the source commits an in-place\n        // transition (rendered as the ↻ badge, never routed).\n        if (!canConnectFn) return true;\n        try {\n            return canConnectFn(from, to) !== false;\n        } catch (err) {\n            console.error(\"[Flowchart] canConnect failed (allowing):\", err);\n            return true;                        // fail-open per spec\n        }\n    }, [canConnectFn]);\n\n    // The pointer over the drawing, in its own px: the drawing is scaled from its corner at the zoom (R42).\n    const svgPoint = useCallback((e: { clientX: number; clientY: number }): { x: number; y: number } => {\n        const el = bodyRef.current?.querySelector(\"[data-flowchart-canvas]\");\n        const r = el?.getBoundingClientRect();\n        const z = zoomRef.current;\n        return r ? { x: (e.clientX - r.left) / z, y: (e.clientY - r.top) / z } : { x: 0, y: 0 };\n    }, []);\n\n    /** The state a connect drag rests on: its card, or as near as the drop pad — never one drawn as context. */\n    const connectTarget = useCallback((p: Pt): string | null => {\n        if (layout === null) return null;\n        const key = dropTargetAt(layout, p);\n        const node = key === null ? undefined : model.nodesByKey.get(key);\n        return node === undefined || node.dimmed ? null : key;\n    }, [layout, model]);\n\n    // The drag in flight — a transition drawn out of a handle, or a state carried by its card — is its pointer's\n    // (`followPointer`): its moves alone carry it, and its own release lands it. One at a time: a new press lets go of\n    // one still in flight, landing nothing, as the canvas going does.\n    const dropDrag = useRef<(() => void) | undefined>(undefined);\n    const followDrag = useCallback((pressed: React.PointerEvent, follow: Required<PointerFollow>): void => {\n        dropDrag.current?.();\n        const stop = followPointer(pressed, {\n            move: follow.move,\n            up: (event) => { dropDrag.current = undefined; follow.up(event); },\n            cancel: () => { dropDrag.current = undefined; follow.cancel(); },\n        });\n        dropDrag.current = () => {\n            dropDrag.current = undefined;\n            stop();\n            follow.cancel();\n        };\n    }, []);\n    useEffect(() => () => dropDrag.current?.(), []);\n\n    const connectEdit = edit?.connect;\n    const beginDraft = useCallback((from: string, side: \"left\" | \"right\" | \"top\" | \"bottom\", e: React.PointerEvent) => {\n        if (connectEdit === undefined) return;\n        e.preventDefault();\n        e.stopPropagation();\n        const p = svgPoint(e);\n        followDrag(e, {\n            move: (ev) => {\n                const q = svgPoint(ev);\n                const fromKey = draftRef.current?.from ?? from;\n                // The WHOLE node (plus DROP_PAD) is the target — nobody has to\n                // land a 7px ring.\n                const over = connectTarget(q);\n                const dup = over !== null ? existingLink(model, fromKey, over) : undefined;\n                const allowed = over !== null && dup === undefined && canConnect(fromKey, over);\n                setDraft(d => (d === null ? d : { ...d, x: q.x, y: q.y, over, allowed, dup }));\n            },\n            // The browser took the pointer back — a scroll of its own, say — or the window lost the page: the transition\n            // is let go of, and none is drawn.\n            cancel: () => { setDraft(null); },\n            up: () => {\n                const d = draftRef.current;\n                setDraft(null);\n                if (!d || d.over === null) return;\n                if (d.dup !== undefined) {\n                    // Already connected — absorb the drop and pulse the existing\n                    // link (or the node itself for a folded in-place loop).\n                    setPulse(p => ({ from: d.from, to: d.over!, seq: (p?.seq ?? 0) + 1 }));\n                    return;\n                }\n                if (d.allowed) {\n                    connectEdit(d.from, d.over);\n                    setPulse(p => ({ from: d.from, to: d.over!, seq: (p?.seq ?? 0) + 1 }));\n                }\n            },\n        });\n        // After the follow: it lets go of a drag still in flight, whose draft this one's replaces.\n        setDraft({ from, side, x: p.x, y: p.y, over: null, allowed: false, dup: undefined });\n    }, [connectEdit, svgPoint, connectTarget, model, canConnect, followDrag]);\n\n    /**\n     * Where a moved state lands at a point: the band under it, where the band\n     * takes a state, and — where the states carry an `order` — the row of the\n     * band's states, as drawn, that the line marks.\n     */\n    const moveLanding = useCallback((p: Pt): { overLane: string | null; row: number | null } => {\n        const drawn = layoutRef.current;\n        const key = drawn === null ? null : laneAt(drawn, p);\n        if (drawn === null || key === null || !takesStates(key)) return { overLane: null, row: null };\n        const index = model.lanes.findIndex((lane) => keyEqual(lane.key, key));\n        return { overLane: key, row: model.ordered ? rowAt(drawn, bandStates(model, index).length, p) : null };\n    }, [model, takesStates]);\n\n    /** Node move gesture — begins after a 5px threshold so plain clicks\n     * stay selection; the candidate band, and where it lands, highlight while dragging. */\n    const moveEdit = edit?.moveStates;\n    const beginMove = useCallback((key: string, e: React.PointerEvent) => {\n        if (moveEdit === undefined) return;\n        const startP = svgPoint(e);\n        let started = false;\n        followDrag(e, {\n            move: (ev) => {\n                const q = svgPoint(ev);\n                if (!started) {\n                    if (Math.abs(q.x - startP.x) + Math.abs(q.y - startP.y) < 5) return;\n                    started = true;\n                    movedRef.current = true;\n                }\n                setMoveDrag({ key, x: q.x, y: q.y, ...moveLanding(q) });\n            },\n            // The browser took the pointer back — a touch's scroll, a drag of its own — or the window lost the page: the\n            // state stays where it stands, and the gesture was no move, so the next click on a card selects it.\n            cancel: () => {\n                movedRef.current = false;\n                setMoveDrag(null);\n            },\n            up: () => {\n                const d = moveDragRef.current;\n                setMoveDrag(null);\n                if (!started || d === null || d.overLane === null) return;\n                const node = model.nodesByKey.get(key);\n                const index = model.lanes.findIndex((lane) => keyEqual(lane.key, d.overLane!));\n                if (node === undefined || index < 0) return;\n                const same = node.laneIndex === index;\n                // States carrying no order stand by key: a move writes their lane alone, and one within its own lane does nothing.\n                if (d.row === null) {\n                    if (!same) moveEdit([key], d.overLane);\n                    return;\n                }\n                // Among the band's other states: past the moved state's own row, one fewer; its own row, nothing moves.\n                let at = d.row;\n                if (same) {\n                    const own = bandStates(model, index).findIndex((state) => keyEqual(state.key, key));\n                    if (at > own) at -= 1;\n                    if (at === own) return;\n                }\n                moveEdit([key], d.overLane, at);\n            },\n        });\n        // After the follow: it lets go of a drag still in flight, which says its gesture was no move.\n        movedRef.current = false;\n    }, [moveEdit, svgPoint, moveLanding, model, followDrag]);\n\n    // ── render helpers ────────────────────────────────────────────────────\n    const linksByKey = useMemo(() => new Map(model.links.map(l => [l.key, l])), [model]);\n    const showMinimap = minimapOpt ?? model.nodes.length >= 25;\n\n    // dashed renders over solid; context under both; selected on top.\n    const orderedRoutes = useMemo(() => {\n        if (!layout) return [];\n        const context: LinkRoute[] = [], solid: LinkRoute[] = [], dashed: LinkRoute[] = [], selected: LinkRoute[] = [];\n        for (const r of layout.routes) {\n            const l = linksByKey.get(r.key);\n            if (!l) continue;\n            if (selectedLink !== null && keyEqual(r.key, selectedLink)) selected.push(r);\n            else if (l.dimmed) context.push(r);\n            else if (l.cls === \"planned\") solid.push(r);\n            else dashed.push(r);\n        }\n        return [...context, ...solid, ...dashed, ...selected];\n    }, [layout, linksByKey, selectedLink]);\n\n    // Records with nothing in them — no lane, no state, no transition — draw\n    // nothing; the box stays, measured, for what comes. Where a lane or a\n    // state can be added, the band row draws, so \"+ LANE\" or \"+ STATE\" can\n    // give it its first.\n    const empty = model.blank && edit?.addLane === undefined && edit?.addState === undefined;\n    const addStateEdit = edit?.addState;\n    const renameLaneEdit = edit?.renameLane;\n    const deleteLaneEdit = edit?.deleteLane;\n    const addLaneEdit = edit?.addLane;\n    // The \"+ STATE\" editor types a new state's key only where it can refuse a key taken; else its kind makes it (#1549).\n    const typesKey = edit?.stateKeyTaken !== undefined;\n    // Why \"+ STATE\" or \"+ LANE\" adds nothing: off, its tooltip saying so (#1549).\n    const statesOff = edit?.off?.states;\n    const lanesOff = edit?.off?.lanes;\n    const body = (\n        <Box ref={onBody} css={styles.body} data-flowchart-body=\"\"\n            onPointerEnter={() => { hoveredRef.current = true; }} onPointerLeave={() => { hoveredRef.current = false; }}>\n            {probe}\n            {layout !== null && !empty && (\n                // Focusable, so a press inside it — a state, a transition — lands its keys here: Del's.\n                <Box ref={setScroll} css={styles.scroll} data-flowchart-scroll=\"\" tabIndex={-1} onKeyDown={onCanvasKey}>\n                    {/* What main scrolls: the canvas at the size the zoom draws it (R42). */}\n                    <Box css={styles.canvasZoom} data-flowchart-zoom-box=\"\" style={{ width: layout.width * zoom, height: layout.height * zoom }}>\n                        {/* The canvas's one drop cell, where a tab of the library drops — scaled from its corner at the zoom. */}\n                        <Box ref={setWrap} css={styles.canvasWrap}\n                            style={{ width: layout.width, height: layout.height, transform: zoom === 1 ? undefined : `scale(${zoom})` }}>\n                            <svg\n                                data-flowchart-canvas\n                                width={layout.width}\n                                height={layout.height}\n                                viewBox={`0 0 ${layout.width} ${layout.height}`}\n                                style={{ position: \"absolute\", inset: 0, display: \"block\" }}\n                                onClick={(e) => {\n                                    // A click where nothing is — no transition, diamond or lane's header — selects nothing.\n                                    if ((e.target as Element).closest(\"[data-flowchart-link], [data-flowchart-trigger], [data-flowchart-lane-head]\") === null) select(null);\n                                }}\n                            >\n                                <defs>\n                                    {/* Fixed 12px filled arrowheads — the spec sheet's visual\n                                        size — userSpaceOnUse so they never scale with stroke;\n                                        refX 10 puts the TIP exactly at the path end, which is\n                                        trimmed to the ring edge. */}\n                                    {([[\"ink\", INK], [\"info\", INFO], [\"neg\", NEG], [\"brand\", BRAND_D]] as const).map(([id, color]) => (\n                                        <marker key={id} id={`fc-mk-${id}-${storageKey}`} viewBox=\"0 0 10 10\" refX={10} refY={5}\n                                            markerWidth={12} markerHeight={12} markerUnits=\"userSpaceOnUse\" orient=\"auto\">\n                                            <path d=\"M0 0L10 5L0 10z\" fill={color} />\n                                        </marker>\n                                    ))}\n                                </defs>\n\n                                {/* lane bands — alternating paper-2 tint */}\n                                {layout.lanes.map(lane => lane.tinted && (\n                                    <rect key={lane.key} x={lane.x} y={lane.y} width={lane.w} height={lane.h} fill={LANE_TINT} />\n                                ))}\n                                {/* band hover targets — reveal the \"+ STATE\" ghost, in a band that takes a state */}\n                                {addStateEdit !== undefined && layout.lanes.map(lane => takesStates(lane.key) && (\n                                    <rect\n                                        key={`bandhit-${lane.key}`}\n                                        data-flowchart-band={lane.key}\n                                        x={lane.x} y={lane.y} width={lane.w} height={lane.h}\n                                        fill=\"transparent\"\n                                        onPointerEnter={() => setLaneHover(lane.key)}\n                                        onPointerLeave={() => setLaneHover(h => (h !== null && keyEqual(h, lane.key) ? null : h))}\n                                    />\n                                ))}\n                                {/* move-drag candidate band highlight */}\n                                {moveDrag !== null && moveDrag.overLane !== null && (() => {\n                                    const lane = layout.lanes.find(l => keyEqual(l.key, moveDrag.overLane!));\n                                    if (!lane) return null;\n                                    return (\n                                        <g style={{ pointerEvents: \"none\" }}>\n                                            <rect x={lane.x} y={lane.y} width={lane.w} height={lane.h} fill={BRAND} opacity={0.07} />\n                                            <rect x={lane.x + 2} y={lane.y + 2} width={lane.w - 4} height={lane.h - 4}\n                                                fill=\"none\" stroke={BRAND_D} strokeDasharray=\"6 4\" strokeWidth={1.5} />\n                                        </g>\n                                    );\n                                })()}\n                                {/* lane headers — their look the recipe's (#1520): mono 12/600,\n                                    caps spaced 2.6px, ink-4. A click on the header's strip\n                                    selects its lane, and a double-click renames it in\n                                    place where the lanes edit; No lane, and the one band\n                                    of a Flowchart given no lanes, are neither. Each lane's\n                                    × and \"+ LANE\" are the HTML layer's, below. */}\n                                {layout.lanes.map(lane => {\n                                    const head = laneHead(layout, lane);\n                                    const text = (\n                                        <text x={head.x} y={head.y} textAnchor={head.td ? \"start\" : \"middle\"}\n                                            data-flowchart-lane={lane.key}>\n                                            {lane.label.toUpperCase()}\n                                        </text>\n                                    );\n                                    if (!isLane(lane.key)) return <g key={lane.key} data-flowchart-band-kind={bands.get(lane.key)}>{text}</g>;\n                                    const box = laneHeadBox(layout, lane);\n                                    return (\n                                        <g key={lane.key} data-flowchart-lane-head={lane.key} style={{ cursor: \"pointer\" }}\n                                            onClick={() => select({ kind: \"lane\", key: lane.key })}\n                                            onDoubleClick={renameLaneEdit !== undefined ? () => setLaneEdit({ key: lane.key, label: lane.label }) : undefined}>\n                                            <rect x={box.x} y={box.y} width={box.w} height={box.h} fill=\"transparent\" />\n                                            {text}\n                                        </g>\n                                    );\n                                })}\n\n                                {/* the brand wash on the transition a card sets where it\n                                    rests — under every line, the recipe's */}\n                                {dropMark?.kind === \"transition\" && (() => {\n                                    const route = layout.routes.find((r) => keyEqual(r.key, dropMark.key));\n                                    return route === undefined ? null : <path data-flowchart-dropwash={route.key} d={route.d} />;\n                                })()}\n\n                                {/* links — context first, then solid, then dashed (dashed renders over solid), selected last;\n                                    a transition drawn as context takes no pointer */}\n                                <g data-flowchart-links>\n                                    {orderedRoutes.map(r => {\n                                        const l = linksByKey.get(r.key)!;\n                                        const isSel = isSelectedLink(r.key);\n                                        return (\n                                            <g key={r.key} data-context={l.dimmed ? \"\" : undefined} style={{ opacity: linkOpacity(l), transition: fade(dim.active) }}>\n                                                {isSel && (\n                                                    <path d={r.d} fill=\"none\" stroke={BRAND} strokeWidth={9} opacity={0.16} strokeLinecap=\"round\" />\n                                                )}\n                                                <path\n                                                    d={r.d}\n                                                    fill=\"none\"\n                                                    stroke={isSel ? BRAND_D : CLASS_STROKE[l.cls]}\n                                                    strokeWidth={isSel ? 3 : l.weight}\n                                                    strokeDasharray={CLASS_DASH[l.cls]}\n                                                    markerEnd={`url(#fc-mk-${isSel ? \"brand\" : CLASS_MARKER[l.cls]}-${storageKey})`}\n                                                />\n                                                {!l.dimmed && (\n                                                    <path\n                                                        d={r.d}\n                                                        data-flowchart-link={r.key}\n                                                        fill=\"none\"\n                                                        stroke=\"transparent\"\n                                                        strokeWidth={12}\n                                                        style={{ cursor: \"pointer\" }}\n                                                        onPointerEnter={() => hoverOn({ kind: \"link\", key: r.key })}\n                                                        onPointerLeave={() => setHover(null)}\n                                                        onClick={e => {\n                                                            if (e.altKey && onTracePathFn) {\n                                                                dispatchEast(\"onTracePath\", () => onTracePathFn(r.key));\n                                                                return;\n                                                            }\n                                                            select({ kind: \"link\", key: r.key });\n                                                        }}\n                                                    />\n                                                )}\n                                            </g>\n                                        );\n                                    })}\n                                </g>\n\n                                {/* decision diamonds, each at the middle of its line's longest straight stretch — one on a transition drawn as context takes no pointer */}\n                                {orderedRoutes.map(r => {\n                                    const l = linksByKey.get(r.key)!;\n                                    const trigger = l.trigger !== undefined ? model.triggers.get(l.trigger) : undefined;\n                                    if (trigger === undefined) return null;\n                                    const live = !l.dimmed;\n                                    return (\n                                        <g key={`dia-${r.key}`} data-context={live ? undefined : \"\"} style={{ opacity: linkOpacity(l), transition: fade(dim.active) }}>\n                                            <g\n                                                data-flowchart-trigger={live ? trigger.key : undefined}\n                                                data-drop-target={live && dropMark?.kind === \"decision\" && keyEqual(dropMark.key, trigger.key) ? \"\" : undefined}\n                                                data-selected={live && selection?.kind === \"trigger\" && keyEqual(selection.key, trigger.key) ? \"\" : undefined}\n                                                transform={`translate(${r.mid.x},${r.mid.y}) rotate(45)`}\n                                                style={{ cursor: live ? \"pointer\" : undefined }}\n                                                onPointerEnter={live ? () => hoverOn({ kind: \"trigger\", key: trigger.key }) : undefined}\n                                                onPointerLeave={live ? () => setHover(null) : undefined}\n                                                onClick={live ? () => select({ kind: \"trigger\", key: trigger.key }) : undefined}\n                                            >\n                                                <rect x={-8} y={-8} width={16} height={16} rx={3} fill={PAPER} stroke={BRAND_D} strokeWidth={1.4} />\n                                                <text transform=\"rotate(-45)\" y={3.5} textAnchor=\"middle\"\n                                                    style={{ fontFamily: MONO, fontSize: 8.5, fontWeight: 700, fill: BRAND_D }}>\n                                                    {trigger.letter}\n                                                </text>\n                                            </g>\n                                        </g>\n                                    );\n                                })}\n\n                                {/* labels — collision-resolved in layout over their boxes, each\n                                    as big as its lines (R32); chrome inherits the link class; its\n                                    evidence line's numerals mono tabular ink */}\n                                {orderedRoutes.map(r => {\n                                    const l = linksByKey.get(r.key)!;\n                                    const box = r.label;\n                                    if (box === undefined) return null;\n                                    const selectedHere = isSelectedLink(r.key);\n                                    const bs = badgeStyle(l.cls, selectedHere);\n                                    // Its details' lines under its evidence, 13 apart — the first line's place where it has none (R32).\n                                    const detail = labels?.lines.get(r.key) ?? [];\n                                    const first = -box.h / 2 + LABEL_BASELINE + (l.badgeText === undefined ? 0 : LABEL_LINE_H);\n                                    return (\n                                        // Ornament, not a control — pointer-transparent so the\n                                        // link's hit path beneath stays hoverable.\n                                        <g key={`bdg-${r.key}`} data-flowchart-label={r.key} data-selected={selectedHere || undefined}\n                                            style={{ opacity: linkOpacity(l), transition: fade(dim.active), pointerEvents: \"none\" }}\n                                            transform={`translate(${box.x + box.w / 2},${box.y + box.h / 2})`}>\n                                            <rect x={-box.w / 2} y={-box.h / 2} width={box.w} height={box.h} rx={4}\n                                                fill={PAPER} stroke={bs.stroke} strokeWidth={1} strokeDasharray={bs.dash} />\n                                            {l.badgeText !== undefined && (\n                                                <text y={-box.h / 2 + LABEL_BASELINE} textAnchor=\"middle\"\n                                                    style={{ fontFamily: MONO, fontSize: 10, fontWeight: 600, fill: bs.text, fontVariantNumeric: \"tabular-nums\" }}>\n                                                    {l.badgeText}\n                                                </text>\n                                            )}\n                                            {detail.map((line, i) => {\n                                                const y = first + i * LABEL_LINE_H;\n                                                if (line.kind === \"placeholder\") {\n                                                    const w = Math.min(PLACEHOLDER_BAR.w, box.w - 14);\n                                                    return <rect key={i} data-line=\"placeholder\" x={-w / 2} y={y - PLACEHOLDER_BAR.above} width={w} height={PLACEHOLDER_BAR.h} rx={2} />;\n                                                }\n                                                return <text key={i} data-line=\"detail\" y={y} textAnchor=\"middle\">{labelLineText(line, words)}</text>;\n                                            })}\n                                        </g>\n                                    );\n                                })}\n\n                            </svg>\n\n                            {/* the band a dropped state lands in, or whose header a card\n                                sets: its wash, under the states, the recipe's */}\n                            {(dropMark?.kind === \"lane\" || dropMark?.kind === \"header\") && (() => {\n                                const band = layout.lanes.find((l) => keyEqual(l.key, dropMark.lane));\n                                return band === undefined ? null : (\n                                    <Box css={styles.dropLane} data-flowchart-droplane={band.key}\n                                        style={{ left: band.x, top: band.y, width: band.w, height: band.h }} />\n                                );\n                            })()}\n\n                            {/* the selected lane: its band ringed, under the states, the recipe's */}\n                            {selection?.kind === \"lane\" && (() => {\n                                const band = layout.lanes.find((l) => keyEqual(l.key, selection.key));\n                                return band === undefined ? null : (\n                                    <Box css={styles.laneSelected} data-flowchart-lane-selected={band.key}\n                                        style={{ left: band.x, top: band.y, width: band.w, height: band.h }} />\n                                );\n                            })()}\n\n                            {/* node cards — HTML above the SVG; one drawn as context takes no pointer, the recipe's */}\n                            {[...layout.nodes.values()].map(rect => {\n                                const nm = model.nodesByKey.get(rect.key);\n                                if (!nm) return null;\n                                const isSel = pickedStates.some((key) => keyEqual(key, rect.key));\n                                const live = !nm.dimmed;\n                                // A ghost is an end no state is keyed by: selected, never moved or renamed.\n                                const movable = live && !nm.ghost && moveEdit !== undefined;\n                                // Where the details draw on the cards: its head over its reads (R22).\n                                const card = cardsByKey?.get(rect.key);\n                                const members = nm.members === undefined ? null : (\n                                    <Box as=\"span\" css={card === undefined ? styles.nodeBadge : styles.cardChip} data-flowchart-members=\"\">×{words.number(nm.members)}</Box>\n                                );\n                                const inPlace = live && nm.inPlaceKeys.length > 0 ? (() => {\n                                    // Folded self-loops have no route to click — the ↻\n                                    // badge is their selection surface. Click selects\n                                    // (cycling when several fold here) so Del deletes\n                                    // it as it deletes any transition, and the\n                                    // inspector shows its Details.\n                                    const selIdx = selection?.kind === \"link\" ? nm.inPlaceKeys.findIndex((k) => keyEqual(k, selection.key)) : -1;\n                                    return (\n                                        <Box as=\"span\" css={styles.nodeBadge}\n                                            data-flowchart-inplace={rect.key}\n                                            data-selected={selIdx >= 0 || undefined}\n                                            onPointerDown={e => e.stopPropagation()}\n                                            onDoubleClick={e => e.stopPropagation()}\n                                            onClick={e => {\n                                                e.stopPropagation();\n                                                select({ kind: \"link\", key: nm.inPlaceKeys[(selIdx + 1) % nm.inPlaceKeys.length]! });\n                                            }}\n                                        >\n                                            <FontAwesomeIcon icon={faRotateRight} style={{ fontSize: \"8px\" }} /> {nm.inPlaceKeys.length}\n                                        </Box>\n                                    );\n                                })() : null;\n                                return (\n                                    <Box\n                                        key={rect.key}\n                                        data-flowchart-node={rect.key}\n                                        css={nm.ghost ? styles.ghostNode : styles.node}\n                                        data-details={card === undefined ? undefined : \"\"}\n                                        data-selected={isSel || undefined}\n                                        data-context={live ? undefined : \"\"}\n                                        data-conflict={conflicted?.has(rect.key) === true ? \"\" : undefined}\n                                        data-bounds={bounded?.has(rect.key) === true ? \"\" : undefined}\n                                        data-drop-target={dropMark?.kind === \"state\" && keyEqual(dropMark.key, rect.key) ? \"\" : undefined}\n                                        style={{\n                                            left: rect.x, top: rect.y, width: rect.w, height: rect.h,\n                                            opacity: moveDrag !== null && keyEqual(moveDrag.key, rect.key) ? 0.3 : nodeOpacity(nm),\n                                            transition: fade(dim.active),\n                                        }}\n                                        onPointerEnter={live ? () => hoverOn({ kind: \"state\", key: rect.key }) : undefined}\n                                        onPointerLeave={live ? () => setHover(null) : undefined}\n                                        onPointerDown={movable ? (e) => beginMove(rect.key, e) : undefined}\n                                        onClick={live ? (e) => {\n                                            if (movedRef.current) { movedRef.current = false; return; }\n                                            // Shift, ⌘ or Ctrl: into a selection of several, or out of it.\n                                            if (e.shiftKey || e.metaKey || e.ctrlKey) select(toggleState(selectionRef.current, rect.key));\n                                            else select({ kind: \"state\", key: rect.key });\n                                        } : undefined}\n                                        onDoubleClick={live && !nm.ghost && edit?.renameState !== undefined ? () => {\n                                            setStateEditor({ mode: \"edit\", key: rect.key, label: nm.label ?? \"\", was: nm.label ?? \"\" });\n                                        } : undefined}\n                                    >\n                                        {card !== undefined && details.states !== undefined ? (\n                                            <FlowchartCardContent styles={styles} kind={details.states} card={card} words={words}\n                                                name={nm.label ?? rect.key} code={nm.label === undefined ? undefined : rect.key}\n                                                badges={<>{members}{inPlace}</>} />\n                                        ) : (\n                                            <>\n                                                <Box css={styles.nodeCode}>\n                                                    {rect.key}\n                                                    {members}\n                                                    {inPlace}\n                                                </Box>\n                                                {nm.label !== undefined && <Box css={styles.nodeLabel}>{nm.label}</Box>}\n                                            </>\n                                        )}\n                                    </Box>\n                                );\n                            })}\n\n                            {/* connector overlay — ABOVE the node borders per the spec's\n                                z-order; rings on occupied handles, all four revealed on\n                                hover/selection, 16×16 hit targets on the out-handles where\n                                the transitions edit — never on a state drawn as context */}\n                            <svg\n                                width={layout.width}\n                                height={layout.height}\n                                viewBox={`0 0 ${layout.width} ${layout.height}`}\n                                style={{ position: \"absolute\", inset: 0, display: \"block\", pointerEvents: \"none\" }}\n                            >\n                                {[...layout.nodes.values()].map(rect => {\n                                    const nm = model.nodesByKey.get(rect.key);\n                                    if (!nm) return null;\n                                    const nodeActive = (hover?.kind === \"state\" && keyEqual(hover.key, rect.key))\n                                        || pickedStates.some((key) => keyEqual(key, rect.key))\n                                        || draft !== null;\n                                    const occupied = layout.handles.get(rect.key) ?? [];\n                                    const occupiedSides = new Set(occupied.map(h => h.side));\n                                    // Unoccupied handles are the EDIT affordance — they only\n                                    // reveal on hover/selection where the transitions edit;\n                                    // occupied rings are anatomy and always render.\n                                    const authoring = connectEdit !== undefined && !nm.dimmed;\n                                    const extra = nodeActive && authoring\n                                        ? ([\"left\", \"right\", \"top\", \"bottom\"] as const).filter(s => !occupiedSides.has(s))\n                                        : [];\n\n                                    return (\n                                        <g key={`ports-${rect.key}`} data-flowchart-ports={rect.key} style={{ opacity: nodeOpacity(nm), transition: fade(dim.active) }}>\n                                            {/* invisible 16×16 hit targets — ANY handle is the\n                                                drag-to-connect affordance */}\n                                            {authoring && ([\"left\", \"right\", \"top\", \"bottom\"] as const).map(side => (\n                                                <circle\n                                                    key={`hit-${side}`}\n                                                    data-flowchart-handle={side}\n                                                    cx={rect[side].x} cy={rect[side].y} r={8}\n                                                    fill=\"transparent\"\n                                                    style={{ pointerEvents: \"all\", cursor: \"crosshair\" }}\n                                                    onPointerEnter={() => hoverOn({ kind: \"state\", key: rect.key })}\n                                                    onPointerDown={(e) => beginDraft(rect.key, side, e)}\n                                                />\n                                            ))}\n                                            {occupied.map(h => {\n                                                const attached = h.links.map(k => linksByKey.get(k)).filter((x): x is ModelLink => x !== undefined);\n                                                const r = nodeActive ? 4.5 : RING_R;\n                                                return (\n                                                    <circle\n                                                        key={h.side}\n                                                        cx={h.pt.x} cy={h.pt.y} r={r}\n                                                        fill={PAPER}\n                                                        stroke={portColor(attached, selectedLink)}\n                                                        strokeWidth={1.4}\n                                                    />\n                                                );\n                                            })}\n                                            {extra.map(side => (\n                                                <circle\n                                                    key={side}\n                                                    cx={rect[side].x} cy={rect[side].y} r={4.5}\n                                                    fill={PAPER}\n                                                    stroke={INK}\n                                                    strokeWidth={1.4}\n                                                />\n                                            ))}\n                                        </g>\n                                    );\n                                })}\n\n                                {/* connect draft */}\n                                {draft !== null && (() => {\n                                    const from = layout.nodes.get(draft.from);\n                                    if (!from) return null;\n                                    const target = draft.over !== null ? layout.nodes.get(draft.over) : undefined;\n                                    const landable = draft.allowed || draft.dup !== undefined;\n                                    const selfDrop = draft.over !== null && keyEqual(draft.over, draft.from) && landable;\n                                    // Spec-compliant preview: the exact H/V route (r 8\n                                    // corners, ring-trimmed) the link would take when a\n                                    // target is snapped; an orthogonal path to the cursor\n                                    // otherwise. A self-drop previews as the ↻ cue.\n                                    const d = selfDrop\n                                        ? undefined\n                                        : target !== undefined && landable\n                                            ? previewLinkPath(from, target)\n                                            : previewCursorPath(from, draft.side, { x: draft.x, y: draft.y });\n                                    return (\n                                        <g>\n                                            {d !== undefined && (\n                                                <path\n                                                    d={d}\n                                                    fill=\"none\"\n                                                    stroke={draft.over !== null && !landable ? NEG : BRAND_D}\n                                                    strokeWidth={1.6}\n                                                    strokeDasharray=\"5 4\"\n                                                />\n                                            )}\n                                        </g>\n                                    );\n                                })()}\n\n                                {/* one-shot connection pulse — the existing link on a\n                                    duplicate drop, or the new link once its row arrives;\n                                    SMIL restarts per seq via the element key */}\n                                {pulse !== null && orderedRoutes.map(r => {\n                                    const l = linksByKey.get(r.key);\n                                    if (!l || !keyEqual(l.from, pulse.from) || !keyEqual(l.to, pulse.to)) return null;\n                                    return (\n                                        // CSS keyframe (not SMIL — whose begin is relative to\n                                        // the SVG document timeline, so late-inserted animates\n                                        // never play): starts on mount, restarts per seq key.\n                                        <path\n                                            key={`pulse-${pulse.seq}-${r.key}`}\n                                            d={r.d}\n                                            fill=\"none\"\n                                            stroke={BRAND}\n                                            strokeWidth={11}\n                                            strokeLinecap=\"round\"\n                                            opacity={0}\n                                            style={{ pointerEvents: \"none\", animation: \"fc-connect-pulse 0.9s ease-out forwards\" }}\n                                        />\n                                    );\n                                })}\n                            </svg>\n\n                            {/* the landing line where a dropped state lands: across the\n                                node's footprint, between the state above it and the one it\n                                lands before — its thickness the recipe's */}\n                            {dropMark?.kind === \"lane\" && (() => {\n                                const band = layout.lanes.find((l) => keyEqual(l.key, dropMark.lane));\n                                if (band === undefined) return null;\n                                const seam = landingSeam(layout, band, dropMark.row);\n                                const td = layout.orientation === \"TD\";\n                                return (\n                                    <Box css={styles.dropSeam} data-flowchart-landing={dropMark.row} data-orientation={layout.orientation}\n                                        style={td ? { left: seam.x, top: seam.y, height: seam.h } : { left: seam.x, top: seam.y, width: seam.w }} />\n                                );\n                            })()}\n\n                            {/* the line down the gap a dropped lane lands in — between two\n                                lanes, or at the band row's tail — the recipe's */}\n                            {dropMark?.kind === \"gap\" && (() => {\n                                const at = gapLine(layout, dropMark.at);\n                                const td = layout.orientation === \"TD\";\n                                return (\n                                    <Box css={styles.dropSeam} data-flowchart-gap={dropMark.at} data-orientation={layout.orientation}\n                                        style={td ? { left: 0, top: at, width: layout.width } : { left: at, top: 0, height: layout.height }} />\n                                );\n                            })()}\n\n                            {/* the line where a moved state lands, between two cards, where the states carry an order */}\n                            {moveDrag !== null && moveDrag.overLane !== null && moveDrag.row !== null && (() => {\n                                const band = layout.lanes.find((l) => keyEqual(l.key, moveDrag.overLane!));\n                                if (band === undefined) return null;\n                                const seam = landingSeam(layout, band, moveDrag.row);\n                                const td = layout.orientation === \"TD\";\n                                return (\n                                    <Box css={styles.dropSeam} data-flowchart-move={moveDrag.row} data-orientation={layout.orientation}\n                                        style={td ? { left: seam.x, top: seam.y, height: seam.h } : { left: seam.x, top: seam.y, width: seam.w }} />\n                                );\n                            })()}\n\n                            {/* each lane's × — Font Awesome's xmark beside its header; off\n                                while the lane holds states, its tooltip saying why */}\n                            {deleteLaneEdit !== undefined && layout.lanes.map(lane => {\n                                if (!isLane(lane.key)) return null;\n                                const head = laneHead(layout, lane);\n                                const holds = model.laneStates.get(lane.key) ?? 0;\n                                const name = words.m.deleteLane({ label: lane.label });\n                                return (\n                                    <Tooltip.Root key={`lanedelete-${lane.key}`} openDelay={250} positioning={{ placement: \"bottom\" }}>\n                                        <Tooltip.Trigger asChild>\n                                            <chakra.button\n                                                type=\"button\"\n                                                css={styles.laneDelete}\n                                                data-flowchart-lane-delete={lane.key}\n                                                data-disabled={holds > 0 ? \"\" : undefined}\n                                                aria-disabled={holds > 0 ? true : undefined}\n                                                aria-label={name}\n                                                style={{ left: head.close - CLOSE_BOX / 2, top: head.y - HEAD_MIDDLE - CLOSE_BOX / 2 }}\n                                                onClick={holds > 0 ? undefined : () => deleteLaneEdit(lane.key)}\n                                            >\n                                                <FontAwesomeIcon icon={faXmark} />\n                                            </chakra.button>\n                                        </Tooltip.Trigger>\n                                        <Portal>\n                                            <Tooltip.Positioner>\n                                                <Tooltip.Content>{holds > 0 ? words.m.laneHoldsStates({ n: holds, count: words.number(holds) }) : name}</Tooltip.Content>\n                                            </Tooltip.Positioner>\n                                        </Portal>\n                                    </Tooltip.Root>\n                                );\n                            })}\n\n                            {/* \"+ LANE\" — the band row's tail, full lane height: Font\n                                Awesome's plus over the word, a lane added on a click */}\n                            {addLaneEdit !== undefined && (\n                                <Tooltip.Root openDelay={250} disabled={lanesOff === undefined} positioning={{ placement: \"bottom\" }}>\n                                    <Tooltip.Trigger asChild>\n                                        <chakra.button\n                                            type=\"button\"\n                                            css={styles.addLane}\n                                            data-flowchart-addlane=\"\"\n                                            data-orientation={layout.orientation}\n                                            data-disabled={lanesOff === undefined ? undefined : \"\"}\n                                            aria-disabled={lanesOff === undefined ? undefined : true}\n                                            aria-label={words.m.addLane()}\n                                            style={{ left: layout.laneTail.x, top: layout.laneTail.y, width: layout.laneTail.w, height: layout.laneTail.h }}\n                                            onClick={lanesOff === undefined ? () => addLaneEdit() : undefined}\n                                        >\n                                            <FontAwesomeIcon icon={faPlus} />\n                                            <span>{words.m.laneWord()}</span>\n                                        </chakra.button>\n                                    </Tooltip.Trigger>\n                                    <Portal>\n                                        <Tooltip.Positioner>\n                                            <Tooltip.Content>{lanesOff}</Tooltip.Content>\n                                        </Tooltip.Positioner>\n                                    </Portal>\n                                </Tooltip.Root>\n                            )}\n\n                            {/* \"+ STATE\" ghost — dashed, exact node footprint, one per\n                                hovered band that takes a state, Font Awesome's plus beside\n                                its word; click turns it into the inline editor */}\n                            {addStateEdit !== undefined && stateEditor === null && laneHover !== null && takesStates(laneHover) && moveDrag === null && !dragging && (() => {\n                                const cell = layout.laneGhosts.get(laneHover);\n                                if (!cell) return null;\n                                return (\n                                    <Tooltip.Root openDelay={250} disabled={statesOff === undefined} positioning={{ placement: \"bottom\" }}>\n                                        <Tooltip.Trigger asChild>\n                                            <Box\n                                                data-flowchart-ghoststate={laneHover}\n                                                css={styles.stateGhost}\n                                                data-disabled={statesOff === undefined ? undefined : \"\"}\n                                                aria-disabled={statesOff === undefined ? undefined : true}\n                                                style={{ left: cell.x, top: cell.y, width: cell.w, height: cell.h }}\n                                                onPointerEnter={() => setLaneHover(laneHover)}\n                                                onClick={statesOff === undefined ? () => setStateEditor({ mode: \"add\", lane: laneHover, code: \"\", label: \"\" }) : undefined}\n                                            >\n                                                <FontAwesomeIcon icon={faPlus} />\n                                                <span>{words.m.stateWord()}</span>\n                                            </Box>\n                                        </Tooltip.Trigger>\n                                        <Portal>\n                                            <Tooltip.Positioner>\n                                                <Tooltip.Content>{statesOff}</Tooltip.Content>\n                                            </Tooltip.Positioner>\n                                        </Portal>\n                                    </Tooltip.Root>\n                                );\n                            })()}\n\n                            {/* inline node editor — the ghost's commit surface, a new\n                                state's key auto-focused and its label below; and the\n                                double-click rename, its key shown fixed and its label\n                                auto-focused. ⏎ commits — a key the Flowchart holds already\n                                refused, the editor left open — Esc dismisses, and a blur\n                                commits what it can */}\n                            {stateEditor !== null && (() => {\n                                const cell = stateEditor.mode === \"add\"\n                                    ? layout.laneGhosts.get(stateEditor.lane)\n                                    : layout.nodes.get(stateEditor.key);\n                                if (!cell) return null;\n                                const code = stateEditor.mode === \"add\" ? stateEditor.code.trim() : \"\";\n                                const taken = stateEditor.mode === \"add\" && code.length > 0 && edit?.stateKeyTaken?.(code) === true;\n                                /** Commits the editor; whether it closes — a key taken leaves it open on ⏎. */\n                                const commit = (blur: boolean): void => {\n                                    const ed = stateEditor;\n                                    if (ed.mode === \"add\") {\n                                        const key = ed.code.trim();\n                                        const label = ed.label.trim();\n                                        // Nothing typed — no key, or with none to type no label — dismisses.\n                                        if ((typesKey ? key.length === 0 : label.length === 0) || addStateEdit === undefined) { setStateEditor(null); return; }\n                                        const added = !taken && addStateEdit(ed.lane, typesKey ? key : undefined, label);\n                                        if (added || blur) setStateEditor(null);\n                                        return;\n                                    }\n                                    setStateEditor(null);\n                                    const label = ed.label.trim();\n                                    if (label !== ed.was) edit?.renameState?.(ed.key, label);\n                                };\n                                // ⏎ commits and Esc dismisses, each key going no further than the Flowchart (#1398).\n                                const keys = (e: React.KeyboardEvent): void => {\n                                    if (e.key === \"Enter\") { takeKey(e); commit(false); }\n                                    else if (e.key === \"Escape\") { takeKey(e); setStateEditor(null); }\n                                };\n                                return (\n                                    <Box\n                                        data-flowchart-stateeditor\n                                        css={styles.stateEditor}\n                                        // Over a card with details, over its head alone: its reads stay in view.\n                                        style={{ left: cell.x, top: cell.y, width: cell.w, minHeight: stateEditor.mode === \"edit\" && cardsByKey?.has(stateEditor.key) === true ? Math.min(cell.h, DETAILS_HEAD_H) : cell.h }}\n                                        onBlur={e => {\n                                            // blur-empty dismisses; blur with content commits\n                                            if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n                                            commit(true);\n                                        }}\n                                    >\n                                        {stateEditor.mode === \"add\" ? typesKey && (\n                                            <input\n                                                autoFocus\n                                                data-flowchart-key=\"\"\n                                                aria-label={words.m.stateKeyField()}\n                                                aria-invalid={taken || undefined}\n                                                title={taken ? words.m.stateKeyTaken({ key: code }) : undefined}\n                                                placeholder={words.m.stateKeyPlaceholder()}\n                                                value={stateEditor.code}\n                                                onChange={e => setStateEditor(ed => (ed === null || ed.mode !== \"add\" ? ed : { ...ed, code: e.target.value }))}\n                                                onKeyDown={keys}\n                                            />\n                                        ) : (\n                                            <Box css={styles.nodeCode} data-flowchart-key=\"\">{stateEditor.key}</Box>\n                                        )}\n                                        <input\n                                            autoFocus={stateEditor.mode === \"edit\" || !typesKey}\n                                            data-flowchart-label=\"\"\n                                            aria-label={words.m.stateLabelField()}\n                                            placeholder={words.m.stateLabelPlaceholder()}\n                                            value={stateEditor.label}\n                                            onChange={e => setStateEditor(ed => (ed === null ? ed : { ...ed, label: e.target.value }))}\n                                            onKeyDown={keys}\n                                        />\n                                    </Box>\n                                );\n                            })()}\n\n                            {/* floating clone while a node drags */}\n                            {moveDrag !== null && (() => {\n                                const nm = model.nodesByKey.get(moveDrag.key);\n                                if (!nm) return null;\n                                return (\n                                    <Box css={styles.moveClone} style={{ left: moveDrag.x + 10, top: moveDrag.y + 10 }}>\n                                        <Box css={styles.nodeCode}>{moveDrag.key}</Box>\n                                        {nm.label !== undefined && <Box css={styles.nodeLabel}>{nm.label}</Box>}\n                                    </Box>\n                                );\n                            })()}\n\n                            {/* drag cursor cues — FA icons in the HTML layer (↻ = self-drop\n                                lands an in-place transition; ⊘ = vetoed target) */}\n                            {draft !== null && draft.over !== null && (() => {\n                                const landable = draft.allowed || draft.dup !== undefined;\n                                const selfDrop = keyEqual(draft.over, draft.from) && landable;\n                                if (!selfDrop && landable) return null;\n                                return (\n                                    <Box\n                                        style={{\n                                            position: \"absolute\", left: draft.x + 12, top: draft.y - 18,\n                                            pointerEvents: \"none\", fontSize: 13,\n                                            color: selfDrop ? \"var(--fc-brand-d)\" : \"var(--fc-neg)\",\n                                        }}\n                                    >\n                                        <FontAwesomeIcon icon={selfDrop ? faRotateRight : faBan} />\n                                    </Box>\n                                );\n                            })()}\n\n                            {/* one-shot node pulse — an in-place (self-loop) create or\n                                duplicate has no route to pulse, so the node card glows */}\n                            {pulse !== null && keyEqual(pulse.from, pulse.to) && (() => {\n                                const rect = layout.nodes.get(pulse.from);\n                                if (!rect) return null;\n                                return (\n                                    <Box\n                                        key={`nodepulse-${pulse.seq}`}\n                                        style={{\n                                            position: \"absolute\",\n                                            left: rect.x, top: rect.y, width: rect.w, height: rect.h,\n                                            borderRadius: 6,\n                                            pointerEvents: \"none\",\n                                            animation: \"fc-node-pulse 0.9s ease-out forwards\",\n                                        }}\n                                    />\n                                );\n                            })()}\n\n                            {/* inline lane-rename editor */}\n                            {laneEdit !== null && (() => {\n                                const lane = layout.lanes.find(l => keyEqual(l.key, laneEdit.key));\n                                if (!lane) return null;\n                                const td = layout.orientation === \"TD\";\n                                const style: React.CSSProperties = td\n                                    ? { left: 8, top: lane.y + 8, width: 148 }\n                                    : { left: lane.cx - 74, top: 8, width: 148 };\n                                const commit = (): void => {\n                                    const next = laneEdit;\n                                    setLaneEdit(null);\n                                    if (next !== null && next.label.trim() !== \"\" && renameLaneEdit !== undefined) renameLaneEdit(next.key, next.label.trim());\n                                };\n                                return (\n                                    <input\n                                        data-flowchart-lane-edit\n                                        autoFocus\n                                        aria-label={words.m.laneLabelField()}\n                                        value={laneEdit.label}\n                                        onChange={e => setLaneEdit(le => (le === null ? le : { ...le, label: e.target.value }))}\n                                        onBlur={commit}\n                                        onKeyDown={e => {\n                                            // ⏎ commits and Esc puts the label back, each key going no further than the Flowchart (#1398).\n                                            if (e.key === \"Enter\") { takeKey(e); commit(); }\n                                            else if (e.key === \"Escape\") { takeKey(e); setLaneEdit(null); }\n                                        }}\n                                        style={{\n                                            position: \"absolute\", ...style, zIndex: 11,\n                                            fontFamily: \"var(--chakra-fonts-mono)\", fontSize: 11, fontWeight: 600,\n                                            padding: \"3px 8px\", borderRadius: 4,\n                                            border: \"1px solid var(--fc-brand-d)\",\n                                            background: \"var(--fc-paper)\", color: \"inherit\", outline: \"none\",\n                                        }}\n                                    />\n                                );\n                            })()}\n\n                            {/* legend — planned / observed / trigger / in-place, then a row for each read the cards and\n                                labels draw, and beside them, one over another, a group for each tag list it lists (R31) */}\n                            {legendOn && (\n                                <Box css={styles.legend} data-flowchart-legend>\n                                    <Box css={styles.legendRows} data-legend-rows=\"\">\n                                        <Box css={styles.legendTitle}>{words.m.legendTitle()}</Box>\n                                        <Box css={styles.legendRow} data-legend-line=\"planned\">\n                                            <svg width={28} height={8}><line x1={1} y1={4} x2={27} y2={4} stroke={INK} strokeWidth={2} /></svg>\n                                            <span>{words.m.legendLine({ line: \"planned\" })}</span>\n                                        </Box>\n                                        <Box css={styles.legendRow} data-legend-line=\"observed\">\n                                            <svg width={28} height={8}><line x1={1} y1={4} x2={27} y2={4} stroke={INFO} strokeWidth={1.6} strokeDasharray=\"5 4\" /></svg>\n                                            <span>{words.m.legendLine({ line: \"observed\" })}</span>\n                                        </Box>\n                                        <Box css={styles.legendRow} data-legend-line=\"decision\">\n                                            <svg width={28} height={16}>\n                                                <rect x={9} y={3} width={10} height={10} rx={2} transform=\"rotate(45 14 8)\" fill={PAPER} stroke={BRAND_D} strokeWidth={1.2} />\n                                            </svg>\n                                            <span>{words.m.legendLine({ line: \"decision\" })}</span>\n                                        </Box>\n                                        <Box css={styles.legendRow} data-legend-line=\"inPlace\">\n                                            {/* The ↻ badge in a mark's 28 × 16 box, as a read's mark is: its words start where every row's do. */}\n                                            <Box as=\"span\" css={styles.legendMark}>\n                                                <Box as=\"span\" css={styles.nodeBadge}><FontAwesomeIcon icon={faRotateRight} style={{ fontSize: \"8px\" }} /> n</Box>\n                                            </Box>\n                                            <span>{words.m.legendLine({ line: \"inPlace\" })}</span>\n                                        </Box>\n                                        {legend.reads.map((row) => (\n                                            <Box key={row.key} css={styles.legendRow} data-legend-read={row.key}>\n                                                <FlowchartLegendMarkView styles={styles} mark={row.mark} />\n                                                <span>{row.text}</span>\n                                            </Box>\n                                        ))}\n                                    </Box>\n                                    {legend.groups.length > 0 && (\n                                        <Box css={styles.legendGroups} data-legend-groups=\"\">\n                                            {legend.groups.map((group) => (\n                                                <Box key={group.key} css={styles.legendTags} data-legend-group={group.key}>\n                                                    <Box css={styles.legendTitle}>{group.label}</Box>\n                                                    {group.tags.length > 0 && (\n                                                        <Box css={styles.legendTagList}>\n                                                            {group.tags.map((tag) => <FlowchartTag key={tag.tag} css={styles.tag} text={tag.tag} look={tag.look} />)}\n                                                        </Box>\n                                                    )}\n                                                </Box>\n                                            ))}\n                                        </Box>\n                                    )}\n                                </Box>\n                            )}\n                        </Box>\n                    </Box>\n                </Box>\n            )}\n            {/* The minimap: over the canvas in main's corner, where it stays\n                while the canvas scrolls under it — never in the drawing, whose\n                far corner a wide or a tall Flowchart scrolls out of view. */}\n            {layout !== null && !empty && showMinimap && (\n                <Box css={styles.minimap} data-flowchart-minimap>\n                    <svg width={96} height={64} viewBox={`0 0 ${layout.width} ${layout.height}`} preserveAspectRatio=\"xMidYMid meet\">\n                        {[...layout.nodes.values()].map(r => (\n                            <rect key={r.key} x={r.x} y={r.y} width={r.w} height={r.h} rx={8}\n                                fill=\"none\" stroke={INK_3} strokeWidth={6} />\n                        ))}\n                    </svg>\n                </Box>\n            )}\n            {/* A read that failed: said once, at the top-left of the canvas's box, which the drawing scrolls under. */}\n            {failure !== undefined && (\n                <LoadingFailedBox message={failure.message} retry={{ onRetry: failure.retry }} at={{ top: FAILED_INSET_PX, left: FAILED_INSET_PX }} />\n            )}\n        </Box>\n    );\n\n    // A phone's lane pager over the canvas, while the window holds fewer lanes than the flow has: each lane as wide as the zoom draws it.\n    return (\n        <>\n            {layout !== null && !empty && windowed && layout.lanes.length > lanesShown && (\n                <FlowchartLanePager frame={scrollEl} total={layout.lanes.length} inView={lanesShown} slotPx={laneSlot * zoom} centred={cards !== undefined} words={words} />\n            )}\n            {body}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's reads of the app's records (#1502, `Flowchart Records\n * Spec.md` R5, R6, D7), in a component of its own, as the Schematic's are\n * (`schematic/data.ts`): each kind's stored rows through its `rows()` — its\n * record read whole, or its narrowing read complete through its source of the\n * rail, page by page until done, four pages in flight at most (`PagedScan`,\n * inside the kind's own function) — never a window of it, with no cap and no\n * banner. The lanes and the decisions are read whole.\n *\n * - **Under `\"hide\"`** a transition kept whose end no state read holds has\n *   that end read by key through the states' source (`recordSliceRows`, the\n *   Plan's link ends' read), every such end in one request, at the states' key\n *   type (#1549): found, the state the narrowing hides holds it, and the\n *   transition is hidden with it; absent — or a text no key of theirs prints\n *   as — the end is a ghost, and Issues lists it. Under `\"dim\"` every row is\n *   read, so an end no state holds is absent.\n * - **The last settled read stands** while a newer one is in flight, so a new\n *   narrowing keeps what the canvas drew, busy, and the footer's loading line\n *   says what is read (`reading`) and whether it is a new narrowing\n *   (`filtering`). A read the flowchart has never settled is the frame's cold\n *   load: nothing drawn, never as empty.\n * - **Each kind is read on its own**: one whose read fails keeps what was\n *   drawn of it and says why under its kind, every other kind read; a read\n *   again — `attempt` moving — reads every kind afresh.\n *\n * It reads the stored rows alone: the frame draws the editing session's drafts\n * over them (`drafted.ts`). A kind's rows read again as they were — the same\n * keys, each row's bytes the same — are the same object, so the frame is handed\n * what it reads only when that moves. Beside them it says the revision each\n * kind read by key was read at (`revisions`) and the one its record reads at\n * now, whatever is in flight (`now`): rows read at another are from before it,\n * which tells stored rows read before a Save from rows read since.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { BlobType, StringType, SortedSet, compareFor, equalFor, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { getSomeorUndefined, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { recordSliceRows } from \"@elaraai/east-ui-components/internal\";\nimport { kindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport type { FlowchartDecisionRoles, FlowchartLaneRoles, FlowchartStateRoles, FlowchartTransitionRoles, FlowchartValue } from \"./model.js\";\n\n/** The Flowchart's kinds, by the prop each fills — and the slot each keeps its reads, its session and its failures under. */\nexport type FlowchartSort = \"states\" | \"transitions\" | \"lanes\" | \"decisions\";\n\n/** The kinds in the Flowchart's order: what the loading line names first. */\nexport const FLOWCHART_SORTS: readonly FlowchartSort[] = [\"states\", \"transitions\", \"lanes\", \"decisions\"];\n\n/** The kinds read through a source of the rail, each named after the kind. */\nexport const SOURCE_SORTS: readonly (\"states\" | \"transitions\")[] = [\"states\", \"transitions\"];\n\n/** One stored row a read holds: its roles, read with it, and its row's bytes at the record's row type. */\nexport interface FlowchartStoredRow<R> {\n    /** Its roles. */\n    readonly roles: R;\n    /** Its row, as bytes. */\n    readonly row: Uint8Array;\n}\n\n/** A kind's stored rows a read holds, by key. */\nexport type FlowchartStored<R> = ReadonlyMap<string, FlowchartStoredRow<R>>;\n\n/** Each kind's stored rows the settled read holds; `undefined` for a kind the Flowchart is not given. */\nexport interface FlowchartHeld {\n    /** The states: the rows the narrowing keeps, or every row under `\"dim\"`. */\n    readonly states: FlowchartStored<FlowchartStateRoles>;\n    /** The transitions. */\n    readonly transitions: FlowchartStored<FlowchartTransitionRoles> | undefined;\n    /** The lanes, read whole. */\n    readonly lanes: FlowchartStored<FlowchartLaneRoles> | undefined;\n    /** The decisions, read whole. */\n    readonly decisions: FlowchartStored<FlowchartDecisionRoles> | undefined;\n}\n\n/** What the Flowchart reads now, as the footer's loading line says it: the first kind in flight, and whether the read is of a new narrowing. */\nexport interface FlowchartReading {\n    /** The kind. */\n    readonly sort: FlowchartSort;\n    /** Whether its source's narrowing is not the one its drawing was read under, which stands in meanwhile: `Updating states…`. */\n    readonly filtering: boolean;\n}\n\n/** What the Flowchart has read of its kinds' records. */\nexport interface FlowchartData {\n    /** Whether a read has settled: every kind read, or its read failed. */\n    readonly ready: boolean;\n    /** Whether a read is in flight. */\n    readonly loading: boolean;\n    /** What is read now, the first kind in flight in the Flowchart's order; `undefined` while nothing is. */\n    readonly reading: FlowchartReading | undefined;\n    /** Whether what is drawn of a kind was read under a narrowing its source no longer holds, the new one in flight: it stands in, kept, taking no edit. */\n    readonly filtering: boolean;\n    /** Why the read as a whole failed — outside any one kind's. */\n    readonly error: string | undefined;\n    /** Why a kind's read failed, by the kind. */\n    readonly failures: ReadonlyMap<FlowchartSort, string>;\n    /** Each kind's stored rows the settled read holds. */\n    readonly held: FlowchartHeld;\n    /**\n     * The transitions held whose end no state read holds and the states' narrowing hides (D7), by key: hidden with it —\n     * never drawn, and never an issue — yet held, so a state's Del deletes them with it (R10).\n     */\n    readonly hiddenWith: ReadonlySet<string>;\n    /** The revision each kind's held rows were read at, for a kind its record is read by key of (its `entries`); none for one read whole. */\n    readonly revisions: ReadonlyMap<FlowchartSort, string>;\n    /**\n     * The revision each such kind's record reads at now, whatever of the read is in flight: held rows read at another\n     * are from before it (`drafted.ts`' `landedDrafts`).\n     */\n    readonly now: ReadonlyMap<FlowchartSort, string>;\n}\n\nconst compareString = compareFor(StringType);\nconst sameString = equalFor(StringType);\nconst sameBytes = equalFor(BlobType);\nconst sameWhere = equalFor(RecordSliceWhereType);\n\n/** A record Slice's narrowing, decoded. */\ntype Where = ValueTypeOf<typeof RecordSliceWhereType>;\n\n/** No row held. */\nconst NO_ROWS: ReadonlyMap<string, never> = new Map<string, never>();\n\n/** No transition hidden with its far end. */\nconst NO_KEYS: ReadonlySet<string> = new SortedSet<string>([], compareString);\n\n/** No kind failed. */\nconst NO_FAILURES: ReadonlyMap<FlowchartSort, string> = new Map<FlowchartSort, string>();\n\n/** No kind whose record names a revision. */\nconst NO_REVISIONS: ReadonlyMap<FlowchartSort, string> = new Map<FlowchartSort, string>();\n\n/** Nothing held: a frame before its first read settles. */\nconst NOTHING_HELD: FlowchartHeld = { states: NO_ROWS, transitions: undefined, lanes: undefined, decisions: undefined };\n\n/** The frame's data before its reader first reports: nothing drawn, a read in flight. */\nexport const INITIAL_FLOWCHART_DATA: FlowchartData = {\n    ready: false, loading: true, reading: undefined, filtering: false, error: undefined, failures: NO_FAILURES, held: NOTHING_HELD, hiddenWith: NO_KEYS,\n    revisions: NO_REVISIONS, now: NO_REVISIONS,\n};\n\n/** Why a read failed, as the box says it. */\nfunction messageOf(error: unknown): string {\n    return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * A kind's rows as they were, where they read again as they were: the same keys, each row's bytes the same.\n *\n * @param was - The rows last held\n * @param now - The rows read now\n * @returns `was` where they hold the same, else `now`\n */\nfunction steady<R>(was: FlowchartStored<R> | undefined, now: FlowchartStored<R>): FlowchartStored<R> {\n    if (was === undefined || was.size !== now.size) return now;\n    for (const [key, entry] of now) {\n        const last = was.get(key);\n        if (last === undefined || !sameBytes(last.row, entry.row)) return now;\n    }\n    return was;\n}\n\n/** Two sets of keys holding the same keys. */\nfunction sameKeys(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean {\n    if (a.size !== b.size) return false;\n    for (const key of a) if (!b.has(key)) return false;\n    return true;\n}\n\n/** Two maps of failures saying the same. */\nfunction sameFailures(a: ReadonlyMap<FlowchartSort, string>, b: ReadonlyMap<FlowchartSort, string>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [sort, why] of a) {\n        const other = b.get(sort);\n        if (other === undefined || !sameString(other, why)) return false;\n    }\n    return true;\n}\n\n/** A kind as its read takes it: its stored rows, `none` while in flight, and its record read by key, whose revision they are read at. */\ninterface RowsReader {\n    readonly rows: () => option<FlowchartStored<unknown>>;\n    readonly entries: option<{ readonly revision: () => option<string> }>;\n}\n\n/** Two maps of revisions saying the same. */\nfunction sameRevisions(a: ReadonlyMap<FlowchartSort, string>, b: ReadonlyMap<FlowchartSort, string>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [sort, revision] of a) {\n        const other = b.get(sort);\n        if (other === undefined || !sameString(other, revision)) return false;\n    }\n    return true;\n}\n\n/** What one read of every kind gave: each kind's rows where they landed, why one failed, what is in flight, the far ends' verdict and the narrowings read under. */\ninterface Read {\n    readonly rows: { -readonly [S in FlowchartSort]?: FlowchartStored<unknown> };\n    readonly failures: ReadonlyMap<FlowchartSort, string>;\n    readonly inFlight: ReadonlySet<FlowchartSort>;\n    readonly hiddenWith: ReadonlySet<string>;\n    readonly wheres: ReadonlyMap<FlowchartSort, Where>;\n    /** The revision each kind read by key reads at now: what the rows this read holds of it were read at. */\n    readonly now: ReadonlyMap<FlowchartSort, string>;\n}\n\n/**\n * Reads the records (see the module docs).\n *\n * @param value - The payload\n * @param attempt - Moves to read every kind afresh: a Retry\n * @returns What the Flowchart has read\n */\nexport function useFlowchartData(value: FlowchartValue, attempt = 0): FlowchartData {\n    const read = useCallback((): Read => {\n        // A Retry reads every kind again.\n        void attempt;\n        const chrome = getSomeorUndefined(value.slice);\n        const rows: Read[\"rows\"] = {};\n        const failures = new Map<FlowchartSort, string>();\n        const inFlight = new Set<FlowchartSort>();\n        const now = new Map<FlowchartSort, string>();\n        const take = (sort: FlowchartSort, kind: RowsReader | undefined) => {\n            if (kind === undefined) return;\n            try {\n                // The revision its record reads at now, whatever of its rows is in flight: what they are read at.\n                const at = kind.entries.type === \"some\" ? kind.entries.value.revision() : undefined;\n                if (at?.type === \"some\") now.set(sort, at.value);\n                const got = kind.rows();\n                if (got.type === \"some\") rows[sort] = got.value;\n                else inFlight.add(sort);\n            } catch (error) {\n                failures.set(sort, messageOf(error));\n            }\n        };\n        take(\"states\", value.states);\n        take(\"transitions\", getSomeorUndefined(value.transitions));\n        take(\"lanes\", getSomeorUndefined(value.lanes));\n        take(\"decisions\", getSomeorUndefined(value.decisions));\n\n        // Under hide, the ends of the transitions kept that no state read holds: read by key through the states' source,\n        // every such end in one request (D7). Found, the transition is hidden with it; absent, the end is a ghost.\n        let hiddenWith: ReadonlySet<string> = NO_KEYS;\n        const states = rows.states as FlowchartStored<FlowchartStateRoles> | undefined;\n        const transitions = rows.transitions as FlowchartStored<FlowchartTransitionRoles> | undefined;\n        const part = value.narrowed.type === \"hide\" ? sourcePart(chrome, \"states\") : undefined;\n        if (part !== undefined && states !== undefined && transitions !== undefined) {\n            const far = new SortedSet<string>([], compareString);\n            for (const entry of transitions.values()) {\n                if (!states.has(entry.roles.from)) far.add(entry.roles.from);\n                if (!states.has(entry.roles.to)) far.add(entry.roles.to);\n            }\n            // Each end read back at the states' key type (#1549): a text no key of theirs prints as names no state, a ghost.\n            const stateKeys = kindKeys(value.states.keyType);\n            const asked = [...far].flatMap((text) => {\n                const key = stateKeys.keyOf(text);\n                return key === undefined ? [] : [{ text, key }];\n            });\n            if (asked.length > 0) {\n                try {\n                    const got = recordSliceRows(part, asked.map(({ key }) => key));\n                    if (got.type === \"none\") inFlight.add(\"transitions\");\n                    else {\n                        const held = new SortedSet<string>([], compareString);\n                        got.value.forEach((row, i) => { if (row.type === \"some\") held.add(asked[i]!.text); });\n                        if (held.size > 0) {\n                            const hidden = new SortedSet<string>([], compareString);\n                            for (const [key, entry] of transitions) {\n                                if (held.has(entry.roles.from) || held.has(entry.roles.to)) hidden.add(key);\n                            }\n                            hiddenWith = hidden;\n                        }\n                    }\n                } catch (error) {\n                    failures.set(\"transitions\", messageOf(error));\n                }\n            }\n        }\n\n        // The narrowing each kind read through its source was read under: what a new one is told from.\n        const wheres = new Map<FlowchartSort, Where>();\n        for (const sort of SOURCE_SORTS) {\n            const source = sourcePart(chrome, sort);\n            if (source !== undefined) wheres.set(sort, source.read().where);\n        }\n        return { rows, failures, inFlight, hiddenWith, wheres, now };\n    }, [value, attempt]);\n    const { result } = useTrackedEvaluation(read);\n\n    // The last settled read, kept while a newer one is in flight: a kind whose read failed keeps what it held.\n    const settled = useRef<{\n        readonly held: FlowchartHeld; readonly hiddenWith: ReadonlySet<string>; readonly failures: ReadonlyMap<FlowchartSort, string>;\n        readonly wheres: ReadonlyMap<FlowchartSort, Where>; readonly revisions: ReadonlyMap<FlowchartSort, string>;\n    } | undefined>(undefined);\n    if (result.ok && result.value.inFlight.size === 0) {\n        const got = result.value;\n        const was = settled.current;\n        // A kind's rows read again as they were stay the same object — whatever payload read them, as they are told\n        // apart by their bytes — and one whose read failed keeps what it held.\n        const kept = <R>(sort: FlowchartSort, last: FlowchartStored<R> | undefined, given: boolean): FlowchartStored<R> | undefined => {\n            if (!given) return undefined;\n            const now = got.rows[sort] as FlowchartStored<R> | undefined;\n            if (now === undefined) return last ?? (NO_ROWS as FlowchartStored<R>);\n            return steady(last, now);\n        };\n        const held: FlowchartHeld = {\n            states: kept(\"states\", was?.held.states, true)!,\n            transitions: kept(\"transitions\", was?.held.transitions, value.transitions.type === \"some\"),\n            lanes: kept(\"lanes\", was?.held.lanes, value.lanes.type === \"some\"),\n            decisions: kept(\"decisions\", was?.held.decisions, value.decisions.type === \"some\"),\n        };\n        const same = was !== undefined && Object.is(was.held.states, held.states) && Object.is(was.held.transitions, held.transitions)\n            && Object.is(was.held.lanes, held.lanes) && Object.is(was.held.decisions, held.decisions);\n        settled.current = {\n            held: same ? was.held : held,\n            hiddenWith: was !== undefined && sameKeys(was.hiddenWith, got.hiddenWith) ? was.hiddenWith : got.hiddenWith,\n            failures: was !== undefined && sameFailures(was.failures, got.failures) ? was.failures : got.failures.size === 0 ? NO_FAILURES : got.failures,\n            wheres: got.wheres,\n            // What every kind's rows were read at: the revisions this read found, each kind's rows landed at its own.\n            revisions: was !== undefined && sameRevisions(was.revisions, got.now) ? was.revisions : got.now.size === 0 ? NO_REVISIONS : got.now,\n        };\n    }\n    const last = settled.current;\n    const loading = result.ok ? result.value.inFlight.size > 0 : false;\n    const error = result.ok ? undefined : messageOf(result.error);\n    // A kind's drawing read under a narrowing its source no longer holds stands in, kept, while the new one is read.\n    const moved = (sort: FlowchartSort): boolean => {\n        if (!result.ok || last === undefined) return false;\n        const was = last.wheres.get(sort);\n        const now = result.value.wheres.get(sort);\n        return was !== undefined && now !== undefined && !sameWhere(was, now);\n    };\n    const filtering = result.ok && SOURCE_SORTS.some((sort) => moved(sort) && !result.value.failures.has(sort));\n    const first = result.ok ? FLOWCHART_SORTS.find((sort) => result.value.inFlight.has(sort)) : undefined;\n    const readingRef = useRef<FlowchartReading | undefined>(undefined);\n    const readingNow: FlowchartReading | undefined = first === undefined ? undefined : { sort: first, filtering: moved(first) };\n    const readingWas = readingRef.current;\n    // The same object while it names the same kind the same way, so a page landing moves nothing.\n    const reading = readingNow !== undefined && readingWas !== undefined && readingNow.sort === readingWas.sort && readingNow.filtering === readingWas.filtering\n        ? readingWas : readingNow;\n    readingRef.current = reading;\n    // What the frame is handed: another object only as what it holds moves — a kind's rows, the transitions hidden with\n    // their ends, a kind's failure — or what is read. The settled read is written afresh at every render, and the frame\n    // taking what it is handed renders the reader again: handed a new object at every render, it would take one without end.\n    const held = last?.held;\n    const hiddenWith = last?.hiddenWith;\n    const failures = last?.failures;\n    const revisions = last?.revisions ?? NO_REVISIONS;\n    // The revision each record reads at now — the latest read's, never the settled one's: the same object while it says the same.\n    const nowRef = useRef<ReadonlyMap<FlowchartSort, string>>(NO_REVISIONS);\n    const nowRead = result.ok ? result.value.now : NO_REVISIONS;\n    const now = sameRevisions(nowRead, nowRef.current) ? nowRef.current : nowRead;\n    nowRef.current = now;\n    return useMemo((): FlowchartData => (held === undefined || hiddenWith === undefined || failures === undefined\n        ? { ...INITIAL_FLOWCHART_DATA, loading: error === undefined, reading, error, now }\n        : { ready: true, loading, reading, filtering, error, failures, held, hiddenWith, revisions, now }),\n    [held, hiddenWith, failures, revisions, now, loading, reading, filtering, error]);\n}\n\n/**\n * The Flowchart's reads, in a component of its own (#1343, as the\n * Schematic's): each page that lands renders it again alone, and it hands the frame\n * what it read only when what the frame shows moves — once its own render is\n * done, so the frame draws it in a task of its own.\n *\n * @param props - The payload, the read's attempt, and where the data goes\n * @returns Nothing: it reads\n */\nexport function FlowchartDataReader({ value, attempt, onData }: {\n    value: FlowchartValue; attempt: number; onData: (data: FlowchartData) => void;\n}): null {\n    const data = useFlowchartData(value, attempt);\n    const reported = useRef<FlowchartData | undefined>(undefined);\n    useEffect(() => {\n        if (Object.is(reported.current, data)) return;\n        reported.current = data;\n        onData(data);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The records with the drafts in place (#1503, `Flowchart Records Spec.md`\n * R6, R11) — pure, as the Schematic's `drafted.ts`: what the model is made\n * from, the reader's stored rows with the editing session's drafts over them,\n * each drafted row as its kind reads it.\n *\n * - **A drafted row the read holds** stands as drafted; one its draft deletes\n *   stands nowhere.\n * - **A row its draft adds** — one a gesture created, or one another session\n *   removed under the draft, its session's original holding none of it\n *   (`shared/schedule/drafted-rows.ts`) — stands whatever the narrowing, and\n *   draws as itself, never as context.\n * - **A drafted row the read does not hold** — a source's narrowing hides it\n *   — waits in its session by its original key: Issues lists it with the\n *   choices hiding it, and Save writes it with the rest. So does a drafted\n *   transition hidden with its far end (`read.ts`' `hiddenWith`).\n * - **Through a carry-over a drafted row stands as it last stood**\n *   (`shared/schedule/drafted-rows.ts`' `DraftedStanding`, the one rule every\n *   builder that draws its records' own rows asks): its record read again,\n *   its session yet to read the row there by its key, a state renamed here\n *   that another session removed is in no read and not yet a row its draft\n *   adds — and never leaves the canvas meanwhile.\n * - **Under `\"dim\"`** a stored row the narrowing's shown keys leave out stands\n *   as context (`dimmed`), and so does its draft.\n * - **What a Save landed** of a kind read through its source stands as the\n *   Save left it until the stored rows are read since (`landedDrafts`): a\n *   Save is confirmed as its kind's rows land, while the reader hands the\n *   frame nothing until every kind has — a link's far end, read by its key\n *   after them, among them — and drawn from the stored rows alone a renamed\n *   state showed its old name meanwhile. Stored rows are from before a Save\n *   while they were read at another revision than the one their record reads\n *   at now — the rule every host that draws what a Save landed reads its rows\n *   by (east-ui-components' `readBeforeSaves`) — and what landed is let go\n *   once they are read at it (`landedRead`).\n *\n * @packageDocumentation\n */\n\nimport { readBeforeSaves } from \"@elaraai/east-ui-components/internal\";\nimport { DraftedStanding, type DraftedRow, type DraftedRows } from \"../shared/schedule/drafted-rows.js\";\nimport type {\n    FlowchartDecisionRoles, FlowchartKindKeys, FlowchartLaneRoles, FlowchartRow, FlowchartRows, FlowchartStateRoles, FlowchartTransitionRoles,\n} from \"./model.js\";\nimport { FLOWCHART_SORTS, type FlowchartHeld, type FlowchartSort, type FlowchartStored } from \"./read.js\";\n\n/** One kind's drafts, by key: the drafted row, or `undefined` for one its draft deletes. */\nexport type KindDrafts<R> = DraftedRows<R>;\n\n/** Every kind's drafts. */\nexport interface FlowchartDrafts {\n    /** The states'. */\n    readonly states: KindDrafts<FlowchartStateRoles>;\n    /** The transitions'. */\n    readonly transitions: KindDrafts<FlowchartTransitionRoles>;\n    /** The lanes'. */\n    readonly lanes: KindDrafts<FlowchartLaneRoles>;\n    /** The decisions'. */\n    readonly decisions: KindDrafts<FlowchartDecisionRoles>;\n}\n\n/** No draft of a kind. */\nconst NONE: KindDrafts<never> = new Map<string, never>();\n\n/** No drafts. */\nexport const NO_DRAFTS: FlowchartDrafts = { states: NONE, transitions: NONE, lanes: NONE, decisions: NONE };\n\n/**\n * What a confirmed Save landed of a row of a kind read through its source (`EditSession.landed`): the row as the Save\n * left it, standing so until the stored rows are read since (see the module docs).\n */\nexport interface LandedRow<R> {\n    /** The row as the Save left it, as the model takes a drafted row; `undefined` for one it deleted. */\n    readonly drawn: DraftedRow<R> | undefined;\n    /** The revision the Save's request was drafted at; `undefined` for a row held from none (`LandedEntry.from`). */\n    readonly from: string | undefined;\n}\n\n/** One kind's landed rows, by key. */\nexport type KindLanded<R> = ReadonlyMap<string, LandedRow<R>>;\n\n/** What Saves landed of each kind: none of a kind read whole, whose session is over its record's snapshot. */\nexport interface FlowchartLanded {\n    /** The states'. */\n    readonly states: KindLanded<FlowchartStateRoles>;\n    /** The transitions'. */\n    readonly transitions: KindLanded<FlowchartTransitionRoles>;\n    /** The lanes'. */\n    readonly lanes: KindLanded<FlowchartLaneRoles>;\n    /** The decisions'. */\n    readonly decisions: KindLanded<FlowchartDecisionRoles>;\n}\n\n/** Nothing landed of a kind. */\nexport const NONE_LANDED: KindLanded<never> = new Map<string, never>();\n\n/** Nothing landed. */\nexport const NO_LANDED: FlowchartLanded = { states: NONE_LANDED, transitions: NONE_LANDED, lanes: NONE_LANDED, decisions: NONE_LANDED };\n\n/** A drafted row of one kind waiting in its session, drawn nowhere: its kind, its key and its roles. */\ninterface Waiting<S extends FlowchartSort, R> {\n    /** Its kind. */\n    readonly sort: S;\n    /** Its key. */\n    readonly key: string;\n    /** Its drafted roles. */\n    readonly roles: R;\n}\n\n/** A drafted row waiting in its session, drawn nowhere: its kind, its key and its roles, as its kind reads them. */\nexport type FlowchartWaiting =\n    | Waiting<\"states\", FlowchartStateRoles>\n    | Waiting<\"transitions\", FlowchartTransitionRoles>\n    | Waiting<\"lanes\", FlowchartLaneRoles>\n    | Waiting<\"decisions\", FlowchartDecisionRoles>;\n\n/** Which stored rows the narrowing's shown keys leave out, under `\"dim\"`: by kind, whether a key draws as context. */\nexport interface FlowchartDimmed {\n    /** A state drawn as context. */\n    readonly states?: ((key: string) => boolean) | undefined;\n    /** A transition drawn as context. */\n    readonly transitions?: ((key: string) => boolean) | undefined;\n}\n\n/** The records with the drafts in place, and the drafts drawn nowhere. */\nexport interface FlowchartDraftedRows {\n    /** What the model is made from. */\n    readonly rows: FlowchartRows;\n    /** The transitions held but hidden with their far end, their drafts in place: what a state's Del deletes beside those drawn. */\n    readonly hidden: readonly FlowchartRow<FlowchartTransitionRoles>[];\n    /** The drafted rows waiting in their sessions, each kind's in its drafts' order: what Issues checks beside the drawing. */\n    readonly waiting: readonly FlowchartWaiting[];\n}\n\n/** A row drawn as itself. */\nconst LIT = (): boolean => false;\n\n/** No key hidden. */\nconst NO_KEYS: ReadonlySet<string> = new Set<string>();\n\n/**\n * One kind's rows with its drafts in place: each stored row as drafted, or\n * nowhere where its draft deletes it; each row its draft adds after them.\n *\n * @param sort - The kind\n * @param stored - The kind's stored rows the read holds\n * @param drafts - The kind's drafts\n * @param waits - A drafted row of the kind drawn nowhere, as Issues lists it\n * @param dimmed - Whether a stored row draws as context\n * @param hidden - Stored rows hidden from the canvas, though held: a transition hidden with its far end\n * @param waiting - Where a drafted row drawn nowhere is listed\n * @param standing - Which drafted rows stand, and what the canvas last drew\n * @param drew - Where the kind's drafted rows these rows hold are told: what the canvas remembers of them\n * @returns The rows\n */\nfunction merged<R>(sort: FlowchartSort, stored: FlowchartStored<R>, drafts: KindDrafts<R>, waits: (key: string, roles: R) => FlowchartWaiting,\n    dimmed: (key: string) => boolean, hidden: ReadonlySet<string>, waiting: FlowchartWaiting[], standing: DraftedStanding,\n    drew: Map<string, ReadonlySet<string>>): FlowchartRow<R>[] {\n    const out: FlowchartRow<R>[] = [];\n    const stood = new Set<string>();\n    drew.set(sort, stood);\n    for (const [key, entry] of stored) {\n        if (hidden.has(key)) continue;\n        if (!drafts.has(key)) { out.push({ key, roles: entry.roles, dimmed: dimmed(key) }); continue; }\n        const drafted = drafts.get(key);\n        if (drafted !== undefined) { stood.add(key); out.push({ key, roles: drafted.roles, dimmed: dimmed(key) }); }\n    }\n    for (const [key, drafted] of drafts) {\n        // A row its draft deletes stands nowhere, and is remembered as it stood: the deletion taken back finds it so.\n        if (drafted === undefined) { if (standing.stood(sort, key)) stood.add(key); continue; }\n        if (stored.has(key) && !hidden.has(key)) continue;\n        // A row its draft adds draws whatever the narrowing; any other the read doesn't show waits in its session — but\n        // through a carry-over, its session yet to judge it where its record is, one the canvas last drew stands.\n        if (!stored.has(key) && standing.stands(sort, key, drafted, false)) { stood.add(key); out.push({ key, roles: drafted.roles, dimmed: false }); }\n        else waiting.push(waits(key, drafted.roles));\n    }\n    return out;\n}\n\n/**\n * The records with the drafts in place (see the module docs).\n *\n * @param held - Each kind's stored rows the read holds\n * @param hiddenWith - The transitions hidden with their far end\n * @param drafts - Every kind's drafts\n * @param keys - Each kind's keys (#1549), which the model orders each kind's rows by\n * @param dimmed - Which stored rows the narrowing leaves out, under `\"dim\"`\n * @param standing - Which drafted rows stand, and what the canvas last drew, which these rows replace: the canvas's own,\n *   kept while it is mounted; one that remembers nothing unless given\n * @returns The rows, and the drafts drawn nowhere\n */\nexport function draftedRows(held: FlowchartHeld, hiddenWith: ReadonlySet<string>, drafts: FlowchartDrafts, keys: FlowchartKindKeys,\n    dimmed: FlowchartDimmed = {}, standing: DraftedStanding = new DraftedStanding()): FlowchartDraftedRows {\n    const waiting: FlowchartWaiting[] = [];\n    const drew = new Map<string, ReadonlySet<string>>();\n    const states = merged(\"states\", held.states, drafts.states, (key, roles) => ({ sort: \"states\", key, roles }), dimmed.states ?? LIT, NO_KEYS, waiting, standing, drew);\n    const transitions = held.transitions === undefined ? []\n        : merged(\"transitions\", held.transitions, drafts.transitions, (key, roles) => ({ sort: \"transitions\", key, roles }), dimmed.transitions ?? LIT, hiddenWith, waiting, standing, drew);\n    const lanes = held.lanes === undefined ? undefined\n        : merged(\"lanes\", held.lanes, drafts.lanes, (key, roles) => ({ sort: \"lanes\", key, roles }), LIT, NO_KEYS, waiting, standing, drew);\n    const decisions = held.decisions === undefined ? []\n        : merged(\"decisions\", held.decisions, drafts.decisions, (key, roles) => ({ sort: \"decisions\", key, roles }), LIT, NO_KEYS, waiting, standing, drew);\n    // What these rows hold of the drafts, once every one was asked by what the last rows held.\n    standing.drew(drew);\n    // The transitions hidden with their far end, as drafted: a deleted one is gone.\n    const hidden: FlowchartRow<FlowchartTransitionRoles>[] = [];\n    for (const key of hiddenWith) {\n        const entry = held.transitions?.get(key);\n        if (entry === undefined) continue;\n        if (!drafts.transitions.has(key)) { hidden.push({ key, roles: entry.roles, dimmed: false }); continue; }\n        const drafted = drafts.transitions.get(key);\n        if (drafted !== undefined) hidden.push({ key, roles: drafted.roles, dimmed: false });\n    }\n    return { rows: { states, transitions, lanes, decisions, keys }, hidden, waiting };\n}\n\n/**\n * The revision the Save of each landed row was drafted at.\n *\n * @param rows - A kind's landed rows\n * @returns Their revisions, one a row\n */\nfunction* draftedAt(rows: KindLanded<unknown>): Iterable<string | undefined> {\n    for (const row of rows.values()) yield row.from;\n}\n\n/**\n * Whether a kind's stored rows are from before what Saves landed of it, so holding its rows as they stood: read at\n * another revision than the one the kind's record reads at now (east-ui-components' `readBeforeSaves`) — or at none, no\n * read of the kind having said its revision yet.\n *\n * @param read - The revision the stored rows were read at; `undefined` for none\n * @param now - The revision the kind's record reads at now; `undefined` while it names none\n * @param rows - The kind's landed rows\n * @returns Whether they are\n */\nfunction storedBefore(read: string | undefined, now: string | undefined, rows: KindLanded<unknown>): boolean {\n    return read === undefined || readBeforeSaves(read, now, draftedAt(rows));\n}\n\n/**\n * One kind's drafts with what Saves landed of it laid under them, as {@link landedDrafts} lays them.\n *\n * @param drafts - The kind's drafts\n * @param landed - What Saves landed of it\n * @param stored - The kind's stored rows the read holds\n * @param hidden - Stored rows hidden from the canvas, though held\n * @returns The drafts; themselves while nothing is laid\n */\nfunction laidKind<R>(drafts: KindDrafts<R>, landed: KindLanded<R>, stored: FlowchartStored<R> | undefined, hidden: ReadonlySet<string>): KindDrafts<R> {\n    let out: Map<string, DraftedRow<R> | undefined> | undefined;\n    for (const [key, row] of landed) {\n        // A draft made since stands in its place. A row the canvas never drew — its narrowing hides it, or its far end —\n        // that the Save did not make stays out, as before the Save: it is no change waiting on Save.\n        if (drafts.has(key)) continue;\n        if (row.drawn !== undefined && !row.drawn.created && (stored?.has(key) !== true || hidden.has(key))) continue;\n        (out ??= new Map(drafts)).set(key, row.drawn);\n    }\n    return out ?? drafts;\n}\n\n/**\n * The drafts with what confirmed Saves landed laid under them (see the module docs): over a kind's stored rows read\n * before the revision its record reads at now, each row the Saves landed as they left it — one they deleted standing\n * nowhere, one they made standing though no stored row holds it. A draft of a row made since stands in its place, and\n * over stored rows read at that revision nothing is laid: they hold the Saves.\n *\n * @param drafts - Every kind's drafts\n * @param landed - What Saves landed of each kind\n * @param held - Each kind's stored rows the read holds\n * @param hiddenWith - The transitions hidden with their far end\n * @param revisions - The revision each kind's stored rows were read at (`read.ts`' `revisions`)\n * @param now - The revision each kind's record reads at now (`read.ts`' `now`)\n * @returns The drafts, each kind's landed rows after its own; the drafts themselves while nothing is laid\n */\nexport function landedDrafts(drafts: FlowchartDrafts, landed: FlowchartLanded, held: FlowchartHeld, hiddenWith: ReadonlySet<string>,\n    revisions: ReadonlyMap<FlowchartSort, string>, now: ReadonlyMap<FlowchartSort, string>): FlowchartDrafts {\n    const lay = <R>(sort: FlowchartSort, own: KindDrafts<R>, rows: KindLanded<R>, stored: FlowchartStored<R> | undefined, hidden: ReadonlySet<string>): KindDrafts<R> =>\n        (rows.size === 0 || !storedBefore(revisions.get(sort), now.get(sort), rows) ? own : laidKind(own, rows, stored, hidden));\n    const states = lay(\"states\", drafts.states, landed.states, held.states, NO_KEYS);\n    const transitions = lay(\"transitions\", drafts.transitions, landed.transitions, held.transitions, hiddenWith);\n    const lanes = lay(\"lanes\", drafts.lanes, landed.lanes, held.lanes, NO_KEYS);\n    const decisions = lay(\"decisions\", drafts.decisions, landed.decisions, held.decisions, NO_KEYS);\n    return Object.is(states, drafts.states) && Object.is(transitions, drafts.transitions) && Object.is(lanes, drafts.lanes) && Object.is(decisions, drafts.decisions)\n        ? drafts : { states, transitions, lanes, decisions };\n}\n\n/**\n * What Saves landed that the stored rows hold now, which their sessions let go (`EditSession.shown`): every landed row\n * of a kind whose stored rows are read at the revision its record reads at now. Over stored rows from before them, they\n * stand as landed still.\n *\n * @param landed - What Saves landed of each kind\n * @param revisions - The revision each kind's stored rows were read at\n * @param now - The revision each kind's record reads at now\n * @returns Each such kind's landed keys\n */\nexport function landedRead(landed: FlowchartLanded, revisions: ReadonlyMap<FlowchartSort, string>,\n    now: ReadonlyMap<FlowchartSort, string>): ReadonlyMap<FlowchartSort, readonly string[]> {\n    const out = new Map<FlowchartSort, readonly string[]>();\n    for (const sort of FLOWCHART_SORTS) {\n        const rows: KindLanded<unknown> = landed[sort];\n        if (rows.size === 0 || storedBefore(revisions.get(sort), now.get(sort), rows)) continue;\n        out.set(sort, [...rows.keys()]);\n    }\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A builder's drafted rows as it renders (#1599): `drafted-rows.ts`' rows,\n * read from the shared editing's sessions.\n *\n * - **Read again as the history moves**, never only as the drafts' bytes do:\n *   what a row began from moves under an unchanged draft — another session\n *   removed the row, or its own Save landed.\n * - **The same object while no row moves**, so what draws from them holds\n *   still while a Save is sent or read back.\n * - **A session behind its record is said to be carrying its drafts over**\n *   (the shared editing's `carrying`) from the very render the record's\n *   revision moves in: the session itself is told after that render, and a\n *   builder whose rows of the new revision were at hand already would draw one\n *   frame by what the session said of the old.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { NO_DRAFTED_ROWS, draftedRowsOf, type DraftedRows, type DraftedRowsByKind, type DraftedRowsCache, type DraftedRowsKind } from \"./drafted-rows.js\";\nimport type { ScheduleEditing } from \"./editing.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * Every kind's drafted rows (see `drafted-rows.ts`), read again as the history moves and the same object while no row\n * does.\n *\n * @param schedule - The shared editing over the kinds' records\n * @param kinds - The kinds, each named as its session is\n * @returns Each kind's rows, by what its session is named by: none of a kind with no draft\n */\nexport function useDraftedRows(schedule: Pick<ScheduleEditing, \"version\" | \"drafts\" | \"sessions\" | \"draftsOf\" | \"carrying\">, kinds: readonly DraftedRowsKind[]): DraftedRowsByKind {\n    const cache = useRef<DraftedRowsCache>(new WeakMap());\n    const held = useRef<DraftedRowsByKind>(NO_DRAFTED_ROWS);\n    const { version, drafts, sessions, draftsOf, carrying } = schedule;\n    // Whether each kind's session has yet to judge its drafts where its record reads now (tracked: it reads the record's\n    // revision) — from the very render the record moves in, before the session itself is told.\n    const readCarrying = useCallback(() => kinds.map((kind) => carrying(kind.key)),\n        // The sessions move under the history's version.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [kinds, carrying, version]);\n    const { result: read } = useTrackedEvaluation(readCarrying);\n    const behind = read.ok ? read.value : undefined;\n    return useMemo(() => {\n        const was = held.current;\n        const out = new Map<string, DraftedRows<unknown>>();\n        kinds.forEach((kind, i) => {\n            const ids = draftsOf(kind.key);\n            if (ids.size === 0) return;\n            const session = sessions.find((part) => stringEqual(part.kind, kind.key))?.session;\n            const from = session === undefined ? undefined : { entries: session.entries, originals: session.originals, carrying: session.carrying || behind?.[i] === true };\n            out.set(kind.key, draftedRowsOf(kind, ids.keys(), from, cache.current, was.get(kind.key)));\n        });\n        if (out.size === was.size && [...out].every(([key, rows]) => Object.is(was.get(key), rows))) return was;\n        held.current = out;\n        return out;\n        // The sessions' maps are mutable: the history's version records each change of them, an original's among them,\n        // and the drafts say which entries are drafted.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [version, drafts, sessions, kinds, draftsOf, behind]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's editing (#1503, `Flowchart Records Spec.md` R8–R13): one\n * history over a session a record — the states, the transitions, the lanes\n * and the decisions, each bound with its patch door — through the shared\n * Schedule editing (`shared/schedule/editing.ts`' `useScheduleEditing`), as\n * the Schematic's is (`schematic/editing.ts`). A gesture is one step across\n * the records it changes; Save sends each record's changes as a request of its\n * own through its patch door, and a refusal keeps that record's drafts and\n * leaves the others' commits standing (R12).\n *\n * - **Its reads.** A kind read whole is a session over its record's snapshot.\n *   A kind read through its source of the rail is read by key through its\n *   `entries`: what its source's read holds, kept at the revision it was read\n *   at (`keptAtRevision`), is a gesture's original and a Save's\n *   confirmation, and a row it does not hold is read by its key. Drafts of\n *   rows the narrowing hides stay in their sessions by their original keys,\n *   and Save sends them (R11).\n * - **Its writes.** A gesture's edits (`edits.ts`) go through the kinds' own\n *   functions: an existing row is rewritten from the row as its session finds\n *   it — drafted, else as the record holds it — through its kind's `write`, so\n *   only its roles' fields move (R8); a new row is its kind's `create`; a\n *   transition dropped a card is its kind's `create` over the ends its row\n *   holds, so they and its key stay; a decision's queue loses a deleted\n *   state's key through its kind's `unqueue`, and takes a state's new key in\n *   its old one's place through its `requeue`; a field of the form through its\n *   kind's `set`; the row a kind's own Details hands back, whole. A gesture any\n *   of whose rows its kind refuses records nothing.\n * - **A new key e3 holds already (R9, D3).** A kind read through its source\n *   under `\"hide\"` knows only the keys its narrowing keeps, so its session's\n *   check asks e3 for each new row's key by key through the kind's source —\n *   every such key in one request (`recordSliceRows`), each read back at the\n *   kind's key type (#1549), inside the history's tracked check — and a key\n *   e3 holds already is an `invalid` issue holding Save off, `incomplete`\n *   while the answer is read; the app's own `ready` is asked beside it. A key\n *   the Flowchart holds already is refused as it is typed (`edits.ts`).\n * - **A new row's key (#1549)** is its kind's to make (`newKey`): built from\n *   the row by the kind's `key`; else, keyed by String, the text the gesture\n *   makes up; by Integer, one past the largest the record, the drafts and the\n *   gesture hold — a kind read through its source asking its record for its\n *   largest; by any type the form types, a placeholder — a text no key prints\n *   as — which holds Save, `incomplete` at the row's key field, until the\n *   viewer types its key; and by any other, none: the kind adds no row\n *   (`untyped`). A row whose kind builds its key from its fields moves under\n *   the key a gesture's edit of them builds (`moves`).\n * - **A number its field's bounds don't hold (#1585).** Each kind's form goes\n *   with its record (`fields`): a changed row whose number is under its least\n *   or over its most holds Save, as the app's check does, and Issues names it.\n * - **Its drafts.** Each draft is read once for its version and the original\n *   beside it (`shared/schedule/drafted-rows.ts`): its roles through its\n *   kind's `read`, and whether its draft adds it — what the frame draws over\n *   the stored rows (`drafted.ts`).\n * - **What a Save landed.** A kind read by key is confirmed as its rows land,\n *   while the frame is handed what was read only once every kind has: its\n *   session keeps what each Save landed (`drawsLanded`, `EditSession.landed`),\n *   each row decoded once, which the frame lays under the drafts over stored\n *   rows read before the Save (`drafted.ts`' `landedDrafts`) and lets go once\n *   they are read since (`shown`).\n * - **What stands in.** While what the canvas draws stands in for a new\n *   narrowing, it is retained: no record takes an edit — every route asks\n *   `available`, and `record` records nothing — until it lands. The history's\n *   Undo, Redo, Discard and Save stay live.\n *\n * A Flowchart read only (`readOnly`) has no session, nor has a kind bound read\n * only (R13).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { StringType, equalFor, none, some, variant, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport type { EditingReadinessType, RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { getSomeorUndefined, type EditHistory, type LandedEntry, type Origin } from \"@elaraai/east-ui-components\";\nimport { recordSliceRows } from \"@elaraai/east-ui-components/internal\";\nimport type { DraftedRowsKind } from \"../shared/schedule/drafted-rows.js\";\nimport {\n    useScheduleEditing,\n    type ScheduleChange, type ScheduleEditing, type ScheduleEditingKind, type ScheduleEditingRecord, type ScheduleEntryRef, type ScheduleKindSession,\n    type ScheduleRowRead,\n} from \"../shared/schedule/editing.js\";\nimport { kindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { draftedRow, heldInWindow, keptAtRevision, madeFromValues, mintKey, rowCodec } from \"../shared/schedule/records.js\";\nimport { useDraftedRows } from \"../shared/schedule/use-drafted-rows.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { NONE_LANDED, NO_DRAFTS, NO_LANDED, type FlowchartDrafts, type FlowchartLanded, type KindDrafts, type KindLanded, type LandedRow } from \"./drafted.js\";\nimport type {\n    FlowchartDecisionRoles, FlowchartLaneRoles, FlowchartStateRoles, FlowchartTransitionRoles, FlowchartValue,\n} from \"./model.js\";\nimport { FLOWCHART_SORTS, type FlowchartHeld, type FlowchartSort } from \"./read.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** No event kind: the Flowchart writes its kinds a whole row at a time, as records. */\nconst NO_KINDS: readonly ScheduleEditingKind[] = [];\n\n/** No session made elsewhere joins the Flowchart's history. */\nconst NO_JOINED: Parameters<typeof useScheduleEditing>[0][\"joined\"] = [];\n\n/** A state's write, decoded. */\nexport type FlowchartStateWrite = ValueTypeOf<typeof import(\"@elaraai/e3-ui/internal\").Flowchart.Types.StateWrite>;\n/** A transition's write, decoded. */\nexport type FlowchartTransitionWrite = ValueTypeOf<typeof import(\"@elaraai/e3-ui/internal\").Flowchart.Types.TransitionWrite>;\n/** A lane's write, decoded. */\nexport type FlowchartLaneWrite = ValueTypeOf<typeof import(\"@elaraai/e3-ui/internal\").Flowchart.Types.LaneWrite>;\n/** The fields an author's card or the form sets on a row, as a kind's `set` takes them. */\nexport type FlowchartFieldWrites = Parameters<FlowchartValue[\"states\"][\"set\"]>[1];\n\n/** A drafted row's readiness, as a kind's check gives it. */\ntype Readiness = ValueTypeOf<typeof EditingReadinessType>;\n\n/**\n * One row a gesture changes, and how (R8): each through its kind's own\n * functions, as the module docs say.\n */\nexport type FlowchartEdit =\n    | { readonly op: \"createState\"; readonly key: string; readonly write: FlowchartStateWrite; readonly values: option<Uint8Array> }\n    | { readonly op: \"writeState\"; readonly key: string; readonly write: FlowchartStateWrite }\n    | { readonly op: \"createTransition\"; readonly key: string; readonly write: FlowchartTransitionWrite; readonly values: option<Uint8Array> }\n    | { readonly op: \"writeTransition\"; readonly key: string; readonly write: FlowchartTransitionWrite }\n    /** A transition given a card's values, its ends and its key kept. */\n    | { readonly op: \"retypeTransition\"; readonly key: string; readonly values: Uint8Array }\n    | { readonly op: \"createLane\"; readonly key: string; readonly write: FlowchartLaneWrite; readonly values: option<Uint8Array> }\n    | { readonly op: \"writeLane\"; readonly key: string; readonly write: FlowchartLaneWrite }\n    /** A deleted state's key taken out of a decision's queue. */\n    | { readonly op: \"unqueue\"; readonly key: string; readonly state: string }\n    /** A state's key replaced in a decision's queue by the new key it moves to (#1549). */\n    | { readonly op: \"requeue\"; readonly key: string; readonly from: string; readonly to: string }\n    /** Fields no role writes: the form's, or an author's card's. */\n    | { readonly op: \"set\"; readonly sort: FlowchartSort; readonly key: string; readonly sets: FlowchartFieldWrites }\n    /** A row whole: the one a kind's own Details hands back. */\n    | { readonly op: \"row\"; readonly sort: FlowchartSort; readonly key: string; readonly row: Uint8Array }\n    /**\n     * A new row under `key`, a copy of the row under `from` as its session finds it — a duplicate, or a new row under the\n     * key the form gives it — its order written where given. In a swap or a shift (#1581) it `replaces` the row the\n     * gesture moves off `key`, never a new one.\n     */\n    | { readonly op: \"copy\"; readonly sort: FlowchartSort; readonly key: string; readonly from: string; readonly order?: number | undefined; readonly replaces?: true }\n    | { readonly op: \"remove\"; readonly sort: FlowchartSort; readonly key: string };\n\n/** What the key check says, in the flowchart's words. */\nexport interface FlowchartKeyCheckWords {\n    /** A new row's key e3 holds already — `A state is keyed \"SCN\" already`. */\n    readonly held: (p: { sort: FlowchartSort; key: string }) => string;\n    /** While e3 is asked for it — `Checking the key \"SCN\"`. */\n    readonly checking: (p: { sort: FlowchartSort; key: string }) => string;\n    /** A new row held under a placeholder, its key still to be typed (#1549) — `Type this lane's key: Save waits for it`. */\n    readonly placeholder: (p: { sort: FlowchartSort }) => string;\n}\n\n/** A new row's key, as its kind makes it (#1549). */\nexport type FlowchartNewKey =\n    /** Its key: built from its row, made up, one past the largest, or a placeholder until the viewer types its key. */\n    | { readonly key: string }\n    /** None: the key its row builds is held already, by the row of that key. */\n    | { readonly taken: string }\n    /** None: its kind's keys are of a type the form can't type — by the type's name — and its kind builds none. */\n    | { readonly untyped: string };\n\n/** A row a gesture moves under the key its fields build once the gesture writes them (#1549). */\nexport interface FlowchartMove {\n    /** Its kind. */\n    readonly sort: FlowchartSort;\n    /** Its key. */\n    readonly key: string;\n    /** The key its row builds after the gesture. */\n    readonly to: string;\n}\n\n/** The Flowchart's editing: its history, every kind's drafts, and how a gesture is recorded. */\nexport interface FlowchartEditing {\n    /** The shared Schedule editing over the records: each one's session, and what each holds. */\n    readonly schedule: ScheduleEditing;\n    /** The one history over them. */\n    readonly history: EditHistory<ScheduleEntryRef>;\n    /** Whether any record is edited: a kind bound with its patch door, and the Flowchart not read only. */\n    readonly edits: boolean;\n    /** Every kind's drafts, each decoded once. */\n    readonly drafts: FlowchartDrafts;\n    /**\n     * What each confirmed Save landed of the kinds read by key, as their sessions keep it (`EditSession.landed`), each row\n     * decoded once: laid under the drafts over stored rows read before the Save (`drafted.ts`' `landedDrafts`).\n     */\n    readonly landed: FlowchartLanded;\n    /** The history's version: it moves with every change of it or of its sessions. */\n    readonly version: number;\n    /**\n     * Lets go of what Saves landed of a kind's rows, once the stored rows hold them as the record does now (`drafted.ts`'\n     * `landedRead`).\n     *\n     * @param sort - The kind\n     * @param keys - The rows' keys\n     */\n    shown(sort: FlowchartSort, keys: readonly string[]): void;\n    /**\n     * Whether the decisions queue states by their keys: a queue is given them — a state's Del takes its key out, and a\n     * state moved to a new key takes it there.\n     */\n    readonly unqueues: boolean;\n    /** Whether the lanes' order takes a whole number alone: an Integer field, whose write and create give none for another. */\n    readonly wholeLaneOrders: boolean;\n    /**\n     * Whether a kind is edited at all: bound with its patch door, and the Flowchart not read only (R13).\n     *\n     * @param sort - The kind\n     */\n    editable(sort: FlowchartSort): boolean;\n    /**\n     * Whether a kind takes an edit now: its session takes one, and nothing the canvas draws is retained.\n     *\n     * @param sort - The kind\n     */\n    available(sort: FlowchartSort): boolean;\n    /**\n     * Records one gesture's edits as one step of the history.\n     *\n     * @param edits - The rows it changes, and how\n     * @param origin - The gesture\n     * @param label - Its label in the history\n     * @returns Whether anything was recorded: nothing is when a kind refuses a row, a row's read is in flight, or what the\n     *   canvas draws is retained\n     */\n    record(edits: readonly FlowchartEdit[], origin: Origin, label: string): boolean;\n    /**\n     * Whether the Flowchart holds a key of a kind already: read, or drafted — a new row's among them.\n     *\n     * @param sort - The kind\n     * @param key - The key\n     */\n    taken(sort: FlowchartSort, key: string): boolean;\n    /**\n     * Whether a row of a kind stands under a key (#1549): drafted, else read — a key whose row a draft deletes stands\n     * free, so a row built under it again takes it back.\n     *\n     * @param sort - The kind\n     * @param key - The key\n     */\n    stands(sort: FlowchartSort, key: string): boolean;\n    /**\n     * A new transition's key: minted unique (`crypto.randomUUID()`) among every key the Flowchart has read and drafted\n     * of the transitions, and those given — never drawn (R9).\n     *\n     * @param minted - The keys the gesture has minted already\n     */\n    mintTransition(minted: ReadonlySet<string>): string;\n    /**\n     * A new row's key, as its kind makes one (#1549; the module docs): built from the row the edit makes, by the\n     * kind's `key`, refused where a row holds it; else, keyed by String, the text the gesture makes up; by Integer,\n     * one past the largest; by a type the form types, the text made up as a placeholder; by any other, none.\n     *\n     * @param sort - The row's kind\n     * @param made - The edit making the row, under any key: what the kind's `key` builds its key from\n     * @param madeUp - The text the gesture makes up, unique by what it is told is taken: `lane-<n>`, `state-<n>`, a UUID\n     * @param minted - The keys the gesture has made already\n     * @returns The key, or why there is none; `undefined` while a kind read through its source asks its record for its\n     *   largest, or where the kind makes no row of the edit\n     */\n    newKey(sort: FlowchartSort, made: FlowchartEdit, madeUp: (taken: (key: string) => boolean) => string, minted?: ReadonlySet<string>): FlowchartNewKey | undefined;\n    /**\n     * The rows a gesture moves under the keys their fields build once it writes them (#1549): each row it finds held —\n     * never one it makes — whose kind builds its key from its row, where the key its row builds changes, to another than\n     * the one it stands under — a row whose fields an app wrote apart from its key, edited back to build it, stays (#1581).\n     *\n     * @param edits - The gesture's edits\n     * @returns Each row it moves, and the key it moves under\n     */\n    moves(edits: readonly FlowchartEdit[]): FlowchartMove[];\n    /**\n     * Whether a kind builds a new row's key from its row: its `key`, which a key field never edits (#1549).\n     *\n     * @param sort - The kind\n     */\n    builds(sort: FlowchartSort): boolean;\n    /**\n     * Why a kind adds no row (#1549): its keys are of a type the form can't type, and it builds none.\n     *\n     * @param sort - The kind\n     * @returns The key type's name; `undefined` for a kind that keys the rows it adds\n     */\n    untyped(sort: FlowchartSort): string | undefined;\n}\n\n/** An Option's value, or `undefined`. */\nfunction someOf<T>(value: option<T>): T | undefined {\n    return value.type === \"some\" ? value.value : undefined;\n}\n\n/** A kind of any sort, as the payload carries it. */\ntype AnyKind = FlowchartValue[\"states\"] | NonNullable<FlowchartValue[\"transitions\"] extends option<infer T> ? T : never>\n    | NonNullable<FlowchartValue[\"lanes\"] extends option<infer T> ? T : never> | NonNullable<FlowchartValue[\"decisions\"] extends option<infer T> ? T : never>;\n\n/**\n * A kind of the payload, by its sort.\n *\n * @param value - The payload\n * @param sort - The kind\n * @returns It; `undefined` for a kind the Flowchart is not given\n */\nexport function kindOf(value: FlowchartValue, sort: FlowchartSort): AnyKind | undefined {\n    switch (sort) {\n        case \"states\": return value.states;\n        case \"transitions\": return getSomeorUndefined(value.transitions);\n        case \"lanes\": return getSomeorUndefined(value.lanes);\n        case \"decisions\": return getSomeorUndefined(value.decisions);\n    }\n}\n\n/** Every kind ready: what the check gives a batch with no app's check of its own. */\nconst READY: Readiness = variant(\"ready\", null);\n\n/** No key a gesture has made. */\nconst NO_MINTED: ReadonlySet<string> = new Set<string>();\n\n/**\n * The function a kind builds a new row's key from its row with (#1549): its `key`.\n *\n * @param kind - The kind\n * @returns It; `undefined` for a kind that builds none — a decision's among them\n */\nfunction builderOf(kind: AnyKind | undefined): ((row: Uint8Array) => string) | undefined {\n    return kind === undefined || !(\"rowKey\" in kind) ? undefined : getSomeorUndefined(kind.rowKey);\n}\n\n/**\n * A row as its session finds it: drafted, else as the read holds it.\n *\n * @param editing - The shared editing\n * @param held - Each kind's stored rows the read holds\n * @param kind - The row's kind\n * @param sort - Its sort\n * @param key - Its key\n * @returns Its bytes; `undefined` for a row its draft deletes, or one neither holds\n */\nfunction rowNow(editing: ScheduleEditing, held: FlowchartHeld, kind: AnyKind, sort: FlowchartSort, key: string): Uint8Array | undefined {\n    const entry = editing.sessions.find((part) => stringEqual(part.kind, sort))?.session.entries.get(key);\n    if (entry !== undefined) {\n        const row = draftedRow(entry);\n        return row === undefined ? undefined : rowCodec(kind.rowType).encode(row.row);\n    }\n    const rows: ReadonlyMap<string, { readonly row: Uint8Array }> | undefined = held[sort];\n    return rows?.get(key)?.row;\n}\n\n/**\n * The Flowchart's sessions over its records, and their drafts (see the module\n * docs).\n *\n * @param value - The payload\n * @param storageKey - The Flowchart's key: its sessions and their history are kept under it\n * @param recordSlices - The slice's parts over the kinds read through their sources: each Save notice counts what leaves its own\n * @param held - Each kind's stored rows the read holds: the keys a new row's key is unique among\n * @param words - What the key check says\n * @param retained - Whether what the canvas draws is retained: no record takes an edit while it is\n * @returns The editing\n */\nexport function useFlowchartEditing(value: FlowchartValue, storageKey: string, recordSlices: readonly ValueTypeOf<RecordSliceBindType>[],\n    held: FlowchartHeld, words: FlowchartKeyCheckWords, retained = false): FlowchartEditing {\n    // The sessions, the rows read and the words as they stand when the history's check is made. The sessions are the\n    // history's, known once it is made: before then — a first render over drafts kept from before — every drafted row the\n    // read does not hold is asked for, and the check is made again, knowing them, once the answer lands.\n    const sessionsNow = useRef<readonly ScheduleKindSession[]>([]);\n    const heldNow = useRef(held);\n    heldNow.current = held;\n    const wordsNow = useRef(words);\n    wordsNow.current = words;\n    // Each kind bound with its patch door — none while the Flowchart is read only (R13) — its check composed with the key\n    // check where its source's narrowing hides rows (D3), and its form: a changed row's number outside its field's bounds\n    // holds Save as the app's check does (#1585).\n    const records = useMemo((): ScheduleEditingRecord[] => {\n        if (value.readOnly) return [];\n        const chrome = getSomeorUndefined(value.slice);\n        const out: ScheduleEditingRecord[] = [];\n        for (const sort of FLOWCHART_SORTS) {\n            const kind = kindOf(value, sort);\n            if (kind === undefined || !kind.editable || kind.editing.type !== \"some\") continue;\n            const part = (sort === \"states\" || sort === \"transitions\") && value.narrowed.type === \"hide\" ? sourcePart(chrome, sort) : undefined;\n            const app = someOf(kind.ready);\n            const keyed = kindKeys(kind.keyType);\n            // A new row held under a placeholder, its key the viewer's to type: its kind makes none of its own (#1549).\n            const placeholders = !keyed.text && kind.keyType.type !== \"Integer\" && builderOf(kind) === undefined;\n            // The app's check over rows each under a key, and the key check where the narrowing hides rows (D3).\n            const keyedReady = (batch: { id: string; entry: Uint8Array }[]): Readiness[] => {\n                const verdicts = app === undefined ? batch.map(() => READY) : app(batch);\n                if (part === undefined) return verdicts;\n                // The rows new to the record: their session found none of their key before the gesture that wrote them, and\n                // the read holds none — a row it holds is e3's, and a Save's confirmation settles one written since. Each is\n                // asked at the kind's key type: a text no key prints as, e3 holds none of.\n                const session = sessionsNow.current.find((s) => stringEqual(s.kind, sort))?.session;\n                const read: ReadonlyMap<string, unknown> | undefined = heldNow.current[sort];\n                const fresh = batch.flatMap(({ id }, i) => {\n                    if (draftedRow(session?.originals.get(id)) !== undefined || read?.has(id) === true) return [];\n                    const key = keyed.keyOf(id);\n                    return key === undefined ? [] : [{ at: i, key }];\n                });\n                if (fresh.length === 0) return verdicts;\n                const asked = recordSliceRows(part, fresh.map(({ key }) => key));\n                const out = [...verdicts];\n                fresh.forEach(({ at }, n) => {\n                    const key = batch[at]!.id;\n                    if (asked.type !== \"some\") {\n                        out[at] = variant(\"incomplete\", [{ field: \"\", message: wordsNow.current.checking({ sort, key }) }]);\n                    } else if (asked.value[n]?.type === \"some\") {\n                        out[at] = variant(\"invalid\", [{ field: \"\", message: wordsNow.current.held({ sort, key }) }]);\n                    }\n                });\n                return out;\n            };\n            const ready = part === undefined && !placeholders ? kind.ready : some((batch: { id: string; entry: Uint8Array }[]): Readiness[] => {\n                if (!placeholders) return keyedReady(batch);\n                // A row under a placeholder waits on its key, at its key field; neither check is asked of it.\n                const out = batch.map(({ id }): Readiness => (keyed.isKey(id) ? READY\n                    : variant(\"incomplete\", [{ field: \"key\", message: wordsNow.current.placeholder({ sort }) }])));\n                const rest = batch.flatMap((entry, i) => (keyed.isKey(entry.id) ? [{ entry, i }] : []));\n                if (rest.length > 0) keyedReady(rest.map(({ entry }) => entry)).forEach((verdict, n) => { out[rest[n]!.i] = verdict; });\n                return out;\n            });\n            // A kind read by key keeps what each Save landed: the frame's stored rows are read apart from its confirmation.\n            out.push({ key: sort, name: kind.name, editing: kind.editing.value, entries: kind.entries, ready, fields: kind.fields, drawsLanded: kind.entries.type === \"some\" });\n        }\n        return out;\n    }, [value]);\n    // A kind read through its source: the rows its source's read holds, kept at the revision they were read at — a\n    // gesture's original, and what a Save confirms its entries by; any other row is read by its key.\n    const reads = useMemo((): Record<string, ScheduleRowRead> => {\n        const out: Record<string, ScheduleRowRead> = {};\n        for (const sort of FLOWCHART_SORTS) {\n            const kind = kindOf(value, sort);\n            if (kind === undefined || !kind.editable || kind.entries.type !== \"some\") continue;\n            const rows = keptAtRevision<ReadonlyMap<string, { readonly row: Uint8Array }>>(kind.entries, () => kind.rows());\n            out[sort] = (key) => heldInWindow(rows(), key);\n        }\n        return out;\n    }, [value]);\n    const schedule = useScheduleEditing({ kinds: NO_KINDS, records, reads, storageKey, joined: NO_JOINED, recordSlices, autosave: value.autosave });\n    sessionsNow.current = schedule.sessions;\n\n    // Each drafted row as its kind reads it, and whether its draft adds it: read again as its original moves — another\n    // session's removal of a row drafted here leaves the draft adding it — and the same rows while none does.\n    const draftedKinds = useMemo((): readonly DraftedRowsKind[] => FLOWCHART_SORTS.flatMap((sort) => {\n        const kind = kindOf(value, sort);\n        return kind === undefined ? [] : [{ key: sort, rowType: kind.rowType, keyType: kind.keyType, read: kind.read as DraftedRowsKind[\"read\"] }];\n    }), [value]);\n    const draftedRows = useDraftedRows(schedule, draftedKinds);\n    const drafts = useMemo((): FlowchartDrafts => ({\n        states: (draftedRows.get(\"states\") ?? NO_DRAFTS.states) as KindDrafts<FlowchartStateRoles>,\n        transitions: (draftedRows.get(\"transitions\") ?? NO_DRAFTS.transitions) as KindDrafts<FlowchartTransitionRoles>,\n        lanes: (draftedRows.get(\"lanes\") ?? NO_DRAFTS.lanes) as KindDrafts<FlowchartLaneRoles>,\n        decisions: (draftedRows.get(\"decisions\") ?? NO_DRAFTS.decisions) as KindDrafts<FlowchartDecisionRoles>,\n    }), [draftedRows]);\n\n    // What each Save landed of a kind read by key, each row decoded once: a session keeps a landed entry the same object\n    // until it lets it go.\n    const landedDecoded = useRef(new WeakMap<LandedEntry<ScheduleEntryRef>, LandedRow<unknown>>());\n    const version = schedule.version;\n    const landed = useMemo((): FlowchartLanded => {\n        const of = <R,>(sort: FlowchartSort): KindLanded<R> => {\n            const kind = kindOf(value, sort);\n            const entries = kind === undefined ? undefined : schedule.sessions.find((part) => stringEqual(part.kind, sort))?.session.landed;\n            if (kind === undefined || entries === undefined || entries.size === 0) return NONE_LANDED;\n            const codec = rowCodec(kind.rowType);\n            const keys = kindKeys(kind.keyType);\n            const read = kind.read as (bytes: Uint8Array, key: string) => R;\n            const rows = new Map<string, LandedRow<R>>();\n            for (const [id, entry] of entries) {\n                let row = landedDecoded.current.get(entry) as LandedRow<R> | undefined;\n                if (row === undefined) {\n                    // A row the Save deleted is none; one it added, a row its session found none of before.\n                    const after = draftedRow(entry.after);\n                    row = {\n                        drawn: after === undefined ? undefined : { roles: read(codec.encode(after.row), keys.readKey(id)), created: draftedRow(entry.before) === undefined },\n                        from: entry.from,\n                    };\n                    landedDecoded.current.set(entry, row);\n                }\n                rows.set(id, row);\n            }\n            return rows;\n        };\n        const states = of<FlowchartStateRoles>(\"states\"), transitions = of<FlowchartTransitionRoles>(\"transitions\");\n        const lanes = of<FlowchartLaneRoles>(\"lanes\"), decisions = of<FlowchartDecisionRoles>(\"decisions\");\n        // Nothing landed is the one object, so what reads it holds still while gestures move the history.\n        return states.size + transitions.size + lanes.size + decisions.size === 0 ? NO_LANDED : { states, transitions, lanes, decisions };\n        // What the sessions keep moves with the history's version.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [version, schedule.sessions, value]);\n\n    // Stable to the canvas: each calls the latest render's.\n    const latest = useRef({ value, schedule, held, retained });\n    latest.current = { value, schedule, held, retained };\n    const shown = useCallback((sort: FlowchartSort, keys: readonly string[]): void => {\n        latest.current.schedule.sessions.find((part) => stringEqual(part.kind, sort))?.session.shown(keys);\n    }, []);\n    const editedSorts = useMemo(() => new Set(records.map((record) => record.key)), [records]);\n    const editable = useCallback((sort: FlowchartSort): boolean => editedSorts.has(sort), [editedSorts]);\n    // Retained, no record takes an edit: every route asks it, and `record` refuses one.\n    const scheduleAvailable = schedule.available;\n    const available = useCallback((sort: FlowchartSort): boolean => !retained && editedSorts.has(sort) && scheduleAvailable(sort),\n        [retained, editedSorts, scheduleAvailable]);\n    // A gesture's edits as the shared editing records them, each row through its kind's own functions; `undefined` where\n    // a kind refuses one.\n    const changesOf = useCallback((edits: readonly FlowchartEdit[]): ScheduleChange[] | undefined => {\n        const { value: payload, schedule: editing, held: read } = latest.current;\n        const transitions = getSomeorUndefined(payload.transitions);\n        const lanes = getSomeorUndefined(payload.lanes);\n        const decisions = getSomeorUndefined(payload.decisions);\n        const changes: ScheduleChange[] = [];\n        for (const edit of edits) {\n            switch (edit.op) {\n                case \"createState\": {\n                    // A row the app's `values` fail to make, as one its kind refuses, records nothing.\n                    const row = madeFromValues(\"Flowchart\", `a new ${payload.states.name}`, () => payload.states.create(edit.write, edit.values));\n                    if (row?.type !== \"some\") return undefined;\n                    changes.push({ kind: \"states\", id: edit.key, row: row.value, created: true });\n                    break;\n                }\n                case \"writeState\": {\n                    const write = edit.write;\n                    changes.push({ kind: \"states\", id: edit.key, rewrite: (row) => someOf(payload.states.write(row, write)) });\n                    break;\n                }\n                case \"createTransition\": {\n                    const row = transitions === undefined ? undefined\n                        : madeFromValues(\"Flowchart\", `a new ${transitions.name}`, () => transitions.create(edit.write, edit.values));\n                    if (row?.type !== \"some\") return undefined;\n                    changes.push({ kind: \"transitions\", id: edit.key, row: row.value, created: true });\n                    break;\n                }\n                case \"writeTransition\": {\n                    if (transitions === undefined) return undefined;\n                    const write = edit.write;\n                    changes.push({ kind: \"transitions\", id: edit.key, rewrite: (row) => someOf(transitions.write(row, write)) });\n                    break;\n                }\n                case \"retypeTransition\": {\n                    // A card's values over the ends the row holds as the gesture finds it: they and its key stay.\n                    if (transitions === undefined) return undefined;\n                    const { key, values } = edit;\n                    changes.push({ kind: \"transitions\", id: key, rewrite: (row) => {\n                        const roles = transitions.read(row, key);\n                        return someOf(transitions.create({ from: some(roles.from), to: some(roles.to), decision: none }, some(values)));\n                    } });\n                    break;\n                }\n                case \"createLane\": {\n                    const row = lanes === undefined ? undefined : madeFromValues(\"Flowchart\", `a new ${lanes.name}`, () => lanes.create(edit.write, edit.values));\n                    if (row?.type !== \"some\") return undefined;\n                    changes.push({ kind: \"lanes\", id: edit.key, row: row.value, created: true });\n                    break;\n                }\n                case \"writeLane\": {\n                    if (lanes === undefined) return undefined;\n                    const write = edit.write;\n                    changes.push({ kind: \"lanes\", id: edit.key, rewrite: (row) => someOf(lanes.write(row, write)) });\n                    break;\n                }\n                case \"unqueue\": {\n                    const unqueue = decisions === undefined ? undefined : someOf(decisions.unqueue);\n                    if (unqueue === undefined) return undefined;\n                    const state = edit.state;\n                    // A queue no longer holding the key, as its session finds it, stays as it is.\n                    changes.push({ kind: \"decisions\", id: edit.key, rewrite: (row) => someOf(unqueue(row, state)) ?? row });\n                    break;\n                }\n                case \"requeue\": {\n                    const requeue = decisions === undefined ? undefined : someOf(decisions.requeue);\n                    if (requeue === undefined) return undefined;\n                    const { from, to } = edit;\n                    // A queue no longer holding the old key, as its session finds it, stays as it is.\n                    changes.push({ kind: \"decisions\", id: edit.key, rewrite: (row) => someOf(requeue(row, from, to)) ?? row });\n                    break;\n                }\n                case \"set\": {\n                    const kind = kindOf(payload, edit.sort);\n                    if (kind === undefined) return undefined;\n                    const sets = edit.sets;\n                    changes.push({ kind: edit.sort, id: edit.key, rewrite: (row) => someOf(kind.set(row, [...sets])) });\n                    break;\n                }\n                case \"row\":\n                    changes.push({ kind: edit.sort, id: edit.key, row: edit.row });\n                    break;\n                case \"copy\": {\n                    const kind = kindOf(payload, edit.sort);\n                    const from = kind === undefined ? undefined : rowNow(editing, read, kind, edit.sort, edit.from);\n                    if (kind === undefined || from === undefined) return undefined;\n                    let row = from;\n                    if (edit.order !== undefined) {\n                        const order = some(edit.order);\n                        const placed = edit.sort === \"states\" ? payload.states.write(row, { label: none, lane: none, order })\n                            : edit.sort === \"lanes\" && lanes !== undefined ? lanes.write(row, { label: none, order }) : some(row);\n                        if (placed.type !== \"some\") return undefined;\n                        row = placed.value;\n                    }\n                    changes.push({ kind: edit.sort, id: edit.key, row, ...(edit.replaces === true ? {} : { created: true as const }) });\n                    break;\n                }\n                case \"remove\":\n                    changes.push({ kind: edit.sort, id: edit.key, remove: true });\n                    break;\n            }\n        }\n        return changes;\n    }, []);\n    const record = useCallback((edits: readonly FlowchartEdit[], origin: Origin, label: string): boolean => {\n        if (latest.current.retained) return false;\n        const changes = changesOf(edits);\n        return changes !== undefined && changes.length > 0 && latest.current.schedule.record(changes, origin, label);\n    }, [changesOf]);\n    const taken = useCallback((sort: FlowchartSort, key: string): boolean => {\n        const { schedule: editing, held: read } = latest.current;\n        const session = editing.sessions.find((part) => stringEqual(part.kind, sort))?.session;\n        if (session?.entries.has(key) === true) return true;\n        const rows: ReadonlyMap<string, unknown> | undefined = read[sort];\n        return rows?.has(key) === true;\n    }, []);\n    const stands = useCallback((sort: FlowchartSort, key: string): boolean => {\n        const { schedule: editing, held: read } = latest.current;\n        const entry = editing.sessions.find((part) => stringEqual(part.kind, sort))?.session.entries.get(key);\n        if (entry !== undefined) return draftedRow(entry) !== undefined;\n        const rows: ReadonlyMap<string, unknown> | undefined = read[sort];\n        return rows?.has(key) === true;\n    }, []);\n    const mintTransition = useCallback((minted: ReadonlySet<string>): string => mintKey((key) => minted.has(key) || taken(\"transitions\", key)), [taken]);\n    const newKey = useCallback((sort: FlowchartSort, made: FlowchartEdit, madeUp: (held: (key: string) => boolean) => string,\n        minted: ReadonlySet<string> = NO_MINTED): FlowchartNewKey | undefined => {\n        const { value: payload, schedule: editing } = latest.current;\n        const kind = kindOf(payload, sort);\n        if (kind === undefined) return undefined;\n        const keys = kindKeys(kind.keyType);\n        const holds = (key: string): boolean => minted.has(key) || taken(sort, key);\n        // Built from the row the edit makes: refused where a row stands under it.\n        const build = builderOf(kind);\n        if (build !== undefined) {\n            const change = changesOf([made])?.[0];\n            const row = change !== undefined && \"row\" in change ? change.row : undefined;\n            if (row === undefined) return undefined;\n            let key: string;\n            try {\n                key = build(row);\n            } catch (err) {\n                console.error(`[Flowchart] ${kind.name}'s key could not be built from a new row:`, err);\n                return undefined;\n            }\n            return minted.has(key) || stands(sort, key) ? { taken: key } : { key };\n        }\n        if (keys.text) return { key: madeUp(holds) };\n        if (kind.keyType.type === \"Integer\") {\n            const key = editing.mint(sort, \"\", minted);\n            return key === undefined ? undefined : { key };\n        }\n        // A placeholder: a text made up that no key prints as, until the viewer types its key.\n        if (keys.typed) return { key: madeUp((key) => keys.isKey(key) || holds(key)) };\n        return { untyped: kind.keyType.type };\n    }, [changesOf, taken, stands]);\n    const moves = useCallback((edits: readonly FlowchartEdit[]): FlowchartMove[] => {\n        const { value: payload, schedule: editing, held: read } = latest.current;\n        const changes = changesOf(edits);\n        // A gesture touching no kind that builds its keys moves no row: its edits are never composed.\n        if (changes === undefined || !changes.some((change) => builderOf(kindOf(payload, change.kind as FlowchartSort)) !== undefined)) return [];\n        // Each row the gesture touches as it leaves it, the edits composed in order over the row as it finds it.\n        const at = (sort: string, key: string): string => `${sort}\\u0000${key}`;\n        const found = (sort: FlowchartSort, key: string): Uint8Array | undefined => {\n            const kind = kindOf(payload, sort);\n            return kind === undefined ? undefined : rowNow(editing, read, kind, sort, key);\n        };\n        const now = new Map<string, Uint8Array | undefined>();\n        const made = new Set<string>();\n        const touched: { sort: FlowchartSort; key: string }[] = [];\n        const seen = new Set<string>();\n        for (const change of changes) {\n            const sort = change.kind as FlowchartSort;\n            const id = at(sort, change.id);\n            if (!seen.has(id)) { seen.add(id); touched.push({ sort, key: change.id }); }\n            const was = now.has(id) ? now.get(id) : found(sort, change.id);\n            if (\"remove\" in change) now.set(id, undefined);\n            else if (\"row\" in change) {\n                now.set(id, change.row);\n                if (change.created === true) made.add(id);\n            } else if (\"rewrite\" in change && was !== undefined) {\n                try {\n                    now.set(id, change.rewrite(was) ?? was);\n                } catch {\n                    now.set(id, was);\n                }\n            }\n        }\n        const out: FlowchartMove[] = [];\n        for (const { sort, key } of touched) {\n            const id = at(sort, key);\n            const build = builderOf(kindOf(payload, sort));\n            const was = found(sort, key);\n            const after = now.get(id);\n            if (made.has(id) || build === undefined || was === undefined || after === undefined) continue;\n            try {\n                const to = build(after);\n                if (!stringEqual(build(was), to) && !stringEqual(key, to)) out.push({ sort, key, to });\n            } catch (err) {\n                console.error(`[Flowchart] ${kindOf(payload, sort)?.name ?? sort}'s key could not be built from ${key}'s row:`, err);\n            }\n        }\n        return out;\n    }, [changesOf]);\n    const builds = useCallback((sort: FlowchartSort): boolean => builderOf(kindOf(latest.current.value, sort)) !== undefined, []);\n    const untyped = useCallback((sort: FlowchartSort): string | undefined => {\n        const kind = kindOf(latest.current.value, sort);\n        if (kind === undefined || builderOf(kind) !== undefined) return undefined;\n        const keys = kindKeys(kind.keyType);\n        return keys.text || kind.keyType.type === \"Integer\" || keys.typed ? undefined : kind.keyType.type;\n    }, []);\n    const unqueues = getSomeorUndefined(value.decisions)?.unqueue.type === \"some\";\n    // An Integer order takes a whole number alone: its create gives none for another, over the type's defaults — never\n    // asking the app's values of a lane it refuses. A create that asks them and fails takes a fraction.\n    const wholeLaneOrders = useMemo(() => {\n        const lanes = getSomeorUndefined(value.lanes);\n        if (lanes === undefined) return false;\n        try {\n            return lanes.create({ label: none, order: some(0.5) }, none).type !== \"some\";\n        } catch {\n            return false;\n        }\n    }, [value]);\n\n    return useMemo(() => ({\n        schedule, history: schedule.history, edits: records.length > 0, drafts, landed, version: schedule.version, unqueues, wholeLaneOrders,\n        shown, editable, available, record, taken, stands, mintTransition, newKey, moves, builds, untyped,\n    }), [schedule, records.length, drafts, landed, unqueues, wholeLaneOrders, shown, editable, available, record, taken, stands, mintTransition, newKey, moves, builds, untyped]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Find state (#1504, `Flowchart Records Spec.md` R17): the toolbar's search\n * over the states — the shared key search's item (`useKeySearchToolbarItem`),\n * its box folding to its icon.\n *\n * - **States read through their source of the rail** are sought in their\n *   record through e3, as the Schematic's kinds are (`schematic/find.ts`):\n *   `recordSliceSeek` with no narrowing places the query's matches by key,\n *   `recordSlicePage` reads the rows a list shows by their place, each made\n *   its roles by the kind's `read`, and `recordSliceWithin` asks, in one\n *   request, which of them the rail's narrowing holds — so a state the\n *   narrowing hides is found by its key.\n * - **The states the canvas draws** are sought by key and by label: those a\n *   key's start, a quoted key or a range finds, and — for bare text — those\n *   whose label holds it, in any case. Beside a record sought through e3 they\n *   add what its matches leave out: a state found by its label alone, and a new\n *   one, which the record holds no row of yet.\n *\n * Keys are case-sensitive, as every builder's Search Records takes them, and\n * sought at the states' key type (#1549): a String key by its start, any other\n * as typed — `10` finds the state keyed by the number 10 — and the empty box\n * lists the first states only where they are keyed by String. The matches are\n * one list: the record's in its keys' order, then the drawn states' in theirs,\n * at their type. A line names a state by its key, its label where it has\n * one, and — where the narrowing leaves it out — which of the rail's choices\n * do, in the shared hidden pick's words (`shared/schedule/hidden.ts`), asked\n * of e3 for the rows a list shows, or, under `\"dim\"`, the words for a row\n * drawn as context. A pick hands the frame the state and what leaves it out\n * (`onPick`): the frame clears just those choices and selects the state once\n * it is drawn as itself. The box asks its query again as the record, its\n * narrowing or the drawn states move — a pick standing — and lists its lines\n * again as e3 says which choices leave a row out, or as the narrowing comes to\n * dim or to hide what it leaves out (`relist`).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { StringType, equalFor, match, none, printFor, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { RecordSliceWhereType, findKeyInline, type DatasetKeyMatchRange, type DatasetKeyQuery, type RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { useTrackedEvaluation, type KeySearchSource } from \"@elaraai/east-ui-components\";\nimport { awaitTracked, recordSlicePage, recordSliceRevision, recordSliceSeek, recordSliceWithin, toSeekQuery } from \"@elaraai/east-ui-components/internal\";\nimport { askHiding, hiddenLine, hiddenOf, useRelist, type RowHidden, type SourceHidden } from \"../shared/schedule/hidden.js\";\nimport { STRING_KEYS, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport type { RowCodec } from \"../shared/schedule/records.js\";\nimport type { HiddenWords } from \"../shared/schedule/words.js\";\nimport type { FlowchartMessages, FlowchartWords } from \"./messages.js\";\nimport type { FlowchartStateRoles } from \"./model.js\";\n\nconst keyEqual = equalFor(StringType);\nconst printWhere = printFor(RecordSliceWhereType);\n\n/** No narrowing: the record's own rows, in its order. */\nconst WHOLE: ValueTypeOf<typeof RecordSliceWhereType> = new Map();\n\n/** An empty box lists the first of the states. */\nconst BROWSE_QUERY: DatasetKeyQuery = { prefix: \"\" };\n\n/** An Option's value, or `undefined`. */\nconst someOf = <T,>(opt: option<T>): T | undefined => match(opt, { some: (value) => value }, undefined);\n\n/** A record Slice's part: the states' source of the rail. */\ntype RecordPart = ValueTypeOf<RecordSliceBindType>;\n\n/** An entry of a record's page, as every record Slice binding reads one: its key, at the record's key type, and its row, joined. */\ninterface RecordEntry {\n    readonly key: unknown;\n    readonly row: option<unknown>;\n}\n\n/** One state as Find seeks it among those the canvas draws: its key, its label, and whether it draws as context. */\nexport interface FindableState {\n    /** Its key. */\n    readonly key: string;\n    /** Its card's name; `undefined` for none. */\n    readonly label: string | undefined;\n    /** Whether the narrowing leaves it out, drawn as context (`\"dim\"`). */\n    readonly dimmed: boolean;\n}\n\n/** One state Find found. */\nexport interface FoundState {\n    /** Its key. */\n    readonly key: string;\n    /** Its card's name — the drafts in place, where the canvas draws it; `undefined` for none. */\n    readonly label: string | undefined;\n    /**\n     * What leaves it out on the rail — the states' source, and which of its choices e3 has said do (the shared hidden\n     * pick) — which a pick of it clears; `undefined` while the narrowing holds it.\n     */\n    readonly hidden: readonly RowHidden[] | undefined;\n}\n\n/**\n * The words a line names the choices that leave a state out in, where the narrowing draws what it leaves out as context\n * (`\"dim\"`): they dim it, never hide it.\n *\n * @param m - The Flowchart's message table\n * @returns Its dimmed words, as the shared hidden pick's line takes them\n */\nfunction dimmedWords(m: FlowchartMessages): HiddenWords {\n    return { hiddenByFilters: m.dimmedByFilters, hiddenBy: m.dimmedBy };\n}\n\n/**\n * How a found state reads in Find's list: its key, its label where it is not its key, and — where the narrowing leaves\n * it out — which of the rail's choices do (`hiddenLine`), or, under `\"dim\"`, which dim it.\n *\n * @param found - The state\n * @param words - The Flowchart's words\n * @param dim - Whether the narrowing draws what it leaves out as context (`\"dim\"`), rather than hiding it\n * @returns Its line\n */\nexport function foundLine(found: FoundState, words: FlowchartWords, dim: boolean): string {\n    const named = found.label === undefined || keyEqual(found.label, found.key) ? [found.key] : [found.key, found.label];\n    const hidden = found.hidden === undefined ? [] : [hiddenLine(found.hidden, words, dim ? dimmedWords(words.m) : words.m)];\n    return [...named, ...hidden].join(\" · \");\n}\n\n/**\n * The drawn states a query finds, in East's order of their keys at the states' key type (see the module docs): those its\n * key finds — a key's start, a quoted key, a range, as the server finds a key (`findKeyInline`) — but those `listed` says\n * the record's matches hold; and, for bare text, those whose label holds it, in any case.\n *\n * @param states - The states the canvas draws, in any order\n * @param query - The query the box parsed\n * @param locale - The app's locale, which a label and the text are compared in\n * @param listed - Whether the record's matches list a state its key finds: one the states' read holds, where the record is\n *   sought through e3; none where it is not\n * @param keys - The states' keys (#1549): each key's text read back once at their key type, and their order; String's by default\n * @returns The states found, in key order\n */\nexport function drawnMatches(states: readonly FindableState[], query: DatasetKeyQuery, locale: string,\n    listed: (key: string) => boolean, keys: KindKeys = STRING_KEYS): FindableState[] {\n    const byText = new Map(states.map((state) => [state.key, state] as const));\n    const order = keys.order(byText.keys());\n    const sorted = order.map(({ text }) => byText.get(text)!);\n    // The keys the query is sought among: a text no key prints as is found by its label alone.\n    const sought = order.filter(({ key }) => key !== undefined);\n    const range = findKeyInline(keys.keyType, sought.map(({ key }) => key), query);\n    const byKey = new Set(range.found ? sought.slice(range.row, range.row + range.count).map(({ text }) => text) : []);\n    // Bare text finds a label that holds it too.\n    const text = \"prefix\" in query && !(\"fields\" in query) ? query.prefix.toLocaleLowerCase(locale) : undefined;\n    return sorted.filter((state) => (byKey.has(state.key)\n        ? !listed(state.key)\n        : text !== undefined && text.length > 0 && state.label !== undefined && state.label.toLocaleLowerCase(locale).includes(text)));\n}\n\n/** What the last find found: the record's matches, from `start` in its own order — sought through e3 — then the drawn states'. */\ninterface Found {\n    /** The record's matches: the states' source, where they start, and how many; `undefined` for states read whole. */\n    readonly record: { readonly part: RecordPart; readonly start: number; readonly count: number } | undefined;\n    /** The drawn states' matches, in key order. */\n    readonly drawn: readonly FindableState[];\n}\n\n/** Nothing found. */\nconst NOTHING: Found = { record: undefined, drawn: [] };\n\n/** A state's label as a line names it: none for an empty one. */\nfunction labelOf(roles: FlowchartStateRoles): string | undefined {\n    return roles.label.length === 0 ? undefined : roles.label;\n}\n\n/** Props of {@link useFlowchartFind}. */\nexport interface FlowchartFindProps {\n    /** The states' source of the rail, whose record they are sought in through e3; `undefined` for states read whole. */\n    readonly part: RecordPart | undefined;\n    /** A stored state's roles, from its bytes and its key: the states' `read`. */\n    readonly read: (bytes: Uint8Array, key: string) => FlowchartStateRoles;\n    /** The states' rows, as bytes and back. */\n    readonly codec: RowCodec;\n    /** The states' keys (#1549): the key type the box parses typed text at, each key's text, and their order. */\n    readonly keys: KindKeys;\n    /** The states the canvas draws, the drafts in place — as themselves or as context — never a ghost. */\n    readonly drawn: readonly FindableState[];\n    /** The states the read holds, by key: a drawn state of one is listed among the record's matches, found by its key. */\n    readonly stored: ReadonlyMap<string, unknown>;\n    /** The states' hidden pick (`hidden-pick.tsx`' `HideSources`); `undefined` for states read whole. */\n    readonly pick: SourceHidden | undefined;\n    /** Whether the narrowing draws what it leaves out as context (`\"dim\"`): a line names the choices that dim a state. */\n    readonly dim: boolean;\n    /** The Flowchart's words. */\n    readonly words: FlowchartWords;\n    /** Told the state a pick lands on. */\n    readonly onPick: (found: FoundState) => void;\n}\n\n/**\n * Find state's source, for the shared key search's toolbar item (see the module docs).\n *\n * @param props - The states' source, their read, their keys, the drawn states, the hidden pick, whether the narrowing dims,\n *   the words and the pick\n * @returns The source; `undefined` with no state to seek — none drawn, and none sought through e3\n */\nexport function useFlowchartFind({ part, read, codec, keys, drawn, stored, pick, dim, words, onPick }: FlowchartFindProps): KeySearchSource | undefined {\n    // What a find reads, and whom a pick tells: the latest — the box calls what it captured before the find answered.\n    const latest = useRef({ part, read, codec, keys, drawn, stored, pick, dim, words, onPick });\n    useLayoutEffect(() => { latest.current = { part, read, codec, keys, drawn, stored, pick, dim, words, onPick }; });\n    // What the last find found; a find answered after a newer one asked finds nothing here.\n    const found = useRef<Found>(NOTHING);\n    const asked = useRef(0);\n    const find = useCallback(async (query: DatasetKeyQuery): Promise<DatasetKeyMatchRange> => {\n        const mine = ++asked.current;\n        const { part: source, keys: stateKeys, drawn: states, stored: held, words: w } = latest.current;\n        let record: Found[\"record\"];\n        if (source !== undefined) {\n            const range = await awaitTracked(() => recordSliceSeek(source, WHOLE, toSeekQuery(query)));\n            record = { part: source, start: range.found ? Number(range.row) : 0, count: range.found ? Number(range.count) : 0 };\n        }\n        const matches = drawnMatches(states, query, w.locale, (key) => source !== undefined && held.has(key), stateKeys);\n        if (mine === asked.current) found.current = { record, drawn: matches };\n        const count = (record?.count ?? 0) + matches.length;\n        return { found: count > 0, row: 0, count };\n    }, []);\n    /** The matches at the list's rows `[row, row + limit)`, each with the row it is at. */\n    const statesAt = useCallback(async (row: number, limit: number): Promise<{ at: number; state: FoundState }[]> => {\n        const { record, drawn: matches } = found.current;\n        const { read: readRoles, codec: rows, keys: stateKeys, drawn: states, pick: hidden } = latest.current;\n        const out: { at: number; state: FoundState }[] = [];\n        const inRecord = record?.count ?? 0;\n        if (record !== undefined && row < inRecord) {\n            const { part: source } = record;\n            const from = record.start + row;\n            const n = Math.min(limit, inRecord - row);\n            // Each entry by its key's text (#1549), the narrowing asked of it at its key.\n            const entries = await awaitTracked(() => recordSlicePage(source, { where: WHOLE, area: none }, BigInt(from), BigInt(n))) as readonly RecordEntry[];\n            const listed = entries.map((entry) => ({ key: stateKeys.textOf(entry.key), at: entry.key, row: someOf(entry.row) }));\n            const present = listed.flatMap(({ key, at, row: value }) => (value === undefined ? [] : [{ key, at, row: value }]));\n            const where = source.read().where;\n            const within = where.size === 0 ? undefined\n                : await awaitTracked(() => recordSliceWithin(source, where, present.map(({ at, row: value }) => ({ key: at, row: value }))));\n            // Whether the narrowing holds each row read; every entry of the page with it — one with no row asks nothing.\n            const held = present.map((_row, i) => within === undefined || within[i] === true);\n            let at = 0;\n            const holds = listed.map(({ row: value }) => (value === undefined ? true : held[at++]!));\n            if (within !== undefined && hidden !== undefined) hidden.rows.askListed(from, listed.map(({ key }) => key), holds);\n            // A state the canvas draws is named as it draws it, the drafts in place.\n            const labels = new Map(states.map((state) => [state.key, state.label] as const));\n            present.forEach(({ key, row: value }, i) => out.push({\n                at: row + i,\n                state: {\n                    key,\n                    label: labels.has(key) ? labels.get(key) : labelOf(readRoles(rows.encode(value), key)),\n                    hidden: held[i] || hidden === undefined ? undefined : hiddenOf([{ pick: hidden, id: key }]),\n                },\n            }));\n        }\n        const from = Math.max(row, inRecord) - inRecord;\n        const to = row + limit - inRecord;\n        if (to > from) {\n            const listed = matches.slice(from, to);\n            // A state drawn as context is left out by the narrowing: e3 is asked which choices dim it.\n            if (hidden !== undefined) askHiding(listed.filter((state) => state.dimmed).map((state) => ({ pick: hidden, id: state.key })), true);\n            listed.forEach((state, i) => out.push({\n                at: inRecord + from + i,\n                state: {\n                    key: state.key, label: state.label,\n                    hidden: state.dimmed && hidden !== undefined ? hiddenOf([{ pick: hidden, id: state.key }]) : undefined,\n                },\n            }));\n        }\n        return out;\n    }, []);\n    const listRange = useCallback(async (row: number, limit: number) => {\n        const { words: w, dim: dimmed } = latest.current;\n        // A pick shows the state's key in the box: what its query is typed against.\n        return (await statesAt(row, limit)).map(({ at, state }) => ({ row: at, label: foundLine(state, w, dimmed), text: state.key }));\n    }, [statesAt]);\n    const jump = useCallback((row: number) => {\n        void statesAt(row, 1).then(([hit]) => { if (hit !== undefined) latest.current.onPick(hit.state); })\n            .catch((error: unknown) => { console.error(\"[Flowchart] Find state could not read the state it found:\", error); });\n    }, [statesAt]);\n    const clear = useCallback(() => {\n        asked.current++;\n        found.current = NOTHING;\n    }, []);\n    // The box asks its query again as what its lines are read from moves: the states' record and its narrowing — read\n    // through the source, so a page landing moves none of it — and the states the canvas draws.\n    const readAnswers = useCallback(() => (part === undefined ? \"\"\n        : `${someOf(recordSliceRevision(part)) ?? \"\"}\\u0000${printWhere(part.read().where)}`), [part]);\n    const { result } = useTrackedEvaluation(readAnswers);\n    const answers = result.ok ? result.value : \"\";\n    const [requery, setRequery] = useState(0);\n    const seen = useRef({ answers, drawn });\n    useEffect(() => {\n        if (keyEqual(seen.current.answers, answers) && Object.is(seen.current.drawn, drawn)) return;\n        seen.current = { answers, drawn };\n        setRequery((n) => n + 1);\n    }, [answers, drawn]);\n    // It lists its lines again as e3 says which choices leave out a state they show, or the pick comes to ask — and as the\n    // narrowing comes to dim what it leaves out, or to hide it, which its lines word.\n    const relist = useRelist(pick === undefined ? [] : [pick], [dim]);\n    const noMatches = words.m.findNoMatches();\n    const any = part !== undefined || drawn.length > 0;\n    // Typed text parses at the states' key type; the empty box lists the first of them where a key's start finds them all.\n    const keyType = keys.keyType;\n    const browse = keys.text ? BROWSE_QUERY : undefined;\n    return useMemo(() => (any ? {\n        resetKey: \"flowchart\", requery, relist, keyType, find, listRange, jump, clear, browseQuery: browse, noMatchesText: noMatches,\n    } : undefined), [any, requery, relist, keyType, find, listRange, jump, clear, browse, noMatches]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's footer (#1502, #1503, `Flowchart Records Spec.md` R5, R12)\n * — today's counts, in its frame's footer: the transitions the flowchart\n * holds, and on the right their split, planned · observed · unresolved; where\n * the flowchart edits, the changes waiting on Save (`3 pending`); when its\n * records were last saved, the newest of their last saves; each Save's notice,\n * the rows it took out of a kind's narrowing (the shared\n * `RecordSliceSaveNotice`); and, after a card's ⏎ that is refused, why — a\n * polite live line, so a screen reader hears it too. What the narrowing draws\n * as context counts nowhere: the transitions counted are those drawn as\n * themselves, an in-place one among them though it folds into its state's\n * `↻ n`, and an unresolved one once, under unresolved.\n *\n * At its trailing end, in a slot of its own, the shared loading line (R5):\n * what is read now, in a kind's noun — `Loading states…`, or `Updating\n * states…` while a new narrowing is read and what the canvas drew stands in —\n * or why a read failed, with Retry; shown on the frame's one reveal clock (its\n * `LoadingReveal`), and fitted to the room the rail leaves it\n * (`useFooterFit`): its full text, its short form or its dot alone. The\n * refusal's line takes the rail's slack (`data-footer-slack`), cut short\n * before the split.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { Box, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { DateTimeType, StringType, compareFor, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { useTrackedEvaluation, type Formatters } from \"@elaraai/east-ui-components\";\nimport { LoadingLine, RecordSliceSaveNotice, useFooterFit, useRevealed, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport { authorOf } from \"../shared/records/author.js\";\nimport { kindOf } from \"./editing.js\";\nimport type { FlowchartWords } from \"./messages.js\";\nimport type { FlowchartValue, ModelCounts } from \"./model.js\";\nimport { FLOWCHART_SORTS, type FlowchartSort } from \"./read.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\nconst stringEqual = equalFor(StringType);\nconst compareInstant = compareFor(DateTimeType);\n\n/** A kind read through its source that writes: what its Save's notice counts the rows it took out of the narrowing in. */\nexport interface FlowchartNotice {\n    /** The kind. */\n    readonly sort: FlowchartSort;\n    /** Its source of the slice. */\n    readonly slice: ValueTypeOf<RecordSliceBindType>;\n    /** One of its rows, as a sentence names it — `state`. */\n    readonly singular: string;\n    /** Several. */\n    readonly plural: string;\n}\n\n/** Props of {@link FlowchartFooter}. */\nexport interface FlowchartFooterProps {\n    /** The `flowchart` recipe's styles. */\n    readonly styles: Styles;\n    /** What the flowchart holds, counted: its transitions, and their split. */\n    readonly counts: ModelCounts;\n    /** The changes waiting on Save; `undefined` where the flowchart edits nothing. */\n    readonly pending: number | undefined;\n    /** When the records were last saved, as the footer says it — the newest of their last saves; `undefined` with none. */\n    readonly saved: string | undefined;\n    /** Why a card's ⏎ was refused — `Drop onto a transition`; `undefined`, nothing to say. */\n    readonly message?: string | undefined;\n    /** The flowchart's words: its numbers print in the app's locale. */\n    readonly words: FlowchartWords;\n    /** Each kind read through its source that writes: its Save's notice. */\n    readonly notices: readonly FlowchartNotice[];\n    /** What the loading line says: a read in flight, or one that failed, with Retry; `undefined` while nothing is read. */\n    readonly line: LoadingLineValue | undefined;\n}\n\n/**\n * Renders the footer — see the module docs.\n *\n * @param props - The counts, the changes waiting, the last save, a refused ⏎'s reason, the Saves' notices and the\n *   loading line\n * @returns The footer\n */\nexport function FlowchartFooter({ styles, counts, pending, saved, message, words, notices, line }: FlowchartFooterProps) {\n    const m = words.m;\n    const rail = useRef<HTMLDivElement>(null);\n    const fit = useFooterFit(rail);\n    const shown = useRevealed() === true;\n    return (\n        <Box ref={rail} css={styles.footer} data-flowchart-footer=\"\">\n            <Box as=\"span\" css={styles.footerStrong}>{words.number(counts.transitions)}</Box>\n            <Box as=\"span\">{m.footerLinks({ n: counts.transitions })}</Box>\n            {message !== undefined && <Box as=\"span\">·</Box>}\n            {/* Always there, so a screen reader hears each line it takes. */}\n            <Box as=\"span\" css={styles.footerMessage} data-flowchart-message=\"\" data-footer-slack=\"\" aria-live=\"polite\">{message ?? \"\"}</Box>\n            {notices.map((notice) => <RecordSliceSaveNotice key={notice.sort} slice={notice.slice} singular={notice.singular} plural={notice.plural} />)}\n            <Box css={styles.footerSplit} data-flowchart-split=\"\">\n                {m.footerSplit({\n                    planned: words.number(counts.planned), observed: words.number(counts.observed),\n                    unresolved: counts.unresolved > 0 ? words.number(counts.unresolved) : undefined,\n                })}\n                {pending !== undefined && <Box as=\"span\" data-flowchart-pending=\"\">{` · ${m.footerPending({ n: pending, count: words.number(pending) })}`}</Box>}\n                {saved !== undefined && <Box as=\"span\" data-flowchart-saved=\"\">{` · ${m.footerSaved({ when: saved })}`}</Box>}\n            </Box>\n            <LoadingLine value={line} shown={shown} form={fit.form} />\n        </Box>\n    );\n}\n\n/** A record's last save (R15): when, as the footer and the inspector say it, and who made it. */\nexport interface FlowchartLastSave {\n    /** The record's kind. */\n    readonly sort: FlowchartSort;\n    /** The kind's name, as the payload gives it. */\n    readonly name: string;\n    /** When: its time when it was today, its date and time otherwise. */\n    readonly when: string;\n    /** When, as an instant: what tells the newest of them. */\n    readonly at: Date;\n    /** Who made it, where it names a person. */\n    readonly by: string | undefined;\n}\n\n/** The last saves of the records, each record's, and the newest of them. */\nexport interface FlowchartLastSaves {\n    /** Each record's last save, in the Flowchart's order of its kinds: one with no commit, or whose read fails, says nothing. */\n    readonly records: readonly FlowchartLastSave[];\n    /** The newest of them; `undefined` with none. */\n    readonly newest: FlowchartLastSave | undefined;\n}\n\n/** No record saved. */\nconst NONE_SAVED: FlowchartLastSaves = { records: [], newest: undefined };\n\n/**\n * When each of the Flowchart's records was last saved, and who saved it\n * (R15): its newest commit, read from its kind's `history` where its commits\n * are read — and again as the record commits — each its time when it was\n * today, its date and time otherwise, and the person it names. A kind bound\n * with `Data.bind` or `Data.bindPaged` alone has no history.\n *\n * @param value - The payload\n * @param words - The formatters the time prints with, in the app's locale\n * @returns Each record's last save, and the newest of them\n */\nexport function useLastSaves(value: FlowchartValue, words: Formatters): FlowchartLastSaves {\n    const read = useCallback(() => FLOWCHART_SORTS.flatMap((sort) => {\n        const kind = kindOf(value, sort);\n        if (kind === undefined || kind.history.type !== \"some\") return [];\n        try {\n            const commits = kind.history.value();\n            const newest = commits.type === \"some\" ? commits.value[0] : undefined;\n            return newest === undefined ? [] : [{ sort, name: kind.name, at: newest.at, actor: newest.actor }];\n        } catch {\n            return [];\n        }\n    }), [value]);\n    const { result } = useTrackedEvaluation(read);\n    const commits = result.ok ? result.value : undefined;\n    return useMemo(() => {\n        if (commits === undefined || commits.length === 0) return NONE_SAVED;\n        const today = words.date(new Date());\n        const records = commits.map((commit): FlowchartLastSave => ({\n            sort: commit.sort, name: commit.name, at: commit.at, by: authorOf(commit.actor),\n            when: stringEqual(words.date(commit.at), today) ? words.time(commit.at) : words.dateTime(commit.at),\n        }));\n        const newest = records.reduce((a, b) => (compareInstant(b.at, a.at) > 0 ? b : a));\n        return { records, newest };\n    }, [commits, words]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The inspector's reads (#1510, `Flowchart Records Spec.md` R33–R36, R41):\n * after a state's or a transition's head, the reads its kind shows there —\n * `show` `\"all\"` or `\"inspector\"` — in the details' order and in full, in the\n * `flowchartInspector` recipe's slots, which own every colour, size and type:\n * these set data attributes and geometry alone.\n *\n * - **Figures** side by side share the stats grid, each its value in the\n *   app's locale and its unit, as on a card, over its label — the figures\n *   next to one another in the details one grid.\n * - **Every other read** stands under its title, its total beside it: a tag\n *   list's count, a histogram's sum in its `counts`, a list's in its `unit`.\n * - **Tags**: every one, in the order their looks are defined, then the rest\n *   in the row's order, each 20 high in its look, wrapping.\n * - **A histogram** across the pane on the app's axis: a slot a bin, its bar\n *   as tall as its count over the row's tallest, 2 short of the next — or on\n *   a linear axis, too thin for that, flush with it and a pixel at least; the\n *   axis's ticks at the pane's width; and the caption — where half and nine in\n *   ten of its counts fall, or, for the bin under the pointer or focus, which\n *   darkens, its span, its count and its share. The bins are a list, one stop\n *   on the keyboard: the arrows, Home and End move between them.\n * - **A list**: its items by value, each its name and note, its value and its\n *   share over a track filled to it; the first 8, then Show n more, and Show\n *   fewer once open.\n *\n * A row there is none of says *no data* under Details, where the reads would\n * go; a read with nothing to show says *no data*, a tag list or a list with no\n * items *none*; until the row lands, the shared placeholder shapes stand where\n * its values go, its labels drawn.\n *\n * Over reads the rail's picks weigh (#1522, R46), one line names the picks in\n * the rail's words — *Service · Standard, Priority* — and a row holding none\n * of them says *no data* in those reads alone; while picks that moved are\n * read, those reads draw their placeholder (R44).\n *\n * @packageDocumentation\n */\n\nimport { useRef, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { Box, chakra, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FloatType, lessFor } from \"@elaraai/east\";\nimport { getSomeorUndefined, useContainerWidth } from \"@elaraai/east-ui-components\";\nimport { PlaceholderShape } from \"@elaraai/east-ui-components/internal\";\nimport {\n    barsOf, listLines, orderedTags, valueAt, waitsAt,\n    type FlowchartBinCounts, type FlowchartBins, type FlowchartDetailRowValue, type FlowchartKindDetails, type FlowchartReadValue, type FlowchartRowDetails,\n} from \"./details.js\";\nimport { FlowchartTag, barAcross, ticksOf } from \"./details-card.js\";\nimport { tagLookOf } from \"./details-draw.js\";\nimport { PANE_TICK_CHAR, axisTicks, binText, marksText, shareText } from \"./details-words.js\";\nimport type { FlowchartWords } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\ntype HistogramRead = Extract<FlowchartReadValue, { type: \"histogram\" }>[\"value\"];\ntype ListRead = Extract<FlowchartReadValue, { type: \"list\" }>[\"value\"];\ntype ListValue = Extract<FlowchartDetailRowValue[number], { type: \"list\" }>[\"value\"];\n\nconst lessFloat = lessFor(FloatType);\n\n/** A bar in the pane at most, inside the bars' 1px rule: the visual spec's 63. */\nconst PANE_BAR_MOST = 63;\n/** A bar that counts anything, at least. */\nconst PANE_BAR_LEAST = 1.5;\n/** The histogram's width until it is measured: the 320 pane's, inside its 16 of padding. */\nconst PANE_AXIS_W = 288;\n/** A list's items before Show n more (R36). */\nconst LIST_FIRST = 8;\n\n/** A share as a CSS length across its box. */\nconst across = (share: number): string => `${share * 100}%`;\n\n/**\n * A bar's height in the pane: as tall as its count over the row's tallest, a\n * pixel and a half at least where it counts anything.\n *\n * @param height - Its height, the tallest 1\n * @param count - What it counts\n * @returns Its height, in px\n */\nexport function paneBarHeight(height: number, count: number): number {\n    return lessFloat(0, count) ? Math.max(PANE_BAR_LEAST, height * PANE_BAR_MOST) : 0;\n}\n\n/** Props of {@link FlowchartPaneReads}. */\nexport interface FlowchartPaneReadsProps {\n    /** The `flowchartInspector` recipe's slots. */\n    readonly styles: Styles;\n    /** The kind's details; `undefined` for a kind with none. */\n    readonly kind: FlowchartKindDetails | undefined;\n    /** The row's key. */\n    readonly at: string;\n    /** The flowchart's words. */\n    readonly words: FlowchartWords;\n}\n\n/**\n * The reads the inspector shows of a row (see the module docs), after its\n * head; nothing where its kind shows none there.\n *\n * @param props - The recipe's slots, the kind's details, the row's key, and the words\n * @returns The reads\n */\nexport function FlowchartPaneReads({ styles, kind, at, words }: FlowchartPaneReadsProps) {\n    if (kind === undefined) return null;\n    const shown = kind.reads.flatMap((entry, index) => (entry.show.type === \"canvas\" ? [] : [index]));\n    if (shown.length === 0) return null;\n    const m = words.m;\n    const row = kind.rows.get(at);\n    if (row === null) {\n        return (\n            <Box css={styles.reads} data-inspector-reads=\"\" data-reads=\"none\">\n                <Box css={styles.read}>\n                    <Box css={styles.readHead}><Box as=\"span\" css={styles.readTitle}>{m.detailsTitle()}</Box></Box>\n                    <Box as=\"span\" css={styles.noData} data-read-empty=\"\">{m.detailsNoData()}</Box>\n                </Box>\n            </Box>\n        );\n    }\n    // The figures next to one another one stats grid, every other read under its title.\n    const parts: ReactNode[] = [];\n    let run: number[] = [];\n    const flush = (): void => {\n        if (run.length === 0) return;\n        parts.push(<Stats key={`stats:${run[0]}`} styles={styles} kind={kind} row={row} reads={run} words={words} />);\n        run = [];\n    };\n    for (const index of shown) {\n        if (kind.reads[index]!.read.type === \"figure\") {\n            run.push(index);\n            continue;\n        }\n        flush();\n        parts.push(<PaneRead key={index} styles={styles} kind={kind} row={row} index={index} words={words} />);\n    }\n    flush();\n    const weighed = kind.weighedBy;\n    return (\n        <Box css={styles.reads} data-inspector-reads=\"\" data-reads={row === undefined ? \"landing\" : \"landed\"}>\n            {weighed !== undefined && <Box css={styles.readsWeighed} data-read-weighed=\"\">{m.detailsWeighed(weighed)}</Box>}\n            {parts}\n        </Box>\n    );\n}\n\n/** Figures next to one another in the details, side by side in the stats grid: each its value and its unit over its label. */\nfunction Stats({ styles, kind, row, reads, words }: {\n    styles: Styles; kind: FlowchartKindDetails; row: FlowchartRowDetails | undefined; reads: readonly number[]; words: FlowchartWords;\n}) {\n    return (\n        <Box css={styles.readStats} data-read-stats=\"\">\n            {reads.map((index) => {\n                const read = kind.reads[index]!.read;\n                const unit = read.type === \"figure\" ? getSomeorUndefined(read.value.unit) : undefined;\n                const at = row === undefined ? undefined : valueAt(row, index);\n                const value = at?.type === \"figure\" ? getSomeorUndefined(at.value) : undefined;\n                return (\n                    <Box key={index} css={styles.readStat} data-pane-read={index} data-read=\"figure\">\n                        {waitsAt(row, index) ? (\n                            <Box css={styles.placeholder} data-place=\"stat\"><PlaceholderShape kind=\"number\" index={index} /></Box>\n                        ) : value === undefined ? (\n                            <Box as=\"span\" css={styles.noData} data-read-empty=\"\">{words.m.detailsNoData()}</Box>\n                        ) : (\n                            <Box as=\"span\" css={styles.readStatLine} data-read-figure=\"\">\n                                <Box as=\"span\" css={styles.readStatValue} data-read-value=\"\">{words.number(value)}</Box>\n                                {unit !== undefined && <Box as=\"span\" css={styles.readStatUnit} data-read-unit=\"\">{unit}</Box>}\n                            </Box>\n                        )}\n                        <Box as=\"span\" css={styles.readStatLabel} data-read-label=\"\">{read.value.label}</Box>\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n}\n\n/** A read's title, and its total beside it once its row lands. */\nfunction ReadHead({ styles, title, total }: { styles: Styles; title: string; total: string | undefined }) {\n    return (\n        <Box css={styles.readHead}>\n            <Box as=\"span\" css={styles.readTitle} data-read-label=\"\">{title}</Box>\n            {total !== undefined && <Box as=\"span\" css={styles.readTotal} data-read-total=\"\">{total}</Box>}\n        </Box>\n    );\n}\n\n/** A read other than a figure, under its title. */\nfunction PaneRead({ styles, kind, row, index, words }: {\n    styles: Styles; kind: FlowchartKindDetails; row: FlowchartRowDetails | undefined; index: number; words: FlowchartWords;\n}) {\n    const m = words.m;\n    const read = kind.reads[index]!.read;\n    const at = row === undefined ? undefined : valueAt(row, index);\n    const waits = waitsAt(row, index);\n    const empty = (text: string) => <Box as=\"span\" css={styles.noData} data-read-empty=\"\">{text}</Box>;\n    switch (read.type) {\n        case \"figure\":\n            return null;\n        case \"tags\": {\n            const tags = at?.type === \"tags\" ? orderedTags(read.value.colors, at.value) : undefined;\n            return (\n                <Box css={styles.read} data-pane-read={index} data-read=\"tags\">\n                    <ReadHead styles={styles} title={read.value.label} total={tags === undefined ? undefined : words.number(tags.length)} />\n                    {waits ? (\n                        <Box css={styles.placeholder} data-place=\"tags\"><PlaceholderShape kind=\"chip\" index={index} /></Box>\n                    ) : tags === undefined ? empty(m.detailsNoData())\n                        : tags.length === 0 ? empty(m.detailsNone()) : (\n                            <Box css={styles.readTags} data-read-tags=\"\">\n                                {tags.map((tag) => <FlowchartTag key={tag} css={styles.tag} text={tag} look={tagLookOf(read.value.colors, tag)} />)}\n                            </Box>\n                        )}\n                </Box>\n            );\n        }\n        case \"histogram\": {\n            const counts = row?.counts[index];\n            const noun = getSomeorUndefined(read.value.counts);\n            const bins = kind.bins[index];\n            const counted = bins !== undefined && counts !== undefined && lessFloat(0, counts.total);\n            return (\n                <Box css={styles.read} data-pane-read={index} data-read=\"histogram\">\n                    <ReadHead styles={styles} title={read.value.label}\n                        total={counts === undefined ? undefined : m.detailsCount({ count: words.number(counts.total), noun })} />\n                    {waits ? (\n                        <Box css={styles.placeholder} data-place=\"bars\"><PlaceholderShape kind=\"fill\" index={index} /></Box>\n                    ) : !counted ? empty(m.detailsNoData()) : (\n                        <PaneHistogram styles={styles} read={read.value} bins={bins} counts={counts} words={words} />\n                    )}\n                </Box>\n            );\n        }\n        case \"list\": {\n            const items = at?.type === \"list\" ? at.value : undefined;\n            return (\n                <Box css={styles.read} data-pane-read={index} data-read=\"list\">\n                    <ReadHead styles={styles} title={read.value.label} total={items === undefined ? undefined : listTotal(read.value, items, words)} />\n                    {waits ? (\n                        <Box css={styles.placeholder} data-place=\"row\"><PlaceholderShape kind=\"text\" index={index} /></Box>\n                    ) : items === undefined ? empty(m.detailsNoData())\n                        : items.length === 0 ? empty(m.detailsNone()) : <PaneList styles={styles} items={items} words={words} />}\n                </Box>\n            );\n        }\n    }\n}\n\n/** A list's total, in its unit: what its values count, together — a value that counts nothing left out. */\nfunction listTotal(read: ListRead, items: ListValue, words: FlowchartWords): string {\n    const total = items.reduce((sum, item) => sum + (Number.isFinite(item.value) && !lessFloat(item.value, 0) ? item.value : 0), 0);\n    return words.m.detailsCount({ count: words.number(total), noun: getSomeorUndefined(read.unit) });\n}\n\n/** A histogram across the pane: its bins, the axis, and its caption. */\nfunction PaneHistogram({ styles, read, bins, counts, words }: {\n    styles: Styles; read: HistogramRead; bins: FlowchartBins; counts: FlowchartBinCounts; words: FlowchartWords;\n}) {\n    const m = words.m;\n    const box = useRef<HTMLDivElement | null>(null);\n    const slots = useRef<(HTMLElement | null)[]>([]);\n    const measured = useContainerWidth(box);\n    const width = measured > 0 ? measured : PANE_AXIS_W;\n    const [hovered, setHovered] = useState<number | undefined>(undefined);\n    const [focused, setFocused] = useState<number | undefined>(undefined);\n    // The keyboard's one stop: the bin it last rested on.\n    const [stop, setStop] = useState(0);\n    const unit = read.unit.type;\n    const noun = getSomeorUndefined(read.counts);\n    const bars = barsOf(bins, counts.counts);\n    const caption = (bin: number): string => m.detailsBinCaption({\n        bin: binText(bins.edges, bin, unit, words),\n        count: m.detailsCount({ count: words.number(counts.counts[bin] ?? 0), noun }),\n        share: shareText(lessFloat(0, counts.total) ? (counts.counts[bin] ?? 0) / counts.total : 0, words),\n    });\n    const active = hovered ?? focused;\n    const onKey = (event: KeyboardEvent<HTMLElement>, bin: number): void => {\n        const last = bars.length - 1;\n        const next = event.key === \"ArrowRight\" || event.key === \"ArrowDown\" ? Math.min(last, bin + 1)\n            : event.key === \"ArrowLeft\" || event.key === \"ArrowUp\" ? Math.max(0, bin - 1)\n                : event.key === \"Home\" ? 0\n                    : event.key === \"End\" ? last : undefined;\n        if (next === undefined) return;\n        event.preventDefault();\n        setStop(next);\n        slots.current[next]?.focus();\n    };\n    return (\n        <Box css={styles.histogram} data-pane-histogram=\"\">\n            <Box ref={box} css={styles.bars} role=\"list\" aria-label={read.label} data-pane-bars=\"\">\n                {bars.map((bar, b) => {\n                    const at = barAcross(bins, bar, width);\n                    return (\n                        <Box key={b} as=\"span\" ref={(el: HTMLElement | null) => { slots.current[b] = el; }} css={styles.binSlot} role=\"listitem\"\n                            tabIndex={b === stop ? 0 : -1} aria-label={caption(b)} data-bin={b} data-flush={at.flush ? \"\" : undefined} data-active={active === b ? \"\" : undefined}\n                            style={{ left: at.left, width: at.width, minWidth: at.minWidth }}\n                            onPointerEnter={() => setHovered(b)} onPointerLeave={() => setHovered(undefined)}\n                            onFocus={() => { setStop(b); setFocused(b); }} onBlur={() => setFocused(undefined)} onKeyDown={(event: KeyboardEvent<HTMLElement>) => onKey(event, b)}>\n                            <Box as=\"span\" css={styles.bin} style={{ height: paneBarHeight(bar.height, bar.count) }} />\n                        </Box>\n                    );\n                })}\n            </Box>\n            <Box css={styles.axis} aria-hidden=\"true\" data-pane-axis=\"\">\n                {axisTicks(bins, unit, ticksOf(read.ticks), width, PANE_TICK_CHAR, words).map((tick) => (\n                    <Box as=\"span\" key={tick.text} css={styles.tick} data-tick=\"\" style={tick.end ? { right: 0 } : { left: tick.x }}>{tick.text}</Box>\n                ))}\n            </Box>\n            <Box css={styles.caption} data-pane-caption=\"\">\n                {active === undefined ? marksText(bins.edges, counts.counts, unit, words) : caption(active)}\n            </Box>\n        </Box>\n    );\n}\n\n/** A list's items by value: the first 8, then Show n more — and Show fewer once open. */\nfunction PaneList({ styles, items, words }: { styles: Styles; items: ListValue; words: FlowchartWords }) {\n    const [open, setOpen] = useState(false);\n    const lines = listLines(items, Number.POSITIVE_INFINITY);\n    const rest = lines.length - LIST_FIRST;\n    const drawn = open || rest <= 0 ? lines : lines.slice(0, LIST_FIRST);\n    return (\n        <>\n            <Box css={styles.listRows} data-pane-list=\"\">\n                {drawn.map((line, i) => (\n                    <Box key={i} css={styles.listRow} data-list-row={i}>\n                        <Box as=\"span\" css={styles.listNameLine}>\n                            <Box as=\"span\" css={styles.listName} title={line.name}>{line.name}</Box>\n                            {line.note !== undefined && <Box as=\"span\" css={styles.listNote}>{line.note}</Box>}\n                        </Box>\n                        <Box as=\"span\" css={styles.listValue}>{words.number(line.value)}</Box>\n                        <Box as=\"span\" css={styles.listShare}>{shareText(line.share, words)}</Box>\n                        <Box as=\"span\" css={styles.listTrack} aria-hidden=\"true\"><Box as=\"span\" css={styles.listFill} style={{ width: across(line.share) }} /></Box>\n                    </Box>\n                ))}\n            </Box>\n            {rest > 0 && (\n                <chakra.button type=\"button\" css={styles.showMore} aria-expanded={open} data-pane-more=\"\" onClick={() => setOpen((was) => !was)}>\n                    {words.m.detailsShowMore({ n: rest, count: words.number(rest), open })}\n                </chakra.button>\n            )}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A new row's key as the viewer types it in the Flowchart's and the\n * Schematic's inspectors (#1549, #1581). A key of one part — a String, a\n * number, a date, a case holding nothing — is taken as it is typed. A key of\n * several — a struct's fields, a variant's case and its value — is typed a part\n * at a time into a draft the form shows, and taken whole when the viewer sets\n * it ({@link KeySetButton}), checked once then: no key with a part still at its\n * default is ever the row's, so one another row holds never refuses a part, and\n * the row waits under its placeholder, holding Save, until the key is set.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useState } from \"react\";\nimport { chakra, useRecipe } from \"@chakra-ui/react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { keyEdited, type KindKeys } from \"./kind-keys.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** A new row's key as the viewer types it: see the module docs. */\nexport interface KeyDraft {\n    /** The key as the form shows it, under `key`: the draft typed so far, else the row's — `undefined` for a placeholder. */\n    readonly value: unknown;\n    /** Whether the key has several parts: typed into the draft, and set whole. */\n    readonly parts: boolean;\n    /** Whether the draft holds a key other than the row's: what Set takes. */\n    readonly typed: boolean;\n    /**\n     * A part of the key edited in the form: the key taken at once, for a key of one part; else the draft.\n     *\n     * @param path - The edited spec's path, from `key` down\n     * @param next - Its new value\n     * @returns Why a key of one part was refused, where the inspector says: what the form says under its field\n     */\n    readonly onChange: (path: readonly string[], next: unknown) => string | void;\n    /** Takes the draft whole: refused, the draft stays to be changed. */\n    readonly set: () => void;\n}\n\n/**\n * A new row's key as the viewer types it (see the module docs).\n *\n * @param keys - The row's kind's keys\n * @param at - The row's key's text: a placeholder's until its key is set\n * @param take - Takes a key, by its text: the row under it, or refused, saying why — the words handed back where it does\n * @returns The key as the form shows it, and how it is typed and set\n */\nexport function useKeyDraft(keys: KindKeys, at: string, take: (key: string) => string | void): KeyDraft {\n    const [draft, setDraft] = useState<{ readonly key: unknown } | undefined>(undefined);\n    const held = useMemo(() => keys.keyOf(at), [keys, at]);\n    const parts = keys.specs.length > 1;\n    const onChange = useCallback((path: readonly string[], next: unknown): string | void => {\n        if (!parts) return take(keys.textOf(keyEdited(keys, held, path, next)));\n        setDraft((was) => ({ key: keyEdited(keys, was === undefined ? held : was.key, path, next) }));\n    }, [parts, keys, held, take]);\n    const text = draft === undefined ? undefined : keys.textOf(draft.key);\n    const typed = text !== undefined && !stringEqual(text, at);\n    const set = useCallback(() => {\n        if (text !== undefined && typed) take(text);\n    }, [text, typed, take]);\n    return { value: draft === undefined ? held : draft.key, parts, typed, onChange, set };\n}\n\n/**\n * A key of several parts' Set: takes the draft whole — off while it holds the row's key.\n *\n * @param props - The draft, and the button's words\n * @returns The button\n */\nexport function KeySetButton({ draft, label }: { readonly draft: KeyDraft; readonly label: string }) {\n    const button = useRecipe({ key: \"button\" });\n    return (\n        <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={!draft.typed} data-inspector-key-set=\"\" onClick={draft.set}>\n            {label}\n        </chakra.button>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's model (#1502, `Flowchart Records Spec.md` R6, R7, D4, D12) —\n * pure and React-free: what the canvas, the inspector, Issues and the footer\n * draw from, made from the four records' rows with the drafts in place.\n *\n * - **The lanes** stand in their `order`, else by key (D4). A state whose lane\n *   names no lane stands in a last band, *No lane* (D12); with no lanes given,\n *   one band holds every state.\n * - **Each lane's states** stand in their `order`, else by key: the order e3\n *   returns a record in, kept under every index the rail picks, though a page\n *   of a source comes in its index's order (R7).\n * - **By key** is at the kind's record's key type (#1549): Integer keys stand\n *   `2`, `9`, `10`, never as their text would, each text read back once\n *   (`kind-keys.ts`).\n * - **An end no state is keyed by** is a ghost, *No state row*, beside its\n *   other end's lane, and its transition's line is unresolved. A transition\n *   from a state to itself folds into the state's `↻ n`.\n * - **A row the narrowing leaves out**, under `\"dim\"`, draws faded: `dimmed`,\n *   selected by no path and counted nowhere (R6).\n *\n * Stroke weights, the evidence badge and the planned · observed · unresolved\n * split are derived, never authored.\n *\n * @packageDocumentation\n */\n\nimport { FloatType, OptionType, StringType, compareFor, equalFor, none, some, variant, type EastTypeValue, type ValueTypeOf } from \"@elaraai/east\";\nimport type { Flowchart } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, type Formatters, type TickFormatOpt } from \"@elaraai/east-ui-components\";\nimport { STRING_KEYS, kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport type { FlowchartWords } from \"./messages.js\";\n\n/** The decoded Flowchart payload — what `<Flowchart>` hands the renderer. */\nexport type FlowchartValue = ValueTypeOf<typeof Flowchart.Types.Payload>;\n\n/** The decoded canvas: what the flowchart draws with besides its kinds. */\nexport type FlowchartCanvasValue = ValueTypeOf<typeof Flowchart.Types.Canvas>;\n\n/** A state's roles, as its kind reads them from the app's row. */\nexport type FlowchartStateRoles = ValueTypeOf<typeof Flowchart.Types.StateRoles>;\n/** A transition's roles. */\nexport type FlowchartTransitionRoles = ValueTypeOf<typeof Flowchart.Types.TransitionRoles>;\n/** A lane's roles. */\nexport type FlowchartLaneRoles = ValueTypeOf<typeof Flowchart.Types.LaneRoles>;\n/** A decision's roles. */\nexport type FlowchartDecisionRoles = ValueTypeOf<typeof Flowchart.Types.DecisionRoles>;\n/** A transition's evidence, decoded. */\nexport type FlowchartEvidenceValue = ValueTypeOf<typeof Flowchart.Types.Evidence>;\n\n/** One row of a record as the model takes it: its key, its roles and whether the narrowing leaves it out, drawn as context. */\nexport interface FlowchartRow<R> {\n    /** Its key in its record. */\n    readonly key: string;\n    /** Its roles, as its kind reads them — its draft's, where it has one. */\n    readonly roles: R;\n    /** Whether the narrowing leaves it out, under `\"dim\"`: drawn faded, selected by no path. */\n    readonly dimmed: boolean;\n}\n\n/** Each kind's keys (#1549): each key's text, read back at its record's key type, and the keys' order by it. */\nexport interface FlowchartKindKeys {\n    /** The states'. */\n    readonly states: KindKeys;\n    /** The transitions'. */\n    readonly transitions: KindKeys;\n    /** The lanes'. */\n    readonly lanes: KindKeys;\n    /** The decisions'. */\n    readonly decisions: KindKeys;\n}\n\n/** Every kind's keys, each record keyed by String. */\nexport const STRING_KIND_KEYS: FlowchartKindKeys = { states: STRING_KEYS, transitions: STRING_KEYS, lanes: STRING_KEYS, decisions: STRING_KEYS };\n\n/**\n * Each of a Flowchart's kinds' keys, as its payload says each record is keyed (#1549).\n *\n * @param value - The payload\n * @returns Each kind's keys: a kind the Flowchart is not given, by String\n */\nexport function flowchartKindKeys(value: FlowchartValue): FlowchartKindKeys {\n    const of = (kind: { readonly keyType: EastTypeValue } | undefined): KindKeys => (kind === undefined ? STRING_KEYS : kindKeys(kind.keyType));\n    return {\n        states: of(value.states), transitions: of(getSomeorUndefined(value.transitions)), lanes: of(getSomeorUndefined(value.lanes)),\n        decisions: of(getSomeorUndefined(value.decisions)),\n    };\n}\n\n/** The four records' rows, the drafts in place: what the model is made from. */\nexport interface FlowchartRows {\n    /** The states. */\n    readonly states: readonly FlowchartRow<FlowchartStateRoles>[];\n    /** The transitions; none for a flowchart given none. */\n    readonly transitions: readonly FlowchartRow<FlowchartTransitionRoles>[];\n    /** The lanes; `undefined` for a flowchart given none, whose one band holds every state. */\n    readonly lanes: readonly FlowchartRow<FlowchartLaneRoles>[] | undefined;\n    /** The decisions; none for a flowchart given none. */\n    readonly decisions: readonly FlowchartRow<FlowchartDecisionRoles>[];\n    /** Each kind's keys: what each kind's rows are ordered by, by key. */\n    readonly keys: FlowchartKindKeys;\n}\n\n/** Spec line classes (unresolved is derived, never authored). */\nexport type LinkClass = \"planned\" | \"observed\" | \"unresolved\";\n\n/** One node in the view model — a state, or a ghost standing for an end no state is keyed by. */\nexport interface ModelNode {\n    /** Its key: the state's, or the end's a ghost stands for. */\n    readonly key: string;\n    /** Its card's name; `undefined` for an empty label. */\n    readonly label: string | undefined;\n    /** Its band's place among the model's lanes. */\n    readonly laneIndex: number;\n    /** Its place in its band, from the first. */\n    readonly laneOrder: number;\n    /** The lane its row names, by key; `undefined` for none. */\n    readonly lane: string | undefined;\n    /** Its place in its lane, as its `order` gives it; `undefined` for a kind with no `order`. */\n    readonly order: number | undefined;\n    /** State-class member count (the ×N badge). */\n    readonly members: bigint | undefined;\n    /**\n     * In-place transitions (self-loops) drawn as themselves, by key, in key\n     * order — the `↻ n` badge, their selection surface: they have no route to\n     * click. One the narrowing leaves out draws nowhere.\n     */\n    readonly inPlaceKeys: string[];\n    /** True for the derived \"No state row\" ghost. */\n    readonly ghost: boolean;\n    /** Whether the narrowing leaves it out, drawn faded (R6); a ghost is, when every transition naming it is. */\n    readonly dimmed: boolean;\n}\n\n/** One routed transition in the view model (in-place ones fold into their state's `↻ n` badge). */\nexport interface ModelLink {\n    /** Its key in its record: never drawn — a transition is named by its ends. */\n    readonly key: string;\n    /** The state it leaves. */\n    readonly from: string;\n    /** The state it enters. */\n    readonly to: string;\n    /** How its line draws. */\n    readonly cls: LinkClass;\n    /** The decision it names, by key — the lettered diamond, drawn while the decisions hold it. */\n    readonly trigger: string | undefined;\n    /** Its evidence. */\n    readonly evidence: FlowchartEvidenceValue | undefined;\n    /** Stroke weight from evidence volume — log scale 1.6 / 2 / 2.5, floor 1.4. */\n    readonly weight: number;\n    /** Pre-formatted evidence badge (\"17,350 parcels · 386\"); undefined ⇒ no badge. */\n    readonly badgeText: string | undefined;\n    /** Whether the narrowing leaves it out, drawn faded (R6). */\n    readonly dimmed: boolean;\n}\n\n/** A band of the canvas: a lane of the app's, the last band of states naming no lane, or the one band of a flowchart given no lanes. */\nexport type ModelBand = \"lane\" | \"noLane\" | \"all\";\n\n/** One band of the canvas. */\nexport interface ModelLane {\n    /** Its key: the lane's; {@link NO_LANE_KEY} or {@link ALL_LANE_KEY} for a band of no lane. */\n    readonly key: string;\n    /** Its header. */\n    readonly label: string;\n    /** Its place among the lanes, as its `order` gives it; `undefined` for a band of no lane, or a kind with no `order`. */\n    readonly order: number | undefined;\n    /** What the band is: only a lane of the app's takes a gesture of its own — a rename, its ×, \"+ STATE\". */\n    readonly band: ModelBand;\n}\n\n/** One decision in the view model. */\nexport interface ModelTrigger {\n    /** Its key. */\n    readonly key: string;\n    /** Its name. */\n    readonly label: string;\n    /** Its diamond's letter. */\n    readonly letter: string;\n    /** Who owns it. */\n    readonly owner: string | undefined;\n    /** The states queued at it, by key. */\n    readonly queue: ReadonlyArray<string>;\n    /** Its outcomes' summary line. */\n    readonly outcomes: string | undefined;\n    /** The routed transitions it governs, by key. */\n    readonly governs: ReadonlyArray<string>;\n}\n\n/** What the flowchart holds, counted: what the narrowing leaves out counts nowhere. */\nexport interface ModelCounts {\n    /** Its routed transitions. */\n    readonly total: number;\n    /** Of them, planned. */\n    readonly planned: number;\n    /** Of them, observed. */\n    readonly observed: number;\n    /** Of them, with an end no state is keyed by. */\n    readonly unresolved: number;\n    /** Its lanes. */\n    readonly lanes: number;\n    /** Its states. */\n    readonly states: number;\n    /** Its transitions, in-place ones among them. */\n    readonly transitions: number;\n    /** Its decisions. */\n    readonly decisions: number;\n}\n\n/** The view model. */\nexport interface FlowchartModel {\n    /** The bands, in their order: the lanes, then *No lane* when a state names no lane; one band with no lanes given. */\n    readonly lanes: ReadonlyArray<ModelLane>;\n    /** The states in their order — by `order`, else by key — then the ghosts: each knows its band, and its place in it. */\n    readonly nodes: ReadonlyArray<ModelNode>;\n    /** The nodes, by key. */\n    readonly nodesByKey: ReadonlyMap<string, ModelNode>;\n    /** The routed transitions, in key order. */\n    readonly links: ReadonlyArray<ModelLink>;\n    /** The decisions, by key. */\n    readonly triggers: ReadonlyMap<string, ModelTrigger>;\n    /** What it holds, counted. */\n    readonly counts: ModelCounts;\n    /** It holds no lane, no state and no transition: there is nothing to draw. */\n    readonly blank: boolean;\n    /** How many states each lane holds, by its key — every state the flowchart holds naming it: a lane holding states is not deleted (R8). */\n    readonly laneStates: ReadonlyMap<string, number>;\n    /** No lanes are given: `lanes` is one band holding every state, which no gesture renames or deletes. */\n    readonly standIn: boolean;\n    /** The states naming no lane the flowchart holds, by key, in their band's order: they stand in *No lane*, and Issues lists each (D12). */\n    readonly noLane: ReadonlyArray<string>;\n    /** Whether the states carry an `order`: a move within a lane, and a drop between two cards, write the middle of theirs (D4). */\n    readonly ordered: boolean;\n    /** Each kind's keys, as the rows gave them: what every list of a kind's rows orders them by, by key (#1549). */\n    readonly keys: FlowchartKindKeys;\n}\n\n/** The key of the last band, *No lane*: a key no lane of the app's is given — an East String holds no lone NUL as a key's text. */\nexport const NO_LANE_KEY = \"\\u0000no-lane\";\n\n/** The key of the one band of a flowchart given no lanes. */\nexport const ALL_LANE_KEY = \"\";\n\nconst keyEqual = equalFor(StringType);\nconst compareFloat = compareFor(FloatType);\n\n/**\n * Stroke weight from evidence volume — the spec's log ladder:\n * 1.6 / 2 / 2.5 px, floor 1.4 for links without volume. Normalised\n * min→max in log space so the observed range spreads across the tiers.\n *\n * @param volume - The transition's volume\n * @param minVolume - The smallest volume drawn\n * @param maxVolume - The largest volume drawn\n * @returns The stroke weight, in px\n */\nexport function evidenceWeight(volume: number | undefined, minVolume: number, maxVolume: number): number {\n    if (volume === undefined || volume <= 0 || maxVolume <= 0) return 1.4;\n    if (maxVolume <= minVolume) return 2;\n    const t = (Math.log1p(volume) - Math.log1p(minVolume)) / (Math.log1p(maxVolume) - Math.log1p(minVolume));\n    if (t >= 0.8) return 2.5;\n    if (t >= 0.4) return 2;\n    return 1.6;\n}\n\n/** A badge volume at or past a thousand: whole units. */\nconst VOLUME_WHOLE: TickFormatOpt = variant(\"number\", { minimumFractionDigits: none, maximumFractionDigits: some(0n), signDisplay: none });\n/** A badge volume under a thousand: one decimal at most. */\nconst VOLUME_TENTH: TickFormatOpt = variant(\"number\", { minimumFractionDigits: none, maximumFractionDigits: some(1n), signDisplay: none });\n\n/**\n * Compact volume formatting for badges, in the app's locale (#850).\n *\n * @param v - The volume\n * @param words - The formatters\n * @returns The volume, printed\n */\nexport function fmtVolume(v: number, words: Formatters): string {\n    return words.value(v, v >= 1000 ? VOLUME_WHOLE : VOLUME_TENTH);\n}\n\n/**\n * Grouped count formatting for badges, in the app's locale (#850).\n *\n * @param n - The count\n * @param words - The formatters\n * @returns The count, printed\n */\nexport function fmtCount(n: bigint, words: Formatters): string {\n    return words.number(n);\n}\n\n/**\n * A transition's evidence badge, in the app's locale (#850) — `17,350 parcels\n * · 386`: its volume with its unit, and its count; none without a volume.\n *\n * @param evidence - The transition's evidence\n * @param words - The formatters\n * @returns The badge; `undefined` for none\n */\nexport function evidenceBadge(evidence: FlowchartEvidenceValue | undefined, words: Formatters): string | undefined {\n    const volume = evidence === undefined ? undefined : getSomeorUndefined(evidence.volume);\n    if (evidence === undefined || volume === undefined) return undefined;\n    const count = getSomeorUndefined(evidence.count);\n    const unit = getSomeorUndefined(evidence.unit);\n    return `${fmtVolume(volume, words)}${unit !== undefined ? ` ${unit}` : \"\"}${count !== undefined ? ` · ${fmtCount(count, words)}` : \"\"}`;\n}\n\n/** A row as it is placed: its `order`, and its key's place in its kind's keys' order. */\ninterface Placed {\n    readonly order: ValueTypeOf<OptionType<FloatType>>;\n    readonly rank: number;\n}\n\n/**\n * Two rows in their order (D4): by `order` — a row with none after every row\n * with one — then by key, the record's order at its key type (#1549).\n *\n * @param a - One row's order and its key's place\n * @param b - The other's\n * @returns Negative, zero or positive\n */\nfunction byOrder(a: Placed, b: Placed): number {\n    if (a.order.type === \"some\" && b.order.type === \"some\") {\n        const order = compareFloat(a.order.value, b.order.value);\n        if (order !== 0) return order;\n    } else if (a.order.type !== b.order.type) {\n        return a.order.type === \"some\" ? -1 : 1;\n    }\n    return a.rank - b.rank;\n}\n\n/**\n * Builds the view model (see the module docs). Pure; unit-testable.\n *\n * @param rows - The four records' rows, the drafts in place\n * @param words - The flowchart's words: the badges' numbers in the app's locale, and the ghost's and *No lane*'s names\n * @returns The view model\n */\nexport function buildModel(rows: FlowchartRows, words: FlowchartWords): FlowchartModel {\n    // ── The bands: the lanes in their order, then No lane while a state names none of them ──\n    const given = rows.lanes;\n    // Each kind's keys' places in their order at its key type, each key's text read back once (#1549).\n    const laneRanks = rows.keys.lanes.ranks((given ?? []).map((lane) => lane.key));\n    const stateRanks = rows.keys.states.ranks(rows.states.map((state) => state.key));\n    const lanes: ModelLane[] = given === undefined ? [] : [...given]\n        .sort((a, b) => byOrder({ order: a.roles.order, rank: laneRanks.get(a.key)! }, { order: b.roles.order, rank: laneRanks.get(b.key)! }))\n        .map((lane) => ({\n            key: lane.key,\n            label: lane.roles.label.length === 0 ? lane.key : lane.roles.label,\n            order: getSomeorUndefined(lane.roles.order),\n            band: \"lane\" as const,\n        }));\n    const laneIndex = new Map<string, number>(lanes.map((lane, i) => [lane.key, i]));\n    const states = [...rows.states].sort((a, b) => byOrder({ order: a.roles.order, rank: stateRanks.get(a.key)! }, { order: b.roles.order, rank: stateRanks.get(b.key)! }));\n    // A state naming no lane the flowchart holds, while lanes are given: the last band's.\n    const unplaced = given === undefined ? [] : states.filter((state) => {\n        const lane = getSomeorUndefined(state.roles.lane);\n        return lane === undefined || !laneIndex.has(lane);\n    });\n    if (given === undefined) lanes.push({ key: ALL_LANE_KEY, label: \"\", order: undefined, band: \"all\" });\n    else if (unplaced.length > 0) lanes.push({ key: NO_LANE_KEY, label: words.m.noLaneBand(), order: undefined, band: \"noLane\" });\n    const noLaneIndex = lanes.length - 1;\n    const bandOf = (lane: string | undefined): number => {\n        if (given === undefined) return 0;\n        const at = lane === undefined ? undefined : laneIndex.get(lane);\n        return at ?? noLaneIndex;\n    };\n\n    // ── The states, band by band, each band's in its order ──\n    const perBand = new Array<number>(Math.max(lanes.length, 1)).fill(0);\n    const nextInBand = (band: number): number => {\n        const n = perBand[band] ?? 0;\n        perBand[band] = n + 1;\n        return n;\n    };\n    const nodes: ModelNode[] = [];\n    const nodesByKey = new Map<string, ModelNode>();\n    const laneStates = new Map<string, number>();\n    for (const state of states) {\n        const lane = getSomeorUndefined(state.roles.lane);\n        const band = bandOf(lane);\n        const node: ModelNode = {\n            key: state.key,\n            label: state.roles.label.length === 0 ? undefined : state.roles.label,\n            laneIndex: band,\n            laneOrder: nextInBand(band),\n            lane,\n            order: getSomeorUndefined(state.roles.order),\n            members: getSomeorUndefined(state.roles.members),\n            inPlaceKeys: [],\n            ghost: false,\n            dimmed: state.dimmed,\n        };\n        nodes.push(node);\n        nodesByKey.set(node.key, node);\n        if (lane !== undefined) laneStates.set(lane, (laneStates.get(lane) ?? 0) + 1);\n    }\n\n    // ── The transitions: in-place ones fold into `↻ n`; an end no state is keyed by is a ghost ──\n    const transitionRanks = rows.keys.transitions.ranks(rows.transitions.map((transition) => transition.key));\n    const transitions = [...rows.transitions].sort((a, b) => transitionRanks.get(a.key)! - transitionRanks.get(b.key)!);\n    const volumes = transitions\n        .map((t) => { const ev = getSomeorUndefined(t.roles.evidence); return ev === undefined ? undefined : getSomeorUndefined(ev.volume); })\n        .filter((v): v is number => v !== undefined && v > 0);\n    const maxVolume = volumes.length > 0 ? Math.max(...volumes) : 0;\n    const minVolume = volumes.length > 0 ? Math.min(...volumes) : 0;\n    // Each ghost, and whether every transition naming it is left out by the narrowing.\n    const ghostLit = new Map<string, boolean>();\n    const ensureGhost = (key: string, nearBand: number, dimmed: boolean): void => {\n        if (nodesByKey.has(key) && !ghostLit.has(key)) return;\n        ghostLit.set(key, (ghostLit.get(key) ?? false) || !dimmed);\n        if (nodesByKey.has(key)) return;\n        // Lanes given, none of them held and no state to place: the ghosts stand in No lane.\n        if (lanes.length === 0) lanes.push({ key: NO_LANE_KEY, label: words.m.noLaneBand(), order: undefined, band: \"noLane\" });\n        const band = Math.min(Math.max(nearBand, 0), lanes.length - 1);\n        const ghost: ModelNode = {\n            key, label: words.m.noStateRow(), laneIndex: band, laneOrder: nextInBand(band), lane: undefined, order: undefined,\n            members: undefined, inPlaceKeys: [], ghost: true, dimmed,\n        };\n        nodes.push(ghost);\n        nodesByKey.set(key, ghost);\n    };\n\n    const links: ModelLink[] = [];\n    let planned = 0, observed = 0, unresolved = 0, held = 0;\n    for (const transition of transitions) {\n        const { from, to } = transition.roles;\n        if (!transition.dimmed) held += 1;\n        if (keyEqual(from, to)) {\n            if (!nodesByKey.has(from) || ghostLit.has(from)) ensureGhost(from, 0, transition.dimmed);\n            // One the narrowing leaves out draws nowhere: its state's `↻ n` counts those drawn as themselves.\n            if (!transition.dimmed) nodesByKey.get(from)!.inPlaceKeys.push(transition.key);\n            continue;\n        }\n        const missing = !nodesByKey.has(from) || !nodesByKey.has(to) || ghostLit.has(from) || ghostLit.has(to);\n        if (missing) {\n            // A ghost stands beside its resolved end's band, or in the first.\n            const anchor = [nodesByKey.get(from), nodesByKey.get(to)].find((node) => node !== undefined && !node.ghost);\n            const near = anchor === undefined ? 0 : anchor.laneIndex + 1;\n            if (!nodesByKey.has(from) || ghostLit.has(from)) ensureGhost(from, near, transition.dimmed);\n            if (!nodesByKey.has(to) || ghostLit.has(to)) ensureGhost(to, near, transition.dimmed);\n        }\n        const cls: LinkClass = missing ? \"unresolved\" : transition.roles.kind.type;\n        if (!transition.dimmed) {\n            if (cls === \"planned\") planned += 1;\n            else if (cls === \"observed\") observed += 1;\n            else unresolved += 1;\n        }\n        const ev = getSomeorUndefined(transition.roles.evidence);\n        const vol = ev === undefined ? undefined : getSomeorUndefined(ev.volume);\n        links.push({\n            key: transition.key,\n            from,\n            to,\n            cls,\n            trigger: getSomeorUndefined(transition.roles.decision),\n            evidence: ev,\n            weight: cls === \"unresolved\" ? 1.4 : evidenceWeight(vol, minVolume, maxVolume),\n            badgeText: evidenceBadge(ev, words),\n            dimmed: transition.dimmed,\n        });\n    }\n    // A ghost is faded only while every transition naming it is.\n    for (const [key, lit] of ghostLit) {\n        const ghost = nodesByKey.get(key)!;\n        if (ghost.dimmed === !lit) continue;\n        const next = { ...ghost, dimmed: !lit };\n        nodes[nodes.indexOf(ghost)] = next;\n        nodesByKey.set(key, next);\n    }\n\n    // ── The decisions ──\n    const triggers = new Map<string, ModelTrigger>();\n    const decisionRanks = rows.keys.decisions.ranks(rows.decisions.map((decision) => decision.key));\n    for (const decision of [...rows.decisions].sort((a, b) => decisionRanks.get(a.key)! - decisionRanks.get(b.key)!)) {\n        const label = decision.roles.label;\n        triggers.set(decision.key, {\n            key: decision.key,\n            label,\n            letter: getSomeorUndefined(decision.roles.letter) ?? (label.length > 0 ? label.charAt(0).toUpperCase() : \"?\"),\n            owner: getSomeorUndefined(decision.roles.owner),\n            queue: decision.roles.queue,\n            outcomes: getSomeorUndefined(decision.roles.outcomes),\n            governs: links.filter((link) => link.trigger !== undefined && keyEqual(link.trigger, decision.key)).map((link) => link.key),\n        });\n    }\n\n    const shownLinks = links.filter((link) => !link.dimmed);\n    return {\n        lanes,\n        nodes,\n        nodesByKey,\n        links,\n        triggers,\n        counts: {\n            total: shownLinks.length, planned, observed, unresolved,\n            lanes: lanes.filter((lane) => lane.band === \"lane\").length,\n            states: nodes.filter((node) => !node.ghost && !node.dimmed).length,\n            transitions: held,\n            decisions: triggers.size,\n        },\n        blank: (given === undefined || given.length === 0) && rows.states.length === 0 && rows.transitions.length === 0,\n        laneStates,\n        standIn: given === undefined,\n        noLane: unplaced.map((state) => state.key),\n        ordered: states.some((state) => state.roles.order.type === \"some\"),\n        keys: rows.keys,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's inspector (#1504, `Flowchart Records Spec.md` R13, R15–R17):\n * its end pane — on unless `inspector={false}` — its tabs Details and Issues,\n * Issues with its count; collapsed, a rail with its icon, the issues' count\n * and what is selected.\n *\n * Details shows what is selected: a row of the app's, under its head — its\n * kind's name and the name the Flowchart gives it everywhere (`State · SCN`,\n * `Transition · DSP → DLV`), and a Pending or New chip while its drafts hold\n * it otherwise than its record. A state's and a transition's head is followed\n * by the reads its kind's details show there, in their order and in full\n * (`details-pane.tsx`, R35, R36) — then:\n *\n * - **a state**: its key, printed — a new state's the viewer's to change until\n *   Save, the transitions naming it following (R9), in the form's own editor\n *   for its key type: a struct key's fields, a date's input, a number's\n *   (#1549), a key of several parts typed a part at a time and taken whole by\n *   Set key (#1581, `shared/schedule/key-draft.tsx`); a key its kind builds\n *   from the row is printed — its label and its lane,\n *   the lane chosen from the lanes, each written as the canvas's rename and\n *   move write them (R8); its kind's form over the fields no role writes, or\n *   its kind's own Details in the form's place; Duplicate and Delete; and its\n *   transitions, In, Out and In place, each with its volume and each a control\n *   that selects it. A key no state is keyed by — an unresolved end, its ghost\n *   — says so, with its transitions;\n * - **a transition**: its ends, each chosen from the states drawn, and its\n *   decision, chosen from the decisions, written as a retarget writes them;\n *   its kind's form or own Details; Delete; and its evidence, read only. Its\n *   key is minted and never drawn;\n * - **a decision**: its key, printed; its kind's form or own Details; Delete;\n *   and the transitions it governs;\n * - **a lane**, which a click on its header selects: its key — a new lane's the\n *   viewer's to change until Save, its states following — and its label; its\n *   kind's form or own Details; how many states it holds; and Delete, off\n *   while it holds any, saying why;\n * - **several states**: how many; a lane every one moves to; and Delete;\n * - **nothing**: the flowchart, as the Schematic's names its drawing (R15) —\n *   the lanes, states, transitions and decisions it holds, counted; its\n *   transitions planned · observed · unresolved; each record's last save and\n *   who made it; and its hints.\n *\n * Every list Details chooses from — a state's lane, a transition's ends and\n * its decision, the lane several states move to — offers its rows in their\n * keys' order at their kind's key type (#1584): never the drawing's, where a\n * state second in its lane comes after every lane's first, nor their texts',\n * where 10 comes before 9.\n *\n * Every edit is one step of the history, through the gestures the canvas\n * makes (`edits.ts`): a role through its kind's `write`, a field of the form\n * through its kind's `set`, and the row an own Details hands back, whole. A\n * field its drafts changed is tinted against its record. Read only — a kind\n * bound read only, or the Flowchart `readOnly` (R13) — Details prints every\n * field and edits none, an own Details giving way to the form; while a record\n * takes no edit — a Save in flight, or what the canvas draws standing in while\n * a new narrowing is read — its controls are off. A field's edit refused leaves\n * the field showing what its row holds: one the Flowchart says why of — a key\n * typed that a row stands under already, or left empty; a key its fields build\n * that another row holds; a row that would move while what may name it isn't\n * held — says so under the field, as the footer does, the keyboard where the\n * edit left it (`FieldForm`'s refusal); one refused with nothing to say — its\n * kind's own `set` or `write` refusing it — draws its form again. A key whose\n * row a draft deletes is free (#1581). A number a row holds outside its\n * field's bounds is said in the tone the row's Save stands in (#1585): a\n * warning as stored, an error once its record's session refuses the row's\n * change, holding Save. A field its record's session's refusal names — the\n * app's check of the row's change, a new row's key still to be typed — takes\n * the warn wash and says the refusal's words under it (ruled 13 Nov 2026):\n * Details lists no issue, so the field itself says why it is named. An issue\n * gone to, from the toolbar or from its line in\n * Issues, puts the keyboard in the field it names, the inspector opened at\n * Details where it is collapsed or at Issues.\n *\n * Details keeps the keyboard (#1398): a control that goes with the view it\n * belongs to — Delete, which leaves nothing selected; Duplicate and a\n * transition's line, which select another; a refused edit's form drawn again\n * — leaves the focus on the heading of the view drawn in its place\n * (`../shared/focus-home.ts`), never on the page's body.\n *\n * Issues (R16) lists the Flowchart's issues (`issues.ts`), each a control that\n * selects what it names and brings it into view, the field it names taking\n * the keyboard in its Details, as the toolbar's issue gone to puts it there:\n * the viewer lands where the issue is fixed, not left on Issues. An issue of\n * an unsaved change the narrowing hides says on a line of its own which of the\n * rail's choices hide it, asked of e3 through its source's hidden pick, and Go\n * to issue on it is the frame's hidden pick: those choices cleared, then\n * selected once it is drawn (R11).\n *\n * Its look is the `flowchartInspector` recipe's, the form's `fieldForm`'s and\n * the buttons the shared `button`'s; the pane — its tab row, its collapse\n * control and its rail — is the Dock's.\n *\n * @packageDocumentation\n */\n\nimport { Fragment, memo, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { Box, chakra, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport {\n    DateTimeType, IntegerType, OptionType, StringType, StructType, encodeBeast2For, equalFor, fromEastTypeValue, none, some,\n    type EastType, type StructType as EastStructType, type option,\n} from \"@elaraai/east\";\nimport { Fields, type FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport {\n    EastChakraComponent, FieldForm, fieldFormMessages, getSomeorUndefined, type BuilderFrameDock, type FieldFormWords, type FieldOption,\n} from \"@elaraai/east-ui-components\";\nimport { FrameDrawer } from \"@elaraai/east-ui-components/internal\";\nimport { FOCUS_HOME_PROPS, useFocusHome } from \"../shared/focus-home.js\";\nimport { useFieldAsk } from \"../shared/schedule/field-ask.js\";\nimport { askHiding, hiddenLine, hiddenOf, type RowHidden, type RowHiding, type SourceHiding } from \"../shared/schedule/hidden.js\";\nimport type { HiddenPicks } from \"../shared/schedule/hidden-pick.js\";\nimport { draftedRow, rowCodec } from \"../shared/schedule/records.js\";\nimport { entryRefusals, refusedFields, type RefusedFields } from \"../shared/schedule/refusals.js\";\nimport type { FlowchartDetailsModel } from \"./details.js\";\nimport { FlowchartPaneReads } from \"./details-pane.js\";\nimport { kindOf, type FlowchartEditing, type FlowchartFieldWrites } from \"./editing.js\";\nimport {\n    deleteDecision, deleteLane, deleteLink, deleteStates, duplicateState, editLink, moveStates, rekey, renameLane, renameState, setFields, setRow,\n    type FlowchartGesture, type FlowchartHolding, type GestureEdits,\n} from \"./edits.js\";\nimport { KeySetButton, useKeyDraft, type KeyDraft } from \"../shared/schedule/key-draft.js\";\nimport { keyFieldSpecs, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport type { FlowchartLastSaves } from \"./footer.js\";\nimport type { FlowchartIssue } from \"./issues.js\";\nimport type { FlowchartWords } from \"./messages.js\";\nimport {\n    fmtVolume, type FlowchartModel, type FlowchartRow, type FlowchartRows, type FlowchartTransitionRoles, type FlowchartValue, type LinkClass,\n} from \"./model.js\";\nimport type { FlowchartHeld, FlowchartSort } from \"./read.js\";\nimport type { FlowchartSelection } from \"./selection.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n/** A kind of any sort, as the payload carries it. */\ntype AnyKind = NonNullable<ReturnType<typeof kindOf>>;\n/** An author's own Details, decoded: the row as bytes and its writer, to UI. */\ntype OwnDetails = Extract<AnyKind[\"inspector\"], { type: \"some\" }>[\"value\"];\n/** One field of the form written, as a kind's `set` takes it. */\ntype FieldWrite = FlowchartFieldWrites[number];\n\n/** The inspector open: the design system's 320px, as the Schematic's, the Plan's and the Sheet's are. */\nconst INSPECTOR_SIZE = \"320px\";\n\n/** A form that takes no edit: read only. */\nconst NO_EDIT = (): void => {};\n/** What a new row's form is tinted against: nothing — every field it has is a change. */\nconst NEW_ROW: Readonly<Record<string, unknown>> = {};\n\nconst stringEqual = equalFor(StringType);\n\n/** A state's roles as its form edits them past its key, whose field is its key type's own (`keyFieldSpecs`): its label and its lane. */\nconst StateRolesForm = StructType({ label: StringType, lane: StringType });\n/** A transition's roles as its form edits them: its ends and its decision. */\nconst TransitionRolesForm = StructType({ from: StringType, to: StringType, decision: OptionType(StringType) });\n/** A lane's roles as its form edits them past its key: its label. */\nconst LaneRolesForm = StructType({ label: StringType });\n/** A decision's key, as its form prints it. */\nconst DecisionKeyForm = StructType({ key: StringType });\n/** A transition's evidence as its form prints it: the volume with its unit, the count, and when it was measured. */\nconst EvidenceForm = StructType({ volume: OptionType(StringType), count: OptionType(IntegerType), measured: OptionType(DateTimeType) });\n/** Several states as the form moves them: the lane each goes to. */\nconst MoveForm = StructType({ lane: StringType });\n\n/** A chip in a view's head: drafted since the record held it, new, a key no state is keyed by, a transition naming one. */\ntype Chip = \"pending\" | \"new\" | \"noRow\" | \"unresolved\";\n\n/** What the inspector reads of the Flowchart. */\nexport interface FlowchartInspectorProps {\n    /** The payload, decoded: each kind's name, form, own Details and row type. */\n    readonly value: FlowchartValue;\n    /** What the canvas draws, the drafts in place. */\n    readonly model: FlowchartModel;\n    /** The rows it draws, the drafts in place. */\n    readonly rows: FlowchartRows;\n    /** Each kind's stored rows the read holds: what a form is tinted against. */\n    readonly held: FlowchartHeld;\n    /** What is selected, as the canvas draws it. */\n    readonly selection: FlowchartSelection | null;\n    /** The editing: each record's session and drafts, and which kinds take an edit. */\n    readonly editing: FlowchartEditing;\n    /**\n     * Records a gesture's edits as one step, as the canvas's are — what the gesture reads the latest the frame holds —\n     * clearing the footer's refusal.\n     *\n     * @param gesture - The gesture\n     * @param edits - Its edits, over what it reads; `undefined` where it makes none\n     * @returns The edits recorded; `undefined` where nothing was\n     */\n    readonly act: (gesture: FlowchartGesture, edits: (holding: FlowchartHolding) => GestureEdits | undefined) => GestureEdits | undefined;\n    /**\n     * Records a form's edit as one step, as `act` does a gesture's: refused, why — the footer's words, which the form says\n     * under its field too.\n     *\n     * @param gesture - The gesture\n     * @param edits - Its edits, over what it reads; `undefined` where it makes none\n     * @returns `true` once recorded; refused, why — or `false` where nothing says\n     */\n    readonly edit: (gesture: FlowchartGesture, edits: (holding: FlowchartHolding) => GestureEdits | undefined) => boolean | string;\n    /** Says why an edit was refused, in the footer. */\n    readonly refuse: (words: string) => void;\n    /** Selects something, or nothing — a transition in a state's Details, an issue's row — bringing it into view unless `scroll` is `false`. */\n    readonly reveal: (selection: FlowchartSelection | null, scroll?: boolean) => void;\n    /** The Flowchart's issues, and its sessions'. */\n    readonly issues: readonly FlowchartIssue[];\n    /** Each source's hidden pick, by its kind: what an issue of a change the narrowing hides asks e3 which choices hide its row through. */\n    readonly picks: HiddenPicks;\n    /**\n     * Goes to a change the narrowing hides — the frame's hidden pick, as Find's is: the choices hiding it cleared, and\n     * selected once the narrowing they leave draws it.\n     *\n     * @param at - What the issue names\n     * @param hidden - What hides it, as far as e3 has said; `undefined` where nothing does\n     */\n    readonly goToWaiting: (at: FlowchartSelection, hidden: readonly SourceHiding[] | undefined) => void;\n    /**\n     * Asks a row's Details for a field, which takes the keyboard there, the inspector opened at Details: what an issue's\n     * line in Issues asks, as the toolbar's issue gone to does. Asked for none, any ask standing is dropped.\n     *\n     * @param sort - The row's kind\n     * @param key - Its key\n     * @param field - The field the issue names, by its form's key; none for an issue naming none\n     */\n    readonly ask: (sort: FlowchartSort, key: string, field: option<string>) => void;\n    /** Each record's last save, and who made it. */\n    readonly saves: FlowchartLastSaves;\n    /** The details: the reads a state's or a transition's Details shows after its head. */\n    readonly details: FlowchartDetailsModel;\n    /** Where an own Details keeps its own state. */\n    readonly storageKey: string;\n    /** The Flowchart's words. */\n    readonly words: FlowchartWords;\n}\n\n/** Every view's props: the inspector's, and the recipe's styles. */\ninterface ViewProps extends FlowchartInspectorProps {\n    readonly styles: Styles;\n}\n\n/** A row's view: the inspector's, and the key of what it shows. */\ninterface RowViewProps extends ViewProps {\n    readonly at: string;\n}\n\n/** A kind's name, as the payload gives it: what one is called. */\nfunction kindName(value: FlowchartValue, sort: FlowchartSort): string {\n    return kindOf(value, sort)?.name ?? \"\";\n}\n\n/** A transition the canvas draws, by its key, its drafts in place. */\nfunction transitionAt(rows: FlowchartRows, key: string): FlowchartRow<FlowchartTransitionRoles> | undefined {\n    return rows.transitions.find((transition) => stringEqual(transition.key, key));\n}\n\n/** A transition named by its ends' keys, as the Flowchart names it everywhere. */\nfunction endsOf(roles: FlowchartTransitionRoles): string {\n    return `${roles.from} → ${roles.to}`;\n}\n\n/** A lane's header, by its key; its key where the canvas draws no lane of it. */\nfunction laneLabel(model: FlowchartModel, key: string): string {\n    return model.lanes.find((lane) => lane.band === \"lane\" && stringEqual(lane.key, key))?.label ?? key;\n}\n\n/** A state's name on its card: its label, else its key. */\nfunction stateName(model: FlowchartModel, key: string): string {\n    const node = model.nodesByKey.get(key);\n    return node === undefined || node.ghost || node.label === undefined ? key : node.label;\n}\n\n/**\n * What is selected, as the head and the collapsed rail name it — `State · SCN`,\n * `Transition · DSP → DLV`, `Decision · R`, `Lane · Sort`, `3 states` — by the\n * name Issues gives it too.\n *\n * @param props - The inspector's props\n * @param selection - What is selected\n * @returns Its name\n */\nfunction whatOf(props: FlowchartInspectorProps, selection: FlowchartSelection): string {\n    const { value, model, rows, words } = props;\n    const m = words.m;\n    switch (selection.kind) {\n        case \"state\": return m.inspectorWhat({ what: \"row\", kind: value.states.name, name: selection.key });\n        case \"link\": {\n            const roles = transitionAt(rows, selection.key)?.roles;\n            return m.inspectorWhat({ what: \"row\", kind: kindName(value, \"transitions\"), name: roles === undefined ? selection.key : endsOf(roles) });\n        }\n        case \"trigger\": return m.inspectorWhat({ what: \"row\", kind: kindName(value, \"decisions\"), name: model.triggers.get(selection.key)?.letter ?? selection.key });\n        case \"lane\": return m.inspectorWhat({ what: \"row\", kind: kindName(value, \"lanes\"), name: laneLabel(model, selection.key) });\n        case \"states\": {\n            const n = selection.keys.length;\n            return m.inspectorWhat({ what: \"several\", n, count: words.number(n), name: value.states.name.toLocaleLowerCase(words.locale) });\n        }\n    }\n}\n\n/**\n * The inspector pane, as `BuilderFrame` draws it — see the module docs.\n *\n * @param props - The payload, what the canvas draws, what is selected, the editing, the issues, the saves and the words\n * @returns The pane — 320px wide, its collapsed state kept per viewer — or `undefined`, no pane, given `inspector={false}`\n */\nexport function flowchartInspectorPane(props: FlowchartInspectorProps): BuilderFrameDock | undefined {\n    if (!props.value.inspector) return undefined;\n    const { words, issues, selection } = props;\n    const m = words.m;\n    const n = issues.length;\n    return {\n        label: m.inspectorPane(),\n        icon: \"sliders\",\n        size: INSPECTOR_SIZE,\n        persist: \"local\",\n        // Collapsed, the rail counts the issues and names what is selected.\n        badge: n > 0 ? n : undefined,\n        detail: selection === null ? undefined : whatOf(props, selection),\n        tabs: [\n            { key: \"details\", label: m.inspectorTab({ tab: \"details\" }), body: <FlowchartInspectorDetails {...props} /> },\n            { key: \"issues\", label: m.inspectorTab({ tab: \"issues\" }), count: n, body: <FlowchartInspectorIssues {...props} /> },\n        ],\n    };\n}\n\n// ============================================================================\n// The shared parts\n// ============================================================================\n\n/**\n * A view's head: what it shows, its name under that, and its chips — their row kept while there is none where its view\n * takes edits (`writes`, #1584), so a draft's chip arriving moves nothing under it — its view's home, where the keyboard\n * lands as a control goes with the view.\n */\nfunction Head({ styles, what, name, chips, writes = false, words }: {\n    styles: Styles; what: string; name: string | undefined; chips: readonly Chip[]; writes?: boolean; words: FlowchartWords;\n}) {\n    return (\n        <Box css={styles.head} {...FOCUS_HOME_PROPS}>\n            <Box css={styles.eyebrow} data-inspector-what=\"\">{what}</Box>\n            {name !== undefined && <Box css={styles.name} data-inspector-name=\"\">{name}</Box>}\n            <Box css={styles.marks} data-writes={writes ? \"\" : undefined}>\n                {chips.map((chip) => (\n                    <Box as=\"span\" key={chip} css={styles.chip} data-inspector-chip=\"\" data-state={chip}>{words.m.inspectorChip({ state: chip })}</Box>\n                ))}\n            </Box>\n        </Box>\n    );\n}\n\n/** One gesture's button: Duplicate, Delete. */\nfunction Action({ action, onClick, disabled, words }: { action: \"duplicate\" | \"delete\"; onClick: () => void; disabled?: boolean; words: FlowchartWords }) {\n    const button = useRecipe({ key: \"button\" });\n    return (\n        <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} disabled={disabled} data-inspector-action={action} onClick={onClick}>\n            {words.m.inspectorAction({ action })}\n        </chakra.button>\n    );\n}\n\n/** A view's edits: its forms — or an own Details — and its gestures, in one fieldset, off while its record takes no edit. */\nfunction Edits({ styles, available, children, actions }: { styles: Styles; available: boolean; children: ReactNode; actions: ReactNode | undefined }) {\n    return (\n        <chakra.fieldset css={styles.edits} disabled={!available} data-inspector-edits=\"\">\n            {children}\n            {actions !== undefined && <Box css={styles.actions} data-inspector-actions=\"\">{actions}</Box>}\n        </chakra.fieldset>\n    );\n}\n\n/** A fact on a line of its own. */\nfunction Fact({ styles, fact, children }: { styles: Styles; fact: string; children: ReactNode }) {\n    return <Box css={styles.section}><Box css={styles.fact} data-inspector-fact={fact}>{children}</Box></Box>;\n}\n\n/**\n * A new row's key field (#1549): the form's own editor for its kind's key\n * type, taking an edit while the row is new — a key its kind builds from the\n * row never does — the warn wash and the keyboard while it holds a placeholder,\n * which Issues points at, and under it what its record's session says of it\n * while it waits, `Type this state's key: Save waits for it` (ruled 13 Nov\n * 2026): the refusal names the key's field, and no check of the app's is asked\n * of a row under a placeholder. A key of several parts says it is set whole\n * (#1581), in its help line.\n *\n * @param keys - The kind's keys\n * @param at - The row's key\n * @param keyed - Whether its key takes an edit\n * @param m - The Flowchart's messages\n * @param refused - The fields its record's session's refusals name, each with their words\n * @returns The key's specs, and what the form washes — each field with what it says under it — and focuses\n */\nfunction useKeyField(keys: KindKeys, at: string, keyed: boolean, m: FlowchartWords[\"m\"], refused: RefusedFields) {\n    const placeholder = !keys.isKey(at);\n    const specs = useMemo(() => keyFieldSpecs(keys, m.inspectorField({ field: \"key\" }), keys.specs.length > 1 ? m.inspectorKeyPartsHelp() : m.inspectorKeyHelp(), keyed),\n        [keys, m, keyed]);\n    const issues: RefusedFields | undefined = !placeholder ? undefined\n        : new Map(specs.map((spec) => { const key = spec.path.join(\".\"); return [key, refused.get(key) ?? []] as const; }));\n    return { specs, issues, focus: placeholder && keyed ? specs[0]?.path.join(\".\") : undefined };\n}\n\n/**\n * A row's key in a form of its own (#1549, #1581): printed, or the viewer's to type while the row is new — a key of\n * several parts into its draft, which Set key takes whole.\n */\nfunction KeyForm({ styles, keyField, draft, keyed, refused, baseline, writes, words }: {\n    styles: Styles; keyField: ReturnType<typeof useKeyField>; draft: KeyDraft; keyed: boolean; refused: number; baseline: unknown; writes: boolean;\n    words: FlowchartWords;\n}) {\n    return (\n        <>\n            <FieldForm key={refused} specs={keyField.specs} value={{ key: draft.value }} baseline={baseline}\n                onChange={writes ? draft.onChange : NO_EDIT} readOnly={!writes} issues={keyField.issues} focus={keyField.focus} />\n            {keyed && draft.parts && (\n                <Box css={styles.actions} data-inspector-actions=\"key\"><KeySetButton draft={draft} label={words.m.inspectorKeySet()} /></Box>\n            )}\n        </>\n    );\n}\n\n/** A remount counter for a form whose edit was refused with nothing to say: its inputs show what the row holds again. */\nfunction useRefused(): [number, () => void] {\n    const [refused, setRefused] = useState(0);\n    const bump = useCallback(() => setRefused((n) => n + 1), []);\n    return [refused, bump];\n}\n\n/**\n * A list's choices in their keys' order at their kind's key type (#1584): the form holds a key's text, a String, and\n * offers its choices in the order given.\n *\n * @param keys - The kind's keys\n * @param choices - The choices, a row's key's text each, in any order\n * @returns The choices, in their keys' order\n */\nfunction inKeyOrder(keys: KindKeys, choices: readonly FieldOption[]): FieldOption[] {\n    const byText = new Map(choices.map((choice) => [choice.key, choice] as const));\n    return keys.order(byText.keys()).map(({ text }) => byText.get(text)!);\n}\n\n/** The form's words where it chooses a decision: the field form's, its reference with no key the Flowchart's no decision. */\nfunction useDecisionWords(words: FlowchartWords): FieldFormWords {\n    return useMemo(() => ({ ...words, m: { ...fieldFormMessages, unassigned: words.m.noDecision } }), [words]);\n}\n\n/**\n * An own Details for a row: what the author's function returns for its bytes,\n * its `update` writing the edited row back — or, where it fails, nothing, and\n * the form shows.\n *\n * @param author - The kind's own Details; `undefined` for none, or a kind read only\n * @param bytes - The row, as bytes\n * @param update - The writer of the edited row's bytes\n * @param what - What the row is, for the console\n * @returns The UI it returns, or `undefined`\n */\nfunction useOwnDetails(author: OwnDetails | undefined, bytes: Uint8Array | undefined, update: (edited: Uint8Array) => null, what: string): unknown {\n    return useMemo(() => {\n        if (author === undefined || bytes === undefined) return undefined;\n        try {\n            return author(bytes, update);\n        } catch (err) {\n            console.error(`[Flowchart] ${what}'s own Details failed; its form shows instead:`, err);\n            return undefined;\n        }\n    }, [author, bytes, update, what]);\n}\n\n/**\n * A field of the form edited, as its kind's `set` takes it: its path, and its\n * value as bytes at the field's type — its spec's, else the row's own field's.\n *\n * @param specs - The form's specs\n * @param rowType - The row type\n * @param path - The field's path\n * @param next - Its new value\n * @returns The write; `undefined` for a path no field is at\n */\nfunction fieldWrite(specs: readonly FieldSpecValue[], rowType: AnyKind[\"rowType\"], path: readonly string[], next: unknown): FieldWrite | undefined {\n    const spec = specs.find((field) => field.path.length === path.length && field.path.every((part, i) => stringEqual(part, path[i]!)));\n    const row = fromEastTypeValue(rowType) as EastStructType;\n    const type = spec !== undefined ? fromEastTypeValue(spec.type) as EastType : path.length === 1 ? row.fields[path[0]!] : undefined;\n    if (type === undefined) return undefined;\n    return { path: [...path], value: encodeBeast2For(type)(next as never) };\n}\n\n/** A row as Details holds it: as its drafts hold it, else its record; what its form is tinted against; its chip. */\ninterface RowState {\n    /** The app's row now, decoded: drafted, else as its record holds it; `undefined` for none. */\n    readonly row: unknown;\n    /** The row now, as bytes: what an own Details is handed. */\n    readonly bytes: Uint8Array | undefined;\n    /** What its form is tinted against: its record's row, or — a new row — nothing. */\n    readonly baseline: unknown;\n    /** New while its record holds none of it; Pending while its drafts hold it otherwise. */\n    readonly chip: \"pending\" | \"new\" | undefined;\n    /** Whether a gesture made it, unsaved: its key is the viewer's to change. */\n    readonly created: boolean;\n}\n\n/**\n * A record's row as Details holds it: drafted, its session's version; else as\n * its record holds it, from the read's bytes.\n *\n * @param editing - The editing\n * @param sort - The row's kind\n * @param kind - The kind: its row type\n * @param key - The row's key\n * @param stored - Its stored row's bytes, as the read holds them\n * @returns The row's state\n */\nfunction useRowState(editing: FlowchartEditing, sort: FlowchartSort, kind: AnyKind | undefined, key: string, stored: Uint8Array | undefined): RowState {\n    const codec = useMemo(() => (kind === undefined ? undefined : rowCodec(kind.rowType)), [kind]);\n    const decoded = useMemo(() => (stored === undefined || codec === undefined ? undefined : codec.decode(stored)), [stored, codec]);\n    const drafted = editing.schedule.draftsOf(sort).has(key);\n    const session = drafted ? editing.schedule.sessions.find((part) => stringEqual(part.kind, sort))?.session : undefined;\n    const draft = drafted ? draftedRow(session?.entries.get(key))?.row : undefined;\n    const row = drafted ? draft : decoded;\n    const bytes = useMemo(() => {\n        if (row === undefined || codec === undefined) return undefined;\n        return !drafted && stored !== undefined ? stored : codec.encode(row);\n    }, [row, codec, drafted, stored]);\n    const kindDrafts: ReadonlyMap<string, { readonly created: boolean } | undefined> = editing.drafts[sort];\n    const created = kindDrafts.get(key)?.created === true;\n    return { row, bytes, baseline: decoded ?? NEW_ROW, chip: drafted ? (created ? \"new\" : \"pending\") : undefined, created };\n}\n\n/**\n * A row's side of its record, as Details edits it: its kind's form or its own\n * Details over the row as its drafts and its record hold it; each field one\n * step through the kind's `set`, the own Details' row one step whole.\n *\n * @param props - The view's props\n * @param sort - The row's kind\n * @param key - Its key\n * @param what - What it is, for the console\n * @returns The kind, whether it writes and takes an edit now, the row's state, the form's edit, the own Details, the\n *   tone a bound its row breaks is said in, the fields its session's refusals name with their words, and the field an\n *   issue gone to asks of it\n */\nfunction useSide(props: ViewProps, sort: FlowchartSort, key: string, what: string) {\n    const { value, editing, held, act, edit } = props;\n    const kind = kindOf(value, sort);\n    const writes = kind !== undefined && editing.editable(sort);\n    const available = writes && editing.available(sort);\n    const rows: ReadonlyMap<string, { readonly row: Uint8Array }> | undefined = held[sort];\n    const state = useRowState(editing, sort, kind, key, rows?.get(key)?.row);\n    const [refused, bump] = useRefused();\n    // A field's edit refused shows what the row holds again: saying why under the field, or with nothing to say, the\n    // form drawn again.\n    const onField = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        if (kind === undefined) return undefined;\n        const write = fieldWrite(kind.fields, kind.rowType, path, next);\n        const done = write === undefined ? false : edit(\"form\", (holding) => setFields(holding, sort, key, [write]));\n        if (done === false) bump();\n        return done === true || done === false ? undefined : done;\n    }, [kind, sort, key, edit, bump]);\n    const update = useCallback((edited: Uint8Array): null => {\n        if (writes) act(\"details\", (holding) => setRow(holding, sort, key, edited));\n        return null;\n    }, [writes, sort, key, act]);\n    // Read only, the form prints every field: an own Details is for a record that takes its edits.\n    const own = useOwnDetails(writes && kind !== undefined ? getSomeorUndefined(kind.inspector) : undefined, state.bytes, update, what);\n    // What its record's session refuses of the row, holding Save. A bound its row breaks (#1585) is said in the tone its\n    // Save stands in: as stored it warns; its change refused, it is an error. And each field a refusal names says the\n    // refusal's words under it (ruled 13 Nov 2026): Details lists no issue, so the field says why it is named.\n    const refusals = entryRefusals(editing.schedule.sessions, sort, key);\n    const breaches: \"warn\" | \"error\" = refusals.length > 0 ? \"error\" : \"warn\";\n    const issues = refusedFields(refusals);\n    // The field an issue gone to names, from the toolbar or from Issues: it takes the keyboard, the inspector opened at\n    // Details.\n    const focus = useFieldAsk(sort, key);\n    return { kind, writes, available, state, onField, own, refused, bump, breaches, issues, focus };\n}\n\n/**\n * A row's fields: its roles' form, then its kind's form over the fields no\n * role writes, each field its session's refusal names saying why under it —\n * or its kind's own Details in that form's place.\n */\nfunction RowFields({ styles, roles, side, storageKey }: {\n    styles: Styles; roles: ReactNode; side: ReturnType<typeof useSide>; storageKey: string;\n}) {\n    const { kind, writes, state, onField, own, refused, breaches, issues, focus } = side;\n    const specs = kind?.fields ?? [];\n    return (\n        <>\n            <Box css={styles.rowForms} data-inspector-fields=\"row\">\n                {roles}\n                {own === undefined && specs.length > 0 && (\n                    <Box data-inspector-form=\"fields\">\n                        <FieldForm key={refused} specs={specs} value={state.row} baseline={state.baseline} onChange={writes ? onField : NO_EDIT} readOnly={!writes}\n                            breaches={breaches} issues={issues} focus={focus} />\n                    </Box>\n                )}\n            </Box>\n            {own !== undefined && (\n                <Box css={styles.custom} data-inspector-fields=\"custom\">\n                    <EastChakraComponent value={own as never} storageKey={storageKey} />\n                </Box>\n            )}\n        </>\n    );\n}\n\n/** A transition as a list shows it: its key, its ends, its kind and its decision, and its volume. */\ninterface LinkLine {\n    readonly key: string;\n    readonly from: string;\n    readonly to: string;\n    readonly meta: string;\n    readonly volume: string;\n}\n\n/**\n * Transitions as a list shows them, in their keys' order at their key type\n * (R37, #1549): each its ends' keys, its kind — unresolved where an end is no\n * state's — and its decision, and its evidence's volume with its unit — *not\n * measured* without one. What the narrowing draws as context is left out.\n *\n * @param props - The inspector's props: what the canvas draws\n * @param pick - Which of its transitions\n * @returns The lines\n */\nfunction linkLines(props: FlowchartInspectorProps, pick: (roles: FlowchartTransitionRoles) => boolean): LinkLine[] {\n    const { model, rows, words } = props;\n    const unresolved = (key: string): boolean => model.nodesByKey.get(key)?.ghost !== false;\n    const picked = new Map(rows.transitions.filter((transition) => !transition.dimmed && pick(transition.roles)).map((transition) => [transition.key, transition] as const));\n    return rows.keys.transitions.order(picked.keys())\n        .map(({ text }) => picked.get(text)!)\n        .map((transition) => {\n            const { from, to } = transition.roles;\n            const kind: LinkClass = unresolved(from) || unresolved(to) ? \"unresolved\" : transition.roles.kind.type;\n            const decision = getSomeorUndefined(transition.roles.decision);\n            const trigger = decision === undefined ? undefined : model.triggers.get(decision);\n            const evidence = getSomeorUndefined(transition.roles.evidence);\n            const volume = evidence === undefined ? undefined : getSomeorUndefined(evidence.volume);\n            const unit = evidence === undefined ? undefined : getSomeorUndefined(evidence.unit);\n            return {\n                key: transition.key, from, to,\n                meta: words.m.inspectorLinkKind({\n                    kind,\n                    decision: decision === undefined ? undefined : trigger === undefined || trigger.label.length === 0 ? decision : trigger.label,\n                }),\n                volume: words.m.inspectorVolume({\n                    volume: volume === undefined ? undefined : unit === undefined ? fmtVolume(volume, words) : `${fmtVolume(volume, words)} ${unit}`,\n                }),\n            };\n        });\n}\n\n/** One group of a list of transitions: its head — `In · 2` — and its lines. */\ninterface LinkGroup {\n    readonly key: string;\n    readonly head: string | undefined;\n    readonly lines: readonly LinkLine[];\n}\n\n/** A list of transitions under its head, in groups, each line a control that selects its transition and brings it into view. */\nfunction Transitions({ styles, title, groups, reveal }: { styles: Styles; title: string; groups: readonly LinkGroup[]; reveal: FlowchartInspectorProps[\"reveal\"] }) {\n    const shown = groups.filter((group) => group.lines.length > 0);\n    if (shown.length === 0) return null;\n    return (\n        <Box css={styles.section} data-inspector-links=\"\">\n            <Box css={styles.sectionHead}>{title}</Box>\n            {shown.map((group) => (\n                <Fragment key={group.key}>\n                    {group.head !== undefined && <Box css={styles.linkGroup} data-inspector-link-group={group.key}>{group.head}</Box>}\n                    <Box as=\"ul\" css={styles.links} data-inspector-link-list={group.key}>\n                        {group.lines.map((line) => (\n                            <Box as=\"li\" key={line.key}>\n                                <chakra.button type=\"button\" css={styles.link} data-inspector-link={line.key} onClick={() => reveal({ kind: \"link\", key: line.key })}>\n                                    <Box as=\"span\" css={styles.linkText}>{`${line.from} → ${line.to}`}</Box>\n                                    <Box as=\"span\" css={styles.linkMeta}>{line.meta}</Box>\n                                    <Box as=\"span\" css={styles.linkVolume} data-inspector-link-volume=\"\">{line.volume}</Box>\n                                </chakra.button>\n                            </Box>\n                        ))}\n                    </Box>\n                </Fragment>\n            ))}\n        </Box>\n    );\n}\n\n/**\n * A state's transitions in their groups: In, Out and In place.\n *\n * @param props - The inspector's props\n * @param key - The state's key\n * @returns Its transitions' count, and the groups\n */\nfunction stateGroups(props: FlowchartInspectorProps, key: string): { n: number; groups: LinkGroup[] } {\n    const m = props.words.m;\n    const lines = linkLines(props, (roles) => stringEqual(roles.from, key) || stringEqual(roles.to, key));\n    const into = lines.filter((line) => stringEqual(line.to, key) && !stringEqual(line.from, key));\n    const out = lines.filter((line) => stringEqual(line.from, key) && !stringEqual(line.to, key));\n    const inPlace = lines.filter((line) => stringEqual(line.from, key) && stringEqual(line.to, key));\n    const head = (section: \"in\" | \"out\" | \"inPlace\", group: readonly LinkLine[]) =>\n        m.inspectorSection({ section, n: group.length, count: props.words.number(group.length), name: \"\" });\n    return {\n        n: lines.length,\n        groups: [\n            { key: \"in\", head: head(\"in\", into), lines: into },\n            { key: \"out\", head: head(\"out\", out), lines: out },\n            { key: \"inPlace\", head: head(\"inPlace\", inPlace), lines: inPlace },\n        ],\n    };\n}\n\n// ============================================================================\n// Details\n// ============================================================================\n\n/**\n * The Details tab: what is selected — a state, a transition, a decision, a lane, several states — or the flowchart; the\n * keyboard kept as a control goes with the view it belongs to, on the heading of the view drawn in its place.\n */\nconst FlowchartInspectorDetails = memo(function FlowchartInspectorDetails(props: FlowchartInspectorProps) {\n    const styles = useSlotRecipe({ key: \"flowchartInspector\" })() as Styles;\n    const home = useFocusHome();\n    return (\n        <Box ref={home.ref} css={styles.home} onFocus={home.onFocus} onBlur={home.onBlur} data-inspector-home=\"\">\n            {detailsView({ ...props, styles })}\n        </Box>\n    );\n});\n\n/** What Details shows, a view a selection: what was typed for one never lands on the next. */\nfunction detailsView(view: ViewProps): ReactNode {\n    const { selection, model } = view;\n    if (selection === null) return <FlowchartView key=\"flowchart\" {...view} />;\n    switch (selection.kind) {\n        case \"state\": return model.nodesByKey.get(selection.key)?.ghost === true\n            ? <GhostView key={`ghost:${selection.key}`} {...view} at={selection.key} />\n            : <StateView key={`state:${selection.key}`} {...view} at={selection.key} />;\n        case \"link\": return <LinkView key={`link:${selection.key}`} {...view} at={selection.key} />;\n        case \"trigger\": return <DecisionView key={`trigger:${selection.key}`} {...view} at={selection.key} />;\n        case \"lane\": return <LaneView key={`lane:${selection.key}`} {...view} at={selection.key} />;\n        case \"states\": return <SeveralView key=\"states\" {...view} picked={selection.keys} />;\n    }\n}\n\n/**\n * A key typed for a new row (R9): refused — the field showing the key it has,\n * saying why under it as the footer does — when it is empty or a row of the\n * Flowchart stands under it already; else the row under it, the rows naming it\n * following, and the selection with it. A key whose row a draft deletes is free\n * (#1581).\n *\n * @param props - The view's props\n * @param sort - The row's kind: a state's or a lane's\n * @param from - Its key\n * @param typed - The key typed\n * @param bump - Draws the form again, showing the key it has\n * @returns Why it was refused, where the Flowchart says: what the form says under the field\n */\nfunction typedKey(props: RowViewProps, sort: \"states\" | \"lanes\", from: string, typed: string, bump: () => void): string | undefined {\n    const { value, editing, edit, refuse, reveal, words } = props;\n    const to = typed.trim();\n    if (stringEqual(to, from)) {\n        bump();\n        return undefined;\n    }\n    const why = to.length === 0 ? \"empty\" as const : editing.stands(sort, to) ? \"taken\" as const : undefined;\n    if (why !== undefined) {\n        const said = words.m.inspectorKeyRefused({ name: kindName(value, sort).toLocaleLowerCase(words.locale), key: to, why });\n        refuse(said);\n        return said;\n    }\n    const done = edit(\"rekey\", (holding) => rekey(holding, sort, from, to));\n    if (done === true) reveal(sort === \"states\" ? { kind: \"state\", key: to } : { kind: \"lane\", key: to }, false);\n    else if (done === false) bump();\n    return done === true || done === false ? undefined : done;\n}\n\n// ── A state ─────────────────────────────────────────────────────────────────\n\n/** A state: its head, its roles and its kind's form — or own Details — Duplicate and Delete, and its transitions. */\nfunction StateView(props: RowViewProps) {\n    const { at, styles, words, value, model, rows, held, editing, act, edit, reveal, storageKey } = props;\n    const m = words.m;\n    const side = useSide(props, \"states\", at, value.states.name);\n    const { created } = side.state;\n    const lanes = getSomeorUndefined(value.lanes);\n    const keys = rows.keys.states;\n    const keyed = created && side.writes && !editing.builds(\"states\");\n    const key = useKeyField(keys, at, keyed, m, side.issues);\n    const specs = useMemo(() => Fields.specs(StateRolesForm, {\n        label: Fields.text({ label: m.inspectorField({ field: \"label\" }) }),\n        lane: Fields.reference({ of: \"lanes\", label: lanes?.name ?? \"\" }),\n    }, lanes === undefined ? [\"lane\"] : []), [m, lanes]);\n    const options = useMemo(() => ({\n        lanes: inKeyOrder(rows.keys.lanes, model.lanes.filter((lane) => lane.band === \"lane\").map((lane): FieldOption => ({ key: lane.key, label: lane.label }))),\n    }), [model.lanes, rows.keys.lanes]);\n    const roles = rows.states.find((state) => stringEqual(state.key, at))?.roles;\n    const stored = held.states.get(at)?.roles;\n    const { bump, refused } = side;\n    const draft = useKeyDraft(keys, at, useCallback((typed: string) => typedKey(props, \"states\", at, typed, bump), [props, at, bump]));\n    const onRole = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        const done = stringEqual(path[0]!, \"label\") ? edit(\"renameState\", (holding) => renameState(holding, at, next as string))\n            : edit(\"moveStates\", (holding) => moveStates(holding, [at], next as string));\n        if (done === false) bump();\n        return done === true || done === false ? undefined : done;\n    }, [at, edit, bump]);\n    if (roles === undefined) return null;\n    const transitions = stateGroups(props, at);\n    // Off where the states' keys can't be typed and their kind builds none: no copy has a key (#1549).\n    const untyped = editing.untyped(\"states\");\n    const actions = !side.writes ? undefined : (\n        <>\n            <Action action=\"duplicate\" words={words} disabled={untyped !== undefined} onClick={() => {\n                const copy = act(\"duplicateState\", (holding) => duplicateState(holding, at));\n                if (copy?.key !== undefined) reveal({ kind: \"state\", key: copy.key });\n            }} />\n            <Action action=\"delete\" words={words} onClick={() => {\n                if (act(\"deleteStates\", (holding) => deleteStates(holding, [at])) !== undefined) reveal(null);\n            }} />\n            {untyped !== undefined && (\n                <Box css={styles.why} data-inspector-why=\"\">{m.keysUntyped({ name: value.states.name.toLocaleLowerCase(words.locale), type: untyped })}</Box>\n            )}\n        </>\n    );\n    const label = roles.label.length === 0 ? undefined : roles.label;\n    return (\n        <Box css={styles.root} data-flowchart-inspector=\"state\">\n            <Head styles={styles} words={words} what={m.inspectorWhat({ what: \"row\", kind: value.states.name, name: at })} name={label}\n                chips={side.state.chip === undefined ? [] : [side.state.chip]} writes={side.writes} />\n            <FlowchartPaneReads styles={styles} kind={props.details.states} at={at} words={words} />\n            <Edits styles={styles} available={side.available} actions={actions}>\n                <RowFields styles={styles} side={side} storageKey={`${storageKey}.inspector.states`} roles={(\n                    <Box css={styles.roleForms} data-inspector-form=\"roles\">\n                        <KeyForm styles={styles} keyField={key} draft={draft} keyed={keyed} refused={refused} words={words}\n                            baseline={created || stored === undefined ? NEW_ROW : { key: keys.keyOf(at) }} writes={side.writes} />\n                        <FieldForm key={refused} specs={specs} value={{ label: roles.label, lane: getSomeorUndefined(roles.lane) }}\n                            baseline={created || stored === undefined ? NEW_ROW : { label: stored.label, lane: getSomeorUndefined(stored.lane) }}\n                            options={options} onChange={side.writes ? onRole : NO_EDIT} readOnly={!side.writes} />\n                    </Box>\n                )} />\n            </Edits>\n            <Transitions styles={styles} reveal={reveal} groups={transitions.groups}\n                title={m.inspectorSection({ section: \"transitions\", n: transitions.n, count: words.number(transitions.n), name: kindName(value, \"transitions\") })} />\n        </Box>\n    );\n}\n\n/** A key no state is keyed by — an unresolved end, its ghost: says so, with its transitions; Delete takes them away. */\nfunction GhostView(props: RowViewProps) {\n    const { at, styles, words, value, editing, act, reveal } = props;\n    const m = words.m;\n    const transitions = stateGroups(props, at);\n    const writes = editing.editable(\"transitions\");\n    const actions = !writes ? undefined : (\n        <Action action=\"delete\" words={words} onClick={() => {\n            if (act(\"deleteStates\", (holding) => deleteStates(holding, [at])) !== undefined) reveal(null);\n        }} />\n    );\n    const n = transitions.n;\n    const lower = (sort: FlowchartSort) => kindName(value, sort).toLocaleLowerCase(words.locale);\n    return (\n        <Box css={styles.root} data-flowchart-inspector=\"ghost\">\n            <Head styles={styles} words={words} what={m.inspectorWhat({ what: \"row\", kind: value.states.name, name: at })} name={at} chips={[\"noRow\"]} />\n            <Fact styles={styles} fact=\"ghost\">\n                {m.inspectorNoRow({ n, count: words.number(n), key: at, state: lower(\"states\"), transition: lower(\"transitions\") })}\n            </Fact>\n            <Transitions styles={styles} reveal={reveal} groups={transitions.groups}\n                title={m.inspectorSection({ section: \"transitions\", n, count: words.number(n), name: kindName(value, \"transitions\") })} />\n            {actions !== undefined && <Edits styles={styles} available={editing.available(\"transitions\")} actions={actions}>{null}</Edits>}\n        </Box>\n    );\n}\n\n// ── A transition ────────────────────────────────────────────────────────────\n\n/** A transition: its head, its ends and its decision, its kind's form — or own Details — Delete, and its evidence. */\nfunction LinkView(props: RowViewProps) {\n    const { at, styles, words, value, model, rows, held, act, edit, reveal, storageKey } = props;\n    const m = words.m;\n    const name = kindName(value, \"transitions\");\n    const side = useSide(props, \"transitions\", at, name);\n    const decisions = getSomeorUndefined(value.decisions);\n    const decisionWords = useDecisionWords(words);\n    const specs = useMemo(() => Fields.specs(TransitionRolesForm, {\n        from: Fields.reference({ of: \"states\", label: m.inspectorField({ field: \"from\" }) }),\n        to: Fields.reference({ of: \"states\", label: m.inspectorField({ field: \"to\" }) }),\n        decision: Fields.reference({ of: \"decisions\", label: decisions?.name ?? \"\" }),\n    }, decisions === undefined ? [\"decision\"] : []), [m, decisions]);\n    // The states the canvas draws as themselves, and the decisions, each in their keys' order: a choice always holds its\n    // own value, shown as itself.\n    const options = useMemo(() => ({\n        states: inKeyOrder(rows.keys.states, model.nodes.filter((node) => !node.ghost && !node.dimmed)\n            .map((node): FieldOption => ({ key: node.key, label: node.label === undefined ? node.key : m.inspectorChoice({ key: node.key, label: node.label }) }))),\n        decisions: inKeyOrder(rows.keys.decisions, [...model.triggers.values()]\n            .map((trigger): FieldOption => ({ key: trigger.key, label: trigger.label.length === 0 ? trigger.key : trigger.label }))),\n    }), [model, rows.keys, m]);\n    const { bump, refused } = side;\n    const onRole = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        const field = path[0]!;\n        const write = stringEqual(field, \"from\") ? { from: some(next as string), to: none, decision: none }\n            : stringEqual(field, \"to\") ? { from: none, to: some(next as string), decision: none }\n                : { from: none, to: none, decision: some(next as option<string>) };\n        const done = edit(\"editLink\", (holding) => editLink(holding, at, write));\n        if (done === false) bump();\n        return done === true || done === false ? undefined : done;\n    }, [at, edit, bump]);\n    const transition = transitionAt(rows, at);\n    if (transition === undefined) return null;\n    const roles = transition.roles;\n    const stored = held.transitions?.get(at)?.roles;\n    const unresolved = [roles.from, roles.to].some((end) => model.nodesByKey.get(end)?.ghost !== false);\n    const chips: Chip[] = [...(side.state.chip === undefined ? [] : [side.state.chip]), ...(unresolved ? [\"unresolved\" as const] : [])];\n    const evidence = getSomeorUndefined(roles.evidence);\n    const volume = evidence === undefined ? undefined : getSomeorUndefined(evidence.volume);\n    const unit = evidence === undefined ? undefined : getSomeorUndefined(evidence.unit);\n    const actions = !side.writes ? undefined : (\n        <Action action=\"delete\" words={words} onClick={() => {\n            if (act(\"deleteLink\", (holding) => deleteLink(holding, at)) !== undefined) reveal(null);\n        }} />\n    );\n    return (\n        <Box css={styles.root} data-flowchart-inspector=\"transition\">\n            <Head styles={styles} words={words} what={m.inspectorWhat({ what: \"row\", kind: name, name: endsOf(roles) })}\n                name={`${stateName(model, roles.from)} → ${stateName(model, roles.to)}`} chips={chips} writes={side.writes} />\n            <FlowchartPaneReads styles={styles} kind={props.details.transitions} at={at} words={words} />\n            <Edits styles={styles} available={side.available} actions={actions}>\n                <RowFields styles={styles} side={side} storageKey={`${storageKey}.inspector.transitions`} roles={(\n                    <Box css={styles.roleForms} data-inspector-form=\"roles\">\n                        <FieldForm key={refused} specs={specs} value={{ from: roles.from, to: roles.to, decision: roles.decision }}\n                            baseline={side.state.created || stored === undefined ? NEW_ROW : { from: stored.from, to: stored.to, decision: stored.decision }}\n                            options={options} onChange={side.writes ? onRole : NO_EDIT} readOnly={!side.writes} words={decisionWords} />\n                    </Box>\n                )} />\n            </Edits>\n            {evidence !== undefined && (\n                <Box css={styles.section} data-inspector-evidence=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"evidence\", n: 0, count: \"\", name })}</Box>\n                    <FieldForm specs={EVIDENCE_SPECS(m)} onChange={NO_EDIT} readOnly value={{\n                        volume: volume === undefined ? none : some(unit === undefined ? words.number(volume) : `${words.number(volume)} ${unit}`),\n                        count: evidence.count,\n                        measured: evidence.measuredAt,\n                    }} />\n                </Box>\n            )}\n        </Box>\n    );\n}\n\n/** The evidence's form, read only: its specs, made once for a message table. */\nconst evidenceSpecs = new WeakMap<FlowchartWords[\"m\"], readonly FieldSpecValue[]>();\n\n/**\n * The evidence's specs for a message table, made once.\n *\n * @param m - The message table\n * @returns The specs\n */\nfunction EVIDENCE_SPECS(m: FlowchartWords[\"m\"]): readonly FieldSpecValue[] {\n    let specs = evidenceSpecs.get(m);\n    if (specs === undefined) {\n        specs = Fields.specs(EvidenceForm, {\n            volume: Fields.readonly({ label: m.inspectorField({ field: \"volume\" }) }),\n            count: Fields.readonly({ label: m.inspectorField({ field: \"count\" }) }),\n            measured: Fields.readonly({ label: m.inspectorField({ field: \"measured\" }) }),\n        });\n        evidenceSpecs.set(m, specs);\n    }\n    return specs;\n}\n\n// ── A decision ──────────────────────────────────────────────────────────────\n\n/** A decision: its head, its key and its kind's form — or own Details — Delete, and the transitions it governs. */\nfunction DecisionView(props: RowViewProps) {\n    const { at, styles, words, value, model, act, reveal, storageKey } = props;\n    const m = words.m;\n    const name = kindName(value, \"decisions\");\n    const side = useSide(props, \"decisions\", at, name);\n    const specs = useMemo(() => Fields.specs(DecisionKeyForm, { key: Fields.readonly({ label: m.inspectorField({ field: \"key\" }) }) }), [m]);\n    const trigger = model.triggers.get(at);\n    if (trigger === undefined) return null;\n    const lines = linkLines(props, (roles) => roles.decision.type === \"some\" && stringEqual(roles.decision.value, at));\n    const actions = !side.writes ? undefined : (\n        <Action action=\"delete\" words={words} onClick={() => {\n            if (act(\"deleteDecision\", (holding) => deleteDecision(holding, at)) !== undefined) reveal(null);\n        }} />\n    );\n    return (\n        <Box css={styles.root} data-flowchart-inspector=\"decision\">\n            <Head styles={styles} words={words} what={m.inspectorWhat({ what: \"row\", kind: name, name: trigger.letter })}\n                name={trigger.label.length === 0 ? undefined : trigger.label} chips={side.state.chip === undefined ? [] : [side.state.chip]} writes={side.writes} />\n            <Edits styles={styles} available={side.available} actions={actions}>\n                <RowFields styles={styles} side={side} storageKey={`${storageKey}.inspector.decisions`} roles={(\n                    <Box css={styles.roleForms} data-inspector-form=\"roles\">\n                        <FieldForm specs={specs} value={{ key: at }} onChange={NO_EDIT} readOnly />\n                    </Box>\n                )} />\n            </Edits>\n            <Transitions styles={styles} reveal={reveal} groups={[{ key: \"governs\", head: undefined, lines }]}\n                title={m.inspectorSection({ section: \"governs\", n: lines.length, count: words.number(lines.length), name: kindName(value, \"transitions\") })} />\n        </Box>\n    );\n}\n\n// ── A lane ──────────────────────────────────────────────────────────────────\n\n/** A lane: its head, its key and its label, its kind's form — or own Details — how many states it holds, and Delete. */\nfunction LaneView(props: RowViewProps) {\n    const { at, styles, words, value, model, rows, held, editing, act, edit, reveal, storageKey } = props;\n    const m = words.m;\n    const name = kindName(value, \"lanes\");\n    const side = useSide(props, \"lanes\", at, name);\n    const { created } = side.state;\n    const keys = rows.keys.lanes;\n    const keyed = created && side.writes && !editing.builds(\"lanes\");\n    const key = useKeyField(keys, at, keyed, m, side.issues);\n    const specs = useMemo(() => Fields.specs(LaneRolesForm, {\n        label: Fields.text({ label: m.inspectorField({ field: \"label\" }) }),\n    }), [m]);\n    const { bump, refused } = side;\n    const draft = useKeyDraft(keys, at, useCallback((typed: string) => typedKey(props, \"lanes\", at, typed, bump), [props, at, bump]));\n    const onRole = useCallback((_path: readonly string[], next: unknown): string | undefined => {\n        const done = edit(\"renameLane\", (holding) => renameLane(holding, at, next as string));\n        if (done === false) bump();\n        return done === true || done === false ? undefined : done;\n    }, [at, edit, bump]);\n    const lane = rows.lanes?.find((row) => stringEqual(row.key, at));\n    if (lane === undefined) return null;\n    const stored = held.lanes?.get(at)?.roles;\n    const holds = model.laneStates.get(at) ?? 0;\n    const states = value.states.name.toLocaleLowerCase(words.locale);\n    const actions = !side.writes ? undefined : (\n        <>\n            <Action action=\"delete\" words={words} disabled={holds > 0} onClick={() => {\n                if (act(\"deleteLane\", (holding) => deleteLane(holding, at)) !== undefined) reveal(null);\n            }} />\n            {holds > 0 && <Box css={styles.why} data-inspector-why=\"\">{m.laneHoldsStates({ n: holds, count: words.number(holds), name: states })}</Box>}\n        </>\n    );\n    return (\n        <Box css={styles.root} data-flowchart-inspector=\"lane\">\n            <Head styles={styles} words={words} what={m.inspectorWhat({ what: \"row\", kind: name, name: laneLabel(model, at) })} name={undefined}\n                chips={side.state.chip === undefined ? [] : [side.state.chip]} writes={side.writes} />\n            <Edits styles={styles} available={side.available} actions={actions}>\n                <RowFields styles={styles} side={side} storageKey={`${storageKey}.inspector.lanes`} roles={(\n                    <Box css={styles.roleForms} data-inspector-form=\"roles\">\n                        <KeyForm styles={styles} keyField={key} draft={draft} keyed={keyed} refused={refused} words={words}\n                            baseline={created || stored === undefined ? NEW_ROW : { key: keys.keyOf(at) }} writes={side.writes} />\n                        <FieldForm key={refused} specs={specs} value={{ label: lane.roles.label }}\n                            baseline={created || stored === undefined ? NEW_ROW : { label: stored.label }}\n                            onChange={side.writes ? onRole : NO_EDIT} readOnly={!side.writes} />\n                    </Box>\n                )} />\n            </Edits>\n            <Fact styles={styles} fact=\"lane\">{m.inspectorLaneStates({ n: holds, count: words.number(holds), name: states })}</Fact>\n        </Box>\n    );\n}\n\n// ── Several states ──────────────────────────────────────────────────────────\n\n/** Several states: how many; the lane every one moves to; and Delete. */\nfunction SeveralView(props: ViewProps & { readonly picked: readonly string[] }) {\n    const { picked, styles, words, value, model, editing, act, edit, reveal } = props;\n    const m = words.m;\n    const lanes = getSomeorUndefined(value.lanes);\n    const writes = editing.editable(\"states\");\n    const specs = useMemo(() => Fields.specs(MoveForm, {\n        lane: Fields.reference({ of: \"lanes\", label: m.inspectorField({ field: \"moveTo\", name: (lanes?.name ?? \"\").toLocaleLowerCase(words.locale) }) }),\n    }), [m, lanes, words.locale]);\n    const keys = props.rows.keys.lanes;\n    const options = useMemo(() => ({\n        lanes: inKeyOrder(keys, model.lanes.filter((lane) => lane.band === \"lane\").map((lane): FieldOption => ({ key: lane.key, label: lane.label }))),\n    }), [model.lanes, keys]);\n    const [refused, bump] = useRefused();\n    const onChange = useCallback((_path: readonly string[], next: unknown): string | undefined => {\n        const done = edit(\"moveStates\", (holding) => moveStates(holding, picked, next as string));\n        if (done === false) bump();\n        return done === true || done === false ? undefined : done;\n    }, [edit, picked, bump]);\n    // The lane they share, when they do.\n    const held = picked.map((key) => model.nodesByKey.get(key)?.lane);\n    const first = held[0];\n    const shared = first !== undefined && held.every((lane) => lane !== undefined && stringEqual(lane, first)) ? first : undefined;\n    const n = picked.length;\n    const actions = !writes ? undefined : (\n        <Action action=\"delete\" words={words} onClick={() => {\n            if (act(\"deleteStates\", (holding) => deleteStates(holding, picked)) !== undefined) reveal(null);\n        }} />\n    );\n    return (\n        <Box css={styles.root} data-flowchart-inspector=\"several\">\n            <Box css={styles.head} {...FOCUS_HOME_PROPS}>\n                <Box css={styles.summary} data-inspector-several=\"\">\n                    {m.inspectorWhat({ what: \"several\", n, count: words.number(n), name: value.states.name.toLocaleLowerCase(words.locale) })}\n                </Box>\n            </Box>\n            {(lanes !== undefined || actions !== undefined) && (\n                <Edits styles={styles} available={writes && editing.available(\"states\")} actions={actions}>\n                    {lanes !== undefined && (\n                        <Box css={styles.bulk} data-inspector-fields=\"move\">\n                            <FieldForm key={refused} specs={specs} value={{ lane: shared }} options={options}\n                                onChange={writes ? onChange : NO_EDIT} readOnly={!writes} />\n                        </Box>\n                    )}\n                </Edits>\n            )}\n        </Box>\n    );\n}\n\n// ── Nothing selected: the flowchart ─────────────────────────────────────────\n\n/** Nothing selected: the flowchart's counts, its transitions' split, each record's last save with who made it, and its hints. */\nfunction FlowchartView({ styles, words, value, model, saves, editing }: ViewProps) {\n    const m = words.m;\n    // In a phone's pane, the hint is a tap's: no several selected or renamed in place there.\n    const touch = useContext(FrameDrawer);\n    const counts = model.counts;\n    const stats = [\n        ...(value.lanes.type === \"some\" ? [{ key: \"lanes\", name: value.lanes.value.name, n: counts.lanes }] : []),\n        { key: \"states\", name: value.states.name, n: counts.states },\n        ...(value.transitions.type === \"some\" ? [{ key: \"transitions\", name: value.transitions.value.name, n: counts.transitions }] : []),\n        ...(value.decisions.type === \"some\" ? [{ key: \"decisions\", name: value.decisions.value.name, n: counts.decisions }] : []),\n    ];\n    const hints = editing.edits ? [1, 2, 3] as const : [1, 2] as const;\n    return (\n        <Box css={styles.root} data-flowchart-inspector=\"flowchart\">\n            <Box css={styles.head} {...FOCUS_HOME_PROPS}>\n                <Box css={styles.eyebrow} data-inspector-what=\"\">{m.inspectorWhat({ what: \"flowchart\" })}</Box>\n            </Box>\n            <Box css={styles.stats} data-inspector-counts=\"\">\n                {stats.map((stat) => (\n                    <Box key={stat.key} css={styles.stat} data-count={stat.key}>\n                        <Box as=\"span\" css={styles.statValue}>{words.number(stat.n)}</Box>\n                        <Box as=\"span\" css={styles.statLabel}>{m.inspectorCount({ name: stat.name, n: stat.n })}</Box>\n                    </Box>\n                ))}\n            </Box>\n            {value.transitions.type === \"some\" && (\n                <Fact styles={styles} fact=\"split\">\n                    {m.inspectorSplit({ planned: words.number(counts.planned), observed: words.number(counts.observed), unresolved: words.number(counts.unresolved) })}\n                </Fact>\n            )}\n            {saves.records.length > 0 && (\n                <Box css={styles.section}>\n                    {saves.records.map((save) => (\n                        <Box key={save.sort} css={styles.fact} data-inspector-saved={save.sort}>{m.inspectorSaved({ name: save.name, when: save.when, by: save.by })}</Box>\n                    ))}\n                </Box>\n            )}\n            <Box as=\"ul\" css={styles.hints}>\n                {touch ? <Box as=\"li\" css={styles.hint}>{m.inspectorHintTouch()}</Box>\n                    : hints.map((n) => <Box as=\"li\" key={n} css={styles.hint}>{m.inspectorHint({ n, edits: editing.edits })}</Box>)}\n            </Box>\n        </Box>\n    );\n}\n\n// ============================================================================\n// Issues (R16)\n// ============================================================================\n\n/**\n * The Issues tab: every issue of the Flowchart and of its unsaved changes, each a control that selects what it names and\n * brings it into view, the field it names taking the keyboard in its Details. An issue of a change the narrowing hides\n * says on a line of its own which of the rail's choices hide its row, asked of e3 through its source's hidden pick, and\n * Go to issue on it is the frame's hidden pick (`goToWaiting`): those choices cleared, then selected once it is drawn.\n */\nconst FlowchartInspectorIssues = memo(function FlowchartInspectorIssues({ issues, value, picks, reveal, goToWaiting, ask, words }: FlowchartInspectorProps) {\n    const styles = useSlotRecipe({ key: \"flowchartInspector\" })() as Styles;\n    const m = words.m;\n    // Each issue's rows of the rail's sources whose narrowing hides what it names: each source's hidden pick, and the row.\n    const hidingsOf = (issue: FlowchartIssue): RowHiding[] => issue.hiding.flatMap((hiding) => {\n        const pick = picks.get(hiding.sort);\n        return pick === undefined ? [] : [{ pick, id: hiding.key }];\n    });\n    const hidings = issues.flatMap(hidingsOf);\n    // The narrowing hides each, as the Flowchart knows: each says so at once while e3 is asked which choices do — asked\n    // once at its record's revision and its narrowing, so a render that moves neither asks nothing. Asked after every\n    // render: the revision and the narrowing land in renders of their own.\n    useEffect(() => {\n        if (hidings.length > 0) askHiding(hidings, true);\n    });\n    // What hides an issue's row, as far as e3 has said: `undefined` for any other issue, and for one nothing hides.\n    const hiddenOfIssue = (issue: FlowchartIssue): readonly RowHidden[] | undefined => {\n        const of = hidingsOf(issue);\n        return of.length === 0 ? undefined : hiddenOf(of);\n    };\n    // Go to issue: what it names selected and brought into view — a change the narrowing hides through the frame's hidden\n    // pick, the choices hiding it cleared first. Its row's Details is asked for the field it names, as the toolbar's issue\n    // gone to asks, so Details opens where it is fixed; an issue naming none drops an earlier ask, which would otherwise\n    // take the keyboard when that row's Details is next drawn.\n    const goTo = (issue: FlowchartIssue) => {\n        const sort = issue.where.sort;\n        if (sort !== undefined && issue.at !== null && issue.at.kind !== \"states\") {\n            ask(sort, issue.at.key, issue.field === undefined ? none : some(issue.field));\n        }\n        if (issue.at !== null && issue.hiding.length > 0) goToWaiting(issue.at, hiddenOfIssue(issue));\n        else reveal(issue.at);\n    };\n    if (issues.length === 0) {\n        return (\n            <Box css={styles.empty} data-inspector-no-issues=\"\">\n                <Box as=\"span\" css={styles.emptyTitle}>{m.inspectorNoIssues({ part: \"title\" })}</Box>\n                <Box as=\"span\" css={styles.emptyHint}>{m.inspectorNoIssues({ part: \"hint\" })}</Box>\n            </Box>\n        );\n    }\n    return (\n        <Box as=\"ul\" css={styles.issueList} data-inspector-issue-list=\"\">\n            {issues.map((issue, i) => {\n                const hiddenBy = hiddenOfIssue(issue);\n                const hidden = hiddenBy === undefined ? undefined : hiddenLine(hiddenBy, words, m);\n                const sort = issue.where.sort;\n                return (\n                    <Box as=\"li\" key={i}>\n                        <chakra.button type=\"button\" css={styles.issueItem} data-inspector-issue={issue.word.issue} onClick={() => goTo(issue)}>\n                            <Box as=\"span\" css={styles.issueWhere}>{m.issueWhere({ kind: sort === undefined ? undefined : kindName(value, sort), name: issue.where.name })}</Box>\n                            <Box as=\"span\" css={styles.issueMessage} data-kind={issue.blocking ? \"invalid\" : \"warning\"}>{m.issueText(issue.word)}</Box>\n                            {hidden !== undefined && <Box as=\"span\" css={styles.issueHidden} data-inspector-issue-hidden=\"\">{hidden}</Box>}\n                        </chakra.button>\n                    </Box>\n                );\n            })}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's issues (#1504, `Flowchart Records Spec.md` R6, R7, R11,\n * R12, R16, D3, D12) — pure and React-free: what the inspector's Issues tab\n * lists, each naming what a click on it selects, and the field it names, if\n * any, which the click asks of its row's Details.\n *\n * - **An end no state is keyed by** — a transition's end the canvas draws as a\n *   ghost. Under `\"hide\"` such an end is read by key first: one the states'\n *   narrowing hides takes its transition off the canvas with it, and is no\n *   issue (D7).\n * - **A state whose lane names no lane** — or that names none, while lanes are\n *   given — drawn in the last band, *No lane* (D12).\n * - **A transition whose decision names none** of the decisions the Flowchart\n *   is given.\n * - **The details' counts no bin holds** — a row's histogram counting at no\n *   edge of the flowchart's bins, or counting what is no count — and **the bins\n *   the app binds** that hold no edge, one that is no finite number, or two\n *   that do not ascend (R38, `details.ts`). A details row keyed as no row drawn\n *   is no issue.\n * - **A number its field's bounds don't hold** (#1585) — a row drawn whose\n *   number is under its least or over its most, by its field's label and the\n *   bound in its hint's own words, `Slices: at least 1`. A changed row's is\n *   its session's readiness, which holds Save off; any other row's warns.\n * - **A draft waiting in its session**, the narrowing hiding its row: listed\n *   with the rows of the rail's sources whose narrowing leaves it out, which the\n *   inspector names the choices of (the shared hidden pick) and Go to issue\n *   clears (R11).\n * - **The app's `ready` refusals** — the key check's among them, a new key e3\n *   holds already (D3) — which hold Save off (R12).\n * - **A Save's conflict or refusal**, while it stands.\n *\n * The last two block, and come first; the rest warn, and Save goes ahead with\n * them. What the narrowing draws as context (`\"dim\"`) raises no issue: no path\n * selects it.\n *\n * A Save's conflict names each side's value as the canvas names that row — a\n * state's lane by the lane's label, a transition's ends by their states' and\n * its decision by the decision's — never a key ({@link conflictValueName}),\n * each read at the key type of the kind it names (#1549).\n *\n * @packageDocumentation\n */\n\nimport { OptionType, StringType, equalFor, fromEastTypeValue, isValueOf, type PatchPath, type option } from \"@elaraai/east\";\nimport type { EditIssue, EditSession, FieldBreach } from \"@elaraai/east-ui-components\";\nimport { breachOf } from \"../shared/bounds.js\";\nimport type { FlowchartBinsRefusalWord, FlowchartDetailsFinding } from \"./details.js\";\nimport type { FlowchartWaiting } from \"./drafted.js\";\nimport type { FlowchartDecisionRoles, FlowchartModel, FlowchartRow, FlowchartTransitionRoles } from \"./model.js\";\nimport type { FlowchartSort } from \"./read.js\";\nimport type { FlowchartSelection } from \"./selection.js\";\n\nconst keyEqual = equalFor(StringType);\n\n/** A row of a source of the rail whose narrowing leaves out what an issue names: the source's kind, and the row's key. */\nexport interface FlowchartHiding {\n    /** The kind read through the source. */\n    readonly sort: \"states\" | \"transitions\";\n    /** The row's key in its record. */\n    readonly key: string;\n}\n\n/** What an issue says, before its words. */\nexport type FlowchartIssueWord =\n    /** A transition, named by its ends, naming states no row is keyed by — by their keys. */\n    | { readonly issue: \"end\"; readonly link: string; readonly missing: readonly string[] }\n    /** A state naming a lane the Flowchart has none of, by its key — or naming none. */\n    | { readonly issue: \"lane\"; readonly state: string; readonly lane: string | undefined }\n    /** A transition, named by its ends, naming a decision the Flowchart has none of, by its key. */\n    | { readonly issue: \"decision\"; readonly link: string; readonly decision: string }\n    /** A row's histogram holding counts no bin holds, by the row's name and the read's label. */\n    | { readonly issue: \"counts\"; readonly name: string; readonly read: string }\n    /** A histogram's bins, as the app binds them, refused, by the read's label: why, its numbers in the app's locale. */\n    | { readonly issue: \"bins\"; readonly read: string; readonly refusal: FlowchartBinsRefusalWord }\n    /**\n     * The rail's source whose picks would weigh a kind's details narrowing another record than they read (#1522), by\n     * the kind's name and the source's: the details draw each row's own.\n     */\n    | { readonly issue: \"weighed\"; readonly kind: string; readonly source: string }\n    /** A change waiting on Save that the narrowing hides, by the row's name. */\n    | { readonly issue: \"waiting\"; readonly name: string }\n    /** The app's check — or the key check — refusing a drafted row, which holds Save off, in its own words. */\n    | { readonly issue: \"ready\"; readonly message: string }\n    /** A number its field's bounds don't hold (#1585): its field's label, and the bound in its hint's own words. */\n    | { readonly issue: \"bounds\"; readonly field: string; readonly bound: string }\n    /** A Save's conflict or refusal, in the source's own words. */\n    | { readonly issue: \"save\"; readonly message: string };\n\n/** One issue, as the Issues tab lists it. */\nexport interface FlowchartIssue {\n    /** What a click on it selects, as the canvas selects it; `null`, the Flowchart itself — what nothing selected shows. */\n    readonly at: FlowchartSelection | null;\n    /** Whether it blocks — the app's check holds Save, or a Save was stopped — rather than warns. */\n    readonly blocking: boolean;\n    /** What it names: its kind — `undefined` for a record's words that name no row — and its name, as the Flowchart names it. */\n    readonly where: { readonly sort: FlowchartSort | undefined; readonly name: string };\n    /**\n     * The rows of the rail's sources whose narrowing leaves out what it names — a draft waiting in its session: its own\n     * row, or a transition's ends the states' narrowing hides; none for what the canvas draws.\n     */\n    readonly hiding: readonly FlowchartHiding[];\n    /** What it says. */\n    readonly word: FlowchartIssueWord;\n    /**\n     * The field it names, by its form's key: a click on it asks its row's Details for it, and it takes the keyboard\n     * there, as it does for the toolbar's issue gone to. `undefined` for an issue naming none.\n     */\n    readonly field?: string | undefined;\n}\n\n/** A number its field's bounds don't hold, as Issues says it (#1585). */\nexport interface FlowchartBreachWords {\n    /** Its field's label. */\n    readonly field: string;\n    /** The bound, in its field's hint's own words — `at least 1`. */\n    readonly bound: string;\n}\n\n/** A row drawn whose number its field's bounds don't hold, no change of it holding Save (#1585). */\nexport interface FlowchartBreach extends FlowchartBreachWords {\n    /** Its kind. */\n    readonly sort: FlowchartSort;\n    /** Its key. */\n    readonly key: string;\n    /** The field, by its form's key: what a click on its issue asks of its row's Details. */\n    readonly fieldKey: string;\n}\n\n/** What the issues are worked out from. */\nexport interface FlowchartIssueArgs {\n    /** What the canvas draws, the drafts in place. */\n    readonly model: FlowchartModel;\n    /** The transitions it draws, the drafts in place — those in place among them. */\n    readonly transitions: readonly FlowchartRow<FlowchartTransitionRoles>[];\n    /** The drafted rows waiting in their sessions (`drafted.ts`). */\n    readonly waiting: readonly FlowchartWaiting[];\n    /** The transitions held but hidden with their far end (`read.ts`' `hiddenWith`). */\n    readonly hiddenWith: ReadonlySet<string>;\n    /** The states the read holds, by key: a waiting transition's end it does not hold is one the narrowing hides. */\n    readonly stored: ReadonlyMap<string, unknown>;\n    /** Whether the Flowchart is given decisions: a transition naming one it has none of is an issue only then. */\n    readonly decisions: boolean;\n    /** What the details model finds (`details.ts`): the bins the app binds refused, and the rows' counts no bin holds. */\n    readonly details: readonly FlowchartDetailsFinding[];\n    /** The rows drawn whose numbers their fields' bounds don't hold, none of them changed so (#1585); none unless given. */\n    readonly breaches?: readonly FlowchartBreach[] | undefined;\n}\n\n/**\n * What the canvas selects a row of a kind as, by its key.\n *\n * @param sort - The row's kind\n * @param key - Its key\n * @returns The selection\n */\nexport function selectionOf(sort: FlowchartSort, key: string): FlowchartSelection {\n    switch (sort) {\n        case \"states\": return { kind: \"state\", key };\n        case \"transitions\": return { kind: \"link\", key };\n        case \"lanes\": return { kind: \"lane\", key };\n        case \"decisions\": return { kind: \"trigger\", key };\n    }\n}\n\n/** How the issues name rows, and what hides one that waits. */\ninterface IssueReader {\n    /**\n     * A row's name, as the inspector's head names it: a state by its key, a transition by its ends' keys, a lane by its\n     * label — else its key — and a decision by its diamond's letter.\n     */\n    readonly nameOf: (sort: FlowchartSort, key: string) => string;\n    /** The rows of the rail's sources whose narrowing leaves out a row waiting in its session; none for a row drawn. */\n    readonly hidingOf: (sort: FlowchartSort, key: string) => readonly FlowchartHiding[];\n}\n\n/**\n * A decision's diamond's letter, as the model gives it: its own, else its label's first, upper case.\n *\n * @param roles - The decision's roles\n * @returns The letter\n */\nfunction letterOf(roles: FlowchartDecisionRoles): string {\n    if (roles.letter.type === \"some\") return roles.letter.value;\n    return roles.label.length > 0 ? roles.label.charAt(0).toUpperCase() : \"?\";\n}\n\n/** The issues' namer over what they are worked out from. */\nfunction readerOf(args: FlowchartIssueArgs): IssueReader {\n    const { model, transitions, waiting, hiddenWith, stored } = args;\n    const waits = (sort: FlowchartSort, key: string): FlowchartWaiting | undefined =>\n        waiting.find((row) => row.sort === sort && keyEqual(row.key, key));\n    const nameOf = (sort: FlowchartSort, key: string): string => {\n        switch (sort) {\n            case \"states\": return key;\n            case \"transitions\": {\n                const drawn = transitions.find((t) => keyEqual(t.key, key))?.roles;\n                const row = waits(\"transitions\", key);\n                const roles = drawn ?? (row?.sort === \"transitions\" ? row.roles : undefined);\n                return roles === undefined ? key : `${roles.from} → ${roles.to}`;\n            }\n            case \"lanes\": {\n                const lane = model.lanes.find((l) => l.band === \"lane\" && keyEqual(l.key, key));\n                if (lane !== undefined) return lane.label;\n                const row = waits(\"lanes\", key);\n                return row?.sort === \"lanes\" && row.roles.label.length > 0 ? row.roles.label : key;\n            }\n            case \"decisions\": {\n                const trigger = model.triggers.get(key);\n                if (trigger !== undefined) return trigger.letter;\n                const row = waits(\"decisions\", key);\n                return row?.sort === \"decisions\" ? letterOf(row.roles) : key;\n            }\n        }\n    };\n    const hidingOf = (sort: FlowchartSort, key: string): readonly FlowchartHiding[] => {\n        const row = waits(sort, key);\n        if (row === undefined) return [];\n        if (row.sort === \"states\") return [{ sort: \"states\", key }];\n        if (row.sort !== \"transitions\") return [];\n        if (!hiddenWith.has(key)) return [{ sort: \"transitions\", key }];\n        // Hidden with its far end: the end the states' narrowing hides — the read holds no state of its key.\n        const { from, to } = row.roles;\n        return [from, to].filter((end, i) => !stored.has(end) && (i === 0 || !keyEqual(from, to))).map((end) => ({ sort: \"states\" as const, key: end }));\n    };\n    return { nameOf, hidingOf };\n}\n\n/**\n * The Flowchart's own issues (see the module docs), each a warning: the states\n * standing in *No lane*, in their band's order; then the transitions', in\n * their keys' order at their key type — an end no state is keyed by, a decision\n * the Flowchart has none of;\n * then the details', as the details model finds them — each kind's refused\n * bins, naming the kind and selecting the Flowchart, then its rows' counts no\n * bin holds, each selecting its row; then the rows' numbers their fields'\n * bounds don't hold, as given, each naming its field; then each draft waiting\n * in its session, each kind's in its drafts' order.\n *\n * @param args - What the canvas draws, its transitions, the drafts waiting, the transitions hidden with their far end,\n *   the states read, whether decisions are given, what the details model finds, and the rows' breaches\n * @returns The issues\n */\nexport function flowchartIssues(args: FlowchartIssueArgs): FlowchartIssue[] {\n    const { model, transitions, waiting, decisions, details } = args;\n    const { nameOf, hidingOf } = readerOf(args);\n    const out: FlowchartIssue[] = [];\n    const warn = (at: FlowchartSelection, where: FlowchartIssue[\"where\"], word: FlowchartIssueWord, hiding: readonly FlowchartHiding[] = [], field?: string) =>\n        out.push({ at, blocking: false, where, hiding, word, field });\n    for (const key of model.noLane) {\n        const node = model.nodesByKey.get(key);\n        if (node === undefined || node.dimmed) continue;\n        warn({ kind: \"state\", key }, { sort: \"states\", name: key }, { issue: \"lane\", state: key, lane: node.lane });\n    }\n    const ghost = (key: string): boolean => model.nodesByKey.get(key)?.ghost === true;\n    const byKey = new Map(transitions.map((transition) => [transition.key, transition] as const));\n    for (const { text } of model.keys.transitions.order(byKey.keys())) {\n        const transition = byKey.get(text)!;\n        if (transition.dimmed) continue;\n        const { key } = transition;\n        const { from, to } = transition.roles;\n        const link = nameOf(\"transitions\", key);\n        const where = { sort: \"transitions\" as const, name: link };\n        const missing = [from, to].filter((end, i) => ghost(end) && (i === 0 || !keyEqual(from, to)));\n        if (missing.length > 0) warn({ kind: \"link\", key }, where, { issue: \"end\", link, missing });\n        const decision = transition.roles.decision;\n        if (decisions && decision.type === \"some\" && !model.triggers.has(decision.value)) {\n            warn({ kind: \"link\", key }, where, { issue: \"decision\", link, decision: decision.value });\n        }\n    }\n    // What the narrowing draws as context raises none: no path selects it.\n    const dimmed = (sort: \"states\" | \"transitions\", key: string): boolean => (sort === \"states\"\n        ? model.nodesByKey.get(key)?.dimmed === true\n        : transitions.some((t) => t.dimmed && keyEqual(t.key, key)));\n    for (const found of details) {\n        if (found.finding === \"bins\") {\n            out.push({ at: null, blocking: false, where: { sort: undefined, name: found.kind }, hiding: [], word: { issue: \"bins\", read: found.read, refusal: found.refusal } });\n            continue;\n        }\n        if (found.finding === \"weighed\") {\n            out.push({ at: null, blocking: false, where: { sort: undefined, name: found.kind }, hiding: [], word: { issue: \"weighed\", kind: found.kind, source: found.source } });\n            continue;\n        }\n        if (dimmed(found.sort, found.key)) continue;\n        const name = nameOf(found.sort, found.key);\n        warn(selectionOf(found.sort, found.key), { sort: found.sort, name }, { issue: \"counts\", name, read: found.read });\n    }\n    for (const breach of args.breaches ?? []) {\n        warn(selectionOf(breach.sort, breach.key), { sort: breach.sort, name: nameOf(breach.sort, breach.key) },\n            { issue: \"bounds\", field: breach.field, bound: breach.bound }, [], breach.fieldKey);\n    }\n    for (const row of waiting) {\n        const name = nameOf(row.sort, row.key);\n        warn(selectionOf(row.sort, row.key), { sort: row.sort, name }, { issue: \"waiting\", name }, hidingOf(row.sort, row.key));\n    }\n    return out;\n}\n\n/** A record's session as Issues reads it: the kind it is, and where its Save stands. */\nexport interface FlowchartIssueSession {\n    /** The record's key in the history: its kind. */\n    readonly kind: string;\n    /** Its session: where its latest Save stands, its source's words, and its drafts' readiness. */\n    readonly session: Pick<EditSession<unknown>, \"status\" | \"issues\" | \"readiness\">;\n}\n\n/** Whether a record's key in the history names one of the Flowchart's kinds. */\nfunction isSort(kind: string): kind is FlowchartSort {\n    return kind === \"states\" || kind === \"transitions\" || kind === \"lanes\" || kind === \"decisions\";\n}\n\n/**\n * The issues each record's session raises (see the module docs): the app's\n * check — the key check's among it — refusing its drafted rows, a changed\n * row's number its field's bounds don't hold among them, and its latest Save's\n * conflict or refusal while it stands; each blocking, naming its row — one\n * waiting in its session with the rows of the rail's sources hiding it — and\n * the field the source's issue names.\n *\n * @param sessions - Each record's session\n * @param args - What the canvas draws, as {@link flowchartIssues} takes it: what names a row, and what hides one waiting\n * @param kindName - A kind's name, as the payload gives it: what a record's words that name no row stand for\n * @param breachWords - A breach of a kind's form in Issues' words (#1585): its field's label and its bound; a breach\n *   says its bound alone unless given\n * @returns The issues, in the sessions' order\n */\nexport function sessionIssues(sessions: readonly FlowchartIssueSession[], args: FlowchartIssueArgs,\n    kindName: (sort: FlowchartSort) => string, breachWords?: (sort: FlowchartSort, breach: FieldBreach) => FlowchartBreachWords): FlowchartIssue[] {\n    const { nameOf, hidingOf } = readerOf(args);\n    const out: FlowchartIssue[] = [];\n    for (const part of sessions) {\n        if (!isSort(part.kind)) continue;\n        const sort = part.kind;\n        const raise = (issue: EditIssue, word: FlowchartIssueWord) => {\n            // The source's own words name no row: they stand for the kind's record.\n            const row = keyEqual(issue.entry, \"\") ? undefined : issue.entry;\n            out.push({\n                at: row === undefined ? null : selectionOf(sort, row), blocking: true,\n                where: { sort: row === undefined ? undefined : sort, name: row === undefined ? kindName(sort) : nameOf(sort, row) },\n                hiding: row === undefined ? [] : hidingOf(sort, row),\n                word,\n                field: row === undefined || issue.field.type !== \"some\" ? undefined : issue.field.value,\n            });\n        };\n        const readiness = part.session.readiness;\n        if (readiness.type !== \"ready\") {\n            for (const issue of readiness.value) {\n                const breach = breachOf(issue);\n                raise(issue, breach === undefined || breachWords === undefined ? { issue: \"ready\", message: issue.message }\n                    : { issue: \"bounds\", ...breachWords(sort, breach) });\n            }\n        }\n        const status = part.session.status;\n        if (status === \"conflict\" || status === \"rejected\") for (const issue of part.session.issues) raise(issue, { issue: \"save\", message: issue.message });\n    }\n    return out;\n}\n\n/** The fields the kinds' roles name another row's key in (#1503): what a conflict on one is named by. */\nexport interface FlowchartKeyFields {\n    /** The field of a state naming its lane by the lane's key; `undefined` without lanes. */\n    readonly lane: string | undefined;\n    /** The fields of a transition naming its ends by their states' keys; `undefined` without transitions. */\n    readonly ends: readonly [from: string, to: string] | undefined;\n    /** The field of a transition naming its decision by the decision's key; `undefined` without one. */\n    readonly decision: string | undefined;\n}\n\n/**\n * A conflict's value as the canvas names that row, where the value is a key\n * (#1503): a state's lane by the lane's label, a transition's end by its\n * state's label and its decision by the decision's — never a key, as the\n * history bar's conflict card shows each side and what it was.\n *\n * @param sort - The kind whose row conflicts\n * @param path - The conflict's path in the row: one field, through the case of an Option\n * @param value - The value on one side: a key at the key type of the kind its field names (#1549), or an `Option` of one\n * @param fields - The fields the kinds' roles name a key in\n * @param model - The flowchart as its drafts stand, which names each row and holds each kind's keys\n * @returns Its name, or the key's text for a row the flowchart holds none of; `undefined` for any other value, which the card reads as it is\n */\nexport function conflictValueName(sort: FlowchartSort, path: PatchPath, value: unknown, fields: FlowchartKeyFields, model: FlowchartModel): string | undefined {\n    let named: string | undefined;\n    for (const step of path) {\n        if (step.kind !== \"field\") continue;\n        if (named !== undefined) return undefined;\n        named = step.name;\n    }\n    const field = named;\n    if (field === undefined) return undefined;\n    const is = (name: string | undefined): boolean => name !== undefined && keyEqual(name, field);\n    // The kind the field names a row of.\n    const names = sort === \"states\" ? (is(fields.lane) ? \"lanes\" : undefined)\n        : sort !== \"transitions\" ? undefined\n        : fields.ends !== undefined && (is(fields.ends[0]) || is(fields.ends[1])) ? \"states\"\n        : is(fields.decision) ? \"decisions\" : undefined;\n    if (names === undefined) return undefined;\n    const keys = model.keys[names];\n    const keyType = fromEastTypeValue(keys.keyType);\n    let key: { readonly at: unknown } | undefined;\n    if (isValueOf(value, keyType)) key = { at: value };\n    else if (isValueOf(value, OptionType(keyType))) {\n        const held = value as option<unknown>;\n        if (held.type === \"some\") key = { at: held.value };\n    }\n    if (key === undefined) return undefined;\n    const text = keys.textOf(key.at);\n    switch (names) {\n        case \"lanes\": return model.lanes.find((lane) => keyEqual(lane.key, text))?.label ?? text;\n        case \"states\": return model.nodesByKey.get(text)?.label ?? text;\n        case \"decisions\": return model.triggers.get(text)?.label ?? text;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The library pane (#1501, `Flowchart Records Spec.md` R14, D5, D8): the\n * Flowchart's start pane, its tabs the ones `library` lists, in that order,\n * each with its count after its name and a search. A Flowchart whose\n * `library` lists no tab has no pane.\n *\n * - **Steps** (`Flowchart.library.states()`), **Transitions**\n *   (`Flowchart.library.transitions()`) and **Lanes**\n *   (`Flowchart.library.lanes()`) — each its kind's cards, as the kind carries\n *   them (`Flowchart.templates` on the kind): one card per card row, its name,\n *   with the tab's icon or else its kind's, grouped by its `group` and\n *   searched by its name. A tab its author leaves unnamed is named in the\n *   Flowchart's words.\n * - **An author's tab** (`Flowchart.library.tab(rows, …)`) — its cards, each\n *   its label and the line under it, grouped by its `group` and searched by\n *   its key, label and line.\n * - An empty tab says so in the shared empty state; a search that hides\n *   every card, the `Library`'s own `No matches`. Collapsed, the pane is a\n *   rail with the first tab's count — of the cards it shows.\n * - **The narrowing**: a kind's tab follows the source its cards name, an\n *   author's tab the source it names, by its cards' keys — the shared\n *   `sourceTab`: the tab shows the cards its source shows, counts them (`2 of\n *   5`), says so when the rail leaves it none, with the rail's Clear for that\n *   source alone, and while its source resolves holds its cards retained\n *   (#1398, CL8): readable and selectable, aria-disabled, taking no drag, ⏎ or\n *   tap that drops. A tab that follows none lists its cards whole.\n * - **A kind adding no row** (#1549): the Steps' or the Lanes' cards of a kind\n *   whose keys the form can't type, and that builds none, take no drag, ⏎ or\n *   tap that drops, each card's line saying why.\n *\n * Each tab's cards are a `Library`'s, drawn by the shared parts — every icon\n * Font Awesome's solid set, every style the `library` recipe's — and drag\n * from the library `${flowchartKeys(name).library}:<the tab's key>`\n * ({@link flowchartLibraryId}), each card keyed by its row's key: the canvas\n * takes them dropped (`use-drop.ts`). A kind's cards always drag; an author's\n * when its tab's patch names a kind. A card that drops takes ⏎ too — the\n * card, dropped on the canvas's selection — and on a touch screen, or below\n * 480px of main, a tap on the selected card does the same, so no edit needs a\n * precise drag; the tap leaves it selected, for the next. Below 480px of main\n * no card drags. A click selects a card, and a click on the selected card lets\n * it go.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useState } from \"react\";\nimport { Box, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { StringType, equalFor, none, some } from \"@elaraai/east\";\nimport type { flowchartKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    EastChakraLibrary, getSomeorUndefined, useCoarsePointer, type BuilderFrameDock, type LibraryEmpty, type LibraryNarrowing, type LibraryValue,\n} from \"@elaraai/east-ui-components\";\nimport type { FollowedSources } from \"../shared/schedule/follow-sources.js\";\nimport { scheduleLibrary, scheduleLibraryCard } from \"../shared/schedule/library.js\";\nimport { sourceTab, type SourceShown, type SourceTab } from \"../shared/schedule/source-tab.js\";\nimport type { FlowchartLibraryTabWord, FlowchartMessages, FlowchartWords } from \"./messages.js\";\nimport type { FlowchartValue } from \"./model.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The names a Flowchart keeps its viewer's state under. */\ntype FlowchartKeys = ReturnType<typeof flowchartKeys>;\n/** One tab the payload lists, decoded. */\nexport type FlowchartTabValue = FlowchartValue[\"library\"][number];\n/** The kinds whose cards a tab of their own lists. */\nexport type FlowchartCardKind = \"states\" | \"transitions\" | \"lanes\";\n/** What a kind whose cards a tab lists carries of them: its icon, its cards, and the source they follow. */\ntype CardKindValue = Pick<FlowchartValue[\"states\"], \"icon\" | \"templates\" | \"templatesSource\">;\n\nconst stringEqual = equalFor(StringType);\n\n/** The library open: the design system's 272px. */\nconst LIBRARY_SIZE = \"272px\";\n\n/** What a tab that follows no source shows: its cards whole. */\nconst WHOLE: SourceShown = { keys: none, busy: false, ready: true, clear: undefined };\n\n/** A card as the pane lists it, whatever its tab: its key, its name, the line under it, its group, and what its search reads. */\ninterface PaneCard {\n    readonly key: string;\n    readonly label: string;\n    readonly meta: string | undefined;\n    readonly group: string | undefined;\n    readonly search: string;\n}\n\n/**\n * A tab's key among the pane's tabs — and, after the Flowchart's library id,\n * its cards' library's: `states`, `transitions`, `lanes`, or `tab:<its name>`.\n *\n * @param tab - The tab\n * @returns Its key\n */\nexport function flowchartTabKey(tab: FlowchartTabValue): string {\n    return tab.type === \"tab\" ? `tab:${tab.value.name}` : tab.type;\n}\n\n/**\n * The library a tab's cards drag from — the libraries the canvas takes drops\n * from.\n *\n * @param keys - The Flowchart's keys\n * @param tabKey - The tab's key ({@link flowchartTabKey})\n * @returns The library's id\n */\nexport function flowchartLibraryId(keys: FlowchartKeys, tabKey: string): string {\n    return `${keys.library}:${tabKey}`;\n}\n\n/**\n * A kind whose cards a tab lists, as the payload carries it.\n *\n * @param value - The payload\n * @param kind - The kind\n * @returns Its icon, its cards and their source; `undefined` for a kind the Flowchart is not given\n */\nexport function cardKindOf(value: FlowchartValue, kind: FlowchartCardKind): CardKindValue | undefined {\n    switch (kind) {\n        case \"states\": return value.states;\n        case \"transitions\": return getSomeorUndefined(value.transitions);\n        case \"lanes\": return getSomeorUndefined(value.lanes);\n    }\n}\n\n/**\n * The source of the rail a tab follows: a kind's tab its cards', an author's\n * tab its own — each when it names one.\n *\n * @param value - The payload\n * @param tab - The tab\n * @returns The source's name; `undefined` for a tab that follows none\n */\nexport function flowchartTabSource(value: FlowchartValue, tab: FlowchartTabValue): string | undefined {\n    if (tab.type === \"tab\") return getSomeorUndefined(tab.value.source);\n    const kind = cardKindOf(value, tab.type);\n    return kind === undefined ? undefined : getSomeorUndefined(kind.templatesSource);\n}\n\n/**\n * A tab's name: an author's tab's own; a kind's tab its author's, or the\n * Flowchart's words for it — `Steps`, `Transitions`, `Lanes`.\n *\n * @param tab - The tab\n * @param m - The Flowchart's messages\n * @returns The name its tab shows\n */\nexport function flowchartTabName(tab: FlowchartTabValue, m: FlowchartMessages): string {\n    return tab.type === \"tab\" ? tab.value.name : getSomeorUndefined(tab.value.name) ?? m.libraryTab({ tab: tab.type });\n}\n\n/** A tab's cards as the pane lists them, its icon, and whether its cards drag: a kind's always, an author's when its patch names a kind. */\nfunction tabCards(value: FlowchartValue, tab: FlowchartTabValue): { readonly cards: readonly PaneCard[]; readonly icon: string | undefined; readonly drops: boolean } {\n    if (tab.type === \"tab\") {\n        return {\n            cards: tab.value.cards.map((card): PaneCard => {\n                const meta = getSomeorUndefined(card.meta);\n                return {\n                    key: card.key, label: card.label, meta, group: getSomeorUndefined(card.group),\n                    search: [card.key, card.label, meta ?? \"\"].filter((text) => text !== \"\").join(\" · \"),\n                };\n            }),\n            icon: getSomeorUndefined(tab.value.icon),\n            drops: tab.value.drop.type === \"some\",\n        };\n    }\n    const kind = cardKindOf(value, tab.type);\n    return {\n        cards: (kind?.templates ?? []).map((card): PaneCard => ({ key: card.key, label: card.name, meta: undefined, group: getSomeorUndefined(card.group), search: card.name })),\n        icon: getSomeorUndefined(tab.value.icon) ?? (kind === undefined || kind.icon === \"\" ? undefined : kind.icon),\n        drops: true,\n    };\n}\n\n/** One tab, as the pane builds it: its word, key, name, icon, whether its cards drop, and what its source shows of them. */\ninterface PaneTab {\n    readonly word: FlowchartLibraryTabWord;\n    readonly tabKey: string;\n    readonly name: string;\n    readonly icon: string | undefined;\n    readonly drops: boolean;\n    /** Why its cards drop nowhere, on each card's line: its kind adds no row (#1549); `undefined` for cards that drop as its tab does. */\n    readonly why: string | undefined;\n    /** Whether any of its cards has a group: its Group by. */\n    readonly grouped: boolean;\n    readonly follow: SourceTab<PaneCard>;\n}\n\n/** A tab's narrowing in the Flowchart's words: the shared narrowing, its empty state said by its message table. */\nfunction narrowingOf(narrowing: LibraryNarrowing | undefined, tab: FlowchartLibraryTabWord, name: string, m: FlowchartMessages): LibraryNarrowing | undefined {\n    return narrowing === undefined ? undefined\n        : { ...narrowing, empty: { title: m.libraryNarrowed({ tab, name }), description: m.libraryNarrowedHint({ tab, name }) } };\n}\n\n/** Props of {@link useFlowchartLibrary}. */\nexport interface FlowchartLibraryProps {\n    /** The payload: its library's tabs, and its kinds and their cards. */\n    readonly value: FlowchartValue;\n    /** The names the Flowchart keeps its viewer's state under. */\n    readonly keys: FlowchartKeys;\n    /** The Flowchart's words. */\n    readonly words: FlowchartWords;\n    /** A card's ⏎: the card, by its library and its key, dropped on the canvas's selection. */\n    readonly enter?: ((library: string, key: string) => void) | undefined;\n    /** What each source the library's tabs follow shows, by the source's name. */\n    readonly followed: FollowedSources;\n    /** Whether main is below 480px: no card drags, and a tap on the selected card is its ⏎, whatever the pointer. */\n    readonly narrow?: boolean | undefined;\n    /** Why the states or the lanes add no row (#1549): their keys can't be typed, and they build none — their cards' line. */\n    readonly off?: { readonly states?: string | undefined; readonly lanes?: string | undefined } | undefined;\n}\n\n/**\n * The library pane, as `BuilderFrame` draws it — see the module docs.\n *\n * @param props - The payload, the Flowchart's keys, its words, a card's ⏎, the followed sources, whether main is narrow and\n *   why a kind adds no row\n * @returns The pane — its tabs the ones `library` lists, each with its count; 272px wide; its collapsed state kept per viewer — or `undefined`, no pane, when `library` lists none\n */\nexport function useFlowchartLibrary({ value, keys, words, enter, followed, narrow = false, off }: FlowchartLibraryProps): BuilderFrameDock | undefined {\n    const m = words.m;\n    const library = value.library;\n    // The recipe's styles, resolved once a recipe: the frame renders it again as each read lands.\n    const recipe = useSlotRecipe({ key: \"flowchart\" });\n    const styles = useMemo(() => recipe() as Styles, [recipe]);\n    // A touch screen, or a main too narrow to drag on: a tap on the selected card drops it, as its ⏎ does.\n    const coarse = useCoarsePointer();\n    const tapDrops = coarse || narrow;\n\n    // The card each tab's click selected, by the tab's key: a click on another moves it, a click on it lets it go.\n    const [picked, setPicked] = useState<ReadonlyMap<string, string>>(() => new Map());\n    const isPicked = useCallback((tabKey: string, key: string) => {\n        const chosen = picked.get(tabKey);\n        return chosen !== undefined && stringEqual(chosen, key);\n    }, [picked]);\n    const pick = useCallback((tabKey: string, key: string) => {\n        setPicked((was) => {\n            const next = new Map(was);\n            const chosen = was.get(tabKey);\n            if (chosen !== undefined && stringEqual(chosen, key)) next.delete(tabKey);\n            else next.set(tabKey, key);\n            return next;\n        });\n    }, []);\n\n    // Each tab over the source it follows, by its cards' keys: the cards it shows, its count, its narrowed and its own\n    // empty states, and its pane's attributes; a tab that follows none, its cards whole.\n    const offStates = off?.states, offLanes = off?.lanes;\n    const tabs = useMemo(() => library.map((tab): PaneTab => {\n        const { cards, icon, drops } = tabCards(value, tab);\n        const name = flowchartTabName(tab, m);\n        const source = flowchartTabSource(value, tab);\n        const shown = source === undefined ? WHOLE : followed.get(source)?.shown ?? WHOLE;\n        // A Steps' or a Lanes' card adds a row: none where its kind adds none.\n        const why = tab.type === \"states\" ? offStates : tab.type === \"lanes\" ? offLanes : undefined;\n        return {\n            word: tab.type, tabKey: flowchartTabKey(tab), name, icon, drops: drops && why === undefined, why, grouped: cards.some((card) => card.group !== undefined),\n            follow: sourceTab({ cards, keyOf: (card) => card.key, shown, noun: tab.type === \"tab\" ? name.toLocaleLowerCase(words.locale) : m.libraryNoun({ tab: tab.type, n: 2 }), words }),\n        };\n    }), [library, value, followed, m, words, offStates, offLanes]);\n\n    // Each tab whose cards drop takes ⏎ on a card: the card, dropped on the canvas's selection — one function per tab, held still.\n    const enters = useMemo(() => new Map(tabs.flatMap((tab): [string, (key: string) => void][] => {\n        if (enter === undefined || !tab.drops) return [];\n        const id = flowchartLibraryId(keys, tab.tabKey);\n        return [[tab.tabKey, (key: string) => enter(id, key)]];\n    })), [tabs, keys, enter]);\n    // A tab its source reads again holds its cards retained (#1398, CL8): a tap on one selects it, and drops nothing.\n    const held = useMemo(() => new Set(tabs.flatMap((tab) => (tab.follow.pane[\"aria-disabled\"] === true ? [tab.tabKey] : []))), [tabs]);\n    // A click on a card selects it, or lets the selected one go; on a touch screen, or below 480px of main, a tap on the\n    // selected card is its ⏎ — never in a tab held while its source reads again.\n    const onCard = useCallback((tabKey: string, key: string) => {\n        const onEnter = held.has(tabKey) ? undefined : enters.get(tabKey);\n        if (tapDrops && onEnter !== undefined && isPicked(tabKey, key)) onEnter(key);\n        else pick(tabKey, key);\n    }, [held, enters, tapDrops, isPicked, pick]);\n    const groupBy = useMemo(() => [{ key: \"group\", label: m.libraryGroupBy() }], [m]);\n\n    // Each tab's Library: the cards its source shows, each a drag source where its tab drops and main is wide enough.\n    const libraries = useMemo(() => new Map(tabs.map((tab): [string, LibraryValue] => [tab.tabKey, scheduleLibrary({\n        id: flowchartLibraryId(keys, tab.tabKey),\n        items: tab.follow.cards.map((card) => {\n            // A card of a kind adding no row says why on its line (#1549).\n            const line = tab.why ?? card.meta;\n            return scheduleLibraryCard({\n                key: card.key, label: card.label, sublabel: line === undefined ? none : some(line), icon: tab.icon === undefined ? none : some(tab.icon),\n                status: none, trailing: none,\n                draggable: tab.drops && !narrow, filtered: false, placed: isPicked(tab.tabKey, card.key),\n                search: some(card.search),\n                groups: card.group === undefined ? new Map() : new Map([[\"group\", card.group]]),\n            });\n        }),\n        groupOptions: tab.grouped ? groupBy : [],\n        noun: some({ singular: m.libraryNoun({ tab: tab.word, n: 1 }), plural: m.libraryNoun({ tab: tab.word, n: 2 }) }),\n        onCardClick: some((key: string) => { onCard(tab.tabKey, key); return null; }),\n    }, true)])), [tabs, keys, narrow, isPicked, groupBy, m, onCard]);\n\n    return useMemo((): BuilderFrameDock | undefined => {\n        // No tab listed: no pane.\n        if (tabs.length === 0) return undefined;\n        const panes = tabs.map((tab) => {\n            const cards = libraries.get(tab.tabKey)!;\n            const empty: LibraryEmpty | undefined = tab.follow.empty === undefined ? undefined\n                : { title: m.libraryEmpty({ tab: tab.word, name: tab.name }), description: m.libraryEmptyHint({ tab: tab.word, name: tab.name }) };\n            return {\n                key: tab.tabKey,\n                label: tab.name,\n                count: tab.follow.count,\n                shown: cards.items.length,\n                body: (\n                    // Its source's cards, counted, and while its source narrows what it says when that leaves it none.\n                    <Box css={styles.pane} data-flowchart-library={tab.tabKey} {...tab.follow.pane}>\n                        <EastChakraLibrary value={cards} storageKey={`${keys.library}.${tab.tabKey}`} onCardEnter={enters.get(tab.tabKey)} empty={empty}\n                            narrowing={narrowingOf(tab.follow.narrowing, tab.word, tab.name.toLocaleLowerCase(words.locale), m)} />\n                    </Box>\n                ),\n            };\n        });\n        // Collapsed, the rail counts the cards the first tab shows.\n        return {\n            label: m.libraryPane(), icon: \"layer-group\", badge: panes[0]!.shown, size: LIBRARY_SIZE, persist: \"local\",\n            tabs: panes.map(({ shown: _shown, ...pane }) => pane),\n        };\n    }, [tabs, libraries, enters, keys, m, words.locale, styles.pane]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's words (#1501–#1505, `Flowchart Records Spec.md`) — its\n * canvas's gestures: \"+ LANE\", a lane's ×, the \"+ STATE\" ghost and each\n * gesture's name in the history; its footer's counts, the changes waiting on\n * Save and its last save; its loading line, in a kind's noun; the details'\n * (#1510, R41) — durations from the unit, a bin's edges, a histogram's caption,\n * a count with what it counts, a share under one percent, a tag list's +n, a\n * list's Show n more, and the legend's rows; its library\n * pane's — the pane, the Steps, Transitions and Lanes tabs, each tab's empty\n * state and what the rail leaves it; its drops': where a card lands, what it\n * sets its fields on, why it is refused, and a drop's name in the history; its\n * inspector's: the pane and its tabs, what it shows, each field's label, its\n * parts' heads, chips, gestures, counts and hints, why a key is refused, and\n * each issue's words; and the rail's: what it counts each kind and each list\n * of cards in, what a row it hides or dims says of the choices that do, and\n * the banner over a source whose narrowing could not be read — beside the\n * editing session's own (`EditingMessages`), which its history item and\n * banners speak, as the Schematic's and the Sheet's tables carry them. A host\n * translates the flowchart where it translates the session.\n *\n * The table is made from the Flowchart's nouns (`flowchartMessagesOf`, #1516):\n * each kind's noun — its own `name`, `State` unless the app gives one — and\n * the app's words for a transition's kinds, `Planned` and `Observed` unless\n * its `vocabulary` gives others; so every word the table says of a kind is the\n * app's. `flowchartMessages` is the table in the Flowchart's own words.\n *\n * @packageDocumentation\n */\n\nimport { StringType, printFor } from \"@elaraai/east\";\nimport { editingMessages, type EditingMessages, type EditingWords } from \"@elaraai/east-ui-components\";\nimport { withArticle as aNoun } from \"../shared/article.js\";\nimport { pagedLoadingMessages, type PagedLoadingMessages } from \"../shared/loading.js\";\nimport { hiddenByText, joinedWords, kindPlural, lowerWord, type HiddenWords } from \"../shared/schedule/words.js\";\nimport type { FlowchartBinsRefusalWord } from \"./details.js\";\nimport type { FlowchartGesture } from \"./edits.js\";\nimport type { FlowchartIssueWord } from \"./issues.js\";\nimport type { FlowchartSort } from \"./read.js\";\n\n/** A count as a message takes it: the number, for its plural, and the number as the locale prints it. */\nexport interface FlowchartCount {\n    /** The number. */\n    readonly n: number;\n    /** The number, printed in the app's locale. */\n    readonly count: string;\n}\n\n/** A tab of the library pane: the Steps, Transitions or Lanes tab — a kind's cards — or one of the author's. */\nexport type FlowchartLibraryTabWord = \"states\" | \"transitions\" | \"lanes\" | \"tab\";\n\n/**\n * What a library card lands on: a state's card a lane; a transition's card a\n * transition; a lane's card the gap between two lanes; an author's card a\n * state, a transition, a lane's header or a decision's diamond, as its drop's\n * type names.\n */\nexport type FlowchartLandsWord = \"lane\" | \"state\" | \"transition\" | \"header\" | \"gap\" | \"decision\";\n\n/**\n * Where a dropped card lands: a state after the state above it, at the start\n * of a lane holding states, or in a lane holding none — the lane `undefined`\n * where the flowchart has no lanes; a lane before the lane it lands before, or\n * at the end of the lanes.\n */\nexport type FlowchartDropPlaceWord =\n    | { readonly place: \"after\"; readonly lane: string | undefined; readonly after: string }\n    | { readonly place: \"start\" | \"in\"; readonly lane: string | undefined }\n    | { readonly place: \"before\"; readonly lane: string }\n    | { readonly place: \"end\" };\n\n/** What a dropped card sets its fields on, as its words name it: a state by its key, a transition by its ends, a lane by its name, a decision by its label. */\nexport type FlowchartDropWhatWord =\n    | { readonly what: \"state\"; readonly key: string }\n    | { readonly what: \"transition\"; readonly from: string; readonly to: string }\n    | { readonly what: \"header\"; readonly lane: string }\n    | { readonly what: \"decision\"; readonly label: string };\n\n/**\n * Why a drop is refused: not onto what the card lands on; or its kind's\n * record takes no edit — read only, or its session busy — the kind as one of\n * its rows is called, `state`; or its kind adds no row, its keys of a type the\n * form can't type, by the type's name; or the lane it lands in is held under a\n * placeholder, its key still to be typed — by what a lane is called (#1549).\n */\nexport type FlowchartDropRefusalWord =\n    | { readonly why: \"onto\"; readonly lands: FlowchartLandsWord }\n    | { readonly why: \"readOnly\" | \"busy\"; readonly kind: string }\n    | { readonly why: \"untyped\"; readonly kind: string; readonly type: string }\n    | { readonly why: \"placeholder\"; readonly kind: string };\n\n/**\n * Why a gesture records nothing (#1549), as the footer says it: the row\n * holding the key a row builds — a transition by its ends' names, any other row\n * by its own; a row named in another's field while its key is still to be\n * typed; a kind adding no row, its keys of a type the form can't type; and a\n * row whose key would move, by its name, while the rows of another kind that\n * may name it — `by` — the rail hides some of, or take no edit now (#1580).\n */\nexport type FlowchartRefusalWord =\n    | { readonly refusal: \"taken\"; readonly sort: FlowchartSort; readonly name: string }\n    | { readonly refusal: \"taken\"; readonly sort: \"transitions\"; readonly from: string; readonly to: string }\n    | { readonly refusal: \"placeholder\"; readonly sort: FlowchartSort }\n    | { readonly refusal: \"untyped\"; readonly sort: FlowchartSort; readonly type: string }\n    | { readonly refusal: \"unheld\"; readonly name: string; readonly by: FlowchartSort; readonly why: \"filtered\" | \"busy\" };\n\n/**\n * What the inspector shows, in its head and on its rail: one row, by its\n * kind's name and its own — `State · SCN`; several states — `3 states`, the\n * kind's name as a sentence says it; or nothing selected, the flowchart.\n */\nexport type FlowchartInspectWord =\n    | { readonly what: \"row\"; readonly kind: string; readonly name: string }\n    | { readonly what: \"several\"; readonly n: number; readonly count: string; readonly name: string }\n    | { readonly what: \"flowchart\" };\n\n/** A field the inspector's own forms show, by its name: a row's key and label, a transition's ends, its evidence's, and the lane several states move to. */\nexport type FlowchartFieldWord = \"key\" | \"label\" | \"from\" | \"to\" | \"volume\" | \"count\" | \"measured\" | \"moveTo\";\n\n/** A part's head in the inspector's Details: a state's transitions, those a decision governs, a transition's evidence, and a state's transitions' groups. */\nexport type FlowchartPartWord = \"transitions\" | \"governs\" | \"evidence\" | \"in\" | \"out\" | \"inPlace\";\n\n/** A row's chip in the inspector's head: drafted since e3 held it, new, a key no state is keyed by, a transition naming one. */\nexport type FlowchartChipWord = \"pending\" | \"new\" | \"noRow\" | \"unresolved\";\n\n/**\n * The words the Flowchart's table is made from (#1516): each kind's noun, its own `name` as a heading writes it, and the\n * app's words for a transition's kinds.\n */\nexport interface FlowchartNouns {\n    /** What a state is called — `State`, or the states kind's `name`. */\n    readonly state: string;\n    /** What a transition is called — `Transition`, or the transitions kind's `name`. */\n    readonly transition: string;\n    /** What a lane is called — `Lane`, or the lanes kind's `name`. */\n    readonly lane: string;\n    /** What a decision is called — `Decision`, or the decisions kind's `name`. */\n    readonly decision: string;\n    /** A transition as it was designed — `Planned`, or the app's word in `vocabulary`. */\n    readonly planned: string;\n    /** A transition as it was seen to run — `Observed`, or the app's word in `vocabulary`. */\n    readonly observed: string;\n}\n\n/** The Flowchart's nouns where nothing names them. */\nexport const DEFAULT_FLOWCHART_NOUNS: FlowchartNouns = {\n    state: \"State\", transition: \"Transition\", lane: \"Lane\", decision: \"Decision\", planned: \"Planned\", observed: \"Observed\",\n};\n\n/** A duration's step, as the details print it (R41): `0` alone, then minutes, hours, days and whole weeks. */\nexport type FlowchartDurationStep = \"zero\" | \"minutes\" | \"hours\" | \"days\" | \"weeks\";\n\n/**\n * Where half, or nine in ten, of a histogram's counts fall (R41): within the\n * end of the bin they reach, or — reaching the open last bin — over its edge.\n */\nexport interface FlowchartMarkWord {\n    /** Within a bin's end, or over the last edge. */\n    readonly where: \"within\" | \"over\";\n    /** The edge, as a duration prints it. */\n    readonly at: string;\n}\n\n/** One of the legend's rows for the lines: planned, observed, a decision's diamond, an in-place transition's badge. */\nexport type FlowchartLegendLineWord = \"planned\" | \"observed\" | \"decision\" | \"inPlace\";\n\n/**\n * One of the legend's rows for a read the cards or the labels draw (§4): its\n * label, and what it shows — a figure on each card or under the evidence; a\n * histogram's range, first edge to last, and its scale; a list's top, by share\n * on a card or under the evidence.\n */\nexport type FlowchartLegendReadWord =\n    | { readonly read: \"figure\"; readonly label: string; readonly on: \"card\" | \"label\" }\n    | { readonly read: \"histogram\"; readonly label: string; readonly first: string | undefined; readonly last: string | undefined; readonly scale: \"band\" | \"linear\" }\n    | { readonly read: \"list\"; readonly label: string; readonly top: string; readonly on: \"card\" | \"label\" };\n\n/** The Flowchart's message table: its own words, the rail's, the loading line's, and the editing session's. */\nexport interface FlowchartMessages extends EditingMessages, HiddenWords, PagedLoadingMessages {\n    /** A new lane's label, by its number — `Lane 3`. */\n    newLane: (p: FlowchartCount) => string;\n    /** \"+ LANE\": the word under its plus. */\n    laneWord: () => string;\n    /** \"+ LANE\"'s accessible name, and its tooltip. */\n    addLane: () => string;\n    /** A phone's lane pager (`lane-pager.tsx`): its readout's word and what it counts — `Lanes 1–2 of 3`. */\n    lanePager: (p: { range: string; total: string }) => string;\n    /** The pager's ‹ and ›. */\n    laneStep: (p: { more: boolean }) => string;\n    /** What a read with nothing to show says, on a card, a label or in the inspector — `no data` (R33, R41). */\n    detailsNoData: () => string;\n    /** What a list or a tag list with no items says — `none` (R41). */\n    detailsNone: () => string;\n    /** A duration, by its step, its number in the app's locale (R41) — `15m`, `4h`, `2d`, `1w`; `0` alone. */\n    detailsDuration: (p: { step: FlowchartDurationStep; n: string }) => string;\n    /** The last edge, as an axis names it, its bin open — `1w+`. */\n    detailsOpen: (p: { at: string }) => string;\n    /** A bin, by its edges — `4h – 8h`; the last, open — `1w or more`. */\n    detailsBin: (p: { from: string; to: string | undefined }) => string;\n    /** A histogram's caption: where half and nine in ten of its counts fall — `Half within 4h · nine in ten within 2d`. */\n    detailsMarks: (p: { half: FlowchartMarkWord; nine: FlowchartMarkWord }) => string;\n    /** The bin under the pointer or the focus, as the caption says it — `4h – 8h · 236 parcels · 22%`. */\n    detailsBinCaption: (p: { bin: string; count: string; share: string }) => string;\n    /** A number with what it counts, the read's own word — `236 parcels`; the number alone where the read names none. */\n    detailsCount: (p: { count: string; noun: string | undefined }) => string;\n    /** A share above nothing but under the least the locale prints — `<1%`, by its 1%. */\n    detailsShareUnder: (p: { least: string }) => string;\n    /** The +n that ends a tag list cut short. */\n    detailsMore: (p: { count: string }) => string;\n    /** Its title: the tags it stands for — `Fragile and Cold chain`. */\n    detailsRest: (p: { tags: readonly string[] }) => string;\n    /** A list's control past its first 8 items — `Show 3 more`; open, `Show fewer`. */\n    detailsShowMore: (p: { n: number; count: string; open: boolean }) => string;\n    /** The inspector's read for a row the details hold no row of, saying *no data* (R33) — `Details`. */\n    detailsTitle: () => string;\n    /** The line over reads the rail's picks weigh, naming them (#1522, R46): the field as the rail labels it, then the picks — `Service · Standard, Priority`. */\n    detailsWeighed: (p: { label: string; picks: string }) => string;\n    /** What a kind's details are, as the loading line names them — `state details`. */\n    detailsNoun: (p: { sort: \"states\" | \"transitions\" }) => string;\n    /** The legend's title. */\n    legendTitle: () => string;\n    /** One of the legend's rows for the lines — `Planned`, `Observed`, `Decision trigger`, `In-place transition`. */\n    legendLine: (p: { line: FlowchartLegendLineWord }) => string;\n    /** One of its rows for a read (§4) — `Parcels · a figure on each card`, `Time in state · 0 to 1w+, a bar a bin`. */\n    legendRead: (p: FlowchartLegendReadWord) => string;\n    /** The \"+ STATE\" ghost: the word beside its plus. */\n    stateWord: () => string;\n    /** A lane's ×: its accessible name, and its tooltip while it can delete — `Delete lane Sort`. */\n    deleteLane: (p: { label: string }) => string;\n    /** Why a lane's × is off: the states it holds — `Move its 3 states first`; `name`, what one is called, `state` unless given. */\n    laneHoldsStates: (p: { n: number; count: string; name?: string | undefined }) => string;\n    /** A lane's label field, where it is renamed in place. */\n    laneLabelField: () => string;\n    /** The \"+ STATE\" ghost's key field: its accessible name. */\n    stateKeyField: () => string;\n    /** Its placeholder. */\n    stateKeyPlaceholder: () => string;\n    /** Why its key is refused: a state holds it already — `A state is keyed \"SCN\" already`. */\n    stateKeyTaken: (p: { key: string }) => string;\n    /** The ghost's label field: its accessible name. */\n    stateLabelField: () => string;\n    /** Its placeholder. */\n    stateLabelPlaceholder: () => string;\n    /** A gesture's name in the history, and its Save's — `Move states`. */\n    editLabel: (p: { gesture: FlowchartGesture }) => string;\n    /** The band of the states naming no lane, in a flowchart that has lanes. */\n    noLaneBand: () => string;\n    /** A state no row stands for, which a transition names: its card's line. */\n    noStateRow: () => string;\n    /** The toolbar's Find: its accessible name and its placeholder. */\n    findLabel: () => string;\n    /** What Find says with nothing matching. */\n    findNoMatches: () => string;\n    /** The toolbar's orientation control. */\n    orientationLabel: () => string;\n    /** The toolbar's view menu. */\n    viewLabel: () => string;\n    /** The zoom's strip's accessible name (R42). */\n    zoomLabel: () => string;\n    /** Zoom out. */\n    zoomOut: () => string;\n    /** Zoom in. */\n    zoomIn: () => string;\n    /** Fit: the whole flowchart in view. */\n    fit: () => string;\n    /** The footer's transitions, after their count — `transitions`. */\n    footerLinks: (p: { n: number }) => string;\n    /** Their split — `8 planned · 2 observed · 1 unresolved`, the unresolved only when some are. */\n    footerSplit: (p: { planned: string; observed: string; unresolved?: string | undefined }) => string;\n    /** The changes waiting on Save — `3 pending`. */\n    footerPending: (p: FlowchartCount) => string;\n    /** When the records were last saved — `Saved 14:02`. */\n    footerSaved: (p: { when: string }) => string;\n    /** The library pane's name: its rail's label and its toggle's words. */\n    libraryPane: () => string;\n    /** A kind's tab's name, when its author gives none — `Steps`, `Transitions`, `Lanes`. */\n    libraryTab: (p: { tab: Exclude<FlowchartLibraryTabWord, \"tab\"> }) => string;\n    /** A tab's empty state: its title — `No cards`, `Nothing in Owners`; `name` is the tab's. */\n    libraryEmpty: (p: { tab: FlowchartLibraryTabWord; name: string }) => string;\n    /** The line under it. */\n    libraryEmptyHint: (p: { tab: FlowchartLibraryTabWord; name: string }) => string;\n    /** A tab the rail leaves no card: its title. */\n    libraryNarrowed: (p: { tab: FlowchartLibraryTabWord; name: string }) => string;\n    /** The line under it. */\n    libraryNarrowedHint: (p: { tab: FlowchartLibraryTabWord; name: string }) => string;\n    /** What a tab's search box counts its cards as — `card`, `cards`. */\n    libraryNoun: (p: { tab: FlowchartLibraryTabWord; n: number }) => string;\n    /** What a tab's cards are grouped by: its grouping control's words. */\n    libraryGroupBy: () => string;\n    /** Where a dropped card lands, as the ghost says it — `after CH* in Sort`, `at the start of Sort`, `before Load`. */\n    dropPlace: (p: FlowchartDropPlaceWord) => string;\n    /** The same place, as a screen reader hears where a drag rests and as a drop's history names it — `Sort, after CH*`, `the gap before Load`. */\n    dropPlaceName: (p: FlowchartDropPlaceWord) => string;\n    /** What a dropped card sets its fields on, named — `CH*`, `CH* → LDD`, `lane Sort`, `decision route`. */\n    dropWhat: (p: FlowchartDropWhatWord) => string;\n    /** What the ghost says over what a card sets its fields on — `onto CH* → LDD`. */\n    dropOnto: (p: { what: string }) => string;\n    /** Why a drop is refused where it rests — red on the ghost — and, for a card's ⏎, in the footer — `Drop onto a transition`. */\n    dropRefused: (p: FlowchartDropRefusalWord) => string;\n    /** The canvas, as a screen reader hears it where a drop is refused. */\n    dropCanvas: () => string;\n    /** A drop's name in the history, and its Save's — `Drop Held on Sort, after CH*`. */\n    dropLabel: (p: { card: string; onto: string }) => string;\n    /** The inspector pane's name: its rail's label and its toggle's words. */\n    inspectorPane: () => string;\n    /** The inspector's tabs: `Details`, `Issues`. */\n    inspectorTab: (p: { tab: \"details\" | \"issues\" }) => string;\n    /** What the inspector shows, in its head and on its rail — `State · SCN`, `3 states`, `Flowchart`. */\n    inspectorWhat: (p: FlowchartInspectWord) => string;\n    /** A field's label in the inspector's own forms — `Key`, `From`; `Move to lane`, by what a lane is called. */\n    inspectorField: (p: { field: Exclude<FlowchartFieldWord, \"moveTo\"> } | { field: \"moveTo\"; name: string }) => string;\n    /** The line under a new row's key field. */\n    inspectorKeyHelp: () => string;\n    /** The line under a new row's key of several parts — a struct's fields, a variant's case and its value (#1581). */\n    inspectorKeyPartsHelp: () => string;\n    /** A key of several parts' Set, which takes it whole (#1581). */\n    inspectorKeySet: () => string;\n    /** A row in a select of the inspector's — `SCN · Scan`. */\n    inspectorChoice: (p: { key: string; label: string }) => string;\n    /** A part's head in Details — `Transitions · 3`, `In · 2`, `Evidence`; `name` is the transitions kind's. */\n    inspectorSection: (p: { section: FlowchartPartWord; n: number; count: string; name: string }) => string;\n    /** A transition's line under its ends in a list — `observed · route`, `unresolved`. */\n    inspectorLinkKind: (p: { kind: \"planned\" | \"observed\" | \"unresolved\"; decision: string | undefined }) => string;\n    /** A transition's volume beside its ends in a list (R37) — `18,460 parcels`; none measured, `not measured`. */\n    inspectorVolume: (p: { volume: string | undefined }) => string;\n    /** A row's chip in its head — `Pending`, `New`, `No state row`, `Unresolved`. */\n    inspectorChip: (p: { state: FlowchartChipWord }) => string;\n    /** A gesture's button in Details — `Duplicate`, `Delete`. */\n    inspectorAction: (p: { action: \"duplicate\" | \"delete\" }) => string;\n    /** Why a key typed in the inspector is refused, in the footer — `Every state needs a key`, `A lane is keyed \"ld\" already`; `name` as a sentence says it. */\n    inspectorKeyRefused: (p: { name: string; key: string; why: \"empty\" | \"taken\" }) => string;\n    /**\n     * Why a kind adds no row (#1549) — on Duplicate's off line, \"+ LANE\"'s and \"+ STATE\"'s tooltips, a drop and the\n     * footer: `Stations are keyed by Blob, which can't be typed — give the kind `key` to add them`; `name` as a\n     * sentence says one of its rows, `type` its key type's name.\n     */\n    keysUntyped: (p: { name: string; type: string }) => string;\n    /** A new row held under a placeholder, its key still to be typed (#1549) — `Type this lane's key: Save waits for it`. */\n    keyPlaceholder: (p: { sort: FlowchartSort }) => string;\n    /**\n     * Why a gesture records nothing (#1549), in the footer — `A move from Mix to Proof is there already`, `Type the new\n     * lane's key first`, `Scan isn't changed: the rail hides some transitions that may name it — clear its choices, then\n     * try again` (#1580).\n     */\n    gestureRefused: (p: FlowchartRefusalWord) => string;\n    /** How many states a lane holds — `Holds 3 states`; `name` as a sentence says it. */\n    inspectorLaneStates: (p: { n: number; count: string; name: string }) => string;\n    /** A key no state is keyed by, which transitions name — `Named by 2 transitions, and e3 holds no state keyed \"GONE\"`. */\n    inspectorNoRow: (p: { n: number; count: string; key: string; state: string; transition: string }) => string;\n    /** What one of the flowchart's counts counts, by its kind's name — `Lanes`, `States`. */\n    inspectorCount: (p: { name: string; n: number }) => string;\n    /** The flowchart's transitions, split — `8 planned · 2 observed · 1 unresolved`. */\n    inspectorSplit: (p: { planned: string; observed: string; unresolved: string }) => string;\n    /** A record's last save, and who made it — `States saved 14:02 by planner`. */\n    inspectorSaved: (p: { name: string; when: string; by: string | undefined }) => string;\n    /** One of the three hints nothing selected shows, as the flowchart edits or not. */\n    inspectorHint: (p: { n: 1 | 2 | 3; edits: boolean }) => string;\n    /** The hint in a phone's pane, nothing selected (ruled 3 Nov 2026): a tap, and no several selected or renamed in place there. */\n    inspectorHintTouch: () => string;\n    /** The Issues tab with none: its title, and the line under it. */\n    inspectorNoIssues: (p: { part: \"title\" | \"hint\" }) => string;\n    /** A transition's decision when it has none, first in its select. */\n    noDecision: () => string;\n    /** Where an issue is, over its words — `State · SCN`; the flowchart's own, its name alone. */\n    issueWhere: (p: { kind: string | undefined; name: string }) => string;\n    /** An issue — `SCN → GONE names GONE, and e3 holds no state of that key`. */\n    issueText: (p: FlowchartIssueWord) => string;\n    /** What the rail counts a kind's rows in, and its banner names it by where its source has no label of its own — `states`. */\n    kindNoun: (p: { sort: FlowchartSort; n: number }) => string;\n    /** What the rail counts a kind's list of cards in — `state cards`. */\n    cardsNoun: (p: { tab: Exclude<FlowchartLibraryTabWord, \"tab\"> }) => string;\n    /** A row the rail's narrowing draws dimmed, before e3 has said which choices dim it — `dimmed by the rail`. */\n    dimmedByFilters: () => string;\n    /** Once it has: the choices that dim it, and those a pick clears with them. */\n    dimmedBy: (p: { readonly filters: readonly string[]; readonly also: readonly string[] }) => string;\n    /** A new row's key e3 holds already — `A state is keyed \"SCN\" already`. */\n    keyHeld: (p: { sort: FlowchartSort; key: string }) => string;\n    /** While e3 is asked for it — `Checking the key \"SCN\"`. */\n    keyChecking: (p: { sort: FlowchartSort; key: string }) => string;\n    /** A pick of a hidden row whose rail choices could not be cleared. */\n    hiddenUncleared: () => string;\n    /** The banner over a source of the rail whose narrowing could not be read — `Owners results unavailable`; `name` is the source's label, or what it is counted in. */\n    sourceUnavailable: (p: { name: string }) => string;\n    /** Why: its results moved while they were read. */\n    sourceChanged: (p: { name: string }) => string;\n    /** Why: its results could not be read. */\n    sourceFailed: (p: { name: string }) => string;\n}\n\nconst plural = (n: number, one: string, many: string): string => (n === 1 ? one : many);\n\n/** A kind's name, one or several of it — `state`, `states`. */\nconst counted = (n: number, name: string): string => (n === 1 ? name : kindPlural(name));\n\n/** A key as a sentence quotes it: East's printing of the string. */\nconst quoted = printFor(StringType);\n\n/** A name as a sentence starts with it. */\nconst capital = (name: string): string => `${name.charAt(0).toUpperCase()}${name.slice(1)}`;\n\n/** Why a kind adds no row (#1549): its rows' name as a sentence says one, and its key type's name. */\nconst keysUntyped = (name: string, type: string): string => `${capital(kindPlural(name))} are keyed by ${type}, which can't be typed — give the kind \\`key\\` to add them`;\n\n/** Each field's label in the inspector's own forms. */\nconst FIELDS: { readonly [F in Exclude<FlowchartFieldWord, \"moveTo\">]: string } = {\n    key: \"Key\", label: \"Label\", from: \"From\", to: \"To\", volume: \"Volume\", count: \"Count\", measured: \"Measured\",\n};\n\n/** A state's transitions' groups. */\nconst GROUPS = { in: \"In\", out: \"Out\", inPlace: \"In place\" } as const;\n\n/** Each duration step's letter, after its number. */\nconst DURATION_STEPS: { readonly [S in Exclude<FlowchartDurationStep, \"zero\">]: string } = { minutes: \"m\", hours: \"h\", days: \"d\", weeks: \"w\" };\n\n/** Where half or nine in ten of the counts fall — `within 4h`, `over 1w`. */\nconst markText = (mark: FlowchartMarkWord): string => `${mark.where} ${mark.at}`;\n\n/** A legend row's words for a read (§4): its label, and what it shows. */\nfunction legendReadText(p: FlowchartLegendReadWord): string {\n    switch (p.read) {\n        case \"figure\": return `${p.label} · ${p.on === \"card\" ? \"a figure on each card\" : \"a figure under the evidence\"}`;\n        case \"histogram\": {\n            const range = p.first === undefined ? \"\" : p.last === undefined ? `${p.first}+, ` : `${p.first} to ${p.last}+, `;\n            return `${p.label} · ${range}${p.scale === \"linear\" ? \"to scale\" : \"a bar a bin\"}`;\n        }\n        case \"list\": return `${p.label} · top ${p.top}, ${p.on === \"card\" ? \"by share\" : \"under the evidence\"}`;\n    }\n}\n\n/** Why a histogram's bins, as the app binds them, are refused — `The bins of Time in state do not ascend: 5, then 5`. */\nfunction binsRefused(read: string, refusal: FlowchartBinsRefusalWord): string {\n    switch (refusal.why) {\n        case \"empty\": return `The bins of ${read} hold no edge`;\n        case \"number\": return `The bins of ${read} hold ${refusal.edge}, which no bin starts at`;\n        case \"order\": return `The bins of ${read} do not ascend: ${refusal.before}, then ${refusal.after}`;\n    }\n}\n\n/**\n * The English table, in the Flowchart's nouns (#1516): each kind's own `name`, and the app's words for a transition's\n * kinds.\n *\n * @param nouns - The nouns, each as a heading writes it\n * @returns The table\n */\nexport function flowchartMessagesOf(nouns: FlowchartNouns): FlowchartMessages {\n    // Each noun as running text says it — and several of it, as English makes the plural.\n    const state = lowerWord(nouns.state), states = kindPlural(state), transition = lowerWord(nouns.transition), transitions = kindPlural(transition);\n    const lane = lowerWord(nouns.lane), lanes = kindPlural(lane), decision = lowerWord(nouns.decision);\n    const planned = lowerWord(nouns.planned), observed = lowerWord(nouns.observed);\n    /** A transition's kind, as running text says it. */\n    const kindWord = (kind: \"planned\" | \"observed\" | \"unresolved\"): string => (kind === \"planned\" ? planned : kind === \"observed\" ? observed : kind);\n\n    /** Each gesture's name. */\n    const EDIT_LABELS: { readonly [G in FlowchartGesture]: string } = {\n        addLane: `Add ${lane}`,\n        renameLane: `Rename ${lane}`,\n        deleteLane: `Delete ${lane}`,\n        addState: `Add ${state}`,\n        renameState: `Rename ${state}`,\n        moveStates: `Move ${states}`,\n        deleteStates: `Delete ${states}`,\n        duplicateState: `Duplicate ${state}`,\n        connect: `Connect ${states}`,\n        editLink: `Edit ${transition}`,\n        deleteLink: `Delete ${transition}`,\n        deleteDecision: `Delete ${decision}`,\n        dropCard: \"Drop card\",\n        form: \"Edit fields\",\n        details: \"Edit details\",\n        rekey: \"Change key\",\n    };\n\n    /** The three hints nothing selected shows, where the flowchart edits. */\n    const HINTS = {\n        1: `Click ${aNoun(state)}, ${aNoun(transition)}, ${aNoun(decision)} or ${aNoun(lane)}'s header to see its details here.`,\n        2: `Shift-click ${states} to select several, and move or delete them together.`,\n        3: `Double-click ${aNoun(state)} or ${aNoun(lane)}'s header to rename it where it stands.`,\n    } as const;\n\n    /** The three hints, where it edits nothing. */\n    const READ_HINTS = {\n        1: HINTS[1],\n        2: `Shift-click ${states} to select several, and see how many there are.`,\n        3: `Find picks ${aNoun(state)} by its key or label, even one the rail hides.`,\n    } as const;\n\n    /** One row of each kind, as a sentence names it. */\n    const ONE: { readonly [S in FlowchartSort]: string } = { states: state, transitions: transition, lanes: lane, decisions: decision };\n\n    /** What a card lands on, as a refusal names it. */\n    const LANDS: { readonly [L in FlowchartLandsWord]: string } = {\n        lane: `onto ${aNoun(lane)}`, state: `onto ${aNoun(state)}`, transition: `onto ${aNoun(transition)}`,\n        header: `onto ${aNoun(lane)}'s header`, gap: `between the ${lanes}`, decision: `onto ${aNoun(decision)}`,\n    };\n\n    /** Each kind's tab, when its author names none: the states' cards are the Steps, the others' each its kind's plural. */\n    const TABS: { readonly [T in Exclude<FlowchartLibraryTabWord, \"tab\">]: string } = {\n        states: \"Steps\", transitions: kindPlural(nouns.transition), lanes: kindPlural(nouns.lane),\n    };\n\n    /** Each kind's tab, empty: what it has no card to drag onto. */\n    const EMPTY_HINTS: { readonly [T in Exclude<FlowchartLibraryTabWord, \"tab\">]: string } = {\n        states: `No ${state} card to drag onto ${aNoun(lane)}.`,\n        transitions: `No ${transition} card to drag onto ${aNoun(transition)}.`,\n        lanes: `No ${lane} card to drag between the ${lanes}.`,\n    };\n\n    /** Each chip's words. */\n    const CHIPS: { readonly [C in FlowchartChipWord]: string } = { pending: \"Pending\", new: \"New\", noRow: `No ${state} row`, unresolved: \"Unresolved\" };\n    /** The legend's rows for the lines. */\n    const LEGEND_LINES: { readonly [L in FlowchartLegendLineWord]: string } = {\n        planned: nouns.planned, observed: nouns.observed, decision: `${nouns.decision} trigger`, inPlace: `In-place ${transition}`,\n    };\n\n    return {\n        ...editingMessages,\n        ...pagedLoadingMessages,\n        // A kind read again as the rail moves: the canvas updates in place, and the line says so.\n        lineFiltering: ({ noun }) => [`Updating ${noun}…`],\n        lineShort: ({ kind }) => (kind === \"filtering\" ? \"Updating…\" : pagedLoadingMessages.lineShort({ kind })),\n        newLane: ({ count }) => `${nouns.lane} ${count}`,\n        laneWord: () => nouns.lane,\n        addLane: () => `Add ${lane}`,\n        lanePager: ({ range, total }) => `${kindPlural(nouns.lane)} ${range} of ${total}`,\n        laneStep: ({ more }) => (more ? `Next ${lane}` : `Previous ${lane}`),\n        detailsNoData: () => \"no data\",\n        detailsNone: () => \"none\",\n        detailsDuration: ({ step, n }) => (step === \"zero\" ? \"0\" : `${n}${DURATION_STEPS[step]}`),\n        detailsOpen: ({ at }) => `${at}+`,\n        detailsBin: ({ from, to }) => (to === undefined ? `${from} or more` : `${from} – ${to}`),\n        detailsMarks: ({ half, nine }) => `Half ${markText(half)} · nine in ten ${markText(nine)}`,\n        detailsBinCaption: ({ bin, count, share }) => `${bin} · ${count} · ${share}`,\n        detailsCount: ({ count, noun }) => (noun === undefined ? count : `${count} ${noun}`),\n        detailsShareUnder: ({ least }) => `<${least}`,\n        detailsMore: ({ count }) => `+${count}`,\n        detailsRest: ({ tags }) => joinedWords(tags, \"and\"),\n        detailsShowMore: ({ count, open }) => (open ? \"Show fewer\" : `Show ${count} more`),\n        detailsTitle: () => \"Details\",\n        detailsWeighed: ({ label, picks }) => `${label} · ${picks}`,\n        detailsNoun: ({ sort }) => `${ONE[sort]} details`,\n        legendTitle: () => \"Legend\",\n        legendLine: ({ line }) => LEGEND_LINES[line],\n        legendRead: (p) => legendReadText(p),\n        stateWord: () => state,\n        deleteLane: ({ label }) => `Delete ${lane} ${label}`,\n        laneHoldsStates: ({ n, count, name }) => `Move its ${count} ${counted(n, name ?? state)} first`,\n        laneLabelField: () => `${nouns.lane} label`,\n        stateKeyField: () => `${nouns.state} key`,\n        stateKeyPlaceholder: () => \"KEY\",\n        stateKeyTaken: ({ key }) => `${capital(aNoun(state))} is keyed ${quoted(key)} already`,\n        stateLabelField: () => `${nouns.state} label`,\n        stateLabelPlaceholder: () => \"Label\",\n        editLabel: ({ gesture }) => EDIT_LABELS[gesture],\n        noLaneBand: () => `No ${lane}`,\n        noStateRow: () => `No ${state} row`,\n        findLabel: () => `Find ${state}`,\n        findNoMatches: () => \"No matches\",\n        orientationLabel: () => \"Orientation\",\n        viewLabel: () => \"View\",\n        zoomLabel: () => \"Zoom\",\n        zoomOut: () => \"Zoom out\",\n        zoomIn: () => \"Zoom in\",\n        fit: () => \"Fit\",\n        footerLinks: ({ n }) => plural(n, transition, transitions),\n        footerSplit: ({ planned: p, observed: o, unresolved }) =>\n            `${p} ${planned} · ${o} ${observed}${unresolved === undefined ? \"\" : ` · ${unresolved} unresolved`}`,\n        footerPending: ({ count }) => `${count} pending`,\n        footerSaved: ({ when }) => `Saved ${when}`,\n        libraryPane: () => \"Library\",\n        libraryTab: ({ tab }) => TABS[tab],\n        libraryEmpty: ({ tab, name }) => (tab === \"tab\" ? `Nothing in ${name}` : \"No cards\"),\n        libraryEmptyHint: ({ tab, name }) => (tab === \"tab\" ? `${name} lists nothing yet.` : EMPTY_HINTS[tab]),\n        libraryNarrowed: ({ name }) => `The rail hides every card in ${name}`,\n        libraryNarrowedHint: () => \"Change or clear the rail's choices to see more cards.\",\n        libraryNoun: ({ n }) => plural(n, \"card\", \"cards\"),\n        libraryGroupBy: () => \"Group\",\n        dropPlace: (p) => {\n            switch (p.place) {\n                case \"after\": return p.lane === undefined ? `after ${p.after}` : `after ${p.after} in ${p.lane}`;\n                case \"start\": return p.lane === undefined ? \"at the start\" : `at the start of ${p.lane}`;\n                case \"in\": return p.lane === undefined ? \"at the start\" : `in ${p.lane}`;\n                case \"before\": return `before ${p.lane}`;\n                case \"end\": return `at the end of the ${lanes}`;\n            }\n        },\n        dropPlaceName: (p) => {\n            switch (p.place) {\n                case \"after\": return p.lane === undefined ? `the row after ${p.after}` : `${p.lane}, after ${p.after}`;\n                case \"start\": return p.lane === undefined ? \"the start\" : `the start of ${p.lane}`;\n                case \"in\": return p.lane ?? \"the start\";\n                case \"before\": return `the gap before ${p.lane}`;\n                case \"end\": return `the end of the ${lanes}`;\n            }\n        },\n        dropWhat: (p) => {\n            switch (p.what) {\n                case \"state\": return p.key;\n                case \"transition\": return `${p.from} → ${p.to}`;\n                case \"header\": return `${lane} ${p.lane}`;\n                case \"decision\": return `${decision} ${p.label}`;\n            }\n        },\n        dropOnto: ({ what }) => `onto ${what}`,\n        dropRefused: (p) => {\n            switch (p.why) {\n                case \"onto\": return `Drop ${LANDS[p.lands]}`;\n                case \"readOnly\": return `${capital(kindPlural(p.kind))} are read only`;\n                case \"busy\": return `${capital(kindPlural(p.kind))} take no edit now`;\n                case \"untyped\": return keysUntyped(p.kind, p.type);\n                case \"placeholder\": return `Type the new ${p.kind}'s key first`;\n            }\n        },\n        dropCanvas: () => \"the canvas\",\n        dropLabel: ({ card, onto }) => `Drop ${card} on ${onto}`,\n        inspectorPane: () => \"Inspector\",\n        inspectorTab: ({ tab }) => (tab === \"details\" ? \"Details\" : \"Issues\"),\n        inspectorWhat: (p) => {\n            switch (p.what) {\n                case \"row\": return `${p.kind} · ${p.name}`;\n                case \"several\": return `${p.count} ${counted(p.n, p.name)}`;\n                case \"flowchart\": return \"Flowchart\";\n            }\n        },\n        inspectorField: (p) => (p.field === \"moveTo\" ? `Move to ${p.name}` : FIELDS[p.field]),\n        inspectorKeyHelp: () => \"A new row's key can change until it is saved; what names it follows the change.\",\n        inspectorKeyPartsHelp: () => \"Type each part, then Set key: the row takes the key whole, and Save waits until it does.\",\n        inspectorKeySet: () => \"Set key\",\n        inspectorChoice: ({ key, label }) => `${key} · ${label}`,\n        inspectorSection: ({ section, count, name }) => {\n            switch (section) {\n                case \"transitions\": return `${kindPlural(name)} · ${count}`;\n                case \"governs\": return `${kindPlural(name)} it governs · ${count}`;\n                case \"evidence\": return \"Evidence\";\n                default: return `${GROUPS[section]} · ${count}`;\n            }\n        },\n        inspectorLinkKind: ({ kind, decision: named }) => (named === undefined ? kindWord(kind) : `${kindWord(kind)} · ${named}`),\n        inspectorVolume: ({ volume }) => volume ?? \"not measured\",\n        inspectorChip: ({ state: chip }) => CHIPS[chip],\n        inspectorAction: ({ action }) => (action === \"duplicate\" ? \"Duplicate\" : \"Delete\"),\n        inspectorKeyRefused: ({ name, key, why }) => (why === \"empty\" ? `Every ${name} needs a key` : `${capital(aNoun(name))} is keyed ${quoted(key)} already`),\n        keysUntyped: ({ name, type }) => keysUntyped(name, type),\n        keyPlaceholder: ({ sort }) => `Type this ${ONE[sort]}'s key: Save waits for it`,\n        gestureRefused: (p) => {\n            switch (p.refusal) {\n                case \"taken\": return \"from\" in p\n                    ? `${capital(aNoun(transition))} from ${p.from} to ${p.to} is there already`\n                    : `${capital(aNoun(ONE[p.sort]))} ${p.name} is there already`;\n                case \"placeholder\": return `Type the new ${ONE[p.sort]}'s key first`;\n                case \"untyped\": return keysUntyped(ONE[p.sort], p.type);\n                case \"unheld\": return p.why === \"filtered\"\n                    ? `${p.name} isn't changed: the rail hides some ${kindPlural(ONE[p.by])} that may name it — clear its choices, then try again`\n                    : `${p.name} isn't changed: ${kindPlural(ONE[p.by])} that may name it take no edit now — try again in a moment`;\n            }\n        },\n        inspectorLaneStates: ({ n, count, name }) => (n === 0 ? `Holds no ${name}` : `Holds ${count} ${counted(n, name)}`),\n        inspectorNoRow: ({ n, count, key, state: one, transition: link }) => `Named by ${count} ${counted(n, link)}, and e3 holds no ${one} keyed ${quoted(key)}`,\n        inspectorCount: ({ name, n }) => counted(n, name),\n        inspectorSplit: ({ planned: p, observed: o, unresolved }) => `${p} ${planned} · ${o} ${observed} · ${unresolved} unresolved`,\n        inspectorSaved: ({ name, when, by }) => `${kindPlural(name)} saved ${when}${by === undefined ? \"\" : ` by ${by}`}`,\n        inspectorHint: ({ n, edits }) => (edits ? HINTS[n] : READ_HINTS[n]),\n        inspectorHintTouch: () => `Tap ${aNoun(state)}, ${aNoun(transition)}, ${aNoun(decision)} or ${aNoun(lane)}'s header to see its details here.`,\n        inspectorNoIssues: ({ part }) => (part === \"title\" ? \"No issues\" : `Every end, ${lane} and ${decision} resolves, and nothing waits on Save.`),\n        noDecision: () => `No ${decision}`,\n        issueWhere: ({ kind, name }) => (kind === undefined ? name : `${kind} · ${name}`),\n        issueText: (p) => {\n            switch (p.issue) {\n                case \"end\": return p.missing.length === 1\n                    ? `${p.link} names ${p.missing[0]}, and e3 holds no ${state} of that key`\n                    : `${p.link} names ${joinedWords(p.missing, \"and\")}, and e3 holds no ${state} of either key`;\n                case \"lane\": return p.lane === undefined ? `${p.state} names no ${lane}` : `${p.state} names the ${lane} ${p.lane}, which the flowchart has none of`;\n                case \"decision\": return `${p.link} names the ${decision} ${p.decision}, which the flowchart has none of`;\n                case \"counts\": return `${p.read} of ${p.name} has counts no bin holds`;\n                case \"bins\": return binsRefused(p.read, p.refusal);\n                case \"weighed\": return `${p.kind} details read another record than the rail's ${p.source}, so its picks don't add them up: each draws its row's own`;\n                case \"waiting\": return `${p.name} has an unsaved change the rail hides: Save writes it with the rest`;\n                case \"ready\": return p.message;\n                case \"bounds\": return `${p.field}: ${p.bound}`;\n                case \"save\": return p.message;\n            }\n        },\n        kindNoun: ({ sort, n }) => (n === 1 ? ONE[sort] : kindPlural(ONE[sort])),\n        cardsNoun: ({ tab }) => `${ONE[tab]} cards`,\n        hiddenByFilters: () => \"hidden by the rail\",\n        hiddenBy: ({ filters, also }) => hiddenByText(filters, also),\n        dimmedByFilters: () => \"dimmed by the rail\",\n        dimmedBy: ({ filters, also }) => hiddenByText(filters, also, \"dimmed\"),\n        keyHeld: ({ sort, key }) => `${capital(aNoun(ONE[sort]))} is keyed ${quoted(key)} already`,\n        keyChecking: ({ key }) => `Checking the key ${quoted(key)}`,\n        hiddenUncleared: () => \"The rail's choices hiding it could not be cleared\",\n        sourceUnavailable: ({ name }) => `${capital(name)} results unavailable`,\n        sourceChanged: ({ name }) => `${capital(name)} results changed; retry the narrowing.`,\n        sourceFailed: ({ name }) => `Could not load ${name} results`,\n    };\n}\n\n/** The English table, in the Flowchart's own words. */\nexport const flowchartMessages: FlowchartMessages = flowchartMessagesOf(DEFAULT_FLOWCHART_NOUNS);\n\n/** The words a flowchart speaks: its message table, and its locale's formatters. */\nexport interface FlowchartWords extends EditingWords {\n    /** The message table in effect. */\n    m: FlowchartMessages;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * LR · TD, the viewer's (#1246, `Flowchart Builder Spec.md` §4.1, FB43): the\n * orientation the viewer picked, held in the UI store under the flowchart's\n * name (`flowchartKeys(name).orientation`) as an East\n * `Flowchart.Types.Orientation`, so a remount keeps it and two flowcharts of\n * one name turn together. Until the viewer picks, the flowchart shows the\n * payload's `orientation`, LR when it gives none.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport { decodeBeast2For, encodeBeast2For, variant } from \"@elaraai/east\";\nimport { Flowchart } from \"@elaraai/e3-ui/internal\";\nimport { StateRuntime } from \"@elaraai/east-ui-components\";\nimport type { FlowchartOrientation } from \"./toolbar.js\";\n\nconst encodeOrientation = encodeBeast2For(Flowchart.Types.Orientation);\nconst decodeOrientation = decodeBeast2For(Flowchart.Types.Orientation);\n\n/** Each orientation as the East value the store holds. */\nconst ORIENTATIONS = { LR: variant(\"LR\", null), TD: variant(\"TD\", null) } as const;\n\n/**\n * The orientation the viewer picked in the flowchart a key names — or, until\n * they pick, the one the payload gives — and how to pick another: a write\n * every flowchart under that key follows.\n *\n * @param key - The flowchart's orientation key (`flowchartKeys(name).orientation`)\n * @param initial - The payload's `orientation`, LR when it gives none: shown until the viewer picks\n * @returns The orientation shown, and the write that picks another\n */\nexport function useViewerOrientation(key: string, initial: FlowchartOrientation): [FlowchartOrientation, (orientation: FlowchartOrientation) => void] {\n    const store = StateRuntime.getStore();\n    const subscribe = useCallback((notify: () => void) => store.subscribe(key, notify), [store, key]);\n    const snapshot = useCallback(() => store.read(key), [store, key]);\n    const bytes = useSyncExternalStore(subscribe, snapshot);\n    const picked = useMemo(() => (bytes === undefined ? undefined : decodeOrientation(bytes).type), [bytes]);\n    const pick = useCallback((orientation: FlowchartOrientation) => { store.write(key, encodeOrientation(ORIENTATIONS[orientation])); }, [store, key]);\n    return [picked ?? initial, pick];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The sources of the Flowchart's rail it follows (#1502, `Flowchart Records\n * Spec.md` R6, R14): each kind's cards' source, whose shown keys narrow its\n * tab's cards; each author's tab's that names one; and, under `\"dim\"`, the\n * states' and the transitions' own, whose shown keys say which rows draw as\n * context — and what the rail counts each source in. The shared\n * `FollowSources` reads them.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { flowchartTabSource } from \"./library.js\";\nimport type { FlowchartMessages } from \"./messages.js\";\nimport type { FlowchartValue } from \"./model.js\";\nimport { SOURCE_SORTS } from \"./read.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * The sources the Flowchart follows: each tab's — a kind's tab its cards', an\n * author's tab its own — and, under `\"dim\"`, each kind read through its source\n * of the rail, the states' and the transitions' — each once, in that order.\n *\n * @param value - The payload\n * @returns The sources' names\n */\nexport function followedSources(value: FlowchartValue): string[] {\n    const named = value.library.flatMap((tab) => {\n        const source = flowchartTabSource(value, tab);\n        return source === undefined ? [] : [source];\n    });\n    if (value.narrowed.type === \"dim\") {\n        const chrome = getSomeorUndefined(value.slice);\n        for (const sort of SOURCE_SORTS) if (sourcePart(chrome, sort) !== undefined) named.push(sort);\n    }\n    return named.filter((source, i) => named.findIndex((other) => stringEqual(other, source)) === i);\n}\n\n/**\n * What the rail counts each source in, by its name: a kind read through its\n * source, its kind's name in the plural; a kind's cards' source, cards; an\n * author's tab's, its name as a sentence writes it — the first that names a\n * source naming it.\n *\n * @param value - The payload\n * @param m - The Flowchart's messages\n * @param locale - The app's locale, which lowers a name\n * @returns Each source's noun, by its name\n */\nexport function sourceNouns(value: FlowchartValue, m: FlowchartMessages, locale: string): ReadonlyMap<string, string> {\n    const nouns = new Map<string, string>();\n    for (const sort of SOURCE_SORTS) nouns.set(sort, m.kindNoun({ sort, n: 2 }));\n    for (const tab of value.library) {\n        const source = flowchartTabSource(value, tab);\n        if (source === undefined || nouns.has(source)) continue;\n        nouns.set(source, tab.type === \"tab\" ? tab.value.name.toLocaleLowerCase(locale) : m.cardsNoun({ tab: tab.type }));\n    }\n    return nouns;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Zoom out, Zoom in and Fit (#1393, #1519): icon buttons, one strip of the\n * `seg` recipe, for a builder's toolbar and its View — the Schematic's and the\n * Flowchart's. Each is titled with its name; Zoom out is off at Fit, Zoom in\n * at the zoom's limit, and Fit can be clicked at any zoom. Each click of\n * either zooms by {@link ZOOM_STEP}: where it zooms about, and how far, is the\n * builder's.\n *\n * @packageDocumentation\n */\n\nimport { Box, chakra, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faExpand, faMinus, faPlus } from \"@fortawesome/free-solid-svg-icons\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** How far a click of Zoom out or Zoom in zooms: ×1.5, or ÷1.5. */\nexport const ZOOM_STEP = 1.5;\n\n/** Where a zoom stands: at Fit, where Zoom out does nothing, and at its limit, where Zoom in does nothing. */\nexport interface ZoomRange {\n    /** Whether it stands at Fit. */\n    readonly atFit: boolean;\n    /** Whether it stands at its limit. */\n    readonly atLimit: boolean;\n}\n\n/** What the strip says: a builder's message table holds each. */\nexport interface ZoomWords {\n    /** The strip's accessible name: `Zoom`. */\n    zoomLabel(): string;\n    /** `Zoom out`. */\n    zoomOut(): string;\n    /** `Zoom in`. */\n    zoomIn(): string;\n    /** `Fit`: the whole drawing in view. */\n    fit(): string;\n}\n\n/** Props of {@link ZoomStrip}. */\nexport interface ZoomStripProps {\n    /** The builder it stands in, as `data-<scope>-zoom` names it: `schematic`, `flowchart`. */\n    readonly scope: string;\n    /** What it says. */\n    readonly words: ZoomWords;\n    /** Where the zoom stands. */\n    readonly range: ZoomRange;\n    /** Zooms by a factor: {@link ZOOM_STEP}, or its inverse. */\n    readonly onZoom: (factor: number) => void;\n    /** Puts the whole drawing in view. */\n    readonly onFit: () => void;\n    /** Fills its row with equal buttons, as in a View's popover. */\n    readonly fullWidth?: boolean | undefined;\n}\n\n/**\n * The zoom strip — see the module docs.\n *\n * @param props - Its builder, words, range and what each button does\n * @returns Its group of three buttons\n */\nexport function ZoomStrip({ scope, words, range, onZoom, onFit, fullWidth = false }: ZoomStripProps) {\n    const seg = useSlotRecipe({ key: \"seg\" })({ fullWidth }) as Styles;\n    return (\n        <Box css={seg.root} role=\"group\" aria-label={words.zoomLabel()} {...{ [`data-${scope}-zoom`]: \"\" }}>\n            <chakra.button type=\"button\" css={seg.item} aria-label={words.zoomOut()} title={words.zoomOut()} disabled={range.atFit}\n                onClick={() => onZoom(1 / ZOOM_STEP)}>\n                <FontAwesomeIcon icon={faMinus} aria-hidden=\"true\" />\n            </chakra.button>\n            <chakra.button type=\"button\" css={seg.item} aria-label={words.zoomIn()} title={words.zoomIn()} disabled={range.atLimit}\n                onClick={() => onZoom(ZOOM_STEP)}>\n                <FontAwesomeIcon icon={faPlus} aria-hidden=\"true\" />\n            </chakra.button>\n            <chakra.button type=\"button\" css={seg.item} aria-label={words.fit()} title={words.fit()} onClick={onFit}>\n                <FontAwesomeIcon icon={faExpand} aria-hidden=\"true\" />\n            </chakra.button>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's toolbar items (#1245, `Flowchart Builder Spec.md` §7.1,\n * FB8, FB9; `Flowchart Records Spec.md` R17, R42) — every control the\n * flowchart has, as items of its frame's one toolbar, in this order: find\n * state, LR · TD, the zoom — Zoom out, Zoom in and Fit, the strip the\n * Schematic draws (`shared/schedule/zoom.tsx`) — and the freshness chip at the\n * row's start; the rail over the flowchart's `Slice.bindRecords` (#1346) at\n * its end — each source's fields in source order, the presets, and one summary\n * counting each source — and last the history item over the records' one\n * history, where the flowchart edits (#1503). The canvas draws no eyebrow of\n * its own. Every word the items say is the Flowchart's message table's.\n *\n * They fold on one ladder: the rail first, in its own order (#952) — its\n * fields into their summary chips, then one chip, then its icon, and its\n * summary after every step of the rail (`SUMMARY_RANK`) — then the freshness\n * chip goes, LR · TD folds into one chip naming the orientation, whose menu\n * holds both, and find state's box folds to its icon, which opens the box in\n * the edit popover; then, one move, the zoom's strip folds into find state's\n * popover, the View — and with a rail LR · TD with it, so a phone's row keeps\n * the rail and Save. A flowchart with no state to find keeps its strip. The\n * history item's step (`DEFAULT_RANK`) comes after all of them. Nothing wraps,\n * scrolls or goes to a second row, and on a coarse pointer every control is a\n * 44px target by its box or by its halo, the row's height its own. On a\n * phone, where find state is Search Records, the View is a button of its own\n * beside it, holding the strip — and LR · TD with a rail — which leave the\n * row, as the Schematic's tools and zoom do.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport { Box, useRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSlicesChromeType } from \"@elaraai/east-ui/internal\";\nimport { HOST_RANK, useRecordSlicesToolbarItems } from \"@elaraai/east-ui-components/internal\";\nimport { useKeySearchToolbarItem, type KeySearchSource, type ToolbarItem } from \"@elaraai/east-ui-components\";\nimport { Seg, SegMenu } from \"../shared/schedule/segments.js\";\nimport { ZoomStrip, type ZoomRange } from \"../shared/schedule/zoom.js\";\nimport type { FlowchartWords } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The canvas's orientation: left to right, or top down. */\nexport type FlowchartOrientation = \"LR\" | \"TD\";\n\n/**\n * The Flowchart's own fold ranks, after every step of the slice rail's\n * (#952): the freshness chip goes, LR · TD folds into its chip, find state\n * into its icon, and last the zoom's strip — with a rail, LR · TD with it —\n * into find state's View. The history item's step (`DEFAULT_RANK`) comes\n * after them.\n */\nexport const FLOWCHART_RANK = {\n    freshness: HOST_RANK,\n    orientation: HOST_RANK + 1,\n    seek: HOST_RANK + 2,\n    controls: HOST_RANK + 3,\n} as const;\n\n/** The bundle the zoom's strip folds into find state's View in — with a rail, LR · TD with it: one move. */\nexport const FLOWCHART_CONTROLS = \"flowchart.controls\";\n\n/** LR · TD's segments, in order. */\nconst ORIENTATIONS: ReadonlyArray<{ key: FlowchartOrientation; label: string }> = [\n    { key: \"LR\", label: \"LR\" },\n    { key: \"TD\", label: \"TD\" },\n];\n\n/** What the freshness chip says: the evidence the flow was drawn from, and when. */\nexport interface FlowchartFreshness {\n    /** Its label (`scans-2026.09`). */\n    readonly label: string;\n    /** Its stamp, when it has one. */\n    readonly date: Date | undefined;\n}\n\n/** What the Flowchart's toolbar items show and drive. */\nexport interface FlowchartToolbarProps {\n    /** The `flowchart` recipe's styles: the freshness chip's dot. */\n    readonly styles: Styles;\n    /** Find state's source (`find.ts`) — `undefined` with no state to seek. */\n    readonly find: KeySearchSource | undefined;\n    /** The canvas's orientation. */\n    readonly orientation: FlowchartOrientation;\n    /** Turns the canvas. */\n    readonly onOrientation: (orientation: FlowchartOrientation) => void;\n    /** The freshness chip — `undefined` when the flowchart has none. */\n    readonly freshness: FlowchartFreshness | undefined;\n    /** The Flowchart's words: the items' labels, and the formatters the chip's date prints with, in the app's locale. */\n    readonly words: FlowchartWords;\n    /** The history item over the records' one history (`historyToolbarItem`) — where the flowchart edits; `undefined` where it does not. */\n    readonly history?: ToolbarItem | undefined;\n    /** The rail (#1346): one over the flowchart's `Slice.bindRecords`, its affordances and its persistence; `undefined` with no slice. */\n    readonly chrome?: ValueTypeOf<RecordSlicesChromeType> | undefined;\n    /** What the rail's summary counts each source in, by its name — `states`, `state cards`, `owners`. */\n    readonly nouns?: Readonly<Record<string, string>> | undefined;\n    /** Where the canvas's zoom stands (R42): at Fit Zoom out is off, at the cards' own size Zoom in. */\n    readonly zoom: ZoomRange;\n    /** Zooms the canvas about its middle by a factor. */\n    readonly onZoom: (factor: number) => void;\n    /** Puts the whole flowchart in view. */\n    readonly onFit: () => void;\n}\n\n/**\n * The Flowchart's toolbar items, in §7.1's order and on its fold ladder (see\n * the module docs) — for its frame's one toolbar.\n *\n * @param props - What the items show and drive\n * @returns The items, a falsy entry for each the flowchart has no use for\n */\nexport function useFlowchartToolbarItems({\n    styles, find, orientation, onOrientation, freshness, words, history, chrome, nouns, zoom, onZoom, onFit,\n}: FlowchartToolbarProps): ReadonlyArray<ToolbarItem | false | undefined> {\n    // Find state: its box, or its icon, which opens the box, on a row short of room — and last its popover, the View,\n    // holding the zoom's strip over its box — and, beside a rail, LR · TD — the strip and the orientation's chip gone in\n    // the same move. On a phone the View is a button of its own beside Search Records.\n    const folds = find !== undefined;\n    const combine = chrome !== undefined && folds;\n    const m = words.m;\n    const turn = m.orientationLabel();\n    // The View, made again only as what it shows moves: the item it gives the row is then the same (#1398, CL9).\n    const compact = useMemo(() => (find === undefined ? undefined : {\n        label: m.viewLabel(),\n        controls: (\n            <Box css={styles.toolbarControls} data-flowchart-view=\"\">\n                {combine && <Seg label={turn} name=\"orientation\" scope=\"flowchart\" items={ORIENTATIONS} active={orientation} onPick={onOrientation} fullWidth />}\n                <ZoomStrip scope=\"flowchart\" words={m} range={zoom} onZoom={onZoom} onFit={onFit} fullWidth />\n            </Box>\n        ),\n        phoneView: true,\n    }), [find, m, styles.toolbarControls, combine, turn, orientation, onOrientation, zoom, onZoom, onFit]);\n    const seek = useKeySearchToolbarItem(find, { rank: FLOWCHART_RANK.seek, label: m.findLabel(), compact });\n    // The zoom's strip in the row: Zoom out, Zoom in and Fit (R42).\n    const strip = <ZoomStrip scope=\"flowchart\" words={m} range={zoom} onZoom={onZoom} onFit={onFit} />;\n    // The rail (#1346): one over every source of the flowchart's slice, each counted in its own noun.\n    const rail = useRecordSlicesToolbarItems(chrome?.slice, {\n        ...(nouns === undefined ? {} : { nouns }),\n        ...(chrome === undefined ? {} : { affordances: chrome.affordances.map((a) => a.type) }),\n        ...(chrome?.persist.type === \"some\" ? { persist: chrome.persist.value.type } : {}),\n    });\n    // The freshness chip: the shared chip, its dot first and its date muted after its label.\n    const chipRecipe = useRecipe({ key: \"chip\" });\n    const chip = freshness === undefined ? undefined : (\n        <Box as=\"span\" css={chipRecipe({ tone: \"neutral\" })} data-flowchart-freshness=\"\">\n            <Box as=\"span\" css={styles.freshnessDot} />\n            <Box as=\"span\">{freshness.label}</Box>\n            {freshness.date !== undefined && <Box as=\"span\" data-chip-meta=\"\">{words.monthDay(freshness.date)}</Box>}\n        </Box>\n    );\n    return [\n        seek !== undefined ? { ...seek, rank: [FLOWCHART_RANK.seek, FLOWCHART_RANK.controls], bundle: [undefined, FLOWCHART_CONTROLS] } : seek,\n        {\n            key: \"orientation\",\n            rank: combine ? [FLOWCHART_RANK.orientation, FLOWCHART_RANK.controls] : FLOWCHART_RANK.orientation,\n            bundle: combine ? [undefined, FLOWCHART_CONTROLS] : undefined,\n            forms: [\n                <Seg label={turn} name=\"orientation\" scope=\"flowchart\" items={ORIENTATIONS} active={orientation} onPick={onOrientation} />,\n                <SegMenu label={turn} name=\"orientation\" scope=\"flowchart\" items={ORIENTATIONS} active={orientation} onPick={onOrientation} />,\n                ...(combine ? [null] : []),\n            ],\n            // On a phone, in the View beside Search Records.\n            ...(combine ? { phone: { form: null } } : {}),\n        },\n        {\n            key: \"zoom\",\n            rank: FLOWCHART_RANK.controls,\n            bundle: FLOWCHART_CONTROLS,\n            forms: folds ? [strip, null] : [strip],\n            // On a phone, in the View beside Search Records.\n            ...(folds ? { phone: { form: null } } : {}),\n        },\n        chip !== undefined && { key: \"freshness\", rank: FLOWCHART_RANK.freshness, forms: [chip, null] },\n        ...rail,\n        history,\n    ];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Flowchart's drop target (#1501, `Flowchart Records Spec.md` R14, D5,\n * D8): what the frame hands the canvas and the library so that a library card\n * lands, each drop — and each card's ⏎ — one step of the editing's history.\n *\n * - **The target** registers while a tab of the library drops, on the\n *   Flowchart's drop target (`flowchartKeys(name).surface`), taking the cards\n *   of every such tab: the Steps, Transitions and Lanes tabs', and an author's\n *   tab's whose patch names a kind. A Flowchart that edits nothing still takes\n *   a drag: its drop is refused, the ghost saying why, never lost on nothing.\n * - **The canvas's part** ({@link FlowchartCanvasDrop}) plans a drop over the\n *   Flowchart as it stands (`drop.ts`' `planDrop`), says where it lands in the\n *   ghost's caption and to a screen reader, and vetoes what it refuses; the\n *   canvas works out where a drag rests from its own drawing.\n * - **A card's ⏎** — and, on a touch screen or below 480px of main, a tap on\n *   the selected card — drops it on the canvas's selection (`enterAt`);\n *   refused, the footer says why, and a drop that lands clears it.\n *\n * Below 480px of main no card drags: no target registers and the canvas has\n * no drop cell, and a card's ⏎ — a tap on the selected card — is how a card\n * lands.\n *\n * A state or a lane a drop adds is selected. Every function the parts hold\n * reads the frame's latest state, so the parts stay put while the Flowchart\n * takes drops.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport type { flowchartKeys } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, useDragTarget, type DragEventValue, type DragPayload, type DragTargetConfig } from \"@elaraai/east-ui-components\";\nimport {\n    cardOf, dropCaption, dropEdits, dropHostOf, dropLabel, dropName, dropRefusal, droppedSelection, enterAt, landsOf, planDrop, readDropAt,\n    type FlowchartCanvasDrop, type FlowchartDropAt, type FlowchartDropCard, type FlowchartDropContext, type FlowchartDropPlan,\n} from \"./drop.js\";\nimport type { FlowchartHolding, GestureEdits } from \"./edits.js\";\nimport { flowchartLibraryId } from \"./library.js\";\nimport type { FlowchartWords } from \"./messages.js\";\nimport type { FlowchartValue } from \"./model.js\";\nimport type { FlowchartSelection } from \"./selection.js\";\n\n/** The names a Flowchart keeps its viewer's state under. */\ntype FlowchartKeys = ReturnType<typeof flowchartKeys>;\n\n/** What the frame hands its drop target. */\nexport interface FlowchartDropProps {\n    /** The payload: its library's tabs, and its kinds' cards. */\n    readonly value: FlowchartValue;\n    /** The names the Flowchart keeps its state under: its library's id, and its drop target. */\n    readonly keys: FlowchartKeys;\n    /** The Flowchart as it stands now — never a render's copy: what a drop plans over. */\n    readonly context: () => FlowchartDropContext;\n    /** What the Flowchart holds now: what a drop's edits are made over. */\n    readonly holding: () => FlowchartHolding;\n    /**\n     * Records a drop's edits as one step of the history, under its name — every row whose key its kind builds from it\n     * following its fields, and a refusal said in the footer (#1549).\n     *\n     * @returns The edits recorded; `undefined` where nothing was\n     */\n    readonly record: (made: GestureEdits, label: string) => GestureEdits | undefined;\n    /** What the canvas has selected now. */\n    readonly selection: () => FlowchartSelection | null;\n    /** Selects the state or the lane a drop added — scrolling it into view, for a card's ⏎. */\n    readonly select: (selection: FlowchartSelection, scroll: boolean) => void;\n    /** Says why a card's ⏎ was refused, in the footer; `undefined` clears it. */\n    readonly notice: (text: string | undefined) => void;\n    /** The Flowchart's words. */\n    readonly words: FlowchartWords;\n    /** Whether a card drags onto the canvas: `false` below 480px of main, where no target registers and the canvas has no drop cell. */\n    readonly drags?: boolean | undefined;\n}\n\n/** What the drop target hands the canvas and the library. */\nexport interface FlowchartDropState {\n    /** The canvas's drop cell; `undefined` while no tab of the library drops, or no card drags. */\n    readonly canvas: FlowchartCanvasDrop | undefined;\n    /** A card's ⏎: the card, by its library and its key, dropped on the canvas's selection. */\n    readonly enter: (library: string, key: string) => void;\n}\n\n/**\n * The Flowchart's drop target — see the module docs.\n *\n * @param props - The payload, the Flowchart's keys, how a drop reads the Flowchart and records itself, the canvas's\n *   selection, what a drop selects, the footer's line, and the words\n * @returns The canvas's drop cell, and a card's ⏎\n */\nexport function useFlowchartDrop(props: FlowchartDropProps): FlowchartDropState {\n    const { value, keys, drags = true } = props;\n    // The latest props, which every function of the parts reads: the parts stay put.\n    const latest = useRef(props);\n    latest.current = props;\n    // Each tab of the library that drops, under the library its cards drag from.\n    const host = useMemo(() => dropHostOf(keys.surface, (tabKey) => flowchartLibraryId(keys, tabKey), value.library, {\n        states: value.states.templates,\n        transitions: getSomeorUndefined(value.transitions)?.templates ?? [],\n        lanes: getSomeorUndefined(value.lanes)?.templates ?? [],\n    }), [keys, value.library, value.states, value.transitions, value.lanes]);\n    const drops = host.libraries.size > 0;\n\n    /** What a card's drop where a drag rests does, over the Flowchart as it stands now. */\n    const plan = useCallback((card: FlowchartDropCard, at: FlowchartDropAt): FlowchartDropPlan => planDrop(card, at, latest.current.context()), []);\n    /** A completed drag, or a candidate: the card it carries, and what its drop does. */\n    const read = useCallback((event: DragEventValue): { readonly card: FlowchartDropCard; readonly plan: FlowchartDropPlan } | undefined => {\n        if (event.type !== \"add\") return undefined;\n        const card = cardOf(host, event.value.from.library, event.value.from.key);\n        const at = readDropAt(event.value.into.row);\n        return card === undefined || at === undefined ? undefined : { card, plan: plan(card, at) };\n    }, [host, plan]);\n    /** Records a plan as one step of the history — the footer's line cleared, and the state or lane it adds selected; whether it was recorded. */\n    const run = useCallback((card: FlowchartDropCard, planned: FlowchartDropPlan, scroll: boolean): boolean => {\n        const p = latest.current;\n        if (planned.kind === \"refused\") return false;\n        const edits = dropEdits(planned, p.holding());\n        const recorded = edits === undefined ? undefined : p.record(edits, dropLabel(planned, card, p.words.m));\n        if (recorded === undefined) return false;\n        const selection = droppedSelection(planned, recorded);\n        if (selection !== undefined) p.select(selection, scroll);\n        return true;\n    }, []);\n\n    // The Flowchart's drop target, taking the cards of every tab of its library that drops — while a card drags.\n    const target = useMemo((): DragTargetConfig | null => (!drops || !drags ? null : {\n        id: host.surface,\n        sources: [...host.libraries.keys()],\n        kinds: { add: true },\n        onDrag: (event) => {\n            const drop = read(event);\n            return drop !== undefined && run(drop.card, drop.plan, false);\n        },\n    }), [drops, drags, host, read, run]);\n    useDragTarget(target);\n\n    const canvas = useMemo((): FlowchartCanvasDrop | undefined => {\n        if (!drops || !drags) return undefined;\n        const cardOfPayload = (payload: DragPayload): FlowchartDropCard | undefined =>\n            (payload.kind === \"item\" ? cardOf(host, payload.from.library, payload.from.key) : undefined);\n        /** What a drop of what a drag carries does where its coordinate says it rests. */\n        const planAt = (row: string, payload: DragPayload): FlowchartDropPlan | undefined => {\n            const card = cardOfPayload(payload);\n            const at = readDropAt(row);\n            return card === undefined || at === undefined ? undefined : plan(card, at);\n        };\n        return {\n            surface: host.surface,\n            cardOf: cardOfPayload,\n            plan,\n            canDrop: (event) => {\n                const drop = read(event);\n                return drop !== undefined && drop.plan.kind !== \"refused\";\n            },\n            options: {\n                caption: (coord, payload) => {\n                    const planned = planAt(coord.row, payload);\n                    return planned === undefined ? undefined : dropCaption(planned, latest.current.words.m);\n                },\n                name: (coord, payload) => {\n                    const planned = planAt(coord.row, payload);\n                    return planned === undefined ? \"\" : dropName(planned, latest.current.words.m);\n                },\n            },\n        };\n    }, [drops, drags, host, plan, read]);\n\n    // A card's ⏎: a drop on the canvas's selection — refused, the footer says why.\n    const enter = useCallback((libraryId: string, key: string) => {\n        const card = cardOf(host, libraryId, key);\n        if (card === undefined) return;\n        const p = latest.current;\n        const context = p.context();\n        const planned = planDrop(card, enterAt(landsOf(card), p.selection(), context.model), context);\n        if (planned.kind === \"refused\") {\n            p.notice(dropRefusal(planned, p.words.m));\n            return;\n        }\n        // Not refused: whatever the footer said of an earlier ⏎ no longer holds — though a drop that changes nothing records nothing.\n        p.notice(undefined);\n        run(card, planned, true);\n    }, [host, run]);\n\n    return { canvas, enter };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraFlowchart` — the Flowchart (#1500–#1505, `Flowchart Records\n * Spec.md`): one flowchart over the app's records, laid out in `BuilderFrame`\n * wherever it is used. There is no other flowchart: no canvas without the\n * frame, and no toolbar but its one.\n *\n * It registers itself against the `Flowchart` extension (`Flowchart.Component`)\n * as the module loads. Its payload carries four records of the app's — its\n * states and transitions, each read through its source of the rail, and its\n * lanes and decisions, small records read whole — and the canvas's options.\n * Every word it says is its message table's, made from its nouns — each\n * kind's own `name`, and the app's words for a transition's kinds (#1516). The\n * frame places its parts in its regions, over one shared state — the rows\n * read with the drafts in place, the model drawn from them, the editing, the\n * orientation and what is selected:\n *\n * - **the reads** (`read.ts`): every kind read page by page until done, the\n *   states and transitions through their sources of the rail; as the rail\n *   moves, a kind is read again and what the canvas drew stands in, retained —\n *   readable and selectable, no record taking an edit until the new rows land;\n *   and a read that fails is said once on the canvas, in a box at its top-left\n *   with Retry, as the footer's loading line says it (R5). Under `narrowed:\n *   \"dim\"` every row is read and what the rail leaves out is drawn dimmed, its\n *   keys the source's shown keys (`FollowSources`);\n * - **the details** (`details.ts`): a state's and a transition's details read\n *   as their kind is — whole, or by the keys of the rows drawn, every key in\n *   one request — in a reader of their own, counted into the flowchart's bins;\n *   what no bin holds, and the bins the app binds refused, listed in Issues;\n * - **the editing** (`editing.ts`): one history over a session per record that\n *   writes; every gesture on the canvas, every drop and every edit the\n *   inspector makes is one step of it (`edits.ts`). Its history item ends the\n *   toolbar — ⌘Z undoing and ⇧⌘Z or ⌘Y redoing from anywhere in the frame but\n *   a field being typed into, each key going no further than the Flowchart\n *   (`takeKey`) — and each session's banners sit under it;\n * - **the toolbar** (`toolbar.tsx`): Find — ⌘F or Ctrl+F from anywhere in the\n *   frame — which finds a state the rail hides too, and picks it by clearing\n *   just the choices hiding it (the shared hidden pick, `HideSources`), LR · TD,\n *   the zoom — Zoom out, Zoom in and Fit, through the canvas's handle, the\n *   canvas telling it where the zoom stands (R42) — and the freshness chip, and\n *   at the row's end the rail;\n * - **the library** (`library.tsx`), the start pane: the Steps, Transitions\n *   and Lanes tabs and the author's own, their cards dropped onto the canvas\n *   (`use-drop.ts`);\n * - **the inspector** (`inspector.tsx`), the end pane: what is selected, and\n *   the flowchart's issues — each one selecting what it names, an unsaved\n *   change the rail hides by the same hidden pick. An issue gone to, from the\n *   toolbar or from its line in Issues, asks its row's Details for the field\n *   it names, which takes the keyboard there, the inspector opened at Details\n *   where it is collapsed or at Issues;\n * - **the footer** (`footer.tsx`): the counts, the changes waiting on Save,\n *   the last save, each Save's notice, a refused gesture's words, and the\n *   loading line — `Loading states…`, `Updating states…`, or a failed read\n *   with Retry — shown on the frame's one reveal clock (`LoadingReveal`).\n *\n * Below 480px of main, measured by the canvas's element, nothing drags (R17):\n * the library's cards are not dragged — a card's ⏎ drops it — and the canvas\n * neither moves a state nor connects one, by touch or by mouse; the inspector\n * carries a state's lane and a transition's ends.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useLayoutEffect, useMemo, useRef, useState, type KeyboardEvent } from \"react\";\nimport { Box, Button, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { ArrayType, StringType, equalFor, equivalentFor, none, type PatchPath } from \"@elaraai/east\";\nimport { EditingBatchReadinessType } from \"@elaraai/east-ui/internal\";\nimport { Flowchart, flowchartKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, BuilderFrame, SessionBanners, fieldBreachText, fieldBreaches, fieldFormMessages, focusKeySearch, getSomeorUndefined, historyShortcut,\n    historyToolbarItem, implementUIComponent, takeKey, typedInto, useContainerBelow, useDataStable, useFormatters,\n    type EditIssue, type FieldBreach, type HistoryAction, type Origin,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingReveal, loadingLineText, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport { isBounded } from \"../shared/bounds.js\";\nimport { pagedLoadingLine } from \"../shared/loading.js\";\nimport { DraftedStanding } from \"../shared/schedule/drafted-rows.js\";\nimport { FieldAskProvider, useFieldAsks } from \"../shared/schedule/field-ask.js\";\nimport { FollowSources, type FollowedSources } from \"../shared/schedule/follow-sources.js\";\nimport type { SourceHiding } from \"../shared/schedule/hidden.js\";\nimport { HideSources, useHiddenPick, type HiddenPicks, type HiddenSource } from \"../shared/schedule/hidden-pick.js\";\nimport { draftedRow, rowCodec } from \"../shared/schedule/records.js\";\nimport { sourcePart, type KeyVisibilityWords } from \"../shared/schedule/visibility.js\";\nimport { NARROW_WIDTH } from \"../shared/schedule/window.js\";\nimport { kindPlural } from \"../shared/schedule/words.js\";\nimport type { ZoomRange } from \"../shared/schedule/zoom.js\";\nimport { FlowchartCanvasView, type FlowchartCanvasEdit, type FlowchartCanvasFailure, type FlowchartCanvasHandle, type FlowchartReveal } from \"./canvas.js\";\nimport { FlowchartDetailsReader, NO_DETAILS, askDetailsAgain, detailsKindsOf, flowchartDetailsModel, useDrawnKeys, type FlowchartDetailsData } from \"./details.js\";\nimport { draftedRows, landedDrafts, landedRead, type FlowchartDimmed } from \"./drafted.js\";\nimport type { FlowchartDropContext } from \"./drop.js\";\nimport { kindOf, useFlowchartEditing, type FlowchartKeyCheckWords } from \"./editing.js\";\nimport {\n    EDIT_ORIGIN, addLane, addState, connect, deleteDecision, deleteLane, deleteLink, deleteStates, followBuiltKeys, moveStates, renameLane, renameState,\n    type FlowchartGesture, type FlowchartHolding, type FlowchartRefusal, type GestureEdits,\n} from \"./edits.js\";\nimport { useFlowchartFind, type FindableState, type FoundState } from \"./find.js\";\nimport { FlowchartFooter, useLastSaves, type FlowchartNotice } from \"./footer.js\";\nimport { flowchartInspectorPane } from \"./inspector.js\";\nimport {\n    conflictValueName, flowchartIssues, selectionOf, sessionIssues, type FlowchartBreach, type FlowchartBreachWords, type FlowchartIssueArgs, type FlowchartKeyFields,\n} from \"./issues.js\";\nimport { useFlowchartLibrary } from \"./library.js\";\nimport { DEFAULT_FLOWCHART_NOUNS, flowchartMessagesOf, type FlowchartNouns, type FlowchartRefusalWord, type FlowchartWords } from \"./messages.js\";\nimport { buildModel, flowchartKindKeys, type FlowchartValue } from \"./model.js\";\nimport { useViewerOrientation } from \"./orientation.js\";\nimport { FLOWCHART_SORTS, FlowchartDataReader, INITIAL_FLOWCHART_DATA, SOURCE_SORTS, type FlowchartData, type FlowchartSort } from \"./read.js\";\nimport { selectionHeld, type FlowchartSelection } from \"./selection.js\";\nimport { followedSources, sourceNouns } from \"./sources.js\";\nimport { useFlowchartToolbarItems } from \"./toolbar.js\";\nimport { useFlowchartDrop } from \"./use-drop.js\";\n\nexport type { FlowchartValue } from \"./model.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\nconst payloadEqual = equivalentFor(Flowchart.Types.Payload);\nconst stringEqual = equalFor(StringType);\nconst readinessesEqual = equalFor(ArrayType(EditingBatchReadinessType));\n\n/** Where the zoom stands until the canvas is measured (R42): at the cards' own size, which is Fit — both ends. */\nconst OPENS_ZOOMED: ZoomRange = { atFit: true, atLimit: true };\n\n/** Props of {@link EastChakraFlowchart}. */\nexport interface EastChakraFlowchartProps {\n    /** The payload, decoded. */\n    readonly value: FlowchartValue;\n    /** The structural storage key: the editing's sessions are kept under it and the Flowchart's `name`. */\n    readonly storageKey: string;\n}\n\n/** A session's kind as the Flowchart names its kinds: `undefined` for none of them. */\nfunction sortOf(kind: string): FlowchartSort | undefined {\n    return FLOWCHART_SORTS.find((sort) => stringEqual(sort, kind));\n}\n\n/**\n * The nouns the Flowchart's words are made from (#1516): each kind's own\n * `name` — its default where the Flowchart has no such kind — and the app's\n * words for a transition's kinds, its `vocabulary`.\n *\n * @param value - The payload\n * @returns The nouns, each as a heading writes it\n */\nfunction flowchartNouns(value: FlowchartValue): FlowchartNouns {\n    return {\n        state: value.states.name,\n        transition: kindOf(value, \"transitions\")?.name ?? DEFAULT_FLOWCHART_NOUNS.transition,\n        lane: kindOf(value, \"lanes\")?.name ?? DEFAULT_FLOWCHART_NOUNS.lane,\n        decision: kindOf(value, \"decisions\")?.name ?? DEFAULT_FLOWCHART_NOUNS.decision,\n        planned: value.vocabulary.planned,\n        observed: value.vocabulary.observed,\n    };\n}\n\n/**\n * Renders the Flowchart: its records read, and its frame over them — see the\n * module docs.\n *\n * @param props - The payload, and the storage key\n * @returns The Flowchart\n */\nexport const EastChakraFlowchart = memo(function EastChakraFlowchart({ value, storageKey }: EastChakraFlowchartProps) {\n    const [data, setData] = useState<FlowchartData>(INITIAL_FLOWCHART_DATA);\n    // A Retry reads every kind again: each source of the rail a kind is read through asked anew — its pages, a failed\n    // one among them, which it holds until then — as the Schematic's Retry asks its kind's, the details' paged reads\n    // asked again at once (R34), and the read's attempt moves.\n    const [attempt, setAttempt] = useState(0);\n    const slice = value.slice;\n    const readAgain = useCallback(() => {\n        const chrome = getSomeorUndefined(slice);\n        for (const sort of SOURCE_SORTS) sourcePart(chrome, sort)?.retry();\n        askDetailsAgain(detailsKindsOf(value));\n        setAttempt((n) => n + 1);\n    }, [slice, value]);\n    return (\n        <>\n            <FlowchartDataReader value={value} attempt={attempt} onData={setData} />\n            <FlowchartFollows value={value} data={data} attempt={attempt} readAgain={readAgain} storageKey={storageKey} />\n        </>\n    );\n}, (prev, next) => payloadEqual(prev.value, next.value) && prev.storageKey === next.storageKey);\n\n/** Props of {@link FlowchartFollows}. */\ninterface FlowchartFollowsProps {\n    /** The payload, decoded. */\n    readonly value: FlowchartValue;\n    /** What the reader has read. */\n    readonly data: FlowchartData;\n    /** The read's attempt: a Retry moves it, and the details are read again with the records. */\n    readonly attempt: number;\n    /** Reads every kind again: the loading line's Retry. */\n    readonly readAgain: () => void;\n    /** The structural storage key. */\n    readonly storageKey: string;\n}\n\n/**\n * The sources of the rail the Flowchart follows — each library tab's, and,\n * under `narrowed: \"dim\"`, the states' and the transitions' — each counted in\n * its noun; and the states and the transitions read through their sources,\n * each one's hidden pick (`HideSources`), which Find and Issues pick by.\n *\n * @param props - The payload, what is read, its Retry and the storage key\n * @returns The frame, once every source is read\n */\nfunction FlowchartFollows(props: FlowchartFollowsProps) {\n    const { value } = props;\n    const formatters = useFormatters();\n    // Its words, made from its nouns (#1516): each kind's own name, and the app's words for a transition's kinds.\n    const words = useMemo((): FlowchartWords => ({ ...formatters, m: flowchartMessagesOf(flowchartNouns(value)) }), [formatters, value]);\n    const chrome = useMemo(() => getSomeorUndefined(value.slice), [value.slice]);\n    const sources = useMemo(() => followedSources(value), [value]);\n    const nouns = useMemo(() => sourceNouns(value, words.m, words.locale), [value, words]);\n    // What a source's failed narrowing says, in the Flowchart's words.\n    const said = useCallback((name: string): KeyVisibilityWords => ({ changed: words.m.sourceChanged({ name }), failed: words.m.sourceFailed({ name }) }), [words]);\n    // The states and the transitions, each read through its source of the rail: each one's hidden pick, which asks e3 of\n    // a row at its kind's key type (#1549).\n    const hidden = useMemo(() => SOURCE_SORTS.flatMap((sort): HiddenSource[] => {\n        const kind = kindOf(value, sort);\n        const part = kind === undefined ? undefined : sourcePart(chrome, sort);\n        return kind === undefined || part === undefined ? [] : [{ key: sort, part, keyType: kind.keyType }];\n    }), [value, chrome]);\n    return (\n        <FollowSources chrome={chrome} narrowed={value.shown} sources={sources} nouns={nouns} said={said}>\n            {(followed) => (\n                <HideSources name=\"Flowchart\" sources={hidden}>\n                    {(picks) => <FlowchartFrame {...props} words={words} nouns={nouns} followed={followed} picks={picks} />}\n                </HideSources>\n            )}\n        </FollowSources>\n    );\n}\n\n/** Props of {@link FlowchartFrame}. */\ninterface FlowchartFrameProps extends FlowchartFollowsProps {\n    /** The Flowchart's words, in the app's locale. */\n    readonly words: FlowchartWords;\n    /** What the rail counts each source in, by its name. */\n    readonly nouns: ReadonlyMap<string, string>;\n    /** What each source the Flowchart follows shows. */\n    readonly followed: FollowedSources;\n    /** Each source's hidden pick, by its kind. */\n    readonly picks: HiddenPicks;\n}\n\n/**\n * A refusal in the footer's words (#1549): the row holding the key a row\n * builds, or the row whose key would move (#1580), named as the canvas names it\n * — a transition by its ends' states, a state by its label, else its key, a\n * lane by its label.\n *\n * @param refusal - Why the gesture records nothing\n * @param holding - What the Flowchart holds: the row named, among those drawn, hidden and waiting\n * @returns Its words\n */\nfunction refusalWord(refusal: FlowchartRefusal, holding: FlowchartHolding): FlowchartRefusalWord {\n    if (refusal.refusal === \"placeholder\" || refusal.refusal === \"untyped\") return refusal;\n    const { model, rows } = holding;\n    const key = refusal.key;\n    const waiting = holding.waiting.find((row) => row.sort === refusal.sort && stringEqual(row.key, key));\n    const stateName = (state: string): string => model.nodesByKey.get(state)?.label ?? state;\n    const labelled = (label: string | undefined): string => (label === undefined || label.length === 0 ? key : label);\n    const nameOf = (): string => {\n        switch (refusal.sort) {\n            case \"states\": return labelled(rows.states.find((row) => stringEqual(row.key, key))?.roles.label ?? (waiting?.sort === \"states\" ? waiting.roles.label : undefined));\n            case \"lanes\": return labelled(model.lanes.find((lane) => lane.band === \"lane\" && stringEqual(lane.key, key))?.label ?? (waiting?.sort === \"lanes\" ? waiting.roles.label : undefined));\n            case \"decisions\": return model.triggers.get(key)?.label ?? key;\n            case \"transitions\": return key;\n        }\n    };\n    if (refusal.refusal === \"unheld\") return { refusal: \"unheld\", name: nameOf(), by: refusal.by, why: refusal.why };\n    if (refusal.sort !== \"transitions\") return { refusal: \"taken\", sort: refusal.sort, name: nameOf() };\n    const roles = [...rows.transitions, ...holding.hidden].find((row) => stringEqual(row.key, key))?.roles\n        ?? (waiting?.sort === \"transitions\" ? waiting.roles : undefined);\n    return roles === undefined ? { refusal: \"taken\", sort: \"transitions\", name: key }\n        : { refusal: \"taken\", sort: \"transitions\", from: stateName(roles.from), to: stateName(roles.to) };\n}\n\n/**\n * What is selected, after a gesture moved rows under the keys their fields\n * build (#1549): a moved row's selection under its new key.\n *\n * @param selection - What was selected\n * @param moved - The rows moved\n * @returns The selection that follows them; `undefined` where none moved\n */\nfunction followMoves(selection: FlowchartSelection | null, moved: GestureEdits[\"moved\"]): FlowchartSelection | undefined {\n    if (selection === null || moved === undefined || moved.length === 0) return undefined;\n    const to = (sort: FlowchartSort, key: string) => moved.find((move) => move.sort === sort && stringEqual(move.key, key))?.to;\n    switch (selection.kind) {\n        case \"states\": {\n            const keys = selection.keys.map((key) => to(\"states\", key) ?? key);\n            return keys.some((key, i) => !stringEqual(key, selection.keys[i]!)) ? { kind: \"states\", keys } : undefined;\n        }\n        case \"state\": { const key = to(\"states\", selection.key); return key === undefined ? undefined : { kind: \"state\", key }; }\n        case \"link\": { const key = to(\"transitions\", selection.key); return key === undefined ? undefined : { kind: \"link\", key }; }\n        case \"lane\": { const key = to(\"lanes\", selection.key); return key === undefined ? undefined : { kind: \"lane\", key }; }\n        case \"trigger\": return undefined;\n    }\n}\n\n/** What the frame's gestures read as they are made, the latest render's: what is held, what is selected, and how a drop lands. */\ninterface Latest {\n    readonly holding: FlowchartHolding;\n    readonly selection: FlowchartSelection | null;\n    readonly context: FlowchartDropContext;\n}\n\n/**\n * The frame: the rows read with the drafts in place, the model drawn from\n * them, and every part over them — see the module docs.\n *\n * @param props - The payload, what is read, the words, and the rail's sources and picks\n * @returns The frame\n */\nfunction FlowchartFrame({ value, data, attempt, readAgain, storageKey, words, nouns, followed, picks }: FlowchartFrameProps) {\n    const recipe = useSlotRecipe({ key: \"flowchart\" });\n    const styles = useMemo(() => recipe() as Styles, [recipe]);\n    const m = words.m;\n    const name = getSomeorUndefined(value.name);\n    const keys = useMemo(() => flowchartKeys(name), [name]);\n    // Each kind's keys (#1549): each key's text, read back at its record's key type, and their order by it.\n    const rowKeys = useMemo(() => flowchartKindKeys(value), [value]);\n    const chrome = useMemo(() => getSomeorUndefined(value.slice), [value.slice]);\n    const kindName = useCallback((sort: FlowchartSort): string => kindOf(value, sort)?.name ?? sort, [value]);\n\n    // ── What stands in while a new narrowing is read ─────────────────────\n    // Under `dim`, a kind's shown keys resolving keeps the canvas's last rows; a failed one keeps them too.\n    const narrowingBusy = SOURCE_SORTS.some((sort) => {\n        const one = followed.get(sort);\n        return one !== undefined && one.shown.busy && one.error === undefined;\n    });\n    const stale = data.ready && (data.filtering || narrowingBusy);\n    const retained = stale || SOURCE_SORTS.some((sort) => followed.get(sort)?.error !== undefined);\n\n    // ── The editing: one history over a session per record that writes ─\n    // Each kind read through its source that writes: its Save's notice counts what leaves the source's narrowing.\n    const recordSlices = useMemo(() => SOURCE_SORTS.flatMap((sort) => {\n        const part = kindOf(value, sort)?.editable === true ? sourcePart(chrome, sort) : undefined;\n        return part === undefined ? [] : [part];\n    }), [value, chrome]);\n    const keyWords = useMemo((): FlowchartKeyCheckWords => ({ held: m.keyHeld, checking: m.keyChecking, placeholder: m.keyPlaceholder }), [m]);\n    const editing = useFlowchartEditing(value, `${storageKey}.${name ?? \"flowchart\"}`, recordSlices, data.held, keyWords, retained);\n    const history = editing.history;\n    const sessions = editing.schedule.sessions;\n\n    // ── The rows, the drafts in place, and the model drawn from them ────\n    // Under `dim`, what the rail leaves out of a kind read through its source is drawn dimmed: the keys it shows.\n    const dimmed = useMemo((): FlowchartDimmed => {\n        if (value.narrowed.type !== \"dim\") return {};\n        const of = (sort: FlowchartSort) => {\n            const shown = followed.get(sort)?.shown.keys;\n            return shown?.type === \"some\" ? (key: string) => !shown.value.has(key) : undefined;\n        };\n        return { states: of(\"states\"), transitions: of(\"transitions\") };\n    }, [value.narrowed, followed]);\n    // A kind read by key is confirmed as its rows land, while the reader hands the frame what it read only once every\n    // kind has: what a Save landed stands as the Save left it over stored rows read before it — at another revision than\n    // the one their record reads at now — and is let go once they are read at it, before paint, so no frame draws both.\n    const laidDrafts = useMemo(() => landedDrafts(editing.drafts, editing.landed, data.held, data.hiddenWith, data.revisions, data.now),\n        [editing.drafts, editing.landed, data.held, data.hiddenWith, data.revisions, data.now]);\n    const landed = editing.landed, shownLanded = editing.shown;\n    useLayoutEffect(() => {\n        for (const [sort, keys] of landedRead(landed, data.revisions, data.now)) shownLanded(sort, keys);\n    }, [landed, data.revisions, data.now, shownLanded]);\n    // Which drafted rows stand, and what the canvas last made its model of: what stands through a carry-over (`drafted.ts`).\n    const [standing] = useState(() => new DraftedStanding());\n    const drafted = useMemo(() => draftedRows(data.held, data.hiddenWith, laidDrafts, rowKeys, dimmed, standing),\n        [data.held, data.hiddenWith, laidDrafts, rowKeys, dimmed, standing]);\n    const model = useMemo(() => buildModel(drafted.rows, words), [drafted.rows, words]);\n\n    // ── The details: read by the rows drawn, in a reader of their own, and counted into the flowchart's bins ──\n    const [details, setDetails] = useState<FlowchartDetailsData>(NO_DETAILS);\n    const detailsKinds = useMemo(() => detailsKindsOf(value), [value]);\n    const drawn = useDrawnKeys(model);\n    const detailsModel = useMemo(() => flowchartDetailsModel(detailsKinds, details, drawn, words), [detailsKinds, details, drawn, words]);\n\n    // ── What is selected, and where the canvas looks ──────────────────\n    const [selected, setSelected] = useState<FlowchartSelection | null>(null);\n    const selection = useMemo(() => selectionHeld(selected, model), [selected, model]);\n    const [reveal, setReveal] = useState<FlowchartReveal | null>(null);\n    const revealSelection = useCallback((next: FlowchartSelection | null, scroll = true) => {\n        setSelected(next);\n        if (next !== null) setReveal((was) => ({ selection: next, seq: (was?.seq ?? 0) + 1, scroll }));\n    }, []);\n    // A gesture refused, a pick that could not clear the rail's choices: the footer's line says why.\n    const [notice, setNotice] = useState<string | undefined>(undefined);\n\n    // ── The gestures: each one step of the history ─────────────────────\n    const holding = useMemo((): FlowchartHolding => ({\n        model, rows: drafted.rows, hidden: drafted.hidden, waiting: drafted.waiting,\n        can: (sort) => editing.editable(sort) && editing.available(sort),\n        taken: (sort, key) => editing.taken(sort, key),\n        stands: (sort, key) => editing.stands(sort, key),\n        mintTransition: (minted) => editing.mintTransition(minted),\n        unqueues: editing.unqueues, wholeLaneOrders: editing.wholeLaneOrders,\n        newKey: (sort, made, madeUp, minted) => editing.newKey(sort, made, madeUp, minted),\n        moves: (edits) => editing.moves(edits),\n        // A state or a transition the rail narrows reads only its narrowing, under `\"hide\"`; under `\"dim\"` it reads every\n        // row, and a lane or a decision is read whole (#1580).\n        unheld: (sort) => {\n            if (!editing.editable(sort)) return undefined;\n            const narrows = (sort === \"states\" || sort === \"transitions\") && value.narrowed.type !== \"dim\";\n            if (narrows && (sourcePart(chrome, sort)?.read().where.size ?? 0) > 0) return \"filtered\";\n            return editing.available(sort) ? undefined : \"busy\";\n        },\n        created: (sort, key) => editing.drafts[sort].get(key)?.created === true,\n    }), [model, drafted, editing, value.narrowed, chrome]);\n    const context = useMemo((): FlowchartDropContext => ({\n        model,\n        editable: (sort) => editing.editable(sort),\n        available: (sort) => editing.available(sort),\n        kindName: (sort) => kindName(sort).toLocaleLowerCase(words.locale),\n        untyped: (sort) => editing.untyped(sort),\n    }), [model, editing, kindName, words.locale]);\n    // The latest render's, as a gesture reads them when it is made: set once the render commits, never as it renders.\n    const latest = useRef<Latest>({ holding, selection, context });\n    useLayoutEffect(() => { latest.current = { holding, selection, context }; });\n    const record = editing.record;\n    // Every gesture's one way into the history, a drop's too: every row whose kind builds its key from it following its\n    // fields (#1549); a refusal said in the footer, its words handed back; and what is selected following a row the\n    // gesture moves.\n    const recordGesture = useCallback((made: GestureEdits, origin: Origin, label: string):\n        { readonly done: GestureEdits } | { readonly said: string } | undefined => {\n        const { holding: now, selection: picked } = latest.current;\n        const followed = followBuiltKeys(now, made);\n        if (followed.refused !== undefined) {\n            const said = m.gestureRefused(refusalWord(followed.refused, now));\n            setNotice(said);\n            return { said };\n        }\n        if (followed.edits.length > 0 && !record(followed.edits, origin, label)) return undefined;\n        setNotice(undefined);\n        const follows = followMoves(picked, followed.moved);\n        if (follows !== undefined) setSelected(follows);\n        return { done: followed };\n    }, [record, m]);\n    const commit = useCallback((made: GestureEdits, origin: Origin, label: string): GestureEdits | undefined => {\n        const got = recordGesture(made, origin, label);\n        return got === undefined || \"said\" in got ? undefined : got.done;\n    }, [recordGesture]);\n    const act = useCallback((gesture: FlowchartGesture, build: (holding: FlowchartHolding) => GestureEdits | undefined): GestureEdits | undefined => {\n        const made = build(latest.current.holding);\n        return made === undefined ? undefined : commit(made, EDIT_ORIGIN[gesture], m.editLabel({ gesture }));\n    }, [commit, m]);\n    // A form's edit in the inspector, as every gesture's: refused, why, which Details says under the field too.\n    const edit = useCallback((gesture: FlowchartGesture, build: (holding: FlowchartHolding) => GestureEdits | undefined): boolean | string => {\n        const made = build(latest.current.holding);\n        const got = made === undefined ? undefined : recordGesture(made, EDIT_ORIGIN[gesture], m.editLabel({ gesture }));\n        return got === undefined ? false : \"said\" in got ? got.said : true;\n    }, [recordGesture, m]);\n    const edits = editing.edits;\n    const editable = editing.editable;\n    const untyped = editing.untyped;\n    const number = words.number;\n    // Why \"+ LANE\", \"+ STATE\" and a kind's library cards add nothing, of a kind edited at all: its keys can't be typed, and\n    // it builds none (#1549).\n    const keysOff = useMemo(() => {\n        const why = (sort: \"states\" | \"lanes\"): string | undefined => {\n            const type = editable(sort) ? untyped(sort) : undefined;\n            return type === undefined ? undefined : m.keysUntyped({ name: kindName(sort).toLocaleLowerCase(words.locale), type });\n        };\n        return { states: why(\"states\"), lanes: why(\"lanes\") };\n    }, [editable, untyped, m, kindName, words.locale]);\n    const canvasEdit = useMemo((): FlowchartCanvasEdit | undefined => {\n        if (!edits) return undefined;\n        const lanes = editable(\"lanes\"), states = editable(\"states\"), transitions = editable(\"transitions\"), decisions = editable(\"decisions\");\n        // The \"+ STATE\" editor types a new state's key where the states are keyed by String and build none.\n        const typed = states && rowKeys.states.text && !editing.builds(\"states\");\n        return {\n            off: keysOff,\n            addLane: lanes ? () => { act(\"addLane\", (h) => addLane(h, (n) => m.newLane({ n, count: number(n) }))); } : undefined,\n            renameLane: lanes ? (key, label) => { act(\"renameLane\", (h) => renameLane(h, key, label)); } : undefined,\n            deleteLane: lanes ? (key) => { act(\"deleteLane\", (h) => deleteLane(h, key)); } : undefined,\n            addState: states ? (band, key, label) => {\n                const made = act(\"addState\", (h) => addState(h, band, typed ? key : undefined, label));\n                const added = made?.key ?? key;\n                if (made !== undefined && added !== undefined) revealSelection({ kind: \"state\", key: added }, false);\n                return made !== undefined;\n            } : undefined,\n            stateKeyTaken: typed ? (key) => editing.taken(\"states\", key) : undefined,\n            renameState: states ? (key, label) => { act(\"renameState\", (h) => renameState(h, key, label)); } : undefined,\n            moveStates: states ? (keys, band, at) => { act(\"moveStates\", (h) => moveStates(h, keys, band, at)); } : undefined,\n            deleteStates: states ? (keys) => { act(\"deleteStates\", (h) => deleteStates(h, keys)); } : undefined,\n            connect: transitions ? (from, to) => {\n                const made = act(\"connect\", (h) => connect(h, from, to));\n                if (made?.key !== undefined) revealSelection({ kind: \"link\", key: made.key }, false);\n            } : undefined,\n            deleteLink: transitions ? (key) => { act(\"deleteLink\", (h) => deleteLink(h, key)); } : undefined,\n            deleteDecision: decisions ? (key) => { act(\"deleteDecision\", (h) => deleteDecision(h, key)); } : undefined,\n        };\n    }, [edits, editable, editing, act, m, number, revealSelection, keysOff, rowKeys]);\n\n    // ── The narrow layout: below 480px of main, measured by the canvas's element, which fills it ──\n    const mainRef = useRef<HTMLDivElement | null>(null);\n    const onCanvasElement = useCallback((element: HTMLDivElement | null) => { mainRef.current = element; }, []);\n    const narrow = useContainerBelow(mainRef, NARROW_WIDTH);\n    // Before the first read settles — the frame's cold load — the canvas draws nothing, never the empty records' band\n    // row and its \"+ LANE\" (`read.ts`): it is given no gesture, so a flowchart with nothing read is blank. Below 480px of\n    // main nothing drags (R17): the canvas moves no state and connects none, whatever the pointer — the inspector\n    // carries a state's lane and a transition's ends.\n    const canvasEdits = useMemo((): FlowchartCanvasEdit | undefined => {\n        if (!data.ready || canvasEdit === undefined) return undefined;\n        return narrow ? { ...canvasEdit, moveStates: undefined, connect: undefined } : canvasEdit;\n    }, [data.ready, canvasEdit, narrow]);\n\n    // ── The drops: a library card onto the canvas, as one step of the history ──\n    const drop = useFlowchartDrop({\n        value, keys, words,\n        context: () => latest.current.context,\n        holding: () => latest.current.holding,\n        record: (made, label) => commit(made, EDIT_ORIGIN.dropCard, label),\n        selection: () => latest.current.selection,\n        select: revealSelection,\n        notice: setNotice,\n        drags: !narrow,\n    });\n\n    // ── The hidden pick: Find's and Issues', clearing just the choices hiding a row, then selecting it once drawn ──\n    const pick = useHiddenPick<FlowchartSelection>({\n        onError: (said) => setNotice(said),\n        uncleared: m.hiddenUncleared(),\n        landing: {\n            drawn: (at) => !stale && selectionHeld(at, model) !== null,\n            selects: (at) => revealSelection(at),\n        },\n    });\n    const onFound = useCallback((found: FoundState) => {\n        setNotice(undefined);\n        const at: FlowchartSelection = { kind: \"state\", key: found.key };\n        pick.pick(found.hidden, at, () => { revealSelection(at); });\n    }, [pick, revealSelection]);\n    const goToWaiting = useCallback((at: FlowchartSelection, hidden: readonly SourceHiding[] | undefined) => {\n        pick.pick(hidden, at, () => { revealSelection(at); });\n    }, [pick, revealSelection]);\n\n    // ── Find: the states drawn, and those the rail hides through the states' source ──\n    const statesPart = useMemo(() => sourcePart(chrome, \"states\"), [chrome]);\n    const codec = useMemo(() => rowCodec(value.states.rowType), [value.states.rowType]);\n    const findable = useMemo(() => model.nodes.filter((node) => !node.ghost)\n        .map((node): FindableState => ({ key: node.key, label: node.label, dimmed: node.dimmed })), [model.nodes]);\n    const finder = useFlowchartFind({\n        part: statesPart, read: value.states.read, codec, keys: rowKeys.states, drawn: findable, stored: data.held.states, pick: picks.get(\"states\"),\n        dim: value.narrowed.type === \"dim\", words, onPick: onFound,\n    });\n    const find = useMemo(() => (finder === undefined ? undefined : pick.search(finder)), [finder, pick]);\n\n    // ── The history item, and a conflict's Go to ───────────────────────\n    // A row named as the canvas names it: a state by its key, a transition by its ends, a lane and a decision by their labels.\n    const rowName = useCallback((kind: string, key: string): string => {\n        switch (sortOf(kind)) {\n            case \"transitions\": {\n                const roles = drafted.rows.transitions.find((row) => stringEqual(row.key, key))?.roles;\n                return roles === undefined ? key : `${roles.from} → ${roles.to}`;\n            }\n            case \"lanes\": return model.lanes.find((lane) => stringEqual(lane.key, key))?.label ?? key;\n            case \"decisions\": return model.triggers.get(key)?.label ?? key;\n            default: return key;\n        }\n    }, [drafted.rows.transitions, model]);\n    const partOf = useCallback((issue: EditIssue) => {\n        const key = history.sourceOf(issue);\n        return key === undefined ? undefined : sessions.find((part) => stringEqual(part.key, key));\n    }, [history, sessions]);\n    // The field an issue gone to names, from the toolbar or from Issues, asked of its row's Details: it takes the keyboard\n    // there, the inspector opened where it is collapsed (`../shared/schedule/field-ask.tsx`) — a conflict's Go to, which\n    // names its path, asks none.\n    const { asks: fieldAsks, request: askField } = useFieldAsks();\n    const onIssue = useCallback((issue: EditIssue, at?: PatchPath) => {\n        const sort = sortOf(partOf(issue)?.kind ?? \"\");\n        if (sort === undefined) return;\n        askField(sort, issue.entry, at === undefined ? issue.field : none);\n        revealSelection(selectionOf(sort, issue.entry));\n    }, [partOf, revealSelection, askField]);\n    const where = useCallback((issue: EditIssue) => {\n        const part = partOf(issue);\n        return part === undefined ? issue.entry : rowName(part.kind, issue.entry);\n    }, [partOf, rowName]);\n    // A conflict's value as the canvas names that row — a state's lane by the lane's label, a transition's ends by their\n    // states' and its decision by the decision's — never a key (#1503).\n    const transitionKind = getSomeorUndefined(value.transitions);\n    const keyFields = useMemo((): FlowchartKeyFields => ({\n        lane: getSomeorUndefined(value.states.laneField),\n        ends: transitionKind === undefined ? undefined : [transitionKind.fromField, transitionKind.toField],\n        decision: transitionKind === undefined ? undefined : getSomeorUndefined(transitionKind.decisionField),\n    }), [value.states, transitionKind]);\n    const conflictValue = useCallback((issue: EditIssue, path: PatchPath, held: unknown) => {\n        const sort = sortOf(partOf(issue)?.kind ?? \"\");\n        return sort === undefined ? undefined : conflictValueName(sort, path, held, keyFields, model);\n    }, [partOf, keyFields, model]);\n    // The history's acts: a field typed into lets go first, committing what it holds — the history's buttons take no\n    // focus from it. Anything else keeps the focus, a button of the canvas's or the canvas itself, so the next key — a\n    // Redo after an Undo — reaches the frame too, never the page.\n    const onAction = useCallback((action: HistoryAction) => {\n        const active = document.activeElement;\n        if (active instanceof HTMLElement && typedInto(active)) active.blur();\n        history.act(action);\n    }, [history]);\n    const historyItem = edits ? historyToolbarItem({ session: history, words, editing: false, showError: false, onIssue, where, conflictValue, onAction }) : undefined;\n\n    // ── The toolbar ─────────────────────────────────────────────────────\n    const toolbarRef = useRef<HTMLDivElement>(null);\n    const [orientation, setOrientation] = useViewerOrientation(keys.orientation, getSomeorUndefined(value.canvas.orientation)?.type ?? \"LR\");\n    const freshnessValue = getSomeorUndefined(value.canvas.freshness);\n    const freshness = useMemo(\n        () => (freshnessValue === undefined ? undefined : { label: freshnessValue.label, date: getSomeorUndefined(freshnessValue.date) }),\n        [freshnessValue]);\n    const railNouns = useMemo(() => Object.fromEntries(nouns), [nouns]);\n    // The zoom (R42): the toolbar's strip zooms the canvas through its handle, and the canvas tells it where the zoom\n    // stands — until it is measured, at the cards' own size and at Fit, both off.\n    const canvasRef = useRef<FlowchartCanvasHandle>(null);\n    const [zoomRange, setZoomRange] = useState<ZoomRange>(OPENS_ZOOMED);\n    const zoomBy = useCallback((factor: number) => canvasRef.current?.zoomBy(factor), []);\n    const fit = useCallback(() => canvasRef.current?.fit(), []);\n    const items = useFlowchartToolbarItems({\n        styles, find, orientation, onOrientation: setOrientation, freshness, words, history: historyItem, chrome, nouns: railNouns,\n        zoom: zoomRange, onZoom: zoomBy, onFit: fit,\n    });\n    // ⌘F, or Ctrl+F, anywhere in the frame: Find; ⌘Z, ⇧⌘Z and ⌘Y the history's, but in a field typed into, whose own\n    // they are; and the canvas's keys. Each key acted on goes no further than the Flowchart.\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n        if (event.defaultPrevented) return;\n        if ((event.metaKey || event.ctrlKey) && !event.altKey && !event.shiftKey && event.key.toLowerCase() === \"f\") {\n            if (focusKeySearch(toolbarRef.current)) takeKey(event);\n            return;\n        }\n        const action = historyShortcut(event);\n        if (action !== undefined && edits && !typedInto(event.target)) {\n            takeKey(event);\n            onAction(action);\n            return;\n        }\n        canvasRef.current?.key(event);\n    }, [edits, onAction]);\n\n    // ── The issues, and the panes ──────────────────────────────────────\n    const decisionsGiven = getSomeorUndefined(value.decisions) !== undefined;\n    const historyVersion = editing.version;\n    // Each session's readiness, held by what it says, as the Sheet holds its own: the history checks each session again\n    // as what its checks read lands — the key check's answer from e3 (D3) — and that moves no version of it.\n    const readiness = useDataStable(sessions.map((part) => part.session.readiness), readinessesEqual);\n    // Each kind's form's numbers held to bounds (#1585), and its rows' codec: what each row drawn is checked against, in\n    // the form's own words.\n    const bounded = useMemo(() => FLOWCHART_SORTS.flatMap((sort) => {\n        const kind = kindOf(value, sort);\n        const specs = kind?.fields.filter(isBounded) ?? [];\n        return kind === undefined || specs.length === 0 ? [] : [{ sort, specs, codec: rowCodec(kind.rowType) }];\n    }), [value]);\n    const breachWords = useCallback((sort: FlowchartSort, breach: FieldBreach): FlowchartBreachWords => ({\n        field: bounded.find((one) => one.sort === sort)?.specs.find((spec) => stringEqual(spec.path.join(\".\"), breach.key))?.label ?? breach.key,\n        bound: fieldBreachText(breach, { ...words, m: fieldFormMessages }),\n    }), [bounded, words]);\n    // Each stored row decoded once: a read keeps a row's bytes the same object while it holds the row.\n    const decodedRows = useRef(new WeakMap<Uint8Array, unknown>());\n    // The rows drawn whose numbers their fields' bounds don't hold, the drafts in place: each warns, but a changed row's,\n    // which its session's readiness lists among what holds Save — and a state's, stored or changed, wears the warn ring.\n    const breaches = useMemo((): { readonly warned: FlowchartBreach[]; readonly states: ReadonlySet<string> } => {\n        const warned: FlowchartBreach[] = [];\n        const states = new Set<string>();\n        for (const { sort, specs, codec } of bounded) {\n            const session = sessions.find((part) => stringEqual(part.kind, sort))?.session;\n            const said = session === undefined || session.readiness.type === \"ready\" ? [] : session.readiness.value;\n            const stored: ReadonlyMap<string, { readonly row: Uint8Array }> | undefined = data.held[sort];\n            const rows = sort === \"lanes\" ? drafted.rows.lanes ?? [] : drafted.rows[sort];\n            for (const { key, dimmed } of rows) {\n                // What the narrowing draws as context raises none: no path selects it.\n                if (dimmed) continue;\n                const entry = session?.entries.get(key);\n                let held: unknown;\n                if (entry !== undefined) {\n                    held = draftedRow(entry)?.row;\n                } else {\n                    const bytes = stored?.get(key)?.row;\n                    if (bytes === undefined) continue;\n                    held = decodedRows.current.get(bytes);\n                    if (held === undefined) {\n                        held = codec.decode(bytes);\n                        decodedRows.current.set(bytes, held);\n                    }\n                }\n                if (held === undefined) continue;\n                const found = fieldBreaches(specs, held);\n                if (sort === \"states\" && found.length > 0) states.add(key);\n                for (const breach of found) {\n                    if (said.some((issue) => stringEqual(issue.entry, key) && issue.field.type === \"some\" && stringEqual(issue.field.value, breach.key))) continue;\n                    warned.push({ sort, key, fieldKey: breach.key, ...breachWords(sort, breach) });\n                }\n            }\n        }\n        return { warned, states };\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version and their readiness say they moved\n    }, [bounded, drafted.rows, data.held, sessions, breachWords, historyVersion, readiness]);\n    const issueArgs = useMemo((): FlowchartIssueArgs => ({\n        model, transitions: drafted.rows.transitions, waiting: drafted.waiting, hiddenWith: data.hiddenWith, stored: data.held.states, decisions: decisionsGiven,\n        details: detailsModel.findings, breaches: breaches.warned,\n    }), [model, drafted, data.hiddenWith, data.held.states, decisionsGiven, detailsModel.findings, breaches]);\n    const issues = useMemo(() => [...sessionIssues(sessions, issueArgs, kindName, breachWords), ...flowchartIssues(issueArgs)],\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version and their readiness say they moved\n        [sessions, issueArgs, kindName, breachWords, historyVersion, readiness]);\n    // The states a Save's conflict names: the canvas marks them.\n    const conflicted = useMemo(() => {\n        const out = new Set<string>();\n        for (const part of sessions) if (sortOf(part.kind) === \"states\") for (const key of part.session.conflicts.keys()) out.add(key);\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version says they moved\n    }, [sessions, historyVersion]);\n    const saves = useLastSaves(value, words);\n    const start = useFlowchartLibrary({ value, keys, words, enter: drop.enter, followed, narrow, off: keysOff });\n    const end = flowchartInspectorPane({\n        value, model, rows: drafted.rows, held: data.held, selection, editing, act, edit, refuse: setNotice, reveal: revealSelection,\n        issues, picks, goToWaiting, ask: askField, saves, details: detailsModel, storageKey: keys.frame, words,\n    });\n\n    // ── The banners: each session's, and each source the rail could not read ──\n    const followedFailures = [...followed.values()].filter((source) => source.error !== undefined);\n    const banners = sessions.length === 0 && followedFailures.length === 0 ? undefined : (\n        <>\n            {sessions.map((part) => {\n                const sort = sortOf(part.kind);\n                return (\n                    <SessionBanners key={part.key} session={part.session} words={words} name={sort === undefined ? part.kind : kindName(sort)}\n                        where={(issue) => rowName(part.kind, issue.entry)} onAction={(action) => history.actOn(part.key, action)} />\n                );\n            })}\n            {followedFailures.map((source) => (\n                <Box key={source.name} data-flowchart-banner=\"source\">\n                    <BannerView status=\"error\" title={m.sourceUnavailable({ name: source.name })} description={source.error}\n                        actions={<Button size=\"xs\" variant=\"outline\" onClick={source.retry}>{m.retry()}</Button>} />\n                </Box>\n            ))}\n        </>\n    );\n\n    // ── The footer: each Save's notice, and the loading line ────────────\n    const locale = words.locale;\n    const notices = useMemo(() => SOURCE_SORTS.flatMap((sort): FlowchartNotice[] => {\n        const kind = kindOf(value, sort);\n        const part = kind?.editable === true ? sourcePart(chrome, sort) : undefined;\n        if (kind === undefined || part === undefined) return [];\n        const one = kind.name.toLocaleLowerCase(locale);\n        return [{ sort, slice: part, singular: one, plural: kindPlural(one) }];\n    }), [value, chrome, locale]);\n    // What the line says: a failed read first, with Retry — the rows', then the details' — then the read in flight — a\n    // kind's first, or its new narrowing's, then the details' (R34).\n    const line = useMemo((): LoadingLineValue | undefined => {\n        const noun = (sort: FlowchartSort) => m.kindNoun({ sort, n: 2 });\n        const detailsOf = [[\"states\", detailsModel.states], [\"transitions\", detailsModel.transitions]] as const;\n        if (data.error !== undefined) return pagedLoadingLine({ kind: \"failed\", from: undefined, to: undefined, reason: data.error }, noun(\"states\"), m, number, readAgain);\n        for (const [sort, reason] of data.failures) return pagedLoadingLine({ kind: \"failed\", from: undefined, to: undefined, reason }, noun(sort), m, number, readAgain);\n        for (const [sort, kind] of detailsOf) {\n            if (kind?.error !== undefined) return pagedLoadingLine({ kind: \"failed\", from: undefined, to: undefined, reason: kind.error }, m.detailsNoun({ sort }), m, number, readAgain);\n        }\n        if (data.reading !== undefined) {\n            return pagedLoadingLine(data.reading.filtering ? { kind: \"filtering\" } : { kind: \"loading\", from: undefined, to: undefined }, noun(data.reading.sort), m, number, readAgain);\n        }\n        if (narrowingBusy) return pagedLoadingLine({ kind: \"filtering\" }, noun(\"states\"), m, number, readAgain);\n        for (const [sort, kind] of detailsOf) {\n            if (kind?.reading === true) return pagedLoadingLine({ kind: \"loading\", from: undefined, to: undefined }, m.detailsNoun({ sort }), m, number, readAgain);\n        }\n        return undefined;\n    }, [data.error, data.failures, data.reading, narrowingBusy, detailsModel.states, detailsModel.transitions, m, number, readAgain]);\n    // A failed read, said once on the canvas at its top-left as the line says it, with the line's Retry (R5).\n    const failure = useMemo((): FlowchartCanvasFailure | undefined =>\n        (line?.kind === \"failed\" ? { message: loadingLineText(line.text), retry: line.onRetry } : undefined), [line]);\n\n    return (\n        <FieldAskProvider value={fieldAsks}><Box css={styles.root} data-flowchart-root=\"\" data-flowchart-layout={narrow ? \"narrow\" : \"wide\"}>\n            <FlowchartDetailsReader kinds={detailsKinds} drawn={drawn} attempt={attempt} onDetails={setDetails} />\n            {/* The frame's one reveal clock: the footer's line shows a read in flight after 150 ms, held 300 ms once shown. */}\n            <LoadingReveal waiting={line?.kind === \"loading\"}>\n                <BuilderFrame\n                    storageKey={keys.frame}\n                    loading={!data.ready && data.error === undefined}\n                    busy={data.loading || narrowingBusy}\n                    toolbar={items}\n                    toolbarRef={toolbarRef}\n                    banners={banners}\n                    start={start}\n                    end={end}\n                    footer={<FlowchartFooter styles={styles} counts={model.counts} pending={edits ? history.pending : undefined} saved={saves.newest?.when}\n                        message={notice} words={words} notices={notices} line={line} />}\n                    onKeyDown={onKeyDown}\n                >\n                    <FlowchartCanvasView ref={canvasRef} canvas={value.canvas} model={model} details={detailsModel} orientation={orientation} reveal={reveal} conflicted={conflicted}\n                        bounded={breaches.states}\n                        edit={canvasEdits} drop={drop.canvas} selection={selection} onSelect={setSelected} words={words} storageKey={storageKey}\n                        onElement={onCanvasElement} failure={failure} onZoomRange={setZoomRange} />\n                </BuilderFrame>\n            </LoadingReveal>\n        </Box></FieldAskProvider>\n    );\n}\n\n// =============================================================================\n// Side-effect — register the renderer for the Flowchart extension on module load.\n// =============================================================================\n\nimplementUIComponent(Flowchart.Component, EastChakraFlowchart);\n","\n/**\n * Rearranges items so that all items in the [left, k] are the smallest.\n * The k-th element will have the (k - left + 1)-th smallest value in [left, right].\n *\n * @template T\n * @param {T[]} arr the array to partially sort (in place)\n * @param {number} k middle index for partial sorting (as defined above)\n * @param {number} [left=0] left index of the range to sort\n * @param {number} [right=arr.length-1] right index\n * @param {(a: T, b: T) => number} [compare = (a, b) => a - b] compare function\n */\nexport default function quickselect(arr, k, left = 0, right = arr.length - 1, compare = defaultCompare) {\n\n    while (right > left) {\n        if (right - left > 600) {\n            const n = right - left + 1;\n            const m = k - left + 1;\n            const z = Math.log(n);\n            const s = 0.5 * Math.exp(2 * z / 3);\n            const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n            const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n            const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n            quickselect(arr, k, newLeft, newRight, compare);\n        }\n\n        const t = arr[k];\n        let i = left;\n        /** @type {number} */\n        let j = right;\n\n        swap(arr, left, k);\n        if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n        while (i < j) {\n            swap(arr, i, j);\n            i++;\n            j--;\n            while (compare(arr[i], t) < 0) i++;\n            while (compare(arr[j], t) > 0) j--;\n        }\n\n        if (compare(arr[left], t) === 0) swap(arr, left, j);\n        else {\n            j++;\n            swap(arr, j, right);\n        }\n\n        if (j <= k) left = j + 1;\n        if (k <= j) right = j - 1;\n    }\n}\n\n/**\n * @template T\n * @param {T[]} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\n/**\n * @template T\n * @param {T} a\n * @param {T} b\n * @returns {number}\n */\nfunction defaultCompare(a, b) {\n    return a < b ? -1 : a > b ? 1 : 0;\n}\n","import quickselect from 'quickselect';\n\nexport default class RBush {\n    constructor(maxEntries = 9) {\n        // max entries in a node is 9 by default; min node fill is 40% for best performance\n        this._maxEntries = Math.max(4, maxEntries);\n        this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n        this.clear();\n    }\n\n    all() {\n        return this._all(this.data, []);\n    }\n\n    search(bbox) {\n        let node = this.data;\n        const result = [];\n\n        if (!intersects(bbox, node)) return result;\n\n        const toBBox = this.toBBox;\n        const nodesToSearch = [];\n\n        while (node) {\n            for (let i = 0; i < node.children.length; i++) {\n                const child = node.children[i];\n                const childBBox = node.leaf ? toBBox(child) : child;\n\n                if (intersects(bbox, childBBox)) {\n                    if (node.leaf) result.push(child);\n                    else if (contains(bbox, childBBox)) this._all(child, result);\n                    else nodesToSearch.push(child);\n                }\n            }\n            node = nodesToSearch.pop();\n        }\n\n        return result;\n    }\n\n    collides(bbox) {\n        let node = this.data;\n\n        if (!intersects(bbox, node)) return false;\n\n        const nodesToSearch = [];\n        while (node) {\n            for (let i = 0; i < node.children.length; i++) {\n                const child = node.children[i];\n                const childBBox = node.leaf ? this.toBBox(child) : child;\n\n                if (intersects(bbox, childBBox)) {\n                    if (node.leaf || contains(bbox, childBBox)) return true;\n                    nodesToSearch.push(child);\n                }\n            }\n            node = nodesToSearch.pop();\n        }\n\n        return false;\n    }\n\n    load(data) {\n        if (!(data && data.length)) return this;\n\n        if (data.length < this._minEntries) {\n            for (let i = 0; i < data.length; i++) {\n                this.insert(data[i]);\n            }\n            return this;\n        }\n\n        // recursively build the tree with the given data from scratch using OMT algorithm\n        let node = this._build(data.slice(), 0, data.length - 1, 0);\n\n        if (!this.data.children.length) {\n            // save as is if tree is empty\n            this.data = node;\n\n        } else if (this.data.height === node.height) {\n            // split root if trees have the same height\n            this._splitRoot(this.data, node);\n\n        } else {\n            if (this.data.height < node.height) {\n                // swap trees if inserted one is bigger\n                const tmpNode = this.data;\n                this.data = node;\n                node = tmpNode;\n            }\n\n            // insert the small tree into the large tree at appropriate level\n            this._insert(node, this.data.height - node.height - 1, true);\n        }\n\n        return this;\n    }\n\n    insert(item) {\n        if (item) this._insert(item, this.data.height - 1);\n        return this;\n    }\n\n    clear() {\n        this.data = createNode([]);\n        return this;\n    }\n\n    remove(item, equalsFn) {\n        if (!item) return this;\n\n        let node = this.data;\n        const bbox = this.toBBox(item);\n        const path = [];\n        const indexes = [];\n        let i, parent, goingUp;\n\n        // depth-first iterative tree traversal\n        while (node || path.length) {\n\n            if (!node) { // go up\n                node = path.pop();\n                parent = path[path.length - 1];\n                i = indexes.pop();\n                goingUp = true;\n            }\n\n            if (node.leaf) { // check current node\n                const index = findItem(item, node.children, equalsFn);\n\n                if (index !== -1) {\n                    // item found, remove the item and condense tree upwards\n                    node.children.splice(index, 1);\n                    path.push(node);\n                    this._condense(path);\n                    return this;\n                }\n            }\n\n            if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n                path.push(node);\n                indexes.push(i);\n                i = 0;\n                parent = node;\n                node = node.children[0];\n\n            } else if (parent) { // go right\n                i++;\n                node = parent.children[i];\n                goingUp = false;\n\n            } else node = null; // nothing found\n        }\n\n        return this;\n    }\n\n    toBBox(item) { return item; }\n\n    compareMinX(a, b) { return a.minX - b.minX; }\n    compareMinY(a, b) { return a.minY - b.minY; }\n\n    toJSON() { return this.data; }\n\n    fromJSON(data) {\n        this.data = data;\n        return this;\n    }\n\n    _all(node, result) {\n        const nodesToSearch = [];\n        while (node) {\n            if (node.leaf) result.push(...node.children);\n            else nodesToSearch.push(...node.children);\n\n            node = nodesToSearch.pop();\n        }\n        return result;\n    }\n\n    _build(items, left, right, height) {\n\n        const N = right - left + 1;\n        let M = this._maxEntries;\n        let node;\n\n        if (N <= M) {\n            // reached leaf level; return leaf\n            node = createNode(items.slice(left, right + 1));\n            calcBBox(node, this.toBBox);\n            return node;\n        }\n\n        if (!height) {\n            // target height of the bulk-loaded tree\n            height = Math.ceil(Math.log(N) / Math.log(M));\n\n            // target number of root entries to maximize storage utilization\n            M = Math.ceil(N / Math.pow(M, height - 1));\n        }\n\n        node = createNode([]);\n        node.leaf = false;\n        node.height = height;\n\n        // split the items into M mostly square tiles\n\n        const N2 = Math.ceil(N / M);\n        const N1 = N2 * Math.ceil(Math.sqrt(M));\n\n        multiSelect(items, left, right, N1, this.compareMinX);\n\n        for (let i = left; i <= right; i += N1) {\n\n            const right2 = Math.min(i + N1 - 1, right);\n\n            multiSelect(items, i, right2, N2, this.compareMinY);\n\n            for (let j = i; j <= right2; j += N2) {\n\n                const right3 = Math.min(j + N2 - 1, right2);\n\n                // pack each entry recursively\n                node.children.push(this._build(items, j, right3, height - 1));\n            }\n        }\n\n        calcBBox(node, this.toBBox);\n\n        return node;\n    }\n\n    _chooseSubtree(bbox, node, level, path) {\n        while (true) {\n            path.push(node);\n\n            if (node.leaf || path.length - 1 === level) break;\n\n            let minArea = Infinity;\n            let minEnlargement = Infinity;\n            let targetNode;\n\n            for (let i = 0; i < node.children.length; i++) {\n                const child = node.children[i];\n                const area = bboxArea(child);\n                const enlargement = enlargedArea(bbox, child) - area;\n\n                // choose entry with the least area enlargement\n                if (enlargement < minEnlargement) {\n                    minEnlargement = enlargement;\n                    minArea = area < minArea ? area : minArea;\n                    targetNode = child;\n\n                } else if (enlargement === minEnlargement) {\n                    // otherwise choose one with the smallest area\n                    if (area < minArea) {\n                        minArea = area;\n                        targetNode = child;\n                    }\n                }\n            }\n\n            node = targetNode || node.children[0];\n        }\n\n        return node;\n    }\n\n    _insert(item, level, isNode) {\n        const bbox = isNode ? item : this.toBBox(item);\n        const insertPath = [];\n\n        // find the best node for accommodating the item, saving all nodes along the path too\n        const node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n        // put the item into the node\n        node.children.push(item);\n        extend(node, bbox);\n\n        // split on node overflow; propagate upwards if necessary\n        while (level >= 0) {\n            if (insertPath[level].children.length > this._maxEntries) {\n                this._split(insertPath, level);\n                level--;\n            } else break;\n        }\n\n        // adjust bboxes along the insertion path\n        this._adjustParentBBoxes(bbox, insertPath, level);\n    }\n\n    // split overflowed node into two\n    _split(insertPath, level) {\n        const node = insertPath[level];\n        const M = node.children.length;\n        const m = this._minEntries;\n\n        this._chooseSplitAxis(node, m, M);\n\n        const splitIndex = this._chooseSplitIndex(node, m, M);\n\n        const newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n        newNode.height = node.height;\n        newNode.leaf = node.leaf;\n\n        calcBBox(node, this.toBBox);\n        calcBBox(newNode, this.toBBox);\n\n        if (level) insertPath[level - 1].children.push(newNode);\n        else this._splitRoot(node, newNode);\n    }\n\n    _splitRoot(node, newNode) {\n        // split root node\n        this.data = createNode([node, newNode]);\n        this.data.height = node.height + 1;\n        this.data.leaf = false;\n        calcBBox(this.data, this.toBBox);\n    }\n\n    _chooseSplitIndex(node, m, M) {\n        let index;\n        let minOverlap = Infinity;\n        let minArea = Infinity;\n\n        for (let i = m; i <= M - m; i++) {\n            const bbox1 = distBBox(node, 0, i, this.toBBox);\n            const bbox2 = distBBox(node, i, M, this.toBBox);\n\n            const overlap = intersectionArea(bbox1, bbox2);\n            const area = bboxArea(bbox1) + bboxArea(bbox2);\n\n            // choose distribution with minimum overlap\n            if (overlap < minOverlap) {\n                minOverlap = overlap;\n                index = i;\n\n                minArea = area < minArea ? area : minArea;\n\n            } else if (overlap === minOverlap) {\n                // otherwise choose distribution with minimum area\n                if (area < minArea) {\n                    minArea = area;\n                    index = i;\n                }\n            }\n        }\n\n        return index || M - m;\n    }\n\n    // sorts node children by the best axis for split\n    _chooseSplitAxis(node, m, M) {\n        const compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;\n        const compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;\n        const xMargin = this._allDistMargin(node, m, M, compareMinX);\n        const yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n        // if total distributions margin value is minimal for x, sort by minX,\n        // otherwise it's already sorted by minY\n        if (xMargin < yMargin) node.children.sort(compareMinX);\n    }\n\n    // total margin of all possible split distributions where each node is at least m full\n    _allDistMargin(node, m, M, compare) {\n        node.children.sort(compare);\n\n        const toBBox = this.toBBox;\n        const leftBBox = distBBox(node, 0, m, toBBox);\n        const rightBBox = distBBox(node, M - m, M, toBBox);\n        let margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);\n\n        for (let i = m; i < M - m; i++) {\n            const child = node.children[i];\n            extend(leftBBox, node.leaf ? toBBox(child) : child);\n            margin += bboxMargin(leftBBox);\n        }\n\n        for (let i = M - m - 1; i >= m; i--) {\n            const child = node.children[i];\n            extend(rightBBox, node.leaf ? toBBox(child) : child);\n            margin += bboxMargin(rightBBox);\n        }\n\n        return margin;\n    }\n\n    _adjustParentBBoxes(bbox, path, level) {\n        // adjust bboxes along the given tree path\n        for (let i = level; i >= 0; i--) {\n            extend(path[i], bbox);\n        }\n    }\n\n    _condense(path) {\n        // go through the path, removing empty nodes and updating bboxes\n        for (let i = path.length - 1, siblings; i >= 0; i--) {\n            if (path[i].children.length === 0) {\n                if (i > 0) {\n                    siblings = path[i - 1].children;\n                    siblings.splice(siblings.indexOf(path[i]), 1);\n\n                } else this.clear();\n\n            } else calcBBox(path[i], this.toBBox);\n        }\n    }\n}\n\nfunction findItem(item, items, equalsFn) {\n    if (!equalsFn) return items.indexOf(item);\n\n    for (let i = 0; i < items.length; i++) {\n        if (equalsFn(item, items[i])) return i;\n    }\n    return -1;\n}\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n    distBBox(node, 0, node.children.length, toBBox, node);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox, destNode) {\n    if (!destNode) destNode = createNode(null);\n    destNode.minX = Infinity;\n    destNode.minY = Infinity;\n    destNode.maxX = -Infinity;\n    destNode.maxY = -Infinity;\n\n    for (let i = k; i < p; i++) {\n        const child = node.children[i];\n        extend(destNode, node.leaf ? toBBox(child) : child);\n    }\n\n    return destNode;\n}\n\nfunction extend(a, b) {\n    a.minX = Math.min(a.minX, b.minX);\n    a.minY = Math.min(a.minY, b.minY);\n    a.maxX = Math.max(a.maxX, b.maxX);\n    a.maxY = Math.max(a.maxY, b.maxY);\n    return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.minX - b.minX; }\nfunction compareNodeMinY(a, b) { return a.minY - b.minY; }\n\nfunction bboxArea(a)   { return (a.maxX - a.minX) * (a.maxY - a.minY); }\nfunction bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\n\nfunction enlargedArea(a, b) {\n    return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n           (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n}\n\nfunction intersectionArea(a, b) {\n    const minX = Math.max(a.minX, b.minX);\n    const minY = Math.max(a.minY, b.minY);\n    const maxX = Math.min(a.maxX, b.maxX);\n    const maxY = Math.min(a.maxY, b.maxY);\n\n    return Math.max(0, maxX - minX) *\n           Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n    return a.minX <= b.minX &&\n           a.minY <= b.minY &&\n           b.maxX <= a.maxX &&\n           b.maxY <= a.maxY;\n}\n\nfunction intersects(a, b) {\n    return b.minX <= a.maxX &&\n           b.minY <= a.maxY &&\n           b.maxX >= a.minX &&\n           b.maxY >= a.minY;\n}\n\nfunction createNode(children) {\n    return {\n        children,\n        height: 1,\n        leaf: true,\n        minX: Infinity,\n        minY: Infinity,\n        maxX: -Infinity,\n        maxY: -Infinity\n    };\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n    const stack = [left, right];\n\n    while (stack.length) {\n        right = stack.pop();\n        left = stack.pop();\n\n        if (right - left <= n) continue;\n\n        const mid = left + Math.ceil((right - left) / n / 2) * n;\n        quickselect(arr, mid, left, right, compare);\n\n        stack.push(left, mid, mid, right);\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the canvas draws (#1386): each kind's rows, as its `rows` read them,\n * made the entities the camera, the painter, the hit-tests and the navigator\n * work over — an item placed at its centre, a zone, a link between two items,\n * a net joining many to many. Each is named on the canvas by its reference,\n * printed (`entityId`): its kind's slot and its key, so two kinds' rows of one\n * key are two entities. A link's ends and a net's sides name their items so.\n * An item's card draws its details' status, bar, figure and second line where\n * its kind gives none — and, while its details row is read, a placeholder in\n * each one's place (#1398): never a value it has not read. React-free data in,\n * data out, unit-tested in `drawn.test.ts`.\n *\n * @packageDocumentation\n */\n\nimport { ArrayType, FloatType, OptionType, StringType, StructType, none, parseFor, printFor, some, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { Schematic } from \"@elaraai/e3-ui/internal\";\n\nconst T = Schematic.Types;\n\n/**\n * An item as the canvas draws it: placed at its centre, named by its reference\n * printed.\n *\n * @property key - Its id on the canvas: its reference, printed\n * @property ref - Its kind's slot and its key\n * @property pending - Which of its card's roles its details give, while its details row is read: each a placeholder in\n *   its place (#1398); `none` once it is read, and for a kind with no details\n */\nexport const SchematicDrawnItemType = StructType({\n    key: StringType,\n    ref: T.Ref,\n    x: FloatType,\n    y: FloatType,\n    label: StringType,\n    sublabel: OptionType(StringType),\n    icon: OptionType(StringType),\n    status: OptionType(T.Status),\n    meter: OptionType(T.Meter),\n    metric: OptionType(StringType),\n    width: OptionType(FloatType),\n    height: OptionType(FloatType),\n    footprint: OptionType(T.Geometry),\n    tone: OptionType(T.Tone),\n    color: OptionType(StringType),\n    fillOpacity: OptionType(FloatType),\n    weight: OptionType(FloatType),\n    layer: OptionType(StringType),\n    pending: OptionType(T.CardRoles),\n});\n\n/**\n * A zone as the canvas draws it.\n *\n * @property key - Its id on the canvas: its reference, printed\n * @property ref - Its kind's slot and its key\n */\nexport const SchematicDrawnZoneType = StructType({\n    key: StringType,\n    ref: T.Ref,\n    label: StringType,\n    x: FloatType,\n    y: FloatType,\n    width: FloatType,\n    height: FloatType,\n    pattern: T.ZonePattern,\n    geometry: OptionType(T.Geometry),\n    tone: OptionType(T.Tone),\n    color: OptionType(StringType),\n    fillOpacity: OptionType(FloatType),\n    weight: OptionType(FloatType),\n    layer: OptionType(StringType),\n});\n\n/**\n * A link as the canvas draws it: its ends the ids of the items it joins.\n *\n * @property key - Its id on the canvas: its reference, printed\n * @property ref - Its kind's slot and its key\n * @property from - The id of the item it runs from\n * @property to - The id of the item it runs to\n */\nexport const SchematicDrawnLinkType = StructType({\n    key: StringType,\n    ref: T.Ref,\n    from: StringType,\n    to: StringType,\n    label: OptionType(StringType),\n    metric: OptionType(StringType),\n    style: T.LinkStyle,\n    route: T.Route,\n    via: ArrayType(T.Point),\n    layer: OptionType(StringType),\n});\n\n/**\n * A net as the canvas draws it: its sides the ids of the items it joins.\n *\n * @property key - Its id on the canvas: its reference, printed\n * @property ref - Its kind's slot and its key\n * @property sources - The ids of the items on its feeding side\n * @property destinations - The ids of the items on its fed side\n */\nexport const SchematicDrawnNetType = StructType({\n    key: StringType,\n    ref: T.Ref,\n    sources: ArrayType(StringType),\n    destinations: ArrayType(StringType),\n    label: OptionType(StringType),\n    metric: OptionType(StringType),\n    style: T.LinkStyle,\n    route: T.Route,\n    via: ArrayType(T.Point),\n    layer: OptionType(StringType),\n});\n\n/**\n * Everything the canvas draws: its items, zones, links and nets, each kind's\n * in the order the Schematic lists its kinds, each kind's in key order.\n */\nexport const SchematicDrawnType = StructType({\n    items: ArrayType(SchematicDrawnItemType),\n    zones: ArrayType(SchematicDrawnZoneType),\n    links: ArrayType(SchematicDrawnLinkType),\n    nets: ArrayType(SchematicDrawnNetType),\n});\n\n/** An item as the canvas draws it. */\nexport type DrawnItem = ValueTypeOf<typeof SchematicDrawnItemType>;\n/** A zone as the canvas draws it. */\nexport type DrawnZone = ValueTypeOf<typeof SchematicDrawnZoneType>;\n/** A link as the canvas draws it. */\nexport type DrawnLink = ValueTypeOf<typeof SchematicDrawnLinkType>;\n/** A net as the canvas draws it. */\nexport type DrawnNet = ValueTypeOf<typeof SchematicDrawnNetType>;\n/** Everything the canvas draws. */\nexport type SchematicDrawn = ValueTypeOf<typeof SchematicDrawnType>;\n/** An entity's reference: its kind's slot and its key. */\nexport type SchematicRef = ValueTypeOf<typeof T.Ref>;\n\n/** An item's roles, as its kind's `rows` give them. */\nexport type ItemRoles = ValueTypeOf<typeof T.Item>;\n/** A zone's roles. */\nexport type ZoneRoles = ValueTypeOf<typeof T.Zone>;\n/** A link's roles. */\nexport type LinkRoles = ValueTypeOf<typeof T.Link>;\n/** A net's roles. */\nexport type NetRoles = ValueTypeOf<typeof T.Net>;\n/** A details row's roles. */\nexport type DetailsRoles = ValueTypeOf<typeof T.DetailsRoles>;\n/** Which of a card's roles its kind's details give. */\nexport type CardRoles = ValueTypeOf<typeof T.CardRoles>;\n\n/** Nothing drawn: a Schematic whose reads have not landed. */\nexport const EMPTY_DRAWN: SchematicDrawn = { items: [], zones: [], links: [], nets: [] };\n\n/** An entity's id on the canvas: its reference, as East prints it — its kind's slot and its key. */\nexport const entityId: (ref: SchematicRef) => string = printFor(T.Ref);\n\nconst parseRef = parseFor(T.Ref);\n\n/**\n * An entity's reference from its id on the canvas: what {@link entityId}\n * printed, read back — a link's end, a net's member, by the id it draws under.\n *\n * @param id - The entity's id\n * @returns Its reference; `undefined` for text no reference prints as\n */\nexport function refOfId(id: string): SchematicRef | undefined {\n    const read = parseRef(id);\n    return read.success ? read.value : undefined;\n}\n\n/** An Option the kind gives, else its details', else none. */\nfunction either<V>(own: option<V>, details: option<V> | undefined): option<V> {\n    return own.type === \"some\" || details === undefined ? own : details;\n}\n\n/**\n * An item as the canvas draws it, from its roles and its details' roles; none\n * for a row with no position, which is its kind's backlog and never draws.\n *\n * @param ref - Its kind's slot and its key\n * @param roles - Its roles\n * @param details - Its details row's roles, if its kind has details and the row has one\n * @param pending - The card roles its kind's details give, while its details row is read: its card draws a placeholder in each one's place (#1398)\n * @returns The item, or `undefined` for an unplaced row\n */\nexport function drawnItem(ref: SchematicRef, roles: ItemRoles, details: DetailsRoles | undefined, pending?: CardRoles): DrawnItem | undefined {\n    if (roles.position.type !== \"some\") return undefined;\n    return {\n        key: entityId(ref),\n        ref,\n        x: roles.position.value.x,\n        y: roles.position.value.y,\n        label: roles.label,\n        sublabel: either(roles.sublabel, details?.sublabel),\n        icon: roles.icon,\n        status: either(roles.status, details?.status),\n        meter: either(roles.meter, details?.meter),\n        metric: either(roles.metric, details?.metric),\n        width: roles.width,\n        height: roles.height,\n        footprint: roles.footprint,\n        tone: roles.tone,\n        color: roles.color,\n        fillOpacity: roles.fillOpacity,\n        weight: roles.weight,\n        layer: roles.layer,\n        pending: pending === undefined ? none : some(pending),\n    };\n}\n\n/**\n * Whether an item's colour is its status's, and its status unread (#1398): its\n * details give its status, their row is read, and the item has no colour of\n * its own — its marker and its card's dot draw a placeholder, never a status.\n *\n * @param item - The item\n * @returns Whether its status is unread\n */\nexport function statusUnread(item: DrawnItem): boolean {\n    return item.pending.type === \"some\" && item.pending.value.status && item.color.type === \"none\" && item.tone.type === \"none\";\n}\n\n/**\n * A zone as the canvas draws it, from its roles.\n *\n * @param ref - Its kind's slot and its key\n * @param roles - Its roles\n * @returns The zone\n */\nexport function drawnZone(ref: SchematicRef, roles: ZoneRoles): DrawnZone {\n    return {\n        key: entityId(ref),\n        ref,\n        label: roles.label,\n        x: roles.x,\n        y: roles.y,\n        width: roles.width,\n        height: roles.height,\n        pattern: roles.pattern,\n        geometry: roles.geometry,\n        tone: roles.tone,\n        color: roles.color,\n        fillOpacity: roles.fillOpacity,\n        weight: roles.weight,\n        layer: roles.layer,\n    };\n}\n\n/**\n * A link as the canvas draws it, from its roles: its ends the ids of the items\n * it joins.\n *\n * @param ref - Its kind's slot and its key\n * @param roles - Its roles\n * @returns The link\n */\nexport function drawnLink(ref: SchematicRef, roles: LinkRoles): DrawnLink {\n    return {\n        key: entityId(ref),\n        ref,\n        from: entityId(roles.from),\n        to: entityId(roles.to),\n        label: roles.label,\n        metric: roles.metric,\n        style: roles.style,\n        route: roles.route,\n        via: roles.via,\n        layer: roles.layer,\n    };\n}\n\n/**\n * A net as the canvas draws it, from its roles: its sides the ids of the\n * items it joins.\n *\n * @param ref - Its kind's slot and its key\n * @param roles - Its roles\n * @returns The net\n */\nexport function drawnNet(ref: SchematicRef, roles: NetRoles): DrawnNet {\n    return {\n        key: entityId(ref),\n        ref,\n        sources: roles.sources.map((member) => entityId(member)),\n        destinations: roles.destinations.map((member) => entityId(member)),\n        label: roles.label,\n        metric: roles.metric,\n        style: roles.style,\n        route: roles.route,\n        via: roles.via,\n        layer: roles.layer,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Pure derived-model helpers for the Schematic renderer (#183 WS3): the\n * navigator tree (zones nest by containment, items live in their smallest\n * outline host), the semantic-zoom LOD machinery (per-item tier sizing —\n * no card or pin wider than {@link SCHEMATIC_CARD_MAX_PX} — the centre\n * R-tree, and the symmetric neighbour-fit declutter) and the box the\n * narrowing's matches span (#1392). React-free data-in / data-out —\n * unit-tested in `model.test.ts`.\n */\n\nimport RBush from \"rbush\";\nimport { type DrawnItem as SchematicItemValue, type DrawnZone as SchematicZoneValue, type SchematicDrawn } from \"./drawn\";\n\nexport interface NavZone {\n    zone: SchematicZoneValue;\n    children: NavZone[];\n    items: SchematicItemValue[];\n}\n\n/**\n * Labels in natural order — `A2` before `A10`, `Cage 2` before `Cage 10` — as\n * the Index lists zones and items and the steps walk them.\n *\n * @param a - One labelled entity\n * @param b - Another\n * @returns Below zero where `a`'s label comes first, above where `b`'s does, else zero\n */\nexport function byLabel(a: { readonly label: string }, b: { readonly label: string }): number {\n    return a.label.localeCompare(b.label, undefined, { numeric: true });\n}\n\n/** Whether a zone's box holds a world point, its edges among it. */\nconst contains = (outer: SchematicZoneValue, x: number, y: number): boolean =>\n    x >= outer.x && x <= outer.x + outer.width && y >= outer.y && y <= outer.y + outer.height;\n\n/**\n * The zones that host items, smallest first: the outline zones — a hatched\n * one is an annotation (an aisle, an exclusion zone), never a container.\n *\n * @param zones - The zones\n * @returns The hosts, by their boxes' areas, smallest first\n */\nexport function hostZones(zones: readonly SchematicZoneValue[]): SchematicZoneValue[] {\n    return [...zones].sort((a, b) => (a.width * a.height) - (b.width * b.height)).filter(z => z.pattern.type === \"outline\");\n}\n\n/**\n * The zone an item at a world point is filed under: the smallest host whose\n * box holds the point — the Index's, and the zone a drop's words say a card\n * lands in (#1390).\n *\n * @param hosts - The hosts, smallest first ({@link hostZones})\n * @param x - The point's world x\n * @param y - The point's world y\n * @returns The zone, or `undefined` for a point no host holds\n */\nexport function zoneHolding(hosts: readonly SchematicZoneValue[], x: number, y: number): SchematicZoneValue | undefined {\n    return hosts.find(z => contains(z, x, y));\n}\n\n/** Nest zones by smallest-containing-rect and place items into their\n * smallest containing zone — the drawing IS the hierarchy. Hatch zones\n * are annotations (aisles, exclusion zones), not containers: they\n * never host items. */\nexport function buildNavTree(zones: readonly SchematicZoneValue[], items: readonly SchematicItemValue[]): { roots: NavZone[]; floor: SchematicItemValue[]; zoneOf: Map<string, string>; parentOf: Map<string, string> } {\n    const nodes = new Map<string, NavZone>();\n    const sorted = [...zones].sort((a, b) => (a.width * a.height) - (b.width * b.height));\n    for (const zone of zones) nodes.set(zone.key, { zone, children: [], items: [] });\n\n    const roots: NavZone[] = [];\n    const parentOf = new Map<string, string>();\n    for (const zone of zones) {\n        const parent = sorted.find(p => p.key !== zone.key\n            && p.width * p.height > zone.width * zone.height\n            && contains(p, zone.x + zone.width / 2, zone.y + zone.height / 2));\n        if (parent !== undefined) {\n            nodes.get(parent.key)!.children.push(nodes.get(zone.key)!);\n            parentOf.set(zone.key, parent.key);\n        } else roots.push(nodes.get(zone.key)!);\n    }\n    const hosts = hostZones(zones);\n    const floor: SchematicItemValue[] = [];\n    const zoneOf = new Map<string, string>();\n    for (const item of items) {\n        const host = zoneHolding(hosts, item.x, item.y);\n        if (host !== undefined) {\n            nodes.get(host.key)!.items.push(item);\n            zoneOf.set(item.key, host.key);\n        } else floor.push(item);\n    }\n    return { roots, floor, zoneOf, parentOf };\n}\n\nexport type LodTier = \"card\" | \"label\" | \"dot\";\n\n/**\n * The widest an item's card or labelled pin draws, in screen px, whatever its\n * words (#1393): a longer label, sublabel or figure ends in an ellipsis. A card\n * drawn at its item's own width — its `width` role, a box in the world — is\n * held to that instead. Past the viewport a card reaches no more than half of\n * it, which is what a kind read by area pads its window by (`area.ts`).\n */\nexport const SCHEMATIC_CARD_MAX_PX = 200;\n\n/** A labelled pin's parts, in screen px (#1393): its inline padding, its dot's width, the gap after the dot, and its height. */\nexport const PIN_PAD_X = 6, PIN_DOT_W = 7, PIN_GAP = 4, PIN_H = 16;\n\n/** How far a labelled pin starts before its item's point, in screen px: its dot stands on the point, the words after it (#1393). */\nexport const PIN_LEAD_PX = PIN_PAD_X + PIN_DOT_W / 2;\n\n/** A dot's radius as the declutter keeps clear of it, in screen px: the painter's dot (5) and its rule. */\nconst DOT_CLEAR_PX = 6;\n\n/** The room kept between two items' marks, in screen px. */\nconst MARK_GAP_PX = 6;\n\n/** How far short of its words a card may fall and still draw whole, in screen px: the float error of a zoom worked out to draw it whole. */\nconst WHOLE_SLACK_PX = 1e-6;\n\n/**\n * The width a card takes for its words, in screen px (#1393): its label with\n * its icon and its dot beside it, or its sublabel, whichever is wider — no\n * narrower than a card's least and no wider than\n * {@link SCHEMATIC_CARD_MAX_PX}.\n *\n * @param item - The item\n * @returns Its card's width for its words\n */\nexport function cardContentWidth(item: SchematicItemValue): number {\n    const sublabel = item.sublabel.type === \"some\" ? item.sublabel.value : undefined;\n    return Math.min(SCHEMATIC_CARD_MAX_PX, Math.max(\n        88,\n        item.label.length * 6.6 + (item.icon.type === \"some\" ? 16 : 0) + (item.status.type === \"some\" ? 13 : 0) + 20,\n        (sublabel?.length ?? 0) * 5.4 + 20,\n    ));\n}\n\n/**\n * Whether an item's card draws whole at a zoom (#1393): a card held to its\n * item's own width — a box in the world — draws whole once that width holds\n * its words; any other card is as wide as its words. A zoom worked out to draw\n * it whole — the zoom's limit, a fly to it — draws it whole, its float error\n * among it.\n *\n * @param item - The item\n * @param ppu - The zoom, in px per world unit\n * @returns Whether its card draws whole\n */\nexport function cardWhole(item: SchematicItemValue, ppu: number): boolean {\n    return item.width.type !== \"some\" || item.width.value * ppu + WHOLE_SLACK_PX >= cardContentWidth(item);\n}\n\n/** Screen-px footprint of an item rendered at `tier` — a card or a labelled pin, no wider than\n * {@link SCHEMATIC_CARD_MAX_PX}, but a card at its item's own width. A card is centred on its item; a pin's dot stands\n * on it, its words after ({@link PIN_LEAD_PX}). Translation-invariant, so collisions depend on ppu alone. */\nexport function tierSize(item: SchematicItemValue, tier: LodTier, ppu: number): { w: number; h: number } {\n    if (tier === \"label\") return { w: Math.min(SCHEMATIC_CARD_MAX_PX, item.label.length * 6.6 + 2 * PIN_PAD_X + PIN_DOT_W + PIN_GAP), h: PIN_H };\n    const sublabel = item.sublabel.type === \"some\" ? item.sublabel.value : undefined;\n    const w = item.width.type === \"some\" ? item.width.value * ppu : cardContentWidth(item);\n    const h = 24\n        + (sublabel !== undefined ? 13 : 0)\n        + (item.meter.type === \"some\" ? 8 : 0)\n        + (item.metric.type === \"some\" ? 15 : 0);\n    return { w, h };\n}\n\n/** An item by its centre in the world: what the declutter searches an item's neighbours in. */\nexport type CenterBox = { minX: number; minY: number; maxX: number; maxY: number; item: SchematicItemValue };\n\n/** World-coordinate R-tree over item centres — built over every item drawn, so an item's neighbours past the viewport\n * count too; zooming only changes the (1/ppu-scaled) query boxes. */\nexport function buildCenterTree(items: readonly SchematicItemValue[]): RBush<CenterBox> {\n    const tree = new RBush<CenterBox>();\n    tree.load(items.map(item => ({ minX: item.x, minY: item.y, maxX: item.x, maxY: item.y, item })));\n    return tree;\n}\n\n/** A box in screen px about an item's point: how far it reaches each way. */\ninterface Reach { readonly left: number; readonly right: number; readonly up: number; readonly down: number }\n\n/** Whether two items' boxes, each about its own point, overlap with `gap` between them. */\nfunction boxesMeet(a: SchematicItemValue, ra: Reach, b: SchematicItemValue, rb: Reach, ppu: number, gap: number): boolean {\n    const ax = a.x * ppu, ay = a.y * ppu, bx = b.x * ppu, by = b.y * ppu;\n    return ax - ra.left < bx + rb.right + gap && bx - rb.left < ax + ra.right + gap\n        && ay - ra.up < by + rb.down + gap && by - rb.up < ay + ra.down + gap;\n}\n\n/**\n * Each visible item's tier at the zoom (#1393): a card, a labelled pin or a\n * dot. The zoom's band picks the richest form an item may take, and it takes\n * it only where it draws whole and clear of the items about it — decided from\n * where every item drawn stands, never from the order they come in nor which\n * of them the viewport holds, so a pan never changes what an item draws as,\n * and a uniformly dense row draws as one block rather than checkerboarding:\n *\n * - **a card** where the band is the card's and it draws whole\n *   ({@link cardWhole}), clear of every other item's dot and of every other\n *   card that could draw;\n * - **else a pin** where the band reaches the pin's, clear of every other\n *   item's mark — the card it draws as, or its dot — and of every other pin\n *   that could draw: no pin covers another item's status;\n * - **else a dot.**\n *\n * A selected item is an explicit pointer: it takes the richest form the band\n * gives that draws whole, whatever it covers.\n *\n * @param items - The items to decide: the viewport's\n * @param tree - Every item drawn, by its centre ({@link buildCenterTree}): what an item keeps clear of\n * @param baseLod - The zoom's band\n * @param ppu - The zoom, in px per world unit\n * @param selected - What is selected, by id\n * @returns Each item's tier, by its id\n */\nexport function declutterTiers(items: readonly SchematicItemValue[], tree: RBush<CenterBox>, baseLod: LodTier, ppu: number, selected: ReadonlySet<string>): Map<string, LodTier> {\n    const tiers = new Map<string, LodTier>();\n    if (baseLod === \"dot\" || !(ppu > 0)) {\n        for (const item of items) tiers.set(item.key, \"dot\");\n        return tiers;\n    }\n    // How far any card or pin reaches, in world units: what an item's neighbours are searched within.\n    let widest = SCHEMATIC_CARD_MAX_PX, tallest = PIN_H;\n    for (const { item } of tree.all()) {\n        const card = tierSize(item, \"card\", ppu);\n        widest = Math.max(widest, card.w);\n        tallest = Math.max(tallest, card.h);\n    }\n    const dotReach: Reach = { left: DOT_CLEAR_PX, right: DOT_CLEAR_PX, up: DOT_CLEAR_PX, down: DOT_CLEAR_PX };\n    const cardReach = (item: SchematicItemValue): Reach => {\n        const { w, h } = tierSize(item, \"card\", ppu);\n        return { left: w / 2, right: w / 2, up: h / 2, down: h / 2 };\n    };\n    const pinReach = (item: SchematicItemValue): Reach => {\n        const { w, h } = tierSize(item, \"label\", ppu);\n        return { left: PIN_LEAD_PX, right: w - PIN_LEAD_PX, up: h / 2, down: h / 2 };\n    };\n    const near = (item: SchematicItemValue): SchematicItemValue[] => {\n        const rx = (widest + MARK_GAP_PX + DOT_CLEAR_PX) / ppu, ry = (tallest + MARK_GAP_PX + DOT_CLEAR_PX) / ppu;\n        return tree.search({ minX: item.x - rx, minY: item.y - ry, maxX: item.x + rx, maxY: item.y + ry })\n            .map((hit) => hit.item).filter((other) => other.key !== item.key);\n    };\n    const mayCard = (item: SchematicItemValue): boolean => baseLod === \"card\" && cardWhole(item, ppu);\n    // Cards: each one that could draw, clear of every other's dot and every other card that could draw.\n    const cards = new Map<string, boolean>();\n    const isCard = (item: SchematicItemValue): boolean => {\n        const known = cards.get(item.key);\n        if (known !== undefined) return known;\n        let card = mayCard(item);\n        if (card) {\n            const reach = cardReach(item);\n            for (const other of near(item)) {\n                if (boxesMeet(item, reach, other, dotReach, ppu, MARK_GAP_PX) || (mayCard(other) && boxesMeet(item, reach, other, cardReach(other), ppu, MARK_GAP_PX))) {\n                    card = false;\n                    break;\n                }\n            }\n        }\n        cards.set(item.key, card);\n        return card;\n    };\n    // Pins: each one clear of every other's mark, and of every other pin that could draw.\n    const isPin = (item: SchematicItemValue): boolean => {\n        const reach = pinReach(item);\n        for (const other of near(item)) {\n            const card = isCard(other);\n            if (boxesMeet(item, reach, other, card ? cardReach(other) : dotReach, ppu, MARK_GAP_PX)) return false;\n            if (!card && boxesMeet(item, reach, other, pinReach(other), ppu, MARK_GAP_PX)) return false;\n        }\n        return true;\n    };\n    for (const item of items) {\n        if (selected.has(item.key)) tiers.set(item.key, mayCard(item) ? \"card\" : \"label\");\n        else tiers.set(item.key, isCard(item) ? \"card\" : isPin(item) ? \"label\" : \"dot\");\n    }\n    return tiers;\n}\n\n/** A world box: its least and its greatest corner. */\nexport interface WorldBox { minX: number; minY: number; maxX: number; maxY: number }\n\n/**\n * The world box the narrowing's matches span (#1392, §10.3): each matched\n * item drawn — by its centre grown by `reach`, and by its footprint about it\n * (D22) — each matched zone's box and its shape about the box's centre, and\n * each matched link's or net's members drawn and its bends. What the frame\n * boxes, and what fit flies to.\n *\n * @param drawn - What the canvas draws: its items where a Move's preview has them, a hidden layer's left out\n * @param matches - The matches, by id\n * @param hidden - What a hidden layer holds, by id: never drawn, so spanning nothing\n * @param centers - Each item drawn's centre, by id\n * @param reach - An item's half-extent about its centre, in world units\n * @returns The box, and how many matches it spans; `undefined` while none is drawn\n */\nexport function matchesExtent(\n    drawn: SchematicDrawn, matches: ReadonlySet<string>, hidden: ReadonlySet<string>, centers: ReadonlyMap<string, { x: number; y: number }>,\n    reach: (item: SchematicItemValue) => { readonly w: number; readonly h: number },\n): { box: WorldBox; count: number } | undefined {\n    if (matches.size === 0) return undefined;\n    const box: WorldBox = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n    const take = (x: number, y: number) => {\n        box.minX = Math.min(box.minX, x); box.minY = Math.min(box.minY, y);\n        box.maxX = Math.max(box.maxX, x); box.maxY = Math.max(box.maxY, y);\n    };\n    /** A shape about an anchor: a circle's radius every way, a polygon's or a polyline's vertices. */\n    const shape = (anchor: { x: number; y: number }, geometry: SchematicItemValue[\"footprint\"]) => {\n        if (geometry.type !== \"some\") return;\n        const g = geometry.value;\n        if (g.type === \"circle\") {\n            take(anchor.x - g.value.radius, anchor.y - g.value.radius);\n            take(anchor.x + g.value.radius, anchor.y + g.value.radius);\n        } else if (g.type !== \"rect\") {\n            for (const v of g.value.vertices) take(anchor.x + v.x, anchor.y + v.y);\n        }\n    };\n    let count = 0;\n    for (const item of drawn.items) {\n        const c = matches.has(item.key) ? centers.get(item.key) : undefined;\n        if (c === undefined) continue;\n        count++;\n        const r = reach(item);\n        take(c.x - r.w, c.y - r.h);\n        take(c.x + r.w, c.y + r.h);\n        shape(c, item.footprint);\n    }\n    for (const zone of drawn.zones) {\n        if (!matches.has(zone.key) || hidden.has(zone.key)) continue;\n        count++;\n        take(zone.x, zone.y);\n        take(zone.x + zone.width, zone.y + zone.height);\n        shape({ x: zone.x + zone.width / 2, y: zone.y + zone.height / 2 }, zone.geometry);\n    }\n    // A link or a net spans its members drawn and its bends: one drawn nowhere spans nothing.\n    const edge = (key: string, members: readonly string[], via: readonly { x: number; y: number }[], whole: boolean) => {\n        if (!matches.has(key) || hidden.has(key)) return;\n        const at = members.flatMap((member) => { const c = centers.get(member); return c === undefined ? [] : [c]; });\n        if (at.length === 0 || (whole && at.length < members.length)) return;\n        count++;\n        for (const p of [...at, ...via]) take(p.x, p.y);\n    };\n    for (const link of drawn.links) edge(link.key, [link.from, link.to], link.via, true);\n    for (const net of drawn.nets) edge(net.key, [...net.sources, ...net.destinations], net.via, false);\n    return count === 0 ? undefined : { box, count };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The rows a kind read by area reads, made its stored rows (#1393, `Schematic\n * Builder Spec.md` §10.4): each row's roles beside its bytes, through the\n * kind's `rowsOf` — or its details' — an East function over the rows' bytes,\n * which runs the kind's accessors over every row it is given.\n *\n * - **Each row made once.** What a maker made of a row is kept by the row's\n *   key while the row reads again as it was — the same object, or one East\n *   holds equal (`equalFor`), as a window into finer cells decodes it — so a\n *   window over rows another window made, a zoom into finer cells, which\n *   searches anew, or a pan back makes only the rows it adds, and the rows it\n *   made before are the same stored rows, which the drawing keeps. Past\n *   {@link MAX_MADE_ROWS} kept, those a read does not ask for go.\n * - **A budget a read.** A read makes rows a batch a call\n *   ({@link MAKE_BATCH}), until {@link MAKE_BUDGET_MS} has passed since it\n *   began — a batch at least — and leaves the rest to the next read: a window\n *   of thousands of rows new to it is made over several tasks, a frame\n *   drawing between, never in one long task.\n *\n * @packageDocumentation\n */\n\nimport { ArrayType, SortedMap, StringType, StructType, compareFor, encodeBeast2For, equalFor, fromEastTypeValue, type StructType as StructTypeOf } from \"@elaraai/east\";\nimport { SCHEMATIC_WINDOW_READ_ROWS } from \"@elaraai/e3-ui/internal\";\n\nconst compareString = compareFor(StringType);\n\n/** A stored row: its roles beside its bytes, as a kind's `rowsOf` makes it. */\nexport interface StoredRow {\n    readonly roles: unknown;\n    readonly row: Uint8Array;\n}\n\n/** Stored rows, by key. */\nexport type StoredRows = ReadonlyMap<string, StoredRow>;\n\n/** What makes a kind's stored rows: the kind, or its details — their row type and their `rowsOf`. */\nexport interface RowMaker {\n    /** The row type, as an East type value. */\n    readonly rowType: Parameters<typeof fromEastTypeValue>[0];\n    /** Makes the stored rows of an Array of `{ key, row }`, given as its bytes. */\n    readonly rowsOf: (bytes: Uint8Array) => StoredRows;\n}\n\n/** The most rows a maker keeps made — a window's read — past which those a read does not ask for go. */\nexport const MAX_MADE_ROWS = SCHEMATIC_WINDOW_READ_ROWS;\n\n/**\n * How many rows a maker's `rowsOf` makes in one call: each call's own cost spread over them, and a call a few ms at\n * most — some 10 ms while its functions run cold, under 2 ms once warm — so the budget, checked between calls, is\n * overrun by no more.\n */\nexport const MAKE_BATCH = 64;\n\n/** How long one read makes rows for, in ms, before the rest are left to the next read: a frame draws between. */\nexport const MAKE_BUDGET_MS = 12;\n\n/** What a maker made of a row: the row as it was read, and its stored row. */\ninterface Made {\n    readonly row: unknown;\n    readonly stored: StoredRow;\n}\n\n/** A maker's encoder of the rows it is given, as its `rowsOf` takes them. */\ntype RowsEncoder = (read: { key: string; row: unknown }[]) => Uint8Array;\n\n/** A maker's equality of the rows it is given: whether a row reads again as it was. */\ntype RowEqual = (a: unknown, b: unknown) => boolean;\n\n/** How {@link RowMaking} keeps what it made. */\nexport interface RowMakingOptions {\n    /** The most rows a maker keeps made; {@link MAX_MADE_ROWS} unless given. */\n    readonly most?: number;\n}\n\n/**\n * Rows made their stored rows, each once, a budget a read (see the module\n * docs): one for a reader's every maker — each kind read by area and its\n * details.\n */\nexport class RowMaking {\n    private readonly most: number;\n    private readonly made = new WeakMap<RowMaker, Map<string, Made>>();\n    private readonly encoders = new WeakMap<RowMaker, RowsEncoder>();\n    private readonly equals = new WeakMap<RowMaker, RowEqual>();\n    /** When the read under way stops making rows, by `performance.now()`. */\n    private deadline = Number.POSITIVE_INFINITY;\n    /** Whether the read under way has left rows to make. */\n    private left = false;\n\n    /**\n     * @param options - The most rows a maker keeps made\n     */\n    constructor(options: RowMakingOptions = {}) {\n        this.most = options.most ?? MAX_MADE_ROWS;\n    }\n\n    /** Begins a read: it makes rows for {@link MAKE_BUDGET_MS} — a batch at least — and leaves the rest to the next. */\n    begin(): void {\n        this.deadline = performance.now() + MAKE_BUDGET_MS;\n        this.left = false;\n    }\n\n    /** Whether the last read left rows to make: its reader reads again a task later, a frame drawing between. */\n    get unmade(): boolean {\n        return this.left;\n    }\n\n    /**\n     * Rows made their stored rows, in key order, as `rowsOf` gives them (see\n     * the module docs): a row made before, read again as it was, the same\n     * stored row; the rest made a batch a call, until the read's budget is\n     * spent — a batch at least — the rest left to the next read.\n     *\n     * @param maker - The kind, or its details\n     * @param rows - The rows, by key: each as it was read\n     * @returns Their stored rows, by key; `undefined` while rows are left to make\n     * @throws {Error} When the maker's `rowsOf` makes no stored row of a row it was given, naming its key: asked of it at\n     *   every read after, the read would never end\n     */\n    make(maker: RowMaker, rows: ReadonlyMap<string, unknown>): StoredRows | undefined {\n        let made = this.made.get(maker);\n        if (made === undefined) {\n            made = new Map();\n            this.made.set(maker, made);\n        }\n        const same = this.equalOf(maker);\n        const missing: { key: string; row: unknown }[] = [];\n        for (const [key, row] of rows) {\n            const was = made.get(key);\n            if (was === undefined || !(Object.is(was.row, row) || same(was.row, row))) missing.push({ key, row });\n            // Read again as it was: kept as it was read now, so its next read is the same object.\n            else if (!Object.is(was.row, row)) made.set(key, { row, stored: was.stored });\n        }\n        for (let at = 0; at < missing.length; at += MAKE_BATCH) {\n            if (at > 0 && performance.now() >= this.deadline) {\n                this.left = true;\n                return undefined;\n            }\n            const batch = missing.slice(at, at + MAKE_BATCH);\n            const fresh = maker.rowsOf(this.encoderOf(maker)(batch));\n            if (made.size + batch.length > this.most) {\n                for (const key of [...made.keys()]) if (!rows.has(key)) made.delete(key);\n            }\n            for (const { key, row } of batch) {\n                const stored = fresh.get(key);\n                if (stored === undefined) throw new Error(`The rows read of \"${key}\" made it no stored row`);\n                made.set(key, { row, stored });\n            }\n        }\n        const out = new SortedMap<string, StoredRow>(undefined, compareString);\n        for (const key of rows.keys()) {\n            const one = made.get(key);\n            if (one !== undefined) out.set(key, one.stored);\n        }\n        return out;\n    }\n\n    /** A maker's encoder of the rows it is given, made once a maker. */\n    private encoderOf(maker: RowMaker): RowsEncoder {\n        let encode = this.encoders.get(maker);\n        if (encode === undefined) {\n            const row = fromEastTypeValue(maker.rowType) as StructTypeOf;\n            encode = encodeBeast2For(ArrayType(StructType({ key: StringType, row }))) as RowsEncoder;\n            this.encoders.set(maker, encode);\n        }\n        return encode;\n    }\n\n    /** A maker's equality of its rows, made once a maker. */\n    private equalOf(maker: RowMaker): RowEqual {\n        let equal = this.equals.get(maker);\n        if (equal === undefined) {\n            equal = equalFor(fromEastTypeValue(maker.rowType)) as RowEqual;\n            this.equals.set(maker, equal);\n        }\n        return equal;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A Schematic kind read by area (#1393, `Schematic Builder Spec.md` §10.4,\n * D25, D41): its viewport's window read from an area index alone, a cell at a\n * time, as the Plan's events are read (`plan/root/cells.ts`, #1039).\n *\n * # The window\n *\n * The canvas writes where its viewport rests — its box, its zoom and the tier\n * its items draw at — to a store of its own ({@link createViewportStore}),\n * rendering nothing for it. A kind's window is that viewport padded by the\n * largest card's half size at the zoom ({@link windowOf}), so a card whose\n * centre lies just outside still draws. Drawn as its rows, it holds while the\n * viewport stays inside the box its searches reach — the window grown by its\n * margin — and is at least half its size, so a pan or a zoom inside the\n * margin reads nothing. Drawn as its density, it holds only at the zoom it\n * was made for, so one view draws one raster by whatever route it was\n * reached, and only while the viewport still holds more rows than a window\n * draws ({@link windowHolds}).\n *\n * # What it reads\n *\n * e3-ui's planner names the area index a window reads and its leading values\n * (`schematicWindowPlan`, SC34); each of the window's searches is a cell\n * (`areaCells`). Every cell not yet found goes in one request, counted before\n * an entry is read, and the rows the viewport holds are counted from those\n * counts (D25, {@link cellsInView}): each cell's rows held evenly over its\n * part of the drawing's extent, the viewport's share of them. While they\n * number at most `SCHEMATIC_WINDOW_ROWS`, and the window's cells hold at most\n * `SCHEMATIC_WINDOW_READ_ROWS`, the entries of the cells not held go in one\n * read of their runs, each cell's kept at the revision it was read at while\n * the window wants it — so a window into new cells searches and reads only\n * those. A narrowing the index doesn't lead is asked of the window's rows, and\n * of the far ends read beside them, in one `within` (D28), each row's answer\n * kept for its revision and narrowing; under `narrowed=\"dim\"` every row is\n * read, and `within` says which match.\n *\n * Past `SCHEMATIC_WINDOW_ROWS` in view, the density (D25): one request finds\n * the bounds of the raster's cells — the level whose cells are about a\n * sixty-fourth of the window's reach — and of the coarser levels' cells, by\n * their exact keys (`schematicRaster`). The density's own count of the\n * viewport ({@link densityInView}), finer than the cells', decides at last:\n * once it counts no more than `SCHEMATIC_WINDOW_ROWS` there, the rows are read\n * after all, so the footer, which says that count, never says one the rows\n * would draw at. A window whose cells hold more than\n * `SCHEMATIC_WINDOW_READ_ROWS` draws its density whatever its view holds. The\n * coarser levels' rows, boxes larger than half a raster cell, are read as rows\n * while they number no more than a window draws, in one read of their runs;\n * past that they are spread over the raster cells their cells cover\n * (`schematicDensityCells`), and no row is read. No search of the density is\n * kept as a cell: the source's cells are the window's alone.\n *\n * Beside its window, a kind's overview — its whole drawing's density, which\n * the minimap draws — is counted over the drawing's extent in one request, once\n * a revision and a narrowing ({@link SchematicAreaReader.overview}); and under\n * `fit`, the box its narrowing's rows stand in, from the same counts of its\n * narrowing alone ({@link SchematicAreaReader.fitBox}): what the camera flies\n * to as the narrowing changes, wherever the window is (§10.3).\n *\n * Its items' details are read at every tier — a dot draws its item's status\n * too (D45) — by the runs its window's rows were read by: the window's cells,\n * or at density the coarser levels' runs, every cell not held in one request\n * of the details' record, the server reading each entry's key from the area\n * index, none sent (`recordSliceCellJoins`); each cell's kept at the kind's\n * revision and the details' while the window wants it, so a pan reads only the\n * cells it adds, and a commit to the details reads them again. The far ends of\n * the links and nets that touch the window are read by key, a request a kind,\n * through the kind's own paged read — whether or not its source joins its rows.\n *\n * Each row is held by its key's text, as a reference names it (#1549): a\n * String key as itself, any other as East prints it. A text is read back at\n * the record's key type where the record is read by key — a far end — or a\n * row is asked of its narrowing.\n *\n * # What it keeps\n *\n * Each kind's state across reads (`Slot`): its window, its plan and its cells,\n * what each was read from — and every result the same object while what it\n * was read from is, so a read that lands elsewhere, or a viewport resting\n * inside the window, plans nothing, asks nothing, makes nothing and hands the\n * frame nothing new.\n *\n * What a kind's `rowsOf` — or its details' — made of each row is kept by the\n * row's key while the row reads again as it was, as many as a window reads,\n * and made a budget a read (`made-rows.ts`): a window over rows another\n * window made — a zoom into finer cells, which searches anew, or a pan back —\n * makes only the rows it adds, the rows it made before the same objects,\n * which the drawing keeps; and a window of thousands of rows new to it is\n * made over several reads, a frame drawing between (#1393).\n *\n * # What it says while it reads\n *\n * While a kind's window is read, the reader says what the read waits on — its\n * rows, or its density's counts ({@link SchematicAreaReader.waiting}), what\n * the footer's loading line names — and the window it reads\n * ({@link SchematicAreaReader.wanted}), each read saying the window it was\n * read for: the canvas washes what of the window the drawing does not cover\n * yet ({@link unreadArea}, #1398, CL2).\n *\n * @packageDocumentation\n */\n\nimport { IntegerType, StringType, compareFor, equalFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { SeekQueryType, type SeekRangeType } from \"@elaraai/east-ui\";\nimport {\n    RecordSliceWhereType, areaCells,\n    type AreaCell, type RecordOnPrinter, type RecordSliceBindType, type RecordSliceCell, type RecordSliceEntry, type RecordSliceJoined,\n} from \"@elaraai/east-ui/internal\";\nimport {\n    SCHEMATIC_WINDOW_READ_ROWS, SCHEMATIC_WINDOW_ROWS, schematicDensityCells, schematicRaster, schematicWindowPlan,\n    type SchematicAreaIndexes, type SchematicDensityCell, type SchematicRaster, type SchematicWindowPlan,\n} from \"@elaraai/e3-ui/internal\";\nimport {\n    recordSliceBounds, recordSliceCellEntries, recordSliceCellJoins, recordSliceCellRuns, recordSliceOnPrinter, recordSliceRevision,\n    recordSliceRunEntries, recordSliceRunJoins, recordSliceWithin,\n} from \"@elaraai/east-ui-components/internal\";\nimport { defaultPagedRuntime, pagedSourceOf, type PagedRow } from \"../platform/paged-runtime.js\";\nimport { SCHEMATIC_CARD_MAX_PX, type LodTier, type WorldBox } from \"./canvas/model.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport { kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { RowMaking, type StoredRows } from \"./made-rows.js\";\n\n/** An item kind or a zone kind: what reads by area. */\nexport type SchematicAreaKind = SchematicValue[\"items\"][number] | SchematicValue[\"zones\"][number];\n/** A kind's source of the slice. */\ntype Part = ValueTypeOf<RecordSliceBindType>;\n/** A record Slice's narrowing, decoded. */\ntype Where = ValueTypeOf<typeof RecordSliceWhereType>;\n/** A kind's details, closed. */\ntype Details = Extract<SchematicAreaKind[\"details\"], { type: \"some\" }>[\"value\"];\n/** One key search, decoded. */\ntype Query = ValueTypeOf<typeof SeekQueryType>;\n/** One search's bounds, decoded. */\ntype Range = ValueTypeOf<typeof SeekRangeType>;\n\nconst stringEqual = equalFor(StringType);\nconst rowOrder = compareFor(IntegerType);\nconst printQuery = printFor(SeekQueryType);\nconst printWhere = printFor(RecordSliceWhereType);\n\n/** A read still in flight. */\nexport const READING = \"reading\";\n/** A read still in flight. */\nexport type Reading = typeof READING;\n\n// ============================================================================\n// The viewport and the window\n// ============================================================================\n\n/** Where the canvas's viewport rests (#1393): what a kind read by area reads its window around. */\nexport interface SchematicViewport {\n    /** Its box, in world units. */\n    readonly box: WorldBox;\n    /** Its pixels per world unit. */\n    readonly ppu: number;\n    /** The tier its items draw at: their cards' details are read at card and label zoom. */\n    readonly lod: LodTier;\n}\n\n/** Where the canvas's viewport rests, as the canvas reports it to the reader: a store of one viewport. */\nexport interface SchematicViewportStore {\n    /** The viewport last reported; `undefined` before any is. */\n    get(): SchematicViewport | undefined;\n    /** Reports where the viewport rests: one the store holds already moves nothing. */\n    set(viewport: SchematicViewport): void;\n    /** Listens for a viewport that moves; returns the unsubscribe. */\n    subscribe(listener: () => void): () => void;\n}\n\n/**\n * A store of where the canvas's viewport rests (#1393): the canvas writes it\n * as its camera comes to rest, and the reader, a component of its own, reads\n * it — the canvas renders nothing for it, as the Plan's span store does.\n *\n * @returns The store\n */\nexport function createViewportStore(): SchematicViewportStore {\n    let viewport: SchematicViewport | undefined;\n    const listeners = new Set<() => void>();\n    const same = (a: SchematicViewport, b: SchematicViewport) => a.ppu === b.ppu && a.lod === b.lod\n        && a.box.minX === b.box.minX && a.box.minY === b.box.minY && a.box.maxX === b.box.maxX && a.box.maxY === b.box.maxY;\n    return {\n        get: () => viewport,\n        set(next) {\n            if (viewport !== undefined && same(viewport, next)) return;\n            viewport = next;\n            for (const listener of [...listeners]) listener();\n        },\n        subscribe(listener) {\n            listeners.add(listener);\n            return () => { listeners.delete(listener); };\n        },\n    };\n}\n\n/**\n * How far past the viewport a card or a labelled pin whose centre lies outside still draws, in screen pixels: half the\n * widest one ({@link SCHEMATIC_CARD_MAX_PX}), each shorter than it is wide. A card drawn at its item's own width spans\n * that box, which the area index files its row by (SC34), and reaches past it by less.\n */\nexport const SCHEMATIC_CARD_REACH_PX = SCHEMATIC_CARD_MAX_PX / 2;\n\n/** A dot's reach past the viewport, in screen pixels: its marker and its ring. */\nconst DOT_REACH_PX = 10;\n\n/** A kind's window (§10.4): the viewport padded by the largest card's half size, the box its searches reach, and its zoom. */\nexport interface SchematicWindow {\n    /** The viewport padded by the largest card's half size at its zoom: what its searches are planned over. */\n    readonly box: WorldBox;\n    /** The box its searches hold: the padded viewport grown by an eighth of its larger side on each side (`areaCells`' margin). */\n    readonly reach: WorldBox;\n    /** The zoom it was made for, in px per world unit: drawn as its density, it holds only at it. */\n    readonly ppu: number;\n}\n\n/** A box's larger side. */\nfunction larger(box: WorldBox): number {\n    return Math.max(box.maxX - box.minX, box.maxY - box.minY);\n}\n\n/**\n * A viewport's window (§10.4): the viewport padded by the largest card's half\n * size at its zoom — a dot's at dot zoom — the box its searches reach, and\n * the zoom.\n *\n * @param viewport - Where the viewport rests\n * @returns Its window\n */\nexport function windowOf(viewport: SchematicViewport): SchematicWindow {\n    const pad = (viewport.lod === \"dot\" ? DOT_REACH_PX : SCHEMATIC_CARD_REACH_PX) / viewport.ppu;\n    const { minX, minY, maxX, maxY } = viewport.box;\n    const box = { minX: minX - pad, minY: minY - pad, maxX: maxX + pad, maxY: maxY + pad };\n    const margin = larger(box) / 8;\n    return { box, reach: { minX: box.minX - margin, minY: box.minY - margin, maxX: box.maxX + margin, maxY: box.maxY + margin }, ppu: viewport.ppu };\n}\n\n/** A window drawn as its density, as whether it holds weighs it: the density, and whether its cells hold more rows than a window reads. */\nexport interface SchematicWindowDensity {\n    /** The density it draws. */\n    readonly density: SchematicDensity;\n    /** Whether its cells hold more than `SCHEMATIC_WINDOW_READ_ROWS`: then it draws its density whatever its view holds. */\n    readonly capped: boolean;\n}\n\n/**\n * Whether a window holds for a viewport (§10.4, D25). Drawn as its rows, it\n * holds while the viewport's padded box lies inside the window's reach and is\n * at least half its size, so a pan or a zoom inside the margin reads nothing,\n * and a zoom in by more than half plans the window again at its finer cells.\n * Drawn as its density, it holds only at the zoom it was made for — so a view\n * draws one raster by whatever route it was reached, Fit's button or the\n * wheel — while the viewport's padded box lies inside its reach, which its\n * raster covers, and while the density counts more rows in the viewport than\n * a window draws or its cells hold more than a window reads: past that, the\n * viewport's own window is planned, which reads the rows.\n *\n * @param window - The window read\n * @param viewport - Where the viewport rests now\n * @param drawn - Its density, while it is drawn as its density; `undefined` while it is drawn as its rows, or not yet read\n * @param extent - The drawing's extent, in world units: where a density's rows lie\n * @returns Whether the window still holds\n */\nexport function windowHolds(window: SchematicWindow, viewport: SchematicViewport, drawn: SchematicWindowDensity | undefined, extent: WorldBox): boolean {\n    const next = windowOf(viewport).box;\n    const { reach } = window;\n    const inside = next.minX >= reach.minX && next.minY >= reach.minY && next.maxX <= reach.maxX && next.maxY <= reach.maxY;\n    if (drawn === undefined) return inside && larger(next) >= larger(window.box) / 2;\n    return inside && viewport.ppu === window.ppu\n        && (drawn.capped || densityInView(drawn.density, viewport.box, extent).rows > SCHEMATIC_WINDOW_ROWS);\n}\n\n// ============================================================================\n// The reads\n// ============================================================================\n\n/** A kind's rows read by area: each row's decoded value, by its key's text ({@link kindKeys}, #1549). */\nexport type SchematicAreaRows = ReadonlyMap<string, unknown>;\n\n/** A density raster, as the canvas draws it (D25): its cells holding rows, each its corner and how many. */\nexport interface SchematicDensity {\n    /** Its cells' side, in world units. */\n    readonly side: number;\n    /** Its cells that hold rows: each its left edge, its top and how many rows it holds. */\n    readonly cells: readonly SchematicDensityCell[];\n    /** The most rows a cell holds: what the raster's shading is scaled to. */\n    readonly most: number;\n    /** The box its cells cover, in world units: its window's reach. */\n    readonly box: WorldBox;\n    /** Whether the coarser levels' rows are spread over its cells, each cell's count then holding a share of theirs. */\n    readonly spread: boolean;\n    /** Whether a narrowing the index doesn't lead is left out of it, which the footer says. */\n    readonly unnarrowed: boolean;\n}\n\n/** How many rows a density shades in a box (#1393): what the footer says of a kind drawn as its density. */\nexport interface SchematicDensityInView {\n    /**\n     * How many: every row of each cell inside the box, and the box's share of each cell it cuts — the cell's rows held\n     * evenly over its part in the drawing's extent — whole below a hundred and to two significant figures above, where it\n     * is not exact.\n     */\n    readonly rows: number;\n    /** Whether that is exact: every cell the box meets lies inside it, the density covers the box, and no coarser level's rows are spread. */\n    readonly exact: boolean;\n}\n\n/**\n * How many rows a density shades in a box (#1393, D25) — the viewport's, where\n * it rests: what the footer says of a kind drawn as its density. A cell's rows\n * lie in its part of the drawing's extent, as Issues holds every item to the\n * extent, so a cell reaching past the extent's edge lies in the box while its\n * part in the extent does: the view Fit leaves, the extent edge to edge, counts\n * every row exactly whatever cell the extent's edge cuts. A cell wholly outside\n * the extent holds rows only where they stand outside it, and is taken whole. A\n * cell the box cuts gives the box its share of the cell's rows, as the density\n * holds a coarser cell's rows evenly over the cells it covers; a count that\n * takes a share is an estimate, said to two significant figures.\n *\n * @param density - The kind's density\n * @param box - The box, in world units\n * @param extent - The drawing's extent, in world units\n * @returns How many rows it shades in the box, and whether that is exact\n */\nexport function densityInView(density: SchematicDensity, box: WorldBox, extent: WorldBox): SchematicDensityInView {\n    const { side, box: covered } = density;\n    let exact = !density.spread && box.minX >= covered.minX && box.minY >= covered.minY && box.maxX <= covered.maxX && box.maxY <= covered.maxY;\n    let rows = 0;\n    for (const cell of density.cells) {\n        const share = shareInBox(cell.minX, cell.minY, side, box, extent);\n        if (share === 0) continue;\n        if (share < 1) exact = false;\n        rows += cell.count * share;\n    }\n    return { rows: exact ? rows : roughly(rows), exact };\n}\n\n/**\n * How many rows a window's cells hold in a box, by their counts (#1393, D25) —\n * the viewport's, where it rests: what the density switch weighs before a row\n * or a raster is read. Each cell's rows are held evenly over its part of the\n * drawing's extent, as a density's cell's are ({@link densityInView}), the\n * box giving its share of them; a coarser level's cell by its exact key the\n * same, its rows' centres anywhere in it.\n *\n * @param cells - The window's cells, as `areaCells` plans them\n * @param counts - How many entries each holds, in their order\n * @param box - The box, in world units\n * @param extent - The drawing's extent, in world units\n * @returns How many rows they hold in the box: an estimate, unrounded\n * @throws {Error} When the counts are not one a cell\n */\nexport function cellsInView(cells: readonly AreaCell[], counts: readonly bigint[], box: WorldBox, extent: WorldBox): number {\n    if (counts.length !== cells.length) throw new Error(`A window of ${cells.length} cells was counted ${counts.length}`);\n    let rows = 0;\n    cells.forEach((cell, i) => {\n        const count = counts[i]!;\n        if (count > 0n) rows += Number(count) * shareInBox(cell.minX, cell.minY, cell.side, box, extent);\n    });\n    return rows;\n}\n\n/**\n * The share of a cell's rows a box holds: its rows lie evenly over its part of the drawing's extent, as Issues holds\n * every item to the extent, so a cell reaching past the extent's edge gives all of them to a box holding its part; a\n * cell wholly outside the extent holds them where they stand. Whole for a part inside the box, none for one only\n * touching it.\n */\nfunction shareInBox(minX: number, minY: number, side: number, box: WorldBox, extent: WorldBox): number {\n    const whole = { minX, minY, maxX: minX + side, maxY: minY + side };\n    const part = overlap(whole, extent) ?? whole;\n    const seen = overlap(part, box);\n    if (seen === undefined) return 0;\n    if (part.minX >= box.minX && part.maxX <= box.maxX && part.minY >= box.minY && part.maxY <= box.maxY) return 1;\n    return ((seen.maxX - seen.minX) / (part.maxX - part.minX)) * ((seen.maxY - seen.minY) / (part.maxY - part.minY));\n}\n\n/** Where two boxes overlap, with an area; `undefined` where they only touch, or not at all. */\nfunction overlap(a: WorldBox, b: WorldBox): WorldBox | undefined {\n    const minX = Math.max(a.minX, b.minX), minY = Math.max(a.minY, b.minY), maxX = Math.min(a.maxX, b.maxX), maxY = Math.min(a.maxY, b.maxY);\n    return minX < maxX && minY < maxY ? { minX, minY, maxX, maxY } : undefined;\n}\n\n/**\n * What of a box another leaves (#1398): up to four boxes, disjoint — the\n * strips above and below the other, then those beside it, between them. The\n * box whole where the two do not overlap; none where the other covers it.\n *\n * @param a - The box\n * @param b - What is taken from it; `undefined`, nothing\n * @returns What of `a` lies outside `b`\n */\nexport function boxMinus(a: WorldBox, b: WorldBox | undefined): WorldBox[] {\n    const cut = b === undefined ? undefined : overlap(a, b);\n    if (cut === undefined) return [a];\n    const out: WorldBox[] = [];\n    if (cut.minY > a.minY) out.push({ minX: a.minX, minY: a.minY, maxX: a.maxX, maxY: cut.minY });\n    if (cut.maxY < a.maxY) out.push({ minX: a.minX, minY: cut.maxY, maxX: a.maxX, maxY: a.maxY });\n    if (cut.minX > a.minX) out.push({ minX: a.minX, minY: cut.minY, maxX: cut.minX, maxY: cut.maxY });\n    if (cut.maxX < a.maxX) out.push({ minX: cut.maxX, minY: cut.minY, maxX: a.maxX, maxY: cut.maxY });\n    return out;\n}\n\n/**\n * The area a drawing's reads in flight have not drawn yet (#1398, CL2): each\n * kind's window being read, less the reach of the window its drawing holds —\n * what the canvas washes, as boxes disjoint from one another, so where two\n * kinds' unread areas meet it washes once.\n *\n * @param parts - Each kind read by area whose window is read: the reach it reads, and the reach its drawing holds — `undefined` for none yet\n * @returns The unread area, as disjoint boxes\n */\nexport function unreadArea(parts: readonly { readonly want: WorldBox; readonly have: WorldBox | undefined }[]): WorldBox[] {\n    const out: WorldBox[] = [];\n    for (const { want, have } of parts) {\n        for (const piece of boxMinus(want, have)) {\n            // What an earlier kind's unread area holds already is washed once.\n            let rest = [piece];\n            for (const held of out) rest = rest.flatMap((box) => boxMinus(box, held));\n            out.push(...rest);\n        }\n    }\n    return out;\n}\n\n/** An estimate's count, as it is said: whole below a hundred, else to two significant figures. */\nfunction roughly(n: number): number {\n    if (n < 100) return Math.round(n);\n    const unit = 10 ** (Math.floor(Math.log10(n)) - 1);\n    return Math.round(n / unit) * unit;\n}\n\n/** A kind's window as it was read, before its narrowing is asked of it (#1393). */\nexport interface SchematicWindowRead {\n    /** The plan it was read by. */\n    readonly plan: SchematicWindowPlan;\n    /** The revision it was read at. */\n    readonly revision: string;\n    /** Its rows, by key: the window's — or, at density, the coarser levels' — the narrowing not yet asked of them. */\n    readonly rows: SchematicAreaRows;\n    /** Its density, past the rows a window draws; `undefined` while it draws items. */\n    readonly density: SchematicDensity | undefined;\n    /** Where its rows were read from in its index, which its details are read by (D45): its cells, or at density the coarser levels' runs. */\n    readonly at: { readonly cells: readonly RecordSliceCell[] } | { readonly runs: readonly Range[] };\n    /** What its rows were read from: the same parts, the same rows. */\n    readonly from: readonly unknown[];\n    /** The window it was read for: the drawing it makes covers that window's reach. */\n    readonly window: SchematicWindow;\n}\n\n/** A kind's rows read by area, the narrowing asked of them (#1393). */\nexport interface SchematicAreaRead {\n    /** The rows it draws, by key: within its narrowing — every one read under `narrowed=\"dim\"`. */\n    readonly rows: SchematicAreaRows;\n    /**\n     * The rows its narrowing holds, while one narrows it: under `narrowed=\"dim\"` those `within` answered for, else every\n     * row it draws; `undefined` while nothing narrows it.\n     */\n    readonly matched: ReadonlySet<string> | undefined;\n    /** What its rows were read from: the same parts, the same rows. */\n    readonly from: readonly unknown[];\n}\n\n/** An entry's row: its joined row, or the whole row its index carries (D29). */\nfunction rowOf(entry: RecordSliceEntry): unknown {\n    if (entry.row?.type === \"some\") return entry.row.value;\n    if (entry.value?.type === \"some\") return entry.value.value;\n    return undefined;\n}\n\n/** No narrowing: under `narrowed=\"dim\"`, a window reads every row. */\nconst NO_WHERE: Where = new Map();\n\n/** No rows. */\nconst NO_ROWS: SchematicAreaRows = new Map();\n\n/** No entries: the coarser levels' while none holds a row, or while their rows are spread. */\nconst NO_ENTRIES: readonly RecordSliceEntry[] = [];\n\n/** No runs: the coarser levels' while none holds a row, or while their rows are spread. */\nconst NO_RUNS: readonly Range[] = [];\n\n/** No details' rows: a cell's, or runs', that hold no entry. */\nconst NO_JOINED: readonly RecordSliceJoined[] = [];\n\n/** The most within answers a kind keeps at a revision and a narrowing, past which those of rows no longer read go. */\nconst MAX_KEPT_ANSWERS = 20_000;\n\n/**\n * A window's plan, and its searches as the cells it reads — each where it is beside it, in the same order: for the\n * source's config, the narrowing and the window they were planned for.\n */\ninterface Planned {\n    readonly config: unknown;\n    readonly where: Where;\n    readonly window: SchematicWindow;\n    readonly plan: SchematicWindowPlan;\n    /** The plan's index's `on` printer: its searches of the key's own fields name its leading values as one (#1432). */\n    readonly printOn: RecordOnPrinter;\n    readonly cells: readonly RecordSliceCell[];\n    readonly places: readonly AreaCell[];\n}\n\n/** How many entries a window's cells hold, found at a revision: each cell's, in their order, and all of them. */\ninterface Found {\n    readonly revision: string;\n    readonly planned: Planned;\n    readonly counts: readonly bigint[];\n    readonly total: bigint;\n}\n\n/**\n * A window's density raster as its bounds were found: the density it draws, the bounds, the coarser levels' bounds,\n * and whether their rows are read as rows — they hold some, and no more than a window draws.\n */\ninterface Rasterized {\n    readonly density: SchematicDensity;\n    readonly found: readonly Range[];\n    readonly coarse: readonly Range[];\n    readonly few: boolean;\n}\n\n/** A kind's overview raster: planned over the drawing's extent for the source's config and the narrowing, and its searches. */\ninterface OverviewPlanned {\n    readonly config: unknown;\n    readonly where: Where;\n    readonly extent: WorldBox;\n    readonly plan: SchematicWindowPlan;\n    readonly raster: SchematicRaster;\n    readonly cells: number;\n    readonly queries: readonly Query[];\n}\n\n/** A window's density raster: its plan's, over its reach, and its searches — its cells' ranges, then the coarser levels' keys. */\ninterface Rastered {\n    readonly planned: Planned;\n    readonly raster: SchematicRaster;\n    readonly cells: number;\n    readonly queries: readonly Query[];\n}\n\n/**\n * A kind's details' rows read by the runs its window's rows were read by (D45), at the kind's revision and the details':\n * each cell's, and the coarser levels' runs' at density.\n */\ninterface Joined {\n    /** The `id` of the details' paged read. */\n    readonly dict: string;\n    /** The index the runs are of. */\n    readonly index: string;\n    /** The kind's revision the runs were found at. */\n    readonly revision: string;\n    /** The details' revision their rows were read at. */\n    readonly details: string;\n    /** Each cell's rows of the details, by its name, while the window wants it. */\n    readonly cells: Map<string, readonly RecordSliceJoined[]>;\n    /** The coarser levels' runs' rows of the details, for the runs they were read by. */\n    runs: { readonly runs: readonly Range[]; readonly joined: readonly RecordSliceJoined[] } | undefined;\n}\n\n/** What the reader holds of one kind read by area, across reads: each part beside what it was read from. */\ninterface Slot {\n    /** The window it holds. */\n    window?: SchematicWindow;\n    /** Its window's plan and cells. */\n    planned?: Planned;\n    /** How many entries its window's cells hold, found at a revision. */\n    found?: Found;\n    /** Each cell's entries, read through an index at a revision. */\n    kept?: { readonly index: string; readonly revision: string; readonly cells: Map<string, RecordSliceEntry[]> };\n    /** Its density's raster. */\n    rastered?: Rastered;\n    /** The raster's searches' bounds, found at a revision. */\n    bounds?: { readonly revision: string; readonly raster: SchematicRaster; readonly found: readonly Range[] };\n    /** The coarser levels' rows, read for the bounds they were found by, and the runs they were read by. */\n    coarse?: { readonly found: readonly Range[]; readonly runs: readonly Range[]; readonly entries: readonly RecordSliceEntry[] };\n    /** The density it last drew. */\n    density?: SchematicDensity;\n    /** Its overview's raster, planned over the drawing's extent. */\n    overviewPlanned?: OverviewPlanned;\n    /** Its overview: the whole drawing's density, read at a revision for the raster it was planned as. */\n    overview?: { readonly planned: OverviewPlanned; readonly revision: string; readonly density: SchematicDensity };\n    /** Its narrowing's raster over the drawing's extent, planned for `fit`. */\n    fitPlanned?: OverviewPlanned;\n    /** The box its narrowing's rows stand in, read at a revision for the raster it was planned as; `null` for none. */\n    fit?: { readonly planned: OverviewPlanned; readonly revision: string; readonly box: WorldBox | null };\n    /** Its window as it was last read, for its plan and its revision, and whether its cells hold more rows than a window reads. */\n    read?: { readonly planned: Planned; readonly revision: string; readonly read: SchematicWindowRead; readonly capped: boolean };\n    /** Its far ends' rows, as the read by key gave them. */\n    far?: { readonly read: readonly PagedRow[]; readonly rows: SchematicAreaRows };\n    /** The narrowing's answers, at a revision and a narrowing. */\n    answers?: { readonly revision: string; readonly where: string; held: ReadonlyMap<string, boolean> };\n    /** Its rows, the narrowing asked of them, for what they were read from. */\n    narrowed?: { readonly read: SchematicWindowRead; readonly far: SchematicAreaRows; readonly where: Where; readonly dim: boolean; readonly result: SchematicAreaRead };\n    /** Its rows made its stored rows: and what they were made from — the kind itself among it, whose accessors make the roles. */\n    made?: { readonly from: readonly unknown[]; readonly rows: StoredRows };\n    /** Its details' rows, read by the runs its window's rows were read by (D45). */\n    joined?: Joined;\n    /** Its items' details made their stored rows, for the details and the rows read: each cell's, in the window's order. */\n    details?: { readonly details: Details; readonly from: readonly (readonly RecordSliceJoined[])[]; readonly rows: StoredRows };\n    /** The rows its window holds, as the frame is handed them. */\n    holding?: { readonly revision: string; readonly rows: ReadonlyMap<string, { readonly row: Uint8Array }> };\n    /** What its window's read waits on while it is in flight: its rows, or its density's counts (#1398, CL3). */\n    waiting?: SchematicWindowWait | undefined;\n}\n\n/** What a kind's window's read waits on: its rows — its cells' counts and entries, the coarser levels' — or its density's counts. */\nexport type SchematicWindowWait = \"rows\" | \"counts\";\n\n/**\n * The reader's state across reads (see the module docs): each kind's window,\n * the cells it read at their revision, the narrowing's answers, the density it\n * drew and the rows it made — every part beside what it was read from.\n */\nexport class SchematicAreaReader {\n    private readonly slots = new Map<string, Slot>();\n    /** What each kind's `rowsOf` — and its details' — has made of its rows, a budget a read (`made-rows.ts`). */\n    private readonly making = new RowMaking();\n\n    /** Begins a read: it makes rows for a budget's time, and leaves the rest to the next read ({@link unmade}). */\n    begin(): void {\n        this.making.begin();\n    }\n\n    /** Whether the last read left rows to make: its reader reads again a task later, so a frame draws between. */\n    get unmade(): boolean {\n        return this.making.unmade;\n    }\n\n    /** A kind's state, made empty on first use. */\n    private slotOf(key: string): Slot {\n        let slot = this.slots.get(key);\n        if (slot === undefined) {\n            slot = {};\n            this.slots.set(key, slot);\n        }\n        return slot;\n    }\n\n    /**\n     * The rows a kind's window holds at a revision, as the frame is handed them:\n     * the same object while they and the revision hold.\n     *\n     * @param slot - The kind's slot\n     * @param revision - The revision they were read at\n     * @param rows - The rows, by key\n     * @returns What the window holds\n     */\n    held(slot: string, revision: string, rows: ReadonlyMap<string, { readonly row: Uint8Array }>): { readonly revision: string; readonly rows: ReadonlyMap<string, { readonly row: Uint8Array }> } {\n        const state = this.slotOf(slot);\n        const was = state.holding;\n        if (was !== undefined && Object.is(was.rows, rows) && stringEqual(was.revision, revision)) return was;\n        const now = { revision, rows };\n        state.holding = now;\n        return now;\n    }\n\n    /**\n     * A kind's window as it is read (see the module docs): its rows while the\n     * viewport holds no more than a window draws, else its density — the same\n     * object while its plan and its revision hold.\n     *\n     * @param kind - The kind\n     * @param part - Its source of the slice\n     * @param areas - Its area indexes\n     * @param viewport - Where the viewport rests\n     * @param dim - Whether every row is read, the narrowing drawn as context (`narrowed=\"dim\"`)\n     * @param extent - The drawing's extent, in world units: where a cell's rows lie, as the viewport's count weighs them\n     * @returns What the window holds; {@link READING} while a search or a read is in flight\n     */\n    window(kind: SchematicAreaKind, part: Part, areas: SchematicAreaIndexes, viewport: SchematicViewport, dim: boolean, extent: WorldBox): SchematicWindowRead | Reading {\n        const slot = this.slotOf(kind.key);\n        // Until it lands, what it waits on is said: its rows, or its density's counts.\n        slot.waiting = \"rows\";\n        const revision = recordSliceRevision(part);\n        if (revision.type !== \"some\") return READING;\n        const planned = this.plannedOf(slot, part, areas, dim ? NO_WHERE : part.read().where, this.windowFor(slot, viewport, extent));\n        const last = slot.read;\n        if (last !== undefined && Object.is(last.planned, planned) && stringEqual(last.revision, revision.value)) {\n            slot.waiting = undefined;\n            return last.read;\n        }\n        const found = this.foundOf(slot, part, planned, revision.value);\n        if (found === READING) return READING;\n        const keys = kindKeys(kind.keyType);\n        // The rows are read while the viewport holds no more than a window draws — by the cells' counts, else by the\n        // density's finer one, which the footer says — and the cells no more than a window reads (D25).\n        const capped = found.total > BigInt(SCHEMATIC_WINDOW_READ_ROWS);\n        let read: SchematicWindowRead | Reading;\n        if (!capped && cellsInView(planned.places, found.counts, viewport.box, extent) <= SCHEMATIC_WINDOW_ROWS) {\n            read = this.rows(slot, part, planned, revision.value, keys);\n        } else {\n            slot.waiting = \"counts\";\n            const raster = this.rasterOf(slot, part, planned, revision.value, dim);\n            if (raster === READING) return READING;\n            slot.waiting = \"rows\";\n            read = !capped && densityInView(raster.density, viewport.box, extent).rows <= SCHEMATIC_WINDOW_ROWS\n                ? this.rows(slot, part, planned, revision.value, keys)\n                : this.density(slot, part, planned, revision.value, raster, keys);\n        }\n        if (read === READING) return READING;\n        slot.waiting = undefined;\n        slot.read = { planned, revision: revision.value, read, capped };\n        return read;\n    }\n\n    /**\n     * The window a kind reads now (#1398): its viewport's, or the one it holds while it holds — what the canvas washes\n     * the part of its drawing does not cover, while its read is in flight.\n     *\n     * @param slot - The kind's slot\n     * @returns The window; `undefined` before the kind has planned one\n     */\n    wanted(slot: string): SchematicWindow | undefined {\n        return this.slots.get(slot)?.window;\n    }\n\n    /**\n     * What a kind's window's read waits on, while it is in flight (#1398, CL3): its rows — `Loading racks in view` — or\n     * its density's counts — `Loading counts`.\n     *\n     * @param slot - The kind's slot\n     * @returns What it waits on; `undefined` while its read has landed\n     */\n    waiting(slot: string): SchematicWindowWait | undefined {\n        return this.slots.get(slot)?.waiting;\n    }\n\n    /**\n     * The window a kind reads for a viewport: the one it holds while it holds as it was drawn ({@link windowHolds}) —\n     * as its rows until its read lands — else the viewport's own.\n     */\n    private windowFor(slot: Slot, viewport: SchematicViewport, extent: WorldBox): SchematicWindow {\n        const held = slot.window;\n        const last = slot.read;\n        const density = last !== undefined && Object.is(last.planned.window, held) ? last.read.density : undefined;\n        const drawn = density === undefined || last === undefined ? undefined : { density, capped: last.capped };\n        if (held !== undefined && windowHolds(held, viewport, drawn, extent)) return held;\n        const next = windowOf(viewport);\n        slot.window = next;\n        return next;\n    }\n\n    /** A window's plan and its cells, planned again only when the source, the narrowing or the window moves. */\n    private plannedOf(slot: Slot, part: Part, areas: SchematicAreaIndexes, where: Where, window: SchematicWindow): Planned {\n        const last = slot.planned;\n        if (last !== undefined && Object.is(last.config, part.config) && Object.is(last.where, where) && Object.is(last.window, window)) return last;\n        const plan = schematicWindowPlan(areas, where, window.box);\n        const printOn = recordSliceOnPrinter(part, plan.index.name);\n        // A cell a search: the same search in every window that holds it (`areaCells`), so a pan asks only the cells it adds.\n        const places = plan.prefixes.flatMap((prefix) => areaCells(prefix, window.box, plan.cell, printOn));\n        const cells = places.map((place) => ({ id: printQuery(place.query), queries: [place.query] }));\n        const planned = { config: part.config, where, window, plan, printOn, cells, places };\n        slot.planned = planned;\n        return planned;\n    }\n\n    /** How many entries a window's cells hold, each cell's and all of them: found in one request, once a revision. */\n    private foundOf(slot: Slot, part: Part, planned: Planned, revision: string): Found | Reading {\n        const last = slot.found;\n        if (last !== undefined && Object.is(last.planned, planned) && stringEqual(last.revision, revision)) return last;\n        const runs = recordSliceCellRuns(part, planned.plan.index.name, planned.cells);\n        if (runs.type !== \"some\") return READING;\n        const counts = planned.cells.map((cell) => runs.value.get(cell.id)?.total ?? 0n);\n        let total = 0n;\n        for (const count of counts) total += count;\n        const found = { revision, planned, counts, total };\n        slot.found = found;\n        return found;\n    }\n\n    /** A window's rows, by their keys' text: its cells' entries, those of the cells not held read in one read of their runs. */\n    private rows(slot: Slot, part: Part, planned: Planned, revision: string, keys: KindKeys): SchematicWindowRead | Reading {\n        const entries = this.entriesOf(slot, part, planned.plan.index.name, revision, planned.cells);\n        if (entries === READING) return READING;\n        return {\n            plan: planned.plan, revision, rows: rowsOfEntries(entries, keys), density: undefined, at: { cells: planned.cells }, from: entries, window: planned.window,\n        };\n    }\n\n    /**\n     * The cells' entries a kind's window holds, at the record's revision through\n     * an index: those of the wanted cells it doesn't hold read in one read of\n     * their runs, and every cell no longer wanted let go.\n     *\n     * @returns Each wanted cell's entries, in order; {@link READING} while the read is in flight\n     */\n    private entriesOf(slot: Slot, part: Part, index: string, revision: string, cells: readonly RecordSliceCell[]): (readonly RecordSliceEntry[])[] | Reading {\n        let kept = slot.kept;\n        if (kept === undefined || !stringEqual(kept.index, index) || !stringEqual(kept.revision, revision)) {\n            kept = { index, revision, cells: new Map() };\n            slot.kept = kept;\n        }\n        const held = kept.cells;\n        const missing = cells.filter((cell) => !held.has(cell.id));\n        if (missing.length > 0) {\n            const read = recordSliceCellEntries(part, index, missing);\n            if (read.type !== \"some\") return READING;\n            for (const cell of missing) held.set(cell.id, read.value.get(cell.id) ?? []);\n        }\n        const wanted = new Set(cells.map((cell) => cell.id));\n        for (const id of [...held.keys()]) if (!wanted.has(id)) held.delete(id);\n        return cells.map((cell) => held.get(cell.id)!);\n    }\n\n    /**\n     * A window's density raster (D25): the bounds of the raster's cells over\n     * the window's reach and of the coarser levels' cells, in one request, and\n     * the density they draw — the coarser levels' rows spread over the raster\n     * while they number more than a window draws.\n     */\n    private rasterOf(slot: Slot, part: Part, planned: Planned, revision: string, dim: boolean): Rasterized | Reading {\n        const rastered = this.rasteredOf(slot, planned);\n        const found = this.boundsOf(slot, part, planned.plan.index.name, rastered, revision);\n        if (found === READING) return READING;\n        const counts = found.slice(0, rastered.cells).map((range) => range.count);\n        const coarse = found.slice(rastered.cells);\n        let total = 0n;\n        for (const range of coarse) total += range.count;\n        // The coarser levels' rows, boxes larger than half a raster cell: drawn as rows while a window would draw them all.\n        const few = total <= BigInt(SCHEMATIC_WINDOW_ROWS);\n        // Under `dim` the raster counts every row; otherwise the fields the index doesn't lead aren't counted in it.\n        const unnarrowed = dim ? part.read().where.size > 0 : planned.plan.residual.length > 0;\n        const density = this.densityOf(slot, rastered, counts, few ? undefined : coarse.map((range) => range.count), unnarrowed);\n        return { density, found, coarse, few: few && total > 0n };\n    }\n\n    /** A window drawn as its density (D25): the coarser levels' rows read in one read of their runs while they are few. */\n    private density(slot: Slot, part: Part, planned: Planned, revision: string, raster: Rasterized, keys: KindKeys): SchematicWindowRead | Reading {\n        let entries = NO_ENTRIES;\n        let runs = NO_RUNS;\n        if (raster.few) {\n            const read = this.coarseOf(slot, part, planned.plan.index.name, raster.found, raster.coarse);\n            if (read === READING) return READING;\n            entries = read.entries;\n            runs = read.runs;\n        }\n        return {\n            plan: planned.plan, revision, rows: rowsOfEntries([entries], keys), density: raster.density, at: { runs }, from: [entries, raster.density],\n            window: planned.window,\n        };\n    }\n\n    /** A window's density raster and its searches, planned again only with the window's plan. */\n    private rasteredOf(slot: Slot, planned: Planned): Rastered {\n        const last = slot.rastered;\n        if (last !== undefined && Object.is(last.planned, planned)) return last;\n        const raster = schematicRaster(planned.plan, planned.window.reach, planned.printOn);\n        const ranges = raster.cells.flat().map((cell) => cell.query);\n        const rastered = { planned, raster, cells: ranges.length, queries: [...ranges, ...raster.coarse.map((cell) => cell.query)] };\n        slot.rastered = rastered;\n        return rastered;\n    }\n\n    /** A raster's searches' bounds: found in one request, once a revision, and kept as no cell. */\n    private boundsOf(slot: Slot, part: Part, index: string, rastered: Rastered, revision: string): readonly Range[] | Reading {\n        const last = slot.bounds;\n        if (last !== undefined && Object.is(last.raster, rastered.raster) && stringEqual(last.revision, revision)) return last.found;\n        const found = recordSliceBounds(part, index, rastered.queries);\n        if (found.type !== \"some\") return READING;\n        slot.bounds = { revision, raster: rastered.raster, found: found.value };\n        return found.value;\n    }\n\n    /**\n     * The coarser levels' rows: the runs holding any, ascending, read in one read — once for the bounds they were found\n     * by — and those runs, which their details are read by.\n     */\n    private coarseOf(\n        slot: Slot, part: Part, index: string, found: readonly Range[], coarse: readonly Range[],\n    ): { readonly runs: readonly Range[]; readonly entries: readonly RecordSliceEntry[] } | Reading {\n        const last = slot.coarse;\n        if (last !== undefined && Object.is(last.found, found)) return last;\n        // Each coarser cell an exact key: their runs are disjoint, read in the index's order.\n        const runs = coarse.filter((range) => range.count > 0n).sort((a, b) => rowOrder(a.row, b.row));\n        const read = recordSliceRunEntries(part, index, runs);\n        if (read.type !== \"some\") return READING;\n        const got = { found, runs, entries: read.value };\n        slot.coarse = got;\n        return got;\n    }\n\n    /** A raster's density, as the canvas draws it: the one it last drew while its cells read again as they were, over the same box. */\n    private densityOf(slot: Slot, rastered: Rastered, counts: readonly bigint[], spread: readonly bigint[] | undefined, unnarrowed: boolean): SchematicDensity {\n        const { raster } = rastered;\n        const box = rastered.planned.window.reach;\n        const cells = schematicDensityCells(raster, counts, spread);\n        const spreads = spread !== undefined;\n        const last = slot.density;\n        if (last !== undefined && last.side === raster.side && last.unnarrowed === unnarrowed && last.spread === spreads && sameBox(last.box, box)\n            && sameCells(last.cells, cells)) return last;\n        const density = { side: raster.side, cells, most: cells.reduce((most, cell) => Math.max(most, cell.count), 0), box, spread: spreads, unnarrowed };\n        slot.density = density;\n        return density;\n    }\n\n    /**\n     * A kind's overview (#1393): its whole drawing's density, which the\n     * minimap draws, where its window holds only what the view is near — the\n     * area index's counts over the drawing's extent at the level whose cells\n     * are about a sixty-fourth of it, through the index its narrowing reads a\n     * window through, each combination of its leading values added cell by\n     * cell and the coarser levels' rows spread over them: one request of\n     * counted ranges, no row read, read once a revision and a narrowing, the\n     * last one standing until the next lands.\n     *\n     * @param kind - The kind\n     * @param part - Its source of the slice\n     * @param areas - Its area indexes\n     * @param extent - The drawing's extent, in world units\n     * @param dim - Whether every row is drawn, the narrowing as context (`narrowed=\"dim\"`)\n     * @returns The density; {@link READING} while its counts are in flight\n     */\n    overview(kind: SchematicAreaKind, part: Part, areas: SchematicAreaIndexes, extent: WorldBox, dim: boolean): SchematicDensity | Reading {\n        const revision = recordSliceRevision(part);\n        if (revision.type !== \"some\") return READING;\n        const slot = this.slotOf(kind.key);\n        const where = dim ? NO_WHERE : part.read().where;\n        let planned = slot.overviewPlanned;\n        if (planned === undefined || !Object.is(planned.config, part.config) || !Object.is(planned.where, where) || !sameBox(planned.extent, extent)) {\n            const plan = schematicWindowPlan(areas, where, extent);\n            const raster = schematicRaster(plan, extent, recordSliceOnPrinter(part, plan.index.name));\n            const ranges = raster.cells.flat().map((cell) => cell.query);\n            planned = { config: part.config, where, extent, plan, raster, cells: ranges.length, queries: [...ranges, ...raster.coarse.map((cell) => cell.query)] };\n            slot.overviewPlanned = planned;\n        }\n        const last = slot.overview;\n        if (last !== undefined && Object.is(last.planned, planned) && stringEqual(last.revision, revision.value)) return last.density;\n        const found = recordSliceBounds(part, planned.plan.index.name, planned.queries);\n        // Until its counts land, the last overview it read stands, as the previous window does.\n        if (found.type !== \"some\") return last === undefined ? READING : last.density;\n        const cells = schematicDensityCells(planned.raster, found.value.slice(0, planned.cells).map((range) => range.count),\n            found.value.slice(planned.cells).map((range) => range.count));\n        const unnarrowed = dim ? part.read().where.size > 0 : planned.plan.residual.length > 0;\n        const density: SchematicDensity = {\n            side: planned.raster.side, cells, most: cells.reduce((most, cell) => Math.max(most, cell.count), 0), box: extent, spread: true, unnarrowed,\n        };\n        slot.overview = { planned, revision: revision.value, density };\n        return density;\n    }\n\n    /**\n     * The box a kind's narrowing's rows stand in (#1393, §10.3), as its area\n     * index's counts over the drawing's extent answer it: the cells of its\n     * narrowing's raster — planned as the overview's is, its narrowing's\n     * choices whatever `narrowed` draws — and of the coarser levels that hold\n     * a row, each cell's part of the extent, in one request of counted ranges,\n     * no row read; what the camera flies\n     * to under `fit`, never what the window draws. A choice the index doesn't\n     * lead isn't counted in it: the box is then that of the choices it leads,\n     * which hold the narrowing's rows among others. Read once a revision and a\n     * narrowing; while a new one's counts are in flight, none stands in.\n     *\n     * @param kind - The kind\n     * @param part - Its source of the slice\n     * @param areas - Its area indexes\n     * @param extent - The drawing's extent, in world units\n     * @returns The box; `null` where the narrowing holds no row; {@link READING} while its counts are in flight\n     */\n    fitBox(kind: SchematicAreaKind, part: Part, areas: SchematicAreaIndexes, extent: WorldBox): WorldBox | null | Reading {\n        const revision = recordSliceRevision(part);\n        if (revision.type !== \"some\") return READING;\n        const slot = this.slotOf(kind.key);\n        const where = part.read().where;\n        let planned = slot.fitPlanned;\n        if (planned === undefined || !Object.is(planned.config, part.config) || !Object.is(planned.where, where) || !sameBox(planned.extent, extent)) {\n            const plan = schematicWindowPlan(areas, where, extent);\n            const raster = schematicRaster(plan, extent, recordSliceOnPrinter(part, plan.index.name));\n            const ranges = raster.cells.flat().map((cell) => cell.query);\n            planned = { config: part.config, where, extent, plan, raster, cells: ranges.length, queries: [...ranges, ...raster.coarse.map((cell) => cell.query)] };\n            slot.fitPlanned = planned;\n        }\n        const last = slot.fit;\n        if (last !== undefined && Object.is(last.planned, planned) && stringEqual(last.revision, revision.value)) return last.box;\n        const found = recordSliceBounds(part, planned.plan.index.name, planned.queries);\n        if (found.type !== \"some\") return READING;\n        // Each cell holding a row, the raster's and the coarser levels' alike — a coarser cell's rows anywhere in it — by its\n        // part of the drawing's extent, where its rows lie, else whole.\n        let box: WorldBox | null = null;\n        [...planned.raster.cells.flat(), ...planned.raster.coarse].forEach((cell, i) => {\n            if (found.value[i]!.count <= 0n) return;\n            const whole = { minX: cell.minX, minY: cell.minY, maxX: cell.minX + cell.side, maxY: cell.minY + cell.side };\n            const part = overlap(whole, extent) ?? whole;\n            box = box === null ? part\n                : { minX: Math.min(box.minX, part.minX), minY: Math.min(box.minY, part.minY), maxX: Math.max(box.maxX, part.maxX), maxY: Math.max(box.maxY, part.maxY) };\n        });\n        slot.fit = { planned, revision: revision.value, box };\n        return box;\n    }\n\n    /**\n     * The rows of some of a kind's keys its window doesn't hold — the far ends\n     * of the links and nets that touch it — read by key through the kind's own\n     * paged read, in one request: the same rows while that read's answer is.\n     *\n     * @param slot - The kind's slot\n     * @param paged - The `id` of its paged read; `undefined` for a kind with none\n     * @param keys - The kind's keys: each text read back at the record's key type for the read, and each row read by its key's text (#1549)\n     * @param texts - The keys' text, as the links and nets name them, in order\n     * @returns Each row the record holds, by its key's text; {@link READING} while the read is in flight\n     * @throws {Error} When the kind has no paged read, or it is bound on no page this runtime serves\n     */\n    farEnds(slot: string, paged: string | undefined, keys: KindKeys, texts: readonly string[]): SchematicAreaRows | Reading {\n        if (texts.length === 0) return NO_ROWS;\n        if (paged === undefined) throw new Error(`The kind \"${slot}\" read by area reads its far ends by key through its own paged read, and it has none`);\n        const source = pagedSourceOf(paged);\n        if (source === undefined) throw new Error(`The kind \"${slot}\"'s paged read '${paged}' is bound on no page this runtime serves`);\n        // A text no key prints as names no row the record holds: nothing is read for it.\n        const asked: unknown[] = [];\n        for (const text of texts) {\n            const key = keys.keyOf(text);\n            if (key !== undefined) asked.push(key);\n        }\n        if (asked.length === 0) return NO_ROWS;\n        const read = defaultPagedRuntime.rowsAll(source, asked);\n        if (read.type !== \"some\") return READING;\n        const state = this.slotOf(slot);\n        if (state.far !== undefined && Object.is(state.far.read, read.value)) return state.far.rows;\n        const rows = new Map<string, unknown>();\n        for (const row of read.value) if (row.row.type === \"some\") rows.set(keys.textOf(row.key), row.row.value);\n        state.far = { read: read.value, rows };\n        return rows;\n    }\n\n    /**\n     * A kind's rows read by area, its narrowing asked of them (D28): those it\n     * holds drawn — every one under `dim`, those it holds the matches — each\n     * row's answer kept at its revision and narrowing, so a pan asks only of\n     * the rows it adds; every row asked in one request. The same object while\n     * what it was read from is.\n     *\n     * @param kind - The kind\n     * @param part - Its source of the slice\n     * @param read - Its window, as it was read\n     * @param far - Its far ends, read by key\n     * @param dim - Whether the narrowing is drawn as context\n     * @returns The rows it draws, and under `dim` the matches; {@link READING} while the narrowing's answer is in flight\n     */\n    narrowed(kind: SchematicAreaKind, part: Part, read: SchematicWindowRead, far: SchematicAreaRows, dim: boolean): SchematicAreaRead | Reading {\n        const where = part.read().where;\n        const slot = this.slotOf(kind.key);\n        const last = slot.narrowed;\n        if (last !== undefined && Object.is(last.read, read) && Object.is(last.far, far) && Object.is(last.where, where) && last.dim === dim) return last.result;\n        const result = this.narrow(slot, part, read, far, where, dim, kindKeys(kind.keyType));\n        if (result !== READING) slot.narrowed = { read, far, where, dim, result };\n        return result;\n    }\n\n    /** A kind's rows, its narrowing asked of them (see {@link SchematicAreaReader.narrowed}). */\n    private narrow(slot: Slot, part: Part, read: SchematicWindowRead, far: SchematicAreaRows, where: Where, dim: boolean, keys: KindKeys): SchematicAreaRead | Reading {\n        const rows = far.size === 0 ? read.rows : new Map([...read.rows, ...far]);\n        if (where.size === 0) return { rows, matched: undefined, from: [...read.from, far] };\n        // Read by key, a far end is held to the whole narrowing; a window read through an index that serves it whole, to nothing.\n        const residual = dim || read.plan.residual.length > 0;\n        if (!residual && far.size === 0) return { rows, matched: new Set(rows.keys()), from: [...read.from, far] };\n        const held = this.answersOf(slot, part, read.revision, where, residual ? rows : far, keys);\n        if (held === READING) return READING;\n        if (dim) {\n            const matched = new Set<string>();\n            for (const key of rows.keys()) if (held.get(key) === true) matched.add(key);\n            return { rows, matched, from: [...read.from, far, held] };\n        }\n        const shown = new Map<string, unknown>();\n        for (const [key, row] of rows) {\n            const asked = residual || far.has(key);\n            if (!asked || held.get(key) === true) shown.set(key, row);\n        }\n        return { rows: shown, matched: new Set(shown.keys()), from: [...read.from, far, held] };\n    }\n\n    /**\n     * Which of some rows a narrowing holds: each answer kept at its revision and narrowing, by its row's key's text, the\n     * rows not yet answered asked in one request — each by its key read back at the record's key type (#1549).\n     */\n    private answersOf(slot: Slot, part: Part, revision: string, where: Where, rows: SchematicAreaRows, keys: KindKeys): ReadonlyMap<string, boolean> | Reading {\n        const text = printWhere(where);\n        let kept = slot.answers;\n        if (kept === undefined || !stringEqual(kept.revision, revision) || !stringEqual(kept.where, text)) {\n            kept = { revision, where: text, held: new Map() };\n            slot.answers = kept;\n        }\n        const held = kept.held;\n        const asked = [...rows].filter(([key]) => !held.has(key));\n        if (asked.length === 0) return held;\n        const answer = recordSliceWithin(part, where, asked.map(([key, row]) => ({ key: keys.keyOf(key), row })));\n        if (answer.type !== \"some\") return READING;\n        // A fresh map: what the rows are drawn from moved.\n        const next = new Map(held.size + asked.length > MAX_KEPT_ANSWERS ? [...held].filter(([key]) => rows.has(key)) : held);\n        asked.forEach(([key], i) => next.set(key, answer.value[i] === true));\n        kept.held = next;\n        return next;\n    }\n\n    /**\n     * A kind's rows made its stored rows (#1393), through its `rowsOf`: each\n     * one's roles beside its bytes — made again only when what they were read\n     * from moved, and then only the rows it has not made already, over as\n     * many reads as its budget takes.\n     *\n     * @param kind - The kind\n     * @param read - Its rows, the narrowing asked of them\n     * @returns Its stored rows, by key; {@link READING} while rows are left to make\n     */\n    rowsOf<K extends SchematicAreaKind>(kind: K, read: SchematicAreaRead): ReturnType<K[\"rowsOf\"]> | Reading {\n        const slot = this.slotOf(kind.key);\n        const from = [kind, ...read.from];\n        const last = slot.made;\n        if (last !== undefined && sameFrom(last.from, from)) return last.rows as ReturnType<K[\"rowsOf\"]>;\n        const rows = this.making.make(kind, read.rows);\n        if (rows === undefined) return READING;\n        slot.made = { from, rows };\n        return rows as ReturnType<K[\"rowsOf\"]>;\n    }\n\n    /**\n     * The details of the items a kind's window holds, made their stored rows\n     * (§12, D45): read by the runs its rows were read by — its cells, or at\n     * density the coarser levels' runs — every cell not held in one request of\n     * the details' record, the server reading each entry's key from the area\n     * index, none sent; each cell's kept at the kind's revision and the\n     * details' while the window wants it, so a pan reads only the cells it\n     * adds and a commit to the details reads them again. Read at every tier: a\n     * dot draws its item's status too. A far end, drawn off the window, has\n     * none read.\n     *\n     * @param slot - The kind's slot\n     * @param details - Its details\n     * @param part - Its source of the slice: the area index its window was read through\n     * @param read - Its window, as it was read\n     * @param keys - The kind's keys, which its details are keyed as: each details row by its key's text (#1549)\n     * @returns Their details' rows, by key; `undefined` for details read whole or by no paged read; {@link READING} while the read is in flight, or rows are left to make\n     * @throws {Error} When the details' paged read is bound on no page this runtime serves\n     */\n    detailsOf(slot: string, details: Details, part: Part, read: SchematicWindowRead, keys: KindKeys): StoredRows | Reading | undefined {\n        if (details.paged.type !== \"some\") return undefined;\n        const dict = details.paged.value;\n        const source = pagedSourceOf(dict);\n        if (source === undefined) throw new Error(`The details' paged read '${dict}' is bound on no page this runtime serves`);\n        const revision = defaultPagedRuntime.revisionOf(source);\n        if (revision.type !== \"some\") return READING;\n        const state = this.slotOf(slot);\n        const index = read.plan.index.name;\n        let kept = state.joined;\n        if (kept === undefined || !stringEqual(kept.dict, dict) || !stringEqual(kept.index, index)\n            || !stringEqual(kept.revision, read.revision) || !stringEqual(kept.details, revision.value)) {\n            kept = { dict, index, revision: read.revision, details: revision.value, cells: new Map(), runs: undefined };\n            state.joined = kept;\n        }\n        const parts = this.joinedOf(kept, part, read.at);\n        if (parts === READING) return READING;\n        const last = state.details;\n        if (last !== undefined && Object.is(last.details, details) && sameFrom(last.from, parts)) return last.rows;\n        const present = new Map<string, unknown>();\n        for (const joined of parts) {\n            for (const entry of joined) if (entry.row.type === \"some\") present.set(keys.textOf(entry.key), entry.row.value);\n        }\n        const made = this.making.make(details, present);\n        if (made === undefined) return READING;\n        state.details = { details, from: parts, rows: made };\n        return made;\n    }\n\n    /**\n     * A window's details' rows (see {@link SchematicAreaReader.detailsOf}): its\n     * cells' — those not held read in one request, and every cell no longer\n     * wanted let go — or the coarser levels' runs', read once for the runs.\n     *\n     * @returns Each cell's rows of the details, in the window's order, or the runs'; {@link READING} while the read is in flight\n     */\n    private joinedOf(kept: Joined, part: Part, at: SchematicWindowRead[\"at\"]): readonly (readonly RecordSliceJoined[])[] | Reading {\n        if (\"runs\" in at) {\n            if (kept.runs === undefined || !Object.is(kept.runs.runs, at.runs)) {\n                let joined = NO_JOINED;\n                if (at.runs.length > 0) {\n                    const got = recordSliceRunJoins(part, kept.index, at.runs, kept.dict);\n                    if (got.type !== \"some\") return READING;\n                    joined = got.value;\n                }\n                kept.runs = { runs: at.runs, joined };\n            }\n            return [kept.runs.joined];\n        }\n        const held = kept.cells;\n        const missing = at.cells.filter((cell) => !held.has(cell.id));\n        if (missing.length > 0) {\n            const got = recordSliceCellJoins(part, kept.index, missing, kept.dict);\n            if (got.type !== \"some\") return READING;\n            for (const cell of missing) held.set(cell.id, got.value.get(cell.id) ?? NO_JOINED);\n        }\n        const wanted = new Set(at.cells.map((cell) => cell.id));\n        for (const id of [...held.keys()]) if (!wanted.has(id)) held.delete(id);\n        return at.cells.map((cell) => held.get(cell.id)!);\n    }\n}\n\n/** The rows some cells' entries hold, by their keys' text (#1549): each row once. */\nfunction rowsOfEntries(entries: readonly (readonly RecordSliceEntry[])[], keys: KindKeys): Map<string, unknown> {\n    const rows = new Map<string, unknown>();\n    for (const cell of entries) {\n        for (const entry of cell) {\n            const row = rowOf(entry);\n            if (row !== undefined) rows.set(keys.textOf(entry.key), row);\n        }\n    }\n    return rows;\n}\n\n/** Whether two lists of what rows were read from are the same parts, in order. */\nfunction sameFrom(a: readonly unknown[], b: readonly unknown[]): boolean {\n    return a.length === b.length && a.every((part, i) => Object.is(part, b[i]));\n}\n\n/** Whether two boxes are the same box. */\nfunction sameBox(a: WorldBox, b: WorldBox): boolean {\n    return a.minX === b.minX && a.minY === b.minY && a.maxX === b.maxX && a.maxY === b.maxY;\n}\n\n/** Whether two densities' cells read the same: each at the same corner, holding as many rows. */\nfunction sameCells(a: readonly SchematicDensityCell[], b: readonly SchematicDensityCell[]): boolean {\n    return a.length === b.length && a.every((cell, i) => cell.minX === b[i]!.minX && cell.minY === b[i]!.minY && cell.count === b[i]!.count);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The library's Backlog (#1389, `Schematic Builder Spec.md` §8, SC4) — pure:\n * every item kind's rows with no position, each kind's in the Schematic's\n * order of its kinds, the read's rows with the editing session's drafts in\n * place, as the canvas draws its rows (`drafted.ts`):\n *\n * - **a stored row with no position** is listed, unless a draft holds it —\n *   the draft decides;\n * - **a drafted row with no position** is listed: one a gesture unplaced, or\n *   one it created unplaced;\n * - **a drafted row placed, or deleted**, is not;\n * - **a drafted row the read does not hold** — a source's narrowing hides it —\n *   waits in its session, listed once a read holds it again; a new one is\n *   listed always.\n *\n * A kind read whole, or complete through its source, holds its every row with\n * no position its read holds: those are what the Backlog lists. A kind read by\n * area (#1393) pages them through its area index instead (`backlog-pages.ts`),\n * and holds only its window: its drafted rows with no position are listed\n * here wherever the window is, each told by the row its session began from, as\n * the Calendar's paged Backlog tells its drafted events — one whose stored row\n * had a position, which no page lists, while its narrowing holds that row\n * (`drafts-narrowing.ts`); one whose stored row had none is its page's, its\n * draft in place.\n *\n * @packageDocumentation\n */\n\nimport { entityId, type ItemRoles, type SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicHeldRows, SchematicUnplacedRows } from \"./data.js\";\nimport type { SortDrafts } from \"./drafted.js\";\n\n/** One row the Backlog lists: its kind's slot and its key, its id on the canvas, and its roles. */\nexport interface BacklogEntry {\n    /** Its kind's slot and its key. */\n    readonly ref: SchematicRef;\n    /** Its reference, printed: its id on the canvas, and its card's key. */\n    readonly id: string;\n    /** Its roles, as its kind reads them: its card's label, icon, second line and status. */\n    readonly roles: ItemRoles;\n}\n\n/** An item kind, as the Backlog reads it: its slot, and whether its rows may have no position. */\nexport interface BacklogKind {\n    /** Its slot. */\n    readonly key: string;\n    /** Whether its `x` and `y` are Options: its rows with no position are its backlog. */\n    readonly backlog: boolean;\n}\n\n/** The item kinds read by area (#1393), as the Backlog lists their drafted rows: by the row each one's session began from. */\nexport interface BacklogArea {\n    /** The kinds read by area, by slot. */\n    readonly kinds: ReadonlySet<string>;\n    /**\n     * Whether a kind read by area's narrowing holds a drafted row, by the row its session began from: `false` leaves it\n     * out; `undefined` for one not asked — nothing narrows the kind, or the answer is in flight — which is listed.\n     */\n    readonly held: (ref: SchematicRef) => boolean | undefined;\n}\n\n/** No row. */\nconst NO_ROWS: ReadonlyMap<string, never> = new Map<string, never>();\n\n/** No kind read by area. */\nconst NO_AREA: BacklogArea = { kinds: new Set(), held: () => undefined };\n\n/**\n * The rows the Backlog lists (see the module docs).\n *\n * @param kinds - The item kinds, in the Schematic's order\n * @param unplaced - Each item kind's rows the read holds with no position\n * @param held - Each kind's rows the read holds\n * @param drafts - The item kinds' drafts\n * @param area - The kinds read by area, and whether their narrowing holds a drafted row; none by default\n * @returns The rows, each kind's in its read's order, then its drafted ones in theirs\n */\nexport function backlogEntries(kinds: readonly BacklogKind[], unplaced: SchematicUnplacedRows, held: SchematicHeldRows,\n    drafts: SortDrafts<ItemRoles>, area: BacklogArea = NO_AREA): BacklogEntry[] {\n    const out: BacklogEntry[] = [];\n    for (const kind of kinds) {\n        if (!kind.backlog) continue;\n        const drafted = drafts.get(kind.key) ?? NO_ROWS;\n        const read = held.get(kind.key);\n        const byArea = area.kinds.has(kind.key);\n        for (const [key, roles] of unplaced.get(kind.key) ?? NO_ROWS) {\n            if (drafted.has(key)) continue;\n            const ref = { kind: kind.key, key };\n            out.push({ ref, id: entityId(ref), roles });\n        }\n        for (const [key, row] of drafted) {\n            if (row === undefined || row.roles.position.type === \"some\") continue;\n            const ref = { kind: kind.key, key };\n            if (!row.created) {\n                if (byArea) {\n                    // A kind read by area, wherever its window is: a row whose stored row had no position is its page's, and\n                    // one the narrowing leaves out — by the row its session began from — waits in its session.\n                    if (row.began?.position.type !== \"some\" || area.held(ref) === false) continue;\n                } else if (read?.has(key) !== true) {\n                    // A row a narrowing hides waits in its session; a new one is listed.\n                    continue;\n                }\n            }\n            out.push({ ref, id: entityId(ref), roles: row.roles });\n        }\n    }\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * A kind's rows as its `rowsOf` makes them (#1393): each one's roles beside\n * its bytes, kept at the revision they were read at — those not yet made\n * made in one call — what the paged Backlog and the Index read of a kind read\n * by area outside its window.\n *\n * @packageDocumentation\n */\n\nimport { ArrayType, StringType, StructType, encodeBeast2For, equalFor, fromEastTypeValue, type StructType as StructTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceEntry } from \"@elaraai/east-ui/internal\";\nimport type { SchematicValue } from \"./data.js\";\n\n/** An item kind, decoded: what makes its rows' roles. */\ntype ItemKind = SchematicValue[\"items\"][number];\n\n/** A row as its kind's `rowsOf` makes it: its roles beside its bytes. */\nexport interface KindRow<R> {\n    /** Its roles. */\n    readonly roles: R;\n    /** Its bytes: the row as the record holds it, beast2 of the kind's row type. */\n    readonly row: Uint8Array;\n}\n\n/** Each kind's encoder of the rows it reads, as its `rowsOf` takes them: an Array of `{ key, row }`. */\ntype RowsEncoder = (rows: { key: string; row: unknown }[]) => Uint8Array;\n\nconst stringEqual = equalFor(StringType);\n\n/** The most rows a kind keeps at a revision, past which they are made again as they are read again. */\nconst MAX_KEPT = 8_192;\n\n/**\n * An entry's row: its joined row, or the whole row its index carries (D29).\n *\n * @param entry - The entry\n * @returns Its row; `undefined` for an entry that carries none\n */\nexport function entryRow(entry: RecordSliceEntry): unknown {\n    if (entry.row?.type === \"some\") return entry.row.value;\n    if (entry.value?.type === \"some\") return entry.value.value;\n    return undefined;\n}\n\n/** Some kinds' rows as their `rowsOf` makes them (see the module docs). */\nexport class KindRows<R> {\n    /** Each kind's rows, by key, at the revision they were read at. */\n    private readonly kept = new Map<string, { readonly revision: string; readonly rows: Map<string, KindRow<R>> }>();\n    /** Each kind's encoder, made once. */\n    private readonly encoders = new WeakMap<object, RowsEncoder>();\n\n    /**\n     * Some rows of a kind, made: those not yet made at the revision made in one call of its `rowsOf`.\n     *\n     * @param kind - The kind\n     * @param revision - The record's revision the rows were read at\n     * @param rows - The rows, each its key's text (`kind-keys.ts`) and its row\n     * @returns Each row's roles and bytes, by key — every row made at the revision, these among them\n     */\n    rowsOf(kind: ItemKind, revision: string, rows: readonly { readonly key: string; readonly row: unknown }[]): ReadonlyMap<string, KindRow<R>> {\n        let kept = this.kept.get(kind.key);\n        if (kept === undefined || !stringEqual(kept.revision, revision) || kept.rows.size > MAX_KEPT) {\n            kept = { revision, rows: new Map() };\n            this.kept.set(kind.key, kept);\n        }\n        const missing = rows.filter(({ key }) => !kept!.rows.has(key));\n        if (missing.length > 0) {\n            const made = (kind.rowsOf as (bytes: Uint8Array) => ReadonlyMap<string, KindRow<R>>)(this.encoderOf(kind)(missing.map(({ key, row }) => ({ key, row }))));\n            for (const [key, row] of made) kept.rows.set(key, row);\n        }\n        return kept.rows;\n    }\n\n    /**\n     * A row of a kind made at the revision it was read at.\n     *\n     * @param slot - The kind's slot\n     * @param key - The row's key\n     * @returns Its bytes and the revision they were read at; `undefined` for a row not made\n     */\n    rowOf(slot: string, key: string): { readonly revision: string; readonly row: Uint8Array } | undefined {\n        const kept = this.kept.get(slot);\n        const row = kept?.rows.get(key);\n        return kept === undefined || row === undefined ? undefined : { revision: kept.revision, row: row.row };\n    }\n\n    /** A kind's encoder of the rows it reads, made once per kind. */\n    private encoderOf(kind: ItemKind): RowsEncoder {\n        let encode = this.encoders.get(kind);\n        if (encode === undefined) {\n            const row = fromEastTypeValue(kind.rowType) as StructTypeOf;\n            encode = encodeBeast2For(ArrayType(StructType({ key: StringType, row }))) as RowsEncoder;\n            this.encoders.set(kind, encode);\n        }\n        return encode;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Backlog of the item kinds read by area (#1393, `Schematic Builder\n * Spec.md` §8, D51): every item kind's rows with no position as one paged\n * list, which the library's Backlog tab draws with the shared `PagedLibrary`.\n *\n * - **The rows in hand come first**: those of the kinds read whole or complete,\n *   and the drafted rows with no position — a row a gesture unplaced, or one it\n *   created (`backlog.ts`).\n * - **Then each kind read by area's**, a page at a time through its source's\n *   area index's unplaced clause (`schematicUnplacedPlan`, §11.4): the\n *   narrowing's choices that index leads taken in the read, the rest asked of\n *   each page's rows in one `within` (D28). A row they leave out draws as\n *   context — faded, and never dragged — as does a stored row a draft has\n *   placed or deleted, drawn as drafted; a row a draft only edits draws as\n *   drafted, in place.\n * - **Its count** ({@link SchematicBacklogPages.count}): the rows it lists, and\n *   — while a narrowing an area index leads narrows them — `N of M`, every row\n *   with no position the kinds hold.\n * - **What a card drops** ({@link SchematicBacklogPages.card}): each row it has\n *   listed and not as context, placed where it lands — its row, as its page\n *   read it at its revision, the original a gesture rewrites (the frame's\n *   `KindRows`, which the lists share), so a drop records at once.\n *\n * Nothing it reads is the record whole: the counts are two index counts a kind,\n * and each page one read of the index's entries, which carry their rows (D29).\n *\n * @packageDocumentation\n */\n\nimport { SortedMap, StringType, compareFor, equalFor, none, printFor, some, variant, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { RecordSliceWhereType, type RecordSliceBindType, type RecordSliceEntry, type RecordSliceReadType } from \"@elaraai/east-ui/internal\";\nimport { schematicUnplacedPlan, type SchematicAreaIndexes, type SchematicUnplacedPlan } from \"@elaraai/e3-ui/internal\";\nimport { recordSlicePage, recordSliceRevision, recordSliceWithin, type LibraryPageSource } from \"@elaraai/east-ui-components/internal\";\nimport type { BacklogEntry } from \"./backlog.js\";\nimport { entityId, type ItemRoles } from \"./canvas/drawn.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport type { SortDrafts } from \"./drafted.js\";\nimport type { SchematicDropCard } from \"./drop.js\";\nimport { kindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { entryRow, type KindRows } from \"./kind-rows.js\";\n\n/** A kind's source of the slice. */\ntype Part = ValueTypeOf<RecordSliceBindType>;\n/** A read of a record Slice: its narrowing, and a read by area's clause beside it (#1432). */\ntype Read = ValueTypeOf<RecordSliceReadType>;\n/** An item kind, decoded. */\ntype ItemKind = SchematicValue[\"items\"][number];\n\nconst compareString = compareFor(StringType);\nconst stringEqual = equalFor(StringType);\nconst printWhere = printFor(RecordSliceWhereType);\n\n/** The rows with no position, whatever the narrowing: what `M` counts. */\nconst UNPLACED: Read = { where: new SortedMap([], compareString), area: some(variant(\"unplaced\", null)) };\n\n/** The most cards the list keeps for what a drop finds them by, past which the oldest go: the pages around the view hold far fewer. */\nconst MAX_SERVED = 4_096;\n\n/** An item kind read by area that has a backlog: the kind, its source of the slice and its area indexes. */\nexport interface BacklogAreaKind {\n    /** The kind: its `x` and `y` are Options. */\n    readonly kind: ItemKind;\n    /** Its source of the slice. */\n    readonly part: Part;\n    /** Its area indexes. */\n    readonly areas: SchematicAreaIndexes;\n}\n\n/** One row the paged Backlog lists: its entry, and whether it draws as context. */\nexport interface BacklogPageRow {\n    /** Its kind's slot and key, its id and its roles — a drafted row's as drafted. */\n    readonly entry: BacklogEntry;\n    /** Whether it draws as context, faded and never dragged: the narrowing leaves it out, or a draft placed or deleted it. */\n    readonly context: boolean;\n}\n\n/** What the paged Backlog counts: the rows it lists, every row with no position, and whether a narrowing narrows the list. */\nexport interface BacklogPageCount {\n    /** The rows it lists. */\n    readonly shown: number;\n    /** Every row with no position the kinds hold, the rows in hand among them. */\n    readonly total: number;\n    /** Whether a narrowing an area index leads narrows what it lists. */\n    readonly narrowing: boolean;\n}\n\n/**\n * The paged Backlog's rows and counts — see the module docs. Every read is a\n * tracked read of the kinds' sources, so the list's reader runs again as a\n * page, a count or an answer lands, and as a narrowing or a revision moves.\n */\nexport class SchematicBacklogPages implements LibraryPageSource<BacklogPageRow> {\n    /** Each kind's plan, for the narrowing it was made for. */\n    private readonly plans = new WeakMap<object, SchematicUnplacedPlan>();\n    /** What each row listed and not as context drops, by its id: kept for the narrowing it was listed under. */\n    private served = new Map<string, SchematicDropCard>();\n    private servedFor = \"\";\n\n    /**\n     * @param id - The list's id: the Backlog's library, which its cards drag from\n     * @param fresh - The rows in hand: the kinds read whole or complete, and the drafted rows with no position, each kind's in its order\n     * @param kinds - The item kinds read by area that have a backlog, in the Schematic's order\n     * @param drafts - The item kinds' drafts\n     * @param rows - The kinds' rows as their `rowsOf` makes them, kept across lists: what a gesture on a row a page read rewrites\n     */\n    constructor(readonly id: string, private readonly fresh: readonly BacklogEntry[], private readonly kinds: readonly BacklogAreaKind[],\n        private readonly drafts: SortDrafts<ItemRoles>, private readonly rows: KindRows<ItemRoles>) {}\n\n    /** A kind's plan for its narrowing as it stands, made once a narrowing. */\n    private planOf({ part, areas }: BacklogAreaKind): SchematicUnplacedPlan {\n        const where = part.read().where;\n        let plan = this.plans.get(where);\n        if (plan === undefined) {\n            plan = schematicUnplacedPlan(areas, where);\n            this.plans.set(where, plan);\n        }\n        return plan;\n    }\n\n    /**\n     * The kinds' revisions, as one: `none` while any is not yet known.\n     *\n     * @returns The revisions\n     */\n    revision(): option<string> {\n        const revisions: string[] = [];\n        for (const { part } of this.kinds) {\n            const revision = recordSliceRevision(part);\n            if (revision.type !== \"some\") return none;\n            revisions.push(revision.value);\n        }\n        return some(revisions.join(\"\\u0000\"));\n    }\n\n    /**\n     * The narrowings the kinds' rows are read under, as one: the list starts its viewport again as it moves.\n     *\n     * @returns The narrowings, printed\n     */\n    query(): string {\n        return this.kinds.map(({ part }) => printWhere(part.read().where)).join(\"\\u0001\");\n    }\n\n    /** Each kind's count of the rows it lists; `undefined` while any is read. */\n    private listed(): bigint[] | undefined {\n        const counts: bigint[] = [];\n        for (const kind of this.kinds) {\n            const count = kind.part.countWhere(this.planOf(kind).read);\n            if (count.type !== \"some\") return undefined;\n            counts.push(count.value);\n        }\n        return counts;\n    }\n\n    /**\n     * How many rows it lists: the rows in hand, and each kind's its narrowing's led choices hold.\n     *\n     * @returns The count; `none` while any is read\n     */\n    total(): option<bigint> {\n        const counts = this.listed();\n        if (counts === undefined) return none;\n        return some(counts.reduce((sum, count) => sum + count, BigInt(this.fresh.length)));\n    }\n\n    /**\n     * What the Backlog tab counts (see {@link BacklogPageCount}).\n     *\n     * @returns The count; `undefined` while any count is read\n     */\n    count(): BacklogPageCount | undefined {\n        const counts = this.listed();\n        if (counts === undefined) return undefined;\n        let shown = this.fresh.length, total = this.fresh.length, narrowing = false;\n        for (const [i, kind] of this.kinds.entries()) {\n            shown += Number(counts[i]!);\n            const plan = this.planOf(kind);\n            // Only the choices the index leads narrow the list — any its read holds: the rest draw what they leave out as context.\n            if (plan.read.where.size > 0) {\n                narrowing = true;\n                const all = kind.part.countWhere(UNPLACED);\n                if (all.type !== \"some\") return undefined;\n                total += Number(all.value);\n            } else {\n                total += Number(counts[i]!);\n            }\n        }\n        return { shown, total, narrowing };\n    }\n\n    /**\n     * The rows `[offset, offset + limit)` of the list: the rows in hand, then each kind's, a page read through its\n     * area index's unplaced clause, its narrowing's other choices asked of the page's rows.\n     *\n     * @param offset - The first row\n     * @param limit - How many rows\n     * @returns The rows; `none` while a count, a page or an answer is read\n     */\n    page(offset: bigint, limit: bigint): option<BacklogPageRow[]> {\n        const counts = this.listed();\n        if (counts === undefined) return none;\n        const listing = this.query();\n        if (!stringEqual(listing, this.servedFor)) {\n            this.served = new Map();\n            this.servedFor = listing;\n        }\n        const rows: BacklogPageRow[] = [];\n        let at = offset;\n        let left = limit;\n        const fresh = BigInt(this.fresh.length);\n        if (at < fresh) {\n            const end = at + left < fresh ? at + left : fresh;\n            for (const entry of this.fresh.slice(Number(at), Number(end))) rows.push({ entry, context: false });\n            left -= end - at;\n            at = end;\n        }\n        let base = fresh;\n        for (const [i, kind] of this.kinds.entries()) {\n            if (left <= 0n) break;\n            const count = counts[i]!;\n            if (at < base + count) {\n                const from = at - base;\n                const take = from + left < count ? left : count - from;\n                const got = this.kindPage(kind, from, take);\n                if (got.type !== \"some\") return none;\n                rows.push(...got.value);\n                at += take;\n                left -= take;\n            }\n            base += count;\n        }\n        for (const row of rows) {\n            if (row.context) continue;\n            this.served.set(row.entry.id, { does: \"place\", ref: row.entry.ref, label: row.entry.roles.label });\n            if (this.served.size > MAX_SERVED) this.served.delete(this.served.keys().next().value!);\n        }\n        return some(rows);\n    }\n\n    /** One kind's rows `[offset, offset + limit)`: a page of its unplaced clause, its drafts in place and its narrowing's other choices asked. */\n    private kindPage(kind: BacklogAreaKind, offset: bigint, limit: bigint): option<BacklogPageRow[]> {\n        const plan = this.planOf(kind);\n        const got = recordSlicePage(kind.part, plan.read, offset, limit);\n        if (got.type !== \"some\") return none;\n        const entries = got.value as RecordSliceEntry[];\n        // Each row by its key's text (#1549).\n        const keys = kindKeys(kind.kind.keyType);\n        const read = entries.map((entry) => ({ key: keys.textOf(entry.key), row: entryRow(entry) }));\n        // The narrowing's choices the index doesn't lead, asked of the page's rows in one request (D28), each by its key.\n        let held: readonly boolean[] | undefined;\n        if (plan.residual.length > 0) {\n            const answer = recordSliceWithin(kind.part, kind.part.read().where, entries.map((entry) => ({ key: entry.key, row: entryRow(entry) })));\n            if (answer.type !== \"some\") return none;\n            held = answer.value;\n        }\n        const revision = recordSliceRevision(kind.part);\n        if (revision.type !== \"some\") return none;\n        const stored = this.rows.rowsOf(kind.kind, revision.value, read);\n        const drafted = this.drafts.get(kind.kind.key);\n        return some(read.map(({ key }, i) => {\n            const ref = { kind: kind.kind.key, key };\n            const id = entityId(ref);\n            const outside = held !== undefined && held[i] !== true;\n            const roles = stored.get(key)!.roles;\n            if (drafted === undefined || !drafted.has(key)) return { entry: { ref, id, roles }, context: outside };\n            // A draft decides: deleted, or placed, it draws as context; edited, as drafted, in place.\n            const draft = drafted.get(key);\n            if (draft === undefined) return { entry: { ref, id, roles }, context: true };\n            return { entry: { ref, id, roles: draft.roles }, context: outside || draft.roles.position.type === \"some\" };\n        }));\n    }\n\n    /**\n     * What a card of the list drops, by its id: a row it has listed, and not as context — placed where it lands.\n     *\n     * @param id - The card's id\n     * @returns What it drops, or `undefined` for a row it lists in hand, as context, or not at all\n     */\n    card(id: string): SchematicDropCard | undefined {\n        return this.served.get(id);\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the Schematic's history names its records by (#1388) — pure and\n * React-free: a kind's own record by its slot, and its details record by\n * {@link detailsKey}; what the editing (`editing.ts`), the banners and the\n * inspector's Issues (`issues.ts`, #1391) read a record's kind from.\n *\n * @packageDocumentation\n */\n\n/**\n * What a change names a kind's details record by: never a kind's slot, which\n * holds no NUL.\n *\n * @param slot - The kind's slot\n * @returns The details record's key in the history\n */\nexport function detailsKey(slot: string): string {\n    return `${slot}\\u0000details`;\n}\n\n/**\n * The slot of the kind a record of the history is: the kind's own, or the kind\n * whose details it is ({@link detailsKey}).\n *\n * @param key - The record's key in the history\n * @returns The kind's slot\n */\nexport function recordSlot(key: string): string {\n    const at = key.indexOf(\"\\u0000\");\n    return at < 0 ? key : key.slice(0, at);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The rows the Schematic draws whose numbers their fields' bounds don't hold\n * (#1585): an entity whose row, or its details row, breaks a bound of its\n * record's form wears the warn ring, stored or changed, as one holding a\n * conflict does, and a stored row's breach is a warning in Issues that holds\n * no Save — a changed row's is its session's readiness's, which does\n * (`issues.ts`). A form holding no number to a least or a most is read for\n * nothing. Each row the drawing draws is checked as its draft has it, else as\n * the Schematic's reads hold it — its kind's `rows`, its record read whole or\n * its narrowing read complete through its source; a kind read by area's\n * window; a kind's details read whole — and never read by its key: a details\n * record read by key, or a kind read by area's, is checked where a draft holds\n * its row.\n *\n * The read runs in a component of its own, {@link SchematicBoundsReader}: what\n * it reads is read again only as the reads move, never as a gesture does, and\n * the frame is handed the breaches only as they move (#1343).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { StringType, equalFor, fromEastTypeValue, type EastType } from \"@elaraai/east\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport { fieldBreachIssue, fieldBreaches, useTrackedEvaluation, type FieldBreach } from \"@elaraai/east-ui-components\";\nimport { isBounded, rowBreaches } from \"../shared/bounds.js\";\nimport type { ScheduleEditing } from \"../shared/schedule/editing.js\";\nimport { draftedRow } from \"../shared/schedule/records.js\";\nimport { fieldLabelOf } from \"../shared/schedule/refusals.js\";\nimport type { SchematicDrawn } from \"./canvas/drawn.js\";\nimport type { SchematicValue, SchematicWindowRows } from \"./data.js\";\nimport type { SchematicBreach, SchematicBreaches } from \"./issues.js\";\nimport { detailsKey } from \"./record-keys.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** A kind of any sort, as the payload carries it. */\ntype AnyKind = SchematicValue[\"items\"][number] | SchematicValue[\"zones\"][number] | SchematicValue[\"links\"][number] | SchematicValue[\"nets\"][number];\n\n/** Rows as a read holds them, by key: each its bytes. */\ntype HeldRows = ReadonlyMap<string, { readonly row: Uint8Array }>;\n\n/** No row breaking its field's bounds. */\nexport const NO_BREACHES: SchematicBreaches = new Map();\n\n/** No stored row read. */\nconst NO_STORED: ReadonlyMap<string, HeldRows> = new Map();\n\n/** No bound broken. */\nconst NONE: readonly FieldBreach[] = [];\n\n/** A record whose form holds a number to bounds, and where its stored rows are read. */\ninterface BoundedRecord {\n    /** Its key in the history: its kind's slot, or its details record's (`detailsKey`). */\n    readonly record: string;\n    /** Its form: what a breach names its field by. */\n    readonly fields: readonly FieldSpecValue[];\n    /** Its form's fields held to bounds. */\n    readonly bounded: readonly FieldSpecValue[];\n    /** One stored row's breaches, by its bytes. */\n    readonly breachesOf: (bytes: Uint8Array) => readonly FieldBreach[];\n    /**\n     * Where its stored rows are read: its kind's `rows`, its kind's window (read by area), or its details read whole;\n     * `undefined` for a record read by key, whose stored rows no read here asks for.\n     */\n    readonly reads: \"rows\" | \"window\" | \"details\" | undefined;\n}\n\n/** A kind with a record whose form holds a number to bounds, and its records so held: its own, then its details'. */\ninterface BoundedKind {\n    readonly kind: AnyKind;\n    readonly records: readonly BoundedRecord[];\n}\n\n/** Whether two of what the reader found say the same, in the same order. */\nfunction sameBreaches(a: SchematicBreaches, b: SchematicBreaches): boolean {\n    if (a.size !== b.size) return false;\n    const theirs = [...b];\n    return [...a].every(([id, found], i) => {\n        const [other, said] = theirs[i]!;\n        return stringEqual(id, other) && found.length === said.length && found.every((breach, j) => {\n            const them = said[j]!;\n            return stringEqual(breach.record, them.record) && stringEqual(breach.key, them.key) && stringEqual(breach.field, them.field)\n                && stringEqual(breach.fieldKey, them.fieldKey) && stringEqual(breach.message, them.message) && breach.changed === them.changed;\n        });\n    });\n}\n\n/** Props of {@link SchematicBoundsReader}. */\nexport interface SchematicBoundsReaderProps {\n    /** The payload: each kind, its form and its details' form. */\n    value: SchematicValue;\n    /** The kinds read by area, by slot: their stored rows are their windows'. */\n    areas: ReadonlySet<string>;\n    /** The rows each kind read by area holds in its window. */\n    windows: SchematicWindowRows;\n    /** What the canvas draws: the stored rows, the drafts in place — the rows checked. */\n    drawing: SchematicDrawn;\n    /** The editing over the records: each record's session, whose drafts are checked as they stand, and which rows they changed. */\n    schedule: Pick<ScheduleEditing, \"sessions\" | \"draftsOf\">;\n    /** The history's version: it moves with every change of the sessions. */\n    version: number;\n    /** Where the breaches go: called only when they move. */\n    onBreaches: (breaches: SchematicBreaches) => void;\n}\n\n/**\n * The rows the drawing draws whose numbers their fields' bounds don't hold,\n * read in a component of its own (see the module docs). A read in flight, or\n * one that failed, holds none of its rows: the frame says why it failed.\n *\n * @param props - The payload, the kinds read by area and their windows, the drawing, the editing, and where the breaches go\n * @returns Nothing: it reads\n */\nexport function SchematicBoundsReader({ value, areas, windows, drawing, schedule, version, onBreaches }: SchematicBoundsReaderProps): null {\n    const checked = useMemo(() => [...value.items, ...value.zones, ...value.links, ...value.nets].flatMap((kind): BoundedKind[] => {\n        const records: BoundedRecord[] = [];\n        const byArea = areas.has(kind.key);\n        const own = kind.fields.filter(isBounded);\n        if (own.length > 0) {\n            records.push({\n                record: kind.key, fields: kind.fields, bounded: own, breachesOf: rowBreaches(own, fromEastTypeValue(kind.rowType) as EastType),\n                reads: byArea ? \"window\" : \"rows\",\n            });\n        }\n        const details = kind.details.type === \"some\" ? kind.details.value : undefined;\n        const theirs = details?.fields.filter(isBounded) ?? [];\n        if (details !== undefined && theirs.length > 0) {\n            records.push({\n                record: detailsKey(kind.key), fields: details.fields, bounded: theirs, breachesOf: rowBreaches(theirs, fromEastTypeValue(details.rowType) as EastType),\n                reads: details.rows.type === \"some\" && !byArea ? \"details\" : undefined,\n            });\n        }\n        return records.length === 0 ? [] : [{ kind, records }];\n    }), [value.items, value.zones, value.links, value.nets, areas]);\n    // The stored rows each record's read holds, by its key in the history: the reads the drawing's are, so no request of\n    // their own, read again only as they move.\n    const read = useCallback((): ReadonlyMap<string, HeldRows> => {\n        const out = new Map<string, HeldRows>();\n        for (const { kind, records } of checked) {\n            for (const { record, reads } of records) {\n                try {\n                    if (reads === \"rows\") {\n                        const got = kind.rows();\n                        if (got.type === \"some\") out.set(record, got.value);\n                    } else if (reads === \"details\" && kind.details.type === \"some\" && kind.details.value.rows.type === \"some\") {\n                        const got = kind.details.value.rows.value();\n                        if (got.type === \"some\") out.set(record, got.value);\n                    }\n                } catch {\n                    // Its kind's read failed, which the frame says: none of its rows is checked here meanwhile.\n                    continue;\n                }\n            }\n        }\n        return out;\n    }, [checked]);\n    const { result } = useTrackedEvaluation(read);\n    const stored = result.ok ? result.value : NO_STORED;\n    const { sessions, draftsOf } = schedule;\n    const now = useMemo((): SchematicBreaches => {\n        if (checked.length === 0) return NO_BREACHES;\n        const out = new Map<string, SchematicBreach[]>();\n        const byKind = new Map(checked.map(({ kind, records }) => [kind.key, records] as const));\n        const sessionOf = new Map(sessions.map((part) => [part.kind, part.session] as const));\n        for (const entity of [...drawing.items, ...drawing.zones, ...drawing.links, ...drawing.nets]) {\n            const records = byKind.get(entity.ref.kind);\n            if (records === undefined) continue;\n            const key = entity.ref.key;\n            for (const { record, fields, bounded, breachesOf, reads } of records) {\n                // As its draft has it, else as its read holds it.\n                const entry = sessionOf.get(record)?.entries.get(key);\n                let found = NONE;\n                if (entry !== undefined) {\n                    const drafted = draftedRow(entry);\n                    if (drafted !== undefined) found = fieldBreaches(bounded, drafted.row);\n                } else {\n                    const bytes = (reads === \"window\" ? windows.get(entity.ref.kind)?.rows : stored.get(record))?.get(key)?.row;\n                    if (bytes !== undefined) found = breachesOf(bytes);\n                }\n                if (found.length === 0) continue;\n                const changed = draftsOf(record).has(key);\n                let said = out.get(entity.key);\n                if (said === undefined) {\n                    said = [];\n                    out.set(entity.key, said);\n                }\n                // In the words its session's readiness says a changed row's in.\n                for (const breach of found) {\n                    said.push({\n                        record, key, field: fieldLabelOf(fields, breach.key), fieldKey: breach.key, message: fieldBreachIssue(breach, { entry: key }).message, changed,\n                    });\n                }\n            }\n        }\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version says they moved\n    }, [checked, stored, windows, drawing, sessions, draftsOf, version]);\n    const reported = useRef(NO_BREACHES);\n    useLayoutEffect(() => {\n        if (sameBreaches(reported.current, now)) return;\n        reported.current = now;\n        onBreaches(now);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The links' look on a Canvas2D surface (#1403): what the SVG layer\n * (`layer.tsx`) draws, drawn by a painter, for a host whose links are painted —\n * the Schematic's links and nets — so the three builders' links draw alike. The\n * host routes its links in its own px and hands them here with the shared\n * part's colours and caption font, as its theme probe reads them\n * (`linkRibbons`):\n *\n * - every run of a link stroked at its weight in the muted ink — or its own\n *   tone's — over a paper casing one px either side, and every link's casing\n *   under every link's ink;\n * - its corners turned round, circular, at its corner's radius, clamped to half\n *   of each run beside them ({@link traceRoute}, beside `geometry.ts`'\n *   `rounded`);\n * - a head 8 long and max(8, 2 × weight) wide where it arrives ({@link arrive}),\n *   cased as its line is;\n * - the selected links, then the lit one, drawn last, in the strong ink, the\n *   ends they join ringed 1px four outside them;\n * - each caption on its paper knockout 12 tall, 4 either side of its text, over\n *   every link, outlined while its link is selected.\n *\n * Its measures are the layer's own (`look.ts`); its colours and its font are\n * the part's, never its own. A caption's letters each keep a cell of their\n * own: the page turns the font's joins off for the SVG layer's, which a\n * canvas's text need not take, so it turns them off itself — `textRendering`,\n * and a non-joiner in each pair the font would join ({@link unjoined}) for\n * Safari, whose canvas has no `textRendering`. Pure over the context: no React,\n * no DOM.\n *\n * @packageDocumentation\n */\n\nimport {\n    LINK_CASING, LINK_HALO_OUT, LINK_HALO_R, LINK_HEAD_LEN, LINK_KNOCKOUT_H, LINK_KNOCKOUT_PAD, LINK_KNOCKOUT_RISE, linkHeadHalf,\n} from \"./look.js\";\n\n/** A point on the surface, in its px. */\nexport interface CanvasPoint {\n    readonly x: number;\n    readonly y: number;\n}\n\n/**\n * What links draw in: the colours and the caption's font the page computes for\n * the shared part's elements (`linkRibbons`), each a CSS colour the context\n * takes.\n */\nexport interface CanvasLinkLook {\n    /** The paper under a link's ink and its head: its casing. */\n    readonly casing: string;\n    /** The muted ink every link draws in. */\n    readonly ink: string;\n    /** The strong ink a lit or a selected link draws in. */\n    readonly strong: string;\n    /** The ring round the ends a lit or a selected link joins. */\n    readonly ring: string;\n    /** The ring's width (px). */\n    readonly ringWidth: number;\n    /** The paper a caption sits on. */\n    readonly knockout: string;\n    /** A selected link's caption's outline. */\n    readonly outline: string;\n    /** A caption's ink. */\n    readonly caption: string;\n    /** A caption's font, as `ctx.font` takes it. */\n    readonly captionFont: string;\n}\n\n/** One run of a link's line: its points, its weight, and what it draws in over its link's. */\nexport interface CanvasStroke {\n    /** Its points, in order. */\n    readonly points: readonly CanvasPoint[];\n    /** Its weight: its stroke's width (px). */\n    readonly width: number;\n    /** The radius its corners turn at, before their clamp; 0 turns none. */\n    readonly corner: number;\n    /** Its alpha over its link's: a net's leg to an item drawn as context fades with it. */\n    readonly alpha?: number | undefined;\n    /** Its ink over its link's: a leg drained of its colour with the item it joins. */\n    readonly ink?: string | undefined;\n    /** Whether it draws in the strong ink, its link lit or not: a net's selected leg. */\n    readonly strong?: boolean | undefined;\n}\n\n/** A head: its tip where its link arrives, its base on its line, how far it reaches either side, and what it draws in over its link's. */\nexport interface CanvasHead {\n    /** Its tip, where its link arrives. */\n    readonly tip: CanvasPoint;\n    /** Its base's middle, on its link's line. */\n    readonly base: CanvasPoint;\n    /** How far it reaches either side of its line (px). */\n    readonly half: number;\n    /** Its alpha over its link's. */\n    readonly alpha?: number | undefined;\n    /** Its ink over its link's. */\n    readonly ink?: string | undefined;\n    /** Whether it draws in the strong ink, its link lit or not. */\n    readonly strong?: boolean | undefined;\n}\n\n/** An end a link joins, which its ring goes round while it is lit or selected: a box, or a circle. */\nexport type CanvasEnd =\n    | { readonly kind: \"box\"; readonly left: number; readonly top: number; readonly right: number; readonly bottom: number }\n    | { readonly kind: \"circle\"; readonly x: number; readonly y: number; readonly r: number };\n\n/** A link's caption: its text, centred across `x`, its baseline at `y`. */\nexport interface CanvasCaption {\n    readonly text: string;\n    readonly x: number;\n    readonly y: number;\n}\n\n/** One link as the painter draws it: its runs, its heads and its joins, how it draws, the ends it joins and its caption. */\nexport interface CanvasLink {\n    /** Its identity among the links. */\n    readonly id: string;\n    /** Its runs: a link's one, a net's trunk, bars and legs. */\n    readonly strokes: readonly CanvasStroke[];\n    /** Its heads, each where it arrives. */\n    readonly heads: readonly CanvasHead[];\n    /** Where its runs join — a net's junctions — each a dot of its radius, in its ink. */\n    readonly dots: readonly { readonly x: number; readonly y: number; readonly r: number }[];\n    /** Its dash; empty for a solid line. */\n    readonly dash: readonly number[];\n    /** Its ink — its tone's — or, `undefined`, the look's muted ink. */\n    readonly ink: string | undefined;\n    /** Its alpha: faded, as context. */\n    readonly alpha: number;\n    /** Whether it is the one under the pointer. */\n    readonly lit: boolean;\n    /** Whether it is selected. */\n    readonly selected: boolean;\n    /** The ends it joins, ringed while it is lit or selected. */\n    readonly ends: readonly CanvasEnd[];\n    /** Its caption; `undefined` for none. */\n    readonly caption: CanvasCaption | undefined;\n}\n\n/**\n * Traces a route into the context's path: straight runs between its points,\n * each corner turned on a circle of `corner`'s radius, clamped so the turn\n * takes at most half of each run beside it — the canvas's trace of what\n * `geometry.ts`' `rounded` writes as path data, at any angle. A point that turns\n * nothing, or turns back on itself, is passed straight through. The caller\n * begins the path and strokes it.\n *\n * @param ctx - The context\n * @param points - The route's points, in order\n * @param corner - The corners' radius, before their clamp; 0 turns none\n */\nexport function traceRoute(ctx: CanvasRenderingContext2D, points: readonly CanvasPoint[], corner: number): void {\n    const first = points[0];\n    if (first === undefined) return;\n    ctx.moveTo(first.x, first.y);\n    for (let i = 1; i < points.length - 1; i++) {\n        const a = points[i - 1]!, p = points[i]!, b = points[i + 1]!;\n        const inLen = Math.hypot(p.x - a.x, p.y - a.y), outLen = Math.hypot(b.x - p.x, b.y - p.y);\n        if (corner <= 0 || inLen < 1e-6 || outLen < 1e-6) { ctx.lineTo(p.x, p.y); continue; }\n        // The turn's deflection, 0 straight on and π back on itself: a circle of radius r meets each run r·tan(δ/2) from the corner.\n        const cos = ((p.x - a.x) * (b.x - p.x) + (p.y - a.y) * (b.y - p.y)) / (inLen * outLen);\n        const tangent = Math.tan(Math.acos(Math.max(-1, Math.min(1, cos))) / 2);\n        const r = tangent > 1e-6 && Number.isFinite(tangent) ? Math.min(corner, Math.min(inLen, outLen) / 2 / tangent) : 0;\n        if (r < 0.5 || tangent > 1e6) { ctx.lineTo(p.x, p.y); continue; }\n        ctx.arcTo(p.x, p.y, b.x, b.y, r);\n    }\n    const last = points[points.length - 1]!;\n    if (points.length > 1) ctx.lineTo(last.x, last.y);\n}\n\n/**\n * Traces a head into the context's path: a triangle, its base across its line\n * at `base`, `half` either side, its tip at `tip`. The caller begins the path\n * and fills it.\n *\n * @param ctx - The context\n * @param head - The head\n */\nexport function traceHead(ctx: CanvasRenderingContext2D, head: CanvasHead): void {\n    const dx = head.tip.x - head.base.x, dy = head.tip.y - head.base.y;\n    const len = Math.hypot(dx, dy);\n    if (len < 1e-9) return;\n    const nx = (-dy / len) * head.half, ny = (dx / len) * head.half;\n    ctx.moveTo(head.base.x + nx, head.base.y + ny);\n    ctx.lineTo(head.tip.x, head.tip.y);\n    ctx.lineTo(head.base.x - nx, head.base.y - ny);\n    ctx.closePath();\n}\n\n/**\n * Where a route arrives: its line, to the head's base, and its head, 8 back\n * along it from its last point — its tip there — max(8, 2 × weight) wide. A\n * route shorter than a head is all head.\n *\n * @param points - The route's points, its last where it arrives\n * @param weight - Its weight: its stroke's width (px)\n * @returns Its line, and its head; `undefined` for a route of no length\n */\nexport function arrive(points: readonly CanvasPoint[], weight: number): { readonly line: CanvasPoint[]; readonly head: CanvasHead } | undefined {\n    const tip = points[points.length - 1];\n    if (tip === undefined) return undefined;\n    // Walk back from the tip a head's length: the base is where the walk ends, the line every point before it.\n    let left = LINK_HEAD_LEN;\n    for (let i = points.length - 1; i > 0; i--) {\n        const p = points[i]!, a = points[i - 1]!;\n        const seg = Math.hypot(p.x - a.x, p.y - a.y);\n        if (seg >= left) {\n            const t = seg > 0 ? left / seg : 0;\n            const base = { x: p.x + (a.x - p.x) * t, y: p.y + (a.y - p.y) * t };\n            return { line: [...points.slice(0, i), base], head: { tip, base, half: linkHeadHalf(weight) } };\n        }\n        left -= seg;\n    }\n    const base = points[0]!;\n    if (Math.hypot(tip.x - base.x, tip.y - base.y) < 1e-9) return undefined;\n    return { line: [], head: { tip, base, half: linkHeadHalf(weight) } };\n}\n\n/** A link's casing: the paper one px either side of each of its runs, round its heads and its joins. */\nfunction paintCasing(ctx: CanvasRenderingContext2D, link: CanvasLink, look: CanvasLinkLook): void {\n    ctx.save();\n    ctx.setLineDash([]);\n    ctx.lineJoin = \"round\";\n    ctx.strokeStyle = look.casing;\n    ctx.fillStyle = look.casing;\n    for (const stroke of link.strokes) {\n        ctx.globalAlpha = link.alpha * (stroke.alpha ?? 1);\n        ctx.lineWidth = stroke.width + 2 * LINK_CASING;\n        ctx.beginPath();\n        traceRoute(ctx, stroke.points, stroke.corner);\n        ctx.stroke();\n    }\n    // A head's casing is the head grown by the casing every way: filled, and stroked round its corners.\n    ctx.lineWidth = 2 * LINK_CASING;\n    for (const head of link.heads) {\n        ctx.globalAlpha = link.alpha * (head.alpha ?? 1);\n        ctx.beginPath();\n        traceHead(ctx, head);\n        ctx.fill();\n        ctx.stroke();\n    }\n    ctx.globalAlpha = link.alpha;\n    for (const dot of link.dots) {\n        ctx.beginPath();\n        ctx.arc(dot.x, dot.y, dot.r + LINK_CASING, 0, Math.PI * 2);\n        ctx.fill();\n    }\n    ctx.restore();\n}\n\n/** A link's ink: each run at its weight, its heads and its joins — the strong ink while it is lit or selected. */\nfunction paintInk(ctx: CanvasRenderingContext2D, link: CanvasLink, look: CanvasLinkLook): void {\n    const raised = link.lit || link.selected;\n    const inkOf = (part: { readonly ink?: string | undefined; readonly strong?: boolean | undefined }): string =>\n        (raised || part.strong === true ? look.strong : part.ink ?? link.ink ?? look.ink);\n    ctx.save();\n    ctx.lineJoin = \"round\";\n    ctx.lineCap = \"butt\";\n    ctx.setLineDash(link.dash);\n    for (const stroke of link.strokes) {\n        ctx.globalAlpha = link.alpha * (stroke.alpha ?? 1);\n        ctx.strokeStyle = inkOf(stroke);\n        ctx.lineWidth = stroke.width;\n        ctx.beginPath();\n        traceRoute(ctx, stroke.points, stroke.corner);\n        ctx.stroke();\n    }\n    ctx.setLineDash([]);\n    for (const head of link.heads) {\n        ctx.globalAlpha = link.alpha * (head.alpha ?? 1);\n        ctx.fillStyle = inkOf(head);\n        ctx.beginPath();\n        traceHead(ctx, head);\n        ctx.fill();\n    }\n    ctx.globalAlpha = link.alpha;\n    ctx.fillStyle = inkOf({});\n    for (const dot of link.dots) {\n        ctx.beginPath();\n        ctx.arc(dot.x, dot.y, dot.r, 0, Math.PI * 2);\n        ctx.fill();\n    }\n    ctx.restore();\n}\n\n/** The ring round each end a lit or a selected link joins: 1px, four outside it — a box's corners round, a circle's about it. */\nfunction paintRings(ctx: CanvasRenderingContext2D, link: CanvasLink, look: CanvasLinkLook): void {\n    ctx.save();\n    ctx.globalAlpha = link.alpha;\n    ctx.setLineDash([]);\n    ctx.lineWidth = look.ringWidth;\n    ctx.strokeStyle = look.ring;\n    for (const end of link.ends) {\n        ctx.beginPath();\n        if (end.kind === \"circle\") ctx.arc(end.x, end.y, end.r + LINK_HALO_OUT, 0, Math.PI * 2);\n        else {\n            const left = end.left - LINK_HALO_OUT, top = end.top - LINK_HALO_OUT;\n            const width = Math.max(2, end.right - end.left) + 2 * LINK_HALO_OUT, height = end.bottom - end.top + 2 * LINK_HALO_OUT;\n            if (typeof ctx.roundRect === \"function\") ctx.roundRect(left, top, width, height, Math.min(LINK_HALO_R, width / 2, height / 2));\n            else ctx.rect(left, top, width, height);\n        }\n        ctx.stroke();\n    }\n    ctx.restore();\n}\n\n/**\n * A text as a canvas draws it and measures it, its letters unjoined: a\n * zero-width non-joiner after each f that meets an f, an i or an l, so a pair\n * the font would join — Chivo Mono's ff, fi, fl, ffi and ffl, each in one cell —\n * stays two letters, each in a cell of its own, as the page draws it.\n * `textRendering` turns the joins off where a canvas has it; Safari's has not,\n * and the non-joiner keeps the pair apart there too. It takes no room and draws\n * nothing, so a text measured through it measures what is drawn through it.\n *\n * @param text - The text\n * @returns The text, every pair the font would join kept apart\n */\nexport function unjoined(text: string): string {\n    return text.replace(/f(?=[fil])/gu, \"f\\u200C\");\n}\n\n/** A link's caption on its paper knockout, 4 either side of its text — outlined while its link is selected. */\nfunction paintCaption(ctx: CanvasRenderingContext2D, link: CanvasLink, look: CanvasLinkLook): void {\n    const caption = link.caption;\n    if (caption === undefined) return;\n    ctx.save();\n    ctx.globalAlpha = link.alpha;\n    ctx.font = look.captionFont;\n    ctx.textRendering = \"optimizeSpeed\";\n    const text = unjoined(caption.text);\n    const half = ctx.measureText(text).width / 2 + LINK_KNOCKOUT_PAD;\n    ctx.beginPath();\n    ctx.rect(caption.x - half, caption.y - LINK_KNOCKOUT_RISE, 2 * half, LINK_KNOCKOUT_H);\n    ctx.fillStyle = look.knockout;\n    ctx.fill();\n    if (link.selected) {\n        ctx.setLineDash([]);\n        ctx.lineWidth = 1;\n        ctx.strokeStyle = look.outline;\n        ctx.stroke();\n    }\n    ctx.fillStyle = look.caption;\n    ctx.textAlign = \"center\";\n    ctx.textBaseline = \"alphabetic\";\n    ctx.fillText(text, caption.x, caption.y);\n    ctx.restore();\n}\n\n/**\n * Paints links in the shared look (see the module docs): every link's casing\n * under every link's ink, the selected links and then the lit one last, each\n * its casing, its ink and the rings round its ends, and every caption over them\n * all.\n *\n * @param ctx - The context\n * @param links - The links, in drawing order\n * @param look - What they draw in: the shared part's colours and caption font\n */\nexport function paintLinks(ctx: CanvasRenderingContext2D, links: readonly CanvasLink[], look: CanvasLinkLook): void {\n    const plain = links.filter((link) => !link.lit && !link.selected);\n    const raised = [...links.filter((link) => link.selected && !link.lit), ...links.filter((link) => link.lit)];\n    for (const link of plain) paintCasing(ctx, link, look);\n    for (const link of plain) paintInk(ctx, link, look);\n    for (const link of raised) {\n        paintCasing(ctx, link, look);\n        paintInk(ctx, link, look);\n        paintRings(ctx, link, look);\n    }\n    for (const link of links) paintCaption(ctx, link, look);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Pure camera maths for the Schematic renderer — the single source of truth for\n * the pan/zoom transform, the interaction-mode machine, viewport culling\n * geometry, and the `requestAnimationFrame` coalescer. Kept free of React,\n * Chakra, and Canvas2D so every piece is unit-testable in a `node` environment\n * and so the **same** world→screen projection is shared by the Canvas2D painter\n * ({@link ../paint}) and the DOM card layer — the two surfaces can never use a\n * different transform and drift apart (issue #57, P1).\n *\n * @packageDocumentation\n */\n\n/** The pan/zoom state: `screen = world × fit × zoom + t`. */\nexport interface Viewport {\n    zoom: number;\n    tx: number;\n    ty: number;\n}\n\n/** The identity camera — fully zoomed out, no pan: the camera before the canvas has a size to fit to. */\nexport const IDENTITY: Viewport = { zoom: 1, tx: 0, ty: 0 };\n\n/** The room Fit leaves round the drawing, in CSS px each side — a zone's eyebrow, standing above its box, within it. */\nexport const FIT_MARGIN_PX = 24;\n\n/**\n * The fit, and the camera Fit takes (#1393): the drawing's extent fitted\n * inside the canvas less a margin each side ({@link FIT_MARGIN_PX}, no more\n * than an eighth of the canvas), so nothing drawn at its edge meets the\n * canvas's — and centred on both axes, so the canvas's middle, which the\n * toolbar's zoom zooms about, is the drawing's.\n *\n * @param width - The canvas's width, in CSS px\n * @param height - Its height, in CSS px\n * @param worldW - The extent's width, in world units\n * @param worldH - Its height, in world units\n * @returns The fit — px per world unit at zoom 1 — and the camera at it; `0` and {@link IDENTITY} while there is nothing to fit\n */\nexport function fitView(width: number, height: number, worldW: number, worldH: number): { fit: number; home: Viewport } {\n    if (!(width > 0 && height > 0 && worldW > 0 && worldH > 0)) return { fit: 0, home: IDENTITY };\n    const margin = Math.min(FIT_MARGIN_PX, width / 8, height / 8);\n    const fit = Math.min((width - 2 * margin) / worldW, (height - 2 * margin) / worldH);\n    return { fit, home: { zoom: 1, tx: (width - worldW * fit) / 2, ty: (height - worldH * fit) / 2 } };\n}\n\n/**\n * The transform in CSS pixels with `ppu` (pixels-per-world-unit) already\n * folded in: `screen = world × ppu + t`. Mirrors {@link ../paint!PaintCamera}.\n */\nexport interface ScreenCamera {\n    ppu: number;\n    tx: number;\n    ty: number;\n}\n\n/** An axis-aligned bounding box (world or screen space). */\nexport interface Bbox {\n    minX: number;\n    minY: number;\n    maxX: number;\n    maxY: number;\n}\n\n/**\n * Project a world point to screen space (`x × ppu + tx`, `y × ppu + ty`). The\n * one projector shared by the painter and the card layer; the DOM cards apply\n * the identical arithmetic in CSS via {@link cardTranslateCss}.\n *\n * @param x - world x\n * @param y - world y\n * @param cam - the screen camera (ppu + translation)\n * @returns the screen-space point\n */\nexport function project(x: number, y: number, cam: ScreenCamera): { sx: number; sy: number } {\n    return { sx: x * cam.ppu + cam.tx, sy: y * cam.ppu + cam.ty };\n}\n\n/**\n * The CSS `translate(...)` a DOM card uses to sit on its world anchor, reading\n * the live camera from the `--cam-ppu` / `--cam-tx` / `--cam-ty` custom\n * properties set on the card layer. The arithmetic is identical to\n * {@link project} (`ppu × coord + t`), so card and canvas-drawn footprint\n * resolve to the same screen point. The string is **camera-independent** (it\n * only embeds the item's world `x`/`y`), so a camera change is a single set of\n * custom-property writes on the parent — no per-card React re-layout.\n *\n * @param x - world x of the item anchor\n * @param y - world y of the item anchor\n * @returns a CSS `translate()` expression referencing the `--cam-*` vars\n */\nexport function cardTranslateCss(x: number, y: number): string {\n    return `translate(calc(var(--cam-ppu) * ${x} * 1px + var(--cam-tx)), calc(var(--cam-ppu) * ${y} * 1px + var(--cam-ty)))`;\n}\n\n/**\n * The CSS length a DOM card uses for an explicit world-space `width`, reading\n * the live `--cam-ppu`. Expressing the width through the var (not a\n * render-time `width × ppu`) keeps an explicit-width card's box sized from the\n * **same** live ppu the canvas footprint is drawn from, so box and footprint\n * never diverge in size during a zoom (issue #57, Phase 2 invariant 6).\n *\n * @param width - the item's world-space width\n * @returns a CSS `calc()` length referencing `--cam-ppu`\n */\nexport function cardWidthCss(width: number): string {\n    return `calc(var(--cam-ppu) * ${width} * 1px)`;\n}\n\n/**\n * A world box's CSS geometry on the card layer's camera (#1398): its left and\n * top edges where {@link cardTranslateCss} would place a card's anchor —\n * `ppu × coord + t` — and its width and height as {@link cardWidthCss} sizes a\n * card, each reading the live `--cam-ppu` / `--cam-tx` / `--cam-ty` custom\n * properties, so the box follows the camera with no render: an unread area's\n * wash.\n *\n * @param box - The box, in world units\n * @returns Its `left`, `top`, `width` and `height`, as CSS lengths referencing the `--cam-*` vars\n */\nexport function boxCss(box: Bbox): { left: string; top: string; width: string; height: string } {\n    return {\n        left: `calc(var(--cam-ppu) * ${box.minX} * 1px + var(--cam-tx))`,\n        top: `calc(var(--cam-ppu) * ${box.minY} * 1px + var(--cam-ty))`,\n        width: `calc(var(--cam-ppu) * ${box.maxX - box.minX} * 1px)`,\n        height: `calc(var(--cam-ppu) * ${box.maxY - box.minY} * 1px)`,\n    };\n}\n\n/**\n * The world-space rectangle currently visible — the inverse projection of the\n * canvas corners. Used to cull off-screen zones / links (issue #57, P6).\n *\n * @param cam - the screen camera\n * @param width - canvas width in CSS px\n * @param height - canvas height in CSS px\n * @returns the visible world bbox\n */\nexport function viewportWorldBbox(cam: ScreenCamera, width: number, height: number): Bbox {\n    return {\n        minX: -cam.tx / cam.ppu,\n        minY: -cam.ty / cam.ppu,\n        maxX: (width - cam.tx) / cam.ppu,\n        maxY: (height - cam.ty) / cam.ppu,\n    };\n}\n\n/**\n * Whether two axis-aligned bounding boxes overlap (inclusive edges). Off-screen\n * shapes whose bbox misses the viewport bbox are culled.\n *\n * @param a - first bbox\n * @param b - second bbox\n * @returns `true` when the boxes touch or overlap\n */\nexport function bboxOverlaps(a: Bbox, b: Bbox): boolean {\n    return a.maxX >= b.minX && a.minX <= b.maxX && a.maxY >= b.minY && a.minY <= b.maxY;\n}\n\n/**\n * The world-space AABB over a set of points. For a link this is taken over\n * **all** anchors (endpoints + waypoints), so a trunk whose two ends sit\n * off-screen but whose segment crosses the viewport is not wrongly culled\n * (issue #57, 1e).\n *\n * @param pts - the points to bound (world coords)\n * @returns the AABB, or `null` when the list is empty\n */\nexport function pointsBbox(pts: readonly { x: number; y: number }[]): Bbox | null {\n    if (pts.length === 0) return null;\n    let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n    for (const p of pts) {\n        if (p.x < minX) minX = p.x;\n        if (p.y < minY) minY = p.y;\n        if (p.x > maxX) maxX = p.x;\n        if (p.y > maxY) maxY = p.y;\n    }\n    return { minX, minY, maxX, maxY };\n}\n\n/**\n * Apply a multiplicative zoom about a screen-space focal point, keeping that\n * point fixed on screen (cursor-anchored wheel zoom, centre-anchored button\n * zoom). Clamps to `[min, max]`; one clamped to `min` returns `home` — the\n * camera Fit takes ({@link fitView}) — so a full zoom-out also recentres.\n *\n * @param prev - the current camera\n * @param factor - multiply `zoom` by this\n * @param px - screen-x to keep fixed\n * @param py - screen-y to keep fixed\n * @param min - minimum zoom\n * @param max - maximum zoom\n * @param home - the camera at `min`: Fit's\n * @returns the next camera\n */\nexport function zoomAbout(prev: Viewport, factor: number, px: number, py: number, min: number, max: number, home: Viewport = IDENTITY): Viewport {\n    const zoom = Math.max(min, Math.min(max, prev.zoom * factor));\n    if (zoom <= min) return home;\n    const k = zoom / prev.zoom;\n    return { zoom, tx: px - k * (px - prev.tx), ty: py - k * (py - prev.ty) };\n}\n\n/**\n * Apply one step of a pinch: zoom by its factor about the point the fingers'\n * midpoint stood at, and carry what the drawing shows there to where the\n * midpoint stands now — so each finger stays on the point of the drawing it\n * touched, and two fingers carried together, their distance kept, pan.\n *\n * The zoom is held to `[min, max]`, and what the fingers ask for past a limit\n * is remembered, not lost (`over`): drawn together past the least zoom and\n * apart again, the drawing zooms only once they stand further apart than where\n * the limit held it. Without that a limit is a ratchet — two fingers carried\n * together arrive one move at a time, the first changing their distance and the\n * second putting it back, and at the least zoom the first would be dropped and\n * the second zoom in. At a limit the step carries the drawing by the midpoint's\n * move alone. It never snaps to Fit's camera as {@link zoomAbout} does — a\n * camera that jumped under the fingers would leave them — so a pinch in that\n * comes to rest at `min` is settled there by its caller, as it ends.\n *\n * @param prev - the current camera\n * @param factor - the fingers' distance now over their distance before the move\n * @param from - where the fingers' midpoint stood, in px from the canvas's corner\n * @param to - where it stands now\n * @param min - minimum zoom\n * @param max - maximum zoom\n * @param over - how far past a limit the fingers stood before the move: the zoom they asked for over the zoom the\n *   limits allowed, 1 within them\n * @returns the next camera, and how far past a limit the fingers stand now\n */\nexport function pinchAbout(\n    prev: Viewport, factor: number, from: { readonly x: number; readonly y: number }, to: { readonly x: number; readonly y: number }, min: number, max: number,\n    over = 1,\n): { camera: Viewport; over: number } {\n    const asked = prev.zoom * over * factor;\n    const zoom = Math.max(min, Math.min(max, asked));\n    const k = zoom / prev.zoom;\n    return { camera: { zoom, tx: to.x - k * (from.x - prev.tx), ty: to.y - k * (from.y - prev.ty) }, over: asked / zoom };\n}\n\n/** Moving slower than a viewport each this many ms, the canvas tells its reader where its view stands as it moves (#1398, CL6). */\nexport const SLOW_READ_MS = 200;\n\n/**\n * Zooming by less than this factor each {@link SLOW_READ_MS}, the canvas tells its reader as it zooms (#1398, CL6). A\n * faster zoom asks for a new view at every notch, which the next notch leaves before its read lands.\n */\nexport const SLOW_ZOOM = 1.25;\n\n/** Where the canvas last told its reader its view stood: when, the view's centre in world units, and its zoom in px a unit. */\nexport interface ViewTold {\n    readonly at: number;\n    readonly x: number;\n    readonly y: number;\n    readonly ppu: number;\n}\n\n/**\n * Whether the camera, still moving, tells its reader where its view stands now, rather than once it rests (#1398, CL6).\n * It does once {@link SLOW_READ_MS} have passed since it last told it, its centre has moved less than the view's span,\n * and its zoom has moved by less than {@link SLOW_ZOOM}, in or out. So a slow pan or a slow zoom reads as it goes, and\n * a fast one reads where it rests: a zoom about a point moves the view's centre little, but each notch of a fast one is\n * a view the next leaves before it lands. A time stamped before the last tell is no time since it.\n *\n * @param told - Where it last told its reader the view stood\n * @param now - Where the view stands now: when, its centre and its zoom, and its span in world units\n * @returns Whether it tells its reader now\n */\nexport function tellsAsItMoves(told: ViewTold, now: ViewTold & { readonly span: number }): boolean {\n    if (now.at - told.at < SLOW_READ_MS) return false;\n    const zoomed = Math.max(now.ppu, told.ppu) / Math.min(now.ppu, told.ppu);\n    return Math.hypot(now.x - told.x, now.y - told.y) < now.span && zoomed < SLOW_ZOOM;\n}\n\n/** How long a fly takes, in ms. */\nexport const FLY_DURATION_MS = 350;\n\n/**\n * Where a fly stands a time into it (#1393): eased out of the camera it began\n * at towards the one it lands at. A time before its start stands where it\n * began — a frame the page stamped before the gesture that started it, or one\n * stamped on another clock — never thrown back past it, as an ease of a\n * negative time would; a time past its end stands where it lands.\n *\n * @param from - The camera it began at\n * @param to - The camera it lands at\n * @param elapsed - How long it has flown, in ms\n * @returns The camera\n */\nexport function flyStep(from: Viewport, to: Viewport, elapsed: number): Viewport {\n    const t = Math.min(1, Math.max(0, elapsed / FLY_DURATION_MS));\n    const e = 1 - Math.pow(1 - t, 3);\n    return { zoom: from.zoom + (to.zoom - from.zoom) * e, tx: from.tx + (to.tx - from.tx) * e, ty: from.ty + (to.ty - from.ty) * e };\n}\n\n/** The interaction modes the camera can be in at any instant. */\nexport type CameraMode = \"idle\" | \"panning\" | \"wheeling\" | \"flying\";\n\n/** The inputs that drive {@link nextMode} transitions. */\nexport type CameraEvent = \"pointerDown\" | \"wheel\" | \"zoom\" | \"flyStart\" | \"pointerUp\" | \"flyEnd\" | \"cancel\";\n\n/**\n * The camera interaction-mode transition. Entering an input mode\n * (`pointerDown` / `wheel` / `zoom`) supersedes a running fly — see\n * {@link cancelsFly} for the companion side-effect predicate — so a user\n * gesture always wins over an animation rather than racing it (issue #57, P4 /\n * Phase 2 invariant 5).\n *\n * @param mode - the current mode\n * @param event - the input event\n * @returns the next mode\n */\nexport function nextMode(mode: CameraMode, event: CameraEvent): CameraMode {\n    switch (event) {\n        case \"pointerDown\": return \"panning\";\n        case \"wheel\": return \"wheeling\";\n        case \"zoom\": return \"wheeling\";\n        case \"flyStart\": return \"flying\";\n        case \"pointerUp\": return mode === \"panning\" ? \"idle\" : mode;\n        case \"flyEnd\": return mode === \"flying\" ? \"idle\" : mode;\n        case \"cancel\": return \"idle\";\n    }\n}\n\n/**\n * Whether processing `event` in `mode` must cancel a running fly animation.\n * Pairs with {@link nextMode}: the reducer names the next mode, this names the\n * side-effect (cancel the in-flight `flyTo` rAF) the transition implies. Every\n * event that moves the machine OUT of `flying` (a user gesture, an explicit\n * `cancel`/`reset`) must cancel the rAF, so the mode and the live `animRef` can\n * never disagree — `flyEnd` is the sole exception (the rAF has already ended).\n *\n * @param mode - the current mode\n * @param event - the input event\n * @returns `true` when a fly animation is in progress and is being superseded\n */\nexport function cancelsFly(mode: CameraMode, event: CameraEvent): boolean {\n    return mode === \"flying\"\n        && (event === \"pointerDown\" || event === \"wheel\" || event === \"zoom\" || event === \"cancel\");\n}\n\n/** A frame-coalesced render scheduler — see {@link makeRafCoalescer}. */\nexport interface RafCoalescer {\n    /** Schedule `run` for the next frame; repeat calls before it fires are no-ops. */\n    request(run: () => void): void;\n    /** Cancel a pending frame (teardown). */\n    cancel(): void;\n}\n\n/**\n * Coalesce many `request` calls within a single frame down to **one** scheduled\n * callback. Pointer-move / wheel handlers mutate the live camera synchronously\n * and call `request` on every event; this guarantees at most one paint +\n * snapshot per frame, keeping the hot pan path off the per-event path (issue\n * #57, Phase 2 invariant 2). Injecting `schedule` / `cancel` (rather than\n * closing over `requestAnimationFrame`) keeps the coalescer unit-testable.\n *\n * @param schedule - schedules a callback for the next frame, returns a handle\n * @param cancel - cancels a scheduled callback by handle\n * @returns a {@link RafCoalescer}\n */\nexport function makeRafCoalescer(schedule: (cb: () => void) => number, cancel: (handle: number) => void): RafCoalescer {\n    let handle: number | null = null;\n    return {\n        request(run: () => void): void {\n            if (handle !== null) return;\n            handle = schedule(() => {\n                handle = null;\n                run();\n            });\n        },\n        cancel(): void {\n            if (handle !== null) {\n                cancel(handle);\n                handle = null;\n            }\n        },\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The markers' geometry (#57, #1393): where an item drawn as a dot or a\n * labelled pin stands on the screen, and the words a pin draws — what the\n * painter draws a marker by (`paint.ts`), what a tap meets it in, and the edge\n * a link's end meets (`routes.ts`' `endShape`), so the clickable area is the\n * drawn one (invariant 27). Pure: no React, no DOM.\n *\n * @packageDocumentation\n */\n\nimport { type ScreenCamera, project } from \"./camera\";\nimport { PIN_DOT_W, PIN_GAP, PIN_H, PIN_LEAD_PX, PIN_PAD_X, SCHEMATIC_CARD_MAX_PX } from \"./model\";\n\n/** Drawn radius of a `dot`-tier marker, in screen px. */\nexport const MARKER_DOT_RADIUS = 5;\n/** Hit radius of a `dot`-tier marker, in screen px — comfortably over the\n * drawn dot (5) and its selected ring (7.5) for touch slop (issue #57, P11). */\nexport const MARKER_DOT_HIT_RADIUS = 10;\n\n/** The widest a labelled pin's words draw, in screen px: the pin at its widest ({@link SCHEMATIC_CARD_MAX_PX}), less its padding, its dot and the gap after it. */\nconst MARKER_PIN_TEXT_MAX = SCHEMATIC_CARD_MAX_PX - (PIN_PAD_X + PIN_DOT_W + PIN_GAP + PIN_PAD_X);\n\n/** What a label is cut between: its graphemes, where the page segments them. */\nconst GRAPHEMES = typeof Intl.Segmenter === \"function\" ? new Intl.Segmenter(undefined, { granularity: \"grapheme\" }) : undefined;\n\n/** A label's graphemes — so a cut never splits an accented letter or a flag — or its code points where the page has no segmenter. */\nconst graphemesOf = (text: string): string[] => (GRAPHEMES === undefined ? Array.from(text) : Array.from(GRAPHEMES.segment(text), (part) => part.segment));\n\n/**\n * The words a labelled pin draws, and their width (#1393): its item's whole\n * label, or — one wider than a pin's words draw at its widest — as much of it\n * as fits before an ellipsis, cut between graphemes, a space before the cut\n * dropped. A longer cut is never narrower, so the longest that fits is found\n * by halving.\n *\n * @param label - The item's label\n * @param measure - A string's width in px, in the pins' font\n * @returns The words, and their width in px\n */\nfunction pinWords(label: string, measure: (text: string) => number): { readonly text: string; readonly width: number } {\n    const whole = measure(label);\n    if (whole <= MARKER_PIN_TEXT_MAX) return { text: label, width: whole };\n    const parts = graphemesOf(label);\n    const cut = (n: number): string => `${parts.slice(0, n).join(\"\").trimEnd()}…`;\n    let lo = 0, hi = parts.length - 1;\n    while (lo < hi) {\n        const mid = Math.ceil((lo + hi) / 2);\n        if (measure(cut(mid)) <= MARKER_PIN_TEXT_MAX) lo = mid;\n        else hi = mid - 1;\n    }\n    const text = cut(lo);\n    return { text, width: measure(text) };\n}\n\n/** The screen-space hitbox of a non-card LOD marker — a circle for a `dot`, the\n * rounded-pill rect for a `label`, with the words it draws. */\nexport type MarkerHitbox =\n    | { kind: \"circle\"; cx: number; cy: number; r: number }\n    | { kind: \"rect\"; left: number; top: number; w: number; h: number; text: string };\n\n/**\n * The screen-space hitbox of an item's LOD marker at `tier`. The single source\n * of truth used by **both** {@link paintSchematic} (to draw the pill) and the\n * React layer's pick (to hit-test), so the clickable area always equals the\n * drawn area and the two cannot silently drift (issue #57, P11). A `dot` is a\n * circle of {@link MARKER_DOT_HIT_RADIUS}; a `label` is the rounded pill whose\n * width is `pad + dot + gap + textWidth + pad`, no wider than\n * {@link SCHEMATIC_CARD_MAX_PX} — its words the label, or as much of it as fits\n * before an ellipsis (#1393), each measured by `measure` (the caller sets the\n * context font to the palette's `labelFont` first) — its dot on its item's\n * point and its words after it ({@link PIN_LEAD_PX}), so the status it shows\n * stands where its item does, never on a neighbour's.\n *\n * @param item - the item's world anchor and label\n * @param tier - the LOD tier (`dot` or `label`; `card` markers are DOM)\n * @param cam - the screen camera\n * @param measure - measures a string's width in px under the pin font\n * @returns the marker's screen-space hitbox, and a pill's words\n */\nexport function markerHitbox(\n    item: { x: number; y: number; label: string },\n    tier: \"dot\" | \"label\",\n    cam: ScreenCamera,\n    measure: (text: string) => number,\n): MarkerHitbox {\n    const { sx, sy } = project(item.x, item.y, cam);\n    if (tier === \"dot\") return { kind: \"circle\", cx: sx, cy: sy, r: MARKER_DOT_HIT_RADIUS };\n    const words = pinWords(item.label, measure);\n    const w = PIN_PAD_X + PIN_DOT_W + PIN_GAP + words.width + PIN_PAD_X;\n    return { kind: \"rect\", left: sx - PIN_LEAD_PX, top: sy - PIN_H / 2, w, h: PIN_H, text: words.text };\n}\n\n/**\n * Whether the screen point `(sx, sy)` falls inside `box` (see\n * {@link markerHitbox}).\n *\n * @param box - a marker hitbox\n * @param sx - screen x\n * @param sy - screen y\n * @returns `true` when the point is inside the hitbox\n */\nexport function markerHit(box: MarkerHitbox, sx: number, sy: number): boolean {\n    return box.kind === \"circle\"\n        ? Math.hypot(sx - box.cx, sy - box.cy) <= box.r\n        : sx >= box.left && sx <= box.left + box.w && sy >= box.top && sy <= box.top + box.h;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The links' and the nets' routes on the screen (#180, #189, #1403), and the\n * hit geometry over them: what the painter draws (`paint.ts`), and what a tap,\n * a hover, a drop and a selected link's handles meet (`selection.ts`'\n * `linkAt`), so hit-testing is the drawing (invariant 9). A link is routed\n * between the items it joins — orthogonal or direct, through its bends, two of\n * one pair fanned into lanes — and a net as its bus: its trunk, a bar across\n * each side of several members and a leg from each of them; each end on its\n * item's edge where it draws at the zoom (a card's side, a labelled pin's edge,\n * a dot's rim), its head where it arrives; and the world box a net's bus draws\n * in (`netBox`), which the painter culls it by and the links' R-tree files it\n * under. Pure: no React, no DOM.\n *\n * @packageDocumentation\n */\n\nimport { match, type option } from \"@elaraai/east\";\nimport { arrive, type CanvasEnd, type CanvasHead } from \"../../shared/links/canvas.js\";\nimport { LINK_CORNER } from \"../../shared/links/look.js\";\nimport { type Bbox, type ScreenCamera, pointsBbox, project } from \"./camera\";\nimport type { DrawnItem, DrawnLink, DrawnNet } from \"./drawn\";\nimport { MARKER_DOT_RADIUS, markerHitbox } from \"./markers\";\nimport { tierSize, type LodTier } from \"./model\";\n\n/** An Option's value, or `undefined` — East's `match`, as paint.ts reads one: this module loads no renderer. */\nconst getSomeorUndefined = <T,>(opt: option<T>): T | undefined => match(opt, { some: (value) => value }, undefined);\n\ntype Pt = { x: number; y: number };\n\n/** Expand anchors into an axis-aligned point list (one elbow per diagonal).\n *  Exported so link hit-testing routes exactly like the painter (P11 spirit). */\nexport function orthogonalize(points: Pt[]): Pt[] {\n    const out: Pt[] = [];\n    for (const next of points) {\n        const prev = out[out.length - 1];\n        if (prev !== undefined && prev.x !== next.x && prev.y !== next.y) {\n            out.push(Math.abs(next.y - prev.y) >= Math.abs(next.x - prev.x)\n                ? { x: prev.x, y: next.y }\n                : { x: next.x, y: prev.y });\n        }\n        if (prev === undefined || prev.x !== next.x || prev.y !== next.y) out.push(next);\n    }\n    return out;\n}\n\n/**\n * Segment-wise distance from a screen point to a polyline — the link\n * hit-test's core (routed points, so the clickable path equals the drawn\n * path, including fan lanes). Exported for unit testing.\n *\n * @param pts - the routed points, in order\n * @param sx - screen x\n * @param sy - screen y\n * @returns the minimum distance (Infinity for fewer than 2 points)\n */\nexport function distanceToPolyline(pts: readonly Pt[], sx: number, sy: number): number {\n    let best = Infinity;\n    for (let i = 1; i < pts.length; i++) {\n        const a = pts[i - 1]!, b = pts[i]!;\n        const dx = b.x - a.x, dy = b.y - a.y;\n        const len2 = dx * dx + dy * dy;\n        const t = len2 > 0 ? Math.max(0, Math.min(1, ((sx - a.x) * dx + (sy - a.y) * dy) / len2)) : 0;\n        const d = Math.hypot(sx - (a.x + t * dx), sy - (a.y + t * dy));\n        if (d < best) best = d;\n    }\n    return best;\n}\n\n/** Screen-px gap between parallel link lanes (#180 fan-out). */\nexport const LINK_LANE_GAP = 7;\n\n/**\n * The arc-length midpoint of a polyline (screen space) — where a link's label\n * pill anchors, so it sits centred along the routed path (not the chord).\n * Exported for unit testing.\n *\n * @param pts - the routed points, in order\n * @returns the midpoint (the sole point / origin for degenerate inputs)\n */\nexport function polylineMidpoint(pts: readonly Pt[]): Pt {\n    if (pts.length === 0) return { x: 0, y: 0 };\n    let total = 0;\n    for (let i = 1; i < pts.length; i++) total += Math.hypot(pts[i]!.x - pts[i - 1]!.x, pts[i]!.y - pts[i - 1]!.y);\n    if (total <= 1e-9) return pts[0]!;\n    let acc = 0;\n    const half = total / 2;\n    for (let i = 1; i < pts.length; i++) {\n        const seg = Math.hypot(pts[i]!.x - pts[i - 1]!.x, pts[i]!.y - pts[i - 1]!.y);\n        if (acc + seg >= half) {\n            const t = seg > 0 ? (half - acc) / seg : 0;\n            return { x: pts[i - 1]!.x + (pts[i]!.x - pts[i - 1]!.x) * t, y: pts[i - 1]!.y + (pts[i]!.y - pts[i - 1]!.y) * t };\n        }\n        acc += seg;\n    }\n    return pts[pts.length - 1]!;\n}\n\n/**\n * Per-link parallel-fan lanes (#180): links sharing an endpoint pair (either\n * direction, no explicit waypoints, both endpoints resolved) would overdraw\n * into one edge — assign each a lane index so the painter can translate the\n * whole routed polyline rigidly along the pair's perpendicular. Deterministic\n * (lanes ordered by link key). Exported for unit testing.\n *\n * @param links - the links about to paint (pre-filtered upstream is fine)\n * @param eligible - whether a link participates (endpoints resolved, no `via`, not hidden)\n * @returns link key → `{ i, n }` lane position, only for groups of 2+\n */\nexport function parallelLanes<L extends { key: string; from: string; to: string }>(\n    links: readonly L[],\n    eligible: (link: L) => boolean,\n): Map<string, { i: number; n: number }> {\n    const groups = new Map<string, string[]>();\n    for (const link of links) {\n        if (!eligible(link)) continue;\n        const pair = link.from < link.to ? `${link.from}\\x00${link.to}` : `${link.to}\\x00${link.from}`;\n        const g = groups.get(pair);\n        if (g !== undefined) g.push(link.key); else groups.set(pair, [link.key]);\n    }\n    const lanes = new Map<string, { i: number; n: number }>();\n    for (const keys of groups.values()) {\n        if (keys.length < 2) continue;\n        keys.sort();\n        keys.forEach((k, i) => lanes.set(k, { i, n: keys.length }));\n    }\n    return lanes;\n}\n\n/** One side of a net resolved to bus-bar geometry (world space). */\ninterface NetSide {\n    /** Where the trunk attaches (bar tap for a multi-endpoint side, the item centre for a single one). */\n    anchor: Pt;\n    /** The header-bar segment, when this side has 2+ spread endpoints. */\n    bar?: [Pt, Pt];\n    /** Axis-aligned stub from each endpoint to its bar tap. */\n    stubs: Pt[][];\n    /** Junction DOTS — taps strictly inside the bar span (3-way joins); bar-end taps are elbows, no dot. */\n    taps: Pt[];\n}\n\n/** Net (bus / trunk) geometry, world space — shared verbatim by the\n *  painter and the hit-test so the clickable shape equals the drawn one. */\n/** The leg a net's stub draws: the side it is on, and its member's place in that side. */\nexport interface NetStubLeg {\n    end: \"source\" | \"destination\";\n    index: number;\n}\n\nexport interface NetGeometry {\n    /** Trunk polyline: source anchor → via… → destination anchor. */\n    trunk: Pt[];\n    bars: Array<[Pt, Pt]>;\n    stubs: Pt[][];\n    /**\n     * Each stub's leg, in the stubs' order (#1388): a side with one member —\n     * or its members at one point — draws no stub, so a stub's place among the\n     * stubs alone doesn't name its leg.\n     */\n    legs: NetStubLeg[];\n    taps: Pt[];\n}\n\n/** Resolve one endpoint group to a header BAR + stubs (the bus-bar\n *  convention of a one-line diagram), or a bare anchor when the group is a\n *  single point.\n *\n *  The bar runs along the group's larger spread axis, offset from the\n *  cluster TOWARD the trunk (30% of the gap, clamped to [0.9, 3] world\n *  units) so stubs stay short and the bar never spears the items. */\nfunction netSide(pts: readonly Pt[], toward: Pt): NetSide {\n    const centroid: Pt = {\n        x: pts.reduce((a, q) => a + q.x, 0) / pts.length,\n        y: pts.reduce((a, q) => a + q.y, 0) / pts.length,\n    };\n    if (pts.length === 1) return { anchor: pts[0]!, stubs: [], taps: [] };\n    const minX = Math.min(...pts.map(q => q.x)), maxX = Math.max(...pts.map(q => q.x));\n    const minY = Math.min(...pts.map(q => q.y)), maxY = Math.max(...pts.map(q => q.y));\n    const vertical = (maxY - minY) >= (maxX - minX);\n    // Coordinates along the bar (axis) and across it (perp).\n    const axis = (q: Pt): number => vertical ? q.y : q.x;\n    const perp = (q: Pt): number => vertical ? q.x : q.y;\n    const mk = (a: number, pp: number): Pt => vertical ? { x: pp, y: a } : { x: a, y: pp };\n    const lo = vertical ? minY : minX, hi = vertical ? maxY : maxX;\n    if (hi - lo < 1e-6) return { anchor: centroid, stubs: [], taps: [] };\n    // Bar offset: from the cluster edge FACING the trunk, toward it.\n    const dir = Math.sign(perp(toward) - perp(centroid)) || 1;\n    const edge = dir > 0 ? Math.max(...pts.map(perp)) : Math.min(...pts.map(perp));\n    const gap = Math.abs(perp(toward) - edge);\n    const barPerp = edge + dir * Math.min(Math.max(gap * 0.3, 0.9), 3);\n    const anchor = mk(Math.min(Math.max(axis(toward), lo), hi), barPerp);\n    const stubs = pts.map(q => [q, mk(axis(q), barPerp)]);\n    const isEnd = (a: number): boolean => a - lo < 1e-6 || hi - a < 1e-6;\n    const taps: Pt[] = [];\n    const pushTap = (q: Pt): void => {\n        if (isEnd(axis(q))) return;\n        if (!taps.some(t => Math.abs(t.x - q.x) < 1e-6 && Math.abs(t.y - q.y) < 1e-6)) taps.push(q);\n    };\n    for (const st of stubs) pushTap(st[1]!);\n    pushTap(anchor);\n    return { anchor, bar: [mk(lo, barPerp), mk(hi, barPerp)], stubs, taps };\n}\n\n/** Bus-bar geometry for a whole net: each side becomes a header bar (or a\n *  bare anchor), the trunk runs bar-tap → `via`… → bar-tap. With one\n *  endpoint per side and no waypoints this degrades to a plain link. */\nexport function netGeometry(sources: readonly Pt[], destinations: readonly Pt[], via: readonly Pt[]): NetGeometry {\n    const centroid = (qs: readonly Pt[]): Pt => ({\n        x: qs.reduce((a, q) => a + q.x, 0) / qs.length,\n        y: qs.reduce((a, q) => a + q.y, 0) / qs.length,\n    });\n    const srcToward = via.length > 0 ? via[0]! : centroid(destinations);\n    const dstToward = via.length > 0 ? via[via.length - 1]! : centroid(sources);\n    const src = netSide(sources, srcToward);\n    const dst = netSide(destinations, dstToward);\n    const bars: Array<[Pt, Pt]> = [];\n    if (src.bar) bars.push(src.bar);\n    if (dst.bar) bars.push(dst.bar);\n    return {\n        trunk: [src.anchor, ...via, dst.anchor],\n        bars,\n        stubs: [...src.stubs, ...dst.stubs],\n        legs: [\n            ...src.stubs.map((_, index): NetStubLeg => ({ end: \"source\", index })),\n            ...dst.stubs.map((_, index): NetStubLeg => ({ end: \"destination\", index })),\n        ],\n        taps: [...src.taps, ...dst.taps],\n    };\n}\n\n/**\n * The world box a net draws in (invariant 9): its members drawn, its bends, and its bus as {@link netGeometry} lays it\n * out — its trunk, its bars and its legs. A side's bar stands off toward the trunk, and where the other side stands\n * level with it — a rack's trunk into frames in its row — past every member: the members' box alone leaves it out.\n * What the painter culls a net by and the links' R-tree files it under, so a net draws, and takes a tap, wherever its bus\n * is.\n *\n * @param net - The net\n * @param centers - Each item drawn's centre, in world units, by its id\n * @returns Its box; `null` while a side has no member drawn, when it draws nothing\n */\nexport function netBox(net: DrawnNet, centers: ReadonlyMap<string, Pt>): Bbox | null {\n    const sources = net.sources.flatMap((k) => { const c = centers.get(k); return c === undefined ? [] : [c]; });\n    const destinations = net.destinations.flatMap((k) => { const c = centers.get(k); return c === undefined ? [] : [c]; });\n    if (sources.length === 0 || destinations.length === 0) return null;\n    const bus = netGeometry(sources, destinations, net.via);\n    return pointsBbox([...sources, ...destinations, ...net.via, ...bus.trunk, ...bus.bars.flat(), ...bus.stubs.flat()]);\n}\n\n// ---- The links' routes on the screen (#1403) ----------------------------------------------------------------\n\n/** Where an item draws at the zoom, in the canvas's px — a card's box, a labelled pin's, a dot's circle: what a link's end meets. */\nexport type EndShape = CanvasEnd;\n\n/**\n * Where an item draws at the zoom, in the canvas's px (#1403): its card's box,\n * its labelled pin's — the box a tap meets it in ({@link markerHitbox}) — or\n * its dot's circle. A card's box is its card's size as the page lays it out,\n * or, unmeasured, the size the declutter reckons it at (`tierSize`).\n *\n * @param item - The item, where it draws\n * @param tier - What it draws as at the zoom\n * @param cam - The screen camera\n * @param measure - A label's width in px, in the pins' font\n * @param card - Its card's size as the page lays it out; `undefined`, unmeasured\n * @returns Its shape\n */\nexport function endShape(item: DrawnItem, tier: LodTier, cam: ScreenCamera, measure: (text: string) => number, card: { readonly w: number; readonly h: number } | undefined): EndShape {\n    const { sx, sy } = project(item.x, item.y, cam);\n    if (tier === \"dot\") return { kind: \"circle\", x: sx, y: sy, r: MARKER_DOT_RADIUS };\n    if (tier === \"label\") {\n        const pin = markerHitbox(item, \"label\", cam, measure);\n        if (pin.kind === \"rect\") return { kind: \"box\", left: pin.left, top: pin.top, right: pin.left + pin.w, bottom: pin.top + pin.h };\n    }\n    const size = card ?? tierSize(item, \"card\", cam.ppu);\n    return { kind: \"box\", left: sx - size.w / 2, top: sy - size.h / 2, right: sx + size.w / 2, bottom: sy + size.h / 2 };\n}\n\n/** Whether a point lies in a shape, its edge among it. */\nfunction inShape(shape: EndShape, p: Pt): boolean {\n    return shape.kind === \"circle\"\n        ? Math.hypot(p.x - shape.x, p.y - shape.y) <= shape.r\n        : p.x >= shape.left && p.x <= shape.right && p.y >= shape.top && p.y <= shape.bottom;\n}\n\n/** Where a segment from a point in a shape to one out of it leaves the shape: the last of it the shape holds. */\nfunction leavesAt(shape: EndShape, a: Pt, b: Pt): Pt {\n    const dx = b.x - a.x, dy = b.y - a.y;\n    let t: number;\n    if (shape.kind === \"circle\") {\n        const fx = a.x - shape.x, fy = a.y - shape.y;\n        const qa = dx * dx + dy * dy, qb = 2 * (fx * dx + fy * dy), qc = fx * fx + fy * fy - shape.r * shape.r;\n        t = qa > 0 ? (-qb + Math.sqrt(Math.max(0, qb * qb - 4 * qa * qc))) / (2 * qa) : 0;\n    } else {\n        const tx = dx > 0 ? (shape.right - a.x) / dx : dx < 0 ? (shape.left - a.x) / dx : Infinity;\n        const ty = dy > 0 ? (shape.bottom - a.y) / dy : dy < 0 ? (shape.top - a.y) / dy : Infinity;\n        t = Math.min(tx, ty);\n    }\n    const at = Math.max(0, Math.min(1, t));\n    return { x: a.x + dx * at, y: a.y + dy * at };\n}\n\n/**\n * A route leaving its source where the source draws (#1403): from the point\n * its line first leaves the source's shape, every point before it dropped. A\n * route that starts outside the shape stands as it is; one the shape holds\n * whole is no route.\n *\n * @param points - The route, from inside the source\n * @param shape - The source's shape\n * @returns The route from the shape's edge\n */\nexport function leaveShape(points: readonly Pt[], shape: EndShape): Pt[] {\n    const first = points[0];\n    if (first === undefined || !inShape(shape, first)) return [...points];\n    for (let i = 0; i < points.length - 1; i++) {\n        if (inShape(shape, points[i + 1]!)) continue;\n        return [leavesAt(shape, points[i]!, points[i + 1]!), ...points.slice(i + 1)];\n    }\n    return [];\n}\n\n/**\n * A route meeting its destination where the destination draws (#1403): to the\n * point its line first meets the destination's shape, every point after it\n * dropped — {@link leaveShape} walked from the far end.\n *\n * @param points - The route, into the destination\n * @param shape - The destination's shape\n * @returns The route to the shape's edge\n */\nexport function meetShape(points: readonly Pt[], shape: EndShape): Pt[] {\n    return leaveShape([...points].reverse(), shape).reverse();\n}\n\n/** A link's or a net's weight: its style's, else a solid run's 2.5 and a dashed one's 1.5. */\nexport function edgeWeight(style: DrawnLink[\"style\"]): number {\n    return getSomeorUndefined(style.value.weight) ?? (style.type === \"solid\" ? 2.5 : 1.5);\n}\n\n/** One run of a link's or a net's drawing, in the canvas's px. */\nexport interface EdgeRun {\n    /** Its route, from where it leaves to where it arrives — its head's tip, where it has one: what the pointer meets. */\n    readonly route: readonly Pt[];\n    /** What its line draws: its route, to its head's base where it has one. */\n    readonly line: readonly Pt[];\n    /** Its head, where it arrives at an item. */\n    readonly head: CanvasHead | undefined;\n    /** Its weight (px). */\n    readonly width: number;\n    /** The radius its corners turn at, before their clamp. */\n    readonly corner: number;\n    /** The net's leg it is — its side and its member — or `undefined`: a link's line, a trunk, a bar. */\n    readonly leg: { readonly end: \"source\" | \"destination\"; readonly item: string } | undefined;\n}\n\n/** What a link or a net draws, in the canvas's px, before its look (#1403). */\nexport interface EdgeGeometry {\n    /** Its runs: a link's line; a net's trunk, its bars and its legs. */\n    readonly runs: readonly EdgeRun[];\n    /** Where a net's legs join its bars: its junction dots. */\n    readonly dots: readonly { readonly x: number; readonly y: number; readonly r: number }[];\n    /** The shapes of the items it joins: what its rings go round while it is lit or selected. */\n    readonly ends: readonly EndShape[];\n    /** A link's ends where its line leaves its source and meets its destination — where its handles stand; none for a net. */\n    readonly handles: { readonly from: Pt; readonly to: Pt } | undefined;\n    /** Its route's middle — a net's trunk's — where its caption centres; `undefined` with no route to draw. */\n    readonly middle: Pt | undefined;\n}\n\n/** What a link's or a net's routes are worked out over: the camera, the items' centres and shapes, and the links' lanes. */\nexport interface RouteEnv {\n    /** The screen camera. */\n    readonly cam: ScreenCamera;\n    /** Each item's centre drawn, in world units, by its id. */\n    readonly centers: ReadonlyMap<string, Pt>;\n    /** Each item's shape on the screen, by its id; `undefined` for one not drawn. */\n    readonly shapeOf: (id: string) => EndShape | undefined;\n    /** The links' lanes, by their ids (`parallelLanes`). */\n    readonly lanes: ReadonlyMap<string, { i: number; n: number }>;\n}\n\n/**\n * What a link's or a net's routes are worked out over, each item's shape\n * worked out once, as it is asked.\n *\n * @param input - The camera, each item drawn and its centre, what each draws as, its card's size, the lanes and a label's width\n * @returns The routes' environment\n */\nexport function routeEnv(input: {\n    readonly cam: ScreenCamera;\n    readonly centers: ReadonlyMap<string, Pt>;\n    readonly items: ReadonlyMap<string, DrawnItem>;\n    readonly tiers: ReadonlyMap<string, LodTier>;\n    readonly cardSizes: ReadonlyMap<string, { readonly w: number; readonly h: number }> | undefined;\n    readonly lanes: ReadonlyMap<string, { i: number; n: number }>;\n    readonly measure: (text: string) => number;\n}): RouteEnv {\n    const shapes = new Map<string, EndShape | undefined>();\n    return {\n        cam: input.cam, centers: input.centers, lanes: input.lanes,\n        shapeOf: (id) => {\n            if (shapes.has(id)) return shapes.get(id);\n            const item = input.items.get(id);\n            const shape = item === undefined || !input.centers.has(id) ? undefined\n                : endShape(item, input.tiers.get(id) ?? \"dot\", input.cam, input.measure, input.cardSizes?.get(id));\n            shapes.set(id, shape);\n            return shape;\n        },\n    };\n}\n\n/**\n * A link's drawing on the screen (#1403): routed from its source's centre to\n * its destination's — orthogonal or direct, through its bends, translated\n * rigidly onto its lane — then from where its line leaves its source's shape to\n * where it meets its destination's, its head there.\n *\n * @param link - The link\n * @param env - What its routes are worked out over\n * @returns Its drawing; `undefined` while an item it joins is drawn nowhere\n */\nexport function linkRoutes(link: DrawnLink, env: RouteEnv): EdgeGeometry | undefined {\n    const from = env.centers.get(link.from), to = env.centers.get(link.to);\n    if (from === undefined || to === undefined) return undefined;\n    const { cam } = env;\n    const anchors = [from, ...link.via, to].map((q) => ({ x: q.x * cam.ppu + cam.tx, y: q.y * cam.ppu + cam.ty }));\n    // Its fan lane (#180): the whole routed line translated along the pair's perpendicular, so its lanes stay parallel\n    // through its elbows and fan at its ends.\n    const lane = env.lanes.get(link.key);\n    if (lane !== undefined) {\n        const a0 = anchors[0]!, a1 = anchors[anchors.length - 1]!;\n        const len = Math.hypot(a1.x - a0.x, a1.y - a0.y);\n        if (len > 1e-6) {\n            const d = (lane.i - (lane.n - 1) / 2) * LINK_LANE_GAP;\n            const ox = -(a1.y - a0.y) / len * d, oy = (a1.x - a0.x) / len * d;\n            for (const q of anchors) { q.x += ox; q.y += oy; }\n        }\n    }\n    const orthogonal = link.route.type === \"orthogonal\";\n    const corner = link.route.type === \"orthogonal\" ? getSomeorUndefined(link.route.value.corner) ?? LINK_CORNER : 0;\n    const width = edgeWeight(link.style);\n    const fromShape = env.shapeOf(link.from), toShape = env.shapeOf(link.to);\n    const routed = orthogonal ? orthogonalize(anchors) : anchors;\n    const left = fromShape === undefined ? routed : leaveShape(routed, fromShape);\n    const route = toShape === undefined ? left : meetShape(left, toShape);\n    const ends = [fromShape, toShape].filter((shape): shape is EndShape => shape !== undefined);\n    const arrived = arrive(route, width);\n    if (arrived === undefined) return { runs: [], dots: [], ends, handles: undefined, middle: undefined };\n    return {\n        runs: [{ route, line: arrived.line, head: arrived.head, width, corner, leg: undefined }],\n        dots: [], ends,\n        handles: { from: route[0]!, to: route[route.length - 1]! },\n        middle: polylineMidpoint(route),\n    };\n}\n\n/**\n * A net's drawing on the screen (#1403): its bus (`netGeometry`) — its trunk,\n * a bar across each side of several members, a leg from each of them — its\n * trunk leaving a lone source where it draws and meeting a lone destination so,\n * its head there; each source's leg leaving its member's shape, and each\n * destination's meeting it, its head there. Its trunk and its bars carry no\n * head; its junctions are dots.\n *\n * @param net - The net\n * @param env - What its routes are worked out over\n * @returns Its drawing; `undefined` while a side has no member drawn\n */\nexport function netRoutes(net: DrawnNet, env: RouteEnv): EdgeGeometry | undefined {\n    const sources = net.sources.filter((k) => env.centers.has(k));\n    const destinations = net.destinations.filter((k) => env.centers.has(k));\n    if (sources.length === 0 || destinations.length === 0) return undefined;\n    const geo = netGeometry(sources.map((k) => env.centers.get(k)!), destinations.map((k) => env.centers.get(k)!), net.via);\n    const { cam } = env;\n    const toScreen = (q: Pt): Pt => ({ x: q.x * cam.ppu + cam.tx, y: q.y * cam.ppu + cam.ty });\n    const orthogonal = net.route.type === \"orthogonal\";\n    const routed = (world: readonly Pt[]): Pt[] => { const screen = world.map(toScreen); return orthogonal ? orthogonalize(screen) : screen; };\n    const corner = net.route.type === \"orthogonal\" ? getSomeorUndefined(net.route.value.corner) ?? LINK_CORNER : 0;\n    const weight = edgeWeight(net.style);\n    const runs: EdgeRun[] = [];\n    // A side whose members draw no leg is a lone member — or members at one point — which the trunk itself joins.\n    const loneSource = !geo.legs.some((leg) => leg.end === \"source\");\n    const loneDestination = !geo.legs.some((leg) => leg.end === \"destination\");\n    const sourceShape = loneSource ? env.shapeOf(sources[0]!) : undefined;\n    const destinationShape = loneDestination ? env.shapeOf(destinations[0]!) : undefined;\n    let trunk = routed(geo.trunk);\n    if (sourceShape !== undefined) trunk = leaveShape(trunk, sourceShape);\n    if (destinationShape !== undefined) trunk = meetShape(trunk, destinationShape);\n    // The trunk and the bars carry the trunk's weight; the legs are a step lighter.\n    const arrivedTrunk = loneDestination ? arrive(trunk, weight + 1) : undefined;\n    if (trunk.length >= 2) runs.push({ route: trunk, line: arrivedTrunk?.line ?? trunk, head: arrivedTrunk?.head, width: weight + 1, corner, leg: undefined });\n    for (const bar of geo.bars) {\n        const line = bar.map(toScreen);\n        runs.push({ route: line, line, head: undefined, width: weight + 1, corner: 0, leg: undefined });\n    }\n    for (const [i, stub] of geo.stubs.entries()) {\n        const leg = geo.legs[i]!;\n        const member = leg.end === \"source\" ? sources[leg.index]! : destinations[leg.index]!;\n        const shape = env.shapeOf(member);\n        if (leg.end === \"source\") {\n            const route = shape === undefined ? routed(stub) : leaveShape(routed(stub), shape);\n            if (route.length >= 2) runs.push({ route, line: route, head: undefined, width: weight, corner, leg: { end: \"source\", item: member } });\n            continue;\n        }\n        // A destination's leg runs from its bar to its member, and arrives there.\n        const toward = routed([stub[stub.length - 1]!, stub[0]!]);\n        const route = shape === undefined ? toward : meetShape(toward, shape);\n        const arrived = arrive(route, weight);\n        if (arrived !== undefined) runs.push({ route, line: arrived.line, head: arrived.head, width: weight, corner, leg: { end: \"destination\", item: member } });\n    }\n    return {\n        runs,\n        dots: geo.taps.map((q) => ({ ...toScreen(q), r: weight + 1.5 })),\n        ends: [...sources, ...destinations].flatMap((k) => { const shape = env.shapeOf(k); return shape === undefined ? [] : [shape]; }),\n        handles: undefined,\n        middle: trunk.length >= 2 ? polylineMidpoint(trunk) : undefined,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Pure Canvas2D paint layer for the Schematic. Given a 2D context, the East\n * value, a camera, the (already culled / LOD-decided) visible set, and a\n * theme-resolved palette, it draws the **bulk shapes** — zones (rect\n * outline / hatch + circle / polyline / polygon geometry, arcs included), links,\n * item footprints, and the dot / pin LOD markers. Rich item *cards* stay DOM\n * (the React layer draws\n * those at close zoom); this module never touches React, Chakra, or the DOM, so\n * it is unit-testable under any Canvas2D implementation (browser or node-skia).\n *\n * Every colour it draws is a design-system token the theme bridge resolved\n * (`theme.tsx`, #1387): its own marks' roles, and each entity's colour by its\n * id — its colour token, its tone, or its status's, resolved as the cards\n * resolve theirs (D14). Its labels draw in the font the bridge read from the\n * recipe: the design system's mono face, each letter in a cell of its own —\n * the page turns the face's joins off, which a canvas's text need not take, so\n * every text it draws or measures turns them off itself: `textRendering`, and a\n * non-joiner in each pair the face would join (`unjoined`) for Safari, whose\n * canvas has no `textRendering`. A marker whose colour is its status's while\n * its status is unread — its details row read — draws in the placeholders'\n * fill once the builder's reveal says so, and is unseen before (#1398): never a\n * status it has not read. While what it draws stands in for a new narrowing,\n * its words — a labelled pin's and a link's caption — draw in the third ink, as\n * a zone's eyebrow always does; every mark and edge is as it was (the loading\n * design's retained card).\n *\n * Its links and nets draw in the shared links look (#1403), through the shared\n * Canvas2D painter (`shared/links/canvas.ts`) the Plan's and the Allocation's\n * look is drawn by on SVG: each routed between the items it joins — orthogonal\n * or direct, through its bends, two of one pair fanned into lanes, a net as its\n * bus — its ends on the items' edges where they draw at the zoom (a card's\n * side, a labelled pin's edge, a dot's rim), its head where it arrives, a net's\n * on each of its destination legs; cased in the paper, in the muted ink or its\n * style's tone, a caption on its knockout at its route's middle, and the lit\n * and the selected ones in the strong ink, their ends ringed. Its colours and\n * its caption's font are the shared part's (`linkRibbons`), as the bridge\n * reads them. Its routes are pure too, in `routes.ts` (`linkRoutes`,\n * `netRoutes`), and its markers' geometry in `markers.ts` (`markerHitbox`), so\n * the hit-tests and a selected link's handles take the routes and the markers\n * the painter draws.\n *\n * @packageDocumentation\n */\n\nimport { match, type option, type ValueTypeOf } from \"@elaraai/east\";\nimport { Schematic } from \"@elaraai/e3-ui/internal\";\nimport { arrive, paintLinks, traceHead, traceRoute, unjoined, type CanvasLink, type CanvasLinkLook } from \"../../shared/links/canvas.js\";\nimport { placeCaptions, type RibbonCaption } from \"../../shared/links/captions.js\";\nimport { LINK_CAPTION_DROP, LINK_CORNER } from \"../../shared/links/look.js\";\nimport type { SchematicDensity } from \"../area.js\";\nimport { type Bbox, bboxOverlaps, pointsBbox, viewportWorldBbox } from \"./camera\";\nimport { statusUnread, type DrawnItem, type DrawnLink, type DrawnNet, type DrawnZone, type SchematicDrawn } from \"./drawn\";\nimport { MARKER_DOT_RADIUS, markerHitbox } from \"./markers\";\nimport { PIN_DOT_W, PIN_GAP, PIN_PAD_X } from \"./model\";\nimport {\n    edgeWeight, leaveShape, linkRoutes, meetShape, netBox, netRoutes, orthogonalize, parallelLanes, routeEnv, type EdgeGeometry, type EdgeRun,\n} from \"./routes\";\n\n/** An Option's value, or `undefined` — East's `match`, as east-ui-components'\n *  `getSomeorUndefined` reads one, without loading that package's renderers:\n *  this module stays free of React, Chakra and the DOM (#1384). */\nconst getSomeorUndefined = <T,>(opt: option<T>): T | undefined => match(opt, { some: (value) => value }, undefined);\n\ntype SchematicGeometryValue = ValueTypeOf<typeof Schematic.Types.Geometry>;\ntype Pt = { x: number; y: number };\n/** A screen-space shape vertex carrying its DXF bulge (0 = straight to next). */\ntype Vert = { x: number; y: number; bulge: number };\n\n/** Per-item LOD tier (mirrors the React layer). */\nexport type LodTier = \"card\" | \"label\" | \"dot\";\n\n/** An `[r, g, b]` triple in 0–255. */\nexport type RGB = [number, number, number];\n\n/**\n * What the paint layer draws with, resolved by the theme bridge\n * (`theme.tsx`) from the design system's tokens through the recipe, once per\n * theme: its own marks' colours, each a role named after its token, and its\n * fonts. The paint layer is colour-system-agnostic and consumes RGB and font\n * strings.\n */\nexport interface SchematicPalette {\n    /** `brandMark`: marks and dots — a match's ring, a connection's flash. */\n    brandMark: RGB;\n    /** `brand.solid`: the brand's line — a selected zone's and link's edge, a draft, a frame. */\n    brandSolid: RGB;\n    /** `brandTint`: the brand's area fill — a selected zone's wash. */\n    brandTint: RGB;\n    /** `fg`: ink — a selected marker's ring, a label. */\n    fg: RGB;\n    /** `fg.strong`: strong secondary ink. */\n    fgStrong: RGB;\n    /** `fg.muted`: secondary ink — a metric, an eyebrow, a context mark. */\n    fgMuted: RGB;\n    /** `fg.subtle`: labels and captions. */\n    fgSubtle: RGB;\n    /** `fg.faint`: muted marks. */\n    fgFaint: RGB;\n    /** `bg.surface`: paper — a pill's and a handle's fill, a dot's ring. */\n    bgSurface: RGB;\n    /** `bg.canvas`: the canvas's paper — an eyebrow's halo. */\n    bgCanvas: RGB;\n    /** `border.subtle`: a pill's rule. */\n    borderSubtle: RGB;\n    /** `border.strong`: a pin's rule. */\n    borderStrong: RGB;\n    /** `status.pos`. */\n    statusPos: RGB;\n    /** `status.neg`: a refused connection. */\n    statusNeg: RGB;\n    /** `status.warn`. */\n    statusWarn: RGB;\n    /** `status.info`. */\n    statusInfo: RGB;\n    /** `bg.subtle`: the placeholders' fill — a marker whose status is unread (#1398). */\n    bgSubtle: RGB;\n    /** `heat.1` … `heat.5`, lightest first: a density cell's steps (#1393). */\n    heat1: RGB;\n    heat2: RGB;\n    heat3: RGB;\n    heat4: RGB;\n    heat5: RGB;\n    /** The labels' font — a labelled pin's and a link's pill — in the design system's mono face, as `ctx.font` takes it. */\n    labelFont: string;\n    /** A zone's eyebrow's font, in the mono face. */\n    eyebrowFont: string;\n    /**\n     * What links and nets draw in (#1403): the colours and the caption's font the page computes for the shared links\n     * part's elements (`linkRibbons`), which the Plan's and the Allocation's links draw with too.\n     */\n    links: SchematicLinkLook;\n}\n\n/**\n * What the Schematic's links draw in (#1403): the shared look's colours and caption font, and a link drag's new line\n * and a moved link's `was` line, each with its width — every one the page computes for the shared links part's\n * elements.\n */\nexport interface SchematicLinkLook extends CanvasLinkLook {\n    /** A link drag's new line: Connect's draft. */\n    readonly preview: string;\n    /** Its width (px). */\n    readonly previewWidth: number;\n    /** A moved link's line while a retarget drags its end. */\n    readonly was: string;\n    /** Its width (px). */\n    readonly wasWidth: number;\n}\n\n/** The pan/zoom transform in CSS pixels: `screen = world × ppu + t`. */\nexport interface PaintCamera {\n    ppu: number;\n    tx: number;\n    ty: number;\n}\n\n/**\n * What the rail's narrowing paints (#1392, §10.3): the rows it leaves out drawn\n * as context, and its matches emphasised and framed. Absent from\n * {@link PaintInput} ⇒ nothing narrows. A narrowed-out row that is hidden is\n * never drawn, so `excluded` holds only what draws as context.\n */\nexport interface SchematicPaintEffect {\n    /** What draws as context, by id — items, zones, links and nets — faded, and greyed when `excludedDesaturate`; a net's leg to a context item too. */\n    excluded: ReadonlySet<string>;\n    /** Context's alpha (0–1); `1` ⇒ no fade. */\n    excludedOpacity: number;\n    /** Drain context's colour to the muted ink. */\n    excludedDesaturate: boolean;\n    /** The matches, by id: what `emphasis` rings — an item's marker, a zone's edge, a link's or a net's line. */\n    matches: ReadonlySet<string>;\n    /** The matches' emphasis — a ring, or one that breathes; `undefined` ⇒ none. */\n    emphasis: \"halo\" | \"pulse\" | undefined;\n    /** Animated pulse phase in `[0, 1)`; only read when `emphasis === \"pulse\"`. */\n    pulsePhase: number;\n    /** World-coordinate bbox framing the matches; `undefined` ⇒ no frame. */\n    frame: Bbox | undefined;\n}\n\n/** Everything {@link paintSchematic} needs for one frame. */\nexport interface PaintInput {\n    ctx: CanvasRenderingContext2D;\n    /** What the canvas draws: each kind's entities, the local edits in place. */\n    value: SchematicDrawn;\n    cam: PaintCamera;\n    /** Canvas size in CSS px (the ctx is pre-scaled by devicePixelRatio). */\n    width: number;\n    height: number;\n    /** Viewport-culled items (the React layer's `visibleItems`). */\n    visibleItems: readonly DrawnItem[];\n    /** Per-item LOD tier after declutter. */\n    tiers: ReadonlyMap<string, LodTier>;\n    /** The set of selected item keys (single/multiple/range all share it). */\n    selected: ReadonlySet<string>;\n    /**\n     * The items holding a conflict not yet chosen, by key: each marker wears the conflicts' warn ring, a 1px ring just\n     * outside it — a card's is its element's. None by default.\n     */\n    conflicted?: ReadonlySet<string>;\n    /** The set of selected ZONE keys (#177); absent/empty ⇒ no zone highlight. */\n    selectedZones?: ReadonlySet<string>;\n    /** Item key → world centre, for link endpoints. */\n    centers: ReadonlyMap<string, Pt>;\n    palette: SchematicPalette;\n    /**\n     * Each entity's colour, by its id: an item's (its markers' and its\n     * footprint's), a zone's, a link's and a net's — its colour token, else\n     * its tone, else its status's or its pattern's, as the bridge resolved it\n     * (`theme.tsx`). An entity it lacks draws in its kind's ground colour.\n     */\n    tints: ReadonlyMap<string, RGB>;\n    /** What the rail's narrowing paints: context, emphasis and a frame (#1392). */\n    effect?: SchematicPaintEffect;\n    /** Entity keys in a hidden layer — zones / links with a hidden-layer key are\n     * skipped (items are already pre-filtered out of `visibleItems`). Empty ⇒ no\n     * layer filtering. */\n    layerHiddenKeys?: ReadonlySet<string>;\n    /** Item key → layer opacity (0–1), for items in a dimmed layer. Multiplies\n     * the item marker / footprint alpha. Absent / missing key ⇒ full. */\n    layerAlpha?: ReadonlyMap<string, number>;\n    /**\n     * The in-flight connect draft (#176): the shared drag preview from the item it runs from — `from` its centre, in\n     * world coords, `fromKey` its id — to the pointer (`to`), or once `snapped`, to the item `toKey` names, ending on\n     * each one's edge, with a head (#1403); `forbiddenKey` the target the veto refuses, the draft in the danger ink and\n     * its marker ringed.\n     */\n    draftLink?: { from: Pt; to: Pt; fromKey: string; toKey?: string; snapped: boolean; forbiddenKey?: string };\n    /** One-shot connect commit flash (#176); `phase` 0..1. Endpoints may be\n     * undefined when an item vanished mid-flash — the painter skips then. */\n    connectFlash?: { from: Pt | undefined; to: Pt | undefined; phase: number };\n    /** The selected link (#176): halo stroke; `editable` also draws the\n     * endpoint connector handles for re-targeting. A net LEG selection\n     * narrows the halo to that one stub (#189 follow-up). */\n    selectedLink?: { key: string; editable: boolean; leg?: { end: \"source\" | \"destination\"; item: string } };\n    /**\n     * Where a library card's drop lands while its drag rests there (#1390):\n     * the point a template's item or a backlog row lands at, in world units —\n     * a ring there — or the entity a card lands on, by its id: a zone's\n     * dashed brand edge, a link's or a net's brand wash, a marker's brand\n     * ring. A card-tier item's mark is its DOM card's (`data-drop-target`).\n     */\n    dropMark?: { kind: \"point\"; x: number; y: number } | { kind: \"entity\"; id: string };\n    /**\n     * Each card's size as the page lays it out, by its item's id (#1403): what a link's end meets at card zoom. A card\n     * it lacks is reckoned as the declutter reckons it (`tierSize`).\n     */\n    cardSizes?: ReadonlyMap<string, { readonly w: number; readonly h: number }>;\n    /** The link or the net under the pointer, by its id (#1403): drawn last, in the strong ink, its ends ringed. */\n    lit?: string;\n    /** The link whose end a retarget drags, by its id (#1403): drawn as its `was` line until the drag lets go. */\n    was?: string;\n    /**\n     * Each kind read by area drawing its density in place of its items (#1393, D25), by its slot: its raster's cells,\n     * each in its heat step by how many rows it holds, under the zones and every link and item.\n     */\n    density?: ReadonlyMap<string, SchematicDensity>;\n    /**\n     * Whether the placeholders show (#1398, CL4): a marker — or a footprint — whose colour is its status's while its status\n     * is unread draws in the placeholders' fill once the builder's reveal says so, and is unseen before, its place kept.\n     * Absent, they show.\n     */\n    placeholders?: boolean;\n    /**\n     * Whether what it draws stands in for a new narrowing while that is read (#1398, the loading design's retained card):\n     * its words — a labelled pin's and a link's caption — in the third ink (`fg.muted`), every mark and edge as it is.\n     * Absent, it draws as itself.\n     */\n    stale?: boolean;\n    /**\n     * The theme's colour tokens (D14): a dot whose colour token names none of them draws in its tone's colour, and is\n     * stacked by its tone ({@link drawnSeverity}). Absent, every token is the theme's.\n     */\n    colours?: ReadonlySet<string>;\n}\n\n/** What {@link planMarkers} reads of a frame: what the painter draws the markers not drawn as cards by. */\nexport type MarkerInput = Pick<PaintInput,\n    \"visibleItems\" | \"tiers\" | \"selected\" | \"dropMark\" | \"tints\" | \"effect\" | \"layerAlpha\" | \"placeholders\" | \"colours\" | \"cam\" | \"palette\">;\n\n/**\n * How the markers not drawn as cards paint in a frame (#1393, ruled 26 Oct 2026, \"Legible dots\"), bottom to top:\n * every dot's paper — an open dot's inside, a filled dot's ring of it — then every dot's colour a layer at a time, by\n * the severity of the colour each is drawn in, each layer's filled dots then its open rings, each look's dots in the\n * order they came; then what draws on its own — a labelled pin, the marker a drop lands on — and what is selected\n * last, over them all. The painter draws by it, and a tap finds the marker drawn on top by it ({@link topMarker}), so\n * the paint and the hit agree (invariant 9).\n */\nexport interface MarkerPlan {\n    /** Every open dot's inside, in the paper. */\n    readonly paperInsides: DotBatch;\n    /** Every filled dot's ring of paper. */\n    readonly paperRings: DotBatch;\n    /** Each layer's colours, bottom to top: its filled dots', then its open rings'. */\n    readonly layers: readonly { readonly fills: DotBatch; readonly rings: DotBatch }[];\n    /** What draws on its own after the dots, bottom to top: the pins and a drop's target, then what is selected. */\n    readonly alone: readonly DrawnItem[];\n    /**\n     * A marker's colour, as its words: its own as the bridge resolved it; drained as context, the muted ink; its status\n     * unread, the placeholders' fill.\n     *\n     * @param item - The item\n     * @param unread - Whether its status is unread\n     * @returns Its colour\n     */\n    readonly tintOf: (item: DrawnItem, unread: boolean) => string;\n}\n\n/**\n * How the markers not drawn as cards paint in a frame (see {@link MarkerPlan}).\n *\n * @param input - The frame: the items in view, what each draws as, what is selected, a drop's mark, each entity's\n *   colour, the narrowing's context, the layers' fades, whether the placeholders show, the theme's colour tokens, the\n *   camera and the palette\n * @returns The plan\n */\nexport function planMarkers(input: MarkerInput): MarkerPlan {\n    const { visibleItems, tiers, selected, tints, effect, layerAlpha, cam, palette: p } = input;\n    const placeholders = input.placeholders ?? true;\n    const dropOn = input.dropMark?.kind === \"entity\" ? input.dropMark.id : undefined;\n    const isExcluded = (key: string): boolean => effect?.excluded.has(key) ?? false;\n    const alphaOf = (key: string): number => (effect !== undefined && isExcluded(key) ? effect.excludedOpacity : 1) * (layerAlpha?.get(key) ?? 1);\n    const surface = css(p.bgSurface), placeholder = css(p.bgSubtle), muted = css(p.fgMuted);\n    const words = new Map<RGB, string>();\n    const tintOf = (item: DrawnItem, unread: boolean): string => {\n        if (effect !== undefined && isExcluded(item.key) && effect.excludedDesaturate) return muted;\n        if (unread) return placeholder;\n        const own = tints.get(item.key);\n        if (own === undefined) return muted;\n        let said = words.get(own);\n        if (said === undefined) words.set(own, said = css(own));\n        return said;\n    };\n    // The layer each dot's colour draws in: what the narrowing leaves out, a status unread, then the severity of the colour\n    // it is drawn in.\n    const layerOf = (item: DrawnItem, unread: boolean): number => {\n        if (isExcluded(item.key)) return DOT_CONTEXT_LAYER;\n        if (unread) return DOT_UNREAD_LAYER;\n        const severity = drawnSeverity(item, input.colours);\n        return severity === undefined ? DOT_NO_STATUS_LAYER : DOT_STATUS_LAYER[severity];\n    };\n    const paperInsides: DotBatch = new Map(), paperRings: DotBatch = new Map();\n    const layers = Array.from({ length: DOT_LAYERS }, () => ({ fills: new Map() as DotBatch, rings: new Map() as DotBatch }));\n    const alone: DrawnItem[] = [];\n    for (const item of visibleItems) {\n        const tier = tiers.get(item.key) ?? \"dot\";\n        if (tier === \"card\") continue; // rich card rendered by the React layer\n        if (tier !== \"dot\" || selected.has(item.key) || dropOn === item.key) { alone.push(item); continue; }\n        // Its status unread (#1398): its dot in the placeholders' fill once revealed, unseen before — never a status.\n        const unread = statusUnread(item);\n        if (unread && !placeholders) continue;\n        const tint = tintOf(item, unread);\n        const alpha = alphaOf(item.key);\n        const x = item.x * cam.ppu + cam.tx, y = item.y * cam.ppu + cam.ty;\n        const colour = layers[layerOf(item, unread)]!;\n        // A ring status — a tentative one — is an open ring in its tone, the paper inside it; any other a filled dot, ringed\n        // in the paper.\n        if (statusRing(item.status)) {\n            batchDot(paperInsides, surface, 0, alpha, x, y, item.key);\n            batchDot(colour.rings, tint, DOT_RING_PX, alpha, x, y, item.key);\n        } else {\n            batchDot(paperRings, surface, DOT_PAPER_PX, alpha, x, y, item.key);\n            batchDot(colour.fills, tint, 0, alpha, x, y, item.key);\n        }\n    }\n    // What is selected draws last, over its neighbours: the declutter keeps every other pin clear of every mark, but a\n    // selected item takes its form whatever it covers.\n    const marked = selected.size === 0 ? alone\n        : [...alone.filter((item) => !selected.has(item.key)), ...alone.filter((item) => selected.has(item.key))];\n    return { paperInsides, paperRings, layers, alone: marked, tintOf };\n}\n\n/**\n * Which of some markers draws on top in a frame (invariant 9): the last of them its plan draws — each layer's\n * colours, bottom to top, each look's dots in the order they came, then what draws on its own. A marker the plan\n * draws not at all — its status unread, unseen until the reveal — is none of them.\n *\n * @param plan - The frame's plan ({@link planMarkers})\n * @param ids - The markers, by their items' ids\n * @returns The one drawn on top; `undefined` where the plan draws none of them\n */\nexport function topMarker(plan: MarkerPlan, ids: ReadonlySet<string>): string | undefined {\n    let top: string | undefined;\n    for (const layer of plan.layers) {\n        for (const batch of [layer.fills, layer.rings]) {\n            for (const widths of batch.values()) {\n                for (const alphas of widths.values()) {\n                    for (const run of alphas.values()) for (const id of run.ids) if (ids.has(id)) top = id;\n                }\n            }\n        }\n    }\n    for (const item of plan.alone) if (ids.has(item.key)) top = item.key;\n    return top;\n}\n\n/**\n * A density raster's cell's heat step (#1393, ruled 23 Oct 2026): one of the\n * theme's five, by its share of the fullest cell on halving steps — over half\n * the fullest the fifth, over a quarter the fourth, over an eighth the third,\n * over a sixteenth the second, the first below — so cells that differ by a\n * row or two of a uniform block read alike, and a cell the rows fill in part\n * reads a step or two lighter.\n *\n * @param count - The rows the cell holds\n * @param most - The rows the fullest cell holds\n * @returns Its step, 1 to 5; `0` for an empty cell\n */\nexport function densityStep(count: number, most: number): 0 | 1 | 2 | 3 | 4 | 5 {\n    if (count <= 0 || most <= 0) return 0;\n    const halvings = Math.floor(Math.log2(most / Math.min(count, most)));\n    return Math.max(1, 5 - halvings) as 1 | 2 | 3 | 4 | 5;\n}\n\nconst css = (c: RGB, a = 1): string =>\n    a >= 1 ? `rgb(${c[0]},${c[1]},${c[2]})` : `rgba(${c[0]},${c[1]},${c[2]},${a})`;\n\n/** Whether an item's status draws as an open ring, as a tentative one does. */\nfunction statusRing(status: DrawnItem[\"status\"]): boolean {\n    return status.type === \"some\" && status.value.ring;\n}\n\n/**\n * Geometry's vertices in world units: each an offset from its entity's anchor\n * — an item's centre, a zone's box centre (D22) — placed about it.\n *\n * @param anchor - The entity's anchor, in world units\n * @param vertices - The geometry's vertices, offsets from the anchor\n * @returns The vertices placed in the world\n */\nexport function placedVertices<V extends { x: number; y: number; bulge: number }>(anchor: Pt, vertices: readonly V[]): Vert[] {\n    return vertices.map(v => ({ x: anchor.x + v.x, y: anchor.y + v.y, bulge: v.bulge }));\n}\n\n/** A zone's anchor: its box's centre, what its geometry is drawn about. */\nexport function zoneAnchor(zone: { x: number; y: number; width: number; height: number }): Pt {\n    return { x: zone.x + zone.width / 2, y: zone.y + zone.height / 2 };\n}\n\n/** Trace `pts` into `ctx`, rounding corners by up to `radius` (rounded cable-tray look). */\nfunction traceRounded(ctx: CanvasRenderingContext2D, pts: Pt[], radius: number): void {\n    if (pts.length === 0) return;\n    ctx.moveTo(pts[0]!.x, pts[0]!.y);\n    for (let i = 1; i < pts.length - 1; i++) {\n        const p = pts[i]!, a = pts[i - 1]!, b = pts[i + 1]!;\n        const inLen = Math.hypot(p.x - a.x, p.y - a.y);\n        const outLen = Math.hypot(b.x - p.x, b.y - p.y);\n        const r = Math.min(radius, inLen / 2, outLen / 2);\n        if (r < 0.5) { ctx.lineTo(p.x, p.y); continue; }\n        const inU = { x: (p.x - a.x) / inLen, y: (p.y - a.y) / inLen };\n        ctx.lineTo(p.x - inU.x * r, p.y - inU.y * r);\n        ctx.quadraticCurveTo(p.x, p.y, p.x + (b.x - p.x) / outLen * r, p.y + (b.y - p.y) / outLen * r);\n    }\n    const last = pts[pts.length - 1]!;\n    if (pts.length > 1) ctx.lineTo(last.x, last.y);\n}\n\n/** Centre / radius / sweep of a DXF bulge arc, ready for `CanvasRenderingContext2D.arc`. */\nexport interface BulgeArc {\n    cx: number;\n    cy: number;\n    radius: number;\n    startAngle: number;\n    endAngle: number;\n    anticlockwise: boolean;\n}\n\n/**\n * Pure geometry of the circular arc a DXF `bulge` encodes for the edge\n * `p1`→`p2` (`bulge = tan(includedAngle / 4)`; sign = turn direction). Returns\n * `null` for a straight or degenerate edge (`|bulge|` ~ 0, or a zero-length\n * chord). Screen space: the caller has already transformed the vertices, and\n * the uniform camera scale preserves the bulge (it is the tangent of an angle).\n * Exported so the arc maths is unit-testable without a Canvas2D context.\n */\nexport function arcFromBulge(p1: Pt, p2: Pt, bulge: number): BulgeArc | null {\n    const dx = p2.x - p1.x, dy = p2.y - p1.y;\n    const chord = Math.hypot(dx, dy);\n    if (Math.abs(bulge) < 1e-4 || chord < 1e-9) return null;\n    const theta = 4 * Math.atan(bulge);            // signed swept angle\n    const radius = Math.abs(chord / (2 * Math.sin(theta / 2)));\n    const mx = (p1.x + p2.x) / 2, my = (p1.y + p2.y) / 2;\n    const d = (chord / 2) / Math.tan(theta / 2);   // signed midpoint→centre distance\n    const cx = mx - (dy / chord) * d, cy = my + (dx / chord) * d;\n    // A large-magnitude bulge drives `theta → ±2π`, so `sin(theta/2)` and\n    // `tan(theta/2) → 0` and both `radius` and `d` diverge — treat the\n    // resulting non-finite centre/radius as a straight edge (issue #57, P9).\n    if (!Number.isFinite(radius) || !Number.isFinite(d) || !Number.isFinite(cx) || !Number.isFinite(cy)) return null;\n    return {\n        cx, cy, radius,\n        startAngle: Math.atan2(p1.y - cy, p1.x - cx),\n        endAngle: Math.atan2(p2.y - cy, p2.x - cx),\n        anticlockwise: theta < 0,\n    };\n}\n\n/**\n * Append the edge `p1`→`p2` to the current path: a straight `lineTo` when the\n * edge is straight, else the circular arc its DXF bulge encodes (see\n * {@link arcFromBulge}).\n */\nfunction traceBulge(ctx: CanvasRenderingContext2D, p1: Pt, p2: Pt, bulge: number): void {\n    const arc = arcFromBulge(p1, p2, bulge);\n    if (arc === null) { ctx.lineTo(p2.x, p2.y); return; }\n    ctx.arc(arc.cx, arc.cy, arc.radius, arc.startAngle, arc.endAngle, arc.anticlockwise);\n}\n\n/**\n * Trace an arc-aware vertex list (screen space, each `{x,y,bulge}`) into the\n * current path. When `closed`, the last vertex's bulge curves the edge back to\n * the first and the subpath is closed (polygon); otherwise it is left open\n * (polyline). The caller sets stroke / fill and calls `beginPath` first.\n */\nfunction traceVertices(ctx: CanvasRenderingContext2D, pts: Vert[], closed: boolean): void {\n    if (pts.length === 0) return;\n    ctx.moveTo(pts[0]!.x, pts[0]!.y);\n    for (let i = 1; i < pts.length; i++) traceBulge(ctx, pts[i - 1]!, pts[i]!, pts[i - 1]!.bulge);\n    if (closed) {\n        const last = pts[pts.length - 1]!;\n        traceBulge(ctx, last, pts[0]!, last.bulge);\n        ctx.closePath();\n    }\n}\n\n/**\n * Where a zone's eyebrow stands, in world units (#1546): on the outline its `geometry` draws, at the outline's point\n * nearest its box's top-left — of a polygon's edges, the last vertex's bulge curving the edge back to the first; of a\n * polyline's run, along its middle; on a circle, toward the corner — and for a zone with no geometry, a `rect` or a\n * shape of no vertices, its box's top-left itself. Its words run to the right of it.\n *\n * @param zone - The zone's box, in world units\n * @param geom - Its drawn shape, if it has one\n * @returns The point its eyebrow stands at, in world units\n */\nexport function zoneEyebrowAnchor(zone: { x: number; y: number; width: number; height: number }, geom: SchematicGeometryValue | undefined): Pt {\n    const corner = { x: zone.x, y: zone.y };\n    if (geom === undefined || geom.type === \"rect\") return corner;\n    const centre = zoneAnchor(zone);\n    if (geom.type === \"circle\") {\n        const r = geom.value.radius, dx = corner.x - centre.x, dy = corner.y - centre.y, d = Math.hypot(dx, dy);\n        // A box of no size has its corner at its centre: the circle's top stands for the point toward it.\n        return d < 1e-9 ? { x: centre.x, y: centre.y - r } : { x: centre.x + dx / d * r, y: centre.y + dy / d * r };\n    }\n    return nearestOnVertices(corner, placedVertices(centre, geom.value.vertices), geom.type === \"polygon\") ?? corner;\n}\n\n/**\n * The point of an arc-aware vertex run nearest `p`, as {@link traceVertices} draws it: each edge straight, or the arc\n * its DXF bulge encodes — and, `closed`, the last vertex's edge back to the first.\n *\n * @param p - The point\n * @param pts - The run's vertices, placed\n * @param closed - Whether the run closes, a polygon's\n * @returns The run's point nearest `p`; `undefined` for a run of no vertices\n */\nfunction nearestOnVertices(p: Pt, pts: readonly Vert[], closed: boolean): Pt | undefined {\n    if (pts.length === 0) return undefined;\n    let best: Pt = { x: pts[0]!.x, y: pts[0]!.y };\n    let bestDist = Math.hypot(p.x - best.x, p.y - best.y);\n    const edges = closed ? pts.length : pts.length - 1;\n    for (let i = 0; i < edges; i++) {\n        const from = pts[i]!;\n        const q = nearestOnEdge(p, from, pts[(i + 1) % pts.length]!, from.bulge);\n        const d = Math.hypot(p.x - q.x, p.y - q.y);\n        if (d < bestDist) { best = q; bestDist = d; }\n    }\n    return best;\n}\n\n/**\n * The point of the edge `a`→`b` nearest `p`, as {@link traceBulge} draws it: of the segment, or of the arc its DXF bulge\n * encodes — swept from its start the way `CanvasRenderingContext2D.arc` turns, the point toward `p` where the sweep\n * reaches it, else the nearer end.\n *\n * @param p - The point\n * @param a - The edge's start\n * @param b - The edge's end\n * @param bulge - Its DXF bulge, `a`'s\n * @returns The edge's point nearest `p`\n */\nfunction nearestOnEdge(p: Pt, a: Pt, b: Pt, bulge: number): Pt {\n    const arc = arcFromBulge(a, b, bulge);\n    if (arc === null) {\n        const dx = b.x - a.x, dy = b.y - a.y, length2 = dx * dx + dy * dy;\n        const t = length2 === 0 ? 0 : Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.y - a.y) * dy) / length2));\n        return { x: a.x + dx * t, y: a.y + dy * t };\n    }\n    const TAU = Math.PI * 2;\n    const norm = (angle: number) => ((angle % TAU) + TAU) % TAU;\n    const toward = Math.atan2(p.y - arc.cy, p.x - arc.cx);\n    const sweep = arc.anticlockwise ? norm(arc.startAngle - arc.endAngle) : norm(arc.endAngle - arc.startAngle);\n    const into = arc.anticlockwise ? norm(arc.startAngle - toward) : norm(toward - arc.startAngle);\n    if (into <= sweep) return { x: arc.cx + arc.radius * Math.cos(toward), y: arc.cy + arc.radius * Math.sin(toward) };\n    return Math.hypot(p.x - a.x, p.y - a.y) <= Math.hypot(p.x - b.x, p.y - b.y) ? { x: a.x, y: a.y } : { x: b.x, y: b.y };\n}\n\n/** One look's dots: their centres in screen px, as `x, y, x, y, …`, and their items' ids, in the order they came. */\ninterface DotRun {\n    readonly centres: number[];\n    readonly ids: string[];\n}\n\n/**\n * Dots drawn alike, by their look (#1393): their style, then their line's\n * width (a fill's is 0), then their alpha, each look's dots in the order they\n * came.\n */\ntype DotBatch = Map<string, Map<number, Map<number, DotRun>>>;\n\n/** Adds a dot to the look it draws in. */\nfunction batchDot(batch: DotBatch, style: string, width: number, alpha: number, x: number, y: number, id: string): void {\n    let widths = batch.get(style);\n    if (widths === undefined) batch.set(style, widths = new Map());\n    let alphas = widths.get(width);\n    if (alphas === undefined) widths.set(width, alphas = new Map());\n    const run = alphas.get(alpha);\n    if (run === undefined) alphas.set(alpha, { centres: [x, y], ids: [id] });\n    else { run.centres.push(x, y); run.ids.push(id); }\n}\n\n/**\n * Fills or strokes each look's dots as one path, every dot a circle of\n * `radius` about its centre: a draw a look, whatever the number of dots. The\n * caller saves and restores the context about it.\n */\nfunction paintDots(ctx: CanvasRenderingContext2D, batch: DotBatch, op: \"fill\" | \"stroke\", radius: number): void {\n    for (const [style, widths] of batch) {\n        for (const [width, alphas] of widths) {\n            for (const [alpha, { centres }] of alphas) {\n                ctx.globalAlpha = alpha;\n                if (op === \"fill\") ctx.fillStyle = style;\n                else { ctx.strokeStyle = style; ctx.lineWidth = width; }\n                ctx.beginPath();\n                for (let i = 0; i < centres.length; i += 2) {\n                    const x = centres[i]!, y = centres[i + 1]!;\n                    ctx.moveTo(x + radius, y);\n                    ctx.arc(x, y, radius, 0, Math.PI * 2);\n                }\n                if (op === \"fill\") ctx.fill();\n                else ctx.stroke();\n            }\n        }\n    }\n}\n\n/** The width of a filled dot's ring of paper, in px: it rings the dot from half of it inside its edge to half outside. */\nconst DOT_PAPER_PX = 1.5;\n\n/** The width of an open dot's ring — a status drawn as a ring — in px. */\nconst DOT_RING_PX = 2;\n\n/**\n * The radius of a filled dot's colour, in px: what its ring of paper leaves of it, so a dot drawn on its own is\n * its colour within its ring as it ever was, whichever is drawn first.\n */\nexport const DOT_COLOUR_RADIUS = MARKER_DOT_RADIUS - DOT_PAPER_PX / 2;\n\n/**\n * How far a dot's drawn shape reaches from its centre, in px (invariant 9): a filled dot's ring of paper half its\n * width past its radius, an open dot's ring half its own. What a tap lands on the dot by, where dots overlap.\n *\n * @param item - The item, drawn as a dot\n * @returns Its reach\n */\nexport function dotDrawnRadius(item: DrawnItem): number {\n    return MARKER_DOT_RADIUS + (statusRing(item.status) ? DOT_RING_PX : DOT_PAPER_PX) / 2;\n}\n\n/** A status's tone, as an item's status names it: what a dot's colour is stacked by. */\nexport type StatusTone = Extract<DrawnItem[\"status\"], { type: \"some\" }>[\"value\"][\"tone\"][\"type\"];\n\n/**\n * The valence a theme colour token names, by its group: the design system's status bases (`status.pos` …), their\n * text steps (`fg.success` …), their washes and their palettes (`success.solid` …).\n */\nconst TOKEN_SEVERITIES: readonly (readonly [StatusTone, RegExp])[] = [\n    [\"success\", /^(status\\.pos|fg\\.success|bg\\.success|success(\\.|$))/],\n    [\"neutral\", /^neutral(\\.|$)/],\n    [\"info\", /^(status\\.info|fg\\.info|bg\\.info|info(\\.|$))/],\n    [\"warning\", /^(status\\.warn|fg\\.warning|bg\\.warning|warning(\\.|$))/],\n    [\"danger\", /^(status\\.neg|fg\\.(danger|error)|bg\\.(danger|error)|danger(\\.|$))/],\n];\n\n/** The severity an item's tone names: its valence's — brand, ink and muted name none. */\nconst TONE_SEVERITY: Readonly<Record<string, StatusTone>> = { success: \"success\", warning: \"warning\", danger: \"danger\" };\n\n/**\n * The severity of the colour a dot is drawn in (ruled 26 Oct 2026, \"Legible dots\"; D14): its colour token's — the\n * token's valence, while the theme holds it, as the colour chain draws it — else its tone's, else its status's. A\n * colour of no valence — a heat step, the brand's, an ink — names none, and stacks with the dots showing no status.\n *\n * @param item - The item\n * @param colours - The theme's colour tokens: one naming none of them draws its tone, and stacks by it; absent, every token is the theme's\n * @returns The severity; `undefined` for none\n */\nexport function drawnSeverity(item: DrawnItem, colours?: ReadonlySet<string>): StatusTone | undefined {\n    const token = getSomeorUndefined(item.color);\n    if (token !== undefined && (colours === undefined || colours.has(token))) {\n        return TOKEN_SEVERITIES.find(([, pattern]) => pattern.test(token))?.[0];\n    }\n    const tone = getSomeorUndefined(item.tone);\n    if (tone !== undefined) return TONE_SEVERITY[tone.type];\n    return getSomeorUndefined(item.status)?.tone.type;\n}\n\n/**\n * The layers the dots' colours draw in, bottom to top: what the narrowing leaves out, as context; a status not read\n * yet, in the placeholders' fill; a dot whose colour names no severity; then each severity, from success to danger\n * ({@link DOT_STATUS_LAYER}) — the severity of the colour each is drawn in ({@link drawnSeverity}). Packed dots overlap\n * by it, never by the order they come in, so the worst colour drawn is never hidden under a healthier one (\"Legible\n * dots\").\n */\nconst DOT_CONTEXT_LAYER = 0, DOT_UNREAD_LAYER = 1, DOT_NO_STATUS_LAYER = 2;\n\n/** The layer each severity draws its dots' colour in: over context, a status unread and none, danger the top. */\nconst DOT_STATUS_LAYER: Readonly<Record<StatusTone, number>> = { success: 3, neutral: 4, info: 5, warning: 6, danger: 7 };\n\n/** How many layers the dots' colours draw in. */\nconst DOT_LAYERS = 8;\n\n/** Links hide their mid-path label below this zoom (px per world unit) —\n *  aligned with the item labelled-pin band. */\nexport const LINK_LABEL_MIN_PPU = 16;\n\n/** Clamp a hatch `spacing` to a positive, finite minimum so the line sweep\n * always advances and terminates — a `0` / negative / NaN spacing would\n * otherwise hard-hang or stall the render thread (issue #57, P3). */\nexport function hatchSpacing(rawSpacing: number): number {\n    return Number.isFinite(rawSpacing) ? Math.max(1, rawSpacing) : 1;\n}\n\n/**\n * The bounded offset range `[oStart, oEnd)` for the diagonal hatch sweep of a\n * zone whose screen rect is `(x, y, w, h)` on an `width × height` canvas, for a\n * line family of direction `(dx, dy)` spaced `spacing` apart, with `diag` the\n * sweep half-length. The full sweep is `-diag … diag`; this narrows it to the\n * offsets whose line can reach the on-screen portion of the zone, so the step\n * count is O(visible area / spacing) not O(zone area / spacing) (issue #57,\n * 1e). `oStart` is snapped onto the SAME `{ -diag + k·spacing }` phase grid the\n * full sweep uses, so the bounded sweep draws the identical lines — fewer of\n * them, never phase-shifted. A horizontal family (`dy ≈ 0`, so the line normal\n * has no x-component) can't be solved this way and falls back to the full\n * `-diag … diag` range: fully off-screen zones are already culled upstream, so\n * the only cost case is an on-screen zone far taller than the viewport, which\n * then pays the full-height sweep (it still terminates — `spacing ≥ 1`; this\n * degenerate orientation renders as collinear lines and is rarely authored).\n *\n * @returns the inclusive-exclusive offset range to sweep\n */\nexport function hatchSweepBounds(\n    x: number, y: number, w: number, h: number, width: number, height: number,\n    dx: number, dy: number, diag: number, spacing: number,\n): { oStart: number; oEnd: number } {\n    const nx = -dy, ny = dx;                       // unit line normal\n    if (Math.abs(nx) <= 1e-6) return { oStart: -diag, oEnd: diag };\n    const cx0 = Math.max(x, 0), cy0 = Math.max(y, 0);\n    const cx1 = Math.min(x + w, width), cy1 = Math.min(y + h, height);\n    // A line's normal-coordinate `c = X·n` is constant along it;\n    // `c(o) = (x+o)·nx + (y - diag·dy)·ny`. Solve for the `o` whose `c` spans\n    // the visible rect's `c` range.\n    const cs = [cx0 * nx + cy0 * ny, cx1 * nx + cy0 * ny, cx0 * nx + cy1 * ny, cx1 * nx + cy1 * ny];\n    const oOfC = (c: number) => (c - x * nx - (y - diag * dy) * ny) / nx;\n    const oA = oOfC(Math.min(...cs)), oB = oOfC(Math.max(...cs));\n    return {\n        oStart: Math.max(-diag, -diag + Math.floor((Math.min(oA, oB) + diag) / spacing) * spacing - spacing),\n        oEnd: Math.min(diag, Math.max(oA, oB) + spacing),\n    };\n}\n\n/**\n * An upper bound on the number of hatch lines swept across an `w × h` (screen\n * px) region at `rawSpacing`. Finite for any input because {@link hatchSpacing}\n * floors the spacing at 1 (issue #57, P3); the painter further bounds the sweep\n * to the on-screen portion of the zone (1e).\n *\n * @param w - region width in screen px\n * @param h - region height in screen px\n * @param rawSpacing - the raw (possibly zero/negative) spacing\n * @returns a finite line-count upper bound\n */\nexport function hatchLineCount(w: number, h: number, rawSpacing: number): number {\n    return Math.ceil((2 * Math.hypot(w, h)) / hatchSpacing(rawSpacing)) + 1;\n}\n\n/** World-space cull bbox for a zone: the declared `x/y/width/height` rect\n * unioned with the actual geometry's extent (circle centre±radius, polygon /\n * polyline vertex bounds, each vertex about the box's centre), mirroring the\n * item-footprint union — so a shape that bows outside its declared rect is\n * never wrongly culled (issue #57, 1e). */\nfunction zoneWorldBbox(zone: DrawnZone, geom: SchematicGeometryValue | undefined): Bbox {\n    const bb: Bbox = { minX: zone.x, minY: zone.y, maxX: zone.x + zone.width, maxY: zone.y + zone.height };\n    if (geom !== undefined && geom.type === \"circle\") {\n        const cx = zone.x + zone.width / 2, cy = zone.y + zone.height / 2, r = geom.value.radius;\n        bb.minX = Math.min(bb.minX, cx - r); bb.minY = Math.min(bb.minY, cy - r);\n        bb.maxX = Math.max(bb.maxX, cx + r); bb.maxY = Math.max(bb.maxY, cy + r);\n    } else if (geom !== undefined && geom.type !== \"rect\") {\n        // Vertex bounds per issue #57 1e (\"min/max over geom.value.vertices\").\n        // A DXF bulge arc bows past the vertex AABB by up to chord/2 for a\n        // semicircle (more for a reflex bulge); that bow is intentionally NOT\n        // added here, so a heavily-bulged edge whose apex is the only on-screen\n        // part (its vertices, chord, and declared rect all off screen) can cull\n        // a frame early — a rare, transient gap while zoomed in and panning, not\n        // a persistent error, accepted to keep the cull cheap per 1e.\n        const g = pointsBbox(placedVertices(zoneAnchor(zone), geom.value.vertices));\n        if (g !== null) {\n            bb.minX = Math.min(bb.minX, g.minX); bb.minY = Math.min(bb.minY, g.minY);\n            bb.maxX = Math.max(bb.maxX, g.maxX); bb.maxY = Math.max(bb.maxY, g.maxY);\n        }\n    }\n    return bb;\n}\n\n/** A caption's text: a link's label and its metric (`uplink · 100G`), either alone, or none. */\nexport function captionText(label: string | undefined, metric: string | undefined): string | undefined {\n    return label !== undefined && metric !== undefined ? `${label} · ${metric}` : label ?? metric;\n}\n\n/** Draw the schematic's bulk-shape layer for one frame. Clears first. */\nexport function paintSchematic(input: PaintInput): void {\n    const { ctx, value, cam, width, height, visibleItems, tiers, selected, selectedZones, centers, palette: p, tints, effect, layerHiddenKeys, layerAlpha, draftLink, connectFlash, selectedLink, dropMark } = input;\n    // An entity's colour by its id, as the bridge resolved it; else its kind's ground.\n    const tintOf = (key: string, ground: RGB): string => css(tints.get(key) ?? ground);\n    // Whether a status unread draws its placeholder now: once the builder's reveal says so (#1398, CL4).\n    const placeholders = input.placeholders ?? true;\n    // The ink its words draw in: the third while what it draws stands in for a new narrowing (#1398), else the ink.\n    const wordsInk = css(input.stale === true ? p.fgMuted : p.fg);\n    // The entity a library card's drop lands on, by its id (#1390).\n    const dropOn = dropMark?.kind === \"entity\" ? dropMark.id : undefined;\n    const wx = (x: number) => x * cam.ppu + cam.tx;\n    const wy = (y: number) => y * cam.ppu + cam.ty;\n    const ppu = cam.ppu;\n    // Render alpha / tint. `contextAlpha` is the narrowing's fade of what draws as context (#1392); `alphaOf` folds an\n    // item's layer dim into it (multiplicative) — a layer dims its items alone; `desatOf` drains context to the muted ink.\n    const isExcluded = (key: string): boolean => effect?.excluded.has(key) ?? false;\n    const layerHidden = (key: string): boolean => layerHiddenKeys?.has(key) ?? false;\n    const contextAlpha = (key: string): number => ((effect !== undefined && isExcluded(key)) ? effect.excludedOpacity : 1);\n    const alphaOf = (key: string): number => contextAlpha(key) * (layerAlpha?.get(key) ?? 1);\n    const desatOf = (key: string): boolean => (effect !== undefined && isExcluded(key) && effect.excludedDesaturate);\n    // The matches' emphasis (§10.3): a ring of the brand's mark about a match — steady for `halo`, breathing for\n    // `pulse` (0..1 sinusoid) — on an item's marker, a zone's edge, or under a link's or a net's line.\n    const pulse = effect?.emphasis === \"pulse\";\n    const breath = pulse ? Math.sin(effect!.pulsePhase * Math.PI * 2) * 0.5 + 0.5 : 1;\n    const emphasised = (key: string): boolean => effect !== undefined && effect.emphasis !== undefined && effect.matches.has(key);\n    const ringAlpha = pulse ? 0.14 + 0.30 * (1 - breath) : 0.34;\n    const ringGrow = pulse ? breath * 7 : 4;\n    // The world rect currently on screen — zones / links whose geometry bbox\n    // misses it are culled (issue #57, P6). Items are already viewport-culled\n    // into `visibleItems` by the React layer's rbush.\n    const viewBbox = viewportWorldBbox(cam, width, height);\n\n    // Clear the FULL backing store in device space, independent of the dpr\n    // transform — clearing in CSS px under a fractional-dpr transform leaves a\n    // sub-pixel fringe on the right/bottom edge across pan frames (issue #57,\n    // P7). The caller's transform still applies to subsequent drawing.\n    ctx.save();\n    ctx.setTransform(1, 0, 0, 1, 0, 0);\n    ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n    ctx.restore();\n    ctx.lineJoin = \"round\";\n\n    // ---- the density at overview (#1393, D25): each kind's raster, under the zones -------\n    // Each cell holding rows a square in its heat step (`densityStep`); a cell off screen is culled. The zones draw over\n    // it, so a hall's outline and its eyebrow stand over the racks' shading.\n    if (input.density !== undefined && input.density.size > 0) {\n        const steps = [p.heat1, p.heat2, p.heat3, p.heat4, p.heat5].map((c) => css(c));\n        ctx.save();\n        for (const raster of input.density.values()) {\n            const side = raster.side * ppu;\n            for (const cell of raster.cells) {\n                const step = densityStep(cell.count, raster.most);\n                if (step === 0) continue;\n                const x = wx(cell.minX), y = wy(cell.minY);\n                if (x > width || y > height || x + side < 0 || y + side < 0) continue;\n                ctx.fillStyle = steps[step - 1]!;\n                ctx.fillRect(x, y, side, side);\n            }\n        }\n        ctx.restore();\n    }\n\n    // ---- zones: rect outline / hatch + polyline / polygon geometry ----------\n    // Each zone's eyebrow is drawn after the dots, over them (`eyebrows`): a hall its racks pack keeps its name.\n    const eyebrows: { readonly x: number; readonly y: number; readonly label: string; readonly alpha: number }[] = [];\n    for (const zone of value.zones) {\n        if (layerHidden(zone.key)) continue;   // zone in a hidden layer\n        const geom = getSomeorUndefined(zone.geometry);\n        if (!bboxOverlaps(zoneWorldBbox(zone, geom), viewBbox)) continue;\n        const pattern = zone.pattern;\n        // Its colour token, else its tone, else its pattern's (§4.2); as context, drained to its ground (#1392).\n        const tint = desatOf(zone.key) ? css(p.borderStrong) : tintOf(zone.key, p.borderStrong);\n        // A zone is unfilled unless its `fillOpacity` says how much: then it is filled in its tint.\n        const zFillAlpha = getSomeorUndefined(zone.fillOpacity);\n        const zWeight = getSomeorUndefined(zone.weight);\n        const x = wx(zone.x), y = wy(zone.y), w = zone.width * ppu, h = zone.height * ppu;\n        const anchor = zoneAnchor(zone);\n        // Its whole drawing faded as context, each alpha of its own times it.\n        const za = contextAlpha(zone.key);\n        ctx.save();\n        ctx.globalAlpha = za;\n        // Its shape's path, in screen space: its circle, its polygon, or its box.\n        const traceShape = () => {\n            ctx.beginPath();\n            if (geom !== undefined && geom.type === \"circle\") {\n                ctx.arc(x + w / 2, y + h / 2, geom.value.radius * ppu, 0, Math.PI * 2);\n            } else if (geom !== undefined && geom.type === \"polygon\") {\n                traceVertices(ctx, placedVertices(anchor, geom.value.vertices).map(q => ({ x: wx(q.x), y: wy(q.y), bulge: q.bulge })), true);\n            } else {\n                ctx.rect(x, y, w, h);\n            }\n        };\n        const fillShape = () => {\n            if (zFillAlpha === undefined) return;\n            ctx.save();\n            ctx.globalAlpha = zFillAlpha * za;\n            ctx.fillStyle = tint;\n            ctx.fill();\n            ctx.restore();\n        };\n\n        if (geom !== undefined && geom.type !== \"rect\") {\n            if (geom.type === \"circle\") {\n                ctx.beginPath();\n                ctx.arc(x + w / 2, y + h / 2, geom.value.radius * ppu, 0, Math.PI * 2);\n                fillShape();\n                ctx.setLineDash([4, 3]);\n                ctx.lineWidth = zWeight ?? 1;\n                ctx.strokeStyle = tint;\n                ctx.stroke();\n                ctx.setLineDash([]);\n            } else {\n                const pts = placedVertices(anchor, geom.value.vertices).map(q => ({ x: wx(q.x), y: wy(q.y), bulge: q.bulge }));\n                if (pts.length > 0) {\n                    ctx.beginPath();\n                    if (geom.type === \"polygon\") {\n                        traceVertices(ctx, pts, true);\n                        fillShape();\n                        ctx.setLineDash([4, 3]);\n                        ctx.lineWidth = zWeight ?? 1;\n                        ctx.strokeStyle = tint;\n                        ctx.stroke();\n                        ctx.setLineDash([]);\n                    } else {\n                        traceVertices(ctx, pts, false);\n                        const band = geom.value.width.type === \"some\" ? geom.value.width.value * ppu : undefined;\n                        ctx.setLineDash([]);\n                        ctx.lineCap = \"round\";\n                        ctx.lineWidth = zWeight ?? band ?? 1.5;\n                        ctx.save();\n                        ctx.globalAlpha = 0.55 * za;\n                        ctx.strokeStyle = tint;\n                        ctx.stroke();\n                        ctx.restore();\n                        ctx.lineCap = \"butt\";\n                    }\n                }\n            }\n        } else if (pattern.type === \"hatch\") {\n            // `spacing` floored at 1 so the sweep always advances (no hang on\n            // `spacing: 0`/negative — issue #57, P3).\n            const spacing = hatchSpacing(getSomeorUndefined(pattern.value.spacing) ?? 8);\n            const angle = (getSomeorUndefined(pattern.value.angle) ?? 45) * Math.PI / 180;\n            ctx.save();\n            ctx.beginPath();\n            ctx.rect(x, y, w, h);\n            ctx.clip();\n            if (zFillAlpha !== undefined) {\n                ctx.save();\n                ctx.globalAlpha = zFillAlpha * za;\n                ctx.fillStyle = tint;\n                ctx.fillRect(x, y, w, h);\n                ctx.restore();\n            }\n            ctx.globalAlpha = 0.3 * za;\n            ctx.strokeStyle = tint;\n            ctx.lineWidth = zWeight ?? 1;\n            const dx = Math.cos(angle), dy = Math.sin(angle);\n            const diag = Math.hypot(w, h);\n            // Bound the sweep to the offsets whose line reaches the on-screen\n            // portion of the zone — phase-locked to the full sweep's grid so the\n            // visible hatch is identical, just cheaper (issue #57, 1e).\n            const { oStart, oEnd } = hatchSweepBounds(x, y, w, h, width, height, dx, dy, diag, spacing);\n            ctx.beginPath();\n            for (let o = oStart; o < oEnd; o += spacing) {\n                ctx.moveTo(x + o, y - diag * dy);\n                ctx.lineTo(x + o + dx * 2 * diag, y - diag * dy + dy * 2 * diag);\n            }\n            ctx.stroke();\n            ctx.restore();\n        } else {\n            if (zFillAlpha !== undefined) {\n                ctx.save();\n                ctx.globalAlpha = zFillAlpha * za;\n                ctx.fillStyle = tint;\n                ctx.fillRect(x, y, w, h);\n                ctx.restore();\n            }\n            ctx.setLineDash([5, 4]);\n            ctx.lineWidth = zWeight ?? 1;\n            ctx.strokeStyle = tint;\n            ctx.strokeRect(x, y, w, h);\n            ctx.setLineDash([]);\n        }\n\n        // Selected-zone highlight (#177): the brand's area fill — the design\n        // system's `brandTint` at 0.7 — and a solid 2px `brand.solid` stroke\n        // over the zone's actual shape, drawn above its pattern.\n        if (selectedZones?.has(zone.key) ?? false) {\n            ctx.save();\n            traceShape();\n            ctx.globalAlpha = 0.7 * za;\n            ctx.fillStyle = css(p.brandTint);\n            ctx.fill();\n            ctx.globalAlpha = za;\n            ctx.setLineDash([]);\n            ctx.lineWidth = 2;\n            ctx.strokeStyle = css(p.brandSolid);\n            ctx.stroke();\n            ctx.restore();\n        }\n\n        // The zone a card's drop lands on (#1390): the brand's wash, under a dashed brand edge — a selection's is solid.\n        if (dropOn === zone.key) {\n            ctx.save();\n            traceShape();\n            ctx.globalAlpha = 0.5 * za;\n            ctx.fillStyle = css(p.brandTint);\n            ctx.fill();\n            ctx.globalAlpha = za;\n            ctx.setLineDash([6, 4]);\n            ctx.lineWidth = 2;\n            ctx.strokeStyle = css(p.brandSolid);\n            ctx.stroke();\n            ctx.setLineDash([]);\n            ctx.restore();\n        }\n\n        // A matched zone's emphasis (#1392): the brand's mark rings its edge.\n        if (emphasised(zone.key)) {\n            ctx.save();\n            traceShape();\n            ctx.setLineDash([]);\n            ctx.lineWidth = 2 + ringGrow;\n            ctx.strokeStyle = css(p.brandMark, ringAlpha);\n            ctx.stroke();\n            ctx.restore();\n        }\n\n        // Its eyebrow on its outline, at the point nearest its box's top-left — at that corner for a zone with no shape or\n        // a rect (#1546) — where its box has room: drawn over the dots, below. Its room, like the minimap's anchor and\n        // Fit's margin, is its box's.\n        if (w >= zone.label.length * 6.2 + 24) {\n            const at = zoneEyebrowAnchor(zone, geom);\n            eyebrows.push({ x: wx(at.x), y: wy(at.y), label: zone.label.toUpperCase(), alpha: za });\n        }\n        ctx.restore();\n    }\n\n    // ---- links and nets, in the shared links look (#1403) ------------------------\n    // Each routed between the items it joins, its ends on their edges where they\n    // draw at the zoom; culled by the box over every item it joins and its bends,\n    // so one whose ends sit off screen but which crosses it draws (issue #57, 1e).\n    // Parallel links (#180) fan into lanes, so N runs of one pair read as N.\n    const lanes = parallelLanes(value.links, l =>\n        !layerHidden(l.key) && centers.has(l.from) && centers.has(l.to) && l.via.length === 0);\n    const itemsById = new Map(value.items.map((item) => [item.key, item] as const));\n    // A pin's label, measured in the pins' font, as the marker pass and a tap measure it.\n    const measure = (text: string): number => {\n        ctx.save();\n        ctx.font = p.labelFont;\n        ctx.textRendering = \"optimizeSpeed\";\n        const w = ctx.measureText(unjoined(text)).width;\n        ctx.restore();\n        return w;\n    };\n    const env = routeEnv({ cam, centers, items: itemsById, tiers, cardSizes: input.cardSizes, lanes, measure });\n    const edges: { readonly drawn: DrawnLink | DrawnNet; readonly net: boolean; readonly geometry: EdgeGeometry }[] = [];\n    for (const link of value.links) {\n        if (layerHidden(link.key)) continue;   // a link in a hidden layer\n        const from = centers.get(link.from), to = centers.get(link.to);\n        if (!from || !to) continue;   // an end hidden (a layer, or the narrowing): no centre\n        const box = pointsBbox([from, ...link.via, to]);\n        if (box !== null && !bboxOverlaps(box, viewBbox)) continue;\n        const geometry = linkRoutes(link, env);\n        if (geometry !== undefined) edges.push({ drawn: link, net: false, geometry });\n    }\n    // A net (#189): one entity, many members — a hidden member drops its leg, and the whole net goes while a side has\n    // none drawn or its layer is hidden. Culled by the box its bus spans (`netBox`), a bar standing off its members\n    // among it, which the links' R-tree files it under too: it draws, and takes a tap, wherever its bus is (invariant 9).\n    for (const net of value.nets) {\n        if (layerHidden(net.key)) continue;\n        const box = netBox(net, centers);\n        if (box === null || !bboxOverlaps(box, viewBbox)) continue;\n        const geometry = netRoutes(net, env);\n        if (geometry !== undefined) edges.push({ drawn: net, net: true, geometry });\n    }\n    // Under every line: a match's emphasis — the brand's mark, wide (#1392) — and where a card's drop lands, the\n    // brand's wash (#1390), along each run to its head's tip.\n    const underline = (geometry: EdgeGeometry, width: number, style: string, alpha: number) => {\n        ctx.save();\n        ctx.globalAlpha = alpha;\n        ctx.setLineDash([]);\n        ctx.lineCap = \"round\";\n        ctx.lineJoin = \"round\";\n        ctx.lineWidth = width;\n        ctx.strokeStyle = style;\n        for (const run of geometry.runs) {\n            ctx.beginPath();\n            traceRoute(ctx, run.route, run.corner);\n            ctx.stroke();\n        }\n        ctx.restore();\n    };\n    for (const edge of edges) {\n        const key = edge.drawn.key, weight = edgeWeight(edge.drawn.style);\n        if (emphasised(key)) underline(edge.geometry, weight + (edge.net ? 5 : 4) + ringGrow, css(p.brandMark, ringAlpha), contextAlpha(key));\n        if (dropOn === key) underline(edge.geometry, weight + 10, css(p.brandSolid, 0.3), contextAlpha(key));\n    }\n    // Each caption — a link's label and its metric — at its route's middle, from the label zoom, kept inside the\n    // canvas and stepped clear of an earlier one (`placeCaptions`).\n    const captions = new Map<string, RibbonCaption>();\n    if (ppu >= LINK_LABEL_MIN_PPU) {\n        for (const edge of edges) {\n            const text = captionText(getSomeorUndefined(edge.drawn.label), getSomeorUndefined(edge.drawn.metric));\n            const middle = edge.geometry.middle;\n            if (text !== undefined && middle !== undefined) captions.set(edge.drawn.key, { label: text, lx: middle.x, ly: middle.y + LINK_CAPTION_DROP });\n        }\n        placeCaptions([...captions.values()], 0, width);\n    }\n    // The links as the shared painter draws them: the muted ink — or its style's tone, drained as context — cased in\n    // the paper; the selected one, then the lit one, in the strong ink, their ends ringed; a net's selected leg in the\n    // strong ink; a retarget's link its `was` line while its end is dragged. Standing in for a new narrowing, each\n    // caption's words draw in the third ink, its line as it is (#1398).\n    const look = input.stale === true ? { ...p.links, caption: css(p.fgMuted) } : p.links;\n    const selectedLeg = selectedLink?.leg;\n    paintLinks(ctx, edges.map(({ drawn, geometry }): CanvasLink => {\n        const key = drawn.key;\n        const moved = input.was === key;\n        const selected = !moved && selectedLink !== undefined && selectedLink.key === key && selectedLeg === undefined;\n        const lit = !moved && input.lit === key;\n        const tint = tints.get(key);\n        // A leg to an item drawn as context fades with it, the net itself drawing as itself (#1392); the net's selected leg is strong.\n        const own = (leg: EdgeRun[\"leg\"]) => {\n            const faded = leg !== undefined && isExcluded(leg.item) && !isExcluded(key);\n            const strong = selectedLeg !== undefined && selectedLink?.key === key && leg !== undefined && leg.end === selectedLeg.end && leg.item === selectedLeg.item;\n            return {\n                ...(faded ? { alpha: effect!.excludedOpacity, ...(effect!.excludedDesaturate ? { ink: look.ink } : {}) } : {}),\n                ...(strong ? { strong: true } : {}),\n            };\n        };\n        const caption = captions.get(key);\n        return {\n            id: key,\n            strokes: geometry.runs.map((run) => ({ points: run.line, width: moved ? look.wasWidth : run.width, corner: run.corner, ...own(run.leg) })),\n            heads: geometry.runs.flatMap((run) => (run.head === undefined ? [] : [{ ...run.head, ...own(run.leg) }])),\n            dots: geometry.dots,\n            dash: drawn.style.type === \"dashed\" ? [6, 5] : [],\n            ink: moved ? look.was : desatOf(key) || tint === undefined ? undefined : css(tint),\n            alpha: contextAlpha(key),\n            lit, selected,\n            ends: lit || selected ? geometry.ends : [],\n            caption: caption === undefined || caption.label === undefined ? undefined : { text: caption.label, x: caption.lx, y: caption.ly },\n        };\n    }), look);\n    // A selected link's handles (#176, SC10), over it at its ends' edges, while it writes: a press there that moves\n    // retargets that end.\n    if (selectedLink?.editable === true) {\n        const handles = edges.find((edge) => edge.drawn.key === selectedLink.key)?.geometry.handles;\n        if (handles !== undefined) {\n            ctx.save();\n            for (const q of [handles.from, handles.to]) {\n                ctx.beginPath();\n                ctx.arc(q.x, q.y, 5, 0, Math.PI * 2);\n                ctx.fillStyle = css(p.bgSurface);\n                ctx.fill();\n                ctx.lineWidth = 2;\n                ctx.strokeStyle = css(p.brandSolid);\n                ctx.stroke();\n            }\n            ctx.restore();\n        }\n    }\n\n    // ---- connect-tool overlays (#176): the draft edge and the flash ----------\n    // Drawn above real links, below the narrowing's frame and rings and the\n    // markers. Routed through the SAME orthogonal painter as real links (shape\n    // constraints). A Connect session's links and its net are drafts the\n    // drawing holds (#1388), drawn as the links and nets they are.\n    const routeScreen = (a: Pt, b: Pt): Pt[] =>\n        orthogonalize([{ x: wx(a.x), y: wy(a.y) }, { x: wx(b.x), y: wy(b.y) }]);\n    if (draftLink !== undefined) {\n        // The shared drag preview (#1403): the brand's line from the item the draft runs from — off its edge — to the\n        // pointer, or to the item it snaps to, onto its edge, with a head. A canConnect veto turns it DANGER, and rings\n        // the forbidden marker (a card's ring is the recipe's `data-forbidden`; here the dot and label tiers').\n        const vetoed = draftLink.forbiddenKey !== undefined;\n        const ink = vetoed ? css(p.statusNeg) : look.preview;\n        const fromShape = env.shapeOf(draftLink.fromKey);\n        const toShape = draftLink.snapped && draftLink.toKey !== undefined ? env.shapeOf(draftLink.toKey) : undefined;\n        let route = routeScreen(draftLink.from, draftLink.to);\n        if (fromShape !== undefined) route = leaveShape(route, fromShape);\n        if (toShape !== undefined) route = meetShape(route, toShape);\n        const arrived = arrive(route, look.previewWidth);\n        ctx.save();\n        if (arrived !== undefined) {\n            ctx.setLineDash([]);\n            ctx.lineJoin = \"round\";\n            ctx.lineCap = \"butt\";\n            ctx.lineWidth = look.previewWidth;\n            ctx.strokeStyle = ink;\n            ctx.beginPath();\n            traceRoute(ctx, arrived.line, LINK_CORNER);\n            ctx.stroke();\n            ctx.fillStyle = ink;\n            ctx.beginPath();\n            traceHead(ctx, arrived.head);\n            ctx.fill();\n        }\n        if (vetoed) {\n            const fc = centers.get(draftLink.forbiddenKey!);\n            const tier = tiers.get(draftLink.forbiddenKey!) ?? \"dot\";\n            if (fc !== undefined && tier !== \"card\") {\n                const r = (tier === \"label\" ? 18 : 11) + 4;\n                ctx.beginPath();\n                ctx.arc(wx(fc.x), wy(fc.y), r, 0, Math.PI * 2);\n                ctx.lineWidth = 2;\n                ctx.strokeStyle = css(p.statusNeg, 0.75);\n                ctx.stroke();\n            }\n        }\n        ctx.restore();\n    }\n    if (connectFlash !== undefined && connectFlash.from !== undefined && connectFlash.to !== undefined) {\n        const t = connectFlash.phase;\n        const pts = routeScreen(connectFlash.from, connectFlash.to);\n        ctx.save();\n        ctx.lineCap = \"round\";\n        // Draw-in: the dash offset sweeps the edge; the whole flash fades out.\n        ctx.setLineDash([10, 6]);\n        ctx.lineDashOffset = -t * 32;\n        ctx.lineWidth = 3;\n        ctx.strokeStyle = css(p.brandSolid, 0.9 * (1 - t));\n        ctx.beginPath();\n        traceRounded(ctx, pts, 8);\n        ctx.stroke();\n        // Endpoint pulse rings expand + fade on BOTH items.\n        ctx.setLineDash([]);\n        for (const q of [pts[0]!, pts[pts.length - 1]!]) {\n            ctx.beginPath();\n            ctx.arc(q.x, q.y, 6 + t * 12, 0, Math.PI * 2);\n            ctx.lineWidth = 2;\n            ctx.strokeStyle = css(p.brandMark, 0.8 * (1 - t));\n            ctx.stroke();\n        }\n        ctx.restore();\n    }\n\n    // ---- the narrowing (#1392): frame the matches, then ring the matched items ---\n    // Drawn between links and items so the frame sits under the markers and the\n    // emphasis rings glow behind them. Card-tier emphasis is a DOM concern (the\n    // React layer styles the card element); here we ring only dot / label markers.\n    // A zone's, a link's and a net's are drawn with them, above.\n    if (effect !== undefined) {\n        if (effect.frame !== undefined) {\n            const pad = 10;\n            const fx = wx(effect.frame.minX) - pad, fy = wy(effect.frame.minY) - pad;\n            const fw = (effect.frame.maxX - effect.frame.minX) * ppu + pad * 2;\n            const fh = (effect.frame.maxY - effect.frame.minY) * ppu + pad * 2;\n            ctx.save();\n            ctx.beginPath();\n            ctx.rect(fx, fy, fw, fh);\n            ctx.globalAlpha = 0.7;\n            ctx.fillStyle = css(p.brandTint);\n            ctx.fill();\n            ctx.restore();\n            ctx.save();\n            ctx.setLineDash([7, 5]);\n            ctx.lineWidth = 1.5;\n            ctx.strokeStyle = css(p.brandSolid);\n            ctx.strokeRect(fx, fy, fw, fh);\n            ctx.setLineDash([]);\n            ctx.restore();\n        }\n        if (effect.emphasis !== undefined) {\n            for (const item of visibleItems) {\n                if (!effect.matches.has(item.key)) continue;           // matched only\n                const tier = tiers.get(item.key) ?? \"dot\";\n                if (tier === \"card\") continue;                         // card ring is CSS\n                const baseR = tier === \"label\" ? 18 : 11;\n                ctx.save();\n                ctx.beginPath();\n                ctx.arc(wx(item.x), wy(item.y), baseR + ringGrow, 0, Math.PI * 2);\n                ctx.lineWidth = 2;\n                ctx.strokeStyle = css(p.brandMark, ringAlpha);\n                ctx.stroke();\n                ctx.restore();\n            }\n        }\n    }\n\n    // ---- the conflicts' rings: 1px of warn at the edge of each marker holding a conflict not yet chosen, and a soft\n    // glow, as a card's CSS draws its own: round a dot, the edge it draws; round a labelled pin, its pill's border. ----\n    const conflicted = input.conflicted;\n    if (conflicted !== undefined && conflicted.size > 0) {\n        ctx.save();\n        ctx.font = p.labelFont;\n        ctx.textRendering = \"optimizeSpeed\";\n        ctx.lineWidth = 1;\n        ctx.strokeStyle = css(p.statusWarn);\n        ctx.shadowColor = css(p.statusWarn, 0.45);\n        ctx.shadowBlur = 8;\n        for (const item of visibleItems) {\n            if (!conflicted.has(item.key)) continue;\n            const tier = tiers.get(item.key) ?? \"dot\";\n            if (tier === \"card\") continue;\n            ctx.beginPath();\n            if (tier === \"dot\") {\n                ctx.arc(wx(item.x), wy(item.y), dotDrawnRadius(item) + 0.5, 0, Math.PI * 2);\n            } else {\n                const box = markerHitbox(item, \"label\", cam, (t) => ctx.measureText(unjoined(t)).width);\n                if (box.kind !== \"rect\") continue;\n                if (ctx.roundRect) ctx.roundRect(box.left - 1, box.top - 1, box.w + 2, box.h + 2, box.h / 2 + 1);\n                else ctx.rect(box.left - 1, box.top - 1, box.w + 2, box.h + 2);\n            }\n            ctx.stroke();\n        }\n        ctx.restore();\n    }\n\n    // ---- item footprints (close zoom only — semantic zoom) ------------------\n    // Wrapped in save/restore per item so a footprint drawn as context can fade\n    // (globalAlpha) / desaturate (grey tint) without leaking state to the next.\n    for (const item of visibleItems) {\n        const footprint = getSomeorUndefined(item.footprint);\n        if (footprint === undefined || footprint.type === \"rect\") continue;\n        if ((tiers.get(item.key) ?? \"dot\") !== \"card\") continue;\n        const isSel = selected.has(item.key);\n        // Its status unread, its colour is the placeholders' fill, once revealed; unseen before (#1398).\n        const unread = statusUnread(item);\n        if (unread && !placeholders) continue;\n        // Its colour token, else its tone, else its status's — the colour its card's dot is.\n        let tint = unread ? css(p.bgSubtle) : tintOf(item.key, p.fgMuted);\n        if (desatOf(item.key)) tint = css(p.fgMuted);\n        const a = alphaOf(item.key);\n        const fillAlpha = getSomeorUndefined(item.fillOpacity) ?? (isSel ? 0.24 : 0.12);\n        const stroke = getSomeorUndefined(item.weight) ?? (isSel ? 2.5 : 1.5);\n        const fillShape = () => {\n            ctx.save();\n            ctx.globalAlpha = fillAlpha * a;\n            ctx.fillStyle = tint;\n            ctx.fill();\n            ctx.restore();\n        };\n\n        ctx.save();\n        ctx.globalAlpha = a;\n        if (footprint.type === \"circle\") {\n            ctx.beginPath();\n            ctx.arc(wx(item.x), wy(item.y), footprint.value.radius * ppu, 0, Math.PI * 2);\n            fillShape();\n            ctx.lineWidth = stroke;\n            ctx.strokeStyle = tint;\n            ctx.stroke();\n        } else {\n            const pts = placedVertices(item, footprint.value.vertices).map(q => ({ x: wx(q.x), y: wy(q.y), bulge: q.bulge }));\n            if (pts.length > 0) {\n                ctx.beginPath();\n                if (footprint.type === \"polygon\") {\n                    traceVertices(ctx, pts, true);\n                    fillShape();\n                    ctx.lineWidth = stroke;\n                } else {\n                    traceVertices(ctx, pts, false);\n                    const band = footprint.value.width.type === \"some\" ? footprint.value.width.value * ppu : undefined;\n                    ctx.lineCap = \"round\";\n                    ctx.lineWidth = getSomeorUndefined(item.weight) ?? band ?? (isSel ? 2.5 : 1.5);\n                }\n                ctx.strokeStyle = tint;\n                ctx.stroke();\n                ctx.lineCap = \"butt\";\n            }\n        }\n        ctx.restore();\n    }\n\n    // ---- item LOD markers: dots + labelled pins (cards are DOM) --------------\n    // The dots not selected draw in batches (#1393), one path a look — its style, its line's width and its alpha — never\n    // a save, a fill and a stroke a dot, as thousands land at the dots' zoom: first every dot's paper — a filled dot's\n    // ring of it, an open dot's inside — then every dot's colour — a filled dot's, within its ring, and an open dot's\n    // ring — so no dot's paper covers a neighbour's colour (ruled 26 Oct 2026, \"Legible dots\"). Dots packed closer than\n    // their paper reaches — a hall's racks at Fit, a metre or two apart — read as their colours, the paper showing only\n    // between them, never merging into a block of it; a dot on its own draws as it ever did. The colours draw a layer at\n    // a time, by the severity of the colour each is drawn in (`DOT_LAYERS`, `drawnSeverity`): context under a status\n    // unread, under a colour of no severity, under success, neutral, info, warning and danger, so packed dots overlap\n    // with the worst colour drawn on top, never in the order they came in. Then each zone's eyebrow, over the dots, so a\n    // hall they pack keeps its name. A pin draws on its own, its save and restore keeping its fade and its font from the\n    // next; and what is selected draws last, over its neighbours, each on its own: the declutter keeps every other pin\n    // clear of every mark, but a selected item takes its form whatever it covers. The marker a card's drop lands on\n    // draws on its own too, its ring about it. Its tint — its status unread (#1398), the placeholders' fill; drained as\n    // context, the muted ink — each colour's words made once a frame. The order is the plan's (`planMarkers`), which a\n    // tap finds the marker drawn on top by (invariant 9).\n    const surface = css(p.bgSurface), muted = css(p.fgMuted);\n    const plan = planMarkers(input);\n    ctx.save();\n    paintDots(ctx, plan.paperInsides, \"fill\", MARKER_DOT_RADIUS);\n    paintDots(ctx, plan.paperRings, \"stroke\", MARKER_DOT_RADIUS);\n    for (const colour of plan.layers) {\n        paintDots(ctx, colour.fills, \"fill\", DOT_COLOUR_RADIUS);\n        paintDots(ctx, colour.rings, \"stroke\", MARKER_DOT_RADIUS);\n    }\n    ctx.restore();\n    // Each zone's eyebrow, over the dots, in the mono face: its words in the third ink on the canvas's paper.\n    for (const brow of eyebrows) {\n        ctx.save();\n        ctx.globalAlpha = brow.alpha;\n        ctx.font = p.eyebrowFont;\n        ctx.textRendering = \"optimizeSpeed\";\n        const label = unjoined(brow.label);\n        const tw = ctx.measureText(label).width;\n        ctx.fillStyle = css(p.bgCanvas);\n        ctx.fillRect(brow.x + 6, brow.y - 7, tw + 6, 12);\n        ctx.fillStyle = muted;\n        ctx.textBaseline = \"middle\";\n        ctx.fillText(label, brow.x + 9, brow.y);\n        ctx.restore();\n    }\n    for (const item of plan.alone) {\n        const tier = tiers.get(item.key) ?? \"dot\";\n        // Its status unread (#1398): its dot in the placeholders' fill once revealed, unseen before — never a status.\n        const unread = statusUnread(item);\n        const tint = plan.tintOf(item, unread);\n        const isSel = selected.has(item.key);\n        const x = wx(item.x), y = wy(item.y);\n\n        ctx.save();\n        ctx.globalAlpha = alphaOf(item.key);\n        const ring = statusRing(item.status);\n        if (tier === \"dot\") {\n            if (!unread || placeholders) {\n                ctx.beginPath();\n                ctx.arc(x, y, MARKER_DOT_RADIUS, 0, Math.PI * 2);\n                // A ring status — a tentative one — is an open ring in its tone; any other a filled dot.\n                ctx.fillStyle = ring ? surface : tint;\n                ctx.fill();\n                ctx.lineWidth = ring ? DOT_RING_PX : DOT_PAPER_PX;\n                ctx.strokeStyle = ring ? tint : surface;\n                ctx.stroke();\n            }\n            if (isSel) {\n                ctx.beginPath();\n                ctx.arc(x, y, 7.5, 0, Math.PI * 2);\n                ctx.lineWidth = 2;\n                ctx.strokeStyle = css(p.fg);\n                ctx.stroke();\n            }\n        } else {\n            // labelled pin — bounds and words come from the SHARED markerHitbox so the\n            // drawn pill and the click target are identical (issue #57, P11), a long\n            // label cut before an ellipsis (#1393).\n            ctx.font = p.labelFont;\n            ctx.textRendering = \"optimizeSpeed\";\n            const box = markerHitbox(item, \"label\", cam, t => ctx.measureText(unjoined(t)).width);\n            if (box.kind === \"rect\") {\n                const { left, top, w, h, text } = box;\n                ctx.beginPath();\n                ctx.roundRect?.(left, top, w, h, h / 2);\n                if (!ctx.roundRect) ctx.rect(left, top, w, h);\n                ctx.fillStyle = surface;\n                ctx.fill();\n                ctx.lineWidth = 1;\n                ctx.strokeStyle = isSel ? css(p.fg) : css(p.borderStrong);\n                ctx.stroke();\n                // Its dot on its item's point — its status unread, the placeholders' fill once revealed, unseen before.\n                if (!unread || placeholders) {\n                    ctx.beginPath();\n                    ctx.arc(x, y, ring ? PIN_DOT_W / 2 - 0.75 : PIN_DOT_W / 2, 0, Math.PI * 2);\n                    if (ring) {\n                        ctx.lineWidth = 1.5;\n                        ctx.strokeStyle = tint;\n                        ctx.stroke();\n                    } else {\n                        ctx.fillStyle = tint;\n                        ctx.fill();\n                    }\n                }\n                ctx.fillStyle = wordsInk;\n                ctx.textBaseline = \"middle\";\n                ctx.fillText(unjoined(text), left + PIN_PAD_X + PIN_DOT_W + PIN_GAP, y);\n            }\n        }\n        ctx.restore();\n        // The marker a card's drop lands on (#1390): a brand ring about it, wider than a selection's.\n        if (dropOn === item.key) {\n            ctx.save();\n            ctx.beginPath();\n            ctx.arc(x, y, (tier === \"label\" ? 18 : 11) + 4, 0, Math.PI * 2);\n            ctx.lineWidth = 2.5;\n            ctx.strokeStyle = css(p.brandSolid);\n            ctx.stroke();\n            ctx.restore();\n        }\n    }\n\n    // ---- where a template's item or a backlog row lands (#1390) --------------\n    // A ring at the drop point, over every marker: the item's centre once it lands.\n    if (dropMark?.kind === \"point\") {\n        const x = wx(dropMark.x), y = wy(dropMark.y);\n        ctx.save();\n        ctx.beginPath();\n        ctx.arc(x, y, 8, 0, Math.PI * 2);\n        ctx.lineWidth = 2;\n        ctx.strokeStyle = css(p.brandSolid);\n        ctx.stroke();\n        ctx.beginPath();\n        ctx.arc(x, y, 2.5, 0, Math.PI * 2);\n        ctx.fillStyle = css(p.brandSolid);\n        ctx.fill();\n        ctx.restore();\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Pure selection logic for the Schematic renderer — the marquee hit\n * collection (#159), and the link or the net under a point (#1403): the links'\n * R-tree, which a pointer's hover, a tap and a drop search, so what they cost\n * is what is near the point, never every link. React-free and DOM-free so every\n * rule the interaction layer relies on is unit-testable in a `node`\n * environment (see `selection.test.ts`), mirroring the `camera.ts` /\n * `paint.ts` split.\n *\n * @packageDocumentation\n */\n\nimport RBush from \"rbush\";\nimport { LINK_HIT_REACH } from \"../../shared/links/look.js\";\nimport type { NetLeg } from \"../edits.js\";\nimport { pointsBbox } from \"./camera\";\nimport { type DrawnItem, type DrawnLink, type DrawnNet } from \"./drawn\";\nimport { LINK_LANE_GAP, distanceToPolyline, edgeWeight, netBox, type EdgeGeometry } from \"./routes\";\n\n/** An axis-aligned world-space box over an item, as stored in the culling R-tree. */\nexport interface ItemBox { minX: number; minY: number; maxX: number; maxY: number; item: DrawnItem }\n\n/** Shared empty key set (stable identity — never churns memos / paint dedup). */\nexport const EMPTY_STRING_SET: ReadonlySet<string> = new Set();\n\n/**\n * Collect the items a marquee region selects: an R-tree sweep, then a\n * CENTER-in-region test (the index boxes are padded for culling, so bare\n * overlap would over-select), skipping locked items and narrowed-out items\n * drawn dimmed (context, not targets). Layer-hidden items never reach the tree.\n *\n * @param tree - the world-space culling R-tree over the working item set\n * @param region - the swept world rectangle\n * @param lockedKeys - keys in a locked layer (non-selectable)\n * @param excludedKeys - narrowed-out keys drawn dimmed (non-selectable)\n * @returns the selected item keys\n */\nexport function marqueeHits(\n    tree: RBush<ItemBox>,\n    region: { minX: number; minY: number; maxX: number; maxY: number },\n    lockedKeys: ReadonlySet<string>,\n    excludedKeys: ReadonlySet<string>,\n): Set<string> {\n    const hits = new Set<string>();\n    for (const b of tree.search(region)) {\n        const k = b.item.key;\n        if (lockedKeys.has(k)) continue;\n        if (excludedKeys.has(k)) continue;\n        if (b.item.x < region.minX || b.item.x > region.maxX || b.item.y < region.minY || b.item.y > region.maxY) continue;\n        hits.add(k);\n    }\n    return hits;\n}\n\n/** A link's or a net's world box in the links' R-tree, by its id. */\nexport interface LinkBox { minX: number; minY: number; maxX: number; maxY: number; id: string }\n\n/** The links' and the nets' R-tree, and how far past a box its link's drawn route reaches, at most. */\nexport interface LinkIndex {\n    /** Each link's and net's world box: the centres of the items it joins drawn, and its bends. */\n    readonly tree: RBush<LinkBox>;\n    /** How far past its box a link's route takes the pointer, at most: its lane, half its weight and the hit reach (px). */\n    readonly reach: number;\n}\n\n/**\n * The links' R-tree (#1403): each link's world box over the centres of the\n * items it joins drawn and its bends, and each net's over its bus as well\n * (`netBox`: a bar standing off its side, past every member) — its route runs\n * inside it, but for its lane and its weight, which the search reaches past\n * ({@link LinkIndex}'s `reach`). A link on a hidden layer, or one an item it\n * joins isn't drawn for, is left out, as the painter leaves it out.\n *\n * @param links - The links\n * @param nets - The nets\n * @param centers - Each item drawn's centre, by its id\n * @param hidden - What a hidden layer holds, by id\n * @param lanes - The links' lanes (`parallelLanes`)\n * @returns The index\n */\nexport function linkIndex(\n    links: readonly DrawnLink[], nets: readonly DrawnNet[], centers: ReadonlyMap<string, { x: number; y: number }>, hidden: ReadonlySet<string>,\n    lanes: ReadonlyMap<string, { i: number; n: number }>,\n): LinkIndex {\n    const boxes: LinkBox[] = [];\n    let half = 0;\n    for (const link of links) {\n        const from = centers.get(link.from), to = centers.get(link.to);\n        if (hidden.has(link.key) || from === undefined || to === undefined) continue;\n        const box = pointsBbox([from, ...link.via, to]);\n        if (box !== null) boxes.push({ ...box, id: link.key });\n        half = Math.max(half, edgeWeight(link.style) / 2);\n    }\n    for (const net of nets) {\n        if (hidden.has(net.key)) continue;\n        // Its bus as the painter draws it, not its members alone: a tap on a bar standing off them finds it (invariant 9).\n        const box = netBox(net, centers);\n        if (box === null) continue;\n        boxes.push({ ...box, id: net.key });\n        half = Math.max(half, (edgeWeight(net.style) + 1) / 2);\n    }\n    let lane = 0;\n    for (const { i, n } of lanes.values()) lane = Math.max(lane, Math.abs(i - (n - 1) / 2) * LINK_LANE_GAP);\n    const tree = new RBush<LinkBox>();\n    tree.load(boxes);\n    return { tree, reach: lane + half + LINK_HIT_REACH };\n}\n\n/**\n * The link or the net under a point, and the net's leg it is on (#1403): of\n * those whose boxes the R-tree holds near the point, the nearest whose drawn\n * route — each run to its head's tip — the point lies within its weight and the\n * hit reach of; a net's trunk and bars are the whole net, a leg its leg. Only\n * those near the point have their routes asked.\n *\n * @param index - The links' R-tree\n * @param routeOf - A link's or a net's drawing, by its id, as the painter draws it\n * @param world - The point, in world units\n * @param screen - The point, in the canvas's px\n * @param ppu - The camera's px a world unit\n * @param takes - Whether a link, or a net's leg, takes the point: none locked, none the narrowing leaves out\n * @returns The link or the net, and its leg; `undefined` for none\n */\nexport function linkAt(\n    index: LinkIndex, routeOf: (id: string) => EdgeGeometry | undefined, world: { x: number; y: number }, screen: { x: number; y: number }, ppu: number,\n    takes: (id: string, leg: NetLeg | null) => boolean,\n): { key: string; leg: NetLeg | null } | undefined {\n    const r = ppu > 0 ? index.reach / ppu : 0;\n    let best: { key: string; leg: NetLeg | null } | undefined;\n    let bestD = Infinity;\n    for (const box of index.tree.search({ minX: world.x - r, minY: world.y - r, maxX: world.x + r, maxY: world.y + r })) {\n        const geometry = routeOf(box.id);\n        if (geometry === undefined) continue;\n        for (const run of geometry.runs) {\n            const leg: NetLeg | null = run.leg === undefined ? null : run.leg;\n            if (!takes(box.id, leg)) continue;\n            const d = distanceToPolyline(run.route, screen.x, screen.y);\n            if (d <= run.width / 2 + LINK_HIT_REACH && d < bestD) { best = { key: box.id, leg }; bestD = d; }\n        }\n    }\n    return best;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * An entity's colour, as its roles name it (#1387, D14, SC26): an item's\n * colour token, else its tone, else its status's; a zone's colour token, else\n * its tone, else its pattern's; a link's or a net's style's tone — one whose\n * style names none draws in the shared links look's muted ink, which the theme\n * bridge reads from the links part (#1403); a layer's swatch its colour token,\n * else its tone (#1389). The\n * recipe's one chain of custom properties resolves it, for\n * the canvas — through the theme bridge's probe (`theme.tsx`) — and for an\n * item's card alike, so both draw one colour in each mode, and a value naming\n * no theme colour token draws the tone. This module only names what to\n * resolve: each entity's colour roles, the key they are resolved under, and\n * every colour a drawing needs. Pure, unit-tested in `tints.test.ts`.\n *\n * @packageDocumentation\n */\n\nimport { match, type option } from \"@elaraai/east\";\nimport type { RGB } from \"./paint\";\nimport type { DrawnItem, DrawnLink, DrawnNet, DrawnZone, SchematicDrawn } from \"./drawn\";\nimport type { SchematicLayerValue } from \"./layers\";\n\n/** An Option's value, or `undefined` — East's `match`, as paint.ts reads one: this module loads no renderer. */\nconst getSomeorUndefined = <T,>(opt: option<T>): T | undefined => match(opt, { some: (value) => value }, undefined);\n\n/**\n * An entity's colour roles, as the recipe's chain takes them from its data\n * attributes: its surface (whose ground colour is the last resort), its\n * colour token, its tone, its status's tone and its pattern's tone.\n */\nexport interface SchematicTint {\n    /** `item`, `zone` or `link` (a net's too): what its tone's `muted` and its ground are. */\n    readonly surface: \"item\" | \"zone\" | \"link\";\n    /** A theme colour token (`status.warn`, `heat.3`): drawn when the theme holds it, else its tone. */\n    readonly color?: string | undefined;\n    /** Its tone: brand, ink, muted, success, warning or danger. */\n    readonly tone?: string | undefined;\n    /** Its status's tone: success, warning, danger, info or neutral. */\n    readonly status?: string | undefined;\n    /** A zone's pattern's tone. */\n    readonly pattern?: string | undefined;\n}\n\n/**\n * An item's colour roles: its colour token, its tone, its status's — the\n * colour of its card's dot, its markers and its footprint.\n *\n * @param item - The item, as the canvas draws it\n * @returns Its colour roles\n */\nexport function itemTint(item: DrawnItem): SchematicTint {\n    const status = getSomeorUndefined(item.status);\n    return { surface: \"item\", color: getSomeorUndefined(item.color), tone: getSomeorUndefined(item.tone)?.type, status: status?.tone.type };\n}\n\n/**\n * A zone's colour roles: its colour token, its tone, its pattern's tone — muted\n * when its pattern names none (§4.2).\n *\n * @param zone - The zone, as the canvas draws it\n * @returns Its colour roles\n */\nexport function zoneTint(zone: DrawnZone): SchematicTint {\n    const pattern = getSomeorUndefined(zone.pattern.value.tone)?.type ?? \"muted\";\n    return { surface: \"zone\", color: getSomeorUndefined(zone.color), tone: getSomeorUndefined(zone.tone)?.type, pattern };\n}\n\n/**\n * A link's or a net's colour roles: its style's tone (#1403). A style naming\n * none has no colour of its own: it draws in the shared links look's muted ink,\n * as the Plan's and the Allocation's links do.\n *\n * @param edge - The link or the net, as the canvas draws it\n * @returns Its colour roles; `undefined` for a style naming no tone\n */\nexport function edgeTint(edge: DrawnLink | DrawnNet): SchematicTint | undefined {\n    const tone = getSomeorUndefined(edge.style.value.tone)?.type;\n    return tone === undefined ? undefined : { surface: \"link\", tone };\n}\n\n/**\n * A layer's swatch's colour roles, in the library's Layers tab (#1389, §8):\n * its colour token, else its tone, else an item's ground.\n *\n * @param layer - The layer\n * @returns Its colour roles\n */\nexport function layerTint(layer: SchematicLayerValue): SchematicTint {\n    return { surface: \"item\", color: getSomeorUndefined(layer.color), tone: getSomeorUndefined(layer.tone)?.type };\n}\n\n/**\n * The key a colour is resolved under: its roles, each in its place.\n *\n * @param tint - The colour roles\n * @returns Its key\n */\nexport function tintKey(tint: SchematicTint): string {\n    return JSON.stringify([tint.surface, tint.color ?? \"\", tint.tone ?? \"\", tint.status ?? \"\", tint.pattern ?? \"\"]);\n}\n\n/**\n * The data attributes the recipe's chain reads a colour from: what the\n * probe's element and an item's card dot carry.\n *\n * @param tint - The colour roles\n * @returns The attributes, each only when its role is given\n */\nexport function tintAttributes(tint: SchematicTint): Readonly<Record<string, string>> {\n    return {\n        \"data-surface\": tint.surface,\n        ...(tint.color === undefined ? {} : { \"data-color\": tint.color }),\n        ...(tint.tone === undefined ? {} : { \"data-tone\": tint.tone }),\n        ...(tint.status === undefined ? {} : { \"data-status\": tint.status }),\n        ...(tint.pattern === undefined ? {} : { \"data-pattern\": tint.pattern }),\n    };\n}\n\n/** Every colour a drawing draws its entities in, and each entity's. */\nexport interface SchematicTints {\n    /** Each colour, by its key, in the order the drawing first names it. */\n    readonly specs: ReadonlyMap<string, SchematicTint>;\n    /** Each entity's colour's key, by the entity's id. */\n    readonly byEntity: ReadonlyMap<string, string>;\n    /** The colours' keys, in order: equal whenever the drawing names the same colours. */\n    readonly signature: string;\n}\n\n/**\n * Every colour a drawing draws its entities in (see the module docs).\n *\n * @param drawn - What the canvas draws\n * @returns The colours, and each entity's\n */\nexport function tintsOf(drawn: SchematicDrawn): SchematicTints {\n    const specs = new Map<string, SchematicTint>();\n    const byEntity = new Map<string, string>();\n    const take = (id: string, tint: SchematicTint | undefined) => {\n        if (tint === undefined) return;\n        const key = tintKey(tint);\n        if (!specs.has(key)) specs.set(key, tint);\n        byEntity.set(id, key);\n    };\n    for (const item of drawn.items) take(item.key, itemTint(item));\n    for (const zone of drawn.zones) take(zone.key, zoneTint(zone));\n    for (const link of drawn.links) take(link.key, edgeTint(link));\n    for (const net of drawn.nets) take(net.key, edgeTint(net));\n    return { specs, byEntity, signature: [...specs.keys()].join(\"\\n\") };\n}\n\n/**\n * Each entity's colour, resolved: its colour's RGB, by the entity's id.\n *\n * @param byEntity - Each entity's colour's key, by its id\n * @param resolved - Each colour's RGB, by its key, as the bridge read it\n * @returns Each entity's RGB; an entity whose colour was not read is left out, and draws its kind's ground\n */\nexport function entityTints(byEntity: ReadonlyMap<string, string>, resolved: ReadonlyMap<string, RGB>): Map<string, RGB> {\n    const out = new Map<string, RGB>();\n    for (const [id, key] of byEntity) {\n        const rgb = resolved.get(key);\n        if (rgb !== undefined) out.set(id, rgb);\n    }\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * An item's card on the Schematic's canvas (#1387): its icon, its label and\n * its status's dot, its second line, its bar and its figure — while its\n * details row is read, a placeholder in each of their places (#1398) — placed\n * through the card layer's camera properties, so a camera move moves it with\n * no render. It renders again only as its item or how it stands moves —\n * selected, locked, dimmed by its layer, drawn as the narrowing's context, a\n * match's emphasis, a Connect's refused end, a drop's target — never as the\n * camera does (#1393): a pan where the items draw as cards works out no\n * card's styles again.\n *\n * @packageDocumentation\n */\n\nimport { memo } from \"react\";\nimport { Box, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { findIconDefinition, library, type IconName } from \"@fortawesome/fontawesome-svg-core\";\nimport { fas } from \"@fortawesome/free-solid-svg-icons\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { PlaceholderShape } from \"@elaraai/east-ui-components/internal\";\nimport { cardTranslateCss, cardWidthCss } from \"./camera\";\nimport { statusUnread, type DrawnItem } from \"./drawn\";\nimport { itemTint, tintAttributes } from \"./tints\";\nimport type { SchematicNarrowedLook } from \"../narrowing.js\";\n\nlibrary.add(fas);\n\n/** Whether an item's status shows as an open ring, as a tentative one does. */\nfunction statusRing(status: DrawnItem[\"status\"]): boolean {\n    return status.type === \"some\" && status.value.ring;\n}\n\n/** Whether an item's card draws its dot: it has a status, or a colour of its own (D14). */\nfunction hasDot(item: DrawnItem): boolean {\n    return item.status.type === \"some\" || item.color.type === \"some\" || item.tone.type === \"some\";\n}\n\n/**\n * An item's placeholders' index, from its id (#1398): what keys their bars' widths, the same however the view moves, so\n * the pattern never crawls as cards come and go.\n */\nfunction placeholderIndex(key: string): number {\n    let hash = 0;\n    for (let i = 0; i < key.length; i++) hash = (hash * 31 + key.charCodeAt(i)) % 9973;\n    return hash;\n}\n\n/** Props of {@link SchematicCard}: its item, and how it stands — each a value, so a card whose standing holds renders not. */\nexport interface SchematicCardProps {\n    /** The item, as the canvas draws it: the same object while its rows read as they were. */\n    readonly item: DrawnItem;\n    /** The recipe's styles, resolved once a recipe. */\n    readonly styles: Readonly<Record<string, SystemStyleObject>>;\n    /** What hears the card's size as the page lays it out (#1403): a ref callback, the same one for every card. */\n    readonly observe: (el: HTMLElement | null) => (() => void) | undefined;\n    /** Whether it is selected, or a marquee in flight would select it. */\n    readonly selected: boolean;\n    /** Whether it holds a conflict not yet chosen: it wears the conflicts' warn ring. */\n    readonly conflict: boolean;\n    /** Whether its row breaks its fields' bounds (#1585), stored or changed: it wears the same warn ring. */\n    readonly bounds: boolean;\n    /** Whether its layer is locked: it takes no pointer, and selects by no path (SC27). */\n    readonly locked: boolean;\n    /** Its layer's opacity, where its layer dims it. */\n    readonly layerOpacity: number | undefined;\n    /** Its opacity while it draws as the narrowing's context (#1392); `undefined` while it draws as itself. */\n    readonly contextOpacity: number | undefined;\n    /** Whether, drawn as context, it is greyed. */\n    readonly desaturate: boolean;\n    /** A match's emphasis, while it is a match the look rings. */\n    readonly emphasis: SchematicNarrowedLook[\"emphasis\"];\n    /** Whether a Connect's draft would end on it, refused (SC9). */\n    readonly forbidden: boolean;\n    /** Whether a library card's drop lands on it (#1390). */\n    readonly dropTarget: boolean;\n}\n\n/**\n * An item's card (see the module docs): no `onClick` and no `stopPropagation`, as a drag-pan can start on a card, and\n * the canvas resolves a tap on it as it lets go.\n */\nexport const SchematicCard = memo(function SchematicCard({\n    item, styles, observe, selected, conflict, bounds, locked, layerOpacity, contextOpacity, desaturate, emphasis, forbidden, dropTarget,\n}: SchematicCardProps) {\n    const sublabel = getSomeorUndefined(item.sublabel);\n    const icon = getSomeorUndefined(item.icon);\n    const meter = getSomeorUndefined(item.meter);\n    const metric = getSomeorUndefined(item.metric);\n    const width = getSomeorUndefined(item.width);\n    // While its details are read, each role they give holds its place: a placeholder, never a value (#1398).\n    const pending = getSomeorUndefined(item.pending);\n    const shape = pending === undefined ? 0 : placeholderIndex(item.key);\n    const iconDef = icon !== undefined ? findIconDefinition({ prefix: \"fas\", iconName: icon as IconName }) : undefined;\n    const context = contextOpacity !== undefined;\n    return (\n        <Box\n            ref={observe}\n            css={styles.item}\n            data-card-key={item.key}\n            // At its item's own width, a box in the world: the recipe holds it to no widest card (#1393).\n            {...(width !== undefined ? { \"data-boxed\": \"\" } : {})}\n            {...(selected ? { \"data-selected\": \"\" } : {})}\n            {...(conflict ? { \"data-conflict\": \"\" } : {})}\n            {...(bounds ? { \"data-bounds\": \"\" } : {})}\n            {...(locked ? { \"data-locked\": \"\" } : {})}\n            {...(context ? { \"data-context\": \"\", ...(desaturate ? { \"data-desaturate\": \"\" } : {}) } : {})}\n            {...(emphasis !== undefined ? { \"data-emphasis\": emphasis } : {})}\n            {...(forbidden ? { \"data-forbidden\": \"\" } : {})}\n            {...(dropTarget ? { \"data-drop-target\": \"\" } : {})}\n            style={{\n                left: 0, top: 0,\n                transform: `${cardTranslateCss(item.x, item.y)} translate(-50%, -50%)`,\n                ...(width !== undefined ? { width: cardWidthCss(width) } : {}),\n                ...(layerOpacity !== undefined ? { \"--schematic-layer-opacity\": String(layerOpacity) } : {}),\n                ...(context ? { \"--schematic-context-opacity\": String(contextOpacity) } : {}),\n            }}\n        >\n            <Box css={styles.itemHead}>\n                {iconDef !== undefined && (\n                    <Box as=\"span\" css={styles.itemIcon}><FontAwesomeIcon icon={iconDef} /></Box>\n                )}\n                <Box as=\"span\" css={styles.itemLabel} data-card-label=\"\">{item.label}</Box>\n                {/* Its colour: its colour token, else its tone, else its status's — its markers' on the canvas (D14, SC26);\n                    its status unread, the dot's place a placeholder. */}\n                {statusUnread(item)\n                    ? <Box as=\"span\" css={styles.statusDot} data-pending=\"\"><PlaceholderShape kind=\"fill\" index={shape} /></Box>\n                    : hasDot(item) && <Box as=\"span\" css={styles.statusDot} {...tintAttributes(itemTint(item))} {...(statusRing(item.status) ? { \"data-ring\": \"\" } : {})} />}\n            </Box>\n            {pending?.sublabel === true\n                ? <Box css={styles.itemSublabel} data-pending=\"\"><PlaceholderShape kind=\"text\" index={shape} /></Box>\n                : sublabel !== undefined && <Box css={styles.itemSublabel}>{sublabel}</Box>}\n            {pending?.meter === true ? (\n                <Box css={styles.meterTrack} data-meter=\"\" data-pending=\"\"><PlaceholderShape kind=\"fill\" index={shape} /></Box>\n            ) : meter !== undefined && (\n                <Box css={styles.meterTrack} data-meter=\"\">\n                    <Box css={styles.meterFill} style={{ width: `${meter.max > 0 ? Math.min(100, (meter.value / meter.max) * 100) : 0}%` }} />\n                </Box>\n            )}\n            {pending?.metric === true\n                ? <Box css={styles.itemMetric} data-pending=\"\"><PlaceholderShape kind=\"number\" index={shape} /></Box>\n                : metric !== undefined && <Box css={styles.itemMetric}>{metric}</Box>}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The canvas's card layer (#1387, #1393, #1403): the layer the cards draw in —\n * an item drawn as a card a component of its own (`card.tsx`), told how it\n * stands in values (invariant 13) — and with them a Move's preview and a\n * refused connection's caption under the item it would end at, in the shared\n * drag caption (invariant 6). It holds the live camera's custom properties the\n * apply writes, so a camera move is three property writes on it and never a\n * card's re-layout, and the widest card, which the recipe reads. Each card's\n * size as the page lays it out is heard by a ResizeObserver, for a link's end\n * to meet (invariant 9): written into one map in place as it moves, never a\n * copy of it a batch, and let go of as the layer stops observing the card, so\n * the map holds the sizes of the cards drawn, no more.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useRef, type CSSProperties, type RefObject } from \"react\";\nimport { Box } from \"@chakra-ui/react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport type { SchematicDropMark } from \"../drop.js\";\nimport type { SchematicNarrowedLook } from \"../narrowing.js\";\nimport { cardTranslateCss } from \"./camera\";\nimport { SchematicCard, type SchematicCardProps } from \"./card\";\nimport type { DrawnItem } from \"./drawn\";\nimport { SCHEMATIC_CARD_MAX_PX, type LodTier } from \"./model\";\nimport type { GestureState } from \"./use-gestures\";\n\nconst stringEqual = equalFor(StringType);\n\n/** No item whose row breaks its fields' bounds. */\nconst NONE_BOUNDED: ReadonlySet<string> = new Set();\n\n/** The card layer's widest card (#1393): what the recipe holds a card to, but one at its item's own width — the figure `tierSize` and the area read reckon with. */\nconst CARD_LAYER_STYLE = { \"--schematic-card-max\": `${SCHEMATIC_CARD_MAX_PX}px` } as CSSProperties;\n\n/** Props of {@link SchematicCardLayer}. */\nexport interface SchematicCardLayerProps {\n    /** The layer's element: what the apply writes the live camera's custom properties to. */\n    readonly cardLayerRef: RefObject<HTMLDivElement | null>;\n    /** The recipe's styles, resolved once a recipe. */\n    readonly styles: SchematicCardProps[\"styles\"];\n    /** The items in view: those drawn as cards draw here. */\n    readonly visibleItems: readonly DrawnItem[];\n    /** What each item in view draws as at the zoom. */\n    readonly tiers: ReadonlyMap<string, LodTier>;\n    /** The tier the zoom's band draws its items at. */\n    readonly lod: LodTier;\n    /** What draws as the narrowing's context (#1392). */\n    readonly context: ReadonlySet<string>;\n    /** How context draws, and what the matches take. */\n    readonly look: SchematicNarrowedLook;\n    /** The narrowing's matches, by id. */\n    readonly matches: ReadonlySet<string>;\n    /** The items holding a conflict not yet chosen, by key. */\n    readonly conflicted: ReadonlySet<string>;\n    /** The items whose rows break their fields' bounds (#1585), by key: none by default. */\n    readonly bounded?: ReadonlySet<string> | undefined;\n    /** What draws selected: the selection, or what a marquee in flight would select. */\n    readonly renderSelected: ReadonlySet<string>;\n    /** What a locked layer holds, by id. */\n    readonly lockedKeys: ReadonlySet<string>;\n    /** Each dimmed entity's opacity, by id. */\n    readonly layerAlpha: ReadonlyMap<string, number>;\n    /** Connect's draft: the item it would end at, refused, and why (SC9). */\n    readonly connectDraft: GestureState[\"connectDraft\"];\n    /** Where a library card's drop lands while its drag rests there (#1390). */\n    readonly dropMark: SchematicDropMark | undefined;\n    /** Each item drawn's centre, by its id: where a refusal's caption stands. */\n    readonly centers: ReadonlyMap<string, { x: number; y: number }>;\n    /** Each card's size as the page lays it out, by its item's id (#1403): what the observer writes, in place. */\n    readonly cardSizesRef: RefObject<Map<string, { w: number; h: number }>>;\n    /** Draws the paint again as a card's size moves (`use-paint.ts`' `applyCardSizes`): told the sizes moved, then the apply. */\n    readonly applyCamera: () => void;\n}\n\n/**\n * The card layer (see the module docs).\n *\n * @param props - The layer's element and the recipe's styles, the items in view and what each draws as, how each card\n *   stands, Connect's draft, the drop's mark, the items' centres, and each card's size and the apply\n * @returns The layer\n */\nexport function SchematicCardLayer({\n    cardLayerRef, styles, visibleItems, tiers, lod, context, look, matches, conflicted, bounded = NONE_BOUNDED, renderSelected, lockedKeys, layerAlpha, connectDraft,\n    dropMark, centers, cardSizesRef, applyCamera,\n}: SchematicCardLayerProps) {\n    // Each card's size as the page lays it out (#1403): a ResizeObserver hears each card as it is laid out and as its box\n    // changes — a card with an explicit width grows with the zoom — each size written into the one map in place, and the\n    // paint told once a batch that moved one. A card the layer stops observing — it draws as a pin or a dot now, or left\n    // the view — leaves the map, which so holds the cards drawn, never every card a session has drawn. Made as the first\n    // card is laid out, and let go with the canvas.\n    const cardObserverRef = useRef<ResizeObserver | null>(null);\n    const observeCard = useCallback((el: HTMLElement | null) => {\n        if (el === null || typeof ResizeObserver === \"undefined\") return undefined;\n        cardObserverRef.current ??= new ResizeObserver((entries) => {\n            const sizes = cardSizesRef.current;\n            let moved = false;\n            for (const entry of entries) {\n                const key = entry.target.getAttribute(\"data-card-key\");\n                const box = entry.borderBoxSize[0];\n                if (key === null || box === undefined || !(box.inlineSize > 0 && box.blockSize > 0)) continue;\n                const was = sizes.get(key);\n                if (was !== undefined && was.w === box.inlineSize && was.h === box.blockSize) continue;\n                sizes.set(key, { w: box.inlineSize, h: box.blockSize });\n                moved = true;\n            }\n            if (moved) applyCamera();\n        });\n        const observer = cardObserverRef.current;\n        observer.observe(el);\n        // The card it was let go of: a card still drawn so is observed again, its size heard again with it.\n        const key = el.getAttribute(\"data-card-key\");\n        return () => {\n            observer.unobserve(el);\n            if (key !== null) cardSizesRef.current.delete(key);\n        };\n    }, [applyCamera, cardSizesRef]);\n    useEffect(() => () => { cardObserverRef.current?.disconnect(); cardObserverRef.current = null; }, []);\n    return (\n        <Box ref={cardLayerRef} css={styles.cardLayer} data-schematic-cards=\"\" style={CARD_LAYER_STYLE}>\n            {visibleItems.map(item => {\n                // Rich cards are DOM; dots / pins / footprints / zones /\n                // links are painted on the canvas above.\n                if ((tiers.get(item.key) ?? lod) !== \"card\") return null;\n                // The narrowing's (#1392): context fades — greyed, as the look says — and takes no pointer, as\n                // a locked card; a match wears its emphasis's ring. Each card a component of its own, told how it\n                // stands in values, so a frame the camera moves renders none whose standing holds (#1393).\n                const isContextCard = context.has(item.key);\n                return (\n                    <SchematicCard\n                        key={item.key}\n                        item={item}\n                        styles={styles}\n                        observe={observeCard}\n                        selected={renderSelected.has(item.key)}\n                        conflict={conflicted.has(item.key)}\n                        bounds={bounded.has(item.key)}\n                        // Layer treatment: dim + lock (non-selectable — clicks fall\n                        // through to entities beneath, matching the pickAt lock skip).\n                        locked={lockedKeys.has(item.key)}\n                        layerOpacity={layerAlpha.get(item.key)}\n                        contextOpacity={isContextCard ? look.opacity : undefined}\n                        desaturate={isContextCard && look.desaturate}\n                        emphasis={look.emphasis !== undefined && matches.has(item.key) ? look.emphasis : undefined}\n                        forbidden={connectDraft?.forbidden === item.key}\n                        dropTarget={dropMark?.kind === \"entity\" && stringEqual(dropMark.id, item.key)}\n                    />\n                );\n            })}\n            {/* A refused connection's words under the item its draft would end at (SC9), in the shared\n                drag caption, moving with the camera as the cards do. */}\n            {connectDraft?.forbidden !== undefined && connectDraft.reason !== undefined && centers.has(connectDraft.forbidden) && (\n                <Box css={styles.draftCaption} data-schematic-refusal=\"\"\n                    style={{ transform: cardTranslateCss(centers.get(connectDraft.forbidden)!.x, centers.get(connectDraft.forbidden)!.y) }}>\n                    <div data-drag-caption=\"\" data-refused=\"\">{connectDraft.reason}</div>\n                </Box>\n            )}\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The theme bridge for the Canvas2D schematic (#1387, \"The canvas's theme and\n * styles\"). The canvas can't read Chakra's CSS custom properties, so it reads\n * what the recipe resolves: hidden elements in the `schematic` recipe's\n * `probe` slot, each named by a data attribute, never styled inline —\n *\n * - **its own marks' colours**, a role each (`data-role`), each a design-system\n *   token: `brandMark`, `brand.solid`, `brandTint`, `fg` … `fg.faint`,\n *   `bg.surface`, `bg.canvas`, `border.subtle`, `border.strong`, `status.*`,\n *   the placeholders' fill `bg.subtle` (#1398) and the heat ramp a density's\n *   steps draw in, `heat.1` … `heat.5` — never a raw palette step, never a\n *   Chakra default;\n * - **its fonts** (`data-font`): its labels' and its eyebrows', the design\n *   system's mono face (`fonts.mono`);\n * - **each entity's colour** (`data-tint`), through the chain an item's card\n *   dot resolves its own by (`tints.ts`), so the canvas and the cards draw one\n *   colour in each mode, and a value naming no theme colour token draws its\n *   tone (D14, SC26);\n * - **the links' look** (#1403): the shared links part's own elements\n *   (`linkRibbons`), as the Plan's links layer draws them — the casing's paper,\n *   the muted ink and the strong ink, the ring, the knockout and a selected\n *   one's outline, the caption's ink and font, a drag's new line and a moved\n *   link's `was` line with their widths — so a change to the part changes the\n *   Plan's, the Allocation's and the Schematic's links together.\n *\n * A colour is read as the page computes it and converted to RGB on a 1×1\n * canvas, which takes every colour the page can compute (`oklch()`, a\n * `color-mix()`'s result); with no canvas — jsdom — an `rgb()` is parsed. The\n * canvas reads again when the colours its drawing names change, or the\n * document's theme does.\n *\n * @packageDocumentation\n */\n\nimport { memo, useLayoutEffect, useMemo, useState, type Ref } from \"react\";\nimport { Box, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport type { RGB, SchematicLinkLook, SchematicPalette } from \"./paint\";\nimport { tintAttributes, type SchematicTint } from \"./tints\";\n\n/** The palette's colour roles, each named after the token the probe resolves it from. */\nexport const PALETTE_ROLES = [\n    \"brandMark\", \"brandSolid\", \"brandTint\",\n    \"fg\", \"fgStrong\", \"fgMuted\", \"fgSubtle\", \"fgFaint\",\n    \"bgSurface\", \"bgCanvas\", \"borderSubtle\", \"borderStrong\",\n    \"statusPos\", \"statusNeg\", \"statusWarn\", \"statusInfo\",\n    \"bgSubtle\",\n    \"heat1\", \"heat2\", \"heat3\", \"heat4\", \"heat5\",\n] as const satisfies readonly (keyof SchematicPalette)[];\n\n/** A palette role. */\ntype PaletteRole = (typeof PALETTE_ROLES)[number];\n\n/** Props of {@link SchematicProbe}. */\nexport interface SchematicProbeProps {\n    /** Every colour the drawing names, by its key (`tintsOf`). */\n    readonly tints: ReadonlyMap<string, SchematicTint>;\n    /** The colours' keys, in order (`tintsOf`'s signature): the probe draws again only when it moves. */\n    readonly signature: string;\n    /** The probe's element: what {@link readPalette} reads. */\n    readonly probeRef: Ref<HTMLDivElement>;\n}\n\n/**\n * The probe: hidden, in the recipe's `probe` slot, one element per palette\n * role, per font and per colour the drawing names (see the module docs). It\n * draws again only when the colours named do — a drawing that moves and names\n * the same colours probes nothing new.\n *\n * @param props - The colours, their signature, and where the probe's element goes\n * @returns The probe\n */\nexport const SchematicProbe = memo(function SchematicProbe({ tints, probeRef }: SchematicProbeProps) {\n    // The recipe's styles, resolved once a recipe: the probe draws again as each window's colours do.\n    const recipe = useSlotRecipe({ key: \"schematic\" });\n    const styles = useMemo(() => recipe() as Record<string, SystemStyleObject>, [recipe]);\n    return (\n        <Box ref={probeRef} css={styles.probe} aria-hidden=\"true\" data-schematic-probe=\"\">\n            {PALETTE_ROLES.map((role) => <span key={role} data-role={role} />)}\n            <span data-font=\"label\" />\n            <span data-font=\"eyebrow\" />\n            {[...tints].map(([key, tint]) => <span key={key} data-tint={key} {...tintAttributes(tint)} />)}\n            <LinkParts />\n        </Box>\n    );\n}, (prev, next) => prev.signature === next.signature && prev.probeRef === next.probeRef);\n\n/**\n * The links' parts the probe holds (#1403): the shared links part's elements, as the Plan's links layer draws them —\n * a link at rest and one lit, a lit link's ring, a caption's knockout at rest and selected, a moved link's `was` line\n * and a drag's new line — which the recipe styles as it styles the Plan's.\n *\n * @returns The parts\n */\nfunction LinkParts() {\n    return (\n        <svg data-schematic-links=\"\">\n            <path data-plan-casing=\"band\" />\n            <path data-plan-casing=\"head\" />\n            <g data-plan-link=\"\"><path data-plan-ribbon-band=\"\" /><path data-plan-ribbon-head=\"\" /></g>\n            <g data-plan-link=\"\" data-lit=\"\"><path data-plan-ribbon-band=\"\" /><path data-plan-ribbon-head=\"\" /><rect data-plan-linkend=\"to\" /></g>\n            <g data-plan-ribbon-label=\"\"><rect data-plan-ribbon-knockout=\"\" /><text data-plan-ribbon-caption=\"\">0</text></g>\n            <g data-plan-ribbon-label=\"\" data-selected=\"\"><rect data-plan-ribbon-knockout=\"\" /></g>\n            <g data-was=\"\"><path data-plan-ribbon-band=\"\" /><path data-plan-ribbon-head=\"\" /></g>\n            <g data-plan-link-preview=\"\"><path data-plan-ribbon-band=\"\" /><path data-plan-ribbon-head=\"\" /></g>\n        </svg>\n    );\n}\n\n/** Parse a computed `rgb(...)` / `rgba(...)` string into an `[r,g,b]` triple. */\nfunction parseRGB(s: string): RGB {\n    const m = s.match(/[\\d.]+/g);\n    if (m === null || m.length < 3) return [0, 0, 0];\n    return [Math.round(+m[0]!), Math.round(+m[1]!), Math.round(+m[2]!)];\n}\n\n/**\n * A computed colour as RGB: painted on a 1×1 canvas and read back, which\n * takes every colour the page can compute; parsed, with no canvas.\n *\n * @param color - The computed colour\n * @param scratch - The 1×1 canvas's context; `null` with none\n * @returns Its RGB\n */\nfunction rgbOf(color: string, scratch: CanvasRenderingContext2D | null): RGB {\n    if (scratch === null) return parseRGB(color);\n    scratch.clearRect(0, 0, 1, 1);\n    scratch.fillStyle = \"#000000\";\n    scratch.fillStyle = color;\n    scratch.fillRect(0, 0, 1, 1);\n    const [r, g, b] = scratch.getImageData(0, 0, 1, 1).data;\n    return [r ?? 0, g ?? 0, b ?? 0];\n}\n\n/** An element's font, as `ctx.font` takes it: its weight, its size and its family — none for no element, which the canvas ignores. */\nfunction fontOf(el: Element | null): string {\n    if (el === null) return \"\";\n    const s = getComputedStyle(el);\n    return `${s.fontWeight} ${s.fontSize} ${s.fontFamily}`;\n}\n\n/** An RGB colour as a context takes it. */\nconst cssOf = ([r, g, b]: RGB): string => `rgb(${r},${g},${b})`;\n\n/**\n * The links' look, as the page computes the shared links part's elements the probe holds (#1403).\n *\n * @param probe - The probe's element\n * @param colourOf - A colour the page computes for an element, as RGB\n * @returns The look\n */\nfunction readLinkLook(probe: HTMLElement, colourOf: (el: Element | null, property: \"stroke\" | \"fill\") => RGB): SchematicLinkLook {\n    const part = (selector: string): Element | null => probe.querySelector(`[data-schematic-links] ${selector}`);\n    const paint = (selector: string, property: \"stroke\" | \"fill\"): string => cssOf(colourOf(part(selector), property));\n    // A width the page computes for none — a document that lays nothing out — is the part's own.\n    const widthOf = (selector: string, standing: number): number => {\n        const el = part(selector);\n        const width = el === null ? Number.NaN : Number.parseFloat(getComputedStyle(el).strokeWidth);\n        return Number.isFinite(width) && width > 0 ? width : standing;\n    };\n    return {\n        casing: paint(\"[data-plan-casing='band']\", \"stroke\"),\n        ink: paint(\"[data-plan-link]:not([data-lit]) [data-plan-ribbon-band]\", \"stroke\"),\n        strong: paint(\"[data-plan-link][data-lit] [data-plan-ribbon-band]\", \"stroke\"),\n        ring: paint(\"[data-plan-linkend]\", \"stroke\"),\n        ringWidth: widthOf(\"[data-plan-linkend]\", 1),\n        knockout: paint(\"[data-plan-ribbon-label]:not([data-selected]) [data-plan-ribbon-knockout]\", \"fill\"),\n        outline: paint(\"[data-plan-ribbon-label][data-selected] [data-plan-ribbon-knockout]\", \"stroke\"),\n        caption: paint(\"[data-plan-ribbon-caption]\", \"fill\"),\n        captionFont: fontOf(part(\"[data-plan-ribbon-caption]\")),\n        preview: paint(\"[data-plan-link-preview] [data-plan-ribbon-band]\", \"stroke\"),\n        previewWidth: widthOf(\"[data-plan-link-preview] [data-plan-ribbon-band]\", 3),\n        was: paint(\"[data-was] [data-plan-ribbon-band]\", \"stroke\"),\n        wasWidth: widthOf(\"[data-was] [data-plan-ribbon-band]\", 1.5),\n    };\n}\n\n/** What the probe reads: the palette, and each colour the drawing names, by its key. */\nexport interface ProbeReading {\n    /** The canvas's own colours and fonts. */\n    readonly palette: SchematicPalette;\n    /** Each colour the drawing names, by its key. */\n    readonly tints: ReadonlyMap<string, RGB>;\n}\n\n/**\n * Reads the probe (see the module docs).\n *\n * @param probe - The probe's element, its children committed\n * @returns The palette and the drawing's colours\n */\nexport function readPalette(probe: HTMLElement): ProbeReading {\n    const scratch = probe.ownerDocument.createElement(\"canvas\");\n    scratch.width = 1;\n    scratch.height = 1;\n    const context = scratch.getContext(\"2d\", { willReadFrequently: true });\n    const colourOf = (el: Element | null, property: \"color\" | \"stroke\" | \"fill\" = \"color\"): RGB =>\n        (el === null ? [0, 0, 0] : rgbOf(getComputedStyle(el)[property], context));\n    const roles = Object.fromEntries(PALETTE_ROLES.map((role) => [role, colourOf(probe.querySelector(`[data-role=\"${role}\"]`))])) as Record<PaletteRole, RGB>;\n    const tints = new Map<string, RGB>();\n    for (const el of probe.querySelectorAll(\"[data-tint]\")) tints.set(el.getAttribute(\"data-tint\") ?? \"\", colourOf(el));\n    return {\n        palette: {\n            ...roles,\n            labelFont: fontOf(probe.querySelector('[data-font=\"label\"]')),\n            eyebrowFont: fontOf(probe.querySelector('[data-font=\"eyebrow\"]')),\n            links: readLinkLook(probe, colourOf),\n        },\n        tints,\n    };\n}\n\n/**\n * The document's theme's version: it moves when the document root's class,\n * `data-theme` or style does — a light/dark switch — so the canvas reads its\n * palette again.\n *\n * @returns The version\n */\nexport function useThemeVersion(): number {\n    const [version, setVersion] = useState(0);\n    useLayoutEffect(() => {\n        const observer = new MutationObserver(() => setVersion((v) => v + 1));\n        observer.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\", \"data-theme\", \"style\"] });\n        return () => observer.disconnect();\n    }, []);\n    return version;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The minimap (#1393): the whole drawing in the canvas's corner, a press on\n * it a jump there. It shows the drawing, never only what the view is near:\n * each zone's floor and outline, each kind read by area as its whole\n * drawing's density — the area index's counts over the extent, read once a\n * revision (`../area.ts`' `overview`), in the theme's five heat steps as the\n * canvas's density draws — and each item of a kind read whole as a dot. The\n * viewport's box over it is the canvas's DOM, which moves with the camera;\n * this module only sizes the minimap and paints it, pure.\n *\n * @packageDocumentation\n */\n\nimport type { SchematicDensity } from \"../area.js\";\nimport { densityStep, type RGB, type SchematicPalette } from \"./paint\";\n\n/** The minimap's widest, in CSS px: a desktop's canvas. */\nexport const MINIMAP_MAX_PX = 150;\n\n/** The most of the canvas's width the minimap takes: on a phone, a corner, never half the floor. */\nconst MINIMAP_WIDTH_SHARE = 1 / 4;\n\n/** The most of the canvas's height it takes: a drawing far taller than it is wide stays in its corner. */\nconst MINIMAP_HEIGHT_SHARE = 1 / 3;\n\n/** An item's dot on the minimap, in CSS px a side. */\nconst MINIMAP_DOT_PX = 2;\n\n/**\n * The minimap's size (#1393): the drawing's extent at its own aspect,\n * {@link MINIMAP_MAX_PX} wide at most, and no more than a quarter of the\n * canvas's width or a third of its height.\n *\n * @param canvas - The canvas's size, in CSS px\n * @param extent - The drawing's extent, in world units\n * @returns The minimap's size, in CSS px\n */\nexport function minimapSize(canvas: { readonly w: number; readonly h: number }, extent: { readonly width: number; readonly height: number }): { w: number; h: number } {\n    const aspect = extent.width > 0 ? extent.height / extent.width : 1;\n    let w = Math.min(MINIMAP_MAX_PX, canvas.w * MINIMAP_WIDTH_SHARE);\n    let h = w * aspect;\n    const most = canvas.h * MINIMAP_HEIGHT_SHARE;\n    if (h > most) {\n        h = most;\n        w = aspect > 0 ? h / aspect : w;\n    }\n    return { w, h };\n}\n\n/** A zone as the minimap draws it: its box, in world units. */\nexport interface MinimapZone {\n    readonly x: number;\n    readonly y: number;\n    readonly width: number;\n    readonly height: number;\n}\n\n/** Everything {@link paintMinimap} needs. */\nexport interface MinimapPaintInput {\n    readonly ctx: CanvasRenderingContext2D;\n    /** The minimap's size, in CSS px; the context is scaled by the device's pixel ratio already. */\n    readonly width: number;\n    readonly height: number;\n    /** The drawing's extent, in world units: what the minimap shows, edge to edge. */\n    readonly extent: { readonly width: number; readonly height: number };\n    /** The zones drawn: each its floor, under everything, and its outline, over the density. */\n    readonly zones: readonly MinimapZone[];\n    /** Each kind read by area's density over the whole drawing. */\n    readonly densities: readonly SchematicDensity[];\n    /** Each item of a kind read whole, by its centre, in world units. */\n    readonly items: readonly { readonly x: number; readonly y: number }[];\n    readonly palette: SchematicPalette;\n}\n\nconst css = (c: RGB): string => `rgb(${c[0]},${c[1]},${c[2]})`;\n\n/**\n * Paints the minimap (#1393): clears it, then each zone's floor in the\n * canvas's paper, each density's cells in their heat steps (`densityStep`),\n * each item's dot in the muted ink, and each zone's outline in the subtle\n * rule over them.\n *\n * @param input - The minimap's context and size, the extent and what it draws\n */\nexport function paintMinimap(input: MinimapPaintInput): void {\n    const { ctx, width, height, extent, zones, densities, items, palette: p } = input;\n    const sx = extent.width > 0 ? width / extent.width : 0;\n    const sy = extent.height > 0 ? height / extent.height : 0;\n    ctx.save();\n    ctx.setTransform(1, 0, 0, 1, 0, 0);\n    ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n    ctx.restore();\n    ctx.fillStyle = css(p.bgCanvas);\n    for (const zone of zones) ctx.fillRect(zone.x * sx, zone.y * sy, zone.width * sx, zone.height * sy);\n    const steps = [p.heat1, p.heat2, p.heat3, p.heat4, p.heat5].map(css);\n    for (const density of densities) {\n        const w = density.side * sx, h = density.side * sy;\n        for (const cell of density.cells) {\n            const step = densityStep(cell.count, density.most);\n            if (step === 0) continue;\n            ctx.fillStyle = steps[step - 1]!;\n            ctx.fillRect(cell.minX * sx, cell.minY * sy, w, h);\n        }\n    }\n    ctx.fillStyle = css(p.fgMuted);\n    for (const item of items) ctx.fillRect(item.x * sx - MINIMAP_DOT_PX / 2, item.y * sy - MINIMAP_DOT_PX / 2, MINIMAP_DOT_PX, MINIMAP_DOT_PX);\n    ctx.strokeStyle = css(p.borderSubtle);\n    ctx.lineWidth = 1;\n    for (const zone of zones) ctx.strokeRect(zone.x * sx + 0.5, zone.y * sy + 0.5, Math.max(0, zone.width * sx - 1), Math.max(0, zone.height * sy - 1));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The library's Index tab (#1389, `Schematic Builder Spec.md` §8) — pure: the\n * zones nested by containment and the items inside them (`canvas/model.ts`'\n * `buildNavTree`, the tree the canvas's steps walk), laid out as the tab's\n * rows, and the zone the viewport is in.\n *\n * - **The rows.** Each zone in label order — natural, so `Cage 2` comes\n *   before `Cage 10` — with how many items it holds, its own and its nested\n *   zones'; under an open zone its items, then its nested zones; the items in\n *   no zone last. A hatched zone is an annotation, holding no items. Each row\n *   says where it stands among the rows listed beside it, which a reader hears\n *   while the rest of the list is scrolled out.\n * - **Its search** keeps the items whose label, key or kind's name holds the\n *   query, each under the zones it is in, opened; a zone with none of them\n *   leaves. A kind read by area is searched through its source (#1393, D52):\n *   each of its items listed is a match.\n * - **A zone's count** is whole only where every item it holds is in hand: a\n *   zone holding items of a kind read by area counts them only once its box\n *   is read (D52), and says no count until then.\n * - **The open zone's row** heads the rows listed under it — its items and the\n *   zones it holds — which scroll under it while it sticks at the tree's top,\n *   until the next row past them pushes it out (#1570).\n * - **The zone in view** is the one covering most of the viewport — of two\n *   covering as much, the smaller, so a view inside a cage is in the cage and\n *   a view of the whole hall in the hall — kept until it clearly loses, so a\n *   view on a score's edge doesn't flap. With the whole drawing in view, none\n *   is.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport type { StickySection } from \"@elaraai/east-ui-components/internal\";\nimport type { DrawnItem, DrawnZone } from \"./canvas/drawn.js\";\nimport { byLabel, type NavZone } from \"./canvas/model.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** No section: no zone open, or one open listing nothing under it. */\nconst NO_SECTIONS: readonly StickySection[] = [];\n\n/** Where a row stands among the rows listed beside it, under one zone or at the top: what a reader hears while the rest scroll out. */\nexport interface IndexPlace {\n    /** Its place, from 1. */\n    readonly position: number;\n    /** How many rows are listed beside it, itself among them. */\n    readonly siblings: number;\n}\n\n/** One row of the Index tab: a zone, or an item inside one — or inside none. */\nexport type IndexRow = IndexPlace & (\n    | {\n        readonly kind: \"zone\";\n        /** The zone. */\n        readonly zone: DrawnZone;\n        /** How deep it nests: 0 for a zone in none. */\n        readonly depth: number;\n        /** Whether it is open: its items and its nested zones listed under it. */\n        readonly open: boolean;\n        /** Whether it holds anything to open. */\n        readonly branch: boolean;\n        /** How many items it holds, its nested zones' among them; `undefined` while that is not whole. */\n        readonly count: number | undefined;\n    }\n    | {\n        readonly kind: \"item\";\n        /** The item. */\n        readonly item: DrawnItem;\n        /** How deep it is listed: one under its zone's, 0 for an item in no zone. */\n        readonly depth: number;\n    });\n\n/** What one level of the Index lists: a zone, or an item. */\ntype IndexEntry = { readonly kind: \"zone\"; readonly node: NavZone } | { readonly kind: \"item\"; readonly item: DrawnItem };\n\n/** How many items a zone holds, its nested zones' among them. */\nfunction countOf(node: NavZone): number {\n    return node.items.length + node.children.reduce((n, child) => n + countOf(child), 0);\n}\n\n/**\n * Whether the Index's search holds an item it searches itself — one of a kind read whole, or one a gesture made, which no\n * source holds: its label, its key or its kind's name holds the query, each in the app's locale's lower case.\n *\n * @param item - The item\n * @param query - The search; empty, every item\n * @param kindName - An item kind's name, by its slot\n * @param locale - The app's locale, which the search lowers its text in\n * @returns Whether it holds the item\n */\nexport function indexSearchHolds(item: DrawnItem, query: string, kindName: (slot: string) => string, locale: string): boolean {\n    const q = query.trim().toLocaleLowerCase(locale);\n    return q === \"\" || [item.label, item.ref.key, kindName(item.ref.kind)].some((text) => text.toLocaleLowerCase(locale).includes(q));\n}\n\n/** What the Index's rows take of the kinds read by area (#1393, D52). */\nexport interface IndexRowsOptions {\n    /** The item kinds read by area, by slot: searched through their sources, each of their items listed is a match. */\n    readonly searched?: ReadonlySet<string> | undefined;\n    /** Whether a zone's count is whole, by its key; with none, every zone's is. */\n    readonly whole?: ((zone: string) => boolean) | undefined;\n}\n\n/**\n * The Index tab's rows (see the module docs).\n *\n * @param tree - The zones nested by containment, the items inside them and those in none (`buildNavTree`)\n * @param open - The zones the viewer has open, by key\n * @param query - The tab's search; empty, none\n * @param kindName - An item kind's name, by its slot: what the search reads beside an item's label and key\n * @param locale - The app's locale, which the search lowers its text in\n * @param options - The kinds read by area, searched through their sources, and whether a zone's count is whole\n * @returns The rows, in order, each with its place among the rows listed beside it\n */\nexport function indexRows(tree: { readonly roots: readonly NavZone[]; readonly floor: readonly DrawnItem[] }, open: ReadonlySet<string>, query: string,\n    kindName: (slot: string) => string, locale: string, options: IndexRowsOptions = {}): IndexRow[] {\n    const searching = query.trim() !== \"\";\n    const matches = (item: DrawnItem): boolean => options.searched?.has(item.ref.kind) === true || indexSearchHolds(item, query, kindName, locale);\n    // A zone's items the search keeps, its nested zones' among them.\n    const kept = (node: NavZone): number => node.items.filter(matches).length + node.children.reduce((n, child) => n + kept(child), 0);\n    const zonesOf = (nodes: readonly NavZone[]): IndexEntry[] => [...nodes].sort((a, b) => byLabel(a.zone, b.zone)).map((node) => ({ kind: \"zone\", node }));\n    const itemsOf = (items: readonly DrawnItem[]): IndexEntry[] => [...items].sort(byLabel).map((item) => ({ kind: \"item\", item }));\n    const rows: IndexRow[] = [];\n    // One level's rows: the ones the search keeps, each with its place among them, an open zone's own under it.\n    const level = (entries: readonly IndexEntry[], depth: number) => {\n        const listed = entries.filter((entry) => (entry.kind === \"item\" ? matches(entry.item) : !searching || kept(entry.node) > 0));\n        listed.forEach((entry, i) => {\n            const place = { position: i + 1, siblings: listed.length };\n            if (entry.kind === \"item\") {\n                rows.push({ kind: \"item\", item: entry.item, depth, ...place });\n                return;\n            }\n            const { node } = entry;\n            const isOpen = searching || open.has(node.zone.key);\n            const count = options.whole === undefined || options.whole(node.zone.key) ? countOf(node) : undefined;\n            rows.push({ kind: \"zone\", zone: node.zone, depth, open: isOpen, branch: node.items.length > 0 || node.children.length > 0 || count === undefined, count, ...place });\n            // An open zone: its own items, then its nested zones.\n            if (isOpen) level([...itemsOf(node.items), ...zonesOf(node.children)], depth + 1);\n        });\n    };\n    // The top: the zones in none, then the items in no zone.\n    level([...zonesOf(tree.roots), ...itemsOf(tree.floor)], 0);\n    return rows;\n}\n\n/**\n * The open zone's section of the Index's rows (#1570): its row, heading the rows listed under it — its items and the\n * zones it holds — to the next row past them, so it sticks at the tree's top while they scroll under it (the shared\n * rows' `sections`, #1568).\n *\n * @param rows - The Index's rows ({@link indexRows})\n * @param open - The open zone, by key: the deepest of the zones open; `undefined` for none\n * @returns Its section; none while no zone is open, the open zone is not listed, or it lists nothing under it\n */\nexport function indexSections(rows: readonly IndexRow[], open: string | undefined): readonly StickySection[] {\n    if (open === undefined) return NO_SECTIONS;\n    const start = rows.findIndex((row) => row.kind === \"zone\" && stringEqual(row.zone.key, open));\n    if (start < 0) return NO_SECTIONS;\n    const depth = rows[start]!.depth;\n    let end = start + 1;\n    while (end < rows.length && rows[end]!.depth > depth) end++;\n    return end - start > 1 ? [{ start, end, head: 1 }] : NO_SECTIONS;\n}\n\n/** A box in world units. */\nexport interface WorldBox {\n    readonly minX: number;\n    readonly minY: number;\n    readonly maxX: number;\n    readonly maxY: number;\n}\n\n/** The view the canvas reports: its window on the world, and whether the whole drawing is in it. */\nexport interface IndexViewport {\n    /** The window, in world units. */\n    readonly box: WorldBox;\n    /** Whether the camera is at its fit, the whole drawing in view: no zone is in view then. */\n    readonly fitted: boolean;\n}\n\n/** A zone takes the view from none at this score; holds it at this; and a challenger must beat it by this margin. */\nconst ENTER = 0.3, STAY = 0.18, MARGIN = 0.15;\n\n/**\n * The zone the viewport is in (see the module docs).\n *\n * @param zones - The zones drawn — a hatched one is an annotation, never in view\n * @param view - The canvas's view; `undefined` before it reports one\n * @param prev - The zone in view before\n * @returns The zone's key; `undefined` for none\n */\nexport function zoneInView(zones: readonly DrawnZone[], view: IndexViewport | undefined, prev: string | undefined): string | undefined {\n    if (view === undefined || view.fitted) return undefined;\n    const { box } = view;\n    const viewArea = Math.max(0, box.maxX - box.minX) * Math.max(0, box.maxY - box.minY);\n    if (viewArea === 0) return undefined;\n    // How much of the view a zone covers.\n    const scoreOf = (z: DrawnZone): number => {\n        const ix = Math.max(0, Math.min(box.maxX, z.x + z.width) - Math.max(box.minX, z.x));\n        const iy = Math.max(0, Math.min(box.maxY, z.y + z.height) - Math.max(box.minY, z.y));\n        return (ix * iy) / viewArea;\n    };\n    const hosts = zones.filter((z) => z.pattern.type === \"outline\");\n    let best: DrawnZone | undefined;\n    let bestScore = 0;\n    for (const z of hosts) {\n        const score = scoreOf(z);\n        // Of two zones covering as much of the view, the smaller: a cage before its hall.\n        if (score > bestScore || (score === bestScore && best !== undefined && z.width * z.height < best.width * best.height)) { best = z; bestScore = score; }\n    }\n    if (prev !== undefined) {\n        const holder = hosts.find((z) => stringEqual(z.key, prev));\n        const held = holder === undefined ? 0 : scoreOf(holder);\n        if (held >= STAY && ((best !== undefined && stringEqual(best.key, prev)) || bestScore < held + MARGIN)) return prev;\n    }\n    return bestScore >= ENTER ? best?.key : undefined;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic canvas's camera (#57, #1393): its live ref, which the input\n * handlers move and one frame applies to every surface (`requestRender`, the\n * coalesced frame), and a throttled snapshot of it for what the render\n * derives; the canvas's size and its pixel ratio; Fit's camera — home — and the\n * zoom's limit (invariants 23, 24); the interaction-mode machine a gesture\n * supersedes a fly by; the fly, on one clock (invariant 25); a zoom about a\n * point — the toolbar's, about the middle, and the wheel's, about the cursor;\n * Fit; the minimap's jump; the fly to the narrowing's matches, keyed on the\n * narrowing itself (invariant 22);\n * and what the camera tells as it moves — as it comes to rest, never during a\n * fly, the zone the viewport is in, for the Index (#1570), and where the\n * viewport rests, for the reader; where the zoom stands, for the toolbar; and\n * each move the viewer makes, for the frame, whose refusal's words go with it.\n * Its maths is `camera.ts`'.\n *\n * The commit-phase snapshot reads the camera (`use-paint.ts`, invariant 1), and\n * what moves it reads the snapshot and calls the painter's apply:\n * {@link useCamera} holds the camera, and is made before the snapshot;\n * {@link useCameraMoves} holds what moves it, and is made after it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type RefObject } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { SchematicViewportStore } from \"../area.js\";\nimport { zoneInView } from \"../index-tree.js\";\nimport {\n    type CameraEvent, type CameraMode, type RafCoalescer, type ViewTold, type Viewport,\n    FLY_DURATION_MS, IDENTITY, cancelsFly, fitView, flyStep, makeRafCoalescer, nextMode, tellsAsItMoves, zoomAbout,\n} from \"./camera\";\nimport type { DrawnItem, DrawnZone } from \"./drawn\";\nimport { cardContentWidth, type LodTier, type WorldBox } from \"./model\";\nimport type { Paint } from \"./use-paint\";\nimport type { SchematicCanvasFit } from \"./view\";\nimport type { ZoomRange } from \"../../shared/schedule/zoom.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** The zoom's least limit, from Fit: further only where the drawing's smallest item needs it to draw as a whole card. */\nconst MAX_ZOOM = 40;\n/** The most px per world unit any zoom reaches, whatever an item's size asks: a bound on a degenerate item's width. */\nconst MAX_PPU = 4000;\n/** How long the camera rests before the canvas tells the reader where its viewport is (#1393, CL6), in ms. */\nconst REST_READ_MS = 100;\n\n/** How much room a fly leaves about the box it frames: the box at 1 / 1.18 of the canvas's width or height, whichever binds. */\nconst FLY_PAD = 1.18;\n\n/** The world box a fly to a point frames: 8 × 6 units about it. */\nexport function pointFrame(p: { x: number; y: number }): { x: number; y: number; w: number; h: number } {\n    return { x: p.x - 4, y: p.y - 3, w: 8, h: 6 };\n}\n\n/**\n * The world box a fly to an item frames (#1393): 8 × 6 units about its centre — or, for an item held to its own width\n * whose card that box shows too narrow for its words, the box about it at whose zoom its card draws whole\n * (`cardWhole`), so a step, Find's pick or the Index's lands on its card, as far as the zoom's limit reaches.\n *\n * @param item - The item\n * @param size - The canvas's size, in CSS px\n * @returns The world box\n */\nexport function itemFrame(item: DrawnItem, size: { readonly w: number; readonly h: number }): { x: number; y: number; w: number; h: number } {\n    const width = getSomeorUndefined(item.width);\n    if (width === undefined || !(width > 0)) return pointFrame(item);\n    const needed = cardContentWidth(item) / width;\n    const w = Math.min(8, size.w / (FLY_PAD * needed)), h = Math.min(6, size.h / (FLY_PAD * needed));\n    return { x: item.x - w / 2, y: item.y - h / 2, w, h };\n}\n\n/** What {@link useCamera} reads. */\nexport interface CameraProps {\n    /** The canvas's element: what its size is measured by. */\n    readonly canvasRef: RefObject<HTMLDivElement | null>;\n    /** The drawing's extent's width, in world units. */\n    readonly W: number;\n    /** The drawing's extent's height, in world units. */\n    readonly H: number;\n    /** The items drawn, a hidden layer's left out: the zoom's limit follows the smallest of them held to its own width. */\n    readonly items: readonly DrawnItem[];\n}\n\n/**\n * The camera, as the canvas renders by it (see the module docs).\n *\n * @param props - The canvas's element, the drawing's extent and its items\n * @returns The canvas's size and its pixel ratio, the camera's live ref and its snapshot, the fit and Fit's camera, the\n *   zoom's px a world unit and its limit\n */\nexport function useCamera({ canvasRef, W, H, items }: CameraProps) {\n    const [size, setSize] = useState<{ w: number; h: number } | null>(null);\n    useLayoutEffect(() => {\n        const el = canvasRef.current;\n        if (!el) return;\n        const measure = () => setSize({ w: el.clientWidth, h: el.clientHeight });\n        measure();\n        const ro = new ResizeObserver(measure);\n        ro.observe(el);\n        return () => ro.disconnect();\n    }, [canvasRef]);\n\n    // Track devicePixelRatio so moving the window across monitors / changing OS\n    // scale / browser zoom repaints the canvas at the correct backing-store\n    // resolution instead of leaving it stale and blurry (issue #57, P5). One\n    // live `matchMedia` listener, re-subscribed on each change.\n    const [dpr, setDpr] = useState(() => (typeof window !== \"undefined\" ? window.devicePixelRatio || 1 : 1));\n    useEffect(() => {\n        if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") return;\n        let cleanup = () => {};\n        const subscribe = () => {\n            const mql = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);\n            const onChange = () => { cleanup(); setDpr(window.devicePixelRatio || 1); subscribe(); };\n            mql.addEventListener(\"change\", onChange);\n            cleanup = () => mql.removeEventListener(\"change\", onChange);\n        };\n        subscribe();\n        return () => cleanup();\n    }, []);\n\n    // The live camera lives in a ref, mutated synchronously by input handlers,\n    // which then call `requestRender()` (coalesced to one rAF). React state\n    // holds only a throttled snapshot for derived UI — minimap, the LOD/culling\n    // recompute — never updated per pointer event (issue #57, Phase 2\n    // invariants 1–2).\n    const cameraRef = useRef<Viewport>(IDENTITY);\n    const [cameraSnapshot, setCameraSnapshot] = useState<Viewport>(IDENTITY);\n\n    // The fit, and the camera Fit takes (#1393): the drawing inside the canvas less its margin, centred on both axes.\n    const { fit, home } = useMemo(() => (size === null ? { fit: 0, home: IDENTITY } : fitView(size.w, size.h, W, H)), [size, W, H]);\n    const ppu = fit * cameraSnapshot.zoom;\n    // The zoom's limit (#1393, ruled 23 Oct 2026): 40× Fit, or further — until the drawing's smallest item held to its own\n    // width draws as a whole card (`cardWhole`), however dense the floor.\n    const maxZoom = useMemo(() => {\n        if (fit === 0) return MAX_ZOOM;\n        let needed = 0;\n        for (const item of items) {\n            const width = getSomeorUndefined(item.width);\n            if (width !== undefined && width > 0) needed = Math.max(needed, cardContentWidth(item) / width);\n        }\n        return Math.max(MAX_ZOOM, Math.min(MAX_PPU, needed) / fit);\n    }, [items, fit]);\n    return { size, dpr, cameraRef, cameraSnapshot, setCameraSnapshot, fit, home, ppu, maxZoom };\n}\n\n/** The camera, as the canvas renders by it: {@link useCamera}'s. */\nexport type Camera = ReturnType<typeof useCamera>;\n\n/** What {@link useCameraMoves} reads. */\nexport interface CameraMovesProps {\n    /** The canvas's element: what the wheel is heard on. */\n    readonly canvasRef: RefObject<HTMLDivElement | null>;\n    /** The drawing's extent's width, in world units. */\n    readonly W: number;\n    /** The drawing's extent's height, in world units. */\n    readonly H: number;\n    /** The tier the zoom's band draws its items at: what the reader is told the viewport rests at. */\n    readonly lod: LodTier;\n    /** The zones drawn, a hidden layer's left out. */\n    readonly shownZones: readonly DrawnZone[];\n    /** What the narrowing takes out of every list and of the selection (#1392): the Index lists none of it. */\n    readonly narrowedOut: ReadonlySet<string>;\n    /** Told the zone the viewport is in, by its id — `undefined` for none — as that changes, once the camera rests (#1389, #1570). */\n    readonly onZoneInView: ((zone: string | undefined) => void) | undefined;\n    /** Where the canvas writes its viewport as its camera comes to rest (#1393); `undefined`, it writes nowhere. */\n    readonly viewport: SchematicViewportStore | undefined;\n    /** Told whether the zoom stands at Fit and at its limit, as either changes (#1393). */\n    readonly onZoomRange: ((range: ZoomRange) => void) | undefined;\n    /**\n     * Told as the viewer acts on the camera — a press, the wheel, a pinch, a zoom, Fit, the minimap, a fly — each its\n     * transition into a mode; never a resize, which moves the camera by none.\n     */\n    readonly onAction: (() => void) | undefined;\n    /** What `fit` flies the camera to as the narrowing changes (§10.3): the narrowing it is keyed on, and whether what it flies to is read. */\n    readonly narrowingFit: SchematicCanvasFit;\n    /** The box `fit` flies to: the matches the canvas draws of the kinds read whole or complete, and each kind read by area's narrowing's. */\n    readonly fitBox: WorldBox | undefined;\n    /** The camera ({@link useCamera}'s). */\n    readonly camera: Camera;\n    /** The commit-phase snapshot and the painter's apply (`use-paint.ts`). */\n    readonly paint: Paint;\n}\n\n/**\n * What moves the camera, and what the camera tells as it moves (see the module docs).\n *\n * @param props - The canvas's element and the drawing's extent, what the camera tells and whom, the narrowing's look and\n *   its matches, the camera, and the snapshot and the painter's apply\n * @returns The frame applier, a press's draw of a frame still waiting, the mode machine's transition, the fly, Fit, a\n *   zoom about the middle, and the minimap's jump and the pointer dragging it\n */\nexport function useCameraMoves({\n    canvasRef, W, H, lod, shownZones, narrowedOut, onZoneInView, viewport, onZoomRange, onAction, narrowingFit, fitBox, camera, paint,\n}: CameraMovesProps) {\n    const { size, cameraRef, cameraSnapshot, setCameraSnapshot, fit, home, ppu, maxZoom } = camera;\n    const { renderSnapRef, applyCamera } = paint;\n    const modeRef = useRef<CameraMode>(\"idle\");\n    const animRef = useRef<number | null>(null);\n\n    // The zone the viewport is in (#1389): the one covering most of it, kept until it clearly loses, none at the fit —\n    // among the zones the Index lists, what the narrowing takes out left out (#1392) — told the frame as it changes, and\n    // only as the camera comes to rest, as where the viewport rests is told (#1570): 100 ms without a move, or while it\n    // moves slower than a viewport and zooms by less than a quarter each 200 ms; never during a fly, which lands where it\n    // flies, nor at each frame of a pan or a wheel's zoom. The Index opens the zone it is told and reads its items: told\n    // the zones a move passes on its way, it opened and read each in turn.\n    const listedZones = useMemo(() => (narrowedOut.size === 0 ? shownZones : shownZones.filter(z => !narrowedOut.has(z.key))), [shownZones, narrowedOut]);\n    const inViewRef = useRef<string | undefined>(undefined);\n    const zoneToldRef = useRef<ViewTold | undefined>(undefined);\n    useEffect(() => {\n        if (onZoneInView === undefined || size === null || ppu === 0) return undefined;\n        const box = {\n            minX: -cameraSnapshot.tx / ppu, minY: -cameraSnapshot.ty / ppu,\n            maxX: (size.w - cameraSnapshot.tx) / ppu, maxY: (size.h - cameraSnapshot.ty) / ppu,\n        };\n        const centre = { x: (box.minX + box.maxX) / 2, y: (box.minY + box.maxY) / 2 };\n        const fitted = cameraSnapshot.zoom <= 1.05;\n        const tell = () => {\n            zoneToldRef.current = { at: performance.now(), ...centre, ppu };\n            const was = inViewRef.current;\n            const next = zoneInView(listedZones, { box, fitted }, was);\n            if (next === undefined ? was === undefined : was !== undefined && stringEqual(next, was)) return;\n            inViewRef.current = next;\n            onZoneInView(next);\n        };\n        const told = zoneToldRef.current;\n        const span = Math.max(box.maxX - box.minX, box.maxY - box.minY);\n        if (told === undefined || (modeRef.current !== \"flying\" && tellsAsItMoves(told, { at: performance.now(), ...centre, ppu, span }))) {\n            tell();\n            return undefined;\n        }\n        // A fly's frames each put this off again, and the one after its last tells: one late enough to run mid-fly tells nothing.\n        const timer = setTimeout(() => { if (modeRef.current !== \"flying\") tell(); }, REST_READ_MS);\n        return () => clearTimeout(timer);\n    }, [onZoneInView, size, ppu, cameraSnapshot, listedZones]);\n\n    // --- Where the viewport rests (#1393): what a kind read by area reads its window around. ---\n    // Told to the reader's store as the camera comes to rest — 100 ms without a move, or while it moves slower than a\n    // viewport and zooms by less than a quarter each 200 ms, a fly never, as it lands where it flies (CL6) — rendering\n    // nothing for it; the first at once, so the first window is read as the canvas opens.\n    const toldRef = useRef<ViewTold | undefined>(undefined);\n    useEffect(() => {\n        if (viewport === undefined || size === null || ppu === 0) return undefined;\n        const box = {\n            minX: -cameraSnapshot.tx / ppu, minY: -cameraSnapshot.ty / ppu,\n            maxX: (size.w - cameraSnapshot.tx) / ppu, maxY: (size.h - cameraSnapshot.ty) / ppu,\n        };\n        const centre = { x: (box.minX + box.maxX) / 2, y: (box.minY + box.maxY) / 2 };\n        const tell = () => {\n            viewport.set({ box, ppu, lod });\n            toldRef.current = { at: performance.now(), ...centre, ppu };\n        };\n        const told = toldRef.current;\n        if (told === undefined || viewport.get() === undefined) { tell(); return undefined; }\n        const span = Math.max(box.maxX - box.minX, box.maxY - box.minY);\n        if (modeRef.current !== \"flying\" && tellsAsItMoves(told, { at: performance.now(), ...centre, ppu, span })) {\n            tell();\n            return undefined;\n        }\n        const timer = setTimeout(tell, REST_READ_MS);\n        return () => clearTimeout(timer);\n    }, [viewport, size, ppu, cameraSnapshot, lod]);\n\n    // Coalesce many camera mutations within a frame into one paint + one\n    // throttled snapshot — keeps the hot pan path off React (invariant 2). Each\n    // frame is asked of the page's frame clock as it is then, as a fly's are, so\n    // one clock runs every camera move: a test's own, when it runs one.\n    const coalescerRef = useRef<RafCoalescer | null>(null);\n    if (coalescerRef.current === null && typeof requestAnimationFrame !== \"undefined\") {\n        coalescerRef.current = makeRafCoalescer((run) => requestAnimationFrame(run), (handle) => cancelAnimationFrame(handle));\n    }\n    const requestRender = useCallback(() => {\n        const run = () => {\n            applyCamera();\n            const cam = cameraRef.current;\n            setCameraSnapshot(prev => (prev.zoom === cam.zoom && prev.tx === cam.tx && prev.ty === cam.ty)\n                ? prev : { zoom: cam.zoom, tx: cam.tx, ty: cam.ty });\n        };\n        const cz = coalescerRef.current;\n        if (cz !== null) cz.request(run); else run();\n    }, [applyCamera, cameraRef, setCameraSnapshot]);\n\n    // The camera at Fit once the canvas takes its size (#1393), and again as its size moves while it stands there — a\n    // pane opening beside it — so the drawing stays framed at Fit; a camera moved from Fit stays where it was moved.\n    const homeRef = useRef<Viewport>(IDENTITY);\n    useLayoutEffect(() => {\n        if (fit === 0) return;\n        const was = homeRef.current, cam = cameraRef.current;\n        homeRef.current = home;\n        if (cam.zoom !== was.zoom || cam.tx !== was.tx || cam.ty !== was.ty) return;\n        cameraRef.current = home;\n        requestRender();\n    }, [fit, home, requestRender, cameraRef]);\n\n    // The toolbar hears where the zoom stands (#1393): at Fit its Zoom out takes no press, at the limit its Zoom in.\n    const zoomRangeRef = useRef<ZoomRange | undefined>(undefined);\n    useEffect(() => {\n        if (onZoomRange === undefined || fit === 0) return;\n        const range = { atFit: cameraSnapshot.zoom <= 1 + 1e-9, atLimit: cameraSnapshot.zoom >= maxZoom - 1e-9 };\n        const was = zoomRangeRef.current;\n        if (was !== undefined && was.atFit === range.atFit && was.atLimit === range.atLimit) return;\n        zoomRangeRef.current = range;\n        onZoomRange(range);\n    }, [onZoomRange, fit, cameraSnapshot.zoom, maxZoom]);\n\n    // A press meets what the canvas has drawn (invariant 9): a camera move still waiting on its frame — Fit, a zoom, the\n    // wheel, a fly's last step — is drawn and committed first, so the culling, the tiers and the routes a press, a tap or\n    // a double-click hit-tests are those of the camera it lands on, never the frame's before. Asked only as a press\n    // lands: a move, a hover or a drag over the canvas waits for the frame as the drawing does.\n    const drawPending = useCallback(() => {\n        const snap = renderSnapRef.current;\n        const cam = cameraRef.current;\n        if (snap.size === null || (snap.camera.zoom === cam.zoom && snap.camera.tx === cam.tx && snap.camera.ty === cam.ty)) return;\n        flushSync(() => { setCameraSnapshot({ zoom: cam.zoom, tx: cam.tx, ty: cam.ty }); });\n    }, [renderSnapRef, cameraRef, setCameraSnapshot]);\n\n    // Interaction-mode machine: an input mode supersedes a running fly as a\n    // transition, not a hand-added cancel at each call site (P4 / invariant 5).\n    const cancelFlyRaf = useCallback(() => {\n        if (animRef.current !== null) { cancelAnimationFrame(animRef.current); animRef.current = null; }\n    }, []);\n    // What hears the viewer's action, the latest, read as a transition runs: one heard or let go remakes no handler.\n    const actionRef = useRef(onAction);\n    useLayoutEffect(() => { actionRef.current = onAction; }, [onAction]);\n    const transition = useCallback((event: CameraEvent) => {\n        if (cancelsFly(modeRef.current, event)) cancelFlyRaf();\n        modeRef.current = nextMode(modeRef.current, event);\n        // Into a mode is the viewer's action — every press on the canvas, the wheel, a pinch, a zoom, Fit, the minimap and\n        // a fly enters one; a release and a fly's end leave one, and a resize enters none.\n        if (event !== \"pointerUp\" && event !== \"flyEnd\") actionRef.current?.();\n    }, [cancelFlyRaf]);\n\n    // Animated fly-to: frame a world rect with padding, writing the live camera\n    // each frame (cancellable by any user input via the mode machine) — in the\n    // view's width less what covers it from its right, `clearRight` px: a\n    // popover hung over the canvas, while a third of the view stays clear.\n    const flyTo = useCallback((rect: { x: number; y: number; w: number; h: number }, clearRight = 0) => {\n        if (renderSnapRef.current.size === null || renderSnapRef.current.fit === 0) return;\n        // Re-derive the destination from the LIVE viewport every frame, so a\n        // resize mid-fly (a pane opening, a window resize) re-aims the landing\n        // instead of framing against the stale start-time size/fit.\n        const frame = (): Viewport | null => {\n            const sz = renderSnapRef.current.size, ft = renderSnapRef.current.fit;\n            if (sz === null || ft === 0) return null;\n            const w = clearRight > 0 && sz.w - clearRight >= sz.w / 3 ? sz.w - clearRight : sz.w;\n            const zoom = Math.min(renderSnapRef.current.maxZoom, Math.min(w / (rect.w * FLY_PAD * ft), sz.h / (rect.h * FLY_PAD * ft)));\n            return {\n                zoom,\n                tx: w / 2 - (rect.x + rect.w / 2) * ft * zoom,\n                ty: sz.h / 2 - (rect.y + rect.h / 2) * ft * zoom,\n            };\n        };\n        const from = { ...cameraRef.current };\n        const start = performance.now();\n        if (animRef.current !== null) cancelAnimationFrame(animRef.current);\n        transition(\"flyStart\");\n        // Each frame reads the clock the fly began on, never the frame's own stamp: a page stamps its frames on its frame\n        // clock, which can stand before the gesture that began the fly, or — off a browser — on another origin (#1393).\n        const step = () => {\n            const elapsed = performance.now() - start;\n            const target = frame();\n            if (target !== null) {\n                cameraRef.current = flyStep(from, target, elapsed);\n                applyCamera();\n                const cam = cameraRef.current;\n                setCameraSnapshot({ zoom: cam.zoom, tx: cam.tx, ty: cam.ty });\n            }\n            if (elapsed < FLY_DURATION_MS) { animRef.current = requestAnimationFrame(step); }\n            else { animRef.current = null; transition(\"flyEnd\"); }\n        };\n        animRef.current = requestAnimationFrame(step);\n    }, [applyCamera, transition, renderSnapRef, cameraRef, setCameraSnapshot]);\n\n    // Wheel zooms about the cursor (no modifier — a dedicated canvas owns the\n    // wheel, like any map); attached non-passively so preventDefault stops the\n    // page scrolling. Mutates the live camera, then requests one frame.\n    useEffect(() => {\n        const el = canvasRef.current;\n        if (!el) return;\n        const onWheel = (e: WheelEvent) => {\n            e.preventDefault();\n            const rect = el.getBoundingClientRect();\n            const px = e.clientX - rect.left, py = e.clientY - rect.top;\n            transition(\"wheel\");\n            const snap = renderSnapRef.current;\n            cameraRef.current = zoomAbout(cameraRef.current, Math.exp(-e.deltaY * 0.0015), px, py, 1, snap.maxZoom, snap.home);\n            requestRender();\n        };\n        el.addEventListener(\"wheel\", onWheel, { passive: false });\n        return () => el.removeEventListener(\"wheel\", onWheel);\n    }, [transition, requestRender, canvasRef, renderSnapRef, cameraRef]);\n\n    const resetView = useCallback(() => {\n        transition(\"cancel\");           // cancels a running fly via the mode machine\n        cameraRef.current = renderSnapRef.current.home;\n        requestRender();\n    }, [transition, requestRender, cameraRef, renderSnapRef]);\n    const zoomBy = useCallback((factor: number) => {\n        const snap = renderSnapRef.current;\n        const sz = snap.size;\n        if (sz === null) return;\n        transition(\"zoom\");\n        cameraRef.current = zoomAbout(cameraRef.current, factor, sz.w / 2, sz.h / 2, 1, snap.maxZoom, snap.home);\n        requestRender();\n    }, [transition, requestRender, renderSnapRef, cameraRef]);\n\n    // Minimap is a camera writer (jump on press, follow on drag — invariant 8): whose its drag is, and each way it ends,\n    // are its surface's (`view.tsx`' `minimapSurface`, invariant 34).\n    const minimapJump = useCallback((el: HTMLElement, clientX: number, clientY: number) => {\n        const sz = renderSnapRef.current.size;\n        if (sz === null) return;\n        const rect = el.getBoundingClientRect();\n        const cx = ((clientX - rect.left) / rect.width) * W;\n        const cy = ((clientY - rect.top) / rect.height) * H;\n        const cam = cameraRef.current;\n        cameraRef.current = { ...cam, tx: sz.w / 2 - cx * renderSnapRef.current.fit * cam.zoom, ty: sz.h / 2 - cy * renderSnapRef.current.fit * cam.zoom };\n        requestRender();\n    }, [W, H, requestRender, renderSnapRef, cameraRef]);\n\n    // Tear down any pending frame / fly on unmount.\n    useEffect(() => () => {\n        coalescerRef.current?.cancel();\n        if (animRef.current !== null) cancelAnimationFrame(animRef.current);\n    }, [animRef]);\n\n    // `fit` (§10.3): the camera flies to the matches as the narrowing changes — keyed on the narrowing itself, each source's\n    // choices, never on which entities match nor where they are, so neither a zoom that moves what a kind read by area's\n    // window draws nor a Move flies it — once what it flies to is read: the matches of the kinds read whole or complete,\n    // and each kind read by area's narrowing's box as its area index answers it. Once the canvas has its size, so a\n    // narrowing a reload restores is flown to too. A narrowing cleared leaves the camera where it is, and one holding\n    // nothing to fly to flies nowhere.\n    const flownRef = useRef<string | undefined>(undefined);\n    const sized = size !== null;\n    useEffect(() => {\n        const key = narrowingFit.key;\n        if (key === undefined) { flownRef.current = undefined; return; }\n        if (!sized || narrowingFit.reading || (flownRef.current !== undefined && stringEqual(flownRef.current, key))) return;\n        flownRef.current = key;\n        const box = renderSnapRef.current.fitBox;\n        if (box !== undefined) flyTo({ x: box.minX, y: box.minY, w: Math.max(box.maxX - box.minX, 1e-3), h: Math.max(box.maxY - box.minY, 1e-3) });\n    }, [narrowingFit.key, narrowingFit.reading, fitBox, sized, flyTo, renderSnapRef]);\n    return { requestRender, drawPending, transition, flyTo, resetView, zoomBy, minimapJump };\n}\n\n/** What moves the camera: {@link useCameraMoves}'s. */\nexport type CameraMoves = ReturnType<typeof useCameraMoves>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's edits (#1388, `Schematic Builder Spec.md` §7, SC5, SC7–SC10)\n * — pure and React-free: what each gesture on the canvas writes, as the rows\n * of the app's records it changes. The canvas records each gesture's edits as\n * one step of its history (`editing.ts`), each edit through its kind's own\n * `write` or `create`, so a gesture writes only the fields its roles map\n * (SC2).\n *\n * - **Move** places every item it moves by the drag's delta, rigidly: the\n *   delta is clamped so each centre stays within the extent (SC8).\n * - **Connect** adds a link of the Connect tool's kind between two items,\n *   under the key its kind makes (SC7, SC9; `editing.ts`' `newKey`, #1549) —\n *   refused, naming the link, where the key its row builds is taken.\n * - **A Shift session** folds its drags' pairs into a net's two sides, keeping\n *   membership: the first pair sets both sides, a pair from a member adds the\n *   other item downstream, one into a member adds it upstream, and a member\n *   never changes side. Its first Shift-drag makes it a net of the first\n *   editable net kind whose sides hold its members, deleting the links it\n *   absorbs; each later one writes the net's sides. With no such kind, each\n *   drag adds a link.\n * - **Retarget** writes the end of a link it moves; **Extend** adds an item to\n *   a net's destinations (SC10).\n * - **Delete** deletes the selected link or net, or takes a net leg's item\n *   off its side — the net deleted once a side holds none — and deletes the\n *   selected items with every link naming one and every net leg naming one\n *   (D7, SC5). An item a link or a net bound read only names is not deleted:\n *   the gesture is refused, naming it.\n *\n * A gesture onto an item of a slot the kind's end or side holds no keys of is\n * refused before its draft snaps, naming the end, as the connect veto's words\n * are (SC9); so is one naming an item held under a placeholder — a new item's\n * key still to be typed (#1549) — in a link's end or a net's side.\n *\n * **A key built from the row follows the row** (#1549, {@link followBuiltKeys}):\n * a gesture writing the fields its kind's `key` reads moves the row under the\n * key they build, its details row with it, and the links and nets naming an\n * item follow — refused, naming the row, where another row holds that key\n * once the gesture is made, so a swap or a shift passes (#1581), and where a\n * link or net kind that may name a moving item isn't held whole (#1580): its\n * rows the rail's filters hide, or not read, would keep the old key; and where\n * what follows a moving row — its details, the rows naming it — takes no edit\n * now (#1584), a Save of it in flight. They follow a new item's key typed in\n * the inspector too; and a Shift session follows its net as its sides move it\n * ({@link followSession}).\n *\n * A library card's drop (#1390, `drop.ts`) writes its rows as edits too: an\n * item template's new item, a backlog row placed, a link or net template's\n * values written over a link or a net of its kind, and an author's card's\n * fields set on an entity. So does the inspector (#1391): a field of its\n * form, of the row or its details row; the row a kind's own Details hands\n * back; an item's centre, or Unplace; a link's ends; a net's sides; and below\n * 480px of main an item's Connect to… (#1394, D15), a link from it as a\n * Connect drag draws one.\n *\n * The host's veto (`canConnect`, #1401, D34) is asked the same way by every\n * route that connects two items ({@link connectVeto}): a Connect drag's draft\n * and its release, a Retarget's and an Extend's, and the inspector's Connect\n * to…, ends and sides — of every pair the gesture newly joins under the kind it\n * writes ({@link vetoOfPairs}): a link's one; a net a Shift session grows into,\n * every pair of its sides, the runs it gathers among them; and a change of a\n * net's sides — a Shift-drag's, an Extend's, the inspector's — each pair it\n * newly joins ({@link joinedPairs}), never the pair dragged alone.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, some, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport { Schematic } from \"@elaraai/e3-ui/internal\";\nimport { kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { entityId, refOfId, type SchematicDrawn, type SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport type { SchematicMove, SchematicNewKey } from \"./editing.js\";\nimport { detailsKey } from \"./record-keys.js\";\n\n/** A point in world units. */\ntype Point = ValueTypeOf<typeof Schematic.Types.Point>;\n/** A link's ends, as a gesture writes them. */\nexport type SchematicEnds = ValueTypeOf<typeof Schematic.Types.Ends>;\n/** A net's sides, as a gesture writes them. */\nexport type SchematicSides = ValueTypeOf<typeof Schematic.Types.Sides>;\n/** An author's tab, decoded. */\ntype AuthorTabValue = Extract<SchematicValue[\"library\"][number], { type: \"tab\" }>[\"value\"];\n/** One field an author's card sets (#1390): its path, and its value as bytes at the field's type. */\nexport type SchematicFieldWrite = AuthorTabValue[\"cards\"][number][\"sets\"][number];\n\nconst stringEqual = equalFor(StringType);\nconst sidesEqual = equalFor(Schematic.Types.Sides);\n\n/**\n * One row a gesture changes, by its kind's slot and its key, and how — each\n * written through its kind's own `write` or `create`:\n *\n * - `place`: an item's centre — placed, or with `none` unplaced;\n * - `ends`: a link's ends;\n * - `sides`: a net's sides;\n * - `link`, `net`: a new link or net, its key minted, its other fields its\n *   type's defaults or a template's values;\n * - `item`: a new item, its key minted, at its centre, its other fields a\n *   template's values or their types' defaults (#1390);\n * - `retype`: a link's or a net's fields a template of its kind gives, its\n *   ends or its sides and its key as they are (#1390);\n * - `set`: the fields an author's card sets (#1390), or the inspector's\n *   form edits (#1391), every other field as it was — of the row, or of its\n *   details row (`details`);\n * - `row`: the row as a kind's own Details hands it back (`update`, #1391),\n *   whole — the row's, or its details row's;\n * - `move`: the row — or its details row (`details`) — under a new key, as the\n *   gesture finds it, and gone from its own (#1549): a row whose kind builds\n *   its key from its fields, once a gesture moves them; or a new item's\n *   placeholder, once its key is typed. In a swap or a shift (#1581) it\n *   `replaces` the row the gesture moves off its new key — never a new one —\n *   and its own key, which another row the gesture moves takes, is `refilled`:\n *   not deleted;\n * - `remove`: the row deleted.\n */\nexport type SchematicEdit =\n    | { readonly op: \"place\"; readonly ref: SchematicRef; readonly at: option<Point> }\n    | { readonly op: \"ends\"; readonly ref: SchematicRef; readonly ends: SchematicEnds }\n    | { readonly op: \"sides\"; readonly ref: SchematicRef; readonly sides: SchematicSides }\n    | { readonly op: \"link\"; readonly ref: SchematicRef; readonly ends: SchematicEnds; readonly values: option<Uint8Array> }\n    | { readonly op: \"net\"; readonly ref: SchematicRef; readonly sides: SchematicSides; readonly values: option<Uint8Array> }\n    | { readonly op: \"item\"; readonly ref: SchematicRef; readonly at: option<Point>; readonly values: option<Uint8Array> }\n    | { readonly op: \"retype\"; readonly ref: SchematicRef; readonly values: Uint8Array }\n    | { readonly op: \"set\"; readonly ref: SchematicRef; readonly sets: readonly SchematicFieldWrite[]; readonly details?: true }\n    | { readonly op: \"row\"; readonly ref: SchematicRef; readonly row: Uint8Array; readonly details?: true }\n    | { readonly op: \"move\"; readonly ref: SchematicRef; readonly to: string; readonly details?: true; readonly replaces?: true; readonly refilled?: true }\n    | { readonly op: \"remove\"; readonly ref: SchematicRef };\n\n/** A link kind, as the edits read it: its name, whether it writes, and the item slots each end holds keys of. */\nexport interface EditLinkKind {\n    readonly name: string;\n    readonly editable: boolean;\n    readonly from: readonly string[];\n    readonly to: readonly string[];\n}\n\n/** A net kind, as the edits read it: its name, whether it writes, and the item slot each side holds keys of. */\nexport interface EditNetKind {\n    readonly name: string;\n    readonly editable: boolean;\n    readonly sources: string;\n    readonly destinations: string;\n}\n\n/** An item kind's keys, as the edits read them (#1549): its name, and its keys — what tells a placeholder. */\nexport interface EditItemKeys {\n    readonly name: string;\n    readonly keys: KindKeys;\n}\n\n/** The Schematic's kinds, as the edits read them: which write, and what each link's ends and each net's sides hold. */\nexport interface EditKinds {\n    /** The slots of the item kinds that write: bound with their patch door, and the Schematic not read only. */\n    readonly items: ReadonlySet<string>;\n    /** Every item kind's keys, by its slot (#1549): a gesture naming an item held under a placeholder is refused. */\n    readonly itemKeys: ReadonlyMap<string, EditItemKeys>;\n    /** Each link kind, by its slot, in the order the Schematic lists them. */\n    readonly links: ReadonlyMap<string, EditLinkKind>;\n    /** Each net kind, by its slot, in the order the Schematic lists them. */\n    readonly nets: ReadonlyMap<string, EditNetKind>;\n}\n\n/**\n * The Schematic's kinds as the edits read them: a kind writes when it is bound\n * with its patch door, and none does while the Schematic is read only (SC14).\n *\n * @param value - The payload\n * @returns The kinds\n */\nexport function editKinds(value: Pick<SchematicValue, \"items\" | \"links\" | \"nets\" | \"readOnly\">): EditKinds {\n    const writes = (editable: boolean) => editable && !value.readOnly;\n    return {\n        items: new Set(value.items.filter((kind) => writes(kind.editable)).map((kind) => kind.key)),\n        itemKeys: new Map(value.items.map((kind) => [kind.key, { name: kind.name, keys: kindKeys(kind.keyType) }] as const)),\n        links: new Map(value.links.map((kind) => [kind.key, { name: kind.name, editable: writes(kind.editable), from: kind.ends.from, to: kind.ends.to }] as const)),\n        nets: new Map(value.nets.map((kind) => [kind.key, {\n            name: kind.name, editable: writes(kind.editable), sources: kind.sides.sources, destinations: kind.sides.destinations,\n        }] as const)),\n    };\n}\n\n/**\n * Why a gesture is refused, for its words:\n *\n * - `end`: a link's end, or a net's side, its kind holds no item of that\n *   slot at — `start` the link's from or the net's sources, `end` the link's\n *   to or the net's destinations;\n * - `named`: an item a link or a net bound read only names, which a Delete\n *   would leave naming an item no kind holds;\n * - `placeholder`: an item held under a placeholder, its key still to be\n *   typed (#1549), which no link's end or net's side names until it is — by its\n *   kind's name.\n */\nexport type EditRefusal =\n    | { readonly why: \"end\"; readonly kind: string; readonly end: \"start\" | \"end\"; readonly item: string }\n    | { readonly why: \"named\"; readonly item: string; readonly kind: string; readonly key: string }\n    | { readonly why: \"placeholder\"; readonly kind: string; readonly item: string };\n\n/** An item a gesture names: its reference, and its label for a refusal's words. */\nexport interface EditItem {\n    readonly ref: SchematicRef;\n    readonly label: string;\n}\n\n/**\n * Why a gesture can't name an item in a link's end or a net's side (#1549):\n * it is held under a placeholder, its key still to be typed.\n *\n * @param kinds - The Schematic's kinds\n * @param item - The item\n * @returns The refusal; `undefined` for an item under its key\n */\nexport function placeholderRefusal(kinds: EditKinds, item: EditItem): EditRefusal | undefined {\n    const kind = kinds.itemKeys.get(item.ref.kind);\n    return kind === undefined || kind.keys.isKey(item.ref.key) ? undefined : { why: \"placeholder\", kind: kind.name, item: item.label };\n}\n\n/** Why the Schematic may not hold every row of a link or net kind (#1580): the rail's filters leave some out, or they are not read. */\nexport type SchematicUnheld = \"filtered\" | \"unread\";\n\n/** Why a gesture records nothing (#1549), as the footer says it. */\nexport type SchematicKeyRefusal =\n    /** The key a row builds is held already, by the row of that key. */\n    | { readonly refusal: \"taken\"; readonly ref: SchematicRef }\n    /** Its kind's keys are of a type the form can't type — by the type's name — and its kind builds none: by the kind's slot. */\n    | { readonly refusal: \"untyped\"; readonly kind: string; readonly type: string }\n    /**\n     * An item whose key the gesture moves, which a link or a net kind that writes may name, the Schematic not holding every\n     * row of that kind — by its slot, and why (#1580): what names the item there would keep naming its old key; or rows of\n     * it naming the item taking no edit now — `busy`, a Save of them in flight (#1584): what follows the item could not.\n     */\n    | { readonly refusal: \"unheld\"; readonly ref: SchematicRef; readonly kind: string; readonly why: SchematicUnheld | \"busy\" }\n    /** A row whose key the gesture moves, its details row with it, whose details take no edit now — a Save of them in flight (#1584). */\n    | { readonly refusal: \"details\"; readonly ref: SchematicRef };\n\n/**\n * A new row's key as its kind makes it (`editing.ts`' `newKey`, #1549), or why\n * the gesture records nothing.\n *\n * @param slot - The row's kind\n * @param keyed - What its kind makes\n * @returns The key, or the refusal; `undefined` while the key is still to be read\n */\nexport function keyedRow(slot: string, keyed: SchematicNewKey | undefined): { readonly key: string } | { readonly refused: SchematicKeyRefusal } | undefined {\n    if (keyed === undefined) return undefined;\n    if (\"taken\" in keyed) return { refused: { refusal: \"taken\", ref: { kind: slot, key: keyed.taken } } };\n    if (\"untyped\" in keyed) return { refused: { refusal: \"untyped\", kind: slot, type: keyed.untyped } };\n    return keyed;\n}\n\n// ============================================================================\n// Move\n// ============================================================================\n\n/** An item a Move moves: its reference, and its centre where the drag found it. */\nexport interface Mover {\n    readonly ref: SchematicRef;\n    readonly x: number;\n    readonly y: number;\n}\n\n/**\n * A drag's delta, clamped so every item it moves keeps its centre within the\n * extent, the items keeping their places to one another (SC8). An item outside\n * the extent already moves no further out, and is never pulled in.\n *\n * @param movers - The items the drag moves, where it found them\n * @param dx - The drag's delta along x, in world units\n * @param dy - The drag's delta along y\n * @param extent - The drawing's world bounds\n * @returns The delta the items move by\n */\nexport function clampDelta(movers: readonly Mover[], dx: number, dy: number, extent: { readonly width: number; readonly height: number }): { dx: number; dy: number } {\n    if (movers.length === 0) return { dx, dy };\n    let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;\n    for (const mover of movers) {\n        minX = Math.min(minX, mover.x); maxX = Math.max(maxX, mover.x);\n        minY = Math.min(minY, mover.y); maxY = Math.max(maxY, mover.y);\n    }\n    const clamp = (d: number, low: number, high: number) => Math.min(Math.max(d, Math.min(0, low)), Math.max(0, high));\n    return { dx: clamp(dx, -minX, extent.width - maxX), dy: clamp(dy, -minY, extent.height - maxY) };\n}\n\n/**\n * What a Move writes (SC8): each item's centre, by the delta — none for a drag\n * that moved nothing.\n *\n * @param movers - The items it moves, where the drag found them\n * @param delta - The delta, clamped ({@link clampDelta})\n * @returns The edits\n */\nexport function moveEdits(movers: readonly Mover[], delta: { readonly dx: number; readonly dy: number }): SchematicEdit[] {\n    if (delta.dx === 0 && delta.dy === 0) return [];\n    return movers.map((mover) => ({ op: \"place\", ref: mover.ref, at: some({ x: mover.x + delta.dx, y: mover.y + delta.dy }) }));\n}\n\n// ============================================================================\n// Connect, and its Shift session\n// ============================================================================\n\n/** One drag of a Connect gesture: the item it runs from and the one it runs to. */\nexport interface ConnectPair {\n    readonly from: SchematicRef;\n    readonly to: SchematicRef;\n}\n\n/**\n * A connect session: the links it absorbs when it grows into a net — those its\n * drags drew, or the selected link it was seeded with — and that net, once it\n * did. Their ends and sides are the drawing's, as they stand when its next\n * drag lands ({@link SessionDrawn}), so Undo, Redo or another gesture between\n * two drags is the session's too.\n */\nexport interface ConnectSession {\n    /** The links it absorbs when it grows into a net. */\n    readonly links: readonly SchematicRef[];\n    /** The net it grew into, once it did. */\n    readonly net: SchematicRef | undefined;\n}\n\n/** A session's links and net as the drawing holds them now. */\nexport interface SessionDrawn {\n    /** A link's ends; `undefined` for one the drawing holds none of. */\n    readonly ends: (ref: SchematicRef) => ConnectPair | undefined;\n    /** A net's sides; `undefined` for one the drawing holds none of. */\n    readonly sides: (ref: SchematicRef) => SchematicSides | undefined;\n}\n\nconst refEqual = (a: SchematicRef, b: SchematicRef): boolean => stringEqual(a.kind, b.kind) && stringEqual(a.key, b.key);\nconst holds = (refs: readonly SchematicRef[], ref: SchematicRef): boolean => refs.some((held) => refEqual(held, ref));\nconst NO_SIDES: SchematicSides = { sources: [], destinations: [] };\n\n/**\n * A pair folded onto a net's two sides, keeping membership: onto no sides, it\n * sets both; from a member, it adds the other item downstream; into a member,\n * upstream; between two new items, each to its side; and between two members,\n * nothing — a member never changes side.\n *\n * @param sides - The sides it folds onto\n * @param pair - The pair\n * @returns The sides after it\n */\nexport function foldPair(sides: SchematicSides, pair: ConnectPair): SchematicSides {\n    const member = (ref: SchematicRef) => holds(sides.sources, ref) || holds(sides.destinations, ref);\n    if (sides.sources.length === 0 && sides.destinations.length === 0) return { sources: [pair.from], destinations: [pair.to] };\n    const from = member(pair.from), to = member(pair.to);\n    if (from && to) return sides;\n    return {\n        sources: from ? sides.sources : [...sides.sources, pair.from],\n        destinations: to ? sides.destinations : [...sides.destinations, pair.to],\n    };\n}\n\n/**\n * Pairs folded into a net's two sides, in order ({@link foldPair}).\n *\n * @param pairs - The pairs\n * @returns The sides\n */\nexport function foldSession(pairs: readonly ConnectPair[]): SchematicSides {\n    return pairs.reduce(foldPair, NO_SIDES);\n}\n\n/**\n * The first editable net kind whose sides hold a fold's members: every source\n * of its sources' slot, every destination of its destinations'.\n *\n * @param kinds - The Schematic's kinds\n * @param sides - The fold\n * @returns The net kind's slot; `undefined` for none\n */\nexport function netKindFor(kinds: EditKinds, sides: SchematicSides): string | undefined {\n    for (const [slot, kind] of kinds.nets) {\n        if (!kind.editable) continue;\n        if (sides.sources.every((ref) => stringEqual(ref.kind, kind.sources)) && sides.destinations.every((ref) => stringEqual(ref.kind, kind.destinations))) return slot;\n    }\n    return undefined;\n}\n\n/**\n * Why a link kind can't run between two items: an end whose field holds no\n * keys of the item's slot.\n *\n * @param kind - The link kind\n * @param from - The item it would run from\n * @param to - The item it would run to\n * @returns The refusal; `undefined` when both ends hold their items\n */\nexport function linkRefusal(kind: EditLinkKind, from: EditItem, to: EditItem): EditRefusal | undefined {\n    if (!kind.from.some((slot) => stringEqual(slot, from.ref.kind))) return { why: \"end\", kind: kind.name, end: \"start\", item: from.label };\n    if (!kind.to.some((slot) => stringEqual(slot, to.ref.kind))) return { why: \"end\", kind: kind.name, end: \"end\", item: to.label };\n    return undefined;\n}\n\n/**\n * Why a net kind can't hold a fold: the first member of a slot its side holds\n * no keys of, by its label.\n *\n * @param kind - The net kind\n * @param sides - The fold\n * @param labelOf - A member's label\n * @returns The refusal; `undefined` when both sides hold their members\n */\nexport function netRefusal(kind: EditNetKind, sides: SchematicSides, labelOf: (ref: SchematicRef) => string): EditRefusal | undefined {\n    const source = sides.sources.find((ref) => !stringEqual(ref.kind, kind.sources));\n    if (source !== undefined) return { why: \"end\", kind: kind.name, end: \"start\", item: labelOf(source) };\n    const destination = sides.destinations.find((ref) => !stringEqual(ref.kind, kind.destinations));\n    if (destination !== undefined) return { why: \"end\", kind: kind.name, end: \"end\", item: labelOf(destination) };\n    return undefined;\n}\n\n/** What a Connect drag is: the session it may grow, whether Shift is held, the Connect tool's kind, and its two items. */\nexport interface ConnectDragArgs {\n    /** The open session; `undefined` for none. */\n    readonly session: ConnectSession | undefined;\n    /** Whether Shift was held as the drag began: it grows the open session. */\n    readonly shift: boolean;\n    /** The Connect tool's link kind; `undefined` where no link kind writes. */\n    readonly linkKind: string | undefined;\n    /** The item it runs from. */\n    readonly from: EditItem;\n    /** The item it runs to. */\n    readonly to: EditItem;\n    /** The session's links and net as the drawing holds them now. */\n    readonly drawn: SessionDrawn;\n    /** A member's label, for a refusal's words. */\n    readonly labelOf: (ref: SchematicRef) => string;\n}\n\n/**\n * What a Shift-drag grows: the open session's net and its sides, or the sides\n * its links fold into; `undefined` for no session — or one the drawing no\n * longer holds all of, which is over.\n */\nfunction grows(args: ConnectDragArgs): { readonly net: SchematicRef | undefined; readonly sides: SchematicSides; readonly links: readonly SchematicRef[] } | undefined {\n    const open = args.shift ? args.session : undefined;\n    if (open === undefined) return undefined;\n    if (open.net !== undefined) {\n        const sides = args.drawn.sides(open.net);\n        return sides === undefined ? undefined : { net: open.net, sides, links: [] };\n    }\n    const pairs: ConnectPair[] = [];\n    for (const ref of open.links) {\n        const ends = args.drawn.ends(ref);\n        if (ends === undefined) return undefined;\n        pairs.push(ends);\n    }\n    return { net: undefined, sides: foldSession(pairs), links: open.links };\n}\n\n/** What a Connect drag would write, before it lands: the kind it writes, why it can't, and the pairs it newly joins. */\nexport interface ConnectCandidate {\n    /** The slot of the link or net kind it writes; `undefined` where none can be written. */\n    readonly kind: string | undefined;\n    /** Why its kind can't hold the pair; `undefined` when it can. */\n    readonly refusal: EditRefusal | undefined;\n    /**\n     * Each pair it newly joins under its kind, in its sides' order — what the host's veto hears of it: a link's one pair;\n     * a net a session grows into, every pair of its sides, each run it gathers among them; an open net, each pair its new\n     * member joins. None where no kind can be written.\n     */\n    readonly pairs: readonly ConnectPair[];\n}\n\n/** No kind can be written: nothing to ask the veto of. */\nconst NO_CANDIDATE: ConnectCandidate = { kind: undefined, refusal: undefined, pairs: [] };\n\n/**\n * What a Connect drag would write (SC9): a link of the Connect tool's kind —\n * or, a Shift-drag in an open session, the session's net: its own, or the\n * first editable net kind's whose sides hold the session's members, else a\n * link. The kind it writes is what the veto hears (`Candidate.kind`), of each\n * pair it newly joins — a net's, the runs it gathers among them, never the\n * pair dragged alone — and its refusal what the draft shows.\n *\n * @param kinds - The Schematic's kinds\n * @param args - The drag\n * @returns The kind it writes, why it can't, and the pairs it newly joins\n */\nexport function connectCandidate(kinds: EditKinds, args: ConnectDragArgs): ConnectCandidate {\n    const link = args.linkKind === undefined ? undefined : kinds.links.get(args.linkKind);\n    const pair: ConnectPair = { from: args.from.ref, to: args.to.ref };\n    // An item held under a placeholder joins nothing until its key is typed (#1549).\n    const waiting = placeholderRefusal(kinds, args.from) ?? placeholderRefusal(kinds, args.to);\n    const plain = (): ConnectCandidate => (link === undefined || !link.editable ? NO_CANDIDATE\n        : { kind: args.linkKind, refusal: waiting ?? linkRefusal(link, args.from, args.to), pairs: [pair] });\n    const open = grows(args);\n    if (open === undefined) return plain();\n    const sides = foldPair(open.sides, pair);\n    if (open.net !== undefined) {\n        const net = kinds.nets.get(open.net.kind);\n        return net === undefined || !net.editable ? NO_CANDIDATE\n            : { kind: open.net.kind, refusal: waiting ?? netRefusal(net, sides, args.labelOf), pairs: joinedPairs(open.sides, sides) };\n    }\n    // Grown from links into a net: each run it gathers is a leg of the net's kind now, as the new pair is.\n    const grown = netKindFor(kinds, sides);\n    return grown !== undefined ? { kind: grown, refusal: waiting, pairs: joinedPairs(NO_SIDES, sides) } : plain();\n}\n\n/** One Connect drag landed: what it writes, and the session it leaves. */\nexport interface ConnectStep {\n    /** The edits: one step of the history. */\n    readonly edits: SchematicEdit[];\n    /** The session after it. */\n    readonly session: ConnectSession;\n}\n\n/**\n * What a Connect drag writes as it lands (SC9): a plain drag — or a session's\n * first — a new link of the Connect tool's kind; a Shift-drag in an open\n * session, the session's net — its first making it a net of the kind\n * {@link connectCandidate} names, deleting the links it absorbs, each later\n * one writing its sides — else another link. A new link or net is keyed as\n * its kind makes one (#1549): refused, saying why, where its kind makes none.\n *\n * @param kinds - The Schematic's kinds\n * @param args - The drag\n * @param newKey - A new row's key, as its kind makes one from the edit making it (`editing.ts`' `newKey`)\n * @param values - What a new link's or net's other fields take, by its kind's slot: the values of the template of that kind\n *   the library has selected (§4.3, #1390); `none`, their types' defaults\n * @returns The step, or why it records nothing; `undefined` for a drag that writes nothing — one its kind refuses, one\n *   between two members of the net, or one whose key is still to be read\n */\nexport function connectStep(kinds: EditKinds, args: ConnectDragArgs, newKey: (made: SchematicEdit) => SchematicNewKey | undefined,\n    values: (slot: string) => option<Uint8Array>): ConnectStep | { readonly refused: SchematicKeyRefusal } | undefined {\n    const candidate = connectCandidate(kinds, args);\n    const slot = candidate.kind;\n    if (slot === undefined || candidate.refusal !== undefined) return undefined;\n    const pair: ConnectPair = { from: args.from.ref, to: args.to.ref };\n    const open = grows(args);\n    if (kinds.links.has(slot)) {\n        // A link: the session's first, or one more of a session no net kind holds.\n        const made = keyedRow(slot, newKey({ op: \"link\", ref: { kind: slot, key: \"\" }, ends: pair, values: values(slot) }));\n        if (made === undefined || \"refused\" in made) return made;\n        const ref = { kind: slot, key: made.key };\n        return { edits: [{ op: \"link\", ref, ends: pair, values: values(slot) }], session: { links: [...(open?.links ?? []), ref], net: undefined } };\n    }\n    if (open === undefined) return undefined;\n    const sides = foldPair(open.sides, pair);\n    if (open.net !== undefined) {\n        // A pair between two members changes no side: nothing to write.\n        if (sidesEqual(sides, open.sides)) return undefined;\n        return { edits: [{ op: \"sides\", ref: open.net, sides }], session: { links: [], net: open.net } };\n    }\n    // The session grows into a net, which absorbs its links.\n    const made = keyedRow(slot, newKey({ op: \"net\", ref: { kind: slot, key: \"\" }, sides, values: values(slot) }));\n    if (made === undefined || \"refused\" in made) return made;\n    const net = { kind: slot, key: made.key };\n    return {\n        edits: [...open.links.map((ref): SchematicEdit => ({ op: \"remove\", ref })), { op: \"net\", ref: net, sides, values: values(slot) }],\n        session: { links: [], net },\n    };\n}\n\n/**\n * The session a Connect drag leaves, its net under the key recording the drag moved it to (#1549): a net whose kind\n * builds its key from its sides moves as a Shift-drag writes them, and the session's next drag grows it there — never a\n * link of its own.\n *\n * @param session - The session the drag's step leaves ({@link connectStep}'s)\n * @param moved - The rows recording the step moved under the keys they build ({@link followBuiltKeys}')\n * @returns The session, its net under its key now\n */\nexport function followSession(session: ConnectSession, moved: readonly SchematicMove[]): ConnectSession {\n    if (session.net === undefined) return session;\n    const net = session.net;\n    const move = moved.find((m) => refEqual(m.ref, net));\n    return move === undefined ? session : { links: session.links, net: { kind: net.kind, key: move.to } };\n}\n\n/** No session's links or net: what a plain drag reads of the drawing, and the inspector's Connect to… (#1394), which opens none. */\nexport const NO_SESSION: SessionDrawn = { ends: () => undefined, sides: () => undefined };\n\n// ============================================================================\n// The host's veto\n// ============================================================================\n\n/** The host's veto of a connection (`canConnect`, #1401, D34), decoded: its words refusing a candidate, or `none` allowing it. */\nexport type ConnectVeto = Extract<SchematicValue[\"canConnect\"], { readonly type: \"some\" }>[\"value\"];\n\n/**\n * A connection, as every route asks the host's veto of it: the link or net kind it writes, by its slot, and the item it\n * runs from and the one it runs to, by their ids — its words refusing it, or `undefined` allowing it.\n */\nexport type ConnectVetoOf = (kind: string, from: string, to: string) => string | undefined;\n\n/**\n * The host's veto as every route that connects two items asks it (#1401, D34): a Connect drag's draft and its release, a\n * Retarget's and an Extend's, and the inspector's Connect to…, ends and sides (#1394). Its verdict on each candidate is\n * kept, so a pointer's moves never ask it again for one; one that throws is logged and allows, so a broken veto never\n * blocks editing.\n *\n * @param veto - The host's veto; `undefined` for none, which allows every connection\n * @param refOf - An item's reference, by its id: what the veto hears it as; `undefined` for one it can't name, which it allows\n * @returns The veto, by the candidate's kind and its items' ids\n */\nexport function connectVeto(veto: ConnectVeto | undefined, refOf: (id: string) => SchematicRef | undefined): ConnectVetoOf {\n    if (veto === undefined) return () => undefined;\n    const verdicts = new Map<string, string | null>();\n    return (kind, from, to) => {\n        const key = `${kind}\\u0000${from}\\u0000${to}`;\n        const kept = verdicts.get(key);\n        if (kept !== undefined) return kept ?? undefined;\n        let refusal: string | null = null;\n        const fromRef = refOf(from), toRef = refOf(to);\n        if (fromRef !== undefined && toRef !== undefined) {\n            try {\n                const said = veto({ kind, from: fromRef, to: toRef });\n                refusal = said.type === \"some\" ? said.value : null;\n            } catch (err) {\n                console.error(\"[Schematic] canConnect veto failed (allowing):\", err);\n            }\n        }\n        verdicts.set(key, refusal);\n        return refusal ?? undefined;\n    };\n}\n\n/**\n * The host's veto of a gesture, as every route that connects asks it (#1401, D34): of each pair the gesture newly joins\n * under the kind it writes, in order — a link's one pair; a net's, every pair it newly joins, the runs a Shift session\n * gathers into it among them — the first it refuses saying why the gesture is.\n *\n * @param veto - The host's veto ({@link connectVeto})\n * @param kind - The link or net kind the gesture writes, by its slot\n * @param pairs - The pairs it newly joins ({@link connectCandidate}'s, {@link joinedPairs}, {@link extendPairs})\n * @returns The first refusal's words; `undefined` while it refuses none\n */\nexport function vetoOfPairs(veto: ConnectVetoOf, kind: string, pairs: readonly ConnectPair[]): string | undefined {\n    for (const pair of pairs) {\n        const said = veto(kind, entityId(pair.from), entityId(pair.to));\n        if (said !== undefined) return said;\n    }\n    return undefined;\n}\n\n/**\n * The pairs a change of a net's sides joins that its sides didn't before (#1394): each source with each destination, one\n * of the two new to its side — what the host's veto hears of the change, each pair a net's feeding member and its fed one\n * (`Schematic.Types.Candidate`), as it hears an Extend's. A change that only takes members off joins none.\n *\n * @param before - The sides as they stand\n * @param after - The sides as the change leaves them\n * @returns The pairs, in the sides' order\n */\nexport function joinedPairs(before: SchematicSides, after: SchematicSides): ConnectPair[] {\n    const pairs: ConnectPair[] = [];\n    for (const from of after.sources) {\n        const was = holds(before.sources, from);\n        for (const to of after.destinations) if (!was || !holds(before.destinations, to)) pairs.push({ from, to });\n    }\n    return pairs;\n}\n\n// ============================================================================\n// Retarget, Extend\n// ============================================================================\n\n/**\n * What a Retarget writes (SC10): the link's end it moves, onto another item.\n *\n * @param link - The link: its reference and its ends\n * @param end - The end it moves\n * @param target - The item it moves onto\n * @returns The edits; none for a move onto the link's other end — a link joins two items\n */\nexport function retargetEdits(link: { readonly ref: SchematicRef; readonly ends: SchematicEnds }, end: \"from\" | \"to\", target: SchematicRef): SchematicEdit[] {\n    const ends = end === \"from\" ? { from: target, to: link.ends.to } : { from: link.ends.from, to: target };\n    if (refEqual(ends.from, ends.to) || refEqual(end === \"from\" ? link.ends.from : link.ends.to, target)) return [];\n    return [{ op: \"ends\", ref: link.ref, ends }];\n}\n\n/** A net's sides once an Extend adds an item to its destinations; `undefined` for an item the net holds already. */\nfunction extendedSides(sides: SchematicSides, target: SchematicRef): SchematicSides | undefined {\n    if (holds(sides.sources, target) || holds(sides.destinations, target)) return undefined;\n    return { sources: sides.sources, destinations: [...sides.destinations, target] };\n}\n\n/**\n * What an Extend writes (SC10): an item added to a net's destinations.\n *\n * @param net - The net: its reference and its sides\n * @param target - The item it adds\n * @returns The edits; none for an item the net holds already\n */\nexport function extendEdits(net: { readonly ref: SchematicRef; readonly sides: SchematicSides }, target: SchematicRef): SchematicEdit[] {\n    const sides = extendedSides(net.sides, target);\n    return sides === undefined ? [] : [{ op: \"sides\", ref: net.ref, sides }];\n}\n\n/**\n * The pairs an Extend newly joins (SC10, #1394): each of the net's sources with the item it adds to its destinations —\n * what the host's veto hears of it, whichever of its members the drag began at.\n *\n * @param sides - The net's sides as they stand\n * @param target - The item it adds\n * @returns The pairs, in its sources' order; none for an item the net holds already\n */\nexport function extendPairs(sides: SchematicSides, target: SchematicRef): ConnectPair[] {\n    const after = extendedSides(sides, target);\n    return after === undefined ? [] : joinedPairs(sides, after);\n}\n\n// ============================================================================\n// Delete\n// ============================================================================\n\n/** A net's leg: the side it is on, and its item's id on the canvas. */\nexport interface NetLeg {\n    readonly end: \"source\" | \"destination\";\n    readonly item: string;\n}\n\n/** What a Delete deletes: the selected items, and the selected link or net — or one of a net's legs. */\nexport interface DeleteSelection {\n    /** The selected items, by their ids on the canvas. */\n    readonly items: ReadonlySet<string>;\n    /** The selected link or net, by its id, and its leg when a net's leg is selected; `null` for none. */\n    readonly link: { readonly key: string; readonly leg: NetLeg | null } | null;\n}\n\n/** What a Delete writes, or why it is refused. */\nexport type DeleteResult = { readonly edits: SchematicEdit[] } | { readonly refusal: EditRefusal };\n\n/**\n * What a Delete writes (SC5, SC10, D7): the selected link or net deleted, or\n * a selected leg's item taken off its side; the selected items of the kinds\n * that write deleted, with every link naming one and every net leg naming\n * one — a net deleted once a side holds none. Refused when a link or a net\n * bound read only names an item it would delete.\n *\n * @param kinds - The Schematic's kinds\n * @param drawn - What the canvas draws: the items, links and nets a Delete finds\n * @param selection - What is selected\n * @returns The edits, one step; or the refusal\n */\nexport function deleteEdits(kinds: EditKinds, drawn: Pick<SchematicDrawn, \"items\" | \"links\" | \"nets\">, selection: DeleteSelection): DeleteResult {\n    const items = drawn.items.filter((item) => selection.items.has(item.key) && kinds.items.has(item.ref.kind));\n    const gone = new Set(items.map((item) => item.key));\n    const labelOf = new Map(items.map((item) => [item.key, item.label] as const));\n    const edits: SchematicEdit[] = items.map((item) => ({ op: \"remove\", ref: item.ref }));\n    const picked = selection.link;\n    for (const link of drawn.links) {\n        const named = gone.has(link.from) ? link.from : gone.has(link.to) ? link.to : undefined;\n        const chosen = picked !== null && stringEqual(picked.key, link.key);\n        if (named === undefined && !chosen) continue;\n        const kind = kinds.links.get(link.ref.kind);\n        if (kind?.editable !== true) {\n            // A read-only link naming an item a Delete would take: refused. One merely selected stays, as it is.\n            if (named !== undefined) return { refusal: { why: \"named\", item: labelOf.get(named) ?? named, kind: kind?.name ?? link.ref.kind, key: link.ref.key } };\n            continue;\n        }\n        edits.push({ op: \"remove\", ref: link.ref });\n    }\n    for (const net of drawn.nets) {\n        const chosen = picked !== null && stringEqual(picked.key, net.key) ? picked : undefined;\n        const leg = chosen?.leg ?? null;\n        const off = (side: readonly string[], end: NetLeg[\"end\"]) => side.filter((id) => !gone.has(id) && !(leg !== null && leg.end === end && stringEqual(leg.item, id)));\n        const sources = off(net.sources, \"source\");\n        const destinations = off(net.destinations, \"destination\");\n        const named = net.sources.find((id) => gone.has(id)) ?? net.destinations.find((id) => gone.has(id));\n        const changed = sources.length !== net.sources.length || destinations.length !== net.destinations.length;\n        const whole = chosen !== undefined && leg === null;\n        if (!changed && !whole) continue;\n        const kind = kinds.nets.get(net.ref.kind);\n        if (kind?.editable !== true) {\n            if (named !== undefined) return { refusal: { why: \"named\", item: labelOf.get(named) ?? named, kind: kind?.name ?? net.ref.kind, key: net.ref.key } };\n            continue;\n        }\n        if (whole || sources.length === 0 || destinations.length === 0) {\n            edits.push({ op: \"remove\", ref: net.ref });\n            continue;\n        }\n        const refs = (ids: readonly string[]) => ids.flatMap((id) => { const ref = refOfId(id); return ref === undefined ? [] : [ref]; });\n        edits.push({ op: \"sides\", ref: net.ref, sides: { sources: refs(sources), destinations: refs(destinations) } });\n    }\n    return { edits };\n}\n\n// ============================================================================\n// A key built from the row\n// ============================================================================\n\n/** What a gesture's moves read (#1549): the rows it moves, where a row stands, which records are edited, and what names an item. */\nexport interface SchematicKeyHolding {\n    /** The Schematic's kinds. */\n    readonly kinds: EditKinds;\n    /**\n     * The rows a gesture moves under the keys their fields build once it writes them (`editing.ts`' `moves`).\n     *\n     * @param edits - The gesture's edits\n     */\n    readonly moves: (edits: readonly SchematicEdit[]) => readonly SchematicMove[];\n    /**\n     * Whether a row of a kind stands under a key: drafted, else read — one a draft deletes stands free.\n     *\n     * @param slot - The kind's slot\n     * @param key - The key's text\n     */\n    readonly stands: (slot: string, key: string) => boolean;\n    /**\n     * Whether a record is edited: a kind's, or its details' (`detailsKey`).\n     *\n     * @param record - The record's key in the history\n     */\n    readonly edited: (record: string) => boolean;\n    /** The links and nets the Schematic holds — drawn, and waiting in their sessions — their drafts in place: what names an item. */\n    readonly drawn: Pick<SchematicDrawn, \"links\" | \"nets\">;\n    /**\n     * Why the Schematic may not hold every row of a link or net kind (#1580): the rail's filters leave some out, or its read\n     * hasn't landed or failed; `undefined` where it holds them all.\n     *\n     * @param slot - The kind's slot\n     */\n    readonly unheld: (slot: string) => SchematicUnheld | undefined;\n    /**\n     * Whether a record takes an edit now (#1584): one whose Save is in flight takes none.\n     *\n     * @param record - The record's key in the history: a kind's slot, or its details' (`detailsKey`)\n     */\n    readonly takes: (record: string) => boolean;\n}\n\n/** A gesture's edits with every row it moves following its key, and the rows moved; or why it records nothing. */\nexport type FollowedEdits =\n    | { readonly edits: readonly SchematicEdit[]; readonly moved: readonly SchematicMove[] }\n    | { readonly refused: SchematicKeyRefusal };\n\n/** How many times a row's move can reach another's: an item's to the links and nets naming it, keyed by what they name. */\nconst FOLLOWS = 4;\n\n/**\n * What names the items a gesture moves, following them (#1549): each link of\n * a kind that writes naming one at an end, and each net of a kind that writes\n * naming one on a side — those drawn and those waiting — written to name it\n * under its new key, every other end and member as it was. A link or a net\n * bound read only is left, naming the key it named.\n *\n * @param holding - What the gesture reads\n * @param moves - The rows it moves\n * @returns The edits writing each one's ends or sides\n */\nfunction namers(holding: SchematicKeyHolding, moves: readonly SchematicMove[]): SchematicEdit[] {\n    const follow = (ref: SchematicRef): SchematicRef => {\n        const move = moves.find((m) => refEqual(m.ref, ref));\n        return move === undefined ? ref : { kind: ref.kind, key: move.to };\n    };\n    const moving = (ref: SchematicRef): boolean => moves.some((m) => refEqual(m.ref, ref));\n    const refs = (ids: readonly string[]) => ids.flatMap((id) => { const ref = refOfId(id); return ref === undefined ? [] : [ref]; });\n    const edits: SchematicEdit[] = [];\n    for (const link of holding.drawn.links) {\n        if (holding.kinds.links.get(link.ref.kind)?.editable !== true) continue;\n        const from = refOfId(link.from), to = refOfId(link.to);\n        if (from === undefined || to === undefined || (!moving(from) && !moving(to))) continue;\n        edits.push({ op: \"ends\", ref: link.ref, ends: { from: follow(from), to: follow(to) } });\n    }\n    for (const net of holding.drawn.nets) {\n        if (holding.kinds.nets.get(net.ref.kind)?.editable !== true) continue;\n        const sources = refs(net.sources), destinations = refs(net.destinations);\n        if (!sources.some(moving) && !destinations.some(moving)) continue;\n        edits.push({ op: \"sides\", ref: net.ref, sides: { sources: sources.map(follow), destinations: destinations.map(follow) } });\n    }\n    return edits;\n}\n\n/**\n * Why a gesture can't move the items it moves (#1580): the first link or net\n * kind that writes and may name one — an end or a side holding its slot — whose\n * rows the Schematic doesn't all hold, which {@link namers} can't follow it in.\n * An item under a placeholder no stored row names.\n *\n * @param holding - What the gesture reads\n * @param moves - The rows it moves\n * @returns The refusal; `undefined` where every kind that may name them is held whole\n */\nfunction unheldNamer(holding: SchematicKeyHolding, moves: readonly SchematicMove[]): SchematicKeyRefusal | undefined {\n    for (const move of moves) {\n        const slot = move.ref.kind;\n        const item = holding.kinds.itemKeys.get(slot);\n        if (item === undefined || !item.keys.isKey(move.ref.key)) continue;\n        const naming = [\n            ...[...holding.kinds.links].flatMap(([kind, link]) => (link.editable && [...link.from, ...link.to].some((end) => stringEqual(end, slot)) ? [kind] : [])),\n            ...[...holding.kinds.nets].flatMap(([kind, net]) => (net.editable && (stringEqual(net.sources, slot) || stringEqual(net.destinations, slot)) ? [kind] : [])),\n        ];\n        for (const kind of naming) {\n            const why = holding.unheld(kind);\n            if (why !== undefined) return { refusal: \"unheld\", ref: move.ref, kind, why };\n        }\n    }\n    return undefined;\n}\n\n/**\n * Why a gesture can't move the rows it moves where what follows one takes no\n * edit now (#1584) — a Save of it in flight: its details, where they are\n * edited, which its details row moves into with it; or the rows of a link or a\n * net kind naming an item, which {@link namers} writes. Recorded, the gesture\n * would record nothing, and say nothing of why.\n *\n * @param holding - What the gesture reads\n * @param moves - The rows it moves\n * @returns The refusal; `undefined` where every record what follows them writes takes an edit\n */\nfunction busyFollower(holding: SchematicKeyHolding, moves: readonly SchematicMove[]): SchematicKeyRefusal | undefined {\n    for (const move of moves) {\n        const details = detailsKey(move.ref.kind);\n        if (holding.edited(details) && !holding.takes(details)) return { refusal: \"details\", ref: move.ref };\n        const busy = namers(holding, [move]).find((edit) => !holding.takes(edit.ref.kind));\n        if (busy !== undefined) return { refusal: \"unheld\", ref: move.ref, kind: busy.ref.kind, why: \"busy\" };\n    }\n    return undefined;\n}\n\n/**\n * Whether a key a row moves to is held once the gesture is made (#1581):\n * another row moves there too, or a row stands there that the gesture leaves\n * there — a row moving off it frees it, so a swap or a shift passes.\n *\n * @param holding - What the gesture reads\n * @param moves - The rows the gesture moves\n * @param move - The row moving\n * @returns Whether its new key is held\n */\nfunction heldOnceMoved(holding: SchematicKeyHolding, moves: readonly SchematicMove[], move: SchematicMove): boolean {\n    const at = (kind: string, key: string): boolean => stringEqual(kind, move.ref.kind) && stringEqual(key, move.to);\n    if (moves.some((other) => other !== move && at(other.ref.kind, other.to))) return true;\n    return holding.stands(move.ref.kind, move.to) && !moves.some((other) => at(other.ref.kind, other.ref.key));\n}\n\n/**\n * A gesture's edits with each row whose kind builds its key from its row\n * moved under the key its fields build once the gesture writes them (#1549):\n * the row moved under its new key before any of its edits — its details row\n * with it, where they are edited — so each writes it there; then what names\n * it following — an item's links and nets — whose own keys, built from what\n * they name, move them in turn. A key another row stands under once the\n * gesture is made, or another moving row takes, refuses the gesture, naming\n * that key — one a row moves off is free, so a swap or a shift passes, the row\n * moving onto it replacing the one moving off, whose key it leaves standing\n * (#1581). A row the gesture moves itself — a new item's key typed in the\n * inspector — is followed the same way by what names it. An item that a link\n * or a net kind the Schematic doesn't hold whole may name refuses the gesture\n * too (#1580): what it leaves out would keep the old key; and so does a row\n * whose details, or the rows naming it, take no edit now (#1584).\n *\n * @param holding - What the gesture reads\n * @param made - The gesture's edits\n * @returns The edits with every move, and the rows moved by the keys they build; or the refusal, where a key is taken,\n *   what may name a moving item isn't held, or what follows a moving row takes no edit now\n */\nexport function followBuiltKeys(holding: SchematicKeyHolding, made: readonly SchematicEdit[]): FollowedEdits {\n    const typed = made.flatMap((edit): SchematicMove[] => (edit.op === \"move\" && edit.details !== true ? [{ ref: edit.ref, to: edit.to }] : []));\n    const unheldTyped = unheldNamer(holding, typed) ?? busyFollower(holding, typed);\n    if (unheldTyped !== undefined) return { refused: unheldTyped };\n    let edits: readonly SchematicEdit[] = typed.length === 0 ? made : [...made, ...namers(holding, typed)];\n    const moved: SchematicMove[] = [];\n    for (let pass = 0; pass < FOLLOWS && edits.length > 0; pass++) {\n        const moves = holding.moves(edits);\n        if (moves.length === 0) break;\n        for (const move of moves) {\n            if (heldOnceMoved(holding, moves, move)) return { refused: { refusal: \"taken\", ref: { kind: move.ref.kind, key: move.to } } };\n        }\n        const unheld = unheldNamer(holding, moves) ?? busyFollower(holding, moves);\n        if (unheld !== undefined) return { refused: unheld };\n        const to = (ref: SchematicRef) => moves.find((move) => refEqual(move.ref, ref))?.to;\n        // A row moving onto a key another moving row leaves replaces that row; a key another moving row takes stays.\n        const sameKind = (a: SchematicMove, b: SchematicMove) => stringEqual(a.ref.kind, b.ref.kind);\n        const flags = (move: SchematicMove) => ({\n            ...(moves.some((other) => sameKind(other, move) && stringEqual(other.ref.key, move.to)) ? { replaces: true as const } : {}),\n            ...(moves.some((other) => sameKind(other, move) && stringEqual(other.to, move.ref.key)) ? { refilled: true as const } : {}),\n        });\n        edits = [\n            ...moves.flatMap((move): SchematicEdit[] => [\n                { op: \"move\", ref: move.ref, to: move.to, ...flags(move) },\n                ...(holding.edited(detailsKey(move.ref.kind)) ? [{ op: \"move\", ref: move.ref, to: move.to, details: true, ...flags(move) } as const] : []),\n            ]),\n            ...edits.map((edit): SchematicEdit => {\n                const moving = edit.op === \"move\" || edit.op === \"remove\" ? undefined : to(edit.ref);\n                return moving === undefined ? edit : { ...edit, ref: { kind: edit.ref.kind, key: moving } };\n            }),\n            ...namers(holding, moves),\n        ];\n        moved.push(...moves);\n    }\n    return { edits, moved };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's drops (#1390, `Schematic Builder Spec.md` §7, §8,\n * SC11–SC13) — pure and React-free: what a library card does where it lands,\n * decided as data before anything is drawn or written. The frame records a\n * plan as one step of the editing's history (`use-drop.ts`), and the canvas\n * works out where a drag rests from its own drawing.\n *\n * - **What is dragged** ({@link SchematicDropCard}, {@link dropHostOf}): a\n *   card of a tab that drops — an item kind's template, which adds an item; a\n *   row of the Backlog, which places it; a link or a net kind's template,\n *   which writes its values over a link or a net of its kind; an author's\n *   card, whose patch sets its fields on an entity of the kind it names.\n * - **Where a drag rests** ({@link SchematicDropAtType}, {@link restsAt}): the\n *   point of the drawing under the pointer, for a card that adds or places an\n *   item — at the screen's resolution ({@link dropPoint}), so what the ghost\n *   says is what is written — or the entity of the card's kind under it, for\n *   one that lands on an entity; or nothing of its kind. The shared drag\n *   grammar's `CellRef` carries it in its `row`, printed.\n * - **What a drop does** ({@link planDrop}, {@link dropEdits}): an item added\n *   at the point, under the key its kind makes (SC12, #1549); a backlog row\n *   placed there (SC4); a template's values written over the link or the net,\n *   never its ends, its sides or its key (SC11); an author's card's fields set\n *   — or refused, with the reason the ghost says in red: outside the drawing,\n *   no entity of the card's kind under it, its kind read only, its kind's\n *   session taking no edit now, or its kind adding no item, its keys of a type\n *   the form can't type (#1549).\n * - **⏎ on a card** ({@link planEnter}, SC13): a card that adds or places an\n *   item lands at the view's centre — and Details' Place there too (#1394) —\n *   refused where that is off the drawing in words that say what brings the\n *   drawing to it; one that lands on an entity, on the selection — every\n *   selected entity of its kind, as one step.\n * - **Its words** ({@link dropCaption}, {@link dropName}, {@link dropRefusal},\n *   {@link dropLabel}) and **its marks** ({@link markOf}): the point a card\n *   lands at and the zone holding it, or the entity it lands on.\n *\n * @packageDocumentation\n */\n\nimport { FloatType, IntegerType, NullType, StringType, StructType, VariantType, equalFor, none, parseFor, printFor, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { Schematic } from \"@elaraai/e3-ui/internal\";\nimport type { DragPayload, DropCellOptions, DropVeto } from \"@elaraai/east-ui-components\";\nimport type { BacklogEntry } from \"./backlog.js\";\nimport { entityId, type SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport type { SchematicNewKey } from \"./editing.js\";\nimport { keyedRow, type SchematicEdit, type SchematicFieldWrite, type SchematicKeyRefusal } from \"./edits.js\";\nimport type { SchematicDropRefusalWord, SchematicWords } from \"./messages.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** A point of the drawing, in world units. */\ntype Point = ValueTypeOf<typeof Schematic.Types.Point>;\n\n// ── What is dragged ───────────────────────────────────────────────────────\n\n/** A card the canvas takes, as the Schematic reads it: what its drop does, the kind it writes, and its name. */\nexport type SchematicDropCard =\n    /** An item kind's template: a new item of its kind at the drop point, every other field the template's (SC12). */\n    | { readonly does: \"add\"; readonly kind: string; readonly label: string; readonly values: Uint8Array }\n    /** A row of an item kind's backlog: placed at the drop point (SC4). */\n    | { readonly does: \"place\"; readonly ref: SchematicRef; readonly label: string }\n    /** A link or a net kind's template: its values written over a link or a net of its kind, never its ends, its sides or its key (SC11). */\n    | { readonly does: \"retype\"; readonly kind: string; readonly label: string; readonly values: Uint8Array }\n    /** An author's card: the fields its patch sets, on an entity of the kind its patch names. */\n    | { readonly does: \"set\"; readonly kind: string; readonly label: string; readonly sets: readonly SchematicFieldWrite[] };\n\n/**\n * The slot of the kind a card writes.\n *\n * @param card - The card\n * @returns The kind's slot\n */\nexport function cardKind(card: SchematicDropCard): string {\n    return card.does === \"place\" ? card.ref.kind : card.kind;\n}\n\n/**\n * Whether a card lands at a point of the drawing — a template's new item, a\n * backlog row placed — rather than on an entity.\n *\n * @param card - The card\n * @returns Whether it lands at a point\n */\nexport function landsAtPoint(card: SchematicDropCard): card is Extract<SchematicDropCard, { readonly does: \"add\" | \"place\" }> {\n    return card.does === \"add\" || card.does === \"place\";\n}\n\n/** A kind whose templates the Templates tab lists: its slot, and its templates. */\nexport interface SchematicTemplatesKind {\n    /** The kind's slot. */\n    readonly key: string;\n    /** Its templates, as the wire carries them: each its key, its name, and its values as bytes. */\n    readonly templates: readonly ValueTypeOf<typeof Schematic.Types.Template>[];\n}\n\n/** What the canvas takes dropped: its drop target, and each library whose cards drop — its cards by key. */\nexport interface SchematicDropHost {\n    /** The Schematic's drop target: the surface its canvas registers on. */\n    readonly surface: string;\n    /** Each library whose cards drop, by its id: its cards, by key. */\n    readonly libraries: ReadonlyMap<string, ReadonlyMap<string, SchematicDropCard>>;\n    /** Each library whose cards a paged list draws, by its id: a card it has drawn, by key — the paged Backlog's (#1393). */\n    readonly paged: ReadonlyMap<string, (key: string) => SchematicDropCard | undefined>;\n}\n\n/**\n * What the canvas takes dropped, from the tabs the payload lists: the\n * Templates tab's cards — an item kind's adding an item, a link or a net\n * kind's writing its values over one — keyed as the tab keys them, by their\n * kind's slot and their key; the Backlog's rows, each placed where it is\n * dropped, keyed by its id; and each author's tab whose patch names a kind,\n * its cards by their keys. The Index, the Layers and an author's tab with no\n * `drop` drop nothing.\n *\n * @param surface - The Schematic's drop target\n * @param libraryOf - The library a tab's cards drag from, by the tab's key\n * @param tabs - The tabs the payload lists\n * @param kinds - The payload's item, link and net kinds: their templates\n * @param backlog - The Backlog's rows in hand\n * @param pagedBacklog - What a card of the paged Backlog drops, by its id (#1393): a row it has drawn, placed where it lands;\n *   `undefined` while the Backlog lists only rows in hand\n * @returns What the canvas takes\n */\nexport function dropHostOf(surface: string, libraryOf: (tabKey: string) => string, tabs: SchematicValue[\"library\"],\n    kinds: { readonly items: readonly SchematicTemplatesKind[]; readonly links: readonly SchematicTemplatesKind[]; readonly nets: readonly SchematicTemplatesKind[] },\n    backlog: readonly BacklogEntry[], pagedBacklog?: (key: string) => SchematicDropCard | undefined): SchematicDropHost {\n    const libraries = new Map<string, ReadonlyMap<string, SchematicDropCard>>();\n    const paged = new Map<string, (key: string) => SchematicDropCard | undefined>();\n    for (const tab of tabs) {\n        switch (tab.type) {\n            case \"templates\": {\n                const cards = new Map<string, SchematicDropCard>();\n                for (const kind of kinds.items) {\n                    for (const template of kind.templates) {\n                        cards.set(entityId({ kind: kind.key, key: template.key }), { does: \"add\", kind: kind.key, label: template.name, values: template.values });\n                    }\n                }\n                for (const kind of [...kinds.links, ...kinds.nets]) {\n                    for (const template of kind.templates) {\n                        cards.set(entityId({ kind: kind.key, key: template.key }), { does: \"retype\", kind: kind.key, label: template.name, values: template.values });\n                    }\n                }\n                libraries.set(libraryOf(\"templates\"), cards);\n                break;\n            }\n            case \"backlog\":\n                libraries.set(libraryOf(\"backlog\"), new Map(backlog.map((entry) => [entry.id, { does: \"place\", ref: entry.ref, label: entry.roles.label }] as const)));\n                if (pagedBacklog !== undefined) paged.set(libraryOf(\"backlog\"), pagedBacklog);\n                break;\n            case \"tab\": {\n                const lands = tab.value.drop;\n                if (lands.type !== \"some\") break;\n                libraries.set(libraryOf(`tab:${tab.value.name}`),\n                    new Map(tab.value.cards.map((card) => [card.key, { does: \"set\", kind: lands.value, label: card.label, sets: card.sets }] as const)));\n                break;\n            }\n            case \"index\":\n            case \"layers\":\n                break;\n        }\n    }\n    return { surface, libraries, paged };\n}\n\n/**\n * A card the canvas takes, by its library and its key: one the library lists in hand, or one its paged list has drawn.\n *\n * @param host - What the canvas takes\n * @param library - The card's library\n * @param key - The card's key\n * @returns The card, or `undefined` for one no tab that drops lists\n */\nexport function cardOf(host: SchematicDropHost, library: string, key: string): SchematicDropCard | undefined {\n    return host.libraries.get(library)?.get(key) ?? host.paged.get(library)?.(key);\n}\n\n// ── Where a drag rests ────────────────────────────────────────────────────\n\n/**\n * A point a card lands at: its coordinates in world units, and how many\n * decimal digits the screen resolved them to — what the words print them at.\n */\nexport const SchematicDropPointType = StructType({ x: FloatType, y: FloatType, digits: IntegerType });\n\n/** A point a card lands at, decoded. */\nexport type SchematicDropPoint = ValueTypeOf<typeof SchematicDropPointType>;\n\n/** Where a drag rests over the canvas, for what it carries — what the Schematic's drop `CellRef` names in its `row`, printed. */\nexport const SchematicDropAtType = VariantType({\n    /** A point of the drawing: where a template's item or a backlog row lands. */\n    point: SchematicDropPointType,\n    /** The entity of the card's kind under the pointer: what a template writes its values over, or an author's card sets its fields on. */\n    entity: Schematic.Types.Ref,\n    /** Nothing of the card's kind under the pointer. */\n    nothing: NullType,\n});\n\n/** Where a drag rests, decoded. */\nexport type SchematicDropAt = ValueTypeOf<typeof SchematicDropAtType>;\n\n/** Where a drag rests, as its `CellRef` carries it. */\nexport const printDropAt: (at: SchematicDropAt) => string = printFor(SchematicDropAtType);\n\nconst parseDropAt = parseFor(SchematicDropAtType);\n\n/**\n * Where a drop's `CellRef` says the drag rests.\n *\n * @param text - The `CellRef`'s `row`\n * @returns Where it rests, or `undefined` when the text names nowhere — a coordinate another surface made\n */\nexport function readDropAt(text: string): SchematicDropAt | undefined {\n    const read = parseDropAt(text);\n    return read.success ? read.value : undefined;\n}\n\n/** Nothing of a card's kind: where the canvas's drop cell rests before a drag says otherwise. */\nexport const NOWHERE: SchematicDropAt = variant(\"nothing\", null);\n\n/** The most digits a drop point keeps: a millionth of a unit. */\nconst MAX_DIGITS = 6;\n\n/**\n * The point a drop lands at, from the pointer's place in the world: each\n * coordinate rounded to the screen's resolution — the fewest decimal digits\n * whose last is no wider than a pixel at the current zoom — so the drop lands\n * within a pixel of the pointer, and the ghost says what is written.\n *\n * @param world - The pointer's place, in world units\n * @param ppu - The canvas's pixels per world unit\n * @returns The point, and its digits\n */\nexport function dropPoint(world: { readonly x: number; readonly y: number }, ppu: number): SchematicDropPoint {\n    const digits = Number.isFinite(ppu) && ppu > 0 ? Math.min(MAX_DIGITS, Math.max(0, Math.ceil(Math.log10(ppu)))) : 0;\n    const scale = 10 ** digits;\n    // `+ 0` lets a rounded negative zero go: the point prints `0`, never `-0`.\n    const round = (v: number): number => Math.round(v * scale) / scale + 0;\n    return { x: round(world.x), y: round(world.y), digits: BigInt(digits) };\n}\n\n/**\n * Where a drag rests at a point of the canvas, for a card: the point, for one\n * that lands at a point; else the entity of its kind under the pointer, or\n * nothing.\n *\n * @param card - The card dragged\n * @param point - The point under the pointer, at the screen's resolution ({@link dropPoint})\n * @param entityOf - The entity of a kind under the pointer, by the kind's slot; `undefined` for none\n * @returns Where the drag rests\n */\nexport function restsAt(card: SchematicDropCard, point: SchematicDropPoint, entityOf: (kind: string) => SchematicRef | undefined): SchematicDropAt {\n    if (landsAtPoint(card)) return variant(\"point\", point);\n    const ref = entityOf(cardKind(card));\n    return ref === undefined ? NOWHERE : variant(\"entity\", ref);\n}\n\n// ── What a drop does ──────────────────────────────────────────────────────\n\n/** A kind, as a drop reads it: its name, and whether it writes — bound with its patch door, the Schematic not read only. */\nexport interface SchematicDropKind {\n    /** Its name (`Rack`). */\n    readonly name: string;\n    /** Whether a drop writes it. */\n    readonly writes: boolean;\n}\n\n/** What a drop reads of the Schematic as it stands. */\nexport interface SchematicDropContext {\n    /** The drawing's world bounds: a card lands at a point inside them. */\n    readonly extent: { readonly width: number; readonly height: number };\n    /** Each kind, by its slot. */\n    readonly kinds: ReadonlyMap<string, SchematicDropKind>;\n    /** Whether a kind's session takes a gesture now: its record read, no Save on its way. */\n    readonly available: (slot: string) => boolean;\n    /**\n     * Why a kind adds no item (#1549): its keys' type's name, a type the form can't type, where it builds none of its own;\n     * `undefined` for a kind that keys the items it adds.\n     */\n    readonly untyped: (slot: string) => string | undefined;\n    /** An entity's name, as the words say it; `undefined` for one the drawing no longer draws. */\n    readonly nameOf: (ref: SchematicRef) => string | undefined;\n    /** The label of the innermost zone holding a point; `undefined` for none. */\n    readonly zoneAt: (point: Point) => string | undefined;\n}\n\n/**\n * Why a drop is refused where it rests: in its words — the kind named as the\n * kind gives its name — or, what it lands on having left the drawing, in none.\n */\nexport type SchematicDropRefusal = { readonly why: \"gone\" } | SchematicDropRefusalWord;\n\n/** What a drop does where it rests. */\nexport type SchematicDropPlan =\n    /** A new item of a kind at a point, its other fields a template's values (SC12): the zone holding the point, for its words. */\n    | { readonly kind: \"add\"; readonly slot: string; readonly at: SchematicDropPoint; readonly zone: string | undefined; readonly values: Uint8Array }\n    /** A backlog row placed at a point (SC4). */\n    | { readonly kind: \"place\"; readonly ref: SchematicRef; readonly at: SchematicDropPoint; readonly zone: string | undefined }\n    /** A template's values written over a link or a net of its kind (SC11), and its name. */\n    | { readonly kind: \"retype\"; readonly ref: SchematicRef; readonly name: string; readonly values: Uint8Array }\n    /** An author's card's fields set on entities of a kind: one's name, or — several, a card's ⏎ — the kind's. */\n    | { readonly kind: \"set\"; readonly refs: readonly SchematicRef[]; readonly name: string | undefined; readonly kindName: string; readonly sets: readonly SchematicFieldWrite[] }\n    | { readonly kind: \"refused\"; readonly why: SchematicDropRefusal };\n\nconst refused = (why: SchematicDropRefusal): SchematicDropPlan => ({ kind: \"refused\", why });\nconst GONE: SchematicDropPlan = refused({ why: \"gone\" });\n\n/**\n * The kind a card writes, if a drop of it may write now: refused when the\n * kind is read only, or its session takes no gesture now.\n */\nfunction writable(card: SchematicDropCard, ctx: SchematicDropContext):\n    { readonly writes: true; readonly slot: string; readonly kind: SchematicDropKind } | { readonly writes: false; readonly plan: SchematicDropPlan } {\n    const slot = cardKind(card);\n    const kind = ctx.kinds.get(slot);\n    if (kind === undefined) return { writes: false, plan: GONE };\n    if (!kind.writes) return { writes: false, plan: refused({ why: \"readOnly\", kind: kind.name }) };\n    if (!ctx.available(slot)) return { writes: false, plan: refused({ why: \"busy\", kind: kind.name }) };\n    return { writes: true, slot, kind };\n}\n\n/**\n * What a drop does where it rests — see the module docs. A card of a kind\n * read only, or whose session takes no gesture now, is refused wherever it\n * rests, and so is a template of a kind that adds no item (#1549); a card that lands at a point is refused outside the drawing, and one\n * that lands on an entity anywhere but on an entity of its kind; one whose\n * entity has left the drawing is refused in no words.\n *\n * @param card - The card dragged\n * @param at - Where the drag rests\n * @param ctx - The Schematic as it stands\n * @returns What the drop does, or why it is refused\n */\nexport function planDrop(card: SchematicDropCard, at: SchematicDropAt, ctx: SchematicDropContext): SchematicDropPlan {\n    const gate = writable(card, ctx);\n    if (!gate.writes) return gate.plan;\n    const { slot, kind } = gate;\n    const untyped = card.does === \"add\" ? ctx.untyped(slot) : undefined;\n    if (untyped !== undefined) return refused({ why: \"untyped\", kind: kind.name, type: untyped });\n    if (landsAtPoint(card)) {\n        if (at.type !== \"point\") return refused({ why: \"outside\" });\n        const point = at.value;\n        const { width, height } = ctx.extent;\n        if (!(point.x >= 0 && point.x <= width && point.y >= 0 && point.y <= height)) return refused({ why: \"outside\" });\n        const zone = ctx.zoneAt({ x: point.x, y: point.y });\n        return card.does === \"add\"\n            ? { kind: \"add\", slot, at: point, zone, values: card.values }\n            : { kind: \"place\", ref: card.ref, at: point, zone };\n    }\n    if (at.type !== \"entity\" || !stringEqual(at.value.kind, slot)) return refused({ why: \"onto\", kind: kind.name });\n    const name = ctx.nameOf(at.value);\n    if (name === undefined) return GONE;\n    switch (card.does) {\n        case \"retype\": return { kind: \"retype\", ref: at.value, name, values: card.values };\n        case \"set\": return { kind: \"set\", refs: [at.value], name, kindName: kind.name, sets: card.sets };\n    }\n}\n\n/**\n * What ⏎ on a card does (SC13) — and Details' Place, below 480px of main\n * (#1394): a card that adds or places an item lands at the view's centre, and\n * where that is off the drawing it is refused in words that say what brings the\n * drawing there — pan it into view, or Fit — as no pointer can be moved there;\n * a template of a link or a net kind, on the selected link or net of its kind;\n * an author's card, on every selected entity of its kind, as one step. A card\n * the selection holds nothing of its kind for is refused, naming where it\n * lands, as a drag over nothing of its kind is.\n *\n * @param card - The card\n * @param selection - What the canvas has selected, each entity by its reference\n * @param centre - The view's centre, at the screen's resolution; `undefined` while the canvas has no size\n * @param ctx - The Schematic as it stands\n * @returns What the ⏎ does, or why it is refused\n */\nexport function planEnter(card: SchematicDropCard, selection: readonly SchematicRef[], centre: SchematicDropPoint | undefined,\n    ctx: SchematicDropContext): SchematicDropPlan {\n    if (landsAtPoint(card)) {\n        const plan = planDrop(card, centre === undefined ? NOWHERE : variant(\"point\", centre), ctx);\n        // No pointer to move: off the drawing, the refusal says what brings the drawing to the view's centre.\n        return plan.kind === \"refused\" && plan.why.why === \"outside\" ? refused({ why: \"offView\" }) : plan;\n    }\n    const slot = cardKind(card);\n    const picked = selection.filter((ref) => stringEqual(ref.kind, slot));\n    if (card.does !== \"set\" || picked.length <= 1) return planDrop(card, picked.length === 0 ? NOWHERE : variant(\"entity\", picked[0]!), ctx);\n    // An author's card on several: every one the drawing still draws, as one step.\n    const gate = writable(card, ctx);\n    if (!gate.writes) return gate.plan;\n    const refs = picked.filter((ref) => ctx.nameOf(ref) !== undefined);\n    if (refs.length === 0) return GONE;\n    return { kind: \"set\", refs, name: refs.length === 1 ? ctx.nameOf(refs[0]!) : undefined, kindName: gate.kind.name, sets: card.sets };\n}\n\n/**\n * The edits a plan writes, one step of the history: a new item under the key\n * its kind makes (#1549); a backlog row's centre; a link's or a net's template\n * values; each entity's fields an author's card sets — none for a refusal.\n *\n * @param plan - The plan\n * @param newKey - A new row's key, as its kind makes one from the edit making it (`editing.ts`' `newKey`)\n * @returns The edits, or why the drop records nothing — the key its item builds taken; `undefined` while the key is\n *   still to be read\n */\nexport function dropEdits(plan: SchematicDropPlan, newKey: (made: SchematicEdit) => SchematicNewKey | undefined):\n    { readonly edits: SchematicEdit[] } | { readonly refused: SchematicKeyRefusal } | undefined {\n    switch (plan.kind) {\n        case \"refused\": return { edits: [] };\n        case \"add\": {\n            const at = some({ x: plan.at.x, y: plan.at.y });\n            const values = some(plan.values);\n            const made = keyedRow(plan.slot, newKey({ op: \"item\", ref: { kind: plan.slot, key: \"\" }, at, values }));\n            if (made === undefined || \"refused\" in made) return made;\n            return { edits: [{ op: \"item\", ref: { kind: plan.slot, key: made.key }, at, values }] };\n        }\n        case \"place\": return { edits: [{ op: \"place\", ref: plan.ref, at: some({ x: plan.at.x, y: plan.at.y }) }] };\n        case \"retype\": return { edits: [{ op: \"retype\", ref: plan.ref, values: plan.values }] };\n        case \"set\": return { edits: plan.refs.map((ref): SchematicEdit => ({ op: \"set\", ref, sets: plan.sets })) };\n    }\n}\n\n/**\n * The item a drop brings onto the canvas, which it selects: the one a\n * template added — its key the one its edits made — or the backlog row it\n * placed; none for a drop on an entity.\n *\n * @param plan - The plan\n * @param edits - The edits it wrote\n * @returns The item's reference, or `undefined`\n */\nexport function droppedItem(plan: SchematicDropPlan, edits: readonly SchematicEdit[]): SchematicRef | undefined {\n    if (plan.kind === \"place\") return plan.ref;\n    if (plan.kind !== \"add\") return undefined;\n    const added = edits.find((edit) => edit.op === \"item\");\n    return added?.ref;\n}\n\n// ── Its marks ─────────────────────────────────────────────────────────────\n\n/** What the canvas marks while a drag rests where it lands: the point a card lands at, in world units, or the entity it lands on, by its id. */\nexport type SchematicDropMark =\n    | { readonly kind: \"point\"; readonly x: number; readonly y: number }\n    | { readonly kind: \"entity\"; readonly id: string };\n\n/**\n * What the canvas marks for a plan: the point a template's item or a backlog\n * row lands at, or the entity a card lands on — nothing for a refusal.\n *\n * @param plan - The plan\n * @returns The mark, or `undefined`\n */\nexport function markOf(plan: SchematicDropPlan): SchematicDropMark | undefined {\n    switch (plan.kind) {\n        case \"add\":\n        case \"place\": return { kind: \"point\", x: plan.at.x, y: plan.at.y };\n        case \"retype\": return { kind: \"entity\", id: entityId(plan.ref) };\n        case \"set\": return plan.refs.length === 1 ? { kind: \"entity\", id: entityId(plan.refs[0]!) } : undefined;\n        case \"refused\": return undefined;\n    }\n}\n\n/**\n * Whether two marks are one: what the canvas draws need not move.\n *\n * @param a - A mark, or none\n * @param b - Another, or none\n * @returns Whether they mark the same\n */\nexport function markEqual(a: SchematicDropMark | undefined, b: SchematicDropMark | undefined): boolean {\n    if (a === undefined || b === undefined) return a === undefined && b === undefined;\n    if (a.kind === \"point\" || b.kind === \"point\") return a.kind === \"point\" && b.kind === \"point\" && a.x === b.x && a.y === b.y;\n    return stringEqual(a.id, b.id);\n}\n\n// ── Its words ─────────────────────────────────────────────────────────────\n\n/** A drop point, as the words say it: the zone holding it, and its coordinates at the digits the screen resolved, in the drawing's unit. */\nfunction pointWords(at: SchematicDropPoint, zone: string | undefined, words: SchematicWords, unit: string | undefined): string {\n    const digits = some(at.digits);\n    const fixed = variant(\"number\", { minimumFractionDigits: digits, maximumFractionDigits: digits, signDisplay: none });\n    return words.m.dropAt({ zone, x: words.value(at.x, fixed), y: words.value(at.y, fixed), unit });\n}\n\n/** What a plan lands on, as the words say it: the point and its zone, the entity, or — several — the count of them. */\nfunction whereWords(plan: Exclude<SchematicDropPlan, { kind: \"refused\" }>, words: SchematicWords, unit: string | undefined): string {\n    switch (plan.kind) {\n        case \"add\":\n        case \"place\": return pointWords(plan.at, plan.zone, words, unit);\n        case \"retype\": return plan.name;\n        case \"set\": return plan.name ?? words.m.dropMany({\n            n: plan.refs.length, count: words.number(plan.refs.length), name: plan.kindName.toLocaleLowerCase(words.locale),\n        });\n    }\n}\n\n/**\n * Why a plan is refused, as its words say it: its kind named as running text\n * writes it.\n */\nfunction refusalWords(why: SchematicDropRefusal, words: SchematicWords): string | undefined {\n    if (why.why === \"gone\") return undefined;\n    return words.m.dropRefused(why.why === \"outside\" || why.why === \"offView\" ? why : { ...why, kind: why.kind.toLocaleLowerCase(words.locale) });\n}\n\n/**\n * What the ghost says of a plan: where a card lands — `Cage A · 6.04, 2.91 m`\n * — or what it lands on — `onto A01 → ODF-1` — or, red, why it can't:\n * `Drop onto a fibre run`.\n *\n * @param plan - The plan\n * @param words - The Schematic's words\n * @param unit - The drawing's scale unit, if it has one\n * @returns The caption; `undefined` for a refusal that says nothing\n */\nexport function dropCaption(plan: SchematicDropPlan, words: SchematicWords, unit: string | undefined): string | undefined {\n    if (plan.kind === \"refused\") return refusalWords(plan.why, words);\n    const where = whereWords(plan, words, unit);\n    return plan.kind === \"retype\" || plan.kind === \"set\" ? words.m.dropOnto({ name: where }) : where;\n}\n\n/**\n * Why a plan is refused, as the footer says it for a card's ⏎ (SC13).\n *\n * @param plan - The plan\n * @param words - The Schematic's words\n * @returns The words; `undefined` for a plan that lands, or a refusal that says nothing\n */\nexport function dropRefusal(plan: SchematicDropPlan, words: SchematicWords): string | undefined {\n    return plan.kind === \"refused\" ? refusalWords(plan.why, words) : undefined;\n}\n\n/**\n * Where a plan lands, as a screen reader hears the drag layer say it — the\n * point and its zone, or the entity — or, refused, the canvas.\n *\n * @param plan - The plan\n * @param words - The Schematic's words\n * @param unit - The drawing's scale unit, if it has one\n * @returns The name\n */\nexport function dropName(plan: SchematicDropPlan, words: SchematicWords, unit: string | undefined): string {\n    return plan.kind === \"refused\" ? words.m.dropCanvas() : whereWords(plan, words, unit);\n}\n\n/**\n * A drop's step in the history, and its Save's — `Drop 42U rack · 8 kW at\n * Cage A · 6.04, 2.91 m`.\n *\n * @param plan - The plan: one that lands\n * @param card - The card dropped\n * @param words - The Schematic's words\n * @param unit - The drawing's scale unit, if it has one\n * @returns The name\n */\nexport function dropLabel(plan: SchematicDropPlan, card: SchematicDropCard, words: SchematicWords, unit: string | undefined): string {\n    return words.m.dropLabel({ card: card.label, where: dropName(plan, words, unit), onto: plan.kind === \"retype\" || plan.kind === \"set\" });\n}\n\n// ── The canvas's part ─────────────────────────────────────────────────────\n\n/**\n * What the canvas hands the drag layer as its one drop cell: built by the\n * frame and held still while the Schematic takes drops, its functions reading\n * the Schematic as it stands. The canvas works out where a drag rests from its\n * own drawing, and marks it.\n */\nexport interface SchematicCanvasDrop {\n    /** The surface the cell registers on: the Schematic's drop target. */\n    readonly surface: string;\n    /** What a drag carries, as the Schematic reads it — a card a tab of its library drops — or `undefined`. */\n    readonly cardOf: (payload: DragPayload) => SchematicDropCard | undefined;\n    /** What a drop of a card where a drag rests does, over the Schematic as it stands. */\n    readonly plan: (card: SchematicDropCard, at: SchematicDropAt) => SchematicDropPlan;\n    /** The veto: whether the drop a candidate event makes lands. */\n    readonly canDrop: DropVeto;\n    /** What the ghost says where the drag rests, and that place's name for the announcements. */\n    readonly options: Required<Pick<DropCellOptions, \"caption\" | \"name\">>;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The canvas's drop cell (#1390): where a library card's drag rests over the\n * canvas — the point under the pointer, at the screen's resolution, for a card\n * that adds or places an item; the entity of the card's kind under it, found as\n * a tap finds it, for one that lands on an entity — and its mark, which the\n * painter draws and a card wears while the drop there lands (invariants 17,\n * 18). The canvas is the Schematic's drop target's one cell (`../use-drop.ts`);\n * what a drop does is `../drop.ts`'.\n *\n * The commit-phase snapshot reads the mark (`use-paint.ts`, invariant 1), and\n * the cell reads the snapshot: {@link useCanvasDropMark} holds the mark, and is\n * made before the snapshot; {@link useCanvasDrop} holds the cell, and is made\n * after it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useState, type RefObject } from \"react\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { useDragLayerOptional, useDropCell, type CellCoord, type DragPayload, type DropCellOptions } from \"@elaraai/east-ui-components\";\nimport type { SchematicValue } from \"../data.js\";\nimport {\n    NOWHERE, dropPoint, markEqual, markOf, printDropAt, readDropAt, restsAt, type SchematicCanvasDrop, type SchematicDropMark,\n} from \"../drop.js\";\nimport type { SchematicRef } from \"./drawn\";\nimport type { Camera } from \"./use-camera\";\nimport type { Gestures } from \"./use-gestures\";\nimport type { Paint } from \"./use-paint\";\n\nconst stringEqual = equalFor(StringType);\n\n/** Where a drag rests over the canvas before it says otherwise: on nothing of its card's kind (#1390). */\nconst NOWHERE_AT = printDropAt(NOWHERE);\n\n/**\n * Where a library card's drag rests over the canvas, marked (see the module docs).\n *\n * @returns Whether a library card is dragged, and the mark of where its drop lands, and what sets it\n */\nexport function useCanvasDropMark() {\n    // Where a library card's drag rests while its drop lands there (#1390): the point it lands at, or the entity it\n    // lands on — what the canvas marks. A drag over, nothing stays marked.\n    const dragging = useDragLayerOptional()?.active ?? false;\n    const [dropMark, setDropMark] = useState<SchematicDropMark | undefined>(undefined);\n    useEffect(() => { if (!dragging) setDropMark(undefined); }, [dragging]);\n    return { dragging, dropMark, setDropMark };\n}\n\n/** Where a library card's drag rests over the canvas, marked: {@link useCanvasDropMark}'s. */\nexport type CanvasDropMark = ReturnType<typeof useCanvasDropMark>;\n\n/** What {@link useCanvasDrop} reads. */\nexport interface CanvasDropProps {\n    /** The payload, decoded: its kinds, by which a card's kind is an item's, a zone's or a link's. */\n    readonly value: SchematicValue;\n    /** The canvas's drop cell, where a tab of the library drops (#1390); `undefined`, it takes no drop. */\n    readonly drop: SchematicCanvasDrop | undefined;\n    /** The canvas's element: what a drag's point is found over. */\n    readonly canvasRef: RefObject<HTMLDivElement | null>;\n    /** Each entity's reference by its id on the canvas. */\n    readonly refById: ReadonlyMap<string, SchematicRef>;\n    /** What never selects, by any path: a locked layer's entities, and what the narrowing takes out — and takes no drop. */\n    readonly inertKeys: ReadonlySet<string>;\n    /** The canvas's size, in CSS px; `null` before it is measured, when no cell registers. */\n    readonly size: Camera[\"size\"];\n    /** The camera's live ref (`use-camera.ts`). */\n    readonly cameraRef: Camera[\"cameraRef\"];\n    /** The commit-phase snapshot (`use-paint.ts`). */\n    readonly renderSnapRef: Paint[\"renderSnapRef\"];\n    /** The item of a kind under a point, as a tap finds it (`use-gestures.ts`). */\n    readonly itemKeyAt: Gestures[\"itemKeyAt\"];\n    /** The zone of a kind under a point, as a tap finds it (`use-gestures.ts`). */\n    readonly zoneKeyAt: Gestures[\"zoneKeyAt\"];\n    /** The link or the net of a kind under a point, as a tap finds it (`use-gestures.ts`). */\n    readonly linkKeyAt: Gestures[\"linkKeyAt\"];\n    /** Sets the mark of where a drag's drop lands ({@link useCanvasDropMark}'s). */\n    readonly setDropMark: CanvasDropMark[\"setDropMark\"];\n}\n\n/**\n * The canvas's drop cell (see the module docs).\n *\n * @param props - The payload and the frame's drop, the canvas's element and its size, the camera, the snapshot, the\n *   hit-tests, and what sets the mark\n * @returns The ref callback that registers the canvas's element as the cell\n */\nexport function useCanvasDrop({ value, drop, canvasRef, refById, inertKeys, size, cameraRef, renderSnapRef, itemKeyAt, zoneKeyAt, linkKeyAt, setDropMark }: CanvasDropProps) {\n    // --- Drops (#1390): the canvas is one drop cell of the shared drag layer. ----\n    // Where a drag rests is worked out from the drawing as it stands: the point\n    // under the pointer, for a card that adds or places an item; the entity of\n    // the card's kind under it — never a locked layer's — for one that lands on\n    // an entity; and marked while the drop there lands.\n    const sortOf = useMemo(() => new Map<string, \"items\" | \"zones\" | \"links\">([\n        ...value.items.map((kind) => [kind.key, \"items\"] as const),\n        ...value.zones.map((kind) => [kind.key, \"zones\"] as const),\n        ...[...value.links, ...value.nets].map((kind) => [kind.key, \"links\"] as const),\n    ]), [value.items, value.zones, value.links, value.nets]);\n    /**\n     * The entity of a kind under a client point, by the kind's slot: what a card of that kind lands on. An item's card\n     * covers what is drawn under it, as it does from a tap: a zone or a link it covers takes no drop there.\n     */\n    const entityAt = useCallback((kind: string, clientX: number, clientY: number): SchematicRef | undefined => {\n        const host = canvasRef.current;\n        if (host === null) return undefined;\n        const accept = (id: string): boolean => { const ref = refById.get(id); return ref !== undefined && stringEqual(ref.kind, kind); };\n        const sort = sortOf.get(kind);\n        if (sort !== \"items\" && typeof document !== \"undefined\") {\n            const covering = document.elementFromPoint(clientX, clientY)?.closest(\"[data-card-key]\")?.getAttribute(\"data-card-key\");\n            if (covering !== null && covering !== undefined && !inertKeys.has(covering)) return undefined;\n        }\n        const id = sort === \"items\" ? itemKeyAt(host, clientX, clientY, accept)\n            : sort === \"zones\" ? zoneKeyAt(host, clientX, clientY, accept)\n                : sort === \"links\" ? linkKeyAt(host, clientX, clientY, accept)?.key : undefined;\n        return id === undefined ? undefined : refById.get(id);\n    }, [refById, sortOf, itemKeyAt, zoneKeyAt, linkKeyAt, inertKeys, canvasRef]);\n    /** Where a drag rests at a client point, for what it carries: the coordinate its drop's `CellRef` names. */\n    const resolveDrop = useCallback((clientX: number, clientY: number, payload: DragPayload): CellCoord => {\n        const surface = drop?.surface ?? \"\";\n        const card = drop?.cardOf(payload);\n        const host = canvasRef.current;\n        const snap = renderSnapRef.current;\n        if (card === undefined || host === null || snap.size === null || snap.fit === 0) return { surface, row: NOWHERE_AT, slot: \"\" };\n        const rect = host.getBoundingClientRect();\n        const cam = cameraRef.current;\n        const ppuLive = snap.fit * cam.zoom;\n        const point = dropPoint({ x: (clientX - rect.left - cam.tx) / ppuLive, y: (clientY - rect.top - cam.ty) / ppuLive }, ppuLive);\n        return { surface, row: printDropAt(restsAt(card, point, (kind) => entityAt(kind, clientX, clientY))), slot: \"\" };\n    }, [drop, entityAt, canvasRef, renderSnapRef, cameraRef]);\n    /**\n     * The drop cell's behaviour: the frame's words for where a drag rests, the canvas marking it. The caption is asked\n     * each time the drag rests over the canvas, whether its drop lands there or not: the mark follows it — where the\n     * drop lands, or nothing where it is refused — and goes when the drag rests elsewhere.\n     */\n    const dropOptions = useMemo((): DropCellOptions | undefined => {\n        if (drop === undefined) return undefined;\n        return {\n            ...drop.options,\n            caption: (coord, payload, allowed) => {\n                const card = drop.cardOf(payload);\n                const at = readDropAt(coord.row);\n                const mark = card === undefined || at === undefined ? undefined : markOf(drop.plan(card, at));\n                setDropMark((was) => (markEqual(was, mark) ? was : mark));\n                return drop.options.caption(coord, payload, allowed);\n            },\n            onLeave: () => setDropMark(undefined),\n        };\n    }, [drop, setDropMark]);\n    const dropCell = useDropCell(drop === undefined || size === null ? null : { surface: drop.surface, row: NOWHERE_AT, slot: \"\" },\n        false, drop?.canDrop, resolveDrop, dropOptions);\n    return dropCell;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the Schematic's canvas has selected (#172, #177, #1391, #1401): its\n * items and the anchor its steps walk from, its zones, and its link or its\n * net — a net's leg with it — each part committed through its one funnel, and\n * the whole selection heard once by the host after a gesture's last funnel\n * (`onSelect`, each entity by its reference) and by the frame (invariant 7).\n * What keeps the selection to the drawing — the hygiene effects, letting go of\n * what leaves it, what a layer locks or hides and what the narrowing takes out\n * (invariants 7a, 7b), and an item a drop adds or places, selected once it\n * draws (invariant 19), as is what Find's pick or Go to issue finds off the\n * drawing, of any sort — and the steps through the items, each flying to the\n * item it selects (invariant 8). A row of a kind read by area the window no\n * longer holds still stands (#1393): the frame says so (`standing`), as a read\n * of it by its key does, and the selection keeps it — a pan or a zoom lets go\n * of nothing, and `onSelect` hears nothing of it.\n *\n * The commit-phase snapshot reads the selection (`use-paint.ts`, invariant 1),\n * and what keeps it reads the snapshot: {@link useCanvasSelection} holds the\n * selection, its funnels and its report, and is made before the snapshot;\n * {@link useSelectionSteps} holds the hygiene effects, a dropped item's\n * selection and the steps, and is made after it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { ArrayType, StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { Schematic } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { SchematicValue } from \"../data.js\";\nimport type { NetLeg } from \"../edits.js\";\nimport { refOfId, type DrawnItem, type DrawnZone, type SchematicDrawn, type SchematicRef } from \"./drawn\";\nimport type { SchematicLayerState } from \"./layers\";\nimport { buildNavTree, byLabel, type NavZone } from \"./model\";\nimport { EMPTY_STRING_SET } from \"./selection\";\nimport { itemFrame, pointFrame, type CameraMoves } from \"./use-camera\";\nimport type { Paint } from \"./use-paint\";\n\n/**\n * What is selected that the drawing doesn't draw and still stands (#1393): each row of a kind read by area its window\n * doesn't hold, by its id — as its stored row draws it, `undefined` while it is first read. The selection keeps each, and\n * Del deletes each item with the rest.\n */\nexport interface SchematicStanding {\n    /** The items, by id. */\n    readonly items: ReadonlyMap<string, DrawnItem | undefined>;\n    /** The zones, by id. */\n    readonly zones: ReadonlyMap<string, DrawnZone | undefined>;\n}\n\n/** Nothing selected stands off the drawing. */\nexport const NO_STANDING: SchematicStanding = { items: new Map(), zones: new Map() };\n\n/** What `onSelect` hears: the whole selection, each entity by its kind and key. */\nconst SelectedType = ArrayType(Schematic.Types.Ref);\nconst selectedEqual = equalFor(SelectedType);\nconst stringEqual = equalFor(StringType);\n\n/** Runs an author's East callback off the event turn (queueMicrotask, per\n *  the interactive-state pattern) with error isolation — a throwing callback\n *  logs with context instead of surfacing as an unhandled rejection or taking\n *  interaction state down with it. */\nfunction dispatchEast(name: string, run: () => unknown): void {\n    queueMicrotask(() => {\n        try {\n            const out = run();\n            // Async East callbacks reject later — attach the same isolation.\n            if (out instanceof Promise) out.catch(err => console.error(`[Schematic] ${name} callback failed:`, err));\n        } catch (err) {\n            console.error(`[Schematic] ${name} callback failed:`, err);\n        }\n    });\n}\n\n/** What {@link useCanvasSelection} reads. */\nexport interface CanvasSelectionProps {\n    /** The payload, decoded: its `onSelect`, which hears the whole selection. */\n    readonly value: SchematicValue;\n    /** Each entity's reference by its id on the canvas: what the host hears an entity named by (#1401, D34). */\n    readonly refById: ReadonlyMap<string, SchematicRef>;\n    /** Told what is selected — the items, the zones, and the link or the net — by their ids, and the net's leg (#1391). */\n    readonly onSelection: (ids: ReadonlySet<string>, leg: NetLeg | null) => void;\n}\n\n/**\n * What the canvas has selected, its funnels and its one report (see the module docs).\n *\n * @param props - The payload, each entity's reference, and what the frame is told\n * @returns The selection — the items and their anchor, the zones, the link or the net — the report's context, which\n *   the commit-phase snapshot writes, and the funnels\n */\nexport function useCanvasSelection({ value, refById, onSelection }: CanvasSelectionProps) {\n    // The host hears the whole selection after each change, each entity by its kind and key (#1401, D34, SC29).\n    const onSelectFn = useMemo(() => getSomeorUndefined(value.onSelect), [value.onSelect]);\n    // Zone (area) selection (#177) — a separate set from item selection, committed\n    // through its own funnel below (declared here so early callbacks can reference it).\n    const [zoneSelection, setZoneSelection] = useState<ReadonlySet<string>>(EMPTY_STRING_SET);\n    // The selected link (single, #176) — selection works even when read-only\n    // (inspection, and the host's `onSelect`); the connector handles / delete do not. A net\n    // STUB click selects one LEG (`leg` non-null): the halo narrows to that stub\n    // and Del removes just that endpoint (#189 follow-up).\n    const [selectedLink, setSelectedLink] = useState<{ key: string; leg: NetLeg | null } | null>(null);\n\n    // Selection state, consolidated (#172): the selected SET and the anchor (the\n    // last-touched key driving prev/next stepping) commit ATOMICALLY as one\n    // object — they can never disagree. Every mutation allocates a FRESH Set so\n    // the paint identity short-circuit (lastPaintRef.sel) stays correct.\n    const [selection, setSelection] = useState<{ selected: ReadonlySet<string>; anchor: string | null }>(\n        { selected: EMPTY_STRING_SET, anchor: null });\n    const selected = selection.selected;\n    // Commit context for the stable (empty-deps) selection funnels: the decoded\n    // callback and each entity's reference it must read FRESH at event time. ONE\n    // object, written in the commit-phase snapshot effect below (#172) — never in\n    // the render body, so a discarded render can't leak into it.\n    const commitCtx = { onSelect: onSelectFn, refById };\n    const commitCtxRef = useRef(commitCtx);\n    // The whole selection as the funnels leave it — items, zones and the link or\n    // net — and what the host last heard (#1401, D34). Each funnel writes its\n    // part here as it commits, and asks for one report: a gesture that changes\n    // several parts (a background tap clears all three) is heard once, after its\n    // last funnel, and a change the host has heard already is not heard again.\n    const selectedNowRef = useRef<{ items: ReadonlySet<string>; zones: ReadonlySet<string>; link: string | null }>(\n        { items: EMPTY_STRING_SET, zones: EMPTY_STRING_SET, link: null });\n    const heardRef = useRef<ValueTypeOf<typeof SelectedType>>([]);\n    const reportPendingRef = useRef(false);\n    const reportSelection = useCallback(() => {\n        if (reportPendingRef.current) return;\n        reportPendingRef.current = true;\n        dispatchEast(\"onSelect\", () => {\n            reportPendingRef.current = false;\n            const { onSelect, refById: refs } = commitCtxRef.current;\n            if (onSelect === undefined) return undefined;\n            const now = selectedNowRef.current;\n            const ids = [...now.items, ...now.zones, ...(now.link === null ? [] : [now.link])];\n            // An entity the drawing doesn't draw — a row standing off its window — by its id, its reference printed.\n            const heard = ids.flatMap(id => { const ref = refs.get(id) ?? refOfId(id); return ref === undefined ? [] : [ref]; });\n            if (selectedEqual(heardRef.current, heard)) return undefined;\n            heardRef.current = heard;\n            return onSelect(heard);\n        });\n    }, []);\n    // Single funnel for every item-selection mutation (tap / marquee / clear). Per\n    // the MANDATORY interactive-state pattern: compute `next` OUTSIDE the updater,\n    // then set the state and report as separate statements.\n    const commitSelection = useCallback((next: ReadonlySet<string>, opts: { anchor?: string } = {}) => {\n        // Selected set + anchor commit atomically: a cleared selection has no\n        // anchor; an explicit `anchor` (the touched key / last marquee hit) wins;\n        // otherwise the prior last-touched anchor is preserved (it need not be\n        // selected — a Shift-toggle OFF still anchors stepping there). Dead\n        // anchors (item left the working set) are pruned by the hygiene effect.\n        // The updater is PURE (side effects stay below, per the interactive-state\n        // pattern) — it only merges the prior anchor.\n        setSelection(prev => ({\n            selected: next,\n            anchor: next.size === 0 ? null : opts.anchor !== undefined ? opts.anchor : prev.anchor,\n        }));\n        selectedNowRef.current = { ...selectedNowRef.current, items: next };\n        reportSelection();\n    }, [reportSelection]);\n    const clearSelection = useCallback(() => commitSelection(EMPTY_STRING_SET), [commitSelection]);\n    // The link or net selected — `leg` a net's one stub — through its funnel, as the items' are.\n    const commitLinkSelection = useCallback((next: { key: string; leg: NetLeg | null } | null) => {\n        setSelectedLink(next);\n        selectedNowRef.current = { ...selectedNowRef.current, link: next === null ? null : next.key };\n        reportSelection();\n    }, [reportSelection]);\n    // The frame hears what is selected: its toolbar's steps show while something is, the Index marks its rows, and the\n    // inspector shows it — a net's leg with it (#1391).\n    useEffect(() => {\n        onSelection(new Set([...selected, ...zoneSelection, ...(selectedLink === null ? [] : [selectedLink.key])]), selectedLink?.leg ?? null);\n    }, [selected, zoneSelection, selectedLink, onSelection]);\n\n    // --- Zone (area) selection (#177). ---------------------------------------\n    // The zone-selection commit funnel — mirrors commitSelection: a fresh set,\n    // the state set, then one report of the whole selection.\n    const commitZoneSelection = useCallback((next: ReadonlySet<string>) => {\n        setZoneSelection(next);\n        selectedNowRef.current = { ...selectedNowRef.current, zones: next };\n        reportSelection();\n    }, [reportSelection]);\n    return {\n        zoneSelection, selectedLink, selection, setSelection, selected, commitCtx, commitCtxRef,\n        commitSelection, clearSelection, commitLinkSelection, commitZoneSelection,\n    };\n}\n\n/** What the canvas has selected, its funnels and its one report: {@link useCanvasSelection}'s. */\nexport type CanvasSelection = ReturnType<typeof useCanvasSelection>;\n\n/** What {@link useSelectionSteps} reads. */\nexport interface SelectionStepsProps {\n    /** What the canvas draws: the links and nets a selected one is kept among, and the drawing a dropped item waits on. */\n    readonly data: SchematicDrawn;\n    /** What the layers hide, lock and dim. */\n    readonly layers: SchematicLayerState;\n    /** What never selects, by any path: a locked layer's entities, and what the narrowing takes out (SC27, #1392). */\n    readonly inertKeys: ReadonlySet<string>;\n    /** What the narrowing takes out of every list and of the selection, its context among it (#1392). */\n    readonly narrowedOut: ReadonlySet<string>;\n    /** The items drawn, a hidden layer's left out: what the selected items are kept among, and what the steps walk. */\n    readonly items: readonly DrawnItem[];\n    /** The zones drawn, a hidden layer's left out. */\n    readonly shownZones: readonly DrawnZone[];\n    /** What is selected that the drawing doesn't draw and still stands: rows of kinds read by area off their windows, kept selected. */\n    readonly standing: SchematicStanding;\n    /** Whether a read the drawing needs is in flight: an item a drop asks to select is waited for until it lands. */\n    readonly reading: boolean;\n    /** What is selected, and its funnels ({@link useCanvasSelection}'s). */\n    readonly canvasSelection: CanvasSelection;\n    /** The commit-phase snapshot (`use-paint.ts`, invariant 1). */\n    readonly renderSnapRef: Paint[\"renderSnapRef\"];\n    /** The fly (`use-camera.ts`), which a step's selection comes after (invariant 8). */\n    readonly flyTo: CameraMoves[\"flyTo\"];\n}\n\n/**\n * What keeps the selection to the drawing, and the steps through its items (see the module docs).\n *\n * @param props - The drawing and what never selects, what is selected and its funnels, the snapshot and the fly\n * @returns The zones' clear, the fly to an item that selects it, the steps, and an item a drop asks to select: where it\n *   is asked, and what asks again\n */\nexport function useSelectionSteps({ data, layers, inertKeys, narrowedOut, items, shownZones, standing, reading, canvasSelection, renderSnapRef, flyTo }: SelectionStepsProps) {\n    const { zoneSelection, selection, setSelection, selected, commitSelection, commitLinkSelection, commitZoneSelection } = canvasSelection;\n    // Selected-link hygiene: clear when the link leaves the drawing (deleted —\n    // a draft, or another session's commit — or taken back by Undo), or its\n    // layer is hidden or locked (SC27), or the narrowing takes it out (#1392),\n    // through the link's funnel, so the host hears it.\n    useEffect(() => {\n        const prev = renderSnapRef.current.selectedLink;\n        if (prev === null) return;\n        const net = data.nets.find(n => n.key === prev.key);\n        if ((net === undefined && !data.links.some(l => l.key === prev.key)) || layers.hidden.has(prev.key) || inertKeys.has(prev.key)) {\n            commitLinkSelection(null);\n            return;\n        }\n        // A selected LEG whose endpoint left the net — or its item went to context (#1392) — demotes to the whole net.\n        if (prev.leg !== null && net !== undefined) {\n            const side = prev.leg.end === \"source\" ? net.sources : net.destinations;\n            if (!side.includes(prev.leg.item) || narrowedOut.has(prev.leg.item)) commitLinkSelection({ key: prev.key, leg: null });\n        }\n    }, [data.links, data.nets, layers.hidden, inertKeys, narrowedOut, commitLinkSelection, renderSnapRef]);\n\n    // Selection hygiene: prune any selected keys that left the working set (their\n    // layer was hidden) or whose layer was locked — a locked layer's entities\n    // never select (SC27) — and null a dead anchor, so prev/next stepping stays\n    // consistent; a row standing off its window stays (#1393). Only set state\n    // when the set actually shrank (fresh Set), so this can't loop.\n    useEffect(() => {\n        if (selected.size === 0) return;\n        const live = new Set([...items.flatMap(it => (inertKeys.has(it.key) ? [] : [it.key])), ...standing.items.keys()]);\n        let changed = false;\n        const next = new Set<string>();\n        for (const k of selected) { if (live.has(k)) next.add(k); else changed = true; }\n        // Route the prune through the funnel (not a raw set) so the host hears it.\n        // Shrank-only ⇒ no loop.\n        if (changed) commitSelection(next);\n        // A dead anchor (its item left the working set) is pruned with a PURE,\n        // identity-stable updater — no set change, so no callbacks fire.\n        setSelection(prev => (prev.anchor !== null && !live.has(prev.anchor)) ? { ...prev, anchor: null } : prev);\n    }, [items, selected, inertKeys, standing, commitSelection, setSelection]);\n    const clearZoneSelection = useCallback(() => {\n        // Only a real clear commits — Esc on an already-empty zone selection is silent.\n        if (renderSnapRef.current.zoneSelection.size > 0) commitZoneSelection(EMPTY_STRING_SET);\n    }, [commitZoneSelection, renderSnapRef]);\n    // Zone-selection hygiene, as the items': a zone whose layer is hidden or locked, or the narrowing takes out, leaves\n    // the selection (SC27, #1392); a zone standing off its window stays (#1393).\n    useEffect(() => {\n        if (zoneSelection.size === 0) return;\n        const live = new Set([...shownZones.flatMap(z => (inertKeys.has(z.key) ? [] : [z.key])), ...standing.zones.keys()]);\n        if ([...zoneSelection].every(key => live.has(key))) return;\n        commitZoneSelection(new Set([...zoneSelection].filter(key => live.has(key))));\n    }, [zoneSelection, shownZones, inertKeys, standing, commitZoneSelection]);\n\n    // Selection stepping order: the zones nested by containment (`buildNavTree`, as the Index tab's tree is, #1389),\n    // in natural label order, each zone's items in it, nested zones after their parent's own items, floor items last — a\n    // locked layer's and the narrowing's context left out, as they never select (SC27, #1392). Worked out as a step asks\n    // for it, and kept while the zones, the items and what never selects are as they were — never as a window lands,\n    // whose thousands of rows a step may never walk (#1393); the key→index map makes each step O(1).\n    const orderRef = useRef<{ zones: unknown; items: unknown; inert: unknown; ordered: DrawnItem[]; indexOf: ReadonlyMap<string, number> } | undefined>(undefined);\n    const itemOrder = useCallback((): { ordered: readonly DrawnItem[]; indexOf: ReadonlyMap<string, number> } => {\n        const was = orderRef.current;\n        if (was !== undefined && Object.is(was.zones, shownZones) && Object.is(was.items, items) && Object.is(was.inert, inertKeys)) return was;\n        const nav = buildNavTree(shownZones, items);\n        const unlocked = (item: DrawnItem) => !inertKeys.has(item.key);\n        const ordered: DrawnItem[] = [];\n        const walk = (nodes: NavZone[]) => {\n            for (const node of [...nodes].sort((a, b) => byLabel(a.zone, b.zone))) {\n                ordered.push(...node.items.filter(unlocked).sort(byLabel));\n                walk(node.children);\n            }\n        };\n        walk(nav.roots);\n        ordered.push(...nav.floor.filter(unlocked).sort(byLabel));\n        const order = { zones: shownZones, items, inert: inertKeys, ordered, indexOf: new Map(ordered.map((item, i) => [item.key, i])) };\n        orderRef.current = order;\n        return order;\n    }, [shownZones, items, inertKeys]);\n\n    const flyToItem = useCallback((item: DrawnItem, clearRight = 0) => {\n        const size = renderSnapRef.current.size;\n        flyTo(size === null ? pointFrame(item) : itemFrame(item, size), clearRight);\n        // A fly-to focus (Find's pick, a step, the Index's) is always\n        // single-focus REPLACE — the item alone, no zone or link beside it;\n        // its purpose is the camera move; Shift-add is marquee-only.\n        commitSelection(new Set([item.key]), { anchor: item.key });\n        clearZoneSelection();\n        commitLinkSelection(null);\n    }, [flyTo, commitSelection, clearZoneSelection, commitLinkSelection, renderSnapRef]);\n    const stepSelection = useCallback((delta: number) => {\n        const { ordered, indexOf } = itemOrder();\n        if (ordered.length === 0) return;\n        const anchor = selection.anchor;\n        const idx = anchor !== null ? (indexOf.get(anchor) ?? -1) : -1;\n        flyToItem(ordered[(idx + delta + ordered.length) % ordered.length]!);\n    }, [itemOrder, flyToItem, selection.anchor]);\n    // An item a drop added or placed (#1390), or what Find's pick or Go to issue found off the drawing (#1404, #1391),\n    // selected once the drawing draws it, alone, where it stands — an item, a zone, or a link or a net, each through its\n    // funnel, as a reveal selects it — or, a drawing that doesn't, nothing.\n    const pendingSelectRef = useRef<{ readonly id: string; readonly seen: unknown } | undefined>(undefined);\n    const [selectAsked, setSelectAsked] = useState(0);\n    useEffect(() => {\n        const pending = pendingSelectRef.current;\n        if (pending === undefined) return;\n        const id = pending.id;\n        const drawnAs = items.some((it) => stringEqual(it.key, id)) ? \"item\"\n            : shownZones.some((zone) => stringEqual(zone.key, id)) ? \"zone\"\n                : !layers.hidden.has(id) && (data.links.some((link) => stringEqual(link.key, id)) || data.nets.some((net) => stringEqual(net.key, id))) ? \"link\"\n                    : undefined;\n        if (drawnAs !== undefined) {\n            pendingSelectRef.current = undefined;\n            if (inertKeys.has(id)) return;\n            commitSelection(drawnAs === \"item\" ? new Set([id]) : EMPTY_STRING_SET, drawnAs === \"item\" ? { anchor: id } : {});\n            if (drawnAs === \"zone\") commitZoneSelection(new Set([id]));\n            else clearZoneSelection();\n            commitLinkSelection(drawnAs === \"link\" ? { key: id, leg: null } : null);\n            return;\n        }\n        // A new drawing that doesn't draw it — its layer hidden, the rail narrowing it out — selects nothing; while a read\n        // is in flight, a window that will hold it among them (#1393), it is waited for.\n        if (!Object.is(data, pending.seen) && !reading) pendingSelectRef.current = undefined;\n    }, [items, shownZones, layers.hidden, data, selectAsked, inertKeys, commitSelection, clearZoneSelection, commitZoneSelection, commitLinkSelection, reading]);\n    return { clearZoneSelection, flyToItem, stepSelection, pendingSelectRef, setSelectAsked };\n}\n\n/** What keeps the selection to the drawing, and the steps: {@link useSelectionSteps}'s. */\nexport type SelectionSteps = ReturnType<typeof useSelectionSteps>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic canvas's paint path (#57, #172, #1387): ONE commit-phase\n * snapshot of every render-derived value the async closures read — the frame's\n * apply, a fly's re-aim, the pointer handlers — written by one dep-less layout\n * effect, never in a render, the palette and each entity's colour read from the\n * theme bridge's probe in the same effect (invariant 1); the apply, which moves\n * every surface with the live camera and calls the painter behind the paint's\n * identity short-circuit (invariant 2); the minimap's paint, from the same\n * snapshot (#1393); the builder's reveal, heard through `RevealTell` for the\n * painted placeholders (#1398, invariant 30), and a pulse's breath (#1392,\n * invariant 22) — neither rendering the canvas. The painter is `paint.ts`, pure.\n *\n * The snapshot reads every part's state and every part's behaviour reads the\n * snapshot: {@link usePaint} is made after the camera's, the selection's, the\n * gestures' and the drop's state, and before what moves the camera, keeps the\n * selection, handles the gestures and takes the drop.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, type RefObject } from \"react\";\nimport { schematicColorTokens, useRevealed } from \"@elaraai/east-ui-components/internal\";\nimport type { SchematicDensity } from \"../area.js\";\nimport type { SchematicValue } from \"../data.js\";\nimport type { SchematicDropMark } from \"../drop.js\";\nimport type { SchematicNarrowedLook } from \"../narrowing.js\";\nimport type { Viewport } from \"./camera\";\nimport type { DrawnItem, DrawnZone, SchematicDrawn } from \"./drawn\";\nimport { paintMinimap } from \"./minimap\";\nimport type { LodTier, WorldBox } from \"./model\";\nimport { paintSchematic, type RGB, type SchematicPaintEffect, type SchematicPalette } from \"./paint\";\nimport { readPalette, useThemeVersion } from \"./theme\";\nimport { entityTints, tintsOf, type SchematicTints } from \"./tints\";\nimport type { Camera } from \"./use-camera\";\nimport type { CanvasSelection } from \"./use-canvas-selection\";\nimport type { GestureState } from \"./use-gestures\";\n\ntype Pt = { x: number; y: number };\n\n/** One breath of a pulse's ring, in ms. */\nconst PULSE_PERIOD_MS = 1600;\n/** No entity's colour resolved: what the canvas paints by before the probe is first read. */\nconst NO_TINTS: ReadonlyMap<string, RGB> = new Map();\n\n/**\n * The theme's colour tokens an entity's colour may name (D14): a dot whose token names none of them draws its tone's\n * colour, and is stacked by its tone — what the painter and a tap's pick of the dot drawn on top read alike.\n */\nexport const THEME_COLOURS: ReadonlySet<string> = new Set(schematicColorTokens);\n\n/**\n * Tells the canvas whether its builder's reveal shows a read in flight (#1398, CL4), as its clock flips: what its\n * painted placeholders — a marker whose status is unread — show by. It draws nothing, and its flip renders it alone,\n * never the canvas. Outside a builder's reveal a placeholder shows, as the shared shapes do.\n */\nexport const RevealTell = memo(function RevealTell({ onReveal }: { onReveal: (shown: boolean) => void }) {\n    const shown = useRevealed() !== false;\n    useLayoutEffect(() => { onReveal(shown); }, [shown, onReveal]);\n    return null;\n});\n\n/** A round scale-bar length (1/2/5 × 10^k) rendering near `targetPx`. */\nexport function niceScaleLength(ppu: number, targetPx: number): number {\n    const target = targetPx / ppu;\n    const pow = Math.pow(10, Math.floor(Math.log10(target)));\n    for (const m of [5, 2, 1]) {\n        if (m * pow <= target) return m * pow;\n    }\n    return pow;\n}\n\n/** What {@link usePaint} reads: what the snapshot holds, and the pulse's narrowing. */\nexport interface PaintProps {\n    /** The payload, decoded: the drawing's extent. */\n    readonly value: SchematicValue;\n    /** What the canvas draws: its reader's stored rows, the editing session's drafts in place — what the colours are read for. */\n    readonly data: SchematicDrawn;\n    /** What the painter draws: the drawing, its items where a Move's preview has them — the ONE seam into the painter (invariant 4). */\n    readonly paintValue: SchematicDrawn;\n    /** The items in view. */\n    readonly visibleItems: readonly DrawnItem[];\n    /** What each item in view draws as at the zoom. */\n    readonly tiers: ReadonlyMap<string, LodTier>;\n    /** Each item drawn's centre, by its id. */\n    readonly centers: ReadonlyMap<string, Pt>;\n    /** What a hidden layer holds, by id. */\n    readonly layerHiddenKeys: ReadonlySet<string>;\n    /** Each dimmed entity's opacity, by id. */\n    readonly layerAlpha: ReadonlyMap<string, number>;\n    /** Connect's draft in world units (#176): from the item it runs from to the pointer, or the target it snaps to. */\n    readonly connectDraftWorld: { from: Pt; to: Pt; fromKey: string; snapped: boolean; toKey?: string; forbiddenKey?: string } | undefined;\n    /** The link or the net lit under the pointer, while it draws and takes the pointer (#1403). */\n    readonly litShown: string | undefined;\n    /** The link a retarget moves, drawn as its `was` line (#1403). */\n    readonly wasLink: string | undefined;\n    /** Where a library card's drop lands while its drag rests there (#1390). */\n    readonly dropMark: SchematicDropMark | undefined;\n    /** What the painter draws of the narrowing, but the pulse's phase (#1392). */\n    readonly paintEffect: Omit<SchematicPaintEffect, \"pulsePhase\"> | undefined;\n    /** The box the narrowing's fit flies to (#1392). */\n    readonly fitBox: WorldBox | undefined;\n    /** Each kind read by area drawing its density in place of its items (D25), by its slot. */\n    readonly density: ReadonlyMap<string, SchematicDensity>;\n    /** Whether what it draws stands in for a new narrowing (#1398): its words painted in the third ink. */\n    readonly stale: boolean;\n    /** Whether what it draws is retained (#1398, CL8): no gesture edits it. */\n    readonly retained: boolean;\n    /** Whether the minimap shows. */\n    readonly showMinimap: boolean;\n    /** The minimap's size, in CSS px; `undefined` while the canvas has no size. */\n    readonly minimapBox: { w: number; h: number } | undefined;\n    /** The zones drawn, a hidden layer's left out: the minimap's. */\n    readonly shownZones: readonly DrawnZone[];\n    /** Each kind read by area's whole drawing's density: the minimap's (#1393). */\n    readonly minimapDensities: readonly SchematicDensity[];\n    /** Each item of a kind read whole: the minimap's dots (#1393). */\n    readonly minimapItems: readonly DrawnItem[];\n    /** How a narrowed-out row draws, and what the matches take: whether a pulse breathes. */\n    readonly look: SchematicNarrowedLook;\n    /** The narrowing's matches, by id (#1392). */\n    readonly matches: ReadonlySet<string>;\n    /** The items wearing the conflicts' warn ring, by key: holding a conflict not yet chosen, or a row its fields' bounds don't hold (#1585). */\n    readonly conflicted: ReadonlySet<string>;\n    /** The camera (`use-camera.ts`). */\n    readonly camera: Camera;\n    /** What is selected, and the report's context the snapshot writes (`use-canvas-selection.ts`). */\n    readonly canvasSelection: CanvasSelection;\n    /** The gestures' state (`use-gestures.ts`). */\n    readonly gestureState: GestureState;\n}\n\n/**\n * The commit-phase snapshot (invariant 1): every render-derived value the async closures read — the apply, a fly's\n * re-aim, the pointer handlers — as the last commit left it, the palette and each entity's colour read from the probe\n * with it.\n */\nexport interface CanvasSnapshot {\n    /** What the painter draws: the drawing, its items where a Move's preview has them — the ONE seam into the painter (invariant 4). */\n    readonly value: SchematicDrawn;\n    /** What the canvas draws, as its reader and the drafts give it: the drawing an item a drop asks to select waits on. */\n    readonly drawn: SchematicDrawn;\n    /** The canvas's size, in CSS px; `null` before it is measured. */\n    readonly size: Camera[\"size\"];\n    /** Px per world unit at Fit's zoom; `0` before the canvas is measured. */\n    readonly fit: number;\n    /** Fit's camera: home. */\n    readonly home: Viewport;\n    /** The zoom's limit, as a factor of Fit's (invariant 24). */\n    readonly maxZoom: number;\n    /** The device's pixel ratio. */\n    readonly dpr: number;\n    /** The camera as the render last took it: its throttled snapshot, which the culling and the tiers follow. */\n    readonly camera: Viewport;\n    /** The items in view. */\n    readonly visibleItems: readonly DrawnItem[];\n    /** What each item in view draws as at the zoom. */\n    readonly tiers: ReadonlyMap<string, LodTier>;\n    /** The items selected, and the anchor the steps walk from. */\n    readonly selection: CanvasSelection[\"selection\"];\n    /** The zones selected. */\n    readonly zoneSelection: ReadonlySet<string>;\n    /** What draws selected: the selection, or what a marquee in flight would select. */\n    readonly renderSelected: ReadonlySet<string>;\n    /** Each item drawn's centre, by its id. */\n    readonly centers: ReadonlyMap<string, Pt>;\n    /** What a hidden layer holds, by id. */\n    readonly layerHiddenKeys: ReadonlySet<string>;\n    /** Each dimmed entity's opacity, by id. */\n    readonly layerAlpha: ReadonlyMap<string, number>;\n    /** The tool in force. */\n    readonly effectiveTool: GestureState[\"effectiveTool\"];\n    /** Whether the tool in force drags a box: Zoom box, or Marquee. */\n    readonly isBoxTool: boolean;\n    /** Connect's draft in world units (#176). */\n    readonly connectDraftWorld: PaintProps[\"connectDraftWorld\"];\n    /** The link or the net selected, and a net's leg. */\n    readonly selectedLink: CanvasSelection[\"selectedLink\"];\n    /** Whether the selected link writes: its handles draw, and a press on one re-targets it. */\n    readonly selectedLinkEditable: boolean;\n    /** Where a library card's drop lands while its drag rests there (#1390). */\n    readonly dropMark: SchematicDropMark | undefined;\n    /** What the painter draws of the narrowing, but the pulse's phase (#1392). */\n    readonly paintEffect: PaintProps[\"paintEffect\"];\n    /** The box the narrowing's fit flies to (#1392). */\n    readonly fitBox: WorldBox | undefined;\n    /** The link or the net lit under the pointer (#1403). */\n    readonly lit: string | undefined;\n    /** The link a retarget moves, drawn as its `was` line (#1403). */\n    readonly wasLink: string | undefined;\n    /** Each kind read by area drawing its density in place of its items, by its slot (D25). */\n    readonly density: ReadonlyMap<string, SchematicDensity>;\n    /** Whether what it draws stands in for a new narrowing (#1398). */\n    readonly stale: boolean;\n    /** Whether what it draws is retained (#1398, CL8). */\n    readonly retained: boolean;\n    /** The drawing's extent, in world units. */\n    readonly extent: SchematicValue[\"extent\"];\n    /** What the minimap draws, while it shows and the canvas has a size (#1393). */\n    readonly minimap: {\n        readonly box: { readonly w: number; readonly h: number };\n        readonly zones: readonly DrawnZone[];\n        readonly densities: readonly SchematicDensity[];\n        readonly items: readonly DrawnItem[];\n    } | undefined;\n    /** The palette the probe last read; `null` before it is first read. */\n    readonly palette: SchematicPalette | null;\n    /** Each entity's colour, by its id, as the probe resolved it. */\n    readonly tints: ReadonlyMap<string, RGB>;\n}\n\n/** The paint path, as {@link usePaint} gives it. */\nexport interface Paint {\n    /** The painted canvas's element. */\n    readonly drawRef: RefObject<HTMLCanvasElement | null>;\n    /**\n     * Each card's size as the page lays it out, by its item's id (#1403): what the card layer's observer writes, in place,\n     * and a link's end meets.\n     */\n    readonly cardSizesRef: RefObject<Map<string, { w: number; h: number }>>;\n    /** Draws again as a card's size moves: the card layer tells it so, and the paint's short-circuit hears it (invariant 2). */\n    readonly applyCardSizes: () => void;\n    /** The card layer's element: what the apply writes the live camera's custom properties to. */\n    readonly cardLayerRef: RefObject<HTMLDivElement | null>;\n    /** The grid's element: its cells and its position, as the apply writes them. */\n    readonly gridRef: RefObject<HTMLDivElement | null>;\n    /** The unread area's layer, under the grid (#1398). */\n    readonly washLayerRef: RefObject<HTMLDivElement | null>;\n    /** Every colour the drawing names, and each entity's: what the probe holds (`tints.ts`). */\n    readonly tintIndex: SchematicTints;\n    /** The theme bridge's probe's element (`theme.tsx`). */\n    readonly probeRef: RefObject<HTMLDivElement | null>;\n    /** What draws selected: the selection, or what a marquee in flight would select. */\n    readonly renderSelected: ReadonlySet<string>;\n    /** The commit-phase snapshot (invariant 1). */\n    readonly renderSnapRef: RefObject<CanvasSnapshot>;\n    /** Applies the live camera to every surface, then paints behind the paint's identity short-circuit (invariant 2). */\n    readonly applyCamera: () => void;\n    /** Hears the builder's reveal flip (CL4): the painted placeholders show, or go unseen, with no render of the canvas. */\n    readonly onReveal: (shown: boolean) => void;\n    /** Whether the painted placeholders show, as the reveal last said: what a tap's pick of the marker drawn on top reads too. */\n    readonly placeholdersRef: RefObject<boolean>;\n    /** The minimap's painted canvas's element. */\n    readonly minimapPaintRef: RefObject<HTMLCanvasElement | null>;\n}\n\n/**\n * The paint path (see the module docs).\n *\n * @param props - What the snapshot holds — the drawing and what it draws in view, the camera, what is selected, the\n *   gestures' state, the drop's mark, the narrowing's look and what stands in — and the minimap's\n * @returns The surfaces' refs, the probe's colours and its ref, what the cards draw selected, the snapshot's ref, the\n *   apply, what hears the reveal, and the minimap's paint's ref\n */\nexport function usePaint({\n    value, data, paintValue, visibleItems, tiers, centers, layerHiddenKeys, layerAlpha, connectDraftWorld, litShown, wasLink, dropMark, paintEffect, fitBox,\n    density, stale, retained, showMinimap, minimapBox, shownZones, minimapDensities, minimapItems, look, matches, conflicted, camera, canvasSelection, gestureState,\n}: PaintProps): Paint {\n    const { size, dpr, cameraRef, cameraSnapshot, fit, home, maxZoom } = camera;\n    const { selection, zoneSelection, selected, selectedLink, commitCtx, commitCtxRef } = canvasSelection;\n    const { effectiveTool, isBoxTool, selectedLinkEditable, marqueePreview, connectFlashRef } = gestureState;\n    const drawRef = useRef<HTMLCanvasElement | null>(null);\n    // Each card's size as the page lays it out, by its item's id (#1403): what a link's end meets at card zoom. Heard\n    // by a ResizeObserver as each card is laid out and as its box changes — never in a render — written into this one\n    // map in place, and a card the card layer lets go of leaving it; a card it hasn't heard, or one laid out at no size,\n    // is reckoned (`tierSize`). The map stays the same object: its version, moved as a size moves, is what the paint's\n    // short-circuit compares (invariant 2).\n    const cardSizesRef = useRef<Map<string, { w: number; h: number }>>(new Map());\n    const cardSizesVersionRef = useRef(0);\n    const cardLayerRef = useRef<HTMLDivElement | null>(null);\n    const gridRef = useRef<HTMLDivElement | null>(null);\n    // The unread area's layer, under the grid (#1398): its washes follow the camera's custom properties, as the cards do.\n    const washLayerRef = useRef<HTMLDivElement | null>(null);\n    // Whether the painted placeholders show, as the builder's reveal says (CL4): heard by `RevealTell`, read at paint time.\n    const placeholdersRef = useRef(true);\n\n    // --- The theme bridge (#1387): every colour and font the canvas draws in ----\n    // The colours the drawing names, each entity's by its id: read from what is\n    // drawn — the reader's rows, the drafts in place — which keeps its identity\n    // while nothing it shows moves, so a Move's preview keeps its items' colours,\n    // and a drafted link draws in its style's own. The probe holds one element\n    // per colour; the commit-phase snapshot below reads it when the colours named\n    // or the theme change, never in the render body.\n    const tintIndex = useMemo(() => tintsOf(data), [data]);\n    const themeVersion = useThemeVersion();\n    const probeRef = useRef<HTMLDivElement | null>(null);\n    /** What the probe last read, and for which colours — by their signature — and which theme. */\n    const paletteRef = useRef<{ signature: string; theme: number; palette: SchematicPalette; tints: ReadonlyMap<string, RGB> } | null>(null);\n    /** Each entity's colour, and the colours and the drawing it was resolved for. */\n    const entityTintsRef = useRef<{ byEntity: unknown; tints: unknown; byId: ReadonlyMap<string, RGB> } | null>(null);\n\n    // --- Single synchronized camera apply (Phase 2). ------------------------\n    // While a marquee drag is in flight, the CANVAS previews the would-be\n    // selection (rings on the boxed items) without committing. Interaction\n    // logic keeps using the committed `selected`; only the paint + cards read this.\n    const renderSelected = marqueePreview ?? selected;\n    // ONE commit-phase snapshot of every render-derived value the async closures\n    // (the rAF `applyCamera`, `flyTo`'s per-frame re-aim, the pointer handlers)\n    // need (#172). Written ONLY in the dep-less layout effect below — never in\n    // the render body — so a discarded / StrictMode-double render can never leak\n    // uncommitted values into a frame, and there is no per-field mirror (or\n    // dependency list) to drift. The palette and each entity's colour are read\n    // there too, from the probe the commit just laid out.\n    const renderSnap = {\n        value: paintValue, drawn: data, size, fit, home, maxZoom, dpr, camera: cameraSnapshot, visibleItems, tiers,\n        selection, zoneSelection, renderSelected, centers, conflicted,\n        layerHiddenKeys, layerAlpha,\n        effectiveTool, isBoxTool,\n        connectDraftWorld,\n        selectedLink, selectedLinkEditable,\n        dropMark,\n        paintEffect, fitBox,\n        lit: litShown, wasLink,\n        density,\n        // What stands in for a new narrowing (#1398): kept, its words painted in the third ink; retained, no gesture edits.\n        stale, retained,\n        extent: value.extent,\n        minimap: showMinimap && minimapBox !== undefined ? { box: minimapBox, zones: shownZones, densities: minimapDensities, items: minimapItems } : undefined,\n        palette: null as SchematicPalette | null,\n        tints: NO_TINTS,\n    };\n    const renderSnapRef = useRef(renderSnap);\n    // The pulse's phase (0..1), moved by its ticker and read at paint time, with no render: the animation's own.\n    const pulsePhaseRef = useRef(0);\n\n    // Skip an apply whose inputs are referentially identical to the last —\n    // covers redundant idle re-renders / repeated requestRender with no change.\n    // (During an active pan the layout-effect apply still repaints, because\n    // visibleItems is rebuilt fresh each snapshot; that second paint is accepted\n    // — bounded by viewport culling — and keeps canvas LOD lock-step with cards.)\n    const lastPaintRef = useRef<{\n        zoom: number; tx: number; ty: number; vis: unknown; tiers: unknown;\n        sel: ReadonlySet<string>; zsel: ReadonlySet<string>; pal: SchematicPalette | null; tints: unknown; w: number; h: number; dpr: number; val: unknown;\n        lay: unknown; alp: unknown;\n        dl: unknown; cf: number; slk: unknown; sle: boolean; dm: unknown; eff: unknown; phase: number;\n        lit: string | undefined; was: string | undefined; cs: number; den: unknown; ph: boolean; st: boolean; cfl: ReadonlySet<string>;\n    } | null>(null);\n\n    // Apply the LIVE camera to ALL surfaces in one step: card-layer CSS vars +\n    // grid first (cheap, palette-independent), then the canvas paint (issue\n    // #57, Phase 2 invariant 1). Positions therefore never desync — every\n    // surface reads the same `cameraRef` (P1).\n    const applyCamera = useCallback(() => {\n        const snap = renderSnapRef.current;\n        const sz = snap.size;\n        if (sz === null) return;\n        const cam = cameraRef.current;\n        const ppuLive = snap.fit * cam.zoom;\n        const dprLive = snap.dpr;\n\n        // DOM card layer: move every card with three custom-property writes on\n        // the parent (compositor only — no per-card layout) — invariant 6. The\n        // grid's rules follow the same camera, by the same properties.\n        const grid = gridRef.current;\n        for (const layer of [cardLayerRef.current, washLayerRef.current, grid]) {\n            if (layer === null) continue;\n            layer.style.setProperty(\"--cam-ppu\", String(ppuLive));\n            layer.style.setProperty(\"--cam-tx\", `${cam.tx}px`);\n            layer.style.setProperty(\"--cam-ty\", `${cam.ty}px`);\n        }\n        // Background grid: its cells, the scale bar's length a major one, five minor ones to it — the recipe drawing its\n        // rules from them, solid, or dashed while what the canvas draws is kept (#1398).\n        if (grid !== null) {\n            const len = ppuLive > 0 ? niceScaleLength(ppuLive, 100) : 0;\n            if (len > 0) {\n                const major = len * ppuLive;\n                grid.style.setProperty(\"--schematic-grid-major\", `${major}px`);\n                grid.style.setProperty(\"--schematic-grid-minor\", `${major / 5}px`);\n            }\n        }\n\n        const canvas = drawRef.current, pal = snap.palette;\n        if (canvas === null || pal === null) return;\n        // Connect-flash phase (0..1; -1 = no flash) — animates via the flash rAF.\n        const cf = connectFlashRef.current;\n        const cfPhase = cf !== null ? Math.min(1, (performance.now() - cf.t0) / 450) : -1;\n        const cardSizes = cardSizesRef.current;\n        const cardSizesVersion = cardSizesVersionRef.current;\n        const last = lastPaintRef.current;\n        if (last !== null\n            && last.zoom === cam.zoom && last.tx === cam.tx && last.ty === cam.ty\n            && last.vis === snap.visibleItems && last.tiers === snap.tiers\n            && last.sel === snap.renderSelected && last.zsel === snap.zoneSelection && last.pal === pal && last.tints === snap.tints\n            && last.w === sz.w && last.h === sz.h && last.dpr === dprLive && Object.is(last.val, snap.value)\n            && last.lay === snap.layerHiddenKeys && last.alp === snap.layerAlpha\n            && last.dl === snap.connectDraftWorld && last.cf === cfPhase\n            && last.slk === snap.selectedLink && last.sle === snap.selectedLinkEditable && last.dm === snap.dropMark\n            && last.eff === snap.paintEffect && last.phase === pulsePhaseRef.current\n            && last.lit === snap.lit && last.was === snap.wasLink && last.cs === cardSizesVersion && last.den === snap.density\n            && last.ph === placeholdersRef.current && last.st === snap.stale && last.cfl === snap.conflicted) return;\n        lastPaintRef.current = {\n            zoom: cam.zoom, tx: cam.tx, ty: cam.ty, vis: snap.visibleItems, tiers: snap.tiers,\n            sel: snap.renderSelected, zsel: snap.zoneSelection, pal, tints: snap.tints, w: sz.w, h: sz.h, dpr: dprLive, val: snap.value,\n            lay: snap.layerHiddenKeys, alp: snap.layerAlpha,\n            dl: snap.connectDraftWorld, cf: cfPhase,\n            slk: snap.selectedLink, sle: snap.selectedLinkEditable, dm: snap.dropMark,\n            eff: snap.paintEffect, phase: pulsePhaseRef.current,\n            lit: snap.lit, was: snap.wasLink, cs: cardSizesVersion, den: snap.density, ph: placeholdersRef.current, st: snap.stale, cfl: snap.conflicted,\n        };\n        const bw = Math.round(sz.w * dprLive), bh = Math.round(sz.h * dprLive);\n        if (canvas.width !== bw || canvas.height !== bh) { canvas.width = bw; canvas.height = bh; }\n        const ctx = canvas.getContext(\"2d\");\n        if (ctx === null) return;\n        ctx.setTransform(dprLive, 0, 0, dprLive, 0, 0);\n        // A paint throw (bad geometry / palette edge) logs and skips the frame\n        // rather than propagating out of a layout effect and unmounting the tree.\n        try {\n            paintSchematic({\n                ctx, value: snap.value, cam: { ppu: ppuLive, tx: cam.tx, ty: cam.ty },\n                width: sz.w, height: sz.h,\n                visibleItems: snap.visibleItems, tiers: snap.tiers,\n                selected: snap.renderSelected, selectedZones: snap.zoneSelection, centers: snap.centers, palette: pal, tints: snap.tints,\n                conflicted: snap.conflicted,\n                // Layer masks for the zone / link paint passes (items are already\n                // pre-filtered out of visibleItems); `layerAlpha` dims item markers.\n                layerHiddenKeys: snap.layerHiddenKeys, layerAlpha: snap.layerAlpha,\n                // Connect-tool overlays (#176): the draft edge and the one-shot commit flash.\n                ...(snap.connectDraftWorld !== undefined ? { draftLink: snap.connectDraftWorld } : {}),\n                ...(cf !== null ? { connectFlash: { from: snap.centers.get(cf.from), to: snap.centers.get(cf.to), phase: cfPhase } } : {}),\n                ...(snap.selectedLink !== null ? {\n                    selectedLink: {\n                        key: snap.selectedLink.key, editable: snap.selectedLinkEditable,\n                        ...(snap.selectedLink.leg !== null ? { leg: snap.selectedLink.leg } : {}),\n                    },\n                } : {}),\n                // Where a library card's drop lands (#1390): the point, or the entity it lands on.\n                ...(snap.dropMark !== undefined ? { dropMark: snap.dropMark } : {}),\n                // What the narrowing paints (#1392): context, the matches' rings at the pulse's phase, and their frame.\n                ...(snap.paintEffect !== undefined ? { effect: { ...snap.paintEffect, pulsePhase: pulsePhaseRef.current } } : {}),\n                // The links' ends on the cards' sides as the page lays them out, the link lit, and a retarget's run (#1403).\n                cardSizes,\n                ...(snap.lit !== undefined ? { lit: snap.lit } : {}),\n                ...(snap.wasLink !== undefined ? { was: snap.wasLink } : {}),\n                // The density at overview, each kind read by area past the rows a window draws (#1393, D25).\n                ...(snap.density.size > 0 ? { density: snap.density } : {}),\n                // A marker whose status is unread draws in the placeholders' fill once the reveal says so (#1398, CL4).\n                placeholders: placeholdersRef.current,\n                // What stands in for a new narrowing (#1398): its words in the third ink.\n                stale: snap.stale,\n                // The theme's colour tokens: a dot whose token names none draws, and is stacked by, its tone.\n                colours: THEME_COLOURS,\n            });\n        } catch (err) {\n            console.error(\"[Schematic] paint failed (frame skipped):\", err);\n        }\n    }, [cameraRef, connectFlashRef]);\n\n    // A card's size moving (#1403): the map is written in place, so its version moves for the short-circuit, then the apply.\n    const applyCardSizes = useCallback(() => {\n        cardSizesVersionRef.current += 1;\n        applyCamera();\n    }, [applyCamera]);\n\n    // The builder's reveal flipping (CL4): the painted placeholders show, or go unseen, with no render of the canvas.\n    const onReveal = useCallback((shown: boolean) => {\n        if (placeholdersRef.current === shown) return;\n        placeholdersRef.current = shown;\n        applyCamera();\n    }, [applyCamera]);\n\n    // The minimap's paint (#1393): from the commit-phase snapshot, as the canvas's is, and drawn again only as what it\n    // shows moves — its element, its size, the zones, the overview, the items, the palette — never as the camera moves:\n    // the viewport's box over it is the DOM's.\n    const minimapPaintRef = useRef<HTMLCanvasElement | null>(null);\n    const lastMinimapRef = useRef<{\n        el: HTMLCanvasElement; w: number; h: number; dpr: number; pal: SchematicPalette; zones: unknown; densities: unknown; items: unknown;\n    } | null>(null);\n    const applyMinimap = useCallback(() => {\n        const snap = renderSnapRef.current;\n        const canvas = minimapPaintRef.current, pal = snap.palette, mini = snap.minimap;\n        if (canvas === null || pal === null || mini === undefined) return;\n        const { box } = mini;\n        const last = lastMinimapRef.current;\n        if (last !== null && last.el === canvas && last.w === box.w && last.h === box.h && last.dpr === snap.dpr && last.pal === pal\n            && last.zones === mini.zones && last.densities === mini.densities && last.items === mini.items) return;\n        lastMinimapRef.current = { el: canvas, w: box.w, h: box.h, dpr: snap.dpr, pal, zones: mini.zones, densities: mini.densities, items: mini.items };\n        const bw = Math.round(box.w * snap.dpr), bh = Math.round(box.h * snap.dpr);\n        if (canvas.width !== bw || canvas.height !== bh) { canvas.width = bw; canvas.height = bh; }\n        const ctx = canvas.getContext(\"2d\");\n        if (ctx === null) return;\n        ctx.setTransform(snap.dpr, 0, 0, snap.dpr, 0, 0);\n        try {\n            paintMinimap({ ctx, width: box.w, height: box.h, extent: snap.extent, zones: mini.zones, densities: mini.densities, items: mini.items, palette: pal });\n        } catch (err) {\n            console.error(\"[Schematic] minimap paint failed:\", err);\n        }\n    }, []);\n\n    // THE commit-phase snapshot write (#172): dep-less, so it runs on EVERY\n    // commit — the snapshot + commit context can never lag a render, and there\n    // is no dependency list to drift. The palette is read from the probe here,\n    // when the colours the drawing names or the theme moved — the probe this\n    // commit laid out — and each entity's colour resolved from it, before the\n    // paint. `applyCamera`'s identity short-circuit makes the trailing repaint\n    // free when nothing paint-relevant changed.\n    useLayoutEffect(() => {\n        const probe = probeRef.current;\n        let read = paletteRef.current;\n        if (probe !== null && (read === null || read.signature !== tintIndex.signature || read.theme !== themeVersion)) {\n            const reading = readPalette(probe);\n            read = { signature: tintIndex.signature, theme: themeVersion, palette: reading.palette, tints: reading.tints };\n            paletteRef.current = read;\n        }\n        let resolved = entityTintsRef.current;\n        if (read !== null && (resolved === null || resolved.byEntity !== tintIndex.byEntity || resolved.tints !== read.tints)) {\n            resolved = { byEntity: tintIndex.byEntity, tints: read.tints, byId: entityTints(tintIndex.byEntity, read.tints) };\n            entityTintsRef.current = resolved;\n        }\n        renderSnapRef.current = { ...renderSnap, palette: read?.palette ?? null, tints: resolved?.byId ?? NO_TINTS };\n        commitCtxRef.current = commitCtx;\n        applyCamera();\n        applyMinimap();\n    });\n\n    // A pulse's breath (#1392, §10.3): a loop of its own that moves the phase and repaints, only while a match is\n    // ringed by a pulse — a halo, or none, never starts it. Its cards breathe by the same clock, the card layer's\n    // `--pulse` (0..1), which the recipe's ring reads; let go, the phase rests and one paint clears the last ring.\n    const pulsing = look.emphasis === \"pulse\" && matches.size > 0;\n    useEffect(() => {\n        if (!pulsing) return;\n        let raf = 0;\n        // The card layer the cards breathe on: read at each frame, as it mounts only once the canvas is measured.\n        let breathed: HTMLDivElement | null = null;\n        const start = performance.now();\n        // The clock the breath began on, as a fly reads its own: never the frame's stamp, which can stand before it.\n        const tick = () => {\n            const phase = ((performance.now() - start) % PULSE_PERIOD_MS) / PULSE_PERIOD_MS;\n            pulsePhaseRef.current = phase;\n            breathed = cardLayerRef.current;\n            breathed?.style.setProperty(\"--pulse\", String(Math.sin(phase * Math.PI * 2) * 0.5 + 0.5));\n            applyCamera();\n            raf = requestAnimationFrame(tick);\n        };\n        raf = requestAnimationFrame(tick);\n        return () => {\n            cancelAnimationFrame(raf);\n            pulsePhaseRef.current = 0;\n            breathed?.style.setProperty(\"--pulse\", \"0\");\n            applyCamera();\n        };\n    }, [pulsing, applyCamera]);\n\n    // (The per-commit repaint rides the dep-less snapshot-write effect above —\n    // a zone/link-only layer change, a theme switch, or a data change repaints\n    // because EVERY commit re-snapshots then applies, and the identity\n    // short-circuit makes the no-change case free.)\n    return {\n        drawRef, cardSizesRef, applyCardSizes, cardLayerRef, gridRef, washLayerRef, tintIndex, probeRef, renderSelected, renderSnapRef, applyCamera, onReveal,\n        placeholdersRef, minimapPaintRef,\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic canvas's gestures (#57, #153, #159, #176, #179, #189, #353):\n * the pointer handlers over the camera's mode machine — a pan, a pinch, the\n * zoom box and the marquee, Move and its preview (invariant 4), Connect and its\n * Shift session (invariant 11), Retarget and Extend, each held to the host's\n * veto (invariant 6), and the taps, each hit-testing what the painter draws\n * (invariant 9); the canvas's keys, and the frame's and the page's while the\n * pointer is over it (invariant 16), each it acts on going no further than the\n * Schematic (#1398); and the link or the net lit under the pointer (#1403,\n * invariant 12). Every gesture that writes is one step of the editing's\n * history (`../edits.ts`, #1388).\n *\n * Which pointer a gesture is, the fingers the canvas holds and each way a\n * gesture ends are not this hook's: the canvas is a surface of the shared\n * pointer core (east-ui-components' `src/pointer/`, `useSurfaceGestures`),\n * which holds every surface's gestures to one rule (invariants 33, 34). A\n * finger is gone as it lifts, as the browser takes it back and as the canvas\n * loses its capture, and one whose end is never heard is let go of as the next\n * first finger lands or the window loses the page — so no finger is remembered\n * into a pinch that never ends. One gesture is in flight at a time, its\n * pointer's: another pointer's moves and release are not its, and a second\n * finger, a new press, a lost pointer and the window losing the page each let\n * go of it. What the hook holds is what the canvas's gestures do: what a press\n * begins under the tool in force, what its drag draws, what its release\n * records, and what letting go puts back, recording nothing (`drop`). Two\n * fingers pinch: the drawing zooms by how far apart they are drawn and is\n * carried with them, each finger staying on the point of the drawing it\n * touched (`camera.ts`' `pinchAbout`).\n *\n * The commit-phase snapshot reads the gestures' state (`use-paint.ts`,\n * invariant 1), and the handlers read the snapshot: {@link useGestureState}\n * holds the state — the tool in force, a Move's preview, Connect's draft and\n * its flash, the box in flight and the link lit — and is made before the\n * snapshot; {@link useGestures} holds the handlers, and is made after it.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState, type RefObject } from \"react\";\nimport type RBush from \"rbush\";\nimport { StringType, equalFor, type option } from \"@elaraai/east\";\nimport { SCHEMATIC_WINDOW_ROWS } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, takeKey, typedInto, type Origin } from \"@elaraai/east-ui-components\";\nimport { useSurfaceGestures, type PinchStep } from \"@elaraai/east-ui-components/internal\";\nimport { keepsSpace, keyFromPage, keyInFrame } from \"../../shared/frame-keys.js\";\nimport { unjoined } from \"../../shared/links/canvas.js\";\nimport { densityInView } from \"../area.js\";\nimport type { SchematicValue } from \"../data.js\";\nimport type { SchematicMove } from \"../editing.js\";\nimport {\n    clampDelta, connectCandidate, connectStep, connectVeto, deleteEdits, editKinds, extendEdits, extendPairs, followSession, linkRefusal, moveEdits,\n    placeholderRefusal, retargetEdits, vetoOfPairs,\n    type ConnectDragArgs, type ConnectSession, type EditRefusal, type Mover, type NetLeg, type SchematicEdit, type SessionDrawn,\n} from \"../edits.js\";\nimport type { SchematicStep, SchematicWords } from \"../messages.js\";\nimport type { SchematicTool } from \"../tools.js\";\nimport { pinchAbout } from \"./camera\";\nimport { entityId, refOfId, type DrawnItem, type DrawnLink, type DrawnNet, type DrawnZone, type SchematicDrawn, type SchematicRef } from \"./drawn\";\nimport type { SchematicLayerState } from \"./layers\";\nimport { markerHit, markerHitbox } from \"./markers\";\nimport type { LodTier } from \"./model\";\nimport { dotDrawnRadius, planMarkers, topMarker, zoneAnchor, type MarkerPlan } from \"./paint\";\nimport { linkRoutes, netRoutes, routeEnv, type EdgeGeometry } from \"./routes\";\nimport { EMPTY_STRING_SET, type ItemBox, type LinkIndex, linkAt, marqueeHits } from \"./selection\";\nimport type { Camera, CameraMoves } from \"./use-camera\";\nimport type { CanvasSelection, SchematicStanding, SelectionSteps } from \"./use-canvas-selection\";\nimport { THEME_COLOURS, type Paint } from \"./use-paint\";\nimport type { SchematicCanvasEditing } from \"./view\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * A connect drag in flight (#176): the item it runs from, whether Shift was\n * held, the end of a selected link it re-targets, or the selected net it\n * extends.\n */\ntype ConnectDrag = { from: string; additive: boolean; retarget?: { key: string; movingEnd: \"from\" | \"to\" }; netExtend?: string };\n\ntype Pt = { x: number; y: number };\n\n/** No drag moves anything. */\nconst NO_MOVES: ReadonlyMap<string, Pt> = new Map();\n\n/** How far a press moves, each way, before it is a drag: within it, its release is a tap (px). */\nconst DRAG_THRESHOLD_PX = 4;\n\n/**\n * Whether a key the window hears is the canvas's to take while the pointer is over it: one from nowhere in particular\n * — the page, its body — or from inside the canvas's own frame (`../../shared/frame-keys.ts`). A key from a layer\n * portaled out of the frame — a popover, a menu, a Chooser's list — is that layer's, as the frame leaves such a layer\n * its Esc (`BuilderFrame`); so is one from another frame on the page.\n *\n * @param canvas - The canvas's element\n * @param target - The key's target\n * @returns Whether the key is the canvas's\n */\nfunction keyIsCanvas(canvas: Element | null, target: EventTarget | null): boolean {\n    return keyFromPage(target) || keyInFrame(canvas, target);\n}\n\n/**\n * What a tap on the density zooms in to: a box whose rows, by the density's own count, draw once the fly frames it —\n * its view the box grown by the fly's margin (1.18 a side, near 1.4 times its rows) still short of the rows a view\n * draws.\n */\nconst DENSITY_TAP_ROWS = SCHEMATIC_WINDOW_ROWS * 0.6;\n\n/** Even–odd point-in-polygon test in world coords (footprint hit-testing). */\nfunction pointInPolygon(x: number, y: number, pts: readonly Pt[]): boolean {\n    let inside = false;\n    for (let i = 0, j = pts.length - 1; i < pts.length; j = i++) {\n        const xi = pts[i]!.x, yi = pts[i]!.y, xj = pts[j]!.x, yj = pts[j]!.y;\n        if ((yi > y) !== (yj > y) && x < (xj - xi) * (y - yi) / (yj - yi) + xi) inside = !inside;\n    }\n    return inside;\n}\n\n/** What {@link useGestureState} reads. */\nexport interface GestureStateProps {\n    /** The payload, decoded: its kinds, which write and which draw only (`../edits.ts`' `editKinds`). */\n    readonly value: SchematicValue;\n    /** The tool held, the frame's. */\n    readonly tool: SchematicTool;\n    /** Whether main is below 480px (#1394, D15): a selected link draws no handle, and takes no re-target's drag. */\n    readonly narrow: boolean;\n    /** Whether what the canvas draws is retained (#1398, CL8): no gesture edits it. */\n    readonly retained: boolean;\n    /** Each entity's reference by its id on the canvas. */\n    readonly refById: ReadonlyMap<string, SchematicRef>;\n    /** The link or the net selected, and a net's leg (`use-canvas-selection.ts`). */\n    readonly selectedLink: CanvasSelection[\"selectedLink\"];\n    /** The items selected (`use-canvas-selection.ts`): what a Shift marquee unions into. */\n    readonly selected: ReadonlySet<string>;\n}\n\n/**\n * The gestures' state (see the module docs).\n *\n * @param props - The payload, the tool held, the layout and what stands in, each entity's reference, and what is\n *   selected\n * @returns The kinds as the edits read them, the link lit, whether the selected link writes, a Move's preview — each\n *   item its drag moves, where it has it — the tool in force, Connect's draft and its flash, and the box in flight and\n *   its preview\n */\nexport function useGestureState({ value, tool, narrow, retained, refById, selectedLink, selected }: GestureStateProps) {\n    // Editing (#1388) follows the kinds' bindings (§1, rule 4): a kind bound with\n    // its patch door writes, and none does while the Schematic is read only\n    // (`edits.ts`' `editKinds`, SC14). The Connect tool draws the link kind the\n    // frame's Connect menu chose; a Shift session grows into the first net kind\n    // whose sides hold its items; the Move tool moves the items of the item kinds\n    // that write; Del deletes what is selected of them. Each gesture is one step\n    // of the editing's history.\n    const kinds = useMemo(() => editKinds({ items: value.items, links: value.links, nets: value.nets, readOnly: value.readOnly }),\n        [value.items, value.links, value.nets, value.readOnly]);\n    const movableKinds = kinds.items;\n    // The link or the net under the pointer (#1403), lit: drawn last in the strong ink, its ends ringed, and named in\n    // `data-lit-link`. It lights while no gesture is under way, and nothing opens on it (invariant 12).\n    const [lit, setLit] = useState<string | undefined>(undefined);\n    // Whether the selected link writes: its connector handles show, and a re-target writes it — never below 480px of main,\n    // where the inspector's ends re-target it (#1394, D15), nor while what the canvas draws is retained (#1398, CL8).\n    const selectedLinkEditable = !narrow && !retained && selectedLink !== null && kinds.links.get(refById.get(selectedLink.key)?.kind ?? \"\")?.editable === true;\n    // --- A Move's preview (#179, #1388) — while its drag is under way. ----------\n    // Each item the drag moves, where it has it: applied UPSTREAM of the working set\n    // so centers / rbush / LOD / nav / link endpoints all follow it. The release\n    // records the move as one step, its preview going as its drafts draw; Esc or a\n    // lost pointer drops the preview and records nothing (SC8).\n    const [dragMoves, setDragMoves] = useState<ReadonlyMap<string, Pt>>(NO_MOVES);\n\n    // Interaction tool, the frame's (§6.1): Select drag-pans and tap-selects\n    // (#153); Zoom box drags a box the view flies into (#153); Marquee drags a\n    // box that selects the enclosed items (#159); Connect (#176) and Move (#179)\n    // edit. Both box tools share the drag machinery — `isBoxTool` gates it.\n    // Momentary keyboard overrides — hold Space (Select) / Ctrl (Zoom box) while\n    // hovering — set `tempTool`; `effectiveTool` is what the cursor + drag obey.\n    const [tempTool, setTempTool] = useState<\"select\" | \"zoom\" | null>(null);\n    const effectiveTool = tempTool ?? tool;\n    const isBoxTool = effectiveTool === \"zoom\" || effectiveTool === \"marquee\";\n    // A refused draft keeps the refusal's words (`reason`) — its kind's, or the veto's — which it shows (SC9). A\n    // retarget's names the link it moves (`retarget`), drawn as its `was` line while its end is dragged (#1403).\n    const [connectDraft, setConnectDraft] = useState<{\n        from: string; toWorld: Pt; target: string | undefined; retarget?: string; forbidden?: string; reason?: string | undefined;\n    } | null>(null);\n    // One-shot connect flash (the draw-in + endpoint rings), driven by a short\n    // rAF loop like the pulse ticker — phase read at paint time from the ref.\n    const connectFlashRef = useRef<{ from: string; to: string; t0: number } | null>(null);\n    const flashRafRef = useRef<number | null>(null);\n    // Box-gesture render state, consolidated (#172): ONE object per in-flight\n    // box drag — the overlay rect, which tool owns it, Shift-additivity, and the\n    // live marquee hits. `null` ⇒ no box in flight. The badge count and the\n    // canvas selection PREVIEW derive from it (they can never disagree).\n    const [boxDrag, setBoxDrag] = useState<{\n        rect: { x: number; y: number; w: number; h: number };\n        mode: \"zoom\" | \"marquee\";\n        additive: boolean;\n        hits: ReadonlySet<string>;\n    } | null>(null);\n    const selRect = boxDrag?.rect ?? null;\n    const marqueeCount = boxDrag !== null && boxDrag.mode === \"marquee\" ? boxDrag.hits.size : 0;\n    // The would-be selection while a marquee drag is in flight (null = not\n    // dragging ⇒ render the committed selection). Memoised so the paint\n    // identity short-circuit sees a stable set per commit. Canvas-only.\n    const marqueePreview = useMemo<ReadonlySet<string> | null>(() => {\n        if (boxDrag === null || boxDrag.mode !== \"marquee\") return null;\n        return boxDrag.additive ? new Set([...selected, ...boxDrag.hits]) : boxDrag.hits;\n    }, [boxDrag, selected]);\n    return {\n        kinds, movableKinds, lit, setLit, selectedLinkEditable, dragMoves, setDragMoves, setTempTool, effectiveTool, isBoxTool,\n        connectDraft, setConnectDraft, connectFlashRef, flashRafRef, setBoxDrag, selRect, marqueeCount, marqueePreview,\n    };\n}\n\n/** The gestures' state: {@link useGestureState}'s. */\nexport type GestureState = ReturnType<typeof useGestureState>;\n\n/** What {@link useGestures} reads. */\nexport interface GesturesProps {\n    /** The payload, decoded: its kinds' veto, `canConnect`. */\n    readonly value: SchematicValue;\n    /** What the canvas draws: its reader's stored rows, the editing session's drafts in place (#1388). */\n    readonly data: SchematicDrawn;\n    /** What the layers hide, lock and dim. */\n    readonly layers: SchematicLayerState;\n    /** The tool held, the frame's. */\n    readonly tool: SchematicTool;\n    /** The link kind Connect draws; `undefined` where no link kind is editable. */\n    readonly linkKind: string | undefined;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /** How the canvas records its gestures; `undefined` where no record is edited. */\n    readonly editing: SchematicCanvasEditing | undefined;\n    /** Told why a gesture was refused, or — `undefined` — that one has been recorded since. */\n    readonly onRefused: (words: string | undefined) => void;\n    /** Told when Enter, or a double-click on an entity, opens the selection in the inspector's Details; `undefined` with no inspector. */\n    readonly onOpen: (() => void) | undefined;\n    /** What a Connect's new link or net takes its other fields from, by its kind's slot (§4.3, #1390). */\n    readonly connectValues: (slot: string) => option<Uint8Array>;\n    /** The drawing's extent's width, in world units: what a Move is held inside. */\n    readonly W: number;\n    /** The drawing's extent's height, in world units. */\n    readonly H: number;\n    /** The canvas's element: what a key the frame or the window hears is the canvas's by. */\n    readonly canvasRef: RefObject<HTMLDivElement | null>;\n    /** Each entity's reference by its id on the canvas. */\n    readonly refById: ReadonlyMap<string, SchematicRef>;\n    /** Each item's label by its id: what a refusal's words name it by. */\n    readonly labelById: ReadonlyMap<string, string>;\n    /** What never selects, by any path: a locked layer's entities, and what the narrowing takes out (SC27, #1392). */\n    readonly inertKeys: ReadonlySet<string>;\n    /** What the narrowing takes out of every list and of the selection, its context among it (#1392). */\n    readonly narrowedOut: ReadonlySet<string>;\n    /** The zones drawn, a hidden layer's left out: what a tap selects a zone among. */\n    readonly shownZones: readonly DrawnZone[];\n    /** What is selected that the drawing doesn't draw and still stands: Del deletes its items with the rest (#1393). */\n    readonly standing: SchematicStanding;\n    /** The items in view: what a tap finds an item among. */\n    readonly visibleItems: readonly DrawnItem[];\n    /** What each item in view draws as at the zoom. */\n    readonly tiers: ReadonlyMap<string, LodTier>;\n    /** The tier the zoom's band draws its items at. */\n    readonly lod: LodTier;\n    /** The items drawn, by their boxes: what the marquee sweeps. */\n    readonly index: RBush<ItemBox>;\n    /** Each item drawn, by its id: what a link's end is worked out over (#1403). */\n    readonly itemById: ReadonlyMap<string, DrawnItem>;\n    /** The links' lanes, as the painter fans them (#180). */\n    readonly lanes: ReadonlyMap<string, { i: number; n: number }>;\n    /** The links' R-tree: what a hover, a tap and a drop search for the link or the net under a point (#1403). */\n    readonly linkTree: LinkIndex;\n    /** Each link drawn, by its id. */\n    readonly linkById: ReadonlyMap<string, DrawnLink>;\n    /** Each net drawn, by its id. */\n    readonly netById: ReadonlyMap<string, DrawnNet>;\n    /** Whether a library card is dragged: nothing lights under the pointer meanwhile. */\n    readonly dragging: boolean;\n    /** What is selected, and its funnels (`use-canvas-selection.ts`). */\n    readonly canvasSelection: CanvasSelection;\n    /** The zones' clear and the steps (`use-canvas-selection.ts`). */\n    readonly selectionSteps: SelectionSteps;\n    /** The camera (`use-camera.ts`). */\n    readonly camera: Camera;\n    /** What moves the camera (`use-camera.ts`). */\n    readonly cameraMoves: CameraMoves;\n    /** The commit-phase snapshot and the painter's apply (`use-paint.ts`). */\n    readonly paint: Paint;\n    /** The gestures' state ({@link useGestureState}'s). */\n    readonly gestureState: GestureState;\n}\n\n/**\n * The gestures' handlers (see the module docs).\n *\n * @param props - The payload and what the canvas draws, the tool and how the canvas records and tells, the drawing's\n *   extent and what the hit-tests search, what is selected and its funnels, the camera and what moves it, the snapshot,\n *   and the gestures' state\n * @returns Whether the pointer is over the canvas, the canvas's keys, the hit-tests of an item, a zone and a link or a\n *   net under a point, the pointer handlers the canvas's element carries (`surface`), and the double-click's\n */\nexport function useGestures({\n    value, data, layers, tool, linkKind, words, editing, onRefused, onOpen, connectValues, W, H, canvasRef, refById, labelById, inertKeys, narrowedOut,\n    shownZones, standing, visibleItems, tiers, lod, index, itemById, lanes, linkTree, linkById, netById, dragging, canvasSelection, selectionSteps, camera,\n    cameraMoves, paint, gestureState,\n}: GesturesProps) {\n    const { commitSelection, clearSelection, commitLinkSelection, commitZoneSelection } = canvasSelection;\n    const { clearZoneSelection, stepSelection } = selectionSteps;\n    const { cameraRef } = camera;\n    const { drawPending, transition, requestRender, flyTo, resetView } = cameraMoves;\n    const { renderSnapRef, applyCamera, drawRef, cardSizesRef, placeholdersRef } = paint;\n    const { kinds, movableKinds, setLit, setDragMoves, setTempTool, setConnectDraft, connectFlashRef, flashRafRef, setBoxDrag } = gestureState;\n    // Connection veto (#176, #1401 D34): gates the connect GESTURE itself — the\n    // one channel behind pairwise links, every Shift-session extension (nets),\n    // and endpoint re-targets — so all three obey the same rule, as the\n    // inspector's Connect to…, ends and sides do (#1394). It hears the\n    // gesture's candidate: the link or net kind it writes and its two items;\n    // `none` allows it, and words refuse it, which the draft shows (#1388).\n    // Verdicts cache per (kind, from, to) (`edits.ts`' `connectVeto`), afresh\n    // when the fn or the drawing's entities change, so the pointermove probe\n    // never re-runs the East function for the same candidate; a THROWING veto\n    // logs and ALLOWS (fail-open) so a broken function cannot brick editing.\n    const canConnectFn = useMemo(() => getSomeorUndefined(value.canConnect), [value.canConnect]);\n    /** The veto's words for a candidate, or `undefined` when it allows it. */\n    const connectRefusal = useMemo(() => connectVeto(canConnectFn, (id) => refById.get(id)), [canConnectFn, refById]);\n    const hoveredRef = useRef(false);\n    // Live screen-space selection box (px, relative to the canvas host) while a\n    // box-drag is in flight; drives the dashed overlay and the release action.\n    // `mode` distinguishes a zoom-box from a marquee; `additive` latches Shift at\n    // pointer-down (marquee unions rather than replaces).\n    // Connect-tool gesture (#176): the live drag (pointer-capture scoped) and its\n    // render state (the draft edge painted on the canvas). A SESSION (Shift) keeps\n    // the links its drags drew — or the selected link it was seeded with — and\n    // the net they grew into (`edits.ts`' `ConnectSession`), each read from the\n    // drawing as it stands when the next drag lands.\n    const connectDragRef = useRef<ConnectDrag | null>(null);\n    // A press on an editable selected link's end handle (SC10): a tap until it moves past the drag threshold, when it\n    // becomes the re-target drag — so a tap there selects what is under it, as any tap does. Its link, the end it would\n    // move, the end that stays, and where it was pressed.\n    const handlePressRef = useRef<{ key: string; movingEnd: \"from\" | \"to\"; fixed: string; x: number; y: number } | null>(null);\n    // Move-tool drag (#179): the pressed key, the items moving (a group move rides\n    // the selection) where the drag found them, the world start point of the\n    // gesture, and the delta it has them at, clamped to the extent (SC8).\n    const moveDragRef = useRef<{ key: string; movers: readonly (Mover & { readonly id: string })[]; startWorld: Pt; delta: { dx: number; dy: number } } | null>(null);\n    const linkSessionRef = useRef<ConnectSession | undefined>(undefined);\n    // The session's links' ends and its net's sides, as the drawing holds them now: Undo, Redo or another gesture\n    // between two of its drags is the session's too.\n    const sessionDrawn = useMemo((): SessionDrawn => {\n        const links = new Map(data.links.map((link) => [link.key, link] as const));\n        const nets = new Map(data.nets.map((net) => [net.key, net] as const));\n        const refs = (ids: readonly string[]) => ids.flatMap((id) => { const ref = refOfId(id); return ref === undefined ? [] : [ref]; });\n        return {\n            ends: (ref) => {\n                const link = links.get(entityId(ref));\n                const from = link === undefined ? undefined : refOfId(link.from);\n                const to = link === undefined ? undefined : refOfId(link.to);\n                return from === undefined || to === undefined ? undefined : { from, to };\n            },\n            sides: (ref) => {\n                const net = nets.get(entityId(ref));\n                return net === undefined ? undefined : { sources: refs(net.sources), destinations: refs(net.destinations) };\n            },\n        };\n    }, [data.links, data.nets]);\n    // An item a gesture names: its reference, and its label for a refusal's words.\n    const itemOf = useCallback((id: string) => {\n        const ref = refById.get(id);\n        return ref === undefined ? undefined : { ref, label: labelById.get(id) ?? ref.key };\n    }, [refById, labelById]);\n    /** A refusal's words. */\n    const refusalWords = useCallback((refusal: EditRefusal): string => {\n        switch (refusal.why) {\n            case \"end\": return words.m.endRefused({ kind: refusal.kind, end: refusal.end, item: refusal.item });\n            case \"named\": return words.m.deleteRefused({ item: refusal.item, kind: refusal.kind, key: refusal.key });\n            case \"placeholder\": return words.m.placeholderRefused({ kind: refusal.kind.toLocaleLowerCase(words.locale) });\n        }\n    }, [words]);\n    /** A connect drag onto a target, as the edits read it: the open session, Shift, the Connect tool's kind and its items. */\n    const dragArgs = useCallback((cd: Pick<ConnectDrag, \"from\" | \"additive\">, target: string): ConnectDragArgs | undefined => {\n        const from = itemOf(cd.from), to = itemOf(target);\n        if (from === undefined || to === undefined) return undefined;\n        return {\n            session: linkSessionRef.current, shift: cd.additive, linkKind, from, to, drawn: sessionDrawn,\n            labelOf: (ref) => labelById.get(entityId(ref)) ?? ref.key,\n        };\n    }, [itemOf, linkKind, sessionDrawn, labelById]);\n    // Why a connect drag can't land on a target (SC9, #1401 D34): the end of its\n    // kind that holds no item of the target's slot, or a target held under a\n    // placeholder, its key still to be typed (#1549), else the veto's words of a\n    // pair the drag newly joins. A re-target writes its link, vetted in the\n    // link's REAL direction — the fixed end may be either side; an Extend its net,\n    // each source with the item it adds, whichever member the drag began at; a\n    // Shift session the net it grows into, when a net kind holds its items —\n    // every pair the net newly joins, each run it gathers among them; any other\n    // drag a link of the Connect tool's kind. `undefined` when it may land.\n    const candidateRefusal = useCallback((cd: ConnectDrag, target: string): string | undefined => {\n        const fixed = itemOf(cd.from), moving = itemOf(target);\n        if (fixed === undefined || moving === undefined) return undefined;\n        if (cd.retarget !== undefined) {\n            const slot = refById.get(cd.retarget.key)?.kind;\n            const link = slot === undefined ? undefined : kinds.links.get(slot);\n            if (slot === undefined || link === undefined) return undefined;\n            const toFrom = cd.retarget.movingEnd === \"from\";\n            const refusal = placeholderRefusal(kinds, moving) ?? (toFrom ? linkRefusal(link, moving, fixed) : linkRefusal(link, fixed, moving));\n            if (refusal !== undefined) return refusalWords(refusal);\n            return toFrom ? connectRefusal(slot, target, cd.from) : connectRefusal(slot, cd.from, target);\n        }\n        if (cd.netExtend !== undefined) {\n            const net = netById.get(cd.netExtend);\n            const kind = net === undefined ? undefined : kinds.nets.get(net.ref.kind);\n            const sides = net === undefined ? undefined : sessionDrawn.sides(net.ref);\n            if (net === undefined || kind === undefined || sides === undefined) return undefined;\n            if (!stringEqual(moving.ref.kind, kind.destinations)) return refusalWords({ why: \"end\", kind: kind.name, end: \"end\", item: moving.label });\n            const waiting = placeholderRefusal(kinds, moving);\n            if (waiting !== undefined) return refusalWords(waiting);\n            return vetoOfPairs(connectRefusal, net.ref.kind, extendPairs(sides, moving.ref));\n        }\n        const args = dragArgs(cd, target);\n        if (args === undefined) return undefined;\n        const candidate = connectCandidate(kinds, args);\n        if (candidate.refusal !== undefined) return refusalWords(candidate.refusal);\n        return candidate.kind === undefined ? undefined : vetoOfPairs(connectRefusal, candidate.kind, candidate.pairs);\n    }, [itemOf, refById, kinds, refusalWords, connectRefusal, dragArgs, netById, sessionDrawn]);\n    const selStartRef = useRef<{ sx: number; sy: number; mode: \"zoom\" | \"marquee\"; additive: boolean } | null>(null);\n    // Marquee-hit recompute coalescing (#183 WS6): the box rect tracks every\n    // pointermove; the HITS (r-tree + footprint tests) recompute at most once\n    // per animation frame from the latest rect. Display-only — pointerup\n    // recomputes at commit, so a pending frame can never skew the selection.\n    const marqueeRafRef = useRef<number | null>(null);\n    const marqueeRegionRef = useRef<{ x0: number; y0: number; sw: number; sh: number } | null>(null);\n    useEffect(() => () => {\n        if (marqueeRafRef.current !== null) cancelAnimationFrame(marqueeRafRef.current);\n    }, []);\n\n    // The innermost selectable zone under a screen point: OUTLINE zones only\n    // (hatch bands are annotations, mirroring the Index's host contract), honouring\n    // explicit circle / polygon geometry, skipping locked-layer zones; smallest\n    // containing zone wins so nested cages select before their hall. `accept`\n    // narrows it to the zones a drop's card lands on (#1390).\n    const zoneKeyAt = useCallback((host: HTMLElement, clientX: number, clientY: number, accept?: (id: string) => boolean): string | undefined => {\n        const snap = renderSnapRef.current;\n        if (snap.size === null) return undefined;\n        const cam = cameraRef.current;\n        const ppuLive = snap.fit * cam.zoom;\n        if (ppuLive === 0) return undefined;\n        const rect = host.getBoundingClientRect();\n        const wxp = (clientX - rect.left - cam.tx) / ppuLive, wyp = (clientY - rect.top - cam.ty) / ppuLive;\n        let best: DrawnZone | undefined;\n        let bestArea = Infinity;\n        for (const z of shownZones) {\n            if (z.pattern.type !== \"outline\") continue;\n            if (inertKeys.has(z.key)) continue;\n            if (accept !== undefined && !accept(z.key)) continue;\n            const geom = getSomeorUndefined(z.geometry);\n            // Its geometry is drawn about its box's centre (D22).\n            const anchor = zoneAnchor(z);\n            let hit: boolean;\n            if (geom !== undefined && geom.type === \"circle\") {\n                hit = Math.hypot(wxp - anchor.x, wyp - anchor.y) <= geom.value.radius;\n            } else if (geom !== undefined && geom.type === \"polygon\") {\n                hit = pointInPolygon(wxp - anchor.x, wyp - anchor.y, geom.value.vertices);\n            } else if (geom !== undefined && geom.type === \"polyline\") {\n                continue;   // an open band is not a container\n            } else {\n                hit = wxp >= z.x && wxp <= z.x + z.width && wyp >= z.y && wyp <= z.y + z.height;\n            }\n            if (!hit) continue;\n            const area = z.width * z.height;\n            if (area < bestArea) { best = z; bestArea = area; }\n        }\n        return best?.key;\n    }, [shownZones, inertKeys, renderSnapRef, cameraRef]);\n    // A link's or a net's drawing as the painter draws it, worked out over a camera (#1403): its runs from the edges of\n    // the items it joins where they draw at the zoom — a card's side as the page lays it out, a pin's edge, a dot's rim\n    // — its heads, and a link's handles. What a tap, a hover, a drop and a selected link's handles meet: hit-testing is\n    // the drawing (invariant 9). A pin's label is measured in the painter's font, its letters unjoined as the painter\n    // draws them (`textRendering`, `unjoined`), else reckoned at 6px a letter.\n    const routesAt = useCallback((cam: { ppu: number; tx: number; ty: number }) => {\n        const snap = renderSnapRef.current;\n        const ctx = drawRef.current?.getContext(\"2d\") ?? null;\n        const labelFont = snap.palette?.labelFont;\n        const measure = (text: string): number => {\n            if (ctx === null || labelFont === undefined) return text.length * 6;\n            ctx.save();\n            ctx.font = labelFont;\n            ctx.textRendering = \"optimizeSpeed\";\n            const w = ctx.measureText(unjoined(text)).width;\n            ctx.restore();\n            return w;\n        };\n        const env = routeEnv({ cam, centers: snap.centers, items: itemById, tiers: snap.tiers, cardSizes: cardSizesRef.current, lanes, measure });\n        return (id: string): EdgeGeometry | undefined => {\n            const link = linkById.get(id);\n            if (link !== undefined) return linkRoutes(link, env);\n            const net = netById.get(id);\n            return net === undefined ? undefined : netRoutes(net, env);\n        };\n    }, [itemById, lanes, linkById, netById, renderSnapRef, drawRef, cardSizesRef]);\n    // The link or the net under a screen point (#176, #1403), and a net's leg: of those the links' R-tree holds near it,\n    // the nearest whose drawn route it lies within the weight and the hit reach of — a net's trunk and bars the whole\n    // net, a stub its leg. `accept` narrows it to the links and nets a drop's card lands on (#1390).\n    const linkKeyAt = useCallback((host: HTMLElement, clientX: number, clientY: number, accept?: (id: string) => boolean): { key: string; leg: NetLeg | null } | undefined => {\n        const snap = renderSnapRef.current;\n        if (snap.size === null) return undefined;\n        const cam = cameraRef.current;\n        const ppuLive = snap.fit * cam.zoom;\n        if (ppuLive === 0) return undefined;\n        const rect = host.getBoundingClientRect();\n        const sx = clientX - rect.left, sy = clientY - rect.top;\n        return linkAt(linkTree, routesAt({ ppu: ppuLive, tx: cam.tx, ty: cam.ty }), { x: (sx - cam.tx) / ppuLive, y: (sy - cam.ty) / ppuLive }, { x: sx, y: sy }, ppuLive,\n            // A locked layer's, and what the narrowing takes out, take no point; nor a net's leg to an item drawn as context (#1392).\n            (id, leg) => !inertKeys.has(id) && (accept === undefined || accept(id)) && (leg === null || !narrowedOut.has(leg.item)));\n    }, [linkTree, routesAt, inertKeys, narrowedOut, renderSnapRef, cameraRef]);\n    // Click-select a link or a net — selection works read-only (inspection\n    // channel); the host hears it in the whole selection, named by its kind and key.\n    // A plain tap selects it alone, letting go of the items and the zones (D16, #1391); Shift adds it to them.\n    const selectLink = useCallback((key: string, leg: NetLeg | null = null, additive = false) => {\n        if (!additive) {\n            commitSelection(EMPTY_STRING_SET);\n            clearZoneSelection();\n        }\n        commitLinkSelection({ key, leg });\n    }, [commitLinkSelection, commitSelection, clearZoneSelection]);\n\n    // A canvas tap on a zone body (items always take precedence): a plain tap\n    // selects the zone alone, letting go of the items and the link or net (D16,\n    // #1391); Shift toggles/extends — mirroring the item tap semantics. A tap\n    // selects in place: Find, the Index and the arrow keys fly.\n    const zoneTap = useCallback((key: string, additive: boolean) => {\n        let next: Set<string>;\n        if (additive) {\n            next = new Set(renderSnapRef.current.zoneSelection);\n            if (next.has(key)) next.delete(key); else next.add(key);\n        } else {\n            next = new Set([key]);\n            commitSelection(EMPTY_STRING_SET);\n            commitLinkSelection(null);\n        }\n        commitZoneSelection(next);\n    }, [commitZoneSelection, commitSelection, commitLinkSelection, renderSnapRef]);\n    // End the open connect session (Esc, tool switch, a plain new drag, or any other gesture).\n    const endLinkSession = useCallback(() => {\n        linkSessionRef.current = undefined;\n    }, []);\n    // ~450ms one-shot flash driving repaints via the same identity-checked apply.\n    const startConnectFlash = useCallback(() => {\n        if (flashRafRef.current !== null) cancelAnimationFrame(flashRafRef.current);\n        const tick = () => {\n            const cf = connectFlashRef.current;\n            if (cf === null) { flashRafRef.current = null; return; }\n            applyCamera();\n            if (performance.now() - cf.t0 >= 450) {\n                connectFlashRef.current = null;\n                flashRafRef.current = null;\n                applyCamera();\n                return;\n            }\n            flashRafRef.current = requestAnimationFrame(tick);\n        };\n        flashRafRef.current = requestAnimationFrame(tick);\n    }, [applyCamera, flashRafRef, connectFlashRef]);\n    useEffect(() => () => { if (flashRafRef.current !== null) cancelAnimationFrame(flashRafRef.current); }, [flashRafRef]);\n    /**\n     * Records one gesture's edits as one step of the editing's history (#1388),\n     * labelled for it; one recorded says no refusal any more.\n     *\n     * @returns The rows it moved under the keys their fields build (#1549); `undefined` where nothing was recorded\n     */\n    const recordStep = useCallback((edits: readonly SchematicEdit[], origin: Origin, step: SchematicStep, name: string, n: number): readonly SchematicMove[] | undefined => {\n        if (editing === undefined || edits.length === 0) return undefined;\n        const moved = editing.record(edits, origin, words.m.step({ step, name: name.toLocaleLowerCase(words.locale), n }));\n        if (moved !== undefined) onRefused(undefined);\n        return moved;\n    }, [editing, words, onRefused]);\n    // Commit a connect gesture (SC9): a link of the Connect tool's kind — or,\n    // Shift held in an open session, the net the session grows into, absorbing\n    // its links — each new row keyed as its kind makes one (#1549), its other\n    // fields the template of its kind the library has selected (§4.3), one\n    // step; then the flash. A key its kind refuses records nothing, the footer\n    // saying why. The session follows its net under the key its sides move it\n    // to, so the next Shift-drag grows it there.\n    const commitConnect = useCallback((from: string, to: string, shift: boolean) => {\n        if (editing === undefined) return;\n        const args = dragArgs({ from, additive: shift }, to);\n        if (args === undefined) return;\n        const step = connectStep(kinds, args, (made) => editing.newKey(made), connectValues);\n        if (step === undefined) return;\n        if (\"refused\" in step) {\n            editing.keyRefused(step.refused);\n            return;\n        }\n        const grown = step.edits.find((edit) => edit.op === \"net\" || edit.op === \"sides\");\n        const slot = (grown ?? step.edits.find((edit) => edit.op === \"link\"))?.ref.kind;\n        if (slot === undefined) return;\n        const name = (grown !== undefined ? kinds.nets.get(slot)?.name : kinds.links.get(slot)?.name) ?? slot;\n        const moved = recordStep(step.edits, \"insert\", grown !== undefined ? \"net\" : \"connect\", name, 1);\n        if (moved === undefined) return;\n        linkSessionRef.current = followSession(step.session, moved);\n        connectFlashRef.current = { from, to, t0: performance.now() };\n        startConnectFlash();\n    }, [editing, dragArgs, kinds, recordStep, startConnectFlash, connectValues, connectFlashRef]);\n    // Re-target a selected link's end (connector-handle drag, SC10): the end it\n    // moves written, one step.\n    const commitRetarget = useCallback((key: string, movingEnd: \"from\" | \"to\", target: string) => {\n        const link = data.links.find(l => stringEqual(l.key, key));\n        const from = link === undefined ? undefined : refOfId(link.from);\n        const to = link === undefined ? undefined : refOfId(link.to);\n        const onto = refById.get(target);\n        if (link === undefined || from === undefined || to === undefined || onto === undefined) return;\n        const edits = retargetEdits({ ref: link.ref, ends: { from, to } }, movingEnd, onto);\n        if (recordStep(edits, \"move\", \"retarget\", kinds.links.get(link.ref.kind)?.name ?? link.ref.kind, 1) === undefined) return;\n        endLinkSession();\n        connectFlashRef.current = { from: movingEnd === \"from\" ? target : link.from, to: movingEnd === \"to\" ? target : link.to, t0: performance.now() };\n        startConnectFlash();\n    }, [data.links, refById, kinds, recordStep, endLinkSession, startConnectFlash, connectFlashRef]);\n    // Extend a selected NET by one member (Shift-drag out of a member, SC10):\n    // the dragged-to item joins its destinations, one step.\n    const commitNetExtend = useCallback((netKey: string, from: string, to: string) => {\n        const net = data.nets.find(n => stringEqual(n.key, netKey));\n        const onto = refById.get(to);\n        if (net === undefined || onto === undefined) return;\n        if (!net.sources.some((id) => stringEqual(id, from)) && !net.destinations.some((id) => stringEqual(id, from))) return;\n        const sides = sessionDrawn.sides(net.ref);\n        if (sides === undefined) return;\n        const edits = extendEdits({ ref: net.ref, sides }, onto);\n        if (recordStep(edits, \"insert\", \"extend\", kinds.nets.get(net.ref.kind)?.name ?? net.ref.kind, 1) === undefined) return;\n        endLinkSession();\n        connectFlashRef.current = { from, to, t0: performance.now() };\n        startConnectFlash();\n    }, [data.nets, refById, sessionDrawn, kinds, recordStep, endLinkSession, startConnectFlash, connectFlashRef]);\n    // Delete what is selected (Del / Backspace, SC5, SC10, D7): the selected link\n    // or net, or a net leg's item off its side, and the selected items with every\n    // link and net leg naming one — one step; refused, in its words, where a link\n    // or a net bound read only names an item it would delete.\n    const deleteSelection = useCallback((): boolean => {\n        if (editing === undefined) return false;\n        const snap = renderSnapRef.current;\n        const selection = { items: snap.selection.selected, link: snap.selectedLink };\n        if (selection.items.size === 0 && selection.link === null) return false;\n        // The items standing off the drawing go with the rest: rows of kinds read by area off their windows (#1393).\n        const off = [...standing.items.values()].flatMap((item) => (item === undefined ? [] : [item]));\n        const result = deleteEdits(kinds, off.length === 0 ? data : { ...data, items: [...data.items, ...off] }, selection);\n        if (\"refusal\" in result) {\n            onRefused(refusalWords(result.refusal));\n            return true;\n        }\n        if (recordStep(result.edits, \"remove\", \"delete\", \"\", result.edits.length) === undefined) return false;\n        endLinkSession();\n        return true;\n    }, [editing, kinds, data, standing, onRefused, refusalWords, recordStep, endLinkSession, renderSnapRef]);\n\n    // Keyboard traversal (#183 WS7): with the canvas focused, arrows step the\n    // selection through the deterministic item order (the toolbar's steps'\n    // exact path — fly + select), and Del deletes it (#1388). Enter opens the\n    // selection in the inspector's Details, with the inspector (#1391). Each\n    // key it acts on goes no further than the Schematic (#1398). Esc / Space /\n    // Ctrl are the hovered keys' (`hoverKey`), which hear Del too while the\n    // pointer is over the canvas.\n    const onCanvasKeyDown = useCallback((e: React.KeyboardEvent) => {\n        if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") { takeKey(e); stepSelection(1); }\n        else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") { takeKey(e); stepSelection(-1); }\n        // Del deletes what is selected, as one step (#1388, SC5).\n        else if ((e.key === \"Delete\" || e.key === \"Backspace\") && deleteSelection()) takeKey(e);\n        // Enter opens what is selected in Details (#1391, D34): something must be.\n        else if (e.key === \"Enter\" && onOpen !== undefined) {\n            const snap = renderSnapRef.current;\n            if (snap.selection.selected.size > 0 || snap.zoneSelection.size > 0 || snap.selectedLink !== null) {\n                takeKey(e);\n                onOpen();\n            }\n        }\n    }, [stepSelection, deleteSelection, onOpen, renderSnapRef]);\n\n    // Drag-pan + tap-to-pick on the canvas. The pick runs on the press's RELEASE,\n    // not the `click` event: the canvas captures the pointer of every press it\n    // takes (`useSurfaceGestures`), and a captured pointer's click is delivered\n    // to the capturing box — not the inner <canvas> — so a click handler there\n    // never fires for a marker / footprint tap (issue #57, P11). `moved`\n    // distinguishes a pan from a tap.\n    const panRef = useRef<{ x: number; y: number; tx: number; ty: number } | null>(null);\n    // The pinch under way (#353, invariant 33): the zoom it began at, and how far past a limit of the zoom its fingers\n    // stand (`pinchAbout`'s `over`), so a limit is no ratchet; `null` while none is. A pinch in from a closer zoom that\n    // ends at the least zoom is a full zoom out, and lands on Fit's camera as it ends (invariant 23).\n    const pinchRef = useRef<{ readonly from: number; over: number } | null>(null);\n    const movedRef = useRef(false);\n    // End an in-progress canvas drag-pan (panning → idle). Returns whether a pan\n    // was active; never disturbs a running fly.\n    const endPan = useCallback(() => {\n        if (panRef.current === null) return false;\n        panRef.current = null;\n        transition(\"pointerUp\");\n        return true;\n    }, [transition]);\n\n    // The order the markers not drawn as cards paint in, as the last commit drew them (`paint.ts`' `planMarkers`): what\n    // a tap where markers overlap picks the one drawn on top by (invariant 9). Made again only as a commit or the reveal\n    // moves it — never as the camera moves, which moves no marker over another.\n    const markerPlanRef = useRef<{ readonly snap: unknown; readonly placeholders: boolean; readonly plan: MarkerPlan } | null>(null);\n    const markerPlan = useCallback((): MarkerPlan | undefined => {\n        const snap = renderSnapRef.current;\n        if (snap.palette === null) return undefined;\n        const placeholders = placeholdersRef.current;\n        const was = markerPlanRef.current;\n        if (was !== null && Object.is(was.snap, snap) && was.placeholders === placeholders) return was.plan;\n        const plan = planMarkers({\n            visibleItems: snap.visibleItems, tiers: snap.tiers, selected: snap.renderSelected, tints: snap.tints, layerAlpha: snap.layerAlpha,\n            placeholders, colours: THEME_COLOURS, cam: { ppu: 1, tx: 0, ty: 0 }, palette: snap.palette,\n            ...(snap.dropMark !== undefined ? { dropMark: snap.dropMark } : {}),\n            ...(snap.paintEffect !== undefined ? { effect: { ...snap.paintEffect, pulsePhase: 0 } } : {}),\n        });\n        markerPlanRef.current = { snap, placeholders, plan };\n        return plan;\n    }, [renderSnapRef, placeholdersRef]);\n\n    // Pick the item under a tap. Card-tier hits take precedence over markers\n    // (rich cards / footprints are the primary affordance): (1) the footprint\n    // shape's exact painted geometry, then (2) the real DOM card under the\n    // pointer, then (3) the dot/label markers: where the point lies on the drawn\n    // shapes of several, the one drawn on top (invariant 9, \"Legible dots\"),\n    // else the nearest against its FULL rendered extent (P11). Reads the LIVE\n    // camera so a tap maps to what was painted (invariant 4). Returns whether\n    // anything was selected. `accept` narrows it to the items a drop's card\n    // lands on (#1390).\n    const itemKeyAt = useCallback((host: HTMLElement, clientX: number, clientY: number, accept?: (id: string) => boolean): string | undefined => {\n        const sz = renderSnapRef.current.size;\n        if (sz === null) return undefined;\n        const cam = cameraRef.current;\n        const ppuLive = renderSnapRef.current.fit * cam.zoom;\n        if (ppuLive === 0) return undefined;\n        const rect = host.getBoundingClientRect();\n        const sx = clientX - rect.left, sy = clientY - rect.top;\n        const wxp = (sx - cam.tx) / ppuLive, wyp = (sy - cam.ty) / ppuLive;\n        // 1) footprint shape (the exact world-space geometry the painter drew).\n        // Items in a locked layer, and the narrowing's context, are non-interactive — the pick falls through them.\n        for (const it of visibleItems) {\n            if (inertKeys.has(it.key)) continue;\n            if (accept !== undefined && !accept(it.key)) continue;\n            if ((tiers.get(it.key) ?? lod) !== \"card\") continue;\n            const fp = getSomeorUndefined(it.footprint);\n            if (fp === undefined || fp.type === \"rect\") continue;\n            // Its footprint is drawn about its centre (D22).\n            const hit = fp.type === \"circle\"\n                ? Math.hypot(wxp - it.x, wyp - it.y) <= fp.value.radius\n                : pointInPolygon(wxp - it.x, wyp - it.y, fp.value.vertices);\n            if (hit) return it.key;\n        }\n        // 2) the real DOM card under the pointer — hit-test the actual rendered\n        // element (pixel-accurate), not an estimate of its box. (Locked cards\n        // take no pointer, so elementFromPoint already skips them; the\n        // guard is belt-and-suspenders.)\n        if (typeof document !== \"undefined\") {\n            const cardKey = document.elementFromPoint(clientX, clientY)\n                ?.closest(\"[data-card-key]\")?.getAttribute(\"data-card-key\");\n            if (cardKey !== null && cardKey !== undefined && !inertKeys.has(cardKey) && (accept === undefined || accept(cardKey))) return cardKey;\n        }\n        // 3) dot / label markers: where the point lies on the drawn shapes of several — a dot's colour and its ring, a pin's\n        // pill — the one the painter draws on top of them (invariant 9): packed dots overlap by the severity of the colour\n        // each is drawn in, a pin over the dots and what is selected over all. Else the nearest hit against the full\n        // rendered extent, its touch slop among it (P11).\n        const ctx = drawRef.current?.getContext(\"2d\") ?? null;\n        const labelFont = renderSnapRef.current.palette?.labelFont;\n        // Measure label widths with the painter's font, its letters unjoined as the\n        // painter draws them, so the hitbox matches the drawn pill; save/restore so\n        // the pick never leaks font state.\n        const measuring = ctx !== null && labelFont !== undefined;\n        if (measuring) { ctx.save(); ctx.font = labelFont; ctx.textRendering = \"optimizeSpeed\"; }\n        const camScreen = { ppu: ppuLive, tx: cam.tx, ty: cam.ty };\n        let best: DrawnItem | null = null, bestD = Infinity;\n        const drawnUnder = new Set<string>();\n        for (const it of visibleItems) {\n            if (inertKeys.has(it.key)) continue;\n            if (accept !== undefined && !accept(it.key)) continue;\n            const tier = tiers.get(it.key) ?? lod;\n            if (tier === \"card\") continue;\n            const box = markerHitbox(it, tier, camScreen, t => measuring ? ctx.measureText(unjoined(t)).width : t.length * 6);\n            if (!markerHit(box, sx, sy)) continue;\n            const d = Math.hypot(it.x * ppuLive + cam.tx - sx, it.y * ppuLive + cam.ty - sy);\n            if (d < bestD) { best = it; bestD = d; }\n            // On what it draws: a pin's pill is its hitbox; a dot's shape its colour and its ring, inside its slop.\n            if (box.kind === \"rect\" || d <= dotDrawnRadius(it)) drawnUnder.add(it.key);\n        }\n        if (measuring) ctx.restore();\n        if (drawnUnder.size > 1) {\n            const plan = markerPlan();\n            const top = plan === undefined ? undefined : topMarker(plan, drawnUnder);\n            if (top !== undefined) return top;\n        }\n        return best?.key;\n    }, [tiers, lod, visibleItems, inertKeys, renderSnapRef, cameraRef, drawRef, markerPlan]);\n    const pickAt = useCallback((host: HTMLElement, clientX: number, clientY: number, additive: boolean): boolean => {\n        const key = itemKeyAt(host, clientX, clientY);\n        if (key === undefined) return false;\n        // A plain tap replaces the selection; a Shift+tap toggles the item (extends the set).\n        const shiftAdd = additive;\n        let next: Set<string>;\n        if (shiftAdd) {\n            next = new Set(renderSnapRef.current.selection.selected);\n            if (next.has(key)) next.delete(key); else next.add(key);\n        } else {\n            next = new Set([key]);\n        }\n        // A tap selects in place: Find, the Index and the arrow keys fly (D34). A plain tap selects the item alone,\n        // letting go of the zones and the link or net (D16, #1391).\n        commitSelection(next, { anchor: key });\n        if (!shiftAdd) {\n            clearZoneSelection();\n            commitLinkSelection(null);\n        }\n        return true;\n    }, [itemKeyAt, commitSelection, clearZoneSelection, commitLinkSelection, renderSnapRef]);\n    // A tap on a density raster's cell that holds rows (#1393, D25, SC36): the view it zooms into — about the tap, shaped\n    // as the canvas is, halved until the density counts no more rows in it than draw, with room for the fly's own margin\n    // — so the rows draw there, from whatever zoom the tap was made at; never past the zoom's limit. `undefined` off the\n    // density.\n    const densityTap = useCallback((host: HTMLElement, clientX: number, clientY: number): { x: number; y: number; w: number; h: number } | undefined => {\n        const snap = renderSnapRef.current;\n        if (snap.density.size === 0 || snap.size === null) return undefined;\n        const cam = cameraRef.current;\n        const ppuLive = snap.fit * cam.zoom;\n        if (ppuLive === 0) return undefined;\n        const rect = host.getBoundingClientRect();\n        const x = (clientX - rect.left - cam.tx) / ppuLive, y = (clientY - rect.top - cam.ty) / ppuLive;\n        const rasters = [...snap.density.values()];\n        const onCell = rasters.some((raster) => raster.cells.some((cell) =>\n            cell.count > 0 && x >= cell.minX && x < cell.minX + raster.side && y >= cell.minY && y < cell.minY + raster.side));\n        if (!onCell) return undefined;\n        const extent = { minX: 0, minY: 0, maxX: W, maxY: H };\n        // The narrowest view the zoom reaches, in world units.\n        const least = snap.size.w / (snap.fit * snap.maxZoom);\n        let w = snap.size.w / ppuLive, h = snap.size.h / ppuLive;\n        for (;;) {\n            w /= 2;\n            h /= 2;\n            const box = { minX: x - w / 2, minY: y - h / 2, maxX: x + w / 2, maxY: y + h / 2 };\n            const rows = rasters.reduce((n, raster) => n + densityInView(raster, box, extent).rows, 0);\n            if (rows <= DENSITY_TAP_ROWS || w <= least) return { x: box.minX, y: box.minY, w, h };\n        }\n    }, [W, H, renderSnapRef, cameraRef]);\n    // A tap selects what is under it (D16): an item, else a link's or a net's line (#176), else an outline zone's body\n    // (#177); a tap on nothing lets go of everything. Shift extends, and keeps what is selected on nothing. A tap on the\n    // density zooms in until its rows draw there (D25, SC36).\n    const tapAt = useCallback((host: HTMLElement, clientX: number, clientY: number, additive: boolean) => {\n        drawPending();\n        if (pickAt(host, clientX, clientY, additive)) return;\n        const dense = densityTap(host, clientX, clientY);\n        if (dense !== undefined) {\n            flyTo(dense);\n            return;\n        }\n        const lk = linkKeyAt(host, clientX, clientY);\n        if (lk !== undefined) { selectLink(lk.key, lk.leg, additive); return; }\n        const zk = zoneKeyAt(host, clientX, clientY);\n        if (zk !== undefined) zoneTap(zk, additive);\n        else if (!additive) { clearSelection(); clearZoneSelection(); commitLinkSelection(null); }\n    }, [drawPending, pickAt, densityTap, flyTo, linkKeyAt, selectLink, zoneKeyAt, zoneTap, clearSelection, clearZoneSelection, commitLinkSelection]);\n\n    // Collect the items a marquee region encloses — the pure rule lives in\n    // `selection.ts` (`marqueeHits`: R-tree sweep + CENTER-in-region test,\n    // skipping locked items and the narrowing's context; layer-hidden items are\n    // already absent from `index`, built over the post-filter working set).\n    const collectMarquee = useCallback((region: { minX: number; minY: number; maxX: number; maxY: number }): Set<string> =>\n        marqueeHits(index, region, layers.locked, narrowedOut),\n    [index, layers.locked, narrowedOut]);\n\n    // What the canvas's gestures do (`useSurfaceGestures`, east-ui-components' `src/pointer/`). Which pointer a gesture\n    // is, the fingers held and each way a gesture ends are that rule's (invariants 33, 34), told here as a press, its\n    // drags, and then its release or its being let go of — never both, and each once — and a pinch's start, steps and\n    // end. They read the commit-phase snapshot and the live refs, as every handler does (invariant 1).\n    /** A press: the gesture the tool in force begins where it lands. */\n    const press = (e: React.PointerEvent): void => {\n        // What the press hit-tests is what the canvas draws: a camera move waiting on its frame is drawn first.\n        drawPending();\n        // A press is a gesture: the link lit goes out until no button is held again (#1403).\n        setLit(undefined);\n        movedRef.current = false;\n        // Move tool (#179): a press ON AN ITEM of a kind bound with its patch door\n        // starts a reposition drag; when the pressed item is part of the selection\n        // the WHOLE selection's movable items move rigidly. An empty press falls\n        // through to a pan — as every press does while what is drawn is retained\n        // (#1398, CL8): no gesture edits it.\n        if (renderSnapRef.current.effectiveTool === \"move\" && !renderSnapRef.current.retained) {\n            const k = itemKeyAt(e.currentTarget as HTMLElement, e.clientX, e.clientY);\n            const movable = (key: string) => { const ref = refById.get(key); return ref !== undefined && movableKinds.has(ref.kind); };\n            if (k !== undefined && movable(k)) {\n                transition(\"cancel\");\n                const snap = renderSnapRef.current;\n                const cam = cameraRef.current;\n                const ppuLive = snap.fit * cam.zoom;\n                const r = (e.currentTarget as HTMLElement).getBoundingClientRect();\n                const wxp = ppuLive > 0 ? (e.clientX - r.left - cam.tx) / ppuLive : 0;\n                const wyp = ppuLive > 0 ? (e.clientY - r.top - cam.ty) / ppuLive : 0;\n                const keys = snap.selection.selected.has(k) ? [...snap.selection.selected].filter(movable) : [k];\n                // Each item moving, where the drag found it: drafted, the read's, as the canvas draws it.\n                const movers = keys.flatMap((id) => {\n                    const c = snap.centers.get(id), ref = refById.get(id);\n                    return c === undefined || ref === undefined ? [] : [{ id, ref, x: c.x, y: c.y }];\n                });\n                moveDragRef.current = { key: k, movers, startWorld: { x: wxp, y: wyp }, delta: { dx: 0, dy: 0 } };\n                return;\n            }\n        }\n        // Connector-handle grab (#176): with an editable selected link, a press\n        // within a handle's reach that moves past the drag threshold is a\n        // RE-TARGET drag (any tool) — the draft anchors at the FIXED end and\n        // follows the cursor; let go where it began, it is a tap (SC10). SHIFT\n        // skips the handle: Shift-drag from a selected link's endpoint SEEDS a\n        // net session instead (plain = retarget, Shift = extend).\n        if (!e.shiftKey && renderSnapRef.current.selectedLinkEditable && renderSnapRef.current.selectedLink !== null) {\n            const snap = renderSnapRef.current;\n            const lk2 = data.links.find(l => l.key === snap.selectedLink?.key);\n            const cam2 = cameraRef.current;\n            const ppu2 = snap.fit * cam2.zoom;\n            if (lk2 !== undefined && ppu2 > 0) {\n                const r2 = (e.currentTarget as HTMLElement).getBoundingClientRect();\n                const sx2 = e.clientX - r2.left, sy2 = e.clientY - r2.top;\n                // Its handles stand at its ends' edges, as the painter draws them (#1403).\n                const handles = routesAt({ ppu: ppu2, tx: cam2.tx, ty: cam2.ty })(lk2.key)?.handles;\n                const near = (q: Pt | undefined) => q !== undefined && Math.hypot(q.x - sx2, q.y - sy2) <= 10;\n                const movingEnd = near(handles?.from) ? \"from\" as const : near(handles?.to) ? \"to\" as const : undefined;\n                if (movingEnd !== undefined) {\n                    transition(\"cancel\");\n                    // A tap until it moves: its first move past the threshold starts the drag (`drag`).\n                    handlePressRef.current = { key: lk2.key, movingEnd, fixed: movingEnd === \"from\" ? lk2.to : lk2.from, x: e.clientX, y: e.clientY };\n                    return;\n                }\n            }\n        }\n        // Connect tool (#176): a press ON AN ITEM starts a connect drag (draft\n        // edge to the cursor); an empty press falls through to a pan, as every\n        // press does while what is drawn is retained (#1398, CL8).\n        if (renderSnapRef.current.effectiveTool === \"connect\" && !renderSnapRef.current.retained) {\n            const from = itemKeyAt(e.currentTarget as HTMLElement, e.clientX, e.clientY);\n            if (from !== undefined) {\n                // A non-Shift press starts a NEW proposal — the open session\n                // (and its dashed preview) ends now, not at commit.\n                if (!e.shiftKey && linkSessionRef.current !== undefined) endLinkSession();\n                transition(\"cancel\");\n                const r = (e.currentTarget as HTMLElement).getBoundingClientRect();\n                const cam = cameraRef.current;\n                const ppuLive = renderSnapRef.current.fit * cam.zoom;\n                const wxp = ppuLive > 0 ? (e.clientX - r.left - cam.tx) / ppuLive : 0;\n                const wyp = ppuLive > 0 ? (e.clientY - r.top - cam.ty) / ppuLive : 0;\n                connectDragRef.current = { from, additive: e.shiftKey };\n                // Shift-drag FROM the SELECTED thing extends it (#189 UX):\n                // a selected NET member drags a membership ADD (Extend); a\n                // selected link's endpoint SEEDS the session with that link,\n                // which the net it grows into absorbs — each only of a kind\n                // that writes.\n                if (e.shiftKey && linkSessionRef.current === undefined) {\n                    const selL = renderSnapRef.current.selectedLink;\n                    if (selL !== null && selL.leg === null) {\n                        const selNet = data.nets.find(n => stringEqual(n.key, selL.key));\n                        const member = selNet !== undefined && (selNet.sources.some((id) => stringEqual(id, from)) || selNet.destinations.some((id) => stringEqual(id, from)));\n                        if (selNet !== undefined && member && kinds.nets.get(selNet.ref.kind)?.editable === true) {\n                            connectDragRef.current = { from, additive: true, netExtend: selNet.key };\n                        } else {\n                            const selLink = data.links.find(l => stringEqual(l.key, selL.key));\n                            if (selLink !== undefined && (stringEqual(selLink.from, from) || stringEqual(selLink.to, from)) && kinds.links.get(selLink.ref.kind)?.editable === true) {\n                                linkSessionRef.current = { links: [selLink.ref], net: undefined };\n                            }\n                        }\n                    }\n                }\n                setConnectDraft({ from, toWorld: { x: wxp, y: wyp }, target: undefined });\n                return;\n            }\n        }\n        // Box tools (#153 zoom, #159 marquee): start a screen-space selection box\n        // instead of a pan. `mode` decides the release action; `additive` latches\n        // Shift now so a marquee unions rather than replaces.\n        if (renderSnapRef.current.isBoxTool) {\n            // Cancel any in-flight fly-to so the camera stops moving under the\n            // box (the select branch gets this for free via \"pointerDown\").\n            transition(\"cancel\");\n            const r = (e.currentTarget as HTMLElement).getBoundingClientRect();\n            const sx = e.clientX - r.left, sy = e.clientY - r.top;\n            const mode = renderSnapRef.current.effectiveTool === \"marquee\" ? \"marquee\" as const : \"zoom\" as const;\n            selStartRef.current = { sx, sy, mode, additive: e.shiftKey };\n            setBoxDrag({ rect: { x: sx, y: sy, w: 0, h: 0 }, mode, additive: e.shiftKey, hits: EMPTY_STRING_SET });\n            return;\n        }\n        // A background press is \"click away\" — an open connect session (and its\n        // dashed proposal) dismisses, like any pending-selection pattern.\n        if (linkSessionRef.current !== null) endLinkSession();\n        transition(\"pointerDown\");\n        panRef.current = { x: e.clientX, y: e.clientY, tx: cameraRef.current.tx, ty: cameraRef.current.ty };\n    };\n    /** The pressing pointer's move: what the gesture in flight draws. */\n    const drag = (e: React.PointerEvent): void => {\n        // Move drag (#179, SC8): every mover follows the shared world delta,\n        // clamped so each stays within the extent — rigidly, the movers keeping\n        // their places to one another — previewed until the release records it.\n        const md = moveDragRef.current;\n        if (md !== null) {\n            const host = e.currentTarget as HTMLElement;\n            const r = host.getBoundingClientRect();\n            const cam = cameraRef.current;\n            const ppuLive = renderSnapRef.current.fit * cam.zoom;\n            if (ppuLive > 0) {\n                const delta = clampDelta(md.movers, (e.clientX - r.left - cam.tx) / ppuLive - md.startWorld.x,\n                    (e.clientY - r.top - cam.ty) / ppuLive - md.startWorld.y, { width: W, height: H });\n                md.delta = delta;\n                setDragMoves(new Map(md.movers.map((m) => [m.id, { x: m.x + delta.dx, y: m.y + delta.dy }] as const)));\n            }\n            return;\n        }\n        // A press on a handle that moves past the drag threshold is the re-target drag (SC10), its draft following the\n        // pointer from this move on.\n        const hp = handlePressRef.current;\n        if (hp !== null) {\n            if (Math.abs(e.clientX - hp.x) <= DRAG_THRESHOLD_PX && Math.abs(e.clientY - hp.y) <= DRAG_THRESHOLD_PX) return;\n            handlePressRef.current = null;\n            connectDragRef.current = { from: hp.fixed, additive: false, retarget: { key: hp.key, movingEnd: hp.movingEnd } };\n        }\n        // Connect drag (#176): track the cursor in world coords and snap to a\n        // valid target item (anything but the source; locked items never resolve).\n        const cd = connectDragRef.current;\n        if (cd !== null) {\n            const host = e.currentTarget as HTMLElement;\n            const r = host.getBoundingClientRect();\n            const cam = cameraRef.current;\n            const ppuLive = renderSnapRef.current.fit * cam.zoom;\n            if (ppuLive > 0) {\n                const wxp = (e.clientX - r.left - cam.tx) / ppuLive, wyp = (e.clientY - r.top - cam.ty) / ppuLive;\n                const tk = itemKeyAt(host, e.clientX, e.clientY);\n                // canConnect veto: the draft never snaps to a forbidden pair.\n                // Re-targets validate in the link's REAL direction (the fixed\n                // end may be either side).\n                const refusal = tk !== undefined && tk !== cd.from ? candidateRefusal(cd, tk) : undefined;\n                const ok = tk !== undefined && tk !== cd.from && refusal === undefined;\n                const target = ok ? tk : undefined;\n                // A vetoed candidate is surfaced, not silent: the draft goes\n                // DANGER (red edge + ring on the target, not-allowed cursor), its\n                // words kept for the draft to show (#1388).\n                const forbidden = tk !== undefined && tk !== cd.from && !ok ? tk : undefined;\n                setConnectDraft({\n                    from: cd.from, toWorld: { x: wxp, y: wyp }, target,\n                    ...(cd.retarget !== undefined ? { retarget: cd.retarget.key } : {}),\n                    ...(forbidden !== undefined ? { forbidden, reason: refusal } : {}),\n                });\n            }\n            return;\n        }\n        // Box-drag: grow the screen-space box from its start corner.\n        const sel = selStartRef.current;\n        if (sel !== null) {\n            const r = (e.currentTarget as HTMLElement).getBoundingClientRect();\n            const cx = e.clientX - r.left, cy = e.clientY - r.top;\n            if (Math.abs(cx - sel.sx) > DRAG_THRESHOLD_PX || Math.abs(cy - sel.sy) > DRAG_THRESHOLD_PX) movedRef.current = true;\n            const x0 = Math.min(sel.sx, cx), y0 = Math.min(sel.sy, cy), sw = Math.abs(cx - sel.sx), sh = Math.abs(cy - sel.sy);\n            // One state write per move keeps the overlay rect on the cursor;\n            // the marquee HITS (badge + preview) coalesce to one r-tree pass\n            // per FRAME (#183 WS6), so per-move cost stays bounded at\n            // thousands of items. Hits here are display-only — pointerup\n            // recomputes at commit.\n            setBoxDrag(prev => ({ rect: { x: x0, y: y0, w: sw, h: sh }, mode: sel.mode, additive: sel.additive, hits: prev !== null ? prev.hits : EMPTY_STRING_SET }));\n            if (sel.mode === \"marquee\") {\n                marqueeRegionRef.current = { x0, y0, sw, sh };\n                if (marqueeRafRef.current === null) {\n                    marqueeRafRef.current = requestAnimationFrame(() => {\n                        marqueeRafRef.current = null;\n                        const region = marqueeRegionRef.current;\n                        if (region === null || selStartRef.current === null) return;   // drag ended — pointerup owns the commit\n                        const camF = cameraRef.current;\n                        const ppuF = renderSnapRef.current.fit * camF.zoom;\n                        const hits = region.sw > 6 && region.sh > 6 && ppuF > 0\n                            ? collectMarquee({\n                                minX: (region.x0 - camF.tx) / ppuF, minY: (region.y0 - camF.ty) / ppuF,\n                                maxX: (region.x0 + region.sw - camF.tx) / ppuF, maxY: (region.y0 + region.sh - camF.ty) / ppuF,\n                            })\n                            : EMPTY_STRING_SET;\n                        setBoxDrag(prev => prev === null ? prev : { ...prev, hits });\n                    });\n                }\n            }\n            return;\n        }\n        // A gesture Esc let go of goes on to its release with nothing to draw.\n        const pan = panRef.current;\n        if (pan === null) return;\n        if (Math.abs(e.clientX - pan.x) > DRAG_THRESHOLD_PX || Math.abs(e.clientY - pan.y) > DRAG_THRESHOLD_PX) movedRef.current = true;\n        cameraRef.current = { ...cameraRef.current, tx: pan.tx + e.clientX - pan.x, ty: pan.ty + e.clientY - pan.y };\n        requestRender();\n    };\n    /**\n     * A move with no gesture in flight. No button held and no card dragged over the canvas: the link or the net under\n     * the pointer lights (#1403), found through the links' R-tree — as a tap would find it, an item over it first, so\n     * nothing lights under a card, a pin or a dot; and nothing under the minimap.\n     */\n    const hover = (e: React.PointerEvent): void => {\n        if (e.buttons !== 0 || dragging) return;\n        const host = e.currentTarget as HTMLElement;\n        const overMinimap = e.target instanceof Element && e.target.closest(\"[data-schematic-minimap]\") !== null;\n        setLit(overMinimap || itemKeyAt(host, e.clientX, e.clientY) !== undefined ? undefined : linkKeyAt(host, e.clientX, e.clientY)?.key);\n    };\n    /** The pressing pointer's release: the gesture lands where it stands. */\n    const release = (e: React.PointerEvent): void => {\n        // A press on a handle let go where it began (SC10): a tap, which selects what is under it.\n        if (handlePressRef.current !== null) {\n            handlePressRef.current = null;\n            tapAt(e.currentTarget as HTMLElement, e.clientX, e.clientY, e.shiftKey);\n            return;\n        }\n        // Move release (#179, SC8): the move recorded as one step, its preview\n        // giving way to its drafts; a release where it began records nothing.\n        const md = moveDragRef.current;\n        if (md !== null) {\n            moveDragRef.current = null;\n            if (recordStep(moveEdits(md.movers, md.delta), \"move\", \"move\", \"\", md.movers.length) !== undefined) endLinkSession();\n            setDragMoves(NO_MOVES);\n            return;\n        }\n        // Connect release (#176): over a valid target commits the gesture\n        // (session-aware); anywhere else cancels the draft.\n        const cd = connectDragRef.current;\n        if (cd !== null) {\n            connectDragRef.current = null;\n            setConnectDraft(null);\n            const tk = itemKeyAt(e.currentTarget as HTMLElement, e.clientX, e.clientY);\n            if (tk !== undefined && tk !== cd.from) {\n                const allowed = candidateRefusal(cd, tk) === undefined;\n                if (allowed) {\n                    if (cd.retarget !== undefined) commitRetarget(cd.retarget.key, cd.retarget.movingEnd, tk);\n                    else if (cd.netExtend !== undefined) commitNetExtend(cd.netExtend, cd.from, tk);\n                    else commitConnect(cd.from, tk, cd.additive);\n                }\n            }\n            return;\n        }\n        // Box-drag release: a zoom box flies the view in (#153); a marquee selects\n        // the enclosed items (#159).\n        const sel = selStartRef.current;\n        if (sel !== null) {\n            selStartRef.current = null;\n            const r = (e.currentTarget as HTMLElement).getBoundingClientRect();\n            const cx = e.clientX - r.left, cy = e.clientY - r.top;\n            const x0 = Math.min(sel.sx, cx), y0 = Math.min(sel.sy, cy);\n            const sw = Math.abs(cx - sel.sx), sh = Math.abs(cy - sel.sy);\n            setBoxDrag(null);\n            const cam = cameraRef.current;\n            const ppuLive = renderSnapRef.current.fit * cam.zoom;\n            const isBox = sw > 6 && sh > 6 && ppuLive > 0;   // a real box, not a tap / sliver\n            if (sel.mode === \"zoom\") {\n                // A real box zooms; a bare tap / sliver instead SELECTS the item under\n                // it (empty tap clears) — so you can drag-zoom then click to select.\n                if (isBox) flyTo({ x: (x0 - cam.tx) / ppuLive, y: (y0 - cam.ty) / ppuLive, w: sw / ppuLive, h: sh / ppuLive });\n                else if (!pickAt(e.currentTarget as HTMLElement, e.clientX, e.clientY, e.shiftKey) && !e.shiftKey) clearSelection();\n                return;\n            }\n            // marquee\n            if (isBox) {\n                const region = {\n                    minX: (x0 - cam.tx) / ppuLive, minY: (y0 - cam.ty) / ppuLive,\n                    maxX: (x0 + sw - cam.tx) / ppuLive, maxY: (y0 + sh - cam.ty) / ppuLive,\n                };\n                const hits = collectMarquee(region);\n                // Plain box replaces the selection; Shift+box unions into it.\n                const next = sel.additive ? new Set([...renderSnapRef.current.selection.selected, ...hits]) : hits;\n                commitSelection(next, hits.size > 0 ? { anchor: [...hits][hits.size - 1]! } : {});\n            } else {\n                // A bare tap in marquee mode is a tap: an item, a link's line or a zone's body selects; the background\n                // clears all (unless Shift).\n                tapAt(e.currentTarget as HTMLElement, e.clientX, e.clientY, sel.additive);\n            }\n            return;\n        }\n        const wasPress = endPan();\n        if (!wasPress || movedRef.current) return;   // not a canvas tap, or it was a drag\n        // Select-tool tap: what is under it selects (Shift extends); a tap on empty background clears (unless Shift).\n        // The host hears the whole selection after each change, through the funnels' one report.\n        tapAt(e.currentTarget as HTMLElement, e.clientX, e.clientY, e.shiftKey);\n    };\n    /**\n     * The gesture in flight is let go of, recording nothing (invariants 4, 34): a Move's preview, Connect's draft and\n     * a handle's press, the box, and the pan. What a second finger, a new press, a lost pointer, a mouse moved with its\n     * button no longer held and the window losing the page each do, in this one place: a new state a press begins is\n     * put back here.\n     */\n    const drop = (): void => {\n        movedRef.current = false;\n        // A move that loses its pointer records nothing: its items stay where they were (SC8).\n        if (moveDragRef.current !== null) {\n            moveDragRef.current = null;\n            setDragMoves(NO_MOVES);\n        }\n        connectDragRef.current = null;\n        handlePressRef.current = null;\n        setConnectDraft(null);\n        selStartRef.current = null;\n        setBoxDrag(null);\n        endPan();\n    };\n    /** A second finger landed (#353): the two own the canvas until one is gone. */\n    const pinchStart = (): void => {\n        pinchRef.current = { from: cameraRef.current.zoom, over: 1 };\n    };\n    /**\n     * One of a pinch's two fingers moved: the drawing zooms by how much further apart they stand, about the point midway\n     * between them, and is carried as that point moves, so each finger stays on the point of the drawing it touched.\n     */\n    const pinch = (step: PinchStep, e: React.PointerEvent): void => {\n        const under = pinchRef.current;\n        if (under === null) return;\n        const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n        transition(\"wheel\");\n        const next = pinchAbout(cameraRef.current, step.factor, { x: step.from.x - rect.left, y: step.from.y - rect.top },\n            { x: step.to.x - rect.left, y: step.to.y - rect.top }, 1, renderSnapRef.current.maxZoom, under.over);\n        pinchRef.current = { from: under.from, over: next.over };\n        cameraRef.current = next.camera;\n        requestRender();\n    };\n    /** The pinch is over: fewer than two fingers are held — one lifted, taken back or lost. */\n    const pinchEnd = (): void => {\n        const under = pinchRef.current;\n        pinchRef.current = null;\n        // Zoomed all the way out: Fit's camera, as the wheel's and the toolbar's zoom out land on it. A pinch that began\n        // at the least zoom stays where its fingers carried the drawing, as a one-finger pan there does.\n        if (under !== null && under.from > 1 && cameraRef.current.zoom <= 1) {\n            cameraRef.current = renderSnapRef.current.home;\n            requestRender();\n        }\n    };\n    const surface = useSurfaceGestures({ press, drag, hover, release, drop, pinchStart, pinch, pinchEnd }, {\n        // Presses on the canvas's own buttons are theirs — a finger's among them, which is then no finger of the\n        // canvas's. Cards are NOT excluded — a drag-pan can start anywhere, including over a card; a tap (no drag) over\n        // the card is resolved by pickAt on its release.\n        accepts: (e) => (e.target as HTMLElement).closest(\"button\") === null,\n    });\n    // Double-click: on an entity it opens the selection in the inspector's\n    // Details (#1391) — the first click of the pair has already selected it; on\n    // the background it fits the view. Locked entities never resolve.\n    const onCanvasDoubleClick = useCallback((e: React.MouseEvent) => {\n        const host = e.currentTarget as HTMLElement;\n        drawPending();\n        if (itemKeyAt(host, e.clientX, e.clientY) !== undefined || linkKeyAt(host, e.clientX, e.clientY) !== undefined\n            || zoneKeyAt(host, e.clientX, e.clientY) !== undefined) {\n            onOpen?.();\n            return;\n        }\n        resetView();\n    }, [drawPending, itemKeyAt, linkKeyAt, zoneKeyAt, resetView, onOpen]);\n\n    // Leaving the Connect tool cancels any in-flight draft and ends the session.\n    useEffect(() => {\n        if (tool !== \"connect\") {\n            connectDragRef.current = null;\n            setConnectDraft(null);\n            endLinkSession();\n        }\n    }, [tool, endLinkSession, setConnectDraft]);\n\n    // Momentary tool overrides (#153): while the schematic is hovered, holding\n    // Space → Select, Ctrl → Zoom box, reverting on release. Del deletes what is\n    // selected (#1388). Escape (#159) cancels an in-flight gesture or, failing\n    // that, clears the selection, and drops a refusal's words. Gated on hover so\n    // the page's Space-scroll / Ctrl-modifier is untouched elsewhere — and never\n    // on a key typed into a field, Find's box among them, which is the field's,\n    // nor one the canvas has heard itself, nor one from a layer portaled out of\n    // the frame — a popover, a menu, a Chooser's list — which is the layer's\n    // (`keyIsCanvas`); window blur and pointer-leave clear a stuck override.\n    // Space is the canvas's only from itself, the page, or an element that acts\n    // on none: a button, a checkbox, a radio or a Chooser in the frame keeps its\n    // own Space, as a browser activates it (`keepsSpace`).\n    /** Whether a key is the canvas's while the pointer is over it (see above). */\n    const canvasHears = useCallback((e: { readonly defaultPrevented: boolean; readonly target: EventTarget | null }): boolean =>\n        hoveredRef.current && !e.defaultPrevented && !typedInto(e.target) && keyIsCanvas(canvasRef.current, e.target), [canvasRef]);\n    /**\n     * Does what a key the canvas hears while the pointer is over it does (see above): `true` when it acted on the key,\n     * which then goes no further (#1398) — EVERY Space, auto-repeat too, so the page never scrolls while panning; Ctrl,\n     * a modifier held, goes on.\n     */\n    const hoverKey = useCallback((e: { readonly key: string; readonly code: string; readonly repeat: boolean }): boolean => {\n        if (e.code === \"Space\") { if (!e.repeat) setTempTool(\"select\"); return true; }\n        if (e.key === \"Control\") { if (!e.repeat) setTempTool(\"zoom\"); return false; }\n        if (e.key === \"Delete\" || e.key === \"Backspace\") return deleteSelection();\n        if (e.key !== \"Escape\") return false;\n        onRefused(undefined);\n        if (moveDragRef.current !== null) { moveDragRef.current = null; setDragMoves(NO_MOVES); }\n        else if (connectDragRef.current !== null || handlePressRef.current !== null) { connectDragRef.current = null; handlePressRef.current = null; setConnectDraft(null); }\n        else if (selStartRef.current !== null) { selStartRef.current = null; setBoxDrag(null); }\n        else if (linkSessionRef.current !== undefined) endLinkSession();\n        else if (renderSnapRef.current.selection.selected.size > 0\n            || renderSnapRef.current.zoneSelection.size > 0\n            || renderSnapRef.current.selectedLink !== null) { clearSelection(); clearZoneSelection(); commitLinkSelection(null); }\n        else return false;\n        return true;\n    }, [clearSelection, clearZoneSelection, endLinkSession, deleteSelection, commitLinkSelection, onRefused, setTempTool, setDragMoves, setConnectDraft,\n        setBoxDrag, renderSnapRef]);\n    // A key from inside the frame — the canvas, its toolbar, its panes — heard as it leaves the frame, after every part\n    // of it that takes keys of its own, and taken there where it acts (#1398): it goes no further than the Schematic.\n    const onFrameKeyDown = useCallback((e: React.KeyboardEvent) => {\n        if (keyFromPage(e.target) || !canvasHears(e)) return;\n        // A control's own Space — a button's, a radio's, a Chooser's — is the control's.\n        if (e.code === \"Space\" && keepsSpace(e.target, canvasRef.current)) return;\n        if (hoverKey(e)) takeKey(e);\n    }, [canvasHears, hoverKey, canvasRef]);\n    // A key from the page, which no part of the frame hears: the window's.\n    useEffect(() => {\n        const onKeyDown = (e: KeyboardEvent) => {\n            if (!keyFromPage(e.target) || !canvasHears(e)) return;\n            if (hoverKey(e)) e.preventDefault();\n        };\n        const onKeyUp = (e: KeyboardEvent) => {\n            if (e.code === \"Space\" || e.key === \"Control\") setTempTool(null);\n        };\n        const clear = () => setTempTool(null);\n        window.addEventListener(\"keydown\", onKeyDown);\n        window.addEventListener(\"keyup\", onKeyUp);\n        window.addEventListener(\"blur\", clear);\n        return () => {\n            window.removeEventListener(\"keydown\", onKeyDown);\n            window.removeEventListener(\"keyup\", onKeyUp);\n            window.removeEventListener(\"blur\", clear);\n        };\n    }, [canvasHears, hoverKey, setTempTool]);\n    return {\n        hoveredRef, onCanvasKeyDown, onFrameKeyDown, itemKeyAt, zoneKeyAt, linkKeyAt, surface, onCanvasDoubleClick,\n    };\n}\n\n/** The gestures' handlers: {@link useGestures}'. */\nexport type Gestures = ReturnType<typeof useGestures>;\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's reads of the app's records (#1386, `Schematic Builder\n * Spec.md` §10.4), in a component of its own, as the Allocation's day and the\n * Roster's week are (#1343): each kind's rows through its `rows` — its record\n * read whole, or its narrowing read complete through its source of the slice —\n * and the details of a kind whose details are read whole beside it, made what\n * the canvas draws (`canvas/drawn.ts`). An entity whose roles read again as\n * they were keeps what was drawn of it, so the drawing keeps its identity\n * while nothing it shows moves, and the frame is handed what it reads only\n * when that moves. While a read the drawing needs is in flight, the frame keeps\n * the last complete drawing; one it has never read is never drawn as empty.\n * It reads the stored rows alone: the frame draws the editing session's drafts\n * over them (#1388), by which rows each read holds and their details' roles,\n * and lists in the library's Backlog the rows an item kind's read holds with\n * no position (#1389).\n *\n * Each kind is read on its own (#1387, SC32): a kind whose read fails keeps\n * what was drawn of it, says why under its slot, and leaves every other kind\n * read; the frame says so in a banner, with Retry. A read again — `attempt`\n * moving — reads every kind afresh. A read holds a kind's rows by their keys'\n * texts, in the texts' order; they are drawn, held and listed in their keys'\n * order at the kind's key type (#1549), each text read back once a read.\n *\n * A kind whose source of the slice lists an area index is read by area\n * (#1393, §10.4): its viewport's window, a cell at a time (`area.ts`), never\n * its record whole nor its narrowing complete — its rows, or past\n * `SCHEMATIC_WINDOW_ROWS` in view its density; its items' details by the runs its\n * window was read by, at every zoom, so a dot draws its item's status (D45);\n * its whole drawing's density, which the minimap draws (`overview`); and the\n * far ends of the links and nets that touch it, by key. One\n * that lists area indexes none of which reads it — none led by no field, or\n * one boxing its rows otherwise than its roles — is refused as it reads,\n * naming what to declare (SC34). The previous window stays drawn until the\n * next lands, and until every row of it is made: a read makes a budget's\n * worth of the rows new to it (`area.ts`), and the next read, a task later,\n * the rest, so a frame draws between them. A kind whose read is in flight, or\n * whose rows are still being made, keeps what was drawn of it, so the read\n * that next draws it keeps each entity that reads again as it was.\n *\n * What it reads now is the footer's loading line's to say (#1398, CL3): the\n * first kind in the Schematic's order whose rows, details or narrowing are in\n * flight — its record whole, its window's rows in view, its density's counts,\n * or its rows' details — and whether that read is of a new narrowing — the\n * kind's source's narrowing no longer the one its drawing was read under,\n * which stands in meanwhile. A kind's rows draw while their details are read:\n * each card keeps the places of the roles its details give, a placeholder in\n * each (`canvas/drawn.ts`' `pending`), and a row whose details were drawn\n * before keeps them until they land again — never a value it has not read.\n * While a kind's window is read, the area its drawing does not cover yet is\n * said, for the canvas to wash (`unread`, CL2); and where its read fails, the\n * area it failed reading, for the canvas to say so at (`failedAreas`, CL11).\n * While what it hands the frame was read under a narrowing its kind's source\n * no longer holds — the new one in flight — it says so (`filtering`), for the\n * frame to draw it as kept and take no edit on it until the new one lands (CL8).\n *\n * Under `fit` it reads, for each kind read by area its narrowing narrows, the\n * box the narrowing's rows stand in, from its area index's counts (`fits`,\n * §10.3): what the camera flies to as the narrowing changes, never what the\n * window draws — and says while one is read (`fitting`).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from \"react\";\nimport { StringType, compareFor, equalFor, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { Schematic, schematicAreaIndexes, type SchematicAreaIndexes } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { recordSliceRevision } from \"@elaraai/east-ui-components/internal\";\nimport { kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport {\n    READING, SchematicAreaReader, boxMinus, unreadArea, windowOf,\n    type SchematicAreaKind, type SchematicDensity, type SchematicViewport, type SchematicViewportStore, type SchematicWindowRead,\n} from \"./area.js\";\nimport {\n    EMPTY_DRAWN, drawnItem, drawnLink, drawnNet, drawnZone,\n    type CardRoles, type DetailsRoles, type DrawnItem, type DrawnLink, type DrawnNet, type DrawnZone, type ItemRoles, type SchematicDrawn, type SchematicRef,\n} from \"./canvas/drawn.js\";\nimport type { WorldBox } from \"./canvas/model.js\";\n\n/** The Schematic's payload, decoded. */\nexport type SchematicValue = ValueTypeOf<typeof Schematic.Types.Payload>;\n\nconst sameItem = equalFor(Schematic.Types.Item);\nconst sameZone = equalFor(Schematic.Types.Zone);\nconst sameLink = equalFor(Schematic.Types.Link);\nconst sameNet = equalFor(Schematic.Types.Net);\nconst sameDetails = equalFor(Schematic.Types.DetailsRoles);\nconst sameWhere = equalFor(RecordSliceWhereType);\nconst printWhere = printFor(RecordSliceWhereType);\nconst sameString = equalFor(StringType);\nconst compareString = compareFor(StringType);\n\n/** A record Slice's narrowing, decoded. */\ntype Where = ValueTypeOf<typeof RecordSliceWhereType>;\n\n/**\n * What the Schematic reads now, as the footer's loading line says it (#1398, CL3): the first kind in the Schematic's\n * order whose read is in flight, and whether that read is of a new narrowing, the last standing in.\n */\nexport interface SchematicReading {\n    /** The kind's slot. */\n    readonly slot: string;\n    /**\n     * What of it is read: its record whole, or its narrowing complete (`rows`: `Loading racks…`); its window's rows\n     * (`area`: `Loading racks in view`); its density's counts (`counts`: `Loading counts`); or its rows' details, its rows\n     * drawn meanwhile (`details`: `Loading details for 12 racks`).\n     */\n    readonly what: \"rows\" | \"area\" | \"counts\" | \"details\";\n    /** Whether its source's narrowing is not the one its drawing was read under: `Filtering racks…`, whatever is read. */\n    readonly filtering: boolean;\n    /** How many of its rows drawn wait on their details; `0` but while its details are read. */\n    readonly waiting: number;\n}\n\n/** What the Schematic has read of its kinds' records. */\nexport interface SchematicData {\n    /** What the canvas draws: the last settled read's entities. */\n    readonly drawn: SchematicDrawn;\n    /** Whether a read the drawing needs — a kind's rows, or its details read whole — is in flight. */\n    readonly loading: boolean;\n    /** What is read now, the first kind in flight in the Schematic's order; `undefined` while nothing is. */\n    readonly reading: SchematicReading | undefined;\n    /**\n     * Whether what the canvas draws of a kind was read under a narrowing its source no longer holds, the new one's read\n     * in flight (#1398, CL8): it stands in, kept, until the new one lands — never a kind whose read of it failed.\n     */\n    readonly filtering: boolean;\n    /** Whether a read has settled: every kind read, or its read failed. */\n    readonly ready: boolean;\n    /** Why the read as a whole failed — outside any one kind's. */\n    readonly error: string | undefined;\n    /** Why a kind's read failed, by the kind's slot. */\n    readonly failures: ReadonlyMap<string, string>;\n    /** How many rows each kind's settled read holds, by the kind's slot — those with no position among them. */\n    readonly rows: ReadonlyMap<string, number>;\n    /**\n     * Each kind's rows the settled read holds, by the kind's slot, then by key — each one's details' roles, where its\n     * kind's details are read whole beside it (#1388): which rows a draft draws over, and what a drafted card draws.\n     */\n    readonly held: SchematicHeldRows;\n    /**\n     * Each item kind's rows the settled read holds with no position, by the kind's slot, then by key — each one's roles,\n     * in their keys' order (#1389, #1549): what the library's Backlog lists, the drafts over them.\n     */\n    readonly unplaced: SchematicUnplacedRows;\n    /**\n     * Each kind read by area, by its slot: the rows its settled window holds, by key, each its row's bytes — what a\n     * gesture's original, a Save's confirmation and the inspector find a row in before reading it by key (#1393).\n     */\n    readonly windows: SchematicWindowRows;\n    /**\n     * Each kind read by area, by its slot: the revision its record reads at now, whatever of its window is in flight —\n     * none for one whose record names none yet. A window read at another revision is from before it: what tells a window\n     * read before a Save from one read since (`drafted.ts`).\n     */\n    readonly revisions: ReadonlyMap<string, string>;\n    /** Each kind read by area drawing its density in place of items, by its slot (D25). */\n    readonly density: ReadonlyMap<string, SchematicDensity>;\n    /** Each kind read by area's whole drawing's density, by its slot: what the minimap draws of it (#1393). */\n    readonly overview: ReadonlyMap<string, SchematicDensity>;\n    /**\n     * Each kind read by area under `narrowed=\"dim\"` and a narrowing, by its slot: the rows its window holds that the\n     * narrowing holds, as `within` answered (D28) — what draws as a match, and the rest as context.\n     */\n    readonly matched: ReadonlyMap<string, ReadonlySet<string>>;\n    /**\n     * What the reads in flight have not drawn yet, in world units, as disjoint boxes (#1398, CL2): each kind read by area\n     * whose window's rows or counts are read, the reach it reads less the reach its drawing holds — what the canvas washes.\n     */\n    readonly unread: readonly WorldBox[];\n    /**\n     * Each kind read by area whose read failed, by its slot: the area it failed reading — its window's reach less what its\n     * drawing holds, or, where its drawing holds it all, the reach — where the canvas says so, at its top-left (CL11).\n     */\n    readonly failedAreas: ReadonlyMap<string, readonly WorldBox[]>;\n    /**\n     * Under `fit`, each kind read by area its narrowing narrows, by its slot: the box its narrowing's rows stand in, as its\n     * area index's counts answer it (§10.3) — `null` where it holds none — what the camera flies to, beside the narrowing it\n     * was read under, printed, so a narrowing that has moved since waits for its own.\n     */\n    readonly fits: ReadonlyMap<string, SchematicFit>;\n    /** Whether a kind's box under `fit` is read: the camera waits for it before it flies. */\n    readonly fitting: boolean;\n}\n\n/** The box a kind read by area's narrowing's rows stand in under `fit`, and the narrowing it was read under. */\nexport interface SchematicFit {\n    /** The narrowing, printed. */\n    readonly under: string;\n    /** The box, in world units; `null` where the narrowing holds no row. */\n    readonly box: WorldBox | null;\n}\n\n/** The rows a kind's window holds, by key, each its row's bytes, and the revision of the record they were read at. */\nexport interface SchematicWindowHeld {\n    /** The record's revision they were read at. */\n    readonly revision: string;\n    /** The rows, by key. */\n    readonly rows: ReadonlyMap<string, { readonly row: Uint8Array }>;\n}\n\n/** Each kind read by area, by its slot: the rows its window holds, at the revision they were read at. */\nexport type SchematicWindowRows = ReadonlyMap<string, SchematicWindowHeld>;\n\n/** Each item kind's rows a read holds with no position, by the kind's slot, then by key: each one's roles. */\nexport type SchematicUnplacedRows = ReadonlyMap<string, ReadonlyMap<string, ItemRoles>>;\n\n/** One row a kind's read holds: its details' roles, where its kind's details are read whole beside it. */\nexport interface SchematicHeldRow {\n    readonly details: DetailsRoles | undefined;\n    /** The card roles its kind's details give, while its details row is read and none stands in: a drafted card over it holds their places (#1398). */\n    readonly pending?: CardRoles | undefined;\n}\n\n/** Each kind's rows a read holds, by the kind's slot, then by key. */\nexport type SchematicHeldRows = ReadonlyMap<string, ReadonlyMap<string, SchematicHeldRow>>;\n\n/** No kind failed. */\nconst NO_FAILURES: ReadonlyMap<string, string> = new Map();\n\n/** No kind read. */\nconst NO_ROWS: ReadonlyMap<string, number> = new Map();\n\n/** No row held. */\nconst NO_HELD: SchematicHeldRows = new Map();\n\n/** No row with no position. */\nconst NO_UNPLACED: SchematicUnplacedRows = new Map();\n\n/** No kind read by area. */\nconst NO_WINDOWS: SchematicWindowRows = new Map();\n\n/** No kind read by area whose record names a revision. */\nconst NO_REVISIONS: ReadonlyMap<string, string> = new Map();\n\n/** No kind drawing its density, and none's overview read. */\nconst NO_DENSITY: ReadonlyMap<string, SchematicDensity> = new Map();\n\n/** No kind read by area under a dimmed narrowing. */\nconst NO_MATCHED: ReadonlyMap<string, ReadonlySet<string>> = new Map();\n\n/** Nothing unread. */\nconst NO_BOXES: readonly WorldBox[] = [];\n\n/** No kind read by area failed. */\nconst NO_FAILED_AREAS: ReadonlyMap<string, readonly WorldBox[]> = new Map();\n\n/** No kind's box read under `fit`. */\nconst NO_FITS: ReadonlyMap<string, SchematicFit> = new Map();\n\n/** The frame's data before its reader first reports: nothing drawn, a read in flight. */\nexport const INITIAL_SCHEMATIC_DATA: SchematicData = {\n    drawn: EMPTY_DRAWN, loading: true, reading: undefined, filtering: false, ready: false, error: undefined, failures: NO_FAILURES, rows: NO_ROWS, held: NO_HELD,\n    unplaced: NO_UNPLACED, windows: NO_WINDOWS, revisions: NO_REVISIONS, density: NO_DENSITY, overview: NO_DENSITY, matched: NO_MATCHED, unread: NO_BOXES,\n    failedAreas: NO_FAILED_AREAS, fits: NO_FITS, fitting: false,\n};\n\n/** Whether two kinds' boxes under `fit` say the same. */\nfunction sameFits(a: ReadonlyMap<string, SchematicFit>, b: ReadonlyMap<string, SchematicFit>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [slot, fit] of a) {\n        const other = b.get(slot);\n        if (other === undefined || !sameString(fit.under, other.under)) return false;\n        if (fit.box === null || other.box === null ? fit.box !== other.box : !sameBoxes([fit.box], [other.box])) return false;\n    }\n    return true;\n}\n\n/**\n * The kinds read by area, by their slots (#1393): each item and zone kind\n * whose source of the slice lists an area index — what is never read whole,\n * nor its narrowing complete, whether or not its indexes read it.\n *\n * @param value - The payload\n * @returns Their slots\n */\nexport function areaSlots(value: SchematicValue): ReadonlySet<string> {\n    const chrome = getSomeorUndefined(value.slice);\n    const slots = new Set<string>();\n    for (const kind of [...value.items, ...value.zones]) {\n        if (sourcePart(chrome, kind.key)?.config.indexes.some((index) => index.area.type === \"some\") === true) slots.add(kind.key);\n    }\n    return slots;\n}\n\n/** One entity as it was last drawn: the roles it was drawn from, its details' roles, and what was drawn — none for an unplaced item. */\ninterface Kept extends SchematicHeldRow {\n    readonly roles: unknown;\n    readonly drawn: unknown;\n}\n\n/**\n * What was last read, for the payload it was read under: each kind's entities by its slot, then by key, what each\n * kind's were made from — its stored rows, its details' and what of them was unread — the narrowing each kind read\n * through its source was drawn under, the reach each kind read by area's drawing covers, and the drawing.\n */\ninterface Held {\n    readonly value: SchematicValue | undefined;\n    readonly kinds: ReadonlyMap<string, ReadonlyMap<string, Kept>>;\n    readonly inputs: ReadonlyMap<string, Inputs>;\n    readonly wheres: ReadonlyMap<string, Where>;\n    readonly reaches: ReadonlyMap<string, WorldBox>;\n    readonly drawn: SchematicDrawn;\n}\n\n/** What one kind's entities were made from: its stored rows, its details', and the card roles they give while they are read. */\ninterface Inputs {\n    readonly rows: unknown;\n    readonly details: unknown;\n    readonly unread: CardRoles | undefined;\n}\n\n/** Nothing held: a payload read for the first time. */\nfunction nothingHeld(value: SchematicValue | undefined): Held {\n    return { value, kinds: new Map(), inputs: new Map(), wheres: new Map(), reaches: new Map(), drawn: EMPTY_DRAWN };\n}\n\n/** One kind's stored rows a read holds, each its roles. */\ntype Rows<R> = ReadonlyMap<string, { readonly roles: R }>;\n\n/** Why a read failed, as the banner says it. */\nfunction messageOf(error: unknown): string {\n    return error instanceof Error ? error.message : String(error);\n}\n\n/** Whether two lists of boxes are the same boxes, in order. */\nfunction sameBoxes(a: readonly WorldBox[], b: readonly WorldBox[]): boolean {\n    return a.length === b.length && a.every((box, i) => box.minX === b[i]!.minX && box.minY === b[i]!.minY && box.maxX === b[i]!.maxX && box.maxY === b[i]!.maxY);\n}\n\n/** Whether two kinds' failed areas say the same. */\nfunction sameAreas(a: ReadonlyMap<string, readonly WorldBox[]>, b: ReadonlyMap<string, readonly WorldBox[]>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [slot, boxes] of a) {\n        const other = b.get(slot);\n        if (other === undefined || !sameBoxes(boxes, other)) return false;\n    }\n    return true;\n}\n\n/** A map's entries as one string: equal whenever the map holds the same. */\nfunction signatureOf(map: ReadonlyMap<string, string | number>): string {\n    return [...map].map(([key, value]) => `${key}\\u0000${value}`).join(\"\\u0001\");\n}\n\n/** Two maps holding the same objects under the same keys. */\nfunction sameEntries<V>(a: ReadonlyMap<string, V>, b: ReadonlyMap<string, V>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [key, value] of a) if (!Object.is(b.get(key), value)) return false;\n    return true;\n}\n\n/** Whether each kind's drawing was read under the same narrowing in both: East deciding which narrowings are the same. */\nfunction sameWheres(a: ReadonlyMap<string, Where>, b: ReadonlyMap<string, Where>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [slot, where] of a) {\n        const other = b.get(slot);\n        if (other === undefined || !sameWhere(where, other)) return false;\n    }\n    return true;\n}\n\n/** A kind's read that threw: why. */\ninterface Refused {\n    readonly refused: unknown;\n}\n\n/** What a read through a kind's `rows()` gave: its rows, `none` while in flight, or why it threw. */\nfunction rowsRead<T>(read: () => T): T | Refused {\n    try {\n        return read();\n    } catch (refused) {\n        return { refused };\n    }\n}\n\n/** Whether a read threw. */\nfunction isRefused(read: unknown): read is Refused {\n    return typeof read === \"object\" && read !== null && \"refused\" in read;\n}\n\n/** Each kind's rows' keys' texts in their keys' order, by the rows read: read back once while the read holds them. */\nconst keyOrders = new WeakMap<ReadonlyMap<string, unknown>, readonly string[]>();\n\n/**\n * A kind's rows' keys in their keys' order at its key type (#1549): a read holds them by their texts in the texts' order,\n * which is a String key's own — any other's each read back, once for the rows read.\n *\n * @param rows - The kind's rows a read holds, by their keys' texts\n * @param keys - The kind's keys\n * @returns The keys' texts, in their keys' order\n */\nfunction keysInOrder(rows: ReadonlyMap<string, unknown>, keys: KindKeys): Iterable<string> {\n    if (keys.text) return rows.keys();\n    let order = keyOrders.get(rows);\n    if (order === undefined) {\n        order = keys.order(rows.keys()).map(({ text }) => text);\n        keyOrders.set(rows, order);\n    }\n    return order;\n}\n\n/**\n * Reads the drawing (see the module docs).\n *\n * @param value - The payload\n * @param attempt - Moves to read every kind afresh: a Retry\n * @param viewport - Where the canvas's viewport rests, which a kind read by area reads its window around; `undefined` before the canvas has reported it\n * @returns What the Schematic has read\n */\nexport function useSchematicData(value: SchematicValue, attempt = 0, viewport?: SchematicViewport): SchematicData {\n    const held = useRef<Held>(nothingHeld(undefined));\n    // The reads by area: each kind's window, the cells it read and the rows it made, across reads (#1393).\n    const [areaReader] = useState(() => new SchematicAreaReader());\n    // Rows a read leaves to make, the next read makes, a task later, so a frame draws between: it moves to ask it (#1393).\n    const [makes, setMakes] = useState(0);\n    const read = useCallback(() => {\n        // A Retry reads every kind again, from what was drawn.\n        void attempt;\n        void makes;\n        areaReader.begin();\n        // A payload built again holds functions of its own: what they draw is read again.\n        const prior: Held = Object.is(held.current.value, value) ? held.current : nothingHeld(value);\n        const kinds = new Map<string, ReadonlyMap<string, Kept>>();\n        const inputs = new Map<string, Inputs>();\n        const wheres = new Map<string, Where>();\n        const reaches = new Map<string, WorldBox>();\n        const failures = new Map<string, string>();\n        const windows = new Map<string, SchematicWindowHeld>();\n        const revisions = new Map<string, string>();\n        const density = new Map<string, SchematicDensity>();\n        const overview = new Map<string, SchematicDensity>();\n        const matched = new Map<string, ReadonlySet<string>>();\n        const failedAreas = new Map<string, readonly WorldBox[]>();\n        let loading = false;\n        // The kinds whose rows, details or narrowing are in flight, and what of each: what the footer's loading line says\n        // (#1398, CL3) — a kind's rows before its details.\n        const inFlight = new Set<string>();\n        const what = new Map<string, SchematicReading[\"what\"]>();\n        const awaiting = (slot: string, doing: SchematicReading[\"what\"]) => {\n            loading = true;\n            inFlight.add(slot);\n            if (doing !== \"details\" || !what.has(slot)) what.set(slot, doing);\n        };\n        let changed = prior.kinds.size === 0;\n        /**\n         * One kind's entities: each kept where its roles and its details read again as they were, else drawn again — all\n         * of them, unread, where its rows and its details are the very ones the last read drew from — the narrowing they\n         * were read under, and the reach a kind read by area's drawing covers. While its details are read (`unread`, the\n         * card roles they give), a row keeps the details it was drawn with, and one with none waits on them, its card\n         * holding their places (#1398). Its rows are drawn in their keys' order at its key type (#1549).\n         */\n        const take = <R, E>(slot: string, keys: KindKeys, rows: Rows<R>, details: Rows<DetailsRoles> | undefined, same: (a: R, b: R) => boolean,\n            draw: (ref: SchematicRef, roles: R, details: DetailsRoles | undefined, pending: CardRoles | undefined) => E | undefined, out: E[],\n            unread?: CardRoles, reach?: WorldBox) => {\n            const was = prior.kinds.get(slot);\n            const from = prior.inputs.get(slot);\n            inputs.set(slot, { rows, details, unread });\n            const where = whereOf(slot);\n            if (where !== undefined) wheres.set(slot, where);\n            if (reach !== undefined) reaches.set(slot, reach);\n            if (was !== undefined && from !== undefined && Object.is(from.rows, rows) && Object.is(from.details, details) && Object.is(from.unread, unread)) {\n                kinds.set(slot, was);\n                for (const kept of was.values()) if (kept.drawn !== undefined) out.push(kept.drawn as E);\n                return;\n            }\n            if (was === undefined || was.size !== rows.size) changed = true;\n            const kept = new Map<string, Kept>();\n            for (const key of keysInOrder(rows, keys)) {\n                const entry = rows.get(key)!;\n                const last = was?.get(key);\n                // While its details are read, the details it was drawn with stand in; one with none waits on them.\n                const its = details?.get(key)?.roles ?? (unread !== undefined ? last?.details : undefined);\n                const pending = unread !== undefined && its === undefined ? unread : undefined;\n                // A row made again as it was is the same object (`area.ts`' made rows): compared as such before as values.\n                const keep = last !== undefined && (Object.is(last.roles, entry.roles) || same(last.roles as R, entry.roles))\n                    && (Object.is(last.details, its) || (last.details !== undefined && its !== undefined && sameDetails(last.details, its)))\n                    && Object.is(last.pending, pending);\n                const drawn = keep ? last.drawn as E | undefined : draw({ kind: slot, key }, entry.roles, its, pending);\n                if (!keep) changed = true;\n                kept.set(key, { roles: entry.roles, details: its, pending, drawn });\n                if (drawn !== undefined) out.push(drawn);\n            }\n            kinds.set(slot, kept);\n        };\n        /**\n         * What was drawn of a kind stays — whose read failed, or is in flight, or whose rows are still being made — and\n         * what it was drawn from, so the read that next draws it keeps each entity that reads again as it was.\n         */\n        const carry = <E>(slot: string, out: E[]) => {\n            const was = prior.kinds.get(slot);\n            if (was === undefined) return;\n            kinds.set(slot, was);\n            const from = prior.inputs.get(slot);\n            if (from !== undefined) inputs.set(slot, from);\n            const where = prior.wheres.get(slot);\n            if (where !== undefined) wheres.set(slot, where);\n            const reach = prior.reaches.get(slot);\n            if (reach !== undefined) reaches.set(slot, reach);\n            for (const kept of was.values()) if (kept.drawn !== undefined) out.push(kept.drawn as E);\n        };\n        /**\n         * A kind whose read failed: what was drawn of it stays, and why is kept under its slot — and, read by area, the area\n         * it failed reading: its window's reach less what its drawing holds, or the reach, where its drawing holds it all.\n         */\n        const failed = <E>(slot: string, error: unknown, out: E[]) => {\n            failures.set(slot, messageOf(error));\n            const want = areaReader.wanted(slot)?.reach;\n            if (want !== undefined) {\n                const area = boxMinus(want, prior.reaches.get(slot));\n                failedAreas.set(slot, area.length > 0 ? area : [want]);\n            }\n            carry(slot, out);\n        };\n        // The item and zone kinds whose read is in flight, or whose rows are still being made: drawn as they were.\n        const pending = new Set<string>();\n        const items: DrawnItem[] = [];\n        const zones: DrawnZone[] = [];\n        const links: DrawnLink[] = [];\n        const nets: DrawnNet[] = [];\n        const chrome = getSomeorUndefined(value.slice);\n        // The narrowing a kind's source holds now; `undefined` for a kind read through none.\n        const whereOf = (slot: string): Where | undefined => sourcePart(chrome, slot)?.read().where;\n        const dim = value.narrowed.show.type === \"dim\";\n        // The drawing's extent, where a window's rows lie as the viewport's count of them weighs them — the footer's too.\n        const extent = { minX: 0, minY: 0, maxX: value.extent.width, maxY: value.extent.height };\n\n        // The links and the nets, read complete (D17): first, as the far ends of those that touch a window are read by key.\n        const linkReads = value.links.map((kind) => rowsRead(() => kind.rows()));\n        const netReads = value.nets.map((kind) => rowsRead(() => kind.rows()));\n\n        // Each item and zone kind read by area: its window, its narrowing not yet asked of it (#1393).\n        const byArea = new Map<string, {\n            readonly kind: SchematicAreaKind; readonly part: NonNullable<ReturnType<typeof sourcePart>>; readonly areas: SchematicAreaIndexes;\n            readonly read: SchematicWindowRead;\n        }>();\n        /** A kind's read by area, where its source lists an area index: its window, or `READING`; `undefined` for a kind read through `rows()`. */\n        const areaRead = (kind: SchematicAreaKind, sort: \"items\" | \"zones\"): SchematicWindowRead | typeof READING | undefined => {\n            const part = sourcePart(chrome, kind.key);\n            const where = `Schematic.${sort}: \"${kind.name}\"`;\n            const areas = part === undefined ? undefined : schematicAreaIndexes(part.config.indexes, kind.box, sort, where);\n            if (part === undefined || areas === undefined) return undefined;\n            // The revision its record reads at now, whatever of its window is in flight: a window read at another is from before it.\n            const revision = recordSliceRevision(part);\n            if (revision.type === \"some\") revisions.set(kind.key, revision.value);\n            // Nothing is read before the canvas says where its viewport rests.\n            if (viewport === undefined) return READING;\n            const got = areaReader.window(kind, part, areas, viewport, dim, extent);\n            if (got !== READING) byArea.set(kind.key, { kind, part, areas, read: got });\n            return got;\n        };\n        // What a kind's window's read waits on, as the line says it: its rows in view, or its density's counts.\n        const windowWait = (slot: string): SchematicReading[\"what\"] => (areaReader.waiting(slot) === \"counts\" ? \"counts\" : \"area\");\n        // Each item kind read through `rows()`, its details read whole beside it: its rows, to draw once the far ends are read.\n        const wholeItems: {\n            readonly kind: SchematicAreaKind; readonly rows: Rows<ItemRoles>; readonly details: Rows<DetailsRoles> | undefined; readonly unread: CardRoles | undefined;\n        }[] = [];\n        const wholeZones: { readonly kind: SchematicAreaKind; readonly rows: Rows<ValueTypeOf<typeof Schematic.Types.Zone>> }[] = [];\n        for (const kind of value.items) {\n            try {\n                const area = areaRead(kind, \"items\");\n                if (area === READING) { awaiting(kind.key, windowWait(kind.key)); pending.add(kind.key); continue; }\n                if (area !== undefined) continue;\n                const rows = kind.rows();\n                // A kind's details read whole beside it: what its cards draw where the kind gives none — its rows drawn while\n                // they are read, each card holding the places of the roles they give (#1398).\n                let details: Rows<DetailsRoles> | undefined;\n                let unread: CardRoles | undefined;\n                if (kind.details.type === \"some\" && kind.details.value.rows.type === \"some\") {\n                    const got = kind.details.value.rows.value();\n                    if (got.type === \"some\") details = got.value;\n                    else { unread = kind.details.value.roles; awaiting(kind.key, \"details\"); }\n                }\n                if (rows.type !== \"some\") { awaiting(kind.key, \"rows\"); pending.add(kind.key); continue; }\n                wholeItems.push({ kind, rows: rows.value, details, unread });\n            } catch (error) {\n                failed(kind.key, error, items);\n            }\n        }\n        for (const kind of value.zones) {\n            try {\n                const area = areaRead(kind, \"zones\");\n                if (area === READING) { awaiting(kind.key, windowWait(kind.key)); pending.add(kind.key); continue; }\n                if (area !== undefined) continue;\n                const rows = kind.rows();\n                if (rows.type !== \"some\") { awaiting(kind.key, \"rows\"); pending.add(kind.key); continue; }\n                wholeZones.push({ kind, rows: rows.value });\n            } catch (error) {\n                failed(kind.key, error, zones);\n            }\n        }\n\n        // The far ends of the links and nets that touch a window (D17, §12): an end of a kind read by area its window\n        // doesn't hold, where the other end is drawn in the window's reach — held by its window, or read whole there.\n        const reach = viewport === undefined ? undefined : windowOf(viewport).reach;\n        const placedAt = new Map<string, ItemRoles>();\n        for (const { kind, rows } of wholeItems) for (const [key, entry] of rows) placedAt.set(`${kind.key}\\u0000${key}`, entry.roles);\n        const touches = (ref: SchematicRef): boolean => {\n            const area = byArea.get(ref.kind);\n            if (area !== undefined) return area.read.rows.has(ref.key);\n            const roles = placedAt.get(`${ref.kind}\\u0000${ref.key}`);\n            const at = roles === undefined ? undefined : getSomeorUndefined(roles.position);\n            return at !== undefined && reach !== undefined && at.x >= reach.minX && at.x <= reach.maxX && at.y >= reach.minY && at.y <= reach.maxY;\n        };\n        const far = new Map<string, Set<string>>();\n        const wantFar = (ends: readonly SchematicRef[]) => {\n            if (!ends.some(touches)) return;\n            for (const end of ends) {\n                const area = byArea.get(end.kind);\n                if (area === undefined || area.read.rows.has(end.key)) continue;\n                let keys = far.get(end.kind);\n                if (keys === undefined) { keys = new Set(); far.set(end.kind, keys); }\n                keys.add(end.key);\n            }\n        };\n        if (byArea.size > 0) {\n            for (const got of linkReads) {\n                if (isRefused(got) || got.type !== \"some\") continue;\n                for (const entry of got.value.values()) wantFar([entry.roles.from, entry.roles.to]);\n            }\n            for (const got of netReads) {\n                if (isRefused(got) || got.type !== \"some\") continue;\n                for (const entry of got.value.values()) wantFar([...entry.roles.sources, ...entry.roles.destinations]);\n            }\n        }\n\n        // Under `fit`, each kind read by area its narrowing narrows: the box the narrowing's rows stand in, by its area index's\n        // counts over the drawing's extent (§10.3) — never what its window draws. One whose read fails is said as its kind's.\n        const fits = new Map<string, SchematicFit>();\n        let fitting = false;\n        if (value.narrowed.fit) {\n            for (const [sort, kinds] of [[\"items\", value.items], [\"zones\", value.zones]] as const) {\n                for (const kind of kinds) {\n                    const part = sourcePart(chrome, kind.key);\n                    if (part === undefined || part.read().where.size === 0) continue;\n                    try {\n                        const areas = schematicAreaIndexes(part.config.indexes, kind.box, sort, `Schematic.${sort}: \"${kind.name}\"`);\n                        if (areas === undefined) continue;\n                        const box = areaReader.fitBox(kind, part, areas, extent);\n                        if (box === READING) fitting = true;\n                        else fits.set(kind.key, { under: printWhere(part.read().where), box });\n                    } catch (error) {\n                        failures.set(kind.key, messageOf(error));\n                    }\n                }\n            }\n        }\n\n        // Each kind read by area: its far ends by key through its own paged read, its narrowing asked of its rows and theirs\n        // in one request, its rows made its stored rows, and its items' details by the runs its window was read by.\n        const areaRows = new Map<string, {\n            readonly rows: Rows<unknown>; readonly details: Rows<DetailsRoles> | undefined; readonly unread: CardRoles | undefined; readonly reach: WorldBox;\n        }>();\n        for (const [slot, { kind, part, areas, read: windowRead }] of byArea) {\n            const isItem = value.items.some((item) => Object.is(item, kind));\n            // Its whole drawing's density, which the minimap draws: read beside its window, never holding the drawing up. One\n            // that fails is said as its kind's read failing, with Retry, its rows still drawn.\n            try {\n                const whole = areaReader.overview(kind, part, areas, extent, dim);\n                if (whole !== READING) overview.set(slot, whole);\n            } catch (error) {\n                failures.set(slot, messageOf(error));\n            }\n            try {\n                // Only an item is a link's end or a net's member: a zone kind has no far ends.\n                const paged = \"paged\" in kind ? getSomeorUndefined(kind.paged) : undefined;\n                const keys = kindKeys(kind.keyType);\n                const farRows = areaReader.farEnds(slot, paged, keys, [...(far.get(slot) ?? [])].sort(compareString));\n                if (farRows === READING) { awaiting(slot, \"area\"); pending.add(slot); continue; }\n                const narrowed = areaReader.narrowed(kind, part, windowRead, farRows, dim);\n                if (narrowed === READING) { awaiting(slot, \"area\"); pending.add(slot); continue; }\n                // Made over as many reads as their making takes, a frame drawing between.\n                const made = areaReader.rowsOf(kind, narrowed);\n                if (made === READING) { awaiting(slot, \"area\"); pending.add(slot); continue; }\n                const rows = made as ReadonlyMap<string, { readonly roles: unknown; readonly row: Uint8Array }>;\n                // At every zoom: a dot draws its item's status too (D45). Its rows draw while their details are read, each\n                // card holding the places of the roles they give (#1398).\n                let details: Rows<DetailsRoles> | undefined;\n                let unread: CardRoles | undefined;\n                if (kind.details.type === \"some\") {\n                    const got = areaReader.detailsOf(slot, kind.details.value, part, windowRead, keys);\n                    if (got === READING) { unread = kind.details.value.roles; awaiting(slot, \"details\"); }\n                    else if (got !== undefined) details = got as Rows<DetailsRoles>;\n                }\n                areaRows.set(slot, { rows, details, unread, reach: windowRead.window.reach });\n                // The same object while its rows hold: what the frame hands on moves only when they do.\n                windows.set(slot, areaReader.held(slot, windowRead.revision, rows));\n                if (windowRead.density !== undefined) density.set(slot, windowRead.density);\n                if (narrowed.matched !== undefined) matched.set(slot, narrowed.matched);\n            } catch (error) {\n                if (isItem) failed(slot, error, items);\n                else failed(slot, error, zones);\n            }\n        }\n\n        // What each kind draws, in the Schematic's order of its kinds.\n        for (const kind of value.items) {\n            if (pending.has(kind.key)) { carry(kind.key, items); continue; }\n            const area = areaRows.get(kind.key);\n            const keys = kindKeys(kind.keyType);\n            if (area !== undefined) { take(kind.key, keys, area.rows as Rows<ItemRoles>, area.details, sameItem, drawnItem, items, area.unread, area.reach); continue; }\n            const whole = wholeItems.find((one) => Object.is(one.kind, kind));\n            if (whole !== undefined) take(kind.key, keys, whole.rows, whole.details, sameItem, drawnItem, items, whole.unread);\n        }\n        for (const kind of value.zones) {\n            if (pending.has(kind.key)) { carry(kind.key, zones); continue; }\n            const area = areaRows.get(kind.key);\n            const keys = kindKeys(kind.keyType);\n            if (area !== undefined) {\n                take(kind.key, keys, area.rows as Rows<ValueTypeOf<typeof Schematic.Types.Zone>>, undefined, sameZone, (ref, roles) => drawnZone(ref, roles), zones,\n                    undefined, area.reach);\n                continue;\n            }\n            const whole = wholeZones.find((one) => Object.is(one.kind, kind));\n            if (whole !== undefined) take(kind.key, keys, whole.rows, undefined, sameZone, (ref, roles) => drawnZone(ref, roles), zones);\n        }\n        value.links.forEach((kind, i) => {\n            const got = linkReads[i]!;\n            if (isRefused(got)) { failed(kind.key, got.refused, links); return; }\n            if (got.type !== \"some\") { awaiting(kind.key, \"rows\"); carry(kind.key, links); return; }\n            take(kind.key, kindKeys(kind.keyType), got.value, undefined, sameLink, (ref, roles) => drawnLink(ref, roles), links);\n        });\n        value.nets.forEach((kind, i) => {\n            const got = netReads[i]!;\n            if (isRefused(got)) { failed(kind.key, got.refused, nets); return; }\n            if (got.type !== \"some\") { awaiting(kind.key, \"rows\"); carry(kind.key, nets); return; }\n            take(kind.key, kindKeys(kind.keyType), got.value, undefined, sameNet, (ref, roles) => drawnNet(ref, roles), nets);\n        });\n        const drawn = changed || kinds.size !== prior.kinds.size ? { items, zones, links, nets } : prior.drawn;\n        // The first kind in flight in the Schematic's order: what the footer's loading line names, what of it is read — and\n        // how many of its rows wait on their details — and whether its source's narrowing has moved from the one its drawing\n        // was read under, which stands in meanwhile.\n        const first = [...value.items, ...value.zones, ...value.links, ...value.nets].find((kind) => inFlight.has(kind.key))?.key;\n        const was = first === undefined ? undefined : prior.wheres.get(first);\n        const now = first === undefined ? undefined : whereOf(first);\n        let doing = first === undefined ? undefined : what.get(first) ?? \"rows\";\n        let waiting = 0;\n        if (first !== undefined && doing === \"details\") for (const kept of kinds.get(first)?.values() ?? []) if (kept.pending !== undefined && kept.drawn !== undefined) waiting += 1;\n        // Every row drawn with the details it was drawn with, standing in — a new revision of them read again: none waits,\n        // and the read is of the kind's rows in view, or whole.\n        if (first !== undefined && doing === \"details\" && waiting === 0) doing = byArea.has(first) ? \"area\" : \"rows\";\n        const reading: SchematicReading | undefined = first === undefined || doing === undefined ? undefined\n            : { slot: first, what: doing, filtering: was !== undefined && now !== undefined && !sameWhere(was, now), waiting };\n        // What the reads in flight have not drawn yet (CL2): each kind read by area whose window's rows or counts are read,\n        // the reach it reads less the reach its drawing holds — never a kind whose read failed, which says so instead.\n        const unread = unreadArea([...value.items, ...value.zones].flatMap((kind) => {\n            const doingNow = what.get(kind.key);\n            const want = areaReader.wanted(kind.key)?.reach;\n            if ((doingNow !== \"area\" && doingNow !== \"counts\") || failures.has(kind.key) || want === undefined) return [];\n            return [{ want, have: reaches.get(kind.key) }];\n        }));\n        // Whether what is drawn may be handed on: nothing in flight but details, whose rows draw meanwhile (#1398).\n        const drawable = [...inFlight].every((slot) => what.get(slot) === \"details\");\n        // The narrowing each kind's source holds now: what the drawing handed on was read under, or stands in for (CL8).\n        const narrowings = new Map<string, Where>();\n        for (const kind of [...value.items, ...value.zones, ...value.links, ...value.nets]) {\n            const where = whereOf(kind.key);\n            if (where !== undefined) narrowings.set(kind.key, where);\n        }\n        return {\n            held: { value, kinds, inputs, wheres, reaches, drawn } satisfies Held, loading, reading, narrowings, failures, windows, revisions, density, overview,\n            matched, unmade: areaReader.unmade, unread, failedAreas, drawable, fits, fitting,\n        };\n    }, [value, attempt, viewport, areaReader, makes]);\n    const { result } = useTrackedEvaluation(read);\n    // A read that left rows to make asks the next a task later: a frame draws between, each read making a budget's worth.\n    const unmade = result.ok && result.value.unmade;\n    useEffect(() => {\n        if (!unmade) return undefined;\n        const timer = setTimeout(() => setMakes((n) => n + 1), 0);\n        return () => clearTimeout(timer);\n    }, [unmade, makes]);\n    // What the last read said is read now, kept while it names the same kind the same way; and what it has not drawn yet,\n    // kept while it is the same area.\n    const readingRef = useRef<SchematicReading | undefined>(undefined);\n    const unreadRef = useRef<readonly WorldBox[]>(NO_BOXES);\n    // The last settled read: a newer one in flight keeps it, so a scan landing redraws nothing until the read is whole — but\n    // for details, whose rows draw meanwhile, each card holding their places (#1398), once a first read has settled whole:\n    // the frame opens on what its first read drew, details and all. What it holds moves with what it draws: a row added,\n    // removed, or its roles or details changed, draws anew — and the narrowing each kind's drawing was read under.\n    const settled = useRef<{\n        drawn: SchematicDrawn; failures: ReadonlyMap<string, string>; rows: ReadonlyMap<string, number>; held: SchematicHeldRows;\n        unplaced: SchematicUnplacedRows; windows: SchematicWindowRows; density: ReadonlyMap<string, SchematicDensity>;\n        overview: ReadonlyMap<string, SchematicDensity>; matched: ReadonlyMap<string, ReadonlySet<string>>;\n        failedAreas: ReadonlyMap<string, readonly WorldBox[]>; wheres: ReadonlyMap<string, Where>;\n    } | undefined>(undefined);\n    if (result.ok) {\n        const got = result.value;\n        held.current = got.held;\n        if (!got.loading || (settled.current !== undefined && got.drawable)) {\n            const rows = new Map([...got.held.kinds].map(([slot, kept]) => [slot, kept.size] as const));\n            const was = settled.current;\n            const overview = got.overview;\n            if (was === undefined || !Object.is(was.drawn, got.held.drawn) || signatureOf(was.failures) !== signatureOf(got.failures)\n                || signatureOf(was.rows) !== signatureOf(rows) || !sameEntries(was.windows, got.windows) || !sameEntries(was.density, got.density)\n                || !sameEntries(was.overview, overview) || !sameEntries(was.matched, got.matched) || !sameAreas(was.failedAreas, got.failedAreas)\n                || !sameWheres(was.wheres, got.held.wheres)) {\n                settled.current = {\n                    drawn: got.held.drawn,\n                    failures: was !== undefined && signatureOf(was.failures) === signatureOf(got.failures) ? was.failures : got.failures,\n                    rows: was !== undefined && signatureOf(was.rows) === signatureOf(rows) ? was.rows : rows,\n                    held: got.held.kinds,\n                    unplaced: unplacedOf(value, got.held.kinds),\n                    windows: was !== undefined && sameEntries(was.windows, got.windows) ? was.windows : got.windows,\n                    density: was !== undefined && sameEntries(was.density, got.density) ? was.density : got.density,\n                    overview: was !== undefined && sameEntries(was.overview, overview) ? was.overview : overview,\n                    matched: was !== undefined && sameEntries(was.matched, got.matched) ? was.matched : got.matched,\n                    failedAreas: was !== undefined && sameAreas(was.failedAreas, got.failedAreas) ? was.failedAreas : got.failedAreas,\n                    wheres: got.held.wheres,\n                };\n            }\n        }\n    }\n    const last = settled.current;\n    const loading = result.ok ? result.value.loading : false;\n    const error = result.ok ? undefined : messageOf(result.error);\n    // What the canvas draws stands in (#1398, CL8): a kind's drawing read under a narrowing its source no longer holds —\n    // but one whose read of the new one failed, which says so instead.\n    const filtering = result.ok && last !== undefined && [...result.value.narrowings].some(([slot, now]) => {\n        const was = last.wheres.get(slot);\n        return was !== undefined && !sameWhere(was, now) && !result.value.failures.has(slot);\n    });\n    // What is read now: the same object while it names the same kind the same way, so a landing that leaves it moves nothing.\n    const readingNow = result.ok ? result.value.reading : undefined;\n    const readingWas = readingRef.current;\n    const reading = readingNow !== undefined && readingWas !== undefined && sameString(readingNow.slot, readingWas.slot)\n        && readingNow.what === readingWas.what && readingNow.filtering === readingWas.filtering && readingNow.waiting === readingWas.waiting\n        ? readingWas : readingNow;\n    readingRef.current = reading;\n    const unreadNow = result.ok ? result.value.unread : NO_BOXES;\n    const unread = sameBoxes(unreadNow, unreadRef.current) ? unreadRef.current : unreadNow;\n    unreadRef.current = unread;\n    // The boxes under `fit`: the same object while they say the same, so the camera hears only a box that moves.\n    const fitsRef = useRef<ReadonlyMap<string, SchematicFit>>(NO_FITS);\n    const fitsNow = result.ok ? result.value.fits : NO_FITS;\n    const fits = sameFits(fitsNow, fitsRef.current) ? fitsRef.current : fitsNow;\n    fitsRef.current = fits;\n    const fitting = result.ok && result.value.fitting;\n    // The revision each kind read by area's record reads at now — the latest read's, never the settled one's, which a\n    // window read before it stands in: the same object while it says the same.\n    const revisionsRef = useRef<ReadonlyMap<string, string>>(NO_REVISIONS);\n    const revisionsNow = result.ok ? result.value.revisions : NO_REVISIONS;\n    const revisions = signatureOf(revisionsNow) === signatureOf(revisionsRef.current) ? revisionsRef.current : revisionsNow;\n    revisionsRef.current = revisions;\n    return useMemo((): SchematicData => (last === undefined\n        ? { ...INITIAL_SCHEMATIC_DATA, loading, reading, error, revisions, unread, fits, fitting }\n        : {\n            drawn: last.drawn, loading, reading, filtering, ready: true, error, failures: last.failures, rows: last.rows, held: last.held,\n            unplaced: last.unplaced, windows: last.windows, revisions, density: last.density, overview: last.overview, matched: last.matched,\n            unread, failedAreas: last.failedAreas, fits, fitting,\n        }),\n    [last, loading, reading, filtering, error, revisions, unread, fits, fitting]);\n}\n\n/**\n * Each item kind's rows a read holds with no position (#1389): the rows it\n * drew nothing of, each one's roles, in their keys' order (#1549) — for a kind\n * whose `x` and `y` are Options; none for a kind whose every row is placed.\n *\n * @param value - The payload the read was made under\n * @param kinds - Each kind's rows the read holds, by its slot\n * @returns The rows, by the kind's slot, then by key\n */\nfunction unplacedOf(value: SchematicValue, kinds: ReadonlyMap<string, ReadonlyMap<string, Kept>>): SchematicUnplacedRows {\n    const out = new Map<string, ReadonlyMap<string, ItemRoles>>();\n    for (const kind of value.items) {\n        if (!kind.backlog) continue;\n        const rows = new Map<string, ItemRoles>();\n        for (const [key, kept] of kinds.get(kind.key) ?? []) if (kept.drawn === undefined) rows.set(key, kept.roles as ItemRoles);\n        out.set(kind.key, rows);\n    }\n    return out;\n}\n\n/**\n * The drawing's reads, in a component of its own (#1343): each scan and page\n * that lands re-runs it alone, and it hands the frame what it read only when\n * what the frame shows moves. It hears where the canvas's viewport rests from\n * the store the canvas writes (#1393), re-reading only itself as it moves. It\n * hands the frame what it read once its own render is done, so the frame\n * draws it in a task of its own: a read that settles a window of thousands of\n * rows, and the frame drawing them, are never one long task (#1393).\n *\n * @param props - The payload, the read's attempt, the viewport's store, and where the data goes\n * @returns Nothing: it reads\n */\nexport function SchematicDataReader({ value, attempt, viewport, onData }: {\n    value: SchematicValue; attempt: number; viewport: SchematicViewportStore; onData: (data: SchematicData) => void;\n}): null {\n    const rests = useSyncExternalStore(viewport.subscribe, viewport.get, viewport.get);\n    // Only a drawing with a kind read by area reads anything where the viewport rests: any other is read once.\n    const byArea = useMemo(() => areaSlots(value).size > 0, [value]);\n    const data = useSchematicData(value, attempt, byArea ? rests : undefined);\n    const reported = useRef<SchematicData | undefined>(undefined);\n    useEffect(() => {\n        if (Object.is(reported.current, data)) return;\n        reported.current = data;\n        onData(data);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's canvas (#1387): the 2D world-coordinate drawing in its\n * frame's main — a Canvas2D paint layer and a DOM card layer under one camera,\n * the minimap and the scale bar at its foot, the minimap the whole drawing,\n * wherever the view is (`minimap.ts`, #1393). It holds no control of its own:\n * the frame's toolbar holds the tools, the zoom, Fit, Find and the steps, and\n * drives the camera through this canvas's handle ({@link SchematicCanvasHandle});\n * the tool held and the link kind Connect draws are the frame's. What it draws\n * is its reader's (`data.ts`), each kind's rows as their roles give them, the\n * editing session's drafts in place (`drafted.ts`, #1388); what its layers\n * hide, lock and dim is the frame's (`layers.ts`). Every colour and font it\n * draws is the design system's, read through the theme bridge (`theme.tsx`).\n * Each card is a component of its own (`card.tsx`), told how it stands in\n * values, so a camera move — which renders the canvas a frame at a time —\n * renders no card whose standing holds (#1393).\n * Every gesture that writes — Move, Connect and its Shift session, Retarget,\n * Extend and Del — is one step of the editing's history: the gesture's edits\n * (`edits.ts`) recorded through the frame's editing, nothing held here but a\n * Move's preview while its drag is under way. The library's Index (#1389)\n * flies to a zone or an item and selects it through the handle, and hears\n * the canvas's selection and the zone its viewport is in. The inspector\n * (#1391) selects through it what Details and Issues name — a link or a net,\n * a net's leg among them — hears the selection with the leg a stub's tap\n * selected, and is opened on Details by Enter, or a double-click on an\n * entity.\n *\n * Where a tab of the library drops (#1390), the canvas is one drop cell of the\n * shared drag layer, on the frame's drop target (`use-drop.ts`): it works out\n * where a drag rests from its own drawing (`drop.ts`' `restsAt`) — the point\n * under the pointer, at the screen's resolution, for a card that adds or\n * places an item; the entity of the card's kind under it, never a locked\n * layer's, for one that lands on an entity — and, while the drop there lands,\n * marks it: a ring at the point, or the entity's drop mark. An item a drop\n * adds or places comes back through the handle's `select`, selected where it\n * stands; a card's ⏎ asks it for the view's centre. A Connect's new link or\n * net takes its other fields from the template of its kind the library has\n * selected (§4.3).\n *\n * Its links and nets draw in the shared links look (#1403): each ends on the\n * edges of the items it joins where they draw at the zoom — a card's side, as\n * the page lays the card out, a labelled pin's edge, a dot's rim — and the one\n * under the pointer lights, named in `data-lit-link`, while no gesture is under\n * way; a tap, a hover, a drop and a selected link's handles — named in\n * `data-link-handles` while they draw — meet each one's route as the painter\n * draws it, searched through the links' R-tree.\n *\n * Below 480px of main (#1394, D15) the canvas pans, pinches and selects: the\n * frame holds no Move or Connect and gives it no drop cell, and a selected\n * link draws no handle — the inspector moves, connects, re-targets, places and\n * deletes. The frame measures main by the canvas's element, which fills it.\n *\n * While a read is in flight (#1398) it washes the area the reads have not\n * drawn yet, under its grid, with no item's shape in it (CL2); a card whose\n * details are read keeps the places of the roles they give, a placeholder in\n * each, and a marker whose status is unread draws in the placeholders' fill —\n * each on its builder's reveal clock (CL4), which the painter hears with no\n * render; and a read that failed is said once, at the top-left in view of the\n * area it failed reading, with Retry (CL11). While what it draws stands in for\n * a new narrowing (CL8) it is kept — its grid's rules dashed, its words in the\n * third ink, its items' edges and marks as they were — and retained:\n * `aria-disabled`, panning and selecting, and taking no gesture that edits.\n *\n * Its gestures, its selection funnels, its camera and its paint path are the\n * ones `CLAUDE.md` holds to its invariants: no render-phase ref write, one\n * commit-phase snapshot, the paint's identity short-circuit, the fly before\n * the commit, and hit-testing that is the drawing.\n *\n * Each is a part of its own, holding the state it owns: the camera\n * (`use-camera.ts`), the gestures (`use-gestures.ts`), the selection\n * (`use-canvas-selection.ts`), the drop's cell (`use-canvas-drop.ts`), the\n * commit-phase snapshot and the painter's call (`use-paint.ts`) and the card\n * layer (`card-layer.tsx`). The snapshot reads every part's state, and every\n * part's behaviour reads the snapshot: this component makes each part's state\n * before the snapshot and its behaviour after it, over what the parts share —\n * the items a hidden layer leaves, their culling and their tiers, the links'\n * R-tree, the narrowing's look and a failed read's box.\n *\n * @packageDocumentation\n */\n\nimport {\n    memo, useCallback, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, type KeyboardEvent, type Ref,\n} from \"react\";\nimport { Box, chakra, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport RBush from \"rbush\";\nimport { StringType, equalFor, type option } from \"@elaraai/east\";\nimport { getSomeorUndefined, type Origin } from \"@elaraai/east-ui-components\";\nimport { LoadingFailedBox, LoadingWash, useSurfaceGestures } from \"@elaraai/east-ui-components/internal\";\nimport { placedVertices, type SchematicPaintEffect } from \"./paint\";\nimport { parallelLanes as paintParallelLanes } from \"./routes\";\nimport { EMPTY_STRING_SET, type ItemBox, linkIndex } from \"./selection\";\nimport { type LodTier, type WorldBox, buildCenterTree, declutterTiers, matchesExtent, tierSize } from \"./model\";\nimport { refOfId, type SchematicDrawn, type SchematicRef } from \"./drawn\";\nimport { boxCss } from \"./camera\";\nimport { SchematicCardLayer } from \"./card-layer\";\nimport { SchematicProbe } from \"./theme\";\nimport type { SchematicLayerState } from \"./layers\";\nimport { minimapSize } from \"./minimap\";\nimport { itemFrame, pointFrame, useCamera, useCameraMoves } from \"./use-camera\";\nimport { useCanvasDrop, useCanvasDropMark } from \"./use-canvas-drop\";\nimport { NO_STANDING, useCanvasSelection, useSelectionSteps, type SchematicStanding } from \"./use-canvas-selection\";\nimport { useGestureState, useGestures } from \"./use-gestures\";\nimport { RevealTell, niceScaleLength, usePaint } from \"./use-paint\";\nimport type { SchematicDensity, SchematicViewportStore } from \"../area.js\";\nimport { areaSlots, type SchematicValue } from \"../data.js\";\nimport { dropPoint, type SchematicCanvasDrop, type SchematicDropPoint } from \"../drop.js\";\nimport type { SchematicMove, SchematicNewKey } from \"../editing.js\";\nimport type { NetLeg, SchematicEdit, SchematicKeyRefusal } from \"../edits.js\";\nimport type { SchematicWords } from \"../messages.js\";\nimport type { SchematicNarrowedLook } from \"../narrowing.js\";\nimport type { SchematicTool } from \"../tools.js\";\nimport type { ZoomRange } from \"../../shared/schedule/zoom.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** What the rail's narrowing does on the canvas (#1392, §10.3), each entity by its id. */\nexport interface SchematicCanvasNarrowing {\n    /** What draws as context: faded, drained of colour or a bare marker. */\n    readonly context: ReadonlySet<string>;\n    /** What never selects, by any path: the context, and a link or a net whose ends the narrowing hides. */\n    readonly out: ReadonlySet<string>;\n    /** The matches: what emphasis rings, the frame boxes and fit flies to. */\n    readonly matches: ReadonlySet<string>;\n    /** How context draws, and what the matches take. */\n    readonly look: SchematicNarrowedLook;\n}\n\n/** A dot's half-extent the frame wraps, in screen px: its marker and its touch slop. */\nconst DOT_FRAME_PX = 10;\n\ntype SlotStyles = Record<string, SystemStyleObject>;\ntype Pt = { x: number; y: number };\n\n/**\n * How the canvas records its gestures (#1388): the Schematic's editing, which\n * writes each gesture's edits as one step of its history.\n */\nexport interface SchematicCanvasEditing {\n    /**\n     * Records one gesture's edits as one step.\n     *\n     * @param edits - The rows it changes, and how\n     * @param origin - The gesture\n     * @param label - Its label in the history\n     * @returns The rows it moved under the keys their fields build (#1549) — none for a step that moves none; `undefined`\n     *   where nothing was recorded\n     */\n    readonly record: (edits: readonly SchematicEdit[], origin: Origin, label: string) => readonly SchematicMove[] | undefined;\n    /**\n     * A new row's key, as its kind makes one from the edit making it (`editing.ts`' `newKey`, #1549).\n     *\n     * @param made - The edit making the row, under any key\n     * @param minted - The keys the gesture has made already\n     * @returns The key, or why there is none; `undefined` while it is still to be read\n     */\n    readonly newKey: (made: SchematicEdit, minted?: ReadonlySet<string>) => SchematicNewKey | undefined;\n    /**\n     * Says why a gesture records nothing, its new row's key refused (#1549), in the footer.\n     *\n     * @param refusal - Why\n     */\n    readonly keyRefused: (refusal: SchematicKeyRefusal) => void;\n}\n\n/** LOD thresholds in px per world unit: card ⇢ labelled dot ⇢ dot. */\nconst LOD_CARD_PPU = 30;\nconst LOD_LABEL_PPU = 16;\n/** Item-count threshold for the minimap default. */\nconst MINIMAP_AUTO = 25;\n/** No kind drawing its density. */\nconst NO_DENSITY: ReadonlyMap<string, SchematicDensity> = new Map();\n/** No item's centre: what the declutter is given at the dots' zoom, where it reads none. */\nconst NO_CENTERS = buildCenterTree([]);\n/** Nothing unread. */\nconst NO_UNREAD: readonly WorldBox[] = [];\n/** How far inside the area it failed reading a failure's message box sits, from its top-left in view (CL11), in px — and its least room from the canvas's right. */\nconst FAILED_INSET_PX = 16;\n\n/** What the frame drives the camera and the selection by: its toolbar's zoom, Fit, Find and steps, and the library's Index. */\nexport interface SchematicCanvasHandle {\n    /** Zooms about the canvas's middle by a factor. */\n    zoomBy(factor: number): void;\n    /** Fits the drawing in view. */\n    fit(): void;\n    /** Steps the selection to the previous item, or the next, flying to it. */\n    step(delta: 1 | -1): void;\n    /**\n     * Flies to an entity, by its id, and selects it alone: Find's pick and the Index's (#1389) — an item or a zone —\n     * and the inspector's (#1391), which also names a link or a net, and a net's leg with it. `undefined` selects\n     * nothing, the camera where it is. `avoid` is a box on the page over the canvas — a conflicts popover open from\n     * the toolbar — the flight lands beside, in the part of the view it leaves clear.\n     */\n    reveal(id: string | undefined, leg?: NetLeg, avoid?: DOMRectReadOnly): void;\n    /**\n     * Selects an entity alone, by its id, once the drawing draws it — the item a drop added or placed (#1390), and what\n     * Find's pick or Go to issue finds off the drawing, the choices that hid it cleared (#1404, #1391): an item, a zone,\n     * or a link or a net, selected where it stands, the camera where it is. One the next drawing doesn't draw — its layer\n     * hidden, the rail narrowing it out — selects nothing.\n     */\n    select(id: string): void;\n    /** The view's centre, at the screen's resolution: where a card's ⏎ adds or places an item (#1390); `undefined` while the canvas has no size. */\n    centre(): SchematicDropPoint | undefined;\n    /**\n     * Flies to a world point, framing the 8 × 6 units a fly to an item frames about it, and selects nothing: where Find's\n     * pick lands on an item the canvas doesn't draw as itself — the rail's filters hide it, or its layer does (#1404).\n     */\n    look(x: number, y: number): void;\n    /**\n     * Hears a key from inside the frame as it leaves it — the frame's own keys first (#1398): Space, Ctrl, Del and Esc,\n     * the canvas's while the pointer is over it (invariant 16), each it acts on taken there, going no further.\n     */\n    key(event: KeyboardEvent<HTMLElement>): void;\n}\n\n/** Props of {@link SchematicCanvas}. */\nexport interface SchematicCanvasProps {\n    /** The payload, decoded. */\n    readonly value: SchematicValue;\n    /** What the canvas draws: its reader's stored rows, the editing session's drafts in place (#1388). */\n    readonly data: SchematicDrawn;\n    /** What the layers hide, lock and dim. */\n    readonly layers: SchematicLayerState;\n    /** What the rail's narrowing does (#1392): what draws as context, what never selects, and the matches. */\n    readonly narrowing: SchematicCanvasNarrowing;\n    /** The items holding a conflict not yet chosen, by key: each wears the conflicts' warn ring. None by default. */\n    readonly conflicted?: ReadonlySet<string> | undefined;\n    /** The items whose rows break their fields' bounds (#1585), stored or changed, by key: each wears the same warn ring. None by default. */\n    readonly bounded?: ReadonlySet<string> | undefined;\n    /** The tool held. */\n    readonly tool: SchematicTool;\n    /** The link kind Connect draws; `undefined` where no link kind is editable. */\n    readonly linkKind: string | undefined;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /** How the canvas records its gestures; `undefined` where no record is edited. */\n    readonly editing: SchematicCanvasEditing | undefined;\n    /** Told why a gesture was refused — a Delete a read-only link or net blocks — or, `undefined`, that one has been recorded since. */\n    readonly onRefused: (words: string | undefined) => void;\n    /**\n     * Told as the viewer acts on the canvas: a press on it, or a move of its camera — a pan, the wheel, a pinch, a zoom,\n     * Fit, the minimap, a fly. A resize is no action: the camera it moves tells nothing. The frame hears it while the footer\n     * says why a gesture was refused, the words going at the viewer's next action (hand retest, 27 Oct 2026).\n     */\n    readonly onAction?: (() => void) | undefined;\n    /**\n     * Told what is selected — the items, the zones, and the link or the net — by their ids, and the net's leg when a\n     * stub is selected (#1391), as that changes.\n     */\n    readonly onSelection: (ids: ReadonlySet<string>, leg: NetLeg | null) => void;\n    /** Told when Enter, or a double-click on an entity, opens the selection in the inspector's Details (#1391, D34); `undefined` with no inspector. */\n    readonly onOpen?: (() => void) | undefined;\n    /** Told the zone the viewport is in, by its id — `undefined` for none — as that changes (#1389): the Index marks it. */\n    readonly onZoneInView?: ((zone: string | undefined) => void) | undefined;\n    /** The canvas's drop cell, where a tab of the library drops (#1390); `undefined`, it takes no drop. */\n    readonly drop?: SchematicCanvasDrop | undefined;\n    /**\n     * What a Connect's new link or net takes its other fields from, by its kind's slot (§4.3, #1390): the values of the\n     * template of that kind the library has selected; `none`, their types' defaults.\n     */\n    readonly connectValues: (slot: string) => option<Uint8Array>;\n    /**\n     * Where the canvas writes its viewport as its camera comes to rest (#1393): what a kind read by area reads its window\n     * around; `undefined`, it writes nowhere.\n     */\n    readonly viewport?: SchematicViewportStore | undefined;\n    /** Each kind read by area drawing its density in place of its items (D25), by its slot: the raster painted under them. */\n    readonly density?: ReadonlyMap<string, SchematicDensity> | undefined;\n    /** Each kind read by area's whole drawing's density, by its slot: what the minimap draws of it, wherever the view is (#1393). */\n    readonly overview?: ReadonlyMap<string, SchematicDensity> | undefined;\n    /** Whether a read the drawing needs is in flight: an item a drop or a pick asks to select is waited for until it lands. */\n    readonly reading?: boolean | undefined;\n    /**\n     * What is selected that the drawing doesn't draw and still stands (#1393): each row of a kind read by area its window\n     * doesn't hold, read by its key — kept selected, never heard of as a camera moves, and deleted by Del with the rest.\n     */\n    readonly standing?: SchematicStanding | undefined;\n    /** What `fit` flies the camera to as the narrowing changes (§10.3): keyed on the narrowing itself, a kind read by area by its box. */\n    readonly fit?: SchematicCanvasFit | undefined;\n    /** What the reads in flight have not drawn yet, in world units, as disjoint boxes (#1398, CL2): washed, under the grid, until they land. */\n    readonly unread?: readonly WorldBox[] | undefined;\n    /** A read that failed, said once where it happened (CL11), with Retry; `undefined` while none has. */\n    readonly failure?: SchematicCanvasFailure | undefined;\n    /**\n     * Whether what it draws stands in for a new narrowing while that is read (#1398, the loading design's retained card):\n     * kept — its grid's rules dashed and its words, a card's, a pin's and a caption's, in the third ink — its items' edges\n     * and marks as they were.\n     */\n    readonly stale?: boolean | undefined;\n    /**\n     * Whether what it draws is retained (#1398, CL8): readable, focusable and selectable — a press pans and a tap selects\n     * — and taking no gesture that edits: no Move, Connect, re-target or Del, a selected link's handles gone, and no drop\n     * on its cell. It is `aria-disabled` but while a read's failure is said on it, its Retry in it.\n     */\n    readonly retained?: boolean | undefined;\n    /** Told whether the zoom stands at Fit and at its limit, as either changes (#1393): the toolbar's Zoom out and Zoom in take no press there. */\n    readonly onZoomRange?: ((range: ZoomRange) => void) | undefined;\n    /**\n     * Whether main is below 480px (#1394, D15): the canvas pans, pinches and selects, and a selected link draws no handle\n     * and takes no re-target's drag — the inspector's ends re-target it. The frame offers no Move or Connect there, and\n     * gives the canvas no drop cell.\n     */\n    readonly narrow?: boolean | undefined;\n    /** Hears the canvas's element as it mounts, and `null` as it goes (#1394): the canvas fills main, whose width the frame measures by it. */\n    readonly onElement?: ((element: HTMLDivElement | null) => void) | undefined;\n    /** The canvas's handle, the frame's. */\n    readonly ref?: Ref<SchematicCanvasHandle> | undefined;\n}\n\n/**\n * A read that failed, as the canvas says it once where it happened (#1398, CL11): in the message box, at the top-left in\n * view of the area it failed reading, with Retry.\n */\nexport interface SchematicCanvasFailure {\n    /** Its words: `Couldn't read this area`, or the kind's or the drawing's, `Couldn't read racks`. */\n    readonly message: string;\n    /** Asks it again. */\n    readonly retry: () => void;\n    /** The area it failed reading, in world units; `undefined` for a kind read whole, or the drawing's read — said at the canvas's top-left. */\n    readonly area: readonly WorldBox[] | undefined;\n}\n\n/**\n * What `fit` flies the camera to (§10.3, #1393): the narrowing it is keyed on — each source's choices, printed — and\n * whether what it flies to is read, and the box each kind read by area's narrowing's rows stand in, as its area index\n * answers it: never what its window draws.\n */\nexport interface SchematicCanvasFit {\n    /** The narrowing the fly is keyed on; `undefined` while nothing narrows, or the Schematic takes no `fit`. */\n    readonly key: string | undefined;\n    /** Whether what it flies to is read: the drawing, a source's matches, a kind read by area's box. */\n    readonly reading: boolean;\n    /** The box the kinds read by area's narrowing's rows stand in, in world units; `undefined` for none. */\n    readonly box: WorldBox | undefined;\n}\n\n/** No fit. */\nconst NO_FIT: SchematicCanvasFit = { key: undefined, reading: false, box: undefined };\n\n/**\n * The Schematic's canvas (see the module docs): map-grade navigation — wheel\n * zoom about the cursor, drag pan, animated fly-to, semantic zoom (status dots\n * ⇢ labelled dots ⇢ full cards), rbush viewport culling, an adaptive scale bar\n * and a minimap with a draggable viewport — and its gestures, each one step of\n * the editing's history.\n */\nexport const SchematicCanvas = memo(function SchematicCanvas({\n    value, data, layers, narrowing, conflicted = EMPTY_STRING_SET, bounded = EMPTY_STRING_SET, tool, linkKind, words, editing, onRefused, onAction, onSelection, onOpen,\n    onZoneInView, drop, connectValues,\n    viewport, density = NO_DENSITY, overview = NO_DENSITY, reading = false, standing = NO_STANDING, fit = NO_FIT, unread = NO_UNREAD, failure, stale = false,\n    retained = false, onZoomRange, narrow = false, onElement, ref,\n}: SchematicCanvasProps) {\n    // The recipe's styles, resolved once a recipe: the canvas renders at every frame its camera moves.\n    const recipe = useSlotRecipe({ key: \"schematic\" });\n    const styles = useMemo(() => recipe() as SlotStyles, [recipe]);\n    const { width: W, height: H } = value.extent;\n    // What never selects, by any path — a tap, the marquee, the steps, a drop, a reveal — and lets go of what is\n    // selected: a locked layer's entities (SC27), and what the narrowing takes out, its context among them (#1392).\n    const { context, out: narrowedOut, matches, look } = narrowing;\n    const inertKeys = useMemo(() => (narrowedOut.size === 0 ? layers.locked : new Set([...layers.locked, ...narrowedOut])), [layers.locked, narrowedOut]);\n\n    const scaleUnit = getSomeorUndefined(value.scaleUnit);\n    const showGrid = getSomeorUndefined(value.grid) ?? true;\n    // Shown by default from 25 items — and for a kind read by area, whose drawing is past any count of items its window\n    // holds, its whole drawing's density the minimap's (D25, #1393).\n    const showMinimap = getSomeorUndefined(value.minimap) ?? (data.items.length >= MINIMAP_AUTO || density.size > 0 || overview.size > 0);\n\n    // Each entity's reference by its id on the canvas: what the host hears an\n    // entity named by — the links and nets drafted among them, each under its\n    // kind's slot and its minted key (#1401, D34).\n    const refById = useMemo(() => {\n        const refs = new Map<string, SchematicRef>();\n        for (const entity of [...data.items, ...data.zones, ...data.links, ...data.nets]) refs.set(entity.key, entity.ref);\n        return refs;\n    }, [data.items, data.zones, data.links, data.nets]);\n    // Each item's label by its id: what a refusal's words name it by.\n    const labelById = useMemo(() => new Map(data.items.map((item) => [item.key, item.label] as const)), [data.items]);\n\n    // What is selected — its items, its zones, and its link or net — through its funnels, heard once after each gesture\n    // (`use-canvas-selection.ts`).\n    const canvasSelection = useCanvasSelection({ value, refById, onSelection });\n    const { selectedLink, selected, commitSelection, commitLinkSelection, commitZoneSelection } = canvasSelection;\n    // The gestures' state (`use-gestures.ts`): the tool in force, a Move's preview, Connect's draft and its flash, the box\n    // in flight and the link lit.\n    const gestureState = useGestureState({ value, tool, narrow, retained, refById, selectedLink, selected });\n    const { lit, setLit, selectedLinkEditable, dragMoves, setTempTool, effectiveTool, connectDraft, selRect, marqueeCount } = gestureState;\n    // Where a library card's drag rests over the canvas, marked (`use-canvas-drop.ts`).\n    const { dragging, dropMark, setDropMark } = useCanvasDropMark();\n    // A Move's preview (`use-gestures.ts`' `dragMoves`), applied UPSTREAM of the working set (invariant 4).\n    const movedItems = useMemo(() => {\n        if (dragMoves.size === 0) return data.items;\n        return data.items.map(it => {\n            const m = dragMoves.get(it.key);\n            return m !== undefined ? { ...it, x: m.x, y: m.y } : it;\n        });\n    }, [data.items, dragMoves]);\n    // The ONE seam into the painter: what the canvas draws, its items where a\n    // Move's preview has them. Built over the drawing's identity, so a\n    // closure-only change never repaints.\n    const paintValue = useMemo(() => (dragMoves.size > 0 ? { ...data, items: movedItems } : data), [data, movedItems, dragMoves]);\n\n    // --- Layers: what the frame's layer state hides, locks and dims. ----------\n    const layerHiddenKeys = layers.hidden;\n    const lockedKeys = layers.locked;\n    const layerAlpha = layers.alpha;\n\n    // The item working set: layer-hidden is a HARD pre-filter (an off layer means\n    // \"not at all\"). Propagates for free to centers / rbush index / visibleItems /\n    // LOD / the stepping order.\n    const items = useMemo(() => {\n        if (layerHiddenKeys.size === 0) return movedItems;\n        return movedItems.filter(it => !layerHiddenKeys.has(it.key));\n    }, [movedItems, layerHiddenKeys]);\n\n    // Zones are read at several surfaces (minimap, labels, the stepping order);\n    // drop hidden-layer zones once here. Links are filtered inside paint.\n    const shownZones = useMemo(\n        () => layerHiddenKeys.size === 0 ? data.zones : data.zones.filter(z => !layerHiddenKeys.has(z.key)),\n        [data.zones, layerHiddenKeys],\n    );\n    // What the minimap draws (#1393): the whole drawing — each kind read by area as its whole drawing's density, never only\n    // the items its window holds, and each item of a kind read whole as a dot (`minimap.ts`).\n    const areaKinds = useMemo(() => areaSlots(value), [value]);\n    const minimapItems = useMemo(() => items.filter((item) => !areaKinds.has(item.ref.kind)), [items, areaKinds]);\n    const minimapDensities = useMemo(() => [...overview.values()], [overview]);\n    const minimapCells = useMemo(() => minimapDensities.reduce((n, raster) => n + raster.cells.length, 0), [minimapDensities]);\n\n    const canvasRef = useRef<HTMLDivElement | null>(null);\n    // The camera: its live ref and its snapshot, the canvas's size and its pixel ratio, Fit's camera and the zoom's limit\n    // (`use-camera.ts`).\n    const camera = useCamera({ canvasRef, W, H, items });\n    const { size, cameraRef, cameraSnapshot, ppu } = camera;\n\n    // The minimap's size: the drawing at its aspect, 150px wide at most, and no more than a quarter of the canvas's width\n    // or a third of its height, so a phone's keeps to its corner (#1393).\n    const minimapBox = useMemo(() => (size === null ? undefined : minimapSize(size, { width: W, height: H })), [size, W, H]);\n\n    const centers = useMemo(() => {\n        const out = new Map<string, Pt>();\n        for (const item of items) out.set(item.key, { x: item.x, y: item.y });\n        return out;\n    }, [items]);\n    // Each item drawn, by its id: what a link's end is worked out over (#1403).\n    const itemById = useMemo(() => new Map(items.map((item) => [item.key, item] as const)), [items]);\n\n    // The links' lanes (#180), as the painter fans them, and the links' R-tree (#1403): what a hover, a tap and a drop\n    // search for the link or the net under a point, so a pointer's move costs what is near it, never every link.\n    const lanes = useMemo(() => paintParallelLanes(data.links, l =>\n        !layerHiddenKeys.has(l.key) && centers.has(l.from) && centers.has(l.to) && l.via.length === 0), [data.links, layerHiddenKeys, centers]);\n    const linkTree = useMemo(() => linkIndex(data.links, data.nets, centers, layerHiddenKeys, lanes), [data.links, data.nets, centers, layerHiddenKeys, lanes]);\n    const linkById = useMemo(() => new Map(data.links.map((link) => [link.key, link] as const)), [data.links]);\n    const netById = useMemo(() => new Map(data.nets.map((net) => [net.key, net] as const)), [data.nets]);\n    // The link lit, while it still draws and takes the pointer: one gone, hidden, locked or out of the narrowing lights nothing.\n    const litShown = lit !== undefined && (linkById.has(lit) || netById.has(lit)) && !layerHiddenKeys.has(lit) && !inertKeys.has(lit) ? lit : undefined;\n\n    // World-resolved connect visuals (#176): the draft edge (from the item it\n    // runs from to the cursor or the target it snaps to, each named, so the\n    // painter ends it on their edges, #1403) and the open session's edges.\n    const connectDraftWorld = useMemo(() => {\n        if (connectDraft === null) return undefined;\n        const from = centers.get(connectDraft.from);\n        if (from === undefined) return undefined;\n        const to = connectDraft.target !== undefined ? (centers.get(connectDraft.target) ?? connectDraft.toWorld) : connectDraft.toWorld;\n        return {\n            from, to, fromKey: connectDraft.from, snapped: connectDraft.target !== undefined,\n            ...(connectDraft.target !== undefined ? { toKey: connectDraft.target } : {}),\n            ...(connectDraft.forbidden !== undefined ? { forbiddenKey: connectDraft.forbidden } : {}),\n        };\n    }, [connectDraft, centers]);\n    // The link a retarget moves, drawn as its `was` line while its end is dragged (#1403).\n    const wasLink = connectDraft?.retarget;\n    // Spatial index for viewport culling (item half-extent ~2.4 world units\n    // covers the widest constant-size marker at the card threshold).\n    const index = useMemo(() => {\n        const tree = new RBush<ItemBox>();\n        tree.load(items.map(item => {\n            const hw = (getSomeorUndefined(item.width) ?? 0) / 2 + 2.4;\n            const hh = (getSomeorUndefined(item.height) ?? 0) / 2 + 2;\n            let minX = item.x - hw, minY = item.y - hh, maxX = item.x + hw, maxY = item.y + hh;\n            // A footprint can reach past the marker box — union its world\n            // bbox in so the shape isn't culled when the anchor leaves view.\n            const fp = getSomeorUndefined(item.footprint);\n            if (fp !== undefined && fp.type === \"circle\") {\n                const r = fp.value.radius;\n                minX = Math.min(minX, item.x - r); minY = Math.min(minY, item.y - r);\n                maxX = Math.max(maxX, item.x + r); maxY = Math.max(maxY, item.y + r);\n            } else if (fp !== undefined && fp.type !== \"rect\") {\n                // Its vertices are offsets from the item's centre (D22).\n                for (const v of placedVertices(item, fp.value.vertices)) {\n                    minX = Math.min(minX, v.x); minY = Math.min(minY, v.y);\n                    maxX = Math.max(maxX, v.x); maxY = Math.max(maxY, v.y);\n                }\n            }\n            return { minX, minY, maxX, maxY, item };\n        }));\n        return tree;\n    }, [items]);\n\n    const visibleItems = useMemo(() => {\n        if (size === null || ppu === 0) return [];\n        return index.search({\n            minX: -cameraSnapshot.tx / ppu, minY: -cameraSnapshot.ty / ppu,\n            maxX: (size.w - cameraSnapshot.tx) / ppu, maxY: (size.h - cameraSnapshot.ty) / ppu,\n        }).map(b => b.item);\n    }, [index, size, ppu, cameraSnapshot]);\n\n    const lod: LodTier = ppu >= LOD_CARD_PPU ? \"card\" : ppu >= LOD_LABEL_PPU ? \"label\" : \"dot\";\n\n    // --- A read that failed (#1398, CL11): said once, at the top-left in view of the area it failed reading. ---\n    // The area's first box in view, topmost then leftmost, at its top-left — the canvas's own for a read with no area —\n    // inset; none while the area is out of view, the footer's line saying it still. Its box measured as it lays out, so\n    // it stays inside the canvas however near its right edge the area begins.\n    const [failedWidth, setFailedWidth] = useState(0);\n    const failedAt = useMemo(() => {\n        if (failure === undefined || size === null || ppu === 0) return undefined;\n        let at: { x: number; y: number } | undefined;\n        if (failure.area === undefined) at = { x: 0, y: 0 };\n        else {\n            const view = {\n                minX: -cameraSnapshot.tx / ppu, minY: -cameraSnapshot.ty / ppu,\n                maxX: (size.w - cameraSnapshot.tx) / ppu, maxY: (size.h - cameraSnapshot.ty) / ppu,\n            };\n            for (const box of failure.area) {\n                const minX = Math.max(box.minX, view.minX), minY = Math.max(box.minY, view.minY);\n                if (minX >= Math.min(box.maxX, view.maxX) || minY >= Math.min(box.maxY, view.maxY)) continue;\n                const sx = minX * ppu + cameraSnapshot.tx, sy = minY * ppu + cameraSnapshot.ty;\n                if (at === undefined || sy < at.y || (sy === at.y && sx < at.x)) at = { x: sx, y: sy };\n            }\n        }\n        if (at === undefined) return undefined;\n        const left = Math.max(FAILED_INSET_PX, Math.min(at.x + FAILED_INSET_PX, size.w - FAILED_INSET_PX - failedWidth));\n        return { top: at.y + FAILED_INSET_PX, left };\n    }, [failure, size, ppu, cameraSnapshot, failedWidth]);\n    useLayoutEffect(() => {\n        const box = failedAt === undefined ? null : canvasRef.current?.querySelector<HTMLElement>(\"[data-loading-failed-box]\") ?? null;\n        const width = box === null ? 0 : box.offsetWidth;\n        if (width !== failedWidth) setFailedWidth(width);\n    }, [failedAt, failedWidth]);\n\n    // Every item drawn by its centre — never only the viewport's: what an item keeps clear of, so a pan never changes\n    // what it draws as (#1393). Built only where the declutter reads it: at the dots' zoom every item is a dot, and a\n    // window of thousands of rows lands there.\n    const dotZoom = lod === \"dot\";\n    const centerTree = useMemo(() => (dotZoom ? NO_CENTERS : buildCenterTree(items)), [items, dotZoom]);\n    const tiers = useMemo(() => {\n        const base = declutterTiers(visibleItems, centerTree, lod, ppu, selected);\n        // `dot` (§10.3): what draws as context is a bare marker, so the matches stand out.\n        if (look.dot) for (const key of context) if (base.has(key)) base.set(key, \"dot\");\n        return base;\n    }, [visibleItems, centerTree, lod, ppu, selected, look.dot, context]);\n\n    // --- The narrowing (#1392, §10.3): context faded, the matches ringed, framed and flown to. ---\n    // The matches the canvas draws: what the frame boxes, at the zoom — each item by what it draws as, a card, a pin or\n    // a dot — a frame wrapping two at least, as a lone match needs no box.\n    const frameRect = useMemo(() => {\n        if (!look.frame || ppu === 0) return undefined;\n        const spanned = matchesExtent({ ...paintValue, items }, matches, layerHiddenKeys, centers, (item) => {\n            const px = lod === \"dot\" ? { w: DOT_FRAME_PX, h: DOT_FRAME_PX } : { w: tierSize(item, lod, ppu).w / 2 + 2, h: tierSize(item, lod, ppu).h / 2 + 2 };\n            return { w: px.w / ppu, h: px.h / ppu };\n        });\n        return spanned !== undefined && spanned.count >= 2 ? spanned.box : undefined;\n    }, [look.frame, paintValue, items, matches, layerHiddenKeys, centers, lod, ppu]);\n    // What fit flies to: the matches' world box, each item by its own box — a lone item's at least the 8 × 6 a fly to\n    // an item frames — of the kinds read whole or complete, and each kind read by area's narrowing's box as its area index\n    // answers it, grown so: never what a window draws, which holds only what is near the view (#1393).\n    const fitMatches = useMemo(() => (areaKinds.size === 0 ? matches\n        : new Set([...matches].filter((id) => { const ref = refOfId(id); return ref === undefined || !areaKinds.has(ref.kind); }))), [matches, areaKinds]);\n    const fitBox = useMemo(() => {\n        if (!look.fit) return undefined;\n        const spanned = matchesExtent({ ...paintValue, items }, fitMatches, layerHiddenKeys, centers, (item) => ({\n            w: Math.max((getSomeorUndefined(item.width) ?? 0) / 2, 4), h: Math.max((getSomeorUndefined(item.height) ?? 0) / 2, 3),\n        }))?.box;\n        const area = fit.box === undefined ? undefined : { minX: fit.box.minX - 4, minY: fit.box.minY - 3, maxX: fit.box.maxX + 4, maxY: fit.box.maxY + 3 };\n        if (spanned === undefined || area === undefined) return spanned ?? area;\n        return { minX: Math.min(spanned.minX, area.minX), minY: Math.min(spanned.minY, area.minY), maxX: Math.max(spanned.maxX, area.maxX), maxY: Math.max(spanned.maxY, area.maxY) };\n    }, [look.fit, paintValue, items, fitMatches, layerHiddenKeys, centers, fit.box]);\n    // What the painter draws of it, but the pulse's phase, which its ticker moves without a render: engaged while it\n    // draws anything — context, or a match to ring or frame.\n    const ringed = look.emphasis !== undefined && matches.size > 0;\n    const paintEffect = useMemo((): Omit<SchematicPaintEffect, \"pulsePhase\"> | undefined => {\n        if (context.size === 0 && !ringed && frameRect === undefined) return undefined;\n        return {\n            excluded: context, excludedOpacity: look.opacity, excludedDesaturate: look.desaturate,\n            matches, emphasis: ringed ? look.emphasis : undefined, frame: frameRect,\n        };\n    }, [context, ringed, frameRect, look.opacity, look.desaturate, look.emphasis, matches]);\n\n    const scaleLen = ppu > 0 ? niceScaleLength(ppu, 100) : 0;\n\n    // A marker's warn ring is one, a conflict's or a broken bound's (#1585): the painter rings each item either names, the\n    // set kept while both are, as its short-circuit compares it.\n    const warned = useMemo(() => (bounded.size === 0 ? conflicted : conflicted.size === 0 ? bounded : new Set([...conflicted, ...bounded])),\n        [conflicted, bounded]);\n    // The commit-phase snapshot, the paint's identity short-circuit and the painter's call (`use-paint.ts`).\n    const paint = usePaint({\n        value, data, paintValue, visibleItems, tiers, centers, layerHiddenKeys, layerAlpha, connectDraftWorld, litShown, wasLink, dropMark, paintEffect, fitBox,\n        density, stale, retained, showMinimap, minimapBox, shownZones, minimapDensities, minimapItems, look, matches, conflicted: warned, camera, canvasSelection,\n        gestureState,\n    });\n    const {\n        drawRef, cardSizesRef, applyCardSizes, cardLayerRef, gridRef, washLayerRef, tintIndex, probeRef, renderSelected, renderSnapRef, onReveal,\n        minimapPaintRef,\n    } = paint;\n    // What moves the camera, and what the camera tells as it moves (`use-camera.ts`).\n    const cameraMoves = useCameraMoves({ canvasRef, W, H, lod, shownZones, narrowedOut, onZoneInView, viewport, onZoomRange, onAction, narrowingFit: fit, fitBox, camera, paint });\n    const { transition, flyTo, resetView, zoomBy, minimapJump } = cameraMoves;\n    // What keeps the selection to the drawing, and the steps through its items (`use-canvas-selection.ts`).\n    const selectionSteps = useSelectionSteps({ data, layers, inertKeys, narrowedOut, items, shownZones, standing, reading, canvasSelection, renderSnapRef, flyTo });\n    const { clearZoneSelection, flyToItem, stepSelection, pendingSelectRef, setSelectAsked } = selectionSteps;\n    // The gestures' handlers (`use-gestures.ts`): the pointer's over the mode machine, the keys and the taps.\n    const {\n        hoveredRef, onCanvasKeyDown, onFrameKeyDown, itemKeyAt, zoneKeyAt, linkKeyAt, surface, onCanvasDoubleClick,\n    } = useGestures({\n        value, data, layers, tool, linkKind, words, editing, onRefused, onOpen, connectValues, W, H, canvasRef, refById, labelById, inertKeys, narrowedOut,\n        shownZones, standing, visibleItems, tiers, lod, index, itemById, lanes, linkTree, linkById, netById, dragging, canvasSelection, selectionSteps, camera,\n        cameraMoves, paint, gestureState,\n    });\n    // The canvas's drop cell: where a library card's drag rests over it, marked (`use-canvas-drop.ts`).\n    const dropCell = useCanvasDrop({ value, drop, canvasRef, refById, inertKeys, size, cameraRef, renderSnapRef, itemKeyAt, zoneKeyAt, linkKeyAt, setDropMark });\n    // The minimap is a surface of its own inside the canvas (invariant 34): a press jumps the camera to where it lands\n    // and its drag follows, the pointer that pressed alone — over as that pointer lifts, is taken back by the browser or\n    // loses its capture, so no drag is left standing to follow every later pointer over the minimap. The canvas hears\n    // none of a pointer the minimap holds (`contained`).\n    const minimapSurface = useSurfaceGestures({\n        press: (e) => {\n            transition(\"cancel\");   // cancels a running fly via the mode machine\n            minimapJump(e.currentTarget as HTMLElement, e.clientX, e.clientY);\n        },\n        drag: (e) => minimapJump(e.currentTarget as HTMLElement, e.clientX, e.clientY),\n        // Each move has already jumped the camera: neither end has more to do.\n        release: () => undefined,\n        drop: () => undefined,\n    }, { contained: true });\n    const setCanvasElement = useCallback((el: HTMLDivElement | null) => {\n        canvasRef.current = el;\n        dropCell(el);\n        onElement?.(el);\n    }, [dropCell, onElement]);\n\n    // The frame's toolbar drives the camera and the selection through the handle:\n    // its zoom, Fit, its steps and Find's pick, which flies to an item and selects it.\n    useImperativeHandle(ref, () => ({\n        zoomBy,\n        fit: resetView,\n        step: (delta) => stepSelection(delta),\n        reveal: (id, leg, avoid) => {\n            // What covers the canvas from its right, kept clear of the flight: a box over the canvas's height, at its side.\n            const clear = (() => {\n                const el = canvasRef.current;\n                if (avoid === undefined || el === null) return 0;\n                const box = el.getBoundingClientRect();\n                if (avoid.right <= box.left || avoid.left >= box.right || avoid.bottom <= box.top || avoid.top >= box.bottom) return 0;\n                return box.right - Math.max(avoid.left, box.left);\n            })();\n            // Nothing: the selection let go, the camera where it is (#1391).\n            if (id === undefined) {\n                commitSelection(EMPTY_STRING_SET);\n                clearZoneSelection();\n                commitLinkSelection(null);\n                return;\n            }\n            // An entity on a locked layer, or the narrowing takes out, is flown to and never selected (SC27, #1392).\n            const item = items.find(it => stringEqual(it.key, id));\n            if (item !== undefined) {\n                const size = renderSnapRef.current.size;\n                if (inertKeys.has(item.key)) flyTo(size === null ? pointFrame(item) : itemFrame(item, size), clear);\n                else flyToItem(item, clear);\n                return;\n            }\n            // A zone: the camera flies to its box, and the zone alone is selected (#1389).\n            const zone = shownZones.find(z => stringEqual(z.key, id));\n            if (zone !== undefined) {\n                flyTo({ x: zone.x, y: zone.y, w: zone.width, h: zone.height }, clear);\n                if (inertKeys.has(zone.key)) return;\n                commitSelection(EMPTY_STRING_SET);\n                commitLinkSelection(null);\n                commitZoneSelection(new Set([zone.key]));\n                return;\n            }\n            // A link or a net (#1391): the camera flies to the box its items and its waypoints span, and it alone is\n            // selected — a net's leg with it. One on a hidden layer is drawn nowhere, and goes unselected.\n            const link = data.links.find(l => stringEqual(l.key, id));\n            const net = link === undefined ? data.nets.find(n => stringEqual(n.key, id)) : undefined;\n            if ((link === undefined && net === undefined) || layerHiddenKeys.has(id)) return;\n            const members = link !== undefined ? [link.from, link.to] : [...net!.sources, ...net!.destinations];\n            const points = [...members.flatMap(m => { const c = centers.get(m); return c === undefined ? [] : [c]; }), ...(link ?? net!).via];\n            if (points.length > 0) {\n                const minX = Math.min(...points.map(p => p.x)), maxX = Math.max(...points.map(p => p.x));\n                const minY = Math.min(...points.map(p => p.y)), maxY = Math.max(...points.map(p => p.y));\n                const w = Math.max(maxX - minX, 8), h = Math.max(maxY - minY, 6);\n                flyTo({ x: (minX + maxX - w) / 2, y: (minY + maxY - h) / 2, w, h }, clear);\n            }\n            if (inertKeys.has(id)) return;\n            commitSelection(EMPTY_STRING_SET);\n            clearZoneSelection();\n            commitLinkSelection({ key: id, leg: leg ?? null });\n        },\n        select: (id) => {\n            // Asked as a drop records itself, or as Go to issue clears the choices that hid a draft: it draws in a drawing\n            // to come — the one holding the draft, or the narrowing left.\n            pendingSelectRef.current = { id, seen: renderSnapRef.current.drawn };\n            setSelectAsked((n) => n + 1);\n        },\n        centre: () => {\n            const snap = renderSnapRef.current;\n            if (snap.size === null || snap.fit === 0) return undefined;\n            const cam = cameraRef.current;\n            const ppuLive = snap.fit * cam.zoom;\n            return dropPoint({ x: (snap.size.w / 2 - cam.tx) / ppuLive, y: (snap.size.h / 2 - cam.ty) / ppuLive }, ppuLive);\n        },\n        look: (x, y) => flyTo(pointFrame({ x, y })),\n        key: onFrameKeyDown,\n    }), [zoomBy, resetView, stepSelection, items, inertKeys, flyToItem, shownZones, flyTo, commitSelection, commitLinkSelection, commitZoneSelection,\n        clearZoneSelection, data.links, data.nets, centers, layerHiddenKeys, renderSnapRef, cameraRef, pendingSelectRef, setSelectAsked, onFrameKeyDown]);\n\n    return (\n        <Box\n            ref={setCanvasElement}\n            css={styles.canvas}\n            data-schematic-canvas=\"\"\n            data-tool={effectiveTool}\n            data-lod={lod}\n            // What stands in for a new narrowing (#1398): kept, as the recipe draws it, and retained — readable, focusable\n            // and selectable, taking no edit — but while a failure is said on it, its Retry in it.\n            {...(stale ? { \"data-schematic-stale\": \"\" } : {})}\n            {...(retained && failure === undefined ? { \"aria-disabled\": true } : {})}\n            {...(litShown !== undefined ? { \"data-lit-link\": litShown } : {})}\n            {...(selectedLinkEditable && selectedLink !== null ? { \"data-link-handles\": selectedLink.key } : {})}\n            {...(connectDraft?.forbidden !== undefined ? { \"data-forbidden\": \"\" } : {})}\n            tabIndex={0}\n            role=\"application\"\n            aria-label={words.m.canvasLabel()}\n            onKeyDown={onCanvasKeyDown}\n            onPointerEnter={() => { hoveredRef.current = true; }}\n            onPointerLeave={() => { hoveredRef.current = false; setTempTool(null); setLit(undefined); }}\n            // Its pointers' handlers: a press, its drags and its end, a pinch, and the link lit under a pointer at rest.\n            {...surface}\n            onDoubleClick={onCanvasDoubleClick}\n        >\n            {/* The theme bridge's probe: what the canvas reads its colours and fonts from (#1387). */}\n            <SchematicProbe tints={tintIndex.specs} signature={tintIndex.signature} probeRef={probeRef} />\n            {/* The builder's reveal, which the painted placeholders show by (#1398, CL4). */}\n            <RevealTell onReveal={onReveal} />\n            {/* The area the reads in flight have not drawn yet (#1398, CL2): the shared wash, under the grid, each box placed\n                by the camera's custom properties as a card is, so a pan moves it with no render. */}\n            {size !== null && (\n                <Box ref={washLayerRef} css={styles.washLayer} data-schematic-unread={unread.length} aria-hidden=\"true\">\n                    {unread.map((box, i) => <LoadingWash key={i} geometry={boxCss(box)} />)}\n                </Box>\n            )}\n            {/* Grid size/position are driven imperatively by applyCamera so\n                they stay locked to the same camera frame as the canvas. */}\n            {showGrid && size !== null && <Box ref={gridRef} css={styles.grid} data-schematic-grid=\"\" />}\n            {size !== null && (\n                <>\n                    <chakra.canvas ref={drawRef} css={styles.paint} />\n                    {/* Card layer holds the live `--cam-*` vars (set by\n                        applyCamera); each card translates off them, so a\n                        camera change is 3 var writes on this parent, never a\n                        per-card React re-layout (issue #57, invariant 6). It\n                        holds the widest card too, which the recipe reads. */}\n                    <SchematicCardLayer cardLayerRef={cardLayerRef} styles={styles} visibleItems={visibleItems} tiers={tiers} lod={lod} context={context}\n                        look={look} matches={matches} conflicted={conflicted} bounded={bounded} renderSelected={renderSelected} lockedKeys={lockedKeys} layerAlpha={layerAlpha}\n                        connectDraft={connectDraft} dropMark={dropMark} centers={centers} cardSizesRef={cardSizesRef} applyCamera={applyCardSizes} />\n                    {/* Drag box overlay — zoom (#153) or marquee (#159). The marquee\n                        carries a live hit-count badge. Screen-space, host-relative. */}\n                    {selRect !== null && (\n                        <Box css={styles.selectBox} data-mode={effectiveTool === \"marquee\" ? \"marquee\" : \"zoom\"} style={{ left: selRect.x, top: selRect.y, width: selRect.w, height: selRect.h }} aria-hidden=\"true\">\n                            {effectiveTool === \"marquee\" && marqueeCount > 0 && (\n                                <Box as=\"span\" css={styles.selectBoxCount}>{marqueeCount}</Box>\n                            )}\n                        </Box>\n                    )}\n                    {scaleUnit !== undefined && scaleLen > 0 && (() => {\n                        const len = scaleLen * ppu;\n                        const quarter = (k: number, h: number) => `M ${(len * k) / 4} 6.5 V ${h}`;\n                        return (\n                            <Box css={styles.scaleBar} data-schematic-scale=\"\">\n                                <Box as=\"span\" css={styles.scaleLabel}>{scaleLen} {scaleUnit}</Box>\n                                <Box\n                                    as=\"svg\"\n                                    css={styles.scaleRuler}\n                                    // Its size inline: the length follows the zoom, and a style prop would mint a class at each.\n                                    style={{ width: len, height: 7 }}\n                                    {...{ viewBox: `0 0 ${len} 7` }}\n                                >\n                                    <path\n                                        d={`M 0.5 0 V 6.5 H ${len - 0.5} V 0 ${quarter(1, 3)} ${quarter(2, 1.5)} ${quarter(3, 3)}`}\n                                        fill=\"none\"\n                                    />\n                                </Box>\n                            </Box>\n                        );\n                    })()}\n                    {/* A read that failed, said once (#1398, CL11): the message box at the top-left in view of the area it\n                        failed reading, with Retry. */}\n                    {failure !== undefined && failedAt !== undefined && (\n                        <LoadingFailedBox message={failure.message} retry={{ onRetry: failure.retry }} at={failedAt} />\n                    )}\n                    {showMinimap && minimapBox !== undefined && (\n                        <Box\n                            css={styles.minimap}\n                            data-schematic-minimap=\"\"\n                            // What it draws, for a reader of the page: the cells of each kind's whole drawing's density, and the items' dots.\n                            data-minimap-cells={minimapCells}\n                            data-minimap-items={minimapItems.length}\n                            title={words.m.minimapHint()}\n                            style={{ width: minimapBox.w, height: minimapBox.h }}\n                            {...minimapSurface}\n                        >\n                            {/* The zones, each kind read by area's whole drawing's density and the items' dots, painted (`minimap.ts`). */}\n                            <chakra.canvas ref={minimapPaintRef} css={styles.minimapPaint} />\n                            <Box\n                                css={styles.minimapViewport}\n                                style={{\n                                    left: `${Math.max(0, (-cameraSnapshot.tx / ppu / W) * 100)}%`,\n                                    top: `${Math.max(0, (-cameraSnapshot.ty / ppu / H) * 100)}%`,\n                                    width: `${Math.min(100, (size.w / ppu / W) * 100)}%`,\n                                    height: `${Math.min(100, (size.h / ppu / H) * 100)}%`,\n                                }}\n                            />\n                        </Box>\n                    )}\n                </>\n            )}\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the layers do to the drawing (#1387, §8): each entity's layer — its\n * `layer`, naming a layer by its key (`Schematic.layers`, D36) — hides it,\n * locks it or dims it as the layer's author defaults say: `visible` false\n * hides every entity on it, `locked` makes them unselectable, and `opacity`\n * under 1 dims them. An entity on no layer, or on a key no layer has, is\n * always shown. The viewer's own choices are the Layers tab's (#1389), kept\n * under the Schematic's `id`. Pure: data in, data out, unit-tested in\n * `layers.test.ts`.\n *\n * @packageDocumentation\n */\n\nimport { match, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport type { Schematic } from \"@elaraai/e3-ui/internal\";\nimport type { SchematicDrawn } from \"./drawn\";\n\n/** An Option's value, or `undefined` — East's `match`: this module loads no renderer. */\nconst getSomeorUndefined = <T,>(opt: option<T>): T | undefined => match(opt, { some: (value) => value }, undefined);\n\n/** A layer, decoded. */\nexport type SchematicLayerValue = ValueTypeOf<typeof Schematic.Types.Layer>;\n\n/** What the layers do to the drawing, by each entity's id. */\nexport interface SchematicLayerState {\n    /** The entities a hidden layer holds: they never draw. */\n    readonly hidden: ReadonlySet<string>;\n    /** The entities a locked layer holds: they never select. */\n    readonly locked: ReadonlySet<string>;\n    /** Each dimmed entity's opacity. */\n    readonly alpha: ReadonlyMap<string, number>;\n}\n\n/** No layer does anything: the drawing of a Schematic with none. */\nexport const NO_LAYER_STATE: SchematicLayerState = { hidden: new Set(), locked: new Set(), alpha: new Map() };\n\n/**\n * What the layers do to a drawing (see the module docs).\n *\n * @param layers - The layers, in their order\n * @param drawn - What the canvas draws\n * @returns Each entity hidden, locked or dimmed by its layer\n */\nexport function layerState(layers: readonly SchematicLayerValue[], drawn: SchematicDrawn): SchematicLayerState {\n    if (layers.length === 0) return NO_LAYER_STATE;\n    const byKey = new Map(layers.map((layer) => [layer.key, layer] as const));\n    const hidden = new Set<string>();\n    const locked = new Set<string>();\n    const alpha = new Map<string, number>();\n    const place = (id: string, on: option<string>) => {\n        const key = getSomeorUndefined(on);\n        const layer = key === undefined ? undefined : byKey.get(key);\n        if (layer === undefined) return;\n        if (getSomeorUndefined(layer.visible) === false) {\n            hidden.add(id);\n            return;\n        }\n        if (getSomeorUndefined(layer.locked) === true) locked.add(id);\n        const opacity = getSomeorUndefined(layer.opacity);\n        if (opacity !== undefined && opacity < 1) alpha.set(id, opacity);\n    };\n    for (const item of drawn.items) place(item.key, item.layer);\n    for (const zone of drawn.zones) place(zone.key, zone.layer);\n    for (const link of drawn.links) place(link.key, link.layer);\n    for (const net of drawn.nets) place(net.key, net.layer);\n    return { hidden, locked, alpha };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the inspector's Details says of the drawing with nothing selected\n * (#1387, #1391, `Schematic Builder Spec.md` §9): each item kind's items drawn\n * — placed, and on no hidden layer — the zones drawn, the links drawn between\n * two items drawn and the nets drawn with a member drawn on either side, each\n * sort only where the Schematic has a kind of it; and the kinds' records whose\n * commits say when each was last saved. Pure: data in, data out, unit-tested\n * in `counts.test.ts`; the inspector (`inspector.tsx`) says them. The footer\n * says none of it: it holds only what is live (`footer.tsx`).\n *\n * A kind read by area draws only its window (#1393), which a pan moves: its\n * count is never what the window draws, but its stored rows its narrowing\n * holds that have a position, counted by its source's indexes and given here\n * (`area-counts.ts`), its drafts in place — `reading`, a placeholder in its\n * place, until those counts land, never a number no read said. Where no read\n * can say it, it is not counted, and Details says why: a hidden layer may\n * hold some of its rows; or its filters can't count its rows with no\n * position. The links and the nets that may join one of its items are not\n * counted either: which of them draw, each between two items drawn, is read\n * only as the view moves.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport type { ItemRoles, SchematicDrawn, SchematicRef, ZoneRoles } from \"./canvas/drawn.js\";\nimport type { SchematicLayerState } from \"./canvas/layers.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport type { SortDrafts } from \"./drafted.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** Why the drawing's Details counts none of a sort or a kind: a hidden layer, the ends a link or a net joins, or the filters. */\nexport type SchematicUncounted = \"layer\" | \"ends\" | \"filters\";\n\n/**\n * A count the drawing's Details says (see the module docs): a number; one whose read is in flight — a placeholder in its\n * place; or one no read can say, and why.\n */\nexport type SchematicDrawingCount =\n    | { readonly kind: \"counted\"; readonly n: number }\n    | { readonly kind: \"reading\" }\n    | { readonly kind: \"uncounted\"; readonly why: SchematicUncounted };\n\n/** A count in flight. */\nexport const COUNT_READING: SchematicDrawingCount = { kind: \"reading\" };\n\n/**\n * A count, as a number says it.\n *\n * @param n - The number\n * @returns The count\n */\nexport function counted(n: number): SchematicDrawingCount {\n    return { kind: \"counted\", n };\n}\n\n/**\n * A count no read can say.\n *\n * @param why - Why\n * @returns The count\n */\nexport function uncounted(why: SchematicUncounted): SchematicDrawingCount {\n    return { kind: \"uncounted\", why };\n}\n\n/** One item kind, as the drawing's Details counts it. */\nexport interface SchematicKindCount {\n    /** Its slot. */\n    readonly slot: string;\n    /** Its name (`Rack`). */\n    readonly name: string;\n    /** Its items drawn: placed, its narrowing's and on no hidden layer — a kind read by area's counted by its source. */\n    readonly drawn: SchematicDrawingCount;\n}\n\n/** What the drawing's Details counts. */\nexport interface SchematicCounts {\n    /** Each item kind's items drawn, in the order the Schematic lists them. */\n    readonly kinds: readonly SchematicKindCount[];\n    /** The zones drawn; `undefined` with no zone kind. */\n    readonly zones: SchematicDrawingCount | undefined;\n    /** The links drawn — each between two items drawn; `undefined` with no link kind. */\n    readonly links: SchematicDrawingCount | undefined;\n    /** The nets drawn — each with a member drawn on either side; `undefined` with no net kind. */\n    readonly nets: SchematicDrawingCount | undefined;\n}\n\n/** What the Schematic declares, as the drawing's Details counts it: its kinds, by sort. */\nexport interface SchematicCountedKinds {\n    /** The item kinds: each its slot and its name. */\n    readonly items: readonly { readonly key: string; readonly name: string }[];\n    /** Whether it has zone kinds. */\n    readonly zones: boolean;\n    /** Whether it has link kinds. */\n    readonly links: boolean;\n    /** Whether it has net kinds. */\n    readonly nets: boolean;\n    /** The kinds read by area, by slot (#1393): each counted by its source, as given, never by what its window draws. */\n    readonly areas?: ReadonlySet<string> | undefined;\n    /** Whether a link kind may join an item of a kind read by area: then no link is counted. */\n    readonly linksByArea?: boolean | undefined;\n    /** Whether a net kind may join an item of a kind read by area: then no net is counted. */\n    readonly netsByArea?: boolean | undefined;\n}\n\n/** No kind read by area. */\nconst NO_AREAS: ReadonlySet<string> = new Set();\n\n/** No kind read by area counted. */\nconst NO_AREA_COUNTS: ReadonlyMap<string, SchematicDrawingCount> = new Map();\n\n/** Several counts as one: a sum of numbers — in flight while any is, and none any read can say once one is not. */\nfunction summed(counts: readonly SchematicDrawingCount[]): SchematicDrawingCount {\n    let n = 0;\n    let reading = false;\n    for (const count of counts) {\n        if (count.kind === \"uncounted\") return count;\n        if (count.kind === \"reading\") reading = true;\n        else n += count.n;\n    }\n    return reading ? COUNT_READING : counted(n);\n}\n\n/**\n * What the drawing's Details counts of a drawing (see the module docs).\n *\n * @param kinds - The Schematic's kinds\n * @param drawn - What the canvas draws\n * @param layers - What its layers hide\n * @param areaCounts - Each kind read by area's count, by its slot, its drafts in place: in flight while it has none\n * @returns The counts\n */\nexport function schematicCounts(kinds: SchematicCountedKinds, drawn: SchematicDrawn, layers: SchematicLayerState,\n    areaCounts: ReadonlyMap<string, SchematicDrawingCount> = NO_AREA_COUNTS): SchematicCounts {\n    const byArea = kinds.areas ?? NO_AREAS;\n    const shown = (key: string) => !layers.hidden.has(key);\n    const items = drawn.items.filter((item) => shown(item.key));\n    const drawnItems = new Set(items.map((item) => item.key));\n    const itemSlots = new Set(kinds.items.map((kind) => kind.key));\n    const areaCount = (slot: string): SchematicDrawingCount => areaCounts.get(slot) ?? COUNT_READING;\n    // The zone kinds read by area: those of the kinds read by area that are no item kind.\n    const areaZones = [...byArea].filter((slot) => !itemSlots.has(slot));\n    return {\n        kinds: kinds.items.map((kind) => ({\n            slot: kind.key, name: kind.name,\n            drawn: byArea.has(kind.key) ? areaCount(kind.key) : counted(items.filter((item) => stringEqual(item.ref.kind, kind.key)).length),\n        })),\n        zones: kinds.zones ? summed([counted(drawn.zones.filter((zone) => shown(zone.key) && !byArea.has(zone.ref.kind)).length), ...areaZones.map(areaCount)]) : undefined,\n        links: !kinds.links ? undefined : kinds.linksByArea === true ? uncounted(\"ends\")\n            : counted(drawn.links.filter((link) => shown(link.key) && drawnItems.has(link.from) && drawnItems.has(link.to)).length),\n        nets: !kinds.nets ? undefined : kinds.netsByArea === true ? uncounted(\"ends\")\n            : counted(drawn.nets.filter((net) => shown(net.key) && net.sources.some((m) => drawnItems.has(m)) && net.destinations.some((m) => drawnItems.has(m))).length),\n    };\n}\n\n/** A kind read by area, as its count is drafted: its slot, and its sort — an item's rows may have no position, a zone's always have one. */\nexport interface SchematicAreaCountedKind {\n    /** Its slot. */\n    readonly key: string;\n    /** Its sort. */\n    readonly sort: \"items\" | \"zones\";\n}\n\n/**\n * Each kind read by area's count with its drafts in place (#1393): its stored rows' count, and for each row a draft holds\n * that its narrowing holds — by the row its session began from — one more where the draft has a position and the row it\n * began from had none, one fewer the other way, and one fewer where the draft deletes a row that had one; a row a gesture\n * made, one more where it has a position, the narrowing's or not, as it draws. A count in flight, or one no read can say,\n * stays so; and while a hidden layer may hold some of a kind's rows, no read can say how many it draws.\n *\n * @param kinds - The kinds read by area\n * @param stored - Each one's stored rows' count, by its slot (`area-counts.ts`)\n * @param drafts - The item kinds' and the zone kinds' drafts\n * @param held - Whether a kind's narrowing holds a drafted row, by the row its session began from: `false` leaves it out;\n *   `undefined` — nothing narrows the kind, or its answer is in flight — counts it\n * @param began - Whether the row a deleted draft's session began from had a position; `undefined` for one a gesture made\n * @param layerHidden - Whether a layer is hidden\n * @returns Each kind's count, by its slot\n */\nexport function draftedAreaCounts(kinds: readonly SchematicAreaCountedKind[], stored: ReadonlyMap<string, SchematicDrawingCount>,\n    drafts: { readonly items: SortDrafts<ItemRoles>; readonly zones: SortDrafts<ZoneRoles> }, held: (ref: SchematicRef) => boolean | undefined,\n    began: (ref: SchematicRef) => boolean | undefined, layerHidden: boolean): ReadonlyMap<string, SchematicDrawingCount> {\n    const out = new Map<string, SchematicDrawingCount>();\n    for (const kind of kinds) {\n        if (layerHidden) { out.set(kind.key, uncounted(\"layer\")); continue; }\n        const count = stored.get(kind.key) ?? COUNT_READING;\n        if (count.kind !== \"counted\") { out.set(kind.key, count); continue; }\n        let n = count.n;\n        const placed = (roles: ItemRoles | ZoneRoles): boolean => kind.sort === \"zones\" || (roles as ItemRoles).position.type === \"some\";\n        const rows: ReadonlyMap<string, { readonly roles: ItemRoles | ZoneRoles; readonly created: boolean; readonly began?: ItemRoles | ZoneRoles | undefined } | undefined> =\n            (kind.sort === \"items\" ? drafts.items : drafts.zones).get(kind.key) ?? new Map();\n        for (const [key, row] of rows) {\n            const ref = { kind: kind.key, key };\n            if (row?.created === true) { if (placed(row.roles)) n += 1; continue; }\n            if (held(ref) === false) continue;\n            const was = row === undefined ? began(ref) === true : row.began !== undefined && placed(row.began);\n            const now = row !== undefined && placed(row.roles);\n            n += (now ? 1 : 0) - (was ? 1 : 0);\n        }\n        out.set(kind.key, counted(n));\n    }\n    return out;\n}\n\n/** A record's commits, newest first, as a kind's `history` reads them. */\ntype History = Extract<SchematicValue[\"items\"][number][\"history\"], { type: \"some\" }>[\"value\"];\n\n/** A kind's record whose commits say when it was last saved: one bound with its patch door. */\nexport interface SchematicSavedRecord {\n    /** The kind's slot. */\n    readonly slot: string;\n    /** The kind's name (`Rack`). */\n    readonly name: string;\n    /** Its record's commits, newest first. */\n    readonly history: History;\n}\n\n/**\n * The kinds whose records say when they were last saved: each bound with its\n * patch door, whose commits it reads — in the Schematic's order of its sorts,\n * items, zones, links and nets.\n *\n * @param value - The payload\n * @returns Each such kind's record\n */\nexport function savedRecords(value: SchematicValue): SchematicSavedRecord[] {\n    return [...value.items, ...value.zones, ...value.links, ...value.nets]\n        .flatMap((kind) => (kind.history.type === \"some\" ? [{ slot: kind.key, name: kind.name, history: kind.history.value }] : []));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the drawing's Details counts of each kind read by area (#1393,\n * `Schematic Builder Spec.md` §9, §11.4), read in a component of its own:\n * never what its window draws, which a pan moves, but its stored rows its\n * narrowing holds that have a position, counted by its source's indexes —\n * every row its narrowing holds (`countWhere`), less those its area index's\n * unplaced clause counts under the narrowing's choices the index leads; a\n * zone kind, or an item kind every row of which has a position, the first\n * alone. No row is read. A narrowing with a choice no area index leads can't\n * count its rows with no position, so such a kind is not counted (`filters`).\n * Its drafts are the frame's to lay over the count (`counts.ts`).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useRef } from \"react\";\nimport { none, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { schematicAreaIndexes, schematicUnplacedPlan } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { COUNT_READING, counted, uncounted, type SchematicDrawingCount } from \"./counts.js\";\nimport type { SchematicValue } from \"./data.js\";\n\n/** A kind's source of the slice. */\ntype Part = ValueTypeOf<RecordSliceBindType>;\n\n/** Nothing counted. */\nexport const NO_AREA_COUNTS: ReadonlyMap<string, SchematicDrawingCount> = new Map();\n\n/** One item kind's stored rows with a position its narrowing holds (see the module docs). */\nfunction itemCount(kind: SchematicValue[\"items\"][number], part: Part): SchematicDrawingCount {\n    const where = part.read().where;\n    const all = part.countWhere({ where, area: none });\n    if (!kind.backlog) return all.type === \"some\" ? counted(Number(all.value)) : COUNT_READING;\n    const areas = schematicAreaIndexes(part.config.indexes, kind.box, \"items\", `Schematic.items: \"${kind.name}\"`);\n    if (areas === undefined) return uncounted(\"filters\");\n    const plan = schematicUnplacedPlan(areas, where);\n    if (plan.residual.length > 0) return uncounted(\"filters\");\n    const unplaced = part.countWhere(plan.read);\n    return all.type === \"some\" && unplaced.type === \"some\" ? counted(Number(all.value - unplaced.value)) : COUNT_READING;\n}\n\n/** One zone kind's stored rows its narrowing holds. */\nfunction zoneCount(part: Part): SchematicDrawingCount {\n    const all = part.countWhere({ where: part.read().where, area: none });\n    return all.type === \"some\" ? counted(Number(all.value)) : COUNT_READING;\n}\n\n/** Whether two counts say the same. */\nfunction sameCount(a: SchematicDrawingCount | undefined, b: SchematicDrawingCount): boolean {\n    if (a === undefined || a.kind !== b.kind) return false;\n    if (a.kind === \"counted\") return b.kind === \"counted\" && a.n === b.n;\n    if (a.kind === \"uncounted\") return b.kind === \"uncounted\" && a.why === b.why;\n    return true;\n}\n\n/** No kind read by area. */\nconst NO_AREAS: ReadonlySet<string> = new Set();\n\n/**\n * Reads each kind read by area's count (see the module docs), handing the frame what it read only when that moves.\n *\n * @param props - The payload, the kinds read by area, and where the counts go\n * @returns Nothing: it reads\n */\nexport function SchematicAreaCountsReader({ value, areas = NO_AREAS, onRead }: {\n    value: SchematicValue; areas?: ReadonlySet<string>; onRead: (counts: ReadonlyMap<string, SchematicDrawingCount>) => void;\n}): null {\n    const read = useCallback((): ReadonlyMap<string, SchematicDrawingCount> => {\n        const chrome = getSomeorUndefined(value.slice);\n        const out = new Map<string, SchematicDrawingCount>();\n        for (const kind of value.items) {\n            const part = areas.has(kind.key) ? sourcePart(chrome, kind.key) : undefined;\n            if (part === undefined) continue;\n            // A count whose read fails stands in flight: the frame's line says why its kind's read failed.\n            try { out.set(kind.key, itemCount(kind, part)); } catch { out.set(kind.key, COUNT_READING); }\n        }\n        for (const kind of value.zones) {\n            const part = areas.has(kind.key) ? sourcePart(chrome, kind.key) : undefined;\n            if (part === undefined) continue;\n            try { out.set(kind.key, zoneCount(part)); } catch { out.set(kind.key, COUNT_READING); }\n        }\n        return out;\n    }, [value, areas]);\n    const { result } = useTrackedEvaluation(read);\n    const reported = useRef<ReadonlyMap<string, SchematicDrawingCount>>(NO_AREA_COUNTS);\n    useLayoutEffect(() => {\n        if (!result.ok) return;\n        const now = result.value;\n        const was = reported.current;\n        if (was.size === now.size && [...now].every(([slot, count]) => sameCount(was.get(slot), count))) return;\n        reported.current = now;\n        onRead(now);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The drawing with the drafts in place (#1388, `Schematic Builder Spec.md` §7,\n * SC23) — pure: what the canvas draws, its reader's stored rows with the\n * editing session's drafts over them, each drafted row drawn from the roles\n * its kind reads from it.\n *\n * - **A drafted row the read holds** draws as drafted: moved, its ends or its\n *   sides rewritten; one its draft deletes, or unplaces, draws nothing.\n * - **A row its draft adds** — one a gesture created, or one another session\n *   removed under the draft, its session's original holding none of it\n *   (`shared/schedule/drafted-rows.ts`) — draws though no read holds it.\n * - **A drafted row the read does not hold** — a source's narrowing hides it —\n *   waits in its session: it draws once a read holds it again, as drafted,\n *   and Save sends it whatever is drawn. A kind read by area reads only its\n *   window (#1393): a drafted row of it its window doesn't hold — moved off\n *   the window, or placed from the Backlog — draws where its draft places it,\n *   while its narrowing holds it, as the row its session began from answers\n *   (`drafts-narrowing.ts`): one the hidden narrowing leaves out waits in its\n *   session, as every kind's does, and one the dimmed narrowing leaves out\n *   draws as context (`narrowing.ts`).\n *\n * Which drafted rows draw is the one rule every builder that draws its\n * records' own rows asks (`shared/schedule/drafted-rows.ts`'\n * `DraftedStanding`), and through a carry-over — its record read again, its\n * session yet to read the row there by its key — a drafted row stands as the\n * canvas last drew it: a rack moved here that another session removed, in no\n * read and not yet a row its draft adds, never leaves the canvas meanwhile.\n *\n * What a drafted row draws is kept by the roles it was drawn from, so a\n * render that moves no draft draws each the same.\n *\n * What the drawing leaves out of the drafts — each drafted row waiting in its\n * session — is made as its kind draws it too (`waitingDrafts`), never for the\n * canvas: Issues checks it beside the drawing, so every unsaved change is\n * checked, drawn or not (ruled 27 Oct 2026, \"Checked in view, said so\"), and\n * Go to issue flies to where it stands (`waitingPoint`).\n *\n * What a confirmed Save landed of a kind read by area draws as the Save left\n * it until the kind's reads are from after the commit (`landedDrafts`): a\n * window read before the Save landed holds each row as it stood, and drawn\n * from the window alone a moved rack showed where it was until the window was\n * read again. A window is from before a Save while it was read at another\n * revision than the one its record reads at now — the rule every host that\n * draws what a Save landed reads its rows by (east-ui-components'\n * `readBeforeSave`), whichever revision the Save was drafted at: the same rack\n * saved twice before its window is read again draws as the second Save left\n * it. Over such a window — or none, its read failed — each row the Save\n * landed is laid under the drafts as a draft is; over one read since, only a\n * row the window holds none of. Details reads the windows with the rows so\n * (`landedWindows`), and a kind's are let go once its window, and the Index's\n * read of it, are from after them (`landedRead`).\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { readBeforeSaves } from \"@elaraai/east-ui-components/internal\";\nimport {\n    EMPTY_DRAWN, drawnItem, drawnLink, drawnNet, drawnZone, entityId,\n    type CardRoles, type DetailsRoles, type ItemRoles, type LinkRoles, type NetRoles, type SchematicDrawn, type SchematicRef, type ZoneRoles,\n} from \"./canvas/drawn.js\";\nimport { zoneAnchor } from \"./canvas/paint.js\";\nimport { DraftedStanding, type DraftedRow } from \"../shared/schedule/drafted-rows.js\";\nimport type { SchematicHeldRows, SchematicWindowHeld, SchematicWindowRows } from \"./data.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/**\n * One sort's drafts: by each kind's slot, then by key — the drafted row, or `undefined` for one its draft deletes. A\n * drafted row's `began` — the roles of the row its session began from — is where a kind read by area's paged Backlog\n * lists it, by its stored place (`backlog.ts`, #1393).\n */\nexport type SortDrafts<R> = ReadonlyMap<string, ReadonlyMap<string, DraftedRow<R> | undefined>>;\n\n/** Every kind's drafts, by sort. */\nexport interface SchematicDrafts {\n    /** The item kinds'. */\n    readonly items: SortDrafts<ItemRoles>;\n    /** The zone kinds'. */\n    readonly zones: SortDrafts<ZoneRoles>;\n    /** The link kinds'. */\n    readonly links: SortDrafts<LinkRoles>;\n    /** The net kinds'. */\n    readonly nets: SortDrafts<NetRoles>;\n}\n\n/** No drafts. */\nexport const NO_DRAFTS: SchematicDrafts = { items: new Map(), zones: new Map(), links: new Map(), nets: new Map() };\n\n/**\n * What a confirmed Save landed of a row of a kind read by area (`EditSession.landed`): the row as the Save left it, drawn\n * so until the reads of its kind are from after the commit (see the module docs).\n */\nexport interface LandedRow<R> {\n    /** The row as the Save left it, as the drawing takes a drafted row; `undefined` for one it deleted. */\n    readonly drawn: DraftedRow<R> | undefined;\n    /** Its bytes as the Save left it, as a window holds a row; `undefined` for one it deleted. */\n    readonly row: Uint8Array | undefined;\n    /**\n     * The revision the Save's request was drafted at: a record still read there holds the row as it stood before.\n     * `undefined` for a row held from none (`LandedEntry.from`).\n     */\n    readonly from: string | undefined;\n}\n\n/** One sort's landed rows: by each kind's slot, then by key. */\nexport type SortLanded<R> = ReadonlyMap<string, ReadonlyMap<string, LandedRow<R>>>;\n\n/** What Saves landed of the kinds read by area, by sort: the sorts a kind is read by area of. */\nexport interface SchematicLanded {\n    /** The item kinds'. */\n    readonly items: SortLanded<ItemRoles>;\n    /** The zone kinds'. */\n    readonly zones: SortLanded<ZoneRoles>;\n}\n\n/** Nothing landed. */\nexport const NO_LANDED: SchematicLanded = { items: new Map(), zones: new Map() };\n\n/** What a drafted row was drawn as, by the roles it was drawn from: kept while they are, and its details' and what of them is unread. */\nexport type DraftedCache = WeakMap<object, { readonly details: DetailsRoles | undefined; readonly pending: CardRoles | undefined; readonly drawn: unknown }>;\n\n/** No kind read by area. */\nconst NONE_WINDOWED: ReadonlySet<string> = new Set();\n\n/** Nothing the narrowing leaves out. */\nconst NONE_LEFT_OUT = (): boolean => false;\n\n/**\n * Whether a sort has any draft.\n *\n * @param drafts - The sort's drafts\n * @returns Whether any kind of it has one\n */\nfunction drafted(drafts: SortDrafts<unknown>): boolean {\n    for (const rows of drafts.values()) if (rows.size > 0) return true;\n    return false;\n}\n\n/**\n * Whether a drafted row is drawn (see the module docs) — any other waits in its session, drawn nowhere: one its read\n * holds; one its draft adds; one of a kind read by area its window doesn't hold, while the hidden narrowing holds the\n * row its session began from; and one the canvas last drew, while its session has yet to judge it where its record is.\n *\n * @param standing - The rule, and what the canvas last drew\n * @param ref - The row's kind's slot and its key\n * @param kept - What the read holds of it; `undefined` for nothing\n * @param row - The drafted row\n * @param windowed - Whether its kind is read by area\n * @param leftOut - Whether the hidden narrowing leaves it out, asked only of a kind read by area's row its read doesn't hold\n * @returns Whether it is drawn\n */\nfunction stands(standing: DraftedStanding, ref: SchematicRef, kept: unknown, row: DraftedRow<unknown>, windowed: boolean, leftOut: () => boolean): boolean {\n    return standing.stands(ref.kind, ref.key, row, kept !== undefined, () => windowed && !leftOut());\n}\n\n/**\n * One sort's entities with its drafts in place: each drafted entity the read\n * holds drawn from its drafted roles where it was — or nowhere, deleted or\n * unplaced — and each the read does not hold, a gesture created, after them.\n *\n * @param entities - The sort's stored entities, as the reader drew them\n * @param drafts - The sort's drafts\n * @param held - Each kind's rows the read holds\n * @param windowed - The kinds read by area, by slot: a drafted row of one draws though its window doesn't hold it\n * @param leftOut - Whether the hidden narrowing leaves out a drafted row of a kind read by area its window doesn't hold\n * @param cache - What each drafted row was drawn as\n * @param standing - Which drafted rows draw, and what the canvas last drew\n * @param drew - Where each kind's drafted rows this drawing draws are told, by slot: what the canvas remembers of it\n * @param draw - An entity from its reference, its roles, its details' roles and the card roles they give while they are\n *   read (#1398); `undefined` for one that draws nothing\n * @returns The entities\n */\nfunction merged<R extends object, E extends { readonly key: string }>(\n    entities: readonly E[], drafts: SortDrafts<R>, held: SchematicHeldRows, windowed: ReadonlySet<string>, leftOut: (ref: SchematicRef) => boolean,\n    cache: DraftedCache, standing: DraftedStanding, drew: Map<string, ReadonlySet<string>>,\n    draw: (ref: SchematicRef, roles: R, details: DetailsRoles | undefined, pending: CardRoles | undefined) => E | undefined,\n): E[] {\n    // Each drafted entity, by its id: what it draws as, or `undefined` for nothing.\n    const replaced = new Map<string, E | undefined>();\n    for (const [slot, rows] of drafts) {\n        const read = held.get(slot);\n        const stood = new Set<string>();\n        drew.set(slot, stood);\n        for (const [key, row] of rows) {\n            const ref = { kind: slot, key };\n            const id = entityId(ref);\n            // A row its draft deletes draws nothing, and is remembered as it stood: the deletion taken back finds it so.\n            if (row === undefined) { if (standing.stood(slot, key)) stood.add(key); replaced.set(id, undefined); continue; }\n            const kept = read?.get(key);\n            // A row a narrowing hides waits in its session; one its draft adds draws, and one of a kind read by area its\n            // window doesn't hold while its narrowing holds it — and one the canvas last drew, through a carry-over.\n            if (!stands(standing, ref, kept, row, windowed.has(slot), () => leftOut(ref))) continue;\n            stood.add(key);\n            // A drafted card over a row whose details are read holds their places, as the row's own does (#1398).\n            const details = kept?.details;\n            const pending = kept?.pending;\n            const was = cache.get(row.roles);\n            // Standing through a carry-over, no read holding it: as it was last drawn, its details with it.\n            if (kept === undefined && row.carrying === true && was !== undefined) { replaced.set(id, was.drawn as E | undefined); continue; }\n            // The very details it was drawn with, as the reader keeps them while they read again as they were.\n            if (was !== undefined && Object.is(was.details, details) && Object.is(was.pending, pending)) { replaced.set(id, was.drawn as E | undefined); continue; }\n            const drawn = draw(ref, row.roles, details, pending);\n            cache.set(row.roles, { details, pending, drawn });\n            replaced.set(id, drawn);\n        }\n    }\n    const out: E[] = [];\n    for (const entity of entities) {\n        if (!replaced.has(entity.key)) { out.push(entity); continue; }\n        const drawn = replaced.get(entity.key);\n        replaced.delete(entity.key);\n        if (drawn !== undefined) out.push(drawn);\n    }\n    // What the stored drawing holds none of: a new row, or a row placed by its draft.\n    for (const drawn of replaced.values()) if (drawn !== undefined) out.push(drawn);\n    return out;\n}\n\n/**\n * The drawing with the drafts in place (see the module docs).\n *\n * @param stored - What the reader drew of the stored rows\n * @param held - Each kind's rows the read holds, and their details' roles\n * @param drafts - Every kind's drafts\n * @param cache - What each drafted row was drawn as, kept across calls\n * @param windowed - The kinds read by area, by slot (#1393): a drafted row of one its window doesn't hold draws\n * @param leftOut - Whether the hidden narrowing leaves out a drafted row of a kind read by area its window doesn't hold, as\n *   the row its session began from answers (`drafts-narrowing.ts`): it waits in its session; none while nothing does\n * @param standing - Which drafted rows draw, and what the canvas last drew, which this drawing replaces: the canvas's\n *   own, kept while it is mounted; one that remembers nothing unless given\n * @returns The drawing; the stored one itself while nothing is drafted\n */\nexport function draftedDrawing(stored: SchematicDrawn, held: SchematicHeldRows, drafts: SchematicDrafts, cache: DraftedCache,\n    windowed: ReadonlySet<string> = NONE_WINDOWED, leftOut: (ref: SchematicRef) => boolean = NONE_LEFT_OUT,\n    standing: DraftedStanding = new DraftedStanding()): SchematicDrawn {\n    const items = drafted(drafts.items), zones = drafted(drafts.zones), links = drafted(drafts.links), nets = drafted(drafts.nets);\n    const drew = new Map<string, ReadonlySet<string>>();\n    const drawing = !items && !zones && !links && !nets ? stored : {\n        items: items ? merged(stored.items, drafts.items, held, windowed, leftOut, cache, standing, drew, (ref, roles, details, pending) => drawnItem(ref, roles, details, pending)) : stored.items,\n        zones: zones ? merged(stored.zones, drafts.zones, held, windowed, leftOut, cache, standing, drew, (ref, roles) => drawnZone(ref, roles)) : stored.zones,\n        links: links ? merged(stored.links, drafts.links, held, windowed, leftOut, cache, standing, drew, (ref, roles) => drawnLink(ref, roles)) : stored.links,\n        nets: nets ? merged(stored.nets, drafts.nets, held, windowed, leftOut, cache, standing, drew, (ref, roles) => drawnNet(ref, roles)) : stored.nets,\n    };\n    // What this drawing drew of the drafts, once every one was asked by what the last drawing drew.\n    standing.drew(drew);\n    return drawing;\n}\n\n/**\n * The drafted rows the drawing leaves out, each waiting in its session — a\n * narrowing leaves out the row it drafts (see the module docs) — made as\n * their kinds draw them: what Issues checks beside the drawing, so an unsaved\n * change carries no issue unseen, wherever it is drawn or not (ruled 27 Oct\n * 2026, \"Checked in view, said so\"). Never the canvas's: what the narrowing\n * hides is drawn nowhere. An item with no position draws nothing here, as on\n * the canvas; a row its draft deletes is no row.\n *\n * @param held - Each kind's rows the read holds\n * @param drafts - Every kind's drafts\n * @param windowed - The kinds read by area, by slot, as {@link draftedDrawing} takes them\n * @param leftOut - Whether the hidden narrowing leaves out a drafted row of a kind read by area its window doesn't hold, as\n *   {@link draftedDrawing} takes it\n * @param standing - Which drafted rows draw, as the drawing of these drafts told it ({@link draftedDrawing}); one that\n *   remembers nothing unless given\n * @returns The rows, each kind's in its drafts' order — no row while every draft draws\n */\nexport function waitingDrafts(held: SchematicHeldRows, drafts: SchematicDrafts, windowed: ReadonlySet<string> = NONE_WINDOWED,\n    leftOut: (ref: SchematicRef) => boolean = NONE_LEFT_OUT, standing: DraftedStanding = new DraftedStanding()): SchematicDrawn {\n    const sort = <R, E>(sorted: SortDrafts<R>, draw: (ref: SchematicRef, roles: R) => E | undefined): E[] => {\n        const out: E[] = [];\n        for (const [slot, rows] of sorted) {\n            const read = held.get(slot);\n            for (const [key, row] of rows) {\n                const ref = { kind: slot, key };\n                if (row === undefined || stands(standing, ref, read?.get(key), row, windowed.has(slot), () => leftOut(ref))) continue;\n                const drawn = draw(ref, row.roles);\n                if (drawn !== undefined) out.push(drawn);\n            }\n        }\n        return out;\n    };\n    const items = sort(drafts.items, (ref, roles) => drawnItem(ref, roles, undefined));\n    const zones = sort(drafts.zones, drawnZone);\n    const links = sort(drafts.links, drawnLink);\n    const nets = sort(drafts.nets, drawnNet);\n    return items.length + zones.length + links.length + nets.length === 0 ? EMPTY_DRAWN : { items, zones, links, nets };\n}\n\n/**\n * The drawing with the drafted rows it leaves out beside it ({@link waitingDrafts}): what Issues checks and names.\n *\n * @param drawn - The drawing, the drafts drawn in place\n * @param waiting - The drafted rows it leaves out\n * @returns Both, each sort's drawn entities first; the drawing itself while none waits\n */\nexport function withWaiting(drawn: SchematicDrawn, waiting: SchematicDrawn): SchematicDrawn {\n    if (waiting.items.length + waiting.zones.length + waiting.links.length + waiting.nets.length === 0) return drawn;\n    return {\n        items: [...drawn.items, ...waiting.items],\n        zones: [...drawn.zones, ...waiting.zones],\n        links: [...drawn.links, ...waiting.links],\n        nets: [...drawn.nets, ...waiting.nets],\n    };\n}\n\n/**\n * Where a drafted row waiting in its session stands, as its draft places it: what the camera looks at as Go to issue\n * goes to it (#1391) — an item's centre; a zone's box's centre, its anchor; a link's or a net's members' box's centre,\n * each member where the drawing or a waiting row places it.\n *\n * @param id - The row's id\n * @param waiting - The drafted rows waiting in their sessions ({@link waitingDrafts})\n * @param drawn - The drawing, the drafts drawn in place\n * @returns Its point; `undefined` for an id no waiting row has, and for a link or a net none of whose members is placed\n */\nexport function waitingPoint(id: string, waiting: SchematicDrawn, drawn: SchematicDrawn): { readonly x: number; readonly y: number } | undefined {\n    const item = waiting.items.find((it) => stringEqual(it.key, id));\n    if (item !== undefined) return { x: item.x, y: item.y };\n    const zone = waiting.zones.find((z) => stringEqual(z.key, id));\n    if (zone !== undefined) return zoneAnchor(zone);\n    const link = waiting.links.find((l) => stringEqual(l.key, id));\n    const net = link === undefined ? waiting.nets.find((n) => stringEqual(n.key, id)) : undefined;\n    const members = link !== undefined ? [link.from, link.to] : net !== undefined ? [...net.sources, ...net.destinations] : [];\n    const placed = members.flatMap((member) => {\n        const at = drawn.items.find((it) => stringEqual(it.key, member)) ?? waiting.items.find((it) => stringEqual(it.key, member));\n        return at === undefined ? [] : [at];\n    });\n    if (placed.length === 0) return undefined;\n    const xs = placed.map((at) => at.x), ys = placed.map((at) => at.y);\n    return { x: (Math.min(...xs) + Math.max(...xs)) / 2, y: (Math.min(...ys) + Math.max(...ys)) / 2 };\n}\n\n/**\n * The revision the Save of each landed row was drafted at.\n *\n * @param rows - A kind's landed rows\n * @returns Their revisions, one a row\n */\nfunction* draftedAt(rows: ReadonlyMap<string, LandedRow<unknown>>): Iterable<string | undefined> {\n    for (const row of rows.values()) yield row.from;\n}\n\n/**\n * Whether a read of a kind is from before what Saves landed of it, so holding its rows as they stood: read at another\n * revision than the one the kind's record reads at now, by the rule every host that draws what a Save landed reads its\n * rows by (east-ui-components' `readBeforeSaves`).\n *\n * @param revision - The revision the read was read at\n * @param now - The revision the kind's record reads at now; `undefined` while it names none\n * @param rows - The kind's landed rows\n * @returns Whether it is\n */\nfunction readBefore(revision: string, now: string | undefined, rows: ReadonlyMap<string, LandedRow<unknown>>): boolean {\n    return readBeforeSaves(revision, now, draftedAt(rows));\n}\n\n/**\n * One sort's drafts with what Saves landed of it laid under them, as {@link landedDrafts} lays them.\n *\n * @param drafts - The sort's drafts\n * @param landed - What Saves landed of it\n * @param windows - Each kind read by area's window\n * @param now - The revision each kind read by area's record reads at now\n * @returns The drafts; themselves while nothing is laid\n */\nfunction laidSort<R>(drafts: SortDrafts<R>, landed: SortLanded<R>, windows: SchematicWindowRows, now: ReadonlyMap<string, string>): SortDrafts<R> {\n    let out: Map<string, ReadonlyMap<string, DraftedRow<R> | undefined>> | undefined;\n    for (const [slot, rows] of landed) {\n        const window = windows.get(slot);\n        const before = window === undefined || readBefore(window.revision, now.get(slot), rows);\n        const own = drafts.get(slot);\n        let laid: Map<string, DraftedRow<R> | undefined> | undefined;\n        for (const [key, row] of rows) {\n            if (own?.has(key) === true || (!before && window?.rows.has(key) === true)) continue;\n            laid ??= new Map(own);\n            laid.set(key, row.drawn);\n        }\n        if (laid === undefined) continue;\n        out ??= new Map(drafts);\n        out.set(slot, laid);\n    }\n    return out ?? drafts;\n}\n\n/**\n * The drafts with what confirmed Saves landed of the kinds read by area laid under them (see the module docs): over a\n * window read before the revision its record reads at now — or none, its read failed and what was drawn of it standing\n * — every row the Saves landed, as they left it, one they deleted drawing nowhere; over a window read at it, only a row\n * it holds none of, which the Index, its read perhaps older, lists where the Save left it. A draft of a row made since\n * draws in its place.\n *\n * @param drafts - Every kind's drafts\n * @param landed - What Saves landed of the kinds read by area\n * @param windows - Each kind read by area's window, at the revision it was read at\n * @param now - The revision each kind read by area's record reads at now, by its slot (`data.ts`' `revisions`)\n * @returns The drafts, each kind's landed rows after its own; the drafts themselves while nothing is laid\n */\nexport function landedDrafts(drafts: SchematicDrafts, landed: SchematicLanded, windows: SchematicWindowRows, now: ReadonlyMap<string, string>): SchematicDrafts {\n    const items = laidSort(drafts.items, landed.items, windows, now), zones = laidSort(drafts.zones, landed.zones, windows, now);\n    return Object.is(items, drafts.items) && Object.is(zones, drafts.zones) ? drafts : { ...drafts, items, zones };\n}\n\n/**\n * Each kind read by area's window with what Saves landed of it in place while the window is from before them: each row\n * as the Save left it, and none of one it deleted. Details reads a row of a kind read by area from its window\n * (`inspector-rows.ts`), so its fields never show the row as it stood before the Save; a window read since holds the\n * rows itself.\n *\n * @param windows - Each kind read by area's window\n * @param landed - What Saves landed of the kinds read by area\n * @param now - The revision each kind read by area's record reads at now, by its slot\n * @returns The windows; themselves while none is from before a Save\n */\nexport function landedWindows(windows: SchematicWindowRows, landed: SchematicLanded, now: ReadonlyMap<string, string>): SchematicWindowRows {\n    let out: Map<string, SchematicWindowHeld> | undefined;\n    const sorts: readonly SortLanded<unknown>[] = [landed.items, landed.zones];\n    for (const sort of sorts) {\n        for (const [slot, rows] of sort) {\n            const window = windows.get(slot);\n            if (window === undefined || !readBefore(window.revision, now.get(slot), rows)) continue;\n            const held = new Map(window.rows);\n            for (const [key, row] of rows) {\n                if (row.row === undefined) held.delete(key);\n                else held.set(key, { row: row.row });\n            }\n            out ??= new Map(windows);\n            out.set(slot, { revision: window.revision, rows: held });\n        }\n    }\n    return out ?? windows;\n}\n\n/**\n * What Saves landed that the reads draw now, which their sessions let go (`EditSession.shown`): every landed row of a\n * kind whose window is read at the revision its record reads at now — and the Index's read of it too, where the Index\n * reads the kind. Over a window from before them, or none, its read failed, they draw as landed still.\n *\n * @param landed - What Saves landed of the kinds read by area\n * @param windows - Each kind read by area's window\n * @param index - The revision the Index read each kind it lists at (`index-area.ts`); none for a kind it reads none of\n * @param now - The revision each kind read by area's record reads at now, by its slot\n * @returns Each such kind's landed keys, by slot\n */\nexport function landedRead(landed: SchematicLanded, windows: SchematicWindowRows,\n    index: ReadonlyMap<string, string>, now: ReadonlyMap<string, string>): ReadonlyMap<string, readonly string[]> {\n    const out = new Map<string, readonly string[]>();\n    const sorts: readonly SortLanded<unknown>[] = [landed.items, landed.zones];\n    for (const sort of sorts) {\n        for (const [slot, rows] of sort) {\n            const window = windows.get(slot), listed = index.get(slot), at = now.get(slot);\n            if (window === undefined || readBefore(window.revision, at, rows) || (listed !== undefined && readBefore(listed, at, rows))) continue;\n            out.set(slot, [...rows.keys()]);\n        }\n    }\n    return out;\n}\n\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Which drafted rows of a kind read by area its narrowing holds (#1393,\n * #1398, `Schematic Builder Spec.md` §10.3, SC23), read in a component of its\n * own, as the Calendar's shared cells reader asks it of its drafts: each\n * drafted row a gesture did not create told by the row its editing session\n * began from — what its record held when the session first read it — asked of\n * the kind's source's narrowing in one `within` a kind (D28), as the far ends\n * of the links that touch a window are. A kind read by area reads only its\n * window, so a drafted row its window doesn't hold — moved off it, or placed\n * from the Backlog — is drawn where its draft places it, and only this says\n * whether the narrowing holds it: hidden, one it leaves out waits in its\n * session, drawn nowhere; dimmed, it draws as context — as every kind's\n * drafted row does (`drafted.ts`, `narrowing.ts`). A row a gesture created is\n * neither: no stored row names it.\n *\n * Each row's answer is kept at its kind's revision and narrowing, so a gesture\n * asks only of the rows it adds; while nothing narrows a kind, the narrowing\n * holds every row, and nothing is asked. While a new narrowing's answers are\n * in flight, the last narrowing's stand in, and the reader says so (`busy`):\n * the frame keeps what it draws standing in, retained, until they land (CL8).\n * A row a gesture drafts under the narrowing that stands — drawn, so the\n * narrowing holds it — draws as the narrowing's until its answer lands.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useRef } from \"react\";\nimport { StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { RecordSliceWhereType, type RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { getSomeorUndefined, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { recordSliceRevision, recordSliceWithin } from \"@elaraai/east-ui-components/internal\";\nimport { kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport type { SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport type { SchematicDrafts } from \"./drafted.js\";\n\n/** A record Slice's narrowing, decoded. */\ntype Where = ValueTypeOf<typeof RecordSliceWhereType>;\n/** A kind's source of the slice. */\ntype Part = ValueTypeOf<RecordSliceBindType>;\n\nconst sameWhere = equalFor(RecordSliceWhereType);\nconst stringEqual = equalFor(StringType);\n\n/** Which drafted rows of the kinds read by area their narrowing holds. */\nexport interface SchematicDraftsNarrowing {\n    /**\n     * Each kind read by area's drafted rows a gesture did not create, by its slot then by key: whether its narrowing holds\n     * each, by the row its session began from — every one, while nothing narrows it. A row whose answer is in flight is\n     * absent.\n     */\n    readonly held: ReadonlyMap<string, ReadonlyMap<string, boolean>>;\n    /** Whether a new narrowing's answers are in flight: the last narrowing's stand in meanwhile. */\n    readonly busy: boolean;\n}\n\n/** No drafted row asked of any narrowing. */\nexport const NO_DRAFTS_NARROWING: SchematicDraftsNarrowing = { held: new Map(), busy: false };\n\n/**\n * Whether a kind read by area's narrowing holds one of its drafted rows, as the reader answered (see the module docs).\n *\n * @param narrowing - What the reader answered\n * @param ref - The row's kind's slot and its key\n * @returns `true` held, `false` left out; `undefined` for a row not asked — one a gesture created, one of a kind read\n *   otherwise, or one whose answer is in flight\n */\nexport function draftHeld(narrowing: SchematicDraftsNarrowing, ref: SchematicRef): boolean | undefined {\n    return narrowing.held.get(ref.kind)?.get(ref.key);\n}\n\n/** One kind's answers, at a revision and a narrowing. */\ninterface Answered {\n    readonly revision: string;\n    readonly where: Where;\n    held: ReadonlyMap<string, boolean>;\n}\n\n/** What the reader keeps across reads, by each kind's slot: its answers now, and the last narrowing's every answer landed under. */\ninterface Kept {\n    readonly now: Map<string, Answered>;\n    readonly settled: Map<string, Answered>;\n}\n\n/**\n * Which of some rows a narrowing holds: each answer kept at the kind's revision and narrowing, the rows not yet answered\n * asked in one request, each at its key (#1549).\n *\n * @returns The answers, by key's text; `undefined` while the request is in flight\n */\nfunction answersOf(kept: Kept, slot: string, part: Part, revision: string, where: Where, rows: readonly { readonly key: string; readonly row: unknown }[],\n    keyed: KindKeys): ReadonlyMap<string, boolean> | undefined {\n    let answered = kept.now.get(slot);\n    if (answered === undefined || !stringEqual(answered.revision, revision) || !sameWhere(answered.where, where)) {\n        answered = { revision, where, held: new Map() };\n        kept.now.set(slot, answered);\n    }\n    const held = answered.held;\n    const asked = rows.filter(({ key }) => !held.has(key));\n    if (asked.length > 0) {\n        const answer = recordSliceWithin(part, where, asked.map(({ key, row }) => ({ key: keyed.keyOf(key), row })));\n        if (answer.type !== \"some\") return undefined;\n        // Only the drafted rows': a draft gone takes its answer with it.\n        const next = new Map(rows.flatMap(({ key }) => { const was = held.get(key); return was === undefined ? [] : [[key, was] as const]; }));\n        asked.forEach(({ key }, i) => next.set(key, answer.value[i] === true));\n        answered.held = next;\n    }\n    return answered.held;\n}\n\n/** Whether two answers say the same, kind by kind and row by row. */\nfunction sameAnswers(a: SchematicDraftsNarrowing, b: SchematicDraftsNarrowing): boolean {\n    if (a.busy !== b.busy || a.held.size !== b.held.size) return false;\n    for (const [slot, rows] of a.held) {\n        const other = b.held.get(slot);\n        if (other === undefined || other.size !== rows.size) return false;\n        for (const [key, held] of rows) if (other.get(key) !== held) return false;\n    }\n    return true;\n}\n\n/** No kind read by area. */\nconst NO_AREAS: ReadonlySet<string> = new Set();\n\n/**\n * Reads which drafted rows of the kinds read by area their narrowing holds (see the module docs), handing the frame what\n * it read only when that moves.\n *\n * @param props - The payload, the kinds read by area, the drafts, the row each drafted row's session began from — the\n *   editing's `held`: `undefined` for a row a gesture created — and where the answers go\n * @returns Nothing: it reads\n */\nexport function SchematicDraftsReader({ value, areas = NO_AREAS, drafts, original, onRead }: {\n    value: SchematicValue; areas?: ReadonlySet<string>; drafts: SchematicDrafts; original: (slot: string, key: string) => unknown;\n    onRead: (narrowing: SchematicDraftsNarrowing) => void;\n}): null {\n    const kept = useRef<Kept>({ now: new Map(), settled: new Map() });\n    const read = useCallback((): SchematicDraftsNarrowing => {\n        const chrome = getSomeorUndefined(value.slice);\n        const held = new Map<string, ReadonlyMap<string, boolean>>();\n        let busy = false;\n        for (const kind of [...value.items, ...value.zones]) {\n            const rows = drafts.items.get(kind.key) ?? drafts.zones.get(kind.key);\n            const part = areas.has(kind.key) ? sourcePart(chrome, kind.key) : undefined;\n            if (rows === undefined || rows.size === 0 || part === undefined) continue;\n            // The row each began from: none for a row a gesture created, which is neither the narrowing's nor out of it.\n            const began = [...rows.keys()].flatMap((key) => { const row = original(kind.key, key); return row === undefined ? [] : [{ key, row }]; });\n            if (began.length === 0) continue;\n            const where = part.read().where;\n            // Nothing narrows the kind: the narrowing holds every row.\n            if (where.size === 0) {\n                held.set(kind.key, new Map(began.map(({ key }) => [key, true] as const)));\n                continue;\n            }\n            const revision = recordSliceRevision(part);\n            const answers = revision.type === \"some\" ? answersOf(kept.current, kind.key, part, revision.value, where, began, kindKeys(kind.keyType)) : undefined;\n            if (answers !== undefined) {\n                kept.current.settled.set(kind.key, kept.current.now.get(kind.key)!);\n                held.set(kind.key, answers);\n                continue;\n            }\n            // In flight: the narrowing's last answers stand in — a new narrowing's said to be read — and, under the narrowing\n            // that stands, a row not yet answered draws as the narrowing's.\n            const settled = kept.current.settled.get(kind.key);\n            if (settled === undefined) continue;\n            if (!sameWhere(settled.where, where)) busy = true;\n            held.set(kind.key, settled.held);\n        }\n        return held.size === 0 && !busy ? NO_DRAFTS_NARROWING : { held, busy };\n    }, [value, areas, drafts, original]);\n    const { result } = useTrackedEvaluation(read);\n    const reported = useRef<SchematicDraftsNarrowing>(NO_DRAFTS_NARROWING);\n    useLayoutEffect(() => {\n        // A read that fails leaves every drafted row as the narrowing's: the frame's line says why its source failed.\n        const now = result.ok ? result.value : NO_DRAFTS_NARROWING;\n        if (sameAnswers(reported.current, now)) return;\n        reported.current = now;\n        onRead(now);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's editing (#1388, `Schematic Builder Spec.md` §7): one history\n * over a session per record it writes — each kind bound with its patch door,\n * its items, zones, links and nets alike, and each kind's details so bound —\n * through the shared Schedule editing (`shared/schedule/editing.ts`'\n * `useScheduleEditing`), as the Roster's and the Allocation's are. A gesture\n * is one step across the records it changes; Save sends each record's changes\n * as its own request through its patch door, and a conflict or a refusal\n * keeps that record's drafts and leaves the others' commits standing (SC6).\n *\n * - **Its reads.** A kind read whole is a session over its record's\n *   snapshot. A kind read through its source of the slice is read by key\n *   through its `entries`: what its source's read holds, kept at the revision\n *   it was read at, serves a gesture's original and a Save's confirmation, and\n *   a row it does not hold is read by its key. A kind read by area (#1393) is\n *   the same, its window's rows serving while they are at the record's\n *   revision, and then the rows the paged Backlog's pages read at it — a drop\n *   placing one records at once. Drafts of rows the narrowing hides, or the\n *   window does not hold, stay in their sessions, and Save sends them (SC23).\n * - **Its writes.** A gesture's edits (`edits.ts`) go through the kinds' own\n *   functions: an existing row is rewritten from the row as its session finds\n *   it — drafted, else as the record holds it — through its kind's `write`, so\n *   only its roles' fields move (SC2); a new row is its kind's `create`, under\n *   the key its kind makes (`newKey`, below); a deleted one is removed. A drop (#1390) writes the same\n *   way: a template's new item through its kind's `create`; a link or net\n *   template's values over a link or a net through its kind's `create` over\n *   the ends or the sides its row holds, so they and its key stay as they are\n *   (SC11); an author's card's fields through its kind's `set`. The\n *   inspector's (#1391) the same: a field of its form through the `set` of\n *   the row's record or its details record, and the row a kind's own Details\n *   hands back, whole. A gesture any of whose rows its kind refuses records\n *   nothing.\n * - **A new row's key (#1549)** is its kind's to make (`newKey`): built from\n *   the row by the kind's `key`; else, keyed by String, minted unique among\n *   every key the Schematic has read and drafted (`mintKey`, SC7); by Integer,\n *   one past the largest the record, the drafts and the gesture hold — a kind\n *   read by key asking its record for its largest; by any type the form types,\n *   a placeholder — a text minted that no key prints as — which holds Save\n *   until the viewer types its key in the inspector, the app's check asked of\n *   the rows under keys alone; and by any other, none: the kind adds no row\n *   (`untyped`). A row whose kind builds its key from its fields moves under\n *   the key a gesture's edit of them builds (`moves`), its details row with it.\n * - **A number its field's bounds don't hold (#1585).** Each record's form\n *   goes with it (`fields`): a changed row whose number is under its least or\n *   over its most holds Save, as the app's check does, and Issues names it.\n * - **Its drafts.** Each draft is read once for its version and the original\n *   beside it (`shared/schedule/drafted-rows.ts`): its roles through its\n *   kind's `read` — a row under a placeholder as keyed by its key type's\n *   default — whether its draft adds it, and the roles of the row its session\n *   began from — what the frame draws over the stored rows (`drafted.ts`), and\n *   where a kind read by area's Backlog lists it (`backlog.ts`).\n * - **What a Save landed.** A kind read by area draws its rows from its\n *   window, which a Save's confirmation does not read again: its session keeps\n *   what each Save landed (`drawsLanded`, `EditSession.landed`), each row\n *   decoded once, which the frame draws over a window read before the commit\n *   (`drafted.ts`' `landedDrafts`) and lets go once the window is read since\n *   (`shown`).\n * - **What stands in.** While what the canvas draws stands in for a new\n *   narrowing, or a narrowing the frame follows could not be read, it is\n *   retained (#1398, CL8): no record takes an edit — every route asks\n *   `available`, and `record` records nothing — until it lands. The history's\n *   Undo, Redo, Discard and Save stay live.\n *\n * A Schematic read only (`readOnly`) has no session, nor has a kind bound read\n * only (SC14).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { StringType, equalFor, some, variant, type EastTypeValue, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport type { EditingReadinessType, RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport type { EditHistory, LandedEntry, Origin } from \"@elaraai/east-ui-components\";\nimport { draftedOf, type DraftedRows, type DraftedRowsKind } from \"../shared/schedule/drafted-rows.js\";\nimport {\n    useScheduleEditing,\n    type ScheduleChange, type ScheduleEditing, type ScheduleEditingKind, type ScheduleEditingRecord, type ScheduleEntryRef, type ScheduleRowRead,\n    type ScheduleStandingRows,\n} from \"../shared/schedule/editing.js\";\nimport { kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { draftedRow, heldInWindow, keptAtRevision, madeFromValues, mintKey, rowCodec } from \"../shared/schedule/records.js\";\nimport { useDraftedRows } from \"../shared/schedule/use-drafted-rows.js\";\nimport type { SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicHeldRows, SchematicValue, SchematicWindowRows } from \"./data.js\";\nimport { NO_LANDED, type LandedRow, type SchematicDrafts, type SchematicLanded, type SortDrafts, type SortLanded } from \"./drafted.js\";\nimport type { SchematicEdit } from \"./edits.js\";\nimport { detailsKey } from \"./record-keys.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** No event kind: the Schematic writes its kinds a whole row at a time, as records. */\nconst NO_KINDS: readonly ScheduleEditingKind[] = [];\n\n/** No session made elsewhere joins the Schematic's history. */\nconst NO_JOINED: Parameters<typeof useScheduleEditing>[0][\"joined\"] = [];\n\n// What the history names each record by: pure, in a module of its own, so what reads it needs no editing.\nexport { detailsKey, recordSlot } from \"./record-keys.js\";\n\n/** A drafted row's readiness, as a kind's check gives it. */\ntype Readiness = ValueTypeOf<typeof EditingReadinessType>;\n\n/** What the Schematic's editing says of a new row's key (#1549). */\nexport interface SchematicKeyWords {\n    /** A new row held under a placeholder, its key still to be typed — `Type this rack's key: Save waits for it`; `name` is its kind's. */\n    readonly placeholder: (p: { name: string }) => string;\n}\n\n/** A new row's key, as its kind makes it (#1549). */\nexport type SchematicNewKey =\n    /** Its key: built from its row, minted, one past the largest, or a placeholder until the viewer types its key. */\n    | { readonly key: string }\n    /** None: the key its row builds is held already, by the row of that key. */\n    | { readonly taken: string }\n    /** None: its kind's keys are of a type the form can't type — by the type's name — and its kind builds none. */\n    | { readonly untyped: string };\n\n/** A row a gesture moves under the key its fields build once the gesture writes them (#1549). */\nexport interface SchematicMove {\n    /** The row. */\n    readonly ref: SchematicRef;\n    /** The key its row builds after the gesture. */\n    readonly to: string;\n}\n\n/** The Schematic's editing: its history, every kind's drafts, and how a gesture is recorded. */\nexport interface SchematicEditing {\n    /** The shared Schedule editing over the records: each one's session, and what each holds. */\n    readonly schedule: ScheduleEditing;\n    /** The one history over them. */\n    readonly history: EditHistory<ScheduleEntryRef>;\n    /** Whether any record is edited: a kind or a details record bound with its patch door, and the Schematic not read only. */\n    readonly edits: boolean;\n    /** Every kind's drafts, by sort, each decoded once. */\n    readonly drafts: SchematicDrafts;\n    /**\n     * What each confirmed Save landed of the kinds read by area, as their sessions keep it (`EditSession.landed`), each\n     * row decoded once: drawn as the Save left it over a window read before the commit (`drafted.ts`' `landedDrafts`).\n     */\n    readonly landed: SchematicLanded;\n    /** The history's version: it moves with every change of it or of its sessions. */\n    readonly version: number;\n    /**\n     * Lets go of what Saves landed of a kind's rows, once its reads draw them as the record holds them now (`drafted.ts`'\n     * `landedRead`).\n     *\n     * @param slot - The kind's slot\n     * @param keys - The rows' keys\n     */\n    shown(slot: string, keys: readonly string[]): void;\n    /**\n     * Whether a record takes an edit now: its session takes one, and nothing the canvas draws is retained (#1398, CL8).\n     *\n     * @param record - The record's key in the history: a kind's slot, or its details' (`detailsKey`)\n     * @returns Whether it takes one\n     */\n    available(record: string): boolean;\n    /**\n     * Records one gesture's edits as one step of the history.\n     *\n     * @param edits - The rows it changes, and how\n     * @param origin - The gesture\n     * @param label - Its label in the history\n     * @returns Whether anything was recorded: nothing is when a kind refuses a row, a row's read is in flight, or what the\n     *   canvas draws is retained\n     */\n    record(edits: readonly SchematicEdit[], origin: Origin, label: string): boolean;\n    /**\n     * Whether a record is edited at all: a kind or a details record bound with its patch door, and the Schematic not read\n     * only (SC14).\n     *\n     * @param record - The record's key in the history: a kind's slot, or its details' (`detailsKey`)\n     */\n    edited(record: string): boolean;\n    /**\n     * A new row's key, as its kind makes one (#1549; the module docs): built from the row the edit makes, by the kind's\n     * `key`, refused where a row stands under it; else, keyed by String, minted unique (SC7); by Integer, one past the\n     * largest; by a type the form types, a placeholder; by any other, none.\n     *\n     * @param made - The edit making the row — an item's, a link's or a net's — under any key: its kind's, and the row the\n     *   kind's `key` builds a key from\n     * @param minted - The keys the gesture has made already\n     * @returns The key, or why there is none; `undefined` while a kind read by key asks its record for its largest, or\n     *   where the kind makes no row of the edit\n     */\n    newKey(made: SchematicEdit, minted?: ReadonlySet<string>): SchematicNewKey | undefined;\n    /**\n     * Whether the Schematic holds a key of a kind already: read, or drafted — a new row's among them. A kind read by key\n     * knows the keys its reads hold: a key e3 holds unread is its Save's conflict.\n     *\n     * @param slot - The kind's slot\n     * @param key - The key's text\n     */\n    taken(slot: string, key: string): boolean;\n    /**\n     * Whether a row of a kind stands under a key (#1549): drafted, else read — a key whose row a draft deletes stands\n     * free, so a row built under it again takes it back.\n     *\n     * @param slot - The kind's slot\n     * @param key - The key's text\n     */\n    stands(slot: string, key: string): boolean;\n    /**\n     * The rows a gesture moves under the keys their fields build once it writes them (#1549): each row it finds held —\n     * never one it makes — whose kind builds its key from its row, where the key its row builds changes, to another than\n     * the one it stands under — a row whose fields an app wrote apart from its key, edited back to build it, stays (#1581).\n     *\n     * @param edits - The gesture's edits\n     * @returns Each row it moves, and the key it moves under\n     */\n    moves(edits: readonly SchematicEdit[]): SchematicMove[];\n    /**\n     * Whether a kind builds a new row's key from its row: its `key` (#1549).\n     *\n     * @param slot - The kind's slot\n     */\n    builds(slot: string): boolean;\n    /**\n     * Why a kind adds no row (#1549): its keys are of a type the form can't type, and it builds none.\n     *\n     * @param slot - The kind's slot\n     * @returns The key type's name; `undefined` for a kind that keys the rows it adds\n     */\n    untyped(slot: string): string | undefined;\n    /**\n     * Whether the viewer types a kind's new rows' keys (#1549): it makes none of its own — keyed by neither String nor\n     * Integer, and building none — and the form types its key type. A new row waits under a placeholder until it is typed.\n     *\n     * @param slot - The kind's slot\n     */\n    keysTyped(slot: string): boolean;\n}\n\n/** A kind of any sort, as the payload carries it. */\ntype AnyKind = SchematicValue[\"items\"][number] | SchematicValue[\"zones\"][number] | SchematicValue[\"links\"][number] | SchematicValue[\"nets\"][number];\n\n/** An Option's value, or `undefined`. */\nfunction someOf<T>(value: option<T>): T | undefined {\n    return value.type === \"some\" ? value.value : undefined;\n}\n\n/** Every kind of the payload, in the Schematic's order of its sorts: items', zones', links' and nets'. */\nfunction kindsOf(value: Pick<SchematicValue, \"items\" | \"zones\" | \"links\" | \"nets\">): readonly AnyKind[] {\n    return [...value.items, ...value.zones, ...value.links, ...value.nets];\n}\n\n/** A kind of the payload, by its slot; `undefined` for none — a details record's key among them. */\nfunction kindOf(value: Pick<SchematicValue, \"items\" | \"zones\" | \"links\" | \"nets\">, slot: string): AnyKind | undefined {\n    return kindsOf(value).find((kind) => stringEqual(kind.key, slot));\n}\n\n/**\n * The function a kind builds a new row's key from its row with (#1549): its `key`.\n *\n * @param kind - The kind\n * @returns It; `undefined` for a kind that builds none — a zone's among them\n */\nfunction builderOf(kind: AnyKind | undefined): ((row: Uint8Array) => string) | undefined {\n    return kind === undefined || !(\"rowKey\" in kind) ? undefined : someOf(kind.rowKey);\n}\n\n/** Whether a kind's new rows wait under a placeholder for the viewer to type their keys (#1549): it makes none of its own. */\nfunction placeholdersOf(kind: AnyKind): boolean {\n    return !kindKeys(kind.keyType).text && kind.keyType.type !== \"Integer\" && builderOf(kind) === undefined;\n}\n\n/** A record a change names, as a row is found in it: its row type, its read by key, and its keys — a details record's its kind's. */\ninterface RecordSide {\n    readonly rowType: EastTypeValue;\n    readonly entries: ScheduleEditingRecord[\"entries\"];\n    readonly keys: KindKeys;\n}\n\n/** A row as a gesture finds it: its bytes, none — never held, or deleted by a draft — or its read in flight. */\ntype RowFound = { readonly state: \"held\"; readonly row: Uint8Array } | { readonly state: \"absent\" } | { readonly state: \"reading\" };\n\nconst ABSENT_ROW: RowFound = { state: \"absent\" };\nconst READING_ROW: RowFound = { state: \"reading\" };\n\n/** Every row ready: what a placeholder's details row is, its own row holding Save. */\nconst READY: Readiness = variant(\"ready\", null);\n\n/** No key a gesture has made. */\nconst NO_MINTED: ReadonlySet<string> = new Set<string>();\n\n/**\n * The Schematic's sessions over its records, and their drafts (see the module\n * docs).\n *\n * @param value - The payload\n * @param storageKey - The Schematic's key: its sessions and their history are kept under it\n * @param recordSlices - The slice's parts over the kinds read through their sources: each Save notice counts what leaves its own\n * @param held - Each kind's rows its read holds: the keys a new row's key is minted unique among\n * @param areas - The kinds read by area, by slot: never read whole, nor their narrowing complete\n * @param windows - The rows each kind read by area holds in its window, at the revision they were read at\n * @param words - What the editing says of a new row's key\n * @param paged - A row of a kind read by area the paged Backlog's pages read, by the kind's slot and the row's key, and the\n *   revision they read it at (#1393): asked as a gesture reads it, for a row the window does not hold\n * @param retained - Whether what the canvas draws is retained (#1398, CL8): no record takes an edit while it is\n * @returns The editing\n */\nexport function useSchematicEditing(value: SchematicValue, storageKey: string, recordSlices: readonly ValueTypeOf<RecordSliceBindType>[],\n    held: SchematicHeldRows, areas: ReadonlySet<string>, windows: SchematicWindowRows, words: SchematicKeyWords,\n    paged?: (slot: string, key: string) => { readonly revision: string; readonly row: Uint8Array } | undefined, retained = false): SchematicEditing {\n    const kinds = useMemo((): readonly AnyKind[] => kindsOf({ items: value.items, zones: value.zones, links: value.links, nets: value.nets }),\n        [value.items, value.zones, value.links, value.nets]);\n    // The words as they stand when the history's check is made.\n    const wordsNow = useRef(words);\n    wordsNow.current = words;\n    // Each kind bound with its patch door, and each one's details so bound, in the Schematic's order of its sorts — none\n    // while the Schematic is read only — each with its form: a changed row's number outside its field's bounds holds Save\n    // as the app's check does (#1585).\n    const records = useMemo((): ScheduleEditingRecord[] => {\n        if (value.readOnly) return [];\n        const out: ScheduleEditingRecord[] = [];\n        for (const kind of kinds) {\n            const keys = kindKeys(kind.keyType);\n            // A kind whose new rows wait under a placeholder (#1549): the app's check is asked of the rows under keys alone —\n            // it reads each key back at the kind's key type — and a row under a placeholder waits on its key, its details\n            // row ready, its own row holding Save.\n            const waiting = (ready: ScheduleEditingRecord[\"ready\"], verdict: () => Readiness): ScheduleEditingRecord[\"ready\"] => (!placeholdersOf(kind) ? ready\n                : some((batch: { id: string; entry: Uint8Array }[]): Readiness[] => {\n                    const verdicts = batch.map(({ id }): Readiness => (keys.isKey(id) ? READY : verdict()));\n                    const app = ready === undefined ? undefined : someOf(ready);\n                    const rest = batch.flatMap((entry, i) => (keys.isKey(entry.id) ? [{ entry, i }] : []));\n                    if (app !== undefined && rest.length > 0) app(rest.map(({ entry }) => entry)).forEach((said, n) => { verdicts[rest[n]!.i] = said; });\n                    return verdicts;\n                }));\n            if (kind.editable && kind.editing.type === \"some\") {\n                const ready = waiting(kind.ready, () => variant(\"incomplete\", [{ field: \"\", message: wordsNow.current.placeholder({ name: kind.name }) }]));\n                // A kind read by area draws its rows from its window, which a Save's confirmation doesn't read: its session\n                // keeps what each Save landed, drawn until the window is read again.\n                out.push({ key: kind.key, name: kind.name, editing: kind.editing.value, entries: kind.entries, ready, fields: kind.fields, drawsLanded: areas.has(kind.key) });\n            }\n            const details = someOf(kind.details);\n            if (details !== undefined && details.editable && details.editing.type === \"some\") {\n                out.push({\n                    key: detailsKey(kind.key), name: `${kind.name} details`, editing: details.editing.value, entries: details.entries,\n                    ready: waiting(details.ready, () => READY), fields: details.fields,\n                });\n            }\n        }\n        return out;\n    }, [kinds, value.readOnly, areas]);\n    // Each record a change names, by its key in the history — a kind's own and its details' — as a row is found in it.\n    const sides = useMemo(() => {\n        const out = new Map<string, RecordSide>();\n        for (const kind of kinds) {\n            const keys = kindKeys(kind.keyType);\n            out.set(kind.key, { rowType: kind.rowType, entries: kind.entries, keys });\n            const details = someOf(kind.details);\n            if (details !== undefined) out.set(detailsKey(kind.key), { rowType: details.rowType, entries: details.entries, keys });\n        }\n        return out;\n    }, [kinds]);\n    // The windows of the kinds read by area as they stand when a gesture or a Save reads them, and the Backlog's pages.\n    const windowsNow = useRef(windows);\n    useLayoutEffect(() => { windowsNow.current = windows; }, [windows]);\n    const pagedNow = useRef(paged);\n    useLayoutEffect(() => { pagedNow.current = paged; }, [paged]);\n    // The rows each kind read through its source last held, whatever revision they were read at.\n    const lastRows = useRef(new Map<string, ReadonlyMap<string, { readonly row: Uint8Array }>>());\n    // A kind read through its source: the rows its source's read holds, kept at the revision they were read at — a\n    // gesture's original, and what a Save confirms its entries by. A kind read by area: the rows its window holds,\n    // while they are at the record's revision; any other row is read by its key (#1393).\n    const reads = useMemo((): Record<string, ScheduleRowRead> => {\n        const out: Record<string, ScheduleRowRead> = {};\n        for (const kind of kinds) {\n            if (!kind.editable || kind.entries.type !== \"some\") continue;\n            const entries = kind.entries.value;\n            if (areas.has(kind.key)) {\n                out[kind.key] = (key) => {\n                    const at = entries.revision();\n                    if (at.type !== \"some\") return undefined;\n                    const window = windowsNow.current.get(kind.key);\n                    const inWindow = window === undefined || !stringEqual(window.revision, at.value) ? undefined : heldInWindow(some(window.rows), key);\n                    if (inWindow !== undefined) return inWindow;\n                    // A row the window doesn't hold, a page of the Backlog read at the revision: a drop placing it (#1393).\n                    const page = pagedNow.current?.(kind.key, key);\n                    return page === undefined || !stringEqual(page.revision, at.value) ? undefined : some(some(page.row));\n                };\n                continue;\n            }\n            const rows = keptAtRevision<ReadonlyMap<string, { readonly row: Uint8Array }>>(kind.entries, () => kind.rows());\n            out[kind.key] = (key) => {\n                const read = rows();\n                // The rows last read stand on the canvas while the record's revision now is read.\n                if (read.type === \"some\") lastRows.current.set(kind.key, read.value);\n                return heldInWindow(read, key);\n            };\n        }\n        return out;\n    }, [kinds, areas]);\n    // What the canvas draws of each kind's rows now, at whatever revision they were read (`ScheduleStandingRows`): a kind\n    // read by area, its window's rows and the Backlog's pages; one read through its source, the rows its read last held.\n    // A gesture begins from them — the row its person sees — so one made while a window is read again, after a Save or\n    // another session's write, is taken at once (a Save never stops the editing).\n    const standing = useMemo((): { current: ScheduleStandingRows } => {\n        const out: Record<string, (id: string) => Uint8Array | undefined> = {};\n        for (const kind of kinds) {\n            if (!kind.editable || kind.entries.type !== \"some\") continue;\n            out[kind.key] = areas.has(kind.key)\n                ? (id) => windowsNow.current.get(kind.key)?.rows.get(id)?.row ?? pagedNow.current?.(kind.key, id)?.row\n                : (id) => lastRows.current.get(kind.key)?.get(id)?.row;\n        }\n        return { current: out };\n    }, [kinds, areas]);\n    const schedule = useScheduleEditing({ kinds: NO_KINDS, records, reads, standing, storageKey, joined: NO_JOINED, recordSlices, autosave: value.autosave });\n\n    // Each drafted row as its kind reads it, and whether its draft adds it: read again as its original moves — another\n    // session's removal of a row drafted here leaves the draft adding it — and the same rows while none does.\n    const draftedRows = useDraftedRows(schedule, kinds);\n    const drafts = useMemo((): SchematicDrafts => {\n        const sort = <R,>(sorted: readonly DraftedRowsKind<R>[]): SortDrafts<R> => {\n            const out = new Map<string, DraftedRows<R>>();\n            for (const kind of sorted) {\n                const rows = draftedOf(draftedRows, kind);\n                if (rows !== undefined) out.set(kind.key, rows);\n            }\n            return out;\n        };\n        return { items: sort(value.items), zones: sort(value.zones), links: sort(value.links), nets: sort(value.nets) };\n    }, [draftedRows, value.items, value.zones, value.links, value.nets]);\n\n    // What each Save landed of a kind read by area, each row decoded once: a session keeps a landed entry the same object\n    // until it lets it go.\n    const landedDecoded = useRef(new WeakMap<LandedEntry<ScheduleEntryRef>, LandedRow<unknown>>());\n    const version = schedule.version;\n    const landed = useMemo((): SchematicLanded => {\n        const sort = <R,>(sorted: readonly {\n            readonly key: string; readonly rowType: EastTypeValue; readonly keyType: EastTypeValue; readonly read: (bytes: Uint8Array, key: string) => R;\n        }[]): SortLanded<R> => {\n            const out = new Map<string, ReadonlyMap<string, LandedRow<R>>>();\n            for (const kind of sorted) {\n                if (!areas.has(kind.key)) continue;\n                const entries = schedule.sessions.find((part) => stringEqual(part.kind, kind.key))?.session.landed;\n                if (entries === undefined || entries.size === 0) continue;\n                const codec = rowCodec(kind.rowType);\n                const keys = kindKeys(kind.keyType);\n                const rows = new Map<string, LandedRow<R>>();\n                for (const [id, entry] of entries) {\n                    let row = landedDecoded.current.get(entry) as LandedRow<R> | undefined;\n                    if (row === undefined) {\n                        // A row the Save deleted is none; one it added, a row no read held before it.\n                        const after = draftedRow(entry.after);\n                        const bytes = after === undefined ? undefined : codec.encode(after.row);\n                        row = {\n                            drawn: bytes === undefined ? undefined : { roles: kind.read(bytes, keys.readKey(id)), created: draftedRow(entry.before) === undefined },\n                            row: bytes, from: entry.from,\n                        };\n                        landedDecoded.current.set(entry, row);\n                    }\n                    rows.set(id, row);\n                }\n                out.set(kind.key, rows);\n            }\n            return out;\n        };\n        // Nothing landed is the one object, so what reads it holds still while gestures move the history.\n        const items = sort(value.items), zones = sort(value.zones);\n        return items.size === 0 && zones.size === 0 ? NO_LANDED : { items, zones };\n        // What the sessions keep moves with the history's version.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [version, schedule.sessions, areas, value.items, value.zones]);\n\n    // Stable to the canvas: each runs the latest render's.\n    const latest = useRef({ value, schedule, held, retained, reads, sides });\n    latest.current = { value, schedule, held, retained, reads, sides };\n    const shown = useCallback((slot: string, keys: readonly string[]): void => {\n        latest.current.schedule.sessions.find((part) => stringEqual(part.kind, slot))?.session.shown(keys);\n    }, []);\n    // Retained, no record takes an edit: every route asks it, and `record` refuses one (#1398, CL8).\n    const scheduleAvailable = schedule.available;\n    const available = useCallback((slot: string): boolean => !retained && scheduleAvailable(slot), [retained, scheduleAvailable]);\n    const editedRecords = useMemo(() => new Set(records.map((record) => record.key)), [records]);\n    const edited = useCallback((record: string): boolean => editedRecords.has(record), [editedRecords]);\n    // A row as a gesture finds it: drafted, else as its record holds it — its read, else by its key.\n    const rowNow = useCallback((record: string, id: string): RowFound => {\n        const { schedule: editing, reads: own, sides: recorded } = latest.current;\n        const side = recorded.get(record);\n        if (side === undefined) return ABSENT_ROW;\n        const codec = rowCodec(side.rowType);\n        const entry = editing.sessions.find((part) => stringEqual(part.kind, record))?.session.entries.get(id);\n        if (entry !== undefined) {\n            const row = draftedRow(entry);\n            return row === undefined ? ABSENT_ROW : { state: \"held\", row: codec.encode(row.row) };\n        }\n        // A placeholder names no row a record holds (#1549): never sought.\n        if (!side.keys.isKey(id)) return ABSENT_ROW;\n        if (side.entries.type !== \"some\") {\n            const stored = editing.held(record, id);\n            return stored === undefined ? ABSENT_ROW : { state: \"held\", row: codec.encode(stored) };\n        }\n        let read: option<option<Uint8Array>>;\n        try {\n            read = own[record]?.(id) ?? side.entries.value.entry(id);\n        } catch (err) {\n            console.error(`[Schematic] ${record}'s row ${id} could not be read:`, err);\n            return READING_ROW;\n        }\n        if (read.type !== \"some\") return READING_ROW;\n        return read.value.type === \"some\" ? { state: \"held\", row: read.value.value } : ABSENT_ROW;\n    }, []);\n    // A gesture's edits as the shared editing records them, each row through its kind's own functions; `undefined` where\n    // a kind refuses one, or a row a move takes is gone or still read.\n    const changesOf = useCallback((edits: readonly SchematicEdit[]): ScheduleChange[] | undefined => {\n        const { value: payload } = latest.current;\n        const of = <K extends { readonly key: string }>(sorted: readonly K[], slot: string): K | undefined => sorted.find((kind) => stringEqual(kind.key, slot));\n        const changes: ScheduleChange[] = [];\n        for (const edit of edits) {\n            const slot = edit.ref.kind;\n            const id = edit.ref.key;\n            switch (edit.op) {\n                case \"remove\":\n                    changes.push({ kind: slot, id, remove: true });\n                    break;\n                case \"place\": {\n                    const kind = of(payload.items, slot);\n                    if (kind === undefined) return undefined;\n                    changes.push({ kind: slot, id, rewrite: (row) => someOf(kind.write(row, edit.at)) });\n                    break;\n                }\n                case \"ends\": {\n                    const kind = of(payload.links, slot);\n                    if (kind === undefined) return undefined;\n                    changes.push({ kind: slot, id, rewrite: (row) => someOf(kind.write(row, edit.ends)) });\n                    break;\n                }\n                case \"sides\": {\n                    const kind = of(payload.nets, slot);\n                    if (kind === undefined) return undefined;\n                    changes.push({ kind: slot, id, rewrite: (row) => someOf(kind.write(row, edit.sides)) });\n                    break;\n                }\n                case \"link\": {\n                    // A row the app's `values` fail to make (#1526), as one its kind refuses, records nothing.\n                    const kind = of(payload.links, slot);\n                    const row = kind === undefined ? undefined : madeFromValues(\"Schematic\", `a new ${kind.name}`, () => kind.create(edit.ends, edit.values));\n                    if (row?.type !== \"some\") return undefined;\n                    changes.push({ kind: slot, id, row: row.value, created: true });\n                    break;\n                }\n                case \"net\": {\n                    const kind = of(payload.nets, slot);\n                    const row = kind === undefined ? undefined : madeFromValues(\"Schematic\", `a new ${kind.name}`, () => kind.create(edit.sides, edit.values));\n                    if (row?.type !== \"some\") return undefined;\n                    changes.push({ kind: slot, id, row: row.value, created: true });\n                    break;\n                }\n                case \"item\": {\n                    const row = of(payload.items, slot)?.create(edit.at, edit.values);\n                    if (row === undefined || row.type !== \"some\") return undefined;\n                    changes.push({ kind: slot, id, row: row.value, created: true });\n                    break;\n                }\n                case \"retype\": {\n                    // A template's values over the ends or the sides the row holds as the gesture finds it: they and its key stay.\n                    const link = of(payload.links, slot);\n                    const net = link === undefined ? of(payload.nets, slot) : undefined;\n                    if (link !== undefined) {\n                        const key = kindKeys(link.keyType).readKey(id);\n                        changes.push({ kind: slot, id, rewrite: (row) => {\n                            const roles = link.read(row, key);\n                            return someOf(link.create({ from: roles.from, to: roles.to }, some(edit.values)));\n                        } });\n                    } else if (net !== undefined) {\n                        const key = kindKeys(net.keyType).readKey(id);\n                        changes.push({ kind: slot, id, rewrite: (row) => {\n                            const roles = net.read(row, key);\n                            return someOf(net.create({ sources: roles.sources, destinations: roles.destinations }, some(edit.values)));\n                        } });\n                    } else {\n                        return undefined;\n                    }\n                    break;\n                }\n                case \"set\": {\n                    // A field of the row, or of its details row (#1391), through its record's own setter.\n                    const kind = of(kindsOf(payload), slot);\n                    const side = edit.details === true ? (kind === undefined ? undefined : someOf(kind.details)) : kind;\n                    if (side === undefined) return undefined;\n                    changes.push({ kind: edit.details === true ? detailsKey(slot) : slot, id, rewrite: (row) => someOf(side.set(row, [...edit.sets])) });\n                    break;\n                }\n                case \"row\":\n                    // The row a kind's own Details hands back (#1391), whole.\n                    changes.push({ kind: edit.details === true ? detailsKey(slot) : slot, id, row: edit.row });\n                    break;\n                case \"move\": {\n                    // The row, or its details row, under its new key as the gesture finds it, and gone from its own (#1549): a\n                    // details row the record holds none of moves nothing; a row gone, or still read, refuses the gesture. In a\n                    // swap or a shift (#1581) it replaces the row moving off its new key, never a new one, and its own key,\n                    // which another row moves under, stays.\n                    const record = edit.details === true ? detailsKey(slot) : slot;\n                    const found = rowNow(record, id);\n                    if (found.state === \"reading\") return undefined;\n                    if (found.state === \"absent\") {\n                        if (edit.details === true) break;\n                        return undefined;\n                    }\n                    changes.push({ kind: record, id: edit.to, row: found.row, ...(edit.replaces === true ? {} : { created: true as const }) });\n                    if (edit.refilled !== true) changes.push({ kind: record, id, remove: true });\n                    break;\n                }\n            }\n        }\n        return changes;\n    }, [rowNow]);\n    const record = useCallback((edits: readonly SchematicEdit[], origin: Origin, label: string): boolean => {\n        const { schedule: editing, retained: standingIn } = latest.current;\n        if (standingIn) return false;\n        const changes = changesOf(edits);\n        return changes !== undefined && changes.length > 0 && editing.record(changes, origin, label);\n    }, [changesOf]);\n    const taken = useCallback((slot: string, key: string): boolean => {\n        const { schedule: editing, held: read } = latest.current;\n        const session = editing.sessions.find((part) => stringEqual(part.kind, slot))?.session;\n        return session?.entries.has(key) === true || read.get(slot)?.has(key) === true;\n    }, []);\n    const stands = useCallback((slot: string, key: string): boolean => {\n        const { schedule: editing, held: read } = latest.current;\n        const entry = editing.sessions.find((part) => stringEqual(part.kind, slot))?.session.entries.get(key);\n        if (entry !== undefined) return draftedRow(entry) !== undefined;\n        return read.get(slot)?.has(key) === true;\n    }, []);\n    const newKey = useCallback((made: SchematicEdit, minted: ReadonlySet<string> = NO_MINTED): SchematicNewKey | undefined => {\n        const { value: payload, schedule: editing } = latest.current;\n        const slot = made.ref.kind;\n        const kind = kindOf(payload, slot);\n        if (kind === undefined) return undefined;\n        const keys = kindKeys(kind.keyType);\n        const holds = (key: string): boolean => minted.has(key) || taken(slot, key);\n        // Built from the row the edit makes: refused where a row stands under it.\n        const build = builderOf(kind);\n        if (build !== undefined) {\n            const change = changesOf([made])?.[0];\n            const row = change !== undefined && \"row\" in change ? change.row : undefined;\n            if (row === undefined) return undefined;\n            let key: string;\n            try {\n                key = build(row);\n            } catch (err) {\n                console.error(`[Schematic] ${kind.name}'s key could not be built from a new row:`, err);\n                return undefined;\n            }\n            return minted.has(key) || stands(slot, key) ? { taken: key } : { key };\n        }\n        if (keys.text) return { key: mintKey(holds) };\n        if (kind.keyType.type === \"Integer\") {\n            const key = editing.mint(slot, \"\", minted);\n            return key === undefined ? undefined : { key };\n        }\n        // A placeholder: a text minted that no key prints as, until the viewer types its key.\n        if (keys.typed) return { key: mintKey((key) => keys.isKey(key) || holds(key)) };\n        return { untyped: kind.keyType.type };\n    }, [changesOf, taken, stands]);\n    const moves = useCallback((edits: readonly SchematicEdit[]): SchematicMove[] => {\n        const { value: payload } = latest.current;\n        const changes = changesOf(edits);\n        // A gesture touching no kind that builds its keys moves no row: its edits are never composed.\n        if (changes === undefined || !changes.some((change) => builderOf(kindOf(payload, change.kind)) !== undefined)) return [];\n        // Each row the gesture touches as it leaves it, the edits composed in order over the row as it finds it.\n        const at = (record: string, key: string): string => `${record}\\u0000${key}`;\n        const found = (record: string, key: string): Uint8Array | undefined => {\n            const got = rowNow(record, key);\n            return got.state === \"held\" ? got.row : undefined;\n        };\n        const now = new Map<string, Uint8Array | undefined>();\n        const made = new Set<string>();\n        const touched: { record: string; key: string }[] = [];\n        const seen = new Set<string>();\n        for (const change of changes) {\n            const id = at(change.kind, change.id);\n            if (!seen.has(id)) { seen.add(id); touched.push({ record: change.kind, key: change.id }); }\n            const was = now.has(id) ? now.get(id) : found(change.kind, change.id);\n            if (\"remove\" in change) now.set(id, undefined);\n            else if (\"row\" in change) {\n                now.set(id, change.row);\n                if (change.created === true) made.add(id);\n            } else if (\"rewrite\" in change && was !== undefined) {\n                try {\n                    now.set(id, change.rewrite(was) ?? was);\n                } catch {\n                    now.set(id, was);\n                }\n            }\n        }\n        const out: SchematicMove[] = [];\n        for (const { record, key } of touched) {\n            const id = at(record, key);\n            const kind = kindOf(payload, record);\n            const build = builderOf(kind);\n            const was = found(record, key);\n            const after = now.get(id);\n            if (made.has(id) || build === undefined || was === undefined || after === undefined) continue;\n            try {\n                const to = build(after);\n                if (!stringEqual(build(was), to) && !stringEqual(key, to)) out.push({ ref: { kind: record, key }, to });\n            } catch (err) {\n                console.error(`[Schematic] ${kind?.name ?? record}'s key could not be built from ${key}'s row:`, err);\n            }\n        }\n        return out;\n    }, [changesOf, rowNow]);\n    const builds = useCallback((slot: string): boolean => builderOf(kindOf(latest.current.value, slot)) !== undefined, []);\n    const untyped = useCallback((slot: string): string | undefined => {\n        const kind = kindOf(latest.current.value, slot);\n        if (kind === undefined || builderOf(kind) !== undefined) return undefined;\n        const keys = kindKeys(kind.keyType);\n        return keys.text || kind.keyType.type === \"Integer\" || keys.typed ? undefined : kind.keyType.type;\n    }, []);\n    const keysTyped = useCallback((slot: string): boolean => {\n        const kind = kindOf(latest.current.value, slot);\n        return kind !== undefined && placeholdersOf(kind) && kindKeys(kind.keyType).typed;\n    }, []);\n\n    return useMemo(() => ({\n        schedule, history: schedule.history, edits: records.length > 0, drafts, landed, version: schedule.version, shown, available, record, edited,\n        newKey, taken, stands, moves, builds, untyped, keysTyped,\n    }), [schedule, records.length, drafts, landed, shown, available, record, edited, newKey, taken, stands, moves, builds, untyped, keysTyped]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Find (#1387, #1404, §6.1): the toolbar's search over the item kinds' keys,\n * each kind sought in its own record, never in what the canvas draws — the\n * shared key search's item (`useKeySearchToolbarItem`), its box folding to its\n * icon, then into the View popover on a phone. ⌘F focuses it\n * (`focusKeySearch`).\n *\n * - **A kind read through its source of the slice** is sought in its record's\n *   own order, through e3: `recordSliceSeek` with no narrowing places the\n *   query's run, `recordSlicePage` reads the rows a list shows by position,\n *   each made its roles by the kind's `read`, and `recordSliceWithin` asks, in\n *   one request, which of them the rail's narrowing holds.\n * - **A kind read whole** is sought in its rows — every row of its record —\n *   its keys in East's order, as the server finds a key (`findKeyInline`).\n *\n * The query is the shared key search's: a key's start, a quoted key or a\n * range, keys case-sensitive, as the Sheet's Search Records takes it. The box\n * parses it at the item kinds' key type where they share one (#1549) — a\n * String key by its start, any other as typed, `10` finding the oven keyed by\n * the number 10 — and at String where they are keyed by several types, a kind\n * keyed otherwise reading the text as typed at its own ({@link kindQuery}).\n * The empty box lists the first matches of the kinds keyed by String alone.\n * The matches are one list: each kind's in its keys' order at its key type,\n * the kinds in the order the Schematic lists them, each kind's run after the\n * one before. A line names an item by its key, its label where it is not its\n * key, and its kind's name, and says what keeps it off the canvas: its layer,\n * or no position — and, where its kind's source's narrowing leaves it out,\n * which of the rail's choices do, as every builder's Search Records names them\n * (the shared hidden pick, `shared/schedule/hidden.ts`): `hidden by Owner:\n * Northwind Media — picking it clears that filter`, asked of e3 for the rows a\n * list shows that the narrowing leaves out, by the page the list read them\n * from, and `hidden by the filters` until it has said — or, where the\n * narrowing draws what it leaves out as context (`narrowed=\"dim\"`), `dimmed by\n * Owner: Northwind Media — …` and `dimmed by the filters`. A pick hands the\n * frame the item and what it knows of it — what hides it among it (`onPick`) —\n * and the box shows its key; the pick stands until the search is cleared or a\n * new query asked in its place, which the frame hears (`onCleared`), so what\n * it said of where the pick landed goes with it. The box asks its query again\n * when what its lines are read from moves — a source's record or its\n * narrowing, a kind read whole's rows, the layers hidden — and never when a\n * window of what the canvas draws lands, so a pick's fly keeps its place among\n * the matches: a query asked again leaves the pick standing. It lists its\n * lines again as e3 says which choices hide a row, and as the narrowing comes\n * to dim what it leaves out or to hide it (`relist`).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport {\n    EastTypeType, StringType, compareFor, equalFor, match, none, parseFor, printFor, type EastTypeValue, type ValueTypeOf, type option,\n} from \"@elaraai/east\";\nimport {\n    RecordSliceWhereType, findKeyInline, parseKeyInput, type DatasetKeyMatchRange, type DatasetKeyQuery, type RecordSliceBindType,\n} from \"@elaraai/east-ui/internal\";\nimport { useTrackedEvaluation, type KeySearchSource } from \"@elaraai/east-ui-components\";\nimport { awaitTracked, recordSlicePage, recordSliceRevision, recordSliceSeek, recordSliceWithin, toSeekQuery } from \"@elaraai/east-ui-components/internal\";\nimport { entityId, type ItemRoles, type SchematicRef } from \"./canvas/drawn.js\";\nimport { hiddenLine, hiddenOf, useRelist, type RowHidden, type SourceHidden } from \"../shared/schedule/hidden.js\";\nimport type { HiddenPicks } from \"../shared/schedule/hidden-pick.js\";\nimport { STRING_KEYS, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport type { RowCodec } from \"../shared/schedule/records.js\";\nimport type { HiddenWords } from \"../shared/schedule/words.js\";\nimport type { SchematicMessages, SchematicWords } from \"./messages.js\";\n\nconst compareKey = compareFor(StringType);\nconst keyEqual = equalFor(StringType);\nconst sameType = equalFor(EastTypeType);\nconst readString = parseFor(StringType);\nconst printWhere = printFor(RecordSliceWhereType);\n\n/** Each kind read whole's rows as read, numbered: what tells Find they were read again. */\nconst rowsIds = new WeakMap<object, number>();\nlet nextRowsId = 0;\n\n/** A kind read whole's rows, as a token that moves when they are read again; `-` while they are read. */\nfunction rowsToken(rows: option<ReadonlyMap<string, unknown>>): string {\n    const held = match(rows, { some: (value) => value }, undefined);\n    if (held === undefined) return \"-\";\n    let id = rowsIds.get(held);\n    if (id === undefined) {\n        id = nextRowsId++;\n        rowsIds.set(held, id);\n    }\n    return `rows:${id}`;\n}\n\n/** No narrowing: a record's own rows, in its order. */\nconst WHOLE: ValueTypeOf<typeof RecordSliceWhereType> = new Map();\n\n/** An empty box lists the first of the matches each item kind keyed by String holds: one keyed otherwise is sought as typed. */\nconst BROWSE_QUERY: DatasetKeyQuery = { prefix: \"\" };\n\n/** An Option's value, or `undefined`. */\nconst someOf = <T,>(opt: option<T>): T | undefined => match(opt, { some: (value) => value }, undefined);\n\n/** A record Slice's part, as a kind's source of the slice. */\ntype RecordPart = ValueTypeOf<RecordSliceBindType>;\n\n/** An entry of a record's window, as every record Slice binding reads one: its key, at the record's key type, and its row, joined. */\ninterface RecordEntry {\n    readonly key: unknown;\n    readonly row: option<unknown>;\n}\n\n/** One item kind, as Find seeks it. */\nexport interface FindKind {\n    /** Its slot. */\n    readonly slot: string;\n    /** Its name (`Rack`). */\n    readonly name: string;\n    /** Its source of the slice, whose record it is sought in, through e3; `undefined` for a kind read whole. */\n    readonly part: RecordPart | undefined;\n    /** Its rows, read whole — every row of its record, by key, each its roles; none while the read is in flight. */\n    readonly rows: () => option<ReadonlyMap<string, { readonly roles: ItemRoles }>>;\n    /** A stored row's roles, from its bytes and its key. */\n    readonly read: (bytes: Uint8Array, key: string) => ItemRoles;\n    /** Its record's rows, as bytes and back. */\n    readonly codec: RowCodec;\n    /** Its keys (#1549): each key's text read back at its record's key type, and their order. */\n    readonly keys: KindKeys;\n}\n\n/** One item Find found. */\nexport interface FoundItem {\n    /** Its id on the canvas: its reference, printed. */\n    readonly id: string;\n    /** Its kind's slot and its key. */\n    readonly ref: SchematicRef;\n    /** Its card's name. */\n    readonly label: string;\n    /** Its kind's name. */\n    readonly kind: string;\n    /** Its centre; `undefined` for a row with no position. */\n    readonly position: { readonly x: number; readonly y: number } | undefined;\n    /** The layer it is on, by the layer's key. */\n    readonly layer: string | undefined;\n    /**\n     * What leaves it out on the rail — its kind's source, and which of its choices e3 has said hide it (the shared hidden\n     * pick) — which a pick of it clears; `undefined` while the narrowing holds it.\n     */\n    readonly hidden: readonly RowHidden[] | undefined;\n}\n\n/** What keeps a found item off the canvas but the rail's filters, as its line marks it — or `undefined` while nothing does. */\nexport type FoundMark = \"layer\" | \"unplaced\" | undefined;\n\n/**\n * What keeps a found item off the canvas but the rail's filters, which its line names apart and a pick of it clears: no\n * position first, then a hidden layer.\n *\n * @param item - The item found\n * @param hiddenLayers - The layers hidden, by key\n * @returns Its mark\n */\nexport function foundMark(item: FoundItem, hiddenLayers: ReadonlySet<string>): FoundMark {\n    if (item.position === undefined) return \"unplaced\";\n    return item.layer !== undefined && hiddenLayers.has(item.layer) ? \"layer\" : undefined;\n}\n\n/**\n * The words a line names the choices that leave an item out in, where the narrowing draws what it leaves out as context\n * (`narrowed=\"dim\"`): they dim it, never hide it.\n *\n * @param m - The Schematic's message table\n * @returns Its dimmed words, as the shared hidden pick's line takes them\n */\nfunction dimmedWords(m: SchematicMessages): HiddenWords {\n    return { hiddenByFilters: m.dimmedByFilters, hiddenBy: m.dimmedBy };\n}\n\n/**\n * How a found item reads in Find's list: its key, its label when it is not its key, its kind's name, what keeps it off\n * the canvas — its layer, or no position — and, last, which of the rail's choices leave it out, as every builder's line\n * names them (`hiddenLine`): `hidden by the filters` until e3 has said which — or, where the narrowing draws what it\n * leaves out as context, `dimmed by the filters`, then the choices that dim it.\n *\n * @param item - The item\n * @param mark - What keeps it off the canvas but the filters\n * @param words - The Schematic's words\n * @param dim - Whether the narrowing draws what it leaves out as context (`narrowed=\"dim\"`), rather than hiding it\n * @returns Its line\n */\nexport function foundLine(item: FoundItem, mark: FoundMark, words: SchematicWords, dim: boolean): string {\n    const parts = keyEqual(item.label, item.ref.key) ? [item.ref.key, item.kind] : [item.ref.key, item.label, item.kind];\n    return [\n        ...parts,\n        ...(mark === undefined ? [] : [words.m.findMark({ mark })]),\n        ...(item.hidden === undefined ? [] : [hiddenLine(item.hidden, words, dim ? dimmedWords(words.m) : words.m)]),\n    ].join(\" · \");\n}\n\n/**\n * The keys of a kind read whole that a query finds, in East's order at the kind's key type (#1549): as the server finds a\n * key in a record's own order (`findKeyInline`) — a key's start, a quoted key, a range.\n *\n * @param keys - The kind's keys' texts, in any order\n * @param query - The query, as the kind seeks it ({@link kindQuery})\n * @param keyed - The kind's keys: each text read back at its key type, and their order; String's by default\n * @returns The texts of the keys it finds, in their keys' order\n */\nexport function wholeMatches(keys: readonly string[], query: DatasetKeyQuery, keyed: KindKeys = STRING_KEYS): string[] {\n    // A text no key prints as is no key a query finds.\n    const sought = keyed.order(keys).filter(({ key }) => key !== undefined);\n    const range = findKeyInline(keyed.keyType, sought.map(({ key }) => key), query);\n    return range.found ? sought.slice(range.row, range.row + range.count).map(({ text }) => text) : [];\n}\n\n/**\n * The text a query the box parsed at String was typed as: a key's start as itself, a quoted key as its literal, a range\n * by its ends' texts — what a kind keyed by another type reads as typed.\n *\n * @param query - The query, parsed at String\n * @returns The text\n */\nfunction typedText(query: DatasetKeyQuery): string {\n    if (\"key\" in query) return query.key;\n    if (\"from\" in query || \"to\" in query) {\n        const end = (literals: readonly string[] | undefined): string => {\n            const literal = literals?.[0];\n            const read = literal === undefined ? undefined : readString(literal);\n            return read?.success === true ? read.value : \"\";\n        };\n        return `${end(query.from)}..${end(query.to)}`;\n    }\n    return \"prefix\" in query ? query.prefix : \"\";\n}\n\n/**\n * A query the box parsed, as one kind seeks it (#1549): as it is where the box parses at the kind's key type; else — the\n * box at String, over item kinds keyed by several types — the text as typed, read at the kind's as the shared key search\n * reads it (`parseKeyInput`): `10` the key 10 of a kind keyed by Integer, `2..9` a range of them.\n *\n * @param query - The query the box parsed\n * @param box - The key type the box parses at\n * @param keyed - The kind's keys\n * @returns The query the kind is sought by; `undefined` where the text reads as no key of the kind's, which finds none of\n *   its rows\n */\nexport function kindQuery(query: DatasetKeyQuery, box: EastTypeValue, keyed: KindKeys): DatasetKeyQuery | undefined {\n    if (sameType(box, keyed.keyType)) return query;\n    const parsed = parseKeyInput(keyed.keyType, typedText(query));\n    return parsed.kind === \"query\" ? parsed.query : undefined;\n}\n\n/** One kind's matches: a run of its record's rows, from `start`, or a kind read whole's keys. */\nexport interface FindRun {\n    /** The kind. */\n    readonly kind: FindKind;\n    /** Where its matches start, in its record's own order: a kind read through its source. */\n    readonly start: number;\n    /** How many it finds. */\n    readonly count: number;\n    /** A kind read whole's matches' keys, in order. */\n    readonly keys: readonly string[] | undefined;\n}\n\n/**\n * The runs a list's rows `[row, row + limit)` fall in: each kind's matches after the one before.\n *\n * @param runs - Each kind's matches, in the Schematic's order of its kinds\n * @param row - The list's first row\n * @param limit - How many rows\n * @returns Each run's part of the rows: the run, the first of its matches, how many, and the list's row it is at\n */\nexport function runsAt(runs: readonly FindRun[], row: number, limit: number): { run: FindRun; offset: number; n: number; at: number }[] {\n    const out: { run: FindRun; offset: number; n: number; at: number }[] = [];\n    let base = 0;\n    for (const run of runs) {\n        const from = Math.max(row, base), to = Math.min(row + limit, base + run.count);\n        if (from < to) out.push({ run, offset: from - base, n: to - from, at: from });\n        base += run.count;\n    }\n    return out;\n}\n\n/** An item found, from its kind's roles of its row, and what leaves it out on the rail. */\nfunction foundOf(kind: FindKind, key: string, roles: ItemRoles, hidden: readonly RowHidden[] | undefined): FoundItem {\n    const ref = { kind: kind.slot, key };\n    const position = someOf(roles.position);\n    return {\n        id: entityId(ref), ref, label: roles.label, kind: kind.name,\n        position: position === undefined ? undefined : { x: position.x, y: position.y }, layer: someOf(roles.layer), hidden,\n    };\n}\n\n/**\n * Some of a kind's matches, read: a kind read through its source's rows by position, through e3, and which of them its\n * narrowing leaves out in one request — those it does asked of e3 which choices do, by the page they were read from\n * (the kind's hidden pick's `askListed`); a kind read whole's from its rows.\n *\n * @param run - The kind's matches\n * @param offset - The first of them the list shows\n * @param n - How many\n * @param pick - The kind's hidden pick; `undefined` for a kind read whole\n * @returns The items, in order\n */\nasync function matchesOf(run: FindRun, offset: number, n: number, pick: SourceHidden | undefined): Promise<FoundItem[]> {\n    const { kind } = run;\n    if (kind.part === undefined || run.keys !== undefined) {\n        const rows = await awaitTracked(() => kind.rows());\n        return (run.keys ?? []).slice(offset, offset + n).flatMap((key) => {\n            const roles = rows.get(key)?.roles;\n            return roles === undefined ? [] : [foundOf(kind, key, roles, undefined)];\n        });\n    }\n    const part = kind.part;\n    const from = run.start + offset;\n    // Each entry by its key's text (#1549), the narrowing asked of it at its key.\n    const entries = await awaitTracked(() => recordSlicePage(part, { where: WHOLE, area: none }, BigInt(from), BigInt(n))) as readonly RecordEntry[];\n    const listed = entries.map((entry) => ({ key: kind.keys.textOf(entry.key), at: entry.key, row: someOf(entry.row) }));\n    const rows = listed.flatMap(({ key, at, row }) => (row === undefined ? [] : [{ key, at, row }]));\n    const where = part.read().where;\n    const within = where.size === 0 ? undefined\n        : await awaitTracked(() => recordSliceWithin(part, where, rows.map(({ at, row }) => ({ key: at, row }))));\n    // Whether the narrowing holds each row read, in order; every entry of the page with it — one with no row asks nothing.\n    const held = rows.map((_row, i) => within === undefined || within[i] === true);\n    let at = 0;\n    const holds = listed.map(({ row }) => (row === undefined ? true : held[at++]!));\n    if (within !== undefined && pick !== undefined) pick.rows.askListed(from, listed.map(({ key }) => key), holds);\n    return rows.map(({ key, row }, i) => foundOf(kind, key, kind.read(kind.codec.encode(row), key),\n        held[i] || pick === undefined ? undefined : hiddenOf([{ pick, id: key }])));\n}\n\n/** Props of {@link useSchematicFind}. */\nexport interface SchematicFindProps {\n    /** The item kinds, in the Schematic's order. */\n    readonly kinds: readonly FindKind[];\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /**\n     * Each kind's hidden pick, by its slot (`hidden-pick.tsx`' `HideSources`): what a kind read through its source asks e3\n     * which of the rail's choices leave out a row its list shows.\n     */\n    readonly picks: HiddenPicks;\n    /** The layers hidden, by key. */\n    readonly hiddenLayers: ReadonlySet<string>;\n    /**\n     * Whether the narrowing draws what it leaves out as context (`narrowed=\"dim\"`), the frame's `look.dim`: a line names\n     * the choices that dim an item, never that hide it.\n     */\n    readonly dim: boolean;\n    /** Told the item a pick lands on. */\n    readonly onPick: (item: FoundItem) => void;\n    /** Told the last pick stands no more: the search cleared, or a new query asked in its place — never one asked again. */\n    readonly onCleared: () => void;\n}\n\n/**\n * Find's source, for the shared key search's toolbar item (see the module docs).\n *\n * @param props - The kinds, the words, each kind's hidden pick, the layers hidden, whether the narrowing dims, the pick,\n *   and the pick let go\n * @returns The source\n */\nexport function useSchematicFind({ kinds, words, picks, hiddenLayers, dim, onPick, onCleared }: SchematicFindProps): KeySearchSource {\n    // The box parses at the item kinds' key type where they share one; else at String, each kind keyed otherwise reading\n    // the text as typed at its own (#1549).\n    const keyType = useMemo(() => {\n        const first = kinds[0]?.keys.keyType;\n        return first !== undefined && kinds.every((kind) => sameType(kind.keys.keyType, first)) ? first : STRING_KEYS.keyType;\n    }, [kinds]);\n    // What a find reads, and whom a pick tells: the latest — the box calls what it captured before the find answered.\n    const latest = useRef({ kinds, keyType, words, picks, hiddenLayers, dim, onPick, onCleared });\n    useLayoutEffect(() => { latest.current = { kinds, keyType, words, picks, hiddenLayers, dim, onPick, onCleared }; });\n    // What the last find found, each kind's run; a find answered after a newer one asked finds nothing here.\n    const found = useRef<readonly FindRun[]>([]);\n    const asked = useRef(0);\n    const find = useCallback(async (query: DatasetKeyQuery, again?: boolean): Promise<DatasetKeyMatchRange> => {\n        // A new query takes the last pick's place; one asked again, as what its lines are read from moved, keeps it.\n        if (again !== true) latest.current.onCleared();\n        const mine = ++asked.current;\n        const { kinds: sought, keyType: box } = latest.current;\n        const runs = await Promise.all(sought.map(async (kind): Promise<FindRun> => {\n            // Text that reads as no key of the kind's finds none of its rows.\n            const kindAsked = kindQuery(query, box, kind.keys);\n            if (kindAsked === undefined) return { kind, start: 0, count: 0, keys: undefined };\n            if (kind.part !== undefined) {\n                const part = kind.part;\n                const range = await awaitTracked(() => recordSliceSeek(part, WHOLE, toSeekQuery(kindAsked)));\n                return { kind, start: range.found ? Number(range.row) : 0, count: range.found ? Number(range.count) : 0, keys: undefined };\n            }\n            const rows = await awaitTracked(() => kind.rows());\n            const keys = wholeMatches([...rows.keys()], kindAsked, kind.keys);\n            return { kind, start: 0, count: keys.length, keys };\n        }));\n        if (mine === asked.current) found.current = runs;\n        const count = runs.reduce((sum, run) => sum + run.count, 0);\n        return { found: count > 0, row: 0, count };\n    }, []);\n    /** The matches at the list's rows `[row, row + limit)`, each with the row it is at. */\n    const itemsAt = useCallback(async (row: number, limit: number): Promise<{ at: number; item: FoundItem }[]> => {\n        const parts = await Promise.all(runsAt(found.current, row, limit).map(async ({ run, offset, n, at }) =>\n            (await matchesOf(run, offset, n, latest.current.picks.get(run.kind.slot))).map((item, i) => ({ at: at + i, item }))));\n        return parts.flat();\n    }, []);\n    const listRange = useCallback(async (row: number, limit: number) => {\n        const { words: w, hiddenLayers: hidden, dim: dimmed } = latest.current;\n        // A pick shows the item's key in the box: what its query is typed against.\n        return (await itemsAt(row, limit)).map(({ at, item }) => ({ row: at, label: foundLine(item, foundMark(item, hidden), w, dimmed), text: item.ref.key }));\n    }, [itemsAt]);\n    const jump = useCallback((row: number) => {\n        void itemsAt(row, 1).then(([hit]) => { if (hit !== undefined) latest.current.onPick(hit.item); })\n            .catch((error: unknown) => { console.error(\"[Schematic] Find could not read the item it found:\", error); });\n    }, [itemsAt]);\n    const clear = useCallback(() => {\n        asked.current++;\n        found.current = [];\n        latest.current.onCleared();\n    }, []);\n    // The box asks its query again when what its lines are read from moves: each source's record and its narrowing,\n    // each kind read whole's rows — tracked, so a window the canvas reads moves none of it — and the layers hidden.\n    const readAnswers = useCallback(() => kinds.map((kind) => (kind.part === undefined\n        ? rowsToken(kind.rows())\n        : `${someOf(recordSliceRevision(kind.part)) ?? \"\"}\\u0000${printWhere(kind.part.read().where)}`)).join(\"\\n\"), [kinds]);\n    const { result } = useTrackedEvaluation(readAnswers);\n    const answers = result.ok ? result.value : \"\";\n    const layers = useMemo(() => [...hiddenLayers].sort(compareKey).join(\"\\u0000\"), [hiddenLayers]);\n    const [requery, setRequery] = useState(0);\n    const seen = useRef({ answers, layers });\n    useEffect(() => {\n        if (keyEqual(seen.current.answers, answers) && keyEqual(seen.current.layers, layers)) return;\n        seen.current = { answers, layers };\n        setRequery((n) => n + 1);\n    }, [answers, layers]);\n    // It lists its lines again as e3 says which choices leave out a row they show, or a kind's pick comes to ask — and as\n    // the narrowing comes to dim what it leaves out, or to hide it, which its lines word.\n    const relist = useRelist(kinds.flatMap((kind) => { const pick = picks.get(kind.slot); return pick === undefined ? [] : [pick]; }), [dim]);\n    const noMatches = words.m.findNoMatches();\n    // The empty box lists the first matches where a key's start finds them: the box parsing at String.\n    const browse = keyType.type === \"String\" ? BROWSE_QUERY : undefined;\n    return useMemo(() => ({\n        resetKey: \"schematic\", requery, relist, keyType, find, listRange, jump, clear, browseQuery: browse, noMatchesText: noMatches,\n    }), [requery, relist, keyType, find, listRange, jump, clear, browse, noMatches]);\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * Whether a builder's footer rail wraps (the shared `builder-footer` rail):\n * its items do not fit on one line. The rail can be wider than main, and its\n * labels are translated, so it fits its actual items rather than assume a\n * breakpoint does.\n *\n * What it measures is the same whichever form the rail is in: the items' own\n * widths (they never shrink or wrap), the rail's unwrapped gap, which the\n * recipe keeps in `--builder-footer-gap` while the rail wraps at a narrower\n * one, and its inline padding and borders. Measured with the wrapped gap, a\n * rail between the two would fit once wrapped, unwrap, and no longer fit —\n * a render loop. An item a host lets wrap its own words once the rail wraps —\n * the Schematic's density, on a phone — shrinks only when it alone is wider\n * than the rail, and then fills it: so a wrapped rail stays wrapped while its\n * items fill it, and unwraps only once they fit with a pixel to spare, or one\n * item filling the rail would unwrap it, overflow and wrap it again.\n *\n * @packageDocumentation\n */\n\nimport { useLayoutEffect, useState, type RefObject } from \"react\";\n\n/** The room, in px, a wrapped rail's items leave before it unwraps: more than a layout's subpixel rounding. */\nconst UNWRAP_ROOM_PX = 1;\n\n/**\n * Whether the rail's items need more than one line (see the module docs).\n *\n * @param ref - The rail\n * @param items - What its items are: measured again when it changes\n * @returns Whether it wraps\n */\nexport function useRailWrap(ref: RefObject<HTMLElement | null>, items: unknown): boolean {\n    const [wrap, setWrap] = useState(false);\n    useLayoutEffect(() => {\n        const rail = ref.current;\n        if (rail === null) return undefined;\n        const measure = () => {\n            const children = [...rail.children];\n            const css = getComputedStyle(rail);\n            const px = (value: string) => Number.parseFloat(value) || 0;\n            const gap = px(css.getPropertyValue(\"--builder-footer-gap\")) || px(css.columnGap);\n            const required = children.reduce((n, item) => n + item.getBoundingClientRect().width, 0) + Math.max(0, children.length - 1) * gap\n                + px(css.paddingInlineStart) + px(css.paddingInlineEnd) + px(css.borderInlineStartWidth) + px(css.borderInlineEndWidth);\n            const width = rail.getBoundingClientRect().width;\n            setWrap((wrapped) => required > (wrapped ? width - UNWRAP_ROOM_PX : width));\n        };\n        measure();\n        const observer = new ResizeObserver(measure);\n        observer.observe(rail);\n        for (const item of rail.children) observer.observe(item);\n        return () => observer.disconnect();\n    }, [ref, items]);\n    return wrap;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's footer (#1387, `Schematic Builder Spec.md` §6.3), on the\n * shared builder rail (`builder-footer.ts`): only what is live (ruled 23 Oct\n * 2026) — each kind drawn as its density in place of items (#1393, D25): how\n * many rows it shades in the viewport where it rests (`densityInView`), and\n * that zooming in draws them, the side of its cells named on it\n * (`data-density-cell`); why the last gesture was refused, until one is\n * recorded — a Delete a read-only link or net blocks, a drop, an inspector\n * edit (#1390, #1391); each Save's notice, the rows it took out of a source's\n * narrowing (`RecordSliceSaveNotice`); and where Find's last pick landed on\n * an item the canvas doesn't show as itself, why — its layer, or no position\n * (#1404); the rail's filters hiding it the pick cleared, as every builder's\n * hidden pick does — while that pick stands: the search cleared, or a new\n * query asked in its place, it goes. With nothing\n * live the rail is empty. The drawing's counts and each record's last save are the\n * inspector's, in its Details with nothing selected (`counts.ts`), and the\n * changes waiting on Save the history's.\n *\n * At the rail's trailing end, in a slot of its own, the shared loading line\n * (#1398, CL3): what is read now, in a kind's noun — `Loading racks…`,\n * `Filtering racks…` while a new narrowing's rows are read and the last stand\n * in — or why a read failed, with Retry; shown on the frame's one reveal\n * clock (CL4, its `LoadingReveal`). The rail never wraps and never cuts a\n * word: the line shows its full text, its short form or its dot alone, as the\n * rail fits it (`useFooterFit`). The live notices are one item of the rail,\n * which takes what the line leaves (`data-footer-slack`) and wraps within\n * itself item by item where it is narrow (`useRailWrap`), an item wider than\n * it wrapping its own words. Each notice is `data-footer-live`, which a phone's\n * frame keeps: there the rail shows only while one stands, above the pane tabs.\n *\n * @packageDocumentation\n */\n\nimport { useMemo, useRef, useSyncExternalStore } from \"react\";\nimport { Box, type SystemStyleObject } from \"@chakra-ui/react\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { LoadingLine, RecordSliceSaveNotice, useFooterFit, useRevealed, type LoadingLineValue } from \"@elaraai/east-ui-components/internal\";\nimport { useRailWrap } from \"../shared/schedule/footer.js\";\nimport { densityInView, type SchematicDensity, type SchematicViewportStore } from \"./area.js\";\nimport type { SchematicWords } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** A kind read through its source that writes: what its Save's notice counts the rows it took out of the narrowing in. */\nexport interface SchematicNotice {\n    /** The kind's slot. */\n    readonly slot: string;\n    /** Its source of the slice. */\n    readonly slice: ValueTypeOf<RecordSliceBindType>;\n    /** One of its rows, as running text names it — `rack`. */\n    readonly singular: string;\n    /** Several. */\n    readonly plural: string;\n}\n\n/** Props of {@link SchematicFooter}. */\nexport interface SchematicFooterProps {\n    /** The `schematic` recipe's styles. */\n    readonly styles: Styles;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /** Each kind read by area drawing its density in place of items, by its slot (D25). */\n    readonly density: ReadonlyMap<string, SchematicDensity>;\n    /** Each kind's name, by its slot. */\n    readonly names: ReadonlyMap<string, string>;\n    /** Where the canvas's viewport rests, which the canvas writes as its camera comes to rest: what a density's count is of. */\n    readonly viewport: SchematicViewportStore;\n    /** The drawing's extent, in world units from its origin: where a density's rows lie. */\n    readonly extent: { readonly width: number; readonly height: number };\n    /** Why the last gesture was refused; `undefined` once one is recorded, or for none. */\n    readonly refusal: string | undefined;\n    /** Each kind read through its source that writes: its Save's notice. */\n    readonly notices: readonly SchematicNotice[];\n    /**\n     * What keeps the item Find's last pick landed on from the canvas as itself, the filters hiding it cleared by the pick\n     * (#1404) — `A04 is on a hidden layer`, `A06 has no position: it is in the Backlog` — or `undefined` while nothing does.\n     */\n    readonly found?: string | undefined;\n    /** What the loading line says: a read in flight, or one that failed, with Retry; `undefined` while nothing is read. */\n    readonly line: LoadingLineValue | undefined;\n}\n\n/**\n * Renders the footer — see the module docs.\n *\n * @param props - The densities and where the viewport rests, the refusal, the Saves' notices, where Find's last pick\n *   landed, and the loading line\n * @returns The footer: its rail, its notices and its loading line, empty while nothing is live\n */\nexport function SchematicFooter({ styles, words, density, names, viewport, extent, refusal, notices, found, line }: SchematicFooterProps) {\n    // Where the viewport rests: the footer alone renders again as it moves, and only while a kind draws its density.\n    const rests = useSyncExternalStore(viewport.subscribe, viewport.get, viewport.get);\n    const { width, height } = extent;\n    // Each kind drawn as its density, by its slot: how many rows it shades in the viewport — none while it shades none there —\n    // and the side of the cells it shades them in, which one view draws alike by whatever route it was reached.\n    const dense = useMemo(() => (rests === undefined ? [] : [...density].flatMap(([slot, raster]) => {\n        const seen = densityInView(raster, rests.box, { minX: 0, minY: 0, maxX: width, maxY: height });\n        if (seen.rows === 0) return [];\n        const name = (names.get(slot) ?? slot).toLocaleLowerCase(words.locale);\n        const text = words.m.densityNotice({ n: seen.rows, count: words.number(seen.rows), name, about: !seen.exact, unfiltered: raster.unnarrowed });\n        return [{ slot, text, side: raster.side }];\n    })), [rests, density, width, height, names, words]);\n    const rail = useRef<HTMLDivElement>(null);\n    const fit = useFooterFit(rail);\n    const shown = useRevealed() === true;\n    const live = useRef<HTMLDivElement>(null);\n    const wrap = useRailWrap(live, [...dense.map((notice) => notice.text), refusal ?? \"\", found ?? \"\"].join(\"\\n\"));\n    return (\n        <Box ref={rail} css={styles.footer} data-schematic-footer=\"\">\n            <Box ref={live} css={styles.footerNotices} data-schematic-notices=\"\" data-footer-slack=\"\" data-builder-narrow={wrap ? \"\" : undefined}>\n                {dense.map((notice) => (\n                    <Box as=\"span\" key={notice.slot} css={styles.footerItem} data-schematic-density={notice.slot} data-density-cell={notice.side} data-footer-live=\"\" data-footer-ambient=\"\">{notice.text}</Box>\n                ))}\n                {refusal !== undefined && <Box as=\"span\" css={styles.footerItem} data-schematic-refused=\"\" data-footer-live=\"\" role=\"alert\">{refusal}</Box>}\n                {notices.map((notice) => <RecordSliceSaveNotice key={notice.slot} slice={notice.slice} singular={notice.singular} plural={notice.plural} />)}\n                {/* Where Find's last pick landed, the canvas not showing it as itself: why. */}\n                {found !== undefined && <Box as=\"span\" css={styles.footerItem} data-schematic-found=\"\" data-footer-live=\"\" role=\"status\">{found}</Box>}\n            </Box>\n            <LoadingLine value={line} shown={shown} form={fit.form} />\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the Schematic's inspector shows (#1391, `Schematic Builder Spec.md`\n * §9, SC15) — pure and React-free: the selection as Details shows it, and what\n * an item is joined to.\n *\n * - **Nothing selected** — the drawing.\n * - **One entity** — an item, a zone, a link or a net; or a net's leg, the\n *   stub a tap selected, its item on one side.\n * - **Several** — each by its sort and its reference, in the order the canvas\n *   selected them.\n * - **An item with no position** — below 480px of main, the Backlog's card\n *   picked (#1394, D15), which Details places at the canvas's centre. The frame\n *   says which; the canvas draws none.\n *\n * An id the drawing no longer draws is left out: a selection the canvas holds\n * a moment longer than the drawing does shows what is left of it.\n *\n * Each entity has one name, wherever the Schematic says it\n * ({@link entityNames}): an item's or a zone's label; a link's ends; a net's\n * label, else its ends — never a key the Schematic minted for a new link or net.\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { refOfId, type DrawnLink, type DrawnNet, type SchematicDrawn, type SchematicRef } from \"./canvas/drawn.js\";\nimport type { NetLeg } from \"./edits.js\";\nimport type { SchematicMembers, SchematicWords } from \"./messages.js\";\n\nconst stringEqual = equalFor(StringType);\n\n/** How many of a net's members on a side its name lists by name, before it counts the rest. */\nconst NAMED_MEMBERS = 3;\n\n/** A member's name, where a link or a net names it: its label as drawn, else the key its id names. */\nfunction memberName(id: string, labelOf: (id: string) => string | undefined): string {\n    return labelOf(id) ?? refOfId(id)?.key ?? id;\n}\n\n/** A link's name: its ends' items — `A04 → CORE-1`. */\nfunction linkName(link: DrawnLink, labelOf: (id: string) => string | undefined, words: SchematicWords): string {\n    return words.m.linkEnds({ from: memberName(link.from, labelOf), to: memberName(link.to, labelOf) });\n}\n\n/** A net's name: its label, else its ends — its sources, then its destinations, each side's first three and how many more. */\nfunction netName(net: DrawnNet, labelOf: (id: string) => string | undefined, words: SchematicWords): string {\n    if (net.label.type === \"some\") return net.label.value;\n    const side = (ids: readonly string[]): SchematicMembers => {\n        const names = ids.slice(0, NAMED_MEMBERS).map((id) => memberName(id, labelOf));\n        const more = ids.length - names.length;\n        return { names, more: more > 0 ? { n: more, count: words.number(more) } : undefined };\n    };\n    return words.m.netEnds({ sources: side(net.sources), destinations: side(net.destinations) });\n}\n\n/**\n * Each entity's name, as the Schematic says it wherever it names one (#1391) — the inspector's head and its collapsed\n * rail, what an item is joined to and a net's leg, a drop's words, an issue's row and a record's banners: an item's or a\n * zone's label; a link's ends, by their items' labels (`A04 → CORE-1`); a net's label, else its ends, its sources then\n * its destinations (`A03 → CORE-1, ODF-1`). Never a key the Schematic minted: a new link or net is named by what it joins.\n *\n * @param drawn - What the canvas draws\n * @param words - The Schematic's words\n * @returns Each entity's name, by its id\n */\nexport function entityNames(drawn: SchematicDrawn, words: SchematicWords): ReadonlyMap<string, string> {\n    const out = new Map<string, string>();\n    for (const item of drawn.items) out.set(item.key, item.label);\n    for (const zone of drawn.zones) out.set(zone.key, zone.label);\n    const labelOf = (id: string) => out.get(id);\n    for (const link of drawn.links) out.set(link.key, linkName(link, labelOf, words));\n    for (const net of drawn.nets) out.set(net.key, netName(net, labelOf, words));\n    return out;\n}\n\n/**\n * An entity's name, as {@link entityNames} named it — or, for one the drawing doesn't draw, the key its id names.\n *\n * @param names - Each entity's name, by its id ({@link entityNames})\n * @param id - The entity's id\n * @returns Its name\n */\nexport function nameOfEntity(names: ReadonlyMap<string, string>, id: string): string {\n    return names.get(id) ?? refOfId(id)?.key ?? id;\n}\n\n/** What an entity is: an item, a zone, a link or a net. */\nexport type SchematicSort = \"item\" | \"zone\" | \"link\" | \"net\";\n\n/** An entity the drawing draws: its sort and its reference. */\nexport interface SchematicDrawnEntity {\n    readonly sort: SchematicSort;\n    readonly ref: SchematicRef;\n}\n\n/** An item with no position, as Details shows it (#1394): its id, its reference, its label and its icon, as its Backlog card has them. */\nexport interface SchematicUnplaced {\n    /** Its id: its reference, printed, and its Backlog card's key. */\n    readonly id: string;\n    /** Its kind's slot and its key. */\n    readonly ref: SchematicRef;\n    /** Its label. */\n    readonly label: string;\n    /** Its own icon, where its row gives one. */\n    readonly icon: string | undefined;\n}\n\n/** What Details shows: the drawing, one entity, a net's leg, several, or an item with no position. */\nexport type SchematicInspected =\n    | { readonly view: \"drawing\" }\n    | { readonly view: \"entity\"; readonly sort: SchematicSort; readonly id: string; readonly ref: SchematicRef }\n    | { readonly view: \"leg\"; readonly id: string; readonly ref: SchematicRef; readonly leg: NetLeg }\n    | { readonly view: \"several\"; readonly entities: readonly (SchematicDrawnEntity & { readonly id: string })[] }\n    | ({ readonly view: \"unplaced\" } & SchematicUnplaced);\n\n/** Nothing selected: the drawing. */\nexport const NOTHING_INSPECTED: SchematicInspected = { view: \"drawing\" };\n\n/**\n * Each entity the drawing draws, by its id: its sort and its reference.\n *\n * @param drawn - What the canvas draws\n * @returns The entities, by id\n */\nexport function drawnEntities(drawn: SchematicDrawn): ReadonlyMap<string, SchematicDrawnEntity> {\n    const out = new Map<string, SchematicDrawnEntity>();\n    for (const item of drawn.items) out.set(item.key, { sort: \"item\", ref: item.ref });\n    for (const zone of drawn.zones) out.set(zone.key, { sort: \"zone\", ref: zone.ref });\n    for (const link of drawn.links) out.set(link.key, { sort: \"link\", ref: link.ref });\n    for (const net of drawn.nets) out.set(net.key, { sort: \"net\", ref: net.ref });\n    return out;\n}\n\n/**\n * What Details shows for a selection (see the module docs).\n *\n * @param selection - What the canvas has selected, by id: the items, the zones, and the link or the net\n * @param leg - The selected net's leg, when a stub is selected; `null` for none\n * @param entities - Each entity the drawing draws ({@link drawnEntities})\n * @returns What Details shows\n */\nexport function inspectedOf(selection: ReadonlySet<string>, leg: NetLeg | null, entities: ReadonlyMap<string, SchematicDrawnEntity>): SchematicInspected {\n    const held = [...selection].flatMap((id) => {\n        const entity = entities.get(id);\n        return entity === undefined ? [] : [{ id, ...entity }];\n    });\n    if (held.length === 0) return NOTHING_INSPECTED;\n    if (held.length > 1) return { view: \"several\", entities: held };\n    const one = held[0]!;\n    if (one.sort === \"net\" && leg !== null) return { view: \"leg\", id: one.id, ref: one.ref, leg };\n    return { view: \"entity\", sort: one.sort, id: one.id, ref: one.ref };\n}\n\n/**\n * Whether two of what Details shows are one: the same view of the same\n * entities, so what it holds need not move.\n *\n * @param a - What Details shows\n * @param b - What it showed\n * @returns Whether they show the same\n */\nexport function inspectedEqual(a: SchematicInspected, b: SchematicInspected): boolean {\n    switch (a.view) {\n        case \"drawing\": return b.view === \"drawing\";\n        case \"entity\": return b.view === \"entity\" && stringEqual(a.id, b.id);\n        case \"leg\": return b.view === \"leg\" && stringEqual(a.id, b.id) && a.leg.end === b.leg.end && stringEqual(a.leg.item, b.leg.item);\n        case \"several\": return b.view === \"several\" && a.entities.length === b.entities.length && a.entities.every((e, i) => stringEqual(e.id, b.entities[i]!.id));\n        case \"unplaced\": return b.view === \"unplaced\" && stringEqual(a.id, b.id) && stringEqual(a.label, b.label)\n            && (a.icon === undefined ? b.icon === undefined : b.icon !== undefined && stringEqual(a.icon, b.icon));\n    }\n}\n\n/** What an item is joined to: the links that run from or to it, and the nets it is a member of, each on its side. */\nexport interface SchematicJoins {\n    readonly links: readonly DrawnLink[];\n    readonly nets: readonly { readonly net: DrawnNet; readonly end: NetLeg[\"end\"] }[];\n}\n\n/**\n * What an item is joined to, as the drawing holds it: each link from or to it,\n * and each net it is a member of — on its feeding side, else its fed side — in\n * the drawing's order.\n *\n * @param id - The item's id\n * @param drawn - What the canvas draws\n * @returns Its links and nets\n */\nexport function joinsOf(id: string, drawn: Pick<SchematicDrawn, \"links\" | \"nets\">): SchematicJoins {\n    return {\n        links: drawn.links.filter((link) => stringEqual(link.from, id) || stringEqual(link.to, id)),\n        nets: drawn.nets.flatMap((net): { net: DrawnNet; end: NetLeg[\"end\"] }[] => {\n            if (net.sources.some((member) => stringEqual(member, id))) return [{ net, end: \"source\" }];\n            if (net.destinations.some((member) => stringEqual(member, id))) return [{ net, end: \"destination\" }];\n            return [];\n        }),\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's words (#1387, `Schematic Builder Spec.md` §6) — its frame's:\n * the toolbar's tools, Connect's menu, the zoom, Fit, Find and the steps\n * through the items, the View popover a phone's row folds them into, and what\n * the rail counts a templates list's source in; what the footer says of a kind\n * drawn as its density (#1393); what the canvas says where a read failed, and\n * its Retry (#1398, CL11); what Find marks an item it found by, the rail's\n * filters leaving it out, its layer hidden or no position, and what the\n * footer says of one the canvas doesn't show as itself (#1404); the canvas's\n * and the frame's accessible names; and its editing's\n * (#1388): what a Save's notice counts a kind's\n * rows in, a details record's banners, why a connection's draft doesn't snap\n * or a Delete is refused, and each gesture's step in the history — and of a\n * new row's key (#1549): a kind that adds none, a placeholder waiting on its\n * key, and a key a gesture builds that a row holds; and its\n * library's (#1389): the pane and its tabs, their cards' lines and nouns, what\n * an empty tab and a tab the rail empties say, the Index's search, its zones'\n * and the zone in view, the Layers tab's controls, and a followed source's\n * failed narrowing; and its drops' (#1390): where a card lands, why a drop is\n * refused, and a drop's step in the history; and its inspector's (#1391): the\n * pane and its tabs, the heads of Details' sections and its own fields, where\n * an entity stands, a gesture's button and its step, a record's last save and\n * who made it, why a net's side stays, each issue's words, and what Issues\n * says of the kinds read by area it checks only in view — and below\n * 480px of main (#1394) its Connect to…, its link kind, and an item with no\n * position, its Place; what Find's line and an issue's line say of a row the\n * rail's filters hide — the shared hidden pick's words\n * (`shared/schedule/words.ts`' `HiddenWords`) — and what Find's line says of\n * one they dim, where a dimmed narrowing draws it as context, and why a pick\n * of one could not clear them; and the\n * footer's loading line's (#1398, CL3), the shared paged words over a kind's\n * rows — `Loading racks…`, `Filtering racks…`, `Couldn't read racks` — and\n * its own over a kind's window — `Loading racks in view`, `Loading counts`,\n * `Loading details for 12 racks`, `Couldn't read racks in view` — and the\n * drawing's noun, where its read fails as a whole. A host translates the\n * Schematic where it translates its formatters.\n *\n * @packageDocumentation\n */\n\nimport { none, some, variant } from \"@elaraai/east\";\nimport type { Formatters } from \"@elaraai/east-ui-components\";\nimport type { LoadingLineText } from \"@elaraai/east-ui-components/internal\";\nimport { articleOf as article } from \"../shared/article.js\";\nimport { pagedLoadingMessages, type PagedLoadingMessages } from \"../shared/loading.js\";\nimport { hiddenByText, joinedWords, lowerWord, type HiddenWords } from \"../shared/schedule/words.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport type { SchematicIssueWord } from \"./issues.js\";\nimport type { SchematicTool } from \"./tools.js\";\n\n/** The app's words for what the Schematic draws, as the payload carries them. */\nexport type SchematicVocabulary = SchematicValue[\"vocabulary\"];\n\n/** A count as a message takes it: the number, for its plural, and the number as the locale prints it. */\nexport interface SchematicCount {\n    /** The number. */\n    readonly n: number;\n    /** The number, printed in the app's locale. */\n    readonly count: string;\n}\n\n/** A side of a net as its name lists it: its first members' names, and how many more it holds past them. */\nexport interface SchematicMembers {\n    /** The first members' names, in the side's order. */\n    readonly names: readonly string[];\n    /** How many more members the side holds; `undefined` where the names are all of them. */\n    readonly more: SchematicCount | undefined;\n}\n\n/**\n * The Schematic's message table: its own words, the footer's loading line's over a kind's rows (`PagedLoadingMessages`),\n * and what Find's line and an issue's line say of a row the rail's filters hide (`HiddenWords`) — and Find's of one a\n * dimmed narrowing draws as context (`dimmedByFilters`, `dimmedBy`).\n */\nexport interface SchematicMessages extends PagedLoadingMessages, HiddenWords {\n    /** The frame's accessible name, and what its skeleton is the loading of. */\n    frameLabel: () => string;\n    /** What the footer's loading line names a read of the drawing as a whole that failed — `Couldn't read the drawing`. */\n    drawingNoun: () => string;\n    /** A kind's window's rows read, the drawing in view standing meanwhile (#1398, CL3) — `Loading racks in view`. */\n    lineInView: (p: { noun: string }) => LoadingLineText;\n    /** A kind's density's counts read — `Loading counts`. */\n    lineCounts: () => LoadingLineText;\n    /** A kind's rows' details read, its rows drawn meanwhile — `Loading details for 12 racks`, the count strong; `noun` is one row's or several's, by `n`. */\n    lineDetails: (p: SchematicCount & { noun: string }) => LoadingLineText;\n    /** A kind's window whose read failed — `Couldn't read racks in view`. */\n    lineFailedInView: (p: { noun: string }) => LoadingLineText;\n    /** What the canvas says at the top-left of an area whose read failed, beside its Retry (CL11) — `Couldn't read this area`. */\n    areaFailed: () => string;\n    /** The canvas's accessible name: what it is, and what its keys do. */\n    canvasLabel: () => string;\n    /** The minimap's line under the pointer: what a press on it does. */\n    minimapHint: () => string;\n    /** The tools' strip's accessible name. */\n    toolsLabel: () => string;\n    /** A tool's name: its segment's word, and its accessible name. */\n    toolName: (p: { tool: SchematicTool }) => string;\n    /** A tool's line under the pointer: what it does, and the key that holds it. */\n    toolHint: (p: { tool: SchematicTool }) => string;\n    /** Connect's menu's accessible name: the link kind it draws. */\n    connectDraws: () => string;\n    /** Connect drawing a link kind, as the folded tools' menu lists it — `Connect · Fibre run`. */\n    connectKind: (p: { name: string }) => string;\n    /** The zoom's group's accessible name. */\n    zoomLabel: () => string;\n    /** Zoom out. */\n    zoomOut: () => string;\n    /** Zoom in. */\n    zoomIn: () => string;\n    /** Fit: the whole drawing in view. */\n    fit: () => string;\n    /** Find's placeholder, its icon's accessible name and its popover's head. */\n    findLabel: () => string;\n    /** What Find says when a query finds nothing. */\n    findNoMatches: () => string;\n    /**\n     * What keeps an item Find found off the canvas, at its line's end (#1404): its layer is hidden; it has no position. One\n     * the rail's filters leave out says which of them do: they hide it (`hiddenByFilters`, `hiddenBy`), or, where the\n     * narrowing draws what it leaves out as context, dim it (`dimmedByFilters`, `dimmedBy`).\n     */\n    findMark: (p: { mark: \"layer\" | \"unplaced\" }) => string;\n    /** What the footer says of an item a Find's pick landed on that the canvas doesn't show as itself — `A04 is on a hidden layer`. */\n    foundOff: (p: { item: string; mark: \"layer\" | \"unplaced\" }) => string;\n    /** The View popover's name: a phone's row's tools, zoom, Fit and Find. */\n    viewLabel: () => string;\n    /** The steps' group's accessible name. */\n    stepLabel: () => string;\n    /** The step to the previous item. */\n    previousItem: () => string;\n    /** The step to the next item. */\n    nextItem: () => string;\n    /**\n     * What the footer says of a kind drawn as its density in place of items (#1393, D25) — `Density: 20,000 racks — zoom\n     * in to draw them`: how many rows it shades in the view, `about` that many where the count is an estimate, and\n     * `unfiltered` where the filters the index doesn't lead are not applied to it; `name` is the kind's, as running text\n     * writes it.\n     */\n    densityNotice: (p: SchematicCount & { name: string; about: boolean; unfiltered: boolean }) => string;\n    /** What the rail counts a templates list's source in — `rack templates`: `name` is its kind's, as running text writes it. */\n    templatesNoun: (p: { name: string }) => string;\n    /** A failed read's Retry, which reads it again. */\n    retry: () => string;\n    /**\n     * What a Save's notice counts a kind's rows in, a row or several (`RecordSliceSaveNotice`): `name` is the\n     * kind's, as running text writes it — `rack`, `racks`.\n     */\n    kindNoun: (p: { name: string; plural: boolean }) => string;\n    /** A kind's details' session, as its banners are titled — `Rack details`. */\n    detailsName: (p: { name: string }) => string;\n    /**\n     * Why a connection's draft doesn't snap: its kind's end — `start` a link's from or a net's sources, `end` a\n     * link's to or a net's destinations — holds no item of the target's kind: `Fibre run can't end at PDU-A`.\n     */\n    endRefused: (p: { kind: string; end: \"start\" | \"end\"; item: string }) => string;\n    /** Why a Delete was refused: a link or a net bound read only names an item it would delete. */\n    deleteRefused: (p: { item: string; kind: string; key: string }) => string;\n    /**\n     * Why a connection's draft doesn't snap, or a gesture names no item, where the item is held under a placeholder, its\n     * key still to be typed (#1549) — `Type the new rack's key first`: `kind` is its kind's name, as running text writes it.\n     */\n    placeholderRefused: (p: { kind: string }) => string;\n    /**\n     * Why a kind adds no row (#1549) — on a template's card, a drop's ghost and the footer: `Racks are keyed by Blob,\n     * which can't be typed — give the kind `key` to add them`; `name` is the kind's, as running text writes it, `type` its\n     * key type's name.\n     */\n    keysUntyped: (p: { name: string; type: string }) => string;\n    /**\n     * A new row held under a placeholder, its key still to be typed (#1549) — `Type this rack's key: Save waits for it`;\n     * `name` is its kind's, as running text writes it.\n     */\n    keyPlaceholder: (p: { name: string }) => string;\n    /**\n     * Why a gesture records nothing (#1549), in the footer — `A fibre run A01 → ODF-1 is there already`, `A01 isn't changed:\n     * the filters hide some fibre runs that may name it — clear them, then try again` (#1580), `A01 isn't changed: the\n     * fibre runs naming it take no edit now — try again in a moment` (#1584).\n     */\n    keyRefused: (p: SchematicKeyRefusalWord) => string;\n    /** A gesture's label in the history: what it did, and to how many. */\n    step: (p: { step: SchematicStep; name: string; n: number }) => string;\n    /** The library pane's name, on its rail and its head (#1389). */\n    libraryPane: () => string;\n    /** A tab of the library's own, by its name: `Templates`, `Backlog`, `Index`, `Layers`. */\n    libraryTab: (p: { tab: Exclude<SchematicLibraryTabWord, \"tab\"> }) => string;\n    /** What a tab counts its cards as, one or several: a template, an item, a zone, a layer; an author's tab's a card. */\n    libraryNoun: (p: { tab: SchematicLibraryTabWord; n: number }) => string;\n    /** What an empty tab says: `No templates`; an author's tab, `Nothing in <name>`. */\n    libraryEmpty: (p: { tab: SchematicLibraryTabWord; name: string }) => string;\n    /** The line under an empty tab's words. */\n    libraryEmptyHint: (p: { tab: SchematicLibraryTabWord; name: string }) => string;\n    /** What a tab the rail leaves no card says: `No templates match the filters`; `name` is an author's tab's, as running text writes it. */\n    libraryNarrowed: (p: { tab: SchematicLibraryTabWord; name: string }) => string;\n    /** The line under it. */\n    libraryNarrowedHint: (p: { tab: SchematicLibraryTabWord; name: string }) => string;\n    /** The cards' grouping's name. */\n    libraryGroupBy: () => string;\n    /** A template's group: its kind's name, then the template's own group — `Rack · Half racks`. */\n    templateGroup: (p: { kind: string; group: string | undefined }) => string;\n    /** A Backlog card's line: its kind's name, then the item's second line — `Rack · 48U · 12 kW`. */\n    backlogLine: (p: { kind: string; sublabel: string | undefined }) => string;\n    /** The Index's search: its placeholder and its accessible name. */\n    indexSearch: () => string;\n    /** What the Index says when its search keeps no item: `No items match \"A9\"`. */\n    indexNoMatch: (p: { query: string }) => string;\n    /** A zone's chevron: what a press on it does. */\n    indexToggle: (p: { zone: string; open: boolean }) => string;\n    /** A zone's count of the items it holds — `4 items` — as a reader hears it. */\n    indexCount: (p: SchematicCount) => string;\n    /**\n     * What the Index says of an open zone holding more items of a kind read by area than a window reads (#1393, D52) —\n     * `Hall 3 holds more than 20,000 racks: search to find one`; `name` is the kind's, as running text writes it.\n     */\n    indexCrowded: (p: SchematicCount & { zone: string; name: string }) => string;\n    /** What the Index says of the matches its search holds past those it lists (#1393, D52) — `12 more match: type more to find them`. */\n    indexMore: (p: SchematicCount) => string;\n    /** The Layers tab's Show all: every layer shown, the isolation ended. */\n    layersShowAll: () => string;\n    /** A layer's Show or Hide. */\n    layerShow: (p: { layer: string; shown: boolean }) => string;\n    /** A layer's Isolate: alone, or ending it. */\n    layerIsolate: (p: { layer: string; isolated: boolean }) => string;\n    /** A layer's Lock. */\n    layerLock: (p: { layer: string; locked: boolean }) => string;\n    /** A layer's count of the entities on it — `12 entities` — as a reader hears it. */\n    layerCount: (p: SchematicCount) => string;\n    /** The banner over a source the library follows whose narrowing could not be read — `Rack templates results unavailable`. */\n    sourceUnavailable: (p: { name: string }) => string;\n    /** A followed source's results moved while they were read. */\n    sourceChanged: (p: { name: string }) => string;\n    /** A followed source's results could not be read. */\n    sourceFailed: (p: { name: string }) => string;\n    /**\n     * Where a card dropped at a point lands, as the ghost says it and the history names its drop (#1390): the zone\n     * holding the point, if one does, and the point as the drawing's scale unit measures it — `Cage A · 6.04, 2.91 m`.\n     */\n    dropAt: (p: { zone: string | undefined; x: string; y: string; unit: string | undefined }) => string;\n    /** What a card dropped on an entity lands on, as the ghost says it — `onto A03`; `name` is the entity's. */\n    dropOnto: (p: { name: string }) => string;\n    /** A link, as the Schematic names it — its inspector's head and rail, a drop's words, an issue's row — by its ends' items: `A01 → ODF-1`. */\n    linkEnds: (p: { from: string; to: string }) => string;\n    /** A net with no label of its own, as the Schematic names it: its sources, then its destinations — `A03 → CORE-1, ODF-1`, `A01, A02, A03 and 17 more → ODF-1`. */\n    netEnds: (p: { sources: SchematicMembers; destinations: SchematicMembers }) => string;\n    /** The entities of a kind a card's ⏎ drops on, several of them — `3 racks`; `name` is the kind's, as running text writes it. */\n    dropMany: (p: SchematicCount & { name: string }) => string;\n    /** Why a drop is refused where the drag rests: red under the ghost, and for a card's ⏎ and Details' Place in the footer. */\n    dropRefused: (p: SchematicDropRefusalWord) => string;\n    /** Where a drag that lands nowhere rests, as a screen reader hears it. */\n    dropCanvas: () => string;\n    /**\n     * A drop's step in the history, and its Save's — `Drop 42U rack · 8 kW at Cage A · 6.04, 2.91 m`, `Drop Uplink ·\n     * 100G on A01 → ODF-1`: `where` is where it lands, and `onto` whether that is an entity.\n     */\n    dropLabel: (p: { card: string; where: string; onto: boolean }) => string;\n    /** The inspector pane's name, on its rail and its head (#1391). */\n    inspectorPane: () => string;\n    /** The inspector's tabs: `Details`, `Issues`. */\n    inspectorTab: (p: { tab: \"details\" | \"issues\" }) => string;\n    /** What nothing selected shows, in its head's eyebrow: the drawing. */\n    inspectorDrawing: () => string;\n    /**\n     * A section of Details, under its head — `Rack`, `Rack details`, `Position`, `Joined to`, `Ends`, `Sides`, `Member`, and below 480px of\n     * main `Connect to` (#1394): `name` is the kind's.\n     */\n    inspectorSection: (p: { section: SchematicInspectorSection; name: string }) => string;\n    /**\n     * A field of Details' own — an item's `x` and `y`, a link's ends, a net's sides, Connect to…'s link kind (#1394), and a\n     * new item's key while it waits under a placeholder (#1549).\n     */\n    inspectorField: (p: { field: \"x\" | \"y\" | \"from\" | \"to\" | \"sources\" | \"destinations\" | \"kind\" | \"key\" }) => string;\n    /** The line under a new item's key field, while it waits under a placeholder (#1549). */\n    inspectorKeyHelp: () => string;\n    /** The line under a new item's key of several parts — a struct's fields, a variant's case and its value (#1581). */\n    inspectorKeyPartsHelp: () => string;\n    /** A key of several parts' Set, which takes it whole (#1581). */\n    inspectorKeySet: () => string;\n    /** Why a key typed in the inspector is refused, in the footer (#1549) — `A rack is keyed 2026-11-07T06:00:00.000 already`; `name` as running text writes it. */\n    inspectorKeyRefused: (p: { name: string; key: string }) => string;\n    /** A gesture's button: Delete, Unplace, Remove, and below 480px of main an item with no position's Place (#1394). */\n    inspectorAction: (p: { action: \"delete\" | \"unplace\" | \"remove\" | \"place\" }) => string;\n    /** What an item with no position says under its name, below 480px of main (#1394) — `Not placed`. */\n    inspectorUnplaced: () => string;\n    /** An item's place, under its name: the zone holding it, if one does, and its centre — `Cage A · 9.60, 2.90 m`. */\n    inspectorAt: (p: { zone: string | undefined; x: string; y: string; unit: string | undefined }) => string;\n    /** A zone's size, under its name — `19.60 × 4.60 m`. */\n    inspectorSize: (p: { width: string; height: string; unit: string | undefined }) => string;\n    /** A net's sides, under its name — `2 sources → 3 destinations`. */\n    inspectorSides: (p: { sources: SchematicCount; destinations: SchematicCount }) => string;\n    /** Which side a net's leg is on, under its name — `Source leg`, `Destination leg`. */\n    inspectorLeg: (p: { end: \"source\" | \"destination\" }) => string;\n    /** Several selected, in their head — `4 selected`. */\n    inspectorSeveral: (p: SchematicCount) => string;\n    /** What the drawing's Details counts, under a count — `Zones`, `Links`, `Nets`, one or several. */\n    inspectorCount: (p: { what: \"zones\" | \"links\" | \"nets\"; n: number }) => string;\n    /**\n     * What the drawing's Details says of the counts no read can say (#1393) — `Links not counted: what they join is read as\n     * the view moves`: `names` are the counts' own, as running text writes them in the plural (`racks`, `links`), and `why`\n     * a hidden layer that may hold some of a kind read by area's rows, the items a link or a net joins read as the view\n     * moves, or filters that can't count a kind's rows with no position.\n     */\n    inspectorNotCounted: (p: { names: readonly string[]; why: \"layer\" | \"ends\" | \"filters\" }) => string;\n    /** How many of a kind are selected — `3 racks`: `name` is the kind's, as running text writes it. */\n    inspectorKindCount: (p: SchematicCount & { name: string }) => string;\n    /** A row the record holds none of: an entity whose row is gone. */\n    inspectorNoRow: () => string;\n    /** An item whose details record holds no row of it. */\n    inspectorNoDetails: (p: { name: string }) => string;\n    /** What a link or a net Details lists an item joined to is, under its name: its kind, and for a net the item's side. */\n    inspectorJoin: (p: { kind: string; end: \"source\" | \"destination\" | undefined }) => string;\n    /** A record's last save in the drawing's Details — `Rack saved 14:02 by alice`, or `Rack saved 14:02` where it names no one: `when` is its time today, else its date and time. */\n    inspectorSaved: (p: { name: string; when: string; by: string | undefined }) => string;\n    /**\n     * An edit's step in the history — `Edit A03`, `Unplace A06`, `Delete A03`, `Remove A05 from PDU-B · A side`, and a new\n     * item's key typed (#1549), `Type A03's key`.\n     */\n    inspectorStep: (p: { edit: \"edit\" | \"unplace\" | \"delete\" | \"remove\" | \"key\"; name: string; from?: string }) => string;\n    /** Why a net's side can't be emptied in its tags: a Delete takes the net. */\n    inspectorSideEmpty: (p: { side: \"sources\" | \"destinations\" }) => string;\n    /** What an issue names, in its row — `Rack · A03`; a layer's when `kind` is `undefined`. */\n    issueWhere: (p: { kind: string | undefined; name: string }) => string;\n    /** What an issue says. */\n    issueText: (p: SchematicIssueWord) => string;\n    /** What Issues says with none: its head and the line under it. */\n    inspectorNoIssues: (p: { part: \"title\" | \"hint\" }) => string;\n    /**\n     * What Issues says of the kinds read by area, whose rows it checks only as the view reads them (ruled 27 Oct 2026) —\n     * `Racks out of view are checked only as the view reaches them`: `names` are the kinds', as running text writes them\n     * in the plural.\n     */\n    inspectorUnchecked: (p: { names: readonly string[] }) => string;\n    /**\n     * What Find's line says of an item the rail's filters leave out where the narrowing draws what it leaves out as\n     * context (`narrowed=\"dim\"`), until e3 has said which choices do — `dimmed by the filters`: `hiddenByFilters`' words\n     * for a narrowing that hides.\n     */\n    dimmedByFilters: HiddenWords[\"hiddenByFilters\"];\n    /**\n     * What it says once e3 has: the choices that dim it, each as the rail words it, and those a pick clears with them —\n     * `dimmed by Owner: Harbour Labs — picking it clears that filter` (`hiddenByText` with `dimmed`): `hiddenBy`'s for a\n     * narrowing that hides.\n     */\n    dimmedBy: HiddenWords[\"hiddenBy\"];\n    /**\n     * What the footer says where a pick of a row the rail's filters hide — Find's, or Go to issue's on an unsaved change\n     * waiting in its session — could not clear the choices hiding it, and the rail gave no words of its own.\n     */\n    hiddenUncleared: () => string;\n}\n\n/** A section of the inspector's Details, as its head names it. */\nexport type SchematicInspectorSection = \"fields\" | \"details\" | \"position\" | \"joins\" | \"ends\" | \"sides\" | \"member\" | \"connect\";\n\n/**\n * Why a drop is refused, as its words say it (#1390): outside the drawing; the\n * view's centre, where a card's ⏎ and Details' Place land, off the drawing\n * (#1394), which no pointer moves; no entity of the card's kind under the\n * drag; its kind read only; its kind's session taking no edit now; or its kind\n * adding no item, its keys of a type the form can't type, by the type's name\n * (#1549) — `kind` is the kind's name, as running text writes it.\n */\nexport type SchematicDropRefusalWord =\n    | { readonly why: \"outside\" }\n    | { readonly why: \"offView\" }\n    | { readonly why: \"onto\" | \"readOnly\" | \"busy\"; readonly kind: string }\n    | { readonly why: \"untyped\"; readonly kind: string; readonly type: string };\n\n/**\n * Why a gesture records nothing (#1549), as the footer says it: the row holding\n * the key a row builds, by its kind's name and its own, as running text writes\n * them; a kind adding no row, its keys of a type the form can't type; an item\n * whose key would move, by its name, while some rows of a link or net kind that\n * may name it — by its name, as running text writes it — the filters hide or\n * aren't read (#1580), or those naming it take no edit now (#1584); or a row\n * whose key would move while its kind's details take no edit now (#1584).\n */\nexport type SchematicKeyRefusalWord =\n    | { readonly refusal: \"taken\"; readonly kind: string; readonly name: string }\n    | { readonly refusal: \"untyped\"; readonly kind: string; readonly type: string }\n    | { readonly refusal: \"unheld\"; readonly name: string; readonly kind: string; readonly why: \"filtered\" | \"unread\" | \"busy\" }\n    | { readonly refusal: \"details\"; readonly name: string; readonly kind: string };\n\n/** A tab of the library, as its words name it: its own, or an author's (`tab`). */\nexport type SchematicLibraryTabWord = \"templates\" | \"backlog\" | \"index\" | \"layers\" | \"tab\";\n\n/** A gesture, as the history labels its step. */\nexport type SchematicStep = \"move\" | \"connect\" | \"net\" | \"retarget\" | \"extend\" | \"delete\";\n\nconst plural = (n: number, one: string, many: string): string => (n === 1 ? one : many);\n\n/** A side of a net, as its name lists it: its first members, and how many more. */\nconst membersOf = ({ names, more }: SchematicMembers): string => (more === undefined ? names.join(\", \") : `${names.join(\", \")} and ${more.count} more`);\n\n/** Words as a sentence starts them. */\nconst capital = (text: string): string => text.charAt(0).toUpperCase() + text.slice(1);\n\n/** Why a kind adds no row (#1549): its name as running text writes it, and its key type's name. */\nconst keysUntyped = (name: string, type: string): string => `${capital(name)}s are keyed by ${type}, which can't be typed — give the kind \\`key\\` to add them`;\n\n/** What an issue says, in English. */\nfunction issueText(p: SchematicIssueWord): string {\n    switch (p.issue) {\n        case \"missing\": return `Names ${p.kind} ${p.key}, which no ${p.kind.toLowerCase()} holds`;\n        case \"outside\": return \"Outside the drawing\";\n        case \"geometry\": return \"Its shape reaches past its box\";\n        case \"colour\": return `Its colour, ${p.colour}, is no theme colour: it draws its tone`;\n        case \"bounds\":\n        case \"ready\":\n        case \"save\": return p.field === undefined ? p.message : `${p.field}: ${p.message}`;\n    }\n}\n\n/** Each section's head. */\nfunction inspectorSection({ section, name }: { section: SchematicInspectorSection; name: string }): string {\n    switch (section) {\n        case \"fields\": return name;\n        case \"details\": return `${name} details`;\n        case \"position\": return \"Position\";\n        case \"joins\": return \"Joined to\";\n        case \"ends\": return \"Ends\";\n        case \"sides\": return \"Sides\";\n        case \"member\": return \"Member\";\n        case \"connect\": return \"Connect to\";\n    }\n}\n\n/** Why a drop is refused, in English. */\nfunction dropRefused(p: SchematicDropRefusalWord): string {\n    switch (p.why) {\n        case \"outside\": return \"Outside the drawing\";\n        case \"offView\": return \"The middle of the view is off the drawing: pan the drawing into view, or Fit\";\n        case \"onto\": return `Drop onto ${article(p.kind)} ${p.kind}`;\n        case \"readOnly\": return `${capital(p.kind)}s are read only`;\n        case \"busy\": return `${capital(p.kind)}s take no edit now`;\n        case \"untyped\": return keysUntyped(p.kind, p.type);\n    }\n}\n\n/** Each tool's name. */\nconst TOOL_NAMES: { readonly [T in SchematicTool]: string } = {\n    select: \"Select\", zoom: \"Zoom box\", marquee: \"Marquee\", connect: \"Connect\", move: \"Move\",\n};\n\n/** The words the Schematic draws with none given. */\nconst DEFAULT_VOCABULARY: SchematicVocabulary = {\n    templates: { one: \"Template\", other: \"Templates\" }, backlog: \"Backlog\", index: \"Index\", layer: { one: \"Layer\", other: \"Layers\" },\n    zone: { one: \"Zone\", other: \"Zones\" }, net: { one: \"Net\", other: \"Nets\" }, link: { one: \"Link\", other: \"Links\" },\n    source: { one: \"Source\", other: \"Sources\" }, destination: { one: \"Destination\", other: \"Destinations\" },\n};\n\n/**\n * The English table, in the app's words for what the Schematic draws (#1516).\n *\n * @param v - The app's words\n * @returns The table\n */\nexport function schematicMessagesOf(v: SchematicVocabulary): SchematicMessages {\n    const word = lowerWord;\n    const TAB_NAMES: { readonly [T in Exclude<SchematicLibraryTabWord, \"tab\">]: string } = {\n        templates: v.templates.other, backlog: v.backlog, index: v.index, layers: v.layer.other,\n    };\n    const TAB_NOUNS: { readonly [T in SchematicLibraryTabWord]: readonly [string, string] } = {\n        templates: [word(v.templates.one), word(v.templates.other)], backlog: [\"item\", \"items\"], index: [word(v.zone.one), word(v.zone.other)],\n        layers: [word(v.layer.one), word(v.layer.other)], tab: [\"card\", \"cards\"],\n    };\n    const TOOL_HINTS: { readonly [T in SchematicTool]: string } = {\n        select: \"Select — a tap selects, a drag on empty canvas pans (hold Space)\",\n        zoom: \"Zoom box — drag a box to zoom into (hold Ctrl)\",\n        marquee: \"Marquee — drag a box to select the items in it (Shift adds)\",\n        connect: `Connect — drag from an item to another to record ${article(v.link.one)} ${word(v.link.one)}`,\n        move: \"Move — drag an item, or the selection, to move it\",\n    };\n    return {\n        ...pagedLoadingMessages,\n        frameLabel: () => \"Schematic\",\n        drawingNoun: () => \"the drawing\",\n        lineInView: ({ noun }) => [`Loading ${noun} in view`],\n        lineCounts: () => [\"Loading counts\"],\n        lineDetails: ({ count, noun }) => [\"Loading details for \", { strong: count }, ` ${noun}`],\n        lineFailedInView: ({ noun }) => [`Couldn't read ${noun} in view`],\n        areaFailed: () => \"Couldn't read this area\",\n        canvasLabel: () => \"Schematic canvas — arrow keys step through the items\",\n        minimapHint: () => \"Jump to a location\",\n        toolsLabel: () => \"Tool\",\n        toolName: ({ tool }) => TOOL_NAMES[tool],\n        toolHint: ({ tool }) => TOOL_HINTS[tool],\n        connectDraws: () => \"Connect draws\",\n        connectKind: ({ name }) => `Connect · ${name}`,\n        zoomLabel: () => \"Zoom\",\n        zoomOut: () => \"Zoom out\",\n        zoomIn: () => \"Zoom in\",\n        fit: () => \"Fit\",\n        findLabel: () => \"Find item\",\n        findNoMatches: () => \"No item's key matches. Keys are case-sensitive.\",\n        findMark: ({ mark }) => ({ layer: `on a hidden ${word(v.layer.one)}`, unplaced: \"no position\" })[mark],\n        foundOff: ({ item, mark }) => ({\n            layer: `${item} is on a hidden ${word(v.layer.one)}`,\n            unplaced: `${item} has no position: it is in the ${v.backlog}`,\n        })[mark],\n        viewLabel: () => \"View\",\n        stepLabel: () => \"Step through items\",\n        previousItem: () => \"Previous item\",\n        nextItem: () => \"Next item\",\n        densityNotice: ({ n, count, name, about, unfiltered }) =>\n            `Density: ${about ? \"about \" : \"\"}${count} ${plural(n, name, `${name}s`)}${unfiltered ? \", the filters not applied\" : \"\"} — zoom in to draw ${plural(n, \"it\", \"them\")}`,\n        templatesNoun: ({ name }) => `${name} ${word(v.templates.other)}`,\n        retry: () => \"Retry\",\n        kindNoun: ({ name, plural }) => (plural ? `${name}s` : name),\n        detailsName: ({ name }) => `${name} details`,\n        endRefused: ({ kind, end, item }) => `${kind} can't ${end === \"start\" ? \"start\" : \"end\"} at ${item}`,\n        deleteRefused: ({ item, kind, key }) => `${item} isn't deleted: ${kind} ${key} names it, and is read only`,\n        placeholderRefused: ({ kind }) => `Type the new ${kind}'s key first`,\n        keysUntyped: ({ name, type }) => keysUntyped(name, type),\n        keyPlaceholder: ({ name }) => `Type this ${name}'s key: Save waits for it`,\n        keyRefused: (p) => {\n            switch (p.refusal) {\n                case \"taken\": return `${capital(article(p.kind))} ${p.kind} ${p.name} is there already`;\n                case \"untyped\": return keysUntyped(p.kind, p.type);\n                case \"unheld\": return `${p.name} isn't changed: ${({\n                    filtered: `the filters hide some ${p.kind}s that may name it — clear them, then try again`,\n                    unread: `some ${p.kind}s that may name it aren't read — try again once they are`,\n                    busy: `the ${p.kind}s naming it take no edit now — try again in a moment`,\n                })[p.why]}`;\n                case \"details\": return `${p.name} isn't changed: its ${p.kind} details take no edit now — try again in a moment`;\n            }\n        },\n        step: ({ step, name, n }) => ({\n            move: `Move ${n} ${plural(n, \"item\", \"items\")}`,\n            connect: `Connect a ${name}`,\n            net: `Grow a ${name}`,\n            retarget: `Retarget a ${name}`,\n            extend: `Extend a ${name}`,\n            delete: `Delete ${n} ${plural(n, \"row\", \"rows\")}`,\n        })[step],\n        libraryPane: () => \"Library\",\n        libraryTab: ({ tab }) => TAB_NAMES[tab],\n        libraryNoun: ({ tab, n }) => plural(n, TAB_NOUNS[tab][0], TAB_NOUNS[tab][1]),\n        libraryEmpty: ({ tab, name }) => ({\n            templates: `No ${word(v.templates.other)}`, backlog: `Nothing in the ${word(v.backlog)}`, index: `No ${word(v.zone.other)}`, layers: `No ${word(v.layer.other)}`, tab: `Nothing in ${name}`,\n        })[tab],\n        libraryEmptyHint: ({ tab }) => ({\n            templates: `No ${word(v.templates.one)} to drag onto the canvas.`,\n            backlog: \"Every item has a place on the drawing.\",\n            index: `The drawing holds no ${word(v.zone.one)}.`,\n            layers: `The drawing has no ${word(v.layer.one)}.`,\n            tab: \"No card to drag onto the canvas.\",\n        })[tab],\n        libraryNarrowed: ({ tab, name }) => `No ${tab === \"tab\" ? name : TAB_NOUNS[tab][1]} match the filters`,\n        libraryNarrowedHint: ({ tab, name }) => `Change or clear the filters to see more ${tab === \"tab\" ? name : TAB_NOUNS[tab][1]}.`,\n        libraryGroupBy: () => \"Group\",\n        templateGroup: ({ kind, group }) => (group === undefined ? kind : `${kind} · ${group}`),\n        backlogLine: ({ kind, sublabel }) => (sublabel === undefined ? kind : `${kind} · ${sublabel}`),\n        indexSearch: () => \"Search items\",\n        indexNoMatch: ({ query }) => `No items match \"${query}\"`,\n        indexToggle: ({ zone, open }) => `${open ? \"Close\" : \"Open\"} ${zone}`,\n        indexCount: ({ n, count }) => `${count} ${plural(n, \"item\", \"items\")}`,\n        indexCrowded: ({ n, count, zone, name }) => `${zone} holds more than ${count} ${plural(n, name, `${name}s`)}: search to find one`,\n        indexMore: ({ n, count }) => `${count} more ${plural(n, \"matches\", \"match\")}: type more to find ${plural(n, \"it\", \"them\")}`,\n        layersShowAll: () => \"Show all\",\n        layerShow: ({ layer, shown }) => `${shown ? \"Hide\" : \"Show\"} ${layer}`,\n        layerIsolate: ({ layer, isolated }) => (isolated ? `Show every ${word(v.layer.one)}, not ${layer} alone` : `Isolate ${layer}`),\n        layerLock: ({ layer, locked }) => `${locked ? \"Unlock\" : \"Lock\"} ${layer}`,\n        layerCount: ({ n, count }) => `${count} ${plural(n, \"entity\", \"entities\")}`,\n        sourceUnavailable: ({ name }) => `${capital(name)} results unavailable`,\n        sourceChanged: ({ name }) => `${capital(name)} results changed; retry the narrowing.`,\n        sourceFailed: ({ name }) => `Could not load ${name} results`,\n        dropAt: ({ zone, x, y, unit }) => `${zone === undefined ? \"\" : `${zone} · `}${x}, ${y}${unit === undefined ? \"\" : ` ${unit}`}`,\n        dropOnto: ({ name }) => `onto ${name}`,\n        linkEnds: ({ from, to }) => `${from} → ${to}`,\n        netEnds: ({ sources, destinations }) => `${membersOf(sources)} → ${membersOf(destinations)}`,\n        dropMany: ({ n, count, name }) => `${count} ${plural(n, name, `${name}s`)}`,\n        dropRefused,\n        dropCanvas: () => \"the canvas\",\n        dropLabel: ({ card, where, onto }) => `Drop ${card} ${onto ? \"on\" : \"at\"} ${where}`,\n        inspectorPane: () => \"Inspector\",\n        inspectorTab: ({ tab }) => (tab === \"details\" ? \"Details\" : \"Issues\"),\n        inspectorDrawing: () => \"Drawing\",\n        inspectorSection,\n        inspectorField: ({ field }) => ({\n            x: \"x\", y: \"y\", from: \"From\", to: \"To\", sources: v.source.other, destinations: v.destination.other, kind: `${v.link.one} kind`, key: \"Key\",\n        })[field],\n        inspectorKeyHelp: () => \"Its kind makes no key of its own: Save waits for this one, and nothing joins the item until it is typed.\",\n        inspectorKeyPartsHelp: () => \"Its kind makes no key of its own: type each part, then Set key. Save waits for it, and nothing joins the item until it is set.\",\n        inspectorKeySet: () => \"Set key\",\n        inspectorKeyRefused: ({ name, key }) => `${capital(article(name))} ${name} is keyed ${key} already`,\n        inspectorAction: ({ action }) => ({ delete: \"Delete\", unplace: \"Unplace\", remove: \"Remove\", place: \"Place\" })[action],\n        inspectorUnplaced: () => \"Not placed\",\n        inspectorAt: ({ zone, x, y, unit }) => `${zone === undefined ? \"\" : `${zone} · `}${x}, ${y}${unit === undefined ? \"\" : ` ${unit}`}`,\n        inspectorSize: ({ width, height, unit }) => `${width} × ${height}${unit === undefined ? \"\" : ` ${unit}`}`,\n        inspectorSides: ({ sources, destinations }) =>\n            `${sources.count} ${plural(sources.n, word(v.source.one), word(v.source.other))} → ${destinations.count} ${plural(destinations.n, word(v.destination.one), word(v.destination.other))}`,\n        inspectorLeg: ({ end }) => `${end === \"source\" ? v.source.one : v.destination.one} leg`,\n        inspectorSeveral: ({ count }) => `${count} selected`,\n        inspectorCount: ({ what, n }) => ({ zones: plural(n, v.zone.one, v.zone.other), links: plural(n, v.link.one, v.link.other), nets: plural(n, v.net.one, v.net.other) })[what],\n        inspectorNotCounted: ({ names, why }) => `${capital(joinedWords(names, \"and\"))} not counted: ${({\n            layer: `a hidden ${word(v.layer.one)} may hold some of them`, ends: \"what they join is read as the view moves\", filters: \"the filters can't count those with no position\",\n        })[why]}`,\n        inspectorKindCount: ({ n, count, name }) => `${count} ${plural(n, name, `${name}s`)}`,\n        inspectorNoRow: () => \"Its record holds no row of it\",\n        inspectorNoDetails: ({ name }) => `No ${name.toLowerCase()} details`,\n        inspectorJoin: ({ kind, end }) => (end === undefined ? kind : `${kind} · ${word(end === \"source\" ? v.source.one : v.destination.one)}`),\n        inspectorSaved: ({ name, when, by }) => (by === undefined ? `${name} saved ${when}` : `${name} saved ${when} by ${by}`),\n        inspectorStep: ({ edit, name, from }) => ({\n            edit: `Edit ${name}`, unplace: `Unplace ${name}`, delete: `Delete ${name}`, remove: `Remove ${name} from ${from ?? \"\"}`, key: `Type ${name}'s key`,\n        })[edit],\n        inspectorSideEmpty: ({ side }) => `${capital(article(v.net.one))} ${word(v.net.one)} keeps one ${word(side === \"sources\" ? v.source.one : v.destination.one)} at least: Delete takes the ${word(v.net.one)}`,\n        issueWhere: ({ kind, name }) => `${kind ?? v.layer.one} · ${name}`,\n        issueText,\n        inspectorNoIssues: ({ part }) => (part === \"title\" ? \"No issues\" : `Every ${word(v.link.one)} names its items, and every shape and colour holds.`),\n        inspectorUnchecked: ({ names }) => `${capital(joinedWords(names, \"and\"))} out of view are checked only as the view reaches them`,\n        hiddenByFilters: () => \"hidden by the filters\",\n        hiddenBy: ({ filters, also }) => hiddenByText(filters, also),\n        dimmedByFilters: () => \"dimmed by the filters\",\n        dimmedBy: ({ filters, also }) => hiddenByText(filters, also, \"dimmed\"),\n        hiddenUncleared: () => \"The filters hiding it could not be cleared\",\n    };\n}\n\n/** The English table, in the Schematic's own words. */\nexport const schematicMessages: SchematicMessages = schematicMessagesOf(DEFAULT_VOCABULARY);\n\n/** The words a Schematic speaks: its message table, and its locale's formatters. */\nexport interface SchematicWords extends Formatters {\n    /** The message table in effect. */\n    readonly m: SchematicMessages;\n}\n\n/**\n * A coordinate or a length as the Schematic prints it, to the centimetre:\n * Details' position and size, and a conflict's card.\n *\n * @param n - The value, in the drawing's unit\n * @param words - The words\n * @returns Its text, in the locale\n */\nexport function coordinate(n: number, words: SchematicWords): string {\n    const digits = some(2n);\n    return words.value(n, variant(\"number\", { minimumFractionDigits: digits, maximumFractionDigits: digits, signDisplay: none }));\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's inspector (#1391, `Schematic Builder Spec.md` §9, SC15,\n * SC16, D11, D32): its end pane, given `inspector` — opted into, as the\n * Plan's, the Roster's and the Calendar's are — its tabs Details and Issues,\n * Issues with its count; collapsed, a rail with its icon, the issues' count\n * and what is selected. It replaces the hover cards (D11).\n *\n * Details shows what is selected (`inspect.ts`), every field through the\n * shared `FieldForm` — the shared input its East type takes, by its kind's\n * form (`fields`: the `Fields` specs of the fields no role writes, and of the\n * fields an item's or a zone's box is, which Details leaves out of it, a hint\n * holding them to their bounds (#1585)) — under the shared inspector head: its\n * kind's icon and name, its own name, where it stands, its status, and a\n * Pending or New chip while its drafts hold it otherwise than its record. Its\n * own name is the one the Schematic gives it everywhere (`inspect.ts`'\n * `entityNames`), which the collapsed rail says too: a link's ends, its caption\n * under them; a net's label, else its ends — never a key the Schematic minted\n * for a new link or net:\n *\n * - **an item**: its kind's form — or its kind's own `inspector` in its place\n *   — its details record's form, or its details' own; its position, `x` and\n *   `y` — held to the bounds a hint gives its centre, one it breaks said once,\n *   in its field's help line (#1585) — with Unplace where its kind has a\n *   backlog; Delete; and what it is joined to, each link and net a control\n *   that selects it;\n * - **a zone**: its form, or its own Details;\n * - **a link**: its ends, each a Chooser over the items of the slots its role\n *   names; its form; Delete;\n * - **a net**: its sides, each tags over the keys of its slot's items; its\n *   form; Delete; and **a net's leg** — the stub a tap selected — its item, a\n *   control that selects it, and Remove, which takes it off its side;\n * - **several**: how many of each kind, and Delete;\n * - **nothing**: the drawing — its counts, and each record's last save with\n *   who made it. A kind read by area is counted by its source, never by its\n *   window (`counts.ts`): a placeholder stands in its count's place while it\n *   is read, and a line names each count no read can say, and why.\n *\n * A Chooser, a side's tags and what an item is joined to offer only what the\n * rail's narrowing shows (#1392, §10.2).\n *\n * Below 480px of main (#1394, D15) Details gains the actions the canvas\n * doesn't take there: an item's Connect to… — a Chooser over the items a link\n * of a kind may run to from it, and the kind while several may, a choice\n * recording the link as a Connect drag does — and, for the Backlog's card\n * picked, an item with no position: its Place puts it at the canvas's centre,\n * as the card's ⏎ does, and selects it, its fields then Details' to edit. Its\n * Move is the position's `x` and `y`, its Delete the item's. A link's ends, a\n * net's sides and Connect to… are held to the host's veto as the gestures are\n * (`edits.ts`' `connectVeto`): a link's new pair, each pair a net's sides newly\n * join; refused, the field and the footer say why and nothing is recorded.\n *\n * A new item whose kind makes no key of its own (#1549) — keyed by a type the\n * viewer types, its record building none — shows its key field at the head of\n * Details while it is new: the form's own editor for the key type, its help\n * line under it, washed and taking the keyboard while the item waits under a\n * placeholder, which holds Save. A key of several parts — a struct's fields, a\n * variant's case and its value — is typed a part at a time and taken whole by\n * Set key (#1581, `shared/schedule/key-draft.tsx`). A key typed moves the item,\n * and its details row, under it — refused, its field and the footer saying why,\n * where a row of its kind stands under it already; a key whose row a draft deletes is free\n * (#1581). Until it is typed, no link's end or net's side names the item:\n * Connect to…, a link's ends and a net's sides refuse it, saying so.\n *\n * Every edit is one step of the editing's history (`editing.ts`): a field\n * through its record's `set`, the row a kind's own Details hands back through\n * `update` whole, a position, ends or sides through the kind's `write`, and\n * Delete as the canvas's Del — refused, the footer says why. A field's edit\n * refused leaves the field showing what its row holds: one the Schematic says\n * why of — a key another row holds, the host's veto, a side emptied — says so\n * under the field too, the keyboard where the edit left it (`FieldForm`'s\n * refusal); one refused with nothing to say — its kind's own `set` or `write`\n * refusing it — draws its form again. A field its\n * drafts changed is tinted against its record. Read only — a kind bound read\n * only, or the Schematic `readOnly` — Details shows every field and edits\n * none, an own Details giving way to the form; while a record takes no edit\n * — a Save in flight, or what the canvas draws standing in while a new\n * narrowing is read (#1398, CL8) — its controls are off. A number a row holds\n * outside its field's bounds is said in the tone the row's Save stands in\n * (#1585): a warning as stored, an error once its record's session refuses the\n * row's change, holding Save. A field its record's session's refusal names —\n * the app's check of the row's change — takes the warn wash and says the\n * refusal's words under it (ruled 13 Nov 2026), an item's centre's in its\n * position: Details lists no issue, so the field itself says why it is named.\n * An issue gone to, from the toolbar or from its\n * line in Issues, puts the keyboard in the field it names — an item's\n * centre's, in its position — the inspector opened at Details where it is\n * collapsed or at Issues.\n *\n * Details keeps the keyboard (#1398): a control that goes with the view it was\n * pressed in — Delete and Unplace, which leave nothing selected, a leg's\n * Remove, Place, a join's link, a refused edit's form drawn again — leaves the\n * focus on the heading of the view drawn in its place (`../shared/focus-home.ts`),\n * never on the page's body. The heading, not the canvas: it names what Details\n * shows now, a screen reader saying where the keyboard is, and the next Tab\n * goes on through the controls under it; the canvas would move the keyboard\n * to a part the viewer did not press in, where an arrow steps the selection.\n *\n * While a row of what is selected is read — its own, or its details' — its\n * section shows its form's fields, each its real label over a placeholder in\n * its control's place, shaped as its editor's value (#1398): never a value it\n * has not read, and the form its own height when the row lands.\n *\n * Issues (SC16) lists the drawing's issues (`issues.ts`), each a control that\n * selects what it names and flies to it, the field it names taking the\n * keyboard in its Details, as the toolbar's issue gone to puts it there: the\n * viewer lands where the issue is fixed, not left on Issues. A kind read by\n * area is checked in the rows read around the view, with every unsaved\n * change, never by a read of its other rows: while one is, a line over the\n * list names it and says its rows out of view are checked only as the view\n * reaches them, as the drawing's counts say what they don't count (ruled 27\n * Oct 2026, \"Checked in view, said so\").\n * An unsaved change the drawing leaves out — a draft waiting in its session,\n * the rail's filters leaving out the row it drafts — is checked as its draft\n * has it, and its issue says on a line of its own which choices hide it, each\n * as the rail words it — `hidden by the filters` until e3 has said — asked of\n * e3 through its kind's hidden pick, which the frame reads for every kind read\n * through its source (the shared hidden pick): Go to issue is the frame's\n * hidden pick, as Find's is — just those choices cleared, every choice of its\n * kind's source while e3 has not said, then flown to where its draft stands\n * and selected once the narrowing they leave draws it.\n *\n * Styles are the `schematicInspector` recipe's, the form's `fieldForm`'s and\n * the buttons the shared `button`'s; the pane — its tab row, its collapse\n * control and its rail — is the Dock's.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { Box, chakra, useRecipe, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport {\n    ArrayType, FloatType, StringType, StructType, encodeBeast2For, equalFor, fromEastTypeValue, none, some,\n    type EastType, type StructType as EastStructType, type option,\n} from \"@elaraai/east\";\nimport { Fields, type FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport {\n    EastChakraComponent, FieldForm, getSomeorUndefined, useTrackedEvaluation, type BuilderFrameDock, type FieldOption, type Origin,\n} from \"@elaraai/east-ui-components\";\nimport { PlaceholderShape, type PlaceholderKind } from \"@elaraai/east-ui-components/internal\";\nimport { FOCUS_HOME_PROPS, useFocusHome } from \"../shared/focus-home.js\";\nimport { useFieldAsk } from \"../shared/schedule/field-ask.js\";\nimport { KeySetButton, useKeyDraft } from \"../shared/schedule/key-draft.js\";\nimport { keyFieldSpecs, kindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { askHiding, hiddenLine, hiddenOf, type RowHidden, type RowHiding, type SourceHiding } from \"../shared/schedule/hidden.js\";\nimport type { HiddenPicks } from \"../shared/schedule/hidden-pick.js\";\nimport { ScheduleInspectorHead } from \"../shared/schedule/inspector-head.js\";\nimport { draftedRow, rowCodec } from \"../shared/schedule/records.js\";\nimport { entryRefusals, refusedFields, type RefusedFields } from \"../shared/schedule/refusals.js\";\nimport { kindPlural } from \"../shared/schedule/words.js\";\nimport { authorOf } from \"../shared/records/author.js\";\nimport { entityId, refOfId, type DrawnItem, type DrawnLink, type DrawnNet, type DrawnZone, type SchematicDrawn, type SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicCounts, SchematicDrawingCount, SchematicSavedRecord, SchematicUncounted } from \"./counts.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport {\n    NO_SESSION, connectStep, deleteEdits, editKinds, joinedPairs, linkRefusal, placeholderRefusal, retargetEdits, vetoOfPairs,\n    type ConnectVetoOf, type DeleteSelection, type EditRefusal, type NetLeg, type SchematicEdit, type SchematicFieldWrite, type SchematicKeyRefusal,\n} from \"./edits.js\";\nimport { detailsKey, type SchematicEditing } from \"./editing.js\";\nimport { joinsOf, nameOfEntity, type SchematicDrawnEntity, type SchematicInspected, type SchematicUnplaced } from \"./inspect.js\";\nimport { captionText } from \"./canvas/paint.js\";\nimport type { SchematicInspectedRows, SchematicRowRead } from \"./inspector-rows.js\";\nimport type { SchematicIssue } from \"./issues.js\";\nimport { coordinate, type SchematicWords } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n/** A kind of any sort, as the payload carries it. */\ntype AnyKind = SchematicValue[\"items\"][number] | SchematicValue[\"zones\"][number] | SchematicValue[\"links\"][number] | SchematicValue[\"nets\"][number];\n/** A record's side as Details reads it: a kind's own, or its details'. */\ntype RecordSide = Pick<AnyKind, \"editable\" | \"fields\" | \"inspector\" | \"rowType\">;\n/** An author's own Details, decoded: the row as bytes and its writer, to UI. */\ntype OwnDetails = Extract<AnyKind[\"inspector\"], { type: \"some\" }>[\"value\"];\n\n/** The inspector open: the design system's 320px (§6), as the Plan's, the Sheet's and the Flowchart's are. */\nconst INSPECTOR_SIZE = \"320px\";\n\n/** A form that takes no edit: read only. */\nconst NO_EDIT = (): void => {};\n/** What a new row's form is tinted against: nothing — every field it has is a change. */\nconst NEW_ROW: Readonly<Record<string, unknown>> = {};\n\nconst stringEqual = equalFor(StringType);\n\n/** An item's centre, as its form edits it. */\nconst PositionType = StructType({ x: FloatType, y: FloatType });\n/** A link's ends, as their Choosers pick them: each item by its id. */\nconst EndsFormType = StructType({ from: StringType, to: StringType });\n/** A net's sides, as their tags list them: each member by its key. */\nconst SidesFormType = StructType({ sources: ArrayType(StringType), destinations: ArrayType(StringType) });\n/** Connect to…, below 480px of main (#1394): the link kind it records, by its slot, and the item it runs to, by its id. */\nconst ConnectFormType = StructType({ kind: StringType, to: StringType });\n\n/**\n * The editing as Details records its edits: as every route's are (`index.tsx`), each row whose key its fields build\n * following them (#1549) — an edit refused handing back why, where the Schematic says.\n */\nexport interface SchematicInspectorEditing extends Omit<SchematicEditing, \"record\"> {\n    /**\n     * Records one edit as one step of the history.\n     *\n     * @param edits - The rows it changes, and how\n     * @param origin - The gesture\n     * @param label - Its label in the history\n     * @returns `true` once recorded; refused, why — its key refused, as the footer says it — or `false` where nothing says\n     */\n    record(edits: readonly SchematicEdit[], origin: Origin, label: string): boolean | string;\n}\n\n/** What the inspector reads of the Schematic. */\nexport interface SchematicInspectorProps {\n    /** The payload, decoded. */\n    readonly value: SchematicValue;\n    /** What Details shows. */\n    readonly inspected: SchematicInspected;\n    /** The inspected entity's stored rows: its own and its details'. */\n    readonly rows: SchematicInspectedRows;\n    /** What the canvas draws: the stored rows, the drafts in place. */\n    readonly drawn: SchematicDrawn;\n    /**\n     * Each entity's name, by its id, as the Schematic says it everywhere (`inspect.ts`' `entityNames`): what the head, the\n     * collapsed rail and the lists name it — a link by its ends, a net by its label or its ends, never a key it minted.\n     */\n    readonly names: ReadonlyMap<string, string>;\n    /** The drawing as its lists show it, what the rail's narrowing leaves out left out (#1392): what a Chooser offers, and what an item is joined to. */\n    readonly listed: SchematicDrawn;\n    /** The editing: each record's session and drafts, and how an edit is recorded. */\n    readonly editing: SchematicInspectorEditing;\n    /** What the drawing's Details counts, with nothing selected (`counts.ts`). */\n    readonly counts: SchematicCounts;\n    /** The kinds' records whose commits say when each was last saved, and by whom. */\n    readonly records: readonly SchematicSavedRecord[];\n    /** The drawing's issues, and its sessions'. */\n    readonly issues: readonly SchematicIssue[];\n    /**\n     * The kinds read by area, each by its name as running text writes it in the plural (`racks`): Issues checks their rows\n     * read around the view and says the others are checked only as the view reaches them; none, it says nothing of it.\n     */\n    readonly unchecked: readonly string[];\n    /**\n     * Each unsaved change the drawing leaves out — a drafted row waiting in its session, the narrowing leaving out the row\n     * it drafts (`drafted.ts`' `waitingDrafts`) — its reference by its id: what Issues checks beside the drawing, and an\n     * issue of which says which of the rail's choices hide it.\n     */\n    readonly waiting: ReadonlyMap<string, SchematicRef>;\n    /**\n     * Each kind's hidden pick, by its slot — every kind read through its source of the rail, read by the frame\n     * (`hidden-pick.tsx`' `HideSources`): what an issue of an unsaved change the drawing leaves out asks e3 which of the\n     * rail's choices hide the row it drafts.\n     */\n    readonly picks: HiddenPicks;\n    /**\n     * Goes to an unsaved change the drawing leaves out, by its id — the frame's hidden pick, as Find's is: the choices\n     * hiding it cleared, flown to where its draft stands, and selected once the narrowing they leave draws it.\n     *\n     * @param id - The change's entity, by its id\n     * @param hidden - What hides the row it drafts, as far as e3 has said; `undefined` where nothing does\n     */\n    readonly goToWaiting: (id: string, hidden: readonly SourceHiding[] | undefined) => void;\n    /**\n     * Asks a row's Details for a field, which takes the keyboard there, the inspector opened at Details: what an issue's\n     * line in Issues asks, as the toolbar's issue gone to does. Asked for none, any ask standing is dropped.\n     *\n     * @param record - The row's record, by its key in the history: its kind's slot, or its details record's\n     * @param entry - The row's key\n     * @param field - The field the issue names, by its form's key; none for an issue naming none\n     */\n    readonly ask: (record: string, entry: string, field: option<string>) => void;\n    /** The zone holding a point, by its name, as the Index files an item. */\n    readonly zoneAt: (x: number, y: number) => string | undefined;\n    /** Selects an entity, by its id — a net's leg with it — flying to it; `undefined` selects nothing. */\n    readonly reveal: (id: string | undefined, leg?: NetLeg) => void;\n    /** Says why an edit was refused, in the footer; `undefined` clears it. */\n    readonly refuse: (words: string | undefined) => void;\n    /** Says why an edit records nothing, its new row's key refused (#1549), in the footer, and hands back the words. */\n    readonly keyRefused: (refusal: SchematicKeyRefusal) => string;\n    /** Selects an entity alone, by its id, once the drawing draws it, the camera where it is: an item under the key typed for it (#1549). */\n    readonly select: (id: string) => void;\n    /** The open tab. */\n    readonly tab: string;\n    /** Opens a tab. */\n    readonly onTab: (tab: string) => void;\n    /** Where an own Details keeps its own state. */\n    readonly storageKey: string;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /** Whether main is below 480px (#1394, D15): Details gains the actions the canvas doesn't take there — an item's Connect to…, an unplaced item's Place. */\n    readonly narrow: boolean;\n    /** The host's veto, as every route that connects two items asks it (`edits.ts`' `connectVeto`): what Connect to…, a link's ends and a net's sides are held to. */\n    readonly veto: ConnectVetoOf;\n    /** The link kind Connect draws, by its slot — the toolbar's Connect menu's choice: what Connect to… records, while it may run from the item. */\n    readonly linkKind: string | undefined;\n    /** Picks the link kind Connect draws: Connect to…'s choice of it, which the toolbar's Connect menu follows. */\n    readonly onLinkKind: (slot: string) => void;\n    /** What a new link takes its other fields from, by its kind's slot (§4.3): the values of the template of its kind the library has selected; `none`, their types' defaults. */\n    readonly connectValues: (slot: string) => option<Uint8Array>;\n    /** Places an item with no position at the canvas's centre, by its id, as its Backlog card's ⏎ does, and selects it (#1394). */\n    readonly place: (id: string) => void;\n}\n\n/** Each view's props: the inspector's, and the recipe's styles. */\ninterface ViewProps extends SchematicInspectorProps {\n    readonly styles: Styles;\n}\n\n/** What is selected, as the rail says it under its label: what the head titles it, by the one name the Schematic gives it. */\nfunction whatOf(props: SchematicInspectorProps): string | undefined {\n    const { inspected, names, words } = props;\n    switch (inspected.view) {\n        case \"drawing\": return undefined;\n        case \"several\": return words.m.inspectorSeveral({ n: inspected.entities.length, count: words.number(inspected.entities.length) });\n        case \"entity\":\n        case \"leg\": return nameOfEntity(names, inspected.id);\n        case \"unplaced\": return inspected.label;\n    }\n}\n\n/**\n * The inspector pane, as `BuilderFrame` draws it — see the module docs.\n *\n * @param props - What is selected and its rows, the drawing, the editing, the counts, the records, the issues, the tab and the words\n * @returns The pane — 320px wide, its collapsed state kept per viewer — or `undefined`, no pane, when the Schematic is given no inspector\n */\nexport function schematicInspectorPane(props: SchematicInspectorProps): BuilderFrameDock | undefined {\n    if (!props.value.inspector) return undefined;\n    const { words, issues } = props;\n    const m = words.m;\n    const n = issues.length;\n    return {\n        label: m.inspectorPane(),\n        icon: \"sliders\",\n        size: INSPECTOR_SIZE,\n        persist: \"local\",\n        // Collapsed, the rail counts the issues and names what is selected.\n        badge: n > 0 ? n : undefined,\n        detail: whatOf(props),\n        tab: props.tab,\n        onTabChange: props.onTab,\n        tabs: [\n            { key: \"details\", label: m.inspectorTab({ tab: \"details\" }), body: <SchematicInspectorDetails {...props} /> },\n            { key: \"issues\", label: m.inspectorTab({ tab: \"issues\" }), count: n, body: <SchematicInspectorIssues {...props} /> },\n        ],\n    };\n}\n\n// ============================================================================\n// The shared parts\n// ============================================================================\n\n/** One gesture's button: Delete, Unplace, Remove, and an item with no position's Place (#1394). */\nfunction Action({ action, onClick, words }: { action: \"delete\" | \"unplace\" | \"remove\" | \"place\"; onClick: () => void; words: SchematicWords }) {\n    const button = useRecipe({ key: \"button\" });\n    return (\n        <chakra.button type=\"button\" css={button({ variant: \"outline\", size: \"xs\" })} data-inspector-action={action} onClick={onClick}>\n            {words.m.inspectorAction({ action })}\n        </chakra.button>\n    );\n}\n\n/** A view's edits: its forms — or an own Details — and its gestures, in one fieldset, off while its record takes no edit. */\nfunction Edits({ styles, available, children, actions }: { styles: Styles; available: boolean; children: ReactNode; actions: ReactNode | undefined }) {\n    return (\n        <chakra.fieldset css={styles.edits} disabled={!available} data-inspector-edits=\"\">\n            {children}\n            {actions !== undefined && <Box css={styles.actions} data-inspector-actions=\"\">{actions}</Box>}\n        </chakra.fieldset>\n    );\n}\n\n/** What a field's value is drawn as while its row is read (#1398): the shape of its editor's value. */\nfunction placeholderOf(spec: FieldSpecValue): PlaceholderKind {\n    switch (spec.editor.type) {\n        case \"number\": return \"number\";\n        case \"checkbox\": return \"boolean\";\n        case \"datetime\": return \"date\";\n        case \"select\": return \"enum\";\n        case \"tags\": return \"chip\";\n        default: return \"text\";\n    }\n}\n\n/** A field's control while its row is read: a placeholder in its place, its length keyed to the field, so it never moves. */\nconst pendingControl = (spec: FieldSpecValue): ReactNode => <PlaceholderShape kind={placeholderOf(spec)} index={spec.path.join(\".\").length} />;\n\n/**\n * A form under its section's head — a section with no head of its own, a new item's key field, has none: an edit\n * refused saying why (`onChange` handing back the words) puts its field back, saying so under it; one refused with\n * nothing to say remounts it (`refused`), so it shows what the row holds again. While its row is read (`pending`),\n * each field is its label over a placeholder (#1398). A field an issue names (`issues`) takes the warn wash — and, given\n * the issue's words, says them under it (ruled 13 Nov 2026) — and the field named (`focus`) the keyboard (#1549); a\n * number outside its bounds is said in the tone its row's Save stands in (`breaches`, #1585).\n */\nfunction Form({ styles, head, section, specs, value, baseline, options, onChange, readOnly, refused, pending = false, issues, focus, breaches }: {\n    styles: Styles; head: string | undefined; section: string; specs: readonly FieldSpecValue[]; value: unknown; baseline: unknown;\n    options?: Readonly<Record<string, readonly FieldOption[]>> | undefined;\n    onChange: (path: readonly string[], value: unknown) => string | void; readOnly: boolean; refused?: number; pending?: boolean;\n    issues?: ReadonlySet<string> | RefusedFields | undefined; focus?: string | undefined; breaches?: \"warn\" | \"error\" | undefined;\n}) {\n    if (specs.length === 0) return null;\n    return (\n        <Box css={styles.fields} data-inspector-fields={section} data-pending={pending ? \"\" : undefined}>\n            {head !== undefined && <Box css={styles.sectionHead}>{head}</Box>}\n            <FieldForm key={refused ?? 0} specs={specs} value={value} baseline={baseline} options={options} onChange={onChange} readOnly={readOnly}\n                renderControl={pending ? pendingControl : undefined} issues={issues} focus={focus} breaches={breaches} />\n        </Box>\n    );\n}\n\n/** An own Details in its section: the author's UI for the row, its `update` writing the edited row back. */\nfunction Custom({ styles, head, section, ui, storageKey }: { styles: Styles; head: string; section: string; ui: unknown; storageKey: string }) {\n    return (\n        <Box css={styles.custom} data-inspector-fields={section}>\n            <Box css={styles.sectionHead}>{head}</Box>\n            <EastChakraComponent value={ui as never} storageKey={storageKey} />\n        </Box>\n    );\n}\n\n/** A fact on a line of its own. */\nfunction Fact({ styles, fact, children }: { styles: Styles; fact: string; children: ReactNode }) {\n    return <Box css={styles.section}><Box css={styles.fact} data-inspector-fact={fact}>{children}</Box></Box>;\n}\n\n/** A remount counter for a form whose edit was refused with nothing to say: its input shows what the row holds again. */\nfunction useRefused(): [number, () => void] {\n    const [refused, setRefused] = useState(0);\n    const bump = useCallback(() => setRefused((n) => n + 1), []);\n    return [refused, bump];\n}\n\n/** A row as Details holds it: as its drafts hold it, else its record; what its form is tinted against; its chip. */\ninterface RowState {\n    /** The row now, decoded: drafted, else as its record holds it; `undefined` while it is read, or for none. */\n    readonly row: unknown;\n    /** The row now, as bytes: what an own Details is handed. */\n    readonly bytes: Uint8Array | undefined;\n    /** What its form is tinted against: its record's row, or — a new row — nothing. */\n    readonly baseline: unknown;\n    /** New while its record holds none of it; Pending while its drafts hold it otherwise. */\n    readonly chip: \"pending\" | \"new\" | undefined;\n    /** Whether its stored row's read is in flight, and no draft stands in for it. */\n    readonly reading: boolean;\n}\n\n/**\n * A record's row as Details holds it: drafted, its session's version; else as\n * its record holds it, from the reader's bytes.\n *\n * @param editing - The editing\n * @param record - The record's key in the history: a kind's slot, or its details'\n * @param side - The record's side: its row type\n * @param key - The row's key\n * @param read - Its stored row, as the reader read it\n * @returns The row's state\n */\nfunction useRowState(editing: SchematicInspectorEditing, record: string, side: RecordSide | undefined, key: string, read: SchematicRowRead | undefined): RowState {\n    const codec = useMemo(() => (side === undefined ? undefined : rowCodec(side.rowType)), [side]);\n    const stored = useMemo(() => (read?.state === \"held\" && codec !== undefined ? codec.decode(read.row) : undefined), [read, codec]);\n    const drafted = editing.schedule.draftsOf(record).has(key);\n    const session = drafted ? editing.schedule.sessions.find((part) => stringEqual(part.kind, record))?.session : undefined;\n    const draft = drafted ? draftedRow(session?.entries.get(key))?.row : undefined;\n    const row = drafted ? draft : stored;\n    const bytes = useMemo(() => {\n        if (row === undefined || codec === undefined) return undefined;\n        return !drafted && read?.state === \"held\" ? read.row : codec.encode(row);\n    }, [row, codec, drafted, read]);\n    return {\n        row, bytes,\n        baseline: stored ?? NEW_ROW,\n        chip: drafted ? (read?.state === \"held\" ? \"pending\" : \"new\") : undefined,\n        reading: !drafted && read?.state === \"reading\",\n    };\n}\n\n/**\n * An own Details for a row: what the author's function returns for its bytes,\n * its `update` writing the edited row back — or, where it fails, nothing, and\n * the form shows.\n */\nfunction useOwnDetails(author: OwnDetails | undefined, bytes: Uint8Array | undefined, update: (edited: Uint8Array) => null, what: string): unknown {\n    return useMemo(() => {\n        if (author === undefined || bytes === undefined) return undefined;\n        try {\n            return author(bytes, update);\n        } catch (err) {\n            console.error(`[Schematic] ${what}'s own Details failed; its form shows instead:`, err);\n            return undefined;\n        }\n    }, [author, bytes, update, what]);\n}\n\n/**\n * A field of a form edited, as its record's `set` takes it: its path, and its\n * value as bytes at the field's type — its spec's, else the row's own field's.\n *\n * @param specs - The form's specs\n * @param rowType - The row type\n * @param path - The field's path\n * @param next - Its new value\n * @returns The write; `undefined` for a path no field is at\n */\nfunction fieldWrite(specs: readonly FieldSpecValue[], rowType: RecordSide[\"rowType\"], path: readonly string[], next: unknown): SchematicFieldWrite | undefined {\n    const spec = specs.find((field) => field.path.length === path.length && field.path.every((part, i) => stringEqual(part, path[i]!)));\n    const row = fromEastTypeValue(rowType) as EastStructType;\n    const type = spec !== undefined ? fromEastTypeValue(spec.type) as EastType : path.length === 1 ? row.fields[path[0]!] : undefined;\n    if (type === undefined) return undefined;\n    return { path: [...path], value: encodeBeast2For(type)(next as never) };\n}\n\n/** A refusal's words, as the canvas says them. */\nfunction refusalWords(refusal: EditRefusal, words: SchematicWords): string {\n    switch (refusal.why) {\n        case \"end\": return words.m.endRefused({ kind: refusal.kind, end: refusal.end, item: refusal.item });\n        case \"named\": return words.m.deleteRefused({ item: refusal.item, kind: refusal.kind, key: refusal.key });\n        case \"placeholder\": return words.m.placeholderRefused({ kind: refusal.kind.toLocaleLowerCase(words.locale) });\n    }\n}\n\n/**\n * The edits a view records: each one step, a recorded one clearing the\n * footer's refusal — refused, why, where the Schematic says (`false` where\n * nothing does) — and Delete, as the canvas's Del, refused in its words.\n */\nfunction useCommit(props: SchematicInspectorProps) {\n    const { editing, refuse, value, drawn, words } = props;\n    const commit = useCallback((edits: readonly SchematicEdit[], origin: Origin, label: string): boolean | string => {\n        if (edits.length === 0) return false;\n        const recorded = editing.record(edits, origin, label);\n        if (recorded === true) refuse(undefined);\n        return recorded;\n    }, [editing, refuse]);\n    const remove = useCallback((selection: DeleteSelection, label: string): boolean => {\n        const result = deleteEdits(editKinds(value), drawn, selection);\n        if (\"refusal\" in result) {\n            refuse(refusalWords(result.refusal, words));\n            return false;\n        }\n        return commit(result.edits, \"remove\", label) === true;\n    }, [value, drawn, words, refuse, commit]);\n    return { commit, remove };\n}\n\n/** A kind of a sort, by its slot. */\nfunction kindOf<K extends { readonly key: string }>(kinds: readonly K[], slot: string): K | undefined {\n    return kinds.find((kind) => stringEqual(kind.key, slot));\n}\n\n/**\n * An item's or a zone's side as Details draws its form: its kind's, but the fields its box is, which its kind's form\n * holds so a hint holds them to their bounds (#1585) — Details draws an item's centre as its position, and its box nowhere.\n */\nfunction formSide<K extends SchematicValue[\"items\"][number] | SchematicValue[\"zones\"][number]>(kind: K): K {\n    const box = [kind.box.x, kind.box.y, getSomeorUndefined(kind.box.width), getSomeorUndefined(kind.box.height)];\n    return { ...kind, fields: kind.fields.filter((spec) => !box.some((field) => field !== undefined && stringEqual(field, spec.path[0]!))) };\n}\n\n/** A row whose read is in flight. */\nconst READING: SchematicRowRead = { state: \"reading\" };\n\n/**\n * The reader's rows of an entity: its row and its details row — while the\n * reader still holds another entity's, the selection having just moved, each\n * in flight, so no row is ever read as another kind's.\n *\n * @param rows - What the reader read\n * @param ref - The entity Details shows\n * @returns Its row and its details row\n */\nfunction rowsOf(rows: SchematicInspectedRows, ref: SchematicRef): { readonly row: SchematicRowRead; readonly details: SchematicRowRead | undefined } {\n    const its = rows.ref !== undefined && stringEqual(rows.ref.kind, ref.kind) && stringEqual(rows.ref.key, ref.key);\n    return its ? { row: rows.row, details: rows.details } : { row: READING, details: READING };\n}\n\n// ============================================================================\n// Details\n// ============================================================================\n\n/**\n * The Details tab: what is selected — an item, a zone, a link, a net, a net's leg, several, an item with no position — or\n * the drawing; the keyboard kept as a control goes with the view it was in, on the heading of the view drawn in its place.\n */\nconst SchematicInspectorDetails = memo(function SchematicInspectorDetails(props: SchematicInspectorProps) {\n    const styles = useSlotRecipe({ key: \"schematicInspector\" })() as Styles;\n    const home = useFocusHome();\n    return (\n        <Box ref={home.ref} css={styles.home} onFocus={home.onFocus} onBlur={home.onBlur} data-inspector-home=\"\">\n            {detailsView({ ...props, styles })}\n        </Box>\n    );\n});\n\n/** What Details shows, a view a selection: what was typed for one never lands on the next. */\nfunction detailsView(view: ViewProps): ReactNode {\n    const { inspected, value, drawn } = view;\n    switch (inspected.view) {\n        case \"drawing\": return <DrawingView key=\"drawing\" {...view} />;\n        case \"several\": return <SeveralView key=\"several\" {...view} entities={inspected.entities} />;\n        case \"unplaced\": {\n            const kind = kindOf(value.items, inspected.ref.kind);\n            return kind === undefined ? null : <UnplacedView key={`unplaced:${inspected.id}`} {...view} item={inspected} kind={kind} />;\n        }\n        case \"leg\": {\n            const net = drawn.nets.find((n) => stringEqual(n.key, inspected.id));\n            const kind = kindOf(value.nets, inspected.ref.kind);\n            if (net === undefined || kind === undefined) return null;\n            return <LegView key={`leg:${inspected.id}:${inspected.leg.end}:${inspected.leg.item}`} {...view} net={net} kind={kind} leg={inspected.leg} />;\n        }\n        case \"entity\": {\n            const at = `${inspected.sort}:${inspected.id}`;\n            switch (inspected.sort) {\n                case \"item\": {\n                    const item = drawn.items.find((i) => stringEqual(i.key, inspected.id));\n                    const kind = kindOf(value.items, inspected.ref.kind);\n                    return item === undefined || kind === undefined ? null : <ItemView key={at} {...view} item={item} kind={kind} />;\n                }\n                case \"zone\": {\n                    const zone = drawn.zones.find((z) => stringEqual(z.key, inspected.id));\n                    const kind = kindOf(value.zones, inspected.ref.kind);\n                    return zone === undefined || kind === undefined ? null : <ZoneView key={at} {...view} zone={zone} kind={kind} />;\n                }\n                case \"link\": {\n                    const link = drawn.links.find((l) => stringEqual(l.key, inspected.id));\n                    const kind = kindOf(value.links, inspected.ref.kind);\n                    return link === undefined || kind === undefined ? null : <LinkView key={at} {...view} link={link} kind={kind} />;\n                }\n                case \"net\": {\n                    const net = drawn.nets.find((n) => stringEqual(n.key, inspected.id));\n                    const kind = kindOf(value.nets, inspected.ref.kind);\n                    return net === undefined || kind === undefined ? null : <NetView key={at} {...view} net={net} kind={kind} />;\n                }\n            }\n        }\n    }\n}\n\n/**\n * A record's side of an entity as Details edits it: its form or its own\n * Details, over the row as its drafts and its record hold it; each field one\n * step through the record's `set`, the own Details' row one step whole.\n */\nfunction useSide(props: ViewProps, ref: SchematicRef, name: string, side: RecordSide | undefined, details: boolean) {\n    const { value, editing, rows, words } = props;\n    const m = words.m;\n    const record = details ? detailsKey(ref.kind) : ref.kind;\n    const writes = side !== undefined && side.editable && !value.readOnly;\n    const available = writes && editing.available(record);\n    const its = rowsOf(rows, ref);\n    const state = useRowState(editing, record, side, ref.key, details ? its.details : its.row);\n    const { commit } = useCommit(props);\n    // A field's edit refused shows what the row holds again: one refused for the key the row's fields build — another\n    // row's (#1549) — saying why under the field; one its record's `set` refuses, the form drawn again.\n    const [refused, bump] = useRefused();\n    const onField = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        if (side === undefined) return undefined;\n        const write = fieldWrite(side.fields, side.rowType, path, next);\n        if (write === undefined) return undefined;\n        const recorded = commit([{ op: \"set\", ref, sets: [write], ...(details ? { details: true as const } : {}) }], \"typed\", m.inspectorStep({ edit: \"edit\", name }));\n        if (recorded === false) bump();\n        return recorded === true || recorded === false ? undefined : recorded;\n    }, [side, ref, details, commit, m, name, bump]);\n    const update = useCallback((edited: Uint8Array): null => {\n        if (writes) commit([{ op: \"row\", ref, row: edited, ...(details ? { details: true as const } : {}) }], \"typed\", m.inspectorStep({ edit: \"edit\", name }));\n        return null;\n    }, [writes, ref, details, commit, m, name]);\n    // Read only, the form shows every field: an own Details is for a record that takes its edits.\n    const own = useOwnDetails(writes && side !== undefined ? getSomeorUndefined(side.inspector) : undefined, state.bytes, update, name);\n    // What its record's session refuses of the row, holding Save. A bound its row breaks (#1585) is said in the tone its\n    // Save stands in: as stored it warns; its change refused, it is an error. And each field a refusal names says the\n    // refusal's words under it (ruled 13 Nov 2026): Details lists no issue, so the field says why it is named.\n    const refusals = entryRefusals(editing.schedule.sessions, record, ref.key);\n    const breaches: \"warn\" | \"error\" = refusals.length > 0 ? \"error\" : \"warn\";\n    const issues = refusedFields(refusals);\n    // The field an issue gone to names, from the toolbar or from Issues: it takes the keyboard, the inspector opened at\n    // Details. A freshly selected entity's forms are placeholders until its rows are read — a drafted row's drawn at once —\n    // so the ask waits for both its row and its details row: neither form lets go of an ask that is the other's.\n    const placeholder = (read: SchematicRowRead | undefined, of: string) => read?.state === \"reading\" && !editing.schedule.draftsOf(of).has(ref.key);\n    const drawn = !placeholder(its.row, ref.kind) && !placeholder(its.details, detailsKey(ref.kind));\n    const focus = useFieldAsk(record, ref.key, drawn);\n    return { side, writes, available, state, onField, own, refused, breaches, issues, focus };\n}\n\n/**\n * A record's side drawn: its form, or its own Details, under its head — each field its session's refusal names saying why\n * under it; while its row is read, its fields' placeholders; no row, said so.\n */\nfunction SideBody({ styles, head, section, side, own, state, onField, writes, storageKey, empty, refused, breaches, issues, focus }: {\n    styles: Styles; head: string; section: string; side: RecordSide; own: unknown; state: RowState;\n    onField: (path: readonly string[], value: unknown) => string | void; writes: boolean; storageKey: string; empty: string; refused: number;\n    breaches: \"warn\" | \"error\"; issues: RefusedFields; focus: string | undefined;\n}) {\n    // Read, its form's fields stand at their places, each a placeholder until the row lands (#1398): its head is real.\n    if (state.reading) {\n        return <Form styles={styles} head={head} section={section} specs={side.fields} value={undefined} baseline={undefined} onChange={NO_EDIT} readOnly={!writes} pending />;\n    }\n    if (state.row === undefined) return <Fact styles={styles} fact={`${section}-none`}>{empty}</Fact>;\n    if (own !== undefined) return <Custom styles={styles} head={head} section={section} ui={own} storageKey={storageKey} />;\n    return <Form styles={styles} head={head} section={section} specs={side.fields} value={state.row} baseline={state.baseline}\n        onChange={writes ? onField : NO_EDIT} readOnly={!writes} refused={refused} breaches={breaches} issues={issues} focus={focus} />;\n}\n\n// ── An item ─────────────────────────────────────────────────────────────────\n\n/** An item: its head, its form or own Details, its details', its position and Unplace, Delete, and what it is joined to. */\nfunction ItemView(props: ViewProps & { readonly item: DrawnItem; readonly kind: SchematicValue[\"items\"][number] }) {\n    const { item, kind, styles, words, value, names: entityNames, listed, rows, zoneAt, reveal, storageKey, editing, refuse: say, select } = props;\n    const m = words.m;\n    const unit = getSomeorUndefined(value.scaleUnit);\n    // The item's own row, and its details row: each its record's side — its own form but its box (#1585).\n    const form = useMemo(() => formSide(kind), [kind]);\n    const self = useSide(props, item.ref, item.label, form, false);\n    const details = getSomeorUndefined(kind.details);\n    const theirs = useSide(props, item.ref, item.label, details, true);\n    const { commit, remove } = useCommit(props);\n    // A new item whose key the viewer types (#1549): its key field, while it is new — washed, and taking the keyboard,\n    // while it waits under a placeholder.\n    const keys = kindKeys(kind.keyType);\n    const waiting = !keys.isKey(item.ref.key);\n    const keyed = self.state.chip === \"new\" && self.writes && editing.keysTyped(kind.key);\n    const keySpecs = useMemo(() => (keyed\n        ? keyFieldSpecs(keys, m.inspectorField({ field: \"key\" }), keys.specs.length > 1 ? m.inspectorKeyPartsHelp() : m.inspectorKeyHelp(), true) : []),\n    [keyed, keys, m]);\n    const keyIssues = useMemo(() => (waiting ? new Set(keySpecs.map((spec) => spec.path.join(\".\"))) : undefined), [waiting, keySpecs]);\n    const [keyRefused, bumpKey] = useRefused();\n    // A key typed whole: refused where a row of its kind stands under it — one whose row a draft deletes is free (#1581) —\n    // saying why, under the field of a key of one part as in the footer.\n    const takeKey = useCallback((to: string): string | undefined => {\n        const from = item.ref.key;\n        if (stringEqual(to, from)) return undefined;\n        if (editing.stands(kind.key, to)) {\n            const said = m.inspectorKeyRefused({ name: kind.name.toLocaleLowerCase(words.locale), key: to });\n            say(said);\n            return said;\n        }\n        // The item under its key, its details row with it where they are edited, and the selection with it.\n        const moved: SchematicEdit[] = [\n            { op: \"move\", ref: item.ref, to },\n            ...(editing.edited(detailsKey(kind.key)) ? [{ op: \"move\", ref: item.ref, to, details: true } as const] : []),\n        ];\n        const recorded = commit(moved, \"typed\", m.inspectorStep({ edit: \"key\", name: item.label }));\n        if (recorded === true) select(entityId({ kind: kind.key, key: to }));\n        else if (recorded === false) bumpKey();\n        return recorded === true || recorded === false ? undefined : recorded;\n    }, [item.ref, item.label, kind, editing, commit, say, select, m, words.locale, bumpKey]);\n    const keyDraft = useKeyDraft(keys, item.ref.key, takeKey);\n    // Its centre as its record holds it — what the position is tinted against; nothing for a new row.\n    const stored = rowsOf(rows, item.ref).row;\n    const heldAt = useMemo(() => {\n        if (stored.state !== \"held\") return NEW_ROW;\n        const at = getSomeorUndefined(kind.read(stored.row, item.ref.key).position);\n        return at === undefined ? NEW_ROW : { x: at.x, y: at.y };\n    }, [stored, kind, item.ref.key]);\n    // Its centre held to the bounds a hint gives its fields in its kind's form (#1585): a coordinate they don't hold is\n    // said under its field, as the form says one.\n    const positionSpecs = useMemo(() => {\n        const bounds = (field: string) => {\n            const spec = kind.fields.find((s) => s.path.length === 1 && stringEqual(s.path[0]!, field));\n            if (spec?.editor.type !== \"number\") return {};\n            const min = getSomeorUndefined(spec.editor.value.min), max = getSomeorUndefined(spec.editor.value.max);\n            return { ...(min === undefined ? {} : { min }), ...(max === undefined ? {} : { max }) };\n        };\n        return Fields.specs(PositionType, {\n            x: Fields.number<number>({ label: m.inspectorField({ field: \"x\" }), ...(unit === undefined ? {} : { unit }), ...bounds(kind.box.x) }),\n            y: Fields.number<number>({ label: m.inspectorField({ field: \"y\" }), ...(unit === undefined ? {} : { unit }), ...bounds(kind.box.y) }),\n        });\n    }, [m, unit, kind]);\n    // A position refused shows where the item stands again: one refused for the key its centre builds — another item's\n    // (#1581) — saying why under the field; one its kind's `write` refuses, the form drawn again.\n    const [positionRefused, bumpPosition] = useRefused();\n    const onPosition = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        const n = next as number;\n        const at = stringEqual(path[0]!, \"x\") ? { x: n, y: item.y } : { x: item.x, y: n };\n        const recorded = commit([{ op: \"place\", ref: item.ref, at: some(at) }], \"move\", m.inspectorStep({ edit: \"edit\", name: item.label }));\n        if (recorded === false) bumpPosition();\n        return recorded === true || recorded === false ? undefined : recorded;\n    }, [item, commit, m, bumpPosition]);\n    // The field an issue gone to names, where it is one its centre is: that coordinate of its position (#1585) — and what\n    // a refusal says of either, under that coordinate.\n    const positionFocus = self.focus === undefined ? undefined\n        : stringEqual(self.focus, kind.box.x) ? \"x\" : stringEqual(self.focus, kind.box.y) ? \"y\" : undefined;\n    const positionIssues: RefusedFields = new Map([[\"x\", kind.box.x] as const, [\"y\", kind.box.y] as const]\n        .flatMap(([coordinate, field]) => { const said = self.issues.get(field); return said === undefined ? [] : [[coordinate, said] as const]; }));\n    const joins = useMemo(() => joinsOf(item.key, listed), [item.key, listed]);\n    const names = useMemo(() => new Map([...value.links, ...value.nets].map((k) => [k.key, k.name] as const)), [value.links, value.nets]);\n    const actions = !self.writes ? undefined : (\n        <>\n            {kind.backlog && <Action action=\"unplace\" words={words} onClick={() => {\n                commit([{ op: \"place\", ref: item.ref, at: none }], \"move\", m.inspectorStep({ edit: \"unplace\", name: item.label }));\n            }} />}\n            <Action action=\"delete\" words={words} onClick={() => {\n                remove({ items: new Set([item.key]), link: null }, m.inspectorStep({ edit: \"delete\", name: item.label }));\n            }} />\n        </>\n    );\n    const icon = getSomeorUndefined(item.icon) ?? (kind.icon === \"\" ? \"cube\" : kind.icon);\n    // Its status: as the canvas draws it, else as its details row — drafted, else read by its key — gives it.\n    const detailsBytes = theirs.state.bytes;\n    // A row under a placeholder is read as keyed by its key type's default (#1549).\n    const status = useMemo(() => getSomeorUndefined(item.status)\n        ?? (details === undefined || detailsBytes === undefined ? undefined : getSomeorUndefined(details.read(detailsBytes, keys.readKey(item.ref.key)).status)),\n    [item.status, item.ref.key, details, detailsBytes, keys]);\n    return (\n        <Box css={styles.root} data-schematic-inspector=\"item\">\n            <ScheduleInspectorHead styles={styles} kind={{ name: kind.name, icon }} title={item.label}\n                when={m.inspectorAt({ zone: zoneAt(item.x, item.y), x: coordinate(item.x, words), y: coordinate(item.y, words), unit })}\n                status={status} pending={self.state.chip} writes={self.writes} home />\n            <Edits styles={styles} available={self.available} actions={actions}>\n                {/* A placeholder's key holds no value: its field is Not set, with Set, until it is typed. */}\n                <Form styles={styles} head={undefined} section=\"key\" specs={keySpecs} value={{ key: keyDraft.value }} baseline={NEW_ROW}\n                    onChange={keyDraft.onChange} readOnly={false} refused={keyRefused} issues={keyIssues} focus={waiting ? keySpecs[0]?.path.join(\".\") : undefined} />\n                {keyed && keyDraft.parts && (\n                    <Box css={styles.actions} data-inspector-actions=\"key\"><KeySetButton draft={keyDraft} label={m.inspectorKeySet()} /></Box>\n                )}\n                <SideBody styles={styles} head={m.inspectorSection({ section: \"fields\", name: kind.name })} section=\"row\" side={form} own={self.own}\n                    state={self.state} onField={self.onField} writes={self.writes} storageKey={`${storageKey}.inspector.${kind.key}`} empty={m.inspectorNoRow()}\n                    refused={self.refused} breaches={self.breaches} issues={self.issues} focus={self.focus} />\n                <Form styles={styles} head={m.inspectorSection({ section: \"position\", name: kind.name })} section=\"position\" specs={positionSpecs}\n                    value={{ x: item.x, y: item.y }} baseline={heldAt} onChange={self.writes ? onPosition : NO_EDIT} readOnly={!self.writes} refused={positionRefused}\n                    breaches={self.breaches} issues={positionIssues} focus={positionFocus} />\n            </Edits>\n            {/* Below 480px of main, what a Connect drag from it records (#1394, D15). */}\n            {props.narrow && <ConnectTo {...props} item={item} />}\n            {details !== undefined && (\n                <Edits styles={styles} available={theirs.available} actions={undefined}>\n                    <SideBody styles={styles} head={m.inspectorSection({ section: \"details\", name: kind.name })} section=\"details\" side={details}\n                        own={theirs.own} state={theirs.state} onField={theirs.onField} writes={theirs.writes}\n                        storageKey={`${storageKey}.inspector.${kind.key}.details`} empty={m.inspectorNoDetails({ name: kind.name })} refused={theirs.refused}\n                        breaches={theirs.breaches} issues={theirs.issues} focus={theirs.focus} />\n                </Edits>\n            )}\n            {(joins.links.length > 0 || joins.nets.length > 0) && (\n                <Box css={styles.section} data-inspector-joins=\"\">\n                    <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"joins\", name: kind.name })}</Box>\n                    <Box as=\"ul\" css={styles.links}>\n                        {joins.links.map((link) => (\n                            <Box as=\"li\" key={link.key}>\n                                <chakra.button type=\"button\" css={styles.link} data-inspector-join={link.key} onClick={() => reveal(link.key)}>\n                                    <Box as=\"span\" css={styles.linkText}>{nameOfEntity(entityNames, link.key)}</Box>\n                                    <Box as=\"span\" css={styles.linkMeta}>{m.inspectorJoin({ kind: names.get(link.ref.kind) ?? link.ref.kind, end: undefined })}</Box>\n                                </chakra.button>\n                            </Box>\n                        ))}\n                        {joins.nets.map(({ net, end }) => (\n                            <Box as=\"li\" key={net.key}>\n                                <chakra.button type=\"button\" css={styles.link} data-inspector-join={net.key} onClick={() => reveal(net.key)}>\n                                    <Box as=\"span\" css={styles.linkText}>{nameOfEntity(entityNames, net.key)}</Box>\n                                    <Box as=\"span\" css={styles.linkMeta}>{m.inspectorJoin({ kind: names.get(net.ref.kind) ?? net.ref.kind, end })}</Box>\n                                </chakra.button>\n                            </Box>\n                        ))}\n                    </Box>\n                </Box>\n            )}\n        </Box>\n    );\n}\n\n/**\n * An item's Connect to…, below 480px of main (#1394, D15): a Chooser over the items a link of its kind may run to from\n * the item — what the rail's narrowing shows — and, while several link kinds may run from it, the kind, the toolbar's\n * Connect menu's choice. A choice records the link, one step, as a Connect drag from the item onto the one chosen does —\n * keyed as its kind makes one (#1549), its other fields the template of its kind the library has selected (§4.3) — and\n * the Chooser is clear again for the next; refused — its kind's end, an item waiting for its key to be typed, the key\n * its kind makes, or the host's veto — the footer says why, and nothing is recorded.\n */\nfunction ConnectTo(props: ViewProps & { readonly item: DrawnItem }) {\n    const { item, styles, words, value, listed, editing, veto, linkKind, onLinkKind, connectValues, refuse: say, keyRefused } = props;\n    const m = words.m;\n    const { commit } = useCommit(props);\n    const [chosen, clear] = useRefused();\n    const kinds = useMemo(() => editKinds(value), [value]);\n    // The link kinds that write and may run from the item: its kind among their start's slots.\n    const choices = useMemo(() => value.links.filter((kind) => kinds.links.get(kind.key)?.editable === true\n        && kind.ends.from.some((slot) => stringEqual(slot, item.ref.kind))), [value.links, kinds, item.ref.kind]);\n    const kind = choices.find((choice) => linkKind !== undefined && stringEqual(choice.key, linkKind)) ?? choices[0];\n    const names = useMemo(() => new Map(value.items.map((k) => [k.key, k.name] as const)), [value.items]);\n    const options = useMemo(() => ({\n        kind: choices.map((choice) => ({ key: choice.key, label: choice.name })),\n        // The items its end may hold, but the item itself: a link joins two.\n        to: kind === undefined ? [] : itemChoices(listed, kind.ends.to, names, []).filter((choice) => !stringEqual(choice.key, item.key)),\n    }), [choices, kind, listed, names, item.key]);\n    const specs = useMemo(() => Fields.specs(ConnectFormType, {\n        kind: Fields.reference({ of: \"kind\", label: m.inspectorField({ field: \"kind\" }) }),\n        to: Fields.reference({ of: \"to\", label: m.inspectorField({ field: \"to\" }) }),\n    }, choices.length > 1 ? [] : [\"kind\"]), [m, choices.length]);\n    const onChange = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        if (kind === undefined) return undefined;\n        if (stringEqual(path[0]!, \"kind\")) {\n            onLinkKind(next as string);\n            return undefined;\n        }\n        // Whatever it comes to, the Chooser is clear again, for the next — refused, saying why under it.\n        const target = listed.items.find((i) => stringEqual(i.key, next as string));\n        const link = kinds.links.get(kind.key);\n        if (target === undefined || link === undefined) {\n            clear();\n            return undefined;\n        }\n        const from = { ref: item.ref, label: item.label }, to = { ref: target.ref, label: target.label };\n        const refusal = placeholderRefusal(kinds, from) ?? placeholderRefusal(kinds, to) ?? linkRefusal(link, from, to);\n        const said = refusal !== undefined ? refusalWords(refusal, words) : veto(kind.key, item.key, target.key);\n        if (said !== undefined) {\n            say(said);\n            return said;\n        }\n        const step = connectStep(kinds, { session: undefined, shift: false, linkKind: kind.key, from, to, drawn: NO_SESSION, labelOf: (ref) => ref.key },\n            (made) => editing.newKey(made), connectValues);\n        if (step !== undefined && \"refused\" in step) return keyRefused(step.refused);\n        const recorded = step === undefined ? false : commit(step.edits, \"insert\", m.step({ step: \"connect\", name: kind.name.toLocaleLowerCase(words.locale), n: 1 }));\n        if (recorded !== true && recorded !== false) return recorded;\n        clear();\n        return undefined;\n    }, [kind, kinds, listed.items, item, words, veto, say, keyRefused, editing, connectValues, commit, m, onLinkKind, clear]);\n    if (kind === undefined) return null;\n    return (\n        <Edits styles={styles} available={editing.available(kind.key)} actions={undefined}>\n            <Form styles={styles} head={m.inspectorSection({ section: \"connect\", name: kind.name })} section=\"connect\" specs={specs}\n                value={{ kind: kind.key, to: undefined }} baseline={undefined} options={options} onChange={onChange} readOnly={false} refused={chosen} />\n        </Edits>\n    );\n}\n\n/**\n * An item with no position, below 480px of main (#1394, D15) — the Backlog's card picked: its kind's head, and Place,\n * which puts it at the canvas's centre as the card's ⏎ does and selects it, its fields then Details' to edit. Its kind\n * read only, it has no Place; while its kind's session takes no edit, its Place is off.\n */\nfunction UnplacedView(props: ViewProps & { readonly item: SchematicUnplaced; readonly kind: SchematicValue[\"items\"][number] }) {\n    const { item, kind, styles, words, value, editing, place } = props;\n    const m = words.m;\n    const writes = kind.editable && !value.readOnly;\n    const actions = !writes ? undefined : <Action action=\"place\" words={words} onClick={() => place(item.id)} />;\n    return (\n        <Box css={styles.root} data-schematic-inspector=\"unplaced\">\n            <ScheduleInspectorHead styles={styles} kind={{ name: kind.name, icon: item.icon ?? (kind.icon === \"\" ? \"cube\" : kind.icon) }} title={item.label}\n                when={m.inspectorUnplaced()} home />\n            <Edits styles={styles} available={writes && editing.available(kind.key)} actions={actions}>{null}</Edits>\n        </Box>\n    );\n}\n\n// ── A zone ──────────────────────────────────────────────────────────────────\n\n/** A zone: its head and its form, or its own Details. */\nfunction ZoneView(props: ViewProps & { readonly zone: DrawnZone; readonly kind: SchematicValue[\"zones\"][number] }) {\n    const { zone, kind, styles, words, value, storageKey } = props;\n    const m = words.m;\n    const unit = getSomeorUndefined(value.scaleUnit);\n    // Its own form but its box (#1585).\n    const form = useMemo(() => formSide(kind), [kind]);\n    const own = useSide(props, zone.ref, zone.label, form, false);\n    return (\n        <Box css={styles.root} data-schematic-inspector=\"zone\">\n            <ScheduleInspectorHead styles={styles} kind={{ name: kind.name, icon: kind.icon === \"\" ? \"vector-square\" : kind.icon }} title={zone.label}\n                when={m.inspectorSize({ width: coordinate(zone.width, words), height: coordinate(zone.height, words), unit })} pending={own.state.chip} writes={own.writes} home />\n            <Edits styles={styles} available={own.available} actions={undefined}>\n                <SideBody styles={styles} head={m.inspectorSection({ section: \"fields\", name: kind.name })} section=\"row\" side={form} own={own.own}\n                    state={own.state} onField={own.onField} writes={own.writes} storageKey={`${storageKey}.inspector.${kind.key}`} empty={m.inspectorNoRow()}\n                    refused={own.refused} breaches={own.breaches} issues={own.issues} focus={own.focus} />\n            </Edits>\n        </Box>\n    );\n}\n\n// ── A link ──────────────────────────────────────────────────────────────────\n\n/** The items of some slots, as a Chooser offers them: each by its id, its label — with its kind's name, among several kinds. */\nfunction itemChoices(drawn: SchematicDrawn, slots: readonly string[], names: ReadonlyMap<string, string>, also: readonly string[]): FieldOption[] {\n    const out: FieldOption[] = drawn.items.filter((item) => slots.some((slot) => stringEqual(slot, item.ref.kind))).map((item) => ({\n        key: item.key, label: slots.length > 1 ? `${item.label} · ${names.get(item.ref.kind) ?? item.ref.kind}` : item.label,\n    }));\n    // What the row names now, drawn or not: a Chooser always holds its own value.\n    for (const id of also) if (!out.some((option) => stringEqual(option.key, id))) out.push({ key: id, label: refOfId(id)?.key ?? id });\n    return out;\n}\n\n/**\n * A link: its head — titled by its ends, as the rail names it, its caption under them — its ends as Choosers, its form\n * or own Details, and Delete.\n */\nfunction LinkView(props: ViewProps & { readonly link: DrawnLink; readonly kind: SchematicValue[\"links\"][number] }) {\n    const { link, kind, styles, words, value, names: entityNames, listed, rows, storageKey, veto, refuse: say } = props;\n    const m = words.m;\n    const name = nameOfEntity(entityNames, link.key);\n    const own = useSide(props, link.ref, name, kind, false);\n    const { commit, remove } = useCommit(props);\n    const [refused, refuse] = useRefused();\n    const names = useMemo(() => new Map(value.items.map((k) => [k.key, k.name] as const)), [value.items]);\n    const options = useMemo(() => ({\n        from: itemChoices(listed, kind.ends.from, names, [link.from]),\n        to: itemChoices(listed, kind.ends.to, names, [link.to]),\n    }), [listed, kind.ends, names, link.from, link.to]);\n    const specs = useMemo(() => Fields.specs(EndsFormType, {\n        from: Fields.reference({ of: \"from\", label: m.inspectorField({ field: \"from\" }) }),\n        to: Fields.reference({ of: \"to\", label: m.inspectorField({ field: \"to\" }) }),\n    }), [m]);\n    // Its ends as its record holds them, each item by its id: what they are tinted against; nothing for a new row.\n    const stored = rowsOf(rows, link.ref).row;\n    const baseline = useMemo(() => {\n        if (stored.state !== \"held\") return NEW_ROW;\n        const roles = kind.read(stored.row, link.ref.key);\n        return { from: entityId(roles.from), to: entityId(roles.to) };\n    }, [stored, kind, link.ref.key]);\n    const kinds = useMemo(() => editKinds(value), [value]);\n    const onEnd = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        const from = refOfId(link.from), to = refOfId(link.to), target = refOfId(next as string);\n        const end = stringEqual(path[0]!, \"from\") ? \"from\" as const : \"to\" as const;\n        if (from === undefined || to === undefined || target === undefined) return undefined;\n        const edits = retargetEdits({ ref: link.ref, ends: { from, to } }, end, target);\n        // An item waiting for its key to be typed is no end (#1549); the new pair is held to the host's veto in the link's\n        // own direction, as a Retarget's drag is (#1394), and a key its ends build another link holds refuses it (#1549):\n        // refused, the Chooser shows the end it has, saying why under it as the footer does.\n        const waiting = edits.length === 0 ? undefined : placeholderRefusal(kinds, { ref: target, label: target.key });\n        const said = waiting !== undefined ? refusalWords(waiting, words)\n            : edits.length === 0 ? undefined : end === \"from\" ? veto(link.ref.kind, next as string, link.to) : veto(link.ref.kind, link.from, next as string);\n        if (said !== undefined) {\n            say(said);\n            return said;\n        }\n        const recorded = commit(edits, \"move\", m.inspectorStep({ edit: \"edit\", name }));\n        if (recorded === false) refuse();\n        return recorded === true || recorded === false ? undefined : recorded;\n    }, [link, kinds, words, commit, m, name, refuse, veto, say]);\n    const actions = !own.writes ? undefined : (\n        <Action action=\"delete\" words={words} onClick={() => {\n            remove({ items: new Set(), link: { key: link.key, leg: null } }, m.inspectorStep({ edit: \"delete\", name }));\n        }} />\n    );\n    return (\n        <Box css={styles.root} data-schematic-inspector=\"link\">\n            <ScheduleInspectorHead styles={styles} kind={{ name: kind.name, icon: kind.icon === \"\" ? \"link\" : kind.icon }}\n                title={name} when={captionText(getSomeorUndefined(link.label), getSomeorUndefined(link.metric))} pending={own.state.chip} writes={own.writes} home />\n            <Edits styles={styles} available={own.available} actions={actions}>\n                <Form styles={styles} head={m.inspectorSection({ section: \"ends\", name: kind.name })} section=\"ends\" specs={specs}\n                    value={{ from: link.from, to: link.to }} baseline={baseline} options={options}\n                    onChange={own.writes ? onEnd : NO_EDIT} readOnly={!own.writes} refused={refused} />\n                <SideBody styles={styles} head={m.inspectorSection({ section: \"fields\", name: kind.name })} section=\"row\" side={kind} own={own.own}\n                    state={own.state} onField={own.onField} writes={own.writes} storageKey={`${storageKey}.inspector.${kind.key}`} empty={m.inspectorNoRow()}\n                    refused={own.refused} breaches={own.breaches} issues={own.issues} focus={own.focus} />\n            </Edits>\n        </Box>\n    );\n}\n\n// ── A net, and its leg ──────────────────────────────────────────────────────\n\n/** A net: its head — titled by its label, else its ends, as the rail names it — its sides as tags, its form or own Details, and Delete. */\nfunction NetView(props: ViewProps & { readonly net: DrawnNet; readonly kind: SchematicValue[\"nets\"][number] }) {\n    const { net, kind, styles, words, value, names: entityNames, listed, rows, storageKey, veto, refuse: say } = props;\n    const m = words.m;\n    const name = nameOfEntity(entityNames, net.key);\n    const own = useSide(props, net.ref, name, kind, false);\n    const { commit, remove } = useCommit(props);\n    const [refused, refuse] = useRefused();\n    const kinds = useMemo(() => editKinds(value), [value]);\n    const keysOf = (ids: readonly string[]) => ids.map((id) => refOfId(id)?.key ?? id);\n    const slotKeys = useCallback((slot: string) => listed.items.filter((item) => stringEqual(item.ref.kind, slot)).map((item) => item.ref.key), [listed.items]);\n    const specs = useMemo(() => Fields.specs(SidesFormType, {\n        sources: Fields.tags({ label: m.inspectorField({ field: \"sources\" }), options: slotKeys(kind.sides.sources) }),\n        destinations: Fields.tags({ label: m.inspectorField({ field: \"destinations\" }), options: slotKeys(kind.sides.destinations) }),\n    }), [m, slotKeys, kind.sides]);\n    // Its sides as its record holds them: what they are tinted against; nothing for a new row.\n    const stored = rowsOf(rows, net.ref).row;\n    const baseline = useMemo(() => {\n        if (stored.state !== \"held\") return NEW_ROW;\n        const roles = kind.read(stored.row, net.ref.key);\n        return { sources: roles.sources.map((r) => r.key), destinations: roles.destinations.map((r) => r.key) };\n    }, [stored, kind, net.ref.key]);\n    const onSide = useCallback((path: readonly string[], next: unknown): string | undefined => {\n        const side = stringEqual(path[0]!, \"sources\") ? \"sources\" as const : \"destinations\" as const;\n        const keys = next as readonly string[];\n        if (keys.length === 0) {\n            // A net keeps a member on each side: its Delete takes it.\n            const said = m.inspectorSideEmpty({ side });\n            say(said);\n            return said;\n        }\n        const refs = (ids: readonly string[]) => ids.flatMap((id) => { const ref = refOfId(id); return ref === undefined ? [] : [ref]; });\n        const slot = side === \"sources\" ? kind.sides.sources : kind.sides.destinations;\n        const written = keys.map((key) => ({ kind: slot, key }));\n        const sides = side === \"sources\" ? { sources: written, destinations: refs(net.destinations) } : { sources: refs(net.sources), destinations: written };\n        // An item waiting for its key to be typed is no member (#1549); each pair the sides newly join is held to the host's\n        // veto, as an Extend's is (#1394), and a key its sides build another net holds refuses them (#1549): refused, the\n        // tags show the sides as they stand, saying why under them as the footer does.\n        const waiting = written.reduce<EditRefusal | undefined>((found, ref) => found ?? placeholderRefusal(kinds, { ref, label: ref.key }), undefined);\n        const said = waiting !== undefined ? refusalWords(waiting, words)\n            : vetoOfPairs(veto, net.ref.kind, joinedPairs({ sources: refs(net.sources), destinations: refs(net.destinations) }, sides));\n        if (said !== undefined) {\n            say(said);\n            return said;\n        }\n        const recorded = commit([{ op: \"sides\", ref: net.ref, sides }], \"typed\", m.inspectorStep({ edit: \"edit\", name }));\n        if (recorded === false) refuse();\n        return recorded === true || recorded === false ? undefined : recorded;\n    }, [net, kind.sides, kinds, words, commit, m, name, say, refuse, veto]);\n    const actions = !own.writes ? undefined : (\n        <Action action=\"delete\" words={words} onClick={() => {\n            remove({ items: new Set(), link: { key: net.key, leg: null } }, m.inspectorStep({ edit: \"delete\", name }));\n        }} />\n    );\n    const count = (n: number) => ({ n, count: words.number(n) });\n    return (\n        <Box css={styles.root} data-schematic-inspector=\"net\">\n            <ScheduleInspectorHead styles={styles} kind={{ name: kind.name, icon: kind.icon === \"\" ? \"diagram-project\" : kind.icon }} title={name}\n                when={m.inspectorSides({ sources: count(net.sources.length), destinations: count(net.destinations.length) })} pending={own.state.chip} writes={own.writes} home />\n            <Edits styles={styles} available={own.available} actions={actions}>\n                <Form styles={styles} head={m.inspectorSection({ section: \"sides\", name: kind.name })} section=\"sides\" specs={specs}\n                    value={{ sources: keysOf(net.sources), destinations: keysOf(net.destinations) }} baseline={baseline}\n                    onChange={own.writes ? onSide : NO_EDIT} readOnly={!own.writes} refused={refused} />\n                <SideBody styles={styles} head={m.inspectorSection({ section: \"fields\", name: kind.name })} section=\"row\" side={kind} own={own.own}\n                    state={own.state} onField={own.onField} writes={own.writes} storageKey={`${storageKey}.inspector.${kind.key}`} empty={m.inspectorNoRow()}\n                    refused={own.refused} breaches={own.breaches} issues={own.issues} focus={own.focus} />\n            </Edits>\n        </Box>\n    );\n}\n\n/** A net's leg: its net's head, the item on it — a control that selects it — and Remove. */\nfunction LegView(props: ViewProps & { readonly net: DrawnNet; readonly kind: SchematicValue[\"nets\"][number]; readonly leg: NetLeg }) {\n    const { net, kind, leg, styles, words, value, names: entityNames, reveal } = props;\n    const m = words.m;\n    const name = nameOfEntity(entityNames, net.key);\n    const member = nameOfEntity(entityNames, leg.item);\n    const { remove } = useCommit(props);\n    const writes = kind.editable && !value.readOnly;\n    const available = writes && props.editing.available(kind.key);\n    const actions = !writes ? undefined : (\n        <Action action=\"remove\" words={words} onClick={() => {\n            if (remove({ items: new Set(), link: { key: net.key, leg } }, m.inspectorStep({ edit: \"remove\", name: member, from: name }))) reveal(net.key);\n        }} />\n    );\n    return (\n        <Box css={styles.root} data-schematic-inspector=\"leg\">\n            <ScheduleInspectorHead styles={styles} kind={{ name: kind.name, icon: kind.icon === \"\" ? \"diagram-project\" : kind.icon }} title={name}\n                when={m.inspectorLeg({ end: leg.end })} home />\n            <Box css={styles.section} data-inspector-member=\"\">\n                <Box css={styles.sectionHead}>{m.inspectorSection({ section: \"member\", name: kind.name })}</Box>\n                <chakra.button type=\"button\" css={styles.link} data-inspector-join={leg.item} onClick={() => reveal(leg.item)}>\n                    <Box as=\"span\" css={styles.linkText}>{member}</Box>\n                    <Box as=\"span\" css={styles.linkMeta}>{m.inspectorLeg({ end: leg.end })}</Box>\n                </chakra.button>\n            </Box>\n            <Edits styles={styles} available={available} actions={actions}>{null}</Edits>\n        </Box>\n    );\n}\n\n// ── Several ─────────────────────────────────────────────────────────────────\n\n/** Several: how many, how many of each kind, and Delete. */\nfunction SeveralView(props: ViewProps & { readonly entities: readonly (SchematicDrawnEntity & { readonly id: string })[] }) {\n    const { entities, styles, words, value } = props;\n    const m = words.m;\n    const { remove } = useCommit(props);\n    const kinds = [...value.items, ...value.zones, ...value.links, ...value.nets];\n    const byKind = new Map<string, number>();\n    for (const entity of entities) byKind.set(entity.ref.kind, (byKind.get(entity.ref.kind) ?? 0) + 1);\n    const items = new Set(entities.filter((e) => e.sort === \"item\").map((e) => e.id));\n    const edge = entities.find((e) => e.sort === \"link\" || e.sort === \"net\");\n    const selection: DeleteSelection = { items, link: edge === undefined ? null : { key: edge.id, leg: null } };\n    // Delete writes what is selected of the kinds that write: none, no Delete.\n    const writes = !value.readOnly && entities.some((e) => kinds.find((k) => stringEqual(k.key, e.ref.kind))?.editable === true && e.sort !== \"zone\");\n    const n = entities.length;\n    return (\n        <Box css={styles.root} data-schematic-inspector=\"several\">\n            <Box css={styles.head} {...FOCUS_HOME_PROPS}>\n                <Box css={styles.summary} data-inspector-several=\"\">{m.inspectorSeveral({ n, count: words.number(n) })}</Box>\n            </Box>\n            <Box css={styles.section}>\n                {[...byKind].map(([slot, count]) => (\n                    <Box key={slot} css={styles.fact} data-inspector-count={slot}>\n                        {m.inspectorKindCount({ n: count, count: words.number(count), name: (kinds.find((k) => stringEqual(k.key, slot))?.name ?? slot).toLocaleLowerCase(words.locale) })}\n                    </Box>\n                ))}\n            </Box>\n            {writes && (\n                <Box css={styles.actions} data-inspector-actions=\"\">\n                    <Action action=\"delete\" words={words} onClick={() => {\n                        remove(selection, m.inspectorStep({ edit: \"delete\", name: m.inspectorSeveral({ n, count: words.number(n) }) }));\n                    }} />\n                </Box>\n            )}\n        </Box>\n    );\n}\n\n// ── Nothing selected: the drawing ───────────────────────────────────────────\n\n/** Nothing selected: the drawing's counts, and each record's last save with who made it. */\nfunction DrawingView({ styles, words, counts, records }: ViewProps) {\n    const m = words.m;\n    // Each record's newest commit, read where its commits are tracked: one whose read fails says nothing.\n    const read = useCallback(() => records.flatMap((record) => {\n        try {\n            const commits = record.history();\n            const newest = commits.type === \"some\" ? commits.value[0] : undefined;\n            return newest === undefined ? [] : [{ slot: record.slot, name: record.name, at: newest.at, by: authorOf(newest.actor) }];\n        } catch {\n            return [];\n        }\n    }), [records]);\n    const { result } = useTrackedEvaluation(read);\n    const saved = result.ok ? result.value : [];\n    const today = words.date(new Date());\n    // Each count, its label and its name as running text writes it: a number, a placeholder while it is read, or — no\n    // read can say it — a line naming it and why (#1393).\n    const sorts = [\n        ...counts.kinds.map((kind) => ({ key: kind.slot, count: kind.drawn, label: (n: number) => (n === 1 ? kind.name : kindPlural(kind.name)), noun: kindPlural(kind.name.toLocaleLowerCase(words.locale)) })),\n        ...([\"zones\", \"links\", \"nets\"] as const).flatMap((what) => {\n            const count = counts[what];\n            return count === undefined ? [] : [{\n                key: what, count, label: (n: number) => m.inspectorCount({ what, n }), noun: m.inspectorCount({ what, n: 2 }).toLocaleLowerCase(words.locale),\n            }];\n        }),\n    ];\n    const stats = sorts.flatMap((sort): { key: string; count: Exclude<SchematicDrawingCount, { kind: \"uncounted\" }>; label: string }[] =>\n        (sort.count.kind === \"uncounted\" ? [] : [{ key: sort.key, count: sort.count, label: sort.label(sort.count.kind === \"counted\" ? sort.count.n : 2) }]));\n    const notCounted = new Map<SchematicUncounted, string[]>();\n    for (const sort of sorts) if (sort.count.kind === \"uncounted\") notCounted.set(sort.count.why, [...(notCounted.get(sort.count.why) ?? []), sort.noun]);\n    return (\n        <Box css={styles.root} data-schematic-inspector=\"drawing\">\n            <Box css={styles.head} {...FOCUS_HOME_PROPS}>\n                <Box css={styles.eyebrow} data-inspector-what=\"\">{m.inspectorDrawing()}</Box>\n            </Box>\n            <Box css={styles.stats} data-inspector-counts=\"\">\n                {stats.map((stat) => (\n                    <Box key={stat.key} css={styles.stat} data-count={stat.key} data-pending={stat.count.kind === \"reading\" ? \"\" : undefined}>\n                        <Box as=\"span\" css={styles.statValue}>\n                            {stat.count.kind === \"counted\" ? words.number(stat.count.n) : <PlaceholderShape kind=\"number\" index={stat.key.length} />}\n                        </Box>\n                        <Box as=\"span\" css={styles.statLabel}>{stat.label}</Box>\n                    </Box>\n                ))}\n            </Box>\n            {notCounted.size > 0 && (\n                <Box css={styles.section}>\n                    {[...notCounted].map(([why, names]) => (\n                        <Box key={why} css={styles.fact} data-inspector-uncounted={why}>{m.inspectorNotCounted({ names, why })}</Box>\n                    ))}\n                </Box>\n            )}\n            {saved.length > 0 && (\n                <Box css={styles.section}>\n                    {saved.map((save) => (\n                        <Box key={save.slot} css={styles.fact} data-inspector-saved={save.slot}>\n                            {m.inspectorSaved({ name: save.name, when: stringEqual(words.date(save.at), today) ? words.time(save.at) : words.dateTime(save.at), by: save.by })}\n                        </Box>\n                    ))}\n                </Box>\n            )}\n        </Box>\n    );\n}\n\n// ============================================================================\n// Issues (SC16)\n// ============================================================================\n\n/**\n * The Issues tab: every issue of the drawing and of its unsaved changes, each a control that selects what it names and\n * flies to it, the field it names taking the keyboard in its Details — under a line, while a kind is read by area, saying\n * its rows out of view are checked only as the view reaches them (ruled 27 Oct 2026). An issue of an unsaved change the\n * drawing leaves out says on a line of its own which of the rail's choices hide the row it drafts, asked of e3 through\n * its kind's hidden pick, and Go to issue on it is the frame's hidden pick (`goToWaiting`): those choices cleared, then\n * flown to and selected once it draws.\n */\nconst SchematicInspectorIssues = memo(function SchematicInspectorIssues({ issues, unchecked, reveal, words, waiting, picks, goToWaiting, ask }: SchematicInspectorProps) {\n    const styles = useSlotRecipe({ key: \"schematicInspector\" })() as Styles;\n    const m = words.m;\n    // Each issue's unsaved change the drawing leaves out: its kind's hidden pick, and the row it drafts.\n    const hidingOf = (issue: SchematicIssue): RowHiding | undefined => {\n        const ref = issue.at === undefined ? undefined : waiting.get(issue.at);\n        const pick = ref === undefined ? undefined : picks.get(ref.kind);\n        return ref === undefined || pick === undefined ? undefined : { pick, id: ref.key };\n    };\n    const hidings = issues.flatMap((issue) => { const hiding = hidingOf(issue); return hiding === undefined ? [] : [hiding]; });\n    // The narrowing leaves each out, as the drawing knows: each says so at once while e3 is asked which choices do — each\n    // asked once at its record's revision and its narrowing, so a render that moves neither asks nothing. Asked after every\n    // render: the revision and the narrowing land in renders of their own.\n    useEffect(() => {\n        if (hidings.length > 0) askHiding(hidings, true);\n    });\n    // What hides an issue's row, as far as e3 has said: `undefined` for any other issue, and for one nothing hides.\n    const hiddenOfIssue = (issue: SchematicIssue): readonly RowHidden[] | undefined => {\n        const hiding = hidingOf(issue);\n        return hiding === undefined ? undefined : hiddenOf([hiding]);\n    };\n    // Go to issue: what it names selected and flown to — an unsaved change the drawing leaves out through the frame's hidden\n    // pick, the choices hiding it cleared first. Its row's Details is asked for the field it names, as the toolbar's issue\n    // gone to asks, so Details opens where it is fixed; an issue of a row naming no field drops an earlier ask, which\n    // would otherwise take the keyboard when that row's Details is next drawn.\n    const goTo = (issue: SchematicIssue) => {\n        const row = issue.row;\n        if (row !== undefined) ask(row.record, row.entry, row.field === undefined ? none : some(row.field));\n        if (issue.at !== undefined && waiting.has(issue.at)) goToWaiting(issue.at, hiddenOfIssue(issue));\n        else reveal(issue.at);\n    };\n    // What the list leaves unchecked, said before it: a reader hears it ahead of the issues, or of none.\n    const scope = unchecked.length === 0 ? null : (\n        <Box css={styles.section}>\n            <Box css={styles.fact} data-inspector-unchecked=\"\">{m.inspectorUnchecked({ names: unchecked })}</Box>\n        </Box>\n    );\n    if (issues.length === 0) {\n        return (\n            <>\n                {scope}\n                <Box css={styles.empty} data-inspector-no-issues=\"\">\n                    <Box as=\"span\" css={styles.emptyTitle}>{m.inspectorNoIssues({ part: \"title\" })}</Box>\n                    <Box as=\"span\" css={styles.emptyHint}>{m.inspectorNoIssues({ part: \"hint\" })}</Box>\n                </Box>\n            </>\n        );\n    }\n    return (\n        <>\n            {scope}\n            <Box as=\"ul\" css={styles.issueList} data-inspector-issue-list=\"\">\n                {issues.map((issue, i) => {\n                    const hiddenBy = hiddenOfIssue(issue);\n                    const hidden = hiddenBy === undefined ? undefined : hiddenLine(hiddenBy, words, m);\n                    return (\n                        <Box as=\"li\" key={i}>\n                            <chakra.button type=\"button\" css={styles.issueItem} data-inspector-issue={issue.word.issue} onClick={() => goTo(issue)}>\n                                <Box as=\"span\" css={styles.issueWhere}>{m.issueWhere(issue.where)}</Box>\n                                <Box as=\"span\" css={styles.issueMessage} data-kind={issue.blocking ? \"invalid\" : \"warning\"}>{m.issueText(issue.word)}</Box>\n                                {hidden !== undefined && <Box as=\"span\" css={styles.issueHidden} data-inspector-issue-hidden=\"\">{hidden}</Box>}\n                            </chakra.button>\n                        </Box>\n                    );\n                })}\n            </Box>\n        </>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The inspected entity's stored rows (#1391, `Schematic Builder Spec.md` §9),\n * read in a component of their own, as the Calendar's selection is (#1343):\n * the row its kind's record holds, and its details row, each as bytes. A kind's\n * rows hold it where its read does — its record read whole, its narrowing\n * read through its source, or, read by area, its window (#1393) — else it is\n * read by its key through the kind's `entries`, or, for a kind read by area\n * that has none, through its source of the slice (`recordSliceRows`, at the\n * kind's key type, #1549): a row the window no longer holds, still selected. A details record read whole\n * holds its row, and one read by key is asked for it. A new row whose key isn't\n * typed yet — held under a placeholder, which no key prints as (#1549) — has no\n * stored rows, and no read asks for one. The reader hands the\n * frame what it read only when that moves, so a scan landing elsewhere redraws\n * no inspector. What its drafts make of the rows is the inspector's: the reads\n * are the record's alone.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useRef } from \"react\";\nimport { BlobType, StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { getSomeorUndefined, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { recordSliceRows } from \"@elaraai/east-ui-components/internal\";\nimport { kindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { rowCodec } from \"../shared/schedule/records.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport type { SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicValue, SchematicWindowRows } from \"./data.js\";\n\nconst blobEqual = equalFor(BlobType);\nconst stringEqual = equalFor(StringType);\n\n/** A kind of any sort, as the payload carries it. */\ntype AnyKind = SchematicValue[\"items\"][number] | SchematicValue[\"zones\"][number] | SchematicValue[\"links\"][number] | SchematicValue[\"nets\"][number];\n/** A kind's details, as the payload carries them. */\ntype Details = Extract<AnyKind[\"details\"], { type: \"some\" }>[\"value\"];\n/** A kind's source of the slice. */\ntype Part = ValueTypeOf<RecordSliceBindType>;\n\n/** A stored row as a read finds it: its bytes, the record holding none of it, or its read in flight. */\nexport type SchematicRowRead =\n    | { readonly state: \"held\"; readonly row: Uint8Array }\n    | { readonly state: \"absent\" }\n    | { readonly state: \"reading\" };\n\n/** The inspected entity's stored rows. */\nexport interface SchematicInspectedRows {\n    /** The entity read; `undefined` for none. */\n    readonly ref: SchematicRef | undefined;\n    /** Its row, as its kind's record holds it. */\n    readonly row: SchematicRowRead;\n    /** Its details row; `undefined` for a kind with no details. */\n    readonly details: SchematicRowRead | undefined;\n}\n\n/** Nothing inspected: no row read. */\nexport const NO_INSPECTED_ROWS: SchematicInspectedRows = { ref: undefined, row: { state: \"absent\" }, details: undefined };\n\nconst READING: SchematicRowRead = { state: \"reading\" };\nconst ABSENT: SchematicRowRead = { state: \"absent\" };\n\n/** A row read by its key through a record's `entries`. */\nfunction byKey(entries: AnyKind[\"entries\"], key: string): SchematicRowRead | undefined {\n    if (entries.type !== \"some\") return undefined;\n    const got = entries.value.entry(key);\n    if (got.type !== \"some\") return READING;\n    return got.value.type === \"some\" ? { state: \"held\", row: got.value.value } : ABSENT;\n}\n\n/**\n * A row read by its key through its kind's source of the slice: a kind read by area that has no `entries`, read only\n * (#1393) — at the kind's key type (#1549), a text no key of its prints as naming no row.\n */\nfunction bySource(kind: AnyKind, part: Part, key: string): SchematicRowRead {\n    const at = kindKeys(kind.keyType).keyOf(key);\n    if (at === undefined) return ABSENT;\n    const got = recordSliceRows(part, [at]);\n    if (got.type !== \"some\") return READING;\n    const row = got.value[0];\n    return row === undefined || row.type !== \"some\" ? ABSENT : { state: \"held\", row: rowCodec(kind.rowType).encode(row.value) };\n}\n\n/**\n * A kind's stored row of a key: where its rows hold it, else by its key through\n * its `entries`. A kind read by area is never read whole, nor its narrowing\n * complete: its window holds the row, or it is read by its key (#1393) —\n * through its source of the slice where it has no `entries`.\n *\n * @param kind - The kind\n * @param key - The row's key\n * @param window - The rows its window holds, for a kind read by area; `undefined` for one read through its `rows()`\n * @param part - Its source of the slice, for a kind read by area\n * @returns The read\n */\nexport function storedRow(kind: AnyKind, key: string, window?: ReadonlyMap<string, { readonly row: Uint8Array }>, part?: Part): SchematicRowRead {\n    if (window !== undefined) {\n        const held = window.get(key);\n        if (held !== undefined) return { state: \"held\", row: held.row };\n        return byKey(kind.entries, key) ?? (part === undefined ? ABSENT : bySource(kind, part, key));\n    }\n    const rows = kind.rows();\n    if (rows.type === \"some\") {\n        const entry = rows.value.get(key);\n        if (entry !== undefined) return { state: \"held\", row: entry.row };\n    }\n    return byKey(kind.entries, key) ?? (rows.type === \"some\" ? ABSENT : READING);\n}\n\n/**\n * A kind's details row of a key: where its details read whole hold it, else by\n * its key through their `entries`.\n *\n * @param details - The kind's details\n * @param key - The row's key\n * @returns The read\n */\nexport function storedDetailsRow(details: Details, key: string): SchematicRowRead {\n    if (details.rows.type === \"some\") {\n        const rows = details.rows.value();\n        if (rows.type !== \"some\") return READING;\n        const entry = rows.value.get(key);\n        return entry === undefined ? ABSENT : { state: \"held\", row: entry.row };\n    }\n    return byKey(details.entries, key) ?? ABSENT;\n}\n\n/** Whether two reads say the same. */\nfunction readEqual(a: SchematicRowRead | undefined, b: SchematicRowRead | undefined): boolean {\n    if (a === undefined || b === undefined) return a === undefined && b === undefined;\n    if (a.state === \"held\" || b.state === \"held\") return a.state === \"held\" && b.state === \"held\" && blobEqual(a.row, b.row);\n    return a.state === b.state;\n}\n\n/** Whether two of what the reader read say the same. */\nfunction rowsEqual(a: SchematicInspectedRows, b: SchematicInspectedRows): boolean {\n    const sameRef = a.ref === undefined || b.ref === undefined ? a.ref === undefined && b.ref === undefined\n        : stringEqual(a.ref.kind, b.ref.kind) && stringEqual(a.ref.key, b.ref.key);\n    return sameRef && readEqual(a.row, b.row) && readEqual(a.details, b.details);\n}\n\n/** No kind read by area. */\nconst NO_AREAS: ReadonlySet<string> = new Set();\n\n/** No window read. */\nconst NO_WINDOWS: SchematicWindowRows = new Map();\n\n/**\n * Reads the inspected entity's stored rows (see the module docs), handing them\n * on only when what they say moves.\n *\n * @param props - The payload, the entity inspected — `undefined` for none — the kinds read by area and the rows each\n *   one's window holds, and where its rows go\n * @returns Nothing: it reads\n */\nexport function SchematicInspectedReader({ value, inspected, areas = NO_AREAS, windows = NO_WINDOWS, onRows }: {\n    value: SchematicValue; inspected: SchematicRef | undefined; areas?: ReadonlySet<string>; windows?: SchematicWindowRows;\n    onRows: (rows: SchematicInspectedRows) => void;\n}): null {\n    const read = useCallback((): SchematicInspectedRows => {\n        if (inspected === undefined) return NO_INSPECTED_ROWS;\n        const kind = [...value.items, ...value.zones, ...value.links, ...value.nets].find((k) => stringEqual(k.key, inspected.kind));\n        if (kind === undefined) return { ref: inspected, row: ABSENT, details: undefined };\n        if (!kindKeys(kind.keyType).isKey(inspected.key)) return { ref: inspected, row: ABSENT, details: kind.details.type === \"some\" ? ABSENT : undefined };\n        // A kind read by area: its window's rows, none before it has landed — a row they don't hold read by its key.\n        const byArea = areas.has(kind.key);\n        const window = byArea ? windows.get(kind.key)?.rows ?? new Map<string, { readonly row: Uint8Array }>() : undefined;\n        return {\n            ref: inspected,\n            row: storedRow(kind, inspected.key, window, byArea ? sourcePart(getSomeorUndefined(value.slice), kind.key) : undefined),\n            details: kind.details.type === \"some\" ? storedDetailsRow(kind.details.value, inspected.key) : undefined,\n        };\n    }, [value, inspected, areas, windows]);\n    const { result } = useTrackedEvaluation(read);\n    const reported = useRef<SchematicInspectedRows | undefined>(undefined);\n    useLayoutEffect(() => {\n        // A read that fails reads as in flight: the inspector says it is reading, and the frame's banners say why.\n        const rows = result.ok ? result.value : { ref: inspected, row: READING, details: undefined };\n        const was = reported.current;\n        if (was !== undefined && rowsEqual(was, rows)) return;\n        reported.current = rows;\n        onRows(rows);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The drawing's issues (#1391, `Schematic Builder Spec.md` §9, SC16) — pure\n * and React-free: what the inspector's Issues tab lists, each naming what a\n * click on it selects — and, an issue of a record's row, the row and the field\n * it names, which the click asks of the row's Details.\n *\n * - **A link or a net naming an item no kind holds** — an end or a member of\n *   a slot no item kind has, or of an item kind read whole that holds no row\n *   of its key, the drafts in place. A kind read through its source is asked\n *   nothing: what its narrowing leaves out, the drawing cannot say is gone.\n * - **An item outside the extent** — its centre past the drawing's bounds.\n * - **Geometry outside its entity's box** — an item's footprint past its box\n *   about its centre, a zone's shape past its box: its vertices, the arcs its\n *   bulges draw (as the painter draws them), and a band's half-width.\n * - **A colour naming no theme colour** (D14) — an item's, a zone's or a\n *   layer's, which draws its tone instead.\n * - **A stored row's number outside its field's bounds** (#1585) — a row the\n *   drawing draws, or its details row, as its read holds it (`bounds.ts`).\n * - **The app's `ready` refusals**, and a changed row's number outside its\n *   field's bounds — they hold Save.\n * - **A Save's conflict or refusal**, while it stands.\n *\n * The last three name a field by its form's label, as every builder's do.\n *\n * The last two block, and come first, then the stored rows' bounds; the rest\n * warn, and Save goes ahead with them. Two items of one key in one kind can't\n * arise: each kind is a record keyed by String.\n *\n * What is checked is what the drawing holds — a kind read by area's rows read\n * around the view, and the drafts drawn — and every unsaved change it leaves\n * out, waiting in its session where a narrowing leaves out the row it drafts,\n * as its draft has it (`drafted.ts`' `waitingDrafts`, which the frame hands\n * beside the drawing): never a read of a kind's other rows, which are checked\n * as the view reaches them; the inspector says so (ruled 27 Oct 2026, \"Checked\n * in view, said so\").\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport type { Schematic } from \"@elaraai/e3-ui/internal\";\nimport type { FieldSpecValue } from \"@elaraai/east-ui/internal\";\nimport type { EditIssue, EditSession } from \"@elaraai/east-ui-components\";\nimport { fieldLabelOf } from \"../shared/schedule/refusals.js\";\nimport { arcFromBulge } from \"./canvas/paint.js\";\nimport { entityId, refOfId, type SchematicDrawn, type SchematicRef } from \"./canvas/drawn.js\";\nimport { recordSlot } from \"./record-keys.js\";\n\n/** Shape geometry, decoded. */\ntype Geometry = ValueTypeOf<typeof Schematic.Types.Geometry>;\n\nconst stringEqual = equalFor(StringType);\n\n/** How far past its bound a shape may reach and still be within it: float noise, never a drawing's. */\nconst EPSILON = 1e-6;\n\n/** What an issue says, before its words. */\nexport type SchematicIssueWord =\n    /** An end or a member naming an item no kind holds: its kind's name — or its slot, for one no item kind has — and its key. */\n    | { readonly issue: \"missing\"; readonly kind: string; readonly key: string }\n    /** An item whose centre lies outside the drawing's extent. */\n    | { readonly issue: \"outside\" }\n    /** A footprint, or a zone's shape, reaching past its box. */\n    | { readonly issue: \"geometry\" }\n    /** A colour naming no theme colour token: it draws its tone. */\n    | { readonly issue: \"colour\"; readonly colour: string }\n    /** A stored row's number its field's bounds don't hold (#1585): its field by its form's label, and the bound in its hint's own words. */\n    | { readonly issue: \"bounds\"; readonly field: string; readonly message: string }\n    /** The app's check refusing a drafted row, which holds Save — its field by its form's label, if it names one. */\n    | { readonly issue: \"ready\"; readonly field: string | undefined; readonly message: string }\n    /** A Save's conflict or refusal, in the source's own words — its field by its form's label, if it names one. */\n    | { readonly issue: \"save\"; readonly field: string | undefined; readonly message: string };\n\n/** One issue of the drawing, as the Issues tab lists it. */\nexport interface SchematicIssue {\n    /**\n     * What a click on it selects: an entity, by its id — one the drawing leaves out, waiting in its session, once the\n     * choices that hide it are cleared; `undefined` for nothing — a layer, or a record's words that name no row.\n     */\n    readonly at: string | undefined;\n    /** Whether it blocks — the app's check holds Save, or a Save was stopped — rather than warns. */\n    readonly blocking: boolean;\n    /** What it names: its kind's name — `undefined` for a layer — and its own name, as the Schematic names it everywhere. */\n    readonly where: { readonly kind: string | undefined; readonly name: string };\n    /** What it says. */\n    readonly word: SchematicIssueWord;\n    /**\n     * The row it names, as its record's session names it — the record by its key in the history, its kind's slot or its\n     * details record's, and the row's key — and the field it names, by its form's key: a click on it asks the row's\n     * Details for the field, which takes the keyboard there, as it does for the toolbar's issue gone to. `undefined` for\n     * an issue of the drawing's own, which names no row's field.\n     */\n    readonly row?: { readonly record: string; readonly entry: string; readonly field: string | undefined } | undefined;\n}\n\n/** What the drawing's issues are worked out from. */\nexport interface SchematicIssueArgs {\n    /**\n     * What is checked: what the canvas draws — the stored rows, the drafts in place — and the drafted rows it leaves out,\n     * each as its draft has it (`drafted.ts`' `withWaiting`).\n     */\n    readonly drawn: SchematicDrawn;\n    /** The drawing's world bounds. */\n    readonly extent: { readonly width: number; readonly height: number };\n    /** Each kind's name, by its slot. */\n    readonly names: ReadonlyMap<string, string>;\n    /**\n     * Each entity's name, by its id, as the Schematic names it everywhere (`inspect.ts`' `entityNames`): what an issue's\n     * row names it — a link by its ends, a net by its label or its ends, never a key the Schematic minted.\n     */\n    readonly nameOf: (id: string) => string;\n    /**\n     * Whether an item is held: `false` for one of a slot no item kind has, or one an item kind read whole holds no row\n     * of; `undefined` where it can't be said — a kind read through its source.\n     */\n    readonly holds: (ref: SchematicRef) => boolean | undefined;\n    /** The layers: each its key, its name and its colour. */\n    readonly layers: readonly { readonly key: string; readonly label: string; readonly color: option<string> }[];\n    /** The theme colour tokens a colour may name. */\n    readonly colours: ReadonlySet<string>;\n}\n\n/** A shape's reach about its anchor: its least and greatest offsets along each axis. */\nexport interface ShapeExtent {\n    readonly minX: number;\n    readonly minY: number;\n    readonly maxX: number;\n    readonly maxY: number;\n}\n\n/** A point about the anchor. */\ntype Pt = { readonly x: number; readonly y: number };\n\n/**\n * Whether an angle lies on an arc's sweep, as `CanvasRenderingContext2D.arc`\n * draws it from its start to its end.\n */\nfunction onSweep(angle: number, start: number, end: number, anticlockwise: boolean): boolean {\n    const turn = 2 * Math.PI;\n    const wrap = (a: number) => ((a % turn) + turn) % turn;\n    return anticlockwise ? wrap(start - angle) <= wrap(start - end) : wrap(angle - start) <= wrap(end - start);\n}\n\n/**\n * The points an edge reaches: its two ends, and — for an arc its bulge draws —\n * each of the arc's extremes along an axis that lies on its sweep.\n */\nfunction edgeReach(p1: Pt, p2: Pt, bulge: number): Pt[] {\n    const out: Pt[] = [p1, p2];\n    const arc = arcFromBulge(p1, p2, bulge);\n    if (arc === null) return out;\n    for (const angle of [0, Math.PI / 2, Math.PI, (3 * Math.PI) / 2]) {\n        if (onSweep(angle, arc.startAngle, arc.endAngle, arc.anticlockwise)) {\n            out.push({ x: arc.cx + arc.radius * Math.cos(angle), y: arc.cy + arc.radius * Math.sin(angle) });\n        }\n    }\n    return out;\n}\n\n/**\n * A shape's reach about its anchor (D22): a circle's radius every way; a\n * polygon's or a polyline's vertices and the arcs their bulges draw — a\n * polygon's closing edge among them — and a polyline's band half its width\n * past them; nothing for the box itself.\n *\n * @param geometry - The shape\n * @returns Its reach; `undefined` for the box (`rect`) or a shape with no vertex\n */\nexport function shapeExtent(geometry: Geometry): ShapeExtent | undefined {\n    switch (geometry.type) {\n        case \"rect\": return undefined;\n        case \"circle\": {\n            const r = geometry.value.radius;\n            return { minX: -r, minY: -r, maxX: r, maxY: r };\n        }\n        case \"polygon\":\n        case \"polyline\": {\n            const vertices = geometry.value.vertices;\n            if (vertices.length === 0) return undefined;\n            const closed = geometry.type === \"polygon\";\n            const points: Pt[] = [];\n            for (let i = 0; i < vertices.length; i++) {\n                const v = vertices[i]!;\n                const next = vertices[i + 1] ?? (closed ? vertices[0] : undefined);\n                if (next === undefined) points.push(v);\n                else points.push(...edgeReach(v, next, v.bulge));\n            }\n            const band = geometry.type === \"polyline\" && geometry.value.width.type === \"some\" ? geometry.value.width.value / 2 : 0;\n            return {\n                minX: Math.min(...points.map((p) => p.x)) - band, minY: Math.min(...points.map((p) => p.y)) - band,\n                maxX: Math.max(...points.map((p) => p.x)) + band, maxY: Math.max(...points.map((p) => p.y)) + band,\n            };\n        }\n    }\n}\n\n/**\n * Whether a shape reaches past a box about its anchor.\n *\n * @param geometry - The shape\n * @param width - The box's width\n * @param height - The box's height\n * @returns Whether some of it lies outside the box\n */\nexport function outsideBox(geometry: Geometry, width: number, height: number): boolean {\n    const reach = shapeExtent(geometry);\n    if (reach === undefined) return false;\n    const hw = width / 2 + EPSILON, hh = height / 2 + EPSILON;\n    return reach.minX < -hw || reach.maxX > hw || reach.minY < -hh || reach.maxY > hh;\n}\n\n/**\n * The drawing's own issues (see the module docs): its items' — outside the\n * extent, a footprint past its box, a colour naming no theme colour — then its\n * zones', its links' and its nets' — an end or a member no kind holds — and\n * its layers', each in the drawing's order. Each warns.\n *\n * @param args - The drawing, its extent, its kinds' names, what the item kinds hold, its layers and the theme's colours\n * @returns Its issues\n */\nexport function drawingIssues(args: SchematicIssueArgs): SchematicIssue[] {\n    const { drawn, extent, names, nameOf, holds, layers, colours } = args;\n    const out: SchematicIssue[] = [];\n    const kindOf = (slot: string) => names.get(slot) ?? slot;\n    const warn = (at: string | undefined, where: SchematicIssue[\"where\"], word: SchematicIssueWord) => out.push({ at, blocking: false, where, word });\n    const badColour = (colour: option<string>): string | undefined => (colour.type === \"some\" && !colours.has(colour.value) ? colour.value : undefined);\n    for (const item of drawn.items) {\n        const where = { kind: kindOf(item.ref.kind), name: nameOf(item.key) };\n        if (item.x < -EPSILON || item.y < -EPSILON || item.x > extent.width + EPSILON || item.y > extent.height + EPSILON) warn(item.key, where, { issue: \"outside\" });\n        if (item.footprint.type === \"some\" && item.width.type === \"some\" && item.height.type === \"some\"\n            && outsideBox(item.footprint.value, item.width.value, item.height.value)) warn(item.key, where, { issue: \"geometry\" });\n        const colour = badColour(item.color);\n        if (colour !== undefined) warn(item.key, where, { issue: \"colour\", colour });\n    }\n    for (const zone of drawn.zones) {\n        const where = { kind: kindOf(zone.ref.kind), name: nameOf(zone.key) };\n        if (zone.geometry.type === \"some\" && outsideBox(zone.geometry.value, zone.width, zone.height)) warn(zone.key, where, { issue: \"geometry\" });\n        const colour = badColour(zone.color);\n        if (colour !== undefined) warn(zone.key, where, { issue: \"colour\", colour });\n    }\n    // An end or a member no kind holds: named by its kind's name and its key.\n    const missing = (at: string, where: SchematicIssue[\"where\"], member: string) => {\n        const ref = refOfId(member);\n        if (ref === undefined || holds(ref) !== false) return;\n        warn(at, where, { issue: \"missing\", kind: kindOf(ref.kind), key: ref.key });\n    };\n    // A link or a net named as the Schematic names it: by its ends, a net by its label first.\n    for (const link of drawn.links) {\n        const where = { kind: kindOf(link.ref.kind), name: nameOf(link.key) };\n        missing(link.key, where, link.from);\n        if (!stringEqual(link.from, link.to)) missing(link.key, where, link.to);\n    }\n    for (const net of drawn.nets) {\n        const where = { kind: kindOf(net.ref.kind), name: nameOf(net.key) };\n        for (const member of [...net.sources, ...net.destinations]) missing(net.key, where, member);\n    }\n    for (const layer of layers) {\n        const colour = badColour(layer.color);\n        if (colour !== undefined) warn(undefined, { kind: undefined, name: layer.label }, { issue: \"colour\", colour });\n    }\n    return out;\n}\n\n/**\n * A number a row the drawing draws holds outside its field's bounds (#1585): the row's, or its details row's, as its draft\n * has it, else as its read holds it (`bounds.ts`).\n */\nexport interface SchematicBreach {\n    /** The row's record's key in the history: its kind's slot, or its details record's (`detailsKey`). */\n    readonly record: string;\n    /** The row's key. */\n    readonly key: string;\n    /** The field, by its form's label. */\n    readonly field: string;\n    /** The field, by its form's key: what a click on its issue asks of its row's Details. */\n    readonly fieldKey: string;\n    /** The bound it breaks, in its hint's own words — `at most 10` — as its session's readiness says it of a changed row. */\n    readonly message: string;\n    /** Whether a draft changed the row: its session's readiness raises the breach then, holding Save. */\n    readonly changed: boolean;\n}\n\n/** The breaches of the rows the drawing draws, by the id of the entity each row is drawn as: one whose rows break none is absent. */\nexport type SchematicBreaches = ReadonlyMap<string, readonly SchematicBreach[]>;\n\n/**\n * The stored rows' breaches, as Issues lists them (see the module docs): each a warning naming its entity and the field\n * by its form's label, in the drawing's order. A changed row's is its session's readiness's, which blocks: never here.\n *\n * @param breaches - The breaches of the rows the drawing draws, by entity\n * @param names - Each kind's name, by its slot\n * @param nameOf - Each entity's name, by its id, as the Schematic names it everywhere\n * @returns The issues\n */\nexport function boundsIssues(breaches: SchematicBreaches, names: ReadonlyMap<string, string>, nameOf: (id: string) => string): SchematicIssue[] {\n    const out: SchematicIssue[] = [];\n    for (const [id, found] of breaches) {\n        for (const breach of found) {\n            if (breach.changed) continue;\n            const slot = recordSlot(breach.record);\n            out.push({\n                at: id, blocking: false, where: { kind: names.get(slot) ?? slot, name: nameOf(id) },\n                word: { issue: \"bounds\", field: breach.field, message: breach.message },\n                row: { record: breach.record, entry: breach.key, field: breach.fieldKey },\n            });\n        }\n    }\n    return out;\n}\n\n/** A record's session as Issues reads it: the kind or the details record it is, and where its Save stands. */\nexport interface SchematicIssueSession {\n    /** The record's key in the history: a kind's slot, or its details record's (`detailsKey`). */\n    readonly kind: string;\n    /** Its session: where its latest Save stands, its source's words, and its drafts' readiness. */\n    readonly session: Pick<EditSession<unknown>, \"status\" | \"issues\" | \"readiness\">;\n    /** Its row's form: what an issue names a field by. */\n    readonly fields: readonly FieldSpecValue[];\n}\n\n/**\n * The issues each record's session raises (see the module docs): the app's\n * check refusing its drafted rows, and its latest Save's conflict or refusal\n * while it stands — each blocking, naming the entity of its row and a field\n * by its form's label, and the row and the field by its key, which a click\n * asks of the row's Details.\n *\n * @param sessions - Each record's session\n * @param names - Each kind's name, by its slot\n * @param labelOf - An entity's name by its id: its label, where the drawing draws it\n * @returns The issues, in the sessions' order\n */\nexport function sessionIssues(sessions: readonly SchematicIssueSession[], names: ReadonlyMap<string, string>,\n    labelOf: (id: string) => string | undefined): SchematicIssue[] {\n    const out: SchematicIssue[] = [];\n    for (const part of sessions) {\n        const slot = recordSlot(part.kind);\n        const kind = names.get(slot) ?? slot;\n        const raise = (issue: EditIssue, word: \"ready\" | \"save\") => {\n            const field = issue.field.type === \"some\" ? fieldLabelOf(part.fields, issue.field.value) : undefined;\n            // The source's own words name no row: they stand for the kind's record.\n            const named = !stringEqual(issue.entry, \"\");\n            const id = named ? entityId({ kind: slot, key: issue.entry }) : undefined;\n            out.push({\n                at: id, blocking: true,\n                where: { kind, name: id === undefined ? kind : labelOf(id) ?? issue.entry },\n                word: { issue: word, field, message: issue.message },\n                row: named ? { record: part.kind, entry: issue.entry, field: issue.field.type === \"some\" ? issue.field.value : undefined } : undefined,\n            });\n        };\n        const readiness = part.session.readiness;\n        if (readiness.type !== \"ready\") for (const issue of readiness.value) raise(issue, \"ready\");\n        const status = part.session.status;\n        if (status === \"conflict\" || status === \"rejected\") for (const issue of part.session.issues) raise(issue, \"save\");\n    }\n    return out;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Index of the item kinds read by area (#1393, `Schematic Builder Spec.md`\n * §8, D52): what no window holds of them, read for the Index alone.\n *\n * - **An open zone's items** are read through each such kind's source by the\n *   zone's box: the area index its window would read through\n *   (`schematicWindowPlan`), the box's cells (`areaCells`) counted, then —\n *   while they hold no more than a window reads — their entries read, each\n *   cell's kept at its revision while an open zone wants it; the narrowing's\n *   choices that index doesn't lead asked of the rows in one `within` (D28).\n *   The rows whose centre the zone holds are its items, nested as every item\n *   is. A zone whose box holds more than a window reads lists none of them,\n *   and says so.\n * - **Their details** are read beside them by the same cells, as the canvas\n *   reads a window's (D45): the details' rows of each cell's entries, every\n *   cell not held in one request of the details' record — the server reading\n *   each entry's key from the area index, none sent — kept at the kind's\n *   revision and the details' while an open zone wants it. So each item's dot\n *   carries its status, and its row its figure, as the canvas draws them\n *   (#1570); a zone's items are listed only once both have landed.\n * - **Its search** reads each such kind through its source's `search` fields\n *   (ruling 11), as a paged tab's search does (`pagedSearchWhere`): a prefix of\n *   the first field that combines with the rail's choices, its first\n *   {@link INDEX_MATCHES} matches read, and how many more it holds said.\n *\n * Nothing it reads is the record whole. Each result is the same object while\n * what it was read from is, and names the revision it read each kind at: what\n * a Save landed of a kind is drawn until the Index reads it since\n * (`drafted.ts`' `landedRead`).\n *\n * @packageDocumentation\n */\n\nimport { StringType, equalFor, none, printFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { SeekQueryType } from \"@elaraai/east-ui\";\nimport { areaCells, type RecordSliceBindType, type RecordSliceCell, type RecordSliceEntry, type RecordSliceJoined } from \"@elaraai/east-ui/internal\";\nimport { SCHEMATIC_WINDOW_READ_ROWS, schematicWindowPlan, type SchematicAreaIndexes } from \"@elaraai/e3-ui/internal\";\nimport {\n    pagedSearchTarget, pagedSearchWhere, recordSliceCellEntries, recordSliceCellJoins, recordSliceCellRuns, recordSliceOnPrinter, recordSlicePage,\n    recordSliceRevision, recordSliceWithin,\n} from \"@elaraai/east-ui-components/internal\";\nimport { defaultPagedRuntime, pagedSourceOf } from \"../platform/paged-runtime.js\";\nimport { READING, type Reading } from \"./area.js\";\nimport { drawnItem, type DetailsRoles, type DrawnItem, type DrawnZone, type ItemRoles } from \"./canvas/drawn.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport { kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { entryRow, type KindRows } from \"./kind-rows.js\";\nimport { RowMaking, type StoredRows } from \"./made-rows.js\";\n\n/** A kind's source of the slice. */\ntype Part = ValueTypeOf<RecordSliceBindType>;\n/** An item kind, decoded. */\ntype ItemKind = SchematicValue[\"items\"][number];\n\nconst stringEqual = equalFor(StringType);\nconst printQuery = printFor(SeekQueryType);\n\n/** A cell's details of none: no entry of it has a details row. */\nconst NO_JOINED: readonly RecordSliceJoined[] = [];\n\n/** A kind's details' rows read by the cells an open zone's items were read by (D45), at the kind's revision and the details'. */\ninterface Joined {\n    /** The `id` of the details' paged read. */\n    readonly dict: string;\n    /** The kind's revision the cells were read at. */\n    readonly revision: string;\n    /** The details' revision their rows were read at. */\n    readonly details: string;\n    /** Each cell's rows of the details, by its name, while an open zone wants it. */\n    readonly cells: Map<string, readonly RecordSliceJoined[]>;\n}\n\n/** Lets go of the cells no open zone wants of one kind's, through every index: an index it reads none through, whole. */\nfunction forgetCells<C>(byIndex: Map<string, { readonly cells: Map<string, C> }> | undefined, wanted: ReadonlyMap<string, ReadonlySet<string>>): void {\n    if (byIndex === undefined) return;\n    for (const [index, kept] of [...byIndex]) {\n        const ids = wanted.get(index);\n        if (ids === undefined) { byIndex.delete(index); continue; }\n        for (const id of [...kept.cells.keys()]) if (!ids.has(id)) kept.cells.delete(id);\n    }\n}\n\n/** The most matches of a search the Index reads a kind: past them, it says how many more there are. */\nexport const INDEX_MATCHES = 50;\n\n/** An item kind read by area: the kind, its source of the slice and its area indexes. */\nexport interface IndexAreaKind {\n    /** The kind. */\n    readonly kind: ItemKind;\n    /** Its source of the slice. */\n    readonly part: Part;\n    /** Its area indexes. */\n    readonly areas: SchematicAreaIndexes;\n}\n\n/** What the Index read of the item kinds read by area. */\nexport interface IndexAreaRead {\n    /** Their items: the open zones', or the search's matches — each once. */\n    readonly items: readonly DrawnItem[];\n    /** The zones whose box was read, by id: what they hold of those kinds is whole. */\n    readonly read: ReadonlySet<string>;\n    /** The zones whose box holds more than a window reads, by id: they list none of those kinds' items. */\n    readonly crowded: ReadonlySet<string>;\n    /** How many matches of the search those kinds hold past those read. */\n    readonly more: number;\n    /** The revision each kind was read at, by its slot. */\n    readonly revisions: ReadonlyMap<string, string>;\n}\n\n/** Nothing read: no kind read by area, or no zone open and no search. */\nexport const NO_INDEX_AREA: IndexAreaRead = { items: [], read: new Set(), crowded: new Set(), more: 0, revisions: new Map() };\n\n/** A zone's box, in world units. */\nfunction boxOf(zone: DrawnZone): { minX: number; minY: number; maxX: number; maxY: number } {\n    return { minX: zone.x, minY: zone.y, maxX: zone.x + zone.width, maxY: zone.y + zone.height };\n}\n\n/** Whether two lists of what a result was read from are the same parts, in order. */\nfunction sameFrom(a: readonly unknown[], b: readonly unknown[]): boolean {\n    return a.length === b.length && a.every((part, i) => Object.is(part, b[i]));\n}\n\n/** The Index's reads of the item kinds read by area, kept across reads — see the module docs. */\nexport class SchematicIndexArea {\n    /** Each kind's cells' entries, by its slot, then by the index they were read through, at a revision: those an open zone wants. */\n    private readonly kept = new Map<string, Map<string, { readonly revision: string; readonly cells: Map<string, RecordSliceEntry[]> }>>();\n    /** Each kind's cells' details, by its slot, then by the index they were read through (D45): those an open zone wants. */\n    private readonly joined = new Map<string, Map<string, Joined>>();\n    /** What the details' `rowsOf` has made of their rows: all a read asks for, at once, since the Index draws them in one pass. */\n    private readonly making = new RowMaking();\n    /** The last result, and what it was read from. */\n    private last: { readonly from: readonly unknown[]; readonly result: IndexAreaRead } | undefined;\n\n    /**\n     * @param rows - The kinds' rows as their `rowsOf` makes them, shared with the paged Backlog: what a gesture on one rewrites\n     */\n    constructor(private readonly rows: KindRows<ItemRoles>) {}\n\n    /**\n     * What the Index reads of the kinds: the open zones' items, or — searching — the matches.\n     *\n     * @param kinds - The item kinds read by area\n     * @param open - The zones open in the Index\n     * @param query - The Index's search; empty, none\n     * @returns What it read; {@link READING} while a count, a page or an answer is read\n     */\n    read(kinds: readonly IndexAreaKind[], open: readonly DrawnZone[], query: string): IndexAreaRead | Reading {\n        if (kinds.length === 0 || (open.length === 0 && query === \"\")) return NO_INDEX_AREA;\n        const from: unknown[] = [query];\n        const items = new Map<string, DrawnItem>();\n        const read = new Set<string>();\n        const crowded = new Set<string>();\n        const revisions = new Map<string, string>();\n        let more = 0;\n        for (const kind of kinds) {\n            const revision = recordSliceRevision(kind.part);\n            if (revision.type !== \"some\") return READING;\n            from.push(kind.kind, revision.value);\n            revisions.set(kind.kind.key, revision.value);\n            const got = query === \"\"\n                ? this.zones(kind, revision.value, open, from, read, crowded)\n                : this.search(kind, revision.value, query, from);\n            if (got === READING) return READING;\n            for (const item of got.items) items.set(item.key, item);\n            more += got.more;\n        }\n        const last = this.last;\n        if (last !== undefined && sameFrom(last.from, from)) return last.result;\n        const result = { items: [...items.values()], read, crowded, more, revisions };\n        this.last = { from, result };\n        return result;\n    }\n\n    /** A kind's items in the open zones: each zone's box's cells counted, then read while they hold no more than a window reads. */\n    private zones(kind: IndexAreaKind, revision: string, open: readonly DrawnZone[], from: unknown[], read: Set<string>, crowded: Set<string>):\n        { readonly items: readonly DrawnItem[]; readonly more: number } | Reading {\n        const where = kind.part.read().where;\n        const keys = kindKeys(kind.kind.keyType);\n        const items: DrawnItem[] = [];\n        const wanted = new Map<string, Set<string>>();\n        for (const zone of open) {\n            const box = boxOf(zone);\n            const plan = schematicWindowPlan(kind.areas, where, box);\n            const index = plan.index.name;\n            const printOn = recordSliceOnPrinter(kind.part, index);\n            const cells: RecordSliceCell[] = plan.prefixes.flatMap((prefix) => areaCells(prefix, box, plan.cell, printOn))\n                .map((place) => ({ id: printQuery(place.query), queries: [place.query] }));\n            // Counted first, in one request: a zone holding more than a window reads lists none of the kind's items.\n            const runs = recordSliceCellRuns(kind.part, index, cells);\n            if (runs.type !== \"some\") return READING;\n            let total = 0n;\n            for (const cell of cells) total += runs.value.get(cell.id)?.total ?? 0n;\n            if (total > BigInt(SCHEMATIC_WINDOW_READ_ROWS)) { crowded.add(zone.key); continue; }\n            // The entries and their details asked together: neither waits on the other's answer.\n            const entries = this.entriesOf(kind, index, revision, cells);\n            const details = this.detailsOf(kind, index, revision, cells, keys);\n            if (entries === READING || details === READING) return READING;\n            let ids = wanted.get(index);\n            if (ids === undefined) { ids = new Set(); wanted.set(index, ids); }\n            for (const cell of cells) ids.add(cell.id);\n            // Each row once, as the cells hold it, by its key's text (#1549).\n            const rows = new Map<string, { readonly key: unknown; readonly row: unknown }>();\n            for (const cell of entries) for (const entry of cell) rows.set(keys.textOf(entry.key), { key: entry.key, row: entryRow(entry) });\n            const listed = [...rows].map(([key, { row }]) => ({ key, row }));\n            // The narrowing's choices the index doesn't lead, asked of the rows in one request (D28), each by its key.\n            let held: readonly boolean[] | undefined;\n            if (plan.residual.length > 0 && listed.length > 0) {\n                const answer = recordSliceWithin(kind.part, where, [...rows.values()]);\n                if (answer.type !== \"some\") return READING;\n                held = answer.value;\n            }\n            // The answers as one text: the same while they are.\n            from.push(zone.key, ...entries, ...(details?.joined ?? []), held === undefined ? \"\" : held.map((inside) => (inside ? \"1\" : \"0\")).join(\"\"));\n            const made = this.rows.rowsOf(kind.kind, revision, listed);\n            listed.forEach(({ key }, i) => {\n                if (held !== undefined && held[i] !== true) return;\n                // Its details' roles, as the canvas draws them beside its own: a row of no details row draws its own alone.\n                const own = details?.rows.get(key)?.roles as DetailsRoles | undefined;\n                const item = drawnItem({ kind: kind.kind.key, key }, made.get(key)!.roles, own);\n                // The zone's items: those whose centre it holds.\n                if (item !== undefined && item.x >= box.minX && item.x <= box.maxX && item.y >= box.minY && item.y <= box.maxY) items.push(item);\n            });\n            read.add(zone.key);\n        }\n        this.forget(kind.kind.key, wanted);\n        return { items, more: 0 };\n    }\n\n    /** A kind's search through its source's `search` fields: its first {@link INDEX_MATCHES} matches, and how many more. */\n    private search(kind: IndexAreaKind, revision: string, query: string, from: unknown[]): { readonly items: readonly DrawnItem[]; readonly more: number } | Reading {\n        const where = kind.part.read().where;\n        const target = pagedSearchTarget(kind.part.config, where);\n        // No field to search, or the rail's choices block every one: the search finds none of the kind's.\n        if (target?.field === undefined) return { items: [], more: 0 };\n        const within = pagedSearchWhere(target.field, where, query);\n        if (within === null) return { items: [], more: 0 };\n        // A read of the search's narrowing alone, never a read by area (#1432).\n        const count = kind.part.countWhere({ where: within, area: none });\n        if (count.type !== \"some\") return READING;\n        const page = recordSlicePage(kind.part, { where: within, area: none }, 0n, BigInt(INDEX_MATCHES));\n        if (page.type !== \"some\") return READING;\n        const entries = page.value as RecordSliceEntry[];\n        from.push(count.value, ...entries);\n        const keys = kindKeys(kind.kind.keyType);\n        const listed = entries.map((entry) => ({ key: keys.textOf(entry.key), row: entryRow(entry) }));\n        const made = this.rows.rowsOf(kind.kind, revision, listed);\n        const items: DrawnItem[] = [];\n        for (const { key } of listed) {\n            // A match with no position is the Backlog's.\n            const item = drawnItem({ kind: kind.kind.key, key }, made.get(key)!.roles, undefined);\n            if (item !== undefined) items.push(item);\n        }\n        return { items, more: Math.max(0, Number(count.value) - listed.length) };\n    }\n\n    /** Some cells' entries through an index at a revision: those not held read in one request. */\n    private entriesOf(kind: IndexAreaKind, index: string, revision: string, cells: readonly RecordSliceCell[]): (readonly RecordSliceEntry[])[] | Reading {\n        let byIndex = this.kept.get(kind.kind.key);\n        if (byIndex === undefined) { byIndex = new Map(); this.kept.set(kind.kind.key, byIndex); }\n        let kept = byIndex.get(index);\n        if (kept === undefined || !stringEqual(kept.revision, revision)) {\n            kept = { revision, cells: new Map() };\n            byIndex.set(index, kept);\n        }\n        const held = kept.cells;\n        const missing = cells.filter((cell) => !held.has(cell.id));\n        if (missing.length > 0) {\n            const got = recordSliceCellEntries(kind.part, index, missing);\n            if (got.type !== \"some\") return READING;\n            for (const cell of missing) held.set(cell.id, got.value.get(cell.id) ?? []);\n        }\n        return cells.map((cell) => held.get(cell.id)!);\n    }\n\n    /**\n     * Some cells' details' rows (D45), as the canvas reads a window's (`area.ts`' `detailsOf`): the details' rows of the\n     * cells' entries through an index — those not held read in one request of the details' record, the server reading\n     * each entry's key from the index, none sent — kept at the kind's revision and the details', made their stored rows.\n     *\n     * @param kind - The kind\n     * @param index - The area index the cells are of\n     * @param revision - The kind's revision the cells' entries were read at\n     * @param cells - The cells\n     * @param keys - The kind's keys, which its details are keyed as: each details row by its key's text (#1549)\n     * @returns The cells' rows of the details, in order, and the rows made of them, by key; `undefined` for a kind with\n     *   no details, or details read by no paged read; {@link READING} while the details' revision or a cell's rows are read\n     * @throws {Error} When the details' paged read is bound on no page this runtime serves\n     */\n    private detailsOf(kind: IndexAreaKind, index: string, revision: string, cells: readonly RecordSliceCell[], keys: KindKeys):\n        { readonly joined: readonly (readonly RecordSliceJoined[])[]; readonly rows: StoredRows } | Reading | undefined {\n        const details = kind.kind.details;\n        if (details.type !== \"some\" || details.value.paged.type !== \"some\") return undefined;\n        const dict = details.value.paged.value;\n        const source = pagedSourceOf(dict);\n        if (source === undefined) throw new Error(`The details' paged read '${dict}' is bound on no page this runtime serves`);\n        const at = defaultPagedRuntime.revisionOf(source);\n        if (at.type !== \"some\") return READING;\n        let byIndex = this.joined.get(kind.kind.key);\n        if (byIndex === undefined) { byIndex = new Map(); this.joined.set(kind.kind.key, byIndex); }\n        let kept = byIndex.get(index);\n        if (kept === undefined || !stringEqual(kept.dict, dict) || !stringEqual(kept.revision, revision) || !stringEqual(kept.details, at.value)) {\n            kept = { dict, revision, details: at.value, cells: new Map() };\n            byIndex.set(index, kept);\n        }\n        const held = kept.cells;\n        const missing = cells.filter((cell) => !held.has(cell.id));\n        if (missing.length > 0) {\n            const got = recordSliceCellJoins(kind.part, index, missing, dict);\n            if (got.type !== \"some\") return READING;\n            for (const cell of missing) held.set(cell.id, got.value.get(cell.id) ?? NO_JOINED);\n        }\n        const joined = cells.map((cell) => held.get(cell.id)!);\n        const present = new Map<string, unknown>();\n        for (const cell of joined) for (const entry of cell) if (entry.row.type === \"some\") present.set(keys.textOf(entry.key), entry.row.value);\n        // No budget is begun, so every row is made in this read.\n        const rows = this.making.make(details.value, present);\n        return rows === undefined ? READING : { joined, rows };\n    }\n\n    /** Lets go of the cells of a kind no open zone wants, its entries' and its details', through every index. */\n    private forget(slot: string, wanted: ReadonlyMap<string, ReadonlySet<string>>): void {\n        forgetCells(this.kept.get(slot), wanted);\n        forgetCells(this.joined.get(slot), wanted);\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The viewer's layer choices (#1389, `Schematic Builder Spec.md` §8, SC27):\n * what the library's Layers tab shows, hides, isolates and locks, held in the\n * UI store under the Schematic's `id` (`schematicKeys(id).layers`) as an East\n * value — as the tools are (`tools.ts`) — so a remount keeps them and two\n * Schematics of one `id` share them. They are view settings, like the Plan's\n * Series and the Sheet's Columns: they write no record.\n *\n * Each layer's author defaults — its `visible` and `locked` — stand until the\n * viewer overrides them:\n *\n * - **Show or Hide** flips the layer as it shows now, isolation counted, and\n *   ends an isolation;\n * - **Isolate** shows that layer alone — an entity on no layer, or on a key no\n *   layer has, still shows — and Isolate again ends it;\n * - **Lock** flips whether the layer's entities select;\n * - **Show all** shows every layer, the ones its author hides at first among\n *   them, and ends an isolation; the locks stay as they are.\n *\n * The pure functions here turn the choices into the layers the drawing obeys\n * (`layersInForce`, which `canvas/layers.ts`' `layerState` reads), and each\n * toggle into the next choices.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport {\n    BooleanType, DictType, OptionType, SortedMap, StringType, StructType, compareFor, decodeBeast2For, encodeBeast2For, equalFor, none, some,\n    type ValueTypeOf,\n} from \"@elaraai/east\";\nimport { StateRuntime, getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport type { SchematicLayerValue } from \"./canvas/layers.js\";\n\nconst stringEqual = equalFor(StringType);\nconst compareString = compareFor(StringType);\n\n/**\n * The viewer's layer choices, as the UI store holds them.\n *\n * @property shown - Each layer the viewer showed or hid, by its key: over its author's `visible`\n * @property locked - Each layer the viewer locked or unlocked, by its key: over its author's `locked`\n * @property isolated - The layer shown alone; `none` while none is\n */\nexport const SchematicLayerViewType = StructType({\n    shown: DictType(StringType, BooleanType),\n    locked: DictType(StringType, BooleanType),\n    isolated: OptionType(StringType),\n});\n\n/** The viewer's layer choices, decoded. */\nexport type SchematicLayerView = ValueTypeOf<typeof SchematicLayerViewType>;\n\n/** No choice yet: every layer as its author has it. */\nexport const NO_LAYER_VIEW: SchematicLayerView = { shown: new SortedMap([], compareString), locked: new SortedMap([], compareString), isolated: none };\n\nconst encodeView = encodeBeast2For(SchematicLayerViewType);\nconst decodeView = decodeBeast2For(SchematicLayerViewType);\n\n/**\n * Whether a layer shows now: the isolated one alone while one is, else the\n * viewer's choice, else its author's default — shown unless it says otherwise.\n *\n * @param layer - The layer\n * @param view - The viewer's choices\n * @returns Whether it shows\n */\nexport function layerShown(layer: SchematicLayerValue, view: SchematicLayerView): boolean {\n    const isolated = getSomeorUndefined(view.isolated);\n    if (isolated !== undefined) return stringEqual(isolated, layer.key);\n    return view.shown.get(layer.key) ?? getSomeorUndefined(layer.visible) ?? true;\n}\n\n/**\n * Whether a layer is locked now: the viewer's choice, else its author's\n * default — unlocked unless it says otherwise.\n *\n * @param layer - The layer\n * @param view - The viewer's choices\n * @returns Whether its entities never select\n */\nexport function layerLocked(layer: SchematicLayerValue, view: SchematicLayerView): boolean {\n    return view.locked.get(layer.key) ?? getSomeorUndefined(layer.locked) ?? false;\n}\n\n/**\n * The layers as the drawing obeys them: each one's `visible` and `locked` the\n * viewer's choices over its author's defaults (see the module docs).\n *\n * @param layers - The layers, in their order\n * @param view - The viewer's choices\n * @returns The layers, each as it shows and locks now; the layers themselves while the viewer has chosen nothing\n */\nexport function layersInForce(layers: readonly SchematicLayerValue[], view: SchematicLayerView): readonly SchematicLayerValue[] {\n    if (view.shown.size === 0 && view.locked.size === 0 && view.isolated.type === \"none\") return layers;\n    return layers.map((layer) => ({ ...layer, visible: some(layerShown(layer, view)), locked: some(layerLocked(layer, view)) }));\n}\n\n/**\n * Show or Hide: the layer flipped as it shows now, isolation counted, and the\n * isolation ended.\n *\n * @param layers - The layers\n * @param view - The viewer's choices\n * @param key - The layer's key\n * @returns The choices after it\n */\nexport function toggleShown(layers: readonly SchematicLayerValue[], view: SchematicLayerView, key: string): SchematicLayerView {\n    const layer = layers.find((l) => stringEqual(l.key, key));\n    if (layer === undefined) return view;\n    const shown = new SortedMap(view.shown, compareString);\n    // Ending an isolation shows every layer as its own choice has it: the isolated one, and the others.\n    shown.set(key, !layerShown(layer, view));\n    return { shown, locked: view.locked, isolated: none };\n}\n\n/**\n * Lock or unlock a layer, as it is locked now.\n *\n * @param layers - The layers\n * @param view - The viewer's choices\n * @param key - The layer's key\n * @returns The choices after it\n */\nexport function toggleLocked(layers: readonly SchematicLayerValue[], view: SchematicLayerView, key: string): SchematicLayerView {\n    const layer = layers.find((l) => stringEqual(l.key, key));\n    if (layer === undefined) return view;\n    const locked = new SortedMap(view.locked, compareString);\n    locked.set(key, !layerLocked(layer, view));\n    return { shown: view.shown, locked, isolated: view.isolated };\n}\n\n/**\n * Isolate a layer, or end its isolation.\n *\n * @param view - The viewer's choices\n * @param key - The layer's key\n * @returns The choices after it\n */\nexport function toggleIsolated(view: SchematicLayerView, key: string): SchematicLayerView {\n    const isolated = getSomeorUndefined(view.isolated);\n    return { shown: view.shown, locked: view.locked, isolated: isolated !== undefined && stringEqual(isolated, key) ? none : some(key) };\n}\n\n/**\n * Show all: every layer shown, the ones its author hides at first among them,\n * the isolation ended and the locks kept.\n *\n * @param layers - The layers\n * @param view - The viewer's choices\n * @returns The choices after it\n */\nexport function showAll(layers: readonly SchematicLayerValue[], view: SchematicLayerView): SchematicLayerView {\n    // A layer its author shows needs no choice; one its author hides is shown by one.\n    const shown = new SortedMap(layers.filter((layer) => getSomeorUndefined(layer.visible) === false).map((layer) => [layer.key, true] as const), compareString);\n    return { shown, locked: view.locked, isolated: none };\n}\n\n/**\n * Whether any layer is hidden now, isolation counted: what offers Show all.\n *\n * @param layers - The layers\n * @param view - The viewer's choices\n * @returns Whether one is\n */\nexport function anyHidden(layers: readonly SchematicLayerValue[], view: SchematicLayerView): boolean {\n    return layers.some((layer) => !layerShown(layer, view));\n}\n\n/**\n * The viewer's layer choices under a key, and the write that changes them —\n * every Schematic under that key follows it (see the module docs).\n *\n * @param key - The Schematic's layers key (`schematicKeys(id).layers`)\n * @returns What the store holds — no choice until the viewer makes one — and the write\n */\nexport function useSchematicLayerView(key: string): [SchematicLayerView, (next: SchematicLayerView) => void] {\n    const store = StateRuntime.getStore();\n    const subscribe = useCallback((notify: () => void) => store.subscribe(key, notify), [store, key]);\n    const snapshot = useCallback(() => store.read(key), [store, key]);\n    const bytes = useSyncExternalStore(subscribe, snapshot);\n    const view = useMemo((): SchematicLayerView => (bytes === undefined ? NO_LAYER_VIEW : decodeView(bytes)), [bytes]);\n    const write = useCallback((next: SchematicLayerView) => { store.write(key, encodeView(next)); }, [store, key]);\n    return [view, write];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The library's Index tab (#1389, `Schematic Builder Spec.md` §8): the zones\n * nested by containment and the items inside them — the drawing as the\n * canvas draws it, the drafts in place and a hidden layer's entities left\n * out — as a tree (`index-tree.ts`), each row the design system's tree row.\n *\n * - **One zone open at a time** — with every zone it is in, so its path\n *   shows: opening another closes it, as the navigator did before the frame\n *   (#1389). A zone's chevron opens or closes it; a click on its row flies to\n *   the zone and selects it, and opens it — or, open, closes it. Its count is\n *   the items it holds, its nested zones' among them.\n * - **It follows the view** — the zone the viewport is in is marked, opened\n *   and scrolled to the tree's top once the camera rests, never during a fly\n *   (#1570): a zone's row clicked keeps its zone open as the camera flies\n *   there, the zone the view left marked until it lands. A zone closed while\n *   the view is in it stays closed until the view moves on — to another zone,\n *   or to Fit — and at Fit, no zone in view, the zone the view opened closes.\n * - **The open zone's row sticks** at the tree's top while its items and the\n *   zones it holds scroll under it, until the next row past them pushes it out\n *   (`indexSections` over the shared rows' `sections`); a click on it closes\n *   it. Every row anchors the list, so rows landing or folding above the view\n *   never move what it shows (#1570).\n * - **It never opens empty** — a zone opened whose items of a kind read by\n *   area are not read yet leaves the tree as it was, busy, until they land,\n *   then opens with them in one commit; a read that fails holds it no longer\n *   (#1570).\n * - **An item's row** — its dot in its colour, its status's where it has one\n *   (for a kind read by area, from its details, read beside it), its label and\n *   its figure; a click flies to the item and selects it. An entity on a\n *   locked layer is flown to and never selected (SC27): the canvas decides.\n * - **The search** keeps the items whose label, key or kind's name holds it,\n *   under their zones, opened: the tab's own, never the rail's.\n * - **A kind read by area** (#1393, D52) holds only its window, so the tab\n *   reads its items itself, in a component of its own (`index-area.ts`): an\n *   open zone's by the zone's box, and the search's through the kind's\n *   source's `search` fields, its first matches listed and how many more said\n *   under the tree. A zone holding such items counts them once its box is\n *   read, and one holding more than a window reads says so. What it read is\n *   as the record stores it, so the drafts are laid over it, as the canvas\n *   draws them: a row a draft holds is listed where its draft has it — moved,\n *   under the zone it now stands in — a row a gesture made is listed in its\n *   zone, and the search finds it as it finds a kind read whole's, and a row\n *   a draft deletes or unplaces is listed nowhere. Its items in no zone are the\n *   search's and the Backlog's alone. A row a Save landed is listed as the\n *   canvas draws it too, until the tab has read its kind since: the tab tells\n *   its host the revision it read each kind at (`onRead`).\n * - **The keys** — the tree is one tab stop, pointing at its active row\n *   (`aria-activedescendant`, as the Sheet's grid does): ↑ and ↓ move between\n *   the rows, Home and End to the first and the last, → opens a zone or goes\n *   into it, ← closes it or goes up to its zone, and Enter or Space does a\n *   row's click — each move bringing its row into view, and each key the\n *   tree acts on going no further than the Schematic (#1398).\n *\n * The rows are the shared virtual rows (`VirtualRows`): only those in view are\n * mounted, however many the drawing holds, and each says where it stands among\n * the rows beside it. Every style is the `schematic` recipe's; the search box\n * and the empty state are the Library's.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type KeyboardEvent, type MouseEvent } from \"react\";\nimport { Box, chakra, useSlotRecipe } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faAngleRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { SCHEMATIC_WINDOW_READ_ROWS } from \"@elaraai/e3-ui/internal\";\nimport { getSomeorUndefined, takeKey, useSlicesReactivity, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { LibraryEmptyState, LibrarySearchBox, SEARCH_DELAY_MS, VirtualRows } from \"@elaraai/east-ui-components/internal\";\nimport { READING } from \"./area.js\";\nimport type { DrawnItem, DrawnZone } from \"./canvas/drawn.js\";\nimport { buildNavTree } from \"./canvas/model.js\";\nimport { itemTint, tintAttributes } from \"./canvas/tints.js\";\nimport { NO_INDEX_AREA, type IndexAreaKind, type IndexAreaRead, type SchematicIndexArea } from \"./index-area.js\";\nimport { indexRows, indexSearchHolds, indexSections, type IndexRow } from \"./index-tree.js\";\nimport type { SchematicWords } from \"./messages.js\";\n\n/** The recipe's slots, as the shared virtual rows take their root's: the Roster's and the Allocation's are typed so too. */\ntype Styles = Record<string, Record<string, unknown>>;\n\nconst stringEqual = equalFor(StringType);\n\n/** A row's key: its entity's id on the canvas. */\nconst rowKey = (row: IndexRow): string => (row.kind === \"zone\" ? row.zone.key : row.item.key);\n\n/** A row's indent, its geometry: the recipe lays it out 24px a level. */\nconst depthStyle = (depth: number): CSSProperties => ({ \"--index-depth\": String(depth) }) as CSSProperties;\n\n/** A row's height until it is measured: the design system's tree row (a touch screen's taller row is measured). */\nconst ROW_ESTIMATE = 36;\n\n/** A chevron's press keeps the focus where it is: on the tree, which points at its rows. */\nconst keepFocus = (e: MouseEvent) => e.preventDefault();\n\n/** Every row anchors the list: rows landing or folding above the view never move what it shows (#1570). */\nconst ANCHOR_EVERY_ROW = () => true;\n\n/**\n * A zone and every zone it is in, by key.\n *\n * @param tree - The zones nested by containment: each zone's parent, by key\n * @param zone - The zone, by key; `undefined` for none\n * @returns The path, the zone first; empty for none\n */\nfunction pathOf(tree: { readonly parentOf: ReadonlyMap<string, string> }, zone: string | undefined): ReadonlySet<string> {\n    const path = new Set<string>();\n    for (let at = zone; at !== undefined; at = tree.parentOf.get(at)) path.add(at);\n    return path;\n}\n\n/** The item kinds read by area, as the Index reads them (#1393, D52). */\nexport interface SchematicIndexAreaProps {\n    /** The kinds, each with its source of the slice and its area indexes. */\n    readonly kinds: readonly IndexAreaKind[];\n    /** Its reads, kept across renders. */\n    readonly reader: SchematicIndexArea;\n    /** The layers hidden, by key: the Index lists none of the items on them. */\n    readonly hiddenLayers: ReadonlySet<string>;\n    /**\n     * The rows of those kinds a draft holds, by id: each is listed as the canvas draws it — moved, edited or made — never\n     * as its record stores it, and none a draft deletes or unplaces.\n     */\n    readonly drafted: ReadonlySet<string>;\n    /** Of them, those a gesture made: no source holds them, so the search finds them as it finds a kind read whole's. */\n    readonly created: ReadonlySet<string>;\n    /**\n     * Hears the revision the tab read each of those kinds at, by slot, as it moves — none once the tab is gone: what a\n     * Save landed of a kind is drawn until the tab has read it since (`drafted.ts`' `landedRead`).\n     */\n    readonly onRead?: ((revisions: ReadonlyMap<string, string>) => void) | undefined;\n}\n\n/** Props of {@link SchematicIndexTab}. */\nexport interface SchematicIndexTabProps {\n    /** The zones the canvas draws: a hidden layer's left out. */\n    readonly zones: readonly DrawnZone[];\n    /** The items the canvas draws: a hidden layer's left out. */\n    readonly items: readonly DrawnItem[];\n    /** An item kind's name, by its slot: what the search reads beside an item's label and key. */\n    readonly kindName: (slot: string) => string;\n    /** The zone the viewport is in, by its id; `undefined` for none. */\n    readonly inView: string | undefined;\n    /** What the canvas has selected, by id: its rows are marked. */\n    readonly selected: ReadonlySet<string>;\n    /** Flies to an item or a zone, by its id, and selects it. */\n    readonly onReveal: (id: string) => void;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /** The item kinds read by area, which the tab reads itself; `undefined` with none. */\n    readonly area?: SchematicIndexAreaProps | undefined;\n}\n\n/** No kind read by the tab: what it tells its host once it is gone. */\nconst NO_REVISIONS: ReadonlyMap<string, string> = new Map();\n\n/**\n * The Index's reads of the item kinds read by area (#1393, D52), in a\n * component of its own: each page and each count that lands re-runs it alone,\n * and it hands the tab what it read only as that moves — its last standing\n * while a read is in flight.\n *\n * @param props - The kinds, the zones open, the search as it reads, where what it read goes, and whom a failed read is told\n * @returns Nothing: it reads\n */\nfunction IndexAreaReader({ area, open, query, onRead, onFailed }: {\n    readonly area: SchematicIndexAreaProps; readonly open: readonly DrawnZone[]; readonly query: string; readonly onRead: (read: IndexAreaRead) => void;\n    readonly onFailed: () => void;\n}): null {\n    const parts = useMemo(() => area.kinds.map((kind) => kind.part.key), [area.kinds]);\n    useSlicesReactivity(parts);\n    const read = useCallback(() => area.reader.read(area.kinds, open, query), [area, open, query]);\n    const { result } = useTrackedEvaluation(read);\n    const got = result.ok && result.value !== READING ? result.value : undefined;\n    useEffect(() => { if (got !== undefined) onRead(got); }, [got, onRead]);\n    // A read that fails holds the tree no longer: the zone opened shows what is read of it (#1570).\n    const failed = !result.ok;\n    useEffect(() => { if (failed) onFailed(); }, [failed, onFailed]);\n    return null;\n}\n\n/**\n * The Index tab's body — see the module docs.\n *\n * @param props - The zones and items drawn, the kinds' names, the zone in view, the selection, what a row's click does and the words\n * @returns The tab's body: its search over its tree\n */\nexport function SchematicIndexTab({ zones, items, kindName, inView, selected, onReveal, words, area }: SchematicIndexTabProps) {\n    const styles = useSlotRecipe({ key: \"schematic\" })() as unknown as Styles;\n    const library = useSlotRecipe({ key: \"library\" })() as unknown as Styles;\n    const m = words.m;\n    const treeId = useId();\n    // The one zone open, every zone it is in open with it: a chain, never two.\n    const [openZone, setOpenZone] = useState<string | undefined>(undefined);\n    // The zone the tree shows open while the one opened is read — the last it showed (#1570) — and the zone opened whose\n    // read failed, which the tree shows as it is read.\n    const [heldZone, setHeldZone] = useState<string | undefined>(undefined);\n    const [failedZone, setFailedZone] = useState<string | undefined>(undefined);\n    // A zone the viewer closed: the view opens it again only once it has moved on — to another zone, or to Fit.\n    const closedRef = useRef<string | undefined>(undefined);\n    // The zone the view opened: Fit, no zone in view, closes it (#1570).\n    const viewOpenedRef = useRef<string | undefined>(undefined);\n    const [query, setQuery] = useState(\"\");\n    const searchRef = useRef<HTMLInputElement | null>(null);\n    // The kinds read by area (#1393, D52): read by the tab — the open zones' items, or the search's, a pause after its\n    // last keystroke — in place of their window's.\n    const areaSlots = useMemo(() => new Set(area?.kinds.map((kind) => kind.kind.key) ?? []), [area]);\n    const [areaRead, setAreaRead] = useState<IndexAreaRead>(NO_INDEX_AREA);\n    const onAreaRead = useCallback((read: IndexAreaRead) => {\n        setAreaRead(read);\n        setFailedZone(undefined);\n    }, []);\n    const onAreaFailed = useCallback(() => setFailedZone(openZone), [openZone]);\n    // The revision the tab's items were read at, kind by kind: a Save's rows are listed as landed until it moves past it.\n    const onRevisions = area?.onRead;\n    const revisions = areaRead.revisions;\n    useEffect(() => { onRevisions?.(revisions); }, [onRevisions, revisions]);\n    useEffect(() => () => onRevisions?.(NO_REVISIONS), [onRevisions]);\n    const [areaQuery, setAreaQuery] = useState(\"\");\n    useEffect(() => {\n        const text = query.trim();\n        if (text === \"\") { setAreaQuery(\"\"); return undefined; }\n        const timer = setTimeout(() => setAreaQuery(text), SEARCH_DELAY_MS);\n        return () => clearTimeout(timer);\n    }, [query]);\n    const searching = query.trim() !== \"\";\n    const locale = words.locale;\n    const listed = useMemo(() => {\n        if (area === undefined) return items;\n        // What the tab read of the kinds read by area, as their records store them — but a row a draft holds, listed as the\n        // canvas draws it: moved or edited, a stored row the search found; made, one the search holds as a kind read whole's.\n        const read = areaRead.items.filter((item) => {\n            const layer = getSomeorUndefined(item.layer);\n            return !area.drafted.has(item.key) && (layer === undefined || !area.hiddenLayers.has(layer));\n        });\n        const found = new Set(areaRead.items.map((item) => item.key));\n        const drafted = items.filter((item) => areaSlots.has(item.ref.kind) && area.drafted.has(item.key)\n            && (!searching || found.has(item.key) || (area.created.has(item.key) && indexSearchHolds(item, query, kindName, locale))));\n        return [...items.filter((item) => !areaSlots.has(item.ref.kind)), ...read, ...drafted];\n    }, [area, items, areaSlots, areaRead, searching, query, kindName, locale]);\n    const tree = useMemo(() => {\n        const built = buildNavTree(zones, listed);\n        // A kind read by area's items in no zone are the search's and the Backlog's alone (D52).\n        return area === undefined || searching ? built : { ...built, floor: built.floor.filter((item) => !areaSlots.has(item.ref.kind)) };\n    }, [zones, listed, area, searching, areaSlots]);\n    // The zone opened and every zone it is in: what the tab reads of the kinds read by area.\n    const wanted = useMemo(() => pathOf(tree, openZone), [tree, openZone]);\n    const wantedZones = useMemo(() => zones.filter((zone) => wanted.has(zone.key)), [zones, wanted]);\n    // The tree opens it once what it lists of those kinds is read — each zone of its path read, or too full to list them —\n    // so it never opens empty: until then it shows the zone it showed, busy (#1570).\n    const settled = area === undefined || searching || openZone === undefined\n        || (failedZone !== undefined && stringEqual(failedZone, openZone))\n        || [...wanted].every((key) => areaRead.read.has(key) || areaRead.crowded.has(key));\n    const displayed = settled ? openZone : heldZone;\n    useLayoutEffect(() => { if (settled) setHeldZone(openZone); }, [settled, openZone]);\n    // The zone shown open and every zone it is in.\n    const open = useMemo(() => pathOf(tree, displayed), [tree, displayed]);\n    const openZones = useMemo(() => zones.filter((zone) => open.has(zone.key)), [zones, open]);\n    // A zone holding items of a kind read by area counts them once its box — or an enclosing zone's — is read.\n    const whole = useMemo(() => (area === undefined ? undefined : (key: string) => {\n        for (let at: string | undefined = key; at !== undefined; at = tree.parentOf.get(at)) if (areaRead.read.has(at)) return true;\n        return false;\n    }), [area, tree, areaRead]);\n    const rows = useMemo(() => indexRows(tree, open, query, kindName, words.locale, { searched: areaSlots, whole }),\n        [tree, open, query, kindName, words.locale, areaSlots, whole]);\n    // The open zone's row heads the rows under it, sticking at the tree's top while they scroll (#1570); none while\n    // searching, which opens every zone it keeps.\n    const sections = useMemo(() => indexSections(rows, searching ? undefined : displayed), [rows, searching, displayed]);\n    // What the tree can't hold: the open zones too full to list a kind read by area's items, and the matches past those listed.\n    const notes = useMemo(() => {\n        const out: string[] = [];\n        if (area === undefined) return out;\n        const noun = area.kinds.length === 1 ? area.kinds[0]!.kind.name.toLocaleLowerCase(words.locale) : m.libraryNoun({ tab: \"backlog\", n: 1 });\n        for (const zone of openZones) {\n            if (!areaRead.crowded.has(zone.key)) continue;\n            out.push(m.indexCrowded({ zone: zone.label, name: noun, n: SCHEMATIC_WINDOW_READ_ROWS, count: words.number(SCHEMATIC_WINDOW_READ_ROWS) }));\n        }\n        if (query.trim() !== \"\" && areaRead.more > 0) out.push(m.indexMore({ n: areaRead.more, count: words.number(areaRead.more) }));\n        return out;\n    }, [area, openZones, areaRead, query, m, words]);\n    // The active row, the one the tree points at: the one last moved to or clicked while it is listed, else the first.\n    const [active, setActive] = useState<string | undefined>(undefined);\n    const found = active === undefined ? -1 : rows.findIndex((row) => stringEqual(rowKey(row), active));\n    const activeIndex = found >= 0 ? found : rows.length > 0 ? 0 : undefined;\n    // A key's move brings its row into view, the least distance; the view's zone, to the tree's top: a request for each.\n    const [shown, setShown] = useState<{ index: number; nonce: number; align: \"auto\" | \"start\" } | undefined>(undefined);\n    const rowId = useCallback((index: number) => `${treeId}-row-${index}`, [treeId]);\n\n    // Opening a zone closes the one open before, but for the zones it is in; closing one leaves the zone it is in open.\n    const setZone = useCallback((key: string, next: boolean) => {\n        if (next) {\n            closedRef.current = undefined;\n            setOpenZone(key);\n            return;\n        }\n        closedRef.current = key;\n        setOpenZone(tree.parentOf.get(key));\n    }, [tree]);\n    // The view's zone, told once the camera rests (#1570): opened and brought to the tree's top, unless the viewer closed it\n    // while the view was in it. With none in view — at Fit — the zone the view opened closes, and one the viewer closed\n    // opens again once the view comes back to it.\n    const [followed, setFollowed] = useState<{ key: string; nonce: number } | undefined>(undefined);\n    useEffect(() => {\n        if (inView === undefined) {\n            closedRef.current = undefined;\n            const opened = viewOpenedRef.current;\n            viewOpenedRef.current = undefined;\n            if (opened !== undefined) setOpenZone((was) => (was !== undefined && stringEqual(was, opened) ? undefined : was));\n            return;\n        }\n        if (closedRef.current !== undefined) {\n            if (stringEqual(closedRef.current, inView)) return;\n            closedRef.current = undefined;\n        }\n        viewOpenedRef.current = inView;\n        setOpenZone(inView);\n        setFollowed((was) => ({ key: inView, nonce: (was?.nonce ?? 0) + 1 }));\n    }, [inView]);\n    // A row's click: a zone flies, is selected and opens — or closes, open; an item flies and is selected.\n    const activate = useCallback((row: IndexRow) => {\n        setActive(rowKey(row));\n        if (row.kind === \"zone\") setZone(row.zone.key, !row.open || query.trim() !== \"\");\n        onReveal(rowKey(row));\n    }, [setZone, onReveal, query]);\n    const moveTo = useCallback((index: number) => {\n        const row = rows[index];\n        if (row === undefined) return;\n        setActive(rowKey(row));\n        setShown((was) => ({ index, nonce: (was?.nonce ?? 0) + 1, align: \"auto\" }));\n    }, [rows]);\n    // Each key the tree acts on goes no further than the Schematic (#1398).\n    const onKeyDown = useCallback((e: KeyboardEvent<HTMLDivElement>) => {\n        if (activeIndex === undefined) return;\n        const row = rows[activeIndex]!;\n        const go = (to: number) => {\n            if (rows[to] === undefined) return;\n            takeKey(e);\n            moveTo(to);\n        };\n        if (e.key === \"ArrowDown\") go(activeIndex + 1);\n        else if (e.key === \"ArrowUp\") go(activeIndex - 1);\n        else if (e.key === \"Home\") go(0);\n        else if (e.key === \"End\") go(rows.length - 1);\n        else if (e.key === \"ArrowRight\" && row.kind === \"zone\" && row.branch) {\n            takeKey(e);\n            if (!row.open) setZone(row.zone.key, true); else go(activeIndex + 1);\n        } else if (e.key === \"ArrowLeft\") {\n            takeKey(e);\n            if (row.kind === \"zone\" && row.open && row.branch && query === \"\") { setZone(row.zone.key, false); return; }\n            // Up to the zone it is in: the nearest row above, one level up.\n            for (let i = activeIndex - 1; i >= 0; i--) {\n                const above = rows[i]!;\n                if (above.kind === \"zone\" && above.depth < row.depth) { moveTo(i); return; }\n            }\n        } else if (e.key === \"Enter\" || e.key === \" \") {\n            takeKey(e);\n            activate(row);\n        }\n    }, [rows, activeIndex, moveTo, setZone, activate, query]);\n    const getItemKey = useCallback((index: number) => rowKey(rows[index]!), [rows]);\n    // The view's zone brought to the tree's top once the tree shows it open — its items read — in the commit that opens it,\n    // so no frame paints it opened where the list stood (#1570); once each time the view comes to it, so the rows moving\n    // after never pull the list back from where the viewer scrolled it.\n    const scrolledRef = useRef(0);\n    useLayoutEffect(() => {\n        if (followed === undefined || scrolledRef.current === followed.nonce) return;\n        if (displayed === undefined || !stringEqual(displayed, followed.key)) return;\n        const index = rows.findIndex((row) => row.kind === \"zone\" && stringEqual(row.zone.key, followed.key));\n        if (index < 0) return;\n        scrolledRef.current = followed.nonce;\n        setShown((was) => ({ index, nonce: (was?.nonce ?? 0) + 1, align: \"start\" }));\n    }, [followed, rows, displayed]);\n\n    const renderRow = (index: number) => {\n        const row = rows[index]!;\n        const key = rowKey(row);\n        const common = {\n            id: rowId(index),\n            role: \"treeitem\",\n            \"aria-level\": row.depth + 1,\n            \"aria-posinset\": row.position,\n            \"aria-setsize\": row.siblings,\n            \"data-index-key\": key,\n            onClick: () => activate(row),\n            style: depthStyle(row.depth),\n            ...(index === activeIndex ? { \"data-active\": \"\" } : {}),\n            ...(selected.has(key) ? { \"data-selected\": \"\", \"aria-selected\": true } : { \"aria-selected\": false }),\n        } as const;\n        if (row.kind === \"zone\") {\n            const current = inView !== undefined && stringEqual(inView, key);\n            return (\n                <Box css={styles.indexRow} {...common} data-index-zone=\"\" aria-expanded={row.branch ? row.open : undefined}\n                    {...(current ? { \"data-current\": \"\", \"aria-current\": \"location\" } : {})}>\n                    {/* The pointer's way to open it; the keys' is → and ←. */}\n                    <chakra.button type=\"button\" css={styles.indexChevron} tabIndex={-1} aria-hidden=\"true\" title={m.indexToggle({ zone: row.zone.label, open: row.open })}\n                        {...(row.open ? { \"data-open\": \"\" } : {})} {...(row.branch ? {} : { \"data-leaf\": \"\" })}\n                        onMouseDown={keepFocus}\n                        onClick={(e: MouseEvent) => { e.stopPropagation(); setActive(key); setZone(row.zone.key, !row.open); }}>\n                        <FontAwesomeIcon icon={faAngleRight} />\n                    </chakra.button>\n                    <Box as=\"span\" css={styles.indexName} data-index-name=\"\">{row.zone.label}</Box>\n                    {row.count !== undefined && row.count > 0 && (\n                        <Box as=\"span\" css={styles.indexCount} data-index-count=\"\" aria-label={m.indexCount({ n: row.count, count: words.number(row.count) })}>{words.number(row.count)}</Box>\n                    )}\n                </Box>\n            );\n        }\n        const metric = getSomeorUndefined(row.item.metric);\n        const status = getSomeorUndefined(row.item.status);\n        return (\n            <Box css={styles.indexRow} {...common} data-index-item=\"\">\n                <Box as=\"span\" css={styles.indexChevron} data-leaf=\"\" aria-hidden=\"true\" />\n                <Box as=\"span\" css={styles.indexDot} data-index-dot=\"\" {...tintAttributes(itemTint(row.item))} {...(status?.ring === true ? { \"data-ring\": \"\" } : {})} aria-hidden=\"true\" />\n                <Box as=\"span\" css={styles.indexName} data-index-name=\"\">{row.item.label}</Box>\n                {metric !== undefined && <Box as=\"span\" css={styles.indexMetric} data-index-metric=\"\">{metric}</Box>}\n            </Box>\n        );\n    };\n\n    const reader = area === undefined ? null : <IndexAreaReader area={area} open={wantedZones} query={areaQuery} onRead={onAreaRead} onFailed={onAreaFailed} />;\n    if (zones.length === 0 && items.length === 0 && area === undefined) {\n        return <Box css={styles.indexEmpty}><LibraryEmptyState said={{ title: m.libraryEmpty({ tab: \"index\", name: \"\" }), description: m.libraryEmptyHint({ tab: \"index\", name: \"\" }) }} onClear={undefined} /></Box>;\n    }\n    return (\n        <>\n            {reader}\n            <Box css={styles.indexSearch}>\n                <LibrarySearchBox size=\"mid\" inputRef={searchRef} query={query} onQuery={setQuery} placeholder={m.indexSearch()} label={m.indexSearch()} />\n            </Box>\n            {rows.length === 0 ? (\n                <Box css={styles.indexEmpty}><LibraryEmptyState said={{ title: m.indexNoMatch({ query: query.trim() }) }} onClear={undefined} /></Box>\n            ) : (\n                // The tree takes the focus around its rows' scroll box, never inside it: a focus — the keyboard's, or one a\n                // menu hands back — scrolls nothing of the rows.\n                <Box css={styles.indexTree} role=\"tree\" aria-label={m.libraryTab({ tab: \"index\" })} tabIndex={0} onKeyDown={onKeyDown}\n                    {...(activeIndex === undefined ? {} : { \"aria-activedescendant\": rowId(activeIndex) })} {...(settled ? {} : { \"aria-busy\": true })}>\n                    <VirtualRows fillParent height={undefined} maxHeight={undefined} rootCss={styles.indexRows}\n                        count={rows.length} getItemKey={getItemKey} estimateSize={() => ROW_ESTIMATE} anchorable={ANCHOR_EVERY_ROW} sections={sections}\n                        scrollToIndex={shown?.index} scrollNonce={shown?.nonce} scrollAlign={shown?.align ?? \"auto\"} renderRow={renderRow} />\n                </Box>\n            )}\n            {notes.length > 0 && (\n                <Box css={library.footer} data-index-notes=\"\">\n                    {notes.map((note) => <Box key={note} as=\"span\" css={library.hiddenNote} data-index-note=\"\">{note}</Box>)}\n                </Box>\n            )}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The library's Layers tab (#1389, `Schematic Builder Spec.md` §8, SC27): each\n * layer `Schematic.layers` reads from the app's record, in its order — its\n * swatch, in its colour token, else its tone; its name; how many entities it\n * holds — with Isolate, Lock and Show or Hide, each a toggle that says\n * whether it is on, and Show all under the rows while a layer is hidden. The\n * viewer's choices are view settings (`layers-view.ts`), kept under the\n * Schematic's `id`: a hidden layer's entities never draw, and a locked one's\n * never select.\n *\n * Each row is the design system's pick-panel row — 44 at least, a hairline\n * between — and a hidden layer's reads in the faint ink, never by opacity.\n * Every icon is Font Awesome's solid set, and every style the `schematic`\n * recipe's.\n *\n * @packageDocumentation\n */\n\nimport { Box, Button, chakra, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faBullseye, faEye, faEyeSlash, faLock, faLockOpen } from \"@fortawesome/free-solid-svg-icons\";\nimport { StringType, equalFor } from \"@elaraai/east\";\nimport { getSomeorUndefined } from \"@elaraai/east-ui-components\";\nimport { LibraryEmptyState } from \"@elaraai/east-ui-components/internal\";\nimport type { SchematicLayerValue } from \"./canvas/layers.js\";\nimport { layerTint, tintAttributes } from \"./canvas/tints.js\";\nimport {\n    anyHidden, layerLocked, layerShown, showAll, toggleIsolated, toggleLocked, toggleShown, type SchematicLayerView,\n} from \"./layers-view.js\";\nimport type { SchematicWords } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\nconst stringEqual = equalFor(StringType);\n\n/** Props of {@link SchematicLayersTab}. */\nexport interface SchematicLayersTabProps {\n    /** The layers, in their order, with their author defaults. */\n    readonly layers: readonly SchematicLayerValue[];\n    /** The viewer's choices. */\n    readonly view: SchematicLayerView;\n    /** Writes the viewer's choices. */\n    readonly onView: (next: SchematicLayerView) => void;\n    /** How many entities each layer holds, by its key. */\n    readonly counts: ReadonlyMap<string, number>;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n}\n\n/**\n * The Layers tab's body — see the module docs.\n *\n * @param props - The layers, the viewer's choices and their write, each layer's count, and the words\n * @returns The tab's body: its rows, and Show all while a layer is hidden\n */\nexport function SchematicLayersTab({ layers, view, onView, counts, words }: SchematicLayersTabProps) {\n    const styles = useSlotRecipe({ key: \"schematic\" })() as Styles;\n    const m = words.m;\n    if (layers.length === 0) {\n        return <LibraryEmptyState said={{ title: m.libraryEmpty({ tab: \"layers\", name: \"\" }), description: m.libraryEmptyHint({ tab: \"layers\", name: \"\" }) }} onClear={undefined} />;\n    }\n    const isolated = getSomeorUndefined(view.isolated);\n    return (\n        <>\n            <Box css={styles.layerList} role=\"list\" aria-label={m.libraryTab({ tab: \"layers\" })} data-schematic-layers=\"\">\n                {layers.map((layer) => {\n                    const shown = layerShown(layer, view);\n                    const locked = layerLocked(layer, view);\n                    const alone = isolated !== undefined && stringEqual(isolated, layer.key);\n                    const n = counts.get(layer.key) ?? 0;\n                    return (\n                        <Box key={layer.key} css={styles.layerRow} role=\"listitem\" data-schematic-layer={layer.key} {...(shown ? {} : { \"data-hidden\": \"\" })}>\n                            <Box as=\"span\" css={styles.layerSwatch} {...tintAttributes(layerTint(layer))} aria-hidden=\"true\" />\n                            <Box as=\"span\" css={styles.layerName}>{layer.label}</Box>\n                            <Box as=\"span\" css={styles.layerCount} aria-label={m.layerCount({ n, count: words.number(n) })}>{words.number(n)}</Box>\n                            <Box as=\"span\" css={styles.layerToggles}>\n                                <chakra.button type=\"button\" css={styles.layerToggle} data-layer-toggle=\"isolate\" aria-pressed={alone} {...(alone ? { \"data-on\": \"\" } : {})}\n                                    aria-label={m.layerIsolate({ layer: layer.label, isolated: alone })} title={m.layerIsolate({ layer: layer.label, isolated: alone })}\n                                    onClick={() => onView(toggleIsolated(view, layer.key))}>\n                                    <FontAwesomeIcon icon={faBullseye} />\n                                </chakra.button>\n                                <chakra.button type=\"button\" css={styles.layerToggle} data-layer-toggle=\"lock\" aria-pressed={locked} {...(locked ? { \"data-on\": \"\" } : {})}\n                                    aria-label={m.layerLock({ layer: layer.label, locked })} title={m.layerLock({ layer: layer.label, locked })}\n                                    onClick={() => onView(toggleLocked(layers, view, layer.key))}>\n                                    <FontAwesomeIcon icon={locked ? faLock : faLockOpen} />\n                                </chakra.button>\n                                <chakra.button type=\"button\" css={styles.layerToggle} data-layer-toggle=\"show\" aria-pressed={shown} {...(shown ? { \"data-on\": \"\" } : {})}\n                                    aria-label={m.layerShow({ layer: layer.label, shown })} title={m.layerShow({ layer: layer.label, shown })}\n                                    onClick={() => onView(toggleShown(layers, view, layer.key))}>\n                                    <FontAwesomeIcon icon={shown ? faEye : faEyeSlash} />\n                                </chakra.button>\n                            </Box>\n                        </Box>\n                    );\n                })}\n            </Box>\n            {anyHidden(layers, view) && (\n                <Box css={styles.layerFoot}>\n                    <Button size=\"xs\" variant=\"outline\" data-layers-show-all=\"\" onClick={() => onView(showAll(layers, view))}>{m.layersShowAll()}</Button>\n                </Box>\n            )}\n        </>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The library pane (#1389, `Schematic Builder Spec.md` §8, SC4, SC27): the\n * Schematic's start pane, its tabs the ones `library` lists, in that order,\n * each with its count after its name. A Schematic whose `library` lists no\n * tab has no pane. Like the Calendar's and the Plan's, each covers every kind\n * (D33):\n *\n * - **Templates** (`Schematic.library.templates()`) — every kind's templates,\n *   item, link and net kinds alike, each card its template's name over its\n *   kind's — an item kind's that adds no item (#1549), its keys of a type the\n *   form can't type, over why, neither dragged nor dropped — grouped by its\n *   kind and then its template's `group`; each kind's\n *   list follows the source of the rail its templates record names\n *   (`sourcesTab`), counting what it shows (`3 of 5`) and saying so, with\n *   Clear filters, when the rail leaves it none.\n * - **Backlog** (`Schematic.library.backlog()`) — every item kind's rows with\n *   no position, with the drafts in place (`backlog.ts`), each card its\n *   label, its kind's name and its second line, and its status's dot, grouped\n *   by its kind. A kind read through its source lists the rows its narrowing\n *   holds; while the rail narrows one, an emptied tab says so with Clear\n *   filters. Beside a kind read by area (#1393, D51), it is one paged list\n *   (`PagedLibrary` over `backlog-pages.ts`): the rows in hand, then each such\n *   kind's, a page at a time through its area index's unplaced clause, a row\n *   its narrowing leaves out, or a draft placed or deleted, drawn as context;\n *   it counts `N of M` while an index the narrowing leads narrows it.\n * - **Index** (`Schematic.library.index()`) — the zones nested by containment\n *   and the items inside them (`index-tab.tsx`); a kind read by area's read by\n *   the tab itself, an open zone's by its box and the search's through the\n *   kind's source (#1393, D52).\n * - **Layers** (`Schematic.library.layers()`) — each layer, with Isolate, Lock\n *   and Show or Hide, and Show all (`layers-tab.tsx`).\n * - **An author's tab** (`Schematic.library.tab(rows, …)`) — its cards, each\n *   its label and its meta, grouped by its `group`, following the source it\n *   names (`sourceTab`).\n *\n * Each card tab is a `Library` — its search finds within the tab alone, and\n * only the cards in view are mounted, as the Roster's and the Allocation's\n * are — whose cards are keyed as the canvas names what they are: a template's and a\n * backlog row's by its kind's slot and its key, as East prints a\n * `Schematic.Types.Ref`; an author's by its row's key. A click selects a card,\n * and a click on the selected card lets it go: the template selected is what\n * a Connect's new link or net takes its fields from (§4.3). The frame keeps\n * which card each tab has selected.\n *\n * Each card that drops is a drag source (#1390): every template, every\n * backlog row, and an author's tab's cards when its patch names a kind. They\n * drag from the libraries `${schematicKeys(id).library}:<the tab's key>`\n * ({@link schematicLibraryId}), which the canvas takes drops from\n * (`use-drop.ts`). A card that drops takes ⏎ too — dropped on the selection,\n * or at the view's centre — and on a touch screen a tap on the selected card\n * does the same, so no drop needs a precise drag (SC13); the tap leaves it\n * selected, for the next. Below 480px of main (#1394, D15) no card drags, and\n * a tap on the selected card drops it whatever the pointer. While a tab's\n * source reads again its cards are retained (#1398, CL8): aria-disabled,\n * selectable, and taking no drag, ⏎ or tap that drops.\n *\n * The pane is the frame's start pane, 272px open, its open tab and its\n * collapsed state kept under the Schematic's `id`; collapsed, its rail counts\n * the backlog — or, with no Backlog tab, the first tab's cards.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useEffect, useMemo, type ReactNode } from \"react\";\nimport { Box, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { StringType, equalFor, none, some } from \"@elaraai/east\";\nimport type { schematicKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    EastChakraLibrary, getSomeorUndefined, useCoarsePointer, useSlicesReactivity, useTrackedEvaluation,\n    type BuilderFrameDock, type LibraryEmpty, type LibraryItemValue, type LibraryNarrowing, type LibraryValue,\n} from \"@elaraai/east-ui-components\";\nimport { PagedLibrary, narrowedCount } from \"@elaraai/east-ui-components/internal\";\nimport { scheduleLibrary, scheduleLibraryCard } from \"../shared/schedule/library.js\";\nimport type { FollowedSources } from \"../shared/schedule/follow-sources.js\";\nimport { sourceTab, sourcesTab, type SourceShown, type SourceTab } from \"../shared/schedule/source-tab.js\";\nimport type { BacklogEntry } from \"./backlog.js\";\nimport type { BacklogPageCount, BacklogPageRow, SchematicBacklogPages } from \"./backlog-pages.js\";\nimport { entityId, refOfId, type DrawnItem, type DrawnZone } from \"./canvas/drawn.js\";\nimport type { SchematicLayerValue } from \"./canvas/layers.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport { SchematicIndexTab, type SchematicIndexAreaProps } from \"./index-tab.js\";\nimport type { SchematicLayerView } from \"./layers-view.js\";\nimport { SchematicLayersTab } from \"./layers-tab.js\";\nimport type { SchematicLibraryTabWord, SchematicWords } from \"./messages.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/** The names a Schematic keeps its viewer's state under. */\ntype SchematicKeys = ReturnType<typeof schematicKeys>;\n/** One tab the payload lists, decoded. */\ntype SchematicTabValue = SchematicValue[\"library\"][number];\n/** An author's tab, decoded. */\ntype AuthorTabValue = Extract<SchematicTabValue, { type: \"tab\" }>[\"value\"];\n/** One card of an author's tab. */\ntype AuthorCardValue = AuthorTabValue[\"cards\"][number];\n/** A kind that may have templates: an item, link or net kind. */\ntype TemplatesKind = SchematicValue[\"items\"][number] | SchematicValue[\"links\"][number] | SchematicValue[\"nets\"][number];\n/** A template, decoded. */\ntype TemplateValue = TemplatesKind[\"templates\"][number];\n\n/** One template's card: its kind, and the template. */\ninterface TemplateEntry {\n    readonly kind: TemplatesKind;\n    readonly template: TemplateValue;\n}\n\nconst stringEqual = equalFor(StringType);\n\n/** The library open: the Calendar's and the Plan's 272px (§8). */\nconst LIBRARY_SIZE = \"272px\";\n\n/** What a tab that follows no source shows: its cards whole. */\nconst WHOLE: SourceShown = { keys: none, busy: false, ready: true, clear: undefined };\n\n/**\n * A tab's key among the pane's tabs — and, after the Schematic's library id,\n * its cards' library's: `templates`, `backlog`, `index`, `layers`, or\n * `tab:<its name>`.\n *\n * @param tab - The tab\n * @returns Its key\n */\nexport function schematicTabKey(tab: SchematicTabValue): string {\n    return tab.type === \"tab\" ? `tab:${tab.value.name}` : tab.type;\n}\n\n/**\n * The library a tab's cards drag from (#1390): the Schematic's library id, and the tab's key.\n *\n * @param keys - The Schematic's keys\n * @param tabKey - The tab's key ({@link schematicTabKey})\n * @returns The library's id\n */\nexport function schematicLibraryId(keys: SchematicKeys, tabKey: string): string {\n    return `${keys.library}:${tabKey}`;\n}\n\n/** What the rail hides of the backlog: whether it narrows an item kind read through its source, and its Clear filters. */\nexport interface SchematicBacklogNarrowing {\n    /** Whether a choice of the rail narrows an item kind with a backlog. */\n    readonly narrows: boolean;\n    /** Clears those kinds' sources' choices; `undefined` while none narrows. */\n    readonly clear: (() => void) | undefined;\n}\n\n/** Props of {@link useSchematicLibrary}. */\nexport interface SchematicLibraryProps {\n    /** The payload: its library's tabs, its kinds and their templates, its layers. */\n    readonly value: SchematicValue;\n    /** The zones the canvas draws, the drafts in place and a hidden layer's left out: the Index's. */\n    readonly zones: readonly DrawnZone[];\n    /** The items the canvas draws, as its zones are: the Index's. */\n    readonly items: readonly DrawnItem[];\n    /** Every item kind's rows with no position, the drafts in place: the Backlog's. */\n    readonly backlog: readonly BacklogEntry[];\n    /** What the rail hides of the backlog. */\n    readonly backlogNarrowing: SchematicBacklogNarrowing;\n    /**\n     * The Backlog beside item kinds read by area (#1393, D51): its one paged list — the rows in hand, then each such kind's\n     * rows with no position, read a page at a time — and what it counts, `undefined` while a count is read; `undefined`\n     * while the Backlog lists only rows in hand.\n     */\n    readonly backlogPages?: { readonly source: SchematicBacklogPages; readonly count: BacklogPageCount | undefined } | undefined;\n    /** The item kinds read by area, which the Index reads itself (#1393, D52); `undefined` with none. */\n    readonly indexArea?: SchematicIndexAreaProps | undefined;\n    /** The layers, with their author defaults. */\n    readonly layers: readonly SchematicLayerValue[];\n    /** How many entities each layer holds in the drawing, by its key. */\n    readonly layerCounts: ReadonlyMap<string, number>;\n    /** The viewer's layer choices. */\n    readonly layerView: SchematicLayerView;\n    /** Writes the viewer's layer choices. */\n    readonly onLayerView: (next: SchematicLayerView) => void;\n    /** The zone the viewport is in, by its id. */\n    readonly inView: string | undefined;\n    /** What the canvas has selected, by id. */\n    readonly selected: ReadonlySet<string>;\n    /** Flies to an item or a zone, by its id, and selects it. */\n    readonly onReveal: (id: string) => void;\n    /** The names the Schematic keeps its viewer's state under. */\n    readonly keys: SchematicKeys;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /** What each source of the rail its tabs follow shows: each templates record's, and each an author's tab names. */\n    readonly followed: FollowedSources;\n    /** The card each card tab has selected, by the tab's key: the frame's. */\n    readonly picked: ReadonlyMap<string, string>;\n    /** A click on a card of a tab, by the tab's key and the card's: it selects the card, or lets the selected one go. */\n    readonly onPick: (tabKey: string, key: string) => void;\n    /** A card's ⏎ (#1390, SC13): the card, by its library and its key, dropped on the selection or at the view's centre. */\n    readonly enter?: ((library: string, key: string) => void) | undefined;\n    /** Whether main is below 480px (#1394, D15): no card drags, and a tap on the selected card is its ⏎, whatever the pointer. */\n    readonly narrow?: boolean | undefined;\n    /**\n     * Why an item kind adds no item (#1549), by its slot: its keys can't be typed, and it builds none — its template cards'\n     * line, which neither drag nor drop.\n     */\n    readonly off?: ReadonlyMap<string, string> | undefined;\n}\n\n/** No kind off. */\nconst NO_OFF: ReadonlyMap<string, string> = new Map();\n\n/** A tab's narrowing in the Schematic's words: the shared narrowing, its empty state said by its message table. */\nfunction narrowingOf(narrowing: LibraryNarrowing | undefined, tab: SchematicLibraryTabWord, name: string, words: SchematicWords): LibraryNarrowing | undefined {\n    return narrowing === undefined ? undefined\n        : { ...narrowing, empty: { title: words.m.libraryNarrowed({ tab, name }), description: words.m.libraryNarrowedHint({ tab, name }) } };\n}\n\n/**\n * The Templates tab's cards (see the module docs): every kind's templates, in\n * the kinds' order — items', links', nets' — each following the source its\n * templates record names, by its key in that record.\n *\n * @param value - The payload\n * @param followed - What each followed source shows\n * @param words - The Schematic's words\n * @returns The cards it shows, its count, its narrowed and its own empty states, and its pane's attributes\n */\nfunction templatesTab(value: SchematicValue, followed: FollowedSources, words: SchematicWords): SourceTab<TemplateEntry> {\n    const kinds: readonly TemplatesKind[] = [...value.items, ...value.links, ...value.nets];\n    const entries = kinds.flatMap((kind) => kind.templates.map((template): TemplateEntry => ({ kind, template })));\n    const sourceOf = (kind: TemplatesKind): SourceShown | undefined => {\n        const source = getSomeorUndefined(kind.templatesSource);\n        return source === undefined ? undefined : followed.get(source)?.shown;\n    };\n    const sources = kinds.flatMap((kind) => { const shown = sourceOf(kind); return shown === undefined ? [] : [shown]; })\n        .filter((shown, i, all) => all.indexOf(shown) === i);\n    return sourcesTab({\n        cards: entries, keyOf: (entry) => entry.template.key, sources, sourceOf: (entry) => sourceOf(entry.kind),\n        noun: words.m.libraryNoun({ tab: \"templates\", n: 2 }), words,\n    });\n}\n\n/**\n * The library pane, as `BuilderFrame` draws it — see the module docs.\n *\n * @param props - The payload, the drawing's zones and items, the backlog and what the rail hides of it, the layers and the viewer's choices, the zone in view, the selection, what a row's click does, the keys, the words and the followed sources\n * @returns The pane — its tabs the ones `library` lists, each with its count — or `undefined`, no pane, when `library` lists none\n */\nexport function useSchematicLibrary(props: SchematicLibraryProps): BuilderFrameDock | undefined {\n    const {\n        value, zones, items, backlog, backlogNarrowing, backlogPages, indexArea, layers, layerCounts, layerView, onLayerView, inView, selected, onReveal, keys,\n        words, followed, picked, onPick, enter, narrow = false, off = NO_OFF,\n    } = props;\n    const m = words.m;\n    // The recipe's styles, resolved once a recipe: the frame renders it again as each window lands.\n    const recipe = useSlotRecipe({ key: \"schematic\" });\n    const styles = useMemo(() => recipe() as Styles, [recipe]);\n    const library = value.library;\n    const listsBacklog = library.some((tab) => tab.type === \"backlog\");\n    // A touch screen, or a main too narrow to drag on (#1394): a tap on the selected card drops it, as its ⏎ does (SC13).\n    const coarse = useCoarsePointer();\n    const tapDrops = coarse || narrow;\n\n    const isPicked = useCallback((tabKey: string, key: string) => {\n        const chosen = picked.get(tabKey);\n        return chosen !== undefined && stringEqual(chosen, key);\n    }, [picked]);\n    // Each tab whose cards drop takes ⏎ on a card (#1390): the card, dropped on the selection or at the view's centre —\n    // one function per tab, held still. An author's tab drops when its patch names a kind.\n    const enters = useMemo(() => new Map(library.flatMap((tab): [string, (key: string) => void][] => {\n        if (enter === undefined) return [];\n        const drops = tab.type === \"templates\" || tab.type === \"backlog\" || (tab.type === \"tab\" && tab.value.drop.type === \"some\");\n        if (!drops) return [];\n        const tabKey = schematicTabKey(tab);\n        const id = schematicLibraryId(keys, tabKey);\n        // A template of a kind that adds no item drops nothing: its card says why (#1549).\n        if (tab.type === \"templates\") return [[tabKey, (key: string) => { if (!off.has(refOfId(key)?.kind ?? \"\")) enter(id, key); }]];\n        return [[tabKey, (key: string) => enter(id, key)]];\n    })), [library, keys, enter, off]);\n    // What each tab that follows a source shows: the Templates tab its kinds' templates records', an author's tab its own.\n    const templatesFollow = useMemo(() => templatesTab(value, followed, words), [value, followed, words]);\n    const authorTabs = useMemo(() => library.flatMap((tab) => (tab.type === \"tab\" ? [tab.value] : [])), [library]);\n    const authorFollows = useMemo(() => new Map(authorTabs.map((tab): [string, SourceTab<AuthorCardValue>] => {\n        const source = getSomeorUndefined(tab.source);\n        const shown = source === undefined ? WHOLE : followed.get(source)?.shown ?? WHOLE;\n        return [`tab:${tab.name}`, sourceTab({ cards: tab.cards, keyOf: (card) => card.key, shown, noun: tab.name.toLocaleLowerCase(words.locale), words })];\n    })), [authorTabs, followed, words]);\n    // A tab its source reads again holds its cards retained (#1398, CL8): a tap on one selects it, and drops nothing.\n    const held = useMemo(() => new Set([...(templatesFollow.pane[\"aria-disabled\"] === true ? [\"templates\"] : []),\n        ...[...authorFollows].flatMap(([tabKey, follow]) => (follow.pane[\"aria-disabled\"] === true ? [tabKey] : []))]), [templatesFollow, authorFollows]);\n    // A click on a card selects it, or lets the selected one go; on a touch screen, or below 480px of main, a tap on the\n    // selected card is its ⏎ (SC13, #1394) — never in a tab held while its source reads again.\n    const onCard = useCallback((tabKey: string, key: string) => {\n        const onEnter = held.has(tabKey) ? undefined : enters.get(tabKey);\n        if (tapDrops && onEnter !== undefined && isPicked(tabKey, key)) onEnter(key);\n        else onPick(tabKey, key);\n    }, [enters, held, tapDrops, isPicked, onPick]);\n    const groupBy = useMemo(() => [{ key: \"group\", label: m.libraryGroupBy() }], [m]);\n    const noun = useCallback((tab: SchematicLibraryTabWord) => some({ singular: m.libraryNoun({ tab, n: 1 }), plural: m.libraryNoun({ tab, n: 2 }) }), [m]);\n    const empty = useCallback((tab: SchematicLibraryTabWord, name: string): LibraryEmpty => ({ title: m.libraryEmpty({ tab, name }), description: m.libraryEmptyHint({ tab, name }) }), [m]);\n\n    // ── Templates: every kind's, under its name, then their group ────────\n    const templates = useMemo((): LibraryValue => scheduleLibrary({\n        id: schematicLibraryId(keys, \"templates\"),\n        items: templatesFollow.cards.map(({ kind, template }) => {\n            const key = entityId({ kind: kind.key, key: template.key });\n            const icon = getSomeorUndefined(template.icon) ?? (kind.icon === \"\" ? undefined : kind.icon);\n            // A kind adding no item says why on its line (#1549).\n            const why = off.get(kind.key);\n            return scheduleLibraryCard({\n                key, label: template.name, sublabel: some(why ?? kind.name), icon: icon === undefined ? none : some(icon), status: none, trailing: none,\n                // An item kind's lands on the canvas, a link or a net kind's on a link or a net of its kind (#1390) — dragged\n                // there wherever main is wide enough (#1394).\n                draggable: !narrow && why === undefined, filtered: false, placed: isPicked(\"templates\", key),\n                search: some([template.name, kind.name, getSomeorUndefined(template.group) ?? \"\"].filter((text) => text !== \"\").join(\" · \")),\n                groups: new Map([[\"group\", m.templateGroup({ kind: kind.name, group: getSomeorUndefined(template.group) })]]),\n            });\n        }),\n        groupOptions: groupBy,\n        noun: noun(\"templates\"),\n        onCardClick: some((key: string) => { onCard(\"templates\", key); return null; }),\n    }, true), [keys, templatesFollow, narrow, off, isPicked, m, groupBy, noun, onCard]);\n\n    // ── Backlog: every item kind's rows with no position, under its name ─\n    const kindOf = useMemo(() => new Map(value.items.map((kind) => [kind.key, kind] as const)), [value.items]);\n    // A row's card: drawn as context — the narrowing leaves it out, or a draft placed or deleted it — faded, never dragged.\n    const backlogCard = useCallback(({ id, ref, roles }: BacklogEntry, context: boolean): LibraryItemValue => {\n        const kind = kindOf.get(ref.kind);\n        const name = kind?.name ?? ref.kind;\n        const icon = getSomeorUndefined(roles.icon) ?? (kind === undefined || kind.icon === \"\" ? undefined : kind.icon);\n        const line = m.backlogLine({ kind: name, sublabel: getSomeorUndefined(roles.sublabel) });\n        return scheduleLibraryCard({\n            key: id, label: roles.label, sublabel: some(line), icon: icon === undefined ? none : some(icon), status: roles.status, trailing: none,\n            // A drop places it where it lands (#1390, SC4): dragged there wherever main is wide enough (#1394).\n            draggable: !context && !narrow, filtered: context, placed: isPicked(\"backlog\", id),\n            search: some([roles.label, ref.key, line].join(\" · \")),\n            groups: new Map([[\"group\", name]]),\n        });\n    }, [kindOf, narrow, isPicked, m]);\n    const backlogLibrary = useMemo((): LibraryValue => scheduleLibrary({\n        id: schematicLibraryId(keys, \"backlog\"),\n        items: backlog.map((entry) => backlogCard(entry, false)),\n        groupOptions: groupBy,\n        noun: noun(\"backlog\"),\n        onCardClick: some((key: string) => { onCard(\"backlog\", key); return null; }),\n    }, true), [keys, backlog, backlogCard, groupBy, noun, onCard]);\n    // The paged Backlog's cards, and a click on one (#1393).\n    const pagedCard = useCallback((row: BacklogPageRow) => backlogCard(row.entry, row.context), [backlogCard]);\n    const onPagedCard = useCallback((key: string) => onCard(\"backlog\", key), [onCard]);\n    // The backlog is each kind's read: while the rail narrows one, an emptied tab says so, with Clear filters.\n    const backlogNarrowed = useMemo((): LibraryNarrowing | undefined => (!backlogNarrowing.narrows || backlogNarrowing.clear === undefined ? undefined : {\n        empty: { title: m.libraryNarrowed({ tab: \"backlog\", name: \"\" }), description: m.libraryNarrowedHint({ tab: \"backlog\", name: \"\" }) },\n        onClear: backlogNarrowing.clear,\n    }), [backlogNarrowing, m]);\n\n    // ── An author's tabs: their cards, each following the source it names ─\n    const authorLibraries = useMemo(() => new Map(authorTabs.map((tab): [string, LibraryValue] => {\n        const tabKey = `tab:${tab.name}`;\n        const icon = getSomeorUndefined(tab.icon);\n        // Its cards drag when its patch names the kind they land on (#1390), wherever main is wide enough (#1394).\n        const drags = tab.drop.type === \"some\" && !narrow;\n        return [tabKey, scheduleLibrary({\n            id: schematicLibraryId(keys, tabKey),\n            items: (authorFollows.get(tabKey)?.cards ?? tab.cards).map((card) => {\n                const meta = getSomeorUndefined(card.meta);\n                const group = getSomeorUndefined(card.group);\n                return scheduleLibraryCard({\n                    key: card.key, label: card.label, sublabel: meta === undefined ? none : some(meta), icon: icon === undefined ? none : some(icon),\n                    status: none, trailing: none,\n                    draggable: drags, filtered: false, placed: isPicked(tabKey, card.key),\n                    search: some([card.key, card.label, meta ?? \"\"].filter((text) => text !== \"\").join(\" · \")),\n                    groups: group === undefined ? new Map() : new Map([[\"group\", group]]),\n                });\n            }),\n            groupOptions: tab.cards.some((card) => card.group.type === \"some\") ? groupBy : [],\n            noun: noun(\"tab\"),\n            onCardClick: some((key: string) => { onCard(tabKey, key); return null; }),\n        }, true)];\n    })), [authorTabs, authorFollows, keys, narrow, isPicked, groupBy, noun, onCard]);\n\n    // The kinds' names, by slot: what the Index's search reads beside an item's label and key.\n    const kindName = useCallback((slot: string) => kindOf.get(slot)?.name ?? slot, [kindOf]);\n\n    return useMemo((): BuilderFrameDock | undefined => {\n        // No tab listed: no pane.\n        if (library.length === 0) return undefined;\n        const body = (tab: string, attributes: SourceTab<unknown>[\"pane\"], content: ReactNode) => (\n            <Box css={styles.libraryPane} data-schematic-library={tab} {...attributes}>{content}</Box>\n        );\n        const tabs = library.map((tab) => {\n            switch (tab.type) {\n                case \"templates\":\n                    return {\n                        key: \"templates\", label: m.libraryTab({ tab: \"templates\" }), count: templatesFollow.count, shown: templates.items.length,\n                        body: body(\"templates\", templatesFollow.pane, (\n                            <EastChakraLibrary value={templates} storageKey={`${keys.library}.templates`} onCardEnter={enters.get(\"templates\")}\n                                empty={templatesFollow.empty === undefined ? undefined : empty(\"templates\", \"\")}\n                                narrowing={narrowingOf(templatesFollow.narrowing, \"templates\", \"\", words)} />\n                        )),\n                    };\n                case \"backlog\": {\n                    // Beside a kind read by area, one paged list (#1393, D51), counted `N of M` while an index the narrowing leads narrows it.\n                    if (backlogPages !== undefined) {\n                        const { source, count } = backlogPages;\n                        return {\n                            key: \"backlog\", label: m.libraryTab({ tab: \"backlog\" }),\n                            count: count === undefined ? undefined : narrowedCount(words, count.shown, count.total, count.narrowing), shown: count?.shown ?? 0,\n                            body: body(\"backlog\", {}, (\n                                <PagedLibrary source={source} id={source.id} item={pagedCard} onOpen={onPagedCard} onEnter={enters.get(\"backlog\")}\n                                    empty={empty(\"backlog\", \"\")} narrowing={backlogNarrowed} />\n                            )),\n                        };\n                    }\n                    return {\n                        key: \"backlog\", label: m.libraryTab({ tab: \"backlog\" }), count: backlogLibrary.items.length, shown: backlogLibrary.items.length,\n                        body: body(\"backlog\", {}, (\n                            <EastChakraLibrary value={backlogLibrary} storageKey={`${keys.library}.backlog`} onCardEnter={enters.get(\"backlog\")}\n                                empty={empty(\"backlog\", \"\")} narrowing={backlogNarrowed} />\n                        )),\n                    };\n                }\n                case \"index\":\n                    return {\n                        key: \"index\", label: m.libraryTab({ tab: \"index\" }), count: zones.length, shown: zones.length,\n                        body: body(\"index\", {}, (\n                            <SchematicIndexTab zones={zones} items={items} kindName={kindName} inView={inView} selected={selected} onReveal={onReveal} words={words}\n                                area={indexArea} />\n                        )),\n                    };\n                case \"layers\":\n                    return {\n                        key: \"layers\", label: m.libraryTab({ tab: \"layers\" }), count: layers.length, shown: layers.length,\n                        body: body(\"layers\", {}, (\n                            <SchematicLayersTab layers={layers} view={layerView} onView={onLayerView} counts={layerCounts} words={words} />\n                        )),\n                    };\n                case \"tab\": {\n                    const tabKey = `tab:${tab.value.name}`;\n                    const cards = authorLibraries.get(tabKey)!;\n                    const follows = authorFollows.get(tabKey)!;\n                    const name = tab.value.name.toLocaleLowerCase(words.locale);\n                    return {\n                        key: tabKey, label: tab.value.name, count: follows.count, shown: cards.items.length,\n                        body: body(tabKey, follows.pane, (\n                            <EastChakraLibrary value={cards} storageKey={`${keys.library}.${tabKey}`} onCardEnter={enters.get(tabKey)}\n                                empty={follows.empty === undefined ? undefined : empty(\"tab\", tab.value.name)}\n                                narrowing={narrowingOf(follows.narrowing, \"tab\", name, words)} />\n                        )),\n                    };\n                }\n            }\n        });\n        // Collapsed, the rail counts the backlog — or, with no Backlog tab, the first tab's cards.\n        const backlogShown = backlogPages === undefined ? backlogLibrary.items.length : backlogPages.count?.shown ?? 0;\n        return {\n            label: m.libraryPane(), icon: \"layer-group\", size: LIBRARY_SIZE, persist: \"local\",\n            badge: listsBacklog ? backlogShown : tabs[0]!.shown,\n            tabs: tabs.map(({ shown: _shown, ...pane }) => pane),\n        };\n    }, [library, m, words, styles.libraryPane, templates, templatesFollow, backlogLibrary, backlogNarrowed, backlogPages, pagedCard, onPagedCard, zones, items,\n        indexArea, kindName, inView, selected, onReveal, layers, layerView, onLayerView, layerCounts, authorLibraries, authorFollows, keys, empty, listsBacklog,\n        enters]);\n}\n\n/**\n * The paged Backlog's count (#1393), read where it renders nothing and handed\n * to the frame only as it moves, as the Calendar's window reader hands its\n * read: a tracked read in the frame would draw the whole frame again at every\n * settle.\n *\n * @param props - The paged Backlog, the sources of the kinds it reads, and where its count goes\n * @returns Nothing: the count is handed on\n */\nexport function SchematicBacklogCountReader({ source, parts, onCount }: {\n    readonly source: SchematicBacklogPages; readonly parts: readonly string[]; readonly onCount: (count: BacklogPageCount | undefined) => void;\n}): null {\n    useSlicesReactivity(parts);\n    const read = useCallback(() => source.count(), [source]);\n    const { result } = useTrackedEvaluation(read);\n    const count = result.ok ? result.value : undefined;\n    // Handed on by what it counts, so a read that settles the same count draws nothing again.\n    const shown = count?.shown, total = count?.total, narrowing = count?.narrowing;\n    useEffect(() => {\n        onCount(shown === undefined || total === undefined || narrowing === undefined ? undefined : { shown, total, narrowing });\n    }, [shown, total, narrowing, onCount]);\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The selected rows of the kinds read by area (#1393, #1398, `Schematic\n * Builder Spec.md` §4.5, §9), read in a component of their own: what a\n * selection keeps of a row its kind's window no longer holds. A kind read by\n * area holds only its window, so a pan or a zoom takes a selected row off the\n * drawing while the row still stands where its record holds it: it stays\n * selected — the host's `onSelect` hears nothing of a camera's move — and\n * Details shows it, read by its key. It is let go only as a read proves it\n * gone — its record holds none of it, it has no position, or its kind's\n * narrowing leaves it out, asked of the row in one `within` a kind (D28) —\n * or as a layer hides or locks it (the frame's to say, by the row's layer).\n *\n * A row the window holds at the record's revision is the stored row itself:\n * kept as the window holds it, so a row the window then leaves is drawn for\n * Details at once, as it was, and read again by its key — every such row of a\n * kind in one request (`recordSliceRows`), each key read back at the kind's\n * key type (#1549), a text no key prints as gone — only once the revision\n * moves. Its narrowing is asked of it only once it is off the window, the window's own\n * rows being its narrowing's, each answer kept at the revision and the\n * narrowing. While a read or an answer is in flight, the row as last kept\n * stands in. Its drafts are the frame's: a drafted row draws, or is let go,\n * as its drafts say (`drafted.ts`).\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useLayoutEffect, useRef } from \"react\";\nimport { StringType, equalFor, type ValueTypeOf } from \"@elaraai/east\";\nimport { RecordSliceWhereType, type RecordSliceBindType } from \"@elaraai/east-ui/internal\";\nimport { getSomeorUndefined, useTrackedEvaluation } from \"@elaraai/east-ui-components\";\nimport { recordSliceRevision, recordSliceRows, recordSliceWithin } from \"@elaraai/east-ui-components/internal\";\nimport { kindKeys, type KindKeys } from \"../shared/schedule/kind-keys.js\";\nimport { rowCodec } from \"../shared/schedule/records.js\";\nimport { sourcePart } from \"../shared/schedule/visibility.js\";\nimport { drawnItem, drawnZone, entityId, refOfId, type DrawnItem, type DrawnZone } from \"./canvas/drawn.js\";\nimport type { SchematicValue, SchematicWindowRows } from \"./data.js\";\n\n/** A record Slice's narrowing, decoded. */\ntype Where = ValueTypeOf<typeof RecordSliceWhereType>;\n/** A kind's source of the slice. */\ntype Part = ValueTypeOf<RecordSliceBindType>;\n\nconst sameWhere = equalFor(RecordSliceWhereType);\nconst stringEqual = equalFor(StringType);\n\n/** The selected rows of the kinds read by area, as their stored rows draw them. */\nexport interface SchematicSelectedRows {\n    /**\n     * Each selected item of a kind read by area, by its id: as its stored row draws it — `null` for one a read proves\n     * gone, one with no position, or one its narrowing leaves out, which the selection lets go of; absent while it is\n     * first read.\n     */\n    readonly items: ReadonlyMap<string, DrawnItem | null>;\n    /** Each selected zone of a kind read by area, by its id, as {@link SchematicSelectedRows.items}. */\n    readonly zones: ReadonlyMap<string, DrawnZone | null>;\n}\n\n/** No selected row read. */\nexport const NO_SELECTED_ROWS: SchematicSelectedRows = { items: new Map(), zones: new Map() };\n\n/** A row as the reader keeps it: its bytes at the revision they were read at, and the row decoded, once asked of a narrowing. */\ninterface Kept {\n    readonly revision: string;\n    readonly row: Uint8Array;\n    value?: unknown;\n}\n\n/** One kind's narrowing's answers, at a revision and a narrowing. */\ninterface Answered {\n    readonly revision: string;\n    readonly where: Where;\n    held: ReadonlyMap<string, boolean>;\n}\n\n/**\n * Which of some rows a narrowing holds: each answer kept at the kind's revision and narrowing, the rows not yet answered\n * asked in one request, each at its key (#1549).\n *\n * @returns The answers, by key's text; `undefined` while the request is in flight\n */\nfunction answersOf(kept: Map<string, Answered>, slot: string, part: Part, revision: string, where: Where,\n    rows: readonly { readonly key: string; readonly row: unknown }[], keyed: KindKeys): ReadonlyMap<string, boolean> | undefined {\n    let answered = kept.get(slot);\n    if (answered === undefined || !stringEqual(answered.revision, revision) || !sameWhere(answered.where, where)) {\n        answered = { revision, where, held: new Map() };\n        kept.set(slot, answered);\n    }\n    const held = answered.held;\n    const asked = rows.filter(({ key }) => !held.has(key));\n    if (asked.length === 0) return held;\n    const answer = recordSliceWithin(part, where, asked.map(({ key, row }) => ({ key: keyed.keyOf(key), row })));\n    if (answer.type !== \"some\") return undefined;\n    // Only the selected rows': a row let go takes its answer with it.\n    const next = new Map(rows.flatMap(({ key }) => { const was = held.get(key); return was === undefined ? [] : [[key, was] as const]; }));\n    asked.forEach(({ key }, i) => next.set(key, answer.value[i] === true));\n    answered.held = next;\n    return next;\n}\n\n/** Whether two reads say the same: each id the same entity, or the same `null`. */\nfunction sameRows(a: SchematicSelectedRows, b: SchematicSelectedRows): boolean {\n    const same = <E,>(x: ReadonlyMap<string, E | null>, y: ReadonlyMap<string, E | null>) => x.size === y.size && [...x].every(([id, e]) => y.has(id) && Object.is(y.get(id), e));\n    return same(a.items, b.items) && same(a.zones, b.zones);\n}\n\n/** No kind read by area. */\nconst NO_AREAS: ReadonlySet<string> = new Set();\n\n/** No row selected. */\nconst NO_IDS: readonly string[] = [];\n\n/**\n * Reads the selected rows of the kinds read by area (see the module docs), handing the frame what it read only when that\n * moves.\n *\n * @param props - The payload, the kinds read by area, the selected entities' ids, the rows each kind's window holds, and\n *   where the rows go\n * @returns Nothing: it reads\n */\nexport function SchematicSelectedReader({ value, areas = NO_AREAS, selected = NO_IDS, windows, onRead }: {\n    value: SchematicValue; areas?: ReadonlySet<string>; selected?: readonly string[]; windows: SchematicWindowRows;\n    onRead: (rows: SchematicSelectedRows) => void;\n}): null {\n    // Each selected row as last kept, by its id; and each kind's narrowing's answers, by its slot.\n    const kept = useRef(new Map<string, Kept>());\n    const answers = useRef(new Map<string, Answered>());\n    // What each kept row draws as, by its bytes: the same entity while they are.\n    const drawn = useRef(new WeakMap<Uint8Array, DrawnItem | DrawnZone | null>());\n    const read = useCallback((): SchematicSelectedRows => {\n        const chrome = getSomeorUndefined(value.slice);\n        const items = new Map<string, DrawnItem | null>();\n        const zones = new Map<string, DrawnZone | null>();\n        // A row no longer selected is let go of.\n        const wanted = new Set(selected);\n        for (const id of [...kept.current.keys()]) if (!wanted.has(id)) kept.current.delete(id);\n        // The selected keys of each kind read by area, in the selection's order.\n        const byKind = new Map<string, string[]>();\n        for (const id of selected) {\n            const ref = refOfId(id);\n            if (ref === undefined || !areas.has(ref.kind)) continue;\n            const keys = byKind.get(ref.kind);\n            if (keys === undefined) byKind.set(ref.kind, [ref.key]);\n            else keys.push(ref.key);\n        }\n        for (const [slot, keys] of byKind) {\n            const item = value.items.find((kind) => stringEqual(kind.key, slot));\n            const zone = item === undefined ? value.zones.find((kind) => stringEqual(kind.key, slot)) : undefined;\n            const kind = item ?? zone;\n            const part = sourcePart(chrome, slot);\n            if (kind === undefined || part === undefined) continue;\n            const codec = rowCodec(kind.rowType);\n            const keyed = kindKeys(kind.keyType);\n            const idOf = (key: string) => entityId({ kind: slot, key });\n            // A row as its stored row draws it — the same entity while its bytes are.\n            const put = (key: string, row: Uint8Array) => {\n                let entity = drawn.current.get(row);\n                if (entity === undefined) {\n                    const ref = { kind: slot, key };\n                    entity = (item !== undefined ? drawnItem(ref, item.read(row, key), undefined) : drawnZone(ref, zone!.read(row, key))) ?? null;\n                    drawn.current.set(row, entity);\n                }\n                if (item !== undefined) items.set(idOf(key), entity as DrawnItem | null);\n                else zones.set(idOf(key), entity as DrawnZone | null);\n            };\n            // Gone: let go of.\n            const gone = (key: string) => {\n                kept.current.delete(idOf(key));\n                if (item !== undefined) items.set(idOf(key), null); else zones.set(idOf(key), null);\n            };\n            // In flight: the row as last kept stands in; one never kept is absent.\n            const standIn = (key: string) => { const was = kept.current.get(idOf(key)); if (was !== undefined) put(key, was.row); };\n            const revision = recordSliceRevision(part);\n            if (revision.type !== \"some\") { keys.forEach(standIn); continue; }\n            const window = windows.get(slot);\n            const held = window !== undefined && stringEqual(window.revision, revision.value) ? window.rows : undefined;\n            // The window holds it at the revision: the stored row itself, kept, the narrowing's as the window's every row is.\n            const off: string[] = [];\n            for (const key of keys) {\n                const row = held?.get(key);\n                if (row === undefined) { off.push(key); continue; }\n                const was = kept.current.get(idOf(key));\n                if (was === undefined || !Object.is(was.row, row.row) || !stringEqual(was.revision, revision.value)) kept.current.set(idOf(key), { revision: revision.value, row: row.row });\n                put(key, row.row);\n            }\n            if (off.length === 0) continue;\n            // Off the window: read by its key once the revision has moved from the one it was kept at, every such row in one request.\n            const unread = off.filter((key) => { const was = kept.current.get(idOf(key)); return was === undefined || !stringEqual(was.revision, revision.value); });\n            // Each read at the kind's key type: a text no key of its prints as names no row, and is gone.\n            const asked: { readonly key: string; readonly at: unknown }[] = [];\n            for (const key of unread) {\n                const at = keyed.keyOf(key);\n                if (at === undefined) gone(key);\n                else asked.push({ key, at });\n            }\n            if (asked.length > 0) {\n                const got = recordSliceRows(part, asked.map(({ at }) => at));\n                if (got.type !== \"some\") { off.forEach(standIn); continue; }\n                asked.forEach(({ key }, i) => {\n                    const row = got.value[i];\n                    if (row === undefined || row.type !== \"some\") { gone(key); return; }\n                    kept.current.set(idOf(key), { revision: revision.value, row: codec.encode(row.value), value: row.value });\n                });\n            }\n            const present = off.filter((key) => kept.current.has(idOf(key)));\n            // Asked of its narrowing, while one narrows the kind.\n            const where = part.read().where;\n            let narrowed: ReadonlyMap<string, boolean> | undefined;\n            if (where.size > 0 && present.length > 0) {\n                narrowed = answersOf(answers.current, slot, part, revision.value, where, present.map((key) => {\n                    const was = kept.current.get(idOf(key))!;\n                    if (was.value === undefined) was.value = codec.decode(was.row);\n                    return { key, row: was.value };\n                }), keyed);\n                if (narrowed === undefined) { present.forEach(standIn); continue; }\n            }\n            for (const key of present) {\n                if (narrowed?.get(key) === false) gone(key);\n                else put(key, kept.current.get(idOf(key))!.row);\n            }\n        }\n        return items.size === 0 && zones.size === 0 ? NO_SELECTED_ROWS : { items, zones };\n    }, [value, areas, selected, windows]);\n    const { result } = useTrackedEvaluation(read);\n    const reported = useRef<SchematicSelectedRows>(NO_SELECTED_ROWS);\n    useLayoutEffect(() => {\n        // A read that fails reads as in flight: what was kept stands, and the frame's line says why the kind's read failed.\n        if (!result.ok) return;\n        const now = result.value;\n        if (sameRows(reported.current, now)) return;\n        reported.current = now;\n        onRead(now);\n    });\n    return null;\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * What the rail's narrowing does to the Schematic's drawing (#1392,\n * `Schematic Builder Spec.md` §10.2, §10.3) — pure: which entities match it,\n * which draw as context, and which it takes out of every list that shows the\n * drawing — Find, the Index, the Backlog, the inspector's Choosers and what an\n * item is joined to, and the footer's counts — and of the selection.\n *\n * A row matches while its kind's source narrows and holds it among its shown\n * keys (`useSourceVisibility`), never by a predicate over the rows. What else\n * the narrowing does follows how a narrowed-out row draws:\n *\n * - **Hidden** (the default): a kind read through its source reads only what\n *   its narrowing holds, so a narrowed-out row is never drawn. A link or a net\n *   draws only while its ends do, so one ending at an item of a kind read\n *   through its source that its read does not hold is out too — a net once a\n *   side of it has no such member left.\n * - **Dimmed** (`narrowed=\"dim\"`): every row is read, and one its kind's\n *   source narrows out draws as context; so does a link ending at one, and a\n *   net whose every member drawn on a side is one. Context is out.\n *\n * A kind read by area reads only its window (#1393): a drafted row of it the\n * window doesn't hold, drawn where its draft places it, is the narrowing's or\n * not as the row its session began from answers (`drafts-narrowing.ts`) — a\n * match, or, dimmed, context — as every kind's drafted row is.\n *\n * A row a gesture created is neither: no read holds it, and it draws as it is.\n *\n * @packageDocumentation\n */\n\nimport { match, type ValueTypeOf, type option } from \"@elaraai/east\";\nimport type { Schematic } from \"@elaraai/e3-ui/internal\";\nimport { refOfId, type SchematicDrawn, type SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicHeldRows } from \"./data.js\";\n\n/** No entity. */\nconst NONE: ReadonlySet<string> = new Set();\n\n/** How a narrowed-out row draws, and what the matches take (§10.3): the payload's `narrowed`, read once. */\nexport interface SchematicNarrowedLook {\n    /** Whether a narrowed-out row draws as context, rather than hidden. */\n    readonly dim: boolean;\n    /** Context's opacity (0–1). */\n    readonly opacity: number;\n    /** Whether context is drained of colour. */\n    readonly desaturate: boolean;\n    /** Whether a context item draws as a bare marker. */\n    readonly dot: boolean;\n    /** The matches' emphasis: a ring, one that breathes, or none. */\n    readonly emphasis: \"halo\" | \"pulse\" | undefined;\n    /** Whether the matches are boxed. */\n    readonly frame: boolean;\n    /** Whether the camera flies to the matches when they change. */\n    readonly fit: boolean;\n}\n\n/**\n * How a narrowed-out row draws, as the payload says it.\n *\n * @param narrowed - The payload's `narrowed`\n * @returns Its look\n */\nexport function narrowedLook(narrowed: ValueTypeOf<typeof Schematic.Types.Narrowed>): SchematicNarrowedLook {\n    return {\n        dim: narrowed.show.type === \"dim\",\n        opacity: narrowed.opacity,\n        desaturate: narrowed.desaturate,\n        dot: narrowed.dot,\n        emphasis: match(narrowed.emphasis, { some: (emphasis) => emphasis.type }, undefined),\n        frame: narrowed.frame,\n        fit: narrowed.fit,\n    };\n}\n\n/** Whether a look asks anything of the matches: an emphasis, a frame or a fit — what makes a hidden narrowing read its keys. */\nexport function looksAtMatches(look: SchematicNarrowedLook): boolean {\n    return look.emphasis !== undefined || look.frame || look.fit;\n}\n\n/** What the narrowing does to the drawing, each entity by its id. */\nexport interface SchematicNarrowing {\n    /** The matches: each entity of a kind whose source narrows, among its shown keys, and drawn as itself — what emphasis rings, frame boxes and fit flies to. */\n    readonly matches: ReadonlySet<string>;\n    /** What draws as context (`narrowed=\"dim\"`): faded, drained of colour or a bare marker, and never selected. */\n    readonly context: ReadonlySet<string>;\n    /** What the narrowing takes out of every list and of the selection: the context, and a link or a net whose ends it hides. */\n    readonly out: ReadonlySet<string>;\n    /** Whether a row the read holds draws as context: one its kind's source narrows out, under `narrowed=\"dim\"` — a backlog row among them. */\n    readonly isContext: (ref: SchematicRef) => boolean;\n}\n\n/** Nothing narrows. */\nexport const NO_NARROWING: SchematicNarrowing = { matches: NONE, context: NONE, out: NONE, isContext: () => false };\n\n/** What the narrowing is worked out from. */\nexport interface SchematicNarrowingArgs {\n    /** What the canvas draws: the stored rows, the drafts in place. */\n    readonly drawn: SchematicDrawn;\n    /** Each kind's rows its read holds, by the kind's slot, then by key. */\n    readonly held: SchematicHeldRows;\n    /** The kinds read through their source of the slice, by slot. */\n    readonly sourced: ReadonlySet<string>;\n    /**\n     * A kind's source's shown keys, by the kind's slot: `none` while the source narrows nothing; `undefined` for a kind\n     * read whole, and for one whose source's keys are not read, or have not yet resolved.\n     */\n    readonly keys: (slot: string) => option<ReadonlySet<string>> | undefined;\n    /** Whether a narrowed-out row draws as context: `narrowed=\"dim\"`. */\n    readonly dim: boolean;\n    /**\n     * Whether a kind read by area's narrowing holds a drafted row of it its read does not hold, as the row its session\n     * began from answers (`drafts-narrowing.ts`): `undefined` for a row not asked — one a gesture created, one of a kind\n     * read otherwise, one whose answer is in flight — which is neither a match nor context.\n     */\n    readonly drafted?: ((ref: SchematicRef) => boolean | undefined) | undefined;\n}\n\n/**\n * What the narrowing does to the drawing (see the module docs).\n *\n * @param args - The drawing, what each read holds, the kinds read through their source, each source's shown keys and whether a narrowed-out row is dimmed\n * @returns The matches, the context, and what is out\n */\nexport function schematicNarrowing(args: SchematicNarrowingArgs): SchematicNarrowing {\n    const { drawn, held, sourced, keys, dim, drafted } = args;\n    const holds = (ref: SchematicRef): boolean => held.get(ref.kind)?.has(ref.key) === true;\n    // A drafted row its read does not hold, as the row its session began from answers: `undefined` for one not asked.\n    const answer = (ref: SchematicRef): boolean | undefined => (drafted === undefined || holds(ref) ? undefined : drafted(ref));\n    // A row its kind's source narrows out: its read holds it, and its source's shown keys do not — or, a drafted row its\n    // read does not hold, the row its session began from is not the narrowing's.\n    const outside = (ref: SchematicRef): boolean => {\n        const shown = keys(ref.kind);\n        if (shown === undefined || shown.type !== \"some\") return false;\n        return holds(ref) ? !shown.value.has(ref.key) : answer(ref) === false;\n    };\n    const context = new Set<string>();\n    const out = new Set<string>();\n    const items = new Set(drawn.items.map((item) => item.key));\n    if (dim) {\n        for (const item of drawn.items) if (outside(item.ref)) context.add(item.key);\n        for (const zone of drawn.zones) if (outside(zone.ref)) context.add(zone.key);\n        for (const link of drawn.links) {\n            if (outside(link.ref) || context.has(link.from) || context.has(link.to)) context.add(link.key);\n        }\n        // A side whose every member drawn is context leaves the net context.\n        const dimmed = (members: readonly string[]) => {\n            const on = members.filter((member) => items.has(member));\n            return on.length > 0 && on.every((member) => context.has(member));\n        };\n        for (const net of drawn.nets) if (outside(net.ref) || dimmed(net.sources) || dimmed(net.destinations)) context.add(net.key);\n        for (const id of context) out.add(id);\n    } else {\n        // An end the narrowing hides: drawn nowhere, of a kind read through its source whose read does not hold it.\n        const hidden = (id: string): boolean => {\n            if (items.has(id)) return false;\n            const ref = refOfId(id);\n            return ref !== undefined && sourced.has(ref.kind) && !holds(ref);\n        };\n        for (const link of drawn.links) if (hidden(link.from) || hidden(link.to)) out.add(link.key);\n        const gone = (members: readonly string[]) => members.length > 0 && members.every(hidden);\n        for (const net of drawn.nets) if (gone(net.sources) || gone(net.destinations)) out.add(net.key);\n    }\n    const matches = new Set<string>();\n    for (const entity of [...drawn.items, ...drawn.zones, ...drawn.links, ...drawn.nets]) {\n        const shown = keys(entity.ref.kind);\n        if (shown === undefined || shown.type !== \"some\" || out.has(entity.key)) continue;\n        if (shown.value.has(entity.ref.key) || answer(entity.ref) === true) matches.add(entity.key);\n    }\n    if (matches.size === 0 && context.size === 0 && out.size === 0) return NO_NARROWING;\n    return { matches, context, out, isContext: (ref) => dim && outside(ref) };\n}\n\n/**\n * The drawing as the lists show it: what the narrowing takes out left out.\n *\n * @param drawn - What the canvas draws\n * @param out - What the narrowing takes out, by id\n * @returns The drawing; the one given while nothing is out\n */\nexport function narrowedDrawing(drawn: SchematicDrawn, out: ReadonlySet<string>): SchematicDrawn {\n    if (out.size === 0) return drawn;\n    return {\n        items: drawn.items.filter((item) => !out.has(item.key)),\n        zones: drawn.zones.filter((zone) => !out.has(zone.key)),\n        links: drawn.links.filter((link) => !out.has(link.key)),\n        nets: drawn.nets.filter((net) => !out.has(net.key)),\n    };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's toolbar items (#1387, `Schematic Builder Spec.md` §6.1,\n * SC24) — every control the Schematic has, as items of its frame's one\n * toolbar, in this order:\n *\n * 1. **the rail** over its `Slice.bindRecords` — each source's fields, the\n *    presets over them — and, at the row's end, its summary;\n * 2. **the tools**, one strip: Select, Zoom box, Marquee, Connect (while a link\n *    kind is editable) and Move (while an item kind is editable); beside it,\n *    while several link kinds are editable, Connect's menu of the kind it\n *    draws;\n * 3. **Zoom** − / + and **Fit**;\n * 4. **Find**, over the item kinds' keys (`find.ts`);\n * 5. **the steps** to the previous and the next item, while something is\n *    selected;\n * 6. **the history item**, last, where the Schematic edits (#1388).\n *\n * They fold on one ladder: the rail first, in its own order (#952) — its\n * fields into their chips, then one chip, then its icon — then its summary\n * (`SUMMARY_RANK`); then the Schematic's own: the tools' strip drops its words\n * for its icons, Find's box folds to its icon, the strip folds into one chip\n * naming the tool, whose menu holds every tool — Connect once per link kind\n * it may draw — and last the tools, the zoom, Fit and the steps fold into\n * Find's popover, the View, one move: a phone's row holds the rail's icon,\n * the View and the history item (the Plan's View precedent). The history\n * item's step (`DEFAULT_RANK`) comes after all of them. While Find's query\n * stands, its box keeps its form — the View held off — while anything else in\n * the row can fold, and folds to its icon only once nothing else can, its\n * query and its pick in the popover the icon opens, so the history stays in\n * the row (the shared key search's rule, ruled 26 Oct 2026, \"Find folds\").\n * Nothing wraps, scrolls or goes to a second row, and on a coarse pointer\n * every control is a 44px target by its halo, the row's height its own.\n *\n * @packageDocumentation\n */\n\nimport { Box, chakra, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport {\n    faArrowPointer, faChevronLeft, faChevronRight, faLink, faMagnifyingGlassPlus, faObjectGroup, faUpDownLeftRight,\n    type IconDefinition,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport type { ValueTypeOf } from \"@elaraai/east\";\nimport type { RecordSlicesChromeType } from \"@elaraai/east-ui/internal\";\nimport { HOST_RANK, useRecordSlicesToolbarItems } from \"@elaraai/east-ui-components/internal\";\nimport { useKeySearchToolbarItem, type KeySearchSource, type ToolbarItem } from \"@elaraai/east-ui-components\";\nimport { Seg, SegMenu } from \"../shared/schedule/segments.js\";\nimport { ZoomStrip, type ZoomRange } from \"../shared/schedule/zoom.js\";\nimport type { SchematicWords } from \"./messages.js\";\nimport type { SchematicTool, SchematicToolsState } from \"./tools.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n/**\n * The Schematic's own fold ranks, after every step of the slice rail's\n * (#952): the tools' strip drops its words, Find folds to its icon, the strip\n * folds into its chip, and last the View bundle. The history item's step\n * (`DEFAULT_RANK`) comes after them.\n */\nexport const SCHEMATIC_RANK = {\n    labels: HOST_RANK,\n    seek: HOST_RANK + 1,\n    chip: HOST_RANK + 2,\n    view: HOST_RANK + 3,\n} as const;\n\n/** The bundle a phone's row folds the tools, the zoom, Fit, the steps and Find into: Find's View popover, one move. */\nexport const SCHEMATIC_VIEW = \"schematic.view\";\n\n/** Each tool's icon, Font Awesome's solid. */\nconst TOOL_ICONS: { readonly [T in SchematicTool]: IconDefinition } = {\n    select: faArrowPointer, zoom: faMagnifyingGlassPlus, marquee: faObjectGroup, connect: faLink, move: faUpDownLeftRight,\n};\n\n/** One link kind Connect may draw. */\nexport interface SchematicLinkChoice {\n    /** Its slot. */\n    readonly key: string;\n    /** Its name (`Fibre run`). */\n    readonly name: string;\n}\n\n/** What the Schematic's toolbar items show and drive. */\nexport interface SchematicToolbarProps {\n    /** The `schematic` recipe's styles. */\n    readonly styles: Styles;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /** The rail: one over the Schematic's `Slice.bindRecords`, its affordances and its persistence; `undefined` with no slice. */\n    readonly chrome: ValueTypeOf<RecordSlicesChromeType> | undefined;\n    /** What the rail's summary counts each source in, by its name. */\n    readonly nouns: Readonly<Record<string, string>> | undefined;\n    /** The tools the Schematic offers, in order. */\n    readonly tools: readonly SchematicTool[];\n    /** The tools in force: the tool held, and the link kind Connect draws. */\n    readonly held: SchematicToolsState;\n    /** The link kinds Connect may draw: the editable ones. */\n    readonly links: readonly SchematicLinkChoice[];\n    /** Picks a tool, or the link kind Connect draws. */\n    readonly onTools: (next: SchematicToolsState) => void;\n    /** Find's source, over the item kinds' keys. */\n    readonly find: KeySearchSource;\n    /** Zooms about the canvas's middle by a factor. */\n    readonly onZoom: (factor: number) => void;\n    /** Where the zoom stands: at Fit Zoom out takes no press, and at the zoom's limit Zoom in takes none (#1393). */\n    readonly zoom: ZoomRange;\n    /** Fits the drawing in view. */\n    readonly onFit: () => void;\n    /** Whether something is selected: the steps show. */\n    readonly selected: boolean;\n    /** Steps the selection to the previous item, or the next. */\n    readonly onStep: (delta: 1 | -1) => void;\n    /** The history item, where the Schematic edits (#1388); `undefined` where it does not. */\n    readonly history?: ToolbarItem | undefined;\n}\n\n/** The tools' strip: each tool, its icon and its name — or its icon alone, named by its name. */\nfunction ToolStrip({ props, iconsOnly, fullWidth, onPicked }: {\n    props: SchematicToolbarProps; iconsOnly: boolean; fullWidth?: boolean; onPicked?: () => void;\n}) {\n    const { words, tools, held, onTools } = props;\n    const items = tools.map((tool) => ({ key: tool, label: words.m.toolName({ tool }), hint: words.m.toolHint({ tool }), icon: TOOL_ICONS[tool] }));\n    return (\n        <Seg label={words.m.toolsLabel()} name=\"tools\" scope=\"schematic\" items={items} active={held.tool} iconsOnly={iconsOnly}\n            fullWidth={fullWidth ?? false} onPick={(tool) => { onTools({ tool, link: held.link }); onPicked?.(); }} />\n    );\n}\n\n/** Connect's menu: the link kind it draws — picking one holds Connect. */\nfunction LinkMenu({ props }: { props: SchematicToolbarProps }) {\n    const { words, links, held, onTools } = props;\n    return (\n        <SegMenu label={words.m.connectDraws()} name=\"link\" scope=\"schematic\" items={links.map((link) => ({ key: link.key, label: link.name }))}\n            active={held.link ?? \"\"} onPick={(link) => onTools({ tool: \"connect\", link })} />\n    );\n}\n\n/** The tools on a row with room: the strip, and Connect's menu while several link kinds are editable. */\nfunction Tools({ props, iconsOnly }: { props: SchematicToolbarProps; iconsOnly: boolean }) {\n    return (\n        <Box css={props.styles.tools} data-schematic-tools={iconsOnly ? \"icons\" : \"\"}>\n            <ToolStrip props={props} iconsOnly={iconsOnly} />\n            {props.links.length > 1 && <LinkMenu props={props} />}\n        </Box>\n    );\n}\n\n/**\n * The tools folded into one chip naming the tool held, whose menu holds every\n * tool — Connect once per link kind it may draw, while several are editable.\n */\nfunction ToolChip({ props }: { props: SchematicToolbarProps }) {\n    const { words, tools, held, links, onTools } = props;\n    const several = links.length > 1;\n    // Each entry, and the tools it holds.\n    const entries = tools.flatMap((tool): { key: string; label: string; next: SchematicToolsState }[] => (tool === \"connect\" && several\n        ? links.map((link) => ({ key: `connect:${link.key}`, label: words.m.connectKind({ name: link.name }), next: { tool, link: link.key } }))\n        : [{ key: tool, label: words.m.toolName({ tool }), next: { tool, link: held.link } }]));\n    const active = held.tool === \"connect\" && several ? `connect:${held.link ?? \"\"}` : held.tool;\n    return (\n        <SegMenu label={words.m.toolsLabel()} name=\"tools\" scope=\"schematic\" items={entries.map(({ key, label }) => ({ key, label }))} active={active}\n            onPick={(key) => {\n                const entry = entries.find((e) => e.key === key);\n                if (entry !== undefined) onTools(entry.next);\n            }} />\n    );\n}\n\n/** Zoom − / + and Fit: the shared strip (`shared/schedule/zoom.tsx`) — Zoom out off at Fit, Zoom in off at the zoom's limit (#1393). */\nfunction ZoomGroup({ props, fullWidth = false }: { props: SchematicToolbarProps; fullWidth?: boolean }) {\n    return <ZoomStrip scope=\"schematic\" words={props.words.m} range={props.zoom} onZoom={props.onZoom} onFit={props.onFit} fullWidth={fullWidth} />;\n}\n\n/** The steps to the previous and the next item: icon buttons, one strip. */\nfunction StepGroup({ props, fullWidth = false }: { props: SchematicToolbarProps; fullWidth?: boolean }) {\n    const seg = useSlotRecipe({ key: \"seg\" })({ fullWidth }) as Styles;\n    const { words, onStep } = props;\n    return (\n        <Box css={seg.root} role=\"group\" aria-label={words.m.stepLabel()} data-schematic-step=\"\">\n            <chakra.button type=\"button\" css={seg.item} aria-label={words.m.previousItem()} title={words.m.previousItem()} onClick={() => onStep(-1)}>\n                <FontAwesomeIcon icon={faChevronLeft} aria-hidden=\"true\" />\n            </chakra.button>\n            <chakra.button type=\"button\" css={seg.item} aria-label={words.m.nextItem()} title={words.m.nextItem()} onClick={() => onStep(1)}>\n                <FontAwesomeIcon icon={faChevronRight} aria-hidden=\"true\" />\n            </chakra.button>\n        </Box>\n    );\n}\n\n/**\n * The View popover's controls (§6.1): on a phone's row, the tools — a pick\n * closes the popover, the canvas taking the next gesture — Connect's link\n * kinds, the zoom, Fit and the steps, over Find's box.\n */\nfunction ViewControls({ props, close }: { props: SchematicToolbarProps; close: () => void }) {\n    const { words, links, held, onTools, selected, styles } = props;\n    return (\n        <Box css={styles.viewControls} data-schematic-view=\"\">\n            <ToolStrip props={props} iconsOnly fullWidth onPicked={close} />\n            {links.length > 1 && (\n                <Seg label={words.m.connectDraws()} name=\"link\" scope=\"schematic\" items={links.map((link) => ({ key: link.key, label: link.name }))}\n                    active={held.link ?? \"\"} fullWidth onPick={(link) => { onTools({ tool: \"connect\", link }); close(); }} />\n            )}\n            <ZoomGroup props={props} fullWidth />\n            {selected && <StepGroup props={props} fullWidth />}\n        </Box>\n    );\n}\n\n/**\n * The Schematic's toolbar items, in §6.1's order and on its fold ladder (see\n * the module docs) — for its frame's one toolbar.\n *\n * @param props - What the items show and drive\n * @returns The items, a falsy entry for each the Schematic has no use for\n */\nexport function useSchematicToolbarItems(props: SchematicToolbarProps): ReadonlyArray<ToolbarItem | false | undefined> {\n    const { words, chrome, nouns, tools, held, links, find, selected, history } = props;\n    // The rail: one over every source of the Schematic's slice, each counted in its own noun.\n    const rail = useRecordSlicesToolbarItems(chrome?.slice, {\n        ...(nouns === undefined ? {} : { nouns }),\n        ...(chrome === undefined ? {} : { affordances: chrome.affordances.map((a) => a.type) }),\n        ...(chrome?.persist.type === \"some\" ? { persist: chrome.persist.value.type } : {}),\n    });\n    // Find: its box, its icon, then the View popover holding the tools, the zoom, Fit and the steps over its box.\n    const seek = useKeySearchToolbarItem(find, {\n        rank: SCHEMATIC_RANK.seek, label: words.m.findLabel(),\n        compact: { label: words.m.viewLabel(), controls: (close) => <ViewControls props={props} close={close} />, phoneView: true },\n    });\n    // What the tools' forms show moves with the tool held and what is offered: their widths are measured again.\n    const toolsVersion = `${held.tool}|${held.link ?? \"\"}|${tools.join(\",\")}|${links.map((link) => link.key).join(\",\")}`;\n    return [\n        ...rail,\n        {\n            key: \"tools\",\n            rank: [SCHEMATIC_RANK.labels, SCHEMATIC_RANK.chip, SCHEMATIC_RANK.view],\n            bundle: [undefined, undefined, SCHEMATIC_VIEW],\n            version: toolsVersion,\n            forms: [<Tools props={props} iconsOnly={false} />, <Tools props={props} iconsOnly />, <ToolChip props={props} />, null],\n        },\n        { key: \"zoom\", rank: SCHEMATIC_RANK.view, bundle: SCHEMATIC_VIEW, forms: [<ZoomGroup props={props} />, null] },\n        seek !== undefined && { ...seek, rank: [SCHEMATIC_RANK.seek, SCHEMATIC_RANK.view], bundle: [undefined, SCHEMATIC_VIEW] },\n        selected && { key: \"step\", rank: SCHEMATIC_RANK.view, bundle: SCHEMATIC_VIEW, forms: [<StepGroup props={props} />, null] },\n        history,\n    ];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The tool the viewer holds, and the link kind Connect draws (#1387, §6.1):\n * the viewer's, held in the UI store under the Schematic's `id`\n * (`schematicKeys(id).tools`) as an East value, so a remount keeps them and two\n * Schematics of one `id` hold one tool, as the Flowchart keeps its orientation.\n * Until the viewer picks, Select; Connect draws the first link kind its\n * Schematic edits.\n *\n * - **Select** — a tap selects; a drag on empty canvas pans.\n * - **Zoom box** — a drag boxes the view the camera flies into.\n * - **Marquee** — a drag boxes the items it selects.\n * - **Connect** — shown while a link kind is editable: a drag from an item to\n *   another records a link of the kind its menu chose.\n * - **Move** — shown while an item kind is editable: a drag moves an item, or\n *   the selection.\n *\n * A tool the Schematic does not offer — Connect over no editable link kind,\n * Move over no editable item kind — is held as Select; a link kind no longer\n * editable, as the first that is.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport { NullType, OptionType, StringType, StructType, VariantType, decodeBeast2For, encodeBeast2For, none, some, variant, type ValueTypeOf } from \"@elaraai/east\";\nimport { StateRuntime } from \"@elaraai/east-ui-components\";\n\n/** A tool, as the UI store holds it. */\nexport const SchematicToolType = VariantType({ select: NullType, zoom: NullType, marquee: NullType, connect: NullType, move: NullType });\n\n/** The tools' state, as the UI store holds it: the tool, and the link kind Connect draws, by its slot. */\nexport const SchematicToolsType = StructType({ tool: SchematicToolType, link: OptionType(StringType) });\n\n/** A tool, by its name. */\nexport type SchematicTool = ValueTypeOf<typeof SchematicToolType>[\"type\"];\n\n/** Every tool, in the toolbar's order. */\nexport const SCHEMATIC_TOOLS: readonly SchematicTool[] = [\"select\", \"zoom\", \"marquee\", \"connect\", \"move\"];\n\nconst encodeTools = encodeBeast2For(SchematicToolsType);\nconst decodeTools = decodeBeast2For(SchematicToolsType);\n\n/** What the viewer holds: the tool, and the link kind Connect draws. */\nexport interface SchematicToolsState {\n    /** The tool held. */\n    readonly tool: SchematicTool;\n    /** The link kind Connect draws, by its slot. */\n    readonly link: string | undefined;\n}\n\n/** What the Schematic offers: the link kinds Connect may draw, and whether Move moves anything. */\nexport interface SchematicToolsOffered {\n    /** The editable link kinds, by their slots, in the order the Schematic lists them. */\n    readonly links: readonly string[];\n    /** Whether an item kind is editable: Move is offered. */\n    readonly movable: boolean;\n}\n\n/**\n * The tools the Schematic offers, in order: Select, Zoom box and Marquee\n * always; Connect over an editable link kind; Move over an editable item kind.\n *\n * @param offered - What the Schematic edits\n * @returns The tools\n */\nexport function offeredTools(offered: SchematicToolsOffered): SchematicTool[] {\n    return SCHEMATIC_TOOLS.filter((tool) => (tool === \"connect\" ? offered.links.length > 0 : tool === \"move\" ? offered.movable : true));\n}\n\n/**\n * What the viewer holds, as the Schematic offers it: a tool it does not offer\n * is Select, and a link kind it does not edit is the first it does.\n *\n * @param held - What the store holds\n * @param offered - What the Schematic edits\n * @returns The tool and the link kind in force\n */\nexport function toolsInForce(held: SchematicToolsState, offered: SchematicToolsOffered): SchematicToolsState {\n    const tool = offeredTools(offered).includes(held.tool) ? held.tool : \"select\";\n    const link = held.link !== undefined && offered.links.includes(held.link) ? held.link : offered.links[0];\n    return { tool, link };\n}\n\n/**\n * The tools the viewer holds under a key, and how to pick another tool or link\n * kind: a write every Schematic under that key follows (see the module docs).\n *\n * @param key - The Schematic's tools key (`schematicKeys(id).tools`)\n * @returns What the store holds — Select and no link kind until the viewer picks — and the write that picks\n */\nexport function useSchematicTools(key: string): [SchematicToolsState, (next: SchematicToolsState) => void] {\n    const store = StateRuntime.getStore();\n    const subscribe = useCallback((notify: () => void) => store.subscribe(key, notify), [store, key]);\n    const snapshot = useCallback(() => store.read(key), [store, key]);\n    const bytes = useSyncExternalStore(subscribe, snapshot);\n    const held = useMemo((): SchematicToolsState => {\n        if (bytes === undefined) return { tool: \"select\", link: undefined };\n        const decoded = decodeTools(bytes);\n        return { tool: decoded.tool.type, link: decoded.link.type === \"some\" ? decoded.link.value : undefined };\n    }, [bytes]);\n    const pick = useCallback((next: SchematicToolsState) => {\n        store.write(key, encodeTools({ tool: variant(next.tool, null), link: next.link === undefined ? none : some(next.link) }));\n    }, [store, key]);\n    return [held, pick];\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * The Schematic's drop target (#1390, `Schematic Builder Spec.md` §7, §8,\n * SC11–SC13): what the frame hands the canvas and the library so that a\n * library card lands, each drop — and each card's ⏎ — one step of the\n * editing's history.\n *\n * - **The target** registers while a tab of the library drops, on the\n *   Schematic's drop target (`schematicKeys(id).surface`), taking the cards\n *   of every such tab. A Schematic that edits nothing still takes a drag: its\n *   drop is refused, the ghost saying why, never lost on nothing.\n * - **The canvas's part** ({@link SchematicCanvasDrop}) plans a drop over the\n *   Schematic as it stands (`drop.ts`' `planDrop`), says where it lands in the\n *   ghost's caption and to a screen reader, and vetoes what it refuses; the\n *   canvas works out where a drag rests from its own drawing.\n * - **A card's ⏎** — and, on a touch screen or below 480px of main, a tap on\n *   the selected card — drops it on the selection, or at the view's centre\n *   (`planEnter`); refused, the footer says why, and a drop that lands clears\n *   it.\n *\n * Below 480px of main (#1394, D15) no card drags: no target registers and the\n * canvas has no drop cell, and a card's ⏎ — a tap on the selected card, or the\n * inspector's Place — is how a card lands.\n *\n * An item a drop adds is keyed as its kind makes one (#1549): a drop its kind\n * makes no key for records nothing, the footer saying why. An item a drop adds or places is selected (SC12). Every function the parts\n * hold reads the frame's latest state, so the parts stay put while the\n * Schematic takes drops.\n *\n * @packageDocumentation\n */\n\nimport { useCallback, useMemo, useRef } from \"react\";\nimport type { schematicKeys } from \"@elaraai/e3-ui/internal\";\nimport { useDragTarget, type DragEventValue, type DragPayload, type DragTargetConfig } from \"@elaraai/east-ui-components\";\nimport type { BacklogEntry } from \"./backlog.js\";\nimport { entityId, type SchematicRef } from \"./canvas/drawn.js\";\nimport type { SchematicValue } from \"./data.js\";\nimport type { SchematicNewKey } from \"./editing.js\";\nimport {\n    cardOf, dropCaption, dropEdits, dropHostOf, dropLabel, dropName, dropRefusal, droppedItem, planDrop, planEnter, readDropAt,\n    type SchematicCanvasDrop, type SchematicDropAt, type SchematicDropCard, type SchematicDropContext, type SchematicDropPlan, type SchematicDropPoint,\n} from \"./drop.js\";\nimport type { SchematicEdit, SchematicKeyRefusal } from \"./edits.js\";\nimport { schematicLibraryId } from \"./library.js\";\nimport type { SchematicWords } from \"./messages.js\";\n\n/** The names a Schematic keeps its viewer's state under. */\ntype SchematicKeys = ReturnType<typeof schematicKeys>;\n\n/** What the frame hands its drop target. */\nexport interface SchematicDropProps {\n    /** The payload: its library's tabs, and its item, link and net kinds' templates. */\n    readonly value: SchematicValue;\n    /** The Backlog's rows in hand: what its cards place. */\n    readonly backlog: readonly BacklogEntry[];\n    /** What a card of the paged Backlog places, by its id (#1393); `undefined` while the Backlog lists only rows in hand. */\n    readonly pagedBacklog?: ((key: string) => SchematicDropCard | undefined) | undefined;\n    /** The names the Schematic keeps its state under: its library's id, and its drop target. */\n    readonly keys: SchematicKeys;\n    /** The Schematic as it stands now — never a render's copy: what a drop plans over. */\n    readonly context: () => SchematicDropContext;\n    /** Records a drop's edits as one step of the history, under its name; whether anything was recorded. */\n    readonly record: (edits: readonly SchematicEdit[], label: string) => boolean;\n    /** A new row's key, as its kind makes one from the edit making it (`editing.ts`' `newKey`, #1549). */\n    readonly newKey: (made: SchematicEdit) => SchematicNewKey | undefined;\n    /** Says why a drop records nothing, its new item's key refused (#1549), in the footer. */\n    readonly keyRefused: (refusal: SchematicKeyRefusal) => void;\n    /** What the canvas has selected now, each entity by its reference. */\n    readonly selection: () => readonly SchematicRef[];\n    /** The view's centre, at the screen's resolution; `undefined` while the canvas has no size. */\n    readonly centre: () => SchematicDropPoint | undefined;\n    /** Selects the item a drop added or placed, by its id. */\n    readonly select: (id: string) => void;\n    /** Says why a card's ⏎ was refused, in the footer; `undefined` clears it. */\n    readonly notice: (text: string | undefined) => void;\n    /** The Schematic's words. */\n    readonly words: SchematicWords;\n    /** The drawing's scale unit, if it has one: what the words measure a drop's point in. */\n    readonly unit: string | undefined;\n    /** Whether a card drags onto the canvas: `false` below 480px of main (#1394, D15), where no target registers and the canvas has no drop cell. */\n    readonly drags?: boolean | undefined;\n}\n\n/** What the drop target hands the canvas and the library. */\nexport interface SchematicDropState {\n    /** The canvas's drop cell; `undefined` while no tab of the library drops, or no card drags. */\n    readonly canvas: SchematicCanvasDrop | undefined;\n    /** A card's ⏎ (SC13): the card, by its library and its key, dropped on the selection or at the view's centre. */\n    readonly enter: (library: string, key: string) => void;\n}\n\n/**\n * The Schematic's drop target — see the module docs.\n *\n * @param props - The payload and its backlog, the Schematic's keys, how a drop reads the Schematic and records itself, the\n *   canvas's selection and centre, what a drop selects, the footer's line, and the words\n * @returns The canvas's drop cell, and a card's ⏎\n */\nexport function useSchematicDrop(props: SchematicDropProps): SchematicDropState {\n    const { value, backlog, pagedBacklog, keys, drags = true } = props;\n    // The latest props, which every function of the parts reads: the parts stay put.\n    const latest = useRef(props);\n    latest.current = props;\n    // Each tab of the library that drops, under the library its cards drag from.\n    const host = useMemo(() => dropHostOf(keys.surface, (tabKey) => schematicLibraryId(keys, tabKey), value.library,\n        { items: value.items, links: value.links, nets: value.nets }, backlog, pagedBacklog),\n    [keys, value.library, value.items, value.links, value.nets, backlog, pagedBacklog]);\n    const drops = host.libraries.size > 0;\n\n    /** What a card's drop where a drag rests does, over the Schematic as it stands now. */\n    const plan = useCallback((card: SchematicDropCard, at: SchematicDropAt): SchematicDropPlan => planDrop(card, at, latest.current.context()), []);\n    /** A completed drag, or a candidate: the card it carries, and what its drop does. */\n    const read = useCallback((event: DragEventValue): { readonly card: SchematicDropCard; readonly plan: SchematicDropPlan } | undefined => {\n        if (event.type !== \"add\") return undefined;\n        const card = cardOf(host, event.value.from.library, event.value.from.key);\n        const at = readDropAt(event.value.into.row);\n        return card === undefined || at === undefined ? undefined : { card, plan: plan(card, at) };\n    }, [host, plan]);\n    /** Runs a plan as one step of the history — the footer's line cleared, and the item it adds or places selected; whether it was recorded. */\n    const run = useCallback((card: SchematicDropCard, planned: SchematicDropPlan): boolean => {\n        const p = latest.current;\n        if (planned.kind === \"refused\") return false;\n        const made = dropEdits(planned, p.newKey);\n        if (made === undefined) return false;\n        if (\"refused\" in made) {\n            p.keyRefused(made.refused);\n            return false;\n        }\n        if (!p.record(made.edits, dropLabel(planned, card, p.words, p.unit))) return false;\n        p.notice(undefined);\n        const item = droppedItem(planned, made.edits);\n        if (item !== undefined) p.select(entityId(item));\n        return true;\n    }, []);\n\n    // The Schematic's drop target, taking the cards of every tab of its library that drops — while a card drags.\n    const target = useMemo((): DragTargetConfig | null => (!drops || !drags ? null : {\n        id: host.surface,\n        sources: [...host.libraries.keys()],\n        kinds: { add: true },\n        onDrag: (event) => {\n            const drop = read(event);\n            return drop !== undefined && run(drop.card, drop.plan);\n        },\n    }), [drops, drags, host, read, run]);\n    useDragTarget(target);\n\n    const canvas = useMemo((): SchematicCanvasDrop | undefined => {\n        if (!drops || !drags) return undefined;\n        const cardOfPayload = (payload: DragPayload): SchematicDropCard | undefined =>\n            (payload.kind === \"item\" ? cardOf(host, payload.from.library, payload.from.key) : undefined);\n        /** What a drop of what a drag carries does where its coordinate says it rests. */\n        const planAt = (row: string, payload: DragPayload): SchematicDropPlan | undefined => {\n            const card = cardOfPayload(payload);\n            const at = readDropAt(row);\n            return card === undefined || at === undefined ? undefined : plan(card, at);\n        };\n        return {\n            surface: host.surface,\n            cardOf: cardOfPayload,\n            plan,\n            canDrop: (event) => {\n                const drop = read(event);\n                return drop !== undefined && drop.plan.kind !== \"refused\";\n            },\n            options: {\n                caption: (coord, payload) => {\n                    const planned = planAt(coord.row, payload);\n                    return planned === undefined ? undefined : dropCaption(planned, latest.current.words, latest.current.unit);\n                },\n                name: (coord, payload) => {\n                    const planned = planAt(coord.row, payload);\n                    return planned === undefined ? \"\" : dropName(planned, latest.current.words, latest.current.unit);\n                },\n            },\n        };\n    }, [drops, drags, host, plan, read]);\n\n    // A card's ⏎ (SC13): a drop on the selection, or at the view's centre — refused, the footer says why.\n    const enter = useCallback((libraryId: string, key: string) => {\n        const card = cardOf(host, libraryId, key);\n        if (card === undefined) return;\n        const p = latest.current;\n        const planned = planEnter(card, p.selection(), p.centre(), p.context());\n        if (planned.kind === \"refused\") {\n            p.notice(dropRefusal(planned, p.words));\n            return;\n        }\n        // Not refused: whatever the footer said of an earlier ⏎ no longer holds — though a drop that changes nothing records nothing.\n        p.notice(undefined);\n        run(card, planned);\n    }, [host, run]);\n\n    return { canvas, enter };\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `EastChakraSchematic` — the Schematic (#1384, #1386, #1387, `Schematic\n * Builder Spec.md` §6): the one Schematic, laid out in its `BuilderFrame`\n * wherever it is used, as the Flowchart is. There is no other Schematic: no\n * canvas without the frame, and no toolbar but its one.\n *\n * It registers itself against the `Schematic` extension\n * (`Schematic.Component`) as the module loads. It draws the app's own records\n * (#1386): its reader (`data.ts`), in a component of its own, reads each\n * kind's rows and hands the frame what the canvas draws (`canvas/drawn.ts`),\n * each entity named by its kind's slot and its key. The frame places its parts\n * in its regions over one shared state — what was read, the tool held, what\n * the layers do, and whether anything is selected:\n *\n * - **the toolbar** — the Schematic's items (`useSchematicToolbarItems`,\n *   `toolbar.tsx`) on the frame's one folding row, in §6.1's order: the rail\n *   over its `Slice.bindRecords` and its summary, the tools, Zoom − / + and\n *   Fit, Find over every item kind's record by key (`find.ts`, #1404) — a pick\n *   of an item the rail's filters leave out clearing the choices that do,\n *   flying to it and selecting it once the narrowing they leave draws it, as\n *   every builder's hidden pick does (`shared/schedule/hidden-pick.tsx`), and\n *   one on a hidden layer or with no position flown to where it stands, the\n *   footer saying why — and the steps through the items while something is\n *   selected.\n *   The tool held and the link kind Connect draws are the viewer's, kept under\n *   the Schematic's `id` (`tools.ts`). ⌘F, or Ctrl+F, anywhere in the frame\n *   focuses Find;\n * - **main** — the canvas (`canvas/view.tsx`), filling main, the minimap and\n *   the scale bar on it and no control of its own; the toolbar drives its\n *   camera and its steps through its handle;\n * - **the footer** — only what is live (`footer.tsx`): a kind drawn as its\n *   density, how many rows it shades in the view; why a gesture was refused;\n *   each Save's notice; and where Find's last pick landed off the canvas, why.\n *   The drawing's counts and each record's last save are the inspector's\n *   (`counts.ts`), the changes waiting on Save the history's;\n * - **the banners** — each record's session's (`SessionBanners`), titled by\n *   its kind, and each source the library follows whose narrowing could not be\n *   read, with Retry. A kind's read that fails is said once where it happened\n *   (#1398, CL11): on the canvas, at the top-left in view of the area it failed\n *   reading — the canvas's own top-left for a kind read whole or the drawing's\n *   read — with Retry, and in the footer's line: a kind read through its\n *   source of the slice asks the source again, and one read whole is read\n *   again;\n * - **the library** — the start pane, when `library` lists a tab (#1389,\n *   `library.tsx`): every kind's templates, the item kinds' backlog, the\n *   zones' Index — the zone the viewport is in marked, a row's click flying\n *   to what it names — the Layers tab, whose choices the canvas obeys\n *   (`layers-view.ts`), and the author's tabs, each following the source of\n *   the rail it names (`FollowSources`), whose failed narrowing is a banner\n *   with Retry. Which card each tab has selected is the frame's: the\n *   template selected is what a Connect's new link or net takes its fields\n *   from (§4.3);\n * - **the drops** (#1390, `use-drop.ts`): the library's cards land on the\n *   canvas, the Schematic's drop target — an item template adding an item\n *   where it lands, a backlog row placed there, a link or net template\n *   writing its values over a link or a net of its kind, an author's card\n *   setting its fields on an entity of the kind its patch names — each one\n *   step of the history, an item it adds or places selected; ⏎ on a card,\n *   and on a touch screen a tap on the selected card, drops it on the\n *   selection or at the view's centre, and where that is refused the footer\n *   says why;\n * - **the inspector** (#1391, `inspector.tsx`): the end pane, given\n *   `inspector` — Details of what is selected (`inspect.ts`), its rows read in\n *   a component of their own (`inspector-rows.ts`), every edit one step of the\n *   history; and Issues (`issues.ts`), each selecting what it names — a kind\n *   read by area checked in the rows read around the view and every unsaved\n *   change, a line naming it and saying its other rows are checked only as the\n *   view reaches them. An unsaved change the drawing leaves out, waiting in its\n *   session (`drafted.ts`' `waitingDrafts`), is checked as its draft has it,\n *   never drawn: its issue says which of the rail's choices hide it (the shared\n *   hidden pick, each kind's read through its source in `SchematicFollows`), and\n *   Go to issue clears them, then flies to where its draft stands and selects\n *   it once it draws — the frame's one hidden pick, Find's too. Enter, or a\n *   double-click on an entity, opens Details, its open tab kept per viewer.\n *   An issue gone to, from the toolbar or from its line in Issues, asks its\n *   row's Details for the field it names, which takes the keyboard there, the\n *   inspector opened at Details where it is collapsed or at Issues.\n *   A selected row of a kind read by area its window no longer holds stays\n *   selected, and Details shows it as its stored row reads, by its key\n *   (`selected-rows.ts`, §4.5): a pan or a zoom lets go of nothing, and only a\n *   read proving it gone, its drafts, its layer or the narrowing let go of it;\n * - **the narrow layout** (#1394, §9, D15): below 480px of main — measured by\n *   the canvas's element, which fills it, as `useContainerBelow` measures the\n *   other builders' — the canvas pans, pinches and selects, and nothing drags:\n *   the tools hold no Move or Connect, no card drags and the canvas has no\n *   drop cell, and a selected link draws no handle. A tap on the selected card\n *   drops it, whatever the pointer, and Details gains the actions the canvas\n *   doesn't take — an item's Connect to…, and for the Backlog's card picked an\n *   item with no position, its Place — beside its Move (`x`, `y`), its ends,\n *   its sides and Delete. Resizing keeps the tool held, the selection and the\n *   drafts;\n * - **the narrowing** (#1392, `narrowing.ts`): each kind's source of the rail,\n *   its shown keys followed while the narrowing dims or looks at its matches,\n *   hiding what it leaves out or drawing it as context; every list — the\n *   Index, the Backlog, the Choosers, what an item is joined to — and every\n *   count shows what it leaves in, Find names the choices that leave an item\n *   out — hidden by them, or dimmed by them where it draws as context — and\n *   the canvas rings, frames and flies to its matches — `fit` keyed on the\n *   narrowing itself, each source's choices, and a kind read by area flown to\n *   by the box its area index finds its narrowing's rows in, never by what its\n *   window draws (§10.3). A drafted row of a kind\n *   read by area its window doesn't hold is the narrowing's or not as the row\n *   its session began from answers, read in a component of its own\n *   (`drafts-narrowing.ts`);\n * - **the skeleton** — `BuilderFrame.loading` covers the frame until every\n *   kind has been read once (or its read failed); later reads keep the canvas\n *   and what it draws until they land, main `aria-busy` meanwhile\n *   (`BuilderFrame.busy`, #1398 CL12), as it is while a narrowing resolves\n *   (§6.5, §10.4) — the canvas washing the area a window's read has not drawn\n *   yet, and a card whose details are read holding their places (CL2); the\n *   footer's line saying what is read (CL3); each placeholder and the line on\n *   the frame's one reveal clock (CL4), the inspector's reads among what it\n *   waits on. While a new narrowing is read, what the canvas draws under the\n *   last stands in, kept — its grid's rules dashed and its words in the third\n *   ink — and retained (CL8): readable, focusable and selectable, taking no\n *   edit by any route — a gesture, a drop, the inspector — until it lands.\n *\n * Every gesture is one step of one history over a session per record the\n * Schematic writes (`editing.ts`, #1388): the canvas records each gesture's\n * edits (`edits.ts`), and draws the stored rows with the drafts in place\n * (`drafted.ts`), and what a Save landed of a kind read by area as the Save\n * left it — on the canvas, in the Index and in Details — until the kind's\n * window and the Index's read of it are read since. A new row is keyed as its\n * kind makes one (#1549), and a row\n * whose kind builds its key from its fields follows the key a gesture's edit\n * of them builds, the links and nets naming it with it — every route's edits,\n * the canvas's, a drop's and the inspector's, recorded so — refused, the\n * footer naming the row that holds the key, or saying the filters hide, or no\n * read holds, rows of a link or net kind that may name it (#1580), or that its\n * details or the rows naming it take no edit now (#1584); a lone selected entity that moves\n * stays selected under its new key. The history item ends the toolbar while a record is edited —\n * Undo, Redo, Discard and Save — and ⌘Z, ⇧⌘Z and ⌘Y take it anywhere in the\n * frame but a field typed into.\n *\n * An item whose row, or its details row, holds a number outside its field's\n * bounds (#1585) wears the warn ring, stored or changed, as one holding a\n * conflict does — the rows read in a component of their own (`bounds.ts`) —\n * and Issues lists a stored row's as a warning; a changed row's holds Save.\n *\n * The layers hide, lock and dim the entities on them as their author defaults\n * say (`canvas/layers.ts`), and the viewer's choices in the Layers tab over\n * them, kept under the Schematic's `id`. The host hears the whole selection through\n * `onSelect`, and vets a connection through `canConnect` (#1401, D34). The\n * Schematic fills the box it is given and draws no border: a host gives it a\n * box of its own height.\n *\n * @packageDocumentation\n */\n\nimport { memo, useCallback, useLayoutEffect, useMemo, useRef, useState, type KeyboardEvent } from \"react\";\nimport { Box, Button, useSlotRecipe, type SystemStyleObject } from \"@chakra-ui/react\";\nimport { ArrayType, StringType, compareFor, equalFor, equivalentFor, none, printFor, some, type EastType, type PatchPath, type option } from \"@elaraai/east\";\nimport { RecordSliceWhereType } from \"@elaraai/east-ui/internal\";\nimport { Schematic, schematicAreaIndexes, schematicKeys } from \"@elaraai/e3-ui/internal\";\nimport {\n    BannerView, BuilderFrame, SessionBanners, editingMessages, focusKeySearch, getSomeorUndefined, historyShortcut, historyToolbarItem,\n    implementUIComponent, takeKey, typedInto, useContainerBelow, useDataStable, useFormatters, usePersistedState, useSlicesReactivity,\n    type BuilderFramePanes, type EditIssue, type EditingWords, type HistoryAction, type Origin,\n} from \"@elaraai/east-ui-components\";\nimport { LoadingReveal, loadingLineText, schematicColorTokens, type LoadingLineText, type LoadingLineValue, keptRead } from \"@elaraai/east-ui-components/internal\";\nimport { DraftedStanding } from \"../shared/schedule/drafted-rows.js\";\nimport { FieldAskProvider, useFieldAsks } from \"../shared/schedule/field-ask.js\";\nimport { FollowSources, type FollowedSources } from \"../shared/schedule/follow-sources.js\";\nimport type { SourceHiding } from \"../shared/schedule/hidden.js\";\nimport { HideSources, useHiddenPick, type HiddenPicks, type HiddenSource } from \"../shared/schedule/hidden-pick.js\";\nimport { kindKeys as keysOfType } from \"../shared/schedule/kind-keys.js\";\nimport { rowCodec } from \"../shared/schedule/records.js\";\nimport { sourcePart, type KeyVisibilityWords, type SourcesChrome } from \"../shared/schedule/visibility.js\";\nimport { kindPlural } from \"../shared/schedule/words.js\";\nimport { NARROW_WIDTH } from \"../shared/schedule/window.js\";\nimport type { ZoomRange } from \"../shared/schedule/zoom.js\";\nimport { createViewportStore, type SchematicViewportStore } from \"./area.js\";\nimport { backlogEntries } from \"./backlog.js\";\nimport { SchematicBacklogPages, type BacklogAreaKind, type BacklogPageCount } from \"./backlog-pages.js\";\nimport { NO_BREACHES, SchematicBoundsReader } from \"./bounds.js\";\nimport {\n    SchematicCanvas, type SchematicCanvasEditing, type SchematicCanvasFailure, type SchematicCanvasFit, type SchematicCanvasHandle, type SchematicCanvasNarrowing,\n} from \"./canvas/view.js\";\nimport { entityId, refOfId, type DrawnItem, type DrawnLink, type DrawnNet, type DrawnZone, type ItemRoles, type SchematicRef } from \"./canvas/drawn.js\";\nimport { layerState } from \"./canvas/layers.js\";\nimport type { SchematicStanding } from \"./canvas/use-canvas-selection.js\";\nimport { hostZones, zoneHolding, type WorldBox } from \"./canvas/model.js\";\nimport { INITIAL_SCHEMATIC_DATA, SchematicDataReader, areaSlots, type SchematicData, type SchematicValue } from \"./data.js\";\nimport { SchematicAreaCountsReader, NO_AREA_COUNTS } from \"./area-counts.js\";\nimport { draftedAreaCounts, savedRecords, schematicCounts, type SchematicDrawingCount } from \"./counts.js\";\nimport { draftedDrawing, landedDrafts, landedRead, landedWindows, waitingDrafts, waitingPoint, withWaiting, type DraftedCache } from \"./drafted.js\";\nimport { NO_DRAFTS_NARROWING, SchematicDraftsReader, draftHeld, type SchematicDraftsNarrowing } from \"./drafts-narrowing.js\";\nimport type { SchematicDropContext, SchematicDropKind } from \"./drop.js\";\nimport { connectVeto, editKinds, followBuiltKeys, type NetLeg, type SchematicEdit, type SchematicKeyRefusal, type SchematicUnheld } from \"./edits.js\";\nimport { recordSlot, useSchematicEditing, type SchematicKeyWords, type SchematicMove } from \"./editing.js\";\nimport { foundMark, useSchematicFind, type FindKind, type FoundItem } from \"./find.js\";\nimport { SchematicFooter, type SchematicNotice } from \"./footer.js\";\nimport { drawnEntities, entityNames, inspectedEqual, inspectedOf, nameOfEntity, type SchematicInspected, type SchematicUnplaced } from \"./inspect.js\";\nimport { schematicInspectorPane, type SchematicInspectorEditing } from \"./inspector.js\";\nimport { NO_INSPECTED_ROWS, SchematicInspectedReader, type SchematicInspectedRows } from \"./inspector-rows.js\";\nimport { boundsIssues, drawingIssues, sessionIssues, type SchematicBreaches } from \"./issues.js\";\nimport { SchematicIndexArea, type IndexAreaKind } from \"./index-area.js\";\nimport { KindRows } from \"./kind-rows.js\";\nimport { layersInForce, useSchematicLayerView } from \"./layers-view.js\";\nimport { SchematicBacklogCountReader, schematicLibraryId, useSchematicLibrary, type SchematicBacklogNarrowing } from \"./library.js\";\nimport { coordinate, schematicMessagesOf, type SchematicWords } from \"./messages.js\";\nimport { NO_SELECTED_ROWS, SchematicSelectedReader, type SchematicSelectedRows } from \"./selected-rows.js\";\nimport { looksAtMatches, narrowedDrawing, narrowedLook, schematicNarrowing, type SchematicNarrowedLook } from \"./narrowing.js\";\nimport { useSchematicToolbarItems, type SchematicLinkChoice } from \"./toolbar.js\";\nimport { offeredTools, toolsInForce, useSchematicTools, type SchematicToolsOffered } from \"./tools.js\";\nimport { useSchematicDrop } from \"./use-drop.js\";\n\ntype Styles = Record<string, SystemStyleObject>;\n\n// The memo compares closures too (#809): a payload whose functions captured new\n// data is a new payload, which the reader reads again; what it draws keeps its\n// identity while nothing it shows moves, so an in-progress edit or the camera\n// is never replaced by a closure-only change.\nconst schematicEqual = equivalentFor(Schematic.Types.Payload);\nconst layersEqual = equalFor(ArrayType(Schematic.Types.Layer));\nconst narrowedEqual = equalFor(Schematic.Types.Narrowed);\nconst vocabularyEqual = equalFor(Schematic.Types.Payload.fields.vocabulary);\nconst stringEqual = equalFor(StringType);\nconst compareString = compareFor(StringType);\nconst printWhere = printFor(RecordSliceWhereType);\n\nexport type { SchematicValue } from \"./data.js\";\n\n/** An item as the canvas draws it. */\nexport type SchematicItemValue = DrawnItem;\n\n/** A zone as the canvas draws it. */\nexport type SchematicZoneValue = DrawnZone;\n\n/** A link as the canvas draws it. */\nexport type SchematicLinkValue = DrawnLink;\n\n/** A net (bus / trunk) as the canvas draws it. */\nexport type SchematicNetValue = DrawnNet;\n\n/** The props `EastChakraSchematic` takes: the payload and its structural storage key. */\nexport interface EastChakraSchematicProps {\n    /** The payload, decoded. */\n    value: SchematicValue;\n    /**\n     * The structural storage key: the editing's sessions are kept under it and the Schematic's `id` (#1388), and the\n     * frame keeps its panes under the `id` (`schematicKeys(id).frame`).\n     */\n    storageKey: string;\n}\n\n/**\n * Renders the Schematic (e3-ui's `<Schematic>`): its reader, which reads each\n * kind's rows (`data.ts`), and its frame, which lays the canvas and its chrome\n * out over what it read — see the module docs.\n *\n * @param props - The payload and its storage key\n * @returns The Schematic, in its frame\n */\nexport const EastChakraSchematic = memo(function EastChakraSchematic({ value, storageKey }: EastChakraSchematicProps) {\n    const [data, setData] = useState<SchematicData>(INITIAL_SCHEMATIC_DATA);\n    // A Retry of a kind read whole reads every kind again: the read's attempt moves.\n    const [attempt, setAttempt] = useState(0);\n    const readAgain = useCallback(() => setAttempt((n) => n + 1), []);\n    // Where the canvas's viewport rests (#1393): the canvas writes it, the reader reads its windows around it.\n    const [viewport] = useState(createViewportStore);\n    return (\n        <>\n            <SchematicDataReader value={value} attempt={attempt} viewport={viewport} onData={setData} />\n            <SchematicFollows value={value} data={data} readAgain={readAgain} storageKey={storageKey} viewport={viewport} />\n        </>\n    );\n}, (prev, next) => schematicEqual(prev.value, next.value) && prev.storageKey === next.storageKey);\n\n/** Props of {@link SchematicFrame}. */\ninterface SchematicFrameProps {\n    /** The payload, decoded. */\n    readonly value: SchematicValue;\n    /** What the reader has read. */\n    readonly data: SchematicData;\n    /** Reads every kind again: a Retry of a kind read whole. */\n    readonly readAgain: () => void;\n    /** The structural storage key: the editing's sessions are kept under it and the Schematic's `id`. */\n    readonly storageKey: string;\n    /** Where the canvas's viewport rests, which the canvas writes as its camera comes to rest (#1393). */\n    readonly viewport: SchematicViewportStore;\n}\n\n/**\n * The sources of the rail the Schematic follows (#1389, #1392): each kind's\n * templates record's, each an author's tab names, and — while the narrowing\n * draws its context or its matches — each kind's read through its source;\n * each once, in order, with what the rail counts each in: a kind's templates,\n * an author's tab's name, a kind's rows.\n *\n * @param value - The payload\n * @param words - The Schematic's words\n * @param chrome - The rail; `undefined` with no slice\n * @param look - How a narrowed-out row draws, and what the matches take\n * @returns The sources, and their nouns, by name\n */\nfunction followedSources(value: SchematicValue, words: SchematicWords, chrome: SourcesChrome | undefined, look: SchematicNarrowedLook): {\n    sources: string[]; nouns: Map<string, string>;\n} {\n    const nouns = new Map<string, string>();\n    for (const kind of [...value.items, ...value.links, ...value.nets]) {\n        const source = getSomeorUndefined(kind.templatesSource);\n        if (source !== undefined && !nouns.has(source)) nouns.set(source, words.m.templatesNoun({ name: kind.name.toLocaleLowerCase(words.locale) }));\n    }\n    for (const tab of value.library) {\n        const source = tab.type === \"tab\" ? getSomeorUndefined(tab.value.source) : undefined;\n        if (tab.type === \"tab\" && source !== undefined && !nouns.has(source)) nouns.set(source, tab.value.name.toLocaleLowerCase(words.locale));\n    }\n    // A kind's own source: its shown keys say what is context, dimmed, and what matches — read only while either draws.\n    // A kind read by area asks its window's rows of its narrowing instead, never the narrowing's keys whole (D28).\n    if (look.dim || looksAtMatches(look)) {\n        const areas = areaSlots(value);\n        for (const kind of [...value.items, ...value.zones, ...value.links, ...value.nets]) {\n            if (sourcePart(chrome, kind.key) !== undefined && !areas.has(kind.key) && !nouns.has(kind.key)) {\n                nouns.set(kind.key, words.m.kindNoun({ name: kind.name.toLocaleLowerCase(words.locale), plural: true }));\n            }\n        }\n    }\n    return { sources: [...nouns.keys()], nouns };\n}\n\n/**\n * The frame, once each source it follows is read (#1389, #1392): what each\n * templates list and each author's tab shows of the source it names, and each\n * kind's matches — and each kind's hidden pick, every kind read through its\n * source of the rail (`HideSources`, the shared hidden pick): what Find's lines\n * and an issue's say of a row the rail's filters leave out, and what a pick of\n * one clears — one component a source, so a payload naming another set keeps\n * each one's hooks in order.\n */\nfunction SchematicFollows(props: SchematicFrameProps) {\n    const { value } = props;\n    const formatters = useFormatters();\n    const vocabulary = useDataStable(value.vocabulary, vocabularyEqual);\n    const words = useMemo((): SchematicWords => ({ ...formatters, m: schematicMessagesOf(vocabulary) }), [formatters, vocabulary]);\n    const chrome = useMemo(() => getSomeorUndefined(value.slice), [value.slice]);\n    const narrowed = useDataStable(value.narrowed, narrowedEqual);\n    const look = useMemo(() => narrowedLook(narrowed), [narrowed]);\n    const { sources, nouns } = useMemo(() => followedSources(value, words, chrome, look), [value, words, chrome, look]);\n    // What a source's failed narrowing says, in the Schematic's words.\n    const said = useCallback((name: string): KeyVisibilityWords => ({ changed: words.m.sourceChanged({ name }), failed: words.m.sourceFailed({ name }) }), [words]);\n    // Every kind read through its source of the rail, in the Schematic's order of its kinds: each one's hidden pick, which\n    // asks e3 of a row at its kind's key type (#1549).\n    const hidden = useMemo(() => [...value.items, ...value.zones, ...value.links, ...value.nets].flatMap((kind): HiddenSource[] => {\n        const part = sourcePart(chrome, kind.key);\n        return part === undefined ? [] : [{ key: kind.key, part, keyType: kind.keyType }];\n    }), [value.items, value.zones, value.links, value.nets, chrome]);\n    return (\n        <FollowSources chrome={chrome} narrowed={value.shown} sources={sources} nouns={nouns} said={said}>\n            {(followed) => (\n                <HideSources name=\"Schematic\" sources={hidden}>\n                    {(picks) => <SchematicFrame {...props} followed={followed} look={look} picks={picks} />}\n                </HideSources>\n            )}\n        </FollowSources>\n    );\n}\n\n/** No entity selected. */\nconst NOTHING_SELECTED: ReadonlySet<string> = new Set();\n\n/** No card of the library selected. */\nconst NO_PICKS: ReadonlyMap<string, string> = new Map();\n\n/** No kind the Index reads by area. */\nconst NO_INDEX_REVISIONS: ReadonlyMap<string, string> = new Map();\n\n/**\n * Whether two reports of the revision the Index read each kind at say the same.\n *\n * @param a - One, by slot\n * @param b - The other\n * @returns Whether they do\n */\nfunction sameRevisions(a: ReadonlyMap<string, string>, b: ReadonlyMap<string, string>): boolean {\n    if (a.size !== b.size) return false;\n    for (const [slot, revision] of a) {\n        const other = b.get(slot);\n        if (other === undefined || !stringEqual(other, revision)) return false;\n    }\n    return true;\n}\n\n/** The zoom as the canvas opens: at Fit. */\nconst AT_FIT: ZoomRange = { atFit: true, atLimit: false };\n\n/** What the tools offer below 480px of main (#1394, D15): no Move and no Connect, the inspector's actions there. */\nconst VIEW_ONLY: SchematicToolsOffered = { links: [], movable: false };\n\n/** No link kind Connect's menu draws: below 480px of main, where no Connect is offered. */\nconst NO_LINK_CHOICES: readonly SchematicLinkChoice[] = [];\n\n/** The theme colour tokens a colour may name (D14): what the Issues tab holds each colour to (#1391). */\nconst THEME_COLOURS: ReadonlySet<string> = new Set(schematicColorTokens);\n\n/** The frame, its regions holding the Schematic's parts over one shared state — see the module docs. */\nfunction SchematicFrame({ value, data, readAgain, storageKey, viewport, followed, look, picks }: SchematicFrameProps & {\n    readonly followed: FollowedSources;\n    readonly look: SchematicNarrowedLook;\n    readonly picks: HiddenPicks;\n}) {\n    // The recipe's styles, resolved once a recipe: the frame renders again as each window lands.\n    const recipe = useSlotRecipe({ key: \"schematic\" });\n    const styles = useMemo(() => recipe() as Styles, [recipe]);\n    // The counts and the dates, in the app's locale (#850), and the Schematic's words.\n    const formatters = useFormatters();\n    const vocabulary = useDataStable(value.vocabulary, vocabularyEqual);\n    const words = useMemo((): SchematicWords => ({ ...formatters, m: schematicMessagesOf(vocabulary) }), [formatters, vocabulary]);\n    // Keyed on the id's text: each payload decodes its Option afresh, and the keys must hold while the id does.\n    const id = getSomeorUndefined(value.id);\n    const keys = useMemo(() => schematicKeys(id), [id]);\n    const chrome = useMemo(() => getSomeorUndefined(value.slice), [value.slice]);\n\n    // ── The editing (#1388, §7): one history over a session per record it writes ─────\n    // Each kind read through its source: its Save's notice counts what leaves the source's narrowing.\n    const recordSlices = useMemo(() => [...value.items, ...value.zones, ...value.links, ...value.nets].flatMap((kind) => {\n        const part = kind.editable ? sourcePart(chrome, kind.key) : undefined;\n        return part === undefined ? [] : [part];\n    }), [value.items, value.zones, value.links, value.nets, chrome]);\n    // The kinds read by area (#1393): never read whole, nor their narrowing complete.\n    const areas = useMemo(() => areaSlots(value), [value]);\n    // The rows of the kinds read by area that the paged Backlog and the Index read outside the window (#1393), as their\n    // `rowsOf` makes them: what a gesture on one rewrites, asked as the gesture reads it.\n    const [kindRows] = useState(() => new KindRows<ItemRoles>());\n    const pagedRow = useCallback((slot: string, key: string) => kindRows.rowOf(slot, key), [kindRows]);\n    // ── What stands in while a new narrowing is read (#1398, CL5, CL8; the loading design's retained card) ──\n    // Each kind read through its source of the rail.\n    const sourced = useMemo(() => new Set([...value.items, ...value.zones, ...value.links, ...value.nets]\n        .flatMap((kind) => (sourcePart(chrome, kind.key) === undefined ? [] : [kind.key]))), [value.items, value.zones, value.links, value.nets, chrome]);\n    // Which drafted rows of the kinds read by area their narrowing holds, by the row each one's session began from (#1393).\n    const [draftsNarrowing, setDraftsNarrowing] = useState<SchematicDraftsNarrowing>(NO_DRAFTS_NARROWING);\n    // A kind's narrowing resolving — its shown keys, or its drafted rows' answers: the frame is busy, its last membership\n    // drawn meanwhile.\n    const narrowingBusy = draftsNarrowing.busy\n        || [...sourced].some((slot) => { const one = followed.get(slot); return one !== undefined && one.shown.busy && one.error === undefined; });\n    // What the canvas draws under the last narrowing stands in while a new one is read — a kind's rows, or the matches a\n    // source the frame follows says — kept: its grid's rules dashed and its words in the third ink. While it stands in, or\n    // a narrowing the frame follows could not be read, it is retained: readable, focusable and selectable, its selection\n    // kept, and no record takes an edit by any route until the new one lands; the history stays live.\n    const stale = data.ready && (data.filtering || narrowingBusy);\n    const retained = stale || [...sourced].some((slot) => followed.get(slot)?.error !== undefined);\n    // What the editing says of a new row's key (#1549): its kind's name as running text writes it.\n    const keyWords = useMemo((): SchematicKeyWords => ({ placeholder: ({ name }) => words.m.keyPlaceholder({ name: name.toLocaleLowerCase(words.locale) }) }), [words]);\n    const editing = useSchematicEditing(value, `${storageKey}.${id ?? \"schematic\"}`, recordSlices, data.held, areas, data.windows, keyWords, pagedRow, retained);\n    const editingWords = useMemo((): EditingWords => ({ ...formatters, m: editingMessages }), [formatters]);\n    // What the canvas draws: the stored rows, the drafts in place, each drafted row drawn once.\n    const draftedCache = useRef<DraftedCache>(new WeakMap());\n    // Which drafted rows draw, and what the canvas last drew of them: what stands through a carry-over (`drafted.ts`).\n    const [draftsStanding] = useState(() => new DraftedStanding());\n    // A kind read by area holds only its window: a drafted row of it off the window draws where its draft places it while its\n    // narrowing holds it — the hidden narrowing's leaving it waiting in its session (#1393).\n    const dim = look.dim;\n    const drafted = useCallback((ref: SchematicRef) => draftHeld(draftsNarrowing, ref), [draftsNarrowing]);\n    const leftOut = useCallback((ref: SchematicRef) => !dim && drafted(ref) === false, [dim, drafted]);\n    // A kind read by area draws from its window, which a Save's confirmation doesn't read again: what the Save landed draws\n    // as the Save left it over a window read before the commit — at another revision than the one its record reads at now\n    // — until the window is read again: drawn from the window alone, a moved rack showed where it was meanwhile. Details\n    // reads the windows so; the drafts unsaved stay the drafts.\n    const canvasDrafts = useMemo(() => landedDrafts(editing.drafts, editing.landed, data.windows, data.revisions),\n        [editing.drafts, editing.landed, data.windows, data.revisions]);\n    const inspectedWindows = useMemo(() => landedWindows(data.windows, editing.landed, data.revisions), [data.windows, editing.landed, data.revisions]);\n    // And the drafted rows the drawing leaves out — each waiting in its session, the narrowing leaving out the row it\n    // drafts — as their kinds draw them, never drawn: Issues checks and names every unsaved change, drawn or not (ruled\n    // 27 Oct 2026, \"Checked in view, said so\"). Made with the drawing, and after it: the rule is asked of them once the\n    // drawing has told it what it drew, so a row that stands through a carry-over waits nowhere.\n    const { drawing, waiting } = useMemo(() => {\n        const drawn = draftedDrawing(data.drawn, data.held, canvasDrafts, draftedCache.current, areas, leftOut, draftsStanding);\n        return { drawing: drawn, waiting: waitingDrafts(data.held, editing.drafts, areas, leftOut, draftsStanding) };\n    }, [data.drawn, data.held, canvasDrafts, editing.drafts, areas, leftOut, draftsStanding]);\n\n    // ── The narrowing (#1392, §10.2, §10.3): what each kind's source of the rail leaves out, hidden or dimmed ──\n    // Each kind read through its source: its shown keys once they have resolved — a pending one is not empty — `none`\n    // while it narrows nothing, read while the narrowing dims or looks at its matches.\n    const kindKeys = useCallback((slot: string): option<ReadonlySet<string>> | undefined => {\n        // A kind read by area: which of its window's rows its narrowing holds, as `within` answered (D28).\n        if (areas.has(slot)) {\n            const matched = data.matched.get(slot);\n            return matched === undefined ? none : some(matched);\n        }\n        const shown = sourced.has(slot) ? followed.get(slot)?.shown : undefined;\n        return shown === undefined || (shown.keys.type === \"some\" && !shown.ready) ? undefined : shown.keys;\n    }, [areas, data.matched, sourced, followed]);\n    const narrowing = useMemo(() => schematicNarrowing({ drawn: drawing, held: data.held, sourced, keys: kindKeys, dim, drafted }),\n        [drawing, data.held, sourced, kindKeys, dim, drafted]);\n    // The drawing as every list shows it — Find, the Index, the Choosers, what an item is joined to, the counts.\n    const listed = useMemo(() => narrowedDrawing(drawing, narrowing.out), [drawing, narrowing.out]);\n    // What `fit` flies the camera to (§10.3): keyed on the narrowing itself — each source's choices, never on which\n    // entities match or where, which a zoom moves over a kind read by area — once what it flies to is read; a kind read by\n    // area by the box its area index finds its narrowing's rows in (#1393).\n    const sourcedParts = useMemo(() => [...sourced].flatMap((slot) => { const part = sourcePart(chrome, slot); return part === undefined ? [] : [part]; }),\n        [sourced, chrome]);\n    const sourcedVersion = useSlicesReactivity(sourcedParts.map((part) => part.key));\n    const fitKey = useMemo(() => {\n        if (!look.fit) return undefined;\n        const wheres = sourcedParts.map((part) => part.read().where);\n        if (wheres.every((where) => where.size === 0)) return undefined;\n        return sourcedParts.map((part, i) => `${part.key}\\u0000${printWhere(wheres[i]!)}`).join(\"\\u0001\");\n        // `sourcedVersion` moves with each source's choices.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [look.fit, sourcedParts, sourcedVersion]);\n    // Each kind read by area its narrowing narrows: its box, once read under the narrowing it holds now — one read under the\n    // last waits, as the reader's report follows a choice a render behind.\n    const fitAreas = useMemo((): { readonly box: WorldBox | undefined; readonly read: boolean } => {\n        if (fitKey === undefined) return { box: undefined, read: true };\n        let box: WorldBox | undefined;\n        let read = true;\n        for (const slot of areas) {\n            const where = sourcePart(chrome, slot)?.read().where;\n            if (where === undefined || where.size === 0) continue;\n            const found = data.fits.get(slot);\n            if (found === undefined || !stringEqual(found.under, printWhere(where))) { read = false; continue; }\n            if (found.box === null) continue;\n            box = box === undefined ? found.box : {\n                minX: Math.min(box.minX, found.box.minX), minY: Math.min(box.minY, found.box.minY),\n                maxX: Math.max(box.maxX, found.box.maxX), maxY: Math.max(box.maxY, found.box.maxY),\n            };\n        }\n        return { box, read };\n    }, [fitKey, areas, chrome, data.fits]);\n    const fitReading = data.loading || narrowingBusy || data.fitting || !fitAreas.read;\n    const canvasFit = useMemo((): SchematicCanvasFit => ({ key: fitKey, reading: fitReading, box: fitAreas.box }), [fitKey, fitReading, fitAreas.box]);\n    const canvasNarrowing = useMemo((): SchematicCanvasNarrowing => ({ context: narrowing.context, out: narrowing.out, matches: narrowing.matches, look }),\n        [narrowing, look]);\n    // Why the last gesture was refused, until one is recorded, Esc, or the viewer's next action: a press on the canvas, a\n    // move of its camera — a pan, a zoom, Fit, a fly — or a Find pick; never a resize alone (hand retest, 27 Oct 2026).\n    const [refusal, setRefusal] = useState<string | undefined>(undefined);\n    const dropRefusal = useCallback(() => setRefusal(undefined), []);\n\n    // ── The layers: what their author defaults and the viewer's choices hide, lock and dim (#1389) ──\n    const layerValues = useDataStable(value.layers, layersEqual);\n    const [layerView, setLayerView] = useSchematicLayerView(keys.layers);\n    const layersNow = useMemo(() => layersInForce(layerValues, layerView), [layerValues, layerView]);\n    const layers = useMemo(() => layerState(layersNow, drawing), [layersNow, drawing]);\n\n    // ── The narrow layout (#1394, §9, D15): below 480px of main, measured by the canvas's element, which fills it ──\n    // The canvas pans, pinches and selects there: no Move or Connect, no card dragged, no drop cell or link handle — the\n    // inspector moves, connects, re-targets, places and deletes. Resizing keeps the tool held, the selection and the drafts.\n    const mainRef = useRef<HTMLDivElement | null>(null);\n    const onCanvasElement = useCallback((element: HTMLDivElement | null) => { mainRef.current = element; }, []);\n    const narrow = useContainerBelow(mainRef, NARROW_WIDTH);\n\n    // ── The tools (§6.1): the viewer's, as the Schematic offers them ─────\n    // Connect over a link kind bound with its patch door, Move over such an item kind; `readOnly` offers neither, nor\n    // does a narrow main, where each is the inspector's (#1394) — the tool the viewer holds kept for a wider one.\n    const readOnly = value.readOnly;\n    const linkChoices = useMemo(() => (readOnly ? [] : value.links.filter((kind) => kind.editable).map((kind) => ({ key: kind.key, name: kind.name }))),\n        [readOnly, value.links]);\n    const movable = !readOnly && value.items.some((kind) => kind.editable);\n    const linkSlots = useMemo(() => linkChoices.map((link) => link.key).join(\"\\u0000\"), [linkChoices]);\n    const offered = useMemo(() => ({ links: linkSlots === \"\" ? [] : linkSlots.split(\"\\u0000\"), movable }), [linkSlots, movable]);\n    const offeredNow = narrow ? VIEW_ONLY : offered;\n    const [stored, pickTools] = useSchematicTools(keys.tools);\n    const held = useMemo(() => toolsInForce(stored, offeredNow), [stored, offeredNow]);\n    const tools = useMemo(() => offeredTools(offeredNow), [offeredNow]);\n    // The link kind Connect draws, the toolbar's Connect menu's choice: on a narrow main, what Details' Connect to… records.\n    const connectKind = useMemo(() => toolsInForce(stored, offered).link, [stored, offered]);\n    const storedTool = stored.tool;\n    const pickConnectKind = useCallback((link: string) => pickTools({ tool: storedTool, link }), [pickTools, storedTool]);\n\n    // ── The canvas: the camera and the selection are its own ────────────\n    const canvasRef = useRef<SchematicCanvasHandle>(null);\n    // What the canvas has selected, by id: the toolbar's steps show while something is, the Index marks its rows, and\n    // the inspector shows it — a net's leg with it (#1391).\n    const [selection, setSelection] = useState<ReadonlySet<string>>(NOTHING_SELECTED);\n    const [leg, setLeg] = useState<NetLeg | null>(null);\n    // Why the item Find's last pick landed on doesn't show as itself, the filters hiding it cleared by the pick — its layer,\n    // no position — while that pick stands: until the next pick, the search cleared or a new query asked in its place, or\n    // a selection (#1404, the footer holding only what is live).\n    const [found, setFound] = useState<string | undefined>(undefined);\n    const pickLetGo = useCallback(() => setFound(undefined), []);\n    // The Backlog's card picked below 480px of main (#1394, D15), by its id: an item with no position, which Details shows\n    // with its Place until the canvas selects something, the card is let go, or it is placed.\n    const [placingId, setPlacingId] = useState<string | undefined>(undefined);\n    const onSelection = useCallback((ids: ReadonlySet<string>, next: NetLeg | null) => {\n        setSelection(ids);\n        setLeg(next);\n        // A selection says no more where Find's last pick landed (#1404), and Details shows it, not the Backlog's card.\n        if (ids.size > 0) {\n            setFound(undefined);\n            setPlacingId(undefined);\n        }\n    }, []);\n    const selected = selection.size > 0;\n    // The selection as a gesture records itself: a lone selected entity that moves follows its key (#1549).\n    const selectionNow = useRef(selection);\n    selectionNow.current = selection;\n    // Where the zoom stands, as the canvas tells it: the toolbar's Zoom out and Zoom in take no press past either end (#1393).\n    const [zoomRange, setZoomRange] = useState<ZoomRange>(AT_FIT);\n    const zoomBy = useCallback((factor: number) => canvasRef.current?.zoomBy(factor), []);\n    const fit = useCallback(() => canvasRef.current?.fit(), []);\n    const step = useCallback((delta: 1 | -1) => canvasRef.current?.step(delta), []);\n\n    // ── The hidden pick (the shared one, `shared/schedule/hidden-pick.tsx`) ──\n    // Find's pick of an item the rail's filters leave out, and Go to issue's of an unsaved change they leave out: the\n    // choices hiding it cleared — those e3 named, every choice of its source while it has not said — a clear that throws\n    // said in the footer, as a refused gesture is; then flown to where it stands; then, once the narrowing they leave draws\n    // it as itself — drawn, neither context nor out of the lists, and no longer standing in while a narrowing is read —\n    // selected through the canvas. It hands the canvas no keyboard, as no Find's pick does.\n    const drawnIds = useMemo(() => new Set([...drawing.items, ...drawing.zones, ...drawing.links, ...drawing.nets].map((entity) => entity.key)),\n        [drawing]);\n    const narrowedOut = narrowing.out;\n    const pick = useHiddenPick<string>({\n        onError: (said) => setRefusal(said),\n        uncleared: words.m.hiddenUncleared(),\n        landing: {\n            drawn: (id) => !stale && drawnIds.has(id) && !narrowedOut.has(id),\n            selects: (id) => canvasRef.current?.select(id),\n        },\n    });\n\n    // ── The library's selected cards (#1389, #1390): each card tab's, by the tab's key ──\n    // A click selects a card, and a click on the selected one lets it go. Below 480px of main a Backlog card selected is\n    // what Details shows, an item with no position with its Place, and lets go of what the canvas selects (#1394).\n    const [picked, setPicked] = useState<ReadonlyMap<string, string>>(NO_PICKS);\n    const onPick = useCallback((tabKey: string, key: string) => {\n        const chosen = picked.get(tabKey);\n        const letGo = chosen !== undefined && stringEqual(chosen, key);\n        const next = new Map(picked);\n        if (letGo) next.delete(tabKey);\n        else next.set(tabKey, key);\n        setPicked(next);\n        if (!stringEqual(tabKey, \"backlog\")) return;\n        if (letGo) setPlacingId(undefined);\n        else if (narrow) {\n            setPlacingId(key);\n            canvasRef.current?.reveal(undefined);\n        }\n    }, [picked, narrow]);\n    // The template the Templates tab has selected, of a link or a net kind: what a Connect's new link or net of its kind\n    // takes its other fields from (§4.3).\n    const pickedTemplate = useMemo(() => {\n        const id = picked.get(\"templates\");\n        const ref = id === undefined ? undefined : refOfId(id);\n        if (ref === undefined) return undefined;\n        const kind = [...value.links, ...value.nets].find((k) => stringEqual(k.key, ref.kind));\n        const template = kind?.templates.find((t) => stringEqual(t.key, ref.key));\n        return kind === undefined || template === undefined ? undefined : { slot: kind.key, values: template.values };\n    }, [picked, value.links, value.nets]);\n    const connectValues = useCallback((slot: string): option<Uint8Array> =>\n        (pickedTemplate !== undefined && stringEqual(pickedTemplate.slot, slot) ? some(pickedTemplate.values) : none), [pickedTemplate]);\n\n    // ── Find (§6.1, #1404): every item kind's record, by key — one read through its source sought through e3 ─────\n    const findKinds = useMemo((): FindKind[] => value.items.map((kind) => ({\n        slot: kind.key, name: kind.name, part: sourcePart(chrome, kind.key), rows: kind.rows, read: kind.read, codec: rowCodec(kind.rowType),\n        keys: keysOfType(kind.keyType),\n    })), [value.items, chrome]);\n    const reveal = useCallback((entity: string, avoid?: DOMRectReadOnly) => canvasRef.current?.reveal(entity, undefined, avoid), []);\n    const hiddenLayers = useMemo(() => new Set(layersNow.flatMap((layer) => (getSomeorUndefined(layer.visible) === false ? [layer.key] : []))), [layersNow]);\n    const drawnItems = useMemo(() => new Set(drawing.items.map((item) => item.key)), [drawing.items]);\n    const onFound = useCallback((item: FoundItem) => {\n        // A pick is the viewer's action: a refusal's words go with it, wherever the camera goes.\n        setRefusal(undefined);\n        const canvas = canvasRef.current;\n        // What keeps it off the canvas but the rail's filters, which the pick clears: the footer says so while it stands.\n        const mark = foundMark(item, hiddenLayers);\n        setFound(mark === undefined ? undefined : words.m.foundOff({ item: item.label, mark }));\n        pick.pick(item.hidden, item.id, () => {\n            // No position: it is in the Backlog — listed there once the filters hiding it are cleared — and nothing flies.\n            if (item.position === undefined) return false;\n            const drawn = drawnItems.has(item.id);\n            // Drawn, it is flown to — and selected, as itself; as context no path selects it — and else flown to where it\n            // stands: the narrowing hides it, its window doesn't hold it (#1393), or its layer is hidden.\n            if (drawn && mark === undefined) canvas?.reveal(item.id);\n            else canvas?.look(item.position.x, item.position.y);\n            // The filters hiding it cleared: selected once the narrowing they leave draws it — never on a hidden layer.\n            if (item.hidden !== undefined) return mark === undefined;\n            // The narrowing holds it, off its window: selected once it draws.\n            if (!drawn && mark === undefined) canvas?.select(item.id);\n            return false;\n        });\n    }, [hiddenLayers, drawnItems, words, pick]);\n    // Its lines say the filters dim an item they leave out where the narrowing draws it as context, else hide it.\n    const find = useSchematicFind({ kinds: findKinds, words, picks, hiddenLayers, dim, onPick: onFound, onCleared: pickLetGo });\n\n    // ── The toolbar (§6.1) ──────────────────────────────────────────────\n    // What the rail counts a source in: a templates list's, its kind's templates; a kind's own, its rows (#1392).\n    const nouns = useMemo(() => {\n        const named: Record<string, string> = {};\n        for (const kind of [...value.items, ...value.links, ...value.nets]) {\n            const source = getSomeorUndefined(kind.templatesSource);\n            if (source !== undefined && named[source] === undefined) named[source] = words.m.templatesNoun({ name: kind.name.toLocaleLowerCase(words.locale) });\n        }\n        for (const kind of [...value.items, ...value.zones, ...value.links, ...value.nets]) {\n            if (named[kind.key] === undefined && sourcePart(chrome, kind.key) !== undefined) {\n                named[kind.key] = words.m.kindNoun({ name: kind.name.toLocaleLowerCase(words.locale), plural: true });\n            }\n        }\n        return named;\n    }, [value.items, value.zones, value.links, value.nets, chrome, words]);\n    const toolbarRef = useRef<HTMLDivElement>(null);\n    // The history's acts: a field typed into lets go first, committing what it holds — the history's buttons take no\n    // focus from it. Anything else keeps the focus, the canvas or a control of the frame's, so the next key — a Redo\n    // after an Undo — reaches the frame too, never the page.\n    const history = editing.history;\n    const onAction = useCallback((action: HistoryAction) => {\n        const active = document.activeElement;\n        if (active instanceof HTMLElement && typedInto(active)) active.blur();\n        history.act(action);\n    }, [history]);\n    // An issue a Save raised: the canvas flies to the item it names, and selects it — a conflict's Go to, beside the\n    // conflicts popover open over the canvas, which stays open and says where it lies. The field it names, asked of its\n    // row's Details as an issue's line in Issues asks it, takes the keyboard there, the inspector opened where it is\n    // collapsed (`../shared/schedule/field-ask.tsx`) — a conflict's Go to, which names its path, asks none.\n    const sessions = editing.schedule.sessions;\n    const { asks: fieldAsks, request: askField } = useFieldAsks();\n    const onIssue = useCallback((issue: EditIssue, at?: PatchPath, popover?: DOMRectReadOnly) => {\n        const key = history.sourceOf(issue);\n        const part = key === undefined ? undefined : sessions.find((held) => stringEqual(held.key, key));\n        if (part === undefined) return;\n        askField(part.kind, issue.entry, at === undefined ? issue.field : none);\n        reveal(entityId({ kind: recordSlot(part.kind), key: issue.entry }), popover);\n    }, [history, sessions, reveal, askField]);\n    // A conflict's item in the history bar's popover, named as its session's banners name its issues — by the names this\n    // render draws, read as the popover draws.\n    const namesNow = useRef<ReadonlyMap<string, string>>(new Map());\n    const where = useCallback((issue: EditIssue) => {\n        const key = history.sourceOf(issue);\n        const part = key === undefined ? undefined : sessions.find((held) => stringEqual(held.key, key));\n        return (part === undefined ? undefined : namesNow.current.get(entityId({ kind: recordSlot(part.kind), key: issue.entry }))) ?? issue.entry;\n    }, [history, sessions]);\n    // A conflict's value as Details writes it: an item's box — its x, its y, its width or its height — to the centimetre,\n    // in the drawing's unit.\n    const unit = getSomeorUndefined(value.scaleUnit);\n    const conflictValue = useCallback((issue: EditIssue, path: PatchPath, held: unknown, type: EastType | undefined) => {\n        const key = history.sourceOf(issue);\n        const part = key === undefined ? undefined : sessions.find((s) => stringEqual(s.key, key));\n        const kind = part === undefined ? undefined : value.items.find((k) => stringEqual(k.key, recordSlot(part.kind)));\n        if (kind === undefined || type?.type !== \"Float\") return undefined;\n        let field: string | undefined;\n        for (const step of path) {\n            if (step.kind !== \"field\") continue;\n            if (field !== undefined) return undefined;\n            field = step.name;\n        }\n        const box = [kind.box.x, kind.box.y, getSomeorUndefined(kind.box.width), getSomeorUndefined(kind.box.height)];\n        if (field === undefined || !box.some((name) => name !== undefined && stringEqual(name, field))) return undefined;\n        const text = coordinate(held as number, words);\n        return unit === undefined ? text : `${text} ${unit}`;\n    }, [history, sessions, value.items, unit, words]);\n    const historyItem = editing.edits\n        ? historyToolbarItem({ session: history, words: editingWords, editing: false, showError: false, onIssue, onConflict: onIssue, where, conflictValue, onAction })\n        : undefined;\n    const items = useSchematicToolbarItems({\n        styles, words, chrome, nouns, tools, held, links: narrow ? NO_LINK_CHOICES : linkChoices, onTools: pickTools, find,\n        onZoom: zoomBy, zoom: zoomRange, onFit: fit, selected, onStep: step, history: historyItem,\n    });\n    // ⌘F, or Ctrl+F, anywhere in the frame: Find, in whichever form the row holds it; ⌘Z, ⇧⌘Z and ⌘Y the history's,\n    // but in a field typed into, whose own they are; and the canvas's keys while the pointer is over it — Space, Ctrl,\n    // Del and Esc (invariant 16). Each key acted on goes no further than the Schematic (#1398).\n    const edits = editing.edits;\n    const onKeyDown = useCallback((event: KeyboardEvent<HTMLDivElement>) => {\n        if (event.defaultPrevented) return;\n        if ((event.metaKey || event.ctrlKey) && !event.altKey && !event.shiftKey && event.key.toLowerCase() === \"f\") {\n            if (focusKeySearch(toolbarRef.current)) takeKey(event);\n            return;\n        }\n        const action = historyShortcut(event);\n        if (action !== undefined && edits && !typedInto(event.target)) {\n            takeKey(event);\n            onAction(action);\n            return;\n        }\n        canvasRef.current?.key(event);\n    }, [edits, onAction]);\n\n    // ── The library (#1389, §8): the start pane, when `library` lists a tab ──\n    // Every item kind's rows with no position, the drafts in place: the Backlog's — dimmed, its context left out (#1392).\n    // A kind read by area's drafted rows with no position are listed wherever its window is, each told by the row its session\n    // began from (#1393).\n    const backlogArea = useMemo(() => ({ kinds: areas, held: drafted }), [areas, drafted]);\n    const backlog = useMemo(() => backlogEntries(value.items, data.unplaced, data.held, editing.drafts.items, backlogArea)\n        .filter((entry) => !narrowing.isContext(entry.ref)), [value.items, data.unplaced, data.held, editing.drafts.items, backlogArea, narrowing]);\n    // An item kind with a backlog read through its source: while the rail narrows one, the Backlog says so, with Clear filters.\n    const backlogParts = useMemo(() => value.items.flatMap((kind) => {\n        const part = kind.backlog ? sourcePart(chrome, kind.key) : undefined;\n        return part === undefined ? [] : [part];\n    }), [value.items, chrome]);\n    const backlogVersion = useSlicesReactivity(backlogParts.map((part) => part.key));\n    const backlogNarrowing = useMemo((): SchematicBacklogNarrowing => {\n        const narrowing = backlogParts.filter((part) => part.read().where.size > 0);\n        return { narrows: narrowing.length > 0, clear: narrowing.length === 0 ? undefined : () => { for (const part of narrowing) part.clearAll(); } };\n        // `backlogVersion` moves with each source's choices.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [backlogParts, backlogVersion]);\n    // The item kinds read by area (#1393): what the Backlog pages and the Index reads of them outside their window. A kind\n    // whose area indexes are refused the reader says so of, with Retry, and reads no further: neither reads it.\n    const areaItemKinds = useMemo(() => value.items.flatMap((kind): IndexAreaKind[] => {\n        const part = areas.has(kind.key) ? sourcePart(chrome, kind.key) : undefined;\n        if (part === undefined) return [];\n        try {\n            const indexes = schematicAreaIndexes(part.config.indexes, kind.box, \"items\", `Schematic.items: \"${kind.name}\"`);\n            return indexes === undefined ? [] : [{ kind, part, areas: indexes }];\n        } catch {\n            return [];\n        }\n    }), [value.items, areas, chrome]);\n    // Those with a backlog (D51): their rows with no position paged through their area index's unplaced clause, the\n    // Backlog one paged list.\n    const backlogAreaKinds = useMemo((): BacklogAreaKind[] => areaItemKinds.filter(({ kind }) => kind.backlog), [areaItemKinds]);\n    const pagesBacklog = backlogAreaKinds.length > 0 && value.library.some((tab) => tab.type === \"backlog\");\n    const backlogPages = useMemo(() => (!pagesBacklog ? undefined\n        : new SchematicBacklogPages(schematicLibraryId(keys, \"backlog\"), backlog, backlogAreaKinds, editing.drafts.items, kindRows)),\n    [pagesBacklog, keys, backlog, backlogAreaKinds, editing.drafts.items, kindRows]);\n    const backlogPartKeys = useMemo(() => backlogAreaKinds.map(({ part }) => part.key), [backlogAreaKinds]);\n    // Its count, read in a component of its own; and what a card of it drops.\n    const [backlogCount, setBacklogCount] = useState<BacklogPageCount | undefined>(undefined);\n    const backlogPaged = useMemo(() => (backlogPages === undefined ? undefined : { source: backlogPages, count: backlogCount }), [backlogPages, backlogCount]);\n    const pagedBacklog = useMemo(() => (backlogPages === undefined ? undefined : (id: string) => backlogPages.card(id)), [backlogPages]);\n    // The Index's zones and items: what the canvas draws, a hidden layer's and what the narrowing leaves out left out.\n    const shownZones = useMemo(() => (layers.hidden.size === 0 ? listed.zones : listed.zones.filter((zone) => !layers.hidden.has(zone.key))), [listed.zones, layers.hidden]);\n    const shownItems = useMemo(() => (layers.hidden.size === 0 ? listed.items : listed.items.filter((item) => !layers.hidden.has(item.key))), [listed.items, layers.hidden]);\n    // How many entities each layer holds: every one on it, shown or hidden.\n    const layerCounts = useMemo(() => {\n        const counts = new Map<string, number>();\n        for (const entity of [...drawing.items, ...drawing.zones, ...drawing.links, ...drawing.nets]) {\n            const on = getSomeorUndefined(entity.layer);\n            if (on !== undefined) counts.set(on, (counts.get(on) ?? 0) + 1);\n        }\n        return counts;\n    }, [drawing]);\n    // The zone the viewport is in, which the Index marks: the canvas tells it only while the library lists the Index.\n    const [inView, setInView] = useState<string | undefined>(undefined);\n    const listsIndex = value.library.some((tab) => tab.type === \"index\");\n    // The Index's reads of the item kinds read by area (D52): an open zone's items by its box, and the search's — the rows a\n    // draft holds listed as the canvas draws them, never as their records store them.\n    const [indexReader] = useState(() => new SchematicIndexArea(kindRows));\n    const areaDrafts = useMemo(() => {\n        const drafted = new Set<string>(), created = new Set<string>();\n        for (const [slot, rows] of editing.drafts.items) {\n            if (!areas.has(slot)) continue;\n            for (const [key, row] of rows) {\n                const id = entityId({ kind: slot, key });\n                drafted.add(id);\n                if (row?.created === true) created.add(id);\n            }\n        }\n        // What a Save landed is listed as the canvas draws it, whatever its window holds: the Index's read may be older.\n        for (const [slot, rows] of editing.landed.items) {\n            for (const [key, row] of rows) {\n                const id = entityId({ kind: slot, key });\n                drafted.add(id);\n                if (row.drawn?.created === true) created.add(id);\n            }\n        }\n        return { drafted, created };\n    }, [editing.drafts.items, editing.landed.items, areas]);\n    // The revision the Index read each kind by area at: what a Save landed of a kind is listed so until it has read it since.\n    const [indexRevisions, setIndexRevisions] = useState<ReadonlyMap<string, string>>(NO_INDEX_REVISIONS);\n    const onIndexRead = useCallback((revisions: ReadonlyMap<string, string>) => {\n        setIndexRevisions((was) => (sameRevisions(was, revisions) ? was : revisions));\n    }, []);\n    const indexArea = useMemo(() => (!listsIndex || areaItemKinds.length === 0 ? undefined\n        : { kinds: areaItemKinds, reader: indexReader, hiddenLayers, drafted: areaDrafts.drafted, created: areaDrafts.created, onRead: onIndexRead }),\n    [listsIndex, areaItemKinds, indexReader, hiddenLayers, areaDrafts, onIndexRead]);\n    // What a Save landed is let go once its kind's window, and the Index's read of it, are read at the revision its record\n    // reads at now: before paint, so the frame never draws both.\n    const landed = editing.landed, shownLanded = editing.shown;\n    useLayoutEffect(() => {\n        for (const [slot, keys] of landedRead(landed, data.windows, indexRevisions, data.revisions)) shownLanded(slot, keys);\n    }, [landed, data.windows, indexRevisions, data.revisions, shownLanded]);\n\n    // ── What a selection keeps of a row of a kind read by area its window no longer holds (#1393, §4.5) ──\n    // Each selected entity of such a kind, read by its key once its window lets it go: it stays selected and Details shows\n    // it; a read proving it gone, its drafts — a drafted row draws, or is gone — its layer or the narrowing let go of it.\n    const selectedArea = useMemo(() => [...selection].filter((id) => { const ref = refOfId(id); return ref !== undefined && areas.has(ref.kind); })\n        .sort(compareString), [selection, areas]);\n    const [selectedRows, setSelectedRows] = useState<SchematicSelectedRows>(NO_SELECTED_ROWS);\n    const draftedArea = useMemo(() => {\n        const out = new Set<string>();\n        for (const sort of [canvasDrafts.items, canvasDrafts.zones]) {\n            for (const [slot, rows] of sort) if (areas.has(slot)) for (const key of rows.keys()) out.add(entityId({ kind: slot, key }));\n        }\n        return out;\n    }, [canvasDrafts.items, canvasDrafts.zones, areas]);\n    const standing = useMemo((): SchematicStanding => {\n        if (selectedArea.length === 0) return { items: new Map(), zones: new Map() };\n        const drawnIds = new Set([...drawing.items.map((item) => item.key), ...drawing.zones.map((zone) => zone.key)]);\n        const itemKinds = new Set(value.items.map((kind) => kind.key));\n        const items = new Map<string, DrawnItem | undefined>();\n        const zones = new Map<string, DrawnZone | undefined>();\n        for (const id of selectedArea) {\n            if (drawnIds.has(id) || draftedArea.has(id)) continue;\n            const ref = refOfId(id)!;\n            if (itemKinds.has(ref.kind)) {\n                const item = selectedRows.items.get(id);\n                if (item !== null) items.set(id, item);\n            } else {\n                const zone = selectedRows.zones.get(id);\n                if (zone !== null) zones.set(id, zone);\n            }\n        }\n        // A hidden layer's entities never draw, and a locked one's never select (SC27).\n        const onLayers = layerState(layersNow, {\n            items: [...items.values()].flatMap((item) => (item === undefined ? [] : [item])),\n            zones: [...zones.values()].flatMap((zone) => (zone === undefined ? [] : [zone])), links: [], nets: [],\n        });\n        for (const id of [...onLayers.hidden, ...onLayers.locked]) { items.delete(id); zones.delete(id); }\n        return { items, zones };\n    }, [selectedArea, drawing, value.items, draftedArea, selectedRows, layersNow]);\n    // What Details shows of the drawing: its entities, and the selected rows standing off their windows.\n    const inspectorDrawn = useMemo(() => {\n        const items = [...standing.items.values()].flatMap((item) => (item === undefined ? [] : [item]));\n        const zones = [...standing.zones.values()].flatMap((zone) => (zone === undefined ? [] : [zone]));\n        return items.length === 0 && zones.length === 0 ? drawing : { ...drawing, items: [...drawing.items, ...items], zones: [...drawing.zones, ...zones] };\n    }, [drawing, standing]);\n\n    // ── The drops (#1390, §7, §8): the library's cards, onto the canvas ──\n    // Each kind, as a drop reads it: its name, and whether it writes — bound with its patch door, the Schematic not read only.\n    const dropKinds = useMemo(() => new Map<string, SchematicDropKind>([...value.items, ...value.zones, ...value.links, ...value.nets]\n        .map((kind) => [kind.key, { name: kind.name, writes: kind.editable && !value.readOnly }] as const)),\n    [value.items, value.zones, value.links, value.nets, value.readOnly]);\n    // Each entity's one name, wherever the Schematic says it — a drop's words, the inspector's head and rail, an issue's row\n    // and a session's banners: an item's or a zone's label, a link's ends, a net's label or its ends; never a minted key. An\n    // unsaved change the drawing leaves out is named so too, as its draft has it.\n    const names = useMemo(() => entityNames(withWaiting(inspectorDrawn, waiting), words), [inspectorDrawn, waiting, words]);\n    namesNow.current = names;\n    // Each kind's name, by its slot: what a refusal, a banner and the footer's line name it by.\n    const kindName = useMemo(() => new Map([...value.items, ...value.zones, ...value.links, ...value.nets].map((kind) => [kind.key, kind.name] as const)),\n        [value.items, value.zones, value.links, value.nets]);\n\n    // ── A key built from a row's fields follows the row (#1549) ──────────\n    // What names an item a gesture moves: the links and nets drawn and waiting, the drafts in place.\n    const editsKinds = useMemo(() => editKinds(value), [value]);\n    const heldDrawing = useMemo(() => withWaiting(drawing, waiting), [drawing, waiting]);\n    // Why a gesture records nothing, its new row's key refused: in the footer, the row holding the key by its name — the\n    // words handed back, which Details says under the field an edit of it was made in too.\n    const keyRefused = useCallback((refusal: SchematicKeyRefusal): string => {\n        const named = (slot: string) => (kindName.get(slot) ?? slot).toLocaleLowerCase(words.locale);\n        const nameOf = (ref: SchematicRef) => namesNow.current.get(entityId(ref)) ?? ref.key;\n        const said = ((): string => {\n            switch (refusal.refusal) {\n                case \"untyped\": return words.m.keyRefused({ refusal: \"untyped\", kind: named(refusal.kind), type: refusal.type });\n                case \"taken\": return words.m.keyRefused({ refusal: \"taken\", kind: named(refusal.ref.kind), name: nameOf(refusal.ref) });\n                case \"unheld\": return words.m.keyRefused({ refusal: \"unheld\", kind: named(refusal.kind), name: nameOf(refusal.ref), why: refusal.why });\n                case \"details\": return words.m.keyRefused({ refusal: \"details\", kind: named(refusal.ref.kind), name: nameOf(refusal.ref) });\n            }\n        })();\n        setRefusal(said);\n        return said;\n    }, [kindName, words]);\n    // Why the Schematic may not hold every row of a link or net kind (#1580): the rail's filters leave some out — under\n    // `narrowed=\"dim\"` its source reads every row — or its read hasn't landed, or failed.\n    const ready = data.ready, failures = data.failures;\n    const unheld = useCallback((slot: string): SchematicUnheld | undefined => {\n        if (!dim && (sourcePart(chrome, slot)?.read().where.size ?? 0) > 0) return \"filtered\";\n        return !ready || failures.has(slot) ? \"unread\" : undefined;\n    }, [dim, chrome, ready, failures]);\n    // Every route's edits recorded with each row whose key its fields build following them: refused where a row holds a\n    // key one builds, a link or net kind that may name a moving item isn't held whole, or what follows a moving row — its\n    // details, the rows naming it — takes no edit now (#1584), the footer saying why, and the words handed back; recorded,\n    // a lone selected entity that moves selected under its new key, and the rows moved handed back — a Shift session's net\n    // among them (#1584).\n    const recordEdits = editing.record;\n    const moves = editing.moves, stands = editing.stands, edited = editing.edited, takes = editing.available;\n    const recordFollowing = useCallback((edits: readonly SchematicEdit[], origin: Origin, label: string):\n        { readonly moved: readonly SchematicMove[] } | { readonly refused: string } | undefined => {\n        const followed = followBuiltKeys({ kinds: editsKinds, moves, stands, edited, drawn: heldDrawing, unheld, takes }, edits);\n        if (\"refused\" in followed) return { refused: keyRefused(followed.refused) };\n        if (!recordEdits(followed.edits, origin, label)) return undefined;\n        const now = selectionNow.current;\n        const lone = now.size === 1 ? [...now][0]! : undefined;\n        const moved = lone === undefined ? undefined : followed.moved.find((move) => stringEqual(entityId(move.ref), lone));\n        if (moved !== undefined) canvasRef.current?.select(entityId({ kind: moved.ref.kind, key: moved.to }));\n        return { moved: followed.moved };\n    }, [editsKinds, moves, stands, edited, heldDrawing, unheld, takes, keyRefused, recordEdits]);\n    // The canvas's and a drop's: the rows moved, or nothing recorded.\n    const recordMoves = useCallback((edits: readonly SchematicEdit[], origin: Origin, label: string): readonly SchematicMove[] | undefined => {\n        const done = recordFollowing(edits, origin, label);\n        return done === undefined || \"refused\" in done ? undefined : done.moved;\n    }, [recordFollowing]);\n    const newKey = editing.newKey;\n    const canvasEditing = useMemo((): SchematicCanvasEditing | undefined => (editing.edits ? { record: recordMoves, newKey, keyRefused } : undefined),\n        [editing.edits, recordMoves, newKey, keyRefused]);\n    // The inspector's edits are recorded so too: one refused for its key hands Details why, which it says under the field.\n    const inspectorEditing = useMemo((): SchematicInspectorEditing => ({\n        ...editing,\n        record: (edits, origin, label) => {\n            const done = recordFollowing(edits, origin, label);\n            return done === undefined ? false : \"refused\" in done ? done.refused : true;\n        },\n    }), [editing, recordFollowing]);\n    // The zones a point lands in, smallest first, as the Index files an item: what a drop's words name.\n    const hosts = useMemo(() => hostZones(shownZones), [shownZones]);\n    // A kind takes a drop while its session takes an edit and nothing the canvas draws is retained (#1398, CL8).\n    const takesEdit = editing.available;\n    const untyped = editing.untyped;\n    const dropContext = useCallback((): SchematicDropContext => ({\n        extent: value.extent,\n        kinds: dropKinds,\n        available: (slot) => takesEdit(slot),\n        untyped,\n        nameOf: (ref) => names.get(entityId(ref)),\n        zoneAt: (point) => zoneHolding(hosts, point.x, point.y)?.label,\n    }), [value.extent, dropKinds, takesEdit, untyped, names, hosts]);\n    const recordDrop = useCallback((edits: readonly SchematicEdit[], label: string) => recordMoves(edits, \"drop\", label) !== undefined, [recordMoves]);\n    // What the canvas has selected, each entity by its reference: what a card's ⏎ drops on.\n    const selectedRefs = useCallback((): SchematicRef[] => [...selection].flatMap((id) => { const ref = refOfId(id); return ref === undefined ? [] : [ref]; }), [selection]);\n    const viewCentre = useCallback(() => canvasRef.current?.centre(), []);\n    // The item a drop added or placed, selected once it draws; a Backlog card placed leaves the Backlog, its pick with it.\n    const selectDropped = useCallback((id: string) => {\n        canvasRef.current?.select(id);\n        setPicked((was) => { const chosen = was.get(\"backlog\"); return chosen !== undefined && stringEqual(chosen, id) ? new Map([...was].filter(([tab]) => !stringEqual(tab, \"backlog\"))) : was; });\n        setPlacingId((was) => (was !== undefined && stringEqual(was, id) ? undefined : was));\n    }, []);\n    const drop = useSchematicDrop({\n        value, backlog, pagedBacklog, keys, context: dropContext, record: recordDrop, newKey, keyRefused, selection: selectedRefs, centre: viewCentre,\n        select: selectDropped, notice: setRefusal, words, unit: getSomeorUndefined(value.scaleUnit), drags: !narrow,\n    });\n    // Each item kind that writes and adds no item, its keys of a type the form can't type (#1549): why, on its templates' cards.\n    const offKinds = useMemo(() => new Map(value.items.flatMap((kind): [string, string][] => {\n        const type = kind.editable && !value.readOnly ? untyped(kind.key) : undefined;\n        return type === undefined ? [] : [[kind.key, words.m.keysUntyped({ name: kind.name.toLocaleLowerCase(words.locale), type })]];\n    })), [value.items, value.readOnly, untyped, words]);\n\n    const library = useSchematicLibrary({\n        value, zones: shownZones, items: shownItems, backlog, backlogNarrowing, backlogPages: backlogPaged, indexArea, layers: layerValues, layerCounts, layerView,\n        onLayerView: setLayerView,\n        inView, selected: selection, onReveal: reveal, keys, words, followed, picked, onPick, enter: drop.enter, narrow, off: offKinds,\n    });\n\n    // ── The drawing's counts and saves: the inspector's Details, with nothing selected (#1391) ──\n    // A kind read by area is counted by its source, its drafts laid over its stored rows' count, never by what its window\n    // draws; and a link or a net that may join one of its items is not counted (#1393).\n    const counted = useMemo(() => ({\n        items: value.items.map((kind) => ({ key: kind.key, name: kind.name })),\n        zones: value.zones.length > 0, links: value.links.length > 0, nets: value.nets.length > 0,\n        areas,\n        linksByArea: value.links.some((kind) => [...kind.ends.from, ...kind.ends.to].some((slot) => areas.has(slot))),\n        netsByArea: value.nets.some((kind) => areas.has(kind.sides.sources) || areas.has(kind.sides.destinations)),\n    }), [value.items, value.zones, value.links, value.nets, areas]);\n    const [areaCounts, setAreaCounts] = useState<ReadonlyMap<string, SchematicDrawingCount>>(NO_AREA_COUNTS);\n    const areaKinds = useMemo(() => [\n        ...value.items.flatMap((kind) => (areas.has(kind.key) ? [{ key: kind.key, sort: \"items\" as const }] : [])),\n        ...value.zones.flatMap((kind) => (areas.has(kind.key) ? [{ key: kind.key, sort: \"zones\" as const }] : [])),\n    ], [value.items, value.zones, areas]);\n    const layerHidden = useMemo(() => layersNow.some((layer) => getSomeorUndefined(layer.visible) === false), [layersNow]);\n    // Whether the row a deleted draft's session began from had a position: an item kind's, as its kind reads it; a zone's, always.\n    const heldRow = editing.schedule.held;\n    const deletedPlaced = useCallback((ref: SchematicRef): boolean | undefined => {\n        const row = heldRow(ref.kind, ref.key);\n        if (row === undefined) return undefined;\n        const kind = value.items.find((item) => stringEqual(item.key, ref.kind));\n        return kind === undefined || kind.read(rowCodec(kind.rowType).encode(row), ref.key).position.type === \"some\";\n    }, [heldRow, value.items]);\n    const areaCounted = useMemo(() => draftedAreaCounts(areaKinds, areaCounts, editing.drafts, drafted, deletedPlaced, layerHidden),\n        [areaKinds, areaCounts, editing.drafts, drafted, deletedPlaced, layerHidden]);\n    // What the narrowing leaves out counts nowhere: dimmed context is no match.\n    const counts = useMemo(() => schematicCounts(counted, listed, layers, areaCounted), [counted, listed, layers, areaCounted]);\n    const records = useMemo(() => savedRecords(value), [value]);\n\n    // ── The footer (§6.3): only what is live ────────────────────────────\n    // Each kind read through its source that writes: a Save's notice counts the rows it took out of the source's narrowing.\n    const notices = useMemo((): SchematicNotice[] => [...value.items, ...value.zones, ...value.links, ...value.nets].flatMap((kind) => {\n        const part = kind.editable && !value.readOnly ? sourcePart(chrome, kind.key) : undefined;\n        const name = kind.name.toLocaleLowerCase(words.locale);\n        return part === undefined ? [] : [{ slot: kind.key, slice: part, singular: words.m.kindNoun({ name, plural: false }), plural: words.m.kindNoun({ name, plural: true }) }];\n    }), [value.items, value.zones, value.links, value.nets, value.readOnly, chrome, words]);\n\n    // ── A read that failed, said once where it happened (#1398, CL11) ──\n    // A kind read through its source asks its source again; one read whole is read again.\n    const retry = useCallback((slot: string | undefined) => {\n        const part = slot === undefined ? undefined : sourcePart(chrome, slot);\n        if (part !== undefined) part.retry();\n        else readAgain();\n    }, [chrome, readAgain]);\n    // A kind's rows, as the line names them — `racks`, one `rack`.\n    const nounOf = useCallback((slot: string, plural = true) => words.m.kindNoun({ name: (kindName.get(slot) ?? slot).toLocaleLowerCase(words.locale), plural }),\n        [kindName, words]);\n    // On the canvas, at the top-left in view of the area it failed reading — the canvas's own for a kind read whole and\n    // the drawing's read — with Retry: the drawing's first, then the first kind's in the Schematic's order.\n    const canvasFailure = useMemo((): SchematicCanvasFailure | undefined => {\n        if (data.error !== undefined) {\n            return { message: loadingLineText(words.m.lineFailed({ noun: words.m.drawingNoun(), from: undefined, to: undefined })), retry: () => retry(undefined), area: undefined };\n        }\n        const [failure] = data.failures;\n        if (failure === undefined) return undefined;\n        const [slot] = failure;\n        const area = data.failedAreas.get(slot);\n        const message = area !== undefined ? words.m.areaFailed() : loadingLineText(words.m.lineFailed({ noun: nounOf(slot), from: undefined, to: undefined }));\n        return { message, retry: () => retry(slot), area };\n    }, [data.error, data.failures, data.failedAreas, words, nounOf, retry]);\n    // ── The footer's loading line (#1398, CL3): a read that failed first — the drawing's, a kind's, then a narrowing's the\n    // frame follows — then what is read, then a narrowing resolving ──\n    // A kind's source the frame follows whose narrowing resolves, its last standing in: `Filtering racks…`.\n    const resolving = [...sourced].find((slot) => { const one = followed.get(slot); return one !== undefined && one.shown.busy && one.error === undefined; });\n    const reading = data.reading;\n    const line = useMemo((): LoadingLineValue | undefined => {\n        const m = words.m;\n        const failed = (text: LoadingLineText, reason: string, again: () => void): LoadingLineValue =>\n            ({ kind: \"failed\", text, short: m.lineShort({ kind: \"failed\" }), reason, onRetry: again, retry: m.retry() });\n        const loading = (text: LoadingLineText, filtering: boolean): LoadingLineValue =>\n            ({ kind: \"loading\", text, short: m.lineShort({ kind: filtering ? \"filtering\" : \"loading\" }) });\n        if (data.error !== undefined) return failed(m.lineFailed({ noun: m.drawingNoun(), from: undefined, to: undefined }), data.error, () => retry(undefined));\n        const [failure] = data.failures;\n        if (failure !== undefined) {\n            const [slot, reason] = failure;\n            const noun = nounOf(slot);\n            return failed(data.failedAreas.has(slot) ? m.lineFailedInView({ noun }) : m.lineFailed({ noun, from: undefined, to: undefined }), reason, () => retry(slot));\n        }\n        // A source the frame follows whose narrowing could not be read: in its own noun, its Retry its own.\n        const unread = [...followed.values()].find((source) => source.error !== undefined);\n        if (unread?.error !== undefined) return failed(m.lineFailed({ noun: unread.name, from: undefined, to: undefined }), unread.error, unread.retry);\n        if (reading !== undefined) {\n            const noun = nounOf(reading.slot);\n            if (reading.filtering) return loading(m.lineFiltering({ noun }), true);\n            switch (reading.what) {\n                case \"area\": return loading(m.lineInView({ noun }), false);\n                case \"counts\": return loading(m.lineCounts(), false);\n                case \"details\": {\n                    const n = reading.waiting;\n                    return loading(m.lineDetails({ n, count: words.number(n), noun: nounOf(reading.slot, n !== 1) }), false);\n                }\n                case \"rows\": return loading(m.lineLoading({ noun, from: undefined, to: undefined }), false);\n            }\n        }\n        return resolving === undefined ? undefined : loading(m.lineFiltering({ noun: nounOf(resolving) }), true);\n    }, [data.error, data.failures, data.failedAreas, followed, reading, resolving, nounOf, words, retry]);\n    // Each source the library follows whose narrowing could not be read, with Retry (#1389).\n    const followedFailures = [...followed.values()].filter((source) => source.error !== undefined);\n    // Each record's session's banners, titled by its kind, an issue placed by the entity it names, by its name.\n    const sessionName = (key: string) => {\n        const slot = recordSlot(key);\n        const name = kindName.get(slot) ?? slot;\n        return stringEqual(slot, key) ? name : words.m.detailsName({ name });\n    };\n    const banners = sessions.length === 0 && followedFailures.length === 0 ? undefined : (\n        <>\n            {sessions.map((part) => (\n                <SessionBanners key={part.key} session={part.session} words={editingWords} name={sessionName(part.kind)}\n                    where={(issue) => names.get(entityId({ kind: recordSlot(part.kind), key: issue.entry })) ?? issue.entry}\n                    onAction={(action) => history.actOn(part.key, action)} />\n            ))}\n            {followedFailures.map((source) => (\n                <Box key={source.name} data-schematic-banner=\"source\">\n                    <BannerView status=\"error\" title={words.m.sourceUnavailable({ name: source.name })} description={source.error}\n                        actions={<Button size=\"xs\" variant=\"outline\" onClick={source.retry}>{words.m.retry()}</Button>} />\n                </Box>\n            ))}\n        </>\n    );\n\n    // ── The inspector (#1391, §9): the end pane, given `inspector` ──────\n    // What Details shows: the selection as the drawing draws it, a net's leg with it — or, below 480px of main, the\n    // Backlog's card picked, an item with no position (#1394); and its rows, read on their own.\n    const entities = useMemo(() => drawnEntities(inspectorDrawn), [inspectorDrawn]);\n    const placing = useMemo((): SchematicUnplaced | undefined => {\n        if (!narrow || placingId === undefined) return undefined;\n        const entry = backlog.find((row) => stringEqual(row.id, placingId));\n        if (entry !== undefined) return { id: entry.id, ref: entry.ref, label: entry.roles.label, icon: getSomeorUndefined(entry.roles.icon) };\n        // A row of the paged Backlog, as its page read it.\n        const card = backlogPages?.card(placingId);\n        return card?.does === \"place\" ? { id: placingId, ref: card.ref, label: card.label, icon: undefined } : undefined;\n    }, [narrow, placingId, backlog, backlogPages]);\n    const inspectedNow = useMemo((): SchematicInspected => (placing !== undefined ? { view: \"unplaced\", ...placing } : inspectedOf(selection, leg, entities)),\n        [placing, selection, leg, entities]);\n    const inspected = useDataStable(inspectedNow, inspectedEqual);\n    const inspectedRef = inspected.view === \"entity\" || inspected.view === \"leg\" ? inspected.ref : undefined;\n    const [inspectedRows, setInspectedRows] = useState<SchematicInspectedRows>(NO_INSPECTED_ROWS);\n    // Its rows in flight: what the frame's reveal waits on too, so its placeholders show by the same clock (#1398, CL4).\n    const inspectorReading = inspectedRows.ref !== undefined && (inspectedRows.row.state === \"reading\" || inspectedRows.details?.state === \"reading\");\n    // Its open tab, kept per viewer; Enter, or a double-click on an entity, opens Details — the pane too, collapsed.\n    const { state: inspectorTab, setState: setInspectorTab } = usePersistedState<{ tab: string }>(`${keys.frame}.inspector.tab`, { tab: \"details\" }, keptRead.record({ tab: keptRead.string }));\n    const onInspectorTab = useCallback((tab: string) => setInspectorTab({ tab }), [setInspectorTab]);\n    // The frame's panes, as the Schematic's own code opens them: Enter's Details.\n    const panes = useRef<BuilderFramePanes>(null);\n    const openDetails = useCallback(() => {\n        setInspectorTab({ tab: \"details\" });\n        panes.current?.open(\"end\");\n    }, [setInspectorTab]);\n    // What Details and Issues name, selected through the canvas — and flown to.\n    const revealEntity = useCallback((id: string | undefined, at?: NetLeg) => canvasRef.current?.reveal(id, at), []);\n    const zoneAt = useCallback((x: number, y: number) => zoneHolding(hosts, x, y)?.label, [hosts]);\n    // The issues: each record's session's first — they block — then the stored rows' numbers outside their bounds, then the\n    // drawing's, every unsaved change the drawing leaves out checked beside it as its draft has it. Whether an item is held\n    // is known for an item kind read whole: its drawn rows and its backlog, the drafts in place.\n    const itemSlots = useMemo(() => new Set(value.items.map((kind) => kind.key)), [value.items]);\n    const wholeItems = useMemo(() => new Set(value.items.filter((kind) => kind.entries.type === \"none\").map((kind) => kind.key)), [value.items]);\n    const heldItems = useMemo(() => new Set([...drawing.items.map((item) => item.key), ...backlog.map((entry) => entry.id)]), [drawing.items, backlog]);\n    const historyVersion = editing.version;\n    // The items holding a conflict not yet chosen, by their ids: each wears the conflicts' warn ring. Read again as the\n    // history moves (its version), which every choice and every carry-over moves.\n    const conflicted = useMemo(() => {\n        const out = new Set<string>();\n        for (const part of sessions) for (const id of part.session.conflicts.keys()) out.add(entityId({ kind: recordSlot(part.kind), key: id }));\n        return out;\n        // eslint-disable-next-line react-hooks/exhaustive-deps -- the sessions are mutable: the history's version says they moved\n    }, [sessions, historyVersion]);\n    // The rows drawn whose numbers their fields' bounds don't hold (#1585), by entity, read in a component of their own:\n    // each wears the conflicts' warn ring, stored or changed, and a stored one's breach warns in Issues, after what blocks.\n    const [breaches, setBreaches] = useState<SchematicBreaches>(NO_BREACHES);\n    const bounded = useMemo(() => new Set(breaches.keys()), [breaches]);\n    const issues = useMemo(() => [\n        ...sessionIssues(sessions, kindName, (id) => names.get(id)),\n        ...boundsIssues(breaches, kindName, (id) => nameOfEntity(names, id)),\n        ...drawingIssues({\n            drawn: withWaiting(drawing, waiting), extent: value.extent, names: kindName, nameOf: (id) => nameOfEntity(names, id), layers: layerValues,\n            colours: THEME_COLOURS, holds: (ref) => (!itemSlots.has(ref.kind) ? false : wholeItems.has(ref.kind) ? heldItems.has(entityId(ref)) : undefined),\n        }),\n        // A session's readiness and its Save's issues move with the history's version.\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    ], [sessions, historyVersion, kindName, names, breaches, drawing, waiting, value.extent, layerValues, itemSlots, wholeItems, heldItems]);\n    // Each unsaved change the drawing leaves out, its reference by its id: an issue of one says which of the rail's choices\n    // hide it. Go to issue on one is the frame's hidden pick, as Find's is: those choices cleared, it flies to where its\n    // draft stands, and selects it once the narrowing they leave draws it.\n    const waitingRefs = useMemo((): ReadonlyMap<string, SchematicRef> => new Map([...waiting.items, ...waiting.zones, ...waiting.links, ...waiting.nets]\n        .map((entity) => [entity.key, entity.ref] as const)), [waiting]);\n    const goToWaiting = useCallback((id: string, hidden: readonly SourceHiding[] | undefined) => {\n        pick.pick(hidden, id, () => {\n            const at = waitingPoint(id, waiting, drawing);\n            if (at !== undefined) canvasRef.current?.look(at.x, at.y);\n            return true;\n        });\n    }, [pick, waiting, drawing]);\n    // A kind read by area is checked in the rows read around the view, never by a read of its others: Issues names each, its\n    // rows out of view checked only as the view reaches them (ruled 27 Oct 2026, \"Checked in view, said so\").\n    const unchecked = useMemo(() => [...value.items, ...value.zones].filter((kind) => areas.has(kind.key))\n        .map((kind) => kindPlural(kind.name.toLocaleLowerCase(words.locale))), [value.items, value.zones, areas, words]);\n    // The host's veto, as Details' Connect to…, a link's ends and a net's sides ask it — as the canvas's gestures do (#1394).\n    const canConnectFn = useMemo(() => getSomeorUndefined(value.canConnect), [value.canConnect]);\n    const veto = useMemo(() => connectVeto(canConnectFn, refOfId), [canConnectFn]);\n    // Details' Place: the Backlog's card, dropped as its ⏎ drops it — at the canvas's centre, selected (#1394).\n    const enterCard = drop.enter;\n    const place = useCallback((id: string) => enterCard(schematicLibraryId(keys, \"backlog\"), id), [enterCard, keys]);\n    const selectEntity = useCallback((entity: string) => canvasRef.current?.select(entity), []);\n    const end = schematicInspectorPane({\n        value, inspected, rows: inspectedRows, drawn: inspectorDrawn, names, listed, editing: inspectorEditing, counts, records, issues, unchecked,\n        waiting: waitingRefs, picks, goToWaiting, ask: askField, zoneAt, reveal: revealEntity, refuse: setRefusal, keyRefused, select: selectEntity,\n        tab: inspectorTab.tab, onTab: onInspectorTab, storageKey: keys.frame, words,\n        narrow, veto, linkKind: connectKind, onLinkKind: pickConnectKind, connectValues, place,\n    });\n\n    return (\n        <FieldAskProvider value={fieldAsks}><Box css={styles.root} data-schematic=\"\" data-schematic-layout={narrow ? \"narrow\" : \"wide\"}>\n            {value.inspector && <SchematicInspectedReader value={value} inspected={inspectedRef} areas={areas} windows={inspectedWindows} onRows={setInspectedRows} />}\n            {areas.size > 0 && editing.edits && (\n                <SchematicDraftsReader value={value} areas={areas} drafts={canvasDrafts} original={editing.schedule.held} onRead={setDraftsNarrowing} />\n            )}\n            {areas.size > 0 && <SchematicSelectedReader value={value} areas={areas} selected={selectedArea} windows={data.windows} onRead={setSelectedRows} />}\n            {value.inspector && areas.size > 0 && <SchematicAreaCountsReader value={value} areas={areas} onRead={setAreaCounts} />}\n            {backlogPages !== undefined && <SchematicBacklogCountReader source={backlogPages} parts={backlogPartKeys} onCount={setBacklogCount} />}\n            <SchematicBoundsReader value={value} areas={areas} windows={data.windows} drawing={drawing} schedule={editing.schedule} version={historyVersion}\n                onBreaches={setBreaches} />\n            {/* The frame's one reveal clock (CL4): the footer's line, the canvas's wash and placeholders and the inspector's show a\n                read in flight after 150 ms, held 300 ms once shown. */}\n            <LoadingReveal waiting={line?.kind === \"loading\" || inspectorReading}>\n                <BuilderFrame\n                    panesRef={panes}\n                    storageKey={keys.frame}\n                    label={words.m.frameLabel()}\n                    loading={!data.ready && data.error === undefined}\n                    busy={data.loading || narrowingBusy}\n                    toolbar={items}\n                    toolbarRef={toolbarRef}\n                    banners={banners}\n                    start={library}\n                    end={end}\n                    footer={<SchematicFooter styles={styles} words={words} density={data.density} names={kindName} viewport={viewport} extent={value.extent}\n                        refusal={refusal} notices={notices} found={found} line={line} />}\n                    liveFooter\n                    onKeyDown={onKeyDown}\n                >\n                    <SchematicCanvas ref={canvasRef} value={value} data={drawing} layers={layers} narrowing={canvasNarrowing} conflicted={conflicted} bounded={bounded} tool={held.tool} linkKind={held.link}\n                        words={words} editing={canvasEditing} onRefused={setRefusal} onAction={refusal === undefined ? undefined : dropRefusal}\n                        onSelection={onSelection} onOpen={value.inspector ? openDetails : undefined}\n                        onZoneInView={listsIndex ? setInView : undefined} drop={drop.canvas} connectValues={connectValues}\n                        viewport={areas.size > 0 ? viewport : undefined} density={data.density} overview={data.overview} reading={areas.size > 0 && data.loading}\n                        unread={data.unread} failure={canvasFailure} stale={stale} retained={retained} onZoomRange={setZoomRange} narrow={narrow}\n                        standing={standing} fit={canvasFit} onElement={onCanvasElement} />\n                </BuilderFrame>\n            </LoadingReveal>\n        </Box></FieldAskProvider>\n    );\n}\n\n// =============================================================================\n// Side-effect — register the renderer for the Schematic extension on module load.\n// =============================================================================\n\nimplementUIComponent(Schematic.Component, EastChakraSchematic);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useQuery, useMutation, type UseMutationResult, type UseQueryResult } from '@tanstack/react-query';\nimport { repoList, repoStatus, repoGc, repoGcStart, repoGcStatus, repoCreate, repoRemove } from '@elaraai/e3-api-client';\nimport type { RequestOptions, GcRequest, GcResult, GcStartResult, GcStatusResult } from '@elaraai/e3-api-client';\nimport type { QueryOverrides } from './types.js';\n\nexport function useRepoList(url: string, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['repoList', url],\n        queryFn: () => repoList(url, requestOptions ?? { token: null }),\n        enabled: true,\n        ...queryOptions,\n    });\n}\n\nexport function useRepoStatus(url: string, repo: string, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['repoStatus', url, repo],\n        queryFn: () => repoStatus(url, repo, requestOptions ?? { token: null }),\n        enabled: !!repo,\n        ...queryOptions,\n    });\n}\n\nexport function useRepoGc(url: string, repo: string, requestOptions?: RequestOptions): UseMutationResult<GcResult, Error, GcRequest> {\n    return useMutation<GcResult, Error, GcRequest>({\n        mutationFn: (gcOptions) => repoGc(url, repo, gcOptions, requestOptions ?? { token: null }),\n    });\n}\n\nexport function useRepoGcStart(url: string, repo: string, requestOptions?: RequestOptions): UseMutationResult<GcStartResult, Error, GcRequest> {\n    return useMutation<GcStartResult, Error, GcRequest>({\n        mutationFn: (gcOptions) => repoGcStart(url, repo, gcOptions, requestOptions ?? { token: null }),\n    });\n}\n\nexport function useRepoGcStatus(url: string, repo: string, executionId: string, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<GcStatusResult, Error> {\n    return useQuery({\n        queryKey: ['repoGcStatus', url, repo, executionId],\n        queryFn: () => repoGcStatus(url, repo, executionId, requestOptions ?? { token: null }),\n        enabled: !!repo && !!executionId,\n        ...queryOptions,\n    });\n}\n\nexport function useRepoCreate(url: string, requestOptions?: RequestOptions) {\n    return useMutation<string, Error, string>({\n        mutationFn: (name) => repoCreate(url, name, requestOptions ?? { token: null }),\n    });\n}\n\nexport function useRepoRemove(url: string, requestOptions?: RequestOptions) {\n    return useMutation<void, Error, string>({\n        mutationFn: (name) => repoRemove(url, name, requestOptions ?? { token: null }),\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useQuery, useMutation, type UseQueryResult } from '@tanstack/react-query';\nimport type { QueryOverrides } from './types.js';\nimport { packageList, packageGet, packageImport, packageExport, packageRemove } from '@elaraai/e3-api-client';\nimport type { RequestOptions, PackageImportResult } from '@elaraai/e3-api-client';\nimport type { PackageObject } from '@elaraai/e3-types';\n\nexport function usePackageList(url: string, repo: string, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['packageList', url, repo],\n        queryFn: () => packageList(url, repo, requestOptions ?? { token: null }),\n        enabled: !!repo,\n        ...queryOptions,\n    });\n}\n\nexport function usePackageGet(url: string, repo: string, name: string, version: string, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<PackageObject, Error> {\n    return useQuery({\n        queryKey: ['packageGet', url, repo, name, version],\n        queryFn: () => packageGet(url, repo, name, version, requestOptions ?? { token: null }),\n        enabled: !!repo && !!name && !!version,\n        ...queryOptions,\n    });\n}\n\nexport function usePackageImport(url: string, repo: string, requestOptions?: RequestOptions) {\n    return useMutation<PackageImportResult, Error, Uint8Array>({\n        mutationFn: (archive) => packageImport(url, repo, archive, requestOptions ?? { token: null }),\n    });\n}\n\nexport function usePackageExport(url: string, repo: string, name: string, version: string, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['packageExport', url, repo, name, version],\n        queryFn: () => packageExport(url, repo, name, version, requestOptions ?? { token: null }),\n        enabled: !!repo && !!name && !!version,\n        ...queryOptions,\n    });\n}\n\nexport function usePackageRemove(url: string, repo: string, requestOptions?: RequestOptions) {\n    return useMutation<void, Error, { name: string; version: string }>({\n        mutationFn: ({ name, version }) => packageRemove(url, repo, name, version, requestOptions ?? { token: null }),\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useQuery, useMutation, type UseMutationResult, type UseQueryResult } from '@tanstack/react-query';\nimport type { QueryOverrides } from './types.js';\nimport {\n    workspaceList, workspaceCreate, workspaceCopy, workspaceGet, workspaceStatus, workspaceRemove, workspaceDeploy, workspaceExport,\n    pollRequestOptions,\n} from '@elaraai/e3-api-client';\nimport type { RequestOptions, WorkspaceDeployOptions, WorkspaceDeployResult, WorkspaceInfo, WorkspaceStatusResult } from '@elaraai/e3-api-client';\nimport type { WorkspaceState } from '@elaraai/e3-types';\n\nexport function useWorkspaceList(url: string, repo: string, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<WorkspaceInfo[], Error> {\n    return useQuery({\n        queryKey: ['workspaceList', url, repo],\n        queryFn: () => workspaceList(url, repo, requestOptions ?? { token: null }),\n        enabled: !!repo,\n        ...queryOptions,\n    });\n}\n\nexport function useWorkspaceCreate(url: string, repo: string, requestOptions?: RequestOptions): UseMutationResult<WorkspaceInfo, Error, string> {\n    return useMutation<WorkspaceInfo, Error, string>({\n        mutationFn: (name) => workspaceCreate(url, repo, name, requestOptions ?? { token: null }),\n    });\n}\n\n/**\n * Copy a workspace within its repository: the target becomes the source as it\n * is now, made or replaced whole, its refs only written.\n *\n * @param url - Base URL of the e3 API server\n * @param repo - Repository name\n * @param requestOptions - Request options including auth token\n * @returns A mutation, given the workspace copied and the one it is copied to,\n *   whose data is the target as the workspace list gives it\n */\nexport function useWorkspaceCopy(\n    url: string,\n    repo: string,\n    requestOptions?: RequestOptions,\n): UseMutationResult<WorkspaceInfo, Error, { from: string; to: string }> {\n    return useMutation<WorkspaceInfo, Error, { from: string; to: string }>({\n        mutationFn: ({ from, to }) => workspaceCopy(url, repo, from, to, requestOptions ?? { token: null }),\n    });\n}\n\nexport function useWorkspaceGet(url: string, repo: string, name: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<WorkspaceState, Error> {\n    return useQuery({\n        queryKey: ['workspaceGet', url, repo, name],\n        queryFn: () => workspaceGet(url, repo, name!, requestOptions ?? { token: null }),\n        enabled: !!repo && !!name,\n        ...queryOptions,\n    });\n}\n\n/** A workspace's status, read once per poll: one request attempt each, its\n *  next poll being its retry. */\nexport function useWorkspaceStatus(url: string, repo: string, name: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<WorkspaceStatusResult, Error> {\n    return useQuery({\n        queryKey: ['workspaceStatus', url, repo, name],\n        queryFn: () => workspaceStatus(url, repo, name!, pollRequestOptions(requestOptions ?? { token: null })),\n        enabled: !!repo && !!name,\n        ...queryOptions,\n    });\n}\n\nexport function useWorkspaceRemove(url: string, repo: string, requestOptions?: RequestOptions) {\n    return useMutation<void, Error, string>({\n        mutationFn: (name) => workspaceRemove(url, repo, name, requestOptions ?? { token: null }),\n    });\n}\n\n/**\n * Deploy a package to a workspace.\n *\n * @remarks\n * The server runs the deploy as a job, which the mutation polls, so it\n * settles once the deploy has finished.\n *\n * @param url - Base URL of the e3 API server\n * @param repo - Repository name\n * @param requestOptions - Request options including auth token\n * @returns A mutation, given the workspace, the package reference and the\n *   deploy's options — what it does with a record it cannot keep and with an\n *   input someone set, and whether it only plans — whose data is what the\n *   deploy decided for each record, index and input\n */\nexport function useWorkspaceDeploy(\n    url: string,\n    repo: string,\n    requestOptions?: RequestOptions,\n): UseMutationResult<WorkspaceDeployResult, Error, { name: string; packageRef: string; options?: WorkspaceDeployOptions }> {\n    return useMutation<WorkspaceDeployResult, Error, { name: string; packageRef: string; options?: WorkspaceDeployOptions }>({\n        mutationFn: ({ name, packageRef, options }) => workspaceDeploy(url, repo, name, packageRef, requestOptions ?? { token: null }, options),\n    });\n}\n\nexport function useWorkspaceExport(url: string, repo: string, name: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['workspaceExport', url, repo, name],\n        queryFn: () => workspaceExport(url, repo, name!, requestOptions ?? { token: null }),\n        enabled: !!repo && !!name,\n        ...queryOptions,\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useQuery, type UseQueryResult } from '@tanstack/react-query';\nimport type { QueryOverrides } from './types.js';\nimport { taskList, taskGet, taskExecutionList } from '@elaraai/e3-api-client';\nimport type { RequestOptions, TaskDetails, TaskListItem, ExecutionListItem } from '@elaraai/e3-api-client';\n\n// NOTE: the return type must stay explicitly annotated. TaskListItem carries\n// an East variant (`role`), so the inferred type references east-internal\n// symbols the declaration emitter cannot name (TS4058) — the declaration build then\n// silently drops this whole FILE from the published types (how 1.0.38 shipped\n// without the task hooks).\nexport function useTaskList(url: string, repo: string, workspace: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<TaskListItem[], Error> {\n    return useQuery({\n        queryKey: ['taskList', url, repo, workspace],\n        queryFn: () => taskList(url, repo, workspace!, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\n/**\n * The query key of a task's details, which `useTaskGet` and `useTaskDetails`\n * share: a preview and the host that opened it read the task once.\n *\n * @param url - Base URL of the e3 API server\n * @param repo - Repository name\n * @param workspace - Workspace name\n * @param name - The task\n * @returns The key\n */\nexport function taskDetailsQueryKey(url: string, repo: string, workspace: string | null, name: string | null): readonly unknown[] {\n    return ['taskGet', url, repo, workspace, name];\n}\n\nexport function useTaskGet(url: string, repo: string, workspace: string | null, name: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<TaskDetails, Error> {\n    return useQuery({\n        queryKey: taskDetailsQueryKey(url, repo, workspace, name),\n        queryFn: () => taskGet(url, repo, workspace!, name!, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace && !!name,\n        ...queryOptions,\n    });\n}\n\nexport function useTaskExecutionList(url: string, repo: string, workspace: string | null, taskName: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<ExecutionListItem[], Error> {\n    return useQuery({\n        queryKey: ['taskExecutionList', url, repo, workspace, taskName],\n        queryFn: () => taskExecutionList(url, repo, workspace!, taskName!, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace && !!taskName,\n        ...queryOptions,\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useQuery, useMutation, type UseMutationResult, type UseQueryResult } from '@tanstack/react-query';\nimport { IntegerType, printFor } from '@elaraai/east';\nimport type { QueryOverrides } from './types.js';\nimport {\n    dataflowExecute, dataflowExecuteLaunch, dataflowGraph, dataflowExecutePoll, dataflowCancel, taskLogs, pollRequestOptions,\n} from '@elaraai/e3-api-client';\nimport type { RequestOptions, DataflowOptions, DataflowPollOptions, ExecutionStateOptions, LogOptions, DataflowResult, DataflowExecutionState } from '@elaraai/e3-api-client';\n\n/** Prints a poll's cursor for its query key, which react-query hashes as\n *  JSON, where a bigint does not go. */\nconst printSeq = printFor(IntegerType);\n\nexport function useDataflowExecute(url: string, repo: string, workspace: string | null, requestOptions?: RequestOptions): UseMutationResult<DataflowResult, Error, { dataflowOptions?: DataflowOptions; pollOptions?: DataflowPollOptions }> {\n    return useMutation<DataflowResult, Error, { dataflowOptions?: DataflowOptions; pollOptions?: DataflowPollOptions }>({\n        mutationFn: ({ dataflowOptions, pollOptions } = {}) =>\n            dataflowExecute(url, repo, workspace!, dataflowOptions, requestOptions ?? { token: null }, pollOptions),\n    });\n}\n\nexport function useDataflowStart(url: string, repo: string, workspace: string | null, requestOptions?: RequestOptions) {\n    return useMutation<void, Error, DataflowOptions | undefined>({\n        mutationFn: (dataflowOptions) =>\n            dataflowExecuteLaunch(url, repo, workspace!, dataflowOptions, requestOptions ?? { token: null }),\n    });\n}\n\nexport function useDataflowGraph(url: string, repo: string, workspace: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['dataflowGraph', url, repo, workspace],\n        queryFn: () => dataflowGraph(url, repo, workspace!, requestOptions ?? { token: null }),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\n/**\n * Polls a workspace's latest run: its state, with the events past\n * `stateOptions.since`, at most `stateOptions.limit` of them, and the cursor\n * past them (`nextSeq`). Each poll makes one request attempt: its next poll\n * is its retry.\n *\n * @param url - The API's base URL\n * @param repo - Repository name\n * @param workspace - Workspace name; nothing is polled while it is `null`\n * @param stateOptions - The cursor to poll from, and the most events to serve:\n *   `{ limit: 0 }` reads the run's state alone\n * @param requestOptions - The request's token\n * @param queryOptions - react-query overrides, such as a `refetchInterval`\n * @returns The query of the run's state\n */\nexport function useDataflowExecution(url: string, repo: string, workspace: string | null, stateOptions?: ExecutionStateOptions, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<DataflowExecutionState, Error> {\n    const since = stateOptions?.since === undefined ? null : printSeq(stateOptions.since);\n    return useQuery({\n        queryKey: ['dataflowExecution', url, repo, workspace, since, stateOptions?.limit ?? null],\n        queryFn: () => dataflowExecutePoll(url, repo, workspace!, stateOptions, pollRequestOptions(requestOptions ?? { token: null })),\n        enabled: !!repo && !!workspace,\n        ...queryOptions,\n    });\n}\n\nexport function useDataflowCancel(url: string, repo: string, workspace: string | null, requestOptions?: RequestOptions) {\n    return useMutation<void, Error, void>({\n        mutationFn: () => dataflowCancel(url, repo, workspace!, requestOptions ?? { token: null }),\n    });\n}\n\n/** A chunk of a task's log, read once per poll: one request attempt each,\n *  its next poll being its retry. */\nexport function useTaskLogs(url: string, repo: string, workspace: string | null, task: string | null, logOptions?: LogOptions, requestOptions?: RequestOptions, queryOptions?: QueryOverrides) {\n    return useQuery({\n        queryKey: ['taskLogs', url, repo, workspace, task, logOptions],\n        queryFn: () => taskLogs(url, repo, workspace!, task!, logOptions, pollRequestOptions(requestOptions ?? { token: null })),\n        enabled: !!repo && !!workspace && !!task,\n        ...queryOptions,\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useMemo } from 'react';\nimport { useQuery, keepPreviousData, type UseQueryResult } from '@tanstack/react-query';\nimport { datasetGetPage } from '@elaraai/e3-api-client';\nimport type { RequestOptions, DatasetPageWindow } from '@elaraai/e3-api-client';\nimport { variant, decodeBeast2For, type EastTypeValue } from '@elaraai/east';\nimport type { QueryOverrides } from './types.js';\n\nexport type { DatasetPageWindow } from '@elaraai/e3-api-client';\n\nexport interface UseDatasetPageOptions {\n    requestOptions?: RequestOptions;\n    queryOverrides?: QueryOverrides;\n    /** Set false to skip the fetch. Defaults to true. */\n    enabled?: boolean;\n    /**\n     * Content hash of the current dataset version — part of the query key so\n     * cached pages invalidate when the underlying data changes. The fetch is\n     * gated on it being non-null.\n     */\n    hash?: string | null;\n    /** East type to decode pages against. Required. */\n    type: EastTypeValue;\n    /** The window to read: an element window or one writer segment. */\n    window: DatasetPageWindow;\n}\n\nexport interface DatasetPageResult {\n    /** The decoded window — a value of the dataset's own type. */\n    decoded: unknown;\n    /** Total elements in the dataset (pairs for Dict datasets). */\n    totalElements: number;\n    /** Byte size of the whole stored blob. */\n    totalBytes: number;\n    /** Whether `totalElements` is exact (segment windows of Set/Dict\n     *  datasets report an upper bound). */\n    totalExact: boolean;\n    /** Segments in the stored blob; 0 when the blob carries no index. */\n    segmentCount: number;\n    /** Global element offset of the window's first element. */\n    offset: number;\n    /** Elements actually in this page (the server may clamp the limit). */\n    count: number;\n}\n\n/**\n * Fetch + decode one window of a collection (Array/Set/Dict) dataset.\n *\n * Pages are keyed by content hash and window, and the previous page is held\n * on screen while the next loads, so stepping through windows never flashes\n * the loading state.\n */\nexport function useDatasetPage(\n    apiUrl: string,\n    repo: string,\n    workspace: string | null,\n    datasetPath: string | null,\n    options: UseDatasetPageOptions,\n): UseQueryResult<DatasetPageResult, Error> {\n    const { requestOptions, queryOverrides, enabled = true, hash, type, window } = options;\n    const reqOpts = requestOptions ?? { token: null };\n\n    const pathParts = useMemo(() =>\n        datasetPath?.split('.').filter(Boolean).map((v) => variant('field', v)) ?? [],\n        [datasetPath],\n    );\n    const windowKey = 'segment' in window ? `s${window.segment}` : `${window.offset}+${window.limit}`;\n\n    return useQuery({\n        queryKey: ['datasetPage', apiUrl, repo, workspace, datasetPath, hash ?? null, windowKey],\n        queryFn: async (): Promise<DatasetPageResult> => {\n            // Pin the request to the hash: the URL becomes a pure function of\n            // the bytes, so edge/browser caches can hold pages immutably.\n            const pinned = hash != null ? { ...window, hash } : window;\n            const page = await datasetGetPage(apiUrl, repo, workspace!, pathParts, pinned, reqOpts);\n            const decoded = decodeBeast2For(type)(page.data);\n            return {\n                decoded,\n                totalElements: page.totalElements,\n                totalBytes: page.totalBytes,\n                totalExact: page.totalExact,\n                segmentCount: page.segmentCount,\n                offset: page.offset,\n                count: page.count,\n            };\n        },\n        enabled: enabled && !!workspace && !!datasetPath && hash != null,\n        placeholderData: keepPreviousData,\n        ...queryOverrides,\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useEffect, useMemo } from 'react';\nimport { useQuery, useQueryClient, type UseQueryResult } from '@tanstack/react-query';\nimport { taskGet } from '@elaraai/e3-api-client';\nimport type { RequestOptions, TaskDetails } from '@elaraai/e3-api-client';\nimport type { QueryOverrides } from './types.js';\nimport { taskDetailsQueryKey } from './tasks.js';\n\nexport interface UseTaskDetailsOptions {\n    requestOptions?: RequestOptions;\n    queryOverrides?: QueryOverrides;\n    /**\n     * The task's details, when the caller holds them — from a task list it\n     * read, or a preview that read them: the query is answered from them,\n     * first and as they change, and the server is not asked.\n     */\n    details?: TaskDetails;\n}\n\n/**\n * Fetch a task's details (name, body, runner, inputs, output, role).\n *\n * @remarks\n * The query is keyed as `useTaskGet`'s ({@link taskDetailsQueryKey}), so a\n * preview and the host that opened it share one read; and a caller that\n * holds the details gives them (`options.details`), which answers the query\n * without a request — and answers it again as they change, so a host that\n * read the task again hands the preview what it read.\n *\n * @param apiUrl - Base URL of the e3 API server\n * @param repo - Repository name\n * @param workspace - Workspace name; nothing is read while `null`\n * @param taskName - The task; nothing is read while `null`\n * @param options - The requests' options, react-query overrides, and the\n *   details when held\n * @returns The query of the details\n */\nexport function useTaskDetails(\n    apiUrl: string,\n    repo: string,\n    workspace: string | null,\n    taskName: string | null,\n    options?: UseTaskDetailsOptions,\n): UseQueryResult<TaskDetails, Error> {\n    const reqOpts = options?.requestOptions ?? { token: null };\n    const details = options?.details;\n    const client = useQueryClient();\n    const queryKey = useMemo(() => taskDetailsQueryKey(apiUrl, repo, workspace, taskName), [apiUrl, repo, workspace, taskName]);\n    // The details the host holds answer the query as they change: the first\n    // are its initial data, and each after replaces what the query holds.\n    useEffect(() => {\n        if (details !== undefined) client.setQueryData(queryKey, details);\n    }, [client, details, queryKey]);\n    return useQuery({\n        queryKey,\n        queryFn: () => taskGet(apiUrl, repo, workspace!, taskName!, reqOpts),\n        enabled: !!repo && !!workspace && !!taskName && details === undefined,\n        ...(details !== undefined && { initialData: details }),\n        ...options?.queryOverrides,\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { Component, type ErrorInfo, type ReactNode } from 'react';\nimport { StatusDisplay } from './StatusDisplay.js';\nimport { formatError } from '../errors.js';\n\nexport interface ErrorBoundaryProps {\n    children: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n    error: Error | null;\n}\n\n/**\n * React Error Boundary that catches rendering errors in East UI components.\n * Displays EastError details (including source locations) using StatusDisplay.\n *\n * @remarks\n * `componentDidUpdate` clears the error when `children` changes, so a\n * transient render exception followed by a successful re-render shows up\n * as a brief \"flash\" of the error UI. We always `console.error` the caught\n * exception so the failure is preserved even when the visual flash is too\n * fast to read.\n */\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n    constructor(props: ErrorBoundaryProps) {\n        super(props);\n        this.state = { error: null };\n    }\n\n    static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n        return { error };\n    }\n\n    override componentDidCatch(error: Error, info: ErrorInfo): void {\n        console.error('[ErrorBoundary] render exception caught:', error, info.componentStack);\n    }\n\n    override componentDidUpdate(prevProps: ErrorBoundaryProps) {\n        // Reset error when children change (new data loaded)\n        if (this.state.error !== null && prevProps.children !== this.props.children) {\n            this.setState({ error: null });\n        }\n    }\n\n    override render() {\n        if (this.state.error !== null) {\n            return (\n                <StatusDisplay\n                    variant=\"error\"\n                    title=\"Rendering error\"\n                    details={formatError(this.state.error)}\n                />\n            );\n        }\n        return this.props.children;\n    }\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<InputPreview>` — an input's value, editable, under a band naming the\n * input.\n *\n * A host that names the input and draws the preview's controls in its own\n * header passes `bare`, so the preview draws no band naming the input, and\n * `toolbar={false}`; it controls the key search with `search` and acts on the\n * tree through the `controls` it makes with `usePreviewControls`, which reach\n * the value's {@link DatasetPreview} (#1209).\n *\n * @packageDocumentation\n */\n\nimport { memo } from 'react';\nimport { Box, Text, Flex } from '@chakra-ui/react';\nimport type { RequestOptions } from '@elaraai/e3-api-client';\nimport { DatasetPreview, type DatasetPreviewProps } from './DatasetPreview.js';\n\nexport interface InputPreviewProps {\n    apiUrl: string;\n    repo: string;\n    workspace: string;\n    path: string;\n    requestOptions?: RequestOptions;\n    /** No band naming the input, for a host whose frame names it, as\n     *  `TaskPreview`'s `bare` drops its own (#1209). Default `false`. */\n    bare?: boolean;\n    /** `false` draws no band above the value: see {@link DatasetPreviewProps.toolbar}. Default `true`. */\n    toolbar?: boolean;\n    /** The value's key search, controlled: see {@link DatasetPreviewProps.search}. */\n    search?: string;\n    /** Told the text of the value's own search box: see {@link DatasetPreviewProps.onSearchChange}. */\n    onSearchChange?: (search: string) => void;\n    /** The handle a host's own Collapse all and Expand all act through: see {@link DatasetPreviewProps.controls}. */\n    controls?: DatasetPreviewProps['controls'];\n    /** How often the input's status is polled, in milliseconds: see\n     *  {@link DatasetPreviewProps.pollInterval}. Default 30 000. */\n    pollInterval?: number;\n}\n\nexport const InputPreview = memo(function InputPreview({\n    apiUrl,\n    repo,\n    workspace,\n    path,\n    requestOptions,\n    bare = false,\n    toolbar,\n    search,\n    onSearchChange,\n    controls,\n    pollInterval,\n}: InputPreviewProps) {\n    const displayName = path.replace(/^\\.inputs\\./, '');\n\n    return (\n        // `height` rather than `flex`, matching the sibling previews: the host\n        // mount is not always a flex container, and a `flex` bound would then\n        // silently fall back to auto height and grow with the content.\n        <Box height=\"100%\" display=\"flex\" flexDirection=\"column\" overflow=\"hidden\">\n            {!bare && (\n                <Flex px={4} py={2} borderBottom=\"1px solid\" borderColor=\"border.subtle\" bg=\"bg.surface\" align=\"center\" justify=\"space-between\">\n                    <Text fontSize=\"body.lg\" fontWeight=\"medium\" color=\"fg\">{displayName}</Text>\n                </Flex>\n            )}\n            <Box flex={1} overflow=\"hidden\" minHeight={0}>\n                <DatasetPreview\n                    apiUrl={apiUrl}\n                    repo={repo}\n                    workspace={workspace}\n                    path={path}\n                    editable\n                    {...(requestOptions != null && { requestOptions })}\n                    {...(toolbar !== undefined && { toolbar })}\n                    {...(search !== undefined && { search })}\n                    {...(onSearchChange !== undefined && { onSearchChange })}\n                    {...(controls !== undefined && { controls })}\n                    {...(pollInterval !== undefined && { pollInterval })}\n                />\n            </Box>\n        </Box>\n    );\n}, (prev, next) => prev.path === next.path && prev.workspace === next.workspace\n    && prev.apiUrl === next.apiUrl && prev.repo === next.repo && prev.bare === next.bare\n    // A rotated token, or another fetch, re-renders the preview, or its reads\n    // keep the old one (as TaskPreview's, #959).\n    && prev.requestOptions?.token === next.requestOptions?.token\n    && Object.is(prev.requestOptions?.fetch, next.requestOptions?.fetch)\n    // The host's controls (#1209).\n    && prev.toolbar === next.toolbar && prev.search === next.search\n    && Object.is(prev.onSearchChange, next.onSearchChange) && Object.is(prev.controls, next.controls)\n    && prev.pollInterval === next.pollInterval);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<UITaskPreview>` — render an e3 task whose role is `ui`.\n *\n * Pipeline: useTaskDetails → the role's manifest → preload manifest reads →\n * register reads with workspace poller → fetch output → render decoded\n * value as a UIComponent tree, scoped to the manifest.\n *\n * Workspace/apiUrl/repo come from the surrounding `<ReactiveDatasetProvider>`\n * by default; can be overridden via the `config` prop (used by `<TaskPreview>`\n * which still takes these as explicit props), whose workspace must be the one\n * the provider serves.\n *\n * Each stage that fails shows its failure, and recovers by itself for as long\n * as the preview is mounted, so a preview on a screen no one touches, such as\n * a kiosk's, goes on once the server answers again: the task's details, the\n * preload, and the output's status and value are tried again after waits that\n * back off from 1 s to 30 s, drawn at random so previews that failed together\n * try again apart. The failure shows until a try reads, never going back to\n * loading.\n *\n * @packageDocumentation\n */\n\nimport { memo, useEffect, useMemo } from 'react';\nimport { Box } from '@chakra-ui/react';\nimport {\n    UIStoreProvider,\n    createUIStore,\n    EastChakraComponent,\n    StateImpl,\n    SliceImpl,\n    SliceApplyImpl,\n    OverlayImpl,\n    ClipboardImpl,\n    DownloadImpl,\n    ShareImpl,\n} from '@elaraai/east-ui-components';\nimport type { ValueTypeOf } from '@elaraai/east';\nimport type { UIComponentType } from '@elaraai/east-ui';\nimport { RecordSliceImpl } from '@elaraai/east-ui-components/platform';\nimport type { PlatformFunction } from '@elaraai/east/internal';\nimport type { TaskDetails } from '@elaraai/e3-api-client';\nimport type { TreePath } from '@elaraai/e3-types';\nimport {\n    useReactiveDatasetCacheOptional,\n    usePreloadReactiveDatasets,\n    type ReactiveDatasetToPreload,\n} from '../platform/dataset-hooks.js';\nimport { e3RequestOptions, useE3ConfigOptional, type E3Config } from '../platform/e3-config.js';\nimport { useQueryRecovery } from '../platform/recovery.js';\nimport { createScopedBindPlatform } from '../platform/bind-runtime.js';\nimport { createScopedPagedPlatform } from '../platform/paged-runtime.js';\nimport { createScopedFuncPlatform } from '../platform/func-runtime.js';\nimport { createScopedRecordPlatform } from '../platform/record-runtime.js';\nimport { DecisionBindPlatform } from '../decision/handle-runtime.js';\nimport { useTaskDetails } from '../hooks/useTaskDetails.js';\nimport { useDatasetStatus } from '../hooks/useDatasetStatus.js';\nimport { useDatasetValue } from '../hooks/useDatasetValue.js';\nimport { StatusDisplay } from './StatusDisplay.js';\nimport { ErrorBoundary } from './ErrorBoundary.js';\n\nexport interface UITaskPreviewProps {\n    /** Task name (a task whose role is `ui`). */\n    task: string;\n    /**\n     * Override the surrounding `<E3Provider>`'s server identity, or supply one\n     * where there is none. A `workspace` it names must be the one the\n     * surrounding `<ReactiveDatasetProvider>` serves: `Data.bind` and\n     * `Data.bindPaged` read through process-global runtimes bound to that\n     * workspace, so a page previews one workspace, and a preview whose override\n     * names another shows an error.\n     */\n    config?: E3Config;\n    /**\n     * Poll interval (ms) for the manifest's declared reads while what they\n     * show changes: the workspace's poll backs off once nothing has, and\n     * comes back to this on a change or when the viewer acts. The cache's\n     * own interval (`ReactiveDatasetProvider`'s `pollIntervalMs`, 1000 ms\n     * unless given) when omitted.\n     */\n    pollInterval?: number;\n    /**\n     * The longest (ms) the workspace's poll backs off to while nothing the\n     * manifest's reads show changes. The cache's own backoff\n     * (`ReactiveDatasetProvider`'s `pollBackoffMs`, 5000 ms unless given)\n     * when omitted.\n     */\n    pollBackoff?: number;\n    /**\n     * How often (ms) the output's status is polled, which says when the\n     * task has produced a new value. Default 30 000.\n     */\n    outputPollInterval?: number;\n    /** The task's details, when the host holds them: the preview reads them\n     *  from the host rather than the server. */\n    details?: TaskDetails;\n    /**\n     * Chromeless mode: drop the padding + scroll wrapper so the ui output\n     * (a page that owns its own layout) fills its container edge-to-edge —\n     * for a host's own page or kiosk embedding. Default `false`\n     * (the padded, scrollable preview wrapper).\n     */\n    bare?: boolean;\n}\n\nfunction treePathToString(path: TreePath): string {\n    return path.map(p => p.value).join('.');\n}\n\nexport const UITaskPreview = memo(function UITaskPreview({\n    task,\n    config,\n    pollInterval,\n    pollBackoff,\n    outputPollInterval,\n    details: givenDetails,\n    bare = false,\n}: UITaskPreviewProps) {\n    // Read the provider non-throwingly: the `config` prop is designed to let a\n    // caller render a preview without a surrounding <E3Provider>. `config` wins;\n    // fall back to the provider when present. Either source alone is sufficient.\n    const e3 = useE3ConfigOptional();\n    const cache = useReactiveDatasetCacheOptional();\n    const apiUrl = config?.apiUrl ?? e3?.apiUrl ?? null;\n    const repo = config?.repo ?? e3?.repo ?? 'default';\n    const workspace = config?.workspace ?? e3?.workspace ?? null;\n    const requestOptions = e3RequestOptions({\n        token: config?.token ?? e3?.token ?? null,\n        fetch: config?.fetch ?? e3?.fetch,\n    });\n    // The data bindings read the workspace the provider serves, through\n    // runtimes that are process-global: an override naming another workspace\n    // would render its task over this one's data.\n    const bound = cache?.getConfig().workspace;\n    const foreign = config?.workspace !== undefined && bound !== undefined && config.workspace !== bound;\n\n    const detailsQuery = useTaskDetails(apiUrl ?? '', repo, workspace, task, {\n        requestOptions,\n        ...(givenDetails !== undefined && { details: givenDetails }),\n    });\n    const detailsFailure = useQueryRecovery(detailsQuery);\n    const details = detailsQuery.data;\n\n    const manifest = useMemo(() => (details?.role.type === 'ui' ? details.role.value : null), [details]);\n\n    const outputPath = details ? treePathToString(details.output.path) : null;\n\n    // Preload manifest paths so Data.bind().read() never misses on first paint.\n    const preloads = useMemo<ReactiveDatasetToPreload[]>(\n        () => (manifest && workspace && !foreign ? manifest.paths.map(path => ({ workspace, path })) : []),\n        [manifest, workspace, foreign],\n    );\n    const { loading: preloading, error: preloadError } = usePreloadReactiveDatasets(preloads);\n\n    // Per-render scoped `Data.bind` impl (strict path validation against\n    // the manifest). `OverlayImpl` here is the UI overlay (modal/dialog)\n    // impl — unrelated to data bindings despite the name.\n    const scopedPlatforms = useMemo<PlatformFunction[] | undefined>(\n        () =>\n            manifest\n                ? [\n                    // EVERY browser-local platform impl (unscoped — no manifest paths) from east-ui-components +\n                    // e3-ui-components MUST be listed here, or a ui() task that uses it throws \"Platform function\n                    // '<x>_bind' is not available\" — and only inside an e3 ui() task, so component tests miss it\n                    // (see east-contribute \"Common traps\"). The manifest-SCOPED data/func/record binds follow.\n                    ...StateImpl,\n                    ...SliceImpl, ...RecordSliceImpl,\n                    ...SliceApplyImpl,\n                    ...OverlayImpl,\n                    ...ClipboardImpl,\n                    ...DownloadImpl,\n                    ...ShareImpl,\n                    ...DecisionBindPlatform,\n                    ...createScopedBindPlatform(manifest),\n                    ...createScopedPagedPlatform(manifest.pages),\n                    ...createScopedFuncPlatform(manifest.functions),\n                    ...createScopedRecordPlatform(manifest.records),\n                ]\n                : undefined,\n        [manifest],\n    );\n\n    // Register manifest paths with workspace poller for live updates;\n    // unregister on unmount so the poller stops when nothing watches.\n    useEffect(() => {\n        if (!cache || !manifest || !workspace || foreign) return;\n        for (const path of manifest.paths) {\n            cache.setRefetchInterval(workspace, path, pollInterval, pollBackoff);\n        }\n        return () => {\n            for (const path of manifest.paths) {\n                cache.clearRefetchInterval(workspace, path);\n            }\n        };\n    }, [cache, manifest, workspace, pollInterval, pollBackoff, foreign]);\n\n    // Fetch the output value (no size gate — UI is wanted in full).\n    const statusQuery = useDatasetStatus(apiUrl ?? '', repo, workspace, outputPath, {\n        requestOptions,\n        ...(outputPollInterval !== undefined && { pollInterval: outputPollInterval }),\n    });\n    const statusFailure = useQueryRecovery(statusQuery);\n    const valueQuery = useDatasetValue(apiUrl ?? '', repo, workspace, outputPath, {\n        requestOptions,\n        type: statusQuery.data?.type as never,\n        hash: statusQuery.data?.hash ?? null,\n        ...(scopedPlatforms && { platforms: scopedPlatforms }),\n    });\n    const valueFailure = useQueryRecovery(valueQuery);\n\n    // Stable UIStore per UI tree (re-create when task changes — `task`\n    // listed as a dep so a new store is allocated whenever the task\n    // identity changes, even though the factory takes no arguments).\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    const store = useMemo(() => createUIStore(), [task]);\n\n    if (!apiUrl) return <StatusDisplay variant=\"error\" title=\"Configuration error\" message=\"No apiUrl available — render UITaskPreview inside an <E3Provider> or pass a config prop.\" />;\n    if (foreign) {\n        return <StatusDisplay variant=\"error\" title=\"Workspace mismatch\" message={`config names workspace \"${config?.workspace}\", and the data bindings read workspace \"${bound}\", the one the surrounding <ReactiveDatasetProvider> serves: a page previews one workspace.`} />;\n    }\n    // Each stage's failure before its loading state: a query that failed has\n    // no data, and would otherwise show as loading forever, and one tried\n    // again shows its failure until it reads, never going back to loading.\n    if (detailsFailure) return <StatusDisplay variant=\"error\" title=\"Error\" message={detailsFailure.message} />;\n    if (detailsQuery.isLoading) return <StatusDisplay variant=\"loading\" title=\"Loading task...\" />;\n    if (!details) return <StatusDisplay variant=\"info\" title=\"No task\" message={`Task \"${task}\" not found`} />;\n    if (!manifest) return <StatusDisplay variant=\"error\" title=\"Not a UI task\" message={`Task \"${task}\" is a ${details.role.type} task`} />;\n    if (preloadError) return <StatusDisplay variant=\"error\" title=\"Preload failed\" message={preloadError.message} />;\n    if (preloading) return <StatusDisplay variant=\"loading\" title=\"Loading datasets...\" />;\n    if (statusFailure) return <StatusDisplay variant=\"error\" title=\"Error\" message={statusFailure.message} />;\n    if (statusQuery.isLoading || !statusQuery.data) return <StatusDisplay variant=\"loading\" title=\"Loading...\" />;\n    if (statusQuery.data.refType !== 'value') return <StatusDisplay variant=\"info\" title=\"No output yet\" message=\"Task has not produced a value\" />;\n    if (valueFailure) return <StatusDisplay variant=\"error\" title=\"Load failed\" message={valueFailure.message} />;\n    if (valueQuery.isLoading || !valueQuery.data) return <StatusDisplay variant=\"loading\" title=\"Loading...\" />;\n\n    return (\n        <UIStoreProvider store={store}>\n            <ErrorBoundary>\n                {/* bare: fill the container, no inset/scroll wrapper — the ui\n                    output owns its own layout + scrolling. */}\n                <Box height=\"100%\" overflow={bare ? undefined : 'auto'} p={bare ? undefined : '4'} minH={bare ? 0 : undefined}>\n                    <EastChakraComponent\n                        value={valueQuery.data.decoded as ValueTypeOf<typeof UIComponentType>}\n                        storageKey={outputPath ?? task}\n                    />\n                </Box>\n            </ErrorBoundary>\n        </UIStoreProvider>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<VirtualizedLogViewer>` — a log, its lines virtualized, under a band\n * holding the stdout/stderr tabs, a search that marks its matches and steps\n * through them, and Copy. The view follows the log's end while it is there,\n * and says when new lines arrive while it is not.\n *\n * A host that draws the view's controls in its own header (#1209) passes\n * `toolbar={false}`, so the view draws no band and the log fills it edge to\n * edge; controls the search with `search`; hears the matches with\n * `onMatchesChange`; and steps through them and copies the log through\n * `controlsRef`.\n *\n * @packageDocumentation\n */\n\nimport { useRef, useMemo, useEffect, useState, useCallback, useImperativeHandle, type KeyboardEvent, type ReactNode, type Ref } from 'react';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport { Box, Text, IconButton, Tabs, type UseTabsReturn, Input, Badge, chakra, useSlotRecipe, type SystemStyleObject } from '@chakra-ui/react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCopy, faCheck, faChevronUp, faChevronDown, faArrowDown } from '@fortawesome/free-solid-svg-icons';\nimport type { LogViewerControls } from './preview-controls.js';\n\ninterface Match {\n    /** Its place among the log's matches. */\n    index: number;\n    lineIndex: number;\n    start: number;\n    end: number;\n}\n\n/** The search's matches, as a host's \"3/17\" shows them (#1209). */\nexport interface LogMatches {\n    /** The match shown, from 0; 0 while there are none. */\n    current: number;\n    /** How many matches the log has. */\n    count: number;\n}\n\nexport interface VirtualizedLogViewerProps {\n    /** The log's text. */\n    content: string;\n    /** The stdout/stderr tabs the band shows. */\n    tabs: UseTabsReturn;\n    /** `false` draws no band — no tabs, search, match count or chevrons, or\n     *  Copy — and the log fills the view edge to edge, with no inset, corners\n     *  or border, for the host's frame to hold (#1209). Default `true`. */\n    toolbar?: boolean | undefined;\n    /** The search, controlled: the view draws no search box, count or\n     *  chevrons of its own, marks the text's matches in any case, and scrolls\n     *  to the first; `''` clears (#1209). */\n    search?: string | undefined;\n    /** Told the text of the view's own search box as it is edited, unless\n     *  `search` is given. */\n    onSearchChange?: ((search: string) => void) | undefined;\n    /** Told the match shown and how many there are whenever either changes\n     *  (#1209). */\n    onMatchesChange?: ((matches: LogMatches) => void) | undefined;\n    /** Given the view's next and previous match and its Copy while it is\n     *  mounted, for a host's own controls (#1209). */\n    controlsRef?: Ref<LogViewerControls> | undefined;\n}\n\ntype SlotStyles = Record<string, SystemStyleObject>;\n\n/** A line, its matches marked, the current one strongest. */\nfunction HighlightedLine({ text, lineMatches, current, styles }: {\n    text: string;\n    lineMatches: Match[];\n    current: number;\n    styles: SlotStyles;\n}): ReactNode {\n    if (lineMatches.length === 0) {\n        return <>{text || ' '}</>;\n    }\n\n    const parts: ReactNode[] = [];\n    let lastEnd = 0;\n\n    lineMatches.forEach((match, idx) => {\n        // Add text before this match\n        if (match.start > lastEnd) {\n            parts.push(<span key={`t${idx}`}>{text.slice(lastEnd, match.start)}</span>);\n        }\n        parts.push(\n            <chakra.span key={`m${idx}`} css={styles['match']} {...(match.index === current && { 'data-current': '' })}>\n                {text.slice(match.start, match.end)}\n            </chakra.span>,\n        );\n        lastEnd = match.end;\n    });\n\n    // Add remaining text\n    if (lastEnd < text.length) {\n        parts.push(<span key=\"end\">{text.slice(lastEnd)}</span>);\n    }\n\n    return <>{parts}</>;\n}\n\nexport function VirtualizedLogViewer({\n    content,\n    tabs,\n    toolbar = true,\n    search,\n    onSearchChange,\n    onMatchesChange,\n    controlsRef,\n}: VirtualizedLogViewerProps) {\n    const styles = useSlotRecipe({ key: 'logViewer' })() as SlotStyles;\n    const parentRef = useRef<HTMLDivElement>(null);\n    const [copied, setCopied] = useState(false);\n    // The search: the host's when it controls it, else the view's own box's.\n    const [ownSearch, setOwnSearch] = useState('');\n    const searchQuery = search ?? ownSearch;\n    const [currentMatchIndex, setCurrentMatchIndex] = useState(0);\n    const [isAtBottom, setIsAtBottom] = useState(true);\n    const [hasNewLogs, setHasNewLogs] = useState(false);\n\n    // Split content into lines\n    const lines = useMemo(() => {\n        if (!content) return [''];\n        return content.split('\\n');\n    }, [content]);\n\n    // Every match of the search, in any case and none overlapping another,\n    // and each line's, for O(1) lookup\n    const { matches, matchesByLine } = useMemo(() => {\n        const matches: Match[] = [];\n        const matchesByLine = new Map<number, Match[]>();\n\n        if (!searchQuery) {\n            return { matches, matchesByLine };\n        }\n\n        const query = searchQuery.toLowerCase();\n\n        lines.forEach((line, lineIndex) => {\n            const lineLower = line.toLowerCase();\n            const lineMatches: Match[] = [];\n            for (let found = lineLower.indexOf(query); found !== -1; found = lineLower.indexOf(query, found + query.length)) {\n                const match: Match = { index: matches.length, lineIndex, start: found, end: found + query.length };\n                matches.push(match);\n                lineMatches.push(match);\n            }\n            if (lineMatches.length > 0) {\n                matchesByLine.set(lineIndex, lineMatches);\n            }\n        });\n\n        return { matches, matchesByLine };\n    }, [lines, searchQuery]);\n\n    // Reset current match when search changes\n    useEffect(() => {\n        setCurrentMatchIndex(0);\n    }, [searchQuery]);\n\n    // The match shown stays within the log's matches: another stream's log,\n    // or a new run's, with fewer never shows one past its count (#1209).\n    const current = matches.length === 0 ? 0 : Math.min(currentMatchIndex, matches.length - 1);\n\n    const virtualizer = useVirtualizer({\n        count: lines.length,\n        getScrollElement: () => parentRef.current,\n        estimateSize: () => 20,\n        overscan: 20,\n    });\n\n    // Scroll to current match\n    const scrollToMatch = useCallback((index: number) => {\n        const match = matches[index];\n        if (match) {\n            virtualizer.scrollToIndex(match.lineIndex, { align: 'center' });\n        }\n    }, [matches, virtualizer]);\n\n    // Scroll to first match when search changes\n    useEffect(() => {\n        if (matches.length > 0) {\n            scrollToMatch(0);\n        }\n    }, [matches, scrollToMatch]);\n\n    const handlePrevMatch = useCallback(() => {\n        const count = matches.length;\n        if (count === 0) return;\n        setCurrentMatchIndex(prev => {\n            const newIndex = (Math.min(prev, count - 1) + count - 1) % count;\n            scrollToMatch(newIndex);\n            return newIndex;\n        });\n    }, [matches.length, scrollToMatch]);\n\n    const handleNextMatch = useCallback(() => {\n        const count = matches.length;\n        if (count === 0) return;\n        setCurrentMatchIndex(prev => {\n            const newIndex = (Math.min(prev, count - 1) + 1) % count;\n            scrollToMatch(newIndex);\n            return newIndex;\n        });\n    }, [matches.length, scrollToMatch]);\n\n    // The view's own search box, which tells the host of each edit\n    const editSearch = useCallback((text: string) => {\n        setOwnSearch(text);\n        onSearchChange?.(text);\n    }, [onSearchChange]);\n\n    // Handle keyboard shortcuts\n    const handleSearchKeyDown = useCallback((e: KeyboardEvent) => {\n        if (e.key === 'Enter') {\n            if (e.shiftKey) {\n                handlePrevMatch();\n            } else {\n                handleNextMatch();\n            }\n            e.preventDefault();\n        } else if (e.key === 'Escape') {\n            editSearch('');\n        }\n    }, [handlePrevMatch, handleNextMatch, editSearch]);\n\n    // Check if scrolled to bottom (within threshold)\n    const checkIsAtBottom = useCallback(() => {\n        const el = parentRef.current;\n        if (!el) return true;\n        const threshold = 50; // pixels from bottom\n        return el.scrollHeight - el.scrollTop - el.clientHeight < threshold;\n    }, []);\n\n    // Handle scroll events to track position\n    const handleScroll = useCallback(() => {\n        const atBottom = checkIsAtBottom();\n        setIsAtBottom(atBottom);\n        if (atBottom) {\n            setHasNewLogs(false);\n        }\n    }, [checkIsAtBottom]);\n\n    // Scroll to bottom and clear notification\n    const scrollToBottom = useCallback(() => {\n        virtualizer.scrollToIndex(lines.length - 1, { align: 'end' });\n        setHasNewLogs(false);\n        setIsAtBottom(true);\n    }, [virtualizer, lines.length]);\n\n    // Auto-scroll to bottom when new logs arrive (only if already at bottom and not searching)\n    const prevLinesLength = useRef(lines.length);\n    useEffect(() => {\n        if (lines.length > prevLinesLength.current) {\n            if (!searchQuery && isAtBottom) {\n                virtualizer.scrollToIndex(lines.length - 1, { align: 'end' });\n            } else if (!searchQuery) {\n                setHasNewLogs(true);\n            }\n        }\n        prevLinesLength.current = lines.length;\n    }, [lines.length, virtualizer, searchQuery, isAtBottom]);\n\n    // Copies the log, answering whether the clipboard took it\n    const copy = useCallback(async (): Promise<boolean> => {\n        try {\n            await navigator.clipboard.writeText(content);\n            return true;\n        } catch {\n            return false;\n        }\n    }, [content]);\n\n    const handleCopy = useCallback(async () => {\n        if (!await copy()) return;\n        setCopied(true);\n        setTimeout(() => setCopied(false), 2000);\n    }, [copy]);\n\n    // A host's own controls do what the band's do (#1209).\n    useImperativeHandle(controlsRef, () => ({\n        nextMatch: handleNextMatch,\n        previousMatch: handlePrevMatch,\n        copy,\n    }), [handleNextMatch, handlePrevMatch, copy]);\n\n    // The host hears the matches as they change, and only then, whatever\n    // function it passes on each render.\n    const hearMatches = useRef(onMatchesChange);\n    useEffect(() => {\n        hearMatches.current = onMatchesChange;\n    }, [onMatchesChange]);\n    useEffect(() => {\n        hearMatches.current?.({ current, count: matches.length });\n    }, [current, matches.length]);\n\n    // A view whose host draws its controls draws no band, and its log fills it.\n    const bare = !toolbar;\n\n    return (\n        <Box css={styles['root']} {...(bare && { 'data-bare': '' })}>\n            {toolbar && (\n                <Box css={styles['band']}>\n                    <Tabs.RootProvider value={tabs} size=\"sm\" variant=\"line\">\n                        <Tabs.List css={styles['tabList']}>\n                            <Tabs.Trigger value=\"stdout\" css={styles['trigger']}>\n                                stdout\n                            </Tabs.Trigger>\n                            <Tabs.Trigger value=\"stderr\" css={styles['trigger']}>\n                                stderr\n                            </Tabs.Trigger>\n                        </Tabs.List>\n                    </Tabs.RootProvider>\n\n                    {/* Search controls, unless the host controls the search */}\n                    <Box css={styles['search']}>\n                        {search === undefined && (\n                            <>\n                                <Input\n                                    size=\"xs\"\n                                    placeholder=\"Search...\"\n                                    value={ownSearch}\n                                    onChange={(e) => editSearch(e.target.value)}\n                                    onKeyDown={handleSearchKeyDown}\n                                    css={styles['searchInput']}\n                                />\n                                {ownSearch && (\n                                    <Text css={styles['count']}>\n                                        {matches.length > 0 ? `${current + 1}/${matches.length}` : '0/0'}\n                                    </Text>\n                                )}\n                                <IconButton\n                                    variant=\"ghost\"\n                                    size=\"xs\"\n                                    onClick={handlePrevMatch}\n                                    css={styles['bandButton']}\n                                    aria-label=\"Previous match\"\n                                    disabled={matches.length === 0}\n                                >\n                                    <FontAwesomeIcon icon={faChevronUp} />\n                                </IconButton>\n                                <IconButton\n                                    variant=\"ghost\"\n                                    size=\"xs\"\n                                    onClick={handleNextMatch}\n                                    css={styles['bandButton']}\n                                    aria-label=\"Next match\"\n                                    disabled={matches.length === 0}\n                                >\n                                    <FontAwesomeIcon icon={faChevronDown} />\n                                </IconButton>\n                            </>\n                        )}\n                        <IconButton\n                            variant=\"ghost\"\n                            size=\"xs\"\n                            onClick={handleCopy}\n                            css={styles['bandButton']}\n                            aria-label=\"Copy logs\"\n                        >\n                            <FontAwesomeIcon icon={copied ? faCheck : faCopy} />\n                        </IconButton>\n                    </Box>\n                </Box>\n            )}\n\n            {/* Virtualized content */}\n            <Box css={styles['body']}>\n                <Box\n                    ref={parentRef}\n                    css={styles['surface']}\n                    {...(bare && { 'data-bare': '' })}\n                    onScroll={handleScroll}\n                >\n                <div\n                    style={{\n                        height: `${virtualizer.getTotalSize()}px`,\n                        width: '100%',\n                        position: 'relative',\n                    }}\n                >\n                    {virtualizer.getVirtualItems().map((virtualItem) => {\n                        const lineIndex = virtualItem.index;\n                        const lineText = lines[lineIndex] ?? '';\n                        const lineMatches = matchesByLine.get(lineIndex) || [];\n\n                        return (\n                            <div\n                                key={virtualItem.key}\n                                style={{\n                                    position: 'absolute',\n                                    top: 0,\n                                    left: 0,\n                                    width: '100%',\n                                    height: `${virtualItem.size}px`,\n                                    transform: `translateY(${virtualItem.start}px)`,\n                                }}\n                            >\n                                <Box css={styles['line']}>\n                                    <chakra.span css={styles['gutter']}>\n                                        {lineIndex + 1}\n                                    </chakra.span>\n                                    <chakra.span css={styles['text']}>\n                                        <HighlightedLine\n                                            text={lineText}\n                                            lineMatches={lineMatches}\n                                            current={current}\n                                            styles={styles}\n                                        />\n                                    </chakra.span>\n                                </Box>\n                            </div>\n                        );\n                    })}\n                </div>\n                </Box>\n\n                {/* New logs notification */}\n                {hasNewLogs && (\n                    <Box css={styles['newLogs']} onClick={scrollToBottom}>\n                        <Badge variant=\"brand\" css={styles['newLogsBadge']}>\n                            <FontAwesomeIcon icon={faArrowDown} />\n                            New logs\n                        </Badge>\n                    </Box>\n                )}\n            </Box>\n        </Box>\n    );\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { useRef } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { StringType, equalFor } from '@elaraai/east';\nimport type { QueryOverrides } from './types.js';\nimport { pollRequestOptions, taskLogs } from '@elaraai/e3-api-client';\nimport type { LogOptions, RequestOptions, TaskLogChunk } from '@elaraai/e3-api-client';\n\n// Beast2 decoder has stack overflow with large strings, so fetch in chunks\nconst CHUNK_SIZE = 64 * 1024; // 64KB per chunk\nconst MAX_TOTAL_SIZE = 10 * 1024 * 1024; // 10MB max total\n\n/** How often a task's log is polled while it changes: every second. */\nexport const LOG_POLL_MS = 1000;\n\n/** The longest a task's log waits between polls: 5 s, which it backs off to\n *  while nothing changes. */\nexport const LOG_POLL_BACKOFF_MS = 5000;\n\n/** How often a task's log is polled once its execution has ended and the log\n *  is read: every half minute, for another execution of the task. */\nexport const LOG_POLL_ENDED_MS = 30_000;\n\n/** How a task's log is polled: how often while it changes, and the longest\n *  it waits while nothing does. */\nexport interface LogPollOptions {\n    /** How often the log is polled while it changes, in milliseconds\n     *  (default {@link LOG_POLL_MS}) */\n    pollMs?: number;\n    /** The longest the log waits between polls while nothing changes, in\n     *  milliseconds (default {@link LOG_POLL_BACKOFF_MS}) */\n    backoffMs?: number;\n    /** How often the log is polled once its execution has ended and the log\n     *  is read, in milliseconds (default {@link LOG_POLL_ENDED_MS}) */\n    endedMs?: number;\n}\n\n/**\n * A task's log as far as it has been read: one execution's, from its first\n * byte, at most 10 MB of it.\n */\nexport interface TaskLogRead {\n    /** The log's text, as far as it has been read */\n    data: string;\n    /** The inputs hash of the execution it is the log of */\n    inputsHash: string;\n    /** The id of the execution it is the log of */\n    executionId: string;\n    /** The byte the next read starts at */\n    offset: number;\n    /** The log's size when it was last read */\n    totalSize: number;\n    /** Whether the last read reached the log's end */\n    complete: boolean;\n    /** Whether the execution has ended: its log grows no more */\n    ended: boolean;\n}\n\nconst sameString = equalFor(StringType);\n\n/**\n * Reads a task's log on from where the last read stopped: only what is new,\n * a 64 KB chunk at a time, up to 10 MB in all. Each poll's first read names no\n * execution, so it finds the task's current one: when that is another\n * execution than the one read so far, the log starts over from its first\n * byte, every read after naming it. Past 10 MB, a poll reads no bytes, and\n * only finds whether the execution has changed or ended.\n *\n * @param read - Reads a chunk of the task's log (the client's `taskLogs`,\n *   bound to the task)\n * @param stream - The stream\n * @param held - The log as far as the last poll read it; none for the first\n * @returns The log as far as it is read now, and whether the poll found\n *   anything new: bytes, another execution, or the execution's end\n */\nexport async function readTaskLogOn(\n    read: (options: LogOptions) => Promise<TaskLogChunk>,\n    stream: 'stdout' | 'stderr',\n    held: TaskLogRead | undefined,\n): Promise<{ log: TaskLogRead; changed: boolean }> {\n    const capped = held !== undefined && held.data.length >= MAX_TOTAL_SIZE;\n    let chunk = await read({ stream, offset: held?.offset ?? 0, limit: capped ? 0 : CHUNK_SIZE });\n    let log: TaskLogRead;\n    if (held !== undefined && sameString(held.inputsHash, chunk.inputsHash) && sameString(held.executionId, chunk.executionId)) {\n        log = held;\n    } else {\n        // The first poll, or another execution's log: from its first byte\n        const execution = { inputsHash: chunk.inputsHash, executionId: chunk.executionId };\n        if (Number(chunk.offset) !== 0) chunk = await read({ stream, offset: 0, limit: CHUNK_SIZE, execution });\n        log = { data: '', ...execution, offset: 0, totalSize: 0, complete: false, ended: false };\n    }\n    const before = log;\n    for (;;) {\n        // Advance by what was actually returned, not what was asked for: a\n        // chunk stops short of the requested size rather than split a\n        // multi-byte character across the boundary.\n        const size = Number(chunk.size);\n        log = {\n            ...log,\n            data: log.data + chunk.data,\n            offset: log.offset + size,\n            totalSize: Number(chunk.totalSize),\n            complete: chunk.complete,\n            ended: chunk.ended,\n        };\n        if (chunk.complete || size === 0 || log.data.length >= MAX_TOTAL_SIZE) break;\n        chunk = await read({ stream, offset: log.offset, limit: CHUNK_SIZE, execution: { inputsHash: log.inputsHash, executionId: log.executionId } });\n    }\n    const changed = before !== held || log.offset !== before.offset || log.ended !== before.ended;\n    return { log, changed };\n}\n\n/**\n * How long a task's log waits before its next poll: `pollMs` after a poll\n * that found something new, doubling toward `backoffMs` after each that found\n * nothing, and `endedMs` once the execution has ended and its log is read —\n * the log grows no more, and a poll looks only for another execution of the\n * task, as a read made for another reason does, a view shown again. A poll\n * that finds one starts the polls again.\n *\n * @param previous - How long the last poll waited\n * @param log - The log as the poll left it\n * @param changed - Whether the poll found anything new\n * @param pollMs - How often the log is polled while it changes\n * @param backoffMs - The longest it waits while nothing changes\n * @param endedMs - How often it is polled once the execution has ended and\n *   the log is read\n * @returns How long the next waits, in milliseconds\n */\nexport function nextLogPollMs(\n    previous: number,\n    log: TaskLogRead,\n    changed: boolean,\n    pollMs: number = LOG_POLL_MS,\n    backoffMs: number = LOG_POLL_BACKOFF_MS,\n    endedMs: number = LOG_POLL_ENDED_MS,\n): number {\n    if (log.ended && log.complete) return endedMs;\n    if (changed) return pollMs;\n    return Math.min(previous * 2, backoffMs);\n}\n\n/** What the hook answers: the log's text as far as it is read. */\nexport interface TaskLogsData {\n    data: string;\n    offset: bigint;\n    size: bigint;\n    totalSize: bigint;\n    complete: boolean;\n}\n\nconst NO_LOG: TaskLogsData = { data: '', offset: 0n, size: 0n, totalSize: 0n, complete: true };\n\n/** A log as far as the hook has read it, and how long its next poll waits. */\ninterface HeldLog {\n    log: TaskLogRead | undefined;\n    pollMs: number;\n}\n\n/** How many logs the hook keeps as far as they were read, for the views that\n *  come back to them: the other stream, another task. */\nconst LOGS_HELD = 8;\n\n/** Keeps a log as far as it is read under its key, the latest kept last, and\n *  forgets the oldest past {@link LOGS_HELD}. */\nfunction keep(held: Map<string, HeldLog>, key: string, log: HeldLog): void {\n    held.delete(key);\n    held.set(key, log);\n    while (held.size > LOGS_HELD) held.delete(held.keys().next().value!);\n}\n\n/**\n * Polls a task's log: only what is new each time, starting over when the\n * task's current execution changes, backing off while nothing does, and every\n * half minute once the execution has ended and its log is read, for another\n * execution ({@link readTaskLogOn}, {@link nextLogPollMs}). Each poll makes\n * one request attempt: its next poll is its retry. A log the view left — the\n * other stream, another task — is kept as far as it was read, so a view that\n * comes back to it reads on from there, as react-query shows what it read.\n *\n * @param apiUrl - Base URL of the e3 API server\n * @param repo - Repository name\n * @param workspace - Workspace name; nothing is read while `null`\n * @param taskName - The task; nothing is read while `null`\n * @param stream - The stream\n * @param requestOptions - The requests' token and fetch\n * @param queryOptions - react-query overrides\n * @param poll - How often the log is polled while it changes, the longest it\n *   waits while nothing does, and how often it is polled once its execution\n *   has ended\n * @returns The query of the log's text as far as it is read\n */\nexport function useTaskLogs(\n    apiUrl: string,\n    repo: string,\n    workspace: string | null,\n    taskName: string | null,\n    stream: 'stdout' | 'stderr' = 'stdout',\n    requestOptions?: RequestOptions,\n    queryOptions?: QueryOverrides,\n    poll: LogPollOptions = {},\n) {\n    const pollMs = poll.pollMs ?? LOG_POLL_MS;\n    const backoffMs = poll.backoffMs ?? LOG_POLL_BACKOFF_MS;\n    const endedMs = poll.endedMs ?? LOG_POLL_ENDED_MS;\n    // Each log as far as it is read, and how long its next poll waits, by the\n    // log's key: the query's own, kept across its polls, and kept for a log\n    // the view left, so a view that comes back to it reads on from there\n    const key = JSON.stringify([apiUrl, repo, workspace, taskName, stream]);\n    const held = useRef(new Map<string, HeldLog>());\n\n    return useQuery({\n        queryKey: ['taskLogs', apiUrl, repo, workspace, taskName, stream],\n        queryFn: async (): Promise<TaskLogsData> => {\n            const at = held.current.get(key) ?? { log: undefined, pollMs };\n            try {\n                const { log, changed } = await readTaskLogOn(\n                    (options) => taskLogs(apiUrl, repo, workspace!, taskName!, options, pollRequestOptions(requestOptions ?? { token: null })),\n                    stream,\n                    at.log,\n                );\n                at.log = log;\n                at.pollMs = nextLogPollMs(at.pollMs, log, changed, pollMs, backoffMs, endedMs);\n                keep(held.current, key, at);\n                return { data: log.data, offset: 0n, size: BigInt(log.data.length), totalSize: BigInt(log.totalSize), complete: true };\n            } catch {\n                // No execution yet, or a failed read: what was read stays, and\n                // the poll backs off — never sooner than the poll before it\n                // waited, so an ended log's failed poll keeps its half minute\n                at.pollMs = Math.max(at.pollMs, Math.min(at.pollMs * 2, backoffMs));\n                keep(held.current, key, at);\n                return at.log === undefined\n                    ? NO_LOG\n                    : { data: at.log.data, offset: 0n, size: BigInt(at.log.data.length), totalSize: BigInt(at.log.totalSize), complete: true };\n            }\n        },\n        enabled: !!workspace && !!taskName,\n        refetchInterval: () => held.current.get(key)?.pollMs ?? pollMs,\n        ...queryOptions,\n    });\n}\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { memo, useMemo, type Ref } from 'react';\nimport { useTabs } from '@chakra-ui/react';\nimport { VirtualizedLogViewer, type LogMatches } from './VirtualizedLogViewer.js';\nimport type { LogViewerControls } from './preview-controls.js';\nimport { useTaskLogs as useTaskLogsHook } from '../hooks/useTaskLogsHook.js';\nimport type { RequestOptions } from '@elaraai/e3-api-client';\n\nexport interface TaskLogsProps {\n    apiUrl: string;\n    repo: string;\n    workspace: string;\n    task: string;\n    requestOptions?: RequestOptions;\n    /** The stream, controlled: the tabs show it, and a click tells\n     *  `onStreamChange` rather than switching (#1209). The view's own,\n     *  from `'stdout'`, when not given. */\n    stream?: 'stdout' | 'stderr' | undefined;\n    /** Told the stream the tabs pick. */\n    onStreamChange?: ((stream: 'stdout' | 'stderr') => void) | undefined;\n    /** `false` draws no band, and the log fills the view: see {@link VirtualizedLogViewer}. */\n    toolbar?: boolean | undefined;\n    /** The log's search, controlled: see {@link VirtualizedLogViewer}. */\n    search?: string | undefined;\n    /** Told the text of the view's own search box. */\n    onSearchChange?: ((search: string) => void) | undefined;\n    /** Told the match shown and how many there are. */\n    onMatchesChange?: ((matches: LogMatches) => void) | undefined;\n    /** Given the view's next and previous match and its Copy. */\n    controlsRef?: Ref<LogViewerControls> | undefined;\n    /** How often the log shown is polled while it changes, in milliseconds.\n     *  Default 1000. */\n    pollInterval?: number | undefined;\n    /** The longest the log shown waits between polls while nothing changes,\n     *  in milliseconds; once its execution has ended and it is read, it is\n     *  polled every half minute, for another execution. Default 5000. */\n    pollBackoff?: number | undefined;\n}\n\n/**\n * Renders a virtualized log viewer for a task's stdout/stderr: the stream\n * shown is polled, and the other is read when the tabs show it.\n */\nexport const TaskLogs = memo(function TaskLogs({\n    apiUrl,\n    repo,\n    workspace,\n    task,\n    requestOptions,\n    stream,\n    onStreamChange,\n    toolbar,\n    search,\n    onSearchChange,\n    onMatchesChange,\n    controlsRef,\n    pollInterval,\n    pollBackoff,\n}: TaskLogsProps) {\n    // The stream: the host's when it controls it, else the tabs' own.\n    const tabs = useTabs({\n        defaultValue: 'stdout',\n        ...(stream !== undefined && { value: stream }),\n        onValueChange: (details) => onStreamChange?.(details.value === 'stderr' ? 'stderr' : 'stdout'),\n    });\n    const shown: 'stdout' | 'stderr' = tabs.value === 'stderr' ? 'stderr' : 'stdout';\n\n    // The stream shown alone is polled: the other's query, kept by react-query\n    // under its own key, is read on from where it stopped when the tabs show\n    // it again.\n    const { data: log } = useTaskLogsHook(apiUrl, repo, workspace, task, shown, requestOptions, undefined, {\n        ...(pollInterval !== undefined && { pollMs: pollInterval }),\n        ...(pollBackoff !== undefined && { backoffMs: pollBackoff }),\n    });\n    const activeLogContent = useMemo(() => log?.data ?? '', [log?.data]);\n\n    return (\n        <VirtualizedLogViewer\n            content={activeLogContent}\n            tabs={tabs}\n            toolbar={toolbar}\n            search={search}\n            onSearchChange={onSearchChange}\n            onMatchesChange={onMatchesChange}\n            controlsRef={controlsRef}\n        />\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<DataTaskPreview>` — preview a non-UI e3 task.\n *\n * Tabs:\n *   - **Output**: size-aware preview of the task's output dataset (delegates\n *     to `<DatasetPreview>`). Inline if small, \"Download\" button if oversized.\n *   - **Logs**: streamed task execution logs.\n *\n * A host that draws the preview's controls in its own header (#1120) controls\n * the tab with `view` and `onViewChange`, passes `toolbar={false}` so the\n * preview draws no band, and controls the output's key search with `search`.\n * The bands `toolbar={false}` hides are all of the preview's — the value\n * tree's Collapse all and Expand all, and the log's tabs, search and Copy\n * too — so the host also controls the log's stream and search, hears its\n * matches, and does the rest through the `controls` it makes with\n * `usePreviewControls` (#1209).\n *\n * @packageDocumentation\n */\n\nimport { memo, useState } from 'react';\nimport { Box, Flex, SegmentGroup } from '@chakra-ui/react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCode, faTerminal } from '@fortawesome/free-solid-svg-icons';\nimport type { RequestOptions, TaskDetails } from '@elaraai/e3-api-client';\nimport type { TreePath } from '@elaraai/e3-types';\nimport { useTaskDetails } from '../hooks/useTaskDetails.js';\nimport { DatasetPreview, type DatasetPreviewProps } from './DatasetPreview.js';\nimport { TaskLogs } from './TaskLogs.js';\nimport { StatusDisplay } from './StatusDisplay.js';\nimport { logControlsOf, type PreviewControls } from './preview-controls.js';\nimport type { LogMatches } from './VirtualizedLogViewer.js';\n\ntype ViewMode = 'output' | 'logs';\n/** The tabs, in the switch's order. */\nconst VIEWS = [{ value: 'output', label: 'Output', icon: faCode }, { value: 'logs', label: 'Logs', icon: faTerminal }] as const;\n\nexport interface DataTaskPreviewProps {\n    apiUrl: string;\n    repo: string;\n    workspace: string;\n    task: string;\n    requestOptions?: RequestOptions;\n    /** Initially selected tab, when `view` is not given. Default 'output'. */\n    initialView?: ViewMode;\n    /** The tab, controlled (#1120): the preview shows it, and tells\n     *  `onViewChange` of a switch rather than making it. */\n    view?: ViewMode;\n    /** Told the tab the preview's switch picks. */\n    onViewChange?: (view: ViewMode) => void;\n    /** The tabs this preview offers; omitted or empty, both. One left, no switch shows, and a tab left out is never drawn. */\n    views?: readonly ViewMode[];\n    /** Max output bytes to render inline (above → download button). Default 200KB. */\n    sizeLimit?: number;\n    /** `false` draws no band — no Output/Logs switch; no key search, size or\n     *  Download above the output (#1120), nor its tree's Collapse all and\n     *  Expand all; and no tabs, search or Copy above the log, which fills the\n     *  view (#1209). Default `true`. */\n    toolbar?: boolean;\n    /** The output's key search, controlled: see {@link DatasetPreviewProps.search}. */\n    search?: string;\n    /** Told the text of the output's own search box: see {@link DatasetPreviewProps.onSearchChange}. */\n    onSearchChange?: (search: string) => void;\n    /** The log's stream, controlled (#1209): the log's tabs show it, and tell\n     *  `onLogStreamChange` of a click rather than switching. */\n    logStream?: 'stdout' | 'stderr';\n    /** Told the stream the log's tabs pick. */\n    onLogStreamChange?: (stream: 'stdout' | 'stderr') => void;\n    /** The log's search, controlled (#1209): the log draws no search box,\n     *  count or chevrons of its own, marks the text's matches in any case and\n     *  scrolls to the first; `''` clears. */\n    logSearch?: string;\n    /** Told the text of the log's own search box as it is edited, unless\n     *  `logSearch` is given. */\n    onLogSearchChange?: (search: string) => void;\n    /** Told the log's match shown (from 0) and how many there are whenever\n     *  either changes, for the host's \"3/17\" (#1209). */\n    onLogMatchesChange?: (matches: LogMatches) => void;\n    /** The handle a host's own controls act through, made with\n     *  `usePreviewControls` (#1209). */\n    controls?: PreviewControls;\n    /** The task's details, when the host holds them: the preview reads them\n     *  from the host rather than the server. */\n    details?: TaskDetails;\n    /** How often the output's status is polled, in milliseconds: see\n     *  {@link DatasetPreviewProps.pollInterval}. Default 30 000. */\n    statusPollInterval?: number;\n    /** How often the log is polled while it changes, in milliseconds:\n     *  see `TaskLogsProps.pollInterval`. Default 1000. */\n    logPollInterval?: number;\n    /** The longest the log waits between polls while nothing changes, in\n     *  milliseconds: see `TaskLogsProps.pollBackoff`. Default 5000. */\n    logPollBackoff?: number;\n}\n\nfunction treePathToString(path: TreePath): string {\n    return path.map(p => p.value).join('.');\n}\n\nexport const DataTaskPreview = memo(function DataTaskPreview({\n    apiUrl,\n    repo,\n    workspace,\n    task,\n    requestOptions,\n    initialView = 'output',\n    view,\n    onViewChange,\n    views,\n    sizeLimit,\n    toolbar = true,\n    search,\n    onSearchChange,\n    logStream,\n    onLogStreamChange,\n    logSearch,\n    onLogSearchChange,\n    onLogMatchesChange,\n    controls,\n    details,\n    statusPollInterval,\n    logPollInterval,\n    logPollBackoff,\n}: DataTaskPreviewProps) {\n    // The tab: the host's when it controls it, else the preview's own.\n    const [ownView, setOwnView] = useState<ViewMode>(initialView);\n    const offered = VIEWS.filter(({ value }) => views === undefined || views.length === 0 || views.includes(value));\n    const asked = view ?? ownView;\n    const viewMode: ViewMode = offered.some(({ value }) => value === asked) ? asked : offered[0]!.value;\n    const pick = (next: ViewMode): void => {\n        if (view === undefined) setOwnView(next);\n        onViewChange?.(next);\n    };\n    const detailsQuery = useTaskDetails(apiUrl, repo, workspace, task, {\n        ...(requestOptions != null && { requestOptions }),\n        ...(details !== undefined && { details }),\n    });\n    const outputPath = detailsQuery.data ? treePathToString(detailsQuery.data.output.path) : null;\n    const outputControls: Pick<DatasetPreviewProps, 'toolbar' | 'search' | 'onSearchChange' | 'controls'> = {\n        toolbar,\n        ...(search !== undefined && { search }),\n        ...(onSearchChange !== undefined && { onSearchChange }),\n        ...(controls !== undefined && { controls }),\n    };\n\n    return (\n        <Box height=\"100%\" display=\"flex\" flexDirection=\"column\" overflow=\"hidden\">\n            {toolbar && offered.length > 1 && (\n                <Flex\n                    px={4} py={2}\n                    borderBottom=\"1px solid\" borderColor=\"border.subtle\" bg=\"bg.surface\"\n                    align=\"center\" justify=\"flex-end\" flexShrink={0}\n                >\n                    <SegmentGroup.Root\n                        size=\"xs\"\n                        value={viewMode}\n                        onValueChange={(d) => pick(d.value as ViewMode)}\n                    >\n                        <SegmentGroup.Indicator />\n                        {offered.map(({ value, label, icon }) => (\n                            <SegmentGroup.Item key={value} value={value} title={label}>\n                                <SegmentGroup.ItemText>\n                                    <FontAwesomeIcon icon={icon} />\n                                </SegmentGroup.ItemText>\n                                <SegmentGroup.ItemHiddenInput />\n                            </SegmentGroup.Item>\n                        ))}\n                    </SegmentGroup.Root>\n                </Flex>\n            )}\n            <Box flex={1} overflow=\"hidden\" minHeight={0}>\n                {viewMode === 'output' ? (\n                    detailsQuery.isLoading\n                        ? <StatusDisplay variant=\"loading\" title=\"Loading task...\" />\n                        : detailsQuery.error\n                            ? <StatusDisplay variant=\"error\" title=\"Error\" message={detailsQuery.error.message} />\n                            : <DatasetPreview\n                                apiUrl={apiUrl}\n                                repo={repo}\n                                workspace={workspace}\n                                path={outputPath}\n                                {...(requestOptions != null && { requestOptions })}\n                                {...(sizeLimit !== undefined && { sizeLimit })}\n                                {...(statusPollInterval !== undefined && { pollInterval: statusPollInterval })}\n                                {...outputControls}\n                            />\n                ) : (\n                    <TaskLogs\n                        apiUrl={apiUrl}\n                        repo={repo}\n                        workspace={workspace}\n                        task={task}\n                        {...(requestOptions != null && { requestOptions })}\n                        toolbar={toolbar}\n                        stream={logStream}\n                        onStreamChange={onLogStreamChange}\n                        search={logSearch}\n                        onSearchChange={onLogSearchChange}\n                        onMatchesChange={onLogMatchesChange}\n                        controlsRef={logControlsOf(controls)}\n                        pollInterval={logPollInterval}\n                        pollBackoff={logPollBackoff}\n                    />\n                )}\n            </Box>\n        </Box>\n    );\n});\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\n/**\n * `<TaskPreview>` — router for previewing an e3 task.\n *\n * Branches by the task's `role`:\n *   - `ui`   → `<UITaskPreview>`\n *   - `data` → `<DataTaskPreview>` (output preview tabs + logs)\n *\n * A host that draws a data task's controls in its own header (#1120) passes\n * `toolbar={false}` and controls the tab (`view`, `onViewChange`) and the\n * output's key search (`search`, `onSearchChange`); the log's stream\n * (`logStream`, `onLogStreamChange`) and search (`logSearch`,\n * `onLogSearchChange`), and hears its matches (`onLogMatchesChange`); and\n * collapses and expands the value's tree, steps through the log's matches and\n * copies the log through the `controls` it makes with `usePreviewControls`\n * (#1209). They reach the data task's preview; a ui task's preview, which\n * draws no band, ignores them.\n *\n * @packageDocumentation\n */\n\nimport { memo } from 'react';\nimport { Box, Flex, Text } from '@chakra-ui/react';\nimport type { RequestOptions, TaskDetails } from '@elaraai/e3-api-client';\nimport { UITaskPreview } from './UITaskPreview.js';\nimport { DataTaskPreview, type DataTaskPreviewProps } from './DataTaskPreview.js';\nimport { useTaskDetails } from '../hooks/useTaskDetails.js';\nimport { StatusDisplay } from './StatusDisplay.js';\n\nexport interface TaskPreviewProps {\n    apiUrl: string;\n    repo: string;\n    workspace: string;\n    task: string;\n    requestOptions?: RequestOptions;\n    /**\n     * Chromeless mode: drop the task-name header bar and, for a `ui` task,\n     * render the output edge-to-edge (forwarded to {@link UITaskPreview} as\n     * `bare`) — for a host that shows a deployed UI task as a page of its\n     * own. Default `false`.\n     */\n    bare?: boolean;\n    /** A data task's tab, controlled: see {@link DataTaskPreviewProps.view}. */\n    view?: DataTaskPreviewProps['view'];\n    /** Told the tab a data task's switch picks. */\n    onViewChange?: DataTaskPreviewProps['onViewChange'];\n    /** `false` draws no band anywhere in a data task's preview (#1120,\n     *  #1209): see {@link DataTaskPreviewProps.toolbar}. Default `true`. */\n    toolbar?: boolean;\n    /** A data task's output's key search, controlled: see {@link DataTaskPreviewProps.search}. */\n    search?: string;\n    /** Told the text of the output's own search box: see {@link DataTaskPreviewProps.onSearchChange}. */\n    onSearchChange?: (search: string) => void;\n    /** A data task's log's stream, controlled: see {@link DataTaskPreviewProps.logStream}. */\n    logStream?: DataTaskPreviewProps['logStream'];\n    /** Told the stream the log's tabs pick. */\n    onLogStreamChange?: DataTaskPreviewProps['onLogStreamChange'];\n    /** A data task's log's search, controlled: see {@link DataTaskPreviewProps.logSearch}. */\n    logSearch?: string;\n    /** Told the text of the log's own search box: see {@link DataTaskPreviewProps.onLogSearchChange}. */\n    onLogSearchChange?: (search: string) => void;\n    /** Told the log's matches: see {@link DataTaskPreviewProps.onLogMatchesChange}. */\n    onLogMatchesChange?: DataTaskPreviewProps['onLogMatchesChange'];\n    /** The handle a host's own controls act through: see {@link DataTaskPreviewProps.controls}. */\n    controls?: DataTaskPreviewProps['controls'];\n    /** The task's details, when the host holds them — from the task list it\n     *  read, say: the preview reads them from the host rather than the\n     *  server. Without them, the preview's read is keyed as `useTaskGet`'s,\n     *  so a host that read the task through it shares the read all the same. */\n    details?: TaskDetails;\n    /** How often the task's output status is polled, in milliseconds: a data\n     *  task's output preview's, and a ui task's output's. Default 30 000. */\n    statusPollInterval?: number;\n    /** How often a data task's log is polled while it changes, in\n     *  milliseconds: see {@link DataTaskPreviewProps.logPollInterval}. */\n    logPollInterval?: number;\n    /** The longest a data task's log waits between polls while nothing\n     *  changes: see {@link DataTaskPreviewProps.logPollBackoff}. */\n    logPollBackoff?: number;\n}\n\nexport const TaskPreview = memo(function TaskPreview({\n    apiUrl,\n    repo,\n    workspace,\n    task,\n    requestOptions,\n    bare = false,\n    view,\n    onViewChange,\n    toolbar,\n    search,\n    onSearchChange,\n    logStream,\n    onLogStreamChange,\n    logSearch,\n    onLogSearchChange,\n    onLogMatchesChange,\n    controls,\n    details: givenDetails,\n    statusPollInterval,\n    logPollInterval,\n    logPollBackoff,\n}: TaskPreviewProps) {\n    const detailsQuery = useTaskDetails(apiUrl, repo, workspace, task, {\n        ...(requestOptions != null && { requestOptions }),\n        ...(givenDetails !== undefined && { details: givenDetails }),\n    });\n    const details = detailsQuery.data;\n    const isUI = details?.role.type === 'ui';\n\n    return (\n        <Box height=\"100%\" display=\"flex\" flexDirection=\"column\" overflow=\"hidden\">\n            {/* The task-name header is preview chrome; a bare preview drops it\n                so the task's UI owns the whole surface. */}\n            {!bare && (\n                <Flex px={4} py={2} borderBottom=\"1px solid\" borderColor=\"border.subtle\" bg=\"bg.surface\" align=\"center\" flexShrink={0}>\n                    <Text fontSize=\"body.lg\" fontWeight=\"medium\" color=\"fg\">{task}</Text>\n                </Flex>\n            )}\n            <Box flex={1} overflow=\"hidden\" minHeight={0}>\n                {detailsQuery.isLoading\n                    ? <StatusDisplay variant=\"loading\" title=\"Loading task...\" />\n                    : detailsQuery.error\n                        ? <StatusDisplay variant=\"error\" title=\"Error\" message={detailsQuery.error.message} />\n                        : isUI\n                            ? <UITaskPreview\n                                task={task}\n                                bare={bare}\n                                config={{\n                                    apiUrl, repo, workspace, token: requestOptions?.token ?? null,\n                                    ...(requestOptions?.fetch !== undefined && { fetch: requestOptions.fetch }),\n                                }}\n                                {...(details !== undefined && { details })}\n                                {...(statusPollInterval !== undefined && { outputPollInterval: statusPollInterval })}\n                            />\n                            : <DataTaskPreview\n                                apiUrl={apiUrl}\n                                repo={repo}\n                                workspace={workspace}\n                                task={task}\n                                {...(requestOptions != null && { requestOptions })}\n                                {...(view !== undefined && { view })}\n                                {...(onViewChange !== undefined && { onViewChange })}\n                                {...(toolbar !== undefined && { toolbar })}\n                                {...(search !== undefined && { search })}\n                                {...(onSearchChange !== undefined && { onSearchChange })}\n                                {...(logStream !== undefined && { logStream })}\n                                {...(onLogStreamChange !== undefined && { onLogStreamChange })}\n                                {...(logSearch !== undefined && { logSearch })}\n                                {...(onLogSearchChange !== undefined && { onLogSearchChange })}\n                                {...(onLogMatchesChange !== undefined && { onLogMatchesChange })}\n                                {...(controls !== undefined && { controls })}\n                                {...(details !== undefined && { details })}\n                                {...(statusPollInterval !== undefined && { statusPollInterval })}\n                                {...(logPollInterval !== undefined && { logPollInterval })}\n                                {...(logPollBackoff !== undefined && { logPollBackoff })}\n                            />\n                }\n            </Box>\n        </Box>\n    );\n}, (prev, next) => prev.task === next.task && prev.apiUrl === next.apiUrl && prev.repo === next.repo\n    && prev.workspace === next.workspace && prev.bare === next.bare\n    // A rotated token, or another fetch, re-renders the preview, or its reads\n    // keep the old one.\n    && prev.requestOptions?.token === next.requestOptions?.token\n    && Object.is(prev.requestOptions?.fetch, next.requestOptions?.fetch)\n    // The host's controls (#1120, #1209).\n    && prev.view === next.view && prev.toolbar === next.toolbar && prev.search === next.search\n    && Object.is(prev.onViewChange, next.onViewChange) && Object.is(prev.onSearchChange, next.onSearchChange)\n    && prev.logStream === next.logStream && prev.logSearch === next.logSearch\n    && Object.is(prev.onLogStreamChange, next.onLogStreamChange) && Object.is(prev.onLogSearchChange, next.onLogSearchChange)\n    && Object.is(prev.onLogMatchesChange, next.onLogMatchesChange) && Object.is(prev.controls, next.controls)\n    // The details the host holds, and how often the previews poll.\n    && Object.is(prev.details, next.details) && prev.statusPollInterval === next.statusPollInterval\n    && prev.logPollInterval === next.logPollInterval && prev.logPollBackoff === next.logPollBackoff);\n","/**\n * Copyright (c) 2025 Elara AI Pty Ltd\n * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.\n */\n\nimport { Box, Text, Badge } from '@chakra-ui/react';\nimport { printFor, type EastTypeValue, type variant } from '@elaraai/east';\n\nexport interface EastValueViewerProps {\n    type: EastTypeValue;\n    value: unknown;\n}\n\n// A primitive value as East prints it — every digit of an Integer, a Float's\n// `.0` and `-0.0`, a String quoted and escaped, a DateTime's UTC instant to\n// the millisecond — save a Blob, shown by its size rather than every byte.\nfunction formatPrimitive(type: EastTypeValue, value: unknown): string {\n    if (type.type === 'Blob') return `Blob[${(value as Uint8Array).length} bytes]`;\n    return printFor(type)(value);\n}\n\n// Check if a type is a primitive (renders inline without nesting)\nfunction isPrimitive(type: EastTypeValue): boolean {\n    return ['Null', 'Boolean', 'Integer', 'Float', 'String', 'DateTime', 'Blob'].includes(type.type);\n}\n\n// Get a short type label for display\nfunction getTypeLabel(type: EastTypeValue, value: unknown): string {\n    switch (type.type) {\n        case 'Array':\n            return `Array[${(value as unknown[]).length}]`;\n        case 'Set':\n            return `Set[${(value as Set<unknown>).size}]`;\n        case 'Dict':\n            return `Dict[${(value as Map<unknown, unknown>).size}]`;\n        case 'Struct':\n            return 'Struct';\n        case 'Variant':\n            return `Variant.${(value as variant).type}`;\n        case 'Ref':\n            return 'Ref';\n        default:\n            return type.type;\n    }\n}\n\n// Single value node - handles both primitives and complex types\nfunction ValueNode({\n    type,\n    value,\n    label,\n    depth,\n}: {\n    type: EastTypeValue;\n    value: unknown;\n    label?: string;\n    depth: number;\n}) {\n    // Prevent infinite recursion\n    if (depth > 20) {\n        return (\n            <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                <Text as=\"span\" color=\"fg.muted\">[max depth reached]</Text>\n            </Box>\n        );\n    }\n\n    // Primitives render inline\n    if (isPrimitive(type)) {\n        return (\n            <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                <Text as=\"span\" color={type.type === 'String' ? 'fg.success' : type.type === 'Integer' || type.type === 'Float' ? 'link' : 'fg.muted'}>\n                    {formatPrimitive(type, value)}\n                </Text>\n                <Badge size=\"xs\" colorPalette=\"gray\" variant=\"subtle\">{type.type}</Badge>\n            </Box>\n        );\n    }\n\n    // Complex types render as expandable nodes\n    const typeLabel = getTypeLabel(type, value);\n\n    // Array type\n    if (type.type === 'Array') {\n        const items = value as unknown[];\n        const elementType = type.value as EastTypeValue;\n        if (items.length === 0) {\n            return (\n                <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                    {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                    <Text as=\"span\" color=\"fg.muted\">[]</Text>\n                    <Badge size=\"xs\" colorPalette=\"brand\" variant=\"subtle\">Array[0]</Badge>\n                </Box>\n            );\n        }\n        return (\n            <Box>\n                <details>\n                    <summary style={{ cursor: 'pointer', padding: '2px 0', display: 'flex', alignItems: 'center', gap: '8px' }}>\n                        {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                        <Badge size=\"xs\" colorPalette=\"brand\" variant=\"subtle\">{typeLabel}</Badge>\n                    </summary>\n                    <Box pl={4}>\n                        {items.map((item, index) => (\n                            <Box\n                                key={index}\n                                py={1}\n                                borderBottom={index < items.length - 1 ? '1px solid' : undefined}\n                                borderColor=\"border.strong\"\n                            >\n                                <ValueNode\n                                    type={elementType}\n                                    value={item}\n                                    label={`[${index}]`}\n                                    depth={depth + 1}\n                                />\n                            </Box>\n                        ))}\n                    </Box>\n                </details>\n            </Box>\n        );\n    }\n\n    // Struct type\n    if (type.type === 'Struct') {\n        const fields = type.value as Array<{ name: string; type: EastTypeValue }>;\n        const obj = value as Record<string, unknown>;\n        if (fields.length === 0) {\n            return (\n                <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                    {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                    <Text as=\"span\" color=\"fg.muted\">{'{}'}</Text>\n                    <Badge size=\"xs\" colorPalette=\"warning\" variant=\"subtle\">Struct</Badge>\n                </Box>\n            );\n        }\n        return (\n            <Box>\n                <details>\n                    <summary style={{ cursor: 'pointer', padding: '2px 0', display: 'flex', alignItems: 'center', gap: '8px' }}>\n                        {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                        <Badge size=\"xs\" colorPalette=\"warning\" variant=\"subtle\">{typeLabel}</Badge>\n                    </summary>\n                    <Box pl={4}>\n                        {fields.map((field) => (\n                            <ValueNode\n                                key={field.name}\n                                type={field.type}\n                                value={obj[field.name]}\n                                label={field.name}\n                                depth={depth + 1}\n                            />\n                        ))}\n                    </Box>\n                </details>\n            </Box>\n        );\n    }\n\n    // Variant type\n    if (type.type === 'Variant') {\n        const cases = type.value as Array<{ name: string; type: EastTypeValue }>;\n        const chosen = value as variant;\n        const activeCase = cases.find(c => c.name === chosen.type);\n        if (!activeCase) {\n            return (\n                <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                    {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                    <Text as=\"span\" color=\"fg.danger\">Unknown variant: {chosen.type}</Text>\n                </Box>\n            );\n        }\n        // If the variant value is Null, render inline\n        if (activeCase.type.type === 'Null') {\n            return (\n                <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                    {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                    <Badge size=\"xs\" colorPalette=\"brand\" variant=\"subtle\">.{chosen.type}</Badge>\n                </Box>\n            );\n        }\n        return (\n            <Box>\n                <details>\n                    <summary style={{ cursor: 'pointer', padding: '2px 0', display: 'flex', alignItems: 'center', gap: '8px' }}>\n                        {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                        <Badge size=\"xs\" colorPalette=\"brand\" variant=\"subtle\">.{chosen.type}</Badge>\n                    </summary>\n                    <Box pl={4}>\n                        <ValueNode\n                            type={activeCase.type}\n                            value={chosen.value}\n                            depth={depth + 1}\n                        />\n                    </Box>\n                </details>\n            </Box>\n        );\n    }\n\n    // Dict type (Map)\n    if (type.type === 'Dict') {\n        const map = value as Map<unknown, unknown>;\n        const keyType = (type.value as { key: EastTypeValue; value: EastTypeValue }).key;\n        const valueType = (type.value as { key: EastTypeValue; value: EastTypeValue }).value;\n        if (map.size === 0) {\n            return (\n                <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                    {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                    <Text as=\"span\" color=\"fg.muted\">{'Map{}'}</Text>\n                    <Badge size=\"xs\" colorPalette=\"info\" variant=\"subtle\">Dict[0]</Badge>\n                </Box>\n            );\n        }\n        const entries = Array.from(map.entries()) as [unknown, unknown][];\n        return (\n            <Box>\n                <details>\n                    <summary style={{ cursor: 'pointer', padding: '2px 0', display: 'flex', alignItems: 'center', gap: '8px' }}>\n                        {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                        <Badge size=\"xs\" colorPalette=\"info\" variant=\"subtle\">{typeLabel}</Badge>\n                    </summary>\n                    <Box pl={4}>\n                        {entries.map(([k, v], i) => (\n                            <Box\n                                key={i}\n                                py={2}\n                                borderBottom={i < entries.length - 1 ? '1px solid' : undefined}\n                                borderColor=\"border.strong\"\n                            >\n                                <ValueNode type={keyType} value={k} depth={depth + 1} />\n                                <ValueNode type={valueType} value={v} depth={depth + 1} />\n                            </Box>\n                        ))}\n                    </Box>\n                </details>\n            </Box>\n        );\n    }\n\n    // Set type\n    if (type.type === 'Set') {\n        const set = value as Set<unknown>;\n        const elementType = type.value as EastTypeValue;\n        if (set.size === 0) {\n            return (\n                <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                    {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                    <Text as=\"span\" color=\"fg.muted\">{'Set{}'}</Text>\n                    <Badge size=\"xs\" colorPalette=\"brand\" variant=\"subtle\">Set[0]</Badge>\n                </Box>\n            );\n        }\n        const items = Array.from(set);\n        return (\n            <Box>\n                <details>\n                    <summary style={{ cursor: 'pointer', padding: '2px 0', display: 'flex', alignItems: 'center', gap: '8px' }}>\n                        {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                        <Badge size=\"xs\" colorPalette=\"brand\" variant=\"subtle\">{typeLabel}</Badge>\n                    </summary>\n                    <Box pl={4}>\n                        {items.map((item, i) => (\n                            <Box\n                                key={i}\n                                py={1}\n                                borderBottom={i < items.length - 1 ? '1px solid' : undefined}\n                                borderColor=\"border.strong\"\n                            >\n                                <ValueNode\n                                    type={elementType}\n                                    value={item}\n                                    depth={depth + 1}\n                                />\n                            </Box>\n                        ))}\n                    </Box>\n                </details>\n            </Box>\n        );\n    }\n\n    // Ref type\n    if (type.type === 'Ref') {\n        const ref = value as { value: unknown };\n        return (\n            <Box>\n                <details>\n                    <summary style={{ cursor: 'pointer', padding: '2px 0', display: 'flex', alignItems: 'center', gap: '8px' }}>\n                        {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                        <Badge size=\"xs\" colorPalette=\"danger\" variant=\"subtle\">Ref</Badge>\n                    </summary>\n                    <Box pl={4}>\n                        <ValueNode\n                            type={type.value as EastTypeValue}\n                            value={ref.value}\n                            depth={depth + 1}\n                        />\n                    </Box>\n                </details>\n            </Box>\n        );\n    }\n\n    // Function types\n    if (type.type === 'Function' || type.type === 'AsyncFunction') {\n        return (\n            <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n                {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n                <Text as=\"span\" color=\"fg.muted\">[function]</Text>\n                <Badge size=\"xs\" colorPalette=\"gray\" variant=\"subtle\">{type.type}</Badge>\n            </Box>\n        );\n    }\n\n    // Fallback for unknown types\n    return (\n        <Box py={0.5} display=\"flex\" alignItems=\"center\" gap={2}>\n            {label && <Text as=\"span\" color=\"accent.purple\" fontWeight=\"medium\">{label}:</Text>}\n            <Text as=\"span\" color=\"fg.muted\">[{type.type}]</Text>\n        </Box>\n    );\n}\n\n// Main component\nexport function EastValueViewer({ type, value }: EastValueViewerProps) {\n    return (\n        <Box\n            layerStyle=\"surface.code.dark\"\n            fontFamily=\"mono\"\n            fontSize=\"body.lg\"\n            p={4}\n            overflow=\"auto\"\n            maxHeight=\"100%\"\n        >\n            <ValueNode type={type} value={value} depth={0} />\n        </Box>\n    );\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,164,165,173,174,175,176,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,490,491,492,493,494,495,496,497,498,499,500,501,704,705],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAI,eAAe,MAAM;CACvB,cAAc;EACZ,KAAK,4BAA4B,IAAI,IAAI;EACzC,KAAK,YAAY,KAAK,UAAU,KAAK,IAAI;CAC3C;CACA,UAAU,UAAU;EAClB,KAAK,UAAU,IAAI,QAAQ;EAC3B,KAAK,YAAY;EACjB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ACvwB;AACA,IAAI,mBAAmB;AACvB,IAAI,WAAW;CACb,QAAQ;CACR,UAAU;CACV,MAAM;EAAC;EAAK;EAAK,CAAC,QAAQ,cAAc;EAAG;EAAQ;CAAmN;AACxQ;AACA,IAAI,gBAAgB;AACpB,IAAI,cAAc;CAChB,QAAQ;CACR,UAAU;CACV,MAAM;EAAC;EAAK;EAAK,CAAC,OAAO;EAAG;EAAQ;CAA2P;AACjS;AACA,IAAI,UAAU;AACd,IAAI,iBAAiB;CACnB,QAAQ;CACR,UAAU;CACV,MAAM;EAAC;EAAK;EAAK,CAAC;EAAG;EAAQ;CAAwwB;AACvyB;AACA,IAAI,iBAAiB;CACnB,QAAQ;CACR,UAAU;CACV,MAAM;EAAC;EAAK;EAAK,CAAC,QAAQ,eAAe;EAAG;EAAQ;CAAiZ;AACvc;AA2BA,IAAI,QAAQ;CACL;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACS;CACJ;CACH;CACA;CACQ;CACL;CACC;CACI;CACA;CACC;CACC;CACL;CACJ;CACM;CACP;CACU;CACR;CACQ;CACP;CACD;CACD;CACU;CACP;CACK;CACI;CACR;CACE;CACU;CACP;CACD;CACD;CACL;CACG;CACQ;CACL;CACM;CACL;CACH;CACL;CACG;CACC;CACK;CACC;CACN;CACA;CACG;CACJ;CACE;CACA;CACP;CACI;CACM;CACD;CACT;CACO;CACA;CACH;CACF;CACC;CACG;CACH;CACF;CACE;CACa;CACF;CACH;CACN;CACJ;CACW;CACA;CACX;CACH;CACW;CACC;CACU;CACX;CACD;CACG;CACZ;CACa;CACJ;CACR;CACE;CACS;CACG;CACR;CACA;CACA;CACE;CACL;CACI;CACA;CACN;CACI;CACA;CACU;CACN;CACT;CACK;CACM;CACR;CACO;CACF;CACK;CACL;CACL;CACG;CACC;CACW;CACf;CACC;CACG;CACJ;CACG;CACJ;CACG;CACD;CACH;CACI;CACK;CACD;CACS;CACR;CACE;CACH;CACD;CACK;CACN;CACC;CACA;CACI;CACK;CACf;CACY;CACP;CACA;CACA;CACO;CACF;CACL;CACJ;CACG;CACI;CACN;CACD;CACG;CACC;CACA;CACa;CAChB;CACI;CACA;CACL;CACF;CACU;CACP;CACQ;CACT;CACI;CACL;CACI;CACD;CACY;CACJ;CACT;CACC;CACF;CACC;CACM;CACH;CACL;CACE;CACO;CACA;CACR;CACM;CACA;CACR;CACI;CACE;CACF;CACe;CACb;CACH;CACE;CACN;CACQ;CACJ;CACC;CACC;CACC;CACH;CACG;CACA;CACC;CACJ;CACF;CACe;CACP;CACC;CACF;CACF;CACC;CACR;CACA;CACC;CACW;CACT;CACG;CACG;CACP;CACG;CACE;CACP;CACG;CACM;CACP;CACI;CACG;CACH;CACE;CACD;CACN;CACW;CACd;CACM;CACD;CACG;CACgB;CACV;CACZ;CACE;CACO;CACD;CACI;CACX;CACA;CACA;CACH;CACG;CACQ;CACN;CACQ;CACJ;CACC;CACD;CACA;CACJ;CACS;CACD;CACM;CACJ;CACH;CACR;CACG;CACG;CACC;CACE;CACA;CACJ;CACI;CACN;CACC;CACH;CACG;CACA;CACF;CACA;CACM;CACJ;CACH;CACC;CACJ;CACM;CACC;CACF;CACG;CACN;CACI;CACY;CAChB;CACM;CACJ;CACJ;CACa;CACX;CACe;CACN;CACC;CACJ;CACJ;CACD;CACG;CACC;CACL;CACC;CACI;CACA;CACE;CACL;CACM;CACF;CACN;CACK;CACD;CACA;CACA;CACS;CACjB;CACW;CACA;CACL;CACH;CACE;CACM;CACJ;CACO;CACJ;CACL;CACE;CACA;CACE;CACA;CACD;CACE;CACJ;CACU;CACZ;CACM;CACJ;CACS;CACN;CACa;CACP;CACP;CACa;CACG;CACJ;CACb;CACC;CACK;CACA;CACL;CACH;CACgB;CACZ;CACP;CACG;CACA;CACI;CACL;CACG;CACC;CACA;CACD;CACK;CACJ;CACE;CACD;CACG;CACJ;CACE;CACP;CACO;CACA;CACM;CACJ;CACG;CACV;CACgB;CACF;CACR;CACP;CACI;CACL;CACS;CACJ;CACI;CACJ;CACA;CACC;CACD;CACA;CACW;CACT;CACA;CACC;CACA;CACA;CACJ;CACY;CACY;CACjB;CACsB;CAClB;CACb;CACA;CACG;CACJ;CACc;CACN;CACH;CACA;CACD;CACJ;CACA;CACA;CACU;CACA;CACJ;CACH;CACG;CACI;CACI;CACV;CACI;CACL;CACI;CACJ;CACA;CACH;CACE;CACN;CACS;CACF;CACH;CACmB;CACZ;CACA;CACY;CACvB;CACU;CACC;CACN;CACW;CACN;CACH;CACD;CACG;CACL;CACM;CACK;CACH;CACC;CACF;CACT;CACS;CACD;CACP;CACO;CACE;CACT;CACO;CACA;CACH;CACF;CACK;CACG;CACN;CACC;CACC;CACM;CACL;CACP;CACe;CACT;CACL;CACK;CACF;CACJ;CACM;CACF;CACC;CACH;CACG;CACF;CACF;CACA;CACK;CACI;CACF;CACI;CACX;CACM;CACD;CACM;CACC;CACN;CACW;CACd;CACC;CACA;CACD;CACO;CACF;CACT;CACA;CACS;CACM;CACb;CACC;CACA;CACD;CACQ;CACF;CACJ;CACG;CACC;CACG;CACC;CACR;CACG;CACL;CACF;CACW;CACR;CACE;CACH;CACG;CACF;CACN;CACI;CACM;CACF;CACD;CACM;CACA;CACN;CACG;CACD;CACA;CACE;CACL;CACC;CACD;CACG;CACC;CACA;CACA;CACO;CACF;CACT;CACJ;CACA;CACU;CACN;CACM;CACF;CACH;CACE;CACL;CACM;CACF;CACA;CACU;CACP;CACE;CACD;CACH;CACN;CACM;CACD;CACS;CACL;CACD;CACH;CACH;CACG;CACK;CACN;CACE;CACH;CACE;CACJ;CACK;CACN;CACE;CACG;CACA;CACF;CACS;CACJ;CACC;CACJ;CACW;CACZ;CACC;CACS;CACN;CACN;CACC;CACO;CACR;CACE;CACD;CACG;CACA;CACA;CACL;CACK;CACM;CACR;CACD;CACA;CACD;CACK;CACF;CACD;CACS;CACG;CACZ;CACG;CACO;CACN;CACD;CACA;CACP;CACG;CACI;CACc;CACJ;CACV;CACE;CACN;CACQ;CACN;CACO;CACJ;CACP;CACI;CACL;CACY;CACf;CACS;CACK;CACL;CACC;CACA;CACA;CACJ;CACQ;CACZ;CACQ;CACJ;CACK;CACF;CACL;CACY;CACR;CACG;CACL;CACC;CACC;CACH;CACO;CACA;CACF;CACF;CACD;CACA;CACL;CACC;CACY;CACR;CACD;CACJ;CACA;CACA;CACA;CACI;CACG;CACK;CACF;CACT;CACS;CACH;CACC;CACK;CACJ;CACH;CACE;CACC;CACD;CACE;CACJ;CACO;CACA;CACZ;CACM;CACJ;CACC;CACY;CACN;CACN;CACJ;CACK;CACI;CACP;CACC;CACI;CACI;CACR;CACG;CACiB;CACnB;CACG;CACK;CACR;CACC;CACA;CACD;CACI;CACD;CACK;CACA;CACD;CACN;CACE;CACF;CACC;CACO;CACA;CACJ;CACA;CACE;CACV;CACU;CACJ;CACQ;CACT;CACI;CACR;CACO;CACC;CACP;CACS;CACH;CACA;CACG;CACE;CACJ;CACI;CACN;CACA;CACA;CACA;CACN;CACK;CACH;CACJ;CACmB;CACnB;CACK;CACH;CACW;CACE;CACJ;CACA;CACN;CACC;CACL;CACK;CACE;CACA;CACF;CACA;CACI;CACD;CACJ;CACQ;CACJ;CACA;CACI;CACN;CACC;CACE;CACG;CACN;CACA;CACI;CACJ;CACG;CACA;CACE;CACT;CACI;CACA;CACA;CACA;CACO;CACF;CACH;CACJ;CACI;CACG;CACT;CACK;CACD;CACC;CACM;CACX;CACY;CACR;CACL;CACU;CACR;CACD;CACQ;CACA;CACL;CACO;CACL;CACN;CACC;CACO;CACC;CACJ;CACO;CACM;CACd;CACH;CACG;CACQ;CACA;CACb;CACD;CACM;CACG;CACC;CACL;CACA;CACA;CACJ;CACC;CACO;CACA;CACX;CACS;CACA;CACG;CACN;CACH;CACK;CACH;CACI;CACA;CACJ;CACG;CACJ;CACgB;CACT;CACJ;CACH;CACE;CACC;CACC;CACA;CACK;CACA;CACJ;CACA;CACA;CACF;CACA;CACK;CACA;CACJ;CACG;CACD;CACJ;CACA;CACQ;CACA;CACX;CACD;CACc;CACZ;CACY;CACA;CACH;CACA;CACF;CACH;CACE;CACC;CACN;CACU;CACN;CACN;CACM;CACO;CACJ;CACL;CACI;CACgB;CACnB;CACF;CACK;CACD;CACD;CACJ;CACE;CACE;CACD;CACA;CACI;CACD;CACH;CACJ;CACS;CACP;CACK;CACE;CACJ;CACC;CACM;CACL;CACN;CACK;CACI;CACA;CACK;CACV;CACC;CACP;CACM;CACA;CACL;CACC;CACA;CACG;CACI;CACL;CACF;CACE;CACA;CACQ;CACf;CACU;CACC;CACA;CACA;CACR;CACW;CACE;CACT;CACG;CACH;CACE;CACK;CACP;CACI;CACP;CACG;CACC;CACD;CACU;CACA;CACb;CACG;CACgB;CACf;CACC;CACL;CACF;CACG;CACS;CACL;CACE;CACE;CACA;CACA;CACH;CACL;CACE;CACA;CACE;CACR;CACI;CACM;CACG;CACN;CACF;CACK;CACA;CACJ;CACC;CACO;CACV;CACQ;CACJ;CACA;CACQ;CACN;CACL;CACW;CACd;CACa;CACR;CACI;CACA;CACE;CACV;CACG;CACS;CACX;CACA;CACO;CACJ;CACJ;CACM;CACI;CACP;CACU;CACT;CACQ;CACI;CAChB;CACO;CACE;CACJ;CACD;CACC;CACJ;CACE;CACA;CACQ;CACJ;CACJ;CACU;CACL;CACH;CACD;CACR;CACoB;CACf;CACD;CACD;CACG;CACE;CACF;CACF;CACA;CACO;CACH;CACL;CACO;CACH;CACF;CACI;CACQ;CACN;CACA;CACM;CACX;CACC;CACF;CACL;CACG;CACS;CACN;CACM;CACJ;CACL;CACE;CACG;CACJ;CACS;CACF;CACA;CACD;CACA;CACE;CACQ;CACJ;CACJ;CACG;CACL;CACH;CACQ;CACR;CACC;CACJ;CACA;CACW;CACa;CACnB;CACS;CACT;CACD;CACL;CACI;CACO;CACH;CACF;CACN;CACgB;CACA;CACF;CACZ;CACF;CACG;CACE;CACA;CACH;CACS;CACP;CACC;CACM;CACH;CACA;CACG;CACT;CACmB;CACV;CACN;CACC;CACA;CACD;CACJ;CACG;CACD;CACD;CACA;CACK;CACI;CACX;CACA;CACA;CACW;CACC;CACD;CACA;CACV;CACJ;CACU;CACD;CACC;CACJ;CACM;CACN;CACE;CACI;CACI;CACP;CACF;CACE;CACD;CACG;CACG;CACH;CACN;CACK;CACA;CACN;CACa;CACZ;CACL;CACY;CACJ;CACD;CACW;CACJ;CACN;CACO;CACf;CACK;CACO;CACF;CACG;CACG;CACR;CACE;CACN;CACI;CACS;CACH;CACV;CACC;CACE;CACI;CACA;CACJ;CACK;CACA;CACH;CACQ;CACP;CACN;CACA;CACG;CACF;CACD;CACC;CACc;CACb;CACC;CACC;CACG;CACH;CACF;CACH;CACK;CACF;CACC;CACM;CACS;CACT;CACH;CACH;CACE;CACN;CACI;CACJ;CACG;CACG;CACS;CACX;CACJ;CACD;CACQ;CACA;CACJ;CACG;CACD;CACL;CACG;CACU;CACA;CACX;CACO;CACJ;CACH;CACH;CACE;CACW;CACb;CACE;CACC;CACM;CACI;CACL;CACA;CACA;CACA;CACQ;CACR;CACO;CACb;CACA;CACI;CACJ;CACa;CACR;CACG;CACG;CACJ;CACH;CACG;CACN;CACQ;CACJ;CACA;CACG;CACJ;CACL;CACY;CACL;CACJ;CACM;CACR;CACa;CACR;CACE;CACA;CACD;CACA;CACH;CACI;CACa;CACV;CACF;CACL;CACI;CACG;CACJ;CACG;CACE;CACL;CACD;CACF;CACC;CACC;CACL;CACC;CACF;CACK;CACK;CACV;CACS;CACF;CACP;CACH;CACW;CACG;CACH;CACX;CACG;CACO;CACL;CACI;CACA;CACA;CACG;CACG;CACb;CACW;CACL;CACG;CACD;CACF;CACA;CACD;CACC;CACQ;CACL;CACG;CACX;CACI;CACO;CACR;CACC;CACM;CACD;CACG;CACJ;CACA;CACH;CACM;CACD;CACI;CACP;CACF;CACE;CACA;CACC;CACH;CACD;CACH;CACO;CACS;CACP;CACA;CACP;CACI;CACD;CACF;CACA;CACJ;CACM;CACL;CACE;CACA;CACK;CACM;CACA;CACX;CACE;CACS;CACJ;CACb;CACiB;CACJ;CACG;CACJ;CACH;CACL;CACO;CACF;CACG;CACI;CACK;CACR;CACI;CACV;CACA;CACC;CACK;CACH;CACE;CACF;CACG;CACC;CACN;CACQ;CACA;CACH;CACL;CACK;CACG;CACG;CACT;CACJ;CACI;CACE;CACG;CACX;CAC4B;CACjB;CACD;CACH;CACA;CACH;CACE;CACF;CACM;CACb;CACQ;CACL;CACE;CACF;CACD;CACA;CACe;CACA;CACZ;CACgB;CACV;CACF;CACN;CACQ;CACD;CACH;CACH;CACD;CACE;CACN;CACG;CACO;CACD;CACF;CACE;CACH;CACD;CACO;CACN;CACC;CACE;CACA;CACI;CACP;CACA;CACD;CACI;CACC;CACE;CACZ;CACgB;CACV;CACS;CACN;CACE;CACE;CACE;CACH;CACA;CACJ;CACC;CACC;CACA;CACH;CACG;CACN;CACG;CACA;CACL;CACA;CACkB;CACd;CACQ;CACJ;CACN;CACG;CACK;CACR;CACC;CACD;CACS;CACF;CACE;CACJ;CACE;CACO;CACX;CACE;CACW;CACH;CACP;CACC;CACI;CACT;CACY;CACX;CACA;CACI;CACA;CACJ;CACG;CACJ;CACC;CACE;CACE;CACJ;CACO;CACA;CACX;CACI;CACE;CACH;CACC;CACI;CACH;CACF;CACA;CACC;CACI;CACN;CACQ;CACJ;CACO;CACH;CACA;CACN;CACS;CACD;CACH;CACH;CACL;CACM;CACH;CACJ;CACM;CACD;CACO;CACJ;CACD;CACI;CACG;CACN;CACL;CACH;CACQ;CACE;CACN;CACJ;CACG;CACE;CACA;CACJ;CACM;CACV;CACQ;CACJ;CACgB;CACT;CACA;CACN;CACG;CACG;CACE;CACL;CACA;CACE;CACR;CACS;CACL;CACA;CACN;CACc;CACJ;CACe;CACf;CACN;CACF;CACc;CACJ;CACN;CACU;CACA;CACR;CACQ;CACJ;CACT;CACU;CACE;CACR;CACH;CACM;CACJ;CACD;CACG;CACG;CACP;CACD;CACD;CACC;CACK;CACM;CACJ;CACR;CACO;CACA;CACK;CACR;CACJ;CACC;CACW;CACN;CACE;CACD;CACJ;CACU;CACA;CACE;CACd;CACG;CACD;CACI;CACQ;CACL;CACC;CACL;CACR;CACU;CACJ;CACC;CACA;CACC;CACE;CACC;CACJ;CACJ;CACG;CACK;CACJ;CACG;CACA;CACC;CACN;CACG;CACA;CACC;CACL;CACC;CACI;CACE;CACH;CACG;CACJ;CACG;CACJ;CACC;CACW;CACR;CACF;CACD;CACA;CACE;CACL;CACC;CACF;CACD;CACA;CACO;CACM;CACD;CACA;CACA;CACI;CACf;CACK;CACJ;CACA;CACJ;CACM;CACA;CACe;CACf;CACH;CACQ;CACR;CACa;CACV;CACgB;CACd;CACL;CACC;CACK;CACM;CACH;CACD;CACH;CACI;CACA;CACF;CACH;CACL;CACG;CACM;CACJ;CACL;CACY;CACP;CACQ;CACL;CACI;CACN;CACJ;CACK;CACK;CACP;CACK;CACL;CACE;CACJ;CACG;CACI;CACF;CACoB;CACT;CACV;CACS;CACT;CACJ;CACG;CACT;CACQ;CACJ;CACM;CACN;CACQ;CACP;CACD;CACG;CACI;CACN;CACD;CACQ;CACH;CACA;CACP;CACQ;CACA;CACN;CACE;CACJ;CACQ;CACL;CACE;CACJ;CACW;CACV;CACE;CACC;CACM;CACX;CACO;CACL;CACI;CACP;CACM;CACG;CACQ;CACZ;CACK;CACH;CACL;CACI;CACG;CACP;CACJ;CACQ;CACG;CACH;CACP;CACS;CACO;CACT;CACD;CACa;CAChB;CACK;CACE;CACJ;CACQ;CACP;CACD;CACG;CACK;CACT;CACG;CACM;CACT;CACC;CACD;CACE;CACJ;CACK;CACI;CACF;CACH;CACE;CACC;CACS;CACX;CACO;CACZ;CACC;CACF;CACG;CACK;CACA;CACL;CACG;CACD;CACC;CACG;CACJ;CACS;CACb;CACG;CACK;CACP;CACO;CACD;CACO;CACT;CACC;CACH;CACQ;CACE;CACV;CACU;CACT;CACM;CACL;CACI;CACJ;CACK;CACT;CACI;CACE;CACJ;CACA;CACF;CACG;CACJ;CACQ;CACE;CACD;CACL;CACJ;CACI;CACF;CACF;CACE;CACG;CACQ;CACP;CACJ;CACI;CACL;CACG;CACA;CACE;CACP;CACH;CACU;CACA;CACE;CACD;CACL;CACH;CACO;CACL;CACE;CACE;CACL;CACK;CACH;CACY;CACb;CACA;CACM;CACF;CACN;CACU;CACA;CACD;CACF;CACL;CACE;CACK;CACD;CACD;CACC;CACC;CACJ;CACE;CACA;CACC;CACA;CACI;CACF;CACC;CACR;CACJ;CACS;CACD;CACR;CACY;CACT;CACK;CACC;CACR;CACI;CACJ;CACc;CACP;CACJ;CACI;CACM;CACA;CACd;CACE;CACO;CACJ;CACQ;CACD;CACJ;CACK;CACJ;CACT;CACM;CACC;CACA;CACA;CACH;CACC;CACM;CACH;CACS;CACL;CACD;CACL;CACK;CACR;CACQ;CACH;CACN;CACD;CACM;CACE;CACP;CACO;CACL;CACA;CACM;CACT;CACK;CACI;CACL;CACA;CACE;CACQ;CACT;CACQ;CACH;CACR;CACK;CACF;CACJ;CACO;CACA;CACA;CACL;EAp+DX,QAAQ;EACR,UAAU;EACV,MAAM;GAAC;GAAK;GAAK,CAAC,MAAM;GAAG;GAAQ;EAAiS;CAk+DzT;CACI;EAh+Df,QAAQ;EACR,UAAU;EACV,MAAM;GAAC;GAAK;GAAK,CAAC;GAAG;GAAQ;EAAulB;CA89DrmB;CACD;EA59Dd,QAAQ;EACR,UAAU;EACV,MAAM;GAAC;GAAK;GAAK,CAAC,GAAG;GAAG;GAAQ;EAA0T;CA09D5U;CACC;EAx9Df,QAAQ;EACR,UAAU;EACV,MAAM;GAAC;GAAK;GAAK,CAAC;GAAG;GAAQ;EAA0qB;CAs9DxrB;CACQ;EAp9DvB,QAAQ;EACR,UAAU;EACV,MAAM;GAAC;GAAK;GAAK,CAAC;GAAG;GAAQ;EAAwa;CAk9D9a;AACzB;;;;;;;;;;;;AC97SA,IAAa,mBAAqD;CAC9D,SAAa;CACb,aAAa;CACb,UAAa;CACb,WAAa;CACb,KAAa;CACb,OAAa;CACb,MAAa;CACb,UAAa;CACb,QAA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